summaryrefslogtreecommitdiff
path: root/graphics/asymptote
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-11-13 03:03:42 +0000
committerNorbert Preining <norbert@preining.info>2024-11-13 03:03:42 +0000
commit5037cc8f66c1c2dfc56accf0f29866977fce1f11 (patch)
tree916c5b917a84c268d98a6176a93f0a4c3e63a102 /graphics/asymptote
parentd63a87aba38d505e5b1322a0fd3b93549e7cb203 (diff)
CTAN sync 202411130303
Diffstat (limited to 'graphics/asymptote')
-rw-r--r--graphics/asymptote/CMakeLists.txt92
-rw-r--r--graphics/asymptote/CMakePresets.json191
-rw-r--r--graphics/asymptote/ChangeLog3399
-rw-r--r--graphics/asymptote/EXRFiles.h2
-rw-r--r--graphics/asymptote/GUI/ContextWindow.py16
-rw-r--r--graphics/asymptote/GUI/CustMatTransform.py2
-rw-r--r--graphics/asymptote/GUI/SetCustomAnchor.py2
-rw-r--r--graphics/asymptote/GUI/Widg_addLabel.py2
-rw-r--r--graphics/asymptote/GUI/Widg_addPolyOpt.py2
-rw-r--r--graphics/asymptote/GUI/Widg_editBezier.py2
-rw-r--r--graphics/asymptote/GUI/Window1.py19
-rw-r--r--graphics/asymptote/GUI/buildtool.py124
-rw-r--r--graphics/asymptote/GUI/configs/xasyconfig.cson17
-rw-r--r--graphics/asymptote/GUI/icons_rc.py2903
-rw-r--r--graphics/asymptote/GUI/labelEditor.py2
-rw-r--r--graphics/asymptote/GUI/pyUIClass/custMatTransform.py175
-rw-r--r--graphics/asymptote/GUI/pyUIClass/labelTextEditor.py121
-rw-r--r--graphics/asymptote/GUI/pyUIClass/setCustomAnchor.py57
-rw-r--r--graphics/asymptote/GUI/pyUIClass/widg_addLabel.py142
-rw-r--r--graphics/asymptote/GUI/pyUIClass/widg_addPolyOpt.py61
-rw-r--r--graphics/asymptote/GUI/pyUIClass/widg_editBezier.py96
-rw-r--r--graphics/asymptote/GUI/pyUIClass/widgetPointEditor.py98
-rw-r--r--graphics/asymptote/GUI/pyUIClass/window1.py1013
-rw-r--r--graphics/asymptote/GUI/requirements.dev.txt2
-rw-r--r--graphics/asymptote/GUI/requirements.txt7
-rw-r--r--graphics/asymptote/GUI/setup.py4
-rwxr-xr-xgraphics/asymptote/GUI/xasy.py7
-rw-r--r--graphics/asymptote/GUI/xasy2asy.py51
-rw-r--r--graphics/asymptote/GUI/xasyArgs.py9
-rw-r--r--graphics/asymptote/GUI/xasyFile.py20
-rw-r--r--graphics/asymptote/GUI/xasyOptions.py17
-rw-r--r--graphics/asymptote/GUI/xasySvg.py38
-rw-r--r--graphics/asymptote/INSTALL275
-rw-r--r--graphics/asymptote/INSTALL-WIN.md250
-rw-r--r--graphics/asymptote/INSTALL.md118
-rw-r--r--graphics/asymptote/LspCpp/CMakeLists.txt363
-rw-r--r--graphics/asymptote/LspCpp/LICENSE21
-rw-r--r--graphics/asymptote/LspCpp/README.md53
-rw-r--r--graphics/asymptote/LspCpp/examples/StdIOClientExample.cpp219
-rw-r--r--graphics/asymptote/LspCpp/examples/StdIOServerExample.cpp161
-rw-r--r--graphics/asymptote/LspCpp/examples/TcpServerExample.cpp209
-rw-r--r--graphics/asymptote/LspCpp/examples/WebsocketExample.cpp296
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Cancellation.h23
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Condition.h48
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Context.h216
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Endpoint.h53
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/GCThreadContext.h19
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageIssue.h182
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageJsonHandler.h61
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageProducer.h20
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/NotificationInMessage.h62
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RemoteEndPoint.h350
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RequestInMessage.h70
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/ScopeExit.h59
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/StreamMessageProducer.h91
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/TcpServer.h40
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/WebSocketServer.h87
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/future.h178
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/json.h81
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsRequestId.h51
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsResponseMessage.h71
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/macro_map.h134
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/message.h34
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/optionalVersion.h13
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/serializer.h372
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/stream.h196
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h250
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/traits.h158
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/AbsolutePath.h27
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ClientPreferences.h310
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/CodeActionParams.h114
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/Directory.h13
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ExecuteCommandParams.h20
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/IProgressMonitor.h143
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/Markup.h119
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/string_ref.h1061
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ParentProcessWatcher.h17
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ProcessIoService.h48
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ProtocolJsonHandler.h11
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/ResourceOperation.h121
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/SimpleTimer.h49
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/client/registerCapability.h49
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/client/unregisterCapability.h41
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/Move.h14
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/OverridableMethod.h34
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/WorkspaceSymbolParams.h13
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/addOverridableMethods.h19
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/buildWorkspace.h17
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkConstructorsStatus.h29
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkDelegateMethodsStatus.h29
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkHashCodeEqualsStatus.h36
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkToStringStatus.h24
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/classFileContents.h10
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/codeActionResult.h22
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/executeCommand.h29
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/findLinks.h22
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateAccessors.h19
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateConstructors.h19
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateDelegateMethods.h25
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateHashCodeEquals.h25
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateToString.h18
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getMoveDestinations.h65
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getRefactorEdit.h77
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/listOverridableMethods.h17
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/organizeImports.h12
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/projectConfigurationUpdate.h13
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/resolveUnimplementedAccessors.h24
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/searchSymbols.h27
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/sonarlint/protocol.h176
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/InitializeParams.h128
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/exit.h7
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialize.h39
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialized.h13
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsClientCapabilities.h48
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsServerCapabilities.h589
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsTextDocumentClientCapabilities.h713
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsWorkspaceClientCapabilites.h256
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/progress.h16
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/general/shutdown.h15
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/language/language.h170
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h63
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lru_cache.h151
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsAny.h159
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCodeAction.h58
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCommand.h44
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsDocumentUri.h26
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsFormattingOptions.h43
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsMarkedString.h45
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsPosition.h40
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsRange.h32
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsResponseError.h117
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentEdit.h24
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentIdentifier.h14
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentItem.h26
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentPositionParams.h26
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h87
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsVersionedTextDocumentIdentifier.h32
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsWorkspaceEdit.h57
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_code_action.h64
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_completion.h224
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_diagnostic.h152
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/method_type.h7
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/out_list.h22
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/symbol.h164
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/SemanticTokens.h267
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/callHierarchy.h121
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_action.h37
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_lens.h42
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/colorPresentation.h63
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/completion.h82
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/declaration_definition.h29
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/didRenameFiles.h44
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_change.h51
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_close.h33
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_open.h39
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_save.h31
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/documentColor.h73
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_link.h44
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_symbol.h55
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/foldingRange.h62
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/formatting.h32
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/highlight.h18
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/hover.h55
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/implementation.h16
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/linkedEditingRange.h51
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/onTypeFormatting.h44
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/prepareRename.h40
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/publishDiagnostics.h28
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/range_formatting.h35
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/references.h48
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/rename.h41
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCodeLens.h10
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCompletionItem.h21
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveTypeHierarchy.h31
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/selectionRange.h52
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/semanticHighlighting.h66
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/signature_help.h92
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/typeHierarchy.h133
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/type_definition.h16
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/willSave.h71
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/utils.h141
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/windows/MessageNotify.h83
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/working_files.h72
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/applyEdit.h42
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/configuration.h37
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/didChangeWorkspaceFolders.h48
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_configuration.h25
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_watched_files.h46
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/execute_command.h24
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/symbol.h16
-rw-r--r--graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/workspaceFolders.h34
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/Context.cpp35
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/Endpoint.cpp46
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/GCThreadContext.cpp17
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/MessageJsonHandler.cpp57
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/RemoteEndPoint.cpp655
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/StreamMessageProducer.cpp297
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/TcpServer.cpp306
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/WebSocketServer.cpp337
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/message.cpp88
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/serializer.cpp214
-rw-r--r--graphics/asymptote/LspCpp/src/jsonrpc/threaded_queue.cpp20
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/Markup.cpp942
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/ParentProcessWatcher.cpp107
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/ProtocolJsonHandler.cpp716
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/initialize.cpp45
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/lsp.cpp1089
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/lsp_diagnostic.cpp75
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/textDocument.cpp349
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/utils.cpp612
-rw-r--r--graphics/asymptote/LspCpp/src/lsp/working_files.cpp186
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/CHANGELOG.md158
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/CMakeLists.txt251
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/CMakeModules/FindGTestSrc.cmake30
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSON.pc.in7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfig.cmake.in25
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfigVersion.cmake.in10
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/appveyor.yml102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/abcde.txt1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/glossary.json22
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/menu.json27
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/readme.txt1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/sample.json3315
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/webapp.json88
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/widget.json26
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/draft-04/schema150
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16be.jsonbin368 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16bebom.jsonbin370 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16le.jsonbin368 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16lebom.jsonbin370 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32be.jsonbin736 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32bebom.jsonbin740 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32le.jsonbin736 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32lebom.jsonbin740 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8.json7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8bom.json7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail1.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail10.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail11.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail12.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail13.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail14.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail15.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail16.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail17.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail18.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail19.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail2.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail20.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail21.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail22.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail23.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail24.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail25.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail26.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail27.json2
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail28.json2
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail29.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail3.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail30.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail31.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail32.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail33.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail4.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail5.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail6.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail7.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail8.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail9.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass1.json58
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass2.json1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass3.json6
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/readme.txt3
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/LICENSE19
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/README.md148
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/bin/jsonschema_suite283
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json3
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/integer.json3
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/subSchemas.json8
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json82
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json88
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/default.json49
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/dependencies.json108
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/disallow.json80
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json60
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/enum.json71
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/extends.json94
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/items.json46
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxItems.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxLength.json33
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maximum.json42
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minItems.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minLength.json33
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minimum.json42
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json107
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/format.json222
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json18
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json15
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/pattern.json34
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json110
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/properties.json92
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/ref.json159
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/refRemote.json74
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/required.json53
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/type.json474
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json79
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json82
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json88
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/allOf.json112
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/anyOf.json68
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/default.json49
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/definitions.json32
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/dependencies.json113
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/enum.json72
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/items.json46
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxItems.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxLength.json33
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maximum.json42
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minItems.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minLength.json33
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minProperties.json28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minimum.json42
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json60
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/not.json96
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/oneOf.json68
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json107
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/format.json148
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json15
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/pattern.json34
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json110
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/properties.json92
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/ref.json159
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/refRemote.json74
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/required.json39
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/type.json330
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json79
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tox.ini8
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/alotofkeys.json502
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/booleans.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/floats.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/guids.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/integers.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/mixed.json592
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/nulls.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/paragraphs.json102
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/readme.txt1
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/address.json138
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/allOf_address.json7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/anyOf_address.json7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/idandref.json69
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/oneOf_address.json7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/LICENSE45
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/README.md7
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/rapidjson.natvis38
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/CMakeLists.txt27
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.in2369
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.zh-cn.in2369
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.dot50
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.pngbin16569 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.dot65
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.pngbin37281 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.dot62
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.pngbin92378 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/makefile8
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.dot47
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.pngbin16081 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.dot62
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.pngbin41517 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.dot60
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.pngbin36371 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.dot56
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.pngbin32887 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.dot54
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.pngbin43670 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.dot58
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.pngbin44634 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.dot73
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.pngbin99993 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.md281
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.zh-cn.md285
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.md146
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.zh-cn.md152
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.md289
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.zh-cn.md290
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.md106
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.zh-cn.md103
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.md368
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.zh-cn.md363
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.pngbin5259 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.svg119
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/DoxygenLayout.xml194
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/doxygenextra.css274
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/footer.html11
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/header.html24
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/npm.md31
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.md26
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.zh-cn.md26
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.md234
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.zh-cn.md234
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.md509
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.zh-cn.md487
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.md513
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.zh-cn.md237
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.md429
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.zh-cn.md429
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.md536
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.zh-cn.md535
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/docker/debian/Dockerfile8
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/CMakeLists.txt46
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.cpp292
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.h145
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archivertest.cpp287
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/capitalize/capitalize.cpp67
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/condense/condense.cpp32
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkey/filterkey.cpp135
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkeydom/filterkeydom.cpp170
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/jsonx/jsonx.cpp207
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/lookaheadparser/lookaheadparser.cpp350
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/messagereader/messagereader.cpp105
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/parsebyparts/parsebyparts.cpp176
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/pretty/pretty.cpp30
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/prettyauto/prettyauto.cpp56
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/schemavalidator/schemavalidator.cpp199
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/serialize/serialize.cpp173
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/simpledom/simpledom.cpp29
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/simplepullreader/simplepullreader.cpp53
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/simplereader/simplereader.cpp42
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/simplewriter/simplewriter.cpp36
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/sortkeys/sortkeys.cpp62
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/traverseaspointer.cpp39
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/example/tutorial/tutorial.cpp151
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/allocators.h693
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/cursorstreamwrapper.h78
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/document.h3043
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodedstream.h299
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodings.h716
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/en.h176
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/error.h285
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filereadstream.h99
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filewritestream.h104
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/fwd.h151
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/biginteger.h297
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/clzll.h71
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/diyfp.h261
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/dtoa.h249
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/ieee754.h78
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/itoa.h308
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/meta.h186
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/pow10.h55
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/regex.h739
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/stack.h232
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strfunc.h83
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strtod.h293
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/swap.h46
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/istreamwrapper.h128
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorybuffer.h70
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorystream.h71
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/inttypes.h316
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/stdint.h300
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/ostreamwrapper.h81
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/pointer.h1476
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/prettywriter.h277
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/rapidjson.h741
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/reader.h2246
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/schema.h3262
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stream.h223
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stringbuffer.h121
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/uri.h481
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/writer.h710
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/include_dirs.js2
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/library.json15
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/license.txt57
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/package.json24
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/rapidjson.autopkg77
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/readme.md210
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/readme.zh-cn.md152
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/CMakeLists.txt20
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/CMakeLists.txt28
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/misctest.cpp974
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.cpp24
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.h186
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/platformtest.cpp166
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/rapidjsontest.cpp564
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/schematest.cpp223
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/CMakeLists.txt95
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/allocatorstest.cpp292
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/bigintegertest.cpp138
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/clzlltest.cpp34
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/cursorstreamwrappertest.cpp115
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/documenttest.cpp674
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/dtoatest.cpp99
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodedstreamtest.cpp313
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodingstest.cpp451
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/filestreamtest.cpp155
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/fwdtest.cpp230
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/istreamwrappertest.cpp181
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/itoatest.cpp160
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/jsoncheckertest.cpp143
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/namespacetest.cpp70
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/ostreamwrappertest.cpp92
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/platformtest.cpp40
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/pointertest.cpp1730
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/prettywritertest.cpp373
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/readertest.cpp2370
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/regextest.cpp639
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/schematest.cpp3575
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/simdtest.cpp219
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strfunctest.cpp30
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/stringbuffertest.cpp192
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strtodtest.cpp132
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.cpp51
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.h143
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/uritest.cpp725
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/valuetest.cpp1861
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/writertest.cpp598
-rw-r--r--graphics/asymptote/LspCpp/third_party/rapidjson/test/valgrind.supp26
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/rapidjson/travis-doxygen.sh128
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CHANGELOG.md42
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake16
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake22
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make91
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/cmake_clean.cmake8
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.make2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.ts2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/progress.make2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/progress.marks1
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/CMakeLists.txt105
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/Doxyfile1742
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/Doxyfile.in1742
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/LICENSE_1_0.txt23
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/Makefile207
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/README.rst82
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/BUILD.bazel207
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/CMakeLists.txt30
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTING.md131
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTORS64
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/LICENSE28
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/README.md140
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/WORKSPACE17
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/ci/linux-presubmit.sh126
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/ci/macos-presubmit.sh73
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/_config.yml1
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/_data/navigation.yml43
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/_layouts/default.html58
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/_sass/main.scss200
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/advanced.md2379
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/community_created_documentation.md7
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/faq.md692
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cheat_sheet.md241
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cook_book.md4299
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_faq.md390
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_for_dummies.md700
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/index.md22
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/pkgconfig.md148
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/platforms.md35
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/primer.md482
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-bazel.md147
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-cmake.md156
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/actions.md115
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/assertions.md633
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/matchers.md285
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/mocking.md587
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/testing.md1431
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/docs/samples.md22
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/CMakeLists.txt214
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/README.md40
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock.pc.in10
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock_main.pc.in10
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/docs/README.md4
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-actions.h1687
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-cardinalities.h157
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-function-mocker.h514
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-matchers.h5572
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-actions.h573
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-matchers.h92
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-nice-strict.h261
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-spec-builders.h2038
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock.h96
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/README.md18
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-generated-actions.h7
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-matchers.h37
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-port.h40
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-internal-utils.h472
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-port.h105
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-pp.h279
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-all.cc46
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-cardinalities.cc155
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-internal-utils.cc256
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-matchers.cc463
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-spec-builders.cc908
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock.cc223
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock_main.cc72
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/BUILD.bazel118
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-actions_test.cc1583
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-cardinalities_test.cc429
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-function-mocker_test.cc986
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-internal-utils_test.cc766
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-matchers_test.cc8692
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-more-actions_test.cc1547
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-nice-strict_test.cc538
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-port_test.cc42
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp-string_test.cc206
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp_test.cc83
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-spec-builders_test.cc2774
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_all_test.cc46
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_ex_test.cc80
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test.py104
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test_.cc99
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link2_test.cc39
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.cc39
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.h690
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test.py183
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_.cc309
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_golden.txt317
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_stress_test.cc240
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test.cc179
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test_utils.py96
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/CMakeLists.txt321
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/README.md217
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/Config.cmake.in9
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest.pc.in9
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest_main.pc.in10
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/internal_utils.cmake346
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/libgtest.la.in21
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/docs/README.md4
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-assertion-result.h232
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-death-test.h346
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-matchers.h934
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-message.h220
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-param-test.h510
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-printers.h1050
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-spi.h235
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-test-part.h186
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-typed-test.h331
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest.h2316
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_pred_impl.h364
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_prod.h60
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/README.md58
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-port.h37
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-printers.h42
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest.h37
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-death-test-internal.h305
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-filepath.h213
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-internal.h1562
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-param-util.h948
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port-arch.h116
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port.h2367
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-string.h177
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-type-util.h185
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/prime_tables.h126
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.cc66
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.h41
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample10_unittest.cc139
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1_unittest.cc151
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.cc54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.h80
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2_unittest.cc107
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3-inl.h172
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3_unittest.cc149
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.cc54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.h53
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4_unittest.cc53
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample5_unittest.cc196
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample6_unittest.cc217
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample7_unittest.cc117
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample8_unittest.cc154
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample9_unittest.cc156
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-all.cc49
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-assertion-result.cc81
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-death-test.cc1647
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-filepath.cc369
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-internal-inl.h1204
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-matchers.cc97
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-port.cc1413
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-printers.cc578
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-test-part.cc108
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-typed-test.cc107
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest.cc6824
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest_main.cc54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/BUILD.bazel590
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest.py208
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest_.cc86
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test.py236
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test_.cc293
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test.py127
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test_.cc62
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test-test.cc1528
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test_ex_test.cc92
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test.py120
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test_.cc132
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest.py410
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest_.cc167
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filepath-test.cc649
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest.py639
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest_.cc137
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest.py128
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest_.cc58
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-outfiles-test.py191
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-output-unittest.py848
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest.py205
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest_.cc156
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-listener-test.cc518
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-message-test.cc158
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-options-test.cc219
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test-golden-lin.txt1196
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test.py346
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test_.cc1116
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test.py63
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test_.cc50
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test.py62
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test_.cc55
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.cc1119
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.h51
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test2-test.cc61
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-port-test.cc1305
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-printers-test.cc1991
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test.py54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test_.cc49
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test.py323
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test_.cc101
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-test-part-test.cc230
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test.py168
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test_.cc71
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test.py67
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test_.cc42
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test2_test.cc40
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.cc437
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.h60
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-unittest-api_test.cc328
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_all_test.cc46
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_assert_by_exception_test.cc116
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_environment_test.cc184
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test.py173
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test_.cc45
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_json_test_utils.py60
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest.py286
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest_.cc77
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_main_unittest.cc44
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_no_test_unittest.cc54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_pred_impl_unittest.cc2422
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_premature_exit_test.cc126
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_prod_test.cc56
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_repeat_test.cc221
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_check_output_test.py59
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_environment_check_output_test.py54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_in_environment_setup_test.cc49
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_test.cc55
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_sole_header_test.cc56
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_stress_test.cc248
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_macro_stack_footprint_test.cc89
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_utils.py255
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test.py63
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test_.cc43
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_throw_on_failure_ex_test.cc90
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_unittest.cc7833
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile1_test_.cc43
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile2_test_.cc43
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfiles_test.py135
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest.py415
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest_.cc193
-rwxr-xr-xgraphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_test_utils.py197
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.cc35
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.h54
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/optional.hpp703
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/string_view.hpp272
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri.hpp38
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/config.hpp21
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp78
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp171
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp89
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp88
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri.hpp757
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp277
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp113
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_io.hpp62
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake16
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake30
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make226
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean.cmake25
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean_target.cmake3
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal1739
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.make2237
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/depend.make2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make10
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/link.txt2
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/progress.make10
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/progress.marks1
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/CMakeLists.txt32
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/Makefile423
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake48
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm.hpp70
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_find.hpp79
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_split.hpp75
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/grammar.hpp124
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp78
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp20
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.cpp74
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.hpp20
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.cpp384
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.hpp20
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp116
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp20
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp80
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.cpp88
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.hpp22
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/uri.cpp695
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/uri_builder.cpp151
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/src/uri_errors.cpp69
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/CMakeLists.txt39
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/invalid_urls.txt39
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/optional_test.cpp168
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/string_utility.hpp17
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/test_uri.hpp99
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_builder_test.cpp855
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_comparison_test.cpp88
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_encoding_test.cpp147
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_normalization_test.cpp212
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_path_test.cpp121
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_scheme_test.cpp79
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_test.cpp565
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_reference_test.cpp68
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_resolve_test.cpp307
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_stream_test.cpp48
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/uri_test.cpp1071
-rw-r--r--graphics/asymptote/LspCpp/third_party/uri/test/valid_urls.txt36
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/CMakeLists.txt62
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/LICENSE23
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/README.md1503
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/samples/docsample.cpp64
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8.h34
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/checked.h319
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/core.h387
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp11.h103
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp17.h103
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h257
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/CMakeLists.txt43
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/apitests.cpp6
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/docker/Dockerfile5
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/negative.cpp59
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/noexceptionstests.cpp4
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_api.h198
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_iterator.h35
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp11.cpp109
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp17.cpp88
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_data/utf8_invalid.txtbin20010 -> 0 bytes
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_api.h164
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_iterator.h36
-rw-r--r--graphics/asymptote/LspCpp/third_party/utfcpp/utf8cppConfig.cmake.in6
-rw-r--r--graphics/asymptote/Makefile.in202
-rw-r--r--graphics/asymptote/README7
-rw-r--r--graphics/asymptote/ReleaseNotes7
-rw-r--r--graphics/asymptote/__pycache__/determine_pkg_info.cpython-312.pycbin0 -> 3364 bytes
-rw-r--r--graphics/asymptote/array.cc12
-rw-r--r--graphics/asymptote/asy-keywords.el2
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/asy-list.pl51
-rw-r--r--graphics/asymptote/asy.list6226
-rw-r--r--graphics/asymptote/asymptote.spec2
-rw-r--r--graphics/asymptote/asyparser.cc (renamed from graphics/asymptote/parser.cc)13
-rw-r--r--graphics/asymptote/asyparser.h (renamed from graphics/asymptote/parser.h)7
-rw-r--r--graphics/asymptote/asyprocess.cc (renamed from graphics/asymptote/process.cc)10
-rw-r--r--graphics/asymptote/asyprocess.h (renamed from graphics/asymptote/process.h)8
-rw-r--r--graphics/asymptote/backports/getopt/CMakeLists.txt27
-rw-r--r--graphics/asymptote/backports/getopt/include/getopt.h (renamed from graphics/asymptote/getopt.h)0
-rw-r--r--graphics/asymptote/backports/getopt/src/getopt.c (renamed from graphics/asymptote/getopt.c)0
-rw-r--r--graphics/asymptote/backports/getopt/src/getopt1.c (renamed from graphics/asymptote/getopt1.c)14
-rw-r--r--graphics/asymptote/backports/glew/CMakeLists.txt10
-rw-r--r--graphics/asymptote/backports/glew/include/GL/glew.h (renamed from graphics/asymptote/GL/glew.h)0
-rw-r--r--graphics/asymptote/backports/glew/include/GL/glxew.h (renamed from graphics/asymptote/GL/glxew.h)0
-rw-r--r--graphics/asymptote/backports/glew/include/GL/wglew.h (renamed from graphics/asymptote/GL/wglew.h)0
-rw-r--r--graphics/asymptote/backports/glew/src/glew.c (renamed from graphics/asymptote/GL/glew.c)0
-rw-r--r--graphics/asymptote/backports/optional/CMakeLists.txt6
-rw-r--r--graphics/asymptote/backports/optional/include/optional.hpp (renamed from graphics/asymptote/optional.hpp)0
-rw-r--r--graphics/asymptote/base/v3dheadertypes.asy2
-rw-r--r--graphics/asymptote/base/v3dtypes.asy2
-rw-r--r--graphics/asymptote/bbox3.h148
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/README7
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/fftw3.dllbin956416 -> 956416 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/freeglut.dllbin247296 -> 247296 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/gc.dllbin147456 -> 148480 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/gccpp.dllbin11264 -> 11264 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/getopt.dllbin18944 -> 18944 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/gsl.dllbin2940928 -> 2940928 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/gslcblas.dllbin415744 -> 415744 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/libcurl.dllbin581120 -> 588800 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/pthreadvc3.dllbin61440 -> 61440 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/readline.dllbin176640 -> 176640 bytes
-rw-r--r--graphics/asymptote/binaries/x86_64-windows/zlib1.dllbin90624 -> 90624 bytes
-rw-r--r--graphics/asymptote/build-scripts/HOWTO-MSWindows87
-rwxr-xr-xgraphics/asymptote/build-scripts/build-asymptote7
-rwxr-xr-xgraphics/asymptote/build-scripts/build-asymptote-CTAN32
-rwxr-xr-xgraphics/asymptote/build-scripts/build-asymptote.dos106
-rw-r--r--graphics/asymptote/build-scripts/build-asymptote.ps1268
-rw-r--r--graphics/asymptote/camp.l12
-rw-r--r--graphics/asymptote/camp.tab.cc438
-rw-r--r--graphics/asymptote/camp.tab.h2
-rw-r--r--graphics/asymptote/camp.y4
-rw-r--r--graphics/asymptote/cmake-scripts/asy-base-files.cmake78
-rw-r--r--graphics/asymptote/cmake-scripts/asy-files.cmake33
-rw-r--r--graphics/asymptote/cmake-scripts/asy-macro.cmake50
-rw-r--r--graphics/asymptote/cmake-scripts/backport-libs.cmake11
-rw-r--r--graphics/asymptote/cmake-scripts/basic-parameters.cmake6
-rw-r--r--graphics/asymptote/cmake-scripts/buildfiles-to-src.cmake4
-rw-r--r--graphics/asymptote/cmake-scripts/common.cmake6
-rw-r--r--graphics/asymptote/cmake-scripts/compiler-config.cmake15
-rw-r--r--graphics/asymptote/cmake-scripts/docgen.cmake305
-rw-r--r--graphics/asymptote/cmake-scripts/external-libs.cmake316
-rw-r--r--graphics/asymptote/cmake-scripts/generated-files.cmake224
-rw-r--r--graphics/asymptote/cmake-scripts/gnu-install-macros.cmake16
-rw-r--r--graphics/asymptote/cmake-scripts/options.cmake271
-rw-r--r--graphics/asymptote/cmake-scripts/tests-asy.cmake96
-rw-r--r--graphics/asymptote/cmake-scripts/thirdparty-impl.cmake6
-rw-r--r--graphics/asymptote/cmake-scripts/vcpkg-features.cmake39
-rw-r--r--graphics/asymptote/cmake-scripts/win32-pre-nsis-installer.cmake174
-rw-r--r--graphics/asymptote/cmake-scripts/win32-specific.cmake100
-rw-r--r--graphics/asymptote/common.h59
-rwxr-xr-xgraphics/asymptote/config.guess72
-rw-r--r--graphics/asymptote/config.h.in73
-rw-r--r--graphics/asymptote/config.sub828
-rwxr-xr-xgraphics/asymptote/configure1642
-rw-r--r--graphics/asymptote/configure.ac751
-rw-r--r--graphics/asymptote/cudareflect/CMakeLists.txt29
-rw-r--r--graphics/asymptote/cudareflect/IrradianceGenerator.sln25
-rw-r--r--graphics/asymptote/cudareflect/IrradianceGenerator.vcxproj119
-rw-r--r--graphics/asymptote/cudareflect/Makefile4
-rw-r--r--graphics/asymptote/cudareflect/common.h2
-rw-r--r--graphics/asymptote/cudareflect/tinyexr.cc15
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/CMakeLists.txt74
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/Makefile25
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw18
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw-msys16
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/Makefile.llvm-mingw25
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/README.md568
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/appveyor.yml13
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/asakusa.exrbin1127425 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/asakusa.pngbin202947 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindASan.cmake59
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindMSan.cmake57
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindSanitizers.cmake94
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindTSan.cmake65
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindUBSan.cmake46
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/asan-wrapper55
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/sanitize-helpers.cmake177
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/config-msvc.py78
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/ChangeLog.md196
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/LICENSE22
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example1.c105
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example2.c164
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example3.c269
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example4.c102
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example5.c327
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example6.c162
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.c7733
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.h1350
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/deps/miniz/readme.md34
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/common/cxxopts.hpp1988
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image.h7462
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_resize.h2585
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_write.h1048
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/Makefile28
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/README.md46
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/cube2longlat.cc470
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/deepview/Makefile2
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/deepview/deepview_screencast.gifbin3790199 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/deepview/main.cc277
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.cc324
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.h81
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/Makefile32
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/README.md7
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/exr2fptiff.cc199
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/tiny_dng_writer.h1356
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/exr2ldr.cc111
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/exr2rgbe.cc38
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/README.md5
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/exrfilter.cc150
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/DroidSans.ttfbin190044 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/CommonWindowInterface.h130
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.h118
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.mm1169
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGL2Include.h59
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGLInclude.h66
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32InternalWindowData.h68
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.cpp200
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.h64
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.cpp810
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.h86
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.cpp1118
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.h78
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/README.md56
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glew.h19093
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glxew.h1750
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/wglew.h1421
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/glew.c18897
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/LICENSE16
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/README.md137
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_cocoa.pngbin100007 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_gtk3.pngbin63193 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_win8.pngbin16188 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/SConstruct99
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/common.h21
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/include/nfd.h69
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m235
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.c142
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.h37
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c326
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp619
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/SConstruct70
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialog.c29
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialogmultiple.c34
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_savedialog.c28
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.cc60
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.h16
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/findOpenGLGlewGlut.lua90
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/main.cc541
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear.h25417
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear_btgui_gl2.h386
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/premake4.lua87
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/screenshots/exrview.pngbin1044671 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.frag12
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.vert12
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/ldr2exr.cc85
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/README.md13
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/main.cc267
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/resize/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/resize/resize.cc46
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/rgbe2exr.cc81
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/Makefile3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/README.md15
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/testmapgen.cc86
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/experimental/js/Makefile2
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/experimental/js/README.md38
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/experimental/js/binding.cc79
-rwxr-xr-xgraphics/asymptote/cudareflect/tinyexr/experimental/js/compile_to_js.sh10
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/experimental/js/index.html41
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/experimental/js/test.js21
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/jni/Android.mk12
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/jni/Application.mk2
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/jni/Makefile8
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/jni/README.md4
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/kuroga.py312
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/premake4.lua55
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/CMakeLists.txt23
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/c-binding/Makefile5
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/c-binding/test.c19
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/exrcat/exrcat.cpp127
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/exrwrite/exrwritetest.cpp132
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/Makefile13
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/README.md16
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/fuzz.cc29
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-62-tinyexr_memcpy_heap-buffer-overflowbin64 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-63-tinyexr_signed-integer-overflowbin503 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-77-heap-buffer-overflowbin20829 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/issues/160/README.md1
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/issues/160/main.py57
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/issues/160/requirements.txt3
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/Makefile21
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/README.md30
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/catch.hpp10445
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/config-msvc.py52
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/config-posix.py53
-rwxr-xr-xgraphics/asymptote/cudareflect/tinyexr/test/unit/kuroga.py312
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/2by2.exrbin395 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/flaga.exrbin4731 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/issue-160-piz-decode.exrbin155069 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/piz-bug-issue-100.exrbin327 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-1383755b301e5f505b2198dc0508918b537fdf48bbfc6deeffe268822e6f6cd6bin473703 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-24322747c47e87a10e4407528b779a1a763a48135384909b3d1010bbba1d4c28_minbin630 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-255456016cca60ddb5c5ed6898182e13739bf687b17d1411e97bb60ad95e7a84_minbin832 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-360c3b0555cb979ca108f2d178cf8a80959cfeabaa4ec1d310d062fa653a8c6b_minbin4738 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-3f1f642c3356fd8e8d2a0787613ec09a56572b3a1e38c9629b6db9e8dead1117_minbin4471 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5ace655ef080932dcc7e4abc9eab1d4f82c845453464993dfa3eb6c5822a1621bin298 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5b66774a7498c635334ad386be0c3b359951738ac47f14878a3346d1c6ea0fe5_minbin678 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-d5c9c893e559277a3320c196523095b94db93985620ac338d037487e0e613047_minbin132 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-df76d1f27adb8927a1446a603028272140905c168a336128465a1162ec7af270.minibin15 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-e7fa6404daa861369d2172fe68e08f9d38c0989f57da7bcfb510bab67e19ca9fbin473695 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-eedff3a9e99eb1c0fd3a3b0989e7c44c0a69f04f10b23e5264f362a4773f4397_minbin793 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-efe9007bfdcbbe8a1569bf01fa9acadb8261ead49cb83f6e91fcdc4dae2e99a3_minbin15 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/regression/tiled_half_1x1_alpha.exrbin335 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/tester.cc1714
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/vcbuild.bat4
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf16le.incbin50 -> 0 bytes
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf8.inc1
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/test_tinyexr.cc469
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/tinyexr.cc8
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/tinyexr.h8533
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/vcbuild.bat11
-rw-r--r--graphics/asymptote/cudareflect/tinyexr/vcsetup2019.bat4
-rw-r--r--graphics/asymptote/cxxtests/CMakeLists.txt21
-rw-r--r--graphics/asymptote/cxxtests/cmake-scripts/external-libs.cmake19
-rw-r--r--graphics/asymptote/cxxtests/cmake-scripts/tests.cmake12
-rw-r--r--graphics/asymptote/cxxtests/include/asycxxtests/common.h9
-rw-r--r--graphics/asymptote/cxxtests/src/testMain.cc14
-rw-r--r--graphics/asymptote/cxxtests/tests/placeholder.cc8
-rw-r--r--graphics/asymptote/dec.cc2
-rw-r--r--graphics/asymptote/determine_pkg_info.py78
-rw-r--r--graphics/asymptote/doc/CAD.pdfbin198634 -> 199142 bytes
-rw-r--r--graphics/asymptote/doc/FAQ/asy-faq.info2
-rw-r--r--graphics/asymptote/doc/TeXShopAndAsymptote.pdfbin81154 -> 81273 bytes
-rw-r--r--graphics/asymptote/doc/asy-latex.pdfbin209115 -> 209115 bytes
-rw-r--r--graphics/asymptote/doc/asy.13
-rw-r--r--graphics/asymptote/doc/asyRefCard.pdfbin121145 -> 121145 bytes
-rw-r--r--graphics/asymptote/doc/asymptote.pdfbin1222158 -> 1253809 bytes
-rw-r--r--graphics/asymptote/doc/asymptote.texi4
-rw-r--r--graphics/asymptote/doc/build-asymptote-pdf-win.py27
-rw-r--r--graphics/asymptote/doc/build-latexusage-pdf.py103
-rw-r--r--graphics/asymptote/doc/gen-asy-options-file.py38
-rw-r--r--graphics/asymptote/doc/png/asymptote.info127
-rw-r--r--graphics/asymptote/drawlabel.cc8
-rw-r--r--graphics/asymptote/envcompleter.cc2
-rw-r--r--graphics/asymptote/errormsg.h2
-rw-r--r--graphics/asymptote/examples/venn.asy2
-rw-r--r--graphics/asymptote/exithandlers.cc61
-rw-r--r--graphics/asymptote/exithandlers.h15
-rw-r--r--graphics/asymptote/exp.cc2
-rw-r--r--graphics/asymptote/fileio.cc211
-rw-r--r--graphics/asymptote/fileio.h160
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/findsym.pl18
-rw-r--r--graphics/asymptote/gen_preprocessed_depfile.py251
-rw-r--r--graphics/asymptote/generate_asy_ver_info.py75
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/generate_enums.py14
-rw-r--r--graphics/asymptote/genv.cc8
-rw-r--r--graphics/asymptote/glew.c22
-rw-r--r--graphics/asymptote/glrender.cc100
-rw-r--r--graphics/asymptote/glrender.h48
-rw-r--r--graphics/asymptote/gsl.cc2
-rw-r--r--graphics/asymptote/interact.cc22
-rw-r--r--graphics/asymptote/keywords.h (renamed from graphics/asymptote/keywords.cc)0
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/keywords.pl41
-rw-r--r--graphics/asymptote/lex.yy.cc12
-rw-r--r--graphics/asymptote/locate.cc31
-rw-r--r--graphics/asymptote/lspserv.cc23
-rw-r--r--graphics/asymptote/lspserv.h11
-rw-r--r--graphics/asymptote/main.cc117
-rw-r--r--graphics/asymptote/memory.cc74
-rw-r--r--graphics/asymptote/memory.h38
-rw-r--r--graphics/asymptote/misc/aspy.py (renamed from graphics/asymptote/aspy.py)0
-rw-r--r--graphics/asymptote/misc/profile.py (renamed from graphics/asymptote/profile.py)0
-rw-r--r--graphics/asymptote/misc/testv3d.asy (renamed from graphics/asymptote/testv3d.asy)0
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/opsymbols.pl26
-rw-r--r--graphics/asymptote/path3.h8
-rw-r--r--graphics/asymptote/picture.cc284
-rw-r--r--graphics/asymptote/pipestream.cc7
-rw-r--r--graphics/asymptote/pipestream.h9
-rw-r--r--graphics/asymptote/pkg-info.cmake16
-rw-r--r--graphics/asymptote/prc/CMakeLists.txt27
-rw-r--r--graphics/asymptote/prc/Makefile42
-rw-r--r--graphics/asymptote/prc/PRCTools/bitData.cc4
-rw-r--r--graphics/asymptote/prc/PRCTools/describePRC.cc14
-rw-r--r--graphics/asymptote/prc/PRCTools/iPRCFile.h10
-rw-r--r--graphics/asymptote/prc/PRCTools/makePRC.cc8
-rw-r--r--graphics/asymptote/prc/PRCbitStream.cc8
-rw-r--r--graphics/asymptote/prc/PRCdouble.cc2
-rw-r--r--graphics/asymptote/prc/include/prc/PRC.h (renamed from graphics/asymptote/prc/PRC.h)236
-rw-r--r--graphics/asymptote/prc/include/prc/PRCbitStream.h (renamed from graphics/asymptote/prc/PRCbitStream.h)2
-rw-r--r--graphics/asymptote/prc/include/prc/PRCdouble.h (renamed from graphics/asymptote/prc/PRCdouble.h)13
-rw-r--r--graphics/asymptote/prc/include/prc/PRCuniversalendianness.h11
-rw-r--r--graphics/asymptote/prc/include/prc/oPRCFile.h (renamed from graphics/asymptote/prc/oPRCFile.h)2
-rw-r--r--graphics/asymptote/prc/include/prc/writePRC.h (renamed from graphics/asymptote/prc/writePRC.h)51
-rw-r--r--graphics/asymptote/prc/oPRCFile.cc30
-rw-r--r--graphics/asymptote/prc/test.cc23
-rw-r--r--graphics/asymptote/prc/writePRC.cc390
-rw-r--r--graphics/asymptote/primitives.h2
-rw-r--r--graphics/asymptote/profiler.h2
-rw-r--r--graphics/asymptote/psfile.cc6
-rw-r--r--graphics/asymptote/quick-start-win32.ps160
-rw-r--r--graphics/asymptote/revision.cc2
-rw-r--r--graphics/asymptote/rounding.h13
-rw-r--r--graphics/asymptote/runarray.cc498
-rw-r--r--graphics/asymptote/runarray.h4
-rw-r--r--graphics/asymptote/runbacktrace.cc18
-rw-r--r--graphics/asymptote/runbacktrace.h4
-rw-r--r--graphics/asymptote/runfile.cc312
-rw-r--r--graphics/asymptote/runfile.h4
-rw-r--r--graphics/asymptote/runfile.in42
-rw-r--r--graphics/asymptote/runhistory.cc43
-rw-r--r--graphics/asymptote/runhistory.h4
-rw-r--r--graphics/asymptote/runhistory.in13
-rw-r--r--graphics/asymptote/runlabel.cc42
-rw-r--r--graphics/asymptote/runlabel.h4
-rw-r--r--graphics/asymptote/runmath.cc279
-rw-r--r--graphics/asymptote/runmath.h4
-rw-r--r--graphics/asymptote/runmath.in27
-rw-r--r--graphics/asymptote/runpair.cc228
-rw-r--r--graphics/asymptote/runpair.h4
-rw-r--r--graphics/asymptote/runpath.cc294
-rw-r--r--graphics/asymptote/runpath.h4
-rw-r--r--graphics/asymptote/runpath3d.cc270
-rw-r--r--graphics/asymptote/runpath3d.h4
-rw-r--r--graphics/asymptote/runpicture.cc390
-rw-r--r--graphics/asymptote/runpicture.h4
-rw-r--r--graphics/asymptote/runstring.cc158
-rw-r--r--graphics/asymptote/runstring.h4
-rw-r--r--graphics/asymptote/runstring.in32
-rw-r--r--graphics/asymptote/runsystem.cc134
-rw-r--r--graphics/asymptote/runsystem.h4
-rw-r--r--graphics/asymptote/runsystem.in2
-rw-r--r--graphics/asymptote/runtime.cc926
-rw-r--r--graphics/asymptote/runtime.h4
-rw-r--r--graphics/asymptote/runtime.in32
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/runtime.pl99
-rw-r--r--graphics/asymptote/runtriple.cc174
-rw-r--r--graphics/asymptote/runtriple.h4
-rw-r--r--graphics/asymptote/seconds.h3
-rw-r--r--graphics/asymptote/settings.cc267
-rw-r--r--graphics/asymptote/settings.h6
-rw-r--r--graphics/asymptote/shaders.h14
-rw-r--r--graphics/asymptote/stack.cc6
-rw-r--r--graphics/asymptote/template_rev.cc.in4
-rw-r--r--graphics/asymptote/texfile.h7
-rw-r--r--graphics/asymptote/thirdparty_impl/tinyexr_impl/CMakeLists.txt28
-rw-r--r--graphics/asymptote/thirdparty_impl/tinyexr_impl/src/tinyexr_impl.cc21
-rw-r--r--graphics/asymptote/tinyexr.cc34
-rw-r--r--graphics/asymptote/tr.h4
-rw-r--r--graphics/asymptote/types.cc4
-rw-r--r--graphics/asymptote/types.h4
-rw-r--r--graphics/asymptote/util.cc242
-rw-r--r--graphics/asymptote/util.h12
-rw-r--r--graphics/asymptote/v3dfile.cc15
-rw-r--r--graphics/asymptote/v3dfile.h6
-rw-r--r--graphics/asymptote/v3dheadertypes.h40
-rw-r--r--graphics/asymptote/v3dheadertypes.py64
-rw-r--r--graphics/asymptote/v3dtypes.h27
-rw-r--r--graphics/asymptote/v3dtypes.py32
-rw-r--r--graphics/asymptote/vcpkg.json78
-rw-r--r--graphics/asymptote/version.texi.in3
-rw-r--r--graphics/asymptote/versionTemplate.asy.in3
-rw-r--r--graphics/asymptote/win32helpers.cc240
-rw-r--r--graphics/asymptote/win32helpers.h92
-rw-r--r--graphics/asymptote/win32pipestream.cc320
-rw-r--r--graphics/asymptote/win32pipestream.h94
-rw-r--r--graphics/asymptote/win32xdr.cc95
-rw-r--r--graphics/asymptote/win32xdr.h175
-rw-r--r--graphics/asymptote/windows/AsymptoteInstallInfo.nsi.in1
-rw-r--r--[-rwxr-xr-x]graphics/asymptote/windows/EnvVarUpdate.nsh (renamed from graphics/asymptote/EnvVarUpdate.nsh)654
-rw-r--r--graphics/asymptote/windows/asy.ico (renamed from graphics/asymptote/asy.ico)bin4286 -> 4286 bytes
-rw-r--r--graphics/asymptote/windows/asy.rc (renamed from graphics/asymptote/asy.rc)0
-rw-r--r--graphics/asymptote/windows/asymptote.nsi (renamed from graphics/asymptote/asymptote.nsi)0
-rw-r--r--graphics/asymptote/windows/build-asy-installer.ps1.in11
-rw-r--r--graphics/asymptote/windows/build-asymptote-installer.py114
-rw-r--r--graphics/asymptote/windows/lnkX64IconFix.nsh (renamed from graphics/asymptote/lnkX64IconFix.nsh)148
-rw-r--r--graphics/asymptote/windows/texindex-wsl.cmd2
-rw-r--r--graphics/asymptote/xdrcommon.h82
-rw-r--r--graphics/asymptote/xstream.cc372
-rw-r--r--graphics/asymptote/xstream.h398
1252 files changed, 19203 insertions, 352994 deletions
diff --git a/graphics/asymptote/CMakeLists.txt b/graphics/asymptote/CMakeLists.txt
new file mode 100644
index 0000000000..fe7c2406ea
--- /dev/null
+++ b/graphics/asymptote/CMakeLists.txt
@@ -0,0 +1,92 @@
+cmake_minimum_required(VERSION 3.26)
+
+include(cmake-scripts/common.cmake)
+include(asy-pkg-version-suffix.cmake OPTIONAL RESULT_VARIABLE ASY_ADDR_VERSION_SUFFIX_FILE)
+include(cmake-scripts/options.cmake)
+include(pkg-info.cmake)
+include(cmake-scripts/vcpkg-features.cmake)
+
+project(${ASY_PACKAGE_NAME})
+
+include(cmake-scripts/compiler-config.cmake)
+include(cmake-scripts/basic-parameters.cmake)
+include(cmake-scripts/buildfiles-to-src.cmake)
+include(cmake-scripts/asy-files.cmake)
+
+# setting build files
+if (WIN32)
+ include(cmake-scripts/win32-specific.cmake)
+endif()
+
+build_files_to_src(CORE_BUILD_FILES CORE_SOURCE_FILES)
+include(cmake-scripts/external-libs.cmake)
+include(cmake-scripts/thirdparty-impl.cmake)
+include(cmake-scripts/backport-libs.cmake)
+
+# PRC
+add_subdirectory(prc/)
+list(APPEND ASY_STATIC_LIBARIES PRC)
+
+get_target_property(prc_incl_dir PRC INCLUDE_DIRECTORIES)
+list(APPEND ASYMPTOTE_INCLUDES $<TARGET_PROPERTY:PRC,INCLUDE_DIRECTORIES>)
+
+include(cmake-scripts/gnu-install-macros.cmake)
+include(cmake-scripts/asy-macro.cmake)
+
+include(cmake-scripts/generated-files.cmake)
+
+# asy-reflect
+if (ENABLE_CUDA_ASY_REFLECT)
+ message(STATUS "asy reflect target enabled")
+ add_subdirectory(cudareflect/)
+endif()
+
+# defining asy target
+
+add_library(
+ asycore STATIC
+ ${CORE_SOURCE_FILES}
+ ${ASY_GENERATED_BUILD_SOURCES}
+)
+
+target_include_directories(asycore PUBLIC ${ASYMPTOTE_INCLUDES})
+add_dependencies(asycore asy_gen_headers)
+target_link_libraries(asycore PUBLIC ${ASY_STATIC_LIBARIES})
+target_compile_definitions(asycore PUBLIC ${ASY_MACROS})
+target_compile_options(asycore PUBLIC ${ASY_COMPILE_OPTS})
+
+# asy executable
+
+add_executable(
+ asy ${ASY_SRC_DIR}/main.cc ${ASY_WIN_RC_FILE}
+)
+
+target_link_libraries(asy PUBLIC asycore)
+
+# base files
+include(cmake-scripts/asy-base-files.cmake)
+
+# asy + base files
+add_custom_target(asy-basefiles DEPENDS ${ASY_OUTPUT_BASE_FILES})
+add_custom_target(asy-with-basefiles ALL DEPENDS asy asy-basefiles)
+
+# documentation generation
+
+if (ENABLE_DOCGEN)
+ include(cmake-scripts/docgen.cmake)
+endif()
+
+# testing
+
+enable_testing()
+include(cmake-scripts/tests-asy.cmake)
+
+if (ENABLE_ASY_CXXTEST)
+ add_subdirectory(cxxtests)
+endif()
+
+
+# installation (on windows, pre-NSIS)
+if (WIN32)
+ include(cmake-scripts/win32-pre-nsis-installer.cmake)
+endif()
diff --git a/graphics/asymptote/CMakePresets.json b/graphics/asymptote/CMakePresets.json
new file mode 100644
index 0000000000..937e3d8481
--- /dev/null
+++ b/graphics/asymptote/CMakePresets.json
@@ -0,0 +1,191 @@
+{
+ "version": 6,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 26,
+ "patch": 0
+ },
+
+ "configurePresets": [
+ {
+ "name": "base",
+ "generator": "Ninja",
+ "architecture": {
+ "strategy": "external",
+ "value": "x64"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/ensure-cl-compiler",
+ "cacheVariables": {
+ "CMAKE_C_COMPILER": "cl",
+ "CMAKE_CXX_COMPILER": "cl"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/vcpkg",
+ "toolchainFile": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
+ "hidden": true
+ },
+ {
+ "name": "base/release",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Release"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/debug",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "Debug"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/relWithDebInfo",
+ "cacheVariables": {
+ "CMAKE_BUILD_TYPE": "RelWithDebInfo"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/linuxCcache",
+ "cacheVariables": {
+ "CMAKE_C_COMPILER_LAUNCHER": "ccache",
+ "CMAKE_CXX_COMPILER_LAUNCHER": "ccache"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/gccCompatCacheVar",
+ "cacheVariables": {
+ "GCCCOMPAT_CXX_COMPILER_FOR_MSVC": "$env{GCCCOMPAT_CXX_COMPILER_FOR_MSVC}"
+ },
+ "hidden": true
+ },
+ {
+ "name": "base/buildBaseWithVcpkg",
+ "inherits": ["base", "base/vcpkg"],
+ "hidden": true
+ },
+ {
+ "name": "base/windows-only",
+ "hidden": true,
+ "condition": {
+ "type": "equals",
+ "lhs": "${hostSystemName}",
+ "rhs": "Windows"
+ }
+ },
+ {
+ "name": "base/allow_version_override_from_env",
+ "hidden": true,
+ "cacheVariables": {
+ "ASY_VERSION_OVERRIDE": "$env{ASY_VERSION_OVERRIDE}"
+ }
+ },
+ {
+ "name": "base/ctan",
+ "hidden": true,
+ "cacheVariables": {
+ "CTAN_BUILD": "true"
+ }
+ },
+ {
+ "name": "linux/release",
+ "displayName": "[linux-x86/64] Release",
+ "binaryDir": "${sourceDir}/cmake-build-linux/release",
+ "inherits": ["base/buildBaseWithVcpkg", "base/release", "base/allow_version_override_from_env"]
+ },
+ {
+ "name": "linux/release-ccache",
+ "displayName": "[linux-x86/64] Release (with ccache)",
+ "binaryDir": "${sourceDir}/cmake-build-linux/release",
+ "inherits": ["linux/release", "base/linuxCcache"]
+ },
+ {
+ "name": "linux/releaseWithDebugInfo",
+ "displayName": "[linux-x86/64] Release with Debug Info",
+ "binaryDir": "${sourceDir}/cmake-build-linux/release-with-dbginfo",
+ "inherits": ["base/buildBaseWithVcpkg", "base/relWithDebInfo"]
+ },
+ {
+ "name": "msvc/release",
+ "displayName": "[MSVC-x86/64] Release",
+ "binaryDir": "${sourceDir}/cmake-build-msvc/release",
+ "inherits": [
+ "base/buildBaseWithVcpkg", "base/release", "base/gccCompatCacheVar",
+ "base/windows-only", "base/ensure-cl-compiler", "base/allow_version_override_from_env"
+ ],
+ "cacheVariables": {
+ "ENABLE_LSP": "false",
+ "CMAKE_INSTALL_PREFIX": "${sourceDir}/cmake-install-w32-nsis-release"
+ }
+ },
+ {
+ "name": "msvc/release-with-existing-asymptote-pdf",
+ "displayName": "[MSVC-x86/64] Release (with external asymptote.pdf)",
+ "inherits": ["msvc/release"],
+ "cacheVariables": {
+ "ENABLE_ASYMPTOTE_PDF_DOCGEN": "false",
+ "EXTERNAL_DOCUMENTATION_DIR": "${sourceDir}/extfiles"
+ }
+ },
+ {
+ "name": "msvc/release-with-external-doc-files",
+ "displayName": "[MSVC-x86/64] Release (with external documentation)",
+ "inherits": ["msvc/release-with-existing-asymptote-pdf"],
+ "cacheVariables": {
+ "ENABLE_DOCGEN": "false"
+ }
+ },
+ {
+ "name": "msvc/release-with-external-doc-file-ctan",
+ "displayName": "[MSVC-x86/64] Release (with external documentation) for CTAN",
+ "inherits": ["msvc/release-with-external-doc-files", "base/ctan"]
+ },
+ {
+ "name": "msvc/releaseWithDebugInfo",
+ "displayName": "[MSVC-x86/64] Release with debug info",
+ "binaryDir": "${sourceDir}/cmake-build-msvc/release-with-dbginfo",
+ "inherits": [
+ "base/buildBaseWithVcpkg", "base/relWithDebInfo", "base/gccCompatCacheVar",
+ "base/windows-only", "base/ensure-cl-compiler"
+ ],
+ "cacheVariables": {
+ "CMAKE_INSTALL_PREFIX": "${sourceDir}/cmake-install-w32-nsis-reldbg"
+ }
+ }
+ ],
+
+ "buildPresets": [
+ {
+ "name": "build-base/windows-only",
+ "hidden": true,
+ "condition": {
+ "type": "equals",
+ "lhs": "${hostSystemName}",
+ "rhs": "Windows"
+ }
+ },
+
+ {
+ "name": "msvc/release",
+ "displayName": "[MSVC-x86/64] Release",
+ "inherits": [ "build-base/windows-only" ],
+ "configurePreset": "msvc/release"
+ },
+ {
+ "name": "linux/release",
+ "displayName": "[linux-x86/64] Release",
+ "configurePreset": "linux/release"
+ },
+ {
+ "name": "linux/release-ccache",
+ "displayName": "[linux-x86/64] Release (with ccache)",
+ "configurePreset": "linux/release-ccache"
+ }
+ ]
+}
diff --git a/graphics/asymptote/ChangeLog b/graphics/asymptote/ChangeLog
index 9e088f7bd4..6f30bb78bc 100644
--- a/graphics/asymptote/ChangeLog
+++ b/graphics/asymptote/ChangeLog
@@ -1,27 +1,402 @@
+commit 594ea5fabff99216b9795606227685db3a9be285
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 15:50:43 2024 -0800
+
+ Update required setuptools version.
+
+commit c5e597d1a17127cf21d582c5c57d970d205c251f
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 15:44:05 2024 -0800
+
+ Fix Makefile.in.
+
+commit a4d12d852e288d66e43d24ec88e2cb6b562fdacd
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 15:24:39 2024 -0800
+
+ Fix missing dependencies.
+
+commit a0bfdd5d73dac863577608e2115c35d8002b0d97
+Merge: ce2dfa5d 5839f005
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:50:41 2024 -0800
+
+ Merge branch 'msvc-support-make'.
+
+commit 5839f005305446aa51b0efe364305650261eb62f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:48:57 2024 -0700
+
+ MAKE: Re-add tests/Makefile.
+
+commit ce2dfa5d76eef26877862a81fbfa4283032e6fc6
+Merge: 34eb2703 cfa4b387
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:49:00 2024 -0800
+
+ Merge branch 'msvc-support-make'.
+
+commit cfa4b387ffd690863a55b97660a7f4a6120ec855
+Author: Supakorn "Jamie" Rassameemasmuang <rassamee@ualberta.ca>
+Date: Mon Nov 11 13:47:33 2024 -0700
+
+ WCE: Set +x on wce.
+
+commit 3424862ad2f7b2f33ce2e85682bca20a514bafe4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:46:53 2024 -0700
+
+ MAKE: Move wce back to root directory.
+
+commit 34eb2703642123f9886b673a8a9f5743afe3292f
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:44:42 2024 -0800
+
+ Restore example.
+
+commit 3e030884510819477e9588fecd4285cfb52aae8e
+Merge: 54955c5a e0ee47fb
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:41:39 2024 -0800
+
+ Merge branch 'msvc-support-make'.
+
+commit e0ee47fbdf08281be6523806094a599e53e71c68
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:41:11 2024 -0700
+
+ MAKE: Add xasy to asy target.
+
+commit 54955c5af723b2a8e7812f039b5b5b4e57099773
+Merge: ac9dad0e dd281a48
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:39:38 2024 -0800
+
+ Merge branch 'msvc-support-make'.
+
+commit dd281a4806fdd7f9185ea72415070cb0b08031b1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:36:55 2024 -0700
+
+ GUI: Fix path import for GUI symlink.
+
+commit ac9dad0e9e1b28a2ad7e6d2dee8e926057beaa9b
+Merge: 6df88fac b9e744cf
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 12:29:16 2024 -0800
+
+ Merge remote-tracking branch 'origin/msvc-support-make'.
+
+commit b9e744cfd9a08c4e404ab598d9a27a6e8fa0b319
+Author: Supakorn "Jamie" Rassameemasmuang <rassamee@ualberta.ca>
+Date: Mon Nov 11 13:21:56 2024 -0700
+
+ XASY: Set +x flag on xasy.py.
+
+commit 57f7f976a57a89a8db910e95c1101cbe7b305e5f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:19:21 2024 -0700
+
+ GUI: Add current path to xasy.
+
+commit fca87415bc500f291ece76784679fe35e23bfee7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:06:03 2024 -0700
+
+ BUILD: Use top-level directory for acextlibs.
+
+commit e9560ad9219d19bd21874307bf6141f2d4618444
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 13:04:59 2024 -0700
+
+ BUILD: Use master ref from vectorgraphics/LspCpp.
+
+commit bfc3ac9c3b67462f09f443e94ebb0a31f7002e1f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 12:53:19 2024 -0700
+
+ XASY: Remove development helper script as it is not needed anymore.
+
+commit e9f7894121d562a3c703f6f28767a6f53afc782e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 12:46:58 2024 -0700
+
+ XASY: Exclude additional dev files in build-asymptote-installer.py.
+
+commit 1c51e2dff7f6aef2d4df84622d80dbebf82c5730
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 12:45:43 2024 -0700
+
+ XASY: Fix import for xasy.
+
+commit ae5b388cd7751401880612f4e5c2f4326d63322d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 12:41:33 2024 -0700
+
+ Revert "XASY: Move xasy files and imports for compatibility with PEP 517 packaging system."
+
+ This reverts commit 51f58653
+
+commit b2b251eab5c4f09286c683392643cc7e1cf25783
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 11 12:40:17 2024 -0700
+
+ Revert "GUI: Fix xasyTransform import."
+
+ This reverts commit 0c70a3135124788c5faa805f75e0be328be7327b.
+
+commit 6df88faca807a0dc4d8041c43ffee0d59e750115
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Nov 11 10:23:38 2024 -0800
+
+ Remove obsolete build script.
+
+commit 7e6ad89e9fbacd3c059632dfb4d84586421c15c1
+Author: John Bowman <bowman@ualberta.ca>
+Date: Sun Nov 10 13:30:51 2024 -0800
+
+ Standardize formatting.
+
+commit d18983c5fe851b71f8aeb574389317cc67655e84
+Merge: 21d1648f dab310c0
+Author: John Bowman <bowman@ualberta.ca>
+Date: Sun Nov 10 13:11:43 2024 -0800
+
+ Merge branch 'master' into msvc-support-make.
+
+commit dab310c018630fb21701e9b1d62c7cf1c701d580
+Author: John Bowman <bowman@ualberta.ca>
+Date: Sun Nov 10 12:58:41 2024 -0800
+
+ Fix #486: use PACKAGE_NAME, PACKAGE_VERSION, and PACKAGE_BUGREPORT.
+
+commit 21d1648f58cfa801f05f0fb0a702012acfa96f27
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 21:42:19 2024 -0700
+
+ BULID: Fix win32-pre-nsis-installer's latexusage.tex.
+
+commit 2a1172adcee3695969d55ed31096795e538a83e7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 21:40:42 2024 -0700
+
+ REPO: Add additional remark about cmake-build-msvc/release.
+
+commit 9359f5fcdd5522e32a09c19522fd06aa4150bc97
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 21:33:36 2024 -0700
+
+ REPO: Use current asymptote dir for windows building script.
+
+commit 55222099ae2614a623b3dd1e3b4f9e748f532bd6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 21:33:22 2024 -0700
+
+ REPO: Add additional files to ignore list.
+
+commit 424a670db2f12b4a6cf1c758e9f853364914d325
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 21:12:52 2024 -0700
+
+ REPO: Add tools-cache to ignore list.
+
+commit 697604fcc34555930a8a976eb6a43fd5a3a0ba7d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 20:55:51 2024 -0700
+
+ BUILD: Install remaining documentation files to examples/ directory on windows.
+
+commit e557e44ad22e1040126e13599c61ce7ab564feaa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 20:52:54 2024 -0700
+
+ BUILD: Move ASY_DOC_ROOT to basic-parameters.cmake.
+
+commit 3336ed8ca36cf9c4341bb28c2127c721ab95cc1a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 20:34:12 2024 -0700
+
+ BUILD: Replace latexusage.pdf's inclusion with extra doc files.
+
+commit 10248a12f9c6db810da18bd2e70f33d97c20eee4
+Merge: 0c70a313 03587f0f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 18:15:11 2024 -0700
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 0c70a3135124788c5faa805f75e0be328be7327b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 17:46:53 2024 -0700
+
+ GUI: Fix xasyTransform import.
+
+commit 522152e8384a400257a1f9dde7d12d951866f014
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 17:44:11 2024 -0700
+
+ GUI: Remove cgitb.text import.
+
+commit 65b51981fdd6524d0dc1217172a4e32abd40c531
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 9 17:27:49 2024 -0700
+
+ REPO: Add .python-version to GUI's ignore list.
+
+commit 03587f0fbdb5b203780186a6c3410d767a4083c3
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Oct 8 10:32:57 2024 -0700
+
+ Increment version to 2.93.
+
+commit 9ed0a02a09524bec5add75a13151c36bc742fe8f
+Merge: 730570ca d773ca31
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 8 02:36:06 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 730570ca070fe034123b7dc55f80f49e332413ca
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 8 02:35:11 2024 -0600
+
+ XASY: Fix passing in additional asymptote args.
+
+commit 8bc6dcf14a559d74f28f5af248070349d9c88eac
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 8 01:13:11 2024 -0600
+
+ VCPKG: Bump vcpkg baseline.
+
commit d773ca31bd669e51263748c9e08324f985b31f95
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Oct 7 10:43:36 2024 -0700
Improve build-asymptote paths.
+commit c89a69a2fbfb0d67590bf000cf2c0a89a68610ad
+Merge: f44f70c6 be6cde32
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 3 21:46:49 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit be6cde3282da117e7dee66f2f6ed269fe66fec91
Author: John Bowman <bowman@ualberta.ca>
Date: Thu Oct 3 20:46:04 2024 -0700
Prebuild pdf and info files for all source releases.
+commit f44f70c60d26e8fe05eeb3dbaa185d3bdffb8823
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 3 21:36:44 2024 -0600
+
+ BUILD: Copy dll files to CTAN output directory as well in build-asymptote.ps1.
+
+commit 0876ddee80b7143a5a7d6deaa15969df1de71e25
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 3 20:26:45 2024 -0600
+
+ BUILD: Use ASYMPTOTE_BUILD_SHARED_DIRECTORY for detecting extfilesRoot path.
+
+commit 66b0f9dff50e125798e251b5f4b6da6728e974cb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 3 20:25:28 2024 -0600
+
+ BUILD: Use ASYMPTOTE_BUILD_SHARED_DIRECTORY for outputting CTAN file.
+
+commit cbc265c1590e8818185ccce341b15766bee29c47
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 1 22:10:11 2024 -0600
+
+ BUILD: Fix installation of external documentation files.
+
+commit dbeb75375392f9f5967c3f3cd867206e1e4cdb5d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 1 22:06:33 2024 -0600
+
+ CI: Add trailing slash to extfiles during package-asy-install.
+
+commit 25eeeb5472cfcb7e5b372a8125c3be30453ed6fd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 1 22:03:05 2024 -0600
+
+ CI: Reconfigure linux with version override information during docgen.
+
+commit 99efd94d4dddf0344e8953b1783099e2850377d0
+Merge: 14cc566d 82c919fb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 29 23:42:19 2024 -0600
+
+ Merge remote-tracking branch 'origin/master' into msvc-support-make
+
+commit 14cc566d926c8ab1a94ebe7f4904fe8c6a08cca2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 29 23:40:43 2024 -0600
+
+ W32: Use checkShellExecuteResult to check displaying files outside help.
+
+commit c9f89d622e195bfca39a6d7d9417b642de68f61b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 29 23:40:13 2024 -0600
+
+ W32: Use ShellExecuteA to display asymptote help file in windows if default viewer is not given.
+
+commit 6014d9534f43dbe6308f9e247c5f02862977dcd1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 29 23:39:47 2024 -0600
+
+ W32: Add helper function to validate ShellExecute/ShellExecuteEx's result.
+
commit 82c919fb26d44f80ddf13b1b9b5f19f023ca4fd7
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Sep 22 20:58:05 2024 -0700
Fix revision efc15f4d3cf0f2891ac944d9d0fa3f57a8966fdb.
+commit ff1c616e8592e130e90f2a50ef3d6d8e676a71be
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 22 14:04:58 2024 -0600
+
+ BUILD: Enable usage of installed NSIS if present.
+
commit 88a0a7bd733c84a496257c4b0d4cdb2065798345
Author: John Bowman <bowman@ualberta.ca>
Date: Wed Sep 18 09:24:29 2024 -0700
Exit gracefully with "qualifier is not a record" instead of aborting.
+commit 85f29c2f9d0887f3e08e1c21ea75948a76e5080f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 15 00:54:47 2024 -0600
+
+ BUILD: Determine version automatically in build-asymptote.ps1 for windows.
+
+commit d83a6d34afbc80bfb67feda456f6b6e8d3e09524
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Sep 14 22:41:54 2024 -0600
+
+ CI: Fix determine_asy_version CI stage.
+
+commit 8cc0d0a551c50998bee03e891f0aa52f1097e00b
+Merge: 24679056 c1c5f761
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Sep 14 22:40:28 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 246790569fe2e0ef1c6c3c069991f74595adfcd9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Sep 14 22:36:20 2024 -0600
+
+ CI: Use python script to determine asymptote version.
+
+commit af02da8c4e3c71b9f52a4042bbf449eb5f20f826
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Sep 14 22:35:10 2024 -0600
+
+ PY: Add script to determine asymptote version.
+
commit c1c5f7613f02b5407a6fdb28674c2ba5edad4a01
Author: John Bowman <bowman@ualberta.ca>
Date: Fri Sep 13 22:42:32 2024 -0700
@@ -52,12 +427,148 @@ Date: Tue Sep 3 19:28:50 2024 -0700
Check for valid clipping planes.
+commit 47607f3af7889a75a0ef129313f9ca6b582546ad
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Sep 3 21:58:46 2024 -0700
+
+ Fix comment.
+
+commit 2a65229976b4a2533011216c611ea21c89825144
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Sep 3 21:53:57 2024 -0700
+
+ Update HOWTO-MSWindows.
+
+commit 7c80031204505ca6f16fe5dd7b96b898485a670d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Sep 3 22:50:51 2024 -0600
+
+ BUILD: Move asymptote setup file instead of copying.
+
+commit f05b0fe99fee4790ce49a70af15e6e78435d5b71
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Sep 3 22:38:36 2024 -0600
+
+ BUILD: Build CTAN asy for windows in build-asymptote.ps1.
+
+commit bbfb13aff4e146c8d907d1cfccba1ca8c691b5e3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Sep 3 22:21:56 2024 -0600
+
+ CMAKE: Add preset for CTAN for windows.
+
+commit 18d96804836250863c7c2b77856eb17d8f96bc13
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Sep 3 22:17:11 2024 -0600
+
+ BUILD: Copy installer files to the build root.
+
+commit 6e07a11772810168210ec694d4539b1135006bb2
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Sep 3 20:07:49 2024 -0700
+
+ Update shared directory.
+
+commit 1707c1fb468243a3c55c2580ff7822972ae6a254
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Sep 3 21:01:49 2024 -0600
+
+ BUILD: Add asymptote.pdf to build-asymptote.ps1.
+
+commit ee85f42d88aab58a3b7a93353dccd21a6597189e
+Merge: 1a74d2f3 db6d2426
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 16:25:35 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 1a74d2f3f4a562cbfd80abf8aba855ee16f6e3d3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 16:25:25 2024 -0600
+
+ BUILD: Update instructions on building asymptote on windows.
+
+commit 3596a172fc64fb486f0f0b33fa54719ca7f607d7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 15:37:06 2024 -0600
+
+ BUILD: Replace build-asymptote.dos with ps1 script that uses CMake.
+
+commit 0385a313ba3e984e1bbff9b81a767cf4393d37fd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 14:16:34 2024 -0600
+
+ DOC: Update documentation on handling ninja dependency.
+
+commit b26c8a80c9509c6b5f6fb0f7aa3a401eb7d85787
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 13:06:35 2024 -0600
+
+ CMAKE: Re-add preset for existing asymptote.pdf.
+
+commit 85d62e50b2076498796c7c2fe24cfb932692dfe1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 13:04:38 2024 -0600
+
+ CMAKE: Disable LSP building in msvc/release builds temporarily.
+
+ See https://developercommunity.visualstudio.com/t/MSVC-Compilation-failed-with-boost-templ/10734959 and https://developercommunity.visualstudio.com/t/C-Syntax-Error-after-upgrading-to-Visu/10724553 .
+
+commit fe5b700a7180ff091d21fb97a783e0337e96b7d2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 00:21:45 2024 -0600
+
+ CMAKE: Modify presets for msvc/release with external docgen to use new cache variables.
+
+commit cfec6670dc35615e175f69012f44dc1648a3af44
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Sep 2 00:18:22 2024 -0600
+
+ CMAKE: Modify documentation generation options to allow for specify external directory for all files.
+
+commit c7fc84be4583bc1de6c6174c2beaed76488c1fae
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 23:06:09 2024 -0600
+
+ W32: Remove the world "application" from System error.
+
+commit cd59c48832654ca4b518e43fedfdfbb1f7475c76
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 22:20:11 2024 -0600
+
+ DOC: Simplify dependency notes for windows docgen.
+
+commit 578de54395a1aa836122b58d2d8244aacc458cc7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 22:03:55 2024 -0600
+
+ CMAKE: Remvoe SYSDIR from asytest.
+
+commit 74cab4c0263972b119c6febaf539a75ade299f00
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 21:52:58 2024 -0600
+
+ CMAKE: Add option for CTAN build.
+
commit db6d2426749080e7a5035668bb3ffee867a65ec2
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Sep 1 19:42:53 2024 -0700
Reorder ImageMagick arguments.
+commit d7f2a95fe274861172c7fe19ddb7fd8269b58ea5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 21:05:05 2024 -0600
+
+ CMAKE: Add tests for template tests.
+
+commit 81d0ffcb6dccf2172ca69a27618bf333c4608b4f
+Merge: 080b4447 604e0e09
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Sep 1 21:01:36 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit 604e0e09f82116b3dd8c613f8439fb2e994dcd9b
Merge: abb6d707 442b9b6f
Author: Charles Staats III <charles.staats.iii@gmail.com>
@@ -83,12 +594,361 @@ Date: Thu Aug 29 17:23:55 2024 -0700
Apply Andy's fix for issue #471: Cannot unravel static field from imported type.
+commit 080b44472cf59090e16f6a0cef00155714f53105
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 18:29:11 2024 -0600
+
+ DOC: Clean up documentation for installing on windows.
+
+commit 305edb54c6f6ccea0d03d4dfc578ccd73bcfb0a8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 18:03:16 2024 -0600
+
+ DOC: Rearrange INSTALL-WIN.md.
+
+commit 7db469aa883b3eb37433fc17c8b9b999a09f7bf2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 14:54:28 2024 -0600
+
+ CI: Use version-override number in building asy's GUI.
+
+commit 5f1e67b7e2275a5f9fdc1ca493344cea11602ff5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 15:27:32 2024 -0600
+
+ GUI: Add "--version-override" option to buildtool.
+
+commit 3f3807ef14733c753895935b7deb428833d4b38d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 14:39:16 2024 -0600
+
+ CI: Determine asymptote version in pull request precheck step.
+
+commit 3173f9d232445a6d9f2e4d3d7f49a4964564761a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 14:39:09 2024 -0600
+
+ CMAKE: Allow ASY_VERSION_OVERRIDE environment variable to be used for overriding version.
+
+commit 388ff0c46faa359e943e1d005d78d11408eec293
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 14:38:42 2024 -0600
+
+ NSIS: Rename build installer script param for easier usage.
+
+commit 91ddba8f238f05f6dcbaeaf4e3393a172dcb39e7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 02:56:28 2024 -0600
+
+ CI: Remove packaging step from build-asy-windows.
+
+commit 91bd1f50e0c6c786dfb35cee9e77460e5b193e8d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 02:05:16 2024 -0600
+
+ CI: Add packaging step for asy.
+
+commit f92cb6206ff0761ce94cf9b6acbe3fc74a5eef0e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 01:31:54 2024 -0600
+
+ CI: Rearrange CI into a single pr-precheck file.
+
+commit 0c6c890633dcd284bd7759593aefdbace81f768b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 01:06:51 2024 -0600
+
+ CI: Remove on-push CI run.
+
+commit 9a8d8f87118f8b77231b5e8225742727ad5353d2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 00:59:28 2024 -0600
+
+ CI: Add workflow for generating UI files.
+
+commit 9e6ab91af1156783baf9940b7a09d0fd7737c125
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 25 00:12:24 2024 -0600
+
+ CI: Remove output directory from asy run command in building latexusage.
+
+commit 869fb73504a7c72eeaf6de0a110d11f5084761ad
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 13:36:55 2024 -0600
+
+ CI: Copy latexusage.pdf to build root for TeX Live support.
+
+commit 2e964f9531c534208bbdabb8bc6f1ea4e81a0efd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 13:21:37 2024 -0600
+
+ CI: Install ghostscript during windows build process.
+
+commit 72b032a86d35ce8b1f87d9917fb6de2de5a86e06
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 13:07:38 2024 -0600
+
+ W32: Add application name to error message.
+
+commit 816f51f1d2c722a5379c61d682b00020205e9a9c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 12:49:42 2024 -0600
+
+ DOCGEN: Remove "-include-directory" for compatibility with TeX Live.
+
+commit 5a4404073b10b77cd77f983a7a45b3d68a50189f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 02:49:39 2024 -0600
+
+ CI: Build asymptote's documentation on windows.
+
+commit d22c2e0c73b92dcebf92089937e4f7c009a11af9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 02:48:56 2024 -0600
+
+ CI: Setup TeX Live on windows CI.
+
+commit 5ea2f86cb30c185219b42c5c3fe896e4d7e0ae43
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 24 00:37:20 2024 -0600
+
+ CI: Replace setup ninja on windows with manual ninja installation.
+
commit 6557661e59511ca9fa65d7b43e9944f5c8b883bf
Author: John Bowman <bowman@ualberta.ca>
Date: Fri Aug 23 20:01:28 2024 -0700
Remove redundant code.
+commit 91905481ab4d654b053b879d3e314d8254f38f94
+Author: John Bowman <bowman@ualberta.ca>
+Date: Thu Aug 22 20:33:11 2024 -0700
+
+ Fix typos.
+
+commit fb85753c908016b69124b2c435d0b737c05b4e33
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 20:55:29 2024 -0600
+
+ W32: Add Ws2_32 library to static linking library.
+
+commit a5c2f091761a9145b3869116ef4fa0c78f2ff7d5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 12:40:13 2024 -0600
+
+ CI: Transition all github actions to v4.
+
+commit 2dda70503521e3fb0cbef19419bbf0bf2293ba69
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 12:27:39 2024 -0600
+
+ CI: Use Install ninja from apt directly for linux CI.
+
+commit 9cc3a2d7f7cebfe429710bf4bdec958fd033ce6c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 02:23:37 2024 -0600
+
+ CMAKE: Handle bezier2 and beziercurve separately in docgen.
+
+commit 17f1456f9541c8eca642a4b068f529c02240c27a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 02:07:13 2024 -0600
+
+ CI: Bundle documentation in package-asymptote-artifacts stage.
+
+commit d935806052d4ed36cbfb794a6e4a30f9e1166f1f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 01:30:21 2024 -0600
+
+ CI: Use ccache for building asy on linux.
+
+commit a6278da9499287bad59d6a8f07a3423022ca0fdf
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 01:29:25 2024 -0600
+
+ CMAKE: Add ccache to compilation preset.
+
+commit b2bb8ca96c58a4b11420c8a49970526b04f1c2a3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 01:25:12 2024 -0600
+
+ CI: Add ccache to env initialization.
+
+commit 7c16b94d344b4a20600f0a9f371aba0e386bd07e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 01:00:24 2024 -0600
+
+ CI: Bump actions/cache to v4 on linux.
+
+commit 8753ca605c6424da78b9fa7aeb726774eac85fd2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 22 00:17:52 2024 -0600
+
+ CI: Add docgen stage to linux CI.
+
+commit 1002b337879cf6408bbe0fce8c4631e5082c12bf
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 21:47:37 2024 -0600
+
+ DOC: Add documentation for generating install file on windows.
+
+commit 8b909e6ebdf41fcd07df6600761bd3426e48bcf3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 21:10:06 2024 -0600
+
+ REPO: Add extfiles to ignore list.
+
+commit caeaee5ca8faf7c546736beec6e3d0f4da6adc12
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 03:09:28 2024 -0600
+
+ VCPKG: Add baseline for manifest file.
+
+commit 13b33f2305a2c5aba3a5765506a4d6f4c328fd47
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 03:05:23 2024 -0600
+
+ CMAKE: Add install prefix to win32 presets.
+
+commit b11ca50dd5d142bad8b731832cea2a8b927955a7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 02:56:14 2024 -0600
+
+ CMAKE: Add asygl.js to list of files to copy.
+
+commit a2f29b73ccbd45afbb47606831082e77f538b635
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 02:47:30 2024 -0600
+
+ CMAKE: Install README, LICENSE, and asy icon files.
+
+commit eb4d4905a19b58b44a69b55af6cff66d69653f4a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 02:41:28 2024 -0600
+
+ CMAKE: Add additional files to docgen.
+
+commit 5dde08d655c3e72f510246c38439aaeafd19d56a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 02:37:11 2024 -0600
+
+ CMAKE: Add option to specify or search for pdftex.
+
+commit 78ac2bcb8c74cfbcf15f0b2a7674f0c48eb8a51f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 00:22:48 2024 -0600
+
+ CMAKE: Copy asymptote.pdf and other documentation files properly after build.
+
+commit 006ea9e60aa3017965b9160a10c64bea8b4841e5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 00:22:24 2024 -0600
+
+ CMAKE: Move error message for insufficient components to install stage.
+
+commit abd23b2d0ff0ce83fcf81ea5fb91e1cf7a1b9b7f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 00:21:52 2024 -0600
+
+ CMAKE: Add custom docgen target and list of documentation files.
+
+commit 652197730386000f22cdb7df11507c3c85ec7b60
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 00:21:29 2024 -0600
+
+ CMAKE: Build asymptote.pdf only if ENABLE_ASYMPTOTE_PDF_DOCGEN is true.
+
+commit d651f0be009b459475e20a43b8ccd3d7bca716ac
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 19 00:20:29 2024 -0600
+
+ CMAKE: Add option to specify external asymptote.pdf file.
+
+commit da697b6421c6aa05b44d5316d340595518646195
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 23:21:16 2024 -0600
+
+ W32: Add helper python script to build installer file.
+
+commit d3ef2bfbf1915e89358c4187d55ba415a99db669
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 23:15:12 2024 -0600
+
+ CMAKE: Fix formatting in options.cmake.
+
+commit 0183b01d6d6d8a3ed82abfa049637f247a5e8b95
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 13:36:37 2024 -0600
+
+ CMAKE: Add additional files to pre-NSIS installation.
+
+commit b6d037b9ee900854d3a24894302ab3011caf85d1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 01:45:55 2024 -0600
+
+ CMAKE: Add draft win32 pre-nsis install script.
+
+commit 3ff1332f1eca64b6937d81c8a2a59082a7fc5bb7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 01:13:36 2024 -0600
+
+ REPO: Add cmake-install-* to ignore list.
+
+commit ae75e1ce4c33750df8440b898bb81ba241ba2775
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 18 00:17:44 2024 -0600
+
+ CMAKE: Add option to override asymptote version.
+
+commit 0e285eb89de8ad5fc886a35901855152adc0a4e9
+Author: Supakorn "Jamie" Rassameemasmuang <rassamee@ualberta.ca>
+Date: Fri Aug 16 02:41:07 2024 -0600
+
+ CMAKE: Add asymptote.pdf build target for linux.
+
+commit 6075b61a0b502701449f5cc0737d1811c0de4b86
+Author: Supakorn "Jamie" Rassameemasmuang <rassamee@ualberta.ca>
+Date: Fri Aug 16 02:32:37 2024 -0600
+
+ CMAKE: Fix CDlabel case-sensitive typo.
+
+commit 315d7958ca29a6e0e23b2d86789359070d1e5329
+Merge: 17965535 c2e57e12
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Aug 16 00:39:56 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 17965535285f79f0c5b8296f2526350403bb775a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 15 23:31:05 2024 -0600
+
+ CMAKE: Add docgen target for asymptote.pdf in windows.
+
+commit aebd49b7eea14eeb04ec9aa644158ad81b52a862
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 15 21:24:21 2024 -0600
+
+ CMAKE: Generate remaining documentation-related asymptote files in docgen.
+
+commit f668036f88f1f1b193fb18efee568f51c82ef350
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 15 23:42:15 2024 -0600
+
+ CMAKE: Fix incorrect option() usage in options.cmake.
+
+commit df956c94d855f8e52887d17e0d1a7739cf6d9c94
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Aug 15 23:30:38 2024 -0600
+
+ CMAKE: Determine if the system can build documentation properly.
+
+commit e7e7365b8e02f49e534d015e2b5102c90f008e8e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Aug 16 00:11:18 2024 -0600
+
+ CXX: Use _unlink for windows builds.
+
commit c2e57e121a47f9f44d80a2012eec05e949c95d99
Author: John Bowman <bowman@ualberta.ca>
Date: Thu Aug 15 01:16:14 2024 -0700
@@ -119,6 +979,13 @@ Date: Wed Aug 14 21:58:18 2024 -0700
Update introductory talk.
+commit 35e076eeaf7057db11df777ac41db80532acb768
+Merge: 1b8712e8 a058c4b3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Aug 14 18:06:01 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit a058c4b32712c63169cabbe8ea4a9b2e4b887203
Author: John Bowman <bowman@ualberta.ca>
Date: Tue Aug 13 00:45:39 2024 -0700
@@ -173,6 +1040,13 @@ Date: Mon Aug 12 14:28:24 2024 -0700
Only recenter camera on nontrivial scenes.
+commit 1b8712e8fecdbd0102ba0af72832f03d82d084a2
+Merge: 98508450 b730244a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 15:25:25 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit b730244a19a1b686138491a0c3c4fd9ea3e7ce00
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Aug 12 13:43:30 2024 -0700
@@ -191,12 +1065,67 @@ Date: Mon Aug 12 04:13:42 2024 -0700
Fix last revision.
+commit 985084504e91de56d468b6238097616879c6c28f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:36:16 2024 -0600
+
+ PY: Fix generate_enums.py.
+
+commit 3b3f8258eb8daa1e8953b795bf7814db82b2c29d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:34:27 2024 -0600
+
+ REPO: Add draft version.texi.in.
+
+commit 1c5389a4fad9d73d885f15da8e38e0a92a21de05
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:34:09 2024 -0600
+
+ REPO: Unignore version.texi.in.
+
+commit 619c4c1dc308096df9c4b6b5206dcc8b20113e43
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:14:29 2024 -0600
+
+ CXX: Fix glrender.cc's args.tup.
+
+commit 834efe1548177677f79212b0c6d921f016e13615
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:13:37 2024 -0600
+
+ CXX: Fix error function in asyparser.cc.
+
+commit cae051f5a9953e8310bc197a2c54cfe33f9a4ebb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:10:15 2024 -0600
+
+ CXX: Fix definition in picture.cc.
+
+commit 726e71d2c5776d44531cec87128e1b65204ce4a8
+Merge: 2aec573d 560ffb6e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 01:07:14 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 2aec573d313e806bc32083efda0b746228cf6b14
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Aug 12 00:45:57 2024 -0600
+
+ CMAKE: Add rule for generating options file for doc.
+
commit 560ffb6e408ad5301f26e318594274e7aa08ed3f
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Aug 11 23:34:20 2024 -0700
Make -debug report traceback only on error.
+commit eb0418fd0fc75f9024f019b0b3c5e7bf931afeb9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 11 20:09:04 2024 -0600
+
+ CMAKE: Add target for relevant asymptote files in docgen.
+
commit 2307614f006498aeb73c2db22fbf3ecced03869f
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Aug 11 18:33:03 2024 -0700
@@ -222,12 +1151,416 @@ Date: Fri Aug 9 12:28:26 2024 -0700
Add url option to figure function in slide.asy.
+commit 797c84dbb66101306e2321cc378d5ddba3d06d5f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Aug 7 02:33:44 2024 -0600
+
+ CMAKE: Add target for latexusage.pdf.
+
+commit 3d3351f8149a5f4814c9f1f7defec92430396a51
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Aug 7 02:28:09 2024 -0600
+
+ DOC: Add script to build latexusage.
+
+commit 269a346b471067547950d299c8e2e0d395fcd4f7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Aug 7 02:20:03 2024 -0600
+
+ W32: Terminate process before exiting program in Win32IoPipeStream.
+
+commit 35b37cf5356225c156d657706cd013d5f4a26b55
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Aug 6 23:14:26 2024 -0600
+
+ W32: Check if ReadFile is from a closed pipe or not.
+
+commit aea92ab1bd68f10c20270d1fc2ac94a3ab104a5d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Aug 6 10:42:39 2024 -0600
+
+ CMAKE: Add target for asy-latex.pdf.
+
+commit 715a560bad0d23e4978de3aa8fb599c39180bec3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Aug 6 10:29:50 2024 -0600
+
+ CMAKE: Add skeleton for docgen on windows.
+
+commit e77cf15e28140cb9332e38e6258ef09932ff9a58
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 21:04:08 2024 -0600
+
+ MAKE: Add PYFILES dependency to install-asy.
+
+commit 4eba858315796cf3f5ea329e2614f4e459406d31
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 21:02:47 2024 -0600
+
+ MAKE: Add PYFILES to DIST variable.
+
+commit 885d64f54a50a5412dd1980f6a70f54011f5acd1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:55:26 2024 -0600
+
+ MAKE: Add doc/version.texi to sty dependency.
+
+commit eb47e3b4917201723c74868dd862c3487df248f0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:50:20 2024 -0600
+
+ MAKE: Restore glew to asymptote build dependency.
+
+commit fb68546339e920b6269ec6a4403e068638c84f55
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:41:20 2024 -0600
+
+ AC: Add HAVE_ZLIB define universally.
+
+commit 70a24707a64658ceeb05d8b7f6ab32d1db7c1e27
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:31:18 2024 -0600
+
+ MAKE: Make uninstall work with updated GUI layout.
+
+commit 0921bb6e1918743972bf4b3489de913c23163e7c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:26:04 2024 -0600
+
+ MAKE: Make install work with updated GUI layout.
+
+commit 23513942941fa1bf1b4da5134c0578d764af5357
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Aug 4 20:23:19 2024 -0600
+
+ PERL: Make asy-list.pl work with strict Perl.
+
+commit 35ec3c2f8d0b504ec28f8661713a96c4404ae439
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 16:23:21 2024 -0600
+
+ Make: Use built-in glew for makefile builds.
+
+commit 937b6af7b031b16a03ffb798e6814f643ec937d0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 16:21:26 2024 -0600
+
+ MAKE: Make gen_preprocessed_depfile.h work with parallel builds.
+
+commit 2a6a58f2cdad340fe920b51a6a949ebc1aa1a150
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 15:51:26 2024 -0600
+
+ MAKE: Restore autoheader to Makefile.in.
+
+commit 85ba9045fd9f7337d990c0405b37bf4fe9379078
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 15:01:34 2024 -0600
+
+ GL: Use included glew source for cmake builds.
+
+commit 9997b5edb2f593172b37ef3d1a8a8caea3b18a9d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 14:11:59 2024 -0600
+
+ MAKE: Make xasy target work with Makefile.
+
+commit c3dd075f1586a104380d6a88e73b3aa68013c9ba
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 14:10:53 2024 -0600
+
+ GUI: Add xasy.py as a launch shortcut.
+
+commit ff0e780834985e1f79542703c7bf2e66a37f1ded
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 13:41:21 2024 -0600
+
+ MAKE: Add GUI/xasy* module targets.
+
+commit 06dadf46f03a41808e6f439c81299ef878e49ed5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 13:13:18 2024 -0600
+
+ MAKE: Remove LspCpp from Makefile.in.
+
+commit c1eab5181057533b30d85dc87cfbf4cd7f7a0469
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 13:10:22 2024 -0600
+
+ MAKE: Fix cleaning of acextbuilds.
+
+commit 12aed932c289293b9504a5d5a433ebd0e31e9b70
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 12:53:57 2024 -0600
+
+ GUI: Add __pycache__ to ignore list.
+
+commit 7b895bd208058fb2d7c8754b6496879ba1fc3b56
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 12:50:58 2024 -0600
+
+ GUI: Add option to buildVersionMoudle to use specified version.
+
+commit 5060c2054424238620339bf11c598b1f53f624fe
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 11:42:41 2024 -0600
+
+ GUI: Update buildtool.py to get the version information from configure.ac.
+
+commit 7a56512bebceca1fd8b50a0ad4944cf3dde02712
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 11:25:38 2024 -0600
+
+ CMAKE: Fetch package version information from configure.ac file.
+
+commit 962cd4c4aa2e15fd626c8cfe7834d68ab079944d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 11:17:03 2024 -0600
+
+ PY: Add script to fetch package version information from configure.ac.
+
+commit b43bf009fd0b67401dd09a7e5a7eb041b98a1fcd
+Merge: 926b16f8 1a683cb0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Aug 3 10:29:05 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 926b16f81110df438e127af1e9b1c2bbfa6589cf
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 12:58:19 2024 -0600
+
+ MAKE: Add acextbuilds to clean target.
+
+commit 3f35eb894eb1e8b174165b431c7996b3d4330dc7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 12:57:34 2024 -0600
+
+ REPO: Add acextbuilds to ignore list.
+
+commit dca520992423feb07ba18b5ae1e7f6935a983cc0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 12:56:59 2024 -0600
+
+ MAKE: Build LSP in Makefile.
+
+commit 886ce7f414244a3a8534abacc2d4b32e61a288b4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 12:56:23 2024 -0600
+
+ AC: Make LSP work with autoconf.
+
+commit 41f2ef35de9ea1ceeb1640557c587f14879ed871
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 12:56:07 2024 -0600
+
+ CXX: Ensure HAVE_LSP is visible to CXX files.
+
commit 1a683cb01c6bec7948befe5bfc941a2b1d9de788
Author: John Bowman <bowman@ualberta.ca>
Date: Wed Jul 31 04:59:54 2024 -0700
Improve camera autoadjust when keepAspect=false.
+commit 0b69049743dbe0e0aa319534cfffc1a0f6d648d9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 00:17:48 2024 -0600
+
+ AC: Remove *** from non-urgent messages.
+
+commit d70d2747f0a5303c88d002f7e6fc15b468881981
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 00:07:44 2024 -0600
+
+ MAKE: Ensure version check is called every time.
+
+commit 7673f137cfd082c65120dafeeb1ef0285a014d3d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 00:03:24 2024 -0600
+
+ CXX: Ensure config.h is directly or indirectly included in all cc files.
+
+commit 1426e5b89247200194b8efcf8f46b1cbf9bef26c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Jul 31 00:02:58 2024 -0600
+
+ AC: Reintroduce header config files.
+
+commit e734bab10dc394f592afe3d52f057212ee3c4b53
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 22:01:12 2024 -0600
+
+ MAKE: Add revision.o to asy dependency.
+
+commit 587ff8958d156ee1d508556ca5b7bde63463ef15
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 21:47:10 2024 -0600
+
+ AC: Set with_vcpkg to default to no.
+
+commit e758204a00af4766a3bf06d980752275d0696c07
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 21:43:15 2024 -0600
+
+ AC: Fix test "x$with_vcpkg" != "xno".
+
+commit 442fc40da78af9b4f7ab1e7c9b203f2f3d174a31
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 21:00:38 2024 -0600
+
+ REPO: Add fleet files into ignore file list.
+
+commit 3f92e6d6ab59131b82b18c04666ed0fc17039819
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 01:36:42 2024 -0600
+
+ CMAKE: Use VERBATIM option only on unix systems for gen_preprocessed_depfile since it was causing problems on github runner and windows.
+
+commit 98c49c8c3d9ccf2dfa324d2423d3e5f0b65ced92
+Merge: 7a67ba57 e4ef069e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 30 01:24:30 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
+commit 7a67ba5747d9981115cfe6193f6a54b29f4b019c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 29 00:03:01 2024 -0600
+
+ MAKE: Add additional generated files to clean list.
+
+commit 7f486be1ef9786493285d574b528e765afa9988c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 29 00:00:22 2024 -0600
+
+ MAKE: Split version build target into multiple files.
+
+commit 046518d38fae4cd6901d32bf7523c41dea6877ef
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 23:42:04 2024 -0600
+
+ MAKE: Remove windows-specific routine in Makefile.
+
+commit b52e03c4c3ab45e6a926bd78511a925ddcdcda0a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 23:40:19 2024 -0600
+
+ REPO: Ignore keywords.h instead of keywords.cc.
+
+commit 571466e7aa51edd35e9650158f68cf5aca67fef0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 23:39:33 2024 -0600
+
+ MAKE: Set makefile build system to be on par with cmake on dependencies.
+
+commit 26e8b4971485ef2edcbce7b76fe36dd16fbc48c9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 21:39:49 2024 -0600
+
+ AC: Fetch tinyexr from github.
+
+commit 28d99ceeb855d83f72c263cd6c978e76060f6926
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 03:30:27 2024 -0600
+
+ CXX: Remove unused #pragma from util.cc.
+
+commit 7644a97545a19a50750df90131b0017966a3a7f9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 03:04:31 2024 -0600
+
+ AC: Always include HAVE_UNORDERED_MAP since we are >= C++11.
+
+commit 837810b54d0fbfc9a0943288749ac805491c04a7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 23:37:11 2024 -0600
+
+ AC: Fetch LSP directly from github.
+
+commit 2d547731466e04aced19935f2ffcd059f8704bf9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 02:35:25 2024 -0600
+
+ AC: Move AC_SUBST to the end of the file as these are changed later on.
+
+commit 8a35969828d945934988465476eb3297603e28b7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 02:27:13 2024 -0600
+
+ REPO: Add *.raw.i to ignore list.
+
+commit 3fb5fbb8523f4179ed5df96377102503025e8a38
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 02:08:24 2024 -0600
+
+ REPO: Add additional conftest files to ignore list.
+
+commit 1616c997ac1a79ccd2f1bd44d72c4cbf8a13f130
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 02:08:15 2024 -0600
+
+ REPO: Add extlibs and extbuilds to ignore list.
+
+commit e51fa6224218bfa17f5a6bcdac4a120a818dc5d9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Jul 27 18:56:34 2024 -0600
+
+ CXX: Use <> brackets for optional.hpp.
+
+commit b14ec24f2360512e85b15a90bd48ed748bb085cb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Jul 27 17:49:29 2024 -0600
+
+ AC: Pass in CXX_STANDARD into makefile.
+
+commit 485c5044f784a89b9409942c7bf519193948fb41
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Jul 27 17:49:16 2024 -0600
+
+ BUILD: Add options for extra flags in gen_preprocessed_depfile.
+
+commit bd43a40a18f5809fc50685fc005a1484dca2a3a1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 02:55:47 2024 -0600
+
+ PRC: Check for univesal endianness if on platforms with unknown endianness.
+
+commit f5f3fdcc3e02021f61084e60827cbf438466d01f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 02:52:15 2024 -0600
+
+ PRC: Add endianness check to PRC build target.
+
+commit 026289237dbdb943d2034fa55a93aa30cd66bfed
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 01:05:45 2024 -0600
+
+ REPO: Add confdefs.{h,cc} and conftest.cpp to ignore list.
+
+commit 12054fff7ca428401e3452e7fdb76483281c9abb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 28 23:36:45 2024 -0600
+
+ AC: Make configure.ac work with vcpkg.
+
+commit 1f7dd2f1b444a5417ecab408cd24df1b3ab27305
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 01:01:18 2024 -0600
+
+ AC: Make configure.ac work with vcpkg.
+
+commit 6c51091ad2a619d8947880ddb9c1b00dca77d7c1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 00:37:05 2024 -0600
+
+ CONFIG: Update config.guess and config.sub.
+
+commit 7e31fd8dc3b2b25f157c1a2dad93e082af653b2a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Jul 26 00:01:39 2024 -0600
+
+ XDR: Add HAVE_CONFIG_H in win32xdr.h if present.
+
commit e4ef069ed7e8586c3d6eedd4989eeb91b3ac44bd
Author: John Bowman <bowman@ualberta.ca>
Date: Thu Jul 25 12:18:34 2024 -0700
@@ -240,6 +1573,18 @@ Date: Thu Jul 25 11:52:41 2024 -0700
Update module map and example to use templated imports (issue #470).
+commit bdc8a96080518a980e94859ca4a44cb5bbfd0e4b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Jul 25 01:55:11 2024 -0600
+
+ GL: Delete OpenImageIo include as it's not needed anymore.
+
+commit d9f23a8a3ffad5f0b9c58e873472445502b3f6f7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Jul 25 00:27:29 2024 -0600
+
+ GIT: Add vcpkg_installed to ignore list.
+
commit e51f6aa11fb03151217790643048f3fb3012a6cb
Author: John Bowman <bowman@ualberta.ca>
Date: Tue Jul 23 23:24:30 2024 -0700
@@ -253,12 +1598,31 @@ Date: Tue Jul 23 23:23:22 2024 -0700
Fix settings.render=0.
+commit 8277a902085f71f6ba0004f1ad6d5be598fcaaf2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jul 23 01:31:46 2024 -0600
+
+ AC: Add check for vcpkg.
+
+commit 7caa4c47a3274b57c9046766056144bfb922b436
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 22 22:42:07 2024 -0600
+
+ AC: Set C++ standard to 17 to match cmake build.
+
commit 853e24d9bc8e287c273f02438fe809bc2fdd09d0
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Jul 22 13:45:42 2024 -0700
Enable GLSL error reporting again.
+commit 5f57f90df7a2cd003c8771906049e58b034572cf
+Merge: 467867e5 0a28468d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 22 12:08:17 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit 0a28468d010da5159b1d3cdb921e50b469f629e9
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Jul 21 20:32:17 2024 -0700
@@ -328,6 +1692,51 @@ Date: Mon Jul 15 17:34:09 2024 -0700
This reverts commit 5841f00d6613e9a32aef986520172738e7bb25a8.
+commit 467867e56e61aa3c3c9aa6e9ee796da557ae9d22
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 22:07:46 2024 -0600
+
+ MAKE: Restore Make & configure.ac to the latest in master before removal.
+
+commit 16de122ad5ab3518f458434483400b4456db3d62
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 22:05:17 2024 -0600
+
+ CXX: Move ax_pthread.m4 back to root directory.
+
+commit a985dae236db05babf7303d6da7edb13984cdd29
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 22:00:57 2024 -0600
+
+ Revert "MAKE: Remove Makefile and autotools files."
+
+ This reverts commit f13648ec70031173268fb34b54e097e30a7b21b7.
+
+commit 97768309bfd5b6cbde639472d9b4e503fcc87af2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 21:58:11 2024 -0600
+
+ CXX: Rename process/processutils to asyprocess for consistency.
+
+commit 3cf08837b3d0249597dd543e23330f57d70c00e2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 21:46:02 2024 -0600
+
+ CXX: Move resources and scripts directory to root directory.
+
+commit 2005fd40b5fdea6cdc0cc15b75a872996dce7d5d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 21:30:32 2024 -0600
+
+ CXX: Move src/include/srctemplate files to root directory.
+
+commit 20f7f705e870ee57784480f16532edaf8a39ff80
+Merge: 2d14741e 40f83910
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 14 21:09:58 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support-make
+
commit 40f83910cdf2961adaace41a30450ea5b71c7ad9
Author: John Bowman <bowman@ualberta.ca>
Date: Sun Jul 14 10:50:38 2024 -0700
@@ -346,6 +1755,13 @@ Date: Sun Jul 14 08:54:21 2024 -0700
Fix offscreen triangle groups.
+commit 2d14741e5805a27f75dc76c4a616f02f6252a5f1
+Merge: 030c13a0 472d8ceb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jul 7 20:35:09 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support
+
commit 472d8ceb641a7f6fd6e2246b064b81185485195c
Author: John Bowman <bowman@ualberta.ca>
Date: Sat Jul 6 22:05:06 2024 -0700
@@ -364,6 +1780,115 @@ Date: Mon Jul 1 21:41:32 2024 -0700
Make -d option output call traceback (issue #451).
+commit 030c13a0cfcf5ae4b7630e3079979a3017355b3f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 1 21:17:33 2024 -0600
+
+ DOC: Update documentation regarding rsvgConverterPath option.
+
+commit a33ee4b660319b3335a36c86c6e09966ef99f075
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 16:53:04 2024 -0600
+
+ XASY: Add support for custom svg converter path.
+
+commit 03b5e658b4fc5c1405ed0695ce663f0466e57140
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jul 1 00:10:08 2024 -0600
+
+ XASY: Fix overriding of settings in xasy.
+
+commit 7d744713189b6c0ac1dbff113c6d346c5654f2d9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 16:52:51 2024 -0600
+
+ XASY: Add additional functions to settings class.
+
+commit abb0b023aab1596d1d049fe05c6deba446ee56fa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 16:58:33 2024 -0600
+
+ XASY: Fix import for xasyversion.
+
+commit 103f40aee015fb532995d869ec4f050ee8d9b57d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 16:53:17 2024 -0600
+
+ XASY: Clean up Window1 setting initialization.
+
+commit 5429a4963e89111159bdeb05f369901f109e0802
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 16:20:24 2024 -0600
+
+ W32: Use \x04\n as a terminating character for xasy for all platforms.
+
+commit 5bda6e338aa35a1746b7a4626c9e71620f06ef4c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 13:27:44 2024 -0600
+
+ CMAKE: Add asymptote base files not already copied.
+
+commit d67b37cb583d73e54b0c5e751c7143caf9d91188
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 13:22:00 2024 -0600
+
+ CXX: Rename parser to asyparser to avoid collision with windows' parser.h.
+
+commit ca57ccf5b5e3d264049dc8aa176f9c0976e5a256
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 12:58:04 2024 -0600
+
+ TEX: Escape path when given to tex.
+
+commit 29e01591ac963ad9c31815044677ac48b355a3e6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 12:57:39 2024 -0600
+
+ UTIL: Add escapeCharacters function.
+
+commit 6c8ed678980ffeceafebbe69cc5007f23f05d007
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 11:12:59 2024 -0600
+
+ CXX: Fix exitHandler from master branch.
+
+commit 5e777baf7e8b16096487432d6c0ca6b789b02f1d
+Merge: b4a7504b 5dc79928
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 11:10:02 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support
+
+commit b4a7504b8bdfb26a3a259d3ff9edcd831251855e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 11:07:01 2024 -0600
+
+ CXX: Use _fdopen when possible.
+
+commit 0990ee5d2591424102dd92f7daa1fc186ed51aa0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 01:09:49 2024 -0600
+
+ CXX: Extract "inpipe >= 0" check into a separate variable.
+
+commit 374c7dcea5e86cab4f094ed15d88ef59a845b8af
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 01:07:38 2024 -0600
+
+ CXX: Extract runhistory.in's readline function initial check.
+
+commit b4698efdc38843cb99678c3989042332a7075002
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 00:56:11 2024 -0600
+
+ LSP: Bump GIT_TAG for LSP repo.
+
+commit 80dacad9459ee397cde24d4ebeb13a718d19a3bc
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 30 00:55:49 2024 -0600
+
+ CXX: Move major functions in fileio.h to fileio.cc.
+
commit 5dc7992891de07af146317ad053ee56d9ffd938d
Author: John Bowman <bowman@ualberta.ca>
Date: Sat Jun 29 21:13:23 2024 -0700
@@ -654,6 +2179,18 @@ Date: Sun Jun 2 17:39:49 2024 -0700
Remove automatic recordInitializer for imported templates; add test.
+commit c2ddde9f86e4533fc625997b8bf21791240c6b20
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 2 15:50:02 2024 -0600
+
+ XASY: Remove fromBezierPoints.
+
+commit 3b8f230e281f6796703de8932f0463474ef4c770
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 2 15:09:32 2024 -0600
+
+ XASY: Add --additional-asy-args to xasy.
+
commit 3f6f4361af778517867837b79cc56db28e791935
Author: Charles Staats III <charles.staats.iii@gmail.com>
Date: Sun Jun 2 13:28:17 2024 -0700
@@ -666,6 +2203,12 @@ Date: Sun Jun 2 12:52:08 2024 -0700
Minor readability improvements.
+commit 426c06840600852a8a80c493b42b3f9c75a0a9d4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jun 2 12:44:23 2024 -0600
+
+ XASY: Use StringIO for xasy2asyCode.
+
commit d22b41fb0e7eaf2290951409abf2f867aa317850
Author: John Bowman <bowman@ualberta.ca>
Date: Sat Jun 1 23:39:39 2024 -0700
@@ -856,12 +2399,113 @@ Date: Tue May 21 23:12:58 2024 -0700
This reverts commit 6e8222e13ad71b03376c84f259bf126944beb303.
+commit 3baf11a2ef131e779dde06356f6c20ac3d4aaded
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue May 21 00:18:35 2024 -0600
+
+ XASY: Use windows temp directory directly.
+
+commit 51f58653157f5a1a11f98bc10ac3f41c4f18a694
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue May 21 00:17:28 2024 -0600
+
+ XASY: Move xasy files and imports for compatibility with PEP 517 packaging system.
+
+commit b828e918cf716d1aab2a5c65472c523bc6d3154a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue May 21 00:02:55 2024 -0600
+
+ XASY: Add version generation to build aid script.
+
+commit 9c23ab47190f0abcba32b1d82a426adff34cd771
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon May 20 12:48:49 2024 -0600
+
+ XASY: Add aid scripts for development.
+
+commit 87f8f280897e8fa61b6e7d6ee876f5a536b6efd5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon May 20 12:43:21 2024 -0600
+
+ XASY: Remove duplicate gitignore files in main asy directory.
+
+commit dc8b4b85b9c3b3b22fa0831ba005b1750c8082cb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon May 20 12:30:55 2024 -0600
+
+ XASY: Add buildtool script.
+
+commit fcac100d96025f6b16e0629c769542eca25a7c6f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon May 20 12:30:10 2024 -0600
+
+ XASY: Add develop requirements.
+
+commit 3912b7d779d4135b0a8bb1f92ae326b52336e6c0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat May 18 23:37:16 2024 -0600
+
+ XASY: Add gitignore for xasy.
+
+commit 2ab4ac960bdd206a190da463647b9def55afb213
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat May 18 20:08:31 2024 -0600
+
+ XASY: Remove rsvg-convert from requirements file.
+
+commit f16cd641e51e5dde9c28aa4735c7e9be9d1123fc
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat May 18 20:07:35 2024 -0600
+
+ XASY: Update requirement versions.
+
+commit db9b2954ff472fbda07f95bf1df7e2e6ef8fe687
+Merge: b6671564 8fbeeaa6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat May 18 20:03:10 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support
+
commit 8fbeeaa6bb7a84be36942b0622294391e46783de
Author: John Bowman <bowman@ualberta.ca>
Date: Fri May 17 16:03:19 2024 -0700
Fix documentation.
+commit b66715648df3559650101d343f5c34399e90bc8b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Apr 11 11:32:45 2024 -0600
+
+ ASY: Increment version to 2.90 for cmake.
+
+commit 9d9d67aab1bc9fd2444e9b40852fc84b8b05ea66
+Merge: da0ecbd4 8b606e7a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Apr 10 23:35:31 2024 -0600
+
+ Merge pull request #10 from vectorgraphics/msvc-support
+
+ update msvc support
+
+commit 8b606e7a66797d6f8c99283733a7813e0894e00e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Apr 10 23:02:58 2024 -0600
+
+ CMAKE: Fix readline import.
+
+commit ee52a02fde8d472adb0c3503624fa50bfc4816c4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Apr 10 22:40:08 2024 -0600
+
+ CXX: Change RPC macro to HAVE_LIBTIRPC.
+
+commit b2f03f07111984f2466ebac0dc689f15868be925
+Merge: da0ecbd4 8371bce0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Apr 10 22:17:59 2024 -0600
+
+ Merge remote-tracking branch 'origin' into msvc-support
+
commit 154a9d938d5c97aa75e83a88ef3de22444d422a5
Author: Jouni K. Seppänen <jks@iki.fi>
Date: Fri Apr 5 15:21:57 2024 +0300
@@ -1092,6 +2736,58 @@ Date: Tue Mar 5 09:41:06 2024 -0800
Specify PDF 1.5 instead of 1.4.
+commit da0ecbd4e2f79eac43283d2e20f24eb7aeaed37c
+Merge: 091c183d 00ac5da3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 22:01:19 2024 -0700
+
+ Merge pull request #9 from vectorgraphics/msvc-support
+
+ Update msvc support
+
+commit 00ac5da370e5a7db35e465e275a6de607b25171f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 21:23:12 2024 -0700
+
+ CI: Add version suffix to windows CI build.
+
+commit 22b0a2d43835592297996564793a9967c2e04f21
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 12:29:43 2024 -0700
+
+ CI: Add version suffix to linux CI build.
+
+commit ec303780fb6ce55cf20906470cc23644274d0468
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 12:22:07 2024 -0700
+
+ CXX: Change process.h to processutils.h since it collides with Windows' existing process.h.
+
+commit 943b0d5440449ae9f41f443057ddeb92c35b7512
+Merge: 1bf3e0ec cd07b1d3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 12:15:52 2024 -0700
+
+ Merge branch 'master' into msvc-support
+
+commit 1bf3e0ec4bb154f670b6e44f08b3262601eba0b0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 12:11:46 2024 -0700
+
+ CMAKE: Add documentation for speicfying custom version suffix.
+
+commit d05ccd29522b043c74d8992058bf883375b64e07
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 12:09:33 2024 -0700
+
+ CMAKE: Add support for custom version suffix.
+
+commit fd497578538a3b2c589d0a6fea51823a58740a45
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Feb 29 11:29:14 2024 -0700
+
+ CMAKE: Bump version.
+
commit cd07b1d33a9a500e7a4a5835ad39168621ed255f
Author: John Bowman <bowman@ualberta.ca>
Date: Wed Feb 28 11:31:53 2024 -0800
@@ -1177,6 +2873,27 @@ Date: Fri Feb 16 22:09:44 2024 -0800
Open context menu only for GUI-drawn items.
+commit 091c183d6a6c5e5e7e53b87488e11b81b3b4235c
+Merge: c5648284 585bad04
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Feb 14 21:44:54 2024 -0700
+
+ Merge pull request #8 from vectorgraphics/msvc-support
+
+ Add packaging step to CI.
+
+commit 585bad046cb9d8c319d0775bf000551afc9b0041
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Feb 14 11:52:08 2024 -0700
+
+ CI: Add package step for windows.
+
+commit 315f32d9bbfedee7602b4deb03810a79139fbee2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Feb 14 11:46:29 2024 -0700
+
+ CI: Add package step to linux build.
+
commit c60f3b513670f266a33c55dd0e11255d1ebaac8d
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Feb 12 21:24:21 2024 -0800
@@ -1330,6 +3047,79 @@ Date: Thu Feb 8 15:22:12 2024 -0800
tests with wrapper
+commit c564828450c3bcbaf4b5493aab02f8422c3bb0f7
+Merge: 44544fc8 e3d8a5cb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Feb 7 00:42:05 2024 -0700
+
+ Merge pull request #7 from vectorgraphics/msvc-support
+
+ Update a/ci-staging
+
+commit e3d8a5cb53bebca0710eda673eae283e3efaaf31
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 15 23:30:45 2024 -0700
+
+ CMAKE: Add Debug compile flag to all debug builds.
+
+ (cherry picked from commit ccc94a2ac66f88850d6295686701ff1c3cadab81)
+
+commit d1973fffa1dd5e29c1738e851c388c368ab2f78c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jan 9 02:46:25 2024 -0700
+
+ clang-format: Add BreakAttributes to formatting.
+
+ (cherry picked from commit 9c3bccfe8508a0eb425228b1cc63bd010aeb460f)
+
+commit c59e820c4b5d528f4ccbd75287f0213b9db027e3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Jan 9 02:05:12 2024 -0700
+
+ clang-format: Use C++17 as formatting standard.
+
+ (cherry picked from commit 0ea0878a89bff32ca48b94629c51516e9a0b7e1d)
+
+commit accc9032f21964b6a06cb016178195d21bd08d3a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Feb 4 13:05:39 2024 -0700
+
+ CMAKE: Remove redundant asy-base-file target.
+
+ (cherry picked from commit fda3082675200917795903267d3db07f284dad41)
+
+commit e06e7fde332227bfb1818ea5175815abafd98824
+Author: John Bowman <bowman@ualberta.ca>
+Date: Thu Jan 18 13:14:09 2024 -0800
+
+ Address issue #392.
+
+commit 279d9d49e383a80ca0e82d053bc04d387aa3ca12
+Author: John Bowman <bowman@ualberta.ca>
+Date: Thu Jan 18 12:46:41 2024 -0800
+
+ Fix issue #419: suppress duplicate error message.
+
+commit 79fd87c4075031f8a062c0060736d3e366f0f500
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Jan 16 17:27:00 2024 -0800
+
+ Suppress warning message regarding boolean operator.
+
+commit e8f7bc100601912298eaaa56758aa6994d1db998
+Author: John Bowman <bowman@ualberta.ca>
+Date: Tue Jan 16 17:23:33 2024 -0800
+
+ Revert "Fix boolean operator."
+
+ This reverts commit fffdb62031f4f68007b2721bdd8ef86ef37d8e3d.
+
+commit b42f10858fda88dac5f2739fc1e4a0b7d47a9aba
+Author: John Bowman <bowman@ualberta.ca>
+Date: Mon Jan 8 17:56:46 2024 -0800
+
+ Update fftw++.h and seconds.h.
+
commit ee98d7193f93ace9ea168192ec32d31838e34025
Author: Charles Staats III <charles.staats.iii@gmail.com>
Date: Mon Feb 5 16:48:11 2024 -0800
@@ -1348,6 +3138,21 @@ Date: Sun Jan 21 09:05:09 2024 -0800
More natural error from camp.y.
+commit 44544fc865ff410e396859f059f9539c0fe60fd7
+Merge: 55ee4cd7 f65f8085
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Jan 20 23:12:32 2024 -0700
+
+ Merge pull request #6 from vectorgraphics/msvc-support
+
+ CI: Run apt-get update before installing.
+
+commit f65f808536cce3a0cf9a5993f525fbece5f120b7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Jan 20 22:52:24 2024 -0700
+
+ CI: Run apt-get update before installing.
+
commit 9810e8b2d175837fd86d2e9051f1b9ab0644b85d
Author: Charles Staats III <charles.staats.iii@gmail.com>
Date: Sat Jan 20 14:33:18 2024 -0800
@@ -1540,12 +3345,151 @@ Date: Fri Dec 29 10:12:33 2023 -0800
dummy parse from Andy
+commit 55ee4cd758034e16b9081619c49a1838edbbe30b
+Merge: 2e4f39ad 55808725
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jan 7 02:51:25 2024 -0700
+
+ Merge pull request #5 from vectorgraphics/msvc-support
+
+ Update a/ci-staging
+
+commit 5580872533b1b47c55bd45012322a474b1c55803
+Merge: 4a69c2ea 2e4f39ad
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jan 7 02:24:34 2024 -0700
+
+ Merge branch 'a/ci-staging' into msvc-support
+
+commit 4a69c2eab22be42a66d6c5301ad5c8a69f47f3b5
+Merge: 544184aa 98d66af9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Jan 7 02:22:41 2024 -0700
+
+ Merge remote-tracking branch 'origin/master' into msvc-support
+
commit 98d66af9f0a7d942ffcf81a21d2d6aa9961bf12d
Author: John Bowman <bowman@ualberta.ca>
Date: Tue Jan 2 17:06:05 2024 -0800
Improve diagnostic.
+commit 2e4f39adb0c07b88fa78d25808b2cc1501afda2c
+Merge: 93553dc8 544184aa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 17:28:39 2024 -0700
+
+ Merge pull request #4 from vectorgraphics/msvc-support
+
+ update msvc support to a/ci-staging
+
+commit 544184aa474a33eba1e1ee40af50c372be39649d
+Merge: 64041044 8c83a8e8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 17:04:25 2024 -0700
+
+ Merge remote-tracking branch 'origin/master' into msvc-support
+
+commit 64041044ecfd1419c5d2e1b3dc83149d55ee964d
+Author: John Bowman <bowman@ualberta.ca>
+Date: Sun Dec 31 22:20:22 2023 -0800
+
+ Fix issue #414: restore missing outpath.
+
+commit f05eb109fab3e7dc3ca69dee740cbca08e731cd3
+Author: John Bowman <bowman@ualberta.ca>
+Date: Sun Dec 31 06:56:58 2023 -0800
+
+ Fix issue #412: prevent inferred assignment of void type.
+
+commit 35b1d8252140e5e296b043416205d0cc8cfe7df1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 12:53:39 2024 -0700
+
+ CI: Add unit testing to linux's CI step.
+
+ (cherry picked from commit 84bb6db450290594d9e679107bb41e90952e3070)
+
+commit d693606274e62d344a744ae1cbdf68a39c74f9e4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 00:35:59 2024 -0700
+
+ CI: Build and run unit tests on windows CI.
+
+ (cherry picked from commit 0cc5f95d94d3141e464688f4a20ce7aa4370c2d6)
+
+commit 93ccd34992a91b5094bb7bfa993b4a03ee34bb1a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 00:08:22 2024 -0700
+
+ GTEST: Add cxxtests. prefix to all cmake tests.
+
+ (cherry picked from commit 1906f45f342b7af2d137519c5b4266853f6504e3)
+
+commit 9ae0c37abb62330914f40bffab534c5564c004ba
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Jan 1 00:02:32 2024 -0700
+
+ CI: Exclude vcpkg_installed in linux CI to speed up artifact uploading.
+
+ (cherry picked from commit b2c9ebd822e6c1289e9310288d403a1efeeb6e74)
+
+commit 9e958fca4d326354579b74a5bd4a3c042498a5bf
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 31 23:49:12 2023 -0700
+
+ CI: Extract windows pwsh initialization to a common variable.
+
+ (cherry picked from commit c855f06ae8433800bbf05ab570afc95c12df45d4)
+
+commit c7d5ded52971f031db574d041b9c88d718a56b98
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 31 23:44:24 2023 -0700
+
+ CI: Remove vcpkg cache from configuration artifact since they can be installed by cache.
+
+ (cherry picked from commit 76c0d5bd94d2ebeff81b81735cef95574f286daf)
+
+commit a1af220ff70e602341007e927aae4525e88d6410
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 31 18:04:04 2023 -0700
+
+ CXX: Use backported optional for C++14 compatibility.
+
+ (cherry picked from commit 457688ecc9fb99bdd1fcf846066cbd860107c76d)
+
+commit f68e05b9790d61139eb35c2c081a0e9ba237618d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 31 14:26:38 2023 -0700
+
+ OPTIONAL: Add Optional backport to build.
+
+ (cherry picked from commit 9d9c66adc9dc459cffacc0bd0e2e6f5a97e2bcf4)
+
+commit 130f4c966981a2d0cea4ca5f372d47fc37cbff0d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 19:49:48 2023 -0700
+
+ CMAKE: Add PACKAGE_STRING macro.
+
+ (cherry picked from commit 56c93531dd01639bf4c888e360330ca073cf608c)
+
+commit 054fef7e18deb7679d73e8e0c6bc498e0c7c0ed1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 19:41:15 2023 -0700
+
+ CI: Trigger build actions for push from any msvc-* branches.
+
+ (cherry picked from commit 0b7586c8c13bdeaa3608ca25d59c09901a81e906)
+
+commit 6b01ec8d2697309b11262c6ffde8138dc1c3bd29
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 19:39:47 2023 -0700
+
+ CXX: Add _USE_MATH_DEFINES to all macros.
+
+ (cherry picked from commit b5ccc2f1af1f87f48db5c56aacaf85e2455f0b68)
+
commit 8c83a8e8710f245bab9833850fd8381c612ea1b9
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Jan 1 13:17:56 2024 -0800
@@ -1564,12 +3508,252 @@ Date: Sun Dec 31 06:56:58 2023 -0800
Fix issue #412: prevent inferred assignment of void type.
+commit 93553dc8bdc772277d181b2f4e176f450f6655c2
+Merge: 977b8d31 5176b7c0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 14:48:46 2023 -0700
+
+ Merge pull request #3 from jamievlin/ci-windows-impl
+
+ CI: Add windows CI workflow implementation.
+
+commit 5176b7c0efcce567859c0dc7cbaf3bcf03fb1bba
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 14:36:11 2023 -0700
+
+ CI: Add artifact uploading to build-windows-msvc-x64.
+
+commit de6b05f3bfcbdab726b642eff4c7cae4ce130e55
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 14:19:45 2023 -0700
+
+ CMAKE: Ensure all headers are generated before preprocessing file.
+
+commit f54890e85012d70213ed7e983fa632000d690f42
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 14:15:09 2023 -0700
+
+ CMAKE: Rearrange generated files order.
+
+commit 4867141a15d5ca8ef715c3530889f7fd923cf68a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 14:06:05 2023 -0700
+
+ CMAKE: Move generated directory creation to top of generated-files.cmake.
+
+commit 69836fa89e0c41148fa38642a9910c6906352525
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 12:57:19 2023 -0700
+
+ CI: Trigger CI on either manual dispatch or push to msvc-support.
+
+commit 92aeabe0f4127fd7332c2d09b6f8bb6a3b9b92ea
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 11:53:27 2023 -0700
+
+ CI: Add windows CI workflow implementation.
+
+commit 4ae0f88895253e01ab213871d66e600a7696aa3a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 11:55:52 2023 -0700
+
+ CI: Add initialize windows action file.
+
+commit 977b8d31b3a204e8c557ab0c9b86ea0557ef35d6
+Merge: 60024dde 0078b611
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 11:49:07 2023 -0700
+
+ Merge pull request #2 from jamievlin/ci-windows
+
+ add stub windows CI
+
+commit 0078b611d34b0ad7b667b6f81ae53e5b29d5c97c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 11:43:57 2023 -0700
+
+ CI: Add stub windows build CI workflow.
+
+commit 8d18a50951b1239fb0ca3b000e5772ae5406e6bf
+Merge: d6e86bd1 60024dde
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 02:40:38 2023 -0700
+
+ Merge branch 'a/ci-staging' into msvc-support
+
+commit d6e86bd10d4879d576c173e57c1ee53e8f1ccba1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 02:16:56 2023 -0700
+
+ CXX: Fix include for picture.cc.
+
+commit 60024dde4db321863e04690fabd15a032d2d2e78
+Merge: 69c3e4a1 8428d007
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 02:37:16 2023 -0700
+
+ Merge branch 'vectorgraphics:master' into a/ci-staging
+
+commit 69c3e4a14110d871d09193443904f419bcded8dd
+Merge: b468f92a fdd82c8d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 02:36:36 2023 -0700
+
+ Merge pull request #1 from jamievlin/ci-dev
+
+ CI test
+
+commit fdd82c8df42a1d924071f293acc53ac16a0f0e6c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 02:16:56 2023 -0700
+
+ CXX: Fix include for picture.cc.
+
+commit 6c09baa3bb7164f2dc7b0d762b35c098de003acd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 00:55:25 2023 -0700
+
+ CI: Add github actions workflow file.
+
+commit a6b3c941959d73352573ba6dfddede8eeac08f48
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 30 01:44:29 2023 -0700
+
+ CI: Add actions file.
+
commit 8428d007fb9ea47f9531c679acf6bd8f58dcbba5
Author: John Bowman <bowman@ualberta.ca>
Date: Thu Dec 28 23:55:02 2023 -0800
Fix typo (issue #411).
+commit 3cc5728993cd99154c079f4d49522a23665f509f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 20:45:46 2023 -0700
+
+ SETTINGS: Remove default adobe acrobat detection for windows pdf viewer.
+
+commit dedd5977b4432135be959ffc4a10f7f6f26a26be
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 20:45:22 2023 -0700
+
+ WIN32: Set all default viewers to empty string
+
+commit 9bd6a6e7622583ad4ba0f14f4ab8e47b5683ae5b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 20:43:24 2023 -0700
+
+ WIN32: Implement opening general files for display.
+
+commit 3ce675093b121cdbc4321b558c05f2e75cd5877b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 20:31:04 2023 -0700
+
+ WIN32: Implement opening pdf/eps files with no viewer given.
+
+commit d03906428e4dd229e3dcced4e29c594f37a7a3e4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 20:29:20 2023 -0700
+
+ COM: Initialize COM if under windows.
+
+commit 244757a32f7742db001688f15298e6b88980dbe3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 13:32:53 2023 -0700
+
+ CMAKE: Add Shell32 to windows linking.
+
+commit 8d58c4ab4325285a21d4bb29c75119378bf6db1c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 13:30:24 2023 -0700
+
+ WIN32: Add support for viewing html file with default browser.
+
+commit e69380bcabed61e785c7803d34f0fa84cbc5afd4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 28 13:29:35 2023 -0700
+
+ WIN32: Move GetLastError-based reporting to a separate function.
+
+commit ab7cbfd8674d042e9a28336a1a4ae0743394ec77
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Dec 27 23:07:02 2023 -0700
+
+ UTIL: Clean up SystemWin32.
+
+commit a6eb0153fbfac6767bb8274478e6d8d6f228b5b3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Dec 27 23:06:50 2023 -0700
+
+ UTIL: Add helper function to check if windows process is running.
+
+commit 99d9140a795b9fa09ede51464b05dfab75e3035e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Dec 27 23:05:32 2023 -0700
+
+ WIN32: Query registry only if on windows platform.
+
+commit fb48e3bb840d655280118a651d9cfdc51dc520c3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 12:31:12 2023 -0700
+
+ WIN32: Fix registry query.
+
+commit 0838b9364348f0e842d1e0f6f9351ec2c829d172
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 12:30:41 2023 -0700
+
+ UTIL: Use backslash for stripFile and stripDir on windows.
+
+commit 6ce66134b6e2736aeaa276650a4e8ac4167477f0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 12:25:49 2023 -0700
+
+ DOCS: Move windows-specific notes to INSTALL-WIN.md.
+
+commit de4ea998f5ae372f47ad89f038e30e4d3345117b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 02:00:27 2023 -0700
+
+ WIN32: Generate more detailed error for win32pipestream.
+
+commit 235e84c2b97d25d6cdc1da60ee921e08fc81e628
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 02:00:13 2023 -0700
+
+ WIN32: Add security attributes to nulfile.
+
+commit ba28e876ef5001e2960c82042fd21c540e72688d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 01:50:31 2023 -0700
+
+ WIN32: Check retcode correctly for System function.
+
+commit cedb7c6de8d4b5b531fdfed1479257f439cc7952
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 01:49:58 2023 -0700
+
+ WIN32: Fix PROCESS_INFORMATION typo for hStdErr.
+
+commit 1946a6c9565e44a5f8b1d34e8cb3e3c386473311
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 01:49:06 2023 -0700
+
+ WIN32: Update checkResult to print windows error.
+
+commit bb115360670dcb29730633811a373b3ed19913d7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 24 00:40:57 2023 -0700
+
+ WIN32: Fix CreateProcessA's arguments.
+
+commit 0b19d8d615b26a33d25291d81f9225a60d56161e
+Merge: b1e03f7a 2b4140b0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Dec 22 23:19:37 2023 -0700
+
+ Merge branch 'master' into msvc-support
+
commit 2b4140b09ecf2df7312f93c59dff128b1a39c222
Author: John Bowman <bowman@ualberta.ca>
Date: Wed Dec 20 00:10:13 2023 -0800
@@ -1588,6 +3772,19 @@ Date: Tue Dec 19 23:14:21 2023 -0800
Only output v3d format for 3D files.
+commit b1e03f7a30bbbb36fb8675c77b176393a8489183
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 19 21:11:46 2023 -0700
+
+ clang-format: Change clang-format style.
+
+commit f64bd104c950d1ff43176c534f1a126d18265107
+Merge: be005add 081db9d0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 19 20:44:46 2023 -0700
+
+ Merge branch 'master' into msvc-support
+
commit 35c261216d6e45593ccd13155ca0ab31652adaf6
Author: John Bowman <bowman@ualberta.ca>
Date: Tue Dec 19 19:20:56 2023 -0800
@@ -1612,18 +3809,380 @@ Date: Tue Dec 19 19:17:52 2023 -0800
Fix LSP segmentation fault.
+commit be005add467c7822433f1dc8d2bc69c01b25d52c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 19 19:35:28 2023 -0700
+
+ CMAKE: Fix reserved file name.
+
commit 488d80962c76cc60629f590e34b350459ea59621
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Dec 18 22:33:47 2023 -0800
Fix bug #405: implicitly format integers with full precision.
+commit b882b8b4b483834aad94ae3ad36de38831dae7a1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 17 17:14:31 2023 -0700
+
+ DOCS: Edit docs to mention quick start scripts.
+
+commit 6a670adfa3a88008c62d025e6d67e1e8a063fdfe
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 17 17:08:52 2023 -0700
+
+ PWSH: Add quick start script for windows.
+
+commit ebfaac3d1e5a54eacded5b7221d9fdd372dbadb9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 17 16:31:08 2023 -0700
+
+ WIN32: Ensure compiler is cl for msvc/release* target preset.
+
+commit 5e1f0d06d572e50a7c743a7e74aa9b9a6fd49e6a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 14:37:01 2023 -0700
+
+ XSTREAM: Move xstream's implementation to a separate file.
+
+commit 2b426301fec370c9f28dbec40b8152b33a56c430
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 03:13:57 2023 -0700
+
+ CMAKE: Enable RPC by default.
+
+commit 7df3801dac4472749cb78a053c2d3a190d26e735
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 03:05:59 2023 -0700
+
+ CMAKE: Add WIN32_LEAN_AND_MEAN to stop winsock.h's inclusion.
+
+commit ed70da29b70f6fac76ac3b2d1dccdc3fb84fa155
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 02:39:51 2023 -0700
+
+ XSTREAM: Make xdr win32 compatible.
+
+commit 81fc9d9320c0ed920ab351fc348a71027a276b6c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 02:38:58 2023 -0700
+
+ XDR: Add common xdr file.
+
+commit fee33e1f020090f2af89790ea4ee0ced96559fc7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 02:37:40 2023 -0700
+
+ W32-XDR: Add xdr implementation for win32.
+
+commit 3ae7c4be102a56a98ff545b7b42a9ce09b1ed099
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 02:36:52 2023 -0700
+
+ CMAKE: Add fmem for common file-in-memory support.
+
+commit 8a1ff0510bfca90afda52a92bb5abd11d250e61b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Dec 10 01:21:20 2023 -0700
+
+ COMMON: Include winsock2.h before any other includes to prevent winsock.h being included.
+
+commit 380cc71f3c903d9a37cbc8e43eaea1bdc6ea5351
+Merge: 4eca6498 6868ca1a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Dec 9 00:47:46 2023 -0700
+
+ Merge branch 'master' into msvc-support
+
commit 6868ca1a66611d72f716e57617d1c9c6031d3fe7
Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
Date: Sat Dec 9 00:00:49 2023 -0700
Add LSPCPP_USEGC macro flag in case of gc.
+commit 4eca64986392c0dadd2eb48fdb720f5dfc735931
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Dec 8 23:49:39 2023 -0700
+
+ CMAKE: Add boehm gc flag to lspcpp compilation.
+
+commit 9b0e491d5cf0af7e83c97a438b1ed0a3b0900a36
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Dec 8 23:49:11 2023 -0700
+
+ LSP: Fix line error in color request handling.
+
+commit 59b892c2936514c68167265d0f83a781e8768f9a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 15:00:55 2023 -0700
+
+ REPO: Move additional files to misc directory.
+
+commit 24fa32a7fc88d580ff280dd82841c95777f3a426
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 14:58:18 2023 -0700
+
+ CXX: Use std::optional everywhere instead of boost::optional.
+
+commit 1a8ae56ed91e5b3e0b98140aef69925bd73cc9b8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:47:43 2023 -0700
+
+ VCPKG: Add dependencies for LSP.
+
+commit 5a041e1d4d84f5a3b6ae4b855154240c3d5e1983
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 14:52:52 2023 -0700
+
+ CMAKE: Download LspCpp directly from cmake rather than git subrepo.
+
+commit 840c13599cff3231761dc8750a87006ccf1eca2d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:48:00 2023 -0700
+
+ CMAKE: Enable LSP option.
+
+commit 75912e49fcfbc2942d1c370218c203a4c5e7c722
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:47:29 2023 -0700
+
+ WSL: Exclude WSL+linux specific options for LSP if compiling outside linux.
+
+commit c077d95169cf4cb4946ef174a1bb009559edc27c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:46:43 2023 -0700
+
+ LSP: Move header files around to avoid Winsock.h include twice error.
+
+commit 2529da853acab5b93f2dabb0b8730916be15b97c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:43:50 2023 -0700
+
+ CMAKE: Add flag to check if compiling under Linux (Not macOS).
+
+commit e5f39ecccf9938f87f3ca0000a6511fd18765c8c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:43:27 2023 -0700
+
+ WIN32: Add _WIN32_WINNT flag for minimum supported windows version.
+
+commit 8d47cfa0346c6153ea26352a4942e14365bd8ec3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 12:41:43 2023 -0700
+
+ MEM: Remove inline flag from stdString.
+
+commit f7b7cfa4bd6ae492aafff463d41fb5445cc6866f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 00:03:38 2023 -0700
+
+ VS: Remove VS solution files from cudareflect.
+
+commit ef635ff641b2d26737bbf87b6dd1320130b5fe69
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 00:03:15 2023 -0700
+
+ CMAKE: Add asy-cuda-reflect to root asymptote project with options to disable and CUDA check.
+
+commit f79960b12f7929b690067236aaa9f970f5ffdfa5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Dec 7 00:00:36 2023 -0700
+
+ CMAKE: Add CMakeLists.txt for asy-cuda-reflect.
+
+commit 40cb7b1aa0dd15faf1bb8021cec33aee5907c2a9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 5 20:20:29 2023 -0700
+
+ WIN32: Add rc file to win32 binary.
+
+commit afa78a1c50a106851281f6399dcc0c020b7c105e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 5 20:13:39 2023 -0700
+
+ REPO: Add windows specific ignore files.
+
+commit c45e94ee38f7861743c37bbce2c55eda31b03774
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 5 12:44:31 2023 -0700
+
+ DOCS: Update documentation for GCCCOMPAT_CXX_COMPILER_FOR_MSVC.
+
+commit 27c2d390036be5ea51e57c19b350e4d20c87debb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 5 12:39:27 2023 -0700
+
+ MSVC: Attempt to automatically locate g++ or clang++ if GCCCOMPAT_CXX_COMPILER_FOR_MSVC is not given.
+
+commit b468f92abcc2087ca546c4104c256edf7a9fbc81
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Dec 5 00:04:19 2023 -0700
+
+ x86-64: Disable fpu precision setting for ARM+x64 systems.
+
+commit db074cd9748a26c891b4a702e0fde228974603c3
+Merge: e0e99d71 4f0b7939
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Dec 4 22:39:06 2023 -0700
+
+ Merge branch 'master' into msvc-support
+
+commit e0e99d71fbac590c72a7c2eacd1704d3e3815286
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Nov 26 00:03:06 2023 -0700
+
+ DOCS: Update instructions regarding VCPKG_ROOT environment variable.
+
+commit 04b53182bb3d8d4e47b683ab9511f04d95617f0e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 25 22:54:34 2023 -0700
+
+ ARRAY: Fix out-of-bounds seeking in setNonBridgingSlice.
+
+commit 8894763cbfd60cd94c8f5393000e71b8aad448eb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 24 13:05:35 2023 -0700
+
+ REPO: Exclude all vscode files from repo.
+
+commit 91abd30c7158f2a8bf6887e2547b9cd154fb04a2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 24 13:05:06 2023 -0700
+
+ VSCODE: Remove vscode-specific files.
+
+commit 3cd86de4e22e576b3303a0e4f67a9ec535b1b9f6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 21:25:39 2023 -0700
+
+ GLRENDER: Specify static_cast directly to stop MSVC's warning.
+
+commit 81afc58b29be836117ced6c101698424dfdd1ad0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 13:43:05 2023 -0700
+
+ CMAKE: Modify asylang test names to use dots for prefixing.
+
+commit 6c46d336f145314bdcea0bc70c469a1498974689
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 13:21:38 2023 -0700
+
+ DOCS: Edit build instructions for msvc build support.
+
+commit ed988bb7e620cd01dd0500511bc8b808c66eb051
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 13:10:47 2023 -0700
+
+ CMAKE: Edit presets file to add msvc presets.
+
+commit f1bb27968bda245d3b3a3e8f0851401bdde4af1d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 13:05:40 2023 -0700
+
+ CMAKE: Fix win32 warnings on gcc-compat C++ compiler.
+
+commit c051134042e7b4a3a404a0315845d939553f7465
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 12:26:48 2023 -0700
+
+ CMAKE: Include BDWgc::gctba if under windows.
+
+commit 350672446d0bb7e63ee421b00a599642973db10d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 12:24:17 2023 -0700
+
+ WIN32: Include GC_throw_bad_alloc only for non-windows builds.
+
+commit 2e3a9b01a9ab3ab25be8184ca6e3fd4a52d1232a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 12:23:26 2023 -0700
+
+ WIN32: Rewrite getEntry to use win32 registry API directly.
+
+commit 20eec0dab82c31ae35b582ffc397018c5e692f3e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 12:22:57 2023 -0700
+
+ WINDOWS: Add win32-specific utilities functions.
+
+commit 5cc05276c24eee371f79d21fc2796e48d005cf41
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 12:17:29 2023 -0700
+
+ TYPES: Move OPEN to types.cc.
+
+commit 7e28ce31298e06ed3b9109283cc7316673f9d11e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 03:12:33 2023 -0700
+
+ W32: Add RegKeyWrapper and checkLStatus.
+
+commit 6cb34f16527514e82eaa0d25b2603e38cf830f28
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 23 02:31:31 2023 -0700
+
+ clang-format: Set column limit to 120.
+
+commit 929ebb5707af54c7e017c3bc30ae9147c0b60d3d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 12:01:42 2023 -0700
+
+ WIN32: Do not declare file mask if under windows.
+
+commit a60607176ce334eed5530aae22e64afa3fca6b22
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:46:41 2023 -0700
+
+ CMAKE: Link to shlwapi for windows builds.
+
+commit 335e876c63b614d872db1856394b88870ca0a420
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:46:15 2023 -0700
+
+ RUNFILE: Implement mkstemp for windows.
+
+commit 5db542896097e6eb349e0e24fad4f88be642391d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:45:45 2023 -0700
+
+ WIN32: Do not include linux-specific headers in windows builds.
+
+commit 79a6c5b4f0c66f1742fc47f0ca69f23ce0d195ca
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:13:00 2023 -0700
+
+ LOCATE: Use fileExists for locate.
+
+commit a10b919dc0fa1e9b018fa672f28a032ddc423fd5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:12:04 2023 -0700
+
+ UTIL: Add fileExists function for both windows and unix systems.
+
+commit c0b8cbb4cccd79fc54b21d022c66e67f09aad40a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:11:12 2023 -0700
+
+ GAMMA: Use std::tgamma for gamma function.
+
+commit 5d68a5a5e01c0af87182443a5fe5233102c3d884
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Nov 20 11:06:02 2023 -0700
+
+ WINFLEX: Add --wincompat option for flex args in cmake.
+
+commit f08622f522bb5c8027a78896d5b832570ebb77a7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 23:09:59 2023 -0700
+
+ CXX: Use #pragma message for MSVC compatibility.
+
+commit 638c69010d7ea190e2d26c79552bd09e0e7a0fb8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 23:05:28 2023 -0700
+
+ MSVC: Remove near/far keyword usage for msvc compatibility.
+
commit 4f0b79391800424a729ccd393f31d01cbb86bbb4
Author: John Bowman <bowman@ualberta.ca>
Date: Sat Nov 18 19:38:00 2023 -0800
@@ -1636,24 +4195,426 @@ Date: Sat Nov 18 16:21:56 2023 -0800
Fix warning message.
+commit 503e7e62a6bb71167f4d52fb8c90adca7b26af2d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 16:58:59 2023 -0700
+
+ MSVC: Add option to specify a gcc-compatible C++ compiler for preprocessing.
+
+commit 4cac9d295508188871c5fd76b9a3db90fefeca69
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 15:46:10 2023 -0700
+
+ TEST: Remove tests/makefile.
+
+commit 5a553ff0f51e04752745ee721e0af5036538e9f2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 15:29:25 2023 -0700
+
+ REPO: Add scratch directory for testing.
+
+commit 04cc52e6457719aeee1144ea17de03201d5c6605
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 15:17:48 2023 -0700
+
+ ASY: Add remaining tests to asylang tests.
+
+commit 1c85e9b02950b1d08eb81a9bfdfdcb2d4b616ca1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 14:22:19 2023 -0700
+
+ CMAKE: Disable gtest on clang64-win by default.
+
+commit e21bbd08b3432c298b4c49e272a860c86c7ee79a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 13:25:33 2023 -0700
+
+ SECONDS: Fix GetProcessTimes() function.
+
+commit 62649fe534a7629aac8ed84ba96e895d1921d295
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 13:16:52 2023 -0700
+
+ GTEST: Add C++ testing platform for asy.
+
commit 1007bd5d1e92e9d41577cf28f1d81fbd3de04fbf
Author: John Bowman <bowman@ualberta.ca>
Date: Sat Nov 18 12:29:00 2023 -0800
Remove unused include.
+commit 9167ce819797d6ba40d34a3c5466d3e41106fc51
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 12:10:25 2023 -0700
+
+ ENUMS: Move C++ comments to before enum value for editor assistance.
+
+commit 1b3840a6e30987d35c47b1c892b61671c531d30d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 12:05:11 2023 -0700
+
+ MAIN: Move exit handlers form main to exithandlers.
+
+commit 8ea1f89a77fed13639c628991b70909bf2d38c62
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 11:45:12 2023 -0700
+
+ PTHREAD: Fix gc_stack_base initialization in main.cc.
+
+commit f0142d7fc007990f46bdd60cb47e6ce9ca0caeb8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 11:44:49 2023 -0700
+
+ MEM: Move memory definitions to memory.cc.
+
+commit 27ebd855508279ee7e30d593fd4aa220fa8f84e7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 18 00:11:12 2023 -0700
+
+ runtime: Print #line macro correctly.
+
+commit 620fa0c2fbfdd648febc672544166960ccae091e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 17 23:55:40 2023 -0700
+
+ testing: Add asy asylang tests.
+
+commit 015d74583e1b70f4e3e548db02a512ad898d30a4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 17 23:11:52 2023 -0700
+
+ clang-format: Add ReferenceAlignment key.
+
+commit 8a7e79afce7639ede06fff6b139e6d759f9ef9a0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 16 12:32:10 2023 -0700
+
+ GC: Add include guard for windows build without gc for main.cc.
+
commit b6e9a2c4ab8d06720bd28930b0c12589d7da19d5
Author: John Bowman <bowman@ualberta.ca>
Date: Wed Nov 15 15:42:37 2023 -0800
Fix URL.
+commit 567525842001aa4dd40bf0a9e223251601f889c6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Nov 14 00:20:50 2023 -0700
+
+ CMAKE: Split dependencies into multiple features.
+
+commit feaddf530400bf6d58e05d10726738813c055d80
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Nov 12 01:30:31 2023 -0700
+
+ PTHREAD: Register main thread explicitly if complied under windows.
+
+commit 81c0a0564281a4a2273af46bb1cad8cc0a416373
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Nov 12 01:21:30 2023 -0700
+
+ CMAKE: Explicitly set library building mode to static for windows.
+
+commit 7553e368fe1f7485f1fad450ff01fb31048b36ad
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 13:02:45 2023 -0700
+
+ DOCS: Add remarks about perl and python3.
+
+commit 0e4fbf427ba867c933c52833753e696ced87734b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 12:48:47 2023 -0700
+
+ DOCS: Change asy target in cmake build instructions.
+
+commit b4617b86868ea03422e980d5a9ac99fdcb187887
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 12:48:11 2023 -0700
+
+ DOCS: Add documentation for clang64-win build target.
+
+commit 7493e0054336847287429482513ffee294acec40
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 12:21:38 2023 -0700
+
+ CMAKE: Use NOMINMAX for all windows builds.
+
+commit f546992f5f1d858aa16155650d4577d78f96386d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 12:17:45 2023 -0700
+
+ PY3: Fix depfile cxx subprocess call.
+
+commit 2a0081a40f631fafdecfc8b5ef23f9eb9939137b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 01:06:33 2023 -0700
+
+ CMAKE: Add option for link-time optimization for release builds.
+
+commit d8d5c9f350d9f070a1ef7e3712c2b4e716b030d4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 11 01:06:15 2023 -0700
+
+ CMAKE: Add release build types for cmake.
+
+commit 9645ef9b0d61022a3124c581e723f422f3d9eb49
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 21:23:50 2023 -0700
+
+ CMAKE: Add clang64-win/release preset.
+
+commit 1eb0f4e075567f89822bd0ce2ae90795b6357f1f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 21:21:59 2023 -0700
+
+ tmp: Disable waiting and some signal functions to get windows compilation working.
+
+commit 573f17c2a1979a520f5fb996b6fa8f6afe0c4067
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 21:21:07 2023 -0700
+
+ CMAKE: Add options to enable debug mode for gc.
+
+commit 703f0443f7e9261f9ffd984191a792a5f0d8c4cd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 20:31:20 2023 -0700
+
+ CMAKE: Remove tinyexr from external-libs (vcpkg).
+
+commit e658d6d1a518db94e1cb7ec89affeaf5e56b8e94
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 20:29:29 2023 -0700
+
+ TIME: Use std::this_thread::sleep_for instead of nanosleep.
+
+commit 52e37142d182b406b9a86929c2b253d5d2218f08
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 20:28:57 2023 -0700
+
+ CMAKE: Link tinyexr-impl library to asy.
+
+commit 642f1870e960f52054dd93b852afe8461924a158
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 20:28:27 2023 -0700
+
+ CMAKE: Move options to before project.
+
+commit 3b9d703de007e8fdfbf007681e6b3542407bdfa3
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 20:27:56 2023 -0700
+
+ TINYEXR: Remove tinyexr from vcpkg since it is breaking cmake.
+
+commit 29d2ac528a22fd3643b7982db106961454e6f29b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 12:26:50 2023 -0700
+
+ Change glrender function to using GLRenderArgs.
+
+commit d2868a128335b0d83a4e7c9d979575d0a8d5f1e0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 03:27:59 2023 -0700
+
+ CMAKE: Add more detail for ENABLE_GL_COMPUTE_SHADERS option.
+
+commit 28db622a2f6cedda7c4f38ea3a0b19f8498860bb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 03:27:41 2023 -0700
+
+ CMAKE: Enable usage of SSBO.
+
+commit 32706d03154422223a204b2dac274d0effd304ab
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 03:21:46 2023 -0700
+
+ CMAKE: Enable usage of fftw3.
+
+commit 1a5fefe10efa0b09b3dcea14bd746b9491f86f06
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 03:21:37 2023 -0700
+
+ VCPKG: Add libfftw3.
+
+commit ad9261574789feab0a33d7720d2a09fc3aee66e9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 02:47:31 2023 -0700
+
+ RUNSTRING: Make time functions work universally.
+
+commit 5b5849a9a75f1823e6aec65c52349b2384323571
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 01:56:18 2023 -0700
+
+ CMAKE: Add basefile targets for asy.
+
+commit 7a57508b7f235544e63880d2b63d8ee0a18b7110
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 01:37:50 2023 -0700
+
+ CMAKE: Add options for enabling XDR/RPC.
+
+commit c64e19b62f07338cf7589c65e25d9d0497bb0e32
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 01:37:35 2023 -0700
+
+ CMAKE: Add codegen for enum files from csv.
+
+commit ecc3e6e93ac2f2465cd320176fbcdce087b51fcd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 01:37:14 2023 -0700
+
+ CMAKE: Add dependency to copy_base_file.
+
+commit abaf05361faa0d2317cb341be4620595ea6cd231
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 01:12:25 2023 -0700
+
+ CMAKE: Move FindPkgConfig to top of external-libs.
+
+commit 9e60dfbcdba22fc43a56285c2c67666f5680e1a8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 10 00:57:46 2023 -0700
+
+ PY3: Remove date information from generate_enums.
+
+commit a570b3653e9678090f3deb2e3889bf53e026239b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 9 19:37:02 2023 -0700
+
+ PY3: Make c++ compiler error messages visible in gen_preprocessed_depfile.
+
+commit e65a1e6b17fea5816047062d3fc2506799010a8e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 9 19:27:55 2023 -0700
+
+ CMAKE: Add presets for quick building.
+
+commit 7d4257f2853891621e44fa75621f4520dfacd366
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 9 19:27:46 2023 -0700
+
+ CMAKE: Enable usage of opengl in asymptote.
+
+commit 90c6d797a26d735267bc6fb0142b1b85fb0a27d8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 9 19:27:28 2023 -0700
+
+ DOCS: Add a quick readme on how to compile with cmake.
+
+commit e695e83fb807fbfe917669c37b927d39c726923a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Nov 9 19:20:14 2023 -0700
+
+ VCPKG: Add OpenGL libraries to vcpkg list.
+
+commit 978532be7422d7fa1ee41762ffcc1342de4b2c58
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 12:08:29 2023 -0700
+
+ CLANG64: Fix remaining compile issues on windows clang64.
+
+commit fa9359073cea1e0dffdc905645da5cc51c49aead
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 12:08:12 2023 -0700
+
+ CMAKE: Add options to disable libreadline.
+
+commit f978aca1b71d4d16ff337f8833bbf028bf2aac2d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 11:38:17 2023 -0700
+
+ REPO: Add ignore directory.
+
+commit ca6cbe48df1fa21492057810a355f7e52e2aeeb4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 11:36:44 2023 -0700
+
+ linux: Fix compile errors for linux.
+
+commit 534dedea2074c179442498051f52ecc5afcca336
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 11:18:58 2023 -0700
+
+ main: Make main.cc compilable with windows clang64.
+
+commit 6350cd87aa2d5f8a9fc6a4f7da5c718059663c12
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 11:17:59 2023 -0700
+
+ runtime: Make runtime work with windows clang64.
+
+commit bd59f050ec2ceebc21c9c2bd0a09ebd5a0663abb
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 11:17:00 2023 -0700
+
+ cmake: Split asy to asy and asycore.
+
+commit 2d3e98f55d621b6c4facaca18cc222652d17ab04
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 01:38:28 2023 -0700
+
+ pipestream: Add win32pipestream for windows as a pipestream re-implementation.
+
+commit e093b578c9f8fa409ce181c437f873eb086b6d51
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Nov 8 01:37:58 2023 -0700
+
+ WINCMD: Move buildWindowsCmd to win32helpers.
+
commit b706a4fd6718e1aa1b3ce06ca657b60fc54ea4c2
Author: John Bowman <bowman@ualberta.ca>
Date: Mon Nov 6 23:44:14 2023 -0800
Implement mapArray via mapArrayString.
+commit 41524fb58214247012fc99661613f2bf94a3d9e9
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 19:44:04 2023 -0600
+
+ lex/bison: Change eof to isEof to avoid symbol collision.
+
+commit ed166a41560ea09734668e8c98a293207a45fa8d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 19:23:34 2023 -0600
+
+ lex/bison: Change THIS to THIS_TOK to avoid macro collision.
+
+commit 515b9aef2358c5b89782797705fcdc822d1fa7fa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 13:26:26 2023 -0600
+
+ PARSER: include curl.h before common.h to avoid Windows.h.
+
+commit ab9e0c73329f973e73b9c1dfae05e398acce751e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 13:21:48 2023 -0600
+
+ EOF: Rename eof to eofException.
+
+commit 9fb59b744ef66bd88abe54ab57c02e9892ee5983
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 13:10:23 2023 -0600
+
+ DRAWLABEL: Make draw() unix/windows compatible.
+
+commit 9939dd25a1ae669e01c1fb15a8c0bb6d39f93f2e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 12:55:53 2023 -0600
+
+ SETTINGS: Make settings compatible with windows.
+
+commit a4a42186fe35913035d6b5bcc08349bfbd828cfa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 12:50:17 2023 -0600
+
+ GETOPT: Use vcpkg getopt instead of backports.
+
+commit 591e5c10a9bbc37f914d979b7bb298b6ab989f17
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sat Nov 4 12:45:51 2023 -0600
+
+ GLEW: Move all of glew into backports.
+
commit e991c19bbb4318201be9e6d8fa11e58ff93c1183
Author: John Bowman <bowman@ualberta.ca>
Date: Fri Nov 3 23:49:52 2023 -0700
@@ -1690,6 +4651,444 @@ Date: Fri Nov 3 23:42:04 2023 -0700
origin: "???"
commit: "???"
+commit cfa9a669968a22812b85529f9db9b924451450ec
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 3 14:35:23 2023 -0600
+
+ UTIL: Make util.cc win32 compatible.
+
+commit e0d4d79a3636f69cf9d978b75036f8e93084013a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Nov 3 14:34:14 2023 -0600
+
+ W32: Add win32helpers utility to asy.
+
+commit f9f7e11d69746c5a88b0d95d87a185132d32bdee
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 23:16:39 2023 -0600
+
+ MSVC: Add additional /Zc options for msvc compiler.
+
+commit 2356520099f62fd7b49ff442161064557547a075
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 23:16:06 2023 -0600
+
+ MSVC: Add ciso646 for and/or/not support.
+
+commit fb9f05c922a8f9a6c83566a1cf5e9c3b4ddbaf05
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 23:05:33 2023 -0600
+
+ CXX: Rename process.h to processutils.h to avoid name collision.
+
+commit 179fa49b7049de409730092d357a0bd8a79972c0
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 22:10:08 2023 -0600
+
+ GETOPT: Make getopt compatible with C99 and beyond.
+
+commit 64ead4713a8e8b4f8ee3254062d424e7b5a51cae
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 15:46:17 2023 -0600
+
+ !hack: Add explicitly runtime.h file for msvc codegen stage.
+
+commit 5d2ad06fdfcf9c686198a93ffec25f44a9f2a829
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 15:31:40 2023 -0600
+
+ REPO: Add visual studio files to ignore list.
+
+commit dc38e817f3d88eba5f8f6f68041fe02d6b133628
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 15:01:58 2023 -0600
+
+ REPO: Add CMakeUserPresets.json to ignore list.
+
+commit e3104efab7ff7a2f1c014b876b6857d3f12fa4aa
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 14:58:46 2023 -0600
+
+ CMAKE: Add __MSDOS__ build macro for windows builds.
+
+commit 3ee7085978bfd45779e83eb8ec119a4f0077f013
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 14:53:39 2023 -0600
+
+ PREPROC: Add python code to properly process msvc source outputs to depfiles and preprocessed files.
+
+commit 3f64b1b3513e884f0aa67854c7c44f8572a61b75
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 14:52:35 2023 -0600
+
+ MSVC: Exclude non-windows header files properly.
+
+commit 40b0234f343eed4268c7b88bad0b3f46fe157257
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 12:54:36 2023 -0600
+
+ PIPESTREAM: Use SSIZE_T for msvc compilation.
+
+commit 6e2f612089e6e6944a639bb08ce7ad937e22146d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 12:17:55 2023 -0600
+
+ MSVC: Enable NOMINMAX for windows compilation flags.
+
+commit 5c3b516087339d68f51b0e005629b95203a1ffcc
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 02:02:18 2023 -0600
+
+ MSVC: Work around strings.h for msvc builds.
+
+commit 75c394fedebffab5d9ab97b1b07f761496203f43
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 01:55:32 2023 -0600
+
+ CMAKE: Properly set __cplusplus variable for version checking.
+
+commit b9df13ec7b21e9b1dc97361af38faf42687ef3c1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 01:46:32 2023 -0600
+
+ CMAKE: Add handling for c++ standard in preprocessing script.
+
+commit 94955792af93477fb0d5a700ff395b53c1e98b31
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:53:53 2023 -0600
+
+ CMAKE: Use backports/getopt for windows builds.
+
+commit 9a294167efe0e40188d07a63d9b41e379f734352
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:53:30 2023 -0600
+
+ GETOPT: Add CMakeLists.txt for getopt.
+
+commit 02a66799b0e7c71753c9ecf5023d6e2a8777eda6
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:53:09 2023 -0600
+
+ REPO: Reorganize backports directory to better select which packages we need.
+
+commit c920ed6eab682aa7b335c838a4049c1289dbccf2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:27:52 2023 -0600
+
+ CMAKE: Enable usage of Pthreads4W on windows.
+
+commit 7b617c172848272d436f06657e75cb7297380d1f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:27:34 2023 -0600
+
+ CMAKE: Use the same readline configuration for both windows and unix systems.
+
+commit ceffa9e460adcdf6a55552ad1495dad141bb9dbf
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:27:04 2023 -0600
+
+ CMAKE: Enable usage of pdcurses on windows.
+
+commit d9117e43ec8a28500e5da3ce55ee4eb62dd463f2
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:26:41 2023 -0600
+
+ CMAKE: Download winflexbison if custom binary not given.
+
+commit 7ab138ebb4d5f92b25e9de0737b9c59e8553d53c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 00:26:09 2023 -0600
+
+ CMAKE: Add option for custom flex and bison binaries for windows.
+
+commit 7da5e12d8c36eb468e6b413c76ca05f790f43acd
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 27 22:53:42 2023 -0600
+
+ VCPKG: Use pdcurses for windows build.
+
+commit 93f4208727e4db8eb2575f047d812506f6706f2c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 29 01:31:20 2023 -0600
+
+ CMAKE: Fix CMAKE_CXX_STANDARD_REQUIRED.
+
+commit 3d97b66fafc25a942ce7493e03a8a585d95c9196
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 26 01:28:15 2023 -0600
+
+ CMAKE: Enable usage of eigen.
+
+commit ca13bbb32b2d49cafb6dc241b283d92c01627ef4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 26 01:28:00 2023 -0600
+
+ VCPKG: Add eigen to package list.
+
+commit ef2e02a50770506be3577e228af8033aa135732c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 26 01:09:57 2023 -0600
+
+ CMAKE: Enable usage of gsl.
+
+commit ce8350fa0be4f9f52409ef9d5f1b345680f2ae20
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 26 01:09:26 2023 -0600
+
+ VCPKG: Add GSL to package list.
+
+commit 4f3b07b89f1a1fed6aec659e605ea0e3c2cd39b4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Oct 25 02:12:46 2023 -0600
+
+ CMAKE: Enable building with pthreads.
+
+commit 770b3ff9e1a70811165757fc5b4da58521488ada
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Oct 25 02:12:27 2023 -0600
+
+ VCPKG: Add pthreads to package list.
+
+commit 01c4240413b9627393559f153c13538ea2b89ea8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Oct 25 01:57:27 2023 -0600
+
+ CURL: Add check for LIBCURL_VERSION_NUM instead of CURLOPT_XFERINFODATA.
+
+commit cae3c911a2f889181b50adb2b6854c91bfc3abe8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Oct 25 01:57:04 2023 -0600
+
+ CMAKE: Enable using of libcurl.
+
+commit 24a59bfc6ee21e0618f1d1995aef49fc543e588b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Wed Oct 25 01:56:52 2023 -0600
+
+ VCPKG: Add libcurl to vcpkg.
+
+commit 32dbc1fa31f14e08b3b7ad7cbf269f4ef0554eac
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 24 23:44:59 2023 -0600
+
+ CMAKE: Enable building for libreadline and curses.
+
+commit f4774afa33a107de47ebc140e4b0adb33798dff4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 24 23:44:45 2023 -0600
+
+ VCPKG: Add curses and readline library.
+
+commit af9823a1318199dd4840506a8ee7761b74ab34a5
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 24 23:12:44 2023 -0600
+
+ CMAKE: Enable linking of gc.
+
+commit 2b8681a390a216b6872af021dda6d70170affa77
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Tue Oct 24 23:12:32 2023 -0600
+
+ VCPKG: Add gc to package list.
+
+commit 2e696b8e67b4ef6b923c97057feabad3df05ffcc
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Oct 23 02:00:34 2023 -0600
+
+ CMAKE: Copy base files to build directory.
+
+commit 3f44dce96a1f30e7f551cc98cac6547b64a89592
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 18:55:23 2023 -0600
+
+ CMAKE: Move preprocessed file generation to a python script.
+
+commit dd3060306d4dea6196b20756e2ea3ffc14d7895f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 14:52:11 2023 -0600
+
+ CMAKE: Add codegen for revision.cc.
+
+commit a4d1ebe3a84e90fcca7c81ac6a6f15a78b175bea
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 14:51:59 2023 -0600
+
+ CMAKE: Add ASY_GL_VERSION.
+
+commit 3837e3965bc01ad679373b4ef5fbcbb43993f34a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 14:09:15 2023 -0600
+
+ PERL: Fix Fix warnings in perl.
+
+commit 82af38ab8d8e730c60c147d347d272dca1009823
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 13:55:57 2023 -0600
+
+ CMAKE: Add *.symbols.h to build target.
+
+commit b342518d5de29a16ab60baf7a61e04c872c24a84
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 12:35:25 2023 -0600
+
+ CMAKE: Add flex+bison files.
+
+commit c602f03f4fff1d16e4a402aaef041af9cdb7ddd7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:42:08 2023 -0600
+
+ CMAKE: Add HAVE_UNORDERED_MAP to compilation macro.
+
+commit 600c1b250c3ab6c935c7a4c705724a0c1a823c85
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:41:36 2023 -0600
+
+ CMAKE: Make include directories work properly in codegen.
+
+commit 22c709375c373072fb8e81762f057daa8946617e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:41:13 2023 -0600
+
+ ZLIB: Add zlib to cmake lists.
+
+commit 72d688bcd27252a01ade37099c724f088699367c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:40:20 2023 -0600
+
+ KEYWORDS: Add keywords.h to target.
+
+commit bc7f64d9582f12b9a28a72827a932166a095f89b
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:40:03 2023 -0600
+
+ KEYWORDS: Make keywords.pl work with cmake.
+
+commit daf4160a3dc675d06774740411001095ea5df365
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:39:40 2023 -0600
+
+ EXR: Remove tinyexr from compilation target.
+
+commit 7dfcf08a3c02e6466eea8b486f0e937a1e06f12c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 02:39:18 2023 -0600
+
+ VCPKG: Add vcpkg manifest file.
+
+commit 84260f414678805e63ce3206c8744ac09636f6b1
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:40:34 2023 -0600
+
+ CMAKE: Add common functions file.
+
+commit a33328d7191053bb51819bddf7f5741cfba29310
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:40:12 2023 -0600
+
+ CMAKE: Fix ASYMPTOTE_GENERATED_HEADERS.
+
+commit f5410edb8973e24ac78b6544d4c0ed94b0d6e61f
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:40:00 2023 -0600
+
+ CMAKE: Add codegen for allsymbols.h.
+
+commit 1fdbe6f201b0abb22eebbe94d4611f4dd4e6b622
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:39:26 2023 -0600
+
+ PERL: Make findsym work with strict mode.
+
+commit 611eab2e467dbc0d0abb1a5a481e129fd858f899
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:39:19 2023 -0600
+
+ PERL: Add arguments to opsymbols and runtime.
+
+commit edc37304fd3c28531397d5bfd8db0be7be5f1c37
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 22 00:33:03 2023 -0600
+
+ CC: Fix glrender.cc file.
+
+commit 68bb68bd88b19e0c7962203fe0ed451d59aecea4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Thu Oct 19 23:35:25 2023 -0600
+
+ CMAKE: Add brief skeleton for using cmake.
+
+commit 16afc037b93d603bd8ca5270bbbbb074bc0bbc0e
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Oct 16 00:50:51 2023 -0600
+
+ CMAKE: Add pkg-info.cmake for package information.
+
+commit ec021ce10d31d8732a96370f84da94f11ed0c939
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Oct 16 00:48:32 2023 -0600
+
+ GSL: Add config.h check to gsl.cc.
+
+commit 04d9db73670dd307063e2a5361363f5a5a1340a4
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Mon Oct 16 00:21:35 2023 -0600
+
+ PERL: Add use strict/warnings to all perl scripts.
+
+commit ec2bf90f1597a99869d03314f79f4bb343294325
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 15 03:12:42 2023 -0600
+
+ COMMON: Use cstdint uint64 for Int max and min.
+
+commit 7066d5bf4423af956b8b526fe22ebdc06e679524
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 15 02:58:36 2023 -0600
+
+ PRC: Add CMakeLists to PRC File.
+
+commit db6c98d2b8db271f7fad8eee8a42ab22d44ca2e8
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 15 02:58:26 2023 -0600
+
+ PRC: Reorganize structure of PRC library.
+
+commit 2878414db8e65036ec3e938a950bb1d58f68ff1c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Sun Oct 15 02:58:03 2023 -0600
+
+ PRC: Remove Makefile.
+
+commit 58343ae0e8297b94ec53227e2b0705ae5d50844a
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 13 23:28:11 2023 -0600
+
+ TINYEXR: Remove tinyexr from subrepo.
+
+commit 593c5abf8e808c783d59c14d0b216dd53aaf876d
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 13 23:01:17 2023 -0600
+
+ DIR: Move file structure around to clean up repository.
+
+commit 1f2f2e9399bcf98ddbae73417a0a4c5f8449c535
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 13 22:43:27 2023 -0600
+
+ REPO: Add CMake files to ignore list.
+
+commit 420bcf146dacb0f0dc52d7b251c2a2be0ca43d1c
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 13 22:41:29 2023 -0600
+
+ CMAKE: Add basic CMake build file.
+
+commit f13648ec70031173268fb34b54e097e30a7b21b7
+Author: Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>
+Date: Fri Oct 13 22:37:56 2023 -0600
+
+ MAKE: Remove Makefile and autotools files.
+
commit 2cb894653a74235788ce33575f9a1af1ea15796b
Author: John Bowman <bowman@ualberta.ca>
Date: Tue Oct 10 23:14:04 2023 -0700
diff --git a/graphics/asymptote/EXRFiles.h b/graphics/asymptote/EXRFiles.h
index 36bd8b9b57..c498ca4ddc 100644
--- a/graphics/asymptote/EXRFiles.h
+++ b/graphics/asymptote/EXRFiles.h
@@ -4,7 +4,7 @@
#pragma once
#include "common.h"
-#include "cudareflect/tinyexr/tinyexr.h"
+#include <tinyexr.h>
namespace camp
{
diff --git a/graphics/asymptote/GUI/ContextWindow.py b/graphics/asymptote/GUI/ContextWindow.py
index 5304472680..1b0afd5213 100644
--- a/graphics/asymptote/GUI/ContextWindow.py
+++ b/graphics/asymptote/GUI/ContextWindow.py
@@ -3,25 +3,11 @@
import PyQt5.QtWidgets as Qw
import PyQt5.QtGui as Qg
import PyQt5.QtCore as Qc
-import xasyVersion
-import xasyUtils as xu
import xasy2asy as x2a
-import xasyFile as xf
-import xasyOptions as xo
-import UndoRedoStack as Urs
-import xasyArgs as xa
-import xasyBezierInterface as xbi
-from xasyTransform import xasyTransform as xT
-import xasyStrings as xs
-import PrimitiveShape
-import InplaceAddObj
+from xasyTransform import xasyTransform as xT
-import CustMatTransform
-import SetCustomAnchor
-import GuidesManager
-import time
class AnotherWindow(Qw.QWidget):
def __init__(self, shape, parent):
diff --git a/graphics/asymptote/GUI/CustMatTransform.py b/graphics/asymptote/GUI/CustMatTransform.py
index 0a66807d35..6a6223b6a0 100644
--- a/graphics/asymptote/GUI/CustMatTransform.py
+++ b/graphics/asymptote/GUI/CustMatTransform.py
@@ -5,7 +5,7 @@ import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import numpy as numpy
import xasy2asy as xasy2asy
-from pyUIClass.custMatTransform import Ui_Dialog
+from xasyqtui.custMatTransform import Ui_Dialog
class CustMatTransform(QtWidgets.QDialog):
diff --git a/graphics/asymptote/GUI/SetCustomAnchor.py b/graphics/asymptote/GUI/SetCustomAnchor.py
index e4414fecc4..647eedc49c 100644
--- a/graphics/asymptote/GUI/SetCustomAnchor.py
+++ b/graphics/asymptote/GUI/SetCustomAnchor.py
@@ -3,7 +3,7 @@
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
-from pyUIClass.setCustomAnchor import Ui_Dialog
+from xasyqtui.setCustomAnchor import Ui_Dialog
class CustomAnchorDialog(QtWidgets.QDialog):
diff --git a/graphics/asymptote/GUI/Widg_addLabel.py b/graphics/asymptote/GUI/Widg_addLabel.py
index a5a6503503..121b84df4a 100644
--- a/graphics/asymptote/GUI/Widg_addLabel.py
+++ b/graphics/asymptote/GUI/Widg_addLabel.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from pyUIClass.widg_addLabel import Ui_Form
+from xasyqtui.widg_addLabel import Ui_Form
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
diff --git a/graphics/asymptote/GUI/Widg_addPolyOpt.py b/graphics/asymptote/GUI/Widg_addPolyOpt.py
index 3d1e419d89..3a02f5ec04 100644
--- a/graphics/asymptote/GUI/Widg_addPolyOpt.py
+++ b/graphics/asymptote/GUI/Widg_addPolyOpt.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from pyUIClass.widg_addPolyOpt import Ui_Form
+from xasyqtui.widg_addPolyOpt import Ui_Form
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
diff --git a/graphics/asymptote/GUI/Widg_editBezier.py b/graphics/asymptote/GUI/Widg_editBezier.py
index 161715e0fc..e45c2338e5 100644
--- a/graphics/asymptote/GUI/Widg_editBezier.py
+++ b/graphics/asymptote/GUI/Widg_editBezier.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from pyUIClass.widg_editBezier import Ui_Form
+from xasyqtui.widg_editBezier import Ui_Form
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtCore as QtCore
diff --git a/graphics/asymptote/GUI/Window1.py b/graphics/asymptote/GUI/Window1.py
index 1e65b23597..dca5cae202 100644
--- a/graphics/asymptote/GUI/Window1.py
+++ b/graphics/asymptote/GUI/Window1.py
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
-from pyUIClass.window1 import Ui_MainWindow
+from xasyqtui.window1 import Ui_MainWindow
import PyQt5.QtWidgets as Qw
import PyQt5.QtGui as Qg
import PyQt5.QtCore as Qc
-import xasyVersion
+from xasyversion.version import VERSION as xasyVersion
import numpy as np
import os
@@ -143,13 +143,14 @@ class MainWindow1(Qw.QMainWindow):
if self.settings['asyBaseLocation'] is not None:
os.environ['ASYMPTOTE_DIR'] = self.settings['asyBaseLocation']
- if self.args.asypath is not None:
- asyPath = self.args.asypath
- else:
- asyPath = self.settings['asyPath']
+ addrAsyArgsRaw: str = self.args.additionalAsyArgs or \
+ self.settings.get('additionalAsyArgs', "")
- self.asyPath = asyPath
- self.asyEngine = x2a.AsymptoteEngine(self.asyPath)
+ self.asyPath = self.args.asypath or self.settings.get('asyPath')
+ self.asyEngine = x2a.AsymptoteEngine(
+ self.asyPath,
+ None if not addrAsyArgsRaw else addrAsyArgsRaw.split(',')
+ )
try:
self.asyEngine.start()
@@ -936,7 +937,7 @@ class MainWindow1(Qw.QMainWindow):
webbrowser.open_new(asyManualURL)
def actionAbout(self):
- Qw.QMessageBox.about(self,"xasy","This is xasy "+xasyVersion.xasyVersion+"; a graphical front end to the Asymptote vector graphics language: https://asymptote.sourceforge.io/")
+ Qw.QMessageBox.about(self,"xasy","This is xasy "+xasyVersion+"; a graphical front end to the Asymptote vector graphics language: https://asymptote.sourceforge.io/")
def actionExport(self, pathToFile):
asyFile = io.open(os.path.realpath(pathToFile), 'w')
diff --git a/graphics/asymptote/GUI/buildtool.py b/graphics/asymptote/GUI/buildtool.py
new file mode 100644
index 0000000000..fdee2a0ea7
--- /dev/null
+++ b/graphics/asymptote/GUI/buildtool.py
@@ -0,0 +1,124 @@
+#!/usr/bin/env python3
+import pathlib
+import sys
+import subprocess
+import shutil
+from typing import Optional
+
+import click
+from PyQt5.uic import compileUiDir
+
+BUILD_ROOT_DIRECTORY = pathlib.Path(__file__).parent
+sys.path.append(str(BUILD_ROOT_DIRECTORY.parent))
+
+import determine_pkg_info
+
+XASY_ICONS_MODULE_NAME = "xasyicons"
+
+PY_UI_FILE_DIR = BUILD_ROOT_DIRECTORY / "xasyqtui"
+PY_ICONS_FILE_DIR = BUILD_ROOT_DIRECTORY / XASY_ICONS_MODULE_NAME
+PY_VERSION_MODULE_DIR = BUILD_ROOT_DIRECTORY / "xasyversion"
+
+
+def add_version_override_arg(cmd_fn):
+ return click.option(
+ "--version-override",
+ default=None,
+ type=str,
+ help="Version to use. If not given, uses information from configure.ac.",
+ )(cmd_fn)
+
+
+def _mapUiFile(_: str, fileName: str):
+ return str(PY_UI_FILE_DIR), fileName
+
+
+def make_init_py_at_dir(dir_name: pathlib.Path):
+ (dir_name / "__init__.py").touch(exist_ok=True)
+
+
+@click.command()
+def buildUi():
+ compileUiDir(
+ "windows", map=_mapUiFile, from_imports=True, import_from=XASY_ICONS_MODULE_NAME
+ )
+ make_init_py_at_dir(PY_UI_FILE_DIR)
+
+
+@click.command()
+def buildIcons():
+ PY_ICONS_FILE_DIR.mkdir(exist_ok=True)
+ make_init_py_at_dir(PY_ICONS_FILE_DIR)
+ subprocess.run(
+ [
+ "pyrcc5",
+ str(BUILD_ROOT_DIRECTORY / "res" / "icons.qrc"),
+ "-o",
+ str(PY_ICONS_FILE_DIR / "icons_rc.py"),
+ ]
+ )
+
+
+def determineAsyVersion() -> str:
+ version_base = determine_pkg_info.determine_asy_pkg_info(
+ BUILD_ROOT_DIRECTORY.parent / "configure.ac"
+ ).get("version-base")
+ if not version_base:
+ return "0.0.0-SNAPSHOT"
+ return version_base
+
+
+def buildVersionModuleInternal(version_override: Optional[str] = None):
+ PY_VERSION_MODULE_DIR.mkdir(exist_ok=True)
+ make_init_py_at_dir(PY_VERSION_MODULE_DIR)
+ if version_override is not None:
+ version = version_override
+ else:
+ version = determineAsyVersion()
+ with open(PY_VERSION_MODULE_DIR / "version.py", "w", encoding="utf-8") as f:
+ f.write(f'VERSION="{version}"\n')
+
+
+@click.command()
+@add_version_override_arg
+def buildVersionModule(version_override: Optional[str]):
+ buildVersionModuleInternal(version_override)
+
+
+@click.command()
+def clean():
+ if PY_UI_FILE_DIR.exists():
+ shutil.rmtree(PY_UI_FILE_DIR)
+
+ if PY_ICONS_FILE_DIR.exists():
+ shutil.rmtree(PY_ICONS_FILE_DIR)
+
+ if PY_VERSION_MODULE_DIR.exists():
+ shutil.rmtree(PY_VERSION_MODULE_DIR)
+
+
+@click.command()
+@click.pass_context
+@add_version_override_arg
+def build(ctx: click.Context, version_override: Optional[str] = None):
+ ctx.invoke(buildUi)
+ ctx.invoke(buildIcons)
+ buildVersionModuleInternal(version_override)
+
+
+@click.group(invoke_without_command=True)
+@click.pass_context
+def cli(ctx: click.Context):
+ if ctx.invoked_subcommand is None:
+ ctx.invoke(build)
+
+
+cli.add_command(buildUi)
+cli.add_command(buildIcons)
+cli.add_command(buildVersionModule)
+cli.add_command(build)
+cli.add_command(clean)
+
+
+if __name__ == "__main__":
+ cli()
diff --git a/graphics/asymptote/GUI/configs/xasyconfig.cson b/graphics/asymptote/GUI/configs/xasyconfig.cson
index 5f0c1abc17..98998a802d 100644
--- a/graphics/asymptote/GUI/configs/xasyconfig.cson
+++ b/graphics/asymptote/GUI/configs/xasyconfig.cson
@@ -1,13 +1,13 @@
# Default Options for xasy
-# External editor. $asypath will be replaced by the current file.
+# External editor. $asypath will be replaced by the current file.
externalEditor: "vi"
externalEditorArgs: ["$asypath"]
# Path to Asymptote executable
asyPath: "asy"
-# Overwrites the ASYMPTOTE_DIR Environment variable if set. Otherwise, leaves asymptote to decide.
+# Overwrites the ASYMPTOTE_DIR Environment variable if set. Otherwise, leaves asymptote to decide.
asyBaseLocation: null
# Show Debugging Information
@@ -16,21 +16,21 @@ showDebug: false
# Default Pen Options
defaultPenOptions: ""
-# Default Pen Color
+# Default Pen Color
defaultPenColor: "#000000"
-#
+#
defaultPenWidth: 0.5
useLegacyDrawMode: false
enableImmediatePreview: true
useDegrees: false
groupObjDefault: false
-#
+#
terminalFont: "Courier"
terminalFontSize: 9
-#
+#
defaultShowAxes: true
defaultShowGrid: false
defaultGridSnap: false
@@ -52,6 +52,11 @@ renderDensity: 2
minimumMagnification: 0.01
maximumMagnification: 100
+# SVG options
+# If null, use "rsvg-convert".
+# otherwise use the converter in the path
+rsvgConverterPath: null
+
# Debug Mode
debugMode: true
diff --git a/graphics/asymptote/GUI/icons_rc.py b/graphics/asymptote/GUI/icons_rc.py
deleted file mode 100644
index ed5548f258..0000000000
--- a/graphics/asymptote/GUI/icons_rc.py
+++ /dev/null
@@ -1,2903 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Resource object code
-#
-# Created by: The Resource Compiler for PyQt5 (Qt v5.15.15)
-#
-# WARNING! All changes made in this file will be lost!
-
-from PyQt5 import QtCore
-
-qt_resource_data = b"\
-\x00\x00\x07\x6b\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x31\x39\x33\x2e\x34\x36\x2c\x32\x34\x39\x2e\x30\
-\x35\x36\x63\x33\x2e\x37\x32\x33\x2d\x30\x2e\x36\x37\x2c\x37\x2e\
-\x35\x38\x39\x2d\x31\x2e\x30\x34\x31\x2c\x31\x31\x2e\x35\x38\x36\
-\x2d\x31\x2e\x30\x34\x31\x4c\x32\x30\x31\x2e\x39\x32\x34\x2c\x32\
-\x34\x38\x68\x31\x30\x33\x2e\x38\x32\x33\x63\x34\x2e\x35\x30\x33\
-\x2c\x30\x2c\x38\x2e\x38\x30\x36\x2d\x30\x2e\x36\x31\x37\x2c\x31\
-\x32\x2e\x39\x30\x38\x2d\x31\x2e\x37\x35\x34\x0a\x09\x09\x63\x31\
-\x39\x2e\x33\x37\x2d\x35\x2e\x33\x36\x33\x2c\x33\x33\x2e\x33\x34\
-\x35\x2d\x32\x32\x2e\x35\x33\x37\x2c\x33\x33\x2e\x33\x34\x35\x2d\
-\x34\x33\x2e\x36\x36\x33\x76\x2d\x33\x30\x2e\x38\x32\x32\x76\x2d\
-\x35\x36\x2e\x34\x30\x32\x63\x30\x2d\x32\x34\x2e\x38\x33\x32\x2d\
-\x32\x31\x2e\x31\x35\x2d\x34\x33\x2e\x34\x38\x34\x2d\x34\x36\x2e\
-\x32\x38\x39\x2d\x34\x37\x2e\x36\x30\x36\x0a\x09\x09\x63\x2d\x31\
-\x35\x2e\x39\x33\x31\x2d\x32\x2e\x36\x32\x34\x2d\x33\x39\x2e\x32\
-\x35\x38\x2d\x33\x2e\x38\x32\x37\x2d\x35\x35\x2e\x30\x38\x39\x2d\
-\x33\x2e\x37\x34\x39\x63\x2d\x31\x35\x2e\x38\x32\x39\x2c\x30\x2e\
-\x30\x38\x36\x2d\x33\x30\x2e\x39\x38\x31\x2c\x31\x2e\x34\x30\x34\
-\x2d\x34\x34\x2e\x32\x37\x37\x2c\x33\x2e\x37\x34\x39\x43\x31\x36\
-\x37\x2e\x31\x34\x33\x2c\x37\x34\x2e\x35\x37\x36\x2c\x31\x36\x30\
-\x2c\x38\x38\x2e\x39\x32\x38\x2c\x31\x36\x30\x2c\x31\x31\x35\x2e\
-\x33\x35\x39\x56\x31\x34\x34\x68\x39\x36\x0a\x09\x09\x76\x31\x36\
-\x48\x31\x32\x38\x2e\x38\x32\x63\x2d\x33\x35\x2e\x36\x32\x38\x2c\
-\x30\x2d\x36\x34\x2e\x35\x33\x38\x2c\x34\x32\x2e\x35\x37\x31\x2d\
-\x36\x34\x2e\x38\x31\x33\x2c\x39\x35\x2e\x32\x34\x32\x43\x36\x34\
-\x2e\x30\x30\x35\x2c\x32\x35\x35\x2e\x34\x39\x35\x2c\x36\x34\x2c\
-\x32\x35\x35\x2e\x37\x34\x37\x2c\x36\x34\x2c\x32\x35\x36\x63\x30\
-\x2c\x39\x2e\x35\x32\x33\x2c\x30\x2e\x39\x34\x2c\x31\x38\x2e\x37\
-\x32\x2c\x32\x2e\x36\x38\x35\x2c\x32\x37\x2e\x34\x30\x34\x0a\x09\
-\x09\x43\x37\x34\x2e\x36\x34\x38\x2c\x33\x32\x33\x2e\x30\x37\x2c\
-\x39\x39\x2e\x34\x35\x31\x2c\x33\x35\x32\x2c\x31\x32\x38\x2e\x38\
-\x32\x2c\x33\x35\x32\x48\x31\x34\x34\x76\x2d\x32\x2e\x36\x36\x32\
-\x76\x2d\x34\x33\x2e\x32\x37\x33\x43\x31\x34\x34\x2c\x32\x37\x39\
-\x2e\x32\x33\x38\x2c\x31\x36\x34\x2e\x31\x34\x36\x2c\x32\x35\x34\
-\x2e\x33\x33\x32\x2c\x31\x39\x33\x2e\x34\x36\x2c\x32\x34\x39\x2e\
-\x30\x35\x36\x7a\x20\x4d\x32\x30\x33\x2e\x36\x35\x36\x2c\x31\x32\
-\x37\x2e\x30\x30\x32\x0a\x09\x09\x63\x2d\x39\x2e\x35\x39\x32\x2c\
-\x30\x2d\x31\x37\x2e\x33\x38\x34\x2d\x37\x2e\x37\x38\x35\x2d\x31\
-\x37\x2e\x33\x38\x34\x2d\x31\x37\x2e\x34\x30\x33\x63\x30\x2d\x39\
-\x2e\x36\x36\x34\x2c\x37\x2e\x37\x37\x34\x2d\x31\x37\x2e\x35\x32\
-\x2c\x31\x37\x2e\x33\x38\x34\x2d\x31\x37\x2e\x35\x32\x63\x39\x2e\
-\x35\x37\x34\x2c\x30\x2c\x31\x37\x2e\x33\x39\x39\x2c\x37\x2e\x38\
-\x35\x35\x2c\x31\x37\x2e\x33\x39\x39\x2c\x31\x37\x2e\x35\x32\x0a\
-\x09\x09\x43\x32\x32\x31\x2e\x30\x35\x36\x2c\x31\x31\x39\x2e\x32\
-\x31\x37\x2c\x32\x31\x33\x2e\x32\x34\x36\x2c\x31\x32\x37\x2e\x30\
-\x30\x32\x2c\x32\x30\x33\x2e\x36\x35\x36\x2c\x31\x32\x37\x2e\x30\
-\x30\x32\x7a\x22\x2f\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x22\x4d\x34\x34\x33\x2e\x39\x35\x31\x2c\x32\x32\x32\x2e\x35\x34\
-\x33\x43\x34\x33\x34\x2e\x37\x38\x2c\x31\x38\x36\x2e\x30\x32\x31\
-\x2c\x34\x31\x31\x2e\x30\x33\x33\x2c\x31\x36\x30\x2c\x33\x38\x33\
-\x2e\x31\x38\x2c\x31\x36\x30\x48\x33\x36\x38\x76\x32\x2e\x36\x32\
-\x36\x76\x33\x38\x2e\x30\x34\x36\x63\x30\x2c\x33\x33\x2e\x39\x31\
-\x35\x2d\x32\x32\x2e\x32\x38\x36\x2c\x35\x38\x2e\x34\x37\x34\x2d\
-\x34\x39\x2e\x34\x38\x39\x2c\x36\x32\x2e\x36\x38\x31\x0a\x09\x09\
-\x63\x2d\x32\x2e\x37\x33\x37\x2c\x30\x2e\x34\x32\x34\x2d\x35\x2e\
-\x34\x38\x33\x2c\x30\x2e\x36\x34\x36\x2d\x38\x2e\x33\x30\x31\x2c\
-\x30\x2e\x36\x34\x36\x48\x32\x30\x36\x2e\x33\x35\x31\x63\x2d\x34\
-\x2e\x35\x31\x38\x2c\x30\x2d\x38\x2e\x39\x30\x34\x2c\x30\x2e\x35\
-\x38\x34\x2d\x31\x33\x2e\x30\x34\x39\x2c\x31\x2e\x36\x37\x32\x43\
-\x31\x37\x34\x2e\x31\x38\x2c\x32\x37\x30\x2e\x36\x38\x39\x2c\x31\
-\x36\x30\x2c\x32\x38\x36\x2e\x36\x2c\x31\x36\x30\x2c\x33\x30\x37\
-\x2e\x32\x33\x36\x76\x33\x32\x2e\x39\x32\x32\x0a\x09\x09\x76\x35\
-\x34\x2e\x33\x30\x35\x63\x30\x2c\x32\x34\x2e\x38\x33\x32\x2c\x32\
-\x34\x2e\x39\x37\x37\x2c\x33\x39\x2e\x34\x32\x36\x2c\x34\x39\x2e\
-\x34\x38\x31\x2c\x34\x36\x2e\x35\x35\x31\x63\x32\x39\x2e\x33\x32\
-\x37\x2c\x38\x2e\x35\x33\x31\x2c\x36\x31\x2e\x32\x36\x37\x2c\x31\
-\x30\x2e\x30\x36\x38\x2c\x39\x36\x2e\x33\x36\x36\x2c\x30\x43\x33\
-\x32\x39\x2e\x31\x35\x2c\x34\x33\x34\x2e\x33\x35\x34\x2c\x33\x35\
-\x32\x2c\x34\x32\x30\x2e\x38\x39\x33\x2c\x33\x35\x32\x2c\x33\x39\
-\x34\x2e\x34\x36\x33\x56\x33\x36\x38\x0a\x09\x09\x68\x2d\x39\x36\
-\x76\x2d\x31\x36\x68\x31\x32\x37\x2e\x31\x38\x63\x32\x35\x2e\x32\
-\x34\x2c\x30\x2c\x34\x37\x2e\x31\x30\x37\x2d\x32\x31\x2e\x33\x36\
-\x35\x2c\x35\x37\x2e\x38\x31\x34\x2d\x35\x32\x2e\x35\x34\x39\x43\
-\x34\x34\x35\x2e\x34\x37\x34\x2c\x32\x38\x36\x2e\x34\x30\x34\x2c\
-\x34\x34\x38\x2c\x32\x37\x31\x2e\x36\x34\x31\x2c\x34\x34\x38\x2c\
-\x32\x35\x36\x0a\x09\x09\x43\x34\x34\x38\x2c\x32\x34\x34\x2e\x32\
-\x33\x32\x2c\x34\x34\x36\x2e\x35\x36\x37\x2c\x32\x33\x32\x2e\x39\
-\x36\x32\x2c\x34\x34\x33\x2e\x39\x35\x31\x2c\x32\x32\x32\x2e\x35\
-\x34\x33\x7a\x20\x4d\x33\x30\x37\x2e\x38\x36\x37\x2c\x33\x38\x32\
-\x2e\x38\x32\x63\x39\x2e\x35\x39\x2c\x30\x2c\x31\x37\x2e\x33\x38\
-\x31\x2c\x37\x2e\x37\x38\x35\x2c\x31\x37\x2e\x33\x38\x31\x2c\x31\
-\x37\x2e\x34\x0a\x09\x09\x63\x30\x2c\x39\x2e\x36\x35\x2d\x37\x2e\
-\x37\x39\x31\x2c\x31\x37\x2e\x35\x32\x31\x2d\x31\x37\x2e\x33\x38\
-\x31\x2c\x31\x37\x2e\x35\x32\x31\x63\x2d\x39\x2e\x35\x37\x37\x2c\
-\x30\x2d\x31\x37\x2e\x33\x39\x39\x2d\x37\x2e\x38\x37\x31\x2d\x31\
-\x37\x2e\x33\x39\x39\x2d\x31\x37\x2e\x35\x32\x31\x43\x32\x39\x30\
-\x2e\x34\x36\x38\x2c\x33\x39\x30\x2e\x35\x39\x2c\x32\x39\x38\x2e\
-\x32\x37\x34\x2c\x33\x38\x32\x2e\x38\x32\x2c\x33\x30\x37\x2e\x38\
-\x36\x37\x2c\x33\x38\x32\x2e\x38\x32\x7a\x22\x2f\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x05\x9c\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x33\x2e\x39\x39\x39\x36\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x33\x2e\x39\x39\x39\x36\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x36\x2e\x34\x30\x39\x34\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x35\x34\x2e\x38\x39\x32\x36\x20\x32\x34\x2e\x35\x32\
-\x39\x31\x43\x20\x35\x34\x2e\x38\x39\x32\x36\x20\x32\x30\x2e\x33\
-\x33\x36\x38\x20\x34\x34\x2e\x36\x39\x36\x39\x20\x31\x36\x2e\x39\
-\x33\x38\x33\x20\x33\x32\x2e\x31\x32\x20\x31\x36\x2e\x39\x33\x38\
-\x33\x43\x20\x31\x39\x2e\x35\x34\x33\x31\x20\x31\x36\x2e\x39\x33\
-\x38\x33\x20\x39\x2e\x33\x34\x37\x34\x32\x20\x32\x30\x2e\x33\x33\
-\x36\x38\x20\x39\x2e\x33\x34\x37\x34\x32\x20\x32\x34\x2e\x35\x32\
-\x39\x31\x43\x20\x39\x2e\x33\x34\x37\x34\x32\x20\x32\x38\x2e\x37\
-\x32\x31\x35\x20\x31\x39\x2e\x35\x34\x33\x31\x20\x33\x32\x2e\x31\
-\x32\x20\x33\x32\x2e\x31\x32\x20\x33\x32\x2e\x31\x32\x43\x20\x34\
-\x34\x2e\x36\x39\x36\x39\x20\x33\x32\x2e\x31\x32\x20\x35\x34\x2e\
-\x38\x39\x32\x36\x20\x32\x38\x2e\x37\x32\x31\x35\x20\x35\x34\x2e\
-\x38\x39\x32\x36\x20\x32\x34\x2e\x35\x32\x39\x31\x5a\x27\x20\x66\
-\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x27\x72\x6f\x75\x6e\
-\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\
-\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3d\x27\x31\x30\
-\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\
-\x64\x74\x68\x3d\x27\x33\x2e\x35\x31\x33\x31\x32\x27\x2f\x3e\x0a\
-\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\
-\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x36\x2e\
-\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\
-\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x27\x4d\x20\x39\x2e\x33\x34\x37\x34\x32\
-\x20\x32\x34\x2e\x35\x32\x39\x31\x4c\x20\x39\x2e\x33\x34\x37\x34\
-\x32\x20\x35\x34\x2e\x38\x39\x32\x36\x4c\x20\x39\x2e\x33\x34\x37\
-\x34\x32\x20\x35\x34\x2e\x38\x39\x32\x36\x43\x20\x39\x2e\x33\x34\
-\x37\x34\x32\x20\x35\x34\x2e\x38\x39\x32\x36\x20\x39\x2e\x33\x34\
-\x37\x34\x32\x20\x35\x34\x2e\x38\x39\x32\x36\x20\x39\x2e\x33\x34\
-\x37\x34\x32\x20\x35\x34\x2e\x38\x39\x32\x36\x43\x20\x39\x2e\x33\
-\x34\x37\x34\x32\x20\x35\x39\x2e\x30\x38\x34\x39\x20\x31\x39\x2e\
-\x35\x34\x33\x31\x20\x36\x32\x2e\x34\x38\x33\x34\x20\x33\x32\x2e\
-\x31\x32\x20\x36\x32\x2e\x34\x38\x33\x34\x43\x20\x34\x34\x2e\x36\
-\x39\x36\x39\x20\x36\x32\x2e\x34\x38\x33\x34\x20\x35\x34\x2e\x38\
-\x39\x32\x36\x20\x35\x39\x2e\x30\x38\x34\x39\x20\x35\x34\x2e\x38\
-\x39\x32\x36\x20\x35\x34\x2e\x38\x39\x32\x36\x4c\x20\x35\x34\x2e\
-\x38\x39\x32\x36\x20\x35\x34\x2e\x38\x39\x32\x36\x4c\x20\x35\x34\
-\x2e\x38\x39\x32\x36\x20\x32\x34\x2e\x35\x32\x39\x31\x27\x20\x66\
-\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x27\x72\x6f\x75\x6e\
-\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\
-\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3d\x27\x31\x30\
-\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\
-\x64\x74\x68\x3d\x27\x33\x2e\x35\x31\x33\x31\x32\x27\x2f\x3e\x0a\
-\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\
-\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x36\x2e\
-\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\
-\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x27\x4d\x20\x35\x34\x2e\x38\x39\x32\x36\
-\x20\x32\x34\x2e\x35\x32\x39\x31\x43\x20\x35\x34\x2e\x38\x39\x32\
-\x36\x20\x31\x31\x2e\x39\x35\x32\x32\x20\x34\x34\x2e\x36\x39\x36\
-\x39\x20\x31\x2e\x37\x35\x36\x35\x36\x20\x33\x32\x2e\x31\x32\x20\
-\x31\x2e\x37\x35\x36\x35\x36\x43\x20\x31\x39\x2e\x35\x34\x33\x31\
-\x20\x31\x2e\x37\x35\x36\x35\x36\x20\x39\x2e\x33\x34\x37\x34\x32\
-\x20\x31\x31\x2e\x39\x35\x32\x32\x20\x39\x2e\x33\x34\x37\x34\x32\
-\x20\x32\x34\x2e\x35\x32\x39\x31\x27\x20\x66\x69\x6c\x6c\x3d\x27\
-\x6e\x6f\x6e\x65\x27\x20\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\
-\x30\x30\x30\x30\x30\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\
-\x6e\x65\x63\x61\x70\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\
-\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\
-\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\
-\x65\x72\x6c\x69\x6d\x69\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\
-\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\
-\x33\x2e\x35\x31\x33\x31\x32\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\
-\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x00\x00\x02\x72\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x38\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\x61\
-\x74\x68\x20\x64\x3d\x22\x4d\x34\x32\x37\x2c\x32\x33\x34\x2e\x36\
-\x32\x35\x48\x31\x36\x37\x2e\x32\x39\x36\x6c\x31\x31\x39\x2e\x37\
-\x30\x32\x2d\x31\x31\x39\x2e\x37\x30\x32\x4c\x32\x35\x36\x2c\x38\
-\x35\x4c\x38\x35\x2c\x32\x35\x36\x6c\x31\x37\x31\x2c\x31\x37\x31\
-\x6c\x32\x39\x2e\x39\x32\x32\x2d\x32\x39\x2e\x39\x32\x34\x4c\x31\
-\x36\x37\x2e\x32\x39\x36\x2c\x32\x37\x37\x2e\x33\x37\x35\x48\x34\
-\x32\x37\x56\x32\x33\x34\x2e\x36\x32\x35\x7a\x22\x2f\x3e\x0a\x09\
-\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x0a\
-\x00\x00\x03\x1b\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x32\x35\x36\x2c\x33\x38\x38\x63\x2d\x37\x32\x2e\
-\x35\x39\x37\x2c\x30\x2d\x31\x33\x32\x2d\x35\x39\x2e\x34\x30\x35\
-\x2d\x31\x33\x32\x2d\x31\x33\x32\x63\x30\x2d\x37\x32\x2e\x36\x30\
-\x31\x2c\x35\x39\x2e\x34\x30\x33\x2d\x31\x33\x32\x2c\x31\x33\x32\
-\x2d\x31\x33\x32\x63\x33\x36\x2e\x33\x2c\x30\x2c\x36\x39\x2e\x32\
-\x39\x39\x2c\x31\x35\x2e\x34\x2c\x39\x32\x2e\x34\x30\x36\x2c\x33\
-\x39\x2e\x36\x30\x31\x4c\x32\x37\x38\x2c\x32\x33\x34\x68\x31\x35\
-\x34\x56\x38\x30\x0a\x09\x09\x6c\x2d\x35\x31\x2e\x36\x39\x38\x2c\
-\x35\x31\x2e\x37\x30\x32\x43\x33\x34\x38\x2e\x34\x30\x36\x2c\x39\
-\x39\x2e\x37\x39\x38\x2c\x33\x30\x34\x2e\x34\x30\x36\x2c\x38\x30\
-\x2c\x32\x35\x36\x2c\x38\x30\x63\x2d\x39\x36\x2e\x37\x39\x37\x2c\
-\x30\x2d\x31\x37\x36\x2c\x37\x39\x2e\x32\x30\x33\x2d\x31\x37\x36\
-\x2c\x31\x37\x36\x73\x37\x38\x2e\x30\x39\x34\x2c\x31\x37\x36\x2c\
-\x31\x37\x36\x2c\x31\x37\x36\x0a\x09\x09\x63\x38\x31\x2e\x30\x34\
-\x35\x2c\x30\x2c\x31\x34\x38\x2e\x32\x38\x37\x2d\x35\x34\x2e\x31\
-\x33\x34\x2c\x31\x36\x39\x2e\x34\x30\x31\x2d\x31\x32\x38\x48\x33\
-\x37\x38\x2e\x38\x35\x43\x33\x36\x30\x2e\x31\x30\x35\x2c\x33\x35\
-\x33\x2e\x35\x36\x31\x2c\x33\x31\x31\x2e\x37\x31\x32\x2c\x33\x38\
-\x38\x2c\x32\x35\x36\x2c\x33\x38\x38\x7a\x22\x2f\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\xe8\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x43\
-\x68\x65\x76\x72\x6f\x6e\x5f\x63\x69\x72\x63\x6c\x65\x64\x5f\x6c\
-\x65\x66\x74\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\
-\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\x6c\
-\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\x6e\
-\x6b\x22\x0a\x09\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\x22\
-\x30\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\
-\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\x32\x34\x20\x30\x20\x30\
-\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\
-\x20\x64\x3d\x22\x4d\x31\x31\x2e\x33\x30\x32\x2c\x36\x2e\x37\x37\
-\x36\x63\x2d\x30\x2e\x31\x39\x36\x2d\x30\x2e\x31\x39\x37\x2d\x30\
-\x2e\x35\x31\x35\x2d\x30\x2e\x31\x39\x37\x2d\x30\x2e\x37\x31\x2c\
-\x30\x4c\x37\x2e\x37\x38\x35\x2c\x39\x2e\x36\x34\x31\x63\x2d\x30\
-\x2e\x31\x39\x36\x2c\x30\x2e\x31\x39\x39\x2d\x30\x2e\x31\x39\x36\
-\x2c\x30\x2e\x35\x32\x2c\x30\x2c\x30\x2e\x37\x31\x37\x6c\x32\x2e\
-\x38\x30\x37\x2c\x32\x2e\x38\x36\x34\x0a\x09\x63\x30\x2e\x31\x39\
-\x35\x2c\x30\x2e\x31\x39\x39\x2c\x30\x2e\x35\x31\x34\x2c\x30\x2e\
-\x31\x39\x38\x2c\x30\x2e\x37\x31\x2c\x30\x63\x30\x2e\x31\x39\x36\
-\x2d\x30\x2e\x31\x39\x37\x2c\x30\x2e\x31\x39\x36\x2d\x30\x2e\x35\
-\x31\x38\x2c\x30\x2d\x30\x2e\x37\x31\x37\x4c\x39\x2c\x31\x30\x6c\
-\x32\x2e\x33\x30\x32\x2d\x32\x2e\x35\x30\x36\x43\x31\x31\x2e\x34\
-\x39\x38\x2c\x37\x2e\x32\x39\x36\x2c\x31\x31\x2e\x34\x39\x38\x2c\
-\x36\x2e\x39\x37\x36\x2c\x31\x31\x2e\x33\x30\x32\x2c\x36\x2e\x37\
-\x37\x36\x7a\x0a\x09\x20\x4d\x31\x30\x2c\x30\x2e\x34\x63\x2d\x35\
-\x2e\x33\x30\x32\x2c\x30\x2d\x39\x2e\x36\x2c\x34\x2e\x32\x39\x38\
-\x2d\x39\x2e\x36\x2c\x39\x2e\x36\x63\x30\x2c\x35\x2e\x33\x30\x33\
-\x2c\x34\x2e\x32\x39\x38\x2c\x39\x2e\x36\x2c\x39\x2e\x36\x2c\x39\
-\x2e\x36\x73\x39\x2e\x36\x2d\x34\x2e\x32\x39\x37\x2c\x39\x2e\x36\
-\x2d\x39\x2e\x36\x43\x31\x39\x2e\x36\x2c\x34\x2e\x36\x39\x38\x2c\
-\x31\x35\x2e\x33\x30\x32\x2c\x30\x2e\x34\x2c\x31\x30\x2c\x30\x2e\
-\x34\x7a\x20\x4d\x31\x30\x2c\x31\x38\x2e\x33\x35\x34\x0a\x09\x63\
-\x2d\x34\x2e\x36\x31\x35\x2c\x30\x2d\x38\x2e\x33\x35\x34\x2d\x33\
-\x2e\x37\x34\x2d\x38\x2e\x33\x35\x34\x2d\x38\x2e\x33\x35\x34\x63\
-\x30\x2d\x34\x2e\x36\x31\x34\x2c\x33\x2e\x37\x33\x39\x2d\x38\x2e\
-\x33\x35\x34\x2c\x38\x2e\x33\x35\x34\x2d\x38\x2e\x33\x35\x34\x63\
-\x34\x2e\x36\x31\x33\x2c\x30\x2c\x38\x2e\x33\x35\x34\x2c\x33\x2e\
-\x37\x34\x2c\x38\x2e\x33\x35\x34\x2c\x38\x2e\x33\x35\x34\x0a\x09\
-\x43\x31\x38\x2e\x33\x35\x34\x2c\x31\x34\x2e\x36\x31\x34\x2c\x31\
-\x34\x2e\x36\x31\x33\x2c\x31\x38\x2e\x33\x35\x34\x2c\x31\x30\x2c\
-\x31\x38\x2e\x33\x35\x34\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\
-\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\x1f\
-\x00\
-\x00\x07\x5c\x78\x9c\xdd\x53\x3d\x6f\xdb\x30\x10\xdd\xfd\x2b\xae\
-\xc8\xc0\x64\xf0\x89\x5f\xa2\xc4\xc0\x74\x80\x1a\xe8\x94\x6e\xc9\
-\xd2\x4d\xb6\x68\x99\x8d\x2c\x19\x92\x2a\xb9\xff\xbe\x88\x2d\xd2\
-\xae\xda\xa0\x4b\x86\x22\x1a\x08\xbd\x77\x7a\xa7\x7b\x77\xbc\xc5\
-\xc3\x71\x5f\x42\x6f\x9b\xd6\xd5\x95\x21\x0c\x29\x01\x5b\x6d\xea\
-\xdc\x55\x85\x21\xcf\x4f\x5f\xe6\x29\x79\x58\xce\x16\x9f\xe6\x73\
-\x78\xda\xb9\x16\xb6\xae\xb4\x30\x64\x2d\x14\xb6\xb2\x4d\xd6\xd9\
-\x1c\xd6\x3f\x21\xef\x5d\xdb\x17\x7b\xe0\xc8\x18\x32\x98\xcf\x97\
-\xb3\x45\xdb\x17\xd7\x89\x19\x81\xe3\xbe\xac\x5a\x43\x76\x5d\x77\
-\xb8\x8f\xa2\x61\x18\x70\x10\x58\x37\x45\xc4\x29\xa5\x51\xdb\x17\
-\xe3\x27\xf7\xc7\xd2\x55\x2f\x7f\xfb\x90\x69\xad\xa3\x53\x94\xc0\
-\xe0\xf2\x6e\x67\x88\x12\xa8\xb5\x56\x87\x8e\xc0\xce\xba\x62\xd7\
-\x19\xa2\xe4\x2b\xea\x9d\x1d\x3e\xd7\x47\x43\x62\x85\x92\x6a\x09\
-\x8c\x25\x98\xc6\x29\x8c\x0a\x50\x92\x2c\x67\x8b\x02\x5c\x6e\xc8\
-\x21\x2b\x2c\x3b\xc3\xae\xc9\xaa\x76\x5b\x37\x7b\x43\x4e\xaf\x65\
-\xd6\xd9\xdb\x49\x8e\xbb\x76\x93\x95\xf6\x16\xb5\x56\x5c\xc9\xbb\
-\x57\xe1\x21\xeb\x76\x90\x1b\xf2\x15\x34\x0a\x99\x48\x0e\x92\x63\
-\x22\x13\xfe\x18\x88\x58\x62\xaa\xb9\xfa\x83\x58\x4d\x89\x7f\xe1\
-\x2b\x81\x46\x9a\x4a\x0d\x4c\x63\x2c\x05\x03\xc5\x51\xa6\x42\x82\
-\xe0\xc8\xb8\x47\x2b\x90\x12\x95\x56\x3a\x84\x7d\x5e\x2f\x0f\xd8\
-\x57\xf8\x26\x11\x4c\x79\x42\x50\x54\x94\xa5\xab\x40\xf0\x53\xab\
-\xe2\xf0\x4f\x2e\x90\x32\x36\x56\x74\x06\xab\x50\xef\x18\xf4\x76\
-\xbc\xd6\xe3\x31\xf9\xe3\xb4\xa7\xdf\xc8\xeb\x45\x2c\x0d\xb9\x59\
-\x6f\xd7\xdb\xed\x96\x44\xcb\xd9\x22\x2a\xde\x67\x7e\xc1\x88\xc4\
-\x98\x6b\x76\xe5\x8c\xa2\x10\x2a\x0d\xce\x98\x42\x2d\x52\x31\x5a\
-\x1b\xd1\xc5\x9b\x0f\x07\x73\xa3\x3c\x60\x9f\x3f\x10\x29\x26\x9c\
-\xc5\x21\xc1\x39\xef\xd5\x79\x19\xe4\x99\x0c\x85\x8d\xc2\x49\xe5\
-\xa1\x4b\x55\x5d\x59\x02\x6d\xd7\xd4\x2f\xd6\x90\x1b\x7a\x7a\x3c\
-\x31\x2f\x5d\x65\x37\xd9\xc1\x90\xa6\xfe\x51\xe5\xbf\xd1\xdf\x6b\
-\x57\x4d\xf9\xbd\xeb\x6c\x53\xba\xbd\xeb\x0c\x61\x14\xa9\x48\xe2\
-\x10\x1b\x77\x52\x60\xcc\x04\xe3\xef\x3a\x95\x49\xd7\x3e\xd6\x56\
-\x8d\xa6\x3e\xd2\xbc\xde\xdc\x22\xc6\x50\xc7\x9c\x5f\xb6\x08\x93\
-\x58\xc5\xca\x6f\xd1\x19\x5d\x6d\xd1\x18\xf6\xb3\xf1\xf2\xc9\x7d\
-\xf8\x6f\x5a\x77\x3e\xda\xbe\x58\xfe\x02\xb3\x30\xdb\xa9\
-\x00\x00\x03\x2a\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x70\x6f\x6c\x79\x67\
-\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x33\x39\x36\x2e\x37\
-\x39\x35\x2c\x33\x39\x36\x2e\x38\x20\x33\x32\x30\x2c\x33\x39\x36\
-\x2e\x38\x20\x33\x32\x30\x2c\x34\x34\x38\x20\x34\x34\x38\x2c\x34\
-\x34\x38\x20\x34\x34\x38\x2c\x33\x32\x30\x20\x33\x39\x36\x2e\x37\
-\x39\x35\x2c\x33\x32\x30\x20\x09\x22\x2f\x3e\x0a\x09\x3c\x70\x6f\
-\x6c\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x33\x39\
-\x36\x2e\x38\x2c\x31\x31\x35\x2e\x32\x30\x35\x20\x33\x39\x36\x2e\
-\x38\x2c\x31\x39\x32\x20\x34\x34\x38\x2c\x31\x39\x32\x20\x34\x34\
-\x38\x2c\x36\x34\x20\x33\x32\x30\x2c\x36\x34\x20\x33\x32\x30\x2c\
-\x31\x31\x35\x2e\x32\x30\x35\x20\x09\x22\x2f\x3e\x0a\x09\x3c\x70\
-\x6f\x6c\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x31\
-\x31\x35\x2e\x32\x30\x35\x2c\x31\x31\x35\x2e\x32\x20\x31\x39\x32\
-\x2c\x31\x31\x35\x2e\x32\x20\x31\x39\x32\x2c\x36\x34\x20\x36\x34\
-\x2c\x36\x34\x20\x36\x34\x2c\x31\x39\x32\x20\x31\x31\x35\x2e\x32\
-\x30\x35\x2c\x31\x39\x32\x20\x09\x22\x2f\x3e\x0a\x09\x3c\x70\x6f\
-\x6c\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x31\x31\
-\x35\x2e\x32\x2c\x33\x39\x36\x2e\x37\x39\x35\x20\x31\x31\x35\x2e\
-\x32\x2c\x33\x32\x30\x20\x36\x34\x2c\x33\x32\x30\x20\x36\x34\x2c\
-\x34\x34\x38\x20\x31\x39\x32\x2c\x34\x34\x38\x20\x31\x39\x32\x2c\
-\x33\x39\x36\x2e\x37\x39\x35\x20\x09\x22\x2f\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x04\x17\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x69\x73\x6f\
-\x2d\x38\x38\x35\x39\x2d\x31\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\
-\x47\x65\x6e\x65\x72\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\
-\x20\x49\x6c\x6c\x75\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x39\x2e\
-\x30\x2e\x30\x2c\x20\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\
-\x50\x6c\x75\x67\x2d\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\
-\x72\x73\x69\x6f\x6e\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\
-\x64\x20\x30\x29\x20\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\
-\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\
-\x22\x4c\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\
-\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
-\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\
-\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\
-\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\
-\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\
-\x79\x3d\x22\x30\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x22\x30\x20\x30\x20\x34\x32\x33\x2e\x37\x35\x34\x20\x34\
-\x32\x33\x2e\x37\x35\x34\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x65\
-\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\
-\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x34\x32\x33\x2e\x37\x35\x34\
-\x20\x34\x32\x33\x2e\x37\x35\x34\x3b\x22\x20\x78\x6d\x6c\x3a\x73\
-\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\
-\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x33\x35\x34\x2e\x32\
-\x34\x2c\x34\x37\x2e\x34\x6c\x33\x39\x2e\x38\x37\x39\x2d\x33\x39\
-\x2e\x38\x37\x39\x48\x32\x37\x32\x2e\x31\x39\x36\x76\x31\x32\x31\
-\x2e\x39\x32\x34\x6c\x36\x30\x2e\x38\x30\x31\x2d\x36\x30\x2e\x38\
-\x30\x31\x63\x35\x36\x2c\x35\x30\x2e\x30\x36\x36\x2c\x37\x37\x2e\
-\x32\x35\x31\x2c\x31\x33\x32\x2e\x30\x30\x34\x2c\x34\x36\x2e\x39\
-\x31\x38\x2c\x32\x30\x35\x2e\x32\x33\x35\x0a\x09\x63\x2d\x31\x38\
-\x2e\x35\x38\x35\x2c\x34\x34\x2e\x38\x36\x39\x2d\x35\x33\x2e\x35\
-\x33\x31\x2c\x37\x39\x2e\x38\x31\x35\x2d\x39\x38\x2e\x34\x2c\x39\
-\x38\x2e\x34\x63\x2d\x34\x34\x2e\x38\x36\x36\x2c\x31\x38\x2e\x35\
-\x38\x35\x2d\x39\x34\x2e\x32\x38\x38\x2c\x31\x38\x2e\x35\x38\x35\
-\x2d\x31\x33\x39\x2e\x31\x35\x38\x2c\x30\x63\x2d\x34\x34\x2e\x38\
-\x36\x39\x2d\x31\x38\x2e\x35\x38\x35\x2d\x37\x39\x2e\x38\x31\x35\
-\x2d\x35\x33\x2e\x35\x33\x31\x2d\x39\x38\x2e\x34\x2d\x39\x38\x2e\
-\x34\x0a\x09\x63\x2d\x31\x38\x2e\x35\x38\x35\x2d\x34\x34\x2e\x38\
-\x36\x39\x2d\x31\x38\x2e\x35\x38\x35\x2d\x39\x34\x2e\x32\x39\x2c\
-\x30\x2d\x31\x33\x39\x2e\x31\x35\x39\x6c\x2d\x32\x37\x2e\x37\x31\
-\x37\x2d\x31\x31\x2e\x34\x38\x63\x2d\x32\x31\x2e\x36\x35\x31\x2c\
-\x35\x32\x2e\x32\x37\x32\x2d\x32\x31\x2e\x36\x35\x31\x2c\x31\x30\
-\x39\x2e\x38\x34\x38\x2c\x30\x2c\x31\x36\x32\x2e\x31\x32\x0a\x09\
-\x63\x32\x31\x2e\x36\x35\x32\x2c\x35\x32\x2e\x32\x37\x32\x2c\x36\
-\x32\x2e\x33\x36\x34\x2c\x39\x32\x2e\x39\x38\x34\x2c\x31\x31\x34\
-\x2e\x36\x33\x37\x2c\x31\x31\x34\x2e\x36\x33\x36\x63\x32\x36\x2e\
-\x31\x34\x2c\x31\x30\x2e\x38\x32\x37\x2c\x35\x33\x2e\x35\x39\x35\
-\x2c\x31\x36\x2e\x32\x34\x2c\x38\x31\x2e\x30\x36\x2c\x31\x36\x2e\
-\x32\x33\x39\x63\x32\x37\x2e\x34\x35\x39\x2d\x30\x2e\x30\x30\x31\
-\x2c\x35\x34\x2e\x39\x32\x37\x2d\x35\x2e\x34\x31\x34\x2c\x38\x31\
-\x2e\x30\x36\x31\x2d\x31\x36\x2e\x32\x33\x39\x0a\x09\x63\x35\x32\
-\x2e\x32\x37\x31\x2d\x32\x31\x2e\x36\x35\x32\x2c\x39\x32\x2e\x39\
-\x38\x33\x2d\x36\x32\x2e\x33\x36\x34\x2c\x31\x31\x34\x2e\x36\x33\
-\x36\x2d\x31\x31\x34\x2e\x36\x33\x36\x43\x34\x34\x32\x2e\x37\x33\
-\x39\x2c\x32\x30\x30\x2e\x36\x2c\x34\x31\x38\x2e\x35\x33\x32\x2c\
-\x31\x30\x35\x2e\x38\x32\x36\x2c\x33\x35\x34\x2e\x32\x34\x2c\x34\
-\x37\x2e\x34\x7a\x22\x2f\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\
-\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\
-\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\
-\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\
-\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x04\xa3\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x34\x2e\x30\x30\x30\x31\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x34\x2e\x30\x30\x30\x31\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\x32\x43\
-\x20\x34\x2e\x33\x35\x34\x33\x38\x20\x32\x34\x2e\x39\x32\x38\x37\
-\x20\x38\x2e\x34\x33\x32\x31\x37\x20\x31\x38\x2e\x30\x30\x31\x34\
-\x20\x31\x33\x2e\x39\x36\x38\x37\x20\x31\x32\x2e\x39\x33\x36\x31\
-\x43\x20\x33\x31\x2e\x37\x33\x33\x39\x20\x2d\x33\x2e\x33\x31\x36\
-\x37\x35\x20\x35\x37\x2e\x32\x39\x34\x33\x20\x33\x2e\x35\x39\x37\
-\x39\x37\x20\x35\x38\x2e\x32\x31\x37\x35\x20\x32\x31\x2e\x37\x33\
-\x37\x38\x43\x20\x35\x38\x2e\x36\x37\x38\x38\x20\x33\x30\x2e\x38\
-\x30\x31\x39\x20\x35\x31\x2e\x31\x37\x38\x33\x20\x33\x37\x2e\x36\
-\x34\x34\x31\x20\x34\x32\x2e\x37\x34\x34\x35\x20\x34\x31\x2e\x37\
-\x31\x31\x39\x43\x20\x32\x37\x2e\x34\x36\x34\x36\x20\x34\x39\x2e\
-\x30\x38\x31\x38\x20\x39\x2e\x32\x36\x34\x35\x31\x20\x34\x36\x2e\
-\x30\x39\x36\x34\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\
-\x32\x5a\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\
-\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
-\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
-\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x32\x2e\x35\x30\x39\x33\
-\x37\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\
-\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\
-\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\x35\
-\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\
-\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\x36\
-\x2e\x30\x32\x32\x35\x27\x20\x63\x79\x3d\x27\x33\x32\x2e\x31\x32\
-\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\
-\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\
-\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\
-\x36\x39\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\
-\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\
-\x63\x6c\x65\x20\x63\x78\x3d\x27\x31\x33\x2e\x39\x36\x38\x37\x27\
-\x20\x63\x79\x3d\x27\x31\x32\x2e\x39\x33\x36\x31\x27\x20\x66\x69\
-\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\
-\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\
-\x63\x78\x3d\x27\x35\x38\x2e\x32\x31\x37\x35\x27\x20\x63\x79\x3d\
-\x27\x32\x31\x2e\x37\x33\x37\x38\x27\x20\x66\x69\x6c\x6c\x3d\x27\
-\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\
-\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\
-\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\
-\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\
-\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\
-\x34\x32\x2e\x37\x34\x34\x35\x27\x20\x63\x79\x3d\x27\x34\x31\x2e\
-\x37\x31\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\
-\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\
-\x67\x3e\
-\x00\x00\x04\x73\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x34\x2e\x30\x30\x30\x31\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x34\x2e\x30\x30\x30\x31\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\x32\x43\
-\x20\x36\x2e\x32\x32\x30\x37\x32\x20\x32\x34\x2e\x39\x36\x35\x35\
-\x20\x39\x2e\x30\x34\x39\x38\x39\x20\x31\x38\x2e\x31\x33\x35\x33\
-\x20\x31\x33\x2e\x39\x36\x38\x37\x20\x31\x32\x2e\x39\x33\x36\x31\
-\x43\x20\x32\x39\x2e\x35\x30\x36\x32\x20\x2d\x33\x2e\x34\x38\x36\
-\x38\x36\x20\x35\x35\x2e\x33\x36\x37\x33\x20\x32\x2e\x36\x39\x39\
-\x35\x20\x35\x38\x2e\x32\x31\x37\x35\x20\x32\x31\x2e\x37\x33\x37\
-\x38\x43\x20\x35\x39\x2e\x36\x39\x32\x32\x20\x33\x31\x2e\x35\x38\
-\x38\x31\x20\x35\x32\x2e\x36\x35\x30\x38\x20\x34\x30\x2e\x36\x37\
-\x37\x39\x20\x34\x32\x2e\x37\x34\x34\x35\x20\x34\x31\x2e\x37\x31\
-\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\
-\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
-\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
-\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x32\x2e\x35\x30\x39\x33\
-\x37\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\
-\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\
-\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\x35\
-\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\
-\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\x36\
-\x2e\x30\x32\x32\x35\x27\x20\x63\x79\x3d\x27\x33\x32\x2e\x31\x32\
-\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\
-\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\
-\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\
-\x36\x39\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\
-\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\
-\x63\x6c\x65\x20\x63\x78\x3d\x27\x31\x33\x2e\x39\x36\x38\x37\x27\
-\x20\x63\x79\x3d\x27\x31\x32\x2e\x39\x33\x36\x31\x27\x20\x66\x69\
-\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\
-\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\
-\x63\x78\x3d\x27\x35\x38\x2e\x32\x31\x37\x35\x27\x20\x63\x79\x3d\
-\x27\x32\x31\x2e\x37\x33\x37\x38\x27\x20\x66\x69\x6c\x6c\x3d\x27\
-\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\
-\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\
-\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\
-\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\
-\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\
-\x34\x32\x2e\x37\x34\x34\x35\x27\x20\x63\x79\x3d\x27\x34\x31\x2e\
-\x37\x31\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\
-\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\
-\x67\x3e\
-\x00\x00\x04\x9c\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x30\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x43\
-\x6f\x64\x65\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\
-\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\x6c\
-\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\x6e\
-\x6b\x22\x20\x78\x3d\x22\x32\x34\x70\x78\x22\x20\x79\x3d\x22\x32\
-\x34\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\
-\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\
-\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\
-\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\
-\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\
-\x65\x72\x76\x65\x22\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\
-\x6f\x72\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\x32\x34\x20\x30\
-\x20\x30\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\x3c\x70\x61\x74\
-\x68\x20\x64\x3d\x22\x4d\x35\x2e\x37\x31\x39\x2c\x31\x34\x2e\x37\
-\x35\x63\x2d\x30\x2e\x32\x33\x36\x2c\x30\x2d\x30\x2e\x34\x37\x34\
-\x2d\x30\x2e\x30\x38\x33\x2d\x30\x2e\x36\x36\x34\x2d\x30\x2e\x32\
-\x35\x32\x4c\x2d\x30\x2e\x30\x30\x35\x2c\x31\x30\x6c\x35\x2e\x33\
-\x34\x31\x2d\x34\x2e\x37\x34\x38\x43\x35\x2e\x37\x34\x38\x2c\x34\
-\x2e\x38\x38\x37\x2c\x36\x2e\x33\x38\x2c\x34\x2e\x39\x32\x32\x2c\
-\x36\x2e\x37\x34\x37\x2c\x35\x2e\x33\x33\x35\x0a\x09\x63\x30\x2e\
-\x33\x36\x37\x2c\x30\x2e\x34\x31\x33\x2c\x30\x2e\x33\x33\x2c\x31\
-\x2e\x30\x34\x35\x2d\x30\x2e\x30\x38\x33\x2c\x31\x2e\x34\x31\x32\
-\x4c\x33\x2e\x30\x30\x35\x2c\x31\x30\x6c\x33\x2e\x33\x37\x38\x2c\
-\x33\x2e\x30\x30\x32\x63\x30\x2e\x34\x31\x33\x2c\x30\x2e\x33\x36\
-\x37\x2c\x30\x2e\x34\x35\x2c\x30\x2e\x39\x39\x39\x2c\x30\x2e\x30\
-\x38\x33\x2c\x31\x2e\x34\x31\x32\x0a\x09\x43\x36\x2e\x32\x36\x39\
-\x2c\x31\x34\x2e\x36\x33\x37\x2c\x35\x2e\x39\x39\x34\x2c\x31\x34\
-\x2e\x37\x35\x2c\x35\x2e\x37\x31\x39\x2c\x31\x34\x2e\x37\x35\x7a\
-\x20\x4d\x31\x34\x2e\x36\x36\x34\x2c\x31\x34\x2e\x37\x34\x38\x4c\
-\x32\x30\x2e\x30\x30\x35\x2c\x31\x30\x6c\x2d\x35\x2e\x30\x36\x2d\
-\x34\x2e\x34\x39\x38\x63\x2d\x30\x2e\x34\x31\x33\x2d\x30\x2e\x33\
-\x36\x37\x2d\x31\x2e\x30\x34\x35\x2d\x30\x2e\x33\x33\x2d\x31\x2e\
-\x34\x31\x31\x2c\x30\x2e\x30\x38\x33\x0a\x09\x63\x2d\x30\x2e\x33\
-\x36\x37\x2c\x30\x2e\x34\x31\x33\x2d\x30\x2e\x33\x33\x2c\x31\x2e\
-\x30\x34\x35\x2c\x30\x2e\x30\x38\x33\x2c\x31\x2e\x34\x31\x32\x4c\
-\x31\x36\x2e\x39\x39\x35\x2c\x31\x30\x6c\x2d\x33\x2e\x36\x35\x39\
-\x2c\x33\x2e\x32\x35\x32\x63\x2d\x30\x2e\x34\x31\x33\x2c\x30\x2e\
-\x33\x36\x37\x2d\x30\x2e\x34\x35\x2c\x30\x2e\x39\x39\x39\x2d\x30\
-\x2e\x30\x38\x33\x2c\x31\x2e\x34\x31\x32\x43\x31\x33\x2e\x34\x35\
-\x2c\x31\x34\x2e\x38\x38\x37\x2c\x31\x33\x2e\x37\x32\x35\x2c\x31\
-\x35\x2c\x31\x34\x2c\x31\x35\x0a\x09\x43\x31\x34\x2e\x32\x33\x36\
-\x2c\x31\x35\x2c\x31\x34\x2e\x34\x37\x34\x2c\x31\x34\x2e\x39\x31\
-\x37\x2c\x31\x34\x2e\x36\x36\x34\x2c\x31\x34\x2e\x37\x34\x38\x7a\
-\x20\x4d\x39\x2e\x39\x38\x36\x2c\x31\x36\x2e\x31\x36\x35\x6c\x32\
-\x2d\x31\x32\x63\x30\x2e\x30\x39\x31\x2d\x30\x2e\x35\x34\x35\x2d\
-\x30\x2e\x32\x37\x37\x2d\x31\x2e\x30\x36\x2d\x30\x2e\x38\x32\x32\
-\x2d\x31\x2e\x31\x35\x31\x0a\x09\x63\x2d\x30\x2e\x35\x34\x37\x2d\
-\x30\x2e\x30\x39\x32\x2d\x31\x2e\x30\x36\x31\x2c\x30\x2e\x32\x37\
-\x37\x2d\x31\x2e\x31\x35\x2c\x30\x2e\x38\x32\x32\x6c\x2d\x32\x2c\
-\x31\x32\x63\x2d\x30\x2e\x30\x39\x31\x2c\x30\x2e\x35\x34\x35\x2c\
-\x30\x2e\x32\x37\x37\x2c\x31\x2e\x30\x36\x2c\x30\x2e\x38\x32\x32\
-\x2c\x31\x2e\x31\x35\x31\x43\x38\x2e\x38\x39\x32\x2c\x31\x36\x2e\
-\x39\x39\x36\x2c\x38\x2e\x39\x34\x36\x2c\x31\x37\x2c\x39\x2e\x30\
-\x30\x31\x2c\x31\x37\x0a\x09\x43\x39\x2e\x34\x38\x31\x2c\x31\x37\
-\x2c\x39\x2e\x39\x30\x35\x2c\x31\x36\x2e\x36\x35\x33\x2c\x39\x2e\
-\x39\x38\x36\x2c\x31\x36\x2e\x31\x36\x35\x7a\x22\x2f\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\xc1\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x73\x74\x79\x6c\x65\
-\x3d\x22\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\
-\x75\x6e\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x3b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\
-\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x70\x6f\x6c\
-\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x34\x38\x30\
-\x2c\x32\x35\x36\x20\x33\x38\x34\x2c\x31\x36\x30\x20\x33\x38\x34\
-\x2c\x32\x33\x36\x20\x32\x37\x36\x2c\x32\x33\x36\x20\x32\x37\x36\
-\x2c\x31\x32\x38\x20\x33\x35\x32\x2c\x31\x32\x38\x20\x32\x35\x36\
-\x2c\x33\x32\x20\x31\x36\x30\x2c\x31\x32\x38\x20\x32\x33\x36\x2c\
-\x31\x32\x38\x20\x32\x33\x36\x2c\x32\x33\x36\x20\x31\x32\x38\x2c\
-\x32\x33\x36\x20\x31\x32\x38\x2c\x31\x36\x30\x20\x33\x32\x2c\x32\
-\x35\x36\x20\x31\x32\x38\x2c\x33\x35\x32\x20\x0a\x09\x31\x32\x38\
-\x2c\x32\x37\x36\x20\x32\x33\x36\x2c\x32\x37\x36\x20\x32\x33\x36\
-\x2c\x33\x38\x34\x20\x31\x36\x30\x2c\x33\x38\x34\x20\x32\x35\x36\
-\x2c\x34\x38\x30\x20\x33\x35\x32\x2c\x33\x38\x34\x20\x32\x37\x35\
-\x2e\x38\x2c\x33\x38\x34\x20\x32\x37\x35\x2e\x34\x2c\x32\x37\x35\
-\x2e\x35\x20\x33\x38\x34\x2c\x32\x37\x35\x2e\x38\x20\x33\x38\x34\
-\x2c\x33\x35\x32\x20\x22\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\
-\x00\x00\x04\xca\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x39\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x0a\x09\x20\x69\x64\x3d\
-\x22\x73\x76\x67\x34\x36\x31\x39\x22\x20\x69\x6e\x6b\x73\x63\x61\
-\x70\x65\x3a\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x30\x2e\x39\x31\
-\x2b\x64\x65\x76\x65\x6c\x2b\x6f\x73\x78\x6d\x65\x6e\x75\x20\x72\
-\x31\x32\x39\x31\x31\x22\x20\x73\x6f\x64\x69\x70\x6f\x64\x69\x3a\
-\x64\x6f\x63\x6e\x61\x6d\x65\x3d\x22\x74\x72\x69\x61\x6e\x67\x6c\
-\x65\x2d\x73\x74\x72\x6f\x6b\x65\x64\x2d\x31\x35\x2e\x73\x76\x67\
-\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x63\x63\x3d\x22\x68\x74\x74\x70\
-\x3a\x2f\x2f\x63\x72\x65\x61\x74\x69\x76\x65\x63\x6f\x6d\x6d\x6f\
-\x6e\x73\x2e\x6f\x72\x67\x2f\x6e\x73\x23\x22\x20\x78\x6d\x6c\x6e\
-\x73\x3a\x64\x63\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x70\x75\x72\
-\x6c\x2e\x6f\x72\x67\x2f\x64\x63\x2f\x65\x6c\x65\x6d\x65\x6e\x74\
-\x73\x2f\x31\x2e\x31\x2f\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x69\x6e\
-\x6b\x73\x63\x61\x70\x65\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x69\x6e\x6b\x73\x63\x61\x70\x65\x2e\x6f\x72\x67\x2f\
-\x6e\x61\x6d\x65\x73\x70\x61\x63\x65\x73\x2f\x69\x6e\x6b\x73\x63\
-\x61\x70\x65\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x72\x64\x66\x3d\x22\
-\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\
-\x67\x2f\x31\x39\x39\x39\x2f\x30\x32\x2f\x32\x32\x2d\x72\x64\x66\
-\x2d\x73\x79\x6e\x74\x61\x78\x2d\x6e\x73\x23\x22\x20\x78\x6d\x6c\
-\x6e\x73\x3a\x73\x6f\x64\x69\x70\x6f\x64\x69\x3d\x22\x68\x74\x74\
-\x70\x3a\x2f\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2e\x73\x6f\x75\
-\x72\x63\x65\x66\x6f\x72\x67\x65\x2e\x6e\x65\x74\x2f\x44\x54\x44\
-\x2f\x73\x6f\x64\x69\x70\x6f\x64\x69\x2d\x30\x2e\x64\x74\x64\x22\
-\x20\x78\x6d\x6c\x6e\x73\x3a\x73\x76\x67\x3d\x22\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\
-\x30\x30\x2f\x73\x76\x67\x22\x0a\x09\x20\x78\x6d\x6c\x6e\x73\x3d\
-\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
-\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\
-\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\
-\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\
-\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\
-\x79\x3d\x22\x30\x70\x78\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x36\
-\x34\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x36\x34\x70\
-\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x31\x35\x20\x31\x35\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\
-\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\
-\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x31\x35\x20\x31\x35\x3b\
-\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\
-\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x70\x61\x74\x68\x20\x69\x64\
-\x3d\x22\x72\x65\x63\x74\x33\x33\x33\x38\x22\x20\x69\x6e\x6b\x73\
-\x63\x61\x70\x65\x3a\x63\x6f\x6e\x6e\x65\x63\x74\x6f\x72\x2d\x63\
-\x75\x72\x76\x61\x74\x75\x72\x65\x3d\x22\x30\x22\x20\x73\x6f\x64\
-\x69\x70\x6f\x64\x69\x3a\x6e\x6f\x64\x65\x74\x79\x70\x65\x73\x3d\
-\x22\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x63\x22\x20\x64\
-\x3d\x22\x4d\x37\x2e\x35\x32\x34\x33\x2c\x31\x2e\x35\x30\x30\x34\
-\x0a\x09\x43\x37\x2e\x32\x34\x32\x39\x2c\x31\x2e\x34\x39\x31\x33\
-\x2c\x36\x2e\x39\x37\x38\x37\x2c\x31\x2e\x36\x34\x32\x33\x2c\x36\
-\x2e\x38\x33\x33\x36\x2c\x31\x2e\x38\x39\x35\x32\x6c\x2d\x35\x2e\
-\x35\x2c\x39\x2e\x38\x36\x39\x32\x43\x31\x2e\x30\x32\x31\x38\x2c\
-\x31\x32\x2e\x33\x30\x37\x38\x2c\x31\x2e\x33\x39\x35\x2c\x31\x32\
-\x2e\x39\x39\x39\x39\x2c\x32\x2c\x31\x33\x68\x31\x31\x0a\x09\x63\
-\x30\x2e\x36\x30\x35\x2d\x30\x2e\x30\x30\x30\x31\x2c\x30\x2e\x39\
-\x37\x38\x32\x2d\x30\x2e\x36\x39\x32\x32\x2c\x30\x2e\x36\x36\x36\
-\x34\x2d\x31\x2e\x32\x33\x35\x35\x6c\x2d\x35\x2e\x35\x2d\x39\x2e\
-\x38\x36\x39\x32\x43\x38\x2e\x30\x33\x30\x32\x2c\x31\x2e\x36\x35\
-\x37\x39\x2c\x37\x2e\x37\x38\x38\x34\x2c\x31\x2e\x35\x30\x39\x32\
-\x2c\x37\x2e\x35\x32\x34\x33\x2c\x31\x2e\x35\x30\x30\x34\x7a\x20\
-\x4d\x37\x2e\x35\x2c\x33\x2e\x38\x39\x39\x33\x6c\x34\x2e\x31\x32\
-\x36\x37\x2c\x37\x2e\x34\x37\x30\x34\x0a\x09\x48\x33\x2e\x33\x37\
-\x33\x33\x4c\x37\x2e\x35\x2c\x33\x2e\x38\x39\x39\x33\x7a\x22\x2f\
-\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x05\xbb\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\
-\x35\x30\x2e\x36\x37\x39\x2c\x32\x37\x33\x2e\x35\x63\x2d\x31\x34\
-\x2e\x35\x38\x35\x2d\x31\x34\x2e\x35\x37\x37\x2d\x33\x36\x2e\x30\
-\x35\x34\x2d\x31\x35\x2e\x38\x39\x2d\x35\x30\x2e\x36\x33\x39\x2d\
-\x31\x2e\x33\x31\x32\x6c\x2d\x34\x31\x2e\x36\x38\x37\x2c\x34\x31\
-\x2e\x36\x36\x34\x63\x2d\x31\x30\x2e\x38\x35\x32\x2c\x31\x30\x2e\
-\x38\x33\x36\x2d\x32\x33\x2e\x39\x33\x2c\x31\x30\x2e\x38\x35\x39\
-\x2d\x33\x31\x2e\x35\x36\x34\x2c\x31\x2e\x38\x35\x32\x0a\x09\x63\
-\x2d\x35\x2e\x30\x35\x37\x2d\x35\x2e\x39\x36\x38\x2d\x33\x2e\x30\
-\x36\x31\x2d\x32\x34\x2e\x33\x37\x34\x2d\x31\x2e\x36\x34\x34\x2d\
-\x33\x36\x2e\x30\x34\x39\x6c\x32\x30\x2e\x39\x30\x37\x2d\x31\x37\
-\x31\x2e\x38\x34\x39\x63\x31\x2e\x38\x36\x37\x2d\x31\x35\x2e\x33\
-\x35\x33\x2d\x39\x2e\x30\x37\x2d\x33\x30\x2e\x31\x38\x35\x2d\x32\
-\x34\x2e\x34\x33\x2d\x33\x32\x2e\x30\x35\x31\x0a\x09\x63\x2d\x31\
-\x35\x2e\x33\x35\x38\x2d\x31\x2e\x38\x36\x37\x2d\x32\x39\x2e\x33\
-\x32\x32\x2c\x39\x2e\x39\x33\x39\x2d\x33\x31\x2e\x31\x39\x31\x2c\
-\x32\x35\x2e\x32\x38\x39\x4c\x32\x36\x37\x2e\x33\x37\x2c\x32\x33\
-\x36\x2e\x30\x32\x31\x63\x2d\x31\x2e\x32\x30\x35\x2c\x33\x2e\x33\
-\x35\x38\x2d\x33\x2e\x37\x39\x2c\x33\x2e\x39\x33\x38\x2d\x34\x2e\
-\x30\x38\x31\x2d\x30\x2e\x35\x38\x32\x4c\x32\x35\x35\x2e\x34\x34\
-\x2c\x36\x30\x0a\x09\x63\x30\x2d\x31\x35\x2e\x34\x36\x35\x2d\x31\
-\x32\x2e\x35\x34\x32\x2d\x32\x38\x2d\x32\x38\x2e\x30\x31\x34\x2d\
-\x32\x38\x63\x2d\x31\x35\x2e\x34\x37\x33\x2c\x30\x2d\x32\x38\x2e\
-\x30\x31\x35\x2c\x31\x32\x2e\x35\x33\x35\x2d\x32\x38\x2e\x30\x31\
-\x35\x2c\x32\x38\x6c\x2d\x30\x2e\x35\x35\x32\x2c\x31\x37\x36\x2e\
-\x37\x35\x32\x63\x30\x2e\x31\x34\x36\x2c\x32\x2e\x30\x34\x2d\x31\
-\x2e\x36\x30\x34\x2c\x32\x2e\x36\x32\x34\x2d\x31\x2e\x39\x32\x2c\
-\x30\x2e\x32\x39\x34\x4c\x31\x37\x32\x2e\x30\x31\x36\x2c\x39\x39\
-\x2e\x30\x37\x37\x0a\x09\x63\x2d\x32\x2e\x37\x35\x2d\x31\x35\x2e\
-\x32\x31\x39\x2d\x31\x37\x2e\x33\x32\x33\x2d\x32\x36\x2e\x32\x30\
-\x33\x2d\x33\x32\x2e\x35\x34\x38\x2d\x32\x33\x2e\x34\x35\x33\x63\
-\x2d\x31\x35\x2e\x32\x32\x37\x2c\x32\x2e\x37\x34\x38\x2d\x32\x35\
-\x2e\x33\x33\x39\x2c\x31\x38\x2e\x31\x38\x37\x2d\x32\x32\x2e\x35\
-\x39\x31\x2c\x33\x33\x2e\x34\x30\x33\x6c\x32\x32\x2e\x31\x39\x33\
-\x2c\x31\x36\x31\x2e\x34\x35\x35\x0a\x09\x63\x30\x2e\x30\x32\x33\
-\x2c\x32\x2e\x38\x37\x32\x2d\x30\x2e\x39\x34\x31\x2c\x34\x2e\x35\
-\x31\x33\x2d\x32\x2e\x33\x30\x38\x2c\x30\x2e\x38\x33\x31\x6c\x2d\
-\x33\x33\x2e\x31\x30\x39\x2d\x38\x38\x2e\x35\x31\x37\x63\x2d\x35\
-\x2e\x31\x38\x2d\x31\x34\x2e\x35\x37\x32\x2d\x32\x31\x2e\x31\x39\
-\x36\x2d\x32\x33\x2e\x30\x36\x35\x2d\x33\x35\x2e\x37\x37\x36\x2d\
-\x31\x37\x2e\x38\x38\x39\x0a\x09\x63\x2d\x31\x34\x2e\x35\x37\x39\
-\x2c\x35\x2e\x31\x37\x37\x2d\x32\x32\x2e\x32\x30\x31\x2c\x32\x32\
-\x2e\x30\x36\x31\x2d\x31\x37\x2e\x30\x32\x33\x2c\x33\x36\x2e\x36\
-\x33\x31\x6c\x35\x38\x2e\x30\x34\x32\x2c\x31\x38\x39\x2e\x36\x32\
-\x35\x63\x30\x2e\x33\x30\x33\x2c\x31\x2e\x30\x34\x36\x2c\x30\x2e\
-\x36\x32\x34\x2c\x32\x2e\x30\x38\x35\x2c\x30\x2e\x39\x35\x33\x2c\
-\x33\x2e\x31\x31\x38\x6c\x30\x2e\x31\x32\x31\x2c\x30\x2e\x33\x39\
-\x0a\x09\x63\x30\x2e\x30\x31\x31\x2c\x30\x2e\x30\x33\x31\x2c\x30\
-\x2e\x30\x32\x35\x2c\x30\x2e\x30\x35\x38\x2c\x30\x2e\x30\x33\x35\
-\x2c\x30\x2e\x30\x38\x38\x43\x31\x32\x36\x2e\x30\x37\x39\x2c\x34\
-\x34\x34\x2e\x32\x33\x33\x2c\x31\x37\x32\x2e\x35\x37\x2c\x34\x38\
-\x30\x2c\x32\x32\x37\x2e\x34\x32\x37\x2c\x34\x38\x30\x63\x33\x35\
-\x2e\x31\x31\x36\x2c\x30\x2c\x37\x31\x2e\x35\x39\x31\x2d\x31\x32\
-\x2e\x33\x37\x38\x2c\x39\x39\x2e\x33\x35\x37\x2d\x33\x33\x2e\x36\
-\x37\x32\x0a\x09\x63\x30\x2e\x30\x30\x31\x2c\x30\x2c\x30\x2e\x30\
-\x30\x33\x2d\x30\x2e\x30\x30\x32\x2c\x30\x2e\x30\x30\x33\x2d\x30\
-\x2e\x30\x30\x32\x63\x32\x39\x2e\x39\x39\x2d\x31\x38\x2e\x30\x35\
-\x31\x2c\x31\x32\x36\x2e\x30\x37\x31\x2d\x31\x32\x31\x2e\x33\x34\
-\x37\x2c\x31\x32\x36\x2e\x30\x37\x31\x2d\x31\x32\x31\x2e\x33\x34\
-\x37\x43\x34\x36\x37\x2e\x34\x34\x35\x2c\x33\x31\x30\x2e\x34\x30\
-\x32\x2c\x34\x36\x35\x2e\x32\x36\x36\x2c\x32\x38\x38\x2e\x30\x38\
-\x2c\x34\x35\x30\x2e\x36\x37\x39\x2c\x32\x37\x33\x2e\x35\x7a\x22\
-\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\xd9\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x43\
-\x68\x65\x76\x72\x6f\x6e\x5f\x63\x69\x72\x63\x6c\x65\x64\x5f\x72\
-\x69\x67\x68\x74\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\
-\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\
-\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\
-\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
-\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\
-\x6e\x6b\x22\x0a\x09\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\
-\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\
-\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\
-\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\
-\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\
-\x72\x76\x65\x22\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\
-\x72\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\x32\x34\x20\x30\x20\
-\x30\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\x0a\x3c\x70\x61\x74\
-\x68\x20\x64\x3d\x22\x4d\x31\x31\x2c\x31\x30\x4c\x38\x2e\x36\x39\
-\x38\x2c\x37\x2e\x34\x39\x34\x63\x2d\x30\x2e\x31\x39\x36\x2d\x30\
-\x2e\x31\x39\x38\x2d\x30\x2e\x31\x39\x36\x2d\x30\x2e\x35\x31\x39\
-\x2c\x30\x2d\x30\x2e\x37\x31\x38\x63\x30\x2e\x31\x39\x36\x2d\x30\
-\x2e\x31\x39\x37\x2c\x30\x2e\x35\x31\x35\x2d\x30\x2e\x31\x39\x37\
-\x2c\x30\x2e\x37\x31\x2c\x30\x6c\x32\x2e\x38\x30\x37\x2c\x32\x2e\
-\x38\x36\x34\x0a\x09\x63\x30\x2e\x31\x39\x36\x2c\x30\x2e\x31\x39\
-\x39\x2c\x30\x2e\x31\x39\x36\x2c\x30\x2e\x35\x32\x2c\x30\x2c\x30\
-\x2e\x37\x31\x37\x6c\x2d\x32\x2e\x38\x30\x37\x2c\x32\x2e\x38\x36\
-\x34\x63\x2d\x30\x2e\x31\x39\x35\x2c\x30\x2e\x31\x39\x39\x2d\x30\
-\x2e\x35\x31\x34\x2c\x30\x2e\x31\x39\x38\x2d\x30\x2e\x37\x31\x2c\
-\x30\x63\x2d\x30\x2e\x31\x39\x36\x2d\x30\x2e\x31\x39\x37\x2d\x30\
-\x2e\x31\x39\x36\x2d\x30\x2e\x35\x31\x38\x2c\x30\x2d\x30\x2e\x37\
-\x31\x37\x4c\x31\x31\x2c\x31\x30\x7a\x20\x4d\x31\x30\x2c\x30\x2e\
-\x34\x0a\x09\x63\x35\x2e\x33\x30\x32\x2c\x30\x2c\x39\x2e\x36\x2c\
-\x34\x2e\x32\x39\x38\x2c\x39\x2e\x36\x2c\x39\x2e\x36\x63\x30\x2c\
-\x35\x2e\x33\x30\x33\x2d\x34\x2e\x32\x39\x38\x2c\x39\x2e\x36\x2d\
-\x39\x2e\x36\x2c\x39\x2e\x36\x53\x30\x2e\x34\x2c\x31\x35\x2e\x33\
-\x30\x33\x2c\x30\x2e\x34\x2c\x31\x30\x43\x30\x2e\x34\x2c\x34\x2e\
-\x36\x39\x38\x2c\x34\x2e\x36\x39\x38\x2c\x30\x2e\x34\x2c\x31\x30\
-\x2c\x30\x2e\x34\x7a\x20\x4d\x31\x30\x2c\x31\x38\x2e\x33\x35\x34\
-\x0a\x09\x63\x34\x2e\x36\x31\x33\x2c\x30\x2c\x38\x2e\x33\x35\x34\
-\x2d\x33\x2e\x37\x34\x2c\x38\x2e\x33\x35\x34\x2d\x38\x2e\x33\x35\
-\x34\x63\x30\x2d\x34\x2e\x36\x31\x34\x2d\x33\x2e\x37\x34\x31\x2d\
-\x38\x2e\x33\x35\x34\x2d\x38\x2e\x33\x35\x34\x2d\x38\x2e\x33\x35\
-\x34\x63\x2d\x34\x2e\x36\x31\x35\x2c\x30\x2d\x38\x2e\x33\x35\x34\
-\x2c\x33\x2e\x37\x34\x2d\x38\x2e\x33\x35\x34\x2c\x38\x2e\x33\x35\
-\x34\x0a\x09\x43\x31\x2e\x36\x34\x35\x2c\x31\x34\x2e\x36\x31\x34\
-\x2c\x35\x2e\x33\x38\x35\x2c\x31\x38\x2e\x33\x35\x34\x2c\x31\x30\
-\x2c\x31\x38\x2e\x33\x35\x34\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\
-\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x04\x13\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x34\x2e\x30\x30\x30\x31\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x34\x2e\x30\x30\x30\x31\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\x32\x4c\
-\x20\x31\x33\x2e\x39\x36\x38\x37\x20\x31\x32\x2e\x39\x33\x36\x31\
-\x4c\x20\x35\x38\x2e\x32\x31\x37\x35\x20\x32\x31\x2e\x37\x33\x37\
-\x38\x4c\x20\x34\x32\x2e\x37\x34\x34\x35\x20\x34\x31\x2e\x37\x31\
-\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\
-\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
-\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
-\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x32\x2e\x35\x30\x39\x33\
-\x37\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\
-\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\
-\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\x35\
-\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\
-\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\x36\
-\x2e\x30\x32\x32\x35\x27\x20\x63\x79\x3d\x27\x33\x32\x2e\x31\x32\
-\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\
-\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\
-\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\
-\x36\x39\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\
-\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\
-\x63\x6c\x65\x20\x63\x78\x3d\x27\x31\x33\x2e\x39\x36\x38\x37\x27\
-\x20\x63\x79\x3d\x27\x31\x32\x2e\x39\x33\x36\x31\x27\x20\x66\x69\
-\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\
-\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\
-\x63\x78\x3d\x27\x35\x38\x2e\x32\x31\x37\x35\x27\x20\x63\x79\x3d\
-\x27\x32\x31\x2e\x37\x33\x37\x38\x27\x20\x66\x69\x6c\x6c\x3d\x27\
-\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\
-\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\
-\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\
-\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\
-\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\
-\x34\x32\x2e\x37\x34\x34\x35\x27\x20\x63\x79\x3d\x27\x34\x31\x2e\
-\x37\x31\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\
-\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\
-\x67\x3e\
-\x00\x00\x03\x48\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\
-\x33\x37\x2e\x33\x33\x34\x2c\x31\x34\x34\x48\x32\x35\x36\x2e\x30\
-\x30\x36\x6c\x2d\x34\x32\x2e\x36\x36\x38\x2d\x34\x38\x48\x37\x34\
-\x2e\x36\x36\x36\x43\x35\x31\x2e\x31\x39\x37\x2c\x39\x36\x2c\x33\
-\x32\x2c\x31\x31\x35\x2e\x31\x39\x38\x2c\x33\x32\x2c\x31\x33\x38\
-\x2e\x36\x36\x37\x76\x32\x33\x34\x2e\x36\x36\x36\x43\x33\x32\x2c\
-\x33\x39\x36\x2e\x38\x30\x32\x2c\x35\x31\x2e\x31\x39\x37\x2c\x34\
-\x31\x36\x2c\x37\x34\x2e\x36\x36\x36\x2c\x34\x31\x36\x68\x33\x36\
-\x32\x2e\x36\x36\x38\x0a\x09\x43\x34\x36\x30\x2e\x38\x30\x33\x2c\
-\x34\x31\x36\x2c\x34\x38\x30\x2c\x33\x39\x36\x2e\x38\x30\x32\x2c\
-\x34\x38\x30\x2c\x33\x37\x33\x2e\x33\x33\x33\x56\x31\x38\x36\x2e\
-\x36\x36\x37\x43\x34\x38\x30\x2c\x31\x36\x33\x2e\x31\x39\x38\x2c\
-\x34\x36\x30\x2e\x38\x30\x33\x2c\x31\x34\x34\x2c\x34\x33\x37\x2e\
-\x33\x33\x34\x2c\x31\x34\x34\x7a\x20\x4d\x34\x34\x38\x2c\x33\x37\
-\x33\x2e\x33\x33\x33\x0a\x09\x63\x30\x2c\x35\x2e\x37\x38\x32\x2d\
-\x34\x2e\x38\x38\x35\x2c\x31\x30\x2e\x36\x36\x37\x2d\x31\x30\x2e\
-\x36\x36\x36\x2c\x31\x30\x2e\x36\x36\x37\x48\x37\x34\x2e\x36\x36\
-\x36\x43\x36\x38\x2e\x38\x38\x34\x2c\x33\x38\x34\x2c\x36\x34\x2c\
-\x33\x37\x39\x2e\x31\x31\x35\x2c\x36\x34\x2c\x33\x37\x33\x2e\x33\
-\x33\x33\x56\x31\x37\x36\x68\x33\x37\x33\x2e\x33\x33\x34\x63\x35\
-\x2e\x37\x38\x31\x2c\x30\x2c\x31\x30\x2e\x36\x36\x36\x2c\x34\x2e\
-\x38\x38\x35\x2c\x31\x30\x2e\x36\x36\x36\x2c\x31\x30\x2e\x36\x36\
-\x37\x0a\x09\x56\x33\x37\x33\x2e\x33\x33\x33\x7a\x22\x2f\x3e\x0a\
-\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\x98\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x31\x32\x38\x2c\x34\x30\x35\x2e\x34\x32\x39\x43\
-\x31\x32\x38\x2c\x34\x32\x38\x2e\x38\x34\x36\x2c\x31\x34\x37\x2e\
-\x31\x39\x38\x2c\x34\x34\x38\x2c\x31\x37\x30\x2e\x36\x36\x37\x2c\
-\x34\x34\x38\x68\x31\x37\x30\x2e\x36\x36\x37\x43\x33\x36\x34\x2e\
-\x38\x30\x32\x2c\x34\x34\x38\x2c\x33\x38\x34\x2c\x34\x32\x38\x2e\
-\x38\x34\x36\x2c\x33\x38\x34\x2c\x34\x30\x35\x2e\x34\x32\x39\x56\
-\x31\x36\x30\x48\x31\x32\x38\x56\x34\x30\x35\x2e\x34\x32\x39\x7a\
-\x20\x4d\x34\x31\x36\x2c\x39\x36\x0a\x09\x09\x68\x2d\x38\x30\x6c\
-\x2d\x32\x36\x2e\x37\x38\x35\x2d\x33\x32\x48\x32\x30\x32\x2e\x37\
-\x38\x36\x4c\x31\x37\x36\x2c\x39\x36\x48\x39\x36\x76\x33\x32\x68\
-\x33\x32\x30\x56\x39\x36\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\
-\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\x16\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x63\x69\x72\x63\x6c\
-\x65\x20\x63\x78\x3d\x22\x32\x35\x36\x22\x20\x63\x79\x3d\x22\x32\
-\x38\x30\x22\x20\x72\x3d\x22\x36\x33\x22\x2f\x3e\x0a\x09\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\x34\x30\x2c\x39\x36\x68\x2d\
-\x38\x38\x6c\x2d\x33\x32\x2d\x33\x32\x48\x31\x39\x32\x6c\x2d\x33\
-\x32\x2c\x33\x32\x48\x37\x32\x63\x2d\x32\x32\x2e\x30\x39\x32\x2c\
-\x30\x2d\x34\x30\x2c\x31\x37\x2e\x39\x30\x38\x2d\x34\x30\x2c\x34\
-\x30\x76\x32\x37\x32\x63\x30\x2c\x32\x32\x2e\x30\x39\x32\x2c\x31\
-\x37\x2e\x39\x30\x38\x2c\x34\x30\x2c\x34\x30\x2c\x34\x30\x68\x33\
-\x36\x38\x63\x32\x32\x2e\x30\x39\x32\x2c\x30\x2c\x34\x30\x2d\x31\
-\x37\x2e\x39\x30\x38\x2c\x34\x30\x2d\x34\x30\x0a\x09\x09\x56\x31\
-\x33\x36\x43\x34\x38\x30\x2c\x31\x31\x33\x2e\x39\x30\x38\x2c\x34\
-\x36\x32\x2e\x30\x39\x32\x2c\x39\x36\x2c\x34\x34\x30\x2c\x39\x36\
-\x7a\x20\x4d\x32\x35\x36\x2c\x33\x39\x32\x63\x2d\x36\x31\x2e\x38\
-\x35\x35\x2c\x30\x2d\x31\x31\x32\x2d\x35\x30\x2e\x31\x34\x35\x2d\
-\x31\x31\x32\x2d\x31\x31\x32\x73\x35\x30\x2e\x31\x34\x35\x2d\x31\
-\x31\x32\x2c\x31\x31\x32\x2d\x31\x31\x32\x73\x31\x31\x32\x2c\x35\
-\x30\x2e\x31\x34\x35\x2c\x31\x31\x32\x2c\x31\x31\x32\x0a\x09\x09\
-\x53\x33\x31\x37\x2e\x38\x35\x35\x2c\x33\x39\x32\x2c\x32\x35\x36\
-\x2c\x33\x39\x32\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\
-\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\xfe\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x33\x2e\x39\x39\x39\x36\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x33\x2e\x39\x39\x39\x36\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x36\x2e\x34\x30\x39\x34\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x32\x2e\x30\x30\x37\x35\x20\x36\x32\x2e\x32\x33\x32\
-\x35\x4c\x20\x36\x32\x2e\x32\x33\x32\x35\x20\x36\x32\x2e\x32\x33\
-\x32\x35\x4c\x20\x36\x32\x2e\x32\x33\x32\x35\x20\x32\x2e\x30\x30\
-\x37\x35\x4c\x20\x32\x2e\x30\x30\x37\x35\x20\x32\x2e\x30\x30\x37\
-\x35\x4c\x20\x32\x2e\x30\x30\x37\x35\x20\x36\x32\x2e\x32\x33\x32\
-\x35\x5a\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\
-\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
-\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
-\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x34\x2e\x30\x31\x35\x27\
-\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\
-\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\
-\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\x35\x38\x29\
-\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\
-\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x27\x4d\x20\x32\x2e\x30\x30\
-\x37\x35\x20\x33\x32\x2e\x31\x32\x4c\x20\x36\x32\x2e\x32\x33\x32\
-\x35\x20\x33\x32\x2e\x31\x32\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\
-\x6f\x6e\x65\x27\x20\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\
-\x30\x30\x30\x30\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\
-\x65\x63\x61\x70\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\
-\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\
-\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\
-\x72\x6c\x69\x6d\x69\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x34\
-\x2e\x30\x31\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\
-\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\
-\x6c\x61\x74\x65\x28\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\
-\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\
-\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x27\x4d\
-\x20\x33\x32\x2e\x31\x32\x20\x36\x32\x2e\x32\x33\x32\x35\x4c\x20\
-\x33\x32\x2e\x31\x32\x20\x32\x2e\x30\x30\x37\x35\x27\x20\x66\x69\
-\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\x73\x74\x72\x6f\x6b\x65\
-\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x27\x72\x6f\x75\x6e\x64\
-\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x6a\x6f\x69\
-\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\
-\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\x3d\x27\x31\x30\x2e\
-\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x77\x69\x64\
-\x74\x68\x3d\x27\x34\x2e\x30\x31\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x00\x00\x02\xf0\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x32\x30\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x35\x36\x2c\x34\x38\x43\x31\
-\x34\x31\x2e\x36\x30\x31\x2c\x34\x38\x2c\x34\x38\x2c\x31\x34\x31\
-\x2e\x36\x30\x31\x2c\x34\x38\x2c\x32\x35\x36\x73\x39\x33\x2e\x36\
-\x30\x31\x2c\x32\x30\x38\x2c\x32\x30\x38\x2c\x32\x30\x38\x73\x32\
-\x30\x38\x2d\x39\x33\x2e\x36\x30\x31\x2c\x32\x30\x38\x2d\x32\x30\
-\x38\x53\x33\x37\x30\x2e\x33\x39\x39\x2c\x34\x38\x2c\x32\x35\x36\
-\x2c\x34\x38\x7a\x20\x4d\x32\x35\x36\x2c\x34\x32\x32\x2e\x33\x39\
-\x39\x0a\x09\x09\x09\x63\x2d\x39\x31\x2e\x35\x31\x38\x2c\x30\x2d\
-\x31\x36\x36\x2e\x33\x39\x39\x2d\x37\x34\x2e\x38\x38\x32\x2d\x31\
-\x36\x36\x2e\x33\x39\x39\x2d\x31\x36\x36\x2e\x33\x39\x39\x53\x31\
-\x36\x34\x2e\x34\x38\x32\x2c\x38\x39\x2e\x36\x2c\x32\x35\x36\x2c\
-\x38\x39\x2e\x36\x53\x34\x32\x32\x2e\x34\x2c\x31\x36\x34\x2e\x34\
-\x38\x32\x2c\x34\x32\x32\x2e\x34\x2c\x32\x35\x36\x53\x33\x34\x37\
-\x2e\x35\x31\x38\x2c\x34\x32\x32\x2e\x33\x39\x39\x2c\x32\x35\x36\
-\x2c\x34\x32\x32\x2e\x33\x39\x39\x7a\x22\x2f\x3e\x0a\x09\x3c\x2f\
-\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\x97\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x53\
-\x61\x76\x65\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\
-\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\x6c\
-\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\x6e\
-\x6b\x22\x20\x78\x3d\x22\x35\x31\x32\x70\x78\x22\x20\x79\x3d\x22\
-\x35\x31\x32\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\x78\
-\x3d\x22\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\
-\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\
-\x3d\x22\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\
-\x32\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\
-\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\
-\x73\x66\x6f\x72\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\x32\x34\
-\x20\x30\x20\x30\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\x0a\x3c\
-\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x35\x2e\x31\x37\x33\x2c\
-\x32\x48\x34\x43\x32\x2e\x38\x39\x39\x2c\x32\x2c\x32\x2c\x32\x2e\
-\x39\x2c\x32\x2c\x34\x76\x31\x32\x63\x30\x2c\x31\x2e\x31\x2c\x30\
-\x2e\x38\x39\x39\x2c\x32\x2c\x32\x2c\x32\x68\x31\x32\x63\x31\x2e\
-\x31\x30\x31\x2c\x30\x2c\x32\x2d\x30\x2e\x39\x2c\x32\x2d\x32\x56\
-\x35\x2e\x31\x32\x37\x4c\x31\x35\x2e\x31\x37\x33\x2c\x32\x7a\x20\
-\x4d\x31\x34\x2c\x38\x63\x30\x2c\x30\x2e\x35\x34\x39\x2d\x30\x2e\
-\x34\x35\x2c\x31\x2d\x31\x2c\x31\x48\x37\x0a\x09\x43\x36\x2e\x34\
-\x35\x2c\x39\x2c\x36\x2c\x38\x2e\x35\x34\x39\x2c\x36\x2c\x38\x56\
-\x33\x68\x38\x56\x38\x7a\x20\x4d\x31\x33\x2c\x34\x68\x2d\x32\x76\
-\x34\x68\x32\x56\x34\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\x6c\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x31\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x67\x3e\
-\x0a\x09\x09\x09\x3c\x70\x6f\x6c\x79\x67\x6f\x6e\x20\x70\x6f\x69\
-\x6e\x74\x73\x3d\x22\x31\x38\x36\x2e\x33\x30\x31\x2c\x33\x33\x39\
-\x2e\x38\x39\x33\x20\x39\x36\x2c\x32\x34\x39\x2e\x34\x36\x31\x20\
-\x36\x34\x2c\x32\x37\x39\x2e\x39\x36\x38\x20\x31\x38\x36\x2e\x33\
-\x30\x31\x2c\x34\x30\x32\x20\x34\x34\x38\x2c\x31\x34\x30\x2e\x35\
-\x30\x36\x20\x34\x31\x36\x2c\x31\x31\x30\x20\x09\x09\x09\x22\x2f\
-\x3e\x0a\x09\x09\x3c\x2f\x67\x3e\x0a\x09\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x01\xdd\
-\x00\
-\x00\x06\xc4\x78\x9c\xcd\x51\x4d\x8f\x9b\x30\x14\x3c\xc3\xaf\x78\
-\xf5\xad\x12\xfe\x82\x85\x24\x14\xb2\x6a\x3e\x14\x45\xda\xb6\x91\
-\x36\x4d\xd5\x53\x45\xc0\x05\xb4\x2c\x20\x70\x80\xf4\xd7\x57\x76\
-\xd2\x6a\x2b\x6d\xae\x4b\x0f\xf6\x93\x67\xde\x9b\x37\xd6\x04\xf7\
-\xc3\x73\x01\x9d\x68\xda\xbc\x2a\x43\xc4\x09\x43\x20\xca\xb8\x4a\
-\xf2\x32\x0d\xd1\x49\xfe\xc4\x53\x74\x3f\x37\x83\x77\x18\xc3\x46\
-\x94\xa2\x89\x64\xd5\xf8\xf0\x31\xa9\x8e\x02\xb6\x45\x71\x6a\xa5\
-\x86\x80\x7b\xc4\x26\xdc\x82\xc7\xc3\x06\xd6\x43\x5d\x35\x12\x76\
-\xc5\x29\xc5\xdb\x12\x88\x06\x0f\x97\x1d\x3e\x78\x84\x31\x58\x9c\
-\xf2\x22\x01\xf6\x1e\x00\x63\x25\xbf\xfa\xb2\xdc\x7f\xdf\xad\xa1\
-\xed\x52\xd8\x7d\x5d\x3c\x6c\x97\x80\x30\xa5\xdf\x9c\x25\xa5\xab\
-\xfd\x4a\x2b\x70\xc2\x29\x5d\x7f\x46\x80\x32\x29\x6b\x9f\xd2\xbe\
-\xef\x49\xef\x90\xaa\x49\xe9\xa6\x89\xea\x2c\x8f\x5b\xfa\x78\xd8\
-\x50\xd5\xb8\xda\xaf\x68\xdb\xa5\x9c\x93\x44\x26\x68\x6e\x06\x4a\
-\xf9\xc5\x3f\x39\x82\x3c\x09\xd1\x43\x74\x16\xcd\x0f\x8e\x60\x78\
-\x2e\xca\x36\x7c\x45\xd9\x66\x8c\x29\xa5\x6b\x8b\x3f\x14\x79\xf9\
-\xf4\x5a\x23\x9f\xcd\x66\x54\xb3\x08\x86\x10\xb1\x7a\x40\x70\xbe\
-\x54\xd3\x80\x3e\x4f\x64\x16\x22\x97\xdb\x0a\xcf\x44\x9e\x66\xf2\
-\xef\xb3\xcb\x45\xbf\xa8\xd4\x10\x30\x70\xb9\xad\x0e\x82\x56\x9e\
-\x0b\x11\x22\x51\x46\xc7\x42\xe0\x63\x14\x3f\xa5\x4d\x75\x2a\x13\
-\xbf\x14\x3d\xbc\xe8\xfc\xa0\xad\xf9\x6d\x1d\xc5\x22\x44\x75\x23\
-\x5a\xd1\x74\x42\xfd\x39\x9d\x9b\x86\xbe\x8c\xa0\x8e\x64\x06\x49\
-\x88\x3e\x71\x8f\x59\xdc\x75\x88\x13\x33\xcb\x21\x13\xec\x58\x1e\
-\x99\x60\x8f\x4c\x54\xcd\xb0\xcb\x88\x1b\x63\x87\x4c\x2c\xa6\x40\
-\xec\xe0\x2b\xdd\x5d\x28\xa6\x39\xe7\xcf\x80\xaa\x99\x26\xf4\x88\
-\x82\x2c\xad\xa8\xce\x41\xef\xf9\x85\x4c\xc3\x30\xe8\xbf\x2e\xec\
-\xe9\xf4\x3f\x70\x71\xc7\xbd\xb1\x5c\x04\xf4\x56\x38\xf6\x94\xbf\
-\x89\x21\xbd\xe7\x66\x38\xe3\xbb\x50\xe1\x8c\xe4\xe2\x76\x38\x77\
-\x6c\xf6\x26\x86\xf4\x9e\x9b\xe1\x8c\xef\x42\x85\x33\x92\x0b\x1d\
-\xce\xf5\x6a\xbb\x74\x6e\xfe\x06\x44\x1a\x94\x79\
-\x00\x00\x03\x3d\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x73\x74\x79\x6c\x65\
-\x3d\x22\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\
-\x75\x6e\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x3b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\
-\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x70\x61\x74\
-\x68\x20\x64\x3d\x22\x4d\x34\x33\x37\x2e\x35\x2c\x33\x38\x36\x2e\
-\x36\x4c\x33\x30\x36\x2e\x39\x2c\x32\x35\x36\x6c\x31\x33\x30\x2e\
-\x36\x2d\x31\x33\x30\x2e\x36\x63\x31\x34\x2e\x31\x2d\x31\x34\x2e\
-\x31\x2c\x31\x34\x2e\x31\x2d\x33\x36\x2e\x38\x2c\x30\x2d\x35\x30\
-\x2e\x39\x63\x2d\x31\x34\x2e\x31\x2d\x31\x34\x2e\x31\x2d\x33\x36\
-\x2e\x38\x2d\x31\x34\x2e\x31\x2d\x35\x30\x2e\x39\x2c\x30\x4c\x32\
-\x35\x36\x2c\x32\x30\x35\x2e\x31\x4c\x31\x32\x35\x2e\x34\x2c\x37\
-\x34\x2e\x35\x0a\x09\x63\x2d\x31\x34\x2e\x31\x2d\x31\x34\x2e\x31\
-\x2d\x33\x36\x2e\x38\x2d\x31\x34\x2e\x31\x2d\x35\x30\x2e\x39\x2c\
-\x30\x63\x2d\x31\x34\x2e\x31\x2c\x31\x34\x2e\x31\x2d\x31\x34\x2e\
-\x31\x2c\x33\x36\x2e\x38\x2c\x30\x2c\x35\x30\x2e\x39\x4c\x32\x30\
-\x35\x2e\x31\x2c\x32\x35\x36\x4c\x37\x34\x2e\x35\x2c\x33\x38\x36\
-\x2e\x36\x63\x2d\x31\x34\x2e\x31\x2c\x31\x34\x2e\x31\x2d\x31\x34\
-\x2e\x31\x2c\x33\x36\x2e\x38\x2c\x30\x2c\x35\x30\x2e\x39\x0a\x09\
-\x63\x31\x34\x2e\x31\x2c\x31\x34\x2e\x31\x2c\x33\x36\x2e\x38\x2c\
-\x31\x34\x2e\x31\x2c\x35\x30\x2e\x39\x2c\x30\x4c\x32\x35\x36\x2c\
-\x33\x30\x36\x2e\x39\x6c\x31\x33\x30\x2e\x36\x2c\x31\x33\x30\x2e\
-\x36\x63\x31\x34\x2e\x31\x2c\x31\x34\x2e\x31\x2c\x33\x36\x2e\x38\
-\x2c\x31\x34\x2e\x31\x2c\x35\x30\x2e\x39\x2c\x30\x43\x34\x35\x31\
-\x2e\x35\x2c\x34\x32\x33\x2e\x34\x2c\x34\x35\x31\x2e\x35\x2c\x34\
-\x30\x30\x2e\x36\x2c\x34\x33\x37\x2e\x35\x2c\x33\x38\x36\x2e\x36\
-\x7a\x22\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\xe7\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x30\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x43\
-\x69\x72\x63\x6c\x65\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\
-\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\
-\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\
-\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\
-\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\
-\x69\x6e\x6b\x22\x20\x78\x3d\x22\x35\x31\x32\x70\x78\x22\x20\x79\
-\x3d\x22\x35\x31\x32\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\
-\x6f\x78\x3d\x22\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\
-\x20\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\
-\x6e\x64\x3d\x22\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\
-\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x67\x20\x74\x72\
-\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\
-\x32\x34\x20\x30\x20\x30\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\
-\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x31\x30\x2c\x30\x2e\
-\x34\x43\x34\x2e\x36\x39\x38\x2c\x30\x2e\x34\x2c\x30\x2e\x34\x2c\
-\x34\x2e\x36\x39\x38\x2c\x30\x2e\x34\x2c\x31\x30\x43\x30\x2e\x34\
-\x2c\x31\x35\x2e\x33\x30\x32\x2c\x34\x2e\x36\x39\x38\x2c\x31\x39\
-\x2e\x36\x2c\x31\x30\x2c\x31\x39\x2e\x36\x63\x35\x2e\x33\x30\x31\
-\x2c\x30\x2c\x39\x2e\x36\x2d\x34\x2e\x32\x39\x38\x2c\x39\x2e\x36\
-\x2d\x39\x2e\x36\x30\x31\x0a\x09\x43\x31\x39\x2e\x36\x2c\x34\x2e\
-\x36\x39\x38\x2c\x31\x35\x2e\x33\x30\x31\x2c\x30\x2e\x34\x2c\x31\
-\x30\x2c\x30\x2e\x34\x7a\x20\x4d\x31\x30\x2c\x31\x37\x2e\x35\x39\
-\x39\x63\x2d\x34\x2e\x31\x39\x37\x2c\x30\x2d\x37\x2e\x36\x2d\x33\
-\x2e\x34\x30\x32\x2d\x37\x2e\x36\x2d\x37\x2e\x36\x53\x35\x2e\x38\
-\x30\x32\x2c\x32\x2e\x34\x2c\x31\x30\x2c\x32\x2e\x34\x63\x34\x2e\
-\x31\x39\x37\x2c\x30\x2c\x37\x2e\x36\x30\x31\x2c\x33\x2e\x34\x30\
-\x32\x2c\x37\x2e\x36\x30\x31\x2c\x37\x2e\x36\x0a\x09\x53\x31\x34\
-\x2e\x31\x39\x37\x2c\x31\x37\x2e\x35\x39\x39\x2c\x31\x30\x2c\x31\
-\x37\x2e\x35\x39\x39\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x02\x72\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x38\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\x61\
-\x74\x68\x20\x64\x3d\x22\x4d\x38\x35\x2c\x32\x37\x37\x2e\x33\x37\
-\x35\x68\x32\x35\x39\x2e\x37\x30\x34\x4c\x32\x32\x35\x2e\x30\x30\
-\x32\x2c\x33\x39\x37\x2e\x30\x37\x37\x4c\x32\x35\x36\x2c\x34\x32\
-\x37\x6c\x31\x37\x31\x2d\x31\x37\x31\x4c\x32\x35\x36\x2c\x38\x35\
-\x6c\x2d\x32\x39\x2e\x39\x32\x32\x2c\x32\x39\x2e\x39\x32\x34\x6c\
-\x31\x31\x38\x2e\x36\x32\x36\x2c\x31\x31\x39\x2e\x37\x30\x31\x48\
-\x38\x35\x56\x32\x37\x37\x2e\x33\x37\x35\x7a\x22\x2f\x3e\x0a\x09\
-\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x0a\
-\x00\x00\x03\x5a\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x33\x2e\x39\x39\x39\x36\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x33\x2e\x39\x39\x39\x36\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x36\x2e\x34\x30\x39\x34\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x32\x2e\x30\x30\x37\x35\x20\x36\x32\x2e\x32\x33\x32\
-\x35\x4c\x20\x36\x32\x2e\x32\x33\x32\x35\x20\x36\x32\x2e\x32\x33\
-\x32\x35\x4c\x20\x36\x32\x2e\x32\x33\x32\x35\x20\x32\x2e\x30\x30\
-\x37\x35\x4c\x20\x32\x2e\x30\x30\x37\x35\x20\x32\x2e\x30\x30\x37\
-\x35\x4c\x20\x32\x2e\x30\x30\x37\x35\x20\x36\x32\x2e\x32\x33\x32\
-\x35\x5a\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\
-\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\
-\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\
-\x69\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\
-\x74\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\
-\x6b\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x34\x2e\x30\x31\x35\x27\
-\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\
-\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\
-\x35\x36\x2e\x34\x30\x39\x34\x20\x31\x31\x37\x2e\x38\x35\x38\x29\
-\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\
-\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x27\x4d\x20\x34\x37\x2e\x31\
-\x37\x36\x32\x20\x33\x32\x2e\x31\x32\x43\x20\x34\x37\x2e\x31\x37\
-\x36\x32\x20\x32\x33\x2e\x38\x30\x34\x37\x20\x34\x30\x2e\x34\x33\
-\x35\x33\x20\x31\x37\x2e\x30\x36\x33\x37\x20\x33\x32\x2e\x31\x32\
-\x20\x31\x37\x2e\x30\x36\x33\x37\x43\x20\x32\x33\x2e\x38\x30\x34\
-\x37\x20\x31\x37\x2e\x30\x36\x33\x37\x20\x31\x37\x2e\x30\x36\x33\
-\x37\x20\x32\x33\x2e\x38\x30\x34\x37\x20\x31\x37\x2e\x30\x36\x33\
-\x37\x20\x33\x32\x2e\x31\x32\x43\x20\x31\x37\x2e\x30\x36\x33\x37\
-\x20\x34\x30\x2e\x34\x33\x35\x33\x20\x32\x33\x2e\x38\x30\x34\x37\
-\x20\x34\x37\x2e\x31\x37\x36\x32\x20\x33\x32\x2e\x31\x32\x20\x34\
-\x37\x2e\x31\x37\x36\x32\x43\x20\x34\x30\x2e\x34\x33\x35\x33\x20\
-\x34\x37\x2e\x31\x37\x36\x32\x20\x34\x37\x2e\x31\x37\x36\x32\x20\
-\x34\x30\x2e\x34\x33\x35\x33\x20\x34\x37\x2e\x31\x37\x36\x32\x20\
-\x33\x32\x2e\x31\x32\x5a\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x30\
-\x30\x30\x30\x30\x30\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x00\x00\x03\x5f\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x0a\x09\x09\x3c\x72\x65\
-\x63\x74\x20\x78\x3d\x22\x31\x37\x38\x2e\x38\x34\x36\x22\x20\x79\
-\x3d\x22\x39\x32\x2e\x30\x38\x37\x22\x20\x74\x72\x61\x6e\x73\x66\
-\x6f\x72\x6d\x3d\x22\x6d\x61\x74\x72\x69\x78\x28\x2d\x30\x2e\x37\
-\x30\x37\x31\x20\x2d\x30\x2e\x37\x30\x37\x31\x20\x30\x2e\x37\x30\
-\x37\x31\x20\x2d\x30\x2e\x37\x30\x37\x31\x20\x32\x32\x34\x2e\x33\
-\x34\x37\x36\x20\x36\x33\x31\x2e\x31\x34\x39\x38\x29\x22\x20\x77\
-\x69\x64\x74\x68\x3d\x22\x31\x32\x38\x2e\x30\x38\x35\x22\x20\x68\
-\x65\x69\x67\x68\x74\x3d\x22\x33\x35\x34\x2e\x30\x34\x39\x22\x2f\
-\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\x37\x31\
-\x2e\x37\x32\x33\x2c\x38\x38\x2e\x33\x39\x33\x6c\x2d\x34\x38\x2e\
-\x31\x31\x35\x2d\x34\x38\x2e\x31\x31\x34\x63\x2d\x31\x31\x2e\x37\
-\x32\x33\x2d\x31\x31\x2e\x37\x32\x34\x2d\x33\x31\x2e\x35\x35\x38\
-\x2d\x31\x30\x2e\x38\x39\x36\x2d\x34\x34\x2e\x33\x30\x34\x2c\x31\
-\x2e\x38\x35\x6c\x2d\x34\x35\x2e\x32\x30\x32\x2c\x34\x35\x2e\x32\
-\x30\x33\x6c\x39\x30\x2e\x35\x36\x39\x2c\x39\x30\x2e\x35\x36\x38\
-\x6c\x34\x35\x2e\x32\x30\x32\x2d\x34\x35\x2e\x32\x30\x32\x0a\x09\
-\x09\x43\x34\x38\x32\x2e\x36\x31\x36\x2c\x31\x31\x39\x2e\x39\x35\
-\x32\x2c\x34\x38\x33\x2e\x34\x34\x35\x2c\x31\x30\x30\x2e\x31\x31\
-\x36\x2c\x34\x37\x31\x2e\x37\x32\x33\x2c\x38\x38\x2e\x33\x39\x33\
-\x7a\x22\x2f\x3e\x0a\x09\x3c\x70\x6f\x6c\x79\x67\x6f\x6e\x20\x70\
-\x6f\x69\x6e\x74\x73\x3d\x22\x36\x34\x2e\x30\x32\x31\x2c\x33\x36\
-\x33\x2e\x32\x35\x32\x20\x33\x32\x2c\x34\x38\x30\x20\x31\x34\x38\
-\x2e\x37\x33\x37\x2c\x34\x34\x37\x2e\x39\x37\x39\x20\x09\x22\x2f\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\x03\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x30\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x43\
-\x68\x65\x63\x6b\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\
-\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\
-\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\
-\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\
-\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\
-\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\x22\x30\
-\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\
-\x20\x30\x20\x32\x30\x20\x32\x30\x22\x20\x65\x6e\x61\x62\x6c\x65\
-\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\x77\
-\x20\x30\x20\x30\x20\x32\x30\x20\x32\x30\x22\x20\x78\x6d\x6c\x3a\
-\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\
-\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x38\x2e\x32\x39\
-\x34\x2c\x31\x36\x2e\x39\x39\x38\x63\x2d\x30\x2e\x34\x33\x35\x2c\
-\x30\x2d\x30\x2e\x38\x34\x37\x2d\x30\x2e\x32\x30\x33\x2d\x31\x2e\
-\x31\x31\x31\x2d\x30\x2e\x35\x35\x33\x4c\x33\x2e\x36\x31\x2c\x31\
-\x31\x2e\x37\x32\x34\x63\x2d\x30\x2e\x34\x36\x35\x2d\x30\x2e\x36\
-\x31\x33\x2d\x30\x2e\x33\x34\x34\x2d\x31\x2e\x34\x38\x36\x2c\x30\
-\x2e\x32\x37\x2d\x31\x2e\x39\x35\x31\x0a\x09\x63\x30\x2e\x36\x31\
-\x35\x2d\x30\x2e\x34\x36\x37\x2c\x31\x2e\x34\x38\x38\x2d\x30\x2e\
-\x33\x34\x34\x2c\x31\x2e\x39\x35\x33\x2c\x30\x2e\x32\x37\x6c\x32\
-\x2e\x33\x35\x31\x2c\x33\x2e\x31\x30\x34\x6c\x35\x2e\x39\x31\x31\
-\x2d\x39\x2e\x34\x39\x32\x63\x30\x2e\x34\x30\x37\x2d\x30\x2e\x36\
-\x35\x32\x2c\x31\x2e\x32\x36\x37\x2d\x30\x2e\x38\x35\x32\x2c\x31\
-\x2e\x39\x32\x31\x2d\x30\x2e\x34\x34\x35\x0a\x09\x63\x30\x2e\x36\
-\x35\x33\x2c\x30\x2e\x34\x30\x36\x2c\x30\x2e\x38\x35\x34\x2c\x31\
-\x2e\x32\x36\x36\x2c\x30\x2e\x34\x34\x36\x2c\x31\x2e\x39\x32\x4c\
-\x39\x2e\x34\x37\x38\x2c\x31\x36\x2e\x33\x34\x63\x2d\x30\x2e\x32\
-\x34\x32\x2c\x30\x2e\x33\x39\x31\x2d\x30\x2e\x36\x36\x31\x2c\x30\
-\x2e\x36\x33\x35\x2d\x31\x2e\x31\x32\x2c\x30\x2e\x36\x35\x36\x43\
-\x38\x2e\x33\x33\x36\x2c\x31\x36\x2e\x39\x39\x38\x2c\x38\x2e\x33\
-\x31\x36\x2c\x31\x36\x2e\x39\x39\x38\x2c\x38\x2e\x32\x39\x34\x2c\
-\x31\x36\x2e\x39\x39\x38\x7a\x22\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\
-\x3e\x0a\
-\x00\x00\x04\x42\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x69\x73\x6f\
-\x2d\x38\x38\x35\x39\x2d\x31\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\
-\x47\x65\x6e\x65\x72\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\
-\x20\x49\x6c\x6c\x75\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x39\x2e\
-\x30\x2e\x30\x2c\x20\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\
-\x50\x6c\x75\x67\x2d\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\
-\x72\x73\x69\x6f\x6e\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\
-\x64\x20\x30\x29\x20\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\
-\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\
-\x22\x4c\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\
-\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
-\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\
-\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\
-\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\
-\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\
-\x79\x3d\x22\x30\x70\x78\x22\x0a\x09\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x22\x30\x20\x30\x20\x34\x32\x33\x2e\x37\x35\x34\x20\x34\
-\x32\x33\x2e\x37\x35\x34\x22\x20\x73\x74\x79\x6c\x65\x3d\x22\x65\
-\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\
-\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x34\x32\x33\x2e\x37\x35\x34\
-\x20\x34\x32\x33\x2e\x37\x35\x34\x3b\x22\x20\x78\x6d\x6c\x3a\x73\
-\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\
-\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\x30\x37\x2e\x35\
-\x31\x36\x2c\x31\x32\x33\x2e\x32\x33\x39\x6c\x2d\x32\x37\x2e\x37\
-\x31\x37\x2c\x31\x31\x2e\x34\x38\x63\x31\x38\x2e\x35\x38\x35\x2c\
-\x34\x34\x2e\x38\x36\x39\x2c\x31\x38\x2e\x35\x38\x35\x2c\x39\x34\
-\x2e\x32\x39\x31\x2c\x30\x2c\x31\x33\x39\x2e\x31\x35\x39\x63\x2d\
-\x31\x38\x2e\x35\x38\x35\x2c\x34\x34\x2e\x38\x36\x39\x2d\x35\x33\
-\x2e\x35\x33\x31\x2c\x37\x39\x2e\x38\x31\x35\x2d\x39\x38\x2e\x34\
-\x2c\x39\x38\x2e\x34\x0a\x09\x63\x2d\x32\x32\x2e\x34\x33\x38\x2c\
-\x39\x2e\x32\x39\x33\x2d\x34\x36\x2e\x30\x30\x34\x2c\x31\x33\x2e\
-\x39\x34\x2d\x36\x39\x2e\x35\x37\x39\x2c\x31\x33\x2e\x39\x33\x39\
-\x63\x2d\x32\x33\x2e\x35\x36\x39\x2d\x30\x2e\x30\x30\x31\x2d\x34\
-\x37\x2e\x31\x34\x37\x2d\x34\x2e\x36\x34\x37\x2d\x36\x39\x2e\x35\
-\x37\x39\x2d\x31\x33\x2e\x39\x33\x39\x63\x2d\x34\x34\x2e\x38\x36\
-\x39\x2d\x31\x38\x2e\x35\x38\x35\x2d\x37\x39\x2e\x38\x31\x35\x2d\
-\x35\x33\x2e\x35\x33\x31\x2d\x39\x38\x2e\x34\x2d\x39\x38\x2e\x34\
-\x0a\x09\x43\x31\x33\x2e\x35\x30\x37\x2c\x32\x30\x30\x2e\x36\x34\
-\x37\x2c\x33\x34\x2e\x37\x35\x38\x2c\x31\x31\x38\x2e\x37\x31\x2c\
-\x39\x30\x2e\x37\x35\x38\x2c\x36\x38\x2e\x36\x34\x34\x6c\x36\x30\
-\x2e\x38\x30\x31\x2c\x36\x30\x2e\x38\x30\x31\x56\x37\x2e\x35\x32\
-\x31\x48\x32\x39\x2e\x36\x33\x35\x4c\x36\x39\x2e\x35\x31\x34\x2c\
-\x34\x37\x2e\x34\x43\x35\x2e\x32\x32\x32\x2c\x31\x30\x35\x2e\x38\
-\x32\x36\x2d\x31\x38\x2e\x39\x38\x35\x2c\x32\x30\x30\x2e\x36\x2c\
-\x31\x36\x2e\x31\x32\x33\x2c\x32\x38\x35\x2e\x33\x35\x39\x0a\x09\
-\x63\x32\x31\x2e\x36\x35\x32\x2c\x35\x32\x2e\x32\x37\x32\x2c\x36\
-\x32\x2e\x33\x36\x34\x2c\x39\x32\x2e\x39\x38\x34\x2c\x31\x31\x34\
-\x2e\x36\x33\x36\x2c\x31\x31\x34\x2e\x36\x33\x36\x63\x32\x36\x2e\
-\x31\x33\x37\x2c\x31\x30\x2e\x38\x32\x36\x2c\x35\x33\x2e\x35\x39\
-\x39\x2c\x31\x36\x2e\x32\x33\x39\x2c\x38\x31\x2e\x30\x36\x31\x2c\
-\x31\x36\x2e\x32\x33\x39\x73\x35\x34\x2e\x39\x32\x34\x2d\x35\x2e\
-\x34\x31\x33\x2c\x38\x31\x2e\x30\x36\x2d\x31\x36\x2e\x32\x33\x39\
-\x0a\x09\x63\x35\x32\x2e\x32\x37\x32\x2d\x32\x31\x2e\x36\x35\x32\
-\x2c\x39\x32\x2e\x39\x38\x34\x2d\x36\x32\x2e\x33\x36\x34\x2c\x31\
-\x31\x34\x2e\x36\x33\x37\x2d\x31\x31\x34\x2e\x36\x33\x36\x43\x34\
-\x32\x39\x2e\x31\x36\x37\x2c\x32\x33\x33\x2e\x30\x38\x37\x2c\x34\
-\x32\x39\x2e\x31\x36\x37\x2c\x31\x37\x35\x2e\x35\x31\x31\x2c\x34\
-\x30\x37\x2e\x35\x31\x36\x2c\x31\x32\x33\x2e\x32\x33\x39\x7a\x22\
-\x2f\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\
-\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\
-\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\
-\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\
-\x0a\x3c\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\
-\x0a\
-\x00\x00\x02\x77\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x73\x74\x79\x6c\x65\
-\x3d\x22\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\
-\x75\x6e\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x3b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\
-\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x70\x6f\x6c\
-\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x32\x38\x38\
-\x2c\x39\x36\x20\x33\x33\x37\x2e\x39\x2c\x31\x34\x35\x2e\x39\x20\
-\x32\x37\x34\x2c\x32\x30\x39\x2e\x37\x20\x32\x37\x34\x2c\x32\x30\
-\x39\x2e\x37\x20\x31\x34\x35\x2e\x39\x2c\x33\x33\x37\x2e\x39\x20\
-\x39\x36\x2c\x32\x38\x38\x20\x39\x36\x2c\x34\x31\x36\x20\x32\x32\
-\x34\x2c\x34\x31\x36\x20\x31\x37\x34\x2e\x31\x2c\x33\x36\x36\x2e\
-\x31\x20\x33\x35\x37\x2e\x34\x2c\x31\x38\x32\x2e\x39\x20\x33\x36\
-\x36\x2e\x31\x2c\x31\x37\x34\x2e\x31\x20\x0a\x09\x34\x31\x36\x2c\
-\x32\x32\x34\x20\x34\x31\x36\x2c\x39\x36\x20\x22\x2f\x3e\x0a\x3c\
-\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x04\x54\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x32\x35\x36\x2c\x31\x37\x36\x63\x2d\x34\x34\x2e\
-\x30\x30\x34\x2c\x30\x2d\x38\x30\x2e\x30\x30\x31\x2c\x33\x36\x2d\
-\x38\x30\x2e\x30\x30\x31\x2c\x38\x30\x63\x30\x2c\x34\x34\x2e\x30\
-\x30\x34\x2c\x33\x35\x2e\x39\x39\x37\x2c\x38\x30\x2c\x38\x30\x2e\
-\x30\x30\x31\x2c\x38\x30\x63\x34\x34\x2e\x30\x30\x35\x2c\x30\x2c\
-\x37\x39\x2e\x39\x39\x39\x2d\x33\x35\x2e\x39\x39\x36\x2c\x37\x39\
-\x2e\x39\x39\x39\x2d\x38\x30\x0a\x09\x09\x09\x43\x33\x33\x35\x2e\
-\x39\x39\x39\x2c\x32\x31\x32\x2c\x33\x30\x30\x2e\x30\x30\x35\x2c\
-\x31\x37\x36\x2c\x32\x35\x36\x2c\x31\x37\x36\x7a\x20\x4d\x34\x34\
-\x36\x2e\x39\x33\x38\x2c\x32\x33\x34\x2e\x36\x36\x37\x63\x2d\x39\
-\x2e\x36\x30\x35\x2d\x38\x38\x2e\x35\x33\x31\x2d\x38\x31\x2e\x30\
-\x37\x34\x2d\x31\x36\x30\x2d\x31\x36\x39\x2e\x36\x30\x35\x2d\x31\
-\x36\x39\x2e\x35\x39\x39\x56\x33\x32\x68\x2d\x34\x32\x2e\x36\x36\
-\x36\x76\x33\x33\x2e\x30\x36\x37\x0a\x09\x09\x09\x63\x2d\x38\x38\
-\x2e\x35\x33\x31\x2c\x39\x2e\x35\x39\x39\x2d\x31\x36\x30\x2c\x38\
-\x31\x2e\x30\x36\x38\x2d\x31\x36\x39\x2e\x36\x30\x34\x2c\x31\x36\
-\x39\x2e\x35\x39\x39\x48\x33\x32\x76\x34\x32\x2e\x36\x36\x37\x68\
-\x33\x33\x2e\x30\x36\x32\x63\x39\x2e\x36\x30\x34\x2c\x38\x38\x2e\
-\x35\x33\x31\x2c\x38\x31\x2e\x30\x37\x32\x2c\x31\x36\x30\x2c\x31\
-\x36\x39\x2e\x36\x30\x34\x2c\x31\x36\x39\x2e\x36\x30\x34\x56\x34\
-\x38\x30\x68\x34\x32\x2e\x36\x36\x36\x76\x2d\x33\x33\x2e\x30\x36\
-\x32\x0a\x09\x09\x09\x63\x38\x38\x2e\x35\x33\x31\x2d\x39\x2e\x36\
-\x30\x34\x2c\x31\x36\x30\x2d\x38\x31\x2e\x30\x37\x33\x2c\x31\x36\
-\x39\x2e\x36\x30\x35\x2d\x31\x36\x39\x2e\x36\x30\x34\x48\x34\x38\
-\x30\x76\x2d\x34\x32\x2e\x36\x36\x37\x48\x34\x34\x36\x2e\x39\x33\
-\x38\x7a\x20\x4d\x32\x35\x36\x2c\x34\x30\x35\x2e\x33\x33\x33\x63\
-\x2d\x38\x32\x2e\x31\x33\x37\x2c\x30\x2d\x31\x34\x39\x2e\x33\x33\
-\x34\x2d\x36\x37\x2e\x31\x39\x38\x2d\x31\x34\x39\x2e\x33\x33\x34\
-\x2d\x31\x34\x39\x2e\x33\x33\x33\x0a\x09\x09\x09\x63\x30\x2d\x38\
-\x32\x2e\x31\x33\x36\x2c\x36\x37\x2e\x31\x39\x37\x2d\x31\x34\x39\
-\x2e\x33\x33\x33\x2c\x31\x34\x39\x2e\x33\x33\x34\x2d\x31\x34\x39\
-\x2e\x33\x33\x33\x63\x38\x32\x2e\x31\x33\x35\x2c\x30\x2c\x31\x34\
-\x39\x2e\x33\x33\x32\x2c\x36\x37\x2e\x31\x39\x38\x2c\x31\x34\x39\
-\x2e\x33\x33\x32\x2c\x31\x34\x39\x2e\x33\x33\x33\x43\x34\x30\x35\
-\x2e\x33\x33\x32\x2c\x33\x33\x38\x2e\x31\x33\x35\x2c\x33\x33\x38\
-\x2e\x31\x33\x35\x2c\x34\x30\x35\x2e\x33\x33\x33\x2c\x32\x35\x36\
-\x2c\x34\x30\x35\x2e\x33\x33\x33\x7a\x0a\x09\x09\x09\x22\x2f\x3e\
-\x0a\x09\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\
-\x67\x3e\x0a\
-\x00\x00\x03\xda\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x30\x2e\x30\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x34\x38\x2e\x34\x35\x31\x2c\x34\x36\x34\x2e\x38\
-\x32\x38\x63\x34\x30\x2e\x30\x32\x33\x2d\x30\x2e\x33\x31\x35\x2c\
-\x34\x35\x2e\x30\x31\x2d\x39\x2e\x39\x35\x35\x2c\x35\x38\x2e\x30\
-\x35\x32\x2d\x35\x30\x2e\x31\x33\x32\x63\x32\x34\x2e\x30\x35\x37\
-\x2d\x36\x33\x2e\x34\x30\x38\x2c\x31\x33\x32\x2e\x34\x31\x39\x2c\
-\x31\x36\x2e\x35\x39\x31\x2c\x36\x35\x2e\x32\x36\x39\x2c\x34\x34\
-\x2e\x33\x37\x34\x0a\x09\x09\x43\x31\x30\x34\x2e\x36\x32\x32\x2c\
-\x34\x38\x36\x2e\x38\x35\x32\x2c\x38\x2e\x34\x32\x38\x2c\x34\x36\
-\x35\x2e\x31\x34\x33\x2c\x34\x38\x2e\x34\x35\x31\x2c\x34\x36\x34\
-\x2e\x38\x32\x38\x7a\x22\x2f\x3e\x0a\x09\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x34\x35\x38\x2e\x38\x35\x37\x2c\x34\x36\x2e\x39\
-\x30\x32\x63\x2d\x31\x39\x2e\x34\x31\x37\x2d\x31\x35\x2e\x36\x34\
-\x37\x2d\x35\x31\x2e\x35\x39\x32\x2d\x37\x2e\x39\x33\x38\x2d\x37\
-\x31\x2e\x38\x36\x34\x2c\x31\x37\x2e\x32\x31\x39\x4c\x31\x38\x31\
-\x2e\x36\x34\x35\x2c\x33\x35\x35\x2e\x38\x34\x39\x63\x2d\x32\x30\
-\x2e\x32\x37\x32\x2c\x32\x35\x2e\x31\x35\x34\x2d\x32\x30\x2e\x31\
-\x37\x31\x2c\x32\x30\x2e\x33\x34\x37\x2d\x30\x2e\x37\x35\x34\x2c\
-\x33\x35\x2e\x39\x39\x32\x0a\x09\x09\x63\x31\x39\x2e\x34\x31\x37\
-\x2c\x31\x35\x2e\x36\x34\x38\x2c\x31\x34\x2e\x37\x33\x38\x2c\x31\
-\x36\x2e\x37\x37\x2c\x33\x35\x2e\x30\x31\x31\x2d\x38\x2e\x33\x38\
-\x38\x6c\x32\x34\x31\x2e\x34\x30\x36\x2d\x32\x36\x32\x2e\x36\x36\
-\x39\x43\x34\x37\x37\x2e\x35\x38\x31\x2c\x39\x35\x2e\x36\x32\x38\
-\x2c\x34\x37\x38\x2e\x32\x37\x35\x2c\x36\x32\x2e\x35\x35\x2c\x34\
-\x35\x38\x2e\x38\x35\x37\x2c\x34\x36\x2e\x39\x30\x32\x7a\x20\x4d\
-\x34\x30\x36\x2e\x30\x36\x35\x2c\x38\x31\x2e\x38\x32\x35\x0a\x09\
-\x09\x63\x30\x2c\x30\x2d\x33\x2d\x33\x2e\x35\x2d\x31\x33\x2d\x31\
-\x31\x2e\x35\x63\x31\x35\x2d\x32\x34\x2e\x35\x2c\x34\x34\x2e\x35\
-\x2d\x32\x30\x2c\x34\x34\x2e\x35\x2d\x32\x30\x43\x34\x30\x39\x2e\
-\x35\x36\x35\x2c\x36\x36\x2e\x38\x32\x35\x2c\x34\x30\x36\x2e\x30\
-\x36\x35\x2c\x38\x31\x2e\x38\x32\x35\x2c\x34\x30\x36\x2e\x30\x36\
-\x35\x2c\x38\x31\x2e\x38\x32\x35\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x04\x22\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\
-\x30\x27\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x27\x55\x54\x46\
-\x2d\x38\x27\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x54\x68\x69\x73\x20\
-\x66\x69\x6c\x65\x20\x77\x61\x73\x20\x67\x65\x6e\x65\x72\x61\x74\
-\x65\x64\x20\x62\x79\x20\x64\x76\x69\x73\x76\x67\x6d\x20\x32\x2e\
-\x31\x31\x2e\x31\x20\x2d\x2d\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\
-\x72\x73\x69\x6f\x6e\x3d\x27\x31\x2e\x31\x27\x20\x78\x6d\x6c\x6e\
-\x73\x3d\x27\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\
-\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x27\x20\x78\
-\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\x27\x68\x74\x74\x70\
-\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\
-\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x27\x20\x77\x69\x64\x74\x68\x3d\
-\x27\x36\x34\x2e\x30\x30\x30\x31\x70\x74\x27\x20\x68\x65\x69\x67\
-\x68\x74\x3d\x27\x36\x34\x70\x74\x27\x20\x76\x69\x65\x77\x42\x6f\
-\x78\x3d\x27\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\
-\x35\x38\x20\x36\x34\x2e\x30\x30\x30\x31\x20\x36\x34\x27\x3e\x0a\
-\x3c\x67\x20\x69\x64\x3d\x27\x70\x61\x67\x65\x31\x27\x3e\x0a\x3c\
-\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\
-\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\
-\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\
-\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x27\x4d\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\x32\x4c\
-\x20\x31\x33\x2e\x39\x36\x38\x37\x20\x31\x32\x2e\x39\x33\x36\x31\
-\x4c\x20\x35\x38\x2e\x32\x31\x37\x35\x20\x32\x31\x2e\x37\x33\x37\
-\x38\x4c\x20\x34\x32\x2e\x37\x34\x34\x35\x20\x34\x31\x2e\x37\x31\
-\x31\x39\x4c\x20\x36\x2e\x30\x32\x32\x35\x20\x33\x32\x2e\x31\x32\
-\x5a\x27\x20\x66\x69\x6c\x6c\x3d\x27\x6e\x6f\x6e\x65\x27\x20\x73\
-\x74\x72\x6f\x6b\x65\x3d\x27\x23\x30\x30\x30\x30\x30\x30\x27\x20\
-\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\x6e\x65\x63\x61\x70\x3d\x27\
-\x72\x6f\x75\x6e\x64\x27\x20\x73\x74\x72\x6f\x6b\x65\x2d\x6c\x69\
-\x6e\x65\x6a\x6f\x69\x6e\x3d\x27\x72\x6f\x75\x6e\x64\x27\x20\x73\
-\x74\x72\x6f\x6b\x65\x2d\x6d\x69\x74\x65\x72\x6c\x69\x6d\x69\x74\
-\x3d\x27\x31\x30\x2e\x30\x33\x37\x35\x27\x20\x73\x74\x72\x6f\x6b\
-\x65\x2d\x77\x69\x64\x74\x68\x3d\x27\x32\x2e\x35\x30\x39\x33\x37\
-\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\
-\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\
-\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\x35\x38\
-\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\x27\
-\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\x36\x2e\
-\x30\x32\x32\x35\x27\x20\x63\x79\x3d\x27\x33\x32\x2e\x31\x32\x27\
-\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\x20\
-\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\
-\x3e\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\
-\x74\x72\x61\x6e\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\
-\x39\x20\x31\x31\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\
-\x2e\x39\x39\x36\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\
-\x6c\x65\x20\x63\x78\x3d\x27\x31\x33\x2e\x39\x36\x38\x37\x27\x20\
-\x63\x79\x3d\x27\x31\x32\x2e\x39\x33\x36\x31\x27\x20\x66\x69\x6c\
-\x6c\x3d\x27\x23\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\x36\
-\x2e\x30\x32\x32\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\
-\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\
-\x73\x6c\x61\x74\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\
-\x37\x2e\x38\x35\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\
-\x32\x36\x34\x29\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\
-\x78\x3d\x27\x35\x38\x2e\x32\x31\x37\x35\x27\x20\x63\x79\x3d\x27\
-\x32\x31\x2e\x37\x33\x37\x38\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\
-\x66\x66\x30\x30\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\
-\x35\x27\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x67\x20\x74\x72\x61\
-\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x74\x72\x61\x6e\x73\x6c\x61\x74\
-\x65\x28\x35\x38\x2e\x34\x36\x36\x39\x20\x31\x31\x37\x2e\x38\x35\
-\x38\x29\x73\x63\x61\x6c\x65\x28\x2e\x39\x39\x36\x32\x36\x34\x29\
-\x27\x3e\x0a\x3c\x63\x69\x72\x63\x6c\x65\x20\x63\x78\x3d\x27\x34\
-\x32\x2e\x37\x34\x34\x35\x27\x20\x63\x79\x3d\x27\x34\x31\x2e\x37\
-\x31\x31\x39\x27\x20\x66\x69\x6c\x6c\x3d\x27\x23\x66\x66\x30\x30\
-\x30\x30\x27\x20\x72\x3d\x27\x36\x2e\x30\x32\x32\x35\x27\x2f\x3e\
-\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\
-\x3e\
-\x00\x00\x02\xab\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x35\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\x6f\
-\x6c\x79\x67\x6f\x6e\x20\x70\x6f\x69\x6e\x74\x73\x3d\x22\x34\x30\
-\x35\x2c\x31\x33\x36\x2e\x37\x39\x38\x20\x33\x37\x35\x2e\x32\x30\
-\x32\x2c\x31\x30\x37\x20\x32\x35\x36\x2c\x32\x32\x36\x2e\x32\x30\
-\x32\x20\x31\x33\x36\x2e\x37\x39\x38\x2c\x31\x30\x37\x20\x31\x30\
-\x37\x2c\x31\x33\x36\x2e\x37\x39\x38\x20\x32\x32\x36\x2e\x32\x30\
-\x32\x2c\x32\x35\x36\x20\x31\x30\x37\x2c\x33\x37\x35\x2e\x32\x30\
-\x32\x20\x31\x33\x36\x2e\x37\x39\x38\x2c\x34\x30\x35\x20\x32\x35\
-\x36\x2c\x32\x38\x35\x2e\x37\x39\x38\x20\x0a\x09\x09\x09\x33\x37\
-\x35\x2e\x32\x30\x32\x2c\x34\x30\x35\x20\x34\x30\x35\x2c\x33\x37\
-\x35\x2e\x32\x30\x32\x20\x32\x38\x35\x2e\x37\x39\x38\x2c\x32\x35\
-\x36\x20\x09\x09\x22\x2f\x3e\x0a\x09\x3c\x2f\x67\x3e\x0a\x3c\x2f\
-\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x01\x1c\
-\x3c\
-\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\
-\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
-\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\x32\
-\x70\x78\x22\x0a\x20\x20\x20\x20\x20\x76\x69\x65\x77\x42\x6f\x78\
-\x3d\x22\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x3e\x0a\
-\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x6d\x61\
-\x74\x72\x69\x78\x28\x34\x38\x20\x30\x20\x30\x20\x34\x38\x20\x34\
-\x38\x20\x34\x38\x29\x27\x3e\x0a\x20\x20\x3c\x70\x61\x74\x68\x20\
-\x64\x3d\x22\x4d\x30\x20\x30\x76\x32\x68\x2e\x35\x63\x30\x2d\x2e\
-\x35\x35\x2e\x34\x35\x2d\x31\x20\x31\x2d\x31\x68\x31\x2e\x35\x76\
-\x35\x2e\x35\x63\x30\x20\x2e\x32\x38\x2d\x2e\x32\x32\x2e\x35\x2d\
-\x2e\x35\x2e\x35\x68\x2d\x2e\x35\x76\x31\x68\x34\x76\x2d\x31\x68\
-\x2d\x2e\x35\x63\x2d\x2e\x32\x38\x20\x30\x2d\x2e\x35\x2d\x2e\x32\
-\x32\x2d\x2e\x35\x2d\x2e\x35\x76\x2d\x35\x2e\x35\x68\x31\x2e\x35\
-\x63\x2e\x35\x35\x20\x30\x20\x31\x20\x2e\x34\x35\x20\x31\x20\x31\
-\x68\x2e\x35\x76\x2d\x32\x68\x2d\x38\x7a\x22\x20\x2f\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\xdc\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x73\x74\x79\x6c\x65\
-\x3d\x22\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\
-\x75\x6e\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x3b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\
-\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x67\x3e\x0a\
-\x09\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x35\x36\x2c\x31\
-\x32\x38\x63\x2d\x38\x31\x2e\x39\x2c\x30\x2d\x31\x34\x35\x2e\x37\
-\x2c\x34\x38\x2e\x38\x2d\x32\x32\x34\x2c\x31\x32\x38\x63\x36\x37\
-\x2e\x34\x2c\x36\x37\x2e\x37\x2c\x31\x32\x34\x2c\x31\x32\x38\x2c\
-\x32\x32\x34\x2c\x31\x32\x38\x63\x39\x39\x2e\x39\x2c\x30\x2c\x31\
-\x37\x33\x2e\x34\x2d\x37\x36\x2e\x34\x2c\x32\x32\x34\x2d\x31\x32\
-\x36\x2e\x36\x0a\x09\x09\x43\x34\x32\x38\x2e\x32\x2c\x31\x39\x38\
-\x2e\x36\x2c\x33\x35\x34\x2e\x38\x2c\x31\x32\x38\x2c\x32\x35\x36\
-\x2c\x31\x32\x38\x7a\x20\x4d\x32\x35\x36\x2c\x33\x34\x37\x2e\x33\
-\x63\x2d\x34\x39\x2e\x34\x2c\x30\x2d\x38\x39\x2e\x36\x2d\x34\x31\
-\x2d\x38\x39\x2e\x36\x2d\x39\x31\x2e\x33\x63\x30\x2d\x35\x30\x2e\
-\x34\x2c\x34\x30\x2e\x32\x2d\x39\x31\x2e\x33\x2c\x38\x39\x2e\x36\
-\x2d\x39\x31\x2e\x33\x73\x38\x39\x2e\x36\x2c\x34\x31\x2c\x38\x39\
-\x2e\x36\x2c\x39\x31\x2e\x33\x0a\x09\x09\x43\x33\x34\x35\x2e\x36\
-\x2c\x33\x30\x36\x2e\x34\x2c\x33\x30\x35\x2e\x34\x2c\x33\x34\x37\
-\x2e\x33\x2c\x32\x35\x36\x2c\x33\x34\x37\x2e\x33\x7a\x22\x2f\x3e\
-\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\x61\x74\x68\x20\x64\x3d\
-\x22\x4d\x32\x35\x36\x2c\x32\x32\x34\x63\x30\x2d\x37\x2e\x39\x2c\
-\x32\x2e\x39\x2d\x31\x35\x2e\x31\x2c\x37\x2e\x36\x2d\x32\x30\x2e\
-\x37\x63\x2d\x32\x2e\x35\x2d\x30\x2e\x34\x2d\x35\x2d\x30\x2e\x36\
-\x2d\x37\x2e\x36\x2d\x30\x2e\x36\x63\x2d\x32\x38\x2e\x38\x2c\x30\
-\x2d\x35\x32\x2e\x33\x2c\x32\x33\x2e\x39\x2d\x35\x32\x2e\x33\x2c\
-\x35\x33\x2e\x33\x63\x30\x2c\x32\x39\x2e\x34\x2c\x32\x33\x2e\x35\
-\x2c\x35\x33\x2e\x33\x2c\x35\x32\x2e\x33\x2c\x35\x33\x2e\x33\x0a\
-\x09\x09\x09\x73\x35\x32\x2e\x33\x2d\x32\x33\x2e\x39\x2c\x35\x32\
-\x2e\x33\x2d\x35\x33\x2e\x33\x63\x30\x2d\x32\x2e\x33\x2d\x30\x2e\
-\x32\x2d\x34\x2e\x36\x2d\x30\x2e\x34\x2d\x36\x2e\x39\x63\x2d\x35\
-\x2e\x35\x2c\x34\x2e\x33\x2d\x31\x32\x2e\x33\x2c\x36\x2e\x39\x2d\
-\x31\x39\x2e\x38\x2c\x36\x2e\x39\x43\x32\x37\x30\x2e\x33\x2c\x32\
-\x35\x36\x2c\x32\x35\x36\x2c\x32\x34\x31\x2e\x37\x2c\x32\x35\x36\
-\x2c\x32\x32\x34\x7a\x22\x2f\x3e\x0a\x09\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\x3f\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x32\x31\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x35\x36\x2c\x31\x35\x32\x63\
-\x2d\x35\x37\x2e\x32\x2c\x30\x2d\x31\x30\x34\x2c\x34\x36\x2e\x38\
-\x2d\x31\x30\x34\x2c\x31\x30\x34\x73\x34\x36\x2e\x38\x2c\x31\x30\
-\x34\x2c\x31\x30\x34\x2c\x31\x30\x34\x73\x31\x30\x34\x2d\x34\x36\
-\x2e\x38\x2c\x31\x30\x34\x2d\x31\x30\x34\x53\x33\x31\x33\x2e\x32\
-\x2c\x31\x35\x32\x2c\x32\x35\x36\x2c\x31\x35\x32\x7a\x20\x4d\x32\
-\x35\x36\x2c\x34\x38\x0a\x09\x09\x09\x43\x31\x34\x31\x2e\x36\x30\
-\x31\x2c\x34\x38\x2c\x34\x38\x2c\x31\x34\x31\x2e\x36\x30\x31\x2c\
-\x34\x38\x2c\x32\x35\x36\x73\x39\x33\x2e\x36\x30\x31\x2c\x32\x30\
-\x38\x2c\x32\x30\x38\x2c\x32\x30\x38\x73\x32\x30\x38\x2d\x39\x33\
-\x2e\x36\x30\x31\x2c\x32\x30\x38\x2d\x32\x30\x38\x53\x33\x37\x30\
-\x2e\x33\x39\x39\x2c\x34\x38\x2c\x32\x35\x36\x2c\x34\x38\x7a\x20\
-\x4d\x32\x35\x36\x2c\x34\x32\x32\x2e\x34\x0a\x09\x09\x09\x63\x2d\
-\x39\x31\x2e\x35\x31\x38\x2c\x30\x2d\x31\x36\x36\x2e\x34\x2d\x37\
-\x34\x2e\x38\x38\x33\x2d\x31\x36\x36\x2e\x34\x2d\x31\x36\x36\x2e\
-\x34\x53\x31\x36\x34\x2e\x34\x38\x32\x2c\x38\x39\x2e\x36\x2c\x32\
-\x35\x36\x2c\x38\x39\x2e\x36\x53\x34\x32\x32\x2e\x34\x2c\x31\x36\
-\x34\x2e\x34\x38\x32\x2c\x34\x32\x32\x2e\x34\x2c\x32\x35\x36\x53\
-\x33\x34\x37\x2e\x35\x31\x38\x2c\x34\x32\x32\x2e\x34\x2c\x32\x35\
-\x36\x2c\x34\x32\x32\x2e\x34\x7a\x22\x2f\x3e\x0a\x09\x3c\x2f\x67\
-\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x01\x69\
-\x3c\
-\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\
-\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
-\x30\x2f\x73\x76\x67\x22\x20\x77\x69\x64\x74\x68\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\x32\
-\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\
-\x20\x35\x31\x32\x20\x35\x31\x32\x22\x3e\x3c\x67\x20\x74\x72\x61\
-\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x6d\x61\x74\x72\x69\x78\x28\x32\
-\x34\x20\x30\x20\x30\x20\x32\x34\x20\x30\x20\x30\x29\x27\x3e\x3c\
-\x70\x61\x74\x68\x20\x64\x3d\x22\x4d\x34\x2e\x33\x34\x20\x31\x35\
-\x2e\x36\x36\x41\x37\x2e\x39\x37\x20\x37\x2e\x39\x37\x20\x30\x20\
-\x30\x20\x30\x20\x39\x20\x31\x37\x2e\x39\x34\x56\x31\x30\x48\x35\
-\x56\x38\x68\x34\x56\x35\x2e\x38\x33\x61\x33\x20\x33\x20\x30\x20\
-\x31\x20\x31\x20\x32\x20\x30\x56\x38\x68\x34\x76\x32\x68\x2d\x34\
-\x76\x37\x2e\x39\x34\x61\x37\x2e\x39\x37\x20\x37\x2e\x39\x37\x20\
-\x30\x20\x30\x20\x30\x20\x34\x2e\x36\x36\x2d\x32\x2e\x32\x38\x6c\
-\x2d\x31\x2e\x34\x32\x2d\x31\x2e\x34\x32\x68\x35\x2e\x36\x36\x6c\
-\x2d\x32\x2e\x38\x33\x20\x32\x2e\x38\x33\x61\x31\x30\x20\x31\x30\
-\x20\x30\x20\x30\x20\x31\x2d\x31\x34\x2e\x31\x34\x20\x30\x4c\x2e\
-\x31\x20\x31\x34\x2e\x32\x34\x68\x35\x2e\x36\x36\x6c\x2d\x31\x2e\
-\x34\x32\x20\x31\x2e\x34\x32\x7a\x4d\x31\x30\x20\x34\x61\x31\x20\
-\x31\x20\x30\x20\x31\x20\x30\x20\x30\x2d\x32\x20\x31\x20\x31\x20\
-\x30\x20\x30\x20\x30\x20\x30\x20\x32\x7a\x22\x2f\x3e\x3c\x2f\x67\
-\x3e\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x03\xb7\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x38\x2e\x31\x2e\x30\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4d\
-\x61\x67\x6e\x69\x66\x79\x69\x6e\x67\x5f\x67\x6c\x61\x73\x73\x22\
-\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\x30\x2f\x73\
-\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\x3a\x78\x6c\x69\x6e\x6b\x3d\
-\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\
-\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\x6c\x69\x6e\x6b\x22\x20\x78\
-\x3d\x22\x30\x70\x78\x22\x0a\x09\x20\x79\x3d\x22\x30\x70\x78\x22\
-\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\x30\x20\x35\x31\
-\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\
-\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\x77\x20\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\x6d\x6c\x3a\x73\
-\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\
-\x0a\x3c\x67\x20\x74\x72\x61\x6e\x73\x66\x6f\x72\x6d\x3d\x27\x6d\
-\x61\x74\x72\x69\x78\x28\x32\x34\x20\x30\x20\x30\x20\x32\x34\x20\
-\x30\x20\x30\x29\x27\x3e\x0a\x3c\x70\x61\x74\x68\x20\x64\x3d\x22\
-\x4d\x31\x37\x2e\x35\x34\x35\x2c\x31\x35\x2e\x34\x36\x37\x6c\x2d\
-\x33\x2e\x37\x37\x39\x2d\x33\x2e\x37\x37\x39\x63\x30\x2e\x35\x37\
-\x2d\x30\x2e\x39\x33\x35\x2c\x30\x2e\x38\x39\x38\x2d\x32\x2e\x30\
-\x33\x35\x2c\x30\x2e\x38\x39\x38\x2d\x33\x2e\x32\x31\x63\x30\x2d\
-\x33\x2e\x34\x31\x37\x2d\x32\x2e\x39\x36\x31\x2d\x36\x2e\x33\x37\
-\x37\x2d\x36\x2e\x33\x37\x38\x2d\x36\x2e\x33\x37\x37\x0a\x09\x43\
-\x34\x2e\x38\x36\x39\x2c\x32\x2e\x31\x2c\x32\x2e\x31\x2c\x34\x2e\
-\x38\x37\x2c\x32\x2e\x31\x2c\x38\x2e\x32\x38\x37\x63\x30\x2c\x33\
-\x2e\x34\x31\x36\x2c\x32\x2e\x39\x36\x31\x2c\x36\x2e\x33\x37\x37\
-\x2c\x36\x2e\x33\x37\x37\x2c\x36\x2e\x33\x37\x37\x63\x31\x2e\x31\
-\x33\x37\x2c\x30\x2c\x32\x2e\x32\x2d\x30\x2e\x33\x30\x39\x2c\x33\
-\x2e\x31\x31\x35\x2d\x30\x2e\x38\x34\x34\x6c\x33\x2e\x37\x39\x39\
-\x2c\x33\x2e\x38\x30\x31\x0a\x09\x63\x30\x2e\x33\x37\x32\x2c\x30\
-\x2e\x33\x37\x31\x2c\x30\x2e\x39\x37\x35\x2c\x30\x2e\x33\x37\x31\
-\x2c\x31\x2e\x33\x34\x36\x2c\x30\x6c\x30\x2e\x39\x34\x33\x2d\x30\
-\x2e\x39\x34\x33\x43\x31\x38\x2e\x30\x35\x31\x2c\x31\x36\x2e\x33\
-\x30\x37\x2c\x31\x37\x2e\x39\x31\x36\x2c\x31\x35\x2e\x38\x33\x38\
-\x2c\x31\x37\x2e\x35\x34\x35\x2c\x31\x35\x2e\x34\x36\x37\x7a\x20\
-\x4d\x34\x2e\x30\x30\x34\x2c\x38\x2e\x32\x38\x37\x0a\x09\x63\x30\
-\x2d\x32\x2e\x33\x36\x36\x2c\x31\x2e\x39\x31\x37\x2d\x34\x2e\x32\
-\x38\x33\x2c\x34\x2e\x32\x38\x32\x2d\x34\x2e\x32\x38\x33\x63\x32\
-\x2e\x33\x36\x36\x2c\x30\x2c\x34\x2e\x34\x37\x34\x2c\x32\x2e\x31\
-\x30\x37\x2c\x34\x2e\x34\x37\x34\x2c\x34\x2e\x34\x37\x34\x63\x30\
-\x2c\x32\x2e\x33\x36\x35\x2d\x31\x2e\x39\x31\x38\x2c\x34\x2e\x32\
-\x38\x33\x2d\x34\x2e\x32\x38\x33\x2c\x34\x2e\x32\x38\x33\x0a\x09\
-\x43\x36\x2e\x31\x31\x31\x2c\x31\x32\x2e\x37\x36\x2c\x34\x2e\x30\
-\x30\x34\x2c\x31\x30\x2e\x36\x35\x32\x2c\x34\x2e\x30\x30\x34\x2c\
-\x38\x2e\x32\x38\x37\x7a\x22\x2f\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\
-\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x00\x6c\
-\x3c\
-\x73\x76\x67\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\x74\x74\x70\x3a\
-\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x32\x30\x30\
-\x30\x2f\x73\x76\x67\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\
-\x30\x20\x30\x20\x32\x30\x20\x32\x30\x22\x3e\x3c\x70\x61\x74\x68\
-\x20\x64\x3d\x22\x4d\x31\x38\x20\x31\x32\x76\x31\x48\x38\x76\x35\
-\x6c\x2d\x36\x2d\x36\x20\x36\x2d\x36\x76\x35\x68\x38\x56\x32\x68\
-\x32\x7a\x22\x2f\x3e\x3c\x2f\x73\x76\x67\x3e\
-\x00\x00\x02\xee\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x73\x74\x79\x6c\x65\
-\x3d\x22\x65\x6e\x61\x62\x6c\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\
-\x75\x6e\x64\x3a\x6e\x65\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\
-\x35\x31\x32\x3b\x22\x20\x78\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\
-\x22\x70\x72\x65\x73\x65\x72\x76\x65\x22\x3e\x0a\x3c\x70\x61\x74\
-\x68\x20\x64\x3d\x22\x4d\x34\x31\x37\x2e\x34\x2c\x32\x32\x34\x48\
-\x32\x38\x38\x56\x39\x34\x2e\x36\x63\x30\x2d\x31\x36\x2e\x39\x2d\
-\x31\x34\x2e\x33\x2d\x33\x30\x2e\x36\x2d\x33\x32\x2d\x33\x30\x2e\
-\x36\x63\x2d\x31\x37\x2e\x37\x2c\x30\x2d\x33\x32\x2c\x31\x33\x2e\
-\x37\x2d\x33\x32\x2c\x33\x30\x2e\x36\x56\x32\x32\x34\x48\x39\x34\
-\x2e\x36\x43\x37\x37\x2e\x37\x2c\x32\x32\x34\x2c\x36\x34\x2c\x32\
-\x33\x38\x2e\x33\x2c\x36\x34\x2c\x32\x35\x36\x0a\x09\x63\x30\x2c\
-\x31\x37\x2e\x37\x2c\x31\x33\x2e\x37\x2c\x33\x32\x2c\x33\x30\x2e\
-\x36\x2c\x33\x32\x48\x32\x32\x34\x76\x31\x32\x39\x2e\x34\x63\x30\
-\x2c\x31\x36\x2e\x39\x2c\x31\x34\x2e\x33\x2c\x33\x30\x2e\x36\x2c\
-\x33\x32\x2c\x33\x30\x2e\x36\x63\x31\x37\x2e\x37\x2c\x30\x2c\x33\
-\x32\x2d\x31\x33\x2e\x37\x2c\x33\x32\x2d\x33\x30\x2e\x36\x56\x32\
-\x38\x38\x68\x31\x32\x39\x2e\x34\x63\x31\x36\x2e\x39\x2c\x30\x2c\
-\x33\x30\x2e\x36\x2d\x31\x34\x2e\x33\x2c\x33\x30\x2e\x36\x2d\x33\
-\x32\x0a\x09\x43\x34\x34\x38\x2c\x32\x33\x38\x2e\x33\x2c\x34\x33\
-\x34\x2e\x33\x2c\x32\x32\x34\x2c\x34\x31\x37\x2e\x34\x2c\x32\x32\
-\x34\x7a\x22\x2f\x3e\x0a\x3c\x2f\x73\x76\x67\x3e\x0a\
-\x00\x00\x05\x16\
-\x3c\
-\x3f\x78\x6d\x6c\x20\x76\x65\x72\x73\x69\x6f\x6e\x3d\x22\x31\x2e\
-\x30\x22\x20\x65\x6e\x63\x6f\x64\x69\x6e\x67\x3d\x22\x75\x74\x66\
-\x2d\x38\x22\x3f\x3e\x0a\x3c\x21\x2d\x2d\x20\x47\x65\x6e\x65\x72\
-\x61\x74\x6f\x72\x3a\x20\x41\x64\x6f\x62\x65\x20\x49\x6c\x6c\x75\
-\x73\x74\x72\x61\x74\x6f\x72\x20\x31\x36\x2e\x32\x2e\x31\x2c\x20\
-\x53\x56\x47\x20\x45\x78\x70\x6f\x72\x74\x20\x50\x6c\x75\x67\x2d\
-\x49\x6e\x20\x2e\x20\x53\x56\x47\x20\x56\x65\x72\x73\x69\x6f\x6e\
-\x3a\x20\x36\x2e\x30\x30\x20\x42\x75\x69\x6c\x64\x20\x30\x29\x20\
-\x20\x2d\x2d\x3e\x0a\x3c\x21\x44\x4f\x43\x54\x59\x50\x45\x20\x73\
-\x76\x67\x20\x50\x55\x42\x4c\x49\x43\x20\x22\x2d\x2f\x2f\x57\x33\
-\x43\x2f\x2f\x44\x54\x44\x20\x53\x56\x47\x20\x31\x2e\x31\x2f\x2f\
-\x45\x4e\x22\x20\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\
-\x77\x33\x2e\x6f\x72\x67\x2f\x47\x72\x61\x70\x68\x69\x63\x73\x2f\
-\x53\x56\x47\x2f\x31\x2e\x31\x2f\x44\x54\x44\x2f\x73\x76\x67\x31\
-\x31\x2e\x64\x74\x64\x22\x3e\x0a\x3c\x73\x76\x67\x20\x76\x65\x72\
-\x73\x69\x6f\x6e\x3d\x22\x31\x2e\x31\x22\x20\x69\x64\x3d\x22\x4c\
-\x61\x79\x65\x72\x5f\x31\x22\x20\x78\x6d\x6c\x6e\x73\x3d\x22\x68\
-\x74\x74\x70\x3a\x2f\x2f\x77\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\
-\x2f\x32\x30\x30\x30\x2f\x73\x76\x67\x22\x20\x78\x6d\x6c\x6e\x73\
-\x3a\x78\x6c\x69\x6e\x6b\x3d\x22\x68\x74\x74\x70\x3a\x2f\x2f\x77\
-\x77\x77\x2e\x77\x33\x2e\x6f\x72\x67\x2f\x31\x39\x39\x39\x2f\x78\
-\x6c\x69\x6e\x6b\x22\x20\x78\x3d\x22\x30\x70\x78\x22\x20\x79\x3d\
-\x22\x30\x70\x78\x22\x0a\x09\x20\x77\x69\x64\x74\x68\x3d\x22\x35\
-\x31\x32\x70\x78\x22\x20\x68\x65\x69\x67\x68\x74\x3d\x22\x35\x31\
-\x32\x70\x78\x22\x20\x76\x69\x65\x77\x42\x6f\x78\x3d\x22\x30\x20\
-\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x65\x6e\x61\x62\x6c\
-\x65\x2d\x62\x61\x63\x6b\x67\x72\x6f\x75\x6e\x64\x3d\x22\x6e\x65\
-\x77\x20\x30\x20\x30\x20\x35\x31\x32\x20\x35\x31\x32\x22\x20\x78\
-\x6d\x6c\x3a\x73\x70\x61\x63\x65\x3d\x22\x70\x72\x65\x73\x65\x72\
-\x76\x65\x22\x3e\x0a\x3c\x67\x20\x69\x64\x3d\x22\x49\x63\x6f\x6e\
-\x5f\x31\x32\x5f\x22\x3e\x0a\x09\x3c\x67\x3e\x0a\x09\x09\x3c\x70\
-\x61\x74\x68\x20\x64\x3d\x22\x4d\x32\x35\x36\x2c\x36\x34\x43\x31\
-\x35\x30\x2e\x34\x30\x31\x2c\x36\x34\x2c\x36\x34\x2c\x31\x35\x30\
-\x2e\x34\x30\x31\x2c\x36\x34\x2c\x32\x35\x36\x63\x30\x2c\x31\x30\
-\x35\x2e\x36\x30\x34\x2c\x38\x36\x2e\x34\x30\x31\x2c\x31\x39\x32\
-\x2c\x31\x39\x32\x2c\x31\x39\x32\x63\x31\x38\x2e\x31\x33\x36\x2c\
-\x30\x2c\x33\x32\x2d\x31\x33\x2e\x38\x36\x34\x2c\x33\x32\x2d\x33\
-\x32\x0a\x09\x09\x09\x63\x30\x2d\x38\x2e\x35\x33\x31\x2d\x33\x2e\
-\x31\x39\x38\x2d\x31\x36\x2d\x38\x2e\x35\x33\x31\x2d\x32\x31\x2e\
-\x33\x33\x33\x63\x2d\x35\x2e\x33\x33\x33\x2d\x35\x2e\x33\x33\x34\
-\x2d\x38\x2e\x35\x33\x31\x2d\x31\x32\x2e\x38\x30\x33\x2d\x38\x2e\
-\x35\x33\x31\x2d\x32\x31\x2e\x33\x33\x34\x63\x30\x2d\x31\x38\x2e\
-\x31\x33\x35\x2c\x31\x33\x2e\x38\x36\x34\x2d\x33\x32\x2c\x33\x32\
-\x2d\x33\x32\x68\x33\x38\x2e\x33\x39\x36\x0a\x09\x09\x09\x63\x35\
-\x38\x2e\x36\x36\x37\x2c\x30\x2c\x31\x30\x36\x2e\x36\x36\x37\x2d\
-\x34\x38\x2c\x31\x30\x36\x2e\x36\x36\x37\x2d\x31\x30\x36\x2e\x36\
-\x36\x36\x43\x34\x34\x38\x2c\x31\x34\x30\x2e\x38\x30\x32\x2c\x33\
-\x36\x31\x2e\x36\x30\x34\x2c\x36\x34\x2c\x32\x35\x36\x2c\x36\x34\
-\x7a\x20\x4d\x31\x33\x38\x2e\x36\x36\x37\x2c\x32\x35\x36\x63\x2d\
-\x31\x38\x2e\x31\x33\x36\x2c\x30\x2d\x33\x32\x2d\x31\x33\x2e\x38\
-\x36\x34\x2d\x33\x32\x2d\x33\x32\x73\x31\x33\x2e\x38\x36\x34\x2d\
-\x33\x32\x2c\x33\x32\x2d\x33\x32\x0a\x09\x09\x09\x63\x31\x38\x2e\
-\x31\x33\x35\x2c\x30\x2c\x33\x32\x2c\x31\x33\x2e\x38\x36\x34\x2c\
-\x33\x32\x2c\x33\x32\x53\x31\x35\x36\x2e\x38\x30\x32\x2c\x32\x35\
-\x36\x2c\x31\x33\x38\x2e\x36\x36\x37\x2c\x32\x35\x36\x7a\x20\x4d\
-\x32\x30\x32\x2e\x36\x36\x37\x2c\x31\x37\x30\x2e\x36\x36\x37\x63\
-\x2d\x31\x38\x2e\x31\x33\x36\x2c\x30\x2d\x33\x32\x2d\x31\x33\x2e\
-\x38\x36\x35\x2d\x33\x32\x2d\x33\x32\x63\x30\x2d\x31\x38\x2e\x31\
-\x33\x36\x2c\x31\x33\x2e\x38\x36\x34\x2d\x33\x32\x2c\x33\x32\x2d\
-\x33\x32\x0a\x09\x09\x09\x63\x31\x38\x2e\x31\x33\x35\x2c\x30\x2c\
-\x33\x32\x2c\x31\x33\x2e\x38\x36\x34\x2c\x33\x32\x2c\x33\x32\x43\
-\x32\x33\x34\x2e\x36\x36\x37\x2c\x31\x35\x36\x2e\x38\x30\x32\x2c\
-\x32\x32\x30\x2e\x38\x30\x32\x2c\x31\x37\x30\x2e\x36\x36\x37\x2c\
-\x32\x30\x32\x2e\x36\x36\x37\x2c\x31\x37\x30\x2e\x36\x36\x37\x7a\
-\x20\x4d\x33\x30\x39\x2e\x33\x33\x33\x2c\x31\x37\x30\x2e\x36\x36\
-\x37\x63\x2d\x31\x38\x2e\x31\x33\x35\x2c\x30\x2d\x33\x32\x2d\x31\
-\x33\x2e\x38\x36\x35\x2d\x33\x32\x2d\x33\x32\x0a\x09\x09\x09\x63\
-\x30\x2d\x31\x38\x2e\x31\x33\x36\x2c\x31\x33\x2e\x38\x36\x35\x2d\
-\x33\x32\x2c\x33\x32\x2d\x33\x32\x63\x31\x38\x2e\x31\x33\x36\x2c\
-\x30\x2c\x33\x32\x2c\x31\x33\x2e\x38\x36\x34\x2c\x33\x32\x2c\x33\
-\x32\x43\x33\x34\x31\x2e\x33\x33\x33\x2c\x31\x35\x36\x2e\x38\x30\
-\x32\x2c\x33\x32\x37\x2e\x34\x36\x39\x2c\x31\x37\x30\x2e\x36\x36\
-\x37\x2c\x33\x30\x39\x2e\x33\x33\x33\x2c\x31\x37\x30\x2e\x36\x36\
-\x37\x7a\x20\x4d\x33\x37\x33\x2e\x33\x33\x33\x2c\x32\x35\x36\x0a\
-\x09\x09\x09\x63\x2d\x31\x38\x2e\x31\x33\x35\x2c\x30\x2d\x33\x32\
-\x2d\x31\x33\x2e\x38\x36\x34\x2d\x33\x32\x2d\x33\x32\x73\x31\x33\
-\x2e\x38\x36\x35\x2d\x33\x32\x2c\x33\x32\x2d\x33\x32\x63\x31\x38\
-\x2e\x31\x33\x36\x2c\x30\x2c\x33\x32\x2c\x31\x33\x2e\x38\x36\x34\
-\x2c\x33\x32\x2c\x33\x32\x53\x33\x39\x31\x2e\x34\x36\x39\x2c\x32\
-\x35\x36\x2c\x33\x37\x33\x2e\x33\x33\x33\x2c\x32\x35\x36\x7a\x22\
-\x2f\x3e\x0a\x09\x3c\x2f\x67\x3e\x0a\x3c\x2f\x67\x3e\x0a\x3c\x2f\
-\x73\x76\x67\x3e\x0a\
-"
-
-qt_resource_name = b"\
-\x00\x05\
-\x00\x6f\xa6\x53\
-\x00\x69\
-\x00\x63\x00\x6f\x00\x6e\x00\x73\
-\x00\x11\
-\x01\x60\xbc\x47\
-\x00\x73\
-\x00\x6f\x00\x63\x00\x69\x00\x61\x00\x6c\x00\x2d\x00\x70\x00\x79\x00\x74\x00\x68\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\
-\x00\x0a\
-\x01\xca\x6d\x87\
-\x00\x62\
-\x00\x75\x00\x63\x00\x6b\x00\x65\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x16\
-\x01\xfb\x76\x27\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x62\x00\x61\x00\x63\
-\x00\x6b\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x13\
-\x03\x24\x75\x47\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x72\x00\x65\x00\x66\x00\x72\x00\x65\x00\x73\x00\x68\x00\x2e\x00\x73\
-\x00\x76\x00\x67\
-\x00\x1c\
-\x04\x66\xe1\x67\
-\x00\x63\
-\x00\x68\x00\x65\x00\x76\x00\x72\x00\x6f\x00\x6e\x00\x2d\x00\x77\x00\x69\x00\x74\x00\x68\x00\x2d\x00\x63\x00\x69\x00\x72\x00\x63\
-\x00\x6c\x00\x65\x00\x2d\x00\x6c\x00\x65\x00\x66\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x10\
-\x04\xa9\x22\xc7\
-\x00\x66\
-\x00\x69\x00\x6c\x00\x6c\x00\x65\x00\x64\x00\x62\x00\x75\x00\x63\x00\x6b\x00\x65\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x12\
-\x04\xb2\x21\x47\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x65\x00\x78\x00\x70\x00\x61\x00\x6e\x00\x64\x00\x2e\x00\x73\x00\x76\
-\x00\x67\
-\x00\x08\
-\x04\xb2\x55\x47\
-\x00\x75\
-\x00\x6e\x00\x64\x00\x6f\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0f\
-\x04\xf2\xa7\x87\
-\x00\x63\
-\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x64\x00\x63\x00\x75\x00\x72\x00\x76\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0d\
-\x05\x20\xce\x87\
-\x00\x6f\
-\x00\x70\x00\x65\x00\x6e\x00\x63\x00\x75\x00\x72\x00\x76\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x08\
-\x05\xa8\x57\x87\
-\x00\x63\
-\x00\x6f\x00\x64\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0e\
-\x05\xed\x38\x67\
-\x00\x61\
-\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x6d\x00\x6f\x00\x76\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x17\
-\x06\xc6\x02\xa7\
-\x00\x74\
-\x00\x72\x00\x69\x00\x61\x00\x6e\x00\x67\x00\x6c\x00\x65\x00\x2d\x00\x73\x00\x74\x00\x72\x00\x6f\x00\x6b\x00\x65\x00\x64\x00\x2d\
-\x00\x31\x00\x35\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x10\
-\x06\xe3\xaf\xe7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x68\x00\x61\x00\x6e\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x1d\
-\x06\xec\xf4\xc7\
-\x00\x63\
-\x00\x68\x00\x65\x00\x76\x00\x72\x00\x6f\x00\x6e\x00\x2d\x00\x77\x00\x69\x00\x74\x00\x68\x00\x2d\x00\x63\x00\x69\x00\x72\x00\x63\
-\x00\x6c\x00\x65\x00\x2d\x00\x72\x00\x69\x00\x67\x00\x68\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0f\
-\x07\x0e\xc4\x87\
-\x00\x6f\
-\x00\x70\x00\x65\x00\x6e\x00\x70\x00\x6f\x00\x6c\x00\x79\x00\x67\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x17\
-\x07\x87\x48\x27\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x66\x00\x6f\x00\x6c\x00\x64\x00\x65\x00\x72\x00\x2d\x00\x6f\x00\x70\
-\x00\x65\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x12\
-\x08\x55\xef\xc7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x64\x00\x65\x00\x6c\x00\x65\x00\x74\x00\x65\x00\x2e\x00\x73\x00\x76\
-\x00\x67\
-\x00\x12\
-\x08\x79\x97\xe7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x63\x00\x61\x00\x6d\x00\x65\x00\x72\x00\x61\x00\x2e\x00\x73\x00\x76\
-\x00\x67\
-\x00\x10\
-\x08\x89\xfa\x47\
-\x00\x63\
-\x00\x65\x00\x6e\x00\x74\x00\x65\x00\x72\x00\x6f\x00\x72\x00\x69\x00\x67\x00\x69\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x1c\
-\x08\x8a\x79\x07\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x72\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x2d\x00\x62\x00\x75\x00\x74\
-\x00\x74\x00\x6f\x00\x6e\x00\x2d\x00\x6f\x00\x66\x00\x66\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x08\
-\x08\xc8\x55\xe7\
-\x00\x73\
-\x00\x61\x00\x76\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x10\
-\x08\xe4\xaf\x47\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x64\x00\x6f\x00\x6e\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x08\
-\x08\xf7\x57\x07\
-\x00\x67\
-\x00\x72\x00\x69\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0f\
-\x09\x76\x60\xc7\
-\x00\x63\
-\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x2d\x00\x72\x00\x6f\x00\x75\x00\x6e\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0a\
-\x0a\x2d\x1b\xc7\
-\x00\x63\
-\x00\x69\x00\x72\x00\x63\x00\x6c\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x19\
-\x0a\x43\x45\xc7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x61\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x66\x00\x6f\x00\x72\
-\x00\x77\x00\x61\x00\x72\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0a\
-\x0a\xc8\x62\x67\
-\x00\x63\
-\x00\x65\x00\x6e\x00\x74\x00\x65\x00\x72\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x08\
-\x0b\x07\x57\xa7\
-\x00\x65\
-\x00\x64\x00\x69\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x09\
-\x0b\x9e\x89\x07\
-\x00\x63\
-\x00\x68\x00\x65\x00\x63\x00\x6b\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x08\
-\x0b\xb2\x55\xc7\
-\x00\x72\
-\x00\x65\x00\x64\x00\x6f\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x10\
-\x0c\x57\x65\x47\
-\x00\x61\
-\x00\x72\x00\x72\x00\x6f\x00\x77\x00\x2d\x00\x72\x00\x65\x00\x73\x00\x69\x00\x7a\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x12\
-\x0c\x5e\xd4\xa7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x6c\x00\x6f\x00\x63\x00\x61\x00\x74\x00\x65\x00\x2e\x00\x73\x00\x76\
-\x00\x67\
-\x00\x09\
-\x0c\x9b\x89\xe7\
-\x00\x62\
-\x00\x72\x00\x75\x00\x73\x00\x68\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x11\
-\x0c\xa7\xc7\x47\
-\x00\x63\
-\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x64\x00\x70\x00\x6f\x00\x6c\x00\x79\x00\x67\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\
-\x00\x11\
-\x0c\xdb\x38\xe7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x63\x00\x6c\x00\x6f\x00\x73\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\
-\x00\x08\
-\x0c\xf7\x55\x87\
-\x00\x74\
-\x00\x65\x00\x78\x00\x74\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x07\
-\x0c\xf8\x5a\x07\
-\x00\x65\
-\x00\x79\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x1b\
-\x0e\xb5\x68\xe7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x72\x00\x61\x00\x64\x00\x69\x00\x6f\x00\x2d\x00\x62\x00\x75\x00\x74\
-\x00\x74\x00\x6f\x00\x6e\x00\x2d\x00\x6f\x00\x6e\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0a\
-\x0f\x68\x53\xe7\
-\x00\x61\
-\x00\x6e\x00\x63\x00\x68\x00\x6f\x00\x72\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x14\
-\x0f\xa5\xe0\xc7\
-\x00\x6d\
-\x00\x61\x00\x67\x00\x6e\x00\x69\x00\x66\x00\x79\x00\x69\x00\x6e\x00\x67\x00\x2d\x00\x67\x00\x6c\x00\x61\x00\x73\x00\x73\x00\x2e\
-\x00\x73\x00\x76\x00\x67\
-\x00\x15\
-\x0f\xc4\x59\xe7\
-\x00\x73\
-\x00\x75\x00\x62\x00\x64\x00\x69\x00\x72\x00\x65\x00\x63\x00\x74\x00\x6f\x00\x72\x00\x79\x00\x2d\x00\x6c\x00\x65\x00\x66\x00\x74\
-\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x0e\
-\x0f\xcb\xd5\xc7\
-\x00\x70\
-\x00\x6c\x00\x75\x00\x73\x00\x2d\x00\x72\x00\x6f\x00\x75\x00\x6e\x00\x64\x00\x2e\x00\x73\x00\x76\x00\x67\
-\x00\x19\
-\x0f\xef\x7b\xe7\
-\x00\x61\
-\x00\x6e\x00\x64\x00\x72\x00\x6f\x00\x69\x00\x64\x00\x2d\x00\x63\x00\x6f\x00\x6c\x00\x6f\x00\x72\x00\x2d\x00\x70\x00\x61\x00\x6c\
-\x00\x65\x00\x74\x00\x74\x00\x65\x00\x2e\x00\x73\x00\x76\x00\x67\
-"
-
-qt_resource_struct_v1 = b"\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2c\x00\x00\x00\x02\
-\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-\x00\x00\x00\x38\x00\x00\x00\x00\x00\x01\x00\x00\x07\x6f\
-\x00\x00\x00\x52\x00\x00\x00\x00\x00\x01\x00\x00\x0d\x0f\
-\x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x0f\x85\
-\x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x12\xa4\
-\x00\x00\x00\xee\x00\x01\x00\x00\x00\x01\x00\x00\x16\x90\
-\x00\x00\x01\x14\x00\x00\x00\x00\x00\x01\x00\x00\x18\xb3\
-\x00\x00\x01\x3e\x00\x00\x00\x00\x00\x01\x00\x00\x1b\xe1\
-\x00\x00\x01\x54\x00\x00\x00\x00\x00\x01\x00\x00\x1f\xfc\
-\x00\x00\x01\x78\x00\x00\x00\x00\x00\x01\x00\x00\x24\xa3\
-\x00\x00\x01\x98\x00\x00\x00\x00\x00\x01\x00\x00\x29\x1a\
-\x00\x00\x01\xae\x00\x00\x00\x00\x00\x01\x00\x00\x2d\xba\
-\x00\x00\x01\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x30\x7f\
-\x00\x00\x02\x04\x00\x00\x00\x00\x00\x01\x00\x00\x35\x4d\
-\x00\x00\x02\x2a\x00\x00\x00\x00\x00\x01\x00\x00\x3b\x0c\
-\x00\x00\x02\x6a\x00\x00\x00\x00\x00\x01\x00\x00\x3e\xe9\
-\x00\x00\x02\x8e\x00\x00\x00\x00\x00\x01\x00\x00\x43\x00\
-\x00\x00\x02\xc2\x00\x00\x00\x00\x00\x01\x00\x00\x46\x4c\
-\x00\x00\x02\xec\x00\x00\x00\x00\x00\x01\x00\x00\x48\xe8\
-\x00\x00\x03\x16\x00\x00\x00\x00\x00\x01\x00\x00\x4c\x02\
-\x00\x00\x03\x3c\x00\x00\x00\x00\x00\x01\x00\x00\x50\x04\
-\x00\x00\x03\x7a\x00\x00\x00\x00\x00\x01\x00\x00\x52\xf8\
-\x00\x00\x03\x90\x00\x00\x00\x00\x00\x01\x00\x00\x55\x93\
-\x00\x00\x03\xb6\x00\x01\x00\x00\x00\x01\x00\x00\x58\x03\
-\x00\x00\x03\xcc\x00\x00\x00\x00\x00\x01\x00\x00\x59\xe4\
-\x00\x00\x03\xf0\x00\x00\x00\x00\x00\x01\x00\x00\x5d\x25\
-\x00\x00\x04\x0a\x00\x00\x00\x00\x00\x01\x00\x00\x60\x10\
-\x00\x00\x04\x42\x00\x00\x00\x00\x00\x01\x00\x00\x62\x86\
-\x00\x00\x04\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x65\xe4\
-\x00\x00\x04\x72\x00\x00\x00\x00\x00\x01\x00\x00\x69\x47\
-\x00\x00\x04\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x6c\x4e\
-\x00\x00\x04\xa0\x00\x00\x00\x00\x00\x01\x00\x00\x70\x94\
-\x00\x00\x04\xc6\x00\x00\x00\x00\x00\x01\x00\x00\x73\x0f\
-\x00\x00\x04\xf0\x00\x00\x00\x00\x00\x01\x00\x00\x77\x67\
-\x00\x00\x05\x08\x00\x00\x00\x00\x00\x01\x00\x00\x7b\x45\
-\x00\x00\x05\x30\x00\x00\x00\x00\x00\x01\x00\x00\x7f\x6b\
-\x00\x00\x05\x58\x00\x00\x00\x00\x00\x01\x00\x00\x82\x1a\
-\x00\x00\x05\x6e\x00\x00\x00\x00\x00\x01\x00\x00\x83\x3a\
-\x00\x00\x05\x82\x00\x00\x00\x00\x00\x01\x00\x00\x87\x1a\
-\x00\x00\x05\xbe\x00\x00\x00\x00\x00\x01\x00\x00\x8a\x5d\
-\x00\x00\x05\xd8\x00\x00\x00\x00\x00\x01\x00\x00\x8b\xca\
-\x00\x00\x06\x06\x00\x00\x00\x00\x00\x01\x00\x00\x8f\x85\
-\x00\x00\x06\x36\x00\x00\x00\x00\x00\x01\x00\x00\x8f\xf5\
-\x00\x00\x06\x58\x00\x00\x00\x00\x00\x01\x00\x00\x92\xe7\
-"
-
-qt_resource_struct_v2 = b"\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
-\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x00\x00\x02\x00\x00\x00\x2c\x00\x00\x00\x02\
-\x00\x00\x00\x00\x00\x00\x00\x00\
-\x00\x00\x00\x10\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x00\x38\x00\x00\x00\x00\x00\x01\x00\x00\x07\x6f\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x00\x52\x00\x00\x00\x00\x00\x01\x00\x00\x0d\x0f\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x00\x84\x00\x00\x00\x00\x00\x01\x00\x00\x0f\x85\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x00\xb0\x00\x00\x00\x00\x00\x01\x00\x00\x12\xa4\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x00\xee\x00\x01\x00\x00\x00\x01\x00\x00\x16\x90\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x01\x14\x00\x00\x00\x00\x00\x01\x00\x00\x18\xb3\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x01\x3e\x00\x00\x00\x00\x00\x01\x00\x00\x1b\xe1\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x01\x54\x00\x00\x00\x00\x00\x01\x00\x00\x1f\xfc\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x01\x78\x00\x00\x00\x00\x00\x01\x00\x00\x24\xa3\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x01\x98\x00\x00\x00\x00\x00\x01\x00\x00\x29\x1a\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x01\xae\x00\x00\x00\x00\x00\x01\x00\x00\x2d\xba\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x01\xd0\x00\x00\x00\x00\x00\x01\x00\x00\x30\x7f\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x02\x04\x00\x00\x00\x00\x00\x01\x00\x00\x35\x4d\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x02\x2a\x00\x00\x00\x00\x00\x01\x00\x00\x3b\x0c\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x02\x6a\x00\x00\x00\x00\x00\x01\x00\x00\x3e\xe9\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x02\x8e\x00\x00\x00\x00\x00\x01\x00\x00\x43\x00\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x02\xc2\x00\x00\x00\x00\x00\x01\x00\x00\x46\x4c\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x02\xec\x00\x00\x00\x00\x00\x01\x00\x00\x48\xe8\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x03\x16\x00\x00\x00\x00\x00\x01\x00\x00\x4c\x02\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x03\x3c\x00\x00\x00\x00\x00\x01\x00\x00\x50\x04\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x03\x7a\x00\x00\x00\x00\x00\x01\x00\x00\x52\xf8\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x03\x90\x00\x00\x00\x00\x00\x01\x00\x00\x55\x93\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x03\xb6\x00\x01\x00\x00\x00\x01\x00\x00\x58\x03\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x03\xcc\x00\x00\x00\x00\x00\x01\x00\x00\x59\xe4\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x03\xf0\x00\x00\x00\x00\x00\x01\x00\x00\x5d\x25\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x04\x0a\x00\x00\x00\x00\x00\x01\x00\x00\x60\x10\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x04\x42\x00\x00\x00\x00\x00\x01\x00\x00\x62\x86\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x04\x5c\x00\x00\x00\x00\x00\x01\x00\x00\x65\xe4\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x04\x72\x00\x00\x00\x00\x00\x01\x00\x00\x69\x47\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x04\x8a\x00\x00\x00\x00\x00\x01\x00\x00\x6c\x4e\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x04\xa0\x00\x00\x00\x00\x00\x01\x00\x00\x70\x94\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x04\xc6\x00\x00\x00\x00\x00\x01\x00\x00\x73\x0f\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x04\xf0\x00\x00\x00\x00\x00\x01\x00\x00\x77\x67\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x05\x08\x00\x00\x00\x00\x00\x01\x00\x00\x7b\x45\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x05\x30\x00\x00\x00\x00\x00\x01\x00\x00\x7f\x6b\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x05\x58\x00\x00\x00\x00\x00\x01\x00\x00\x82\x1a\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x05\x6e\x00\x00\x00\x00\x00\x01\x00\x00\x83\x3a\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x05\x82\x00\x00\x00\x00\x00\x01\x00\x00\x87\x1a\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x05\xbe\x00\x00\x00\x00\x00\x01\x00\x00\x8a\x5d\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-\x00\x00\x05\xd8\x00\x00\x00\x00\x00\x01\x00\x00\x8b\xca\
-\x00\x00\x01\x92\x68\x38\x0e\xb7\
-\x00\x00\x06\x06\x00\x00\x00\x00\x00\x01\x00\x00\x8f\x85\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x06\x36\x00\x00\x00\x00\x00\x01\x00\x00\x8f\xf5\
-\x00\x00\x01\x92\x68\x38\x0e\xb8\
-\x00\x00\x06\x58\x00\x00\x00\x00\x00\x01\x00\x00\x92\xe7\
-\x00\x00\x01\x92\x68\x38\x0e\xb6\
-"
-
-qt_version = [int(v) for v in QtCore.qVersion().split('.')]
-if qt_version < [5, 8, 0]:
- rcc_version = 1
- qt_resource_struct = qt_resource_struct_v1
-else:
- rcc_version = 2
- qt_resource_struct = qt_resource_struct_v2
-
-def qInitResources():
- QtCore.qRegisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-def qCleanupResources():
- QtCore.qUnregisterResourceData(rcc_version, qt_resource_struct, qt_resource_name, qt_resource_data)
-
-qInitResources()
diff --git a/graphics/asymptote/GUI/labelEditor.py b/graphics/asymptote/GUI/labelEditor.py
index 7da1c5f903..4bafd106ee 100644
--- a/graphics/asymptote/GUI/labelEditor.py
+++ b/graphics/asymptote/GUI/labelEditor.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
-from pyUIClass.labelTextEditor import Ui_Dialog
+from xasyqtui.labelTextEditor import Ui_Dialog
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtSvg as QtSvg
import PyQt5.QtGui as QtGui
diff --git a/graphics/asymptote/GUI/pyUIClass/custMatTransform.py b/graphics/asymptote/GUI/pyUIClass/custMatTransform.py
deleted file mode 100644
index 66b64ac9f3..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/custMatTransform.py
+++ /dev/null
@@ -1,175 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/custMatTransform.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Dialog(object):
- def setupUi(self, Dialog):
- Dialog.setObjectName("Dialog")
- Dialog.resize(500, 320)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(Dialog.sizePolicy().hasHeightForWidth())
- Dialog.setSizePolicy(sizePolicy)
- Dialog.setMinimumSize(QtCore.QSize(500, 320))
- Dialog.setMaximumSize(QtCore.QSize(500, 320))
- Dialog.setMouseTracking(False)
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/android-expand.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- Dialog.setWindowIcon(icon)
- Dialog.setSizeGripEnabled(True)
- Dialog.setModal(False)
- self.centralFrame = QtWidgets.QFrame(Dialog)
- self.centralFrame.setGeometry(QtCore.QRect(20, 20, 461, 271))
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.centralFrame.sizePolicy().hasHeightForWidth())
- self.centralFrame.setSizePolicy(sizePolicy)
- self.centralFrame.setBaseSize(QtCore.QSize(0, 0))
- self.centralFrame.setObjectName("centralFrame")
- self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.centralFrame)
- self.verticalLayout_3.setSpacing(4)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
- self.verticalLayout = QtWidgets.QVBoxLayout()
- self.verticalLayout.setObjectName("verticalLayout")
- self.label = QtWidgets.QLabel(self.centralFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
- self.label.setSizePolicy(sizePolicy)
- self.label.setObjectName("label")
- self.verticalLayout.addWidget(self.label)
- self.gridFrame = QtWidgets.QFrame(self.centralFrame)
- self.gridFrame.setFrameShape(QtWidgets.QFrame.Box)
- self.gridFrame.setObjectName("gridFrame")
- self.gridLayout = QtWidgets.QGridLayout(self.gridFrame)
- self.gridLayout.setObjectName("gridLayout")
- self.lineMat00 = QtWidgets.QLineEdit(self.gridFrame)
- self.lineMat00.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMat00.setObjectName("lineMat00")
- self.gridLayout.addWidget(self.lineMat00, 1, 0, 1, 1)
- self.lineMat11 = QtWidgets.QLineEdit(self.gridFrame)
- self.lineMat11.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMat11.setObjectName("lineMat11")
- self.gridLayout.addWidget(self.lineMat11, 2, 1, 1, 1)
- self.lineMat10 = QtWidgets.QLineEdit(self.gridFrame)
- self.lineMat10.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMat10.setObjectName("lineMat10")
- self.gridLayout.addWidget(self.lineMat10, 2, 0, 1, 1)
- self.lineMat01 = QtWidgets.QLineEdit(self.gridFrame)
- self.lineMat01.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMat01.setObjectName("lineMat01")
- self.gridLayout.addWidget(self.lineMat01, 1, 1, 1, 1)
- self.verticalLayout.addWidget(self.gridFrame)
- self.horizontalLayout_3.addLayout(self.verticalLayout)
- spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout_3.addItem(spacerItem)
- self.verticalLayout_4 = QtWidgets.QVBoxLayout()
- self.verticalLayout_4.setObjectName("verticalLayout_4")
- self.label_3 = QtWidgets.QLabel(self.centralFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
- self.label_3.setSizePolicy(sizePolicy)
- self.label_3.setObjectName("label_3")
- self.verticalLayout_4.addWidget(self.label_3)
- self.gridFrame_2 = QtWidgets.QFrame(self.centralFrame)
- self.gridFrame_2.setFrameShape(QtWidgets.QFrame.Box)
- self.gridFrame_2.setObjectName("gridFrame_2")
- self.gridLayout_2 = QtWidgets.QGridLayout(self.gridFrame_2)
- self.gridLayout_2.setObjectName("gridLayout_2")
- self.lineMatTy = QtWidgets.QLineEdit(self.gridFrame_2)
- self.lineMatTy.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMatTy.setObjectName("lineMatTy")
- self.gridLayout_2.addWidget(self.lineMatTy, 2, 1, 1, 1)
- self.lineMatTx = QtWidgets.QLineEdit(self.gridFrame_2)
- self.lineMatTx.setMaximumSize(QtCore.QSize(70, 16777215))
- self.lineMatTx.setObjectName("lineMatTx")
- self.gridLayout_2.addWidget(self.lineMatTx, 1, 1, 1, 1)
- self.verticalLayout_4.addWidget(self.gridFrame_2)
- self.horizontalLayout_3.addLayout(self.verticalLayout_4)
- self.horizontalLayout.addLayout(self.horizontalLayout_3)
- spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.verticalLayout_2 = QtWidgets.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.label_2 = QtWidgets.QLabel(self.centralFrame)
- self.label_2.setObjectName("label_2")
- self.verticalLayout_2.addWidget(self.label_2)
- self.imgPreview = QtWidgets.QLabel(self.centralFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.imgPreview.sizePolicy().hasHeightForWidth())
- self.imgPreview.setSizePolicy(sizePolicy)
- self.imgPreview.setMinimumSize(QtCore.QSize(150, 150))
- self.imgPreview.setBaseSize(QtCore.QSize(300, 300))
- self.imgPreview.setFrameShape(QtWidgets.QFrame.Box)
- self.imgPreview.setText("")
- self.imgPreview.setObjectName("imgPreview")
- self.verticalLayout_2.addWidget(self.imgPreview)
- self.horizontalLayout.addLayout(self.verticalLayout_2)
- self.verticalLayout_3.addLayout(self.horizontalLayout)
- self.lblAnchor = QtWidgets.QLabel(self.centralFrame)
- self.lblAnchor.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
- self.lblAnchor.setObjectName("lblAnchor")
- self.verticalLayout_3.addWidget(self.lblAnchor)
- self.lblCoordsMode = QtWidgets.QLabel(self.centralFrame)
- self.lblCoordsMode.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
- self.lblCoordsMode.setObjectName("lblCoordsMode")
- self.verticalLayout_3.addWidget(self.lblCoordsMode)
- spacerItem2 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
- self.verticalLayout_3.addItem(spacerItem2)
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout_2.addItem(spacerItem3)
- self.btnReset = QtWidgets.QPushButton(self.centralFrame)
- self.btnReset.setObjectName("btnReset")
- self.horizontalLayout_2.addWidget(self.btnReset)
- self.btnCancel = QtWidgets.QPushButton(self.centralFrame)
- self.btnCancel.setObjectName("btnCancel")
- self.horizontalLayout_2.addWidget(self.btnCancel)
- self.btnAccept = QtWidgets.QPushButton(self.centralFrame)
- self.btnAccept.setObjectName("btnAccept")
- self.horizontalLayout_2.addWidget(self.btnAccept)
- self.verticalLayout_3.addLayout(self.horizontalLayout_2)
-
- self.retranslateUi(Dialog)
- QtCore.QMetaObject.connectSlotsByName(Dialog)
-
- def retranslateUi(self, Dialog):
- _translate = QtCore.QCoreApplication.translate
- Dialog.setWindowTitle(_translate("Dialog", "Set Custom Transformation"))
- self.label.setText(_translate("Dialog", "Transformation Matrix"))
- self.lineMat00.setText(_translate("Dialog", "1"))
- self.lineMat11.setText(_translate("Dialog", "1"))
- self.lineMat10.setText(_translate("Dialog", "0"))
- self.lineMat01.setText(_translate("Dialog", "0"))
- self.label_3.setText(_translate("Dialog", "Translation"))
- self.lineMatTy.setText(_translate("Dialog", "0"))
- self.lineMatTx.setText(_translate("Dialog", "0"))
- self.label_2.setText(_translate("Dialog", "Preview:"))
- self.imgPreview.setToolTip(_translate("Dialog", "Shows a red square if transformation determinant is negative."))
- self.lblAnchor.setText(_translate("Dialog", "Anchor: Top Left"))
- self.lblCoordsMode.setText(_translate("Dialog", "Coordinates: Global"))
- self.btnReset.setText(_translate("Dialog", "Reset"))
- self.btnCancel.setText(_translate("Dialog", "Cancel"))
- self.btnAccept.setText(_translate("Dialog", "Accept"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/pyUIClass/labelTextEditor.py b/graphics/asymptote/GUI/pyUIClass/labelTextEditor.py
deleted file mode 100644
index 4ae0707ab3..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/labelTextEditor.py
+++ /dev/null
@@ -1,121 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/labelTextEditor.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Dialog(object):
- def setupUi(self, Dialog):
- Dialog.setObjectName("Dialog")
- Dialog.resize(473, 424)
- self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
- self.verticalLayout.setObjectName("verticalLayout")
- self.frame = QtWidgets.QFrame(Dialog)
- self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
- self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
- self.frame.setObjectName("frame")
- self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.frame)
- self.verticalLayout_3.setObjectName("verticalLayout_3")
- self.gridLayout = QtWidgets.QGridLayout()
- self.gridLayout.setContentsMargins(-1, 0, -1, -1)
- self.gridLayout.setObjectName("gridLayout")
- spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.gridLayout.addItem(spacerItem, 0, 2, 1, 1)
- self.chkMathMode = QtWidgets.QCheckBox(self.frame)
- self.chkMathMode.setObjectName("chkMathMode")
- self.gridLayout.addWidget(self.chkMathMode, 0, 0, 1, 1)
- self.cmbMathStyle = QtWidgets.QComboBox(self.frame)
- self.cmbMathStyle.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.cmbMathStyle.sizePolicy().hasHeightForWidth())
- self.cmbMathStyle.setSizePolicy(sizePolicy)
- self.cmbMathStyle.setMinimumSize(QtCore.QSize(100, 0))
- self.cmbMathStyle.setObjectName("cmbMathStyle")
- self.cmbMathStyle.addItem("")
- self.cmbMathStyle.addItem("")
- self.cmbMathStyle.addItem("")
- self.gridLayout.addWidget(self.cmbMathStyle, 0, 1, 1, 1)
- self.verticalLayout_3.addLayout(self.gridLayout)
- self.verticalLayout_2 = QtWidgets.QVBoxLayout()
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.txtLabelEdit = QtWidgets.QPlainTextEdit(self.frame)
- self.txtLabelEdit.setObjectName("txtLabelEdit")
- self.verticalLayout_2.addWidget(self.txtLabelEdit)
- self.verticalLayout_3.addLayout(self.verticalLayout_2)
- self.verticalLayout_4 = QtWidgets.QVBoxLayout()
- self.verticalLayout_4.setContentsMargins(-1, 0, -1, -1)
- self.verticalLayout_4.setObjectName("verticalLayout_4")
- self.label = QtWidgets.QLabel(self.frame)
- self.label.setObjectName("label")
- self.verticalLayout_4.addWidget(self.label)
- self.lblLabelPreview = QtWidgets.QLabel(self.frame)
- self.lblLabelPreview.setMinimumSize(QtCore.QSize(0, 100))
- self.lblLabelPreview.setFrameShape(QtWidgets.QFrame.Box)
- self.lblLabelPreview.setText("")
- self.lblLabelPreview.setObjectName("lblLabelPreview")
- self.verticalLayout_4.addWidget(self.lblLabelPreview)
- self.verticalLayout_3.addLayout(self.verticalLayout_4)
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.btnGetText = QtWidgets.QPushButton(self.frame)
- self.btnGetText.setMaximumSize(QtCore.QSize(32, 32))
- self.btnGetText.setText("")
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/text.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnGetText.setIcon(icon)
- self.btnGetText.setFlat(True)
- self.btnGetText.setObjectName("btnGetText")
- self.horizontalLayout.addWidget(self.btnGetText)
- self.btnPreview = QtWidgets.QPushButton(self.frame)
- self.btnPreview.setMaximumSize(QtCore.QSize(32, 32))
- self.btnPreview.setText("")
- icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/icons/eye.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnPreview.setIcon(icon1)
- self.btnPreview.setFlat(True)
- self.btnPreview.setObjectName("btnPreview")
- self.horizontalLayout.addWidget(self.btnPreview)
- self.btnCancel = QtWidgets.QPushButton(self.frame)
- self.btnCancel.setMaximumSize(QtCore.QSize(32, 32))
- self.btnCancel.setText("")
- icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/icons/android-close.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnCancel.setIcon(icon2)
- self.btnCancel.setFlat(True)
- self.btnCancel.setObjectName("btnCancel")
- self.horizontalLayout.addWidget(self.btnCancel)
- self.btnAccept = QtWidgets.QPushButton(self.frame)
- self.btnAccept.setMaximumSize(QtCore.QSize(32, 32))
- self.btnAccept.setText("")
- icon3 = QtGui.QIcon()
- icon3.addPixmap(QtGui.QPixmap(":/icons/android-done.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAccept.setIcon(icon3)
- self.btnAccept.setFlat(True)
- self.btnAccept.setObjectName("btnAccept")
- self.horizontalLayout.addWidget(self.btnAccept)
- self.verticalLayout_3.addLayout(self.horizontalLayout)
- self.verticalLayout.addWidget(self.frame)
-
- self.retranslateUi(Dialog)
- QtCore.QMetaObject.connectSlotsByName(Dialog)
-
- def retranslateUi(self, Dialog):
- _translate = QtCore.QCoreApplication.translate
- Dialog.setWindowTitle(_translate("Dialog", "Dialog"))
- self.chkMathMode.setText(_translate("Dialog", "Math Mode"))
- self.cmbMathStyle.setItemText(0, _translate("Dialog", "Inline Style"))
- self.cmbMathStyle.setItemText(1, _translate("Dialog", "Display Style"))
- self.cmbMathStyle.setItemText(2, _translate("Dialog", "Script Style"))
- self.label.setText(_translate("Dialog", "Preview"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/pyUIClass/setCustomAnchor.py b/graphics/asymptote/GUI/pyUIClass/setCustomAnchor.py
deleted file mode 100644
index 9e6e4dfdf1..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/setCustomAnchor.py
+++ /dev/null
@@ -1,57 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/setCustomAnchor.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Dialog(object):
- def setupUi(self, Dialog):
- Dialog.setObjectName("Dialog")
- Dialog.resize(245, 161)
- self.verticalLayoutWidget = QtWidgets.QWidget(Dialog)
- self.verticalLayoutWidget.setGeometry(QtCore.QRect(20, 20, 201, 121))
- self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
- self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
- self.verticalLayout.setContentsMargins(0, 0, 0, 0)
- self.verticalLayout.setObjectName("verticalLayout")
- self.formLayout = QtWidgets.QFormLayout()
- self.formLayout.setFieldGrowthPolicy(QtWidgets.QFormLayout.AllNonFixedFieldsGrow)
- self.formLayout.setObjectName("formLayout")
- self.label = QtWidgets.QLabel(self.verticalLayoutWidget)
- self.label.setObjectName("label")
- self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label)
- self.lineEditX = QtWidgets.QLineEdit(self.verticalLayoutWidget)
- self.lineEditX.setObjectName("lineEditX")
- self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEditX)
- self.label_2 = QtWidgets.QLabel(self.verticalLayoutWidget)
- self.label_2.setObjectName("label_2")
- self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole, self.label_2)
- self.lineEditY = QtWidgets.QLineEdit(self.verticalLayoutWidget)
- self.lineEditY.setObjectName("lineEditY")
- self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole, self.lineEditY)
- self.verticalLayout.addLayout(self.formLayout)
- self.buttonBox = QtWidgets.QDialogButtonBox(self.verticalLayoutWidget)
- self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
- self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Reset)
- self.buttonBox.setObjectName("buttonBox")
- self.verticalLayout.addWidget(self.buttonBox)
-
- self.retranslateUi(Dialog)
- self.buttonBox.accepted.connect(Dialog.accept) # type: ignore
- self.buttonBox.rejected.connect(Dialog.reject) # type: ignore
- QtCore.QMetaObject.connectSlotsByName(Dialog)
-
- def retranslateUi(self, Dialog):
- _translate = QtCore.QCoreApplication.translate
- Dialog.setWindowTitle(_translate("Dialog", "Set Custom Anchor"))
- self.label.setText(_translate("Dialog", "X:"))
- self.lineEditX.setText(_translate("Dialog", "0"))
- self.label_2.setText(_translate("Dialog", "Y:"))
- self.lineEditY.setText(_translate("Dialog", "0"))
diff --git a/graphics/asymptote/GUI/pyUIClass/widg_addLabel.py b/graphics/asymptote/GUI/pyUIClass/widg_addLabel.py
deleted file mode 100644
index 560435b1b5..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/widg_addLabel.py
+++ /dev/null
@@ -1,142 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/widg_addLabel.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Form(object):
- def setupUi(self, Form):
- Form.setObjectName("Form")
- Form.setWindowModality(QtCore.Qt.NonModal)
- Form.resize(599, 35)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
- Form.setSizePolicy(sizePolicy)
- Form.setMinimumSize(QtCore.QSize(0, 35))
- Form.setMaximumSize(QtCore.QSize(16777215, 35))
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
- self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_2.setSpacing(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.txtLabelText = QtWidgets.QLineEdit(Form)
- self.txtLabelText.setObjectName("txtLabelText")
- self.horizontalLayout.addWidget(self.txtLabelText)
- self.btnAdvancedEdit = QtWidgets.QPushButton(Form)
- self.btnAdvancedEdit.setMaximumSize(QtCore.QSize(25, 25))
- self.btnAdvancedEdit.setText("")
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/edit.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAdvancedEdit.setIcon(icon)
- self.btnAdvancedEdit.setFlat(True)
- self.btnAdvancedEdit.setObjectName("btnAdvancedEdit")
- self.horizontalLayout.addWidget(self.btnAdvancedEdit)
- self.label = QtWidgets.QLabel(Form)
- self.label.setObjectName("label")
- self.horizontalLayout.addWidget(self.label)
- self.cmbAlign = QtWidgets.QComboBox(Form)
- self.cmbAlign.setObjectName("cmbAlign")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.cmbAlign.addItem("")
- self.horizontalLayout.addWidget(self.cmbAlign)
- self.label_3 = QtWidgets.QLabel(Form)
- self.label_3.setObjectName("label_3")
- self.horizontalLayout.addWidget(self.label_3)
- self.cmbFontSize = QtWidgets.QComboBox(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.cmbFontSize.sizePolicy().hasHeightForWidth())
- self.cmbFontSize.setSizePolicy(sizePolicy)
- self.cmbFontSize.setEditable(True)
- self.cmbFontSize.setObjectName("cmbFontSize")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.cmbFontSize.addItem("")
- self.horizontalLayout.addWidget(self.cmbFontSize)
- self.label_2 = QtWidgets.QLabel(Form)
- self.label_2.setObjectName("label_2")
- self.horizontalLayout.addWidget(self.label_2)
- self.txtShiftX = QtWidgets.QLineEdit(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.txtShiftX.sizePolicy().hasHeightForWidth())
- self.txtShiftX.setSizePolicy(sizePolicy)
- self.txtShiftX.setMaximumSize(QtCore.QSize(50, 16777215))
- self.txtShiftX.setObjectName("txtShiftX")
- self.horizontalLayout.addWidget(self.txtShiftX)
- self.txtShiftY = QtWidgets.QLineEdit(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.txtShiftY.sizePolicy().hasHeightForWidth())
- self.txtShiftY.setSizePolicy(sizePolicy)
- self.txtShiftY.setMaximumSize(QtCore.QSize(50, 16777215))
- self.txtShiftY.setObjectName("txtShiftY")
- self.horizontalLayout.addWidget(self.txtShiftY)
- spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.horizontalLayout_2.addLayout(self.horizontalLayout)
-
- self.retranslateUi(Form)
- QtCore.QMetaObject.connectSlotsByName(Form)
-
- def retranslateUi(self, Form):
- _translate = QtCore.QCoreApplication.translate
- Form.setWindowTitle(_translate("Form", "Form"))
- self.txtLabelText.setToolTip(_translate("Form", "Number of Sides"))
- self.txtLabelText.setPlaceholderText(_translate("Form", "Text"))
- self.label.setText(_translate("Form", "Align"))
- self.cmbAlign.setItemText(0, _translate("Form", "Center"))
- self.cmbAlign.setItemText(1, _translate("Form", "N"))
- self.cmbAlign.setItemText(2, _translate("Form", "E"))
- self.cmbAlign.setItemText(3, _translate("Form", "W"))
- self.cmbAlign.setItemText(4, _translate("Form", "S"))
- self.cmbAlign.setItemText(5, _translate("Form", "NW"))
- self.cmbAlign.setItemText(6, _translate("Form", "NE"))
- self.cmbAlign.setItemText(7, _translate("Form", "SW"))
- self.cmbAlign.setItemText(8, _translate("Form", "SE"))
- self.cmbAlign.setItemText(9, _translate("Form", "Custom"))
- self.label_3.setText(_translate("Form", "Font Size"))
- self.cmbFontSize.setItemText(0, _translate("Form", "-"))
- self.cmbFontSize.setItemText(1, _translate("Form", "8"))
- self.cmbFontSize.setItemText(2, _translate("Form", "9"))
- self.cmbFontSize.setItemText(3, _translate("Form", "10"))
- self.cmbFontSize.setItemText(4, _translate("Form", "11"))
- self.cmbFontSize.setItemText(5, _translate("Form", "12"))
- self.cmbFontSize.setItemText(6, _translate("Form", "14"))
- self.cmbFontSize.setItemText(7, _translate("Form", "18"))
- self.cmbFontSize.setItemText(8, _translate("Form", "24"))
- self.cmbFontSize.setItemText(9, _translate("Form", "48"))
- self.cmbFontSize.setItemText(10, _translate("Form", "72"))
- self.label_2.setText(_translate("Form", "Custom Align"))
- self.txtShiftX.setPlaceholderText(_translate("Form", "Shift X"))
- self.txtShiftY.setPlaceholderText(_translate("Form", "Shift Y"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/pyUIClass/widg_addPolyOpt.py b/graphics/asymptote/GUI/pyUIClass/widg_addPolyOpt.py
deleted file mode 100644
index 4fa2072e85..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/widg_addPolyOpt.py
+++ /dev/null
@@ -1,61 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/widg_addPolyOpt.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Form(object):
- def setupUi(self, Form):
- Form.setObjectName("Form")
- Form.setWindowModality(QtCore.Qt.NonModal)
- Form.resize(326, 35)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
- Form.setSizePolicy(sizePolicy)
- Form.setMinimumSize(QtCore.QSize(0, 35))
- Form.setMaximumSize(QtCore.QSize(16777215, 35))
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
- self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_2.setSpacing(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.chkInscribed = QtWidgets.QCheckBox(Form)
- self.chkInscribed.setObjectName("chkInscribed")
- self.horizontalLayout.addWidget(self.chkInscribed)
- spacerItem = QtWidgets.QSpacerItem(19, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.label = QtWidgets.QLabel(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.label.sizePolicy().hasHeightForWidth())
- self.label.setSizePolicy(sizePolicy)
- self.label.setObjectName("label")
- self.horizontalLayout.addWidget(self.label)
- self.txtSides = QtWidgets.QLineEdit(Form)
- self.txtSides.setObjectName("txtSides")
- self.horizontalLayout.addWidget(self.txtSides)
- spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.horizontalLayout_2.addLayout(self.horizontalLayout)
-
- self.retranslateUi(Form)
- QtCore.QMetaObject.connectSlotsByName(Form)
-
- def retranslateUi(self, Form):
- _translate = QtCore.QCoreApplication.translate
- Form.setWindowTitle(_translate("Form", "Form"))
- self.chkInscribed.setText(_translate("Form", "Start at Vertex"))
- self.label.setText(_translate("Form", "Sides: "))
- self.txtSides.setToolTip(_translate("Form", "Number of Sides"))
- self.txtSides.setPlaceholderText(_translate("Form", "Sides"))
diff --git a/graphics/asymptote/GUI/pyUIClass/widg_editBezier.py b/graphics/asymptote/GUI/pyUIClass/widg_editBezier.py
deleted file mode 100644
index c44962d300..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/widg_editBezier.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/widg_editBezier.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Form(object):
- def setupUi(self, Form):
- Form.setObjectName("Form")
- Form.setWindowModality(QtCore.Qt.NonModal)
- Form.resize(692, 35)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(Form.sizePolicy().hasHeightForWidth())
- Form.setSizePolicy(sizePolicy)
- Form.setMinimumSize(QtCore.QSize(0, 35))
- Form.setMaximumSize(QtCore.QSize(16777215, 35))
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout(Form)
- self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_2.setSpacing(0)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.cmbLockMode = QtWidgets.QComboBox(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.cmbLockMode.sizePolicy().hasHeightForWidth())
- self.cmbLockMode.setSizePolicy(sizePolicy)
- self.cmbLockMode.setObjectName("cmbLockMode")
- self.cmbLockMode.addItem("")
- self.cmbLockMode.addItem("")
- self.cmbLockMode.addItem("")
- self.horizontalLayout.addWidget(self.cmbLockMode)
- spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.chkRecompute = QtWidgets.QCheckBox(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.chkRecompute.sizePolicy().hasHeightForWidth())
- self.chkRecompute.setSizePolicy(sizePolicy)
- self.chkRecompute.setObjectName("chkRecompute")
- self.horizontalLayout.addWidget(self.chkRecompute)
- self.btnForceRecompute = QtWidgets.QPushButton(Form)
- self.btnForceRecompute.setObjectName("btnForceRecompute")
- self.horizontalLayout.addWidget(self.btnForceRecompute)
- self.btnOk = QtWidgets.QPushButton(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnOk.sizePolicy().hasHeightForWidth())
- self.btnOk.setSizePolicy(sizePolicy)
- self.btnOk.setMaximumSize(QtCore.QSize(25, 25))
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/check.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnOk.setIcon(icon)
- self.btnOk.setFlat(True)
- self.btnOk.setObjectName("btnOk")
- self.horizontalLayout.addWidget(self.btnOk)
- self.btnCancel = QtWidgets.QPushButton(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnCancel.sizePolicy().hasHeightForWidth())
- self.btnCancel.setSizePolicy(sizePolicy)
- self.btnCancel.setMaximumSize(QtCore.QSize(25, 25))
- icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/icons/close-round.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnCancel.setIcon(icon1)
- self.btnCancel.setFlat(True)
- self.btnCancel.setObjectName("btnCancel")
- self.horizontalLayout.addWidget(self.btnCancel)
- self.horizontalLayout_2.addLayout(self.horizontalLayout)
-
- self.retranslateUi(Form)
- self.cmbLockMode.setCurrentIndex(1)
- QtCore.QMetaObject.connectSlotsByName(Form)
-
- def retranslateUi(self, Form):
- _translate = QtCore.QCoreApplication.translate
- Form.setWindowTitle(_translate("Form", "Form"))
- self.cmbLockMode.setItemText(0, _translate("Form", "No Lock"))
- self.cmbLockMode.setItemText(1, _translate("Form", "Lock Angle"))
- self.cmbLockMode.setItemText(2, _translate("Form", "Lock Angle & Scale"))
- self.chkRecompute.setText(_translate("Form", "Recompute Path"))
- self.btnForceRecompute.setText(_translate("Form", "Recompute Once"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/pyUIClass/widgetPointEditor.py b/graphics/asymptote/GUI/pyUIClass/widgetPointEditor.py
deleted file mode 100644
index 25fa684aa9..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/widgetPointEditor.py
+++ /dev/null
@@ -1,98 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/widgetPointEditor.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_Form(object):
- def setupUi(self, Form):
- Form.setObjectName("Form")
- Form.resize(324, 67)
- self.verticalLayout = QtWidgets.QVBoxLayout(Form)
- self.verticalLayout.setObjectName("verticalLayout")
- self.nameLabel = QtWidgets.QLabel(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.nameLabel.sizePolicy().hasHeightForWidth())
- self.nameLabel.setSizePolicy(sizePolicy)
- self.nameLabel.setObjectName("nameLabel")
- self.verticalLayout.addWidget(self.nameLabel)
- self.horizontalLayout = QtWidgets.QHBoxLayout()
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.lineXorA = QtWidgets.QLineEdit(Form)
- self.lineXorA.setEnabled(False)
- self.lineXorA.setReadOnly(False)
- self.lineXorA.setObjectName("lineXorA")
- self.horizontalLayout.addWidget(self.lineXorA)
- self.lineYorM = QtWidgets.QLineEdit(Form)
- self.lineYorM.setEnabled(False)
- self.lineYorM.setAutoFillBackground(False)
- self.lineYorM.setReadOnly(False)
- self.lineYorM.setObjectName("lineYorM")
- self.horizontalLayout.addWidget(self.lineYorM)
- self.btnRelative = QtWidgets.QPushButton(Form)
- self.btnRelative.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnRelative.sizePolicy().hasHeightForWidth())
- self.btnRelative.setSizePolicy(sizePolicy)
- self.btnRelative.setText("")
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/android-locate.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnRelative.setIcon(icon)
- self.btnRelative.setCheckable(True)
- self.btnRelative.setFlat(False)
- self.btnRelative.setObjectName("btnRelative")
- self.horizontalLayout.addWidget(self.btnRelative)
- self.btnPolar = QtWidgets.QPushButton(Form)
- self.btnPolar.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnPolar.sizePolicy().hasHeightForWidth())
- self.btnPolar.setSizePolicy(sizePolicy)
- self.btnPolar.setText("")
- icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/icons/android-radio-button-off.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnPolar.setIcon(icon1)
- self.btnPolar.setCheckable(True)
- self.btnPolar.setFlat(False)
- self.btnPolar.setObjectName("btnPolar")
- self.horizontalLayout.addWidget(self.btnPolar)
- self.btnManualAdj = QtWidgets.QPushButton(Form)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnManualAdj.sizePolicy().hasHeightForWidth())
- self.btnManualAdj.setSizePolicy(sizePolicy)
- self.btnManualAdj.setText("")
- icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/icons/edit.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnManualAdj.setIcon(icon2)
- self.btnManualAdj.setCheckable(True)
- self.btnManualAdj.setFlat(False)
- self.btnManualAdj.setObjectName("btnManualAdj")
- self.horizontalLayout.addWidget(self.btnManualAdj)
- self.verticalLayout.addLayout(self.horizontalLayout)
-
- self.retranslateUi(Form)
- QtCore.QMetaObject.connectSlotsByName(Form)
-
- def retranslateUi(self, Form):
- _translate = QtCore.QCoreApplication.translate
- Form.setWindowTitle(_translate("Form", "Form"))
- self.nameLabel.setText(_translate("Form", "Left Control Point"))
- self.lineXorA.setToolTip(_translate("Form", "X"))
- self.lineXorA.setPlaceholderText(_translate("Form", "X"))
- self.lineYorM.setToolTip(_translate("Form", "X"))
- self.lineYorM.setPlaceholderText(_translate("Form", "Y"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/pyUIClass/window1.py b/graphics/asymptote/GUI/pyUIClass/window1.py
deleted file mode 100644
index 5ca2a134f5..0000000000
--- a/graphics/asymptote/GUI/pyUIClass/window1.py
+++ /dev/null
@@ -1,1013 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Form implementation generated from reading ui file 'GUI/windows/window1.ui'
-#
-# Created by: PyQt5 UI code generator 5.15.10
-#
-# WARNING: Any manual changes made to this file will be lost when pyuic5 is
-# run again. Do not edit this file unless you know what you are doing.
-
-
-from PyQt5 import QtCore, QtGui, QtWidgets
-
-
-class Ui_MainWindow(object):
- def setupUi(self, MainWindow):
- MainWindow.setObjectName("MainWindow")
- MainWindow.resize(1000, 600)
- self.centralwidget = QtWidgets.QWidget(MainWindow)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.centralwidget.sizePolicy().hasHeightForWidth())
- self.centralwidget.setSizePolicy(sizePolicy)
- self.centralwidget.setMouseTracking(True)
- self.centralwidget.setObjectName("centralwidget")
- self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.centralwidget)
- self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout_4.setSpacing(0)
- self.horizontalLayout_4.setObjectName("horizontalLayout_4")
- self.mainWidget = QtWidgets.QWidget(self.centralwidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.mainWidget.sizePolicy().hasHeightForWidth())
- self.mainWidget.setSizePolicy(sizePolicy)
- self.mainWidget.setMouseTracking(True)
- self.mainWidget.setObjectName("mainWidget")
- self.verticalLayout = QtWidgets.QVBoxLayout(self.mainWidget)
- self.verticalLayout.setContentsMargins(2, 2, 2, 2)
- self.verticalLayout.setSpacing(4)
- self.verticalLayout.setObjectName("verticalLayout")
- self.menuFrame = QtWidgets.QFrame(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.menuFrame.sizePolicy().hasHeightForWidth())
- self.menuFrame.setSizePolicy(sizePolicy)
- self.menuFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
- self.menuFrame.setObjectName("menuFrame")
- self.horizontalLayout = QtWidgets.QHBoxLayout(self.menuFrame)
- self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetMinimumSize)
- self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
- self.horizontalLayout.setSpacing(4)
- self.horizontalLayout.setObjectName("horizontalLayout")
- self.btnUndo = QtWidgets.QPushButton(self.menuFrame)
- self.btnUndo.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnUndo.sizePolicy().hasHeightForWidth())
- self.btnUndo.setSizePolicy(sizePolicy)
- self.btnUndo.setMaximumSize(QtCore.QSize(25, 25))
- self.btnUndo.setBaseSize(QtCore.QSize(32, 32))
- self.btnUndo.setText("")
- icon = QtGui.QIcon()
- icon.addPixmap(QtGui.QPixmap(":/icons/undo.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnUndo.setIcon(icon)
- self.btnUndo.setIconSize(QtCore.QSize(16, 16))
- self.btnUndo.setFlat(True)
- self.btnUndo.setObjectName("btnUndo")
- self.horizontalLayout.addWidget(self.btnUndo)
- self.btnRedo = QtWidgets.QPushButton(self.menuFrame)
- self.btnRedo.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnRedo.sizePolicy().hasHeightForWidth())
- self.btnRedo.setSizePolicy(sizePolicy)
- self.btnRedo.setMaximumSize(QtCore.QSize(25, 25))
- self.btnRedo.setBaseSize(QtCore.QSize(32, 32))
- self.btnRedo.setText("")
- icon1 = QtGui.QIcon()
- icon1.addPixmap(QtGui.QPixmap(":/icons/redo.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnRedo.setIcon(icon1)
- self.btnRedo.setIconSize(QtCore.QSize(16, 16))
- self.btnRedo.setFlat(True)
- self.btnRedo.setObjectName("btnRedo")
- self.horizontalLayout.addWidget(self.btnRedo)
- self.btnLoadFile = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnLoadFile.sizePolicy().hasHeightForWidth())
- self.btnLoadFile.setSizePolicy(sizePolicy)
- self.btnLoadFile.setMaximumSize(QtCore.QSize(25, 25))
- self.btnLoadFile.setBaseSize(QtCore.QSize(32, 32))
- self.btnLoadFile.setText("")
- icon2 = QtGui.QIcon()
- icon2.addPixmap(QtGui.QPixmap(":/icons/android-folder-open.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnLoadFile.setIcon(icon2)
- self.btnLoadFile.setIconSize(QtCore.QSize(16, 16))
- self.btnLoadFile.setFlat(True)
- self.btnLoadFile.setObjectName("btnLoadFile")
- self.horizontalLayout.addWidget(self.btnLoadFile)
- self.btnSave = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSave.sizePolicy().hasHeightForWidth())
- self.btnSave.setSizePolicy(sizePolicy)
- self.btnSave.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSave.setBaseSize(QtCore.QSize(32, 32))
- self.btnSave.setText("")
- icon3 = QtGui.QIcon()
- icon3.addPixmap(QtGui.QPixmap(":/icons/save.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSave.setIcon(icon3)
- self.btnSave.setIconSize(QtCore.QSize(16, 16))
- self.btnSave.setFlat(True)
- self.btnSave.setObjectName("btnSave")
- self.horizontalLayout.addWidget(self.btnSave)
- self.btnViewCode = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnViewCode.sizePolicy().hasHeightForWidth())
- self.btnViewCode.setSizePolicy(sizePolicy)
- self.btnViewCode.setMaximumSize(QtCore.QSize(24, 24))
- self.btnViewCode.setBaseSize(QtCore.QSize(20, 20))
- self.btnViewCode.setText("")
- icon4 = QtGui.QIcon()
- icon4.addPixmap(QtGui.QPixmap(":/icons/code.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnViewCode.setIcon(icon4)
- self.btnViewCode.setIconSize(QtCore.QSize(16, 16))
- self.btnViewCode.setFlat(True)
- self.btnViewCode.setObjectName("btnViewCode")
- self.horizontalLayout.addWidget(self.btnViewCode)
- self.btnQuickScreenshot = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnQuickScreenshot.sizePolicy().hasHeightForWidth())
- self.btnQuickScreenshot.setSizePolicy(sizePolicy)
- self.btnQuickScreenshot.setMaximumSize(QtCore.QSize(25, 25))
- self.btnQuickScreenshot.setBaseSize(QtCore.QSize(32, 32))
- self.btnQuickScreenshot.setText("")
- icon5 = QtGui.QIcon()
- icon5.addPixmap(QtGui.QPixmap(":/icons/android-camera.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnQuickScreenshot.setIcon(icon5)
- self.btnQuickScreenshot.setIconSize(QtCore.QSize(16, 16))
- self.btnQuickScreenshot.setFlat(True)
- self.btnQuickScreenshot.setObjectName("btnQuickScreenshot")
- self.horizontalLayout.addWidget(self.btnQuickScreenshot)
- spacerItem = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem)
- self.btnDrawAxes = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnDrawAxes.sizePolicy().hasHeightForWidth())
- self.btnDrawAxes.setSizePolicy(sizePolicy)
- self.btnDrawAxes.setMaximumSize(QtCore.QSize(25, 25))
- self.btnDrawAxes.setBaseSize(QtCore.QSize(32, 32))
- font = QtGui.QFont()
- font.setFamily("Roboto")
- font.setBold(True)
- font.setWeight(75)
- self.btnDrawAxes.setFont(font)
- self.btnDrawAxes.setText("")
- icon6 = QtGui.QIcon()
- icon6.addPixmap(QtGui.QPixmap(":/icons/plus-round.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnDrawAxes.setIcon(icon6)
- self.btnDrawAxes.setIconSize(QtCore.QSize(16, 16))
- self.btnDrawAxes.setCheckable(True)
- self.btnDrawAxes.setChecked(True)
- self.btnDrawAxes.setFlat(True)
- self.btnDrawAxes.setObjectName("btnDrawAxes")
- self.horizontalLayout.addWidget(self.btnDrawAxes)
- self.btnDrawGrid = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnDrawGrid.sizePolicy().hasHeightForWidth())
- self.btnDrawGrid.setSizePolicy(sizePolicy)
- self.btnDrawGrid.setMaximumSize(QtCore.QSize(25, 25))
- self.btnDrawGrid.setBaseSize(QtCore.QSize(32, 32))
- font = QtGui.QFont()
- font.setFamily("Roboto")
- font.setBold(True)
- font.setWeight(75)
- self.btnDrawGrid.setFont(font)
- self.btnDrawGrid.setText("")
- icon7 = QtGui.QIcon()
- icon7.addPixmap(QtGui.QPixmap(":/icons/grid.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnDrawGrid.setIcon(icon7)
- self.btnDrawGrid.setIconSize(QtCore.QSize(16, 16))
- self.btnDrawGrid.setCheckable(True)
- self.btnDrawGrid.setChecked(False)
- self.btnDrawGrid.setFlat(True)
- self.btnDrawGrid.setObjectName("btnDrawGrid")
- self.horizontalLayout.addWidget(self.btnDrawGrid)
- self.btnSetZoom = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSetZoom.sizePolicy().hasHeightForWidth())
- self.btnSetZoom.setSizePolicy(sizePolicy)
- self.btnSetZoom.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSetZoom.setBaseSize(QtCore.QSize(32, 32))
- self.btnSetZoom.setText("")
- icon8 = QtGui.QIcon()
- icon8.addPixmap(QtGui.QPixmap(":/icons/magnifying-glass.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSetZoom.setIcon(icon8)
- self.btnSetZoom.setIconSize(QtCore.QSize(16, 16))
- self.btnSetZoom.setFlat(True)
- self.btnSetZoom.setObjectName("btnSetZoom")
- self.horizontalLayout.addWidget(self.btnSetZoom)
- self.btnPanCenter = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnPanCenter.sizePolicy().hasHeightForWidth())
- self.btnPanCenter.setSizePolicy(sizePolicy)
- self.btnPanCenter.setMaximumSize(QtCore.QSize(25, 25))
- self.btnPanCenter.setBaseSize(QtCore.QSize(32, 32))
- self.btnPanCenter.setText("")
- icon9 = QtGui.QIcon()
- icon9.addPixmap(QtGui.QPixmap(":/icons/center.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnPanCenter.setIcon(icon9)
- self.btnPanCenter.setIconSize(QtCore.QSize(16, 16))
- self.btnPanCenter.setFlat(True)
- self.btnPanCenter.setObjectName("btnPanCenter")
- self.horizontalLayout.addWidget(self.btnPanCenter)
- self.btnResetPan = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnResetPan.sizePolicy().hasHeightForWidth())
- self.btnResetPan.setSizePolicy(sizePolicy)
- self.btnResetPan.setMaximumSize(QtCore.QSize(25, 25))
- self.btnResetPan.setBaseSize(QtCore.QSize(32, 32))
- self.btnResetPan.setText("")
- icon10 = QtGui.QIcon()
- icon10.addPixmap(QtGui.QPixmap(":/icons/centerorigin.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnResetPan.setIcon(icon10)
- self.btnResetPan.setIconSize(QtCore.QSize(16, 16))
- self.btnResetPan.setFlat(True)
- self.btnResetPan.setObjectName("btnResetPan")
- self.horizontalLayout.addWidget(self.btnResetPan)
- self.btnAlignX = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAlignX.sizePolicy().hasHeightForWidth())
- self.btnAlignX.setSizePolicy(sizePolicy)
- self.btnAlignX.setMaximumSize(QtCore.QSize(32, 25))
- self.btnAlignX.setBaseSize(QtCore.QSize(32, 32))
- font = QtGui.QFont()
- font.setFamily("Roboto")
- font.setBold(True)
- font.setWeight(75)
- self.btnAlignX.setFont(font)
- self.btnAlignX.setIconSize(QtCore.QSize(16, 16))
- self.btnAlignX.setCheckable(True)
- self.btnAlignX.setFlat(True)
- self.btnAlignX.setObjectName("btnAlignX")
- self.horizontalLayout.addWidget(self.btnAlignX)
- self.btnAlignY = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAlignY.sizePolicy().hasHeightForWidth())
- self.btnAlignY.setSizePolicy(sizePolicy)
- self.btnAlignY.setMaximumSize(QtCore.QSize(32, 25))
- self.btnAlignY.setBaseSize(QtCore.QSize(32, 32))
- font = QtGui.QFont()
- font.setFamily("Roboto")
- font.setBold(True)
- font.setWeight(75)
- self.btnAlignY.setFont(font)
- self.btnAlignY.setIconSize(QtCore.QSize(16, 16))
- self.btnAlignY.setCheckable(True)
- self.btnAlignY.setFlat(True)
- self.btnAlignY.setObjectName("btnAlignY")
- self.horizontalLayout.addWidget(self.btnAlignY)
- spacerItem1 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem1)
- self.btnSelectEdit = QtWidgets.QPushButton(self.menuFrame)
- self.btnSelectEdit.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSelectEdit.sizePolicy().hasHeightForWidth())
- self.btnSelectEdit.setSizePolicy(sizePolicy)
- self.btnSelectEdit.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSelectEdit.setText("")
- icon11 = QtGui.QIcon()
- icon11.addPixmap(QtGui.QPixmap(":/icons/edit.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSelectEdit.setIcon(icon11)
- self.btnSelectEdit.setIconSize(QtCore.QSize(16, 16))
- self.btnSelectEdit.setCheckable(True)
- self.btnSelectEdit.setFlat(True)
- self.btnSelectEdit.setObjectName("btnSelectEdit")
- self.horizontalLayout.addWidget(self.btnSelectEdit)
- self.btnDeleteMode = QtWidgets.QPushButton(self.menuFrame)
- self.btnDeleteMode.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnDeleteMode.sizePolicy().hasHeightForWidth())
- self.btnDeleteMode.setSizePolicy(sizePolicy)
- self.btnDeleteMode.setMaximumSize(QtCore.QSize(25, 25))
- self.btnDeleteMode.setBaseSize(QtCore.QSize(32, 32))
- self.btnDeleteMode.setText("")
- icon12 = QtGui.QIcon()
- icon12.addPixmap(QtGui.QPixmap(":/icons/android-delete.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnDeleteMode.setIcon(icon12)
- self.btnDeleteMode.setIconSize(QtCore.QSize(16, 16))
- self.btnDeleteMode.setCheckable(True)
- self.btnDeleteMode.setFlat(True)
- self.btnDeleteMode.setObjectName("btnDeleteMode")
- self.horizontalLayout.addWidget(self.btnDeleteMode)
- spacerItem2 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem2)
- self.btnPan = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnPan.sizePolicy().hasHeightForWidth())
- self.btnPan.setSizePolicy(sizePolicy)
- self.btnPan.setMaximumSize(QtCore.QSize(25, 25))
- self.btnPan.setBaseSize(QtCore.QSize(32, 32))
- self.btnPan.setText("")
- icon13 = QtGui.QIcon()
- icon13.addPixmap(QtGui.QPixmap(":/icons/android-hand.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnPan.setIcon(icon13)
- self.btnPan.setIconSize(QtCore.QSize(16, 16))
- self.btnPan.setCheckable(True)
- self.btnPan.setFlat(True)
- self.btnPan.setObjectName("btnPan")
- self.horizontalLayout.addWidget(self.btnPan)
- self.btnTranslate = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnTranslate.sizePolicy().hasHeightForWidth())
- self.btnTranslate.setSizePolicy(sizePolicy)
- self.btnTranslate.setMaximumSize(QtCore.QSize(25, 25))
- self.btnTranslate.setBaseSize(QtCore.QSize(32, 32))
- self.btnTranslate.setText("")
- icon14 = QtGui.QIcon()
- icon14.addPixmap(QtGui.QPixmap(":/icons/arrow-move.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnTranslate.setIcon(icon14)
- self.btnTranslate.setIconSize(QtCore.QSize(16, 16))
- self.btnTranslate.setCheckable(True)
- self.btnTranslate.setChecked(True)
- self.btnTranslate.setFlat(True)
- self.btnTranslate.setObjectName("btnTranslate")
- self.horizontalLayout.addWidget(self.btnTranslate)
- self.btnScale = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnScale.sizePolicy().hasHeightForWidth())
- self.btnScale.setSizePolicy(sizePolicy)
- self.btnScale.setMaximumSize(QtCore.QSize(25, 25))
- self.btnScale.setBaseSize(QtCore.QSize(32, 32))
- self.btnScale.setText("")
- icon15 = QtGui.QIcon()
- icon15.addPixmap(QtGui.QPixmap(":/icons/arrow-resize.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnScale.setIcon(icon15)
- self.btnScale.setIconSize(QtCore.QSize(16, 16))
- self.btnScale.setCheckable(True)
- self.btnScale.setFlat(True)
- self.btnScale.setObjectName("btnScale")
- self.horizontalLayout.addWidget(self.btnScale)
- self.btnRotate = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnRotate.sizePolicy().hasHeightForWidth())
- self.btnRotate.setSizePolicy(sizePolicy)
- self.btnRotate.setMaximumSize(QtCore.QSize(25, 25))
- self.btnRotate.setBaseSize(QtCore.QSize(32, 32))
- self.btnRotate.setText("")
- icon16 = QtGui.QIcon()
- icon16.addPixmap(QtGui.QPixmap(":/icons/android-refresh.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnRotate.setIcon(icon16)
- self.btnRotate.setIconSize(QtCore.QSize(16, 16))
- self.btnRotate.setCheckable(True)
- self.btnRotate.setFlat(True)
- self.btnRotate.setObjectName("btnRotate")
- self.horizontalLayout.addWidget(self.btnRotate)
- spacerItem3 = QtWidgets.QSpacerItem(20, 20, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem3)
- self.btnAnchor = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAnchor.sizePolicy().hasHeightForWidth())
- self.btnAnchor.setSizePolicy(sizePolicy)
- self.btnAnchor.setMaximumSize(QtCore.QSize(25, 25))
- self.btnAnchor.setBaseSize(QtCore.QSize(32, 32))
- self.btnAnchor.setText("")
- icon17 = QtGui.QIcon()
- icon17.addPixmap(QtGui.QPixmap(":/icons/anchor.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAnchor.setIcon(icon17)
- self.btnAnchor.setIconSize(QtCore.QSize(16, 16))
- self.btnAnchor.setCheckable(True)
- self.btnAnchor.setChecked(False)
- self.btnAnchor.setFlat(True)
- self.btnAnchor.setObjectName("btnAnchor")
- self.horizontalLayout.addWidget(self.btnAnchor)
- self.comboAnchor = QtWidgets.QComboBox(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.comboAnchor.sizePolicy().hasHeightForWidth())
- self.comboAnchor.setSizePolicy(sizePolicy)
- self.comboAnchor.setMinimumSize(QtCore.QSize(127, 0))
- self.comboAnchor.setMaximumSize(QtCore.QSize(127, 25))
- self.comboAnchor.setLayoutDirection(QtCore.Qt.LeftToRight)
- self.comboAnchor.setEditable(False)
- self.comboAnchor.setInsertPolicy(QtWidgets.QComboBox.InsertAtCurrent)
- self.comboAnchor.setSizeAdjustPolicy(QtWidgets.QComboBox.AdjustToContentsOnFirstShow)
- self.comboAnchor.setIconSize(QtCore.QSize(0, 0))
- self.comboAnchor.setDuplicatesEnabled(False)
- self.comboAnchor.setFrame(False)
- self.comboAnchor.setModelColumn(0)
- self.comboAnchor.setObjectName("comboAnchor")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.comboAnchor.addItem("")
- self.horizontalLayout.addWidget(self.comboAnchor)
- self.btnToggleVisible = QtWidgets.QPushButton(self.menuFrame)
- self.btnToggleVisible.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnToggleVisible.sizePolicy().hasHeightForWidth())
- self.btnToggleVisible.setSizePolicy(sizePolicy)
- self.btnToggleVisible.setMaximumSize(QtCore.QSize(25, 25))
- self.btnToggleVisible.setBaseSize(QtCore.QSize(32, 32))
- self.btnToggleVisible.setText("")
- icon18 = QtGui.QIcon()
- icon18.addPixmap(QtGui.QPixmap(":/icons/eye.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnToggleVisible.setIcon(icon18)
- self.btnToggleVisible.setIconSize(QtCore.QSize(16, 16))
- self.btnToggleVisible.setCheckable(False)
- self.btnToggleVisible.setFlat(True)
- self.btnToggleVisible.setObjectName("btnToggleVisible")
- self.horizontalLayout.addWidget(self.btnToggleVisible)
- self.btnCustTransform = QtWidgets.QPushButton(self.menuFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnCustTransform.sizePolicy().hasHeightForWidth())
- self.btnCustTransform.setSizePolicy(sizePolicy)
- self.btnCustTransform.setMaximumSize(QtCore.QSize(25, 25))
- self.btnCustTransform.setBaseSize(QtCore.QSize(32, 32))
- self.btnCustTransform.setText("")
- icon19 = QtGui.QIcon()
- icon19.addPixmap(QtGui.QPixmap(":/icons/android-expand.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnCustTransform.setIcon(icon19)
- self.btnCustTransform.setIconSize(QtCore.QSize(16, 16))
- self.btnCustTransform.setFlat(True)
- self.btnCustTransform.setObjectName("btnCustTransform")
- self.horizontalLayout.addWidget(self.btnCustTransform)
- self.btnSendBackwards = QtWidgets.QPushButton(self.menuFrame)
- self.btnSendBackwards.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSendBackwards.sizePolicy().hasHeightForWidth())
- self.btnSendBackwards.setSizePolicy(sizePolicy)
- self.btnSendBackwards.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSendBackwards.setBaseSize(QtCore.QSize(32, 32))
- self.btnSendBackwards.setText("")
- icon20 = QtGui.QIcon()
- icon20.addPixmap(QtGui.QPixmap(":/icons/chevron-with-circle-left.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSendBackwards.setIcon(icon20)
- self.btnSendBackwards.setIconSize(QtCore.QSize(16, 16))
- self.btnSendBackwards.setFlat(True)
- self.btnSendBackwards.setObjectName("btnSendBackwards")
- self.horizontalLayout.addWidget(self.btnSendBackwards)
- self.btnSendForwards = QtWidgets.QPushButton(self.menuFrame)
- self.btnSendForwards.setEnabled(False)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSendForwards.sizePolicy().hasHeightForWidth())
- self.btnSendForwards.setSizePolicy(sizePolicy)
- self.btnSendForwards.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSendForwards.setBaseSize(QtCore.QSize(32, 32))
- self.btnSendForwards.setText("")
- icon21 = QtGui.QIcon()
- icon21.addPixmap(QtGui.QPixmap(":/icons/chevron-with-circle-right.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSendForwards.setIcon(icon21)
- self.btnSendForwards.setIconSize(QtCore.QSize(16, 16))
- self.btnSendForwards.setFlat(True)
- self.btnSendForwards.setObjectName("btnSendForwards")
- self.horizontalLayout.addWidget(self.btnSendForwards)
- spacerItem4 = QtWidgets.QSpacerItem(40, 25, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
- self.horizontalLayout.addItem(spacerItem4)
- self.btnUndo.raise_()
- self.btnRedo.raise_()
- self.btnLoadFile.raise_()
- self.btnSave.raise_()
- self.btnViewCode.raise_()
- self.btnQuickScreenshot.raise_()
- self.btnDrawAxes.raise_()
- self.btnDrawGrid.raise_()
- self.btnSetZoom.raise_()
- self.btnPanCenter.raise_()
- self.btnResetPan.raise_()
- self.btnAlignX.raise_()
- self.btnAlignY.raise_()
- self.btnPan.raise_()
- self.btnTranslate.raise_()
- self.btnScale.raise_()
- self.btnCustTransform.raise_()
- self.btnSendBackwards.raise_()
- self.btnSendForwards.raise_()
- self.comboAnchor.raise_()
- self.btnToggleVisible.raise_()
- self.btnAnchor.raise_()
- self.btnRotate.raise_()
- self.btnSelectEdit.raise_()
- self.btnDeleteMode.raise_()
- self.verticalLayout.addWidget(self.menuFrame)
- self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
- self.horizontalLayout_2.setSpacing(4)
- self.horizontalLayout_2.setObjectName("horizontalLayout_2")
- self.verticalLayout_2 = QtWidgets.QVBoxLayout()
- self.verticalLayout_2.setSpacing(3)
- self.verticalLayout_2.setObjectName("verticalLayout_2")
- self.addOption = QtWidgets.QHBoxLayout()
- self.addOption.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
- self.addOption.setContentsMargins(6, -1, -1, 0)
- self.addOption.setSpacing(6)
- self.addOption.setObjectName("addOption")
- self.btnFill = QtWidgets.QPushButton(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnFill.sizePolicy().hasHeightForWidth())
- self.btnFill.setSizePolicy(sizePolicy)
- self.btnFill.setMaximumSize(QtCore.QSize(32, 32))
- self.btnFill.setBaseSize(QtCore.QSize(32, 32))
- self.btnFill.setAutoFillBackground(False)
- self.btnFill.setStyleSheet("")
- self.btnFill.setText("")
- icon22 = QtGui.QIcon()
- icon22.addPixmap(QtGui.QPixmap(":/icons/bucket.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- icon22.addPixmap(QtGui.QPixmap(":/icons/filledbucket.svg"), QtGui.QIcon.Normal, QtGui.QIcon.On)
- self.btnFill.setIcon(icon22)
- self.btnFill.setIconSize(QtCore.QSize(16, 16))
- self.btnFill.setCheckable(True)
- self.btnFill.setDefault(False)
- self.btnFill.setFlat(True)
- self.btnFill.setObjectName("btnFill")
- self.addOption.addWidget(self.btnFill)
- self.addOptionLayout = QtWidgets.QGridLayout()
- self.addOptionLayout.setSpacing(6)
- self.addOptionLayout.setObjectName("addOptionLayout")
- self.addOption.addLayout(self.addOptionLayout)
- spacerItem5 = QtWidgets.QSpacerItem(40, 35, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Minimum)
- self.addOption.addItem(spacerItem5)
- self.label = QtWidgets.QLabel(self.mainWidget)
- self.label.setObjectName("label")
- self.addOption.addWidget(self.label)
- self.txtLineWidth = QtWidgets.QLineEdit(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.txtLineWidth.sizePolicy().hasHeightForWidth())
- self.txtLineWidth.setSizePolicy(sizePolicy)
- self.txtLineWidth.setMaximumSize(QtCore.QSize(75, 16777215))
- self.txtLineWidth.setObjectName("txtLineWidth")
- self.addOption.addWidget(self.txtLineWidth)
- self.frameCurrColor = QtWidgets.QFrame(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.frameCurrColor.sizePolicy().hasHeightForWidth())
- self.frameCurrColor.setSizePolicy(sizePolicy)
- self.frameCurrColor.setMinimumSize(QtCore.QSize(15, 15))
- self.frameCurrColor.setAutoFillBackground(False)
- self.frameCurrColor.setStyleSheet("QFrame{ \n"
-"padding: 4.0;\n"
-"border-radius: 3.0; \n"
-"background: rgb(0, 0, 0)\n"
-"}")
- self.frameCurrColor.setFrameShape(QtWidgets.QFrame.StyledPanel)
- self.frameCurrColor.setFrameShadow(QtWidgets.QFrame.Sunken)
- self.frameCurrColor.setObjectName("frameCurrColor")
- self.addOption.addWidget(self.frameCurrColor)
- self.btnSelectColor = QtWidgets.QPushButton(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Fixed)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnSelectColor.sizePolicy().hasHeightForWidth())
- self.btnSelectColor.setSizePolicy(sizePolicy)
- self.btnSelectColor.setMaximumSize(QtCore.QSize(25, 25))
- self.btnSelectColor.setBaseSize(QtCore.QSize(32, 32))
- self.btnSelectColor.setAutoFillBackground(False)
- self.btnSelectColor.setStyleSheet("")
- self.btnSelectColor.setText("")
- icon23 = QtGui.QIcon()
- icon23.addPixmap(QtGui.QPixmap(":/icons/android-color-palette.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnSelectColor.setIcon(icon23)
- self.btnSelectColor.setIconSize(QtCore.QSize(16, 16))
- self.btnSelectColor.setDefault(False)
- self.btnSelectColor.setFlat(True)
- self.btnSelectColor.setObjectName("btnSelectColor")
- self.addOption.addWidget(self.btnSelectColor)
- self.verticalLayout_2.addLayout(self.addOption)
- self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
- self.horizontalLayout_7.setContentsMargins(-1, 6, -1, -1)
- self.horizontalLayout_7.setSpacing(6)
- self.horizontalLayout_7.setObjectName("horizontalLayout_7")
- self.formFrame = QtWidgets.QFrame(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Preferred)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.formFrame.sizePolicy().hasHeightForWidth())
- self.formFrame.setSizePolicy(sizePolicy)
- self.formFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
- self.formFrame.setFrameShadow(QtWidgets.QFrame.Plain)
- self.formFrame.setLineWidth(0)
- self.formFrame.setObjectName("formFrame")
- self.formLayout = QtWidgets.QFormLayout(self.formFrame)
- self.formLayout.setContentsMargins(0, 0, 0, 0)
- self.formLayout.setSpacing(0)
- self.formLayout.setObjectName("formLayout")
- self.btnOpenPoly = QtWidgets.QPushButton(self.formFrame)
- self.btnOpenPoly.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnOpenPoly.sizePolicy().hasHeightForWidth())
- self.btnOpenPoly.setSizePolicy(sizePolicy)
- self.btnOpenPoly.setMaximumSize(QtCore.QSize(32, 32))
- self.btnOpenPoly.setText("")
- icon24 = QtGui.QIcon()
- icon24.addPixmap(QtGui.QPixmap(":/icons/openpolygon.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnOpenPoly.setIcon(icon24)
- self.btnOpenPoly.setIconSize(QtCore.QSize(16, 16))
- self.btnOpenPoly.setCheckable(True)
- self.btnOpenPoly.setFlat(True)
- self.btnOpenPoly.setObjectName("btnOpenPoly")
- self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.btnOpenPoly)
- self.btnClosedPoly = QtWidgets.QPushButton(self.formFrame)
- self.btnClosedPoly.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnClosedPoly.sizePolicy().hasHeightForWidth())
- self.btnClosedPoly.setSizePolicy(sizePolicy)
- self.btnClosedPoly.setMaximumSize(QtCore.QSize(32, 32))
- self.btnClosedPoly.setText("")
- icon25 = QtGui.QIcon()
- icon25.addPixmap(QtGui.QPixmap(":/icons/closedpolygon.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnClosedPoly.setIcon(icon25)
- self.btnClosedPoly.setIconSize(QtCore.QSize(16, 16))
- self.btnClosedPoly.setCheckable(True)
- self.btnClosedPoly.setFlat(True)
- self.btnClosedPoly.setObjectName("btnClosedPoly")
- self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.btnClosedPoly)
- self.btnOpenCurve = QtWidgets.QPushButton(self.formFrame)
- self.btnOpenCurve.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnOpenCurve.sizePolicy().hasHeightForWidth())
- self.btnOpenCurve.setSizePolicy(sizePolicy)
- self.btnOpenCurve.setMaximumSize(QtCore.QSize(32, 32))
- self.btnOpenCurve.setText("")
- icon26 = QtGui.QIcon()
- icon26.addPixmap(QtGui.QPixmap(":/icons/opencurve.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnOpenCurve.setIcon(icon26)
- self.btnOpenCurve.setIconSize(QtCore.QSize(16, 16))
- self.btnOpenCurve.setCheckable(True)
- self.btnOpenCurve.setFlat(True)
- self.btnOpenCurve.setObjectName("btnOpenCurve")
- self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.btnOpenCurve)
- self.btnClosedCurve = QtWidgets.QPushButton(self.formFrame)
- self.btnClosedCurve.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnClosedCurve.sizePolicy().hasHeightForWidth())
- self.btnClosedCurve.setSizePolicy(sizePolicy)
- self.btnClosedCurve.setMaximumSize(QtCore.QSize(32, 32))
- self.btnClosedCurve.setText("")
- icon27 = QtGui.QIcon()
- icon27.addPixmap(QtGui.QPixmap(":/icons/closedcurve.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnClosedCurve.setIcon(icon27)
- self.btnClosedCurve.setIconSize(QtCore.QSize(16, 16))
- self.btnClosedCurve.setCheckable(True)
- self.btnClosedCurve.setFlat(True)
- self.btnClosedCurve.setObjectName("btnClosedCurve")
- self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole, self.btnClosedCurve)
- self.btnAddPoly = QtWidgets.QPushButton(self.formFrame)
- self.btnAddPoly.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAddPoly.sizePolicy().hasHeightForWidth())
- self.btnAddPoly.setSizePolicy(sizePolicy)
- self.btnAddPoly.setMaximumSize(QtCore.QSize(32, 32))
- self.btnAddPoly.setText("")
- icon28 = QtGui.QIcon()
- icon28.addPixmap(QtGui.QPixmap(":/icons/triangle-stroked-15.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAddPoly.setIcon(icon28)
- self.btnAddPoly.setIconSize(QtCore.QSize(16, 16))
- self.btnAddPoly.setCheckable(True)
- self.btnAddPoly.setFlat(True)
- self.btnAddPoly.setObjectName("btnAddPoly")
- self.formLayout.setWidget(8, QtWidgets.QFormLayout.LabelRole, self.btnAddPoly)
- self.btnAddCircle = QtWidgets.QPushButton(self.formFrame)
- self.btnAddCircle.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAddCircle.sizePolicy().hasHeightForWidth())
- self.btnAddCircle.setSizePolicy(sizePolicy)
- self.btnAddCircle.setMaximumSize(QtCore.QSize(32, 32))
- self.btnAddCircle.setText("")
- icon29 = QtGui.QIcon()
- icon29.addPixmap(QtGui.QPixmap(":/icons/circle.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAddCircle.setIcon(icon29)
- self.btnAddCircle.setIconSize(QtCore.QSize(16, 16))
- self.btnAddCircle.setCheckable(True)
- self.btnAddCircle.setFlat(True)
- self.btnAddCircle.setObjectName("btnAddCircle")
- self.formLayout.setWidget(10, QtWidgets.QFormLayout.LabelRole, self.btnAddCircle)
- self.btnAddLabel = QtWidgets.QPushButton(self.formFrame)
- self.btnAddLabel.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAddLabel.sizePolicy().hasHeightForWidth())
- self.btnAddLabel.setSizePolicy(sizePolicy)
- self.btnAddLabel.setMaximumSize(QtCore.QSize(32, 32))
- self.btnAddLabel.setText("")
- icon30 = QtGui.QIcon()
- icon30.addPixmap(QtGui.QPixmap(":/icons/text.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAddLabel.setIcon(icon30)
- self.btnAddLabel.setIconSize(QtCore.QSize(16, 16))
- self.btnAddLabel.setCheckable(True)
- self.btnAddLabel.setFlat(True)
- self.btnAddLabel.setObjectName("btnAddLabel")
- self.formLayout.setWidget(11, QtWidgets.QFormLayout.LabelRole, self.btnAddLabel)
- self.btnAddFreehand = QtWidgets.QPushButton(self.formFrame)
- self.btnAddFreehand.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnAddFreehand.sizePolicy().hasHeightForWidth())
- self.btnAddFreehand.setSizePolicy(sizePolicy)
- self.btnAddFreehand.setMaximumSize(QtCore.QSize(32, 32))
- self.btnAddFreehand.setText("")
- icon31 = QtGui.QIcon()
- icon31.addPixmap(QtGui.QPixmap(":/icons/brush.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnAddFreehand.setIcon(icon31)
- self.btnAddFreehand.setIconSize(QtCore.QSize(16, 16))
- self.btnAddFreehand.setCheckable(True)
- self.btnAddFreehand.setFlat(True)
- self.btnAddFreehand.setObjectName("btnAddFreehand")
- self.formLayout.setWidget(12, QtWidgets.QFormLayout.LabelRole, self.btnAddFreehand)
- self.horizontalLayout_7.addWidget(self.formFrame)
- self.imgFrame = QtWidgets.QFrame(self.mainWidget)
- self.imgFrame.setMinimumSize(QtCore.QSize(0, 6))
- self.imgFrame.setMouseTracking(True)
- self.imgFrame.setFrameShape(QtWidgets.QFrame.NoFrame)
- self.imgFrame.setFrameShadow(QtWidgets.QFrame.Raised)
- self.imgFrame.setObjectName("imgFrame")
- self.gridLayout = QtWidgets.QGridLayout(self.imgFrame)
- self.gridLayout.setContentsMargins(0, 0, 0, 0)
- self.gridLayout.setSpacing(0)
- self.gridLayout.setObjectName("gridLayout")
- self.imgLabel = QtWidgets.QLabel(self.imgFrame)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.imgLabel.sizePolicy().hasHeightForWidth())
- self.imgLabel.setSizePolicy(sizePolicy)
- self.imgLabel.setMouseTracking(True)
- self.imgLabel.setFrameShape(QtWidgets.QFrame.Panel)
- self.imgLabel.setText("")
- self.imgLabel.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
- self.imgLabel.setObjectName("imgLabel")
- self.gridLayout.addWidget(self.imgLabel, 0, 1, 1, 1)
- self.horizontalLayout_7.addWidget(self.imgFrame)
- self.verticalLayout_2.addLayout(self.horizontalLayout_7)
- self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
- self.horizontalLayout_3.setSizeConstraint(QtWidgets.QLayout.SetDefaultConstraint)
- self.horizontalLayout_3.setContentsMargins(-1, 0, -1, -1)
- self.horizontalLayout_3.setSpacing(0)
- self.horizontalLayout_3.setObjectName("horizontalLayout_3")
- self.btnTogglePython = QtWidgets.QPushButton(self.mainWidget)
- self.btnTogglePython.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnTogglePython.sizePolicy().hasHeightForWidth())
- self.btnTogglePython.setSizePolicy(sizePolicy)
- self.btnTogglePython.setText("")
- icon32 = QtGui.QIcon()
- icon32.addPixmap(QtGui.QPixmap(":/icons/social-python.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnTogglePython.setIcon(icon32)
- self.btnTogglePython.setIconSize(QtCore.QSize(16, 16))
- self.btnTogglePython.setCheckable(True)
- self.btnTogglePython.setFlat(True)
- self.btnTogglePython.setObjectName("btnTogglePython")
- self.horizontalLayout_3.addWidget(self.btnTogglePython)
- self.txtTerminalPrompt = QtWidgets.QLineEdit(self.mainWidget)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.txtTerminalPrompt.sizePolicy().hasHeightForWidth())
- self.txtTerminalPrompt.setSizePolicy(sizePolicy)
- self.txtTerminalPrompt.setObjectName("txtTerminalPrompt")
- self.horizontalLayout_3.addWidget(self.txtTerminalPrompt)
- self.btnEnterCommand = QtWidgets.QPushButton(self.mainWidget)
- self.btnEnterCommand.setEnabled(True)
- sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
- sizePolicy.setHorizontalStretch(0)
- sizePolicy.setVerticalStretch(0)
- sizePolicy.setHeightForWidth(self.btnEnterCommand.sizePolicy().hasHeightForWidth())
- self.btnEnterCommand.setSizePolicy(sizePolicy)
- self.btnEnterCommand.setText("")
- icon33 = QtGui.QIcon()
- icon33.addPixmap(QtGui.QPixmap(":/icons/subdirectory-left.svg"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
- self.btnEnterCommand.setIcon(icon33)
- self.btnEnterCommand.setIconSize(QtCore.QSize(16, 16))
- self.btnEnterCommand.setFlat(True)
- self.btnEnterCommand.setObjectName("btnEnterCommand")
- self.horizontalLayout_3.addWidget(self.btnEnterCommand)
- self.verticalLayout_2.addLayout(self.horizontalLayout_3)
- self.horizontalLayout_2.addLayout(self.verticalLayout_2)
- self.verticalLayout.addLayout(self.horizontalLayout_2)
- self.horizontalLayout_4.addWidget(self.mainWidget)
- MainWindow.setCentralWidget(self.centralwidget)
- self.menubar = QtWidgets.QMenuBar(MainWindow)
- self.menubar.setGeometry(QtCore.QRect(0, 0, 1000, 26))
- self.menubar.setObjectName("menubar")
- self.menuFIle = QtWidgets.QMenu(self.menubar)
- self.menuFIle.setObjectName("menuFIle")
- self.menuOpenRecent = QtWidgets.QMenu(self.menuFIle)
- self.menuOpenRecent.setObjectName("menuOpenRecent")
- self.menuEdit = QtWidgets.QMenu(self.menubar)
- self.menuEdit.setObjectName("menuEdit")
- self.menuOptions = QtWidgets.QMenu(self.menubar)
- self.menuOptions.setObjectName("menuOptions")
- self.menuHelp = QtWidgets.QMenu(self.menubar)
- self.menuHelp.setObjectName("menuHelp")
- self.menuTools = QtWidgets.QMenu(self.menubar)
- self.menuTools.setObjectName("menuTools")
- MainWindow.setMenuBar(self.menubar)
- self.statusbar = QtWidgets.QStatusBar(MainWindow)
- self.statusbar.setSizeGripEnabled(False)
- self.statusbar.setObjectName("statusbar")
- MainWindow.setStatusBar(self.statusbar)
- self.actionAbout = QtWidgets.QAction(MainWindow)
- self.actionAbout.setObjectName("actionAbout")
- self.actionManual = QtWidgets.QAction(MainWindow)
- self.actionManual.setObjectName("actionManual")
- self.actionSettings = QtWidgets.QAction(MainWindow)
- self.actionSettings.setObjectName("actionSettings")
- self.actionPause = QtWidgets.QAction(MainWindow)
- self.actionPause.setObjectName("actionPause")
- self.actionSaveAs = QtWidgets.QAction(MainWindow)
- self.actionSaveAs.setObjectName("actionSaveAs")
- self.actionEnterCommand = QtWidgets.QAction(MainWindow)
- self.actionEnterCommand.setObjectName("actionEnterCommand")
- self.actionQuit = QtWidgets.QAction(MainWindow)
- self.actionQuit.setObjectName("actionQuit")
- self.actionUndo = QtWidgets.QAction(MainWindow)
- self.actionUndo.setEnabled(False)
- self.actionUndo.setObjectName("actionUndo")
- self.actionRedo = QtWidgets.QAction(MainWindow)
- self.actionRedo.setEnabled(False)
- self.actionRedo.setObjectName("actionRedo")
- self.actionShow_Grid = QtWidgets.QAction(MainWindow)
- self.actionShow_Grid.setObjectName("actionShow_Grid")
- self.actionShow_Local_Grid = QtWidgets.QAction(MainWindow)
- self.actionShow_Local_Grid.setObjectName("actionShow_Local_Grid")
- self.actionTransform = QtWidgets.QAction(MainWindow)
- self.actionTransform.setObjectName("actionTransform")
- self.actionExportAsymptote = QtWidgets.QAction(MainWindow)
- self.actionExportAsymptote.setObjectName("actionExportAsymptote")
- self.actionSave = QtWidgets.QAction(MainWindow)
- self.actionSave.setObjectName("actionSave")
- self.actionOpen = QtWidgets.QAction(MainWindow)
- self.actionOpen.setObjectName("actionOpen")
- self.actionClearRecent = QtWidgets.QAction(MainWindow)
- self.actionClearRecent.setObjectName("actionClearRecent")
- self.actionNewFile = QtWidgets.QAction(MainWindow)
- self.actionNewFile.setObjectName("actionNewFile")
- self.actionExportToAsy = QtWidgets.QAction(MainWindow)
- self.actionExportToAsy.setObjectName("actionExportToAsy")
- self.actionKeymaps = QtWidgets.QAction(MainWindow)
- self.actionKeymaps.setObjectName("actionKeymaps")
- self.menuOpenRecent.addSeparator()
- self.menuOpenRecent.addAction(self.actionClearRecent)
- self.menuFIle.addAction(self.actionNewFile)
- self.menuFIle.addAction(self.actionOpen)
- self.menuFIle.addAction(self.menuOpenRecent.menuAction())
- self.menuFIle.addAction(self.actionSave)
- self.menuFIle.addAction(self.actionSaveAs)
- self.menuFIle.addAction(self.actionExportToAsy)
- self.menuFIle.addAction(self.actionExportAsymptote)
- self.menuFIle.addSeparator()
- self.menuFIle.addAction(self.actionQuit)
- self.menuEdit.addAction(self.actionUndo)
- self.menuEdit.addAction(self.actionRedo)
- self.menuEdit.addSeparator()
- self.menuOptions.addAction(self.actionSettings)
- self.menuOptions.addAction(self.actionKeymaps)
- self.menuHelp.addAction(self.actionManual)
- self.menuHelp.addAction(self.actionAbout)
- self.menuTools.addAction(self.actionEnterCommand)
- self.menubar.addAction(self.menuFIle.menuAction())
- self.menubar.addAction(self.menuEdit.menuAction())
- self.menubar.addAction(self.menuOptions.menuAction())
- self.menubar.addAction(self.menuTools.menuAction())
- self.menubar.addAction(self.menuHelp.menuAction())
-
- self.retranslateUi(MainWindow)
- self.comboAnchor.setCurrentIndex(0)
- QtCore.QMetaObject.connectSlotsByName(MainWindow)
-
- def retranslateUi(self, MainWindow):
- _translate = QtCore.QCoreApplication.translate
- MainWindow.setWindowTitle(_translate("MainWindow", "xasy"))
- self.btnUndo.setToolTip(_translate("MainWindow", "Undo"))
- self.btnRedo.setToolTip(_translate("MainWindow", "Redo"))
- self.btnLoadFile.setToolTip(_translate("MainWindow", "<html><head/><body><p>Open file</p></body></html>"))
- self.btnSave.setToolTip(_translate("MainWindow", "<html><head/><body><p>Save file</p></body></html>"))
- self.btnViewCode.setToolTip(_translate("MainWindow", "<html><head/><body><p>Edit code</p></body></html>"))
- self.btnQuickScreenshot.setToolTip(_translate("MainWindow", "<html><head/><body><p>Screenshot</p></body></html>"))
- self.btnDrawAxes.setToolTip(_translate("MainWindow", "<html><head/><body><p>Toggle display axes</p></body></html>"))
- self.btnDrawGrid.setToolTip(_translate("MainWindow", "<html><head/><body><p>Toggle grid</p></body></html>"))
- self.btnSetZoom.setToolTip(_translate("MainWindow", "Zoom"))
- self.btnPanCenter.setToolTip(_translate("MainWindow", "<html><head/><body><p>Center</p></body></html>"))
- self.btnResetPan.setToolTip(_translate("MainWindow", "<html><head/><body><p>Center about origin</p></body></html>"))
- self.btnAlignX.setToolTip(_translate("MainWindow", "<html><head/><body><p>Lock transform to X axis</p></body></html>"))
- self.btnAlignX.setText(_translate("MainWindow", "X"))
- self.btnAlignY.setToolTip(_translate("MainWindow", "<html><head/><body><p>Lock transform to Y axis</p></body></html>"))
- self.btnAlignY.setText(_translate("MainWindow", "Y"))
- self.btnSelectEdit.setToolTip(_translate("MainWindow", "<html><head/><body><p>Bézier editor</p></body></html>"))
- self.btnDeleteMode.setToolTip(_translate("MainWindow", "<html><head/><body><p>Delete</p></body></html>"))
- self.btnPan.setToolTip(_translate("MainWindow", "Pan"))
- self.btnTranslate.setToolTip(_translate("MainWindow", "Translate"))
- self.btnScale.setToolTip(_translate("MainWindow", "Scale"))
- self.btnRotate.setToolTip(_translate("MainWindow", "Rotate"))
- self.btnAnchor.setToolTip(_translate("MainWindow", "<html><head/><body><p>Set custom anchor</p></body></html>"))
- self.comboAnchor.setToolTip(_translate("MainWindow", "<html><head/><body><p>Anchor</p></body></html>"))
- self.comboAnchor.setCurrentText(_translate("MainWindow", "Center"))
- self.comboAnchor.setItemText(0, _translate("MainWindow", "Center"))
- self.comboAnchor.setItemText(1, _translate("MainWindow", "Origin"))
- self.comboAnchor.setItemText(2, _translate("MainWindow", "Top Left"))
- self.comboAnchor.setItemText(3, _translate("MainWindow", "Top Right"))
- self.comboAnchor.setItemText(4, _translate("MainWindow", "Bottom Right"))
- self.comboAnchor.setItemText(5, _translate("MainWindow", "Bottom Left"))
- self.comboAnchor.setItemText(6, _translate("MainWindow", "Custom"))
- self.btnCustTransform.setToolTip(_translate("MainWindow", "<html><head/><body><p><br/></p></body></html>"))
- self.btnSendBackwards.setToolTip(_translate("MainWindow", "<html><head/><body><p><br/></p></body></html>"))
- self.btnSendForwards.setToolTip(_translate("MainWindow", "Translate"))
- self.btnFill.setToolTip(_translate("MainWindow", "<html><head/><body><p>Toggle fill/outline</p></body></html>"))
- self.label.setText(_translate("MainWindow", "Line Width:"))
- self.txtLineWidth.setToolTip(_translate("MainWindow", "<html><head/><body><p>Current pen width</p></body></html>"))
- self.frameCurrColor.setToolTip(_translate("MainWindow", "<html><head/><body><p>Current pen color</p></body></html>"))
- self.btnSelectColor.setToolTip(_translate("MainWindow", "<html><head/><body><p>Set color</p></body></html>"))
- self.btnOpenPoly.setToolTip(_translate("MainWindow", "<html><head/><body><p>Open polygon</p></body></html>"))
- self.btnClosedPoly.setToolTip(_translate("MainWindow", "<html><head/><body><p>Closed polygon</p></body></html>"))
- self.btnOpenCurve.setToolTip(_translate("MainWindow", "<html><head/><body><p>Open Bézier curve</p></body></html>"))
- self.btnClosedCurve.setToolTip(_translate("MainWindow", "<html><head/><body><p>Closed Bézier curve</p></body></html>"))
- self.btnAddPoly.setToolTip(_translate("MainWindow", "<html><head/><body><p>Regular polygon</p></body></html>"))
- self.btnAddCircle.setToolTip(_translate("MainWindow", "<html><head/><body><p>Circle</p></body></html>"))
- self.btnAddLabel.setToolTip(_translate("MainWindow", "<html><head/><body><p>Text</p></body></html>"))
- self.btnAddFreehand.setToolTip(_translate("MainWindow", "<html><head/><body><p>Freehand</p></body></html>"))
- self.menuFIle.setTitle(_translate("MainWindow", "&File"))
- self.menuOpenRecent.setTitle(_translate("MainWindow", "Open Recent"))
- self.menuEdit.setTitle(_translate("MainWindow", "&Edit"))
- self.menuOptions.setTitle(_translate("MainWindow", "Optio&ns"))
- self.menuHelp.setTitle(_translate("MainWindow", "&Help"))
- self.menuTools.setTitle(_translate("MainWindow", "&Tools"))
- self.actionAbout.setText(_translate("MainWindow", "&About"))
- self.actionManual.setText(_translate("MainWindow", "&Manual"))
- self.actionSettings.setText(_translate("MainWindow", "&Settings"))
- self.actionPause.setText(_translate("MainWindow", "Pause "))
- self.actionSaveAs.setText(_translate("MainWindow", "&Save as"))
- self.actionEnterCommand.setText(_translate("MainWindow", "&Enter Command"))
- self.actionQuit.setText(_translate("MainWindow", "&Quit"))
- self.actionUndo.setText(_translate("MainWindow", "&Undo"))
- self.actionRedo.setText(_translate("MainWindow", "&Redo"))
- self.actionShow_Grid.setText(_translate("MainWindow", "&Show Grid"))
- self.actionShow_Local_Grid.setText(_translate("MainWindow", "Show &Local Grid"))
- self.actionTransform.setText(_translate("MainWindow", "&Transform"))
- self.actionExportAsymptote.setText(_translate("MainWindow", "Export as..."))
- self.actionSave.setText(_translate("MainWindow", "Save"))
- self.actionOpen.setText(_translate("MainWindow", "Open"))
- self.actionClearRecent.setText(_translate("MainWindow", "Clear Menu"))
- self.actionNewFile.setText(_translate("MainWindow", "New File"))
- self.actionExportToAsy.setText(_translate("MainWindow", "Export as Asy"))
- self.actionKeymaps.setText(_translate("MainWindow", "&Keymaps"))
-import icons_rc
diff --git a/graphics/asymptote/GUI/requirements.dev.txt b/graphics/asymptote/GUI/requirements.dev.txt
new file mode 100644
index 0000000000..6558ee69c9
--- /dev/null
+++ b/graphics/asymptote/GUI/requirements.dev.txt
@@ -0,0 +1,2 @@
+click~=8.1.7
+setuptools~=70.0.0
diff --git a/graphics/asymptote/GUI/requirements.txt b/graphics/asymptote/GUI/requirements.txt
index 6e0a44196a..54b2478792 100644
--- a/graphics/asymptote/GUI/requirements.txt
+++ b/graphics/asymptote/GUI/requirements.txt
@@ -1,4 +1,3 @@
-numpy==1.22.0
-cson==0.7
-PyQt5==5.11
-rsvg-convert==2.42.3
+numpy~=1.26.4
+cson~=0.8
+PyQt5~=5.15.0
diff --git a/graphics/asymptote/GUI/setup.py b/graphics/asymptote/GUI/setup.py
index a1b25d809a..10491f12d8 100644
--- a/graphics/asymptote/GUI/setup.py
+++ b/graphics/asymptote/GUI/setup.py
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
-import xasyVersion
+from xasyversion import version
from setuptools import setup
setup(
name="xasy",
- version=xasyVersion.xasyVersion,
+ version=version.VERSION,
author="Supakorn Rassameemasmuang, Orest Shardt, and John C. Bowman",
description="User interface for Asymptote, a vector graphics language",
url="https://asymptote.sourceforge.io",
diff --git a/graphics/asymptote/GUI/xasy.py b/graphics/asymptote/GUI/xasy.py
index a078690b68..84eaf689a8 100755
--- a/graphics/asymptote/GUI/xasy.py
+++ b/graphics/asymptote/GUI/xasy.py
@@ -1,6 +1,11 @@
#!/usr/bin/env python3
-import sys, signal, os
+import sys
+import pathlib
+
+sys.path.append(str(pathlib.Path(__file__).resolve().parent))
+
+import signal, os
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtCore as QtCore
from Window1 import MainWindow1
diff --git a/graphics/asymptote/GUI/xasy2asy.py b/graphics/asymptote/GUI/xasy2asy.py
index cf1edb8af0..52403da38f 100644
--- a/graphics/asymptote/GUI/xasy2asy.py
+++ b/graphics/asymptote/GUI/xasy2asy.py
@@ -30,6 +30,8 @@ import queue
import io
import atexit
import DebugFlags
+import threading
+from typing import Optional
import xasyUtils as xu
import xasyArgs as xa
@@ -70,7 +72,14 @@ class AsymptoteEngine:
"""
xasy=chr(4)+'\n'
- def __init__(self, path=None, keepFiles=DebugFlags.keepFiles, keepDefaultArgs=True):
+ def __init__(
+ self,
+ path=None,
+ addrArgsParam: Optional[list[str]] = None,
+ keepFiles=DebugFlags.keepFiles,
+ keepDefaultArgs=True
+ ):
+ addrArgs = addrArgsParam or []
if path is None:
path = xa.getArgs().asypath
if path is None:
@@ -92,10 +101,7 @@ class AsymptoteEngine:
self.istream = os.fdopen(ra, 'r')
self.keepFiles = keepFiles
- if sys.platform[:3] == 'win':
- self.tmpdir = tempfile.mkdtemp(prefix='xasyData_',dir='./')+'/'
- else:
- self.tmpdir = tempfile.mkdtemp(prefix='xasyData_')+os.sep
+ self.tmpdir = tempfile.mkdtemp(prefix='xasyData_')+os.sep
if xa.getArgs().render:
renderDensity=xa.getArgs().render
@@ -106,7 +112,15 @@ class AsymptoteEngine:
renderDensity = 2
renderDensity=max(renderDensity,1)
- self.args=['-xasy', '-noV', '-q', '-outformat=', '-inpipe=' + str(rx), '-outpipe=' + str(wa), '-render='+str(renderDensity), '-o', self.tmpdir]
+ self.args=addrArgs + [
+ '-xasy',
+ '-noV',
+ '-q',
+ '-outformat=',
+ '-inpipe=' + str(rx),
+ '-outpipe=' + str(wa),
+ '-render='+str(renderDensity),
+ '-o', self.tmpdir]
self.asyPath = path
self.asyProcess = None
@@ -115,9 +129,11 @@ class AsymptoteEngine:
""" starts a subprocess (opens a pipe) """
try:
if sys.platform[:3] == 'win':
- self.asyProcess = subprocess.Popen([self.asyPath] + self.args,
- stdin=subprocess.PIPE, stderr=subprocess.PIPE,
- universal_newlines=True)
+ self.asyProcess = subprocess.Popen(
+ [self.asyPath] + self.args,
+ stdin=subprocess.PIPE, stderr=subprocess.PIPE,
+ text=True
+ )
self.ostream = self.asyProcess.stdin
self.istream = self.asyProcess.stderr
else:
@@ -584,23 +600,6 @@ class asyPath(asyObj):
return newObj
- @classmethod
- def fromBezierPoints(cls, pointList: list, engine=None):
- if not pointList:
- return None
- assert isinstance(pointList[0], BezierCurveEditor.BezierPoint)
- nodeList = []
- controlList = []
- for point in pointList:
- nodeList.append(BezierCurveEditor.QPoint2Tuple(point.point))
- if point.rCtrlPoint is not None: # first
- controlList.append([BezierCurveEditor.QPoint2Tuple(point.rCtrlPoint)])
- if point.lCtrlPoint is not None: # last
- controlList[-1].append(BezierCurveEditor.QPoint2Tuple(point.lCtrlPoint))
- newPath = asyPath(asyengine=engine)
- newPath.initFromControls(nodeList, controlList)
- return newPath
-
def setInfo(self, path):
self.nodeSet = copy.copy(path.nodeSet)
self.linkSet = copy.copy(path.linkSet)
diff --git a/graphics/asymptote/GUI/xasyArgs.py b/graphics/asymptote/GUI/xasyArgs.py
index b9e1518f1e..30c8c17755 100644
--- a/graphics/asymptote/GUI/xasyArgs.py
+++ b/graphics/asymptote/GUI/xasyArgs.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
import argparse
-import xasyVersion
+from xasyversion.version import VERSION as xasyVersion
import PyQt5.QtCore as QtCore
# Add arguments here.
@@ -11,7 +11,7 @@ def parseArgs(args):
help='Custom path to asy executable')
parser.add_argument('-v', '-version', '--version',
help='Version number', action='version',
- version='xasy v{0}'.format(xasyVersion.xasyVersion))
+ version='xasy v{0}'.format(xasyVersion))
parser.add_argument('-l', '-language', '--language',
help='language')
parser.add_argument('-x', '-mag', '--mag',
@@ -20,6 +20,11 @@ def parseArgs(args):
parser.add_argument('-render', '--render',
help='Number of pixels per bp in 3D rendered bitmaps',
default=None, type=float)
+ parser.add_argument('-additional-asy-args', '--additional-asy-args',
+ help='Comma-separated values of additional arguments to pass'
+ 'to Asymptote',
+ dest='additionalAsyArgs',
+ type=str, default=None)
parser.add_argument(
'filename',
help='Filename to load (if omitted, initialize blank canvas)',
diff --git a/graphics/asymptote/GUI/xasyFile.py b/graphics/asymptote/GUI/xasyFile.py
index 1c1251d238..6cf8be2c74 100644
--- a/graphics/asymptote/GUI/xasyFile.py
+++ b/graphics/asymptote/GUI/xasyFile.py
@@ -66,14 +66,18 @@ def extractTransformsFromFile(fileStr):
return final_str, transfDict
def xasy2asyCode(xasyItems, asy2psmap):
- asyCode = ''
- for item in xasyItems:
- asyCode += item.getTransformCode(asy2psmap)
- for item in xasyItems:
- asyCode += item.getObjectCode(asy2psmap)
-
- asyCode += 'size('+str(asy2psmap*xasy2asy.yflip())+'); '+ xasy2asy.xasyItem.resizeComment+'\n'
- return asyCode
+ with io.StringIO() as asyCode:
+ for item in xasyItems:
+ asyCode.write(item.getTransformCode(asy2psmap))
+ for item in xasyItems:
+ asyCode.write(item.getObjectCode(asy2psmap))
+
+ asyCode.write(
+ 'size('+str(asy2psmap*xasy2asy.yflip())+'); ' +
+ xasy2asy.xasyItem.resizeComment +
+ '\n'
+ )
+ return asyCode.getvalue()
def saveFile(file, xasyItems, asy2psmap):
"""Write a list of xasyItems to a file"""
diff --git a/graphics/asymptote/GUI/xasyOptions.py b/graphics/asymptote/GUI/xasyOptions.py
index 458dd9cb3c..c8ecc8581c 100644
--- a/graphics/asymptote/GUI/xasyOptions.py
+++ b/graphics/asymptote/GUI/xasyOptions.py
@@ -68,8 +68,16 @@ class xasyOptions:
self.options = self.defaultOptions()
self.load()
- def __getitem__(self, item):
- return self.options[item]
+ def __getitem__(self, key):
+ return self.options[key]
+
+ def __contains__(self, key):
+ return key in self.options
+
+ def get(self, key, default=None):
+ if key not in self.options:
+ return default
+ return self.options[key]
def __setitem__(self, key, value):
self.options[key] = value
@@ -91,9 +99,10 @@ class xasyOptions:
except (IOError, ModuleNotFoundError):
self.setDefaults()
else:
- for key in self.options.keys():
+ for key, val in self.options.items():
if key in newOptions:
- assert isinstance(newOptions[key], type(self.options[key]))
+ if val is not None:
+ assert isinstance(newOptions[key], type(val))
else:
newOptions[key] = self.options[key]
self.options = newOptions
diff --git a/graphics/asymptote/GUI/xasySvg.py b/graphics/asymptote/GUI/xasySvg.py
index 7261dc5b69..a4624f51fd 100644
--- a/graphics/asymptote/GUI/xasySvg.py
+++ b/graphics/asymptote/GUI/xasySvg.py
@@ -1,22 +1,38 @@
#!/usr/bin/env python3
-
import PyQt5.QtGui as QtGui
import PyQt5.QtWidgets as QtWidgets
-import io
import subprocess
import sys
+import xasyOptions as xo
+
-class SvgObject():
+class SvgObject:
def __init__(self, file: str):
- self.file=file
+ self.file = file
+
+ def _create_call_arguments(self, dpi: int):
+ settings = xo.BasicConfigs.defaultOpt
+ return [
+ settings.get("rsvgConverterPath") or "rsvg-convert",
+ f"--dpi-x={dpi}",
+ f"--dpi-y={dpi}",
+ "--format=png",
+ self.file,
+ ]
- def render(self, dpi:int) -> QtGui.QImage:
+ def render(self, dpi: int) -> QtGui.QImage:
+ callArgs = self._create_call_arguments(dpi)
try:
- rawDataProc = subprocess.Popen(['rsvg-convert', '--dpi-x', str(dpi),
- '--dpi-y', str(dpi), self.file],
- stdout=subprocess.PIPE)
- except:
- QtWidgets.QMessageBox.about(None,'rsvg-convert missing','Please install rsvg-convert version >= 2.40 in your path.')
+ rawDataProc = subprocess.run(
+ callArgs,
+ stdout=subprocess.PIPE,
+ )
+ except OSError:
+ QtWidgets.QMessageBox.about(
+ None,
+ "rsvg-convert missing",
+ "Please install rsvg-convert version >= 2.40 is available.",
+ )
sys.exit(-1)
- return QtGui.QImage.fromData(rawDataProc.stdout.read(), 'PNG')
+ return QtGui.QImage.fromData(rawDataProc.stdout, "PNG")
diff --git a/graphics/asymptote/INSTALL b/graphics/asymptote/INSTALL
deleted file mode 100644
index f4e0dd8937..0000000000
--- a/graphics/asymptote/INSTALL
+++ /dev/null
@@ -1,275 +0,0 @@
-Compiling Asymptote from a Source Release
-=========================================
-
-To compile and install Asymptote version x.xx from a source release:
-
-gunzip asymptote-x.xx.src.tgz
-tar -xf asymptote-x.xx.src.tar
-cd asymptote-x.xx
-./configure
-make all
-make install
-
-The last command requires root privileges. To install without root privileges
-you should change the first line to
-
-./configure --prefix=$HOME/asymptote
-
-If you get errors from a broken texinfo or pdftex installation, simply put
-https://asymptote.sourceforge.io/asymptote.pdf
-in the doc directory and repeat the commands make all and make install.
-
-For a list of configure options, type
-
-configure --help
-
-See also the generic configure instructions below.
-
-Compiling Asymptote from Git Developmental Source Code
-=============================================================
-
-To compile from Git developmental source code:
-
-git clone https://github.com/vectorgraphics/asymptote
-cd asymptote
-./autogen.sh
-./configure
-make all
-make install
-
-Optional packages:
-
-* Fast Fourier Transform library
- https://www.fftw.org/
-
- Version requirement >= 3.0
-
-* The GNU Scientific Library for numerical analysis:
- https://www.gnu.org/software/gsl/
-
-*****************************************
-Generic Configure Instructions (advanced)
-*****************************************
-
- The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation. It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions. Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
- It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring. (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
- If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release. If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
- The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'. You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
- 1. `cd' to the directory containing the package's source code and type
- `./configure' to configure the package for your system. If you're
- using `csh' on an old version of System V, you might need to type
- `sh ./configure' instead to prevent `csh' from trying to execute
- `configure' itself.
-
- Running `configure' takes awhile. While running, it prints some
- messages telling which features it is checking for.
-
- 2. Type `make' to compile the package.
-
- 3. Optionally, type `make check' to run any self-tests that come with
- the package.
-
- 4. Type `make install' to install the programs and any data files and
- documentation.
-
- 5. You can remove the program binaries and object files from the
- source code directory by typing `make clean'. To also remove the
- files that `configure' created (so you can compile the package for
- a different kind of computer), type `make distclean'. There is
- also a `make maintainer-clean' target, but that is intended mainly
- for the package's developers. If you use it, you may have to get
- all sorts of other programs in order to regenerate files that came
- with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about. Run `./configure --help' for
-details on some of the pertinent environment variables.
-
- You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment. Here
-is an example:
-
- ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
- *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory. To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'. `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script. `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
- If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory. After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' installs the package's commands under
-`/usr/local/bin', include files under `/usr/local/include', etc. You
-can specify an installation prefix other than `/usr/local' by giving
-`configure' the option `--prefix=PREFIX'.
-
- You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files. If you
-pass the option `--exec-prefix=PREFIX' to `configure', the package uses
-PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files still use the regular prefix.
-
- In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files. Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
- If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System). The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
- For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option. TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
- CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
- OS KERNEL-OS
-
- See the file `config.sub' for the possible values of each field. If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
- If you are _building_ compiler tools for cross-compiling, you should
-use the option `--target=TYPE' to select the type of system they will
-produce code for.
-
- If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists. Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'. However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost. In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'. For example:
-
- ./configure CC=/usr/local2/bin/gcc
-
-causes the specified `gcc' to be used as the C compiler (unless it is
-overridden in the site shell script). Here is a another example:
-
- /bin/bash ./configure CONFIG_SHELL=/bin/bash
-
-Here the `CONFIG_SHELL=/bin/bash' operand causes subsequent
-configuration-related scripts to be executed by `/bin/bash'.
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
- Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
- Print the version of Autoconf used to generate the `configure'
- script, and exit.
-
-`--cache-file=FILE'
- Enable the cache: use and save the results of the tests in FILE,
- traditionally `config.cache'. FILE defaults to `/dev/null' to
- disable caching.
-
-`--config-cache'
-`-C'
- Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
- Do not print messages saying which checks are being made. To
- suppress all normal output, redirect it to `/dev/null' (any error
- messages will still be shown).
-
-`--srcdir=DIR'
- Look for the package's source code in directory DIR. Usually
- `configure' can determine that directory automatically.
-
-`configure' also accepts some other options. Run
-`configure --help' for more details.
-
diff --git a/graphics/asymptote/INSTALL-WIN.md b/graphics/asymptote/INSTALL-WIN.md
new file mode 100644
index 0000000000..9046b7b13f
--- /dev/null
+++ b/graphics/asymptote/INSTALL-WIN.md
@@ -0,0 +1,250 @@
+# Building Asymptote with CMake (On Windows)
+
+## Basic Requirements
+
+### Required Dependencies
+Ensure the following is installed:
+- Visual Studio 2022+ or Visual Studio 2022+ build tools.
+ - Both can be found at [here](https://visualstudio.microsoft.com/downloads/).
+- CMake
+ - (Recommended way) Visual Studio/Visual Studio Build Tools provides bundled CMake as a selectable component
+ - Otherwise, CMake can be found [here](https://cmake.org/)
+- Python 3+
+ - Available [here](https://www.python.org/downloads/windows/).
+- Perl on Windows
+ - (Recommended way) Strawberry Perl is available at [Strawberry Perl](https://strawberryperl.com/).
+ - (Not recommended due to license terms) ActiveState Perl is available [here](https://www.activestate.com/products/perl/).
+- Ninja
+ - (Recommended) Visual Studio/Visual Studio Build Tools provides bundled Ninja as part of CMake build tools
+ - Otherwise, Ninja can be installed using winget by running `winget install Ninja-build.Ninja`.
+ - If winget is not available, Ninja can be found [here](https://ninja-build.org/).
+ If installing this way, ensure `ninja` is accessible from `PATH`.
+ - (Untested) `ninja.exe` is bundled within a Strawberry Perl installation.
+
+### Optional, but highly recommended dependencies
+- A GCC-compatible C++ compiler (Optional, but highly recommended. See #installing-gcc-compatible-c++-compiler)
+ - (Recommended way) [here](https://releases.llvm.org/).
+ - (Untested) `g++.exe` is bundled within a Strawberry Perl installation.
+ - (Untested) Visual Studio also provides clang tools as an installable component.
+ If installing this way, ensure that `clang++.exe` is available.
+- Vcpkg (Optional, but highly recommended. See #notes-on-dependency-management)
+ - Can be found [here](https://vcpkg.io/).
+
+### Dependencies for documentation generation (Required only for building a setup file)
+
+Ensure [TeX Live](https://tug.org/texlive/windows.html) is available on the system.
+[MikTeX](https://miktex.org) is a possible substitute but is unsupported.
+
+Building `asymptote.pdf` requires a UNIX system.
+
+### Dependencies for building the setup file
+
+The following is required for building the setup file:
+- NSIS installer.
+ - NSIS installer can be found [here](https://nsis.sourceforge.io/Download).
+
+## For a quick start
+
+If you are getting started and want a quick configuration, run `./quick-start-win32.ps1`.
+This script automatically checks that you have vcpkg, and if not, clones and bootstraps vcpkg on your system.
+
+Additionally, this script automatically locates your Visual Studio installation and
+establishes all required environment variables.
+
+## Notes on Dependency management
+
+The recommended way is to use [vcpkg](https://vcpkg.io/).
+See `INSTALL.md` for more details.
+On windows, one may run
+
+```powershell
+git clone https://github.com/microsoft/vcpkg.git
+./vcpkg/bootstrap-vcpkg.bat
+```
+to initialize vcpkg.
+Make sure the environment `VCPKG_ROOT` points to where your vcpkg repository is at user or machine scope.
+
+### For User scope
+This can be done either by Start -> "Edit environment variables for your account" and then adding
+VCPKG_ROOT entry, or by PowerShell,
+
+```powershell
+[Environment]::SetEnvironmentVariable('VCPKG_ROOT', '<path to vcpkg>', 'User')
+```
+
+### For machine scope
+
+Otherwise, you can also set VCPKG_ROOT for everyone on your machine.
+
+## Using CMake
+
+### Installing GCC-compatible C++ compiler
+
+We (highly) suggest installing a GCC-compatible C++ compiler for preprocessing.
+Our recommendation is to use clang/LLVM tools, available [here](https://releases.llvm.org/).
+Once your compiler is installed, there are a few options.
+
+- (Recommended) Ensure `clang++.exe` is available in `PATH` and leave `GCCCOMPAT_CXX_COMPILER_FOR_MSVC` unset.
+ The build script will automatically try to locate `clang++.exe` or `g++.exe` in places
+ within `PATH`.
+ Be warned that the build script may select a different compiler depending
+ on if there are other compilers available in `PATH`.
+- (Only if you require a specific clang++ compiler) Set `GCCCOMPAT_CXX_COMPILER_FOR_MSVC` environment variable to
+ your GCC-compatible C++ compiler. For example
+ ```powershell
+ $env:GCCCOMPAT_CXX_COMPILER_FOR_MSVC="<LLVM install location>/bin/clang++.exe
+ ```
+ - If you want to make the environment variable permanent, run
+ ```powershell
+ [Environment]::SetEnvironmentVariable('GCCCOMPAT_CXX_COMPILER_FOR_MSVC', '<LLVM install location>/bin/clang++.exe', 'User
+ ```
+
+### Building steps
+
+#### Environment set up
+
+Ensure you have `cl.exe` in your path.
+The easiest way is to use Visual Studio Developer PowerShell, though be careful that by default
+VS Developer PowerShell selects 32-bit cl.exe.
+
+To explicitly select 64-bit Visual Studio Developer PowerShell, one can use Visual Studio locator
+alongside its developer shell script as
+
+```powershell
+$vsInfo = Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs
+& "$($vsInfo.InstallLocation)\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
+```
+
+This prompt should put you in to 64-bit Visual Studio Developer PowerShell.
+
+#### Configuring build files
+
+There are multiple CMake presets available for building, depending on what you intend to build
+- If you are building Asymptote for release with setup files, depending on how you would build `asymptote.pdf`,
+ use either (see #documentation-generation section)
+ - The `msvc/release` preset
+ - The `msvc/msvc/release-with-existing-asymptote-pdf`
+- If you are building only asymptote executable for release, or do not care about `asymptote.pdf`, use `msvc/release` preset
+- If you are building Asymptote for development or debug mode,
+ you are required to either create your own debug preset or configure cache variables manually.
+
+Ensure that you are in the Visual Studio 64-bit PowerShell (or have every tool available in `PATH`), and run
+```powershell
+cmake --preset <your selected preset>
+```
+
+#### Building Asymptote
+
+There are multiple key targets for building Asymptote.
+
+- For the `asy.exe` executable and `base/` files, the target to run is `asy-with-basefiles`
+- For documentation (depending on your configuration, including or excluding `asymptote.pdf`) - `docgen`
+- If you are generating an installer file, the target `asy-pre-nsis-targets` builds all required components,
+ excluding the GUI.
+ See #building-gui-files for instructions on how to build GUI files.
+
+The Asymptote binary is available
+at `cmake-build-msvc/release/asy.exe` if using `msvc/release` or `msvc/msvc/release-with-existing-asymptote-pdf`
+targets.
+Instructions for generating a setup file are in the next section
+
+##### Extra considerations for `asymptote.pdf`
+
+On Windows, `asymptote.pdf` is built using MikTeX's `texify` program, hence why TeX Live cannot be used here.
+Additionally, ensure that a replacement for `texindex` is available in the system.
+As of the moment, I have only tested using WSL's `texindex`.
+
+- If you have a WSL distribution with `texindex` installed,
+that may be used as a substitute for `texindex` on windows. In this case, ensure the cache variable
+`WIN32_TEXINDEX` is set to `WSL`. This is the default option.
+- If you have a replacement `texindex` program, ensure `WIN32_TEXINDEX` points to that file.
+
+## Building GUI files
+
+### Dependencies for GUI files
+
+All required dependencies for building GUI are present in `GUI/requirements.txt` and `GUI/requirements.dev.txt`.
+We recommend using a virtual environment, for example
+
+```powershell
+python.exe -m virtualenv asyguibuild
+./asyguibuild/Scripts/activate.ps1
+
+cd <asymptote-repo>/GUI
+pip install -r requirements.txt
+pip install -r requirements.dev.txt
+```
+
+However, against our recommendations, the dependencies can be also installed into the system interpreter.
+
+### Building the GUI files
+
+The python script `GUI/buildtool.py` is used for building required files. To do this, run
+
+```powershell
+cd <asymptote-repo>/GUI
+python.exe buildtool.py build
+```
+
+This should build all required GUI files.
+
+## Installation file generation
+
+#### Prerequisites for installation file generation
+
+Ensure that
+- Requirements for building asymptote executable
+- Requirements for building documentation (excluding `asymptote.pdf`)
+- At least one of the following:
+ - A pre-built `asymptote.pdf` file
+ - Requirements for building `asymptote.pdf` file
+- PowerShell. This should come pre-installed on windows.
+ - Ensure that the ability to execute unsigned scripts is enabled
+- Python 3 with relevant dependencies for building GUI files (This will be discussed in a separate section)
+
+are present in the system.
+
+#### If using a pre-built `asymptote.pdf`
+
+Place `asymptote.pdf` in the directory `<asymptote-repo>/extfiles/`.
+That is, the file `<asymptote-repo>/extfiles/asymptote.pdf` is present.
+After that, configure cmake with the preset `msvc/release-with-existing-asymptote-pdf` - that is,
+
+```powershell
+cmake --preset msvc/release-with-existing-asymptote-pdf
+```
+
+#### If generating `asymptote.pdf` as part of build process
+
+Use the `msvc/release` build preset for cmake.
+
+### Building Asymptote install files
+
+The cmake target `asy-pre-nsis-targets` should build everything on the `C++` side needed
+for asymptote installation.
+
+#### Generating the installer file
+
+After building `asy-pre-nsis-targets`, install using CMake.
+Note that this does not install into
+the program files directory, but rather, to a "local install root"
+at `<asymptote-repo>/cmake-install-w32-nsis-release/`.
+
+Due to how google test build files are written (as of currently), installing
+every component may result in an error (in particular, with `gmock.lib`).
+This can be remedied by installing only the component needed for installer generation: `asy-pre-nsis`
+To do this, run
+
+```powershell
+cmake --install cmake-build-msvc/release --component asy-pre-nsis
+```
+
+After building all the required dependencies,
+navigate to the directory `<asymptote-repo>/cmake-install-w32-nsis-release/`.
+There, a script called `build-asy-installer.ps1` script is present.
+Run that script.
+It will prompt for the location of `makensis.exe` from the NSIS.
+Specify the path to `makensis.exe`.
+
+After this, the script should generate the installer file with the name `asymptote-<version>-setup.exe`.
+This is the setup file ready for distribution.
diff --git a/graphics/asymptote/INSTALL.md b/graphics/asymptote/INSTALL.md
new file mode 100644
index 0000000000..7c3dad0fae
--- /dev/null
+++ b/graphics/asymptote/INSTALL.md
@@ -0,0 +1,118 @@
+# Building Asymptote with CMake
+
+## Dependency management
+
+The recommended way is to use [vcpkg](https://vcpkg.io/). Clone vcpkg to your system, run bootstrap script and ensure
+`VCPKG_ROOT` environment is exported as set as path to your vcpkg repository. For example,
+
+```bash
+cd ~/dev/
+git clone https://github.com/microsoft/vcpkg.git
+cd vcpkg && ./bootstrap-vcpkg.sh
+export VCPKG_ROOT=~/dev/vcpkg
+```
+
+## Linux-specific dependency
+
+Make sure flex and bison is available in path, if not, install them manually first.
+
+```bash
+# This is specific to arch linux, other distributions might use a different name
+sudo pacman -S flex bison
+```
+
+For OpenGL, make sure all relevant dependencies for freeglut is installed. The relevant dependencies
+should be shown during vcpkg install
+
+## Using CMake
+
+### Quick start (Linux)
+
+Make sure `ninja` and `cmake`, `python3` and `perl` are installed, as well as `gcc`.
+Then run
+
+```bash
+mkdir -p cmake-build-linux/release
+cmake --preset linux/release
+cmake --build --preset linux/release --target asy-with-basefiles
+```
+
+The asymptote binary should be available in `cmake-build-linux/release` directory.
+
+### On Debug Builds
+
+One thing you may notice is that we do not provide a debug build preset. This is intentional
+since anyone developing might want to add configurations specific to their system
+(such as a particular clang they want to use for preprocessing), or for vendor-specific configurations
+(e.g. selecting a particular toolchain in CLion).
+
+Our recommendation is to create your own debug presets in `CMakeUserPresets.json` - for example,
+for my (Jamie's) setup:
+
+```json
+{
+ "version": 6,
+ "cmakeMinimumRequired": {
+ "major": 3,
+ "minor": 26,
+ "patch": 0
+ },
+
+ "configurePresets": [
+ {
+ "name": "msvc/debug-clion+vs",
+ "displayName": "[MSVC-x86/64] Debug (With preset environment vars)",
+ "binaryDir": "${sourceDir}/cmake-build-msvc/debug",
+ "inherits": ["base/buildBaseWithVcpkg", "base/debug", "base/gccCompatCacheVar", "base/windows-only"],
+ "environment": {
+ "GCCCOMPAT_CXX_COMPILER_FOR_MSVC": "C:\\msys64\\clang64\\bin\\clang++.exe"
+ },
+ "vendor": {
+ "jetbrains.com/clion": {
+ "toolchain": "MSVC"
+ }
+ }
+ },
+ {
+ "name": "linux/debug-clion+vs",
+ "displayName": "[linux-x86/64] Debug (With preset environment vars)",
+ "binaryDir": "${sourceDir}/cmake-build-linux/debug",
+ "inherits": [ "base/buildBaseWithVcpkg", "base/debug" ],
+ "environment": {
+ "VCPKG_ROOT": "$env{HOME}/dev/vcpkg"
+ },
+ "vendor": {
+ "jetbrains.com/clion": {
+ "toolchain": "WSL"
+ }
+ }
+ }
+ ]
+}
+```
+
+### Additional build information
+
+One can specify additional package string (this is useful for CI for denoting build revision).
+To do this, add a file called `asy-pkg-version-suffix.cmake` with a cmake command
+```cmake
+set(ASY_VERSION_SUFFIX "<custom version suffix>")
+```
+
+This suffix will get embedded into the final asymptote version. If this file is not specified, the default
+suffix is "+debug" for debug builds, or an empty string for all other builds, including release builds
+
+## Testing
+
+Asymptote unit testing is integerated into CMake's `CTest` framework.
+All Asymptote `.asy` based tests are named `asy.<test dirname>.<test file name>`
+excluding `*.asy` extension.
+
+These tests can be run by CTest. For example, after building on linux/release,
+
+```bash
+ctest --test-dir cmake-build-linux/release/ -R "asy.types.*"
+```
+
+# On Windows
+See INSTALL-WIN.md for windows-specific instructions.
diff --git a/graphics/asymptote/LspCpp/CMakeLists.txt b/graphics/asymptote/LspCpp/CMakeLists.txt
deleted file mode 100644
index b04e08e733..0000000000
--- a/graphics/asymptote/LspCpp/CMakeLists.txt
+++ /dev/null
@@ -1,363 +0,0 @@
-cmake_minimum_required(VERSION 3.8)
-
-if(POLICY CMP0025)
- # detect Apple's Clang
- cmake_policy(SET CMP0025 NEW)
-endif()
-if(POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif()
-
-set(LIB_MAJOR_VERSION "1")
-set(LIB_MINOR_VERSION "0")
-set(LIB_PATCH_VERSION "0")
-set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
-
-# Without this, paths are not relative in the sources list
-cmake_policy(SET CMP0076 NEW)
-project(lspcpp VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX C)
-
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
-SET(GOOGLETEST_VERSION "0.00")
-
-# compile in RelWithDebInfo mode by default
-if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
-endif()
-
-###########################################################
-# Options
-###########################################################
-function (option_if_not_defined name description default)
- if(NOT DEFINED ${name})
- option(${name} ${description} ${default})
- endif()
-endfunction()
-
-option_if_not_defined(USE_SYSTEM_RAPIDJSON "Use system RapidJSON instead of the git submodule if exists" OFF)
-option_if_not_defined(LSPCPP_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF)
-option_if_not_defined(LSPCPP_BUILD_EXAMPLES "Build example applications" OFF)
-option_if_not_defined(LSPCPP_BUILD_FUZZER "Build fuzzer" OFF)
-option_if_not_defined(LSPCPP_BUILD_WEBSOCKETS "Build websocket server" ON)
-option_if_not_defined(LSPCPP_ASAN "Build lsp with address sanitizer" OFF)
-option_if_not_defined(LSPCPP_MSAN "Build lsp with memory sanitizer" OFF)
-option_if_not_defined(LSPCPP_TSAN "Build lsp with thread sanitizer" OFF)
-option_if_not_defined(LSPCPP_INSTALL "Create lsp install target" OFF)
-option_if_not_defined(LSPCPP_SUPPORT_BOEHM_GC
- "Enable support for Boehm GC. Boehm GC must be available by find_package(BDWgc CONFIG REQUIRED)." OFF)
-option_if_not_defined(LSPCPP_USE_CPP17 "Use C++17 for compilation. Setting this to off requires boost-optional." OFF)
-
-
-# Boehm GC
-
-if (LSPCPP_SUPPORT_BOEHM_GC)
- find_package(BDWgc CONFIG REQUIRED)
-endif()
-
-###########################################################
-# Directories
-###########################################################
-function (set_if_not_defined name value)
- if(NOT DEFINED ${name})
- set(${name} ${value} PARENT_SCOPE)
- endif()
-endfunction()
-
-set(LSPCPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
-set_if_not_defined(LSPCPP_THIRD_PARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party)
-
-macro(lspcpp_set_target_options_with_nuget_pkg target id version)
- if (CMAKE_GENERATOR MATCHES "Visual Studio.*")
- if(EXISTS ${CMAKE_BINARY_DIR}/packages/${id}.${version}/build/${id}.targets)
- target_link_libraries(${target} PRIVATE ${CMAKE_BINARY_DIR}/packages/${id}.${version}/build/${id}.targets)
- elseif(EXISTS ${CMAKE_BINARY_DIR}/packages/${id}.${version}/build/native/${id}.targets)
- target_link_libraries(${target} PRIVATE ${CMAKE_BINARY_DIR}/packages/${id}.${version}/build/native/${id}.targets)
- else()
- message(FATAL_ERROR "Can't find target of ${id}.${version}")
- endif()
- else()
- message(FATAL_ERROR "NUGET package only use in Visual Studio")
- endif()
-
-endmacro()
-
-macro(INSTALL_NUGET id version)
- if (CMAKE_GENERATOR MATCHES "Visual Studio.*")
- unset(nuget_cmd)
- list(APPEND nuget_cmd install ${id} -Prerelease -Version ${version} -OutputDirectory ${CMAKE_BINARY_DIR}/packages)
- message("excute nuget install:${nuget_cmd}")
- execute_process(COMMAND nuget ${nuget_cmd} ENCODING AUTO)
- else()
- message(FATAL_ERROR "INSTALL_NUGET only use in Visual Studio")
- endif()
-
-endmacro()
-###########################################################
-# Functions
-###########################################################
-function(lspcpp_set_target_options target)
-
- set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
-
- # Enable C++14/17 (Required)
- if (LSPCPP_USE_CPP17)
- set_property(TARGET ${target} PROPERTY CXX_STANDARD 17)
- else()
- set_property(TARGET ${target} PROPERTY CXX_STANDARD 14)
- endif()
-
- set_property(TARGET ${target} PROPERTY CXX_EXTENSIONS OFF)
-
- if (CMAKE_GENERATOR MATCHES "Visual Studio.*")
- lspcpp_set_target_options_with_nuget_pkg(${target} boost 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_chrono-vc141 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_date_time-vc141 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_filesystem-vc141 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_program_options-vc141 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_system-vc141 1.76.0.0)
- lspcpp_set_target_options_with_nuget_pkg(${target} boost_thread-vc141 1.76.0.0)
- endif()
-
- # Enable all warnings
- if(MSVC)
- target_compile_options(${target} PRIVATE "-W4")
- else()
- target_compile_options(${target} PRIVATE "-Wall")
- endif()
-
- # Disable specific, pedantic warnings
- if(MSVC)
- target_compile_options(${target} PRIVATE
- "-D_CRT_SECURE_NO_WARNINGS"
-
- # Warnings from nlohmann/json headers.
- "/wd4267" # 'argument': conversion from 'size_t' to 'int', possible loss of data
- "/bigobj" # for visual studio 2022 x64 or later.
- )
- endif()
-
- # Add define for JSON library in use
- set_target_properties(${target} PROPERTIES
- COMPILE_DEFINITIONS "LSPCPP_JSON_${LSPCPP_JSON_LIBRARY_UPPER}=1"
- )
-
- # Treat all warnings as errors
- if(LSPCPP_WARNINGS_AS_ERRORS)
- if(MSVC)
- target_compile_options(${target} PRIVATE "/WX")
- else()
- target_compile_options(${target} PRIVATE "-Werror")
- endif()
- endif(LSPCPP_WARNINGS_AS_ERRORS)
-
- if(LSPCPP_ASAN)
- target_compile_options(${target} PUBLIC "-fsanitize=address")
- target_link_libraries(${target} PUBLIC "-fsanitize=address")
- elseif(LSPCPP_MSAN)
- target_compile_options(${target} PUBLIC "-fsanitize=memory")
- target_link_libraries(${target} PUBLIC "-fsanitize=memory")
- elseif(LSPCPP_TSAN)
- target_compile_options(${target} PUBLIC "-fsanitize=thread")
- target_link_libraries(${target} PUBLIC "-fsanitize=thread")
- endif()
-
- # Error on undefined symbols
- # if(NOT MSVC)
- # target_compile_options(${target} PRIVATE "-Wl,--no-undefined")
- # endif()
-
- if (LSPCPP_SUPPORT_BOEHM_GC)
- target_link_libraries(${target} PUBLIC BDWgc::gc)
- target_compile_definitions(${target} PUBLIC LSPCPP_USEGC)
- endif()
-
-endfunction()
-
-
-# Libraries
-
-if (MSVC)
- set(Uri_USE_STATIC_CRT OFF)
-endif()
-set(Uri_BUILD_TESTS OFF)
-add_subdirectory(third_party/uri)
-
-###########################################################
-# boost library
-###########################################################
-if (CMAKE_GENERATOR MATCHES "Visual Studio.*")
- INSTALL_NUGET(boost 1.76.0.0)
- INSTALL_NUGET(boost_chrono-vc141 1.76.0.0)
- INSTALL_NUGET(boost_date_time-vc141 1.76.0.0)
- INSTALL_NUGET(boost_filesystem-vc141 1.76.0.0)
- INSTALL_NUGET(boost_program_options-vc141 1.76.0.0)
- INSTALL_NUGET(boost_system-vc141 1.76.0.0)
- INSTALL_NUGET(boost_thread-vc141 1.76.0.0)
-else()
-
- find_package(Boost COMPONENTS date_time chrono filesystem system thread program_options)
- if(NOT Boost_FOUND)
- if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- message(FATAL_ERROR "Can't find boost,lease build boost and install it or install boost with : brew install boost")
- elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
- message(FATAL_ERROR "Can't find boost,please build boost and install it. or install boost with : sudo apt-get install libboost-dev")
- endif()
- endif()
-endif()
-
-
-###########################################################
-# JSON library
-###########################################################
-if(USE_SYSTEM_RAPIDJSON)
- set(RapidJSON_MIN_VERSION "1.1.0")
- find_package(RapidJSON ${RapidJSON_MIN_VERSION} QUIET)
- if(NOT DEFINED RapidJSON_INCLUDE_DIRS AND DEFINED RAPIDJSON_INCLUDE_DIRS)
- set(RapidJSON_INCLUDE_DIRS "${RAPIDJSON_INCLUDE_DIRS}")
- endif()
-endif()
-if(NOT RapidJSON_FOUND)
- if(EXISTS "${PROJECT_SOURCE_DIR}/third_party/rapidjson/include")
- message(STATUS "Using local RapidJSON")
- set(RapidJSON_INCLUDE_DIRS third_party/rapidjson/include)
- else()
- message(STATUS "Please initialize rapidJSON git submodule as currently installed version is to old:")
- message(STATUS "git submodule init && git submodule update")
- message(FATAL_ERROR "RapidJSON version is likely too old.")
- endif()
-endif()
-
-
-###########################################################
-# Targets
-###########################################################
-
-# lsp
-add_library(lspcpp STATIC)
-
-### Includes
-target_include_directories(lspcpp
- PUBLIC
- ${LSPCPP_INCLUDE_DIR}
- ${Boost_INCLUDE_DIRS}
- ${RapidJSON_INCLUDE_DIRS}
- ${Uri_SOURCE_DIR}/include
- )
-
-target_link_libraries(lspcpp PUBLIC network-uri ${Boost_LIBRARIES})
-
-set(LSPCPP_THIRD_PARTY_DIR_LIST
- ${LSPCPP_THIRD_PARTY_DIR}/utfcpp/source
- )
-
-foreach(include_dir ${LSPCPP_THIRD_PARTY_DIR_LIST})
- get_filename_component(include_dir_realpath ${include_dir} REALPATH)
- # Don't add as SYSTEM if they are in CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES.
- # It would reorder the system search paths and cause issues with libstdc++'s
- # use of #include_next.
- if(NOT "${include_dir_realpath}" IN_LIST CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES)
- target_include_directories(lspcpp SYSTEM PRIVATE ${include_dir})
- endif()
-endforeach()
-
-### Sources
-set(JSONRPC_LIST
- src/jsonrpc/Context.cpp
- src/jsonrpc/Endpoint.cpp
- src/jsonrpc/GCThreadContext.cpp
- src/jsonrpc/message.cpp
- src/jsonrpc/MessageJsonHandler.cpp
- src/jsonrpc/RemoteEndPoint.cpp
- src/jsonrpc/serializer.cpp
- src/jsonrpc/StreamMessageProducer.cpp
- src/jsonrpc/TcpServer.cpp
- src/jsonrpc/threaded_queue.cpp
-)
-set(LSPCPP_LIST
- src/lsp/initialize.cpp
- src/lsp/lsp.cpp
- src/lsp/lsp_diagnostic.cpp
- src/lsp/Markup.cpp
- src/lsp/ParentProcessWatcher.cpp
- src/lsp/ProtocolJsonHandler.cpp
- src/lsp/textDocument.cpp
- src/lsp/utils.cpp
- src/lsp/working_files.cpp
- )
-
-if(LSPCPP_BUILD_WEBSOCKETS)
- set(JSONRPC_LIST
- ${JSONRPC_LIST}
- src/jsonrpc/WebSocketServer.cpp
- )
-endif()
-
-target_sources(lspcpp PRIVATE
- ${JSONRPC_LIST}
- ${LSPCPP_LIST})
-
-### Compile options
-
-lspcpp_set_target_options(lspcpp)
-
-set_target_properties(lspcpp PROPERTIES POSITION_INDEPENDENT_CODE 1)
-
-# install
-if(LSPCPP_INSTALL)
- include(GNUInstallDirs)
-
- install(DIRECTORY ${LSPCPP_INCLUDE_DIR}/LibLsp
- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- USE_SOURCE_PERMISSIONS
- )
-
- install(TARGETS lspcpp
- EXPORT lspcpp-targets
- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
- INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
- )
-
- install(EXPORT lspcpp-targets
- FILE lspcpp-config.cmake
- NAMESPACE lspcpp::
- DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/lspcpp
- )
-endif()
-
-# examples
-if(LSPCPP_BUILD_EXAMPLES)
-
- ###########################################################
- # OS libraries
- ###########################################################
- if(CMAKE_SYSTEM_NAME MATCHES "Windows")
- set(LSPCPP_OS_LIBS WS2_32)
- elseif(CMAKE_SYSTEM_NAME MATCHES "Linux")
- set(LSPCPP_OS_LIBS pthread)
- elseif(CMAKE_SYSTEM_NAME MATCHES "Darwin")
- set(LSPCPP_OS_LIBS)
- endif()
-
- function(build_example target)
- add_executable(${target} "${CMAKE_CURRENT_SOURCE_DIR}/examples/${target}.cpp")
- target_include_directories(${target} PRIVATE ${Uri_SOURCE_DIR}/include)
- set_target_properties(${target} PROPERTIES
- FOLDER "Examples"
- )
- lspcpp_set_target_options(${target})
- target_link_libraries(${target} PRIVATE lspcpp "${LSPCPP_OS_LIBS}")
- endfunction(build_example)
-
- set(EXAMPLES
- StdIOClientExample
- StdIOServerExample
- TcpServerExample
- WebsocketExample
- )
-
- foreach (example ${EXAMPLES})
- build_example(${example})
- endforeach()
-endif()
diff --git a/graphics/asymptote/LspCpp/LICENSE b/graphics/asymptote/LspCpp/LICENSE
deleted file mode 100644
index e2016d4801..0000000000
--- a/graphics/asymptote/LspCpp/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2020 kuafuwang
-
-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.
diff --git a/graphics/asymptote/LspCpp/README.md b/graphics/asymptote/LspCpp/README.md
deleted file mode 100644
index afdd8814cf..0000000000
--- a/graphics/asymptote/LspCpp/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# LspCpp
-
-## Dependencies
-`LspCpp` depends on boost, rapidjson, utfcpp, uri.
-
-## Build
-
-### Linux / Mac
-1. On linux, install boost
- ```shell
- $ sudo apt-get install libboost-dev
- ```
- On Mac, install boost on Mac
- ```shell
- $ brew install boost
- ```
-
-2. Building with ``CMake``
------------------------
- $ mkdir _build
- $ cd _build
- $ cmake -DUri_BUILD_TESTS=OFF ..
- $ make -j4
-
-### Windows
-
- 1. Open cmd or powershell and generate visual studio project with ``CMake``.
- -----------------------
- mkdir _build
- cd _build
- cmake -DUri_BUILD_TESTS=OFF -DUri_USE_STATIC_CRT=OFF ..
-
- 2. "cmake -help" is useful if you are not familiar with cmake.
-
- 3. Build it with Visual Studio.
-
-## Reference
- Some code from :[cquery][1]
-
-## Projects using LspCpp:
-* [JCIDE](https://www.javacardos.com/tools)
-* [LPG-language-server](https://github.com/kuafuwang/LPG-language-server)
-## License
- MIT
-
-## Example:
-[It's here](https://github.com/kuafuwang/LspCpp/tree/master/examples)
-
-
-[1]: https://github.com/cquery-project/cquery "cquery:"
-[2]: https://www.javacardos.com/tools "JcKit:"
-[3]: https://docs.microsoft.com/en-us/nuget/consume-packages/package-restore "Package Restore"
-
diff --git a/graphics/asymptote/LspCpp/examples/StdIOClientExample.cpp b/graphics/asymptote/LspCpp/examples/StdIOClientExample.cpp
deleted file mode 100644
index 13bf9da633..0000000000
--- a/graphics/asymptote/LspCpp/examples/StdIOClientExample.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-
-#include "LibLsp/lsp/ProcessIoService.h"
-
-#include <boost/program_options.hpp>
-#include "LibLsp/lsp/general/exit.h"
-#include "LibLsp/lsp/textDocument/declaration_definition.h"
-
-#include "LibLsp/lsp/textDocument/signature_help.h"
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-#include "LibLsp/lsp/textDocument/typeHierarchy.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-#include "LibLsp/lsp/textDocument/resolveCompletionItem.h"
-#include <network/uri.hpp>
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/JsonRpc/TcpServer.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-#include <boost/process.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/asio.hpp>
-#include <iostream>
-
-#include <thread>
-
-using namespace boost::asio::ip;
-using namespace std;
-class DummyLog :public lsp::Log
-{
-public:
-
- void log(Level level, std::wstring&& msg)
- {
-
- std::wcerr << msg << std::endl;
- };
- void log(Level level, const std::wstring& msg)
- {
- std::wcerr << msg << std::endl;
- };
- void log(Level level, std::string&& msg)
- {
- std::cerr << msg << std::endl;
- };
- void log(Level level, const std::string& msg)
- {
- std::cerr << msg << std::endl;
- };
-};
-
-struct boost_process_ipstream : lsp::base_istream< boost::process::ipstream >
-{
- explicit boost_process_ipstream(boost::process::ipstream& _t)
- : base_istream<boost::process::ipstream>(_t)
- {
- }
-
- std::string what() override
- {
- return {};
- }
- void clear() override
- {
-
- }
-};
-struct boost_process_opstream : lsp::base_ostream< boost::process::opstream >
-{
- explicit boost_process_opstream(boost::process::opstream& _t)
- : lsp::base_ostream<boost::process::opstream>(_t)
- {
- }
-
- std::string what() override
- {
- return {};
- }
- void clear() override
- {
-
- }
-};
-class Client
-{
-public:
- Client(std::string& execPath,const std::vector<std::string>& args)
- :point(protocol_json_handler, endpoint, _log)
- {
- std::error_code ec;
- namespace bp = boost::process;
- c = std::make_shared<bp::child>(asio_io.getIOService(), execPath,
- bp::args = args,
- ec,
-
- bp::std_out > read_from_service,
- bp::std_in < write_to_service,
- bp::on_exit([&](int exit_code, const std::error_code& ec_in){
-
- }));
- if (ec)
- {
- // fail
- _log.log(lsp::Log::Level::SEVERE, "Start server failed.");
- }
- else {
- //success
- point.startProcessingMessages(read_from_service_proxy, write_to_service_proxy);
- }
- }
- ~Client()
- {
- point.stop();
- std::this_thread::sleep_for(std::chrono::milliseconds (1000));
- }
-
- lsp::ProcessIoService asio_io;
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared< lsp::ProtocolJsonHandler>();
- DummyLog _log;
-
- std::shared_ptr<GenericEndpoint> endpoint = std::make_shared<GenericEndpoint>(_log);
-
- boost::process::opstream write_to_service;
- boost::process::ipstream read_from_service;
-
- std::shared_ptr<lsp::ostream> write_to_service_proxy = std::make_shared<boost_process_opstream>(write_to_service);
- std::shared_ptr<lsp::istream> read_from_service_proxy = std::make_shared< boost_process_ipstream >(read_from_service);
-
- std::shared_ptr<boost::process::child> c;
- RemoteEndPoint point;
-};
-
-int main(int argc, char* argv[])
-{
- using namespace boost::program_options;
- options_description desc("Allowed options");
- desc.add_options()
- ("help,h", "produce help message")
- ("execPath", value<string>(), "LSP server's path");
-
-
-
- variables_map vm;
- try {
- store(parse_command_line(argc, argv, desc), vm);
- }
- catch (std::exception& e) {
- std::cout << "Undefined input.Reason:" << e.what() << std::endl;
- return 0;
- }
- notify(vm);
-
-
- if (vm.count("help"))
- {
- cout << desc << endl;
- return 1;
- }
- string execPath;
- if (vm.count("execPath"))
- {
- execPath = vm["execPath"].as<string>();
- }
- else
- {
- execPath = "StdIOServerExample";
- }
-
- Client client(execPath, {});
- {
- td_initialize::request req;
- auto rsp = client.point.waitResponse(req);
- if (rsp)
- {
- std::cerr << rsp->ToJson() << std::endl;
- }
- else
- {
- std::cerr << "get initialze response time out" << std::endl;
- }
- }
- {
- td_definition::request req;
- auto future_rsp = client.point.send(req);
- auto state = future_rsp.wait_for(std::chrono::seconds(4));
- if (lsp::future_status::timeout == state)
- {
- std::cerr << "get textDocument/definition response time out" << std::endl;
- return 0;
- }
- auto rsp = future_rsp.get();
- if (rsp.is_error)
- {
- std::cerr << "get textDocument/definition response error" << std::endl;
-
- }
- else
- {
- std::cerr << rsp.response.ToJson() << std::endl;
- }
- }
- {
- td_initialize::request req;
- auto rsp = client.point.waitResponse(req);
- if (rsp)
- {
- std::cerr << rsp->ToJson() << std::endl;
- }
- else
- {
- std::cerr << "get initialze response time out" << std::endl;
- }
- }
- Notify_Exit::notify notify;
- client.point.send(notify);
- return 0;
-}
-
-
diff --git a/graphics/asymptote/LspCpp/examples/StdIOServerExample.cpp b/graphics/asymptote/LspCpp/examples/StdIOServerExample.cpp
deleted file mode 100644
index 8b2d2b2d29..0000000000
--- a/graphics/asymptote/LspCpp/examples/StdIOServerExample.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-
-#include "LibLsp/JsonRpc/Condition.h"
-#include "LibLsp/lsp/general/exit.h"
-#include "LibLsp/lsp/textDocument/declaration_definition.h"
-#include <boost/program_options.hpp>
-#include "LibLsp/lsp/textDocument/signature_help.h"
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-#include "LibLsp/lsp/textDocument/typeHierarchy.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-#include "LibLsp/lsp/textDocument/resolveCompletionItem.h"
-#include <network/uri.hpp>
-
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/JsonRpc/TcpServer.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-#include <boost/process.hpp>
-#include <boost/filesystem.hpp>
-#include <boost/asio.hpp>
-#include <iostream>
-#include <thread>
-
-using namespace boost::asio::ip;
-using namespace std;
-class DummyLog :public lsp::Log
-{
-public:
-
- void log(Level level, std::wstring&& msg)
- {
-
- std::wcerr << msg << std::endl;
- };
- void log(Level level, const std::wstring& msg)
- {
- std::wcerr << msg << std::endl;
- };
- void log(Level level, std::string&& msg)
- {
- std::cerr << msg << std::endl;
- };
- void log(Level level, const std::string& msg)
- {
- std::cerr << msg << std::endl;
- };
-};
-
-
-class StdIOServer
-{
-public:
-
- StdIOServer() : remote_end_point_(protocol_json_handler, endpoint, _log)
- {
- remote_end_point_.registerHandler([&](const td_initialize::request& req)
- {
- td_initialize::response rsp;
- rsp.id = req.id;
- CodeLensOptions code_lens_options;
- code_lens_options.resolveProvider = true;
- rsp.result.capabilities.codeLensProvider = code_lens_options;
- return rsp;
- });
-
- remote_end_point_.registerHandler([&](Notify_Exit::notify& notify)
- {
- remote_end_point_.stop();
- esc_event.notify(std::make_unique<bool>(true));
- });
- remote_end_point_.registerHandler([&](const td_definition::request& req,
- const CancelMonitor& monitor)
- {
- td_definition::response rsp;
- rsp.result.first = std::vector<lsLocation>();
- if (monitor && monitor())
- {
- _log.info("textDocument/definition request had been cancel.");
- }
- return rsp;
- });
-
- remote_end_point_.startProcessingMessages(input, output);
- }
- ~StdIOServer()
- {
-
- }
-
- struct ostream : lsp::base_ostream<std::ostream>
- {
- explicit ostream(std::ostream& _t)
- : base_ostream<std::ostream>(_t)
- {
-
- }
-
- std::string what() override
- {
- return {};
- }
- };
- struct istream :lsp::base_istream<std::istream>
- {
- explicit istream(std::istream& _t)
- : base_istream<std::istream>(_t)
- {
- }
-
- std::string what() override
- {
- return {};
- }
- };
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared < lsp::ProtocolJsonHandler >();
- DummyLog _log;
-
- std::shared_ptr<ostream> output = std::make_shared<ostream>(std::cout);
- std::shared_ptr<istream> input = std::make_shared<istream>(std::cin);
-
- std::shared_ptr < GenericEndpoint > endpoint = std::make_shared<GenericEndpoint>(_log);
- RemoteEndPoint remote_end_point_;
- Condition<bool> esc_event;
-};
-
-
-
-
-int main(int argc, char* argv[])
-{
- using namespace boost::program_options;
- options_description desc("Allowed options");
- desc.add_options()
- ("help,h", "produce help message");
-
-
-
- variables_map vm;
- try {
- store(parse_command_line(argc, argv, desc), vm);
- }
- catch (std::exception& e) {
- std::cout << "Undefined input.Reason:" << e.what() << std::endl;
- return 0;
- }
- notify(vm);
-
-
- if (vm.count("help"))
- {
- cout << desc << endl;
- return 1;
- }
- StdIOServer server;
- server.esc_event.wait();
-
- return 0;
-}
-
-
diff --git a/graphics/asymptote/LspCpp/examples/TcpServerExample.cpp b/graphics/asymptote/LspCpp/examples/TcpServerExample.cpp
deleted file mode 100644
index 37a4266c94..0000000000
--- a/graphics/asymptote/LspCpp/examples/TcpServerExample.cpp
+++ /dev/null
@@ -1,209 +0,0 @@
-
-#include "LibLsp/lsp/general/exit.h"
-#include "LibLsp/lsp/textDocument/declaration_definition.h"
-#include "LibLsp/lsp/textDocument/signature_help.h"
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-#include "LibLsp/lsp/textDocument/typeHierarchy.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-#include "LibLsp/lsp/textDocument/resolveCompletionItem.h"
-#include <network/uri.hpp>
-
-
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/JsonRpc/TcpServer.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-
-#include <boost/filesystem.hpp>
-#include <boost/asio.hpp>
-#include <iostream>
-#include <thread>
-
-using namespace boost::asio::ip;
-using namespace std;
-class DummyLog :public lsp::Log
-{
-public:
-
- void log(Level level, std::wstring&& msg)
- {
- std::wcout << msg << std::endl;
- };
- void log(Level level, const std::wstring& msg)
- {
- std::wcout << msg << std::endl;
- };
- void log(Level level, std::string&& msg)
- {
- std::cout << msg << std::endl;
- };
- void log(Level level, const std::string& msg)
- {
- std::cout << msg << std::endl;
- };
-};
-
-std::string _address = "127.0.0.1";
-std::string _port = "9333";
-
-class Server
-{
-public:
-
-
- Server():server(_address,_port,protocol_json_handler, endpoint, _log)
- {
- server.point.registerHandler(
- [&](const td_initialize::request& req)
- ->lsp::ResponseOrError< td_initialize::response >{
-
- td_initialize::response rsp;
- CodeLensOptions code_lens_options;
- code_lens_options.resolveProvider = true;
- rsp.result.capabilities.codeLensProvider = code_lens_options;
-
- return rsp;
- });
- server.point.registerHandler([&](const td_definition::request& req
- ,const CancelMonitor& monitor) -> lsp::ResponseOrError<td_definition::response>
- {
-
- std::this_thread::sleep_for(std::chrono::seconds(8));
-
- if( monitor && monitor() )
- {
- _log.info("textDocument/definition request had been cancel.");
- Rsp_Error rsp;
- rsp.error.code = lsErrorCodes::RequestCancelled;
- rsp.error.message = "textDocument/definition request had been cancel.";
- return rsp;
- }
- else
- {
- td_definition::response rsp;
- rsp.result.first= std::vector<lsLocation>();
- return rsp;
- }
-
- });
-
- server.point.registerHandler([=](Notify_Exit::notify& notify)
- {
- std::cout << notify.ToJson() << std::endl;
- });
- std::thread([&]()
- {
- server.run();
- }).detach();
- }
- ~Server()
- {
- server.stop();
- }
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared < lsp::ProtocolJsonHandler >();
- DummyLog _log;
-
- std::shared_ptr < GenericEndpoint > endpoint = std::make_shared<GenericEndpoint>(_log);
- lsp::TcpServer server;
-
-};
-
-class Client
-{
-public:
- struct iostream :public lsp::base_iostream<tcp::iostream>
- {
- explicit iostream(boost::asio::basic_socket_iostream<tcp>& _t)
- : base_iostream<boost::asio::basic_socket_iostream<tcp>>(_t)
- {
- }
-
- std::string what() override
- {
- auto msg = _impl.error().message();
- return msg;
- }
-
- };
- Client() :remote_end_point_(protocol_json_handler, endpoint, _log)
- {
- tcp::endpoint end_point( address::from_string(_address), 9333);
-
- socket_ = std::make_shared<tcp::iostream>();
- socket_->connect(end_point);
- if (!socket_)
- {
- string temp = "Unable to connect: " + socket_->error().message();
- std::cout << temp << std::endl;
- }
-
- vector<string> args;
- socket_proxy = std::make_shared<iostream>(*socket_.get());
-
- remote_end_point_.startProcessingMessages(socket_proxy, socket_proxy);
- }
- ~Client()
- {
- remote_end_point_.stop();
- std::this_thread::sleep_for(std::chrono::milliseconds (1000));
- socket_->close();
- }
-
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared< lsp::ProtocolJsonHandler>();
- DummyLog _log;
-
- std::shared_ptr<GenericEndpoint> endpoint = std::make_shared<GenericEndpoint>(_log);
-
- std::shared_ptr < iostream> socket_proxy;
- std::shared_ptr<tcp::iostream> socket_;
- RemoteEndPoint remote_end_point_;
-};
-
-int main()
-{
-
- Server server;
- Client client;
-
- {
- td_initialize::request req;
- auto rsp = client.remote_end_point_.waitResponse(req);
- if (rsp)
- {
- std::cout << rsp->response.ToJson() << std::endl;
- }
- else
- {
- std::cout << "get initialze response time out" << std::endl;
- }
- }
- {
- td_definition::request req;
- auto future_rsp = client.remote_end_point_.send(req);
- client.remote_end_point_.cancelRequest(req.id);
-
- auto state = future_rsp.wait_for(std::chrono::seconds(16));
- if (lsp::future_status::timeout == state)
- {
- std::cout << "get textDocument/definition response time out" << std::endl;
- return 0;
- }
- auto rsp = future_rsp.get();
- if (rsp.is_error)
- {
- std::cout << "get textDocument/definition response error :" << rsp.ToJson() << std::endl;
-
- }
- else
- {
- std::cout << rsp.response.ToJson() << std::endl;
- }
- }
- Notify_Exit::notify notify;
- client.remote_end_point_.send(notify);
- return 0;
-}
-
-
diff --git a/graphics/asymptote/LspCpp/examples/WebsocketExample.cpp b/graphics/asymptote/LspCpp/examples/WebsocketExample.cpp
deleted file mode 100644
index b0474bc288..0000000000
--- a/graphics/asymptote/LspCpp/examples/WebsocketExample.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-
-#include "LibLsp/JsonRpc/WebSocketServer.h"
-#include "LibLsp/lsp/textDocument/signature_help.h"
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-#include "LibLsp/lsp/textDocument/typeHierarchy.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-#include "LibLsp/lsp/textDocument/resolveCompletionItem.h"
-#include <network/uri.hpp>
-
-
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/JsonRpc/TcpServer.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-
-#include <boost/filesystem.hpp>
-#include <boost/asio.hpp>
-#include <iostream>
-#include <boost/beast/core.hpp>
-#include <boost/beast/websocket.hpp>
-#include <boost/asio/dispatch.hpp>
-#include <boost/asio/strand.hpp>
-#include <algorithm>
-#include <cstdlib>
-#include <functional>
-#include <iostream>
-#include <memory>
-#include <string>
-#include <thread>
-#include <vector>
-
-#include <boost/beast/version.hpp>
-#include <boost/beast/websocket.hpp>
-#include <boost/asio/dispatch.hpp>
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/RemoteEndPoint.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-
-namespace beast = boost::beast; // from <boost/beast.hpp>
-namespace http = beast::http; // from <boost/beast/http.hpp>
-namespace websocket = beast::websocket; // from <boost/beast/websocket.hpp>
-namespace net = boost::asio; // from <boost/asio.hpp>
-using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
-
-//------------------------------------------------------------------------------
-
-std::string _address = "127.0.0.1";
-std::string _port = "9333";
-
-
-
-
-using namespace std;
-class DummyLog :public lsp::Log
-{
-public:
-
- void log(Level level, std::wstring&& msg)
- {
- std::wcout << msg << std::endl;
- };
- void log(Level level, const std::wstring& msg)
- {
- std::wcout << msg << std::endl;
- };
- void log(Level level, std::string&& msg)
- {
- std::cout << msg << std::endl;
- };
- void log(Level level, const std::string& msg)
- {
- std::cout << msg << std::endl;
- };
-};
-
-
-
-// Sends a WebSocket message and prints the response
-class Client : public std::enable_shared_from_this<Client>
-{
- net::io_context ioc;
- tcp::resolver resolver_;
- websocket::stream<beast::tcp_stream> ws_;
- beast::flat_buffer buffer_;
- std::string host_;
- std::string user_agent_;
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared< lsp::ProtocolJsonHandler>();
- DummyLog _log;
-
- std::shared_ptr<GenericEndpoint> endpoint = std::make_shared<GenericEndpoint>(_log);
-
- std::shared_ptr<lsp::websocket_stream_wrapper> proxy_;
-public:
- RemoteEndPoint point;
-
-public:
- // Resolver and socket require an io_context
- explicit
- Client()
- : resolver_(net::make_strand(ioc))
- , ws_(net::make_strand(ioc)),point(protocol_json_handler, endpoint, _log)
- {
- proxy_ = std::make_shared<lsp::websocket_stream_wrapper>(ws_);
-
- }
-
- // Start the asynchronous operation
- void
- run(
- char const* host,
- char const* port, char const* user_agent)
- {
- // Save these for later
- host_ = host;
- user_agent_ = user_agent;
- // Look up the domain name
- resolver_.async_resolve(
- host,
- port,
- beast::bind_front_handler(
- &Client::on_resolve,
- shared_from_this()));
- std::thread([&]
- {
- ioc.run();
- }).detach();
- while (!point.isWorking())
- {
- std::this_thread::sleep_for(std::chrono::milliseconds (50));
- }
- }
-
- void
- on_resolve(
- beast::error_code ec,
- tcp::resolver::results_type results)
- {
- if (ec)
- return;
-
- // Set the timeout for the operation
- beast::get_lowest_layer(ws_).expires_after(std::chrono::seconds(30));
-
- // Make the connection on the IP address we get from a lookup
- beast::get_lowest_layer(ws_).async_connect(
- results,
- beast::bind_front_handler(
- &Client::on_connect,
- shared_from_this()));
- }
-
- void
- on_connect(beast::error_code ec, tcp::resolver::results_type::endpoint_type)
- {
- if (ec)
- return;
-
- // Turn off the timeout on the tcp_stream, because
- // the websocket stream has its own timeout system.
- beast::get_lowest_layer(ws_).expires_never();
-
- // Set suggested timeout settings for the websocket
- ws_.set_option(
- websocket::stream_base::timeout::suggested(
- beast::role_type::client));
-
- // Set a decorator to change the User-Agent of the handshake
- ws_.set_option(websocket::stream_base::decorator(
- [=](websocket::request_type& req)
- {
- req.set(http::field::user_agent,
- user_agent_.c_str());
- }));
-
- // Perform the websocket handshake
- ws_.async_handshake(host_, "/",
- beast::bind_front_handler(
- &Client::on_handshake,
- shared_from_this()));
- }
-
- void
- on_handshake(beast::error_code ec)
- {
- if (ec)
- return;
-
- // Send the message
-
-
- point.startProcessingMessages(proxy_, proxy_);
- // Read a message into our buffer
- ws_.async_read(
- buffer_,
- beast::bind_front_handler(
- &Client::on_read,
- shared_from_this()));
- }
-
-
- void
- on_read(
- beast::error_code ec,
- std::size_t bytes_transferred)
- {
- boost::ignore_unused(bytes_transferred);
-
- if (ec)
- return;
-
- char* data = reinterpret_cast<char*>(buffer_.data().data());
- std::vector<char> elements(data, data + bytes_transferred);
- buffer_.clear();
- proxy_->on_request.EnqueueAll(std::move(elements), false);
-
- ws_.async_read(
- buffer_,
- beast::bind_front_handler(
- &Client::on_read,
- shared_from_this()));
- }
-
- void
- on_close(beast::error_code ec)
- {
- if (ec)
- return;
-
- // If we get here then the connection is closed gracefully
-
- // The make_printable() function helps print a ConstBufferSequence
- std::cout << beast::make_printable(buffer_.data()) << std::endl;
- }
-};
-
-class Server
-{
-public:
- Server(const std::string& user_agent) : server(user_agent,_address, _port, protocol_json_handler, endpoint, _log)
- {
- server.point.registerHandler(
- [&](const td_initialize::request& req)
- {
- td_initialize::response rsp;
- CodeLensOptions code_lens_options;
- code_lens_options.resolveProvider = true;
- rsp.result.capabilities.codeLensProvider = code_lens_options;
- return rsp;
- });
- std::thread([&]()
- {
- server.run();
- }).detach();
- }
- ~Server()
- {
- server.stop();
- }
- std::shared_ptr < lsp::ProtocolJsonHandler > protocol_json_handler = std::make_shared < lsp::ProtocolJsonHandler >();
- DummyLog _log;
-
- std::shared_ptr < GenericEndpoint > endpoint = std::make_shared<GenericEndpoint>(_log);
- lsp::WebSocketServer server;
-
-};
-
-int main()
-{
- std::string user_agent = std::string(BOOST_BEAST_VERSION_STRING) +" websocket-server-async";
- Server server(user_agent);
-
- auto client = std::make_shared<Client>();
- user_agent = std::string(BOOST_BEAST_VERSION_STRING) + " websocket-client-async";
- client->run(_address.c_str(), _port.c_str(), user_agent.c_str());
-
- td_initialize::request req;
-
- auto rsp = client->point.waitResponse(req);
- if (rsp)
- {
- std::cout << rsp->ToJson() << std::endl;
- }
- return 0;
-}
-
-
-
-
-
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Cancellation.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Cancellation.h
deleted file mode 100644
index 496be29844..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Cancellation.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#pragma once
-#include <functional>
-#include "lsRequestId.h"
-#include <LibLsp/JsonRpc/NotificationInMessage.h>
-using CancelMonitor = std::function<int()>;
-namespace Cancellation
-{
-
- struct Params {
- /**
- * The request id to cancel.
- */
- lsRequestId id;
-
- MAKE_SWAP_METHOD(Cancellation::Params, id);
- };
-
-};
-MAKE_REFLECT_STRUCT(Cancellation::Params, id);
-
-DEFINE_NOTIFICATION_TYPE(Notify_Cancellation, Cancellation::Params,"$/cancelRequest");
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Condition.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Condition.h
deleted file mode 100644
index 6a8cf7a2a6..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Condition.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-#include <condition_variable>
-template <class T>
-class Condition
-{
-public:
-
- std::mutex m_mutex;
- std::condition_variable m_condition;
- ~Condition() {
- m_condition.notify_all();
- }
- void notify(std::unique_ptr<T> data) noexcept
- {
- {
- std::lock_guard<std::mutex> eventLock(m_mutex);
- any.swap(data);
- }
- // wake up one waiter
- m_condition.notify_one();
- };
-
-
- std::unique_ptr<T> wait(unsigned timeout=0)
- {
- std::unique_lock<std::mutex> ul(m_mutex);
- if (!timeout) {
- m_condition.wait(ul,[&]() {
- if (!any)
- return false;
- return true;
- });
- }
- else{
- if(!any){
- std::cv_status status = m_condition.wait_for(ul, std::chrono::milliseconds(timeout));
- if (status == std::cv_status::timeout)
- {
- return {};
- }
- }
- }
- return std::unique_ptr<T>(any.release());
-
- }
-private:
- std::unique_ptr<T> any;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Context.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Context.h
deleted file mode 100644
index 20edf71b1c..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Context.h
+++ /dev/null
@@ -1,216 +0,0 @@
-//===--- Context.h - Mechanism for passing implicit data --------*- C++-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// Context for storing and retrieving implicit data. Useful for passing implicit
-// parameters on a per-request basis.
-//
-//===----------------------------------------------------------------------===//
-
-#pragma once
-
-#include <memory>
-#include <type_traits>
-
-namespace lsp {
-
-
-/// Values in a Context are indexed by typed keys.
-/// Key<T> serves two purposes:
-/// - it provides a lookup key for the context (each Key is unique),
-/// - it makes lookup type-safe: a Key<T> can only map to a T (or nothing).
-///
-/// Example:
-/// Key<int> RequestID;
-/// Key<int> Version;
-///
-/// Context Ctx = Context::empty().derive(RequestID, 10).derive(Version, 3);
-/// assert(*Ctx.get(RequestID) == 10);
-/// assert(*Ctx.get(Version) == 3);
-///
-/// Keys are typically used across multiple functions, so most of the time you
-/// would want to make them static class members or global variables.
-template <class Type> class Key {
-public:
- static_assert(!std::is_reference<Type>::value,
- "Reference arguments to Key<> are not allowed");
-
- constexpr Key() = default;
-
- Key(Key const &) = delete;
- Key &operator=(Key const &) = delete;
- Key(Key &&) = delete;
- Key &operator=(Key &&) = delete;
-};
-
-/// A context is an immutable container for per-request data that must be
-/// propagated through layers that don't care about it. An example is a request
-/// ID that we may want to use when logging.
-///
-/// Conceptually, a context is a heterogeneous map<Key<T>, T>. Each key has
-/// an associated value type, which allows the map to be typesafe.
-///
-/// There is an "ambient" context for each thread, Context::current().
-/// Most functions should read from this, and use WithContextValue or
-/// WithContext to extend or replace the context within a block scope.
-/// Only code dealing with threads and extension points should need to use
-/// other Context objects.
-///
-/// You can't add data to an existing context, instead you create a new
-/// immutable context derived from it with extra data added. When you retrieve
-/// data, the context will walk up the parent chain until the key is found.
-class Context {
-public:
- /// Returns an empty root context that contains no data.
- static Context empty();
- /// Returns the context for the current thread, creating it if needed.
- static const Context &current();
- // Sets the current() context to Replacement, and returns the old context.
- // Prefer to use WithContext or WithContextValue to do this safely.
- static Context swapCurrent(Context Replacement);
-
-private:
- struct Data;
- Context(std::shared_ptr<const Data> DataPtr);
-
-public:
- /// Same as Context::empty(), please use Context::empty() instead.
- Context() = default;
-
- /// Copy operations for this class are deleted, use an explicit clone() method
- /// when you need a copy of the context instead.
- Context(Context const &) = delete;
- Context &operator=(const Context &) = delete;
-
- Context(Context &&) = default;
- Context &operator=(Context &&) = default;
-
- /// Get data stored for a typed \p Key. If values are not found
- /// \returns Pointer to the data associated with \p Key. If no data is
- /// specified for \p Key, return null.
- template <class Type> const Type *get(const Key<Type> &Key) const {
- for (const Data *DataPtr = this->dataPtr.get(); DataPtr != nullptr;
- DataPtr = DataPtr->parent.get()) {
- if (DataPtr->KeyPtr == &Key)
- return static_cast<const Type *>(DataPtr->value->getValuePtr());
- }
- return nullptr;
- }
-
- /// A helper to get a reference to a \p Key that must exist in the map.
- /// Must not be called for keys that are not in the map.
- template <class Type> const Type &getExisting(const Key<Type> &Key) const {
- auto Val = get(Key);
- assert(Val && "Key does not exist");
- return *Val;
- }
-
- /// Derives a child context
- /// It is safe to move or destroy a parent context after calling derive().
- /// The child will keep its parent alive, and its data remains accessible.
- template <class Type>
- Context derive(const Key<Type> &Key,
- typename std::decay<Type>::type Value) const & {
- return Context(std::make_shared<Data>(
- Data{/*parent=*/dataPtr, &Key,
- std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
- std::move(Value))}));
- }
-
- template <class Type>
- Context
- derive(const Key<Type> &Key,
- typename std::decay<Type>::type Value) && /* takes ownership */ {
- return Context(std::make_shared<Data>(
- Data{/*parent=*/std::move(dataPtr), &Key,
- std::make_unique<TypedAnyStorage<typename std::decay<Type>::type>>(
- std::move(Value))}));
- }
-
- /// Derives a child context, using an anonymous key.
- /// Intended for objects stored only for their destructor's side-effect.
- template <class Type> Context derive(Type &&Value) const & {
- static Key<typename std::decay<Type>::type> Private;
- return derive(Private, std::forward<Type>(Value));
- }
-
- template <class Type> Context derive(Type &&Value) && {
- static Key<typename std::decay<Type>::type> Private;
- return std::move(*this).derive(Private, std::forward<Type>(Value));
- }
-
- /// Clone this context object.
- Context clone() const;
-
-private:
- class AnyStorage {
- public:
- virtual ~AnyStorage() = default;
- virtual void *getValuePtr() = 0;
- };
-
- template <class T> class TypedAnyStorage : public Context::AnyStorage {
- static_assert(std::is_same<typename std::decay<T>::type, T>::value,
- "Argument to TypedAnyStorage must be decayed");
-
- public:
- TypedAnyStorage(T &&Value) : value(std::move(Value)) {}
-
- void *getValuePtr() override { return &value; }
-
- private:
- T value;
- };
-
- struct Data {
- // We need to make sure parent outlives the value, so the order of members
- // is important. We do that to allow classes stored in Context's child
- // layers to store references to the data in the parent layers.
- std::shared_ptr<const Data> parent;
- const void *KeyPtr;
- std::unique_ptr<AnyStorage> value;
- };
-
- std::shared_ptr<const Data> dataPtr;
-};
-
-/// WithContext replaces Context::current() with a provided scope.
-/// When the WithContext is destroyed, the original scope is restored.
-/// For extending the current context with new value, prefer WithContextValue.
-class WithContext {
-public:
- WithContext(Context C) : restore(Context::swapCurrent(std::move(C))) {}
- ~WithContext() { Context::swapCurrent(std::move(restore)); }
- WithContext(const WithContext &) = delete;
- WithContext &operator=(const WithContext &) = delete;
- WithContext(WithContext &&) = delete;
- WithContext &operator=(WithContext &&) = delete;
-
-private:
- Context restore;
-};
-
-/// WithContextValue extends Context::current() with a single value.
-/// When the WithContextValue is destroyed, the original scope is restored.
-class WithContextValue {
-public:
- template <typename T>
- WithContextValue(const Key<T> &K, typename std::decay<T>::type V)
- : restore(Context::current().derive(K, std::move(V))) {}
-
- // Anonymous values can be used for the destructor side-effect.
- template <typename T>
- WithContextValue(T &&V)
- : restore(Context::current().derive(std::forward<T>(V))) {}
-
-private:
- WithContext restore;
-};
-
-
-} // namespace lsp
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Endpoint.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Endpoint.h
deleted file mode 100644
index d752711a3a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/Endpoint.h
+++ /dev/null
@@ -1,53 +0,0 @@
-#pragma once
-#include <map>
-#include <functional>
-#include <memory>
-#include "MessageIssue.h"
-struct LspMessage;
-struct NotificationInMessage;
-struct lsBaseOutMessage;
-struct RequestInMessage;
-
-using GenericResponseHandler = std::function< bool(std::unique_ptr<LspMessage>) >;
-using GenericRequestHandler = std::function< bool(std::unique_ptr<LspMessage>) >;
-using GenericNotificationHandler = std::function< bool(std::unique_ptr<LspMessage>) >;
-
-class Endpoint
-{
-public:
- virtual ~Endpoint() = default;
- virtual bool onRequest(std::unique_ptr<LspMessage>) = 0;
- virtual bool notify(std::unique_ptr<LspMessage>) = 0;
-
- virtual bool onResponse(const std::string&, std::unique_ptr<LspMessage>) = 0;
- virtual void registerRequestHandler(const std::string&, GenericResponseHandler ) = 0;
- virtual void registerNotifyHandler(const std::string&, GenericNotificationHandler ) = 0;
-};
-
-class GenericEndpoint :public Endpoint
-{
-
-public:
- GenericEndpoint(lsp::Log& l):log(l){}
- bool notify(std::unique_ptr<LspMessage>) override;
- bool onResponse(const std::string&, std::unique_ptr<LspMessage>) override;
-
- bool onRequest(std::unique_ptr<LspMessage>) override;
- std::map< std::string, GenericRequestHandler > method2request;
- std::map< std::string, GenericResponseHandler > method2response;
- std::map< std::string, GenericNotificationHandler > method2notification;
-
- void registerRequestHandler(const std::string& method, GenericResponseHandler cb) override
- {
- method2request[method] = cb;
- }
-
- void registerNotifyHandler(const std::string& method, GenericNotificationHandler cb) override
- {
- method2notification[method] = cb;
- }
- lsp::Log& log;
-
-
-
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/GCThreadContext.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/GCThreadContext.h
deleted file mode 100644
index 6c9f9c1cbb..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/GCThreadContext.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#pragma once
-
-#if defined(LSPCPP_USEGC)
-#define GC_THREADS
-#include <gc.h>
-#endif
-
-class GCThreadContext
-{
-public:
- GCThreadContext();
- ~GCThreadContext();
-
-private:
-#if defined(LSPCPP_USEGC)
- GC_stack_base gsb;
-#endif
-
-}; \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageIssue.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageIssue.h
deleted file mode 100644
index 6c29ee8f0e..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageIssue.h
+++ /dev/null
@@ -1,182 +0,0 @@
-#pragma once
-#include <string>
-#include <functional>
-#include <vector>
-namespace lsp
-{
- class Log
- {
- public:
- virtual ~Log() = default;
-
- enum class Level
- {
- /**
- * OFF is a special level that can be used to turn off logging.
-
- */
- OFF = 1,
-
- /**
- * SEVERE is a message level indicating a serious failure.
- * <p>
- * In general SEVERE messages should describe events that are
- * of considerable importance and which will prevent normal
- * program execution. They should be reasonably intelligible
- * to end users and to system administrators.
-
- */
- SEVERE = 2,
-
- /**
- * WARNING is a message level indicating a potential problem.
- * <p>
- * In general WARNING messages should describe events that will
- * be of interest to end users or system managers, or which
- * indicate potential problems.
-
- *
- */
- WARNING = 3,
- /**
- * INFO is a message level for informational messages.
- * <p>
- * Typically INFO messages will be written to the console
- * or its equivalent. So the INFO level should only be
- * used for reasonably significant messages that will
- * make sense to end users and system administrators.
-
- */
- INFO = 3,
- /**
- * CONFIG is a message level for static configuration messages.
- * <p>
- * CONFIG messages are intended to provide a variety of static
- * configuration information, to assist in debugging problems
- * that may be associated with particular configurations.
- * For example, CONFIG message might include the CPU type,
- * the graphics depth, the GUI look-and-feel, etc.
- * This level is initialized to <CODE>4</CODE>.
- */
-
- CONFIG = 4,
-
-
-
- /**
- * FINE is a message level providing tracing information.
- * <p>
- * All of FINE, FINER, and FINEST are intended for relatively
- * detailed tracing. The exact meaning of the three levels will
- * vary between subsystems, but in general, FINEST should be used
- * for the most voluminous detailed output, FINER for somewhat
- * less detailed output, and FINE for the lowest volume (and
- * most important) messages.
- * <p>
- * In general the FINE level should be used for information
- * that will be broadly interesting to developers who do not have
- * a specialized interest in the specific subsystem.
- * <p>
- * FINE messages might include things like minor (recoverable)
- * failures. Issues indicating potential performance problems
- * are also worth logging as FINE.
- * This level is initialized to <CODE>5</CODE>.
- */
- FINE = 5,
-
- /**
- * FINER indicates a fairly detailed tracing message.
- * By default logging calls for entering, returning, or throwing
- * an exception are traced at this level.
- * This level is initialized to <CODE>400</CODE>.
- */
- FINER = 6,
-
- /**
- * FINEST indicates a highly detailed tracing message.
- * This level is initialized to <CODE>300</CODE>.
- */
- FINEST = 7,
-
- /**
- * ALL indicates that all messages should be logged.
- * This level is initialized to <CODE>Integer.MIN_VALUE</CODE>.
- */
- ALL,
- };
- virtual void log(Level level, std::wstring&& msg) = 0;
- virtual void log(Level level, const std::wstring& msg) = 0;
- virtual void log(Level level, std::string&& msg) = 0;
- virtual void log(Level level, const std::string& msg) = 0;
-
- void info(const std::string& msg)
- {
- log(Level::INFO, msg);
- }
- void info(const std::wstring& msg)
- {
- log(Level::INFO, msg);
- }
- void error(const std::string& msg)
- {
- log(Level::SEVERE, msg);
- }
- void error(const std::wstring& msg)
- {
- log(Level::SEVERE, msg);
- }
- void warning(const std::string& msg)
- {
- log(Level::WARNING, msg);
- }
- void warning(const std::wstring& msg)
- {
- log(Level::WARNING, msg);
- }
- };
-}
-
-class MessageIssue {
-
-public:
- std::string text;
-
- lsp::Log::Level code;
-
- MessageIssue(const std::string& text, lsp::Log::Level code) :text(text), code(code)
- {
-
-
- }
- MessageIssue(std::string&& text, lsp::Log::Level code) :text(text), code(code)
- {
-
-
- }
-
-
- std::string getText() {
- return text;
- }
-
- lsp::Log::Level getIssueCode() {
- return code;
- }
-
-
- std::string toString() {
- return getText();
- }
-
-};
-class MessageIssueHandler
-{
-public:
- /**
- * Handle issues found while parsing or validating a message. The list of issues must not be empty.
- */
- virtual ~MessageIssueHandler() = default;
-
- virtual void handle(std::vector<MessageIssue>&&) = 0;
- virtual void handle( MessageIssue&&) = 0;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageJsonHandler.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageJsonHandler.h
deleted file mode 100644
index f019fbf121..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageJsonHandler.h
+++ /dev/null
@@ -1,61 +0,0 @@
-#pragma once
-#include <string>
-#include <map>
-#include <functional>
-#include <LibLsp/JsonRpc/message.h>
-class Reader;
-
-
-using GenericRequestJsonHandler = std::function< std::unique_ptr<LspMessage>(Reader&) >;
-using GenericResponseJsonHandler = std::function< std::unique_ptr<LspMessage>(Reader&) >;
-using GenericNotificationJsonHandler = std::function< std::unique_ptr<LspMessage>(Reader&) >;
-
-class MessageJsonHandler
-{
-public:
- std::map< std::string, GenericRequestJsonHandler > method2request;
- std::map< std::string, GenericResponseJsonHandler > method2response;
- std::map< std::string, GenericNotificationJsonHandler > method2notification;
-
-
- const GenericRequestJsonHandler* GetRequestJsonHandler(const char* methodInfo) const
- {
- const auto findIt = method2request.find(methodInfo);
- return findIt == method2request.end() ? nullptr : &findIt->second;
- }
-
- void SetRequestJsonHandler(const std::string& methodInfo, GenericRequestJsonHandler handler)
- {
- method2request[methodInfo] = handler;
- }
-
- const GenericResponseJsonHandler* GetResponseJsonHandler(const char* methodInfo) const
- {
- const auto findIt = method2response.find(methodInfo);
- return findIt == method2response.end() ? nullptr : &findIt->second;
- }
-
- void SetResponseJsonHandler(const std::string& methodInfo,GenericResponseJsonHandler handler)
- {
- method2response[methodInfo] = handler;
- }
-
- const GenericNotificationJsonHandler* GetNotificationJsonHandler(const char* methodInfo) const
- {
- const auto findIt = method2notification.find(methodInfo);
- return findIt == method2notification.end() ? nullptr : &findIt->second;
- }
-
- void SetNotificationJsonHandler(const std::string& methodInfo, GenericNotificationJsonHandler handler)
- {
- method2notification[methodInfo] = handler;
- }
-
-
-
- std::unique_ptr<LspMessage> parseResponseMessage(const std::string&, Reader&);
- std::unique_ptr<LspMessage> parseRequstMessage(const std::string&, Reader&);
- bool resovleResponseMessage(Reader&, std::pair<std::string, std::unique_ptr<LspMessage>>& result);
- std::unique_ptr<LspMessage> parseNotificationMessage(const std::string&, Reader&);
-};
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageProducer.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageProducer.h
deleted file mode 100644
index 4f3799555a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/MessageProducer.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-#include <string>
-#include <functional>
-
-namespace lsp {
- /// The encoding style of the JSON-RPC messages (both input and output).
- enum JSONStreamStyle {
- /// Encoding per the LSP specification, with mandatory Content-Length header.
- Standard,
- /// Messages are delimited by a '// -----' line. Comment lines start with //.
- Delimited
- };
-}
-class MessageProducer
-{
-public:
- typedef std::function< void(std::string&&) > MessageConsumer;
- virtual ~MessageProducer() = default;
- virtual void listen(MessageConsumer) = 0;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/NotificationInMessage.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/NotificationInMessage.h
deleted file mode 100644
index cdee9e572e..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/NotificationInMessage.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#pragma once
-
-
-#include "lsRequestId.h"
-#include "LibLsp/JsonRpc/message.h"
-
-
-
-// NotificationInMessage does not have |id|.
-struct NotificationInMessage : public LspMessage {
-
- Kind GetKid() override
- {
- return NOTIFICATION_MESSAGE;
- }
- MethodType GetMethodType() const override
- {
- return method.c_str();
- }
- void SetMethodType(MethodType _t) override
- {
- method = _t;
- }
- std::string method;
-};
-template <class T, class TDerived >
-struct lsNotificationInMessage : NotificationInMessage {
-
- void ReflectWriter(Writer& writer) override {
- Reflect(writer, static_cast<TDerived&>(*this));
- }
- lsNotificationInMessage(MethodType _method)
- {
- method = _method;
- }
-
- static std::unique_ptr<LspMessage> ReflectReader(Reader& visitor) {
-
- TDerived* temp = new TDerived();
-
- std::unique_ptr<TDerived> message = std::unique_ptr<TDerived>(temp);
- // Reflect may throw and *message will be partially deserialized.
- Reflect(visitor, static_cast<TDerived&>(*temp));
- return message;
-
- }
- void swap(lsNotificationInMessage& arg) noexcept
- {
- method.swap(method);
- std::swap(params, arg.params);
- }
- T params;
-};
-
-#define DEFINE_NOTIFICATION_TYPE(MSG,paramType,methodInfo)\
-namespace MSG {\
- struct notify : public lsNotificationInMessage< paramType , notify >{\
- static constexpr MethodType kMethodInfo = methodInfo;\
- notify():lsNotificationInMessage(kMethodInfo){} \
- };\
-};\
-MAKE_REFLECT_STRUCT(MSG::notify, jsonrpc,method, params)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RemoteEndPoint.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RemoteEndPoint.h
deleted file mode 100644
index 8d013bd889..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RemoteEndPoint.h
+++ /dev/null
@@ -1,350 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/lsp_diagnostic.h"
-#include "LibLsp/JsonRpc/Cancellation.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "traits.h"
-#include <future>
-#include <string>
-#include "threaded_queue.h"
-#include <unordered_map>
-#include "MessageIssue.h"
-#include "LibLsp/JsonRpc/MessageJsonHandler.h"
-#include "Endpoint.h"
-#include "future.h"
-#include "MessageProducer.h"
-
-
-class MessageJsonHandler;
-class Endpoint;
-struct LspMessage;
-class RemoteEndPoint;
-namespace lsp {
- class ostream;
- class istream;
-
- ////////////////////////////////////////////////////////////////////////////////
- // ResponseOrError<T>
- ////////////////////////////////////////////////////////////////////////////////
-
- // ResponseOrError holds either the response to a request or an error
- // message.
- template <typename T>
- struct ResponseOrError {
- using Request = T;
- ResponseOrError();
- ResponseOrError(const T& response);
- ResponseOrError(T&& response);
- ResponseOrError(const Rsp_Error& error);
- ResponseOrError(Rsp_Error&& error);
- ResponseOrError(const ResponseOrError& other);
- ResponseOrError(ResponseOrError&& other) noexcept;
-
- ResponseOrError& operator=(const ResponseOrError& other);
- ResponseOrError& operator=(ResponseOrError&& other) noexcept;
- bool IsError() const { return is_error; }
- std::string ToJson()
- {
- if (is_error) return error.ToJson();
- return response.ToJson();
- }
- T response;
- Rsp_Error error; // empty represents success.
- bool is_error;
- };
-
- template <typename T>
- ResponseOrError<T>::ResponseOrError(): is_error(false)
- {
- }
-
- template <typename T>
- ResponseOrError<T>::ResponseOrError(const T& resp) : response(resp), is_error(false) {}
- template <typename T>
- ResponseOrError<T>::ResponseOrError(T&& resp) : response(std::move(resp)), is_error(false) {}
- template <typename T>
- ResponseOrError<T>::ResponseOrError(const Rsp_Error& err) : error(err), is_error(true) {}
- template <typename T>
- ResponseOrError<T>::ResponseOrError(Rsp_Error&& err) : error(std::move(err)), is_error(true) {}
- template <typename T>
- ResponseOrError<T>::ResponseOrError(const ResponseOrError& other)
- : response(other.response), error(other.error), is_error(other.is_error) {}
- template <typename T>
- ResponseOrError<T>::ResponseOrError(ResponseOrError&& other) noexcept
- : response(std::move(other.response)), error(std::move(other.error)), is_error(other.is_error) {}
- template <typename T>
- ResponseOrError<T>& ResponseOrError<T>::operator=(
- const ResponseOrError& other) {
- response = other.response;
- error = other.error;
- is_error = other.is_error;
- return *this;
- }
- template <typename T>
- ResponseOrError<T>& ResponseOrError<T>::operator=(ResponseOrError&& other) noexcept
- {
- response = std::move(other.response);
- error = std::move(other.error);
- is_error = other.is_error;
- return *this;
- }
-
-}
-
-
-class RemoteEndPoint :MessageIssueHandler
-{
-
- template <typename F, int N>
- using ParamType = lsp::traits::ParameterType<F, N>;
-
- template <typename T>
- using IsRequest = lsp::traits::EnableIfIsType<RequestInMessage, T>;
-
- template <typename T>
- using IsResponse = lsp::traits::EnableIfIsType<ResponseInMessage, T>;
-
- template <typename T>
- using IsNotify = lsp::traits::EnableIfIsType<NotificationInMessage, T>;
-
-
- template <typename F, typename ReturnType>
- using IsRequestHandler = lsp::traits::EnableIf<lsp::traits::CompatibleWith<
- F,
- std::function<ReturnType(const RequestInMessage&)>>::
- value>;
-
- template <typename F, typename ReturnType>
- using IsRequestHandlerWithMonitor = lsp::traits::EnableIf<lsp::traits::CompatibleWith<
- F,
- std::function<ReturnType(const RequestInMessage&,const CancelMonitor&)>>::
- value>;
-
-public:
-
-
- RemoteEndPoint(const std::shared_ptr <MessageJsonHandler>& json_handler,
- const std::shared_ptr < Endpoint >& localEndPoint,
- lsp::Log& _log,
- lsp::JSONStreamStyle style = lsp::JSONStreamStyle::Standard,
- uint8_t max_workers = 2);
-
- ~RemoteEndPoint() override;
- template <typename F, typename RequestType = ParamType<F, 0>, typename ResponseType = typename RequestType::Response>
- IsRequestHandler< F, lsp::ResponseOrError<ResponseType> > registerHandler(F&& handler)
- {
- processRequestJsonHandler(handler);
- local_endpoint->registerRequestHandler(RequestType::kMethodInfo, [=](std::unique_ptr<LspMessage> msg) {
- auto req = reinterpret_cast<const RequestType*>(msg.get());
- lsp::ResponseOrError<ResponseType> res(handler(*req));
- if (res.is_error) {
- res.error.id = req->id;
- send(res.error);
- }
- else
- {
- res.response.id = req->id;
- send(res.response);
- }
- return true;
- });
- }
- template <typename F, typename RequestType = ParamType<F, 0>, typename ResponseType = typename RequestType::Response>
- IsRequestHandlerWithMonitor< F, lsp::ResponseOrError<ResponseType> > registerHandler(F&& handler) {
- processRequestJsonHandler(handler);
- local_endpoint->registerRequestHandler(RequestType::kMethodInfo, [=](std::unique_ptr<LspMessage> msg) {
- auto req = static_cast<const RequestType*>(msg.get());
- lsp::ResponseOrError<ResponseType> res(handler(*req , getCancelMonitor(req->id)));
- if (res.is_error) {
- res.error.id = req->id;
- send(res.error);
- }
- else
- {
- res.response.id = req->id;
- send(res.response);
- }
- return true;
- });
- }
- using RequestErrorCallback = std::function<void(const Rsp_Error&)>;
-
- template <typename T, typename F, typename ResponseType = ParamType<F, 0> >
- void send(T& request, F&& handler, RequestErrorCallback onError)
- {
- processRequestJsonHandler(handler);
- auto cb = [=](std::unique_ptr<LspMessage> msg) {
- if (!msg)
- return true;
- const auto result = msg.get();
-
- if (static_cast<ResponseInMessage*>(result)->IsErrorType()) {
- const auto rsp_error = static_cast<const Rsp_Error*>(result);
- onError(*rsp_error);
- }
- else {
- handler(*static_cast<ResponseType*>(result));
- }
-
- return true;
- };
- internalSendRequest(request, cb);
- }
-
-
- template <typename F, typename NotifyType = ParamType<F, 0> >
- IsNotify<NotifyType> registerHandler(F&& handler) {
- {
- std::lock_guard<std::mutex> lock(m_sendMutex);
- if (!jsonHandler->GetNotificationJsonHandler(NotifyType::kMethodInfo))
- {
- jsonHandler->SetNotificationJsonHandler(NotifyType::kMethodInfo,
- [](Reader& visitor)
- {
- return NotifyType::ReflectReader(visitor);
- });
- }
- }
- local_endpoint->registerNotifyHandler(NotifyType::kMethodInfo, [=](std::unique_ptr<LspMessage> msg) {
- handler(*static_cast<NotifyType*>(msg.get()));
- return true;
- });
- }
-
- template <typename T, typename = IsRequest<T>>
- lsp::future< lsp::ResponseOrError<typename T::Response> > send(T& request) {
-
- processResponseJsonHandler(request);
- using Response = typename T::Response;
- auto promise = std::make_shared< lsp::promise<lsp::ResponseOrError<Response>>>();
- auto cb = [=](std::unique_ptr<LspMessage> msg) {
- if (!msg)
- return true;
- auto result = msg.get();
-
- if (reinterpret_cast<ResponseInMessage*>(result)->IsErrorType())
- {
- Rsp_Error* rsp_error = static_cast<Rsp_Error*>(result);
- Rsp_Error temp;
- std::swap(temp, *rsp_error);
- promise->set_value(std::move(lsp::ResponseOrError<Response>(std::move(temp))));
- }
- else
- {
- Response temp;
- std::swap(temp, *static_cast<Response*>(result));
- promise->set_value(std::move(lsp::ResponseOrError<Response>(std::move(temp))));
- }
- return true;
- };
- internalSendRequest(request, cb);
- return promise->get_future();
- }
-
- template <typename T, typename = IsRequest<T>>
- std::unique_ptr<lsp::ResponseOrError<typename T::Response>> waitResponse(T& request, const unsigned time_out = 0)
- {
- auto future_rsp = send(request);
- if (time_out == 0)
- {
- future_rsp.wait();
- }
- else
- {
- auto state = future_rsp.wait_for(std::chrono::milliseconds(time_out));
- if (lsp::future_status::timeout == state)
- {
- return {};
- }
- }
-
- using Response = typename T::Response;
- return std::make_unique<lsp::ResponseOrError<Response>>(std::move(future_rsp.get()));
- }
-
- void send(NotificationInMessage& msg)
- {
- sendMsg(msg);
- }
-
- void send(ResponseInMessage& msg)
- {
- sendMsg(msg);
- }
-
- void sendNotification(NotificationInMessage& msg)
- {
- send(msg);
- }
- void sendResponse(ResponseInMessage& msg)
- {
- send(msg);
- }
- template <typename T>
- T createRequest() {
- auto req = T();
- req.id.set(getNextRequestId());
- return req;
- }
-
- int getNextRequestId();
-
- bool cancelRequest(const lsRequestId&);
-
- void startProcessingMessages(std::shared_ptr<lsp::istream> r,
- std::shared_ptr<lsp::ostream> w);
-
- bool isWorking() const;
- void stop();
-
- std::unique_ptr<LspMessage> internalWaitResponse(RequestInMessage&, unsigned time_out = 0);
-
- bool internalSendRequest(RequestInMessage &info, GenericResponseHandler handler);
-
- void handle(std::vector<MessageIssue>&&) override;
- void handle(MessageIssue&&) override;
-private:
- CancelMonitor getCancelMonitor(const lsRequestId&);
- void sendMsg(LspMessage& msg);
- void mainLoop(std::unique_ptr<LspMessage>);
- bool dispatch(const std::string&);
- template <typename F, typename RequestType = ParamType<F, 0>>
- IsRequest<RequestType> processRequestJsonHandler(const F& handler) {
- std::lock_guard<std::mutex> lock(m_sendMutex);
- if (!jsonHandler->GetRequestJsonHandler(RequestType::kMethodInfo))
- {
- jsonHandler->SetRequestJsonHandler(RequestType::kMethodInfo,
- [](Reader& visitor)
- {
- return RequestType::ReflectReader(visitor);
- });
- }
- }
- template <typename T, typename = IsRequest<T>>
- void processResponseJsonHandler(T& request)
- {
- using Response = typename T::Response;
- std::lock_guard<std::mutex> lock(m_sendMutex);
- if (!jsonHandler->GetResponseJsonHandler(T::kMethodInfo))
- {
- jsonHandler->SetResponseJsonHandler(T::kMethodInfo, [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return Response::ReflectReader(visitor);
- });
- }
- }
-
- struct Data;
-
- Data* d_ptr;
-
- std::shared_ptr < MessageJsonHandler> jsonHandler;
- std::mutex m_sendMutex;
-
- std::shared_ptr < Endpoint > local_endpoint;
-public:
- std::shared_ptr < std::thread > message_producer_thread_;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RequestInMessage.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RequestInMessage.h
deleted file mode 100644
index 0775b36dba..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/RequestInMessage.h
+++ /dev/null
@@ -1,70 +0,0 @@
-#pragma once
-
-
-#include "serializer.h"
-#include <atomic>
-#include <mutex>
-#include "lsRequestId.h"
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/method_type.h"
-#include "lsResponseMessage.h"
-
-struct RequestInMessage : public LspMessage {
- // number or string, actually no null
- lsRequestId id;
- std::string method;
- Kind GetKid() override
- {
- return REQUEST_MESSAGE;
- }
-
-};
-
-
-
-template <class T, class TDerived >
-struct lsRequest : public RequestInMessage
-{
- lsRequest(MethodType _method)
- {
- method = _method;
- }
- MethodType GetMethodType() const override { return method.c_str(); }
- void SetMethodType(MethodType _method) override
- {
- method = _method;
- } \
- void ReflectWriter(Writer& writer) override {
- Reflect(writer, static_cast<TDerived&>(*this));
- }
-
- static std::unique_ptr<LspMessage> ReflectReader(Reader& visitor) {
-
- TDerived* temp = new TDerived();
- std::unique_ptr<TDerived> message = std::unique_ptr<TDerived>(temp);
- // Reflect may throw and *message will be partially deserialized.
- Reflect(visitor, static_cast<TDerived&>(*temp));
- return message;
- }
- void swap(lsRequest& arg) noexcept
- {
- id.swap(arg.id);
- method.swap(method);
- std::swap(params, arg.params);
- }
- T params;
-};
-
-
-#define DEFINE_REQUEST_RESPONSE_TYPE(MSG,request_param,response_result,methodInfo)\
-namespace MSG {\
- struct response :public ResponseMessage< response_result, response> {}; \
- struct request : public lsRequest< request_param , request >{\
- static constexpr MethodType kMethodInfo = methodInfo;\
- request():lsRequest(kMethodInfo){} \
- using Response = response;\
- };\
-};\
-MAKE_REFLECT_STRUCT(MSG::request, jsonrpc, id, method, params);\
-MAKE_REFLECT_STRUCT(MSG::response, jsonrpc, id, result);
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/ScopeExit.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/ScopeExit.h
deleted file mode 100644
index 024b700b4a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/ScopeExit.h
+++ /dev/null
@@ -1,59 +0,0 @@
-//===- llvm/ADT/ScopeExit.h - Execute code at scope exit --------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-//
-// This file defines the make_scope_exit function, which executes user-defined
-// cleanup logic at scope exit.
-//
-//===----------------------------------------------------------------------===//
-#pragma once
-#include <type_traits>
-#include <utility>
-
-namespace lsp {
-namespace detail {
-
-template <typename Callable> class scope_exit {
- Callable ExitFunction;
- bool Engaged = true; // False once moved-from or release()d.
-
-public:
- template <typename Fp>
- explicit scope_exit(Fp &&F) : ExitFunction(std::forward<Fp>(F)) {}
-
- scope_exit(scope_exit &&Rhs)
- : ExitFunction(std::move(Rhs.ExitFunction)), Engaged(Rhs.Engaged) {
- Rhs.release();
- }
- scope_exit(const scope_exit &) = delete;
- scope_exit &operator=(scope_exit &&) = delete;
- scope_exit &operator=(const scope_exit &) = delete;
-
- void release() { Engaged = false; }
-
- ~scope_exit() {
- if (Engaged)
- ExitFunction();
- }
-};
-
-} // end namespace detail
-
-// Keeps the callable object that is passed in, and execute it at the
-// destruction of the returned object (usually at the scope exit where the
-// returned object is kept).
-//
-// Interface is specified by p0052r2.
-template <typename Callable>
- detail::scope_exit<typename std::decay<Callable>::type>
-make_scope_exit(Callable &&F) {
- return detail::scope_exit<typename std::decay<Callable>::type>(
- std::forward<Callable>(F));
-}
-
-} // end namespace lsp
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/StreamMessageProducer.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/StreamMessageProducer.h
deleted file mode 100644
index 9cd6aef37f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/StreamMessageProducer.h
+++ /dev/null
@@ -1,91 +0,0 @@
-#pragma once
-#include <string>
-#include <functional>
-#include "MessageProducer.h"
-#include <iostream>
-#include <memory>
-#include "MessageIssue.h"
-
-namespace lsp {
- class istream;
-}
-
-class StreamMessageProducer : public MessageProducer
-{
-public:
-
- StreamMessageProducer(
- MessageIssueHandler& message_issue_handler, std::shared_ptr < lsp::istream> _input)
- : issueHandler(message_issue_handler),
- input(_input)
- {
- }
- StreamMessageProducer(
- MessageIssueHandler& message_issue_handler)
- : issueHandler(message_issue_handler)
- {
- }
-
- bool keepRunning = false;
-
- virtual void bind(std::shared_ptr<lsp::istream>) = 0 ;
-
-protected:
- MessageIssueHandler& issueHandler;
- std::shared_ptr < lsp::istream> input;
-
-};
-
-class LSPStreamMessageProducer : public StreamMessageProducer
-{
-public:
- struct Headers
- {
- int contentLength = -1;
- std::string charset;
- void clear()
- {
- contentLength = -1;
- charset.clear();
- }
- };
- bool handleMessage(Headers& headers, MessageConsumer callBack);
-
- LSPStreamMessageProducer(
- MessageIssueHandler& message_issue_handler, std::shared_ptr < lsp::istream> _input)
- : StreamMessageProducer(message_issue_handler,_input)
- {
- }
- LSPStreamMessageProducer(
- MessageIssueHandler& message_issue_handler)
- : StreamMessageProducer(message_issue_handler)
- {
- }
-
-
- void listen(MessageConsumer) override;
- void bind(std::shared_ptr<lsp::istream>) override;
- void parseHeader(std::string& line, Headers& headers);
-
-
-};
-class DelimitedStreamMessageProducer : public StreamMessageProducer
-{
-public:
-
- DelimitedStreamMessageProducer(
- MessageIssueHandler& message_issue_handler, std::shared_ptr <lsp::istream> _input)
- : StreamMessageProducer(message_issue_handler,_input)
- {
- }
- DelimitedStreamMessageProducer(
- MessageIssueHandler& message_issue_handler)
- : StreamMessageProducer(message_issue_handler)
- {
- }
-
-
- void listen(MessageConsumer) override;
- void bind(std::shared_ptr < lsp::istream>) override;
-
-}; \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/TcpServer.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/TcpServer.h
deleted file mode 100644
index a377be8c3e..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/TcpServer.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-
-#include <boost/asio.hpp>
-#include <string>
-#include "RemoteEndPoint.h"
-
-namespace lsp {
- class Log;
-}
-namespace lsp
-{
- /// The top-level class of the HTTP server.
- class TcpServer
- {
- public:
- TcpServer(const TcpServer&) = delete;
- TcpServer& operator=(const TcpServer&) = delete;
- ~TcpServer();
- /// Construct the server to listen on the specified TCP address and port, and
- /// serve up files from the given directory.
- explicit TcpServer(const std::string& address, const std::string& port,
- std::shared_ptr < MessageJsonHandler> json_handler,
- std::shared_ptr < Endpoint> localEndPoint, lsp::Log& ,uint32_t _max_workers = 2);
-
- /// Run the server's io_context loop.
- void run();
- void stop();
-
- RemoteEndPoint point;
- private:
- struct Data;
- /// Perform an asynchronous accept operation.
- void do_accept();
-
- /// Wait for a request to stop the server.
- void do_stop();
- Data* d_ptr = nullptr;
- };
-} // namespace
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/WebSocketServer.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/WebSocketServer.h
deleted file mode 100644
index 5206525ceb..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/WebSocketServer.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#pragma once
-
-#include <boost/asio.hpp>
-#include <string>
-#include <boost/beast/core/tcp_stream.hpp>
-#include <boost/beast/websocket/stream.hpp>
-
-
-#include "RemoteEndPoint.h"
-#include "stream.h"
-#include "threaded_queue.h"
-
-namespace lsp {
- class Log;
-}
-
-
-namespace lsp
-{
-
-
-
- class websocket_stream_wrapper :public istream, public ostream
- {
- public:
-
- websocket_stream_wrapper(boost::beast::websocket::stream<boost::beast::tcp_stream>& _w);
-
- boost::beast::websocket::stream<boost::beast::tcp_stream>& ws_;
- std::atomic<bool> quit{};
- std::shared_ptr < MultiQueueWaiter> request_waiter;
- ThreadedQueue< char > on_request;
- std::string error_message;
- bool fail() override;
-
- bool eof() override;
-
- bool good() override;
-
- websocket_stream_wrapper& read(char* str, std::streamsize count) override;
-
- int get() override;
-
- bool bad() override;
-
- websocket_stream_wrapper& write(const std::string& c) override;
-
- websocket_stream_wrapper& write(std::streamsize _s) override;
-
- websocket_stream_wrapper& flush() override;
-
- void clear() override;
-
- std::string what() override;
- };
-
- /// The top-level class of the HTTP server.
- class WebSocketServer
- {
- public:
- WebSocketServer(const WebSocketServer&) = delete;
- WebSocketServer& operator=(const WebSocketServer&) = delete;
- ~WebSocketServer();
- /// Construct the server to listen on the specified TCP address and port, and
- /// serve up files from the given directory.
- explicit WebSocketServer(const std::string& user_agent, const std::string& address, const std::string& port,
- std::shared_ptr < MessageJsonHandler> json_handler,
- std::shared_ptr < Endpoint> localEndPoint, lsp::Log& ,uint32_t _max_workers = 2);
-
- /// Run the server's io_context loop.
- void run();
- void stop();
-
- RemoteEndPoint point;
- private:
- struct Data;
- /// Perform an asynchronous accept operation.
- void do_accept();
-
- /// Wait for a request to stop the server.
- void do_stop();
- Data* d_ptr = nullptr;
-
-
- };
-
- } // namespace
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/future.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/future.h
deleted file mode 100644
index 8e241d96e9..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/future.h
+++ /dev/null
@@ -1,178 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// 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
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#pragma once
-
-#include <condition_variable>
-#include <memory>
-#include <mutex>
-
-namespace lsp {
-
-// internal functionality
-namespace detail {
-template <typename T>
-struct promise_state {
- T val;
- std::mutex mutex;
- std::condition_variable cv;
- bool hasVal = false;
-};
-} // namespace detail
-
-// forward declaration
-template <typename T>
-class promise;
-
-// future_status is the enumeration returned by future::wait_for and
-// future::wait_until.
-enum class future_status {
- ready,
- timeout,
-};
-
-// future is a minimal reimplementation of std::future, that does not suffer
-// from TSAN false positives. See:
-// https://gcc.gnu.org/bugzilla//show_bug.cgi?id=69204
-template <typename T>
-class future {
- public:
- using State = detail::promise_state<T>;
-
- // constructors
- inline future() = default;
- inline future(future&&) = default;
-
- // valid() returns true if the future has an internal state.
- bool valid() const;
-
- // get() blocks until the future has a valid result, and returns it.
- // The future must have a valid internal state to call this method.
- inline T get();
-
- // wait() blocks until the future has a valid result.
- // The future must have a valid internal state to call this method.
- void wait() const;
-
- // wait_for() blocks until the future has a valid result, or the timeout is
- // reached.
- // The future must have a valid internal state to call this method.
- template <class Rep, class Period>
- future_status wait_for(
- const std::chrono::duration<Rep, Period>& timeout) const;
-
- // wait_until() blocks until the future has a valid result, or the timeout is
- // reached.
- // The future must have a valid internal state to call this method.
- template <class Clock, class Duration>
- future_status wait_until(
- const std::chrono::time_point<Clock, Duration>& timeout) const;
-
- private:
- friend promise<T>;
- future(const future&) = delete;
- inline future(const std::shared_ptr<State>& state);
-
- std::shared_ptr<State> state = std::make_shared<State>();
-};
-
-template <typename T>
-future<T>::future(const std::shared_ptr<State>& s) : state(s) {}
-
-template <typename T>
-bool future<T>::valid() const {
- return static_cast<bool>(state);
-}
-
-template <typename T>
-T future<T>::get() {
- std::unique_lock<std::mutex> lock(state->mutex);
- state->cv.wait(lock, [&] { return state->hasVal; });
- return state->val;
-}
-
-template <typename T>
-void future<T>::wait() const {
- std::unique_lock<std::mutex> lock(state->mutex);
- state->cv.wait(lock, [&] { return state->hasVal; });
-}
-
-template <typename T>
-template <class Rep, class Period>
-future_status future<T>::wait_for(
- const std::chrono::duration<Rep, Period>& timeout) const {
- std::unique_lock<std::mutex> lock(state->mutex);
- return state->cv.wait_for(lock, timeout, [&] { return state->hasVal; })
- ? future_status::ready
- : future_status::timeout;
-}
-
-template <typename T>
-template <class Clock, class Duration>
-future_status future<T>::wait_until(
- const std::chrono::time_point<Clock, Duration>& timeout) const {
- std::unique_lock<std::mutex> lock(state->mutex);
- return state->cv.wait_until(lock, timeout, [&] { return state->hasVal; })
- ? future_status::ready
- : future_status::timeout;
-}
-
-// promise is a minimal reimplementation of std::promise, that does not suffer
-// from TSAN false positives. See:
-// https://gcc.gnu.org/bugzilla//show_bug.cgi?id=69204
-template <typename T>
-class promise {
- public:
- // constructors
- inline promise() = default;
- inline promise(promise&& other) = default;
- inline promise(const promise& other) = default;
-
- // set_value() stores value to the shared state.
- // set_value() must only be called once.
- inline void set_value(const T& value) const;
- inline void set_value(T&& value) const;
-
- // get_future() returns a future sharing this promise's state.
- future<T> get_future();
-
- private:
- using State = detail::promise_state<T>;
- std::shared_ptr<State> state = std::make_shared<State>();
-};
-
-template <typename T>
-future<T> promise<T>::get_future() {
- return future<T>(state);
-}
-
-template <typename T>
-void promise<T>::set_value(const T& value) const {
- std::unique_lock<std::mutex> lock(state->mutex);
- state->val = value;
- state->hasVal = true;
- state->cv.notify_all();
-}
-
-template <typename T>
-void promise<T>::set_value(T&& value) const {
- std::unique_lock<std::mutex> lock(state->mutex);
- state->val = std::move(value);
- state->hasVal = true;
- state->cv.notify_all();
-}
-
-} // namespace lsp
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/json.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/json.h
deleted file mode 100644
index 34e6232917..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/json.h
+++ /dev/null
@@ -1,81 +0,0 @@
-#pragma once
-
-#include "serializer.h"
-
-#include <rapidjson/document.h>
-#include <rapidjson/prettywriter.h>
-
-class JsonReader : public Reader {
-
- std::vector<const char*> path_;
-
- public:
- rapidjson::GenericValue<rapidjson::UTF8<>>* m_;
- JsonReader(rapidjson::GenericValue<rapidjson::UTF8<>>* m) : m_(m) {}
- SerializeFormat Format() const override { return SerializeFormat::Json; }
-
- bool IsBool() override { return m_->IsBool(); }
- bool IsNull() override { return m_->IsNull(); }
- bool IsArray() override { return m_->IsArray(); }
- bool IsInt() override { return m_->IsInt(); }
- bool IsInt64() override { return m_->IsInt64(); }
- bool IsUint64() override { return m_->IsUint64(); }
- bool IsDouble() override { return m_->IsDouble(); }
- bool IsNumber() override { return m_->IsNumber(); }
- bool IsString() override { return m_->IsString(); }
-
- void GetNull() override {}
- bool GetBool() override { return m_->GetBool(); }
- int GetInt() override { return m_->GetInt(); }
- uint32_t GetUint32() override { return uint32_t(m_->GetUint64()); }
- int64_t GetInt64() override { return m_->GetInt64(); }
- uint64_t GetUint64() override { return m_->GetUint64(); }
- double GetDouble() override { return m_->GetDouble(); }
- std::string GetString() override { return m_->GetString(); }
-
- bool HasMember(const char* x) override
- {
- if (m_->IsObject())
- return m_->HasMember(x);
- else
- return false;
- }
- std::unique_ptr<Reader> operator[](const char* x) override {
- auto& sub = (*m_)[x];
- return std::unique_ptr<JsonReader>(new JsonReader(&sub));
- }
-
- std::string ToString() const override;
-
- void IterMap(std::function<void(const char*, Reader&)> fn) override;
-
- void IterArray(std::function<void(Reader&)> fn) override;
-
- void DoMember(const char* name, std::function<void(Reader&)> fn) override;
-
- std::string GetPath() const;
-};
-
-class JsonWriter : public Writer {
-
- public:
- rapidjson::Writer<rapidjson::StringBuffer>* m_;
-
- JsonWriter(rapidjson::Writer<rapidjson::StringBuffer>* m) : m_(m) {}
- SerializeFormat Format() const override { return SerializeFormat::Json; }
-
- void Null() override { m_->Null(); }
- void Bool(bool x) override { m_->Bool(x); }
- void Int(int x) override { m_->Int(x); }
- void Uint32(uint32_t x) override { m_->Uint64(x); }
- void Int64(int64_t x) override { m_->Int64(x); }
- void Uint64(uint64_t x) override { m_->Uint64(x); }
- void Double(double x) override { m_->Double(x); }
- void String(const char* x) override { m_->String(x); }
- void String(const char* x, size_t len) override { m_->String(x, len); }
- void StartArray(size_t) override { m_->StartArray(); }
- void EndArray() override { m_->EndArray(); }
- void StartObject() override { m_->StartObject(); }
- void EndObject() override { m_->EndObject(); }
- void Key(const char* name) override { m_->Key(name); }
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsRequestId.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsRequestId.h
deleted file mode 100644
index 2efc80b19a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsRequestId.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-struct lsRequestId {
- // The client can send the request id as an int or a string. We should output
- // the same format we received.
- enum Type { kNone, kInt, kString };
- Type type = kNone;
-
- int value = -1;
- std::string k_string;
- bool has_value() const { return type != kNone; }
- void swap(lsRequestId& arg) noexcept
- {
- std::swap(arg, *this);
- }
- void set(int v)
- {
- value = v;
- type = kInt;
- }
- void set(const std::string& v)
- {
- k_string = v;
- type = kString;
- }
- bool operator==(const lsRequestId& rhs) const
- {
- if (type != rhs.type) return false;
- if (type == kInt)
- return value == rhs.value;
- return k_string == rhs.k_string;
- }
- bool operator!=(const lsRequestId& rhs) const
- {
- return !operator==(rhs);
- }
- bool operator<(const lsRequestId& rhs) const
- {
- if (type != rhs.type) return false;
- if (type == kInt)
- return value < rhs.value;
- return k_string < rhs.k_string;
- }
-};
-void Reflect(Reader& visitor, lsRequestId& value);
-void Reflect(Writer& visitor, lsRequestId& value);
-
-// Debug method to convert an id to a string.
-std::string ToString(const lsRequestId& id);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsResponseMessage.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsResponseMessage.h
deleted file mode 100644
index 68ad502b0c..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/lsResponseMessage.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#pragma once
-#include "serializer.h"
-#include "lsRequestId.h"
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/method_type.h"
-
-
-struct ResponseInMessage :public LspMessage {
-
- lsRequestId id;
- std::string m_methodType;
-
- virtual MethodType GetMethodType() const override
- {
- return m_methodType.data();
- };
- virtual void SetMethodType(MethodType _type) override
- {
- m_methodType = _type;
- };
-
- Kind GetKid() override
- {
- return RESPONCE_MESSAGE;
- }
- virtual bool IsErrorType()
- {
- return false;
- }
-};
-template <class TDerived >
-struct BaseResponseMessage : ResponseInMessage {
-
- void ReflectWriter(Writer& writer) override {
- Reflect(writer, static_cast<TDerived&>(*this));
- }
- static std::unique_ptr<LspMessage> ReflectReader(Reader& visitor) {
-
- TDerived* temp = new TDerived();
- std::unique_ptr<TDerived> message = std::unique_ptr<TDerived>(temp);
- // Reflect may throw and *message will be partially deserialized.
- Reflect(visitor, static_cast<TDerived&>(*temp));
- return message;
- }
-
-};
-
-
-template <class T, class TDerived >
-struct ResponseMessage : BaseResponseMessage<TDerived> {
- T result;
- void swap(ResponseMessage<T, TDerived>& arg) noexcept
- {
- std::swap(result, arg.result);
- this->id.swap(arg.id);
- this->m_methodType.swap(arg.m_methodType);
- }
-};
-
-template <class T, class TDerived >
-struct ResponseError : BaseResponseMessage<TDerived> {
- T error;
- bool IsErrorType() override { return true; }
- void swap(ResponseError<T, TDerived>& arg) noexcept
- {
-
- this->id.swap(arg.id);
- this->m_methodType.swap(arg.m_methodType);
- std::swap(error, arg.error);
- }
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/macro_map.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/macro_map.h
deleted file mode 100644
index 19a9634286..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/macro_map.h
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-// Taken from https://github.com/cbeck88/visit_struct.
-//
-// Usage
-//
-// #define PRINT_DOUBLE(x) printf(#x " = %d\n", x);
-//
-// MACRO_MAP(PRINT_DOUBLE, 1, 2, 3)
-// #define PRINT_DOUBLES(...) MACRO_MAP(PRINT_DOUBLE, __VA_ARGS__)
-
-#pragma once
-
-static constexpr const int max_visitable_members = 69;
-
-#define VISIT_STRUCT_EXPAND(x) x
-#define VISIT_STRUCT_PP_ARG_N( \
- _1, _2, _3, _4, _5, _6, _7, _8, _9, _10,\
- _11, _12, _13, _14, _15, _16, _17, _18, _19, _20,\
- _21, _22, _23, _24, _25, _26, _27, _28, _29, _30,\
- _31, _32, _33, _34, _35, _36, _37, _38, _39, _40,\
- _41, _42, _43, _44, _45, _46, _47, _48, _49, _50,\
- _51, _52, _53, _54, _55, _56, _57, _58, _59, _60,\
- _61, _62, _63, _64, _65, _66, _67, _68, _69, N, ...) N
-#define VISIT_STRUCT_PP_NARG(...) VISIT_STRUCT_EXPAND(VISIT_STRUCT_PP_ARG_N(__VA_ARGS__, \
- 69, 68, 67, 66, 65, 64, 63, 62, 61, 60, \
- 59, 58, 57, 56, 55, 54, 53, 52, 51, 50, \
- 49, 48, 47, 46, 45, 44, 43, 42, 41, 40, \
- 39, 38, 37, 36, 35, 34, 33, 32, 31, 30, \
- 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, \
- 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, \
- 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
-
-/* need extra level to force extra eval */
-#define VISIT_STRUCT_CONCAT_(a,b) a ## b
-#define VISIT_STRUCT_CONCAT(a,b) VISIT_STRUCT_CONCAT_(a,b)
-
-#define VISIT_STRUCT_APPLYF0(f)
-#define VISIT_STRUCT_APPLYF1(f,_1) f(_1)
-#define VISIT_STRUCT_APPLYF2(f,_1,_2) f(_1) f(_2)
-#define VISIT_STRUCT_APPLYF3(f,_1,_2,_3) f(_1) f(_2) f(_3)
-#define VISIT_STRUCT_APPLYF4(f,_1,_2,_3,_4) f(_1) f(_2) f(_3) f(_4)
-#define VISIT_STRUCT_APPLYF5(f,_1,_2,_3,_4,_5) f(_1) f(_2) f(_3) f(_4) f(_5)
-#define VISIT_STRUCT_APPLYF6(f,_1,_2,_3,_4,_5,_6) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6)
-#define VISIT_STRUCT_APPLYF7(f,_1,_2,_3,_4,_5,_6,_7) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7)
-#define VISIT_STRUCT_APPLYF8(f,_1,_2,_3,_4,_5,_6,_7,_8) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8)
-#define VISIT_STRUCT_APPLYF9(f,_1,_2,_3,_4,_5,_6,_7,_8,_9) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9)
-#define VISIT_STRUCT_APPLYF10(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10)
-#define VISIT_STRUCT_APPLYF11(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11)
-#define VISIT_STRUCT_APPLYF12(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12)
-#define VISIT_STRUCT_APPLYF13(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13)
-#define VISIT_STRUCT_APPLYF14(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14)
-#define VISIT_STRUCT_APPLYF15(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15)
-#define VISIT_STRUCT_APPLYF16(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16)
-#define VISIT_STRUCT_APPLYF17(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17)
-#define VISIT_STRUCT_APPLYF18(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18)
-#define VISIT_STRUCT_APPLYF19(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19)
-#define VISIT_STRUCT_APPLYF20(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20)
-#define VISIT_STRUCT_APPLYF21(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21)
-#define VISIT_STRUCT_APPLYF22(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22)
-#define VISIT_STRUCT_APPLYF23(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23)
-#define VISIT_STRUCT_APPLYF24(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24)
-#define VISIT_STRUCT_APPLYF25(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25)
-#define VISIT_STRUCT_APPLYF26(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26)
-#define VISIT_STRUCT_APPLYF27(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27)
-#define VISIT_STRUCT_APPLYF28(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28)
-#define VISIT_STRUCT_APPLYF29(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29)
-#define VISIT_STRUCT_APPLYF30(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30)
-#define VISIT_STRUCT_APPLYF31(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31)
-#define VISIT_STRUCT_APPLYF32(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32)
-#define VISIT_STRUCT_APPLYF33(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33)
-#define VISIT_STRUCT_APPLYF34(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34)
-#define VISIT_STRUCT_APPLYF35(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35)
-#define VISIT_STRUCT_APPLYF36(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36)
-#define VISIT_STRUCT_APPLYF37(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37)
-#define VISIT_STRUCT_APPLYF38(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38)
-#define VISIT_STRUCT_APPLYF39(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39)
-#define VISIT_STRUCT_APPLYF40(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40)
-#define VISIT_STRUCT_APPLYF41(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41)
-#define VISIT_STRUCT_APPLYF42(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42)
-#define VISIT_STRUCT_APPLYF43(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43)
-#define VISIT_STRUCT_APPLYF44(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44)
-#define VISIT_STRUCT_APPLYF45(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45)
-#define VISIT_STRUCT_APPLYF46(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46)
-#define VISIT_STRUCT_APPLYF47(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47)
-#define VISIT_STRUCT_APPLYF48(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48)
-#define VISIT_STRUCT_APPLYF49(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49)
-#define VISIT_STRUCT_APPLYF50(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50)
-#define VISIT_STRUCT_APPLYF51(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51)
-#define VISIT_STRUCT_APPLYF52(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52)
-#define VISIT_STRUCT_APPLYF53(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53)
-#define VISIT_STRUCT_APPLYF54(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54)
-#define VISIT_STRUCT_APPLYF55(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55)
-#define VISIT_STRUCT_APPLYF56(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56)
-#define VISIT_STRUCT_APPLYF57(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57)
-#define VISIT_STRUCT_APPLYF58(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58)
-#define VISIT_STRUCT_APPLYF59(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59)
-#define VISIT_STRUCT_APPLYF60(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60)
-#define VISIT_STRUCT_APPLYF61(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61)
-#define VISIT_STRUCT_APPLYF62(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62)
-#define VISIT_STRUCT_APPLYF63(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63)
-#define VISIT_STRUCT_APPLYF64(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64)
-#define VISIT_STRUCT_APPLYF65(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64) f(_65)
-#define VISIT_STRUCT_APPLYF66(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65,_66) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64) f(_65) f(_66)
-#define VISIT_STRUCT_APPLYF67(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65,_66,_67) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64) f(_65) f(_66) f(_67)
-#define VISIT_STRUCT_APPLYF68(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65,_66,_67,_68) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64) f(_65) f(_66) f(_67) f(_68)
-#define VISIT_STRUCT_APPLYF69(f,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,_31,_32,_33,_34,_35,_36,_37,_38,_39,_40,_41,_42,_43,_44,_45,_46,_47,_48,_49,_50,_51,_52,_53,_54,_55,_56,_57,_58,_59,_60,_61,_62,_63,_64,_65,_66,_67,_68,_69) f(_1) f(_2) f(_3) f(_4) f(_5) f(_6) f(_7) f(_8) f(_9) f(_10) f(_11) f(_12) f(_13) f(_14) f(_15) f(_16) f(_17) f(_18) f(_19) f(_20) f(_21) f(_22) f(_23) f(_24) f(_25) f(_26) f(_27) f(_28) f(_29) f(_30) f(_31) f(_32) f(_33) f(_34) f(_35) f(_36) f(_37) f(_38) f(_39) f(_40) f(_41) f(_42) f(_43) f(_44) f(_45) f(_46) f(_47) f(_48) f(_49) f(_50) f(_51) f(_52) f(_53) f(_54) f(_55) f(_56) f(_57) f(_58) f(_59) f(_60) f(_61) f(_62) f(_63) f(_64) f(_65) f(_66) f(_67) f(_68) f(_69)
-
-#define VISIT_STRUCT_APPLY_F_(M, ...) VISIT_STRUCT_EXPAND(M(__VA_ARGS__))
-#define MACRO_MAP(f, ...) VISIT_STRUCT_EXPAND(VISIT_STRUCT_APPLY_F_(VISIT_STRUCT_CONCAT(VISIT_STRUCT_APPLYF, VISIT_STRUCT_PP_NARG(__VA_ARGS__)), f, __VA_ARGS__))
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/message.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/message.h
deleted file mode 100644
index 57f4932520..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/message.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma once
-
-#include <atomic>
-#include <string>
-#include <iostream>
-#include <LibLsp/JsonRpc/serializer.h>
-#include "LibLsp/lsp/method_type.h"
-
-struct LspMessage
-{
-public:
- std::string jsonrpc = "2.0";
- virtual void ReflectWriter(Writer&) = 0;
-
- // Send the message to the language client by writing it to stdout.
- void Write(std::ostream& out);
-
-
- virtual MethodType GetMethodType() const = 0;
- virtual void SetMethodType(MethodType) = 0;
-
- virtual ~LspMessage()=default;
- enum Kind
- {
- REQUEST_MESSAGE,
- RESPONCE_MESSAGE,
- NOTIFICATION_MESSAGE
- };
-
- virtual Kind GetKid() = 0;
- virtual std::string ToJson() ;
-
-};
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/optionalVersion.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/optionalVersion.h
deleted file mode 100644
index f767b18f90..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/optionalVersion.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef boost
-#if __cplusplus < 201703L
-
-#include <boost/optional.hpp>
-using boost::optional;
-
-#else
-
-#include <optional>
-using std::optional;
-
-#endif
-#endif
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/serializer.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/serializer.h
deleted file mode 100644
index 1763c84f5f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/serializer.h
+++ /dev/null
@@ -1,372 +0,0 @@
-#pragma once
-
-#include "macro_map.h"
-
-#include <cassert>
-#include <memory>
-#include <string>
-#include <type_traits>
-#include <vector>
-#include <functional>
-#include <map>
-#include <algorithm>
-
-#include "optionalVersion.h"
-
-struct AbsolutePath;
-
-enum class SerializeFormat { Json, MessagePack };
-
-// A tag type that can be used to write `null` to json.
-struct JsonNull
-{
- void swap(JsonNull& arg) noexcept;
-};
-
-
-
-class Reader {
-public:
- virtual ~Reader() {}
- virtual SerializeFormat Format() const = 0;
-
- virtual bool IsBool() = 0;
- virtual bool IsNull() = 0;
- virtual bool IsArray() = 0;
- virtual bool IsInt() = 0;
- virtual bool IsInt64() = 0;
- virtual bool IsUint64() = 0;
- virtual bool IsDouble() = 0;
- virtual bool IsNumber() = 0;
- virtual bool IsString() = 0;
-
- virtual void GetNull() = 0;
- virtual bool GetBool() = 0;
- virtual int GetInt() = 0;
- virtual uint32_t GetUint32() = 0;
- virtual int64_t GetInt64() = 0;
- virtual uint64_t GetUint64() = 0;
- virtual double GetDouble() = 0;
- virtual std::string GetString() = 0;
-
- virtual bool HasMember(const char* x) = 0;
- virtual std::unique_ptr<Reader> operator[](const char* x) = 0;
- virtual void IterMap( std::function<void(const char*, Reader&)> fn) = 0;
- virtual void IterArray(std::function<void(Reader&)> fn) = 0;
- virtual void DoMember(const char* name, std::function<void(Reader&)> fn) = 0;
- virtual std::string ToString() const = 0;
-};
-
-
-
-class Writer {
-public:
- virtual ~Writer() {}
- virtual SerializeFormat Format() const = 0;
-
- virtual void Null() = 0;
- virtual void Bool(bool x) = 0;
- virtual void Int(int x) = 0;
- virtual void Uint32(uint32_t x) = 0;
- virtual void Int64(int64_t x) = 0;
- virtual void Uint64(uint64_t x) = 0;
- virtual void Double(double x) = 0;
- virtual void String(const char* x) = 0;
- virtual void String(const char* x, size_t len) = 0;
- virtual void StartArray(size_t) = 0;
- virtual void EndArray() = 0;
- virtual void StartObject() = 0;
- virtual void EndObject() = 0;
- virtual void Key(const char* name) = 0;
-};
-
-
-
-struct optionals_mandatory_tag {};
-
-#define REFLECT_MEMBER_START() ReflectMemberStart(visitor, value)
-#define REFLECT_MEMBER_END() ReflectMemberEnd(visitor, value);
-#define REFLECT_MEMBER_END1(value) ReflectMemberEnd(visitor, value);
-#define REFLECT_MEMBER(name) ReflectMember(visitor, #name, value.name)
-#define REFLECT_MEMBER_OPTIONALS(name) \
- ReflectMember(visitor, #name, value.name, optionals_mandatory_tag{})
-#define REFLECT_MEMBER2(name, value) ReflectMember(visitor, name, value)
-
-#define MAKE_REFLECT_TYPE_PROXY(type_name) \
- MAKE_REFLECT_TYPE_PROXY2(type_name, std::underlying_type<type_name>::type)
-#define MAKE_REFLECT_TYPE_PROXY2(type, as_type) \
- inline void Reflect(Reader& visitor, type& value) { \
- as_type value0; \
- ::Reflect(visitor, value0); \
- value = static_cast<type>(value0); \
- } \
- inline void Reflect(Writer& visitor, type& value) { \
- auto value0 = static_cast<as_type>(value); \
- ::Reflect(visitor, value0); \
- }
-
-#define _MAPPABLE_REFLECT_MEMBER(name) REFLECT_MEMBER(name);
-#define _MAPPABLE_REFLECT_MEMBER_OPTIONALS(name) REFLECT_MEMBER_OPTIONALS(name);
-
-#define MAKE_REFLECT_EMPTY_STRUCT(type, ...) \
- template <typename TVisitor> \
- void Reflect(TVisitor& visitor, type& value) { \
- REFLECT_MEMBER_START(); \
- REFLECT_MEMBER_END(); \
- }
-
-#define MAKE_REFLECT_STRUCT(type, ...) \
- template <typename TVisitor> \
- void Reflect(TVisitor& visitor, type& value) { \
- REFLECT_MEMBER_START(); \
- MACRO_MAP(_MAPPABLE_REFLECT_MEMBER, __VA_ARGS__) \
- REFLECT_MEMBER_END(); \
- }
-
-
-#define _MAPPABLE_SWAP_MEMBER(name) std::swap(name,arg.name);
-
-#define MAKE_SWAP_METHOD(type, ...) \
-void swap(type& arg) noexcept{ \
- MACRO_MAP(_MAPPABLE_SWAP_MEMBER, __VA_ARGS__) \
-}
-
-#define MAKE_REFLECT_STRUCT_OPTIONALS_MANDATORY(type, ...) \
- template <typename TVisitor> \
- void Reflect(TVisitor& visitor, type& value) { \
- REFLECT_MEMBER_START(); \
- MACRO_MAP(_MAPPABLE_REFLECT_MEMBER_OPTIONALS, __VA_ARGS__) \
- REFLECT_MEMBER_END(); \
- }
-
-// clang-format off
-// Config has many fields, we need to support at least its number of fields.
-#define NUM_VA_ARGS_IMPL(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,_11,_12,_13,_14,_15,_16,_17,_18,_19,_20,_21,_22,_23,_24,_25,_26,_27,_28,_29,_30,N,...) N
-#define NUM_VA_ARGS(...) NUM_VA_ARGS_IMPL(__VA_ARGS__,30,29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1)
-// clang-format on
-
-#define _MAPPABLE_REFLECT_ARRAY(name) Reflect(visitor, value.name);
-
-// Reflects the struct so it is serialized as an array instead of an object.
-// This currently only supports writers.
-#define MAKE_REFLECT_STRUCT_WRITER_AS_ARRAY(type, ...) \
- inline void Reflect(Writer& visitor, type& value) { \
- visitor.StartArray(NUM_VA_ARGS(__VA_ARGS__)); \
- MACRO_MAP(_MAPPABLE_REFLECT_ARRAY, __VA_ARGS__) \
- visitor.EndArray(); \
- }
-
-//// Elementary types
-
-void Reflect(Reader& visitor, uint8_t& value);
-void Reflect(Writer& visitor, uint8_t& value);
-
-void Reflect(Reader& visitor, short& value);
-void Reflect(Writer& visitor, short& value);
-
-void Reflect(Reader& visitor, unsigned short& value);
-void Reflect(Writer& visitor, unsigned short& value);
-
-void Reflect(Reader& visitor, int& value);
-void Reflect(Writer& visitor, int& value);
-
-void Reflect(Reader& visitor, unsigned& value);
-void Reflect(Writer& visitor, unsigned& value);
-
-void Reflect(Reader& visitor, long& value);
-void Reflect(Writer& visitor, long& value);
-
-void Reflect(Reader& visitor, unsigned long& value);
-void Reflect(Writer& visitor, unsigned long& value);
-
-void Reflect(Reader& visitor, long long& value);
-void Reflect(Writer& visitor, long long& value);
-
-void Reflect(Reader& visitor, unsigned long long& value);
-void Reflect(Writer& visitor, unsigned long long& value);
-
-void Reflect(Reader& visitor, double& value);
-void Reflect(Writer& visitor, double& value);
-
-void Reflect(Reader& visitor, bool& value);
-void Reflect(Writer& visitor, bool& value);
-
-void Reflect(Reader& visitor, std::string& value);
-void Reflect(Writer& visitor, std::string& value);
-
-void Reflect(Reader& visitor, JsonNull& value);
-void Reflect(Writer& visitor, JsonNull& value);
-
-void Reflect(Reader& visitor, SerializeFormat& value);
-void Reflect(Writer& visitor, SerializeFormat& value);
-
-//// Type constructors
-template <typename T>
-void Reflect(Reader& visitor, optional<T>& value) {
- if (visitor.IsNull()) {
- visitor.GetNull();
- return;
- }
- T real_value;
- Reflect(visitor, real_value);
- value = std::move(real_value);
-}
-template <typename T>
-void Reflect(Writer& visitor, optional<T>& value) {
- if (value)
- Reflect(visitor, *value);
- else
- visitor.Null();
-}
-
-
-template <typename T>
-void ReflectMember(Writer& visitor, const char* name, optional<T>& value) {
- // For TypeScript optional property key?: value in the spec,
- // We omit both key and value if value is std::nullopt (null) for JsonWriter
- // to reduce output. But keep it for other serialization formats.
- if (value || visitor.Format() != SerializeFormat::Json) {
- visitor.Key(name);
- Reflect(visitor, value);
- }
-}
-
-
-template <typename T>
-void ReflectMember(Writer& visitor,
- const char* name,
- T& value,
- optionals_mandatory_tag) {
- visitor.Key(name);
- Reflect(visitor, value);
-}
-template <typename T>
-void ReflectMember(Reader& visitor,
- const char* name,
- T& value,
- optionals_mandatory_tag) {
- Reflect(visitor, value);
-}
-
-template<class T >
-void Reflect(Reader& visitor, std::map<std::string, T>& value)
-{
- visitor.IterMap([&](const char* name,Reader& entry) {
- T entry_value;
- Reflect(entry, entry_value);
- value[name]=(std::move(entry_value));
- });
-}
-template<class _Ty >
-void Reflect(Writer& visitor, std::map<std::string, _Ty>& value)
-{
- REFLECT_MEMBER_START();
- for (auto& it : value)
- {
- visitor.Key(it.first.c_str());
- Reflect(visitor, it.second);
- }
- REFLECT_MEMBER_END();
-}
-
-// std::vector
-template <typename T>
-void Reflect(Reader& visitor, std::vector<T>& values) {
- visitor.IterArray([&](Reader& entry) {
- T entry_value;
- Reflect(entry, entry_value);
- values.push_back(std::move(entry_value));
- });
-}
-
-
-template <typename T>
-void Reflect(Writer& visitor, std::vector<T>& values) {
- visitor.StartArray(values.size());
- for (auto& value : values)
- Reflect(visitor, value);
- visitor.EndArray();
-}
-
-// ReflectMember
-
-inline void DefaultReflectMemberStart(Writer& visitor) {
- visitor.StartObject();
-}
-inline void DefaultReflectMemberStart(Reader& visitor) {}
-
-template <typename T>
-bool ReflectMemberStart(Reader& visitor, T& value) {
- return false;
-}
-template <typename T>
-bool ReflectMemberStart(Writer& visitor, T& value) {
- visitor.StartObject();
- return true;
-}
-
-template <typename T>
-void ReflectMemberEnd(Reader& visitor, T& value) {}
-template <typename T>
-void ReflectMemberEnd(Writer& visitor, T& value) {
- visitor.EndObject();
-}
-
-template <typename T>
-void ReflectMember(Reader& visitor, const char* name, T& value) {
- visitor.DoMember(name, [&](Reader& child) { Reflect(child, value); });
-}
-template <typename T>
-void ReflectMember(Writer& visitor, const char* name, T& value) {
- visitor.Key(name);
- Reflect(visitor, value);
-}
-
-template<class _Ty1, class _Ty2>
-void Reflect(Writer& visitor, std::pair< optional<_Ty1>, optional<_Ty2> >& value)
-{
- if (value.first)
- {
- Reflect(visitor, value.first);
- }
- else
- {
- Reflect(visitor, value.second);
- }
-}
-template<class _Ty2>
-void Reflect(Reader& visitor, std::pair< optional<bool>, optional<_Ty2> >& value)
-{
- if(visitor.IsBool())
- {
- Reflect(visitor, value.first);
- return;
- }
-
- Reflect(visitor, value.second);
-}
-template<class _Ty2>
-void Reflect(Reader& visitor, std::pair< optional<std::string>, optional<_Ty2> >& value)
-{
- if (visitor.IsString())
- {
- Reflect(visitor, value.first);
- return;
- }
-
- Reflect(visitor, value.second);
-}
-
-
-template<class _Ty1, class _Ty2>
-void Reflect(Reader& visitor, std::pair< optional<_Ty1>, optional<_Ty2> >& value)
-{
- try
- {
- Reflect(visitor, value.second);
- }
- catch (...)
- {
- Reflect(visitor, value.first);
- }
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/stream.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/stream.h
deleted file mode 100644
index 3dd3def993..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/stream.h
+++ /dev/null
@@ -1,196 +0,0 @@
-#pragma once
-#include <mutex>
-#include <string>
-namespace lsp
-{
- class stream
- {
- public:
- virtual ~stream() = default;
- virtual bool fail() = 0;
- virtual bool bad() = 0;
- virtual bool eof() = 0;
- virtual bool good() = 0;
- virtual void clear() = 0;
- virtual std::string what() = 0;
- virtual bool need_to_clear_the_state()
- {
- return false;
- }
-
- bool operator!()
- {
- return bad();
- }
- };
- class istream : public stream
- {
- public:
- virtual int get() = 0;
- virtual ~istream() = default;
- virtual istream& read(char* str, std::streamsize count) = 0;
- };
- template <class T >
- class base_istream : public istream
- {
- public:
- explicit base_istream(T& _t) :_impl(_t)
- {
-
- }
-
- int get() override
- {
- return _impl.get();
- }
- bool fail() override
- {
- return _impl.fail();
- }
- bool bad() override
- {
- return _impl.bad();
- }
- bool eof() override
- {
- return _impl.eof();
- }
- bool good() override
- {
- return _impl.good();
- }
- istream& read(char* str, std::streamsize count) override
- {
- _impl.read(str, count);
- return *this;
- }
-
- void clear() override
- {
- _impl.clear();
- }
- T& _impl;
- };
- class ostream : public stream
- {
- public:
- virtual ~ostream() = default;
-
- virtual ostream& write(const std::string&) = 0;
- virtual ostream& write(std::streamsize) = 0;
- virtual ostream& flush() = 0;
-
- };
- template <class T >
- class base_ostream : public ostream
- {
- public:
- explicit base_ostream(T& _t) :_impl(_t)
- {
-
- }
-
- bool fail() override
- {
- return _impl.fail();
- }
- bool good() override
- {
- return _impl.good();
- }
- bool bad() override
- {
- return _impl.bad();
- }
- bool eof() override
- {
- return _impl.eof();
- }
-
- ostream& write(const std::string& c) override
- {
- _impl << c;
- return *this;
- }
-
- ostream& write(std::streamsize _s) override
- {
-
- _impl << std::to_string(_s);
- return *this;
- }
-
- ostream& flush() override
- {
- _impl.flush();
- return *this;
- }
-
- void clear() override
- {
- _impl.clear();
- }
- protected:
- T& _impl;
- };
-
- template <class T >
- class base_iostream : public istream, public ostream
- {
- public:
- explicit base_iostream(T& _t) :_impl(_t)
- {
-
- }
-
- int get() override
- {
- return _impl.get();
- }
- bool fail() override
- {
- return _impl.fail();
- }
- bool bad() override
- {
- return _impl.bad();
- }
- bool eof() override
- {
- return _impl.eof();
- }
- bool good() override
- {
- return _impl.good();
- }
- istream& read(char* str, std::streamsize count) override
- {
- _impl.read(str, count);
- return *this;
- }
- ostream& write(const std::string& c) override
- {
- _impl << c;
- return *this;
- }
-
- ostream& write(std::streamsize _s) override
- {
- _impl << std::to_string(_s);
- return *this;
- }
-
- ostream& flush() override
- {
- _impl.flush();
- return *this;
- }
-
- void clear() override
- {
- _impl.clear();
- }
- protected:
- T& _impl;
- };
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h
deleted file mode 100644
index e8fc6d13ea..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/threaded_queue.h
+++ /dev/null
@@ -1,250 +0,0 @@
-#pragma once
-
-#include <optional>
-#include <algorithm>
-#include <atomic>
-#include <condition_variable>
-#include <deque>
-#include <memory>
-#include <mutex>
-#include <tuple>
-#include <utility>
-#include <vector>
-
-#include "optionalVersion.h"
-
-struct MultiQueueWaiter;
-
-struct BaseThreadQueue {
- virtual ~BaseThreadQueue() = default;
-
- virtual bool IsEmpty() = 0;
-
- std::shared_ptr<MultiQueueWaiter> waiter;
-};
-
-// std::lock accepts two or more arguments. We define an overload for one
-// argument.
-namespace std {
-template <typename Lockable>
-void lock(Lockable& l) {
- l.lock();
-}
-} // namespace std
-
-template <typename... Queue>
-struct MultiQueueLock {
- MultiQueueLock(Queue... lockable) : tuple_{lockable...} { lock(); }
- ~MultiQueueLock() { unlock(); }
- void lock() { lock_impl(typename std::index_sequence_for<Queue...>{}); }
- void unlock() { unlock_impl(typename std::index_sequence_for<Queue...>{}); }
-
- private:
- template <size_t... Is>
- void lock_impl(std::index_sequence<Is...>) {
- std::lock(std::get<Is>(tuple_)->mutex...);
- }
-
- template <size_t... Is>
- void unlock_impl(std::index_sequence<Is...>) {
- (void)std::initializer_list<int>{
- (std::get<Is>(tuple_)->mutex.unlock(), 0)...};
- }
-
- std::tuple<Queue...> tuple_;
-};
-
-struct MultiQueueWaiter {
- static bool HasState(std::initializer_list<BaseThreadQueue*> queues);
-
- bool ValidateWaiter(std::initializer_list<BaseThreadQueue*> queues);
-
- template <typename... BaseThreadQueue>
- bool Wait(std::atomic<bool>& quit, BaseThreadQueue... queues) {
- MultiQueueLock<BaseThreadQueue...> l(queues...);
- while (!quit.load(std::memory_order_relaxed)) {
- if (HasState({ queues... }))
- return false;
- cv.wait(l);
- }
- return true;
- }
- template <typename... BaseThreadQueue>
- void WaitUntil(std::chrono::steady_clock::time_point t,
- BaseThreadQueue... queues) {
- MultiQueueLock<BaseThreadQueue...> l(queues...);
- if (!HasState({ queues... }))
- cv.wait_until(l, t);
- }
- template <typename... BaseThreadQueue>
- void Wait(BaseThreadQueue... queues) {
- assert(ValidateWaiter({queues...}));
-
- MultiQueueLock<BaseThreadQueue...> l(queues...);
- while (!HasState({queues...}))
- cv.wait(l);
- }
-
- std::condition_variable_any cv;
-};
-
-// A threadsafe-queue. http://stackoverflow.com/a/16075550
-template <class T>
-struct ThreadedQueue : public BaseThreadQueue {
- public:
- ThreadedQueue() : ThreadedQueue(std::make_shared<MultiQueueWaiter>()) {}
-
- explicit ThreadedQueue(std::shared_ptr<MultiQueueWaiter> waiter)
- : total_count_(0) {
- this->waiter = waiter;
- }
-
- // Returns the number of elements in the queue. This is lock-free.
- size_t Size() const { return total_count_; }
-
- // Add an element to the queue.
- void Enqueue(T&& t, bool priority) {
- {
- std::lock_guard<std::mutex> lock(mutex);
- if (priority)
- priority_.push_back(std::move(t));
- else
- queue_.push_back(std::move(t));
- ++total_count_;
- }
- waiter->cv.notify_one();
- }
-
- // Add a set of elements to the queue.
- void EnqueueAll(std::vector<T>&& elements, bool priority) {
- if (elements.empty())
- return;
-
- {
- std::lock_guard<std::mutex> lock(mutex);
- total_count_ += elements.size();
- for (T& element : elements) {
- if (priority)
- priority_.push_back(std::move(element));
- else
- queue_.push_back(std::move(element));
- }
- elements.clear();
- }
-
- waiter->cv.notify_all();
- }
-
- // Returns true if the queue is empty. This is lock-free.
- bool IsEmpty() { return total_count_ == 0; }
-
- // Get the first element from the queue. Blocks until one is available.
- T Dequeue() {
- std::unique_lock<std::mutex> lock(mutex);
- waiter->cv.wait(lock,
- [&]() { return !priority_.empty() || !queue_.empty(); });
-
- auto execute = [&](std::deque<T>* q) {
- auto val = std::move(q->front());
- q->pop_front();
- --total_count_;
- return std::move(val);
- };
- if (!priority_.empty())
- return execute(&priority_);
- return execute(&queue_);
- }
-
- // Get the first element from the queue without blocking. Returns a null
- // value if the queue is empty.
- optional<T> TryDequeue(bool priority) {
- std::lock_guard<std::mutex> lock(mutex);
-
- auto pop = [&](std::deque<T>* q) {
- auto val = std::move(q->front());
- q->pop_front();
- --total_count_;
- return std::move(val);
- };
-
- auto get_result = [&](std::deque<T>* first,
- std::deque<T>* second) -> optional<T> {
- if (!first->empty())
- return pop(first);
- if (!second->empty())
- return pop(second);
- return {};
- };
-
- if (priority)
- return get_result(&priority_, &queue_);
- return get_result(&queue_, &priority_);
- }
- // Return all elements in the queue.
- std::vector<T> DequeueAll() {
- std::lock_guard<std::mutex> lock(mutex);
-
- total_count_ = 0;
-
- std::vector<T> result;
- result.reserve(priority_.size() + queue_.size());
- while (!priority_.empty()) {
- result.emplace_back(std::move(priority_.front()));
- priority_.pop_front();
- }
- while (!queue_.empty()) {
- result.emplace_back(std::move(queue_.front()));
- queue_.pop_front();
- }
-
- return result;
- }
- std::vector<T> TryDequeueSome(size_t num) {
- std::lock_guard<std::mutex> lock(mutex);
-
- std::vector<T> result;
- num = std::min(num, priority_.size() + queue_.size());
- total_count_ -= num;
- result.reserve(num);
- while (num)
- {
- if(!priority_.empty()) {
- result.emplace_back(std::move(priority_.front()));
- priority_.pop_front();
- }
- else
- {
- break;
- }
- num -= 1;
- }
- while (num)
- {
- if (!queue_.empty()) {
- result.emplace_back(std::move(queue_.front()));
- queue_.pop_front();
- }
- else
- {
- break;
- }
- num -= 1;
- }
- return result;
- }
- template <typename Fn>
- void Iterate(Fn fn) {
- std::lock_guard<std::mutex> lock(mutex);
- for (auto& entry : priority_)
- fn(entry);
- for (auto& entry : queue_)
- fn(entry);
- }
-
- mutable std::mutex mutex;
-
- private:
- std::atomic<int> total_count_;
- std::deque<T> priority_;
- std::deque<T> queue_;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/traits.h b/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/traits.h
deleted file mode 100644
index ce8905a840..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/JsonRpc/traits.h
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// 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
-//
-// https://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-#pragma once
-
-
-#include <tuple>
-#include <type_traits>
-
-namespace lsp {
-namespace traits {
-
-// NthTypeOf returns the `N`th type in `Types`
-template <int N, typename... Types>
-using NthTypeOf = typename std::tuple_element<N, std::tuple<Types...>>::type;
-
-// `IsTypeOrDerived<BASE, T>::value` is true iff `T` is of type `BASE`, or
-// derives from `BASE`.
-template <typename BASE, typename T>
-using IsTypeOrDerived = std::integral_constant<
- bool,
- std::is_base_of<BASE, typename std::decay<T>::type>::value ||
- std::is_same<BASE, typename std::decay<T>::type>::value>;
-
-// `EachIsTypeOrDerived<N, BASES, TYPES>::value` is true iff all of the types in
-// the std::tuple `TYPES` is of, or derives from the corresponding indexed type
-// in the std::tuple `BASES`.
-// `N` must be equal to the number of types in both the std::tuple `BASES` and
-// `TYPES`.
-template <int N, typename BASES, typename TYPES>
-struct EachIsTypeOrDerived {
- using base = typename std::tuple_element<N - 1, BASES>::type;
- using type = typename std::tuple_element<N - 1, TYPES>::type;
- using last_matches = IsTypeOrDerived<base, type>;
- using others_match = EachIsTypeOrDerived<N - 1, BASES, TYPES>;
- static constexpr bool value = last_matches::value && others_match::value;
-};
-
-// EachIsTypeOrDerived specialization for N = 1
-template <typename BASES, typename TYPES>
-struct EachIsTypeOrDerived<1, BASES, TYPES> {
- using base = typename std::tuple_element<0, BASES>::type;
- using type = typename std::tuple_element<0, TYPES>::type;
- static constexpr bool value = IsTypeOrDerived<base, type>::value;
-};
-
-// EachIsTypeOrDerived specialization for N = 0
-template <typename BASES, typename TYPES>
-struct EachIsTypeOrDerived<0, BASES, TYPES> {
- static constexpr bool value = true;
-};
-
-// Signature describes the signature of a function.
-template <typename RETURN, typename... PARAMETERS>
-struct Signature {
- // The return type of the function signature
- using ret = RETURN;
- // The parameters of the function signature held in a std::tuple
- using parameters = std::tuple<PARAMETERS...>;
- // The type of the Nth parameter of function signature
- template <std::size_t N>
- using parameter = NthTypeOf<N, PARAMETERS...>;
- // The total number of parameters
- static constexpr std::size_t parameter_count = sizeof...(PARAMETERS);
-};
-
-// SignatureOf is a traits helper that infers the signature of the function,
-// method, static method, lambda, or function-like object `F`.
-template <typename F>
-struct SignatureOf {
- // The signature of the function-like object `F`
- using type = typename SignatureOf<decltype(&F::operator())>::type;
-};
-
-// SignatureOf specialization for a regular function or static method.
-template <typename R, typename... ARGS>
-struct SignatureOf<R (*)(ARGS...)> {
- // The signature of the function-like object `F`
- using type = Signature<typename std::decay<R>::type,
- typename std::decay<ARGS>::type...>;
-};
-
-// SignatureOf specialization for a non-static method.
-template <typename R, typename C, typename... ARGS>
-struct SignatureOf<R (C::*)(ARGS...)> {
- // The signature of the function-like object `F`
- using type = Signature<typename std::decay<R>::type,
- typename std::decay<ARGS>::type...>;
-};
-
-// SignatureOf specialization for a non-static, const method.
-template <typename R, typename C, typename... ARGS>
-struct SignatureOf<R (C::*)(ARGS...) const> {
- // The signature of the function-like object `F`
- using type = Signature<typename std::decay<R>::type,
- typename std::decay<ARGS>::type...>;
-};
-
-// SignatureOfT is an alias to `typename SignatureOf<F>::type`.
-template <typename F>
-using SignatureOfT = typename SignatureOf<F>::type;
-
-// ParameterType is an alias to `typename SignatureOf<F>::type::parameter<N>`.
-template <typename F, std::size_t N>
-using ParameterType = typename SignatureOfT<F>::template parameter<N>;
-
-// `HasSignature<F, S>::value` is true iff the function-like `F` has a matching
-// signature to the function-like `S`.
-template <typename F, typename S>
-using HasSignature = std::integral_constant<
- bool,
- std::is_same<SignatureOfT<F>, SignatureOfT<S>>::value>;
-
-// `Min<A, B>::value` resolves to the smaller value of A and B.
-template <std::size_t A, std::size_t B>
-using Min = std::integral_constant<std::size_t, (A < B ? A : B)>;
-
-// `CompatibleWith<F, S>::value` is true iff the function-like `F`
-// can be called with the argument types of the function-like `S`. Return type
-// of the two functions are not considered.
-template <typename F, typename S>
-using CompatibleWith = std::integral_constant<
- bool,
- (SignatureOfT<S>::parameter_count == SignatureOfT<F>::parameter_count) &&
- EachIsTypeOrDerived<Min<SignatureOfT<S>::parameter_count,
- SignatureOfT<F>::parameter_count>::value,
- typename SignatureOfT<S>::parameters,
- typename SignatureOfT<F>::parameters>::value>;
-
-// If `CONDITION` is true then EnableIf resolves to type T, otherwise an
-// invalid type.
-template <bool CONDITION, typename T = void>
-using EnableIf = typename std::enable_if<CONDITION, T>::type;
-
-// If `BASE` is a base of `T` then EnableIfIsType resolves to type `TRUE`,
-// otherwise an invalid type.
-template <typename BASE, typename T, typename TRUE_ = void>
-using EnableIfIsType = EnableIf<IsTypeOrDerived<BASE, T>::value, TRUE_>;
-
-// If the function-like `F` has a matching signature to the function-like `S`
-// then EnableIfHasSignature resolves to type `TRUE`, otherwise an invalid type.
-template <typename F, typename S, typename TRUE_ = void>
-using EnableIfHasSignature = EnableIf<HasSignature<F, S>::value, TRUE_>;
-
-} // namespace traits
-} // namespace lsp
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/AbsolutePath.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/AbsolutePath.h
deleted file mode 100644
index 4f9aae0851..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/AbsolutePath.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-#include <LibLsp/JsonRpc/serializer.h>
-#include <string>
-
-struct AbsolutePath {
- static AbsolutePath BuildDoNotUse(const std::string& path);
-
- // Try not to use this.
- AbsolutePath();
-
- // Provide implicit conversions to std::string for the time being.
- AbsolutePath(const std::string& path, bool validate = true);
- operator std::string() const;
-
- bool operator==(const AbsolutePath& rhs) const;
- bool operator!=(const AbsolutePath& rhs) const;
- bool operator<(const AbsolutePath& rhs) const;
- bool operator>(const AbsolutePath& rhs) const;
- std::string path;
- bool qualify = true;
-};
-
-
-void Reflect(Reader& visitor, AbsolutePath& value);
-void Reflect(Writer& visitor, AbsolutePath& value);
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ClientPreferences.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ClientPreferences.h
deleted file mode 100644
index c8920e4492..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ClientPreferences.h
+++ /dev/null
@@ -1,310 +0,0 @@
-#pragma once
-#include <LibLsp/lsp/general/lsClientCapabilities.h>
-#include <LibLsp/lsp/utils.h>
-#include <memory>
-#include <vector>
-#include <string>
-
-class ClientPreferences
-{
-public:
-
- std::shared_ptr<lsWorkspaceClientCapabilites> workspace;
- lsTextDocumentClientCapabilities textDocument ;
-
- ClientPreferences(const lsClientCapabilities& capabilities)
- {
- v3supported = capabilities.textDocument.has_value();
- if (v3supported)
- textDocument = capabilities.textDocument.value();
- if(capabilities.workspace)
- {
- workspace = std::make_shared<lsWorkspaceClientCapabilites>(capabilities.workspace.value());
- }
- }
-
- bool v3supported=false;
-
- bool isSignatureHelpSupported() {
-
- return v3supported && (textDocument.signatureHelp);
- }
- bool isWorkspaceDidChangeConfigurationSupported() const
- {
- return workspace && isDynamicRegistrationSupported(workspace->didChangeConfiguration);
- }
- bool isWorkspaceFoldersSupported() {
- return workspace != nullptr && isTrue(workspace->workspaceFolders);
- }
-
- bool isCompletionDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.completion);
- }
-
- bool isCompletionSnippetsSupported() {
- //@formatter:off
- if(!v3supported || !textDocument.completion)
- {
- return false;
- }
- const auto& completion = textDocument.completion.value();
- if(completion.completionItem)
- {
- return isTrue(completion.completionItem.value().snippetSupport);
- }
- return false;
- }
-
- bool isV3Supported() {
- return v3supported;
- }
-
- bool isFormattingDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.formatting);
- }
-
- bool isRangeFormattingDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.rangeFormatting);
- }
-
- bool isOnTypeFormattingDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.onTypeFormatting);
- }
-
- bool isCodeLensDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.codeLens);
- }
-
- bool isSignatureHelpDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.signatureHelp);
- }
- template<typename T>
- static bool isDynamicRegistrationSupported(optional<T>& capability)
- {
- if(capability)
- return (capability.value().dynamicRegistration.value());
- return false;
- }
-
- bool isTrue(const optional<bool>& value)
- {
- if (value) {
- return *value;
- } else {
- return false;
- }
- }
-
- bool isRenameDynamicRegistrationSupported() {
- return v3supported && isDynamicRegistrationSupported(textDocument.rename);
- }
-
- bool isExecuteCommandDynamicRegistrationSupported() {
- return v3supported && workspace != nullptr && isDynamicRegistrationSupported(workspace->executeCommand);
- }
-
- bool isWorkspaceSymbolDynamicRegistered() {
- return v3supported && workspace != nullptr && isDynamicRegistrationSupported(workspace->symbol);
- }
-
- bool isWorkspaceChangeWatchedFilesDynamicRegistered() {
- return v3supported && workspace != nullptr && isDynamicRegistrationSupported(workspace->didChangeWatchedFiles);
- }
-
- bool isDocumentSymbolDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.documentSymbol);
- }
-
- bool isCodeActionDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.codeAction);
- }
-
- bool isDefinitionDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.definition);
- }
-
- bool isTypeDefinitionDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.typeDefinition);
- }
-
- bool isHoverDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.hover);
- }
-
- bool isReferencesDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.references);
- }
-
- bool isDocumentHighlightDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.documentHighlight);
- }
-
- bool isFoldgingRangeDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.foldingRange);
- }
-
- bool isImplementationDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.implementation);
- }
-
- bool isSelectionRangeDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.selectionRange);
- }
-
- bool isWillSaveRegistered() {
- return v3supported && isTrue(textDocument.synchronization.willSave);
- }
-
- bool isWillSaveWaitUntilRegistered() {
- return v3supported && isTrue(textDocument.synchronization.willSaveWaitUntil);
- }
-
- bool isWorkspaceApplyEditSupported() {
- return workspace != nullptr && isTrue(workspace->applyEdit);
- }
-
- bool isSupportsCompletionDocumentationMarkdown() {
-
- if (!v3supported || !textDocument.completion)
- {
- return false;
- }
- const auto& completion = textDocument.completion.value();
- if (completion.completionItem)
- {
- auto& documentationFormat = completion.completionItem.value().documentationFormat;
- if(documentationFormat)
- {
- auto& data = documentationFormat.value();
- for(auto& it : data)
- {
- if(it == "markdown")
- {
- return true;
- }
- }
- }
- }
- return false;
-
- }
-
-
- bool isWorkspaceEditResourceChangesSupported() {
- if(!workspace) return false;
-
- if(workspace->workspaceEdit)
- {
- return isTrue(workspace->workspaceEdit.value().resourceChanges);
- }
- return false;
- }
- static bool contains(const std::vector<std::string>& v, const std::string& target)
- {
- for(auto& it : v)
- {
- if(it == target) return true;
- }
- return false;
- }
- bool isResourceOperationSupported() const
- {
- if (!workspace) return false;
- if (!workspace->workspaceEdit)
- {
- return false;
- }
- auto& it = (workspace->workspaceEdit.value());
- if(!it.resourceOperations) return false;
- const auto& resourceOperations = it.resourceOperations.value();
- return contains(resourceOperations, "create") && contains(resourceOperations, "rename") && contains(resourceOperations, "delete");
-
- }
-
- /**
- * {@code true} if the client has explicitly set the
- * {@code textDocument.documentSymbol.hierarchicalDocumentSymbolSupport} to
- * {@code true} when initializing the LS. Otherwise, {@code false}.
- */
- bool isHierarchicalDocumentSymbolSupported() {
- if(!v3supported || !textDocument.documentSymbol) return false;
- return isTrue(textDocument.documentSymbol.value().hierarchicalDocumentSymbolSupport);
-
- }
-
- bool isSemanticHighlightingSupported() {
- //@formatter:off
- if (!v3supported || !textDocument.semanticHighlightingCapabilities) return false;
- return isTrue(textDocument.semanticHighlightingCapabilities.value().semanticHighlighting);
- //@formatter:on
- }
-
- /**
- * {@code true} if the client has explicitly set the
- * {@code textDocument.codeAction.codeActionLiteralSupport.codeActionKind.valueSet}
- * value. Otherwise, {@code false}.
- */
- bool isSupportedCodeActionKind(const std::string& kind) {
- if (!v3supported || !textDocument.codeAction) return false;
- //@formatter:off
- const auto& codeAction = textDocument.codeAction.value();
- if(codeAction.codeActionLiteralSupport)
- {
- const auto& codeActionKind = codeAction.codeActionLiteralSupport.value().codeActionKind;
- if(codeActionKind)
- {
- const auto& valueSet = codeActionKind.value().valueSet;
- if(valueSet)
- {
- for(auto& k : valueSet.value())
- {
- if(lsp::StartsWith(kind,k))
- {
- return true;
- }
- }
- }
- }
- }
- return false;
-
- //@formatter:on
- }
-
- /**
- * {@code true} if the client has explicitly set the
- * {@code textDocument.publishDiagnostics.tagSupport} to
- * {@code true} when initializing the LS. Otherwise, {@code false}.
- */
- bool isDiagnosticTagSupported() {
- if (!v3supported || !textDocument.publishDiagnostics) return false;
- const auto& publishDiagnostics = textDocument.publishDiagnostics.value();
- if(publishDiagnostics.tagSupport)
- {
- isTagSupported(publishDiagnostics.tagSupport);
- }
- return false;
- }
-
- bool isTagSupported(const optional < std::pair<optional<bool>,
- optional<DiagnosticsTagSupport> > >& tagSupport) {
- if(tagSupport)
- {
- auto &v = tagSupport.value();
- if (v.first)
- {
- return v.first.value();
- }
- if (v.second) {
- return !v.second.value().valueSet.empty();
- }
- }
- return false;
- }
-
- bool isCallHierarchyDynamicRegistered() {
- return v3supported && isDynamicRegistrationSupported(textDocument.callHierarchy);
- }
-
-};
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/CodeActionParams.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/CodeActionParams.h
deleted file mode 100644
index 6c30ce82da..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/CodeActionParams.h
+++ /dev/null
@@ -1,114 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/method_type.h"
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsp_diagnostic.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsCodeAction.h"
-namespace JDT
-{
- namespace CodeActionKind {
-
-
- /**
- * Base kind for quickfix actions: 'quickfix'
- */
- extern const char* QuickFix;
-
- /**
- * Base kind for refactoring actions: 'refactor'
- */
- extern const char* Refactor;
-
- /**
- * Base kind for refactoring extraction actions: 'refactor.extract'
- *
- * Example extract actions:
- *
- * - Extract method - Extract function - Extract variable - Extract interface
- * from class - ...
- */
- extern const char* RefactorExtract;
-
- /**
- * Base kind for refactoring inline actions: 'refactor.inline'
- *
- * Example inline actions:
- *
- * - Inline function - Inline variable - Inline constant - ...
- */
- extern const char* RefactorInline;
-
- /**
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'
- *
- * Example rewrite actions:
- *
- * - Convert JavaScript function to class - Add or remove parameter -
- * Encapsulate field - Make method static - Move method to base class - ...
- */
- extern const char* RefactorRewrite;
-
- /**
- * Base kind for source actions: `source`
- *
- * Source code actions apply to the entire file.
- */
- extern const char* Source ;
-
- /**
- * Base kind for an organize imports source action: `source.organizeImports`
- */
- extern const char* SourceOrganizeImports;
-
- extern const char* COMMAND_ID_APPLY_EDIT;
- };
-
-
-}
-struct lsCodeActionContext {
- // An array of diagnostics.
- std::vector<lsDiagnostic> diagnostics;
- /**
- * Requested kind of actions to return.
- *
- * Actions not of this kind are filtered out by the client before being shown. So servers
- * can omit computing them.
- *
- * See {@link CodeActionKind} for allowed values.
- */
- optional<std::vector<std::string>> only;
-
- MAKE_SWAP_METHOD(lsCodeActionContext,
- diagnostics, only);
-};
-MAKE_REFLECT_STRUCT(lsCodeActionContext,
- diagnostics, only);
-
-
-// Params for the CodeActionRequest
-struct lsCodeActionParams {
- // The document in which the command was invoked.
- lsTextDocumentIdentifier textDocument;
- // The range for which the command was invoked.
- lsRange range;
- // Context carrying additional information.
- lsCodeActionContext context;
-
- MAKE_SWAP_METHOD(lsCodeActionParams,
- textDocument,
- range,
- context);
-};
-MAKE_REFLECT_STRUCT(lsCodeActionParams,
- textDocument,
- range,
- context);
-
-
-
-
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Directory.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/Directory.h
deleted file mode 100644
index 77b6cbb3e7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Directory.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-#include <string>
-
-struct AbsolutePath;
-
-struct Directory {
- explicit Directory(const AbsolutePath& path);
-
- bool operator==(const Directory& rhs) const;
- bool operator!=(const Directory& rhs) const;
-
- std::string path;
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ExecuteCommandParams.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ExecuteCommandParams.h
deleted file mode 100644
index bb73d8a46f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ExecuteCommandParams.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#pragma once
-
-#include "lsAny.h"
-struct ExecuteCommandParams {
- /**
- * The identifier of the actual command handler.
- */
-
- std::string command;
-
- /**
- * Arguments that the command should be invoked with.
- * The arguments are typically specified when a command is returned from the server to the client.
- * Example requests that return a command are textDocument/codeAction or textDocument/codeLens.
- */
- optional<std::vector<lsp::Any>> arguments;
-
- MAKE_SWAP_METHOD(ExecuteCommandParams, command, arguments);
-};
-MAKE_REFLECT_STRUCT(ExecuteCommandParams,command,arguments)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/IProgressMonitor.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/IProgressMonitor.h
deleted file mode 100644
index 369ebb2a6d..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/IProgressMonitor.h
+++ /dev/null
@@ -1,143 +0,0 @@
-#pragma once
-
-
-#include <string>
-namespace lsp {
-/**
- * The <code>IProgressMonitor</code> interface is implemented
- * by objects that monitor the progress of an activity; the methods
- * in this interface are invoked by code that performs the activity.
- * <p>
- * All activity is broken down into a linear sequence of tasks against
- * which progress is reported. When a task begins, a <code>beginTask(const wstring&, int)
- * </code> notification is reported, followed by any number and mixture of
- * progress reports (<code>worked()</code>) and subtask notifications
- * (<code>subTask(const wstring&)</code>). When the task is eventually completed, a
- * <code>done()</code> notification is reported. After the <code>done()</code>
- * notification, the progress monitor cannot be reused; i.e., <code>
- * beginTask(const wstring&, int)</code> cannot be called again after the call to
- * <code>done()</code>.
- * </p>
- * <p>
- * A request to cancel an operation can be signaled using the
- * <code>setCanceled</code> method. Operations taking a progress
- * monitor are expected to poll the monitor (using <code>isCanceled</code>)
- * periodically and abort at their earliest convenience. Operation can however
- * choose to ignore cancelation requests.
- * </p>
- * <p>
- * Since notification is synchronous with the activity itself, the listener should
- * provide a fast and robust implementation. If the handling of notifications would
- * involve blocking operations, or operations which might throw uncaught exceptions,
- * the notifications should be queued, and the actual processing deferred (or perhaps
- * delegated to a separate thread).
- * </p>
- * <p>
- * Clients may implement this interface.
- * </p>
- */
- class IProgressMonitor {
- public:
- virtual ~IProgressMonitor()
- {
- }
-
- /** Constant indicating an unknown amount of work.
- */
-
- const static int UNKNOWN = -1;
-
- /**
- * Notifies that the main task is beginning. This must only be called once
- * on a given progress monitor instance.
- *
- * @param name the name (or description) of the main task
- * @param totalWork the total number of work units into which
- * the main task is been subdivided. If the value is <code>UNKNOWN</code>
- * the implemenation is free to indicate progress in a way which
- * doesn't require the total number of work units in advance.
- */
- virtual void beginTask(void* , int totalWork)
- {
-
- };
- /**
- * Notifies that the work is done; that is, either the main task is completed
- * or the user canceled it. This method may be called more than once
- * (implementations should be prepared to handle this case).
- */
-
- virtual void endTask(void*, int totalWork)
- {
-
- }
-
- virtual void done(void*) = 0;
-
- /**
- * Internal method to handle scaling correctly. This method
- * must not be called by a client. Clients should
- * always use the method <code>worked(int)</code>.
- */
- virtual void internalWorked(double work)
- {
-
- }
- /**
- * Returns whether cancelation of current operation has been requested.
- * Long-running operations should poll to see if cancelation
- * has been requested.
- *
- * @return <code>true</code> if cancellation has been requested,
- * and <code>false</code> otherwise
- * @see #setCanceled
- */
- virtual bool isCanceled() = 0;
- /**
- * Sets the cancel state to the given value.
- *
- * @param value <code>true</code> indicates that cancelation has
- * been requested (but not necessarily acknowledged);
- * <code>false</code> clears this flag
- *
- * @see #isCanceled
- */
- virtual void setCanceled(bool value) = 0;
- /**
- * Sets the task name to the given value. This method is used to
- * restore the task label after a nested operation was executed.
- * Normally there is no need for clients to call this method.
- *
- * @param name the name (or description) of the main task
- * @see #beginTask(java.lang.const wstring&, int)
- */
- virtual void setTaskName(void*)
- {
-
- };
- /**
- * Notifies that a subtask of the main task is beginning.
- * Subtasks are optional; the main task might not have subtasks.
- *
- * @param name the name (or description) of the subtask
- */
- virtual void subTask(void* )
- {
-
- }
- /**
- * Notifies that a given number of work unit of the main task
- * has been completed. Note that this amount represents an
- * installment, as opposed to a cumulative amount of work done
- * to date.
- *
- * @param work the number of work units just completed
- */
- virtual void worked(int work)
- {
-
- };
-
- virtual void catch_exception(void*) = 0;
- };
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/Markup.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/Markup.h
deleted file mode 100644
index 1618939c69..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/Markup.h
+++ /dev/null
@@ -1,119 +0,0 @@
-#pragma once
-#include <cctype>
-#include <clocale>
-#include <cstddef>
-#include <memory>
-#include <string>
-#include <vector>
-#include <sstream>
-
-#include "string_ref.h"
-
-namespace lsp
-{
-
-/// Holds text and knows how to lay it out. Multiple blocks can be grouped to
-/// form a document. Blocks include their own trailing newlines, std::string_ref
-/// should trim them if need be.
-class Block {
-public:
- virtual void renderMarkdown(std::ostringstream &OS) const = 0;
- virtual void renderPlainText(std::ostringstream &OS) const = 0;
- virtual std::unique_ptr<Block> clone() const = 0;
- std::string_ref asMarkdown() const;
- std::string_ref asPlainText() const;
-
- virtual bool isRuler() const { return false; }
- virtual ~Block() = default;
-};
-
-/// Represents parts of the markup that can contain strings, like inline code,
-/// code block or plain text.
-/// One must introduce different paragraphs to create separate blocks.
-class Paragraph : public Block {
-public:
- void renderMarkdown(std::ostringstream &OS) const override;
- void renderPlainText(std::ostringstream &OS) const override;
- std::unique_ptr<Block> clone() const override;
-
- /// Append plain text to the end of the string.
- Paragraph &appendText(const std::string_ref& Text);
-
- /// Append inline code, this translates to the ` block in markdown.
- /// \p Preserve indicates the code span must be apparent even in plaintext.
- Paragraph &appendCode(const std::string_ref& Code, bool Preserve = false);
-
- /// Ensure there is space between the surrounding chunks.
- /// Has no effect at the beginning or end of a paragraph.
- Paragraph &appendSpace();
-
-private:
- struct Chunk {
- enum {
- PlainText,
- InlineCode,
- } Kind = PlainText;
- // Preserve chunk markers in plaintext.
- bool Preserve = false;
- std::string_ref Contents;
- // Whether this chunk should be surrounded by whitespace.
- // Consecutive SpaceAfter and SpaceBefore will be collapsed into one space.
- // Code spans don't usually set this: their spaces belong "inside" the span.
- bool SpaceBefore = false;
- bool SpaceAfter = false;
- };
- std::vector<Chunk> Chunks;
-};
-
-/// Represents a sequence of one or more documents. Knows how to print them in a
-/// list like format, e.g. by prepending with "- " and indentation.
-class BulletList : public Block {
-public:
- void renderMarkdown(std::ostringstream &OS) const override;
- void renderPlainText(std::ostringstream &OS) const override;
- std::unique_ptr<Block> clone() const override;
-
- class Document &addItem();
-
-private:
- std::vector<class Document> Items;
-};
-
-/// A format-agnostic representation for structured text. Allows rendering into
-/// markdown and plaintext.
-class Document {
-public:
- Document() = default;
- Document(const Document &Other) { *this = Other; }
- Document &operator=(const Document &);
- Document(Document &&) = default;
- Document &operator=(Document &&) = default;
-
- void append(Document Other);
-
- /// Adds a semantical block that will be separate from others.
- Paragraph &addParagraph();
- /// Inserts a horizontal separator to the document.
- void addRuler();
- /// Adds a block of code. This translates to a ``` block in markdown. In plain
- /// text representation, the code block will be surrounded by newlines.
- void addCodeBlock( std::string_ref Code, std::string_ref Language = "cpp");
- /// Heading is a special type of paragraph that will be prepended with \p
- /// Level many '#'s in markdown.
- Paragraph &addHeading(size_t Level);
-
- BulletList &addBulletList();
-
- /// Doesn't contain any trailing newlines.
- /// We try to make the markdown human-readable, e.g. avoid extra escaping.
- /// At least one client (coc.nvim) displays the markdown verbatim!
- std::string_ref asMarkdown() const;
- /// Doesn't contain any trailing newlines.
- std::string_ref asPlainText() const;
-
-private:
- std::vector<std::unique_ptr<Block>> Children;
-};
-
-
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/string_ref.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/string_ref.h
deleted file mode 100644
index bac8fbbaf5..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/Markup/string_ref.h
+++ /dev/null
@@ -1,1061 +0,0 @@
-
-#pragma once
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <stdarg.h>
-#include<functional>
-
-#ifndef _WIN32
-#include <cstring>
-#endif
-namespace std
-{
-
- /**
- * An extension of STL's string providing additional functionality that is often availiable in
- * higher-level languages such as Python.
- */
- class string_ref : public string
- {
- public:
-
- //static unsigned GetAutoSenseRadix(string_ref& Str) {
- // if (Str.empty())
- // return 10;
-
- // if (Str.start_with("0x") || Str.start_with("0X")) {
- // Str = Str.substr(2);
- // return 16;
- // }
-
- // if (Str.start_with("0b") || Str.start_with("0B")) {
- // Str = Str.substr(2);
- // return 2;
- // }
-
- // if (Str.start_with("0o")) {
- // Str = Str.substr(2);
- // return 8;
- // }
-
- // if (Str[0] == '0' && Str.size() > 1 && std::isdigit(Str[1])) {
- // Str = Str.substr(1);
- // return 8;
- // }
-
- // return 10;
- //}
-
- //static bool consumeUnsignedInteger(string_ref& Str, unsigned Radix,
- // unsigned long long& Result) {
- // // Autosense radix if not specified.
- // if (Radix == 0)
- // Radix = GetAutoSenseRadix(Str);
-
- // // Empty strings (after the radix autosense) are invalid.
- // if (Str.empty()) return true;
-
- // // Parse all the bytes of the string given this radix. Watch for overflow.
- // string_ref Str2 = Str;
- // Result = 0;
- // while (!Str2.empty()) {
- // unsigned CharVal;
- // if (Str2[0] >= '0' && Str2[0] <= '9')
- // CharVal = Str2[0] - '0';
- // else if (Str2[0] >= 'a' && Str2[0] <= 'z')
- // CharVal = Str2[0] - 'a' + 10;
- // else if (Str2[0] >= 'A' && Str2[0] <= 'Z')
- // CharVal = Str2[0] - 'A' + 10;
- // else
- // break;
-
- // // If the parsed value is larger than the integer radix, we cannot
- // // consume any more characters.
- // if (CharVal >= Radix)
- // break;
-
- // // Add in this character.
- // unsigned long long PrevResult = Result;
- // Result = Result * Radix + CharVal;
-
- // // Check for overflow by shifting back and seeing if bits were lost.
- // if (Result / Radix < PrevResult)
- // return true;
-
- // Str2 = Str2.substr(1);
- // }
-
- // // We consider the operation a failure if no characters were consumed
- // // successfully.
- // if (Str.size() == Str2.size())
- // return true;
-
- // Str = Str2;
- // return false;
- //}
-
- //static bool consumeSignedInteger(string_ref& Str, unsigned Radix,
- // long long& Result) {
- // unsigned long long ULLVal;
-
- // // Handle positive strings first.
- // if (Str.empty() || Str.front() != '-') {
- // if (consumeUnsignedInteger(Str, Radix, ULLVal) ||
- // // Check for value so large it overflows a signed value.
- // (long long)ULLVal < 0)
- // return true;
- // Result = ULLVal;
- // return false;
- // }
-
- // // Get the positive part of the value.
- // string_ref Str2 = Str.drop_front(1);
- // if (consumeUnsignedInteger(Str2, Radix, ULLVal) ||
- // // Reject values so large they'd overflow as negative signed, but allow
- // // "-0". This negates the unsigned so that the negative isn't undefined
- // // on signed overflow.
- // (long long)-ULLVal > 0)
- // return true;
-
- // Str = Str2;
- // Result = -ULLVal;
- // return false;
- //}
-
- ///// GetAsUnsignedInteger - Workhorse method that converts a integer character
- ///// sequence of radix up to 36 to an unsigned long long value.
- //static bool getAsUnsignedInteger(string_ref Str, unsigned Radix,
- // unsigned long long& Result) {
- // if (consumeUnsignedInteger(Str, Radix, Result))
- // return true;
-
- // // For getAsUnsignedInteger, we require the whole string to be consumed or
- // // else we consider it a failure.
- // return !Str.empty();
- //}
-
- //static bool getAsSignedInteger(string_ref Str, unsigned Radix,
- // long long& Result) {
- // if (consumeSignedInteger(Str, Radix, Result))
- // return true;
-
- // // For getAsSignedInteger, we require the whole string to be consumed or else
- // // we consider it a failure.
- // return !Str.empty();
- //}
-
-
- ///// Parse the current string as an integer of the specified radix. If
- ///// \p Radix is specified as zero, this does radix autosensing using
- ///// extended C rules: 0 is octal, 0x is hex, 0b is binary.
- /////
- ///// If the string is invalid or if only a subset of the string is valid,
- ///// this returns true to signify the error. The string is considered
- ///// erroneous if empty or if it overflows T.
- //template <typename T>
- //std::enable_if_t<std::numeric_limits<T>::is_signed, bool>
- // getAsInteger(unsigned Radix, T& Result) const {
- // long long LLVal;
- // if (getAsSignedInteger(*this, Radix, LLVal) ||
- // static_cast<T>(LLVal) != LLVal)
- // return true;
- // Result = LLVal;
- // return false;
- //}
-
- //template <typename T>
- //std::enable_if_t<!std::numeric_limits<T>::is_signed, bool>
- // getAsInteger(unsigned Radix, T& Result) const {
- // unsigned long long ULLVal;
- // // The additional cast to unsigned long long is required to avoid the
- // // Visual C++ warning C4805: '!=' : unsafe mix of type 'bool' and type
- // // 'unsigned __int64' when instantiating getAsInteger with T = bool.
- // if (getAsUnsignedInteger(*this, Radix, ULLVal) ||
- // static_cast<unsigned long long>(static_cast<T>(ULLVal)) != ULLVal)
- // return true;
- // Result = ULLVal;
- // return false;
- //}
-
-
-
- /**`
- * Default constructor
- *
- * Constructs an empty string_ref ("")
- */
- string_ref() : string() { }
-
- /**
- * Duplicate the STL string copy constructor
- *
- * @param[in] s The string to copy
- * @param[in] pos The starting position in the string to copy from
- * @param[in] n The number of characters to copy
- */
- string_ref(const string &s, size_type pos = 0, size_type n = npos) : string(s, pos, npos) { }
-
- /**
- * Construct an string_ref from a null-terminated character array
- *
- * @param[in] s The character array to copy into the new string
- */
- string_ref(const value_type *s) : string(s) { }
-
- /**
- * Construct an string_ref from a character array and a length
- *
- * @param[in] s The character array to copy into the new string
- * @param[in] n The number of characters to copy
- */
- string_ref(const value_type *s, size_type n) : string(s, n) { }
-
- /**
- * Create an string_ref with @p n copies of @p c
- *
- * @param[in] n The number of copies
- * @param[in] c The character to copy @p n times
- */
- string_ref(size_type n, value_type c) : string(n, c) { }
-
- /**
- * Create a string from a range
- *
- * @param[in] first The first element to copy in
- * @param[in] last The last element to copy in
- */
- template <class InputIterator>
- string_ref(InputIterator first, InputIterator last) : string(first, last) { }
-
- /**
- * The destructor
- */
- ~string_ref() { }
-
- /**
- * Split a string by whitespace
- *
- * @return A vector of strings, each of which is a substring of the string
- */
- vector<string_ref> split(size_type limit = npos) const
- {
- vector<string_ref> v;
-
- const_iterator
- i = begin(),
- last = i;
- for (; i != end(); i++)
- {
- if (*i == ' ' || *i == '\n' || *i == '\t' || *i == '\r')
- {
- if (i + 1 != end() && (i[1] == ' ' || i[1] == '\n' || i[1] == '\t' || i[1] == '\r'))
- continue;
- v.push_back(string_ref(last, i));
- last = i + 1;
- if (v.size() >= limit - 1)
- {
- v.push_back(string_ref(last, end()));
- return v;
- }
- }
- }
-
- if (last != i)
- v.push_back(string_ref(last, i));
-
- return v;
- }
-
- /**
- * Split a string by a character
- *
- * Returns a vector of ext_strings, each of which is a substring of the string formed by splitting
- * it on boundaries formed by the character @p separator. If @p limit is set, the returned vector
- * will contain a maximum of @p limit elements with the last element containing the rest of
- * the string.
- *
- * If @p separator is not found in the string, a single element will be returned in the vector
- * containing the entire string.
- *
- * The separators are removed from the output
- *
- * @param[in] separator The character separator to split the string on
- * @param[in] limit The maximum number of output elements
- * @return A vector of strings, each of which is a substring of the string
- *
- * @section split_ex Example
- * @code
- * std::string_ref s("This|is|a|test.");
- * std::vector<std::string_ref> v = s.split('|');
- * std::copy(v.begin(), v.end(), std::ostream_iterator<std::string_ref>(std::cout, "\n"));
- *
- * This
- * is
- * a
- * test.
- * @endcode
- */
- vector<string_ref> split(value_type separator, size_type limit = npos) const
- {
- vector<string_ref> v;
-
- const_iterator
- i = begin(),
- last = i;
- for (; i != end(); i++)
- {
- if (*i == separator)
- {
- v.push_back(string_ref(last, i));
- last = i + 1;
- if (v.size() >= limit - 1)
- {
- v.push_back(string_ref(last, end()));
- return v;
- }
- }
- }
-
- if (last != i)
- v.push_back(string_ref(last, i));
-
- return v;
- }
-
- /**
- * Split a string by another string
- *
- * Returns a vector of ext_strings, each of which is a substring of the string formed by
- * splitting it on boundaries formed by the string @p separator. If @p limit is set, the
- * returned vector will contain a maximum of @p limit elements with the last element
- * containing the rest of the string.
- *
- * If @p separator is not found in the string, a single element will be returned in the
- * vector containing the entire string.
- *
- * The separators are removed from the output
- *
- * @param[in] separator The string separator to split the string on
- * @param[in] limit The maximum number of output elements
- * @return A vector of strings, each of which is a substring of the string
- *
- * @ref split_ex
- */
- vector<string_ref> split(const string &separator, size_type limit = npos) const
- {
- vector<string_ref> v;
-
- const_iterator
- i = begin(),
- last = i;
- for (; i != end(); i++)
- {
- if (string(i, i + separator.length()) == separator)
- {
- v.push_back(string_ref(last, i));
- last = i + separator.length();
-
- if (v.size() >= limit - 1)
- {
- v.push_back(string_ref(last, end()));
- return v;
- }
- }
- }
-
- if (last != i)
- v.push_back(string_ref(last, i));
-
- return v;
- }
-
- /**
- * Convert a string into an integer
- *
- * Convert the initial portion of a string into a signed integer. Once a non-numeric
- * character is reached, the remainder of @p string is ignored and the integer that was
- * read returned.
- *
- * @param s The string to convert
- * @return The integer converted from @p string
- */
- static long int integer(const string &s)
- {
- long int retval = 0;
- bool neg = false;
-
- for (const_iterator i = s.begin(); i != s.end(); i++)
- {
- if (i == s.begin())
- {
- if (*i == '-')
- {
- neg = true;
- continue;
- }
- else if (*i == '+')
- continue;
- }
- if (*i >= '0' && *i <= '9')
- {
- retval *= 10;
- retval += *i - '0';
- }
- else
- break;
- }
-
- if (neg)
- retval *= -1;
-
- return retval;
- }
-
- /**
- * Convert the string to an integer
- *
- * Convert the initial portion of the string into a signed integer. Once a non-numeric
- * character is reached, the remainder of the string is ignored and the integer that had
- * been read thus far is returned.
- *
- * @return The integer converted from the string
- */
- long int integer() const
- {
- return integer(*this);
- }
-
- /**
- * Split a string into chunks of size @p chunklen. Returns a vector of strings.
- *
- * Splits a string into chunks of the given size. The final chunk may not fill its
- * entire allocated number of characters.
- *
- * @param[in] chunklen The number of characters per chunk
- * @return A vector of strings, each of length <= chunklen
- *
- * @section chunk_split-ex Example
- * @code
- * std::string_ref s("abcdefghijk");
- * std::vector<std::string_ref> v = s.chunk_split(3);
- * std::copy(v.begin(), v.end(), ostream_iterator<std::string_ref>(cout, " "));
- *
- * abc def ghi jk
- * @endcode
- */
- vector<string_ref> chunk_split(size_type chunklen) const
- {
- vector<string_ref> retval;
- retval.reserve(size() / chunklen + 1);
-
- size_type count = 0;
- const_iterator
- i = begin(),
- last = i;
- for (; i != end(); i++, count++)
- {
- if (count == chunklen)
- {
- count = 0;
- retval.push_back(string_ref(last, i));
- last = i;
- }
- }
-
- if (last != i)
- retval.push_back(string_ref(last, i));
-
- return retval;
- }
-
- /**
- * Join a sequence of strings by some glue to create a new string
- *
- * Glue is not added to the end of the string.
- *
- * @pre [first, last) is a valid range
- * @pre InputIterator is a model of STL's Input Iterator
- * @pre InputIterator must point to a string type (std::string, std::string_ref, char *)
- *
- * @param[in] glue The glue to join strings with
- * @param[in] first The beginning of the range to join
- * @param[in] last The end of the range to join
- * @return A string constructed of each element of the range connected together with @p glue
- *
- * @section join_ex Example
- * @code
- * std::vector<std::string_ref> v;
- * v.push_back("This");
- * v.push_back("is");
- * v.push_back("a");
- * v.push_back("test.");
- * std::cout << std::string_ref::join("|", v.begin(), v.end()) << std::endl;
- *
- * This|is|a|test.
- * @endcode
- */
- template <class InputIterator>
- static string_ref join(const string &glue, InputIterator first, InputIterator last)
- {
- string_ref retval;
-
- for (; first != last; ++first)
- {
- retval.append(*first);
- retval.append(glue);
- }
- retval.erase(retval.length() - glue.length());
-
- return retval;
- }
-
- /**
- * Join a sequence of strings by some glue to create a new string
- *
- * @copydoc join
- * @ref join_ex
- */
- template <class InputIterator>
- static string_ref join(value_type glue, InputIterator first, InputIterator last)
- {
- string_ref retval;
-
- for (; first != last; ++first)
- {
- retval.append(*first);
- retval.append(1, glue);
- }
- retval.erase(retval.length() - 1);
-
- return retval;
- }
-
- /**
- * Search for any instances of @p needle and replace them with @p s
- *
- * @param[in] needle The string to replace
- * @param[in] s The replacement string
- * @return *this
- * @post All instances of @p needle in the string are replaced with @p s
- *
- * @section replace-ex Example
- * @code
- * std::string_ref s("This is a test.");
- * s.replace("is", "ere");
- * std::cout << s << std::endl;
- *
- * There ere a test.
- * @endcode
- */
- string_ref &replace(const string &needle, const string &s)
- {
- size_type
- lastpos = 0,
- thispos;
-
- while ((thispos = find(needle, lastpos)) != npos)
- {
- string::replace(thispos, needle.length(), s);
- lastpos = thispos + 1;
- }
- return *this;
- }
- string_ref &replace_first(const string &needle, const string &s)
- {
- size_type
- lastpos = 0,
- thispos;
-
- if ((thispos = find(needle, lastpos)) != npos)
- {
- string::replace(thispos, needle.length(), s);
- lastpos = thispos + 1;
- }
- return *this;
- }
- /**
- * Search of any instances of @p needle and replace them with @p c
- *
- * @param[in] needle The character to replace
- * @param[in] c The replacement character
- * @return *this
- * @post All instances of @p needle in the string are replaced with @p c
- *
- * @ref replace-ex
- */
- string_ref &replace(value_type needle, value_type c)
- {
- for (iterator i = begin(); i != end(); i++)
- if (*i == needle)
- *i = c;
-
- return *this;
- }
-
- /**
- * Repeat a string @p n times
- *
- * @param[in] n The number of times to repeat the string
- * @return string_ref containing @p n copies of the string
- *
- * @section repeat-ex Example
- * @code
- * std::string_ref s("123");
- * s = s * 3;
- * std::cout << s << std::endl;
- *
- * 123123123
- * @endcode
- */
- string_ref operator*(size_type n)
- {
- string_ref retval;
- for (size_type i = 0; i < n; i++)
- retval.append(*this);
-
- return retval;
- }
-
- /**
- * Convert the string to lowercase
- *
- * @return *this
- * @post The string is converted to lowercase
- */
- string_ref &tolower()
- {
- for (iterator i = begin(); i != end(); i++)
- if (*i >= 'A' && *i <= 'Z')
- *i = (*i) + ('a' - 'A');
- return *this;
- }
-
- /**
- * Convert the string to uppercase
- *
- * @return *this
- * @post The string is converted to uppercase
- */
- string_ref &toupper()
- {
- for (iterator i = begin(); i != end(); i++)
- if (*i >= 'a' && *i <= 'z')
- *i = (*i) - ('a' - 'A');
- return *this;
- }
-
- /**
- * Count the occurances of @p str in the string.
- *
- * @return The count of substrings @p str in the string
- */
- size_type count(const string &str) const
- {
- size_type
- count = 0,
- last = 0,
- cur = 0;
-
- while ((cur = find(str, last + 1)) != npos)
- {
- count++;
- last = cur;
- }
-
- return count;
- }
-
- /**
- * Determine if the string is alphanumeric
- *
- * @return true if the string contains only characters between a-z, A-Z and 0-9 and
- * contains at least one character, else false
- */
- bool is_alnum() const
- {
- if (length() == 0)
- return false;
-
- for (const_iterator i = begin(); i != end(); i++)
- {
- if (*i < 'A' || *i > 'Z')
- if (*i < '0' || *i > '9')
- if (*i < 'a' || *i > 'z')
- return false;
- }
-
- return true;
- }
-
- /**
- * Determine if the string is alphabetic only
- *
- * @return true of the string contains only characters between a-z and A-Z and contains at
- * least one character, else false
- */
- bool is_alpha() const
- {
- if (length() == 0)
- return false;
-
- for (const_iterator i = begin(); i != end(); i++)
- if (*i < 'A' || (*i > 'Z' && (*i < 'a' || *i > 'z')))
- return false;
-
- return true;
- }
-
- /**
- * Determine if the string is numeric only
- *
- * @return true if the string contains only characters between 0-9 and contains at least
- * one character, else false
- */
- bool is_numeric() const
- {
- if (length() == 0)
- return false;
-
- for (const_iterator i = begin(); i != end(); i++)
- if (*i < '0' || *i > '9')
- return false;
-
- return true;
- }
-
- /**
- * Determine if a string is all lower case
- *
- * @return true if there is at least one character, and all characters are lowercase
- * letters, else false
- */
- bool is_lower() const
- {
- if (length() == 0)
- return false;
-
- for (const_iterator i = begin(); i != end(); i++)
- if (*i < 'a' || *i < 'z')
- return false;
-
- return true;
- }
-
- /**
- * Determine if a string is all upper case
- *
- * @return true if there is at least one character, and all characters are uppercase
- * letters, else false
- */
- bool is_upper() const
- {
- if (length() == 0)
- return false;
-
- for (const_iterator i = begin(); i != end(); i++)
- if (*i < 'A' || *i > 'Z')
- return false;
-
- return true;
- }
-
- /**
- * Swap the case of a string
- *
- * @post Converts all uppercase to lowercase, and all lowercase to uppercase in the string
- * @return *this
- */
- string_ref &swapcase()
- {
- for (iterator i = begin(); i != end(); i++)
- if (*i >= 'A' && *i <= 'Z')
- *i += ('a' - 'A');
- else if (*i >= 'a' && *i <= 'z')
- *i -= ('a' - 'A');
-
- return *this;
- }
-
- /*******************************************************************************
- Function: std::string_ref::start_with
- Access: public
- Qualifier: const
- Parameter: const string & str
- Returns: bool
-
- Purpose: is the string start with str
- *******************************************************************************/
- bool start_with(const string& str) const
- {
- return ( this->find(str) == 0 );
- }
-
- /// Return a string_ref equal to 'this' but with only the last \p N
- /// elements remaining. If \p N is greater than the length of the
- /// string, the entire string is returned.
-
- string_ref take_back(size_t N = 1) const {
- if (N >= size())
- return *this;
- return drop_front(size() - N);
- }
- /// Return a string_ref equal to 'this' but with the first \p N elements
- /// dropped.
-
- string_ref drop_front(size_t N = 1) const {
- //assert(size() >= N && "Dropping more elements than exist");
- return substr(N);
- }
-
-
-
- /// Return a string_ref equal to 'this' but with the last \p N elements
- /// dropped.
-
- string_ref drop_back(size_t N = 1) const {
-
- return substr(0, size() - N);
- }
-
- /// Return a string_ref equal to 'this', but with all characters satisfying
- /// the given predicate dropped from the beginning of the string.
-
- string_ref drop_while(std::function<bool(char)> F) const {
- return substr(std::find_if_not(begin(),end(),F)-begin());
- }
-
- /// Return a string_ref equal to 'this', but with all characters not
- /// satisfying the given predicate dropped from the beginning of the string.
-
- string_ref drop_until(std::function<bool(char)> F) const {
- return substr(std::find_if(begin(), end(), F) - begin());
- }
-
- /// Returns true if this string_ref has the given prefix and removes that
- /// prefix.
- bool consume_front(string_ref Prefix) {
- if (!start_with(Prefix))
- return false;
-
- *this = drop_front(Prefix.size());
- return true;
- }
-
- /// Returns true if this string_ref has the given suffix and removes that
- /// suffix.
- bool consume_back(string_ref Suffix) {
- if (!end_with(Suffix))
- return false;
-
- *this = drop_back(Suffix.size());
- return true;
- }
-
- /*******************************************************************************
- Function: std::string_ref::end_with
- Access: public
- Qualifier: const
- Parameter: const string & str
- Returns: bool
-
- Purpose: is the string end with str
- *******************************************************************************/
- bool end_with(const string& str) const
- {
- if (str.length() > this->length())
- {
- return false;
- }
- size_type off = this->length() - str.length();
- return ( find(str, off) == off);
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::format
- Access: public
- Qualifier:
- Parameter: const char * format_string
- Parameter: ...
- Returns: string_ref&
-
- Purpose: format the string
- *******************************************************************************/
- string_ref& format(const char* format_string, ...)
- {
- if (format_string == 0)
- {
- return *this;
- }
-
- va_list argList;
- va_start( argList, format_string );
-
-#ifdef _WIN32
- int len = _vscprintf( format_string, argList );
- char* pbuf = new char[len + 1];
- if (pbuf != 0)
- {
- vsprintf_s( pbuf, len + 1, format_string, argList );
- *this = pbuf;
- delete[] pbuf;
- }
-#else
- const int INLINE_FORMAT_BUFFER_LEN =2048;
- char* buf = new char[INLINE_FORMAT_BUFFER_LEN + 1];
- if (buf != 0)
- {
- int len =vsnprintf(buf,INLINE_FORMAT_BUFFER_LEN, format_string, argList);
- assign(buf,buf+len);
- delete[] buf;
- }
-#endif
- va_end( argList );
- return *this;
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::trim_left
- Access: public
- Qualifier:
- Parameter: value_type ch
- Returns: string_ref&
-
- Purpose: delete all char which is ch at the left of the string
- *******************************************************************************/
- string_ref& trim_left(value_type ch = ' ')
- {
- size_type off = this->find_first_not_of(ch);
- if (off != string::npos)
- {
- this->erase(0, off);
- }
- return *this;
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::trim_right
- Access: public
- Qualifier:
- Parameter: value_type ch
- Returns: string_ref&
-
- Purpose: delete all char which is ch at the right of the string
- *******************************************************************************/
- string_ref& trim_right(value_type ch = ' ')
- {
- size_type off = this->find_last_not_of(ch);
- if (off == string::npos)
- {
- off = 0;
- }
- else
- {
- off++;
- }
- this->erase(off, length() - off);
- return *this;
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::trim
- Access: public
- Qualifier:
- Parameter: value_type ch
- Returns: string_ref&
-
- Purpose: delete all char which is ch at the left and right of the string
- *******************************************************************************/
- string_ref& trim(value_type ch = ' ')
- {
- trim_left(ch);
- trim_right(ch);
- return *this;
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::float_num
- Access: public static
- Qualifier:
- Parameter: const string & str
- Returns: double
-
- Purpose: parse str to a float number
- *******************************************************************************/
- static double float_num(const string& str)
- {
- return atof(str.c_str());
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::float_num
- Access: public static
- Qualifier:
- Returns: double
-
- Purpose: parse this to a float number
- *******************************************************************************/
- double float_num() const
- {
- return float_num(*this);
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::compare_nocase
- Access: public
- Qualifier: const
- Parameter: const string & str
- Returns: int
-
- Purpose: compare string no case
- *******************************************************************************/
- int compare_nocase(const string& str) const
- {
-#ifdef _WIN32
- return _stricmp(this->c_str(), str.c_str());
-#else
- return strcasecmp(this->c_str(), str.c_str());
-#endif
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::compare_nocase
- Access: public
- Qualifier: const
- Parameter: size_type index
- Parameter: size_type length
- Parameter: const string & str
- Returns: int
-
- Purpose: compare substring no case
- *******************************************************************************/
- int compare_nocase( size_type index, size_type length, const string &str ) const
- {
- string_ref temp = this->substr(index, length);
- return temp.compare_nocase(str);
- }
-
- /*******************************************************************************
- Function: hl_lib::string_ref::compare_nocase
- Access: public
- Qualifier: const
- Parameter: size_type index
- Parameter: size_type length
- Parameter: const string & str
- Parameter: size_type index2
- Parameter: size_type length2
- Returns: int
-
- Purpose: compare two substring no case
- *******************************************************************************/
- int compare_nocase( size_type index, size_type length, const string &str, size_type index2, size_type length2) const
- {
- string_ref temp1 = this->substr(index, length);
- string_ref temp2 = str.substr(index2, length2);
- return temp1.compare_nocase(temp2);
- }
-
- };
-
-}
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ParentProcessWatcher.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ParentProcessWatcher.h
deleted file mode 100644
index 6d082d2d2a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ParentProcessWatcher.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/MessageIssue.h"
-#include <memory>
-
-class ParentProcessWatcher
-{
-public:
- struct ParentProcessWatcherData;
-
- ParentProcessWatcher(lsp::Log& log, int pid, const std::function<void()>&& callback, uint32_t poll_delay_secs = 10);
-
- ~ParentProcessWatcher();
-
- std::shared_ptr<ParentProcessWatcherData> d_ptr;
-};
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProcessIoService.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProcessIoService.h
deleted file mode 100644
index 5edecef0b2..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProcessIoService.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-#include <boost/asio.hpp>
-#include <iostream>
-
-namespace lsp
-{
- class ProcessIoService
- {
- public:
- using IOService = boost::asio::io_service;
- using Work = boost::asio::io_service::work;
- using WorkPtr = std::unique_ptr<Work>;
-
- ProcessIoService() {
-
- work_ = std::unique_ptr<Work>(new Work(ioService_));
- auto temp_thread_ = new std::thread([this]
- {
- ioService_.run();
- });
- thread_ = std::unique_ptr<std::thread>(temp_thread_);
- }
-
- ProcessIoService(const ProcessIoService&) = delete;
- ProcessIoService& operator=(const ProcessIoService&) = delete;
-
- boost::asio::io_service& getIOService()
- {
- return ioService_;
- }
-
- void stop()
- {
-
- work_.reset();
-
- thread_->join();
-
- }
-
- private:
- IOService ioService_;
- WorkPtr work_;
- std::unique_ptr<std::thread> thread_;
-
- };
-
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProtocolJsonHandler.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProtocolJsonHandler.h
deleted file mode 100644
index f6097fe172..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ProtocolJsonHandler.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/MessageJsonHandler.h"
-namespace lsp {
- class ProtocolJsonHandler : public MessageJsonHandler
- {
- public:
- ProtocolJsonHandler();
- };
-
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ResourceOperation.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/ResourceOperation.h
deleted file mode 100644
index 3d317a8153..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/ResourceOperation.h
+++ /dev/null
@@ -1,121 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <vector>
-#include "lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/lsp/lsTextEdit.h"
-struct ResourceOperation {
- std::string kind;
- virtual ~ResourceOperation() = default;
-
- MAKE_SWAP_METHOD(ResourceOperation, kind);
-};
-MAKE_REFLECT_STRUCT(ResourceOperation, kind);
-extern void Reflect(Writer& visitor, ResourceOperation* value);
-struct CreateFileOptions{
-
- /**
- * Overwrite existing file. Overwrite wins over `ignoreIfExists`
- */
- optional<bool> overwrite = false;
-
- /**
- * Ignore if exists.
- */
- optional< bool> ignoreIfExists =false;
-
- MAKE_SWAP_METHOD(CreateFileOptions, overwrite, ignoreIfExists)
-};
-MAKE_REFLECT_STRUCT(CreateFileOptions, overwrite, ignoreIfExists)
-struct lsCreateFile :public ResourceOperation {
-
- /**
- * The resource to create.
- */
- lsCreateFile();
- lsDocumentUri uri;
-
- /**
- * Additional options
- */
- optional<CreateFileOptions> options;
-
-
- /**
- * An optional annotation identifer describing the operation.
- *
- * @since 3.16.0
- */
- optional<lsChangeAnnotationIdentifier> annotationId;
-
- MAKE_SWAP_METHOD(lsCreateFile, kind, uri, options, annotationId)
-};
-MAKE_REFLECT_STRUCT(lsCreateFile, kind, uri,options, annotationId)
-
-
-struct DeleteFileOptions {
- /**
- * Delete the content recursively if a folder is denoted.
- */
- optional<bool> recursive = false;
-
- /**
- * Ignore the operation if the file doesn't exist.
- */
- optional<bool> ignoreIfNotExists = false;
-
-
- MAKE_SWAP_METHOD(DeleteFileOptions, recursive, ignoreIfNotExists);
-};
-
-MAKE_REFLECT_STRUCT(DeleteFileOptions, recursive, ignoreIfNotExists)
-
-struct lsDeleteFile :public ResourceOperation {
- /**
- * The file to delete.
- */
- lsDeleteFile();
- lsDocumentUri uri;
-
- /**
- * Delete options.
- */
- optional<DeleteFileOptions> options;
-
- MAKE_SWAP_METHOD(lsDeleteFile, kind, uri, options);
-};
-MAKE_REFLECT_STRUCT(lsDeleteFile, kind, uri,options);
-
-typedef CreateFileOptions RenameFileOptions;
-struct lsRenameFile :public ResourceOperation {
- /**
- * The old (existing) location.
- */
- lsRenameFile();
- lsDocumentUri oldUri;
-
- /**
- * The new location.
- */
-
- lsDocumentUri newUri;
-
- /**
- * Rename options.
- */
- optional<RenameFileOptions> options;
-
- /**
- * An optional annotation identifer describing the operation.
- *
- * @since 3.16.0
- */
- optional<lsChangeAnnotationIdentifier> annotationId;
-
- MAKE_SWAP_METHOD(lsRenameFile, kind, oldUri, newUri, options, annotationId)
-};
-MAKE_REFLECT_STRUCT(lsRenameFile, kind, oldUri, newUri, options, annotationId);
-
-
-extern ResourceOperation* GetResourceOperation(lsp::Any& lspAny);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/SimpleTimer.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/SimpleTimer.h
deleted file mode 100644
index 3178d25d69..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/SimpleTimer.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#pragma once
-#include <thread>
-#include <atomic>
-#include <functional>
-#include <boost/asio.hpp>
-
-template<typename Duration = boost::posix_time::milliseconds>
-class SimpleTimer
-{
-public:
- SimpleTimer(unsigned int duration,const std::function<void()>& _call_back)
- :is_running_(true), call_back(_call_back), _deadline_timer(_ios, Duration(duration))
- {
- _deadline_timer.async_wait([&](const boost::system::error_code& e)
- {
- if (e.value() == boost::asio::error::operation_aborted)
- {
- return;
- }
- if(is_running_.load(std::memory_order_relaxed))
- {
- call_back();
- }
-
- });
- _thread = std::thread([this] { _ios.run(); });
- }
- ~SimpleTimer()
- {
- Stop();
- }
- void Stop()
- {
- is_running_.store(false, std::memory_order_relaxed);
- _ios.stop();
- if (_thread.joinable())
- {
- _thread.join();
- }
- }
-private:
- std::atomic_bool is_running_;
- std::function<void()> call_back;
- boost::asio::io_service _ios;
- boost::asio::deadline_timer _deadline_timer;
- std::thread _thread;
-
-
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/registerCapability.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/registerCapability.h
deleted file mode 100644
index 60484db56a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/registerCapability.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-
-/**
- * General parameters to register for a capability.
- */
-
-struct Registration {
- static Registration Create(const std::string& method);
- /**
- * The id used to register the request. The id can be used to deregister
- * the request again.
- */
- std::string id;
-
- /**
- * The method / capability to register for.
- */
-
- std::string method;
-
- MAKE_SWAP_METHOD(Registration, id, method);
-};
-
-
-MAKE_REFLECT_STRUCT(Registration, id, method);
-
-/**
- * The client/registerCapability request is sent from the server to the client to register
- * for a new capability on the client side. Not all clients need to support dynamic
- * capability registration. A client opts in via the dynamicRegistration property on the
- * specific client capabilities. A client can even provide dynamic registration for
- * capability A but not for capability B (see TextDocumentClientCapabilities as an example).
- */
-struct RegistrationParams
-{
- std::vector<Registration> registrations;
- MAKE_SWAP_METHOD(RegistrationParams, registrations);
-};
-/**
- * The client/registerCapability request is sent from the server to the client
- * to register for a new capability on the client side.
- * Not all clients need to support dynamic capability registration.
- * A client opts in via the ClientCapabilities.dynamicRegistration property
- */
-MAKE_REFLECT_STRUCT(RegistrationParams, registrations);
-
-DEFINE_REQUEST_RESPONSE_TYPE(Req_ClientRegisterCapability, RegistrationParams,JsonNull, "client/registerCapability");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/unregisterCapability.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/unregisterCapability.h
deleted file mode 100644
index 33bf9d1db6..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/client/unregisterCapability.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-/**
- * General parameters to unregister a capability.
- */
-
-struct Unregistration {
- /**
- * The id used to unregister the request or notification. Usually an id
- * provided during the register request.
- */
-
- std::string id;
-
- /**
- * The method / capability to unregister for.
- */
-
- std::string method;
-
- MAKE_SWAP_METHOD(Unregistration, id, method);
-};
-MAKE_REFLECT_STRUCT(Unregistration, id, method);
-/**
- * The client/unregisterCapability request is sent from the server to the client to unregister
- * a previously registered capability.
- */
-struct UnregistrationParams
-{
- std::vector<Unregistration> unregisterations;
- MAKE_SWAP_METHOD(UnregistrationParams, unregisterations);
-};
-
-MAKE_REFLECT_STRUCT(UnregistrationParams, unregisterations);
-
-DEFINE_REQUEST_RESPONSE_TYPE(Req_ClientUnregisterCapability, UnregistrationParams,JsonNull, "client/unregisterCapability");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/Move.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/Move.h
deleted file mode 100644
index c0beb625f2..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/Move.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "getMoveDestinations.h"
-#include "getRefactorEdit.h"
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_move, MoveParams, RefactorWorkspaceEdit, "java/move");
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/OverridableMethod.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/OverridableMethod.h
deleted file mode 100644
index dd0ada60cc..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/OverridableMethod.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <string>
-struct OverridableMethod
-{
- std::string bindingKey;
- std::string name;
- std::vector<std::string> parameters;
- bool unimplemented = false;
- std::string declaringClass;
- std::string declaringClassType;
-
- void swap(OverridableMethod& arg) noexcept
- {
- bindingKey.swap(arg.bindingKey);
- name.swap(arg.name);
- parameters.swap(arg.parameters);
- declaringClass.swap(arg.declaringClass);
- declaringClassType.swap(arg.declaringClassType);
- std::swap(unimplemented, arg.unimplemented);
- }
-};
-MAKE_REFLECT_STRUCT(OverridableMethod, bindingKey, name, parameters, unimplemented, declaringClass, declaringClassType);
-
-struct OverridableMethodsResponse
-{
- std::string type;
- std::vector<OverridableMethod> methods;
-
- MAKE_SWAP_METHOD(OverridableMethodsResponse, type, methods)
-};
-
-MAKE_REFLECT_STRUCT(OverridableMethodsResponse, type, methods)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/WorkspaceSymbolParams.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/WorkspaceSymbolParams.h
deleted file mode 100644
index c8ddbe3c01..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/WorkspaceSymbolParams.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <string>
-
-
-struct WorkspaceSymbolParams
-{
- std::string query;
- MAKE_SWAP_METHOD(WorkspaceSymbolParams, query);
-};
-MAKE_REFLECT_STRUCT(WorkspaceSymbolParams, query);
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/addOverridableMethods.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/addOverridableMethods.h
deleted file mode 100644
index 527b3b1827..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/addOverridableMethods.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/message.h"
-#include "OverridableMethod.h"
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-struct AddOverridableMethodParams {
- lsCodeActionParams context;
- std::vector<OverridableMethod> overridableMethods;
-
- MAKE_SWAP_METHOD(AddOverridableMethodParams, context, overridableMethods);
-};
-
-MAKE_REFLECT_STRUCT(AddOverridableMethodParams, context, overridableMethods);
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_addOverridableMethods, AddOverridableMethodParams, lsWorkspaceEdit, "java/addOverridableMethods");
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/buildWorkspace.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/buildWorkspace.h
deleted file mode 100644
index 4809e360bb..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/buildWorkspace.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-#include "WorkspaceSymbolParams.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-
-
-
-enum class BuildWorkspaceStatus : uint8_t{
-
- FAILED, SUCCEED, WITH_ERROR, CANCELLED,
-};
-MAKE_REFLECT_TYPE_PROXY(BuildWorkspaceStatus)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_buildWorkspace, bool, BuildWorkspaceStatus, "java/buildWorkspace");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkConstructorsStatus.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkConstructorsStatus.h
deleted file mode 100644
index acb1e4caa6..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkConstructorsStatus.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "checkHashCodeEqualsStatus.h"
-
-struct LspMethodBinding {
- std::string bindingKey;
- std::string name;
- std::vector< std::string> parameters;
-
- MAKE_SWAP_METHOD(LspMethodBinding, bindingKey, name, parameters);
-};
-MAKE_REFLECT_STRUCT(LspMethodBinding, bindingKey, name, parameters);
-
-
-struct CheckConstructorsResponse {
- std::vector<LspMethodBinding> constructors;
- std::vector<LspVariableBinding> fields;
- MAKE_SWAP_METHOD(CheckConstructorsResponse, constructors, fields)
-};
-MAKE_REFLECT_STRUCT(CheckConstructorsResponse, constructors,fields)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_checkConstructorsStatus, lsCodeActionParams, CheckConstructorsResponse,"java/checkConstructorsStatus")
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkDelegateMethodsStatus.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkDelegateMethodsStatus.h
deleted file mode 100644
index 68a7ed6606..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkDelegateMethodsStatus.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "checkHashCodeEqualsStatus.h"
-#include "checkConstructorsStatus.h"
-
-struct LspDelegateField {
- LspVariableBinding field;
- std::vector<LspMethodBinding> delegateMethods;
-
- MAKE_SWAP_METHOD(LspDelegateField, field, delegateMethods);
-};
-MAKE_REFLECT_STRUCT(LspDelegateField, field, delegateMethods);
-
-
-struct CheckDelegateMethodsResponse {
- std::vector<LspDelegateField> delegateFields;
-
- MAKE_SWAP_METHOD(CheckDelegateMethodsResponse, delegateFields)
-};
-MAKE_REFLECT_STRUCT(CheckDelegateMethodsResponse, delegateFields)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_checkDelegateMethodsStatus,
- lsCodeActionParams, CheckDelegateMethodsResponse, "java/checkDelegateMethodsStatus");
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkHashCodeEqualsStatus.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkHashCodeEqualsStatus.h
deleted file mode 100644
index 88731c29b5..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkHashCodeEqualsStatus.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include <LibLsp/lsp/lsCodeAction.h>
-
-#include "LibLsp/lsp/CodeActionParams.h"
-
-struct LspVariableBinding {
- std::string bindingKey;
- std::string name;
- std::string type;
- bool isField;
- void swap(LspVariableBinding& arg) noexcept
- {
- bindingKey.swap(arg.bindingKey);
- name.swap(arg.name);
- type.swap(arg.type);
- std::swap(isField, arg.isField);
- }
-};
-MAKE_REFLECT_STRUCT(LspVariableBinding, bindingKey, name, type, isField)
-
-struct CheckHashCodeEqualsResponse {
- std::string type;
- std::vector<LspVariableBinding> fields;
- std::vector<std::string> existingMethods;
- MAKE_SWAP_METHOD(CheckHashCodeEqualsResponse, type, fields, type, existingMethods)
-};
-MAKE_REFLECT_STRUCT(CheckHashCodeEqualsResponse, type, fields, type, existingMethods)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_checkHashCodeEqualsStatus,
- lsCodeActionParams, CheckHashCodeEqualsResponse, "java/checkHashCodeEqualsStatus")
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkToStringStatus.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkToStringStatus.h
deleted file mode 100644
index cadb5ba7dd..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/checkToStringStatus.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "checkHashCodeEqualsStatus.h"
-struct CheckToStringResponse {
- std::string type;
- std::vector<LspVariableBinding> fields;
- bool exists;
- void swap(CheckToStringResponse& arg) noexcept
- {
- type.swap(arg.type);
- fields.swap(arg.fields);
- std::swap(exists, arg.exists);
- }
-};
-MAKE_REFLECT_STRUCT(CheckToStringResponse,type,fields,exists)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_checkToStringStatus,
- lsCodeActionParams, CheckToStringResponse ,"java/checkToStringStatus")
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/classFileContents.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/classFileContents.h
deleted file mode 100644
index 70eb121b99..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/classFileContents.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include <string>
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_classFileContents, lsTextDocumentIdentifier, std::string ,"java/classFileContents");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/codeActionResult.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/codeActionResult.h
deleted file mode 100644
index c0195908d0..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/codeActionResult.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsCodeAction.h"
-#include "LibLsp/lsp/workspace/execute_command.h"
-#include <set>
-#include "LibLsp/lsp/textDocument/code_action.h"
-
-namespace SourceAssistProcessor {
-
- /*std::set<std::string> UNSUPPORTED_RESOURCES = { "module-info.java", "package-info.java"
- };*/
-
-// static const char* COMMAND_ID_ACTION_OVERRIDEMETHODSPROMPT = "java.action.overrideMethodsPrompt";
-// static const char* COMMAND_ID_ACTION_HASHCODEEQUALSPROMPT = "java.action.hashCodeEqualsPrompt";
-// static const char* COMMAND_ID_ACTION_ORGANIZEIMPORTS = "java.action.organizeImports";
-// static const char* COMMAND_ID_ACTION_GENERATETOSTRINGPROMPT = "java.action.generateToStringPrompt";
-// static const char* COMMAND_ID_ACTION_GENERATEACCESSORSPROMPT = "java.action.generateAccessorsPrompt";
-// static const char* COMMAND_ID_ACTION_GENERATECONSTRUCTORSPROMPT = "java.action.generateConstructorsPrompt";
-// static const char* COMMAND_ID_ACTION_GENERATEDELEGATEMETHODSPROMPT = "java.action.generateDelegateMethodsPrompt";
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/executeCommand.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/executeCommand.h
deleted file mode 100644
index 19479adfaf..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/executeCommand.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-#include "LibLsp/lsp/ExecuteCommandParams.h"
-namespace buildpath
-{
-// static const char* EDIT_ORGNIZEIMPORTS = "java.edit.organizeImports";
-// static const char* RESOLVE_SOURCE_ATTACHMENT = "java.project.resolveSourceAttachment";
-
-// static const char* UPDATE_SOURCE_ATTACHMENT = "java.project.updateSourceAttachment";
-
-// static const char* ADD_TO_SOURCEPATH = "java.project.addToSourcePath";
-
-// static const char* REMOVE_FROM_SOURCEPATH = "java.project.removeFromSourcePath";
-
-// static const char* LIST_SOURCEPATHS = "java.project.listSourcePaths";
- struct Result {
- bool status;
- std::string message;
- };
-
-
-
-}
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_executeCommand, ExecuteCommandParams, lsWorkspaceEdit, "java/executeCommand");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/findLinks.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/findLinks.h
deleted file mode 100644
index fd470b17c8..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/findLinks.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "getRefactorEdit.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-
-struct FindLinksParams {
- // Supported link types: superImplementation
- std::string type;
- lsTextDocumentPositionParams position;
-
- MAKE_SWAP_METHOD(FindLinksParams, type, position)
-};
-MAKE_REFLECT_STRUCT(FindLinksParams,type,position)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_findLinks, FindLinksParams,lsp::Any, "java/findLinks");
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateAccessors.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateAccessors.h
deleted file mode 100644
index 82013096c7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateAccessors.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "checkHashCodeEqualsStatus.h"
-#include "resolveUnimplementedAccessors.h"
-
-
-struct GenerateAccessorsParams {
- lsCodeActionParams context;
- std::vector<AccessorField> accessors;
-
-
- MAKE_SWAP_METHOD(GenerateAccessorsParams, context, accessors)
-};
-MAKE_REFLECT_STRUCT(GenerateAccessorsParams, context, accessors)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_generateAccessors, GenerateAccessorsParams, lsWorkspaceEdit, "java/generateAccessors");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateConstructors.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateConstructors.h
deleted file mode 100644
index 157fefed79..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateConstructors.h
+++ /dev/null
@@ -1,19 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "checkHashCodeEqualsStatus.h"
-#include "checkConstructorsStatus.h"
-
-
-struct GenerateConstructorsParams {
- lsCodeActionParams context;
- std::vector<LspMethodBinding> constructors;
- std::vector< LspVariableBinding >fields;
- MAKE_SWAP_METHOD(GenerateConstructorsParams, context, fields)
-};
-MAKE_REFLECT_STRUCT(GenerateConstructorsParams, context, fields)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_generateConstructors, GenerateConstructorsParams, lsWorkspaceEdit, "java/generateConstructors");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateDelegateMethods.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateDelegateMethods.h
deleted file mode 100644
index c6b4729378..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateDelegateMethods.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "checkHashCodeEqualsStatus.h"
-#include "checkConstructorsStatus.h"
-
-struct LspDelegateEntry {
- LspVariableBinding field;
- LspMethodBinding delegateMethod;
- MAKE_SWAP_METHOD(LspDelegateEntry, field, delegateMethod);
-};
-MAKE_REFLECT_STRUCT(LspDelegateEntry, field, delegateMethod);
-
-
-struct GenerateDelegateMethodsParams {
- lsCodeActionParams context;
- std::vector<LspDelegateEntry> delegateEntries;
- MAKE_SWAP_METHOD(GenerateDelegateMethodsParams, context, delegateEntries)
-};
-MAKE_REFLECT_STRUCT(GenerateDelegateMethodsParams, context, delegateEntries)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_generateDelegateMethods, GenerateDelegateMethodsParams, lsWorkspaceEdit, "java/generateDelegateMethods");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateHashCodeEquals.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateHashCodeEquals.h
deleted file mode 100644
index 0881d305b1..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateHashCodeEquals.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <LibLsp/lsp/lsCodeAction.h>
-
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "checkHashCodeEqualsStatus.h"
-
-struct GenerateHashCodeEqualsParams {
- lsCodeActionParams context;
- std::vector<LspVariableBinding> fields;
- bool regenerate= false;
- void swap(GenerateHashCodeEqualsParams& arg) noexcept
- {
- context.swap(arg.context);
- fields.swap(arg.fields);
- std::swap(regenerate, arg.regenerate);
- }
-};
-MAKE_REFLECT_STRUCT(GenerateHashCodeEqualsParams, context, fields, regenerate);
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_generateHashCodeEquals, GenerateHashCodeEqualsParams, lsWorkspaceEdit, "java/generateHashCodeEquals")
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateToString.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateToString.h
deleted file mode 100644
index 5e5324a59b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/generateToString.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "checkHashCodeEqualsStatus.h"
-
-
-struct GenerateToStringParams {
- lsCodeActionParams context;
- std::vector< LspVariableBinding >fields;
-
- MAKE_SWAP_METHOD(GenerateToStringParams, context, fields)
-
-};
-MAKE_REFLECT_STRUCT(GenerateToStringParams, context, fields)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_generateToString, GenerateToStringParams, lsWorkspaceEdit, "java/generateToString");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getMoveDestinations.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getMoveDestinations.h
deleted file mode 100644
index 8fbe2caa8d..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getMoveDestinations.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/lsp/CodeActionParams.h"
-
-struct MoveKindInfo
-{
- static std::string moveResource()
- {
- return "moveResource";
- }
- static std::string moveInstanceMethod()
- {
- return "moveInstanceMethod";
- }
- static std::string moveStaticMember()
- {
- return "moveStaticMember";
- }
-};
-
-struct MoveParams {
- /**
- * The supported move kind: moveResource, moveInstanceMethod, moveStaticMember,
- * moveTypeToNewFile.
- */
- std::string moveKind;
- /**
- * The selected resource uris when the move operation is triggered.
- */
- std::vector<std::string> sourceUris;
- /**
- * The code action params when the move operation is triggered.
- */
- optional<lsCodeActionParams> params;
- /**
- * The possible destination: a folder/package, class, instanceDeclaration.
- */
- lsp::Any destination;
- bool updateReferences;
- void swap(MoveParams& arg) noexcept
- {
- moveKind.swap(arg.moveKind);
- sourceUris.swap(arg.sourceUris);
- params.swap(arg.params);
- destination.swap(arg.destination);
- std::swap(updateReferences, arg.updateReferences);
- }
-};
-MAKE_REFLECT_STRUCT(MoveParams, moveKind, sourceUris, params, destination, updateReferences);
-
-struct MoveDestinationsResponse {
- std::string errorMessage;
- std::vector<lsp::Any > destinations;
- MAKE_SWAP_METHOD(MoveDestinationsResponse, errorMessage, destinations);
-};
-MAKE_REFLECT_STRUCT(MoveDestinationsResponse, errorMessage, destinations);
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_getMoveDestinations, MoveParams, MoveDestinationsResponse, "java/getMoveDestinations");
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getRefactorEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getRefactorEdit.h
deleted file mode 100644
index 23549ecbcc..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/getRefactorEdit.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-
-#include <string>
-#include <vector>
-#include "WorkspaceSymbolParams.h"
-#include "LibLsp/lsp/method_type.h"
-#include "LibLsp/lsp/textDocument/code_action.h"
-#include "LibLsp/lsp/lsFormattingOptions.h"
-
-namespace
-RefactorProposalUtility
-{
- extern const char* APPLY_REFACTORING_COMMAND_ID;
- extern const char* EXTRACT_VARIABLE_ALL_OCCURRENCE_COMMAND;
- extern const char* EXTRACT_VARIABLE_COMMAND;
- extern const char* EXTRACT_CONSTANT_COMMAND;
- extern const char* EXTRACT_METHOD_COMMAND;
- extern const char* EXTRACT_FIELD_COMMAND;
- extern const char* CONVERT_VARIABLE_TO_FIELD_COMMAND;
- extern const char* MOVE_FILE_COMMAND;
- extern const char* MOVE_INSTANCE_METHOD_COMMAND;
- extern const char* MOVE_STATIC_MEMBER_COMMAND;
- extern const char* MOVE_TYPE_COMMAND;
-};
-
-
-struct RenamePosition {
- lsDocumentUri uri;
- int offset = 0;
- int length = 0;
- void swap(RenamePosition& arg) noexcept
- {
- uri.swap(arg.uri);
- std::swap(offset, arg.offset);
- std::swap(length, arg.length);
- }
-};
-MAKE_REFLECT_STRUCT(RenamePosition, uri, offset, length);
-
-struct GetRefactorEditParams
-{
- std::string command;
- std::vector<lsp::Any> commandArguments;
- lsCodeActionParams context;
- optional<lsFormattingOptions> options;
- MAKE_SWAP_METHOD(GetRefactorEditParams, command, context, options);
-};
-MAKE_REFLECT_STRUCT(GetRefactorEditParams, command, context, options);
-
-
-
-
-struct RefactorWorkspaceEdit {
- /**
- * The workspace edit this code action performs.
- */
- lsWorkspaceEdit edit;
- /**
- * A command this code action executes. If a code action provides a edit and a
- * command, first the edit is executed and then the command.
- */
-
- optional<std::string> errorMessage;
-
- optional < lsCommandWithAny > command;
-
- MAKE_SWAP_METHOD(RefactorWorkspaceEdit, edit, command, errorMessage)
-};
-MAKE_REFLECT_STRUCT(RefactorWorkspaceEdit,edit,command,errorMessage)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_getRefactorEdit, GetRefactorEditParams, RefactorWorkspaceEdit, "java/getRefactorEdit");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/listOverridableMethods.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/listOverridableMethods.h
deleted file mode 100644
index 13b73ce5c2..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/listOverridableMethods.h
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "OverridableMethod.h"
-
-
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_listOverridableMethods, lsCodeActionParams, OverridableMethodsResponse, "java/listOverridableMethods");
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/organizeImports.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/organizeImports.h
deleted file mode 100644
index 817d52d32b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/organizeImports.h
+++ /dev/null
@@ -1,12 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <LibLsp/lsp/lsCodeAction.h>
-
-#include "LibLsp/lsp/CodeActionParams.h"
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_organizeImports, lsCodeActionParams, lsWorkspaceEdit, "java/organizeImports");
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/projectConfigurationUpdate.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/projectConfigurationUpdate.h
deleted file mode 100644
index 342d167093..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/projectConfigurationUpdate.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-
-#include <string>
-#include <vector>
-#include "WorkspaceSymbolParams.h"
-
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-DEFINE_NOTIFICATION_TYPE(java_projectConfigurationUpdate, lsTextDocumentIdentifier, "java/projectConfigurationUpdate");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/resolveUnimplementedAccessors.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/resolveUnimplementedAccessors.h
deleted file mode 100644
index f8bd8a4f7a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/resolveUnimplementedAccessors.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "checkHashCodeEqualsStatus.h"
-
-
-struct AccessorField {
- std::string fieldName;
- bool isStatic =false;
- bool generateGetter = false;
- bool generateSetter = false;
- void swap(AccessorField& arg) noexcept{
- fieldName.swap(arg.fieldName);
- std::swap(isStatic, arg.isStatic);
- std::swap(generateGetter, arg.generateGetter);
- std::swap(generateSetter, arg.generateSetter);
- }
-};
-
-MAKE_REFLECT_STRUCT(AccessorField, fieldName,isStatic,generateGetter,generateSetter)
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_resolveUnimplementedAccessors, lsCodeActionParams, std::vector<AccessorField>, "java/resolveUnimplementedAccessors");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/searchSymbols.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/searchSymbols.h
deleted file mode 100644
index 6639ad2cf4..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/jdtls/searchSymbols.h
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-#include <string>
-#include <vector>
-#include "WorkspaceSymbolParams.h"
-#include "LibLsp/lsp/method_type.h"
-#include "LibLsp/lsp/symbol.h"
-
-
-struct SearchSymbolParams :public WorkspaceSymbolParams
-{
- optional<std::string> projectName;
- optional< bool >sourceOnly;
- optional< int> maxResults;
- MAKE_SWAP_METHOD(SearchSymbolParams, query, projectName, sourceOnly, maxResults);
-};
-MAKE_REFLECT_STRUCT(SearchSymbolParams, query, projectName, sourceOnly, maxResults);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(java_searchSymbols, SearchSymbolParams, std::vector<lsSymbolInformation>, "java/searchSymbols");
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/sonarlint/protocol.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/sonarlint/protocol.h
deleted file mode 100644
index 6752c40812..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/extention/sonarlint/protocol.h
+++ /dev/null
@@ -1,176 +0,0 @@
-#pragma once
-#include <string>
-#include <optional>
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/lsp/general/InitializeParams.h"
-
-struct LintRule
-{
- std::string key;
- std::string name;
-
-
- std::string Display() const
- {
- return name + " (" + key + ")";
- }
- bool activeByDefault = true;
- optional<std::string> severity;
- optional<std::string> type;
- int icon_index = -1;
- MAKE_SWAP_METHOD(LintRule, key, name, activeByDefault, severity, type);
-
-};
-MAKE_REFLECT_STRUCT(LintRule, key, name, activeByDefault, severity, type);
-
-
-struct RuleParameter {
- std::string name;
- optional<std::string> description;
- optional<std::string> defaultValue;
-
-};
-MAKE_REFLECT_STRUCT(RuleParameter, name, description, defaultValue);
-
-struct ShowRuleDescriptionParams {
-
- optional<std::string> key;
-
- optional<std::string> name;
-
- optional<std::string> htmlDescription;
-
- optional<std::string> type;
-
- optional<std::string> severity;
-
- optional< std::vector<RuleParameter> > parameters;
- MAKE_SWAP_METHOD(ShowRuleDescriptionParams, key, name, htmlDescription, type, severity, parameters)
-
-
-};
-MAKE_REFLECT_STRUCT(ShowRuleDescriptionParams, key, name, htmlDescription, type, severity, parameters);
-
-
-struct GetJavaConfigResponse {
- std::string projectRoot;
- std::string sourceLevel;
- std::vector<std::string> classpath;
- bool isTest;
- std::string vmLocation;
- MAKE_SWAP_METHOD(GetJavaConfigResponse, projectRoot, sourceLevel, classpath, isTest, vmLocation);
-};
-MAKE_REFLECT_STRUCT(GetJavaConfigResponse, projectRoot, sourceLevel, classpath, isTest, vmLocation);
-
-struct SetTraceNotificationParams {
- lsInitializeParams::lsTrace value;
-};
-MAKE_REFLECT_STRUCT(SetTraceNotificationParams, value);
-
-
-struct ServerConnectionSettings {
-
- std::string SONARCLOUD_URL = "https://sonarcloud.io";
- std::vector<std::string>SONARCLOUD_ALIAS = { "https://sonarqube.com",
- "https://www.sonarqube.com",
- "https://www.sonarcloud.io",
- "https://sonarcloud.io" };
-
- std::string connectionId;
- std::string serverUrl;
- std::string token;
- optional<std::string> organizationKey;
- MAKE_SWAP_METHOD(ServerConnectionSettings, connectionId, serverUrl, token, organizationKey)
-
-};
-MAKE_REFLECT_STRUCT(ServerConnectionSettings, connectionId, serverUrl, token, organizationKey)
-
-struct RuleSetting
-{
- bool IsOn();
- std::string level = "on";
- RuleSetting(bool activate);
- RuleSetting() = default;
- void toggle();
- void on()
- {
- level = "on";
- }
- void off()
- {
- level = "off";
- }
- void turn(bool activate)
- {
- if (activate)
- {
- on();
- }
- else
- {
- off();
- }
- }
- optional< std::map<std::string, std::string > > parameters;
-};
-MAKE_REFLECT_STRUCT(RuleSetting, level, parameters)
-
-struct ConsoleParams
-{
- optional < bool >showAnalyzerLogs;
- optional < bool >showVerboseLogs;
- MAKE_SWAP_METHOD(ConsoleParams, showAnalyzerLogs, showVerboseLogs)
-};
-MAKE_REFLECT_STRUCT(ConsoleParams, showAnalyzerLogs, showVerboseLogs)
-
-struct SonarLintWorkspaceSettings
-{
- optional < bool > disableTelemetry;
- optional < std::map<std::string, ServerConnectionSettings> >connectedMode;
- optional<std::map<std::string, RuleSetting>> rules;
- optional<ConsoleParams> output;
-
- optional<std::string > pathToNodeExecutable;
-
- optional< std::map<std::string, std::string > > getConfigurationParameters(const std::string& ruleKey);
-
-
-};
-
-MAKE_REFLECT_STRUCT(SonarLintWorkspaceSettings, disableTelemetry, connectedMode,
- rules, output, pathToNodeExecutable)
-
-
-
- DEFINE_REQUEST_RESPONSE_TYPE(slls_listAllRules, JsonNull, lsp::Any, "sonarlint/listAllRules");
-
-
-
-DEFINE_NOTIFICATION_TYPE(Notify_didClasspathUpdate, lsDocumentUri, "sonarlint/didClasspathUpdate")
-
-
-DEFINE_NOTIFICATION_TYPE(Notify_didJavaServerModeChange, std::string, "sonarlint/didJavaServerModeChange")
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(slls_showSonarLintOutput, JsonNull, JsonNull, "sonarlint/showSonarLintOutput");
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(slls_openJavaHomeSettings, JsonNull, JsonNull, "sonarlint/openJavaHomeSettings");
-
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(slls_openPathToNodeSettings, JsonNull, JsonNull, "sonarlint/openPathToNodeSettings");
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(slls_showRuleDescription, ShowRuleDescriptionParams, JsonNull, "sonarlint/showRuleDescription");
-
-DEFINE_REQUEST_RESPONSE_TYPE(slls_getJavaConfig, lsDocumentUri, GetJavaConfigResponse, "sonarlint/getJavaConfig");
-
-
-DEFINE_NOTIFICATION_TYPE(slls_setTraceNotification, SetTraceNotificationParams, "$/setTraceNotification")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/InitializeParams.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/InitializeParams.h
deleted file mode 100644
index 145c63087f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/InitializeParams.h
+++ /dev/null
@@ -1,128 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "lsClientCapabilities.h"
-#include "LibLsp/lsp/workspace/workspaceFolders.h"
-
-struct ClientInfo {
- std::string name;
- optional<std::string> version;
-
- MAKE_SWAP_METHOD(ClientInfo,name,version);
-};
-MAKE_REFLECT_STRUCT(ClientInfo,name,version);
-
-struct lsInitializeParams {
- // The process Id of the parent process that started
- // the server. Is null if the process has not been started by another process.
- // If the parent process is not alive then the server should exit (see exit
- // notification) its process.
- optional<int> processId;
-
- /**
- * Information about the client
- *
- * @since 3.15.0
- */
- optional<ClientInfo> clientInfo;
- /**
- * The locale the client is currently showing the user interface
- * in. This must not necessarily be the locale of the operating
- * system.
- *
- * Uses IETF language tags as the value's syntax
- * (See https://en.wikipedia.org/wiki/IETF_language_tag)
- *
- * @since 3.16.0
- */
- optional<std::string> locale;
-
- // The rootPath of the workspace. Is null
- // if no folder is open.
- //
- // @deprecated in favour of rootUri.
- optional<std::string> rootPath;
-
- // The rootUri of the workspace. Is null if no
- // folder is open. If both `rootPath` and `rootUri` are set
- // `rootUri` wins.
- optional<lsDocumentUri> rootUri;
-
- // User provided initialization options.
- optional<lsp::Any> initializationOptions;
-
- // The capabilities provided by the client (editor or tool)
- lsClientCapabilities capabilities;
-
-
- /**
- * An optional extension to the protocol.
- * To tell the server what client (editor) is talking to it.
- */
- // @Deprecated
- optional< std::string >clientName;
-
-
-
- enum class lsTrace {
- // NOTE: serialized as a string, one of 'off' | 'messages' | 'verbose';
- Off, // off
- Messages, // messages
- Verbose // verbose
-
- };
-
- // The initial trace setting. If omitted trace is disabled ('off').
- lsTrace trace = lsTrace::Off;
-
-
- /**
- * The workspace folders configured in the client when the server starts.
- * This property is only available if the client supports workspace folders.
- * It can be `null` if the client supports workspace folders but none are
- * configured.
- *
- * Since 3.6.0
- */
- optional< std::vector<WorkspaceFolder> > workspaceFolders;
-
- MAKE_SWAP_METHOD(lsInitializeParams,
- processId,
- rootPath,
- rootUri,
- initializationOptions,
- capabilities, clientName, clientInfo,
- trace, workspaceFolders, locale)
-};
-
-void Reflect(Reader& reader, lsInitializeParams::lsTrace& value);
-
-
-void Reflect(Writer& writer, lsInitializeParams::lsTrace& value);
-
-
-MAKE_REFLECT_STRUCT(lsInitializeParams,
- processId,
- rootPath,
- rootUri,
- initializationOptions,
- capabilities, clientName, clientInfo,
- trace, workspaceFolders, locale)
-
-struct lsInitializeError {
- // Indicates whether the client should retry to send the
- // initilize request after showing the message provided
- // in the ResponseError.
- bool retry;
- void swap(lsInitializeError& arg) noexcept
- {
- auto tem = retry;
- retry = arg.retry;
- arg.retry = tem;
- }
-};
-MAKE_REFLECT_STRUCT(lsInitializeError, retry);
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/exit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/exit.h
deleted file mode 100644
index bef9cad31d..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/exit.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-/**
- * A notification to ask the server to exit its process.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_Exit, optional<JsonNull>, "exit");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialize.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialize.h
deleted file mode 100644
index 2198b158bf..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialize.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/message.h"
-#include "InitializeParams.h"
-#include "lsServerCapabilities.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-
-
-
-
-
-
-/**
- * The capabilities the language server provides.
- */
- struct InitializeResult {
- lsServerCapabilities capabilities;
- MAKE_SWAP_METHOD(InitializeResult, capabilities);
- };
-
-MAKE_REFLECT_STRUCT(InitializeResult, capabilities);
-
-
-/**
- * The initialize request is sent as the first request from the client to
- * the server.
- *
- * If the server receives request or notification before the initialize request it should act as follows:
- * - for a request the respond should be errored with code: -32001. The message can be picked by the server.
- * - notifications should be dropped, except for the exit notification. This will allow the exit a server without an initialize request.
- *
- * Until the server has responded to the initialize request with an InitializeResult
- * the client must not sent any additional requests or notifications to the server.
- *
- * During the initialize request the server is allowed to sent the notifications window/showMessage,
- * window/logMessage and telemetry/event as well as the window/showMessageRequest request to the client.
- */
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_initialize, lsInitializeParams, InitializeResult, "initialize");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialized.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialized.h
deleted file mode 100644
index bb6d12511c..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/initialized.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-/**
- * The initialized notification is sent from the client to the server after
- * the client received the result of the initialize request but before the
- * client is sending any other request or notification to the server. The
- * server can use the initialized notification for example to dynamically
- * register capabilities.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_InitializedNotification, JsonNull, "initialized");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsClientCapabilities.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsClientCapabilities.h
deleted file mode 100644
index 4ec9744258..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsClientCapabilities.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsAny.h"
-#include "lsWorkspaceClientCapabilites.h"
-#include "lsTextDocumentClientCapabilities.h"
-
-/**
- * Client capabilities specific to the used markdown parser.
- *
- * @since 3.16.0
- */
-struct MarkdownClientCapabilities {
- /**
- * The name of the parser.
- */
- std::string parser;
-
- /**
- * The version of the parser.
- */
- optional<std::string> version;
- MAKE_SWAP_METHOD(MarkdownClientCapabilities, parser, version)
-
-};
-MAKE_REFLECT_STRUCT(MarkdownClientCapabilities, parser, version)
-
-struct lsClientCapabilities {
- // Workspace specific client capabilities.
- optional<lsWorkspaceClientCapabilites> workspace;
-
- // Text document specific client capabilities.
- optional<lsTextDocumentClientCapabilities> textDocument;
-
- /**
- * Window specific client capabilities.
- */
- optional<lsp::Any> window;
- /**
- * Experimental client capabilities.
- */
- optional<lsp::Any> experimental;
-
- MAKE_SWAP_METHOD(lsClientCapabilities, workspace, textDocument, window, experimental)
-};
-MAKE_REFLECT_STRUCT(lsClientCapabilities, workspace, textDocument, window, experimental)
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsServerCapabilities.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsServerCapabilities.h
deleted file mode 100644
index e8624681b3..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsServerCapabilities.h
+++ /dev/null
@@ -1,589 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/method_type.h"
-
-
-#include <stdexcept>
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "InitializeParams.h"
-#include "LibLsp/lsp/textDocument/SemanticTokens.h"
-
-
-extern void Reflect(Reader&, std::pair<optional<lsTextDocumentSyncKind>, optional<lsTextDocumentSyncOptions> >&);
-
-//
- // Code Action options.
- //
-struct CodeActionOptions : WorkDoneProgressOptions {
- //
- // CodeActionKinds that this server may return.
- //
- // The list of kinds may be generic, such as `CodeActionKind.Refactor`, or the server
- // may list out every specific kind they provide.
- //
- typedef std::string CodeActionKind;
- std::vector<CodeActionKind> codeActionKinds;
-
- MAKE_SWAP_METHOD(CodeActionOptions, workDoneProgress, codeActionKinds);
-};
-MAKE_REFLECT_STRUCT(CodeActionOptions, workDoneProgress, codeActionKinds)
-struct CodeLensOptions : WorkDoneProgressOptions {
- //
- // Code lens has a resolve provider as well.
- //
- optional<bool> resolveProvider ;
- MAKE_SWAP_METHOD(CodeLensOptions, workDoneProgress, resolveProvider);
-};
-MAKE_REFLECT_STRUCT(CodeLensOptions, workDoneProgress, resolveProvider)
-
-
-// Format document on type options
-struct lsDocumentOnTypeFormattingOptions :WorkDoneProgressOptions {
- // A character on which formatting should be triggered, like `}`.
- std::string firstTriggerCharacter;
-
- // More trigger characters.
- std::vector<std::string> moreTriggerCharacter;
- MAKE_SWAP_METHOD(lsDocumentOnTypeFormattingOptions, workDoneProgress,
- firstTriggerCharacter,
- moreTriggerCharacter);
-};
-MAKE_REFLECT_STRUCT(lsDocumentOnTypeFormattingOptions, workDoneProgress,
- firstTriggerCharacter,
- moreTriggerCharacter);
-struct RenameOptions : WorkDoneProgressOptions {
- //
- // Renames should be checked and tested before being executed.
- //
- optional<bool> prepareProvider;
- MAKE_SWAP_METHOD(RenameOptions, workDoneProgress, prepareProvider);
-};
-MAKE_REFLECT_STRUCT(RenameOptions,workDoneProgress,prepareProvider)
-
-struct DocumentFilter{
- //
- // A language id, like `typescript`.
- //
- optional<std::string> language;
- //
- // A Uri [scheme](#Uri.scheme), like `file` or `untitled`.
- //
- optional<std::string>scheme;
- //
- // A glob pattern, like `*.{ts,js}`.
- //
- // Glob patterns can have the following syntax:
- // - `*` to match one or more characters in a path segment
- // - `?` to match on one character in a path segment
- // - `**` to match any number of path segments, including none
- // - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}
- // matches all TypeScript and JavaScript files)
- // - `[]` to declare a range of characters to match in a path segment
- // (e.g., `example.[0-9]` to match on `example.0`, `example.1`,...)
- // - `[!...]` to negate a range of characters to match in a path segment
- // (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
- // not `example.0`)
- //
- optional<std::string>pattern;
- MAKE_SWAP_METHOD(DocumentFilter, language, scheme, pattern)
-};
-MAKE_REFLECT_STRUCT(DocumentFilter, language, scheme, pattern)
-
-//A document selector is the combination of one or more document filters.
-using DocumentSelector = std::vector<DocumentFilter>;
-
-// Document link options
-struct lsDocumentLinkOptions :WorkDoneProgressOptions {
- // Document links have a resolve provider as well.
- optional<bool> resolveProvider;
- MAKE_SWAP_METHOD(lsDocumentLinkOptions, workDoneProgress, resolveProvider);
-};
-MAKE_REFLECT_STRUCT(lsDocumentLinkOptions, workDoneProgress,resolveProvider);
-
-// Execute command options.
-struct lsExecuteCommandOptions : WorkDoneProgressOptions {
- // The commands to be executed on the server
- std::vector<std::string> commands;
- MAKE_SWAP_METHOD(lsExecuteCommandOptions, workDoneProgress, commands);
-};
-MAKE_REFLECT_STRUCT(lsExecuteCommandOptions, workDoneProgress, commands);
-
-
-struct TextDocumentRegistrationOptions
-{
-//
- // A document selector to identify the scope of the registration. If set to null
- // the document selector provided on the client side will be used.
- //
- optional<DocumentSelector> documentSelector;
-
- MAKE_SWAP_METHOD(TextDocumentRegistrationOptions, documentSelector);
-};
-MAKE_REFLECT_STRUCT(TextDocumentRegistrationOptions, documentSelector);
-
-//
- // Static registration options to be returned in the initialize request.
- //
-struct StaticRegistrationOptions :public TextDocumentRegistrationOptions
-{
- //
- // The id used to register the request. The id can be used to deregister
- // the request again. See also Registration#id.
- //
- optional<std::string> id;
- MAKE_SWAP_METHOD(StaticRegistrationOptions, documentSelector, id)
-};
-MAKE_REFLECT_STRUCT(StaticRegistrationOptions, documentSelector,id)
-
-//
- // The server supports workspace folder.
- //
- // Since 3.6.0
- //
-
-struct WorkspaceFoldersOptions {
- //
- // The server has support for workspace folders
- //
- optional<bool> supported;
-
- //
- // Whether the server wants to receive workspace folder
- // change notifications.
- //
- // If a string is provided, the string is treated as an ID
- // under which the notification is registered on the client
- // side. The ID can be used to unregister for these events
- // using the `client/unregisterCapability` request.
- //
- optional<std::pair< optional<std::string>, optional<bool> > > changeNotifications;
- MAKE_SWAP_METHOD(WorkspaceFoldersOptions, supported, changeNotifications);
-};
-MAKE_REFLECT_STRUCT(WorkspaceFoldersOptions, supported, changeNotifications);
-
-//
- // A pattern kind describing if a glob pattern matches a file a folder or
- // both.
- //
- // @since 3.16.0
- //
-enum lsFileOperationPatternKind
-{
- file,
- folder
-};
-MAKE_REFLECT_TYPE_PROXY(lsFileOperationPatternKind)
-
-//
- // Matching options for the file operation pattern.
- //
- // @since 3.16.0
- //
-struct lsFileOperationPatternOptions {
-
- //
- // The pattern should be matched ignoring casing.
- //
- optional<bool> ignoreCase;
- MAKE_SWAP_METHOD(lsFileOperationPatternOptions, ignoreCase)
-};
-MAKE_REFLECT_STRUCT(lsFileOperationPatternOptions, ignoreCase)
-//
- // A pattern to describe in which file operation requests or notifications
- // the server is interested in.
- //
- // @since 3.16.0
- //
-struct lsFileOperationPattern {
- //
- // The glob pattern to match. Glob patterns can have the following syntax:
- // - `*` to match one or more characters in a path segment
- // - `?` to match on one character in a path segment
- // - `**` to match any number of path segments, including none
- // - `{}` to group sub patterns into an OR expression. (e.g. `**/*.{ts,js}`
- // matches all TypeScript and JavaScript files)
- // - `[]` to declare a range of characters to match in a path segment
- // (e.g., `example.[0-9]` to match on `example.0`, `example.1`,...)
- // - `[!...]` to negate a range of characters to match in a path segment
- // (e.g., `example.[!0-9]` to match on `example.a`, `example.b`, but
- // not `example.0`)
- //
- std::string glob;
-
- //
- // Whether to match files or folders with this pattern.
- //
- // Matches both if undefined.
- //
- optional<lsFileOperationPatternKind> matches;
-
- //
- // Additional options used during matching.
- //
- optional<lsFileOperationPatternOptions> options ;
- MAKE_SWAP_METHOD(lsFileOperationPattern, glob, matches, options)
-};
-MAKE_REFLECT_STRUCT(lsFileOperationPattern, glob, matches, options)
-//
- // A filter to describe in which file operation requests or notifications
- // the server is interested in.
- //
- // @since 3.16.0
- //
-struct lsFileOperationFilter {
-
- //
- // A Uri like `file` or `untitled`.
- //
- optional<std::string> scheme;
-
- //
- // The actual file operation pattern.
- //
- optional<lsFileOperationPattern> pattern;
- MAKE_SWAP_METHOD(lsFileOperationFilter, scheme, pattern)
-};
-MAKE_REFLECT_STRUCT(lsFileOperationFilter, scheme, pattern)
-//
- // The options to register for file operations.
- //
- // @since 3.16.0
- //
-struct lsFileOperationRegistrationOptions {
- //
- // The actual filters.
- //
- optional<std::vector<lsFileOperationFilter>> filters;
- MAKE_SWAP_METHOD(lsFileOperationRegistrationOptions, filters)
-};
-MAKE_REFLECT_STRUCT(lsFileOperationRegistrationOptions, filters)
-
-struct WorkspaceServerCapabilities {
- //
- // The server supports workspace folder.
- //
- // Since 3.6.0
- //
- WorkspaceFoldersOptions workspaceFolders;
-
-
- //
- // The server is interested in file notifications/requests.
- //
- // @since 3.16.0
- //
- struct lsFileOperations
- {
- //
- // The server is interested in receiving didCreateFiles
- // notifications.
- //
- optional<lsFileOperationRegistrationOptions> didCreate;
-
- //
- // The server is interested in receiving willCreateFiles requests.
- //
- optional<lsFileOperationRegistrationOptions> willCreate;
-
- //
- // The server is interested in receiving didRenameFiles
- // notifications.
- //
- optional<lsFileOperationRegistrationOptions> didRename;
-
- //
- // The server is interested in receiving willRenameFiles requests.
- //
- optional<lsFileOperationRegistrationOptions> willRename;
-
- //
- // The server is interested in receiving didDeleteFiles file
- // notifications.
- //
- optional<lsFileOperationRegistrationOptions> didDelete;
-
- //
- // The server is interested in receiving willDeleteFiles file
- // requests.
- //
- optional<lsFileOperationRegistrationOptions> willDelete;
- MAKE_SWAP_METHOD(lsFileOperations, didCreate, willCreate, didRename, willRename, didDelete, willDelete)
- };
- optional<lsFileOperations>fileOperations;
-
-
- MAKE_SWAP_METHOD(WorkspaceServerCapabilities, workspaceFolders, fileOperations)
-};
-MAKE_REFLECT_STRUCT(WorkspaceServerCapabilities, workspaceFolders, fileOperations)
-MAKE_REFLECT_STRUCT(WorkspaceServerCapabilities::lsFileOperations, didCreate, willCreate, didRename, willRename, didDelete, willDelete)
-
-//
- // Semantic highlighting server capabilities.
- //
- // <p>
- // <b>Note:</b> the <a href=
- // "https://github.com/Microsoft/vscode-languageserver-node/pull/367">{@code textDocument/semanticHighlighting}
- // language feature</a> is not yet part of the official LSP specification.
- //
-
-struct SemanticHighlightingServerCapabilities {
- //
- // A "lookup table" of semantic highlighting <a href="https://manual.macromates.com/en/language_grammars">TextMate scopes</a>
- // supported by the language server. If not defined or empty, then the server does not support the semantic highlighting
- // feature. Otherwise, clients should reuse this "lookup table" when receiving semantic highlighting notifications from
- // the server.
- //
- std::vector< std::vector<std::string> > scopes;
- MAKE_SWAP_METHOD(SemanticHighlightingServerCapabilities, scopes)
-};
-MAKE_REFLECT_STRUCT(SemanticHighlightingServerCapabilities, scopes)
-
-struct SemanticTokensServerFull
-{
- //
- // The server supports deltas for full documents.
- //
- bool delta =false;
- MAKE_SWAP_METHOD(SemanticTokensServerFull, delta)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensServerFull, delta)
-struct SemanticTokensWithRegistrationOptions
-{
- SemanticTokensLegend legend;
-
- //
- // Server supports providing semantic tokens for a specific range
- // of a document.
- //
- optional< std::pair< optional<bool>, optional<lsp::Any> > > range;
-
- //
- // Server supports providing semantic tokens for a full document.
- //
- optional< std::pair< optional<bool>,
- optional<SemanticTokensServerFull> > > full;
-
- //
- // A document selector to identify the scope of the registration. If set to null
- // the document selector provided on the client side will be used.
- //
- optional < std::vector<DocumentFilter> > documentSelector;
- //
- // The id used to register the request. The id can be used to deregister
- // the request again. See also Registration#id.
- //
- optional<std::string> id;
- MAKE_SWAP_METHOD(SemanticTokensWithRegistrationOptions, legend, range, full, documentSelector, id)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensWithRegistrationOptions, legend, range, full, documentSelector ,id)
-
-using DocumentColorOptions = WorkDoneProgressOptions;
-using FoldingRangeOptions = WorkDoneProgressOptions;
-struct lsServerCapabilities {
- // Defines how text documents are synced. Is either a detailed structure
- // defining each notification or for backwards compatibility the
-
- // TextDocumentSyncKind number.
- optional< std::pair<optional<lsTextDocumentSyncKind>,
- optional<lsTextDocumentSyncOptions> >> textDocumentSync;
-
- // The server provides hover support.
- optional<bool> hoverProvider;
-
- // The server provides completion support.
- optional < lsCompletionOptions > completionProvider;
-
- // The server provides signature help support.
- optional < lsSignatureHelpOptions > signatureHelpProvider;
-
- // The server provides goto definition support.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > definitionProvider;
-
-
- //
- // The server provides Goto Type Definition support.
- //
- // Since 3.6.0
- //
- optional< std::pair< optional<bool>, optional<StaticRegistrationOptions> > > typeDefinitionProvider ;
-
- // The server provides implementation support.
- optional< std::pair< optional<bool>, optional<StaticRegistrationOptions> > > implementationProvider ;
-
- // The server provides find references support.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > referencesProvider ;
-
- // The server provides document highlight support.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > documentHighlightProvider ;
-
- // The server provides document symbol support.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > documentSymbolProvider ;
-
- // The server provides workspace symbol support.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > workspaceSymbolProvider ;
-
- // The server provides code actions.
- optional< std::pair< optional<bool>, optional<CodeActionOptions> > > codeActionProvider ;
-
- // The server provides code lens.
- optional<CodeLensOptions> codeLensProvider;
-
- // The server provides document formatting.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > documentFormattingProvider ;
-
- // The server provides document range formatting.
- optional< std::pair< optional<bool>, optional<WorkDoneProgressOptions> > > documentRangeFormattingProvider ;
-
- // The server provides document formatting on typing.
- optional<lsDocumentOnTypeFormattingOptions> documentOnTypeFormattingProvider;
-
- // The server provides rename support.
- optional< std::pair< optional<bool>, optional<RenameOptions> > > renameProvider;
-
-
- // The server provides document link support.
- optional<lsDocumentLinkOptions > documentLinkProvider;
-
-
- //
- // The server provides color provider support.
- //
- // @since 3.6.0
- //
- optional< std::pair< optional<bool>, optional<DocumentColorOptions> > > colorProvider;
-
-
- //
- // The server provides folding provider support.
- //
- // @since 3.10.0
- //
- optional < std::pair< optional<bool>, optional<FoldingRangeOptions> > > foldingRangeProvider;
-
- // The server provides execute command support.
- optional < lsExecuteCommandOptions >executeCommandProvider;
-
-
- //
- // Workspace specific server capabilities
- //
- optional< WorkspaceServerCapabilities > workspace;
-
- //
- // Semantic highlighting server capabilities.
- //
-
- optional< SemanticHighlightingServerCapabilities >semanticHighlighting;
-
- //
- // Server capability for calculating super- and subtype hierarchies.
- // The LS supports the type hierarchy language feature, if this capability is set to {@code true}.
- //
- // <p>
- // <b>Note:</b> the <a href=
- // "https://github.com/Microsoft/vscode-languageserver-node/pull/426">{@code textDocument/typeHierarchy}
- // language feature</a> is not yet part of the official LSP specification.
- //
-
- optional< std::pair< optional<bool>,
- optional<StaticRegistrationOptions> > > typeHierarchyProvider;
-
- //
- // The server provides Call Hierarchy support.
- //
-
- optional< std::pair< optional<bool>,
- optional<StaticRegistrationOptions> > > callHierarchyProvider;
-
- //
- // The server provides selection range support.
- //
- // Since 3.15.0
- //
- optional< std::pair< optional<bool>,
- optional<StaticRegistrationOptions> > > selectionRangeProvider;
-
- //
- // The server provides linked editing range support.
- //
- // Since 3.16.0
- //
- optional< std::pair< optional<bool>,
- optional<StaticRegistrationOptions> > > linkedEditingRangeProvider;
-
-
- //
- // The server provides semantic tokens support.
- //
- // Since 3.16.0
- //
- optional < SemanticTokensWithRegistrationOptions> semanticTokensProvider;
-
- //
- // Whether server provides moniker support.
- //
- // Since 3.16.0
- //
- optional< std::pair< optional<bool>,
- optional<StaticRegistrationOptions> > > monikerProvider;
-
- optional<lsp::Any> experimental;
-
-
- MAKE_SWAP_METHOD(lsServerCapabilities,
- textDocumentSync,
- hoverProvider,
- completionProvider,
- signatureHelpProvider,
- definitionProvider,
- typeDefinitionProvider,
- implementationProvider,
- referencesProvider,
- documentHighlightProvider,
- documentSymbolProvider,
- workspaceSymbolProvider,
- codeActionProvider,
- codeLensProvider,
- documentFormattingProvider,
- documentRangeFormattingProvider,
- documentOnTypeFormattingProvider,
- renameProvider,
- documentLinkProvider,
- executeCommandProvider,
- workspace,
- semanticHighlighting,
- typeHierarchyProvider,
- callHierarchyProvider,
- selectionRangeProvider,
- experimental, colorProvider, foldingRangeProvider,
- linkedEditingRangeProvider, monikerProvider, semanticTokensProvider)
-
-};
-MAKE_REFLECT_STRUCT(lsServerCapabilities,
- textDocumentSync,
- hoverProvider,
- completionProvider,
- signatureHelpProvider,
- definitionProvider,
- typeDefinitionProvider,
- implementationProvider,
- referencesProvider,
- documentHighlightProvider,
- documentSymbolProvider,
- workspaceSymbolProvider,
- codeActionProvider,
- codeLensProvider,
- documentFormattingProvider,
- documentRangeFormattingProvider,
- documentOnTypeFormattingProvider,
- renameProvider,
- documentLinkProvider,
- executeCommandProvider,
- workspace,
- semanticHighlighting,
- typeHierarchyProvider,
- callHierarchyProvider,
- selectionRangeProvider,
- experimental, colorProvider, foldingRangeProvider,
- linkedEditingRangeProvider, monikerProvider, semanticTokensProvider)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsTextDocumentClientCapabilities.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsTextDocumentClientCapabilities.h
deleted file mode 100644
index 1523254d63..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsTextDocumentClientCapabilities.h
+++ /dev/null
@@ -1,713 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/method_type.h"
-
-
-#include <stdexcept>
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/lsp/extention/jdtls/searchSymbols.h"
-#include "lsWorkspaceClientCapabilites.h"
-#include "LibLsp/lsp/lsp_completion.h"
-#include "LibLsp/lsp/lsp_diagnostic.h"
-
-
-struct WorkDoneProgressOptions
-{
- optional<bool>workDoneProgress;
- MAKE_SWAP_METHOD(WorkDoneProgressOptions, workDoneProgress);
-};
-MAKE_REFLECT_STRUCT(WorkDoneProgressOptions, workDoneProgress);
-
-// Completion options.
-struct lsCompletionOptions:WorkDoneProgressOptions
-{
- // The server provides support to resolve additional
- // information for a completion item.
- optional<bool> resolveProvider = false;
-
- //
- // Most tools trigger completion request automatically without explicitly requesting
- // it using a keyboard shortcut (e.g. Ctrl+Space). Typically they do so when the user
- // starts to type an identifier. For example if the user types `c` in a JavaScript file
- // code complete will automatically pop up present `console` besides others as a
- // completion item. Characters that make up identifiers don't need to be listed here.
- //
- // If code complete should automatically be trigger on characters not being valid inside
- // an identifier (for example `.` in JavaScript) list them in `triggerCharacters`.
- //
- // https://github.com/Microsoft/language-server-protocol/issues/138.
- optional< std::vector<std::string> > triggerCharacters ;
-
- //
- // The list of all possible characters that commit a completion. This field can be used
- // if clients don't support individual commmit characters per completion item. See
- // `ClientCapabilities.textDocument.completion.completionItem.commitCharactersSupport`
- //
- optional< std::vector<std::string> > allCommitCharacters;
-
- MAKE_SWAP_METHOD(lsCompletionOptions, workDoneProgress, resolveProvider, triggerCharacters, allCommitCharacters);
-};
-MAKE_REFLECT_STRUCT(lsCompletionOptions, workDoneProgress, resolveProvider, triggerCharacters,allCommitCharacters);
-
-
-
-// Save options.
-struct lsSaveOptions {
- // The client is supposed to include the content on save.
- bool includeText = false;
- void swap(lsSaveOptions& arg)noexcept
- {
- auto temp = includeText;
- includeText = arg.includeText;
- arg.includeText = temp;
- }
-};
-MAKE_REFLECT_STRUCT(lsSaveOptions, includeText);
-
-// Signature help options.
-struct lsSignatureHelpOptions : WorkDoneProgressOptions {
- // The characters that trigger signature help automatically.
- // NOTE: If updating signature help tokens make sure to also update
- // WorkingFile::FindClosestCallNameInBuffer.
- std::vector<std::string> triggerCharacters;
- MAKE_SWAP_METHOD(lsSignatureHelpOptions, workDoneProgress, triggerCharacters);
-};
-MAKE_REFLECT_STRUCT(lsSignatureHelpOptions, workDoneProgress, triggerCharacters);
-
-// Defines how the host (editor) should sync document changes to the language
-// server.
-enum class lsTextDocumentSyncKind {
- // Documents should not be synced at all.
- None = 0,
-
- // Documents are synced by always sending the full content
- // of the document.
- Full = 1,
-
- // Documents are synced by sending the full content on open.
- // After that only incremental updates to the document are
- // send.
- Incremental = 2
-};
-
-#if _WIN32
-MAKE_REFLECT_TYPE_PROXY(lsTextDocumentSyncKind)
-#else
-//#pragma clang diagnostic push
-//#pragma clang diagnostic ignored "-Wunused-function"
-MAKE_REFLECT_TYPE_PROXY(lsTextDocumentSyncKind)
-//#pragma clang diagnostic pop
-#endif
-
-struct lsTextDocumentSyncOptions {
- // Open and close notifications are sent to the server.
- optional<bool> openClose ;
- // Change notificatins are sent to the server. See TextDocumentSyncKind.None,
- // TextDocumentSyncKind.Full and TextDocumentSyncKindIncremental.
- optional< lsTextDocumentSyncKind> change ;
- // Will save notifications are sent to the server.
- optional<bool> willSave;
- // Will save wait until requests are sent to the server.
- optional<bool> willSaveWaitUntil;
- // Save notifications are sent to the server.
- optional<lsSaveOptions> save;
-
- MAKE_SWAP_METHOD(lsTextDocumentSyncOptions,
- openClose,
- change,
- willSave,
- willSaveWaitUntil,
- save);
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentSyncOptions,
- openClose,
- change,
- willSave,
- willSaveWaitUntil,
- save);
-
-struct SynchronizationCapabilities {
- // Whether text document synchronization supports dynamic registration.
- optional<bool> dynamicRegistration;
-
- // The client supports sending will save notifications.
- optional<bool> willSave;
-
- // The client supports sending a will save request and
- // waits for a response providing text edits which will
- // be applied to the document before it is saved.
- optional<bool> willSaveWaitUntil;
-
- // The client supports did save notifications.
- optional<bool> didSave;
-
- MAKE_SWAP_METHOD(SynchronizationCapabilities,
- dynamicRegistration,
- willSave,
- willSaveWaitUntil,
- didSave);
-};
-MAKE_REFLECT_STRUCT(SynchronizationCapabilities,
- dynamicRegistration,
- willSave,
- willSaveWaitUntil,
- didSave);
-
-struct CompletionItemKindCapabilities
-{
- optional<std::vector<lsCompletionItemKind> >valueSet;
- MAKE_SWAP_METHOD(CompletionItemKindCapabilities, valueSet);
-};
-MAKE_REFLECT_STRUCT(CompletionItemKindCapabilities, valueSet);
-
-struct CompletionItemCapabilities {
- // Client supports snippets as insert text.
- //
- // A snippet can define tab stops and placeholders with `$1`, `$2`
- // and `${3:foo}`. `$0` defines the final tab stop, it defaults to
- // the end of the snippet. Placeholders with equal identifiers are linked,
- // that is typing in one will update others too.
- optional<bool> snippetSupport;
-
- // Client supports commit characters on a completion item.
-
- optional<bool> commitCharactersSupport;
-
-
- // Client supports the following content formats for the documentation
- // property. The order describes the preferred format of the client.
-
- optional< std::vector<std::string> > documentationFormat;
-
- // Client supports the deprecated property on a completion item.
-
- optional<bool> deprecatedSupport;
-
- //
- // Client supports the preselect property on a completion item.
- //
- optional<bool> preselectSupport;
-
- MAKE_SWAP_METHOD(CompletionItemCapabilities,
- snippetSupport,
- commitCharactersSupport,
- documentationFormat,
- deprecatedSupport, preselectSupport);
-};
-MAKE_REFLECT_STRUCT(CompletionItemCapabilities,
- snippetSupport,
- commitCharactersSupport,
- documentationFormat,
- deprecatedSupport, preselectSupport);
-
-
-//
- // Capabilities specific to the `textDocument/completion`
- //
-struct CompletionCapabilities {
- // Whether completion supports dynamic registration.
- optional<bool> dynamicRegistration;
-
-
-
- // The client supports the following `CompletionItem` specific
- // capabilities.
- optional<CompletionItemCapabilities> completionItem;
-
- //
- // The client supports the following `CompletionItemKind` specific
- // capabilities.
- //
- optional<CompletionItemKindCapabilities> completionItemKind;
-
- //
- // The client supports sending additional context information for a
- // `textDocument/completion` request.
- //
- optional<bool> contextSupport;
-
-
- MAKE_SWAP_METHOD(CompletionCapabilities,
- dynamicRegistration,
- completionItem, completionItemKind);
-};
-
-MAKE_REFLECT_STRUCT(CompletionCapabilities,
- dynamicRegistration,
- completionItem , completionItemKind);
-
-
-struct HoverCapabilities:public DynamicRegistrationCapabilities
-{
- //
- // Client supports the following content formats for the content
- // property. The order describes the preferred format of the client.
- //
- // See {@link MarkupKind} for allowed values.
- //
- optional<std::vector<std::string>> contentFormat;
-
- MAKE_SWAP_METHOD(HoverCapabilities, dynamicRegistration, contentFormat);
-};
-MAKE_REFLECT_STRUCT(HoverCapabilities, dynamicRegistration, contentFormat);
-
-//
- // Client capabilities specific to parameter information.
- //
-struct ParameterInformationCapabilities {
- //
- // The client supports processing label offsets instead of a
- // simple label string.
- //
- // Since 3.14.0
- //
- optional<bool> labelOffsetSupport;
-
- MAKE_SWAP_METHOD(ParameterInformationCapabilities, labelOffsetSupport);
-};
-MAKE_REFLECT_STRUCT(ParameterInformationCapabilities, labelOffsetSupport)
-
-
-struct SignatureInformationCapabilities {
- //
- // Client supports the following content formats for the documentation
- // property. The order describes the preferred format of the client.
- //
- // See {@link MarkupKind} for allowed values.
- //
- std::vector<std::string> documentationFormat;
-
- //
- // Client capabilities specific to parameter information.
- //
- ParameterInformationCapabilities parameterInformation;
-
- MAKE_SWAP_METHOD(SignatureInformationCapabilities, documentationFormat, parameterInformation)
-};
-MAKE_REFLECT_STRUCT(SignatureInformationCapabilities,documentationFormat, parameterInformation)
-
-struct SignatureHelpCapabilities :public DynamicRegistrationCapabilities
-{
- //
- // The client supports the following `SignatureInformation`
- // specific properties.
- //
- optional< SignatureInformationCapabilities > signatureInformation;
-
- MAKE_SWAP_METHOD(SignatureHelpCapabilities, dynamicRegistration, signatureInformation)
-};
-MAKE_REFLECT_STRUCT(SignatureHelpCapabilities, dynamicRegistration, signatureInformation)
-
-struct DocumentSymbolCapabilities :public DynamicRegistrationCapabilities {
- //
- // Specific capabilities for the `SymbolKind`.
- //
- optional<SymbolKindCapabilities> symbolKind;
-
- //
- // The client support hierarchical document symbols.
- //
- optional<bool> hierarchicalDocumentSymbolSupport;
-
- MAKE_SWAP_METHOD(DocumentSymbolCapabilities, dynamicRegistration, symbolKind, hierarchicalDocumentSymbolSupport)
-};
-MAKE_REFLECT_STRUCT(DocumentSymbolCapabilities, dynamicRegistration, symbolKind, hierarchicalDocumentSymbolSupport)
-
-struct DeclarationCapabilities:public DynamicRegistrationCapabilities{
- //
- // The client supports additional metadata in the form of declaration links.
- //
- optional<bool>linkSupport;
-
- MAKE_SWAP_METHOD(DeclarationCapabilities, dynamicRegistration, linkSupport);
-};
-MAKE_REFLECT_STRUCT(DeclarationCapabilities, dynamicRegistration, linkSupport)
-
-
-struct CodeActionKindCapabilities
-{
- //
- // The code action kind values the client supports. When this
- // property exists the client also guarantees that it will
- // handle values outside its set gracefully and falls back
- // to a default value when unknown.
- //
- // See {@link CodeActionKind} for allowed values.
- //
- optional< std::vector< std::string> >valueSet;
-
- MAKE_SWAP_METHOD(CodeActionKindCapabilities, valueSet)
-};
-MAKE_REFLECT_STRUCT(CodeActionKindCapabilities,valueSet)
-
-struct CodeActionLiteralSupportCapabilities
-{
- optional<CodeActionKindCapabilities> codeActionKind;
-
- MAKE_SWAP_METHOD(CodeActionLiteralSupportCapabilities, codeActionKind)
-};
-MAKE_REFLECT_STRUCT(CodeActionLiteralSupportCapabilities, codeActionKind)
-
-struct CodeActionCapabilities:public DynamicRegistrationCapabilities{
- //
- // The client support code action literals as a valid
- // response of the `textDocument/codeAction` request.
- //
- optional<CodeActionLiteralSupportCapabilities> codeActionLiteralSupport;
-
- MAKE_SWAP_METHOD(CodeActionCapabilities, dynamicRegistration, codeActionLiteralSupport)
-};
-MAKE_REFLECT_STRUCT(CodeActionCapabilities,dynamicRegistration,codeActionLiteralSupport)
-
-struct RenameCapabilities :public DynamicRegistrationCapabilities {
- //
- // The client support code action literals as a valid
- // response of the `textDocument/codeAction` request.
- //
- optional<bool> prepareSupport;
-
- MAKE_SWAP_METHOD(RenameCapabilities, dynamicRegistration, prepareSupport)
-};
-MAKE_REFLECT_STRUCT(RenameCapabilities, dynamicRegistration, prepareSupport)
-
-struct DiagnosticsTagSupport {
- /**
- * The tags supported by the client.
- */
- std::vector<DiagnosticTag> valueSet;
- MAKE_SWAP_METHOD(DiagnosticsTagSupport, valueSet)
-};
-MAKE_REFLECT_STRUCT(DiagnosticsTagSupport, valueSet)
-
-struct PublishDiagnosticsClientCapabilities :public DynamicRegistrationCapabilities {
- /**
- * The client support code action literals as a valid
- * response of the `textDocument/codeAction` request.
- */
- optional<bool> relatedInformation;
-
- /**
- * Client supports the tag property to provide meta data about a diagnostic.
- * Clients supporting tags have to handle unknown tags gracefully.
- *
- * This property had been added and implemented as boolean before it was
- * added to the specification as {@link DiagnosticsTagSupport}. In order to
- * keep this implementation compatible with intermediate clients (including
- * vscode-language-client < 6.0.0) we add an either type here.
- *
- * Since 3.15
- */
- optional < std::pair<optional<bool>, optional<DiagnosticsTagSupport> > > tagSupport;
-
- /**
- * Whether the client interprets the version property of the
- * `textDocument/publishDiagnostics` notification's parameter.
- *
- * Since 3.15.0
- */
- optional<bool> versionSupport;
-
- /**
- * Client supports a codeDescription property
- *
- * @since 3.16.0
- */
- optional<bool> codeDescriptionSupport ;
-
- /**
- * Whether code action supports the `data` property which is
- * preserved between a `textDocument/publishDiagnostics` and
- * `textDocument/codeAction` request.
- *
- * @since 3.16.0
- */
- optional<bool> dataSupport ;
-
-
- MAKE_SWAP_METHOD(PublishDiagnosticsClientCapabilities, dynamicRegistration, relatedInformation, tagSupport,versionSupport,codeDescriptionSupport,dataSupport)
-};
-MAKE_REFLECT_STRUCT(PublishDiagnosticsClientCapabilities, dynamicRegistration, relatedInformation, tagSupport, versionSupport, codeDescriptionSupport, dataSupport)
-
-
-struct FoldingRangeCapabilities :public DynamicRegistrationCapabilities {
- //
- // The maximum number of folding ranges that the client prefers to receive per document. The value serves as a
- // hint, servers are free to follow the limit.
- //
- optional<int> rangeLimit;
-
- //
- // If set, the client signals that it only supports folding complete lines. If set, client will
- // ignore specified `startCharacter` and `endCharacter` properties in a FoldingRange.
- //
- optional<bool> lineFoldingOnly;
- MAKE_SWAP_METHOD(FoldingRangeCapabilities, dynamicRegistration, rangeLimit, lineFoldingOnly)
-};
-MAKE_REFLECT_STRUCT(FoldingRangeCapabilities, dynamicRegistration, rangeLimit,lineFoldingOnly)
-
-
-struct SemanticHighlightingCapabilities :public DynamicRegistrationCapabilities {
- //
- // The client support code action literals as a valid
- // response of the `textDocument/codeAction` request.
- //
- optional<bool> semanticHighlighting;
-
- MAKE_SWAP_METHOD(SemanticHighlightingCapabilities, dynamicRegistration, semanticHighlighting)
-};
-MAKE_REFLECT_STRUCT(SemanticHighlightingCapabilities, dynamicRegistration, semanticHighlighting)
-
-struct SemanticTokensClientCapabilitiesRequestsFull {
-
- //
- // The client will send the `textDocument/semanticTokens/full/delta` request if
- // the server provides a corresponding handler.
- //
- bool delta = false;
- MAKE_SWAP_METHOD(SemanticTokensClientCapabilitiesRequestsFull, delta)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensClientCapabilitiesRequestsFull, delta)
-
-struct SemanticTokensClientCapabilities : public DynamicRegistrationCapabilities
-{
- //export TokenFormat = 'relative';
- struct lsRequests
- {
- //
- // The client will send the `textDocument/semanticTokens/range` request
- // if the server provides a corresponding handler.
- //
- optional<std::pair< optional<bool>,
- optional<SemanticTokensClientCapabilitiesRequestsFull>>> range;
- //
- // The client will send the `textDocument/semanticTokens/full` request
- // if the server provides a corresponding handler.
- //
- optional<std::pair< optional<bool>, optional<lsp::Any>>> full;
- MAKE_SWAP_METHOD(lsRequests, range, full)
- };
-
- lsRequests requests;
- //
- // The token types that the client supports.
- //
- std::vector<std::string> tokenTypes;
-
- //
- // The token modifiers that the client supports.
- //
- std::vector<std::string> tokenModifiers;
- //
- // The formats the clients supports.
- //
- std::vector<std::string> formats;
- //
- // Whether the client supports tokens that can overlap each other.
- //
- optional < bool >overlappingTokenSupport;
-
- //
- // Whether the client supports tokens that can span multiple lines.
- //
- optional < bool > multilineTokenSupport;
-
- MAKE_SWAP_METHOD(SemanticTokensClientCapabilities, dynamicRegistration,requests, tokenTypes, tokenModifiers,
- formats, overlappingTokenSupport, multilineTokenSupport)
-
-};
-MAKE_REFLECT_STRUCT(SemanticTokensClientCapabilities::lsRequests, range,full)
-MAKE_REFLECT_STRUCT(SemanticTokensClientCapabilities, dynamicRegistration, requests, tokenTypes, tokenModifiers,
- formats, overlappingTokenSupport, multilineTokenSupport)
-
-// Text document specific client capabilities.
-struct lsTextDocumentClientCapabilities {
-
- SynchronizationCapabilities synchronization;
-
-
- // Capabilities specific to the `textDocument/completion`
- optional<CompletionCapabilities> completion;
-
-
-
- // Capabilities specific to the `textDocument/hover`
- optional<HoverCapabilities> hover;
-
- // Capabilities specific to the `textDocument/signatureHelp`
- optional<SignatureHelpCapabilities> signatureHelp;
-
- // Capabilities specific to the `textDocument/references`
- optional<DynamicRegistrationCapabilities> references;
-
-
-
-
-
- // Capabilities specific to the `textDocument/documentHighlight`
- optional<DynamicRegistrationCapabilities> documentHighlight;
-
- // Capabilities specific to the `textDocument/documentSymbol`
- optional<DocumentSymbolCapabilities> documentSymbol;
-
- // Capabilities specific to the `textDocument/formatting`
- optional<DynamicRegistrationCapabilities> formatting;
-
- // Capabilities specific to the `textDocument/rangeFormatting`
- optional<DynamicRegistrationCapabilities> rangeFormatting;
-
- // Capabilities specific to the `textDocument/onTypeFormatting`
- optional<DynamicRegistrationCapabilities> onTypeFormatting;
-
-
- //
- // Capabilities specific to the `textDocument/declaration`
- //
- // Since 3.14.0
- //
- optional< DeclarationCapabilities> declaration;
-
-
- typedef DeclarationCapabilities DefinitionCapabilities;
- // Capabilities specific to the `textDocument/definition`
- optional<DefinitionCapabilities> definition;
-
-
-
- //
-// Capabilities specific to the `textDocument/typeDefinition`
-//
-// Since 3.6.0
-//
- typedef DeclarationCapabilities TypeDefinitionCapabilities;
- optional<TypeDefinitionCapabilities> typeDefinition;
-
-
- typedef DeclarationCapabilities ImplementationCapabilities;
- // Capabilities specific to the `textDocument/implementation`
- optional<ImplementationCapabilities> implementation;
-
-
- // Capabilities specific to the `textDocument/codeAction`
- optional<CodeActionCapabilities> codeAction;
-
-
- // Capabilities specific to the `textDocument/codeLens`
- optional<DynamicRegistrationCapabilities> codeLens;
-
- // Capabilities specific to the `textDocument/documentLink`
- optional<DynamicRegistrationCapabilities> documentLink;
-
- //
- // Capabilities specific to the `textDocument/documentColor` and the
- // `textDocument/colorPresentation` request.
- //
- // Since 3.6.0
- //
- optional<DynamicRegistrationCapabilities> colorProvider;
-
- // Capabilities specific to the `textDocument/rename`
- optional<RenameCapabilities> rename;
-
-//
-// Capabilities specific to `textDocument/publishDiagnostics`.
-//
- optional<PublishDiagnosticsClientCapabilities> publishDiagnostics;
-
- //
-// Capabilities specific to `textDocument/foldingRange` requests.
-//
-// Since 3.10.0
-//
- optional< FoldingRangeCapabilities > foldingRange;
-
-
- //
- // Capabilities specific to {@code textDocument/semanticHighlighting}.
- //
- optional< SemanticHighlightingCapabilities > semanticHighlightingCapabilities;
-
- //
- // Capabilities specific to {@code textDocument/typeHierarchy}.
- //
- optional< DynamicRegistrationCapabilities > typeHierarchyCapabilities;
-
-
-
- //
-// Capabilities specific to `textDocument/selectionRange` requests
-//
-
- optional< DynamicRegistrationCapabilities > selectionRange;
-
- //
- // Capabilities specific to the `textDocument/linkedEditingRange` request.
- //
- // @since 3.16.0
- //
- optional< DynamicRegistrationCapabilities > linkedEditingRange;
-
- //
- // Capabilities specific to the various call hierarchy requests.
- //
- // @since 3.16.0
- //
- optional< DynamicRegistrationCapabilities > callHierarchy;
-
- //
- // Capabilities specific to the various semantic token requests.
- //
- // @since 3.16.0
- //
- optional< SemanticTokensClientCapabilities > semanticTokens;
-
- //
- // Capabilities specific to the `textDocument/moniker` request.
- //
- // @since 3.16.0
- //
- optional< DynamicRegistrationCapabilities > moniker;
-
- MAKE_SWAP_METHOD(lsTextDocumentClientCapabilities,
- synchronization,
- completion,
- hover,
- signatureHelp,
- implementation,
- references,
- documentHighlight,
- documentSymbol,
- formatting,
- rangeFormatting,
- onTypeFormatting,
- declaration,
- definition, typeDefinition, implementation,
- codeAction,
- codeLens,
- documentLink, colorProvider,
- rename, publishDiagnostics, foldingRange,
- semanticHighlightingCapabilities, typeHierarchyCapabilities,
- callHierarchy, selectionRange , linkedEditingRange, semanticTokens, moniker)
-};
-
-
-MAKE_REFLECT_STRUCT(lsTextDocumentClientCapabilities,
- synchronization,
- completion,
- hover,
- signatureHelp,
- implementation,
- references,
- documentHighlight,
- documentSymbol,
- formatting,
- rangeFormatting,
- onTypeFormatting,
- declaration,
- definition, typeDefinition, implementation,
- codeAction,
- codeLens,
- documentLink, colorProvider,
- rename, publishDiagnostics, foldingRange,
- semanticHighlightingCapabilities, typeHierarchyCapabilities,
- callHierarchy, selectionRange, linkedEditingRange, semanticTokens, moniker)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsWorkspaceClientCapabilites.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsWorkspaceClientCapabilites.h
deleted file mode 100644
index 4b48aec414..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/lsWorkspaceClientCapabilites.h
+++ /dev/null
@@ -1,256 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/method_type.h"
-
-
-#include <stdexcept>
-
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/lsp/extention/jdtls/searchSymbols.h"
-
-/**
- * Capabilities specific to `WorkspaceEdit`s
- */
-
-//New in version 3.13: ResourceOperationKind and FailureHandlingKind and the client capability workspace.workspaceEdit.
-//resourceOperations as well as workspace.workspaceEdit.failureHandling.
-
-//The capabilities of a workspace edit has evolved over the time.
-//Clients can describe their support using the following client capability :
-
-struct lschangeAnnotationSupport
-{
- /**
- * Whether the client groups edits with equal labels into tree nodes,
- * for instance all edits labelled with "Changes in Strings" would
- * be a tree node.
- */
- optional<bool> groupsOnLabel;
- MAKE_SWAP_METHOD(lschangeAnnotationSupport, groupsOnLabel)
-};
-MAKE_REFLECT_STRUCT(lschangeAnnotationSupport, groupsOnLabel)
-
-struct WorkspaceEditCapabilities {
- /**
- * The client supports versioned document changes in `WorkspaceEdit`s
- */
- optional<bool> documentChanges;
-
- /**
- * The client supports resource changes
- * in `WorkspaceEdit`s.
- *
- * @deprecated Since LSP introduces resource operations, use {link #resourceOperations}
- */
-
- optional<bool> resourceChanges;
-
- /**
- * The resource operations the client supports. Clients should at least
- * support 'create', 'rename' and 'delete' files and folders.
- *
- * @since 3.13.0
- */
- optional< std::vector<std::string> > resourceOperations;
-
- /**
- * The failure handling strategy of a client if applying the workspace edit
- * fails.
- *
- * See {@link FailureHandlingKind} for allowed values.
- */
- optional<std::string > failureHandling;
-
- /**
- * Whether the client normalizes line endings to the client specific
- * setting.
- * If set to `true` the client will normalize line ending characters
- * in a workspace edit to the client specific new line character(s).
- *
- * @since 3.16.0
- */
- optional<bool> normalizesLineEndings;;
-
- /**
- * Whether the client in general supports change annotations on text edits,
- * create file, rename file and delete file changes.
- *
- * @since 3.16.0
- */
- optional<lschangeAnnotationSupport> changeAnnotationSupport;
-
- MAKE_SWAP_METHOD(WorkspaceEditCapabilities, documentChanges, resourceChanges, resourceOperations, failureHandling, normalizesLineEndings, changeAnnotationSupport)
-
-};
-MAKE_REFLECT_STRUCT(WorkspaceEditCapabilities,documentChanges, resourceChanges, resourceOperations, failureHandling, normalizesLineEndings, changeAnnotationSupport)
-
-
-struct DynamicRegistrationCapabilities {
- // Did foo notification supports dynamic registration.
- optional<bool> dynamicRegistration;
-
- MAKE_SWAP_METHOD(DynamicRegistrationCapabilities,
- dynamicRegistration);
-};
-
-MAKE_REFLECT_STRUCT(DynamicRegistrationCapabilities,
- dynamicRegistration);
-
-
-
-// Workspace specific client capabilities.
-struct SymbolKindCapabilities
-{
- optional< std::vector<lsSymbolKind> > valueSet;
-
- MAKE_SWAP_METHOD(SymbolKindCapabilities, valueSet)
-
-
-};
-MAKE_REFLECT_STRUCT(SymbolKindCapabilities, valueSet)
-
-
-
-
-struct SymbolCapabilities :public DynamicRegistrationCapabilities {
- /**
- * Specific capabilities for the `SymbolKind` in the `workspace/symbol` request.
- */
- optional<SymbolKindCapabilities> symbolKind;
-
- MAKE_SWAP_METHOD(SymbolCapabilities,
- symbolKind, dynamicRegistration)
-};
-MAKE_REFLECT_STRUCT(SymbolCapabilities,
- symbolKind, dynamicRegistration)
-
-
-struct lsFileOperations
-{
- /**
- * Whether the client supports dynamic registration for file
- * requests/notifications.
- */
- optional<bool> dynamicRegistration ;
-
- /**
- * The client has support for sending didCreateFiles notifications.
- */
- optional<bool>didCreate ;
-
- /**
- * The client has support for sending willCreateFiles requests.
- */
- optional<bool>willCreate ;
-
- /**
- * The client has support for sending didRenameFiles notifications.
- */
- optional<bool>didRename ;
-
- /**
- * The client has support for sending willRenameFiles requests.
- */
- optional<bool>willRename ;
-
- /**
- * The client has support for sending didDeleteFiles notifications.
- */
- optional<bool>didDelete ;
-
- /**
- * The client has support for sending willDeleteFiles requests.
- */
- optional<bool> willDelete ;
- MAKE_SWAP_METHOD(lsFileOperations, dynamicRegistration, didCreate, willCreate,
- didRename, willRename, didDelete, willDelete)
-};
-MAKE_REFLECT_STRUCT(lsFileOperations, dynamicRegistration, didCreate, willCreate,
- didRename, willRename, didDelete, willDelete)
-
-struct lsWorkspaceClientCapabilites {
- // The client supports applying batch edits to the workspace.
- optional<bool> applyEdit;
-
-
-
- // Capabilities specific to `WorkspaceEdit`s
- optional<WorkspaceEditCapabilities> workspaceEdit;
-
-
-
- // Capabilities specific to the `workspace/didChangeConfiguration`
- // notification.
- optional<DynamicRegistrationCapabilities> didChangeConfiguration;
-
- // Capabilities specific to the `workspace/didChangeWatchedFiles`
- // notification.
- optional<DynamicRegistrationCapabilities> didChangeWatchedFiles;
-
- // Capabilities specific to the `workspace/symbol` request.
- optional<SymbolCapabilities> symbol;
-
- // Capabilities specific to the `workspace/executeCommand` request.
- optional<DynamicRegistrationCapabilities> executeCommand;
-
-
- /**
- * The client has support for workspace folders.
- *
- * Since 3.6.0
- */
- optional<bool> workspaceFolders;
-
- /**
- * The client supports `workspace/configuration` requests.
- *
- * Since 3.6.0
- */
- optional<bool> configuration;
-
-
- /**
- * Capabilities specific to the semantic token requests scoped to the
- * workspace.
- *
- * @since 3.16.0
- */
- optional<DynamicRegistrationCapabilities> semanticTokens ;
-
- /**
- * Capabilities specific to the code lens requests scoped to the
- * workspace.
- *
- * @since 3.16.0
- */
- optional<DynamicRegistrationCapabilities> codeLens ;
-
- /**
- * The client has support for file requests/notifications.
- *
- * @since 3.16.0
- */
- optional<lsFileOperations> fileOperations;
-
- MAKE_SWAP_METHOD(lsWorkspaceClientCapabilites,
- applyEdit,
- workspaceEdit,
- didChangeConfiguration,
- didChangeWatchedFiles,
- symbol,executeCommand, workspaceFolders,
- configuration, semanticTokens, codeLens, fileOperations)
-};
-
-MAKE_REFLECT_STRUCT(lsWorkspaceClientCapabilites,
- applyEdit,
- workspaceEdit,
- didChangeConfiguration,
- didChangeWatchedFiles,
- symbol,
- executeCommand,workspaceFolders,
- configuration, semanticTokens, codeLens, fileOperations)
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/progress.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/progress.h
deleted file mode 100644
index d21cfc52f8..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/progress.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/lsp/lsAny.h"
-//The base protocol offers also support to report progress in a generic fashion.
-//This mechanism can be used to report any kind of progress including work done
-//progress(usually used to report progress in the user interface using a progress bar)
-//and partial result progress to support streaming of results.
-struct ProgressParams
-{
- std::pair<optional<std::string> , optional<int> > token;
- lsp::Any value;
- MAKE_SWAP_METHOD(ProgressParams, token, value)
-};
-MAKE_REFLECT_STRUCT(ProgressParams, token, value)
-DEFINE_NOTIFICATION_TYPE(Notify_Progress, ProgressParams, "$/progress");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/shutdown.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/shutdown.h
deleted file mode 100644
index 2571334503..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/general/shutdown.h
+++ /dev/null
@@ -1,15 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-
-/**
- * The shutdown request is sent from the client to the server. It asks the
- * server to shutdown, but to not exit (otherwise the response might not be
- * delivered correctly to the client). There is a separate exit notification
- * that asks the server to exit.
- */
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_shutdown, optional<JsonNull>, optional<lsp::Any>, "shutdown");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/language/language.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/language/language.h
deleted file mode 100644
index 96b4b61fa9..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/language/language.h
+++ /dev/null
@@ -1,170 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsCommand.h"
-
-#ifdef _WIN32
-#include <ppltasks.h>
-#endif
-
-struct StatusReport {
-
- std::string ToString() const
- {
- std::string info;
- info += "type:" + type + "\n";
- info += "message:" + message + "\n";
- return info;
- }
- /**
- * The message type. See {
- *
- */
-
- std::string type;
- /**
- * The actual message
- *
- */
-
- std::string message;
- MAKE_SWAP_METHOD(StatusReport, type, message);
-};
-MAKE_REFLECT_STRUCT(StatusReport, type, message);
-
-/**
- * The show message notification is sent from a server to a client to ask
- * the client to display a particular message in the user interface.
- */
-DEFINE_NOTIFICATION_TYPE(lang_status, StatusReport, "language/status");
-
-
-enum class MessageType {
-
- /**
- * An error message.
- */
- Error=(1),
-
- /**
- * A warning message.
- */
- Warning=(2),
-
- /**
- * An information message.
- */
- Info=(3),
-
- /**
- * A log message.
- */
- Log=(4)
-};
-MAKE_REFLECT_TYPE_PROXY(MessageType);
-
-
-struct ActionableNotification {
-
-
-
- /**
- * The message type. See {
- *
- */
-
- MessageType severity;
- /**
- * The actual message
- *
- */
-
- std::string message;
-
- /**
- * Optional data
- *
- */
-
- optional<lsp::Any> data;
-
-
- /**
- * Optional commands
- *
- */
-
- std::vector<lsCommandWithAny> commands;
-
- MAKE_SWAP_METHOD(ActionableNotification, severity, message, data, commands)
-};
-MAKE_REFLECT_STRUCT(ActionableNotification, severity, message, data, commands)
-
-
-/**
- * The actionable notification is sent from a server to a client to ask the
- * client to display a particular message in the user interface, and possible
- * commands to execute. The commands must be implemented on the client side.
- */
-DEFINE_NOTIFICATION_TYPE(lang_actionableNotification, ActionableNotification, "language/actionableNotification");
-
-
-
-struct ProgressReport {
- std::string ToString() const;
-
- std::string id;
-
-
- std::string task;
-
-
- std::string subTask;
-
-
- std::string status;
-
- int totalWork = 0;
-
-
- int workDone = 0;
-
-
- bool complete = false;
- MAKE_SWAP_METHOD(ProgressReport, id, task, subTask, status, workDone, complete);
-};
-
-
-MAKE_REFLECT_STRUCT(ProgressReport, id, task, subTask, status, workDone, complete);
-
-/**
- * The progress report notification is sent from a server to be handled by the
- * client.
- */
-DEFINE_NOTIFICATION_TYPE(lang_progressReport, ProgressReport, "language/progressReport");
-
-enum EventType {
- /**
- * classpath updated event.
- */
- ClasspathUpdated = (100),
-
- /**
- * projects imported event.
- */
- ProjectsImported = (200)
-};
-
-struct EventNotification
-{
- int eventType;
- lsp::Any data;
- std::string ToString() const;
- MAKE_SWAP_METHOD(EventNotification, eventType, data)
-};
-MAKE_REFLECT_STRUCT(EventNotification, eventType, data);
-
-DEFINE_NOTIFICATION_TYPE(lang_eventNotification, EventNotification, "language/eventNotification");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h
deleted file mode 100644
index f1d8070bf5..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/location_type.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#pragma once
-
-#include "lsDocumentUri.h"
-#include "lsRange.h"
-//Represents a location inside a resource, such as a line inside a text file.
-struct lsLocation {
- lsLocation();
- lsLocation(lsDocumentUri uri, lsRange range);
-
- bool operator==(const lsLocation& other) const;
- bool operator<(const lsLocation& o) const;
-
- lsDocumentUri uri;
- lsRange range;
- MAKE_SWAP_METHOD(lsLocation, uri, range)
-};
-MAKE_REFLECT_STRUCT(lsLocation, uri, range)
-
-
-
-struct LinkLocation :public lsLocation
-{
- std::string displayName;
- std::string kind;
- MAKE_REFLECT_STRUCT(LinkLocation, uri, range, displayName, kind)
-};
-MAKE_REFLECT_STRUCT(LinkLocation, uri, range, displayName,kind)
-
-//Represents a link between a sourceand a target location.
-struct LocationLink
-{
- /**
- * Span of the origin of this link.
- *
- * Used as the underlined span for mouse interaction. Defaults to the word range at
- * the mouse position.
- */
- optional<lsRange> originSelectionRange;
-
- /**
- * The target resource identifier of this link.
- */
-
- lsDocumentUri targetUri;
-
- /**
- * The full target range of this link. If the target for example is a symbol then target range is the
- * range enclosing this symbol not including leading/trailing whitespace but everything else
- * like comments. This information is typically used to highlight the range in the editor.
- */
-
- lsRange targetRange;
-
- /**
- * The range that should be selected and revealed when this link is being followed, e.g the name of a function.
- * Must be contained by the the `targetRange`. See also `DocumentSymbol#range`
- */
-
- lsRange targetSelectionRange;
-
- MAKE_SWAP_METHOD(LocationLink, originSelectionRange, targetUri, targetRange, targetSelectionRange);
-};
-MAKE_REFLECT_STRUCT(LocationLink, originSelectionRange, targetUri, targetRange, targetSelectionRange);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lru_cache.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lru_cache.h
deleted file mode 100644
index f33bc5627a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lru_cache.h
+++ /dev/null
@@ -1,151 +0,0 @@
-#pragma once
-
-#include <algorithm>
-#include <cassert>
-#include <limits>
-#include <memory>
-#include <vector>
-
-// Cache that evicts old entries which have not been used recently. Implemented
-// using array/linear search so this works well for small array sizes.
-template <typename TKey, typename TValue>
-struct LruCache {
- explicit LruCache(int max_entries);
-
- // Fetches an entry for |key|. If it does not exist, |allocator| will be
- // invoked to create one.
- template <typename TAllocator>
- TValue Get(const TKey& key, TAllocator allocator);
- // Returns true if there is an entry for |key|.
- bool Has(const TKey& key);
- // Fetches the entry for |filename| and updates it's usage so it is less
- // likely to be evicted.
- bool TryGet(const TKey& key, TValue* dest);
- // TryGetEntry, except the entry is removed from the cache.
- bool TryTake(const TKey& key, TValue* dest);
- // Inserts an entry. Evicts the oldest unused entry if there is no space.
- void Insert(const TKey& key, const TValue& value);
-
- // Call |func| on existing entries. If |func| returns false iteration
- // terminates early.
- template <typename TFunc>
- void IterateValues(TFunc func);
-
- // Empties the cache
- void Clear(void);
-
- private:
- // There is a global score counter, when we access an element we increase
- // its score to the current global value, so it has the highest overall
- // score. This means that the oldest/least recently accessed value has the
- // lowest score.
- //
- // There is a bit of special logic to handle score overlow.
- struct Entry {
- uint32_t score = 0;
- TKey key;
- TValue value;
- bool operator<(const Entry& other) const { return score < other.score; }
- };
-
- void IncrementScore();
-
- std::vector<Entry> entries_;
- int max_entries_ = 1;
- uint32_t next_score_ = 0;
-};
-
-template <typename TKey, typename TValue>
-LruCache<TKey, TValue>::LruCache(int max_entries) : max_entries_(max_entries) {
- assert(max_entries > 0);
-}
-
-template <typename TKey, typename TValue>
-template <typename TAllocator>
-TValue LruCache<TKey, TValue>::Get(const TKey& key, TAllocator allocator) {
- for (Entry& entry : entries_) {
- if (entry.key == key)
- return entry.value;
- }
-
- auto result = allocator();
- Insert(key, result);
- return result;
-}
-
-template <typename TKey, typename TValue>
-bool LruCache<TKey, TValue>::Has(const TKey& key) {
- for (Entry& entry : entries_) {
- if (entry.key == key)
- return true;
- }
- return false;
-}
-
-template <typename TKey, typename TValue>
-bool LruCache<TKey, TValue>::TryGet(const TKey& key, TValue* dest) {
- // Assign new score.
- for (Entry& entry : entries_) {
- if (entry.key == key) {
- entry.score = next_score_;
- IncrementScore();
- if (dest)
- *dest = entry.value;
- return true;
- }
- }
-
- return false;
-}
-
-template <typename TKey, typename TValue>
-bool LruCache<TKey, TValue>::TryTake(const TKey& key, TValue* dest) {
- for (size_t i = 0; i < entries_.size(); ++i) {
- if (entries_[i].key == key) {
- if (dest)
- *dest = entries_[i].value;
- entries_.erase(entries_.begin() + i);
- return true;
- }
- }
-
- return false;
-}
-
-template <typename TKey, typename TValue>
-void LruCache<TKey, TValue>::Insert(const TKey& key, const TValue& value) {
- if ((int)entries_.size() >= max_entries_)
- entries_.erase(std::min_element(entries_.begin(), entries_.end()));
-
- Entry entry;
- entry.score = next_score_;
- IncrementScore();
- entry.key = key;
- entry.value = value;
- entries_.push_back(entry);
-}
-
-template <typename TKey, typename TValue>
-template <typename TFunc>
-void LruCache<TKey, TValue>::IterateValues(TFunc func) {
- for (Entry& entry : entries_) {
- if (!func(entry.value))
- break;
- }
-}
-
-template <typename TKey, typename TValue>
-void LruCache<TKey, TValue>::IncrementScore() {
- // Overflow.
- if (++next_score_ == 0) {
- std::sort(entries_.begin(), entries_.end());
- for (Entry& entry : entries_)
- entry.score = next_score_++;
- }
-}
-
-template <typename TKey, typename TValue>
-void LruCache<TKey, TValue>::Clear(void) {
- entries_.clear();
- next_score_ = 0;
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsAny.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsAny.h
deleted file mode 100644
index 49a917e4f6..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsAny.h
+++ /dev/null
@@ -1,159 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <string>
-#include "LibLsp/JsonRpc/message.h"
-namespace lsp
-{
- struct Any
- {
- //! Type of JSON value
- enum Type {
- kUnKnown=-1,
- kNullType = 0, //!< null
- kFalseType = 1, //!< false
- kTrueType = 2, //!< true
- kObjectType = 3, //!< object
- kArrayType = 4, //!< array
- kStringType = 5, //!< string
- kNumberType = 6 //!< number
- };
-
-
-
- template <typename T>
- bool Get(T& value);
-
- template <typename T>
- void Set(T& value);
-
- int GuessType();
- int GetType();
-
- void Set(std::unique_ptr<LspMessage> value);
-
- void SetJsonString(std::string&& _data, Type _type);
-
- void SetJsonString(const std::string& _data, Type _type);
-
- const std::string& Data()const
- {
- return data;
- }
-
- void swap(Any& arg) noexcept;
-
- /*
- *Example for GetFromMap
- struct A{
- std::string visitor;
- bool verbose;
- }
- REFLECT_MAP_TO_STRUCT(A,visitor,verbose)
-
- std::string data = "{\"visitor\":\"default\",\"verbose\":\"true\"};
- lsp:Any any;
- any.SetJsonString(data, static_cast<lsp::Any::Type>(-1));
- A a_object;
- any.GetFromMap(a_object);
- */
- template <typename T>
- bool GetFromMap(T& value);
-
-
- template <typename T>
- bool GetForMapHelper(T& value);
- bool GetForMapHelper(std::string& value);
- bool GetForMapHelper(optional<std::string>& value);
- private:
- std::unique_ptr<Reader> GetReader();
- std::unique_ptr<Writer> GetWriter() const;
- void SetData(std::unique_ptr<Writer>&);
-
- std::string data;
- int jsonType = kUnKnown;
-
- };
-
-};
-
-
-extern void Reflect(Reader& visitor, lsp::Any& value);
-extern void Reflect(Writer& visitor, lsp::Any& value);
-
-template <typename T>
-void ReflectMember(std::map < std::string, lsp::Any>& visitor, const char* name, T& value) {
-
- auto it = visitor.find(name);
- if (it != visitor.end())
- {
- it->second.GetForMapHelper(value);
- }
-}
-template <typename T>
-void ReflectMember(std::map < std::string, std::string>& visitor, const char* name, T& value) {
-
- auto it = visitor.find(name);
- if (it != visitor.end())
- {
- lsp::Any any;
- any.SetJsonString(it->second, static_cast<lsp::Any::Type>(-1));
- any.Get(value);
- }
-}
-
-#define REFLECT_MAP_TO_STRUCT(type, ...) \
- template <typename TVisitor> \
- void ReflectMap(TVisitor& visitor, type& value) { \
- MACRO_MAP(_MAPPABLE_REFLECT_MEMBER, __VA_ARGS__) \
- }
-
-
-namespace lsp
-{
- template <typename T>
- bool Any::Get(T& value)
- {
- const auto visitor = GetReader();
- Reflect(*visitor, value);
- return true;
- }
-
- template <typename T>
- void Any::Set(T& value)
- {
- auto visitor = GetWriter();
- Reflect(*visitor, value);
- SetData(visitor);
- }
-
- template <typename T>
- bool Any::GetFromMap(T& value)
- {
- const auto visitor = GetReader();
- std::map < std::string, lsp::Any> _temp;
- Reflect(*visitor, _temp);
- ReflectMap(_temp, value);
- return true;
- }
-
- template <typename T>
- bool Any::GetForMapHelper(T& value)
- {
- jsonType = GetType();
- if (jsonType == kStringType)
- {
- auto copy = data;
- copy.erase(copy.find_last_not_of('"') + 1);
- copy.erase(0, copy.find_first_not_of('"'));
- lsp::Any any;
- any.SetJsonString(copy, kUnKnown);
- any.Get(value);
- }
- else
- {
- Get(value);
- }
- return true;
- }
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCodeAction.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCodeAction.h
deleted file mode 100644
index 1b398cae2b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCodeAction.h
+++ /dev/null
@@ -1,58 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-
-
-#include <string>
-#include <vector>
-#include "lsPosition.h"
-#include "lsWorkspaceEdit.h"
-#include "lsp_diagnostic.h"
-#include "lsCommand.h"
-
-struct CodeAction
-{
- /**
- * A short, human-readable, title for this code action.
- */
-
- std::string title;
-
- /**
- * The kind of the code action.
- *
- * Used to filter code actions.
- */
- optional < std::string> kind;
-
- /**
- * The diagnostics that this code action resolves.
- */
- optional < std::vector<lsDiagnostic>> diagnostics;
-
- /**
- * The workspace edit this code action performs.
- */
- optional < lsWorkspaceEdit >edit;
-
- /**
- * A command this code action executes. If a code action
- * provides a edit and a command, first the edit is
- * executed and then the command.
- */
- optional< lsCommandWithAny > command;
-
- MAKE_SWAP_METHOD(CodeAction, title, kind, diagnostics, edit, command)
-};
-MAKE_REFLECT_STRUCT(CodeAction, title, kind, diagnostics, edit, command)
-struct TextDocumentCodeAction
-
-{
-
- typedef std::pair<optional<lsCommandWithAny>, optional<CodeAction> > Either;
-
-};
-
-
-extern void Reflect(Reader& visitor, TextDocumentCodeAction::Either& value);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCommand.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCommand.h
deleted file mode 100644
index 2d624c3d99..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsCommand.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-
-
-#include <string>
-#include <vector>
-#include "lsAny.h"
-//
-//Represents a reference to a command.Provides a title which will be used to represent a command in the UI.
-//Commands are identified by a string identifier.
-//The recommended way to handle commands is to implement their execution on the server side
-//if the clientand server provides the corresponding capabilities.Alternatively the tool
-//extension code could handle the command.The protocol currently doesn¡¯t specify a set of well - known commands.
-template <typename AnyArray>
-struct lsCommand {
- // Title of the command (ie, 'save')
- std::string title;
- // Actual command identifier.
- std::string command;
- // Arguments to run the command with.
- // **NOTE** This must be serialized as an array. Use
- // MAKE_REFLECT_STRUCT_WRITER_AS_ARRAY.
- optional<AnyArray> arguments;
-
- void swap(lsCommand<AnyArray>& arg) noexcept
- {
- title.swap(arg.title);
- command.swap(arg.command);
- arguments.swap(arg.arguments);
- }
-};
-template <typename TVisitor, typename T>
-void Reflect(TVisitor& visitor, lsCommand<T>& value) {
- REFLECT_MEMBER_START();
- REFLECT_MEMBER(title);
- REFLECT_MEMBER(command);
- REFLECT_MEMBER(arguments);
- REFLECT_MEMBER_END();
-}
-
-
-using lsCommandWithAny = lsCommand< std::vector<lsp::Any>>;
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsDocumentUri.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsDocumentUri.h
deleted file mode 100644
index 255c4c39ba..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsDocumentUri.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/serializer.h"
-#include <string>
-struct lsDocumentUri {
- static lsDocumentUri FromPath(const AbsolutePath& path);
-
- lsDocumentUri();
-
- lsDocumentUri(const AbsolutePath& path);
- lsDocumentUri(const lsDocumentUri& other);;
- bool operator==(const lsDocumentUri& other) const;
- bool operator==(const std::string& other) const;
- void SetPath(const AbsolutePath& path);
- std::string GetRawPath() const;
- AbsolutePath GetAbsolutePath() const;
-
-
- std::string raw_uri_;
- void swap(lsDocumentUri& arg) noexcept
- {
- raw_uri_.swap(arg.raw_uri_);
- }
-};
-extern void Reflect(Writer& visitor, lsDocumentUri& value);
-extern void Reflect(Reader& visitor, lsDocumentUri& value);
-extern std::string make_file_scheme_uri(const std::string& absolute_path);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsFormattingOptions.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsFormattingOptions.h
deleted file mode 100644
index 0c3999896b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsFormattingOptions.h
+++ /dev/null
@@ -1,43 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-struct lsFormattingOptions {
- struct KeyData {
- optional<bool> _boolean;
- optional<int32_t> _integer;
- optional<std::string> _string;
- };
-
- // Size of a tab in spaces.
- int tabSize =4;
- // Prefer spaces over tabs.
- bool insertSpaces = true;
-
- /**
- * Trim trailing whitespace on a line.
- *
- * @since 3.15.0
- */
- optional<bool> trimTrailingWhitespace;
-
- /**
- * Insert a newline character at the end of the file if one does not exist.
- *
- * @since 3.15.0
- */
- optional<bool> insertFinalNewline;
-
- /**
- * Trim all newlines after the final newline at the end of the file.
- *
- * @since 3.15.0
- */
- optional<bool> trimFinalNewlines;
- optional<KeyData> key;
- MAKE_SWAP_METHOD(lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key)
-};
-MAKE_REFLECT_STRUCT(lsFormattingOptions, tabSize, insertSpaces, trimTrailingWhitespace, insertFinalNewline, trimFinalNewlines, key);
-
-extern void Reflect(Reader& visitor, lsFormattingOptions::KeyData& value);
-extern void Reflect(Writer& visitor, lsFormattingOptions::KeyData& value);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsMarkedString.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsMarkedString.h
deleted file mode 100644
index 8478c055c5..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsMarkedString.h
+++ /dev/null
@@ -1,45 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-#include <string>
-#include <vector>
-
-
-// MarkedString can be used to render human readable text. It is either a
-// markdown string or a code-block that provides a language and a code snippet.
-// The language identifier is sematically equal to the optional language
-// identifier in fenced code blocks in GitHub issues. See
-// https://help.github.com/articles/creating-and-highlighting-code-blocks/#syntax-highlighting
-//
-// The pair of a language and a value is an equivalent to markdown:
-// ```${language}
-// ${value}
-// ```
-//
-// Note that markdown strings will be sanitized - that means html will be
-// escaped.
-struct lsMarkedString {
- optional<std::string> language;
- std::string value;
-};
-
-struct MarkupContent {
- /**
- * The type of the Markup.
- */
-
- std::string kind;
-
- /**
- * The content itself.
- */
-
- std::string value;
-
- MAKE_SWAP_METHOD(MarkupContent, kind, value);
-};
-MAKE_REFLECT_STRUCT(MarkupContent,kind,value);
-
-void Reflect(Writer& visitor, lsMarkedString& value);
-void Reflect(Reader& visitor, lsMarkedString& value);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsPosition.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsPosition.h
deleted file mode 100644
index a14d75ed90..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsPosition.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-
-
-#include <string>
-#include <vector>
-
-//Position in a text document expressed as zero - based line and zero - based character offset.
-//A position is between two characters like an ¡®insert¡¯ cursor in a editor.Special values like
-//for example - 1 to denote the end of a line are not supported.
-struct lsPosition {
- lsPosition();
- lsPosition(int line, int character);
-
- bool operator==(const lsPosition& other) const;
- bool operator<(const lsPosition& other) const;
-
- std::string ToString() const;
-
- /**
- * Line position in a document (zero-based).
- */
- // Note: these are 0-based.
- unsigned line = 0;
- /**
- * Character offset on a line in a document (zero-based). Assuming that
- * the line is represented as a string, the `character` value represents
- * the gap between the `character` and `character + 1`.
- *
- * If the character value is greater than the line length it defaults back
- * to the line length.
- */
- unsigned character = 0;
- static const lsPosition kZeroPosition;
-
- MAKE_SWAP_METHOD(lsPosition, line, character)
-};
-MAKE_REFLECT_STRUCT(lsPosition, line, character);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsRange.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsRange.h
deleted file mode 100644
index 97d78712d7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsRange.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-
-
-#include <string>
-#include <vector>
-#include "lsPosition.h"
-//A range in a text document expressed as(zero - based) startand end positions.
-//A range is comparable to a selection in an editor.Therefore the end position is exclusive.
-//If you want to specify a range that contains a line including the line ending character(s)
-//then use an end position denoting the start of the next line.
-struct lsRange {
- lsRange();
- lsRange(lsPosition start, lsPosition end);
-
- bool operator==(const lsRange& other) const;
- bool operator<(const lsRange& other) const;
- /**
- * The range's start position.
- */
- lsPosition start;
- /**
- * The range's end position.
- */
- lsPosition end;
- std::string ToString()const;
- MAKE_SWAP_METHOD(lsRange, start, end)
-};
-
-MAKE_REFLECT_STRUCT(lsRange, start, end)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsResponseError.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsResponseError.h
deleted file mode 100644
index 254e76f757..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsResponseError.h
+++ /dev/null
@@ -1,117 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <sstream>
-#include "LibLsp/lsp/lsAny.h"
-
-enum class lsErrorCodes:int32_t {
- // Defined by JSON RPC
- ParseError = -32700,
- InvalidRequest = -32600,
- MethodNotFound = -32601,
- InvalidParams = -32602,
- InternalError = -32603,
-
- /**
- * This is the start range of JSON RPC reserved error codes.
- * It doesn't denote a real error code. No LSP error codes should
- * be defined between the start and end range. For backwards
- * compatibility the `ServerNotInitialized` and the `UnknownErrorCode`
- * are left in the range.
- *
- * @since 3.16.0
- */
- jsonrpcReservedErrorRangeStart = -32099,
- /** @deprecated use jsonrpcReservedErrorRangeStart */
- serverErrorStart = jsonrpcReservedErrorRangeStart,
-
- /**
- * This is the start range of JSON RPC reserved error codes.
- * It doesn't denote a real error code.
- *
- * @since 3.16.0
- */
- jsonrpcReservedErrorRangeEnd = -32000,
- /** @deprecated use jsonrpcReservedErrorRangeEnd */
- serverErrorEnd = jsonrpcReservedErrorRangeEnd,
-
- /**
- * Error code indicating that a server received a notification or
- * request before the server has received the `initialize` request.
- */
- ServerNotInitialized = -32002,
- UnknownErrorCode = -32001,
-
- /**
- * This is the start range of LSP reserved error codes.
- * It doesn't denote a real error code.
- *
- * @since 3.16.0
- */
- lspReservedErrorRangeStart= -32899,
-
- /**
- * The server cancelled the request. This error code should
- * only be used for requests that explicitly support being
- * server cancellable.
- *
- * @since 3.17.0
- */
- ServerCancelled = -32802,
-
- /**
- * The server detected that the content of a document got
- * modified outside normal conditions. A server should
- * NOT send this error code if it detects a content change
- * in it unprocessed messages. The result even computed
- * on an older state might still be useful for the client.
- *
- * If a client decides that a result is not of any use anymore
- * the client should cancel the request.
- */
- ContentModified = -32801,
-
- /**
- * The client has canceled a request and a server as detected
- * the cancel.
- */
- RequestCancelled = -32800,
-
- /**
- * This is the end range of LSP reserved error codes.
- * It doesn't denote a real error code.
- *
- * @since 3.16.0
- */
- lspReservedErrorRangeEnd = -32800,
-
-
-
-};
-MAKE_REFLECT_TYPE_PROXY(lsErrorCodes);
-struct lsResponseError {
- lsResponseError(): code(lsErrorCodes::UnknownErrorCode)
- {
- }
-
- /**
- * A number indicating the error type that occurred.
- */
- lsErrorCodes code;
- // Short description.
- /**
- * A string providing a short description of the error.
- */
- std::string message;
-
- /**
- * A primitive or structured value that contains additional
- * information about the error. Can be omitted.
- */
- optional<lsp::Any> data;
- std::string ToString();
- void Write(Writer& visitor);
-
- MAKE_SWAP_METHOD(lsResponseError, code, message, data)
-};
-MAKE_REFLECT_STRUCT(lsResponseError, code, message, data)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentEdit.h
deleted file mode 100644
index bebbcd48c2..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentEdit.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <vector>
-#include "LibLsp/JsonRpc/message.h"
-#include "lsVersionedTextDocumentIdentifier.h"
-#include "lsTextEdit.h"
-
-
-struct lsTextDocumentEdit {
- // The text document to change.
- lsVersionedTextDocumentIdentifier textDocument;
-
- /**
- * The edits to be applied.
- *
- * @since 3.16.0 - support for AnnotatedTextEdit. This is guarded by the
- * client capability `workspace.workspaceEdit.changeAnnotationSupport`
- */
- // The edits to be applied.
- std::vector< lsAnnotatedTextEdit > edits;
- MAKE_SWAP_METHOD(lsTextDocumentEdit, textDocument, edits);
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentEdit, textDocument, edits);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentIdentifier.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentIdentifier.h
deleted file mode 100644
index 0129df9b99..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentIdentifier.h
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include "lsDocumentUri.h"
-//Text documents are identified using a URI.On the protocol level,
-//URIs are passed as strings.The corresponding JSON structure looks like this:
-struct lsTextDocumentIdentifier {
- /**
- * The text document's URI.
- */
- lsDocumentUri uri;
- MAKE_SWAP_METHOD(lsTextDocumentIdentifier, uri)
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentIdentifier, uri)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentItem.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentItem.h
deleted file mode 100644
index c5bc915132..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentItem.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <string>
-#include <vector>
-#include "lsDocumentUri.h"
-
-//An item to transfer a text document from the client to the server.
-struct lsTextDocumentItem {
- // The text document's URI.
- lsDocumentUri uri;
-
- // The text document's language identifier.
- std::string languageId;
-
- // The version number of this document (it will strictly increase after each
- // change, including undo/redo).
- int version = 0;
-
- // The content of the opened text document.
- std::string text;
-
- MAKE_SWAP_METHOD(lsTextDocumentItem, uri, languageId, version, text)
-};
-
-MAKE_REFLECT_STRUCT(lsTextDocumentItem, uri, languageId, version, text)
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentPositionParams.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentPositionParams.h
deleted file mode 100644
index a46fa22a9e..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextDocumentPositionParams.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/message.h"
-
-#include "lsTextDocumentIdentifier.h"
-#include "lsPosition.h"
-
-/**
- * A parameter literal used in requests to pass a text document and a position inside that document.
- */
-struct lsTextDocumentPositionParams {
- // The text document.
- lsTextDocumentIdentifier textDocument;
-
- // The position inside the text document.
- lsPosition position;
-
- /**
- * Legacy property to support protocol version 1.0 requests.
- */
- optional<lsDocumentUri> uri;
-
- MAKE_SWAP_METHOD(lsTextDocumentPositionParams, textDocument, position, uri);
-
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentPositionParams, textDocument, position, uri);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h
deleted file mode 100644
index 29699c9c31..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsTextEdit.h
+++ /dev/null
@@ -1,87 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-
-
-#include <string>
-#include "lsRange.h"
-
-
-//Since 3.16.0 there is also the concept of an annotated text edit which supports to add an annotation to a text edit.
-//The annotation can add information describing the change to the text edit.
-/**
- * Additional information that describes document changes.
- *
- * @since 3.16.0
- */
-struct lsChangeAnnotation
-{
- /**
- * A human-readable string describing the actual change. The string
- * is rendered prominent in the user interface.
- */
- std::string label;
-
- /**
- * A flag which indicates that user confirmation is needed
- * before applying the change.
- */
- optional<bool> needsConfirmation;
-
- /**
- * A human-readable string which is rendered less prominent in
- * the user interface.
- */
- optional < std::string > description;
- MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description)
-};
-MAKE_REFLECT_STRUCT(lsChangeAnnotation, label, needsConfirmation, description)
-
-
-//Usually clients provide options to group the changes along the annotations they are associated with.
-//To support this in the protocol an edit or resource operation refers to a change annotation
-//using an identifier and not the change annotation literal directly.This allows servers to use
-//the identical annotation across multiple edits or resource operations which then allows clients
-//to group the operations under that change annotation.The actual change annotations together with
-//their identifers are managed by the workspace edit via the new property changeAnnotations.
-
-
-
-/**
- * An identifier referring to a change annotation managed by a workspace
- * edit.
- *
- * @since 3.16.0.
- */
-using lsChangeAnnotationIdentifier = std::string;
-/**
- * A special text edit with an additional change annotation.
- *
- * @since 3.16.0.
- */
-
-
-//A textual edit applicable to a text document.
-struct lsTextEdit {
- // The range of the text document to be manipulated. To insert
- // text into a document create a range where start === end.
- lsRange range;
-
- // The string to be inserted. For delete operations use an
- // empty string.
- std::string newText;
-
- /**
- * The actual annotation identifier.
- */
- optional<lsChangeAnnotationIdentifier> annotationId;
-
-
- bool operator==(const lsTextEdit& that);
- std::string ToString() const;
- MAKE_SWAP_METHOD(lsTextEdit, range, newText, annotationId)
-};
-MAKE_REFLECT_STRUCT(lsTextEdit, range, newText, annotationId)
-
-using lsAnnotatedTextEdit = lsTextEdit;
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsVersionedTextDocumentIdentifier.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsVersionedTextDocumentIdentifier.h
deleted file mode 100644
index 2b17a4fb0b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsVersionedTextDocumentIdentifier.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-struct lsVersionedTextDocumentIdentifier
-{
- lsDocumentUri uri;
- // The version number of this document. number | null
- optional<int> version;
-
- lsTextDocumentIdentifier AsTextDocumentIdentifier() const;
-
- MAKE_SWAP_METHOD(lsVersionedTextDocumentIdentifier, uri, version)
-};
-MAKE_REFLECT_STRUCT(lsVersionedTextDocumentIdentifier, uri, version)
-
-/**
- * The version number of this document. If an optional versioned text document
- * identifier is sent from the server to the client and the file is not
- * open in the editor (the server has not received an open notification
- * before) the server can send `null` to indicate that the version is
- * known and the content on disk is the master (as specified with document
- * content ownership).
- *
- * The version number of a document will increase after each change,
- * including undo/redo. The number doesn't need to be consecutive.
- */
-using lsOptionalVersionedTextDocumentIdentifier = lsVersionedTextDocumentIdentifier;
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsWorkspaceEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsWorkspaceEdit.h
deleted file mode 100644
index 4caf296c28..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsWorkspaceEdit.h
+++ /dev/null
@@ -1,57 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/serializer.h"
-#include <vector>
-#include "lsTextDocumentEdit.h"
-#include "LibLsp/lsp/ResourceOperation.h"
-#include "lsAny.h"
-
-//A workspace edit represents changes to many resources managed in the workspace.
-//The edit should either provide changes or documentChanges.
-//If the client can handle versioned document edits and if documentChanges are present, the latter are preferred over changes.
-
-//Since version 3.13.0 a workspace edit can contain resource operations(create, delete or rename files and folders) as well.
-//If resource operations are present clients need to execute the operations in the order in which they are provided.
-//So a workspace edit for example can consist of the following two changes : (1) create file a.txt and (2) a text document edit which insert text into file a.
-//txt.An invalid sequence(e.g. (1) delete file a.txt and (2) insert text into file a.txt) will cause failure of the operation.
-//How the client recovers from the failure is described by the client capability : workspace.workspaceEdit.failureHandling
-
-
-
-struct lsChangeAnnotations
-{
- lsChangeAnnotation id;
- MAKE_SWAP_METHOD(lsChangeAnnotations, id)
-};
-MAKE_REFLECT_STRUCT(lsChangeAnnotations, id)
-struct lsWorkspaceEdit {
- // Holds changes to existing resources.
- // changes ? : { [uri:string]: TextEdit[]; };
- // std::unordered_map<lsDocumentUri, std::vector<lsTextEdit>> changes;
-
- // An array of `TextDocumentEdit`s to express changes to specific a specific
- // version of a text document. Whether a client supports versioned document
- // edits is expressed via `WorkspaceClientCapabilites.versionedWorkspaceEdit`.
- //
- optional< std::map<std::string, std::vector<lsTextEdit> > > changes;
- typedef std::pair < optional<lsTextDocumentEdit>, optional<lsp::Any> > Either;
-
- optional < std::vector< Either > > documentChanges;
- /**
- * A map of change annotations that can be referenced in
- * `AnnotatedTextEdit`s or create, rename and delete file / folder
- * operations.
- *
- * Whether clients honor this property depends on the client capability
- * `workspace.changeAnnotationSupport`.
- *
- * @since 3.16.0
- */
- optional< lsChangeAnnotations > changeAnnotations;
-
- MAKE_SWAP_METHOD(lsWorkspaceEdit, changes, documentChanges, changeAnnotations)
-};
-MAKE_REFLECT_STRUCT(lsWorkspaceEdit, changes, documentChanges, changeAnnotations)
-
-extern void Reflect(Reader& visitor, lsWorkspaceEdit::Either& value);
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_code_action.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_code_action.h
deleted file mode 100644
index 2d5c7111fb..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_code_action.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#pragma once
-
-
-#include "location_type.h"
-#include "lsDocumentUri.h"
-#include "lsTextEdit.h"
-#include "lsPosition.h"
-
-// codeAction
-struct CommandArgs {
- lsDocumentUri textDocumentUri;
- std::vector<lsTextEdit> edits;
-};
-MAKE_REFLECT_STRUCT_WRITER_AS_ARRAY(CommandArgs, textDocumentUri, edits);
-inline void Reflect(Reader& visitor, CommandArgs& value) {
- int i = 0;
- visitor.IterArray([&](Reader& visitor) {
- switch (i++) {
- case 0:
- Reflect(visitor, value.textDocumentUri);
- break;
- case 1:
- Reflect(visitor, value.edits);
- break;
-
- }
- });
-}
-
-// codeLens
-struct lsCodeLensUserData {};
-MAKE_REFLECT_EMPTY_STRUCT(lsCodeLensUserData);
-
-struct lsCodeLensCommandArguments {
- lsDocumentUri uri;
- lsPosition position;
- std::vector<lsLocation> locations;
-};
-
-// FIXME Don't use array in vscode-cquery
-inline void Reflect(Writer& visitor, lsCodeLensCommandArguments& value) {
- visitor.StartArray(3);
- Reflect(visitor, value.uri);
- Reflect(visitor, value.position);
- Reflect(visitor, value.locations);
- visitor.EndArray();
-}
-
-inline void Reflect(Reader& visitor, lsCodeLensCommandArguments& value) {
- int i = 0;
- visitor.IterArray([&](Reader& visitor) {
- switch (i++) {
- case 0:
- Reflect(visitor, value.uri);
- break;
- case 1:
- Reflect(visitor, value.position);
- break;
- case 2:
- Reflect(visitor, value.locations);
- break;
- }
- });
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_completion.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_completion.h
deleted file mode 100644
index fca45e9cb7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_completion.h
+++ /dev/null
@@ -1,224 +0,0 @@
-#pragma once
-#include "lsTextEdit.h"
-#include "lsMarkedString.h"
-#include "lsCommand.h"
-
-
-// The kind of a completion entry.
-enum class lsCompletionItemKind {
- Text = 1,
- Method = 2,
- Function = 3,
- Constructor = 4,
- Field = 5,
- Variable = 6,
- Class = 7,
- Interface = 8,
- Module = 9,
- Property = 10,
- Unit = 11,
- Value = 12,
- Enum = 13,
- Keyword = 14,
- Snippet = 15,
- Color = 16,
- File = 17,
- Reference = 18,
- Folder = 19,
- EnumMember = 20,
- Constant = 21,
- Struct = 22,
- Event = 23,
- Operator = 24,
- TypeParameter = 25,
-};
-MAKE_REFLECT_TYPE_PROXY(lsCompletionItemKind);
-
-
-
-// Defines whether the insert text in a completion item should be interpreted as
-// plain text or a snippet.
-enum class lsInsertTextFormat {
- // The primary text to be inserted is treated as a plain string.
- PlainText = 1,
-
- // The primary text to be inserted is treated as a snippet.
- //
- // A snippet can define tab stops and placeholders with `$1`, `$2`
- // and `${3:foo}`. `$0` defines the final tab stop, it defaults to
- // the end of the snippet. Placeholders with equal identifiers are linked,
- // that is typing in one will update others too.
- //
- // See also:
- // https://github.com/Microsoft/vscode/blob/master/src/vs/editor/contrib/snippet/common/snippet.md
- Snippet = 2
-};
-MAKE_REFLECT_TYPE_PROXY(lsInsertTextFormat);
-
-namespace lsp
-{
- std::string ToString(lsCompletionItemKind);
- std::string ToString(lsInsertTextFormat);
-}
-/**
- * The Completion request is sent from the client to the server to compute completion items at a given cursor position.
- * Completion items are presented in the IntelliSense user class. If computing complete completion items is expensive
- * servers can additional provide a handler for the resolve completion item request. This request is send when a
- * completion item is selected in the user class.
- */
-struct lsCompletionItem {
-
- // The label of this completion item. By default
- // also the text that is inserted when selecting
- // this completion.
- std::string label;
-
- // The kind of this completion item. Based of the kind
- // an icon is chosen by the editor.
- optional<lsCompletionItemKind> kind ;
-
- // A human-readable string with additional information
- // about this item, like type or symbol information.
- optional < std::string > detail;
-
- // A human-readable string that represents a doc-comment.
- optional< std::pair<optional< std::string> , optional<MarkupContent> > > documentation;
-
-
- /**
- * Indicates if this item is deprecated.
- */
- optional< bool >deprecated;
-
-
- /**
- * Select this item when showing.
- *
- * *Note* that only one completion item can be selected and that the
- * tool / client decides which item that is. The rule is that the *first
- * item of those that match best is selected.
- */
- optional< bool > preselect;
-
-
- // Internal information to order candidates.
- int relevance = 0;
-
- // A string that shoud be used when comparing this item
- // with other items. When `falsy` the label is used.
- optional< std::string > sortText;
-
- // A string that should be used when filtering a set of
- // completion items. When `falsy` the label is used.
- optional<std::string> filterText;
-
- // A string that should be inserted a document when selecting
- // this completion. When `falsy` the label is used.
- optional<std::string> insertText;
-
- // The format of the insert text. The format applies to both the `insertText`
- // property and the `newText` property of a provided `textEdit`.
- optional< lsInsertTextFormat> insertTextFormat ;
-
- // An edit which is applied to a document when selecting this completion. When
- // an edit is provided the value of `insertText` is ignored.
- //
- // *Note:* The range of the edit must be a single line range and it must
- // contain the position at which completion has been requested.
- optional<lsTextEdit> textEdit;
-
- // An optional array of additional text edits that are applied when
- // selecting this completion. Edits must not overlap with the main edit
- // nor with themselves.
- // std::vector<TextEdit> additionalTextEdits;
-
- // An optional command that is executed *after* inserting this completion.
- // *Note* that additional modifications to the current document should be
- // described with the additionalTextEdits-property. Command command;
-
- // An data entry field that is preserved on a completion item between
- // a completion and a completion resolve request.
- // data ? : any
-
- // Use this helper to figure out what content the completion item will insert
- // into the document, as it could live in either |textEdit|, |insertText|, or
- // |label|.
- const std::string& InsertedContent() const;
-
- std::string DisplayText();
- /**
- * An optional array of additional text edits that are applied when
- * selecting this completion. Edits must not overlap (including the same insert position)
- * with the main edit nor with themselves.
- *
- * Additional text edits should be used to change text unrelated to the current cursor position
- * (for example adding an import statement at the top of the file if the completion item will
- * insert an unqualified type).
- */
- optional<std::vector<lsTextEdit> >additionalTextEdits;
-
- /**
-* An optional set of characters that when pressed while this completion is active will accept it first and
-* then type that character. *Note* that all commit characters should have `length=1` and that superfluous
-* characters will be ignored.
-*/
- optional< std::vector<std::string> > commitCharacters;
-
- /**
-* An optional command that is executed *after* inserting this completion. *Note* that
-* additional modifications to the current document should be described with the
-* additionalTextEdits-property.
-*/
- optional<lsCommandWithAny> command;
-
- /**
-* An data entry field that is preserved on a completion item between a completion and a completion resolve request.
-*/
- optional<lsp::Any> data;
- std::string ToString();
- MAKE_SWAP_METHOD(lsCompletionItem,
- label,
- kind,
- detail,
- documentation,
- sortText,
- insertText,
- filterText,
- insertTextFormat,
- textEdit,
- deprecated, preselect, additionalTextEdits, commitCharacters,
- command, data);
-
-};
-
-
-
-MAKE_REFLECT_STRUCT(lsCompletionItem,
- label,
- kind,
- detail,
- documentation,
- sortText,
- insertText,
- filterText,
- insertTextFormat,
- textEdit,
- deprecated, preselect, additionalTextEdits, commitCharacters,
- command, data);
-
-
-
-struct CompletionList {
- // This list it not complete. Further typing should result in recomputing
- // this list.
- bool isIncomplete = false;
- // The completion items.
- std::vector<lsCompletionItem> items;
-
- void swap(CompletionList& arg) noexcept
- {
- items.swap(arg.items);
- std::swap(isIncomplete, arg.isIncomplete);
- }
-};
-MAKE_REFLECT_STRUCT(CompletionList, isIncomplete, items);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_diagnostic.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_diagnostic.h
deleted file mode 100644
index e05e816b69..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/lsp_diagnostic.h
+++ /dev/null
@@ -1,152 +0,0 @@
-#pragma once
-#include <optional>
-#include "lsRange.h"
-#include "lsTextEdit.h"
-#include "lsDocumentUri.h"
-
-#include "lsResponseError.h"
-#include "location_type.h"
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-enum class lsDiagnosticSeverity {
- // Reports an error.
- Error = 1,
- // Reports a warning.
- Warning = 2,
- // Reports an information.
- Information = 3,
- // Reports a hint.
- Hint = 4
-};
-MAKE_REFLECT_TYPE_PROXY(lsDiagnosticSeverity);
-
-/**
- * The diagnostic tags.
- *
- * @since 3.15.0
- */
-enum class DiagnosticTag :uint8_t {
-
- /**
- * Unused or unnecessary code.
- *
- * Clients are allowed to render diagnostics with this tag faded out instead of having
- * an error squiggle.
- */
- Unnecessary=(1),
-
- /**
- * Deprecated or obsolete code.
- *
- * Clients are allowed to rendered diagnostics with this tag strike through.
- */
- Deprecated=(2),
-};
-MAKE_REFLECT_TYPE_PROXY(DiagnosticTag);
-
-
-
-/**
- * Represents a related message and source code location for a diagnostic. This should be
- * used to point to code locations that cause or related to a diagnostics, e.g when duplicating
- * a symbol in a scope.
- *
- * Since 3.7.0
- */
-
-struct DiagnosticRelatedInformation {
- /**
- * The location of this related diagnostic information.
- */
-
- lsLocation location;
-
- /**
- * The message of this related diagnostic information.
- */
-
- std::string message;
-
- MAKE_SWAP_METHOD(DiagnosticRelatedInformation, location, message)
-};
-MAKE_REFLECT_STRUCT(DiagnosticRelatedInformation, location, message)
-/**
- * Structure to capture a description for an error code.
- *
- * @since 3.16.0
- */
-struct DiagnosticCodeDescription {
- /**
- * An URI to open with more information about the diagnostic error.
- */
- std::string href;
- MAKE_SWAP_METHOD(DiagnosticCodeDescription, href)
-};
-MAKE_REFLECT_STRUCT(DiagnosticCodeDescription, href)
-
-//Represents a diagnostic, such as a compiler error or warning.Diagnostic objects are only valid in the scope of a resource.
-struct lsDiagnostic {
- // The range at which the message applies.
- lsRange range;
-
- // The diagnostic's severity. Can be omitted. If omitted it is up to the
- // client to interpret diagnostics as error, warning, info or hint.
- optional<lsDiagnosticSeverity> severity;
-
- // The diagnostic's code. Can be omitted.
- optional< std::pair<optional<std::string>, optional<int>> > code;
-
- optional<DiagnosticCodeDescription> codeDescription;
- // A human-readable string describing the source of this
- // diagnostic, e.g. 'typescript' or 'super lint'.
- optional < std::string >source ;
-
- // The diagnostic's message.
- std::string message;
-
- // Non-serialized set of fixits.
- std::vector<lsTextEdit> fixits_;
-
- /**
- * Additional metadata about the diagnostic.
- *
- * @since 3.15.0
- */
- optional<std::vector<DiagnosticTag>> tags;
-
-
- /**
- * An array of related diagnostic information, e.g. when symbol-names within a scope collide
- * all definitions can be marked via this property.
- *
- * Since 3.7.0
- */
- optional<std::vector<DiagnosticRelatedInformation>> relatedInformation;
-
- /**
- * A data entry field that is preserved between a
- * `textDocument/publishDiagnostics` notification and
- * `textDocument/codeAction` request.
- *
- * @since 3.16.0
- */
- optional<lsp::Any> data;
- bool operator==(const lsDiagnostic& rhs) const;
- bool operator!=(const lsDiagnostic& rhs) const;
-
- MAKE_SWAP_METHOD(lsDiagnostic, range, severity, code, codeDescription, source, message, tags, data)
-};
-MAKE_REFLECT_STRUCT(lsDiagnostic, range, severity, code, codeDescription, source, message, tags, data)
-
-
-
-struct Rsp_Error : ResponseError<lsResponseError, Rsp_Error> {
-
- MAKE_SWAP_METHOD(Rsp_Error, jsonrpc, id, error)
-};
-MAKE_REFLECT_STRUCT(Rsp_Error, jsonrpc, id, error)
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/method_type.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/method_type.h
deleted file mode 100644
index dcbb4a851a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/method_type.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#pragma once
-#include <string>
-
-using MethodType = const char* const;
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/out_list.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/out_list.h
deleted file mode 100644
index 8ede0b4a60..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/out_list.h
+++ /dev/null
@@ -1,22 +0,0 @@
-#pragma once
-
-
-#include "location_type.h"
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-
-//DEFINE_RESPONCE_TYPE(Rsp_FindLinkLocationList, std::vector<LinkLocation>);
-//DEFINE_RESPONCE_TYPE(Rsp_LocationList, std::vector<lsLocation>);
-
-
-namespace LocationListEither{
-
- typedef std::pair< optional<std::vector<lsLocation>> , optional<std::vector<LocationLink> > > Either;
-
-};
-extern void Reflect(Reader& visitor, LocationListEither::Either& value);
-//DEFINE_RESPONCE_TYPE(Rsp_LocationListEither, LocationListEither::Either);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/symbol.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/symbol.h
deleted file mode 100644
index 216c3f7d13..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/symbol.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/location_type.h"
-
-
-enum class lsSymbolKind : uint8_t {
- Unknown = 0,
-
- File = 1,
- Module = 2,
- Namespace = 3,
- Package = 4,
- Class = 5,
- Method = 6,
- Property = 7,
- Field = 8,
- Constructor = 9,
- Enum = 10,
- Interface = 11,
- Function = 12,
- Variable = 13,
- Constant = 14,
- String = 15,
- Number = 16,
- Boolean = 17,
- Array = 18,
- Object = 19,
- Key = 20,
- Null = 21,
- EnumMember = 22,
- Struct = 23,
- Event = 24,
- Operator = 25,
-
- // For C++, this is interpreted as "template parameter" (including
- // non-type template parameters).
- TypeParameter = 26,
-
- // cquery extensions
- // See also https://github.com/Microsoft/language-server-protocol/issues/344
- // for new SymbolKind clang/Index/IndexSymbol.h clang::index::SymbolKind
- TypeAlias = 252,
- Parameter = 253,
- StaticMethod = 254,
- Macro = 255,
-};
-MAKE_REFLECT_TYPE_PROXY(lsSymbolKind);
-
-typedef lsSymbolKind SymbolKind;
-
-// A document highlight kind.
-enum class lsDocumentHighlightKind {
- // A textual occurrence.
- Text = 1,
- // Read-access of a symbol, like reading a variable.
- Read = 2,
- // Write-access of a symbol, like writing to a variable.
- Write = 3
-};
-MAKE_REFLECT_TYPE_PROXY(lsDocumentHighlightKind);
-
-// A document highlight is a range inside a text document which deserves
-// special attention. Usually a document highlight is visualized by changing
-// the background color of its range.
-struct lsDocumentHighlight {
- // The range this highlight applies to.
- lsRange range;
-
- // The highlight kind, default is DocumentHighlightKind.Text.
- optional<lsDocumentHighlightKind> kind ;
-
- MAKE_SWAP_METHOD(lsDocumentHighlight, range, kind)
-};
-MAKE_REFLECT_STRUCT(lsDocumentHighlight, range, kind);
-
-struct lsSymbolInformation {
-
-/**
- * The name of this symbol.
- */
- std::string name;
- /**
- * The kind of this symbol.
- */
- lsSymbolKind kind;
- /**
-* Indicates if this symbol is deprecated.
-*/
- optional<bool> deprecated;
- /**
- * The location of this symbol. The location's range is used by a tool
- * to reveal the location in the editor. If the symbol is selected in the
- * tool the range's start information is used to position the cursor. So
- * the range usually spans more then the actual symbol's name and does
- * normally include things like visibility modifiers.
- *
- * The range doesn't have to denote a node range in the sense of a abstract
- * syntax tree. It can therefore not be used to re-construct a hierarchy of
- * the symbols.
- */
- lsLocation location;
- /**
- * The name of the symbol containing this symbol. This information is for
- * user interface purposes (e.g. to render a qualifier in the user interface
- * if necessary). It can't be used to re-infer a hierarchy for the document
- * symbols.
- */
- optional<std::string> containerName;
-
-
- MAKE_SWAP_METHOD(lsSymbolInformation, name, kind, deprecated, location, containerName);
-};
-MAKE_REFLECT_STRUCT(lsSymbolInformation, name, kind, deprecated, location, containerName);
-
-
-struct lsDocumentSymbol {
- /**
- * The name of this symbol.
- */
-
- std::string name;
-
- /**
- * The kind of this symbol.
- */
-
- lsSymbolKind kind = lsSymbolKind::Unknown;
-
- /**
- * The range enclosing this symbol not including leading/trailing whitespace but everything else
- * like comments. This information is typically used to determine if the clients cursor is
- * inside the symbol to reveal in the symbol in the UI.
- */
-
- lsRange range;
-
- /**
- * The range that should be selected and revealed when this symbol is being picked, e.g the name of a function.
- * Must be contained by the `range`.
- */
-
- lsRange selectionRange;
-
- /**
- * More detail for this symbol, e.g the signature of a function. If not provided the
- * name is used.
- */
- optional< std::string > detail;
-
- /**
- * Indicates if this symbol is deprecated.
- */
- optional< bool > deprecated;
-
- /**
- * Children of this symbol, e.g. properties of a class.
- */
- optional < std::vector<lsDocumentSymbol> > children;
-
- //internal use
- int flags=0;
-
- MAKE_SWAP_METHOD(lsDocumentSymbol, name, kind, range, selectionRange, detail, deprecated, children, flags);
-};
-MAKE_REFLECT_STRUCT(lsDocumentSymbol, name, kind, range, selectionRange, detail, deprecated, children, flags);
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/SemanticTokens.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/SemanticTokens.h
deleted file mode 100644
index 8a24ebdd45..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/SemanticTokens.h
+++ /dev/null
@@ -1,267 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsVersionedTextDocumentIdentifier.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-enum class HighlightingKind_clangD {
- Variable = 0,
- LocalVariable,
- Parameter,
- Function,
- Method,
- StaticMethod,
- Field,
- StaticField,
- Class,
- Interface,
- Enum,
- EnumConstant,
- Typedef,
- Type,
- Unknown,
- Namespace,
- TemplateParameter,
- Concept,
- Primitive,
- Macro,
-
- // This one is different from the other kinds as it's a line style
- // rather than a token style.
- InactiveCode,
-
- LastKind = InactiveCode
-};
-std::string toSemanticTokenType(HighlightingKind_clangD kind);
-
-enum class HighlightingModifier_clangD {
- Declaration,
- Deprecated,
- Deduced,
- Readonly,
- Static,
- Abstract,
- DependentName,
- DefaultLibrary,
-
- FunctionScope,
- ClassScope,
- FileScope,
- GlobalScope,
-
- LastModifier = GlobalScope
-};
-std::string toSemanticTokenModifier(HighlightingModifier_clangD modifier);
-
-enum SemanticTokenType {
- ls_namespace=0,// 'namespace',
- /**
- * Represents a generic type. Acts as a fallback for types which
- * can't be mapped to a specific type like class or enum.
- */
- ls_type,// 'type',
- ls_class,// 'class',
- ls_enum,// 'enum',
- ls_interface,// 'interface',
- ls_struct,// 'struct',
- ls_typeParameter,// 'typeParameter',
- ls_parameter,// 'parameter',
- ls_variable,// 'variable',
- ls_property,// 'property',
- ls_enumMember,// 'enumMember',
- ls_event,// 'event',
- ls_function,// 'function',
- ls_method,// 'method',
- ls_macro,// 'macro',
- ls_keyword,// 'keyword',
- ls_modifier,// 'modifier',
- ls_comment,// 'comment',
- ls_string,// 'string',
- ls_number,// 'number',
- ls_regexp,// 'regexp',
- ls_operator,// 'operator'
- lastKind = ls_operator
-};
-std::string to_string(SemanticTokenType);
-unsigned toSemanticTokenType(std::vector<SemanticTokenType>& modifiers);
-
-enum TokenType_JDT {
- PACKAGE_JDT=0,
- CLASS_JDT,
- INTERFACE_JDT,
- ENUM_JDT,
- ENUM_MEMBER_JDT,
- TYPE_JDT,
- TYPE_PARAMETER_JDT,
- ANNOTATION_JDT,
- ANNOTATION_MEMBER_JDT,
- METHOD_JDT,
- PROPERTY_JDT,
- VARIABLE_JDT,
- PARAMETER_JDT
-};
-std::string to_string(TokenType_JDT);
-
-enum SemanticTokenModifier {
- ls_declaration=0,// 'declaration',
- ls_definition,// 'definition',
- ls_readonly,// 'readonly',
- ls_static,// 'static',
- ls_deprecated,// 'deprecated',
- ls_abstract,// 'abstract',
- ls_async,// 'async',
- ls_modification,// 'modification',
- ls_documentation,// 'documentation',
- ls_defaultLibrary,// 'defaultLibrary'
- LastModifier = ls_defaultLibrary
-};
-std::string to_string(SemanticTokenModifier);
-unsigned toSemanticTokenModifiers(std::vector<SemanticTokenModifier>&);
-/// Specifies a single semantic token in the document.
-/// This struct is not part of LSP, which just encodes lists of tokens as
-/// arrays of numbers directly.
-struct SemanticToken {
- /// token line number, relative to the previous token
- unsigned deltaLine = 0;
- /// token start character, relative to the previous token
- /// (relative to 0 or the previous token's start if they are on the same line)
- unsigned deltaStart = 0;
- /// the length of the token. A token cannot be multiline
- unsigned length = 0;
- /// will be looked up in `SemanticTokensLegend.tokenTypes`
- unsigned tokenType = 0;
- /// each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`
- unsigned tokenModifiers = 0;
-};
-bool operator==(const SemanticToken&, const SemanticToken&);
-struct SemanticTokens{
-
- /**
- * Tokens in a file are represented as an array of integers. The position of each token is expressed relative to
- * the token before it, because most tokens remain stable relative to each other when edits are made in a file.
- *
- * ---
- * In short, each token takes 5 integers to represent, so a specific token `i` in the file consists of the following array indices:
- * - at index `5*i` - `deltaLine`: token line number, relative to the previous token
- * - at index `5*i+1` - `deltaStart`: token start character, relative to the previous token (relative to 0 or the previous token's start if they are on the same line)
- * - at index `5*i+2` - `length`: the length of the token. A token cannot be multiline.
- * - at index `5*i+3` - `tokenType`: will be looked up in `SemanticTokensLegend.tokenTypes`. We currently ask that `tokenType` < 65536.
- * - at index `5*i+4` - `tokenModifiers`: each set bit will be looked up in `SemanticTokensLegend.tokenModifiers`
- *
- * ---
- * ### How to encode tokens
- *
- * Here is an example for encoding a file with 3 tokens in a uint32 array:
- * ```
- * { line: 2, startChar: 5, length: 3, tokenType: "property", tokenModifiers: ["private", "static"] },
- * { line: 2, startChar: 10, length: 4, tokenType: "type", tokenModifiers: [] },
- * { line: 5, startChar: 2, length: 7, tokenType: "class", tokenModifiers: [] }
- * ```
- *
- * 1. First of all, a legend must be devised. This legend must be provided up-front and capture all possible token types.
- * For this example, we will choose the following legend which must be passed in when registering the provider:
- * ```
- * tokenTypes: ['property', 'type', 'class'],
- * tokenModifiers: ['private', 'static']
- * ```
- *
- * 2. The first transformation step is to encode `tokenType` and `tokenModifiers` as integers using the legend. Token types are looked
- * up by index, so a `tokenType` value of `1` means `tokenTypes[1]`. Multiple token modifiers can be set by using bit flags,
- * so a `tokenModifier` value of `3` is first viewed as binary `0b00000011`, which means `[tokenModifiers[0], tokenModifiers[1]]` because
- * bits 0 and 1 are set. Using this legend, the tokens now are:
- * ```
- * { line: 2, startChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },
- * { line: 2, startChar: 10, length: 4, tokenType: 1, tokenModifiers: 0 },
- * { line: 5, startChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }
- * ```
- *
- * 3. The next step is to represent each token relative to the previous token in the file. In this case, the second token
- * is on the same line as the first token, so the `startChar` of the second token is made relative to the `startChar`
- * of the first token, so it will be `10 - 5`. The third token is on a different line than the second token, so the
- * `startChar` of the third token will not be altered:
- * ```
- * { deltaLine: 2, deltaStartChar: 5, length: 3, tokenType: 0, tokenModifiers: 3 },
- * { deltaLine: 0, deltaStartChar: 5, length: 4, tokenType: 1, tokenModifiers: 0 },
- * { deltaLine: 3, deltaStartChar: 2, length: 7, tokenType: 2, tokenModifiers: 0 }
- * ```
- *
- * 4. Finally, the last step is to inline each of the 5 fields for a token in a single array, which is a memory friendly representation:
- * ```
- * // 1st token, 2nd token, 3rd token
- * [ 2,5,3,0,3, 0,5,4,1,0, 3,2,7,2,0 ]
- * ```
- */
- std::vector<int32_t> data;
- static std::vector<int32_t> encodeTokens(std::vector<SemanticToken>& tokens);
-
- /**
- * An optional result id. If provided and clients support delta updating
- * the client will include the result id in the next semantic token request.
- * A server can then instead of computing all semantic tokens again simply
- * send a delta.
- */
- optional<std::string> resultId;
- MAKE_SWAP_METHOD(SemanticTokens, data, resultId)
-};
-MAKE_REFLECT_STRUCT(SemanticTokens, data, resultId)
-
-/// Body of textDocument/semanticTokens/full request.
-struct SemanticTokensParams {
- /// The text document.
- lsTextDocumentIdentifier textDocument;
- MAKE_REFLECT_STRUCT(SemanticTokensParams, textDocument)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensParams, textDocument)
-
-
-/// Body of textDocument/semanticTokens/full/delta request.
-/// Requests the changes in semantic tokens since a previous response.
-struct SemanticTokensDeltaParams {
- /// The text document.
- lsTextDocumentIdentifier textDocument;
- /**
- * The result id of a previous response. The result Id can either point to
- * a full response or a delta response depending on what was received last.
- */
- std::string previousResultId;
-
- MAKE_REFLECT_STRUCT(SemanticTokensDeltaParams, textDocument, previousResultId)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensDeltaParams, textDocument, previousResultId)
-
-/// Describes a a replacement of a contiguous range of semanticTokens.
-struct SemanticTokensEdit {
- // LSP specifies `start` and `deleteCount` which are relative to the array
- // encoding of the previous tokens.
- // We use token counts instead, and translate when serializing this struct.
- unsigned startToken = 0;
- unsigned deleteTokens = 0;
- std::vector<int32_t> tokens; // encoded as a flat integer array
-
- MAKE_REFLECT_STRUCT(SemanticTokensEdit, startToken, deleteTokens, tokens)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensEdit, startToken, deleteTokens, tokens)
-
-
-/// This models LSP SemanticTokensDelta | SemanticTokens, which is the result of
-/// textDocument/semanticTokens/full/delta.
-struct SemanticTokensOrDelta {
- optional<std::string > resultId;
- /// Set if we computed edits relative to a previous set of tokens.
- optional< std::vector<SemanticTokensEdit> > edits;
- /// Set if we computed a fresh set of tokens.
- /// Set if we computed edits relative to a previous set of tokens.
- optional<std::vector<int32_t>> tokens; // encoded as integer array
- MAKE_REFLECT_STRUCT(SemanticTokensOrDelta, resultId, edits, tokens)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensOrDelta, resultId, edits, tokens)
-
-
-struct SemanticTokensLegend {
- std::vector<std::string> tokenTypes;
- std::vector<std::string> tokenModifiers;
- MAKE_REFLECT_STRUCT(SemanticTokensLegend, tokenTypes, tokenModifiers)
-};
-MAKE_REFLECT_STRUCT(SemanticTokensLegend, tokenTypes, tokenModifiers)
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_semanticTokens_full, SemanticTokensParams,optional<SemanticTokens >,"textDocument/semanticTokens/full")
-DEFINE_REQUEST_RESPONSE_TYPE(td_semanticTokens_full_delta, SemanticTokensDeltaParams, optional<SemanticTokensOrDelta >, "textDocument/semanticTokens/full/delta")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/callHierarchy.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/callHierarchy.h
deleted file mode 100644
index 408767d937..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/callHierarchy.h
+++ /dev/null
@@ -1,121 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/symbol.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "LibLsp/lsp/lsRange.h"
-
-enum class SymbolTag { Deprecated = 1 };
-MAKE_REFLECT_TYPE_PROXY(SymbolTag)
-
-struct CallHierarchyPrepareParams
-{
- lsTextDocumentIdentifier textDocument;
- lsPosition position;
-
- MAKE_SWAP_METHOD(CallHierarchyPrepareParams,
- textDocument,
- position)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyPrepareParams,
- textDocument,
- position)
-
-
-
- /// Represents programming constructs like functions or constructors
- /// in the context of call hierarchy.
-struct CallHierarchyItem {
- /// The name of this item.
- std::string name;
-
- /// The kind of this item.
- SymbolKind kind;
-
- /// Tags for this item.
- optional<std::vector<SymbolTag>> tags;
-
- /// More detaill for this item, e.g. the signature of a function.
- optional<std::string> detail;
-
- /// The resource identifier of this item.
- lsDocumentUri uri;
-
- /**
- * The range enclosing this symbol not including leading/trailing whitespace
- * but everything else, e.g. comments and code.
- */
- lsRange range;
-
- /**
- * The range that should be selected and revealed when this symbol is being
- * picked, e.g. the name of a function. Must be contained by the
- * [`range`](#CallHierarchyItem.range).
- */
- lsRange selectionRange;
-
- /**
- * A data entry field that is preserved between a call hierarchy prepare and
- * incoming calls or outgoing calls requests.
- */
- optional<lsp::Any> data;
- MAKE_SWAP_METHOD(CallHierarchyItem, name, kind, tags, detail, uri, range, selectionRange, data)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyItem, name, kind, tags, detail, uri, range, selectionRange, data)
-
-
-
-/// The parameter of a `callHierarchy/incomingCalls` request.
-struct CallHierarchyIncomingCallsParams {
- CallHierarchyItem item;
- MAKE_SWAP_METHOD(CallHierarchyIncomingCallsParams,item)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyIncomingCallsParams, item)
-
-
-/// Represents an incoming call, e.g. a caller of a method or constructor.
-struct CallHierarchyIncomingCall {
- /// The item that makes the call.
- CallHierarchyItem from;
-
- /// The range at which the calls appear.
- /// This is relative to the caller denoted by `From`.
- std::vector<lsRange> fromRanges;
- MAKE_SWAP_METHOD(CallHierarchyIncomingCall, from, fromRanges)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyIncomingCall, from, fromRanges)
-
-
-
-
-/// The parameter of a `callHierarchy/outgoingCalls` request.
-struct CallHierarchyOutgoingCallsParams {
- CallHierarchyItem item;
- MAKE_SWAP_METHOD(CallHierarchyOutgoingCallsParams, item)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyOutgoingCallsParams, item)
-
-/// Represents an outgoing call, e.g. calling a getter from a method or
-/// a method from a constructor etc.
-struct CallHierarchyOutgoingCall {
- /// The item that is called.
- CallHierarchyItem to;
-
- /// The range at which this item is called.
- /// This is the range relative to the caller, and not `To`.
- std::vector<lsRange> fromRanges;
- MAKE_SWAP_METHOD(CallHierarchyOutgoingCall, to, fromRanges)
-};
-MAKE_REFLECT_STRUCT(CallHierarchyOutgoingCall, to, fromRanges)
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_prepareCallHierarchy, CallHierarchyPrepareParams,
- optional<std::vector<CallHierarchyItem>>, "textDocument/prepareCallHierarchy")
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_incomingCalls, CallHierarchyIncomingCallsParams,
- optional<std::vector<CallHierarchyIncomingCall>>, "callHierarchy/incomingCalls")
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_outgoingCalls, CallHierarchyOutgoingCallsParams,
- optional<std::vector<CallHierarchyOutgoingCall>>, "callHierarchy/CallHierarchyOutgoingCall")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_action.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_action.h
deleted file mode 100644
index e72d83af90..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_action.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/method_type.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/CodeActionParams.h"
-
-namespace QuickAssistProcessor {
-
- extern const char* SPLIT_JOIN_VARIABLE_DECLARATION_ID;//$NON-NLS-1$
- extern const char* CONVERT_FOR_LOOP_ID;// ;// "org.eclipse.jdt.ls.correction.convertForLoop.assist"; //$NON-NLS-1$
- extern const char* ASSIGN_TO_LOCAL_ID ;// "org.eclipse.jdt.ls.correction.assignToLocal.assist"; //$NON-NLS-1$
- extern const char* ASSIGN_TO_FIELD_ID ;// "org.eclipse.jdt.ls.correction.assignToField.assist"; //$NON-NLS-1$
- extern const char* ASSIGN_PARAM_TO_FIELD_ID ;// "org.eclipse.jdt.ls.correction.assignParamToField.assist"; //$NON-NLS-1$
- extern const char* ASSIGN_ALL_PARAMS_TO_NEW_FIELDS_ID ;// "org.eclipse.jdt.ls.correction.assignAllParamsToNewFields.assist"; //$NON-NLS-1$
- extern const char* ADD_BLOCK_ID ;// "org.eclipse.jdt.ls.correction.addBlock.assist"; //$NON-NLS-1$
- extern const char* EXTRACT_LOCAL_ID ;// "org.eclipse.jdt.ls.correction.extractLocal.assist"; //$NON-NLS-1$
- extern const char* EXTRACT_LOCAL_NOT_REPLACE_ID ;// "org.eclipse.jdt.ls.correction.extractLocalNotReplaceOccurrences.assist"; //$NON-NLS-1$
- extern const char* EXTRACT_CONSTANT_ID ;// "org.eclipse.jdt.ls.correction.extractConstant.assist"; //$NON-NLS-1$
- extern const char* INLINE_LOCAL_ID ;// "org.eclipse.jdt.ls.correction.inlineLocal.assist"; //$NON-NLS-1$
- extern const char* CONVERT_LOCAL_TO_FIELD_ID ;// "org.eclipse.jdt.ls.correction.convertLocalToField.assist"; //$NON-NLS-1$
- extern const char* CONVERT_ANONYMOUS_TO_LOCAL_ID ;// "org.eclipse.jdt.ls.correction.convertAnonymousToLocal.assist"; //$NON-NLS-1$
- extern const char* CONVERT_TO_STRING_BUFFER_ID ;// "org.eclipse.jdt.ls.correction.convertToStringBuffer.assist"; //$NON-NLS-1$
- extern const char* CONVERT_TO_MESSAGE_FORMAT_ID ;// "org.eclipse.jdt.ls.correction.convertToMessageFormat.assist"; //$NON-NLS-1$;
- extern const char* EXTRACT_METHOD_INPLACE_ID ;// "org.eclipse.jdt.ls.correction.extractMethodInplace.assist"; //$NON-NLS-1$;
-
- extern const char* CONVERT_ANONYMOUS_CLASS_TO_NESTED_COMMAND ;// "convertAnonymousClassToNestedCommand";
-};
-/**
- * The code action request is sent from the client to the server to compute
- * commands for a given text document and range. These commands are
- * typically code fixes to either fix problems or to beautify/refactor code.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_codeAction, lsCodeActionParams, std::vector<lsCommandWithAny>, "textDocument/codeAction");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_lens.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_lens.h
deleted file mode 100644
index b9241de06b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/code_lens.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-struct lsDocumentCodeLensParams {
-
-/**
- * The document to request code lens for.
- */
- lsTextDocumentIdentifier textDocument;
-
- MAKE_SWAP_METHOD(lsDocumentCodeLensParams, textDocument);
-};
-MAKE_REFLECT_STRUCT(lsDocumentCodeLensParams, textDocument);
-
-
-
-
-struct lsCodeLens {
- // The range in which this code lens is valid. Should only span a single line.
- lsRange range;
- // The command this code lens represents.
- optional<lsCommandWithAny> command;
- // A data entry field that is preserved on a code lens item between
- // a code lens and a code lens resolve request.
- optional< lsp::Any> data;
-
- MAKE_SWAP_METHOD(lsCodeLens, range, command, data)
-};
-MAKE_REFLECT_STRUCT(lsCodeLens, range, command, data)
-
-
-
-/**
- * The code lens request is sent from the client to the server to compute
- * code lenses for a given text document.
- *
- * Registration Options: CodeLensRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_codeLens, lsDocumentCodeLensParams, std::vector<lsCodeLens>, "textDocument/codeLens")
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/colorPresentation.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/colorPresentation.h
deleted file mode 100644
index c70b6502d2..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/colorPresentation.h
+++ /dev/null
@@ -1,63 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsRange.h"
-#include "documentColor.h"
-#include "LibLsp/lsp/lsTextEdit.h"
-
-
-struct ColorPresentationParams {
-
- /**
- * The text document.
- */
- lsTextDocumentIdentifier textDocument;
-
- /**
- * The range in the document where this color appers.
- */
-
- lsRange range;
-
- /**
- * The actual color value for this color range.
- */
-
- TextDocument::Color color;
- MAKE_SWAP_METHOD(ColorPresentationParams, textDocument, range, color)
-};
-MAKE_REFLECT_STRUCT(ColorPresentationParams, textDocument, range, color)
-
-
-struct ColorPresentation {
- /**
- * The label of this color presentation. It will be shown on the color
- * picker header. By default this is also the text that is inserted when selecting
- * this color presentation.
- */
-
- std::string label;
-
- /**
- * An edit which is applied to a document when selecting
- * this presentation for the color. When `null` the label is used.
- */
- lsTextEdit textEdit;
-
- /**
- * An optional array of additional text edits that are applied when
- * selecting this color presentation. Edits must not overlap with the main edit nor with themselves.
- */
- std::vector<lsTextEdit> additionalTextEdits;
- MAKE_SWAP_METHOD(ColorPresentation, label, textEdit, additionalTextEdits)
-};
-MAKE_REFLECT_STRUCT(ColorPresentation, label, textEdit, additionalTextEdits)
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_colorPresentation,
- ColorPresentationParams, std::vector<ColorPresentation>, "textDocument/colorPresentation")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/completion.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/completion.h
deleted file mode 100644
index edcf1e1724..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/completion.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include <regex>
-#include "LibLsp/lsp/lsp_completion.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-
-
-// How a completion was triggered
-enum class lsCompletionTriggerKind {
- // Completion was triggered by typing an identifier (24x7 code
- // complete), manual invocation (e.g Ctrl+Space) or via API.
- Invoked = 1,
-
- // Completion was triggered by a trigger character specified by
- // the `triggerCharacters` properties of the `CompletionRegistrationOptions`.
- TriggerCharacter = 2
-};
-MAKE_REFLECT_TYPE_PROXY(lsCompletionTriggerKind);
-
-
-// Contains additional information about the context in which a completion
-// request is triggered.
-struct lsCompletionContext {
- // How the completion was triggered.
- lsCompletionTriggerKind triggerKind = lsCompletionTriggerKind::Invoked;
-
- // The trigger character (a single character) that has trigger code complete.
- // Is undefined if `triggerKind !== CompletionTriggerKind.TriggerCharacter`
- optional<std::string> triggerCharacter;
-
- MAKE_SWAP_METHOD(lsCompletionContext, triggerKind, triggerCharacter);
-};
-MAKE_REFLECT_STRUCT(lsCompletionContext, triggerKind, triggerCharacter);
-
-struct lsCompletionParams : lsTextDocumentPositionParams {
- // The completion context. This is only available it the client specifies to
- // send this using
- // `ClientCapabilities.textDocument.completion.contextSupport === true`
- optional<lsCompletionContext> context;
-
- MAKE_SWAP_METHOD(lsCompletionParams, textDocument, position, context);
-
-};
-MAKE_REFLECT_STRUCT(lsCompletionParams, textDocument, position, context);
-
-
-
-
-
-
-
-
-
-namespace TextDocumentComplete{
-
- typedef std::pair< optional<std::vector<lsCompletionItem>>, optional<CompletionList> > Either;
-
-};
-extern void Reflect(Reader& visitor, TextDocumentComplete::Either& value);
-
-/**
- * The Completion request is sent from the client to the server to compute
- * completion items at a given cursor position. Completion items are
- * presented in the IntelliSense user interface. If computing complete
- * completion items is expensive servers can additional provide a handler
- * for the resolve completion item request. This request is sent when a
- * completion item is selected in the user interface.
- *
- * Registration Options: CompletionRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_completion, lsCompletionParams, CompletionList , "textDocument/completion")
-
-
-
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/declaration_definition.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/declaration_definition.h
deleted file mode 100644
index aa20fce046..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/declaration_definition.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "LibLsp/lsp/out_list.h"
-
-
-/**
- * The go to declaration request is sent from the client to the server to resolve
- * the declaration location of a symbol at a given text document position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- *
- * Since version 3.14.0
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_declaration, lsTextDocumentPositionParams, LocationListEither::Either, "textDocument/declaration");
-
-/**
- * The goto definition request is sent from the client to the server to resolve
- * the definition location of a symbol at a given text document position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_definition, lsTextDocumentPositionParams, LocationListEither::Either, "textDocument/definition");
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/didRenameFiles.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/didRenameFiles.h
deleted file mode 100644
index d88d0e1307..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/didRenameFiles.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include <string>
-#include "LibLsp/lsp/CodeActionParams.h"
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-
-
-class FileRenameEvent {
-public:
- std::string oldUri;
- std::string newUri;
-
- FileRenameEvent() {
- }
-
- FileRenameEvent(std::string oldUri, std::string newUri) {
- this->oldUri = oldUri;
- this->newUri = newUri;
- }
- MAKE_SWAP_METHOD(FileRenameEvent, oldUri, newUri);
-};
-MAKE_REFLECT_STRUCT(FileRenameEvent, oldUri, newUri);
-
-class FileRenameParams {
-public:
- std::vector <FileRenameEvent> files;
-
- FileRenameParams() {
- }
-
- FileRenameParams(std::vector<FileRenameEvent>& files) {
- this->files = files;
- }
- MAKE_SWAP_METHOD(FileRenameParams, files);
-};
-MAKE_REFLECT_STRUCT(FileRenameParams, files);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_didRenameFiles, FileRenameParams, optional<lsWorkspaceEdit>, "java/didRenameFiles");
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_willRenameFiles, FileRenameParams, optional<lsWorkspaceEdit>, "java/willRenameFiles");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_change.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_change.h
deleted file mode 100644
index 8450bd343a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_change.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsVersionedTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsRange.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-struct lsTextDocumentContentChangeEvent {
- // The range of the document that changed.
- optional<lsRange> range;
- // The length of the range that got replaced.
- optional<int> rangeLength;
- // The new text of the range/document.
- std::string text;
-
- MAKE_SWAP_METHOD(lsTextDocumentContentChangeEvent, range, rangeLength, text);
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentContentChangeEvent, range, rangeLength, text);
-
-
-struct lsTextDocumentDidChangeParams {
- lsVersionedTextDocumentIdentifier textDocument;
- std::vector<lsTextDocumentContentChangeEvent> contentChanges;
-
- /**
- * Legacy property to support protocol version 1.0 requests.
- */
-
- optional<lsDocumentUri> uri;
-
- void swap(lsTextDocumentDidChangeParams& arg) noexcept
- {
- uri.swap(arg.uri);
- contentChanges.swap(arg.contentChanges);
- textDocument.swap(arg.textDocument);
- }
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentDidChangeParams,
- textDocument,
- contentChanges, uri);
-
-/**
- * The document change notification is sent from the client to the server to
- * signal changes to a text document.
- *
- * Registration Options: TextDocumentChangeRegistrationOptions
- */
-DEFINE_NOTIFICATION_TYPE(Notify_TextDocumentDidChange, lsTextDocumentDidChangeParams, "textDocument/didChange");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_close.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_close.h
deleted file mode 100644
index d064819ae9..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_close.h
+++ /dev/null
@@ -1,33 +0,0 @@
-#pragma once
-
-
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-
-
-
-namespace TextDocumentDidClose {
-
- struct Params {
- lsTextDocumentIdentifier textDocument;
- void swap(Params& arg) noexcept
- {
- textDocument.swap(arg.textDocument);
- }
-
- };
-
-};
-
-MAKE_REFLECT_STRUCT(TextDocumentDidClose::Params, textDocument);
-
-/**
- * The document close notification is sent from the client to the server
- * when the document got closed in the client. The document's truth now
- * exists where the document's uri points to (e.g. if the document's uri is
- * a file uri the truth now exists on disk).
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_NOTIFICATION_TYPE(Notify_TextDocumentDidClose, TextDocumentDidClose::Params, "textDocument/didClose");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_open.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_open.h
deleted file mode 100644
index 379f35989f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_open.h
+++ /dev/null
@@ -1,39 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-#include "LibLsp/lsp/lsTextDocumentItem.h"
-
-// Open, view, change, close file
-namespace TextDocumentDidOpen {
-
- struct Params {
- lsTextDocumentItem textDocument;
-
-
-
- /**
- * Legacy property to support protocol version 1.0 requests.
- */
- optional<std::string> text;
-
- MAKE_SWAP_METHOD(TextDocumentDidOpen::Params, textDocument, text);
-
- };
-
-}
-MAKE_REFLECT_STRUCT(TextDocumentDidOpen::Params, textDocument, text);
-
-/**
- * The document open notification is sent from the client to the server to
- * signal newly opened text documents. The document's truth is now managed
- * by the client and the server must not try to read the document's truth
- * using the document's uri.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */;
-
-
-DEFINE_NOTIFICATION_TYPE(Notify_TextDocumentDidOpen, TextDocumentDidOpen::Params, "textDocument/didOpen");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_save.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_save.h
deleted file mode 100644
index 5d00af0c20..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/did_save.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-
-namespace TextDocumentDidSave {
-
- struct Params {
- // The document that was saved.
- lsTextDocumentIdentifier textDocument;
-
- // Optional the content when saved. Depends on the includeText value
- // when the save notifcation was requested.
- optional<std::string> text;
-
- MAKE_SWAP_METHOD(TextDocumentDidSave::Params, textDocument, text);
- };
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentDidSave::Params, textDocument, text);
-
-/**
- * The document save notification is sent from the client to the server when
- * the document for saved in the client.
- *
- * Registration Options: TextDocumentSaveRegistrationOptions
- */
-DEFINE_NOTIFICATION_TYPE(Notify_TextDocumentDidSave, TextDocumentDidSave::Params, "textDocument/didSave");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/documentColor.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/documentColor.h
deleted file mode 100644
index 9aeeadba05..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/documentColor.h
+++ /dev/null
@@ -1,73 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsRange.h"
-#include <vector>
-struct DocumentColorParams {
- /**
- * The text document.
- */
-
- lsTextDocumentIdentifier textDocument;
- MAKE_SWAP_METHOD(DocumentColorParams, textDocument);
-};
-MAKE_REFLECT_STRUCT(DocumentColorParams, textDocument);
-
-/**
- * The document color request is sent from the client to the server to list all color references found in a given text
- * document. Along with the range, a color value in RGB is returned.
- *
- * Clients can use the result to decorate color references in an editor. For example:
- * - Color boxes showing the actual color next to the reference
- * - Show a color picker when a color reference is edited
- *
- * Since version 3.6.0
- */
-
-namespace TextDocument {
- struct Color {
- /**
- * The red component of this color in the range [0-1].
- */
- double red = 0;
-
- /**
- * The green component of this color in the range [0-1].
- */
- double green = 0;
-
- /**
- * The blue component of this color in the range [0-1].
- */
- double blue = 0;
-
- /**
- * The alpha component of this color in the range [0-1].
- */
- double alpha = 0;
- MAKE_SWAP_METHOD(TextDocument::Color, red, green, blue, alpha)
- };
-}
-MAKE_REFLECT_STRUCT(TextDocument::Color, red, green, blue, alpha)
-
-
-struct ColorInformation {
- /**
- * The range in the document where this color appers.
- */
-
- lsRange range;
-
- /**
- * The actual color value for this color range.
- */
-
- TextDocument::Color color;
- MAKE_SWAP_METHOD(ColorInformation, range, color)
-};
-MAKE_REFLECT_STRUCT(ColorInformation,range,color)
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_documentColor, DocumentColorParams,std::vector<ColorInformation>, "textDocument/documentColor");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_link.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_link.h
deleted file mode 100644
index 92f02b24f1..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_link.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-namespace TextDocumentDocumentLink {
-
- struct Params {
- // The document to provide document links for.
- lsTextDocumentIdentifier textDocument;
- MAKE_SWAP_METHOD(Params, textDocument)
- };
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentDocumentLink::Params, textDocument);
-
-
-
-
-// A document link is a range in a text document that links to an internal or
-// external resource, like another text document or a web site.
-struct lsDocumentLink {
- // The range this link applies to.
- lsRange range;
- // The uri this link points to. If missing a resolve request is sent later.
- optional<lsDocumentUri> target;
-
- optional<lsp::Any> data;
-
- MAKE_SWAP_METHOD(lsDocumentLink, range, target, data)
-
-};
-MAKE_REFLECT_STRUCT(lsDocumentLink, range, target,data);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_links, TextDocumentDocumentLink::Params, std::vector<lsDocumentLink>, "textDocument/documentLink");
-
-
-/**
- * The document link resolve request is sent from the client to the server to resolve the target of a given document link.
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_linkResolve, lsDocumentLink, lsDocumentLink, "documentLink/resolve");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_symbol.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_symbol.h
deleted file mode 100644
index b01ffe0dc7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/document_symbol.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/symbol.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
- /**
- * The document symbol request is sent from the client to the server to list all symbols found in a given text document.
- */
-struct lsDocumentSymbolParams {
- lsTextDocumentIdentifier textDocument;
- MAKE_SWAP_METHOD(lsDocumentSymbolParams, textDocument)
-};
-MAKE_REFLECT_STRUCT(lsDocumentSymbolParams, textDocument);
-
-
-
-struct TextDocumentDocumentSymbol{
- typedef std::pair< optional<lsSymbolInformation> , optional<lsDocumentSymbol> > Either;
-};
-void Reflect(Reader& visitor, TextDocumentDocumentSymbol::Either& value);
-
-
-
-/**
- * The document symbol request is sent from the client to the server to list all
- * symbols found in a given text document.
- *
- * Registration Options: {@link TextDocumentRegistrationOptions}
- *
- * <p>
- * <b>Caveat</b>: although the return type allows mixing the
- * {@link DocumentSymbol} and {@link SymbolInformation} instances into a list do
- * not do it because the clients cannot accept a heterogeneous list. A list of
- * {@code DocumentSymbol} instances is only a valid return value if the
- * {@link DocumentSymbolCapabilities#getHierarchicalDocumentSymbolSupport()
- * textDocument.documentSymbol.hierarchicalDocumentSymbolSupport} is
- * {@code true}. More details on this difference between the LSP and the LSP4J
- * can be found <a href="https://github.com/eclipse/lsp4j/issues/252">here</a>.
- * </p>
- */
-
-//DEFINE_REQUEST_RESPONSE_TYPE(td_symbol,
-// lsDocumentSymbolParams,
-// std::vector<TextDocumentDocumentSymbol::Either> );
-//
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_symbol,
- lsDocumentSymbolParams,
- std::vector< lsDocumentSymbol >,"textDocument/documentSymbol" );
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/foldingRange.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/foldingRange.h
deleted file mode 100644
index f863b4991d..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/foldingRange.h
+++ /dev/null
@@ -1,62 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "document_symbol.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-
-struct FoldingRangeRequestParams {
- /**
- * The text document.
- */
-
- lsTextDocumentIdentifier textDocument;
- MAKE_SWAP_METHOD(FoldingRangeRequestParams, textDocument)
-};
-MAKE_REFLECT_STRUCT(FoldingRangeRequestParams, textDocument)
-
-
-struct FoldingRange {
- /**
- * The zero-based line number from where the folded range starts.
- */
- int startLine;
-
- /**
- * The zero-based line number where the folded range ends.
- */
- int endLine;
-
- /**
- * The zero-based character offset from where the folded range starts. If not defined, defaults
- * to the length of the start line.
- */
- int startCharacter;
-
- /**
- * The zero-based character offset before the folded range ends. If not defined, defaults to the
- * length of the end line.
- */
- int endCharacter;
-
- /**
- * Describes the kind of the folding range such as `comment' or 'region'. The kind
- * is used to categorize folding ranges and used by commands like 'Fold all comments'. See
- * FoldingRangeKind for an enumeration of standardized kinds.
- */
- std::string kind;
-
- MAKE_SWAP_METHOD(FoldingRange, startLine, endLine, startCharacter, endCharacter, kind)
-};
-MAKE_REFLECT_STRUCT(FoldingRange,startLine,endLine,startCharacter,endCharacter,kind)
-
-
-/**
- * The folding range request is sent from the client to the server to return all folding
- * ranges found in a given text document.
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_foldingRange, FoldingRangeRequestParams, std::vector<FoldingRange>, "textDocument/foldingRange");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/formatting.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/formatting.h
deleted file mode 100644
index 49b7883b5f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/formatting.h
+++ /dev/null
@@ -1,32 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/lsFormattingOptions.h"
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-
-namespace TextDocumentFormatting {
-
- struct Params {
- /**
- * The document to format.
- */
- lsTextDocumentIdentifier textDocument;
- /**
- * The format options.
- */
- lsFormattingOptions options;
- MAKE_SWAP_METHOD(Params, textDocument, options);
- };
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentFormatting::Params, textDocument, options);
-/**
- * The document formatting request is sent from the client to the server to
- * format a whole document.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_formatting, TextDocumentFormatting::Params,
- std::vector<lsTextEdit>, "textDocument/formatting");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/highlight.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/highlight.h
deleted file mode 100644
index 0e01416126..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/highlight.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "document_symbol.h"
-
-/**
- * The references request is sent from the client to the server to resolve
- * project-wide references for the symbol denoted by the given text document
- * position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_highlight, lsTextDocumentPositionParams,
- std::vector<lsDocumentHighlight>, "textDocument/documentHighlight");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/hover.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/hover.h
deleted file mode 100644
index f2c15c3c44..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/hover.h
+++ /dev/null
@@ -1,55 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsMarkedString.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "LibLsp/lsp/lsRange.h"
-/**
- * The hover request is sent from the client to the server to request hover
- * information at a given text document position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-
-namespace TextDocumentHover
-{
- typedef optional< std::vector< std::pair<optional<std::string>, optional<lsMarkedString>> > > Left;
- typedef std::pair< Left, optional<MarkupContent> > Either;
- struct Result {
- /**
- * The hover's content as markdown
- */
- Either contents;
-
- /**
- * An optional range
- */
- optional<lsRange> range;
-
- MAKE_SWAP_METHOD(Result, contents, range)
- };
-}
-MAKE_REFLECT_STRUCT(TextDocumentHover::Result, contents, range);
-
-extern void Reflect(Reader& visitor, std::pair<optional<std::string>, optional<lsMarkedString>>& value);
-extern void Reflect(Reader& visitor, TextDocumentHover::Either& value);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_hover, lsTextDocumentPositionParams, TextDocumentHover::Result, "textDocument/hover")
-
-//struct Rsp_TextDocumentHover : ResponseMessage< TextDocumentHover::Result, Rsp_TextDocumentHover> {
-//
-//};
-//MAKE_REFLECT_STRUCT(Rsp_TextDocumentHover,
-// jsonrpc,
-// id,
-// result);
-
-//MAKE_REFLECT_STRUCT_OPTIONALS_MANDATORY(Rsp_TextDocumentHover,
-// jsonrpc,
-// id,
-// result);
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/implementation.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/implementation.h
deleted file mode 100644
index 0d7851cb81..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/implementation.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/lsp/out_list.h"
-
-
-/**
- * The goto implementation request is sent from the client to the server to resolve
- * the implementation location of a symbol at a given text document position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- *
- * Since version 3.6.0
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_implementation, lsTextDocumentPositionParams, LocationListEither::Either, "textDocument/implementation"); \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/linkedEditingRange.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/linkedEditingRange.h
deleted file mode 100644
index dfac99d378..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/linkedEditingRange.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/lsAny.h"
-#include "LibLsp/lsp/symbol.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "LibLsp/lsp/lsRange.h"
-
-
-
-struct LinkedEditingRangeParams
-{
- lsTextDocumentIdentifier textDocument;
- lsPosition position;
-
- MAKE_SWAP_METHOD(LinkedEditingRangeParams,
- textDocument,
- position)
-};
-MAKE_REFLECT_STRUCT(LinkedEditingRangeParams,
- textDocument,
- position)
-
-
-struct LinkedEditingRanges
-{
- /**
- * A list of ranges that can be renamed together. The ranges must have
- * identical length and contain identical text content. The ranges cannot overlap.
- */
- std::vector<lsRange> ranges;
-
- /**
- * An optional word pattern (regular expression) that describes valid contents for
- * the given ranges. If no pattern is provided, the client configuration's word
- * pattern will be used.
- */
-
- optional<std::string> wordPattern;
- MAKE_SWAP_METHOD(LinkedEditingRanges,
- ranges,
- wordPattern)
-};
-
-MAKE_REFLECT_STRUCT(LinkedEditingRanges,
- ranges,
- wordPattern)
-DEFINE_REQUEST_RESPONSE_TYPE(td_linkedEditingRange, LinkedEditingRangeParams,
- optional<std::vector<LinkedEditingRanges >>,"textDocument/linkedEditingRange")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/onTypeFormatting.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/onTypeFormatting.h
deleted file mode 100644
index ada2162d12..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/onTypeFormatting.h
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsFormattingOptions.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsRange.h"
-#include "LibLsp/lsp/lsTextEdit.h"
-
-
-struct lsDocumentOnTypeFormattingParams
-{
- lsTextDocumentIdentifier textDocument;
- lsFormattingOptions options;
-
- lsPosition position;
-
- /**
- * The character that has been typed.
- */
-
- std::string ch;
-
- MAKE_SWAP_METHOD(lsDocumentOnTypeFormattingParams,
- textDocument,
- position,
- options, ch);
-};
-MAKE_REFLECT_STRUCT(lsDocumentOnTypeFormattingParams,
- textDocument,
- position,
- options,ch);
-
-/**
- * The document range formatting request is sent from the client to the
- * server to format a given range in a document.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_onTypeFormatting,
- lsDocumentOnTypeFormattingParams, std::vector<lsTextEdit>, "textDocument/onTypeFormatting");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/prepareRename.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/prepareRename.h
deleted file mode 100644
index 1ffe5456f7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/prepareRename.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-
-/**
- * The rename request is sent from the client to the server to do a
- * workspace wide rename of a symbol.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-struct PrepareRenameResult{
- /**
- * The range of the string to rename
- */
-
- lsRange range;
-
-/**
- * A placeholder text of the string content to be renamed.
- */
-
- std::string placeholder;
-
- MAKE_SWAP_METHOD(PrepareRenameResult, range, placeholder)
-
-};
-MAKE_REFLECT_STRUCT(PrepareRenameResult,range,placeholder)
-
-
-
-typedef std::pair< optional< lsRange>, optional<PrepareRenameResult>> TextDocumentPrepareRenameResult;
-extern void Reflect(Reader& visitor, TextDocumentPrepareRenameResult& value);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_prepareRename,
- lsTextDocumentPositionParams, TextDocumentPrepareRenameResult, "textDocument/prepareRename");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/publishDiagnostics.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/publishDiagnostics.h
deleted file mode 100644
index 8272df10e8..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/publishDiagnostics.h
+++ /dev/null
@@ -1,28 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/lsp/lsp_diagnostic.h"
-
-// Diagnostics
-namespace TextDocumentPublishDiagnostics{
- struct Params {
- // The URI for which diagnostic information is reported.
- lsDocumentUri uri;
-
- // An array of diagnostic information items.
- std::vector<lsDiagnostic> diagnostics;
- MAKE_SWAP_METHOD(Params,uri,diagnostics);
- };
-
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentPublishDiagnostics::Params,
- uri,
- diagnostics);
-
-/**
- * Diagnostics notifications are sent from the server to the client to
- * signal results of validation runs.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_TextDocumentPublishDiagnostics, TextDocumentPublishDiagnostics::Params, "textDocument/publishDiagnostics");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/range_formatting.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/range_formatting.h
deleted file mode 100644
index c3c5ff0d0b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/range_formatting.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsFormattingOptions.h"
-
-
-struct lsTextDocumentRangeFormattingParams {
- lsTextDocumentIdentifier textDocument;
- lsRange range;
- lsFormattingOptions options;
-
- MAKE_SWAP_METHOD(lsTextDocumentRangeFormattingParams,
- textDocument,
- range,
- options)
-};
-MAKE_REFLECT_STRUCT(lsTextDocumentRangeFormattingParams,
- textDocument,
- range,
- options);
-
-/**
- * The document range formatting request is sent from the client to the
- * server to format a given range in a document.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_rangeFormatting, lsTextDocumentRangeFormattingParams, std::vector<lsTextEdit>,
- "textDocument/rangeFormatting");
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/references.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/references.h
deleted file mode 100644
index 46782c3d6d..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/references.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/symbol.h"
-
-
-namespace TextDocumentReferences {
-
- struct lsReferenceContext {
- // Include the declaration of the current symbol.
- optional<bool> includeDeclaration;
- MAKE_REFLECT_STRUCT(lsReferenceContext,
- includeDeclaration)
- };
- struct Params {
- lsTextDocumentIdentifier textDocument;
- lsPosition position;
- lsReferenceContext context;
- MAKE_SWAP_METHOD(Params,
- textDocument,
- position,
- context)
-
- };
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentReferences::lsReferenceContext,
- includeDeclaration);
-MAKE_REFLECT_STRUCT(TextDocumentReferences::Params,
- textDocument,
- position,
- context);
-
-
-
-
-/**
- * The references request is sent from the client to the server to resolve
- * project-wide references for the symbol denoted by the given text document
- * position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_references, TextDocumentReferences::Params,
- std::vector<lsLocation>, "textDocument/references");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/rename.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/rename.h
deleted file mode 100644
index 8b6d085910..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/rename.h
+++ /dev/null
@@ -1,41 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-namespace TextDocumentRename {
-
- struct Params {
- // The document to format.
- lsTextDocumentIdentifier textDocument;
-
- // The position at which this request was sent.
- lsPosition position;
-
- // The new name of the symbol. If the given name is not valid the
- // request must return a [ResponseError](#ResponseError) with an
- // appropriate message set.
- std::string newName;
- MAKE_SWAP_METHOD(Params,
- textDocument,
- position,
- newName);
- };
-
-};
-MAKE_REFLECT_STRUCT(TextDocumentRename::Params,
- textDocument,
- position,
- newName);
-/**
- * The rename request is sent from the client to the server to do a
- * workspace wide rename of a symbol.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_rename, TextDocumentRename::Params, lsWorkspaceEdit, "textDocument/rename");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCodeLens.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCodeLens.h
deleted file mode 100644
index 0723985160..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCodeLens.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "code_lens.h"
-
-DEFINE_REQUEST_RESPONSE_TYPE(codeLens_resolve, lsCodeLens, lsCodeLens, "codeLens/resolve")
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCompletionItem.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCompletionItem.h
deleted file mode 100644
index f5576894ed..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveCompletionItem.h
+++ /dev/null
@@ -1,21 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include <regex>
-#include "LibLsp/lsp/lsp_completion.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "completion.h"
-
-/**
- * The request is sent from the client to the server to resolve additional
- * information for a given completion item.
- */
-DEFINE_REQUEST_RESPONSE_TYPE(completionItem_resolve, lsCompletionItem, lsCompletionItem, "completionItem/resolve");
-
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveTypeHierarchy.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveTypeHierarchy.h
deleted file mode 100644
index 8b5f115af7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/resolveTypeHierarchy.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#pragma once
-
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/symbol.h"
-#include "typeHierarchy.h"
-
-struct ResolveTypeHierarchyItemParams {
- /**
- * The hierarchy item to resolve.
- */
-
- TypeHierarchyItem item;
-
- /**
- * The number of hierarchy levels to resolve. {@code 0} indicates no hierarchy level.
- */
- optional<int> resolve;
-
- /**
- * The direction of the type hierarchy resolution.
- */
-
- TypeHierarchyDirection direction;
- MAKE_SWAP_METHOD(ResolveTypeHierarchyItemParams, item, resolve, direction)
-};
-MAKE_REFLECT_STRUCT(ResolveTypeHierarchyItemParams,item,resolve,direction)
-DEFINE_REQUEST_RESPONSE_TYPE(typeHierarchy_resolve, ResolveTypeHierarchyItemParams, TypeHierarchyItem, "typeHierarchy/resolve")
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/selectionRange.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/selectionRange.h
deleted file mode 100644
index 2c908bd57f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/selectionRange.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsPosition.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-struct SelectionRangeParams {
- /**
- * The text document.
- */
-
- lsTextDocumentIdentifier textDocument;
-
- /**
- * The positions inside the text document.
- */
-
- std::vector<lsPosition> positions;
-
- MAKE_SWAP_METHOD(SelectionRangeParams, textDocument, positions)
-
-};
-MAKE_REFLECT_STRUCT(SelectionRangeParams, textDocument, positions)
-
-struct SelectionRange {
- /**
- * The [range](#Range) of this selection range.
- */
-
- lsRange range;
-
- /**
- * The parent selection range containing this range. Therefore `parent.range` must contain `this.range`.
- */
- optional<SelectionRange*> parent;
- MAKE_SWAP_METHOD(SelectionRange, range, parent)
-};
-
-extern void Reflect(Reader& visitor, optional<SelectionRange*>& value);
-extern void Reflect(Writer& visitor, SelectionRange* value);
-
-MAKE_REFLECT_STRUCT(SelectionRange,range,parent)
-/**
- * The {@code textDocument/selectionRange} request is sent from the client to the server to return
- * suggested selection ranges at an array of given positions. A selection range is a range around
- * the cursor position which the user might be interested in selecting.
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_selectionRange, SelectionRangeParams, std::vector<SelectionRange>, "textDocument/selectionRange");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/semanticHighlighting.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/semanticHighlighting.h
deleted file mode 100644
index bfb8619559..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/semanticHighlighting.h
+++ /dev/null
@@ -1,66 +0,0 @@
-#pragma once
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsVersionedTextDocumentIdentifier.h"
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-/**
- * Represents a semantic highlighting information that has to be applied on a specific line of the text document.
- */
-
-struct SemanticHighlightingInformation {
- /**
- * The zero-based line position in the text document.
- */
- int line = 0;
-
- /**
- * A base64 encoded string representing every single highlighted ranges in the line with its start position, length
- * and the "lookup table" index of of the semantic highlighting <a href="https://manual.macromates.com/en/language_grammars">
- * TextMate scopes</a>. If the {@code tokens} is empty or not defined, then no highlighted positions are available for the line.
- */
- std::string tokens;
-
- MAKE_SWAP_METHOD(SemanticHighlightingInformation, line, tokens)
-};
-
-MAKE_REFLECT_STRUCT(SemanticHighlightingInformation, line, tokens);
-
-/**
- * Parameters for the semantic highlighting (server-side) push notification.
- */
-
-struct SemanticHighlightingParams {
- /**
- * The text document that has to be decorated with the semantic highlighting information.
- */
-
- lsVersionedTextDocumentIdentifier textDocument;
-
- /**
- * An array of semantic highlighting information.
- */
-
- std::vector<SemanticHighlightingInformation> lines;
-
- MAKE_SWAP_METHOD(SemanticHighlightingParams, textDocument, lines)
-
-};
-MAKE_REFLECT_STRUCT(SemanticHighlightingParams, textDocument, lines);
-/**
- * The {@code textDocument/semanticHighlighting} notification is pushed from the server to the client
- * to inform the client about additional semantic highlighting information that has to be applied
- * on the text document. It is the server's responsibility to decide which lines are included in
- * the highlighting information. In other words, the server is capable of sending only a delta
- * information. For instance, after opening the text document ({@code DidOpenTextDocumentNotification})
- * the server sends the semantic highlighting information for the entire document, but if the server
- * receives a {@code DidChangeTextDocumentNotification}, it pushes the information only about
- * the affected lines in the document.
- *
- * <p>
- * <b>Note:</b> the <a href=
- * "https://github.com/Microsoft/vscode-languageserver-node/pull/367">{@code textDocument/semanticHighlighting}
- * language feature</a> is not yet part of the official LSP specification.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_semanticHighlighting, SemanticHighlightingParams, "textDocument/semanticHighlighting");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/signature_help.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/signature_help.h
deleted file mode 100644
index bb5cd1dc52..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/signature_help.h
+++ /dev/null
@@ -1,92 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/lsMarkedString.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-
-extern void Reflect(Reader& visitor,
- std::pair<optional<std::string>, optional<MarkupContent>>& value);
-
-
-
-// Represents a parameter of a callable-signature. A parameter can
-// have a label and a doc-comment.
-struct lsParameterInformation {
- // The label of this parameter. Will be shown in
- // the UI.
- std::string label;
-
- // The human-readable doc-comment of this parameter. Will be shown
- // in the UI but can be omitted.
- optional< std::pair< optional<std::string> , optional <MarkupContent> > > documentation;
-
- MAKE_SWAP_METHOD(lsParameterInformation, label, documentation)
-};
-MAKE_REFLECT_STRUCT(lsParameterInformation, label, documentation);
-
-// Represents the signature of something callable. A signature
-// can have a label, like a function-name, a doc-comment, and
-// a set of parameters.
-struct lsSignatureInformation {
- // The label of this signature. Will be shown in
- // the UI.
- std::string label;
-
- // The human-readable doc-comment of this signature. Will be shown
- // in the UI but can be omitted.
- optional< std::pair< optional<std::string>, optional <MarkupContent> > > documentation;
-
- // The parameters of this signature.
- std::vector<lsParameterInformation> parameters;
-
- MAKE_SWAP_METHOD(lsSignatureInformation, label, documentation, parameters)
-};
-MAKE_REFLECT_STRUCT(lsSignatureInformation, label, documentation, parameters);
-
-// Signature help represents the signature of something
-// callable. There can be multiple signature but only one
-// active and only one active parameter.
-struct lsSignatureHelp {
- // One or more signatures.
- std::vector<lsSignatureInformation> signatures;
-
- // The active signature. If omitted or the value lies outside the
- // range of `signatures` the value defaults to zero or is ignored if
- // `signatures.length === 0`. Whenever possible implementors should
- // make an active decision about the active signature and shouldn't
- // rely on a default value.
- // In future version of the protocol this property might become
- // mandantory to better express this.
- optional<int> activeSignature;
-
- // The active parameter of the active signature. If omitted or the value
- // lies outside the range of `signatures[activeSignature].parameters`
- // defaults to 0 if the active signature has parameters. If
- // the active signature has no parameters it is ignored.
- // In future version of the protocol this property might become
- // mandantory to better express the active parameter if the
- // active signature does have any.
- optional<int> activeParameter;
-
-
- MAKE_SWAP_METHOD(lsSignatureHelp,
- signatures,
- activeSignature,
- activeParameter)
-};
-MAKE_REFLECT_STRUCT(lsSignatureHelp,
- signatures,
- activeSignature,
- activeParameter);
-
-
-
-/**
- * The signature help request is sent from the client to the server to
- * request signature information at a given cursor position.
- *
- * Registration Options: SignatureHelpRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_signatureHelp, lsTextDocumentPositionParams, lsSignatureHelp, "textDocument/signatureHelp");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/typeHierarchy.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/typeHierarchy.h
deleted file mode 100644
index 8fe99edd87..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/typeHierarchy.h
+++ /dev/null
@@ -1,133 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/lsp/lsTextDocumentPositionParams.h"
-#include "LibLsp/lsp/symbol.h"
-#include "LibLsp/lsp/lsAny.h"
-/**
- * The {@code textDocument/typeHierarchy} request is sent from the client to the
- * server to retrieve a {@link TypeHierarchyItem type hierarchy item} based on
- * the {@link TypeHierarchyParams cursor position in the text document}. This
- * request would also allow to specify if the item should be resolved and
- * whether sub- or supertypes are to be resolved. If no type hierarchy item can
- * be found under the given text document position, resolves to {@code null}.
- *
- * <p>
- * <b>Note:</b> the <a href=
- * "https://github.com/Microsoft/vscode-languageserver-node/pull/426">{@code textDocument/typeHierarchy}
- * language feature</a> is not yet part of the official LSP specification.
- */
-enum class TypeHierarchyDirection : uint32_t{
-
- /**
- * Flag for retrieving/resolving the subtypes. Value: {@code 0}.
- */
- Children = 0,
-
- /**
- * Flag to use when retrieving/resolving the supertypes. Value: {@code 1}.
- */
- Parents =1,
-
- /**
- * Flag for resolving both the super- and subtypes. Value: {@code 2}.
- */
- Both=2
-};
-void Reflect(Reader& reader, TypeHierarchyDirection& value);
-
-
-void Reflect(Writer& writer, TypeHierarchyDirection& value);
-
-struct TypeHierarchyParams :public lsTextDocumentPositionParams
-{
- optional<int> resolve;
- optional<TypeHierarchyDirection> direction ;
-
- MAKE_SWAP_METHOD(TypeHierarchyParams, textDocument, position, resolve, direction)
-};
-MAKE_REFLECT_STRUCT(TypeHierarchyParams, textDocument, position, resolve, direction);
-
-
-
-
-
-/**
- * Representation of an item that carries type information (such as class, interface, enumeration, etc) with additional parentage details.
- */
-
-struct TypeHierarchyItem {
- /**
- * The human readable name of the hierarchy item.
- */
-
- std::string name;
-
- /**
- * Optional detail for the hierarchy item. It can be, for instance, the signature of a function or method.
- */
- optional<std::string>
- detail;
-
- /**
- * The kind of the hierarchy item. For instance, class or interface.
- */
-
- SymbolKind kind;
-
- /**
- * {@code true} if the hierarchy item is deprecated. Otherwise, {@code false}. It is {@code false} by default.
- */
-
- optional<bool> deprecated;
-
- /**
- * The URI of the text document where this type hierarchy item belongs to.
- */
-
- lsDocumentUri uri;
-
- /**
- * The range enclosing this type hierarchy item not including leading/trailing whitespace but everything else
- * like comments. This information is typically used to determine if the clients cursor is inside the type
- * hierarchy item to reveal in the symbol in the UI.
- *
- * @see TypeHierarchyItem#selectionRange
- */
-
- lsRange range;
-
- /**
- * The range that should be selected and revealed when this type hierarchy item is being picked, e.g the name of a function.
- * Must be contained by the the {@link TypeHierarchyItem#getRange range}.
- *
- * @see TypeHierarchyItem#range
- */
-
- lsRange selectionRange;
-
- /**
- * If this type hierarchy item is resolved, it contains the direct parents. Could be empty if the item does not have any
- * direct parents. If not defined, the parents have not been resolved yet.
- */
- optional< std::vector<TypeHierarchyItem> > parents;
-
- /**
- * If this type hierarchy item is resolved, it contains the direct children of the current item.
- * Could be empty if the item does not have any descendants. If not defined, the children have not been resolved.
- */
- optional< std::vector<TypeHierarchyItem> > children;
-
- /**
- * An optional data field can be used to identify a type hierarchy item in a resolve request.
- */
- optional<lsp::Any> data;
-
- MAKE_SWAP_METHOD(TypeHierarchyItem, name, detail, kind, deprecated, uri, range, selectionRange, parents, children, data)
-};
-MAKE_REFLECT_STRUCT(TypeHierarchyItem, name, detail, kind, deprecated, uri, range, selectionRange, parents, children, data);
-
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(td_typeHierarchy, TypeHierarchyParams, TypeHierarchyItem, "textDocument/typeHierarchy");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/type_definition.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/type_definition.h
deleted file mode 100644
index 196a65c5d3..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/type_definition.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/lsp/out_list.h"
-
-/**
- * The goto type definition request is sent from the client to the server to resolve
- * the type definition location of a symbol at a given text document position.
- *
- * Registration Options: TextDocumentRegistrationOptions
- *
- * Since version 3.6.0
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_typeDefinition,
- lsTextDocumentPositionParams, LocationListEither::Either, "textDocument/typeDefinition");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/willSave.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/willSave.h
deleted file mode 100644
index 4fe33d1dcc..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/textDocument/willSave.h
+++ /dev/null
@@ -1,71 +0,0 @@
-#pragma once
-
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-
-namespace WillSaveTextDocumentParams {
-
- /**
- * Represents reasons why a text document is saved.
- */
- enum class TextDocumentSaveReason {
-
- /**
- * Manually triggered, e.g. by the user pressing save, by starting debugging,
- * or by an API call.
- */
- Manual=(1),
-
- /**
- * Automatic after a delay.
- */
- AfterDelay=(2),
-
- /**
- * When the editor lost focus.
- */
- FocusOut=(3)
- };
-
- struct Params {
- /**
- * The document that will be saved.
- */
- lsTextDocumentIdentifier textDocument;
-
- /*
- * A reason why a text document is saved.
- */
-
- optional<TextDocumentSaveReason> reason;
-
- MAKE_SWAP_METHOD(Params, textDocument, reason);
- };
-
-};
-MAKE_REFLECT_TYPE_PROXY(WillSaveTextDocumentParams::TextDocumentSaveReason);
-
-MAKE_REFLECT_STRUCT(WillSaveTextDocumentParams::Params, textDocument, reason);
-
-/**
- * The document save notification is sent from the client to the server when
- * the document for saved in the client.
- *
- * Registration Options: TextDocumentSaveRegistrationOptions
- */
-DEFINE_NOTIFICATION_TYPE(td_willSave, WillSaveTextDocumentParams::Params, "textDocument/willSave");
-
-/**
- * The document will save request is sent from the client to the server before the document is actually saved.
- * The request can return an array of TextEdits which will be applied to the text document before it is saved.
- * Please note that clients might drop results if computing the text edits took too long or if a server constantly fails on this request.
- * This is done to keep the save fast and reliable.
- *
- * Registration Options: TextDocumentRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(td_willSaveWaitUntil,
- WillSaveTextDocumentParams::Params, std::vector<lsTextEdit>, "textDocument/willSaveWaitUntil");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/utils.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/utils.h
deleted file mode 100644
index 5f1769f80a..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/utils.h
+++ /dev/null
@@ -1,141 +0,0 @@
-#pragma once
-#include <algorithm>
-#include <codecvt>
-#include <functional>
-#include <iterator>
-#include <locale>
-#include <memory>
-#include <string>
-#include <vector>
-#include <optional>
-#include <LibLsp/lsp/AbsolutePath.h>
-
-#include "lsPosition.h"
-
-
-namespace lsp
-{
-
-
-// Returns true if |value| starts/ends with |start| or |ending|.
-bool StartsWith(std::string value, std::string start);
-bool EndsWith(std::string value, std::string ending);
-bool AnyStartsWith(const std::vector<std::string>& values,
- const std::string& start);
-bool StartsWithAny(const std::string& value,
- const std::vector<std::string>& startings);
-bool EndsWithAny(const std::string& value,
- const std::vector<std::string>& endings);
-bool FindAnyPartial(const std::string& value,
- const std::vector<std::string>& values);
-// Returns the dirname of |path|, i.e. "foo/bar.cc" => "foo/", "foo" => "./",
-// "/foo" => "/". The result always ends in '/'.
-std::string GetDirName(std::string path);
-// Returns the basename of |path|, ie, "foo/bar.cc" => "bar.cc".
-std::string GetBaseName(const std::string& path);
-// Returns |path| without the filetype, ie, "foo/bar.cc" => "foo/bar".
-std::string StripFileType(const std::string& path);
-
-std::string ReplaceAll(const std::string& source,
- const std::string& from,
- const std::string& to);
-
-std::vector<std::string> SplitString(const std::string& str,
- const std::string& delimiter);
-
-template <typename TValues, typename TMap>
-std::string StringJoinMap(const TValues& values,
- const TMap& map,
- const std::string& sep = ", ") {
- std::string result;
- bool first = true;
- for (auto& entry : values) {
- if (!first)
- result += sep;
- first = false;
- result += map(entry);
- }
- return result;
-}
-
-template <typename TValues>
-std::string StringJoin(const TValues& values, const std::string& sep = ", ") {
- return StringJoinMap(values, [](const std::string& entry) { return entry; },
- sep);
-}
-
-template <typename TCollection, typename TValue>
-bool ContainsValue(const TCollection& collection, const TValue& value) {
- return std::find(std::begin(collection), std::end(collection), value) !=
- std::end(collection);
-}
-
-
-// Ensures that |path| ends in a slash.
-void EnsureEndsInSlash(std::string& path);
-
-// Converts a file path to one that can be used as filename.
-// e.g. foo/bar.c => foo_bar.c
-std::string EscapeFileName(std::string path);
-
-// FIXME: Move ReadContent into ICacheManager?
-bool FileExists(const std::string& filename);
-optional<std::string> ReadContent(const AbsolutePath& filename);
-std::vector<std::string> ReadLinesWithEnding(const AbsolutePath& filename);
-
-bool WriteToFile(const std::string& filename, const std::string& content);
-
-
-template <typename T, typename Fn>
-void RemoveIf(std::vector<T>* vec, Fn predicate) {
- vec->erase(std::remove_if(vec->begin(), vec->end(), predicate), vec->end());
-}
-
-std::string FormatMicroseconds(long long microseconds);
-
-// Makes sure all newlines in |output| are in \r\n format.
-std::string UpdateToRnNewlines(std::string output);
-
-// Utility methods to check if |path| is absolute.
-bool IsAbsolutePath(const std::string& path);
-bool IsUnixAbsolutePath(const std::string& path);
-bool IsWindowsAbsolutePath(const std::string& path);
-
-bool IsDirectory(const std::string& path);
-
-// string <-> wstring conversion (UTF-16), e.g. for use with Window's wide APIs.
- std::string ws2s(std::wstring const& wstr);
- std::wstring s2ws(std::string const& str);
-
-AbsolutePath NormalizePath(const std::string& path,
- bool ensure_exists = true,
- bool force_lower_on_windows = true);
-
-
-int GetOffsetForPosition(lsPosition position, const std::string& content);
-
-// Finds the position for an |offset| in |content|.
-lsPosition GetPositionForOffset(int offset, const std::string& content);
-
-// Utility method to find a position for the given character.
-lsPosition CharPos(const std::string& search,
- char character,
- int character_offset = 0);
-
-
- void scanDirsNoRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret);
-
- void scanFilesUseRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret,
- std::wstring strSuf = L"");
-
- void scanFileNamesUseRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret,
- std::wstring strSuf = L"");
- void scanFileNamesUseRecursive(const std::string& rootPath, std::vector<std::string>& ret,
- std::string strSuf = "");
-
- void scanFilesUseRecursive(const std::string& rootPath, std::vector<std::string>& ret,
- std::string strSuf = "");
-
- void scanDirsUseRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret);
-
-}
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/windows/MessageNotify.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/windows/MessageNotify.h
deleted file mode 100644
index 332fb7e2e7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/windows/MessageNotify.h
+++ /dev/null
@@ -1,83 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-// Show a message to the user.
-enum class lsMessageType : int { Error = 1, Warning = 2, Info = 3, Log = 4 };
-MAKE_REFLECT_TYPE_PROXY(lsMessageType)
-struct MessageParams {
-/**
- * The message type.
- */
-
- lsMessageType type = lsMessageType::Error;
-
-/**
- * The actual message.
- */
- std::string message;
-
- void swap(MessageParams& arg) noexcept {
- lsMessageType temp = type;
- type = arg.type;
- arg.type = temp;
- message.swap(arg.message);
- }
-};
-MAKE_REFLECT_STRUCT(MessageParams, type, message)
-
- /**
- * The log message notification is send from the server to the client to ask
- * the client to log a particular message.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_LogMessage, MessageParams, "window/logMessage")
-
-
-/**
- * The show message notification is sent from a server to a client to ask
- * the client to display a particular message in the user interface.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_ShowMessage, MessageParams, "window/showMessage")
-
-
-
-/**
- * The show message request is sent from a server to a client to ask the client to display a particular message in the
- * user class. In addition to the show message notification the request allows to pass actions and to wait for an
- * answer from the client.
- */
-struct MessageActionItem {
- /**
- * A short title like 'Retry', 'Open Log' etc.
- */
-
- std::string title;
- MAKE_SWAP_METHOD(MessageActionItem, title)
-};
-MAKE_REFLECT_STRUCT(MessageActionItem, title);
-
-
-struct ShowMessageRequestParams :public MessageParams {
- /**
- * The message action items to present.
- */
- std::vector<MessageActionItem> actions;
-
- MAKE_SWAP_METHOD(ShowMessageRequestParams, type, message, actions)
-
-};
-MAKE_REFLECT_STRUCT(ShowMessageRequestParams, type, message, actions)
-
-/**
-* The show message request is sent from a server to a client to ask the
-* client to display a particular message in the user interface. In addition
-* to the show message notification the request allows to pass actions and
-* to wait for an answer from the client.
-*/
-
-DEFINE_REQUEST_RESPONSE_TYPE(WindowShowMessage, ShowMessageRequestParams, MessageActionItem, "window/showMessage")
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/working_files.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/working_files.h
deleted file mode 100644
index 916268f0fa..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/working_files.h
+++ /dev/null
@@ -1,72 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/lsp_diagnostic.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-#include "LibLsp/lsp/textDocument/did_change.h"
-#include "LibLsp/lsp/textDocument/did_close.h"
-#include "LibLsp/lsp/textDocument/did_open.h"
-#include <mutex>
-#include <string>
-#include <memory>
-#include "Directory.h"
-
-struct WorkingFiles;
-struct WorkingFilesData;
-struct WorkingFile {
-
- int version = 0;
- AbsolutePath filename;
- Directory directory;
- WorkingFiles& parent;
- std::atomic<long long> counter;
- WorkingFile(WorkingFiles& ,const AbsolutePath& filename, const std::string& buffer_content);
- WorkingFile(WorkingFiles&, const AbsolutePath& filename, std::string&& buffer_content);
- const std::string& GetContentNoLock() const
- {
- return buffer_content;
- }
-protected:
- friend struct WorkingFiles;
- std::string buffer_content;
-};
-
-struct WorkingFiles {
-
- WorkingFiles();
- ~WorkingFiles();
-
- void CloseFilesInDirectory(const std::vector<Directory>&);
- std::shared_ptr<WorkingFile> OnOpen(lsTextDocumentItem& open);
- std::shared_ptr<WorkingFile> OnChange(const lsTextDocumentDidChangeParams& change);
- bool OnClose(const lsTextDocumentIdentifier& close);
- std::shared_ptr<WorkingFile> OnSave(const lsTextDocumentIdentifier& _save);
-
- bool GetFileBufferContent(const AbsolutePath& filename, std::wstring& out)
- {
- auto file = GetFileByFilename(filename);
- if(!file)
- return false;
- return GetFileBufferContent(file, out);
- }
- bool GetFileBufferContent(const AbsolutePath& filename,std::string& out)
- {
- auto file = GetFileByFilename(filename);
- if (!file)
- return false;
- return GetFileBufferContent(file, out);
- }
- bool GetFileBufferContent(std::shared_ptr<WorkingFile>&, std::string& out);
- bool GetFileBufferContent(std::shared_ptr<WorkingFile>&, std::wstring& out);
-
-
- // Find the file with the given filename.
- std::shared_ptr<WorkingFile> GetFileByFilename(const AbsolutePath& filename);
-
- void Clear();
-private:
- std::shared_ptr<WorkingFile> GetFileByFilenameNoLock(const AbsolutePath& filename);
-
- WorkingFilesData* d_ptr;
-
-
-};
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/applyEdit.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/applyEdit.h
deleted file mode 100644
index eb1f250b2f..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/applyEdit.h
+++ /dev/null
@@ -1,42 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-
-struct ApplyWorkspaceEditParams
-{
- /**
- * The edits to apply.
- */
-
- lsWorkspaceEdit edit;
-
- /**
- * An optional label of the workspace edit. This label is
- * presented in the user interface for example on an undo
- * stack to undo the workspace edit.
- */
- std::string label;
-
- MAKE_SWAP_METHOD(ApplyWorkspaceEditParams, edit, label)
-};
-/**
- * The workspace/applyEdit request is sent from the server to the client to modify resource on the client side.
- */
-MAKE_REFLECT_STRUCT(ApplyWorkspaceEditParams, edit, label);
-
-
-
-struct ApplyWorkspaceEditResponse
-{
- bool applied;
- optional<std::string> failureReason;
- MAKE_SWAP_METHOD(ApplyWorkspaceEditResponse, applied, failureReason)
-};
-MAKE_REFLECT_STRUCT(ApplyWorkspaceEditResponse, applied, failureReason);
-
-
-DEFINE_REQUEST_RESPONSE_TYPE(WorkspaceApply, ApplyWorkspaceEditParams, ApplyWorkspaceEditResponse, "workspace/applyEdit");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/configuration.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/configuration.h
deleted file mode 100644
index ad22bf0185..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/configuration.h
+++ /dev/null
@@ -1,37 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-
-
-struct ConfigurationItem {
- /**
- * The scope to get the configuration section for.
- */
- lsDocumentUri scopeUri;
-
- /**
- * The configuration section asked for.
- */
- std::string section;
- MAKE_SWAP_METHOD(ConfigurationItem, scopeUri, section);
-};
-MAKE_REFLECT_STRUCT(ConfigurationItem, scopeUri, section);
-struct ConfigurationParams
-{
- std::vector<ConfigurationItem> items;
- MAKE_SWAP_METHOD(ConfigurationParams, items)
-};
-
-MAKE_REFLECT_STRUCT(ConfigurationParams, items);
-
-/**
- * The workspace/configuration request is sent from the server to the client to fetch
- * configuration settings from the client. The request can fetch n configuration settings
- * in one roundtrip. The order of the returned configuration settings correspond to the
- * order of the passed ConfigurationItems (e.g. the first item in the response is the
- * result for the first configuration item in the params).
- */
-DEFINE_REQUEST_RESPONSE_TYPE(WorkspaceConfiguration, ConfigurationParams,std::vector<lsp::Any>, "workspace/configuration");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/didChangeWorkspaceFolders.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/didChangeWorkspaceFolders.h
deleted file mode 100644
index 1c6cd83b62..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/didChangeWorkspaceFolders.h
+++ /dev/null
@@ -1,48 +0,0 @@
-#pragma once
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/lsp/workspace/workspaceFolders.h"
-/**
- * The workspace folder change event.
- */
-struct WorkspaceFoldersChangeEvent {
- /**
- * The array of added workspace folders
- */
-
- std::vector<WorkspaceFolder> added;
-
- /**
- * The array of the removed workspace folders
- */
-
- std::vector <WorkspaceFolder> removed;
- MAKE_SWAP_METHOD(WorkspaceFoldersChangeEvent, added, removed);
-
-};
-MAKE_REFLECT_STRUCT(WorkspaceFoldersChangeEvent, added, removed);
-
-struct DidChangeWorkspaceFoldersParams {
- /**
- * The actual workspace folder change event.
- */
-
- WorkspaceFoldersChangeEvent event;
-
- MAKE_SWAP_METHOD(DidChangeWorkspaceFoldersParams, event);
-};
-MAKE_REFLECT_STRUCT(DidChangeWorkspaceFoldersParams, event);
-
-
-/**
- * The workspace/didChangeWorkspaceFolders notification is sent from the client
- * to the server to inform the server about workspace folder configuration changes.
- * The notification is sent by default if both ServerCapabilities/workspaceFolders
- * and ClientCapabilities/workspace/workspaceFolders are true; or if the server has
- * registered to receive this notification it first.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_WorkspaceDidChangeWorkspaceFolders,
- DidChangeWorkspaceFoldersParams, "workspace/didChangeWorkspaceFolders");
-
-
-
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_configuration.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_configuration.h
deleted file mode 100644
index 3e7ca6dded..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_configuration.h
+++ /dev/null
@@ -1,25 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-
-#include "workspaceFolders.h"
-
-
-
-
-struct lsDidChangeConfigurationParams {
- /**
- * The actual changed settings.
- */
- lsp::Any settings;
- MAKE_SWAP_METHOD(lsDidChangeConfigurationParams, settings);
-};
-
-MAKE_REFLECT_STRUCT(lsDidChangeConfigurationParams, settings);
-
-/**
- * A notification sent from the client to the server to signal the change of
- * configuration settings.
- */
-DEFINE_NOTIFICATION_TYPE(Notify_WorkspaceDidChangeConfiguration, lsDidChangeConfigurationParams, "workspace/didChangeConfiguration");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_watched_files.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_watched_files.h
deleted file mode 100644
index c14a7e0eda..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/did_change_watched_files.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/lsp/lsDocumentUri.h"
-enum class lsFileChangeType {
- Created = 1,
- Changed = 2,
- Deleted = 3,
-};
-
-#ifdef _WIN32
-MAKE_REFLECT_TYPE_PROXY(lsFileChangeType);
-#else
-//#pragma clang diagnostic push
-//#pragma clang diagnostic ignored "-Wunused-function"
-MAKE_REFLECT_TYPE_PROXY(lsFileChangeType);
-//#pragma clang diagnostic pop
-#endif
-
-
-/**
- * An event describing a file change.
- */
-struct lsFileEvent {
- lsDocumentUri uri;
- lsFileChangeType type;
-
- MAKE_SWAP_METHOD(lsFileEvent, uri, type)
-};
-MAKE_REFLECT_STRUCT(lsFileEvent, uri, type);
-
-struct lsDidChangeWatchedFilesParams {
- std::vector<lsFileEvent> changes;
- MAKE_SWAP_METHOD(lsDidChangeWatchedFilesParams, changes);
-};
-MAKE_REFLECT_STRUCT(lsDidChangeWatchedFilesParams, changes);
-
- /**
- * The workspace/didChangeWorkspaceFolders notification is sent from the client
- * to the server to inform the server about workspace folder configuration changes.
- * The notification is sent by default if both ServerCapabilities/workspaceFolders
- * and ClientCapabilities/workspace/workspaceFolders are true; or if the server has
- * registered to receive this notification it first.
- */
-
-DEFINE_NOTIFICATION_TYPE(Notify_WorkspaceDidChangeWatchedFiles, lsDidChangeWatchedFilesParams, "workspace/didChangeWatchedFiles");
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/execute_command.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/execute_command.h
deleted file mode 100644
index c656ee5ef7..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/execute_command.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/ExecuteCommandParams.h"
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-
-
-
-/**
- * The workspace/executeCommand request is sent from the client to the
- * server to trigger command execution on the server. In most cases the
- * server creates a WorkspaceEdit structure and applies the changes to the
- * workspace using the request workspace/applyEdit which is sent from the
- * server to the client.
- *
- * Registration Options: ExecuteCommandRegistrationOptions
- */
-DEFINE_REQUEST_RESPONSE_TYPE(wp_executeCommand, ExecuteCommandParams, lsp::Any, "workspace/executeCommand");
-
-
-DEFINE_NOTIFICATION_TYPE(Notify_sendNotification, ExecuteCommandParams, "workspace/notify") \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/symbol.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/symbol.h
deleted file mode 100644
index 129fb5e822..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/symbol.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#pragma once
-
-#include "LibLsp/lsp/symbol.h"
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-/**
- * The workspace symbol request is sent from the client to the server to
- * list project-wide symbols matching the query string.
- *
- * Registration Options: void
- */
-
-DEFINE_REQUEST_RESPONSE_TYPE(wp_symbol, WorkspaceSymbolParams, std::vector<lsSymbolInformation>, "workspace/symbol");
-
diff --git a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/workspaceFolders.h b/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/workspaceFolders.h
deleted file mode 100644
index 136c1d777b..0000000000
--- a/graphics/asymptote/LspCpp/include/LibLsp/lsp/workspace/workspaceFolders.h
+++ /dev/null
@@ -1,34 +0,0 @@
-#pragma once
-
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-
-#include "LibLsp/lsp/lsDocumentUri.h"
-struct WorkspaceFolder {
- /**
- * The associated URI for this workspace folder.
- */
-
- lsDocumentUri uri;
-
- /**
- * The name of the workspace folder. Defaults to the uri's basename.
- */
- std::string name;
-
- MAKE_SWAP_METHOD(WorkspaceFolder, uri, name)
-};
-MAKE_REFLECT_STRUCT(WorkspaceFolder, uri, name);
-
-
-/**
- * The workspace/workspaceFolders request is sent from the server to the client
- * to fetch the current open list of workspace folders.
- *
- * @return null in the response if only a single file is open in the tool,
- * an empty array if a workspace is open but no folders are configured,
- * the workspace folders otherwise.
- */
-DEFINE_REQUEST_RESPONSE_TYPE(WorkspaceFolders,
- optional<JsonNull>, optional<std::vector< WorkspaceFolder>>, "workspace/workspaceFolders");
-
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/Context.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/Context.cpp
deleted file mode 100644
index 8d4094b41a..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/Context.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===--- Context.cpp ---------------------------------------------*- C++-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "LibLsp/JsonRpc/Context.h"
-#include <cassert>
-
-namespace lsp {
-
-
-Context Context::empty() { return Context(/*dataPtr=*/nullptr); }
-
-Context::Context(std::shared_ptr<const Data> DataPtr)
- : dataPtr(std::move(DataPtr)) {}
-
-Context Context::clone() const { return Context(dataPtr); }
-
-static Context &currentContext() {
- static thread_local auto c = Context::empty();
- return c;
-}
-
-const Context &Context::current() { return currentContext(); }
-
-Context Context::swapCurrent(Context Replacement) {
- std::swap(Replacement, currentContext());
- return Replacement;
-}
-
-
-} // lsp clang
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/Endpoint.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/Endpoint.cpp
deleted file mode 100644
index a66108d2e5..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/Endpoint.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/message.h"
-
-
-bool GenericEndpoint::notify(std::unique_ptr<LspMessage> msg)
-{
- auto findIt = method2notification.find(msg->GetMethodType());
-
- if (findIt != method2notification.end())
- {
- return findIt->second(std::move(msg));
- }
- std::string info = "can't find method2notification for notification:\n" + msg->ToJson() + "\n";
- log.log(lsp::Log::Level::SEVERE, info);
- return false;
-}
-
-bool GenericEndpoint::onResponse(const std::string& method, std::unique_ptr<LspMessage>msg)
-{
- auto findIt = method2response.find(method);
-
- if (findIt != method2response.end())
- {
- return findIt->second(std::move(msg));
- }
-
- std::string info = "can't find method2response for response:\n" + msg->ToJson() + "\n";
- log.log(lsp::Log::Level::SEVERE, info);
-
- return false;
-}
-
-
-
-bool GenericEndpoint::onRequest(std::unique_ptr<LspMessage> request)
-{
- auto findIt = method2request.find(request->GetMethodType());
-
- if (findIt != method2request.end())
- {
- return findIt->second(std::move(request));
- }
- std::string info = "can't find method2request for request:\n" + request->ToJson() + "\n";
- log.log(lsp::Log::Level::SEVERE, info);
- return false;
-}
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/GCThreadContext.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/GCThreadContext.cpp
deleted file mode 100644
index 8b68d329c9..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/GCThreadContext.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
-#include "LibLsp/JsonRpc/GCThreadContext.h"
-#include <iostream>
-
-GCThreadContext::GCThreadContext()
-{
-#ifdef LSPCPP_USEGC
- GC_get_stack_base(&gsb);
- GC_register_my_thread(&gsb);
-#endif
-}
-
-GCThreadContext::~GCThreadContext()
-{
-#ifdef LSPCPP_USEGC
- GC_unregister_my_thread();
-#endif
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/MessageJsonHandler.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/MessageJsonHandler.cpp
deleted file mode 100644
index 78cf8950c2..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/MessageJsonHandler.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-#include "LibLsp/JsonRpc/MessageJsonHandler.h"
-#include <string>
-#include <rapidjson/document.h>
-
-
-
-std::unique_ptr<LspMessage> MessageJsonHandler::parseResponseMessage(const std::string& method, Reader& r)
-{
- auto findIt = method2response.find(method);
-
- if( findIt != method2response.end())
- {
- return findIt->second(r);
- }
- return nullptr;
-}
-
-std::unique_ptr<LspMessage> MessageJsonHandler::parseRequstMessage(const std::string& method, Reader&r)
-{
- auto findIt = method2request.find(method);
-
- if (findIt != method2request.end())
- {
- return findIt->second(r);
- }
- return nullptr;
-}
-
-bool MessageJsonHandler::resovleResponseMessage(Reader&r, std::pair<std::string, std::unique_ptr<LspMessage>>& result)
-{
- for (auto& handler : method2response)
- {
- try
- {
- auto msg = handler.second(r);
- result.first = handler.first;
- result.second = std::move(msg);
- return true;
- }
- catch (...)
- {
-
- }
- }
- return false;
-}
-
-std::unique_ptr<LspMessage> MessageJsonHandler::parseNotificationMessage(const std::string& method, Reader& r)
-{
- auto findIt = method2notification.find(method);
-
- if (findIt != method2notification.end())
- {
- return findIt->second(r);
- }
- return nullptr;
-}
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/RemoteEndPoint.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/RemoteEndPoint.cpp
deleted file mode 100644
index f4bd83aae9..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/RemoteEndPoint.cpp
+++ /dev/null
@@ -1,655 +0,0 @@
-#include "LibLsp/JsonRpc/MessageJsonHandler.h"
-#include "LibLsp/JsonRpc/Endpoint.h"
-#include "LibLsp/JsonRpc/message.h"
-#include "LibLsp/JsonRpc/RemoteEndPoint.h"
-#include <future>
-#include "LibLsp/JsonRpc/Cancellation.h"
-#include "LibLsp/JsonRpc/StreamMessageProducer.h"
-#include "LibLsp/JsonRpc/NotificationInMessage.h"
-#include "LibLsp/JsonRpc/lsResponseMessage.h"
-#include "LibLsp/JsonRpc/Condition.h"
-#include "LibLsp/JsonRpc/Context.h"
-#include "rapidjson/error/en.h"
-#include "LibLsp/JsonRpc/json.h"
-#include "LibLsp/JsonRpc/ScopeExit.h"
-#include "LibLsp/JsonRpc/stream.h"
-#include <atomic>
-#include <optional>
-#include <boost/asio/thread_pool.hpp>
-#include <boost/asio/post.hpp>
-
-#include "LibLsp/JsonRpc/GCThreadContext.h"
-
-namespace lsp {
-
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//===----------------------------------------------------------------------===//
-
-// Cancellation mechanism for long-running tasks.
-//
-// This manages interactions between:
-//
-// 1. Client code that starts some long-running work, and maybe cancels later.
-//
-// std::pair<Context, Canceler> Task = cancelableTask();
-// {
-// WithContext Cancelable(std::move(Task.first));
-// Expected
-// deepThoughtAsync([](int answer){ errs() << answer; });
-// }
-// // ...some time later...
-// if (User.fellAsleep())
-// Task.second();
-//
-// (This example has an asynchronous computation, but synchronous examples
-// work similarly - the Canceler should be invoked from another thread).
-//
-// 2. Library code that executes long-running work, and can exit early if the
-// result is not needed.
-//
-// void deepThoughtAsync(std::function<void(int)> Callback) {
-// runAsync([Callback]{
-// int A = ponder(6);
-// if (getCancelledMonitor())
-// return;
-// int B = ponder(9);
-// if (getCancelledMonitor())
-// return;
-// Callback(A * B);
-// });
-// }
-//
-// (A real example may invoke the callback with an error on cancellation,
-// the CancelledError is provided for this purpose).
-//
-// Cancellation has some caveats:
-// - the work will only stop when/if the library code next checks for it.
-// Code outside clangd such as Sema will not do this.
-// - it's inherently racy: client code must be prepared to accept results
-// even after requesting cancellation.
-// - it's Context-based, so async work must be dispatched to threads in
-// ways that preserve the context. (Like runAsync() or TUScheduler).
-//
-
- /// A canceller requests cancellation of a task, when called.
- /// Calling it again has no effect.
- using Canceler = std::function<void()>;
-
- // We don't want a cancelable scope to "shadow" an enclosing one.
- struct CancelState {
- std::shared_ptr<std::atomic<int>> cancelled;
- const CancelState* parent = nullptr;
- lsRequestId id;
- };
- static Key<CancelState> g_stateKey;
-
- /// Defines a new task whose cancellation may be requested.
- /// The returned Context defines the scope of the task.
- /// When the context is active, getCancelledMonitor() is 0 until the Canceler is
- /// invoked, and equal to Reason afterwards.
- /// Conventionally, Reason may be the LSP error code to return.
- std::pair<Context, Canceler> cancelableTask(const lsRequestId& id,int reason = 1){
- assert(reason != 0 && "Can't detect cancellation if Reason is zero");
- CancelState state;
- state.id = id;
- state.cancelled = std::make_shared<std::atomic<int>>();
- state.parent = Context::current().get(g_stateKey);
- return {
- Context::current().derive(g_stateKey, state),
- [reason, cancelled(state.cancelled)] { *cancelled = reason; },
- };
- }
- /// If the current context is within a cancelled task, returns the reason.
-/// (If the context is within multiple nested tasks, true if any are cancelled).
-/// Always zero if there is no active cancelable task.
-/// This isn't free (context lookup) - don't call it in a tight loop.
- optional<CancelMonitor> getCancelledMonitor(const lsRequestId& id, const Context& ctx = Context::current()){
- for (const CancelState* state = ctx.get(g_stateKey); state != nullptr;
- state = state->parent)
- {
- if (id != state->id)continue;
- const std::shared_ptr<std::atomic<int> > cancelled = state->cancelled;
- std::function<int()> temp = [=]{
- return cancelled->load();
- };
- return std::move(temp);
- }
-
- return {};
- }
-} // namespace lsp
-
-using namespace lsp;
-class PendingRequestInfo
-{
- using RequestCallBack = std::function< bool(std::unique_ptr<LspMessage>) >;
-public:
- PendingRequestInfo(const std::string& md,
- const RequestCallBack& callback);
- PendingRequestInfo(const std::string& md);
- PendingRequestInfo() {}
- std::string method;
- RequestCallBack futureInfo;
-};
-
-PendingRequestInfo::PendingRequestInfo(const std::string& _md,
- const RequestCallBack& callback) : method(_md),
- futureInfo(callback)
-{
-}
-
-PendingRequestInfo::PendingRequestInfo(const std::string& md) : method(md)
-{
-}
-struct RemoteEndPoint::Data
-{
- explicit Data(lsp::JSONStreamStyle style,uint8_t workers,lsp::Log& _log , RemoteEndPoint* owner)
- : max_workers(workers), m_id(0),next_request_cookie(0), log(_log)
- {
- if(style == lsp::JSONStreamStyle::Standard )
- message_producer = (new LSPStreamMessageProducer(*owner)) ;
- else{
- message_producer = (new DelimitedStreamMessageProducer(*owner)) ;
- }
- }
- ~Data()
- {
- delete message_producer;
- }
- uint8_t max_workers;
- std::atomic<int> m_id;
- std::shared_ptr<boost::asio::thread_pool> tp;
- // Method calls may be cancelled by ID, so keep track of their state.
- // This needs a mutex: handlers may finish on a different thread, and that's
- // when we clean up entries in the map.
- mutable std::mutex request_cancelers_mutex;
-
- std::map< lsRequestId, std::pair<Canceler, /*Cookie*/ unsigned> > requestCancelers;
-
- std::atomic<unsigned> next_request_cookie; // To disambiguate reused IDs, see below.
- void onCancel(Notify_Cancellation::notify* notify) {
- std::lock_guard<std::mutex> Lock(request_cancelers_mutex);
- const auto it = requestCancelers.find(notify->params.id);
- if (it != requestCancelers.end())
- it->second.first(); // Invoke the canceler.
- }
-
- // We run cancelable requests in a context that does two things:
- // - allows cancellation using requestCancelers[ID]
- // - cleans up the entry in requestCancelers when it's no longer needed
- // If a client reuses an ID, the last wins and the first cannot be canceled.
- Context cancelableRequestContext(lsRequestId id) {
- auto task = cancelableTask(id,
- /*Reason=*/static_cast<int>(lsErrorCodes::RequestCancelled));
- unsigned cookie;
- {
- std::lock_guard<std::mutex> Lock(request_cancelers_mutex);
- cookie = next_request_cookie.fetch_add(1, std::memory_order_relaxed);
- requestCancelers[id] = { std::move(task.second), cookie };
- }
- // When the request ends, we can clean up the entry we just added.
- // The cookie lets us check that it hasn't been overwritten due to ID
- // reuse.
- return task.first.derive(lsp::make_scope_exit([this, id, cookie] {
- std::lock_guard<std::mutex> lock(request_cancelers_mutex);
- const auto& it = requestCancelers.find(id);
- if (it != requestCancelers.end() && it->second.second == cookie)
- requestCancelers.erase(it);
- }));
- }
-
- std::map <lsRequestId, std::shared_ptr<PendingRequestInfo>> _client_request_futures;
- StreamMessageProducer* message_producer;
- std::atomic<bool> quit{};
- lsp::Log& log;
- std::shared_ptr<lsp::istream> input;
- std::shared_ptr<lsp::ostream> output;
-
- std::mutex m_requestInfo;
-
- bool pendingRequest(RequestInMessage& info, GenericResponseHandler&& handler)
- {
- bool ret = true;
- std::lock_guard<std::mutex> lock(m_requestInfo);
- if(!info.id.has_value()){
- auto id = getNextRequestId();
- info.id.set(id);
- }
- else{
- if(_client_request_futures.find(info.id) != _client_request_futures.end()){
- ret = false;
- }
- }
- _client_request_futures[info.id] = std::make_shared<PendingRequestInfo>(info.method, handler);
- return ret;
- }
- const std::shared_ptr<const PendingRequestInfo> getRequestInfo(const lsRequestId& _id)
- {
- std::lock_guard<std::mutex> lock(m_requestInfo);
- auto findIt = _client_request_futures.find(_id);
- if (findIt != _client_request_futures.end())
- {
- return findIt->second;
- }
- return nullptr;
- }
-
- void removeRequestInfo(const lsRequestId& _id)
- {
- std::lock_guard<std::mutex> lock(m_requestInfo);
- auto findIt = _client_request_futures.find(_id);
- if (findIt != _client_request_futures.end())
- {
- _client_request_futures.erase(findIt);
- }
- }
- void clear()
- {
- {
- std::lock_guard<std::mutex> lock(m_requestInfo);
- _client_request_futures.clear();
- }
- if(tp){
- tp->stop();
- }
- quit.store(true, std::memory_order_relaxed);
- }
-
- int getNextRequestId()
- {
- return m_id.fetch_add(1, std::memory_order_relaxed);
- }
-};
-
-namespace
-{
-void WriterMsg(std::shared_ptr<lsp::ostream>& output, LspMessage& msg)
-{
- const auto& s = msg.ToJson();
- const auto value =
- std::string("Content-Length: ") + std::to_string(s.size()) + "\r\n\r\n" + s;
- output->write(value);
- output->flush();
-}
-
-bool isResponseMessage(JsonReader& visitor)
-{
-
- if (!visitor.HasMember("id"))
- {
- return false;
- }
-
- if (!visitor.HasMember("result") && !visitor.HasMember("error"))
- {
- return false;
- }
-
- return true;
-}
-
-bool isRequestMessage(JsonReader& visitor)
-{
- if (!visitor.HasMember("method"))
- {
- return false;
- }
- if (!visitor["method"]->IsString())
- {
- return false;
- }
- if (!visitor.HasMember("id"))
- {
- return false;
- }
- return true;
-}
-bool isNotificationMessage(JsonReader& visitor)
-{
- if (!visitor.HasMember("method"))
- {
- return false;
- }
- if (!visitor["method"]->IsString())
- {
- return false;
- }
- if (visitor.HasMember("id"))
- {
- return false;
- }
- return true;
-}
-}
-
-CancelMonitor RemoteEndPoint::getCancelMonitor(const lsRequestId& id)
-{
- auto monitor = getCancelledMonitor(id);
- if(monitor.has_value())
- {
- return monitor.value();
- }
- return [] {
- return 0;
- };
-
-}
-
-RemoteEndPoint::RemoteEndPoint(
- const std::shared_ptr < MessageJsonHandler >& json_handler,const std::shared_ptr < Endpoint>& localEndPoint,
- lsp::Log& _log, lsp::JSONStreamStyle style, uint8_t max_workers):
- d_ptr(new Data(style,max_workers,_log,this)),jsonHandler(json_handler), local_endpoint(localEndPoint)
-{
- jsonHandler->method2notification[Notify_Cancellation::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_Cancellation::notify::ReflectReader(visitor);
- };
-
- d_ptr->quit.store(false, std::memory_order_relaxed);
-}
-
-RemoteEndPoint::~RemoteEndPoint()
-{
- delete d_ptr;
- d_ptr->quit.store(true, std::memory_order_relaxed);
-}
-
-bool RemoteEndPoint::dispatch(const std::string& content)
-{
- rapidjson::Document document;
- document.Parse(content.c_str(), content.length());
- if (document.HasParseError())
- {
- std::string info ="lsp msg format error:";
- rapidjson::GetParseErrorFunc GetParseError = rapidjson::GetParseError_En; // or whatever
- info+= GetParseError(document.GetParseError());
- info += "\n";
- info += "ErrorContext offset:\n";
- info += content.substr(document.GetErrorOffset());
- d_ptr->log.log(Log::Level::SEVERE, info);
-
- return false;
- }
-
- JsonReader visitor{ &document };
- if (!visitor.HasMember("jsonrpc") ||
- std::string(visitor["jsonrpc"]->GetString()) != "2.0")
- {
- std::string reason;
- reason = "Reason:Bad or missing jsonrpc version\n";
- reason += "content:\n" + content;
- d_ptr->log.log(Log::Level::SEVERE, reason);
- return false;
-
- }
- LspMessage::Kind _kind = LspMessage::NOTIFICATION_MESSAGE;
- try {
- if (isRequestMessage(visitor))
- {
- _kind = LspMessage::REQUEST_MESSAGE;
- auto msg = jsonHandler->parseRequstMessage(visitor["method"]->GetString(), visitor);
- if (msg) {
- mainLoop(std::move(msg));
- }
- else {
- std::string info = "Unknown support request message when consumer message:\n";
- info += content;
- d_ptr->log.log(Log::Level::WARNING, info);
- return false;
- }
- }
- else if (isResponseMessage(visitor))
- {
- _kind = LspMessage::RESPONCE_MESSAGE;
- lsRequestId id;
- ReflectMember(visitor, "id", id);
-
- auto msgInfo = d_ptr->getRequestInfo(id);
- if (!msgInfo)
- {
- std::string info = "Unknown response message :\n";
- info += content;
- d_ptr->log.log(Log::Level::INFO, info);
- }
- else
- {
-
- auto msg = jsonHandler->parseResponseMessage(msgInfo->method, visitor);
- if (msg) {
- mainLoop(std::move(msg));
- }
- else
- {
- std::string info = "Unknown response message :\n";
- info += content;
- d_ptr->log.log(Log::Level::SEVERE, info);
- return false;
- }
-
- }
- }
- else if (isNotificationMessage(visitor))
- {
- auto msg = jsonHandler->parseNotificationMessage(visitor["method"]->GetString(), visitor);
- if (!msg)
- {
- std::string info = "Unknown notification message :\n";
- info += content;
- d_ptr->log.log(Log::Level::SEVERE, info);
- return false;
- }
- mainLoop(std::move(msg));
- }
- else
- {
- std::string info = "Unknown lsp message when consumer message:\n";
- info += content;
- d_ptr->log.log(Log::Level::WARNING, info);
- return false;
- }
- }
- catch (std::exception& e)
- {
-
- std::string info = "Exception when process ";
- if(_kind==LspMessage::REQUEST_MESSAGE)
- {
- info += "request";
- }
- if (_kind == LspMessage::RESPONCE_MESSAGE)
- {
- info += "response";
- }
- else
- {
- info += "notification";
- }
- info += " message:\n";
- info += e.what();
- std::string reason = "Reason:" + info + "\n";
- reason += "content:\n" + content;
- d_ptr->log.log(Log::Level::SEVERE, reason);
- return false;
- }
- return true;
-}
-
-
-
-bool RemoteEndPoint::internalSendRequest(RequestInMessage& info, GenericResponseHandler handler)
-{
- std::lock_guard<std::mutex> lock(m_sendMutex);
- if (!d_ptr->output || d_ptr->output->bad())
- {
- std::string desc = "Output isn't good any more:\n";
- d_ptr->log.log(Log::Level::WARNING, desc);
- return false;
- }
- if(!d_ptr->pendingRequest(info, std::move(handler)))
- {
- std::string desc = "Duplicate id which of request:";
- desc += info.ToJson();
- desc += "\n";
- d_ptr->log.log(Log::Level::WARNING, desc);
- }
- WriterMsg(d_ptr->output, info);
- return true;
-}
-
-int RemoteEndPoint::getNextRequestId(){
- return d_ptr->getNextRequestId();
-}
-bool RemoteEndPoint::cancelRequest(const lsRequestId& id){
- if(!isWorking()){
- return false;
- }
- auto msgInfo = d_ptr->getRequestInfo(id);
- if (msgInfo){
- Notify_Cancellation::notify cancel_notify;
- cancel_notify.params.id = id;
- send(cancel_notify);
- return true;
- }
- return false;
-}
-std::unique_ptr<LspMessage> RemoteEndPoint::internalWaitResponse(RequestInMessage& request, unsigned time_out)
-{
- auto eventFuture = std::make_shared< Condition< LspMessage > >();
- internalSendRequest(request, [=](std::unique_ptr<LspMessage> data)
- {
- eventFuture->notify(std::move(data));
- return true;
- });
- return eventFuture->wait(time_out);
-}
-
-void RemoteEndPoint::mainLoop(std::unique_ptr<LspMessage>msg)
-{
- if(d_ptr->quit.load(std::memory_order_relaxed))
- {
- return;
- }
- const auto _kind = msg->GetKid();
- if (_kind == LspMessage::REQUEST_MESSAGE)
- {
- auto req = static_cast<RequestInMessage*>(msg.get());
- // Calls can be canceled by the client. Add cancellation context.
- WithContext WithCancel(d_ptr->cancelableRequestContext(req->id));
- local_endpoint->onRequest(std::move(msg));
- }
-
- else if (_kind == LspMessage::RESPONCE_MESSAGE)
- {
- const auto id = static_cast<ResponseInMessage*>(msg.get())->id;
- auto msgInfo = d_ptr->getRequestInfo(id);
- if (!msgInfo)
- {
- const auto _method_desc = msg->GetMethodType();
- local_endpoint->onResponse(_method_desc, std::move(msg));
- }
- else
- {
- bool needLocal = true;
- if (msgInfo->futureInfo)
- {
- if (msgInfo->futureInfo(std::move(msg)))
- {
- needLocal = false;
- }
- }
- if (needLocal)
- {
- local_endpoint->onResponse(msgInfo->method, std::move(msg));
- }
- d_ptr->removeRequestInfo(id);
- }
- }
- else if (_kind == LspMessage::NOTIFICATION_MESSAGE)
- {
- if (strcmp(Notify_Cancellation::notify::kMethodInfo, msg->GetMethodType())==0)
- {
- d_ptr->onCancel(static_cast<Notify_Cancellation::notify*>(msg.get()));
- }
- else
- {
- local_endpoint->notify(std::move(msg));
- }
-
- }
- else
- {
- std::string info = "Unknown lsp message when process message in mainLoop:\n";
- d_ptr->log.log(Log::Level::WARNING, info);
- }
-}
-
-void RemoteEndPoint::handle(std::vector<MessageIssue>&& issue)
-{
- for(auto& it : issue)
- {
- d_ptr->log.log(it.code, it.text);
- }
-}
-
-void RemoteEndPoint::handle(MessageIssue&& issue)
-{
- d_ptr->log.log(issue.code, issue.text);
-}
-
-
-void RemoteEndPoint::startProcessingMessages(std::shared_ptr<lsp::istream> r,
- std::shared_ptr<lsp::ostream> w)
-{
- d_ptr->quit.store(false, std::memory_order_relaxed);
- d_ptr->input = r;
- d_ptr->output = w;
- d_ptr->message_producer->bind(r);
- d_ptr->tp = std::make_shared<boost::asio::thread_pool>(d_ptr->max_workers);
- message_producer_thread_ = std::make_shared<std::thread>([&]()
- {
- d_ptr->message_producer->listen([&](std::string&& content){
- const auto temp = std::make_shared<std::string>(std::move(content));
- boost::asio::post(*d_ptr->tp,
- [this, temp]{
-#ifdef LSPCPP_USEGC
- GCThreadContext gcContext;
-#endif
-
- dispatch(*temp);
- });
- });
- });
-}
-
-void RemoteEndPoint::stop()
-{
- if(message_producer_thread_ && message_producer_thread_->joinable())
- {
- message_producer_thread_->detach();
- message_producer_thread_ = nullptr;
- }
- d_ptr->clear();
-
-}
-
-void RemoteEndPoint::sendMsg( LspMessage& msg)
-{
-
- std::lock_guard<std::mutex> lock(m_sendMutex);
- if (!d_ptr->output || d_ptr->output->bad())
- {
- std::string info = "Output isn't good any more:\n";
- d_ptr->log.log(Log::Level::INFO, info);
- return;
- }
- WriterMsg(d_ptr->output, msg);
-
-}
-
-bool RemoteEndPoint::isWorking() const {
- if (message_producer_thread_ && message_producer_thread_->joinable())
- return true;
- return false;
-}
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/StreamMessageProducer.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/StreamMessageProducer.cpp
deleted file mode 100644
index 695c35fe1d..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/StreamMessageProducer.cpp
+++ /dev/null
@@ -1,297 +0,0 @@
-
-#include "LibLsp/JsonRpc/StreamMessageProducer.h"
-#include <cassert>
-
-#include "LibLsp/JsonRpc/stream.h"
-#include "LibLsp/lsp/Markup/string_ref.h"
-
-
-bool StartsWith(std::string value, std::string start);
-bool StartsWith(std::string value, std::string start) {
- if (start.size() > value.size())
- return false;
- return std::equal(start.begin(), start.end(), value.begin());
-}
-
-using namespace std;
-namespace
-{
- string JSONRPC_VERSION = "2.0";
- string CONTENT_LENGTH_HEADER = "Content-Length";
- string CONTENT_TYPE_HEADER = "Content-Type";
- string JSON_MIME_TYPE = "application/json";
- string CRLF = "\r\n";
-
-}
-
- void LSPStreamMessageProducer::parseHeader(std::string& line, LSPStreamMessageProducer::Headers& headers)
- {
- int sepIndex = line.find(':');
- if (sepIndex >= 0) {
- auto key = line.substr(0, sepIndex);
- if(key == CONTENT_LENGTH_HEADER)
- {
- headers.contentLength = atoi(line.substr(sepIndex + 1).data());
- }
- else if(key == CONTENT_TYPE_HEADER)
- {
- int charsetIndex = line.find("charset=");
- if (charsetIndex >= 0)
- headers.charset = line.substr(charsetIndex + 8);
- }
- }
- }
-
-
-void LSPStreamMessageProducer::listen(MessageConsumer callBack)
-{
- if(!input)
- return;
-
- keepRunning = true;
- bool newLine = false;
- Headers headers;
- string headerBuilder ;
- string debugBuilder ;
- // Read the content length. It is terminated by the "\r\n" sequence.
- while (keepRunning)
- {
- if(input->bad())
- {
- std::string info = "Input stream is bad.";
- auto what = input->what();
- if (what.size())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::SEVERE);
- issueHandler.handle(std::move(issue));
- return;
- }
- if(input->fail())
- {
- std::string info = "Input fail.";
- auto what = input->what();
- if(what.size())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::WARNING);
- issueHandler.handle(std::move(issue));
- if(input->need_to_clear_the_state())
- input->clear();
- else
- {
- return;
- }
- }
- int c = input->get();
- if (c == EOF) {
- // End of input stream has been reached
- keepRunning = false;
- }
- else
- {
-
- debugBuilder.push_back((char)c);
- if (c == '\n')
- {
- if (newLine) {
- // Two consecutive newlines have been read, which signals the start of the message content
- if (headers.contentLength <= 0)
- {
- string info = "Unexpected token:" + debugBuilder;
- info = +" (expected Content-Length: sequence);";
- MessageIssue issue(info, lsp::Log::Level::WARNING);
- issueHandler.handle(std::move(issue));
- }
- else {
- bool result = handleMessage(headers,callBack);
- if (!result)
- keepRunning = false;
- newLine = false;
- }
- headers.clear();
- debugBuilder.clear();
- }
- else if (!headerBuilder.empty()) {
- // A single newline ends a header line
- parseHeader(headerBuilder, headers);
- headerBuilder.clear();
- }
- newLine = true;
- }
- else if (c != '\r') {
- // Add the input to the current header line
-
- headerBuilder.push_back((char)c);
- newLine = false;
- }
- }
- }
-
-}
-
-void LSPStreamMessageProducer::bind(std::shared_ptr<lsp::istream>_in)
-{
- input = _in;
-}
-
-bool LSPStreamMessageProducer::handleMessage(Headers& headers ,MessageConsumer callBack)
-{
- // Read content.
- auto content_length = headers.contentLength;
- std::string content(content_length,0);
- auto data = &content[0];
- input->read(data, content_length);
- if (input->bad())
- {
- std::string info = "Input stream is bad.";
- auto what = input->what();
- if (!what.empty())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::SEVERE);
- issueHandler.handle(std::move(issue));
- return false;
- }
-
- if (input->eof())
- {
- MessageIssue issue("No more input when reading content body", lsp::Log::Level::INFO);
- issueHandler.handle(std::move(issue));
- return false;
- }
- if (input->fail())
- {
- std::string info = "Input fail.";
- auto what = input->what();
- if (!what.empty())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::WARNING);
- issueHandler.handle(std::move(issue));
- if (input->need_to_clear_the_state())
- input->clear();
- else
- {
- return false;
- }
- }
-
- callBack(std::move(content));
-
- return true;
-}
-
-
-
-/// For lit tests we support a simplified syntax:
-/// - messages are delimited by '// -----' on a line by itself
-/// - lines starting with // are ignored.
-/// This is a testing path, so favor simplicity over performance here.
-
-void DelimitedStreamMessageProducer::listen(MessageConsumer callBack)
-{
- if(!input)
- return;
-
- keepRunning = true;
-
- auto readLine = [&]( std::string_ref& lineBuilder) -> bool {
- while (keepRunning)
- {
- if(input->bad())
- {
- std::string info = "Input stream is bad.";
- auto what = input->what();
- if (what.size())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::SEVERE);
- issueHandler.handle(std::move(issue));
- return false;
- }
- if(input->fail())
- {
- std::string info = "Input fail.";
- auto what = input->what();
- if(what.size())
- {
- info += "Reason:";
- info += input->what();
- }
- MessageIssue issue(info, lsp::Log::Level::WARNING);
- issueHandler.handle(std::move(issue));
- if(input->need_to_clear_the_state())
- input->clear();
- else
- {
- return false;
- }
- }
- int c = input->get();
- if (c == EOF) {
- // End of input stream has been reached
- keepRunning = false;
- }
- else
- {
- if (c == '\n')
- {
- if(!lineBuilder.empty()){
- lineBuilder.push_back(c);
- return true;
- }
- }
- else if (c != '\r') {
- // Add the input to the current header line
-
- lineBuilder.push_back((char)c);
- }
- }
- }
- return false;
- };
-
- auto getMessage = [&](std::string& json) -> bool {
- std::string_ref lineBuilder ;
- while (readLine(lineBuilder)){
- lineBuilder.trim();
- if(lineBuilder.start_with("//")){
- // Found a delimiter for the message.
- if (lineBuilder == "// -----")
- {
- return true;
- }
- }
- json += lineBuilder;
- }
- return false;
- };
-
-
- while (true) {
- std::string json;
- if (getMessage(json)) {
- callBack(std::move(json));
- }else{
- return ;
- }
- }
-}
-
-void DelimitedStreamMessageProducer::bind(std::shared_ptr<lsp::istream>_in)
-{
- input = _in;
-}
-
-
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/TcpServer.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/TcpServer.cpp
deleted file mode 100644
index 4b3a9aea35..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/TcpServer.cpp
+++ /dev/null
@@ -1,306 +0,0 @@
-//
-// server.cpp
-
-#include "LibLsp/JsonRpc/TcpServer.h"
-#include <signal.h>
-#include <utility>
-#include <boost/bind/bind.hpp>
-
-#include "LibLsp/JsonRpc/MessageIssue.h"
-#include "LibLsp/JsonRpc/stream.h"
-
-
-namespace lsp {
- struct tcp_connect_session;
-
-
- class tcp_stream_wrapper :public istream, public ostream
- {
- public:
- tcp_stream_wrapper(tcp_connect_session& _w);
-
- tcp_connect_session& session;
- std::atomic<bool> quit{};
- std::shared_ptr < MultiQueueWaiter> request_waiter;
- ThreadedQueue< char > on_request;
- std::string error_message;
-
-
- bool fail() override
- {
- return bad();
- }
-
-
-
- bool eof() override
- {
- return bad();
- }
- bool good() override
- {
- return !bad();
- }
- tcp_stream_wrapper& read(char* str, std::streamsize count)
- override
- {
- auto some = on_request.TryDequeueSome(static_cast<size_t>( count ));
- memcpy(str,some.data(),some.size());
- for (std::streamsize i = some.size(); i < count; ++i)
- {
- str[i] = static_cast<char>(get());
- }
-
- return *this;
- }
- int get() override
- {
- return on_request.Dequeue();
- }
-
- bool bad() override;
-
- tcp_stream_wrapper& write(const std::string& c) override;
-
- tcp_stream_wrapper& write(std::streamsize _s) override;
-
- tcp_stream_wrapper& flush() override
- {
- return *this;
- }
- void reset_state()
- {
- return;
- }
-
- void clear() override
- {
-
- }
-
- std::string what() override;
- bool need_to_clear_the_state() override
- {
- return false;
- }
- };
- struct tcp_connect_session:std::enable_shared_from_this<tcp_connect_session>
- {
- /// Buffer for incoming data.
- std::array<unsigned char, 8192> buffer_;
- boost::asio::ip::tcp::socket socket_;
- /// Strand to ensure the connection's handlers are not called concurrently.
- boost::asio::io_context::strand strand_;
- std::shared_ptr<tcp_stream_wrapper> proxy_;
- explicit tcp_connect_session(boost::asio::io_context& io_context, boost::asio::ip::tcp::socket&& _socket)
- : socket_(std::move(_socket)), strand_(io_context), proxy_(new tcp_stream_wrapper(*this))
- {
- do_read();
- }
- void do_write(const char* data, size_t size)
- {
- socket_.async_write_some(boost::asio::buffer(data, size),
- boost::asio::bind_executor(strand_,[this](boost::system::error_code ec, std::size_t n)
- {
- if (!ec)
- {
- return;
- }
- proxy_->error_message = ec.message();
-
- }));
- }
- void do_read()
- {
- socket_.async_read_some(boost::asio::buffer(buffer_),
- boost::asio::bind_executor(strand_,
- [this](boost::system::error_code ec, size_t bytes_transferred)
- {
- if (!ec)
- {
- std::vector<char> elements(buffer_.data(), buffer_.data() + bytes_transferred);
- proxy_->on_request.EnqueueAll(std::move(elements), false);
- do_read();
- return;
- }
- proxy_->error_message = ec.message();
-
- }));
- }
- };
-
- tcp_stream_wrapper::tcp_stream_wrapper(tcp_connect_session& _w): session(_w)
- {
- }
-
- bool tcp_stream_wrapper::bad()
- {
- return !session.socket_.is_open();
- }
-
- tcp_stream_wrapper& tcp_stream_wrapper::write(const std::string& c)
- {
- size_t off = 0;
- for(;off < c.size();){
- if(off + 1024 < c.size()){
- session.do_write(c.data()+off,1024);
- off += 1024;
- }else{
- session.do_write(c.data()+off,c.size() - off);
- break;
- }
- }
- return *this;
- }
-
- tcp_stream_wrapper& tcp_stream_wrapper::write(std::streamsize _s)
- {
- auto s = std::to_string(_s);
- session.do_write(s.data(),s.size());
- return *this;
- }
-
- std::string tcp_stream_wrapper::what()
- {
- if (error_message.size())
- return error_message;
-
- if(! session.socket_.is_open())
- {
- return "Socket is not open.";
- }
- return {};
- }
-
- struct TcpServer::Data
- {
- Data(
- lsp::Log& log, uint32_t _max_workers) :
- acceptor_(io_context_), _log(log)
- {
- }
-
- ~Data()
- {
-
- }
- /// The io_context used to perform asynchronous operations.
- boost::asio::io_context io_context_;
-
- std::shared_ptr<boost::asio::io_service::work> work;
-
- std::shared_ptr<tcp_connect_session> _connect_session;
- /// Acceptor used to listen for incoming connections.
- boost::asio::ip::tcp::acceptor acceptor_;
-
- lsp::Log& _log;
-
- };
-
- TcpServer::~TcpServer()
- {
- delete d_ptr;
- }
-
- TcpServer::TcpServer(const std::string& address, const std::string& port,
- std::shared_ptr < MessageJsonHandler> json_handler,
- std::shared_ptr < Endpoint> localEndPoint, lsp::Log& log, uint32_t _max_workers)
- : point(json_handler, localEndPoint, log,lsp::JSONStreamStyle::Standard, _max_workers),d_ptr(new Data( log, _max_workers))
-
- {
-
- d_ptr->work = std::make_shared<boost::asio::io_service::work>(d_ptr->io_context_);
-
- // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
- boost::asio::ip::tcp::resolver resolver(d_ptr->io_context_);
- boost::asio::ip::tcp::endpoint endpoint =
- *resolver.resolve(address, port).begin();
- d_ptr->acceptor_.open(endpoint.protocol());
- d_ptr->acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- try
- {
- d_ptr->acceptor_.bind(endpoint);
- }
- catch (boost::system::system_error & e)
- {
- std::string temp = "Socket Server bind failed.";
- d_ptr->_log.log(lsp::Log::Level::INFO , temp + e.what());
- return;
- }
- d_ptr->acceptor_.listen();
-
- do_accept();
- std::string desc = "Socket TcpServer " + address + " " + port + " start.";
- d_ptr->_log.log(lsp::Log::Level::INFO, desc);
- }
-
- void TcpServer::run()
- {
- // The io_context::run() call will block until all asynchronous operations
- // have finished. While the TcpServer is running, there is always at least one
- // asynchronous operation outstanding: the asynchronous accept call waiting
- // for new incoming connections.
- d_ptr->io_context_.run();
-
- }
-
- void TcpServer::stop()
- {
- try
- {
- if(d_ptr->work)
- d_ptr->work.reset();
-
- do_stop();
- }
- catch (...)
- {
- }
- }
-
- void TcpServer::do_accept()
- {
- d_ptr->acceptor_.async_accept(
- [this](boost::system::error_code ec, boost::asio::ip::tcp::socket socket)
- {
- // Check whether the TcpServer was stopped by a signal before this
- // completion handler had a chance to run.
- if (!d_ptr->acceptor_.is_open())
- {
- return;
- }
-
- if (!ec)
- {
- if(d_ptr->_connect_session)
- {
- if(d_ptr->_connect_session->socket_.is_open())
- {
- std::string desc = "Disconnect previous client " + d_ptr->_connect_session->socket_.local_endpoint().address().to_string();
- d_ptr->_log.log(lsp::Log::Level::INFO, desc);
- d_ptr->_connect_session->socket_.close();
- }
-
- point.stop();
- }
- auto local_point = socket.local_endpoint();
-
- std::string desc = ("New client " + local_point.address().to_string() + " connect.");
- d_ptr->_log.log(lsp::Log::Level::INFO, desc);
- d_ptr->_connect_session = std::make_shared<tcp_connect_session>(d_ptr->io_context_,std::move(socket));
-
- point.startProcessingMessages(d_ptr->_connect_session->proxy_, d_ptr->_connect_session->proxy_);
- do_accept();
- }
- });
- }
-
- void TcpServer::do_stop()
- {
- d_ptr->acceptor_.close();
-
- point.stop();
-
- }
-
- } // namespace
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/WebSocketServer.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/WebSocketServer.cpp
deleted file mode 100644
index 92a25e88db..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/WebSocketServer.cpp
+++ /dev/null
@@ -1,337 +0,0 @@
-#include "LibLsp/JsonRpc/MessageIssue.h"
-#include "LibLsp/JsonRpc/WebSocketServer.h"
-#include <iostream>
-#include <signal.h>
-#include <utility>
-#include "LibLsp/JsonRpc/stream.h"
-#include <boost/beast/core.hpp>
-#include <boost/beast/websocket.hpp>
-#include <boost/asio/dispatch.hpp>
-namespace beast = boost::beast; // from <boost/beast.hpp>
-namespace http = beast::http; // from <boost/beast/http.hpp>
-namespace websocket = beast::websocket; // from <boost/beast/websocket.hpp>
-namespace net = boost::asio; // from <boost/asio.hpp>
-using tcp = boost::asio::ip::tcp; // from <boost/asio/ip/tcp.hpp>
-namespace lsp {
-
- // Echoes back all received WebSocket messages
- class server_session : public std::enable_shared_from_this<server_session>
- {
- websocket::stream<beast::tcp_stream> ws_;
-
- beast::flat_buffer buffer_;
- std::string user_agent_;
- public:
- std::shared_ptr<websocket_stream_wrapper> proxy_;
- // Take ownership of the socket
- explicit
- server_session(tcp::socket&& socket,const std::string& user_agent)
- : ws_(std::move(socket)),user_agent_(user_agent)
- {
- proxy_ = std::make_shared<websocket_stream_wrapper>(ws_);
- }
-
- // Get on the correct executor
- void
- run()
- {
- // We need to be executing within a strand to perform async operations
- // on the I/O objects in this server_session. Although not strictly necessary
- // for single-threaded contexts, this example code is written to be
- // thread-safe by default.
- net::dispatch(ws_.get_executor(),
- beast::bind_front_handler(
- &server_session::on_run,
- shared_from_this()));
- }
-
- // Start the asynchronous operation
- void
- on_run()
- {
- // Set suggested timeout settings for the websocket
- ws_.set_option(
- websocket::stream_base::timeout::suggested(
- beast::role_type::server));
-
- // Set a decorator to change the Server of the handshake
- ws_.set_option(websocket::stream_base::decorator(
- [=](websocket::response_type& res)
- {
- res.set(http::field::server, user_agent_.c_str());
- }));
- // Accept the websocket handshake
- ws_.async_accept(
- beast::bind_front_handler(
- &server_session::on_accept,
- shared_from_this()));
- }
-
- void
- on_accept(beast::error_code ec)
- {
- if (ec)
- return ;
-
- // Read a message
- // Read a message into our buffer
- ws_.async_read(
- buffer_,
- beast::bind_front_handler(
- &server_session::on_read,
- shared_from_this()));
- }
-
-
-
- void
- on_read(
- beast::error_code ec,
- std::size_t bytes_transferred)
- {
-
- if(!ec)
- {
- char* data = reinterpret_cast<char*>(buffer_.data().data());
- std::vector<char> elements(data, data + bytes_transferred);
-
- buffer_.clear();
- proxy_->on_request.EnqueueAll(std::move(elements), false);
-
- // Read a message into our buffer
- ws_.async_read(
- buffer_,
- beast::bind_front_handler(
- &server_session::on_read,
- shared_from_this()));
- return;
- }
- if (ec){
- proxy_->error_message = ec.message();
- }
- }
-
-
-
- void close()
- {
- if(ws_.is_open())
- {
- boost::system::error_code ec;
- ws_.close(websocket::close_code::normal, ec);
- }
-
- }
- };
-
- //------------------------------------------------------------------------------
-
- struct WebSocketServer::Data
- {
- Data(const std::string& user_agent, lsp::Log& log) :
- acceptor_(io_context_), user_agent_(user_agent), _log(log)
-
- {
- }
-
- ~Data()
- {
-
- }
- /// The io_context used to perform asynchronous operations.
- boost::asio::io_context io_context_;
-
- std::shared_ptr<boost::asio::io_service::work> work;
-
- /// Acceptor used to listen for incoming connections.
- boost::asio::ip::tcp::acceptor acceptor_;
-
- std::shared_ptr < server_session> _server_session;
-
- std::string user_agent_;
- lsp::Log& _log;
-
- };
-
- websocket_stream_wrapper::websocket_stream_wrapper(boost::beast::websocket::stream<boost::beast::tcp_stream>& _w):
- ws_(_w), request_waiter(new MultiQueueWaiter()),
- on_request(request_waiter)
- {
- }
-
- bool websocket_stream_wrapper::fail()
- {
- return bad();
- }
-
- bool websocket_stream_wrapper::eof()
- {
- return bad();
- }
-
- bool websocket_stream_wrapper::good()
- {
- return !bad();
- }
-
- websocket_stream_wrapper& websocket_stream_wrapper::read(char* str, std::streamsize count)
- {
- auto some = on_request.TryDequeueSome(static_cast<size_t>(count));
- memcpy(str,some.data(),some.size());
- for (std::streamsize i = some.size(); i < count; ++i)
- {
- str[i] = static_cast<char>(get());
- }
- return *this;
- }
-
- int websocket_stream_wrapper::get()
- {
- return on_request.Dequeue();
- }
-
- bool websocket_stream_wrapper::bad()
- {
- return !ws_.next_layer().socket().is_open();
- }
-
- websocket_stream_wrapper& websocket_stream_wrapper::write(const std::string& c)
- {
- ws_.write(boost::asio::buffer(std::string(c)));
- return *this;
- }
-
-
- websocket_stream_wrapper& websocket_stream_wrapper::write(std::streamsize _s)
- {
- std::ostringstream temp;
- temp << _s;
- ws_.write(boost::asio::buffer(temp.str()));
- return *this;
- }
-
- websocket_stream_wrapper& websocket_stream_wrapper::flush()
- {
- return *this;
- }
-
- void websocket_stream_wrapper::clear()
- {
- }
-
- std::string websocket_stream_wrapper::what()
- {
- if (!error_message.empty())
- return error_message;
-
- if (!ws_.next_layer().socket().is_open())
- {
- return "Socket is not open.";
- }
- return {};
- }
-
- WebSocketServer::~WebSocketServer()
- {
- delete d_ptr;
- }
-
- WebSocketServer::WebSocketServer(const std::string& user_agent, const std::string& address, const std::string& port,
- std::shared_ptr < MessageJsonHandler> json_handler,
- std::shared_ptr < Endpoint> localEndPoint, lsp::Log& log, uint32_t _max_workers)
- : point(json_handler,localEndPoint,log,lsp::JSONStreamStyle::Standard, _max_workers),d_ptr(new Data(user_agent,log))
-
- {
-
- d_ptr->work = std::make_shared<boost::asio::io_service::work>(d_ptr->io_context_);
-
- // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
- boost::asio::ip::tcp::resolver resolver(d_ptr->io_context_);
- boost::asio::ip::tcp::endpoint endpoint =
- *resolver.resolve(address, port).begin();
- d_ptr->acceptor_.open(endpoint.protocol());
- d_ptr->acceptor_.set_option(boost::asio::ip::tcp::acceptor::reuse_address(true));
- try
- {
- d_ptr->acceptor_.bind(endpoint);
- }
- catch (boost::system::system_error & e)
- {
- std::string temp = "Socket Server blid faild.";
- d_ptr->_log.log(lsp::Log::Level::INFO , temp + e.what());
- return;
- }
- d_ptr->acceptor_.listen();
-
- do_accept();
- std::string desc = "Socket WebSocketServer " + address + " " + port + " start.";
- d_ptr->_log.log(lsp::Log::Level::INFO, desc);
- }
-
- void WebSocketServer::run()
- {
- // The io_context::run() call will block until all asynchronous operations
- // have finished. While the WebSocketServer is running, there is always at least one
- // asynchronous operation outstanding: the asynchronous accept call waiting
- // for new incoming connections.
- d_ptr->io_context_.run();
-
- }
-
- void WebSocketServer::stop()
- {
- try
- {
- if(d_ptr->work)
- d_ptr->work.reset();
-
- do_stop();
- }
- catch (...)
- {
- }
- }
-
- void WebSocketServer::do_accept()
- {
- d_ptr->acceptor_.async_accept(
- [this](boost::system::error_code ec, boost::asio::ip::tcp::socket socket)
- {
- // Check whether the WebSocketServer was stopped by a signal before this
- // completion handler had a chance to run.
- if (!d_ptr->acceptor_.is_open())
- {
- return;
- }
- if (!ec)
- {
- if(d_ptr->_server_session)
- {
- try
- {
- d_ptr->_server_session->close();
- point.stop();
- }
- catch (...)
- {
- }
- }
- d_ptr->_server_session = std::make_shared<server_session>(std::move(socket), d_ptr->user_agent_);
- d_ptr->_server_session->run();
-
- point.startProcessingMessages(d_ptr->_server_session->proxy_, d_ptr->_server_session->proxy_);
- do_accept();
- }
-
- });
- }
-
- void WebSocketServer::do_stop()
- {
- d_ptr->acceptor_.close();
-
- point.stop();
-
- }
-
- } // namespace
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/message.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/message.cpp
deleted file mode 100644
index a9e7736cd7..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/message.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "LibLsp/JsonRpc/message.h"
-#include <rapidjson/stringbuffer.h>
-#include <rapidjson/writer.h>
-#include "LibLsp/JsonRpc/serializer.h"
-#include "LibLsp/JsonRpc/lsRequestId.h"
-#include "LibLsp/JsonRpc/RequestInMessage.h"
-#include "LibLsp/JsonRpc/Condition.h"
-#include "LibLsp/JsonRpc/json.h"
-
-void LspMessage::Write(std::ostream& out) {
- rapidjson::StringBuffer output;
- rapidjson::Writer<rapidjson::StringBuffer> writer(output);
- JsonWriter json_writer{ &writer };
- ReflectWriter(json_writer);
-
- const auto value = std::string("Content-Length: ") + std::to_string(output.GetSize()) + "\r\n\r\n" + output.GetString();
- out << value;
- out.flush();
-}
-
-std::string LspMessage::ToJson() {
- rapidjson::StringBuffer output;
- rapidjson::Writer<rapidjson::StringBuffer> writer(output);
- JsonWriter json_writer{ &writer };
- this->ReflectWriter(json_writer);
- return output.GetString();
-}
-
-void Reflect(Reader& visitor, lsRequestId& value) {
- if (visitor.IsInt()) {
- value.type = lsRequestId::kInt;
- value.value = visitor.GetInt();
- }
- else if (visitor.IsInt64()) {
- value.type = lsRequestId::kInt;
- // `lsRequestId.value` is an `int`, so we're forced to truncate.
- value.value = static_cast<int>(visitor.GetInt64());
- }
- else if (visitor.IsString()) {
- value.type = lsRequestId::kString;
- value.k_string = visitor.GetString();
- value.value = atoi(value.k_string.c_str());
-
- }
- else {
- value.type = lsRequestId::kNone;
- value.value = -1;
- }
-}
-
-void Reflect(Writer& visitor, lsRequestId& value) {
- switch (value.type) {
- case lsRequestId::kNone:
- visitor.Null();
- break;
- case lsRequestId::kInt:
- visitor.Int(value.value);
- break;
- case lsRequestId::kString:
-
- if(value.k_string.empty())
- {
- std::string str = std::to_string(value.value);
- visitor.String(str.c_str(), str.length());
- }
- else
- {
- visitor.String(value.k_string.c_str(), value.k_string.length());
- }
- break;
- }
-}
-
-std::string ToString(const lsRequestId& id) {
- if (id.type != lsRequestId::kNone)
- {
- if(id.type == lsRequestId::kString)
- {
- if (!id.k_string.empty())
- return id.k_string;
- }
- return std::to_string(id.value);
- }
-
- return "";
-}
-
-
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/serializer.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/serializer.cpp
deleted file mode 100644
index 8c5beba83e..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/serializer.cpp
+++ /dev/null
@@ -1,214 +0,0 @@
-#include "LibLsp/JsonRpc/serializer.h"
-#include <stdexcept>
-#include <rapidjson/allocators.h>
-#include "LibLsp/JsonRpc/json.h"
-
-
-
-//// Elementary types
-
-void JsonNull::swap(JsonNull& arg) noexcept
-{
-}
-
-
-void Reflect(Reader& visitor, uint8_t& value) {
- if (!visitor.IsInt())
- throw std::invalid_argument("uint8_t");
- value = (uint8_t)visitor.GetInt();
-}
-void Reflect(Writer& visitor, uint8_t& value) {
- visitor.Int(value);
-}
-
-void Reflect(Reader& visitor, short& value) {
- if (!visitor.IsInt())
- throw std::invalid_argument("short");
- value = (short)visitor.GetInt();
-}
-void Reflect(Writer& visitor, short& value) {
- visitor.Int(value);
-}
-
-void Reflect(Reader& visitor, unsigned short& value) {
- if (!visitor.IsInt())
- throw std::invalid_argument("unsigned short");
- value = (unsigned short)visitor.GetInt();
-}
-void Reflect(Writer& visitor, unsigned short& value) {
- visitor.Int(value);
-}
-
-void Reflect(Reader& visitor, int& value) {
- if (!visitor.IsInt())
- throw std::invalid_argument("int");
- value = visitor.GetInt();
-}
-void Reflect(Writer& visitor, int& value) {
- visitor.Int(value);
-}
-
-void Reflect(Reader& visitor, unsigned& value) {
- if (!visitor.IsUint64())
- throw std::invalid_argument("unsigned");
- value = visitor.GetUint32();
-}
-void Reflect(Writer& visitor, unsigned& value) {
- visitor.Uint32(value);
-}
-
-void Reflect(Reader& visitor, long& value) {
- if (!visitor.IsInt64())
- throw std::invalid_argument("long");
- value = long(visitor.GetInt64());
-}
-void Reflect(Writer& visitor, long& value) {
- visitor.Int64(value);
-}
-
-void Reflect(Reader& visitor, unsigned long& value) {
- if (!visitor.IsUint64())
- throw std::invalid_argument("unsigned long");
- value = (unsigned long)visitor.GetUint64();
-}
-void Reflect(Writer& visitor, unsigned long& value) {
- visitor.Uint64(value);
-}
-
-void Reflect(Reader& visitor, long long& value) {
- if (!visitor.IsInt64())
- throw std::invalid_argument("long long");
- value = visitor.GetInt64();
-}
-void Reflect(Writer& visitor, long long& value) {
- visitor.Int64(value);
-}
-
-void Reflect(Reader& visitor, unsigned long long& value) {
- if (!visitor.IsUint64())
- throw std::invalid_argument("unsigned long long");
- value = visitor.GetUint64();
-}
-void Reflect(Writer& visitor, unsigned long long& value) {
- visitor.Uint64(value);
-}
-
-void Reflect(Reader& visitor, double& value) {
- if (!visitor.IsNumber())
- throw std::invalid_argument("double");
- value = visitor.GetDouble();
-}
-void Reflect(Writer& visitor, double& value) {
- visitor.Double(value);
-}
-
-void Reflect(Reader& visitor, bool& value) {
- if (!visitor.IsBool())
- throw std::invalid_argument("bool");
- value = visitor.GetBool();
-}
-void Reflect(Writer& visitor, bool& value) {
- visitor.Bool(value);
-}
-
-void Reflect(Reader& visitor, std::string& value) {
- if (!visitor.IsString())
- throw std::invalid_argument("std::string");
- value = visitor.GetString();
-}
-void Reflect(Writer& visitor, std::string& value) {
- visitor.String(value.c_str(), (rapidjson::SizeType)value.size());
-}
-
-void Reflect(Reader& visitor, JsonNull& value) {
- visitor.GetNull();
-}
-
-void Reflect(Writer& visitor, JsonNull& value) {
- visitor.Null();
-}
-
-
-void Reflect(Reader& visitor, SerializeFormat& value) {
- std::string fmt = visitor.GetString();
- value = fmt[0] == 'm' ? SerializeFormat::MessagePack : SerializeFormat::Json;
-}
-
-void Reflect(Writer& visitor, SerializeFormat& value) {
- switch (value) {
- case SerializeFormat::Json:
- visitor.String("json");
- break;
- case SerializeFormat::MessagePack:
- visitor.String("msgpack");
- break;
- }
-}
-
-
-std::string JsonReader::ToString() const
-{
- rapidjson::StringBuffer strBuf;
- strBuf.Clear();
- rapidjson::Writer<rapidjson::StringBuffer> writer(strBuf);
- m_->Accept(writer);
- std::string strJson = strBuf.GetString();
- return strJson;
-}
-
-void JsonReader::IterMap(std::function<void(const char*, Reader&)> fn)
-{
- path_.push_back("0");
- for (auto& entry : m_->GetObject())
- {
- auto saved = m_;
- m_ = &(entry.value);
-
- fn(entry.name.GetString(), *this);
- m_ = saved;
- }
- path_.pop_back();
-}
-
- void JsonReader::IterArray(std::function<void(Reader&)> fn)
-{
- if (!m_->IsArray())
- throw std::invalid_argument("array");
- // Use "0" to indicate any element for now.
- path_.push_back("0");
- for (auto& entry : m_->GetArray())
- {
- auto saved = m_;
- m_ = &entry;
- fn(*this);
- m_ = saved;
- }
- path_.pop_back();
-}
-
-void JsonReader::DoMember(const char* name, std::function<void(Reader&)> fn)
-{
- path_.push_back(name);
- auto it = m_->FindMember(name);
- if (it != m_->MemberEnd())
- {
- auto saved = m_;
- m_ = &it->value;
- fn(*this);
- m_ = saved;
- }
- path_.pop_back();
-}
-
-std::string JsonReader::GetPath() const
-{
- std::string ret;
- for (auto& t : path_)
- {
- ret += '/';
- ret += t;
- }
- ret.pop_back();
- return ret;
-}
-
diff --git a/graphics/asymptote/LspCpp/src/jsonrpc/threaded_queue.cpp b/graphics/asymptote/LspCpp/src/jsonrpc/threaded_queue.cpp
deleted file mode 100644
index 1f9a02ac0d..0000000000
--- a/graphics/asymptote/LspCpp/src/jsonrpc/threaded_queue.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "LibLsp/JsonRpc/threaded_queue.h"
-
-// static
-bool MultiQueueWaiter::HasState(
- std::initializer_list<BaseThreadQueue*> queues) {
- for (BaseThreadQueue* queue : queues) {
- if (!queue->IsEmpty())
- return true;
- }
- return false;
-}
-
-bool MultiQueueWaiter::ValidateWaiter(
- std::initializer_list<BaseThreadQueue*> queues) {
- for (BaseThreadQueue* queue : queues) {
- if (queue->waiter.get() != this)
- return false;
- }
- return true;
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/Markup.cpp b/graphics/asymptote/LspCpp/src/lsp/Markup.cpp
deleted file mode 100644
index f22baac95d..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/Markup.cpp
+++ /dev/null
@@ -1,942 +0,0 @@
-//===--- Markup.cpp -----------------------------------------*- C++-*------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://lsp.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-#include "LibLsp/lsp/Markup/Markup.h"
-
-#include <algorithm>
-#include <cassert>
-#include <cstddef>
-#include <iterator>
-#include <memory>
-#include <string>
-#include <vector>
-#include <boost/algorithm/string.hpp>
-
-namespace lsp {
-
- /// hexdigit - Return the hexadecimal character for the
- /// given number \p X (which should be less than 16).
- inline char hexdigit(unsigned X, bool LowerCase = false) {
- const char HexChar = LowerCase ? 'a' : 'A';
- return X < 10 ? '0' + X : HexChar + X - 10;
- }
-
- /// Given an array of c-style strings terminated by a null pointer, construct
- /// a vector of StringRefs representing the same strings without the terminating
- /// null string.
- inline std::vector< std::string_ref> toStringRefArray(const char* const* Strings) {
- std::vector< std::string_ref> Result;
- while (*Strings)
- Result.push_back(*Strings++);
- return Result;
- }
-
- /// Construct a string ref from a boolean.
- inline std::string_ref toStringRef(bool B) { return std::string_ref(B ? "true" : "false"); }
-
- /// Construct a string ref from an array ref of unsigned chars.
- inline std::string_ref toStringRef(const std::vector<uint8_t>& Input) {
- return std::string_ref(Input.begin(), Input.end());
- }
-
- /// Construct a string ref from an array ref of unsigned chars.
- inline std::vector<uint8_t> arrayRefFromStringRef(const std::string_ref& Input) {
- return { Input.begin(), Input.end() };
- }
-
- /// Interpret the given character \p C as a hexadecimal digit and return its
- /// value.
- ///
- /// If \p C is not a valid hex digit, -1U is returned.
- inline unsigned hexDigitValue(char C) {
- struct HexTable {
- unsigned LUT[255] = {};
- constexpr HexTable() {
- // Default initialize everything to invalid.
- for (int i = 0; i < 255; ++i)
- LUT[i] = ~0U;
- // Initialize `0`-`9`.
- for (int i = 0; i < 10; ++i)
- LUT['0' + i] = i;
- // Initialize `A`-`F` and `a`-`f`.
- for (int i = 0; i < 6; ++i)
- LUT['A' + i] = LUT['a' + i] = 10 + i;
- }
- };
- constexpr HexTable Table;
- return Table.LUT[static_cast<unsigned char>(C)];
- }
-
- /// Checks if character \p C is one of the 10 decimal digits.
- inline bool isDigit(char C) { return C >= '0' && C <= '9'; }
-
- /// Checks if character \p C is a hexadecimal numeric character.
- inline bool isHexDigit(char C) { return hexDigitValue(C) != ~0U; }
-
- /// Checks if character \p C is a valid letter as classified by "C" locale.
- inline bool isAlpha(char C) {
- return ('a' <= C && C <= 'z') || ('A' <= C && C <= 'Z');
- }
-
- /// Checks whether character \p C is either a decimal digit or an uppercase or
- /// lowercase letter as classified by "C" locale.
- inline bool isAlnum(char C) { return isAlpha(C) || isDigit(C); }
-
- /// Checks whether character \p C is valid ASCII (high bit is zero).
- inline bool isASCII(char C) { return static_cast<unsigned char>(C) <= 127; }
-
- /// Checks whether all characters in S are ASCII.
- inline bool isASCII(std::string_ref S) {
- for (char C : S)
- {
- if(!isASCII(C))return true;
- }
- return true;
- }
-
- /// Checks whether character \p C is printable.
- ///
- /// Locale-independent version of the C standard library isprint whose results
- /// may differ on different platforms.
- inline bool isPrint(char C) {
- unsigned char UC = static_cast<unsigned char>(C);
- return (0x20 <= UC) && (UC <= 0x7E);
- }
-
- /// Checks whether character \p C is whitespace in the "C" locale.
- ///
- /// Locale-independent version of the C standard library isspace.
- inline bool isSpace(char C) {
- return C == ' ' || C == '\f' || C == '\n' || C == '\r' || C == '\t' ||
- C == '\v';
- }
-
- /// Returns the corresponding lowercase character if \p x is uppercase.
- inline char toLower(char x) {
- if (x >= 'A' && x <= 'Z')
- return x - 'A' + 'a';
- return x;
- }
-
- /// Returns the corresponding uppercase character if \p x is lowercase.
- inline char toUpper(char x) {
- if (x >= 'a' && x <= 'z')
- return x - 'a' + 'A';
- return x;
- }
-
- inline std::string utohexstr(uint64_t X, bool LowerCase = false) {
- char Buffer[17];
- char* BufPtr = std::end(Buffer);
-
- if (X == 0) *--BufPtr = '0';
-
- while (X) {
- unsigned char Mod = static_cast<unsigned char>(X) & 15;
- *--BufPtr = hexdigit(Mod, LowerCase);
- X >>= 4;
- }
-
- return std::string(BufPtr, std::end(Buffer));
- }
-
- /// Convert buffer \p Input to its hexadecimal representation.
- /// The returned string is double the size of \p Input.
- inline std::string toHex( std::string_ref Input, bool LowerCase = false) {
- static const char* const LUT = "0123456789ABCDEF";
- const uint8_t Offset = LowerCase ? 32 : 0;
- size_t Length = Input.size();
-
- std::string Output;
- Output.reserve(2 * Length);
- for (size_t i = 0; i < Length; ++i) {
- const unsigned char c = Input[i];
- Output.push_back(LUT[c >> 4] | Offset);
- Output.push_back(LUT[c & 15] | Offset);
- }
- return Output;
- }
-
- inline std::string toHex(std::vector<uint8_t> Input, bool LowerCase = false) {
- return toHex(toStringRef(Input), LowerCase);
- }
-
- /// Store the binary representation of the two provided values, \p MSB and
- /// \p LSB, that make up the nibbles of a hexadecimal digit. If \p MSB or \p LSB
- /// do not correspond to proper nibbles of a hexadecimal digit, this method
- /// returns false. Otherwise, returns true.
- inline bool tryGetHexFromNibbles(char MSB, char LSB, uint8_t& Hex) {
- unsigned U1 = hexDigitValue(MSB);
- unsigned U2 = hexDigitValue(LSB);
- if (U1 == ~0U || U2 == ~0U)
- return false;
-
- Hex = static_cast<uint8_t>((U1 << 4) | U2);
- return true;
- }
-
- /// Return the binary representation of the two provided values, \p MSB and
- /// \p LSB, that make up the nibbles of a hexadecimal digit.
- inline uint8_t hexFromNibbles(char MSB, char LSB) {
- uint8_t Hex = 0;
- bool GotHex = tryGetHexFromNibbles(MSB, LSB, Hex);
- (void)GotHex;
- assert(GotHex && "MSB and/or LSB do not correspond to hex digits");
- return Hex;
- }
-
- /// Convert hexadecimal string \p Input to its binary representation and store
- /// the result in \p Output. Returns true if the binary representation could be
- /// converted from the hexadecimal string. Returns false if \p Input contains
- /// non-hexadecimal digits. The output string is half the size of \p Input.
- inline bool tryGetFromHex( std::string_ref Input, std::string& Output) {
- if (Input.empty())
- return true;
-
- Output.reserve((Input.size() + 1) / 2);
- if (Input.size() % 2 == 1) {
- uint8_t Hex = 0;
- if (!tryGetHexFromNibbles('0', Input.front(), Hex))
- return false;
-
- Output.push_back(Hex);
- Input = Input.drop_front();
- }
-
- assert(Input.size() % 2 == 0);
- while (!Input.empty()) {
- uint8_t Hex = 0;
- if (!tryGetHexFromNibbles(Input[0], Input[1], Hex))
- return false;
-
- Output.push_back(Hex);
- Input = Input.drop_front(2);
- }
- return true;
- }
-
- /// Convert hexadecimal string \p Input to its binary representation.
- /// The return string is half the size of \p Input.
- inline std::string fromHex( std::string_ref Input) {
- std::string Hex;
- bool GotHex = tryGetFromHex(Input, Hex);
- (void)GotHex;
- assert(GotHex && "Input contains non hex digits");
- return Hex;
- }
-
-
-
- inline std::string utostr(uint64_t X, bool isNeg = false) {
- char Buffer[21];
- char* BufPtr = std::end(Buffer);
-
- if (X == 0) *--BufPtr = '0'; // Handle special case...
-
- while (X) {
- *--BufPtr = '0' + char(X % 10);
- X /= 10;
- }
-
- if (isNeg) *--BufPtr = '-'; // Add negative sign...
- return std::string(BufPtr, std::end(Buffer));
- }
-
- inline std::string itostr(int64_t X) {
- if (X < 0)
- return utostr(static_cast<uint64_t>(1) + ~static_cast<uint64_t>(X), true);
- else
- return utostr(static_cast<uint64_t>(X));
- }
-
- /// StrInStrNoCase - Portable version of strcasestr. Locates the first
- /// occurrence of string 's1' in string 's2', ignoring case. Returns
- /// the offset of s2 in s1 or npos if s2 cannot be found.
- std::string_ref::size_type StrInStrNoCase( std::string_ref s1, std::string_ref s2);
-
- /// getToken - This function extracts one token from source, ignoring any
- /// leading characters that appear in the Delimiters string, and ending the
- /// token at any of the characters that appear in the Delimiters string. If
- /// there are no tokens in the source string, an empty string is returned.
- /// The function returns a pair containing the extracted token and the
- /// remaining tail string.
- std::pair< std::string_ref, std::string_ref> getToken( std::string_ref Source,
- std::string_ref Delimiters = " \t\n\v\f\r");
-
-
-
- /// Returns the English suffix for an ordinal integer (-st, -nd, -rd, -th).
- inline std::string_ref getOrdinalSuffix(unsigned Val) {
- // It is critically important that we do this perfectly for
- // user-written sequences with over 100 elements.
- switch (Val % 100) {
- case 11:
- case 12:
- case 13:
- return "th";
- default:
- switch (Val % 10) {
- case 1: return "st";
- case 2: return "nd";
- case 3: return "rd";
- default: return "th";
- }
- }
- }
-
- namespace detail {
-
- template <typename IteratorT>
- inline std::string join_impl(IteratorT Begin, IteratorT End,
- std::string_ref Separator, std::input_iterator_tag) {
- std::string S;
- if (Begin == End)
- return S;
-
- S += (*Begin);
- while (++Begin != End) {
- S += Separator;
- S += (*Begin);
- }
- return S;
- }
-
- template <typename IteratorT>
- inline std::string join_impl(IteratorT Begin, IteratorT End,
- std::string_ref Separator, std::forward_iterator_tag) {
- std::string S;
- if (Begin == End)
- return S;
-
- size_t Len = (std::distance(Begin, End) - 1) * Separator.size();
- for (IteratorT I = Begin; I != End; ++I)
- Len += (*I).size();
- S.reserve(Len);
- size_t PrevCapacity = S.capacity();
- (void)PrevCapacity;
- S += (*Begin);
- while (++Begin != End) {
- S += Separator;
- S += (*Begin);
- }
- assert(PrevCapacity == S.capacity() && "String grew during building");
- return S;
- }
-
- template <typename Sep>
- inline void join_items_impl(std::string& Result, Sep Separator) {}
-
- template <typename Sep, typename Arg>
- inline void join_items_impl(std::string& Result, Sep Separator,
- const Arg& Item) {
- Result += Item;
- }
-
- template <typename Sep, typename Arg1, typename... Args>
- inline void join_items_impl(std::string& Result, Sep Separator, const Arg1& A1,
- Args &&... Items) {
- Result += A1;
- Result += Separator;
- join_items_impl(Result, Separator, std::forward<Args>(Items)...);
- }
-
- inline size_t join_one_item_size(char) { return 1; }
- inline size_t join_one_item_size(const char* S) { return S ? ::strlen(S) : 0; }
-
- template <typename T> inline size_t join_one_item_size(const T& Str) {
- return Str.size();
- }
-
- inline size_t join_items_size() { return 0; }
-
- template <typename A1> inline size_t join_items_size(const A1& A) {
- return join_one_item_size(A);
- }
- template <typename A1, typename... Args>
- inline size_t join_items_size(const A1& A, Args &&... Items) {
- return join_one_item_size(A) + join_items_size(std::forward<Args>(Items)...);
- }
-
- } // end namespace detail
-
- /// Joins the strings in the range [Begin, End), adding Separator between
- /// the elements.
- template <typename IteratorT>
- inline std::string join(IteratorT Begin, IteratorT End, std::string_ref Separator) {
- using tag = typename std::iterator_traits<IteratorT>::iterator_category;
- return detail::join_impl(Begin, End, Separator, tag());
- }
-
- /// Joins the strings in the range [R.begin(), R.end()), adding Separator
- /// between the elements.
- template <typename Range>
- inline std::string join(Range&& R, std::string_ref Separator) {
- return join(R.begin(), R.end(), Separator);
- }
-
- /// Joins the strings in the parameter pack \p Items, adding \p Separator
- /// between the elements. All arguments must be implicitly convertible to
- /// std::string, or there should be an overload of std::string::operator+=()
- /// that accepts the argument explicitly.
- template <typename Sep, typename... Args>
- inline std::string join_items(Sep Separator, Args &&... Items) {
- std::string Result;
- if (sizeof...(Items) == 0)
- return Result;
-
- size_t NS = detail::join_one_item_size(Separator);
- size_t NI = detail::join_items_size(std::forward<Args>(Items)...);
- Result.reserve(NI + (sizeof...(Items) - 1) * NS + 1);
- detail::join_items_impl(Result, Separator, std::forward<Args>(Items)...);
- return Result;
- }
-
- /// A helper class to return the specified delimiter string after the first
- /// invocation of operator std::string_ref(). Used to generate a comma-separated
- /// list from a loop like so:
- ///
- /// \code
- /// ListSeparator LS;
- /// for (auto &I : C)
- /// OS << LS << I.getName();
- /// \end
- class ListSeparator {
- bool First = true;
- std::string_ref Separator;
-
- public:
- ListSeparator( std::string_ref Separator = ", ") : Separator(Separator) {}
- operator std::string_ref() {
- if (First) {
- First = false;
- return {};
- }
- return Separator;
- }
- };
-
-} // end namespace lsp
-
-namespace lsp{
-
-// Is <contents a plausible start to an HTML tag?
-// Contents may not be the rest of the line, but it's the rest of the plain
-// text, so we expect to see at least the tag name.
-bool looksLikeTag(std::string_ref& Contents) {
- if (Contents.empty())
- return false;
- if (Contents.front() == '!' || Contents.front() == '?' ||
- Contents.front() == '/')
- return true;
- // Check the start of the tag name.
- if (!lsp::isAlpha(Contents.front()))
- return false;
- // Drop rest of the tag name, and following whitespace.
- Contents = Contents
- .drop_while([](char C) {
- return lsp::isAlnum(C) || C == '-' || C == '_' || C == ':';
- })
- .drop_while(lsp::isSpace);
- // The rest of the tag consists of attributes, which have restrictive names.
- // If we hit '=', all bets are off (attribute values can contain anything).
- for (; !Contents.empty(); Contents = Contents.drop_front()) {
- if (lsp::isAlnum(Contents.front()) || lsp::isSpace(Contents.front()))
- continue;
- if (Contents.front() == '>' || Contents.start_with("/>"))
- return true; // May close the tag.
- if (Contents.front() == '=')
- return true; // Don't try to parse attribute values.
- return false; // Random punctuation means this isn't a tag.
- }
- return true; // Potentially incomplete tag.
-}
-
-// Tests whether C should be backslash-escaped in markdown.
-// The string being escaped is Before + C + After. This is part of a paragraph.
-// StartsLine indicates whether `Before` is the start of the line.
-// After may not be everything until the end of the line.
-//
-// It's always safe to escape punctuation, but want minimal escaping.
-// The strategy is to escape the first character of anything that might start
-// a markdown grammar construct.
-bool needsLeadingEscape(char C, std::string_ref Before, std::string_ref After,
- bool StartsLine) {
-
- auto RulerLength = [&]() -> /*Length*/ unsigned {
- if (!StartsLine || !Before.empty())
- return false;
- std::string_ref A = After.trim_right();
- return std::all_of(A.begin(),A.end(), [C](char D) { return C == D; }) ? 1 + A.size() : 0;
- };
- auto IsBullet = [&]() {
- return StartsLine && Before.empty() &&
- (After.empty() || After.start_with(" "));
- };
- auto SpaceSurrounds = [&]() {
- return (After.empty() || std::isspace(After.front())) &&
- (Before.empty() || std::isspace(Before.back()));
- };
-
- auto WordSurrounds = [&]() {
- return (!After.empty() && std::isalnum(After.front())) &&
- (!Before.empty() && std::isalnum(Before.back()));
- };
-
- switch (C) {
- case '\\': // Escaped character.
- return true;
- case '`': // Code block or inline code
- // Any number of backticks can delimit an inline code block that can end
- // anywhere (including on another line). We must escape them all.
- return true;
- case '~': // Code block
- return StartsLine && Before.empty() && After.start_with("~~");
- case '#': { // ATX heading.
- if (!StartsLine || !Before.empty())
- return false;
- std::string_ref& Rest = After.trim_left(C);
- return Rest.empty() || Rest.start_with(" ");
- }
- case ']': // Link or link reference.
- // We escape ] rather than [ here, because it's more constrained:
- // ](...) is an in-line link
- // ]: is a link reference
- // The following are only links if the link reference exists:
- // ] by itself is a shortcut link
- // ][...] is an out-of-line link
- // Because we never emit link references, we don't need to handle these.
- return After.start_with(":") || After.start_with("(");
- case '=': // Setex heading.
- return RulerLength() > 0;
- case '_': // Horizontal ruler or matched delimiter.
- if (RulerLength() >= 3)
- return true;
- // Not a delimiter if surrounded by space, or inside a word.
- // (The rules at word boundaries are subtle).
- return !(SpaceSurrounds() || WordSurrounds());
- case '-': // Setex heading, horizontal ruler, or bullet.
- if (RulerLength() > 0)
- return true;
- return IsBullet();
- case '+': // Bullet list.
- return IsBullet();
- case '*': // Bullet list, horizontal ruler, or delimiter.
- return IsBullet() || RulerLength() >= 3 || !SpaceSurrounds();
- case '<': // HTML tag (or autolink, which we choose not to escape)
- return looksLikeTag(After);
- case '>': // Quote marker. Needs escaping at start of line.
- return StartsLine && Before.empty();
- case '&': { // HTML entity reference
- auto End = After.find(';');
- if (End == std::string_ref::npos)
- return false;
- std::string_ref Content = After.substr(0, End);
- if (Content.consume_front("#"))
- {
- if (Content.consume_front("x") || Content.consume_front("X"))
- {
- return std::all_of(Content.begin(),Content.end(), lsp::isHexDigit);
- }
-
- return std::all_of(Content.begin(), Content.end(), [](char c)
- {
- return lsp::isDigit(c);
- });
- }
- return std::all_of(Content.begin(), Content.end(), [](char c)
- {
- return lsp::isAlpha(c);
- });
- }
- case '.': // Numbered list indicator. Escape 12. -> 12\. at start of line.
- case ')':
- return StartsLine && !Before.empty() &&
- std::all_of(Before.begin(), Before.end(), [](char c)
- {
- return lsp::isDigit(c);
- }) && After.start_with(" ");
- default:
- return false;
- }
-}
-
-/// Escape a markdown text block. Ensures the punctuation will not introduce
-/// any of the markdown constructs.
- std::string_ref renderText(const std::string_ref& Input, bool StartsLine) {
- std::string_ref R;
- for (unsigned I = 0; I < Input.size(); ++I) {
- if (needsLeadingEscape(Input[I], Input.substr(0, I), Input.substr(I + 1),
- StartsLine))
- R.push_back('\\');
- R.push_back(Input[I]);
- }
- return R;
-}
-
-/// Renders \p Input as an inline block of code in markdown. The returned value
-/// is surrounded by backticks and the inner contents are properly escaped.
- std::string_ref renderInlineBlock(const std::string_ref& Input) {
- std::string_ref R;
- // Double all backticks to make sure we don't close the inline block early.
- for (size_t From = 0; From < Input.size();) {
- size_t Next = Input.find("`", From);
- R += Input.substr(From, Next - From);
- if (Next == std::string_ref::npos)
- break;
- R += "``"; // double the found backtick.
-
- From = Next + 1;
- }
- // If results starts with a backtick, add spaces on both sides. The spaces
- // are ignored by markdown renderers.
- if (std::string_ref(R).start_with("`") || std::string_ref(R).end_with("`"))
- return "` " + std::move(R) + " `";
- // Markdown render should ignore first and last space if both are there. We
- // add an extra pair of spaces in that case to make sure we render what the
- // user intended.
- if (std::string_ref(R).start_with(" ") && std::string_ref(R).end_with(" "))
- return "` " + std::move(R) + " `";
- return "`" + std::move(R) + "`";
-}
-
-/// Get marker required for \p Input to represent a markdown codeblock. It
-/// consists of at least 3 backticks(`). Although markdown also allows to use
-/// tilde(~) for code blocks, they are never used.
- std::string_ref getMarkerForCodeBlock(const std::string_ref& Input) {
- // Count the maximum number of consecutive backticks in \p Input. We need to
- // start and end the code block with more.
- unsigned MaxBackticks = 0;
- unsigned Backticks = 0;
- for (char C : Input) {
- if (C == '`') {
- ++Backticks;
- continue;
- }
- MaxBackticks = std::max(MaxBackticks, Backticks);
- Backticks = 0;
- }
- MaxBackticks = std::max(Backticks, MaxBackticks);
- // Use the corresponding number of backticks to start and end a code block.
- return std::string_ref(/*Repeat=*/std::max(3u, MaxBackticks + 1), '`');
-}
-
- /// SplitString - Split up the specified string according to the specified
-/// delimiters, appending the result fragments to the output list.
- void SplitString(const std::string& Source,
- std::vector<std::string_ref>& OutFragments,
- std::string Delimiters = " \t\n\v\f\r")
-{
- boost::split(OutFragments, Source, boost::is_any_of(Delimiters));
-}
-
-
-// Trims the input and concatenates whitespace blocks into a single ` `.
- std::string_ref canonicalizeSpaces(const std::string_ref& Input) {
- std::vector<std::string_ref> Words;
- SplitString(Input, Words);
-
- return lsp::join(Words, " ");
-}
-
-
- std::string_ref renderBlocks( std::vector<Block*>&& Children,
- void (Block::* RenderFunc)(std::ostringstream&) const) {
- std::string_ref R;
- std::ostringstream OS(R);
-
- std::vector<int> v{ 1, 2, 3 };
-
- // Trim rulers.
- Children.erase(std::remove_if(Children.begin(), Children.end(), [](const Block* C)
- {
- return C->isRuler();
- }), Children.end());
-
- bool LastBlockWasRuler = true;
- for (const auto& C : Children) {
- if (C->isRuler() && LastBlockWasRuler)
- continue;
- LastBlockWasRuler = C->isRuler();
- ((*C).*RenderFunc)(OS);
- }
-
- // Get rid of redundant empty lines introduced in plaintext while imitating
- // padding in markdown.
- std::string_ref AdjustedResult;
- std::string_ref TrimmedText(OS.str());
- TrimmedText = TrimmedText.trim();
-
- std::copy_if(TrimmedText.begin(), TrimmedText.end(),
- std::back_inserter(AdjustedResult),
- [&TrimmedText](const char& C) {
- return !std::string_ref(TrimmedText.data(),
- &C - TrimmedText.data() + 1)
- // We allow at most two newlines.
- .end_with("\n\n\n");
- });
-
- return AdjustedResult;
- };
- std::string_ref renderBlocks(const std::vector<std::unique_ptr<Block> >& children,
- void (Block::* renderFunc)(std::ostringstream&) const)
- {
- std::vector<Block*> temp(children.size(), nullptr);
- for(size_t i = 0 ; i < children.size() ; ++i)
- {
- temp[i]=(children[i].get());
- }
- return renderBlocks(std::move(temp), renderFunc);
- }
-// Separates two blocks with extra spacing. Note that it might render strangely
-// in vscode if the trailing block is a codeblock, see
-// https://github.com/microsoft/vscode/issues/88416 for details.
-class Ruler : public Block {
-public:
- void renderMarkdown(std::ostringstream &OS) const override {
- // Note that we need an extra new line before the ruler, otherwise we might
- // make previous block a title instead of introducing a ruler.
- OS << "\n---\n";
- }
- void renderPlainText(std::ostringstream &OS) const override { OS << '\n'; }
- std::unique_ptr<Block> clone() const override {
- return std::make_unique<Ruler>(*this);
- }
- bool isRuler() const override { return true; }
-};
-
-class CodeBlock : public Block {
-public:
- void renderMarkdown(std::ostringstream &OS) const override {
- std::string_ref Marker = getMarkerForCodeBlock(Contents);
- // No need to pad from previous blocks, as they should end with a new line.
- OS << Marker << Language << '\n' << Contents << '\n' << Marker << '\n';
- }
-
- void renderPlainText(std::ostringstream &OS) const override {
- // In plaintext we want one empty line before and after codeblocks.
- OS << '\n' << Contents << "\n\n";
- }
-
- std::unique_ptr<Block> clone() const override {
- return std::make_unique<CodeBlock>(*this);
- }
-
- CodeBlock( std::string_ref Contents, std::string_ref Language)
- : Contents(std::move(Contents)), Language(std::move(Language)) {}
-
-private:
-
- std::string_ref Contents;
- std::string_ref Language;
-};
-
-// Inserts two spaces after each `\n` to indent each line. First line is not
-// indented.
- std::string_ref indentLines(const std::string_ref& Input) {
- assert(!Input.end_with("\n") && "Input should've been trimmed.");
- std::string_ref IndentedR;
- // We'll add 2 spaces after each new line.
- IndentedR.reserve(Input.size() + Input.count("\n") * 2);
- for (char C : Input) {
- IndentedR += C;
- if (C == '\n')
- IndentedR.append(" ");
- }
- return IndentedR;
-}
-
-class Heading : public Paragraph {
-public:
- Heading(size_t Level) : Level(Level) {}
- void renderMarkdown(std::ostringstream &OS) const override {
- OS << std::string_ref(Level, '#') << ' ';
- Paragraph::renderMarkdown(OS);
- }
-
-private:
- size_t Level;
-};
-
-
-
-
-
- std::string_ref Block::asMarkdown() const {
- std::string_ref R;
- std::ostringstream OS(R);
- renderMarkdown(OS);
- return std::string_ref(OS.str()).trim();
-}
-
- std::string_ref Block::asPlainText() const {
- std::string_ref R;
- std::ostringstream OS(R);
- renderPlainText(OS);
- return std::string_ref(OS.str()).trim().c_str();
-}
-
- void Paragraph::renderMarkdown(std::ostringstream& OS) const {
- bool NeedsSpace = false;
- bool HasChunks = false;
- for (auto& C : Chunks) {
- if (C.SpaceBefore || NeedsSpace)
- OS << " ";
- switch (C.Kind) {
- case Chunk::PlainText:
- OS << renderText(C.Contents, !HasChunks);
- break;
- case Chunk::InlineCode:
- OS << renderInlineBlock(C.Contents);
- break;
- }
- HasChunks = true;
- NeedsSpace = C.SpaceAfter;
- }
- // Paragraphs are translated into markdown lines, not markdown paragraphs.
- // Therefore it only has a single linebreak afterwards.
- // VSCode requires two spaces at the end of line to start a new one.
- OS << " \n";
- }
-
- std::unique_ptr<Block> Paragraph::clone() const {
- return std::make_unique<Paragraph>(*this);
- }
-
- /// Choose a marker to delimit `Text` from a prioritized list of options.
- /// This is more readable than escaping for plain-text.
- std::string_ref chooseMarker(std::vector<std::string_ref> Options,
- const std::string_ref& Text)
- {
- // Prefer a delimiter whose characters don't appear in the text.
- for (std::string_ref& S : Options)
- if (Text.find_first_of(S) == std::string_ref::npos)
- return S;
- return Options.front();
- }
-
- void Paragraph::renderPlainText(std::ostringstream& OS) const {
- bool NeedsSpace = false;
- for (auto& C : Chunks) {
- if (C.SpaceBefore || NeedsSpace)
- OS << " ";
- std::string_ref Marker = "";
- if (C.Preserve && C.Kind == Chunk::InlineCode)
- Marker = chooseMarker({ "`", "'", "\"" }, C.Contents);
- OS << Marker << C.Contents << Marker;
- NeedsSpace = C.SpaceAfter;
- }
- OS << '\n';
- }
-
- void BulletList::renderMarkdown(std::ostringstream& OS) const {
- for (auto& D : Items) {
- // Instead of doing this we might prefer passing Indent to children to get
- // rid of the copies, if it turns out to be a bottleneck.
-
- OS << "- ";
- OS << indentLines(D.asMarkdown()) << '\n';
- }
- // We need a new line after list to terminate it in markdown.
- OS << '\n';
- }
-
- void BulletList::renderPlainText(std::ostringstream& OS) const {
- for (auto& D : Items) {
- // Instead of doing this we might prefer passing Indent to children to get
- // rid of the copies, if it turns out to be a bottleneck.
- OS << "- " << indentLines(D.asPlainText()) << '\n';
- }
- }
-
- Paragraph& Paragraph::appendSpace() {
- if (!Chunks.empty())
- Chunks.back().SpaceAfter = true;
- return *this;
- }
-
- Paragraph& Paragraph::appendText(const std::string_ref& Text) {
- std::string_ref Norm = canonicalizeSpaces(Text);
- if (Norm.empty())
- return *this;
- Chunks.emplace_back();
- Chunk& C = Chunks.back();
- C.Contents = std::move(Norm);
- C.Kind = Chunk::PlainText;
-
- C.SpaceBefore = std::isspace(Text.front());
- C.SpaceAfter = std::isspace(Text.back());
- return *this;
- }
-
- Paragraph& Paragraph::appendCode(const std::string_ref& Code, bool Preserve) {
- bool AdjacentCode =
- !Chunks.empty() && Chunks.back().Kind == Chunk::InlineCode;
- std::string_ref Norm = canonicalizeSpaces(Code);
- if (Norm.empty())
- return *this;
- Chunks.emplace_back();
- Chunk& C = Chunks.back();
- C.Contents = std::move(Norm);
- C.Kind = Chunk::InlineCode;
- C.Preserve = Preserve;
- // Disallow adjacent code spans without spaces, markdown can't render them.
- C.SpaceBefore = AdjacentCode;
- return *this;
- }
-
- std::unique_ptr<Block> BulletList::clone() const {
- return std::make_unique<BulletList>(*this);
- }
-
- class Document& BulletList::addItem() {
- Items.emplace_back();
- return Items.back();
- }
-
- Document& Document::operator=(const Document& Other) {
- Children.clear();
- for (const auto& C : Other.Children)
- Children.push_back(C->clone());
- return *this;
- }
-
- void Document::append(Document Other) {
- std::move(Other.Children.begin(), Other.Children.end(),
- std::back_inserter(Children));
- }
-
- Paragraph& Document::addParagraph() {
- Children.push_back(std::make_unique<Paragraph>());
- return *static_cast<Paragraph*>(Children.back().get());
- }
-
- void Document::addRuler() { Children.push_back(std::make_unique<Ruler>()); }
-
- void Document::addCodeBlock(std::string_ref Code, std::string_ref Language) {
- Children.emplace_back(
- std::make_unique<CodeBlock>(std::move(Code), std::move(Language)));
- }
-
- std::string_ref Document::asMarkdown() const {
- return renderBlocks(Children, &Block::renderMarkdown);
- }
-
- std::string_ref Document::asPlainText() const {
- return renderBlocks(Children, &Block::renderPlainText);
- }
-
- BulletList& Document::addBulletList() {
- Children.emplace_back(std::make_unique<BulletList>());
- return *static_cast<BulletList*>(Children.back().get());
- }
-
- Paragraph& Document::addHeading(size_t Level) {
- assert(Level > 0);
- Children.emplace_back(std::make_unique<Heading>(Level));
- return *static_cast<Paragraph*>(Children.back().get());
- }
- };
diff --git a/graphics/asymptote/LspCpp/src/lsp/ParentProcessWatcher.cpp b/graphics/asymptote/LspCpp/src/lsp/ParentProcessWatcher.cpp
deleted file mode 100644
index c698a3157e..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/ParentProcessWatcher.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-#include "LibLsp/lsp/ParentProcessWatcher.h"
-#include <algorithm>
-#include <boost/process.hpp>
-
-#ifdef _WIN32
-#include <boost/process/windows.hpp>
-#endif
-
-#include <boost/filesystem.hpp>
-#include <boost/asio.hpp>
-#include <iostream>
-
-#include "LibLsp/lsp/ProcessIoService.h"
-#include "LibLsp/lsp/SimpleTimer.h"
-
-
-using namespace boost::asio::ip;
-using namespace std;
-
-struct ParentProcessWatcher::ParentProcessWatcherData : std::enable_shared_from_this<ParentProcessWatcherData>
-{
- std::unique_ptr<SimpleTimer<boost::posix_time::seconds>> timer;
- lsp::Log& _log;
- std::function<void()> on_exit;
- lsp::ProcessIoService asio_io;
- std::shared_ptr < boost::process::opstream> write_to_service;
- std::shared_ptr< boost::process::ipstream > read_from_service;
- int pid;
- const int _poll_delay_secs /*= 10*/;
- std::string command;
- std::shared_ptr<boost::process::child> c;
-
- ParentProcessWatcherData(lsp::Log& log, int _pid,
- const std::function<void()>&& callback, uint32_t poll_delay_secs) :
- _log(log), on_exit(callback), pid(_pid), _poll_delay_secs(poll_delay_secs)
- {
-#ifdef _WIN32
- command = "cmd /c \"tasklist /FI \"PID eq " + std::to_string(pid) + "\" | findstr " +
- std::to_string(pid) + "\"";
-#else
- command = "ps -p " + std::to_string(pid);
-#endif
-
- }
-
- void run()
- {
- write_to_service = std::make_shared<boost::process::opstream>();
- read_from_service = std::make_shared<boost::process::ipstream>();
-
-// const uint32_t POLL_DELAY_SECS = _poll_delay_secs;
- auto self(shared_from_this());
- std::error_code ec;
- namespace bp = boost::process;
- c = std::make_shared<bp::child>(asio_io.getIOService(), command,
- ec,
-#ifdef _WIN32
- bp::windows::hide,
-#endif
- bp::std_out > *read_from_service,
- bp::std_in < *write_to_service,
- bp::on_exit([self](int exit_code, const std::error_code& ec_in) {
- // the tasklist command should return 0 (parent process exists) or 1 (parent process doesn't exist)
- if (exit_code == 1)//
- {
- if (self->on_exit)
- {
-
- std::thread([=]()
- {
- std::this_thread::sleep_for(std::chrono::seconds(3));
- self->on_exit();
- }).detach();
- }
- }
- else
- {
- if (exit_code > 1)
- {
- self->_log.log(lsp::Log::Level::WARNING, "The tasklist command: '" + self->command + "' returns " + std::to_string(exit_code));
- }
-
- self->timer = std::make_unique<SimpleTimer<boost::posix_time::seconds>>(self->_poll_delay_secs, [=]() {
- self->run();
- });
- }
-
- }));
- if (ec)
- {
- // fail
- _log.log(lsp::Log::Level::SEVERE, "Start parent process watcher failed.");
- }
- }
-};
-
-ParentProcessWatcher::ParentProcessWatcher(lsp::Log& log, int pid,
- const std::function<void()>&& callback, uint32_t poll_delay_secs) : d_ptr(new ParentProcessWatcherData(log, pid, std::move(callback), poll_delay_secs))
-{
- d_ptr->run();
-}
-
-ParentProcessWatcher::~ParentProcessWatcher()
-{
- if (d_ptr->timer)
- d_ptr->timer->Stop();
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/ProtocolJsonHandler.cpp b/graphics/asymptote/LspCpp/src/lsp/ProtocolJsonHandler.cpp
deleted file mode 100644
index c860b555af..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/ProtocolJsonHandler.cpp
+++ /dev/null
@@ -1,716 +0,0 @@
-#include "LibLsp/lsp/ProtocolJsonHandler.h"
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/lsp/general/shutdown.h"
-#include "LibLsp/lsp/textDocument/code_action.h"
-#include "LibLsp/lsp/textDocument/code_lens.h"
-#include "LibLsp/lsp/textDocument/completion.h"
-
-
-#include "LibLsp/lsp/textDocument/did_close.h"
-
-#include "LibLsp/lsp/textDocument/highlight.h"
-#include "LibLsp/lsp/textDocument/document_link.h"
-#include "LibLsp/lsp/textDocument/formatting.h"
-#include "LibLsp/lsp/textDocument/hover.h"
-#include "LibLsp/lsp/textDocument/implementation.h"
-#include "LibLsp/lsp/textDocument/range_formatting.h"
-#include "LibLsp/lsp/textDocument/references.h"
-#include "LibLsp/lsp/textDocument/rename.h"
-#include "LibLsp/lsp/textDocument/signature_help.h"
-#include "LibLsp/lsp/textDocument/type_definition.h"
-#include "LibLsp/lsp/workspace/symbol.h"
-#include "LibLsp/lsp/textDocument/typeHierarchy.h"
-#include "LibLsp/lsp/out_list.h"
-#include "LibLsp/lsp/extention/jdtls/codeActionResult.h"
-#include "LibLsp/lsp/textDocument/declaration_definition.h"
-#include "LibLsp/lsp/textDocument/resolveCompletionItem.h"
-#include "LibLsp/lsp/textDocument/resolveCodeLens.h"
-#include "LibLsp/lsp/textDocument/colorPresentation.h"
-#include "LibLsp/lsp/textDocument/foldingRange.h"
-#include "LibLsp/lsp/textDocument/prepareRename.h"
-#include "LibLsp/lsp/textDocument/resolveTypeHierarchy.h"
-#include "LibLsp/lsp/textDocument/callHierarchy.h"
-#include "LibLsp/lsp/textDocument/selectionRange.h"
-#include "LibLsp/lsp/extention/jdtls/classFileContents.h"
-#include "LibLsp/lsp/extention/jdtls/buildWorkspace.h"
-#include "LibLsp/lsp/extention/jdtls/listOverridableMethods.h"
-#include "LibLsp/lsp/extention/jdtls/addOverridableMethods.h"
-#include "LibLsp/lsp/extention/jdtls/checkHashCodeEqualsStatus.h"
-#include "LibLsp/lsp/extention/jdtls/checkConstructorsStatus.h"
-#include "LibLsp/lsp/extention/jdtls/checkDelegateMethodsStatus.h"
-#include "LibLsp/lsp/extention/jdtls/checkToStringStatus.h"
-#include "LibLsp/lsp/extention/jdtls/executeCommand.h"
-#include "LibLsp/lsp/extention/jdtls/findLinks.h"
-#include "LibLsp/lsp/extention/jdtls/generateAccessors.h"
-#include "LibLsp/lsp/extention/jdtls/generateConstructors.h"
-#include "LibLsp/lsp/extention/jdtls/generateDelegateMethods.h"
-#include "LibLsp/lsp/extention/jdtls/generateHashCodeEquals.h"
-#include "LibLsp/lsp/extention/jdtls/generateToString.h"
-#include "LibLsp/lsp/extention/jdtls/getMoveDestinations.h"
-#include "LibLsp/lsp/extention/jdtls/Move.h"
-#include "LibLsp/lsp/extention/jdtls/organizeImports.h"
-#include "LibLsp/lsp/general/exit.h"
-#include "LibLsp/lsp/general/initialized.h"
-#include "LibLsp/lsp/extention/jdtls/projectConfigurationUpdate.h"
-#include "LibLsp/lsp/textDocument/did_change.h"
-#include "LibLsp/lsp/textDocument/did_open.h"
-#include "LibLsp/lsp/textDocument/did_save.h"
-#include "LibLsp/lsp/textDocument/publishDiagnostics.h"
-#include "LibLsp/lsp/textDocument/willSave.h"
-
-#include "LibLsp/lsp/workspace/didChangeWorkspaceFolders.h"
-#include "LibLsp/lsp/workspace/did_change_configuration.h"
-#include "LibLsp/lsp/workspace/did_change_watched_files.h"
-#include "LibLsp/lsp/windows/MessageNotify.h"
-#include "LibLsp/lsp/language/language.h"
-#include "LibLsp/lsp/client/registerCapability.h"
-#include "LibLsp/lsp/client/unregisterCapability.h"
-#include "LibLsp/JsonRpc/Cancellation.h"
-#include "LibLsp/lsp/textDocument/didRenameFiles.h"
-#include "LibLsp/lsp/textDocument/semanticHighlighting.h"
-#include "LibLsp/lsp/workspace/configuration.h"
-
-
-void AddStadardResponseJsonRpcMethod(MessageJsonHandler& handler)
-{
-
- handler.method2response[td_initialize::request::kMethodInfo] = [](Reader& visitor)
- {
- if(visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_initialize::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_shutdown::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_shutdown::response::ReflectReader(visitor);
- };
- handler.method2response[td_codeAction::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_codeAction::response::ReflectReader(visitor);
- };
- handler.method2response[td_codeLens::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_codeLens::response::ReflectReader(visitor);
- };
- handler.method2response[td_completion::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_completion::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_definition::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_definition::response::ReflectReader(visitor);
- };
- handler.method2response[td_declaration::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_declaration::response::ReflectReader(visitor);
- };
- handler.method2response[td_willSaveWaitUntil::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_willSaveWaitUntil::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_highlight::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_highlight::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_links::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_links::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_linkResolve::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_linkResolve::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_symbol::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_symbol::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_formatting::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_formatting::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_hover::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_hover::response::ReflectReader(visitor);
-
- };
-
- handler.method2response[td_implementation::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_implementation::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_rangeFormatting::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_rangeFormatting::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_references::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_references::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_rename::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_rename::response::ReflectReader(visitor);
- };
-
-
- handler.method2response[td_signatureHelp::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_signatureHelp::response::ReflectReader(visitor);
- };
-
- handler.method2response[td_typeDefinition::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_typeDefinition::response::ReflectReader(visitor);
- };
-
- handler.method2response[wp_executeCommand::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return wp_executeCommand::response::ReflectReader(visitor);
- };
-
- handler.method2response[wp_symbol::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return wp_symbol::response::ReflectReader(visitor);
- };
- handler.method2response[td_typeHierarchy::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_typeHierarchy::response::ReflectReader(visitor);
- };
- handler.method2response[completionItem_resolve::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return completionItem_resolve::response::ReflectReader(visitor);
- };
-
- handler.method2response[codeLens_resolve::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return codeLens_resolve::response::ReflectReader(visitor);
-
- };
-
- handler.method2response[td_colorPresentation::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_colorPresentation::response::ReflectReader(visitor);
-
- };
- handler.method2response[td_documentColor::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_documentColor::response::ReflectReader(visitor);
-
- };
- handler.method2response[td_foldingRange::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_foldingRange::response::ReflectReader(visitor);
-
- };
- handler.method2response[td_prepareRename::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_prepareRename::response::ReflectReader(visitor);
-
- };
- handler.method2response[typeHierarchy_resolve::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return typeHierarchy_resolve::response::ReflectReader(visitor);
-
- };
-
- handler.method2response[td_selectionRange::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_selectionRange::response::ReflectReader(visitor);
-
- };
- handler.method2response[td_didRenameFiles::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_didRenameFiles::response::ReflectReader(visitor);
-
- };
- handler.method2response[td_willRenameFiles::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return td_willRenameFiles::response::ReflectReader(visitor);
-
- };
-
-}
-
-
-void AddJavaExtentionResponseJsonRpcMethod(MessageJsonHandler& handler)
-{
- handler.method2response[java_classFileContents::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_classFileContents::response::ReflectReader(visitor);
- };
- handler.method2response[java_buildWorkspace::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_buildWorkspace::response::ReflectReader(visitor);
- };
- handler.method2response[java_listOverridableMethods::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_listOverridableMethods::response::ReflectReader(visitor);
- };
- handler.method2response[java_listOverridableMethods::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_listOverridableMethods::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_checkHashCodeEqualsStatus::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_checkHashCodeEqualsStatus::response::ReflectReader(visitor);
- };
-
-
- handler.method2response[java_addOverridableMethods::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_addOverridableMethods::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_checkConstructorsStatus::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_checkConstructorsStatus::response::ReflectReader(visitor);
- };
-
-
- handler.method2response[java_checkDelegateMethodsStatus::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_checkDelegateMethodsStatus::response::ReflectReader(visitor);
- };
- handler.method2response[java_checkToStringStatus::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_checkToStringStatus::response::ReflectReader(visitor);
- };
-
-
- handler.method2response[java_generateAccessors::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateAccessors::response::ReflectReader(visitor);
- };
- handler.method2response[java_generateConstructors::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateConstructors::response::ReflectReader(visitor);
- };
- handler.method2response[java_generateDelegateMethods::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateDelegateMethods::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_generateHashCodeEquals::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateHashCodeEquals::response::ReflectReader(visitor);
- };
- handler.method2response[java_generateToString::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateToString::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_generateToString::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_generateToString::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_getMoveDestinations::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_getMoveDestinations::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_getRefactorEdit::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_getRefactorEdit::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_move::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_move::response ::ReflectReader(visitor);
- };
-
- handler.method2response[java_organizeImports::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_organizeImports::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_resolveUnimplementedAccessors::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_resolveUnimplementedAccessors::response::ReflectReader(visitor);
- };
-
- handler.method2response[java_searchSymbols::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
-
- return java_searchSymbols::response::ReflectReader(visitor);
- };
-
- handler.method2request[WorkspaceConfiguration::request::kMethodInfo] = [](Reader& visitor)
- {
- return WorkspaceConfiguration::request::ReflectReader(visitor);
- };
- handler.method2request[WorkspaceFolders::request::kMethodInfo] = [](Reader& visitor)
- {
- return WorkspaceFolders::request::ReflectReader(visitor);
- };
-
-}
-
-void AddNotifyJsonRpcMethod(MessageJsonHandler& handler)
-{
-
- handler.method2notification[Notify_Exit::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_Exit::notify::ReflectReader(visitor);
- };
- handler.method2notification[Notify_InitializedNotification::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_InitializedNotification::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[java_projectConfigurationUpdate::notify::kMethodInfo] = [](Reader& visitor)
- {
- return java_projectConfigurationUpdate::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_TextDocumentDidChange::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_TextDocumentDidChange::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_TextDocumentDidClose::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_TextDocumentDidClose::notify::ReflectReader(visitor);
- };
-
-
- handler.method2notification[Notify_TextDocumentDidOpen::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_TextDocumentDidOpen::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_TextDocumentDidSave::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_TextDocumentDidSave::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_TextDocumentPublishDiagnostics::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_TextDocumentPublishDiagnostics::notify::ReflectReader(visitor);
- };
- handler.method2notification[Notify_semanticHighlighting::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_semanticHighlighting::notify::ReflectReader(visitor);
- };
- handler.method2notification[td_willSave::notify::kMethodInfo] = [](Reader& visitor)
- {
- return td_willSave::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_LogMessage::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_LogMessage::notify::ReflectReader(visitor);
- };
- handler.method2notification[Notify_ShowMessage::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_ShowMessage::notify::ReflectReader(visitor);
- };
- handler.method2notification[Notify_WorkspaceDidChangeWorkspaceFolders::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_WorkspaceDidChangeWorkspaceFolders::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_WorkspaceDidChangeConfiguration::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_WorkspaceDidChangeConfiguration::notify::ReflectReader(visitor);
- };
-
-
- handler.method2notification[Notify_WorkspaceDidChangeWatchedFiles::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_WorkspaceDidChangeWatchedFiles::notify::ReflectReader(visitor);
- };
-
- handler.method2notification[Notify_sendNotification::notify::kMethodInfo] = [](Reader& visitor)
- {
- return Notify_sendNotification::notify::ReflectReader(visitor);
- };
- handler.method2notification[lang_status::notify::kMethodInfo] = [](Reader& visitor)
- {
- return lang_status::notify::ReflectReader(visitor);
- };
- handler.method2notification[lang_actionableNotification::notify::kMethodInfo] = [](Reader& visitor)
- {
- return lang_actionableNotification::notify::ReflectReader(visitor);
- };
- handler.method2notification[lang_progressReport::notify::kMethodInfo] = [](Reader& visitor)
- {
- return lang_progressReport::notify::ReflectReader(visitor);
- };
- handler.method2notification[lang_eventNotification::notify::kMethodInfo] = [](Reader& visitor)
- {
- return lang_eventNotification::notify::ReflectReader(visitor);
- };
-}
-
-void AddRequstJsonRpcMethod(MessageJsonHandler& handler)
-{
- handler.method2request[Req_ClientRegisterCapability::request::kMethodInfo]= [](Reader& visitor)
- {
-
- return Req_ClientRegisterCapability::request::ReflectReader(visitor);
- };
- handler.method2request[Req_ClientUnregisterCapability::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return Req_ClientUnregisterCapability::request::ReflectReader(visitor);
- };
-}
-
-void AddStandardRequestJsonRpcMethod(MessageJsonHandler& handler)
-{
-
- handler.method2request[td_initialize::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_initialize::request::ReflectReader(visitor);
- };
- handler.method2request[td_shutdown::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_shutdown::request::ReflectReader(visitor);
- };
- handler.method2request[td_codeAction::request::kMethodInfo] = [](Reader& visitor)
- {
-
-
- return td_codeAction::request::ReflectReader(visitor);
- };
- handler.method2request[td_codeLens::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_codeLens::request::ReflectReader(visitor);
- };
- handler.method2request[td_completion::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_completion::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_definition::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_definition::request::ReflectReader(visitor);
- };
- handler.method2request[td_declaration::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_declaration::request::ReflectReader(visitor);
- };
- handler.method2request[td_willSaveWaitUntil::request::kMethodInfo] = [](Reader& visitor)
- {
- if (visitor.HasMember("error"))
- return Rsp_Error::ReflectReader(visitor);
- return td_willSaveWaitUntil::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_highlight::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_highlight::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_links::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_links::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_linkResolve::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_linkResolve::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_symbol::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_symbol::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_formatting::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_formatting::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_hover::request::kMethodInfo] = [](Reader& visitor)
- {
- return td_hover::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_implementation::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_implementation::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_didRenameFiles::request::kMethodInfo] = [](Reader& visitor)
- {
-
- return td_didRenameFiles::request::ReflectReader(visitor);
- };
-
- handler.method2request[td_willRenameFiles::request::kMethodInfo] = [](Reader& visitor)
- {
- return td_willRenameFiles::request::ReflectReader(visitor);
- };
-}
-
-
-lsp::ProtocolJsonHandler::ProtocolJsonHandler()
-{
- AddStadardResponseJsonRpcMethod(*this);
- AddJavaExtentionResponseJsonRpcMethod(*this);
- AddNotifyJsonRpcMethod(*this);
- AddStandardRequestJsonRpcMethod(*this);
- AddRequstJsonRpcMethod(*this);
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/initialize.cpp b/graphics/asymptote/LspCpp/src/lsp/initialize.cpp
deleted file mode 100644
index 504caa3e65..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/initialize.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-#include "LibLsp/lsp/general/initialize.h"
-#include "LibLsp/JsonRpc/json.h"
-
-void Reflect(Reader& reader, lsInitializeParams::lsTrace& value)
-{
- if (!reader.IsString())
- {
- value = lsInitializeParams::lsTrace::Off;
- return;
- }
- std::string v = reader.GetString();
- if (v == "off")
- value = lsInitializeParams::lsTrace::Off;
- else if (v == "messages")
- value = lsInitializeParams::lsTrace::Messages;
- else if (v == "verbose")
- value = lsInitializeParams::lsTrace::Verbose;
-}
-
-void Reflect(Writer& writer, lsInitializeParams::lsTrace& value)
-{
- switch (value)
- {
- case lsInitializeParams::lsTrace::Off:
- writer.String("off");
- break;
- case lsInitializeParams::lsTrace::Messages:
- writer.String("messages");
- break;
- case lsInitializeParams::lsTrace::Verbose:
- writer.String("verbose");
- break;
- }
-}
- void Reflect(Reader& visitor, std::pair<optional<lsTextDocumentSyncKind>, optional<lsTextDocumentSyncOptions> >& value)
-{
- if(((JsonReader&)visitor).m_->IsObject())
- {
- Reflect(visitor, value.second);
- }
- else
- {
- Reflect(visitor, value.first);
- }
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/lsp.cpp b/graphics/asymptote/LspCpp/src/lsp/lsp.cpp
deleted file mode 100644
index d070f22be1..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/lsp.cpp
+++ /dev/null
@@ -1,1089 +0,0 @@
-
-
-#include "LibLsp/lsp/lru_cache.h"
-
-
-#include <rapidjson/writer.h>
-
-
-#include <stdio.h>
-#include <iostream>
-#include "LibLsp/lsp/location_type.h"
-#include "LibLsp/lsp/out_list.h"
-#include "LibLsp/lsp/lsTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsVersionedTextDocumentIdentifier.h"
-#include "LibLsp/lsp/lsResponseError.h"
-#include "LibLsp/lsp/lsPosition.h"
-#include "LibLsp/lsp/lsTextEdit.h"
-#include "LibLsp/lsp/lsMarkedString.h"
-#include "LibLsp/lsp/lsWorkspaceEdit.h"
-#include "LibLsp/lsp/textDocument/code_action.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/extention/jdtls/codeActionResult.h"
-
-#include "LibLsp/lsp/textDocument/selectionRange.h"
-#include "LibLsp/lsp/AbsolutePath.h"
-
-#ifdef _WIN32
-#include <Windows.h>
-#else
-#include <climits>
-#include <cstdlib>
-#endif
-
-#include "LibLsp/lsp/Directory.h"
-#include "LibLsp/lsp/lsFormattingOptions.h"
-#include "LibLsp/JsonRpc/json.h"
-#include "LibLsp/lsp/language/language.h"
-
-#include <network/uri/uri_builder.hpp>
-
-#include "LibLsp/lsp/lsp_completion.h"
-#include "LibLsp/lsp/utils.h"
-#include "LibLsp/lsp/client/registerCapability.h"
-#include <boost/uuid/uuid.hpp>
-#include <boost/uuid/uuid_io.hpp>
-#include <boost/uuid/uuid_generators.hpp>
-// namespace
-
-
-
-lsTextDocumentIdentifier
-lsVersionedTextDocumentIdentifier::AsTextDocumentIdentifier() const {
- lsTextDocumentIdentifier result;
- result.uri = uri;
- return result;
-}
-
-
-lsPosition::lsPosition() {}
-lsPosition::lsPosition(int line, int character)
- : line(line), character(character) {}
-
-bool lsPosition::operator==(const lsPosition& other) const {
- return line == other.line && character == other.character;
-}
-
-bool lsPosition::operator<(const lsPosition& other) const {
- return line != other.line ? line < other.line : character < other.character;
-}
-
-std::string lsPosition::ToString() const {
- return std::to_string(line) + ":" + std::to_string(character);
-}
-const lsPosition lsPosition::kZeroPosition = lsPosition();
-
-lsRange::lsRange() {}
-lsRange::lsRange(lsPosition start, lsPosition end) : start(start), end(end) {}
-
-bool lsRange::operator==(const lsRange& o) const {
- return start == o.start && end == o.end;
-}
-
-bool lsRange::operator<(const lsRange& o) const {
- return !(start == o.start) ? start < o.start : end < o.end;
-}
-
-std::string lsRange::ToString() const
-{
- std::stringstream ss;
- ss << "start:" << start.ToString() << std::endl;
- ss << "end" << end.ToString() << std::endl;
- return ss.str();
-}
-
-lsLocation::lsLocation() {}
-lsLocation::lsLocation(lsDocumentUri uri, lsRange range)
- : uri(uri), range(range) {}
-
-bool lsLocation::operator==(const lsLocation& o) const {
- return uri == o.uri && range == o.range;
-}
-
-bool lsLocation::operator<(const lsLocation& o) const {
- return std::make_tuple(uri.raw_uri_, range) <
- std::make_tuple(o.uri.raw_uri_, o.range);
-}
-
-bool lsTextEdit::operator==(const lsTextEdit& that) {
- return range == that.range && newText == that.newText;
-}
-
-std::string lsTextEdit::ToString() const
-{
- std::stringstream ss;
- ss << "Range:" << range.ToString() << std::endl;
- ss << "newText:" << newText << std::endl;
- return ss.str();
-}
-
-void Reflect(Writer& visitor, lsMarkedString& value) {
- // If there is a language, emit a `{language:string, value:string}` object. If
- // not, emit a string.
- if (value.language) {
- REFLECT_MEMBER_START();
- REFLECT_MEMBER(language);
- REFLECT_MEMBER(value);
- REFLECT_MEMBER_END();
- } else {
- Reflect(visitor, value.value);
- }
-}
-
-void Reflect(Reader& visitor, lsMarkedString& value)
-{
- REFLECT_MEMBER_START();
- REFLECT_MEMBER(language);
- REFLECT_MEMBER(value);
- REFLECT_MEMBER_END();
-}
-
- void Reflect(Reader& visitor, LocationListEither::Either& value)
-{
- if(!visitor.IsArray())
- {
- throw std::invalid_argument("Rsp_LocationListEither::Either& value is not array");
- }
- auto data = ((JsonReader&)visitor).m_->GetArray();
- if (data.Size() && data[0].HasMember("originSelectionRange"))
- {
- Reflect(visitor, value.second);
- }
- else {
- Reflect(visitor, value.first);
- }
-
-}
-
- void Reflect(Writer& visitor, LocationListEither::Either& value)
-{
- if (value.first)
- {
- Reflect(visitor, value.first.value());
- }
- else if (value.second)
- {
- Reflect(visitor, value.second.value());
- }
-}
-
-
-void Reflect(Reader& visitor, TextDocumentCodeAction::Either& value)
-{
-
-
- if(visitor.HasMember("command"))
- {
- if(visitor["command"]->IsString())
- {
- Reflect(visitor, value.first);
- }
- else
- {
- Reflect(visitor, value.second);
- }
- }
- else
- {
- if (visitor.HasMember("diagnostics") || visitor.HasMember("edit"))
- {
- Reflect(visitor, value.second);
- }
- else
- {
- Reflect(visitor, value.first);
- }
- }
-
-}
-
-
-void Reflect(Reader& visitor, lsWorkspaceEdit::Either& value)
-{
-
-
- if(visitor.HasMember("textDocument"))
- {
- Reflect(visitor, value.first);
- }
- else
- {
- Reflect(visitor, value.second);
- }
-}
-ResourceOperation* GetResourceOperation(lsp::Any& lspAny)
-{
- rapidjson::Document document;
- auto& data = lspAny.Data();
- document.Parse(data.c_str(), data.length());
- if (document.HasParseError()) {
- // ��ʾ
- return nullptr;
- }
- auto find = document.FindMember("kind");
-
- JsonReader visitor{ &document };
- try
- {
- if (find->value == "create")
- {
- auto ptr = std::make_unique<lsCreateFile>();
- auto temp = ptr.get();
- Reflect(visitor, *temp);
- return ptr.release();
- }
- else if (find->value == "rename")
- {
- auto ptr = std::make_unique<lsRenameFile>();
- auto temp = ptr.get();
- Reflect(visitor, *temp);
- return ptr.release();
- }
- else if (find->value == "delete")
- {
-
- auto ptr = std::make_unique<lsDeleteFile>();
- auto temp = ptr.get();
- Reflect(visitor, *temp);
- return ptr.release();
- }
- }
- catch (std::exception&)
- {
-
- }
- return nullptr;
-}
-
- void Reflect(Writer& visitor, ResourceOperation* value)
-{
-
- if(!value)
- {
- throw std::invalid_argument("ResourceOperation value is nullptr");
- }
- if (value->kind == "create")
- {
- auto temp = (lsCreateFile*)value;
- Reflect(visitor, *temp);
- }
- else if (value->kind == "rename")
- {
- auto temp = (lsRenameFile*)value;
- Reflect(visitor, *temp);
- }
- else if (value->kind == "delete")
- {
-
- auto temp = (lsDeleteFile*)value;
- Reflect(visitor, *temp);
- }
-
-}
-
-int lsp::Any::GuessType()
-{
- if (!data.empty())
- {
- if (data == "null")
- {
- jsonType = rapidjson::kNullType;
- }
- else if (data == "true")
- {
- jsonType = rapidjson::kTrueType;
- }
- else if(data == "false")
- {
- jsonType = rapidjson::kFalseType;
- }
- else if (data[0] == '{')
- {
- jsonType = rapidjson::kObjectType;
- }
- else if (data[0] == '[')
- {
- if (data.size() >= 2 && data[1] == '{')
- jsonType = rapidjson::kStringType;
- else
- jsonType = rapidjson::kArrayType;
- }
- else if (data[0] == '"')
- {
- jsonType = rapidjson::kStringType;
- }
- else
- {
- jsonType = rapidjson::kNumberType;
- }
- }
- else
- {
- if (jsonType != kUnKnown)
- return jsonType;
- jsonType = rapidjson::kNullType;
- }
- return jsonType;
-}
-
-int lsp::Any::GetType()
-{
- if (jsonType == Type::kUnKnown)
- {
- if (data.empty())
- {
- jsonType = rapidjson::kNullType;
- return jsonType;
- }
- rapidjson::Document document;
- document.Parse(data.c_str(), data.length());
- if (document.HasParseError())
- {
- // ��ʾ
- return jsonType;
- }
- jsonType = document.GetType();
- }
- return jsonType;
-}
-
-void lsp::Any::Set(std::unique_ptr<LspMessage> value)
-{
- if (value)
- {
- jsonType = rapidjson::Type::kObjectType;
- data = value->ToJson();
- }
- else
- {
- assert(false);
- }
-}
-
-void lsp::Any::SetJsonString(std::string&& _data, Type _type)
-{
- jsonType = _type;
- data.swap(_data);
- GetType();
-}
-
-void lsp::Any::SetJsonString(const std::string& _data, Type _type)
-{
- jsonType = _type;
- data = (_data);
- GetType();
-}
-
-void lsp::Any::swap(Any& arg) noexcept
-{
- data.swap(arg.data);
- const int temp = jsonType;
- jsonType = arg.jsonType;
- arg.jsonType = temp;
-}
-
-class JsonReaderForAny : public JsonReader
-{
-public:
- JsonReaderForAny()
- : JsonReader(&document)
- {
- }
- rapidjson::Document document;
-};
-
-bool lsp::Any::GetForMapHelper(std::string& value)
-{
- return Get(value);
-}
-
-bool lsp::Any::GetForMapHelper(optional<std::string>& value)
-{
- return Get(value);
-}
-
-std::unique_ptr<Reader> lsp::Any::GetReader()
-{
- auto reader = new JsonReaderForAny();
- std::unique_ptr<Reader> ret(reader);
- reader->document.Parse(data.c_str(), data.length());
- if (reader->document.HasParseError())
- {
- return {};
- }
- if (jsonType == kUnKnown)
- {
- jsonType = reader->document.GetType();
- }
- return (ret);
-}
-
-class JsonWriterForAny : public JsonWriter
-{
-public:
- rapidjson::StringBuffer output;
- rapidjson::Writer<rapidjson::StringBuffer> writer;
- JsonWriterForAny():JsonWriter(&writer), writer(output)
- {
-
- }
-};
-
-std::unique_ptr<Writer> lsp::Any::GetWriter() const
-{
- return std::make_unique<JsonWriterForAny>();
-}
-
-void lsp::Any::SetData(std::unique_ptr<Writer>& writer)
-{
- auto _temp = static_cast<JsonWriterForAny*>(writer.get());
- data = _temp->output.GetString();
- GuessType();
-}
-
-namespace
-{
-#if 0
- rapidjson::Type convert(lsp::Any::Type type)
- {
- switch (type)
- {
- case lsp::Any::Type::kNullType:
- return rapidjson::Type::kNullType;
- case lsp::Any::Type::kFalseType:
- return rapidjson::Type::kFalseType;
- case lsp::Any::Type::kTrueType:
- return rapidjson::Type::kTrueType;
- case lsp::Any::Type::kObjectType:
- return rapidjson::Type::kObjectType;
- case lsp::Any::Type::kArrayType:
- return rapidjson::Type::kArrayType;
- case lsp::Any::Type::kStringType:
- return rapidjson::Type::kStringType;
- case lsp::Any::Type::kNumberType:
- return rapidjson::Type::kNumberType;
- default:
- return rapidjson::Type::kNullType;
- }
- }
-#endif
- lsp::Any::Type convert(rapidjson::Type type)
- {
- switch (type)
- {
- case rapidjson::Type::kNullType:
- return lsp::Any::Type::kNullType;
- case rapidjson::Type::kFalseType:
- return lsp::Any::Type::kFalseType;
- case rapidjson::Type::kTrueType:
- return lsp::Any::Type::kTrueType;
- case rapidjson::Type::kObjectType:
- return lsp::Any::Type::kObjectType;
- case rapidjson::Type::kArrayType:
- return lsp::Any::Type::kArrayType;
- case rapidjson::Type::kStringType:
- return lsp::Any::Type::kStringType;
- case rapidjson::Type::kNumberType:
- return lsp::Any::Type::kNumberType;
- default:
- return lsp::Any::Type::kNullType;
- }
- }
-}
-
-void Reflect(Reader& visitor, lsp::Any& value)
-{
-
- //if (visitor.IsNull()) {
- // visitor.GetNull();
- // value.SetJsonString("", rapidjson::Type::kNullType);
- // return;
- //}else
- //{
- //
- //}
- JsonReader& json_reader = reinterpret_cast<JsonReader&>(visitor);
- value.SetJsonString(visitor.ToString(), convert(json_reader.m_->GetType()));
-}
- void Reflect(Writer& visitor, lsp::Any& value)
- {
- JsonWriter& json_writer = reinterpret_cast<JsonWriter&>(visitor);
- json_writer.m_->RawValue( value.Data().data(),value.Data().size(),static_cast<rapidjson::Type>(value.GetType()));
-
- }
- void Reflect(Reader& visitor, lsFormattingOptions::KeyData& value)
-{
- if (visitor.IsBool())
- {
- Reflect(visitor, value._boolean);
- }
- else if (visitor.IsInt() || visitor.IsInt64() || visitor.IsUint64())
- {
- Reflect(visitor, value._integer);
- }
- else if(visitor.IsString())
- {
- Reflect(visitor, value._string);
- }
-}
- void Reflect(Writer& visitor, lsFormattingOptions::KeyData& value)
-{
- if (value._boolean.has_value())
- {
- Reflect(visitor, value._boolean);
- }
- else if (value._integer.has_value())
- {
- Reflect(visitor, value._integer);
- }
- else if (value._string.has_value())
- {
- Reflect(visitor, value._string);
- }
-}
-
-lsCreateFile::lsCreateFile()
-{
- kind = "create";
-}
-
-lsDeleteFile::lsDeleteFile()
-{
- kind = "delete";
-}
-
-lsRenameFile::lsRenameFile()
-{
- kind = "rename";
-}
-
-
-void Reflect(Reader& visitor, optional< SelectionRange* >& value)
-{
- if (visitor.IsNull()) {
- visitor.GetNull();
- return;
- }
-
- SelectionRange* entry_value = nullptr;
-
-
- std::unique_ptr<SelectionRange> ptr = std::make_unique<SelectionRange>();
- SelectionRange* temp = ptr.get();
- Reflect(visitor, *temp);
-
- entry_value = ptr.release();
- value = (entry_value);
-
-}
-void Reflect(Writer& visitor, SelectionRange* value)
-{
-
- if (!value)
- {
- throw std::invalid_argument("ResourceOperation value is nullptr");
- }
-
- Reflect(visitor, *value);
-
-
-}
-
- std::string make_file_scheme_uri(const std::string& absolute_path)
-{
- network::uri_builder builder;
- builder.scheme("file");
- builder.host("");
- builder.path(absolute_path);
- return builder.uri().string();
- //// lsDocumentUri uri;
- //// uri.SetPath(absolute_path);
- /// return uri.raw_uri_;
-}
-
-// static
-AbsolutePath AbsolutePath::BuildDoNotUse(const std::string& path) {
- AbsolutePath p;
- p.path = std::string(path);
- return p;
-}
-
-
-AbsolutePath::AbsolutePath() {}
-
-
-
-AbsolutePath::operator std::string() const {
- return path;
-}
-
-bool AbsolutePath::operator==(const AbsolutePath& rhs) const {
- return path == rhs.path;
-}
-
-bool AbsolutePath::operator!=(const AbsolutePath& rhs) const {
- return path != rhs.path;
-}
-
-bool AbsolutePath::operator<(const AbsolutePath& rhs) const
-{
- return path < rhs.path;
-}
-
-bool AbsolutePath::operator>(const AbsolutePath& rhs) const
-{
- return path > rhs.path;
-}
-
-void Reflect(Reader& visitor, AbsolutePath& value) {
- value.path = visitor.GetString();
-}
-void Reflect(Writer& visitor, AbsolutePath& value) {
- visitor.String(value.path.c_str(), value.path.length());
-}
-
-std::ostream& operator<<(std::ostream& out, const AbsolutePath& path) {
- out << path.path;
- return out;
-}
-
-lsDocumentUri lsDocumentUri::FromPath(const AbsolutePath& path) {
- lsDocumentUri result;
- result.SetPath(path);
- return result;
-}
-//void lsDocumentUri::SetPath(const AbsolutePath& path)
-//{
-// raw_uri_ = make_file_scheme_uri(path.path);
-//}
-//
-void lsDocumentUri::SetPath(const AbsolutePath& path) {
- // file:///c%3A/Users/jacob/Desktop/superindex/indexer/full_tests
- raw_uri_ = path;
-
- size_t index = raw_uri_.find(":");
- if (index == 1) { // widows drive letters must always be 1 char
- raw_uri_.replace(raw_uri_.begin() + index, raw_uri_.begin() + index + 1,
- "%3A");
- }
-
- // subset of reserved characters from the URI standard
- // http://www.ecma-international.org/ecma-262/6.0/#sec-uri-syntax-and-semantics
- std::string t;
- t.reserve(8 + raw_uri_.size());
-
- // TODO: proper fix
-#if defined(_WIN32)
- t += "file:///";
-#else
- t += "file://";
-#endif
-
- // clang-format off
- for (char c : raw_uri_)
- switch (c) {
- case ' ': t += "%20"; break;
- case '#': t += "%23"; break;
- case '$': t += "%24"; break;
- case '&': t += "%26"; break;
- case '(': t += "%28"; break;
- case ')': t += "%29"; break;
- case '+': t += "%2B"; break;
- case ',': t += "%2C"; break;
- case ';': t += "%3B"; break;
- case '?': t += "%3F"; break;
- case '@': t += "%40"; break;
- default: t += c; break;
- }
- // clang-format on
- raw_uri_ = std::move(t);
-}
-
-std::string lsDocumentUri::GetRawPath() const {
-
-
- if (raw_uri_.compare(0, 8, "file:///"))
- return raw_uri_;
-
-
- std::string ret;
-#if defined(_WIN32)
- size_t i = 8;
-#else
- size_t i = 7;
-#endif
- auto from_hex = [](unsigned char c) {
- return c - '0' < 10 ? c - '0' : (c | 32) - 'a' + 10;
- };
- for (; i < raw_uri_.size(); i++) {
- if (i + 3 <= raw_uri_.size() && raw_uri_[i] == '%') {
- ret.push_back(from_hex(raw_uri_[i + 1]) * 16 + from_hex(raw_uri_[i + 2]));
- i += 2;
- }
- else
- ret.push_back(raw_uri_[i] == '\\' ? '/' : raw_uri_[i]);
- }
- return ret;
-}
-
-lsDocumentUri::lsDocumentUri() {}
-
-
-lsDocumentUri::lsDocumentUri(const AbsolutePath& path)
-{
- SetPath(path);
-}
-
-lsDocumentUri::lsDocumentUri(const lsDocumentUri& other): raw_uri_(other.raw_uri_)
-{
-}
-
-bool lsDocumentUri::operator==(const lsDocumentUri& other) const {
- return raw_uri_ == other.raw_uri_;
-}
-
-bool lsDocumentUri::operator==(const std::string& other) const
-{
- return raw_uri_ == other;
-}
-
-
-AbsolutePath lsDocumentUri::GetAbsolutePath() const {
-
-
- if (raw_uri_.find("file://") != std::string::npos){
- try
- {
- return lsp::NormalizePath(GetRawPath(), false /*ensure_exists*/, false);
- }
- catch (std::exception&)
- {
- return AbsolutePath("", false);
- }
- }
-
- return AbsolutePath(raw_uri_,false);
-
-}
-
-AbsolutePath::AbsolutePath(const std::string& path, bool validate)
- : path(path) {
- // TODO: enable validation after fixing tests.
- if (validate && !lsp::IsAbsolutePath(path)) {
- qualify = false;
- auto temp = lsp::NormalizePath(path,false);
- if(!temp.path.empty())
- {
- this->path = temp.path;
- }
- }
-}
-
-void Reflect(Writer& visitor, lsDocumentUri& value) {
- Reflect(visitor, value.raw_uri_);
-}
-void Reflect(Reader& visitor, lsDocumentUri& value) {
- Reflect(visitor, value.raw_uri_);
- // Only record the path when we deserialize a URI, since it most likely came
- // from the client.
-
-}
-
- std::string ProgressReport::ToString() const
-{
- std::string info;
- info += "id:" + id + "\n";
- info += "task:" + task + "\n";
- info += "subTask:" + subTask + "\n";
- info += "status:" + status + "\n";
- {
- std::stringstream ss;
- ss << "totalWork:" << totalWork << std::endl;
- info += ss.str();
- }
- {
- std::stringstream ss;
- ss << "workDone:" << workDone << std::endl;
- info += ss.str();
- }
-
- {
- std::stringstream ss;
- ss << "complete:" << complete << std::endl;
- info += ss.str();
- }
-
- return info;
-}
-
-std::string EventNotification::ToString() const
-{
- std::string info;
- if (ClasspathUpdated == eventType)
- {
- info += "eventType:ClasspathUpdated\n";
- }
- else if (ProjectsImported == eventType)
- {
- info += "eventType:ProjectsImported\n";
- }
- else
- {
- std::ostringstream oss;
- oss << std::hex << eventType << std::endl;
-
- info += "eventType:";
- info += oss.str();
- }
- info += "data:" + data.Data() + "\n";
- return info;
-}
-
-std::string lsp::ToString(lsCompletionItemKind _kind)
-{
- switch (_kind) {
- case lsCompletionItemKind::Text:
- return "Text";
- case lsCompletionItemKind::Method:
- return "Method";
- case lsCompletionItemKind::Function:
- return "";
- case lsCompletionItemKind::Constructor:
- return "Function";
- case lsCompletionItemKind::Field:
- return "Field";
- case lsCompletionItemKind::Variable:
- return "";
- case lsCompletionItemKind::Class:
- return "Variable";
- case lsCompletionItemKind::Interface:
- return "Interface";
- case lsCompletionItemKind::Module:
- return "Module";
- case lsCompletionItemKind::Property:
- return "Property";
- case lsCompletionItemKind::Unit:
- return "Unit";
- case lsCompletionItemKind::Value:
- return "Value";
- case lsCompletionItemKind::Enum:
- return "Enum";
- case lsCompletionItemKind::Keyword:
- return "Keyword";
- case lsCompletionItemKind::Snippet:
- return "Snippet";
- case lsCompletionItemKind::Color:
- return "Color";
- case lsCompletionItemKind::File:
- return "File";
- case lsCompletionItemKind::Reference:
- return "Reference";
- case lsCompletionItemKind::Folder:
- return "Folder";
- case lsCompletionItemKind::EnumMember:
- return "EnumMember";
- case lsCompletionItemKind::Constant:
- return "Constant";
- case lsCompletionItemKind::Struct:
- return "Struct";
- case lsCompletionItemKind::Event:
- return "Event";
- case lsCompletionItemKind::Operator:
- return "Operator";
- case lsCompletionItemKind::TypeParameter:
- return "TypeParameter";
- default:
- return "Unknown";
- }
-}
-
-std::string lsp::ToString(lsInsertTextFormat _kind)
-{
- if (_kind == lsInsertTextFormat::PlainText)
- {
- return "PlainText";
- }
- else if (_kind == lsInsertTextFormat::Snippet)
- {
- return "Snippet";
- }else
- {
- return "Unknown";
- }
-}
-
-const std::string& lsCompletionItem::InsertedContent() const
-{
- if (textEdit)
- return textEdit->newText;
- if (insertText.has_value() && !insertText->empty())
- return insertText.value();
- return label;
-}
-
-std::string lsCompletionItem::DisplayText()
-{
-
- if (detail)
- {
-
- return label + " in " + detail.value();
- }
- return label;
-}
-
-std::string lsCompletionItem::ToString()
- {
- std::stringstream info;
- info << "label : " << label << std::endl;
- if(kind)
- info << "kind : " << lsp::ToString(kind.value()) << std::endl;
- else
- info << "kind : no exist." << std::endl;
-
- if (detail)
- info << "detail : " << detail.value() << std::endl;
- else
- info << "detail : no exist." << std::endl;
-
- if (documentation)
- {
- info << "documentation : " << std::endl;
- if(documentation.value().first)
- {
- info << documentation.value().first.value();
- }
- else if(documentation.value().second)
- {
- info << documentation.value().second.value().value;
- }
- }
- else
- info << "documentation : no exist." << std::endl;
-
- if (deprecated)
- info << "deprecated : " << deprecated.value() << std::endl;
- else
- info << "deprecated : no exist." << std::endl;
-
- if (preselect)
- info << "preselect : " << preselect.value() << std::endl;
- else
- info << "preselect : no exist." << std::endl;
-
- if (sortText)
- info << "sortText : " << sortText.value() << std::endl;
- else
- info << "sortText : no exist." << std::endl;
-
- if (filterText)
- info << "filterText : " << filterText.value() << std::endl;
- else
- info << "filterText : no exist." << std::endl;
-
-
- if (insertText)
- info << "insertText : " << insertText.value() << std::endl;
- else
- info << "insertText : no exist." << std::endl;
-
-
- if (insertTextFormat)
- info << "insertText : " << lsp::ToString(insertTextFormat.value()) << std::endl;
- else
- info << "insertTextFormat : no exist." << std::endl;
-
- if (textEdit)
- info << "textEdit : " << textEdit.value().ToString() << std::endl;
- else
- info << "textEdit : no exist." << std::endl;
-
-
-
- return info.str();
-
- }
-namespace JDT
-{
- namespace CodeActionKind {
-
-
- /**
- * Base kind for quickfix actions: 'quickfix'
- */
- const char* QuickFix = "quickfix";
-
- /**
- * Base kind for refactoring actions: 'refactor'
- */
- const char* Refactor = "refactor";
-
- /**
- * Base kind for refactoring extraction actions: 'refactor.extract'
- *
- * Example extract actions:
- *
- * - Extract method - Extract function - Extract variable - Extract interface
- * from class - ...
- */
- const char* RefactorExtract = "refactor.extract";
-
- /**
- * Base kind for refactoring inline actions: 'refactor.inline'
- *
- * Example inline actions:
- *
- * - Inline function - Inline variable - Inline constant - ...
- */
- const char* RefactorInline = "refactor.inline";
-
- /**
- * Base kind for refactoring rewrite actions: 'refactor.rewrite'
- *
- * Example rewrite actions:
- *
- * - Convert JavaScript function to class - Add or remove parameter -
- * Encapsulate field - Make method static - Move method to base class - ...
- */
- const char* RefactorRewrite = "refactor.rewrite";
-
- /**
- * Base kind for source actions: `source`
- *
- * Source code actions apply to the entire file.
- */
- const char* Source = "source";
-
- /**
- * Base kind for an organize imports source action: `source.organizeImports`
- */
- const char* SourceOrganizeImports = "source.organizeImports";
-
- const char* COMMAND_ID_APPLY_EDIT = "java.apply.workspaceEdit";
-
- };
-
-
-}
-Directory::Directory(const AbsolutePath& path) : path(path.path) {
- lsp::EnsureEndsInSlash(this->path);
-}
-
-bool Directory::operator==(const Directory& rhs) const {
- return path == rhs.path;
-}
-
-bool Directory::operator!=(const Directory& rhs) const {
- return path != rhs.path;
-}
-
-
-
- Registration Registration::Create(const std::string& method)
-{
- Registration reg;
- reg.method = method;
- const boost::uuids::uuid a_uuid = boost::uuids::random_generator()();
- reg.id = to_string(a_uuid);
- return reg;
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/lsp_diagnostic.cpp b/graphics/asymptote/LspCpp/src/lsp/lsp_diagnostic.cpp
deleted file mode 100644
index fba0edc30c..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/lsp_diagnostic.cpp
+++ /dev/null
@@ -1,75 +0,0 @@
-#include "LibLsp/lsp/lsp_diagnostic.h"
-
-bool lsDiagnostic::operator==(const lsDiagnostic& rhs) const {
- // Just check the important fields.
- return range == rhs.range && message == rhs.message;
-}
-bool lsDiagnostic::operator!=(const lsDiagnostic& rhs) const {
- return !(*this == rhs);
-}
-
-std::string lsResponseError::ToString()
-{
- std::string info = "code:";
- switch (code)
- {
- case lsErrorCodes::ParseError:
- info += "ParseError\n";
- break;
- case lsErrorCodes::InvalidRequest:
- info += "InvalidRequest\n";
- break;
- case lsErrorCodes::MethodNotFound:
- info += "MethodNotFound\n";
- break;
- case lsErrorCodes::InvalidParams:
- info += "InvalidParams\n";
- break;
- case lsErrorCodes::InternalError:
- info += "InternalError\n";
- break;
- case lsErrorCodes::serverErrorStart:
- info += "serverErrorStart\n";
- break;
- case lsErrorCodes::serverErrorEnd:
- info += "serverErrorEnd\n";
- break;
- case lsErrorCodes::ServerNotInitialized:
- info += "ServerNotInitialized\n";
- break;
- case lsErrorCodes::UnknownErrorCode:
- info += "UnknownErrorCode\n";
- break;
- // Defined by the protocol.
- case lsErrorCodes::RequestCancelled:
- info += "RequestCancelled\n";
- break;
- default:
- {
- std::stringstream ss;
- ss << "unknown code:" << (int32_t)code << std::endl;
- info += ss.str();
- }
- break;
- }
- info += "message:" + message;
- info += "\n";
-
- if(data.has_value())
- {
-
- info += "data:" + data.value().Data();
- info += "\n";
- }
- return info;
-}
-
-void lsResponseError::Write(Writer& visitor) {
- auto& value = *this;
- int code2 = static_cast<int>(this->code);
-
- visitor.StartObject();
- REFLECT_MEMBER2("code", code2);
- REFLECT_MEMBER(message);
- visitor.EndObject();
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/textDocument.cpp b/graphics/asymptote/LspCpp/src/lsp/textDocument.cpp
deleted file mode 100644
index c87a047d3f..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/textDocument.cpp
+++ /dev/null
@@ -1,349 +0,0 @@
-#include "LibLsp/lsp/textDocument/completion.h"
-#include "LibLsp/lsp/textDocument/document_symbol.h"
-#include "LibLsp/lsp/lsMarkedString.h"
-#include "LibLsp/lsp/textDocument/hover.h"
-#include "LibLsp/lsp/textDocument/prepareRename.h"
-#include <LibLsp/lsp/textDocument/typeHierarchy.h>
-
-#include "LibLsp/lsp/textDocument/semanticHighlighting.h"
-#include "LibLsp/lsp/textDocument/SemanticTokens.h"
-#include "LibLsp/JsonRpc/json.h"
-
-
-constexpr unsigned SemanticTokenEncodingSize = 5;
-
-std::string to_string(SemanticTokenType _type)
-{
- switch (_type) {
-
- case ls_namespace: return "namespace";
- /**
- * Represents a generic type. Acts as a fallback for types which
- * can"t be mapped to a specific type like class or enum.
- */
- case ls_type: return "type";
- case ls_class: return "class";
- case ls_enum: return "enum";
- case ls_interface: return "interface";
- case ls_struct: return "struct";
- case ls_typeParameter: return "typeParameter";
- case ls_parameter: return "parameter";
- case ls_variable: return "variable";
- case ls_property: return "property";
- case ls_enumMember: return "enumMember";
- case ls_event: return "event";
- case ls_function: return "function";
- case ls_method: return "method";
- case ls_macro: return "macro";
- case ls_keyword: return "keyword";
- case ls_modifier: return "modifier";
- case ls_comment: return "comment";
- case ls_string: return "string";
- case ls_number: return "number";
- case ls_regexp: return "regexp";
- case ls_operator: return "operator";
- default:
- return "unknown";
- }
-}
-
-unsigned toSemanticTokenType(std::vector<SemanticTokenType>& modifiers)
-{
- unsigned encode_type = 0;
- for (auto bit : modifiers) {
- encode_type = encode_type | (0b00000001 << bit);
- }
- return encode_type;
-}
-
-std::string to_string(TokenType_JDT _type)
-{
- switch (_type)
- {
- case PACKAGE_JDT:return "namespace";
- case CLASS_JDT:return "class";
- case INTERFACE_JDT:return "interface";
- case ENUM_JDT:return "enum";
- case ENUM_MEMBER_JDT:return "enumMember";
- case TYPE_JDT:return "type";
- case TYPE_PARAMETER_JDT:return "typeParameter";
- case ANNOTATION_JDT:return "annotation";
- case ANNOTATION_MEMBER_JDT:return "annotationMember";
- case METHOD_JDT:return "function";
- case PROPERTY_JDT:return "property";
- case VARIABLE_JDT:return "variable";
- case PARAMETER_JDT:return "parameter";
- }
- return "unknown";
-}
-
-std::string to_string(SemanticTokenModifier modifier)
-{
- switch (modifier) {
- case ls_declaration: return "declaration";
- case ls_definition: return "definition";
- case ls_readonly: return "readonly";
- case ls_static: return "static";
- case ls_deprecated: return "deprecated";
- case ls_abstract: return "abstract";
- case ls_async: return "async";
- case ls_modification: return "modification";
- case ls_documentation: return "documentation";
- case ls_defaultLibrary: return "defaultLibrary";
- default:
- return "unknown";
- }
-}
-
-unsigned toSemanticTokenModifiers(std::vector<SemanticTokenModifier>& modifiers)
-{
- unsigned encodedModifiers = 0;
- for (auto bit : modifiers) {
- encodedModifiers = encodedModifiers | (0b00000001 << bit);
- }
- return encodedModifiers;
-}
-
-
-std::string toSemanticTokenType(HighlightingKind_clangD kind) {
- switch (kind) {
- case HighlightingKind_clangD::Variable:
- case HighlightingKind_clangD::LocalVariable:
- case HighlightingKind_clangD::StaticField:
- return "variable";
- case HighlightingKind_clangD::Parameter:
- return "parameter";
- case HighlightingKind_clangD::Function:
- return "function";
- case HighlightingKind_clangD::Method:
- return "method";
- case HighlightingKind_clangD::StaticMethod:
- // FIXME: better method with static modifier?
- return "function";
- case HighlightingKind_clangD::Field:
- return "property";
- case HighlightingKind_clangD::Class:
- return "class";
- case HighlightingKind_clangD::Interface:
- return "interface";
- case HighlightingKind_clangD::Enum:
- return "enum";
- case HighlightingKind_clangD::EnumConstant:
- return "enumMember";
- case HighlightingKind_clangD::Typedef:
- case HighlightingKind_clangD::Type:
- return "type";
- case HighlightingKind_clangD::Unknown:
- return "unknown"; // nonstandard
- case HighlightingKind_clangD::Namespace:
- return "namespace";
- case HighlightingKind_clangD::TemplateParameter:
- return "typeParameter";
- case HighlightingKind_clangD::Concept:
- return "concept"; // nonstandard
- case HighlightingKind_clangD::Primitive:
- return "type";
- case HighlightingKind_clangD::Macro:
- return "macro";
- case HighlightingKind_clangD::InactiveCode:
- return "comment";
- }
- return ("unhandled HighlightingKind_clangD");
-}
-
-std::string toSemanticTokenModifier(HighlightingModifier_clangD modifier) {
- switch (modifier) {
- case HighlightingModifier_clangD::Declaration:
- return "declaration";
- case HighlightingModifier_clangD::Deprecated:
- return "deprecated";
- case HighlightingModifier_clangD::Readonly:
- return "readonly";
- case HighlightingModifier_clangD::Static:
- return "static";
- case HighlightingModifier_clangD::Deduced:
- return "deduced"; // nonstandard
- case HighlightingModifier_clangD::Abstract:
- return "abstract";
- case HighlightingModifier_clangD::DependentName:
- return "dependentName"; // nonstandard
- case HighlightingModifier_clangD::DefaultLibrary:
- return "defaultLibrary";
- case HighlightingModifier_clangD::FunctionScope:
- return "functionScope"; // nonstandard
- case HighlightingModifier_clangD::ClassScope:
- return "classScope"; // nonstandard
- case HighlightingModifier_clangD::FileScope:
- return "fileScope"; // nonstandard
- case HighlightingModifier_clangD::GlobalScope:
- return "globalScope"; // nonstandard
- }
- return ("unhandled HighlightingModifier_clangD");
-}
-
-
-
-bool operator==(const SemanticToken& l, const SemanticToken& r) {
- return std::tie(l.deltaLine, l.deltaStart, l.length, l.tokenType,
- l.tokenModifiers) == std::tie(r.deltaLine, r.deltaStart,
- r.length, r.tokenType,
- r.tokenModifiers);
-}
-
-std::vector<int32_t> SemanticTokens::encodeTokens(std::vector<SemanticToken>& tokens)
-{
- std::vector<int32_t> result;
- result.reserve(SemanticTokenEncodingSize * tokens.size());
- for (const auto& tok : tokens)
- {
- result.push_back(tok.deltaLine);
- result.push_back(tok.deltaStart);
- result.push_back(tok.length);
- result.push_back(tok.tokenType);
- result.push_back(tok.tokenModifiers);
- }
- assert(result.size() == SemanticTokenEncodingSize * tokens.size());
- return result;
-}
-
-void Reflect(Reader& visitor, TextDocumentComplete::Either& value)
-{
- if(visitor.IsArray())
- {
- Reflect(visitor, value.first);
- }
- else
- {
-
- Reflect(visitor, value.second);
- }
-
-}
-void Reflect(Reader& visitor, TextDocumentDocumentSymbol::Either& value)
-{
- if (visitor.HasMember("location"))
- {
- Reflect(visitor, value.first);
- }
- else
- {
- Reflect(visitor, value.second);
- }
-}
-
-void Reflect(Reader& visitor, std::pair<optional<std::string>, optional<lsMarkedString>>& value)
-{
-
- if (!visitor.IsString())
- {
- Reflect(visitor, value.second);
- }
- else
- {
- Reflect(visitor, value.first);
- }
-}
-
-void Reflect(Reader& visitor, std::pair<optional<std::string>, optional<MarkupContent>>& value)
-{
- if (!visitor.IsString())
- {
- Reflect(visitor, value.second);
- }
- else
- {
- Reflect(visitor, value.first);
- }
-}
- void Reflect(Reader& visitor, TextDocumentHover::Either& value)
-{
- JsonReader& reader = dynamic_cast<JsonReader&>(visitor);
- if (reader.IsArray())
- {
- Reflect(visitor, value.first);
- }
- else if(reader.m_->IsObject())
- {
- Reflect(visitor, value.second);
- }
-}
-
- void Reflect(Reader& visitor, TextDocumentPrepareRenameResult& value)
-{
- if (visitor.HasMember("placeholder"))
- {
- Reflect(visitor, value.second);
- }
- else
- {
- Reflect(visitor, value.first);
- }
-}
-
- namespace
- RefactorProposalUtility
- {
- const char* APPLY_REFACTORING_COMMAND_ID = "java.action.applyRefactoringCommand";
- const char* EXTRACT_VARIABLE_ALL_OCCURRENCE_COMMAND = "extractVariableAllOccurrence";
- const char* EXTRACT_VARIABLE_COMMAND = "extractVariable";
- const char* EXTRACT_CONSTANT_COMMAND = "extractConstant";
- const char* EXTRACT_METHOD_COMMAND = "extractMethod";
- const char* EXTRACT_FIELD_COMMAND = "extractField";
- const char* CONVERT_VARIABLE_TO_FIELD_COMMAND = "convertVariableToField";
- const char* MOVE_FILE_COMMAND = "moveFile";
- const char* MOVE_INSTANCE_METHOD_COMMAND = "moveInstanceMethod";
- const char* MOVE_STATIC_MEMBER_COMMAND = "moveStaticMember";
- const char* MOVE_TYPE_COMMAND = "moveType";
- };
- namespace QuickAssistProcessor {
-
- const char* SPLIT_JOIN_VARIABLE_DECLARATION_ID = "org.eclipse.jdt.ls.correction.splitJoinVariableDeclaration.assist"; //$NON-NLS-1$
- const char* CONVERT_FOR_LOOP_ID = "org.eclipse.jdt.ls.correction.convertForLoop.assist"; //$NON-NLS-1$
- const char* ASSIGN_TO_LOCAL_ID = "org.eclipse.jdt.ls.correction.assignToLocal.assist"; //$NON-NLS-1$
- const char* ASSIGN_TO_FIELD_ID = "org.eclipse.jdt.ls.correction.assignToField.assist"; //$NON-NLS-1$
- const char* ASSIGN_PARAM_TO_FIELD_ID = "org.eclipse.jdt.ls.correction.assignParamToField.assist"; //$NON-NLS-1$
- const char* ASSIGN_ALL_PARAMS_TO_NEW_FIELDS_ID = "org.eclipse.jdt.ls.correction.assignAllParamsToNewFields.assist"; //$NON-NLS-1$
- const char* ADD_BLOCK_ID = "org.eclipse.jdt.ls.correction.addBlock.assist"; //$NON-NLS-1$
- const char* EXTRACT_LOCAL_ID = "org.eclipse.jdt.ls.correction.extractLocal.assist"; //$NON-NLS-1$
- const char* EXTRACT_LOCAL_NOT_REPLACE_ID = "org.eclipse.jdt.ls.correction.extractLocalNotReplaceOccurrences.assist"; //$NON-NLS-1$
- const char* EXTRACT_CONSTANT_ID = "org.eclipse.jdt.ls.correction.extractConstant.assist"; //$NON-NLS-1$
- const char* INLINE_LOCAL_ID = "org.eclipse.jdt.ls.correction.inlineLocal.assist"; //$NON-NLS-1$
- const char* CONVERT_LOCAL_TO_FIELD_ID = "org.eclipse.jdt.ls.correction.convertLocalToField.assist"; //$NON-NLS-1$
- const char* CONVERT_ANONYMOUS_TO_LOCAL_ID = "org.eclipse.jdt.ls.correction.convertAnonymousToLocal.assist"; //$NON-NLS-1$
- const char* CONVERT_TO_STRING_BUFFER_ID = "org.eclipse.jdt.ls.correction.convertToStringBuffer.assist"; //$NON-NLS-1$
- const char* CONVERT_TO_MESSAGE_FORMAT_ID = "org.eclipse.jdt.ls.correction.convertToMessageFormat.assist"; //$NON-NLS-1$;
- const char* EXTRACT_METHOD_INPLACE_ID = "org.eclipse.jdt.ls.correction.extractMethodInplace.assist"; //$NON-NLS-1$;
-
- const char* CONVERT_ANONYMOUS_CLASS_TO_NESTED_COMMAND = "convertAnonymousClassToNestedCommand";
- };
-
- void Reflect(Reader& reader, TypeHierarchyDirection& value) {
- if (!reader.IsString())
- {
- value = TypeHierarchyDirection::Both;
- return;
- }
- std::string v = reader.GetString();
- if (v == "Children")
- value = TypeHierarchyDirection::Both;
- else if (v == "Parents")
- value = TypeHierarchyDirection::Parents;
- else if (v == "Both")
- value = TypeHierarchyDirection::Both;
- }
-
-
- void Reflect(Writer& writer, TypeHierarchyDirection& value) {
- switch (value)
- {
- case TypeHierarchyDirection::Children:
- writer.String("Children");
- break;
- case TypeHierarchyDirection::Parents:
- writer.String("Parents");
- break;
- case TypeHierarchyDirection::Both:
- writer.String("Both");
- break;
- }
- }
diff --git a/graphics/asymptote/LspCpp/src/lsp/utils.cpp b/graphics/asymptote/LspCpp/src/lsp/utils.cpp
deleted file mode 100644
index 893cc94552..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/utils.cpp
+++ /dev/null
@@ -1,612 +0,0 @@
-#include "LibLsp/lsp/utils.h"
-
-#include <algorithm>
-#include <cassert>
-#include <cctype>
-#include <cstring>
-#include <fstream>
-#include <functional>
-
-#include <queue>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <sys/stat.h>
-
-#include "LibLsp/lsp/lsPosition.h"
-#include "utf8.h"
-#ifdef _WIN32
-#include <Windows.h>
-#endif
-
-
-// DEFAULT_RESOURCE_DIRECTORY is passed with quotes for non-MSVC compilers, ie,
-// foo vs "foo".
-#if defined(_MSC_VER)
-#define _STRINGIFY(x) #x
-#define ENSURE_STRING_MACRO_ARGUMENT(x) _STRINGIFY(x)
-#else
-#define ENSURE_STRING_MACRO_ARGUMENT(x) x
-#endif
-#include <boost/filesystem/path.hpp>
-#include <boost/filesystem/operations.hpp>
-#include <boost/algorithm/string.hpp>
-#include <boost/filesystem/directory.hpp>
-namespace lsp
-{
-
-
-// See http://stackoverflow.com/a/2072890
-bool EndsWith(std::string value, std::string ending) {
- if (ending.size() > value.size())
- return false;
- return std::equal(ending.rbegin(), ending.rend(), value.rbegin());
-}
-
-bool StartsWith(std::string value, std::string start) {
- if (start.size() > value.size())
- return false;
- return std::equal(start.begin(), start.end(), value.begin());
-}
-
-bool AnyStartsWith(const std::vector<std::string>& values,
- const std::string& start) {
- return std::any_of(
- std::begin(values), std::end(values),
- [&start](const std::string& value) { return StartsWith(value, start); });
-}
-
-bool StartsWithAny(const std::string& value,
- const std::vector<std::string>& startings) {
- return std::any_of(std::begin(startings), std::end(startings),
- [&value](const std::string& starting) {
- return StartsWith(value, starting);
- });
-}
-
-bool EndsWithAny(const std::string& value,
- const std::vector<std::string>& endings) {
- return std::any_of(
- std::begin(endings), std::end(endings),
- [&value](const std::string& ending) { return EndsWith(value, ending); });
-}
-
-bool FindAnyPartial(const std::string& value,
- const std::vector<std::string>& values) {
- return std::any_of(std::begin(values), std::end(values),
- [&value](const std::string& v) {
- return value.find(v) != std::string::npos;
- });
-}
-
-std::string GetDirName(std::string path) {
-
- ReplaceAll(path, "\\", "/");
- if (path.size() && path.back() == '/')
- path.pop_back();
- size_t last_slash = path.find_last_of('/');
- if (last_slash == std::string::npos)
- return "./";
- return path.substr(0, last_slash + 1);
-}
-
-std::string GetBaseName(const std::string& path) {
- size_t last_slash = path.find_last_of('/');
- if (last_slash != std::string::npos && (last_slash + 1) < path.size())
- return path.substr(last_slash + 1);
- return path;
-}
-
-std::string StripFileType(const std::string& path) {
- size_t last_period = path.find_last_of('.');
- if (last_period != std::string::npos)
- return path.substr(0, last_period);
- return path;
-}
-
-// See http://stackoverflow.com/a/29752943
-std::string ReplaceAll(const std::string& source,
- const std::string& from,
- const std::string& to) {
- std::string result;
- result.reserve(source.length()); // avoids a few memory allocations
-
- std::string::size_type last_pos = 0;
- std::string::size_type find_pos;
-
- while (std::string::npos != (find_pos = source.find(from, last_pos))) {
- result.append(source, last_pos, find_pos - last_pos);
- result += to;
- last_pos = find_pos + from.length();
- }
-
- // Care for the rest after last occurrence
- result += source.substr(last_pos);
-
- return result;
-}
-
-std::vector<std::string> SplitString(const std::string& str,
- const std::string& delimiter) {
- // http://stackoverflow.com/a/13172514
- std::vector<std::string> strings;
-
- std::string::size_type pos = 0;
- std::string::size_type prev = 0;
- while ((pos = str.find(delimiter, prev)) != std::string::npos) {
- strings.emplace_back(str.substr(prev, pos - prev));
- prev = pos + 1;
- }
-
- // To get the last substring (or only, if delimiter is not found)
- strings.emplace_back(str.substr(prev));
-
- return strings;
-}
-
-void EnsureEndsInSlash(std::string& path) {
- if (path.empty() || path[path.size() - 1] != '/')
- path += '/';
-}
-
-std::string EscapeFileName(std::string path) {
- if (path.size() && path.back() == '/')
- path.pop_back();
- std::replace(path.begin(), path.end(), '\\', '@');
- std::replace(path.begin(), path.end(), '/', '@');
- std::replace(path.begin(), path.end(), ':', '@');
- return path;
-}
-
-// http://stackoverflow.com/a/6089413
-std::istream& SafeGetline(std::istream& is, std::string& t) {
- t.clear();
-
- // The characters in the stream are read one-by-one using a std::streambuf.
- // That is faster than reading them one-by-one using the std::istream. Code
- // that uses streambuf this way must be guarded by a sentry object. The sentry
- // object performs various tasks, such as thread synchronization and updating
- // the stream state.
-
- std::istream::sentry se(is, true);
- std::streambuf* sb = is.rdbuf();
-
- for (;;) {
- int c = sb->sbumpc();
- if (c == EOF) {
- // Also handle the case when the last line has no line ending
- if (t.empty())
- is.setstate(std::ios::eofbit);
- return is;
- }
-
- t += (char)c;
-
- if (c == '\n')
- return is;
- }
-}
-
-bool FileExists(const std::string& filename) {
- std::ifstream cache(filename);
- return cache.is_open();
-}
-
-optional<std::string> ReadContent(const AbsolutePath& filename) {
-
- std::ifstream cache;
- cache.open(filename.path);
-
- try {
- return std::string(std::istreambuf_iterator<char>(cache),
- std::istreambuf_iterator<char>());
- } catch (std::ios_base::failure&) {
- return {};
- }
-}
-
-std::vector<std::string> ReadLinesWithEnding(const AbsolutePath& filename) {
- std::vector<std::string> result;
-
- std::ifstream input(filename.path);
- for (std::string line; SafeGetline(input, line);)
- result.emplace_back(line);
-
- return result;
-}
-
-bool WriteToFile(const std::string& filename, const std::string& content) {
- std::ofstream file(filename,
- std::ios::out | std::ios::trunc | std::ios::binary);
- if (!file.good()) {
-
- return false;
- }
-
- file << content;
- return true;
-}
-
-
-std::string FormatMicroseconds(long long microseconds) {
- long long milliseconds = microseconds / 1000;
- long long remaining = microseconds - milliseconds;
-
- // Only show two digits after the dot.
- while (remaining >= 100)
- remaining /= 10;
-
- return std::to_string(milliseconds) + "." + std::to_string(remaining) + "ms";
-}
-
-
-
-std::string UpdateToRnNewlines(std::string output) {
- size_t idx = 0;
- while (true) {
- idx = output.find('\n', idx);
-
- // No more matches.
- if (idx == std::string::npos)
- break;
-
- // Skip an existing "\r\n" match.
- if (idx > 0 && output[idx - 1] == '\r') {
- ++idx;
- continue;
- }
-
- // Replace "\n" with "\r|n".
- output.replace(output.begin() + idx, output.begin() + idx + 1, "\r\n");
- }
-
- return output;
-}
-
-
-
-bool IsAbsolutePath(const std::string& path) {
- return IsUnixAbsolutePath(path) || IsWindowsAbsolutePath(path);
-}
-
-bool IsUnixAbsolutePath(const std::string& path) {
- return !path.empty() && path[0] == '/';
-}
-
-bool IsWindowsAbsolutePath(const std::string& path) {
- auto is_drive_letter = [](char c) {
- return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z');
- };
-
- return path.size() > 3 && path[1] == ':' &&
- (path[2] == '/' || path[2] == '\\') && is_drive_letter(path[0]);
-}
-
-bool IsDirectory(const std::string& path) {
- struct stat path_stat;
-
- if (stat(path.c_str(), &path_stat) != 0) {
- perror("cannot access path");
- return false;
- }
-
- return path_stat.st_mode & S_IFDIR;
-}
-
- std::string ws2s(std::wstring const& wstr) {
- if(sizeof(wchar_t) == 2){
- std::string narrow;
- utf8::utf16to8(wstr.begin(), wstr.end(), std::back_inserter(narrow));
- return narrow;
- }else{
- std::string narrow;
- utf8::utf32to8(wstr.begin(), wstr.end(), std::back_inserter(narrow));
- return narrow;
- }
-
- }
- std::wstring s2ws(const std::string& str) {
- std::wstring wide;
- if(sizeof(wchar_t) == 2){
- utf8::utf8to16(str.begin(), str.end(), std::back_inserter(wide));
- return wide;
- }else{
- utf8::utf8to32(str.begin(), str.end(), std::back_inserter(wide));
- return wide;
- }
- }
-
-#ifdef _WIN32
-
-#else
-// Returns the canonicalized absolute pathname, without expanding symbolic
-// links. This is a variant of realpath(2), C++ rewrite of
-// https://github.com/freebsd/freebsd/blob/master/lib/libc/stdlib/realpath.c
-AbsolutePath RealPathNotExpandSymlink(std::string path,
- bool ensure_exists) {
- if (path.empty()) {
- errno = EINVAL;
- return {};
- }
- if (path[0] == '\0') {
- errno = ENOENT;
- return {};
- }
-
- // Do not use PATH_MAX because it is tricky on Linux.
- // See https://eklitzke.org/path-max-is-tricky
- char tmp[1024];
- std::string resolved;
- size_t i = 0;
- struct stat sb;
- if (path[0] == '/') {
- resolved = "/";
- i = 1;
- }
- else {
- if (!getcwd(tmp, sizeof tmp) && ensure_exists)
- return {};
- resolved = tmp;
- }
-
- while (i < path.size()) {
- auto j = path.find('/', i);
- if (j == std::string::npos)
- j = path.size();
- auto next_token = path.substr(i, j - i);
- i = j + 1;
- if (resolved.back() != '/')
- resolved += '/';
- if (next_token.empty() || next_token == ".") {
- // Handle consequential slashes and "."
- continue;
- }
- else if (next_token == "..") {
- // Strip the last path component except when it is single "/"
- if (resolved.size() > 1)
- resolved.resize(resolved.rfind('/', resolved.size() - 2) + 1);
- continue;
- }
- // Append the next path component.
- // Here we differ from realpath(3), we use stat(2) instead of
- // lstat(2) because we do not want to resolve symlinks.
- resolved += next_token;
- if (stat(resolved.c_str(), &sb) != 0 && ensure_exists)
- return {};
- if (!S_ISDIR(sb.st_mode) && j < path.size() && ensure_exists) {
- errno = ENOTDIR;
- return {};
- }
- }
-
- // Remove trailing slash except when a single "/".
- if (resolved.size() > 1 && resolved.back() == '/')
- resolved.pop_back();
- return AbsolutePath(resolved, true /*validate*/);
-}
-#endif
-
-
-AbsolutePath NormalizePath(const std::string& path0,
- bool ensure_exists ,
- bool force_lower_on_windows) {
-#ifdef _WIN32
-
- std::wstring path = lsp::s2ws(path0);
-
- wchar_t buffer[MAX_PATH] = (L"");
-
- // Normalize the path name, ie, resolve `..`.
- unsigned long len = GetFullPathNameW(path.c_str(), MAX_PATH, buffer, nullptr);
- if (!len)
- return {};
- path = std::wstring(buffer, len);
-
- // Get the actual casing of the path, ie, if the file on disk is `C:\FooBar`
- // and this function is called with `c:\fooBar` this will return `c:\FooBar`.
- // (drive casing is lowercase).
- if (ensure_exists) {
- len = GetLongPathNameW(path.c_str(), buffer, MAX_PATH);
- if (!len)
- return {};
- path = std::wstring(buffer, len);
- }
-
- // Empty paths have no meaning.
- if (path.empty())
- return {};
-
- // We may need to normalize the drive name to upper-case; at the moment
- // vscode sends lower-case path names.
- /*
- path[0] = toupper(path[0]);
- */
- // Make the path all lower-case, since windows is case-insensitive.
- if (force_lower_on_windows) {
- for (size_t i = 0; i < path.size(); ++i)
- path[i] = (wchar_t)tolower(path[i]);
- }
-
- // cquery assumes forward-slashes.
- std::replace(path.begin(), path.end(), '\\', '/');
-
-
- return AbsolutePath(lsp::ws2s(path), false /*validate*/);
-#else
-
- return RealPathNotExpandSymlink(path0, ensure_exists);
-
-#endif
-
-
-}
-
-// VSCode (UTF-16) disagrees with Emacs lsp-mode (UTF-8) on how to represent
-// text documents.
-// We use a UTF-8 iterator to approximate UTF-16 in the specification (weird).
-// This is good enough and fails only for UTF-16 surrogate pairs.
-int GetOffsetForPosition(lsPosition position, const std::string& content) {
- size_t i = 0;
- // Iterate lines until we have found the correct line.
- while (position.line > 0 && i < content.size()) {
- if (content[i] == '\n')
- position.line--;
- i++;
- }
- // Iterate characters on the target line.
- while (position.character > 0 && i < content.size()) {
- if (uint8_t(content[i++]) >= 128) {
- // Skip 0b10xxxxxx
- while (i < content.size() && uint8_t(content[i]) >= 128 &&
- uint8_t(content[i]) < 192)
- i++;
- }
- position.character--;
- }
- return int(i);
-}
-
-
-lsPosition GetPositionForOffset(size_t offset,const std::string& content) {
- lsPosition result;
- for (size_t i = 0; i < offset && i < content.length(); ++i) {
- if (content[i] == '\n') {
- result.line++;
- result.character = 0;
- }
- else {
- result.character++;
- }
- }
- return result;
-}
-
-lsPosition CharPos(const std::string& search,
- char character,
- int character_offset) {
- lsPosition result;
- size_t index = 0;
- while (index < search.size()) {
- char c = search[index];
- if (c == character)
- break;
- if (c == '\n') {
- result.line += 1;
- result.character = 0;
- }
- else {
- result.character += 1;
- }
- ++index;
- }
- assert(index < search.size());
- result.character += character_offset;
- return result;
-}
-
-void scanDirsUseRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret)
-{
- namespace fs = boost::filesystem;
- fs::path fullpath(rootPath);
- if (!fs::exists(fullpath)) { return; }
- fs::recursive_directory_iterator end_iter;
- for (fs::recursive_directory_iterator iter(fullpath); iter != end_iter; iter++) {
- try {
- if (fs::is_directory(*iter)) {
- ret.push_back(iter->path().wstring());
- }
- }
- catch (const std::exception& ex) {
- continue;
- }
- }
-}
-
-void scanDirsNoRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret)
-{
- namespace fs = boost::filesystem;
- boost::filesystem::path myPath(rootPath);
- if (!fs::exists(rootPath)) { return; }
- boost::filesystem::directory_iterator endIter;
- for (boost::filesystem::directory_iterator iter(myPath); iter != endIter; iter++) {
- if (boost::filesystem::is_directory(*iter)) {
- ret.push_back(iter->path().wstring());
- }
- }
-}
-
-void scanFilesUseRecursive(
- const std::wstring& rootPath,
- std::vector<std::wstring>& ret,
- std::wstring suf) {
- namespace fs = boost::filesystem;
- boost::to_lower(suf);
-
- fs::path fullpath(rootPath);
- if (!fs::exists(fullpath)) { return; }
- fs::recursive_directory_iterator end_iter;
- for (fs::recursive_directory_iterator iter(fullpath); iter != end_iter; iter++) {
- try {
- if (!fs::is_directory(*iter) && fs::is_regular_file(*iter)) {
- auto temp_path = iter->path().wstring();
- auto size = suf.size();
- if (!size)
- {
- ret.push_back(std::move(temp_path));
- }
- else
- {
-
- if (temp_path.size() < size) continue;
- auto suf_temp = temp_path.substr(temp_path.size() - size);
- boost::to_lower(suf_temp);
- if (suf_temp == suf)
- {
- ret.push_back(std::move(temp_path));
- }
- }
- }
- }
- catch (const std::exception&) {
- continue;
- }
- }
-}
-
-void scanFileNamesUseRecursive(const std::wstring& rootPath, std::vector<std::wstring>& ret,
- std::wstring strSuf)
-{
- scanFilesUseRecursive(rootPath, ret, strSuf);
- std::vector<std::wstring> names;
- for (auto& it : ret)
- {
- if (it.size() >= rootPath.size())
- {
- names.push_back(it.substr(rootPath.size()));
- }
- }
- ret.swap(names);
-}
-
-void scanFileNamesUseRecursive(const std::string& rootPath, std::vector<std::string>& ret, std::string strSuf)
-{
- std::vector<std::wstring> out;
- scanFileNamesUseRecursive(s2ws(rootPath), out, s2ws(strSuf));
- for (auto& it : out)
- {
- ret.push_back(ws2s(it));
- }
-}
-
-void scanFilesUseRecursive(const std::string& rootPath, std::vector<std::string>& ret, std::string strSuf)
-{
- std::vector<std::wstring> out;
- scanFilesUseRecursive(s2ws(rootPath), out, s2ws(strSuf));
- for (auto& it : out)
- {
- ret.push_back(ws2s(it));
- }
-}
-
-
-}
diff --git a/graphics/asymptote/LspCpp/src/lsp/working_files.cpp b/graphics/asymptote/LspCpp/src/lsp/working_files.cpp
deleted file mode 100644
index 4eb4b29053..0000000000
--- a/graphics/asymptote/LspCpp/src/lsp/working_files.cpp
+++ /dev/null
@@ -1,186 +0,0 @@
-#include "LibLsp/lsp/working_files.h"
-#include <algorithm>
-#include <climits>
-#include <numeric>
-#include "LibLsp/lsp/utils.h"
-#include <memory>
-#include "LibLsp/lsp/AbsolutePath.h"
-using namespace lsp;
-struct WorkingFilesData
-{
- std::map<AbsolutePath, std::shared_ptr<WorkingFile> > files;
- std::mutex files_mutex; // Protects |d_ptr->files|.
-};
-
-WorkingFile::WorkingFile(WorkingFiles& _parent, const AbsolutePath& filename,
- const std::string& buffer_content)
- : filename(filename), directory(filename), parent(_parent), counter(0), buffer_content(buffer_content)
-{
- directory = Directory(GetDirName(filename.path));
-}
-
-WorkingFile::WorkingFile(WorkingFiles& _parent, const AbsolutePath& filename,
- std::string&& buffer_content)
- : filename(filename), directory(filename), parent(_parent), counter(0), buffer_content(buffer_content)
-{
- directory = Directory(GetDirName(filename.path));
-}
-
-WorkingFiles::WorkingFiles():d_ptr(new WorkingFilesData())
-{
-}
-
-WorkingFiles::~WorkingFiles()
-{
- delete d_ptr;
-
-}
-
-
-
-void WorkingFiles::CloseFilesInDirectory(const std::vector<Directory>& directories)
-{
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
- std::vector<AbsolutePath> files_to_be_delete;
-
- for(auto& it : d_ptr->files)
- {
- for (auto& dir : directories)
- {
- if (it.second->directory == dir) {
- files_to_be_delete.emplace_back(it.first);
- }
- }
- }
-
- for(auto& it : files_to_be_delete)
- {
- d_ptr->files.erase(it);
- }
-}
-
-
-
-
-std::shared_ptr<WorkingFile> WorkingFiles::GetFileByFilename(const AbsolutePath& filename) {
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
- return GetFileByFilenameNoLock(filename);
-}
-
-std::shared_ptr<WorkingFile> WorkingFiles::GetFileByFilenameNoLock(
- const AbsolutePath& filename) {
- const auto findIt = d_ptr->files.find(filename);
- if ( findIt != d_ptr->files.end())
- {
- return findIt->second;
- }
- return nullptr;
-}
-
-
-
-std::shared_ptr<WorkingFile> WorkingFiles::OnOpen( lsTextDocumentItem& open) {
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
-
- AbsolutePath filename = open.uri.GetAbsolutePath();
-
- // The file may already be open.
- if (auto file = GetFileByFilenameNoLock(filename)) {
- file->version = open.version;
- file->buffer_content.swap(open.text);
-
- return file;
- }
-
- const auto& it = d_ptr->files.insert({ filename,std::make_shared<WorkingFile>(*this,filename, std::move(open.text)) });
- return it.first->second;
-}
-
-
-std::shared_ptr<WorkingFile> WorkingFiles::OnChange(const lsTextDocumentDidChangeParams& change) {
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
-
- AbsolutePath filename = change.textDocument.uri.GetAbsolutePath();
- auto file = GetFileByFilenameNoLock(filename);
- if (!file) {
- return {};
- }
-
- if (change.textDocument.version)
- file->version = *change.textDocument.version;
- file->counter.fetch_add(1, std::memory_order_relaxed);
- for (const lsTextDocumentContentChangeEvent& diff : change.contentChanges) {
- // Per the spec replace everything if the rangeLength and range are not set.
- // See https://github.com/Microsoft/language-server-protocol/issues/9.
- if (!diff.range) {
- file->buffer_content = diff.text;
-
- } else {
- int start_offset =
- GetOffsetForPosition(diff.range->start, file->buffer_content);
- // Ignore TextDocumentContentChangeEvent.rangeLength which causes trouble
- // when UTF-16 surrogate pairs are used.
- int end_offset =
- GetOffsetForPosition(diff.range->end, file->buffer_content);
- file->buffer_content.replace(file->buffer_content.begin() + start_offset,
- file->buffer_content.begin() + end_offset,
- diff.text);
-
- }
- }
- return file;
-}
-
-bool WorkingFiles::OnClose(const lsTextDocumentIdentifier& close) {
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
-
- AbsolutePath filename = close.uri.GetAbsolutePath();
- const auto findIt = d_ptr->files.find(filename);
- if( findIt != d_ptr->files.end())
- {
- d_ptr->files.erase(findIt);
- return true;
- }
- return false;
-}
-
-std::shared_ptr<WorkingFile> WorkingFiles::OnSave(const lsTextDocumentIdentifier& _save)
-{
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
-
- AbsolutePath filename = _save.uri.GetAbsolutePath();
- const auto findIt = d_ptr->files.find(filename);
- if (findIt != d_ptr->files.end())
- {
- std::shared_ptr<WorkingFile>& file = findIt->second;
- lsp::WriteToFile(file->filename, file->GetContentNoLock());
- return findIt->second;
- }
- return {};
-
-}
-
-bool WorkingFiles::GetFileBufferContent(std::shared_ptr<WorkingFile>&file, std::string& out)
-{
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
- if (file)
- {
- out = file->buffer_content;
- return true;
- }
- return false;
-}
-bool WorkingFiles::GetFileBufferContent(std::shared_ptr<WorkingFile>& file, std::wstring& out)
-{
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
- if (file)
- {
- out = lsp::s2ws(file->buffer_content);
- return true;
- }
- return false;
-}
-void WorkingFiles::Clear() {
- std::lock_guard<std::mutex> lock(d_ptr->files_mutex);
- d_ptr->files.clear();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/CHANGELOG.md b/graphics/asymptote/LspCpp/third_party/rapidjson/CHANGELOG.md
deleted file mode 100644
index 1c580bd140..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/CHANGELOG.md
+++ /dev/null
@@ -1,158 +0,0 @@
-# Change Log
-All notable changes to this project will be documented in this file.
-This project adheres to [Semantic Versioning](http://semver.org/).
-
-## [Unreleased]
-
-## 1.1.0 - 2016-08-25
-
-### Added
-* Add GenericDocument ctor overload to specify JSON type (#369)
-* Add FAQ (#372, #373, #374, #376)
-* Add forward declaration header `fwd.h`
-* Add @PlatformIO Library Registry manifest file (#400)
-* Implement assignment operator for BigInteger (#404)
-* Add comments support (#443)
-* Adding coapp definition (#460)
-* documenttest.cpp: EXPECT_THROW when checking empty allocator (470)
-* GenericDocument: add implicit conversion to ParseResult (#480)
-* Use <wchar.h> with C++ linkage on Windows ARM (#485)
-* Detect little endian for Microsoft ARM targets
-* Check Nan/Inf when writing a double (#510)
-* Add JSON Schema Implementation (#522)
-* Add iostream wrapper (#530)
-* Add Jsonx example for converting JSON into JSONx (a XML format) (#531)
-* Add optional unresolvedTokenIndex parameter to Pointer::Get() (#532)
-* Add encoding validation option for Writer/PrettyWriter (#534)
-* Add Writer::SetMaxDecimalPlaces() (#536)
-* Support {0, } and {0, m} in Regex (#539)
-* Add Value::Get/SetFloat(), Value::IsLossLessFloat/Double() (#540)
-* Add stream position check to reader unit tests (#541)
-* Add Templated accessors and range-based for (#542)
-* Add (Pretty)Writer::RawValue() (#543)
-* Add Document::Parse(std::string), Document::Parse(const char*, size_t length) and related APIs. (#553)
-* Add move constructor for GenericSchemaDocument (#554)
-* Add VS2010 and VS2015 to AppVeyor CI (#555)
-* Add parse-by-parts example (#556, #562)
-* Support parse number as string (#564, #589)
-* Add kFormatSingleLineArray for PrettyWriter (#577)
-* Added optional support for trailing commas (#584)
-* Added filterkey and filterkeydom examples (#615)
-* Added npm docs (#639)
-* Allow options for writing and parsing NaN/Infinity (#641)
-* Add std::string overload to PrettyWriter::Key() when RAPIDJSON_HAS_STDSTRING is defined (#698)
-
-### Fixed
-* Fix gcc/clang/vc warnings (#350, #394, #397, #444, #447, #473, #515, #582, #589, #595, #667)
-* Fix documentation (#482, #511, #550, #557, #614, #635, #660)
-* Fix emscripten alignment issue (#535)
-* Fix missing allocator to uses of AddMember in document (#365)
-* CMake will no longer complain that the minimum CMake version is not specified (#501)
-* Make it usable with old VC8 (VS2005) (#383)
-* Prohibit C++11 move from Document to Value (#391)
-* Try to fix incorrect 64-bit alignment (#419)
-* Check return of fwrite to avoid warn_unused_result build failures (#421)
-* Fix UB in GenericDocument::ParseStream (#426)
-* Keep Document value unchanged on parse error (#439)
-* Add missing return statement (#450)
-* Fix Document::Parse(const Ch*) for transcoding (#478)
-* encodings.h: fix typo in preprocessor condition (#495)
-* Custom Microsoft headers are necessary only for Visual Studio 2012 and lower (#559)
-* Fix memory leak for invalid regex (26e69ffde95ba4773ab06db6457b78f308716f4b)
-* Fix a bug in schema minimum/maximum keywords for 64-bit integer (e7149d665941068ccf8c565e77495521331cf390)
-* Fix a crash bug in regex (#605)
-* Fix schema "required" keyword cannot handle duplicated keys (#609)
-* Fix cmake CMP0054 warning (#612)
-* Added missing include guards in istreamwrapper.h and ostreamwrapper.h (#634)
-* Fix undefined behaviour (#646)
-* Fix buffer overrun using PutN (#673)
-* Fix rapidjson::value::Get<std::string>() may returns wrong data (#681)
-* Add Flush() for all value types (#689)
-* Handle malloc() fail in PoolAllocator (#691)
-* Fix builds on x32 platform. #703
-
-### Changed
-* Clarify problematic JSON license (#392)
-* Move Travis to container based infrastructure (#504, #558)
-* Make whitespace array more compact (#513)
-* Optimize Writer::WriteString() with SIMD (#544)
-* x86-64 48-bit pointer optimization for GenericValue (#546)
-* Define RAPIDJSON_HAS_CXX11_RVALUE_REFS directly in clang (#617)
-* Make GenericSchemaDocument constructor explicit (#674)
-* Optimize FindMember when use std::string (#690)
-
-## [1.0.2] - 2015-05-14
-
-### Added
-* Add Value::XXXMember(...) overloads for std::string (#335)
-
-### Fixed
-* Include rapidjson.h for all internal/error headers.
-* Parsing some numbers incorrectly in full-precision mode (`kFullPrecisionParseFlag`) (#342)
-* Fix some numbers parsed incorrectly (#336)
-* Fix alignment of 64bit platforms (#328)
-* Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502573f1afd3341073dd24b12c3db20fbde4)
-
-### Changed
-* CMakeLists for include as a thirdparty in projects (#334, #337)
-* Change Document::ParseStream() to use stack allocator for Reader (ffbe38614732af8e0b3abdc8b50071f386a4a685)
-
-## [1.0.1] - 2015-04-25
-
-### Added
-* Changelog following [Keep a CHANGELOG](https://github.com/olivierlacan/keep-a-changelog) suggestions.
-
-### Fixed
-* Parsing of some numbers (e.g. "1e-00011111111111") causing assertion (#314).
-* Visual C++ 32-bit compilation error in `diyfp.h` (#317).
-
-## [1.0.0] - 2015-04-22
-
-### Added
-* 100% [Coverall](https://coveralls.io/r/Tencent/rapidjson?branch=master) coverage.
-* Version macros (#311)
-
-### Fixed
-* A bug in trimming long number sequence (4824f12efbf01af72b8cb6fc96fae7b097b73015).
-* Double quote in unicode escape (#288).
-* Negative zero roundtrip (double only) (#289).
-* Standardize behavior of `memcpy()` and `malloc()` (0c5c1538dcfc7f160e5a4aa208ddf092c787be5a, #305, 0e8bbe5e3ef375e7f052f556878be0bd79e9062d).
-
-### Removed
-* Remove an invalid `Document::ParseInsitu()` API (e7f1c6dd08b522cfcf9aed58a333bd9a0c0ccbeb).
-
-## 1.0-beta - 2015-04-8
-
-### Added
-* RFC 7159 (#101)
-* Optional Iterative Parser (#76)
-* Deep-copy values (#20)
-* Error code and message (#27)
-* ASCII Encoding (#70)
-* `kParseStopWhenDoneFlag` (#83)
-* `kParseFullPrecisionFlag` (881c91d696f06b7f302af6d04ec14dd08db66ceb)
-* Add `Key()` to handler concept (#134)
-* C++11 compatibility and support (#128)
-* Optimized number-to-string and vice versa conversions (#137, #80)
-* Short-String Optimization (#131)
-* Local stream optimization by traits (#32)
-* Travis & Appveyor Continuous Integration, with Valgrind verification (#24, #242)
-* Redo all documentation (English, Simplified Chinese)
-
-### Changed
-* Copyright ownership transferred to THL A29 Limited (a Tencent company).
-* Migrating from Premake to CMAKE (#192)
-* Resolve all warning reports
-
-### Removed
-* Remove other JSON libraries for performance comparison (#180)
-
-## 0.11 - 2012-11-16
-
-## 0.1 - 2011-11-18
-
-[Unreleased]: https://github.com/Tencent/rapidjson/compare/v1.1.0...HEAD
-[1.1.0]: https://github.com/Tencent/rapidjson/compare/v1.0.2...v1.1.0
-[1.0.2]: https://github.com/Tencent/rapidjson/compare/v1.0.1...v1.0.2
-[1.0.1]: https://github.com/Tencent/rapidjson/compare/v1.0.0...v1.0.1
-[1.0.0]: https://github.com/Tencent/rapidjson/compare/v1.0-beta...v1.0.0
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeLists.txt
deleted file mode 100644
index dd1f173d1c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeLists.txt
+++ /dev/null
@@ -1,251 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)
-if(POLICY CMP0025)
- # detect Apple's Clang
- cmake_policy(SET CMP0025 NEW)
-endif()
-if(POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif()
-
-SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)
-
-set(LIB_MAJOR_VERSION "1")
-set(LIB_MINOR_VERSION "1")
-set(LIB_PATCH_VERSION "0")
-set(LIB_VERSION_STRING "${LIB_MAJOR_VERSION}.${LIB_MINOR_VERSION}.${LIB_PATCH_VERSION}")
-
-if (CMAKE_VERSION VERSION_LESS 3.0)
- PROJECT(RapidJSON CXX)
-else()
- cmake_policy(SET CMP0048 NEW)
- PROJECT(RapidJSON VERSION "${LIB_VERSION_STRING}" LANGUAGES CXX)
-endif()
-
-# compile in release with debug info mode by default
-if(NOT CMAKE_BUILD_TYPE)
- set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE)
-endif()
-
-# Build all binaries in a separate directory
-SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
-
-option(RAPIDJSON_BUILD_DOC "Build rapidjson documentation." ON)
-option(RAPIDJSON_BUILD_EXAMPLES "Build rapidjson examples." ON)
-option(RAPIDJSON_BUILD_TESTS "Build rapidjson perftests and unittests." ON)
-option(RAPIDJSON_BUILD_THIRDPARTY_GTEST
- "Use gtest installation in `thirdparty/gtest` by default if available" OFF)
-
-option(RAPIDJSON_BUILD_CXX11 "Build rapidjson with C++11" ON)
-option(RAPIDJSON_BUILD_CXX17 "Build rapidjson with C++17" OFF)
-if(RAPIDJSON_BUILD_CXX11)
- set(CMAKE_CXX_STANDARD 11)
- set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
-endif()
-
-option(RAPIDJSON_BUILD_ASAN "Build rapidjson with address sanitizer (gcc/clang)" OFF)
-option(RAPIDJSON_BUILD_UBSAN "Build rapidjson with undefined behavior sanitizer (gcc/clang)" OFF)
-
-option(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT "Build rapidjson with -march or -mcpu options" ON)
-
-option(RAPIDJSON_HAS_STDSTRING "" OFF)
-if(RAPIDJSON_HAS_STDSTRING)
- add_definitions(-DRAPIDJSON_HAS_STDSTRING)
-endif()
-
-option(RAPIDJSON_USE_MEMBERSMAP "" OFF)
-if(RAPIDJSON_USE_MEMBERSMAP)
- add_definitions(-DRAPIDJSON_USE_MEMBERSMAP=1)
-endif()
-
-find_program(CCACHE_FOUND ccache)
-if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
- endif()
-endif(CCACHE_FOUND)
-
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- if(RAPIDJSON_ENABLE_INSTRUMENTATION_OPT AND NOT CMAKE_CROSSCOMPILING)
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
- else()
- #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
- endif()
- endif()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror")
- set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wsign-conversion)
- if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1)
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.7.0")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- endif()
- elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.0")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
- endif()
- if (RAPIDJSON_BUILD_ASAN)
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.0")
- message(FATAL_ERROR "GCC < 4.8 doesn't support the address sanitizer")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
- endif()
- endif()
- if (RAPIDJSON_BUILD_UBSAN)
- if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.9.0")
- message(FATAL_ERROR "GCC < 4.9 doesn't support the undefined behavior sanitizer")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
- endif()
- endif()
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- if(NOT CMAKE_CROSSCOMPILING)
- if(CMAKE_SYSTEM_PROCESSOR STREQUAL "powerpc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "ppc64le")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mcpu=native")
- else()
- #FIXME: x86 is -march=native, but doesn't mean every arch is this option. To keep original project's compatibility, I leave this except POWER.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
- endif()
- endif()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Werror -Wno-missing-field-initializers")
- set(EXTRA_CXX_FLAGS -Weffc++ -Wswitch-default -Wfloat-equal -Wconversion -Wimplicit-fallthrough)
- if (RAPIDJSON_BUILD_CXX11 AND CMAKE_VERSION VERSION_LESS 3.1)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.0")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17")
- endif()
- if (RAPIDJSON_BUILD_ASAN)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
- endif()
- if (RAPIDJSON_BUILD_UBSAN)
- if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined-trap -fsanitize-undefined-trap-on-error")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
- endif()
- endif()
-elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
- add_definitions(-D_CRT_SECURE_NO_WARNINGS=1)
- add_definitions(-DNOMINMAX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
- # CMake >= 3.10 should handle the above CMAKE_CXX_STANDARD fine, otherwise use /std:c++XX with MSVC >= 19.10
- if (RAPIDJSON_BUILD_CXX11 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.10")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++11")
- elseif (RAPIDJSON_BUILD_CXX17 AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "19.14")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17")
- endif()
- # Always compile with /WX
- if(CMAKE_CXX_FLAGS MATCHES "/WX-")
- string(REGEX REPLACE "/WX-" "/WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
- endif()
-elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -qarch=auto")
-endif()
-
-#add extra search paths for libraries and includes
-SET(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "The directory the headers are installed in")
-SET(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE STRING "Directory where lib will install")
-SET(DOC_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/share/doc/${PROJECT_NAME}" CACHE PATH "Path to the documentation")
-
-IF(UNIX OR CYGWIN)
- SET(_CMAKE_INSTALL_DIR "${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME}")
-ELSEIF(WIN32)
- SET(_CMAKE_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/cmake")
-ENDIF()
-SET(CMAKE_INSTALL_DIR "${_CMAKE_INSTALL_DIR}" CACHE PATH "The directory cmake files are installed in")
-
-include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-if(RAPIDJSON_BUILD_DOC)
- add_subdirectory(doc)
-endif()
-
-add_custom_target(travis_doc)
-add_custom_command(TARGET travis_doc
- COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/travis-doxygen.sh)
-
-if(RAPIDJSON_BUILD_EXAMPLES)
- add_subdirectory(example)
-endif()
-
-if(RAPIDJSON_BUILD_TESTS)
- if(MSVC11)
- # required for VS2012 due to missing support for variadic templates
- add_definitions(-D_VARIADIC_MAX=10)
- endif(MSVC11)
- add_subdirectory(test)
- include(CTest)
-endif()
-
-# pkg-config
-IF (UNIX OR CYGWIN)
- CONFIGURE_FILE (${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc.in
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
- @ONLY)
- INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc
- DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
- COMPONENT pkgconfig)
-ENDIF()
-
-install(FILES readme.md
- DESTINATION "${DOC_INSTALL_DIR}"
- COMPONENT doc)
-
-install(DIRECTORY include/rapidjson
- DESTINATION "${INCLUDE_INSTALL_DIR}"
- COMPONENT dev)
-
-install(DIRECTORY example/
- DESTINATION "${DOC_INSTALL_DIR}/examples"
- COMPONENT examples
- # Following patterns are for excluding the intermediate/object files
- # from an install of in-source CMake build.
- PATTERN "CMakeFiles" EXCLUDE
- PATTERN "Makefile" EXCLUDE
- PATTERN "cmake_install.cmake" EXCLUDE)
-
-# Provide config and version files to be used by other applications
-# ===============================
-
-################################################################################
-# Export package for use from the build tree
-EXPORT( PACKAGE ${PROJECT_NAME} )
-
-# Create the RapidJSONConfig.cmake file for other cmake projects.
-# ... for the build tree
-SET( CONFIG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
-SET( CONFIG_DIR ${CMAKE_CURRENT_BINARY_DIR})
-SET( ${PROJECT_NAME}_INCLUDE_DIR "\${${PROJECT_NAME}_SOURCE_DIR}/include" )
-
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake @ONLY )
-CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}ConfigVersion.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake @ONLY)
-
-# ... for the install tree
-SET( CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/${PROJECT_NAME} )
-FILE( RELATIVE_PATH REL_INCLUDE_DIR
- "${CMAKECONFIG_INSTALL_DIR}"
- "${CMAKE_INSTALL_PREFIX}/include" )
-
-SET( ${PROJECT_NAME}_INCLUDE_DIR "\${${PROJECT_NAME}_CMAKE_DIR}/${REL_INCLUDE_DIR}" )
-SET( CONFIG_SOURCE_DIR )
-SET( CONFIG_DIR )
-CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake @ONLY )
-
-INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${PROJECT_NAME}Config.cmake"
- DESTINATION ${CMAKECONFIG_INSTALL_DIR} )
-
-# Install files
-IF(CMAKE_INSTALL_DIR)
- INSTALL(FILES
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake
- DESTINATION "${CMAKE_INSTALL_DIR}"
- COMPONENT dev)
-ENDIF()
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeModules/FindGTestSrc.cmake b/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeModules/FindGTestSrc.cmake
deleted file mode 100644
index f3cb8c9908..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/CMakeModules/FindGTestSrc.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-
-SET(GTEST_SEARCH_PATH
- "${GTEST_SOURCE_DIR}"
- "${CMAKE_CURRENT_LIST_DIR}/../thirdparty/gtest/googletest")
-
-IF(UNIX)
- IF(RAPIDJSON_BUILD_THIRDPARTY_GTEST)
- LIST(APPEND GTEST_SEARCH_PATH "/usr/src/gtest")
- ELSE()
- LIST(INSERT GTEST_SEARCH_PATH 1 "/usr/src/gtest")
- ENDIF()
-ENDIF()
-
-FIND_PATH(GTEST_SOURCE_DIR
- NAMES CMakeLists.txt src/gtest_main.cc
- PATHS ${GTEST_SEARCH_PATH})
-
-
-# Debian installs gtest include directory in /usr/include, thus need to look
-# for include directory separately from source directory.
-FIND_PATH(GTEST_INCLUDE_DIR
- NAMES gtest/gtest.h
- PATH_SUFFIXES include
- HINTS ${GTEST_SOURCE_DIR}
- PATHS ${GTEST_SEARCH_PATH})
-
-INCLUDE(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(GTestSrc DEFAULT_MSG
- GTEST_SOURCE_DIR
- GTEST_INCLUDE_DIR)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSON.pc.in b/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSON.pc.in
deleted file mode 100644
index 6afb079f81..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSON.pc.in
+++ /dev/null
@@ -1,7 +0,0 @@
-includedir=@INCLUDE_INSTALL_DIR@
-
-Name: @PROJECT_NAME@
-Description: A fast JSON parser/generator for C++ with both SAX/DOM style API
-Version: @LIB_VERSION_STRING@
-URL: https://github.com/Tencent/rapidjson
-Cflags: -I${includedir}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfig.cmake.in b/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfig.cmake.in
deleted file mode 100644
index c25d312585..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfig.cmake.in
+++ /dev/null
@@ -1,25 +0,0 @@
-################################################################################
-# CMake minimum version required
-cmake_minimum_required(VERSION 3.0)
-
-################################################################################
-# RapidJSON source dir
-set( RapidJSON_SOURCE_DIR "@CONFIG_SOURCE_DIR@")
-
-################################################################################
-# RapidJSON build dir
-set( RapidJSON_DIR "@CONFIG_DIR@")
-
-################################################################################
-# Compute paths
-get_filename_component(RapidJSON_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
-
-set( RapidJSON_INCLUDE_DIR "@RapidJSON_INCLUDE_DIR@" )
-set( RapidJSON_INCLUDE_DIRS "@RapidJSON_INCLUDE_DIR@" )
-message(STATUS "RapidJSON found. Headers: ${RapidJSON_INCLUDE_DIRS}")
-
-if(NOT TARGET rapidjson)
- add_library(rapidjson INTERFACE IMPORTED)
- set_property(TARGET rapidjson PROPERTY
- INTERFACE_INCLUDE_DIRECTORIES ${RapidJSON_INCLUDE_DIRS})
-endif()
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfigVersion.cmake.in b/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfigVersion.cmake.in
deleted file mode 100644
index 25741fc097..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/RapidJSONConfigVersion.cmake.in
+++ /dev/null
@@ -1,10 +0,0 @@
-SET(PACKAGE_VERSION "@LIB_VERSION_STRING@")
-
-IF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
- SET(PACKAGE_VERSION_EXACT "true")
-ENDIF (PACKAGE_FIND_VERSION VERSION_EQUAL PACKAGE_VERSION)
-IF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
- SET(PACKAGE_VERSION_COMPATIBLE "true")
-ELSE (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
- SET(PACKAGE_VERSION_UNSUITABLE "true")
-ENDIF (NOT PACKAGE_FIND_VERSION VERSION_GREATER PACKAGE_VERSION)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/appveyor.yml b/graphics/asymptote/LspCpp/third_party/rapidjson/appveyor.yml
deleted file mode 100644
index 4044ba6640..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/appveyor.yml
+++ /dev/null
@@ -1,102 +0,0 @@
-version: 1.1.0.{build}
-
-configuration:
-- Debug
-- Release
-
-environment:
- matrix:
- # - VS_VERSION: 9 2008
- # VS_PLATFORM: win32
- # - VS_VERSION: 9 2008
- # VS_PLATFORM: x64
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 10 2010
- VS_PLATFORM: win32
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 10 2010
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: ON
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 11 2012
- VS_PLATFORM: win32
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: ON
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 11 2012
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 12 2013
- VS_PLATFORM: win32
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2013
- VS_VERSION: 12 2013
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: ON
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- VS_VERSION: 14 2015
- VS_PLATFORM: win32
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: ON
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
- VS_VERSION: 14 2015
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- VS_VERSION: 15 2017
- VS_PLATFORM: win32
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- VS_VERSION: 15 2017
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: OFF
- MEMBERSMAP: ON
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- VS_VERSION: 15 2017
- VS_PLATFORM: x64
- CXX11: ON
- CXX17: OFF
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
- VS_VERSION: 15 2017
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: ON
- MEMBERSMAP: OFF
- - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
- VS_VERSION: 16 2019
- VS_PLATFORM: x64
- CXX11: OFF
- CXX17: ON
- MEMBERSMAP: ON
-
-before_build:
-- git submodule update --init --recursive
-- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=true -DRAPIDJSON_BUILD_CXX11=%CXX11% -DRAPIDJSON_BUILD_CXX17=%CXX17% -DRAPIDJSON_USE_MEMBERSMAP=%MEMBERSMAP% -Wno-dev
-
-build:
- project: Build\VS\RapidJSON.sln
- parallel: true
- verbosity: minimal
-
-test_script:
-- cd Build\VS && if %CONFIGURATION%==Debug (ctest --verbose -E perftest --build-config %CONFIGURATION%) else (ctest --verbose --build-config %CONFIGURATION%)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/abcde.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/abcde.txt
deleted file mode 100644
index 6a81654605..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/abcde.txt
+++ /dev/null
@@ -1 +0,0 @@
-abcde \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/glossary.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/glossary.json
deleted file mode 100644
index d5ca56d195..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/glossary.json
+++ /dev/null
@@ -1,22 +0,0 @@
-{
- "glossary": {
- "title": "example glossary",
- "GlossDiv": {
- "title": "S",
- "GlossList": {
- "GlossEntry": {
- "ID": "SGML",
- "SortAs": "SGML",
- "GlossTerm": "Standard Generalized Markup Language",
- "Acronym": "SGML",
- "Abbrev": "ISO 8879:1986",
- "GlossDef": {
- "para": "A meta-markup language, used to create markup languages such as DocBook.",
- "GlossSeeAlso": ["GML", "XML"]
- },
- "GlossSee": "markup"
- }
- }
- }
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/menu.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/menu.json
deleted file mode 100644
index acdf930ea5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/menu.json
+++ /dev/null
@@ -1,27 +0,0 @@
-{"menu": {
- "header": "SVG Viewer",
- "items": [
- {"id": "Open"},
- {"id": "OpenNew", "label": "Open New"},
- null,
- {"id": "ZoomIn", "label": "Zoom In"},
- {"id": "ZoomOut", "label": "Zoom Out"},
- {"id": "OriginalView", "label": "Original View"},
- null,
- {"id": "Quality"},
- {"id": "Pause"},
- {"id": "Mute"},
- null,
- {"id": "Find", "label": "Find..."},
- {"id": "FindAgain", "label": "Find Again"},
- {"id": "Copy"},
- {"id": "CopyAgain", "label": "Copy Again"},
- {"id": "CopySVG", "label": "Copy SVG"},
- {"id": "ViewSVG", "label": "View SVG"},
- {"id": "ViewSource", "label": "View Source"},
- {"id": "SaveAs", "label": "Save As"},
- null,
- {"id": "Help"},
- {"id": "About", "label": "About Adobe CVG Viewer..."}
- ]
-}} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/readme.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/readme.txt
deleted file mode 100644
index c53bfb8b72..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-sample.json is obtained from http://code.google.com/p/json-test-suite/downloads/detail?name=sample.zip
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/sample.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/sample.json
deleted file mode 100644
index 30930e765d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/sample.json
+++ /dev/null
@@ -1,3315 +0,0 @@
-{
- "a": {
- "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null,
- "b茤z\\î¨.N": [[
- "ZL:ï¿„á‹Ž*Y|猫åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)",
- {
- "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true,
- "eîž¡æµ±uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false,
- "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739,
- "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{
- "(QP윤懊FI<ꃣ『䕷[\"ç’嶮?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bd浶tl\u2049#쯀@僞": {"î—i妾8홫": {
- ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*<?੃'ahhCFX(\u0007⮊Eã­ä±¾Gxꥩrâ£.æ´Ž",
- "ë»´5bDDí¯O傆盓왻U?êž…êŠNé­á§¢Ï„\"迳豲8\u001b䃥ꂻ䴺ྸHç­´,": {
- "\"L鸔SE㬡XV&~ÍŽ'놅蔞눶l匛?'.Kæ°\\ƢẨ疇má¿›'ê½³&!é¹ m'|{Pç—Š 秄쒿u\u00111䋧gÏ©x7t丗D䊨䠻z0.A0": -1.50139930144708198E18,
- "8é‹‚ë›·ïž”?ì²’B☚>ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": {
- "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true,
- "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false,
- "蟌Tk愙潦伩": {
- "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826,
- "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ <Ve?í±!ImäŽî­Ÿæ„:*s 9è«šPrᵾ뒰髶B̌qWA8梸vS⫊⢳{t㺲q㺈랊뮣RqK밢쳪": [
- false,
- {
- "\u000b=>x퓮⣫P1à «LMMX'M刼唳ë¤": null,
- "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null,
- "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [
- -1.30142114406914976E17,
- -1.7555215491128452E-19,
- null,
- "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/",
- -4.5737191805302129E18,
- null,
- "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6ী)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许",
- 3808159498143417627,
- null,
- {"m試\u20df1{G8&뚈h홯J<\/": {
- "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [
- -2226135764510113982,
- true,
- null,
- {
- "h%'맞Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null,
- "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null,
- "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!䶢D=à´­ã´ŸjyY": {
- "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [
- 6.385779736989334E-20,
- false,
- true,
- true,
- [
- -6.891946211462334E-19,
- null,
- {
- "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": {
- "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8嘋퀯䉶ጥã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false,
- "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19,
- "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTs1c-7(äµ¢\u2069åŒçµ˜ê¯‰:l毴ï›æ±žt戀oෟᵶ뮱á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M",
- "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true,
- "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null,
- "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BU씧U`ᢶg蓱>.1ӧ譫'L_5VäµÐ¦": [
- false,
- false,
- {"22ä‚盥N霂얢<F8î±ê¼µ7Gà°¸yhë€g᦭ꄢx硴嬢\u001a?Eê´†T|;7犟\"Wt%ä©O⨵t&#ᬋK'èœá²«æ”⾠鲂Të©·éƒ\u0018ä“žcE": {"f=ä츜瞾zw?å­¡é£\\铀᫞yẆg(\u0011M6(s2]`ਫ": [[[{
- "'y몱纣4S@\\,i㷯럹Ua充Tᣢ9躘Zଞ쥿äŠs<\/刎\\\"뉦-8î©Œ/": "蜑.X0꭛낢륹iì ¨êš<8?s볕è¡|Q✬᯦@\\G㑢屿Mn졾J굤⥟JW뤵苑rì•íˆ„åµµ?â¾¥O",
- "^1挲~[n귆誈央碠멪gI洷": -8214236471236116548,
- "sሣ%娌暡clr蟜㑓2\u000bSâŸ_X㨔⚴5~蔷ꀇ|Xu㬖,꤭å¹îµ¿r(g믇ì©ïŠ¨%췸앙|æ £U\\2]䤉+å• è¡ê¯ŽT鉹m\n/`SzDᅼ鞶": 1.1217523390167132E-19,
- "u톇=黚\\ ꂮ췵L>躰îe9â‘©_뵜斌n@B}$ê´»Yá±@䧋V\"☒-諯cVë¯Ê ": true,
- "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true,
- "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [
- "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE",
- -9222726055990423201,
- null,
- [
- false,
- {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [
- -930994432421097536,
- 3157232031581030121,
- "l貚PY䃛5@䭄<nW\u001e",
- [
- 3.801747732605161E18,
- [
- null,
- false,
- {
- "": 4.0442013775147072E16,
- "2J[sᡪ㞿|n'#廲꯬乞": true,
- "B[ç¹°`\\ãa̼㨀å›ã½“<\/꥖ᵈO让\r43⡩徑ﬓ๨ﮕx:㣜oçŽê‰Ÿã¢Cçµï›‰á½†á“žì‡“Qs氯였9駵q혃Ljê‚”<\/昺+tä‹à¼»çŒ™c沪~櫆bpJ9Uá:칣妙!çš—F4㑄탎䕀櫳振讓": 7.3924182188256287E18,
- "H磵ai委曷n柋T<\/å‹¿F&:ꣴfU@㿗榻Lb+?í„sp\"᪟~>ê·»m㎮ç¸f": 1.0318894506812084E-19,
- "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590,
- "ㆎQ䄾\u001bpᩭ${[諟^^骴᤮b^ㅥI┧T㉇⾞\"绦<AYJ⒃-oF<\/蛎mm;obh婃ᦢ": false,
- "䔤䣈?æ±.p襟&dã±…\\Jᚠ@?Oì²à¢½íœ”VR蔩|㒢柺": [[
- "-ꕨ岓棻r@鿆^3~䪤Ѐ狼︌ﹲ\\á¸MlEìµ Q+",
- null,
- false,
- 3346674396990536343,
- null,
- {
- "": null,
- "/ä¨S쨑,&繷㉥8C엮赸3馢|뇲{é„Žê—‡qFﶉ雕UD躢?Ꟛအï–꽡[hᕱᗅ㦋쭞MユèŒ?L槽암V#성å”%㣕嘵\\Ú¹(å˜èº¿&q": [
- -1364715155337673920,
- false,
- -8197733031775379251,
- "E팗鮲JwH\\觡܈áœ\"+뉞娂N휗vå™™á‚ê¹¼\u001dD帒l%-æ–”N",
- -3.844267973858711E-20,
- [{"쬯(褈Q 蟚뿢 /ⱖ㻥\u0017/?v邘䃡0U.Z1î­­x?鯔Vå° 8Emï•<": [[[
- null,
- [
- null,
- -5841406347577698873,
- "í‚·\"S⋄籞繗솸ᵣ浵w쑿ퟗ7náŽx3ì•™z㘌쿸I葥覯ã¬0á†b汆狺뷘ႀnꋋ",
- -1227911573141158702,
- {
- "u㉮PᾺV鵸A\\g*à¡—9슟晭+ͧↀ쿅H\u001c꾣犓}癇æ›á—¬é»©äŸ˜X梑é†e>rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9谶居ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{
- "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8乒㓶B࿠㯉戩oX 貘5V嗆렽ë‚߼4h䧛êºM空\\b꿋貼": 8478577078537189402,
- "VD*|吝z~h譺aᯒ": {
- "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈<bïž²S}㎥l|刖k": {"H7鷮퇢_k": [
- true,
- "s㟑瀭좾쮀â‘î¬Yì°ºk맢戲쀸俻àº6å„®ë—扖puߖꜻ馶rꈞ痘?3ྚ畊惘䎗\"vv)*臔웅鿈䧲^v,껛㰙J <ᚶ5",
- 7950276470944656796,
- 4.9392301536234746E17,
- -4796050478201554639,
- "yꬴc<3㻚",
- "oå¡\u20a4蒵鮬裢Cá´§nBã­±f.",
- false,
- [
- false,
- "ã¡å¼‘V?瀆䰺q!출㇞yᘪ꼼(IS~Ka 烿ꟿ샕桤\u0005HQҹ㯪罂qè¾âš‡æ‡‹â¦•ë‘¡v",
- 1862560050083946970,
- "\u20b6[|(ë­¹gê’펉O轄Dl묽]ﯨ髯QEbAã’¾m@롴礠㕓2ë•«n6ْ엘঵篳R잷꙲m색摪|@ã¿«5aK设f胭r8/NI4춫栵\\꯬2]",
- false,
- {
- "\u000b7*ã™›ç‡.~?䔊pæ•e_拺艿ë·f{ê”»1sé©™`$Ė戧?q⋬沭?å¡·á­šè¹€unoa5": {
- "Sê·¯o紞㾕ᅶä¾î—¶éŠ‡12|ÊŸç•´ï–iNAo?|Sw$M拲գ㭄紧螆+,梔": null,
- "ã­š0?xB疱敻ேBPwv뾃熉(Ó pJ]ê°¢\"Bj'\u0016GE椱<\/zgៅx黢礇h},M9ï´¦?LḨ": "Si ïŸB%~㬒E",
- "핇㉊살ã¢ìˆ¨~ȪRo䦅D桺0z]﬽蠆c9ᣨyPP㿷U~ãž?쯟í¸å®’뉆U|}㉓郾ࣻ*櫎꼪ä—s?~7\u001e㘔h9{aáž‹}:㶒P8": [{"\\R囡ì¬nN柋çØ›7ì¹¾ :㶃衇徜V æ·±f1æ·â™ i?3S角íž^ᆞ\u20e8á¹°D\u0007秡+躒臔&-6": {
- "䨑g.fhã”—=8!\"狿ൻLU^ë»±g䲚ã»'W}k欤?๒鲇S꧗䫾$ĥ피": -794055816303360636,
- "外頮詋~텡竆î™ç¹ƒä©è‹¨ë¾ºæœê¼ƒç˜¹f*㉀枙NH/\u2027ê¢}j묎ïƒvペq︉ì‹ëœ¡Od5 N顯ି烅仟Qfㆤ嚢(i䬅c;맧?嶰㩼츱ç¡?-": {
- "e݆ã¡â¬¬î›–'2ã»’?U篲鿄\"隻Ҭ5NꭰꤺBꀈ拾᩺îº[刯î…5곑Na램ﴦ዆]ã“qwé’„\u001b\"Yæ´Šä—¿î¼ç¥å¡¥è¿µ[⼞⠳P$ê ±5먃0ï¦`": [{"ç°Eè³ï«šb먭N긆Ⰹå²2逶ꜛ?H짉~?P}jj}ä¾·ç¿_T>á­¨b,â»éˆµP䕡䀠८ⱄ홎鄣": {
- "@?k2鶖㋮\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null,
- "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463,
- "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [
- null,
- 1.2850335807501874E-19,
- "~V2",
- 2035406654801997866,
- {
- "<숻1>\"": -8062468865199390827,
- "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false,
- "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RB隧 å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻",
- "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°Ÿ<Fɋ잣緂頒âºä‰²ç‘‘ä…‚,C~Þ…G!f熢-B7~9Pqà¡¢[츑#3ê•Ž,Öඳè⩅㵧춀ë¿xyäŒÍ‚tdj!箧᳆|9èš¡ë¬": -2.54467378964089632E17,
- "䵈䅦5ë¹–,궆-:໿댾仫î»0ᙚyá¦hqáš„": null,
- "侯Y\"湛졯劇Uì…ŽYXçâ…¸2ä¼´|ç­§\\ä’㶶á·ì‘WaᦵᗱãœëŠ¾è† <Jc63<G\u20fe䇹66僣k0O\"_@U": null,
- "姪y$#sæ¼´JH璌Ӊ脛Jã¾íŽ”ï¹´oꈶ㚸PD:薠ì–%說ážè¹‚1]⾕5튄": {
- "á¾Huw3䮅如쿺äŸå«]<鰨ݷ?꯯䫓傩|á¶à·ƒåª½\\澒≡闢": "Mm\"ì‡á¯„졽\"楇<\/ꥆí­å±€néš´@é¿£wâ Š4Pï«å¾ŽW㊋;䤞'.팇è’ä¡´egpxå—Žwà®…ç—å ®á›nË︖䀤4å™™?໚éƒá±‹Þ˜à¥Žtæ‘姫籕殥ï­é™ƒ\"4[ê¬qL4Wê Žx",
- "ℇjéŒïš›5Bë’š\" U": "ç¡„ê˜{憠êµ:&t䌨m Cઌ쿣鞛XFê Ÿsä­ï¶ƒ\"æ ¼a0x闊昵å²L\\æšèˆaê¸j싹ç…\"î ²çŸï±¡é¦†*êµ–ç³ <ê”躎",
- "톌賠弳êŸb\"èž–X50sĶ晠3f秂å¯Iâ“Ÿ:è˜": 5.573183333596288E18,
- "%䴺": [[[[
- -6957233336860166165,
- false,
- null,
- {
- "\"ïŸ\\௮茒袀ᕥ23ୃ괶?ä•Ž.嚲◉ãžL+ᵡ艱hL콇붆@": null,
- "%螥9ꭌ<\/-t": true,
- ",9|î«è€¢æ¤¸ä“Xk죱\u0015$Ώ鲞[ï’—?ì—¢á²í˜ªì¦ˆâ´‚â–‚â„´ã—¯\"gî´ëº˜\\êœ#\u0002ヮ}ሎ芲P[鹮轧@냲䃦=#(": 2.78562909315899616E17,
- "R?H䧰ⵇ<,憰쮼Q總iR>H3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true,
- "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18,
- "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X",
- "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(W⧂çµP鬜O": [{
- "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻<?2K)": null,
- "Z17縬z]愀䖌 ᾋBCg5ë”’êµ­æ†ê¾“aâ²·í„·u:U촳驿?雺楶\u0001\u001c{q*á°—è‹‘B@kæ°z.*è“—7ረIm\"Oá±@7?_": true,
- "㺃Z<": -4349275766673120695,
- "휃䠂fa塆ffixKe'ë¬é—੄뺾w࠾鑎kë•¢m*႑햞é®6攊&虜h黚,Yä±³Sﭼ둺pN6": [
- false,
- "IΎ䣲,\"ᬮ˪癘P~Qlnxå–Sᮔ༬˨IçŒm䜛酛\u0003iê¸ã¦§cQ帲晼D' \\(粋ï›wQcN\\ëµ°è·ˆ",
- [
- "D0\\L?M1ì¥KaêŒsd+盌귤憊tz䌣ëŒ×‘Oå‚wÏ¢%á½’gpî•—,Aiï™âŽ§á¶†I餾ê¦æ£©å˜…᳉怴%m]á¶is纖D凜镧o심b Uî»·",
- {
- "?଼\u0011Rv&^[+匚I趈T媫\u0010.䥤ᆯ1q僤HydⲰl㒽K'ᅾiౕ豲초딨@\u0013J'쪪VD౼P4Ezg#8*㋤W馓]c쿯8": false,
- "c/擯X5~JmK䵶^ìŽà´š|B|u[ì†(X뚤6v}W㤘⠛aR弌臌쾭諦eⒷ僡-;㩩⭖ⷴ徆龄갬{䱓ᥩ!ï¯âŠšá‡¨<v燡露`:볉癮꨽り★Ax7Ꮀ譥~舑\\Vê‹\"$)v": "e&sFF쬘OBï–†d슊寮f蠛জ봞mn~锆竒Gè„\"趵G刕䕳&L唽붵<\/I,X팚Bâ¥î¼¶X,kԇҗ眄_æ…¡:U附ᓚA蕧>\u001a\u0011\";~쓆BH4å‹æ”Š7힪",
- "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894,
- "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [
- null,
- null,
- {
- "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞rè¿ŽjTⲤ渔m炅肳": [
- -3.3325685522591933E18,
- [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [
- null,
- 4975309147809803991,
- null,
- null,
- {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": {
- "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null,
- "|": false,
- "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%ä«Ž)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216,
- "\u209fad놹j檋䇌ᶾ梕ã‰bוּ<dä—±:줰Mé…„\u0000X#_rç¢A饓ê—ÙKo_è·”?ᪧ嵜鼲<": null,
- "ꆘ)ubI@h@洭Ai㜎ä±k\u0003?Tä‰3é—´%j6jæ£j=â\\U毮ᬹ*8䀔v6cpjâ­¬~Q꿾뺶ï‰íŽµæ‚¡!ì©­åŽl六㽫6퇓ޭ2>": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cbä«Ž S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [
- -2.6990368911551596E18,
- [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?S㵧\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{
- ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": {
- "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": {
- "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false,
- "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": {
- "B+:ꉰ`sì¾­)ë¹¼Cç¾Aä«ŠpMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791,
- "sb,XcZ<\/m㉹ ;䑷@c䵀s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [
- "RK鳗z=袤Pf|[,u욺",
- "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓",
- null,
- null,
- true,
- -1.650777344339075E-19,
- false,
- "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”",
- "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I",
- -2.7033457331882025E18,
- {
- ";⚃^㱋x:饬ኡj'꧵T☽O㔬ROå©Ž?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’וֹꙶT犘≫x閦웧v",
- "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎O瀜ìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null,
- "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5槗OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•í‹Žá¸ã‹©B=9IÛâ“Œ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/<EO꽓ᇕu&é‹«\\禞í¹uê’.7훯ಶ2䩦͉ᶱf깵ᷣ늎": [
- 5.5099570884646902E18,
- "uQNæ¿¿m臇<%?谣鮢s]]x0躩慌闋<;(î³¥ 鋤.0á µd1#벘a:Gs?í–·'.)ㅴ䞟ç¯å´ˆFS@O㌛ᓬ抢íŒáž¾ëƒ·ì¿Ÿíˆ¥IZn[惵ê§3ë™[&v憙J>ì´‹jo朣",
- [
- -7675533242647793366,
- {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dᶗGG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“N圴ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [
- false,
- [[
- 7929823049157504248,
- [[
- true,
- "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -擶D[0=퉿8)q0ÙŸ",
- "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ",
- -2154220236962890773,
- -3.2442003245397908E18,
- "Wᄿ筠:瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='橄",
- -7857990034281549164,
- 1.44283696979059942E18,
- null,
- {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [
- 7.393662029337442E15,
- 3564680942654233068,
- [
- false,
- -5253931502642112194,
- "ç…‰\\î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:",
- true,
- null,
- {
- "⒛'P&%죮|:⫶춞": -3818336746965687085,
- "钖m<\/0ݎMtF2Pk=瓰୮洽겎.": [[
- -8757574841556350607,
- -3045234949333270161,
- null,
- {
- "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ 鋺㘓ê–梒뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null,
- "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[
- false,
- null,
- true,
- -5.7131445659795661E18,
- "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚姿",
- true,
- [
- -8759747687917306831,
- {
- ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18,
- "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false,
- "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{
- "(ì¾´ä¡£,寴ph(C\"㳶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{ڒ䭷ᶼéœpIè—虶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[
- 654120831325413520,
- -1.9562073916357608E-19,
- {
- "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18,
- "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zᄊ63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17,
- "p꣑팱쒬ꎑ뛡Ꙩ挴æ胔&7ᔈ묒4Hd硶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi",
- "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null,
- "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"ìš¿Ñœ<u鵵઎⸊î˜å€¾ì‘·à·»rT⪄牤銱;W殆͢芄ਰåší›šìƒ¢î™‡âŠ¿+ã²½": null,
- "å˜ïƒé€†àº»%_맛d)zJ%3칧_릟#95䌨怡\u001ci턠ॣî’i冘4èµ–'à¨ä§_æ ”!": {
- "*?2~4㲌᭳ì¯ftá‚·1#oJ\bäŠ‡é•‡ë” \u2079xä›ãŠá®‚N;穽跖s휇ᣄ홄傷z⸷(霸!3yëºMì’¿í–Û½v㳉tở心3黎vì­» Rp཮Vr~T?&Ë´k糒븥쩩r*D": null,
- "8@~홟ꔘk1[": -5570970366240640754,
- "BZté¦ê¡¬c餖 s(má›´\u0000◄dè…‘t84CâŸå¯VṊ뉙'å™±ê”ç½GCé¡€?허0êž¹&ë‡ä›­Cä·«](": 2.4303828213012387E-20,
- "yæ’”Z외放+}ḑ骈á™&\u0016`G便2|-e]঳?QF㜹YF\"ã¿’ç·„í–·ï€ãˆŸïƒ¦ï¨ä·¦à­€áŒ¤lM蘸N㾆▛럪㞂tᕬ镈ì‡å– l amcxPnm\u001a᱋<\/]_]ﻹïª?H": false,
- "áæ°ë¬¢뜚I[♺뽛x?0Hë´¬Wpn꨹Raä¿ïŒ›ìŒ‘{㴂ni祻윸A'y|⺴ᚘ庌9{$æ²{톽=m#@ï–—6ᨧfgs44陎J#<Ễ쨓瀵â©a୛㷉㙉ܸ◠냔嬯~å‘„ç±ç¾¥é•³": false,
- "㘱{<é ¬22?IF@곊I겂嶻Lá›D{@rì’‚?IAᣧ洪惒誸b徂zì·ºê¾ã ­\\刊%禨ìŒâ¶£ä»µ\\P[:47;<ᇅ<\/": {
- "^U釳-v㢈ê—â—„è˜rᜨi;èµ·kR犺䵫\u0000é”ì™m-Ô™!lḃ꛸뻾F(Wê·›y": "#á ºH㸢5v8_æ´‘C",
- "䔵໳$á™ 6èž\u206eæ‘Žî½ q圩P|æ…sV4:㜾(I溞I?": -6569206717947549676,
- "é€êž‚ç·µí‡8 >e㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true,
- "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null,
- "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": {
- "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": {
- "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*턧簕Ogå©¥Sê": null,
- "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗j侵;m蜫轘趥?븅w5+mi콛L": {
- ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [
- true,
- -3.6479311868339015E-18,
- -7270785619461995400,
- 3.334081886177621E18,
- 2.581457786298155E18,
- -6.605252412954115E-20,
- -3.9232347037744167E-20,
- {
- "B6㊕.k1": null,
- "ZAꄮJ鮷ᳱo갘硥鈠䠒츼": {
- "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇M㶭0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋F嵧]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [
- null,
- "?",
- 2941869570821073737,
- "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y",
- false,
- "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2㳗必꧂淲?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ",
- [[{
- "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [
- -7.8781018564821536E16,
- true,
- [
- -2.28770899315832371E18,
- false,
- -1.0863912140143876E-20,
- -6282721572097446995,
- 6767121921199223078,
- -2545487755405567831,
- false,
- null,
- -9065970397975641765,
- [
- -5.928721243413937E-20,
- {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [
- "Ta쎩aÆt쵯ⰪVb",
- [
- -5222472249213580702,
- null,
- -2851641861541559595,
- null,
- 4808804630502809099,
- 5657671602244269874,
- "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c",
- false,
- [
- null,
- {
- "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ssë•Šë¢i~逇PA쇸1": -2.63273619193485312E17,
- "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~἞ࡹê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125,
- "ᶴ뻗`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null,
- "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^",
- "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663,
- "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false,
- "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true,
- "钣xp?&\u001e侉/y䴼~?U篔蘚缣/I畚�Q绊": -3034854258736382234,
- "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•ä†„`*fl㭀暮滠毡?": [
- "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩<QF;t=?Qꀞ",
- [
- null,
- [{"-ì·«æ²î«§á¬¨å¢Šè‡¸<à ’Hè·¥ 㔭쥃㫯W=z[wধ╌<~yW楄S!â‘»h즓lÄ–N￧篌W듷튗乵᪪템먵Pf悥ᘀk䷭焼\\讄ræ“é¬y6VF<\/6ëž¿p)麡ê ãª\"pà®´e": [
- "#幎æ´é¢’嶈)ã„›J.嶤26_⋌东챯ꠉ⤋ؚ/âš%秼Q룠QGztᄎ㎷អIç¿°Xpç”éœê¨",
- {",T?": [
- false,
- [[
- true,
- 7974824014498027996,
- false,
- [
- 4.3305464880956252E18,
- {
- "᱿W^A]'rᮢ)é¥zï­é¤;Hu\\Fk?ï´º?IGæµ…-䙧>è¨-xJ;å·¡8깊è ï»“U$K": {
- "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true,
- "Ya矲Cë©—Q9膲墅æºíœ»c\\딶Gç””<\/.齵휴": -1.1456247877031811E-19,
- "z#.OOï¿J": -8263224695871959017,
- "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{
- "Nè’¬74": null,
- "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§s槞d!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048",
- "æA C䧩G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": {
- "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u",
- "뽫<G;稳UL⸙q2n쵿C396炿Jè“¡zâ£zဩSOU?<\/ë™oEí¸Oé¿…à·´êˆEm#\"[瑦⤫á†glâ¡—q8\"í˜ë¥ä¿‚@ᆤ=\u0001爖ç¾ì·€ã¸©b9\\jeqt㟿㮸龾m㳳긄": {
- "9\"î²–V霟釜{/o0嫲Cå’€-饷äˆ[ë…©î)\r䤴tMW\\龟ϣ^ي㪙忩䞞N湆Y笕)è¨ê–¤èª¥ç…½:14â«»57U$æ“’ä²è–¡Qvↇ櫲현誧?nà®·6": {"l웾䌵.ä…‹ä¦ic碳g[糲Ƿ-ឈᚱ4쑧\u0004C࿼\u0018&쬑?멲<\/fD_檼픃pd쪼n㕊渪V䛉mæˆW儅톳뗳䓆7㭽諤Tç… ï–ŠNey?î¼…0᪵鈑&": [
- false,
- null,
- {
- "\rî´’;鼶já ‚ê¼RLz~â™”9gf?Ó¡æµ": -1.4843072575250897E-19,
- "&ꊒ\"ê‹Ÿä­E诮ﯚO?SWë’훪mb旙⎕ᗕ⶙|á·¤5y4甥": "j5|庠t铱?v íš‹0\"'rxz䃢æºêž«!\u0002",
- "Q á©ãŸ§": {"Hﬔ\u2058䪠틙izZㅛ탟H^ﶲA??R6å‘ Z솋R.࿶g8": [
- -8762672252886298799,
- -1.9486830507000208E17,
- null,
- -7157359405410123024,
- null,
- null,
- -995856734219489233,
- "呧㫹A4!",
- null,
- -1.9105609358624648E-19,
- 5888184370445333848,
- 2.25460605078245E-19,
- 2.5302739297121987E18,
- "뢹sbEfæµ2丯ï‡?뗾耸(Wdë™SବꭖrtU?ç­¤P똙Qpbbï‘¡KqaE$æ¥Vì›°3i/lK퉜,8︸e= gèž“t竦컼?.寋8éµ—",
- 7377742975895263424,
- 2.4218442017790503E-19,
- {
- "y꒚ཫ쨘醬킃糟}î‘yTSt䡀⇂뿽4ൢ戰U": [[
- 3600537227234741875,
- 4435474101760273035,
- -1.42274517007951795E18,
- -5567915915496026866,
- null,
- null,
- [
- -3204084299154861161,
- {
- "7梧慸æ†.a瘎\u00041Uéµ®CkÖ¨d惥è€â³¡Y,â­ì¨EåžFFI鱑ⳬ줢7⧵Bﴠ耘줕햸qì»´~*ç‘W.떛ࡆ@'á€+è½³": -961121410259132975,
- "⥅]l黭㣓绶;!!⎃=朼ã¿e&ἂ繤C﯀lä£ãŒ€6TMì‘®w懃ꡡ#ᤆ䰓,墼湼゙뽸㲿䧽쫨xᵖ듨<\/ T0峸iQ:溫è„\\\"쎪ὴ砇宖^Mæ³¼í¥âž…鈫@ᄟ༩\u2008⥼": true,
- "â©\"籽汎P싯鲘蟼sRá¯ä…©\u0019R(kRá–&ಌ 0\"鳶!馼YH": null,
- "鮼ꚇ싋։刟\rRLd步Nⴗ5Eࡆ訛갚[I醵NC(郴ṉy5D뤺౳QY壯5苴y훨(W\\Cଇ姚C艄깹\u001c歷㋵ZC᥂": [
- -6806235313106257498,
- null,
- "}N⸿讽sꚪ;\\p繇jè‹„î¡ä«¨\u20e7%5x?î•¥t#",
- {
- "O〗k<墻yV$à°rs-c1ఌ唪.C7_Yobᦜ褷'b帰mã„‘l⌅": {"qB뗗擄3éš‚5ëºæ«‚䱟eì´¸P/é©,3æŽê—©=冉棓㑉|ËžF襴뿴,:㞦<퓂⧙礞♗g뚎ᛩ<\/뉽ⶳ⸻A?_x2Iã½å‹’*Ií™±î¢é§ç²¿~曟㤙2绥Ly6+ìƒuu鿜בfí˜|æ­à£–É": [
- ">hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O",
- null,
- 2.0150326776036215E-19,
- null,
- true,
- false,
- true,
- {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [
- -2995806398034583407,
- [
- 6441377066589744683,
- "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘K鶲y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹",
- {
- "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•á›–cw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18,
- "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{
- "0a,FZ": true,
- "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwᄧã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{
- "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571,
- "*즢[⦃b礞R◚nΰꕢH=귰燙[yc誘g䆌?ଜ臛": {
- "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸",
- "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [
- "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›",
- "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h",
- -335836610224228782,
- null,
- null,
- [
- "r1᫩0>danjY짿bs{",
- [
- -9.594464059325631E-23,
- 1.0456894622831624E-20,
- null,
- 5.803973284253454E-20,
- -8141787905188892123,
- true,
- -4735305442504973382,
- 9.513150514479281E-20,
- "7넳$螔忷㶪}䪪l짴\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019ᶌå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>",
- "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡sè„š",
- {
- "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null,
- "畯}㧢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-䞚䧰$만峬è¼ä ±V✩5宸-æ‚D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": {
- "陓y잀v>╪": null,
- "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": {
- "駫WmGጶ": {
- "\\~m6ç‹©K": -2586304199791962143,
- "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": {
- "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æ튻/蜞`塣৙\"⪰\"æ²’l}è•Œ\\롃è«æ°Œ.望wZ|o!)Hnçqg}": null,
- "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": {
- ":L5r+T㡲": [{
- "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818,
- "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [
- -1.4691944435285607E-19,
- 3.4128661569395795E17,
- "ãƒì´—^G9佭龶nå‹Ÿ8R厞eEw⺡_ㆱ%⼨D뉄퉠2ꩵᛅâ³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•âˆŒTã½²R홓é‰ã“¥",
- "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢q;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS",
- 4367930106786121250,
- -4.9421193149720582E17,
- null,
- {
- ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [
- 1.6010824122815255E-19,
- [
- "宨︩9앉檥pr쇷?WxLb",
- "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®",
- "㶢ážmOã”k'诔栀Z蛟}GZé’¹D",
- false,
- -6.366995517736813E-20,
- -4894479530745302899,
- null,
- "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕",
- ",vç¢å–”㌲쟚蔚톬៓ꭶ",
- 3.9625444752577524E-19,
- null,
- [
- "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”<u뷆cè­†\u001bN?<",
- [{
- ";涉c蒀ᴧN䘱䤳 ÿꭷ,핉dSTDB>K#ꢘug㼈á¦=P^6탲@䧔%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true,
- "æ´«`|XN뤮\u0018è©ž=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20,
- "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[
- -7.3136069426336952E18,
- -2.13572396712722688E18,
- {
- "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•xè“Ž\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411,
- "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": {
- ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK<l_⭨穟": [
- true,
- true,
- {"ﳷm箅6qⷈ?ﲈ憟b۷⫉἞V뚴少U呡瓴ꉆs~嘵得㌶4XR漊": [
- "í†ä»‹fM暪$9K[ㄇìƒí³æ’¦gæ’Ÿæ¸jÒFã¹¹aj bHᘀ踉êŽï¼£ç²„ a?\u000fKì¦‰î¶¯éƒ å¹¨9D舢槷Xh뵎u훩Ꜿ턾ƅ埂P埆kë©€{䢹~?D<\/ê¼¢XR\u001b〱ä½ê¼¨i㘀ḟ㚺A-挸",
- false,
- null,
- -1.1710758021294953E-20,
- 3996737830256461142,
- true,
- null,
- -8271596984134071193,
- "_1Gí‰í…‘m䮔鰼6멲Nmꇩſt쓟íŠN许FDï¡€j+3^ﶜ⎸\u0019⤕橥!\"sî•—-뾞lz北׸êšëž¬)?l⻮고iä‘°\u001f䪬",
- 4.459124464204517E-19,
- -4.0967172848578447E18,
- 5643211135841796287,
- -9.482336221192844E-19,
- "౪å†é‡¶9D?sèž­X榈枸j2秀vï ˜î ]泌鰚岒èµè½€ìŒ¶ïŠ›ií…½qMbL]R,",
- null,
- [
- null,
- {"M쪊ꯪ@;\u0011罙ꕅ<eáº|爑Yâµ<\/&ᩎ<腊ሑᮔ੃Fè±­": [
- "^0à¡Ÿ1ë³Pí‹áæˆF⨥Iê‚´\"z磣Vâ…¡=8í€2]䢹h1\u0017{jT<Iç…›5%Dì…Sâ‘™â…J*ìƒ å·™àº”ï€¢;᧡䙞",
- [{
- "'㶡í¾é„§`è·Š\"gV[?u᭒Ʊ髷%葉굵aë¦N켧Qﯳy%yä©Ÿé«’L䯜Säµ³r絅肾킂á'ꔦg긓a'@혔যWè°á¬F栩ŷ+7wéžš": 6.3544416675584832E17,
- "è‹Žè„·v改hmìµ|ã‹Šg_ᔠ뒨蹨峟ìŽã·¸|Ο刢?Gͨ옛-?î¨Gꦱî«î“©IEYUX4?%ꘋᆊ㱺": -2.8418378709165287E-19,
- "誰?(H]N맘]kæ´³\"qï±è’§è˜ž!Rí«\\(Q$T5Nå â«£ìœ¿6|럦ì†ï¸…ï­—(": [
- "峩_\u0003A瘘?✓[硫䎯á½uጭ\"@Y綅첞m榾=è´®9R벿῜Zï §",
- null,
- "䰉㗹㷾Iaáƒqcp쓘὾൫Q|ﵓ<\/ḙ>)- Q䲌mo펹L_ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕",
- "î“å“‘z懅á¤-ê¹ux쀭",
- [
- true,
- 3998739591332339511,
- "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ꮧ,Oå«šm à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b",
- [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{
- "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5Ⱗ裏_朻ï—%*[-撵䷮彈-芈": {
- "㩩p3篊G|宮hz䑊o곥j^Co0": [
- 653239109285256503,
- {"궲?|\":N1Û¿æ°ƒNZ#깩:쇡o8í‚—à¡Š[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": {
- "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+",
- "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true,
- "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ﶕî\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742,
- "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hড়r5,ê“‹": null,
- "ΉN$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_": null,
- "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _觅ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": {
- "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\t綾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [
- null,
- true,
- {"쌞ì": {
- "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19,
- "ê’¶]í“š%ฬKâ…": [{
- "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\å•š;4X\u20c2è¥B箹)ä¿£eá»»w䇄",
- "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null,
- "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null,
- "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pX᭠9᪘": -2.423073789014103E18,
- "ä„瑄䢸穊f盈᥸,B뾧푗횵B1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`è•ž;픬\fC\"æ–’\")2æ«·I﹥迧",
- "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null,
- "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)gä‘œ9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯r셓㶾\\a볜åºzEä·_죤ဵ뿰᎟CB": [
- 6233512720017661219,
- null,
- -1638543730522713294,
- false,
- -8901187771615024724,
- [
- 3891351109509829590,
- true,
- false,
- -1.03836679125188032E18,
- {
- "<?起HCᷭ죎åŠîŒŽèŽ‡é€°/{gs\u0014⽛㰾愫tï¿–<솞ڢëŒç…²è†ºà¨»9x닳xà¡­Q訽,ᶭඦtt掾\"秧㺌d˪䙻꫗:á­ˆh4ç·žç—䤴cë«šë–©à°¤<?ᕢ謚6]í›Oé°é‹›é• è´©èµŸ\"<Gâ™·1'": true,
- "቙ht4ßBqꦤ+\u0006멲趫ç”)椾": -1100102890585798710,
- "ç·å…Žê³‡ë‡¸ç²ŸF醇;朠?厱楛㶆â¶7râ¾›o꯬᳡F\\머幖 㜦\f[æ¦á¥½ã®£0ä•Š?J㊳뀄e㔔+?<n↴å¤î§·": [
- "4~ê‰ç¾\\å®(泤å•ë¹œ\u0014>j랎:g曞ѕᘼ}链N",
- -1.1103819473845426E-19,
- true,
- [
- true,
- null,
- -7.9091791735309888E17,
- true,
- {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{
- "\"2wG?yn,癷BK\\龞䑞x?蠢": -3.7220345009853505E-19,
- ";饹়â€)çš‹`噿焒j(3â¿w>å5X<np?<줯<Y]æ˜!J೸UⳂNे7v௸㛃ᄧ톿䨷鯻v焇=烻TQ!F⦰䣣눿Ké·šëˆ'â­²mæ (äš»": [
- "蹕 淜੃b\"+몾ⴕ",
- null,
- 35892237756161615,
- {
- " 듹ã)5æ…ç®±&$~:é°ì®<\/å ‹?% \\勽唅zì†å¸‹ä˜ºH髀麡M퇖uz\u0012m諦d᳤콌æ¨\rX싹̡á²": -433791617729505482,
- "-j溗ࢵcz!:î€}✽5à´‡,욨Ýs#ë«=å—浺^}E\\Y\\T*뼈cdêºcÛ˜ïµëŽä¨¸ë±K䠴㉿æ¿é€³îŽœ@wî·¿fì¢<\/[L[": -9.3228549642908109E17,
- "Ms킭uà®—%\\uâŽ/家欲ἅ答㓽/꯳齳|㭘Pr\"v<\/禇䔆$GA䊻˔-:í‹Š[h?倬è¤á¾žà§³.Gw\u000b": [
- "0宜塙I@ä´è‰\\Uyë’…=2<hæš’ï…£K._è´¡ç’Yi檻_⮵uá㘗è [f\u0015힢Hê”®}጑;ï´èªyf0\"\u20cc?(=qæ– âž½5ꎾ鞘kⲃ",
- -2.9234211354411E-19,
- false,
- true,
- {
- "\u0011⟴GH_;#怵:\u001c\u0002nîž»1U\\p/ì™”(┫]hêšî·ƒ7\r0䵷첗岷O௷?î·°ãŽ[殇|J=?韷pᶟ儜犆?5კ1kê–iH竧뛈ପdmk游y(콪팱ê¾k慧 yè¾£": [
- false,
- "O\"ëp覈ykv磂㢠ãµ~뀬íŠlC&4솎䇃:Mj",
- -7.009964654003924E-20,
- false,
- -49306078522414046,
- null,
- null,
- 2160432477732354319,
- true,
- "4íš¡h+!踹ê¬P鮄{0&ë±¥M?ìƒéž…n㮞ᨹ?쒆毪l'ç®…^ꚥ頛`e㻨52柳⮙嫪࡟딯a.ï‘„~äµ®1få˜N&zÈ­L榓ۃ鳠5d㟆M@㣥ï Ó‹AÎq0縶$",
- -3.848996532974368E16,
- true,
- null,
- -3.5240055580952525E18,
- {
- " vï­·áµ#ce乃5僞?Z D`묨粇á”ç» vWLè­¢uë½€\\J|tâ“™tâ„–\"ꨋnT凮ᒩè‚ç¯b騩:䢭Hbvì»å³¨z㹚T趗햆귣학津Xiï¼¹@á–¥K": true,
- "!F 醌yï䉸W2ꇬ\u0006/ä’7~%9擛햀徉9â›°+?㌘;ê “X䇻Dfi뼧쒒\u0012F謞Õ絺+臕kà¤LSQìŒX쎬幦HZ98è’Šæž³": "澤令#\u001dæŠâ›³@Næ•í€‚[5,✄ꘇ~䘷?\u0011Xꈺ[硸⠘⛯X醪è¡x\u0007쌇MiX/|ï¾ëšK8ä¡î¿¥W)銀q僞綂蔕E",
- "6â²ä£–R৞@ငg?<\/à³´xé™™Xꈺ崸⠅ᇾ\\0X,H쟴셭A稂ힿã‚F\\ì‘ž\u0012懦(Aᯕç­~î½”\u0001ê»®X?逊": 5.7566819207732864E17,
- "[c?椓": false,
- "kä’‡": 2583824107104166717,
- "꙯N훙ã…ﮒ燣㨊瞯咽jî™Mxby뻭뵫װ[\"1畈?ৱL": "ë£á”‚魠羓犴ꚃ+|rY",
- "ë…ºZ?îˆä¬ï“©é‰‰îˆ­:?â³™ç˜Cኯ.Vs[釿䨉ì§\\\\*쵢猒$\\y溔^,㑳": {"藶꺟": [{
- "\"d훣N2zq]?'檿죸忷篇ﮟ擤m'9!죶≓pë­»\\ᇷ\f퇶_ä°¸hà¹Q嵃訾㘑従ꯦ䞶jLí‹Šræ¾µOmᾫ!H䱤팼/;|á­ºI7슎YhuXiâš¼": -1.352716906472438E-19,
- "M⽇倻5J䂫औá”楸#î „î¾–J[Fﹱ쫮W誻bWz?}1\"9硪뻶fe": "盬:Ѹ砿íšë•£T凊(mç¦å‘œï»R㿎艴䂵h",
- "Rë¾k힪CHé’™_i苮ⰵoᾨ紑퉎7h؉\"柀è½z0့\"<?嘭$èœ?礲7岇槀묡?Vé’¿T⣜v+솒çšÔ›2ç±³mH?>è–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB",
- "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [
- "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸C蓼êš=軄H犠Gè°–ES詤Zè ‚3lë´Ÿhï¿’7䦹1GPQG癸숟~[#駥8zQ뛣J소obg,",
- null,
- 1513751096373485652,
- null,
- -6.851466660824754E-19,
- {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": {
- "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18,
- "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âŠ°å‘€ïŒ": {
- "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false,
- "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bá‚Œ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006p弊⼂ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [
- true,
- {
- "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [
- 5188716534221998369,
- 2579413015347802508,
- 9.010794400256652E-21,
- -6.5327297761238093E17,
- 1.11635352494065523E18,
- -6656281618760253655,
- {
- "": ")?",
- "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": {
- "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [
- false,
- true,
- {"Mt|êžD|F궣MQ뵕T,ëºk+?ãµi": [
- 7828094884540988137,
- false,
- {
- "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632,
- "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Q嶚!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988,
- "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\槳W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true,
- "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null,
- "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2è‘ŠP ": [
- -3709692921720865059,
- null,
- [
- 6669892810652602379,
- -135535375466621127,
- "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외bã‘Žç²–i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5",
- 1.10439588726055846E18,
- false,
- -4349729830749729097,
- null,
- [
- false,
- "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?",
- true,
- 2.17220752996421728E17,
- -5079714907315156164,
- -9.960375974658589E-20,
- "ᾎ戞༒",
- true,
- false,
- [[
- "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002",
- -5185853871623955469,
- {
- "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?7胜&n薑~": -2.11545634977136992E17,
- "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†áŽ¼Dᣘí›;": false,
- "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null,
- "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428,
- "n0æ™…:黯 xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?C䶖@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null,
- "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘",
- "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{
- "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•â‹ª\"D궣QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": {
- "l곺1L": {
- "T'ਤ?ç …|੬Km]ä„©\"(࿶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446,
- "é‹žEP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[
- "3",
- [
- true,
- 3.4058271399411134E-20,
- true,
- "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N",
- 697483894874368636,
- [
- "vᘯ锴)0訶}ä³…â©š0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•íœ»ID쿇嘗?ꌸῬ07",
- -5.4858784319382006E18,
- 7.5467775182251151E18,
- -8911128589670029195,
- -7531052386005780140,
- null,
- [
- null,
- true,
- [[{
- "1欯twG<uä®â½ê‡£_ჟﱴଶ-쪋\"?홺k:èŽêœª*⺵꽹댅釔좵}P?=9ë ¿46b\u001c\\S?(筈僦⇶爷谰1ྷa": true,
- "TҫJYxÚª\\鰔℮혡)m_WVi眪1[71><\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~è“©<N蹑\"{ä«¥lKcí˜ë«–앺:vⵑ": "g槵?",
- "aꨩ뻃싥렌1`ë¡—}Yg>鲃gå„Š>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": {
- "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\᧫?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18,
- "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{
- "ଛ{i*a(": -8.0314147546006822E17,
- "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NT킶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [
- 287156137829026547,
- {
- "H丞N逕<rO䎗:í…•<\/䶩샌Sd%^ᵯëˆ엑者g䖩똭蕮1U驣?Pâ°°\u001fp(W]67\u0015ï«£6굺OR羸#ì´Fè’ˆ;嘙i✵@_æ’¶yã¤â¤(:᧗뼢༌朆@â°ã¤¨ê­²?-n>⯲": {"": {
- "7-;枮阕梒9ᑄZ": [[[[
- null,
- {
- "": [[[[
- -7.365909561486078E-19,
- 2948694324944243408,
- null,
- [
- true,
- "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/춋9Mᲆឨ^<\/庲3'lë‚¢",
- "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y",
- [[
- null,
- null,
- [
- 3113744396744005402,
- true,
- "v(y",
- {
- "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null,
- "蠗渗iz鱖w]擪E": 1.2927828494783804E-17,
- "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[
- true,
- null,
- null,
- {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [
- null,
- -3808207793125626469,
- [
- -469910450345251234,
- 7852761921290328872,
- -2.7979740127017492E18,
- 1.4458504352519893E-20,
- true,
- "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd",
- [
- 974441101787238751,
- null,
- -2.1647718292441327E-19,
- 1.03602824249831488E18,
- [
- null,
- 1.0311977941822604E-17,
- false,
- true,
- {
- "": -3.7019778830816707E18,
- "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“몓ﴀE(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004,
- "よ殳\\zD⧅%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [
- 6.77723657904486E-20,
- null,
- [
- "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?羧W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6",
- "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡",
- "imçŠÕƒb칧<D-è«‚*u2ꡜ췛~䬢(텸ﵦ>æ ¡\\뼾쯀",
- 9.555715121193197E-20,
- true,
- {
- "<ã«šv6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ﭶ퓀7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101,
- "fg晌o?߲ꗄ;>C>?=鑰監侯Kt굅": true,
- "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\<z": [[
- null,
- "Cä¡>?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄",
- [[{
- "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{
- "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌o嶔f9-庒茪ç“ë·³4": null,
- ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(䶒跲tiâ‘´aî¥ç¡‚#Noë³”",
- "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:移": {
- "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›d᧫䳳#Nî‡Xe3-붋鸿î¢à¬¢ë–“%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{t孶㓑4_": [
- true,
- null,
- [
- false,
- "l怨콈lá’",
- {
- "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19,
- "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": {
- "H?뱜^?꤂-⦲1aã‹ž&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™D秼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true,
- "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701,
- "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]ಲê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[
- true,
- false,
- [
- null,
- 3363739578828074923,
- true,
- {
- "\"鸣詩 î›ë³°ã‘µgL㯦῅ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17,
- "TYႇ7ʠ值4챳唤~Zo&ݛ": false,
- "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=A蚶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[
- "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£",
- 4.317829988264744E15,
- 6.013585322002147E-20,
- false,
- true,
- null,
- null,
- -3.084633632357326E-20,
- false,
- null,
- {
- "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null,
- "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [
- null,
- {
- "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17,
- "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cb⧱}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [
- -2.348150870600346E-19,
- [[
- true,
- -6619392047819511778,
- false,
- [[
- -1.2929189982356161E-20,
- 1.7417192219309838E-19,
- {"?åµ²2à¿2\u0001啑㷳c縯": [
- null,
- [
- false,
- true,
- 2578060295690793218,
- {
- "?\"殃呎ïˆ#ã‘‘F": true,
- "}Fç‚Š_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": {
- "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksê•žç­¼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`",
- ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\ç©ŽvˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”è•ž^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\",
- "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865,
- "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ",
- "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)",
- "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917,
- "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Mᶖa<rà°„4Ů䢤슲AxÄ£eê³–ã´¤x竾éƒB謉鸵kè–½M)\"芣眜`è‰ê‰›ä´º": "é¹^ె캫?3耲]|Ãœ1ä¡’ã®]8e?ä¶^",
- "뿸樅#Pã¡Š1M룮Uꪭ绢ꑮZ9꽸": {"\nJ^Ñ”|3袄ã…7⨆銦yîµ”çâ‹·ä»´ct?[,<\/ã…¬`?갔髞%æA೚C": {
- " 䇞3갫䅪": [{
- "0|â©ã‘‚砕ㅻ": null,
- "D箳᠉`|=â¼­)\"*࣊ã¦LjO誋": "",
- "ࠚDZmê—¥}ᷴ╈r7í—´È¥4Kp5a)o}鎘门Læ°ä†“'✎kä¿Žc#T68Ó⩶î¶6L鎴<r൦$黊BQYã¼³\\è·¿F慮⡨拵贀!甶Vå–…/": null,
- "âµ£q⳹ﻨLk]晩1*y\\$%}ä–¶P煑㇆䈦Eå«æ«•Y࣓嫨ä“OL낮梚㸇洛洚BYtgl∛S☕䉓宑⋢粚ꔯ꠼붠": ")ꬑ윤`\"â°£<\/婽*Y䔸ᓰ_ï³t슲å©éš¥&S糧䛮闵诌è±sh쯽邴*ì„´ØÍŽ=㯨\"RVíž³,^t\"ac?䤒ꉀxHa=Uꛕã™î·“TkF껾",
- "å¼¾cUAF?暤cë½.欀nKì•­]r傊䀓ﯳ馽垃[䥛oI0N砊鈥헅Co쟋钄ㅷ㊌뷚7": [
- null,
- "à«“é¨?^ä†{\u0006`X䧵儱&롡尙砡\u0006ë»ì‘¬sjâ–»Xfᬶgcã„¢V >9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎",
- 2398360204813891033,
- false,
- 3.2658897259932633E-19,
- null,
- "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]䩋-é°¾æ¡ï¾ä³¡??掊",
- false,
- -1309779089385483661,
- "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~",
- -5658779764160586501,
- "ì’Œ:æ› =lìœä¢œwk#sè•š\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<",
- null,
- -4.664877097240962E18,
- -4.1931322262828017E18,
- {
- ",": {
- "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18,
- "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3蒟": [
- 4971487283312058201,
- 8973067552274458613,
- {
- "`aæ™á£—î\u0015i<S幼訃锭B0&槩✨[Wpçš©[g≊k葾x2ᡆ橲䲢W": true,
- "kH皈Sê±qå‚‘u?솹풑~o^F=ï¦N*reî••J沤wW苯7pã¼¹äŽa=ꮧLã·©냴nWꌑ㞱uuè°lVNç¿á¤»(e豶5#L쪉ᅄ઄\u0015숟봊P瀚Xè“Ž": false,
- "䫯דּ〖Scä›­ì Lëµ¾pî«“CꙞ\"엇즓_ﰛ톣ꫀ먩㺣㮠⭴!\\Wâ”tä–°è»…y\u0014~ᇰ렢E7*俜䥪W䀩ä·hë´†vjஉ묣à¼G39.뼳輼:㮿á¦A饕TUL}~": [
- null,
- 8.8648298810470003E17,
- 5.735561205600924E-20,
- null,
- -102555823658171644,
- 1.2674932032973067E-19,
- {
- "D胣O㯨\u0017Ku눓ã’í…nᨊ!Ꚇ廫_>Bo¸": 4.3236479112537999E18,
- "HW&퉡ãåœ<W)6æ‚°ê ‘HEp14xy峑ft\u0005s亘V튉䢮ꦈXåµê¬?lI_ë춇-6Ss噺Nk-ﮥíƒÜ郪*ï“­PR(S6â•‹@ä»™V懸뺵ﯜVç²¹": "9䗌斀4ãˆ^Qséš„ç¡j\u0003",
- "Vk鶅Cæ³¹ç­HX훉朗*r\\z顊誌儖4?n7á¾6몋䎡ﳈ],Hé ¢pèšã‘„P4满Eä©V䬕à¸L廂쒬î®ì‘¨ê†·hè¿¡ê°è­–墎 î‡]鹿ฌ7ﶽ冭༽<ꈓS\\lä‹®?_ユ檒?": -8598528325153980065,
- "t=qí£ç–»Ñ‚Z\\錅J.é•Ž|nfḷ鴒1厰Lç¯çºœîŒ•E]୦⥪]á®'ç¾p/å’©0닳ï³qﳖཽk ?X1Ft%ś뭢v鋋⺃爵⒗": [[
- 5.0824756359232045E-19,
- [
- 7.268480839079619E-19,
- {"탿^굞⧕iјëŠê€›w껩6ꟳXsé…š\\>Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [
- null,
- 4997607199327183467,
- "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮",
- null,
- [{
- "Eᑞ)8<Zî¿—ã¡¿W镀䛒Cìƒî¿«V?0ꯦ+tL)`é½³AjB姀Xà³³D빠㻲ƙgn9â‘°à¾á¿œ&\"ãš¹>餧A5u&ã—¾q?": [
- -1.969987519306507E-19,
- null,
- [
- 3.42437673373841E-20,
- true,
- "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊",
- [
- -8164221302779285367,
- [
- true,
- null,
- "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I",
- 1.4645984996724427E-19,
- [{
- "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null,
- "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[
- "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾",
- -7283717290969427831,
- true,
- [
- 4911644391234541055,
- {
- "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?ඣ/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w",
- "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3eç‹šì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Undã«œ\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": {
- "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [
- -1.69158726118025933E18,
- [
- "궂z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)oê«šn쳟줋",
- null,
- 7517598198523963704,
- "ኑQp襟`uᩄr方]*F48ꔵn俺ሙ9뇒",
- null,
- null,
- 6645782462773449868,
- 1219168146640438184,
- null,
- {
- ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [
- -7.539062290108008E-20,
- [
- true,
- false,
- null,
- true,
- 6574577753576444630,
- [[
- 1.2760162530699766E-19,
- [
- null,
- [
- "顊\\憎zXB,",
- [{
- "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣nå‹Œ\u0010í™ P>j": false,
- "ç®´": [
- false,
- "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ<cਔ↎⩧%鱩涎삧u9K⦈\"á¿á¬‘V绩킯愌ṱv@Gê¾è·¶êš†(?ä–ƒvI᧊xV\r哦jã ’?*=S굤紴ꊀ鹭쬈s<DrIu솹꧑?",
- {
- ".}S㸼L?t\u000fK⑤s~hU鱜꘦}ìªC滈4ꓗ蛌):ྦ\"é¡¥ì´â¢·ïš­á¿³YLn\"?fꘌ>댎Ĝ": true,
- "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿n涻J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18,
- "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [
- 7706977185172797197,
- {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?ҿo줫fऒ}\\S\"ᦨ뵼#nDX": {
- "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛p<q꜉Så²—î¥_.%": 7688630934772863849,
- "溗摽嗙O㧀,⡢⼰呠ꅧ㓲/葇䢛icc@-r\b渂ꌳ뻨饑è§á–œ\\é®­\u0014엙㥀᧺@æµ¹W2꛵{W률G溮킀轡䬆g㨑'Qè¨ï†áŸªç½‘Hd\"Q늴ᱢﶨ邮昕纚枑?â–°hr羌驀[ç—¹<\/": [
- -1.0189902027934687E-19,
- {"窶椸릎뚻shE\"ꪗႥꎳU矖佟{SJ": [{"-æ…œx櫹XYîƒ-æ¾Ü¨â£·àª¢ïŸé¯™%Fu\u0000è¿‹â–’}᥷L嗭臖oញc넨\u0016/è¿Ž1b꯸g뢱ã§è“¤ä’8C散삭|\"컪輩鹩\"\\g$zG䥽긷?狸꿭扵ã²:URON&oU8": [
- null,
- true,
- null,
- -2.8907335031148883E17,
- -3864019407187144121,
- {
- "`빬d⵺4H뜳⧈쓑ohஸ*ã¶ï»‡â¸•ä µ!iä¬ï¹‘h夘▥ê—푹갇㵳TA鳠嚵\\B<X}3訒câ‹{*ï«¢w]ç’¨-gæ­\\j໵侠Ei层\u0011": 3.758356090089446E-19,
- "䄘ï®)Y놞씃㾱陰í:{\u2059/Sâ“´": [[
- null,
- [[
- -3.8256602120220546E-20,
- null,
- 7202317607724472882,
- "CWQëš¿",
- null,
- false,
- true,
- null,
- 2857038485417498625,
- 6.191302233218633E-20,
- null,
- -6795250594296208046,
- [
- true,
- {
- "%ዧé°Yᚯ⚀x莰愒Vᔈ턗BNæ´ê¤ŸA1âŒl콹풪H;OX๫륞ìªá°šÑ†@͎黾a邬<L厒Xb龃7f웨窂二;": [[
- null,
- "耲?䙧㘓F6Xsí‹­ë©¢.v뚌?é„Ÿæ â–½'묺競?WvᆾCî»txo?dZ;䨸疎",
- {
- "@hWê‰&\"빜4礚UO~C;ã†î”殩_ꀥè˜å¥¢^챟k→ᡱKMⵉ<\/Jㅲ붉LÍŸQ": false,
- "tU뢂8é¾°I먽7,.Yî°î»´æ½Z툼=&⨥覽K乫햶㠸%#@Zë–æ„“^âŠâ¾‚몒3E_噆J(廊ឭyd䞜鈬Ћ档'⣘I": {
- "tK*ꔵ銂u艗ԃì¿âˆ³ê„‚霫X3♢9y?=â²­dЊb&xy}": [
- -4.097346784534325E-20,
- null,
- 6016848468610144624,
- -8194387253692332861,
- null,
- {
- "(祬诀譕쯠娣cë´r?ç•„kT뼾⌘⎨?noVä˜ì¥ç¡Žn?": [
- 1.82679422844617293E18,
- [
- false,
- 2.6849944122427694E18,
- true,
- [
- false,
- {
- ";0zâ­†;í™”$bਔ瀓\"衱^ï—´?잢ᢛ⣿~`ꕉ薸⌳໿湘腌'&:ryБꋥá¼ê’¥ç­™ê¬œê¸¨?X": -3536753685245791530,
- "c;Y7釚Uꃣ割J༨Y戣w}c峰뢨㽑㫈0N>R$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733,
- "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f",
- "꿽á…㔂긱Ǧ?SI": -1669030251960539193,
- "ì‡É¨`!è‘Ž>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651,
- "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efï¿Žì«¢[ï„™\"ëˆëŠ–꺙|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4g<Oꗢ뫺N쯂륬J╆.`ᇵP轆&fd$?è‹…o궓vO侃沲â©åš…æ²— E%â¿°ì–¦wi\\*趫": [
- 3504362220185634767,
- false,
- "qzXæœqT3軞T垈ꮲQ览ᚻ⻑쎎b驌䵆ꬠ5Fà­—ä²ç¼¿ê蒇潇Ltᆄ钯蜀W欥ሺ",
- "ë³°É霬)ì é¶¼kwocì—·èr \u001d쒷⎹8{%澡K늒?iﺩd=&皼倚J9s@3å›twὡgjä íª5⭉⨺役&놎cﺉ㺡N5",
- false,
- null,
- "D0st[ni锹r*0k6ꀎë‡UX2⽼৞䃚粭#)Zæ¡·36P]<\/`",
- 4281410120849816730,
- null,
- -3256922126984394461,
- 1.16174580369801549E18,
- {
- " ᆼꤗ~î…‰*TN긂<㡴턱℃酰^蘒涯잰淭傛2rൡetì¾£ä‡m*ã¸y\"\\糮᧺qv쌜镜T@yg1譬ﭧﳭ\f": null,
- "圾ᨿ0xᮛ禵ਗ਼D-㟻ẵ錚e\"赜.˶m)é´‘B(I$<\/轴퉯æ·â‹âº*)宓쓌?*橯Lx\\f쩂㞼⇸\"ﺧ軂é³V\\ë•’\"캘c:G": null,
- "?ïµ_ê³¢î™ç¿¸íˆ8ã¿ hì—´Q2ã­›}RY㯕YT놂⽻e^B<\/맫ﻇ繱\u0017Gц⟊ᢑﵩS:jt櫣嗒⟰Wã´šæ¦á…‰e[w䋺?藂翙Ⲱ芮ä˜â•¢å›¥lpdu7r볺I è¿‘qFyᗊ": [
- "$b脬aᅠ襬育Bگ嵺Pw+'M<\/ï­näššvèžbNâ’‚}褺%lቦ阤\"ꓺá—Mç‰,Ûžï– Ò¶!矬?ke9銊Xê´¦)䈽í‹è„½á¹«äˆžá´†^=Yá—¿é›4I귺⋥%",
- false,
- 2.9444482723232051E18,
- 2072621064799640026,
- "/_뇴뫢jã’=Nꡦâ†Ôºèµ’â¬î»¼í†¥ä¨žç¯su*媸瀳鷔抡oíº-៳è¾å‹·fç»”:äµ¢æ¢2",
- false,
- "ì’œ Eî½·äŒ/í\u0018懺_<\\隺&{wF⤊谼(<죽é ïŸ‡8?@*rᶊGd뻻갇&Ⳇq᣿e࢔t_ꩄ梸O詬C᧧Kê© í’¤9눙醅ëž}竸rw?滨ӽK⥿ཊGé­²']`๖5ã„°",
- -2375253967958699084,
- {"嗱⿲\"få„„á¬": {"v?äš‘í‚¡`â—¤k3,骥曘뒤Oᒱ㲹^圮᠀YTê»›&ì´®P:G/Tâ£#튣k3ç‚©è k@橈ä·S䧕,熜ïŒæ™¬ï£žk1鮥玸먚7䤡fç»å—šìƒ´á¥’~îš¼0q拮垑aë»±Lâ°–_": [{
- ":på°¢": -6.688985172863383E17,
- "A0\u0001疠ﻵ爻鼀湶I~W^å²€mZx#ãˆ7r拣$Ꜷ疕≛⦒痋盩Vꬷá­â„¦Qêªï§éˆ‘A(劽詗ꭅo-ç¶é‘º\"Ⓠ@$j탥;": [
- 8565614620787930994,
- [
- "嶗PC?උQ㪣$&j幾㾷hæ…‘ 즊慧⪉霄M窊ê·'鮕)äŠé“¨m趦䗲(g罣ЮKVﯦé®î¦®5囗ﰼ鿦",
- -7168038789747526632,
- null,
- -7.8069738975270288E16,
- 2.25819579241348352E17,
- -6.5597416611655936E18,
- {
- "瘕멦핓+?フZê·¢zé›V": {
- "ᕾ": 1.7363275204701887E-19,
- "ã­Œs뎹㳉": {"\u00187Fï–‰I6Yféº+UC쬸éºâ²ä‚¿ê¸•R\\ᆮC?Φ耭\rOத际핅홦*ë² W㸫㯼᡹cㅜ|Gã®—\u0013[o`?jHVì•?蒪꩚!í«áœ¦ãŒ‡äš‡é¿˜:@": [
- "}푛Г콲<äŸCè—呈#2ã“‹#ྕáŸå°¿9qç«“gI%ëž™mê¬oaç•è´¿Jå’¿D_ç†Zz皳験Iè±¼B扳ḢQ≖㻹㱣Dä¦ï©—2'á—㗣▌ç ²8罿%à°¹F姦;0î·æ‚‡<\/\"p嚧",
- -710184373154164247,
- "Vo쫬⬾ê«â´·Å»\u0004éŽHBê…¸_aVBHbN>Z4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜",
- -9006004849098116748,
- -3118404930403695681,
- {
- "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o<A?\"顜ᘌΈ;â·…Cæ´ºL蚴蚀voq:,Oo4쪂)": 5719065258177391842,
- "l륪맽耞塻論å€Eã—‘/㲕QM辬I\"qi酨玑㖪5q]尾魨鲡ƞY}⮯蠇%è¡Ÿï„Fsf윔äšì°¤iè…³": {"ꢪ'a䣊糈": {"ë°‘/♋S8sã¼´5瓹O{댞\"9Xï°‡lJ近8}q{긧ⓈI᱑꿋腸D瀬H\"ﺬ'3?}\u0014#?丙㑯ᥨ圦',gé‘ (樴턇?": [
- 2.5879275511391145E18,
- null,
- [
- "3㼮ꔌ1Gẃ2Wé¾™jîªÍŠ{1å›ã¦­9xå® ã‘oRä•çŠ½",
- 1268729930083267852,
- "땕軚⿦7C",
- [
- -3.757935946502082E18,
- "\"赌'糬_2ë­¾áb",
- {
- "(a䕎ጽjÒ°D4.á´¡ïž½66ԃ畮<\/l`k癸\\㇋ࣆ욯R㫜픉녬挛;ڴ맺`.;ç„“q淞뮕ٹ趴r蔞ꯔ䟩vç²u5<\/pZ埖Skrvj帛=\u0005aaï”›": null,
- "璄≩ v몛ᘮ%?:1頌챀H㷪뉮k滘e": [
- "ꤾ{`c샬왌펡[俊络vmz㪀悫⸹ᷥ5o'ã¾µ L蹦qjYIYណԠWëƒå‰«<\/W嗂0,}",
- 2.4817616702666762E18,
- false,
- null,
- null,
- -8.6036958071260979E17,
- null,
- -1.2744078022652468E-19,
- -4.4752020268429594E17,
- 1.13672865156637872E17,
- [
- false,
- false,
- null,
- -4.178004168554046E-20,
- true,
- 2927542512798605527,
- {
- ".ꔓ뉤1䵬cHy汼䊆賓á‡Æ©|樷â‡é†Žã¬…4\u0003èµµ}#yD5è†æ™¹ë±“9ê–è™›J㺕 t䊛膎ؤ": {
- "rVtᓸ5^`েNâ¹»Yv᥋lꌫt拘?<é®°ë„¿ZC?ã’½^": {"âªî©k_:>귵옔夘v*탋èŒ&㳈챗|Oé’§": [
- false,
- "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*y೧4VQè””hVæ·¬{?ᵌEfrI_",
- "j;ꗣ밷é‚副]á—“",
- -4299029053086432759,
- -5610837526958786727,
- [
- null,
- [
- -1.3958390678662759E-19,
- {
- "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{
- "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?Ká«œ`^讶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511,
- "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢c趖": [null]
- }],
- "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17
- }
- ]
- ]
- ]},
- "묗E䀳㧯᳀逞GMc\b墹㓄ë–Æ &U??íŽŒé‘ åª‹k))á„Š": null,
- "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Yï“ž:씧<\/â©«%yf䦀!1Ჶk춎Qç±³W∠WC跉鬽*á›±i<?,l<崣炂骵*?8í‘៣ⰵ憉⎑.,Nwç½£q+ο컆弎": false
- },
- "e[|଀+î±³lꑸãˆTT?ë¿¿|ê«›9`㱯䊸楋-곳賨?ì³k棽擋wQ餈âŸNq[q霩䵀뷮锅ꚢ": 5753148631596678144,
- "sá“鴻߸d렶ὕ蜗ဟ툑!诉౿": false,
- "|4䕳鵻?䈔(]í‹/Ui#æ¹»{듲ーMá‹€t7潔泄Ch⸨}ì£`î¤èž§éŠšã‹¼å£¯kâ°¥Q戵峉갑xè¾™'ì²›": "jd䘯$䕌茷!auw眶ㅥä£ê†¢æ°‘i",
- "剖駰Ɜî¶sM2]á¾´2ࡷ祅拌Av狔꩛'ꓗ킧ê£0酜✘O'": false,
- "澩뢣ê€eU~D\\ꮡ킠": "v^YC嚈ί\u0007죋h>ã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘ì¡ å«ž"
- }
- ]
- ]
- }
- ]
- ]
- ]}}
- }
- ]}
- },
- "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R"
- }
- ]
- ],
- "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`",
- "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false
- }]}}
- ]
- }
- ]}
- }
- ]
- ]
- ],
- "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢"
- }
- ],
- "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Diä•Žè°„nn父ꋊE": -2914269627845628872,
- "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017ï©š?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false,
- "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bꔧ賴緜s뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19
- },
- "ä›ræ»–wã¤<k;l8ꡔጵ⮂ny辶⋃í¼åƒ®z\"﮲X@t5෼暧퓞猋♅䦖QCé¹®|픨( ,>,|Ná‹œ": false
- }
- ]],
- "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624,
- "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„㎻æ°æ‰°Xï¿ŠCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null,
- "~˷jg쿤촖쉯y": -5.5527605669177098E18,
- "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null
- }
- ]
- ]]
- ]],
- "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[<S8á¬ë­©è„¥7U.m࿹:Dè‘┆2蘸^U'w1ì …;䠆ꋪBê»®>︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264
- }
- ]}]}
- ]
- }}}
- ],
- "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYT맵7䥺N<Hp4ê•­â¹ ê½c~çš½z": "课|á–¾ä¡å»‹è„äªW\u0016&Jnê´b~æ‘“M>â±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T"
- }
- ],
- "谶개gTRï¿>áµÍšdt晑䉇é™æ»º}9㉸P漄": -3350307268584339381
- }]
- ]
- ]
- ]]
- ]
- ],
- "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882,
- "í’µO^-⧧ⅶvѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2䂗Ⱨf?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844,
- "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null
- }
- ]
- ],
- "ោ係Øî½<å…ƒ": 1.7926963090826924E-18
- }}]
- }
- ]
- ]]}]
- }]
- ]
- ]
- ]
- ],
- "ጩV<\"ڸsOᤘ": 2.0527167903723048E-19
- }]
- ]}
- ]
- ]],
- "∳㙰3ì ´p᧗䱙?`<U὇<\/æ„E[ᮚAî›j诂ᒽ阚uv徢ဎ떗尔ê½í›€ì©‘Jä´?âª=륪ᆩ푰ஓã•?럽VK\"X?檨လ齿I/耉A(AWA~â¯ç¨è¹«": false,
- "å’å¦ë¾‡}䀼链i⇃%â‹œ&ç’ªIx渥5涧qq棩á¥-â «AA낇yY颕A*ïˆè£¦O|n?䭬혗F": null,
- "ç­CLì–­B혆Kॎ`鎃nrî€sZiÕªWç )?p~K~A眱ä²QO妣\u001b\u001b]ᵆᆯ&ã‹á¹è±‰ëº˜$ê­§#j=C)祤⫢歑1o㒙諩": 7028426989382601021,
- "쳱冲&ဤäŒì•§h胺-é½±H忱8왪RDKᅒ䬋ᔶS*J}ስ漵'㼹뮠9ê±¢9p봋경ጕtởꚳT䶽瘙%춴`@nಆ4<d??#僜ᙤ钴=薔ꭂbLXNam蹈": "樭る蹿= Uî ƒurwkn뙧⌲%\"쑃牪\"cq윕o@",
- "溌[H]ç„ŽSLã…?뀼䫨ç½W": 1.1714289118497062E-19,
- "ﬢp븇剌燇kĔ尘㶿㴞ç ê¾˜Ia;sâº^)$ç©®?sHᢥíªl": null
- }
- ]
- }
- ]
- },
- "TKnzj5o<\/K㊗ꗣ藠⦪駇î€>yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701,
- "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20
- }
- ]
- }],
- "?}\u20e0],s嶳è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'"
- }},
- "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true
- },
- "즛ꄤ酳艚â‚㺘봿㎨iG৕ࡿ?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272
- }
- ]
- ]}
- ]]
- ]]
- ]}
- }
- ]
- }
- ]]}},
- "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true,
- "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301,
- "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.",
- "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®"
- }
- ]
- ]]]
- }}
- }
- ]
- ]},
- "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘ë©Šá„ŸA\"_=": null
- },
- "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ﰎ鶊m䵱팱긽ꆘ<tD쇋>긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null,
- "뾎/Q㣩㫸벯➡㠦◕挮a鶧⋓å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17
- }],
- ",": -5426918750465854828,
- "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false,
- "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false,
- "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\J⵲v7": 6.8002426206715341E17,
- "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false,
- "ì‹Šj20": false
- }]]
- ]],
- "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true
- }
- ]
- ],
- "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Z<C1衽$\"-饧?℃\u0010⼒{î°p飗%R\"ä²”\")ì¹€\\%": true,
- "苧.8\u00120ݬ仓": 6912164821255417986,
- "ë–Žé¡£ä¿X;.#Qí‹.笂'p쟨唒í랩냆¦aâ±{è°.b我$蜑SH\u000fç¾=䟼⣼奔áœæ”•îŸ®B&挰繗ã”ê…‚-Qv\\0ä¶äš¥ãºio[㑮-ᇼ䬰컪ṼiY){ë°\u0010q螰掻~\n輚x\u0014罺)è»´": 3.024364150712629E-20
- }
- ]
- ]
- ]
- ]}
- ]]
- }
- ]
- ]]
- ]
- ]]]],
- "\"凲o肉Iz絾豉J8?i~傠᫽䇂!Wï›—D溊J?á¡’vsè†åµ¹âž’ïŸæ·´î‡…>ì„«^è«Ž0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105,
- "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false,
- "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "㶽1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uIà¡ž\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY",
- "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åŠ‰0~K3c柢Õã‰ïªªé€³~": false,
- "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5",
- "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400,
- "鬙@뎣䫳á®ë¡?){y?5K;TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false,
- "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null
- }
- ]]]],
- ":_=닧弗D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM"
- }},
- "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQG瑮e": 2.222802939724948E-19,
- "ä®´=â‘➶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!᧟;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­Jë•Ÿas꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vê„Ž1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r",
- "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p",
- "ë„ç•ŽQ娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k"
- }
- ]
- }],
- "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?ã•Š#撹圂䆲"
- },
- "Ü‹ë‹é¾«ï¥c웑": false,
- "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20,
- "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@êš„ã°¤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚",
- "ソ᥊/넺I": true
- }]]
- ]
- ]
- ]
- ]]
- },
- "䭑Ik攑\u0002QV烄:芩.麑㟴㘨≕": true,
- "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null,
- "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19,
- "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null,
- "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcࡶ4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true,
- "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null
- },
- "V傜2<": 7175127699521359521
- }],
- "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•æ¡¦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ",
- "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false,
- "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null,
- "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null,
- "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19
- }
- ]]
- ]
- ]
- ],
- "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ??î¿ž?æ«Ž~*á¿¡ê«Œ/繣ﻠq": null
- }
- ]}
- ]},
- "츤": false
- }},
- "s": 3.7339341963399598E18
- }
- ],
- "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"ⅹ䈔áºæŠ™ b,nt5Vã’J檶ê¨â»”?",
- "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V",
- "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null,
- "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null
- }
- ]
- },
- "勂\\&m鰈J釮=Ⲽ鳋+䂡郑": null,
- "殣b綊倶5㥗惢⳷è¢á‘€ä¬„镧M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸",
- "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17
- }}
- ],
- "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f",
- "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr",
- "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20
- }]}
- }
- ],
- "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTතv`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚é¿Ž\\aꡨ?": 3900062609292104525
- }
- ],
- "ਉ샒⊩Lu@S䧰^g": -1.1487677090371648E18,
- "⎢k⑊꬗yá«7^err糎Dt\u000bJ礯확ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညS지?~ì½®gR敉⬹'䧭": 1901472137232418266,
- "ç—k䶥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計l춥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u"
- }
- ],
- "Uﺗ\\Y\\梷䄬~\u0002": null,
- "k\"Y磓ᗔ휎@U冈<\/w컑)[": false,
- "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Z趣5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17
- }]}
- ]
- ],
- "곃㲧<\/dఓꂟs其ࡧ&N葶=?c㠤Ჴ'횠숄臼#\u001a~": false
- }
- ]
- ]}]
- }]
- }}
- ],
- "2f`â½°E쵟>Jî•ç¬‚裭!〛觬囀ۺ쟰#æ¡Šl鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻pæ¿š7E峿": 5613688852456817133
- },
- "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true,
- "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?"
- }}
- ],
- "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19
- },
- "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗l趕": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•ãŠµM}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh",
- "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000",
- "畀e㨼mK꙼HglKb,\"'䤜": null
- }]}]
- ]
- ]
- }]
- ]}
- ]
- ]}
- ],
- "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言",
- "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}㶊Gä£bì–š": null,
- "襞<\/啧 B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1鯯åæ ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š",
- ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356
- }
- }
- ]]]],
- "웺㚑xs}q䭵䪠馯8?LB犯zK'os䚛HZ\"L?셎s^㿧㴘Cv2": null
- }]
- ]
- ]
- ],
- "Kdî©´2Kv+|z": 7367845130646124107,
- "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,㶢9r漢": -3.133230960444846E-20,
- "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null
- }
- ],
- "a8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null,
- "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%趌I┽2ឪЀiJNcN)槣/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245
- }],
- "G5ᩜ䄗巢껳": true
- }
- },
- "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éŠ‰",
- "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6",
- "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000e춂8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false,
- "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-kè•žfu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—",
- "?(˧쩯@å´Ÿå‹æ­„K": null
- },
- "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'觔7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null
- }
- }
- }
- ]
- ]
- ]}
- },
- "HO츧G": 3.694949578823609E17,
- "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286,
- "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850,
- "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&é‹Œ": -2.7231911483181824E18,
- "tꎖ": -4.9517948741799555E-19,
- "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l<Ké«î–žM戶鯮t:wRî°2ꉱ`9'l픪*í芦㊢Pjjoå ¡^ ì‡ì–›å¶…있ষ0?F",
- "下9T挞\\$yᮇk쌋⼇,ਉ": true,
- "櫨:ㆣ,é‚lî ¬r崕祜ã®çƒœZ,XXD蕼㉴ kM꯽?P0﹉릗": null,
- "îŠgv솠歽閘4镳䗄2æ¾¾>쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null,
- "幫 nç…¥sì‡íŽ‡ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"Kè¿Žë©Ž[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17,
- "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=rá橢ឳn:^iá´µtD볠覅Nèµ´": null
- }]
- }]
- }
- ]
- ]}
- ]},
- "謯?w厓奰T李헗èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322,
- "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18
- }
- ]
- }
- ]
- ]],
- "í‰êº”㠦楶Pê…±": 7517896876489142899,
- "ï™°": false
- }
- ]},
- "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18,
- "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false
- }
- ]},
- "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾"
- }
- }}
- }],
- "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_맶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?"
- },
- "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´",
- "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null,
- "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640
- }
- ]
- ]]
- ]}
- ]}]
- ]
- ],
- "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19
- }
- ]
- ]
- ]}
- ]
- ]
- ],
- "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false
- }]]
- ]}}},
- "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null
- },
- "p溉ᑟi짣z:䒤棇r^٫%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null,
- "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null
- }
- ],
- "á±€nè‚“ã„›\"å »2>mæ®®'1æ©Œ%êž´êµ°=Ӳ鯨9耛<\/næ“š0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª"
- },
- "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tⶥGÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032,
- "ì „pJjleb]áž½": -7.5418493141528422E18,
- "n.鎖ጲ\n?,$䪘": true
- },
- "欈Ar㉣螵᪚茩?O)": null
- },
- "쫸M#x}D秱æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~â‘Ÿ~冫ऊ2ì«°<\/戲윱o<\"": true
- },
- "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true
- }
- }
- ]]}]}},
- "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18,
- "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17
- }]}
- }
- ]
- ]],
- "潈촒⿂å¡": 5495738871964062986
- }
- ]]
- }
- ]
- ]}
- ]]
- ]]
- ]}
- ]
- ]},
- "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17,
- "㶵Ui曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!잶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null,
- "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“⦷詵%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19
- }
- ]
- },
- "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô",
- "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959,
- "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅kì©ŽFfì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞",
- "踛M젧>忔芿㌜Zk": 2215369545966507819,
- "ì”A`$槭頰í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true,
- "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null
- },
- "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17
- },
- "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18
- }]}}]
- ]}
- }}
- ]}]
- ],
- "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null,
- "è¹\\ëž“G^璬x৴뭸ゆUS겧﮷Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vê„Ÿ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false,
- "졬믟'ﺇফ圪쓬멤m邸QLবä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null,
- "컮襱⣱뗠 R毪/鹙꾀%헳8&": -5770986448525107020
- }
- ],
- "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^ã“Ÿä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null
- }
- ]
- ]
- }],
- "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null,
- "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null,
- "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null,
- "꽦ﲼLyr纛ZduçB絟쬴糔?㕂짹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k"
- }
- ]]]],
- "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Z맷㰩Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null
- },
- "觓^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19,
- "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null
- }
- ]
- }}],
- "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null
- },
- "脨z\"{X,1u찜<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true,
- "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•à¬—P좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266
- }}]
- },
- "5s⨲JvಽῶꭂᄢI.a৊": null,
- "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19
- }
- ]
- ]},
- "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{F䶛l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540,
- "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—",
- "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19
- },
- "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724,
- "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true,
- "çš^ಸ%ê±<\/蛯<O\"-刷ã R(kO=䢊䅎l䰓팪A絫픧": "è­”\\ãš„ ?R7㔪G㋉⣰渆?\\#|gN⤴;Wì¹·A׫癮଼ೣã³ë’œ7dæ“ê¾²0扬S0ᆵi/贎ྡn䆋武",
- "è‡ç ‡Gã“朦켋Wq`㞲攊*å†î‘µî¨~霓L剢zI腧튴Tç¹™Cঅ뫬╈뮜ㄾ䦧촄椘B⊬츩r2f㶱厊8eϬ{挚â¯OM焄覤\\(KÓ¡>?\"祴å“\\\\'í": -3.4614808555942579E18,
- "釴U:O湛㴑䀣렑縓\ta)<D8ï­³æ§é«­D.L|xsæ–‹æ• \"ë‹æ—©7wáŽ": true,
- "쵈+쬎簨up䓬?q+~\u0019仇îŒëµˆá«¯3áµ£æ˜æž°åŠ«ãª¢uç˜-퀭:ì»™:u`⌿ï«A(9鄦!<çšnj3:Hࣨ巋ä€æ—¸ëŽˆë§»v\"\\(곘vO㤰aZe<\/W鹙鄜;l厮ë‘": null,
- "î–·": -1.2019926774977002E-18,
- "%者Oî–‹7.Nêªs梇接z蕜綛<\/䜭\"죊y<曋漵@Śâ¹sD⟓jݗᢜ?zî–†/9á²Ma쨮긗贎8ᔮ㦛;6p뾥໭䭊0B찛+)(Yã¿ é¸ä•’^옥": "鬃뫤&痽舎Jì½®è—󽸰ᨨMꈫ髿v<N\\î·.ì‚’ê»…Ñ1ê­¼5ä´·5쳬臨wjë¥"
- }],
- "é·Ž'ã³—@帚妇OAj' è°¬f94ǯ(횡ヒ%io쪖ì‚좛>(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null
- }
- ]
- ]]]}]
- ],
- "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797,
- "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y",
- "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true,
- "à·Ø™4ç„⶿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*h짎#á‡é® ë¾áž¿ë€Œ": false,
- "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null,
- "⭤뙓z(㡂%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3譻K1잞": 2091209026076965894,
- "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17,
- "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18,
- "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ"
- }
- ]],
- "斴槾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null,
- "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null,
- "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ"
- }
- ]
- ]
- ]}
- ]
- ]
- }]]]}}
- ]}],
- "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfⶽ?퇋!Å‚ï¡”B〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7ã¢äŸ¸\"Yb": 2.36010731779814E-20,
- "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null
- },
- "曺vì°˜×?&绫OáŸ": 9107241066550187880
- }
- ]
- ],
- "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1î•Ÿèµ³o": true,
- ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null,
- "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íŠ¼î£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582,
- "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進"
- },
- "숌dee節é½é‚ºp넱蹓+e罕U": true
- }
- ],
- "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^î¡œ9R䬑<ﮛG<s~<\/?ⵆá¥è€ç†·uë“·"
- }}
- ]
- }
- ]}
- }
- }
- }
- }},
- "宩j鬅쳜Qê–јyç”Zá­µï1væ“–}䨿F%cֲ᫺贴m塼딚NP亪\"ï¿‹sa뺯ꘓ2:9뛓ï à¼‚쌅䊈#>Rꨳ\u000fTT泠纷꽀MR<CBxPñ±’«X쇤": -2.22390568492330598E18,
- "?䯣ᄽ@Z鸅->ᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳIè„šë™›u": 5.694374481577558E-20
- }]
- }
- ]],
- "obj": {"key": "wrong value"},
- "퓲꽪m{㶩/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1a綑á–DḾä©": null
- },
- "key": "6.908319653520691E8",
- "z": {
- "6U閆崬밺뀫颒myj츥휘:$è–ˆmYí–š#rzé£+玭V㭢뾿愴Yî°‘ê–šX亥ᮉ푊\u0006åž¡ã­ë£\"厓ᔧḅ^Sqpv媫\"⤽걒\"˽Ἆ?ꇆ䬔未tv{DV鯀Tἆl凸g\\㈭ĭ즿UH㽤": null,
- "b茤z\\î¨.N": [[
- "ZL:ï¿„á‹Ž*Y|猫åŠæ«•è¾Oj为1糕쪥æ³S룂w࡛á²â¸¥èš™)",
- {
- "\"䬰á»wDæ¾V`邀⠕VDãºsH6[칑.:醥葹*뻵倻aD\"": true,
- "eîž¡æµ±uî¿£p蔽Crà· JK軵xCʨ<뜡癙Yç©ï½¹é½ˆX/螗唻?<蘡+뷄㩤쳖3å‘犾&\\첊xzå崦ݻé´\"åµ¥B3㰃詤豺嚼aqJ⑆∥韼@\u000b㢊\u0015L臯.샥": false,
- "l?Ǩ喳e6㔡$M꼄I,(3á縢,䊀疅뉲B㴔傳䂴\u0088㮰钘ꜵ!ᅛ韽>": -5514085325291784739,
- "o㮚?\"춛㵉<\/﬊ࠃ䃪ä£wp6ἀ䱄[s*S嬈貒pᛥ㰉'ë€": [{
- "(QP윤懊FI<ꃣ『䕷[\"ç’嶮?%Ḭå£à²»ä‡Ÿ0è¤!è—²ë¹bd浶tl\u2049#쯀@僞": {"î—i妾8홫": {
- ",Mï£ë§ƒäž›K5nAㆴVNã’Ší–¬$n꩑&êŽæ¤žî·é˜«?/á¹ì„¸ë‰ª1x쥼㻤㪙`\"$쟒薟B煌܀ì¨à­2掳7㙟鴙Xå©¢\u0002": "Vዉèˆï ’᧷⦌kîŒï®žà°ˆnz*<?੃'ahhCFX(\u0007⮊Eã­ä±¾Gxꥩrâ£.æ´Ž",
- "ë»´5bDDí¯O傆盓왻U?êž…êŠNé­á§¢Ï„\"迳豲8\u001b䃥ꂻ䴺ྸHç­´,": {
- "\"L鸔SE㬡XV&~ÍŽ'놅蔞눶l匛?'.Kæ°\\ƢẨ疇má¿›'ê½³&!é¹ m'|{Pç—Š 秄쒿u\u00111䋧gÏ©x7t丗D䊨䠻z0.A0": -1.50139930144708198E18,
- "8é‹‚ë›·ïž”?ì²’B☚>ï·œFM\"è­7ê€-VR<\/';ä™E9$䩉\f @s?íªo3^è¡´cî˜à¶Žä§ªaK鼟q䆨c{ä³ 5mᒲՙ蘹ᮩ": {
- "Fã²·JGoâ¯Pëµxë’³p䘧☔\"+ꨲå¿JfR㔹)4nç´¬G练Qáž!C|": true,
- "p^㫮솎ocî’£.೚A㤠??r\u000f)⾽⌲們M2.䴘䩳:⫭胃\\á¾@Fá­Œ\\K": false,
- "蟌Tk愙潦伩": {
- "aï‘<\/@ᾛ慂侇瘎": -7271305752851720826,
- "艓藬/>á„ṯ,XW~㲆w": {"Eç—§î–郶)㜓ha朗!N赻瞉駠uC\u20adè¾ <Ve?í±!ImäŽî­Ÿæ„:*s 9è«šPrᵾ뒰髶B̌qWA8梸vS⫊⢳{t㺲q㺈랊뮣RqK밢쳪": [
- false,
- {
- "\u000b=>x퓮⣫P1à «LMMX'M刼唳ë¤": null,
- "P쓫晥%k覛ዩIUᇸ滨:å™í˜²lMR5䋈V梗>%å¹½ué –\\)쟟": null,
- "eg+昉~矠䧞难\b?gQì­·ç­\\eê® Nl{ಢ哭|]Mn銌╥zê–˜zⱷ⭤ᮜ^": [
- -1.30142114406914976E17,
- -1.7555215491128452E-19,
- null,
- "渾ã¨ß牄귛r?ëŒ?w[âšžÓ»~廩輫㼧/",
- -4.5737191805302129E18,
- null,
- "xyà¿‘M[ocì…’ç«“â’ºx?뜓y䊦>-Dì¼(&&?XKkc꩖ﺸá‹ëµžK伕6ী)딀PæœyWæ™îž¢?훻魢傎EG碸9類៌g踲C⟌aEX舲:z꒸许",
- 3808159498143417627,
- null,
- {"m試\u20df1{G8&뚈h홯J<\/": {
- "3ஸ厠zs#1K7:rᥞoꅔꯧ&ë‡éµ¼éž«6è·œ#赿5l'8{7㕳(b/j\"厢aqç±€êš\u0015厼稥": [
- -2226135764510113982,
- true,
- null,
- {
- "h%'맞Sì‹…Hs&dï”l슾W0jé¿M×D놯L~S-㇡Rì­¬%": null,
- "⟓咔謡칲\u0000孺ꛭx旑檉㶆?": null,
- "æ‡I転;￸B2Y`z\\ç“w,ë†æ¿æ’埵䂄)!䶢D=à´­ã´ŸjyY": {
- "$ࡘt厛毣ൢIèŠ<겿骫⫦6tr惺a": [
- 6.385779736989334E-20,
- false,
- true,
- true,
- [
- -6.891946211462334E-19,
- null,
- {
- "]-\\êŸ1/è–“â§á½Š\\l牑\u0007A郃)阜ᇒᓌ-塯`W峬G}SDb㬨Q臉⮻빌O鞟톴첂B㺱<ƈmu챑J㴹㷳픷Oㆩs": {
- "\"â—‰B\"pᶉt骔J꩸ᄇá›iâ•°æ ›K쉷㉯é©!ãˆnì¹äŸ…難>盥yé“¿eà­”è’M貹ヅ8嘋퀯䉶ጥã¢æ®Šë»³\"絧╿ꉑ䠥?∃蓊{}㣣Gk긔H1哵峱": false,
- "6.瀫cN䇮F㧺?\\椯=ÚˆT䘆4â˜ïšŒ8qv": -3.5687501019676885E-19,
- "Q?yऴr혴{஀䳘p惭f1ﹸ䅷䕋贲<ྃᄊ繲hq\\b|#QSTs1c-7(äµ¢\u2069åŒçµ˜ê¯‰:l毴ï›æ±žt戀oෟᵶ뮱á£-醇Jx䙬äí–¢0࣫á¡grã„›": "\u0011_xM/蘇Chv;dhA5.嗀绱V爤ﰦiëµ²M",
- "â‘[\"ugoy^儣횎~U\\섯겜ï¥l2jw஌yD腅̂\u0019": true,
- "ⵯɇä²á«¿à¢š!㯢l샅笶戮1꣖0Xe": null,
- "劅fë„€ï‹ï§¼bå®ç„ŠE찓橵G!ʱç“뭔雩괛": [{"p⹣켙[q>燣äƒãž½î›œá©²x:쓤삘7玑퇼0<\/qç’‚á‘[ï ™Z\\3䅵䧳\u0011㤧|妱緒C['ì·“Yꞟ3Z鳱雼P錻BU씧U`ᢶg蓱>.1ӧ譫'L_5VäµÐ¦": [
- false,
- false,
- {"22ä‚盥N霂얢<F8î±ê¼µ7Gà°¸yhë€g᦭ꄢx硴嬢\u001a?Eê´†T|;7犟\"Wt%ä©O⨵t&#ᬋK'èœá²«æ”⾠鲂Të©·éƒ\u0018ä“žcE": {"f=ä츜瞾zw?å­¡é£\\铀᫞yẆg(\u0011M6(s2]`ਫ": [[[{
- "'y몱纣4S@\\,i㷯럹Ua充Tᣢ9躘Zଞ쥿äŠs<\/刎\\\"뉦-8î©Œ/": "蜑.X0꭛낢륹iì ¨êš<8?s볕è¡|Q✬᯦@\\G㑢屿Mn졾J굤⥟JW뤵苑rì•íˆ„åµµ?â¾¥O",
- "^1挲~[n귆誈央碠멪gI洷": -8214236471236116548,
- "sሣ%娌暡clr蟜㑓2\u000bSâŸ_X㨔⚴5~蔷ꀇ|Xu㬖,꤭å¹îµ¿r(g믇ì©ïŠ¨%췸앙|æ £U\\2]䤉+å• è¡ê¯ŽT鉹m\n/`SzDᅼ鞶": 1.1217523390167132E-19,
- "u톇=黚\\ ꂮ췵L>躰îe9â‘©_뵜斌n@B}$ê´»Yá±@䧋V\"☒-諯cVë¯Ê ": true,
- "Ű螧ᔼæªéŽë•’딜qꄃH뜣<ç§à¥‚CYå“â¸>XQ㵡趌oë¬k픀빯a(ܵç”ë†à­¯/6Nᪧ}æšá†šì§ŒP牰泱鈷^d꣟#Lì‚€\"㕹襻;k㸊\\f+": true,
- "쎣\",|⫝̸阊x庿k잣v庅$éˆê´Žç‚”k쬪O_": [
- "ìž©AzZGz3v愠ꉈⵎ?㊱}Så°³à¯p\r2>ì·IP䘈M)w|\u000eE",
- -9222726055990423201,
- null,
- [
- false,
- {"´킮'뮤쯽Wxè®V,6ᩪ1ç´²aႈ\u205czD": [
- -930994432421097536,
- 3157232031581030121,
- "l貚PY䃛5@䭄<nW\u001e",
- [
- 3.801747732605161E18,
- [
- null,
- false,
- {
- "": 4.0442013775147072E16,
- "2J[sᡪ㞿|n'#廲꯬乞": true,
- "B[ç¹°`\\ãa̼㨀å›ã½“<\/꥖ᵈO让\r43⡩徑ﬓ๨ﮕx:㣜oçŽê‰Ÿã¢Cçµï›‰á½†á“žì‡“Qs氯였9駵q혃Ljê‚”<\/昺+tä‹à¼»çŒ™c沪~櫆bpJ9Uá:칣妙!çš—F4㑄탎䕀櫳振讓": 7.3924182188256287E18,
- "H磵ai委曷n柋T<\/å‹¿F&:ꣴfU@㿗榻Lb+?í„sp\"᪟~>ê·»m㎮ç¸f": 1.0318894506812084E-19,
- "࢜⩢Ш䧔1肽씮+༎ᣰ闺馺窃䕨8Mƶqè…½xc(៯å¤J5굄ä•Qj_훨/~価.䢵慯틠퇱豠㼇Qﵘ$DuSp(8Uà¸<\/ಟ룴𥳐ݩ$": 8350772684161555590,
- "ㆎQ䄾\u001bpᩭ${[諟^^骴᤮b^ㅥI┧T㉇⾞\"绦<AYJ⒃-oF<\/蛎mm;obh婃ᦢ": false,
- "䔤䣈?æ±.p襟&dã±…\\Jᚠ@?Oì²à¢½íœ”VR蔩|㒢柺": [[
- "-ꕨ岓棻r@鿆^3~䪤Ѐ狼︌ﹲ\\á¸MlEìµ Q+",
- null,
- false,
- 3346674396990536343,
- null,
- {
- "": null,
- "/ä¨S쨑,&繷㉥8C엮赸3馢|뇲{é„Žê—‡qFﶉ雕UD躢?Ꟛအï–꽡[hᕱᗅ㦋쭞MユèŒ?L槽암V#성å”%㣕嘵\\Ú¹(å˜èº¿&q": [
- -1364715155337673920,
- false,
- -8197733031775379251,
- "E팗鮲JwH\\觡܈áœ\"+뉞娂N휗vå™™á‚ê¹¼\u001dD帒l%-æ–”N",
- -3.844267973858711E-20,
- [{"쬯(褈Q 蟚뿢 /ⱖ㻥\u0017/?v邘䃡0U.Z1î­­x?鯔Vå° 8Emï•<": [[[
- null,
- [
- null,
- -5841406347577698873,
- "í‚·\"S⋄籞繗솸ᵣ浵w쑿ퟗ7náŽx3ì•™z㘌쿸I葥覯ã¬0á†b汆狺뷘ႀnꋋ",
- -1227911573141158702,
- {
- "u㉮PᾺV鵸A\\g*à¡—9슟晭+ͧↀ쿅H\u001c꾣犓}癇æ›á—¬é»©äŸ˜X梑é†e>rä°‚f矩'-î½7ä¡­æ¡¥Dz兔V9谶居ãºá”Šä©¯ë².\u001eL0ὅㅷ釣": [{
- "<쯬Jå·^숞u࠯䌗艞R9닪gã¾ë³Ža䂈歖æ„:%é”|ﵤ|y}î¡»>;2,覂⶚啵tb*ä»›8乒㓶B࿠㯉戩oX 貘5V嗆렽ë‚߼4h䧛êºM空\\b꿋貼": 8478577078537189402,
- "VD*|吝z~h譺aᯒ": {
- "YIì·¢K<\/濳xNne玗rJo쾘3í•°é´Š\"↱AR:ࢷ\"9?\"è‡ï¦¡)?誚êŠe)_D翾W?&F6J@뺾ê°NZ醊Z쾈വHï±å¶¿?炫㷱鬰M겈<bïž²S}㎥l|刖k": {"H7鷮퇢_k": [
- true,
- "s㟑瀭좾쮀â‘î¬Yì°ºk맢戲쀸俻àº6å„®ë—扖puߖꜻ馶rꈞ痘?3ྚ畊惘䎗\"vv)*臔웅鿈䧲^v,껛㰙J <ᚶ5",
- 7950276470944656796,
- 4.9392301536234746E17,
- -4796050478201554639,
- "yꬴc<3㻚",
- "oå¡\u20a4蒵鮬裢Cá´§nBã­±f.",
- false,
- [
- false,
- "ã¡å¼‘V?瀆䰺q!출㇞yᘪ꼼(IS~Ka 烿ꟿ샕桤\u0005HQҹ㯪罂qè¾âš‡æ‡‹â¦•ë‘¡v",
- 1862560050083946970,
- "\u20b6[|(ë­¹gê’펉O轄Dl묽]ﯨ髯QEbAã’¾m@롴礠㕓2ë•«n6ْ엘঵篳R잷꙲m색摪|@ã¿«5aK设f胭r8/NI4춫栵\\꯬2]",
- false,
- {
- "\u000b7*ã™›ç‡.~?䔊pæ•e_拺艿ë·f{ê”»1sé©™`$Ė戧?q⋬沭?å¡·á­šè¹€unoa5": {
- "Sê·¯o紞㾕ᅶä¾î—¶éŠ‡12|ÊŸç•´ï–iNAo?|Sw$M拲գ㭄紧螆+,梔": null,
- "ã­š0?xB疱敻ேBPwv뾃熉(Ó pJ]ê°¢\"Bj'\u0016GE椱<\/zgៅx黢礇h},M9ï´¦?LḨ": "Si ïŸB%~㬒E",
- "핇㉊살ã¢ìˆ¨~ȪRo䦅D桺0z]﬽蠆c9ᣨyPP㿷U~ãž?쯟í¸å®’뉆U|}㉓郾ࣻ*櫎꼪ä—s?~7\u001e㘔h9{aáž‹}:㶒P8": [{"\\R囡ì¬nN柋çØ›7ì¹¾ :㶃衇徜V æ·±f1æ·â™ i?3S角íž^ᆞ\u20e8á¹°D\u0007秡+躒臔&-6": {
- "䨑g.fhã”—=8!\"狿ൻLU^ë»±g䲚ã»'W}k欤?๒鲇S꧗䫾$ĥ피": -794055816303360636,
- "外頮詋~텡竆î™ç¹ƒä©è‹¨ë¾ºæœê¼ƒç˜¹f*㉀枙NH/\u2027ê¢}j묎ïƒvペq︉ì‹ëœ¡Od5 N顯ି烅仟Qfㆤ嚢(i䬅c;맧?嶰㩼츱ç¡?-": {
- "e݆ã¡â¬¬î›–'2ã»’?U篲鿄\"隻Ҭ5NꭰꤺBꀈ拾᩺îº[刯î…5곑Na램ﴦ዆]ã“qwé’„\u001b\"Yæ´Šä—¿î¼ç¥å¡¥è¿µ[⼞⠳P$ê ±5먃0ï¦`": [{"ç°Eè³ï«šb먭N긆Ⰹå²2逶ꜛ?H짉~?P}jj}ä¾·ç¿_T>á­¨b,â»éˆµP䕡䀠८ⱄ홎鄣": {
- "@?k2鶖㋮\"Oರ K㨇廪儲\u0017ä¾î¿‚J?);\b*묀㗠섳햭1MC V": null,
- "UIICP!BUA`î€á¢ˆã‹¸~袩㗪⾒=fBï®´l1ꡛ죘R辂여ҳ7쮡<䩲`熕8é ": 4481809488267626463,
- "Y?+8먙ᚔ鋳蜩ï–럶1㥔y璜౩`": [
- null,
- 1.2850335807501874E-19,
- "~V2",
- 2035406654801997866,
- {
- "<숻1>\"": -8062468865199390827,
- "Mã¿£ï€E]}qwG莎Gná¶(ê”™\\D⬲iꇲs寢t駇S뀡ꢜ": false,
- "pê¤ãŽ9W%>M;-Uç’fî£(^j1?&RB隧 å¿“b똊îƒE": "#G?C8.躬ꥯ'?냪#< 渟&헿란zpo왓Kj}é·§XﻘMツbä•–;㪻",
- "vE풤幉xz뱕쫥Ug㦲aH} ᣟp:鬼Yá°Ÿ<Fɋ잣緂頒âºä‰²ç‘‘ä…‚,C~Þ…G!f熢-B7~9Pqà¡¢[츑#3ê•Ž,Öඳè⩅㵧춀ë¿xyäŒÍ‚tdj!箧᳆|9èš¡ë¬": -2.54467378964089632E17,
- "䵈䅦5ë¹–,궆-:໿댾仫î»0ᙚyá¦hqáš„": null,
- "侯Y\"湛졯劇Uì…ŽYXçâ…¸2ä¼´|ç­§\\ä’㶶á·ì‘WaᦵᗱãœëŠ¾è† <Jc63<G\u20fe䇹66僣k0O\"_@U": null,
- "姪y$#sæ¼´JH璌Ӊ脛Jã¾íŽ”ï¹´oꈶ㚸PD:薠ì–%說ážè¹‚1]⾕5튄": {
- "á¾Huw3䮅如쿺äŸå«]<鰨ݷ?꯯䫓傩|á¶à·ƒåª½\\澒≡闢": "Mm\"ì‡á¯„졽\"楇<\/ꥆí­å±€néš´@é¿£wâ Š4Pï«å¾ŽW㊋;䤞'.팇è’ä¡´egpxå—Žwà®…ç—å ®á›nË︖䀤4å™™?໚éƒá±‹Þ˜à¥Žtæ‘姫籕殥ï­é™ƒ\"4[ê¬qL4Wê Žx",
- "ℇjéŒïš›5Bë’š\" U": "ç¡„ê˜{憠êµ:&t䌨m Cઌ쿣鞛XFê Ÿsä­ï¶ƒ\"æ ¼a0x闊昵å²L\\æšèˆaê¸j싹ç…\"î ²çŸï±¡é¦†*êµ–ç³ <ê”躎",
- "톌賠弳êŸb\"èž–X50sĶ晠3f秂å¯Iâ“Ÿ:è˜": 5.573183333596288E18,
- "%䴺": [[[[
- -6957233336860166165,
- false,
- null,
- {
- "\"ïŸ\\௮茒袀ᕥ23ୃ괶?ä•Ž.嚲◉ãžL+ᵡ艱hL콇붆@": null,
- "%螥9ꭌ<\/-t": true,
- ",9|î«è€¢æ¤¸ä“Xk죱\u0015$Ώ鲞[ï’—?ì—¢á²í˜ªì¦ˆâ´‚â–‚â„´ã—¯\"gî´ëº˜\\êœ#\u0002ヮ}ሎ芲P[鹮轧@냲䃦=#(": 2.78562909315899616E17,
- "R?H䧰ⵇ<,憰쮼Q總iR>H3镔ᴚ斦\\é‘r*2橱Gâ¼”F/.j": true,
- "RK좬뎂aí™ f*f㱉á®â¦‹æ½™ã¨‹Gu곌SGI3Ië¿\\F',)t`è蘯囯ﮉ裲뇟쥼_ገ驪▵æ’ᕤV": 1.52738225997956557E18,
- "^k굲䪿꠹B逤%F㱢漥O披M㽯镞竇霒i꼂焅륓\u00059=皫之눃\u2047娤é–銤唫á•b<\/w踲䔼u솆맚,ä’á³'/it": "B餹饴is権ꖪ怯ꦂẉဎt\"!凢谵⧿ï™0\\<=(uLä·åˆ¨ì‘ª>俆æ“Cy襸Q힆䆭涷<\/á±0î É§îŠ‹䗾䚹\\ኜ?ꄢᇘ`ä´¢{囇}᠈䴥X4퓪檄]ꥷ/3謒ሴn+gé¨X",
- "GgG꽬[(å«“ëª6\u0004ê¶宩㙻/>\u0011^è¾dTè…ªhxÇ‘%ꊇk,8(W⧂çµP鬜O": [{
- "Mã´¾c>\\ᓲ\u0019V{>ꤩ혙넪㭪躂TS-痴໸闓âµ/徯O.Mã¥Ê·D囎⧔ì³íœ¤T??鉬뇙=#ꢫ숣BXä­¼<\/d똬졬g榿)eꨋﯪ좇첻<?2K)": null,
- "Z17縬z]愀䖌 ᾋBCg5ë”’êµ­æ†ê¾“aâ²·í„·u:U촳驿?雺楶\u0001\u001c{q*á°—è‹‘B@kæ°z.*è“—7ረIm\"Oá±@7?_": true,
- "㺃Z<": -4349275766673120695,
- "휃䠂fa塆ffixKe'ë¬é—੄뺾w࠾鑎kë•¢m*႑햞é®6攊&虜h黚,Yä±³Sﭼ둺pN6": [
- false,
- "IΎ䣲,\"ᬮ˪癘P~Qlnxå–Sᮔ༬˨IçŒm䜛酛\u0003iê¸ã¦§cQ帲晼D' \\(粋ï›wQcN\\ëµ°è·ˆ",
- [
- "D0\\L?M1ì¥KaêŒsd+盌귤憊tz䌣ëŒ×‘Oå‚wÏ¢%á½’gpî•—,Aiï™âŽ§á¶†I餾ê¦æ£©å˜…᳉怴%m]á¶is纖D凜镧o심b Uî»·",
- {
- "?଼\u0011Rv&^[+匚I趈T媫\u0010.䥤ᆯ1q僤HydⲰl㒽K'ᅾiౕ豲초딨@\u0013J'쪪VD౼P4Ezg#8*㋤W馓]c쿯8": false,
- "c/擯X5~JmK䵶^ìŽà´š|B|u[ì†(X뚤6v}W㤘⠛aR弌臌쾭諦eⒷ僡-;㩩⭖ⷴ徆龄갬{䱓ᥩ!ï¯âŠšá‡¨<v燡露`:볉癮꨽り★Ax7Ꮀ譥~舑\\Vê‹\"$)v": "e&sFF쬘OBï–†d슊寮f蠛জ봞mn~锆竒Gè„\"趵G刕䕳&L唽붵<\/I,X팚Bâ¥î¼¶X,kԇҗ眄_æ…¡:U附ᓚA蕧>\u001a\u0011\";~쓆BH4å‹æ”Š7힪",
- "iT:L闞椕윚*æ»›gI≀Wਟඊ'ꢆ縺뱹鮚Nê©á§¬è•¼21줧\\䋯``â\\ã±é³¨": 1927052677739832894,
- "ì®ç¼¦è…ƒg]礿Y㬙 fî¼ãƒºSɪ꾾N㞈": [
- null,
- null,
- {
- "!t,çY 1䗉罵?c饃호䉂Cá­ì’˜z(즽sZG㬣sഖE4ï‚뢜㓕äžä¸®Qpç°6EZឪ겛fx'ꩱQ0ç½£i{k锩*㤴㯞rè¿ŽjTⲤ渔m炅肳": [
- -3.3325685522591933E18,
- [{"ã“5]A䢕1룥Bï²C?Ꙍ`r룔Ⳛ䙡uä¼²+\u0001àµo": [
- null,
- 4975309147809803991,
- null,
- null,
- {"T팘8Dﯲ稟MM☻㧚䥧/8ﻥ⥯aXLaH\"顾S☟耲ît7fSà·‰ë†ë®”/ꕼ䓈ìº4\\霶䠴ᩢ<\/t4?죵>uDï›5➶༆쉌럮⢀秙䘥\u20972ETR3æ¿¡æ†vB? ~鸆\u0005": {
- "`é––mç’㥉b뜴?Wf;?DV콜\u2020í‰à±“æ“å®ZMj3mJ먡-å‚·ë±™yח㸷꥿ ໘u=Mì!5å­L4v\\?ÇŽ7C홫": null,
- "|": false,
- "~Ztᛋ䚘\\æ“­ã—傪Wé™–+ã—¶qᵿ蘥ᙄp%ä«Ž)}=â ”6ᮢS湟-èž¾-mXH?cp": 448751162044282216,
- "\u209fad놹j檋䇌ᶾ梕ã‰bוּ<dä—±:줰Mé…„\u0000X#_rç¢A饓ê—ÙKo_è·”?ᪧ嵜鼲<": null,
- "ꆘ)ubI@h@洭Ai㜎ä±k\u0003?Tä‰3é—´%j6jæ£j=â\\U毮ᬹ*8䀔v6cpjâ­¬~Q꿾뺶ï‰íŽµæ‚¡!ì©­åŽl六㽫6퇓ޭ2>": {"?è‹´ê© D䋓帘5騱qï±–PF?☸ç—é¡’yU á¡«cbä«Ž S@㥚gꮒ쎘泴멖\\:Ié®±TZ듒ᶨQ3+f7캙\"?\fí’¾\\oæžç´Ÿï»½M.âŽï˜¸é‘OP": [
- -2.6990368911551596E18,
- [{"ä’–@<á°¿<\/⽬tTrè…ž&G%᳊秩蜰擻f㎳?S㵧\r*k뎾-乢겹隷j軛겷0ë£é®ï µ": {")DO0è…¦:ì¶é€¿:1㥨่!è›æ¨‹2": [{
- ",ꌣf侴笾m๫ꆽ?1?U?\u0011ꌈꂇ": {
- "xæ—ç” nVqä…¦w`CD⦂惺嘴0I#vỵ} \\ê·‚Së´Dì–¾?Ô’j溯\"v餄a": {
- "@ç¿™c⢃趚痋i\u0015OQâlqë†Y0pࢥ3쉨䜩^<8g懥0w)]䊑næ´ºo5ì­QL댊랖L镈Qnt⪟㒅십q헎鳒⮤眉ᔹ梠@O縠u泌ㄘb榚癸Xî©­Þ”Ftj;iC": false,
- "I&뱋゘|ï£è“”䔕측瓯%6á—»HW\\N1貇#?åƒá—œghá­ªo'䗈꽹Rcìš/蔳迄à¼!0邔䨷푪8ç–©)[쭶緄㇈୧á": {
- "B+:ꉰ`sì¾­)ë¹¼Cç¾Aä«ŠpMgjdxäHf9᥸W0!C樃'ï¤f䫤סи\u0017Jve? è¦f둀⬣퓉Whk\"஼=չï³î•¤çš†ç¬BIW虨쫓F廰饞": -642906201042308791,
- "sb,XcZ<\/m㉹ ;䑷@c䵀s奤⬷7`ꘖ蕘戚?Feb#輜}p4nH⬮eKL트}": [
- "RK鳗z=袤Pf|[,u욺",
- "Ẏá»ç½¯ë‰‹âº–锅젯㷻{H䰞쬙-ì©“D]~\u0013Oã³¢gb@æ¶è”‰|kᦂâ—!\u001ebMè¤sca쨜襒y⺉룓",
- null,
- null,
- true,
- -1.650777344339075E-19,
- false,
- "☑lꄆs힨꤇]'uTന⌳ë†].1â‹”ê´æ²°\"IWà´©\u0019æ°œ8쟇䔻;3衲æ‹,窌zíŽå–íš—?4?Cë„é—®?ᥙ橭{稻Ⴗ_ì”",
- "n?]讇빽å—}1å­…9#ê­¨é¶v\u0014å–ˆ)vw祔}룼쮿I",
- -2.7033457331882025E18,
- {
- ";⚃^㱋x:饬ኡj'꧵T☽O㔬ROå©Ž?향ᒭæ©$渣y4i;(Q>꿘e8q": "j~錘}0g;Lèº*;á•­ê„®0l潛烢5H▄쳂ê’וֹꙶT犘≫x閦웧v",
- "~î¢æ¯\u2018c4è·ë E~ᑅቚꈂ?nq뎤.:æ…¹`F햘+%鉎O瀜ìŸæ•›è®âŒæµ¢<\/㮺紿P鳆ࠉ8I-o?#jﮨîŸ7v3Dt赻J9": null,
- "à£W䌈0êŽqC逖,íš…î·Žcáƒswj;jJSæ«5槗OaB>D踾Y": {"ã’°äµF%î©®?59.î„„ãˆcᕨï†í•í‹Žá¸ã‹©B=9IÛâ“Œ{:9.ywï½å‘°ã†®è‚’᎒tIã¾´62\"ዃ抡C﹬B<\/<EO꽓ᇕu&é‹«\\禞í¹uê’.7훯ಶ2䩦͉ᶱf깵ᷣ늎": [
- 5.5099570884646902E18,
- "uQNæ¿¿m臇<%?谣鮢s]]x0躩慌闋<;(î³¥ 鋤.0á µd1#벘a:Gs?í–·'.)ㅴ䞟ç¯å´ˆFS@O㌛ᓬ抢íŒáž¾ëƒ·ì¿Ÿíˆ¥IZn[惵ê§3ë™[&v憙J>ì´‹jo朣",
- [
- -7675533242647793366,
- {"ᙧ呃ï£:[㒺쳀쌡ì‚H稈㢤\u001dᶗGG-{GHྻຊꡃ哸䵬;$?&d\\⥬ã“N圴ë¤æŒ¨-'ê•®$î“‹PU%?冕눖ié­q騎Q": [
- false,
- [[
- 7929823049157504248,
- [[
- true,
- "Zè™\u0017'eꕤ᱕l,0\\X\u001c[=雿8è ¬L<\/낲긯W99g톉4ퟋbãº\u0007åŠ'!麕Q궈oW:@XáŽïœ¬z蘻m絙璩귓죉+3柚怫tSæ‡è’£ä -擶D[0=퉿8)q0ÙŸ",
- "唉\nFA椭穒巯\\䥴䅺鿤S#bè¿…ç˜ ï¶—ê¬˜\\?q1qN犠pX꜅^䤊⛤㢌[⬛휖岺q唻ⳡí‹\"ã™™Eh@oA賑㗠yå¿…Nꊑᗘ",
- -2154220236962890773,
- -3.2442003245397908E18,
- "Wᄿ筠:瘫퀩?o貸q⊻(᎞KWf宛尨h^残3[U(='橄",
- -7857990034281549164,
- 1.44283696979059942E18,
- null,
- {"ꫯAwè·­å–€ ?_ï““9\"Aty背F=9缉ྦྷ@;?^鞀w:uN㘢Rá»": [
- 7.393662029337442E15,
- 3564680942654233068,
- [
- false,
- -5253931502642112194,
- "ç…‰\\î¶è¾Žî›¢à³†ç½5â’­1äªäƒ‘s䎢:[e5}峳ﴱn騎3?è…³Hyêƒè†¼N潭錖,Yá‹ËœYAá“㬠bG렣䰣:",
- true,
- null,
- {
- "⒛'P&%죮|:⫶춞": -3818336746965687085,
- "钖m<\/0ݎMtF2Pk=瓰୮洽겎.": [[
- -8757574841556350607,
- -3045234949333270161,
- null,
- {
- "áœî…½rè¼³>⫇9hU#î¦#w@ê·ªA\\Cî’¢ 鋺㘓ê–梒뒬묹㹻+郸å¬ìœ¤'+g<\/碴,}ꙫ>ì†;情d齆Jä¬àº©æ’›ì±íƒ¹/R澡7剌tꤼ?ặ!`â²ç¤\u00002똥଴âŸ": null,
- "\u20f2ܹe\\tAê¥Æ°\\x当뿖ï»ë ‰ç¦›;G檳ﯪï…Sà«°3~㘠#[J<}{奲 5箉⨔{ë†<\/釿抋,åš /曳m&WaOvT赋皺璑ï“í…": [[
- false,
- null,
- true,
- -5.7131445659795661E18,
- "è­m䓪D5|3å©à°ž>î‰è ‡æ™¼6nï´ºPp禽羱î¤DS<ç“닫屚ì‚姿",
- true,
- [
- -8759747687917306831,
- {
- ">ⓛ\t,odKr{䘠?b퓸C嶈=DyEᙬï¿@ᴔ쨺芛髿UT퓻春<\/yê¸>豚W釺N뜨^?꽴﨟5殺ᗃç¿%>í‚ဿ䄸沂Ea;A_\u0005閹殀W+窊?Ꭼd\u0013Pæ±´G5ì“æ˜": 4.342729067882445E-18,
- "Q^즾眆@AN\u0011Kb榰냎Y#ä€ê€’ᳺ'q暇çµs\"!3#I⊆畼寤@HxJ9": false,
- "⿾D[)袨㇩i]웪䀤ᛰMvR<èŸã£¨": {"v퇓L㪱ꖣ豛톤î£\\ê³±#ï–©kDTN": [{
- "(ì¾´ä¡£,寴ph(C\"㳶w\"憳2s馆E!n!&柄<\/0Pꈗſ?㿳Qdéµ”": {"娇堰孹L錮h嵅⛤èºé¡’?CglNæŸ+쨣ﺜ\\MrH": {"çžäŽ‡ë‘ƒá‰²å¼­íŒ­^ꄞ踦涟XK錆쳞ឌ`;੶S炥騞ଋ褂B៎{ڒ䭷ᶼéœpIè—虶K$": [{"â—–S~躘蒉꫿輜è­Qã½™é—@ᢗ¥Eæ¦iØ¡5┄^B[絮跉ᰥé™PWi3wㄾⵀDJ9!w㞣ᄎ{ë“’ê““b6\\篴??c⼰鶹⟧\\鮇ꮇ": [[
- 654120831325413520,
- -1.9562073916357608E-19,
- {
- "DC(æ˜è¡µá¼¡ê¸™ê°µå§­|Ö›[t": 7.6979110359897907E18,
- "Jâ…))嫼â³9Xfd飉j7猬ᩉ+⤻î®çœ—벎Eé°‰Zᄊ63zá69}Zá¶L崭ᦥ⡦éšâ‹›êŽ¨î´µ~i㨃咊ꧭo䰠阀3C(": -3.5844809362512589E17,
- "p꣑팱쒬ꎑ뛡Ꙩ挴æ胔&7ᔈ묒4Hd硶í›ãŽ–zꢼè±ã¿¢aሃ=<\/湉鵲Eî„¡Ó…%$F!í¶æ£Œå­¼{Oé§à¨ºgeu+": ")\u001bìž“kÅ€Xì©«Aë°Â®Ú£ç™¦ç‹¢)扔弒p}k縕ꩋ,䃉tࣼi",
- "ã‚¡F肿輸<솄G-䢹䛸êŠl`Tqê•—îŠè’ža氷⸅ᴉ蠰]S/{J왲m5{9.uá½³~㕚㣹u>x8Uè®Bëºè¥ªç›ŽQhVS맅킃i识{벂磄Ià·„ä™…xZy/æŠà«­Zï–Šé²î¦š-霳Væ®æŒ¦â„’": null,
- "㯛|Nî½™ê¸b7âµb?æ‹ O\u0014Þ†?-(EꞨ4ꕷᄤYᯕï‘OW瞺~螸\"ìš¿Ñœ<u鵵઎⸊î˜å€¾ì‘·à·»rT⪄牤銱;W殆͢芄ਰåší›šìƒ¢î™‡âŠ¿+ã²½": null,
- "å˜ïƒé€†àº»%_맛d)zJ%3칧_릟#95䌨怡\u001ci턠ॣî’i冘4èµ–'à¨ä§_æ ”!": {
- "*?2~4㲌᭳ì¯ftá‚·1#oJ\bäŠ‡é•‡ë” \u2079xä›ãŠá®‚N;穽跖s휇ᣄ홄傷z⸷(霸!3yëºMì’¿í–Û½v㳉tở心3黎vì­» Rp཮Vr~T?&Ë´k糒븥쩩r*D": null,
- "8@~홟ꔘk1[": -5570970366240640754,
- "BZté¦ê¡¬c餖 s(má›´\u0000◄dè…‘t84CâŸå¯VṊ뉙'å™±ê”ç½GCé¡€?허0êž¹&ë‡ä›­Cä·«](": 2.4303828213012387E-20,
- "yæ’”Z외放+}ḑ骈á™&\u0016`G便2|-e]঳?QF㜹YF\"ã¿’ç·„í–·ï€ãˆŸïƒ¦ï¨ä·¦à­€áŒ¤lM蘸N㾆▛럪㞂tᕬ镈ì‡å– l amcxPnm\u001a᱋<\/]_]ﻹïª?H": false,
- "áæ°ë¬¢뜚I[♺뽛x?0Hë´¬Wpn꨹Raä¿ïŒ›ìŒ‘{㴂ni祻윸A'y|⺴ᚘ庌9{$æ²{톽=m#@ï–—6ᨧfgs44陎J#<Ễ쨓瀵â©a୛㷉㙉ܸ◠냔嬯~å‘„ç±ç¾¥é•³": false,
- "㘱{<é ¬22?IF@곊I겂嶻Lá›D{@rì’‚?IAᣧ洪惒誸b徂zì·ºê¾ã ­\\刊%禨ìŒâ¶£ä»µ\\P[:47;<ᇅ<\/": {
- "^U釳-v㢈ê—â—„è˜rᜨi;èµ·kR犺䵫\u0000é”ì™m-Ô™!lḃ꛸뻾F(Wê·›y": "#á ºH㸢5v8_æ´‘C",
- "䔵໳$á™ 6èž\u206eæ‘Žî½ q圩P|æ…sV4:㜾(I溞I?": -6569206717947549676,
- "é€êž‚ç·µí‡8 >e㺰\"'㌢ÆW\u0004çž•>0?V鷵엳": true,
- "뤥G\\î¡‹è¿‹ä ¿[庩'꼡\u001aiá©®Vì¯á³ªä¦ªÃ”î²…;倱ନë›èªˆ": null,
- "쥹䄆䚟Qæ¦äŽá¢­<\/2ã•£p}HW蟔|äƒî‚꿈ꚉ锳2Pb7㙑Tⅹᵅ": {
- "Y?Ö­$>#cVBꩨ:>ï†eLè’å‹™": {
- "86柡0po äš&-æ‘Ћ祌<\/휃-G*㶢הּì©s㶟餇c걺yu꽎還5*턧簕Ogå©¥Sê": null,
- "a+葞h٥ࠆ裈嗫ﵢ5輙퀟ᛜ,QDﹼ⟶Y騠锪E_|x죗j侵;m蜫轘趥?븅w5+mi콛L": {
- ";⯭ﱢ!ä¹°Fâ½æŸ¤é¶‚näµ£V㫚墱2ë ¾ELEl⣆": [
- true,
- -3.6479311868339015E-18,
- -7270785619461995400,
- 3.334081886177621E18,
- 2.581457786298155E18,
- -6.605252412954115E-20,
- -3.9232347037744167E-20,
- {
- "B6㊕.k1": null,
- "ZAꄮJ鮷ᳱo갘硥鈠䠒츼": {
- "á•…}럡}.@y陪é¶r業'æ´î‰°í€‰x䉴ﵴlí˜):씭脴ᥞhiꃰblﲂ䡲엕8߇M㶭0燋標æŒ-?PCwe⾕J碻Ᾱ䬈䈥뷰憵賣뵓痬+": {"aì·©v礗X⋈耓áŠfç½…é®!㔽YYᣓwæ¾33⎔芲F|\"äœT↮輦挑6ᓘL侘?ᅥ]ë†1R௯✎餘6ê½<\/௨\\?qå–·ê«j~@ulq": {"嗫欆뾔Xꆹ4H㌋F嵧]à Ž]ã –1ꞤT<$më«O i댳0ä²iï—Œ": {"?à·©?\u20cd슮|ꯆjs{?îž…d7?eNs⢚嫥氂䡮쎱:鑵롟2hJꎒﯭ鱢3춲亄:ë¼£v䊭諱Yj択cVmR䩃㘬T\"Ní™*ै%x^F\\_s9ë³´zz4æ·—?q": [
- null,
- "?",
- 2941869570821073737,
- "{5{殇0ä¾ïž¢g6ë°–í‹è‡©ç¶¹R$ä–­j紋釰7î‹‘sXI繳漪행y",
- false,
- "aH磂?뛡#惇då©…?Fe,ì˜+늵ä˜\"3r瘆唊å‹ï¢Šj⳧࠴ꇓ<\/唕윈x⬌讣䋵%拗ᛆⰿ妴á”M2㳗必꧂淲?ゥ젯檢<8ë’ï¶MidXä’3á³»Qî”â–®ä½UT|⤪봦éâŠ",
- [[{
- "颉(&뜸귙{yîš’^\"P퟉ì¶á²Ÿä®­î‹ºDé¡¡9=?}Y誱<$bë±£RvO8cH煉@tk~4ǂ⤧â©å±‹Sî›ïž¢S;J{vV#剤餓ᯅc?#a6D,s": [
- -7.8781018564821536E16,
- true,
- [
- -2.28770899315832371E18,
- false,
- -1.0863912140143876E-20,
- -6282721572097446995,
- 6767121921199223078,
- -2545487755405567831,
- false,
- null,
- -9065970397975641765,
- [
- -5.928721243413937E-20,
- {"6ì´Š\u001a홯kB0w撨燠룉{绎6⳹!í„è´‘y▾鱧ժ[;7ᨷ∀*땒䪮1x霆Hᩭ☔\"rî¹›ä7毟á°r惃3ꉭE+>僒æ¾": [
- "Ta쎩aÆt쵯ⰪVb",
- [
- -5222472249213580702,
- null,
- -2851641861541559595,
- null,
- 4808804630502809099,
- 5657671602244269874,
- "5犲﨣4mᥣ?yf젫꾯|䋬ìž$`Iⳉﴷ扳å…,'î±c",
- false,
- [
- null,
- {
- "DyUIN쎾M仼惀⮥裎岶泭lh扠\u001e礼.tEC癯튻@_Qd4cï…«5S熯A<\/ï¼¼6U윲蹴Q=%푫汹\\\u20614b[௒Câ’¥Xe⊇囙b,ï®æœ3ssë•Šë¢i~逇PA쇸1": -2.63273619193485312E17,
- "Mq꺋貘k휕=nKç¡ë«žè¼©>㾆~἞ࡹê¸æ¦µlâ‹™Hw뮢帋M엳뢯î¹…vâ…ƒ^": 1877913476688465125,
- "ᶴ뻗`~ç­—å…⚽টW˃â½b犳䓺Iz篤p;乨A\u20efì©?ç–Šmã€ì»©ë«¡b탔鄃ᾈV(é¢ç³=뎲ିeF仢䆡谨8t0醄7㭧瘵⻰컆r厡궥d)a阄á·Ed&c﯄伮1p": null,
- "â¯w4曢\"(欷輡": "\"Má­«]䣒頳B\\燧ࠃN㡇j姈g⊸⺌忉ꡥF矉স%^",
- "㣡Oᄦ昵⫮Y祎Sì級㭻撥>{I$": -378474210562741663,
- "䛒掷留Q%ì“—1*1J*ë“헩ᦢ﫫哉쩧EↅIcê…¡\\?â´Šl귛顮4": false,
- "寔愆샠5]ä—„IHï©¥=d﯊/å¶?ॊn%晥D視Nò—˜ˆ'᫂⚦|X쵩넽z질tsî¦kxDQ莮Aoﱻ뛓": true,
- "钣xp?&\u001e侉/y䴼~?U篔蘚缣/I畚�Q绊": -3034854258736382234,
- "꺲໣眀)â¿·J暘î©pИfAVì‚•ì³­Nꯗ4々'唄ⶑ伻㷯騑倭D*Okï¯ê§3bâ½_ï„¡<\/ì±£Xm톰á•ä†„`*fl㭀暮滠毡?": [
- "Dç”·p`V뙸擨å¿ë¸ª9c麺`淂⢦Yw⡢+kzÜ–\fY1䬡Hæ­)ë²¾Z♤溊-혰셢?1ï”<-\u0005;æ¢Tále\\ᛵߓﭩ榩<QF;t=?Qꀞ",
- [
- null,
- [{"-ì·«æ²î«§á¬¨å¢Šè‡¸<à ’Hè·¥ 㔭쥃㫯W=z[wধ╌<~yW楄S!â‘»h즓lÄ–N￧篌W듷튗乵᪪템먵Pf悥ᘀk䷭焼\\讄ræ“é¬y6VF<\/6ëž¿p)麡ê ãª\"pà®´e": [
- "#幎æ´é¢’嶈)ã„›J.嶤26_⋌东챯ꠉ⤋ؚ/âš%秼Q룠QGztᄎ㎷អIç¿°Xpç”éœê¨",
- {",T?": [
- false,
- [[
- true,
- 7974824014498027996,
- false,
- [
- 4.3305464880956252E18,
- {
- "᱿W^A]'rᮢ)é¥zï­é¤;Hu\\Fk?ï´º?IGæµ…-䙧>è¨-xJ;å·¡8깊è ï»“U$K": {
- "Vê•¡è«…æ“W=斸s︪vﲜ츧$)iꡟ싉eî®å¯³?ጭムVથ嵬iæ¥Fg<\/Z|៪ꩆ-5'@ꃱ80!燱R쇤tç³³]罛逇dṌ֣XHiͦ{": true,
- "Ya矲Cë©—Q9膲墅æºíœ»c\\딶Gç””<\/.齵휴": -1.1456247877031811E-19,
- "z#.OOï¿J": -8263224695871959017,
- "å´_3夼ᮟ1Fë¸ë½¯á¦“é´­V豈Ь": [{
- "Nè’¬74": null,
- "yuB?厅vK笗!ᔸcXQ旦컶P-ë…«mᄉ麟_": "1R@ 톘xa_|﩯é˜î¥§s槞d!d껀筤⬫è–焵먑D{\\ïƒïŽ¿6k共倌☀G~AS_D\"딟쬚뮥馲렓쓠攥WTMÜ­8nX㩴䕅檹E\u0007ï­¨N 2 ℆æ¶ê¥ê µï“3▙玽|ë¨_\u2048",
- "æA C䧩G": {":Mí£5e들\\ê€æ¼á”„é¸|Iï¨$)n": {
- "|U䬫㟯SKV6ꛤ㗮\bn봻䲄fXT:㾯쳤'笓0b/à³¢Cì³–?2浓uO.ä°´": "à½ê¼‹e?``,ᚇæ…^8ꜙNM䂱\u0001Iá–™ê§M'vKdꌊH牮r\\O@䊷ᓵ쀆(fî »yè»i툺\"?<\/峧ࣞ⓺ᤤ쵒߯ꎺ騬?)刦\u2072læ…ªy꺜ﲖTjî’•+u",
- "뽫<G;稳UL⸙q2n쵿C396炿Jè“¡zâ£zဩSOU?<\/ë™oEí¸Oé¿…à·´êˆEm#\"[瑦⤫á†glâ¡—q8\"í˜ë¥ä¿‚@ᆤ=\u0001爖ç¾ì·€ã¸©b9\\jeqt㟿㮸龾m㳳긄": {
- "9\"î²–V霟釜{/o0嫲Cå’€-饷äˆ[ë…©î)\r䤴tMW\\龟ϣ^ي㪙忩䞞N湆Y笕)è¨ê–¤èª¥ç…½:14â«»57U$æ“’ä²è–¡Qvↇ櫲현誧?nà®·6": {"l웾䌵.ä…‹ä¦ic碳g[糲Ƿ-ឈᚱ4쑧\u0004C࿼\u0018&쬑?멲<\/fD_檼픃pd쪼n㕊渪V䛉mæˆW儅톳뗳䓆7㭽諤Tç… ï–ŠNey?î¼…0᪵鈑&": [
- false,
- null,
- {
- "\rî´’;鼶já ‚ê¼RLz~â™”9gf?Ó¡æµ": -1.4843072575250897E-19,
- "&ꊒ\"ê‹Ÿä­E诮ﯚO?SWë’훪mb旙⎕ᗕ⶙|á·¤5y4甥": "j5|庠t铱?v íš‹0\"'rxz䃢æºêž«!\u0002",
- "Q á©ãŸ§": {"Hﬔ\u2058䪠틙izZㅛ탟H^ﶲA??R6å‘ Z솋R.࿶g8": [
- -8762672252886298799,
- -1.9486830507000208E17,
- null,
- -7157359405410123024,
- null,
- null,
- -995856734219489233,
- "呧㫹A4!",
- null,
- -1.9105609358624648E-19,
- 5888184370445333848,
- 2.25460605078245E-19,
- 2.5302739297121987E18,
- "뢹sbEfæµ2丯ï‡?뗾耸(Wdë™SବꭖrtU?ç­¤P똙Qpbbï‘¡KqaE$æ¥Vì›°3i/lK퉜,8︸e= gèž“t竦컼?.寋8éµ—",
- 7377742975895263424,
- 2.4218442017790503E-19,
- {
- "y꒚ཫ쨘醬킃糟}î‘yTSt䡀⇂뿽4ൢ戰U": [[
- 3600537227234741875,
- 4435474101760273035,
- -1.42274517007951795E18,
- -5567915915496026866,
- null,
- null,
- [
- -3204084299154861161,
- {
- "7梧慸æ†.a瘎\u00041Uéµ®CkÖ¨d惥è€â³¡Y,â­ì¨EåžFFI鱑ⳬ줢7⧵Bﴠ耘줕햸qì»´~*ç‘W.떛ࡆ@'á€+è½³": -961121410259132975,
- "⥅]l黭㣓绶;!!⎃=朼ã¿e&ἂ繤C﯀lä£ãŒ€6TMì‘®w懃ꡡ#ᤆ䰓,墼湼゙뽸㲿䧽쫨xᵖ듨<\/ T0峸iQ:溫è„\\\"쎪ὴ砇宖^Mæ³¼í¥âž…鈫@ᄟ༩\u2008⥼": true,
- "â©\"籽汎P싯鲘蟼sRá¯ä…©\u0019R(kRá–&ಌ 0\"鳶!馼YH": null,
- "鮼ꚇ싋։刟\rRLd步Nⴗ5Eࡆ訛갚[I醵NC(郴ṉy5D뤺౳QY壯5苴y훨(W\\Cଇ姚C艄깹\u001c歷㋵ZC᥂": [
- -6806235313106257498,
- null,
- "}N⸿讽sꚪ;\\p繇jè‹„î¡ä«¨\u20e7%5x?î•¥t#",
- {
- "O〗k<墻yV$à°rs-c1ఌ唪.C7_Yobᦜ褷'b帰mã„‘l⌅": {"qB뗗擄3éš‚5ëºæ«‚䱟eì´¸P/é©,3æŽê—©=冉棓㑉|ËžF襴뿴,:㞦<퓂⧙礞♗g뚎ᛩ<\/뉽ⶳ⸻A?_x2Iã½å‹’*Ií™±î¢é§ç²¿~曟㤙2绥Ly6+ìƒuu鿜בfí˜|æ­à£–É": [
- ">hh䈵î”w>1â²ì­V[â…Ž\\헑벑F_ã–⠗㫇hæ½;á¿æ±°á±¼ç€–J옆9RRì…vsZ柺鶶툤r뢱橾/ꉇ囦FGm\"謗ꉦ⨶쒿⥡%]鵩#ᖣ_蹎 u5|祥?O",
- null,
- 2.0150326776036215E-19,
- null,
- true,
- false,
- true,
- {"\faá­¶Pæ¤WWcá Ÿf뚉á¬í“—â³€Wç¹5:HXH=q7xì°™X$)모r뚥ᆟ!Jﳸf": [
- -2995806398034583407,
- [
- 6441377066589744683,
- "Mﶒ醹i)Gἦ廃s6몞 KJ౹礎VZ螺费힀\u0000冺업{è°¥'꡾뱻:.ꘘ굄奉攼Diá·‘K鶲y繈욊阓v㻘}枭캗e矮1c?íœ\"4\u0005厑莔뀾墓ë‚⽴洗ṹ䇃糞@b1\u0016즽Yè½¹",
- {
- "1⽕⌰鉟í”M㤭n⧴ỼD#%é˜âŠ¯ì¿¼ç¨ë¸£ëªç´§á…‡ã“•á›–cw嬀~ഌ㖓(0r⧦Qä‘•é«à´°é“‚㓻Rå„®\"@ꇱmâˆà¯¿á¦¯é Œ8}㿹犴?xn잆꥽R": 2.07321075750427366E18,
- "˳b18㗈䃟柵Z曆VTAu7+㛂cb0﯑Wp執<\/臋뭡뚋刼틮è‹ë²²î·´TLP预庰܈G\\O@VD'鱃#ä¹–ëº*鑪ꬳ?MÞždï­¹{â‡åœ¯ì‡œã¼ž顄︖Y홡g": [{
- "0a,FZ": true,
- "2z̬è£î’®ê§¦é©¸\u0006L↛Ḣ4๚뿀'?lcwᄧã®!蓚䃦-|7.飑挴.樵*+1ﮊ\u0010ꛌ%貨啺/JdM:ë˜ïˆ!FBe?鰴㨗0Oè´¢I藻ʔWAá«“Gì³›u`<\/I": [{
- "$Ï„5Vé´a뾆両環iZp頻යn븃v": -4869131188151215571,
- "*즢[⦃b礞R◚nΰꕢH=귰燙[yc誘g䆌?ଜ臛": {
- "洤湌鲒)⟻\\䥳va}PeAMnï¼®[": "ã³Éª/(軆lZR,Cpæ®È®Nå•·\"3Bå©´?i=r$펽á¤ì€¸",
- "阄R4㒿㯔ڀ69ZᲦ2ç™í•Œå™—På´œîž#\\-ì­è¢›îˆµ&é‘/$4ç«¥Vê©‘_ZHAæ¾¢fZ3": {"x;P{긳:Gé–‰:9?æ´»H": [
- "繺漮6?z犞焃슳\">á»[Ⳛ䌜ë…䂹>èµâ¼¶ç…œï’˜Yæ¡¥[泥뚩MvK$4ï‰jtï¾›",
- "E#갶霠좭㦻ୗ먵F+䪀oè’ba쮎4X㣵 h",
- -335836610224228782,
- null,
- null,
- [
- "r1᫩0>danjY짿bs{",
- [
- -9.594464059325631E-23,
- 1.0456894622831624E-20,
- null,
- 5.803973284253454E-20,
- -8141787905188892123,
- true,
- -4735305442504973382,
- 9.513150514479281E-20,
- "7넳$螔忷㶪}䪪l짴\u0007é¹Pé°šHFéŠZJﳴ/âŽ1ᷓ忉ç‡áœ‹ì“ˆxëµ mä·çª¥á”^\u0019ᶌå­#ヂt☆áƒpáŽè‡¶äŸ±5ï‰$ä°µ&๵分ìˆ]äˆë‰â™‚åŽ\u0011<>",
- "C蒑貑è—lï°°}X喇몛;të°¿O7/᯹f\u0015îµ¼kI嘦<ዴ㟮ᗎZ`GWퟩ瑹࡮ᅴB꿊칈??Ræ ¡sè„š",
- {
- "9çµæˆ¬+AU^洘拻ቒy柭床'ç²™XG鞕᠜繀伪%]hï ¾C,$è¼™?Utä¹–Qmë–šWï¶8઼}~qâ ªrU䤶CQ痗ig@#≲t샌f㈥酧l;yé—¥ZHæ–¦e⸬]j⸗?ঢ拻퀆滌": null,
- "畯}㧢J罚å¸VX㨑>1ꢶkT⿄蘥ã‘o|<嗸層沈挄GEOM@-䞚䧰$만峬è¼ä ±V✩5宸-æ‚D'ã—ªyP掶7bâ ŸJã•»SfP?d}v㼂á…'猘": {
- "陓y잀v>╪": null,
- "鬿L+7:ë‘Y=ç„ U;킻䯌잫!韎ஔ\f": {
- "駫WmGጶ": {
- "\\~m6ç‹©K": -2586304199791962143,
- "ႜࠀ%Í‘lâ¿…D.ç‘¢Dk%0ç´ªdḨTI픸%뗜☓s榗኉\"?V籄7w髄♲쟗翛歂E䤓皹t ?)ᄟ鬲éœ6Cî³´": {
- "_ì·¤a圷1\u000eB-XOy缿請∎$`쳌eZ~æ튻/蜞`塣৙\"⪰\"æ²’l}è•Œ\\롃è«æ°Œ.望wZ|o!)Hnçqg}": null,
- "kOSܧ䖨钨:಼é‰ê­O醧Sî…¨`ì‹­`ꓭì­ï¯¢N&Et㺪馻ã¢â…³ã¢ºå´¡àºŠèœšé”«\\%ahx켨|ż劻ꎄ㢄ìŸA躊᰹p譞綨Ir쿯\u0016ﵚOd럂*僨郀N*bã•·63z": {
- ":L5r+T㡲": [{
- "VK泓ë²á®™Ry㓤➙Ⱗ38oi}LJቨ7Ó㹡৘*q)1豢⛃e᫛뙪壥镇æž7Gè—¯g㨛oI䄽 孂L缊ꋕ'EN`": -2148138481412096818,
- "`â›á˜‘$(खꊲ⤖á„ꤒ䦦3=)]Y㢌跨NĴ驳줟秠++då­³>8ᎊ떩Eê¡£Sv룃 쯫أ?#Eî·°|á­™ãŽ?zv:5ï©^â‹‘V": [
- -1.4691944435285607E-19,
- 3.4128661569395795E17,
- "ãƒì´—^G9佭龶nå‹Ÿ8R厞eEw⺡_ㆱ%⼨D뉄퉠2ꩵᛅâ³æ¿L팹Là·€n=\"æ…‰ë…á›®y>!`g!í’²î¦ï¨’[/;?[vï®ê²è»‡}⤳â¤í•âˆŒTã½²R홓é‰ã“¥",
- "æ„°_⮹T䓒妒閤둥?0î°šaB@㈧gç„»-#~è·¬x<\/èˆPÝ„ê¡=\\׳P\u0015jᳪá¢q;ã¯l%á­—;砢觨â–,è¬ê°Gy?躤O黩í‹Yã’a擯\n7覌똟_䔡]fJ晋IAS",
- 4367930106786121250,
- -4.9421193149720582E17,
- null,
- {
- ";ᄌ똾柉곟ⰺKpá‡ä±»à¸ºä–{o~h!ï½…ê¿àª»ìš„Úš\u0002y?xUd\u207c悜ꌭ": [
- 1.6010824122815255E-19,
- [
- "宨︩9앉檥pr쇷?WxLb",
- "æ°‡9】J玚\u000f옛呲~ è¼ 1D嬛,î•*mW3?n휂糊γ虻*á´«ê¾ ?qîžå‡è¶—Ko↦GTé“®",
- "㶢ážmOã”k'诔栀Z蛟}GZé’¹D",
- false,
- -6.366995517736813E-20,
- -4894479530745302899,
- null,
- "V%᫡IIç’…ï»ä…›ä“Ží’¹ï±¢/pU9seë˜ë›žx梔~C)䨧䩻蜺(g㘚R?/á»°[å¿“C뾠ࢤc왈邠买?嫥挤풜隊枕",
- ",vç¢å–”㌲쟚蔚톬៓ꭶ",
- 3.9625444752577524E-19,
- null,
- [
- "kO8란뿒䱕馔b臻âŸéš¨\"㜮鲣Yq5mí”<u뷆cè­†\u001bN?<",
- [{
- ";涉c蒀ᴧN䘱䤳 ÿꭷ,핉dSTDB>K#ꢘug㼈á¦=P^6탲@䧔%$CqSw铜랊0&m⟭<\/a逎ym\u0013îš¡vᯗ": true,
- "æ´«`|XN뤮\u0018è©ž=ç´©é´˜_sX)㯅鿻á»ì‹¹": 7.168252736947373E-20,
- "ꛊ饤ï´è¢(逊+~⽫얢鈮ï«è‰¬O힉7Dç­—S곯wæ“I斞᠈븘蓷x": [[[[
- -7.3136069426336952E18,
- -2.13572396712722688E18,
- {
- "ç¡¢3㇩R:o칢行E<=\u0018á¬YuH!\u00044U%å炼2>\u001eSi$â“·ê’ˆ'ï‘¿ë ¢gᙫ番ꯒ㛹럥嶀澈v;è‘·é„•xè“Ž\\惩+稘Uî“´Eᖸﳊ㊈壋Nå«¿â¾æŒŽ,袯苷ኢ\\x|3c": 7540762493381776411,
- "?!*^á¢çª¯?\u0001ڔꙃw虜ë³îšFgJ?&⨫*uo籤:?}ꃹ=ٴ惨瓜Z媊@ત戹ã”똩Ԛ耦Wtè½\\æž’^\\ꩵ}}}ꀣD\\]6M_⌫)Hè±£:36섘㑜": {
- ";í™—á°°U஋㙛`D왔ཿЃS회çˆ\u001b-㢈`ë´†?盂㛣듿ᦾ蒽_AD~EEຆ㊋(eNwk=RÉ å³­qï’«\"5Ἠ婾^>'ls\n8QAK<l_⭨穟": [
- true,
- true,
- {"ﳷm箅6qⷈ?ﲈ憟b۷⫉἞V뚴少U呡瓴ꉆs~嘵得㌶4XR漊": [
- "í†ä»‹fM暪$9K[ㄇìƒí³æ’¦gæ’Ÿæ¸jÒFã¹¹aj bHᘀ踉êŽï¼£ç²„ a?\u000fKì¦‰î¶¯éƒ å¹¨9D舢槷Xh뵎u훩Ꜿ턾ƅ埂P埆kë©€{䢹~?D<\/ê¼¢XR\u001b〱ä½ê¼¨i㘀ḟ㚺A-挸",
- false,
- null,
- -1.1710758021294953E-20,
- 3996737830256461142,
- true,
- null,
- -8271596984134071193,
- "_1Gí‰í…‘m䮔鰼6멲Nmꇩſt쓟íŠN许FDï¡€j+3^ﶜ⎸\u0019⤕橥!\"sî•—-뾞lz北׸êšëž¬)?l⻮고iä‘°\u001f䪬",
- 4.459124464204517E-19,
- -4.0967172848578447E18,
- 5643211135841796287,
- -9.482336221192844E-19,
- "౪å†é‡¶9D?sèž­X榈枸j2秀vï ˜î ]泌鰚岒èµè½€ìŒ¶ïŠ›ií…½qMbL]R,",
- null,
- [
- null,
- {"M쪊ꯪ@;\u0011罙ꕅ<eáº|爑Yâµ<\/&ᩎ<腊ሑᮔ੃Fè±­": [
- "^0à¡Ÿ1ë³Pí‹áæˆF⨥Iê‚´\"z磣Vâ…¡=8í€2]䢹h1\u0017{jT<Iç…›5%Dì…Sâ‘™â…J*ìƒ å·™àº”ï€¢;᧡䙞",
- [{
- "'㶡í¾é„§`è·Š\"gV[?u᭒Ʊ髷%葉굵aë¦N켧Qﯳy%yä©Ÿé«’L䯜Säµ³r絅肾킂á'ꔦg긓a'@혔যWè°á¬F栩ŷ+7wéžš": 6.3544416675584832E17,
- "è‹Žè„·v改hmìµ|ã‹Šg_ᔠ뒨蹨峟ìŽã·¸|Ο刢?Gͨ옛-?î¨Gꦱî«î“©IEYUX4?%ꘋᆊ㱺": -2.8418378709165287E-19,
- "誰?(H]N맘]kæ´³\"qï±è’§è˜ž!Rí«\\(Q$T5Nå â«£ìœ¿6|럦ì†ï¸…ï­—(": [
- "峩_\u0003A瘘?✓[硫䎯á½uጭ\"@Y綅첞m榾=è´®9R벿῜Zï §",
- null,
- "䰉㗹㷾Iaáƒqcp쓘὾൫Q|ﵓ<\/ḙ>)- Q䲌mo펹L_ì¹æ¨–庫9ê©ìª¹á˜¹ä‘–ç€aK îž?*趤fë­“å»p=磕",
- "î“å“‘z懅á¤-ê¹ux쀭",
- [
- true,
- 3998739591332339511,
- "ጻ㙙?᳸aK<\/囩U`B3袗ﱱ?\"/ké”ä§2ï…¤l@쿎VZ쨎/6ꃭ脥|B?31+on颼-ꮧ,Oå«šm à¡­`KH葦:粘i]aSUì“™$ì‚f+詛頖b",
- [{"^<9<ç®&絡;%iï«¡2攑紴\\켉hì“™-柂äšven\u20f7浯-Ꮏ\r^í›ä“ší—¬\u000e?\\ã…¡ÖºJë–·VOt": [{
- "-௄å¶k㘆í˜à®½y⎱㢬sS઄+^瞥h;á¾·jî­;抭\u0003ë°«f<\/5Ⱗ裏_朻ï—%*[-撵䷮彈-芈": {
- "㩩p3篊G|宮hz䑊o곥j^Co0": [
- 653239109285256503,
- {"궲?|\":N1Û¿æ°ƒNZ#깩:쇡o8í‚—à¡Š[\"ë¸Po핇1(6é°$膓}â½*)渽J'DN<ì™ê¸˜æ¯¦ë²Ysì¹–": {
- "2Pr?Xjㆠ?æ®/?㓦柖馃5뚣Nᦼ|é“¢rè¡´ã©–\"ç”æ¹—Üæ†": "\"뾯ië‡ç­ç‰»$ç²/4ka $åŒíœ´ï‹è¯‘zbAá©ê‡¸ç‘…&뵲衯ꎀᆿ7@ꈋ'ᶨH@á ´l+",
- "7뢽ëšv?4^ꊥ_⪛.>pởr渲<\/⢕疻c\"g䇘vU剺dஔ鮥꒚(dïŸv祴Xâ¼¹\\îºa8y5å†": true,
- "o뼄Bìšžç¾hrï·”í˜ë’šâ¿›U5pꪴfg!6\\\"爑ì䢱W<ﶕî\\í…£ç‡oI/BK뺡'谑♟[Ut븷亮g(\"t⡎有?ꬊ躺ç¿è‰©nl F⤿蠜": 1695826030502619742,
- "ÛŠê¹–>ࡹ햹^ⵕ쌾BnN〳2C䌕tʬ]ì° ?ݾ2饺蹳ã¶êŒ­è¨\"â—¹á¬D鯎4e滨T輀ﵣ੃3\u20f3í‚™D瘮g\\擦+泙᧠鬹ﯨַ肋7놷郟lPå†{ß’hড়r5,ê“‹": null,
- "ΉN$y{}2\\N﹯ⱙK'8ɜͣwt,.钟廣䎘ꆚk媄_": null,
- "䎥eᾆá¦î‘§ì‰,JÞªn岪ã¥sî­•æ–謽䚔5tã¯ï–µï£šã°³ã±ŠZhD䃭f絕s鋡篟îža`Q鬃┦鸳n_é‚(E4è¿ _觅ë·_宪D(NLî²ç–¶hL追V熑%]vè‚«=惂!㇫5⬒\u001fï²å–º4랪옑": {
- "2aè¼85먙R㮧㚪Sm}E2yîŠê†£ê«¨rRymã±è†¶á”¨\\t綾A☰.ç„„ë™—9<쫷챻䒵셴᭛䮜.<\/慌꽒9å»Okä°ŠZ㥪幸k": [
- null,
- true,
- {"쌞ì": {
- "â–ŸGL K2ië›±iï¼±\"Ì .옛1X$}涺]éŽæ‡ Ú¦ëŠ·?tfçŸÝžã‚Ÿ{": 1.227740268699265E-19,
- "ê’¶]í“š%ฬKâ…": [{
- "(à·›@Ç®ã£ä§¼äµ¤[aテൖvEnAdUë –ë—ˆ@볓yꈪ,mÔ´|꟢ìº(而첸죕CX4Y믅": "2⯩㳿ꢚ훀~迯?᪑\\å•š;4X\u20c2è¥B箹)ä¿£eá»»w䇄",
- "75༂f詳䅫ê§é¿ }3\u20b5'∓ä±è™€fè¼î‘”Iq鈆﨤gí©)BFa왢d0뮪痮Mé‹¡nw∵謊;ê§f美箈ḋ*\u001cî±ïœŸ`퇚í‹ä³«$!V#N㹲抗ⱉçŽ(V嵟ï«_bã³…\u0019": null,
- "e_m@(i㜀3ꦗ䕯䭰Oc+-ë ¨0뭦⢹苿蟰ê‚SVä°­å‹¢ë¥.ྈ爑Vd,á•¥=í€)vz뱊ꈊB_6듯\"?{ã’²&㵞뵫ç–ë¡ë¯ˆ%Qwé™,?\ræž®\"? N~癃ruà¡—dn&": null,
- "㉹&'Pfs䑜공j<\/?|8oc᧨L7\\pX᭠9᪘": -2.423073789014103E18,
- "ä„瑄䢸穊f盈᥸,B뾧푗횵B1쟢f\u001f凄": "é­–âš2儉j꼂긾껢嗎0ࢇ纬xI4]ï„(à©“`è•ž;픬\fC\"æ–’\")2æ«·I﹥迧",
- "ퟯ詔xæ‚ë ¹+T?Bg⥄섅kOeQí¼ã»´*{Eé¼6æ°¿L缋\u001c둌๶-㥂2==-츫I즃ã ï–˜Lg踞ꙂEG貨鞠\"\u0014d'.ç¼—ï¡gI-lIb䋱ᎂDy缦?": null,
- "î’¢ç´Mã¦çŠ¿w浴詟棓쵫G:äœ?V2íž½7N*n&ã–ŠNd-'ຊ?-樹DIv⊜)gä‘œ9뉂ㄹí‘阉~ê…쵃#R^\u000bïž®B䌎䦾]p.䀳": [{"ϒ爛\"ꄱ︗竒G䃓-î†ã¾å¸³ã‚.j)qguæ‰å¾£à¨Zé¼—A9A鸦甈!kè”å–™:3Tî†%&ã ˜+,ä·ž|ì±½v䚞문H<\/醯r셓㶾\\a볜åºzEä·_죤ဵ뿰᎟CB": [
- 6233512720017661219,
- null,
- -1638543730522713294,
- false,
- -8901187771615024724,
- [
- 3891351109509829590,
- true,
- false,
- -1.03836679125188032E18,
- {
- "<?起HCᷭ죎åŠîŒŽèŽ‡é€°/{gs\u0014⽛㰾愫tï¿–<솞ڢëŒç…²è†ºà¨»9x닳xà¡­Q訽,ᶭඦtt掾\"秧㺌d˪䙻꫗:á­ˆh4ç·žç—䤴cë«šë–©à°¤<?ᕢ謚6]í›Oé°é‹›é• è´©èµŸ\"<Gâ™·1'": true,
- "቙ht4ßBqꦤ+\u0006멲趫ç”)椾": -1100102890585798710,
- "ç·å…Žê³‡ë‡¸ç²ŸF醇;朠?厱楛㶆â¶7râ¾›o꯬᳡F\\머幖 㜦\f[æ¦á¥½ã®£0ä•Š?J㊳뀄e㔔+?<n↴å¤î§·": [
- "4~ê‰ç¾\\å®(泤å•ë¹œ\u0014>j랎:g曞ѕᘼ}链N",
- -1.1103819473845426E-19,
- true,
- [
- true,
- null,
- -7.9091791735309888E17,
- true,
- {"}蔰鋈+ê¨å•µ0?g*사%`J?*": [{
- "\"2wG?yn,癷BK\\龞䑞x?蠢": -3.7220345009853505E-19,
- ";饹়â€)çš‹`噿焒j(3â¿w>å5X<np?<줯<Y]æ˜!J೸UⳂNे7v௸㛃ᄧ톿䨷鯻v焇=烻TQ!F⦰䣣눿Ké·šëˆ'â­²mæ (äš»": [
- "蹕 淜੃b\"+몾ⴕ",
- null,
- 35892237756161615,
- {
- " 듹ã)5æ…ç®±&$~:é°ì®<\/å ‹?% \\勽唅zì†å¸‹ä˜ºH髀麡M퇖uz\u0012m諦d᳤콌æ¨\rX싹̡á²": -433791617729505482,
- "-j溗ࢵcz!:î€}✽5à´‡,욨Ýs#ë«=å—浺^}E\\Y\\T*뼈cdêºcÛ˜ïµëŽä¨¸ë±K䠴㉿æ¿é€³îŽœ@wî·¿fì¢<\/[L[": -9.3228549642908109E17,
- "Ms킭uà®—%\\uâŽ/家欲ἅ答㓽/꯳齳|㭘Pr\"v<\/禇䔆$GA䊻˔-:í‹Š[h?倬è¤á¾žà§³.Gw\u000b": [
- "0宜塙I@ä´è‰\\Uyë’…=2<hæš’ï…£K._è´¡ç’Yi檻_⮵uá㘗è [f\u0015힢Hê”®}጑;ï´èªyf0\"\u20cc?(=qæ– âž½5ꎾ鞘kⲃ",
- -2.9234211354411E-19,
- false,
- true,
- {
- "\u0011⟴GH_;#怵:\u001c\u0002nîž»1U\\p/ì™”(┫]hêšî·ƒ7\r0䵷첗岷O௷?î·°ãŽ[殇|J=?韷pᶟ儜犆?5კ1kê–iH竧뛈ପdmk游y(콪팱ê¾k慧 yè¾£": [
- false,
- "O\"ëp覈ykv磂㢠ãµ~뀬íŠlC&4솎䇃:Mj",
- -7.009964654003924E-20,
- false,
- -49306078522414046,
- null,
- null,
- 2160432477732354319,
- true,
- "4íš¡h+!踹ê¬P鮄{0&ë±¥M?ìƒéž…n㮞ᨹ?쒆毪l'ç®…^ꚥ頛`e㻨52柳⮙嫪࡟딯a.ï‘„~äµ®1få˜N&zÈ­L榓ۃ鳠5d㟆M@㣥ï Ó‹AÎq0縶$",
- -3.848996532974368E16,
- true,
- null,
- -3.5240055580952525E18,
- {
- " vï­·áµ#ce乃5僞?Z D`묨粇á”ç» vWLè­¢uë½€\\J|tâ“™tâ„–\"ꨋnT凮ᒩè‚ç¯b騩:䢭Hbvì»å³¨z㹚T趗햆귣학津Xiï¼¹@á–¥K": true,
- "!F 醌yï䉸W2ꇬ\u0006/ä’7~%9擛햀徉9â›°+?㌘;ê “X䇻Dfi뼧쒒\u0012F謞Õ絺+臕kà¤LSQìŒX쎬幦HZ98è’Šæž³": "澤令#\u001dæŠâ›³@Næ•í€‚[5,✄ꘇ~䘷?\u0011Xꈺ[硸⠘⛯X醪è¡x\u0007쌇MiX/|ï¾ëšK8ä¡î¿¥W)銀q僞綂蔕E",
- "6â²ä£–R৞@ငg?<\/à³´xé™™Xꈺ崸⠅ᇾ\\0X,H쟴셭A稂ힿã‚F\\ì‘ž\u0012懦(Aᯕç­~î½”\u0001ê»®X?逊": 5.7566819207732864E17,
- "[c?椓": false,
- "kä’‡": 2583824107104166717,
- "꙯N훙ã…ﮒ燣㨊瞯咽jî™Mxby뻭뵫װ[\"1畈?ৱL": "ë£á”‚魠羓犴ꚃ+|rY",
- "ë…ºZ?îˆä¬ï“©é‰‰îˆ­:?â³™ç˜Cኯ.Vs[釿䨉ì§\\\\*쵢猒$\\y溔^,㑳": {"藶꺟": [{
- "\"d훣N2zq]?'檿죸忷篇ﮟ擤m'9!죶≓pë­»\\ᇷ\f퇶_ä°¸hà¹Q嵃訾㘑従ꯦ䞶jLí‹Šræ¾µOmᾫ!H䱤팼/;|á­ºI7슎YhuXiâš¼": -1.352716906472438E-19,
- "M⽇倻5J䂫औá”楸#î „î¾–J[Fﹱ쫮W誻bWz?}1\"9硪뻶fe": "盬:Ѹ砿íšë•£T凊(mç¦å‘œï»R㿎艴䂵h",
- "Rë¾k힪CHé’™_i苮ⰵoᾨ紑퉎7h؉\"柀è½z0့\"<?嘭$èœ?礲7岇槀묡?Vé’¿T⣜v+솒çšÔ›2ç±³mH?>è–™å©è¿3aFÆÃ": "2,ê“´g?_섦_>Y쪥션钺;=趘F~?D㨫\bX?㹤+>/믟kᠪ멅쬂Uzỵ]$ç§`mé›ç‘Šî’ඖ鯬cꙉ梢f묛bB",
- "♽n$YjKiXX*GOè´©éƒè±®ç¥´éžK醞眡}ê—¨v嵎꼷0à­¸+Mè‹eH徸Jîžê£†:â¼æ‚¥B켽迚㯃bè«‚\u000bjꠜ碱逮m8": [
- "푷᣺ﻯd8ﱖ嬇ភHîªé¹Žâ¡±á±…0g:æžœ6$GQ췎{vá·§Yy-è„•xå¹ç ¡ï¨¬â®¸C蓼êš=軄H犠Gè°–ES詤Zè ‚3lë´Ÿhï¿’7䦹1GPQG癸숟~[#駥8zQ뛣J소obg,",
- null,
- 1513751096373485652,
- null,
- -6.851466660824754E-19,
- {"ä©‚-â´®2Ù°K솖풄꾚ႻP앳1Hî³é·›wmR䗂皎칄?醜<\/&à §ã¬X濬䵈K`vJ륒Q/IC묛!;$vÏ‘": {
- "@-êš—xྐྵ@m瘬\u0010U絨ﮌé©\\켑寛넆T=tQã­¤Lì—°@脸삯e-ï–…î–‘:⩼u㎳VQ㋱襗ຓ<Ⅶ䌸cML3+\u001e_C)r\\9+Jn\\Pﺔ8蠱檾è…Pqé³è¯î¦§Tä„I": -1.80683891195530061E18,
- "á·­á‹»U~ཷsgSJ`᪅'%ã–”n5픆桪砳峣3ç®æž¾äŒ·âŠ°å‘€ïŒ": {
- "Ş੉䓰邟自~X耤pl7间懑徛s첦5ਕXexh⬖鎥á€nNr(J컗|ૃF\"Q겮葲놔엞^겄+㈆è¯ã€¾í¬ç´G'E?飕1fâ¼í…¬æ‚šï•¦æ³¬ë¨Uç¬í›¶Qs": false,
- "î³…(\u20dag8í½íŠ£>^Y{뤋.袊䂓î†;_ïg]S\u202a꽬L;^'#î—™ë•bá‚Œ?Cç·¡<ä²ä²æ–­ê6\u001asD7IK5Wxo8\u0006p弊⼂ê¯æ‰µ\u0003`뵂픋%ꄰ⫙ë¶lå›å°›ïˆ®+ä—…E쟇\\": [
- true,
- {
- "\n鱿aKã¡â’ã¼™2ì´¹f;`ì¾qIà¡”G}ã·äç“°w늮*ç²…9뒪ㄊCj倡翑閳R渚MiUO~仨䜶RꙀA僈㉋⦋n{ã–¥0딿벑î§é€¦â¥»0î¾®h薓쯴ê»": [
- 5188716534221998369,
- 2579413015347802508,
- 9.010794400256652E-21,
- -6.5327297761238093E17,
- 1.11635352494065523E18,
- -6656281618760253655,
- {
- "": ")?",
- "TWKLꑙ裑꺔UE俸塑炌Ũ᜕-ï’‚o\"徚#": {"M/癟6!oI51niíš=댡>xê¨\u0004 ?": {
- "çš­": {"⢫䋖>u%wî²´ìž¼<ä•ê˜P䋵$é­‹æ‹U䮎緧皇Y훂&|羋ꋕ잿cJ䨈跓齳5\u001a삱籷I꿾뤔S8㌷繖_Yឯ䲱B턼Oæ­µF\\l醴o_欬6ç±=D": [
- false,
- true,
- {"Mt|êžD|F궣MQ뵕T,ëºk+?ãµi": [
- 7828094884540988137,
- false,
- {
- "!༦鯠,&aﳑ>[euJê½ç¶·æB.h": -7648546591767075632,
- "-n켧嘰{7æŒæ¯„Y,>â螵煫乌pv醑Q嶚!|âŒè²¬0왾ë¢ê…蛨S\\)ç«°'舓Q}A釡5#v": 3344849660672723988,
- "8é–ªéºV=鈢1녈幬6棉⪮둌\u207d᚛驉ꛃ'r䆉æƒà¥ˆ|bἧﺢᒙ<=穊强s혧eꮿ慩⌡ \\槳W븧J檀C,ᘉì˜0俯퀉M;筷ࣴ瓿{늊埂鄧_4æ¸Nn阼Jੵ˥(社": true,
- "oë¼€vwï…®)4A뢵(î¼±a䵢)p姃뛸\u000fK#KiQp\u0005ê…芅ì…îª": null,
- "ç ¥$ꥸ┇耽uæ–®Gc{z빔깎밇\\숰\u001eê´·å„㶇쵿_á´„+hç©¢p촀Ნ䃬zäé…³Ó‚31xꔄ1_ç šWë ˜G#2è‘ŠP ": [
- -3709692921720865059,
- null,
- [
- 6669892810652602379,
- -135535375466621127,
- "뎴iO}Z? 馢녱稹ᄾä©rSt帤넆&7ié¨ë©—ç•–ï”9誧鄜'w{Ͻ^2窭외bã‘Žç²–i矪ꦨ탪跣)KEㆹ\u0015V8[W?⽉>'kc$䨘ᮛ뉻٬M5",
- 1.10439588726055846E18,
- false,
- -4349729830749729097,
- null,
- [
- false,
- "_è ¢ã ^䟪/D녒㡋ỎCä’ˆíŒïŒ¢\u0006àªq@O펢%;é¹ìŒo戥~A[ꡉ濽ỳ&虃᩾è£å”™ï¤£èŒ¨Ig楡꒻M窓冉?",
- true,
- 2.17220752996421728E17,
- -5079714907315156164,
- -9.960375974658589E-20,
- "ᾎ戞༒",
- true,
- false,
- [[
- "ⶉᖌX⧕홇)g엃⹪xëšç™Ÿ\u0002",
- -5185853871623955469,
- {
- "L㜤9ợㇶKé°â‹“V뽋˖!æ–«as|9"á¬ä†ª?7胜&n薑~": -2.11545634977136992E17,
- "O8뀩D}캖qè‚6༣ã—䈓煮å½à¨†áŽ¼Dᣘí›;": false,
- "YTá¡…^ï—Lã—ŽcbY$pᣞ縿#fh!ꘂb삵玊颟샞ဢ$ä—é¼’ëª~rkH^:닮먖츸륈⪺쒉砉?㙓扫㆕꣒`R䢱Bé…‚?C뇞<5Iޚ讳騕S瞦z": null,
- "\\RB?`mG댵鉡å¹ç‰©äµŽæœ‰5*e骄T㌓ᛪç¾é§’Ku\u001a[柆jUq8⋈5鿋츿myï»—?é›ux঴?": 5828963951918205428,
- "n0æ™…:黯 xu씪^퓞cB㎊á¬âº˜Ù¤Öƒ~B岚3㥕擄vᲂ~F?C䶖@$mï›~å¿”S왖㲚?챴⊟W#벌{'ã°Iä ç¸s樘\\X뢻9í•¡I6èㄛî‚î«8쯶]wॽ0L\"q": null,
- "x增줖j⦦tä¢áŽ™ïŠ­ã›¿Yf鼘~ê«“æ„4惊\u209c": "oOhbᤃ᛽z&Bi犑\\3B㩬劇䄑oÅ쨅孥ë©àº–acA㖫借ãžvg싰샂ãœ#譞⢤@k]鋰嘘䜾L熶塥_<\/â¾å±ˆï®Š_mYè¹t뙺}Ox=wé®®4S1ê©ï¬¾'å·‘",
- "㗓蟵ꂾe蠅匳(JPä—à·¸\u0089耀왲": [{
- "ᤃ㵥韎뤽\r?挥O쯡⇔㞚3ä¼–\u0005Pî•â‹ª\"D궣QLn(⚘罩䩢Ŏv䤘尗뼤ë›O淽鋋î¡é—šrå´©a{4ç®™{煷m6〈": {
- "l곺1L": {
- "T'ਤ?ç …|੬Km]ä„©\"(࿶<\/6U爢䫈倔郴l2ã´±^줣k'Læµ–Lé°„Rp今鎗⒗Cì–¨Mí›ã¡§Î˜X粜뫈N꤇輊㌻켑#㮮샶-ä—룲è ç™œã±V>=\\I尬癤t=": 7648082845323511446,
- "é‹žEP:<\/_`á§e混ㇹBd⯢㮂驋\\q碽饩跓྿ᴜ+j箿ë ã—‘yK毢宸p謹h䦹乕U媣\\炤": [[
- "3",
- [
- true,
- 3.4058271399411134E-20,
- true,
- "æ€+憱f逮@먻BpW曉\u001aã£âŽŠ$n劈D枤㡞좾\u001aá›ïŒƒè‹”౩é—1B䷒Ṋ݋âžê€žêƒç£$t੤_:蘺⮼(#N",
- 697483894874368636,
- [
- "vᘯ锴)0訶}ä³…â©š0O壱韈ߜ\u0018*Ué¾ä–=䧉뽑å•íœ»ID쿇嘗?ꌸῬ07",
- -5.4858784319382006E18,
- 7.5467775182251151E18,
- -8911128589670029195,
- -7531052386005780140,
- null,
- [
- null,
- true,
- [[{
- "1欯twG<uä®â½ê‡£_ჟﱴଶ-쪋\"?홺k:èŽêœª*⺵꽹댅釔좵}P?=9ë ¿46b\u001c\\S?(筈僦⇶爷谰1ྷa": true,
- "TҫJYxÚª\\鰔℮혡)m_WVi眪1[71><\/ï†Q:0怯押殃탷è«ì‚¬<ỗꕧ蚨ä¡ï¨î³‰nDꌕ\u001cë…¬~è“©<N蹑\"{ä«¥lKcí˜ë«–앺:vⵑ": "g槵?",
- "aꨩ뻃싥렌1`ë¡—}Yg>鲃gå„Š>ê¡l㻿/â‘·*ì±³6㻜W毤緛ﹺᨪ4\u0013뺚J髬e3쳸䘦伧?æª&{L掾p+꬜MäŠd娘6": {
- "2p첼양棜h䜢﮶aQ*c扦v︥뮓kC寵횂S銩&Ç{O*य़iH`Uí…à¡“rä©•5ꄸ?`\\᧫?ᮼ?t〟崾훈kè–ì/iy꤃뵰z1<\/AQ#ë¿©8jJ1z@u䕥": 1.82135747285215155E18,
- "ZdN &=dë…„á…†'ì‘â…‰:烋5&áŸï”‹á„‚汎æ¥L㯄固{é’§u\\ãŠíŠšeæ‘‘&tå—„ê–„UbâŒ?m䴘熚9EW": [{
- "ଛ{i*a(": -8.0314147546006822E17,
- "⫾ꃆY\u000e+W`௸ \"Më’¶+\\ë·lKE}(NT킶Yjé¸ç¯’î©¥ì¶'jNQ硾(똡\\\"逌â´y? IRꜘ὞鄬﨧:M\\fâ ‹Cꚜ쫊ᚴNV^Dä•—ã…–á¼”Iao꿬Câ8": [
- 287156137829026547,
- {
- "H丞N逕<rO䎗:í…•<\/䶩샌Sd%^ᵯëˆ엑者g䖩똭蕮1U驣?Pâ°°\u001fp(W]67\u0015ï«£6굺OR羸#ì´Fè’ˆ;嘙i✵@_æ’¶yã¤â¤(:᧗뼢༌朆@â°ã¤¨ê­²?-n>⯲": {"": {
- "7-;枮阕梒9ᑄZ": [[[[
- null,
- {
- "": [[[[
- -7.365909561486078E-19,
- 2948694324944243408,
- null,
- [
- true,
- "荒\"并孷䂡쵼9o䀘F\u0002龬7⮹Wz%厖/*? a*R枈㌦ë¾g뒠䤈q딄㺿$쮸tᶎ릑弣^éŽ<\/Y鷇驜L鿽<\/춋9Mᲆឨ^<\/庲3'lë‚¢",
- "c鮦\u001bë‘\\~?眾ಢu݆綑෪蘛轋◜gȃ<\/â´ƒcpkDt誩܅\"Y",
- [[
- null,
- null,
- [
- 3113744396744005402,
- true,
- "v(y",
- {
- "AQ幆h쾜O+꺷铀ꛉ練A蚗⼺螔jãŒ3꽂楎䥯뎸먩?": null,
- "蠗渗iz鱖w]擪E": 1.2927828494783804E-17,
- "튷|䀭n*曎b✿~æ¤U]î­¡Gz鄭kW|ã´š#㟗ഠ8u擨": [[
- true,
- null,
- null,
- {"⾪壯톽g7?㥜ώQê‘㦀æƒã§½î“¡ä¼“\\î¦*᧰閖樧뢇赸N휶䎈pIæ°‡ï®é•Šmaᬠ탷#X?î³A+kÐM ༑᩟Ø?5꧎鰜ṚY즫궔 =ঈî³;ﳈ?*s|켦蜌wM笙莔": [
- null,
- -3808207793125626469,
- [
- -469910450345251234,
- 7852761921290328872,
- -2.7979740127017492E18,
- 1.4458504352519893E-20,
- true,
- "㽙깹?ë¨ä†¢:ä´ŽÛ»gæ® JBTU⇞}ꄹꗣi#Iî’¡ëµ£é‰r혯~脀ìƒ#釯:场:ä”>ä°®o'ã¼½HZ擓௧nd",
- [
- 974441101787238751,
- null,
- -2.1647718292441327E-19,
- 1.03602824249831488E18,
- [
- null,
- 1.0311977941822604E-17,
- false,
- true,
- {
- "": -3.7019778830816707E18,
- "Eå³¾æ†èŒ6xLIm縂0n2视֯J-ᤜz+ᨣè·mYDè±ç¹¹â¹ºäŠ“몓ﴀE(@è©®(!ï’Y膽#᎙2䟓섣A䈀㟎,囪QbKæ’wcG湎ꤧtGì—xâ¥ä¿Žj'A一ᯥ뛙6ㅑ鬀": 8999803005418087004,
- "よ殳\\zD⧅%Y泥簳Uꈩ*wîRL{3#3FYHା[d岀䉯T稉駅䞘礄P:é—ˆWæ€ElBã¤å–¬èµ”bGä ¼U଄Nw鰯闀楈ePsDꥷ꭬⊊": [
- 6.77723657904486E-20,
- null,
- [
- "ཚ_뷎꾑è¹q'㾱ꂓ钚蘞慵렜떆`ⴹ⎼櫯]J?[t9Ⓢ !컶躔I᮸uz>3aã •i,錃L$æ°°í…°@7ë…«W㸮?羧W뇧ꃞ,î—‘N鋮숪2ɼì½â”ä²6",
- "&y?뢶=킕올Za惻HZk>c\u20b58i?ꦶcfBv잉ETî…9jä¡¡",
- "imçŠÕƒb칧<D-è«‚*u2ꡜ췛~䬢(텸ﵦ>æ ¡\\뼾쯀",
- 9.555715121193197E-20,
- true,
- {
- "<ã«šv6腓㨭e1ã•”&&V∌ᗈT奄5Lጥ>탤?튣瑦㳆ꉰ!(ᙪ㿬擇_n쌯IMá¿‹î£ã•¨â°æ«ˆá±·5풔蟹&L.ì²½e鰷쯃劼﫭b#ﭶ퓀7ë·„Wr㢈๧Tʴશ㶑澕é%": -1810142373373748101,
- "fg晌o?߲ꗄ;>C>?=鑰監侯Kt굅": true,
- "䫡蓺ꑷ]C蒹㦘\"1à°ƒ@å‘«\u0014NLä¾egå‘®á³,r$裢k>/\\<z": [[
- null,
- "Cä¡>?ㄤᇰﻛ쉕1஥'ÄŠ\" \\_?쨔\"ʾr: 9Sä˜ç¦ºáª§ê„‚㲄",
- [[{
- "*ç¡™^+E쌺I1䀖ju?:⦈Ꞓl๴竣迃xKC/饉:\fl\"XTFᄄ蟭,芢<\/骡軺ëœhê˜\u001f銿<棔햳▨(궆*=ä¹¥b8\\媦ä·€ë«}닶ꇭ(Kej䤑M": [{
- "1á¬?>옿Iâ•…C<ÞŽ?ꊌ冉SV5A㢊㶆z-๎玶绢2F뵨@㉌뀌o嶔f9-庒茪ç“ë·³4": null,
- ";lá°³": "CbB+è‚»aä„·è‹*/볳+/4fq=ã°h6瘉샴4é“¢Yéª.⌖@哼猎㦞+'gꋸ㒕ߤï—ãž‘(䶒跲tiâ‘´aî¥ç¡‚#Noë³”",
- "t?/jE幸YHT셵⩎Kî¹!Eq糦ꗣv刴w\"l$ο:=6:移": {
- "z]鑪醊嫗J-Xm銌ç¿çµ¨c里ëç‚™Ep㣋é£ë˜¼åšŒä€“GPï¹–cmf4é¹­T䅿꣭姧â¸wy6ꦶ;S&(}ᎧKxᾂQ|tï¹ë»³k\"d6\"|Mlì·†hwLtê¼¼4$&8Պ褵婶鯀9": {"嵃닢ᒯ'î–›d᧫䳳#Nî‡Xe3-붋鸿î¢à¬¢ë–“%dK\u0013䲎ê–YV.裸Râ‰rR3蟛\\:ì ¯:å—ĺLʆ넕>|텩鴷矔ꋅⒹ{t孶㓑4_": [
- true,
- null,
- [
- false,
- "l怨콈lá’",
- {
- "0wä²å¬§-:`䉅쉇漧\\Ü‚yㄨb%㽄j7ᦶ涶<": 3.7899452730383747E-19,
- "ꯛTẀq纤qå¶Vâ¿£?\"g}ი艹(쥯B î­T騠I=仵ë°X": {"KX6颠+&á…ƒ^fç•’y[": {
- "H?뱜^?꤂-⦲1aã‹ž&î‘®êƒç²¾Ii᤾챪咽쬘唂쫷<땡劈훫놡o㥂\\ Kâ´™D秼Fæ°®[{'좴:례晰Iq+Iì­¥_T綺砸GOç…䟪ᚪ`î‘↹l羉qì¼Dê½áœ…훦: vUV": true,
- "u^yï³0㱓#[y뜌앸ꊬLã·©?蕶蘾â»KӼ": -7931695755102841701,
- "䤬轉車>\u001c鴵惋\"$쯃྆⇻në½€Gæ° Såª]ಲê¨æ‡Qxኻ椕駔\\9ࣼ﫻ìœç£¡ï©ˆëºªá¶šë³l㕆t+sζ": [[[
- true,
- false,
- [
- null,
- 3363739578828074923,
- true,
- {
- "\"鸣詩 î›ë³°ã‘µgL㯦῅ì¶æ—«}ED辗ﮈI쀤-ꧤ|ã ¦Z\"娑ᕸ4çˆé¨ã£\"]ì³Af]茛⬻싦oèšk䢯ä©è½3廇喑ޅ": 4.5017999150704666E17,
- "TYႇ7ʠ值4챳唤~Zo&ݛ": false,
- "`å¡„J袛㭆ëºã³€N㺣`ê½å¶¥Kï¯SVᶔ∲퀠ç¾N딂X\"á¤hNﬨvI": {"\u20bbã­˜I䖵䰼?sw䂷쇪]î(泒f\"~;꼪FÔsá¦": {"p,'ꉂ軿=A蚶?bƉãµä…°è«¬'LYKL6B깯⋩겦뎙(ᜭ\u0006噣d꾆㗼Z;ä„äš”cd<情@äž‚3苼㸲U{)<6&ꩻ钛\u001au〷N숨囖愙j=BXWìš•^x芜å á¿™çˆ‚ë›·ê’»t✘Q\b": [[
- "ç±›&ଃ䩹.ꃩ㦔\\C颫#暪&!勹ꇶ놽攺J堬镙~軌C'꾖䣹㮅ï¶å²ƒá™´éµ£",
- 4.317829988264744E15,
- 6.013585322002147E-20,
- false,
- true,
- null,
- null,
- -3.084633632357326E-20,
- false,
- null,
- {
- "\"짫愔昻 Xï«\"è—£j\"\"ë¨à½…ѻ㘤㬯0晲DU꟒㸃dë²€î¢ìœ’l䦾cà©»*3": null,
- "è°ˆWm陧阦咟ฯ歖擓Nå–´ã‹éŠ­rCCnVࢥ^♼Ⅾ젲씗刊Sà¼+_tèµ”\\bäšë‰¨ê¬«6펛cL䊘᜼<\/澤pF懽&H": [
- null,
- {
- "W\"HDUuΌ퀟M'P4à¿°H똆ⰱﮯ<\/å‡è˜²\"C鴫ﭒж}ꭩ쥾t5yd诪ﮡí‰â´°@?æ°é†³rj4I6Qt": 6.9090159359219891E17,
- "絛ﳛ⺂": {"è«°Pã—®î˜è¦`ZQ?ꫦh*à´±cb⧱}埌茥h{棩렛툽o3é’›5é®l7Q榛6_g)ὄ\u0013kj뤬^爖eO4Ⱈ槞鉨ͺ订%qX0Tì—å«·$?\\\"봅늆'%": [
- -2.348150870600346E-19,
- [[
- true,
- -6619392047819511778,
- false,
- [[
- -1.2929189982356161E-20,
- 1.7417192219309838E-19,
- {"?åµ²2à¿2\u0001啑㷳c縯": [
- null,
- [
- false,
- true,
- 2578060295690793218,
- {
- "?\"殃呎ïˆ#ã‘‘F": true,
- "}Fç‚Š_æ®›oU헢兔êˆ,èµ­9703.Bæ•°gTz3â¬": {
- "5&t3,í–“Mݸᵣ㴵;꣫ä©â†³#ï¢@ë«·ä …ï¦+W-ࣇzᓃ鿕ಔ梭?T䮑ꥬ旴]u뫵막bBè®:왳둛lEh=숾鱠på’î›î­ˆ$ì§#?gâ¹·á—Švã·µ.æ–ˆu頻\u0018-G.": "ë½™m-ouࣤ஫牷\"`Ksê•žç­¼3HlȨvCï¢î›¦å ˆ\"I]㖡玎r먞#'W賜鴇k'c룼髋䆿飉㗆xgå·¤9;芔cáŒ/ax䊨♢í“rå“㸫೼䢗da᩾\"]å±£`",
- ":M딪<䢥喠\u0013ã–…x9è•ã‘‚XO]f*Q呰瞊å­VP@9,㨣 D\\ç©ŽvˤƩs㜂-曱唅L걬/롬j㈹EB8g<\/ì„©o渀\"u0y&룣": ">æ°ç·©L/ä•‘ë¯êŸ˜îŸ”è•ž^aBë’£+0jK⪄瑨痜LXK^힦1qK{æ·št츔X:Vm{2rçB뾄H첚7æ°¥?쉟䨗ꠂv팳圎è¸é½€\\",
- "D彤5㢷Gꪻ[lㄆ@὜⓰絳[ଃç½ì®¹â˜’[*0ꑚ㜳": 9022717159376231865,
- "Ò–aV銣tW+$é­¿\u20c3ïœäºœ~ë«¡ᙰ禿쨽ã¡fá¹¼zE/h": "5è‡ï’Œã‹‡á²¯ì®º? 昨탰Wム밎#'\"崲钅U?幫뺀â¾@4kh>騧\\0Ò¾EV=çˆî©®ÍŒUæ€%ꉼ 㮋<{j]{R>:gÔ©L\u001c瀈锌ﯲﳡꚒ'â«¿E4æšãŒ—뵉X\"Háœ",
- "ᱚגּ;s醒}çŠSἿ㦣&{T$jkB\\\tḮ앾䤹o<é¿(tW": "vb⯽䴪䮢@|)",
- "⥒í껉%惀뗌+녣迺顀qæ¢g⚯i⤭ë£Mç¹j̈́⽜A": -8385214638503106917,
- "逨ꊶZ<\/W⫟솪㎮ᘇb?ê ”i\"H㧺x෷韒Xꫨฟ|]窽\u001a熑}Agn?Mᶖa<rà°„4Ů䢤슲AxÄ£eê³–ã´¤x竾éƒB謉鸵kè–½M)\"芣眜`è‰ê‰›ä´º": "é¹^ె캫?3耲]|Ãœ1ä¡’ã®]8e?ä¶^",
- "뿸樅#Pã¡Š1M룮Uꪭ绢ꑮZ9꽸": {"\nJ^Ñ”|3袄ã…7⨆銦yîµ”çâ‹·ä»´ct?[,<\/ã…¬`?갔髞%æA೚C": {
- " 䇞3갫䅪": [{
- "0|â©ã‘‚砕ㅻ": null,
- "D箳᠉`|=â¼­)\"*࣊ã¦LjO誋": "",
- "ࠚDZmê—¥}ᷴ╈r7í—´È¥4Kp5a)o}鎘门Læ°ä†“'✎kä¿Žc#T68Ó⩶î¶6L鎴<r൦$黊BQYã¼³\\è·¿F慮⡨拵贀!甶Vå–…/": null,
- "âµ£q⳹ﻨLk]晩1*y\\$%}ä–¶P煑㇆䈦Eå«æ«•Y࣓嫨ä“OL낮梚㸇洛洚BYtgl∛S☕䉓宑⋢粚ꔯ꠼붠": ")ꬑ윤`\"â°£<\/婽*Y䔸ᓰ_ï³t슲å©éš¥&S糧䛮闵诌è±sh쯽邴*ì„´ØÍŽ=㯨\"RVíž³,^t\"ac?䤒ꉀxHa=Uꛕã™î·“TkF껾",
- "å¼¾cUAF?暤cë½.欀nKì•­]r傊䀓ﯳ馽垃[䥛oI0N砊鈥헅Co쟋钄ㅷ㊌뷚7": [
- null,
- "à«“é¨?^ä†{\u0006`X䧵儱&롡尙砡\u0006ë»ì‘¬sjâ–»Xfᬶgcã„¢V >9韲4$3á»´^=ì煤áë·2䣃%ï…Žé· /eQ9頸쥎",
- 2398360204813891033,
- false,
- 3.2658897259932633E-19,
- null,
- "?ꚃ8Nnãž·å¹µd䲳䱲뀙ꪛQ瑓鎴]䩋-é°¾æ¡ï¾ä³¡??掊",
- false,
- -1309779089385483661,
- "ᦲxu_/yecR.6èŠ.áœ‡éŽ ~",
- -5658779764160586501,
- "ì’Œ:æ› =lìœä¢œwk#sè•š\"互㮉m䉤~0ë“䋙#Gîš¿;h숄옥顇෤勹(C7㢅雚ã¯Lâ …VVç°…<",
- null,
- -4.664877097240962E18,
- -4.1931322262828017E18,
- {
- ",": {
- "v㮟麑䄠뤵g{Më®.\u001bzt뢜뵡0Ǥ龍떟Ᾰ怷ϓRT@Lꀌ樂Uã â¾•e扉|bJg(뵒㠶唺~ꂿ(땉x⻫싉ìŠ;%0鎻V(o\f,NéŠ%nk郼螺": -1.73631993428376141E18,
- "쟧摑繮Q@Rᕾ㭚㾣4隅待㓎3蒟": [
- 4971487283312058201,
- 8973067552274458613,
- {
- "`aæ™á£—î\u0015i<S幼訃锭B0&槩✨[Wpçš©[g≊k葾x2ᡆ橲䲢W": true,
- "kH皈Sê±qå‚‘u?솹풑~o^F=ï¦N*reî••J沤wW苯7pã¼¹äŽa=ꮧLã·©냴nWꌑ㞱uuè°lVNç¿á¤»(e豶5#L쪉ᅄ઄\u0015숟봊P瀚Xè“Ž": false,
- "䫯דּ〖Scä›­ì Lëµ¾pî«“CꙞ\"엇즓_ﰛ톣ꫀ먩㺣㮠⭴!\\Wâ”tä–°è»…y\u0014~ᇰ렢E7*俜䥪W䀩ä·hë´†vjஉ묣à¼G39.뼳輼:㮿á¦A饕TUL}~": [
- null,
- 8.8648298810470003E17,
- 5.735561205600924E-20,
- null,
- -102555823658171644,
- 1.2674932032973067E-19,
- {
- "D胣O㯨\u0017Ku눓ã’í…nᨊ!Ꚇ廫_>Bo¸": 4.3236479112537999E18,
- "HW&퉡ãåœ<W)6æ‚°ê ‘HEp14xy峑ft\u0005s亘V튉䢮ꦈXåµê¬?lI_ë춇-6Ss噺Nk-ﮥíƒÜ郪*ï“­PR(S6â•‹@ä»™V懸뺵ﯜVç²¹": "9䗌斀4ãˆ^Qséš„ç¡j\u0003",
- "Vk鶅Cæ³¹ç­HX훉朗*r\\z顊誌儖4?n7á¾6몋䎡ﳈ],Hé ¢pèšã‘„P4满Eä©V䬕à¸L廂쒬î®ì‘¨ê†·hè¿¡ê°è­–墎 î‡]鹿ฌ7ﶽ冭༽<ꈓS\\lä‹®?_ユ檒?": -8598528325153980065,
- "t=qí£ç–»Ñ‚Z\\錅J.é•Ž|nfḷ鴒1厰Lç¯çºœîŒ•E]୦⥪]á®'ç¾p/å’©0닳ï³qﳖཽk ?X1Ft%ś뭢v鋋⺃爵⒗": [[
- 5.0824756359232045E-19,
- [
- 7.268480839079619E-19,
- {"탿^굞⧕iјëŠê€›w껩6ꟳXsé…š\\>Y?ç‘¡Qyí›q!帰ï©s舠㫸zêš—aSæ­²v`G株巷Jp6킼 (ê·¶é”â¾î‹¥â¡ˆ>Mæ±ãžá‰´ê™²dv@i㳓ᇆ?é»": [
- null,
- 4997607199327183467,
- "E㻎蠫á¾é«˜ä™Ÿè˜¬æ´¼æ—¾ï« í…›ã‡›?'M$㣒蔸=A_亀绉앭rN帮",
- null,
- [{
- "Eᑞ)8<Zî¿—ã¡¿W镀䛒Cìƒî¿«V?0ꯦ+tL)`é½³AjB姀Xà³³D빠㻲ƙgn9â‘°à¾á¿œ&\"ãš¹>餧A5u&ã—¾q?": [
- -1.969987519306507E-19,
- null,
- [
- 3.42437673373841E-20,
- true,
- "eê±·Må¢\"割Pâ›í§åŽ€R䱜3ï»´Oí“«r﹉⹊",
- [
- -8164221302779285367,
- [
- true,
- null,
- "爘y^-î¬?蘞Ⲽꪓaâ…ê¨}I",
- 1.4645984996724427E-19,
- [{
- "tY좗⧑mrzïºã¿¥â´–᥷jè«…\u0000q賋è­êž„â®±S\nà¡£B/íƒêµª3ZÉ‘å¤o<\/;ë¡‹": null,
- "彟hæµ _|V4䦭Dᙣ♞uì¿»=ì‚®ã¦\u001e哀鬌": [{"6횣楠,qʎꗇ鎆빙]ã±­R굋鈌%æ ²j分僅ペ䇰wí¦î¼‹p蛃N溈ê¡ê€?@(GI뉬$ﮄ9èªê“š2e甸ڋ[äº,\u0011\u001cࢃ=\\+衪䷨ᯕ鬸K": [[
- "ㅩ拏鈩勥\u000etgWVî–¨Xs陂è¦p狵w퓼{뮵_i\u0002ퟑႢâ¬d6é‹«F~챿æŸ\u0096äš¼1ۼ칥0꣯å„=鋷牋ⅈêžé¾",
- -7283717290969427831,
- true,
- [
- 4911644391234541055,
- {
- "Iî¹éˆ’ì²½P릜朸W徨觘-HᎄíŸâ“º>8kr1{ê²µäƒã€›á¬¡Ì¨Oê·‘oä•'쿡鉕p5": "fvç²–RNçž–è›a?q꤄\u001d⸥}'ꣴ犿ꦼ?뤋?鵆쥴ë‹ä¡«s矷̄?ඣ/;괱絢oWfV<\/\u202cC,ã–¦0䑾%nè³¹g&T;|lj_欂N4w",
- "짨䠗;䌕u i+rà¹0": [{"9ä¥\\à°©8\"馇z䇔<\/á‚¡Y3eç‹šì¡\"ุ6ï°†Zé–c\"Ll:ïŠê®¾ç–£<\/᭙O◌납୕湞9⡳Undã«œ\u0018^4pj1;ä§å„‚ä—·à­—>@e톬": {
- "aâ‘‚Fé‹»Qèž°'<퇽Qè´ç€§{ᘪ,cP&~䮃Z?gI彃": [
- -1.69158726118025933E18,
- [
- "궂z簽㔛㮨瘥⤜䛖Gℤ逆Y⪾j08î±²Sn昞ꘔ캻禀鴚P謦b{ê“®mNéMᥙ5\"ç2냑I\u0011.L&=?6á„ ë»·X鸌t刑\"#z)oê«šn쳟줋",
- null,
- 7517598198523963704,
- "ኑQp襟`uᩄr方]*F48ꔵn俺ሙ9뇒",
- null,
- null,
- 6645782462773449868,
- 1219168146640438184,
- null,
- {
- ")ယ넌竀Sdä°¾zqâ«£âŒÊ¥\u0010á¿“' |磪&p牢蔑mï³V蘸૰짬꺵;K": [
- -7.539062290108008E-20,
- [
- true,
- false,
- null,
- true,
- 6574577753576444630,
- [[
- 1.2760162530699766E-19,
- [
- null,
- [
- "顊\\憎zXB,",
- [{
- "㇆{CVC9ï¼MN㜋ઘR눽#{h@ퟨ!鼚׼XOvXS\u0017á£=cS+梽៲綆16së½íœy屬?ᇳG2á´­\u00054쫖y룇nKcW̭炦s/鰘ᬽ?J|퓀髣nå‹Œ\u0010í™ P>j": false,
- "ç®´": [
- false,
- "éžj\"ꮾ*엇칬瘫xṬ⭽ì©äƒ³\"-⋵?ᦽ<cਔ↎⩧%鱩涎삧u9K⦈\"á¿á¬‘V绩킯愌ṱv@Gê¾è·¶êš†(?ä–ƒvI᧊xV\r哦jã ’?*=S굤紴ꊀ鹭쬈s<DrIu솹꧑?",
- {
- ".}S㸼L?t\u000fK⑤s~hU鱜꘦}ìªC滈4ꓗ蛌):ྦ\"é¡¥ì´â¢·ïš­á¿³YLn\"?fꘌ>댎Ĝ": true,
- "Pg帯佃籛n㔠⭹࠳ë·â‰»à¿Ÿ3ãž±ï“!î—-ì’¾!}쭪䃕!籿n涻J5ਲ਼yî˜vy;Rኂ%ᔡጀ裃;M⣼)쵂쑈": 1.80447711803435366E18,
- "ꈑC⡂ᑆ㤉壂뎃Xub<\/쀆༈憓قì¨×§\\": [
- 7706977185172797197,
- {"": {"K╥踮砆NWࡆFy韣7ä밥{|紒︧䃀榫rᩛꦡTSy잺iH8}ퟴ,M?Ʂ勺ᴹ@T@~꾂=I㙕뾰_涀쑜嫴曣8IY?ҿo줫fऒ}\\S\"ᦨ뵼#nDX": {
- "♘k6?଱癫d68?㽚乳䬳-Vé¡·\u0005è•?\u0018䞊V{邾zã˜l]é›k臤~ൖHë’iꢥ]g?.G碄懺䔛p<q꜉Så²—î¥_.%": 7688630934772863849,
- "溗摽嗙O㧀,⡢⼰呠ꅧ㓲/葇䢛icc@-r\b渂ꌳ뻨饑è§á–œ\\é®­\u0014엙㥀᧺@æµ¹W2꛵{W률G溮킀轡䬆g㨑'Qè¨ï†áŸªç½‘Hd\"Q늴ᱢﶨ邮昕纚枑?â–°hr羌驀[ç—¹<\/": [
- -1.0189902027934687E-19,
- {"窶椸릎뚻shE\"ꪗႥꎳU矖佟{SJ": [{"-æ…œx櫹XYîƒ-æ¾Ü¨â£·àª¢ïŸé¯™%Fu\u0000è¿‹â–’}᥷L嗭臖oញc넨\u0016/è¿Ž1b꯸g뢱ã§è“¤ä’8C散삭|\"컪輩鹩\"\\g$zG䥽긷?狸꿭扵ã²:URON&oU8": [
- null,
- true,
- null,
- -2.8907335031148883E17,
- -3864019407187144121,
- {
- "`빬d⵺4H뜳⧈쓑ohஸ*ã¶ï»‡â¸•ä µ!iä¬ï¹‘h夘▥ê—푹갇㵳TA鳠嚵\\B<X}3訒câ‹{*ï«¢w]ç’¨-gæ­\\j໵侠Ei层\u0011": 3.758356090089446E-19,
- "䄘ï®)Y놞씃㾱陰í:{\u2059/Sâ“´": [[
- null,
- [[
- -3.8256602120220546E-20,
- null,
- 7202317607724472882,
- "CWQëš¿",
- null,
- false,
- true,
- null,
- 2857038485417498625,
- 6.191302233218633E-20,
- null,
- -6795250594296208046,
- [
- true,
- {
- "%ዧé°Yᚯ⚀x莰愒Vᔈ턗BNæ´ê¤ŸA1âŒl콹풪H;OX๫륞ìªá°šÑ†@͎黾a邬<L厒Xb龃7f웨窂二;": [[
- null,
- "耲?䙧㘓F6Xsí‹­ë©¢.v뚌?é„Ÿæ â–½'묺競?WvᆾCî»txo?dZ;䨸疎",
- {
- "@hWê‰&\"빜4礚UO~C;ã†î”殩_ꀥè˜å¥¢^챟k→ᡱKMⵉ<\/Jㅲ붉LÍŸQ": false,
- "tU뢂8é¾°I먽7,.Yî°î»´æ½Z툼=&⨥覽K乫햶㠸%#@Zë–æ„“^âŠâ¾‚몒3E_噆J(廊ឭyd䞜鈬Ћ档'⣘I": {
- "tK*ꔵ銂u艗ԃì¿âˆ³ê„‚霫X3♢9y?=â²­dЊb&xy}": [
- -4.097346784534325E-20,
- null,
- 6016848468610144624,
- -8194387253692332861,
- null,
- {
- "(祬诀譕쯠娣cë´r?ç•„kT뼾⌘⎨?noVä˜ì¥ç¡Žn?": [
- 1.82679422844617293E18,
- [
- false,
- 2.6849944122427694E18,
- true,
- [
- false,
- {
- ";0zâ­†;í™”$bਔ瀓\"衱^ï—´?잢ᢛ⣿~`ꕉ薸⌳໿湘腌'&:ryБꋥá¼ê’¥ç­™ê¬œê¸¨?X": -3536753685245791530,
- "c;Y7釚Uꃣ割J༨Y戣w}c峰뢨㽑㫈0N>R$ä…’X觨lë´œA刊8R梒',}u邩퉕?;91Eî¦a䈈ë¯G⊶芔h袪&廣㺄j;ã¡ç¶½\u001bN頸쳘橆": -2272208444812560733,
- "æ‹‘Wﵚî²j鵼駳Oࣿ)#ã¾…é¡‚N傓çºy僱栜'Bê-!KF*ꭇK¦?䈴^:啤wG逭w᧯": "xᣱmYe1Û@霄F$ě꧘푫O䤕í€Pq52憬ꀜ兴㑗ᡚ?ï—ƒLé·íŸî—¼ë­zJê‘™}╆ᅨJB]\"袌㺲u8䯆f",
- "꿽á…㔂긱Ǧ?SI": -1669030251960539193,
- "ì‡É¨`!è‘Ž>瞺瘡驷錶â¤ï»®é…œ=": -6961311505642101651,
- "?f7♄꫄Jᡔ훮eì‡îª¼í¾á£ä­´KhखT;Qty}O\\|ë«Iá¿’Ne(5æƒê¥¶ã†·Y9ﮡ\\ oyâ­–-䆩å©m#xë´‰>Y鈕Eç–£s驇↙ᙰm<": {"퉻:dê‚&efï¿Žì«¢[ï„™\"ëˆëŠ–꺙|Ôå‰1Í–-K:Êšá­•/;ì–㷛]Iç—èŒ4g<Oꗢ뫺N쯂륬J╆.`ᇵP轆&fd$?è‹…o궓vO侃沲â©åš…æ²— E%â¿°ì–¦wi\\*趫": [
- 3504362220185634767,
- false,
- "qzXæœqT3軞T垈ꮲQ览ᚻ⻑쎎b驌䵆ꬠ5Fà­—ä²ç¼¿ê蒇潇Ltᆄ钯蜀W欥ሺ",
- "ë³°É霬)ì é¶¼kwocì—·èr \u001d쒷⎹8{%澡K늒?iﺩd=&皼倚J9s@3å›twὡgjä íª5⭉⨺役&놎cﺉ㺡N5",
- false,
- null,
- "D0st[ni锹r*0k6ꀎë‡UX2⽼৞䃚粭#)Zæ¡·36P]<\/`",
- 4281410120849816730,
- null,
- -3256922126984394461,
- 1.16174580369801549E18,
- {
- " ᆼꤗ~î…‰*TN긂<㡴턱℃酰^蘒涯잰淭傛2rൡetì¾£ä‡m*ã¸y\"\\糮᧺qv쌜镜T@yg1譬ﭧﳭ\f": null,
- "圾ᨿ0xᮛ禵ਗ਼D-㟻ẵ錚e\"赜.˶m)é´‘B(I$<\/轴퉯æ·â‹âº*)宓쓌?*橯Lx\\f쩂㞼⇸\"ﺧ軂é³V\\ë•’\"캘c:G": null,
- "?ïµ_ê³¢î™ç¿¸íˆ8ã¿ hì—´Q2ã­›}RY㯕YT놂⽻e^B<\/맫ﻇ繱\u0017Gц⟊ᢑﵩS:jt櫣嗒⟰Wã´šæ¦á…‰e[w䋺?藂翙Ⲱ芮ä˜â•¢å›¥lpdu7r볺I è¿‘qFyᗊ": [
- "$b脬aᅠ襬育Bگ嵺Pw+'M<\/ï­näššvèžbNâ’‚}褺%lቦ阤\"ꓺá—Mç‰,Ûžï– Ò¶!矬?ke9銊Xê´¦)䈽í‹è„½á¹«äˆžá´†^=Yá—¿é›4I귺⋥%",
- false,
- 2.9444482723232051E18,
- 2072621064799640026,
- "/_뇴뫢jã’=Nꡦâ†Ôºèµ’â¬î»¼í†¥ä¨žç¯su*媸瀳鷔抡oíº-៳è¾å‹·fç»”:äµ¢æ¢2",
- false,
- "ì’œ Eî½·äŒ/í\u0018懺_<\\隺&{wF⤊谼(<죽é ïŸ‡8?@*rᶊGd뻻갇&Ⳇq᣿e࢔t_ꩄ梸O詬C᧧Kê© í’¤9눙醅ëž}竸rw?滨ӽK⥿ཊGé­²']`๖5ã„°",
- -2375253967958699084,
- {"嗱⿲\"få„„á¬": {"v?äš‘í‚¡`â—¤k3,骥曘뒤Oᒱ㲹^圮᠀YTê»›&ì´®P:G/Tâ£#튣k3ç‚©è k@橈ä·S䧕,熜ïŒæ™¬ï£žk1鮥玸먚7䤡fç»å—šìƒ´á¥’~îš¼0q拮垑aë»±Lâ°–_": [{
- ":på°¢": -6.688985172863383E17,
- "A0\u0001疠ﻵ爻鼀湶I~W^å²€mZx#ãˆ7r拣$Ꜷ疕≛⦒痋盩Vꬷá­â„¦Qêªï§éˆ‘A(劽詗ꭅo-ç¶é‘º\"Ⓠ@$j탥;": [
- 8565614620787930994,
- [
- "嶗PC?උQ㪣$&j幾㾷hæ…‘ 즊慧⪉霄M窊ê·'鮕)äŠé“¨m趦䗲(g罣ЮKVﯦé®î¦®5囗ﰼ鿦",
- -7168038789747526632,
- null,
- -7.8069738975270288E16,
- 2.25819579241348352E17,
- -6.5597416611655936E18,
- {
- "瘕멦핓+?フZê·¢zé›V": {
- "ᕾ": 1.7363275204701887E-19,
- "ã­Œs뎹㳉": {"\u00187Fï–‰I6Yféº+UC쬸éºâ²ä‚¿ê¸•R\\ᆮC?Φ耭\rOத际핅홦*ë² W㸫㯼᡹cㅜ|Gã®—\u0013[o`?jHVì•?蒪꩚!í«áœ¦ãŒ‡äš‡é¿˜:@": [
- "}푛Г콲<äŸCè—呈#2ã“‹#ྕáŸå°¿9qç«“gI%ëž™mê¬oaç•è´¿Jå’¿D_ç†Zz皳験Iè±¼B扳ḢQ≖㻹㱣Dä¦ï©—2'á—㗣▌ç ²8罿%à°¹F姦;0î·æ‚‡<\/\"p嚧",
- -710184373154164247,
- "Vo쫬⬾ê«â´·Å»\u0004éŽHBê…¸_aVBHbN>Z4âœkเꛘZ⥺\\Bʫᇩ鄨魢弞&幟ᓮ2̊盜",
- -9006004849098116748,
- -3118404930403695681,
- {
- "_彃Y艘-\"Xx㤩㳷瑃?%2ä¡éµ›o<A?\"顜ᘌΈ;â·…Cæ´ºL蚴蚀voq:,Oo4쪂)": 5719065258177391842,
- "l륪맽耞塻論å€Eã—‘/㲕QM辬I\"qi酨玑㖪5q]尾魨鲡ƞY}⮯蠇%è¡Ÿï„Fsf윔äšì°¤iè…³": {"ꢪ'a䣊糈": {"ë°‘/♋S8sã¼´5瓹O{댞\"9Xï°‡lJ近8}q{긧ⓈI᱑꿋腸D瀬H\"ﺬ'3?}\u0014#?丙㑯ᥨ圦',gé‘ (樴턇?": [
- 2.5879275511391145E18,
- null,
- [
- "3㼮ꔌ1Gẃ2Wé¾™jîªÍŠ{1å›ã¦­9xå® ã‘oRä•çŠ½",
- 1268729930083267852,
- "땕軚⿦7C",
- [
- -3.757935946502082E18,
- "\"赌'糬_2ë­¾áb",
- {
- "(a䕎ጽjÒ°D4.á´¡ïž½66ԃ畮<\/l`k癸\\㇋ࣆ욯R㫜픉녬挛;ڴ맺`.;ç„“q淞뮕ٹ趴r蔞ꯔ䟩vç²u5<\/pZ埖Skrvj帛=\u0005aaï”›": null,
- "璄≩ v몛ᘮ%?:1頌챀H㷪뉮k滘e": [
- "ꤾ{`c샬왌펡[俊络vmz㪀悫⸹ᷥ5o'ã¾µ L蹦qjYIYណԠWëƒå‰«<\/W嗂0,}",
- 2.4817616702666762E18,
- false,
- null,
- null,
- -8.6036958071260979E17,
- null,
- -1.2744078022652468E-19,
- -4.4752020268429594E17,
- 1.13672865156637872E17,
- [
- false,
- false,
- null,
- -4.178004168554046E-20,
- true,
- 2927542512798605527,
- {
- ".ꔓ뉤1䵬cHy汼䊆賓á‡Æ©|樷â‡é†Žã¬…4\u0003èµµ}#yD5è†æ™¹ë±“9ê–è™›J㺕 t䊛膎ؤ": {
- "rVtᓸ5^`েNâ¹»Yv᥋lꌫt拘?<é®°ë„¿ZC?ã’½^": {"âªî©k_:>귵옔夘v*탋èŒ&㳈챗|Oé’§": [
- false,
- "daꧺdᗹ羞쯧Hã¤é„³é ³<型孒ン냆㹀f4ã¹°\u000f|C*ሟ鰠(O<ꨭ峹ipຠ*y೧4VQè””hVæ·¬{?ᵌEfrI_",
- "j;ꗣ밷é‚副]á—“",
- -4299029053086432759,
- -5610837526958786727,
- [
- null,
- [
- -1.3958390678662759E-19,
- {
- "lh좈T_ë¯Y\"伨\u001cꔌG爔겕ꫳ晚è¸â¿»ìT䯎]~e#฽燇\"5hٔ嶰`泯r;ᗜ쮪Q):/tç­‘,榄&5ï¤ëŽ«ç‹(": [{
- "2áâ“›]r3C攟וּ9è³µsâ›”6'ஂ|\"ⵈ鶆ä¹ç¦3\"痰ࢤéœäµ©ì˜†äŒ€?æ •r7Oç°‚Isd?Ká«œ`^讶}zî°’8?zì–°î§T:X倫⨎ꑹ": -6731128077618251511,
- "|︦僰~m漿햭\\Y1'Vvخ굇á‰ì±¢c趖": [null]
- }],
- "虌魿閆5⛔煊뎰㞤ᗴꥰF䮥蘦䂪樳-Ká·-(^\u20dd_": 2.11318679791770592E17
- }
- ]
- ]
- ]},
- "묗E䀳㧯᳀逞GMc\b墹㓄ë–Æ &U??íŽŒé‘ åª‹k))á„Š": null,
- "묥7콽벼諌J_DɯﮪMæ®´ä£,煚ྼ`Yï“ž:씧<\/â©«%yf䦀!1Ჶk춎Qç±³W∠WC跉鬽*á›±i<?,l<崣炂骵*?8í‘៣ⰵ憉⎑.,Nwç½£q+ο컆弎": false
- },
- "e[|଀+î±³lꑸãˆTT?ë¿¿|ê«›9`㱯䊸楋-곳賨?ì³k棽擋wQ餈âŸNq[q霩䵀뷮锅ꚢ": 5753148631596678144,
- "sá“鴻߸d렶ὕ蜗ဟ툑!诉౿": false,
- "|4䕳鵻?䈔(]í‹/Ui#æ¹»{듲ーMá‹€t7潔泄Ch⸨}ì£`î¤èž§éŠšã‹¼å£¯kâ°¥Q戵峉갑xè¾™'ì²›": "jd䘯$䕌茷!auw眶ㅥä£ê†¢æ°‘i",
- "剖駰Ɜî¶sM2]á¾´2ࡷ祅拌Av狔꩛'ꓗ킧ê£0酜✘O'": false,
- "澩뢣ê€eU~D\\ꮡ킠": "v^YC嚈ί\u0007죋h>ã´•L꘻ê€ì“ª\"_gé¿„'#tâ½™?,Wg㥖|D鑆eâ¥ìª¸åƒ¬h鯔咼ඡ;4TKèŽî¾‘ì¡ å«ž"
- }
- ]
- ]
- }
- ]
- ]
- ]}}
- }
- ]}
- },
- "뿋뀾淣截䔲踀&XJ펖꙯^Xb訅ꫥgá¬>棟S\"혧騾밫ê²7-": "擹8C憎W\"ìµ®yR뢩浗絆䠣簿9äˆå¼•Wcy䤶孖ꯥïž;íŒ]輩ä3@{å 뽸0ï€á¡ˆìµ¡î›„Ⲇ\u001dLåŒê§2F~ݕ㪂@W^é½L襒ᦘî¢~沦zZ棸!꒲栬R"
- }
- ]
- ],
- "Z:ëƒàµ›5Iz찇䅄駠㭧蓡K1": "e8᧤좱U%?ⵇ䯿é¿\u0013縮R∱骒EO\u000fg?幤îš@֗퉙vU`",
- "äƒìªˆï‘’埽້=Ij,쭗쓇చ": false
- }]}}
- ]
- }
- ]}
- }
- ]
- ]
- ],
- "咰긖VM]á¼6䓑쇎çºetDÒŒ?ãžê©„퇫밉gj8è ƒ\"â©5䛹1ࣚ㵪": "ക蹊?⎲⧘⾚̀I#\"䈈⦞ë·`wo窭戕෱휾䃼)앷嵃꾞稧,Ⴆ윧9S?೗EMk3Მ3+e{â¹”Te驨7äµ’?타Ulg悳o43ï“¢"
- }
- ],
- "zQᤚ纂땺6#ٽ﹧vï¿¿#ࠫ휊冟蹧텈ꃊʆ?&a䥯Deæ½|ì¿“pt瓞㭻啹^盚2êŠf醪,ì–T窧\\Diä•Žè°„nn父ꋊE": -2914269627845628872,
- "䉩è·|㨻ᷢã‰B{蓧瞸`î°²I!℄욃힕#ೲᙾ竛ᔺCjk췒늕貭è¯\u0017ï©š?W딚%(pê⤼ë³^=on뺲l䆼bzrﳨ[&j狸䠠=ᜑꦦ\u2061Õµnj=牲攑)Mî»\\é¾": false,
- "뎕y絬᫡⥮Ϙᯑ㌔/NF*Ë“.ïž¿,QEzvK!Iwz?|쥾\"ê©»Lê¼—Bꔧ賴緜s뉣隤茛>ロ?(?^îµ­`>冺飒=噸泥⺭Ᲊ婓鎔븜z^å·è£®Ãªâ“…à»—jM7ﶕ找\\O": 1.376745434746303E-19
- },
- "ä›ræ»–wã¤<k;l8ꡔጵ⮂ny辶⋃í¼åƒ®z\"﮲X@t5෼暧퓞猋♅䦖QCé¹®|픨( ,>,|Ná‹œ": false
- }
- ]],
- "@ê¿™?è–•å°¬ gd晆(ë„5躕ﻫS蔺4)떒錸ç“?~": 1665108992286702624,
- "wë¯ná =`঺ᅥC>'從ë槷ä¤çœ·èž„㎻æ°æ‰°Xï¿ŠCè´½uáƒë‚ŸjKD03T!lDV쀉Ӊy뢖,袛!终캨G?鉮Q)â‘—1쾅庅O4ê‰H7?d\u0010蠈줘월Þ粯Q!낇껉6í…|{": null,
- "~˷jg쿤촖쉯y": -5.5527605669177098E18,
- "펅Wᶺzê†ã¨í‘­e?4j仪열[D<鈑皶婆䵽ehS?袪;Hê¨Më—Žã°[(å—M3qíŸg4y╸鰧茀[Bi盤~ï«å”Žé‹†å½ºî½«â¦Šq?î–³B4쉓癚O洙킋툈䶯_?ퟲ": null
- }
- ]
- ]]
- ]],
- "꟱Ԕã¤7æ›ï¦—ಃéŒVä·°?v㪃૦~K\"$%请|ꇹn\"kä«›ã¨é²¨\u2023ä„¢\u0004[<S8á¬ë­©è„¥7U.m࿹:Dè‘┆2蘸^U'w1ì …;䠆ꋪBê»®>︊Vï‹•J?䶟ាꮈ䗱=깘U빩": -4863152493797013264
- }
- ]}]}
- ]
- }}}
- ],
- "ì·ì²Û¹í‰ƒ~aEå”™a챑,9㮹gLHd'ä”|í‚—ãžäŽ¥&KZYT맵7䥺N<Hp4ê•­â¹ ê½c~çš½z": "课|á–¾ä¡å»‹è„äªW\u0016&Jnê´b~æ‘“M>â±³åŒèŽžé¿§w\\༌疣n/+ꎥU\"å°ëž¾â—‹íŸ™AJá­Œ?9ä›$?é©”9è®ì§˜é­¡TÖ¯cè—³`虉Cì‡ì¦T"
- }
- ],
- "谶개gTRï¿>áµÍšdt晑䉇é™æ»º}9㉸P漄": -3350307268584339381
- }]
- ]
- ]
- ]]
- ]
- ],
- "0y꟭馋X뱔瑇:䌚ï¿å»¿jîžg-懲鸭䷭垤㒬茭u賚찶ಽ+\\mT땱\u20821殑ã„J쩩䭛ꬿNSæ½”*d\\X,壠뒦e殟%LxG9:摸": 3737064585881894882,
- "í’µO^-⧧ⅶvѪ8廸鉵㈉רâ†Q㿴뺟EႳvNM:磇>wî·/៻唎뷭୥!냹D䯙iëµ±è²C#⼉NH6`柴ʗ#\\!2䂗Ⱨf?諳.Pëˆ-è¿”I꘶6?8î“ê˜": -8934657287877777844,
- "溎-è˜å¯ƒi诖ര\"æ±µ\"\ftl,?d⼡쾪⺋h匱[,à·©I8MÒ§F{kç“¿PAî…§'橸ꩯ綷퉲翓": null
- }
- ]
- ],
- "ោ係Øî½<å…ƒ": 1.7926963090826924E-18
- }}]
- }
- ]
- ]]}]
- }]
- ]
- ]
- ]
- ],
- "ጩV<\"ڸsOᤘ": 2.0527167903723048E-19
- }]
- ]}
- ]
- ]],
- "∳㙰3ì ´p᧗䱙?`<U὇<\/æ„E[ᮚAî›j诂ᒽ阚uv徢ဎ떗尔ê½í›€ì©‘Jä´?âª=륪ᆩ푰ஓã•?럽VK\"X?檨လ齿I/耉A(AWA~â¯ç¨è¹«": false,
- "å’å¦ë¾‡}䀼链i⇃%â‹œ&ç’ªIx渥5涧qq棩á¥-â «AA낇yY颕A*ïˆè£¦O|n?䭬혗F": null,
- "ç­CLì–­B혆Kॎ`鎃nrî€sZiÕªWç )?p~K~A眱ä²QO妣\u001b\u001b]ᵆᆯ&ã‹á¹è±‰ëº˜$ê­§#j=C)祤⫢歑1o㒙諩": 7028426989382601021,
- "쳱冲&ဤäŒì•§h胺-é½±H忱8왪RDKᅒ䬋ᔶS*J}ስ漵'㼹뮠9ê±¢9p봋경ጕtởꚳT䶽瘙%춴`@nಆ4<d??#僜ᙤ钴=薔ꭂbLXNam蹈": "樭る蹿= Uî ƒurwkn뙧⌲%\"쑃牪\"cq윕o@",
- "溌[H]ç„ŽSLã…?뀼䫨ç½W": 1.1714289118497062E-19,
- "ﬢp븇剌燇kĔ尘㶿㴞ç ê¾˜Ia;sâº^)$ç©®?sHᢥíªl": null
- }
- ]
- }
- ]
- },
- "TKnzj5o<\/K㊗ꗣ藠⦪駇î€>yZA8Ez0,^á™›4_0븢\u001ft:~䎼s.bb룦明yNP8弆Cå¯;⪾ì§'蕴뮛": -6976654157771105701,
- "íµê¦€\\㇑:nî‹™v+뒤燻䀪ﴣï·9ᚈ኷K㚊誦撪䚛,ꮪxሲ쳊\u0005HSf?asg昱dqꬌVꙇ㼺'k*'㈈": -5.937042203633044E-20
- }
- ]
- }],
- "?}\u20e0],s嶳è‹@#2uì’´sQSä©—=ꥮ;烌,|ꘔ䘆": "á…©ì˜Nç’ kZ먕眻?2ቲ芋眑D륟渂⸑ﴃIRE]å•—`K'"
- }},
- "쨀jmV賂ﰊå§ä‚¦çŽžã¬™áªM᪟ïՎ씜~`uOn*ॠ8\u000ef6??\\@/?9見d筜ﳋB|Sä¬è‘«ã½o": true
- },
- "즛ꄤ酳艚â‚㺘봿㎨iG৕ࡿ?1\"䘓您\u001fSáŠâº¿æºzៀ뻤B\u0019?ìœa䳵᭱䉺膷d:<\/": 3935553551038864272
- }
- ]
- ]}
- ]]
- ]]
- ]}
- }
- ]
- }
- ]]}},
- "᥺3h↛!ê‹°y\"攜(ெl䪕oUkc1A㘞ᡲî촾ᣫ<\/ä’ŒEã›æ½¨i{ï  v?Wà±¾H\\RჅpzè¬R脾;v:碽✘↯삞鷱o㸧瑠jcmK7㶧뾥찲n": true,
- "ⶸ?x䊺â¬-ä°…â‰!e쩆2ꎿ准G踌XXᩯ1ß}0?.í—€Z馟;稄\baDꟹ{-寪⚈ꉷ鮸_L7ƽᾚ<\u001bጨA䧆송뇵⨔\\ç¤ë—”d设룱㶉cq{Hyã±R㥽å¢ï¬…p": -7985372423148569301,
- "ç·«#ì½®IB6<\/=5Eh礹\t8럭@饹韠r㰛斣$ç”LVì·a갵îŸ'请o0g:^": "䔨(.",
- "ë³â„¡åœ¤pï¾à¯„Ä倧訜BìŸGä™”\"Sbâ“®;$$â–S1J뢙SF|赡gï„€*\"Vu䲌y": "䪈&í‹),\\kT鬜1í’¥;ë·´'Zေ䩹@Jéž½Nã¼M?å¥eWb6榀ƩZڮ淽⺞삳煳xჿ絯8eâ¶ç¾·V}ჿ쎱䄫R뱃9Z>'\u20f1â“•äœé½®"
- }
- ]
- ]]]
- }}
- }
- ]
- ]},
- "펮b.hç²”í¯2npXè©«g錰鷇㇒<ì™S値bBi@?镬矉`剔}c2壧ଭfhY깨R()痩⺃a\\â”?M&ﯟ<劜꺄ï‘ë©Šá„ŸA\"_=": null
- },
- "~æ½¹Rqn榢㆓aR鬨侅?䜑亡V_ç¿…ã­”(ä“·w劸á³Dp䀅<\/ﰎ鶊m䵱팱긽ꆘ<tD쇋>긓准D3掱;o:_Ñœ)껚콥8곤d矦8nP倥ꃸI": null,
- "뾎/Q㣩㫸벯➡㠦◕挮a鶧⋓å¼\u00001뱓fm覞n?㛅\"": 2.8515592202045408E17
- }],
- ",": -5426918750465854828,
- "2æ««@0柡g䢻/gꆑ6演&D稒肩Y?艘/놘p{f투`飷ᒉ챻ëŽîª–<늛ä˜ï´¡ì¤°ì«„": false,
- "8î™–(鸑嵀⵹ퟡ<9㣎Tߗ┘d슒ل蘯&㠦뮮eà kç g ì—»": false,
- "d-\u208b?0ﳮ嵙'(J`蔿d^踅⤔榥\\J⵲v7": 6.8002426206715341E17,
- "ཎ耰í“ê•ï’ã±·\u0013y=詽I\"盈xm{0쾽倻䉚ષso#é°‘/8㸴짯%ꀄ떸b츟*\\鲷礬ZQå…©?np㋄椂榨kc᡹醅3": false,
- "ì‹Šj20": false
- }]]
- ]],
- "ä¿›\u0017nç·½Tu뫉èœé¼Ÿçƒ¬.ï‘ꭠIâ°“\"Ἀ᜾uC쎆J@å¤%ê›m뻨ᾀ画è›íœƒT:錖㑸ዚ9죡$": true
- }
- ]
- ],
- "ãµâ‡˜ê¦–辈s}㱮慀밒s`\"㞟j:`ií”»Z<C1衽$\"-饧?℃\u0010⼒{î°p飗%R\"ä²”\")ì¹€\\%": true,
- "苧.8\u00120ݬ仓": 6912164821255417986,
- "ë–Žé¡£ä¿X;.#Qí‹.笂'p쟨唒í랩냆¦aâ±{è°.b我$蜑SH\u000fç¾=䟼⣼奔áœæ”•îŸ®B&挰繗ã”ê…‚-Qv\\0ä¶äš¥ãºio[㑮-ᇼ䬰컪ṼiY){ë°\u0010q螰掻~\n輚x\u0014罺)è»´": 3.024364150712629E-20
- }
- ]
- ]
- ]
- ]}
- ]]
- }
- ]
- ]]
- ]
- ]]]],
- "\"凲o肉Iz絾豉J8?i~傠᫽䇂!Wï›—D溊J?á¡’vsè†åµ¹âž’ïŸæ·´î‡…>ì„«^è«Ž0Ok{켿æ­à·£èƒ°a2﨤[탳뚬쎼嫭뉮m": 409440660915023105,
- "w墄#*ᢄ峠밮jLa`ㆪ꺊漓Lã§ëŽ!Agkï¹ï¾'ê›ë¢ƒã¯å²¬D#ã’¦": false,
- "ଦPGI䕺L몥罭ꃑ궩﮶#⮈ᢓӢ䚬p7웼臧%ï‘¥~Sè âŒíž€6îž’&t䳙y㪘ëƒ\\*;é‰ï¿Šé¿µ'å—•pa\"oL쇿꬈Cgî“": "㶽1ç¸D⟸䴅ᆤ뉎﷛渤csî¸x ä”цꬃ锚æ¬?ຽ+x~꘩uIà¡ž\u0007æ ²5呚ẓem?è¢\")=㥴䨃pac!/æŽY",
- "á·±o\\||뎂몷r篙|#X䦜I#딌媸픕åžRDæ–³X4t⯩夬=[ï‹ë­²r=绥jhë·±ì¸âª˜%]⚋܈㖴スHí…¹m(WOæ›åŠ‰0~K3c柢Õã‰ïªªé€³~": false,
- "ç…½_qb[첑\\륌wEâ½Ztï”´CNï­+餌ᕜOê›­": "{ﳾ쉌&s惧á­âµ†3䢫;䨞팑ï›ê’ªí˜è¤€à¢–Qä ¿V5뭀䎂澻%ë°›u5í…¸oA⮥U㎦;B䳌wzä•™$áž¿\\௅婺ëµâª¾í†\\`Kyौꋟ._\u0006L챯l뇠Hi䧈å’5",
- "艊ä½à£ƒë¡‡ä± çˆ¬ï˜‚!*;⨣æŽïžæ…“qé“|儑ᨋL+è¿¥=6㒺딉6弄3è¾…J-㕎뛄듘SG㆛(\noAzQê±ä°©X*ã¢O퀌%펠낌moí‹®a^<\/F&_눊ᾉ㨦ы4\"8H": 2974648459619059400,
- "鬙@뎣䫳á®ë¡?){y?5K;TA*k溱䫜J汃ꂯ싔ì\u001dA}룖(<\/^,": false,
- "ëª@QꋦFꊩá’뎶î‡lXl垨4î¤^郣|ꮇ;ä´á“}ìµ²zç–": null
- }
- ]]]],
- ":_=닧弗D䙋暨é›. 㱻붘ä‚Jå„’&ZK/녩䪜rå›â½¯D喠죥7ï“⹌䪥c\u001a\u2076￞妈朹oLkè®F౟覛ì§ã®7T;}è›™2{9\"å´“bB<\/⡷룀;즮鿹)丒툃୤뷠5W⊢嶜(fb뭳갣": "E{å“1WM"
- }},
- "䘨tjJ驳豨?y輊M*᳑梵瞻઻ofQG瑮e": 2.222802939724948E-19,
- "ä®´=â‘➶Tà·‹wäžœ\"垦ꃼUt\u001dx;B$뵣䙶E↌艣ᡥ!᧟;ä±€[䔯k쬃`à©8饙른ç†î‹”'2_'袻tGfè’­Jë•Ÿas꯳╖&å•’zWࡇᒫYSá¬\u0014ℑ첥鈤|cG~Pá“®\">\"": "ႆl\f7V儊㦬nHꄬꨧC{ì¢~C⮃⛓嶦vê„Ž1w鰠嘩뿠魄&\"_qMâµ–é‡”ë…®îœ¡ê‡ ãš{ç³Jå“‹ cî°¸v?-jkﻯྌ鹑L舟r",
- "龧葆yB✱H盋夔ﶉ?n*0(": "ꧣኆ㢓氥î³qZZ酒ຜ)鮢樛)X䣆gTSî»»Ò‘Gí…žï’˜k.J圬ç–ë¡«ïœì¯­z L:\\ྤ@w炋塜쿖ᾳy뢀䶃ë±N䥨㚔勇ê²#p",
- "ë„ç•ŽQ娡\"@S/뼋:äµ!Pè¡…ì´šfVHQs✜á«i㻑殡B䜇%믚k*U#濨낄~": "êŸá‹•ì³¸êˆæ•‹&lå¦\u0005憡멗瘌uPgá…ªm<\/To쯬锩h뒓k"
- }
- ]
- }],
- "墥홞r绚<\/⸹ⰃB}<躅\\Y;๑@䔸>韫䜲뱀X뗩鿥쩗SI%ﴞ㳕䛇?<\/\u00018x\\&侂9é‹™a[LRã‹­W胕)â¡¿8ãž™0JF,}?í—ˆd1cDMáƒâ›é„ⱕ%X)!XQ": "â³ê—³=橇a;3t⦾꼑仈î¥á€°aᚯ⯋ꕃAsé´·Nâ•_䎃ꙎAz\u0016䯷\\<à¿«>8q{}ï½·?ᣰ}'0ᴕ펓B┦lF#趤厃T?ã•Š#撹圂䆲"
- },
- "Ü‹ë‹é¾«ï¥c웑": false,
- "ㇿ/q\"6-co髨íœCí¦#\u001b4~?3ä¹E삇<<": 7.600917488140322E-20,
- "äE6?㣖êƒé—´t祗*é‘ {ḣV(æµ¾h逇íž=W?ૉ?nꇽ8ꅉຉj으쮺@êš„ã°¤u]Oyr": "vâ‰á«¸_*όAඤԆl)ۓᦇQ}í zà¼q滚",
- "ソ᥊/넺I": true
- }]]
- ]
- ]
- ]
- ]]
- },
- "䭑Ik攑\u0002QV烄:芩.麑㟴㘨≕": true,
- "å„꿕C쇻풉~å´%碼\\8\"䬦꣙": null,
- "欌L圬䅘Y8c(♺2?ON}o椳s宥2䉀eJ%é—¹rå†O^K諭%凞⺉⡻,掜?$ꥉ?略焕찳㯊艼誜4?\"﯎<ï±ã‚›XáˆINT:è©“ +": -1.0750456770694562E-19,
- "ç’àc뜭싼ﺳ뎤K`ïŸ]p隨LtE": null,
- "ç”™8䵊神EIꩤé¯á¢€,ïµ®Uä‘u疒ử驺䚿≚ഋ梶秓F`覤è­#짾蔀묊4<åªì¬¦éª_Yzgcࡶ4kç´¥`kc[Lï®—î°£ç°*I瀑[â¾°L殽鑥_mGÈ <\/|囹ç gæ¡°iri": true,
- "챓ꖙꟻì¢è‡ou,å— 0\\jK핻뜠qwQ?ഩ㼕3Y彦b\u009bJ榶N棨f?ë¦é–綃6é³µM[OEë´¨uí–.Ꮁ癜蟳뽲ꩌ뻾rM豈Rï¨ç¾« uDꎚ%": null
- },
- "V傜2<": 7175127699521359521
- }],
- "é“«aG切<\/\"ী⊆e<^g࢛)Dé¡ï½Žï¬®é¥¼\u008c猪繩嵿ﱚCꡬ㻊g엺Aì—¦\u000fæš¿_f꿤ë³ã¦•æ¡¦`蒦䎔j甬%å²rj ç³": "䚢åŽëˆ´Au<4箞7礦Iï±”å eȧ䪸uï„€äµp|逹$嗫쨘ꖾï·!胠z寓팢^㨔|u8Nሇe텔ꅦ抷]،鹎ã³#༔繁 ",
- "낂乕ꃻ볨ϱ-ꇋã–fsâ¿«)zꜦ/K?솞♞ꑌ宭hJ᤭瑥Fu": false,
- "쟰ãœé­›G\u0003u?`㾕ℾ㣭5螠烶這趩ꖢ:@å’•ê¶xë’˜ëŠmä°¨bç—ƒë 0鳊喵熬딃$摉_~7*ⱦ녯1錾GKhJ惎秴6'H妈Tᧅ窹㺒疄矤铟wላ": null,
- "쯆q4!3錕ã²âµ†ã‡›ê˜·Zç‘©ë­†\\â—ªNH\u001d\\ã½°U~㯶<\"쑣낞3ᵤ'峉eꢬ;鬹o꣒木X*é•·PXᘱu\"ä ¹n惞": null,
- "ᅸ祊\"&ꥴCjࢼ﴿?䡉`U效5殼㮞V昽êª#ﺸ\\&t6x꠹盥꣰a[\u001aêªSpe鎿蠹": -1.1564713893659811E-19
- }
- ]]
- ]
- ]
- ],
- "羵䥳H,6ⱎ겾|@t\"#í–Šî¦1|稃 ì„­)ëœ=뻔ꡜ??î¿ž?æ«Ž~*á¿¡ê«Œ/繣ﻠq": null
- }
- ]}
- ]},
- "츤": false
- }},
- "s": 3.7339341963399598E18
- }
- ],
- "N,I?1+㢓|ࣱ嶃쩥V2\u0012(4EE虪朶$|w颇væ­¥": "~ì¢~_,Mzrã«YB溓Eæ·š\"ⅹ䈔áºæŠ™ b,nt5Vã’J檶ê¨â»”?",
- "Q껑ꡡ}$넎qHç…”æƒ/ez^!ẳF댙äŒé¦»å‰8": "梲;yté’°$i冄}Aî‘”L%a jëœå¥·ê±³ëš¾d꿽*ሬuDY3î…—?뮟鼯뮟wãªí‹±îŸ‚V",
- "o{Q/K O胟ãzUdê€m&⨺J舕â¾é­¸è¨ŸãŒ¥[T籨櫉å”í‚ aṭ뱫촙莛>碶覆⧬짙쭰ׯdAiH໥벤í¥_æ¸[ 0î­¬e:죃TCå¼¼èŽëµDA:w唵ê£": null,
- "á½æ¨Žäµ®è»§|?à±—aWH쩃1 ê…­su": null
- }
- ]
- },
- "勂\\&m鰈J釮=Ⲽ鳋+䂡郑": null,
- "殣b綊倶5㥗惢⳷è¢á‘€ä¬„镧M^ï±´3⣢翣næ«»1㨵}ኯ뗙顖Z.Q➷ꮨ뗇\u0004": "ê”™ä¼>n^[GीA䨟AMç¢á’ŠS쨲w?d㶣젊嘶çºéº“+æ„£a%気ྞScë“ᔘ:8bM7Xd8㶑臌]Ꙥ0ê­ì’™ä«£æŒµCè–½î€Dfⵃ떼᷸",
- "?ç´¡.ì…ª_à·¨j\u0013Oxâ” $Xᶨ-á…‡oè–¹-}軫;yæ¯ãªœKã£?.EVì®±4둽⛻䤜'2盡\u001f60(|eì°ã¼Žá¦€ã’§-$l@ﻑå³\u0003ä­±å“å·—WFo5c㧆Tí„Y맸♤(": -2.50917882560589088E17
- }}
- ],
- "侸\\릩.᳠뎠狣살cs项䭩畳H1s瀉븇19?.w骴崖㤊h痠볭㞳㞳ä®Ql怠㦵": "@䟴-=7f",
- "鹟1x௢+d ;viä­´FSDS\u0004hꎹãš?â’â¦Ñž6u,扩@ë·Su)Pag휛Tá’—Vç—©!çžé‡€ê–žè˜¥&ೞè˜ê­°êž‡áŽ": "ah懱Ժ&\u20f7䵅♎඀䞧鿪굛ౕ湚粎蚵ᯋ幌YOE)५襦ãŠY*^\"R+ඈî¶å’·è¶9î—ꥂ榨艦멎헦é–ë¶v좛咊E)K㓷ྭr",
- "æ†q쮦4綱켙ì….f4<\/g<籽늷?#蚴픘:fF\u00051㹉뀭.á°–í’ŽfÖ¦Hv蔎㧤.!ä­½=éž½]ìŒH:?\"-4": 8.740133984938656E-20
- }]}
- }
- ],
- "tVKn딩꘥⊾蹓᤹{\u0003lR꼽ᄲQFá…傅ﱋ猢⤊á”,E㓒秤nTතv`â™›I\u0000]꫔ṞD\"麵cè¸î“²æ°X&æ¿¿ë˜ê£¹ê¹³à±¥è‘‚é¿Ž\\aꡨ?": 3900062609292104525
- }
- ],
- "ਉ샒⊩Lu@S䧰^g": -1.1487677090371648E18,
- "⎢k⑊꬗yá«7^err糎Dt\u000bJ礯확ã†æ²‘サꋽeèµ”ã¢^J\u0004笲㿋idra剰-᪉C錇/Ĝ䂾ညS지?~ì½®gR敉⬹'䧭": 1901472137232418266,
- "ç—k䶥:?ì´½è´ì“‰ê“ˆã’¸gç˜[뵎\\胕?\u0014_榙p.j稶,$`糉妋0>Fá¡°ly㘽$?": "]ê™›O赎&#ã ƒë±å‰³î°·\"<â—†>0誉é½_|z|裵씪>áŒã¼\"Z[ç•}O?G뚇諦cs⠜撺5cuç—‘U圲\u001c?鴴計l춥/╓哼䄗èŒîšªê®…뫈댽AëŒë¡–뤫V窗讬sHd&\nOi;_î´–u"
- }
- ],
- "Uﺗ\\Y\\梷䄬~\u0002": null,
- "k\"Y磓ᗔ휎@U冈<\/w컑)[": false,
- "æ›Jè·âŒ»ë¦\u001f㙳s꥓âŸé‚«P늮쥄c∬ྡྷ舆렮칤Z趣5콡넛A쳨\\뀙骫(棻.*&è¼›LiIfi{@EA婳KᬰTXT": -4.3088230431977587E17
- }]}
- ]
- ],
- "곃㲧<\/dఓꂟs其ࡧ&N葶=?c㠤Ჴ'횠숄臼#\u001a~": false
- }
- ]
- ]}]
- }]
- }}
- ],
- "2f`â½°E쵟>Jî•ç¬‚裭!〛觬囀ۺ쟰#æ¡Šl鹛ⲋ|RA_Vxá­gEë“h﵀mfá»|?juTUæ¡£[d⢼⺻pæ¿š7E峿": 5613688852456817133
- },
- "濘ë¶gå¿®7ãµæ®¬W팕Qæ› ë«°)惃廊5%-î«è¹šzYZ樭ﴷQ锘쯤崫îŸgg": true,
- "絥ᇑâ¦ì’“븣爚H.ã—Šß„o蘵貆ꂚ(쎔O᥉î¼ï®“]姨Wê“!RMA|o퉢THxè½®7Mê»U즨'i뾘舯o": "è·¥f꜃?"
- }}
- ],
- "é·°é¹®K-9k;ï°°?_ݦѷ-ꅣ䩨Zꥱ\"mꠟ屎/콑Y╘2&鸞脇ã¢ê€‡à ºâ°¼æ‹¾å–­í‹®îL꽩bt俸墶 [l/웄\"꾦\u20d3iও-&+\u000fQ+໱뵞": -1.296494662286671E-19
- },
- "HX੹/⨇୕붷Uﮘ旧\\쾜͔3l鄈磣糂̖䟎Eá³wæ©–bá¿€_딕huè‘°î¤çª³é—¹Ð²U颵|染H죶.fPä—®:jä«¢\\b뎖i燕ꜚGâ® W-≚뉗l趕": "ଊ칭Oa᡺$IVã·§L\u0019脴셀붿餲햪$迳å‘ì¯ì¼‚PqfT\" ?î¹€I屉鴼쿕@ç¡™z^é•ãŠµM}ãš›T젣쓌-Wâ©-g%⺵<ë®±~빅╴瑿浂脬\u0005왦燲4áƒb|Då § <\/oEQh",
- "䘶#㥘à©îººìº”ï” f巋ἡAJ䢚쭈ࣨ뫒*mᇊK,ࣺAꑱ\u000bR<\/A\"1a6鵌㯀bh곿w(\"$ê˜*rà²è¶£.dà¿©k/抶면䒎9W⊃9": "漩b挋Swè—Ž\u0000",
- "畀e㨼mK꙼HglKb,\"'䤜": null
- }]}]
- ]
- ]
- }]
- ]}
- ]
- ]}
- ],
- "æ­™>駿ꣂ숰Q`J΋方樛(d鱾뼣(ë«–í„­\u20f9lচ9æ­Œ8o]8윶lì–¶?é•–G摄탗6í‹íµ+g:䱫홊<멀뀿/س|ê­ºsê±è·¶ç¨šW々c㫣⎖": "㣮蔊깚Cꓔ舊|XRfé»ã†šï¸†'쾉ì·\\&言",
- "æ®­\"cÞɨê™äž˜:嬮eæ½½Y펪㳅/\"O@à —ê²´]ì·–YÇž(t>R\"N?梳LDæ­=næ°¯Tè±°2R諸#N}*ç§ï¡§4}㶊Gä£bì–š": null,
- "襞<\/啧 B|싞W瓇)6簭鼡艆lNì©`|펭佡\\é–“é‚[z릶&쭟愱ꅅ\\Tá°½1鯯åæ ˆ4̸s윜R7â’/똽?치X": "âŠèº–Cﱰ2Qẫè„&இ?%ëƒæ‚Š",
- ",é°§åµì…£îˆ›ì‹¹xᎹ힨᯳EṬHïŽã¹–9": -4604276727380542356
- }
- }
- ]]]],
- "웺㚑xs}q䭵䪠馯8?LB犯zK'os䚛HZ\"L?셎s^㿧㴘Cv2": null
- }]
- ]
- ]
- ],
- "Kdî©´2Kv+|z": 7367845130646124107,
- "ᦂⶨ?ᢠ祂些ഷ牢㋇æ“\"腭䙾㖪\\(y4cE뽺ㆷ쫺ᔖ%zfÛ»$Ñž1柦,㶢9r漢": -3.133230960444846E-20,
- "ç˜Mç„€q%㢟f鸯Oâ£è“‘맕鯊$Oå™·|)z褫^㢦⠮ꚯ꫞`毕1qꢚ{ĭ䎀বώT\"뱘3G൴?ï¢ï¢^^oï…¯f": null
- }
- ],
- "a8V᯺?:ﺃ/8ꉿBq|9啓댚;*i2": null,
- "cpT瀇Hç°á»ªpೃi鎪Rrâ£ìˆ¬-鹸ҩ䠚z脚цGoN8å…¥y%趌I┽2ឪЀiJNcN)槣/â–Ÿ6S숆牟\"箑X僛G殱娇葱T%æ»:J諹昰qV쨰": 8331037591040855245
- }],
- "G5ᩜ䄗巢껳": true
- }
- },
- "Ồ巢ゕ@_è­™A`碫é„㡥砄㠓(^K": "?܃B혢▦@犑ὺD~Tâ§|é†;o=J牌9냚⢽㨘{4è§èš”9#$∺\u0016p囅\\3Xk阖⪚\"UzA穕롬✎âžã­’춺C㣌ဉ\"2瓑员ᅽê¶ë«}꽚ꞇ鶂舟彺]ê½JCè§éŠ‰",
- "â†Äšè†\"b-í‰ACR言J謈53~V튥x䜢?ꃽɄY뮩ꚜ": "K/↾eèƒ}]Bs⾿q룅鷦-膋?m+æ­»^魊镲6",
- "粡霦cæž‹AHíŸo礼Ke?qWcA趸㡔ê‚?\u000e춂8iতᦜ婪\u0015㢼nﵿê»!á´é–¢\u001d5j㨻gfá¿©UK5Juä¸tã‹TI'?ã“t>⼟o a>i}á°—;뤕Ü": false,
- "ꄮ匴껢ꂰ涽+䜨B蛹H䛓-kè•žfu7kLè°–,'涃V~챳逋穞cT\"vQ쓕ObaCRQã“¡â²®?轭⫦輢墳?vA餽=h䮇킵ní²í‰…喙?\"'1ç–¬V嬗Qdç—'Lự": "6v!së¯ã­Ÿî€µî¦˜ã£¯çƒ!磸餠ቂh0C뿯봗Fé·­gê–¶~コkK<ᦈTtïŽ\\è·“w㭣횋钘ᆹ듡䑚W䟾X'ê…”4ï€FL勉Vܴ邨y)2'〚쭉⽵-鞣E,Q.?å—",
- "?(˧쩯@å´Ÿå‹æ­„K": null
- },
- "Gc럃녧>?2DYIé´¿\\륨)æ¾”0ᔬlx'觔7젘⤡縷螩%Sv׫묈/]↱&S ï…h\u0006æ­‹á‘›xi̘}ã²Y蔯_醨鯘煑橾8?䵎쨋z儬ê*@츾:": null
- }
- }
- }
- ]
- ]
- ]}
- },
- "HO츧G": 3.694949578823609E17,
- "QC\u0012(翻曇Tfã·ŸbGBJ옉53\\嚇ᛎDï–/\u001b夾á‰4\"í•€@祎)쫆yD\"i먎Vnî¿ã¿¿V1Wá¨ä¶€": -6150931500380982286,
- "Zã“®P翸é±é‰¼K䋞꘺튿â­Y": -7704503411315138850,
- "]모开ꬖP븣c霤<[3aΠ\"é»ä––䰑뮋ꤦ秽∼㑷冹T+YUt\"싳F↭ä–&é‹Œ": -2.7231911483181824E18,
- "tꎖ": -4.9517948741799555E-19,
- "䋘즊îŽ.⬅IꬃۣQ챢ꄑé»|f?C⾺|å…•ì¯sC鬸섾整腨솷V": "旆柩l<Ké«î–žM戶鯮t:wRî°2ꉱ`9'l픪*í芦㊢Pjjoå ¡^ ì‡ì–›å¶…있ষ0?F",
- "下9T挞\\$yᮇk쌋⼇,ਉ": true,
- "櫨:ㆣ,é‚lî ¬r崕祜ã®çƒœZ,XXD蕼㉴ kM꯽?P0﹉릗": null,
- "îŠgv솠歽閘4镳䗄2æ¾¾>쪦sá–¸My㦅울ì‰ç˜—㎜檵9ï……ê‚駓ૉᚿ/u3ì”…å¾ï¤¥[Z䞸ࡗ1ꆱ&Q풘?Ç‚8\u0011BCDY2볨;é¸": null,
- "幫 nç…¥sì‡íŽ‡ 왊-$C\"è¡:\u0014㣯舼.3ë™—Yl⋇\"Kè¿Žë©Ž[ê½µs}9鉳UK8ì¥\"掄㹖h㙈!얄સ?Ꜳ봺R伕UTD媚I䜘Wé¨è”®": -4.150842714188901E-17,
- "ﺯ^ã„„\b죵@fྉkf颡팋î¤êž¦{/Pm0V둳⻿/è½éŸ’ꊔᚬ@5螺G\\å’¸a谆⊪ቧ慷绖?è´¢(é·‡uéŒF=rá橢ឳn:^iá´µtD볠覅Nèµ´": null
- }]
- }]
- }
- ]
- ]}
- ]},
- "謯?w厓奰T李헗èážè²–o⪇弒L!캶$ᆅ": -4299324168507841322,
- "뺊奉_åžæµ¸å»¶ëªå­„Z舰2i$q붿좾껇d▵é¤\"v暜Ҭì„mï¿´g>": -1.60911932510533427E18
- }
- ]
- }
- ]
- ]],
- "í‰êº”㠦楶Pê…±": 7517896876489142899,
- "ï™°": false
- }
- ]},
- "是u&I狻餼|è°–j\"7cë®sï­-踳鉷`䣷쉄_A艣鳞凃*m⯾☦椿q㎭Nîœæº”铉tlㆈ^": 1.93547720203604352E18,
- "ï…µkⲨ\\%vr#\u000bâ’ºY\\t<\/3﬌R訤='﹠8è¤êž´ë ´æ›”r": false
- }
- ]},
- "阨{c?C\u001d~K?鎌Ԭ8烫#뙣Pì´ˆé—tã­±E­ë’䆺}ç”—[R*1!\\~hã•…á°º@<9JêષIä³–æ ­6綘걹ᅩM\"▯是∔v鬽顭⋊譬": "ìš´ï¶Kæ•‚(欖C취پ℄爦賾"
- }
- }}
- }],
- "鷨赼鸙+\\ä­£t圙ڹx᜾ČN<\/踘\"S_맶a鷺漇T彚⎲i㈥LT-xA캔$\u001cUH=a0츺l릦": "溣㣂0æ¿•=鉵氬駘>Pꌢpb솇쬤h힊줎çªãª¬CrQ矠a&è„꼬爼M茴/á¿®\u0017å¼è½¼y#êž c6ë‘´=?Rå´ë· éº–w?"
- },
- "閕ᘜ]CT)䵞l9z'xZF{:ØI/躅匽ì¡:䟇AGF૸\u001cퟗ9)駬慟ꡒꆒRS״툋A<>\u0010\"ꂔ炃7gëšEà§îˆbꅰ輤]oã±_뷕ܘ暂\"u": "芢+U^+㢩^鱆8*1鈶鮀\u0002뺰9⬳ꪮlL䃣괟,G8\u20a8DF㉪錖0ㄤ瓶8Nଷd?眡GLc陓\\_죌Vì°à¤²äºŒ?cë¦æ± \u0019JC\u0011b⤉zẒT볕\"绣蘨뚋cꡉkî« I\u001eé³´",
- "ꃣI'{6u^㡃#཰Kq4逹y൒䧠䵮!㱙ï®/n??{Lí’“ZETã™ í¿X2᩟綳跠葿㚙w཮x캽扳B唕S|å°¾}ì´•%N?o䪨": null,
- "ⰴFjà·Ÿì…ˆ[\u0018è¾·px?椯\\1<ﲻ栘á£ë´¢æ† ë‰´p": -5263694954586507640
- }
- ]
- ]]
- ]}
- ]}]
- ]
- ],
- "?#癘82禩鋆êŠty?&": -1.9419029518535086E-19
- }
- ]
- ]
- ]}
- ]
- ]
- ],
- "훊榲.|῕戄&.ãšZꛦ2\"䢥ሆ⤢fV_æ‘•å©”?â‰Fji冀탆꜕iã¬_ẑKᅢ꫄蔻XWc|饡Siẘ^㲦?羡2ã´1ç¸á™…?ì‰Ou": false
- }]]
- ]}}},
- "æ…‚ë—„å“è“”á“åŒåš–/颹蘯/翻ㆼL?뇊,í…µ<\\ç·ã”Cボ": null
- },
- "p溉ᑟi짣z:䒤棇r^٫%G9缑r砌롧.물农g?0׼ሩ4ƸO㣥㯄쩞ጩ": null,
- "껎繥YxK\"F젷쨹뤤1wq轫o?鱑뜀瘊?뎃hç‘\\ꛣ}Kå³^ኖâ¤ï§´ê‰“hy": null
- }
- ],
- "á±€nè‚“ã„›\"å »2>mæ®®'1æ©Œ%êž´êµ°=Ӳ鯨9耛<\/næ“š0u彘8㬇៩fá¿è¯™]嚊": "䋯쪦S럶åŒã…›#î½)O`ሀX_éªæ¸²â›€ã¨»å®…闩➈ꢙஶDRâª"
- },
- "tAì“龇 â‹¥bj왎录r땽✒롰;羋^\\?툳*┎?ì€ma䵳넅U䳆૘〹䆀LQ0\bç–€U~u$M}(鵸gï­â³¾i抦뛹?䤈땚검.鹆?ê©¡tⶥGÄ’;!ቹHïš©Så³»B츪ì¼f5≺": 2366175040075384032,
- "ì „pJjleb]áž½": -7.5418493141528422E18,
- "n.鎖ጲ\n?,$䪘": true
- },
- "欈Ar㉣螵᪚茩?O)": null
- },
- "쫸M#x}D秱æ¬K=侫们ä¸ï‡ª.KꕾxẠ\u001e㿯䣛FÜ캗ï¬qq8꟞ṢFD훎⵳簕꭛^鳜\u205cÙ«~â‘Ÿ~冫ऊ2ì«°<\/戲윱o<\"": true
- },
- "ã·è¥/T뱂\u0010锕|内䞇xä¾â‰¦ã­–:M?iM᣿IJeç…œdG࣯尃⚩gPt*辂.{磼럾äª@a\\袛?}ᓺBç¼": true
- }
- }
- ]]}]}},
- "tn\"6î´ê«¤ìƒ¾ä„„;銞^%VBPwu묪`Y僑N.↺Ws?3C⤻9唩Sä ®á´m;sᇷ냞඘B/;툥B?lB∤)G+O9m裢0kC햪䪤": -4.5941249382502277E18,
- "áš”t'\\æ„«?éµ€@\\ã³ê‚•Pí <<]ç…¹G-b!S?\nꖽ鼫,Ý›&é ºy踦?Eæ†î¬–릱H}햧캡b@手.p탻>췽㣬ꒅ`qeä½­P>á“‚&?u}毚ᜉ蟶頳졪áŽzl2wO": -2.53561440423275936E17
- }]}
- }
- ]
- ]],
- "潈촒⿂å¡": 5495738871964062986
- }
- ]]
- }
- ]
- ]}
- ]]
- ]]
- ]}
- ]
- ]},
- "á‚qí‚è“…R`謈èŸá¦î’³å„‚æ§åƒ»ï¹¶9å©Œî¬æ«žé‡ˆ~\"%匹躾ɢ뤥>࢟瀴愅?殕节/냔O✬H鲽엢?ᮈà©î“Žâ‹§dâ½ã«zCe*": 2.15062231586689536E17,
- "㶵Ui曚ç°é‹ªá¾¼è‡§P{ä䷪쨑̟A뼿T渠誈äšD1!잶<\/ã¡7?)2l≣穷᛾ç¨{:;㡹nemיּ訊`Gî¹²": null,
- "䀕\"飕辭påœf#뫆䶷뛮;â›´á©3çšëá°ìŽ“⦷詵%᜖Մfs⇫(\u001e~P|ï­—CⲾផv湟W첋(텪બTî¾·<บSê‰à©—⋲X婵i ӵ⇮?L䬇|êˆ?졸": 1.548341247351782E-19
- }
- ]
- },
- "t;:N\u0015qé¦Rt缆{ê®C?஛㷱敪\\+鲊㉫㓪몗릙ç«(æ°µkYS": "Xá°‚T?൮ô",
- "碕飦幑|+ 㚦é¶`é•¥ê© B<\/加륙": -4314053432419755959,
- "秌孳(p!G?Vå‚«%8ሽ8w;5鲗㦙LI檸\u2098": "zG N볞䆭éŽí˜\\ONK3íš™<\/樚立圌Q튅kì©ŽFfì‹aׂJK銆ઘì¦ç‹©6༥✙䩜篥CzP(è»é§‡HHퟲ讃%,ά{ë p而刲vy䦅ክ^톺M楒é¢ã¹³]Mdg2>䤉洞",
- "踛M젧>忔芿㌜Zk": 2215369545966507819,
- "ì”A`$槭頰í»^U覒\bG毲aᣴU;8!팲f꜇E⸃_åµ{å«ç¾ƒX쀳C7ë—®m(åš¼u NÜè°ŸD劯9]#": true,
- "ﻩ!뵸-ç­šPá­›}á¼°å±¥lPh?౮ⶹꆛ穉뎃gè‘㑓溢CX뾇Gã–¬A錟]RKï’î´²aꄘ]Yo+@ä˜'s섎襠$^í™°}F": null
- },
- "粘ꪒ4HXᕘ蹵.$å€\r\u001dë¬77pPc^yî¶ç¬²Q<\/ê–¶ è¨äƒá¨•G?*": 1.73773035935040224E17
- },
- "婅拳?bkU;#D矠â´vVN쩆t㜷A풃갮娪a%é®çµª3dAv룒#tm쑬⌛qYwc4|L8KZ;xU⓭㳔밆拓EZ7襨eD|隰ऌ䧼u9Ô¢+]è´´Pè¿": 2.9628516456987075E18
- }]}}]
- ]}
- }}
- ]}]
- ],
- "|g翉F*湹̶\u0005â1脉̀eI쩓ᖂ㫱0碞l䴨ꑅ㵽7AtἈ턧yq䳥塑:z:é€ï¾¼X눔擉)`N3昛oQì…–y-ڨ⾶æ¢êˆµq^<\/": null,
- "è¹\\ëž“G^璬x৴뭸ゆUS겧﮷Bꮤ ┉銜᯻0%N7}~fæ´‹å„Xꔼ<\/4妟Vê„Ÿ9:౟곡t킅冩䧉笭裟炂4ë´‹â±³åºæ€Št+怯涗\"0ã–ˆHq": false,
- "졬믟'ﺇফ圪쓬멤m邸QLবä—æ„4jvsç¿™ à¾ê§€è‰³H-|": null,
- "컮襱⣱뗠 R毪/鹙꾀%헳8&": -5770986448525107020
- }
- ],
- "î½­B䔚bê»ë™å§“展槰T-똌鷺tcï§ç¿á«½^ã“Ÿä€o3o$꘭趙è¬Ié¡©)뇭Ἑä“\f@{ᣨ`x3è”›": null
- }
- ]
- ]
- }],
- "⦖扚vWꃱ꥙㾠壢輓{-⎳鹷è´ç’¿äœ‘bG倛â‹ç£Žc皇皩7a~ﳫUâ•£Q࠭ꎉS摅姽OW.홌ೞ.": null,
- "蚪eVlH献r}á®ë¯ ï°©ê”„@ç‘„â²±": null,
- "퀭$JWoê©¢gì—­ì䖔㑺h&à­¢tXX愰㱇?㾫I_6 OaB瑈q裿": null,
- "꽦ﲼLyr纛ZduçB絟쬴糔?㕂짹äµe": "ḱ\u2009cX9ë©€i䶛簆㳀k"
- }
- ]]]],
- "(_ê®g່澮?ᩑyM<艷\u001aꪽ\\庼뙭Z맷㰩Vm\\lYç­º]3㋲2㌩㄀Eਟäµâ¨„ì¨á”ŸgङHné–⤇놋瓇Q탚單oY\"♆臾jHᶈå¾îž«á‰„??uㇰA?#1侓": null
- },
- "觓^~ሢ&iIë†g륎ḱ캀.ᓡꀮ胙鈉": 1.0664523593012836E-19,
- "yè©­GbᔶऽsëŒU:æœî „⤎ϲì—⮼D醄诿që™°I#즧v蔎xHᵿt᡽[**?崮耖p缫쿃Lè,ë´¬ï–ꤦC쯵#=X1çž»@OZc鱗CQTï‹„x": null
- }
- ]
- }}],
- "剘ç´\u0004\\Xn⊠6,á€×±;嵣崇}讃iႽ)d1\\䔓": null
- },
- "脨z\"{X,1u찜<'k&@?1}Yn$\u0015Rd輲ーa쮂굄+B$l": true,
- "諳>*ì­®ê´äµŸÒ+<ç®}빀䅱⡔æªï€è‡’hIH脟ꩪCí•à¬—P좕\"0i<\/C褻DÛžæ—+^5?'ꂱ䚫^7}ã¡ cq6\\쨪ꔞꥢ?纖䫀氮蒫侲빦敶q{Aç…²G": -6880961710038544266
- }}]
- },
- "5s⨲JvಽῶꭂᄢI.a৊": null,
- "?1qê½ì¿»ê›‹DR%Uå¨>DgNä¹­G": -1.2105047302732358E-19
- }
- ]
- ]},
- "qZz`撋뙹둣j碇ì\\ꆥ\u0018@ïœè—´ç–°Wz)O{F䶛l᷂绘訥$]ë®å¤»ä¢‹ä©‡è¿ç°æ¨§çŒµâ£­jè¶q)$꬚⵷0馢W:â°!Qoe": -1666634370862219540,
- "t": "=î¹›wp|~碎Q鬳Ó\\l-<\/^ﳊhní–}ä”t碵ḛ혷?é»äŠ—",
- "邙쇡㯇%#=,î‰E4勃驆V繚q[Y댻XV㡸[逹á°è‘¢B@u=JS5?bLRnì–®ã‰â…ï°³?a6[&íŸ!è—ˆ": 1.2722786745736667E-19
- },
- "X블땨4{ph鵋ꉯ웸 5p簂䦭s_E徔濧dç¨~No穔噕뽲)뉈c5M윅>âš‹[岦䲟懷æ?éŽê“†à¸¬çˆ‹ç äœ”s{\u001bméšå„¸ç…›%bﯿXT>ê—˜@8G": 1157841540507770724,
- "媤娪Qæ¸ï‡\u0011SAyᡈ쿯": true,
- "çš^ಸ%ê±<\/蛯<O\"-刷ã R(kO=䢊䅎l䰓팪A絫픧": "è­”\\ãš„ ?R7㔪G㋉⣰渆?\\#|gN⤴;Wì¹·A׫癮଼ೣã³ë’œ7dæ“ê¾²0扬S0ᆵi/贎ྡn䆋武",
- "è‡ç ‡Gã“朦켋Wq`㞲攊*å†î‘µî¨~霓L剢zI腧튴Tç¹™Cঅ뫬╈뮜ㄾ䦧촄椘B⊬츩r2f㶱厊8eϬ{挚â¯OM焄覤\\(KÓ¡>?\"祴å“\\\\'í": -3.4614808555942579E18,
- "釴U:O湛㴑䀣렑縓\ta)<D8ï­³æ§é«­D.L|xsæ–‹æ• \"ë‹æ—©7wáŽ": true,
- "쵈+쬎簨up䓬?q+~\u0019仇îŒëµˆá«¯3áµ£æ˜æž°åŠ«ãª¢uç˜-퀭:ì»™:u`⌿ï«A(9鄦!<çšnj3:Hࣨ巋ä€æ—¸ëŽˆë§»v\"\\(곘vO㤰aZe<\/W鹙鄜;l厮ë‘": null,
- "î–·": -1.2019926774977002E-18,
- "%者Oî–‹7.Nêªs梇接z蕜綛<\/䜭\"죊y<曋漵@Śâ¹sD⟓jݗᢜ?zî–†/9á²Ma쨮긗贎8ᔮ㦛;6p뾥໭䭊0B찛+)(Yã¿ é¸ä•’^옥": "鬃뫤&痽舎Jì½®è—󽸰ᨨMꈫ髿v<N\\î·.ì‚’ê»…Ñ1ê­¼5ä´·5쳬臨wjë¥"
- }],
- "é·Ž'ã³—@帚妇OAj' è°¬f94ǯ(횡ヒ%io쪖ì‚좛>(j:숾å´ä—ŒgCiB뽬Oyuqè¼¥åŽ/7)?今hY︺Q": null
- }
- ]
- ]]]}]
- ],
- "I笔趠Ph!<ཛྷ㸞诘X$畉F\u0005笷èŸ.Esr릙!W☆ï›ä²–뗷莾뒭U\"䀸犜Uo3ï¯Gꯌx4r蔇᡹㧪쨢準<ä‚€%ࡡꟼç‘8ç‚Xs0ä€é”€?fi쥱ê†àª²BB": -8571484181158525797,
- "Lâ¦o#J|\"⽩-ã±¢d㌛8d\\㶤傩儻E[Y熯)r噤὘勇 }": "e(濨쓌K䧚僒ã˜è ¤Vᛸ\"络QJL2,嬓ì™î¿‰ä¼¢ã‹’䴿考澰@(ã¾`kX$ë‘ÑE斡,èœ&~y",
- "vj.|统圪ᵮPL?2oŶ`ë°§\"勃+0ue%⿥绬췈체$6:qaë Q;~晘3㙘鹑": true,
- "à·Ø™4ç„⶿c︋iâš…:ã‚“é–Ⳙ苆籦kw{䙞셕pCì·ƒê¬âœêŸ¯êš“é…„bížhwkê­­M鬋8B耳쑘WQ\\å™ac'唀x᪌\u2048*h짎#á‡é® ë¾áž¿ë€Œ": false,
- "⎀jꄒ牺3Ⓝ컴~?親ꕽã¼Ü“å–瘘!@<튋ãŒê¿±â©¦{a?Yv%⪧笯Uܱ栅Eæši뚬:ꄃx7䙳ꦋ&䓹vq☶Iä˜á¾˜æ¶œ\\ì‰ëºŒLr%Bcãœ3?î¤ï…¨ê­ç ¿è£ž]": null,
- "⭤뙓z(㡂%亳K䌽꫿AԾ岺㦦㼴輞낚Vꦴw냟鬓㹈뽈+o3譻K1잞": 2091209026076965894,
- "ㇲ\t⋇轑ꠤ룫X긒\"zoYì‡í¬wjæ¢ì‘l侸`e%s": -9.9240075473576563E17,
- "啸ꮑ㉰!áš“}éŠ": -4.0694813896301194E18,
- "ï‰>]囋੽EK뇜>_ꀣ緳碖{ì裔[<ನ\"䇅\"5L?#îµ³xTwv#ç½\u0005래t应\\N?빗;": "v쮽瞭pë­ƒ"
- }
- ]],
- "斴槾?Zç¿\"~æ…弞ﻆ=꜡o5é‹ï’½dw\"?Kè ¡i샾ogDï²°_C*⬟iㇷ4nયèŸ[㟉U꽌娛苸 à§æ“贻洞펻)쿗૊許X⨪VY츚Zä¾ã¶­~튃ᵦ<\/E臭tve猑x嚢": null,
- "锡⛩<\/칥ꈙᬙè€&êšç±¬â– 865?_>Lè©ì¿¨äˆŒæµ¿å¼¥ï©‰Ì«î¾½ï‘lj&zx<\/C쉾?覯n?": null,
- "꾳鑤/꼩ï¨d=ᘈn挫ᑩ䰬ZC": "3錢爋6Ƹ䴗v⪿Wr益G韠[\u0010å±—9ì¡é’u?殢c䳀蓃樄욂NAq赟c튒ç˜ë ¶î‚³Aà«¡Éšæ"
- }
- ]
- ]
- ]}
- ]
- ]
- }]]]}}
- ]}],
- "ï‚’Ejä—³U<\/Q=ç’샎䞦,å °é  @褙g_\u0003ꤾfⶽ?퇋!Å‚ï¡”B〙ד3CC䌴鈌U:뭔咎(Qો臃䡬è‹BO7ã¢äŸ¸\"Yb": 2.36010731779814E-20,
- "逸'0å²”j\u000e눘먷翌C츊秦=ꭣ棭ှ;鳸=麱$XP⩉駚橄A\\좱⛌jqvä°ž3Ь踌v㳆¹gT┌gvLBè³–ïžçƒ¡m?@E঳i": null
- },
- "曺vì°˜×?&绫OáŸ": 9107241066550187880
- }
- ]
- ],
- "(e屄\u0019昜훕ç–b蓘ᬄ0/۲묇Z蘮á€â¨è›˜èƒ¯ë¢ƒ@㘉8ሪWᨮ⦬ᅳ䅴HIá‡ì¨³z囕陻엣1î•Ÿèµ³o": true,
- ",b刈Z,á æ™Tì†Å•B⩆ou'í¼â‰ƒç»—é›—dè­Š": null,
- "a唥KB\"ï³è‚•$u\n^â…„P䟼냉䞸⩪u윗瀱ꔨ#yÅŸsî««ê’¬=ï‹•1ïš–|ﲤ爢`tà±íŠ¼î£ì³«_Az(Ṋ擬㦷좕耈6": 2099309172767331582,
- "?ã´¸U<\/䢔ꯡ阽扆ã¤qé‹?f㔫wM嬙-;UV죫嚔픞G&\"Cá—äªí’ŠQ": "VM7ç–¹+陕枡툩窲}ç¿¡ä–¶8欞ÄsTë®}ç’¤:jﺋ鎴}HfAàµâ§»Zd#Qï¬u茅J髒皣Y-︴[?-~쉜vë”璮㹚䅊﩯<-#\u000eê±€h\u0004u抱﵊㼃U<㱷⊱IC進"
- },
- "숌dee節é½é‚ºp넱蹓+e罕U": true
- }
- ],
- "b⧴ë£??á” 3ã±>%郿劃ç¿ê¬ê ›Wï¡°çž³á«ëˆ„躨狀ໄy੽\"ីuS=㨞馸k乆E": "トz݈^î¡œ9R䬑<ﮛG<s~<\/?ⵆá¥è€ç†·uë“·"
- }}
- ]
- }
- ]}
- }
- }
- }
- }},
- "宩j鬅쳜Qê–јyç”Zá­µï1væ“–}䨿F%cֲ᫺贴m塼딚NP亪\"ï¿‹sa뺯ꘓ2:9뛓ï à¼‚쌅䊈#>Rꨳ\u000fTT泠纷꽀MR<CBxPñ±’«X쇤": -2.22390568492330598E18,
- "?䯣ᄽ@Z鸅->ᴱ纊:ã ­ë³®?%N56%鈕1ä—äœaä²—j陇=ë¿»å‚衋࿘ᓸ?ᕵZ+<\/}H耢bä€z^f$&ã’LkꢳIè„šë™›u": 5.694374481577558E-20
- }]
- }
- ]],
- "obj": {"key": "wrong value"},
- "퓲꽪m{㶩/뇿#â¼¢&᭙硞㪔E嚉c樱㬇1a綑á–DḾä©": null
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/webapp.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/webapp.json
deleted file mode 100644
index d540b57f0d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/webapp.json
+++ /dev/null
@@ -1,88 +0,0 @@
-{"web-app": {
- "servlet": [
- {
- "servlet-name": "cofaxCDS",
- "servlet-class": "org.cofax.cds.CDSServlet",
- "init-param": {
- "configGlossary:installationAt": "Philadelphia, PA",
- "configGlossary:adminEmail": "ksm@pobox.com",
- "configGlossary:poweredBy": "Cofax",
- "configGlossary:poweredByIcon": "/images/cofax.gif",
- "configGlossary:staticPath": "/content/static",
- "templateProcessorClass": "org.cofax.WysiwygTemplate",
- "templateLoaderClass": "org.cofax.FilesTemplateLoader",
- "templatePath": "templates",
- "templateOverridePath": "",
- "defaultListTemplate": "listTemplate.htm",
- "defaultFileTemplate": "articleTemplate.htm",
- "useJSP": false,
- "jspListTemplate": "listTemplate.jsp",
- "jspFileTemplate": "articleTemplate.jsp",
- "cachePackageTagsTrack": 200,
- "cachePackageTagsStore": 200,
- "cachePackageTagsRefresh": 60,
- "cacheTemplatesTrack": 100,
- "cacheTemplatesStore": 50,
- "cacheTemplatesRefresh": 15,
- "cachePagesTrack": 200,
- "cachePagesStore": 100,
- "cachePagesRefresh": 10,
- "cachePagesDirtyRead": 10,
- "searchEngineListTemplate": "forSearchEnginesList.htm",
- "searchEngineFileTemplate": "forSearchEngines.htm",
- "searchEngineRobotsDb": "WEB-INF/robots.db",
- "useDataStore": true,
- "dataStoreClass": "org.cofax.SqlDataStore",
- "redirectionClass": "org.cofax.SqlRedirection",
- "dataStoreName": "cofax",
- "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
- "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433;DatabaseName=goon",
- "dataStoreUser": "sa",
- "dataStorePassword": "dataStoreTestQuery",
- "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
- "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
- "dataStoreInitConns": 10,
- "dataStoreMaxConns": 100,
- "dataStoreConnUsageLimit": 100,
- "dataStoreLogLevel": "debug",
- "maxUrlLength": 500}},
- {
- "servlet-name": "cofaxEmail",
- "servlet-class": "org.cofax.cds.EmailServlet",
- "init-param": {
- "mailHost": "mail1",
- "mailHostOverride": "mail2"}},
- {
- "servlet-name": "cofaxAdmin",
- "servlet-class": "org.cofax.cds.AdminServlet"},
-
- {
- "servlet-name": "fileServlet",
- "servlet-class": "org.cofax.cds.FileServlet"},
- {
- "servlet-name": "cofaxTools",
- "servlet-class": "org.cofax.cms.CofaxToolsServlet",
- "init-param": {
- "templatePath": "toolstemplates/",
- "log": 1,
- "logLocation": "/usr/local/tomcat/logs/CofaxTools.log",
- "logMaxSize": "",
- "dataLog": 1,
- "dataLogLocation": "/usr/local/tomcat/logs/dataLog.log",
- "dataLogMaxSize": "",
- "removePageCache": "/content/admin/remove?cache=pages&id=",
- "removeTemplateCache": "/content/admin/remove?cache=templates&id=",
- "fileTransferFolder": "/usr/local/tomcat/webapps/content/fileTransferFolder",
- "lookInContext": 1,
- "adminGroupID": 4,
- "betaServer": true}}],
- "servlet-mapping": {
- "cofaxCDS": "/",
- "cofaxEmail": "/cofaxutil/aemail/*",
- "cofaxAdmin": "/admin/*",
- "fileServlet": "/static/*",
- "cofaxTools": "/tools/*"},
-
- "taglib": {
- "taglib-uri": "cofax.tld",
- "taglib-location": "/WEB-INF/tlds/cofax.tld"}}} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/widget.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/widget.json
deleted file mode 100644
index 0449493a64..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/data/widget.json
+++ /dev/null
@@ -1,26 +0,0 @@
-{"widget": {
- "debug": "on",
- "window": {
- "title": "Sample Konfabulator Widget",
- "name": "main_window",
- "width": 500,
- "height": 500
- },
- "image": {
- "src": "Images/Sun.png",
- "name": "sun1",
- "hOffset": 250,
- "vOffset": 250,
- "alignment": "center"
- },
- "text": {
- "data": "Click Here",
- "size": 36,
- "style": "bold",
- "name": "text1",
- "hOffset": 250,
- "vOffset": 100,
- "alignment": "center",
- "onMouseUp": "sun1.opacity = (sun1.opacity / 100) * 90;"
- }
-}} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/draft-04/schema b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/draft-04/schema
deleted file mode 100644
index 85eb502a68..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/draft-04/schema
+++ /dev/null
@@ -1,150 +0,0 @@
-{
- "id": "http://json-schema.org/draft-04/schema#",
- "$schema": "http://json-schema.org/draft-04/schema#",
- "description": "Core schema meta-schema",
- "definitions": {
- "schemaArray": {
- "type": "array",
- "minItems": 1,
- "items": { "$ref": "#" }
- },
- "positiveInteger": {
- "type": "integer",
- "minimum": 0
- },
- "positiveIntegerDefault0": {
- "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
- },
- "simpleTypes": {
- "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
- },
- "stringArray": {
- "type": "array",
- "items": { "type": "string" },
- "minItems": 1,
- "uniqueItems": true
- }
- },
- "type": "object",
- "properties": {
- "id": {
- "type": "string",
- "format": "uri"
- },
- "$schema": {
- "type": "string",
- "format": "uri"
- },
- "title": {
- "type": "string"
- },
- "description": {
- "type": "string"
- },
- "default": {},
- "multipleOf": {
- "type": "number",
- "minimum": 0,
- "exclusiveMinimum": true
- },
- "maximum": {
- "type": "number"
- },
- "exclusiveMaximum": {
- "type": "boolean",
- "default": false
- },
- "minimum": {
- "type": "number"
- },
- "exclusiveMinimum": {
- "type": "boolean",
- "default": false
- },
- "maxLength": { "$ref": "#/definitions/positiveInteger" },
- "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "pattern": {
- "type": "string",
- "format": "regex"
- },
- "additionalItems": {
- "anyOf": [
- { "type": "boolean" },
- { "$ref": "#" }
- ],
- "default": {}
- },
- "items": {
- "anyOf": [
- { "$ref": "#" },
- { "$ref": "#/definitions/schemaArray" }
- ],
- "default": {}
- },
- "maxItems": { "$ref": "#/definitions/positiveInteger" },
- "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "uniqueItems": {
- "type": "boolean",
- "default": false
- },
- "maxProperties": { "$ref": "#/definitions/positiveInteger" },
- "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
- "required": { "$ref": "#/definitions/stringArray" },
- "additionalProperties": {
- "anyOf": [
- { "type": "boolean" },
- { "$ref": "#" }
- ],
- "default": {}
- },
- "definitions": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "properties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "patternProperties": {
- "type": "object",
- "additionalProperties": { "$ref": "#" },
- "default": {}
- },
- "dependencies": {
- "type": "object",
- "additionalProperties": {
- "anyOf": [
- { "$ref": "#" },
- { "$ref": "#/definitions/stringArray" }
- ]
- }
- },
- "enum": {
- "type": "array",
- "minItems": 1,
- "uniqueItems": true
- },
- "type": {
- "anyOf": [
- { "$ref": "#/definitions/simpleTypes" },
- {
- "type": "array",
- "items": { "$ref": "#/definitions/simpleTypes" },
- "minItems": 1,
- "uniqueItems": true
- }
- ]
- },
- "allOf": { "$ref": "#/definitions/schemaArray" },
- "anyOf": { "$ref": "#/definitions/schemaArray" },
- "oneOf": { "$ref": "#/definitions/schemaArray" },
- "not": { "$ref": "#" }
- },
- "dependencies": {
- "exclusiveMaximum": [ "maximum" ],
- "exclusiveMinimum": [ "minimum" ]
- },
- "default": {}
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16be.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16be.json
deleted file mode 100644
index e46dbfb9dd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16be.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16bebom.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16bebom.json
deleted file mode 100644
index 0a23ae205c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16bebom.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16le.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16le.json
deleted file mode 100644
index 92d504530c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16le.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16lebom.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16lebom.json
deleted file mode 100644
index eaba00132c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf16lebom.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32be.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32be.json
deleted file mode 100644
index 9cbb522279..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32be.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32bebom.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32bebom.json
deleted file mode 100644
index bde6a99ab4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32bebom.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32le.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32le.json
deleted file mode 100644
index b00f290a64..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32le.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32lebom.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32lebom.json
deleted file mode 100644
index d3db39bf73..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf32lebom.json
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8.json
deleted file mode 100644
index 1e27ece50e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "en":"I can eat glass and it doesn't hurt me.",
- "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。",
- "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。",
- "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãã‚Œã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。",
- "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ ì•Šì•„ìš”"
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8bom.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8bom.json
deleted file mode 100644
index 07e81e1052..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/encodings/utf8bom.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "en":"I can eat glass and it doesn't hurt me.",
- "zh-Hant":"我能åžä¸‹çŽ»ç’ƒè€Œä¸å‚·èº«é«”。",
- "zh-Hans":"我能åžä¸‹çŽ»ç’ƒè€Œä¸ä¼¤èº«ä½“。",
- "ja":"ç§ã¯ã‚¬ãƒ©ã‚¹ã‚’食ã¹ã‚‰ã‚Œã¾ã™ã€‚ãã‚Œã¯ç§ã‚’å‚·ã¤ã‘ã¾ã›ã‚“。",
- "ko":"나는 유리를 ë¨¹ì„ ìˆ˜ 있어요. ê·¸ëž˜ë„ ì•„í”„ì§€ ì•Šì•„ìš”"
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail1.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail1.json
deleted file mode 100644
index 6216b865f1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail1.json
+++ /dev/null
@@ -1 +0,0 @@
-"A JSON payload should be an object or array, not a string." \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail10.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail10.json
deleted file mode 100644
index 5d8c0047bd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail10.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra value after close": true} "misplaced quoted value" \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail11.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail11.json
deleted file mode 100644
index 76eb95b458..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail11.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal expression": 1 + 2} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail12.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail12.json
deleted file mode 100644
index 77580a4522..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail12.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Illegal invocation": alert()} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail13.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail13.json
deleted file mode 100644
index 379406b59b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail13.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot have leading zeroes": 013} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail14.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail14.json
deleted file mode 100644
index 0ed366b38a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail14.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Numbers cannot be hex": 0x14} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail15.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail15.json
deleted file mode 100644
index fc8376b605..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail15.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \x15"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail16.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail16.json
deleted file mode 100644
index 3fe21d4b53..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail16.json
+++ /dev/null
@@ -1 +0,0 @@
-[\naked] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail17.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail17.json
deleted file mode 100644
index 62b9214aed..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail17.json
+++ /dev/null
@@ -1 +0,0 @@
-["Illegal backslash escape: \017"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail18.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail18.json
deleted file mode 100644
index edac92716f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail18.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[[["Too deep"]]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail19.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail19.json
deleted file mode 100644
index 3b9c46fa9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail19.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Missing colon" null} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail2.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail2.json
deleted file mode 100644
index 6b7c11e5a5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail2.json
+++ /dev/null
@@ -1 +0,0 @@
-["Unclosed array" \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail20.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail20.json
deleted file mode 100644
index 27c1af3e72..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail20.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Double colon":: null} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail21.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail21.json
deleted file mode 100644
index 62474573b2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail21.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Comma instead of colon", null} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail22.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail22.json
deleted file mode 100644
index a7752581bc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail22.json
+++ /dev/null
@@ -1 +0,0 @@
-["Colon instead of comma": false] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail23.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail23.json
deleted file mode 100644
index 494add1ca1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail23.json
+++ /dev/null
@@ -1 +0,0 @@
-["Bad value", truth] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail24.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail24.json
deleted file mode 100644
index caff239bfc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail24.json
+++ /dev/null
@@ -1 +0,0 @@
-['single quote'] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail25.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail25.json
deleted file mode 100644
index 8b7ad23e01..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail25.json
+++ /dev/null
@@ -1 +0,0 @@
-[" tab character in string "] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail26.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail26.json
deleted file mode 100644
index 845d26a6a5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail26.json
+++ /dev/null
@@ -1 +0,0 @@
-["tab\ character\ in\ string\ "] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail27.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail27.json
deleted file mode 100644
index 6b01a2ca4a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail27.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line
-break"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail28.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail28.json
deleted file mode 100644
index 621a0101c6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail28.json
+++ /dev/null
@@ -1,2 +0,0 @@
-["line\
-break"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail29.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail29.json
deleted file mode 100644
index 47ec421bb6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail29.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail3.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail3.json
deleted file mode 100644
index 168c81eb78..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail3.json
+++ /dev/null
@@ -1 +0,0 @@
-{unquoted_key: "keys must be quoted"} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail30.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail30.json
deleted file mode 100644
index 8ab0bc4b8b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail30.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e+] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail31.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail31.json
deleted file mode 100644
index 1cce602b51..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail31.json
+++ /dev/null
@@ -1 +0,0 @@
-[0e+-1] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail32.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail32.json
deleted file mode 100644
index 45cba7396f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail32.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Comma instead if closing brace": true, \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail33.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail33.json
deleted file mode 100644
index ca5eb19dc9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail33.json
+++ /dev/null
@@ -1 +0,0 @@
-["mismatch"} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail4.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail4.json
deleted file mode 100644
index 9de168bf34..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail4.json
+++ /dev/null
@@ -1 +0,0 @@
-["extra comma",] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail5.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail5.json
deleted file mode 100644
index ddf3ce3d24..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail5.json
+++ /dev/null
@@ -1 +0,0 @@
-["double extra comma",,] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail6.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail6.json
deleted file mode 100644
index ed91580e1b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail6.json
+++ /dev/null
@@ -1 +0,0 @@
-[ , "<-- missing value"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail7.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail7.json
deleted file mode 100644
index 8a96af3e4e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail7.json
+++ /dev/null
@@ -1 +0,0 @@
-["Comma after the close"], \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail8.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail8.json
deleted file mode 100644
index b28479c6ec..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail8.json
+++ /dev/null
@@ -1 +0,0 @@
-["Extra close"]] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail9.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail9.json
deleted file mode 100644
index 5815574f36..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/fail9.json
+++ /dev/null
@@ -1 +0,0 @@
-{"Extra comma": true,} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass1.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass1.json
deleted file mode 100644
index 70e2685436..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass1.json
+++ /dev/null
@@ -1,58 +0,0 @@
-[
- "JSON Test Pattern pass1",
- {"object with 1 member":["array with 1 element"]},
- {},
- [],
- -42,
- true,
- false,
- null,
- {
- "integer": 1234567890,
- "real": -9876.543210,
- "e": 0.123456789e-12,
- "E": 1.234567890E+34,
- "": 23456789012E66,
- "zero": 0,
- "one": 1,
- "space": " ",
- "quote": "\"",
- "backslash": "\\",
- "controls": "\b\f\n\r\t",
- "slash": "/ & \/",
- "alpha": "abcdefghijklmnopqrstuvwyz",
- "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ",
- "digit": "0123456789",
- "0123456789": "digit",
- "special": "`1~!@#$%^&*()_+-={':[,]}|;.</>?",
- "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A",
- "true": true,
- "false": false,
- "null": null,
- "array":[ ],
- "object":{ },
- "address": "50 St. James Street",
- "url": "http://www.JSON.org/",
- "comment": "// /* <!-- --",
- "# -- --> */": " ",
- " s p a c e d " :[1,2 , 3
-
-,
-
-4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7],
- "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}",
- "quotes": "&#34; \u0022 %22 0x22 034 &#x22;",
- "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?"
-: "A key can be any string"
- },
- 0.5 ,98.6
-,
-99.44
-,
-
-1066,
-1e1,
-0.1e1,
-1e-1,
-1e00,2e+00,2e-00
-,"rosebud"] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass2.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass2.json
deleted file mode 100644
index d3c63c7ad8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass2.json
+++ /dev/null
@@ -1 +0,0 @@
-[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass3.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass3.json
deleted file mode 100644
index 4528d51f1a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/pass3.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
- "JSON Test Pattern pass3": {
- "The outermost value": "must be an object or array.",
- "In this test": "It is an object."
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/readme.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/readme.txt
deleted file mode 100644
index 321d89d998..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonchecker/readme.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Test suite from http://json.org/JSON_checker/.
-
-If the JSON_checker is working correctly, it must accept all of the pass*.json files and reject all of the fail*.json files.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/LICENSE b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/LICENSE
deleted file mode 100644
index c28adbadd9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/LICENSE
+++ /dev/null
@@ -1,19 +0,0 @@
-Copyright (c) 2012 Julian Berman
-
-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.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/README.md b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/README.md
deleted file mode 100644
index 6d9da94932..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/README.md
+++ /dev/null
@@ -1,148 +0,0 @@
-JSON Schema Test Suite [![Build Status](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite.png?branch=develop)](https://travis-ci.org/json-schema/JSON-Schema-Test-Suite)
-======================
-
-This repository contains a set of JSON objects that implementors of JSON Schema
-validation libraries can use to test their validators.
-
-It is meant to be language agnostic and should require only a JSON parser.
-
-The conversion of the JSON objects into tests within your test framework of
-choice is still the job of the validator implementor.
-
-Structure of a Test
--------------------
-
-If you're going to use this suite, you need to know how tests are laid out. The
-tests are contained in the `tests` directory at the root of this repository.
-
-Inside that directory is a subdirectory for each draft or version of the
-schema. We'll use `draft3` as an example.
-
-If you look inside the draft directory, there are a number of `.json` files,
-which logically group a set of test cases together. Often the grouping is by
-property under test, but not always, especially within optional test files
-(discussed below).
-
-Inside each `.json` file is a single array containing objects. It's easiest to
-illustrate the structure of these with an example:
-
-```json
- {
- "description": "the description of the test case",
- "schema": {"the schema that should" : "be validated against"},
- "tests": [
- {
- "description": "a specific test of a valid instance",
- "data": "the instance",
- "valid": true
- },
- {
- "description": "another specific test this time, invalid",
- "data": 15,
- "valid": false
- }
- ]
- }
-```
-
-So a description, a schema, and some tests, where tests is an array containing
-one or more objects with descriptions, data, and a boolean indicating whether
-they should be valid or invalid.
-
-Coverage
---------
-
-Draft 3 and 4 should have full coverage. If you see anything missing or think
-there is a useful test missing, please send a pull request or open an issue.
-
-Who Uses the Test Suite
------------------------
-
-This suite is being used by:
-
-### Coffeescript ###
-
-* [jsck](https://github.com/pandastrike/jsck)
-
-### Dart ###
-
-* [json_schema](https://github.com/patefacio/json_schema)
-
-### Erlang ###
-
-* [jesse](https://github.com/klarna/jesse)
-
-### Go ###
-
-* [gojsonschema](https://github.com/sigu-399/gojsonschema)
-* [validate-json](https://github.com/cesanta/validate-json)
-
-### Haskell ###
-
-* [aeson-schema](https://github.com/timjb/aeson-schema)
-* [hjsonschema](https://github.com/seagreen/hjsonschema)
-
-### Java ###
-
-* [json-schema-validator](https://github.com/fge/json-schema-validator)
-
-### JavaScript ###
-
-* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)
-* [direct-schema](https://github.com/IreneKnapp/direct-schema)
-* [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid)
-* [jassi](https://github.com/iclanzan/jassi)
-* [JaySchema](https://github.com/natesilva/jayschema)
-* [json-schema-valid](https://github.com/ericgj/json-schema-valid)
-* [Jsonary](https://github.com/jsonary-js/jsonary)
-* [jsonschema](https://github.com/tdegrunt/jsonschema)
-* [request-validator](https://github.com/bugventure/request-validator)
-* [skeemas](https://github.com/Prestaul/skeemas)
-* [tv4](https://github.com/geraintluff/tv4)
-* [z-schema](https://github.com/zaggino/z-schema)
-* [jsen](https://github.com/bugventure/jsen)
-* [ajv](https://github.com/epoberezkin/ajv)
-
-### Node.js ###
-
-The JSON Schema Test Suite is also available as an
-[npm](https://www.npmjs.com/package/json-schema-test-suite) package.
-Node-specific support is maintained on the [node branch](https://github.com/json-schema/JSON-Schema-Test-Suite/tree/node).
-See [NODE-README.md](https://github.com/json-schema/JSON-Schema-Test-Suite/blob/node/NODE-README.md)
-for more information.
-
-### .NET ###
-
-* [Newtonsoft.Json.Schema](https://github.com/JamesNK/Newtonsoft.Json.Schema)
-
-### PHP ###
-
-* [json-schema](https://github.com/justinrainbow/json-schema)
-
-### Python ###
-
-* [jsonschema](https://github.com/Julian/jsonschema)
-
-### Ruby ###
-
-* [json-schema](https://github.com/hoxworth/json-schema)
-
-### Rust ###
-
-* [valico](https://github.com/rustless/valico)
-
-### Swift ###
-
-* [JSONSchema](https://github.com/kylef/JSONSchema.swift)
-
-If you use it as well, please fork and send a pull request adding yourself to
-the list :).
-
-Contributing
-------------
-
-If you see something missing or incorrect, a pull request is most welcome!
-
-There are some sanity checks in place for testing the test suite. You can run
-them with `bin/jsonschema_suite check` or `tox`. They will be run automatically by
-[Travis CI](https://travis-ci.org/) as well.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/bin/jsonschema_suite b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/bin/jsonschema_suite
deleted file mode 100755
index 96108c86ba..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/bin/jsonschema_suite
+++ /dev/null
@@ -1,283 +0,0 @@
-#! /usr/bin/env python
-from __future__ import print_function
-import sys
-import textwrap
-
-try:
- import argparse
-except ImportError:
- print(textwrap.dedent("""
- The argparse library could not be imported. jsonschema_suite requires
- either Python 2.7 or for you to install argparse. You can do so by
- running `pip install argparse`, `easy_install argparse` or by
- downloading argparse and running `python2.6 setup.py install`.
-
- See https://pypi.python.org/pypi/argparse for details.
- """.strip("\n")))
- sys.exit(1)
-
-import errno
-import fnmatch
-import json
-import os
-import random
-import shutil
-import unittest
-import warnings
-
-if getattr(unittest, "skipIf", None) is None:
- unittest.skipIf = lambda cond, msg : lambda fn : fn
-
-try:
- import jsonschema
-except ImportError:
- jsonschema = None
-else:
- validators = getattr(
- jsonschema.validators, "validators", jsonschema.validators
- )
-
-
-ROOT_DIR = os.path.join(
- os.path.dirname(__file__), os.pardir).rstrip("__pycache__")
-SUITE_ROOT_DIR = os.path.join(ROOT_DIR, "tests")
-
-REMOTES = {
- "integer.json": {"type": "integer"},
- "subSchemas.json": {
- "integer": {"type": "integer"},
- "refToInteger": {"$ref": "#/integer"},
- },
- "folder/folderInteger.json": {"type": "integer"}
-}
-REMOTES_DIR = os.path.join(ROOT_DIR, "remotes")
-
-TESTSUITE_SCHEMA = {
- "$schema": "http://json-schema.org/draft-03/schema#",
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "description": {"type": "string", "required": True},
- "schema": {"required": True},
- "tests": {
- "type": "array",
- "items": {
- "type": "object",
- "properties": {
- "description": {"type": "string", "required": True},
- "data": {"required": True},
- "valid": {"type": "boolean", "required": True}
- },
- "additionalProperties": False
- },
- "minItems": 1
- }
- },
- "additionalProperties": False,
- "minItems": 1
- }
-}
-
-
-def files(paths):
- for path in paths:
- with open(path) as test_file:
- yield json.load(test_file)
-
-
-def groups(paths):
- for test_file in files(paths):
- for group in test_file:
- yield group
-
-
-def cases(paths):
- for test_group in groups(paths):
- for test in test_group["tests"]:
- test["schema"] = test_group["schema"]
- yield test
-
-
-def collect(root_dir):
- for root, dirs, files in os.walk(root_dir):
- for filename in fnmatch.filter(files, "*.json"):
- yield os.path.join(root, filename)
-
-
-class SanityTests(unittest.TestCase):
- @classmethod
- def setUpClass(cls):
- print("Looking for tests in %s" % SUITE_ROOT_DIR)
- cls.test_files = list(collect(SUITE_ROOT_DIR))
- print("Found %s test files" % len(cls.test_files))
- assert cls.test_files, "Didn't find the test files!"
-
- def test_all_files_are_valid_json(self):
- for path in self.test_files:
- with open(path) as test_file:
- try:
- json.load(test_file)
- except ValueError as error:
- self.fail("%s contains invalid JSON (%s)" % (path, error))
-
- def test_all_descriptions_have_reasonable_length(self):
- for case in cases(self.test_files):
- descript = case["description"]
- self.assertLess(
- len(descript),
- 60,
- "%r is too long! (keep it to less than 60 chars)" % (descript,)
- )
-
- def test_all_descriptions_are_unique(self):
- for group in groups(self.test_files):
- descriptions = set(test["description"] for test in group["tests"])
- self.assertEqual(
- len(descriptions),
- len(group["tests"]),
- "%r contains a duplicate description" % (group,)
- )
-
- @unittest.skipIf(jsonschema is None, "Validation library not present!")
- def test_all_schemas_are_valid(self):
- for schema in os.listdir(SUITE_ROOT_DIR):
- schema_validator = validators.get(schema)
- if schema_validator is not None:
- test_files = collect(os.path.join(SUITE_ROOT_DIR, schema))
- for case in cases(test_files):
- try:
- schema_validator.check_schema(case["schema"])
- except jsonschema.SchemaError as error:
- self.fail("%s contains an invalid schema (%s)" %
- (case, error))
- else:
- warnings.warn("No schema validator for %s" % schema)
-
- @unittest.skipIf(jsonschema is None, "Validation library not present!")
- def test_suites_are_valid(self):
- validator = jsonschema.Draft3Validator(TESTSUITE_SCHEMA)
- for tests in files(self.test_files):
- try:
- validator.validate(tests)
- except jsonschema.ValidationError as error:
- self.fail(str(error))
-
- def test_remote_schemas_are_updated(self):
- for url, schema in REMOTES.items():
- filepath = os.path.join(REMOTES_DIR, url)
- with open(filepath) as schema_file:
- self.assertEqual(json.load(schema_file), schema)
-
-
-def main(arguments):
- if arguments.command == "check":
- suite = unittest.TestLoader().loadTestsFromTestCase(SanityTests)
- result = unittest.TextTestRunner(verbosity=2).run(suite)
- sys.exit(not result.wasSuccessful())
- elif arguments.command == "flatten":
- selected_cases = [case for case in cases(collect(arguments.version))]
-
- if arguments.randomize:
- random.shuffle(selected_cases)
-
- json.dump(selected_cases, sys.stdout, indent=4, sort_keys=True)
- elif arguments.command == "remotes":
- json.dump(REMOTES, sys.stdout, indent=4, sort_keys=True)
- elif arguments.command == "dump_remotes":
- if arguments.update:
- shutil.rmtree(arguments.out_dir, ignore_errors=True)
-
- try:
- os.makedirs(arguments.out_dir)
- except OSError as e:
- if e.errno == errno.EEXIST:
- print("%s already exists. Aborting." % arguments.out_dir)
- sys.exit(1)
- raise
-
- for url, schema in REMOTES.items():
- filepath = os.path.join(arguments.out_dir, url)
-
- try:
- os.makedirs(os.path.dirname(filepath))
- except OSError as e:
- if e.errno != errno.EEXIST:
- raise
-
- with open(filepath, "wb") as out_file:
- json.dump(schema, out_file, indent=4, sort_keys=True)
- elif arguments.command == "serve":
- try:
- from flask import Flask, jsonify
- except ImportError:
- print(textwrap.dedent("""
- The Flask library is required to serve the remote schemas.
-
- You can install it by running `pip install Flask`.
-
- Alternatively, see the `jsonschema_suite remotes` or
- `jsonschema_suite dump_remotes` commands to create static files
- that can be served with your own web server.
- """.strip("\n")))
- sys.exit(1)
-
- app = Flask(__name__)
-
- @app.route("/<path:path>")
- def serve_path(path):
- if path in REMOTES:
- return jsonify(REMOTES[path])
- return "Document does not exist.", 404
-
- app.run(port=1234)
-
-
-parser = argparse.ArgumentParser(
- description="JSON Schema Test Suite utilities",
-)
-subparsers = parser.add_subparsers(help="utility commands", dest="command")
-
-check = subparsers.add_parser("check", help="Sanity check the test suite.")
-
-flatten = subparsers.add_parser(
- "flatten",
- help="Output a flattened file containing a selected version's test cases."
-)
-flatten.add_argument(
- "--randomize",
- action="store_true",
- help="Randomize the order of the outputted cases.",
-)
-flatten.add_argument(
- "version", help="The directory containing the version to output",
-)
-
-remotes = subparsers.add_parser(
- "remotes",
- help="Output the expected URLs and their associated schemas for remote "
- "ref tests as a JSON object."
-)
-
-dump_remotes = subparsers.add_parser(
- "dump_remotes", help="Dump the remote ref schemas into a file tree",
-)
-dump_remotes.add_argument(
- "--update",
- action="store_true",
- help="Update the remotes in an existing directory.",
-)
-dump_remotes.add_argument(
- "--out-dir",
- default=REMOTES_DIR,
- type=os.path.abspath,
- help="The output directory to create as the root of the file tree",
-)
-
-serve = subparsers.add_parser(
- "serve",
- help="Start a webserver to serve schemas used by remote ref tests."
-)
-
-if __name__ == "__main__":
- main(parser.parse_args())
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json
deleted file mode 100644
index dbe5c758ee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/folder/folderInteger.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "type": "integer"
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/integer.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/integer.json
deleted file mode 100644
index dbe5c758ee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/integer.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "type": "integer"
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/subSchemas.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/subSchemas.json
deleted file mode 100644
index 8b6d8f842f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/remotes/subSchemas.json
+++ /dev/null
@@ -1,8 +0,0 @@
-{
- "integer": {
- "type": "integer"
- },
- "refToInteger": {
- "$ref": "#/integer"
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json
deleted file mode 100644
index 6d4bff51cf..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalItems.json
+++ /dev/null
@@ -1,82 +0,0 @@
-[
- {
- "description": "additionalItems as schema",
- "schema": {
- "items": [],
- "additionalItems": {"type": "integer"}
- },
- "tests": [
- {
- "description": "additional items match schema",
- "data": [ 1, 2, 3, 4 ],
- "valid": true
- },
- {
- "description": "additional items do not match schema",
- "data": [ 1, 2, 3, "foo" ],
- "valid": false
- }
- ]
- },
- {
- "description": "items is schema, no additionalItems",
- "schema": {
- "items": {},
- "additionalItems": false
- },
- "tests": [
- {
- "description": "all items match schema",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- }
- ]
- },
- {
- "description": "array of items with no additionalItems",
- "schema": {
- "items": [{}, {}, {}],
- "additionalItems": false
- },
- "tests": [
- {
- "description": "no additional items present",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "additional items are not permitted",
- "data": [ 1, 2, 3, 4 ],
- "valid": false
- }
- ]
- },
- {
- "description": "additionalItems as false without items",
- "schema": {"additionalItems": false},
- "tests": [
- {
- "description":
- "items defaults to empty schema so everything is valid",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "additionalItems are allowed by default",
- "schema": {"items": []},
- "tests": [
- {
- "description": "only the first items are validated",
- "data": [1, "foo", false],
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json
deleted file mode 100644
index 40831f9e9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/additionalProperties.json
+++ /dev/null
@@ -1,88 +0,0 @@
-[
- {
- "description":
- "additionalProperties being false does not allow other properties",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "patternProperties": { "^v": {} },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": [1, 2, 3],
- "valid": true
- },
- {
- "description": "patternProperties are not additional properties",
- "data": {"foo":1, "vroom": 2},
- "valid": true
- }
- ]
- },
- {
- "description":
- "additionalProperties allows a schema which should validate",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : 1, "bar" : 2, "quux" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : 12},
- "valid": false
- }
- ]
- },
- {
- "description":
- "additionalProperties can exist by itself",
- "schema": {
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1},
- "valid": false
- }
- ]
- },
- {
- "description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
- "tests": [
- {
- "description": "additional properties are allowed",
- "data": {"foo": 1, "bar": 2, "quux": true},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/default.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/default.json
deleted file mode 100644
index 17629779fb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/default.json
+++ /dev/null
@@ -1,49 +0,0 @@
-[
- {
- "description": "invalid type for default",
- "schema": {
- "properties": {
- "foo": {
- "type": "integer",
- "default": []
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"foo": 13},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- },
- {
- "description": "invalid string value for default",
- "schema": {
- "properties": {
- "bar": {
- "type": "string",
- "minLength": 4,
- "default": "bad"
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"bar": "good"},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/dependencies.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/dependencies.json
deleted file mode 100644
index 2f6ae489ae..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/dependencies.json
+++ /dev/null
@@ -1,108 +0,0 @@
-[
- {
- "description": "dependencies",
- "schema": {
- "dependencies": {"bar": "foo"}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependant",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "with dependency",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "multiple dependencies",
- "schema": {
- "dependencies": {"quux": ["foo", "bar"]}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependants",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "with dependencies",
- "data": {"foo": 1, "bar": 2, "quux": 3},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"foo": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing other dependency",
- "data": {"bar": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing both dependencies",
- "data": {"quux": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "multiple dependencies subschema",
- "schema": {
- "dependencies": {
- "bar": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "integer"}
- }
- }
- }
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "wrong type",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "wrong type other",
- "data": {"foo": 2, "bar": "quux"},
- "valid": false
- },
- {
- "description": "wrong type both",
- "data": {"foo": "quux", "bar": "quux"},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/disallow.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/disallow.json
deleted file mode 100644
index a5c9d90cce..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/disallow.json
+++ /dev/null
@@ -1,80 +0,0 @@
-[
- {
- "description": "disallow",
- "schema": {
- "disallow": "integer"
- },
- "tests": [
- {
- "description": "allowed",
- "data": "foo",
- "valid": true
- },
- {
- "description": "disallowed",
- "data": 1,
- "valid": false
- }
- ]
- },
- {
- "description": "multiple disallow",
- "schema": {
- "disallow": ["integer", "boolean"]
- },
- "tests": [
- {
- "description": "valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "mismatch",
- "data": 1,
- "valid": false
- },
- {
- "description": "other mismatch",
- "data": true,
- "valid": false
- }
- ]
- },
- {
- "description": "multiple disallow subschema",
- "schema": {
- "disallow":
- ["string",
- {
- "type": "object",
- "properties": {
- "foo": {
- "type": "string"
- }
- }
- }]
- },
- "tests": [
- {
- "description": "match",
- "data": 1,
- "valid": true
- },
- {
- "description": "other match",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": "foo",
- "valid": false
- },
- {
- "description": "other mismatch",
- "data": {"foo": "bar"},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json
deleted file mode 100644
index ef7cc14890..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/divisibleBy.json
+++ /dev/null
@@ -1,60 +0,0 @@
-[
- {
- "description": "by int",
- "schema": {"divisibleBy": 2},
- "tests": [
- {
- "description": "int by int",
- "data": 10,
- "valid": true
- },
- {
- "description": "int by int fail",
- "data": 7,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "by number",
- "schema": {"divisibleBy": 1.5},
- "tests": [
- {
- "description": "zero is divisible by anything (except 0)",
- "data": 0,
- "valid": true
- },
- {
- "description": "4.5 is divisible by 1.5",
- "data": 4.5,
- "valid": true
- },
- {
- "description": "35 is not divisible by 1.5",
- "data": 35,
- "valid": false
- }
- ]
- },
- {
- "description": "by small number",
- "schema": {"divisibleBy": 0.0001},
- "tests": [
- {
- "description": "0.0075 is divisible by 0.0001",
- "data": 0.0075,
- "valid": true
- },
- {
- "description": "0.00751 is not divisible by 0.0001",
- "data": 0.00751,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/enum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/enum.json
deleted file mode 100644
index 0c83f0804d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/enum.json
+++ /dev/null
@@ -1,71 +0,0 @@
-[
- {
- "description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": 4,
- "valid": false
- }
- ]
- },
- {
- "description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": [],
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": null,
- "valid": false
- },
- {
- "description": "objects are deep compared",
- "data": {"foo": false},
- "valid": false
- }
- ]
- },
- {
- "description": "enums in properties",
- "schema": {
- "type":"object",
- "properties": {
- "foo": {"enum":["foo"]},
- "bar": {"enum":["bar"], "required":true}
- }
- },
- "tests": [
- {
- "description": "both properties are valid",
- "data": {"foo":"foo", "bar":"bar"},
- "valid": true
- },
- {
- "description": "missing optional property is valid",
- "data": {"bar":"bar"},
- "valid": true
- },
- {
- "description": "missing required property is invalid",
- "data": {"foo":"foo"},
- "valid": false
- },
- {
- "description": "missing all properties is invalid",
- "data": {},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/extends.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/extends.json
deleted file mode 100644
index 909bce575a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/extends.json
+++ /dev/null
@@ -1,94 +0,0 @@
-[
- {
- "description": "extends",
- "schema": {
- "properties": {"bar": {"type": "integer", "required": true}},
- "extends": {
- "properties": {
- "foo": {"type": "string", "required": true}
- }
- }
- },
- "tests": [
- {
- "description": "extends",
- "data": {"foo": "baz", "bar": 2},
- "valid": true
- },
- {
- "description": "mismatch extends",
- "data": {"foo": "baz"},
- "valid": false
- },
- {
- "description": "mismatch extended",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "wrong type",
- "data": {"foo": "baz", "bar": "quux"},
- "valid": false
- }
- ]
- },
- {
- "description": "multiple extends",
- "schema": {
- "properties": {"bar": {"type": "integer", "required": true}},
- "extends" : [
- {
- "properties": {
- "foo": {"type": "string", "required": true}
- }
- },
- {
- "properties": {
- "baz": {"type": "null", "required": true}
- }
- }
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": "quux", "bar": 2, "baz": null},
- "valid": true
- },
- {
- "description": "mismatch first extends",
- "data": {"bar": 2, "baz": null},
- "valid": false
- },
- {
- "description": "mismatch second extends",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "mismatch both",
- "data": {"bar": 2},
- "valid": false
- }
- ]
- },
- {
- "description": "extends simple types",
- "schema": {
- "minimum": 20,
- "extends": {"maximum": 30}
- },
- "tests": [
- {
- "description": "valid",
- "data": 25,
- "valid": true
- },
- {
- "description": "mismatch extends",
- "data": 35,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/items.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/items.json
deleted file mode 100644
index f5e18a1384..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/items.json
+++ /dev/null
@@ -1,46 +0,0 @@
-[
- {
- "description": "a schema given for items",
- "schema": {
- "items": {"type": "integer"}
- },
- "tests": [
- {
- "description": "valid items",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "wrong type of items",
- "data": [1, "x"],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "an array of schemas for items",
- "schema": {
- "items": [
- {"type": "integer"},
- {"type": "string"}
- ]
- },
- "tests": [
- {
- "description": "correct types",
- "data": [ 1, "foo" ],
- "valid": true
- },
- {
- "description": "wrong types",
- "data": [ "foo", 1 ],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxItems.json
deleted file mode 100644
index 3b53a6b371..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxItems validation",
- "schema": {"maxItems": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": [1, 2, 3],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "foobar",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxLength.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxLength.json
deleted file mode 100644
index 4de42bcaba..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maxLength.json
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "description": "maxLength validation",
- "schema": {"maxLength": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": "f",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": "foo",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 10,
- "valid": true
- },
- {
- "description": "two supplementary Unicode code points is long enough",
- "data": "\uD83D\uDCA9\uD83D\uDCA9",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maximum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maximum.json
deleted file mode 100644
index 86c7b89c9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/maximum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "maximum validation",
- "schema": {"maximum": 3.0},
- "tests": [
- {
- "description": "below the maximum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "above the maximum is invalid",
- "data": 3.5,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMaximum validation",
- "schema": {
- "maximum": 3.0,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "below the maximum is still valid",
- "data": 2.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 3.0,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minItems.json
deleted file mode 100644
index ed5118815e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minItems validation",
- "schema": {"minItems": 1},
- "tests": [
- {
- "description": "longer is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minLength.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minLength.json
deleted file mode 100644
index 3f09158dee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minLength.json
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "description": "minLength validation",
- "schema": {"minLength": 2},
- "tests": [
- {
- "description": "longer is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": "f",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 1,
- "valid": true
- },
- {
- "description": "one supplementary Unicode code point is not long enough",
- "data": "\uD83D\uDCA9",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minimum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minimum.json
deleted file mode 100644
index d5bf000bcc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/minimum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "minimum validation",
- "schema": {"minimum": 1.1},
- "tests": [
- {
- "description": "above the minimum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "below the minimum is invalid",
- "data": 0.6,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMinimum validation",
- "schema": {
- "minimum": 1.1,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "above the minimum is still valid",
- "data": 1.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 1.1,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json
deleted file mode 100644
index ccc7c17fe8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/bignum.json
+++ /dev/null
@@ -1,107 +0,0 @@
-[
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a bignum is an integer",
- "data": 12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a bignum is a number",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a negative bignum is an integer",
- "data": -12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a negative bignum is a number",
- "data": -98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "string",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "a bignum is not a string",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"maximum": 18446744073709551615},
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision",
- "schema": {
- "maximum": 972783798187987123879878123.18878137,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"minimum": -18446744073709551615},
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision on negative numbers",
- "schema": {
- "minimum": -972783798187987123879878123.18878137,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/format.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/format.json
deleted file mode 100644
index 3ca7319dda..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/format.json
+++ /dev/null
@@ -1,222 +0,0 @@
-[
- {
- "description": "validation of regular expressions",
- "schema": {"format": "regex"},
- "tests": [
- {
- "description": "a valid regular expression",
- "data": "([abc])+\\s+$",
- "valid": true
- },
- {
- "description": "a regular expression with unclosed parens is invalid",
- "data": "^(abc]",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of date-time strings",
- "schema": {"format": "date-time"},
- "tests": [
- {
- "description": "a valid date-time string",
- "data": "1963-06-19T08:30:06.283185Z",
- "valid": true
- },
- {
- "description": "an invalid date-time string",
- "data": "06/19/1963 08:30:06 PST",
- "valid": false
- },
- {
- "description": "only RFC3339 not all of ISO 8601 are valid",
- "data": "2013-350T01:01:01",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of date strings",
- "schema": {"format": "date"},
- "tests": [
- {
- "description": "a valid date string",
- "data": "1963-06-19",
- "valid": true
- },
- {
- "description": "an invalid date string",
- "data": "06/19/1963",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of time strings",
- "schema": {"format": "time"},
- "tests": [
- {
- "description": "a valid time string",
- "data": "08:30:06",
- "valid": true
- },
- {
- "description": "an invalid time string",
- "data": "8:30 AM",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of URIs",
- "schema": {"format": "uri"},
- "tests": [
- {
- "description": "a valid URI",
- "data": "http://foo.bar/?baz=qux#quux",
- "valid": true
- },
- {
- "description": "a valid protocol-relative URI",
- "data": "//foo.bar/?baz=qux#quux",
- "valid": true
- },
- {
- "description": "an invalid URI",
- "data": "\\\\WINDOWS\\fileshare",
- "valid": false
- },
- {
- "description": "an invalid URI though valid URI reference",
- "data": "abc",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of e-mail addresses",
- "schema": {"format": "email"},
- "tests": [
- {
- "description": "a valid e-mail address",
- "data": "joe.bloggs@example.com",
- "valid": true
- },
- {
- "description": "an invalid e-mail address",
- "data": "2962",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IP addresses",
- "schema": {"format": "ip-address"},
- "tests": [
- {
- "description": "a valid IP address",
- "data": "192.168.0.1",
- "valid": true
- },
- {
- "description": "an IP address with too many components",
- "data": "127.0.0.0.1",
- "valid": false
- },
- {
- "description": "an IP address with out-of-range values",
- "data": "256.256.256.256",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IPv6 addresses",
- "schema": {"format": "ipv6"},
- "tests": [
- {
- "description": "a valid IPv6 address",
- "data": "::1",
- "valid": true
- },
- {
- "description": "an IPv6 address with out-of-range values",
- "data": "12345::",
- "valid": false
- },
- {
- "description": "an IPv6 address with too many components",
- "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
- "valid": false
- },
- {
- "description": "an IPv6 address containing illegal characters",
- "data": "::laptop",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of host names",
- "schema": {"format": "host-name"},
- "tests": [
- {
- "description": "a valid host name",
- "data": "www.example.com",
- "valid": true
- },
- {
- "description": "a host name starting with an illegal character",
- "data": "-a-host-name-that-starts-with--",
- "valid": false
- },
- {
- "description": "a host name containing illegal characters",
- "data": "not_a_valid_host_name",
- "valid": false
- },
- {
- "description": "a host name with a component too long",
- "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of CSS colors",
- "schema": {"format": "color"},
- "tests": [
- {
- "description": "a valid CSS color name",
- "data": "fuchsia",
- "valid": true
- },
- {
- "description": "a valid six-digit CSS color code",
- "data": "#CC8899",
- "valid": true
- },
- {
- "description": "a valid three-digit CSS color code",
- "data": "#C89",
- "valid": true
- },
- {
- "description": "an invalid CSS color code",
- "data": "#00332520",
- "valid": false
- },
- {
- "description": "an invalid CSS color name",
- "data": "puce",
- "valid": false
- },
- {
- "description": "a CSS color name containing invalid characters",
- "data": "light_grayish_red-violet",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json
deleted file mode 100644
index 03fe97724c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/jsregex.json
+++ /dev/null
@@ -1,18 +0,0 @@
-[
- {
- "description": "ECMA 262 regex dialect recognition",
- "schema": { "format": "regex" },
- "tests": [
- {
- "description": "[^] is a valid regex",
- "data": "[^]",
- "valid": true
- },
- {
- "description": "ECMA 262 has no support for lookbehind",
- "data": "(?<=foo)bar",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json
deleted file mode 100644
index 9b50ea2776..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/optional/zeroTerminatedFloats.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[
- {
- "description": "some languages do not distinguish between different types of numeric value",
- "schema": {
- "type": "integer"
- },
- "tests": [
- {
- "description": "a float is not an integer even without fractional part",
- "data": 1.0,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/pattern.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/pattern.json
deleted file mode 100644
index 25e7299731..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/pattern.json
+++ /dev/null
@@ -1,34 +0,0 @@
-[
- {
- "description": "pattern validation",
- "schema": {"pattern": "^a*$"},
- "tests": [
- {
- "description": "a matching pattern is valid",
- "data": "aaa",
- "valid": true
- },
- {
- "description": "a non-matching pattern is invalid",
- "data": "abc",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": true,
- "valid": true
- }
- ]
- },
- {
- "description": "pattern is not anchored",
- "schema": {"pattern": "a+"},
- "tests": [
- {
- "description": "matches a substring",
- "data": "xxaayy",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json
deleted file mode 100644
index 18586e5dab..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/patternProperties.json
+++ /dev/null
@@ -1,110 +0,0 @@
-[
- {
- "description":
- "patternProperties validates properties matching a regex",
- "schema": {
- "patternProperties": {
- "f.*o": {"type": "integer"}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "multiple valid matches is valid",
- "data": {"foo": 1, "foooooo" : 2},
- "valid": true
- },
- {
- "description": "a single invalid match is invalid",
- "data": {"foo": "bar", "fooooo": 2},
- "valid": false
- },
- {
- "description": "multiple invalid matches is invalid",
- "data": {"foo": "bar", "foooooo" : "baz"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": 12,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple simultaneous patternProperties are validated",
- "schema": {
- "patternProperties": {
- "a*": {"type": "integer"},
- "aaa*": {"maximum": 20}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"a": 21},
- "valid": true
- },
- {
- "description": "a simultaneous match is valid",
- "data": {"aaaa": 18},
- "valid": true
- },
- {
- "description": "multiple matches is valid",
- "data": {"a": 21, "aaaa": 18},
- "valid": true
- },
- {
- "description": "an invalid due to one is invalid",
- "data": {"a": "bar"},
- "valid": false
- },
- {
- "description": "an invalid due to the other is invalid",
- "data": {"aaaa": 31},
- "valid": false
- },
- {
- "description": "an invalid due to both is invalid",
- "data": {"aaa": "foo", "aaaa": 31},
- "valid": false
- }
- ]
- },
- {
- "description": "regexes are not anchored by default and are case sensitive",
- "schema": {
- "patternProperties": {
- "[0-9]{2,}": { "type": "boolean" },
- "X_": { "type": "string" }
- }
- },
- "tests": [
- {
- "description": "non recognized members are ignored",
- "data": { "answer 1": "42" },
- "valid": true
- },
- {
- "description": "recognized members are accounted for",
- "data": { "a31b": null },
- "valid": false
- },
- {
- "description": "regexes are case sensitive",
- "data": { "a_x_3": 3 },
- "valid": true
- },
- {
- "description": "regexes are case sensitive, 2",
- "data": { "a_X_3": 3 },
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/properties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/properties.json
deleted file mode 100644
index cd1644dcd9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/properties.json
+++ /dev/null
@@ -1,92 +0,0 @@
-[
- {
- "description": "object properties validation",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "string"}
- }
- },
- "tests": [
- {
- "description": "both properties present and valid is valid",
- "data": {"foo": 1, "bar": "baz"},
- "valid": true
- },
- {
- "description": "one property invalid is invalid",
- "data": {"foo": 1, "bar": {}},
- "valid": false
- },
- {
- "description": "both properties invalid is invalid",
- "data": {"foo": [], "bar": {}},
- "valid": false
- },
- {
- "description": "doesn't invalidate other properties",
- "data": {"quux": []},
- "valid": true
- },
- {
- "description": "ignores non-objects",
- "data": [],
- "valid": true
- }
- ]
- },
- {
- "description":
- "properties, patternProperties, additionalProperties interaction",
- "schema": {
- "properties": {
- "foo": {"type": "array", "maxItems": 3},
- "bar": {"type": "array"}
- },
- "patternProperties": {"f.o": {"minItems": 2}},
- "additionalProperties": {"type": "integer"}
- },
- "tests": [
- {
- "description": "property validates property",
- "data": {"foo": [1, 2]},
- "valid": true
- },
- {
- "description": "property invalidates property",
- "data": {"foo": [1, 2, 3, 4]},
- "valid": false
- },
- {
- "description": "patternProperty invalidates property",
- "data": {"foo": []},
- "valid": false
- },
- {
- "description": "patternProperty validates nonproperty",
- "data": {"fxo": [1, 2]},
- "valid": true
- },
- {
- "description": "patternProperty invalidates nonproperty",
- "data": {"fxo": []},
- "valid": false
- },
- {
- "description": "additionalProperty ignores property",
- "data": {"bar": []},
- "valid": true
- },
- {
- "description": "additionalProperty validates others",
- "data": {"quux": 3},
- "valid": true
- },
- {
- "description": "additionalProperty invalidates others",
- "data": {"quux": "foo"},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/ref.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/ref.json
deleted file mode 100644
index 903ecb6bce..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/ref.json
+++ /dev/null
@@ -1,159 +0,0 @@
-[
- {
- "description": "root pointer ref",
- "schema": {
- "properties": {
- "foo": {"$ref": "#"}
- },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "match",
- "data": {"foo": false},
- "valid": true
- },
- {
- "description": "recursive match",
- "data": {"foo": {"foo": false}},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": false},
- "valid": false
- },
- {
- "description": "recursive mismatch",
- "data": {"foo": {"bar": false}},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to object",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"$ref": "#/properties/foo"}
- }
- },
- "tests": [
- {
- "description": "match",
- "data": {"bar": 3},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": true},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to array",
- "schema": {
- "items": [
- {"type": "integer"},
- {"$ref": "#/items/0"}
- ]
- },
- "tests": [
- {
- "description": "match array",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "mismatch array",
- "data": [1, "foo"],
- "valid": false
- }
- ]
- },
- {
- "description": "escaped pointer ref",
- "schema": {
- "tilda~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
- "properties": {
- "tilda": {"$ref": "#/tilda~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
- }
- },
- "tests": [
- {
- "description": "slash invalid",
- "data": {"slash": "aoeu"},
- "valid": false
- },
- {
- "description": "tilda invalid",
- "data": {"tilda": "aoeu"},
- "valid": false
- },
- {
- "description": "percent invalid",
- "data": {"percent": "aoeu"},
- "valid": false
- },
- {
- "description": "slash valid",
- "data": {"slash": 123},
- "valid": true
- },
- {
- "description": "tilda valid",
- "data": {"tilda": 123},
- "valid": true
- },
- {
- "description": "percent valid",
- "data": {"percent": 123},
- "valid": true
- }
- ]
- },
- {
- "description": "nested refs",
- "schema": {
- "definitions": {
- "a": {"type": "integer"},
- "b": {"$ref": "#/definitions/a"},
- "c": {"$ref": "#/definitions/b"}
- },
- "$ref": "#/definitions/c"
- },
- "tests": [
- {
- "description": "nested ref valid",
- "data": 5,
- "valid": true
- },
- {
- "description": "nested ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "remote ref, containing refs itself",
- "schema": {"$ref": "http://json-schema.org/draft-03/schema#"},
- "tests": [
- {
- "description": "remote ref valid",
- "data": {"items": {"type": "integer"}},
- "valid": true
- },
- {
- "description": "remote ref invalid",
- "data": {"items": {"type": 1}},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/refRemote.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/refRemote.json
deleted file mode 100644
index 4ca804732c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/refRemote.json
+++ /dev/null
@@ -1,74 +0,0 @@
-[
- {
- "description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
- "tests": [
- {
- "description": "remote ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
- "tests": [
- {
- "description": "remote fragment valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote fragment invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "ref within remote ref",
- "schema": {
- "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
- },
- "tests": [
- {
- "description": "ref within ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "ref within ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "change resolution scope",
- "schema": {
- "id": "http://localhost:1234/",
- "items": {
- "id": "folder/",
- "items": {"$ref": "folderInteger.json"}
- }
- },
- "tests": [
- {
- "description": "changed scope ref valid",
- "data": [[1]],
- "valid": true
- },
- {
- "description": "changed scope ref invalid",
- "data": [["a"]],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/required.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/required.json
deleted file mode 100644
index aaaf024273..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/required.json
+++ /dev/null
@@ -1,53 +0,0 @@
-[
- {
- "description": "required validation",
- "schema": {
- "properties": {
- "foo": {"required" : true},
- "bar": {}
- }
- },
- "tests": [
- {
- "description": "present required property is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "non-present required property is invalid",
- "data": {"bar": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "required default validation",
- "schema": {
- "properties": {
- "foo": {}
- }
- },
- "tests": [
- {
- "description": "not required by default",
- "data": {},
- "valid": true
- }
- ]
- },
- {
- "description": "required explicitly false validation",
- "schema": {
- "properties": {
- "foo": {"required": false}
- }
- },
- "tests": [
- {
- "description": "not required if required is false",
- "data": {},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/type.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/type.json
deleted file mode 100644
index 337da1206d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/type.json
+++ /dev/null
@@ -1,474 +0,0 @@
-[
- {
- "description": "integer type matches integers",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "an integer is an integer",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is not an integer",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an integer",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an integer",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not an integer",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an integer",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an integer",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "number type matches numbers",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "an integer is a number",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is a number",
- "data": 1.1,
- "valid": true
- },
- {
- "description": "a string is not a number",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a number",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a number",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a number",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a number",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "string type matches strings",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "1 is not a string",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a string",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is a string",
- "data": "foo",
- "valid": true
- },
- {
- "description": "an object is not a string",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a string",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a string",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a string",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "object type matches objects",
- "schema": {"type": "object"},
- "tests": [
- {
- "description": "an integer is not an object",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an object",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an object",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is an object",
- "data": {},
- "valid": true
- },
- {
- "description": "an array is not an object",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an object",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an object",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "array type matches arrays",
- "schema": {"type": "array"},
- "tests": [
- {
- "description": "an integer is not an array",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an array",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an array",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an array",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is an array",
- "data": [],
- "valid": true
- },
- {
- "description": "a boolean is not an array",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an array",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
- "tests": [
- {
- "description": "an integer is not a boolean",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a boolean",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not a boolean",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a boolean",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a boolean",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is a boolean",
- "data": true,
- "valid": true
- },
- {
- "description": "null is not a boolean",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "null type matches only the null object",
- "schema": {"type": "null"},
- "tests": [
- {
- "description": "an integer is not null",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not null",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not null",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not null",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not null",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not null",
- "data": true,
- "valid": false
- },
- {
- "description": "null is null",
- "data": null,
- "valid": true
- }
- ]
- },
- {
- "description": "any type matches any type",
- "schema": {"type": "any"},
- "tests": [
- {
- "description": "any type includes integers",
- "data": 1,
- "valid": true
- },
- {
- "description": "any type includes float",
- "data": 1.1,
- "valid": true
- },
- {
- "description": "any type includes string",
- "data": "foo",
- "valid": true
- },
- {
- "description": "any type includes object",
- "data": {},
- "valid": true
- },
- {
- "description": "any type includes array",
- "data": [],
- "valid": true
- },
- {
- "description": "any type includes boolean",
- "data": true,
- "valid": true
- },
- {
- "description": "any type includes null",
- "data": null,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
- "tests": [
- {
- "description": "an integer is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "a string is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "a float is invalid",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "an object is invalid",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is invalid",
- "data": true,
- "valid": false
- },
- {
- "description": "null is invalid",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "types can include schemas",
- "schema": {
- "type": [
- "array",
- {"type": "object"}
- ]
- },
- "tests": [
- {
- "description": "an integer is invalid",
- "data": 1,
- "valid": false
- },
- {
- "description": "a string is invalid",
- "data": "foo",
- "valid": false
- },
- {
- "description": "a float is invalid",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "an object is valid",
- "data": {},
- "valid": true
- },
- {
- "description": "an array is valid",
- "data": [],
- "valid": true
- },
- {
- "description": "a boolean is invalid",
- "data": true,
- "valid": false
- },
- {
- "description": "null is invalid",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description":
- "when types includes a schema it should fully validate the schema",
- "schema": {
- "type": [
- "integer",
- {
- "properties": {
- "foo": {"type": "null"}
- }
- }
- ]
- },
- "tests": [
- {
- "description": "an integer is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "an object is valid only if it is fully valid",
- "data": {"foo": null},
- "valid": true
- },
- {
- "description": "an object is invalid otherwise",
- "data": {"foo": "bar"},
- "valid": false
- }
- ]
- },
- {
- "description": "types from separate schemas are merged",
- "schema": {
- "type": [
- {"type": ["string"]},
- {"type": ["array", "null"]}
- ]
- },
- "tests": [
- {
- "description": "an integer is invalid",
- "data": 1,
- "valid": false
- },
- {
- "description": "a string is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "an array is valid",
- "data": [1, 2, 3],
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json
deleted file mode 100644
index c1f4ab99c9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft3/uniqueItems.json
+++ /dev/null
@@ -1,79 +0,0 @@
-[
- {
- "description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
- "tests": [
- {
- "description": "unique array of integers is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "non-unique array of integers is invalid",
- "data": [1, 1],
- "valid": false
- },
- {
- "description": "numbers are unique if mathematically unequal",
- "data": [1.0, 1.00, 1],
- "valid": false
- },
- {
- "description": "unique array of objects is valid",
- "data": [{"foo": "bar"}, {"foo": "baz"}],
- "valid": true
- },
- {
- "description": "non-unique array of objects is invalid",
- "data": [{"foo": "bar"}, {"foo": "bar"}],
- "valid": false
- },
- {
- "description": "unique array of nested objects is valid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : false}}}
- ],
- "valid": true
- },
- {
- "description": "non-unique array of nested objects is invalid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : true}}}
- ],
- "valid": false
- },
- {
- "description": "unique array of arrays is valid",
- "data": [["foo"], ["bar"]],
- "valid": true
- },
- {
- "description": "non-unique array of arrays is invalid",
- "data": [["foo"], ["foo"]],
- "valid": false
- },
- {
- "description": "1 and true are unique",
- "data": [1, true],
- "valid": true
- },
- {
- "description": "0 and false are unique",
- "data": [0, false],
- "valid": true
- },
- {
- "description": "unique heterogeneous types are valid",
- "data": [{}, [1], true, null, 1],
- "valid": true
- },
- {
- "description": "non-unique heterogeneous types are invalid",
- "data": [{}, [1], true, null, {}, 1],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json
deleted file mode 100644
index 521745c8d6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalItems.json
+++ /dev/null
@@ -1,82 +0,0 @@
-[
- {
- "description": "additionalItems as schema",
- "schema": {
- "items": [{}],
- "additionalItems": {"type": "integer"}
- },
- "tests": [
- {
- "description": "additional items match schema",
- "data": [ null, 2, 3, 4 ],
- "valid": true
- },
- {
- "description": "additional items do not match schema",
- "data": [ null, 2, 3, "foo" ],
- "valid": false
- }
- ]
- },
- {
- "description": "items is schema, no additionalItems",
- "schema": {
- "items": {},
- "additionalItems": false
- },
- "tests": [
- {
- "description": "all items match schema",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- }
- ]
- },
- {
- "description": "array of items with no additionalItems",
- "schema": {
- "items": [{}, {}, {}],
- "additionalItems": false
- },
- "tests": [
- {
- "description": "no additional items present",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "additional items are not permitted",
- "data": [ 1, 2, 3, 4 ],
- "valid": false
- }
- ]
- },
- {
- "description": "additionalItems as false without items",
- "schema": {"additionalItems": false},
- "tests": [
- {
- "description":
- "items defaults to empty schema so everything is valid",
- "data": [ 1, 2, 3, 4, 5 ],
- "valid": true
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "additionalItems are allowed by default",
- "schema": {"items": [{"type": "integer"}]},
- "tests": [
- {
- "description": "only the first item is validated",
- "data": [1, "foo", false],
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json
deleted file mode 100644
index 40831f9e9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/additionalProperties.json
+++ /dev/null
@@ -1,88 +0,0 @@
-[
- {
- "description":
- "additionalProperties being false does not allow other properties",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "patternProperties": { "^v": {} },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : "boom"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": [1, 2, 3],
- "valid": true
- },
- {
- "description": "patternProperties are not additional properties",
- "data": {"foo":1, "vroom": 2},
- "valid": true
- }
- ]
- },
- {
- "description":
- "additionalProperties allows a schema which should validate",
- "schema": {
- "properties": {"foo": {}, "bar": {}},
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "no additional properties is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : 1, "bar" : 2, "quux" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1, "bar" : 2, "quux" : 12},
- "valid": false
- }
- ]
- },
- {
- "description":
- "additionalProperties can exist by itself",
- "schema": {
- "additionalProperties": {"type": "boolean"}
- },
- "tests": [
- {
- "description": "an additional valid property is valid",
- "data": {"foo" : true},
- "valid": true
- },
- {
- "description": "an additional invalid property is invalid",
- "data": {"foo" : 1},
- "valid": false
- }
- ]
- },
- {
- "description": "additionalProperties are allowed by default",
- "schema": {"properties": {"foo": {}, "bar": {}}},
- "tests": [
- {
- "description": "additional properties are allowed",
- "data": {"foo": 1, "bar": 2, "quux": true},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/allOf.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/allOf.json
deleted file mode 100644
index bbb5f89e4b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/allOf.json
+++ /dev/null
@@ -1,112 +0,0 @@
-[
- {
- "description": "allOf",
- "schema": {
- "allOf": [
- {
- "properties": {
- "bar": {"type": "integer"}
- },
- "required": ["bar"]
- },
- {
- "properties": {
- "foo": {"type": "string"}
- },
- "required": ["foo"]
- }
- ]
- },
- "tests": [
- {
- "description": "allOf",
- "data": {"foo": "baz", "bar": 2},
- "valid": true
- },
- {
- "description": "mismatch second",
- "data": {"foo": "baz"},
- "valid": false
- },
- {
- "description": "mismatch first",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "wrong type",
- "data": {"foo": "baz", "bar": "quux"},
- "valid": false
- }
- ]
- },
- {
- "description": "allOf with base schema",
- "schema": {
- "properties": {"bar": {"type": "integer"}},
- "required": ["bar"],
- "allOf" : [
- {
- "properties": {
- "foo": {"type": "string"}
- },
- "required": ["foo"]
- },
- {
- "properties": {
- "baz": {"type": "null"}
- },
- "required": ["baz"]
- }
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": "quux", "bar": 2, "baz": null},
- "valid": true
- },
- {
- "description": "mismatch base schema",
- "data": {"foo": "quux", "baz": null},
- "valid": false
- },
- {
- "description": "mismatch first allOf",
- "data": {"bar": 2, "baz": null},
- "valid": false
- },
- {
- "description": "mismatch second allOf",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "mismatch both",
- "data": {"bar": 2},
- "valid": false
- }
- ]
- },
- {
- "description": "allOf simple types",
- "schema": {
- "allOf": [
- {"maximum": 30},
- {"minimum": 20}
- ]
- },
- "tests": [
- {
- "description": "valid",
- "data": 25,
- "valid": true
- },
- {
- "description": "mismatch one",
- "data": 35,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/anyOf.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/anyOf.json
deleted file mode 100644
index a58714afd8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/anyOf.json
+++ /dev/null
@@ -1,68 +0,0 @@
-[
- {
- "description": "anyOf",
- "schema": {
- "anyOf": [
- {
- "type": "integer"
- },
- {
- "minimum": 2
- }
- ]
- },
- "tests": [
- {
- "description": "first anyOf valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "second anyOf valid",
- "data": 2.5,
- "valid": true
- },
- {
- "description": "both anyOf valid",
- "data": 3,
- "valid": true
- },
- {
- "description": "neither anyOf valid",
- "data": 1.5,
- "valid": false
- }
- ]
- },
- {
- "description": "anyOf with base schema",
- "schema": {
- "type": "string",
- "anyOf" : [
- {
- "maxLength": 2
- },
- {
- "minLength": 4
- }
- ]
- },
- "tests": [
- {
- "description": "mismatch base schema",
- "data": 3,
- "valid": false
- },
- {
- "description": "one anyOf valid",
- "data": "foobar",
- "valid": true
- },
- {
- "description": "both anyOf invalid",
- "data": "foo",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/default.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/default.json
deleted file mode 100644
index 17629779fb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/default.json
+++ /dev/null
@@ -1,49 +0,0 @@
-[
- {
- "description": "invalid type for default",
- "schema": {
- "properties": {
- "foo": {
- "type": "integer",
- "default": []
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"foo": 13},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- },
- {
- "description": "invalid string value for default",
- "schema": {
- "properties": {
- "bar": {
- "type": "string",
- "minLength": 4,
- "default": "bad"
- }
- }
- },
- "tests": [
- {
- "description": "valid when property is specified",
- "data": {"bar": "good"},
- "valid": true
- },
- {
- "description": "still valid when the invalid default is used",
- "data": {},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/definitions.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/definitions.json
deleted file mode 100644
index cf935a3215..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/definitions.json
+++ /dev/null
@@ -1,32 +0,0 @@
-[
- {
- "description": "valid definition",
- "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
- "tests": [
- {
- "description": "valid definition schema",
- "data": {
- "definitions": {
- "foo": {"type": "integer"}
- }
- },
- "valid": true
- }
- ]
- },
- {
- "description": "invalid definition",
- "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
- "tests": [
- {
- "description": "invalid definition schema",
- "data": {
- "definitions": {
- "foo": {"type": 1}
- }
- },
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/dependencies.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/dependencies.json
deleted file mode 100644
index 7b9b16a7e1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/dependencies.json
+++ /dev/null
@@ -1,113 +0,0 @@
-[
- {
- "description": "dependencies",
- "schema": {
- "dependencies": {"bar": ["foo"]}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependant",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "with dependency",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"bar": 2},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "multiple dependencies",
- "schema": {
- "dependencies": {"quux": ["foo", "bar"]}
- },
- "tests": [
- {
- "description": "neither",
- "data": {},
- "valid": true
- },
- {
- "description": "nondependants",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "with dependencies",
- "data": {"foo": 1, "bar": 2, "quux": 3},
- "valid": true
- },
- {
- "description": "missing dependency",
- "data": {"foo": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing other dependency",
- "data": {"bar": 1, "quux": 2},
- "valid": false
- },
- {
- "description": "missing both dependencies",
- "data": {"quux": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "multiple dependencies subschema",
- "schema": {
- "dependencies": {
- "bar": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "integer"}
- }
- }
- }
- },
- "tests": [
- {
- "description": "valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "no dependency",
- "data": {"foo": "quux"},
- "valid": true
- },
- {
- "description": "wrong type",
- "data": {"foo": "quux", "bar": 2},
- "valid": false
- },
- {
- "description": "wrong type other",
- "data": {"foo": 2, "bar": "quux"},
- "valid": false
- },
- {
- "description": "wrong type both",
- "data": {"foo": "quux", "bar": "quux"},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/enum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/enum.json
deleted file mode 100644
index f124436a7d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/enum.json
+++ /dev/null
@@ -1,72 +0,0 @@
-[
- {
- "description": "simple enum validation",
- "schema": {"enum": [1, 2, 3]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": 4,
- "valid": false
- }
- ]
- },
- {
- "description": "heterogeneous enum validation",
- "schema": {"enum": [6, "foo", [], true, {"foo": 12}]},
- "tests": [
- {
- "description": "one of the enum is valid",
- "data": [],
- "valid": true
- },
- {
- "description": "something else is invalid",
- "data": null,
- "valid": false
- },
- {
- "description": "objects are deep compared",
- "data": {"foo": false},
- "valid": false
- }
- ]
- },
- {
- "description": "enums in properties",
- "schema": {
- "type":"object",
- "properties": {
- "foo": {"enum":["foo"]},
- "bar": {"enum":["bar"]}
- },
- "required": ["bar"]
- },
- "tests": [
- {
- "description": "both properties are valid",
- "data": {"foo":"foo", "bar":"bar"},
- "valid": true
- },
- {
- "description": "missing optional property is valid",
- "data": {"bar":"bar"},
- "valid": true
- },
- {
- "description": "missing required property is invalid",
- "data": {"foo":"foo"},
- "valid": false
- },
- {
- "description": "missing all properties is invalid",
- "data": {},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/items.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/items.json
deleted file mode 100644
index f5e18a1384..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/items.json
+++ /dev/null
@@ -1,46 +0,0 @@
-[
- {
- "description": "a schema given for items",
- "schema": {
- "items": {"type": "integer"}
- },
- "tests": [
- {
- "description": "valid items",
- "data": [ 1, 2, 3 ],
- "valid": true
- },
- {
- "description": "wrong type of items",
- "data": [1, "x"],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": {"foo" : "bar"},
- "valid": true
- }
- ]
- },
- {
- "description": "an array of schemas for items",
- "schema": {
- "items": [
- {"type": "integer"},
- {"type": "string"}
- ]
- },
- "tests": [
- {
- "description": "correct types",
- "data": [ 1, "foo" ],
- "valid": true
- },
- {
- "description": "wrong types",
- "data": [ "foo", 1 ],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxItems.json
deleted file mode 100644
index 3b53a6b371..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxItems validation",
- "schema": {"maxItems": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": [1, 2, 3],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "foobar",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxLength.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxLength.json
deleted file mode 100644
index 811d35b253..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxLength.json
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "description": "maxLength validation",
- "schema": {"maxLength": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": "f",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": "foo",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 100,
- "valid": true
- },
- {
- "description": "two supplementary Unicode code points is long enough",
- "data": "\uD83D\uDCA9\uD83D\uDCA9",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json
deleted file mode 100644
index d282446ad6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maxProperties.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "maxProperties validation",
- "schema": {"maxProperties": 2},
- "tests": [
- {
- "description": "shorter is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "too long is invalid",
- "data": {"foo": 1, "bar": 2, "baz": 3},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "foobar",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maximum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maximum.json
deleted file mode 100644
index 86c7b89c9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/maximum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "maximum validation",
- "schema": {"maximum": 3.0},
- "tests": [
- {
- "description": "below the maximum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "above the maximum is invalid",
- "data": 3.5,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMaximum validation",
- "schema": {
- "maximum": 3.0,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "below the maximum is still valid",
- "data": 2.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 3.0,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minItems.json
deleted file mode 100644
index ed5118815e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minItems.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minItems validation",
- "schema": {"minItems": 1},
- "tests": [
- {
- "description": "longer is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": [1],
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "ignores non-arrays",
- "data": "",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minLength.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minLength.json
deleted file mode 100644
index 3f09158dee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minLength.json
+++ /dev/null
@@ -1,33 +0,0 @@
-[
- {
- "description": "minLength validation",
- "schema": {"minLength": 2},
- "tests": [
- {
- "description": "longer is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": "fo",
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": "f",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": 1,
- "valid": true
- },
- {
- "description": "one supplementary Unicode code point is not long enough",
- "data": "\uD83D\uDCA9",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minProperties.json
deleted file mode 100644
index a72c7d293e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minProperties.json
+++ /dev/null
@@ -1,28 +0,0 @@
-[
- {
- "description": "minProperties validation",
- "schema": {"minProperties": 1},
- "tests": [
- {
- "description": "longer is valid",
- "data": {"foo": 1, "bar": 2},
- "valid": true
- },
- {
- "description": "exact length is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "too short is invalid",
- "data": {},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": "",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minimum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minimum.json
deleted file mode 100644
index d5bf000bcc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/minimum.json
+++ /dev/null
@@ -1,42 +0,0 @@
-[
- {
- "description": "minimum validation",
- "schema": {"minimum": 1.1},
- "tests": [
- {
- "description": "above the minimum is valid",
- "data": 2.6,
- "valid": true
- },
- {
- "description": "below the minimum is invalid",
- "data": 0.6,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "x",
- "valid": true
- }
- ]
- },
- {
- "description": "exclusiveMinimum validation",
- "schema": {
- "minimum": 1.1,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "above the minimum is still valid",
- "data": 1.2,
- "valid": true
- },
- {
- "description": "boundary point is invalid",
- "data": 1.1,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json
deleted file mode 100644
index ca3b761805..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/multipleOf.json
+++ /dev/null
@@ -1,60 +0,0 @@
-[
- {
- "description": "by int",
- "schema": {"multipleOf": 2},
- "tests": [
- {
- "description": "int by int",
- "data": 10,
- "valid": true
- },
- {
- "description": "int by int fail",
- "data": 7,
- "valid": false
- },
- {
- "description": "ignores non-numbers",
- "data": "foo",
- "valid": true
- }
- ]
- },
- {
- "description": "by number",
- "schema": {"multipleOf": 1.5},
- "tests": [
- {
- "description": "zero is multiple of anything",
- "data": 0,
- "valid": true
- },
- {
- "description": "4.5 is multiple of 1.5",
- "data": 4.5,
- "valid": true
- },
- {
- "description": "35 is not multiple of 1.5",
- "data": 35,
- "valid": false
- }
- ]
- },
- {
- "description": "by small number",
- "schema": {"multipleOf": 0.0001},
- "tests": [
- {
- "description": "0.0075 is multiple of 0.0001",
- "data": 0.0075,
- "valid": true
- },
- {
- "description": "0.00751 is not multiple of 0.0001",
- "data": 0.00751,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/not.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/not.json
deleted file mode 100644
index cbb7f46bf8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/not.json
+++ /dev/null
@@ -1,96 +0,0 @@
-[
- {
- "description": "not",
- "schema": {
- "not": {"type": "integer"}
- },
- "tests": [
- {
- "description": "allowed",
- "data": "foo",
- "valid": true
- },
- {
- "description": "disallowed",
- "data": 1,
- "valid": false
- }
- ]
- },
- {
- "description": "not multiple types",
- "schema": {
- "not": {"type": ["integer", "boolean"]}
- },
- "tests": [
- {
- "description": "valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "mismatch",
- "data": 1,
- "valid": false
- },
- {
- "description": "other mismatch",
- "data": true,
- "valid": false
- }
- ]
- },
- {
- "description": "not more complex schema",
- "schema": {
- "not": {
- "type": "object",
- "properties": {
- "foo": {
- "type": "string"
- }
- }
- }
- },
- "tests": [
- {
- "description": "match",
- "data": 1,
- "valid": true
- },
- {
- "description": "other match",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"foo": "bar"},
- "valid": false
- }
- ]
- },
- {
- "description": "forbidden property",
- "schema": {
- "properties": {
- "foo": {
- "not": {}
- }
- }
- },
- "tests": [
- {
- "description": "property present",
- "data": {"foo": 1, "bar": 2},
- "valid": false
- },
- {
- "description": "property absent",
- "data": {"bar": 1, "baz": 2},
- "valid": true
- }
- ]
- }
-
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/oneOf.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
deleted file mode 100644
index 1eaa4e4794..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/oneOf.json
+++ /dev/null
@@ -1,68 +0,0 @@
-[
- {
- "description": "oneOf",
- "schema": {
- "oneOf": [
- {
- "type": "integer"
- },
- {
- "minimum": 2
- }
- ]
- },
- "tests": [
- {
- "description": "first oneOf valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "second oneOf valid",
- "data": 2.5,
- "valid": true
- },
- {
- "description": "both oneOf valid",
- "data": 3,
- "valid": false
- },
- {
- "description": "neither oneOf valid",
- "data": 1.5,
- "valid": false
- }
- ]
- },
- {
- "description": "oneOf with base schema",
- "schema": {
- "type": "string",
- "oneOf" : [
- {
- "minLength": 2
- },
- {
- "maxLength": 4
- }
- ]
- },
- "tests": [
- {
- "description": "mismatch base schema",
- "data": 3,
- "valid": false
- },
- {
- "description": "one oneOf valid",
- "data": "foobar",
- "valid": true
- },
- {
- "description": "both oneOf valid",
- "data": "foo",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json
deleted file mode 100644
index ccc7c17fe8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/bignum.json
+++ /dev/null
@@ -1,107 +0,0 @@
-[
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a bignum is an integer",
- "data": 12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a bignum is a number",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "integer",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "a negative bignum is an integer",
- "data": -12345678910111213141516171819202122232425262728293031,
- "valid": true
- }
- ]
- },
- {
- "description": "number",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "a negative bignum is a number",
- "data": -98249283749234923498293171823948729348710298301928331,
- "valid": true
- }
- ]
- },
- {
- "description": "string",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "a bignum is not a string",
- "data": 98249283749234923498293171823948729348710298301928331,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"maximum": 18446744073709551615},
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision",
- "schema": {
- "maximum": 972783798187987123879878123.18878137,
- "exclusiveMaximum": true
- },
- "tests": [
- {
- "description": "comparison works for high numbers",
- "data": 972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- },
- {
- "description": "integer comparison",
- "schema": {"minimum": -18446744073709551615},
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -18446744073709551600,
- "valid": true
- }
- ]
- },
- {
- "description": "float comparison with high precision on negative numbers",
- "schema": {
- "minimum": -972783798187987123879878123.18878137,
- "exclusiveMinimum": true
- },
- "tests": [
- {
- "description": "comparison works for very negative numbers",
- "data": -972783798187987123879878123.188781371,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/format.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/format.json
deleted file mode 100644
index aacfd11984..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/format.json
+++ /dev/null
@@ -1,148 +0,0 @@
-[
- {
- "description": "validation of date-time strings",
- "schema": {"format": "date-time"},
- "tests": [
- {
- "description": "a valid date-time string",
- "data": "1963-06-19T08:30:06.283185Z",
- "valid": true
- },
- {
- "description": "an invalid date-time string",
- "data": "06/19/1963 08:30:06 PST",
- "valid": false
- },
- {
- "description": "only RFC3339 not all of ISO 8601 are valid",
- "data": "2013-350T01:01:01",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of URIs",
- "schema": {"format": "uri"},
- "tests": [
- {
- "description": "a valid URI",
- "data": "http://foo.bar/?baz=qux#quux",
- "valid": true
- },
- {
- "description": "a valid protocol-relative URI",
- "data": "//foo.bar/?baz=qux#quux",
- "valid": true
- },
- {
- "description": "an invalid URI",
- "data": "\\\\WINDOWS\\fileshare",
- "valid": false
- },
- {
- "description": "an invalid URI though valid URI reference",
- "data": "abc",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of e-mail addresses",
- "schema": {"format": "email"},
- "tests": [
- {
- "description": "a valid e-mail address",
- "data": "joe.bloggs@example.com",
- "valid": true
- },
- {
- "description": "an invalid e-mail address",
- "data": "2962",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IP addresses",
- "schema": {"format": "ipv4"},
- "tests": [
- {
- "description": "a valid IP address",
- "data": "192.168.0.1",
- "valid": true
- },
- {
- "description": "an IP address with too many components",
- "data": "127.0.0.0.1",
- "valid": false
- },
- {
- "description": "an IP address with out-of-range values",
- "data": "256.256.256.256",
- "valid": false
- },
- {
- "description": "an IP address without 4 components",
- "data": "127.0",
- "valid": false
- },
- {
- "description": "an IP address as an integer",
- "data": "0x7f000001",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of IPv6 addresses",
- "schema": {"format": "ipv6"},
- "tests": [
- {
- "description": "a valid IPv6 address",
- "data": "::1",
- "valid": true
- },
- {
- "description": "an IPv6 address with out-of-range values",
- "data": "12345::",
- "valid": false
- },
- {
- "description": "an IPv6 address with too many components",
- "data": "1:1:1:1:1:1:1:1:1:1:1:1:1:1:1:1",
- "valid": false
- },
- {
- "description": "an IPv6 address containing illegal characters",
- "data": "::laptop",
- "valid": false
- }
- ]
- },
- {
- "description": "validation of host names",
- "schema": {"format": "hostname"},
- "tests": [
- {
- "description": "a valid host name",
- "data": "www.example.com",
- "valid": true
- },
- {
- "description": "a host name starting with an illegal character",
- "data": "-a-host-name-that-starts-with--",
- "valid": false
- },
- {
- "description": "a host name containing illegal characters",
- "data": "not_a_valid_host_name",
- "valid": false
- },
- {
- "description": "a host name with a component too long",
- "data": "a-vvvvvvvvvvvvvvvveeeeeeeeeeeeeeeerrrrrrrrrrrrrrrryyyyyyyyyyyyyyyy-long-host-name-component",
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json
deleted file mode 100644
index 9b50ea2776..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/optional/zeroTerminatedFloats.json
+++ /dev/null
@@ -1,15 +0,0 @@
-[
- {
- "description": "some languages do not distinguish between different types of numeric value",
- "schema": {
- "type": "integer"
- },
- "tests": [
- {
- "description": "a float is not an integer even without fractional part",
- "data": 1.0,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/pattern.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/pattern.json
deleted file mode 100644
index 25e7299731..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/pattern.json
+++ /dev/null
@@ -1,34 +0,0 @@
-[
- {
- "description": "pattern validation",
- "schema": {"pattern": "^a*$"},
- "tests": [
- {
- "description": "a matching pattern is valid",
- "data": "aaa",
- "valid": true
- },
- {
- "description": "a non-matching pattern is invalid",
- "data": "abc",
- "valid": false
- },
- {
- "description": "ignores non-strings",
- "data": true,
- "valid": true
- }
- ]
- },
- {
- "description": "pattern is not anchored",
- "schema": {"pattern": "a+"},
- "tests": [
- {
- "description": "matches a substring",
- "data": "xxaayy",
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json
deleted file mode 100644
index 18586e5dab..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/patternProperties.json
+++ /dev/null
@@ -1,110 +0,0 @@
-[
- {
- "description":
- "patternProperties validates properties matching a regex",
- "schema": {
- "patternProperties": {
- "f.*o": {"type": "integer"}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "multiple valid matches is valid",
- "data": {"foo": 1, "foooooo" : 2},
- "valid": true
- },
- {
- "description": "a single invalid match is invalid",
- "data": {"foo": "bar", "fooooo": 2},
- "valid": false
- },
- {
- "description": "multiple invalid matches is invalid",
- "data": {"foo": "bar", "foooooo" : "baz"},
- "valid": false
- },
- {
- "description": "ignores non-objects",
- "data": 12,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple simultaneous patternProperties are validated",
- "schema": {
- "patternProperties": {
- "a*": {"type": "integer"},
- "aaa*": {"maximum": 20}
- }
- },
- "tests": [
- {
- "description": "a single valid match is valid",
- "data": {"a": 21},
- "valid": true
- },
- {
- "description": "a simultaneous match is valid",
- "data": {"aaaa": 18},
- "valid": true
- },
- {
- "description": "multiple matches is valid",
- "data": {"a": 21, "aaaa": 18},
- "valid": true
- },
- {
- "description": "an invalid due to one is invalid",
- "data": {"a": "bar"},
- "valid": false
- },
- {
- "description": "an invalid due to the other is invalid",
- "data": {"aaaa": 31},
- "valid": false
- },
- {
- "description": "an invalid due to both is invalid",
- "data": {"aaa": "foo", "aaaa": 31},
- "valid": false
- }
- ]
- },
- {
- "description": "regexes are not anchored by default and are case sensitive",
- "schema": {
- "patternProperties": {
- "[0-9]{2,}": { "type": "boolean" },
- "X_": { "type": "string" }
- }
- },
- "tests": [
- {
- "description": "non recognized members are ignored",
- "data": { "answer 1": "42" },
- "valid": true
- },
- {
- "description": "recognized members are accounted for",
- "data": { "a31b": null },
- "valid": false
- },
- {
- "description": "regexes are case sensitive",
- "data": { "a_x_3": 3 },
- "valid": true
- },
- {
- "description": "regexes are case sensitive, 2",
- "data": { "a_X_3": 3 },
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/properties.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/properties.json
deleted file mode 100644
index cd1644dcd9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/properties.json
+++ /dev/null
@@ -1,92 +0,0 @@
-[
- {
- "description": "object properties validation",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"type": "string"}
- }
- },
- "tests": [
- {
- "description": "both properties present and valid is valid",
- "data": {"foo": 1, "bar": "baz"},
- "valid": true
- },
- {
- "description": "one property invalid is invalid",
- "data": {"foo": 1, "bar": {}},
- "valid": false
- },
- {
- "description": "both properties invalid is invalid",
- "data": {"foo": [], "bar": {}},
- "valid": false
- },
- {
- "description": "doesn't invalidate other properties",
- "data": {"quux": []},
- "valid": true
- },
- {
- "description": "ignores non-objects",
- "data": [],
- "valid": true
- }
- ]
- },
- {
- "description":
- "properties, patternProperties, additionalProperties interaction",
- "schema": {
- "properties": {
- "foo": {"type": "array", "maxItems": 3},
- "bar": {"type": "array"}
- },
- "patternProperties": {"f.o": {"minItems": 2}},
- "additionalProperties": {"type": "integer"}
- },
- "tests": [
- {
- "description": "property validates property",
- "data": {"foo": [1, 2]},
- "valid": true
- },
- {
- "description": "property invalidates property",
- "data": {"foo": [1, 2, 3, 4]},
- "valid": false
- },
- {
- "description": "patternProperty invalidates property",
- "data": {"foo": []},
- "valid": false
- },
- {
- "description": "patternProperty validates nonproperty",
- "data": {"fxo": [1, 2]},
- "valid": true
- },
- {
- "description": "patternProperty invalidates nonproperty",
- "data": {"fxo": []},
- "valid": false
- },
- {
- "description": "additionalProperty ignores property",
- "data": {"bar": []},
- "valid": true
- },
- {
- "description": "additionalProperty validates others",
- "data": {"quux": 3},
- "valid": true
- },
- {
- "description": "additionalProperty invalidates others",
- "data": {"quux": "foo"},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/ref.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/ref.json
deleted file mode 100644
index 7e80552249..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/ref.json
+++ /dev/null
@@ -1,159 +0,0 @@
-[
- {
- "description": "root pointer ref",
- "schema": {
- "properties": {
- "foo": {"$ref": "#"}
- },
- "additionalProperties": false
- },
- "tests": [
- {
- "description": "match",
- "data": {"foo": false},
- "valid": true
- },
- {
- "description": "recursive match",
- "data": {"foo": {"foo": false}},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": false},
- "valid": false
- },
- {
- "description": "recursive mismatch",
- "data": {"foo": {"bar": false}},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to object",
- "schema": {
- "properties": {
- "foo": {"type": "integer"},
- "bar": {"$ref": "#/properties/foo"}
- }
- },
- "tests": [
- {
- "description": "match",
- "data": {"bar": 3},
- "valid": true
- },
- {
- "description": "mismatch",
- "data": {"bar": true},
- "valid": false
- }
- ]
- },
- {
- "description": "relative pointer ref to array",
- "schema": {
- "items": [
- {"type": "integer"},
- {"$ref": "#/items/0"}
- ]
- },
- "tests": [
- {
- "description": "match array",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "mismatch array",
- "data": [1, "foo"],
- "valid": false
- }
- ]
- },
- {
- "description": "escaped pointer ref",
- "schema": {
- "tilda~field": {"type": "integer"},
- "slash/field": {"type": "integer"},
- "percent%field": {"type": "integer"},
- "properties": {
- "tilda": {"$ref": "#/tilda~0field"},
- "slash": {"$ref": "#/slash~1field"},
- "percent": {"$ref": "#/percent%25field"}
- }
- },
- "tests": [
- {
- "description": "slash invalid",
- "data": {"slash": "aoeu"},
- "valid": false
- },
- {
- "description": "tilda invalid",
- "data": {"tilda": "aoeu"},
- "valid": false
- },
- {
- "description": "percent invalid",
- "data": {"percent": "aoeu"},
- "valid": false
- },
- {
- "description": "slash valid",
- "data": {"slash": 123},
- "valid": true
- },
- {
- "description": "tilda valid",
- "data": {"tilda": 123},
- "valid": true
- },
- {
- "description": "percent valid",
- "data": {"percent": 123},
- "valid": true
- }
- ]
- },
- {
- "description": "nested refs",
- "schema": {
- "definitions": {
- "a": {"type": "integer"},
- "b": {"$ref": "#/definitions/a"},
- "c": {"$ref": "#/definitions/b"}
- },
- "$ref": "#/definitions/c"
- },
- "tests": [
- {
- "description": "nested ref valid",
- "data": 5,
- "valid": true
- },
- {
- "description": "nested ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "remote ref, containing refs itself",
- "schema": {"$ref": "http://json-schema.org/draft-04/schema#"},
- "tests": [
- {
- "description": "remote ref valid",
- "data": {"minLength": 1},
- "valid": true
- },
- {
- "description": "remote ref invalid",
- "data": {"minLength": -1},
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/refRemote.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/refRemote.json
deleted file mode 100644
index 4ca804732c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/refRemote.json
+++ /dev/null
@@ -1,74 +0,0 @@
-[
- {
- "description": "remote ref",
- "schema": {"$ref": "http://localhost:1234/integer.json"},
- "tests": [
- {
- "description": "remote ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "fragment within remote ref",
- "schema": {"$ref": "http://localhost:1234/subSchemas.json#/integer"},
- "tests": [
- {
- "description": "remote fragment valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "remote fragment invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "ref within remote ref",
- "schema": {
- "$ref": "http://localhost:1234/subSchemas.json#/refToInteger"
- },
- "tests": [
- {
- "description": "ref within ref valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "ref within ref invalid",
- "data": "a",
- "valid": false
- }
- ]
- },
- {
- "description": "change resolution scope",
- "schema": {
- "id": "http://localhost:1234/",
- "items": {
- "id": "folder/",
- "items": {"$ref": "folderInteger.json"}
- }
- },
- "tests": [
- {
- "description": "changed scope ref valid",
- "data": [[1]],
- "valid": true
- },
- {
- "description": "changed scope ref invalid",
- "data": [["a"]],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/required.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/required.json
deleted file mode 100644
index 612f73f347..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/required.json
+++ /dev/null
@@ -1,39 +0,0 @@
-[
- {
- "description": "required validation",
- "schema": {
- "properties": {
- "foo": {},
- "bar": {}
- },
- "required": ["foo"]
- },
- "tests": [
- {
- "description": "present required property is valid",
- "data": {"foo": 1},
- "valid": true
- },
- {
- "description": "non-present required property is invalid",
- "data": {"bar": 1},
- "valid": false
- }
- ]
- },
- {
- "description": "required default validation",
- "schema": {
- "properties": {
- "foo": {}
- }
- },
- "tests": [
- {
- "description": "not required by default",
- "data": {},
- "valid": true
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/type.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/type.json
deleted file mode 100644
index db42a44d3f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/type.json
+++ /dev/null
@@ -1,330 +0,0 @@
-[
- {
- "description": "integer type matches integers",
- "schema": {"type": "integer"},
- "tests": [
- {
- "description": "an integer is an integer",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is not an integer",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an integer",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an integer",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not an integer",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an integer",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an integer",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "number type matches numbers",
- "schema": {"type": "number"},
- "tests": [
- {
- "description": "an integer is a number",
- "data": 1,
- "valid": true
- },
- {
- "description": "a float is a number",
- "data": 1.1,
- "valid": true
- },
- {
- "description": "a string is not a number",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a number",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a number",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a number",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a number",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "string type matches strings",
- "schema": {"type": "string"},
- "tests": [
- {
- "description": "1 is not a string",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a string",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is a string",
- "data": "foo",
- "valid": true
- },
- {
- "description": "an object is not a string",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a string",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not a string",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not a string",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "object type matches objects",
- "schema": {"type": "object"},
- "tests": [
- {
- "description": "an integer is not an object",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an object",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an object",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is an object",
- "data": {},
- "valid": true
- },
- {
- "description": "an array is not an object",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not an object",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an object",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "array type matches arrays",
- "schema": {"type": "array"},
- "tests": [
- {
- "description": "an integer is not an array",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not an array",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not an array",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not an array",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is an array",
- "data": [],
- "valid": true
- },
- {
- "description": "a boolean is not an array",
- "data": true,
- "valid": false
- },
- {
- "description": "null is not an array",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "boolean type matches booleans",
- "schema": {"type": "boolean"},
- "tests": [
- {
- "description": "an integer is not a boolean",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not a boolean",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not a boolean",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not a boolean",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not a boolean",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is a boolean",
- "data": true,
- "valid": true
- },
- {
- "description": "null is not a boolean",
- "data": null,
- "valid": false
- }
- ]
- },
- {
- "description": "null type matches only the null object",
- "schema": {"type": "null"},
- "tests": [
- {
- "description": "an integer is not null",
- "data": 1,
- "valid": false
- },
- {
- "description": "a float is not null",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "a string is not null",
- "data": "foo",
- "valid": false
- },
- {
- "description": "an object is not null",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is not null",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is not null",
- "data": true,
- "valid": false
- },
- {
- "description": "null is null",
- "data": null,
- "valid": true
- }
- ]
- },
- {
- "description": "multiple types can be specified in an array",
- "schema": {"type": ["integer", "string"]},
- "tests": [
- {
- "description": "an integer is valid",
- "data": 1,
- "valid": true
- },
- {
- "description": "a string is valid",
- "data": "foo",
- "valid": true
- },
- {
- "description": "a float is invalid",
- "data": 1.1,
- "valid": false
- },
- {
- "description": "an object is invalid",
- "data": {},
- "valid": false
- },
- {
- "description": "an array is invalid",
- "data": [],
- "valid": false
- },
- {
- "description": "a boolean is invalid",
- "data": true,
- "valid": false
- },
- {
- "description": "null is invalid",
- "data": null,
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json
deleted file mode 100644
index c1f4ab99c9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tests/draft4/uniqueItems.json
+++ /dev/null
@@ -1,79 +0,0 @@
-[
- {
- "description": "uniqueItems validation",
- "schema": {"uniqueItems": true},
- "tests": [
- {
- "description": "unique array of integers is valid",
- "data": [1, 2],
- "valid": true
- },
- {
- "description": "non-unique array of integers is invalid",
- "data": [1, 1],
- "valid": false
- },
- {
- "description": "numbers are unique if mathematically unequal",
- "data": [1.0, 1.00, 1],
- "valid": false
- },
- {
- "description": "unique array of objects is valid",
- "data": [{"foo": "bar"}, {"foo": "baz"}],
- "valid": true
- },
- {
- "description": "non-unique array of objects is invalid",
- "data": [{"foo": "bar"}, {"foo": "bar"}],
- "valid": false
- },
- {
- "description": "unique array of nested objects is valid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : false}}}
- ],
- "valid": true
- },
- {
- "description": "non-unique array of nested objects is invalid",
- "data": [
- {"foo": {"bar" : {"baz" : true}}},
- {"foo": {"bar" : {"baz" : true}}}
- ],
- "valid": false
- },
- {
- "description": "unique array of arrays is valid",
- "data": [["foo"], ["bar"]],
- "valid": true
- },
- {
- "description": "non-unique array of arrays is invalid",
- "data": [["foo"], ["foo"]],
- "valid": false
- },
- {
- "description": "1 and true are unique",
- "data": [1, true],
- "valid": true
- },
- {
- "description": "0 and false are unique",
- "data": [0, false],
- "valid": true
- },
- {
- "description": "unique heterogeneous types are valid",
- "data": [{}, [1], true, null, 1],
- "valid": true
- },
- {
- "description": "non-unique heterogeneous types are invalid",
- "data": [{}, [1], true, null, {}, 1],
- "valid": false
- }
- ]
- }
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tox.ini b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tox.ini
deleted file mode 100644
index 5301222a84..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/jsonschema/tox.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[tox]
-minversion = 1.6
-envlist = py27
-skipsdist = True
-
-[testenv]
-deps = jsonschema
-commands = {envpython} bin/jsonschema_suite check
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/alotofkeys.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/alotofkeys.json
deleted file mode 100644
index 3fc052e34f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/alotofkeys.json
+++ /dev/null
@@ -1,502 +0,0 @@
-{
- "4BABQZ5SZJSO3KFKBOG36EIXXTOF34HVFCELHA2DWOMIL44K": null,
- "RSZNOTRIJFCHRKG4IKNOW4ZEBMVXPDBYBXBGDGNWTSVLMJ2U": null,
- "AOGQPY32FQ7T7WZWQPON3X6GU74GOYI6HHVNPATDTBXRUQ4G": null,
- "3PMTZEGLZNHSOWWJ23BE6PWOXD2VZRDN7MMLUMQ4EIRERVCG": null,
- "PD2FMQGI5HTGK6MT76OYS2ER2LXFBON44WOMELDY5MRKQI6I": null,
- "6L6QMMVSE4UQLB4OGX3LVDRNGAL6MOJ6S3RBBUSQ3F5PPHYR": null,
- "LYVVXT7U7WN7PGGUHCLFXVOBJBSSR6ES2P7AY7XGBXEBLTDD": null,
- "G5RWOLHDDZOXYEFGGSVWG3C2UHYDW6UOFVBQQLQJVZNCF4TB": null,
- "3QPIK2M3ZPICZQFQTX22A7VDCAFIGAX2PXIXKDOZX7XUM32R": null,
- "JR75L2BXOA5LVLNKT4EEZO2P45OHWRPMMWMFENTFFIY7A2V3": null,
- "TESL546MN7IR7AT3C5HRSESIFHZ5NW6TNRWZXZ43OSRYOZKP": null,
- "62EJKIAFWGFGPUS6YP2X6E26AV2TZCTCAJMZNWBBNFRPCCRN": null,
- "5ZDD3KPTPGE2CAWR3MTFUSBMGQAS4ZP5WZKXJTXUNFSYABD6": null,
- "XQ7TMN5YMQLAND54B4VIVWJAHU3TNZKT2S4SVRW6WKHNJBX2": null,
- "O456GV3HBAWFDQRCECX6HY3PBTP6WNQIDSKVP2MZIPV3TCBL": null,
- "WXCN25EBQH5WWN2JBHWNFNDUTYSFDLIAOWO5AE6D5HDO7VNE": null,
- "THO3I3KDRIMTD6DKNIETIOWDY7FXQ5GJ3P2KUQJWYAEL3LXV": null,
- "7OMI7VIOKFRZATMNLGIWH7ZBDARZ6ARXIAH5S3GPG5KV52IC": null,
- "ESUPY3ELKCEGFRSYFGPGFBJOAUGXMYZ6XCWXDFOKHBJHNGVR": null,
- "TNXSJIEFJLUFUDTR2S5LV73PD6ACFYNHOCRZPUSDPXDD3B7M": null,
- "T6TISG6P4W66F37634QU4BNJY4RZ77QXXNPGTYH5LCCRDSX6": null,
- "QTVAA56JKNDYTMV7DXAIL4QVLZPW3UHGLTKDI2BED6S3MGDQ": null,
- "DTJREAQBCS6I2AJ6MOGTPIXK3ADB4BPNDIHI2YSQP6Y2BMH7": null,
- "XDGH2OYCTAJ75IEMZ32O644YLT73PRYDORFKBLYEMCHOQ7Q6": null,
- "4KDDQZRBLNS33DRHZHDMENCWGMNFEJGBZJXSGIQW7VBWOTHT": null,
- "5KSH3GKWFNXV55KI2FPUDSD57O25N52UTZAAYDFVMFUSEE6O": null,
- "7AGEUBM5FQZ2JCMUSKTEI6COA3Q5CE5WYB7TP2F5OX3ETMTK": null,
- "HFHZ5ZE5TC45W4WIF6H7ONTHXKAVWRY2LXN2GN2TXZPIP6PQ": null,
- "S3U2JJBPKZHZNOM3SWVFQ7OMS7F5M2KDJHHHZKXHZXQRNUSE": null,
- "YHJBGJ6T6A7PMK5AYXDITDV37BJJIM4TP7I2XHSVYN76724O": null,
- "TH42A7M3645OUKC54JQMDB5BTGS3URFUCYJ2VOEM6IAGZ5QQ": null,
- "OYBKULFLWL2MER745QTDL2X2HJNR77QGH2M2P6TSCHVGUJLV": null,
- "JDU37GHQUOCYA5I5LFS3WAEKKR6C55XJCCLJCCCQJEGUJEP6": null,
- "CB5HEJZNJ2SWZM426TWIWLHTWAPWPT2AVVHBILEVGFD6NPHI": null,
- "D4A5SJA2VRB4JGJFC7PHT35S7XAMHPZZ2PZC5YYVV7RLKSUQ": null,
- "BBVT6NRRU55KNRK5G745FNMZVIFHVZJICEMODF4ZBJFQ3EGL": null,
- "XBV57OEMT4GYPTTH56A6XKF2ZPMXSMHY7L3LUIS5ZZWRP2OB": null,
- "GTFJ3NP4VJR6HG2DRNTDKVIWTMIALYUQIQTBJMKVM2I3QKGE": null,
- "77BMBFMRGASXE5XXT6BRH2DRBNJMIAUDDMEXIJT3RMHTUPI4": null,
- "FWZZMG7I2JWAHX4LBYAK2G4L4TZYLHXMJWIDGT6JC5TEBCPJ": null,
- "J3324OXU2BG2NGFMSOYMVKXE6OEJNGENI7EESHDSEWSUVDVV": null,
- "C636AVNC5C5EKILXT2AQPXYLSNH7LCAJKVDHP67MVHULFSQN": null,
- "OXTDOQG2VIEVYFC23SKOBSSPGE55AVZZADK6PIHP3APVPHND": null,
- "JLQVKV4Q2BQHK355NQXZVX4WJBPFOWSD7WIJX2P433KYO4SO": null,
- "E4XHPOPWH3PRCV5MGQHR3BCTKZMOK46OH4Q6STZDPF2FG6SD": null,
- "J5IP4A3DV3BHGGU3J72JVVTWNIQOLNC6GQES22MVATK5H7BZ": null,
- "HHCCDMLNGOU2ABP57ION5TC33UF3NUHL2L3WUYCGZDWLDNTL": null,
- "54Q67RURG4THOANPT3RAVF72TGKJE425GC5GD3EOKPY6MKVW": null,
- "TG3BH3HBKFEXAUM5O67VVDTXZA6MHWSVNNLXLXIL2SE2ZEDO": null,
- "Q5KJ25G2A4CWNGPPYXBZM6QVYA466MQX3HCUMUO5Z24D5JX3": null,
- "QQZET7VFHGJROUQZSWSRDI5ADXVH26KEPDVL6PZ36ISHOKMQ": null,
- "KWNJME4V365ZIC7SA7BYCVQUAG6URC2T6MHSO3OVDBJAUPFB": null,
- "XHQYKGYVLE2PFNXQPD4OUWBASZO5OFVZISCVEFTU6K6KDKHS": null,
- "Z4SPXMJIAMYD2H4U4F23FALBDZP6NRLUBDFU4PRGZ4SXGTI2": null,
- "HSCK3PEXH3I3XMMEMIHTM7SDJD3GOKXUMCGOL6UXJXLCSCGN": null,
- "BIUYMIDY4EVGRLZ6OLJK2CE2FS5TTELIWSEA6UHKUDUYX5LM": null,
- "IJJDLN5ANXTMX54P6GW2J2EJGGWG257YEAOZMXUSWK7D76LH": null,
- "CLMTO3VSAOBAOBSA5IGOO4W7KEMLOFUOIR564IBKMJA7RWEY": null,
- "JU5DNSHLUW34DT3IQ36JBV6M7EPILLMBALURDAB2KJXF6HQB": null,
- "VXZXWLNQZFJPNQVPTOFWUPLORZD2XRAFXRVRNLUYTPBO22U5": null,
- "HNACM55ZSGJ2FGRMOTXLVVLA32BC333QGC4HFCDSZ335YA4N": null,
- "6J5GIOVKU4PKHHU35DWL3D7GTJFF75FF4FKSP2HPGJ7SQ2DP": null,
- "O3NJM537IQSKKWM3K7EOQSNQDTR6XKUA7ZR7CWYHYYLHKH63": null,
- "B4QMXK2EAR5E7KGHLODCP56DX5HW7IQVXWHFFCZ4SPSSNGJK": null,
- "A5AUZBXKF67OXO34ZSEGVXI5PAIG6W2VG3U5C2Q72SNWYNEI": null,
- "ZGDQ2AA2IFBSU3APKAFL5AO4C4DXY2YBEHXE5UPPVCTFZ36K": null,
- "N3XZ5FYZEO3ZX37OMUJX3PIWEEV7TVEXX64KKEZEJICKXMTB": null,
- "3EVOEEWTD7OABLQJIJYLOSVHBS4SB6QGX7GPDFGWI2DGAWKR": null,
- "HNAEL3D7E2S7IYLKLIK4CGI56DRGAXA5S6KG3RX75PMJ6BVI": null,
- "VGVW32CIRX3M45J2CPCUPPHNRGNG55MKAU7YF3CDNMGONW2T": null,
- "QV5MW2W6WQSHNC6OYMWJAWEQM7LHXRMGWCJ7RI5WQ3JGHARW": null,
- "IND2PUTLFWXTEUY4MMEXCFJA7JN7DODE5HVWC5CL5ED5IEUB": null,
- "W2IA75XHJRBRKXLHGB7LXD7ECYEZI4V5N5I37UFXJMFWQMYR": null,
- "AWTZO6OG6TCOUVYYJCWVP2JYEXRXZ7S7F7QKUKZS7JLPKN3H": null,
- "TCARJATK42Y66SPMGOZ2LHLT2ZPZW7MHGXL5IVTS272FJV4U": null,
- "XVHBOY5WQDOTWXVFZYQKZ6GNRWMITJDDLXSJ2T3UWF6PFOHL": null,
- "CY5FGDYLB4UFR4AJRGLGPQT3W3OERGCXC4JHYKJ4HKSFTGK6": null,
- "B3SJGD67GKIEAOZISX7HWENPDBYJHNJ47JCREGXQ6G2RXPUZ": null,
- "LWVJYH7M5KXMLPFAHTMF6FKT3PSIW2GRC37AHF65PQY7OUE4": null,
- "UUFKWC2DOV4ZQHPDPQPRCBEYNAX6OFZ7ZVJNYGW5YZCMSQIS": null,
- "K5EC26CUN365DZ3LE2NHOINGZHXQ752A3VTPN5IMSRYSTOMT": null,
- "22RV6RSSZIAFXOZIRAWJAIMMVHYWGL2TY42U3TG2SPFN3I6P": null,
- "Q7VEOUC52OLXL53CR4XQSGGR5QZ2QXZTRCBACHQFP2HKN4SZ": null,
- "OZ2ZBCTBC32VOHHBDABY2U462OHUEUS724RUS7Z6TW5K5ZFQ": null,
- "EYXYWTX2UYI6MUK5L65WSTX2FDOJASIMG6ER22NLABNGAEMI": null,
- "U4FJU7RQMXXDMHG7B5WFLXCZBNE5PMV43CE5X4RJSJUABT3U": null,
- "K3T56AL7IXTAGTVIWZHYRKVPHLLD7UVHV4UNU76F764VGY75": null,
- "U2BRKWY2RBYV5S3XVZTUZXT55CXMB45KDMNFMVY6LENW2DH5": null,
- "YKLPZ7SDAG2O6NSJFLVGFVCYMY4WZKXQGHH7OO2BKGGVLQNP": null,
- "WSC2BHA7H6Q62HJIIGQFX2OU64QX4AEU2RZQVIC7LSIO2JSJ": null,
- "QIFNFKPJJCYPITMAYDAOEXBVEDAKBBR3DV5ZB7DAVBIAWI5K": null,
- "NMBGIDIK3BMS5ZPZS6ATTID5BOAXZAH2VUED52JSC5XGI42P": null,
- "LTSG7BGZVBLLXM5U2QDW5LNNPM3B5EQZPHES7JXU2EAQG266": null,
- "5MZMVLLM7YHR4PTQCGDGWFQQLNN532WMTFGX5CFTDURBYEOH": null,
- "UOMT2ERDBVXC3LRYKCVVUNROBWPGFHFWKFCW65HAPXN2H4FD": null,
- "RFYZPAIVYHTITTR5AKOBAMYKOA3VSKRTK4P4ZOS7JFSVEY53": null,
- "QQJGQV6BSW6PL4DZGQDWWVTF7U5MEVPQABOA4IRP7NOD4V4V": null,
- "EFOSJBHVPSGTB3O374JFJW6MVW47ODOZQNKYSWHR5W6UZECP": null,
- "YTL42MLIGIUD6Q3AMVMJ6ZMWNSXSUWCKV4ZUQWSGTEOATQC4": null,
- "F5IL5OV3Y6E4QEE7JMQTKV6ULJ5AQQKQPZ23VXK72AV2P7XG": null,
- "AZEV37T65EWVWQJSISCHTYHLWRXWCR6XD4LJ4KFLJ6RAOPF5": null,
- "T5TAAFPNZLVDYHSNNHIJW4KBZWNFT5CMIPIWW3EFKPU4REYG": null,
- "W326OLSKXRLU6MEIVUTKFFHFGXEH3VM43F353L3NHQP6HE2Q": null,
- "MIIUZQ4KGTLA66VIE7WPN4T43SR6Q42YUKWEP6467AYWKU62": null,
- "AXSJHLTL4FXCMLLJTQS4HIBRGUY6ATR3GZPV4MGXLWNFHDYU": null,
- "MC2CMWSKD2HMTVIWCMSPZWHEGW73RWEZKU3IFZJM33IW3VI6": null,
- "ZGOZHC22WZN6LSY3KK4HK6RF6F73VWSB7U47KZSLTYOQZAVH": null,
- "HU26VJYM5YNEXCOCWCVEQNNZ2WAPFEVYK67JZOHMSZIOUWJN": null,
- "6ZA46O27SWCAX5MQUHZYFV5UNQUDLZG4LDA6VILK6YRQMMZ5": null,
- "LMGGW3CAN4T6DSVJZB46LOBI6KTZN7CKHNZ6BMWRBL5PVYXX": null,
- "RZKIP3F5SY2P4NWANAQZJHPH34CU3GMQ4VCN4QXMP7ZBSQ43": null,
- "CMUAX53FME5Y62VC7T7ZOUZMOPHBDFVLMVVMHYDDBZEHMOOA": null,
- "ORTA47K5MLIHEUXQTFFTQNW2RMYQSTVDJXUNIF334SAJJYMC": null,
- "XEGLAWIOOPE25FDXHN65P4FYJVB46M4NGGXFAWZ5VDWBBMU4": null,
- "WZGXOCCN6GENKYYAYCH6UQD45BIPSYMQOZYAYRU3S2JNJLU3": null,
- "MXDDSZA6VTTYU56ONDE4QZMB3L2D7A5SCRCIVBYYVIKFDFLU": null,
- "JJMW475CTRXRR4R3GEZ77STHMKHTQZYFZHFUFXEB77SV2W3H": null,
- "J3TNJVNF7QSTIJDEEZMLTQECNOES4PXQALSR5ZPYDTIVVKUB": null,
- "Q5EHPI6GHPPZBATKHYYEXNDSYMW6QVAVKKHC2XO7RU7XXKQ3": null,
- "B6WGKJEZH7XBZ4VFFRCBFYKC2Z2ZQXMY2HJQUH4LVI3EDMMU": null,
- "NZ737IT3LUIMH56R66WFETEHFDOZSNVPTHMQTW3JHVTN562C": null,
- "B52PWLRNPFN73AA63O6JFLEYSPFQEIHQ6AI6YC7KWOYFE5OW": null,
- "7UTTRFE2I5WB2XZA37L6F7RWCII6S6HLXZRTLSJYFOENAYPI": null,
- "TJJDGG7R4RNVAOXWRZRZB5K7W2Y6XB7LUYBDOY6H5IDRM3ML": null,
- "TOG35JU7ULNRY3DE2XYDZ25WZETRSO5WSFFYSZT5IIALO3ZP": null,
- "2QZKK4CMZNIKUWZZB22ASDR2BYNRAMTNS7MVLBA7Z7RDKZDV": null,
- "US4C6FXHKR4GCRU6IJQHSAJXLNQGUDCDEPEQDU5C5D76I6XX": null,
- "QOPUXM3ZKXTPVGMVVDMUZZ75KH2S7DKYXSFCQ3R5RYO5WP2J": null,
- "GZ2T37SKRE3ZX7FARFWWF3WG443LVP5X6ENDLDHO7GBWYHHM": null,
- "VSOOUSBMGIPEVAPYAGWZOLDUW5HSTRMTBRTUYLQNHKVUBLJ7": null,
- "45HJFJQ3YKDBFDZPNDO46YT7DLG754XZWMGJQ7YPJXQ4G4N4": null,
- "4KY77KV2OWWFEVIBSUZRGZF2V47BEFFHIHNMAQVK65E34ZF3": null,
- "NB334WI2DNPLWHGXBNHSU4436ZYDQ4D2S3JMLDOM35QINZTR": null,
- "7K23M4FJGIQFWUMPRDZIK32MF7HZULYYSS5Z7N7QTEJGET3D": null,
- "ZBMNFKSEG2PXKJZIXIK2MHJQ2ONRJUJVCDBOCHNERPGMN2NQ": null,
- "YMCOX2NMBDL4J6Z7JBEWHFSCWON4ZSBSBU2WONEYYOYRA75K": null,
- "GDOVKPAWZFHLAPQ5YHCFWL4NAMC5G2DDXFWUTR27XQ7LEOOQ": null,
- "CYBYK7ESXTUUHYQVPMDI7VWAZO5TVGLIB3GB7NYRYVDLMYKG": null,
- "4IYLX3IDNUJ2DWT4RM3QJ3IMVE22X67EW5KWSMZHIU4W2W5B": null,
- "EBWXJZ3PX7LE4JNB2XWJJNXL5QBVSJQSXAUJMJ34YJKR3JJU": null,
- "LEKOXMXHU57JTRZUKMCW4WDCAKEOXPHJ34ULXN5P6DIEOYLL": null,
- "BESPMR4LBE3G4MTWR22CVBYH6NW43HO4ILTSV3P543JZUBD7": null,
- "5SYIBXIHGJGE4WHL2HYUNK3X4JUGOJOUMKVJMMXSQDKJZHFJ": null,
- "XN42HP3QOV34GMJA5VINVW3O7KWW2GV7VDKAZDFBCC6SSHNQ": null,
- "326BDEDWGYW3IMEHP63I6LVGSRMS6DUUNMPY3YVWXCH3YA67": null,
- "FYNTVFBPC37FYGOXFIXJP57FNX5MYDGUWIMUYMFOJSOXRRDS": null,
- "7DRCBIQP4EXAVNEMWOZHAEZ2W2EIMKD77PH6JJWP2BDN6NFN": null,
- "7Z7LWVFB2Z26EVYZPLQAOQ7LXLADTHUA7QGKDRFLXRQ3ZJUX": null,
- "EOZ2S4T75U62LD4QUZNTOHP7SNVJUNNSE7WWGHCMC75O4XPW": null,
- "TVG4ZY3YVNQV7WPZ2CEW26QTGWUBVJV7FTRF4TE54446J5SI": null,
- "MQ62OHPXMGGASRXKOH5MEVGLYHKNWBT3DC7XSXPXFHFXFO5C": null,
- "MBRTEJLOZ6U43EOO2IS3AHNDCT7WUEK4XN5ZRMTPBKUFXUWU": null,
- "24WJGDPNT4E7SQT2IBSTHJGYBMEBKS7VPGJYBRRAT5YXNBC4": null,
- "3KD7I6FOTRB4U2JBT7CIJOPD5XHFWHESYJJQTQVUQ3IGIPVZ": null,
- "25XHQ7A3DWKVDBX2ZFNIHKOGJCXY73N4Q6PUBEWGH2I55XVP": null,
- "GE3YTUBPOT5CFJU2LQVMZVC67NFNLXVWNTV4ERN6BHVGCGYL": null,
- "VXE2WHW6UWRE4WYTAVFAQ75IBYUPNZVMHJC44DGDPIAEOVVE": null,
- "5JRWFOAEX5TNCAMYGF44C72EWF5NTXIRSVST5J3N6N5SLGFF": null,
- "TYNIMWTDY2D565BJUNMFXTJHBUMWOTD4YSAFILKXPKX6FKRO": null,
- "RDUDIY6N4RRUA6YEBBBFPBNYFZQUWRVURNYGJPEU6EHJA64H": null,
- "MMRLX63PFJLWBJUTXCSLALIGK5YOHTLAY64WFQIYQJCX4QID": null,
- "P4T7UPQNUAFMAJ3G4KBRHOQP5GCJP46XXYKPTTENUI36YQEP": null,
- "VNAKVK3A4TN7WEZAJBJVMUVIKIUWCNH7B373DP7WAM7ZXYDD": null,
- "VAPNA5BJL7OF7VRVSUEFAG6RZWENO5VOGMFVN6AB4A7H4VU3": null,
- "TLVHDKN7326OHNXMBBJIVQW5FFFGPXSUR2IVTMPLOLPPJQW2": null,
- "LD4OK3CY7MQGHUMQOMPAJY2NZUASJLSLWVSIIKIYYYAFYHIK": null,
- "DXHC3XJCJJG2SMU4O2HDPMJHO4PNNYGIMLB5KSCQPNLBAJER": null,
- "SANGKO55HOXMBC627JYHVBE3FH6KJL74ITOVF5GYODRRMEMP": null,
- "TOQW7HYYWSFH3NKL7SITPX5H4HLAH7BKL35ECCAILLJ5B4TA": null,
- "WUKAWAQHSBKAUAYEQ4UA5PKFB4676VQNQFLXUIX6UCDFZ472": null,
- "BDU5VYNLNHR6HOLMZI4XSDERPTMVJ4LBUX5XP6W2BQWH3NLR": null,
- "R6BT3RGKODHZN2AEX26XHNSLCHGPGMQ7IS2ONRTZEPJECW7A": null,
- "E7Z4FLW3UW2ALRLPSMHQWJWBK7VWS63H3AUZZL6LHCIG3Q5B": null,
- "FUZAITDO5EH4BU3ZAN55R2RQZ75LRAYI4X3MEJKJD44VHOT7": null,
- "7SZ7VZ5O2OFPJL3K5JJKH3C2ZYAJCWW5GYXSLVFHRRATZDFA": null,
- "6H7VKVPSP4MHB6P7H5KLQQN3Q6ZSS65OMK6GJ3JIUMHQINMC": null,
- "QNCN75MNVAVH2OQR3JE53SGCKLXPSB2XBTZ55J3AX37AV5HT": null,
- "JCSYRKMHDGVUVZO65VQVAV5SGQS5IRS4UGFNFKMYP6CXMHXN": null,
- "JXX5VCQU2Q73TK5ICSFX3QIGA6E4IFRTGKPZZY32UTB2RY2Z": null,
- "BMUAPYFGRJO7ZQAMMSSEADU2RC3LPAAXTORXLSIUCXCSSC2P": null,
- "3SPFCAR2V2PQA3RWOY5ZZXI2V6UEUCZWL6SNCGEAGNR2JQZV": null,
- "KUW7Z4ZHRUX6DI6Y3ME7A33SXUAQPXFAHRG4IEU32ETMGTLC": null,
- "64F67UZGQHZUXLN6HCATAAX2FUQNK2WVOEJGBQ27H5DVZFC3": null,
- "GHMJSW2TE6E3JLFDD7T6FI67HBDHNDVLGEKATAO5G33TID57": null,
- "6BZEOJR372ZLNXUMEQQUKHHDCAOE5W4YDT3VWGI3YYPYDC5R": null,
- "62JOKD5O25I7DBDFMM2BRQP4HI2VJTUHMEF3G3C7JFJF2VNL": null,
- "NEF5ANHSBNEXLOP7FFH7ZVHPDOCHQQ6EYOG64JDZNIHBT44L": null,
- "ZKLJACJIQT6M7KUY3VWTMQ4WD7RETAWN7LDUB7UQA3NZHZLC": null,
- "VBZVHDFHE464JTYWCLYNAA65RDMVURJHVZHWRL3IKTNT6AH6": null,
- "FHBYZO5SUBQ56J72DWYOUZSDKXE3SKDRWBEGLQPHWUGVSW5B": null,
- "HHWRIAY52UXIOIKQOL3PBERZFDCQXAAUIDT4RTZF2VETEY3Q": null,
- "JALKMRCQEIXX3JPLOACUZ2DKA5I2RWSSSIYDVSURW475XHR7": null,
- "IMQUFG6JBGWA7R3D3NRMJNOF5MKE2NU4H2LAI6UPIHUEY2ZD": null,
- "GWSUUFLKG23Z4BXTLB2HJHYVRWAWHKV5MA5RVOEE77Z65ILK": null,
- "ILKEEWZSHVZSQ5M5VAZH6MJPBVQVV63SCQSX73YGTOQZBFKB": null,
- "TBU3SS7AG7QISWIK2KKNE77ISJUEVH3ZV7QZJAEHLMAOUCEZ": null,
- "EPN2PRVPXZGZ6WRX5ZMG6UPIM2V2NEA4BBC7ZDAIVCEKMHR5": null,
- "Z7GJAUSWDAH2JUMVX6IZB2PRSIUHYUKXGKJDM7FXVFDJNDUU": null,
- "APOEQP3DLJGKFU7424CJJBFDTWODGF45H7HSXT3GO2UC3VCI": null,
- "LCYBWI4HYCSVGBSWWDJYDCWQZGJP2KVSXUUJBO3XFUWOS4SA": null,
- "KOTWM653HSOQ2JHNAZGZZA5FGBBJCCBYPDVDE7WDXXIHTULF": null,
- "TIPJO4GHBUJQKWKVHK5RF2NI5Z6FAIEBGFPR5L4SSCLS6IE6": null,
- "QJZMGE4B6UPJ35KTTNIAHWTFV7DFQZ2QMF6DLHB2AHZQ45CD": null,
- "SDV2RDMAXCYWHJJRPTEIZVE6SJST7KQJB57AXCWFVO54E2GX": null,
- "4NW6WJDWXCXG2TS24H4I7WF2IGROPO4UBN2HJ64M3CWBU2M7": null,
- "GJPMFWNBHZ63VB5XWIM52UO22ANEXDYLHTF24LGBC7XXI4SH": null,
- "I3TPFLVZ47TOOMM2G35JFQAYHLAIU3OXV4SXZEP67DNGYXN3": null,
- "QMPKHHYWWSV32R2LHCWFKBFDXUDUXTZ7FRZK3TCF25CSFNWD": null,
- "J3C6XZSMIXH2SQMBUEVWEI6UZVX2GJZCAYSPD74BBUUK45RS": null,
- "WHK5HZ42VH6IJ4U4EUKKVLRAID2FH2YISR7IV6FMNHQPPSH7": null,
- "C62NUQB2FUJTY5VRNI6ND26FXCUVACSUTTR6NZMNQPYK6357": null,
- "2JXXJE7WN7QWO6X3ESQCSDDBTZXOY43L5AODQUIR5P6Y4PZB": null,
- "FQVJ4Y4GES3RGRABQCJIDIYEUNTIGETQ5EOXW25SZSYNJENT": null,
- "IH2YJNGRU5Y3ODZHMWNV3TIU2MGCNLIPV75QL3JL4I7PH5ZI": null,
- "RYUBMVYE4PL6JJOSBM57NE2RFKCY2EB3EQR3QU45MJHEX5IN": null,
- "KRVCQJ6VSHM52MLDNS65PKDYHNBJAHCONQCNLXBD76LDCOFY": null,
- "W7MB2FYKYWXDXNOKVWJW7TSUANZIGE25NABNIAK7VLPLKQQH": null,
- "QUJNQSAHDXMNHKHHIRBEFONX6NRV4NA7NKFRDI72ZKVZXR32": null,
- "SRQAJHTEQYVNHCJDTYHA72VSYS4FPTHXGPFYP6CQRTEUIWVN": null,
- "GYQMORZKT4JGWGOD4KBEMUB3XZNUM7H4G5IRA6SYDZOGAPVF": null,
- "73P37OKSAJ5SWM5NJ2QWCTKPTFNLORRRGBNJWR7BTCRLKNCO": null,
- "D7YVGR63MRZ5YS3UTCUZ7REPWGB6EMGNI3LXZUDAYBSZVGHZ": null,
- "JNUZON5EE4CF5UIPXIAU5HKQSBN6O2C3OXJ5IT6HPZMUBXRK": null,
- "3UMKRHCWRV2WNUWPF4WKESLI6EOHPFC6FOXF2MGP6E7GPKF7": null,
- "ZPWCDBHEOCZRBAVIQNGRQ4WNKSE4XCXWH3PQSBJWVTMLP6AD": null,
- "RCOP6UXD6CG5XYUXFXT7HDAWQA2LRA52R2NVABFBB574N62D": null,
- "6EHQW3VGWSY5MQKBQ4PWU2YD4KKXPBUFJCBEEY6GKOGGGT4P": null,
- "V72EUDLMYSS47DCO7XIEYQO4S6KK7ME4C6VN6IWLZALPDIR2": null,
- "EX6JHHNN4R7BQVBTVXYRD54J6BLOJTRHM64QBK3DHUWW37KF": null,
- "6GGFMOEZN5PBE67AJM6XJKDL7V6X26X3TH2WVOO4X2MEQJKO": null,
- "LYM2NDKVFTJ2IJV2G5HTDDXFDAAHVHVMVTNGBAOABW4JLB7V": null,
- "5GPR3EHGCAFLKH4CTOZK3JBHCJSEEFD2Y5GS5Y3B5FPXAK6H": null,
- "3TVZ6BP47YPHI4HKRIK43AJPRVM5UO736FF7WEXI6FJMTKY7": null,
- "XDL7LZWG4CIO574WINYHCXMGRRZV5BMZQH6GPTTVPBWGV4MD": null,
- "OHDX42IVKOGGQVXFE7Q3DKX2HNXGIZRAZ5TVVKQ34BO7UKPB": null,
- "QHSOVA5SCRL5AK65IALQZWLHPSMLOOHHS6JN3LHDCN7DEHJ7": null,
- "EI2J32TUZKPKSWOYH7EPPKHISCJ5SPTUFJXENKZJFAPEFQJL": null,
- "3FFPGZBSH57RTBR326VUSL4G3DELAIPWCCHB77LFG5CBS2YU": null,
- "VOLJPHGJOQKGKQ3PQGRLYJBZCIF3T355GXCQQKV34USNOXNX": null,
- "ZASYP4G3K3DX6MMU2CK2P6GJ2PKRQFQGFVEZGTMIRAZBDMOC": null,
- "MSLOXTCY6MPU6XRGIJ7ZGFBB5J4RTGTEC2UW2LO5MIKPXFJO": null,
- "DM3ZAC4JV4IDN7ZZ2OLHAUCUEWYTMLZSQQEARJF4JVBUTE2D": null,
- "KWIXQOXXGHTUPBDCHXV6ET4YZXIDCYZEQTFIRHD7DTMSGZ3X": null,
- "SOF4BRIWEU5XLSXVFE6IHVVDYG73RK5HJACKPUNFRNEDHRWS": null,
- "4FECMJE2AGQGN54LFXTIQFZC6ZVJN3LY62YCS4E65PMW2K5J": null,
- "VDCWL2B5OEDDB2YGM7Y23WLJPJBFESITFU5AWDPUKDUMFPBO": null,
- "W6VC6MV4GBWJ7IDAX4DQHWJSBUJHJN7ADFJ53NBVND3TXUCZ": null,
- "Z3TTBMVW3FCTJPLHXITOVK4LPLUFJJY3CIYKJ4QY2DANJ53R": null,
- "O6N3PZGXI5B6NBTOFPB5WWIRJ66O4FYLSGHDIJLVPT25YPWK": null,
- "RXCNDGG7CDEMAOGCALTPXWLUL7A67D3JSKOZSZEQBLDW2F3S": null,
- "XVKBWW7HRXDBW3YXSBMO7WVEUPVQ7LRZ44RVFI27PYZO3NTS": null,
- "XUSRB4YQDOYJALL7CK2OYFPL7GKI6XOFYHP7HTW5H3PF333V": null,
- "PCCHIGPV6SWW2O4YRPMFMNF5YVW6QY5IF7JPYAULF5WPTYKB": null,
- "MHRU7JFEPHHUAULYL34RAEAGBU2ARZG63TGIIS7MHEQUKWPY": null,
- "Y6EDYRAB7V6NAP57DRIKQ3SB57XBPN7MAWD7F3DM4DKWIAMA": null,
- "JQXEFOTP5HPBTKL4VAXYCMJFZVGSAM3JVLFJPQ6KHVLCRXFI": null,
- "U53PDNGH4IKMP4PW6AJV6K5Q43PYB6VUZ3IJVEKZK32IR5WJ": null,
- "52CB2E7VQJ3JJ2SXPHQZZMER64TM2JQBSW3JMX7XITCNSWDT": null,
- "3JLBHZFBPZQTO3MLCW6S5N3RIR42N6RGDHMP4U6IO6STOOVT": null,
- "YTFVKDUY6LHHBY5JBBTT75RYI73Y2Y2DFT5PBMOLEVBJEN4Y": null,
- "TAHMINQIUDTCEBCJ4UH2PUXO5TYMIIZTH4BX26S4NRMPFD6Q": null,
- "4VJIQ6FLWV6ONBHRWDR34KXCTHL7HIXSQAF3FAKOMZ2C7QV7": null,
- "IQWFFVGP6CPSAQWMKA3SWYOXAUL2YCD3EJYRQ56S3VXWAMUF": null,
- "J2FABCRQ7HZFV4FKZKY2UOXRUO4FYXANTTWL27ANRYY6XZC2": null,
- "G3TOY5CIOYIELRC2S35CGAS2E36TDLTO5XYXHFVKZNDFQC6F": null,
- "SDKQB4B47LL6CAFDDYJWDS4X7COKTZOCQ6ELJBL2YF6RHZJC": null,
- "L76D3LKKTUAWNPDXKTWE7JCFCRFVI4UX6NKQS3CAA2OWVF4K": null,
- "QVYYK2GQF7DHSJACSOZPOQUCWWIYTRGEWMBIR5RRCV2EPQ5X": null,
- "UM3PJVMZNDU2GJ6KVY5VQ2HPGMSJKVAQBDRKZKHBPBRCU5SO": null,
- "RDIJQSPXHAUB7XSQQPOL3CNUR5AJAJEWAFYFSDO5G4QWZQCV": null,
- "3CAVVDQOCSMOPC54JWKI5ITUIHAOV6SKAIIAAPAAJLBDTXEM": null,
- "JHLSLTDSRVKDHWRGT55OZ5NC6YHGD35WHW4GPK77VZWPNVKN": null,
- "6K266T5MHDGFA2XECSFBMTQDEE2C4S45S53XBODESR4ERZQ2": null,
- "VJVWAFFKWR2KSTFIWGAKDUG5VQTO3BPTI7YFYZWZSBMMQOIN": null,
- "LBSXWCQNCHYUG5M255T3W72NBPR5MBEPO7DFBCD277HSH4DU": null,
- "WHJGXILLMK23VGXI2OY76SYJQOQHQOM6OSLT4BWU2KSD3OAD": null,
- "DVNEV7ANOMDRQDHTEMD6CXCTO7NOY2MQQOLI47U4DDOJ2A2M": null,
- "TV752NASHG7FG2JOGS5P6QLJ7E4W5NX7F3OYYRPOEFZ2NREE": null,
- "S4DHHYVQ4RQ7HBAXW5ZKISZMULMLCFTSBFICXNLI2OD7YNF6": null,
- "HSRHOS56TX6EEDHUZX7K4K6Y3R2UNHRINXWVK5WBWHDPE5HF": null,
- "I67YQZJ4PXHFWHNHMK5SKUEFIL4EEP5B4BH3TJNHZPQOUXDM": null,
- "5AJTMUDFBWW3EGM2TH2YAJYXIR6GKM7RPBYBRV6KEQPDDLM6": null,
- "6V3SAQQC44I3CSDERRKA2533GYIWWHUZVR67JAWIBPJJBDBI": null,
- "5I6EFWIWLDNJQAZNZN326TUHCUY5YOD4ITIT6NL7LWIK6RP4": null,
- "NVT5LE35FIT6LKWBI5XZO2Q7CTQBFJ3IOIAFNXI7PGVHEE5W": null,
- "E5I534XUV7GRNCMHBVFI7FMTSPYBGXKOFVXXSEQYYLVGCASL": null,
- "3XDVU325YQTEXC7HFJKKKH7CTCCNNJZMV6VRT5GVED7HFKMZ": null,
- "3UJYDR6QUVSSCRHJT6WWNEHC5OMYXOPL3EF26PU2A5HESFG5": null,
- "UPRVTQXNXYCZG4JZIR7GZCCYTXR5VTUR2OKAJXEWGATCSIOH": null,
- "2QLXXZPU57ZXMLJHEYDS6IHFLQHOKANOE5URI2TRNFNSIFUG": null,
- "JFL3SN7LZ7M4RUZXRTYFQTUMYWYHO4P3ZKBGFDC2GGWZBPEA": null,
- "SBLHOHHAOCNEVQI3UPBY5S4UKTTIH3DEJEDJHWMJ6VEWWTCL": null,
- "TIE3GNWA2BE2WGFA7Y3KEHF4IF77M5XHZB3DIQLOE3GG4VQM": null,
- "BB7XBWIYV33TZGTKHTBL4PDPH5ZQ6X7ZCMHS3KIQEJOLOXVH": null,
- "6WO2JPOCRLCUSXS7BHNKFBDGFSEXCWYUFPK5SDZJTFJAEJRV": null,
- "RCJUMHWKL3IBJ4ZVWHK4RCZ4RCVVTMG5ZO2KWZOIVZLJTSMT": null,
- "YIXCNMIMZBA7NK2A5QOCLE77QFF6QDS7NGIHKMILIUB37EMH": null,
- "ZSI25IY4L2U7CRPBLOYY5TCSAVG22XHHZFC7JZCRAVY46BWH": null,
- "HUSGTJENHNIBJ7VSWZPOWFHHKKYH7H2YSP32LLQ2N7CWKRME": null,
- "WTIJK6LZPBOCIJFBZEG26BETKTY5PJKQK5D3M5WVPWVSV7LN": null,
- "ITSWONDXALFBD4WMGSMRKQXCVTL7JRKVFEHOAOODRQEFFSWC": null,
- "IY3RQGYC2ME2TEUBYAQG5WJ7WOAJV5GTO6P3FKXWOLSJWGCD": null,
- "MDSHVZ5WHCTCYB34ZABEUJJRXHQDKO5MSC5YVTGPMNJRXQK7": null,
- "KHNSXQTOSCRSTX63S7OVO2LGMD7OVR6PZIGEKL5ZDYPCEKK6": null,
- "LECVNJKLFT6P2HWX3H7ZC5DKJSSRZ7PWZVBN735K7I45SOX4": null,
- "HFEO55KM3XH34UWCRYM5CFNQ6OFRAKM3U6TABNQDP74DT4JQ": null,
- "QZOWC3TAAU67PVSBRJOOVZCBSRIOZCMLPB3FH4GS37WOSTEZ": null,
- "TSB72AJ4HHOBEYK4CGFX3W4RW3SIECQYJMYISHTPPCGQNLFD": null,
- "6AB4YKYVMU2PXRABAUBBBF4BJ3IOFKYWBJ2IMFMRVLCBI4S4": null,
- "E3TI3V725PEP7U2CYZUUKJEBPAHOEI5SYCR3YZCMGD5EGYHF": null,
- "APKJUBCO5NHY6QBYNA2ADB5TTPLCNZMHG7HGXXOLRBOZD46Y": null,
- "QKL26OQG6L54OCKFPLMXI6M3EG2HI4EG34D7BNI5SBZG6OF7": null,
- "W4KKIH4RPYXL4JZY24JWLHOATFNENBMSEQQ3DI7WW4PQIJQ3": null,
- "4XJPWCDQXS6MSKI4EMFPENOX5FV7KMKKZ77LV6GJ6S7ZBVB2": null,
- "LWMCTL5CEAVQDT5PEXFKRK7Q264CNVV6AU657OQ3SSPCDGSQ": null,
- "CBMCT6STEYDOVXT6OW34OXGZBN2A77OGBPDRN5AZK4RXNEV5": null,
- "OUGRMVL7PTQ3GJNWQ5WP7XXNYBIMVWKSNQ2QZH5RZRDEGUND": null,
- "XKVAYVNQL7KW5EHGEWYRPSWDXNUEKP3YC3OXGEHKG7PGNZHL": null,
- "ZLO6BOTXUEEW7UOENY2NVIFLSG37YPUETQBYYCQBJM5VXNG4": null,
- "QMZJWAJYYE6WZQX3OKY34BPU7ZZN6ECDNIZOIXREE6AP3WJF": null,
- "B5FU7VNVUSA3ODDEUDVTKE7GWPU3JQXWHRWYGLT6VFKSFYAA": null,
- "HLHSAJUSHU5EY26UTR2UDJAM3BIHYYHF46MNLTQZJWDAUCDO": null,
- "N73SLU2EDTPQ54MY5NWT7KPSVTO3TOGPO3DGX4HQYPZMFYJV": null,
- "7B47MDGTJA3P2WX3KWLLESWTC7RJUSVUSBI42SATEYZVPL5K": null,
- "YYLWTHMS5POBP3WVX5Q4NXQ77STWJTAHE6QK7GYMBIJU3TSX": null,
- "JI7Q6GUWUTSJPHKUII5IVOUZ2QQ53EWNWCUM4PKECXWSVSEK": null,
- "XR4W6GZYNYIDAFU7MWMIGFGF63OLKU4FWQZ4RAN3HWNXUINB": null,
- "3KX2TVZZAQSYQHLDSWMVZVF4UAXYONTXXFWSGI6CJ56DXU6O": null,
- "UR6JGWK36D4CU63DYI722UFUKLB2S52ZI4OAVZM7CVGGY3SW": null,
- "VGQOGZH3H5IAFESOYWHOQGU5FHP4BJAUUK2B7AKDCJX3PUE5": null,
- "Y5GO3VITRDTHWTMUULEA44BVX3GHVLIWFMTNUY2APWRL3JLD": null,
- "F7U4AV4VU7YAEDK6SI64JJUNEHG2MEFLKNOI77IVDQS7BGJK": null,
- "D77762UIMSS52GNAPWFCEEFPWGYLBPKWMBN75S3HCOI2SYCL": null,
- "NNRBK2PM7FI7MVFBSUUCZVFTDOKXLNVK6I4MMUXU4AKDPTCK": null,
- "YSGZXEZQRGZ3DSMNCNH6GSWGCRWQSIRD3IOR5E3XEUH5RORJ": null,
- "P6KRZXZTESTNZHYLZFTDLZMIGIN5H74H2KYUTNRIC3JWCNJ2": null,
- "QK36OWDC6RHQIASJXU2HZVIBARNIESSCWKICTRQ4B3OFUB6D": null,
- "JQBWWRLDDMH3HACHKR7EKXFCAAR5E62DX3ALK22Y5AFA4JDZ": null,
- "WWOLYDEZIQARIEC65MFSVB5RH3236B3E2YSGNEN2QY6A2G54": null,
- "QT5UVU5QUPEY7VCTTW26JTO2FBUUBCRBYZORWGTYQZ2JZSCH": null,
- "PJQFD75BGF35X4N33WD423KSDLIAWJNAZUBXQTUGHOW4PTXJ": null,
- "A5VRG2DRN3CKKTP2DN5YNILXVCZRTKFXWILKWLZ6PNVKJTM5": null,
- "TY4YPLWS4MDSKPG2HHIRSAWK37LFVB357RGGBRFP2P332HJL": null,
- "SUC7ZGB6YKDYNAP6NTUZVEVNDL22KBCRZIGAWSOBUAL55LDE": null,
- "Z5I7WKVA6754S4G7QWWXYTRZ3SGEG4B3KG5MLHP3GJDI3H7M": null,
- "VLGCWOT665AT2R6EMOAVHNKVM2NKPSV4KI4CMNEUZ2YMI3UP": null,
- "YJMQW3C2NIIZKTJY34XRL4HQ5A7EUMLMXTJFHHRE3NR3QGZF": null,
- "TOEB56GVW7OQ7QLL25ZY3ABP4ZQS2ZZMIJRNTILE5CWA2IZB": null,
- "5RGLCKE6D2MM5YH74OJBDHTOZIM7LN3EIYBLXVF4PGNBZON4": null,
- "QMQPPFLB6NCEBYCQ5U2YWVYWRKZSFJLCDAAPYSPURDLXAU6G": null,
- "UTAFBURT6XHHZV3Y5OZJBJJQT4342SSCOLWT35GZIJUPWTTM": null,
- "XCIXTAB5SB5EMQLZW7GCBUS2N3XU44YELMLSYIFAJHHGP3VS": null,
- "LWL5AM7Q4JPEDEORTLNDWUF5X4AIUI4QC5S4CWUXKXIWP6FP": null,
- "M4RONO5HAPE25Q46SSRBVQLEXPCVQLKOKX2NYQWX2SNNGEVB": null,
- "UVSHBLSXOHEF3AGG5PDTTDFVXNQPRHCNUTXYDEXJVXI7JCPL": null,
- "C3PB24XOHCI52DU64XQL2V2OKZZYG5B4T6PUU44DZCH4DMSS": null,
- "VGACAPDUB2J7KLW5PA474JQZWZ6QCDYYB2I32ZFYGXR64M2Y": null,
- "NNDVFWEC2OE56D5PLJWEEVG25TMXCXISOUOYDOUEMUZRMZK4": null,
- "57TIZBR3DXRX74YXCSJ2RXLZRXKX3K7H6WPS7DVONX7DOJY3": null,
- "RFSCST6ITGG53EAZEBXD2VFQTJ53ATEOORQV6SQG5OSDR3FM": null,
- "YLIXTKYNMODZNBM3L2EL435GD2LRJ5XAJBDZSYCU3OPZ4N4V": null,
- "FBEPPECF3L4RB6QBQLGL44JDBCQCTQ5MOFYFCUQVNL4DCQYV": null,
- "PAJST32KEXY6I2Y57OASSUFLF2BLPQQ7NZMVN6EVR7JS5LY3": null,
- "76MHL43MEQWH6R552TULI3TLBOR22YDMJC5ZYQVWCNI4BWF2": null,
- "A6KZM4OXBKW2NJ7X545F4LIDSC7LIAFYJ4CJSWW2BWSIRWUY": null,
- "VND76C7TCKQT6R4X56OD4UYSOBZGC5BQ3LR6RXOX6LA3I5F6": null,
- "CE2NODHXCRS4ML26HTI77Q57R7ZXKZO433LHHA66I5U3Y5GP": null,
- "3DGAXWQDLZBPUYZPBGMRZG5DOBPTIHKAXFSCBLMEQHZ2A4W2": null,
- "NAOTRV3ZNB2PK6RZJZ4UEQVF5M3YISGJNFZQQWPV2S5RL7XM": null,
- "HLCSR65OBO7BJQPOA65Q6BRDVFPOL7FJII2LOANRJNUM2DDU": null,
- "YCBI6X4JLTHKGAFR7XYKELWE7JW6VHLMFJIWF2ZC7BPCQFFR": null,
- "QEF3LB5GFEMHAUDKPPNYGRKUUV6PAWU5XXYCFIHXI7PLGVGW": null,
- "ABBQK5JKJZLMX4KGFODWSEHOPDTRHGDZCBO3ULBVOGUIAAGI": null,
- "HZLWUQNBAZJSDZEB6IPXQIUMVWUPYVMVP2N72NJ4MOZFUKGT": null,
- "7SQCYMGSMYW47TXUWC2J5674L4CRDIAO34D342D7IJ6OE23F": null,
- "YAQCDYBXIOY3KZGFJCPS5VD7YQBPBFFFYEA4DPWFWJCWCJXA": null,
- "HCZ7SSO422NW6O3ARCBUGNBCMUVEAHXMVKAJSDBHAQSFXIMV": null,
- "DPX2FNJNMFQT34DLAOEIN4KMWJYLOEGV7U4VDH635AG6UA5T": null,
- "QUO6FPOFFXUUKAZXYRN7N2MMT7IOJEG6NLFIH7B5JI5V2Y44": null,
- "UJ6G5JMOINYVRLVISHWTGQDDDWA6X3QDFICKY4QQIHG3QMF4": null,
- "ZR3VRUOZMQE4EMVT2WDB45TJ7KB5AGU5UBBPNL2A2D255MOL": null,
- "2AFEUH4R6YAJZEODKJBMLDM4ANLCKRU2C33HFSVU2LLXZW5Y": null,
- "3S4PV2VOBFB6GFRPG5SB3EHMZE5M7VAAFRJ3JQYHZEFTEKFX": null,
- "6EFK4THSCBEG4LDSVE5N5FXSQJTYB5SQ7LKJRBL6IYIREWTN": null,
- "HHYCWLKLIII7MJ4MYU7CJZ4YPOOUVWOKLXHZV5NT6LU7WWGX": null,
- "XYRSXFI6XRY3YACAIVIZJAVKFTZPRH5FXD7E4P4LYUGX6I5U": null,
- "6W72FMK5AP56TNCZ3LE5OTYZ3WYPARBB5AOXDVHGCBOTWZTO": null,
- "7YNUW4DUCHUDJSSAWSYOYM2QXWTVSJWGDPIG2EAABTU4QLU5": null,
- "HNVXP5XULHDT666ND2M3X2APGXOBCB7SCQB2D7MFQKKNVOS4": null,
- "MLCMV4777C55OEVW3SFO4VHH56O7BSIDLZFYYTY3JXNN4DWG": null,
- "MSNRSOCYC3HQCUXRLCBYFYQOMJFBDOSHJ3HYYYOHEPODETEE": null,
- "BJB2U3W5ZF7WQVTL6R2F542WSS6FQDSVDMXNYWIC5PHED4HH": null,
- "E26RFAVZYOV5WZ6WQDVINCGNG6ZYU2XCV4FPEKR45IASGARQ": null,
- "4BK33GLSBFLRZHOHECAVVYT3LJHSQ5RFBSMKLMGTK4Z5RGZO": null,
- "5I3526BP3QPLNDBEIPVQL2GOAMRBAYWOMILMQK5IT7RES3EV": null,
- "IBHOZ4VNFYMLMUNOZIGK743IVASI3DXHCY2RH6SO4EKNGR4A": null,
- "CCZT4EOMTISCMIVGMB2ZRUGFIR3R6WKU3ISSJ3VZVA6SBLFC": null,
- "OGJUH7B3WKG3W2UFEBL63KLQGPSPRNIHUUKWTKQMBN5QG42E": null,
- "Y6JCIA2AYVA3RDOUQFYWI4EMF64H5FIFNAHSKZ6LXCRXCFGW": null,
- "VX3OCLLJZPGXWTLGERIMK5IS4OXKU65SMC4YS5JZND6VEPO7": null,
- "UXWF26BRES53JKXYXEG5DWJXCR6USGPBWQBDJEVEBA2PPUAI": null,
- "IB5SSNMYSFCNB4ODT5OQ2GAGPIVDWOBEI3P3EBWI7AUGC7BR": null,
- "ASIAQKC3VSFJE7ZW472ZOAXX2T7JTCLZBN5BYEOAE7E67F5Z": null,
- "BKQ3GY255BDDVZ52IIR5K3NFIEKV6GXBVTX3ROY3IN7XDAHA": null,
- "JTV5ULWFJJOSFTX32FA6DJWADX5UL3NV4RZZS3Z64IPXDZNK": null,
- "GSZ7MZXCFKAWFBXKRVYUDULPJEH3WSI2K634LAAA36M2FRF3": null,
- "HSPTZMNCONTGJGIUWP7ZR277AYWTDIKPAWO4RODOIHQGEUF3": null,
- "4ABCWRBBUAO5TVOSOZDF3KMCUCKIUCRJSBGH4WGKDHWH3LLN": null,
- "K3BK4XFUTDJLS7KY4WJBS7RTZ65HY4N5NJ6AMKNKGO3K6DXG": null,
- "S4VZEKYRNOXUITHJENCBKJN6CC6QV7Y4MIHQ6NLN24OJFMBP": null,
- "MRM4HMHS2KAISLXU2XYFQCQH7XRVVC3EXSP6JU7FIM2DJHVV": null,
- "QMNCR2JQYOST5MD3HI2I4MCTSJDFCAGUTEE6XKM2THC4WXI3": null,
- "ANIF4DT5IA4IY7M5OISD4IW4J2TDVHHFIPEONUU4CV75LOFZ": null,
- "TQHJIX3NKO5CMVRNOG4WP3YDSGPLTTCRBA3RDBPECWO6EN5U": null,
- "6KI4L4RRXZ6WL3TRMCZLAA2W7AQRXDCC43O6AGYJ75NUEQO6": null,
- "VL57QTQMHQOAX5MFQTX7GUWOECHVTLYJHIBRKMWIRF4QMN6M": null,
- "JFTGBEP2LSZGDDFGV6IV2JAS3J3HB7BDRB6WEYHSC5EIFNA3": null,
- "WLEZIN5PPCJE4W2LGEPW4N6AWQ4RLE2AOGFBTETY5HNRSZCY": null,
- "LUJRHNRDNK7YOKST7KRVQGVE2ERU3LUVPZLC5YYLCUAX2EEU": null,
- "F2OOXAP3FFVMQMJP5IVDLRVV6IP2NUTGT5MGZCJMR2IFNA55": null,
- "SVL525L4TVBTLMH22DTXVCNECAZVUTMMYDTA3UQGV7U6P3YU": null,
- "546BD77L33PUPQ7TW3GJJVVJTYKHIIKF7YOO4SSGIIIOIJ2Z": null,
- "FCZRNOURTDJI2BE7HJ3P4MMY4WYAPFFBCTVFXVTYSK4UB4JK": null,
- "S2U5XQEC7I4HOUUR6HFXUF2PR2CLNF5UEIPJHTNF2JM5BZUJ": null,
- "JTQGSOTIPVYKGYJBUQC3Y44RWE372S7MPMFDETMH6OEGUJWA": null,
- "W3DTWDN6YOEPVUJVUDNPWCLQMXXCLXQPVYU27675LZM4ONDF": null,
- "LJ7P7AJNNHJE24PNWQDK7J4VGGNZKKR3OPVRFV5A4U6LRFRW": null,
- "I4QO3SZC4455G5PQIJPUUNI4A2BPJKTH5MBA7LN3HRIW6EFZ": null,
- "NNR3EXDDDPBTOKTRBPR5SO4OFPXU376ZIEHA6YHEJK57ZRGH": null,
- "4MBIV5HD4ZMXY5NIKZQIFKFO7S642PC7CWVX7ATXAXWQWNGU": null,
- "A6S5KTN66UWYBWG5CZXJVCJ2F2EA22BCZDFQMM523DU7VFBG": null,
- "AOAPML4IEVJZSZUOONTTDYSEN465IHW7MZXHSQ55E47TJ2NW": null,
- "ZIW5DXTPGQLTTRHPRQB7SADQPCSTXQRMKHZIXA6T6YW2BMRS": null,
- "OUHF6P7JPB5Z2C2E5MEPNQ5R3NY56KNQFHG3RYGWXBYKRRI7": null,
- "M3JXOC3CTIEMVHTQW7HB2WQ7L7Q54AWFY6F2UBTSZMDXHTDI": null,
- "WQQA7JW5NTSAI73WVQMMAJ4IO6OKZR32GTQTMUWE2HLC7DRH": null,
- "WGDVRLD5YWTXFOFTGBBEFCG455EK3BZCZEE2POAX56O3EOQW": null,
- "6KAR3LTBYTJ6WRGOUQ2TEPZKWVVBPGCO4OVAN2ADNDNLTOSM": null,
- "VEWL2DORBATRWF5HJ7LG66NYWMXH37JJU6XWVGJNDVL3OSAM": null,
- "B4HXCGMG5S3VEOZR5IUYOZAEFL6WPRLXB26SLWZHRY3WL3ZU": null,
- "REKI5EIO6TNXBWJIENJDQ5CAYEYZC2GXVPAOIWGVXKN2K3OE": null,
- "RBOY2SVFDRIKJZWTWVEGSJLHGIMAZXIF5HNBZAKPVRTEFR3A": null,
- "SIOSHIHS52CHIB73RFONJOM2HJBTRLGGDFW6JAWTR6UPJBVB": null,
- "ZGHKTW43CXC3CBOLSENIMDQUIR22VNXSE6HFBT6ZUA3TPODL": null,
- "XA576OGJNZK3AXE3FJLSSGN5MGRK4FJJ2XX3UHHFI6NO7P25": null,
- "22VL7B7ZI53VMYEYHKBI7XYNKRQW634B6RLBRXRJN4CQJA6G": null,
- "YVHEMU6OLF3FI2MTMZ25QKT5F2OUO3H6CX4WRNEXVH4BO3WZ": null,
- "3VJOBPUJI5DUFHNRM456UWSAHIZYXICY7ZFYMECCUHDTG444": null,
- "BXLYOEBYW7R4MWPNTOZ2ZJPDDXBHV7JMH75NCD26VGS2VRH7": null,
- "GCZOZTTLMHTAKVUQ4TSDOOPHEGK6PH4JQ3ULKZCUIEDW2HLX": null,
- "TE6B4JOPAY2CEQ46KJV7N6MY7OAI4VA3UBBXGPOELN7KY5T7": null,
- "62BPAKDHZ7ZRJOMVZ2SX2WAKFQATUQLKDQ7YGACJPL2NP4UR": null,
- "6U3MTBST24MIPS3HSZJPTBSZJ54T63GMZGZQPGFBS7JGBUVX": null,
- "SXBYC5BKXYT4DFNVSS4OVRYLNA5JY4TXMVTIFSCRT6Q5C265": null,
- "TAMMZOCU5GDDOIRG6U53NW3UUEUGI3QWW6YY6GWNE7WIHRNE": null,
- "O37BSKPNGDUUN24XFSCR2IQHWFYUZJBPWSNC4L43MH5HV272": null,
- "AZFWV3I3DANXV3HJB66QMCFJ3UTVJGS3R3IP7VROF2D5JF6U": null,
- "W2BLY5MU4PA7HSENYW4MO6VHHPBXUFCFMSBWTCL5F3BIPBFT": null,
- "ILFL3JG2XQGZCFBJHZFQRZMLGHZWVRBX3M5Z3HXW2A4GDMNK": null,
- "O7VDC3EDG5I567RK5BKXMKA2R6XPHQQPDXQTCZP7BHKV5BK6": null,
- "5ZMIJOTL3NPRKBEPS7542ICCNHHUJ2BNOZ7LSL2ICTCUFGSC": null,
- "FCTKLPX7PYRSVVBH4KN46HEYLJEYSRTQ3PCUU5RY3BROUZKU": null,
- "7EAMJ4C7NUA3XMDDOF3YRJA7Q2BFXFCI4J24ZXSVE7REBRFU": null,
- "NOQ6OL6G7QD4ILQ3FAEMEMROBCK4OK3LX3CRMHMA6GG5YIYK": null,
- "N3XXFRDRYPWGZ3LDGLIXGLLJYKEHPW4565BUUL67OLMXP554": null,
- "GFHEEY3HHESZDI2YHTDDCBKGE3ZPWPXW2WE5AKNL2Y2TJCNJ": null,
- "JTUQIEPPBM2QC6XBY3KP2NSDM6WUCJMORCBXNU6ZPXPOHEIW": null,
- "V5VTVJ36JZDDO5FIOEZNAKYWPRQSUSTEZAKARDOHQEIFLACE": null,
- "KUTOUNOS2QL4O6HF266ANCBNYUSIT66TANXCGYALCPZXULQH": null,
- "CJILUW3VUBZCSO5DXTSE4HSVW5UJAJHHCSHGHADKCQE5OTBU": null,
- "HD72YVUCR4IY5MG3E73UM35ARFCUIHEPIMUSQXOKLVTT2V67": null,
- "ELVTZXW3ZAKR76K6IV6ZHX7WTMKPKIFRPHIU3LK67WQR6IQG": null,
- "NIZTNRLCIS4JDLMOTEAKPA6B2JOE76ZBQDEUUGXENEJBYJFV": null,
- "FE743ELPJYDYWTJ374PZVE4TNGZPDZWSNUO5PATNYUYBDTBJ": null,
- "FIT3JHSZMFJ7N2E7BL6PHEUUHSBHU55YBIH763TGSZQTIAZY": null,
- "AP7SXAQ6HW373QPCHKKA4R7NFFUCD7CFB7EERZBNXRGM2Z7R": null,
- "BAW6TALQRWXK2OWS2O2UV72BKZGBZCUPR6AXKFZ7WHZXZXWX": null,
- "SM3FE7H4NI76AS5YCH6O34LTROZKJ7FEP4IKL33JUBI7FWZJ": null,
- "BNO2EJXVMAPFDVF34NBTPSIYKI3UPFI5G2K6KGVU35TIHOQL": null,
- "INHCLRC6WPTE2U7OQRSSRGCN4B5K4BUVSGFHEKG5DWJWICOF": null,
- "OEHWM7QZ3H67QC4ZQY2USKQA62NLMESA543KWPBUKV7N65TQ": null,
- "BN3U5KDJP3QGOSBX3TH5R2DR6PZA5Z7BEGVG6MYRW5GWUCGT": null,
- "ID7S7JEGBCI7ES3ZN7PIW5NEP67WTL5H5IB6WVRYS47EEEJ2": null,
- "BG4MHZNCCLZQN563CZ2D72CPT5TASZZ6N6L4JOW2XPR7GIDQ": null,
- "IAQKAEEUCCT3ZZY5LCO4AZW6F6ZNGUAF56UCD43OPOKSMBHR": null,
- "LFCSYYMAFZ5IAB5O4QIEN5GERYIGTH4JH266LORQ36SB2A26": null,
- "J7W62H5B42N3YUEFS5F2MECESYBUVHXSIGRMZL6ZNQMCYQMQ": null,
- "J24FG5J3MUQOCDAVVCHM6BJWZW4Y7VCSC73DW32TMKIUOXPB": null,
- "DGJE6OPBSV3JW45P5WC3EGUMIETVT7MIZX4EA5SCY2F3JKFL": null,
- "KWTJYJJT2LMBHE6WH4LNJEHNMNJVOEQ7SLLXGJKWPGOFDYHQ": null,
- "7XZDDO3CCV34UECRKEM344EDKKUFD6YDUJ7EW4OAETABTYWV": null,
- "BPS2OSY2SOAFFPRY24IEXGZVBEUNVIWZYTVVZRUWT7XM727T": null,
- "6GRVGHI3FMCQ5MQ4JR7ORANBXK6GMSI4XRQVE35LPH44XROO": null,
- "MZHRR2BS6HII6JD3H32DPSYTTHCVXE4WSC7NUURU43Z5SD56": null,
- "QJBSWHFQKABG4CALELT62JWLMW2JVZP35RDYHWHQPZYTIX5M": null,
- "K2Y3YRBFB7F5PJJUFJDH5Z5NL2MYOQWGT5T5VI5SP7TVM5NW": null,
- "QLONNH4NMZX5WLEJPQEWJECL5JTLTWDSK234NU5H55GA6PFG": null,
- "NSSRUR3GI6B7NBK77ZQIIHOA4TEEA5UXVVMRWVLMRIP6SN3T": null,
- "WB2TXRE7EPSBGACXUA4YE23M4WLMG3PVRMD2OOCIHNGQVDRY": null,
- "3MDCQC5BPGFGGFDO4C4IY53NPTWZMRK5MWLJG2KX7OWVQNFO": null
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/booleans.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/booleans.json
deleted file mode 100644
index 2dcbb5fe87..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/booleans.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- true,
- true,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- true,
- false,
- false,
- false,
- true,
- false,
- false,
- true,
- true,
- false,
- true,
- true,
- true,
- false,
- false,
- false,
- true,
- false,
- true,
- false,
- false,
- true,
- true,
- true,
- true,
- true,
- true,
- false,
- false,
- true,
- false,
- false,
- false,
- true,
- true,
- false,
- true,
- true,
- false,
- true,
- false,
- true,
- true,
- true,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- true,
- true,
- false,
- true,
- true,
- true,
- true,
- true,
- true,
- true,
- true,
- false,
- false,
- false,
- false,
- false,
- true,
- true,
- true,
- true,
- true,
- true,
- true,
- false,
- false,
- false,
- true,
- false,
- false,
- false,
- true,
- true,
- true,
- false,
- false,
- true,
- false
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/floats.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/floats.json
deleted file mode 100644
index 12b94a11dc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/floats.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- 135.747111636,
- 123.377054008,
- 140.527504552,
- -72.299143906,
- -23.851678949,
- 73.586193519,
- -158.299382442,
- 177.477876032,
- 32.268518982,
- -139.560009969,
- 115.203105183,
- -106.025823607,
- 167.224138231,
- 103.378383732,
- -97.498486285,
- 18.184723416,
- 69.137075711,
- 33.849002681,
- -120.185228215,
- -20.841408615,
- -172.659492727,
- -2.691464061,
- 22.426164066,
- -98.416909437,
- -31.603082708,
- -85.072296561,
- 108.620987395,
- -43.127078238,
- -126.473562057,
- -158.595489097,
- -57.890678254,
- -13.254016573,
- -85.024504709,
- 171.663552644,
- -146.495558248,
- -10.606748276,
- -118.786969354,
- 153.352057804,
- -45.215545083,
- 37.038725288,
- 106.344071897,
- -64.607402031,
- 85.148030911,
- 28.897784566,
- 39.51082061,
- 20.450382102,
- -113.174943618,
- 71.60785784,
- -168.202648062,
- -157.338200017,
- 10.879588527,
- -114.261694831,
- -5.622927072,
- -173.330830616,
- -29.47002003,
- -39.829034201,
- 50.031545162,
- 82.815735508,
- -119.188760828,
- -48.455928081,
- 163.964263034,
- 46.30378861,
- -26.248889762,
- -47.354615322,
- 155.388677633,
- -166.710356904,
- 42.987233558,
- 144.275297374,
- 37.394383186,
- -122.550388725,
- 177.469945914,
- 101.104677413,
- 109.429869885,
- -104.919625624,
- 147.522756541,
- -81.294703727,
- 122.744731363,
- 81.803603684,
- 26.321556167,
- 147.045441354,
- 147.256895816,
- -174.211095908,
- 52.518769316,
- -78.58250334,
- -173.356685435,
- -107.728209264,
- -69.982325771,
- -113.776095893,
- -35.785267074,
- -105.748545976,
- -30.206523864,
- -76.185311723,
- -126.400112781,
- -26.864958639,
- 56.840053629,
- 93.781553535,
- -116.002949803,
- -46.617140948,
- 176.846840093,
- -144.24821335
-]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/guids.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/guids.json
deleted file mode 100644
index 9d7f5dbc8f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/guids.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- "d35bf0d4-8d8f-4e17-a5c3-ad9bfd675266",
- "db402774-eeb6-463b-9986-c458c44d8b5a",
- "2a2e4101-b5f2-40b8-8750-e03f01661e60",
- "76787cfa-f4eb-4d62-aaad-e1d588d00ad5",
- "fd73894b-b500-4a7c-888c-06b5bd9cec65",
- "cce1862a-cf31-4ef2-9e23-f1d23b4e6163",
- "00a98bb0-2b6e-4368-8512-71c21aa87db7",
- "ab9a8d69-cec7-4550-bd35-3ed678e22782",
- "f18b48e1-5114-4fbe-9652-579e8d66950e",
- "4efe3baa-7ac5-4d6a-a839-6b9cfe825764",
- "b4aec119-5b0a-434c-b388-109816c482a5",
- "e0ef0cbb-127a-4a28-9831-5741b4295275",
- "d50286a5-cb7b-4c9e-be99-f214439bae8c",
- "a981094c-f1ac-42ed-a9fa-86404c7210ff",
- "2a34ee57-5815-4829-b77b-eeebaa8fe340",
- "a0530d44-48f8-4eff-b9ea-8810c4308351",
- "c6f91509-83e1-4ea1-9680-e667fbfd56ee",
- "cab11402-dcdd-4454-b190-6da124947395",
- "283d159c-2b18-4856-b4c7-5059252eaa15",
- "146157c6-72a8-4051-9991-cb6ea6743d81",
- "aef6f269-7306-4bd2-83f7-6d5605b5dc9a",
- "37fe6027-d638-4017-80a9-e7b0567b278e",
- "5003d731-33fb-4159-af61-d76348a44079",
- "e0e06979-5f80-4713-9fe0-8a4d60dc89f8",
- "7e85bdc3-0345-4cb6-9398-ccab06e79976",
- "f2ebf5af-6568-4ffe-a46d-403863fd4b66",
- "e0b5bb1c-b4dd-4535-9a9e-3c73f1167d46",
- "c852d20b-6bcb-4b12-bd57-308296c64c5a",
- "7ac3ae82-1818-49cd-a8a4-5ac77dfafd46",
- "138004a9-76e2-4ad7-bd42-e74dabdbb803",
- "ab25b5be-96be-45b0-b765-947b40ec36a6",
- "08404734-fd57-499e-a4cf-71e9ec782ede",
- "8dfdeb16-248b-4a21-bf89-2e22b11a4101",
- "a0e44ef0-3b09-41e8-ad5d-ed8e6a1a2a67",
- "a7981e49-188d-414a-9779-b1ad91e599d1",
- "329186c0-bf27-4208-baf7-c0a0a5a2d5b7",
- "cb5f3381-d33e-4b30-b1a9-f482623cad33",
- "15031262-ca73-4e3c-bd0a-fcf89bdf0caf",
- "6d7333d1-2e8c-4d78-bfde-5be47e70eb13",
- "acaa160c-670a-4e8f-ac45-49416e77d5f9",
- "228f87eb-cde4-4106-808b-2dbf3c7b6d2e",
- "2ff830a3-5445-4d8e-b161-bddd30666697",
- "f488bedd-ff6e-4108-b9a7-07f6da62f476",
- "2e12b846-0a34-478e-adf7-a438493803e6",
- "6686b8ef-7446-4d86-bd8c-df24119e3bfe",
- "e474a5c5-5793-4d41-b4ab-5423acc56ef1",
- "ac046573-e718-44dc-a0dc-9037eeaba6a9",
- "6b0e9099-cf53-4d5a-8a71-977528628fcf",
- "d51a3f22-0ff9-4087-ba9b-fcee2a2d8ade",
- "bdc01286-3511-4d22-bfb8-76d01203d366",
- "ca44eb84-17ff-4f27-8f1e-1bd25f4e8725",
- "4e9a8c2f-be0b-4913-92d2-c801b9a50d04",
- "7685d231-dadd-4041-9165-898397438ab7",
- "86f0bf26-d66a-44d8-99f5-d6768addae3b",
- "2ca1167c-72ba-45a0-aa42-faf033db0d0b",
- "199a1182-ea55-49ff-ba51-71c29cdd0aac",
- "be6a4dd2-c821-4aa0-8b83-d64d6644b5b2",
- "4c5f4781-7f80-4daa-9c20-76b183000514",
- "513b31bd-54fb-4d12-a427-42a7c13ff8e1",
- "8e211bcb-d76c-4012-83ad-74dd7d23b687",
- "44d5807e-0501-4f66-8779-e244d4fdca0a",
- "db8cd555-0563-4b7b-b00c-eada300a7065",
- "cb14d0c9-46cc-4797-bd3a-752b05629f07",
- "4f68b3ef-ac9b-47a0-b6d7-57f398a5c6a5",
- "77221aae-1bcf-471c-be45-7f31f733f9d6",
- "42a7cac8-9e80-4c45-8c71-511d863c98ea",
- "f9018d22-b82c-468c-bdb5-8864d5964801",
- "75f4e9b8-62a2-4f21-ad8a-e19eff0419bc",
- "9b7385c8-8653-4184-951c-b0ac1b36b42e",
- "571018aa-ffbf-4b42-a16d-07b57a7f5f0e",
- "35de4a2f-6bf1-45aa-b820-2a27ea833e44",
- "0b8edb20-3bb4-4cb4-b089-31957466dbab",
- "97da4778-9a7b-4140-a545-968148c81fb7",
- "969f326c-8f2a-47c5-b41c-d9c2f06c9b9d",
- "ae211037-8b53-4b17-bfc8-c06fc7774409",
- "12c5c3c4-0bd5-45d3-bc1d-d04a3c65d3e6",
- "ec02024f-ce43-4dd3-8169-a59f7baee043",
- "5b6afe77-ce48-47ca-90a0-25cd10ca5ffd",
- "2e3a61d4-6b8f-4d2f-ba86-878b4012efd8",
- "19a88a67-a5d3-4647-898f-1cde07bce040",
- "6db6f420-b5c8-48b9-bbb2-8864fe6fed65",
- "5a45dbde-7b53-4f6b-b864-e3b63be3708a",
- "c878321b-8a02-4239-9981-15760c2e7d15",
- "4e36687f-8bf6-4b12-b496-3a8e382d067e",
- "a59a63cd-43c0-4c6e-b208-6dbca86f8176",
- "303308c4-2e4a-45b5-8bf3-3e66e9ad05a1",
- "8b58fdf1-43a6-4c98-9547-6361b50791af",
- "a3563591-72ed-42b5-8e41-bac1d76d70cf",
- "38db8c78-3739-4f6e-8313-de4138082114",
- "86615bea-7e73-4daf-95da-ae6b9eee1bbb",
- "35d38e3e-076e-40dd-9aa8-05be2603bd59",
- "9f84c62d-b454-4ba3-8c19-a01878985cdc",
- "6721bbae-d765-4a06-8289-6fe46a1bf943",
- "0837796f-d0dd-4e50-9b7c-1983e6cc7c48",
- "021eb7d7-e869-49b9-80c3-9dd16ce2d981",
- "819c56f8-e040-475d-aad5-c6d5e98b20aa",
- "3a61ef02-735e-4229-937d-b3777a3f4e1f",
- "79dfab84-12e6-4ec8-bfc8-460ae71e4eca",
- "a106fabf-e149-476c-8053-b62388b6eb57",
- "9a3900a5-bfb4-4de0-baa5-253a8bd0b634"
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/integers.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/integers.json
deleted file mode 100644
index 5dd05e097a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/integers.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- 8125686,
- 8958709,
- 5976222,
- 1889524,
- 7968493,
- 1357486,
- 118415,
- 7081097,
- 4635968,
- 7555332,
- 2270233,
- 3428352,
- 8699968,
- 2087333,
- 7861337,
- 7554440,
- 2017031,
- 7981692,
- 6060687,
- 1877715,
- 3297474,
- 8373177,
- 6158629,
- 7853641,
- 3004441,
- 9650406,
- 2695251,
- 1180761,
- 4988426,
- 6043805,
- 8063373,
- 6103218,
- 2848339,
- 8188690,
- 9235573,
- 5949816,
- 6116081,
- 6471138,
- 3354531,
- 4787414,
- 9660600,
- 942529,
- 7278535,
- 7967399,
- 554292,
- 1436493,
- 267319,
- 2606657,
- 7900601,
- 4276634,
- 7996757,
- 8544466,
- 7266469,
- 3301373,
- 4005350,
- 6437652,
- 7717672,
- 7126292,
- 8588394,
- 2127902,
- 7410190,
- 1517806,
- 4583602,
- 3123440,
- 7747613,
- 5029464,
- 9834390,
- 3087227,
- 4913822,
- 7550487,
- 4518144,
- 5862588,
- 1778599,
- 9493290,
- 5588455,
- 3638706,
- 7394293,
- 4294719,
- 3837830,
- 6381878,
- 7175866,
- 8575492,
- 1415229,
- 1453733,
- 6972404,
- 9782571,
- 4234063,
- 7117418,
- 7293130,
- 8057071,
- 9345285,
- 7626648,
- 3358911,
- 4574537,
- 9371826,
- 7627107,
- 6154093,
- 5392367,
- 5398105,
- 6956377
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/mixed.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/mixed.json
deleted file mode 100644
index 43e9a1d7be..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/mixed.json
+++ /dev/null
@@ -1,592 +0,0 @@
-[
- {
- "favoriteFruit": "banana",
- "greeting": "Hello, Kim! You have 10 unread messages.",
- "friends": [
- {
- "name": "Higgins Rodriquez",
- "id": 0
- },
- {
- "name": "James Floyd",
- "id": 1
- },
- {
- "name": "Gay Stewart",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "pariatur",
- "ad",
- "eiusmod",
- "sit",
- "et",
- "velit",
- "culpa"
- ],
- "longitude": -57.919246,
- "latitude": -36.022812,
- "registered": "Friday, March 21, 2014 9:13 PM",
- "about": "Laborum nulla aliquip ullamco proident excepteur est officia ipsum. Eiusmod exercitation minim ex do labore reprehenderit aliqua minim qui excepteur reprehenderit cupidatat. Sint enim exercitation duis id consequat nisi enim magna. Commodo aliqua id ipsum sit magna enim. Veniam officia in labore fugiat veniam ea laboris ex veniam duis.\r\n",
- "address": "323 Pulaski Street, Ronco, North Carolina, 7701",
- "phone": "+1 (919) 438-2678",
- "email": "kim.griffith@cipromox.biz",
- "company": "CIPROMOX",
- "name": {
- "last": "Griffith",
- "first": "Kim"
- },
- "eyeColor": "green",
- "age": 26,
- "picture": "http://placehold.it/32x32",
- "balance": "$1,283.55",
- "isActive": false,
- "guid": "10ab0392-c5e2-48a3-9473-aa725bad892d",
- "index": 0,
- "_id": "551b91198238a0bcf9a41133"
- },
- {
- "favoriteFruit": "banana",
- "greeting": "Hello, Skinner! You have 9 unread messages.",
- "friends": [
- {
- "name": "Rhonda Justice",
- "id": 0
- },
- {
- "name": "Audra Castaneda",
- "id": 1
- },
- {
- "name": "Vicky Chavez",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "dolore",
- "enim",
- "sit",
- "non",
- "exercitation",
- "fugiat",
- "adipisicing"
- ],
- "longitude": -60.291407,
- "latitude": -84.619318,
- "registered": "Friday, February 7, 2014 3:17 AM",
- "about": "Consectetur eiusmod laboris dolore est ullamco nulla in velit quis esse Lorem. Amet aliqua sunt aute occaecat veniam officia in duis proident aliqua cupidatat mollit. Sint eu qui anim duis ut anim duis eu cillum. Cillum nostrud adipisicing tempor Lorem commodo sit in ad qui non et irure qui. Labore eu aliquip id duis eiusmod veniam.\r\n",
- "address": "347 Autumn Avenue, Fidelis, Puerto Rico, 543",
- "phone": "+1 (889) 457-2319",
- "email": "skinner.maddox@moltonic.co.uk",
- "company": "MOLTONIC",
- "name": {
- "last": "Maddox",
- "first": "Skinner"
- },
- "eyeColor": "green",
- "age": 22,
- "picture": "http://placehold.it/32x32",
- "balance": "$3,553.10",
- "isActive": false,
- "guid": "cfbc2fb6-2641-4388-b06d-ec0212cfac1e",
- "index": 1,
- "_id": "551b91197e0abe92d6642700"
- },
- {
- "favoriteFruit": "strawberry",
- "greeting": "Hello, Reynolds! You have 5 unread messages.",
- "friends": [
- {
- "name": "Brady Valdez",
- "id": 0
- },
- {
- "name": "Boyer Golden",
- "id": 1
- },
- {
- "name": "Gladys Knapp",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "commodo",
- "eiusmod",
- "cupidatat",
- "et",
- "occaecat",
- "proident",
- "Lorem"
- ],
- "longitude": 140.866287,
- "latitude": 1.401032,
- "registered": "Monday, October 20, 2014 8:01 AM",
- "about": "Deserunt elit consequat ea dolor pariatur aute consectetur et nulla ipsum ad. Laboris occaecat ipsum ad duis et esse ea ut voluptate. Ex magna consequat pariatur amet. Quis excepteur non mollit dolore cillum dolor ex esse veniam esse deserunt non occaecat veniam. Sit amet proident proident amet. Nisi est id ut ut adipisicing esse fugiat non dolor aute.\r\n",
- "address": "872 Montague Terrace, Haena, Montana, 3106",
- "phone": "+1 (974) 410-2655",
- "email": "reynolds.sanford@combot.biz",
- "company": "COMBOT",
- "name": {
- "last": "Sanford",
- "first": "Reynolds"
- },
- "eyeColor": "green",
- "age": 21,
- "picture": "http://placehold.it/32x32",
- "balance": "$3,664.47",
- "isActive": true,
- "guid": "f9933a9c-c41a-412f-a18d-e727c569870b",
- "index": 2,
- "_id": "551b91197f170b65413a06e3"
- },
- {
- "favoriteFruit": "banana",
- "greeting": "Hello, Neva! You have 7 unread messages.",
- "friends": [
- {
- "name": "Clara Cotton",
- "id": 0
- },
- {
- "name": "Ray Gates",
- "id": 1
- },
- {
- "name": "Jacobs Reese",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "magna",
- "labore",
- "incididunt",
- "velit",
- "ea",
- "et",
- "eiusmod"
- ],
- "longitude": -133.058479,
- "latitude": 87.803677,
- "registered": "Friday, May 9, 2014 5:41 PM",
- "about": "Do duis occaecat ut officia occaecat officia nostrud reprehenderit ex excepteur aute anim in reprehenderit. Cupidatat nulla eiusmod nulla non minim veniam aute nulla deserunt adipisicing consectetur veniam. Sit consequat ex laboris aliqua labore consectetur tempor proident consequat est. Fugiat quis esse culpa aliquip. Excepteur laborum aliquip sunt eu cupidatat magna eiusmod amet nisi labore aliquip. Ut consectetur esse aliquip exercitation nulla ex occaecat elit do ex eiusmod deserunt. Ex eu voluptate minim deserunt fugiat minim est occaecat ad Lorem nisi.\r\n",
- "address": "480 Eagle Street, Fostoria, Oklahoma, 2614",
- "phone": "+1 (983) 439-3000",
- "email": "neva.barker@pushcart.us",
- "company": "PUSHCART",
- "name": {
- "last": "Barker",
- "first": "Neva"
- },
- "eyeColor": "brown",
- "age": 36,
- "picture": "http://placehold.it/32x32",
- "balance": "$3,182.24",
- "isActive": true,
- "guid": "52489849-78e1-4b27-8b86-e3e5ab2b7dc8",
- "index": 3,
- "_id": "551b9119a13061c083c878d5"
- },
- {
- "favoriteFruit": "banana",
- "greeting": "Hello, Rodgers! You have 6 unread messages.",
- "friends": [
- {
- "name": "Marguerite Conway",
- "id": 0
- },
- {
- "name": "Margarita Cunningham",
- "id": 1
- },
- {
- "name": "Carmela Gallagher",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "ipsum",
- "magna",
- "amet",
- "elit",
- "sit",
- "occaecat",
- "elit"
- ],
- "longitude": -125.436981,
- "latitude": 19.868524,
- "registered": "Tuesday, July 8, 2014 8:09 PM",
- "about": "In cillum esse tempor do magna id ad excepteur ex nostrud mollit deserunt aliqua. Minim aliqua commodo commodo consectetur exercitation nulla nisi dolore aliqua in. Incididunt deserunt mollit nostrud excepteur. Ipsum fugiat anim deserunt Lorem aliquip nisi consequat eu minim in ex duis.\r\n",
- "address": "989 Varanda Place, Duryea, Palau, 3972",
- "phone": "+1 (968) 578-2974",
- "email": "rodgers.conner@frenex.net",
- "company": "FRENEX",
- "name": {
- "last": "Conner",
- "first": "Rodgers"
- },
- "eyeColor": "blue",
- "age": 23,
- "picture": "http://placehold.it/32x32",
- "balance": "$1,665.17",
- "isActive": true,
- "guid": "ed3b2374-5afe-4fca-9325-8a7bbc9f81a0",
- "index": 4,
- "_id": "551b91197bcedb1b56a241ce"
- },
- {
- "favoriteFruit": "strawberry",
- "greeting": "Hello, Mari! You have 10 unread messages.",
- "friends": [
- {
- "name": "Irwin Boyd",
- "id": 0
- },
- {
- "name": "Dejesus Flores",
- "id": 1
- },
- {
- "name": "Lane Mcmahon",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "esse",
- "aliquip",
- "excepteur",
- "dolor",
- "ex",
- "commodo",
- "anim"
- ],
- "longitude": -17.038176,
- "latitude": 17.154663,
- "registered": "Sunday, April 6, 2014 4:46 AM",
- "about": "Excepteur veniam occaecat sint nulla magna in in officia elit. Eiusmod qui dolor fugiat tempor in minim esse officia minim consequat. Lorem ullamco labore proident ipsum id pariatur fugiat consectetur anim cupidatat qui proident non ipsum.\r\n",
- "address": "563 Hendrickson Street, Westwood, South Dakota, 4959",
- "phone": "+1 (980) 434-3976",
- "email": "mari.fleming@beadzza.org",
- "company": "BEADZZA",
- "name": {
- "last": "Fleming",
- "first": "Mari"
- },
- "eyeColor": "blue",
- "age": 21,
- "picture": "http://placehold.it/32x32",
- "balance": "$1,948.04",
- "isActive": true,
- "guid": "6bd02166-3b1f-4ed8-84c9-ed96cbf12abc",
- "index": 5,
- "_id": "551b9119b359ff6d24846f77"
- },
- {
- "favoriteFruit": "strawberry",
- "greeting": "Hello, Maxine! You have 7 unread messages.",
- "friends": [
- {
- "name": "Sullivan Stark",
- "id": 0
- },
- {
- "name": "Underwood Mclaughlin",
- "id": 1
- },
- {
- "name": "Kristy Carlson",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "commodo",
- "ipsum",
- "quis",
- "non",
- "est",
- "mollit",
- "exercitation"
- ],
- "longitude": -105.40635,
- "latitude": 37.197993,
- "registered": "Tuesday, January 20, 2015 12:30 AM",
- "about": "Proident ullamco Lorem est consequat consectetur non eiusmod esse nostrud pariatur eiusmod enim exercitation eiusmod. Consequat duis elit elit minim ullamco et dolor eu minim do tempor esse consequat excepteur. Mollit dolor do voluptate nostrud quis anim cillum velit tempor eiusmod adipisicing tempor do culpa. Eu magna dolor sit amet nisi do laborum dolore nisi. Deserunt ipsum et deserunt non nisi.\r\n",
- "address": "252 Boulevard Court, Brenton, Tennessee, 9444",
- "phone": "+1 (950) 466-3377",
- "email": "maxine.moreno@zentia.tv",
- "company": "ZENTIA",
- "name": {
- "last": "Moreno",
- "first": "Maxine"
- },
- "eyeColor": "brown",
- "age": 24,
- "picture": "http://placehold.it/32x32",
- "balance": "$1,200.24",
- "isActive": false,
- "guid": "ce307a37-ca1f-43f5-b637-dca2605712be",
- "index": 6,
- "_id": "551b91195a6164b2e35f6dc8"
- },
- {
- "favoriteFruit": "strawberry",
- "greeting": "Hello, Helga! You have 5 unread messages.",
- "friends": [
- {
- "name": "Alicia Vance",
- "id": 0
- },
- {
- "name": "Vinson Phelps",
- "id": 1
- },
- {
- "name": "Francisca Kelley",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "nostrud",
- "eiusmod",
- "dolore",
- "officia",
- "sint",
- "non",
- "qui"
- ],
- "longitude": -7.275151,
- "latitude": 75.54202,
- "registered": "Wednesday, October 1, 2014 6:35 PM",
- "about": "Quis duis ullamco velit qui. Consectetur non adipisicing id magna anim. Deserunt est officia qui esse. Et do pariatur incididunt anim ad mollit non. Et eiusmod sunt fugiat elit mollit ad excepteur anim nisi laboris eiusmod aliquip aliquip.\r\n",
- "address": "981 Bush Street, Beaulieu, Vermont, 3775",
- "phone": "+1 (956) 506-3807",
- "email": "helga.burch@synkgen.name",
- "company": "SYNKGEN",
- "name": {
- "last": "Burch",
- "first": "Helga"
- },
- "eyeColor": "blue",
- "age": 22,
- "picture": "http://placehold.it/32x32",
- "balance": "$3,827.89",
- "isActive": false,
- "guid": "ff5dfea0-1052-4ef2-8b66-4dc1aad0a4fb",
- "index": 7,
- "_id": "551b911946be8358ae40e90e"
- },
- {
- "favoriteFruit": "banana",
- "greeting": "Hello, Shaw! You have 5 unread messages.",
- "friends": [
- {
- "name": "Christian Cardenas",
- "id": 0
- },
- {
- "name": "Cohen Pennington",
- "id": 1
- },
- {
- "name": "Mary Lindsay",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "occaecat",
- "ut",
- "occaecat",
- "magna",
- "exercitation",
- "incididunt",
- "irure"
- ],
- "longitude": -89.102972,
- "latitude": 89.489596,
- "registered": "Thursday, August 21, 2014 5:00 PM",
- "about": "Amet cupidatat quis velit aute Lorem consequat pariatur mollit deserunt et sint culpa excepteur duis. Enim proident duis qui ex tempor sunt nostrud occaecat. Officia sit veniam mollit eiusmod minim do aute eiusmod fugiat qui anim adipisicing in laboris. Do tempor reprehenderit sunt laborum esse irure dolor ad consectetur aute sit id ipsum. Commodo et voluptate anim consequat do. Minim laborum ad veniam ad minim incididunt excepteur excepteur aliqua.\r\n",
- "address": "237 Pierrepont Street, Herbster, New York, 3490",
- "phone": "+1 (976) 455-2880",
- "email": "shaw.zamora@shadease.me",
- "company": "SHADEASE",
- "name": {
- "last": "Zamora",
- "first": "Shaw"
- },
- "eyeColor": "blue",
- "age": 38,
- "picture": "http://placehold.it/32x32",
- "balance": "$3,440.82",
- "isActive": false,
- "guid": "ac5fdb0e-e1fb-427e-881d-da461be0d1ca",
- "index": 8,
- "_id": "551b9119af0077bc28a2de25"
- },
- {
- "favoriteFruit": "apple",
- "greeting": "Hello, Melissa! You have 5 unread messages.",
- "friends": [
- {
- "name": "Marion Villarreal",
- "id": 0
- },
- {
- "name": "Kate Rose",
- "id": 1
- },
- {
- "name": "Hines Simon",
- "id": 2
- }
- ],
- "range": [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
- 7,
- 8,
- 9
- ],
- "tags": [
- "amet",
- "veniam",
- "mollit",
- "ad",
- "cupidatat",
- "deserunt",
- "Lorem"
- ],
- "longitude": -52.735052,
- "latitude": 16.258838,
- "registered": "Wednesday, April 16, 2014 7:56 PM",
- "about": "Aute ut culpa eiusmod tempor duis dolor tempor incididunt. Nisi non proident excepteur eiusmod incididunt nisi minim irure sit. In veniam commodo deserunt proident reprehenderit et consectetur ullamco quis nulla cupidatat.\r\n",
- "address": "642 Halsey Street, Blandburg, Kansas, 6761",
- "phone": "+1 (941) 539-3851",
- "email": "melissa.vaughn@memora.io",
- "company": "MEMORA",
- "name": {
- "last": "Vaughn",
- "first": "Melissa"
- },
- "eyeColor": "brown",
- "age": 24,
- "picture": "http://placehold.it/32x32",
- "balance": "$2,399.44",
- "isActive": true,
- "guid": "1769f022-a7f1-4a69-bf4c-f5a5ebeab2d1",
- "index": 9,
- "_id": "551b9119b607c09c7ffc3b8a"
- }
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/nulls.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/nulls.json
deleted file mode 100644
index 7a636ec87c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/nulls.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null,
- null
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/paragraphs.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/paragraphs.json
deleted file mode 100644
index 8ab3e1c561..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/paragraphs.json
+++ /dev/null
@@ -1,102 +0,0 @@
-[
- "Commodo ullamco cupidatat nisi sit proident ex. Cillum pariatur occaecat in officia do commodo nisi cillum tempor minim. Ad dolor ut et aliquip fugiat eu officia cupidatat occaecat consectetur eiusmod veniam enim officia.\r\n",
- "Adipisicing cillum laborum nisi irure. Cillum dolor proident duis nulla qui mollit dolore reprehenderit mollit. Irure nulla dolor ipsum irure nulla quis laboris do.\r\n",
- "Est adipisicing consectetur incididunt in. Occaecat ea magna ex consequat irure sit laborum cillum officia magna sunt do exercitation aliquip. Laboris id aute in dolore reprehenderit voluptate non deserunt laborum.\r\n",
- "Consectetur eu aute est est occaecat adipisicing sint enim dolor eu. Tempor amet id non mollit eu consectetur cillum duis. Eu labore velit nulla ipsum commodo consequat aliquip. Cupidatat commodo dolore mollit enim sit excepteur nisi duis laboris deserunt esse.\r\n",
- "Incididunt ullamco est fugiat enim fugiat. Do sit mollit anim ad excepteur eu laboris exercitation officia labore nulla ut. Voluptate non voluptate cillum sit et voluptate anim duis velit consequat aliquip dolor. Elit et et esse laboris consectetur officia eiusmod aliquip nisi est. Qui labore dolore ad dolor.\r\n",
- "Anim adipisicing est irure proident sit officia ullamco voluptate sunt consectetur duis mollit excepteur veniam. Nostrud ut duis aute exercitation officia et quis elit commodo elit tempor aute aliquip enim. Est officia non cillum consequat voluptate ipsum sit voluptate nulla id.\r\n",
- "Ipsum enim consectetur aliquip nulla commodo ut ex aliqua elit duis do. Officia et sunt aliqua dolor minim voluptate veniam esse elit enim. Adipisicing reprehenderit duis ex magna non in fugiat sunt ipsum nostrud fugiat aliquip. Labore voluptate id officia voluptate eu. Magna do nostrud excepteur sunt aliqua adipisicing qui.\r\n",
- "Est occaecat non non cupidatat laborum qui. Veniam sit est voluptate labore sit irure consectetur fugiat. Anim enim enim fugiat exercitation anim ad proident esse in aliqua. Laboris ut aute culpa ullamco.\r\n",
- "Sit et aliquip cupidatat deserunt eiusmod sint aliquip occaecat nostrud aliqua elit commodo ut magna. Amet sit est deserunt id duis in officia pariatur cupidatat ex. Mollit duis est consequat nulla aute velit ipsum sit consectetur pariatur ut non ex ipsum. Tempor esse velit pariatur reprehenderit et nostrud commodo laborum mollit labore.\r\n",
- "Aliquip irure quis esse aliquip. Ex non deserunt culpa aliqua ad anim occaecat ad. Lorem consectetur mollit eu consectetur est non nisi non ipsum. Qui veniam ullamco officia est ut excepteur. Nulla elit dolore cupidatat aliqua enim Lorem elit consequat eiusmod non aliqua eu in. Pariatur in culpa labore sint ipsum consectetur occaecat ad ex ipsum laboris aliquip officia. Non officia eiusmod nisi officia id id laboris deserunt sunt enim magna mollit sit.\r\n",
- "Mollit velit laboris laborum nulla aliquip consequat Lorem non incididunt irure. Eu voluptate sint do consectetur tempor sit Lorem in. Laborum eiusmod nisi Lorem ipsum dolore do aute laborum occaecat aute sunt. Sit laborum in ea do ipsum officia irure cillum irure nisi laboris. Ad anim deserunt excepteur ea veniam eiusmod culpa velit veniam. Commodo incididunt ea Lorem eu enim esse nisi incididunt mollit.\r\n",
- "Velit proident sunt aute dolore reprehenderit culpa. Pariatur reprehenderit commodo ad ea voluptate anim nulla ipsum eu irure fugiat aliqua et. Adipisicing incididunt anim excepteur voluptate minim qui culpa. Sunt veniam enim reprehenderit magna magna. Sit ad amet deserunt ut aute dolore ad minim.\r\n",
- "Esse ullamco sunt mollit mollit. Eu enim dolore laboris cupidatat. Cupidatat adipisicing non aute exercitation fugiat. Non ut cillum labore fugiat aliquip ex duis quis consectetur ut nisi Lorem amet qui. Proident veniam amet qui reprehenderit duis qui. Nisi culpa sit occaecat ullamco occaecat laborum fugiat ut. Non duis deserunt culpa duis.\r\n",
- "Id ipsum eiusmod laboris non est ipsum deserunt labore duis reprehenderit deserunt. Sint tempor fugiat eiusmod nostrud in ut laborum esse in nostrud sit deserunt nostrud reprehenderit. Cupidatat aliqua qui anim consequat eu quis consequat consequat elit ipsum pariatur. Cupidatat in dolore velit quis. Exercitation cillum ullamco ex consectetur commodo tempor incididunt exercitation labore ad dolore. Minim incididunt consequat adipisicing esse eu eu voluptate.\r\n",
- "Anim sint eiusmod nisi anim do deserunt voluptate ut cillum eiusmod esse ex reprehenderit laborum. Dolore nulla excepteur duis excepteur. Magna nisi nostrud duis non commodo velit esse ipsum Lorem incididunt. Nulla enim consequat ad aliqua. Incididunt irure culpa nostrud ea aute ex sit non ad esse.\r\n",
- "Ullamco nostrud cupidatat adipisicing anim fugiat mollit eu. Et ut eu in nulla consequat. Sunt do pariatur culpa non est.\r\n",
- "Pariatur incididunt reprehenderit non qui excepteur cillum exercitation nisi occaecat ad. Lorem aliquip laborum commodo reprehenderit sint. Laboris qui ut veniam magna quis et et ullamco voluptate. Tempor reprehenderit deserunt consequat nisi. Esse duis sint in tempor. Amet aute cupidatat in sint et.\r\n",
- "Est officia nisi dolore consequat irure et excepteur. Sit qui elit tempor magna qui cillum anim amet proident exercitation proident. Eu cupidatat laborum consectetur duis ullamco irure nulla. Adipisicing culpa non reprehenderit anim aute.\r\n",
- "Eu est laborum culpa velit dolore non sunt. Tempor magna veniam ea sit non qui Lorem qui exercitation aliqua aliqua et excepteur eiusmod. Culpa aute anim proident culpa adipisicing duis tempor elit aliquip elit nulla laboris esse dolore. Sit adipisicing non dolor eiusmod occaecat cupidatat.\r\n",
- "Culpa velit eu esse sunt. Laborum irure aliqua reprehenderit velit ipsum fugiat officia dolor ut aute officia deserunt. Ipsum sit quis fugiat nostrud aliqua cupidatat ex pariatur et. Cillum proident est irure nisi dolor aliqua deserunt esse occaecat velit dolor.\r\n",
- "Exercitation nulla officia sit eiusmod cillum eu incididunt officia exercitation qui Lorem deserunt. Voluptate Lorem minim commodo laborum esse in duis excepteur do duis aliquip nisi voluptate consectetur. Amet tempor officia enim ex esse minim reprehenderit.\r\n",
- "Laboris sint deserunt ad aute incididunt. Anim officia sunt elit qui laborum labore commodo irure non. Mollit adipisicing ullamco do aute nulla eu laborum et quis sint aute adipisicing amet. Aliqua officia irure nostrud duis ex.\r\n",
- "Eiusmod ipsum aliqua reprehenderit esse est non aute id veniam eiusmod. Elit consequat ad sit tempor elit eu incididunt quis irure ad. Eu incididunt veniam consequat Lorem nostrud cillum officia ea consequat ad cillum. Non nisi irure cupidatat incididunt pariatur incididunt. Duis velit officia ad cillum qui. Aliquip consequat sint aute nisi cillum. Officia commodo nisi incididunt laborum nisi voluptate aliquip Lorem cupidatat anim consequat sit laboris.\r\n",
- "Veniam cupidatat et incididunt mollit do ex voluptate veniam nostrud labore esse. Eiusmod irure sint fugiat esse. Aute irure consectetur ut mollit nulla sint esse. Lorem ut quis ex proident nostrud mollit nostrud ea duis duis in magna anim consectetur.\r\n",
- "Irure culpa esse qui do dolor fugiat veniam ad. Elit commodo aute elit magna incididunt tempor pariatur velit irure pariatur cillum et ea ad. Ad consequat ea et ad minim ut sunt qui commodo voluptate. Laboris est aliquip anim reprehenderit eu officia et exercitation. Occaecat laboris cupidatat Lorem ullamco in nostrud commodo ipsum in quis esse ex.\r\n",
- "Incididunt officia quis voluptate eiusmod esse nisi ipsum quis commodo. Eiusmod dolore tempor occaecat sit exercitation aliqua minim consequat minim mollit qui ad nisi. Aute quis irure adipisicing veniam nisi nisi velit deserunt incididunt anim nostrud.\r\n",
- "Voluptate exercitation exercitation id minim excepteur excepteur mollit. Fugiat aute proident nulla ullamco ea. Nisi ea culpa duis dolore veniam anim tempor officia in dolore exercitation exercitation. Dolore quis cillum adipisicing sunt do nulla esse proident ad sint.\r\n",
- "Laborum ut mollit sint commodo nulla laborum deserunt Lorem magna commodo mollit tempor deserunt ut. Qui aliquip commodo ea id. Consectetur dolor fugiat dolor excepteur eiusmod. Eu excepteur ex aute ex ex elit ex esse officia cillum exercitation. Duis ut labore ea nostrud excepteur. Reprehenderit labore aute sunt nisi quis Lorem officia. Ad aliquip cupidatat voluptate exercitation voluptate ad irure magna quis.\r\n",
- "Tempor velit veniam sit labore elit minim do elit cillum eiusmod sunt excepteur nisi. Aliquip est deserunt excepteur duis fugiat incididunt veniam fugiat. Pariatur sit irure labore et minim non. Cillum quis aute anim sint laboris laboris ullamco exercitation nostrud. Nulla pariatur id laborum minim nisi est adipisicing irure.\r\n",
- "Irure exercitation laboris nostrud in do consectetur ad. Magna aliqua Lorem culpa exercitation sint do culpa incididunt mollit eu exercitation. Elit tempor Lorem dolore enim deserunt. Anim et ullamco sint ullamco mollit cillum officia et. Proident incididunt laboris aliquip laborum sint veniam deserunt eu consequat deserunt voluptate laboris. Anim Lorem non laborum exercitation voluptate. Cupidatat reprehenderit culpa Lorem fugiat enim minim consectetur tempor quis ad reprehenderit laboris irure.\r\n",
- "Deserunt elit mollit nostrud occaecat labore reprehenderit laboris ex. Esse reprehenderit adipisicing cillum minim in esse aliquip excepteur ex et nisi cillum quis. Cillum labore ut ex sunt. Occaecat proident et mollit magna consequat irure esse. Dolor do enim esse nisi ad.\r\n",
- "Pariatur est anim cillum minim elit magna adipisicing quis tempor proident nisi laboris incididunt cupidatat. Nulla est adipisicing sit adipisicing id nostrud amet qui consequat eiusmod tempor voluptate ad. Adipisicing non magna sit occaecat magna mollit ad ex nulla velit ea pariatur. Irure labore ad ea exercitation ex cillum.\r\n",
- "Lorem fugiat eu eu cillum nulla tempor sint. Lorem id officia nulla velit labore ut duis ad tempor non. Excepteur quis aute adipisicing nisi nisi consectetur aliquip enim Lorem id ullamco cillum sint voluptate. Qui aliquip incididunt tempor aliqua voluptate labore reprehenderit. Veniam eiusmod elit occaecat voluptate tempor culpa consectetur ea ut exercitation eiusmod exercitation qui.\r\n",
- "Aliqua esse pariatur nulla veniam velit ea. Aliquip consectetur tempor ex magna sit aliquip exercitation veniam. Dolor ullamco minim commodo pariatur. Et amet reprehenderit dolore proident elit tempor eiusmod eu incididunt enim ullamco. Adipisicing id officia incididunt esse dolor sunt cupidatat do deserunt mollit do non. Magna ut officia fugiat adipisicing quis ea cillum laborum dolore ad nostrud magna minim est. Dolor voluptate officia proident enim ea deserunt eu voluptate dolore proident laborum officia ea.\r\n",
- "Culpa aute consequat esse fugiat cupidatat minim voluptate voluptate eiusmod irure anim elit. Do eiusmod culpa laboris consequat incididunt minim nostrud eiusmod commodo velit ea ullamco proident. Culpa pariatur magna ut mollit nisi. Ea officia do magna deserunt minim nisi tempor ea deserunt veniam cillum exercitation esse.\r\n",
- "Anim ullamco nostrud commodo Lorem. Do sunt laborum exercitation proident proident magna. Lorem officia laborum laborum dolor sunt duis commodo Lorem. Officia aute adipisicing ea cupidatat ea dolore. Aliquip adipisicing pariatur consectetur aliqua sit amet officia reprehenderit laborum culpa. Occaecat Lorem eu nisi do Lorem occaecat enim eiusmod laboris id quis. Ad mollit adipisicing sunt adipisicing esse.\r\n",
- "Laborum quis sit adipisicing cupidatat. Veniam Lorem eiusmod esse esse sint nisi labore elit et. Deserunt aliqua mollit ut commodo aliqua non incididunt ipsum reprehenderit consectetur. Eiusmod nulla minim laboris Lorem ea Lorem aute tempor pariatur in sit. Incididunt culpa ut do irure amet irure cupidatat est anim anim culpa occaecat. Est velit consectetur eiusmod veniam reprehenderit officia sunt occaecat eiusmod ut sunt occaecat amet.\r\n",
- "Elit minim aute fugiat nulla ex quis. Labore fugiat sint nostrud amet quis culpa excepteur in. Consectetur exercitation cupidatat laborum sit. Aute nisi eu aliqua est deserunt eiusmod commodo dolor id. Mollit laborum esse sint ipsum voluptate reprehenderit velit et. Veniam aliquip enim in veniam Lorem voluptate quis deserunt consequat qui commodo ut excepteur aute.\r\n",
- "Dolore deserunt veniam aute nisi labore sunt et voluptate irure nisi anim ea. Magna nisi quis anim mollit nisi est dolor do ex aliquip elit aliquip ipsum minim. Dolore est officia nostrud eiusmod ex laborum ea amet est. Officia culpa non est et tempor consectetur exercitation tempor eiusmod enim. Ea tempor laboris qui amet ex nisi culpa dolore consectetur incididunt sunt sunt. Lorem aliquip incididunt magna do et ullamco ex elit aliqua eiusmod qui. Commodo amet dolor sint incididunt ex veniam non Lorem fugiat.\r\n",
- "Officia culpa enim voluptate dolore commodo. Minim commodo aliqua minim ex sint excepteur cupidatat adipisicing eu irure. Anim magna deserunt anim Lorem non.\r\n",
- "Cupidatat aliquip nulla excepteur sunt cupidatat cupidatat laborum cupidatat exercitation. Laboris minim ex cupidatat culpa elit. Amet enim reprehenderit aliqua laborum est tempor exercitation cupidatat ex dolore do. Do incididunt labore fugiat commodo consectetur nisi incididunt irure sit culpa sit. Elit aute occaecat qui excepteur velit proident cillum qui aliqua ex do ex. Dolore irure ex excepteur veniam id proident mollit Lorem.\r\n",
- "Ad commodo cillum duis deserunt elit officia consectetur veniam eiusmod. Reprehenderit et veniam ad commodo reprehenderit magna elit laboris sunt non quis. Adipisicing dolor aute proident ea magna sunt et proident in consectetur.\r\n",
- "Veniam exercitation esse esse veniam est nisi. Minim velit incididunt sint aute dolor anim. Fugiat cupidatat id ad nisi in voluptate dolor culpa eiusmod magna eiusmod amet id. Duis aliquip labore et ex amet amet aliquip laborum eiusmod ipsum. Quis qui ut duis duis. Minim in voluptate reprehenderit aliqua.\r\n",
- "Elit ut pariatur dolor veniam ipsum consequat. Voluptate Lorem mollit et esse dolore mollit Lorem ad. Elit nostrud eu Lorem labore mollit minim cupidatat officia quis minim dolore incididunt. In cillum aute cillum ut.\r\n",
- "Commodo laborum deserunt ut cupidatat pariatur ullamco in esse anim exercitation cillum duis. Consectetur incididunt sit esse Lorem in aute. Eiusmod mollit Lorem consequat minim reprehenderit laborum enim excepteur irure nisi elit. Laborum esse proident aute aute proident adipisicing laborum. Pariatur tempor duis incididunt qui velit pariatur ut officia ea mollit labore dolore. Cillum pariatur minim ullamco sunt incididunt culpa id ullamco exercitation consectetur. Ea exercitation consequat reprehenderit ut ullamco velit eu ad velit magna excepteur eiusmod.\r\n",
- "Eu deserunt magna laboris laborum laborum in consequat dolore. Officia proident consectetur proident do occaecat minim pariatur officia ipsum sit non velit officia cillum. Laborum excepteur labore eu minim eiusmod. Sit anim dolore cillum ad do minim culpa sit est ad.\r\n",
- "Cupidatat dolor nostrud Lorem sint consequat quis. Quis labore sint incididunt officia tempor. Fugiat nostrud in elit reprehenderit dolor. Nisi sit enim officia minim est adipisicing nulla aute labore nulla nostrud cupidatat est. Deserunt dolore qui irure Lorem esse voluptate velit qui nostrud.\r\n",
- "Fugiat Lorem amet nulla nisi qui amet laboris enim cillum. Dolore occaecat exercitation id labore velit do commodo ut cupidatat laborum velit fugiat mollit. Ut et aliqua pariatur occaecat. Lorem occaecat dolore quis esse enim cupidatat exercitation ut tempor sit laboris fugiat adipisicing. Est tempor ex irure consectetur ipsum magna labore. Lorem non quis qui minim nisi magna amet aliquip ex cillum fugiat tempor.\r\n",
- "Aliquip eiusmod laborum ipsum deserunt velit esse do magna excepteur consectetur exercitation sit. Minim ullamco reprehenderit commodo nostrud exercitation id irure ex qui ullamco sit esse laboris. Nulla cillum non minim qui cillum nisi aute proident. Dolor anim culpa elit quis excepteur aliqua eiusmod. Elit ea est excepteur consectetur sunt eiusmod enim id commodo irure amet et pariatur laboris. Voluptate magna ad magna dolore cillum cillum irure laboris ipsum officia id Lorem veniam.\r\n",
- "Esse sunt elit est aliquip cupidatat commodo deserunt. Deserunt pariatur ipsum qui ad esse esse magna qui cillum laborum. Exercitation veniam pariatur elit amet enim.\r\n",
- "Esse quis in id elit nulla occaecat incididunt. Et amet Lorem mollit in veniam do. Velit mollit Lorem consequat commodo Lorem aliquip cupidatat. Minim consequat nostrud nulla in nostrud.\r\n",
- "Cillum nulla et eu est nostrud quis elit cupidatat dolor enim excepteur exercitation nisi voluptate. Nulla dolore non ex velit et qui tempor proident id deserunt nisi eu. Tempor ad Lorem ipsum reprehenderit in anim. Anim dolore ullamco enim deserunt quis ex id exercitation velit. Magna exercitation fugiat mollit pariatur ipsum ex consectetur nostrud. Id dolore officia nostrud excepteur laborum. Magna incididunt elit ipsum pariatur adipisicing enim duis est qui commodo velit aute.\r\n",
- "Quis esse ex qui nisi dolor. Ullamco laborum dolor esse laboris eiusmod ea magna laboris ea esse ut. Dolore ipsum pariatur veniam sint mollit. Lorem ea proident fugiat ullamco ut nisi culpa eu exercitation exercitation aliquip veniam laborum consectetur.\r\n",
- "Pariatur veniam laboris sit aliquip pariatur tempor aute sunt id et ut. Laboris excepteur eiusmod nisi qui quis elit enim ut cupidatat. Et et laborum in fugiat veniam consectetur ipsum laboris duis excepteur ullamco aliqua dolor Lorem. Aliqua ex amet sint anim cupidatat nisi ipsum anim et sunt deserunt. Occaecat culpa ut tempor cillum pariatur ex tempor.\r\n",
- "Dolor deserunt eiusmod magna do officia voluptate excepteur est cupidatat. Veniam qui cupidatat amet anim est qui consectetur sit commodo commodo ea ad. Enim ad adipisicing qui nostrud. Non nulla esse ullamco nulla et ex.\r\n",
- "Id ullamco ea consectetur est incididunt deserunt et esse. Elit nostrud voluptate eiusmod ut. Excepteur adipisicing qui cupidatat consequat labore id. Qui dolor aliqua do dolore do cupidatat labore ex consectetur ea sit cillum. Sint veniam eiusmod in consectetur consequat fugiat et mollit ut fugiat esse dolor adipisicing.\r\n",
- "Ea magna proident labore duis pariatur. Esse cillum aliquip dolor duis fugiat ea ex officia ea irure. Sint elit nisi pariatur sunt nostrud exercitation ullamco culpa magna do.\r\n",
- "Minim aliqua voluptate dolor consequat sint tempor deserunt amet magna excepteur. Irure do voluptate magna velit. Nostrud in reprehenderit magna officia nostrud. Cupidatat nulla irure laboris non fugiat ex ex est cupidatat excepteur officia aute velit duis. Sit voluptate id ea exercitation deserunt culpa voluptate nostrud est adipisicing incididunt. Amet proident laborum commodo magna ipsum quis.\r\n",
- "Ipsum consectetur consectetur excepteur tempor eiusmod ea fugiat aute velit magna in officia sunt. Sit ut sunt dolore cupidatat dolor adipisicing. Veniam nisi adipisicing esse reprehenderit amet aliqua voluptate ex commodo occaecat est voluptate mollit sunt. Pariatur aliqua qui qui in dolor. Fugiat reprehenderit sit nostrud do sint esse. Tempor sit irure adipisicing ea pariatur duis est sit est incididunt laboris quis do. Et voluptate anim minim aliquip excepteur consequat nisi anim pariatur aliquip ut ipsum dolor magna.\r\n",
- "Cillum sit labore excepteur magna id aliqua exercitation consequat laborum Lorem id pariatur nostrud. Lorem qui est labore sint cupidatat sint excepteur nulla in eu aliqua et. Adipisicing velit do enim occaecat laboris quis excepteur ipsum dolor occaecat Lorem dolore id exercitation.\r\n",
- "Incididunt in laborum reprehenderit eiusmod irure ex. Elit duis consequat minim magna. Esse consectetur aliquip cillum excepteur excepteur fugiat. Sint tempor consequat minim reprehenderit consectetur adipisicing dolor id Lorem elit non. Occaecat esse quis mollit ea et sint aute fugiat qui tempor. Adipisicing tempor duis non dolore irure elit deserunt qui do.\r\n",
- "Labore fugiat eiusmod sint laborum sit duis occaecat. Magna in laborum non cillum excepteur nostrud sit proident pariatur voluptate voluptate adipisicing exercitation occaecat. Ad non dolor aute ex sint do do minim exercitation veniam laborum irure magna ea. Magna do non quis sit consequat Lorem aliquip.\r\n",
- "Velit anim do laborum laboris laborum Lorem. Sunt do Lorem amet ipsum est sint velit sit do voluptate mollit veniam enim. Commodo do deserunt in pariatur ut elit sint elit deserunt ea. Ad dolor anim consequat aliquip ut mollit nostrud tempor sunt mollit elit. Reprehenderit laboris labore excepteur occaecat veniam adipisicing cupidatat esse. Ad enim aliquip ea minim excepteur magna. Sint velit veniam pariatur qui dolor est adipisicing ex laboris.\r\n",
- "Ea cupidatat ex nulla in sunt est sit dolor enim ad. Eu tempor consequat cupidatat consequat ex incididunt sint culpa. Est Lorem Lorem non cupidatat sunt ut aliqua non nostrud do ullamco. Reprehenderit ad ad nulla nostrud do nulla in. Ipsum adipisicing commodo mollit ipsum exercitation. Aliqua ea anim anim est elit. Ea incididunt consequat minim ad sunt eu cillum.\r\n",
- "Tempor quis excepteur eiusmod cupidatat ipsum occaecat id et occaecat. Eiusmod magna aliquip excepteur id amet elit. Ullamco dolore amet anim dolor enim ea magna magna elit. Occaecat magna pariatur in deserunt consectetur officia aliquip ullamco ex aute anim. Minim laborum eu sit elit officia esse do irure pariatur tempor et reprehenderit ullamco labore.\r\n",
- "Sit tempor eu minim dolore velit pariatur magna duis reprehenderit ea nulla in. Amet est do consectetur commodo do adipisicing adipisicing in amet. Cillum id ut commodo do pariatur duis aliqua nisi sint ad irure officia reprehenderit. Mollit labore id enim fugiat ullamco irure mollit cupidatat. Quis nisi amet labore eu dolor occaecat commodo aliqua laboris deserunt excepteur deserunt officia. Aliqua non ut sit ad. Laborum veniam ad velit minim dolore ea id magna dolor qui in.\r\n",
- "Dolore nostrud ipsum aliqua pariatur id reprehenderit enim ad eiusmod qui. Deserunt anim commodo pariatur excepteur velit eu irure nulla ex labore ipsum aliqua minim aute. Id consequat amet tempor aliquip ex elit adipisicing est do. Eu enim Lorem consectetur minim id irure nulla culpa. Consectetur do consequat aute tempor anim. Qui ad non elit dolor est adipisicing nisi amet cillum sunt quis anim laboris incididunt. Incididunt proident adipisicing labore Lorem.\r\n",
- "Et reprehenderit ea officia veniam. Aliquip ullamco consequat elit nisi magna mollit id elit. Amet amet sint velit labore ad nisi. Consectetur tempor id dolor aliqua esse deserunt amet. Qui laborum enim proident voluptate aute eu aute aute sit sit incididunt eu. Sunt ullamco nisi nostrud labore commodo non consectetur quis do duis minim irure. Tempor sint dolor sint aliquip dolore nostrud fugiat.\r\n",
- "Aute ullamco quis nisi ut excepteur nostrud duis elit. Veniam ex ad incididunt veniam voluptate. Commodo dolore ullamco sit sint adipisicing proident amet aute duis deserunt.\r\n",
- "Labore velit eu cillum nisi. Laboris do cupidatat et non duis cillum. Ullamco dolor tempor cupidatat voluptate laborum ullamco ea duis.\r\n",
- "Deserunt consequat aliqua duis aliquip nostrud nostrud dolore nisi. Culpa do sint laborum consectetur ipsum quis laborum laborum pariatur eiusmod. Consectetur laboris ad ad ut quis. Ullamco laboris qui velit id laborum voluptate qui aute nostrud aliquip ea.\r\n",
- "Ad cillum anim ex est consectetur mollit id in. Non enim aliquip consequat qui deserunt commodo cillum ad laborum fugiat. Dolor deserunt amet laborum tempor adipisicing voluptate dolor pariatur dolor cillum. Eu mollit ex sunt officia veniam qui est sunt proident. Non aliqua qui elit eu cupidatat ex enim ex proident. Lorem sit minim ullamco officia cupidatat duis minim. Exercitation laborum deserunt voluptate culpa tempor quis nulla id pariatur.\r\n",
- "Nostrud quis consectetur ut aliqua excepteur elit consectetur occaecat. Occaecat voluptate Lorem pariatur consequat ullamco fugiat minim. Anim voluptate eu eu cillum tempor dolore aliquip aliqua. Fugiat incididunt ut tempor amet minim. Voluptate nostrud minim pariatur non excepteur ullamco.\r\n",
- "Dolore nulla velit officia exercitation irure laboris incididunt anim in laborum in fugiat ut proident. Fugiat aute id consequat fugiat officia ut. Labore sint amet proident amet sint nisi laboris amet id ullamco culpa quis consequat proident. Magna do fugiat veniam dolore elit irure minim. Esse ullamco excepteur labore tempor labore fugiat dolore nisi cupidatat irure dolor pariatur. Magna excepteur laboris nisi eiusmod sit pariatur mollit.\r\n",
- "In enim aliquip officia ea ad exercitation cillum culpa occaecat dolore Lorem. Irure cillum commodo adipisicing sunt pariatur ea duis fugiat exercitation laboris culpa ullamco aute. Ut voluptate exercitation qui dolor. Irure et duis elit consequat deserunt proident.\r\n",
- "Officia ea Lorem sunt culpa id et tempor excepteur enim deserunt proident. Dolore aliquip dolor laboris cillum proident velit. Et culpa occaecat exercitation cupidatat irure sint adipisicing excepteur pariatur incididunt ad occaecat. Qui proident ipsum cillum minim. Quis ut culpa irure aliqua minim fugiat. In voluptate cupidatat fugiat est laborum dolor esse in pariatur voluptate.\r\n",
- "Voluptate enim ipsum officia aute ea adipisicing nisi ut ex do aliquip amet. Reprehenderit enim voluptate tempor ex adipisicing culpa. Culpa occaecat voluptate dolor mollit ipsum exercitation labore et tempor sit ea consectetur aliqua. Elit elit sit minim ea ea commodo do tempor cupidatat irure dolore. Occaecat esse adipisicing anim eiusmod commodo fugiat mollit amet. Incididunt tempor tempor qui occaecat cupidatat in.\r\n",
- "Ut qui anim velit enim aliquip do ut nulla labore. Mollit ut commodo ut eiusmod consectetur laboris aliqua qui voluptate culpa fugiat incididunt elit. Lorem ullamco esse elit elit. Labore amet incididunt ea nulla aliquip eiusmod. Sit nulla est voluptate officia ipsum aute aute cillum tempor deserunt. Laboris commodo eiusmod labore sunt aute excepteur ea consectetur reprehenderit veniam nisi. Culpa nisi sint sunt sint tempor laboris dolore cupidatat.\r\n",
- "Duis cillum qui nisi duis amet velit ad cillum ut elit aute sint ad. Amet laboris pariatur excepteur ipsum Lorem aliqua veniam Lorem quis mollit cupidatat aliqua exercitation. Pariatur ex ullamco sit commodo cillum eiusmod ut proident elit cillum. Commodo ut ipsum excepteur occaecat sint elit consequat ex dolor adipisicing consectetur id ut ad. Velit sit eiusmod est esse tempor incididunt consectetur eiusmod duis commodo veniam.\r\n",
- "Ut sunt qui officia anim laboris exercitation Lorem quis laborum do eiusmod officia. Enim consectetur occaecat fugiat cillum cillum. Dolore dolore nostrud in commodo fugiat mollit consequat occaecat non et et elit ullamco. Sit voluptate minim ut est culpa velit nulla fugiat reprehenderit eu aliquip adipisicing labore. Sit minim minim do dolor dolor. Lorem Lorem labore exercitation magna veniam eiusmod do.\r\n",
- "Fugiat dolor adipisicing quis aliquip aute dolore. Qui proident anim elit veniam ex aliquip eiusmod ipsum sunt pariatur est. Non fugiat duis do est officia adipisicing.\r\n",
- "Nulla deserunt do laboris cupidatat veniam do consectetur ipsum elit veniam in mollit eu. Ea in consequat cupidatat laboris sint fugiat irure. In commodo esse reprehenderit deserunt minim velit ullamco enim eu cupidatat tempor ex. Ullamco in non id culpa amet occaecat culpa nostrud id. Non occaecat culpa magna incididunt.\r\n",
- "Enim laboris ex mollit reprehenderit eiusmod exercitation magna. Exercitation Lorem ex mollit non non culpa labore enim. Adipisicing labore dolore incididunt do amet aliquip excepteur ad et nostrud officia aute veniam voluptate. Fugiat enim eiusmod Lorem esse. Minim ullamco commodo consequat ex commodo aliqua eu nulla eu. Veniam non enim nulla ut Lorem nostrud minim sint duis.\r\n",
- "Enim duis consectetur in ullamco cillum veniam nulla amet. Exercitation nisi sunt sunt duis in culpa nisi magna ex id ipsum laboris reprehenderit qui. Officia pariatur qui ex fugiat veniam et sunt sit nostrud. Veniam ullamco tempor fugiat minim Lorem proident velit in eiusmod elit. Enim minim excepteur aute aliquip ex magna commodo dolore qui et labore. Proident eu aliquip cillum dolor. Nostrud ipsum ut irure consequat fugiat nulla proident occaecat laborum.\r\n",
- "Amet duis eiusmod sunt adipisicing esse ex nostrud consectetur voluptate cillum. Ipsum occaecat sit et anim velit irure ea incididunt cupidatat ullamco in nisi quis. Esse officia ipsum commodo qui quis qui do. Commodo aliquip amet aute sit sit ut cupidatat elit nostrud.\r\n",
- "Laboris laboris sit mollit cillum nulla deserunt commodo culpa est commodo anim id anim sit. Officia id consectetur velit incididunt est dolor sunt ipsum magna aliqua consectetur. Eiusmod pariatur minim deserunt cupidatat veniam Lorem aliquip sunt proident eu Lorem sit dolor fugiat. Proident qui ut ex in incididunt nulla nulla dolor ex laboris ea ad.\r\n",
- "Ex incididunt enim labore nulla cupidatat elit. Quis ut incididunt incididunt non irure commodo do mollit cillum anim excepteur. Qui consequat laborum dolore elit tempor aute ut nulla pariatur eu ullamco veniam. Nisi non velit labore in commodo excepteur culpa nulla tempor cillum. Ipsum qui sit sint reprehenderit ut labore incididunt dolor aliquip sunt. Reprehenderit occaecat tempor nisi laborum.\r\n",
- "Lorem officia ullamco eu occaecat in magna eiusmod consectetur nisi aliqua mollit esse. Ullamco ex aute nostrud pariatur do enim cillum sint do fugiat nostrud culpa tempor. Do aliquip excepteur nostrud culpa eu pariatur eiusmod cillum excepteur do. Est sunt non quis cillum voluptate ex.\r\n",
- "Deserunt consectetur tempor irure mollit qui tempor et. Labore enim eu irure laboris in. Nisi in tempor ex occaecat amet cupidatat laboris occaecat amet minim ut magna incididunt id. Consequat cillum laborum commodo mollit. Et magna culpa sunt dolore consequat laboris et sit. Deserunt qui voluptate excepteur dolor. Eu qui amet est proident.\r\n",
- "Eu elit minim eiusmod occaecat eu nostrud dolor qui ut elit. Sunt dolore proident ea eu do eiusmod fugiat incididunt pariatur duis amet Lorem nisi ut. Adipisicing quis veniam cupidatat Lorem sint culpa sunt veniam sint. Excepteur eu exercitation est magna pariatur veniam dolore qui fugiat labore proident eiusmod cillum. Commodo reprehenderit elit proident duis sint magna.\r\n",
- "Ut aliquip pariatur deserunt nostrud commodo ad proident est exercitation. Sit minim do ea enim sint officia nisi incididunt laborum. Ex amet duis commodo fugiat. Ut aute tempor deserunt irure occaecat aliquip voluptate cillum aute elit qui nostrud.\r\n",
- "Irure et quis consectetur sit est do sunt aliquip eu. Cupidatat pariatur consequat dolore consectetur. Adipisicing magna velit mollit occaecat do id. Nisi pariatur cupidatat cillum incididunt excepteur consectetur excepteur do laborum deserunt irure pariatur cillum.\r\n",
- "Adipisicing esse incididunt cillum est irure consequat irure ad aute voluptate. Incididunt do occaecat nostrud do ipsum pariatur Lorem qui laboris et pariatur. Est exercitation dolor culpa ad velit ut et.\r\n",
- "Sit eiusmod id enim ad ex dolor pariatur do. Ullamco occaecat quis dolor minim non elit labore amet est. Commodo velit eu nulla eiusmod ullamco. Incididunt anim pariatur aute eiusmod veniam tempor enim officia elit id. Elit Lorem est commodo dolore nostrud. Labore et consectetur do exercitation veniam laboris incididunt aliqua proident dolore ea officia cupidatat. Velit laboris aliquip deserunt labore commodo.\r\n",
- "Proident nostrud labore eu nostrud. Excepteur ut in velit labore ea proident labore ea sint cillum. Incididunt ipsum consectetur officia irure sit pariatur veniam id velit officia mollit. Adipisicing magna voluptate velit excepteur enim consectetur incididunt voluptate tempor occaecat fugiat velit excepteur labore. Do do incididunt qui nisi voluptate enim. Laboris aute sit voluptate cillum pariatur minim excepteur ullamco mollit deserunt.\r\n",
- "Excepteur laborum adipisicing nisi elit fugiat tempor. Elit laboris qui enim labore duis. Proident tempor in consectetur proident excepteur do ex laboris sit.\r\n",
- "Dolore do ea incididunt do duis dolore eu labore nisi cupidatat voluptate amet incididunt minim. Nulla pariatur mollit cupidatat adipisicing nulla et. Dolor aliquip in ex magna excepteur. Nulla consequat minim consequat ullamco dolor laboris ullamco eu reprehenderit duis nostrud pariatur.\r\n",
- "Id nisi labore duis qui. Incididunt laboris tempor aute do sit. Occaecat excepteur est mollit ea in mollit ullamco est amet reprehenderit.\r\n",
- "Aute labore ipsum velit non voluptate eiusmod et reprehenderit cupidatat occaecat. Lorem tempor tempor consectetur exercitation qui nostrud sunt cillum quis ut non dolore. Reprehenderit consequat reprehenderit laborum qui pariatur anim et officia est cupidatat enim velit velit.\r\n",
- "Commodo ex et fugiat cupidatat non adipisicing commodo. Minim ad dolore fugiat mollit cupidatat aliqua sunt dolor sit. Labore esse labore velit aute enim. Nulla duis incididunt est aliquip consectetur elit qui incididunt minim minim labore amet sit cillum.\r\n"
-] \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/readme.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/readme.txt
deleted file mode 100644
index da1dae675e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/types/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-Test data obtained from https://github.com/xpol/lua-rapidjson/tree/master/performance
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/address.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/address.json
deleted file mode 100644
index abec3ec577..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/address.json
+++ /dev/null
@@ -1,138 +0,0 @@
-{
- "type": "object",
- "properties": {
- "version": {
- "$ref": "#/definitions/decimal_type"
- },
- "address": {
- "$ref": "#/definitions/address_type"
- },
- "phones": {
- "type": "array",
- "minItems": 1,
- "maxItems": 2,
- "uniqueItems": true,
- "items": {
- "$ref": "#/definitions/phone_type"
- }
- },
- "names": {
- "type": "array",
- "items": [
- { "type": "string" },
- { "type": "string" }
- ],
- "additionalItems": false
- },
- "extra": {
- "type": "object",
- "patternProperties": {
- "^S_": { "type": "string" }
- }
- },
- "gender": {
- "type": "string",
- "enum": ["M", "F"]
- }
- },
- "additionalProperties": false,
- "dependencies": {
- "address": [ "version" ],
- "names": {
- "properties": {
- "version": { "$ref": "#/definitions/decimal_type" }
- },
- "required": ["version"]
- }
- },
- "definitions": {
- "address_type": {
- "type": "object",
- "properties": {
- "number": {
- "$ref": "#/definitions/positiveInt_type"
- },
- "street1": {
- "type": "string"
- },
- "street2": {
- "type": ["string", "null"]
- },
- "street3": {
- "not": { "type": ["boolean", "number", ",integer", "object", "null"] }
- },
- "city": {
- "type": "string",
- "maxLength": 10,
- "minLength": 4
- },
- "area": {
- "oneOf": [
- { "$ref": "#/definitions/county_type" },
- { "$ref": "#/definitions/province_type" }
- ]
- },
- "country": {
- "allOf": [
- { "$ref": "#/definitions/country_type" }
- ]
- },
- "postcode": {
- "anyOf": [
- { "type": "string", "pattern": "^[A-Z]{2}[0-9]{1,2} [0-9][A-Z]{2}$" },
- { "type": "string", "pattern": "^[0-9]{5}$" }
- ]
- }
- },
- "minProperties": 7,
- "required": [
- "number",
- "street1",
- "city"
- ]
- },
- "country_type": {
- "type": "string",
- "enum": ["UK", "Canada"]
- },
- "county_type": {
- "type": "string",
- "enum": ["Sussex", "Surrey", "Kent", "Narnia"]
- },
- "province_type": {
- "type": "string",
- "enum": ["Quebec", "Narnia", "BC", "Alberta"]
- },
- "date_type": {
- "pattern": "^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?$",
- "type": "string"
- },
- "positiveInt_type": {
- "minimum": 0,
- "exclusiveMinimum": true,
- "maximum": 100,
- "exclusiveMaximum": true,
- "type": "integer"
- },
- "decimal_type": {
- "multipleOf": 1.0,
- "type": "number"
- },
- "time_type": {
- "pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?$",
- "type": "string"
- },
- "unsignedInt_type": {
- "type": "integer",
- "minimum": 0,
- "maximum": 99999
- },
- "phone_type": {
- "pattern": "^[0-9]*-[0-9]*",
- "type": "string"
- },
- "url_type": {
- "type": "string"
- }
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/allOf_address.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/allOf_address.json
deleted file mode 100644
index fd501f66d4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/allOf_address.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "allOf": [
- {
- "$ref": "http://localhost:1234/address.json#"
- }
- ]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/anyOf_address.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/anyOf_address.json
deleted file mode 100644
index 5c90308f4e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/anyOf_address.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "anyOf": [
- {
- "$ref": "http://localhost:1234/address.json#"
- }
- ]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/idandref.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/idandref.json
deleted file mode 100644
index ad485d29fb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/idandref.json
+++ /dev/null
@@ -1,69 +0,0 @@
-{
- "id": "http://example.com/root.json",
- "definitions": {
- "A": {
- "id": "#foo",
- "type": "integer"
- },
- "B": {
- "id": "other.json",
- "definitions": {
- "X": {
- "id": "#bar",
- "type": "boolean"
- },
- "Y": {
- "$ref": "#/definitions/X"
- },
- "W": {
- "$ref": "#/definitions/Y"
- },
- "Z": {
- "$ref": "#bar"
- },
- "N": {
- "properties": {
- "NX": {
- "$ref": "#/definitions/X"
- }
- }
- }
- }
- }
- },
- "properties": {
- "PA1": {
- "$ref": "http://example.com/root.json#/definitions/A"
- },
- "PA2": {
- "$ref": "#/definitions/A"
- },
- "PA3": {
- "$ref": "#foo"
- },
- "PX1": {
- "$ref": "#/definitions/B/definitions/X"
- },
- "PX2Y": {
- "$ref": "#/definitions/B/definitions/Y"
- },
- "PX3Z": {
- "$ref": "#/definitions/B/definitions/Z"
- },
- "PX4": {
- "$ref": "http://example.com/other.json#/definitions/X"
- },
- "PX5": {
- "$ref": "other.json#/definitions/X"
- },
- "PX6": {
- "$ref": "other.json#bar"
- },
- "PX7W": {
- "$ref": "#/definitions/B/definitions/W"
- },
- "PX8N": {
- "$ref": "#/definitions/B/definitions/N"
- }
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/oneOf_address.json b/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/oneOf_address.json
deleted file mode 100644
index a5baadd2a8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/bin/unittestschema/oneOf_address.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "oneOf": [
- {
- "$ref": "http://localhost:1234/address.json#"
- }
- ]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/LICENSE b/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/LICENSE
deleted file mode 100644
index f57da96cf9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/LICENSE
+++ /dev/null
@@ -1,45 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2017 Bart Muzzin
-
-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.
-
-Derived from:
-
-The MIT License (MIT)
-
-Copyright (c) 2015 mojmir svoboda
-
-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.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/README.md b/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/README.md
deleted file mode 100644
index 9685c7f7c1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# rapidjson.natvis
-
-This file can be used as a [Visual Studio Visualizer](https://docs.microsoft.com/en-gb/visualstudio/debugger/create-custom-views-of-native-objects) to aid in visualizing rapidjson structures within the Visual Studio debugger. Natvis visualizers are supported in Visual Studio 2012 and later. To install, copy the file into this directory:
-
-`%USERPROFILE%\Documents\Visual Studio 2012\Visualizers`
-
-Each version of Visual Studio has a similar directory, it must be copied into each directory to be used with that particular version. In Visual Studio 2015 and later, this can be done without restarting Visual Studio (a new debugging session must be started).
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/rapidjson.natvis b/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/rapidjson.natvis
deleted file mode 100644
index 2a4316ee98..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/contrib/natvis/rapidjson.natvis
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
- <!-- rapidjson::GenericValue - basic support -->
- <Type Name="rapidjson::GenericValue&lt;*,*&gt;">
- <DisplayString Condition="(data_.f.flags &amp; kTypeMask) == rapidjson::kNullType">null</DisplayString>
- <DisplayString Condition="data_.f.flags == kTrueFlag">true</DisplayString>
- <DisplayString Condition="data_.f.flags == kFalseFlag">false</DisplayString>
- <DisplayString Condition="data_.f.flags == kShortStringFlag">{(const Ch*)data_.ss.str,na}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kTypeMask) == rapidjson::kStringType">{(const Ch*)((size_t)data_.s.str &amp; 0x0000FFFFFFFFFFFF),[data_.s.length]na}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kNumberIntFlag) == kNumberIntFlag">{data_.n.i.i}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kNumberUintFlag) == kNumberUintFlag">{data_.n.u.u}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kNumberInt64Flag) == kNumberInt64Flag">{data_.n.i64}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kNumberUint64Flag) == kNumberUint64Flag">{data_.n.u64}</DisplayString>
- <DisplayString Condition="(data_.f.flags &amp; kNumberDoubleFlag) == kNumberDoubleFlag">{data_.n.d}</DisplayString>
- <DisplayString Condition="data_.f.flags == rapidjson::kObjectType">Object members={data_.o.size}</DisplayString>
- <DisplayString Condition="data_.f.flags == rapidjson::kArrayType">Array members={data_.a.size}</DisplayString>
- <Expand>
- <Item Condition="data_.f.flags == rapidjson::kObjectType" Name="[size]">data_.o.size</Item>
- <Item Condition="data_.f.flags == rapidjson::kObjectType" Name="[capacity]">data_.o.capacity</Item>
- <ArrayItems Condition="data_.f.flags == rapidjson::kObjectType">
- <Size>data_.o.size</Size>
- <!-- NOTE: Rapidjson stores some extra data in the high bits of pointers, which is why the mask -->
- <ValuePointer>(rapidjson::GenericMember&lt;$T1,$T2&gt;*)(((size_t)data_.o.members) &amp; 0x0000FFFFFFFFFFFF)</ValuePointer>
- </ArrayItems>
-
- <Item Condition="data_.f.flags == rapidjson::kArrayType" Name="[size]">data_.a.size</Item>
- <Item Condition="data_.f.flags == rapidjson::kArrayType" Name="[capacity]">data_.a.capacity</Item>
- <ArrayItems Condition="data_.f.flags == rapidjson::kArrayType">
- <Size>data_.a.size</Size>
- <!-- NOTE: Rapidjson stores some extra data in the high bits of pointers, which is why the mask -->
- <ValuePointer>(rapidjson::GenericValue&lt;$T1,$T2&gt;*)(((size_t)data_.a.elements) &amp; 0x0000FFFFFFFFFFFF)</ValuePointer>
- </ArrayItems>
-
- </Expand>
- </Type>
-
-</AutoVisualizer>
-
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/CMakeLists.txt
deleted file mode 100644
index c5345ba697..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-find_package(Doxygen)
-
-IF(NOT DOXYGEN_FOUND)
- MESSAGE(STATUS "No Doxygen found. Documentation won't be built")
-ELSE()
- file(GLOB SOURCES ${CMAKE_CURRENT_LIST_DIR}/../include/*)
- file(GLOB MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../doc/*.md)
- list(APPEND MARKDOWN_DOC ${CMAKE_CURRENT_LIST_DIR}/../readme.md)
-
- CONFIGURE_FILE(Doxyfile.in Doxyfile @ONLY)
- CONFIGURE_FILE(Doxyfile.zh-cn.in Doxyfile.zh-cn @ONLY)
-
- file(GLOB DOXYFILES ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile*)
-
- add_custom_command(OUTPUT html
- COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
- COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile.zh-cn
- COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/html
- DEPENDS ${MARKDOWN_DOC} ${SOURCES} ${DOXYFILES}
- WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../
- )
-
- add_custom_target(doc ALL DEPENDS html)
- install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html
- DESTINATION ${DOC_INSTALL_DIR}
- COMPONENT doc)
-ENDIF()
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.in b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.in
deleted file mode 100644
index 6e79f9371d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.in
+++ /dev/null
@@ -1,2369 +0,0 @@
-# Doxyfile 1.8.7
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = RapidJSON
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF = "A fast JSON parser/generator for C++ with both SAX/DOM style API"
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
-# the documentation. The maximum height of the logo should not exceed 55 pixels
-# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
-# to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS = NO
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
-# new page for each member. If set to NO, the documentation of a member will be
-# part of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = YES
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO these classes will be included in the various overviews. This option has
-# no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
-# todo list. This list is created by putting \todo commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
-# test list. This list is created by putting \test commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS)
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES the list
-# will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. Do not use file names with spaces, bibtex cannot handle them. See
-# also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO doxygen will only warn about wrong or incomplete parameter
-# documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT = readme.md \
- CHANGELOG.md \
- include/rapidjson/rapidjson.h \
- include/ \
- doc/features.md \
- doc/tutorial.md \
- doc/pointer.md \
- doc/stream.md \
- doc/encoding.md \
- doc/dom.md \
- doc/sax.md \
- doc/schema.md \
- doc/performance.md \
- doc/internals.md \
- doc/faq.md
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.inc \
- *.md
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE = ./include/rapidjson/msinttypes/
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS = internal
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH = ./doc
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER ) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE = readme.md
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS = YES
-
-# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
-# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
-# cost of reduced performance. This can be particularly helpful with template
-# rich C++ code for which doxygen's built-in parser lacks the necessary type
-# information.
-# Note: The availability of this option depends on whether or not doxygen was
-# compiled with the --with-libclang option.
-# The default value is: NO.
-
-CLANG_ASSISTED_PARSING = NO
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_OPTIONS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX = NO
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER = ./doc/misc/header.html
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER = ./doc/misc/footer.html
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
-# defined cascading style sheet that is included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet file to the output directory. For an example
-# see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the stylesheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler ( hhc.exe). If non-empty
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated (
-# YES) or that it should be included in the master .chm file ( NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = YES
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using prerendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH = http://www.mathjax.org/mathjax
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
-# replace them by respectively the title of the page, the current date and time,
-# only the current date, the version number of doxygen, the project name (see
-# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS = YES
-
-# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT = docbook
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
-# Definitions (see http://autogen.sf.net) file that captures the structure of
-# the code including all documentation. Note that this feature is still
-# experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
-# in the source code. If set to NO only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF = YES
-
-# If the SEARCH_INCLUDES tag is set to YES the includes files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED = \
- RAPIDJSON_DOXYGEN_RUNNING \
- RAPIDJSON_NAMESPACE_BEGIN="namespace rapidjson {" \
- RAPIDJSON_NAMESPACE_END="}" \
- RAPIDJSON_REMOVEFPTR_(x)=x \
- RAPIDJSON_ENABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype" \
- RAPIDJSON_DISABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype"
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED = \
- RAPIDJSON_NOEXCEPT
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
-# class index. If set to NO only the inherited external classes will be listed.
-# The default value is: NO.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
-# the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS = YES
-
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS = 0
-
-# When you want a differently looking font n the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP = YES
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.zh-cn.in b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.zh-cn.in
deleted file mode 100644
index 6a08f72d66..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/Doxyfile.zh-cn.in
+++ /dev/null
@@ -1,2369 +0,0 @@
-# Doxyfile 1.8.7
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a double hash (##) is considered a comment and is placed in
-# front of the TAG it is preceding.
-#
-# All text after a single hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists, items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (\" \").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all text
-# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv
-# built into libc) for the transcoding. See http://www.gnu.org/software/libiconv
-# for the list of possible encodings.
-# The default value is: UTF-8.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by
-# double-quotes, unless you are using Doxywizard) that should identify the
-# project for which the documentation is generated. This name is used in the
-# title of most generated pages and in a few other places.
-# The default value is: My Project.
-
-PROJECT_NAME = RapidJSON
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
-# could be handy for archiving the generated documentation or if some version
-# control system is used.
-
-PROJECT_NUMBER =
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer a
-# quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF = "一个C++快速JSON解æžå™¨åŠç”Ÿæˆå™¨ï¼ŒåŒ…å«SAX/DOM风格API"
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is included in
-# the documentation. The maximum height of the logo should not exceed 55 pixels
-# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
-# to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
-# into which the generated documentation will be written. If a relative path is
-# entered, it will be relative to the location where doxygen was started. If
-# left blank the current directory will be used.
-
-OUTPUT_DIRECTORY = @CMAKE_CURRENT_BINARY_DIR@
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
-# directories (in 2 levels) under the output directory of each output format and
-# will distribute the generated files over these directories. Enabling this
-# option can be useful when feeding doxygen a huge amount of source files, where
-# putting all generated files in the same directory would otherwise causes
-# performance problems for the file system.
-# The default value is: NO.
-
-CREATE_SUBDIRS = NO
-
-# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
-# characters to appear in the names of generated files. If set to NO, non-ASCII
-# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode
-# U+3044.
-# The default value is: NO.
-
-ALLOW_UNICODE_NAMES = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese,
-# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States),
-# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian,
-# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages),
-# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian,
-# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian,
-# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish,
-# Ukrainian and Vietnamese.
-# The default value is: English.
-
-OUTPUT_LANGUAGE = Chinese
-
-# If the BRIEF_MEMBER_DESC tag is set to YES doxygen will include brief member
-# descriptions after the members that are listed in the file and class
-# documentation (similar to Javadoc). Set to NO to disable this.
-# The default value is: YES.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES doxygen will prepend the brief
-# description of a member or function before the detailed description
-#
-# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-# The default value is: YES.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator that is
-# used to form the text in various listings. Each string in this list, if found
-# as the leading text of the brief description, will be stripped from the text
-# and the result, after processing the whole list, is used as the annotated
-# text. Otherwise, the brief description is used as-is. If left blank, the
-# following values are used ($name is automatically replaced with the name of
-# the entity):The $name class, The $name widget, The $name file, is, provides,
-# specifies, contains, represents, a, an and the.
-
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# doxygen will generate a detailed section even if there is only a brief
-# description.
-# The default value is: NO.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-# The default value is: NO.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES doxygen will prepend the full path
-# before files name in the file list and in the header files. If set to NO the
-# shortest path that makes the file name unique will be used
-# The default value is: YES.
-
-FULL_PATH_NAMES = YES
-
-# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
-# Stripping is only done if one of the specified strings matches the left-hand
-# part of the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the path to
-# strip.
-#
-# Note that you can specify absolute paths here, but also relative paths, which
-# will be relative from the directory where doxygen is started.
-# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-
-STRIP_FROM_PATH =
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
-# path mentioned in the documentation of a class, which tells the reader which
-# header file to include in order to use a class. If left blank only the name of
-# the header file containing the class definition is used. Otherwise one should
-# specify the list of include paths that are normally passed to the compiler
-# using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
-# less readable) file names. This can be useful is your file systems doesn't
-# support long names like on DOS, Mac, or CD-ROM.
-# The default value is: NO.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the
-# first line (until the first dot) of a Javadoc-style comment as the brief
-# description. If set to NO, the Javadoc-style will behave just like regular Qt-
-# style comments (thus requiring an explicit @brief command for a brief
-# description.)
-# The default value is: NO.
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
-# line (until the first dot) of a Qt-style comment as the brief description. If
-# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
-# requiring an explicit \brief command for a brief description.)
-# The default value is: NO.
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a
-# multi-line C++ special comment block (i.e. a block of //! or /// comments) as
-# a brief description. This used to be the default behavior. The new default is
-# to treat a multi-line C++ comment block as a detailed description. Set this
-# tag to YES if you prefer the old behavior instead.
-#
-# Note that setting this tag to YES also means that rational rose comments are
-# not recognized any more.
-# The default value is: NO.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the
-# documentation from any documented member that it re-implements.
-# The default value is: YES.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce a
-# new page for each member. If set to NO, the documentation of a member will be
-# part of the file/class/namespace that contains it.
-# The default value is: NO.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen
-# uses this value to replace tabs by spaces in code fragments.
-# Minimum value: 1, maximum value: 16, default value: 4.
-
-TAB_SIZE = 4
-
-# This tag can be used to specify a number of aliases that act as commands in
-# the documentation. An alias has the form:
-# name=value
-# For example adding
-# "sideeffect=@par Side Effects:\n"
-# will allow you to put the command \sideeffect (or @sideeffect) in the
-# documentation, which will result in a user-defined paragraph with heading
-# "Side Effects:". You can put \n's in the value part of an alias to insert
-# newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding "class=itcl::class"
-# will allow you to use the command class in the itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources
-# only. Doxygen will then generate output that is more tailored for C. For
-# instance, some of the names that are used will be different. The list of all
-# members will be omitted, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
-# Python sources only. Doxygen will then generate output that is more tailored
-# for that language. For instance, namespaces will be presented as packages,
-# qualified scopes will look different, etc.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources. Doxygen will then generate output that is tailored for Fortran.
-# The default value is: NO.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for VHDL.
-# The default value is: NO.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given
-# extension. Doxygen has a built-in mapping, but you can override or extend it
-# using this tag. The format is ext=language, where ext is a file extension, and
-# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
-# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran:
-# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran:
-# Fortran. In the later case the parser tries to guess whether the code is fixed
-# or free formatted code, this is the default for Fortran type files), VHDL. For
-# instance to make doxygen treat .inc files as Fortran files (default is PHP),
-# and .f files as C (default is Fortran), use: inc=Fortran f=C.
-#
-# Note For files without extension you can use no_extension as a placeholder.
-#
-# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
-# the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
-# according to the Markdown format, which allows for more readable
-# documentation. See http://daringfireball.net/projects/markdown/ for details.
-# The output of markdown processing is further processed by doxygen, so you can
-# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in
-# case of backward compatibilities issues.
-# The default value is: YES.
-
-MARKDOWN_SUPPORT = YES
-
-# When enabled doxygen tries to link words that correspond to documented
-# classes, or namespaces to their corresponding documentation. Such a link can
-# be prevented in individual cases by by putting a % sign in front of the word
-# or globally by setting AUTOLINK_SUPPORT to NO.
-# The default value is: YES.
-
-AUTOLINK_SUPPORT = YES
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should set this
-# tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string);
-# versus func(std::string) {}). This also make the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-# The default value is: NO.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-# The default value is: NO.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip (see:
-# http://www.riverbankcomputing.co.uk/software/sip/intro) sources only. Doxygen
-# will parse them like normal C++ but will assume all classes use public instead
-# of private inheritance when no explicit protection keyword is present.
-# The default value is: NO.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate
-# getter and setter methods for a property. Setting this option to YES will make
-# doxygen to replace the get and set methods by a property in the documentation.
-# This will only work if the methods are indeed getting or setting a simple
-# type. If this is not the case, or you want to show the methods anyway, you
-# should set this option to NO.
-# The default value is: YES.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-# The default value is: NO.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES to allow class member groups of the same type
-# (for instance a group of public functions) to be put as a subgroup of that
-# type (e.g. under the Public Functions section). Set it to NO to prevent
-# subgrouping. Alternatively, this can be done per class using the
-# \nosubgrouping command.
-# The default value is: YES.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions
-# are shown inside the group in which they are included (e.g. using \ingroup)
-# instead of on a separate page (for HTML and Man pages) or section (for LaTeX
-# and RTF).
-#
-# Note that this feature does not work in combination with
-# SEPARATE_MEMBER_PAGES.
-# The default value is: NO.
-
-INLINE_GROUPED_CLASSES = YES
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions
-# with only public data fields or simple typedef fields will be shown inline in
-# the documentation of the scope in which they are defined (i.e. file,
-# namespace, or group documentation), provided this scope is documented. If set
-# to NO, structs, classes, and unions are shown on a separate page (for HTML and
-# Man pages) or section (for LaTeX and RTF).
-# The default value is: NO.
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or
-# enum is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically be
-# useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-# The default value is: NO.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This
-# cache is used to resolve symbols given their name and scope. Since this can be
-# an expensive process and often the same symbol appears multiple times in the
-# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small
-# doxygen will become slower. If the cache is too large, memory is wasted. The
-# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range
-# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536
-# symbols. At the end of a run doxygen will report the cache usage and suggest
-# the optimal cache size from a speed point of view.
-# Minimum value: 0, maximum value: 9, default value: 0.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available. Private
-# class members and static file members will be hidden unless the
-# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES.
-# Note: This will also disable the warnings about undocumented members that are
-# normally produced when WARNINGS is set to YES.
-# The default value is: NO.
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class will
-# be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal
-# scope will be included in the documentation.
-# The default value is: NO.
-
-EXTRACT_PACKAGE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file will be
-# included in the documentation.
-# The default value is: NO.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) defined
-# locally in source files will be included in the documentation. If set to NO
-# only classes defined in header files are included. Does not have any effect
-# for Java sources.
-# The default value is: YES.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local methods,
-# which are defined in the implementation section but not in the interface are
-# included in the documentation. If set to NO only methods in the interface are
-# included.
-# The default value is: NO.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base name of
-# the file that contains the anonymous namespace. By default anonymous namespace
-# are hidden.
-# The default value is: NO.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all
-# undocumented members inside documented classes or files. If set to NO these
-# members will be included in the various overviews, but no documentation
-# section is generated. This option has no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy. If set
-# to NO these classes will be included in the various overviews. This option has
-# no effect if EXTRACT_ALL is enabled.
-# The default value is: NO.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
-# (class|struct|union) declarations. If set to NO these declarations will be
-# included in the documentation.
-# The default value is: NO.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any
-# documentation blocks found inside the body of a function. If set to NO these
-# blocks will be appended to the function's detailed documentation block.
-# The default value is: NO.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation that is typed after a
-# \internal command is included. If the tag is set to NO then the documentation
-# will be excluded. Set it to YES to include the internal documentation.
-# The default value is: NO.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file
-# names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-# The default value is: system dependent.
-
-CASE_SENSE_NAMES = NO
-
-# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with
-# their full class and namespace scopes in the documentation. If set to YES the
-# scope will be hidden.
-# The default value is: NO.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
-# the files that are included by a file in the documentation of that file.
-# The default value is: YES.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each
-# grouped member an include statement to the documentation, telling the reader
-# which file to include in order to use the member.
-# The default value is: NO.
-
-SHOW_GROUPED_MEMB_INC = NO
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include
-# files with double quotes in the documentation rather than with sharp brackets.
-# The default value is: NO.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the
-# documentation for inline members.
-# The default value is: YES.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the
-# (detailed) documentation of file and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order.
-# The default value is: YES.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief
-# descriptions of file, namespace and class members alphabetically by member
-# name. If set to NO the members will appear in declaration order. Note that
-# this will also influence the order of the classes in the class list.
-# The default value is: NO.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the
-# (brief and detailed) documentation of class members so that constructors and
-# destructors are listed first. If set to NO the constructors will appear in the
-# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS.
-# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief
-# member documentation.
-# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting
-# detailed member documentation.
-# The default value is: NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy
-# of group names into alphabetical order. If set to NO the group names will
-# appear in their defined order.
-# The default value is: NO.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by
-# fully-qualified names, including namespaces. If set to NO, the class list will
-# be sorted only by class name, not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the alphabetical
-# list.
-# The default value is: NO.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper
-# type resolution of all parameters of a function it will reject a match between
-# the prototype and the implementation of a member function even if there is
-# only one candidate or it is obvious which candidate to choose by doing a
-# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still
-# accept a match between prototype and implementation in such cases.
-# The default value is: NO.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable ( YES) or disable ( NO) the
-# todo list. This list is created by putting \todo commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable ( YES) or disable ( NO) the
-# test list. This list is created by putting \test commands in the
-# documentation.
-# The default value is: YES.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable ( YES) or disable ( NO) the bug
-# list. This list is created by putting \bug commands in the documentation.
-# The default value is: YES.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable ( YES) or disable ( NO)
-# the deprecated list. This list is created by putting \deprecated commands in
-# the documentation.
-# The default value is: YES.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional documentation
-# sections, marked by \if <section_label> ... \endif and \cond <section_label>
-# ... \endcond blocks.
-
-ENABLED_SECTIONS = $(RAPIDJSON_SECTIONS)
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the
-# initial value of a variable or macro / define can have for it to appear in the
-# documentation. If the initializer consists of more lines than specified here
-# it will be hidden. Use a value of 0 to hide initializers completely. The
-# appearance of the value of individual variables and macros / defines can be
-# controlled using \showinitializer or \hideinitializer command in the
-# documentation regardless of this setting.
-# Minimum value: 0, maximum value: 10000, default value: 30.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at
-# the bottom of the documentation of classes and structs. If set to YES the list
-# will mention the files that were used to generate the documentation.
-# The default value is: YES.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This
-# will remove the Files entry from the Quick Index and from the Folder Tree View
-# (if specified).
-# The default value is: YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces
-# page. This will remove the Namespaces entry from the Quick Index and from the
-# Folder Tree View (if specified).
-# The default value is: YES.
-
-SHOW_NAMESPACES = NO
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command command input-file, where command is the value of the
-# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided
-# by doxygen. Whatever the program writes to standard output is used as the file
-# version. For an example see the documentation.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. To create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option. You can
-# optionally specify a file name after the option, if omitted DoxygenLayout.xml
-# will be used as the name of the layout file.
-#
-# Note that if you run doxygen from a directory containing a file called
-# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
-# tag is left empty.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
-# the reference definitions. This must be a list of .bib files. The .bib
-# extension is automatically appended if omitted. This requires the bibtex tool
-# to be installed. See also http://en.wikipedia.org/wiki/BibTeX for more info.
-# For LaTeX the style of the bibliography can be controlled using
-# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the
-# search path. Do not use file names with spaces, bibtex cannot handle them. See
-# also \cite for info how to create references.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated to
-# standard output by doxygen. If QUIET is set to YES this implies that the
-# messages are off.
-# The default value is: NO.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated to standard error ( stderr) by doxygen. If WARNINGS is set to YES
-# this implies that the warnings are on.
-#
-# Tip: Turn warnings on while writing the documentation.
-# The default value is: YES.
-
-WARNINGS = YES
-
-# If the WARN_IF_UNDOCUMENTED tag is set to YES, then doxygen will generate
-# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag
-# will automatically be disabled.
-# The default value is: YES.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some parameters
-# in a documented function, or documenting parameters that don't exist or using
-# markup commands wrongly.
-# The default value is: YES.
-
-WARN_IF_DOC_ERROR = YES
-
-# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that
-# are documented, but have no documentation for their parameters or return
-# value. If set to NO doxygen will only warn about wrong or incomplete parameter
-# documentation, but not about the absence of documentation.
-# The default value is: NO.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that doxygen
-# can produce. The string should contain the $file, $line, and $text tags, which
-# will be replaced by the file and line number from which the warning originated
-# and the warning text. Optionally the format may contain $version, which will
-# be replaced by the version of the file (if it could be obtained via
-# FILE_VERSION_FILTER)
-# The default value is: $file:$line: $text.
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning and error
-# messages should be written. If left blank the output is written to standard
-# error (stderr).
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag is used to specify the files and/or directories that contain
-# documented source files. You may enter file names like myfile.cpp or
-# directories like /usr/src/myproject. Separate the files or directories with
-# spaces.
-# Note: If this tag is empty the current directory is searched.
-
-INPUT = readme.zh-cn.md \
- CHANGELOG.md \
- include/rapidjson/rapidjson.h \
- include/ \
- doc/features.zh-cn.md \
- doc/tutorial.zh-cn.md \
- doc/pointer.zh-cn.md \
- doc/stream.zh-cn.md \
- doc/encoding.zh-cn.md \
- doc/dom.zh-cn.md \
- doc/sax.zh-cn.md \
- doc/schema.zh-cn.md \
- doc/performance.zh-cn.md \
- doc/internals.zh-cn.md \
- doc/faq.zh-cn.md
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
-# libiconv (or the iconv built into libc) for the transcoding. See the libiconv
-# documentation (see: http://www.gnu.org/software/libiconv) for the list of
-# possible encodings.
-# The default value is: UTF-8.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank the
-# following patterns are tested:*.c, *.cc, *.cxx, *.cpp, *.c++, *.java, *.ii,
-# *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, *.hh, *.hxx, *.hpp,
-# *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, *.m, *.markdown,
-# *.md, *.mm, *.dox, *.py, *.f90, *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf,
-# *.qsf, *.as and *.js.
-
-FILE_PATTERNS = *.c \
- *.cc \
- *.cxx \
- *.cpp \
- *.h \
- *.hh \
- *.hxx \
- *.hpp \
- *.inc \
- *.md
-
-# The RECURSIVE tag can be used to specify whether or not subdirectories should
-# be searched for input files as well.
-# The default value is: NO.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-#
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE = ./include/rapidjson/msinttypes/
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-# The default value is: NO.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories.
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories for example use the pattern */test/*
-
-EXCLUDE_PATTERNS =
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-#
-# Note that the wildcards are matched against the file with absolute path, so to
-# exclude all test directories use the pattern */test/*
-
-EXCLUDE_SYMBOLS = internal
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or directories
-# that contain example code fragments that are included (see the \include
-# command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and
-# *.h) to filter out the source-files in the directories. If left blank all
-# files are included.
-
-EXAMPLE_PATTERNS = *
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude commands
-# irrespective of the value of the RECURSIVE tag.
-# The default value is: NO.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or directories
-# that contain images that are to be included in the documentation (see the
-# \image command).
-
-IMAGE_PATH = ./doc
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command:
-#
-# <filter> <input-file>
-#
-# where <filter> is the value of the INPUT_FILTER tag, and <input-file> is the
-# name of an input file. Doxygen will then use the output that the filter
-# program writes to standard output. If FILTER_PATTERNS is specified, this tag
-# will be ignored.
-#
-# Note that the filter must not add or remove lines; it is applied before the
-# code is scanned, but not when the output code is generated. If lines are added
-# or removed, the anchors will not be placed correctly.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis. Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match. The filters are a list of the form: pattern=filter
-# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how
-# filters are used. If the FILTER_PATTERNS tag is empty or if none of the
-# patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER ) will also be used to filter the input files that are used for
-# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES).
-# The default value is: NO.
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and
-# it is also possible to disable source filtering for a specific pattern using
-# *.ext= (so without naming a filter).
-# This tag requires that the tag FILTER_SOURCE_FILES is set to YES.
-
-FILTER_SOURCE_PATTERNS =
-
-# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that
-# is part of the input, its contents will be placed on the main page
-# (index.html). This can be useful if you have a project on for instance GitHub
-# and want to reuse the introduction page also for the doxygen output.
-
-USE_MDFILE_AS_MAINPAGE = readme.zh-cn.md
-
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will be
-# generated. Documented entities will be cross-referenced with these sources.
-#
-# Note: To get rid of all source code in the generated output, make sure that
-# also VERBATIM_HEADERS is set to NO.
-# The default value is: NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body of functions,
-# classes and enums directly into the documentation.
-# The default value is: NO.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any
-# special comment blocks from generated source code fragments. Normal C, C++ and
-# Fortran comments will always remain visible.
-# The default value is: YES.
-
-STRIP_CODE_COMMENTS = NO
-
-# If the REFERENCED_BY_RELATION tag is set to YES then for each documented
-# function all documented functions referencing it will be listed.
-# The default value is: NO.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES then for each documented function
-# all documented entities called/used by that function will be listed.
-# The default value is: NO.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set
-# to YES, then the hyperlinks from functions in REFERENCES_RELATION and
-# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will
-# link to the documentation.
-# The default value is: YES.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the
-# source code will show a tooltip with additional information such as prototype,
-# brief description and links to the definition and documentation. Since this
-# will make the HTML file larger and loading of large files a bit slower, you
-# can opt to disable this feature.
-# The default value is: YES.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-SOURCE_TOOLTIPS = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code will
-# point to the HTML generated by the htags(1) tool instead of doxygen built-in
-# source browser. The htags tool is part of GNU's global source tagging system
-# (see http://www.gnu.org/software/global/global.html). You will need version
-# 4.8.6 or higher.
-#
-# To use it do the following:
-# - Install the latest version of global
-# - Enable SOURCE_BROWSER and USE_HTAGS in the config file
-# - Make sure the INPUT points to the root of the source tree
-# - Run doxygen as normal
-#
-# Doxygen will invoke htags (and that will in turn invoke gtags), so these
-# tools must be available from the command line (i.e. in the search path).
-#
-# The result: instead of the source browser generated by doxygen, the links to
-# source code will now point to the output of htags.
-# The default value is: NO.
-# This tag requires that the tag SOURCE_BROWSER is set to YES.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a
-# verbatim copy of the header file for each class for which an include is
-# specified. Set to NO to disable this.
-# See also: Section \class.
-# The default value is: YES.
-
-VERBATIM_HEADERS = YES
-
-# If the CLANG_ASSISTED_PARSING tag is set to YES, then doxygen will use the
-# clang parser (see: http://clang.llvm.org/) for more accurate parsing at the
-# cost of reduced performance. This can be particularly helpful with template
-# rich C++ code for which doxygen's built-in parser lacks the necessary type
-# information.
-# Note: The availability of this option depends on whether or not doxygen was
-# compiled with the --with-libclang option.
-# The default value is: NO.
-
-CLANG_ASSISTED_PARSING = NO
-
-# If clang assisted parsing is enabled you can provide the compiler with command
-# line options that you would normally use when invoking the compiler. Note that
-# the include paths will already be set by doxygen for the files and directories
-# specified with INPUT and INCLUDE_PATH.
-# This tag requires that the tag CLANG_ASSISTED_PARSING is set to YES.
-
-CLANG_OPTIONS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all
-# compounds will be generated. Enable this if the project contains a lot of
-# classes, structs, unions or interfaces.
-# The default value is: YES.
-
-ALPHABETICAL_INDEX = NO
-
-# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
-# which the alphabetical index list will be split.
-# Minimum value: 1, maximum value: 20, default value: 5.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all classes will
-# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag
-# can be used to specify a prefix (or a list of prefixes) that should be ignored
-# while generating the index headers.
-# This tag requires that the tag ALPHABETICAL_INDEX is set to YES.
-
-IGNORE_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES doxygen will generate HTML output
-# The default value is: YES.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_OUTPUT = html/zh-cn
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each
-# generated HTML page (for example: .htm, .php, .asp).
-# The default value is: .html.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a user-defined HTML header file for
-# each generated HTML page. If the tag is left blank doxygen will generate a
-# standard header.
-#
-# To get valid HTML the header file that includes any scripts and style sheets
-# that doxygen needs, which is dependent on the configuration options used (e.g.
-# the setting GENERATE_TREEVIEW). It is highly recommended to start with a
-# default header using
-# doxygen -w html new_header.html new_footer.html new_stylesheet.css
-# YourConfigFile
-# and then modify the file new_header.html. See also section "Doxygen usage"
-# for information on how to generate the default header that doxygen normally
-# uses.
-# Note: The header is subject to change so you typically have to regenerate the
-# default header when upgrading to a newer version of doxygen. For a description
-# of the possible markers and block names see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_HEADER = ./doc/misc/header.html
-
-# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
-# generated HTML page. If the tag is left blank doxygen will generate a standard
-# footer. See HTML_HEADER for more information on how to generate a default
-# footer and what special commands can be used inside the footer. See also
-# section "Doxygen usage" for information on how to generate the default footer
-# that doxygen normally uses.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_FOOTER = ./doc/misc/footer.html
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
-# sheet that is used by each HTML page. It can be used to fine-tune the look of
-# the HTML output. If left blank doxygen will generate a default style sheet.
-# See also section "Doxygen usage" for information on how to generate the style
-# sheet that doxygen normally uses.
-# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as
-# it is more robust and this tag (HTML_STYLESHEET) will in the future become
-# obsolete.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_STYLESHEET tag can be used to specify an additional user-
-# defined cascading style sheet that is included after the standard style sheets
-# created by doxygen. Using this option one can overrule certain style aspects.
-# This is preferred over using HTML_STYLESHEET since it does not replace the
-# standard style sheet and is therefore more robust against future updates.
-# Doxygen will copy the style sheet file to the output directory. For an example
-# see the documentation.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_STYLESHEET = ./doc/misc/doxygenextra.css
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that the
-# files will be copied as-is; there are no commands or markers available.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
-# will adjust the colors in the stylesheet and background images according to
-# this color. Hue is specified as an angle on a colorwheel, see
-# http://en.wikipedia.org/wiki/Hue for more information. For instance the value
-# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300
-# purple, and 360 is red again.
-# Minimum value: 0, maximum value: 359, default value: 220.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors
-# in the HTML output. For a value of 0 the output will use grayscales only. A
-# value of 255 will produce the most vivid colors.
-# Minimum value: 0, maximum value: 255, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the
-# luminance component of the colors in the HTML output. Values below 100
-# gradually make the output lighter, whereas values above 100 make the output
-# darker. The value divided by 100 is the actual gamma applied, so 80 represents
-# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not
-# change the gamma.
-# Minimum value: 40, maximum value: 240, default value: 80.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting this
-# to NO can help when comparing the output of multiple runs.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries
-# shown in the various tree structured indices initially; the user can expand
-# and collapse entries dynamically later on. Doxygen will expand the tree to
-# such a level that at most the specified number of entries are visible (unless
-# a fully collapsed tree already exceeds this amount). So setting the number of
-# entries 1 will produce a full collapsed tree by default. 0 is a special value
-# representing an infinite number of entries and will result in a full expanded
-# tree by default.
-# Minimum value: 0, maximum value: 9999, default value: 100.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-HTML_INDEX_NUM_ENTRIES = 100
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files will be
-# generated that can be used as input for Apple's Xcode 3 integrated development
-# environment (see: http://developer.apple.com/tools/xcode/), introduced with
-# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a
-# Makefile in the HTML output directory. Running make will produce the docset in
-# that directory and running make install will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at
-# startup. See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_DOCSET = NO
-
-# This tag determines the name of the docset feed. A documentation feed provides
-# an umbrella under which multiple documentation sets from a single provider
-# (such as a company or product suite) can be grouped.
-# The default value is: Doxygen generated docs.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# This tag specifies a string that should uniquely identify the documentation
-# set bundle. This should be a reverse domain-name style string, e.g.
-# com.mycompany.MyDocSet. Doxygen will append .docset to the name.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-# The default value is: org.doxygen.Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
-# The default value is: Publisher.
-# This tag requires that the tag GENERATE_DOCSET is set to YES.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three
-# additional HTML index files: index.hhp, index.hhc, and index.hhk. The
-# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop
-# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on
-# Windows.
-#
-# The HTML Help Workshop contains a compiler that can convert all HTML output
-# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML
-# files are now used as the Windows 98 help format, and will replace the old
-# Windows help format (.hlp) on all Windows platforms in the future. Compressed
-# HTML files also contain an index, a table of contents, and you can search for
-# words in the documentation. The HTML workshop also contains a viewer for
-# compressed HTML files.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_HTMLHELP = NO
-
-# The CHM_FILE tag can be used to specify the file name of the resulting .chm
-# file. You can add a path in front of the file if the result should not be
-# written to the html output directory.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_FILE =
-
-# The HHC_LOCATION tag can be used to specify the location (absolute path
-# including file name) of the HTML help compiler ( hhc.exe). If non-empty
-# doxygen will try to run the HTML help compiler on the generated index.hhp.
-# The file has to be specified with full path.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-HHC_LOCATION =
-
-# The GENERATE_CHI flag controls if a separate .chi index file is generated (
-# YES) or that it should be included in the master .chm file ( NO).
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-GENERATE_CHI = NO
-
-# The CHM_INDEX_ENCODING is used to encode HtmlHelp index ( hhk), content ( hhc)
-# and project file content.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-CHM_INDEX_ENCODING =
-
-# The BINARY_TOC flag controls whether a binary table of contents is generated (
-# YES) or a normal table of contents ( NO) in the .chm file. Furthermore it
-# enables the Previous and Next buttons.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members to
-# the table of contents of the HTML help documentation and to the tree view.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTMLHELP is set to YES.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that
-# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help
-# (.qch) of the generated HTML documentation.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify
-# the file name of the resulting .qch file. The path specified is relative to
-# the HTML output folder.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
-# Project output. For more information please see Qt Help Project / Namespace
-# (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#namespace).
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
-# Help Project output. For more information please see Qt Help Project / Virtual
-# Folders (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#virtual-
-# folders).
-# The default value is: doc.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
-# filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see Qt Help Project / Custom
-# Filters (see: http://qt-project.org/doc/qt-4.8/qthelpproject.html#custom-
-# filters).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's filter section matches. Qt Help Project / Filter Attributes (see:
-# http://qt-project.org/doc/qt-4.8/qthelpproject.html#filter-attributes).
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHP_SECT_FILTER_ATTRS =
-
-# The QHG_LOCATION tag can be used to specify the location of Qt's
-# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the
-# generated .qhp file.
-# This tag requires that the tag GENERATE_QHP is set to YES.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be
-# generated, together with the HTML files, they form an Eclipse help plugin. To
-# install this plugin and make it available under the help contents menu in
-# Eclipse, the contents of the directory containing the HTML and XML files needs
-# to be copied into the plugins directory of eclipse. The name of the directory
-# within the plugins directory should be the same as the ECLIPSE_DOC_ID value.
-# After copying Eclipse needs to be restarted before the help appears.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the Eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have this
-# name. Each documentation set should have its own identifier.
-# The default value is: org.doxygen.Project.
-# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# If you want full control over the layout of the generated HTML pages it might
-# be necessary to disable the index and replace it with your own. The
-# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top
-# of each HTML page. A value of NO enables the index and the value YES disables
-# it. Since the tabs in the index contain the same information as the navigation
-# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-DISABLE_INDEX = YES
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information. If the tag
-# value is set to YES, a side panel will be generated containing a tree-like
-# index structure (just like the one that is generated for HTML Help). For this
-# to work a browser that supports JavaScript, DHTML, CSS and frames is required
-# (i.e. any modern browser). Windows users are probably better off using the
-# HTML help feature. Via custom stylesheets (see HTML_EXTRA_STYLESHEET) one can
-# further fine-tune the look of the index. As an example, the default style
-# sheet generated by doxygen has an example that shows how to put an image at
-# the root of the tree instead of the PROJECT_NAME. Since the tree basically has
-# the same information as the tab index, you could consider setting
-# DISABLE_INDEX to YES when enabling this option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-GENERATE_TREEVIEW = YES
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
-# doxygen will group on one line in the generated HTML documentation.
-#
-# Note that a value of 0 will completely suppress the enum values from appearing
-# in the overview section.
-# Minimum value: 0, maximum value: 20, default value: 4.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used
-# to set the initial width (in pixels) of the frame in which the tree is shown.
-# Minimum value: 0, maximum value: 1500, default value: 250.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open links to
-# external symbols imported via tag files in a separate window.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of LaTeX formulas included as images in
-# the HTML documentation. When you change the font size after a successful
-# doxygen run you need to manually remove any form_*.png images from the HTML
-# output directory to force them to be regenerated.
-# Minimum value: 8, maximum value: 50, default value: 10.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are not
-# supported properly for IE 6.0, but are supported on all modern browsers.
-#
-# Note that when changing this option you need to delete any form_*.png files in
-# the HTML output directory before the changes have effect.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
-# http://www.mathjax.org) which uses client side Javascript for the rendering
-# instead of using prerendered bitmaps. Use this if you do not have LaTeX
-# installed or if you want to formulas look prettier in the HTML output. When
-# enabled you may also need to install MathJax separately and configure the path
-# to it using the MATHJAX_RELPATH option.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you can set the default output format to be used for
-# the MathJax output. See the MathJax site (see:
-# http://docs.mathjax.org/en/latest/output.html) for more details.
-# Possible values are: HTML-CSS (which is slower, but has the best
-# compatibility), NativeMML (i.e. MathML) and SVG.
-# The default value is: HTML-CSS.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_FORMAT = HTML-CSS
-
-# When MathJax is enabled you need to specify the location relative to the HTML
-# output directory using the MATHJAX_RELPATH option. The destination directory
-# should contain the MathJax.js script. For instance, if the mathjax directory
-# is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax
-# Content Delivery Network so you can quickly see the result without installing
-# MathJax. However, it is strongly recommended to install a local copy of
-# MathJax from http://www.mathjax.org before deployment.
-# The default value is: http://cdn.mathjax.org/mathjax/latest.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_RELPATH = http://www.mathjax.org/mathjax
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax
-# extension names that should be enabled during MathJax rendering. For example
-# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_EXTENSIONS =
-
-# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces
-# of code that will be used on startup of the MathJax code. See the MathJax site
-# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an
-# example see the documentation.
-# This tag requires that the tag USE_MATHJAX is set to YES.
-
-MATHJAX_CODEFILE =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box for
-# the HTML output. The underlying search engine uses javascript and DHTML and
-# should work on any modern browser. Note that when using HTML help
-# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET)
-# there is already a search function so this one should typically be disabled.
-# For large projects the javascript based search engine can be slow, then
-# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to
-# search using the keyboard; to jump to the search box use <access key> + S
-# (what the <access key> is depends on the OS and browser, but it is typically
-# <CTRL>, <ALT>/<option>, or both). Inside the search box use the <cursor down
-# key> to jump into the search results window, the results can be navigated
-# using the <cursor keys>. Press <Enter> to select an item or <escape> to cancel
-# the search. The filter options can be selected when the cursor is inside the
-# search box by pressing <Shift>+<cursor down>. Also here use the <cursor keys>
-# to select a filter and <Enter> or <escape> to activate or cancel the filter
-# option.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_HTML is set to YES.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a web server instead of a web client using Javascript. There
-# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
-# setting. When disabled, doxygen will generate a PHP script for searching and
-# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
-# and searching needs to be provided by external tools. See the section
-# "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SERVER_BASED_SEARCH = NO
-
-# When EXTERNAL_SEARCH tag is enabled doxygen will no longer generate the PHP
-# script for searching. Instead the search results are written to an XML file
-# which needs to be processed by an external indexer. Doxygen will invoke an
-# external search engine pointed to by the SEARCHENGINE_URL option to obtain the
-# search results.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/).
-#
-# See the section "External Indexing and Searching" for details.
-# The default value is: NO.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH = NO
-
-# The SEARCHENGINE_URL should point to a search engine hosted by a web server
-# which will return the search results when EXTERNAL_SEARCH is enabled.
-#
-# Doxygen ships with an example indexer ( doxyindexer) and search engine
-# (doxysearch.cgi) which are based on the open source search engine library
-# Xapian (see: http://xapian.org/). See the section "External Indexing and
-# Searching" for details.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHENGINE_URL =
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the unindexed
-# search data is written to a file for indexing by an external tool. With the
-# SEARCHDATA_FILE tag the name of this file can be specified.
-# The default file is: searchdata.xml.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-SEARCHDATA_FILE = searchdata.xml
-
-# When SERVER_BASED_SEARCH and EXTERNAL_SEARCH are both enabled the
-# EXTERNAL_SEARCH_ID tag can be used as an identifier for the project. This is
-# useful in combination with EXTRA_SEARCH_MAPPINGS to search through multiple
-# projects and redirect the results back to the right project.
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTERNAL_SEARCH_ID =
-
-# The EXTRA_SEARCH_MAPPINGS tag can be used to enable searching through doxygen
-# projects other than the one defined by this configuration file, but that are
-# all added to the same external search index. Each project needs to have a
-# unique id set via EXTERNAL_SEARCH_ID. The search mapping then maps the id of
-# to a relative location where the documentation can be found. The format is:
-# EXTRA_SEARCH_MAPPINGS = tagname1=loc1 tagname2=loc2 ...
-# This tag requires that the tag SEARCHENGINE is set to YES.
-
-EXTRA_SEARCH_MAPPINGS =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES doxygen will generate LaTeX output.
-# The default value is: YES.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked.
-#
-# Note that when enabling USE_PDFLATEX this option is only used for generating
-# bitmaps for formulas in the HTML output, but not in the Makefile that is
-# written to the output directory.
-# The default file is: latex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to generate
-# index for LaTeX.
-# The default file is: makeindex.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES doxygen generates more compact LaTeX
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used by the
-# printer.
-# Possible values are: a4 (210 x 297 mm), letter (8.5 x 11 inches), legal (8.5 x
-# 14 inches) and executive (7.25 x 10.5 inches).
-# The default value is: a4.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be used to specify one or more LaTeX package names
-# that should be included in the LaTeX output. To get the times font for
-# instance you can specify
-# EXTRA_PACKAGES=times
-# If left blank no extra packages will be included.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
-# generated LaTeX document. The header should contain everything until the first
-# chapter. If it is left blank doxygen will generate a standard header. See
-# section "Doxygen usage" for information on how to let doxygen write the
-# default header to a separate file.
-#
-# Note: Only use a user-defined header if you know what you are doing! The
-# following commands have a special meaning inside the header: $title,
-# $datetime, $date, $doxygenversion, $projectname, $projectnumber. Doxygen will
-# replace them by respectively the title of the page, the current date and time,
-# only the current date, the version number of doxygen, the project name (see
-# PROJECT_NAME), or the project number (see PROJECT_NUMBER).
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for the
-# generated LaTeX document. The footer should contain everything after the last
-# chapter. If it is left blank doxygen will generate a standard footer.
-#
-# Note: Only use a user-defined footer if you know what you are doing!
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_FOOTER =
-
-# The LATEX_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the LATEX_OUTPUT output
-# directory. Note that the files will be copied as-is; there are no commands or
-# markers available.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_EXTRA_FILES =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated is
-# prepared for conversion to PDF (using ps2pdf or pdflatex). The PDF file will
-# contain links (just like the HTML output) instead of page references. This
-# makes the output suitable for online browsing using a PDF viewer.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-PDF_HYPERLINKS = YES
-
-# If the LATEX_PDFLATEX tag is set to YES, doxygen will use pdflatex to generate
-# the PDF file directly from the LaTeX files. Set this option to YES to get a
-# higher quality PDF documentation.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \batchmode
-# command to the generated LaTeX files. This will instruct LaTeX to keep running
-# if errors occur, instead of asking the user for help. This option is also used
-# when generating formulas in HTML.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BATCHMODE = NO
-
-# If the LATEX_HIDE_INDICES tag is set to YES then doxygen will not include the
-# index chapters (such as File Index, Compound Index, etc.) in the output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_HIDE_INDICES = NO
-
-# If the LATEX_SOURCE_CODE tag is set to YES then doxygen will include source
-# code with syntax highlighting in the LaTeX output.
-#
-# Note that which sources are shown also depends on other settings such as
-# SOURCE_BROWSER.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. See
-# http://en.wikipedia.org/wiki/BibTeX and \cite for more info.
-# The default value is: plain.
-# This tag requires that the tag GENERATE_LATEX is set to YES.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES doxygen will generate RTF output. The
-# RTF output is optimized for Word 97 and may not look too pretty with other RTF
-# readers/editors.
-# The default value is: NO.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: rtf.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES doxygen generates more compact RTF
-# documents. This may be useful for small projects and may help to save some
-# trees in general.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated will
-# contain hyperlink fields. The RTF file will contain links (just like the HTML
-# output) instead of page references. This makes the output suitable for online
-# browsing using Word or some other Word compatible readers that support those
-# fields.
-#
-# Note: WordPad (write) and others do not support links.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_HYPERLINKS = NO
-
-# Load stylesheet definitions from file. Syntax is similar to doxygen's config
-# file, i.e. a series of assignments. You only have to provide replacements,
-# missing definitions are set to their default value.
-#
-# See also section "Doxygen usage" for information on how to generate the
-# default style sheet that doxygen normally uses.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an RTF document. Syntax is
-# similar to doxygen's config file. A template extensions file can be generated
-# using doxygen -e rtf extensionFile.
-# This tag requires that the tag GENERATE_RTF is set to YES.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES doxygen will generate man pages for
-# classes and files.
-# The default value is: NO.
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it. A directory man3 will be created inside the directory specified by
-# MAN_OUTPUT.
-# The default directory is: man.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to the generated
-# man pages. In case the manual section does not start with a number, the number
-# 3 is prepended. The dot (.) at the beginning of the MAN_EXTENSION tag is
-# optional.
-# The default value is: .3.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_EXTENSION = .3
-
-# The MAN_SUBDIR tag determines the name of the directory created within
-# MAN_OUTPUT in which the man pages are placed. If defaults to man followed by
-# MAN_EXTENSION with the initial . removed.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_SUBDIR =
-
-# If the MAN_LINKS tag is set to YES and doxygen generates man output, then it
-# will generate one additional man file for each entity documented in the real
-# man page(s). These additional files only source the real man page, but without
-# them the man command would be unable to find the correct page.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_MAN is set to YES.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES doxygen will generate an XML file that
-# captures the structure of the code including all documentation.
-# The default value is: NO.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
-# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
-# it.
-# The default directory is: xml.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_OUTPUT = xml
-
-# If the XML_PROGRAMLISTING tag is set to YES doxygen will dump the program
-# listings (including syntax highlighting and cross-referencing information) to
-# the XML output. Note that enabling this will significantly increase the size
-# of the XML output.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_XML is set to YES.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_DOCBOOK tag is set to YES doxygen will generate Docbook files
-# that can be used to generate PDF.
-# The default value is: NO.
-
-GENERATE_DOCBOOK = NO
-
-# The DOCBOOK_OUTPUT tag is used to specify where the Docbook pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be put in
-# front of it.
-# The default directory is: docbook.
-# This tag requires that the tag GENERATE_DOCBOOK is set to YES.
-
-DOCBOOK_OUTPUT = docbook
-
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES doxygen will generate an AutoGen
-# Definitions (see http://autogen.sf.net) file that captures the structure of
-# the code including all documentation. Note that this feature is still
-# experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES doxygen will generate a Perl module
-# file that captures the structure of the code including all documentation.
-#
-# Note that this feature is still experimental and incomplete at the moment.
-# The default value is: NO.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES doxygen will generate the necessary
-# Makefile rules, Perl scripts and LaTeX code to be able to generate PDF and DVI
-# output from the Perl module output.
-# The default value is: NO.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be nicely
-# formatted so it can be parsed by a human reader. This is useful if you want to
-# understand what is going on. On the other hand, if this tag is set to NO the
-# size of the Perl module output will be much smaller and Perl will parse it
-# just the same.
-# The default value is: YES.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file are
-# prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. This is useful
-# so different doxyrules.make files included by the same Makefile don't
-# overwrite each other's variables.
-# This tag requires that the tag GENERATE_PERLMOD is set to YES.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES doxygen will evaluate all
-# C-preprocessor directives found in the sources and include files.
-# The default value is: YES.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES doxygen will expand all macro names
-# in the source code. If set to NO only conditional compilation will be
-# performed. Macro expansion can be done in a controlled way by setting
-# EXPAND_ONLY_PREDEF to YES.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-MACRO_EXPANSION = YES
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then
-# the macro expansion is limited to the macros specified with the PREDEFINED and
-# EXPAND_AS_DEFINED tags.
-# The default value is: NO.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_ONLY_PREDEF = YES
-
-# If the SEARCH_INCLUDES tag is set to YES the includes files in the
-# INCLUDE_PATH will be searched if a #include is found.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by the
-# preprocessor.
-# This tag requires that the tag SEARCH_INCLUDES is set to YES.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will be
-# used.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that are
-# defined before the preprocessor is started (similar to the -D option of e.g.
-# gcc). The argument of the tag is a list of macros of the form: name or
-# name=definition (no spaces). If the definition and the "=" are omitted, "=1"
-# is assumed. To prevent a macro definition from being undefined via #undef or
-# recursively expanded use the := operator instead of the = operator.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-PREDEFINED = \
- RAPIDJSON_DOXYGEN_RUNNING \
- RAPIDJSON_NAMESPACE_BEGIN="namespace rapidjson {" \
- RAPIDJSON_NAMESPACE_END="}" \
- RAPIDJSON_REMOVEFPTR_(x)=x \
- RAPIDJSON_ENABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype" \
- RAPIDJSON_DISABLEIF_RETURN(cond,returntype)="RAPIDJSON_REMOVEFPTR_ returntype"
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
-# tag can be used to specify a list of macro names that should be expanded. The
-# macro definition that is found in the sources will be used. Use the PREDEFINED
-# tag if you want to use a different macro definition that overrules the
-# definition found in the source code.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-EXPAND_AS_DEFINED = \
- RAPIDJSON_NOEXCEPT
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will
-# remove all references to function-like macros that are alone on a line, have
-# an all uppercase name, and do not end with a semicolon. Such function macros
-# are typically used for boiler-plate code, and will confuse the parser if not
-# removed.
-# The default value is: YES.
-# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES tag can be used to specify one or more tag files. For each tag
-# file the location of the external documentation should be added. The format of
-# a tag file without this location is as follows:
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where loc1 and loc2 can be relative or absolute paths or URLs. See the
-# section "Linking to external documentation" for more information about the use
-# of tag files.
-# Note: Each tag file must have a unique name (where the name does NOT include
-# the path). If a tag file is not located in the directory in which doxygen is
-# run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create a
-# tag file that is based on the input files it reads. See section "Linking to
-# external documentation" for more information about the usage of tag files.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external class will be listed in the
-# class index. If set to NO only the inherited external classes will be listed.
-# The default value is: NO.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed in
-# the modules index. If set to NO, only the current project's groups will be
-# listed.
-# The default value is: YES.
-
-EXTERNAL_GROUPS = YES
-
-# If the EXTERNAL_PAGES tag is set to YES all external pages will be listed in
-# the related pages index. If set to NO, only the current project's pages will
-# be listed.
-# The default value is: YES.
-
-EXTERNAL_PAGES = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of 'which perl').
-# The default file (with absolute path) is: /usr/bin/perl.
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES doxygen will generate a class diagram
-# (in HTML and LaTeX) for classes with base or super classes. Setting the tag to
-# NO turns the diagrams off. Note that this option also works with HAVE_DOT
-# disabled, but it is recommended to install and use dot, since it yields more
-# powerful graphs.
-# The default value is: YES.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see:
-# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# You can include diagrams made with dia in doxygen documentation. Doxygen will
-# then run dia to produce the diagram and insert it in the documentation. The
-# DIA_PATH tag allows you to specify the directory where the dia binary resides.
-# If left empty dia is assumed to be found in the default search path.
-
-DIA_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide inheritance
-# and usage relations if the target is undocumented or is not a class.
-# The default value is: YES.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz (see:
-# http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent
-# Bell Labs. The other options in this section have no effect if this option is
-# set to NO
-# The default value is: NO.
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is allowed
-# to run in parallel. When set to 0 doxygen will base this on the number of
-# processors available in the system. You can set it explicitly to a value
-# larger than 0 to get control over the balance between CPU load and processing
-# speed.
-# Minimum value: 0, maximum value: 32, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_NUM_THREADS = 0
-
-# When you want a differently looking font n the dot files that doxygen
-# generates you can specify the font name using DOT_FONTNAME. You need to make
-# sure dot is able to find the font, which can be done by putting it in a
-# standard location or by setting the DOTFONTPATH environment variable or by
-# setting DOT_FONTPATH to the directory containing the font.
-# The default value is: Helvetica.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size (in points) of the font of
-# dot graphs.
-# Minimum value: 4, maximum value: 24, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the default font as specified with
-# DOT_FONTNAME. If you specify a different font using DOT_FONTNAME you can set
-# the path where dot can find it using this tag.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH tag is set to YES then doxygen will generate a graph for
-# each documented class showing the direct and indirect inheritance relations.
-# Setting this tag to YES will force the CLASS_DIAGRAMS tag to NO.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH tag is set to YES then doxygen will generate a
-# graph for each documented class showing the direct and indirect implementation
-# dependencies (inheritance, containment, and class references variables) of the
-# class with other documented classes.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS tag is set to YES then doxygen will generate a graph for
-# groups, showing the direct groups dependencies.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LOOK = NO
-
-# If the UML_LOOK tag is enabled, the fields and methods are shown inside the
-# class node. If there are many fields or methods and many nodes the graph may
-# become too big to be useful. The UML_LIMIT_NUM_FIELDS threshold limits the
-# number of items for each type to make the size more manageable. Set this to 0
-# for no limit. Note that the threshold may be exceeded by 50% before the limit
-# is enforced. So when you set the threshold to 10, up to 15 fields may appear,
-# but if the number exceeds 15, the total amount of fields shown is limited to
-# 10.
-# Minimum value: 0, maximum value: 100, default value: 10.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-UML_LIMIT_NUM_FIELDS = 10
-
-# If the TEMPLATE_RELATIONS tag is set to YES then the inheritance and
-# collaboration graphs will show the relations between templates and their
-# instances.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-TEMPLATE_RELATIONS = NO
-
-# If the INCLUDE_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are set to
-# YES then doxygen will generate a graph for each documented file showing the
-# direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDE_GRAPH = YES
-
-# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are
-# set to YES then doxygen will generate a graph for each documented file showing
-# the direct and indirect include dependencies of the file with other documented
-# files.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH tag is set to YES then doxygen will generate a call
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable call graphs for selected
-# functions only using the \callgraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH tag is set to YES then doxygen will generate a caller
-# dependency graph for every global function or class method.
-#
-# Note that enabling this option will significantly increase the time of a run.
-# So in most cases it will be better to enable caller graphs for selected
-# functions only using the \callergraph command.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY tag is set to YES then doxygen will graphical
-# hierarchy of all classes instead of a textual one.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH tag is set to YES then doxygen will show the
-# dependencies a directory has on other directories in a graphical way. The
-# dependency relations are determined by the #include relations between the
-# files in the directories.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot.
-# Note: If you choose svg you need to set HTML_FILE_EXTENSION to xhtml in order
-# to make the SVG files visible in IE 9+ (other browsers do not have this
-# requirement).
-# Possible values are: png, jpg, gif and svg.
-# The default value is: png.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-#
-# Note that this requires a modern browser other than Internet Explorer. Tested
-# and working are Firefox, Chrome, Safari, and Opera.
-# Note: For IE 9+ you need to set HTML_FILE_EXTENSION to xhtml in order to make
-# the SVG files visible. Older versions of IE do not have SVG support.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-INTERACTIVE_SVG = NO
-
-# The DOT_PATH tag can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the \dotfile
-# command).
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the \mscfile
-# command).
-
-MSCFILE_DIRS =
-
-# The DIAFILE_DIRS tag can be used to specify one or more directories that
-# contain dia files that are included in the documentation (see the \diafile
-# command).
-
-DIAFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of nodes
-# that will be shown in the graph. If the number of nodes in a graph becomes
-# larger than this value, doxygen will truncate the graph, which is visualized
-# by representing a node as a red box. Note that doxygen if the number of direct
-# children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note that
-# the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-# Minimum value: 0, maximum value: 10000, default value: 50.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the graphs
-# generated by dot. A depth value of 3 means that only nodes reachable from the
-# root by following a path via at most 3 edges will be shown. Nodes that lay
-# further from the root node will be omitted. Note that setting this option to 1
-# or 2 may greatly reduce the computation time needed for large code bases. Also
-# note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-# Minimum value: 0, maximum value: 1000, default value: 0.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not seem
-# to support this out of the box.
-#
-# Warning: Depending on the platform used, enabling this option may lead to
-# badly anti-aliased labels on the edges of a graph (i.e. they become hard to
-# read).
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10) support
-# this, this feature is disabled by default.
-# The default value is: NO.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_MULTI_TARGETS = NO
-
-# If the GENERATE_LEGEND tag is set to YES doxygen will generate a legend page
-# explaining the meaning of the various boxes and arrows in the dot generated
-# graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES doxygen will remove the intermediate dot
-# files that are used to generate the various graphs.
-# The default value is: YES.
-# This tag requires that the tag HAVE_DOT is set to YES.
-
-DOT_CLEANUP = YES
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.dot
deleted file mode 100644
index c816c87183..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.dot
+++ /dev/null
@@ -1,50 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- nodesep=0.5
- penwidth=0.5
- colorscheme=spectral7
-
- node [shape=box, fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, style=filled, fillcolor=white]
- edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "SAX"
- style=filled
- fillcolor=6
-
- Reader -> Writer [style=invis]
- }
-
- subgraph cluster2 {
- margin="10,10"
- labeljust="left"
- label = "DOM"
- style=filled
- fillcolor=7
-
- Value
- Document
- }
-
- Handler [label="<<concept>>\nHandler"]
-
- {
- edge [arrowtail=onormal, dir=back]
- Value -> Document
- Handler -> Document
- Handler -> Writer
- }
-
- {
- edge [arrowhead=vee, style=dashed, constraint=false]
- Reader -> Handler [label="calls"]
- Value -> Handler [label="calls"]
- Document -> Reader [label="uses"]
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.png
deleted file mode 100644
index 556c7e7291..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/architecture.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.dot
deleted file mode 100644
index eca0e3854f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.dot
+++ /dev/null
@@ -1,65 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- {
- node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
- oldjson [label="\{|\"|m|s|g|\"|:|\"|H|e|l|l|o|\\|n|W|o|r|l|d|!|\"|,|\"|\\|u|0|0|7|3|t|a|r|s|\"|:|1|0|\}", xlabel="Before Parsing"]
- //newjson [label="\{|\"|<a>m|s|g|\\0|:|\"|<b>H|e|l|l|o|\\n|W|o|r|l|d|!|\\0|\"|,|\"|<c>s|t|a|r|s|\\0|t|a|r|s|:|1|0|\}", xlabel="After Parsing"]
- newjson [shape=plaintext, label=<
-<table BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="2"><tr>
-<td>{</td>
-<td>"</td><td port="a">m</td><td>s</td><td>g</td><td bgcolor="yellow">\\0</td>
-<td>:</td>
-<td>"</td><td port="b">H</td><td>e</td><td>l</td><td>l</td><td>o</td><td bgcolor="yellow">\\n</td><td bgcolor="yellow">W</td><td bgcolor="yellow">o</td><td bgcolor="yellow">r</td><td bgcolor="yellow">l</td><td bgcolor="yellow">d</td><td bgcolor="yellow">!</td><td bgcolor="yellow">\\0</td><td>"</td>
-<td>,</td>
-<td>"</td><td port="c" bgcolor="yellow">s</td><td bgcolor="yellow">t</td><td bgcolor="yellow">a</td><td bgcolor="yellow">r</td><td bgcolor="yellow">s</td><td bgcolor="yellow">\\0</td><td>t</td><td>a</td><td>r</td><td>s</td>
-<td>:</td>
-<td>1</td><td>0</td>
-<td>}</td>
-</tr></table>
->, xlabel="After Parsing"]
- }
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Document by In situ Parsing"
- style=filled
- fillcolor=gray95
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- root [label="{object|}", fillcolor=3]
-
- {
- msg [label="{string|<a>}", fillcolor=5]
- helloworld [label="{string|<a>}", fillcolor=5]
- stars [label="{string|<a>}", fillcolor=5]
- ten [label="{number|10}", fillcolor=6]
- }
- }
-
- oldjson -> root [label=" ParseInsitu()" lhead="cluster1"]
- edge [arrowhead=vee]
- root -> { msg; stars }
-
- edge [arrowhead="none"]
- msg -> helloworld
- stars -> ten
-
- {
- edge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]
- msg:a:c -> newjson:a
- helloworld:a:c -> newjson:b
- stars:a:c -> newjson:c
- }
-
- //oldjson -> newjson [style=invis]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.png
deleted file mode 100644
index 4400c88466..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/insituparsing.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.dot
deleted file mode 100644
index 82ebfe1f09..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.dot
+++ /dev/null
@@ -1,62 +0,0 @@
-digraph {
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- penwidth=0.0
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
-
- node [shape = doublecircle]; Start; Finish;
- node [shape = box; style = "rounded, filled"; fillcolor=white ];
-
- Start -> ArrayInitial [label=" ["];
- Start -> ObjectInitial [label=" {"];
-
- subgraph clusterArray {
- margin="10,10"
- style=filled
- fillcolor=gray95
- label = "Array"
-
- ArrayInitial; Element; ElementDelimiter; ArrayFinish;
- }
-
- subgraph clusterObject {
- margin="10,10"
- style=filled
- fillcolor=gray95
- label = "Object"
-
- ObjectInitial; MemberKey; KeyValueDelimiter; MemberValue; MemberDelimiter; ObjectFinish;
- }
-
- ArrayInitial -> ArrayInitial [label="["];
- ArrayInitial -> ArrayFinish [label=" ]"];
- ArrayInitial -> ObjectInitial [label="{", constraint=false];
- ArrayInitial -> Element [label="string\nfalse\ntrue\nnull\nnumber"];
-
- Element -> ArrayFinish [label="]"];
- Element -> ElementDelimiter [label=","];
-
- ElementDelimiter -> ArrayInitial [label=" ["];
- ElementDelimiter -> ObjectInitial [label="{"];
- ElementDelimiter -> Element [label="string\nfalse\ntrue\nnull\nnumber"];
-
- ObjectInitial -> ObjectFinish [label=" }"];
- ObjectInitial -> MemberKey [label=" string "];
-
- MemberKey -> KeyValueDelimiter [label=":"];
-
- KeyValueDelimiter -> ArrayInitial [label="["];
- KeyValueDelimiter -> ObjectInitial [label=" {"];
- KeyValueDelimiter -> MemberValue [label=" string\n false\n true\n null\n number"];
-
- MemberValue -> ObjectFinish [label="}"];
- MemberValue -> MemberDelimiter [label=","];
-
- MemberDelimiter -> MemberKey [label=" string "];
-
- ArrayFinish -> Finish;
- ObjectFinish -> Finish;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.png
deleted file mode 100644
index f315494db1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/iterative-parser-states-diagram.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/makefile b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/makefile
deleted file mode 100644
index 3483977655..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-%.pdf: %.dot
- dot $< -Tpdf -o $@
-
-%.png: %.dot
- dot $< -Tpng -o $@
-
-DOTFILES = $(basename $(wildcard *.dot))
-all: $(addsuffix .png, $(DOTFILES)) $(addsuffix .pdf, $(DOTFILES))
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.dot
deleted file mode 100644
index a7c1464ad0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.dot
+++ /dev/null
@@ -1,47 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Before"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- {
- rank = same
- b1 [label="{b:number|456}", fillcolor=6]
- a1 [label="{a:number|123}", fillcolor=6]
- }
-
- a1 -> b1 [style="dashed", label="Move", dir=back]
- }
-
- subgraph cluster2 {
- margin="10,10"
- labeljust="left"
- label = "After"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- {
- rank = same
- b2 [label="{b:null|}", fillcolor=1]
- a2 [label="{a:number|456}", fillcolor=6]
- }
- a2 -> b2 [style=invis, dir=back]
- }
- b1 -> b2 [style=invis]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.png
deleted file mode 100644
index ab322d084b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move1.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.dot
deleted file mode 100644
index 2319871b9e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.dot
+++ /dev/null
@@ -1,62 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Before Copying (Hypothetic)"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- c1 [label="{contacts:array|}", fillcolor=4]
- c11 [label="{|}"]
- c12 [label="{|}"]
- c13 [shape="none", label="...", style="solid"]
- o1 [label="{o:object|}", fillcolor=3]
- ghost [label="{o:object|}", style=invis]
-
- c1 -> o1 [style="dashed", label="AddMember", constraint=false]
-
- edge [arrowhead=vee]
- c1 -> { c11; c12; c13 }
- o1 -> ghost [style=invis]
- }
-
- subgraph cluster2 {
- margin="10,10"
- labeljust="left"
- label = "After Copying (Hypothetic)"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- c2 [label="{contacts:array|}", fillcolor=4]
- c3 [label="{array|}", fillcolor=4]
- c21 [label="{|}"]
- c22 [label="{|}"]
- c23 [shape=none, label="...", style="solid"]
- o2 [label="{o:object|}", fillcolor=3]
- cs [label="{string|\"contacts\"}", fillcolor=5]
- c31 [label="{|}"]
- c32 [label="{|}"]
- c33 [shape="none", label="...", style="solid"]
-
- edge [arrowhead=vee]
- c2 -> { c21; c22; c23 }
- o2 -> cs
- cs -> c3 [arrowhead=none]
- c3 -> { c31; c32; c33 }
- }
- ghost -> o2 [style=invis]
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.png
deleted file mode 100644
index 8d4fc5bcc2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move2.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.dot
deleted file mode 100644
index 57adb4f9d7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.dot
+++ /dev/null
@@ -1,60 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
- forcelabels=true
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Before Moving"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- c1 [label="{contacts:array|}", fillcolor=4]
- c11 [label="{|}"]
- c12 [label="{|}"]
- c13 [shape=none, label="...", style="solid"]
- o1 [label="{o:object|}", fillcolor=3]
- ghost [label="{o:object|}", style=invis]
-
- c1 -> o1 [style="dashed", constraint=false, label="AddMember"]
-
- edge [arrowhead=vee]
- c1 -> { c11; c12; c13 }
- o1 -> ghost [style=invis]
- }
-
- subgraph cluster2 {
- margin="10,10"
- labeljust="left"
- label = "After Moving"
- style=filled
- fillcolor=gray95
-
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- c2 [label="{contacts:null|}", fillcolor=1]
- c3 [label="{array|}", fillcolor=4]
- c21 [label="{|}"]
- c22 [label="{|}"]
- c23 [shape="none", label="...", style="solid"]
- o2 [label="{o:object|}", fillcolor=3]
- cs [label="{string|\"contacts\"}", fillcolor=5]
- c2 -> o2 [style="dashed", constraint=false, label="AddMember", style=invis]
-
- edge [arrowhead=vee]
- c3 -> { c21; c22; c23 }
- o2 -> cs
- cs -> c3 [arrowhead=none]
- }
- ghost -> o2 [style=invis]
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.png
deleted file mode 100644
index 558470f1fa..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/move3.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.dot
deleted file mode 100644
index b15941ba0f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.dot
+++ /dev/null
@@ -1,56 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- {
- node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
- normaljson [label="\{|\"|m|s|g|\"|:|\"|H|e|l|l|o|\\|n|W|o|r|l|d|!|\"|,|\"|\\|u|0|0|7|3|t|a|r|s\"|:|1|0|\}"]
-
- {
- rank = same
- msgstring [label="m|s|g|\\0"]
- helloworldstring [label="H|e|l|l|o|\\n|W|o|r|l|d|!|\\0"]
- starsstring [label="s|t|a|r|s\\0"]
- }
- }
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Document by Normal Parsing"
- style=filled
- fillcolor=gray95
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- root [label="{object|}", fillcolor=3]
-
- {
- msg [label="{string|<a>}", fillcolor=5]
- helloworld [label="{string|<a>}", fillcolor=5]
- stars [label="{string|<a>}", fillcolor=5]
- ten [label="{number|10}", fillcolor=6]
- }
- }
-
- normaljson -> root [label=" Parse()" lhead="cluster1"]
- edge [arrowhead=vee]
- root -> { msg; stars }
-
- edge [arrowhead="none"]
- msg -> helloworld
- stars -> ten
-
- edge [arrowhead=vee, arrowtail=dot, arrowsize=0.5, dir=both, tailclip=false]
- msg:a:c -> msgstring:w
- helloworld:a:c -> helloworldstring:w
- stars:a:c -> starsstring:w
-
- msgstring -> helloworldstring -> starsstring [style=invis]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.png
deleted file mode 100644
index 702512ca36..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/normalparsing.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.dot
deleted file mode 100644
index 959cdbb417..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.dot
+++ /dev/null
@@ -1,54 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10, arrowhead=normal]
-
- {
- node [shape=record, fontsize="8", margin="0.04", height=0.2, color=gray]
- srcjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|0|\}"]
- dstjson [label="\{|\"|p|r|o|j|e|c|t|\"|:|\"|r|a|p|i|d|j|s|o|n|\"|,|\"|s|t|a|r|s|\"|:|1|1|\}"]
- }
-
- {
- node [shape="box", style="filled", fillcolor="gray95"]
- Document2 [label="(Modified) Document"]
- Writer
- }
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Document"
- style=filled
- fillcolor=gray95
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- root [label="{object|}", fillcolor=3]
-
- {
- project [label="{string|\"project\"}", fillcolor=5]
- rapidjson [label="{string|\"rapidjson\"}", fillcolor=5]
- stars [label="{string|\"stars\"}", fillcolor=5]
- ten [label="{number|10}", fillcolor=6]
- }
-
- edge [arrowhead=vee]
- root -> { project; stars }
-
- edge [arrowhead="none"]
- project -> rapidjson
- stars -> ten
- }
-
- srcjson -> root [label=" Parse()", lhead="cluster1"]
-
- ten -> Document2 [label=" Increase \"stars\"", ltail="cluster1" ]
- Document2 -> Writer [label=" Traverse DOM by Accept()"]
- Writer -> dstjson [label=" Output to StringBuffer"]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.png
deleted file mode 100644
index 38d9c5dc12..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/simpledom.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.dot
deleted file mode 100644
index 138ddc381d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.dot
+++ /dev/null
@@ -1,58 +0,0 @@
-digraph {
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.2
- penwidth=0.5
-
- node [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
- edge [fontname="Inconsolata, Consolas", fontsize=10]
-
- subgraph cluster1 {
- margin="10,10"
- labeljust="left"
- label = "Document"
- style=filled
- fillcolor=gray95
- node [shape=Mrecord, style=filled, colorscheme=spectral7]
-
- root [label="{object|}", fillcolor=3]
-
- {
- hello [label="{string|\"hello\"}", fillcolor=5]
- t [label="{string|\"t\"}", fillcolor=5]
- f [label="{string|\"f\"}", fillcolor=5]
- n [label="{string|\"n\"}", fillcolor=5]
- i [label="{string|\"i\"}", fillcolor=5]
- pi [label="{string|\"pi\"}", fillcolor=5]
- a [label="{string|\"a\"}", fillcolor=5]
-
- world [label="{string|\"world\"}", fillcolor=5]
- true [label="{true|}", fillcolor=7]
- false [label="{false|}", fillcolor=2]
- null [label="{null|}", fillcolor=1]
- i1 [label="{number|123}", fillcolor=6]
- pi1 [label="{number|3.1416}", fillcolor=6]
- array [label="{array|size=4}", fillcolor=4]
-
- a1 [label="{number|1}", fillcolor=6]
- a2 [label="{number|2}", fillcolor=6]
- a3 [label="{number|3}", fillcolor=6]
- a4 [label="{number|4}", fillcolor=6]
- }
-
- edge [arrowhead=vee]
- root -> { hello; t; f; n; i; pi; a }
- array -> { a1; a2; a3; a4 }
-
- edge [arrowhead=none]
- hello -> world
- t -> true
- f -> false
- n -> null
- i -> i1
- pi -> pi1
- a -> array
- }
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.png
deleted file mode 100644
index 8a12924acd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/tutorial.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.dot b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.dot
deleted file mode 100644
index 1492a8a7af..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.dot
+++ /dev/null
@@ -1,73 +0,0 @@
-digraph {
- rankdir=LR
- compound=true
- fontname="Inconsolata, Consolas"
- fontsize=10
- margin="0,0"
- ranksep=0.3
- nodesep=0.15
- penwidth=0.5
- colorscheme=spectral7
-
- node [shape=box, fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5, style=filled, fillcolor=white]
- edge [fontname="Inconsolata, Consolas", fontsize=10, penwidth=0.5]
-
- subgraph cluster0 {
- style=filled
- fillcolor=4
-
- Encoding [label="<<concept>>\nEncoding"]
-
- edge [arrowtail=onormal, dir=back]
- Encoding -> { UTF8; UTF16; UTF32; ASCII; AutoUTF }
- UTF16 -> { UTF16LE; UTF16BE }
- UTF32 -> { UTF32LE; UTF32BE }
- }
-
- subgraph cluster1 {
- style=filled
- fillcolor=5
-
- Stream [label="<<concept>>\nStream"]
- InputByteStream [label="<<concept>>\nInputByteStream"]
- OutputByteStream [label="<<concept>>\nOutputByteStream"]
-
- edge [arrowtail=onormal, dir=back]
- Stream -> {
- StringStream; InsituStringStream; StringBuffer;
- EncodedInputStream; EncodedOutputStream;
- AutoUTFInputStream; AutoUTFOutputStream
- InputByteStream; OutputByteStream
- }
-
- InputByteStream -> { MemoryStream; FlieReadStream }
- OutputByteStream -> { MemoryBuffer; FileWriteStream }
- }
-
- subgraph cluster2 {
- style=filled
- fillcolor=3
-
- Allocator [label="<<concept>>\nAllocator"]
-
- edge [arrowtail=onormal, dir=back]
- Allocator -> { CrtAllocator; MemoryPoolAllocator }
- }
-
- {
- edge [arrowtail=odiamond, arrowhead=vee, dir=both]
- EncodedInputStream -> InputByteStream
- EncodedOutputStream -> OutputByteStream
- AutoUTFInputStream -> InputByteStream
- AutoUTFOutputStream -> OutputByteStream
- MemoryPoolAllocator -> Allocator [label="base", tailport=s]
- }
-
- {
- edge [arrowhead=vee, style=dashed]
- AutoUTFInputStream -> AutoUTF
- AutoUTFOutputStream -> AutoUTF
- }
-
- //UTF32LE -> Stream [style=invis]
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.png
deleted file mode 100644
index ce029a4d06..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/diagram/utilityclass.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.md
deleted file mode 100644
index 6992e77d1d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.md
+++ /dev/null
@@ -1,281 +0,0 @@
-# DOM
-
-Document Object Model(DOM) is an in-memory representation of JSON for query and manipulation. The basic usage of DOM is described in [Tutorial](doc/tutorial.md). This section will describe some details and more advanced usages.
-
-[TOC]
-
-# Template {#Template}
-
-In the tutorial, `Value` and `Document` was used. Similarly to `std::string`, these are actually `typedef` of template classes:
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericValue {
- // ...
-};
-
-template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericDocument : public GenericValue<Encoding, Allocator> {
- // ...
-};
-
-typedef GenericValue<UTF8<> > Value;
-typedef GenericDocument<UTF8<> > Document;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-User can customize these template parameters.
-
-## Encoding {#Encoding}
-
-The `Encoding` parameter specifies the encoding of JSON String value in memory. Possible options are `UTF8`, `UTF16`, `UTF32`. Note that, these 3 types are also template class. `UTF8<>` is `UTF8<char>`, which means using char to store the characters. You may refer to [Encoding](doc/encoding.md) for details.
-
-Suppose a Windows application would query localization strings stored in JSON files. Unicode-enabled functions in Windows use UTF-16 (wide character) encoding. No matter what encoding was used in JSON files, we can store the strings in UTF-16 in memory.
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-typedef GenericDocument<UTF16<> > WDocument;
-typedef GenericValue<UTF16<> > WValue;
-
-FILE* fp = fopen("localization.json", "rb"); // non-Windows use "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // wraps bis into eis
-
-WDocument d;
-d.ParseStream<0, AutoUTF<unsigned> >(eis);
-
-const WValue locale(L"ja"); // Japanese
-
-MessageBoxW(hWnd, d[locale].GetString(), L"Test", MB_OK);
-~~~~~~~~~~
-
-## Allocator {#Allocator}
-
-The `Allocator` defines which allocator class is used when allocating/deallocating memory for `Document`/`Value`. `Document` owns, or references to an `Allocator` instance. On the other hand, `Value` does not do so, in order to reduce memory consumption.
-
-The default allocator used in `GenericDocument` is `MemoryPoolAllocator`. This allocator actually allocate memory sequentially, and cannot deallocate one by one. This is very suitable when parsing a JSON into a DOM tree.
-
-Another allocator is `CrtAllocator`, of which CRT is short for C RunTime library. This allocator simply calls the standard `malloc()`/`realloc()`/`free()`. When there is a lot of add and remove operations, this allocator may be preferred. But this allocator is far less efficient than `MemoryPoolAllocator`.
-
-# Parsing {#Parsing}
-
-`Document` provides several functions for parsing. In below, (1) is the fundamental function, while the others are helpers which call (1).
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-// (1) Fundamental
-template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (2) Using the same Encoding for stream
-template <unsigned parseFlags, typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (3) Using default parse flags
-template <typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (4) In situ parsing
-template <unsigned parseFlags>
-GenericDocument& GenericDocument::ParseInsitu(Ch* str);
-
-// (5) In situ parsing, using default parse flags
-GenericDocument& GenericDocument::ParseInsitu(Ch* str);
-
-// (6) Normal parsing of a string
-template <unsigned parseFlags, typename SourceEncoding>
-GenericDocument& GenericDocument::Parse(const Ch* str);
-
-// (7) Normal parsing of a string, using same Encoding of Document
-template <unsigned parseFlags>
-GenericDocument& GenericDocument::Parse(const Ch* str);
-
-// (8) Normal parsing of a string, using default parse flags
-GenericDocument& GenericDocument::Parse(const Ch* str);
-~~~~~~~~~~
-
-The examples of [tutorial](doc/tutorial.md) uses (8) for normal parsing of string. The examples of [stream](doc/stream.md) uses the first three. *In situ* parsing will be described soon.
-
-The `parseFlags` are combination of the following bit-flags:
-
-Parse flags | Meaning
-------------------------------|-----------------------------------
-`kParseNoFlags` | No flag is set.
-`kParseDefaultFlags` | Default parse flags. It is equal to macro `RAPIDJSON_PARSE_DEFAULT_FLAGS`, which is defined as `kParseNoFlags`.
-`kParseInsituFlag` | In-situ(destructive) parsing.
-`kParseValidateEncodingFlag` | Validate encoding of JSON strings.
-`kParseIterativeFlag` | Iterative(constant complexity in terms of function call stack size) parsing.
-`kParseStopWhenDoneFlag` | After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate `kParseErrorDocumentRootNotSingular` error. Using this flag for parsing multiple JSONs in the same stream.
-`kParseFullPrecisionFlag` | Parse number in full precision (slower). If this flag is not set, the normal precision (faster) is used. Normal precision has maximum 3 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) error.
-`kParseCommentsFlag` | Allow one-line `// ...` and multi-line `/* ... */` comments (relaxed JSON syntax).
-`kParseNumbersAsStringsFlag` | Parse numerical type values as strings.
-`kParseTrailingCommasFlag` | Allow trailing commas at the end of objects and arrays (relaxed JSON syntax).
-`kParseNanAndInfFlag` | Allow parsing `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (relaxed JSON syntax).
-`kParseEscapedApostropheFlag` | Allow escaped apostrophe `\'` in strings (relaxed JSON syntax).
-
-By using a non-type template parameter, instead of a function parameter, C++ compiler can generate code which is optimized for specified combinations, improving speed, and reducing code size (if only using a single specialization). The downside is the flags needed to be determined in compile-time.
-
-The `SourceEncoding` parameter defines what encoding is in the stream. This can be differed to the `Encoding` of the `Document`. See [Transcoding and Validation](#TranscodingAndValidation) section for details.
-
-And the `InputStream` is type of input stream.
-
-## Parse Error {#ParseError}
-
-When the parse processing succeeded, the `Document` contains the parse results. When there is an error, the original DOM is *unchanged*. And the error state of parsing can be obtained by `bool HasParseError()`, `ParseErrorCode GetParseError()` and `size_t GetErrorOffset()`.
-
-Parse Error Code | Description
---------------------------------------------|---------------------------------------------------
-`kParseErrorNone` | No error.
-`kParseErrorDocumentEmpty` | The document is empty.
-`kParseErrorDocumentRootNotSingular` | The document root must not follow by other values.
-`kParseErrorValueInvalid` | Invalid value.
-`kParseErrorObjectMissName` | Missing a name for object member.
-`kParseErrorObjectMissColon` | Missing a colon after a name of object member.
-`kParseErrorObjectMissCommaOrCurlyBracket` | Missing a comma or `}` after an object member.
-`kParseErrorArrayMissCommaOrSquareBracket` | Missing a comma or `]` after an array element.
-`kParseErrorStringUnicodeEscapeInvalidHex` | Incorrect hex digit after `\\u` escape in string.
-`kParseErrorStringUnicodeSurrogateInvalid` | The surrogate pair in string is invalid.
-`kParseErrorStringEscapeInvalid` | Invalid escape character in string.
-`kParseErrorStringMissQuotationMark` | Missing a closing quotation mark in string.
-`kParseErrorStringInvalidEncoding` | Invalid encoding in string.
-`kParseErrorNumberTooBig` | Number too big to be stored in `double`.
-`kParseErrorNumberMissFraction` | Miss fraction part in number.
-`kParseErrorNumberMissExponent` | Miss exponent in number.
-
-The offset of error is defined as the character number from beginning of stream. Currently RapidJSON does not keep track of line number.
-
-To get an error message, RapidJSON provided a English messages in `rapidjson/error/en.h`. User can customize it for other locales, or use a custom localization system.
-
-Here shows an example of parse error handling.
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/error/en.h"
-
-// ...
-Document d;
-if (d.Parse(json).HasParseError()) {
- fprintf(stderr, "\nError(offset %u): %s\n",
- (unsigned)d.GetErrorOffset(),
- GetParseError_En(d.GetParseError()));
- // ...
-}
-~~~~~~~~~~
-
-## In Situ Parsing {#InSituParsing}
-
-From [Wikipedia](http://en.wikipedia.org/wiki/In_situ):
-
-> *In situ* ... is a Latin phrase that translates literally to "on site" or "in position". It means "locally", "on site", "on the premises" or "in place" to describe an event where it takes place, and is used in many different contexts.
-> ...
-> (In computer science) An algorithm is said to be an in situ algorithm, or in-place algorithm, if the extra amount of memory required to execute the algorithm is O(1), that is, does not exceed a constant no matter how large the input. For example, heapsort is an in situ sorting algorithm.
-
-In normal parsing process, a large overhead is to decode JSON strings and copy them to other buffers. *In situ* parsing decodes those JSON string at the place where it is stored. It is possible in JSON because the length of decoded string is always shorter than or equal to the one in JSON. In this context, decoding a JSON string means to process the escapes, such as `"\n"`, `"\u1234"`, etc., and add a null terminator (`'\0'`)at the end of string.
-
-The following diagrams compare normal and *in situ* parsing. The JSON string values contain pointers to the decoded string.
-
-![normal parsing](diagram/normalparsing.png)
-
-In normal parsing, the decoded string are copied to freshly allocated buffers. `"\\n"` (2 characters) is decoded as `"\n"` (1 character). `"\\u0073"` (6 characters) is decoded as `"s"` (1 character).
-
-![instiu parsing](diagram/insituparsing.png)
-
-*In situ* parsing just modified the original JSON. Updated characters are highlighted in the diagram. If the JSON string does not contain escape character, such as `"msg"`, the parsing process merely replace the closing double quotation mark with a null character.
-
-Since *in situ* parsing modify the input, the parsing API needs `char*` instead of `const char*`.
-
-~~~~~~~~~~cpp
-// Read whole file into a buffer
-FILE* fp = fopen("test.json", "r");
-fseek(fp, 0, SEEK_END);
-size_t filesize = (size_t)ftell(fp);
-fseek(fp, 0, SEEK_SET);
-char* buffer = (char*)malloc(filesize + 1);
-size_t readLength = fread(buffer, 1, filesize, fp);
-buffer[readLength] = '\0';
-fclose(fp);
-
-// In situ parsing the buffer into d, buffer will also be modified
-Document d;
-d.ParseInsitu(buffer);
-
-// Query/manipulate the DOM here...
-
-free(buffer);
-// Note: At this point, d may have dangling pointers pointed to the deallocated buffer.
-~~~~~~~~~~
-
-The JSON strings are marked as const-string. But they may not be really "constant". The life cycle of it depends on the JSON buffer.
-
-In situ parsing minimizes allocation overheads and memory copying. Generally this improves cache coherence, which is an important factor of performance in modern computer.
-
-There are some limitations of *in situ* parsing:
-
-1. The whole JSON is in memory.
-2. The source encoding in stream and target encoding in document must be the same.
-3. The buffer need to be retained until the document is no longer used.
-4. If the DOM need to be used for long period after parsing, and there are few JSON strings in the DOM, retaining the buffer may be a memory waste.
-
-*In situ* parsing is mostly suitable for short-term JSON that only need to be processed once, and then be released from memory. In practice, these situation is very common, for example, deserializing JSON to C++ objects, processing web requests represented in JSON, etc.
-
-## Transcoding and Validation {#TranscodingAndValidation}
-
-RapidJSON supports conversion between Unicode formats (officially termed UCS Transformation Format) internally. During DOM parsing, the source encoding of the stream can be different from the encoding of the DOM. For example, the source stream contains a UTF-8 JSON, while the DOM is using UTF-16 encoding. There is an example code in [EncodedInputStream](doc/stream.md).
-
-When writing a JSON from DOM to output stream, transcoding can also be used. An example is in [EncodedOutputStream](doc/stream.md).
-
-During transcoding, the source string is decoded to into Unicode code points, and then the code points are encoded in the target format. During decoding, it will validate the byte sequence in the source string. If it is not a valid sequence, the parser will be stopped with `kParseErrorStringInvalidEncoding` error.
-
-When the source encoding of stream is the same as encoding of DOM, by default, the parser will *not* validate the sequence. User may use `kParseValidateEncodingFlag` to force validation.
-
-# Techniques {#Techniques}
-
-Some techniques about using DOM API is discussed here.
-
-## DOM as SAX Event Publisher
-
-In RapidJSON, stringifying a DOM with `Writer` may be look a little bit weird.
-
-~~~~~~~~~~cpp
-// ...
-Writer<StringBuffer> writer(buffer);
-d.Accept(writer);
-~~~~~~~~~~
-
-Actually, `Value::Accept()` is responsible for publishing SAX events about the value to the handler. With this design, `Value` and `Writer` are decoupled. `Value` can generate SAX events, and `Writer` can handle those events.
-
-User may create custom handlers for transforming the DOM into other formats. For example, a handler which converts the DOM into XML.
-
-For more about SAX events and handler, please refer to [SAX](doc/sax.md).
-
-## User Buffer {#UserBuffer}
-
-Some applications may try to avoid memory allocations whenever possible.
-
-`MemoryPoolAllocator` can support this by letting user to provide a buffer. The buffer can be on the program stack, or a "scratch buffer" which is statically allocated (a static/global array) for storing temporary data.
-
-`MemoryPoolAllocator` will use the user buffer to satisfy allocations. When the user buffer is used up, it will allocate a chunk of memory from the base allocator (by default the `CrtAllocator`).
-
-Here is an example of using stack memory. The first allocator is for storing values, while the second allocator is for storing temporary data during parsing.
-
-~~~~~~~~~~cpp
-typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<>> DocumentType;
-char valueBuffer[4096];
-char parseBuffer[1024];
-MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
-MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
-DocumentType d(&valueAllocator, sizeof(parseBuffer), &parseAllocator);
-d.Parse(json);
-~~~~~~~~~~
-
-If the total size of allocation is less than 4096+1024 bytes during parsing, this code does not invoke any heap allocation (via `new` or `malloc()`) at all.
-
-User can query the current memory consumption in bytes via `MemoryPoolAllocator::Size()`. And then user can determine a suitable size of user buffer.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.zh-cn.md
deleted file mode 100644
index 7a555dc1c6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/dom.zh-cn.md
+++ /dev/null
@@ -1,285 +0,0 @@
-# DOM
-
-文档对象模型(Document Object Model, DOM)是一ç§ç½äºŽå†…存中的 JSON 表示方å¼ï¼Œä»¥ä¾›æŸ¥è¯¢åŠæ“作。我们已于 [教程](doc/tutorial.zh-cn.md) 中介ç»äº† DOM 的基本用法,本节将讲述一些细节åŠé«˜çº§ç”¨æ³•ã€‚
-
-[TOC]
-
-# æ¨¡æ¿ {#Template}
-
-教程中使用了 `Value` å’Œ `Document` 类型。与 `std::string` 相似,这些类型其实是两个模æ¿ç±»çš„ `typedef`:
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericValue {
- // ...
-};
-
-template <typename Encoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericDocument : public GenericValue<Encoding, Allocator> {
- // ...
-};
-
-typedef GenericValue<UTF8<> > Value;
-typedef GenericDocument<UTF8<> > Document;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-使用者å¯ä»¥è‡ªå®šä¹‰è¿™äº›æ¨¡æ¿å‚数。
-
-## ç¼–ç  {#Encoding}
-
-`Encoding` å‚数指明在内存中的 JSON String 使用哪ç§ç¼–ç ã€‚å¯è¡Œçš„选项有 `UTF8`ã€`UTF16`ã€`UTF32`。è¦æ³¨æ„è¿™ 3 个类型其实也是模æ¿ç±»ã€‚`UTF8<>` ç­‰åŒ `UTF8<char>`,这代表它使用 `char` æ¥å­˜å‚¨å­—符串。更多细节å¯ä»¥å‚考 [ç¼–ç ](doc/encoding.zh-cn.md)。
-
-这里是一个例å­ã€‚å‡è®¾ä¸€ä¸ª Windows 应用软件希望查询存储于 JSON 中的本地化字符串。Windows ä¸­å« Unicode 的函数使用 UTF-16(宽字符)编ç ã€‚无论 JSON 文件使用哪ç§ç¼–ç ï¼Œæˆ‘们都å¯ä»¥æŠŠå­—符串以 UTF-16 å½¢å¼å­˜å‚¨åœ¨å†…存。
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-typedef GenericDocument<UTF16<> > WDocument;
-typedef GenericValue<UTF16<> > WValue;
-
-FILE* fp = fopen("localization.json", "rb"); // éž Windows å¹³å°ä½¿ç”¨ "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // 包装 bis æˆ eis
-
-WDocument d;
-d.ParseStream<0, AutoUTF<unsigned> >(eis);
-
-const WValue locale(L"ja"); // Japanese
-
-MessageBoxW(hWnd, d[locale].GetString(), L"Test", MB_OK);
-~~~~~~~~~~
-
-## 分é…器 {#Allocator}
-
-`Allocator` 定义当 `Document`/`Value` 分é…或释放内存时使用那个分é…类。`Document` 拥有或引用到一个 `Allocator` 实例。而为了节çœå†…存,`Value` 没有这么åšã€‚
-
-`GenericDocument` 的缺çœåˆ†é…器是 `MemoryPoolAllocator`。此分é…器实际上会顺åºåœ°åˆ†é…内存,并且ä¸èƒ½é€ä¸€é‡Šæ”¾ã€‚当è¦è§£æžä¸€ä¸ª JSON å¹¶ç”Ÿæˆ DOM,这ç§åˆ†é…器是éžå¸¸åˆé€‚的。
-
-RapidJSON 还æä¾›å¦ä¸€ä¸ªåˆ†é…器 `CrtAllocator`,当中 CRT 是 C è¿è¡Œåº“(C RunTime library)的缩写。此分é…器简å•åœ°è¯»ç”¨æ ‡å‡†çš„ `malloc()`/`realloc()`/`free()`。当我们需è¦è®¸å¤šå¢žå‡æ“作,这ç§åˆ†é…器会更为适åˆã€‚然而这ç§åˆ†é…器远远比 `MemoryPoolAllocator` 低效。
-
-# è§£æž {#Parsing}
-
-`Document` æ供几个解æžå‡½æ•°ã€‚以下的 (1) 是根本的函数,其他都是调用 (1) çš„å助函数。
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-// (1) 根本
-template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (2) 使用æµçš„ç¼–ç 
-template <unsigned parseFlags, typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (3) 使用缺çœæ ‡å¿—
-template <typename InputStream>
-GenericDocument& GenericDocument::ParseStream(InputStream& is);
-
-// (4) 原ä½è§£æž
-template <unsigned parseFlags>
-GenericDocument& GenericDocument::ParseInsitu(Ch* str);
-
-// (5) 原ä½è§£æžï¼Œä½¿ç”¨ç¼ºçœæ ‡å¿—
-GenericDocument& GenericDocument::ParseInsitu(Ch* str);
-
-// (6) 正常解æžä¸€ä¸ªå­—符串
-template <unsigned parseFlags, typename SourceEncoding>
-GenericDocument& GenericDocument::Parse(const Ch* str);
-
-// (7) 正常解æžä¸€ä¸ªå­—符串,使用 Document çš„ç¼–ç 
-template <unsigned parseFlags>
-GenericDocument& GenericDocument::Parse(const Ch* str);
-
-// (8) 正常解æžä¸€ä¸ªå­—符串,使用缺çœæ ‡å¿—
-GenericDocument& GenericDocument::Parse(const Ch* str);
-~~~~~~~~~~
-
-[教程](doc/tutorial.zh-cn.md) 中的例使用 (8) 去正常解æžå­—符串。而 [æµ](doc/stream.zh-cn.md) 的例å­ä½¿ç”¨å‰ 3 个函数。我们将ç¨åŽä»‹ç»åŽŸä½ï¼ˆ*In situ*) 解æžã€‚
-
-`parseFlags` 是以下ä½æ ‡ç½®çš„组åˆï¼š
-
-解æžä½æ ‡å¿— | æ„义
-------------------------------|-----------------------------------
-`kParseNoFlags` | 没有任何标志。
-`kParseDefaultFlags` | 缺çœçš„解æžé€‰é¡¹ã€‚它等于 `RAPIDJSON_PARSE_DEFAULT_FLAGS` å®ï¼Œæ­¤å®å®šä¹‰ä¸º `kParseNoFlags`。
-`kParseInsituFlag` | 原ä½ï¼ˆç ´å性)解æžã€‚
-`kParseValidateEncodingFlag` | 校验 JSON 字符串的编ç ã€‚
-`kParseIterativeFlag` | 迭代å¼ï¼ˆè°ƒç”¨å †æ ˆå¤§å°ä¸ºå¸¸æ•°å¤æ‚度)解æžã€‚
-`kParseStopWhenDoneFlag` | 当从æµè§£æžäº†ä¸€ä¸ªå®Œæ•´çš„ JSON 根节点之åŽï¼Œåœæ­¢ç»§ç»­å¤„ç†ä½™ä¸‹çš„æµã€‚当使用了此标志,解æžå™¨ä¾¿ä¸ä¼šäº§ç”Ÿ `kParseErrorDocumentRootNotSingular` 错误。å¯ä½¿ç”¨æœ¬æ ‡å¿—去解æžåŒä¸€ä¸ªæµé‡Œçš„多个 JSON。
-`kParseFullPrecisionFlag` | 使用完整的精确度去解æžæ•°å­—(较慢)。如ä¸è®¾ç½®æ­¤æ ‡èŠ‚,则会使用正常的精确度(较快)。正常精确度会有最多 3 个 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) 的误差。
-`kParseCommentsFlag` | 容许å•è¡Œ `// ...` åŠå¤šè¡Œ `/* ... */` 注释(放宽的 JSON 语法)。
-`kParseNumbersAsStringsFlag` | 把数字类型解æžæˆå­—符串。
-`kParseTrailingCommasFlag` | 容许在对象和数组结æŸå‰å«æœ‰é€—å·ï¼ˆæ”¾å®½çš„ JSON 语法)。
-`kParseNanAndInfFlag` | 容许 `NaN`ã€`Inf`ã€`Infinity`ã€`-Inf` åŠ `-Infinity` 作为 `double` 值(放宽的 JSON 语法)。
-`kParseEscapedApostropheFlag` | 容许字符串中转义å•å¼•å· `\'` (放宽的 JSON 语法)。
-
-由于使用了éžç±»åž‹æ¨¡æ¿å‚数,而ä¸æ˜¯å‡½æ•°å‚数,C++ 编译器能为个别组åˆç”Ÿæˆä»£ç ï¼Œä»¥æ”¹å–„性能åŠå‡å°‘代ç å°ºå¯¸ï¼ˆå½“åªç”¨å•ç§ç‰¹åŒ–)。缺点是需è¦åœ¨ç¼–译期决定标志。
-
-`SourceEncoding` å‚数定义æµä½¿ç”¨äº†ä»€ä¹ˆç¼–ç ã€‚这与 `Document` çš„ `Encoding` ä¸ç›¸åŒã€‚细节å¯å‚考 [转ç å’Œæ ¡éªŒ](#TranscodingAndValidation) 一节。
-
-此外 `InputStream` 是输入æµçš„类型。
-
-## 解æžé”™è¯¯ {#ParseError}
-
-当解æžè¿‡ç¨‹é¡ºåˆ©å®Œæˆï¼Œ`Document` 便会å«æœ‰è§£æžç»“果。当过程出现错误,原æ¥çš„ DOM 会*ç»´æŒä¸å˜*。å¯ä½¿ç”¨ `bool HasParseError()`ã€`ParseErrorCode GetParseError()` åŠ `size_t GetErrorOffset()` 获å–解æžçš„错误状æ€ã€‚
-
-解æžé”™è¯¯ä»£å· | æè¿°
---------------------------------------------|---------------------------------------------------
-`kParseErrorNone` | 无错误。
-`kParseErrorDocumentEmpty` | 文档是空的。
-`kParseErrorDocumentRootNotSingular` | 文档的根åŽé¢ä¸èƒ½æœ‰å…¶å®ƒå€¼ã€‚
-`kParseErrorValueInvalid` | ä¸åˆæ³•çš„值。
-`kParseErrorObjectMissName` | Object æˆå‘˜ç¼ºå°‘å字。
-`kParseErrorObjectMissColon` | Object æˆå‘˜åå­—åŽç¼ºå°‘冒å·ã€‚
-`kParseErrorObjectMissCommaOrCurlyBracket` | Object æˆå‘˜åŽç¼ºå°‘逗å·æˆ– `}`。
-`kParseErrorArrayMissCommaOrSquareBracket` | Array 元素åŽç¼ºå°‘逗å·æˆ– `]` 。
-`kParseErrorStringUnicodeEscapeInvalidHex` | String 中的 `\\u` 转义符åŽå«éžåå…­è¿›ä½æ•°å­—。
-`kParseErrorStringUnicodeSurrogateInvalid` | String 中的代ç†å¯¹ï¼ˆsurrogate pair)ä¸åˆæ³•ã€‚
-`kParseErrorStringEscapeInvalid` | String å«éžæ³•è½¬ä¹‰å­—符。
-`kParseErrorStringMissQuotationMark` | String 缺少关闭引å·ã€‚
-`kParseErrorStringInvalidEncoding` | String å«éžæ³•ç¼–ç ã€‚
-`kParseErrorNumberTooBig` | Number 的值太大,ä¸èƒ½å­˜å‚¨äºŽ `double`。
-`kParseErrorNumberMissFraction` | Number 缺少了å°æ•°éƒ¨åˆ†ã€‚
-`kParseErrorNumberMissExponent` | Number 缺少了指数。
-
-错误的å移é‡å®šä¹‰ä¸ºä»Žæµå¼€å§‹è‡³é”™è¯¯å¤„的字符数é‡ã€‚ç›®å‰ RapidJSON ä¸è®°å½•é”™è¯¯è¡Œå·ã€‚
-
-è¦å–得错误讯æ¯ï¼ŒRapidJSON 在 `rapidjson/error/en.h` 中æ供了英文错误讯æ¯ã€‚使用者å¯ä»¥ä¿®æ”¹å®ƒç”¨äºŽå…¶ä»–语言环境,或使用一个自定义的本地化系统。
-
-以下是一个处ç†é”™è¯¯çš„例å­ã€‚
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/error/en.h"
-
-// ...
-Document d;
-if (d.Parse(json).HasParseError()) {
- fprintf(stderr, "\nError(offset %u): %s\n",
- (unsigned)d.GetErrorOffset(),
- GetParseError_En(d.GetParseErrorCode()));
- // ...
-}
-~~~~~~~~~~
-
-## 原ä½è§£æž {#InSituParsing}
-
-æ ¹æ® [维基百科](http://en.wikipedia.org/wiki/In_situ):
-
-> *In situ* ... is a Latin phrase that translates literally to "on site" or "in position". It means "locally", "on site", "on the premises" or "in place" to describe an event where it takes place, and is used in many different contexts.
-> ...
-> (In computer science) An algorithm is said to be an in situ algorithm, or in-place algorithm, if the extra amount of memory required to execute the algorithm is O(1), that is, does not exceed a constant no matter how large the input. For example, heapsort is an in situ sorting algorithm.
-
-> 翻译:*In situ*……是一个拉ä¸æ–‡ç‰‡è¯­ï¼Œå­—é¢ä¸Šçš„æ„æ€æ˜¯æŒ‡ã€ŒçŽ°åœºã€ã€ã€Œåœ¨ä½ç½®ã€ã€‚在许多ä¸åŒè¯­å¢ƒä¸­ï¼Œå®ƒæ述一个事件å‘生的ä½ç½®ï¼Œæ„指「本地ã€ã€ã€ŒçŽ°åœºã€ã€ã€Œåœ¨å¤„所ã€ã€ã€Œå°±ä½ã€ã€‚
-> ……
-> (在计算机科学中)一个算法若称为原ä½ç®—法,或在ä½ç®—法,是指执行该算法所需的é¢å¤–内存空间是 O(1) 的,æ¢å¥è¯è¯´ï¼Œæ— è®ºè¾“入大å°éƒ½åªéœ€è¦å¸¸æ•°ç©ºé—´ã€‚例如,堆排åºæ˜¯ä¸€ä¸ªåŽŸä½æŽ’åºç®—法。
-
-在正常的解æžè¿‡ç¨‹ä¸­ï¼Œå¯¹ JSON string 解ç å¹¶å¤åˆ¶è‡³å…¶ä»–缓冲区是一个很大的开销。原ä½è§£æžï¼ˆ*in situ* parsing)把这些 JSON string 直接解ç äºŽå®ƒåŽŸæ¥å­˜å‚¨çš„地方。由于解ç åŽçš„ string 长度总是短于或等于原æ¥å‚¨å­˜äºŽ JSON çš„ string,所以这是å¯è¡Œçš„。在这个语境下,对 JSON string 进行解ç æ˜¯æŒ‡å¤„ç†è½¬ä¹‰ç¬¦ï¼Œå¦‚ `"\n"`ã€`"\u1234"` 等,以åŠåœ¨ string æœ«ç«¯åŠ å…¥ç©ºç»ˆæ­¢ç¬¦å· (`'\0'`)。
-
-以下的图比较正常åŠåŽŸä½è§£æžã€‚JSON string 值包å«æŒ‡å‘解ç åŽçš„字符串。
-
-![正常解æž](diagram/normalparsing.png)
-
-在正常解æžä¸­ï¼Œè§£ç åŽçš„字符串被å¤åˆ¶è‡³å…¨æ–°åˆ†é…的缓冲区中。`"\\n"`(2 个字符)被解ç æˆ `"\n"`(1 个字符)。`"\\u0073"`(6 个字符)被解ç æˆ `"s"`(1 个字符)。
-
-![原ä½è§£æž](diagram/insituparsing.png)
-
-原ä½è§£æžç›´æŽ¥ä¿®æ”¹äº†åŽŸæ¥çš„ JSON。图中高亮了被更新的字符。若 JSON string ä¸å«è½¬ä¹‰ç¬¦ï¼Œä¾‹å¦‚ `"msg"`,那么解æžè¿‡ç¨‹ä»…仅是以空字符代替结æŸåŒå¼•å·ã€‚
-
-由于原ä½è§£æžä¿®æ”¹äº†è¾“å…¥ï¼Œå…¶è§£æž API éœ€è¦ `char*` è€Œéž `const char*`。
-
-~~~~~~~~~~cpp
-// 把整个文件读入 buffer
-FILE* fp = fopen("test.json", "r");
-fseek(fp, 0, SEEK_END);
-size_t filesize = (size_t)ftell(fp);
-fseek(fp, 0, SEEK_SET);
-char* buffer = (char*)malloc(filesize + 1);
-size_t readLength = fread(buffer, 1, filesize, fp);
-buffer[readLength] = '\0';
-fclose(fp);
-
-// 原ä½è§£æž buffer 至 d,buffer 内容会被修改。
-Document d;
-d.ParseInsitu(buffer);
-
-// 在此查询ã€ä¿®æ”¹ DOM……
-
-free(buffer);
-// 注æ„:在这个ä½ç½®ï¼Œd å¯èƒ½å«æœ‰æŒ‡å‘已被释放的 buffer 的悬空指针
-~~~~~~~~~~
-
-JSON string 会被打上 const-string 的标志。但它们å¯èƒ½å¹¶éžçœŸæ­£çš„「常数ã€ã€‚它的生命周期å–决于存储 JSON 的缓冲区。
-
-原ä½è§£æžæŠŠåˆ†é…开销åŠå†…å­˜å¤åˆ¶å‡è‡³æœ€å°ã€‚通常这样åšèƒ½æ”¹å–„缓存一致性,而这对现代计算机æ¥è¯´æ˜¯ä¸€ä¸ªé‡è¦çš„性能因素。
-
-原ä½è§£æžæœ‰ä»¥ä¸‹é™åˆ¶ï¼š
-
-1. 整个 JSON 须存储在内存之中。
-2. æµçš„æ¥æºç¼“ç ä¸Žæ–‡æ¡£çš„目标编ç å¿…须相åŒã€‚
-3. 需è¦ä¿ç•™ç¼“冲区,直至文档ä¸å†è¢«ä½¿ç”¨ã€‚
-4. è‹¥ DOM 需è¦åœ¨è§£æžåŽè¢«é•¿æœŸä½¿ç”¨ï¼Œè€Œ DOM 内åªæœ‰å¾ˆå°‘ JSON string,ä¿ç•™ç¼“冲区å¯èƒ½é€ æˆå†…存浪费。
-
-原ä½è§£æžæœ€é€‚åˆç”¨äºŽçŸ­æœŸçš„ã€ç”¨å®Œå³å¼ƒçš„ JSON。实际应用中,这些场åˆæ˜¯éžå¸¸æ™®é的,例如ååºåˆ—化 JSON 至 C++ 对象ã€å¤„ç†ä»¥ JSON 表示的 web 请求等。
-
-## 转ç ä¸Žæ ¡éªŒ {#TranscodingAndValidation}
-
-RapidJSON 内部支æŒä¸åŒ Unicode æ ¼å¼ï¼ˆæ­£å¼çš„术语是 UCS å˜æ¢æ ¼å¼ï¼‰é—´çš„转æ¢ã€‚在 DOM 解æžæ—¶ï¼Œæµçš„æ¥æºç¼–ç ä¸Ž DOM çš„ç¼–ç å¯ä»¥ä¸åŒã€‚例如,æ¥æºæµå¯èƒ½å«æœ‰ UTF-8 çš„ JSON,而 DOM 则使用 UTF-16 ç¼–ç ã€‚在 [EncodedInputStream](doc/stream.zh-cn.md) 一节里有一个例å­ã€‚
-
-当从 DOM 输出一个 JSON 至输出æµä¹‹æ—¶ï¼Œä¹Ÿå¯ä»¥ä½¿ç”¨è½¬ç åŠŸèƒ½ã€‚在 [EncodedOutputStream](doc/stream.zh-cn.md) 一节里有一个例å­ã€‚
-
-在转ç è¿‡ç¨‹ä¸­ï¼Œä¼šæŠŠæ¥æº string 解ç æˆ Unicode ç ç‚¹ï¼Œç„¶åŽæŠŠç ç‚¹ç¼–ç æˆç›®æ ‡æ ¼å¼ã€‚在解ç æ—¶ï¼Œå®ƒä¼šæ ¡éªŒæ¥æº string 的字节åºåˆ—是å¦åˆæ³•ã€‚è‹¥é‡ä¸Šéžåˆæ³•åºåˆ—,解æžå™¨ä¼šåœæ­¢å¹¶è¿”回 `kParseErrorStringInvalidEncoding` 错误。
-
-当æ¥æºç¼–ç ä¸Ž DOM çš„ç¼–ç ç›¸åŒï¼Œè§£æžå™¨ç¼ºçœåœ° * ä¸ä¼š * 校验åºåˆ—。使用者å¯å¼€å¯ `kParseValidateEncodingFlag` 去强制校验。
-
-# 技巧 {#Techniques}
-
-这里讨论一些 DOM API 的使用技巧。
-
-## 把 DOM 作为 SAX 事件å‘表者
-
-在 RapidJSON 中,利用 `Writer` 把 DOM ç”Ÿæˆ JSON çš„åšæ³•ï¼Œçœ‹æ¥æœ‰ç‚¹å¥‡æ€ªã€‚
-
-~~~~~~~~~~cpp
-// ...
-Writer<StringBuffer> writer(buffer);
-d.Accept(writer);
-~~~~~~~~~~
-
-实际上,`Value::Accept()` 是负责å‘布该值相关的 SAX 事件至处ç†å™¨çš„。通过这个设计,`Value` åŠ `Writer` 解除了å¶åˆã€‚`Value` å¯ç”Ÿæˆ SAX 事件,而 `Writer` 则å¯ä»¥å¤„ç†è¿™äº›äº‹ä»¶ã€‚
-
-使用者å¯ä»¥åˆ›å»ºè‡ªå®šä¹‰çš„处ç†å™¨ï¼ŒåŽ»æŠŠ DOM 转æ¢æˆå…¶å®ƒæ ¼å¼ã€‚例如,一个把 DOM 转æ¢æˆ XML 的处ç†å™¨ã€‚
-
-è¦çŸ¥é“更多关于 SAX 事件与处ç†å™¨ï¼Œå¯å‚阅 [SAX](doc/sax.zh-cn.md)。
-
-## 使用者缓冲区 {#UserBuffer}
-
-许多应用软件å¯èƒ½éœ€è¦å°½é‡å‡å°‘内存分é…。
-
-`MemoryPoolAllocator` å¯ä»¥å¸®åŠ©è¿™æ–¹é¢ï¼Œå®ƒå®¹è®¸ä½¿ç”¨è€…æ供一个缓冲区。该缓冲区å¯èƒ½ç½®äºŽç¨‹åºå †æ ˆï¼Œæˆ–是一个é™æ€åˆ†é…的「è‰ç¨¿ç¼“冲区(scratch buffer)ã€ï¼ˆä¸€ä¸ªé™æ€ï¼å…¨å±€çš„数组),用于储存临时数æ®ã€‚
-
-`MemoryPoolAllocator` 会先用使用者缓冲区去解决分é…请求。当使用者缓冲区用完,就会从基础分é…器(缺çœä¸º `CrtAllocator`)分é…一å—内存。
-
-以下是使用堆栈内存的例å­ï¼Œç¬¬ä¸€ä¸ªåˆ†é…器用于存储值,第二个用于解æžæ—¶çš„临时缓冲。
-
-~~~~~~~~~~cpp
-typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<>> DocumentType;
-char valueBuffer[4096];
-char parseBuffer[1024];
-MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
-MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
-DocumentType d(&valueAllocator, sizeof(parseBuffer), &parseAllocator);
-d.Parse(json);
-~~~~~~~~~~
-
-若解æžæ—¶åˆ†é…总é‡å°‘于 4096+1024 字节时,这段代ç ä¸ä¼šé€ æˆä»»ä½•å †å†…存分é…ï¼ˆç» `new` 或 `malloc()`)。
-
-使用者å¯ä»¥é€šè¿‡ `MemoryPoolAllocator::Size()` 查询当å‰å·²åˆ†çš„内存大å°ã€‚那么使用者å¯ä»¥æ‹Ÿå®šä½¿ç”¨è€…缓冲区的åˆé€‚大å°ã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.md
deleted file mode 100644
index e663aeac97..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.md
+++ /dev/null
@@ -1,146 +0,0 @@
-# Encoding
-
-According to [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf),
-
-> (in Introduction) JSON text is a sequence of Unicode code points.
-
-The earlier [RFC4627](http://www.ietf.org/rfc/rfc4627.txt) stated that,
-
-> (in §3) JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
-
-> (in §6) JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible. When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.
-
-RapidJSON supports various encodings. It can also validate the encodings of JSON, and transcoding JSON among encodings. All these features are implemented internally, without the need for external libraries (e.g. [ICU](http://site.icu-project.org/)).
-
-[TOC]
-
-# Unicode {#Unicode}
-From [Unicode's official website](http://www.unicode.org/standard/WhatIsUnicode.html):
-> Unicode provides a unique number for every character,
-> no matter what the platform,
-> no matter what the program,
-> no matter what the language.
-
-Those unique numbers are called code points, which is in the range `0x0` to `0x10FFFF`.
-
-## Unicode Transformation Format {#UTF}
-
-There are various encodings for storing Unicode code points. These are called Unicode Transformation Format (UTF). RapidJSON supports the most commonly used UTFs, including
-
-* UTF-8: 8-bit variable-width encoding. It maps a code point to 1–4 bytes.
-* UTF-16: 16-bit variable-width encoding. It maps a code point to 1–2 16-bit code units (i.e., 2–4 bytes).
-* UTF-32: 32-bit fixed-width encoding. It directly maps a code point to a single 32-bit code unit (i.e. 4 bytes).
-
-For UTF-16 and UTF-32, the byte order (endianness) does matter. Within computer memory, they are often stored in the computer's endianness. However, when it is stored in file or transferred over network, we need to state the byte order of the byte sequence, either little-endian (LE) or big-endian (BE).
-
-RapidJSON provide these encodings via the structs in `rapidjson/encodings.h`:
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template<typename CharType = char>
-struct UTF8;
-
-template<typename CharType = wchar_t>
-struct UTF16;
-
-template<typename CharType = wchar_t>
-struct UTF16LE;
-
-template<typename CharType = wchar_t>
-struct UTF16BE;
-
-template<typename CharType = unsigned>
-struct UTF32;
-
-template<typename CharType = unsigned>
-struct UTF32LE;
-
-template<typename CharType = unsigned>
-struct UTF32BE;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-For processing text in memory, we normally use `UTF8`, `UTF16` or `UTF32`. For processing text via I/O, we may use `UTF8`, `UTF16LE`, `UTF16BE`, `UTF32LE` or `UTF32BE`.
-
-When using the DOM-style API, the `Encoding` template parameter in `GenericValue<Encoding>` and `GenericDocument<Encoding>` indicates the encoding to be used to represent JSON string in memory. So normally we will use `UTF8`, `UTF16` or `UTF32` for this template parameter. The choice depends on operating systems and other libraries that the application is using. For example, Windows API represents Unicode characters in UTF-16, while most Linux distributions and applications prefer UTF-8.
-
-Example of UTF-16 DOM declaration:
-
-~~~~~~~~~~cpp
-typedef GenericDocument<UTF16<> > WDocument;
-typedef GenericValue<UTF16<> > WValue;
-~~~~~~~~~~
-
-For a detail example, please check the example in [DOM's Encoding](doc/stream.md) section.
-
-## Character Type {#CharacterType}
-
-As shown in the declaration, each encoding has a `CharType` template parameter. Actually, it may be a little bit confusing, but each `CharType` stores a code unit, not a character (code point). As mentioned in previous section, a code point may be encoded to 1–4 code units for UTF-8.
-
-For `UTF16(LE|BE)`, `UTF32(LE|BE)`, the `CharType` must be integer type of at least 2 and 4 bytes respectively.
-
-Note that C++11 introduces `char16_t` and `char32_t`, which can be used for `UTF16` and `UTF32` respectively.
-
-## AutoUTF {#AutoUTF}
-
-Previous encodings are statically bound in compile-time. In other words, user must know exactly which encodings will be used in the memory or streams. However, sometimes we may need to read/write files of different encodings. The encoding needed to be decided in runtime.
-
-`AutoUTF` is an encoding designed for this purpose. It chooses which encoding to be used according to the input or output stream. Currently, it should be used with `EncodedInputStream` and `EncodedOutputStream`.
-
-## ASCII {#ASCII}
-
-Although the JSON standards did not mention about [ASCII](http://en.wikipedia.org/wiki/ASCII), sometimes we would like to write 7-bit ASCII JSON for applications that cannot handle UTF-8. Since any JSON can represent unicode characters in escaped sequence `\uXXXX`, JSON can always be encoded in ASCII.
-
-Here is an example for writing a UTF-8 DOM into ASCII:
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-Document d; // UTF8<>
-// ...
-StringBuffer buffer;
-Writer<StringBuffer, Document::EncodingType, ASCII<> > writer(buffer);
-d.Accept(writer);
-std::cout << buffer.GetString();
-~~~~~~~~~~
-
-ASCII can be used in input stream. If the input stream contains bytes with values above 127, it will cause `kParseErrorStringInvalidEncoding` error.
-
-ASCII *cannot* be used in memory (encoding of `Document` or target encoding of `Reader`), as it cannot represent Unicode code points.
-
-# Validation & Transcoding {#ValidationTranscoding}
-
-When RapidJSON parses a JSON, it can validate the input JSON, whether it is a valid sequence of a specified encoding. This option can be turned on by adding `kParseValidateEncodingFlag` in `parseFlags` template parameter.
-
-If the input encoding and output encoding is different, `Reader` and `Writer` will automatically transcode (convert) the text. In this case, `kParseValidateEncodingFlag` is not necessary, as it must decode the input sequence. And if the sequence was unable to be decoded, it must be invalid.
-
-## Transcoder {#Transcoder}
-
-Although the encoding functions in RapidJSON are designed for JSON parsing/generation, user may abuse them for transcoding of non-JSON strings.
-
-Here is an example for transcoding a string from UTF-8 to UTF-16:
-
-~~~~~~~~~~cpp
-#include "rapidjson/encodings.h"
-
-using namespace rapidjson;
-
-const char* s = "..."; // UTF-8 string
-StringStream source(s);
-GenericStringBuffer<UTF16<> > target;
-
-bool hasError = false;
-while (source.Peek() != '\0')
- if (!Transcoder<UTF8<>, UTF16<> >::Transcode(source, target)) {
- hasError = true;
- break;
- }
-
-if (!hasError) {
- const wchar_t* t = target.GetString();
- // ...
-}
-~~~~~~~~~~
-
-You may also use `AutoUTF` and the associated streams for setting source/target encoding in runtime.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.zh-cn.md
deleted file mode 100644
index 808ba525f6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/encoding.zh-cn.md
+++ /dev/null
@@ -1,152 +0,0 @@
-# ç¼–ç 
-
-æ ¹æ® [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf):
-
-> (in Introduction) JSON text is a sequence of Unicode code points.
->
-> 翻译:JSON 文本是 Unicode ç ç‚¹çš„åºåˆ—。
-
-较早的 [RFC4627](http://www.ietf.org/rfc/rfc4627.txt) 申明:
-
-> (in §3) JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
->
-> 翻译:JSON 文本应该以 Unicode ç¼–ç ã€‚缺çœçš„ç¼–ç ä¸º UTF-8。
-
-> (in §6) JSON may be represented using UTF-8, UTF-16, or UTF-32. When JSON is written in UTF-8, JSON is 8bit compatible. When JSON is written in UTF-16 or UTF-32, the binary content-transfer-encoding must be used.
->
-> 翻译:JSON å¯ä½¿ç”¨ UTF-8ã€UTF-16 或 UTF-32 表示。当 JSON 以 UTF-8 写入,该 JSON 是 8 ä½å…¼å®¹çš„。当 JSON 以 UTF-16 或 UTF-32 写入,就必须使用二进制的内容传é€ç¼–ç ã€‚
-
-RapidJSON 支æŒå¤šç§ç¼–ç ã€‚它也能检查 JSON çš„ç¼–ç ï¼Œä»¥åŠåœ¨ä¸åŒç¼–ç ä¸­è¿›è¡Œè½¬ç ã€‚所有这些功能都是在内部实现,无需使用外部的程åºåº“(如 [ICU](http://site.icu-project.org/))。
-
-[TOC]
-
-# Unicode {#Unicode}
-æ ¹æ® [Unicode 的官方网站](http://www.unicode.org/standard/translations/t-chinese.html):
->Unicode ç»™æ¯ä¸ªå­—符æ供了一个唯一的数字,
-ä¸è®ºæ˜¯ä»€ä¹ˆå¹³å°ã€
-ä¸è®ºæ˜¯ä»€ä¹ˆç¨‹åºã€
-ä¸è®ºæ˜¯ä»€ä¹ˆè¯­è¨€ã€‚
-
-这些唯一数字称为ç ç‚¹ï¼ˆcode point),其范围介乎 `0x0` 至 `0x10FFFF` 之间。
-
-## Unicode 转æ¢æ ¼å¼ {#UTF}
-
-存储 Unicode ç ç‚¹æœ‰å¤šç§ç¼–ç æ–¹å¼ã€‚这些称为 Unicode 转æ¢æ ¼å¼ï¼ˆUnicode Transformation Format, UTF)。RapidJSON 支æŒæœ€å¸¸ç”¨çš„ UTF,包括:
-
-* UTF-8:8 ä½å¯å˜é•¿åº¦ç¼–ç ã€‚它把一个ç ç‚¹æ˜ å°„至 1 至 4 个字节。
-* UTF-16:16 ä½å¯å˜é•¿åº¦ç¼–ç ã€‚它把一个ç ç‚¹æ˜ å°„至 1 至 2 个 16 ä½ç¼–ç å•å…ƒï¼ˆå³ 2 至 4 个字节)。
-* UTF-32:32 ä½å›ºå®šé•¿åº¦ç¼–ç ã€‚它直接把ç ç‚¹æ˜ å°„至å•ä¸ª 32 ä½ç¼–ç å•å…ƒï¼ˆå³ 4 字节)。
-
-对于 UTF-16 åŠ UTF-32 æ¥è¯´ï¼Œå­—节åºï¼ˆendianness)是有影å“的。在内存中,它们通常都是以该计算机的字节åºæ¥å­˜å‚¨ã€‚然而,当è¦å‚¨å­˜åœ¨æ–‡ä»¶ä¸­æˆ–在网上传输,我们需è¦æŒ‡æ˜Žå­—节åºåˆ—的字节åºï¼Œæ˜¯å°ç«¯ï¼ˆlittle endian, LE)还是大端(big-endian, BE)。
-
-RapidJSON 通过 `rapidjson/encodings.h` 中的 struct 去æä¾›å„ç§ç¼–ç ï¼š
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template<typename CharType = char>
-struct UTF8;
-
-template<typename CharType = wchar_t>
-struct UTF16;
-
-template<typename CharType = wchar_t>
-struct UTF16LE;
-
-template<typename CharType = wchar_t>
-struct UTF16BE;
-
-template<typename CharType = unsigned>
-struct UTF32;
-
-template<typename CharType = unsigned>
-struct UTF32LE;
-
-template<typename CharType = unsigned>
-struct UTF32BE;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-对于在内存中的文本,我们正常会使用 `UTF8`ã€`UTF16` 或 `UTF32`。对于处ç†ç»è¿‡ I/O 的文本,我们å¯ä½¿ç”¨ `UTF8`ã€`UTF16LE`ã€`UTF16BE`ã€`UTF32LE` 或 `UTF32BE`。
-
-当使用 DOM 风格的 API,`GenericValue<Encoding>` åŠ `GenericDocument<Encoding>` 里的 `Encoding` 模æ¿å‚数是用于指明内存中存储的 JSON 字符串使用哪ç§ç¼–ç ã€‚因此通常我们会在此å‚数中使用 `UTF8`ã€`UTF16` 或 `UTF32`。如何选择,视乎应用软件所使用的æ“作系统åŠå…¶ä»–程åºåº“。例如,Windows API 使用 UTF-16 表示 Unicode 字符,而多数的 Linux å‘行版本åŠåº”用软件则更喜欢 UTF-8。
-
-使用 UTF-16 çš„ DOM 声明例å­ï¼š
-
-~~~~~~~~~~cpp
-typedef GenericDocument<UTF16<> > WDocument;
-typedef GenericValue<UTF16<> > WValue;
-~~~~~~~~~~
-
-å¯ä»¥åœ¨ [DOM's Encoding](doc/stream.zh-cn.md) 一节看到更详细的使用例å­ã€‚
-
-## 字符类型 {#CharacterType}
-
-从之å‰çš„声明中å¯ä»¥çœ‹åˆ°ï¼Œæ¯ä¸ªç¼–ç éƒ½æœ‰ä¸€ä¸ª `CharType` 模æ¿å‚数。这å¯èƒ½æ¯”较容易混淆,实际上,æ¯ä¸ª `CharType` 存储一个编ç å•å…ƒï¼Œè€Œä¸æ˜¯ä¸€ä¸ªå­—符(ç ç‚¹ï¼‰ã€‚如之å‰æ‰€è°ˆåŠï¼Œåœ¨ UTF-8 中一个ç ç‚¹å¯èƒ½ä¼šç¼–ç æˆ 1 至 4 个编ç å•å…ƒã€‚
-
-对于 `UTF16(LE|BE)` åŠ `UTF32(LE|BE)` æ¥è¯´ï¼Œ`CharType` 必须分别是一个至少 2 åŠ 4 字节的整数类型。
-
-æ³¨æ„ C++11 新添了 `char16_t` åŠ `char32_t` 类型,也å¯åˆ†åˆ«ç”¨äºŽ `UTF16` åŠ `UTF32`。
-
-## AutoUTF {#AutoUTF}
-
-上述所介ç»çš„ç¼–ç éƒ½æ˜¯åœ¨ç¼–译期é™æ€æŒ·å®šçš„。æ¢å¥è¯è¯´ï¼Œä½¿ç”¨è€…必须知é“内存或æµä¹‹ä¸­ä½¿ç”¨äº†å“ªç§ç¼–ç ã€‚然而,有时候我们å¯èƒ½éœ€è¦è¯»å†™ä¸åŒç¼–ç çš„文件,而且这些编ç éœ€è¦åœ¨è¿è¡Œæ—¶æ‰èƒ½å†³å®šã€‚
-
-`AutoUTF` 是为此而设计的编ç ã€‚它根æ®è¾“入或输出æµæ¥é€‰æ‹©ä½¿ç”¨å“ªç§ç¼–ç ã€‚ç›®å‰å®ƒåº”该与 `EncodedInputStream` åŠ `EncodedOutputStream` 结åˆä½¿ç”¨ã€‚
-
-## ASCII {#ASCII}
-
-虽然 JSON 标准并未æåŠ [ASCII](http://en.wikipedia.org/wiki/ASCII),有时候我们希望写入 7 ä½çš„ ASCII JSONï¼Œä»¥ä¾›æœªèƒ½å¤„ç† UTF-8 的应用程åºä½¿ç”¨ã€‚由于任 JSON 都å¯ä»¥æŠŠ Unicode 字符表示为 `\uXXXX` 转义åºåˆ—,JSON 总是å¯ç”¨ ASCII æ¥ç¼–ç ã€‚
-
-以下的例å­æŠŠ UTF-8 çš„ DOM å†™æˆ ASCII çš„ JSON:
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-Document d; // UTF8<>
-// ...
-StringBuffer buffer;
-Writer<StringBuffer, Document::EncodingType, ASCII<> > writer(buffer);
-d.Accept(writer);
-std::cout << buffer.GetString();
-~~~~~~~~~~
-
-ASCII å¯ç”¨äºŽè¾“å…¥æµã€‚当输入æµåŒ…å«å¤§äºŽ 127 的字节,就会导致 `kParseErrorStringInvalidEncoding` 错误。
-
-ASCII * ä¸èƒ½ * 用于内存(`Document` çš„ç¼–ç ï¼Œæˆ– `Reader` 的目标编ç ),因为它ä¸èƒ½è¡¨ç¤º Unicode ç ç‚¹ã€‚
-
-# 校验åŠè½¬ç  {#ValidationTranscoding}
-
-当 RapidJSON 解æžä¸€ä¸ª JSON 时,它能校验输入 JSON,判断它是å¦æ‰€æ ‡æ˜Žç¼–ç çš„åˆæ³•åºåˆ—。è¦å¼€å¯æ­¤é€‰é¡¹ï¼Œè¯·æŠŠ `kParseValidateEncodingFlag` 加入 `parseFlags` 模æ¿å‚数。
-
-若输入编ç å’Œè¾“出编ç å¹¶ä¸ç›¸åŒï¼Œ`Reader` åŠ `Writer` 会算把文本转ç ã€‚在这ç§æƒ…况下,并ä¸éœ€è¦ `kParseValidateEncodingFlag`,因为它必须解ç è¾“å…¥åºåˆ—。若åºåˆ—ä¸èƒ½è¢«è§£ç ï¼Œå®ƒå¿…然是ä¸åˆæ³•çš„。
-
-## 转ç å™¨ {#Transcoder}
-
-虽然 RapidJSON çš„ç¼–ç åŠŸèƒ½æ˜¯ä¸º JSON 解æžï¼ç”Ÿæˆè€Œè®¾è®¡ï¼Œä½¿ç”¨è€…也å¯ä»¥â€œæ»¥ç”¨â€å®ƒä»¬æ¥ä¸ºéž JSON 字符串转ç ã€‚
-
-以下的例å­æŠŠ UTF-8 字符串转ç æˆ UTF-16:
-
-~~~~~~~~~~cpp
-#include "rapidjson/encodings.h"
-
-using namespace rapidjson;
-
-const char* s = "..."; // UTF-8 string
-StringStream source(s);
-GenericStringBuffer<UTF16<> > target;
-
-bool hasError = false;
-while (source.Peek() != '\0')
- if (!Transcoder<UTF8<>, UTF16<> >::Transcode(source, target)) {
- hasError = true;
- break;
- }
-
-if (!hasError) {
- const wchar_t* t = target.GetString();
- // ...
-}
-~~~~~~~~~~
-
-你也å¯ä»¥ç”¨ `AutoUTF` åŠå¯¹åº”çš„æµæ¥åœ¨è¿è¡Œæ—¶è®¾ç½®å†…æºï¼ç›®çš„之编ç ã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.md
deleted file mode 100644
index 55fa2af880..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.md
+++ /dev/null
@@ -1,289 +0,0 @@
-# FAQ
-
-[TOC]
-
-## General
-
-1. What is RapidJSON?
-
- RapidJSON is a C++ library for parsing and generating JSON. You may check all [features](doc/features.md) of it.
-
-2. Why is RapidJSON named so?
-
- It is inspired by [RapidXML](http://rapidxml.sourceforge.net/), which is a fast XML DOM parser.
-
-3. Is RapidJSON similar to RapidXML?
-
- RapidJSON borrowed some designs of RapidXML, including *in situ* parsing, header-only library. But the two APIs are completely different. Also RapidJSON provide many features that are not in RapidXML.
-
-4. Is RapidJSON free?
-
- Yes, it is free under MIT license. It can be used in commercial applications. Please check the details in [license.txt](https://github.com/Tencent/rapidjson/blob/master/license.txt).
-
-5. Is RapidJSON small? What are its dependencies?
-
- Yes. A simple executable which parses a JSON and prints its statistics is less than 30KB on Windows.
-
- RapidJSON depends on C++ standard library only.
-
-6. How to install RapidJSON?
-
- Check [Installation section](https://miloyip.github.io/rapidjson/).
-
-7. Can RapidJSON run on my platform?
-
- RapidJSON has been tested in many combinations of operating systems, compilers and CPU architecture by the community. But we cannot ensure that it can be run on your particular platform. Building and running the unit test suite will give you the answer.
-
-8. Does RapidJSON support C++03? C++11?
-
- RapidJSON was firstly implemented for C++03. Later it added optional support of some C++11 features (e.g., move constructor, `noexcept`). RapidJSON shall be compatible with C++03 or C++11 compliant compilers.
-
-9. Does RapidJSON really work in real applications?
-
- Yes. It is deployed in both client and server real applications. A community member reported that RapidJSON in their system parses 50 million JSONs daily.
-
-10. How RapidJSON is tested?
-
- RapidJSON contains a unit test suite for automatic testing. [Travis](https://travis-ci.org/Tencent/rapidjson/)(for Linux) and [AppVeyor](https://ci.appveyor.com/project/Tencent/rapidjson/)(for Windows) will compile and run the unit test suite for all modifications. The test process also uses Valgrind (in Linux) to detect memory leaks.
-
-11. Is RapidJSON well documented?
-
- RapidJSON provides user guide and API documentationn.
-
-12. Are there alternatives?
-
- Yes, there are a lot alternatives. For example, [nativejson-benchmark](https://github.com/miloyip/nativejson-benchmark) has a listing of open-source C/C++ JSON libraries. [json.org](http://www.json.org/) also has a list.
-
-## JSON
-
-1. What is JSON?
-
- JSON (JavaScript Object Notation) is a lightweight data-interchange format. It uses human readable text format. More details of JSON can be referred to [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) and [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm).
-
-2. What are applications of JSON?
-
- JSON are commonly used in web applications for transferring structured data. It is also used as a file format for data persistence.
-
-3. Does RapidJSON conform to the JSON standard?
-
- Yes. RapidJSON is fully compliance with [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) and [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm). It can handle corner cases, such as supporting null character and surrogate pairs in JSON strings.
-
-4. Does RapidJSON support relaxed syntax?
-
- Currently no. RapidJSON only support the strict standardized format. Support on related syntax is under discussion in this [issue](https://github.com/Tencent/rapidjson/issues/36).
-
-## DOM and SAX
-
-1. What is DOM style API?
-
- Document Object Model (DOM) is an in-memory representation of JSON for query and manipulation.
-
-2. What is SAX style API?
-
- SAX is an event-driven API for parsing and generation.
-
-3. Should I choose DOM or SAX?
-
- DOM is easy for query and manipulation. SAX is very fast and memory-saving but often more difficult to be applied.
-
-4. What is *in situ* parsing?
-
- *in situ* parsing decodes the JSON strings directly into the input JSON. This is an optimization which can reduce memory consumption and improve performance, but the input JSON will be modified. Check [in-situ parsing](doc/dom.md) for details.
-
-5. When does parsing generate an error?
-
- The parser generates an error when the input JSON contains invalid syntax, or a value can not be represented (a number is too big), or the handler of parsers terminate the parsing. Check [parse error](doc/dom.md) for details.
-
-6. What error information is provided?
-
- The error is stored in `ParseResult`, which includes the error code and offset (number of characters from the beginning of JSON). The error code can be translated into human-readable error message.
-
-7. Why not just using `double` to represent JSON number?
-
- Some applications use 64-bit unsigned/signed integers. And these integers cannot be converted into `double` without loss of precision. So the parsers detects whether a JSON number is convertible to different types of integers and/or `double`.
-
-8. How to clear-and-minimize a document or value?
-
- Call one of the `SetXXX()` methods - they call destructor which deallocates DOM data:
-
- ~~~~~~~~~~cpp
- Document d;
- ...
- d.SetObject(); // clear and minimize
- ~~~~~~~~~~
-
- Alternatively, use equivalent of the [C++ swap with temporary idiom](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Clear-and-minimize):
- ~~~~~~~~~~cpp
- Value(kObjectType).Swap(d);
- ~~~~~~~~~~
- or equivalent, but slightly longer to type:
- ~~~~~~~~~~cpp
- d.Swap(Value(kObjectType).Move());
- ~~~~~~~~~~
-
-9. How to insert a document node into another document?
-
- Let's take the following two DOM trees represented as JSON documents:
- ~~~~~~~~~~cpp
- Document person;
- person.Parse("{\"person\":{\"name\":{\"first\":\"Adam\",\"last\":\"Thomas\"}}}");
-
- Document address;
- address.Parse("{\"address\":{\"city\":\"Moscow\",\"street\":\"Quiet\"}}");
- ~~~~~~~~~~
- Let's assume we want to merge them in such way that the whole `address` document becomes a node of the `person`:
- ~~~~~~~~~~js
- { "person": {
- "name": { "first": "Adam", "last": "Thomas" },
- "address": { "city": "Moscow", "street": "Quiet" }
- }
- }
- ~~~~~~~~~~
-
- The most important requirement to take care of document and value life-cycle as well as consistent memory management using the right allocator during the value transfer.
-
- Simple yet most efficient way to achieve that is to modify the `address` definition above to initialize it with allocator of the `person` document, then we just add the root member of the value:
- ~~~~~~~~~~cpp
- Document address(&person.GetAllocator());
- ...
- person["person"].AddMember("address", address["address"], person.GetAllocator());
- ~~~~~~~~~~
-Alternatively, if we don't want to explicitly refer to the root value of `address` by name, we can refer to it via iterator:
- ~~~~~~~~~~cpp
- auto addressRoot = address.MemberBegin();
- person["person"].AddMember(addressRoot->name, addressRoot->value, person.GetAllocator());
- ~~~~~~~~~~
-
- Second way is to deep-clone the value from the address document:
- ~~~~~~~~~~cpp
- Value addressValue = Value(address["address"], person.GetAllocator());
- person["person"].AddMember("address", addressValue, person.GetAllocator());
- ~~~~~~~~~~
-
-## Document/Value (DOM)
-
-1. What is move semantics? Why?
-
- Instead of copy semantics, move semantics is used in `Value`. That means, when assigning a source value to a target value, the ownership of source value is moved to the target value.
-
- Since moving is faster than copying, this design decision forces user to aware of the copying overhead.
-
-2. How to copy a value?
-
- There are two APIs: constructor with allocator, and `CopyFrom()`. See [Deep Copy Value](doc/tutorial.md) for an example.
-
-3. Why do I need to provide the length of string?
-
- Since C string is null-terminated, the length of string needs to be computed via `strlen()`, with linear runtime complexity. This incurs an unnecessary overhead of many operations, if the user already knows the length of string.
-
- Also, RapidJSON can handle `\u0000` (null character) within a string. If a string contains null characters, `strlen()` cannot return the true length of it. In such case user must provide the length of string explicitly.
-
-4. Why do I need to provide allocator parameter in many DOM manipulation API?
-
- Since the APIs are member functions of `Value`, we do not want to save an allocator pointer in every `Value`.
-
-5. Does it convert between numerical types?
-
- When using `GetInt()`, `GetUint()`, ... conversion may occur. For integer-to-integer conversion, it only convert when it is safe (otherwise it will assert). However, when converting a 64-bit signed/unsigned integer to double, it will convert but be aware that it may lose precision. A number with fraction, or an integer larger than 64-bit, can only be obtained by `GetDouble()`.
-
-## Reader/Writer (SAX)
-
-1. Why don't we just `printf` a JSON? Why do we need a `Writer`?
-
- Most importantly, `Writer` will ensure the output JSON is well-formed. Calling SAX events incorrectly (e.g. `StartObject()` pairing with `EndArray()`) will assert. Besides, `Writer` will escapes strings (e.g., `\n`). Finally, the numeric output of `printf()` may not be a valid JSON number, especially in some locale with digit delimiters. And the number-to-string conversion in `Writer` is implemented with very fast algorithms, which outperforms than `printf()` or `iostream`.
-
-2. Can I pause the parsing process and resume it later?
-
- This is not directly supported in the current version due to performance consideration. However, if the execution environment supports multi-threading, user can parse a JSON in a separate thread, and pause it by blocking in the input stream.
-
-## Unicode
-
-1. Does it support UTF-8, UTF-16 and other format?
-
- Yes. It fully support UTF-8, UTF-16 (LE/BE), UTF-32 (LE/BE) and ASCII.
-
-2. Can it validate the encoding?
-
- Yes, just pass `kParseValidateEncodingFlag` to `Parse()`. If there is invalid encoding in the stream, it will generate `kParseErrorStringInvalidEncoding` error.
-
-3. What is surrogate pair? Does RapidJSON support it?
-
- JSON uses UTF-16 encoding when escaping unicode character, e.g. `\u5927` representing Chinese character "big". To handle characters other than those in basic multilingual plane (BMP), UTF-16 encodes those characters with two 16-bit values, which is called UTF-16 surrogate pair. For example, the Emoji character U+1F602 can be encoded as `\uD83D\uDE02` in JSON.
-
- RapidJSON fully support parsing/generating UTF-16 surrogates.
-
-4. Can it handle `\u0000` (null character) in JSON string?
-
- Yes. RapidJSON fully support null character in JSON string. However, user need to be aware of it and using `GetStringLength()` and related APIs to obtain the true length of string.
-
-5. Can I output `\uxxxx` for all non-ASCII character?
-
- Yes, use `ASCII<>` as output encoding template parameter in `Writer` can enforce escaping those characters.
-
-## Stream
-
-1. I have a big JSON file. Should I load the whole file to memory?
-
- User can use `FileReadStream` to read the file chunk-by-chunk. But for *in situ* parsing, the whole file must be loaded.
-
-2. Can I parse JSON while it is streamed from network?
-
- Yes. User can implement a custom stream for this. Please refer to the implementation of `FileReadStream`.
-
-3. I don't know what encoding will the JSON be. How to handle them?
-
- You may use `AutoUTFInputStream` which detects the encoding of input stream automatically. However, it will incur some performance overhead.
-
-4. What is BOM? How RapidJSON handle it?
-
- [Byte order mark (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark) sometimes reside at the beginning of file/stream to indicate the UTF encoding type of it.
-
- RapidJSON's `EncodedInputStream` can detect/consume BOM. `EncodedOutputStream` can optionally write a BOM. See [Encoded Streams](doc/stream.md) for example.
-
-5. Why little/big endian is related?
-
- little/big endian of stream is an issue for UTF-16 and UTF-32 streams, but not UTF-8 stream.
-
-## Performance
-
-1. Is RapidJSON really fast?
-
- Yes. It may be the fastest open source JSON library. There is a [benchmark](https://github.com/miloyip/nativejson-benchmark) for evaluating performance of C/C++ JSON libraries.
-
-2. Why is it fast?
-
- Many design decisions of RapidJSON is aimed at time/space performance. These may reduce user-friendliness of APIs. Besides, it also employs low-level optimizations (intrinsics, SIMD) and special algorithms (custom double-to-string, string-to-double conversions).
-
-3. What is SIMD? How it is applied in RapidJSON?
-
- [SIMD](http://en.wikipedia.org/wiki/SIMD) instructions can perform parallel computation in modern CPUs. RapidJSON support Intel's SSE2/SSE4.2 and ARM's Neon to accelerate whitespace/tabspace/carriage-return/line-feed skipping. This improves performance of parsing indent formatted JSON. Define `RAPIDJSON_SSE2`, `RAPIDJSON_SSE42` or `RAPIDJSON_NEON` macro to enable this feature. However, running the executable on a machine without such instruction set support will make it crash.
-
-4. Does it consume a lot of memory?
-
- The design of RapidJSON aims at reducing memory footprint.
-
- In the SAX API, `Reader` consumes memory proportional to maximum depth of JSON tree, plus maximum length of JSON string.
-
- In the DOM API, each `Value` consumes exactly 16/24 bytes for 32/64-bit architecture respectively. RapidJSON also uses a special memory allocator to minimize overhead of allocations.
-
-5. What is the purpose of being high performance?
-
- Some applications need to process very large JSON files. Some server-side applications need to process huge amount of JSONs. Being high performance can improve both latency and throughput. In a broad sense, it will also save energy.
-
-## Gossip
-
-1. Who are the developers of RapidJSON?
-
- Milo Yip ([miloyip](https://github.com/miloyip)) is the original author of RapidJSON. Many contributors from the world have improved RapidJSON. Philipp A. Hartmann ([pah](https://github.com/pah)) has implemented a lot of improvements, setting up automatic testing and also involves in a lot of discussions for the community. Don Ding ([thebusytypist](https://github.com/thebusytypist)) implemented the iterative parser. Andrii Senkovych ([jollyroger](https://github.com/jollyroger)) completed the CMake migration. Kosta ([Kosta-Github](https://github.com/Kosta-Github)) provided a very neat short-string optimization. Thank you for all other contributors and community members as well.
-
-2. Why do you develop RapidJSON?
-
- It was just a hobby project initially in 2011. Milo Yip is a game programmer and he just knew about JSON at that time and would like to apply JSON in future projects. As JSON seems very simple he would like to write a header-only and fast library.
-
-3. Why there is a long empty period of development?
-
- It is basically due to personal issues, such as getting new family members. Also, Milo Yip has spent a lot of spare time on translating "Game Engine Architecture" by Jason Gregory into Chinese.
-
-4. Why did the repository move from Google Code to GitHub?
-
- This is the trend. And GitHub is much more powerful and convenient.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.zh-cn.md
deleted file mode 100644
index cf1124d826..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/faq.zh-cn.md
+++ /dev/null
@@ -1,290 +0,0 @@
-# 常è§é—®é¢˜
-
-[TOC]
-
-## 一般问题
-
-1. RapidJSON 是什么?
-
- RapidJSON 是一个 C++ 库,用于解æžåŠç”Ÿæˆ JSON。读者å¯å‚考它的所有 [特点](doc/features.zh-cn.md)。
-
-2. 为什么称作 RapidJSON?
-
- 它的çµæ„Ÿæ¥è‡ªäºŽ [RapidXML](http://rapidxml.sourceforge.net/),RapidXML 是一个高速的 XML DOM 解æžå™¨ã€‚
-
-3. RapidJSON 与 RapidXML 相似么?
-
- RapidJSON 借镜了 RapidXML 的一些设计, 包括原ä½ï¼ˆ*in situ*)解æžã€åªæœ‰å¤´æ–‡ä»¶çš„库。但两者的 API 是完全ä¸åŒçš„。此外 RapidJSON 也æ供许多 RapidXML 没有的特点。
-
-4. RapidJSON 是å…费的么?
-
- 是的,它在 MIT å议下å…费。它å¯ç”¨äºŽå•†ä¸šè½¯ä»¶ã€‚详情请å‚看 [license.txt](https://github.com/Tencent/rapidjson/blob/master/license.txt)。
-
-5. RapidJSON 很å°ä¹ˆï¼Ÿå®ƒæœ‰ä½•ä¾èµ–?
-
- 是的。在 Windows ä¸Šï¼Œä¸€ä¸ªè§£æž JSON 并打å°å‡ºç»Ÿè®¡çš„å¯æ‰§è¡Œæ–‡ä»¶å°‘于 30KB。
-
- RapidJSON ä»…ä¾èµ–于 C++ 标准库。
-
-6. 怎样安装 RapidJSON?
-
- è§ [安装一节](../readme.zh-cn.md#安装)。
-
-7. RapidJSON 能å¦è¿è¡ŒäºŽæˆ‘çš„å¹³å°ï¼Ÿ
-
- 社区已在多个æ“作系统ï¼ç¼–译器ï¼CPU 架构的组åˆä¸Šæµ‹è¯• RapidJSON。但我们无法确ä¿å®ƒèƒ½è¿è¡ŒäºŽä½ ç‰¹å®šçš„å¹³å°ä¸Šã€‚åªéœ€è¦ç”ŸæˆåŠæ‰§è¡Œå•å…ƒæµ‹è¯•ä¾¿èƒ½èŽ·å–答案。
-
-8. RapidJSON æ”¯æŒ C++03 么?C++11 呢?
-
- RapidJSON 开始时在 C++03 上实现。åŽæ¥åŠ å…¥äº†å¯é€‰çš„ C++11 特性支æŒï¼ˆå¦‚转移构造函数ã€`noexcept`)。RapidJSON 应该兼容所有éµä»Ž C++03 或 C++11 的编译器。
-
-9. RapidJSON 是å¦çœŸçš„用于实际应用?
-
- 是的。它被é…置于å‰å°åŠåŽå°çš„真实应用中。一个社区æˆå‘˜è¯´ RapidJSON 在他们的系统中æ¯æ—¥è§£æž 5 åƒä¸‡ä¸ª JSON。
-
-10. RapidJSON 是如何被测试的?
-
- RapidJSON 包å«ä¸€ç»„å•å…ƒæµ‹è¯•åŽ»æ‰§è¡Œè‡ªåŠ¨æµ‹è¯•ã€‚[Travis](https://travis-ci.org/Tencent/rapidjson/)(供 Linux å¹³å°ï¼‰åŠ [AppVeyor](https://ci.appveyor.com/project/Tencent/rapidjson/)(供 Windows å¹³å°ï¼‰ä¼šå¯¹æ‰€æœ‰ä¿®æ”¹è¿›è¡Œç¼–译åŠæ‰§è¡Œå•å…ƒæµ‹è¯•ã€‚在 Linux 下还会使用 Valgrind 去检测内存泄æ¼ã€‚
-
-11. RapidJSON 是å¦æœ‰å®Œæ•´çš„文档?
-
- RapidJSON æä¾›äº†ä½¿ç”¨æ‰‹å†ŒåŠ API 说明文档。
-
-12. 有没有其他替代å“?
-
- 有许多替代å“。例如 [nativejson-benchmark](https://github.com/miloyip/nativejson-benchmark) 列出了一些开æºçš„ C/C++ JSON 库。[json.org](http://www.json.org/) 也有一个列表。
-
-## JSON
-
-1. 什么是 JSON?
-
- JSON (JavaScript Object Notation) 是一个轻é‡çš„æ•°æ®äº¤æ¢æ ¼å¼ã€‚它使用人类å¯è¯»çš„文本格å¼ã€‚更多关于 JSON 的细节å¯è€ƒ [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) åŠ [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm)。
-
-2. JSON 有什么应用场åˆï¼Ÿ
-
- JSON 常用于网页应用程åºï¼Œä»¥ä¼ é€ç»“构化数æ®ã€‚它也å¯ä½œä¸ºæ–‡ä»¶æ ¼å¼ç”¨äºŽæ•°æ®æŒä¹…化。
-
-3. RapidJSON 是å¦ç¬¦åˆ JSON 标准?
-
- 是。RapidJSON å®Œå…¨ç¬¦åˆ [RFC7159](http://www.ietf.org/rfc/rfc7159.txt) åŠ [ECMA-404](http://www.ecma-international.org/publications/standards/Ecma-404.htm)。它能处ç†ä¸€äº›ç‰¹æ®Šæƒ…å†µï¼Œä¾‹å¦‚æ”¯æŒ JSON 字符串中å«æœ‰ç©ºå­—符åŠä»£ç†å¯¹ï¼ˆsurrogate pair)。
-
-4. RapidJSON 是å¦æ”¯æŒå®½æ¾çš„语法?
-
- ç›®å‰ä¸æ”¯æŒã€‚RapidJSON åªæ”¯æŒä¸¥æ ¼çš„标准格å¼ã€‚宽æ¾è¯­æ³•å¯ä»¥åœ¨è¿™ä¸ª [issue](https://github.com/Tencent/rapidjson/issues/36) 中进行讨论。
-
-## DOM 与 SAX
-
-1. 什么是 DOM 风格 API?
-
- Document Object Model(DOM)是一个储存于内存的 JSON 表示方å¼ï¼Œç”¨äºŽæŸ¥è¯¢åŠä¿®æ”¹ JSON。
-
-2. 什么是 SAX 风格 API?
-
- SAX 是一个事件驱动的 API,用于解æžåŠç”Ÿæˆ JSON。
-
-3. 我应用 DOM 还是 SAX?
-
- DOM 易于查询åŠä¿®æ”¹ã€‚SAX 则是éžå¸¸å¿«åŠçœå†…存的,但通常较难使用。
-
-4. 什么是原ä½ï¼ˆ*in situ*)解æžï¼Ÿ
-
- 原ä½è§£æžä¼šæŠŠ JSON 字符串直接解ç è‡³è¾“入的 JSON 中。这是一个优化,å¯å‡å°‘内存消耗åŠæå‡æ€§èƒ½ï¼Œä½†è¾“入的 JSON 会被更改。进一步细节请å‚考 [原ä½è§£æž](doc/dom.zh-cn.md) 。
-
-5. 什么时候会产生解æžé”™è¯¯ï¼Ÿ
-
- 当输入的 JSON 包å«éžæ³•è¯­æ³•ï¼Œæˆ–ä¸èƒ½è¡¨ç¤ºä¸€ä¸ªå€¼ï¼ˆå¦‚ Number 太大),或解æžå™¨çš„处ç†å™¨ä¸­æ–­è§£æžè¿‡ç¨‹ï¼Œè§£æžå™¨éƒ½ä¼šäº§ç”Ÿä¸€ä¸ªé”™è¯¯ã€‚详情请å‚考 [解æžé”™è¯¯](doc/dom.zh-cn.md)。
-
-6. 有什么错误信æ¯ï¼Ÿ
-
- 错误信æ¯å­˜å‚¨åœ¨ `ParseResult`,它包å«é”™è¯¯ä»£å·åŠå移值(从 JSON 开始至错误处的字符数目)。å¯ä»¥æŠŠé”™è¯¯ä»£å·ç¿»è¯‘为人类å¯è¯»çš„错误讯æ¯ã€‚
-
-7. 为何ä¸åªä½¿ç”¨ `double` 去表示 JSON number?
-
- 一些应用需è¦ä½¿ç”¨ 64 ä½æ— å·ï¼æœ‰å·æ•´æ•°ã€‚这些整数ä¸èƒ½æ— æŸåœ°è½¬æ¢æˆ `double`。因此解æžå™¨ä¼šæ£€æµ‹ä¸€ä¸ª JSON number 是å¦èƒ½è½¬æ¢è‡³å„ç§æ•´æ•°ç±»åž‹åŠ `double`。
-
-8. 如何清空并最å°åŒ– `document` 或 `value` 的容é‡ï¼Ÿ
-
- 调用 `SetXXX()` 方法 - 这些方法会调用æžæž„函数,并é‡å»ºç©ºçš„ Object 或 Array:
-
- ~~~~~~~~~~cpp
- Document d;
- ...
- d.SetObject(); // clear and minimize
- ~~~~~~~~~~
-
- å¦å¤–,也å¯ä»¥å‚考在 [C++ swap with temporary idiom](https://en.wikibooks.org/wiki/More_C%2B%2B_Idioms/Clear-and-minimize) 中的一ç§ç­‰ä»·çš„方法:
- ~~~~~~~~~~cpp
- Value(kObjectType).Swap(d);
- ~~~~~~~~~~
- 或者,使用这个ç¨å¾®é•¿ä¸€ç‚¹çš„代ç ä¹Ÿèƒ½å®ŒæˆåŒæ ·çš„事情:
- ~~~~~~~~~~cpp
- d.Swap(Value(kObjectType).Move());
- ~~~~~~~~~~
-
-9. 如何将一个 `document` 节点æ’入到å¦ä¸€ä¸ª `document` 中?
-
- 比如有以下两个 document(DOM):
- ~~~~~~~~~~cpp
- Document person;
- person.Parse("{\"person\":{\"name\":{\"first\":\"Adam\",\"last\":\"Thomas\"}}}");
-
- Document address;
- address.Parse("{\"address\":{\"city\":\"Moscow\",\"street\":\"Quiet\"}}");
- ~~~~~~~~~~
- å‡è®¾æˆ‘们希望将整个 `address` æ’入到 `person` 中,作为其的一个å­èŠ‚点:
- ~~~~~~~~~~js
- { "person": {
- "name": { "first": "Adam", "last": "Thomas" },
- "address": { "city": "Moscow", "street": "Quiet" }
- }
- }
- ~~~~~~~~~~
-
- 在æ’入节点的过程中需è¦æ³¨æ„ `document` å’Œ `value` 的生命周期并且正确地使用 allocator 进行内存分é…和管ç†ã€‚
-
- 一个简å•æœ‰æ•ˆçš„方法就是修改上述 `address` å˜é‡çš„定义,让其使用 `person` çš„ allocator åˆå§‹åŒ–,然åŽå°†å…¶æ·»åŠ åˆ°æ ¹èŠ‚点。
-
- ~~~~~~~~~~cpp
- Documnet address(&person.GetAllocator());
- ...
- person["person"].AddMember("address", address["address"], person.GetAllocator());
- ~~~~~~~~~~
- 当然,如果你ä¸æƒ³é€šè¿‡æ˜¾å¼åœ°å†™å‡º `address` çš„ key æ¥å¾—到其值,å¯ä»¥ä½¿ç”¨è¿­ä»£å™¨æ¥å®žçŽ°:
- ~~~~~~~~~~cpp
- auto addressRoot = address.MemberBegin();
- person["person"].AddMember(addressRoot->name, addressRoot->value, person.GetAllocator());
- ~~~~~~~~~~
-
- 此外,还å¯ä»¥é€šè¿‡æ·±æ‹·è´ address document æ¥å®žçŽ°:
- ~~~~~~~~~~cpp
- Value addressValue = Value(address["address"], person.GetAllocator());
- person["person"].AddMember("address", addressValue, person.GetAllocator());
- ~~~~~~~~~~
-
-## Document/Value (DOM)
-
-1. 什么是转移语义?为什么?
-
- `Value` ä¸ç”¨å¤åˆ¶è¯­ä¹‰ï¼Œè€Œä½¿ç”¨äº†è½¬ç§»è¯­ä¹‰ã€‚这是指,当把æ¥æºå€¼èµ‹å€¼äºŽç›®æ ‡å€¼æ—¶ï¼Œæ¥æºå€¼çš„所有æƒä¼šè½¬ç§»è‡³ç›®æ ‡å€¼ã€‚
-
- 由于转移快于å¤åˆ¶ï¼Œæ­¤è®¾è®¡å†³å®šå¼ºè¿«ä½¿ç”¨è€…注æ„到å¤åˆ¶çš„消耗。
-
-2. 怎样去å¤åˆ¶ä¸€ä¸ªå€¼ï¼Ÿ
-
- 有两个 API å¯ç”¨ï¼šå« allocator çš„æž„é€ å‡½æ•°ï¼Œä»¥åŠ `CopyFrom()`。å¯å‚考 [æ·±å¤åˆ¶ Value](doc/tutorial.zh-cn.md) 里的用例。
-
-3. 为什么我需è¦æ供字符串的长度?
-
- 由于 C 字符串是空字符结尾的,需è¦ä½¿ç”¨ `strlen()` 去计算其长度,这是线性å¤æ‚度的æ“作。若使用者已知字符串的长度,对很多æ“作æ¥è¯´ä¼šé€ æˆä¸å¿…è¦çš„消耗。
-
- 此外,RapidJSON å¯å¤„ç†å«æœ‰ `\u0000`(空字符)的字符串。若一个字符串å«æœ‰ç©ºå­—符,`strlen()` 便ä¸èƒ½è¿”回真正的字符串长度。在这ç§æƒ…况下使用者必须明确地æ供字符串长度。
-
-4. 为什么在许多 DOM æ“作 API 中è¦æ供分é…器作为å‚数?
-
- 由于这些 API 是 `Value` çš„æˆå‘˜å‡½æ•°ï¼Œæˆ‘们ä¸å¸Œæœ›ä¸ºæ¯ä¸ª `Value` 储存一个分é…器指针。
-
-5. 它会转æ¢å„ç§æ•°å€¼ç±»åž‹ä¹ˆï¼Ÿ
-
- 当使用 `GetInt()`ã€`GetUint()` ç­‰ API 时,å¯èƒ½ä¼šå‘生转æ¢ã€‚对于整数至整数转æ¢ï¼Œä»…当ä¿è¯è½¬æ¢å®‰å…¨æ‰ä¼šè½¬æ¢ï¼ˆå¦åˆ™ä¼šæ–­è¨€å¤±è´¥ï¼‰ã€‚然而,当把一个 64 ä½æœ‰å·ï¼æ— å·æ•´æ•°è½¬æ¢è‡³ double 时,它会转æ¢ï¼Œä½†æœ‰å¯èƒ½ä¼šæŸå¤±ç²¾åº¦ã€‚å«æœ‰å°æ•°çš„æ•°å­—ã€æˆ–大于 64 ä½çš„整数,都åªèƒ½ä½¿ç”¨ `GetDouble()` 获å–其值。
-
-## Reader/Writer (SAX)
-
-1. 为什么ä¸ä»…仅用 `printf` 输出一个 JSONï¼Ÿä¸ºä»€ä¹ˆéœ€è¦ `Writer`?
-
- 最é‡è¦çš„是,`Writer` 能确ä¿è¾“出的 JSON 是格å¼æ­£ç¡®çš„。错误地调用 SAX 事件(如 `StartObject()` é”™é… `EndArray()`)会造æˆæ–­è¨€å¤±è´¥ã€‚此外,`Writer` 会把字符串进行转义(如 `\n`)。最åŽï¼Œ`printf()` 的数值输出å¯èƒ½å¹¶ä¸æ˜¯ä¸€ä¸ªåˆæ³•çš„ JSON number,特别是æŸäº› locale 会有数字分隔符。而且 `Writer` 的数值字符串转æ¢æ˜¯ä½¿ç”¨éžå¸¸å¿«çš„算法æ¥å®žçŽ°çš„,胜过 `printf()` åŠ `iostream`。
-
-2. 我能å¦æš‚åœè§£æžè¿‡ç¨‹ï¼Œå¹¶åœ¨ç¨åŽç»§ç»­ï¼Ÿ
-
- 基于性能考虑,目å‰ç‰ˆæœ¬å¹¶ä¸ç›´æŽ¥æ”¯æŒæ­¤åŠŸèƒ½ã€‚然而,若执行环境支æŒå¤šçº¿ç¨‹ï¼Œä½¿ç”¨è€…å¯ä»¥åœ¨å¦ä¸€çº¿ç¨‹è§£æž JSON,并通过阻塞输入æµåŽ»æš‚åœã€‚
-
-## Unicode
-
-1. 它是å¦æ”¯æŒ UTF-8ã€UTF-16 åŠå…¶ä»–æ ¼å¼ï¼Ÿ
-
- æ˜¯ã€‚å®ƒå®Œå…¨æ”¯æŒ UTF-8ã€UTF-16(大端ï¼å°ç«¯ï¼‰ã€UTF-32(大端ï¼å°ç«¯ï¼‰åŠ ASCII。
-
-2. 它能å¦æ£€æµ‹ç¼–ç çš„åˆæ³•æ€§ï¼Ÿ
-
- 能。åªéœ€æŠŠ `kParseValidateEncodingFlag` å‚考传给 `Parse()`。若å‘现在输入æµä¸­æœ‰éžæ³•çš„ç¼–ç ï¼Œå®ƒå°±ä¼šäº§ç”Ÿ `kParseErrorStringInvalidEncoding` 错误。
-
-3. 什么是代ç†å¯¹ï¼ˆsurrogate pair)?RapidJSON 是å¦æ”¯æŒï¼Ÿ
-
- JSON 使用 UTF-16 ç¼–ç åŽ»è½¬ä¹‰ Unicode 字符,例如 `\u5927` 表示中文字“大â€ã€‚è¦å¤„ç†åŸºæœ¬å¤šæ–‡ç§å¹³é¢ï¼ˆbasic multilingual plane,BMP)以外的字符时,UTF-16 会把那些字符编ç æˆä¸¤ä¸ª 16 ä½å€¼ï¼Œè¿™ç§°ä¸º UTF-16 代ç†å¯¹ã€‚例如,绘文字字符 U+1F602 在 JSON 中å¯è¢«ç¼–ç æˆ `\uD83D\uDE02`。
-
- RapidJSON 完全支æŒè§£æžåŠç”Ÿæˆ UTF-16 代ç†å¯¹ã€‚
-
-4. 它能å¦å¤„ç† JSON 字符串中的 `\u0000`(空字符)?
-
- 能。RapidJSON å®Œå…¨æ”¯æŒ JSON 字符串中的空字符。然而,使用者需è¦æ³¨æ„到这件事,并使用 `GetStringLength()` åŠç›¸å…³ API 去å–得字符串真正长度。
-
-5. 能å¦å¯¹æ‰€æœ‰éž ASCII å­—ç¬¦è¾“å‡ºæˆ `\uxxxx` å½¢å¼ï¼Ÿ
-
- å¯ä»¥ã€‚åªè¦åœ¨ `Writer` 中使用 `ASCII<>` 作为输出编ç å‚数,就å¯ä»¥å¼ºé€¼è½¬ä¹‰é‚£äº›å­—符。
-
-## æµ
-
-1. 我有一个很大的 JSON 文件。我应å¦æŠŠå®ƒæ•´ä¸ªè½½å…¥å†…存中?
-
- 使用者å¯ä½¿ç”¨ `FileReadStream` 去é€å—读入文件。但若使用于原ä½è§£æžï¼Œå¿…须载入整个文件。
-
-2. 我能å¦è§£æžä¸€ä¸ªä»Žç½‘络上串æµè¿›æ¥çš„ JSON?
-
- å¯ä»¥ã€‚使用者å¯æ ¹æ® `FileReadStream` 的实现,去实现一个自定义的æµã€‚
-
-3. 我ä¸çŸ¥é“一些 JSON 将会使用哪ç§ç¼–ç ã€‚怎样处ç†å®ƒä»¬ï¼Ÿ
-
- ä½ å¯ä»¥ä½¿ç”¨ `AutoUTFInputStream`,它能自动检测输入æµçš„ç¼–ç ã€‚然而,它会带æ¥ä¸€äº›æ€§èƒ½å¼€é”€ã€‚
-
-4. 什么是 BOM?RapidJSON 怎样处ç†å®ƒï¼Ÿ
-
- [字节顺åºæ ‡è®°ï¼ˆbyte order mark, BOM)](http://en.wikipedia.org/wiki/Byte_order_mark) 有时会出现于文件ï¼æµçš„开始,以表示其 UTF ç¼–ç ç±»åž‹ã€‚
-
- RapidJSON çš„ `EncodedInputStream` å¯æ£€æµ‹ï¼è·³è¿‡ BOM。`EncodedOutputStream` å¯é€‰æ‹©æ˜¯å¦å†™å…¥ BOM。å¯å‚考 [ç¼–ç æµ](doc/stream.zh-cn.md) 中的例å­ã€‚
-
-5. 为什么会涉åŠå¤§ç«¯ï¼å°ç«¯ï¼Ÿ
-
- æµçš„大端ï¼å°ç«¯æ˜¯ UTF-16 åŠ UTF-32 æµè¦å¤„ç†çš„问题,而 UTF-8 ä¸éœ€è¦å¤„ç†ã€‚
-
-## 性能
-
-1. RapidJSON 是å¦çœŸçš„快?
-
- 是。它å¯èƒ½æ˜¯æœ€å¿«çš„å¼€æº JSON 库。有一个 [评测](https://github.com/miloyip/nativejson-benchmark) 评估 C/C++ JSON 库的性能。
-
-2. 为什么它会快?
-
- RapidJSON 的许多设计是针对时间ï¼ç©ºé—´æ€§èƒ½æ¥è®¾è®¡çš„,这些决定å¯èƒ½ä¼šå½±å“ API 的易用性。此外,它也使用了许多底层优化(内部函数ï¼intrinsicã€SIMD)åŠç‰¹åˆ«çš„算法(自定义的 double 至字符串转æ¢ã€å­—符串至 double 的转æ¢ï¼‰ã€‚
-
-3. 什是是 SIMD?它如何用于 RapidJSON?
-
- [SIMD](http://en.wikipedia.org/wiki/SIMD) 指令å¯ä»¥åœ¨çŽ°ä»£ CPU 中执行并行è¿ç®—。RapidJSON 支æŒä½¿ç”¨ Intel çš„ SSE2/SSE4.2 å’Œ ARM çš„ Neon æ¥åŠ é€Ÿå¯¹ç©ºç™½ç¬¦ã€åˆ¶è¡¨ç¬¦ã€å›žè½¦ç¬¦å’Œæ¢è¡Œç¬¦çš„过滤处ç†ã€‚在解æžå«ç¼©è¿›çš„ JSON 时,这能æå‡æ€§èƒ½ã€‚åªè¦å®šä¹‰å为 `RAPIDJSON_SSE2` ,`RAPIDJSON_SSE42` 或 `RAPIDJSON_NEON` çš„å®ï¼Œå°±èƒ½å¯åŠ¨è¿™ä¸ªåŠŸèƒ½ã€‚然而,若在ä¸æ”¯æŒè¿™äº›æŒ‡ä»¤é›†çš„机器上执行这些å¯æ‰§è¡Œæ–‡ä»¶ï¼Œä¼šå¯¼è‡´å´©æºƒã€‚
-
-4. 它会消耗许多内存么?
-
- RapidJSON 的设计目标是å‡ä½Žå†…å­˜å ç”¨ã€‚
-
- 在 SAX API 中,`Reader` 消耗的内存与 JSON 树深度加上最长 JSON 字符æˆæ­£æ¯”。
-
- 在 DOM API 中,æ¯ä¸ª `Value` 在 32/64 ä½æž¶æž„下分别消耗 16/24 字节。RapidJSON 也使用一个特殊的内存分é…器去å‡å°‘分é…çš„é¢å¤–开销。
-
-5. 高性能的æ„义何在?
-
- 有些应用程åºéœ€è¦å¤„ç†éžå¸¸å¤§çš„ JSON 文件。而有些åŽå°åº”用程åºéœ€è¦å¤„ç†å¤§é‡çš„ JSON。达到高性能åŒæ—¶æ”¹å–„延时åŠåžåé‡ã€‚更广义æ¥è¯´ï¼Œè¿™ä¹Ÿå¯ä»¥èŠ‚çœèƒ½æºã€‚
-
-## å…«å¦
-
-1. è°æ˜¯ RapidJSON çš„å¼€å‘者?
-
- å¶åŠ²å³°ï¼ˆMilo Yip,[miloyip](https://github.com/miloyip))是 RapidJSON 的原作者。全世界许多贡献者一直在改善 RapidJSON。Philipp A. Hartmann([pah](https://github.com/pah))实现了许多改进,也设置了自动化测试,而且还å‚与许多社区讨论。ä¸æ¬§å—(Don Ding,[thebusytypist](https://github.com/thebusytypist))实现了迭代å¼è§£æžå™¨ã€‚Andrii Senkovych([jollyroger](https://github.com/jollyroger))完æˆäº†å‘ CMake çš„è¿ç§»ã€‚Kosta([Kosta-Github](https://github.com/Kosta-Github))æ供了一个éžå¸¸çµå·§çš„短字符串优化。也需è¦æ„Ÿè°¢å…¶ä»–献者åŠç¤¾åŒºæˆå‘˜ã€‚
-
-2. 为何你è¦å¼€å‘ RapidJSON?
-
- 在 2011 年开始这项目时,它åªæ˜¯ä¸€ä¸ªå…´è¶£é¡¹ç›®ã€‚Milo Yip 是一个游æˆç¨‹åºå‘˜ï¼Œä»–在那时候认识到 JSON 并希望在未æ¥çš„项目中使用。由于 JSON 好åƒå¾ˆç®€å•ï¼Œä»–希望写一个快速的仅有头文件的程åºåº“。
-
-3. 为什么开å‘中段有一段长期空档?
-
- 主è¦æ˜¯ä¸ªäººå› ç´ ï¼Œä¾‹å¦‚加入新家庭æˆå‘˜ã€‚å¦å¤–,Milo Yip 也花了许多业余时间去翻译 Jason Gregory 的《Game Engine Architecture》至中文版《游æˆå¼•æ“Žæž¶æž„》。
-
-4. 为什么这个项目从 Google Code æ¬åˆ° GitHub?
-
- 这是大势所趋,而且 GitHub 更为强大åŠæ–¹ä¾¿ã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.md
deleted file mode 100644
index 4d159370ac..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.md
+++ /dev/null
@@ -1,106 +0,0 @@
-# Features
-
-## General
-
-* Cross-platform
- * Compilers: Visual Studio, gcc, clang, etc.
- * Architectures: x86, x64, ARM, etc.
- * Operating systems: Windows, Mac OS X, Linux, iOS, Android, etc.
-* Easy installation
- * Header files only library. Just copy the headers to your project.
-* Self-contained, minimal dependences
- * No STL, BOOST, etc.
- * Only included `<cstdio>`, `<cstdlib>`, `<cstring>`, `<inttypes.h>`, `<new>`, `<stdint.h>`.
-* Without C++ exception, RTTI
-* High performance
- * Use template and inline functions to reduce function call overheads.
- * Internal optimized Grisu2 and floating point parsing implementations.
- * Optional SSE2/SSE4.2 support.
-
-## Standard compliance
-
-* RapidJSON should be fully RFC4627/ECMA-404 compliance.
-* Support JSON Pointer (RFC6901).
-* Support JSON Schema Draft v4.
-* Support Swagger v2 schema.
-* Support OpenAPI v3.0.x schema.
-* Support Unicode surrogate.
-* Support null character (`"\u0000"`)
-* For example, `["Hello\u0000World"]` can be parsed and handled gracefully. There is API for getting/setting lengths of string.
-* Support optional relaxed syntax.
-* Single line (`// ...`) and multiple line (`/* ... */`) comments (`kParseCommentsFlag`).
-* Trailing commas at the end of objects and arrays (`kParseTrailingCommasFlag`).
-* `NaN`, `Inf`, `Infinity`, `-Inf` and `-Infinity` as `double` values (`kParseNanAndInfFlag`)
-* [NPM compliant](http://github.com/Tencent/rapidjson/blob/master/doc/npm.md).
-
-## Unicode
-
-* Support UTF-8, UTF-16, UTF-32 encodings, including little endian and big endian.
- * These encodings are used in input/output streams and in-memory representation.
-* Support automatic detection of encodings in input stream.
-* Support transcoding between encodings internally.
- * For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM.
-* Support encoding validation internally.
- * For example, you can read a UTF-8 file, and let RapidJSON check whether all JSON strings are valid UTF-8 byte sequence.
-* Support custom character types.
- * By default the character types are `char` for UTF8, `wchar_t` for UTF16, `uint32_t` for UTF32.
-* Support custom encodings.
-
-## API styles
-
-* SAX (Simple API for XML) style API
- * Similar to [SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML), RapidJSON provides a event sequential access parser API (`rapidjson::GenericReader`). It also provides a generator API (`rapidjson::Writer`) which consumes the same set of events.
-* DOM (Document Object Model) style API
- * Similar to [DOM](http://en.wikipedia.org/wiki/Document_Object_Model) for HTML/XML, RapidJSON can parse JSON into a DOM representation (`rapidjson::GenericDocument`), for easy manipulation, and finally stringify back to JSON if needed.
- * The DOM style API (`rapidjson::GenericDocument`) is actually implemented with SAX style API (`rapidjson::GenericReader`). SAX is faster but sometimes DOM is easier. Users can pick their choices according to scenarios.
-
-## Parsing
-
-* Recursive (default) and iterative parser
- * Recursive parser is faster but prone to stack overflow in extreme cases.
- * Iterative parser use custom stack to keep parsing state.
-* Support *in situ* parsing.
- * Parse JSON string values in-place at the source JSON, and then the DOM points to addresses of those strings.
- * Faster than convention parsing: no allocation for strings, no copy (if string does not contain escapes), cache-friendly.
-* Support 32-bit/64-bit signed/unsigned integer and `double` for JSON number type.
-* Support parsing multiple JSONs in input stream (`kParseStopWhenDoneFlag`).
-* Error Handling
- * Support comprehensive error code if parsing failed.
- * Support error message localization.
-
-## DOM (Document)
-
-* RapidJSON checks range of numerical values for conversions.
-* Optimization for string literal
- * Only store pointer instead of copying
-* Optimization for "short" strings
- * Store short string in `Value` internally without additional allocation.
- * For UTF-8 string: maximum 11 characters in 32-bit, 21 characters in 64-bit (13 characters in x86-64).
-* Optionally support `std::string` (define `RAPIDJSON_HAS_STDSTRING=1`)
-
-## Generation
-
-* Support `rapidjson::PrettyWriter` for adding newlines and indentations.
-
-## Stream
-
-* Support `rapidjson::GenericStringBuffer` for storing the output JSON as string.
-* Support `rapidjson::FileReadStream` and `rapidjson::FileWriteStream` for input/output `FILE` object.
-* Support custom streams.
-
-## Memory
-
-* Minimize memory overheads for DOM.
- * Each JSON value occupies exactly 16/20 bytes for most 32/64-bit machines (excluding text string).
-* Support fast default allocator.
- * A stack-based allocator (allocate sequentially, prohibit to free individual allocations, suitable for parsing).
- * User can provide a pre-allocated buffer. (Possible to parse a number of JSONs without any CRT allocation)
-* Support standard CRT(C-runtime) allocator.
-* Support custom allocators.
-
-## Miscellaneous
-
-* Some C++11 support (optional)
- * Rvalue reference
- * `noexcept` specifier
- * Range-based for loop
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.zh-cn.md
deleted file mode 100644
index 7662cc13e0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/features.zh-cn.md
+++ /dev/null
@@ -1,103 +0,0 @@
-# 特点
-
-## 总体
-
-* 跨平å°
- * 编译器:Visual Studioã€gccã€clang ç­‰
- * 架构:x86ã€x64ã€ARM ç­‰
- * æ“作系统:Windowsã€Mac OS Xã€Linuxã€iOSã€Android ç­‰
-* 容易安装
- * åªæœ‰å¤´æ–‡ä»¶çš„库。åªéœ€æŠŠå¤´æ–‡ä»¶å¤åˆ¶è‡³ä½ çš„项目中。
-* 独立ã€æœ€å°ä¾èµ–
- * ä¸éœ€ä¾èµ– STLã€BOOST 等。
- * åªåŒ…å« `<cstdio>`, `<cstdlib>`, `<cstring>`, `<inttypes.h>`, `<new>`, `<stdint.h>`。
-* 没使用 C++ 异常ã€RTTI
-* 高性能
- * 使用模版åŠå†…è”函数去é™ä½Žå‡½æ•°è°ƒç”¨å¼€é”€ã€‚
- * 内部ç»ä¼˜åŒ–çš„ Grisu2 åŠæµ®ç‚¹æ•°è§£æžå®žçŽ°ã€‚
- * å¯é€‰çš„ SSE2/SSE4.2 支æŒã€‚
-
-## 符åˆæ ‡å‡†
-
-* RapidJSON åº”å®Œå…¨ç¬¦åˆ RFC4627/ECMA-404 标准。
-* æ”¯æŒ JSON Pointer (RFC6901).
-* æ”¯æŒ JSON Schema Draft v4.
-* æ”¯æŒ Unicode 代ç†å¯¹ï¼ˆsurrogate pair)。
-* 支æŒç©ºå­—符(`"\u0000"`)。
- * 例如,å¯ä»¥ä¼˜é›…地解æžåŠå¤„ç† `["Hello\u0000World"]`。å«è¯»å†™å­—符串长度的 API。
-* 支æŒå¯é€‰çš„放宽语法
- * å•è¡Œï¼ˆ`// ...`)åŠå¤šè¡Œï¼ˆ`/* ... */`) 注释 (`kParseCommentsFlag`)。
- * 在对象和数组结æŸå‰å«é€—å· (`kParseTrailingCommasFlag`)。
- * `NaN`ã€`Inf`ã€`Infinity`ã€`-Inf` åŠ `-Infinity` 作为 `double` 值 (`kParseNanAndInfFlag`)
-* [NPM 兼容](https://github.com/Tencent/rapidjson/blob/master/doc/npm.md).
-
-## Unicode
-
-* æ”¯æŒ UTF-8ã€UTF-16ã€UTF-32 ç¼–ç ï¼ŒåŒ…括å°ç«¯åºå’Œå¤§ç«¯åºã€‚
- * 这些编ç ç”¨äºŽè¾“入输出æµï¼Œä»¥åŠå†…存中的表示。
-* 支æŒä»Žè¾“å…¥æµè‡ªåŠ¨æ£€æµ‹ç¼–ç ã€‚
-* 内部支æŒç¼–ç çš„转æ¢ã€‚
- * 例如,你å¯ä»¥è¯»å–一个 UTF-8 文件,让 RapidJSON 把 JSON 字符串转æ¢è‡³ UTF-16 çš„ DOM。
-* 内部支æŒç¼–ç æ ¡éªŒã€‚
- * 例如,你å¯ä»¥è¯»å–一个 UTF-8 文件,让 RapidJSON 检查是å¦æ‰€æœ‰ JSON 字符串是åˆæ³•çš„ UTF-8 字节åºåˆ—。
-* 支æŒè‡ªå®šä¹‰çš„字符类型。
- * 预设的字符类型是:UTF-8 为 `char`,UTF-16 为 `wchar_t`,UTF32 为 `uint32_t`。
-* 支æŒè‡ªå®šä¹‰çš„ç¼–ç ã€‚
-
-## API 风格
-
-* SAX(Simple API for XML)风格 API
- * 类似于 [SAX](http://en.wikipedia.org/wiki/Simple_API_for_XML), RapidJSON æ供一个事件循åºè®¿é—®çš„解æžå™¨ API(`rapidjson::GenericReader`)。RapidJSON 也æ供一个生æˆå™¨ API(`rapidjson::Writer`),å¯ä»¥å¤„ç†ç›¸åŒçš„事件集åˆã€‚
-* DOM(Document Object Model)风格 API
- * 类似于 HTMLï¼XML çš„ [DOM](http://en.wikipedia.org/wiki/Document_Object_Model),RapidJSON å¯æŠŠ JSON 解æžè‡³ä¸€ä¸ª DOM 表示方å¼ï¼ˆ`rapidjson::GenericDocument`),以方便æ“作。如有需è¦ï¼Œå¯æŠŠ DOM 转æ¢ï¼ˆstringify)回 JSON。
- * DOM 风格 API(`rapidjson::GenericDocument`)实际上是由 SAX 风格 API(`rapidjson::GenericReader`)实现的。SAX 更快,但有时 DOM 更易用。用户å¯æ ¹æ®æƒ…况作出选择。
-
-## 解æž
-
-* 递归å¼ï¼ˆé¢„设)åŠè¿­ä»£å¼è§£æžå™¨
- * 递归å¼è§£æžå™¨è¾ƒå¿«ï¼Œä½†åœ¨æžç«¯æƒ…况下å¯å‡ºçŽ°å †æ ˆæº¢å‡ºã€‚
- * 迭代å¼è§£æžå™¨ä½¿ç”¨è‡ªå®šä¹‰çš„堆栈去维æŒè§£æžçŠ¶æ€ã€‚
-* 支æŒåŽŸä½ï¼ˆ*in situ*)解æžã€‚
- * 把 JSON 字符串的值解æžè‡³åŽŸ JSON 之中,然åŽè®© DOM 指å‘那些字符串。
- * 比常规分æžæ›´å¿«ï¼šä¸éœ€å­—符串的内存分é…ã€ä¸éœ€å¤åˆ¶ï¼ˆå¦‚字符串ä¸å«è½¬ä¹‰ç¬¦ï¼‰ã€ç¼“å­˜å‹å¥½ã€‚
-* 对于 JSON æ•°å­—ç±»åž‹ï¼Œæ”¯æŒ 32-bit/64-bit 的有å·ï¼æ— å·æ•´æ•°ï¼Œä»¥åŠ `double`。
-* 错误处ç†
- * 支æŒè¯¦å°½çš„解æžé”™è¯¯ä»£å·ã€‚
- * 支æŒæœ¬åœ°åŒ–错误信æ¯ã€‚
-
-## DOM (Document)
-
-* RapidJSON 在类型转æ¢æ—¶ä¼šæ£€æŸ¥æ•°å€¼çš„范围。
-* 字符串字é¢é‡çš„优化
- * åªå‚¨å­˜æŒ‡é’ˆï¼Œä¸ä½œå¤åˆ¶
-* 优化“短â€å­—符串
- * 在 `Value` 内储存短字符串,无需é¢å¤–分é…。
- * 对 UTF-8 字符串æ¥è¯´ï¼Œ32 ä½æž¶æž„下å¯å­˜å‚¨æœ€å¤š 11 字符,64 ä½ä¸‹ 21 字符(x86-64 下 13 字符)。
-* å¯é€‰åœ°æ”¯æŒ `std::string`(定义 `RAPIDJSON_HAS_STDSTRING=1`)
-
-## 生æˆ
-
-* æ”¯æŒ `rapidjson::PrettyWriter` 去加入æ¢è¡ŒåŠç¼©è¿›ã€‚
-
-## 输入输出æµ
-
-* æ”¯æŒ `rapidjson::GenericStringBuffer`,把输出的 JSON 储存于字符串内。
-* æ”¯æŒ `rapidjson::FileReadStream` åŠ `rapidjson::FileWriteStream`,使用 `FILE` 对象作输入输出。
-* 支æŒè‡ªå®šä¹‰è¾“入输出æµã€‚
-
-## 内存
-
-* 最å°åŒ– DOM 的内存开销。
- * 对大部分 32ï¼64 ä½æœºå™¨è€Œè¨€ï¼Œæ¯ä¸ª JSON 值åªå  16 或 20 字节(ä¸åŒ…å«å­—符串)。
-* 支æŒå¿«é€Ÿçš„预设分é…器。
- * 它是一个堆栈形å¼çš„分é…器(顺åºåˆ†é…,ä¸å®¹è®¸å•ç‹¬é‡Šæ”¾ï¼Œé€‚åˆè§£æžè¿‡ç¨‹ä¹‹ç”¨ï¼‰ã€‚
- * 使用者也å¯æ供一个预分é…的缓冲区。(有å¯èƒ½è¾¾è‡³æ— éœ€ CRT 分é…就能解æžå¤šä¸ª JSON)
-* 支æŒæ ‡å‡† CRT(C-runtime)分é…器。
-* 支æŒè‡ªå®šä¹‰åˆ†é…器。
-
-## 其他
-
-* 一些 C++11 的支æŒï¼ˆå¯é€‰ï¼‰
- * å³å€¼å¼•ç”¨ï¼ˆrvalue reference)
- * `noexcept` 修饰符
- * 范围 for 循环
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.md
deleted file mode 100644
index 81fe9c16e7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.md
+++ /dev/null
@@ -1,368 +0,0 @@
-# Internals
-
-This section records some design and implementation details.
-
-[TOC]
-
-# Architecture {#Architecture}
-
-## SAX and DOM
-
-The basic relationships of SAX and DOM is shown in the following UML diagram.
-
-![Architecture UML class diagram](diagram/architecture.png)
-
-The core of the relationship is the `Handler` concept. From the SAX side, `Reader` parses a JSON from a stream and publish events to a `Handler`. `Writer` implements the `Handler` concept to handle the same set of events. From the DOM side, `Document` implements the `Handler` concept to build a DOM according to the events. `Value` supports a `Value::Accept(Handler&)` function, which traverses the DOM to publish events.
-
-With this design, SAX is not dependent on DOM. Even `Reader` and `Writer` have no dependencies between them. This provides flexibility to chain event publisher and handlers. Besides, `Value` does not depends on SAX as well. So, in addition to stringify a DOM to JSON, user may also stringify it to a XML writer, or do anything else.
-
-## Utility Classes
-
-Both SAX and DOM APIs depends on 3 additional concepts: `Allocator`, `Encoding` and `Stream`. Their inheritance hierarchy is shown as below.
-
-![Utility classes UML class diagram](diagram/utilityclass.png)
-
-# Value {#Value}
-
-`Value` (actually a typedef of `GenericValue<UTF8<>>`) is the core of DOM API. This section describes the design of it.
-
-## Data Layout {#DataLayout}
-
-`Value` is a [variant type](http://en.wikipedia.org/wiki/Variant_type). In RapidJSON's context, an instance of `Value` can contain 1 of 6 JSON value types. This is possible by using `union`. Each `Value` contains two members: `union Data data_` and a`unsigned flags_`. The `flags_` indicates the JSON type, and also additional information.
-
-The following tables show the data layout of each type. The 32-bit/64-bit columns indicates the size of the field in bytes.
-
-| Null | |32-bit|64-bit|
-|-------------------|----------------------------------|:----:|:----:|
-| (unused) | |4 |8 |
-| (unused) | |4 |4 |
-| (unused) | |4 |4 |
-| `unsigned flags_` | `kNullType kNullFlag` |4 |4 |
-
-| Bool | |32-bit|64-bit|
-|-------------------|----------------------------------------------------|:----:|:----:|
-| (unused) | |4 |8 |
-| (unused) | |4 |4 |
-| (unused) | |4 |4 |
-| `unsigned flags_` | `kBoolType` (either `kTrueFlag` or `kFalseFlag`) |4 |4 |
-
-| String | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `Ch* str` | Pointer to the string (may own) |4 |8 |
-| `SizeType length` | Length of string |4 |4 |
-| (unused) | |4 |4 |
-| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
-
-| Object | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `Member* members` | Pointer to array of members (owned) |4 |8 |
-| `SizeType size` | Number of members |4 |4 |
-| `SizeType capacity` | Capacity of members |4 |4 |
-| `unsigned flags_` | `kObjectType kObjectFlag` |4 |4 |
-
-| Array | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `Value* values` | Pointer to array of values (owned) |4 |8 |
-| `SizeType size` | Number of values |4 |4 |
-| `SizeType capacity` | Capacity of values |4 |4 |
-| `unsigned flags_` | `kArrayType kArrayFlag` |4 |4 |
-
-| Number (Int) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `int i` | 32-bit signed integer |4 |4 |
-| (zero padding) | 0 |4 |4 |
-| (unused) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kIntFlag kInt64Flag ...` |4 |4 |
-
-| Number (UInt) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `unsigned u` | 32-bit unsigned integer |4 |4 |
-| (zero padding) | 0 |4 |4 |
-| (unused) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kUintFlag kUint64Flag ...` |4 |4 |
-
-| Number (Int64) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `int64_t i64` | 64-bit signed integer |8 |8 |
-| (unused) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
-
-| Number (Uint64) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `uint64_t i64` | 64-bit unsigned integer |8 |8 |
-| (unused) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
-
-| Number (Double) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `uint64_t i64` | Double precision floating-point |8 |8 |
-| (unused) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kDoubleFlag` |4 |4 |
-
-Here are some notes:
-* To reduce memory consumption for 64-bit architecture, `SizeType` is typedef as `unsigned` instead of `size_t`.
-* Zero padding for 32-bit number may be placed after or before the actual type, according to the endianness. This makes possible for interpreting a 32-bit integer as a 64-bit integer, without any conversion.
-* An `Int` is always an `Int64`, but the converse is not always true.
-
-## Flags {#Flags}
-
-The 32-bit `flags_` contains both JSON type and other additional information. As shown in the above tables, each JSON type contains redundant `kXXXType` and `kXXXFlag`. This design is for optimizing the operation of testing bit-flags (`IsNumber()`) and obtaining a sequential number for each type (`GetType()`).
-
-String has two optional flags. `kCopyFlag` means that the string owns a copy of the string. `kInlineStrFlag` means using [Short-String Optimization](#ShortString).
-
-Number is a bit more complicated. For normal integer values, it can contains `kIntFlag`, `kUintFlag`, `kInt64Flag` and/or `kUint64Flag`, according to the range of the integer. For numbers with fraction, and integers larger than 64-bit range, they will be stored as `double` with `kDoubleFlag`.
-
-## Short-String Optimization {#ShortString}
-
- [Kosta](https://github.com/Kosta-Github) provided a very neat short-string optimization. The optimization idea is given as follow. Excluding the `flags_`, a `Value` has 12 or 16 bytes (32-bit or 64-bit) for storing actual data. Instead of storing a pointer to a string, it is possible to store short strings in these space internally. For encoding with 1-byte character type (e.g. `char`), it can store maximum 11 or 15 characters string inside the `Value` type.
-
-| ShortString (Ch=char) | |32-bit|64-bit|
-|---------------------|-------------------------------------|:----:|:----:|
-| `Ch str[MaxChars]` | String buffer |11 |15 |
-| `Ch invLength` | MaxChars - Length |1 |1 |
-| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
-
-A special technique is applied. Instead of storing the length of string directly, it stores (MaxChars - length). This make it possible to store 11 characters with trailing `\0`.
-
-This optimization can reduce memory usage for copy-string. It can also improve cache-coherence thus improve runtime performance.
-
-# Allocator {#InternalAllocator}
-
-`Allocator` is a concept in RapidJSON:
-~~~cpp
-concept Allocator {
- static const bool kNeedFree; //!< Whether this allocator needs to call Free().
-
- // Allocate a memory block.
- // \param size of the memory block in bytes.
- // \returns pointer to the memory block.
- void* Malloc(size_t size);
-
- // Resize a memory block.
- // \param originalPtr The pointer to current memory block. Null pointer is permitted.
- // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)
- // \param newSize the new size in bytes.
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
-
- // Free a memory block.
- // \param pointer to the memory block. Null pointer is permitted.
- static void Free(void *ptr);
-};
-~~~
-
-Note that `Malloc()` and `Realloc()` are member functions but `Free()` is static member function.
-
-## MemoryPoolAllocator {#MemoryPoolAllocator}
-
-`MemoryPoolAllocator` is the default allocator for DOM. It allocate but do not free memory. This is suitable for building a DOM tree.
-
-Internally, it allocates chunks of memory from the base allocator (by default `CrtAllocator`) and stores the chunks as a singly linked list. When user requests an allocation, it allocates memory from the following order:
-
-1. User supplied buffer if it is available. (See [User Buffer section in DOM](doc/dom.md))
-2. If user supplied buffer is full, use the current memory chunk.
-3. If the current block is full, allocate a new block of memory.
-
-# Parsing Optimization {#ParsingOptimization}
-
-## Skip Whitespaces with SIMD {#SkipwhitespaceWithSIMD}
-
-When parsing JSON from a stream, the parser need to skip 4 whitespace characters:
-
-1. Space (`U+0020`)
-2. Character Tabulation (`U+000B`)
-3. Line Feed (`U+000A`)
-4. Carriage Return (`U+000D`)
-
-A simple implementation will be simply:
-~~~cpp
-void SkipWhitespace(InputStream& s) {
- while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
- s.Take();
-}
-~~~
-
-However, this requires 4 comparisons and a few branching for each character. This was found to be a hot spot.
-
-To accelerate this process, SIMD was applied to compare 16 characters with 4 white spaces for each iteration. Currently RapidJSON supports SSE2, SSE4.2 and ARM Neon instructions for this. And it is only activated for UTF-8 memory streams, including string stream or *in situ* parsing.
-
-To enable this optimization, need to define `RAPIDJSON_SSE2`, `RAPIDJSON_SSE42` or `RAPIDJSON_NEON` before including `rapidjson.h`. Some compilers can detect the setting, as in `perftest.h`:
-
-~~~cpp
-// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
-// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
-// Likewise, __ARM_NEON is used to detect Neon.
-#if defined(__SSE4_2__)
-# define RAPIDJSON_SSE42
-#elif defined(__SSE2__)
-# define RAPIDJSON_SSE2
-#elif defined(__ARM_NEON)
-# define RAPIDJSON_NEON
-#endif
-~~~
-
-Note that, these are compile-time settings. Running the executable on a machine without such instruction set support will make it crash.
-
-### Page boundary issue
-
-In an early version of RapidJSON, [an issue](https://code.google.com/archive/p/rapidjson/issues/104) reported that the `SkipWhitespace_SIMD()` causes crash very rarely (around 1 in 500,000). After investigation, it is suspected that `_mm_loadu_si128()` accessed bytes after `'\0'`, and across a protected page boundary.
-
-In [Intel® 64 and IA-32 Architectures Optimization Reference Manual
-](http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html), section 10.2.1:
-
-> To support algorithms requiring unaligned 128-bit SIMD memory accesses, memory buffer allocation by a caller function should consider adding some pad space so that a callee function can safely use the address pointer safely with unaligned 128-bit SIMD memory operations.
-> The minimal padding size should be the width of the SIMD register that might be used in conjunction with unaligned SIMD memory access.
-
-This is not feasible as RapidJSON should not enforce such requirement.
-
-To fix this issue, currently the routine process bytes up to the next aligned address. After tha, use aligned read to perform SIMD processing. Also see [#85](https://github.com/Tencent/rapidjson/issues/85).
-
-## Local Stream Copy {#LocalStreamCopy}
-
-During optimization, it is found that some compilers cannot localize some member data access of streams into local variables or registers. Experimental results show that for some stream types, making a copy of the stream and used it in inner-loop can improve performance. For example, the actual (non-SIMD) implementation of `SkipWhitespace()` is implemented as:
-
-~~~cpp
-template<typename InputStream>
-void SkipWhitespace(InputStream& is) {
- internal::StreamLocalCopy<InputStream> copy(is);
- InputStream& s(copy.s);
-
- while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
- s.Take();
-}
-~~~
-
-Depending on the traits of stream, `StreamLocalCopy` will make (or not make) a copy of the stream object, use it locally and copy the states of stream back to the original stream.
-
-## Parsing to Double {#ParsingDouble}
-
-Parsing string into `double` is difficult. The standard library function `strtod()` can do the job but it is slow. By default, the parsers use normal precision setting. This has has maximum 3 [ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) error and implemented in `internal::StrtodNormalPrecision()`.
-
-When using `kParseFullPrecisionFlag`, the parsers calls `internal::StrtodFullPrecision()` instead, and this function actually implemented 3 versions of conversion methods.
-1. [Fast-Path](http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/).
-2. Custom DIY-FP implementation as in [double-conversion](https://github.com/floitsch/double-conversion).
-3. Big Integer Method as in (Clinger, William D. How to read floating point numbers accurately. Vol. 25. No. 6. ACM, 1990).
-
-If the first conversion methods fail, it will try the second, and so on.
-
-# Generation Optimization {#GenerationOptimization}
-
-## Integer-to-String conversion {#itoa}
-
-The naive algorithm for integer-to-string conversion involves division per each decimal digit. We have implemented various implementations and evaluated them in [itoa-benchmark](https://github.com/miloyip/itoa-benchmark).
-
-Although SSE2 version is the fastest but the difference is minor by comparing to the first running-up `branchlut`. And `branchlut` is pure C++ implementation so we adopt `branchlut` in RapidJSON.
-
-## Double-to-String conversion {#dtoa}
-
-Originally RapidJSON uses `snprintf(..., ..., "%g")` to achieve double-to-string conversion. This is not accurate as the default precision is 6. Later we also find that this is slow and there is an alternative.
-
-Google's V8 [double-conversion](https://github.com/floitsch/double-conversion
-) implemented a newer, fast algorithm called Grisu3 (Loitsch, Florian. "Printing floating-point numbers quickly and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243.).
-
-However, since it is not header-only so that we implemented a header-only version of Grisu2. This algorithm guarantees that the result is always accurate. And in most of cases it produces the shortest (optimal) string representation.
-
-The header-only conversion function has been evaluated in [dtoa-benchmark](https://github.com/miloyip/dtoa-benchmark).
-
-# Parser {#Parser}
-
-## Iterative Parser {#IterativeParser}
-
-The iterative parser is a recursive descent LL(1) parser
-implemented in a non-recursive manner.
-
-### Grammar {#IterativeParserGrammar}
-
-The grammar used for this parser is based on strict JSON syntax:
-~~~~~~~~~~
-S -> array | object
-array -> [ values ]
-object -> { members }
-values -> non-empty-values | ε
-non-empty-values -> value addition-values
-addition-values -> ε | , non-empty-values
-members -> non-empty-members | ε
-non-empty-members -> member addition-members
-addition-members -> ε | , non-empty-members
-member -> STRING : value
-value -> STRING | NUMBER | NULL | BOOLEAN | object | array
-~~~~~~~~~~
-
-Note that left factoring is applied to non-terminals `values` and `members`
-to make the grammar be LL(1).
-
-### Parsing Table {#IterativeParserParsingTable}
-
-Based on the grammar, we can construct the FIRST and FOLLOW set.
-
-The FIRST set of non-terminals is listed below:
-
-| NON-TERMINAL | FIRST |
-|:-----------------:|:--------------------------------:|
-| array | [ |
-| object | { |
-| values | ε STRING NUMBER NULL BOOLEAN { [ |
-| addition-values | ε COMMA |
-| members | ε STRING |
-| addition-members | ε COMMA |
-| member | STRING |
-| value | STRING NUMBER NULL BOOLEAN { [ |
-| S | [ { |
-| non-empty-members | STRING |
-| non-empty-values | STRING NUMBER NULL BOOLEAN { [ |
-
-The FOLLOW set is listed below:
-
-| NON-TERMINAL | FOLLOW |
-|:-----------------:|:-------:|
-| S | $ |
-| array | , $ } ] |
-| object | , $ } ] |
-| values | ] |
-| non-empty-values | ] |
-| addition-values | ] |
-| members | } |
-| non-empty-members | } |
-| addition-members | } |
-| member | , } |
-| value | , } ] |
-
-Finally the parsing table can be constructed from FIRST and FOLLOW set:
-
-| NON-TERMINAL | [ | { | , | : | ] | } | STRING | NUMBER | NULL | BOOLEAN |
-|:-----------------:|:---------------------:|:---------------------:|:-------------------:|:-:|:-:|:-:|:-----------------------:|:---------------------:|:---------------------:|:---------------------:|
-| S | array | object | | | | | | | | |
-| array | [ values ] | | | | | | | | | |
-| object | | { members } | | | | | | | | |
-| values | non-empty-values | non-empty-values | | | ε | | non-empty-values | non-empty-values | non-empty-values | non-empty-values |
-| non-empty-values | value addition-values | value addition-values | | | | | value addition-values | value addition-values | value addition-values | value addition-values |
-| addition-values | | | , non-empty-values | | ε | | | | | |
-| members | | | | | | ε | non-empty-members | | | |
-| non-empty-members | | | | | | | member addition-members | | | |
-| addition-members | | | , non-empty-members | | | ε | | | | |
-| member | | | | | | | STRING : value | | | |
-| value | array | object | | | | | STRING | NUMBER | NULL | BOOLEAN |
-
-There is a great [tool](http://hackingoff.com/compilers/predict-first-follow-set) for above grammar analysis.
-
-### Implementation {#IterativeParserImplementation}
-
-Based on the parsing table, a direct(or conventional) implementation
-that pushes the production body in reverse order
-while generating a production could work.
-
-In RapidJSON, several modifications(or adaptations to current design) are made to a direct implementation.
-
-First, the parsing table is encoded in a state machine in RapidJSON.
-States are constructed by the head and body of production.
-State transitions are constructed by production rules.
-Besides, extra states are added for productions involved with `array` and `object`.
-In this way the generation of array values or object members would be a single state transition,
-rather than several pop/push operations in the direct implementation.
-This also makes the estimation of stack size more easier.
-
-The state diagram is shown as follows:
-
-![State Diagram](diagram/iterative-parser-states-diagram.png)
-
-Second, the iterative parser also keeps track of array's value count and object's member count
-in its internal stack, which may be different from a conventional implementation.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.zh-cn.md
deleted file mode 100644
index d414fc1402..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/internals.zh-cn.md
+++ /dev/null
@@ -1,363 +0,0 @@
-# 内部架构
-
-本部分记录了一些设计和实现细节。
-
-[TOC]
-
-# 架构 {#Architecture}
-
-## SAX 和 DOM
-
-下é¢çš„ UML 图显示了 SAX å’Œ DOM 的基本关系。
-
-![架构 UML 类图](diagram/architecture.png)
-
-关系的核心是 `Handler` 概念。在 SAX 一边,`Reader` 从æµè§£æž JSON 并将事件å‘é€åˆ° `Handler`。`Writer` 实现了 `Handler` 概念,用于处ç†ç›¸åŒçš„事件。在 DOM 一边,`Document` 实现了 `Handler` 概念,用于通过这些时间æ¥æž„建 DOM。`Value` 支æŒäº† `Value::Accept(Handler&)` 函数,它å¯ä»¥å°† DOM 转æ¢ä¸ºäº‹ä»¶è¿›è¡Œå‘é€ã€‚
-
-在这个设计,SAX 是ä¸ä¾èµ–于 DOM 的。甚至 `Reader` å’Œ `Writer` 之间也没有ä¾èµ–。这æ供了连接事件å‘é€å™¨å’Œå¤„ç†å™¨çš„çµæ´»æ€§ã€‚除此之外,`Value` 也是ä¸ä¾èµ–于 SAX 的。所以,除了将 DOM åºåˆ—化为 JSON 之外,用户也å¯ä»¥å°†å…¶åºåˆ—化为 XML,或者åšä»»ä½•å…¶ä»–事情。
-
-## 工具类
-
-SAX å’Œ DOM API 都ä¾èµ–于3个é¢å¤–的概念:`Allocator`ã€`Encoding` å’Œ `Stream`。它们的继承层次结构如下图所示。
-
-![工具类 UML 类图](diagram/utilityclass.png)
-
-# 值(Value) {#Value}
-
-`Value` (实际上被定义为 `GenericValue<UTF8<>>`)是 DOM API 的核心。本部分æ述了它的设计。
-
-## æ•°æ®å¸ƒå±€ {#DataLayout}
-
-`Value` 是[å¯å˜ç±»åž‹](http://en.wikipedia.org/wiki/Variant_type)。在 RapidJSON 的上下文中,一个 `Value` 的实例å¯ä»¥åŒ…å«6ç§ JSON æ•°æ®ç±»åž‹ä¹‹ä¸€ã€‚通过使用 `union` ,这是å¯èƒ½å®žçŽ°çš„。æ¯ä¸€ä¸ª `Value` 包å«ä¸¤ä¸ªæˆå‘˜ï¼š`union Data data_` å’Œ `unsigned flags_`。`flags_` 表明了 JSON 类型,以åŠé™„加的信æ¯ã€‚
-
-下表显示了所有类型的数æ®å¸ƒå±€ã€‚32ä½/64ä½åˆ—表明了字段所å ç”¨çš„字节数。
-
-| Null | | 32ä½ | 64ä½ |
-|-------------------|----------------------------------|:----:|:----:|
-| (未使用) | |4 |8 |
-| (未使用) | |4 |4 |
-| (未使用) | |4 |4 |
-| `unsigned flags_` | `kNullType kNullFlag` |4 |4 |
-
-| Bool | | 32ä½ | 64ä½ |
-|-------------------|----------------------------------------------------|:----:|:----:|
-| (未使用) | |4 |8 |
-| (未使用) | |4 |4 |
-| (未使用) | |4 |4 |
-| `unsigned flags_` | `kBoolType` (either `kTrueFlag` or `kFalseFlag`) |4 |4 |
-
-| String | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `Ch* str` | 指å‘字符串的指针(å¯èƒ½æ‹¥æœ‰æ‰€æœ‰æƒï¼‰ |4 |8 |
-| `SizeType length` | 字符串长度 |4 |4 |
-| (未使用) | |4 |4 |
-| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
-
-| Object | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `Member* members` | 指å‘æˆå‘˜æ•°ç»„的指针(拥有所有æƒï¼‰ |4 |8 |
-| `SizeType size` | æˆå‘˜æ•°é‡ |4 |4 |
-| `SizeType capacity` | æˆå‘˜å®¹é‡ |4 |4 |
-| `unsigned flags_` | `kObjectType kObjectFlag` |4 |4 |
-
-| Array | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `Value* values` | 指å‘值数组的指针(拥有所有æƒï¼‰ |4 |8 |
-| `SizeType size` | å€¼æ•°é‡ |4 |4 |
-| `SizeType capacity` | å€¼å®¹é‡ |4 |4 |
-| `unsigned flags_` | `kArrayType kArrayFlag` |4 |4 |
-
-| Number (Int) | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `int i` | 32ä½æœ‰ç¬¦å·æ•´æ•° |4 |4 |
-| (零填充) | 0 |4 |4 |
-| (未使用) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kIntFlag kInt64Flag ...` |4 |4 |
-
-| Number (UInt) | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `unsigned u` | 32ä½æ— ç¬¦å·æ•´æ•° |4 |4 |
-| (零填充) | 0 |4 |4 |
-| (未使用) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kUintFlag kUint64Flag ...` |4 |4 |
-
-| Number (Int64) | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `int64_t i64` | 64ä½æœ‰ç¬¦å·æ•´æ•° |8 |8 |
-| (未使用) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
-
-| Number (Uint64) | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `uint64_t i64` | 64ä½æ— ç¬¦å·æ•´æ•° |8 |8 |
-| (未使用) | |4 |8 |
-| `unsigned flags_` | `kNumberType kNumberFlag kInt64Flag ...` |4 |4 |
-
-| Number (Double) | | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `uint64_t i64` | åŒç²¾åº¦æµ®ç‚¹æ•° |8 |8 |
-| (未使用) | |4 |8 |
-| `unsigned flags_` |`kNumberType kNumberFlag kDoubleFlag`|4 |4 |
-
-这里有一些需è¦æ³¨æ„的地方:
-* 为了å‡å°‘在64ä½æž¶æž„上的内存消耗,`SizeType` 被定义为 `unsigned` 而ä¸æ˜¯ `size_t`。
-* 32ä½æ•´æ•°çš„零填充å¯èƒ½è¢«æ”¾åœ¨å®žé™…类型的å‰é¢æˆ–åŽé¢ï¼Œè¿™ä¾èµ–于字节åºã€‚这使得它å¯ä»¥å°†32ä½æ•´æ•°ä¸ç»è¿‡ä»»ä½•è½¬æ¢å°±å¯ä»¥è§£é‡Šä¸º64ä½æ•´æ•°ã€‚
-* `Int` 永远是 `Int64`,å之ä¸ç„¶ã€‚
-
-## 标志 {#Flags}
-
-32ä½çš„ `flags_` 包å«äº† JSON 类型和其他信æ¯ã€‚如å‰æ–‡ä¸­çš„表所述,æ¯ä¸€ç§ JSON 类型包å«äº†å†—余的 `kXXXType` å’Œ `kXXXFlag`。这个设计是为了优化测试ä½æ ‡å¿—(`IsNumber()`)和获å–æ¯ä¸€ç§ç±»åž‹çš„åºåˆ—å·ï¼ˆ`GetType()`)。
-
-字符串有两个å¯é€‰çš„标志。`kCopyFlag` 表明这个字符串拥有字符串拷è´çš„所有æƒã€‚而 `kInlineStrFlag` æ„味ç€ä½¿ç”¨äº†[短字符串优化](#ShortString)。
-
-数字更加å¤æ‚一些。对于普通的整数值,它å¯ä»¥åŒ…å« `kIntFlag`ã€`kUintFlag`〠`kInt64Flag` å’Œ/或 `kUint64Flag`,这由整数的范围决定。带有å°æ•°æˆ–者超过64ä½æ‰€èƒ½è¡¨è¾¾çš„范围的整数的数字会被存储为带有 `kDoubleFlag` çš„ `double`。
-
-## 短字符串优化 {#ShortString}
-
-[Kosta](https://github.com/Kosta-Github) æ供了很棒的短字符串优化。这个优化的xxx如下所述。除去 `flags_` ,`Value` 有12或16字节(对于32ä½æˆ–64ä½ï¼‰æ¥å­˜å‚¨å®žé™…çš„æ•°æ®ã€‚这为在其内部直接存储短字符串而ä¸æ˜¯å­˜å‚¨å­—符串的指针创造了å¯èƒ½ã€‚对于1字节的字符类型(例如 `char`),它å¯ä»¥åœ¨ `Value` 类型内部存储至多11或15个字符的字符串。
-
-|ShortString (Ch=char)| | 32ä½ | 64ä½ |
-|---------------------|-------------------------------------|:----:|:----:|
-| `Ch str[MaxChars]` | 字符串缓冲区 |11 |15 |
-| `Ch invLength` | MaxChars - Length |1 |1 |
-| `unsigned flags_` | `kStringType kStringFlag ...` |4 |4 |
-
-这里使用了一项特殊的技术。它存储了 (MaxChars - length) 而ä¸ç›´æŽ¥å­˜å‚¨å­—符串的长度。这使得存储11个字符并且带有åŽç¼€ `\0` æˆä¸ºå¯èƒ½ã€‚
-
-这个优化å¯ä»¥å‡å°‘字符串拷è´å†…å­˜å ç”¨ã€‚它也改善了缓存一致性,并进一步æ高了è¿è¡Œæ—¶æ€§èƒ½ã€‚
-
-# 分é…器(Allocator) {#InternalAllocator}
-
-`Allocator` 是 RapidJSON 中的概念:
-~~~cpp
-concept Allocator {
- static const bool kNeedFree; //!< 表明这个分é…器是å¦éœ€è¦è°ƒç”¨ Free()。
-
- // 申请内存å—。
- // \param size 内存å—的大å°ï¼Œä»¥å­—节记。
- // \returns 指å‘内存å—的指针。
- void* Malloc(size_t size);
-
- // 调整内存å—的大å°ã€‚
- // \param originalPtr 当å‰å†…å­˜å—的指针。空指针是被å…许的。
- // \param originalSize 当å‰å¤§å°ï¼Œä»¥å­—节记。(设计问题:因为有些分é…器å¯èƒ½ä¸ä¼šè®°å½•å®ƒï¼Œæ˜¾ç¤ºçš„传递它å¯ä»¥èŠ‚约内存。)
- // \param newSize 新大å°ï¼Œä»¥å­—节记。
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
-
- // 释放内存å—。
- // \param ptr 指å‘内存å—的指针。空指针是被å…许的。
- static void Free(void *ptr);
-};
-~~~
-
-需è¦æ³¨æ„的是 `Malloc()` å’Œ `Realloc()` 是æˆå‘˜å‡½æ•°è€Œ `Free()` 是é™æ€æˆå‘˜å‡½æ•°ã€‚
-
-## MemoryPoolAllocator {#MemoryPoolAllocator}
-
-`MemoryPoolAllocator` 是 DOM 的默认内存分é…器。它åªç”³è¯·å†…存而ä¸é‡Šæ”¾å†…存。这对于构建 DOM æ ‘éžå¸¸åˆé€‚。
-
-在它的内部,它从基础的内存分é…器申请内存å—(默认为 `CrtAllocator`)并将这些内存å—存储为å•å‘链表。当用户请求申请内存,它会éµå¾ªä¸‹åˆ—步骤æ¥ç”³è¯·å†…存:
-
-1. 如果å¯ç”¨ï¼Œä½¿ç”¨ç”¨æˆ·æä¾›çš„ç¼“å†²åŒºã€‚ï¼ˆè§ [User Buffer section in DOM](doc/dom.md))
-2. 如果用户æ供的缓冲区已满,使用当å‰å†…å­˜å—。
-3. 如果当å‰å†…å­˜å—已满,申请新的内存å—。
-
-# 解æžä¼˜åŒ– {#ParsingOptimization}
-
-## 使用 SIMD 跳过空格 {#SkipwhitespaceWithSIMD}
-
-当从æµä¸­è§£æž JSON 时,解æžå™¨éœ€è¦è·³è¿‡4ç§ç©ºæ ¼å­—符:
-
-1. 空格 (`U+0020`)
-2. 制表符 (`U+000B`)
-3. æ¢è¡Œ (`U+000A`)
-4. 回车 (`U+000D`)
-
-这是一份简å•çš„实现:
-~~~cpp
-void SkipWhitespace(InputStream& s) {
- while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
- s.Take();
-}
-~~~
-
-但是,这需è¦å¯¹æ¯ä¸ªå­—符进行4次比较以åŠä¸€äº›åˆ†æ”¯ã€‚这被å‘现是一个热点。
-
-为了加速这一处ç†ï¼ŒRapidJSON 使用 SIMD æ¥åœ¨ä¸€æ¬¡è¿­ä»£ä¸­æ¯”较16个字符和4ä¸ªç©ºæ ¼ã€‚ç›®å‰ RapidJSON æ”¯æŒ SSE2 , SSE4.2 å’Œ ARM Neon 指令。åŒæ—¶å®ƒä¹Ÿåªä¼šå¯¹ UTF-8 内存æµå¯ç”¨ï¼ŒåŒ…括字符串æµæˆ– *原ä½* 解æžã€‚
-
-ä½ å¯ä»¥é€šè¿‡åœ¨åŒ…å« `rapidjson.h` 之å‰å®šä¹‰ `RAPIDJSON_SSE2` , `RAPIDJSON_SSE42` 或 `RAPIDJSON_NEON` æ¥å¯ç”¨è¿™ä¸ªä¼˜åŒ–。一些编译器å¯ä»¥æ£€æµ‹è¿™ä¸ªè®¾ç½®ï¼Œå¦‚ `perftest.h`:
-
-~~~cpp
-// __SSE2__ å’Œ __SSE4_2__ å¯è¢« gccã€clang å’Œ Intel 编译器识别:
-// 如果支æŒçš„è¯ï¼Œæˆ‘们在 gmake 中使用了 -march=native æ¥å¯ç”¨ -msse2 å’Œ -msse4.2
-// åŒæ ·çš„, __ARM_NEON 被用于识别Neon
-#if defined(__SSE4_2__)
-# define RAPIDJSON_SSE42
-#elif defined(__SSE2__)
-# define RAPIDJSON_SSE2
-#elif defined(__ARM_NEON)
-# define RAPIDJSON_NEON
-#endif
-~~~
-
-需è¦æ³¨æ„的是,这是编译期的设置。在ä¸æ”¯æŒè¿™äº›æŒ‡ä»¤çš„机器上è¿è¡Œå¯æ‰§è¡Œæ–‡ä»¶ä¼šä½¿å®ƒå´©æºƒã€‚
-
-### 页é¢å¯¹é½é—®é¢˜
-
-在 RapidJSON 的早期版本中,被报告了[一个问题](https://code.google.com/archive/p/rapidjson/issues/104):`SkipWhitespace_SIMD()` 会罕è§åœ°å¯¼è‡´å´©æºƒï¼ˆçº¦äº”å万分之一的几率)。在调查之åŽï¼Œæ€€ç–‘是 `_mm_loadu_si128()` 访问了 `'\0'` 之åŽçš„内存,并越过被ä¿æŠ¤çš„页é¢è¾¹ç•Œã€‚
-
-在 [Intel® 64 and IA-32 Architectures Optimization Reference Manual
-](http://www.intel.com/content/www/us/en/architecture-and-technology/64-ia-32-architectures-optimization-manual.html) 中,章节 10.2.1:
-
-> 为了支æŒéœ€è¦è´¹å¯¹é½çš„128ä½ SIMD 内存访问的算法,调用者的内存缓冲区申请应当考虑添加一些填充空间,这样被调用的函数å¯ä»¥å®‰å…¨åœ°å°†åœ°å€æŒ‡é’ˆç”¨äºŽæœªå¯¹é½çš„128ä½ SIMD 内存æ“作。
-> 在结åˆéžå¯¹é½çš„ SIMD 内存æ“作中,最å°çš„对é½å¤§å°åº”该等于 SIMD 寄存器的大å°ã€‚
-
-对于 RapidJSON æ¥è¯´ï¼Œè¿™æ˜¾ç„¶æ˜¯ä¸å¯è¡Œçš„,因为 RapidJSON ä¸åº”当强迫用户进行内存对é½ã€‚
-
-为了修å¤è¿™ä¸ªé—®é¢˜ï¼Œå½“å‰çš„代ç ä¼šå…ˆæŒ‰å­—节处ç†ç›´åˆ°ä¸‹ä¸€ä¸ªå¯¹é½çš„地å€ã€‚在这之åŽï¼Œä½¿ç”¨å¯¹é½è¯»å–æ¥è¿›è¡Œ SIMD 处ç†ã€‚è§ [#85](https://github.com/Tencent/rapidjson/issues/85)。
-
-## 局部æµæ‹·è´ {#LocalStreamCopy}
-
-在优化的过程中,我们å‘现一些编译器ä¸èƒ½å°†è®¿é—®æµçš„一些æˆå‘˜æ•°æ®æ”¾å…¥å±€éƒ¨å˜é‡æˆ–者寄存器中。测试结果显示,对于一些æµç±»åž‹ï¼Œåˆ›å»ºæµçš„æ‹·è´å¹¶å°†å…¶ç”¨äºŽå†…层循环中å¯ä»¥æ”¹å–„æ€§èƒ½ã€‚ä¾‹å¦‚ï¼Œå®žé™…ï¼ˆéž SIMD)的 `SkipWhitespace()` 被实现为:
-
-~~~cpp
-template<typename InputStream>
-void SkipWhitespace(InputStream& is) {
- internal::StreamLocalCopy<InputStream> copy(is);
- InputStream& s(copy.s);
-
- while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
- s.Take();
-}
-~~~
-
-基于æµçš„特å¾ï¼Œ`StreamLocalCopy` 会创建(或ä¸åˆ›å»ºï¼‰æµå¯¹è±¡çš„æ‹·è´ï¼Œåœ¨å±€éƒ¨ä½¿ç”¨å®ƒå¹¶å°†æµçš„状æ€æ‹·è´å›žåŽŸæ¥çš„æµã€‚
-
-## 解æžä¸ºåŒç²¾åº¦æµ®ç‚¹æ•° {#ParsingDouble}
-
-将字符串解æžä¸º `double` 并ä¸ç®€å•ã€‚标准库函数 `strtod()` å¯ä»¥èƒœä»»è¿™é¡¹å·¥ä½œï¼Œä½†å®ƒæ¯”较缓慢。默认情况下,解æžå™¨ä½¿ç”¨é»˜è®¤çš„精度设置。这最多有 3[ULP](http://en.wikipedia.org/wiki/Unit_in_the_last_place) 的误差,并实现在 `internal::StrtodNormalPrecision()` 中。
-
-当使用 `kParseFullPrecisionFlag` 时,编译器会改为调用 `internal::StrtodFullPrecision()` ,这个函数会自动调用三个版本的转æ¢ã€‚
-1. [Fast-Path](http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/)。
-2. [double-conversion](https://github.com/floitsch/double-conversion) 中的自定义 DIY-FP 实现。
-3. (Clinger, William D. How to read floating point numbers accurately. Vol. 25. No. 6. ACM, 1990) 中的大整数算法。
-
-如果第一个转æ¢æ–¹æ³•å¤±è´¥ï¼Œåˆ™å°è¯•ä½¿ç”¨ç¬¬äºŒç§æ–¹æ³•ï¼Œä»¥æ­¤ç±»æŽ¨ã€‚
-
-# 生æˆä¼˜åŒ– {#GenerationOptimization}
-
-## æ•´æ•°åˆ°å­—ç¬¦ä¸²çš„è½¬æ¢ {#itoa}
-
-整数到字符串转æ¢çš„朴素算法需è¦å¯¹æ¯ä¸€ä¸ªå进制ä½è¿›è¡Œä¸€æ¬¡é™¤æ³•ã€‚我们实现了若干版本并在 [itoa-benchmark](https://github.com/miloyip/itoa-benchmark) 中对它们进行了评估。
-
-虽然 SSE2 版本是最快的,但它和第二快的 `branchlut` å·®è·ä¸å¤§ã€‚而且 `branchlut` 是纯C++实现,所以我们在 RapidJSON 中使用了 `branchlut`。
-
-## åŒç²¾åº¦æµ®ç‚¹æ•°åˆ°å­—ç¬¦ä¸²çš„è½¬æ¢ {#dtoa}
-
-åŽŸæ¥ RapidJSON 使用 `snprintf(..., ..., "%g")` æ¥è¿›è¡ŒåŒç²¾åº¦æµ®ç‚¹æ•°åˆ°å­—符串的转æ¢ã€‚这是ä¸å‡†ç¡®çš„,因为默认的精度是6。éšåŽæˆ‘们å‘现它很缓慢,而且有其它的替代å“。
-
-Google çš„ V8 [double-conversion](https://github.com/floitsch/double-conversion
-) 实现了更新的ã€å¿«é€Ÿçš„被称为 Grisu3 的算法(Loitsch, Florian. "Printing floating-point numbers quickly and accurately with integers." ACM Sigplan Notices 45.6 (2010): 233-243.)。
-
-然而,这个实现ä¸æ˜¯ä»…头文件的,所以我们实现了一个仅头文件的 Grisu2 版本。这个算法ä¿è¯äº†ç»“果永远精确。而且在大多数情况下,它会生æˆæœ€çŸ­çš„(å¯é€‰ï¼‰å­—符串表示。
-
-这个仅头文件的转æ¢å‡½æ•°åœ¨ [dtoa-benchmark](https://github.com/miloyip/dtoa-benchmark) 中进行评估。
-
-# 解æžå™¨ {#Parser}
-
-## è¿­ä»£è§£æž {#IterativeParser}
-
-迭代解æžå™¨æ˜¯ä¸€ä¸ªä»¥éžé€’å½’æ–¹å¼å®žçŽ°çš„递归下é™çš„ LL(1) 解æžå™¨ã€‚
-
-### 语法 {#IterativeParserGrammar}
-
-解æžå™¨ä½¿ç”¨çš„语法是基于严格 JSON 语法的:
-~~~~~~~~~~
-S -> array | object
-array -> [ values ]
-object -> { members }
-values -> non-empty-values | ε
-non-empty-values -> value addition-values
-addition-values -> ε | , non-empty-values
-members -> non-empty-members | ε
-non-empty-members -> member addition-members
-addition-members -> ε | , non-empty-members
-member -> STRING : value
-value -> STRING | NUMBER | NULL | BOOLEAN | object | array
-~~~~~~~~~~
-
-注æ„到左因å­è¢«åŠ å…¥äº†éžç»ˆç»“符的 `values` å’Œ `members` æ¥ä¿è¯è¯­æ³•æ˜¯ LL(1) 的。
-
-### 解æžè¡¨ {#IterativeParserParsingTable}
-
-基于这份语法,我们å¯ä»¥æž„造 FIRST å’Œ FOLLOW 集åˆã€‚
-
-éžç»ˆç»“符的 FIRST 集åˆå¦‚下所示:
-
-| NON-TERMINAL | FIRST |
-|:-----------------:|:--------------------------------:|
-| array | [ |
-| object | { |
-| values | ε STRING NUMBER NULL BOOLEAN { [ |
-| addition-values | ε COMMA |
-| members | ε STRING |
-| addition-members | ε COMMA |
-| member | STRING |
-| value | STRING NUMBER NULL BOOLEAN { [ |
-| S | [ { |
-| non-empty-members | STRING |
-| non-empty-values | STRING NUMBER NULL BOOLEAN { [ |
-
-FOLLOW 集åˆå¦‚下所示:
-
-| NON-TERMINAL | FOLLOW |
-|:-----------------:|:-------:|
-| S | $ |
-| array | , $ } ] |
-| object | , $ } ] |
-| values | ] |
-| non-empty-values | ] |
-| addition-values | ] |
-| members | } |
-| non-empty-members | } |
-| addition-members | } |
-| member | , } |
-| value | , } ] |
-
-最终å¯ä»¥ä»Ž FIRST å’Œ FOLLOW 集åˆç”Ÿæˆè§£æžè¡¨ï¼š
-
-| NON-TERMINAL | [ | { | , | : | ] | } | STRING | NUMBER | NULL | BOOLEAN |
-|:-----------------:|:---------------------:|:---------------------:|:-------------------:|:-:|:-:|:-:|:-----------------------:|:---------------------:|:---------------------:|:---------------------:|
-| S | array | object | | | | | | | | |
-| array | [ values ] | | | | | | | | | |
-| object | | { members } | | | | | | | | |
-| values | non-empty-values | non-empty-values | | | ε | | non-empty-values | non-empty-values | non-empty-values | non-empty-values |
-| non-empty-values | value addition-values | value addition-values | | | | | value addition-values | value addition-values | value addition-values | value addition-values |
-| addition-values | | | , non-empty-values | | ε | | | | | |
-| members | | | | | | ε | non-empty-members | | | |
-| non-empty-members | | | | | | | member addition-members | | | |
-| addition-members | | | , non-empty-members | | | ε | | | | |
-| member | | | | | | | STRING : value | | | |
-| value | array | object | | | | | STRING | NUMBER | NULL | BOOLEAN |
-
-对于上é¢çš„语法分æžï¼Œè¿™é‡Œæœ‰ä¸€ä¸ªå¾ˆæ£’çš„[工具](http://hackingoff.com/compilers/predict-first-follow-set)。
-
-### 实现 {#IterativeParserImplementation}
-
-基于这份解æžè¡¨ï¼Œä¸€ä¸ªç›´æŽ¥çš„(常规的)将规则åå‘入栈的实现å¯ä»¥æ­£å¸¸å·¥ä½œã€‚
-
-在 RapidJSON 中,对直接的实现进行了一些修改:
-
-首先,在 RapidJSON 中,这份解æžè¡¨è¢«ç¼–ç ä¸ºçŠ¶æ€æœºã€‚
-规则由头部和主体组æˆã€‚
-状æ€è½¬æ¢ç”±è§„则构造。
-除此之外,é¢å¤–的状æ€è¢«æ·»åŠ åˆ°ä¸Ž `array` å’Œ `object` 有关的规则。
-通过这ç§æ–¹å¼ï¼Œç”Ÿæˆæ•°ç»„值或对象æˆå‘˜å¯ä»¥åªç”¨ä¸€æ¬¡çŠ¶æ€è½¬ç§»ä¾¿å¯å®Œæˆï¼Œ
-而ä¸éœ€è¦åœ¨ç›´æŽ¥çš„实现中的多次出栈/入栈æ“作。
-这也使得估计栈的大å°æ›´åŠ å®¹æ˜“。
-
-状æ€å›¾å¦‚如下所示:
-
-![状æ€å›¾](diagram/iterative-parser-states-diagram.png)
-
-第二,迭代解æžå™¨ä¹Ÿåœ¨å†…部栈ä¿å­˜äº†æ•°ç»„的值个数和对象æˆå‘˜çš„æ•°é‡ï¼Œè¿™ä¹Ÿä¸Žä¼ ç»Ÿçš„实现ä¸åŒã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.png b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.png
deleted file mode 100644
index b3b2f80ccb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.svg b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.svg
deleted file mode 100644
index 9708d5a06f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/logo/rapidjson.svg
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="217.15039"
- height="60.831055"
- id="svg2"
- version="1.1"
- inkscape:version="0.48.4 r9939"
- sodipodi:docname="rapidjson.svg">
- <defs
- id="defs4">
- <linearGradient
- id="linearGradient3801">
- <stop
- style="stop-color:#000000;stop-opacity:1;"
- offset="0"
- id="stop3803" />
- <stop
- style="stop-color:#000000;stop-opacity:0;"
- offset="1"
- id="stop3805" />
- </linearGradient>
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3801"
- id="linearGradient3807"
- x1="81.25"
- y1="52.737183"
- x2="122.25"
- y2="52.737183"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.2378503,0,0,1.1662045,-226.99279,64.427324)" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3801"
- id="linearGradient3935"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(-1.4768835,0,0,2.2904698,246.48785,81.630301)"
- x1="81.25"
- y1="52.737183"
- x2="115.96579"
- y2="48.439766" />
- <linearGradient
- inkscape:collect="always"
- xlink:href="#linearGradient3801"
- id="linearGradient3947"
- gradientUnits="userSpaceOnUse"
- gradientTransform="matrix(1.2378503,0,0,1.1662045,-226.99279,-10.072676)"
- x1="81.25"
- y1="52.737183"
- x2="122.25"
- y2="52.737183" />
- </defs>
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="2"
- inkscape:cx="207.8959"
- inkscape:cy="-3.2283687"
- inkscape:document-units="px"
- inkscape:current-layer="layer1"
- showgrid="false"
- inkscape:window-width="1920"
- inkscape:window-height="1137"
- inkscape:window-x="-8"
- inkscape:window-y="-8"
- inkscape:window-maximized="1"
- fit-margin-top="10"
- fit-margin-left="10"
- fit-margin-right="10"
- fit-margin-bottom="10" />
- <metadata
- id="metadata7">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(-39.132812,-38.772339)">
- <text
- sodipodi:linespacing="125%"
- id="text3939"
- y="79.862183"
- x="147.5"
- style="font-size:20px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Microsoft JhengHei;-inkscape-font-specification:Microsoft JhengHei"
- xml:space="preserve"><tspan
- style="font-size:48px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Inconsolata;-inkscape-font-specification:Inconsolata"
- y="79.862183"
- x="147.5"
- id="tspan3941"
- sodipodi:role="line"><tspan
- id="tspan3943"
- style="font-size:42px;font-style:oblique;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;writing-mode:lr-tb;text-anchor:middle;font-family:Segoe UI;-inkscape-font-specification:Segoe UI Oblique">Rapid</tspan><tspan
- id="tspan3945"
- style="font-weight:bold;-inkscape-font-specification:Inconsolata Bold">JSON</tspan></tspan></text>
- </g>
-</svg>
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/DoxygenLayout.xml b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/DoxygenLayout.xml
deleted file mode 100644
index b7c958665b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/DoxygenLayout.xml
+++ /dev/null
@@ -1,194 +0,0 @@
-<doxygenlayout version="1.0">
- <!-- Generated by doxygen 1.8.7 -->
- <!-- Navigation index tabs for HTML output -->
- <navindex>
- <tab type="mainpage" visible="yes" title=""/>
- <tab type="pages" visible="yes" title="" intro=""/>
- <tab type="modules" visible="yes" title="" intro=""/>
- <tab type="namespaces" visible="yes" title="">
- <tab type="namespacelist" visible="yes" title="" intro=""/>
- <tab type="namespacemembers" visible="yes" title="" intro=""/>
- </tab>
- <tab type="classes" visible="yes" title="">
- <tab type="classlist" visible="yes" title="" intro=""/>
- <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/>
- <tab type="hierarchy" visible="yes" title="" intro=""/>
- <tab type="classmembers" visible="yes" title="" intro=""/>
- </tab>
- <tab type="files" visible="yes" title="">
- <tab type="filelist" visible="yes" title="" intro=""/>
- <tab type="globals" visible="yes" title="" intro=""/>
- </tab>
- <tab type="examples" visible="yes" title="" intro=""/>
- </navindex>
-
- <!-- Layout definition for a class page -->
- <class>
- <briefdescription visible="yes"/>
- <includes visible="$SHOW_INCLUDE_FILES"/>
- <inheritancegraph visible="$CLASS_GRAPH"/>
- <collaborationgraph visible="$COLLABORATION_GRAPH"/>
- <memberdecl>
- <nestedclasses visible="yes" title=""/>
- <publictypes title=""/>
- <services title=""/>
- <interfaces title=""/>
- <publicslots title=""/>
- <signals title=""/>
- <publicmethods title=""/>
- <publicstaticmethods title=""/>
- <publicattributes title=""/>
- <publicstaticattributes title=""/>
- <protectedtypes title=""/>
- <protectedslots title=""/>
- <protectedmethods title=""/>
- <protectedstaticmethods title=""/>
- <protectedattributes title=""/>
- <protectedstaticattributes title=""/>
- <packagetypes title=""/>
- <packagemethods title=""/>
- <packagestaticmethods title=""/>
- <packageattributes title=""/>
- <packagestaticattributes title=""/>
- <properties title=""/>
- <events title=""/>
- <privatetypes title=""/>
- <privateslots title=""/>
- <privatemethods title=""/>
- <privatestaticmethods title=""/>
- <privateattributes title=""/>
- <privatestaticattributes title=""/>
- <friends title=""/>
- <related title="" subtitle=""/>
- <membergroups visible="yes"/>
- </memberdecl>
- <detaileddescription title=""/>
- <memberdef>
- <inlineclasses title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <services title=""/>
- <interfaces title=""/>
- <constructors title=""/>
- <functions title=""/>
- <related title=""/>
- <variables title=""/>
- <properties title=""/>
- <events title=""/>
- </memberdef>
- <allmemberslink visible="yes"/>
- <usedfiles visible="$SHOW_USED_FILES"/>
- <authorsection visible="yes"/>
- </class>
-
- <!-- Layout definition for a namespace page -->
- <namespace>
- <briefdescription visible="yes"/>
- <memberdecl>
- <nestednamespaces visible="yes" title=""/>
- <constantgroups visible="yes" title=""/>
- <classes visible="yes" title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- <membergroups visible="yes"/>
- </memberdecl>
- <detaileddescription title=""/>
- <memberdef>
- <inlineclasses title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- </memberdef>
- <authorsection visible="yes"/>
- </namespace>
-
- <!-- Layout definition for a file page -->
- <file>
- <briefdescription visible="yes"/>
- <includes visible="$SHOW_INCLUDE_FILES"/>
- <includegraph visible="$INCLUDE_GRAPH"/>
- <includedbygraph visible="$INCLUDED_BY_GRAPH"/>
- <sourcelink visible="yes"/>
- <memberdecl>
- <classes visible="yes" title=""/>
- <namespaces visible="yes" title=""/>
- <constantgroups visible="yes" title=""/>
- <defines title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- <membergroups visible="yes"/>
- </memberdecl>
- <detaileddescription title=""/>
- <memberdef>
- <inlineclasses title=""/>
- <defines title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <functions title=""/>
- <variables title=""/>
- </memberdef>
- <authorsection/>
- </file>
-
- <!-- Layout definition for a group page -->
- <group>
- <briefdescription visible="yes"/>
- <groupgraph visible="$GROUP_GRAPHS"/>
- <memberdecl>
- <nestedgroups visible="yes" title=""/>
- <dirs visible="yes" title=""/>
- <files visible="yes" title=""/>
- <namespaces visible="yes" title=""/>
- <classes visible="yes" title=""/>
- <defines title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <enumvalues title=""/>
- <functions title=""/>
- <variables title=""/>
- <signals title=""/>
- <publicslots title=""/>
- <protectedslots title=""/>
- <privateslots title=""/>
- <events title=""/>
- <properties title=""/>
- <friends title=""/>
- <membergroups visible="yes"/>
- </memberdecl>
- <detaileddescription title=""/>
- <memberdef>
- <pagedocs/>
- <inlineclasses title=""/>
- <defines title=""/>
- <typedefs title=""/>
- <enums title=""/>
- <enumvalues title=""/>
- <functions title=""/>
- <variables title=""/>
- <signals title=""/>
- <publicslots title=""/>
- <protectedslots title=""/>
- <privateslots title=""/>
- <events title=""/>
- <properties title=""/>
- <friends title=""/>
- </memberdef>
- <authorsection visible="yes"/>
- </group>
-
- <!-- Layout definition for a directory page -->
- <directory>
- <briefdescription visible="yes"/>
- <directorygraph visible="yes"/>
- <memberdecl>
- <dirs visible="yes"/>
- <files visible="yes"/>
- </memberdecl>
- <detaileddescription title=""/>
- </directory>
-</doxygenlayout>
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/doxygenextra.css b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/doxygenextra.css
deleted file mode 100644
index bd6737585b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/doxygenextra.css
+++ /dev/null
@@ -1,274 +0,0 @@
-body code {
- margin: 0;
- border: 1px solid #ddd;
- background-color: #f8f8f8;
- border-radius: 3px;
- padding: 0;
-}
-
-a {
- color: #4183c4;
-}
-
-a.el {
- font-weight: normal;
-}
-
-body, table, div, p, dl {
- color: #333333;
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- font-size: 15px;
- font-style: normal;
- font-variant: normal;
- font-weight: normal;
- line-height: 25.5px;
-}
-
-body {
- background-color: #eee;
-}
-
-div.header {
- background-image: none;
- background-color: white;
- margin: 0px;
- border: 0px;
-}
-
-div.headertitle {
- width: 858px;
- margin: 30px;
- padding: 0px;
-}
-
-div.toc {
- background-color: #f8f8f8;
- border-color: #ddd;
- margin-right: 10px;
- margin-left: 20px;
-}
-div.toc h3 {
- color: #333333;
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- font-size: 18px;
- font-style: normal;
- font-variant: normal;
- font-weight: normal;
-}
-div.toc li {
- color: #333333;
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- font-size: 12px;
- font-style: normal;
- font-variant: normal;
- font-weight: normal;
-}
-
-.title {
- font-size: 2.5em;
- line-height: 63.75px;
- border-bottom: 1px solid #ddd;
- margin-bottom: 15px;
- margin-left: 0px;
- margin-right: 0px;
- margin-top: 0px;
-}
-
-.summary {
- float: none !important;
- width: auto !important;
- padding-top: 10px;
- padding-right: 10px !important;
-}
-
-.summary + .headertitle .title {
- font-size: 1.5em;
- line-height: 2.0em;
-}
-
-body h1 {
- font-size: 2em;
- line-height: 1.7;
- border-bottom: 1px solid #eee;
- margin: 1em 0 15px;
- padding: 0;
- overflow: hidden;
-}
-
-body h2 {
- font-size: 1.5em;
- line-height: 1.7;
- margin: 1em 0 15px;
- padding: 0;
-}
-
-pre.fragment {
- font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
- font-size: 13px;
- font-style: normal;
- font-variant: normal;
- font-weight: normal;
- line-height: 19px;
-}
-
-table.doxtable th {
- background-color: #f8f8f8;
- color: #333333;
- font-size: 15px;
-}
-
-table.doxtable td, table.doxtable th {
- border: 1px solid #ddd;
-}
-
-#doc-content {
- background-color: #fff;
- width: 918px;
- height: auto !important;
- margin-left: 270px !important;
-}
-
-div.contents {
- width: 858px;
- margin: 30px;
-}
-
-div.line {
- font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
- font-size: 13px;
- font-style: normal;
- font-variant: normal;
- font-weight: normal;
- line-height: 19px;
-}
-
-tt, code, pre {
- font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
- font-size: 12px;
-}
-
-div.fragment {
- background-color: #f8f8f8;
- border: 1px solid #ddd;
- font-size: 13px;
- line-height: 19px;
- overflow: auto;
- padding: 6px 10px;
- border-radius: 3px;
-}
-
-#topbanner {
- position: fixed;
- margin: 15px;
- z-index: 101;
-}
-
-#projectname
-{
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- font-size: 38px;
- font-weight: bold;
- line-height: 63.75px;
- margin: 0px;
- padding: 2px 0px;
-}
-
-#projectbrief
-{
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- font-size: 16px;
- line-height: 22.4px;
- margin: 0px 0px 13px 0px;
- padding: 2px;
-}
-
-/* side bar and search */
-
-#side-nav
-{
- padding: 10px 0px 20px 20px;
- border-top: 60px solid #2980b9;
- background-color: #343131;
- width: 250px !important;
- height: 100% !important;
- position: fixed;
-}
-
-#nav-tree
-{
- background-color: transparent;
- background-image: none;
- height: 100% !important;
-}
-
-#nav-tree .label
-{
- font-family: Helvetica, arial, freesans, clean, sans-serif, 'Segoe UI Emoji', 'Segoe UI Symbol';
- line-height: 25.5px;
- font-size: 15px;
-}
-
-#nav-tree
-{
- color: #b3b3b3;
-}
-
-#nav-tree .selected {
- background-image: none;
-}
-
-#nav-tree a
-{
- color: #b3b3b3;
-}
-
-#github
-{
- position: fixed;
- left: auto;
- right: auto;
- width: 250px;
-}
-
-#MSearchBox
-{
- margin: 20px;
- left: 40px;
- right: auto;
- position: fixed;
- width: 180px;
-}
-
-#MSearchField
-{
- width: 121px;
-}
-
-#MSearchResultsWindow
-{
- left: 45px !important;
-}
-
-#nav-sync
-{
- display: none;
-}
-
-.ui-resizable .ui-resizable-handle
-{
- width: 0px;
-}
-
-#nav-path
-{
- display: none;
-}
-
-/* external link icon */
-div.contents a[href ^= "http"]:after {
- content: " " url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAVklEQVR4Xn3PgQkAMQhDUXfqTu7kTtkpd5RA8AInfArtQ2iRXFWT2QedAfttj2FsPIOE1eCOlEuoWWjgzYaB/IkeGOrxXhqB+uA9Bfcm0lAZuh+YIeAD+cAqSz4kCMUAAAAASUVORK5CYII=);
-}
-
-.githublogo {
- content: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyRpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNS1jMDIxIDc5LjE1NDkxMSwgMjAxMy8xMC8yOS0xMTo0NzoxNiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RERCMUIwOUY4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RERCMUIwOUU4NkNFMTFFM0FBNTJFRTMzNTJEMUJDNDYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoTWFjaW50b3NoKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOkU1MTc4QTJBOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkU1MTc4QTJCOTlBMDExRTI5QTE1QkMxMDQ2QTg5MDREIi8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+jUqS1wAAApVJREFUeNq0l89rE1EQx3e3gVJoSPzZeNEWPKgHoa0HBak0iHiy/4C3WvDmoZ56qJ7txVsPQu8qlqqHIhRKJZceesmhioQEfxTEtsoSpdJg1u/ABJ7Pmc1m8zLwgWTmzcw3L+/te+tHUeQltONgCkyCi2AEDHLsJ6iBMlgHL8FeoqokoA2j4CloRMmtwTmj7erHBXPgCWhG6a3JNXKdCiDl1cidVbXZkJoXQRi5t5BrxwoY71FzU8S4JuAIqFkJ2+BFSlEh525b/hr3+k/AklDkNsf6wTT4yv46KIMNpsy+iMdMc47HNWxbsgVcUn7FmLAzzoFAWDsBx+wVP6bUpp5ewI+DOeUx0Wd9D8F70BTGNjkWtqnhmT1JQAHcUgZd8Lo3rQb1LAT8eJVUfgGvHQigGp+V2Z0iAUUl8QH47kAA1XioxIo+bRN8OG8F/oBjwv+Z1nJgX5jpdzQDw0LCjsPmrcW7I/iHScCAEDj03FtD8A0EyuChHgg4KTlJQF3wZ7WELppnBX+dBFSVpJsOBWi1qiRgSwnOgoyD5hmuJdkWCVhTgnTvW3AgYIFrSbZGh0UW/Io5Vp+DQoK7o80pztWMemZbgxeNwCNwDbw1fIfgGZjhU6xPaJgBV8BdsMw5cbZoHsenwYFxkZzl83xTSKTiviCAfCsJLysH3POfC8m8NegyGAGfLP/VmGmfSChgXroR0RSWjEFv2J/nG84cuKFMf4sTCZqXuJd4KaXFVjEG3+tw4eXbNK/YC9oXXs3O8NY8y99L4BXY5cvLY/Bb2VZ58EOJVcB18DHJq9lRsKr8inyKGVjlmh29mtHs3AHfuhCwy1vXT/Nu2GKQt+UHsGdctyX6eQyNvc+5sfX9Dl7Pe2J/BRgAl2CpwmrsHR0AAAAASUVORK5CYII=);
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/footer.html b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/footer.html
deleted file mode 100644
index 77f1131188..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/footer.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!-- HTML footer for doxygen 1.8.7-->
-<!-- start footer part -->
-<!--BEGIN GENERATE_TREEVIEW-->
-<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- $navpath
- </ul>
-</div>
-<!--END GENERATE_TREEVIEW-->
-</body>
-</html>
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/header.html b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/header.html
deleted file mode 100644
index a89ba46b49..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/misc/header.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!-- HTML header for doxygen 1.8.7-->
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
-<meta http-equiv="X-UA-Compatible" content="IE=9"/>
-<meta name="generator" content="Doxygen $doxygenversion"/>
-<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
-<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
-<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
-<script type="text/javascript" src="$relpath^jquery.js"></script>
-<script type="text/javascript" src="$relpath^dynsections.js"></script>
-$treeview
-$search
-$mathjax
-<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
-$extrastylesheet
-</head>
-<body>
-<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
-<div id="topbanner"><a href="https://github.com/Tencent/rapidjson" title="RapidJSON GitHub"><i class="githublogo"></i></a></div>
-$searchbox
-<!--END TITLEAREA-->
-<!-- end header part -->
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/npm.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/npm.md
deleted file mode 100644
index 6f4e85ad96..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/npm.md
+++ /dev/null
@@ -1,31 +0,0 @@
-## NPM
-
-# package.json {#package}
-
-~~~~~~~~~~js
-{
- ...
- "dependencies": {
- ...
- "rapidjson": "git@github.com:Tencent/rapidjson.git"
- },
- ...
- "gypfile": true
-}
-~~~~~~~~~~
-
-# binding.gyp {#binding}
-
-~~~~~~~~~~js
-{
- ...
- 'targets': [
- {
- ...
- 'include_dirs': [
- '<!(node -e \'require("rapidjson")\')'
- ]
- }
- ]
-}
-~~~~~~~~~~
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.md
deleted file mode 100644
index 6f9e1bf8b1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# Performance
-
-There is a [native JSON benchmark collection] [1] which evaluates speed, memory usage and code size of various operations among 37 JSON libraries.
-
-[1]: https://github.com/miloyip/nativejson-benchmark
-
-The old performance article for RapidJSON 0.1 is provided [here](https://code.google.com/p/rapidjson/wiki/Performance).
-
-Additionally, you may refer to the following third-party benchmarks.
-
-## Third-party benchmarks
-
-* [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013)
- * [casablanca](https://casablanca.codeplex.com/)
- * [json_spirit](https://github.com/cierelabs/json_spirit)
- * [jsoncpp](http://jsoncpp.sourceforge.net/)
- * [libjson](http://sourceforge.net/projects/libjson/)
- * [rapidjson](https://github.com/Tencent/rapidjson/)
- * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html)
-
-* [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013)
- * [sajson](https://github.com/chadaustin/sajson)
- * [rapidjson](https://github.com/Tencent/rapidjson/)
- * [vjson](https://code.google.com/p/vjson/)
- * [YAJL](http://lloyd.github.com/yajl/)
- * [Jansson](http://www.digip.org/jansson/)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.zh-cn.md
deleted file mode 100644
index 2322c9c490..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/performance.zh-cn.md
+++ /dev/null
@@ -1,26 +0,0 @@
-# 性能
-
-有一个 [native JSON benchmark collection][1] 项目,能评估 37 个 JSON 库在ä¸åŒæ“作下的速度ã€å…§å­˜ç”¨é‡åŠä»£ç å¤§å°ã€‚
-
-[1]: https://github.com/miloyip/nativejson-benchmark
-
-RapidJSON 0.1 版本的性能测试文章ä½äºŽ [这里](https://code.google.com/p/rapidjson/wiki/Performance).
-
-此外,你也å¯ä»¥å‚考以下这些第三方的评测。
-
-## 第三方评测
-
-* [Basic benchmarks for miscellaneous C++ JSON parsers and generators](https://github.com/mloskot/json_benchmark) by Mateusz Loskot (Jun 2013)
- * [casablanca](https://casablanca.codeplex.com/)
- * [json_spirit](https://github.com/cierelabs/json_spirit)
- * [jsoncpp](http://jsoncpp.sourceforge.net/)
- * [libjson](http://sourceforge.net/projects/libjson/)
- * [rapidjson](https://github.com/Tencent/rapidjson/)
- * [QJsonDocument](http://qt-project.org/doc/qt-5.0/qtcore/qjsondocument.html)
-
-* [JSON Parser Benchmarking](http://chadaustin.me/2013/01/json-parser-benchmarking/) by Chad Austin (Jan 2013)
- * [sajson](https://github.com/chadaustin/sajson)
- * [rapidjson](https://github.com/Tencent/rapidjson/)
- * [vjson](https://code.google.com/p/vjson/)
- * [YAJL](http://lloyd.github.com/yajl/)
- * [Jansson](http://www.digip.org/jansson/)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.md
deleted file mode 100644
index 9a0e5ca03a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.md
+++ /dev/null
@@ -1,234 +0,0 @@
-# Pointer
-
-(This feature was released in v1.1.0)
-
-JSON Pointer is a standardized ([RFC6901]) way to select a value inside a JSON Document (DOM). This can be analogous to XPath for XML document. However, JSON Pointer is much simpler, and a single JSON Pointer only pointed to a single value.
-
-Using RapidJSON's implementation of JSON Pointer can simplify some manipulations of the DOM.
-
-[TOC]
-
-# JSON Pointer {#JsonPointer}
-
-A JSON Pointer is a list of zero-to-many tokens, each prefixed by `/`. Each token can be a string or a number. For example, given a JSON:
-~~~javascript
-{
- "foo" : ["bar", "baz"],
- "pi" : 3.1416
-}
-~~~
-
-The following JSON Pointers resolve this JSON as:
-
-1. `"/foo"` → `[ "bar", "baz" ]`
-2. `"/foo/0"` → `"bar"`
-3. `"/foo/1"` → `"baz"`
-4. `"/pi"` → `3.1416`
-
-Note that, an empty JSON Pointer `""` (zero token) resolves to the whole JSON.
-
-# Basic Usage {#BasicUsage}
-
-The following example code is self-explanatory.
-
-~~~cpp
-#include "rapidjson/pointer.h"
-
-// ...
-Document d;
-
-// Create DOM by Set()
-Pointer("/project").Set(d, "RapidJSON");
-Pointer("/stars").Set(d, 10);
-
-// { "project" : "RapidJSON", "stars" : 10 }
-
-// Access DOM by Get(). It return nullptr if the value does not exist.
-if (Value* stars = Pointer("/stars").Get(d))
- stars->SetInt(stars->GetInt() + 1);
-
-// { "project" : "RapidJSON", "stars" : 11 }
-
-// Set() and Create() automatically generate parents if not exist.
-Pointer("/a/b/0").Create(d);
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] } }
-
-// GetWithDefault() returns reference. And it deep clones the default value.
-Value& hello = Pointer("/hello").GetWithDefault(d, "world");
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "world" }
-
-// Swap() is similar to Set()
-Value x("C++");
-Pointer("/hello").Swap(d, x);
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "C++" }
-// x becomes "world"
-
-// Erase a member or element, return true if the value exists
-bool success = Pointer("/a").Erase(d);
-assert(success);
-
-// { "project" : "RapidJSON", "stars" : 10 }
-~~~
-
-# Helper Functions {#HelperFunctions}
-
-Since object-oriented calling convention may be non-intuitive, RapidJSON also provides helper functions, which just wrap the member functions with free-functions.
-
-The following example does exactly the same as the above one.
-
-~~~cpp
-Document d;
-
-SetValueByPointer(d, "/project", "RapidJSON");
-SetValueByPointer(d, "/stars", 10);
-
-if (Value* stars = GetValueByPointer(d, "/stars"))
- stars->SetInt(stars->GetInt() + 1);
-
-CreateValueByPointer(d, "/a/b/0");
-
-Value& hello = GetValueByPointerWithDefault(d, "/hello", "world");
-
-Value x("C++");
-SwapValueByPointer(d, "/hello", x);
-
-bool success = EraseValueByPointer(d, "/a");
-assert(success);
-~~~
-
-The conventions are shown here for comparison:
-
-1. `Pointer(source).<Method>(root, ...)`
-2. `<Method>ValueByPointer(root, Pointer(source), ...)`
-3. `<Method>ValueByPointer(root, source, ...)`
-
-# Resolving Pointer {#ResolvingPointer}
-
-`Pointer::Get()` or `GetValueByPointer()` function does not modify the DOM. If the tokens cannot match a value in the DOM, it returns `nullptr`. User can use this to check whether a value exists.
-
-Note that, numerical tokens can represent an array index or member name. The resolving process will match the values according to the types of value.
-
-~~~javascript
-{
- "0" : 123,
- "1" : [456]
-}
-~~~
-
-1. `"/0"` → `123`
-2. `"/1/0"` → `456`
-
-The token `"0"` is treated as member name in the first pointer. It is treated as an array index in the second pointer.
-
-The other functions, including `Create()`, `GetWithDefault()`, `Set()` and `Swap()`, will change the DOM. These functions will always succeed. They will create the parent values if they do not exist. If the parent values do not match the tokens, they will also be forced to change their type. Changing the type also mean fully removal of that DOM subtree.
-
-Parsing the above JSON into `d`,
-
-~~~cpp
-SetValueByPointer(d, "1/a", 789); // { "0" : 123, "1" : { "a" : 789 } }
-~~~
-
-## Resolving Minus Sign Token
-
-Besides, [RFC6901] defines a special token `-` (single minus sign), which represents the pass-the-end element of an array. `Get()` only treats this token as a member name '"-"'. Yet the other functions can resolve this for array, equivalent to calling `Value::PushBack()` to the array.
-
-~~~cpp
-Document d;
-d.Parse("{\"foo\":[123]}");
-SetValueByPointer(d, "/foo/-", 456); // { "foo" : [123, 456] }
-SetValueByPointer(d, "/-", 789); // { "foo" : [123, 456], "-" : 789 }
-~~~
-
-## Resolving Document and Value
-
-When using `p.Get(root)` or `GetValueByPointer(root, p)`, `root` is a (const) `Value&`. That means, it can be a subtree of the DOM.
-
-The other functions have two groups of signature. One group uses `Document& document` as parameter, another one uses `Value& root`. The first group uses `document.GetAllocator()` for creating values. And the second group needs user to supply an allocator, like the functions in DOM.
-
-All examples above do not require an allocator parameter, because the first parameter is a `Document&`. But if you want to resolve a pointer to a subtree, you need to supply the allocator as in the following example:
-
-~~~cpp
-class Person {
-public:
- Person() {
- document_ = new Document();
- // CreateValueByPointer() here no need allocator
- SetLocation(CreateValueByPointer(*document_, "/residence"), ...);
- SetLocation(CreateValueByPointer(*document_, "/office"), ...);
- };
-
-private:
- void SetLocation(Value& location, const char* country, const char* addresses[2]) {
- Value::Allocator& a = document_->GetAllocator();
- // SetValueByPointer() here need allocator
- SetValueByPointer(location, "/country", country, a);
- SetValueByPointer(location, "/address/0", address[0], a);
- SetValueByPointer(location, "/address/1", address[1], a);
- }
-
- // ...
-
- Document* document_;
-};
-~~~
-
-`Erase()` or `EraseValueByPointer()` does not need allocator. And they return `true` if the value is erased successfully.
-
-# Error Handling {#ErrorHandling}
-
-A `Pointer` parses a source string in its constructor. If there is parsing error, `Pointer::IsValid()` returns `false`. And you can use `Pointer::GetParseErrorCode()` and `GetParseErrorOffset()` to retrieve the error information.
-
-Note that, all resolving functions assumes valid pointer. Resolving with an invalid pointer causes assertion failure.
-
-# URI Fragment Representation {#URIFragment}
-
-In addition to the string representation of JSON pointer that we are using till now, [RFC6901] also defines the URI fragment representation of JSON pointer. URI fragment is specified in [RFC3986] "Uniform Resource Identifier (URI): Generic Syntax".
-
-The main differences are that a the URI fragment always has a `#` (pound sign) in the beginning, and some characters are encoded by percent-encoding in UTF-8 sequence. For example, the following table shows different C/C++ string literals of different representations.
-
-String Representation | URI Fragment Representation | Pointer Tokens (UTF-8)
-----------------------|-----------------------------|------------------------
-`"/foo/0"` | `"#/foo/0"` | `{"foo", 0}`
-`"/a~1b"` | `"#/a~1b"` | `{"a/b"}`
-`"/m~0n"` | `"#/m~0n"` | `{"m~n"}`
-`"/ "` | `"#/%20"` | `{" "}`
-`"/\0"` | `"#/%00"` | `{"\0"}`
-`"/€"` | `"#/%E2%82%AC"` | `{"€"}`
-
-RapidJSON fully support URI fragment representation. It automatically detects the pound sign during parsing.
-
-# Stringify
-
-You may also stringify a `Pointer` to a string or other output streams. This can be done by:
-
-~~~
-Pointer p(...);
-StringBuffer sb;
-p.Stringify(sb);
-std::cout << sb.GetString() << std::endl;
-~~~
-
-It can also stringify to URI fragment representation by `StringifyUriFragment()`.
-
-# User-Supplied Tokens {#UserSuppliedTokens}
-
-If a pointer will be resolved multiple times, it should be constructed once, and then apply it to different DOMs or in different times. This reduce time and memory allocation for constructing `Pointer` multiple times.
-
-We can go one step further, to completely eliminate the parsing process and dynamic memory allocation, we can establish the token array directly:
-
-~~~cpp
-#define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
-#define INDEX(i) { #i, sizeof(#i) - 1, i }
-
-static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
-static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
-// Equivalent to static const Pointer p("/foo/123");
-~~~
-
-This may be useful for memory constrained systems.
-
-[RFC3986]: https://tools.ietf.org/html/rfc3986
-[RFC6901]: https://tools.ietf.org/html/rfc6901
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.zh-cn.md
deleted file mode 100644
index 239569d4a0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/pointer.zh-cn.md
+++ /dev/null
@@ -1,234 +0,0 @@
-# Pointer
-
-(本功能于 v1.1.0 å‘布)
-
-JSON Pointer 是一个标准化([RFC6901])的方å¼åŽ»é€‰å–一个 JSON Document(DOM)中的值。这类似于 XML çš„ XPath。然而,JSON Pointer 简å•å¾—多,而且æ¯ä¸ª JSON Pointer 仅指å‘å•ä¸ªå€¼ã€‚
-
-使用 RapidJSON çš„ JSON Pointer 实现能简化一些 DOM çš„æ“作。
-
-[TOC]
-
-# JSON Pointer {#JsonPointer}
-
-一个 JSON Pointer 由一串(零至多个)token 所组æˆï¼Œæ¯ä¸ª token 都有 `/` å‰ç¼€ã€‚æ¯ä¸ª token å¯ä»¥æ˜¯ä¸€ä¸ªå­—符串或数字。例如,给定一个 JSON:
-~~~javascript
-{
- "foo" : ["bar", "baz"],
- "pi" : 3.1416
-}
-~~~
-
-以下的 JSON Pointer 解æžä¸ºï¼š
-
-1. `"/foo"` → `[ "bar", "baz" ]`
-2. `"/foo/0"` → `"bar"`
-3. `"/foo/1"` → `"baz"`
-4. `"/pi"` → `3.1416`
-
-è¦æ³¨æ„,一个空 JSON Pointer `""` (零个 token)解æžä¸ºæ•´ä¸ª JSON。
-
-# 基本使用方法 {#BasicUsage}
-
-以下的代ç èŒƒä¾‹ä¸è§£è‡ªæ˜Žã€‚
-
-~~~cpp
-#include "rapidjson/pointer.h"
-
-// ...
-Document d;
-
-// 使用 Set() 创建 DOM
-Pointer("/project").Set(d, "RapidJSON");
-Pointer("/stars").Set(d, 10);
-
-// { "project" : "RapidJSON", "stars" : 10 }
-
-// 使用 Get() 访问 DOM。若该值ä¸å­˜åœ¨åˆ™è¿”回 nullptr。
-if (Value* stars = Pointer("/stars").Get(d))
- stars->SetInt(stars->GetInt() + 1);
-
-// { "project" : "RapidJSON", "stars" : 11 }
-
-// Set() å’Œ Create() 自动生æˆçˆ¶å€¼ï¼ˆå¦‚果它们ä¸å­˜åœ¨ï¼‰ã€‚
-Pointer("/a/b/0").Create(d);
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] } }
-
-// GetWithDefault() 返回引用。若该值ä¸å­˜åœ¨åˆ™ä¼šæ·±æ‹·è´ç¼ºçœå€¼ã€‚
-Value& hello = Pointer("/hello").GetWithDefault(d, "world");
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "world" }
-
-// Swap() 和 Set() 相似
-Value x("C++");
-Pointer("/hello").Swap(d, x);
-
-// { "project" : "RapidJSON", "stars" : 11, "a" : { "b" : [ null ] }, "hello" : "C++" }
-// x å˜æˆ "world"
-
-// 删去一个æˆå‘˜æˆ–元素,若值存在返回 true
-bool success = Pointer("/a").Erase(d);
-assert(success);
-
-// { "project" : "RapidJSON", "stars" : 10 }
-~~~
-
-# 辅助函数 {#HelperFunctions}
-
-由于é¢å‘对象的调用习惯å¯èƒ½ä¸ç¬¦ç›´è§‰ï¼ŒRapidJSON 也æ供了一些辅助函数,它们把æˆå‘˜å‡½æ•°åŒ…装æˆè‡ªç”±å‡½æ•°ã€‚
-
-以下的例å­ä¸Žä¸Šé¢ä¾‹å­æ‰€åšçš„事情完全相åŒã€‚
-
-~~~cpp
-Document d;
-
-SetValueByPointer(d, "/project", "RapidJSON");
-SetValueByPointer(d, "/stars", 10);
-
-if (Value* stars = GetValueByPointer(d, "/stars"))
- stars->SetInt(stars->GetInt() + 1);
-
-CreateValueByPointer(d, "/a/b/0");
-
-Value& hello = GetValueByPointerWithDefault(d, "/hello", "world");
-
-Value x("C++");
-SwapValueByPointer(d, "/hello", x);
-
-bool success = EraseValueByPointer(d, "/a");
-assert(success);
-~~~
-
-以下对比 3 ç§è°ƒç”¨æ–¹å¼ï¼š
-
-1. `Pointer(source).<Method>(root, ...)`
-2. `<Method>ValueByPointer(root, Pointer(source), ...)`
-3. `<Method>ValueByPointer(root, source, ...)`
-
-# è§£æž Pointer {#ResolvingPointer}
-
-`Pointer::Get()` 或 `GetValueByPointer()` 函数并ä¸ä¿®æ”¹ DOM。若那些 token ä¸èƒ½åŒ¹é… DOM 里的值,这些函数便返回 `nullptr`。使用者å¯åˆ©ç”¨è¿™ä¸ªæ–¹æ³•æ¥æ£€æŸ¥ä¸€ä¸ªå€¼æ˜¯å¦å­˜åœ¨ã€‚
-
-注æ„,数值 token å¯è¡¨ç¤ºæ•°ç»„索引或æˆå‘˜å字。解æžè¿‡ç¨‹ä¸­ä¼šæŒ‰å€¼çš„类型æ¥åŒ¹é…。
-
-~~~javascript
-{
- "0" : 123,
- "1" : [456]
-}
-~~~
-
-1. `"/0"` → `123`
-2. `"/1/0"` → `456`
-
-Token `"0"` 在第一个 pointer 中被当作æˆå‘˜å字。它在第二个 pointer 中被当作æˆæ•°ç»„索引。
-
-å…¶ä»–å‡½æ•°ä¼šæ”¹å˜ DOM,包括 `Create()`ã€`GetWithDefault()`ã€`Set()`ã€`Swap()`。这些函数总是æˆåŠŸçš„。若一些父值ä¸å­˜åœ¨ï¼Œå°±ä¼šåˆ›å»ºå®ƒä»¬ã€‚若父值类型ä¸åŒ¹é… token,也会强行改å˜å…¶ç±»åž‹ã€‚改å˜ç±»åž‹ä¹Ÿæ„味ç€å®Œå…¨ç§»é™¤å…¶ DOM å­æ ‘的内容。
-
-例如,把上é¢çš„ JSON 解译至 `d` 之åŽï¼Œ
-
-~~~cpp
-SetValueByPointer(d, "1/a", 789); // { "0" : 123, "1" : { "a" : 789 } }
-~~~
-
-## 解æžè´Ÿå· token
-
-å¦å¤–,[RFC6901] 定义了一个特殊 token `-` (å•ä¸ªè´Ÿå·ï¼‰ï¼Œç”¨äºŽè¡¨ç¤ºæ•°ç»„最åŽå…ƒç´ çš„下一个元素。 `Get()` åªä¼šæŠŠæ­¤ token 当作æˆå‘˜åå­— '"-"'。而其他函数则会以此解æžæ•°ç»„,等åŒäºŽå¯¹æ•°ç»„调用 `Value::PushBack()` 。
-
-~~~cpp
-Document d;
-d.Parse("{\"foo\":[123]}");
-SetValueByPointer(d, "/foo/-", 456); // { "foo" : [123, 456] }
-SetValueByPointer(d, "/-", 789); // { "foo" : [123, 456], "-" : 789 }
-~~~
-
-## è§£æž Document åŠ Value
-
-当使用 `p.Get(root)` 或 `GetValueByPointer(root, p)`,`root` 是一个(常数) `Value&`。这æ„味ç€ï¼Œå®ƒä¹Ÿå¯ä»¥æ˜¯ DOM 里的一个å­æ ‘。
-
-其他函数有两组签å。一组使用 `Document& document` 作为å‚数,å¦ä¸€ç»„使用 `Value& root`。第一组使用 `document.GetAllocator()` 去创建值,而第二组则需è¦ä½¿ç”¨è€…æ供一个 allocatorï¼Œå¦‚åŒ DOM 里的函数。
-
-以上例å­éƒ½ä¸éœ€è¦ allocator å‚数,因为它的第一个å‚数是 `Document&`。但如果你需è¦å¯¹ä¸€ä¸ªå­æ ‘进行解æžï¼Œå°±éœ€è¦å¦‚下é¢çš„例å­èˆ¬æä¾› allocator:
-
-~~~cpp
-class Person {
-public:
- Person() {
- document_ = new Document();
- // CreateValueByPointer() here no need allocator
- SetLocation(CreateValueByPointer(*document_, "/residence"), ...);
- SetLocation(CreateValueByPointer(*document_, "/office"), ...);
- };
-
-private:
- void SetLocation(Value& location, const char* country, const char* addresses[2]) {
- Value::Allocator& a = document_->GetAllocator();
- // SetValueByPointer() here need allocator
- SetValueByPointer(location, "/country", country, a);
- SetValueByPointer(location, "/address/0", address[0], a);
- SetValueByPointer(location, "/address/1", address[1], a);
- }
-
- // ...
-
- Document* document_;
-};
-~~~
-
-`Erase()` 或 `EraseValueByPointer()` ä¸éœ€è¦ allocator。而且它们æˆåŠŸåˆ é™¤å€¼ä¹‹åŽä¼šè¿”回 `true`。
-
-# é”™è¯¯å¤„ç† {#ErrorHandling}
-
-`Pointer` 在其建构函数里会解译æºå­—符串。若有解æžé”™è¯¯ï¼Œ`Pointer::IsValid()` 返回 `false`。你å¯ä½¿ç”¨ `Pointer::GetParseErrorCode()` å’Œ `GetParseErrorOffset()` 去获å–错信æ¯ã€‚
-
-è¦æ³¨æ„的是,所有解æžå‡½æ•°éƒ½å‡è®¾ pointer 是åˆæ³•çš„。对一个éžæ³• pointer 解æžä¼šé€ æˆæ–­è¨€å¤±è´¥ã€‚
-
-# URI ç‰‡æ®µè¡¨ç¤ºæ–¹å¼ {#URIFragment}
-
-除了我们一直在使用的字符串方å¼è¡¨ç¤º JSON pointer,[RFC6901] 也定义了一个 JSON Pointer çš„ URI 片段(fragment)表示方å¼ã€‚URI 片段是定义于 [RFC3986] "Uniform Resource Identifier (URI): Generic Syntax"。
-
-URI 片段的主è¦åˆ†åˆ«æ˜¯å¿…然以 `#` (pound sign)开头,而一些字符也会以百分比编ç æˆ UTF-8 åºåˆ—。例如,以下的表展示了ä¸åŒè¡¨ç¤ºæ³•ä¸‹çš„ C/C++ 字符串常数。
-
-å­—ç¬¦ä¸²è¡¨ç¤ºæ–¹å¼ | URI ç‰‡æ®µè¡¨ç¤ºæ–¹å¼ | Pointer Tokens (UTF-8)
-----------------------|-----------------------------|------------------------
-`"/foo/0"` | `"#/foo/0"` | `{"foo", 0}`
-`"/a~1b"` | `"#/a~1b"` | `{"a/b"}`
-`"/m~0n"` | `"#/m~0n"` | `{"m~n"}`
-`"/ "` | `"#/%20"` | `{" "}`
-`"/\0"` | `"#/%00"` | `{"\0"}`
-`"/€"` | `"#/%E2%82%AC"` | `{"€"}`
-
-RapidJSON å®Œå…¨æ”¯æŒ URI 片段表示方å¼ã€‚它在解译时会自动检测 `#` å·ã€‚
-
-# 字符串化
-
-你也å¯ä»¥æŠŠä¸€ä¸ª `Pointer` 字符串化,储存于字符串或其他输出æµã€‚例如:
-
-~~~
-Pointer p(...);
-StringBuffer sb;
-p.Stringify(sb);
-std::cout << sb.GetString() << std::endl;
-~~~
-
-使用 `StringifyUriFragment()` å¯ä»¥æŠŠ pointer 字符串化为 URI 片段表示法。
-
-# 使用者æ供的 tokens {#UserSuppliedTokens}
-
-若一个 pointer 会用于多次解æžï¼Œå®ƒåº”该åªè¢«åˆ›å»ºä¸€æ¬¡ï¼Œç„¶åŽå†æ–½äºŽä¸åŒçš„ DOM ,或在ä¸åŒæ—¶é—´åšè§£æžã€‚这样å¯ä»¥é¿å…多次创键 `Pointer`,节çœæ—¶é—´å’Œå†…存分é…。
-
-我们甚至å¯ä»¥å†æ›´è¿›ä¸€æ­¥ï¼Œå®Œå…¨æ¶ˆåŽ»è§£æžè¿‡ç¨‹åŠåŠ¨æ€å†…存分é…。我们å¯ä»¥ç›´æŽ¥ç”Ÿæˆ token 数组:
-
-~~~cpp
-#define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
-#define INDEX(i) { #i, sizeof(#i) - 1, i }
-
-static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
-static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
-// Equivalent to static const Pointer p("/foo/123");
-~~~
-
-è¿™ç§åšæ³•å¯èƒ½é€‚åˆå†…å­˜å—é™çš„系统。
-
-[RFC3986]: https://tools.ietf.org/html/rfc3986
-[RFC6901]: https://tools.ietf.org/html/rfc6901
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.md
deleted file mode 100644
index d42d043888..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.md
+++ /dev/null
@@ -1,509 +0,0 @@
-# SAX
-
-The term "SAX" originated from [Simple API for XML](http://en.wikipedia.org/wiki/Simple_API_for_XML). We borrowed this term for JSON parsing and generation.
-
-In RapidJSON, `Reader` (typedef of `GenericReader<...>`) is the SAX-style parser for JSON, and `Writer` (typedef of `GenericWriter<...>`) is the SAX-style generator for JSON.
-
-[TOC]
-
-# Reader {#Reader}
-
-`Reader` parses a JSON from a stream. While it reads characters from the stream, it analyzes the characters according to the syntax of JSON, and publishes events to a handler.
-
-For example, here is a JSON.
-
-~~~~~~~~~~js
-{
- "hello": "world",
- "t": true ,
- "f": false,
- "n": null,
- "i": 123,
- "pi": 3.1416,
- "a": [1, 2, 3, 4]
-}
-~~~~~~~~~~
-
-When a `Reader` parses this JSON, it publishes the following events to the handler sequentially:
-
-~~~~~~~~~~
-StartObject()
-Key("hello", 5, true)
-String("world", 5, true)
-Key("t", 1, true)
-Bool(true)
-Key("f", 1, true)
-Bool(false)
-Key("n", 1, true)
-Null()
-Key("i")
-Uint(123)
-Key("pi")
-Double(3.1416)
-Key("a")
-StartArray()
-Uint(1)
-Uint(2)
-Uint(3)
-Uint(4)
-EndArray(4)
-EndObject(7)
-~~~~~~~~~~
-
-These events can be easily matched with the JSON, but some event parameters need further explanation. Let's see the `simplereader` example which produces exactly the same output as above:
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-struct MyHandler : public BaseReaderHandler<UTF8<>, MyHandler> {
- bool Null() { cout << "Null()" << endl; return true; }
- bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
- bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
- bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
- bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
- bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
- bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
- bool String(const char* str, SizeType length, bool copy) {
- cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool StartObject() { cout << "StartObject()" << endl; return true; }
- bool Key(const char* str, SizeType length, bool copy) {
- cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
- bool StartArray() { cout << "StartArray()" << endl; return true; }
- bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
-};
-
-void main() {
- const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- MyHandler handler;
- Reader reader;
- StringStream ss(json);
- reader.Parse(ss, handler);
-}
-~~~~~~~~~~
-
-Note that RapidJSON uses templates to statically bind the `Reader` type and the handler type, instead of using classes with virtual functions. This paradigm can improve performance by inlining functions.
-
-## Handler {#Handler}
-
-As shown in the previous example, the user needs to implement a handler which consumes the events (via function calls) from the `Reader`. The handler must contain the following member functions.
-
-~~~~~~~~~~cpp
-class Handler {
- bool Null();
- bool Bool(bool b);
- bool Int(int i);
- bool Uint(unsigned i);
- bool Int64(int64_t i);
- bool Uint64(uint64_t i);
- bool Double(double d);
- bool RawNumber(const Ch* str, SizeType length, bool copy);
- bool String(const Ch* str, SizeType length, bool copy);
- bool StartObject();
- bool Key(const Ch* str, SizeType length, bool copy);
- bool EndObject(SizeType memberCount);
- bool StartArray();
- bool EndArray(SizeType elementCount);
-};
-~~~~~~~~~~
-
-`Null()` is called when the `Reader` encounters a JSON null value.
-
-`Bool(bool)` is called when the `Reader` encounters a JSON true or false value.
-
-When the `Reader` encounters a JSON number, it chooses a suitable C++ type mapping. And then it calls *one* function out of `Int(int)`, `Uint(unsigned)`, `Int64(int64_t)`, `Uint64(uint64_t)` and `Double(double)`. If `kParseNumbersAsStrings` is enabled, `Reader` will always calls `RawNumber()` instead.
-
-`String(const char* str, SizeType length, bool copy)` is called when the `Reader` encounters a string. The first parameter is pointer to the string. The second parameter is the length of the string (excluding the null terminator). Note that RapidJSON supports null character `\0` inside a string. If such situation happens, `strlen(str) < length`. The last `copy` indicates whether the handler needs to make a copy of the string. For normal parsing, `copy = true`. Only when *insitu* parsing is used, `copy = false`. And be aware that the character type depends on the target encoding, which will be explained later.
-
-When the `Reader` encounters the beginning of an object, it calls `StartObject()`. An object in JSON is a set of name-value pairs. If the object contains members it first calls `Key()` for the name of member, and then calls functions depending on the type of the value. These calls of name-value pairs repeat until calling `EndObject(SizeType memberCount)`. Note that the `memberCount` parameter is just an aid for the handler; users who do not need this parameter may ignore it.
-
-Arrays are similar to objects, but simpler. At the beginning of an array, the `Reader` calls `BeginArray()`. If there is elements, it calls functions according to the types of element. Similarly, in the last call `EndArray(SizeType elementCount)`, the parameter `elementCount` is just an aid for the handler.
-
-Every handler function returns a `bool`. Normally it should return `true`. If the handler encounters an error, it can return `false` to notify the event publisher to stop further processing.
-
-For example, when we parse a JSON with `Reader` and the handler detects that the JSON does not conform to the required schema, the handler can return `false` and let the `Reader` stop further parsing. This will place the `Reader` in an error state, with error code `kParseErrorTermination`.
-
-## GenericReader {#GenericReader}
-
-As mentioned before, `Reader` is a typedef of a template class `GenericReader`:
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericReader {
- // ...
-};
-
-typedef GenericReader<UTF8<>, UTF8<> > Reader;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-The `Reader` uses UTF-8 as both source and target encoding. The source encoding means the encoding in the JSON stream. The target encoding means the encoding of the `str` parameter in `String()` calls. For example, to parse a UTF-8 stream and output UTF-16 string events, you can define a reader by:
-
-~~~~~~~~~~cpp
-GenericReader<UTF8<>, UTF16<> > reader;
-~~~~~~~~~~
-
-Note that, the default character type of `UTF16` is `wchar_t`. So this `reader` needs to call `String(const wchar_t*, SizeType, bool)` of the handler.
-
-The third template parameter `Allocator` is the allocator type for internal data structure (actually a stack).
-
-## Parsing {#SaxParsing}
-
-The main function of `Reader` is used to parse JSON.
-
-~~~~~~~~~~cpp
-template <unsigned parseFlags, typename InputStream, typename Handler>
-bool Parse(InputStream& is, Handler& handler);
-
-// with parseFlags = kDefaultParseFlags
-template <typename InputStream, typename Handler>
-bool Parse(InputStream& is, Handler& handler);
-~~~~~~~~~~
-
-If an error occurs during parsing, it will return `false`. User can also call `bool HasParseError()`, `ParseErrorCode GetParseErrorCode()` and `size_t GetErrorOffset()` to obtain the error states. In fact, `Document` uses these `Reader` functions to obtain parse errors. Please refer to [DOM](doc/dom.md) for details about parse errors.
-
-## Token-by-Token Parsing {#TokenByTokenParsing}
-
-Some users may wish to parse a JSON input stream a single token at a time, instead of immediately parsing an entire document without stopping. To parse JSON this way, instead of calling `Parse`, you can use the `IterativeParse` set of functions:
-
-~~~~~~~~~~cpp
- void IterativeParseInit();
-
- template <unsigned parseFlags, typename InputStream, typename Handler>
- bool IterativeParseNext(InputStream& is, Handler& handler);
-
- bool IterativeParseComplete();
-~~~~~~~~~~
-
-Here is an example of iteratively parsing JSON, token by token:
-
-~~~~~~~~~~cpp
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- reader.IterativeParseNext<kParseDefaultFlags>(is, handler);
- // Your handler has been called once.
- }
-~~~~~~~~~~
-
-# Writer {#Writer}
-
-`Reader` converts (parses) JSON into events. `Writer` does exactly the opposite. It converts events into JSON.
-
-`Writer` is very easy to use. If your application only need to converts some data into JSON, it may be a good choice to use `Writer` directly, instead of building a `Document` and then stringifying it with a `Writer`.
-
-In `simplewriter` example, we do exactly the reverse of `simplereader`.
-
-~~~~~~~~~~cpp
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-void main() {
- StringBuffer s;
- Writer<StringBuffer> writer(s);
-
- writer.StartObject();
- writer.Key("hello");
- writer.String("world");
- writer.Key("t");
- writer.Bool(true);
- writer.Key("f");
- writer.Bool(false);
- writer.Key("n");
- writer.Null();
- writer.Key("i");
- writer.Uint(123);
- writer.Key("pi");
- writer.Double(3.1416);
- writer.Key("a");
- writer.StartArray();
- for (unsigned i = 0; i < 4; i++)
- writer.Uint(i);
- writer.EndArray();
- writer.EndObject();
-
- cout << s.GetString() << endl;
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-{"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
-~~~~~~~~~~
-
-There are two `String()` and `Key()` overloads. One is the same as defined in handler concept with 3 parameters. It can handle string with null characters. Another one is the simpler version used in the above example.
-
-Note that, the example code does not pass any parameters in `EndArray()` and `EndObject()`. An `SizeType` can be passed but it will be simply ignored by `Writer`.
-
-You may doubt that, why not just using `sprintf()` or `std::stringstream` to build a JSON?
-
-There are various reasons:
-1. `Writer` must output a well-formed JSON. If there is incorrect event sequence (e.g. `Int()` just after `StartObject()`), it generates assertion fail in debug mode.
-2. `Writer::String()` can handle string escaping (e.g. converting code point `U+000A` to `\n`) and Unicode transcoding.
-3. `Writer` handles number output consistently.
-4. `Writer` implements the event handler concept. It can be used to handle events from `Reader`, `Document` or other event publisher.
-5. `Writer` can be optimized for different platforms.
-
-Anyway, using `Writer` API is even simpler than generating a JSON by ad hoc methods.
-
-## Template {#WriterTemplate}
-
-`Writer` has a minor design difference to `Reader`. `Writer` is a template class, not a typedef. There is no `GenericWriter`. The following is the declaration.
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = CrtAllocator<>, unsigned writeFlags = kWriteDefaultFlags>
-class Writer {
-public:
- Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth)
-// ...
-};
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-The `OutputStream` template parameter is the type of output stream. It cannot be deduced and must be specified by user.
-
-The `SourceEncoding` template parameter specifies the encoding to be used in `String(const Ch*, ...)`.
-
-The `TargetEncoding` template parameter specifies the encoding in the output stream.
-
-The `Allocator` is the type of allocator, which is used for allocating internal data structure (a stack).
-
-The `writeFlags` are combination of the following bit-flags:
-
-Parse flags | Meaning
-------------------------------|-----------------------------------
-`kWriteNoFlags` | No flag is set.
-`kWriteDefaultFlags` | Default write flags. It is equal to macro `RAPIDJSON_WRITE_DEFAULT_FLAGS`, which is defined as `kWriteNoFlags`.
-`kWriteValidateEncodingFlag` | Validate encoding of JSON strings.
-`kWriteNanAndInfFlag` | Allow writing of `Infinity`, `-Infinity` and `NaN`.
-
-Besides, the constructor of `Writer` has a `levelDepth` parameter. This parameter affects the initial memory allocated for storing information per hierarchy level.
-
-## PrettyWriter {#PrettyWriter}
-
-While the output of `Writer` is the most condensed JSON without white-spaces, suitable for network transfer or storage, it is not easily readable by human.
-
-Therefore, RapidJSON provides a `PrettyWriter`, which adds indentation and line feeds in the output.
-
-The usage of `PrettyWriter` is exactly the same as `Writer`, expect that `PrettyWriter` provides a `SetIndent(Ch indentChar, unsigned indentCharCount)` function. The default is 4 spaces.
-
-## Completeness and Reset {#CompletenessReset}
-
-A `Writer` can only output a single JSON, which can be any JSON type at the root. Once the singular event for root (e.g. `String()`), or the last matching `EndObject()` or `EndArray()` event, is handled, the output JSON is well-formed and complete. User can detect this state by calling `Writer::IsComplete()`.
-
-When a JSON is complete, the `Writer` cannot accept any new events. Otherwise the output will be invalid (i.e. having more than one root). To reuse the `Writer` object, user can call `Writer::Reset(OutputStream& os)` to reset all internal states of the `Writer` with a new output stream.
-
-# Techniques {#SaxTechniques}
-
-## Parsing JSON to Custom Data Structure {#CustomDataStructure}
-
-`Document`'s parsing capability is completely based on `Reader`. Actually `Document` is a handler which receives events from a reader to build a DOM during parsing.
-
-User may uses `Reader` to build other data structures directly. This eliminates building of DOM, thus reducing memory and improving performance.
-
-In the following `messagereader` example, `ParseMessages()` parses a JSON which should be an object with key-string pairs.
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include "rapidjson/error/en.h"
-#include <iostream>
-#include <string>
-#include <map>
-
-using namespace std;
-using namespace rapidjson;
-
-typedef map<string, string> MessageMap;
-
-struct MessageHandler
- : public BaseReaderHandler<UTF8<>, MessageHandler> {
- MessageHandler() : state_(kExpectObjectStart) {
- }
-
- bool StartObject() {
- switch (state_) {
- case kExpectObjectStart:
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool String(const char* str, SizeType length, bool) {
- switch (state_) {
- case kExpectNameOrObjectEnd:
- name_ = string(str, length);
- state_ = kExpectValue;
- return true;
- case kExpectValue:
- messages_.insert(MessageMap::value_type(name_, string(str, length)));
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
-
- bool Default() { return false; } // All other events are invalid.
-
- MessageMap messages_;
- enum State {
- kExpectObjectStart,
- kExpectNameOrObjectEnd,
- kExpectValue,
- }state_;
- std::string name_;
-};
-
-void ParseMessages(const char* json, MessageMap& messages) {
- Reader reader;
- MessageHandler handler;
- StringStream ss(json);
- if (reader.Parse(ss, handler))
- messages.swap(handler.messages_); // Only change it if success.
- else {
- ParseErrorCode e = reader.GetParseErrorCode();
- size_t o = reader.GetErrorOffset();
- cout << "Error: " << GetParseError_En(e) << endl;;
- cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
- }
-}
-
-int main() {
- MessageMap messages;
-
- const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
- cout << json1 << endl;
- ParseMessages(json1, messages);
-
- for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
- cout << itr->first << ": " << itr->second << endl;
-
- cout << endl << "Parse a JSON with invalid schema." << endl;
- const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
- cout << json2 << endl;
- ParseMessages(json2, messages);
-
- return 0;
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-{ "greeting" : "Hello!", "farewell" : "bye-bye!" }
-farewell: bye-bye!
-greeting: Hello!
-
-Parse a JSON with invalid schema.
-{ "greeting" : "Hello!", "farewell" : "bye-bye!", "foo" : {} }
-Error: Terminate parsing due to Handler error.
- at offset 59 near '} }...'
-~~~~~~~~~~
-
-The first JSON (`json1`) was successfully parsed into `MessageMap`. Since `MessageMap` is a `std::map`, the printing order are sorted by the key. This order is different from the JSON's order.
-
-In the second JSON (`json2`), `foo`'s value is an empty object. As it is an object, `MessageHandler::StartObject()` will be called. However, at that moment `state_ = kExpectValue`, so that function returns `false` and cause the parsing process be terminated. The error code is `kParseErrorTermination`.
-
-## Filtering of JSON {#Filtering}
-
-As mentioned earlier, `Writer` can handle the events published by `Reader`. `condense` example simply set a `Writer` as handler of a `Reader`, so it can remove all white-spaces in JSON. `pretty` example uses the same relationship, but replacing `Writer` by `PrettyWriter`. So `pretty` can be used to reformat a JSON with indentation and line feed.
-
-Actually, we can add intermediate layer(s) to filter the contents of JSON via these SAX-style API. For example, `capitalize` example capitalize all strings in a JSON.
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <vector>
-#include <cctype>
-
-using namespace rapidjson;
-
-template<typename OutputHandler>
-struct CapitalizeFilter {
- CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {
- }
-
- bool Null() { return out_.Null(); }
- bool Bool(bool b) { return out_.Bool(b); }
- bool Int(int i) { return out_.Int(i); }
- bool Uint(unsigned u) { return out_.Uint(u); }
- bool Int64(int64_t i) { return out_.Int64(i); }
- bool Uint64(uint64_t u) { return out_.Uint64(u); }
- bool Double(double d) { return out_.Double(d); }
- bool RawNumber(const char* str, SizeType length, bool copy) { return out_.RawNumber(str, length, copy); }
- bool String(const char* str, SizeType length, bool) {
- buffer_.clear();
- for (SizeType i = 0; i < length; i++)
- buffer_.push_back(std::toupper(str[i]));
- return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
- }
- bool StartObject() { return out_.StartObject(); }
- bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
- bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
- bool StartArray() { return out_.StartArray(); }
- bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
-
- OutputHandler& out_;
- std::vector<char> buffer_;
-};
-
-int main(int, char*[]) {
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
- if (!reader.Parse(is, filter)) {
- fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
-~~~~~~~~~~
-
-Note that, it is incorrect to simply capitalize the JSON as a string. For example:
-~~~~~~~~~~
-["Hello\nWorld"]
-~~~~~~~~~~
-
-Simply capitalizing the whole JSON would contain incorrect escape character:
-~~~~~~~~~~
-["HELLO\NWORLD"]
-~~~~~~~~~~
-
-The correct result by `capitalize`:
-~~~~~~~~~~
-["HELLO\nWORLD"]
-~~~~~~~~~~
-
-More complicated filters can be developed. However, since SAX-style API can only provide information about a single event at a time, user may need to book-keeping the contextual information (e.g. the path from root value, storage of other related values). Some processing may be easier to be implemented in DOM than SAX.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.zh-cn.md
deleted file mode 100644
index 9b11e7683d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/sax.zh-cn.md
+++ /dev/null
@@ -1,487 +0,0 @@
-# SAX
-
-"SAX" 此术语æºäºŽ [Simple API for XML](http://en.wikipedia.org/wiki/Simple_API_for_XML)。我们借了此术语去套用在 JSON 的解æžåŠç”Ÿæˆã€‚
-
-在 RapidJSON 中,`Reader`(`GenericReader<...>` çš„ typedef)是 JSON çš„ SAX 风格解æžå™¨ï¼Œè€Œ `Writer`(`GenericWriter<...>` çš„ typedef)则是 JSON çš„ SAX 风格生æˆå™¨ã€‚
-
-[TOC]
-
-# Reader {#Reader}
-
-`Reader` 从输入æµè§£æžä¸€ä¸ª JSON。当它从æµä¸­è¯»å–字符时,它会基于 JSON 的语法去分æžå­—符,并å‘处ç†å™¨å‘é€äº‹ä»¶ã€‚
-
-例如,以下是一个 JSON。
-
-~~~~~~~~~~js
-{
- "hello": "world",
- "t": true ,
- "f": false,
- "n": null,
- "i": 123,
- "pi": 3.1416,
- "a": [1, 2, 3, 4]
-}
-~~~~~~~~~~
-
-当一个 `Reader` 解æžæ­¤ JSON 时,它会顺åºåœ°å‘处ç†å™¨å‘é€ä»¥ä¸‹çš„事件:
-
-~~~~~~~~~~
-StartObject()
-Key("hello", 5, true)
-String("world", 5, true)
-Key("t", 1, true)
-Bool(true)
-Key("f", 1, true)
-Bool(false)
-Key("n", 1, true)
-Null()
-Key("i")
-Uint(123)
-Key("pi")
-Double(3.1416)
-Key("a")
-StartArray()
-Uint(1)
-Uint(2)
-Uint(3)
-Uint(4)
-EndArray(4)
-EndObject(7)
-~~~~~~~~~~
-
-除了一些事件å‚数需è¦å†ä½œè§£é‡Šï¼Œè¿™äº›äº‹ä»¶å¯ä»¥è½»æ¾åœ°ä¸Ž JSON 对上。我们å¯ä»¥çœ‹çœ‹ `simplereader` 例å­æ€Žæ ·äº§ç”Ÿå’Œä»¥ä¸Šå®Œå…¨ç›¸åŒçš„结果:
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-struct MyHandler : public BaseReaderHandler<UTF8<>, MyHandler> {
- bool Null() { cout << "Null()" << endl; return true; }
- bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
- bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
- bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
- bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
- bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
- bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
- bool String(const char* str, SizeType length, bool copy) {
- cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool StartObject() { cout << "StartObject()" << endl; return true; }
- bool Key(const char* str, SizeType length, bool copy) {
- cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
- bool StartArray() { cout << "StartArray()" << endl; return true; }
- bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
-};
-
-void main() {
- const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- MyHandler handler;
- Reader reader;
- StringStream ss(json);
- reader.Parse(ss, handler);
-}
-~~~~~~~~~~
-
-æ³¨æ„ RapidJSON 使用模æ¿åŽ»é™æ€æŒ·å®š `Reader` 类型åŠå¤„ç†å™¨çš„类型,而ä¸æ˜¯ä½¿ç”¨å«è™šå‡½æ•°çš„类。这个范å¼å¯ä»¥é€šè¿‡æŠŠå‡½æ•°å†…è”而改善性能。
-
-## 处ç†å™¨ {#Handler}
-
-如å‰ä¾‹æ‰€ç¤ºï¼Œä½¿ç”¨è€…需è¦å®žçŽ°ä¸€ä¸ªå¤„ç†å™¨ï¼ˆhandler),用于处ç†æ¥è‡ª `Reader` 的事件(函数调用)。处ç†å™¨å¿…须包å«ä»¥ä¸‹çš„æˆå‘˜å‡½æ•°ã€‚
-
-~~~~~~~~~~cpp
-class Handler {
- bool Null();
- bool Bool(bool b);
- bool Int(int i);
- bool Uint(unsigned i);
- bool Int64(int64_t i);
- bool Uint64(uint64_t i);
- bool Double(double d);
- bool RawNumber(const Ch* str, SizeType length, bool copy);
- bool String(const Ch* str, SizeType length, bool copy);
- bool StartObject();
- bool Key(const Ch* str, SizeType length, bool copy);
- bool EndObject(SizeType memberCount);
- bool StartArray();
- bool EndArray(SizeType elementCount);
-};
-~~~~~~~~~~
-
-当 `Reader` é‡åˆ° JSON null 值时会调用 `Null()`。
-
-当 `Reader` é‡åˆ° JSON true 或 false 值时会调用 `Bool(bool)`。
-
-当 `Reader` é‡åˆ° JSON number,它会选择一个åˆé€‚çš„ C++ 类型映射,然åŽè°ƒç”¨ `Int(int)`ã€`Uint(unsigned)`ã€`Int64(int64_t)`ã€`Uint64(uint64_t)` åŠ `Double(double)` çš„ * 其中之一个 *。 若开å¯äº† `kParseNumbersAsStrings` 选项,`Reader` 便会改为调用 `RawNumber()`。
-
-当 `Reader` é‡åˆ° JSON string,它会调用 `String(const char* str, SizeType length, bool copy)`。第一个å‚数是字符串的指针。第二个å‚数是字符串的长度(ä¸åŒ…å«ç©ºç»ˆæ­¢ç¬¦å·ï¼‰ã€‚æ³¨æ„ RapidJSON 支æŒå­—串中å«æœ‰ç©ºå­—符 `\0`。若出现这ç§æƒ…况,便会有 `strlen(str) < length`。最åŽçš„ `copy` å‚数表示处ç†å™¨æ˜¯å¦éœ€è¦å¤åˆ¶è¯¥å­—符串。在正常解æžæ—¶ï¼Œ`copy = true`。仅当使用原ä½è§£æžæ—¶ï¼Œ`copy = false`。此外,还è¦æ³¨æ„字符的类型与目标编ç ç›¸å…³ï¼Œæˆ‘们ç¨åŽä¼šå†è°ˆè¿™ä¸€ç‚¹ã€‚
-
-当 `Reader` é‡åˆ° JSON object 的开始之时,它会调用 `StartObject()`。JSON çš„ object 是一个键值对(æˆå‘˜ï¼‰çš„集åˆã€‚è‹¥ object 包å«æˆå‘˜ï¼Œå®ƒä¼šå…ˆä¸ºæˆå‘˜çš„å字调用 `Key()`,然åŽå†æŒ‰å€¼çš„类型调用函数。它ä¸æ–­è°ƒç”¨è¿™äº›é”®å€¼å¯¹ï¼Œç›´è‡³æœ€ç»ˆè°ƒç”¨ `EndObject(SizeType memberCount)`ã€‚æ³¨æ„ `memberCount` å‚数对处ç†å™¨æ¥è¯´åªæ˜¯å助性质,使用者å¯èƒ½ä¸éœ€è¦æ­¤å‚数。
-
-JSON array 与 object 相似,但更简å•ã€‚在 array 开始时,`Reader` 会调用 `BeginArary()`。若 array å«æœ‰å…ƒç´ ï¼Œå®ƒä¼šæŒ‰å…ƒç´ çš„类型æ¥è¯»ç”¨å‡½æ•°ã€‚相似地,最åŽå®ƒä¼šè°ƒç”¨ `EndArray(SizeType elementCount)`,其中 `elementCount` å‚数对处ç†å™¨æ¥è¯´åªæ˜¯å助性质。
-
-æ¯ä¸ªå¤„ç†å™¨å‡½æ•°éƒ½è¿”回一个 `bool`。正常它们应返回 `true`。若处ç†å™¨é‡åˆ°é”™è¯¯ï¼Œå®ƒå¯ä»¥è¿”回 `false` 去通知事件å‘é€æ–¹åœæ­¢ç»§ç»­å¤„ç†ã€‚
-
-例如,当我们用 `Reader` 解æžä¸€ä¸ª JSON 时,处ç†å™¨æ£€æµ‹åˆ°è¯¥ JSON 并ä¸ç¬¦åˆæ‰€éœ€çš„ schema,那么处ç†å™¨å¯ä»¥è¿”回 `false`,令 `Reader` åœæ­¢ä¹‹åŽçš„解æžå·¥ä½œã€‚而 `Reader` 会进入一个错误状æ€ï¼Œå¹¶ä»¥ `kParseErrorTermination` 错误ç æ ‡è¯†ã€‚
-
-## GenericReader {#GenericReader}
-
-å‰é¢æåŠï¼Œ`Reader` 是 `GenericReader` 模æ¿ç±»çš„ typedef:
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template <typename SourceEncoding, typename TargetEncoding, typename Allocator = MemoryPoolAllocator<> >
-class GenericReader {
- // ...
-};
-
-typedef GenericReader<UTF8<>, UTF8<> > Reader;
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-`Reader` 使用 UTF-8 作为æ¥æºåŠç›®æ ‡ç¼–ç ã€‚æ¥æºç¼–ç æ˜¯æŒ‡ JSON æµçš„ç¼–ç ã€‚目标编ç æ˜¯æŒ‡ `String()` çš„ `str` å‚数所用的编ç ã€‚例如,è¦è§£æžä¸€ä¸ª UTF-8 æµå¹¶è¾“出至 UTF-16 string 事件,你需è¦è¿™ä¹ˆå®šä¹‰ä¸€ä¸ª reader:
-
-~~~~~~~~~~cpp
-GenericReader<UTF8<>, UTF16<> > reader;
-~~~~~~~~~~
-
-注æ„到 `UTF16` 的缺çœç±»åž‹æ˜¯ `wchar_t`。因此这个 `reader` 需è¦è°ƒç”¨å¤„ç†å™¨çš„ `String(const wchar_t*, SizeType, bool)`。
-
-第三个模æ¿å‚æ•° `Allocator` 是内部数æ®ç»“构(实际上是一个堆栈)的分é…器类型。
-
-## è§£æž {#SaxParsing}
-
-`Reader` çš„å”¯ä¸€åŠŸèƒ½å°±æ˜¯è§£æž JSON。
-
-~~~~~~~~~~cpp
-template <unsigned parseFlags, typename InputStream, typename Handler>
-bool Parse(InputStream& is, Handler& handler);
-
-// 使用 parseFlags = kDefaultParseFlags
-template <typename InputStream, typename Handler>
-bool Parse(InputStream& is, Handler& handler);
-~~~~~~~~~~
-
-若在解æžä¸­å‡ºçŽ°é”™è¯¯ï¼Œå®ƒä¼šè¿”回 `false`。使用者å¯è°ƒç”¨ `bool HasParseEror()`, `ParseErrorCode GetParseErrorCode()` åŠ `size_t GetErrorOffset()` 获å–错误状æ€ã€‚实际上 `Document` 使用这些 `Reader` 函数去获å–解æžé”™è¯¯ã€‚请å‚考 [DOM](doc/dom.zh-cn.md) 去了解有关解æžé”™è¯¯çš„细节。
-
-# Writer {#Writer}
-
-`Reader` 把 JSON 转æ¢ï¼ˆè§£æžï¼‰æˆä¸ºäº‹ä»¶ã€‚`Writer` åšå®Œå…¨ç›¸å的事情。它把事件转æ¢æˆ JSON。
-
-`Writer` 是éžå¸¸å®¹æ˜“使用的。若你的应用程åºåªéœ€æŠŠä¸€äº›æ•°æ®è½¬æ¢æˆ JSON,å¯èƒ½ç›´æŽ¥ä½¿ç”¨ `Writer`,会比建立一个 `Document` 然åŽç”¨ `Writer` 把它转æ¢æˆ JSON 更加方便。
-
-在 `simplewriter` 例å­é‡Œï¼Œæˆ‘ä»¬åš `simplereader` 完全相å的事情。
-
-~~~~~~~~~~cpp
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-void main() {
- StringBuffer s;
- Writer<StringBuffer> writer(s);
-
- writer.StartObject();
- writer.Key("hello");
- writer.String("world");
- writer.Key("t");
- writer.Bool(true);
- writer.Key("f");
- writer.Bool(false);
- writer.Key("n");
- writer.Null();
- writer.Key("i");
- writer.Uint(123);
- writer.Key("pi");
- writer.Double(3.1416);
- writer.Key("a");
- writer.StartArray();
- for (unsigned i = 0; i < 4; i++)
- writer.Uint(i);
- writer.EndArray();
- writer.EndObject();
-
- cout << s.GetString() << endl;
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-{"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
-~~~~~~~~~~
-
-`String()` åŠ `Key()` å„有两个é‡è½½ã€‚一个是如处ç†å™¨ concept 般,有 3 个å‚数。它能处ç†å«ç©ºå­—符的字符串。å¦ä¸€ä¸ªæ˜¯å¦‚上中使用的较简å•ç‰ˆæœ¬ã€‚
-
-注æ„到,例å­ä»£ç ä¸­çš„ `EndArray()` åŠ `EndObject()` 并没有å‚数。å¯ä»¥ä¼ é€’一个 `SizeType` çš„å‚数,但它会被 `Writer` 忽略。
-
-ä½ å¯èƒ½ä¼šæ€€ç–‘,为什么ä¸ä½¿ç”¨ `sprintf()` 或 `std::stringstream` 去建立一个 JSON?
-
-这有几个原因:
-1. `Writer` 必然会输出一个结构良好(well-formed)的 JSON。若然有错误的事件次åºï¼ˆå¦‚ `Int()` ç´§éš `StartObject()` 出现),它会在调试模å¼ä¸­äº§ç”Ÿæ–­è¨€å¤±è´¥ã€‚
-2. `Writer::String()` å¯å¤„ç†å­—符串转义(如把ç ç‚¹ `U+000A` 转æ¢æˆ `\n`)åŠè¿›è¡Œ Unicode 转ç ã€‚
-3. `Writer` ä¸€è‡´åœ°å¤„ç† number 的输出。
-4. `Writer` 实现了事件处ç†å™¨ concept。å¯ç”¨äºŽå¤„ç†æ¥è‡ª `Reader`ã€`Document` 或其他事件å‘生器。
-5. `Writer` å¯å¯¹ä¸åŒå¹³å°è¿›è¡Œä¼˜åŒ–。
-
-无论如何,使用 `Writer` API åŽ»ç”Ÿæˆ JSON 甚至乎比这些临时方法更简å•ã€‚
-
-## æ¨¡æ¿ {#WriterTemplate}
-
-`Writer` 与 `Reader` 有少许设计区别。`Writer` 是一个模æ¿ç±»ï¼Œè€Œä¸æ˜¯ä¸€ä¸ª typedef。 并没有 `GenericWriter`。以下是 `Writer` 的声明。
-
-~~~~~~~~~~cpp
-namespace rapidjson {
-
-template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename Allocator = CrtAllocator<> >
-class Writer {
-public:
- Writer(OutputStream& os, Allocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth)
-// ...
-};
-
-} // namespace rapidjson
-~~~~~~~~~~
-
-`OutputStream` 模æ¿å‚数是输出æµçš„类型。它的类型ä¸å¯ä»¥è¢«è‡ªåŠ¨æŽ¨æ–­ï¼Œå¿…须由使用者æ供。
-
-`SourceEncoding` 模æ¿å‚数指定了 `String(const Ch*, ...)` çš„ç¼–ç ã€‚
-
-`TargetEncoding` 模æ¿å‚数指定输出æµçš„ç¼–ç ã€‚
-
-`Allocator` 是分é…器的类型,用于分é…内部数æ®ç»“构(一个堆栈)。
-
-`writeFlags` 是以下ä½æ ‡å¿—的组åˆï¼š
-
-写入ä½æ ‡å¿— | æ„义
-------------------------------|-----------------------------------
-`kWriteNoFlags` | 没有任何标志。
-`kWriteDefaultFlags` | 缺çœçš„解æžé€‰é¡¹ã€‚它等于 `RAPIDJSON_WRITE_DEFAULT_FLAGS` å®ï¼Œæ­¤å®å®šä¹‰ä¸º `kWriteNoFlags`。
-`kWriteValidateEncodingFlag` | 校验 JSON 字符串的编ç ã€‚
-`kWriteNanAndInfFlag` | 容许写入 `Infinity`, `-Infinity` åŠ `NaN`。
-
-此外,`Writer` 的构造函数有一 `levelDepth` å‚数。存储æ¯å±‚阶信æ¯çš„åˆå§‹å†…存分é…é‡å—æ­¤å‚æ•°å½±å“。
-
-## PrettyWriter {#PrettyWriter}
-
-`Writer` 所输出的是没有空格字符的最紧凑 JSON,适åˆç½‘络传输或储存,但ä¸é€‚åˆäººç±»é˜…读。
-
-因此,RapidJSON æ供了一个 `PrettyWriter`,它在输出中加入缩进åŠæ¢è¡Œã€‚
-
-`PrettyWriter` 的用法与 `Writer` 几乎一样,ä¸åŒä¹‹å¤„是 `PrettyWriter` æ供了一个 `SetIndent(Ch indentChar, unsigned indentCharCount)` 函数。缺çœçš„缩进是 4 个空格。
-
-## 完整性åŠé‡ç½® {#CompletenessReset}
-
-一个 `Writer` åªå¯è¾“出å•ä¸ª JSON,其根节点å¯ä»¥æ˜¯ä»»ä½• JSON 类型。当处ç†å®Œå•ä¸ªæ ¹èŠ‚点事件(如 `String()`),或匹é…çš„æœ€åŽ `EndObject()` 或 `EndArray()` 事件,输出的 JSON 是结构完整(well-formed)åŠå®Œæ•´çš„。使用者å¯è°ƒç”¨ `Writer::IsComplete()` 去检测完整性。
-
-当 JSON 完整时,`Writer` ä¸èƒ½å†æŽ¥å—新的事件。ä¸ç„¶å…¶è¾“出便会是ä¸åˆæ³•çš„(例如有超过一个根节点)。为了é‡æ–°åˆ©ç”¨ `Writer` 对象,使用者å¯è°ƒç”¨ `Writer::Reset(OutputStream& os)` 去é‡ç½®å…¶æ‰€æœ‰å†…部状æ€åŠè®¾ç½®æ–°çš„输出æµã€‚
-
-# 技巧 {#SaxTechniques}
-
-## è§£æž JSON 至自定义结构 {#CustomDataStructure}
-
-`Document` 的解æžåŠŸèƒ½å®Œå…¨ä¾é  `Reader`。实际上 `Document` 是一个处ç†å™¨ï¼Œåœ¨è§£æž JSON 时接收事件去建立一个 DOM。
-
-使用者å¯ä»¥ç›´æŽ¥ä½¿ç”¨ `Reader` 去建立其他数æ®ç»“构。这消除了建立 DOM 的步骤,从而å‡å°‘了内存开销并改善性能。
-
-在以下的 `messagereader` 例å­ä¸­ï¼Œ`ParseMessages()` 解æžä¸€ä¸ª JSON,该 JSON 应该是一个å«é”®å€¼å¯¹çš„ object。
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include "rapidjson/error/en.h"
-#include <iostream>
-#include <string>
-#include <map>
-
-using namespace std;
-using namespace rapidjson;
-
-typedef map<string, string> MessageMap;
-
-struct MessageHandler
- : public BaseReaderHandler<UTF8<>, MessageHandler> {
- MessageHandler() : state_(kExpectObjectStart) {
- }
-
- bool StartObject() {
- switch (state_) {
- case kExpectObjectStart:
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool String(const char* str, SizeType length, bool) {
- switch (state_) {
- case kExpectNameOrObjectEnd:
- name_ = string(str, length);
- state_ = kExpectValue;
- return true;
- case kExpectValue:
- messages_.insert(MessageMap::value_type(name_, string(str, length)));
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
-
- bool Default() { return false; } // All other events are invalid.
-
- MessageMap messages_;
- enum State {
- kExpectObjectStart,
- kExpectNameOrObjectEnd,
- kExpectValue,
- }state_;
- std::string name_;
-};
-
-void ParseMessages(const char* json, MessageMap& messages) {
- Reader reader;
- MessageHandler handler;
- StringStream ss(json);
- if (reader.Parse(ss, handler))
- messages.swap(handler.messages_); // Only change it if success.
- else {
- ParseErrorCode e = reader.GetParseErrorCode();
- size_t o = reader.GetErrorOffset();
- cout << "Error: " << GetParseError_En(e) << endl;;
- cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
- }
-}
-
-int main() {
- MessageMap messages;
-
- const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
- cout << json1 << endl;
- ParseMessages(json1, messages);
-
- for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
- cout << itr->first << ": " << itr->second << endl;
-
- cout << endl << "Parse a JSON with invalid schema." << endl;
- const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
- cout << json2 << endl;
- ParseMessages(json2, messages);
-
- return 0;
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-{ "greeting" : "Hello!", "farewell" : "bye-bye!" }
-farewell: bye-bye!
-greeting: Hello!
-
-Parse a JSON with invalid schema.
-{ "greeting" : "Hello!", "farewell" : "bye-bye!", "foo" : {} }
-Error: Terminate parsing due to Handler error.
- at offset 59 near '} }...'
-~~~~~~~~~~
-
-第一个 JSON(`json1`)被æˆåŠŸåœ°è§£æžè‡³ `MessageMap`。由于 `MessageMap` 是一个 `std::map`,打å°æ¬¡åºæŒ‰é”®å€¼æŽ’åºã€‚此次åºä¸Ž JSON 中的次åºä¸åŒã€‚
-
-在第二个 JSON(`json2`)中,`foo` 的值是一个空 object。由于它是一个 object,`MessageHandler::StartObject()` 会被调用。然而,在 `state_ = kExpectValue` 的情况下,该函数会返回 `false`,并导致解æžè¿‡ç¨‹ç»ˆæ­¢ã€‚错误代ç æ˜¯ `kParseErrorTermination`。
-
-## 过滤 JSON {#Filtering}
-
-如å‰é¢æåŠè¿‡ï¼Œ`Writer` å¯å¤„ç† `Reader` å‘出的事件。`example/condense/condense.cpp` 例å­ç®€å•åœ°è®¾ç½® `Writer` 作为一个 `Reader` 的处ç†å™¨ï¼Œå› æ­¤å®ƒèƒ½ç§»é™¤ JSON 中的所有空白字符。`example/pretty/pretty.cpp` 例å­ä½¿ç”¨åŒæ ·çš„关系,åªæ˜¯ä»¥ `PrettyWriter` å–代 `Writer`。因此 `pretty` 能够é‡æ–°æ ¼å¼åŒ– JSON,加入缩进åŠæ¢è¡Œã€‚
-
-实际上,我们å¯ä»¥ä½¿ç”¨ SAX 风格 API 去加入(多个)中间层去过滤 JSON 的内容。例如 `capitalize` 例å­å¯ä»¥æŠŠæ‰€æœ‰ JSON string 改为大写。
-
-~~~~~~~~~~cpp
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <vector>
-#include <cctype>
-
-using namespace rapidjson;
-
-template<typename OutputHandler>
-struct CapitalizeFilter {
- CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {
- }
-
- bool Null() { return out_.Null(); }
- bool Bool(bool b) { return out_.Bool(b); }
- bool Int(int i) { return out_.Int(i); }
- bool Uint(unsigned u) { return out_.Uint(u); }
- bool Int64(int64_t i) { return out_.Int64(i); }
- bool Uint64(uint64_t u) { return out_.Uint64(u); }
- bool Double(double d) { return out_.Double(d); }
- bool RawNumber(const char* str, SizeType length, bool copy) { return out_.RawNumber(str, length, copy); }
- bool String(const char* str, SizeType length, bool) {
- buffer_.clear();
- for (SizeType i = 0; i < length; i++)
- buffer_.push_back(std::toupper(str[i]));
- return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
- }
- bool StartObject() { return out_.StartObject(); }
- bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
- bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
- bool StartArray() { return out_.StartArray(); }
- bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
-
- OutputHandler& out_;
- std::vector<char> buffer_;
-};
-
-int main(int, char*[]) {
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
- if (!reader.Parse(is, filter)) {
- fprintf(stderr, "\nError(%u): %s\n", (unsigned)reader.GetErrorOffset(), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
-~~~~~~~~~~
-
-注æ„到,ä¸å¯ç®€å•åœ°æŠŠ JSON 当作字符串去改为大写。例如:
-~~~~~~~~~~
-["Hello\nWorld"]
-~~~~~~~~~~
-
-简å•åœ°æŠŠæ•´ä¸ª JSON 转为大写的è¯ä¼šäº§ç”Ÿé”™è¯¯çš„转义符:
-~~~~~~~~~~
-["HELLO\NWORLD"]
-~~~~~~~~~~
-
-而 `capitalize` 就会产生正确的结果:
-~~~~~~~~~~
-["HELLO\nWORLD"]
-~~~~~~~~~~
-
-我们还å¯ä»¥å¼€å‘æ›´å¤æ‚的过滤器。然而,由于 SAX 风格 API 在æŸä¸€æ—¶é—´ç‚¹åªèƒ½æä¾›å•ä¸€äº‹ä»¶çš„ä¿¡æ¯ï¼Œä½¿ç”¨è€…需è¦è‡ªè¡Œè®°å½•ä¸€äº›ä¸Šä¸‹æ–‡ä¿¡æ¯ï¼ˆä¾‹å¦‚从根节点起的路径ã€å‚¨å­˜å…¶ä»–相关值)。对于处ç†æŸäº›æƒ…况,用 DOM 会比 SAX 更容易实现。
-
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.md
deleted file mode 100644
index 4da4474b2e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.md
+++ /dev/null
@@ -1,513 +0,0 @@
-# Schema
-
-(This feature was released in v1.1.0)
-
-JSON Schema is a draft standard for describing the format of JSON data. The schema itself is also JSON data. By validating a JSON structure with JSON Schema, your code can safely access the DOM without manually checking types, or whether a key exists, etc. It can also ensure that the serialized JSON conform to a specified schema.
-
-RapidJSON implemented a JSON Schema validator for [JSON Schema Draft v4](http://json-schema.org/documentation.html). If you are not familiar with JSON Schema, you may refer to [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/).
-
-[TOC]
-
-# Basic Usage {#Basic}
-
-First of all, you need to parse a JSON Schema into `Document`, and then compile the `Document` into a `SchemaDocument`.
-
-Secondly, construct a `SchemaValidator` with the `SchemaDocument`. It is similar to a `Writer` in the sense of handling SAX events. So, you can use `document.Accept(validator)` to validate a document, and then check the validity.
-
-~~~cpp
-#include "rapidjson/schema.h"
-
-// ...
-
-Document sd;
-if (sd.Parse(schemaJson).HasParseError()) {
- // the schema is not a valid JSON.
- // ...
-}
-
-SchemaDocument schema(sd); // Compile a Document to SchemaDocument
-if (!schema.GetError().ObjectEmpty()) {
- // there was a problem compiling the schema
- StringBuffer sb;
- Writer<StringBuffer> w(sb);
- schema.GetError().Accept(w);
- printf("Invalid schema: %s\n", sb.GetString());
-}
-// sd is no longer needed here.
-
-Document d;
-if (d.Parse(inputJson).HasParseError()) {
- // the input is not a valid JSON.
- // ...
-}
-
-SchemaValidator validator(schema);
-if (!d.Accept(validator)) {
- // Input JSON is invalid according to the schema
- // Output diagnostic information
- StringBuffer sb;
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- printf("Invalid schema: %s\n", sb.GetString());
- printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
- sb.Clear();
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- printf("Invalid document: %s\n", sb.GetString());
-}
-~~~
-
-Some notes:
-
-* One `SchemaDocument` can be referenced by multiple `SchemaValidator`s. It will not be modified by `SchemaValidator`s.
-* A `SchemaValidator` may be reused to validate multiple documents. To run it for other documents, call `validator.Reset()` first.
-
-# Validation during parsing/serialization {#Fused}
-
-Unlike most JSON Schema validator implementations, RapidJSON provides a SAX-based schema validator. Therefore, you can parse a JSON from a stream while validating it on the fly. If the validator encounters a JSON value that invalidates the supplied schema, the parsing will be terminated immediately. This design is especially useful for parsing large JSON files.
-
-## DOM parsing {#DOM}
-
-For using DOM in parsing, `Document` needs some preparation and finalizing tasks, in addition to receiving SAX events, thus it needs some work to route the reader, validator and the document. `SchemaValidatingReader` is a helper class that doing such work.
-
-~~~cpp
-#include "rapidjson/filereadstream.h"
-
-// ...
-SchemaDocument schema(sd); // Compile a Document to SchemaDocument
-
-// Use reader to parse the JSON
-FILE* fp = fopen("big.json", "r");
-FileReadStream is(fp, buffer, sizeof(buffer));
-
-// Parse JSON from reader, validate the SAX events, and store in d.
-Document d;
-SchemaValidatingReader<kParseDefaultFlags, FileReadStream, UTF8<> > reader(is, schema);
-d.Populate(reader);
-
-if (!reader.GetParseResult()) {
- // Not a valid JSON
- // When reader.GetParseResult().Code() == kParseErrorTermination,
- // it may be terminated by:
- // (1) the validator found that the JSON is invalid according to schema; or
- // (2) the input stream has I/O error.
-
- // Check the validation result
- if (!reader.IsValid()) {
- // Input JSON is invalid according to the schema
- // Output diagnostic information
- StringBuffer sb;
- reader.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- printf("Invalid schema: %s\n", sb.GetString());
- printf("Invalid keyword: %s\n", reader.GetInvalidSchemaKeyword());
- sb.Clear();
- reader.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- printf("Invalid document: %s\n", sb.GetString());
- }
-}
-~~~
-
-## SAX parsing {#SAX}
-
-For using SAX in parsing, it is much simpler. If it only need to validate the JSON without further processing, it is simply:
-
-~~~
-SchemaValidator validator(schema);
-Reader reader;
-if (!reader.Parse(stream, validator)) {
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-This is exactly the method used in the [schemavalidator](example/schemavalidator/schemavalidator.cpp) example. The distinct advantage is low memory usage, no matter how big the JSON was (the memory usage depends on the complexity of the schema).
-
-If you need to handle the SAX events further, then you need to use the template class `GenericSchemaValidator` to set the output handler of the validator:
-
-~~~
-MyHandler handler;
-GenericSchemaValidator<SchemaDocument, MyHandler> validator(schema, handler);
-Reader reader;
-if (!reader.Parse(ss, validator)) {
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-## Serialization {#Serialization}
-
-It is also possible to do validation during serializing. This can ensure the result JSON is valid according to the JSON schema.
-
-~~~
-StringBuffer sb;
-Writer<StringBuffer> writer(sb);
-GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
-if (!d.Accept(validator)) {
- // Some problem during Accept(), it may be validation or encoding issues.
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-Of course, if your application only needs SAX-style serialization, it can simply send SAX events to `SchemaValidator` instead of `Writer`.
-
-# Remote Schema {#Remote}
-
-JSON Schema supports [`$ref` keyword](http://spacetelescope.github.io/understanding-json-schema/structuring.html), which is a [JSON pointer](doc/pointer.md) referencing to a local or remote schema. Local pointer is prefixed with `#`, while remote pointer is an relative or absolute URI. For example:
-
-~~~js
-{ "$ref": "definitions.json#/address" }
-~~~
-
-As `SchemaDocument` does not know how to resolve such URI, it needs a user-provided `IRemoteSchemaDocumentProvider` instance to do so.
-
-~~~
-class MyRemoteSchemaDocumentProvider : public IRemoteSchemaDocumentProvider {
-public:
- virtual const SchemaDocument* GetRemoteDocument(const char* uri, SizeType length) {
- // Resolve the uri and returns a pointer to that schema.
- }
-};
-
-// ...
-
-MyRemoteSchemaDocumentProvider provider;
-SchemaDocument schema(sd, &provider);
-~~~
-
-# Conformance {#Conformance}
-
-RapidJSON passed 262 out of 263 tests in [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (Json Schema draft 4).
-
-The failed test is "changed scope ref invalid" of "change resolution scope" in `refRemote.json`. It is due to that `id` schema keyword and URI combining function are not implemented.
-
-Besides, the `format` schema keyword for string values is ignored, since it is not required by the specification.
-
-## Regular Expression {#Regex}
-
-The schema keyword `pattern` and `patternProperties` uses regular expression to match the required pattern.
-
-RapidJSON implemented a simple NFA regular expression engine, which is used by default. It supports the following syntax.
-
-|Syntax|Description|
-|------|-----------|
-|`ab` | Concatenation |
-|<code>a&#124;b</code> | Alternation |
-|`a?` | Zero or one |
-|`a*` | Zero or more |
-|`a+` | One or more |
-|`a{3}` | Exactly 3 times |
-|`a{3,}` | At least 3 times |
-|`a{3,5}`| 3 to 5 times |
-|`(ab)` | Grouping |
-|`^a` | At the beginning |
-|`a$` | At the end |
-|`.` | Any character |
-|`[abc]` | Character classes |
-|`[a-c]` | Character class range |
-|`[a-z0-9_]` | Character class combination |
-|`[^abc]` | Negated character classes |
-|`[^a-c]` | Negated character class range |
-|`[\b]` | Backspace (U+0008) |
-|<code>\\&#124;</code>, `\\`, ... | Escape characters |
-|`\f` | Form feed (U+000C) |
-|`\n` | Line feed (U+000A) |
-|`\r` | Carriage return (U+000D) |
-|`\t` | Tab (U+0009) |
-|`\v` | Vertical tab (U+000B) |
-
-For C++11 compiler, it is also possible to use the `std::regex` by defining `RAPIDJSON_SCHEMA_USE_INTERNALREGEX=0` and `RAPIDJSON_SCHEMA_USE_STDREGEX=1`. If your schemas do not need `pattern` and `patternProperties`, you can set both macros to zero to disable this feature, which will reduce some code size.
-
-# Performance {#Performance}
-
-Most C++ JSON libraries do not yet support JSON Schema. So we tried to evaluate the performance of RapidJSON's JSON Schema validator according to [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark), which tests 11 JavaScript libraries running on Node.js.
-
-That benchmark runs validations on [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite), in which some test suites and tests are excluded. We made the same benchmarking procedure in [`schematest.cpp`](test/perftest/schematest.cpp).
-
-On a Mac Book Pro (2.8 GHz Intel Core i7), the following results are collected.
-
-|Validator|Relative speed|Number of test runs per second|
-|---------|:------------:|:----------------------------:|
-|RapidJSON|155%|30682|
-|[`ajv`](https://github.com/epoberezkin/ajv)|100%|19770 (± 1.31%)|
-|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|70%|13835 (± 2.84%)|
-|[`jsen`](https://github.com/bugventure/jsen)|57.7%|11411 (± 1.27%)|
-|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|26%|5145 (± 1.62%)|
-|[`themis`](https://github.com/playlyfe/themis)|19.9%|3935 (± 2.69%)|
-|[`z-schema`](https://github.com/zaggino/z-schema)|7%|1388 (± 0.84%)|
-|[`jsck`](https://github.com/pandastrike/jsck#readme)|3.1%|606 (± 2.84%)|
-|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|0.9%|185 (± 1.01%)|
-|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|0.8%|154 (± 0.79%)|
-|tv4|0.5%|93 (± 0.94%)|
-|[`jayschema`](https://github.com/natesilva/jayschema)|0.1%|21 (± 1.14%)|
-
-That is, RapidJSON is about 1.5x faster than the fastest JavaScript library (ajv). And 1400x faster than the slowest one.
-
-# Schema violation reporting {#Reporting}
-
-(Unreleased as of 2017-09-20)
-
-When validating an instance against a JSON Schema,
-it is often desirable to report not only whether the instance is valid,
-but also the ways in which it violates the schema.
-
-The `SchemaValidator` class
-collects errors encountered during validation
-into a JSON `Value`.
-This error object can then be accessed as `validator.GetError()`.
-
-The structure of the error object is subject to change
-in future versions of RapidJSON,
-as there is no standard schema for violations.
-The details below this point are provisional only.
-
-## General provisions {#ReportingGeneral}
-
-Validation of an instance value against a schema
-produces an error value.
-The error value is always an object.
-An empty object `{}` indicates the instance is valid.
-
-* The name of each member
- corresponds to the JSON Schema keyword that is violated.
-* The value is either an object describing a single violation,
- or an array of such objects.
-
-Each violation object contains two string-valued members
-named `instanceRef` and `schemaRef`.
-`instanceRef` contains the URI fragment serialization
-of a JSON Pointer to the instance subobject
-in which the violation was detected.
-`schemaRef` contains the URI of the schema
-and the fragment serialization of a JSON Pointer
-to the subschema that was violated.
-
-Individual violation objects can contain other keyword-specific members.
-These are detailed further.
-
-For example, validating this instance:
-
-~~~json
-{"numbers": [1, 2, "3", 4, 5]}
-~~~
-
-against this schema:
-
-~~~json
-{
- "type": "object",
- "properties": {
- "numbers": {"$ref": "numbers.schema.json"}
- }
-}
-~~~
-
-where `numbers.schema.json` refers
-(via a suitable `IRemoteSchemaDocumentProvider`)
-to this schema:
-
-~~~json
-{
- "type": "array",
- "items": {"type": "number"}
-}
-~~~
-
-produces the following error object:
-
-~~~json
-{
- "type": {
- "instanceRef": "#/numbers/2",
- "schemaRef": "numbers.schema.json#/items",
- "expected": ["number"],
- "actual": "string"
- }
-}
-~~~
-
-## Validation keywords for numbers {#Numbers}
-
-### multipleOf {#multipleof}
-
-* `expected`: required number strictly greater than 0.
- The value of the `multipleOf` keyword specified in the schema.
-* `actual`: required number.
- The instance value.
-
-### maximum {#maximum}
-
-* `expected`: required number.
- The value of the `maximum` keyword specified in the schema.
-* `exclusiveMaximum`: optional boolean.
- This will be true if the schema specified `"exclusiveMaximum": true`,
- and will be omitted otherwise.
-* `actual`: required number.
- The instance value.
-
-### minimum {#minimum}
-
-* `expected`: required number.
- The value of the `minimum` keyword specified in the schema.
-* `exclusiveMinimum`: optional boolean.
- This will be true if the schema specified `"exclusiveMinimum": true`,
- and will be omitted otherwise.
-* `actual`: required number.
- The instance value.
-
-## Validation keywords for strings {#Strings}
-
-### maxLength {#maxLength}
-
-* `expected`: required number greater than or equal to 0.
- The value of the `maxLength` keyword specified in the schema.
-* `actual`: required string.
- The instance value.
-
-### minLength {#minLength}
-
-* `expected`: required number greater than or equal to 0.
- The value of the `minLength` keyword specified in the schema.
-* `actual`: required string.
- The instance value.
-
-### pattern {#pattern}
-
-* `actual`: required string.
- The instance value.
-
-(The expected pattern is not reported
-because the internal representation in `SchemaDocument`
-does not store the pattern in original string form.)
-
-## Validation keywords for arrays {#Arrays}
-
-### additionalItems {#additionalItems}
-
-This keyword is reported
-when the value of `items` schema keyword is an array,
-the value of `additionalItems` is `false`,
-and the instance is an array
-with more items than specified in the `items` array.
-
-* `disallowed`: required integer greater than or equal to 0.
- The index of the first item that has no corresponding schema.
-
-### maxItems and minItems {#maxItems-minItems}
-
-* `expected`: required integer greater than or equal to 0.
- The value of `maxItems` (respectively, `minItems`)
- specified in the schema.
-* `actual`: required integer greater than or equal to 0.
- Number of items in the instance array.
-
-### uniqueItems {#uniqueItems}
-
-* `duplicates`: required array
- whose items are integers greater than or equal to 0.
- Indices of items of the instance that are equal.
-
-(RapidJSON only reports the first two equal items,
-for performance reasons.)
-
-## Validation keywords for objects
-
-### maxProperties and minProperties {#maxProperties-minProperties}
-
-* `expected`: required integer greater than or equal to 0.
- The value of `maxProperties` (respectively, `minProperties`)
- specified in the schema.
-* `actual`: required integer greater than or equal to 0.
- Number of properties in the instance object.
-
-### required {#required}
-
-* `missing`: required array of one or more unique strings.
- The names of properties
- that are listed in the value of the `required` schema keyword
- but not present in the instance object.
-
-### additionalProperties {#additionalProperties}
-
-This keyword is reported
-when the schema specifies `additionalProperties: false`
-and the name of a property of the instance is
-neither listed in the `properties` keyword
-nor matches any regular expression in the `patternProperties` keyword.
-
-* `disallowed`: required string.
- Name of the offending property of the instance.
-
-(For performance reasons,
-RapidJSON only reports the first such property encountered.)
-
-### dependencies {#dependencies}
-
-* `errors`: required object with one or more properties.
- Names and values of its properties are described below.
-
-Recall that JSON Schema Draft 04 supports
-*schema dependencies*,
-where presence of a named *controlling* property
-requires the instance object to be valid against a subschema,
-and *property dependencies*,
-where presence of a controlling property
-requires other *dependent* properties to be also present.
-
-For a violated schema dependency,
-`errors` will contain a property
-with the name of the controlling property
-and its value will be the error object
-produced by validating the instance object
-against the dependent schema.
-
-For a violated property dependency,
-`errors` will contain a property
-with the name of the controlling property
-and its value will be an array of one or more unique strings
-listing the missing dependent properties.
-
-## Validation keywords for any instance type {#AnyTypes}
-
-### enum {#enum}
-
-This keyword has no additional properties
-beyond `instanceRef` and `schemaRef`.
-
-* The allowed values are not listed
- because `SchemaDocument` does not store them in original form.
-* The violating value is not reported
- because it might be unwieldy.
-
-If you need to report these details to your users,
-you can access the necessary information
-by following `instanceRef` and `schemaRef`.
-
-### type {#type}
-
-* `expected`: required array of one or more unique strings,
- each of which is one of the seven primitive types
- defined by the JSON Schema Draft 04 Core specification.
- Lists the types allowed by the `type` schema keyword.
-* `actual`: required string, also one of seven primitive types.
- The primitive type of the instance.
-
-### allOf, anyOf, and oneOf {#allOf-anyOf-oneOf}
-
-* `errors`: required array of at least one object.
- There will be as many items as there are subschemas
- in the `allOf`, `anyOf` or `oneOf` schema keyword, respectively.
- Each item will be the error value
- produced by validating the instance
- against the corresponding subschema.
-
-For `allOf`, at least one error value will be non-empty.
-For `anyOf`, all error values will be non-empty.
-For `oneOf`, either all error values will be non-empty,
-or more than one will be empty.
-
-### not {#not}
-
-This keyword has no additional properties
-apart from `instanceRef` and `schemaRef`.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.zh-cn.md
deleted file mode 100644
index c85177f9fd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/schema.zh-cn.md
+++ /dev/null
@@ -1,237 +0,0 @@
-# Schema
-
-(本功能于 v1.1.0 å‘布)
-
-JSON Schema 是æè¿° JSON æ ¼å¼çš„一个标准è‰æ¡ˆã€‚一个 schema 本身也是一个 JSON。使用 JSON Schema 去校验 JSON,å¯ä»¥è®©ä½ çš„代ç å®‰å…¨åœ°è®¿é—® DOM,而无须检查类型或键值是å¦å­˜åœ¨ç­‰ã€‚这也能确ä¿è¾“出的 JSON 是符åˆæŒ‡å®šçš„ schema。
-
-RapidJSON 实现了一个 [JSON Schema Draft v4](http://json-schema.org/documentation.html) 的校验器。若你ä¸ç†Ÿæ‚‰ JSON Schema,å¯ä»¥å‚考 [Understanding JSON Schema](http://spacetelescope.github.io/understanding-json-schema/)。
-
-[TOC]
-
-# 基本用法 {#BasicUsage}
-
-首先,你è¦æŠŠ JSON Schema 解æžæˆ `Document`,å†æŠŠå®ƒç¼–译æˆä¸€ä¸ª `SchemaDocument`。
-
-然åŽï¼Œåˆ©ç”¨è¯¥ `SchemaDocument` 创建一个 `SchemaValidator`。它与 `Writer` ç›¸ä¼¼ï¼Œéƒ½æ˜¯èƒ½å¤Ÿå¤„ç† SAX 事件的。因此,你å¯ä»¥ç”¨ `document.Accept(validator)` 去校验一个 JSON,然åŽå†èŽ·å–校验结果。
-
-~~~cpp
-#include "rapidjson/schema.h"
-
-// ...
-
-Document sd;
-if (sd.Parse(schemaJson).HasParseError()) {
- // æ­¤ schema ä¸æ˜¯åˆæ³•çš„ JSON
- // ...
-}
-SchemaDocument schema(sd); // 把一个 Document 编译至 SchemaDocument
-// 之åŽä¸å†éœ€è¦ sd
-
-Document d;
-if (d.Parse(inputJson).HasParseError()) {
- // 输入ä¸æ˜¯ä¸€ä¸ªåˆæ³•çš„ JSON
- // ...
-}
-
-SchemaValidator validator(schema);
-if (!d.Accept(validator)) {
- // 输入的 JSON ä¸åˆä¹Ž schema
- // 打å°è¯Šæ–­ä¿¡æ¯
- StringBuffer sb;
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- printf("Invalid schema: %s\n", sb.GetString());
- printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
- sb.Clear();
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- printf("Invalid document: %s\n", sb.GetString());
-}
-~~~
-
-一些注æ„点:
-
-* 一个 `SchemaDocment` 能被多个 `SchemaValidator` 引用。它ä¸ä¼šè¢« `SchemaValidator` 修改。
-* å¯ä»¥é‡å¤ä½¿ç”¨ä¸€ä¸ª `SchemaValidator` æ¥æ ¡éªŒå¤šä¸ªæ–‡ä»¶ã€‚在校验其他文件å‰ï¼Œé¡»å…ˆè°ƒç”¨ `validator.Reset()`。
-
-# 在解æžï¼ç”Ÿæˆæ—¶è¿›è¡Œæ ¡éªŒ {#ParsingSerialization}
-
-与大部分 JSON Schema 校验器有所ä¸åŒï¼ŒRapidJSON æ供了一个基于 SAX çš„ schema 校验器实现。因此,你å¯ä»¥åœ¨è¾“å…¥æµè§£æž JSON çš„åŒæ—¶è¿›è¡Œæ ¡éªŒã€‚若校验器é‡åˆ°ä¸€ä¸ªä¸Ž schema ä¸ç¬¦çš„值,就会立å³ç»ˆæ­¢è§£æžã€‚这设计对于解æžå¤§åž‹ JSON 文件时特别有用。
-
-## DOM è§£æž {#DomParsing}
-
-在使用 DOM 进行解æžæ—¶ï¼Œ`Document` 除了接收 SAX 事件外,还需åšä¸€äº›å‡†å¤‡åŠç»“æŸå·¥ä½œï¼Œå› æ­¤ï¼Œä¸ºäº†è¿žæŽ¥ `Reader`ã€`SchemaValidator` å’Œ `Document` è¦åšå¤šä¸€ç‚¹äº‹æƒ…。`SchemaValidatingReader` 是一个辅助类去åšé‚£äº›å·¥ä½œã€‚
-
-~~~cpp
-#include "rapidjson/filereadstream.h"
-
-// ...
-SchemaDocument schema(sd); // 把一个 Document 编译至 SchemaDocument
-
-// 使用 reader è§£æž JSON
-FILE* fp = fopen("big.json", "r");
-FileReadStream is(fp, buffer, sizeof(buffer));
-
-// 用 reader è§£æž JSON,校验它的 SAX 事件,并存储至 d
-Document d;
-SchemaValidatingReader<kParseDefaultFlags, FileReadStream, UTF8<> > reader(is, schema);
-d.Populate(reader);
-
-if (!reader.GetParseResult()) {
- // ä¸æ˜¯ä¸€ä¸ªåˆæ³•çš„ JSON
- // 当 reader.GetParseResult().Code() == kParseErrorTermination,
- // 它å¯èƒ½æ˜¯è¢«ä»¥ä¸‹åŽŸå› ä¸­æ­¢ï¼š
- // (1) 校验器å‘现 JSON ä¸åˆä¹Ž schema;或
- // (2) 输入æµæœ‰ I/O 错误。
-
- // 检查校验结果
- if (!reader.IsValid()) {
- // 输入的 JSON ä¸åˆä¹Ž schema
- // 打å°è¯Šæ–­ä¿¡æ¯
- StringBuffer sb;
- reader.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- printf("Invalid schema: %s\n", sb.GetString());
- printf("Invalid keyword: %s\n", reader.GetInvalidSchemaKeyword());
- sb.Clear();
- reader.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- printf("Invalid document: %s\n", sb.GetString());
- }
-}
-~~~
-
-## SAX è§£æž {#SaxParsing}
-
-使用 SAX 解æžæ—¶ï¼Œæƒ…况就简å•å¾—多。若åªéœ€è¦æ ¡éªŒ JSON 而无需进一步处ç†ï¼Œé‚£ä¹ˆä»…需è¦ï¼š
-
-~~~
-SchemaValidator validator(schema);
-Reader reader;
-if (!reader.Parse(stream, validator)) {
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-è¿™ç§æ–¹å¼å’Œ [schemavalidator](example/schemavalidator/schemavalidator.cpp) 例å­å®Œå…¨ç›¸åŒã€‚这带æ¥çš„独特优势是,无论 JSON 多巨大,永远维æŒä½Žå†…存用é‡ï¼ˆå†…存用é‡åªä¸Ž Schema çš„å¤æ‚度相关)。
-
-若你需è¦è¿›ä¸€æ­¥å¤„ç† SAX 事件,便å¯ä½¿ç”¨æ¨¡æ¿ç±» `GenericSchemaValidator` 去设置校验器的输出 `Handler`:
-
-~~~
-MyHandler handler;
-GenericSchemaValidator<SchemaDocument, MyHandler> validator(schema, handler);
-Reader reader;
-if (!reader.Parse(ss, validator)) {
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-## ç”Ÿæˆ {#Serialization}
-
-我们也å¯ä»¥åœ¨ç”Ÿæˆï¼ˆserialization)的时候进行校验。这能确ä¿è¾“出的 JSON 符åˆä¸€ä¸ª JSON Schema。
-
-~~~
-StringBuffer sb;
-Writer<StringBuffer> writer(sb);
-GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
-if (!d.Accept(validator)) {
- // Some problem during Accept(), it may be validation or encoding issues.
- if (!validator.IsValid()) {
- // ...
- }
-}
-~~~
-
-å½“ç„¶ï¼Œå¦‚æžœä½ çš„åº”ç”¨ä»…éœ€è¦ SAX 风格的生æˆï¼Œé‚£ä¹ˆåªéœ€è¦æŠŠ SAX 事件由原æ¥å‘é€åˆ° `Writer`,改为å‘é€åˆ° `SchemaValidator`。
-
-# 远程 Schema {#RemoteSchema}
-
-JSON Schema æ”¯æŒ [`$ref` 关键字](http://spacetelescope.github.io/understanding-json-schema/structuring.html),它是一个 [JSON pointer](doc/pointer.zh-cn.md) 引用至一个本地(local)或远程(remote) schema。本地指针的首字符是 `#`,而远程指针是一个相对或ç»å¯¹ URI。例如:
-
-~~~js
-{ "$ref": "definitions.json#/address" }
-~~~
-
-由于 `SchemaDocument` 并ä¸çŸ¥é“如何处ç†é‚£äº› URI,它需è¦ä½¿ç”¨è€…æ供一个 `IRemoteSchemaDocumentProvider` 的实例去处ç†ã€‚
-
-~~~
-class MyRemoteSchemaDocumentProvider : public IRemoteSchemaDocumentProvider {
-public:
- virtual const SchemaDocument* GetRemoteDocument(const char* uri, SizeType length) {
- // Resolve the uri and returns a pointer to that schema.
- }
-};
-
-// ...
-
-MyRemoteSchemaDocumentProvider provider;
-SchemaDocument schema(sd, &provider);
-~~~
-
-# 标准的符åˆç¨‹åº¦ {#Conformance}
-
-RapidJSON 通过了 [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) (Json Schema draft 4) 中 263 个测试的 262 个。
-
-没通过的测试是 `refRemote.json` 中的 "change resolution scope" - "changed scope ref invalid"。这是由于未实现 `id` schema å…³é”®å­—åŠ URI åˆå¹¶åŠŸèƒ½ã€‚
-
-除此以外,关于字符串类型的 `format` schema 关键字也会被忽略,因为标准中并没需求必须实现。
-
-## æ­£åˆ™è¡¨è¾¾å¼ {#RegEx}
-
-`pattern` åŠ `patternProperties` 这两个 schema 关键字使用了正则表达å¼åŽ»åŒ¹é…所需的模å¼ã€‚
-
-RapidJSON 实现了一个简å•çš„ NFA 正则表达å¼å¼•æ“Žï¼Œå¹¶é¢„设使用。它支æŒä»¥ä¸‹è¯­æ³•ã€‚
-
-|语法|æè¿°|
-|------|-----------|
-|`ab` | ä¸²è” |
-|<code>a&#124;b</code> | 交替 |
-|`a?` | 零或一次 |
-|`a*` | 零或多次 |
-|`a+` | 一或多次 |
-|`a{3}` | 刚好 3 次 |
-|`a{3,}` | 至少 3 次 |
-|`a{3,5}`| 3 至 5 次 |
-|`(ab)` | 分组 |
-|`^a` | 在开始处 |
-|`a$` | 在结æŸå¤„ |
-|`.` | 任何字符 |
-|`[abc]` | 字符组 |
-|`[a-c]` | 字符组范围 |
-|`[a-z0-9_]` | å­—ç¬¦ç»„ç»„åˆ |
-|`[^abc]` | 字符组å–å |
-|`[^a-c]` | 字符组范围å–å |
-|`[\b]` | 退格符 (U+0008) |
-|<code>\\&#124;</code>, `\\`, ... | 转义字符 |
-|`\f` | 馈页 (U+000C) |
-|`\n` | 馈行 (U+000A) |
-|`\r` | 回车 (U+000D) |
-|`\t` | 制表 (U+0009) |
-|`\v` | 垂直制表 (U+000B) |
-
-对于使用 C++11 编译器的使用者,也å¯ä½¿ç”¨ `std::regex`,åªéœ€å®šä¹‰ `RAPIDJSON_SCHEMA_USE_INTERNALREGEX=0` åŠ `RAPIDJSON_SCHEMA_USE_STDREGEX=1`。若你的 schema 无需使用 `pattern` 或 `patternProperties`,å¯ä»¥æŠŠä¸¤ä¸ªå®éƒ½è®¾ä¸ºé›¶ï¼Œä»¥ç¦ç”¨æ­¤åŠŸèƒ½ï¼Œè¿™æ ·åšå¯èŠ‚çœä¸€äº›ä»£ç ä½“积。
-
-# 性能 {#Performance}
-
-大部分 C++ JSON åº“éƒ½æœªæ”¯æŒ JSON Schema。因此我们å°è¯•æŒ‰ç…§ [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) 去评估 RapidJSON çš„ JSON Schema 校验器。该评测测试了 11 个è¿è¡Œåœ¨ node.js 上的 JavaScript 库。
-
-该评测校验 [JSON Schema Test Suite](https://github.com/json-schema/JSON-Schema-Test-Suite) 中的测试,当中排除了一些测试套件åŠä¸ªåˆ«æµ‹è¯•ã€‚我们在 [`schematest.cpp`](test/perftest/schematest.cpp) 实现了相åŒçš„评测。
-
-在 MacBook Pro (2.8 GHz Intel Core i7) 上收集到以下结果。
-
-|校验器|相对速度|æ¯ç§’执行的测试数目|
-|---------|:------------:|:----------------------------:|
-|RapidJSON|155%|30682|
-|[`ajv`](https://github.com/epoberezkin/ajv)|100%|19770 (± 1.31%)|
-|[`is-my-json-valid`](https://github.com/mafintosh/is-my-json-valid)|70%|13835 (± 2.84%)|
-|[`jsen`](https://github.com/bugventure/jsen)|57.7%|11411 (± 1.27%)|
-|[`schemasaurus`](https://github.com/AlexeyGrishin/schemasaurus)|26%|5145 (± 1.62%)|
-|[`themis`](https://github.com/playlyfe/themis)|19.9%|3935 (± 2.69%)|
-|[`z-schema`](https://github.com/zaggino/z-schema)|7%|1388 (± 0.84%)|
-|[`jsck`](https://github.com/pandastrike/jsck#readme)|3.1%|606 (± 2.84%)|
-|[`jsonschema`](https://github.com/tdegrunt/jsonschema#readme)|0.9%|185 (± 1.01%)|
-|[`skeemas`](https://github.com/Prestaul/skeemas#readme)|0.8%|154 (± 0.79%)|
-|tv4|0.5%|93 (± 0.94%)|
-|[`jayschema`](https://github.com/natesilva/jayschema)|0.1%|21 (± 1.14%)|
-
-æ¢è¨€ä¹‹ï¼ŒRapidJSON 比最快的 JavaScript 库(ajv)快约 1.5x。比最慢的快 1400x。
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.md
deleted file mode 100644
index 5d0b0f35ee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.md
+++ /dev/null
@@ -1,429 +0,0 @@
-# Stream
-
-In RapidJSON, `rapidjson::Stream` is a concept for reading/writing JSON. Here we'll first show you how to use provided streams. And then see how to create a custom stream.
-
-[TOC]
-
-# Memory Streams {#MemoryStreams}
-
-Memory streams store JSON in memory.
-
-## StringStream (Input) {#StringStream}
-
-`StringStream` is the most basic input stream. It represents a complete, read-only JSON stored in memory. It is defined in `rapidjson/rapidjson.h`.
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h" // will include "rapidjson/rapidjson.h"
-
-using namespace rapidjson;
-
-// ...
-const char json[] = "[1, 2, 3, 4]";
-StringStream s(json);
-
-Document d;
-d.ParseStream(s);
-~~~~~~~~~~
-
-Since this is very common usage, `Document::Parse(const char*)` is provided to do exactly the same as above:
-
-~~~~~~~~~~cpp
-// ...
-const char json[] = "[1, 2, 3, 4]";
-Document d;
-d.Parse(json);
-~~~~~~~~~~
-
-Note that, `StringStream` is a typedef of `GenericStringStream<UTF8<> >`, user may use another encodings to represent the character set of the stream.
-
-## StringBuffer (Output) {#StringBuffer}
-
-`StringBuffer` is a simple output stream. It allocates a memory buffer for writing the whole JSON. Use `GetString()` to obtain the buffer.
-
-~~~~~~~~~~cpp
-#include "rapidjson/stringbuffer.h"
-#include <rapidjson/writer.h>
-
-StringBuffer buffer;
-Writer<StringBuffer> writer(buffer);
-d.Accept(writer);
-
-const char* output = buffer.GetString();
-~~~~~~~~~~
-
-When the buffer is full, it will increases the capacity automatically. The default capacity is 256 characters (256 bytes for UTF8, 512 bytes for UTF16, etc.). User can provide an allocator and an initial capacity.
-
-~~~~~~~~~~cpp
-StringBuffer buffer1(0, 1024); // Use its allocator, initial size = 1024
-StringBuffer buffer2(allocator, 1024);
-~~~~~~~~~~
-
-By default, `StringBuffer` will instantiate an internal allocator.
-
-Similarly, `StringBuffer` is a typedef of `GenericStringBuffer<UTF8<> >`.
-
-# File Streams {#FileStreams}
-
-When parsing a JSON from file, you may read the whole JSON into memory and use ``StringStream`` above.
-
-However, if the JSON is big, or memory is limited, you can use `FileReadStream`. It only read a part of JSON from file into buffer, and then let the part be parsed. If it runs out of characters in the buffer, it will read the next part from file.
-
-## FileReadStream (Input) {#FileReadStream}
-
-`FileReadStream` reads the file via a `FILE` pointer. And user need to provide a buffer.
-
-~~~~~~~~~~cpp
-#include "rapidjson/filereadstream.h"
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("big.json", "rb"); // non-Windows use "r"
-
-char readBuffer[65536];
-FileReadStream is(fp, readBuffer, sizeof(readBuffer));
-
-Document d;
-d.ParseStream(is);
-
-fclose(fp);
-~~~~~~~~~~
-
-Different from string streams, `FileReadStream` is byte stream. It does not handle encodings. If the file is not UTF-8, the byte stream can be wrapped in a `EncodedInputStream`. We will discuss more about this later in this tutorial.
-
-Apart from reading file, user can also use `FileReadStream` to read `stdin`.
-
-## FileWriteStream (Output) {#FileWriteStream}
-
-`FileWriteStream` is buffered output stream. Its usage is very similar to `FileReadStream`.
-
-~~~~~~~~~~cpp
-#include "rapidjson/filewritestream.h"
-#include <rapidjson/writer.h>
-#include <cstdio>
-
-using namespace rapidjson;
-
-Document d;
-d.Parse(json);
-// ...
-
-FILE* fp = fopen("output.json", "wb"); // non-Windows use "w"
-
-char writeBuffer[65536];
-FileWriteStream os(fp, writeBuffer, sizeof(writeBuffer));
-
-Writer<FileWriteStream> writer(os);
-d.Accept(writer);
-
-fclose(fp);
-~~~~~~~~~~
-
-It can also redirect the output to `stdout`.
-
-# iostream Wrapper {#iostreamWrapper}
-
-Due to users' requests, RapidJSON also provides official wrappers for `std::basic_istream` and `std::basic_ostream`. However, please note that the performance will be much lower than the other streams above.
-
-## IStreamWrapper {#IStreamWrapper}
-
-`IStreamWrapper` wraps any class derived from `std::istream`, such as `std::istringstream`, `std::stringstream`, `std::ifstream`, `std::fstream`, into RapidJSON's input stream.
-
-~~~cpp
-#include <rapidjson/document.h>
-#include <rapidjson/istreamwrapper.h>
-#include <fstream>
-
-using namespace rapidjson;
-using namespace std;
-
-ifstream ifs("test.json");
-IStreamWrapper isw(ifs);
-
-Document d;
-d.ParseStream(isw);
-~~~
-
-For classes derived from `std::wistream`, use `WIStreamWrapper`.
-
-## OStreamWrapper {#OStreamWrapper}
-
-Similarly, `OStreamWrapper` wraps any class derived from `std::ostream`, such as `std::ostringstream`, `std::stringstream`, `std::ofstream`, `std::fstream`, into RapidJSON's input stream.
-
-~~~cpp
-#include <rapidjson/document.h>
-#include <rapidjson/ostreamwrapper.h>
-#include <rapidjson/writer.h>
-#include <fstream>
-
-using namespace rapidjson;
-using namespace std;
-
-Document d;
-d.Parse(json);
-
-// ...
-
-ofstream ofs("output.json");
-OStreamWrapper osw(ofs);
-
-Writer<OStreamWrapper> writer(osw);
-d.Accept(writer);
-~~~
-
-For classes derived from `std::wostream`, use `WOStreamWrapper`.
-
-# Encoded Streams {#EncodedStreams}
-
-Encoded streams do not contain JSON itself, but they wrap byte streams to provide basic encoding/decoding function.
-
-As mentioned above, UTF-8 byte streams can be read directly. However, UTF-16 and UTF-32 have endian issue. To handle endian correctly, it needs to convert bytes into characters (e.g. `wchar_t` for UTF-16) while reading, and characters into bytes while writing.
-
-Besides, it also need to handle [byte order mark (BOM)](http://en.wikipedia.org/wiki/Byte_order_mark). When reading from a byte stream, it is needed to detect or just consume the BOM if exists. When writing to a byte stream, it can optionally write BOM.
-
-If the encoding of stream is known during compile-time, you may use `EncodedInputStream` and `EncodedOutputStream`. If the stream can be UTF-8, UTF-16LE, UTF-16BE, UTF-32LE, UTF-32BE JSON, and it is only known in runtime, you may use `AutoUTFInputStream` and `AutoUTFOutputStream`. These streams are defined in `rapidjson/encodedstream.h`.
-
-Note that, these encoded streams can be applied to streams other than file. For example, you may have a file in memory, or a custom byte stream, be wrapped in encoded streams.
-
-## EncodedInputStream {#EncodedInputStream}
-
-`EncodedInputStream` has two template parameters. The first one is a `Encoding` class, such as `UTF8`, `UTF16LE`, defined in `rapidjson/encodings.h`. The second one is the class of stream to be wrapped.
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/filereadstream.h" // FileReadStream
-#include "rapidjson/encodedstream.h" // EncodedInputStream
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("utf16le.json", "rb"); // non-Windows use "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-EncodedInputStream<UTF16LE<>, FileReadStream> eis(bis); // wraps bis into eis
-
-Document d; // Document is GenericDocument<UTF8<> >
-d.ParseStream<0, UTF16LE<> >(eis); // Parses UTF-16LE file into UTF-8 in memory
-
-fclose(fp);
-~~~~~~~~~~
-
-## EncodedOutputStream {#EncodedOutputStream}
-
-`EncodedOutputStream` is similar but it has a `bool putBOM` parameter in the constructor, controlling whether to write BOM into output byte stream.
-
-~~~~~~~~~~cpp
-#include "rapidjson/filewritestream.h" // FileWriteStream
-#include "rapidjson/encodedstream.h" // EncodedOutputStream
-#include <rapidjson/writer.h>
-#include <cstdio>
-
-Document d; // Document is GenericDocument<UTF8<> >
-// ...
-
-FILE* fp = fopen("output_utf32le.json", "wb"); // non-Windows use "w"
-
-char writeBuffer[256];
-FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
-
-typedef EncodedOutputStream<UTF32LE<>, FileWriteStream> OutputStream;
-OutputStream eos(bos, true); // Write BOM
-
-Writer<OutputStream, UTF8<>, UTF32LE<>> writer(eos);
-d.Accept(writer); // This generates UTF32-LE file from UTF-8 in memory
-
-fclose(fp);
-~~~~~~~~~~
-
-## AutoUTFInputStream {#AutoUTFInputStream}
-
-Sometimes an application may want to handle all supported JSON encoding. `AutoUTFInputStream` will detection encoding by BOM first. If BOM is unavailable, it will use characteristics of valid JSON to make detection. If neither method success, it falls back to the UTF type provided in constructor.
-
-Since the characters (code units) may be 8-bit, 16-bit or 32-bit. `AutoUTFInputStream` requires a character type which can hold at least 32-bit. We may use `unsigned`, as in the template parameter:
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/filereadstream.h" // FileReadStream
-#include "rapidjson/encodedstream.h" // AutoUTFInputStream
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("any.json", "rb"); // non-Windows use "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // wraps bis into eis
-
-Document d; // Document is GenericDocument<UTF8<> >
-d.ParseStream<0, AutoUTF<unsigned> >(eis); // This parses any UTF file into UTF-8 in memory
-
-fclose(fp);
-~~~~~~~~~~
-
-When specifying the encoding of stream, uses `AutoUTF<CharType>` as in `ParseStream()` above.
-
-You can obtain the type of UTF via `UTFType GetType()`. And check whether a BOM is found by `HasBOM()`
-
-## AutoUTFOutputStream {#AutoUTFOutputStream}
-
-Similarly, to choose encoding for output during runtime, we can use `AutoUTFOutputStream`. This class is not automatic *per se*. You need to specify the UTF type and whether to write BOM in runtime.
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-void WriteJSONFile(FILE* fp, UTFType type, bool putBOM, const Document& d) {
- char writeBuffer[256];
- FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
-
- typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;
- OutputStream eos(bos, type, putBOM);
-
- Writer<OutputStream, UTF8<>, AutoUTF<> > writer;
- d.Accept(writer);
-}
-~~~~~~~~~~
-
-`AutoUTFInputStream` and `AutoUTFOutputStream` is more convenient than `EncodedInputStream` and `EncodedOutputStream`. They just incur a little bit runtime overheads.
-
-# Custom Stream {#CustomStream}
-
-In addition to memory/file streams, user can create their own stream classes which fits RapidJSON's API. For example, you may create network stream, stream from compressed file, etc.
-
-RapidJSON combines different types using templates. A class containing all required interface can be a stream. The Stream interface is defined in comments of `rapidjson/rapidjson.h`:
-
-~~~~~~~~~~cpp
-concept Stream {
- typename Ch; //!< Character type of the stream.
-
- //! Read the current character from stream without moving the read cursor.
- Ch Peek() const;
-
- //! Read the current character from stream and moving the read cursor to next character.
- Ch Take();
-
- //! Get the current read cursor.
- //! \return Number of characters read from start.
- size_t Tell();
-
- //! Begin writing operation at the current read pointer.
- //! \return The begin writer pointer.
- Ch* PutBegin();
-
- //! Write a character.
- void Put(Ch c);
-
- //! Flush the buffer.
- void Flush();
-
- //! End the writing operation.
- //! \param begin The begin write pointer returned by PutBegin().
- //! \return Number of characters written.
- size_t PutEnd(Ch* begin);
-}
-~~~~~~~~~~
-
-For input stream, they must implement `Peek()`, `Take()` and `Tell()`.
-For output stream, they must implement `Put()` and `Flush()`.
-There are two special interface, `PutBegin()` and `PutEnd()`, which are only for *in situ* parsing. Normal streams do not implement them. However, if the interface is not needed for a particular stream, it is still need to a dummy implementation, otherwise will generate compilation error.
-
-## Example: istream wrapper {#ExampleIStreamWrapper}
-
-The following example is a simple wrapper of `std::istream`, which only implements 3 functions.
-
-~~~~~~~~~~cpp
-class MyIStreamWrapper {
-public:
- typedef char Ch;
-
- MyIStreamWrapper(std::istream& is) : is_(is) {
- }
-
- Ch Peek() const { // 1
- int c = is_.peek();
- return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
- }
-
- Ch Take() { // 2
- int c = is_.get();
- return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
- }
-
- size_t Tell() const { return (size_t)is_.tellg(); } // 3
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch) { assert(false); }
- void Flush() { assert(false); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- MyIStreamWrapper(const MyIStreamWrapper&);
- MyIStreamWrapper& operator=(const MyIStreamWrapper&);
-
- std::istream& is_;
-};
-~~~~~~~~~~
-
-User can use it to wrap instances of `std::stringstream`, `std::ifstream`.
-
-~~~~~~~~~~cpp
-const char* json = "[1,2,3,4]";
-std::stringstream ss(json);
-MyIStreamWrapper is(ss);
-
-Document d;
-d.ParseStream(is);
-~~~~~~~~~~
-
-Note that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.
-
-## Example: ostream wrapper {#ExampleOStreamWrapper}
-
-The following example is a simple wrapper of `std::istream`, which only implements 2 functions.
-
-~~~~~~~~~~cpp
-class MyOStreamWrapper {
-public:
- typedef char Ch;
-
- MyOStreamWrapper(std::ostream& os) : os_(os) {
- }
-
- Ch Peek() const { assert(false); return '\0'; }
- Ch Take() { assert(false); return '\0'; }
- size_t Tell() const { }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch c) { os_.put(c); } // 1
- void Flush() { os_.flush(); } // 2
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- MyOStreamWrapper(const MyOStreamWrapper&);
- MyOStreamWrapper& operator=(const MyOStreamWrapper&);
-
- std::ostream& os_;
-};
-~~~~~~~~~~
-
-User can use it to wrap instances of `std::stringstream`, `std::ofstream`.
-
-~~~~~~~~~~cpp
-Document d;
-// ...
-
-std::stringstream ss;
-MyOStreamWrapper os(ss);
-
-Writer<MyOStreamWrapper> writer(os);
-d.Accept(writer);
-~~~~~~~~~~
-
-Note that, this implementation may not be as efficient as RapidJSON's memory or file streams, due to internal overheads of the standard library.
-
-# Summary {#Summary}
-
-This section describes stream classes available in RapidJSON. Memory streams are simple. File stream can reduce the memory required during JSON parsing and generation, if the JSON is stored in file system. Encoded streams converts between byte streams and character streams. Finally, user may create custom streams using a simple interface.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.zh-cn.md
deleted file mode 100644
index 6e379bbd6b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/stream.zh-cn.md
+++ /dev/null
@@ -1,429 +0,0 @@
-# æµ
-
-在 RapidJSON 中,`rapidjson::Stream` 是用於读写 JSON 的概念(概念是指 C++ çš„ concept)。在这里我们先介ç»å¦‚何使用 RapidJSON æ供的å„ç§æµã€‚然åŽå†çœ‹çœ‹å¦‚何自行定义æµã€‚
-
-[TOC]
-
-# å†…å­˜æµ {#MemoryStreams}
-
-内存æµæŠŠ JSON 存储在内存之中。
-
-## StringStream(输入){#StringStream}
-
-`StringStream` 是最基本的输入æµï¼Œå®ƒè¡¨ç¤ºä¸€ä¸ªå®Œæ•´çš„ã€åªè¯»çš„ã€å­˜å‚¨äºŽå†…存的 JSON。它在 `rapidjson/rapidjson.h` 中定义。
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h" // ä¼šåŒ…å« "rapidjson/rapidjson.h"
-
-using namespace rapidjson;
-
-// ...
-const char json[] = "[1, 2, 3, 4]";
-StringStream s(json);
-
-Document d;
-d.ParseStream(s);
-~~~~~~~~~~
-
-由于这是éžå¸¸å¸¸ç”¨çš„用法,RapidJSON æä¾› `Document::Parse(const char*)` 去åšå®Œå…¨ç›¸åŒçš„事情:
-
-~~~~~~~~~~cpp
-// ...
-const char json[] = "[1, 2, 3, 4]";
-Document d;
-d.Parse(json);
-~~~~~~~~~~
-
-需è¦æ³¨æ„,`StringStream` 是 `GenericStringStream<UTF8<> >` çš„ typedef,使用者å¯ç”¨å…¶ä»–ç¼–ç ç±»åŽ»ä»£è¡¨æµæ‰€ä½¿ç”¨çš„字符集。
-
-## StringBuffer(输出){#StringBuffer}
-
-`StringBuffer` 是一个简å•çš„输出æµã€‚它分é…一个内存缓冲区,供写入整个 JSON。å¯ä½¿ç”¨ `GetString()` æ¥èŽ·å–该缓冲区。
-
-~~~~~~~~~~cpp
-#include "rapidjson/stringbuffer.h"
-#include <rapidjson/writer.h>
-
-StringBuffer buffer;
-Writer<StringBuffer> writer(buffer);
-d.Accept(writer);
-
-const char* output = buffer.GetString();
-~~~~~~~~~~
-
-当缓冲区满溢,它将自动增加容é‡ã€‚缺çœå®¹é‡æ˜¯ 256 个字符(UTF8 是 256 字节,UTF16 是 512 字节等)。使用者能自行æ供分é…器åŠåˆå§‹å®¹é‡ã€‚
-
-~~~~~~~~~~cpp
-StringBuffer buffer1(0, 1024); // 使用它的分é…器,åˆå§‹å¤§å° = 1024
-StringBuffer buffer2(allocator, 1024);
-~~~~~~~~~~
-
-如无设置分é…器,`StringBuffer` 会自行实例化一个内部分é…器。
-
-相似地,`StringBuffer` 是 `GenericStringBuffer<UTF8<> >` 的 typedef。
-
-# æ–‡ä»¶æµ {#FileStreams}
-
-当è¦ä»Žæ–‡ä»¶è§£æžä¸€ä¸ª JSON,你å¯ä»¥æŠŠæ•´ä¸ª JSON 读入内存并使用上述的 `StringStream`。
-
-然而,若 JSON 很大,或是内存有é™ï¼Œä½ å¯ä»¥æ”¹ç”¨ `FileReadStream`。它åªä¼šä»Žæ–‡ä»¶è¯»å–一部分至缓冲区,然åŽè®©é‚£éƒ¨åˆ†è¢«è§£æžã€‚若缓冲区的字符都被读完,它会å†ä»Žæ–‡ä»¶è¯»å–下一部分。
-
-## FileReadStream(输入) {#FileReadStream}
-
-`FileReadStream` 通过 `FILE` 指针读å–文件。使用者需è¦æ供一个缓冲区。
-
-~~~~~~~~~~cpp
-#include "rapidjson/filereadstream.h"
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("big.json", "rb"); // éž Windows å¹³å°ä½¿ç”¨ "r"
-
-char readBuffer[65536];
-FileReadStream is(fp, readBuffer, sizeof(readBuffer));
-
-Document d;
-d.ParseStream(is);
-
-fclose(fp);
-~~~~~~~~~~
-
-与 `StringStreams` ä¸ä¸€æ ·ï¼Œ`FileReadStream` 是一个字节æµã€‚它ä¸å¤„ç†ç¼–ç ã€‚è‹¥æ–‡ä»¶å¹¶éž UTF-8 ç¼–ç ï¼Œå¯ä»¥æŠŠå­—节æµç”¨ `EncodedInputStream` 包装。我们很快会讨论这个问题。
-
-除了读å–文件,使用者也å¯ä»¥ä½¿ç”¨ `FileReadStream` æ¥è¯»å– `stdin`。
-
-## FileWriteStream(输出){#FileWriteStream}
-
-`FileWriteStream` 是一个å«ç¼“冲功能的输出æµã€‚它的用法与 `FileReadStream` éžå¸¸ç›¸ä¼¼ã€‚
-
-~~~~~~~~~~cpp
-#include "rapidjson/filewritestream.h"
-#include <rapidjson/writer.h>
-#include <cstdio>
-
-using namespace rapidjson;
-
-Document d;
-d.Parse(json);
-// ...
-
-FILE* fp = fopen("output.json", "wb"); // éž Windows å¹³å°ä½¿ç”¨ "w"
-
-char writeBuffer[65536];
-FileWriteStream os(fp, writeBuffer, sizeof(writeBuffer));
-
-Writer<FileWriteStream> writer(os);
-d.Accept(writer);
-
-fclose(fp);
-~~~~~~~~~~
-
-它也å¯ä»¥æŠŠè¾“å‡ºå¯¼å‘ `stdout`。
-
-# iostream 包装类 {#iostreamWrapper}
-
-基于用户的è¦æ±‚,RapidJSON æ供了正å¼çš„ `std::basic_istream` å’Œ `std::basic_ostream` 包装类。然而,请注æ„其性能会大大低于以上的其他æµã€‚
-
-## IStreamWrapper {#IStreamWrapper}
-
-`IStreamWrapper` 把任何继承自 `std::istream` 的类(如 `std::istringstream`ã€`std::stringstream`ã€`std::ifstream`ã€`std::fstream`ï¼‰åŒ…è£…æˆ RapidJSON 的输入æµã€‚
-
-~~~cpp
-#include <rapidjson/document.h>
-#include <rapidjson/istreamwrapper.h>
-#include <fstream>
-
-using namespace rapidjson;
-using namespace std;
-
-ifstream ifs("test.json");
-IStreamWrapper isw(ifs);
-
-Document d;
-d.ParseStream(isw);
-~~~
-
-对于继承自 `std::wistream` 的类,则使用 `WIStreamWrapper`。
-
-## OStreamWrapper {#OStreamWrapper}
-
-相似地,`OStreamWrapper` 把任何继承自 `std::ostream` 的类(如 `std::ostringstream`ã€`std::stringstream`ã€`std::ofstream`ã€`std::fstream`ï¼‰åŒ…è£…æˆ RapidJSON 的输出æµã€‚
-
-~~~cpp
-#include <rapidjson/document.h>
-#include <rapidjson/ostreamwrapper.h>
-#include <rapidjson/writer.h>
-#include <fstream>
-
-using namespace rapidjson;
-using namespace std;
-
-Document d;
-d.Parse(json);
-
-// ...
-
-ofstream ofs("output.json");
-OStreamWrapper osw(ofs);
-
-Writer<OStreamWrapper> writer(osw);
-d.Accept(writer);
-~~~
-
-对于继承自 `std::wistream` 的类,则使用 `WIStreamWrapper`。
-
-# ç¼–ç æµ {#EncodedStreams}
-
-ç¼–ç æµï¼ˆencoded streams)本身ä¸å­˜å‚¨ JSON,它们是通过包装字节æµæ¥æ供基本的编ç ï¼è§£ç åŠŸèƒ½ã€‚
-
-如上所述,我们å¯ä»¥ç›´æŽ¥è¯»å…¥ UTF-8 字节æµã€‚然而,UTF-16 åŠ UTF-32 有字节åºï¼ˆendian)问题。è¦æ­£ç¡®åœ°å¤„ç†å­—节åºï¼Œéœ€è¦åœ¨è¯»å–时把字节转æ¢æˆå­—符(如对 UTF-16 使用 `wchar_t`),以åŠåœ¨å†™å…¥æ—¶æŠŠå­—符转æ¢ä¸ºå­—节。
-
-除此以外,我们也需è¦å¤„ç† [字节顺åºæ ‡è®°ï¼ˆbyte order mark, BOM)](http://en.wikipedia.org/wiki/Byte_order_mark)。当从一个字节æµè¯»å–时,需è¦æ£€æµ‹ BOM,或者仅仅是把存在的 BOM 消去。当把 JSON 写入字节æµæ—¶ï¼Œä¹Ÿå¯é€‰æ‹©å†™å…¥ BOM。
-
-若一个æµçš„ç¼–ç åœ¨ç¼–译期已知,你å¯ä½¿ç”¨ `EncodedInputStream` åŠ `EncodedOutputStream`。若一个æµå¯èƒ½å­˜å‚¨ UTF-8ã€UTF-16LEã€UTF-16BEã€UTF-32LEã€UTF-32BE çš„ JSON,并且编ç åªèƒ½åœ¨è¿è¡Œæ—¶å¾—知,你便å¯ä»¥ä½¿ç”¨ `AutoUTFInputStream` åŠ `AutoUTFOutputStream`。这些æµå®šä¹‰åœ¨ `rapidjson/encodedstream.h`。
-
-注æ„到,这些编ç æµå¯ä»¥æ–½äºŽæ–‡ä»¶ä»¥å¤–çš„æµã€‚例如,你å¯ä»¥ç”¨ç¼–ç æµåŒ…装内存中的文件或自定义的字节æµã€‚
-
-## EncodedInputStream {#EncodedInputStream}
-
-`EncodedInputStream` å«ä¸¤ä¸ªæ¨¡æ¿å‚数。第一个是 `Encoding` 类型,例如定义于 `rapidjson/encodings.h` çš„ `UTF8`ã€`UTF16LE`。第二个å‚数是被包装的æµçš„类型。
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/filereadstream.h" // FileReadStream
-#include "rapidjson/encodedstream.h" // EncodedInputStream
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("utf16le.json", "rb"); // éž Windows å¹³å°ä½¿ç”¨ "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-EncodedInputStream<UTF16LE<>, FileReadStream> eis(bis); // 用 eis 包装 bis
-
-Document d; // Document 为 GenericDocument<UTF8<> >
-d.ParseStream<0, UTF16LE<> >(eis); // 把 UTF-16LE 文件解æžè‡³å†…存中的 UTF-8
-
-fclose(fp);
-~~~~~~~~~~
-
-## EncodedOutputStream {#EncodedOutputStream}
-
-`EncodedOutputStream` 也是相似的,但它的构造函数有一个 `bool putBOM` å‚数,用于控制是å¦åœ¨è¾“出字节æµå†™å…¥ BOM。
-
-~~~~~~~~~~cpp
-#include "rapidjson/filewritestream.h" // FileWriteStream
-#include "rapidjson/encodedstream.h" // EncodedOutputStream
-#include <rapidjson/writer.h>
-#include <cstdio>
-
-Document d; // Document 为 GenericDocument<UTF8<> >
-// ...
-
-FILE* fp = fopen("output_utf32le.json", "wb"); // éž Windows å¹³å°ä½¿ç”¨ "w"
-
-char writeBuffer[256];
-FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
-
-typedef EncodedOutputStream<UTF32LE<>, FileWriteStream> OutputStream;
-OutputStream eos(bos, true); // 写入 BOM
-
-Writer<OutputStream, UTF8<>, UTF32LE<>> writer(eos);
-d.Accept(writer); // 这里从内存的 UTF-8 ç”Ÿæˆ UTF32-LE 文件
-
-fclose(fp);
-~~~~~~~~~~
-
-## AutoUTFInputStream {#AutoUTFInputStream}
-
-有时候,应用软件å¯èƒ½éœ€è¦ã²ƒç†æ‰€æœ‰å¯æ”¯æŒçš„ JSON ç¼–ç ã€‚`AutoUTFInputStream` 会先使用 BOM æ¥æ£€æµ‹ç¼–ç ã€‚è‹¥ BOM ä¸å­˜åœ¨ï¼Œå®ƒä¾¿ä¼šä½¿ç”¨åˆæ³• JSON 的特性æ¥æ£€æµ‹ã€‚若两ç§æ–¹æ³•éƒ½å¤±è´¥ï¼Œå®ƒå°±ä¼šå€’退至构造函数æ供的 UTF 类型。
-
-由于字符(编ç å•å…ƒï¼code unit)å¯èƒ½æ˜¯ 8 ä½ã€16 ä½æˆ– 32 ä½ï¼Œ`AutoUTFInputStream` 需è¦ä¸€ä¸ªèƒ½è‡³å°‘储存 32 ä½çš„字符类型。我们å¯ä»¥ä½¿ç”¨ `unsigned` 作为模æ¿å‚数:
-
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-#include "rapidjson/filereadstream.h" // FileReadStream
-#include "rapidjson/encodedstream.h" // AutoUTFInputStream
-#include <cstdio>
-
-using namespace rapidjson;
-
-FILE* fp = fopen("any.json", "rb"); // éž Windows å¹³å°ä½¿ç”¨ "r"
-
-char readBuffer[256];
-FileReadStream bis(fp, readBuffer, sizeof(readBuffer));
-
-AutoUTFInputStream<unsigned, FileReadStream> eis(bis); // 用 eis 包装 bis
-
-Document d; // Document 为 GenericDocument<UTF8<> >
-d.ParseStream<0, AutoUTF<unsigned> >(eis); // 把任何 UTF ç¼–ç çš„文件解æžè‡³å†…存中的 UTF-8
-
-fclose(fp);
-~~~~~~~~~~
-
-当è¦æŒ‡å®šæµçš„ç¼–ç ï¼Œå¯ä½¿ç”¨ä¸Šé¢ä¾‹å­ä¸­ `ParseStream()` çš„å‚æ•° `AutoUTF<CharType>`。
-
-ä½ å¯ä»¥ä½¿ç”¨ `UTFType GetType()` åŽ»èŽ·å– UTF 类型,并且用 `HasBOM()` 检测输入æµæ˜¯å¦å«æœ‰ BOM。
-
-## AutoUTFOutputStream {#AutoUTFOutputStream}
-
-相似地,è¦åœ¨è¿è¡Œæ—¶é€‰æ‹©è¾“出的编ç ï¼Œæˆ‘们å¯ä½¿ç”¨ `AutoUTFOutputStream`。这个类本身并éžã€Œè‡ªåŠ¨ã€ã€‚你需è¦åœ¨è¿è¡Œæ—¶æŒ‡å®š UTF 类型,以åŠæ˜¯å¦å†™å…¥ BOM。
-
-~~~~~~~~~~cpp
-using namespace rapidjson;
-
-void WriteJSONFile(FILE* fp, UTFType type, bool putBOM, const Document& d) {
- char writeBuffer[256];
- FileWriteStream bos(fp, writeBuffer, sizeof(writeBuffer));
-
- typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream;
- OutputStream eos(bos, type, putBOM);
-
- Writer<OutputStream, UTF8<>, AutoUTF<> > writer;
- d.Accept(writer);
-}
-~~~~~~~~~~
-
-`AutoUTFInputStream`ï¼`AutoUTFOutputStream` 是比 `EncodedInputStream`ï¼`EncodedOutputStream` 方便。但å‰è€…会产生一点è¿è¡ŒæœŸé¢å¤–开销。
-
-# è‡ªå®šä¹‰æµ {#CustomStream}
-
-除了内存ï¼æ–‡ä»¶æµï¼Œä½¿ç”¨è€…å¯åˆ›å»ºè‡ªè¡Œå®šä¹‰é€‚é… RapidJSON API çš„æµç±»ã€‚例如,你å¯ä»¥åˆ›å»ºç½‘络æµã€ä»ŽåŽ‹ç¼©æ–‡ä»¶è¯»å–çš„æµç­‰ç­‰ã€‚
-
-RapidJSON 利用模æ¿ç»“åˆä¸åŒçš„类型。åªè¦ä¸€ä¸ªç±»åŒ…å«æ‰€æœ‰æ‰€éœ€çš„接å£ï¼Œå°±å¯ä»¥ä½œä¸ºä¸€ä¸ªæµã€‚æµçš„接åˆå®šä¹‰åœ¨ `rapidjson/rapidjson.h` 的注释里:
-
-~~~~~~~~~~cpp
-concept Stream {
- typename Ch; //!< æµçš„字符类型
-
- //! 从æµè¯»å–当å‰å­—符,ä¸ç§»åŠ¨è¯»å–指针(read cursor)
- Ch Peek() const;
-
- //! 从æµè¯»å–当å‰å­—符,移动读å–指针至下一字符。
- Ch Take();
-
- //! 获å–读å–指针。
- //! \return 从开始以æ¥æ‰€è¯»è¿‡çš„字符数é‡ã€‚
- size_t Tell();
-
- //! 从当å‰è¯»å–指针开始写入æ“作。
- //! \return 返回开始写入的指针。
- Ch* PutBegin();
-
- //! 写入一个字符。
- void Put(Ch c);
-
- //! 清空缓冲区。
- void Flush();
-
- //! 完æˆå†™ä½œæ“作。
- //! \param begin PutBegin() 返回的开始写入指针。
- //! \return 已写入的字符数é‡ã€‚
- size_t PutEnd(Ch* begin);
-}
-~~~~~~~~~~
-
-输入æµå¿…须实现 `Peek()`ã€`Take()` åŠ `Tell()`。
-输出æµå¿…须实现 `Put()` åŠ `Flush()`。
-`PutBegin()` åŠ `PutEnd()` 是特殊的接å£ï¼Œä»…用于原ä½ï¼ˆ*in situ*)解æžã€‚一般的æµä¸éœ€å®žçŽ°å®ƒä»¬ã€‚然而,å³ä½¿æŽ¥å£ä¸éœ€ç”¨äºŽæŸäº›æµï¼Œä»ç„¶éœ€è¦æ供空实现,å¦åˆ™ä¼šäº§ç”Ÿç¼–译错误。
-
-## 例å­ï¼šistream 的包装类 {#ExampleIStreamWrapper}
-
-以下的简å•ä¾‹å­æ˜¯ `std::istream` 的包装类,它åªéœ€çŽ° 3 个函数。
-
-~~~~~~~~~~cpp
-class MyIStreamWrapper {
-public:
- typedef char Ch;
-
- MyIStreamWrapper(std::istream& is) : is_(is) {
- }
-
- Ch Peek() const { // 1
- int c = is_.peek();
- return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
- }
-
- Ch Take() { // 2
- int c = is_.get();
- return c == std::char_traits<char>::eof() ? '\0' : (Ch)c;
- }
-
- size_t Tell() const { return (size_t)is_.tellg(); } // 3
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch) { assert(false); }
- void Flush() { assert(false); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- MyIStreamWrapper(const MyIStreamWrapper&);
- MyIStreamWrapper& operator=(const MyIStreamWrapper&);
-
- std::istream& is_;
-};
-~~~~~~~~~~
-
-使用者能用它æ¥åŒ…装 `std::stringstream`ã€`std::ifstream` 的实例。
-
-~~~~~~~~~~cpp
-const char* json = "[1,2,3,4]";
-std::stringstream ss(json);
-MyIStreamWrapper is(ss);
-
-Document d;
-d.ParseStream(is);
-~~~~~~~~~~
-
-但è¦æ³¨æ„,由于标准库的内部开销问,此实现的性能å¯èƒ½ä¸å¦‚ RapidJSON 的内存ï¼æ–‡ä»¶æµã€‚
-
-## 例å­ï¼šostream 的包装类 {#ExampleOStreamWrapper}
-
-以下的例å­æ˜¯ `std::istream` 的包装类,它åªéœ€å®žçŽ° 2 个函数。
-
-~~~~~~~~~~cpp
-class MyOStreamWrapper {
-public:
- typedef char Ch;
-
- OStreamWrapper(std::ostream& os) : os_(os) {
- }
-
- Ch Peek() const { assert(false); return '\0'; }
- Ch Take() { assert(false); return '\0'; }
- size_t Tell() const { }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch c) { os_.put(c); } // 1
- void Flush() { os_.flush(); } // 2
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- MyOStreamWrapper(const MyOStreamWrapper&);
- MyOStreamWrapper& operator=(const MyOStreamWrapper&);
-
- std::ostream& os_;
-};
-~~~~~~~~~~
-
-使用者能用它æ¥åŒ…装 `std::stringstream`ã€`std::ofstream` 的实例。
-
-~~~~~~~~~~cpp
-Document d;
-// ...
-
-std::stringstream ss;
-MyOStreamWrapper os(ss);
-
-Writer<MyOStreamWrapper> writer(os);
-d.Accept(writer);
-~~~~~~~~~~
-
-但è¦æ³¨æ„,由于标准库的内部开销问,此实现的性能å¯èƒ½ä¸å¦‚ RapidJSON 的内存ï¼æ–‡ä»¶æµã€‚
-
-# 总结 {#Summary}
-
-本节æ述了 RapidJSON æ供的å„ç§æµçš„类。内存æµå¾ˆç®€å•ã€‚è‹¥ JSON 存储在文件中,文件æµå¯å‡å°‘ JSON 解æžåŠç”Ÿæˆæ‰€éœ€çš„内存é‡ã€‚ç¼–ç æµåœ¨å­—节æµå’Œå­—符æµä¹‹é—´ä½œè½¬æ¢ã€‚最åŽï¼Œä½¿ç”¨è€…å¯ä½¿ç”¨ä¸€ä¸ªç®€å•æŽ¥å£åˆ›å»ºè‡ªå®šä¹‰çš„æµã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.md
deleted file mode 100644
index a86aafdfc0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.md
+++ /dev/null
@@ -1,536 +0,0 @@
-# Tutorial
-
-This tutorial introduces the basics of the Document Object Model(DOM) API.
-
-As shown in [Usage at a glance](@ref index), JSON can be parsed into a DOM, and then the DOM can be queried and modified easily, and finally be converted back to JSON.
-
-[TOC]
-
-# Value & Document {#ValueDocument}
-
-Each JSON value is stored in a type called `Value`. A `Document`, representing the DOM, contains the root `Value` of the DOM tree. All public types and functions of RapidJSON are defined in the `rapidjson` namespace.
-
-# Query Value {#QueryValue}
-
-In this section, we will use excerpt from `example/tutorial/tutorial.cpp`.
-
-Assume we have the following JSON stored in a C string (`const char* json`):
-~~~~~~~~~~js
-{
- "hello": "world",
- "t": true ,
- "f": false,
- "n": null,
- "i": 123,
- "pi": 3.1416,
- "a": [1, 2, 3, 4]
-}
-~~~~~~~~~~
-
-Parse it into a `Document`:
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-
-using namespace rapidjson;
-
-// ...
-Document document;
-document.Parse(json);
-~~~~~~~~~~
-
-The JSON is now parsed into `document` as a *DOM tree*:
-
-![DOM in the tutorial](diagram/tutorial.png)
-
-Since the update to RFC 7159, the root of a conforming JSON document can be any JSON value. In earlier RFC 4627, only objects or arrays were allowed as root values. In this case, the root is an object.
-~~~~~~~~~~cpp
-assert(document.IsObject());
-~~~~~~~~~~
-
-Let's query whether a `"hello"` member exists in the root object. Since a `Value` can contain different types of value, we may need to verify its type and use suitable API to obtain the value. In this example, `"hello"` member associates with a JSON string.
-~~~~~~~~~~cpp
-assert(document.HasMember("hello"));
-assert(document["hello"].IsString());
-printf("hello = %s\n", document["hello"].GetString());
-~~~~~~~~~~
-
-~~~~~~~~~~
-hello = world
-~~~~~~~~~~
-
-JSON true/false values are represented as `bool`.
-~~~~~~~~~~cpp
-assert(document["t"].IsBool());
-printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
-~~~~~~~~~~
-
-~~~~~~~~~~
-t = true
-~~~~~~~~~~
-
-JSON null can be queried with `IsNull()`.
-~~~~~~~~~~cpp
-printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
-~~~~~~~~~~
-
-~~~~~~~~~~
-n = null
-~~~~~~~~~~
-
-JSON number type represents all numeric values. However, C++ needs more specific type for manipulation.
-
-~~~~~~~~~~cpp
-assert(document["i"].IsNumber());
-
-// In this case, IsUint()/IsInt64()/IsUint64() also return true.
-assert(document["i"].IsInt());
-printf("i = %d\n", document["i"].GetInt());
-// Alternatively (int)document["i"]
-
-assert(document["pi"].IsNumber());
-assert(document["pi"].IsDouble());
-printf("pi = %g\n", document["pi"].GetDouble());
-~~~~~~~~~~
-
-~~~~~~~~~~
-i = 123
-pi = 3.1416
-~~~~~~~~~~
-
-JSON array contains a number of elements.
-~~~~~~~~~~cpp
-// Using a reference for consecutive access is handy and faster.
-const Value& a = document["a"];
-assert(a.IsArray());
-for (SizeType i = 0; i < a.Size(); i++) // Uses SizeType instead of size_t
- printf("a[%d] = %d\n", i, a[i].GetInt());
-~~~~~~~~~~
-
-~~~~~~~~~~
-a[0] = 1
-a[1] = 2
-a[2] = 3
-a[3] = 4
-~~~~~~~~~~
-
-Note that, RapidJSON does not automatically convert values between JSON types. For example, if a value is a string, it is invalid to call `GetInt()`. In debug mode it will fail on assertion. In release mode, the behavior is undefined.
-
-In the following sections we discuss details about querying individual types.
-
-## Query Array {#QueryArray}
-
-By default, `SizeType` is typedef of `unsigned`. In most systems, an array is limited to store up to 2^32-1 elements.
-
-You may access the elements in an array by integer literal, for example, `a[0]`, `a[1]`, `a[2]`.
-
-Array is similar to `std::vector`: instead of using indices, you may also use iterator to access all the elements.
-~~~~~~~~~~cpp
-for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
- printf("%d ", itr->GetInt());
-~~~~~~~~~~
-
-And other familiar query functions:
-* `SizeType Capacity() const`
-* `bool Empty() const`
-
-### Range-based For Loop (New in v1.1.0)
-
-When C++11 is enabled, you can use range-based for loop to access all elements in an array.
-
-~~~~~~~~~~cpp
-for (auto& v : a.GetArray())
- printf("%d ", v.GetInt());
-~~~~~~~~~~
-
-## Query Object {#QueryObject}
-
-Similar to Array, we can access all object members by iterator:
-
-~~~~~~~~~~cpp
-static const char* kTypeNames[] =
- { "Null", "False", "True", "Object", "Array", "String", "Number" };
-
-for (Value::ConstMemberIterator itr = document.MemberBegin();
- itr != document.MemberEnd(); ++itr)
-{
- printf("Type of member %s is %s\n",
- itr->name.GetString(), kTypeNames[itr->value.GetType()]);
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-Type of member hello is String
-Type of member t is True
-Type of member f is False
-Type of member n is Null
-Type of member i is Number
-Type of member pi is Number
-Type of member a is Array
-~~~~~~~~~~
-
-Note that, when `operator[](const char*)` cannot find the member, it will fail on assertion.
-
-If we are unsure whether a member exists, we need to call `HasMember()` before calling `operator[](const char*)`. However, this incurs two lookup. A better way is to call `FindMember()`, which can check the existence of a member and obtain its value at once:
-
-~~~~~~~~~~cpp
-Value::ConstMemberIterator itr = document.FindMember("hello");
-if (itr != document.MemberEnd())
- printf("%s\n", itr->value.GetString());
-~~~~~~~~~~
-
-### Range-based For Loop (New in v1.1.0)
-
-When C++11 is enabled, you can use range-based for loop to access all members in an object.
-
-~~~~~~~~~~cpp
-for (auto& m : document.GetObject())
- printf("Type of member %s is %s\n",
- m.name.GetString(), kTypeNames[m.value.GetType()]);
-~~~~~~~~~~
-
-## Querying Number {#QueryNumber}
-
-JSON provides a single numerical type called Number. Number can be an integer or a real number. RFC 4627 says the range of Number is specified by the parser implementation.
-
-As C++ provides several integer and floating point number types, the DOM tries to handle these with the widest possible range and good performance.
-
-When a Number is parsed, it is stored in the DOM as one of the following types:
-
-Type | Description
------------|---------------------------------------
-`unsigned` | 32-bit unsigned integer
-`int` | 32-bit signed integer
-`uint64_t` | 64-bit unsigned integer
-`int64_t` | 64-bit signed integer
-`double` | 64-bit double precision floating point
-
-When querying a number, you can check whether the number can be obtained as the target type:
-
-Checking | Obtaining
-------------------|---------------------
-`bool IsNumber()` | N/A
-`bool IsUint()` | `unsigned GetUint()`
-`bool IsInt()` | `int GetInt()`
-`bool IsUint64()` | `uint64_t GetUint64()`
-`bool IsInt64()` | `int64_t GetInt64()`
-`bool IsDouble()` | `double GetDouble()`
-
-Note that, an integer value may be obtained in various ways without conversion. For example, A value `x` containing 123 will make `x.IsInt() == x.IsUint() == x.IsInt64() == x.IsUint64() == true`. But a value `y` containing -3000000000 will only make `x.IsInt64() == true`.
-
-When obtaining the numeric values, `GetDouble()` will convert internal integer representation to a `double`. Note that, `int` and `unsigned` can be safely converted to `double`, but `int64_t` and `uint64_t` may lose precision (since mantissa of `double` is only 52-bits).
-
-## Query String {#QueryString}
-
-In addition to `GetString()`, the `Value` class also contains `GetStringLength()`. Here explains why:
-
-According to RFC 4627, JSON strings can contain Unicode character `U+0000`, which must be escaped as `"\u0000"`. The problem is that, C/C++ often uses null-terminated string, which treats `\0` as the terminator symbol.
-
-To conform with RFC 4627, RapidJSON supports string containing `U+0000` character. If you need to handle this, you can use `GetStringLength()` to obtain the correct string length.
-
-For example, after parsing the following JSON to `Document d`:
-
-~~~~~~~~~~js
-{ "s" : "a\u0000b" }
-~~~~~~~~~~
-The correct length of the string `"a\u0000b"` is 3, as returned by `GetStringLength()`. But `strlen()` returns 1.
-
-`GetStringLength()` can also improve performance, as user may often need to call `strlen()` for allocating buffer.
-
-Besides, `std::string` also support a constructor:
-
-~~~~~~~~~~cpp
-string(const char* s, size_t count);
-~~~~~~~~~~
-
-which accepts the length of string as parameter. This constructor supports storing null character within the string, and should also provide better performance.
-
-## Comparing values
-
-You can use `==` and `!=` to compare values. Two values are equal if and only if they have same type and contents. You can also compare values with primitive types. Here is an example:
-
-~~~~~~~~~~cpp
-if (document["hello"] == document["n"]) /*...*/; // Compare values
-if (document["hello"] == "world") /*...*/; // Compare value with literal string
-if (document["i"] != 123) /*...*/; // Compare with integers
-if (document["pi"] != 3.14) /*...*/; // Compare with double.
-~~~~~~~~~~
-
-Array/object compares their elements/members in order. They are equal if and only if their whole subtrees are equal.
-
-Note that, currently if an object contains duplicated named member, comparing equality with any object is always `false`.
-
-# Create/Modify Values {#CreateModifyValues}
-
-There are several ways to create values. After a DOM tree is created and/or modified, it can be saved as JSON again using `Writer`.
-
-## Change Value Type {#ChangeValueType}
-When creating a `Value` or `Document` by default constructor, its type is Null. To change its type, call `SetXXX()` or assignment operator, for example:
-
-~~~~~~~~~~cpp
-Document d; // Null
-d.SetObject();
-
-Value v; // Null
-v.SetInt(10);
-v = 10; // Shortcut, same as above
-~~~~~~~~~~
-
-### Overloaded Constructors
-There are also overloaded constructors for several types:
-
-~~~~~~~~~~cpp
-Value b(true); // calls Value(bool)
-Value i(-123); // calls Value(int)
-Value u(123u); // calls Value(unsigned)
-Value d(1.5); // calls Value(double)
-~~~~~~~~~~
-
-To create empty object or array, you may use `SetObject()`/`SetArray()` after default constructor, or using the `Value(Type)` in one call:
-
-~~~~~~~~~~cpp
-Value o(kObjectType);
-Value a(kArrayType);
-~~~~~~~~~~
-
-## Move Semantics {#MoveSemantics}
-
-A very special decision during design of RapidJSON is that, assignment of value does not copy the source value to destination value. Instead, the value from source is moved to the destination. For example,
-
-~~~~~~~~~~cpp
-Value a(123);
-Value b(456);
-a = b; // b becomes a Null value, a becomes number 456.
-~~~~~~~~~~
-
-![Assignment with move semantics.](diagram/move1.png)
-
-Why? What is the advantage of this semantics?
-
-The simple answer is performance. For fixed size JSON types (Number, True, False, Null), copying them is fast and easy. However, For variable size JSON types (String, Array, Object), copying them will incur a lot of overheads. And these overheads are often unnoticed. Especially when we need to create temporary object, copy it to another variable, and then destruct it.
-
-For example, if normal *copy* semantics was used:
-
-~~~~~~~~~~cpp
-Document d;
-Value o(kObjectType);
-{
- Value contacts(kArrayType);
- // adding elements to contacts array.
- // ...
- o.AddMember("contacts", contacts, d.GetAllocator()); // deep clone contacts (may be with lots of allocations)
- // destruct contacts.
-}
-~~~~~~~~~~
-
-![Copy semantics makes a lots of copy operations.](diagram/move2.png)
-
-The object `o` needs to allocate a buffer of same size as contacts, makes a deep clone of it, and then finally contacts is destructed. This will incur a lot of unnecessary allocations/deallocations and memory copying.
-
-There are solutions to prevent actual copying these data, such as reference counting and garbage collection(GC).
-
-To make RapidJSON simple and fast, we chose to use *move* semantics for assignment. It is similar to `std::auto_ptr` which transfer ownership during assignment. Move is much faster and simpler, it just destructs the original value, `memcpy()` the source to destination, and finally sets the source as Null type.
-
-So, with move semantics, the above example becomes:
-
-~~~~~~~~~~cpp
-Document d;
-Value o(kObjectType);
-{
- Value contacts(kArrayType);
- // adding elements to contacts array.
- o.AddMember("contacts", contacts, d.GetAllocator()); // just memcpy() of contacts itself to the value of new member (16 bytes)
- // contacts became Null here. Its destruction is trivial.
-}
-~~~~~~~~~~
-
-![Move semantics makes no copying.](diagram/move3.png)
-
-This is called move assignment operator in C++11. As RapidJSON supports C++03, it adopts move semantics using assignment operator, and all other modifying function like `AddMember()`, `PushBack()`.
-
-### Move semantics and temporary values {#TemporaryValues}
-
-Sometimes, it is convenient to construct a Value in place, before passing it to one of the "moving" functions, like `PushBack()` or `AddMember()`. As temporary objects can't be converted to proper Value references, the convenience function `Move()` is available:
-
-~~~~~~~~~~cpp
-Value a(kArrayType);
-Document::AllocatorType& allocator = document.GetAllocator();
-// a.PushBack(Value(42), allocator); // will not compile
-a.PushBack(Value().SetInt(42), allocator); // fluent API
-a.PushBack(Value(42).Move(), allocator); // same as above
-~~~~~~~~~~
-
-## Create String {#CreateString}
-RapidJSON provides two strategies for storing string.
-
-1. copy-string: allocates a buffer, and then copy the source data into it.
-2. const-string: simply store a pointer of string.
-
-Copy-string is always safe because it owns a copy of the data. Const-string can be used for storing a string literal, and for in-situ parsing which will be mentioned in the DOM section.
-
-To make memory allocation customizable, RapidJSON requires users to pass an instance of allocator, whenever an operation may require allocation. This design is needed to prevent storing an allocator (or Document) pointer per Value.
-
-Therefore, when we assign a copy-string, we call this overloaded `SetString()` with allocator:
-
-~~~~~~~~~~cpp
-Document document;
-Value author;
-char buffer[10];
-int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // dynamically created string.
-author.SetString(buffer, len, document.GetAllocator());
-memset(buffer, 0, sizeof(buffer));
-// author.GetString() still contains "Milo Yip" after buffer is destroyed
-~~~~~~~~~~
-
-In this example, we get the allocator from a `Document` instance. This is a common idiom when using RapidJSON. But you may use other instances of allocator.
-
-Besides, the above `SetString()` requires length. This can handle null characters within a string. There is another `SetString()` overloaded function without the length parameter. And it assumes the input is null-terminated and calls a `strlen()`-like function to obtain the length.
-
-Finally, for a string literal or string with a safe life-cycle one can use the const-string version of `SetString()`, which lacks an allocator parameter. For string literals (or constant character arrays), simply passing the literal as parameter is safe and efficient:
-
-~~~~~~~~~~cpp
-Value s;
-s.SetString("rapidjson"); // can contain null character, length derived at compile time
-s = "rapidjson"; // shortcut, same as above
-~~~~~~~~~~
-
-For a character pointer, RapidJSON requires it to be marked as safe before using it without copying. This can be achieved by using the `StringRef` function:
-
-~~~~~~~~~cpp
-const char * cstr = getenv("USER");
-size_t cstr_len = ...; // in case length is available
-Value s;
-// s.SetString(cstr); // will not compile
-s.SetString(StringRef(cstr)); // ok, assume safe lifetime, null-terminated
-s = StringRef(cstr); // shortcut, same as above
-s.SetString(StringRef(cstr,cstr_len)); // faster, can contain null character
-s = StringRef(cstr,cstr_len); // shortcut, same as above
-
-~~~~~~~~~
-
-## Modify Array {#ModifyArray}
-Value with array type provides an API similar to `std::vector`.
-
-* `Clear()`
-* `Reserve(SizeType, Allocator&)`
-* `Value& PushBack(Value&, Allocator&)`
-* `template <typename T> GenericValue& PushBack(T, Allocator&)`
-* `Value& PopBack()`
-* `ValueIterator Erase(ConstValueIterator pos)`
-* `ValueIterator Erase(ConstValueIterator first, ConstValueIterator last)`
-
-Note that, `Reserve(...)` and `PushBack(...)` may allocate memory for the array elements, therefore requiring an allocator.
-
-Here is an example of `PushBack()`:
-
-~~~~~~~~~~cpp
-Value a(kArrayType);
-Document::AllocatorType& allocator = document.GetAllocator();
-
-for (int i = 5; i <= 10; i++)
- a.PushBack(i, allocator); // allocator is needed for potential realloc().
-
-// Fluent interface
-a.PushBack("Lua", allocator).PushBack("Mio", allocator);
-~~~~~~~~~~
-
-This API differs from STL in that `PushBack()`/`PopBack()` return the array reference itself. This is called _fluent interface_.
-
-If you want to add a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)) to the array, you need to create a string Value by using the copy-string API. To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:
-
-~~~~~~~~~~cpp
-// in-place Value parameter
-contact.PushBack(Value("copy", document.GetAllocator()).Move(), // copy string
- document.GetAllocator());
-
-// explicit parameters
-Value val("key", document.GetAllocator()); // copy string
-contact.PushBack(val, document.GetAllocator());
-~~~~~~~~~~
-
-## Modify Object {#ModifyObject}
-The Object class is a collection of key-value pairs (members). Each key must be a string value. To modify an object, either add or remove members. The following API is for adding members:
-
-* `Value& AddMember(Value&, Value&, Allocator& allocator)`
-* `Value& AddMember(StringRefType, Value&, Allocator&)`
-* `template <typename T> Value& AddMember(StringRefType, T value, Allocator&)`
-
-Here is an example.
-
-~~~~~~~~~~cpp
-Value contact(kObject);
-contact.AddMember("name", "Milo", document.GetAllocator());
-contact.AddMember("married", true, document.GetAllocator());
-~~~~~~~~~~
-
-The name parameter with `StringRefType` is similar to the interface of the `SetString` function for string values. These overloads are used to avoid the need for copying the `name` string, since constant key names are very common in JSON objects.
-
-If you need to create a name from a non-constant string or a string without sufficient lifetime (see [Create String](#CreateString)), you need to create a string Value by using the copy-string API. To avoid the need for an intermediate variable, you can use a [temporary value](#TemporaryValues) in place:
-
-~~~~~~~~~~cpp
-// in-place Value parameter
-contact.AddMember(Value("copy", document.GetAllocator()).Move(), // copy string
- Value().Move(), // null value
- document.GetAllocator());
-
-// explicit parameters
-Value key("key", document.GetAllocator()); // copy string name
-Value val(42); // some value
-contact.AddMember(key, val, document.GetAllocator());
-~~~~~~~~~~
-
-For removing members, there are several choices:
-
-* `bool RemoveMember(const Ch* name)`: Remove a member by search its name (linear time complexity).
-* `bool RemoveMember(const Value& name)`: same as above but `name` is a Value.
-* `MemberIterator RemoveMember(MemberIterator)`: Remove a member by iterator (_constant_ time complexity).
-* `MemberIterator EraseMember(MemberIterator)`: similar to the above but it preserves order of members (linear time complexity).
-* `MemberIterator EraseMember(MemberIterator first, MemberIterator last)`: remove a range of members, preserves order (linear time complexity).
-
-`MemberIterator RemoveMember(MemberIterator)` uses a "move-last" trick to achieve constant time complexity. Basically the member at iterator is destructed, and then the last element is moved to that position. So the order of the remaining members are changed.
-
-## Deep Copy Value {#DeepCopyValue}
-If we really need to copy a DOM tree, we can use two APIs for deep copy: constructor with allocator, and `CopyFrom()`.
-
-~~~~~~~~~~cpp
-Document d;
-Document::AllocatorType& a = d.GetAllocator();
-Value v1("foo");
-// Value v2(v1); // not allowed
-
-Value v2(v1, a); // make a copy
-assert(v1.IsString()); // v1 untouched
-d.SetArray().PushBack(v1, a).PushBack(v2, a);
-assert(v1.IsNull() && v2.IsNull()); // both moved to d
-
-v2.CopyFrom(d, a); // copy whole document to v2
-assert(d.IsArray() && d.Size() == 2); // d untouched
-v1.SetObject().AddMember("array", v2, a);
-d.PushBack(v1, a);
-~~~~~~~~~~
-
-## Swap Values {#SwapValues}
-
-`Swap()` is also provided.
-
-~~~~~~~~~~cpp
-Value a(123);
-Value b("Hello");
-a.Swap(b);
-assert(a.IsString());
-assert(b.IsInt());
-~~~~~~~~~~
-
-Swapping two DOM trees is fast (constant time), despite the complexity of the trees.
-
-# What's next {#WhatsNext}
-
-This tutorial shows the basics of DOM tree query and manipulation. There are several important concepts in RapidJSON:
-
-1. [Streams](doc/stream.md) are channels for reading/writing JSON, which can be a in-memory string, or file stream, etc. User can also create their streams.
-2. [Encoding](doc/encoding.md) defines which character encoding is used in streams and memory. RapidJSON also provide Unicode conversion/validation internally.
-3. [DOM](doc/dom.md)'s basics are already covered in this tutorial. Uncover more advanced features such as *in situ* parsing, other parsing options and advanced usages.
-4. [SAX](doc/sax.md) is the foundation of parsing/generating facility in RapidJSON. Learn how to use `Reader`/`Writer` to implement even faster applications. Also try `PrettyWriter` to format the JSON.
-5. [Performance](doc/performance.md) shows some in-house and third-party benchmarks.
-6. [Internals](doc/internals.md) describes some internal designs and techniques of RapidJSON.
-
-You may also refer to the [FAQ](doc/faq.md), API documentation, examples and unit tests.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.zh-cn.md
deleted file mode 100644
index 8b24ff11f6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/doc/tutorial.zh-cn.md
+++ /dev/null
@@ -1,535 +0,0 @@
-# 教程
-
-本教程简介文件对象模型(Document Object Model, DOM)API。
-
-如 [用法一览](../readme.zh-cn.md#用法一览) 中所示,å¯ä»¥è§£æžä¸€ä¸ª JSON 至 DOM,然åŽå°±å¯ä»¥è½»æ¾æŸ¥è¯¢åŠä¿®æ”¹ DOM,并最终转æ¢å›ž JSON。
-
-[TOC]
-
-# Value åŠ Document {#ValueDocument}
-
-æ¯ä¸ª JSON 值都储存为 `Value` 类,而 `Document` 类则表示整个 DOM,它存储了一个 DOM æ ‘çš„æ ¹ `Value`。RapidJSON 的所有公开类型åŠå‡½æ•°éƒ½åœ¨ `rapidjson` 命å空间中。
-
-# 查询 Value {#QueryValue}
-
-在本节中,我们会使用到 `example/tutorial/tutorial.cpp` 中的代ç ç‰‡æ®µã€‚
-
-å‡è®¾æˆ‘们用 C 语言的字符串储存一个 JSON(`const char* json`):
-~~~~~~~~~~js
-{
- "hello": "world",
- "t": true ,
- "f": false,
- "n": null,
- "i": 123,
- "pi": 3.1416,
- "a": [1, 2, 3, 4]
-}
-~~~~~~~~~~
-
-把它解æžè‡³ä¸€ä¸ª `Document`:
-~~~~~~~~~~cpp
-#include "rapidjson/document.h"
-
-using namespace rapidjson;
-
-// ...
-Document document;
-document.Parse(json);
-~~~~~~~~~~
-
-那么现在该 JSON 就会被解æžè‡³ `document` 中,æˆä¸ºä¸€æ£µ *DOM æ ‘ *:
-
-![教程中的 DOM](diagram/tutorial.png)
-
-自从 RFC 7159 作出更新,åˆæ³• JSON 文件的根å¯ä»¥æ˜¯ä»»ä½•ç±»åž‹çš„ JSON 值。而在较早的 RFC 4627 中,根值åªå…许是 Object 或 Array。而在上述例å­ä¸­ï¼Œæ ¹æ˜¯ä¸€ä¸ª Object。
-~~~~~~~~~~cpp
-assert(document.IsObject());
-~~~~~~~~~~
-
-让我们查询一下根 Object 中有没有 `"hello"` æˆå‘˜ã€‚由于一个 `Value` å¯åŒ…å«ä¸åŒç±»åž‹çš„值,我们å¯èƒ½éœ€è¦éªŒè¯å®ƒçš„类型,并使用åˆé€‚çš„ API 去获å–其值。在此例中,`"hello"` æˆå‘˜å…³è”到一个 JSON String。
-~~~~~~~~~~cpp
-assert(document.HasMember("hello"));
-assert(document["hello"].IsString());
-printf("hello = %s\n", document["hello"].GetString());
-~~~~~~~~~~
-
-~~~~~~~~~~
-world
-~~~~~~~~~~
-
-JSON True/False 值是以 `bool` 表示的。
-~~~~~~~~~~cpp
-assert(document["t"].IsBool());
-printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
-~~~~~~~~~~
-
-~~~~~~~~~~
-true
-~~~~~~~~~~
-
-JSON Null 值å¯ç”¨ `IsNull()` 查询。
-~~~~~~~~~~cpp
-printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
-~~~~~~~~~~
-
-~~~~~~~~~~
-null
-~~~~~~~~~~
-
-JSON Number 类型表示所有数值。然而,C++ 需è¦ä½¿ç”¨æ›´ä¸“门的类型。
-
-~~~~~~~~~~cpp
-assert(document["i"].IsNumber());
-
-// 在此情况下,IsUint()/IsInt64()/IsUint64() 也会返回 true
-assert(document["i"].IsInt());
-printf("i = %d\n", document["i"].GetInt());
-// å¦ä¸€ç§ç”¨æ³•ï¼š (int)document["i"]
-
-assert(document["pi"].IsNumber());
-assert(document["pi"].IsDouble());
-printf("pi = %g\n", document["pi"].GetDouble());
-~~~~~~~~~~
-
-~~~~~~~~~~
-i = 123
-pi = 3.1416
-~~~~~~~~~~
-
-JSON Array 包å«ä¸€äº›å…ƒç´ ã€‚
-~~~~~~~~~~cpp
-// 使用引用æ¥è¿žç»­è®¿é—®ï¼Œæ–¹ä¾¿ä¹‹ä½™è¿˜æ›´é«˜æ•ˆã€‚
-const Value& a = document["a"];
-assert(a.IsArray());
-for (SizeType i = 0; i < a.Size(); i++) // 使用 SizeType 而ä¸æ˜¯ size_t
- printf("a[%d] = %d\n", i, a[i].GetInt());
-~~~~~~~~~~
-
-~~~~~~~~~~
-a[0] = 1
-a[1] = 2
-a[2] = 3
-a[3] = 4
-~~~~~~~~~~
-
-注æ„,RapidJSON 并ä¸è‡ªåŠ¨è½¬æ¢å„ç§ JSON 类型。例如,对一个 String çš„ Value 调用 `GetInt()` 是éžæ³•çš„。在调试模å¼ä¸‹ï¼Œå®ƒä¼šè¢«æ–­è¨€å¤±è´¥ã€‚在å‘布模å¼ä¸‹ï¼Œå…¶è¡Œä¸ºæ˜¯æœªå®šä¹‰çš„。
-
-以下将会讨论有关查询å„类型的细节。
-
-## 查询 Array {#QueryArray}
-
-缺çœæƒ…况下,`SizeType` 是 `unsigned` çš„ typedef。在多数系统中,Array 最多能存储 2^32-1 个元素。
-
-ä½ å¯ä»¥ç”¨æ•´æ•°å­—é¢é‡è®¿é—®å…ƒç´ ï¼Œå¦‚ `a[0]`ã€`a[1]`ã€`a[2]`。
-
-Array 与 `std::vector` 相似,除了使用索引,也å¯ä½¿ç”¨è¿­ä»£å™¨æ¥è®¿é—®æ‰€æœ‰å…ƒç´ ã€‚
-~~~~~~~~~~cpp
-for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
- printf("%d ", itr->GetInt());
-~~~~~~~~~~
-
-还有一些熟悉的查询函数:
-* `SizeType Capacity() const`
-* `bool Empty() const`
-
-### 范围 for 循环 (v1.1.0 中的新功能)
-
-当使用 C++11 功能时,你å¯ä½¿ç”¨èŒƒå›´ for 循环去访问 Array 内的所有元素。
-
-~~~~~~~~~~cpp
-for (auto& v : a.GetArray())
- printf("%d ", v.GetInt());
-~~~~~~~~~~
-
-## 查询 Object {#QueryObject}
-
-å’Œ Array 相似,我们å¯ä»¥ç”¨è¿­ä»£å™¨åŽ»è®¿é—®æ‰€æœ‰ Object æˆå‘˜ï¼š
-
-~~~~~~~~~~cpp
-static const char* kTypeNames[] =
- { "Null", "False", "True", "Object", "Array", "String", "Number" };
-
-for (Value::ConstMemberIterator itr = document.MemberBegin();
- itr != document.MemberEnd(); ++itr)
-{
- printf("Type of member %s is %s\n",
- itr->name.GetString(), kTypeNames[itr->value.GetType()]);
-}
-~~~~~~~~~~
-
-~~~~~~~~~~
-Type of member hello is String
-Type of member t is True
-Type of member f is False
-Type of member n is Null
-Type of member i is Number
-Type of member pi is Number
-Type of member a is Array
-~~~~~~~~~~
-
-注æ„,当 `operator[](const char*)` 找ä¸åˆ°æˆå‘˜ï¼Œå®ƒä¼šæ–­è¨€å¤±è´¥ã€‚
-
-若我们ä¸ç¡®å®šä¸€ä¸ªæˆå‘˜æ˜¯å¦å­˜åœ¨ï¼Œä¾¿éœ€è¦åœ¨è°ƒç”¨ `operator[](const char*)` å‰å…ˆè°ƒç”¨ `HasMember()`。然而,这会导致两次查找。更好的åšæ³•æ˜¯è°ƒç”¨ `FindMember()`,它能åŒæ—¶æ£€æŸ¥æˆå‘˜æ˜¯å¦å­˜åœ¨å¹¶è¿”回它的 Value:
-
-~~~~~~~~~~cpp
-Value::ConstMemberIterator itr = document.FindMember("hello");
-if (itr != document.MemberEnd())
- printf("%s\n", itr->value.GetString());
-~~~~~~~~~~
-
-### 范围 for 循环 (v1.1.0 中的新功能)
-
-当使用 C++11 功能时,你å¯ä½¿ç”¨èŒƒå›´ for 循环去访问 Object 内的所有æˆå‘˜ã€‚
-
-~~~~~~~~~~cpp
-for (auto& m : document.GetObject())
- printf("Type of member %s is %s\n",
- m.name.GetString(), kTypeNames[m.value.GetType()]);
-~~~~~~~~~~
-
-## 查询 Number {#QueryNumber}
-
-JSON åªæ供一ç§æ•°å€¼ç±»åž‹â”€â”€Number。数字å¯ä»¥æ˜¯æ•´æ•°æˆ–实数。RFC 4627 规定数字的范围由解æžå™¨æŒ‡å®šã€‚
-
-由于 C++ æ供多ç§æ•´æ•°åŠæµ®ç‚¹æ•°ç±»åž‹ï¼ŒDOM å°è¯•å°½é‡æ供最广的范围åŠè‰¯å¥½æ€§èƒ½ã€‚
-
-当解æžä¸€ä¸ª Number æ—¶, 它会被存储在 DOM 之中,æˆä¸ºä¸‹åˆ—其中一个类型:
-
-类型 | æè¿°
------------|---------------------------------------
-`unsigned` | 32 ä½æ— å·æ•´æ•°
-`int` | 32 ä½æœ‰å·æ•´æ•°
-`uint64_t` | 64 ä½æ— å·æ•´æ•°
-`int64_t` | 64 ä½æœ‰å·æ•´æ•°
-`double` | 64 ä½åŒç²¾åº¦æµ®ç‚¹æ•°
-
-当查询一个 Number æ—¶, ä½ å¯ä»¥æ£€æŸ¥è¯¥æ•°å­—是å¦èƒ½ä»¥ç›®æ ‡ç±»åž‹æ¥æå–:
-
-查检 | æå–
-------------------|---------------------
-`bool IsNumber()` | ä¸é€‚用
-`bool IsUint()` | `unsigned GetUint()`
-`bool IsInt()` | `int GetInt()`
-`bool IsUint64()` | `uint64_t GetUint64()`
-`bool IsInt64()` | `int64_t GetInt64()`
-`bool IsDouble()` | `double GetDouble()`
-
-注æ„,一个整数å¯èƒ½ç”¨å‡ ç§ç±»åž‹æ¥æå–,而无需转æ¢ã€‚例如,一个å为 `x` çš„ Value åŒ…å« 123,那么 `x.IsInt() == x.IsUint() == x.IsInt64() == x.IsUint64() == true`。但如果一个å为 `y` çš„ Value åŒ…å« -3000000000,那么仅会令 `x.IsInt64() == true`。
-
-当è¦æå– Number 类型,`GetDouble()` 是会把内部整数的表示转æ¢æˆ `double`ã€‚æ³¨æ„ `int` å’Œ `unsigned` å¯ä»¥å®‰å…¨åœ°è½¬æ¢è‡³ `double`,但 `int64_t` åŠ `uint64_t` å¯èƒ½ä¼šä¸§å¤±ç²¾åº¦ï¼ˆå› ä¸º `double` 的尾数åªæœ‰ 52 ä½ï¼‰ã€‚
-
-## 查询 String {#QueryString}
-
-除了 `GetString()`,`Value` 类也有一个 `GetStringLength()`。这里会解释个中原因。
-
-æ ¹æ® RFC 4627,JSON String å¯åŒ…å« Unicode 字符 `U+0000`,在 JSON 中会表示为 `"\u0000"`。问题是,C/C++ 通常使用空字符结尾字符串(null-terminated string),这ç§å­—符串把 ``\0'` 作为结æŸç¬¦å·ã€‚
-
-ä¸ºäº†ç¬¦åˆ RFC 4627,RapidJSON 支æŒåŒ…å« `U+0000` çš„ String。若你需è¦å¤„ç†è¿™äº› String,便å¯ä½¿ç”¨ `GetStringLength()` 去获得正确的字符串长度。
-
-例如,当解æžä»¥ä¸‹çš„ JSON 至 `Document d` 之åŽï¼š
-
-~~~~~~~~~~js
-{ "s" : "a\u0000b" }
-~~~~~~~~~~
-`"a\u0000b"` 值的正确长度应该是 3。但 `strlen()` 会返回 1。
-
-`GetStringLength()` 也å¯ä»¥æ高性能,因为用户å¯èƒ½éœ€è¦è°ƒç”¨ `strlen()` 去分é…缓冲。
-
-此外,`std::string` 也支æŒè¿™ä¸ªæž„造函数:
-
-~~~~~~~~~~cpp
-string(const char* s, size_t count);
-~~~~~~~~~~
-
-此构造函数接å—字符串长度作为å‚数。它支æŒåœ¨å­—符串中存储空字符,也应该会有更好的性能。
-
-## 比较两个 Value
-
-ä½ å¯ä½¿ç”¨ `==` åŠ `!=` 去比较两个 Value。当且仅当两个 Value 的类型åŠå†…容相åŒï¼Œå®ƒä»¬æ‰å½“作相等。你也å¯ä»¥æ¯”较 Value 和它的原生类型值。以下是一个例å­ã€‚
-
-~~~~~~~~~~cpp
-if (document["hello"] == document["n"]) /*...*/; // 比较两个值
-if (document["hello"] == "world") /*...*/; // 与字符串字é¢é‡ä½œæ¯”较
-if (document["i"] != 123) /*...*/; // 与整数作比较
-if (document["pi"] != 3.14) /*...*/; // 与 double 作比较
-~~~~~~~~~~
-
-Arrayï¼Object 顺åºä»¥å®ƒä»¬çš„元素ï¼æˆå‘˜ä½œæ¯”较。当且仅当它们的整个å­æ ‘相等,它们æ‰å½“作相等。
-
-注æ„,现时若一个 Object å«æœ‰é‡å¤å‘½åçš„æˆå‘˜ï¼Œå®ƒä¸Žä»»ä½• Object 作比较都总会返回 `false`。
-
-# 创建ï¼ä¿®æ”¹å€¼ {#CreateModifyValues}
-
-有多ç§æ–¹æ³•åŽ»åˆ›å»ºå€¼ã€‚ 当一个 DOM 树被创建或修改åŽï¼Œå¯ä½¿ç”¨ `Writer` å†æ¬¡å­˜å‚¨ä¸º JSON。
-
-## æ”¹å˜ Value 类型 {#ChangeValueType}
-当使用默认构造函数创建一个 Value 或 Document,它的类型便会是 Null。è¦æ”¹å˜å…¶ç±»åž‹ï¼Œéœ€è°ƒç”¨ `SetXXX()` 或赋值æ“作,例如:
-
-~~~~~~~~~~cpp
-Document d; // Null
-d.SetObject();
-
-Value v; // Null
-v.SetInt(10);
-v = 10; // 简写,和上é¢çš„相åŒ
-~~~~~~~~~~
-
-### 构造函数的å„个é‡è½½
-几个类型也有é‡è½½æž„造函数:
-
-~~~~~~~~~~cpp
-Value b(true); // 调用 Value(bool)
-Value i(-123); // 调用 Value(int)
-Value u(123u); // 调用 Value(unsigned)
-Value d(1.5); // 调用 Value(double)
-~~~~~~~~~~
-
-è¦é‡å»ºç©º Object 或 Array,å¯åœ¨é»˜è®¤æž„造函数åŽä½¿ç”¨ `SetObject()`/`SetArray()`,或一次性使用 `Value(Type)`:
-
-~~~~~~~~~~cpp
-Value o(kObjectType);
-Value a(kArrayType);
-~~~~~~~~~~
-
-## 转移语义(Move Semantics) {#MoveSemantics}
-
-在设计 RapidJSON 时有一个éžå¸¸ç‰¹åˆ«çš„决定,就是 Value 赋值并ä¸æ˜¯æŠŠæ¥æº Value å¤åˆ¶è‡³ç›®çš„ Value,而是把æ¥æº Value 转移(move)至目的 Value。例如:
-
-~~~~~~~~~~cpp
-Value a(123);
-Value b(456);
-b = a; // a å˜æˆ Null,b å˜æˆæ•°å­— 123。
-~~~~~~~~~~
-
-![使用移动语义赋值。](diagram/move1.png)
-
-为什么?此语义有何优点?
-
-最简å•çš„答案就是性能。对于固定大å°çš„ JSON 类型(Numberã€Trueã€Falseã€Null),å¤åˆ¶å®ƒä»¬æ˜¯ç®€å•å¿«æ·ã€‚然而,对于å¯å˜å¤§å°çš„ JSON 类型(Stringã€Arrayã€Object),å¤åˆ¶å®ƒä»¬ä¼šäº§ç”Ÿå¤§é‡å¼€é”€ï¼Œè€Œä¸”这些开销常常ä¸è¢«å¯Ÿè§‰ã€‚尤其是当我们需è¦åˆ›å»ºä¸´æ—¶ Object,把它å¤åˆ¶è‡³å¦ä¸€å˜é‡ï¼Œç„¶åŽå†æžæž„它。
-
-例如,若使用正常 * å¤åˆ¶ * 语义:
-
-~~~~~~~~~~cpp
-Value o(kObjectType);
-{
- Value contacts(kArrayType);
- // 把元素加进 contacts 数组。
- // ...
- o.AddMember("contacts", contacts, d.GetAllocator()); // 深度å¤åˆ¶ contacts (å¯èƒ½æœ‰å¤§é‡å†…存分é…)
- // æžæž„ contacts。
-}
-~~~~~~~~~~
-
-![å¤åˆ¶è¯­ä¹‰äº§ç”Ÿå¤§é‡çš„å¤åˆ¶æ“作。](diagram/move2.png)
-
-那个 `o` Object 需è¦åˆ†é…一个和 contacts 相åŒå¤§å°çš„缓冲区,对 conacts åšæ·±åº¦å¤åˆ¶ï¼Œå¹¶æœ€ç»ˆè¦æžæž„ contacts。这样会产生大é‡æ— å¿…è¦çš„内存分é…ï¼é‡Šæ”¾ï¼Œä»¥åŠå†…å­˜å¤åˆ¶ã€‚
-
-有一些方案å¯é¿å…实质地å¤åˆ¶è¿™äº›æ•°æ®ï¼Œä¾‹å¦‚引用计数(reference counting)ã€åžƒåœ¾å›žæ”¶ï¼ˆgarbage collection, GC)。
-
-为了使 RapidJSON 简å•åŠå¿«é€Ÿï¼Œæˆ‘们选择了对赋值采用 * 转移 * 语义。这方法与 `std::auto_ptr` 相似,都是在赋值时转移拥有æƒã€‚转移快得多简å•å¾—多,åªéœ€è¦æžæž„原æ¥çš„ Value,把æ¥æº `memcpy()` 至目标,最åŽæŠŠæ¥æºè®¾ç½®ä¸º Null 类型。
-
-因此,使用转移语义åŽï¼Œä¸Šé¢çš„例å­å˜æˆï¼š
-
-~~~~~~~~~~cpp
-Value o(kObjectType);
-{
- Value contacts(kArrayType);
- // adding elements to contacts array.
- o.AddMember("contacts", contacts, d.GetAllocator()); // åªéœ€ memcpy() contacts 本身至新æˆå‘˜çš„ Value(16 字节)
- // contacts 在这里å˜æˆ Null。它的æžæž„是平凡的。
-}
-~~~~~~~~~~
-
-![转移语义ä¸éœ€å¤åˆ¶ã€‚](diagram/move3.png)
-
-在 C++11 中这称为转移赋值æ“作(move assignment operator)。由于 RapidJSON æ”¯æŒ C++03,它在赋值æ“作采用转移语义,其它修改型函数如 `AddMember()`, `PushBack()` 也采用转移语义。
-
-### 转移语义åŠä¸´æ—¶å€¼ {#TemporaryValues}
-
-有时候,我们想直接构造一个 Value 并传递给一个“转移â€å‡½æ•°ï¼ˆå¦‚ `PushBack()`ã€`AddMember()`)。由于临时对象是ä¸èƒ½è½¬æ¢ä¸ºæ­£å¸¸çš„ Value 引用,我们加入了一个方便的 `Move()` 函数:
-
-~~~~~~~~~~cpp
-Value a(kArrayType);
-Document::AllocatorType& allocator = document.GetAllocator();
-// a.PushBack(Value(42), allocator); // ä¸èƒ½é€šè¿‡ç¼–译
-a.PushBack(Value().SetInt(42), allocator); // fluent API
-a.PushBack(Value(42).Move(), allocator); // 和上一行相åŒ
-~~~~~~~~~~
-
-## 创建 String {#CreateString}
-RapidJSON æ供两个 String 的存储策略。
-
-1. copy-string: 分é…缓冲区,然åŽæŠŠæ¥æºæ•°æ®å¤åˆ¶è‡³å®ƒã€‚
-2. const-string: 简å•åœ°å‚¨å­˜å­—符串的指针。
-
-Copy-string 总是安全的,因为它拥有数æ®çš„克隆。Const-string å¯ç”¨äºŽå­˜å‚¨å­—符串字é¢é‡ï¼Œä»¥åŠç”¨äºŽåœ¨ DOM 一节中将会æ到的 in-situ 解æžä¸­ã€‚
-
-为了让用户自定义内存分é…æ–¹å¼ï¼Œå½“一个æ“作å¯èƒ½éœ€è¦å†…存分é…时,RapidJSON è¦æ±‚用户传递一个 allocator 实例作为 API å‚数。此设计é¿å…了在æ¯ä¸ª Value 存储 allocator(或 document)的指针。
-
-因此,当我们把一个 copy-string 赋值时, 调用å«æœ‰ allocator çš„ `SetString()` é‡è½½å‡½æ•°ï¼š
-
-~~~~~~~~~~cpp
-Document document;
-Value author;
-char buffer[10];
-int len = sprintf(buffer, "%s %s", "Milo", "Yip"); // 动æ€åˆ›å»ºçš„字符串。
-author.SetString(buffer, len, document.GetAllocator());
-memset(buffer, 0, sizeof(buffer));
-// 清空 buffer åŽ author.GetString() ä»ç„¶åŒ…å« "Milo Yip"
-~~~~~~~~~~
-
-在此例å­ä¸­ï¼Œæˆ‘们使用 `Document` 实例的 allocator。这是使用 RapidJSON 时常用的惯用法。但你也å¯ä»¥ç”¨å…¶ä»– allocator 实例。
-
-å¦å¤–,上é¢çš„ `SetString()` 需è¦é•¿åº¦å‚数。这个 API 能处ç†å«æœ‰ç©ºå­—符的字符串。å¦ä¸€ä¸ª `SetString()` é‡è½½å‡½æ•°æ²¡æœ‰é•¿åº¦å‚数,它å‡è®¾è¾“入是空字符结尾的,并会调用类似 `strlen()` 的函数去获å–长度。
-
-最åŽï¼Œå¯¹äºŽå­—符串字é¢é‡æˆ–有安全生命周期的字符串,å¯ä»¥ä½¿ç”¨ const-string 版本的 `SetString()`,它没有
-allocator å‚数。对于字符串字é¢é‡ï¼ˆæˆ–字符数组常é‡ï¼‰ï¼Œåªéœ€ç®€å•åœ°ä¼ é€’å­—é¢é‡ï¼Œåˆå®‰å…¨åˆé«˜æ•ˆï¼š
-
-~~~~~~~~~~cpp
-Value s;
-s.SetString("rapidjson"); // å¯åŒ…å«ç©ºå­—符,长度在编译期推导
-s = "rapidjson"; // 上行的缩写
-~~~~~~~~~~
-
-对于字符指针,RapidJSON 需è¦ä½œä¸€ä¸ªæ ‡è®°ï¼Œä»£è¡¨å®ƒä¸å¤åˆ¶ä¹Ÿæ˜¯å®‰å…¨çš„。å¯ä»¥ä½¿ç”¨ `StringRef` 函数:
-
-~~~~~~~~~cpp
-const char * cstr = getenv("USER");
-size_t cstr_len = ...; // 如果有长度
-Value s;
-// s.SetString(cstr); // è¿™ä¸èƒ½é€šè¿‡ç¼–译
-s.SetString(StringRef(cstr)); // å¯ä»¥ï¼Œå‡è®¾å®ƒçš„生命周期安全,并且是以空字符结尾的
-s = StringRef(cstr); // 上行的缩写
-s.SetString(StringRef(cstr, cstr_len));// 更快,å¯å¤„ç†ç©ºå­—符
-s = StringRef(cstr, cstr_len); // 上行的缩写
-
-~~~~~~~~~
-
-## 修改 Array {#ModifyArray}
-Array 类型的 Value æ供与 `std::vector` 相似的 API。
-
-* `Clear()`
-* `Reserve(SizeType, Allocator&)`
-* `Value& PushBack(Value&, Allocator&)`
-* `template <typename T> GenericValue& PushBack(T, Allocator&)`
-* `Value& PopBack()`
-* `ValueIterator Erase(ConstValueIterator pos)`
-* `ValueIterator Erase(ConstValueIterator first, ConstValueIterator last)`
-
-注æ„,`Reserve(...)` åŠ `PushBack(...)` å¯èƒ½ä¼šä¸ºæ•°ç»„元素分é…内存,所以需è¦ä¸€ä¸ª allocator。
-
-以下是 `PushBack()` 的例å­ï¼š
-
-~~~~~~~~~~cpp
-Value a(kArrayType);
-Document::AllocatorType& allocator = document.GetAllocator();
-
-for (int i = 5; i <= 10; i++)
- a.PushBack(i, allocator); // å¯èƒ½éœ€è¦è°ƒç”¨ realloc() æ‰€ä»¥éœ€è¦ allocator
-
-// æµç•…接å£ï¼ˆFluent interface)
-a.PushBack("Lua", allocator).PushBack("Mio", allocator);
-~~~~~~~~~~
-
-与 STL ä¸ä¸€æ ·çš„是,`PushBack()`/`PopBack()` 返回 Array 本身的引用。这称为æµç•…接å£ï¼ˆ_fluent interface_)。
-
-如果你想在 Array 中加入一个éžå¸¸é‡å­—ç¬¦ä¸²ï¼Œæˆ–æ˜¯ä¸€ä¸ªæ²¡æœ‰è¶³å¤Ÿç”Ÿå‘½å‘¨æœŸçš„å­—ç¬¦ä¸²ï¼ˆè§ [Create String](#CreateString)),你需è¦ä½¿ç”¨ copy-string API 去创建一个 String。为了é¿å…加入中间å˜é‡ï¼Œå¯ä»¥å°±åœ°ä½¿ç”¨ä¸€ä¸ª [临时值](#TemporaryValues):
-
-~~~~~~~~~~cpp
-// 就地 Value å‚æ•°
-contact.PushBack(Value("copy", document.GetAllocator()).Move(), // copy string
- document.GetAllocator());
-
-// æ˜¾å¼ Value å‚æ•°
-Value val("key", document.GetAllocator()); // copy string
-contact.PushBack(val, document.GetAllocator());
-~~~~~~~~~~
-
-## 修改 Object {#ModifyObject}
-Object 是键值对的集åˆã€‚æ¯ä¸ªé”®å¿…须为 String。è¦ä¿®æ”¹ Object,方法是增加或移除æˆå‘˜ã€‚以下的 API 用æ¥å¢žåŠ æˆå‘˜ï¼š
-
-* `Value& AddMember(Value&, Value&, Allocator& allocator)`
-* `Value& AddMember(StringRefType, Value&, Allocator&)`
-* `template <typename T> Value& AddMember(StringRefType, T value, Allocator&)`
-
-以下是一个例å­ã€‚
-
-~~~~~~~~~~cpp
-Value contact(kObject);
-contact.AddMember("name", "Milo", document.GetAllocator());
-contact.AddMember("married", true, document.GetAllocator());
-~~~~~~~~~~
-
-使用 `StringRefType` 作为 name å‚æ•°çš„é‡è½½ç‰ˆæœ¬ä¸Žå­—符串的 `SetString` 的接å£ç›¸ä¼¼ã€‚ 这些é‡è½½æ˜¯ä¸ºäº†é¿å…å¤åˆ¶ `name` 字符串,因为 JSON object 中ç»å¸¸ä¼šä½¿ç”¨å¸¸æ•°é”®å。
-
-如果你需è¦ä»Žéžå¸¸æ•°å­—符串或生命周期ä¸è¶³çš„字符串创建键åï¼ˆè§ [创建 String](#CreateString)),你需è¦ä½¿ç”¨ copy-string API。为了é¿å…中间å˜é‡ï¼Œå¯ä»¥å°±åœ°ä½¿ç”¨ [临时值](#TemporaryValues):
-
-~~~~~~~~~~cpp
-// 就地 Value å‚æ•°
-contact.AddMember(Value("copy", document.GetAllocator()).Move(), // copy string
- Value().Move(), // null value
- document.GetAllocator());
-
-// 显å¼å‚æ•°
-Value key("key", document.GetAllocator()); // copy string name
-Value val(42); // æŸ Value
-contact.AddMember(key, val, document.GetAllocator());
-~~~~~~~~~~
-
-移除æˆå‘˜æœ‰å‡ ä¸ªé€‰æ‹©ï¼š
-
-* `bool RemoveMember(const Ch* name)`:使用键åæ¥ç§»é™¤æˆå‘˜ï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
-* `bool RemoveMember(const Value& name)`:除了 `name` 是一个 Value,和上一行相åŒã€‚
-* `MemberIterator RemoveMember(MemberIterator)`:使用迭代器移除æˆå‘˜ï¼ˆ_ 常数 _ 时间å¤æ‚度)。
-* `MemberIterator EraseMember(MemberIterator)`:和上行相似但维æŒæˆå‘˜æ¬¡åºï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
-* `MemberIterator EraseMember(MemberIterator first, MemberIterator last)`:移除一个范围内的æˆå‘˜ï¼Œç»´æŒæ¬¡åºï¼ˆçº¿æ€§æ—¶é—´å¤æ‚度)。
-
-`MemberIterator RemoveMember(MemberIterator)` 使用了“转移最åŽâ€æ‰‹æ³•æ¥è¾¾æˆå¸¸æ•°æ—¶é—´å¤æ‚度。基本上就是æžæž„迭代器ä½ç½®çš„æˆå‘˜ï¼Œç„¶åŽæŠŠæœ€åŽçš„æˆå‘˜è½¬ç§»è‡³è¿­ä»£å™¨ä½ç½®ã€‚因此,æˆå‘˜çš„次åºä¼šè¢«æ”¹å˜ã€‚
-
-## æ·±å¤åˆ¶ Value {#DeepCopyValue}
-若我们真的è¦å¤åˆ¶ä¸€ä¸ª DOM 树,我们å¯ä½¿ç”¨ä¸¤ä¸ª APIs 作深å¤åˆ¶ï¼šå« allocator çš„æž„é€ å‡½æ•°åŠ `CopyFrom()`。
-
-~~~~~~~~~~cpp
-Document d;
-Document::AllocatorType& a = d.GetAllocator();
-Value v1("foo");
-// Value v2(v1); // ä¸å®¹è®¸
-
-Value v2(v1, a); // 制造一个克隆
-assert(v1.IsString()); // v1 ä¸å˜
-d.SetArray().PushBack(v1, a).PushBack(v2, a);
-assert(v1.IsNull() && v2.IsNull()); // 两个都转移动 d
-
-v2.CopyFrom(d, a); // 把整个 document å¤åˆ¶è‡³ v2
-assert(d.IsArray() && d.Size() == 2); // d ä¸å˜
-v1.SetObject().AddMember("array", v2, a);
-d.PushBack(v1, a);
-~~~~~~~~~~
-
-## äº¤æ¢ Value {#SwapValues}
-
-RapidJSON 也æä¾› `Swap()`。
-
-~~~~~~~~~~cpp
-Value a(123);
-Value b("Hello");
-a.Swap(b);
-assert(a.IsString());
-assert(b.IsInt());
-~~~~~~~~~~
-
-无论两棵 DOM 树有多å¤æ‚,交æ¢æ˜¯å¾ˆå¿«çš„(常数时间)。
-
-# 下一部分 {#WhatsNext}
-
-本教程展示了如何询查åŠä¿®æ”¹ DOM 树。RapidJSON 还有一个é‡è¦æ¦‚念:
-
-1. [æµ](doc/stream.zh-cn.md) 是读写 JSON 的通é“。æµå¯ä»¥æ˜¯å†…存字符串ã€æ–‡ä»¶æµç­‰ã€‚用户也å¯ä»¥è‡ªå®šä¹‰æµã€‚
-2. [ç¼–ç ](doc/encoding.zh-cn.md) 定义在æµæˆ–内存中使用的字符编ç ã€‚RapidJSON 也在内部æä¾› Unicode 转æ¢åŠæ ¡éªŒåŠŸèƒ½ã€‚
-3. [DOM](doc/dom.zh-cn.md) 的基本功能已在本教程里介ç»ã€‚还有更高级的功能,如原ä½ï¼ˆ*in situ*)解æžã€å…¶ä»–解æžé€‰é¡¹åŠé«˜çº§ç”¨æ³•ã€‚
-4. [SAX](doc/sax.zh-cn.md) 是 RapidJSON 解æžï¼ç”ŸæˆåŠŸèƒ½çš„基础。学习使用 `Reader`/`Writer` 去实现更高性能的应用程åºã€‚也å¯ä»¥ä½¿ç”¨ `PrettyWriter` 去格å¼åŒ– JSON。
-5. [性能](doc/performance.zh-cn.md) 展示一些我们åšçš„åŠç¬¬ä¸‰æ–¹çš„性能测试。
-6. [技术内幕](doc/internals.md) 讲述一些 RapidJSON 内部的设计åŠæŠ€æœ¯ã€‚
-
-你也å¯ä»¥å‚考 [常è§é—®é¢˜](doc/faq.zh-cn.md)ã€API 文档ã€ä¾‹å­åŠå•å…ƒæµ‹è¯•ã€‚
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/docker/debian/Dockerfile b/graphics/asymptote/LspCpp/third_party/rapidjson/docker/debian/Dockerfile
deleted file mode 100644
index 76f0235e5b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/docker/debian/Dockerfile
+++ /dev/null
@@ -1,8 +0,0 @@
-# BUILD: docker build -t rapidjson-debian .
-# RUN: docker run -it -v "$PWD"/../..:/rapidjson rapidjson-debian
-
-FROM debian:jessie
-
-RUN apt-get update && apt-get install -y g++ cmake doxygen valgrind
-
-ENTRYPOINT ["/bin/bash"]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/example/CMakeLists.txt
deleted file mode 100644
index 9f53c9aadc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-if(POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif()
-
-set(EXAMPLES
- capitalize
- condense
- filterkey
- filterkeydom
- jsonx
- lookaheadparser
- messagereader
- parsebyparts
- pretty
- prettyauto
- schemavalidator
- serialize
- simpledom
- simplereader
- simplepullreader
- simplewriter
- sortkeys
- tutorial)
-
-include_directories("../include/")
-
-add_definitions(-D__STDC_FORMAT_MACROS)
-set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
-
-if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
-endif()
-
-add_executable(archivertest archiver/archiver.cpp archiver/archivertest.cpp)
-
-foreach (example ${EXAMPLES})
- add_executable(${example} ${example}/${example}.cpp)
-endforeach()
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- target_link_libraries(parsebyparts pthread)
-endif()
-
-add_custom_target(examples ALL DEPENDS ${EXAMPLES})
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.cpp
deleted file mode 100644
index 2d32ea3539..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-#include "archiver.h"
-#include <cassert>
-#include <stack>
-#include "rapidjson/document.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/stringbuffer.h"
-
-using namespace rapidjson;
-
-struct JsonReaderStackItem {
- enum State {
- BeforeStart, //!< An object/array is in the stack but it is not yet called by StartObject()/StartArray().
- Started, //!< An object/array is called by StartObject()/StartArray().
- Closed //!< An array is closed after read all element, but before EndArray().
- };
-
- JsonReaderStackItem(const Value* value, State state) : value(value), state(state), index() {}
-
- const Value* value;
- State state;
- SizeType index; // For array iteration
-};
-
-typedef std::stack<JsonReaderStackItem> JsonReaderStack;
-
-#define DOCUMENT reinterpret_cast<Document*>(mDocument)
-#define STACK (reinterpret_cast<JsonReaderStack*>(mStack))
-#define TOP (STACK->top())
-#define CURRENT (*TOP.value)
-
-JsonReader::JsonReader(const char* json) : mDocument(), mStack(), mError(false) {
- mDocument = new Document;
- DOCUMENT->Parse(json);
- if (DOCUMENT->HasParseError())
- mError = true;
- else {
- mStack = new JsonReaderStack;
- STACK->push(JsonReaderStackItem(DOCUMENT, JsonReaderStackItem::BeforeStart));
- }
-}
-
-JsonReader::~JsonReader() {
- delete DOCUMENT;
- delete STACK;
-}
-
-// Archive concept
-JsonReader& JsonReader::StartObject() {
- if (!mError) {
- if (CURRENT.IsObject() && TOP.state == JsonReaderStackItem::BeforeStart)
- TOP.state = JsonReaderStackItem::Started;
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::EndObject() {
- if (!mError) {
- if (CURRENT.IsObject() && TOP.state == JsonReaderStackItem::Started)
- Next();
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::Member(const char* name) {
- if (!mError) {
- if (CURRENT.IsObject() && TOP.state == JsonReaderStackItem::Started) {
- Value::ConstMemberIterator memberItr = CURRENT.FindMember(name);
- if (memberItr != CURRENT.MemberEnd())
- STACK->push(JsonReaderStackItem(&memberItr->value, JsonReaderStackItem::BeforeStart));
- else
- mError = true;
- }
- else
- mError = true;
- }
- return *this;
-}
-
-bool JsonReader::HasMember(const char* name) const {
- if (!mError && CURRENT.IsObject() && TOP.state == JsonReaderStackItem::Started)
- return CURRENT.HasMember(name);
- return false;
-}
-
-JsonReader& JsonReader::StartArray(size_t* size) {
- if (!mError) {
- if (CURRENT.IsArray() && TOP.state == JsonReaderStackItem::BeforeStart) {
- TOP.state = JsonReaderStackItem::Started;
- if (size)
- *size = CURRENT.Size();
-
- if (!CURRENT.Empty()) {
- const Value* value = &CURRENT[TOP.index];
- STACK->push(JsonReaderStackItem(value, JsonReaderStackItem::BeforeStart));
- }
- else
- TOP.state = JsonReaderStackItem::Closed;
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::EndArray() {
- if (!mError) {
- if (CURRENT.IsArray() && TOP.state == JsonReaderStackItem::Closed)
- Next();
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::operator&(bool& b) {
- if (!mError) {
- if (CURRENT.IsBool()) {
- b = CURRENT.GetBool();
- Next();
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::operator&(unsigned& u) {
- if (!mError) {
- if (CURRENT.IsUint()) {
- u = CURRENT.GetUint();
- Next();
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::operator&(int& i) {
- if (!mError) {
- if (CURRENT.IsInt()) {
- i = CURRENT.GetInt();
- Next();
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::operator&(double& d) {
- if (!mError) {
- if (CURRENT.IsNumber()) {
- d = CURRENT.GetDouble();
- Next();
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::operator&(std::string& s) {
- if (!mError) {
- if (CURRENT.IsString()) {
- s = CURRENT.GetString();
- Next();
- }
- else
- mError = true;
- }
- return *this;
-}
-
-JsonReader& JsonReader::SetNull() {
- // This function is for JsonWriter only.
- mError = true;
- return *this;
-}
-
-void JsonReader::Next() {
- if (!mError) {
- assert(!STACK->empty());
- STACK->pop();
-
- if (!STACK->empty() && CURRENT.IsArray()) {
- if (TOP.state == JsonReaderStackItem::Started) { // Otherwise means reading array item pass end
- if (TOP.index < CURRENT.Size() - 1) {
- const Value* value = &CURRENT[++TOP.index];
- STACK->push(JsonReaderStackItem(value, JsonReaderStackItem::BeforeStart));
- }
- else
- TOP.state = JsonReaderStackItem::Closed;
- }
- else
- mError = true;
- }
- }
-}
-
-#undef DOCUMENT
-#undef STACK
-#undef TOP
-#undef CURRENT
-
-////////////////////////////////////////////////////////////////////////////////
-// JsonWriter
-
-#define WRITER reinterpret_cast<PrettyWriter<StringBuffer>*>(mWriter)
-#define STREAM reinterpret_cast<StringBuffer*>(mStream)
-
-JsonWriter::JsonWriter() : mWriter(), mStream() {
- mStream = new StringBuffer;
- mWriter = new PrettyWriter<StringBuffer>(*STREAM);
-}
-
-JsonWriter::~JsonWriter() {
- delete WRITER;
- delete STREAM;
-}
-
-const char* JsonWriter::GetString() const {
- return STREAM->GetString();
-}
-
-JsonWriter& JsonWriter::StartObject() {
- WRITER->StartObject();
- return *this;
-}
-
-JsonWriter& JsonWriter::EndObject() {
- WRITER->EndObject();
- return *this;
-}
-
-JsonWriter& JsonWriter::Member(const char* name) {
- WRITER->String(name, static_cast<SizeType>(strlen(name)));
- return *this;
-}
-
-bool JsonWriter::HasMember(const char*) const {
- // This function is for JsonReader only.
- assert(false);
- return false;
-}
-
-JsonWriter& JsonWriter::StartArray(size_t*) {
- WRITER->StartArray();
- return *this;
-}
-
-JsonWriter& JsonWriter::EndArray() {
- WRITER->EndArray();
- return *this;
-}
-
-JsonWriter& JsonWriter::operator&(bool& b) {
- WRITER->Bool(b);
- return *this;
-}
-
-JsonWriter& JsonWriter::operator&(unsigned& u) {
- WRITER->Uint(u);
- return *this;
-}
-
-JsonWriter& JsonWriter::operator&(int& i) {
- WRITER->Int(i);
- return *this;
-}
-
-JsonWriter& JsonWriter::operator&(double& d) {
- WRITER->Double(d);
- return *this;
-}
-
-JsonWriter& JsonWriter::operator&(std::string& s) {
- WRITER->String(s.c_str(), static_cast<SizeType>(s.size()));
- return *this;
-}
-
-JsonWriter& JsonWriter::SetNull() {
- WRITER->Null();
- return *this;
-}
-
-#undef STREAM
-#undef WRITER
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.h b/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.h
deleted file mode 100644
index 72d0cdd65c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archiver.h
+++ /dev/null
@@ -1,145 +0,0 @@
-#ifndef ARCHIVER_H_
-#define ARCHIVER_H_
-
-#include <cstddef>
-#include <string>
-
-/**
-\class Archiver
-\brief Archiver concept
-
-Archiver can be a reader or writer for serialization or deserialization respectively.
-
-class Archiver {
-public:
- /// \returns true if the archiver is in normal state. false if it has errors.
- operator bool() const;
-
- /// Starts an object
- Archiver& StartObject();
-
- /// After calling StartObject(), assign a member with a name
- Archiver& Member(const char* name);
-
- /// After calling StartObject(), check if a member presents
- bool HasMember(const char* name) const;
-
- /// Ends an object
- Archiver& EndObject();
-
- /// Starts an array
- /// \param size If Archiver::IsReader is true, the size of array is written.
- Archiver& StartArray(size_t* size = 0);
-
- /// Ends an array
- Archiver& EndArray();
-
- /// Read/Write primitive types.
- Archiver& operator&(bool& b);
- Archiver& operator&(unsigned& u);
- Archiver& operator&(int& i);
- Archiver& operator&(double& d);
- Archiver& operator&(std::string& s);
-
- /// Write primitive types.
- Archiver& SetNull();
-
- //! Whether it is a reader.
- static const bool IsReader;
-
- //! Whether it is a writer.
- static const bool IsWriter;
-};
-*/
-
-/// Represents a JSON reader which implements Archiver concept.
-class JsonReader {
-public:
- /// Constructor.
- /**
- \param json A non-const source json string for in-situ parsing.
- \note in-situ means the source JSON string will be modified after parsing.
- */
- JsonReader(const char* json);
-
- /// Destructor.
- ~JsonReader();
-
- // Archive concept
-
- operator bool() const { return !mError; }
-
- JsonReader& StartObject();
- JsonReader& Member(const char* name);
- bool HasMember(const char* name) const;
- JsonReader& EndObject();
-
- JsonReader& StartArray(size_t* size = 0);
- JsonReader& EndArray();
-
- JsonReader& operator&(bool& b);
- JsonReader& operator&(unsigned& u);
- JsonReader& operator&(int& i);
- JsonReader& operator&(double& d);
- JsonReader& operator&(std::string& s);
-
- JsonReader& SetNull();
-
- static const bool IsReader = true;
- static const bool IsWriter = !IsReader;
-
-private:
- JsonReader(const JsonReader&);
- JsonReader& operator=(const JsonReader&);
-
- void Next();
-
- // PIMPL
- void* mDocument; ///< DOM result of parsing.
- void* mStack; ///< Stack for iterating the DOM
- bool mError; ///< Whether an error has occurred.
-};
-
-class JsonWriter {
-public:
- /// Constructor.
- JsonWriter();
-
- /// Destructor.
- ~JsonWriter();
-
- /// Obtains the serialized JSON string.
- const char* GetString() const;
-
- // Archive concept
-
- operator bool() const { return true; }
-
- JsonWriter& StartObject();
- JsonWriter& Member(const char* name);
- bool HasMember(const char* name) const;
- JsonWriter& EndObject();
-
- JsonWriter& StartArray(size_t* size = 0);
- JsonWriter& EndArray();
-
- JsonWriter& operator&(bool& b);
- JsonWriter& operator&(unsigned& u);
- JsonWriter& operator&(int& i);
- JsonWriter& operator&(double& d);
- JsonWriter& operator&(std::string& s);
- JsonWriter& SetNull();
-
- static const bool IsReader = false;
- static const bool IsWriter = !IsReader;
-
-private:
- JsonWriter(const JsonWriter&);
- JsonWriter& operator=(const JsonWriter&);
-
- // PIMPL idiom
- void* mWriter; ///< JSON writer.
- void* mStream; ///< Stream buffer.
-};
-
-#endif // ARCHIVER_H__
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archivertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archivertest.cpp
deleted file mode 100644
index 3b84e358b7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/archiver/archivertest.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-#include "archiver.h"
-#include <iostream>
-#include <vector>
-
-//////////////////////////////////////////////////////////////////////////////
-// Test1: simple object
-
-struct Student {
- Student() : name(), age(), height(), canSwim() {}
- Student(const std::string name, unsigned age, double height, bool canSwim) :
- name(name), age(age), height(height), canSwim(canSwim)
- {}
-
- std::string name;
- unsigned age;
- double height;
- bool canSwim;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Student& s) {
- ar.StartObject();
- ar.Member("name") & s.name;
- ar.Member("age") & s.age;
- ar.Member("height") & s.height;
- ar.Member("canSwim") & s.canSwim;
- return ar.EndObject();
-}
-
-std::ostream& operator<<(std::ostream& os, const Student& s) {
- return os << s.name << " " << s.age << " " << s.height << " " << s.canSwim;
-}
-
-void test1() {
- std::string json;
-
- // Serialize
- {
- Student s("Lua", 9, 150.5, true);
-
- JsonWriter writer;
- writer & s;
- json = writer.GetString();
- std::cout << json << std::endl;
- }
-
- // Deserialize
- {
- Student s;
- JsonReader reader(json.c_str());
- reader & s;
- std::cout << s << std::endl;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Test2: std::vector <=> JSON array
-//
-// You can map a JSON array to other data structures as well
-
-struct Group {
- Group() : groupName(), students() {}
- std::string groupName;
- std::vector<Student> students;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Group& g) {
- ar.StartObject();
-
- ar.Member("groupName");
- ar & g.groupName;
-
- ar.Member("students");
- size_t studentCount = g.students.size();
- ar.StartArray(&studentCount);
- if (ar.IsReader)
- g.students.resize(studentCount);
- for (size_t i = 0; i < studentCount; i++)
- ar & g.students[i];
- ar.EndArray();
-
- return ar.EndObject();
-}
-
-std::ostream& operator<<(std::ostream& os, const Group& g) {
- os << g.groupName << std::endl;
- for (std::vector<Student>::const_iterator itr = g.students.begin(); itr != g.students.end(); ++itr)
- os << *itr << std::endl;
- return os;
-}
-
-void test2() {
- std::string json;
-
- // Serialize
- {
- Group g;
- g.groupName = "Rainbow";
-
- Student s1("Lua", 9, 150.5, true);
- Student s2("Mio", 7, 120.0, false);
- g.students.push_back(s1);
- g.students.push_back(s2);
-
- JsonWriter writer;
- writer & g;
- json = writer.GetString();
- std::cout << json << std::endl;
- }
-
- // Deserialize
- {
- Group g;
- JsonReader reader(json.c_str());
- reader & g;
- std::cout << g << std::endl;
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-// Test3: polymorphism & friend
-//
-// Note that friendship is not necessary but make things simpler.
-
-class Shape {
-public:
- virtual ~Shape() {}
- virtual const char* GetType() const = 0;
- virtual void Print(std::ostream& os) const = 0;
-
-protected:
- Shape() : x_(), y_() {}
- Shape(double x, double y) : x_(x), y_(y) {}
-
- template <typename Archiver>
- friend Archiver& operator&(Archiver& ar, Shape& s);
-
- double x_, y_;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Shape& s) {
- ar.Member("x") & s.x_;
- ar.Member("y") & s.y_;
- return ar;
-}
-
-class Circle : public Shape {
-public:
- Circle() : radius_() {}
- Circle(double x, double y, double radius) : Shape(x, y), radius_(radius) {}
- ~Circle() {}
-
- const char* GetType() const { return "Circle"; }
-
- void Print(std::ostream& os) const {
- os << "Circle (" << x_ << ", " << y_ << ")" << " radius = " << radius_;
- }
-
-private:
- template <typename Archiver>
- friend Archiver& operator&(Archiver& ar, Circle& c);
-
- double radius_;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Circle& c) {
- ar & static_cast<Shape&>(c);
- ar.Member("radius") & c.radius_;
- return ar;
-}
-
-class Box : public Shape {
-public:
- Box() : width_(), height_() {}
- Box(double x, double y, double width, double height) : Shape(x, y), width_(width), height_(height) {}
- ~Box() {}
-
- const char* GetType() const { return "Box"; }
-
- void Print(std::ostream& os) const {
- os << "Box (" << x_ << ", " << y_ << ")" << " width = " << width_ << " height = " << height_;
- }
-
-private:
- template <typename Archiver>
- friend Archiver& operator&(Archiver& ar, Box& b);
-
- double width_, height_;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Box& b) {
- ar & static_cast<Shape&>(b);
- ar.Member("width") & b.width_;
- ar.Member("height") & b.height_;
- return ar;
-}
-
-class Canvas {
-public:
- Canvas() : shapes_() {}
- ~Canvas() { Clear(); }
-
- void Clear() {
- for (std::vector<Shape*>::iterator itr = shapes_.begin(); itr != shapes_.end(); ++itr)
- delete *itr;
- }
-
- void AddShape(Shape* shape) { shapes_.push_back(shape); }
-
- void Print(std::ostream& os) {
- for (std::vector<Shape*>::iterator itr = shapes_.begin(); itr != shapes_.end(); ++itr) {
- (*itr)->Print(os);
- std::cout << std::endl;
- }
- }
-
-private:
- template <typename Archiver>
- friend Archiver& operator&(Archiver& ar, Canvas& c);
-
- std::vector<Shape*> shapes_;
-};
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Shape*& shape) {
- std::string type = ar.IsReader ? "" : shape->GetType();
- ar.StartObject();
- ar.Member("type") & type;
- if (type == "Circle") {
- if (ar.IsReader) shape = new Circle;
- ar & static_cast<Circle&>(*shape);
- }
- else if (type == "Box") {
- if (ar.IsReader) shape = new Box;
- ar & static_cast<Box&>(*shape);
- }
- return ar.EndObject();
-}
-
-template <typename Archiver>
-Archiver& operator&(Archiver& ar, Canvas& c) {
- size_t shapeCount = c.shapes_.size();
- ar.StartArray(&shapeCount);
- if (ar.IsReader) {
- c.Clear();
- c.shapes_.resize(shapeCount);
- }
- for (size_t i = 0; i < shapeCount; i++)
- ar & c.shapes_[i];
- return ar.EndArray();
-}
-
-void test3() {
- std::string json;
-
- // Serialize
- {
- Canvas c;
- c.AddShape(new Circle(1.0, 2.0, 3.0));
- c.AddShape(new Box(4.0, 5.0, 6.0, 7.0));
-
- JsonWriter writer;
- writer & c;
- json = writer.GetString();
- std::cout << json << std::endl;
- }
-
- // Deserialize
- {
- Canvas c;
- JsonReader reader(json.c_str());
- reader & c;
- c.Print(std::cout);
- }
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-int main() {
- test1();
- test2();
- test3();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/capitalize/capitalize.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/capitalize/capitalize.cpp
deleted file mode 100644
index c56640bc50..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/capitalize/capitalize.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-// JSON condenser example
-
-// This example parses JSON from stdin with validation,
-// and re-output the JSON content to stdout with all string capitalized, and without whitespace.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <vector>
-#include <cctype>
-
-using namespace rapidjson;
-
-template<typename OutputHandler>
-struct CapitalizeFilter {
- CapitalizeFilter(OutputHandler& out) : out_(out), buffer_() {}
-
- bool Null() { return out_.Null(); }
- bool Bool(bool b) { return out_.Bool(b); }
- bool Int(int i) { return out_.Int(i); }
- bool Uint(unsigned u) { return out_.Uint(u); }
- bool Int64(int64_t i) { return out_.Int64(i); }
- bool Uint64(uint64_t u) { return out_.Uint64(u); }
- bool Double(double d) { return out_.Double(d); }
- bool RawNumber(const char* str, SizeType length, bool copy) { return out_.RawNumber(str, length, copy); }
- bool String(const char* str, SizeType length, bool) {
- buffer_.clear();
- for (SizeType i = 0; i < length; i++)
- buffer_.push_back(static_cast<char>(std::toupper(str[i])));
- return out_.String(&buffer_.front(), length, true); // true = output handler need to copy the string
- }
- bool StartObject() { return out_.StartObject(); }
- bool Key(const char* str, SizeType length, bool copy) { return String(str, length, copy); }
- bool EndObject(SizeType memberCount) { return out_.EndObject(memberCount); }
- bool StartArray() { return out_.StartArray(); }
- bool EndArray(SizeType elementCount) { return out_.EndArray(elementCount); }
-
- OutputHandler& out_;
- std::vector<char> buffer_;
-
-private:
- CapitalizeFilter(const CapitalizeFilter&);
- CapitalizeFilter& operator=(const CapitalizeFilter&);
-};
-
-int main(int, char*[]) {
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- CapitalizeFilter<Writer<FileWriteStream> > filter(writer);
- if (!reader.Parse(is, filter)) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/condense/condense.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/condense/condense.cpp
deleted file mode 100644
index f2d05ca694..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/condense/condense.cpp
+++ /dev/null
@@ -1,32 +0,0 @@
-// JSON condenser example
-
-// This example parses JSON text from stdin with validation,
-// and re-output the JSON content to stdout without whitespace.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-
-using namespace rapidjson;
-
-int main(int, char*[]) {
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- if (!reader.Parse(is, writer)) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkey/filterkey.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkey/filterkey.cpp
deleted file mode 100644
index 3ef72314ef..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkey/filterkey.cpp
+++ /dev/null
@@ -1,135 +0,0 @@
-// JSON filterkey example with SAX-style API.
-
-// This example parses JSON text from stdin with validation.
-// During parsing, specified key will be filtered using a SAX handler.
-// It re-output the JSON content to stdout without whitespace.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <stack>
-
-using namespace rapidjson;
-
-// This handler forwards event into an output handler, with filtering the descendent events of specified key.
-template <typename OutputHandler>
-class FilterKeyHandler {
-public:
- typedef char Ch;
-
- FilterKeyHandler(OutputHandler& outputHandler, const Ch* keyString, SizeType keyLength) :
- outputHandler_(outputHandler), keyString_(keyString), keyLength_(keyLength), filterValueDepth_(), filteredKeyCount_()
- {}
-
- bool Null() { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Null() && EndValue(); }
- bool Bool(bool b) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Bool(b) && EndValue(); }
- bool Int(int i) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int(i) && EndValue(); }
- bool Uint(unsigned u) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint(u) && EndValue(); }
- bool Int64(int64_t i) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int64(i) && EndValue(); }
- bool Uint64(uint64_t u) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint64(u) && EndValue(); }
- bool Double(double d) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Double(d) && EndValue(); }
- bool RawNumber(const Ch* str, SizeType len, bool copy) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.RawNumber(str, len, copy) && EndValue(); }
- bool String (const Ch* str, SizeType len, bool copy) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.String (str, len, copy) && EndValue(); }
-
- bool StartObject() {
- if (filterValueDepth_ > 0) {
- filterValueDepth_++;
- return true;
- }
- else {
- filteredKeyCount_.push(0);
- return outputHandler_.StartObject();
- }
- }
-
- bool Key(const Ch* str, SizeType len, bool copy) {
- if (filterValueDepth_ > 0)
- return true;
- else if (len == keyLength_ && std::memcmp(str, keyString_, len) == 0) {
- filterValueDepth_ = 1;
- return true;
- }
- else {
- ++filteredKeyCount_.top();
- return outputHandler_.Key(str, len, copy);
- }
- }
-
- bool EndObject(SizeType) {
- if (filterValueDepth_ > 0) {
- filterValueDepth_--;
- return EndValue();
- }
- else {
- // Use our own filtered memberCount
- SizeType memberCount = filteredKeyCount_.top();
- filteredKeyCount_.pop();
- return outputHandler_.EndObject(memberCount) && EndValue();
- }
- }
-
- bool StartArray() {
- if (filterValueDepth_ > 0) {
- filterValueDepth_++;
- return true;
- }
- else
- return outputHandler_.StartArray();
- }
-
- bool EndArray(SizeType elementCount) {
- if (filterValueDepth_ > 0) {
- filterValueDepth_--;
- return EndValue();
- }
- else
- return outputHandler_.EndArray(elementCount) && EndValue();
- }
-
-private:
- FilterKeyHandler(const FilterKeyHandler&);
- FilterKeyHandler& operator=(const FilterKeyHandler&);
-
- bool EndValue() {
- if (filterValueDepth_ == 1) // Just at the end of value after filtered key
- filterValueDepth_ = 0;
- return true;
- }
-
- OutputHandler& outputHandler_;
- const char* keyString_;
- const SizeType keyLength_;
- unsigned filterValueDepth_;
- std::stack<SizeType> filteredKeyCount_;
-};
-
-int main(int argc, char* argv[]) {
- if (argc != 2) {
- fprintf(stderr, "filterkey key < input.json > output.json\n");
- return 1;
- }
-
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // Prepare Filter
- FilterKeyHandler<Writer<FileWriteStream> > filter(writer, argv[1], static_cast<SizeType>(strlen(argv[1])));
-
- // JSON reader parse from the input stream, filter handler filters the events, and forward to writer.
- // i.e. the events flow is: reader -> filter -> writer
- if (!reader.Parse(is, filter)) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkeydom/filterkeydom.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkeydom/filterkeydom.cpp
deleted file mode 100644
index b8cfdf0c80..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/filterkeydom/filterkeydom.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-// JSON filterkey example which populates filtered SAX events into a Document.
-
-// This example parses JSON text from stdin with validation.
-// During parsing, specified key will be filtered using a SAX handler.
-// And finally the filtered events are used to populate a Document.
-// As an example, the document is written to standard output.
-
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <stack>
-
-using namespace rapidjson;
-
-// This handler forwards event into an output handler, with filtering the descendent events of specified key.
-template <typename OutputHandler>
-class FilterKeyHandler {
-public:
- typedef char Ch;
-
- FilterKeyHandler(OutputHandler& outputHandler, const Ch* keyString, SizeType keyLength) :
- outputHandler_(outputHandler), keyString_(keyString), keyLength_(keyLength), filterValueDepth_(), filteredKeyCount_()
- {}
-
- bool Null() { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Null() && EndValue(); }
- bool Bool(bool b) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Bool(b) && EndValue(); }
- bool Int(int i) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int(i) && EndValue(); }
- bool Uint(unsigned u) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint(u) && EndValue(); }
- bool Int64(int64_t i) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Int64(i) && EndValue(); }
- bool Uint64(uint64_t u) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Uint64(u) && EndValue(); }
- bool Double(double d) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.Double(d) && EndValue(); }
- bool RawNumber(const Ch* str, SizeType len, bool copy) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.RawNumber(str, len, copy) && EndValue(); }
- bool String (const Ch* str, SizeType len, bool copy) { return filterValueDepth_ > 0 ? EndValue() : outputHandler_.String (str, len, copy) && EndValue(); }
-
- bool StartObject() {
- if (filterValueDepth_ > 0) {
- filterValueDepth_++;
- return true;
- }
- else {
- filteredKeyCount_.push(0);
- return outputHandler_.StartObject();
- }
- }
-
- bool Key(const Ch* str, SizeType len, bool copy) {
- if (filterValueDepth_ > 0)
- return true;
- else if (len == keyLength_ && std::memcmp(str, keyString_, len) == 0) {
- filterValueDepth_ = 1;
- return true;
- }
- else {
- ++filteredKeyCount_.top();
- return outputHandler_.Key(str, len, copy);
- }
- }
-
- bool EndObject(SizeType) {
- if (filterValueDepth_ > 0) {
- filterValueDepth_--;
- return EndValue();
- }
- else {
- // Use our own filtered memberCount
- SizeType memberCount = filteredKeyCount_.top();
- filteredKeyCount_.pop();
- return outputHandler_.EndObject(memberCount) && EndValue();
- }
- }
-
- bool StartArray() {
- if (filterValueDepth_ > 0) {
- filterValueDepth_++;
- return true;
- }
- else
- return outputHandler_.StartArray();
- }
-
- bool EndArray(SizeType elementCount) {
- if (filterValueDepth_ > 0) {
- filterValueDepth_--;
- return EndValue();
- }
- else
- return outputHandler_.EndArray(elementCount) && EndValue();
- }
-
-private:
- FilterKeyHandler(const FilterKeyHandler&);
- FilterKeyHandler& operator=(const FilterKeyHandler&);
-
- bool EndValue() {
- if (filterValueDepth_ == 1) // Just at the end of value after filtered key
- filterValueDepth_ = 0;
- return true;
- }
-
- OutputHandler& outputHandler_;
- const char* keyString_;
- const SizeType keyLength_;
- unsigned filterValueDepth_;
- std::stack<SizeType> filteredKeyCount_;
-};
-
-// Implements a generator for Document::Populate()
-template <typename InputStream>
-class FilterKeyReader {
-public:
- typedef char Ch;
-
- FilterKeyReader(InputStream& is, const Ch* keyString, SizeType keyLength) :
- is_(is), keyString_(keyString), keyLength_(keyLength), parseResult_()
- {}
-
- // SAX event flow: reader -> filter -> handler
- template <typename Handler>
- bool operator()(Handler& handler) {
- FilterKeyHandler<Handler> filter(handler, keyString_, keyLength_);
- Reader reader;
- parseResult_ = reader.Parse(is_, filter);
- return parseResult_;
- }
-
- const ParseResult& GetParseResult() const { return parseResult_; }
-
-private:
- FilterKeyReader(const FilterKeyReader&);
- FilterKeyReader& operator=(const FilterKeyReader&);
-
- InputStream& is_;
- const char* keyString_;
- const SizeType keyLength_;
- ParseResult parseResult_;
-};
-
-int main(int argc, char* argv[]) {
- if (argc != 2) {
- fprintf(stderr, "filterkeydom key < input.json > output.json\n");
- return 1;
- }
-
- // Prepare input stream.
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare Filter
- FilterKeyReader<FileReadStream> reader(is, argv[1], static_cast<SizeType>(strlen(argv[1])));
-
- // Populates the filtered events from reader
- Document document;
- document.Populate(reader);
- ParseResult pr = reader.GetParseResult();
- if (!pr) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(pr.Offset()), GetParseError_En(pr.Code()));
- return 1;
- }
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- Writer<FileWriteStream> writer(os);
-
- // Write the document to standard output
- document.Accept(writer);
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/jsonx/jsonx.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/jsonx/jsonx.cpp
deleted file mode 100644
index b08efc6087..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/jsonx/jsonx.cpp
+++ /dev/null
@@ -1,207 +0,0 @@
-// JSON to JSONx conversion example, using SAX API.
-// JSONx is an IBM standard format to represent JSON as XML.
-// https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html
-// This example parses JSON text from stdin with validation,
-// and convert to JSONx format to stdout.
-// Need compile with -D__STDC_FORMAT_MACROS for defining PRId64 and PRIu64 macros.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-#include <cstdio>
-
-using namespace rapidjson;
-
-// For simplicity, this example only read/write in UTF-8 encoding
-template <typename OutputStream>
-class JsonxWriter {
-public:
- JsonxWriter(OutputStream& os) : os_(os), name_(), level_(0), hasName_(false) {
- }
-
- bool Null() {
- return WriteStartElement("null", true);
- }
-
- bool Bool(bool b) {
- return
- WriteStartElement("boolean") &&
- WriteString(b ? "true" : "false") &&
- WriteEndElement("boolean");
- }
-
- bool Int(int i) {
- char buffer[12];
- return WriteNumberElement(buffer, sprintf(buffer, "%d", i));
- }
-
- bool Uint(unsigned i) {
- char buffer[11];
- return WriteNumberElement(buffer, sprintf(buffer, "%u", i));
- }
-
- bool Int64(int64_t i) {
- char buffer[21];
- return WriteNumberElement(buffer, sprintf(buffer, "%" PRId64, i));
- }
-
- bool Uint64(uint64_t i) {
- char buffer[21];
- return WriteNumberElement(buffer, sprintf(buffer, "%" PRIu64, i));
- }
-
- bool Double(double d) {
- char buffer[30];
- return WriteNumberElement(buffer, sprintf(buffer, "%.17g", d));
- }
-
- bool RawNumber(const char* str, SizeType length, bool) {
- return
- WriteStartElement("number") &&
- WriteEscapedText(str, length) &&
- WriteEndElement("number");
- }
-
- bool String(const char* str, SizeType length, bool) {
- return
- WriteStartElement("string") &&
- WriteEscapedText(str, length) &&
- WriteEndElement("string");
- }
-
- bool StartObject() {
- return WriteStartElement("object");
- }
-
- bool Key(const char* str, SizeType length, bool) {
- // backup key to name_
- name_.Clear();
- for (SizeType i = 0; i < length; i++)
- name_.Put(str[i]);
- hasName_ = true;
- return true;
- }
-
- bool EndObject(SizeType) {
- return WriteEndElement("object");
- }
-
- bool StartArray() {
- return WriteStartElement("array");
- }
-
- bool EndArray(SizeType) {
- return WriteEndElement("array");
- }
-
-private:
- bool WriteString(const char* s) {
- while (*s)
- os_.Put(*s++);
- return true;
- }
-
- bool WriteEscapedAttributeValue(const char* s, size_t length) {
- for (size_t i = 0; i < length; i++) {
- switch (s[i]) {
- case '&': WriteString("&amp;"); break;
- case '<': WriteString("&lt;"); break;
- case '"': WriteString("&quot;"); break;
- default: os_.Put(s[i]); break;
- }
- }
- return true;
- }
-
- bool WriteEscapedText(const char* s, size_t length) {
- for (size_t i = 0; i < length; i++) {
- switch (s[i]) {
- case '&': WriteString("&amp;"); break;
- case '<': WriteString("&lt;"); break;
- default: os_.Put(s[i]); break;
- }
- }
- return true;
- }
-
- bool WriteStartElement(const char* type, bool emptyElement = false) {
- if (level_ == 0)
- if (!WriteString("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"))
- return false;
-
- if (!WriteString("<json:") || !WriteString(type))
- return false;
-
- // For root element, need to add declarations
- if (level_ == 0) {
- if (!WriteString(
- " xsi:schemaLocation=\"http://www.datapower.com/schemas/json jsonx.xsd\""
- " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\""
- " xmlns:json=\"http://www.ibm.com/xmlns/prod/2009/jsonx\""))
- return false;
- }
-
- if (hasName_) {
- hasName_ = false;
- if (!WriteString(" name=\"") ||
- !WriteEscapedAttributeValue(name_.GetString(), name_.GetSize()) ||
- !WriteString("\""))
- return false;
- }
-
- if (emptyElement)
- return WriteString("/>");
- else {
- level_++;
- return WriteString(">");
- }
- }
-
- bool WriteEndElement(const char* type) {
- if (!WriteString("</json:") ||
- !WriteString(type) ||
- !WriteString(">"))
- return false;
-
- // For the last end tag, flush the output stream.
- if (--level_ == 0)
- os_.Flush();
-
- return true;
- }
-
- bool WriteNumberElement(const char* buffer, int length) {
- if (!WriteStartElement("number"))
- return false;
- for (int j = 0; j < length; j++)
- os_.Put(buffer[j]);
- return WriteEndElement("number");
- }
-
- OutputStream& os_;
- StringBuffer name_;
- unsigned level_;
- bool hasName_;
-};
-
-int main(int, char*[]) {
- // Prepare JSON reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare JSON writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- JsonxWriter<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- if (!reader.Parse(is, writer)) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/lookaheadparser/lookaheadparser.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/lookaheadparser/lookaheadparser.cpp
deleted file mode 100644
index 8824ef7867..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/lookaheadparser/lookaheadparser.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-#include "rapidjson/reader.h"
-#include "rapidjson/document.h"
-#include <iostream>
-
-RAPIDJSON_DIAG_PUSH
-#ifdef __GNUC__
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-// This example demonstrates JSON token-by-token parsing with an API that is
-// more direct; you don't need to design your logic around a handler object and
-// callbacks. Instead, you retrieve values from the JSON stream by calling
-// GetInt(), GetDouble(), GetString() and GetBool(), traverse into structures
-// by calling EnterObject() and EnterArray(), and skip over unwanted data by
-// calling SkipValue(). When you know your JSON's structure, this can be quite
-// convenient.
-//
-// If you aren't sure of what's next in the JSON data, you can use PeekType() and
-// PeekValue() to look ahead to the next object before reading it.
-//
-// If you call the wrong retrieval method--e.g. GetInt when the next JSON token is
-// not an int, EnterObject or EnterArray when there isn't actually an object or array
-// to read--the stream parsing will end immediately and no more data will be delivered.
-//
-// After calling EnterObject, you retrieve keys via NextObjectKey() and values via
-// the normal getters. When NextObjectKey() returns null, you have exited the
-// object, or you can call SkipObject() to skip to the end of the object
-// immediately. If you fetch the entire object (i.e. NextObjectKey() returned null),
-// you should not call SkipObject().
-//
-// After calling EnterArray(), you must alternate between calling NextArrayValue()
-// to see if the array has more data, and then retrieving values via the normal
-// getters. You can call SkipArray() to skip to the end of the array immediately.
-// If you fetch the entire array (i.e. NextArrayValue() returned null),
-// you should not call SkipArray().
-//
-// This parser uses in-situ strings, so the JSON buffer will be altered during the
-// parse.
-
-using namespace rapidjson;
-
-
-class LookaheadParserHandler {
-public:
- bool Null() { st_ = kHasNull; v_.SetNull(); return true; }
- bool Bool(bool b) { st_ = kHasBool; v_.SetBool(b); return true; }
- bool Int(int i) { st_ = kHasNumber; v_.SetInt(i); return true; }
- bool Uint(unsigned u) { st_ = kHasNumber; v_.SetUint(u); return true; }
- bool Int64(int64_t i) { st_ = kHasNumber; v_.SetInt64(i); return true; }
- bool Uint64(uint64_t u) { st_ = kHasNumber; v_.SetUint64(u); return true; }
- bool Double(double d) { st_ = kHasNumber; v_.SetDouble(d); return true; }
- bool RawNumber(const char*, SizeType, bool) { return false; }
- bool String(const char* str, SizeType length, bool) { st_ = kHasString; v_.SetString(str, length); return true; }
- bool StartObject() { st_ = kEnteringObject; return true; }
- bool Key(const char* str, SizeType length, bool) { st_ = kHasKey; v_.SetString(str, length); return true; }
- bool EndObject(SizeType) { st_ = kExitingObject; return true; }
- bool StartArray() { st_ = kEnteringArray; return true; }
- bool EndArray(SizeType) { st_ = kExitingArray; return true; }
-
-protected:
- LookaheadParserHandler(char* str);
- void ParseNext();
-
-protected:
- enum LookaheadParsingState {
- kInit,
- kError,
- kHasNull,
- kHasBool,
- kHasNumber,
- kHasString,
- kHasKey,
- kEnteringObject,
- kExitingObject,
- kEnteringArray,
- kExitingArray
- };
-
- Value v_;
- LookaheadParsingState st_;
- Reader r_;
- InsituStringStream ss_;
-
- static const int parseFlags = kParseDefaultFlags | kParseInsituFlag;
-};
-
-LookaheadParserHandler::LookaheadParserHandler(char* str) : v_(), st_(kInit), r_(), ss_(str) {
- r_.IterativeParseInit();
- ParseNext();
-}
-
-void LookaheadParserHandler::ParseNext() {
- if (r_.HasParseError()) {
- st_ = kError;
- return;
- }
-
- r_.IterativeParseNext<parseFlags>(ss_, *this);
-}
-
-class LookaheadParser : protected LookaheadParserHandler {
-public:
- LookaheadParser(char* str) : LookaheadParserHandler(str) {}
-
- bool EnterObject();
- bool EnterArray();
- const char* NextObjectKey();
- bool NextArrayValue();
- int GetInt();
- double GetDouble();
- const char* GetString();
- bool GetBool();
- void GetNull();
-
- void SkipObject();
- void SkipArray();
- void SkipValue();
- Value* PeekValue();
- int PeekType(); // returns a rapidjson::Type, or -1 for no value (at end of object/array)
-
- bool IsValid() { return st_ != kError; }
-
-protected:
- void SkipOut(int depth);
-};
-
-bool LookaheadParser::EnterObject() {
- if (st_ != kEnteringObject) {
- st_ = kError;
- return false;
- }
-
- ParseNext();
- return true;
-}
-
-bool LookaheadParser::EnterArray() {
- if (st_ != kEnteringArray) {
- st_ = kError;
- return false;
- }
-
- ParseNext();
- return true;
-}
-
-const char* LookaheadParser::NextObjectKey() {
- if (st_ == kHasKey) {
- const char* result = v_.GetString();
- ParseNext();
- return result;
- }
-
- if (st_ != kExitingObject) {
- st_ = kError;
- return 0;
- }
-
- ParseNext();
- return 0;
-}
-
-bool LookaheadParser::NextArrayValue() {
- if (st_ == kExitingArray) {
- ParseNext();
- return false;
- }
-
- if (st_ == kError || st_ == kExitingObject || st_ == kHasKey) {
- st_ = kError;
- return false;
- }
-
- return true;
-}
-
-int LookaheadParser::GetInt() {
- if (st_ != kHasNumber || !v_.IsInt()) {
- st_ = kError;
- return 0;
- }
-
- int result = v_.GetInt();
- ParseNext();
- return result;
-}
-
-double LookaheadParser::GetDouble() {
- if (st_ != kHasNumber) {
- st_ = kError;
- return 0.;
- }
-
- double result = v_.GetDouble();
- ParseNext();
- return result;
-}
-
-bool LookaheadParser::GetBool() {
- if (st_ != kHasBool) {
- st_ = kError;
- return false;
- }
-
- bool result = v_.GetBool();
- ParseNext();
- return result;
-}
-
-void LookaheadParser::GetNull() {
- if (st_ != kHasNull) {
- st_ = kError;
- return;
- }
-
- ParseNext();
-}
-
-const char* LookaheadParser::GetString() {
- if (st_ != kHasString) {
- st_ = kError;
- return 0;
- }
-
- const char* result = v_.GetString();
- ParseNext();
- return result;
-}
-
-void LookaheadParser::SkipOut(int depth) {
- do {
- if (st_ == kEnteringArray || st_ == kEnteringObject) {
- ++depth;
- }
- else if (st_ == kExitingArray || st_ == kExitingObject) {
- --depth;
- }
- else if (st_ == kError) {
- return;
- }
-
- ParseNext();
- }
- while (depth > 0);
-}
-
-void LookaheadParser::SkipValue() {
- SkipOut(0);
-}
-
-void LookaheadParser::SkipArray() {
- SkipOut(1);
-}
-
-void LookaheadParser::SkipObject() {
- SkipOut(1);
-}
-
-Value* LookaheadParser::PeekValue() {
- if (st_ >= kHasNull && st_ <= kHasKey) {
- return &v_;
- }
-
- return 0;
-}
-
-int LookaheadParser::PeekType() {
- if (st_ >= kHasNull && st_ <= kHasKey) {
- return v_.GetType();
- }
-
- if (st_ == kEnteringArray) {
- return kArrayType;
- }
-
- if (st_ == kEnteringObject) {
- return kObjectType;
- }
-
- return -1;
-}
-
-//-------------------------------------------------------------------------
-
-int main() {
- using namespace std;
-
- char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null,"
- "\"i\":123, \"pi\": 3.1416, \"a\":[-1, 2, 3, 4, \"array\", []], \"skipArrays\":[1, 2, [[[3]]]], "
- "\"skipObject\":{ \"i\":0, \"t\":true, \"n\":null, \"d\":123.45 }, "
- "\"skipNested\":[[[[{\"\":0}, {\"\":[-9.87]}]]], [], []], "
- "\"skipString\":\"zzz\", \"reachedEnd\":null, \"t\":true }";
-
- LookaheadParser r(json);
-
- RAPIDJSON_ASSERT(r.PeekType() == kObjectType);
-
- r.EnterObject();
- while (const char* key = r.NextObjectKey()) {
- if (0 == strcmp(key, "hello")) {
- RAPIDJSON_ASSERT(r.PeekType() == kStringType);
- cout << key << ":" << r.GetString() << endl;
- }
- else if (0 == strcmp(key, "t") || 0 == strcmp(key, "f")) {
- RAPIDJSON_ASSERT(r.PeekType() == kTrueType || r.PeekType() == kFalseType);
- cout << key << ":" << r.GetBool() << endl;
- continue;
- }
- else if (0 == strcmp(key, "n")) {
- RAPIDJSON_ASSERT(r.PeekType() == kNullType);
- r.GetNull();
- cout << key << endl;
- continue;
- }
- else if (0 == strcmp(key, "pi")) {
- RAPIDJSON_ASSERT(r.PeekType() == kNumberType);
- cout << key << ":" << r.GetDouble() << endl;
- continue;
- }
- else if (0 == strcmp(key, "a")) {
- RAPIDJSON_ASSERT(r.PeekType() == kArrayType);
-
- r.EnterArray();
-
- cout << key << ":[ ";
- while (r.NextArrayValue()) {
- if (r.PeekType() == kNumberType) {
- cout << r.GetDouble() << " ";
- }
- else if (r.PeekType() == kStringType) {
- cout << r.GetString() << " ";
- }
- else {
- r.SkipArray();
- break;
- }
- }
-
- cout << "]" << endl;
- }
- else {
- cout << key << ":skipped" << endl;
- r.SkipValue();
- }
- }
-
- return 0;
-}
-
-RAPIDJSON_DIAG_POP
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/messagereader/messagereader.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/messagereader/messagereader.cpp
deleted file mode 100644
index 3399bc9400..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/messagereader/messagereader.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-// Reading a message JSON with Reader (SAX-style API).
-// The JSON should be an object with key-string pairs.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/error/en.h"
-#include <iostream>
-#include <string>
-#include <map>
-
-using namespace std;
-using namespace rapidjson;
-
-typedef map<string, string> MessageMap;
-
-#if defined(__GNUC__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(switch-enum)
-#endif
-
-struct MessageHandler
- : public BaseReaderHandler<UTF8<>, MessageHandler> {
- MessageHandler() : messages_(), state_(kExpectObjectStart), name_() {}
-
- bool StartObject() {
- switch (state_) {
- case kExpectObjectStart:
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool String(const char* str, SizeType length, bool) {
- switch (state_) {
- case kExpectNameOrObjectEnd:
- name_ = string(str, length);
- state_ = kExpectValue;
- return true;
- case kExpectValue:
- messages_.insert(MessageMap::value_type(name_, string(str, length)));
- state_ = kExpectNameOrObjectEnd;
- return true;
- default:
- return false;
- }
- }
-
- bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }
-
- bool Default() { return false; } // All other events are invalid.
-
- MessageMap messages_;
- enum State {
- kExpectObjectStart,
- kExpectNameOrObjectEnd,
- kExpectValue
- }state_;
- std::string name_;
-};
-
-#if defined(__GNUC__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-static void ParseMessages(const char* json, MessageMap& messages) {
- Reader reader;
- MessageHandler handler;
- StringStream ss(json);
- if (reader.Parse(ss, handler))
- messages.swap(handler.messages_); // Only change it if success.
- else {
- ParseErrorCode e = reader.GetParseErrorCode();
- size_t o = reader.GetErrorOffset();
- cout << "Error: " << GetParseError_En(e) << endl;;
- cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;
- }
-}
-
-int main() {
- MessageMap messages;
-
- const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";
- cout << json1 << endl;
- ParseMessages(json1, messages);
-
- for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)
- cout << itr->first << ": " << itr->second << endl;
-
- cout << endl << "Parse a JSON with invalid schema." << endl;
- const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";
- cout << json2 << endl;
- ParseMessages(json2, messages);
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/parsebyparts/parsebyparts.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/parsebyparts/parsebyparts.cpp
deleted file mode 100644
index 3d8b494221..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/parsebyparts/parsebyparts.cpp
+++ /dev/null
@@ -1,176 +0,0 @@
-// Example of parsing JSON to document by parts.
-
-// Using C++11 threads
-// Temporarily disable for clang (older version) due to incompatibility with libstdc++
-#if (__cplusplus >= 201103L || (defined(_MSC_VER) && _MSC_VER >= 1700)) && !defined(__clang__)
-
-#include "rapidjson/document.h"
-#include "rapidjson/error/en.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/ostreamwrapper.h"
-#include <condition_variable>
-#include <iostream>
-#include <mutex>
-#include <thread>
-
-using namespace rapidjson;
-
-template<unsigned parseFlags = kParseDefaultFlags>
-class AsyncDocumentParser {
-public:
- AsyncDocumentParser(Document& d)
- : stream_(*this)
- , d_(d)
- , parseThread_()
- , mutex_()
- , notEmpty_()
- , finish_()
- , completed_()
- {
- // Create and execute thread after all member variables are initialized.
- parseThread_ = std::thread(&AsyncDocumentParser::Parse, this);
- }
-
- ~AsyncDocumentParser() {
- if (!parseThread_.joinable())
- return;
-
- {
- std::unique_lock<std::mutex> lock(mutex_);
-
- // Wait until the buffer is read up (or parsing is completed)
- while (!stream_.Empty() && !completed_)
- finish_.wait(lock);
-
- // Automatically append '\0' as the terminator in the stream.
- static const char terminator[] = "";
- stream_.src_ = terminator;
- stream_.end_ = terminator + 1;
- notEmpty_.notify_one(); // unblock the AsyncStringStream
- }
-
- parseThread_.join();
- }
-
- void ParsePart(const char* buffer, size_t length) {
- std::unique_lock<std::mutex> lock(mutex_);
-
- // Wait until the buffer is read up (or parsing is completed)
- while (!stream_.Empty() && !completed_)
- finish_.wait(lock);
-
- // Stop further parsing if the parsing process is completed.
- if (completed_)
- return;
-
- // Set the buffer to stream and unblock the AsyncStringStream
- stream_.src_ = buffer;
- stream_.end_ = buffer + length;
- notEmpty_.notify_one();
- }
-
-private:
- void Parse() {
- d_.ParseStream<parseFlags>(stream_);
-
- // The stream may not be fully read, notify finish anyway to unblock ParsePart()
- std::unique_lock<std::mutex> lock(mutex_);
- completed_ = true; // Parsing process is completed
- finish_.notify_one(); // Unblock ParsePart() or destructor if they are waiting.
- }
-
- struct AsyncStringStream {
- typedef char Ch;
-
- AsyncStringStream(AsyncDocumentParser& parser) : parser_(parser), src_(), end_(), count_() {}
-
- char Peek() const {
- std::unique_lock<std::mutex> lock(parser_.mutex_);
-
- // If nothing in stream, block to wait.
- while (Empty())
- parser_.notEmpty_.wait(lock);
-
- return *src_;
- }
-
- char Take() {
- std::unique_lock<std::mutex> lock(parser_.mutex_);
-
- // If nothing in stream, block to wait.
- while (Empty())
- parser_.notEmpty_.wait(lock);
-
- count_++;
- char c = *src_++;
-
- // If all stream is read up, notify that the stream is finish.
- if (Empty())
- parser_.finish_.notify_one();
-
- return c;
- }
-
- size_t Tell() const { return count_; }
-
- // Not implemented
- char* PutBegin() { return 0; }
- void Put(char) {}
- void Flush() {}
- size_t PutEnd(char*) { return 0; }
-
- bool Empty() const { return src_ == end_; }
-
- AsyncDocumentParser& parser_;
- const char* src_; //!< Current read position.
- const char* end_; //!< End of buffer
- size_t count_; //!< Number of characters taken so far.
- };
-
- AsyncStringStream stream_;
- Document& d_;
- std::thread parseThread_;
- std::mutex mutex_;
- std::condition_variable notEmpty_;
- std::condition_variable finish_;
- bool completed_;
-};
-
-int main() {
- Document d;
-
- {
- AsyncDocumentParser<> parser(d);
-
- const char json1[] = " { \"hello\" : \"world\", \"t\" : tr";
- //const char json1[] = " { \"hello\" : \"world\", \"t\" : trX"; // For test parsing error
- const char json2[] = "ue, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.14";
- const char json3[] = "16, \"a\":[1, 2, 3, 4] } ";
-
- parser.ParsePart(json1, sizeof(json1) - 1);
- parser.ParsePart(json2, sizeof(json2) - 1);
- parser.ParsePart(json3, sizeof(json3) - 1);
- }
-
- if (d.HasParseError()) {
- std::cout << "Error at offset " << d.GetErrorOffset() << ": " << GetParseError_En(d.GetParseError()) << std::endl;
- return EXIT_FAILURE;
- }
-
- // Stringify the JSON to cout
- OStreamWrapper os(std::cout);
- Writer<OStreamWrapper> writer(os);
- d.Accept(writer);
- std::cout << std::endl;
-
- return EXIT_SUCCESS;
-}
-
-#else // Not supporting C++11
-
-#include <iostream>
-int main() {
- std::cout << "This example requires C++11 compiler" << std::endl;
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/pretty/pretty.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/pretty/pretty.cpp
deleted file mode 100644
index 2feff5d02e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/pretty/pretty.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// JSON pretty formatting example
-// This example can only handle UTF-8. For handling other encodings, see prettyauto example.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/error/en.h"
-
-using namespace rapidjson;
-
-int main(int, char*[]) {
- // Prepare reader and input stream.
- Reader reader;
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- // Prepare writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- PrettyWriter<FileWriteStream> writer(os);
-
- // JSON reader parse from the input stream and let writer generate the output.
- if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/prettyauto/prettyauto.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/prettyauto/prettyauto.cpp
deleted file mode 100644
index 1687bae555..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/prettyauto/prettyauto.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-// JSON pretty formatting example
-// This example can handle UTF-8/UTF-16LE/UTF-16BE/UTF-32LE/UTF-32BE.
-// The input firstly convert to UTF8, and then write to the original encoding with pretty formatting.
-
-#include "rapidjson/reader.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/encodedstream.h" // NEW
-#include "rapidjson/error/en.h"
-#ifdef _WIN32
-#include <fcntl.h>
-#include <io.h>
-#endif
-
-using namespace rapidjson;
-
-int main(int, char*[]) {
-#ifdef _WIN32
- // Prevent Windows converting between CR+LF and LF
- _setmode(_fileno(stdin), _O_BINARY); // NEW
- _setmode(_fileno(stdout), _O_BINARY); // NEW
-#endif
-
- // Prepare reader and input stream.
- //Reader reader;
- GenericReader<AutoUTF<unsigned>, UTF8<> > reader; // CHANGED
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
- AutoUTFInputStream<unsigned, FileReadStream> eis(is); // NEW
-
- // Prepare writer and output stream.
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
-
-#if 1
- // Use the same Encoding of the input. Also use BOM according to input.
- typedef AutoUTFOutputStream<unsigned, FileWriteStream> OutputStream; // NEW
- OutputStream eos(os, eis.GetType(), eis.HasBOM()); // NEW
- PrettyWriter<OutputStream, UTF8<>, AutoUTF<unsigned> > writer(eos); // CHANGED
-#else
- // You may also use static bound encoding type, such as output to UTF-16LE with BOM
- typedef EncodedOutputStream<UTF16LE<>,FileWriteStream> OutputStream; // NEW
- OutputStream eos(os, true); // NEW
- PrettyWriter<OutputStream, UTF8<>, UTF16LE<> > writer(eos); // CHANGED
-#endif
-
- // JSON reader parse from the input stream and let writer generate the output.
- //if (!reader.Parse<kParseValidateEncodingFlag>(is, writer)) {
- if (!reader.Parse<kParseValidateEncodingFlag>(eis, writer)) { // CHANGED
- fprintf(stderr, "\nError(%u): %s\n", static_cast<unsigned>(reader.GetErrorOffset()), GetParseError_En(reader.GetParseErrorCode()));
- return 1;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/schemavalidator/schemavalidator.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/schemavalidator/schemavalidator.cpp
deleted file mode 100644
index 0d3d0632f2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/schemavalidator/schemavalidator.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-// Schema Validator example
-
-// The example validates JSON text from stdin with a JSON schema specified in the argument.
-
-#define RAPIDJSON_HAS_STDSTRING 1
-
-#include "rapidjson/error/en.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/schema.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/prettywriter.h"
-#include <string>
-#include <iostream>
-#include <sstream>
-
-using namespace rapidjson;
-
-typedef GenericValue<UTF8<>, CrtAllocator > ValueType;
-
-// Forward ref
-static void CreateErrorMessages(const ValueType& errors, size_t depth, const char* context);
-
-// Convert GenericValue to std::string
-static std::string GetString(const ValueType& val) {
- std::ostringstream s;
- if (val.IsString())
- s << val.GetString();
- else if (val.IsDouble())
- s << val.GetDouble();
- else if (val.IsUint())
- s << val.GetUint();
- else if (val.IsInt())
- s << val.GetInt();
- else if (val.IsUint64())
- s << val.GetUint64();
- else if (val.IsInt64())
- s << val.GetInt64();
- else if (val.IsBool() && val.GetBool())
- s << "true";
- else if (val.IsBool())
- s << "false";
- else if (val.IsFloat())
- s << val.GetFloat();
- return s.str();
-}
-
-// Create the error message for a named error
-// The error object can either be empty or contain at least member properties:
-// {"errorCode": <code>, "instanceRef": "<pointer>", "schemaRef": "<pointer>" }
-// Additional properties may be present for use as inserts.
-// An "errors" property may be present if there are child errors.
-static void HandleError(const char* errorName, const ValueType& error, size_t depth, const char* context) {
- if (!error.ObjectEmpty()) {
- // Get error code and look up error message text (English)
- int code = error["errorCode"].GetInt();
- std::string message(GetValidateError_En(static_cast<ValidateErrorCode>(code)));
- // For each member property in the error, see if its name exists as an insert in the error message and if so replace with the stringified property value
- // So for example - "Number '%actual' is not a multiple of the 'multipleOf' value '%expected'." - we would expect "actual" and "expected" members.
- for (ValueType::ConstMemberIterator insertsItr = error.MemberBegin();
- insertsItr != error.MemberEnd(); ++insertsItr) {
- std::string insertName("%");
- insertName += insertsItr->name.GetString(); // eg "%actual"
- size_t insertPos = message.find(insertName);
- if (insertPos != std::string::npos) {
- std::string insertString("");
- const ValueType &insert = insertsItr->value;
- if (insert.IsArray()) {
- // Member is an array so create comma-separated list of items for the insert string
- for (ValueType::ConstValueIterator itemsItr = insert.Begin(); itemsItr != insert.End(); ++itemsItr) {
- if (itemsItr != insert.Begin()) insertString += ",";
- insertString += GetString(*itemsItr);
- }
- } else {
- insertString += GetString(insert);
- }
- message.replace(insertPos, insertName.length(), insertString);
- }
- }
- // Output error message, references, context
- std::string indent(depth * 2, ' ');
- std::cout << indent << "Error Name: " << errorName << std::endl;
- std::cout << indent << "Message: " << message.c_str() << std::endl;
- std::cout << indent << "Instance: " << error["instanceRef"].GetString() << std::endl;
- std::cout << indent << "Schema: " << error["schemaRef"].GetString() << std::endl;
- if (depth > 0) std::cout << indent << "Context: " << context << std::endl;
- std::cout << std::endl;
-
- // If child errors exist, apply the process recursively to each error structure.
- // This occurs for "oneOf", "allOf", "anyOf" and "dependencies" errors, so pass the error name as context.
- if (error.HasMember("errors")) {
- depth++;
- const ValueType &childErrors = error["errors"];
- if (childErrors.IsArray()) {
- // Array - each item is an error structure - example
- // "anyOf": {"errorCode": ..., "errors":[{"pattern": {"errorCode\": ...\"}}, {"pattern": {"errorCode\": ...}}]
- for (ValueType::ConstValueIterator errorsItr = childErrors.Begin();
- errorsItr != childErrors.End(); ++errorsItr) {
- CreateErrorMessages(*errorsItr, depth, errorName);
- }
- } else if (childErrors.IsObject()) {
- // Object - each member is an error structure - example
- // "dependencies": {"errorCode": ..., "errors": {"address": {"required": {"errorCode": ...}}, "name": {"required": {"errorCode": ...}}}
- for (ValueType::ConstMemberIterator propsItr = childErrors.MemberBegin();
- propsItr != childErrors.MemberEnd(); ++propsItr) {
- CreateErrorMessages(propsItr->value, depth, errorName);
- }
- }
- }
- }
-}
-
-// Create error message for all errors in an error structure
-// Context is used to indicate whether the error structure has a parent 'dependencies', 'allOf', 'anyOf' or 'oneOf' error
-static void CreateErrorMessages(const ValueType& errors, size_t depth = 0, const char* context = 0) {
- // Each member property contains one or more errors of a given type
- for (ValueType::ConstMemberIterator errorTypeItr = errors.MemberBegin(); errorTypeItr != errors.MemberEnd(); ++errorTypeItr) {
- const char* errorName = errorTypeItr->name.GetString();
- const ValueType& errorContent = errorTypeItr->value;
- if (errorContent.IsArray()) {
- // Member is an array where each item is an error - eg "type": [{"errorCode": ...}, {"errorCode": ...}]
- for (ValueType::ConstValueIterator contentItr = errorContent.Begin(); contentItr != errorContent.End(); ++contentItr) {
- HandleError(errorName, *contentItr, depth, context);
- }
- } else if (errorContent.IsObject()) {
- // Member is an object which is a single error - eg "type": {"errorCode": ... }
- HandleError(errorName, errorContent, depth, context);
- }
- }
-}
-
-int main(int argc, char *argv[]) {
- if (argc != 2) {
- fprintf(stderr, "Usage: schemavalidator schema.json < input.json\n");
- return EXIT_FAILURE;
- }
-
- // Read a JSON schema from file into Document
- Document d;
- char buffer[4096];
-
- {
- FILE *fp = fopen(argv[1], "r");
- if (!fp) {
- printf("Schema file '%s' not found\n", argv[1]);
- return -1;
- }
- FileReadStream fs(fp, buffer, sizeof(buffer));
- d.ParseStream(fs);
- if (d.HasParseError()) {
- fprintf(stderr, "Schema file '%s' is not a valid JSON\n", argv[1]);
- fprintf(stderr, "Error(offset %u): %s\n",
- static_cast<unsigned>(d.GetErrorOffset()),
- GetParseError_En(d.GetParseError()));
- fclose(fp);
- return EXIT_FAILURE;
- }
- fclose(fp);
- }
-
- // Then convert the Document into SchemaDocument
- SchemaDocument sd(d);
-
- // Use reader to parse the JSON in stdin, and forward SAX events to validator
- SchemaValidator validator(sd);
- Reader reader;
- FileReadStream is(stdin, buffer, sizeof(buffer));
- if (!reader.Parse(is, validator) && reader.GetParseErrorCode() != kParseErrorTermination) {
- // Schema validator error would cause kParseErrorTermination, which will handle it in next step.
- fprintf(stderr, "Input is not a valid JSON\n");
- fprintf(stderr, "Error(offset %u): %s\n",
- static_cast<unsigned>(reader.GetErrorOffset()),
- GetParseError_En(reader.GetParseErrorCode()));
- }
-
- // Check the validation result
- if (validator.IsValid()) {
- printf("Input JSON is valid.\n");
- return EXIT_SUCCESS;
- }
- else {
- printf("Input JSON is invalid.\n");
- StringBuffer sb;
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- fprintf(stderr, "Invalid schema: %s\n", sb.GetString());
- fprintf(stderr, "Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
- fprintf(stderr, "Invalid code: %d\n", validator.GetInvalidSchemaCode());
- fprintf(stderr, "Invalid message: %s\n", GetValidateError_En(validator.GetInvalidSchemaCode()));
- sb.Clear();
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- fprintf(stderr, "Invalid document: %s\n", sb.GetString());
- // Detailed violation report is available as a JSON value
- sb.Clear();
- PrettyWriter<StringBuffer> w(sb);
- validator.GetError().Accept(w);
- fprintf(stderr, "Error report:\n%s\n", sb.GetString());
- CreateErrorMessages(validator.GetError());
- return EXIT_FAILURE;
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/serialize/serialize.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/serialize/serialize.cpp
deleted file mode 100644
index f1be5c4183..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/serialize/serialize.cpp
+++ /dev/null
@@ -1,173 +0,0 @@
-// Serialize example
-// This example shows writing JSON string with writer directly.
-
-#include "rapidjson/prettywriter.h" // for stringify JSON
-#include <cstdio>
-#include <string>
-#include <vector>
-
-using namespace rapidjson;
-
-class Person {
-public:
- Person(const std::string& name, unsigned age) : name_(name), age_(age) {}
- Person(const Person& rhs) : name_(rhs.name_), age_(rhs.age_) {}
- virtual ~Person();
-
- Person& operator=(const Person& rhs) {
- name_ = rhs.name_;
- age_ = rhs.age_;
- return *this;
- }
-
-protected:
- template <typename Writer>
- void Serialize(Writer& writer) const {
- // This base class just write out name-value pairs, without wrapping within an object.
- writer.String("name");
-#if RAPIDJSON_HAS_STDSTRING
- writer.String(name_);
-#else
- writer.String(name_.c_str(), static_cast<SizeType>(name_.length())); // Supplying length of string is faster.
-#endif
- writer.String("age");
- writer.Uint(age_);
- }
-
-private:
- std::string name_;
- unsigned age_;
-};
-
-Person::~Person() {
-}
-
-class Education {
-public:
- Education(const std::string& school, double GPA) : school_(school), GPA_(GPA) {}
- Education(const Education& rhs) : school_(rhs.school_), GPA_(rhs.GPA_) {}
-
- template <typename Writer>
- void Serialize(Writer& writer) const {
- writer.StartObject();
-
- writer.String("school");
-#if RAPIDJSON_HAS_STDSTRING
- writer.String(school_);
-#else
- writer.String(school_.c_str(), static_cast<SizeType>(school_.length()));
-#endif
-
- writer.String("GPA");
- writer.Double(GPA_);
-
- writer.EndObject();
- }
-
-private:
- std::string school_;
- double GPA_;
-};
-
-class Dependent : public Person {
-public:
- Dependent(const std::string& name, unsigned age, Education* education = 0) : Person(name, age), education_(education) {}
- Dependent(const Dependent& rhs) : Person(rhs), education_(0) { education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_); }
- virtual ~Dependent();
-
- Dependent& operator=(const Dependent& rhs) {
- if (this == &rhs)
- return *this;
- delete education_;
- education_ = (rhs.education_ == 0) ? 0 : new Education(*rhs.education_);
- return *this;
- }
-
- template <typename Writer>
- void Serialize(Writer& writer) const {
- writer.StartObject();
-
- Person::Serialize(writer);
-
- writer.String("education");
- if (education_)
- education_->Serialize(writer);
- else
- writer.Null();
-
- writer.EndObject();
- }
-
-private:
-
- Education *education_;
-};
-
-Dependent::~Dependent() {
- delete education_;
-}
-
-class Employee : public Person {
-public:
- Employee(const std::string& name, unsigned age, bool married) : Person(name, age), dependents_(), married_(married) {}
- Employee(const Employee& rhs) : Person(rhs), dependents_(rhs.dependents_), married_(rhs.married_) {}
- virtual ~Employee();
-
- Employee& operator=(const Employee& rhs) {
- static_cast<Person&>(*this) = rhs;
- dependents_ = rhs.dependents_;
- married_ = rhs.married_;
- return *this;
- }
-
- void AddDependent(const Dependent& dependent) {
- dependents_.push_back(dependent);
- }
-
- template <typename Writer>
- void Serialize(Writer& writer) const {
- writer.StartObject();
-
- Person::Serialize(writer);
-
- writer.String("married");
- writer.Bool(married_);
-
- writer.String(("dependents"));
- writer.StartArray();
- for (std::vector<Dependent>::const_iterator dependentItr = dependents_.begin(); dependentItr != dependents_.end(); ++dependentItr)
- dependentItr->Serialize(writer);
- writer.EndArray();
-
- writer.EndObject();
- }
-
-private:
- std::vector<Dependent> dependents_;
- bool married_;
-};
-
-Employee::~Employee() {
-}
-
-int main(int, char*[]) {
- std::vector<Employee> employees;
-
- employees.push_back(Employee("Milo YIP", 34, true));
- employees.back().AddDependent(Dependent("Lua YIP", 3, new Education("Happy Kindergarten", 3.5)));
- employees.back().AddDependent(Dependent("Mio YIP", 1));
-
- employees.push_back(Employee("Percy TSE", 30, false));
-
- StringBuffer sb;
- PrettyWriter<StringBuffer> writer(sb);
-
- writer.StartArray();
- for (std::vector<Employee>::const_iterator employeeItr = employees.begin(); employeeItr != employees.end(); ++employeeItr)
- employeeItr->Serialize(writer);
- writer.EndArray();
-
- puts(sb.GetString());
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simpledom/simpledom.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/simpledom/simpledom.cpp
deleted file mode 100644
index 80384199a9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simpledom/simpledom.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-// JSON simple example
-// This example does not handle errors.
-
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-
-int main() {
- // 1. Parse a JSON string into DOM.
- const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
- Document d;
- d.Parse(json);
-
- // 2. Modify it by DOM.
- Value& s = d["stars"];
- s.SetInt(s.GetInt() + 1);
-
- // 3. Stringify the DOM
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- d.Accept(writer);
-
- // Output {"project":"rapidjson","stars":11}
- std::cout << buffer.GetString() << std::endl;
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplepullreader/simplepullreader.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplepullreader/simplepullreader.cpp
deleted file mode 100644
index 42c45ff1f6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplepullreader/simplepullreader.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-#include "rapidjson/reader.h"
-#include <iostream>
-#include <sstream>
-
-using namespace rapidjson;
-using namespace std;
-
-// If you can require C++11, you could use std::to_string here
-template <typename T> std::string stringify(T x) {
- std::stringstream ss;
- ss << x;
- return ss.str();
-}
-
-struct MyHandler {
- const char* type;
- std::string data;
-
- MyHandler() : type(), data() {}
-
- bool Null() { type = "Null"; data.clear(); return true; }
- bool Bool(bool b) { type = "Bool:"; data = b? "true": "false"; return true; }
- bool Int(int i) { type = "Int:"; data = stringify(i); return true; }
- bool Uint(unsigned u) { type = "Uint:"; data = stringify(u); return true; }
- bool Int64(int64_t i) { type = "Int64:"; data = stringify(i); return true; }
- bool Uint64(uint64_t u) { type = "Uint64:"; data = stringify(u); return true; }
- bool Double(double d) { type = "Double:"; data = stringify(d); return true; }
- bool RawNumber(const char* str, SizeType length, bool) { type = "Number:"; data = std::string(str, length); return true; }
- bool String(const char* str, SizeType length, bool) { type = "String:"; data = std::string(str, length); return true; }
- bool StartObject() { type = "StartObject"; data.clear(); return true; }
- bool Key(const char* str, SizeType length, bool) { type = "Key:"; data = std::string(str, length); return true; }
- bool EndObject(SizeType memberCount) { type = "EndObject:"; data = stringify(memberCount); return true; }
- bool StartArray() { type = "StartArray"; data.clear(); return true; }
- bool EndArray(SizeType elementCount) { type = "EndArray:"; data = stringify(elementCount); return true; }
-private:
- MyHandler(const MyHandler& noCopyConstruction);
- MyHandler& operator=(const MyHandler& noAssignment);
-};
-
-int main() {
- const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- MyHandler handler;
- Reader reader;
- StringStream ss(json);
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- reader.IterativeParseNext<kParseDefaultFlags>(ss, handler);
- cout << handler.type << handler.data << endl;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplereader/simplereader.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplereader/simplereader.cpp
deleted file mode 100644
index f86182dfb7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplereader/simplereader.cpp
+++ /dev/null
@@ -1,42 +0,0 @@
-#include "rapidjson/reader.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-struct MyHandler {
- bool Null() { cout << "Null()" << endl; return true; }
- bool Bool(bool b) { cout << "Bool(" << boolalpha << b << ")" << endl; return true; }
- bool Int(int i) { cout << "Int(" << i << ")" << endl; return true; }
- bool Uint(unsigned u) { cout << "Uint(" << u << ")" << endl; return true; }
- bool Int64(int64_t i) { cout << "Int64(" << i << ")" << endl; return true; }
- bool Uint64(uint64_t u) { cout << "Uint64(" << u << ")" << endl; return true; }
- bool Double(double d) { cout << "Double(" << d << ")" << endl; return true; }
- bool RawNumber(const char* str, SizeType length, bool copy) {
- cout << "Number(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool String(const char* str, SizeType length, bool copy) {
- cout << "String(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool StartObject() { cout << "StartObject()" << endl; return true; }
- bool Key(const char* str, SizeType length, bool copy) {
- cout << "Key(" << str << ", " << length << ", " << boolalpha << copy << ")" << endl;
- return true;
- }
- bool EndObject(SizeType memberCount) { cout << "EndObject(" << memberCount << ")" << endl; return true; }
- bool StartArray() { cout << "StartArray()" << endl; return true; }
- bool EndArray(SizeType elementCount) { cout << "EndArray(" << elementCount << ")" << endl; return true; }
-};
-
-int main() {
- const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- MyHandler handler;
- Reader reader;
- StringStream ss(json);
- reader.Parse(ss, handler);
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplewriter/simplewriter.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplewriter/simplewriter.cpp
deleted file mode 100644
index 2f4d83ad29..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/simplewriter/simplewriter.cpp
+++ /dev/null
@@ -1,36 +0,0 @@
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-int main() {
- StringBuffer s;
- Writer<StringBuffer> writer(s);
-
- writer.StartObject(); // Between StartObject()/EndObject(),
- writer.Key("hello"); // output a key,
- writer.String("world"); // follow by a value.
- writer.Key("t");
- writer.Bool(true);
- writer.Key("f");
- writer.Bool(false);
- writer.Key("n");
- writer.Null();
- writer.Key("i");
- writer.Uint(123);
- writer.Key("pi");
- writer.Double(3.1416);
- writer.Key("a");
- writer.StartArray(); // Between StartArray()/EndArray(),
- for (unsigned i = 0; i < 4; i++)
- writer.Uint(i); // all values are elements of the array.
- writer.EndArray();
- writer.EndObject();
-
- // {"hello":"world","t":true,"f":false,"n":null,"i":123,"pi":3.1416,"a":[0,1,2,3]}
- cout << s.GetString() << endl;
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/sortkeys/sortkeys.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/sortkeys/sortkeys.cpp
deleted file mode 100644
index 7ede9fb938..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/sortkeys/sortkeys.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "rapidjson/document.h"
-#include "rapidjson/filewritestream.h"
-#include <rapidjson/prettywriter.h>
-
-#include <algorithm>
-#include <iostream>
-
-using namespace rapidjson;
-using namespace std;
-
-static void printIt(const Value &doc) {
- char writeBuffer[65536];
- FileWriteStream os(stdout, writeBuffer, sizeof(writeBuffer));
- PrettyWriter<FileWriteStream> writer(os);
- doc.Accept(writer);
- cout << endl;
-}
-
-struct NameComparator {
- bool operator()(const Value::Member &lhs, const Value::Member &rhs) const {
- return (strcmp(lhs.name.GetString(), rhs.name.GetString()) < 0);
- }
-};
-
-int main() {
- Document d(kObjectType);
- Document::AllocatorType &allocator = d.GetAllocator();
-
- d.AddMember("zeta", Value().SetBool(false), allocator);
- d.AddMember("gama", Value().SetString("test string", allocator), allocator);
- d.AddMember("delta", Value().SetInt(123), allocator);
- d.AddMember("alpha", Value(kArrayType).Move(), allocator);
-
- printIt(d);
-
-/*
-{
- "zeta": false,
- "gama": "test string",
- "delta": 123,
- "alpha": []
-}
-*/
-
-// C++11 supports std::move() of Value so it always have no problem for std::sort().
-// Some C++03 implementations of std::sort() requires copy constructor which causes compilation error.
-// Needs a sorting function only depends on std::swap() instead.
-#if __cplusplus >= 201103L || (!defined(__GLIBCXX__) && (!defined(_MSC_VER) || _MSC_VER >= 1900))
- std::sort(d.MemberBegin(), d.MemberEnd(), NameComparator());
-
- printIt(d);
-
-/*
-{
- "alpha": [],
- "delta": 123,
- "gama": "test string",
- "zeta": false
-}
-*/
-#endif
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/traverseaspointer.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/traverseaspointer.cpp
deleted file mode 100644
index cf80f7acc6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/traverseaspointer.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-#include "rapidjson/document.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/pointer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-
-void traverse(const Value& v, const Pointer& p) {
- StringBuffer sb;
- p.Stringify(sb);
- std::cout << sb.GetString() << std::endl;
-
- switch (v.GetType()) {
- case kArrayType:
- for (SizeType i = 0; i != v.Size(); ++i)
- traverse(v[i], p.Append(i));
- break;
- case kObjectType:
- for (Value::ConstMemberIterator m = v.MemberBegin(); m != v.MemberEnd(); ++m)
- traverse(m->value, p.Append(m->name.GetString(), m->name.GetStringLength()));
- break;
- default:
- break;
- }
-}
-
-int main(int, char*[]) {
- char readBuffer[65536];
- FileReadStream is(stdin, readBuffer, sizeof(readBuffer));
-
- Document d;
- d.ParseStream(is);
-
- Pointer root;
- traverse(d, root);
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/example/tutorial/tutorial.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/example/tutorial/tutorial.cpp
deleted file mode 100644
index f97b0be86e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/example/tutorial/tutorial.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-// Hello World example
-// This example shows basic usage of DOM-style API.
-
-#include "rapidjson/document.h" // rapidjson's DOM-style API
-#include "rapidjson/prettywriter.h" // for stringify JSON
-#include <cstdio>
-
-using namespace rapidjson;
-using namespace std;
-
-int main(int, char*[]) {
- ////////////////////////////////////////////////////////////////////////////
- // 1. Parse a JSON text string to a document.
-
- const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
- printf("Original JSON:\n %s\n", json);
-
- Document document; // Default template parameter uses UTF8 and MemoryPoolAllocator.
-
-#if 0
- // "normal" parsing, decode strings to new buffers. Can use other input stream via ParseStream().
- if (document.Parse(json).HasParseError())
- return 1;
-#else
- // In-situ parsing, decode strings directly in the source string. Source must be string.
- char buffer[sizeof(json)];
- memcpy(buffer, json, sizeof(json));
- if (document.ParseInsitu(buffer).HasParseError())
- return 1;
-#endif
-
- printf("\nParsing to document succeeded.\n");
-
- ////////////////////////////////////////////////////////////////////////////
- // 2. Access values in document.
-
- printf("\nAccess values in document:\n");
- assert(document.IsObject()); // Document is a JSON value represents the root of DOM. Root can be either an object or array.
-
- assert(document.HasMember("hello"));
- assert(document["hello"].IsString());
- printf("hello = %s\n", document["hello"].GetString());
-
- // Since version 0.2, you can use single lookup to check the existing of member and its value:
- Value::MemberIterator hello = document.FindMember("hello");
- assert(hello != document.MemberEnd());
- assert(hello->value.IsString());
- assert(strcmp("world", hello->value.GetString()) == 0);
- (void)hello;
-
- assert(document["t"].IsBool()); // JSON true/false are bool. Can also uses more specific function IsTrue().
- printf("t = %s\n", document["t"].GetBool() ? "true" : "false");
-
- assert(document["f"].IsBool());
- printf("f = %s\n", document["f"].GetBool() ? "true" : "false");
-
- printf("n = %s\n", document["n"].IsNull() ? "null" : "?");
-
- assert(document["i"].IsNumber()); // Number is a JSON type, but C++ needs more specific type.
- assert(document["i"].IsInt()); // In this case, IsUint()/IsInt64()/IsUint64() also return true.
- printf("i = %d\n", document["i"].GetInt()); // Alternative (int)document["i"]
-
- assert(document["pi"].IsNumber());
- assert(document["pi"].IsDouble());
- printf("pi = %g\n", document["pi"].GetDouble());
-
- {
- const Value& a = document["a"]; // Using a reference for consecutive access is handy and faster.
- assert(a.IsArray());
- for (SizeType i = 0; i < a.Size(); i++) // rapidjson uses SizeType instead of size_t.
- printf("a[%d] = %d\n", i, a[i].GetInt());
-
- int y = a[0].GetInt();
- (void)y;
-
- // Iterating array with iterators
- printf("a = ");
- for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
- printf("%d ", itr->GetInt());
- printf("\n");
- }
-
- // Iterating object members
- static const char* kTypeNames[] = { "Null", "False", "True", "Object", "Array", "String", "Number" };
- for (Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr)
- printf("Type of member %s is %s\n", itr->name.GetString(), kTypeNames[itr->value.GetType()]);
-
- ////////////////////////////////////////////////////////////////////////////
- // 3. Modify values in document.
-
- // Change i to a bigger number
- {
- uint64_t f20 = 1; // compute factorial of 20
- for (uint64_t j = 1; j <= 20; j++)
- f20 *= j;
- document["i"] = f20; // Alternate form: document["i"].SetUint64(f20)
- assert(!document["i"].IsInt()); // No longer can be cast as int or uint.
- }
-
- // Adding values to array.
- {
- Value& a = document["a"]; // This time we uses non-const reference.
- Document::AllocatorType& allocator = document.GetAllocator();
- for (int i = 5; i <= 10; i++)
- a.PushBack(i, allocator); // May look a bit strange, allocator is needed for potentially realloc. We normally uses the document's.
-
- // Fluent API
- a.PushBack("Lua", allocator).PushBack("Mio", allocator);
- }
-
- // Making string values.
-
- // This version of SetString() just store the pointer to the string.
- // So it is for literal and string that exists within value's life-cycle.
- {
- document["hello"] = "rapidjson"; // This will invoke strlen()
- // Faster version:
- // document["hello"].SetString("rapidjson", 9);
- }
-
- // This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.
- Value author;
- {
- char buffer2[10];
- int len = sprintf(buffer2, "%s %s", "Milo", "Yip"); // synthetic example of dynamically created string.
-
- author.SetString(buffer2, static_cast<SizeType>(len), document.GetAllocator());
- // Shorter but slower version:
- // document["hello"].SetString(buffer, document.GetAllocator());
-
- // Constructor version:
- // Value author(buffer, len, document.GetAllocator());
- // Value author(buffer, document.GetAllocator());
- memset(buffer2, 0, sizeof(buffer2)); // For demonstration purpose.
- }
- // Variable 'buffer' is unusable now but 'author' has already made a copy.
- document.AddMember("author", author, document.GetAllocator());
-
- assert(author.IsNull()); // Move semantic for assignment. After this variable is assigned as a member, the variable becomes null.
-
- ////////////////////////////////////////////////////////////////////////////
- // 4. Stringify JSON
-
- printf("\nModified JSON with reformatting:\n");
- StringBuffer sb;
- PrettyWriter<StringBuffer> writer(sb);
- document.Accept(writer); // Accept() traverses the DOM and generates Handler events.
- puts(sb.GetString());
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/allocators.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/allocators.h
deleted file mode 100644
index a943cf1993..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/allocators.h
+++ /dev/null
@@ -1,693 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ALLOCATORS_H_
-#define RAPIDJSON_ALLOCATORS_H_
-
-#include "rapidjson.h"
-#include "internal/meta.h"
-
-#include <memory>
-#include <limits>
-
-#if RAPIDJSON_HAS_CXX11
-#include <type_traits>
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// Allocator
-
-/*! \class rapidjson::Allocator
- \brief Concept for allocating, resizing and freeing memory block.
-
- Note that Malloc() and Realloc() are non-static but Free() is static.
-
- So if an allocator need to support Free(), it needs to put its pointer in
- the header of memory block.
-
-\code
-concept Allocator {
- static const bool kNeedFree; //!< Whether this allocator needs to call Free().
-
- // Allocate a memory block.
- // \param size of the memory block in bytes.
- // \returns pointer to the memory block.
- void* Malloc(size_t size);
-
- // Resize a memory block.
- // \param originalPtr The pointer to current memory block. Null pointer is permitted.
- // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)
- // \param newSize the new size in bytes.
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
-
- // Free a memory block.
- // \param pointer to the memory block. Null pointer is permitted.
- static void Free(void *ptr);
-};
-\endcode
-*/
-
-
-/*! \def RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY
- \ingroup RAPIDJSON_CONFIG
- \brief User-defined kDefaultChunkCapacity definition.
-
- User can define this as any \c size that is a power of 2.
-*/
-
-#ifndef RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY
-#define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024)
-#endif
-
-
-///////////////////////////////////////////////////////////////////////////////
-// CrtAllocator
-
-//! C-runtime library allocator.
-/*! This class is just wrapper for standard C library memory routines.
- \note implements Allocator concept
-*/
-class CrtAllocator {
-public:
- static const bool kNeedFree = true;
- void* Malloc(size_t size) {
- if (size) // behavior of malloc(0) is implementation defined.
- return RAPIDJSON_MALLOC(size);
- else
- return NULL; // standardize to returning NULL.
- }
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
- (void)originalSize;
- if (newSize == 0) {
- RAPIDJSON_FREE(originalPtr);
- return NULL;
- }
- return RAPIDJSON_REALLOC(originalPtr, newSize);
- }
- static void Free(void *ptr) RAPIDJSON_NOEXCEPT { RAPIDJSON_FREE(ptr); }
-
- bool operator==(const CrtAllocator&) const RAPIDJSON_NOEXCEPT {
- return true;
- }
- bool operator!=(const CrtAllocator&) const RAPIDJSON_NOEXCEPT {
- return false;
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// MemoryPoolAllocator
-
-//! Default memory allocator used by the parser and DOM.
-/*! This allocator allocate memory blocks from pre-allocated memory chunks.
-
- It does not free memory blocks. And Realloc() only allocate new memory.
-
- The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default.
-
- User may also supply a buffer as the first chunk.
-
- If the user-buffer is full then additional chunks are allocated by BaseAllocator.
-
- The user-buffer is not deallocated by this allocator.
-
- \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator.
- \note implements Allocator concept
-*/
-template <typename BaseAllocator = CrtAllocator>
-class MemoryPoolAllocator {
- //! Chunk header for perpending to each chunk.
- /*! Chunks are stored as a singly linked list.
- */
- struct ChunkHeader {
- size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself).
- size_t size; //!< Current size of allocated memory in bytes.
- ChunkHeader *next; //!< Next chunk in the linked list.
- };
-
- struct SharedData {
- ChunkHeader *chunkHead; //!< Head of the chunk linked-list. Only the head chunk serves allocation.
- BaseAllocator* ownBaseAllocator; //!< base allocator created by this object.
- size_t refcount;
- bool ownBuffer;
- };
-
- static const size_t SIZEOF_SHARED_DATA = RAPIDJSON_ALIGN(sizeof(SharedData));
- static const size_t SIZEOF_CHUNK_HEADER = RAPIDJSON_ALIGN(sizeof(ChunkHeader));
-
- static inline ChunkHeader *GetChunkHead(SharedData *shared)
- {
- return reinterpret_cast<ChunkHeader*>(reinterpret_cast<uint8_t*>(shared) + SIZEOF_SHARED_DATA);
- }
- static inline uint8_t *GetChunkBuffer(SharedData *shared)
- {
- return reinterpret_cast<uint8_t*>(shared->chunkHead) + SIZEOF_CHUNK_HEADER;
- }
-
- static const size_t kDefaultChunkCapacity = RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity.
-
-public:
- static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator)
- static const bool kRefCounted = true; //!< Tell users that this allocator is reference counted on copy
-
- //! Constructor with chunkSize.
- /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
- \param baseAllocator The allocator for allocating memory chunks.
- */
- explicit
- MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
- chunk_capacity_(chunkSize),
- baseAllocator_(baseAllocator ? baseAllocator : RAPIDJSON_NEW(BaseAllocator)()),
- shared_(static_cast<SharedData*>(baseAllocator_ ? baseAllocator_->Malloc(SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER) : 0))
- {
- RAPIDJSON_ASSERT(baseAllocator_ != 0);
- RAPIDJSON_ASSERT(shared_ != 0);
- if (baseAllocator) {
- shared_->ownBaseAllocator = 0;
- }
- else {
- shared_->ownBaseAllocator = baseAllocator_;
- }
- shared_->chunkHead = GetChunkHead(shared_);
- shared_->chunkHead->capacity = 0;
- shared_->chunkHead->size = 0;
- shared_->chunkHead->next = 0;
- shared_->ownBuffer = true;
- shared_->refcount = 1;
- }
-
- //! Constructor with user-supplied buffer.
- /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size.
-
- The user buffer will not be deallocated when this allocator is destructed.
-
- \param buffer User supplied buffer.
- \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader).
- \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
- \param baseAllocator The allocator for allocating memory chunks.
- */
- MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
- chunk_capacity_(chunkSize),
- baseAllocator_(baseAllocator),
- shared_(static_cast<SharedData*>(AlignBuffer(buffer, size)))
- {
- RAPIDJSON_ASSERT(size >= SIZEOF_SHARED_DATA + SIZEOF_CHUNK_HEADER);
- shared_->chunkHead = GetChunkHead(shared_);
- shared_->chunkHead->capacity = size - SIZEOF_SHARED_DATA - SIZEOF_CHUNK_HEADER;
- shared_->chunkHead->size = 0;
- shared_->chunkHead->next = 0;
- shared_->ownBaseAllocator = 0;
- shared_->ownBuffer = false;
- shared_->refcount = 1;
- }
-
- MemoryPoolAllocator(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT :
- chunk_capacity_(rhs.chunk_capacity_),
- baseAllocator_(rhs.baseAllocator_),
- shared_(rhs.shared_)
- {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- ++shared_->refcount;
- }
- MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) RAPIDJSON_NOEXCEPT
- {
- RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
- ++rhs.shared_->refcount;
- this->~MemoryPoolAllocator();
- baseAllocator_ = rhs.baseAllocator_;
- chunk_capacity_ = rhs.chunk_capacity_;
- shared_ = rhs.shared_;
- return *this;
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- MemoryPoolAllocator(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT :
- chunk_capacity_(rhs.chunk_capacity_),
- baseAllocator_(rhs.baseAllocator_),
- shared_(rhs.shared_)
- {
- RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
- rhs.shared_ = 0;
- }
- MemoryPoolAllocator& operator=(MemoryPoolAllocator&& rhs) RAPIDJSON_NOEXCEPT
- {
- RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
- this->~MemoryPoolAllocator();
- baseAllocator_ = rhs.baseAllocator_;
- chunk_capacity_ = rhs.chunk_capacity_;
- shared_ = rhs.shared_;
- rhs.shared_ = 0;
- return *this;
- }
-#endif
-
- //! Destructor.
- /*! This deallocates all memory chunks, excluding the user-supplied buffer.
- */
- ~MemoryPoolAllocator() RAPIDJSON_NOEXCEPT {
- if (!shared_) {
- // do nothing if moved
- return;
- }
- if (shared_->refcount > 1) {
- --shared_->refcount;
- return;
- }
- Clear();
- BaseAllocator *a = shared_->ownBaseAllocator;
- if (shared_->ownBuffer) {
- baseAllocator_->Free(shared_);
- }
- RAPIDJSON_DELETE(a);
- }
-
- //! Deallocates all memory chunks, excluding the first/user one.
- void Clear() RAPIDJSON_NOEXCEPT {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- for (;;) {
- ChunkHeader* c = shared_->chunkHead;
- if (!c->next) {
- break;
- }
- shared_->chunkHead = c->next;
- baseAllocator_->Free(c);
- }
- shared_->chunkHead->size = 0;
- }
-
- //! Computes the total capacity of allocated memory chunks.
- /*! \return total capacity in bytes.
- */
- size_t Capacity() const RAPIDJSON_NOEXCEPT {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- size_t capacity = 0;
- for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next)
- capacity += c->capacity;
- return capacity;
- }
-
- //! Computes the memory blocks allocated.
- /*! \return total used bytes.
- */
- size_t Size() const RAPIDJSON_NOEXCEPT {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- size_t size = 0;
- for (ChunkHeader* c = shared_->chunkHead; c != 0; c = c->next)
- size += c->size;
- return size;
- }
-
- //! Whether the allocator is shared.
- /*! \return true or false.
- */
- bool Shared() const RAPIDJSON_NOEXCEPT {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- return shared_->refcount > 1;
- }
-
- //! Allocates a memory block. (concept Allocator)
- void* Malloc(size_t size) {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- if (!size)
- return NULL;
-
- size = RAPIDJSON_ALIGN(size);
- if (RAPIDJSON_UNLIKELY(shared_->chunkHead->size + size > shared_->chunkHead->capacity))
- if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size))
- return NULL;
-
- void *buffer = GetChunkBuffer(shared_) + shared_->chunkHead->size;
- shared_->chunkHead->size += size;
- return buffer;
- }
-
- //! Resizes a memory block (concept Allocator)
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
- if (originalPtr == 0)
- return Malloc(newSize);
-
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- if (newSize == 0)
- return NULL;
-
- originalSize = RAPIDJSON_ALIGN(originalSize);
- newSize = RAPIDJSON_ALIGN(newSize);
-
- // Do not shrink if new size is smaller than original
- if (originalSize >= newSize)
- return originalPtr;
-
- // Simply expand it if it is the last allocation and there is sufficient space
- if (originalPtr == GetChunkBuffer(shared_) + shared_->chunkHead->size - originalSize) {
- size_t increment = static_cast<size_t>(newSize - originalSize);
- if (shared_->chunkHead->size + increment <= shared_->chunkHead->capacity) {
- shared_->chunkHead->size += increment;
- return originalPtr;
- }
- }
-
- // Realloc process: allocate and copy memory, do not free original buffer.
- if (void* newBuffer = Malloc(newSize)) {
- if (originalSize)
- std::memcpy(newBuffer, originalPtr, originalSize);
- return newBuffer;
- }
- else
- return NULL;
- }
-
- //! Frees a memory block (concept Allocator)
- static void Free(void *ptr) RAPIDJSON_NOEXCEPT { (void)ptr; } // Do nothing
-
- //! Compare (equality) with another MemoryPoolAllocator
- bool operator==(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT {
- RAPIDJSON_NOEXCEPT_ASSERT(shared_->refcount > 0);
- RAPIDJSON_NOEXCEPT_ASSERT(rhs.shared_->refcount > 0);
- return shared_ == rhs.shared_;
- }
- //! Compare (inequality) with another MemoryPoolAllocator
- bool operator!=(const MemoryPoolAllocator& rhs) const RAPIDJSON_NOEXCEPT {
- return !operator==(rhs);
- }
-
-private:
- //! Creates a new chunk.
- /*! \param capacity Capacity of the chunk in bytes.
- \return true if success.
- */
- bool AddChunk(size_t capacity) {
- if (!baseAllocator_)
- shared_->ownBaseAllocator = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)();
- if (ChunkHeader* chunk = static_cast<ChunkHeader*>(baseAllocator_->Malloc(SIZEOF_CHUNK_HEADER + capacity))) {
- chunk->capacity = capacity;
- chunk->size = 0;
- chunk->next = shared_->chunkHead;
- shared_->chunkHead = chunk;
- return true;
- }
- else
- return false;
- }
-
- static inline void* AlignBuffer(void* buf, size_t &size)
- {
- RAPIDJSON_NOEXCEPT_ASSERT(buf != 0);
- const uintptr_t mask = sizeof(void*) - 1;
- const uintptr_t ubuf = reinterpret_cast<uintptr_t>(buf);
- if (RAPIDJSON_UNLIKELY(ubuf & mask)) {
- const uintptr_t abuf = (ubuf + mask) & ~mask;
- RAPIDJSON_ASSERT(size >= abuf - ubuf);
- buf = reinterpret_cast<void*>(abuf);
- size -= abuf - ubuf;
- }
- return buf;
- }
-
- size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated.
- BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks.
- SharedData *shared_; //!< The shared data of the allocator
-};
-
-namespace internal {
- template<typename, typename = void>
- struct IsRefCounted :
- public FalseType
- { };
- template<typename T>
- struct IsRefCounted<T, typename internal::EnableIfCond<T::kRefCounted>::Type> :
- public TrueType
- { };
-}
-
-template<typename T, typename A>
-inline T* Realloc(A& a, T* old_p, size_t old_n, size_t new_n)
-{
- RAPIDJSON_NOEXCEPT_ASSERT(old_n <= (std::numeric_limits<size_t>::max)() / sizeof(T) && new_n <= (std::numeric_limits<size_t>::max)() / sizeof(T));
- return static_cast<T*>(a.Realloc(old_p, old_n * sizeof(T), new_n * sizeof(T)));
-}
-
-template<typename T, typename A>
-inline T *Malloc(A& a, size_t n = 1)
-{
- return Realloc<T, A>(a, NULL, 0, n);
-}
-
-template<typename T, typename A>
-inline void Free(A& a, T *p, size_t n = 1)
-{
- static_cast<void>(Realloc<T, A>(a, p, n, 0));
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++) // std::allocator can safely be inherited
-#endif
-
-template <typename T, typename BaseAllocator = CrtAllocator>
-class StdAllocator :
- public std::allocator<T>
-{
- typedef std::allocator<T> allocator_type;
-#if RAPIDJSON_HAS_CXX11
- typedef std::allocator_traits<allocator_type> traits_type;
-#else
- typedef allocator_type traits_type;
-#endif
-
-public:
- typedef BaseAllocator BaseAllocatorType;
-
- StdAllocator() RAPIDJSON_NOEXCEPT :
- allocator_type(),
- baseAllocator_()
- { }
-
- StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT :
- allocator_type(rhs),
- baseAllocator_(rhs.baseAllocator_)
- { }
-
- template<typename U>
- StdAllocator(const StdAllocator<U, BaseAllocator>& rhs) RAPIDJSON_NOEXCEPT :
- allocator_type(rhs),
- baseAllocator_(rhs.baseAllocator_)
- { }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- StdAllocator(StdAllocator&& rhs) RAPIDJSON_NOEXCEPT :
- allocator_type(std::move(rhs)),
- baseAllocator_(std::move(rhs.baseAllocator_))
- { }
-#endif
-#if RAPIDJSON_HAS_CXX11
- using propagate_on_container_move_assignment = std::true_type;
- using propagate_on_container_swap = std::true_type;
-#endif
-
- /* implicit */
- StdAllocator(const BaseAllocator& allocator) RAPIDJSON_NOEXCEPT :
- allocator_type(),
- baseAllocator_(allocator)
- { }
-
- ~StdAllocator() RAPIDJSON_NOEXCEPT
- { }
-
- template<typename U>
- struct rebind {
- typedef StdAllocator<U, BaseAllocator> other;
- };
-
- typedef typename traits_type::size_type size_type;
- typedef typename traits_type::difference_type difference_type;
-
- typedef typename traits_type::value_type value_type;
- typedef typename traits_type::pointer pointer;
- typedef typename traits_type::const_pointer const_pointer;
-
-#if RAPIDJSON_HAS_CXX11
-
- typedef typename std::add_lvalue_reference<value_type>::type &reference;
- typedef typename std::add_lvalue_reference<typename std::add_const<value_type>::type>::type &const_reference;
-
- pointer address(reference r) const RAPIDJSON_NOEXCEPT
- {
- return std::addressof(r);
- }
- const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT
- {
- return std::addressof(r);
- }
-
- size_type max_size() const RAPIDJSON_NOEXCEPT
- {
- return traits_type::max_size(*this);
- }
-
- template <typename ...Args>
- void construct(pointer p, Args&&... args)
- {
- traits_type::construct(*this, p, std::forward<Args>(args)...);
- }
- void destroy(pointer p)
- {
- traits_type::destroy(*this, p);
- }
-
-#else // !RAPIDJSON_HAS_CXX11
-
- typedef typename allocator_type::reference reference;
- typedef typename allocator_type::const_reference const_reference;
-
- pointer address(reference r) const RAPIDJSON_NOEXCEPT
- {
- return allocator_type::address(r);
- }
- const_pointer address(const_reference r) const RAPIDJSON_NOEXCEPT
- {
- return allocator_type::address(r);
- }
-
- size_type max_size() const RAPIDJSON_NOEXCEPT
- {
- return allocator_type::max_size();
- }
-
- void construct(pointer p, const_reference r)
- {
- allocator_type::construct(p, r);
- }
- void destroy(pointer p)
- {
- allocator_type::destroy(p);
- }
-
-#endif // !RAPIDJSON_HAS_CXX11
-
- template <typename U>
- U* allocate(size_type n = 1, const void* = 0)
- {
- return RAPIDJSON_NAMESPACE::Malloc<U>(baseAllocator_, n);
- }
- template <typename U>
- void deallocate(U* p, size_type n = 1)
- {
- RAPIDJSON_NAMESPACE::Free<U>(baseAllocator_, p, n);
- }
-
- pointer allocate(size_type n = 1, const void* = 0)
- {
- return allocate<value_type>(n);
- }
- void deallocate(pointer p, size_type n = 1)
- {
- deallocate<value_type>(p, n);
- }
-
-#if RAPIDJSON_HAS_CXX11
- using is_always_equal = std::is_empty<BaseAllocator>;
-#endif
-
- template<typename U>
- bool operator==(const StdAllocator<U, BaseAllocator>& rhs) const RAPIDJSON_NOEXCEPT
- {
- return baseAllocator_ == rhs.baseAllocator_;
- }
- template<typename U>
- bool operator!=(const StdAllocator<U, BaseAllocator>& rhs) const RAPIDJSON_NOEXCEPT
- {
- return !operator==(rhs);
- }
-
- //! rapidjson Allocator concept
- static const bool kNeedFree = BaseAllocator::kNeedFree;
- static const bool kRefCounted = internal::IsRefCounted<BaseAllocator>::Value;
- void* Malloc(size_t size)
- {
- return baseAllocator_.Malloc(size);
- }
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize)
- {
- return baseAllocator_.Realloc(originalPtr, originalSize, newSize);
- }
- static void Free(void *ptr) RAPIDJSON_NOEXCEPT
- {
- BaseAllocator::Free(ptr);
- }
-
-private:
- template <typename, typename>
- friend class StdAllocator; // access to StdAllocator<!T>.*
-
- BaseAllocator baseAllocator_;
-};
-
-#if !RAPIDJSON_HAS_CXX17 // std::allocator<void> deprecated in C++17
-template <typename BaseAllocator>
-class StdAllocator<void, BaseAllocator> :
- public std::allocator<void>
-{
- typedef std::allocator<void> allocator_type;
-
-public:
- typedef BaseAllocator BaseAllocatorType;
-
- StdAllocator() RAPIDJSON_NOEXCEPT :
- allocator_type(),
- baseAllocator_()
- { }
-
- StdAllocator(const StdAllocator& rhs) RAPIDJSON_NOEXCEPT :
- allocator_type(rhs),
- baseAllocator_(rhs.baseAllocator_)
- { }
-
- template<typename U>
- StdAllocator(const StdAllocator<U, BaseAllocator>& rhs) RAPIDJSON_NOEXCEPT :
- allocator_type(rhs),
- baseAllocator_(rhs.baseAllocator_)
- { }
-
- /* implicit */
- StdAllocator(const BaseAllocator& baseAllocator) RAPIDJSON_NOEXCEPT :
- allocator_type(),
- baseAllocator_(baseAllocator)
- { }
-
- ~StdAllocator() RAPIDJSON_NOEXCEPT
- { }
-
- template<typename U>
- struct rebind {
- typedef StdAllocator<U, BaseAllocator> other;
- };
-
- typedef typename allocator_type::value_type value_type;
-
-private:
- template <typename, typename>
- friend class StdAllocator; // access to StdAllocator<!T>.*
-
- BaseAllocator baseAllocator_;
-};
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_ENCODINGS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/cursorstreamwrapper.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/cursorstreamwrapper.h
deleted file mode 100644
index fd6513db14..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/cursorstreamwrapper.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_
-#define RAPIDJSON_CURSORSTREAMWRAPPER_H_
-
-#include "stream.h"
-
-#if defined(__GNUC__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#if defined(_MSC_VER) && _MSC_VER <= 1800
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4702) // unreachable code
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-
-//! Cursor stream wrapper for counting line and column number if error exists.
-/*!
- \tparam InputStream Any stream that implements Stream Concept
-*/
-template <typename InputStream, typename Encoding = UTF8<> >
-class CursorStreamWrapper : public GenericStreamWrapper<InputStream, Encoding> {
-public:
- typedef typename Encoding::Ch Ch;
-
- CursorStreamWrapper(InputStream& is):
- GenericStreamWrapper<InputStream, Encoding>(is), line_(1), col_(0) {}
-
- // counting line and column number
- Ch Take() {
- Ch ch = this->is_.Take();
- if(ch == '\n') {
- line_ ++;
- col_ = 0;
- } else {
- col_ ++;
- }
- return ch;
- }
-
- //! Get the error line number, if error exists.
- size_t GetLine() const { return line_; }
- //! Get the error column number, if error exists.
- size_t GetColumn() const { return col_; }
-
-private:
- size_t line_; //!< Current Line
- size_t col_; //!< Current Column
-};
-
-#if defined(_MSC_VER) && _MSC_VER <= 1800
-RAPIDJSON_DIAG_POP
-#endif
-
-#if defined(__GNUC__)
-RAPIDJSON_DIAG_POP
-#endif
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/document.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/document.h
deleted file mode 100644
index d1420719bb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/document.h
+++ /dev/null
@@ -1,3043 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_DOCUMENT_H_
-#define RAPIDJSON_DOCUMENT_H_
-
-/*! \file document.h */
-
-#include "reader.h"
-#include "internal/meta.h"
-#include "internal/strfunc.h"
-#include "memorystream.h"
-#include "encodedstream.h"
-#include <new> // placement new
-#include <limits>
-#ifdef __cpp_lib_three_way_comparison
-#include <compare>
-#endif
-
-RAPIDJSON_DIAG_PUSH
-#ifdef __clang__
-RAPIDJSON_DIAG_OFF(padded)
-RAPIDJSON_DIAG_OFF(switch-enum)
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
-RAPIDJSON_DIAG_OFF(4244) // conversion from kXxxFlags to 'uint16_t', possible loss of data
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_OFF(effc++)
-#endif // __GNUC__
-
-#ifdef GetObject
-// see https://github.com/Tencent/rapidjson/issues/1448
-// a former included windows.h might have defined a macro called GetObject, which affects
-// GetObject defined here. This ensures the macro does not get applied
-#pragma push_macro("GetObject")
-#define RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED
-#undef GetObject
-#endif
-
-#ifndef RAPIDJSON_NOMEMBERITERATORCLASS
-#include <iterator> // std::random_access_iterator_tag
-#endif
-
-#if RAPIDJSON_USE_MEMBERSMAP
-#include <map> // std::multimap
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-// Forward declaration.
-template <typename Encoding, typename Allocator>
-class GenericValue;
-
-template <typename Encoding, typename Allocator, typename StackAllocator>
-class GenericDocument;
-
-/*! \def RAPIDJSON_DEFAULT_ALLOCATOR
- \ingroup RAPIDJSON_CONFIG
- \brief Allows to choose default allocator.
-
- User can define this to use CrtAllocator or MemoryPoolAllocator.
-*/
-#ifndef RAPIDJSON_DEFAULT_ALLOCATOR
-#define RAPIDJSON_DEFAULT_ALLOCATOR ::RAPIDJSON_NAMESPACE::MemoryPoolAllocator<::RAPIDJSON_NAMESPACE::CrtAllocator>
-#endif
-
-/*! \def RAPIDJSON_DEFAULT_STACK_ALLOCATOR
- \ingroup RAPIDJSON_CONFIG
- \brief Allows to choose default stack allocator for Document.
-
- User can define this to use CrtAllocator or MemoryPoolAllocator.
-*/
-#ifndef RAPIDJSON_DEFAULT_STACK_ALLOCATOR
-#define RAPIDJSON_DEFAULT_STACK_ALLOCATOR ::RAPIDJSON_NAMESPACE::CrtAllocator
-#endif
-
-/*! \def RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY
- \ingroup RAPIDJSON_CONFIG
- \brief User defined kDefaultObjectCapacity value.
-
- User can define this as any natural number.
-*/
-#ifndef RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY
-// number of objects that rapidjson::Value allocates memory for by default
-#define RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY 16
-#endif
-
-/*! \def RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY
- \ingroup RAPIDJSON_CONFIG
- \brief User defined kDefaultArrayCapacity value.
-
- User can define this as any natural number.
-*/
-#ifndef RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY
-// number of array elements that rapidjson::Value allocates memory for by default
-#define RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY 16
-#endif
-
-//! Name-value pair in a JSON object value.
-/*!
- This class was internal to GenericValue. It used to be a inner struct.
- But a compiler (IBM XL C/C++ for AIX) have reported to have problem with that so it moved as a namespace scope struct.
- https://code.google.com/p/rapidjson/issues/detail?id=64
-*/
-template <typename Encoding, typename Allocator>
-class GenericMember {
-public:
- GenericValue<Encoding, Allocator> name; //!< name of member (must be a string)
- GenericValue<Encoding, Allocator> value; //!< value of member.
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move constructor in C++11
- GenericMember(GenericMember&& rhs) RAPIDJSON_NOEXCEPT
- : name(std::move(rhs.name)),
- value(std::move(rhs.value))
- {
- }
-
- //! Move assignment in C++11
- GenericMember& operator=(GenericMember&& rhs) RAPIDJSON_NOEXCEPT {
- return *this = static_cast<GenericMember&>(rhs);
- }
-#endif
-
- //! Assignment with move semantics.
- /*! \param rhs Source of the assignment. Its name and value will become a null value after assignment.
- */
- GenericMember& operator=(GenericMember& rhs) RAPIDJSON_NOEXCEPT {
- if (RAPIDJSON_LIKELY(this != &rhs)) {
- name = rhs.name;
- value = rhs.value;
- }
- return *this;
- }
-
- // swap() for std::sort() and other potential use in STL.
- friend inline void swap(GenericMember& a, GenericMember& b) RAPIDJSON_NOEXCEPT {
- a.name.Swap(b.name);
- a.value.Swap(b.value);
- }
-
-private:
- //! Copy constructor is not permitted.
- GenericMember(const GenericMember& rhs);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericMemberIterator
-
-#ifndef RAPIDJSON_NOMEMBERITERATORCLASS
-
-//! (Constant) member iterator for a JSON object value
-/*!
- \tparam Const Is this a constant iterator?
- \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document)
- \tparam Allocator Allocator type for allocating memory of object, array and string.
-
- This class implements a Random Access Iterator for GenericMember elements
- of a GenericValue, see ISO/IEC 14882:2003(E) C++ standard, 24.1 [lib.iterator.requirements].
-
- \note This iterator implementation is mainly intended to avoid implicit
- conversions from iterator values to \c NULL,
- e.g. from GenericValue::FindMember.
-
- \note Define \c RAPIDJSON_NOMEMBERITERATORCLASS to fall back to a
- pointer-based implementation, if your platform doesn't provide
- the C++ <iterator> header.
-
- \see GenericMember, GenericValue::MemberIterator, GenericValue::ConstMemberIterator
- */
-template <bool Const, typename Encoding, typename Allocator>
-class GenericMemberIterator {
-
- friend class GenericValue<Encoding,Allocator>;
- template <bool, typename, typename> friend class GenericMemberIterator;
-
- typedef GenericMember<Encoding,Allocator> PlainType;
- typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
-
-public:
- //! Iterator type itself
- typedef GenericMemberIterator Iterator;
- //! Constant iterator type
- typedef GenericMemberIterator<true,Encoding,Allocator> ConstIterator;
- //! Non-constant iterator type
- typedef GenericMemberIterator<false,Encoding,Allocator> NonConstIterator;
-
- /** \name std::iterator_traits support */
- //@{
- typedef ValueType value_type;
- typedef ValueType * pointer;
- typedef ValueType & reference;
- typedef std::ptrdiff_t difference_type;
- typedef std::random_access_iterator_tag iterator_category;
- //@}
-
- //! Pointer to (const) GenericMember
- typedef pointer Pointer;
- //! Reference to (const) GenericMember
- typedef reference Reference;
- //! Signed integer type (e.g. \c ptrdiff_t)
- typedef difference_type DifferenceType;
-
- //! Default constructor (singular value)
- /*! Creates an iterator pointing to no element.
- \note All operations, except for comparisons, are undefined on such values.
- */
- GenericMemberIterator() : ptr_() {}
-
- //! Iterator conversions to more const
- /*!
- \param it (Non-const) iterator to copy from
-
- Allows the creation of an iterator from another GenericMemberIterator
- that is "less const". Especially, creating a non-constant iterator
- from a constant iterator are disabled:
- \li const -> non-const (not ok)
- \li const -> const (ok)
- \li non-const -> const (ok)
- \li non-const -> non-const (ok)
-
- \note If the \c Const template parameter is already \c false, this
- constructor effectively defines a regular copy-constructor.
- Otherwise, the copy constructor is implicitly defined.
- */
- GenericMemberIterator(const NonConstIterator & it) : ptr_(it.ptr_) {}
- Iterator& operator=(const NonConstIterator & it) { ptr_ = it.ptr_; return *this; }
-
- //! @name stepping
- //@{
- Iterator& operator++(){ ++ptr_; return *this; }
- Iterator& operator--(){ --ptr_; return *this; }
- Iterator operator++(int){ Iterator old(*this); ++ptr_; return old; }
- Iterator operator--(int){ Iterator old(*this); --ptr_; return old; }
- //@}
-
- //! @name increment/decrement
- //@{
- Iterator operator+(DifferenceType n) const { return Iterator(ptr_+n); }
- Iterator operator-(DifferenceType n) const { return Iterator(ptr_-n); }
-
- Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; }
- Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; }
- //@}
-
- //! @name relations
- //@{
- template <bool Const_> bool operator==(const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ == that.ptr_; }
- template <bool Const_> bool operator!=(const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ != that.ptr_; }
- template <bool Const_> bool operator<=(const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ <= that.ptr_; }
- template <bool Const_> bool operator>=(const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ >= that.ptr_; }
- template <bool Const_> bool operator< (const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ < that.ptr_; }
- template <bool Const_> bool operator> (const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ > that.ptr_; }
-
-#ifdef __cpp_lib_three_way_comparison
- template <bool Const_> std::strong_ordering operator<=>(const GenericMemberIterator<Const_, Encoding, Allocator>& that) const { return ptr_ <=> that.ptr_; }
-#endif
- //@}
-
- //! @name dereference
- //@{
- Reference operator*() const { return *ptr_; }
- Pointer operator->() const { return ptr_; }
- Reference operator[](DifferenceType n) const { return ptr_[n]; }
- //@}
-
- //! Distance
- DifferenceType operator-(ConstIterator that) const { return ptr_-that.ptr_; }
-
-private:
- //! Internal constructor from plain pointer
- explicit GenericMemberIterator(Pointer p) : ptr_(p) {}
-
- Pointer ptr_; //!< raw pointer
-};
-
-#else // RAPIDJSON_NOMEMBERITERATORCLASS
-
-// class-based member iterator implementation disabled, use plain pointers
-
-template <bool Const, typename Encoding, typename Allocator>
-class GenericMemberIterator;
-
-//! non-const GenericMemberIterator
-template <typename Encoding, typename Allocator>
-class GenericMemberIterator<false,Encoding,Allocator> {
-public:
- //! use plain pointer as iterator type
- typedef GenericMember<Encoding,Allocator>* Iterator;
-};
-//! const GenericMemberIterator
-template <typename Encoding, typename Allocator>
-class GenericMemberIterator<true,Encoding,Allocator> {
-public:
- //! use plain const pointer as iterator type
- typedef const GenericMember<Encoding,Allocator>* Iterator;
-};
-
-#endif // RAPIDJSON_NOMEMBERITERATORCLASS
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericStringRef
-
-//! Reference to a constant string (not taking a copy)
-/*!
- \tparam CharType character type of the string
-
- This helper class is used to automatically infer constant string
- references for string literals, especially from \c const \b (!)
- character arrays.
-
- The main use is for creating JSON string values without copying the
- source string via an \ref Allocator. This requires that the referenced
- string pointers have a sufficient lifetime, which exceeds the lifetime
- of the associated GenericValue.
-
- \b Example
- \code
- Value v("foo"); // ok, no need to copy & calculate length
- const char foo[] = "foo";
- v.SetString(foo); // ok
-
- const char* bar = foo;
- // Value x(bar); // not ok, can't rely on bar's lifetime
- Value x(StringRef(bar)); // lifetime explicitly guaranteed by user
- Value y(StringRef(bar, 3)); // ok, explicitly pass length
- \endcode
-
- \see StringRef, GenericValue::SetString
-*/
-template<typename CharType>
-struct GenericStringRef {
- typedef CharType Ch; //!< character type of the string
-
- //! Create string reference from \c const character array
-#ifndef __clang__ // -Wdocumentation
- /*!
- This constructor implicitly creates a constant string reference from
- a \c const character array. It has better performance than
- \ref StringRef(const CharType*) by inferring the string \ref length
- from the array length, and also supports strings containing null
- characters.
-
- \tparam N length of the string, automatically inferred
-
- \param str Constant character array, lifetime assumed to be longer
- than the use of the string in e.g. a GenericValue
-
- \post \ref s == str
-
- \note Constant complexity.
- \note There is a hidden, private overload to disallow references to
- non-const character arrays to be created via this constructor.
- By this, e.g. function-scope arrays used to be filled via
- \c snprintf are excluded from consideration.
- In such cases, the referenced string should be \b copied to the
- GenericValue instead.
- */
-#endif
- template<SizeType N>
- GenericStringRef(const CharType (&str)[N]) RAPIDJSON_NOEXCEPT
- : s(str), length(N-1) {}
-
- //! Explicitly create string reference from \c const character pointer
-#ifndef __clang__ // -Wdocumentation
- /*!
- This constructor can be used to \b explicitly create a reference to
- a constant string pointer.
-
- \see StringRef(const CharType*)
-
- \param str Constant character pointer, lifetime assumed to be longer
- than the use of the string in e.g. a GenericValue
-
- \post \ref s == str
-
- \note There is a hidden, private overload to disallow references to
- non-const character arrays to be created via this constructor.
- By this, e.g. function-scope arrays used to be filled via
- \c snprintf are excluded from consideration.
- In such cases, the referenced string should be \b copied to the
- GenericValue instead.
- */
-#endif
- explicit GenericStringRef(const CharType* str)
- : s(str), length(NotNullStrLen(str)) {}
-
- //! Create constant string reference from pointer and length
-#ifndef __clang__ // -Wdocumentation
- /*! \param str constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
- \param len length of the string, excluding the trailing NULL terminator
-
- \post \ref s == str && \ref length == len
- \note Constant complexity.
- */
-#endif
- GenericStringRef(const CharType* str, SizeType len)
- : s(RAPIDJSON_LIKELY(str) ? str : emptyString), length(len) { RAPIDJSON_ASSERT(str != 0 || len == 0u); }
-
- GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {}
-
- //! implicit conversion to plain CharType pointer
- operator const Ch *() const { return s; }
-
- const Ch* const s; //!< plain CharType pointer
- const SizeType length; //!< length of the string (excluding the trailing NULL terminator)
-
-private:
- SizeType NotNullStrLen(const CharType* str) {
- RAPIDJSON_ASSERT(str != 0);
- return internal::StrLen(str);
- }
-
- /// Empty string - used when passing in a NULL pointer
- static const Ch emptyString[];
-
- //! Disallow construction from non-const array
- template<SizeType N>
- GenericStringRef(CharType (&str)[N]) /* = delete */;
- //! Copy assignment operator not permitted - immutable type
- GenericStringRef& operator=(const GenericStringRef& rhs) /* = delete */;
-};
-
-template<typename CharType>
-const CharType GenericStringRef<CharType>::emptyString[] = { CharType() };
-
-//! Mark a character pointer as constant string
-/*! Mark a plain character pointer as a "string literal". This function
- can be used to avoid copying a character string to be referenced as a
- value in a JSON GenericValue object, if the string's lifetime is known
- to be valid long enough.
- \tparam CharType Character type of the string
- \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
- \return GenericStringRef string reference object
- \relatesalso GenericStringRef
-
- \see GenericValue::GenericValue(StringRefType), GenericValue::operator=(StringRefType), GenericValue::SetString(StringRefType), GenericValue::PushBack(StringRefType, Allocator&), GenericValue::AddMember
-*/
-template<typename CharType>
-inline GenericStringRef<CharType> StringRef(const CharType* str) {
- return GenericStringRef<CharType>(str);
-}
-
-//! Mark a character pointer as constant string
-/*! Mark a plain character pointer as a "string literal". This function
- can be used to avoid copying a character string to be referenced as a
- value in a JSON GenericValue object, if the string's lifetime is known
- to be valid long enough.
-
- This version has better performance with supplied length, and also
- supports string containing null characters.
-
- \tparam CharType character type of the string
- \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
- \param length The length of source string.
- \return GenericStringRef string reference object
- \relatesalso GenericStringRef
-*/
-template<typename CharType>
-inline GenericStringRef<CharType> StringRef(const CharType* str, size_t length) {
- return GenericStringRef<CharType>(str, SizeType(length));
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-//! Mark a string object as constant string
-/*! Mark a string object (e.g. \c std::string) as a "string literal".
- This function can be used to avoid copying a string to be referenced as a
- value in a JSON GenericValue object, if the string's lifetime is known
- to be valid long enough.
-
- \tparam CharType character type of the string
- \param str Constant string, lifetime assumed to be longer than the use of the string in e.g. a GenericValue
- \return GenericStringRef string reference object
- \relatesalso GenericStringRef
- \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
-*/
-template<typename CharType>
-inline GenericStringRef<CharType> StringRef(const std::basic_string<CharType>& str) {
- return GenericStringRef<CharType>(str.data(), SizeType(str.size()));
-}
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericValue type traits
-namespace internal {
-
-template <typename T, typename Encoding = void, typename Allocator = void>
-struct IsGenericValueImpl : FalseType {};
-
-// select candidates according to nested encoding and allocator types
-template <typename T> struct IsGenericValueImpl<T, typename Void<typename T::EncodingType>::Type, typename Void<typename T::AllocatorType>::Type>
- : IsBaseOf<GenericValue<typename T::EncodingType, typename T::AllocatorType>, T>::Type {};
-
-// helper to match arbitrary GenericValue instantiations, including derived classes
-template <typename T> struct IsGenericValue : IsGenericValueImpl<T>::Type {};
-
-} // namespace internal
-
-///////////////////////////////////////////////////////////////////////////////
-// TypeHelper
-
-namespace internal {
-
-template <typename ValueType, typename T>
-struct TypeHelper {};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, bool> {
- static bool Is(const ValueType& v) { return v.IsBool(); }
- static bool Get(const ValueType& v) { return v.GetBool(); }
- static ValueType& Set(ValueType& v, bool data) { return v.SetBool(data); }
- static ValueType& Set(ValueType& v, bool data, typename ValueType::AllocatorType&) { return v.SetBool(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, int> {
- static bool Is(const ValueType& v) { return v.IsInt(); }
- static int Get(const ValueType& v) { return v.GetInt(); }
- static ValueType& Set(ValueType& v, int data) { return v.SetInt(data); }
- static ValueType& Set(ValueType& v, int data, typename ValueType::AllocatorType&) { return v.SetInt(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, unsigned> {
- static bool Is(const ValueType& v) { return v.IsUint(); }
- static unsigned Get(const ValueType& v) { return v.GetUint(); }
- static ValueType& Set(ValueType& v, unsigned data) { return v.SetUint(data); }
- static ValueType& Set(ValueType& v, unsigned data, typename ValueType::AllocatorType&) { return v.SetUint(data); }
-};
-
-#ifdef _MSC_VER
-RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int));
-template<typename ValueType>
-struct TypeHelper<ValueType, long> {
- static bool Is(const ValueType& v) { return v.IsInt(); }
- static long Get(const ValueType& v) { return v.GetInt(); }
- static ValueType& Set(ValueType& v, long data) { return v.SetInt(data); }
- static ValueType& Set(ValueType& v, long data, typename ValueType::AllocatorType&) { return v.SetInt(data); }
-};
-
-RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned));
-template<typename ValueType>
-struct TypeHelper<ValueType, unsigned long> {
- static bool Is(const ValueType& v) { return v.IsUint(); }
- static unsigned long Get(const ValueType& v) { return v.GetUint(); }
- static ValueType& Set(ValueType& v, unsigned long data) { return v.SetUint(data); }
- static ValueType& Set(ValueType& v, unsigned long data, typename ValueType::AllocatorType&) { return v.SetUint(data); }
-};
-#endif
-
-template<typename ValueType>
-struct TypeHelper<ValueType, int64_t> {
- static bool Is(const ValueType& v) { return v.IsInt64(); }
- static int64_t Get(const ValueType& v) { return v.GetInt64(); }
- static ValueType& Set(ValueType& v, int64_t data) { return v.SetInt64(data); }
- static ValueType& Set(ValueType& v, int64_t data, typename ValueType::AllocatorType&) { return v.SetInt64(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, uint64_t> {
- static bool Is(const ValueType& v) { return v.IsUint64(); }
- static uint64_t Get(const ValueType& v) { return v.GetUint64(); }
- static ValueType& Set(ValueType& v, uint64_t data) { return v.SetUint64(data); }
- static ValueType& Set(ValueType& v, uint64_t data, typename ValueType::AllocatorType&) { return v.SetUint64(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, double> {
- static bool Is(const ValueType& v) { return v.IsDouble(); }
- static double Get(const ValueType& v) { return v.GetDouble(); }
- static ValueType& Set(ValueType& v, double data) { return v.SetDouble(data); }
- static ValueType& Set(ValueType& v, double data, typename ValueType::AllocatorType&) { return v.SetDouble(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, float> {
- static bool Is(const ValueType& v) { return v.IsFloat(); }
- static float Get(const ValueType& v) { return v.GetFloat(); }
- static ValueType& Set(ValueType& v, float data) { return v.SetFloat(data); }
- static ValueType& Set(ValueType& v, float data, typename ValueType::AllocatorType&) { return v.SetFloat(data); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, const typename ValueType::Ch*> {
- typedef const typename ValueType::Ch* StringType;
- static bool Is(const ValueType& v) { return v.IsString(); }
- static StringType Get(const ValueType& v) { return v.GetString(); }
- static ValueType& Set(ValueType& v, const StringType data) { return v.SetString(typename ValueType::StringRefType(data)); }
- static ValueType& Set(ValueType& v, const StringType data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); }
-};
-
-#if RAPIDJSON_HAS_STDSTRING
-template<typename ValueType>
-struct TypeHelper<ValueType, std::basic_string<typename ValueType::Ch> > {
- typedef std::basic_string<typename ValueType::Ch> StringType;
- static bool Is(const ValueType& v) { return v.IsString(); }
- static StringType Get(const ValueType& v) { return StringType(v.GetString(), v.GetStringLength()); }
- static ValueType& Set(ValueType& v, const StringType& data, typename ValueType::AllocatorType& a) { return v.SetString(data, a); }
-};
-#endif
-
-template<typename ValueType>
-struct TypeHelper<ValueType, typename ValueType::Array> {
- typedef typename ValueType::Array ArrayType;
- static bool Is(const ValueType& v) { return v.IsArray(); }
- static ArrayType Get(ValueType& v) { return v.GetArray(); }
- static ValueType& Set(ValueType& v, ArrayType data) { return v = data; }
- static ValueType& Set(ValueType& v, ArrayType data, typename ValueType::AllocatorType&) { return v = data; }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, typename ValueType::ConstArray> {
- typedef typename ValueType::ConstArray ArrayType;
- static bool Is(const ValueType& v) { return v.IsArray(); }
- static ArrayType Get(const ValueType& v) { return v.GetArray(); }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, typename ValueType::Object> {
- typedef typename ValueType::Object ObjectType;
- static bool Is(const ValueType& v) { return v.IsObject(); }
- static ObjectType Get(ValueType& v) { return v.GetObject(); }
- static ValueType& Set(ValueType& v, ObjectType data) { return v = data; }
- static ValueType& Set(ValueType& v, ObjectType data, typename ValueType::AllocatorType&) { return v = data; }
-};
-
-template<typename ValueType>
-struct TypeHelper<ValueType, typename ValueType::ConstObject> {
- typedef typename ValueType::ConstObject ObjectType;
- static bool Is(const ValueType& v) { return v.IsObject(); }
- static ObjectType Get(const ValueType& v) { return v.GetObject(); }
-};
-
-} // namespace internal
-
-// Forward declarations
-template <bool, typename> class GenericArray;
-template <bool, typename> class GenericObject;
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericValue
-
-//! Represents a JSON value. Use Value for UTF8 encoding and default allocator.
-/*!
- A JSON value can be one of 7 types. This class is a variant type supporting
- these types.
-
- Use the Value if UTF8 and default allocator
-
- \tparam Encoding Encoding of the value. (Even non-string values need to have the same encoding in a document)
- \tparam Allocator Allocator type for allocating memory of object, array and string.
-*/
-template <typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR >
-class GenericValue {
-public:
- //! Name-value pair in an object.
- typedef GenericMember<Encoding, Allocator> Member;
- typedef Encoding EncodingType; //!< Encoding type from template parameter.
- typedef Allocator AllocatorType; //!< Allocator type from template parameter.
- typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding.
- typedef GenericStringRef<Ch> StringRefType; //!< Reference to a constant string
- typedef typename GenericMemberIterator<false,Encoding,Allocator>::Iterator MemberIterator; //!< Member iterator for iterating in object.
- typedef typename GenericMemberIterator<true,Encoding,Allocator>::Iterator ConstMemberIterator; //!< Constant member iterator for iterating in object.
- typedef GenericValue* ValueIterator; //!< Value iterator for iterating in array.
- typedef const GenericValue* ConstValueIterator; //!< Constant value iterator for iterating in array.
- typedef GenericValue<Encoding, Allocator> ValueType; //!< Value type of itself.
- typedef GenericArray<false, ValueType> Array;
- typedef GenericArray<true, ValueType> ConstArray;
- typedef GenericObject<false, ValueType> Object;
- typedef GenericObject<true, ValueType> ConstObject;
-
- //!@name Constructors and destructor.
- //@{
-
- //! Default constructor creates a null value.
- GenericValue() RAPIDJSON_NOEXCEPT : data_() { data_.f.flags = kNullFlag; }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move constructor in C++11
- GenericValue(GenericValue&& rhs) RAPIDJSON_NOEXCEPT : data_(rhs.data_) {
- rhs.data_.f.flags = kNullFlag; // give up contents
- }
-#endif
-
-private:
- //! Copy constructor is not permitted.
- GenericValue(const GenericValue& rhs);
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Moving from a GenericDocument is not permitted.
- template <typename StackAllocator>
- GenericValue(GenericDocument<Encoding,Allocator,StackAllocator>&& rhs);
-
- //! Move assignment from a GenericDocument is not permitted.
- template <typename StackAllocator>
- GenericValue& operator=(GenericDocument<Encoding,Allocator,StackAllocator>&& rhs);
-#endif
-
-public:
-
- //! Constructor with JSON value type.
- /*! This creates a Value of specified type with default content.
- \param type Type of the value.
- \note Default content for number is zero.
- */
- explicit GenericValue(Type type) RAPIDJSON_NOEXCEPT : data_() {
- static const uint16_t defaultFlags[] = {
- kNullFlag, kFalseFlag, kTrueFlag, kObjectFlag, kArrayFlag, kShortStringFlag,
- kNumberAnyFlag
- };
- RAPIDJSON_NOEXCEPT_ASSERT(type >= kNullType && type <= kNumberType);
- data_.f.flags = defaultFlags[type];
-
- // Use ShortString to store empty string.
- if (type == kStringType)
- data_.ss.SetLength(0);
- }
-
- //! Explicit copy constructor (with allocator)
- /*! Creates a copy of a Value by using the given Allocator
- \tparam SourceAllocator allocator of \c rhs
- \param rhs Value to copy from (read-only)
- \param allocator Allocator for allocating copied elements and buffers. Commonly use GenericDocument::GetAllocator().
- \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer)
- \see CopyFrom()
- */
- template <typename SourceAllocator>
- GenericValue(const GenericValue<Encoding,SourceAllocator>& rhs, Allocator& allocator, bool copyConstStrings = false) {
- switch (rhs.GetType()) {
- case kObjectType:
- DoCopyMembers(rhs, allocator, copyConstStrings);
- break;
- case kArrayType: {
- SizeType count = rhs.data_.a.size;
- GenericValue* le = reinterpret_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
- const GenericValue<Encoding,SourceAllocator>* re = rhs.GetElementsPointer();
- for (SizeType i = 0; i < count; i++)
- new (&le[i]) GenericValue(re[i], allocator, copyConstStrings);
- data_.f.flags = kArrayFlag;
- data_.a.size = data_.a.capacity = count;
- SetElementsPointer(le);
- }
- break;
- case kStringType:
- if (rhs.data_.f.flags == kConstStringFlag && !copyConstStrings) {
- data_.f.flags = rhs.data_.f.flags;
- data_ = *reinterpret_cast<const Data*>(&rhs.data_);
- }
- else
- SetStringRaw(StringRef(rhs.GetString(), rhs.GetStringLength()), allocator);
- break;
- default:
- data_.f.flags = rhs.data_.f.flags;
- data_ = *reinterpret_cast<const Data*>(&rhs.data_);
- break;
- }
- }
-
- //! Constructor for boolean value.
- /*! \param b Boolean value
- \note This constructor is limited to \em real boolean values and rejects
- implicitly converted types like arbitrary pointers. Use an explicit cast
- to \c bool, if you want to construct a boolean JSON value in such cases.
- */
-#ifndef RAPIDJSON_DOXYGEN_RUNNING // hide SFINAE from Doxygen
- template <typename T>
- explicit GenericValue(T b, RAPIDJSON_ENABLEIF((internal::IsSame<bool, T>))) RAPIDJSON_NOEXCEPT // See #472
-#else
- explicit GenericValue(bool b) RAPIDJSON_NOEXCEPT
-#endif
- : data_() {
- // safe-guard against failing SFINAE
- RAPIDJSON_STATIC_ASSERT((internal::IsSame<bool,T>::Value));
- data_.f.flags = b ? kTrueFlag : kFalseFlag;
- }
-
- //! Constructor for int value.
- explicit GenericValue(int i) RAPIDJSON_NOEXCEPT : data_() {
- data_.n.i64 = i;
- data_.f.flags = (i >= 0) ? (kNumberIntFlag | kUintFlag | kUint64Flag) : kNumberIntFlag;
- }
-
- //! Constructor for unsigned value.
- explicit GenericValue(unsigned u) RAPIDJSON_NOEXCEPT : data_() {
- data_.n.u64 = u;
- data_.f.flags = (u & 0x80000000) ? kNumberUintFlag : (kNumberUintFlag | kIntFlag | kInt64Flag);
- }
-
- //! Constructor for int64_t value.
- explicit GenericValue(int64_t i64) RAPIDJSON_NOEXCEPT : data_() {
- data_.n.i64 = i64;
- data_.f.flags = kNumberInt64Flag;
- if (i64 >= 0) {
- data_.f.flags |= kNumberUint64Flag;
- if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))
- data_.f.flags |= kUintFlag;
- if (!(static_cast<uint64_t>(i64) & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
- data_.f.flags |= kIntFlag;
- }
- else if (i64 >= static_cast<int64_t>(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
- data_.f.flags |= kIntFlag;
- }
-
- //! Constructor for uint64_t value.
- explicit GenericValue(uint64_t u64) RAPIDJSON_NOEXCEPT : data_() {
- data_.n.u64 = u64;
- data_.f.flags = kNumberUint64Flag;
- if (!(u64 & RAPIDJSON_UINT64_C2(0x80000000, 0x00000000)))
- data_.f.flags |= kInt64Flag;
- if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x00000000)))
- data_.f.flags |= kUintFlag;
- if (!(u64 & RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x80000000)))
- data_.f.flags |= kIntFlag;
- }
-
- //! Constructor for double value.
- explicit GenericValue(double d) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = d; data_.f.flags = kNumberDoubleFlag; }
-
- //! Constructor for float value.
- explicit GenericValue(float f) RAPIDJSON_NOEXCEPT : data_() { data_.n.d = static_cast<double>(f); data_.f.flags = kNumberDoubleFlag; }
-
- //! Constructor for constant string (i.e. do not make a copy of string)
- GenericValue(const Ch* s, SizeType length) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(StringRef(s, length)); }
-
- //! Constructor for constant string (i.e. do not make a copy of string)
- explicit GenericValue(StringRefType s) RAPIDJSON_NOEXCEPT : data_() { SetStringRaw(s); }
-
- //! Constructor for copy-string (i.e. do make a copy of string)
- GenericValue(const Ch* s, SizeType length, Allocator& allocator) : data_() { SetStringRaw(StringRef(s, length), allocator); }
-
- //! Constructor for copy-string (i.e. do make a copy of string)
- GenericValue(const Ch*s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Constructor for copy-string from a string object (i.e. do make a copy of string)
- /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
- */
- GenericValue(const std::basic_string<Ch>& s, Allocator& allocator) : data_() { SetStringRaw(StringRef(s), allocator); }
-#endif
-
- //! Constructor for Array.
- /*!
- \param a An array obtained by \c GetArray().
- \note \c Array is always pass-by-value.
- \note the source array is moved into this value and the sourec array becomes empty.
- */
- GenericValue(Array a) RAPIDJSON_NOEXCEPT : data_(a.value_.data_) {
- a.value_.data_ = Data();
- a.value_.data_.f.flags = kArrayFlag;
- }
-
- //! Constructor for Object.
- /*!
- \param o An object obtained by \c GetObject().
- \note \c Object is always pass-by-value.
- \note the source object is moved into this value and the sourec object becomes empty.
- */
- GenericValue(Object o) RAPIDJSON_NOEXCEPT : data_(o.value_.data_) {
- o.value_.data_ = Data();
- o.value_.data_.f.flags = kObjectFlag;
- }
-
- //! Destructor.
- /*! Need to destruct elements of array, members of object, or copy-string.
- */
- ~GenericValue() {
- // With RAPIDJSON_USE_MEMBERSMAP, the maps need to be destroyed to release
- // their Allocator if it's refcounted (e.g. MemoryPoolAllocator).
- if (Allocator::kNeedFree || (RAPIDJSON_USE_MEMBERSMAP+0 &&
- internal::IsRefCounted<Allocator>::Value)) {
- switch(data_.f.flags) {
- case kArrayFlag:
- {
- GenericValue* e = GetElementsPointer();
- for (GenericValue* v = e; v != e + data_.a.size; ++v)
- v->~GenericValue();
- if (Allocator::kNeedFree) { // Shortcut by Allocator's trait
- Allocator::Free(e);
- }
- }
- break;
-
- case kObjectFlag:
- DoFreeMembers();
- break;
-
- case kCopyStringFlag:
- if (Allocator::kNeedFree) { // Shortcut by Allocator's trait
- Allocator::Free(const_cast<Ch*>(GetStringPointer()));
- }
- break;
-
- default:
- break; // Do nothing for other types.
- }
- }
- }
-
- //@}
-
- //!@name Assignment operators
- //@{
-
- //! Assignment with move semantics.
- /*! \param rhs Source of the assignment. It will become a null value after assignment.
- */
- GenericValue& operator=(GenericValue& rhs) RAPIDJSON_NOEXCEPT {
- if (RAPIDJSON_LIKELY(this != &rhs)) {
- // Can't destroy "this" before assigning "rhs", otherwise "rhs"
- // could be used after free if it's an sub-Value of "this",
- // hence the temporary danse.
- GenericValue temp;
- temp.RawAssign(rhs);
- this->~GenericValue();
- RawAssign(temp);
- }
- return *this;
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move assignment in C++11
- GenericValue& operator=(GenericValue&& rhs) RAPIDJSON_NOEXCEPT {
- return *this = rhs.Move();
- }
-#endif
-
- //! Assignment of constant string reference (no copy)
- /*! \param str Constant string reference to be assigned
- \note This overload is needed to avoid clashes with the generic primitive type assignment overload below.
- \see GenericStringRef, operator=(T)
- */
- GenericValue& operator=(StringRefType str) RAPIDJSON_NOEXCEPT {
- GenericValue s(str);
- return *this = s;
- }
-
- //! Assignment with primitive types.
- /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
- \param value The value to be assigned.
-
- \note The source type \c T explicitly disallows all pointer types,
- especially (\c const) \ref Ch*. This helps avoiding implicitly
- referencing character strings with insufficient lifetime, use
- \ref SetString(const Ch*, Allocator&) (for copying) or
- \ref StringRef() (to explicitly mark the pointer as constant) instead.
- All other pointer types would implicitly convert to \c bool,
- use \ref SetBool() instead.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::IsPointer<T>), (GenericValue&))
- operator=(T value) {
- GenericValue v(value);
- return *this = v;
- }
-
- //! Deep-copy assignment from Value
- /*! Assigns a \b copy of the Value to the current Value object
- \tparam SourceAllocator Allocator type of \c rhs
- \param rhs Value to copy from (read-only)
- \param allocator Allocator to use for copying
- \param copyConstStrings Force copying of constant strings (e.g. referencing an in-situ buffer)
- */
- template <typename SourceAllocator>
- GenericValue& CopyFrom(const GenericValue<Encoding, SourceAllocator>& rhs, Allocator& allocator, bool copyConstStrings = false) {
- RAPIDJSON_ASSERT(static_cast<void*>(this) != static_cast<void const*>(&rhs));
- this->~GenericValue();
- new (this) GenericValue(rhs, allocator, copyConstStrings);
- return *this;
- }
-
- //! Exchange the contents of this value with those of other.
- /*!
- \param other Another value.
- \note Constant complexity.
- */
- GenericValue& Swap(GenericValue& other) RAPIDJSON_NOEXCEPT {
- GenericValue temp;
- temp.RawAssign(*this);
- RawAssign(other);
- other.RawAssign(temp);
- return *this;
- }
-
- //! free-standing swap function helper
- /*!
- Helper function to enable support for common swap implementation pattern based on \c std::swap:
- \code
- void swap(MyClass& a, MyClass& b) {
- using std::swap;
- swap(a.value, b.value);
- // ...
- }
- \endcode
- \see Swap()
- */
- friend inline void swap(GenericValue& a, GenericValue& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
-
- //! Prepare Value for move semantics
- /*! \return *this */
- GenericValue& Move() RAPIDJSON_NOEXCEPT { return *this; }
- //@}
-
- //!@name Equal-to and not-equal-to operators
- //@{
- //! Equal-to operator
- /*!
- \note If an object contains duplicated named member, comparing equality with any object is always \c false.
- \note Complexity is quadratic in Object's member number and linear for the rest (number of all values in the subtree and total lengths of all strings).
- */
- template <typename SourceAllocator>
- bool operator==(const GenericValue<Encoding, SourceAllocator>& rhs) const {
- typedef GenericValue<Encoding, SourceAllocator> RhsType;
- if (GetType() != rhs.GetType())
- return false;
-
- switch (GetType()) {
- case kObjectType: // Warning: O(n^2) inner-loop
- if (data_.o.size != rhs.data_.o.size)
- return false;
- for (ConstMemberIterator lhsMemberItr = MemberBegin(); lhsMemberItr != MemberEnd(); ++lhsMemberItr) {
- typename RhsType::ConstMemberIterator rhsMemberItr = rhs.FindMember(lhsMemberItr->name);
- if (rhsMemberItr == rhs.MemberEnd() || lhsMemberItr->value != rhsMemberItr->value)
- return false;
- }
- return true;
-
- case kArrayType:
- if (data_.a.size != rhs.data_.a.size)
- return false;
- for (SizeType i = 0; i < data_.a.size; i++)
- if ((*this)[i] != rhs[i])
- return false;
- return true;
-
- case kStringType:
- return StringEqual(rhs);
-
- case kNumberType:
- if (IsDouble() || rhs.IsDouble()) {
- double a = GetDouble(); // May convert from integer to double.
- double b = rhs.GetDouble(); // Ditto
- return a >= b && a <= b; // Prevent -Wfloat-equal
- }
- else
- return data_.n.u64 == rhs.data_.n.u64;
-
- default:
- return true;
- }
- }
-
- //! Equal-to operator with const C-string pointer
- bool operator==(const Ch* rhs) const { return *this == GenericValue(StringRef(rhs)); }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Equal-to operator with string object
- /*! \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
- */
- bool operator==(const std::basic_string<Ch>& rhs) const { return *this == GenericValue(StringRef(rhs)); }
-#endif
-
- //! Equal-to operator with primitive types
- /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c true, \c false
- */
- template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>,internal::IsGenericValue<T> >), (bool)) operator==(const T& rhs) const { return *this == GenericValue(rhs); }
-
-#ifndef __cpp_impl_three_way_comparison
- //! Not-equal-to operator
- /*! \return !(*this == rhs)
- */
- template <typename SourceAllocator>
- bool operator!=(const GenericValue<Encoding, SourceAllocator>& rhs) const { return !(*this == rhs); }
-
- //! Not-equal-to operator with const C-string pointer
- bool operator!=(const Ch* rhs) const { return !(*this == rhs); }
-
- //! Not-equal-to operator with arbitrary types
- /*! \return !(*this == rhs)
- */
- template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& rhs) const { return !(*this == rhs); }
-
- //! Equal-to operator with arbitrary types (symmetric version)
- /*! \return (rhs == lhs)
- */
- template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator==(const T& lhs, const GenericValue& rhs) { return rhs == lhs; }
-
- //! Not-Equal-to operator with arbitrary types (symmetric version)
- /*! \return !(rhs == lhs)
- */
- template <typename T> friend RAPIDJSON_DISABLEIF_RETURN((internal::IsGenericValue<T>), (bool)) operator!=(const T& lhs, const GenericValue& rhs) { return !(rhs == lhs); }
- //@}
-#endif
-
- //!@name Type
- //@{
-
- Type GetType() const { return static_cast<Type>(data_.f.flags & kTypeMask); }
- bool IsNull() const { return data_.f.flags == kNullFlag; }
- bool IsFalse() const { return data_.f.flags == kFalseFlag; }
- bool IsTrue() const { return data_.f.flags == kTrueFlag; }
- bool IsBool() const { return (data_.f.flags & kBoolFlag) != 0; }
- bool IsObject() const { return data_.f.flags == kObjectFlag; }
- bool IsArray() const { return data_.f.flags == kArrayFlag; }
- bool IsNumber() const { return (data_.f.flags & kNumberFlag) != 0; }
- bool IsInt() const { return (data_.f.flags & kIntFlag) != 0; }
- bool IsUint() const { return (data_.f.flags & kUintFlag) != 0; }
- bool IsInt64() const { return (data_.f.flags & kInt64Flag) != 0; }
- bool IsUint64() const { return (data_.f.flags & kUint64Flag) != 0; }
- bool IsDouble() const { return (data_.f.flags & kDoubleFlag) != 0; }
- bool IsString() const { return (data_.f.flags & kStringFlag) != 0; }
-
- // Checks whether a number can be losslessly converted to a double.
- bool IsLosslessDouble() const {
- if (!IsNumber()) return false;
- if (IsUint64()) {
- uint64_t u = GetUint64();
- volatile double d = static_cast<double>(u);
- return (d >= 0.0)
- && (d < static_cast<double>((std::numeric_limits<uint64_t>::max)()))
- && (u == static_cast<uint64_t>(d));
- }
- if (IsInt64()) {
- int64_t i = GetInt64();
- volatile double d = static_cast<double>(i);
- return (d >= static_cast<double>((std::numeric_limits<int64_t>::min)()))
- && (d < static_cast<double>((std::numeric_limits<int64_t>::max)()))
- && (i == static_cast<int64_t>(d));
- }
- return true; // double, int, uint are always lossless
- }
-
- // Checks whether a number is a float (possible lossy).
- bool IsFloat() const {
- if ((data_.f.flags & kDoubleFlag) == 0)
- return false;
- double d = GetDouble();
- return d >= -3.4028234e38 && d <= 3.4028234e38;
- }
- // Checks whether a number can be losslessly converted to a float.
- bool IsLosslessFloat() const {
- if (!IsNumber()) return false;
- double a = GetDouble();
- if (a < static_cast<double>(-(std::numeric_limits<float>::max)())
- || a > static_cast<double>((std::numeric_limits<float>::max)()))
- return false;
- double b = static_cast<double>(static_cast<float>(a));
- return a >= b && a <= b; // Prevent -Wfloat-equal
- }
-
- //@}
-
- //!@name Null
- //@{
-
- GenericValue& SetNull() { this->~GenericValue(); new (this) GenericValue(); return *this; }
-
- //@}
-
- //!@name Bool
- //@{
-
- bool GetBool() const { RAPIDJSON_ASSERT(IsBool()); return data_.f.flags == kTrueFlag; }
- //!< Set boolean value
- /*! \post IsBool() == true */
- GenericValue& SetBool(bool b) { this->~GenericValue(); new (this) GenericValue(b); return *this; }
-
- //@}
-
- //!@name Object
- //@{
-
- //! Set this value as an empty object.
- /*! \post IsObject() == true */
- GenericValue& SetObject() { this->~GenericValue(); new (this) GenericValue(kObjectType); return *this; }
-
- //! Get the number of members in the object.
- SizeType MemberCount() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size; }
-
- //! Get the capacity of object.
- SizeType MemberCapacity() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.capacity; }
-
- //! Check whether the object is empty.
- bool ObjectEmpty() const { RAPIDJSON_ASSERT(IsObject()); return data_.o.size == 0; }
-
- //! Get a value from an object associated with the name.
- /*! \pre IsObject() == true
- \tparam T Either \c Ch or \c const \c Ch (template used for disambiguation with \ref operator[](SizeType))
- \note In version 0.1x, if the member is not found, this function returns a null value. This makes issue 7.
- Since 0.2, if the name is not correct, it will assert.
- If user is unsure whether a member exists, user should use HasMember() first.
- A better approach is to use FindMember().
- \note Linear time complexity.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >),(GenericValue&)) operator[](T* name) {
- GenericValue n(StringRef(name));
- return (*this)[n];
- }
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >),(const GenericValue&)) operator[](T* name) const { return const_cast<GenericValue&>(*this)[name]; }
-
- //! Get a value from an object associated with the name.
- /*! \pre IsObject() == true
- \tparam SourceAllocator Allocator of the \c name value
-
- \note Compared to \ref operator[](T*), this version is faster because it does not need a StrLen().
- And it can also handle strings with embedded null characters.
-
- \note Linear time complexity.
- */
- template <typename SourceAllocator>
- GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) {
- MemberIterator member = FindMember(name);
- if (member != MemberEnd())
- return member->value;
- else {
- RAPIDJSON_ASSERT(false); // see above note
-
-#if RAPIDJSON_HAS_CXX11
- // Use thread-local storage to prevent races between threads.
- // Use static buffer and placement-new to prevent destruction, with
- // alignas() to ensure proper alignment.
- alignas(GenericValue) thread_local static char buffer[sizeof(GenericValue)];
- return *new (buffer) GenericValue();
-#elif defined(_MSC_VER) && _MSC_VER < 1900
- // There's no way to solve both thread locality and proper alignment
- // simultaneously.
- __declspec(thread) static char buffer[sizeof(GenericValue)];
- return *new (buffer) GenericValue();
-#elif defined(__GNUC__) || defined(__clang__)
- // This will generate -Wexit-time-destructors in clang, but that's
- // better than having under-alignment.
- __thread static GenericValue buffer;
- return buffer;
-#else
- // Don't know what compiler this is, so don't know how to ensure
- // thread-locality.
- static GenericValue buffer;
- return buffer;
-#endif
- }
- }
- template <typename SourceAllocator>
- const GenericValue& operator[](const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this)[name]; }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Get a value from an object associated with name (string object).
- GenericValue& operator[](const std::basic_string<Ch>& name) { return (*this)[GenericValue(StringRef(name))]; }
- const GenericValue& operator[](const std::basic_string<Ch>& name) const { return (*this)[GenericValue(StringRef(name))]; }
-#endif
-
- //! Const member iterator
- /*! \pre IsObject() == true */
- ConstMemberIterator MemberBegin() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer()); }
- //! Const \em past-the-end member iterator
- /*! \pre IsObject() == true */
- ConstMemberIterator MemberEnd() const { RAPIDJSON_ASSERT(IsObject()); return ConstMemberIterator(GetMembersPointer() + data_.o.size); }
- //! Member iterator
- /*! \pre IsObject() == true */
- MemberIterator MemberBegin() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer()); }
- //! \em Past-the-end member iterator
- /*! \pre IsObject() == true */
- MemberIterator MemberEnd() { RAPIDJSON_ASSERT(IsObject()); return MemberIterator(GetMembersPointer() + data_.o.size); }
-
- //! Request the object to have enough capacity to store members.
- /*! \param newCapacity The capacity that the object at least need to have.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \note Linear time complexity.
- */
- GenericValue& MemberReserve(SizeType newCapacity, Allocator &allocator) {
- RAPIDJSON_ASSERT(IsObject());
- DoReserveMembers(newCapacity, allocator);
- return *this;
- }
-
- //! Check whether a member exists in the object.
- /*!
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Whether a member with that name exists.
- \note It is better to use FindMember() directly if you need the obtain the value as well.
- \note Linear time complexity.
- */
- bool HasMember(const Ch* name) const { return FindMember(name) != MemberEnd(); }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Check whether a member exists in the object with string object.
- /*!
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Whether a member with that name exists.
- \note It is better to use FindMember() directly if you need the obtain the value as well.
- \note Linear time complexity.
- */
- bool HasMember(const std::basic_string<Ch>& name) const { return FindMember(name) != MemberEnd(); }
-#endif
-
- //! Check whether a member exists in the object with GenericValue name.
- /*!
- This version is faster because it does not need a StrLen(). It can also handle string with null character.
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Whether a member with that name exists.
- \note It is better to use FindMember() directly if you need the obtain the value as well.
- \note Linear time complexity.
- */
- template <typename SourceAllocator>
- bool HasMember(const GenericValue<Encoding, SourceAllocator>& name) const { return FindMember(name) != MemberEnd(); }
-
- //! Find member by name.
- /*!
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Iterator to member, if it exists.
- Otherwise returns \ref MemberEnd().
-
- \note Earlier versions of Rapidjson returned a \c NULL pointer, in case
- the requested member doesn't exist. For consistency with e.g.
- \c std::map, this has been changed to MemberEnd() now.
- \note Linear time complexity.
- */
- MemberIterator FindMember(const Ch* name) {
- GenericValue n(StringRef(name));
- return FindMember(n);
- }
-
- ConstMemberIterator FindMember(const Ch* name) const { return const_cast<GenericValue&>(*this).FindMember(name); }
-
- //! Find member by name.
- /*!
- This version is faster because it does not need a StrLen(). It can also handle string with null character.
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Iterator to member, if it exists.
- Otherwise returns \ref MemberEnd().
-
- \note Earlier versions of Rapidjson returned a \c NULL pointer, in case
- the requested member doesn't exist. For consistency with e.g.
- \c std::map, this has been changed to MemberEnd() now.
- \note Linear time complexity.
- */
- template <typename SourceAllocator>
- MemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) {
- RAPIDJSON_ASSERT(IsObject());
- RAPIDJSON_ASSERT(name.IsString());
- return DoFindMember(name);
- }
- template <typename SourceAllocator> ConstMemberIterator FindMember(const GenericValue<Encoding, SourceAllocator>& name) const { return const_cast<GenericValue&>(*this).FindMember(name); }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Find member by string object name.
- /*!
- \param name Member name to be searched.
- \pre IsObject() == true
- \return Iterator to member, if it exists.
- Otherwise returns \ref MemberEnd().
- */
- MemberIterator FindMember(const std::basic_string<Ch>& name) { return FindMember(GenericValue(StringRef(name))); }
- ConstMemberIterator FindMember(const std::basic_string<Ch>& name) const { return FindMember(GenericValue(StringRef(name))); }
-#endif
-
- //! Add a member (name-value pair) to the object.
- /*! \param name A string value as name of member.
- \param value Value of any type.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \note The ownership of \c name and \c value will be transferred to this object on success.
- \pre IsObject() && name.IsString()
- \post name.IsNull() && value.IsNull()
- \note Amortized Constant time complexity.
- */
- GenericValue& AddMember(GenericValue& name, GenericValue& value, Allocator& allocator) {
- RAPIDJSON_ASSERT(IsObject());
- RAPIDJSON_ASSERT(name.IsString());
- DoAddMember(name, value, allocator);
- return *this;
- }
-
- //! Add a constant string value as member (name-value pair) to the object.
- /*! \param name A string value as name of member.
- \param value constant string reference as value of member.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \pre IsObject()
- \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below.
- \note Amortized Constant time complexity.
- */
- GenericValue& AddMember(GenericValue& name, StringRefType value, Allocator& allocator) {
- GenericValue v(value);
- return AddMember(name, v, allocator);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Add a string object as member (name-value pair) to the object.
- /*! \param name A string value as name of member.
- \param value constant string reference as value of member.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \pre IsObject()
- \note This overload is needed to avoid clashes with the generic primitive type AddMember(GenericValue&,T,Allocator&) overload below.
- \note Amortized Constant time complexity.
- */
- GenericValue& AddMember(GenericValue& name, std::basic_string<Ch>& value, Allocator& allocator) {
- GenericValue v(value, allocator);
- return AddMember(name, v, allocator);
- }
-#endif
-
- //! Add any primitive value as member (name-value pair) to the object.
- /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
- \param name A string value as name of member.
- \param value Value of primitive type \c T as value of member
- \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \pre IsObject()
-
- \note The source type \c T explicitly disallows all pointer types,
- especially (\c const) \ref Ch*. This helps avoiding implicitly
- referencing character strings with insufficient lifetime, use
- \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref
- AddMember(StringRefType, StringRefType, Allocator&).
- All other pointer types would implicitly convert to \c bool,
- use an explicit cast instead, if needed.
- \note Amortized Constant time complexity.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
- AddMember(GenericValue& name, T value, Allocator& allocator) {
- GenericValue v(value);
- return AddMember(name, v, allocator);
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericValue& AddMember(GenericValue&& name, GenericValue&& value, Allocator& allocator) {
- return AddMember(name, value, allocator);
- }
- GenericValue& AddMember(GenericValue&& name, GenericValue& value, Allocator& allocator) {
- return AddMember(name, value, allocator);
- }
- GenericValue& AddMember(GenericValue& name, GenericValue&& value, Allocator& allocator) {
- return AddMember(name, value, allocator);
- }
- GenericValue& AddMember(StringRefType name, GenericValue&& value, Allocator& allocator) {
- GenericValue n(name);
- return AddMember(n, value, allocator);
- }
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-
- //! Add a member (name-value pair) to the object.
- /*! \param name A constant string reference as name of member.
- \param value Value of any type.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \note The ownership of \c value will be transferred to this object on success.
- \pre IsObject()
- \post value.IsNull()
- \note Amortized Constant time complexity.
- */
- GenericValue& AddMember(StringRefType name, GenericValue& value, Allocator& allocator) {
- GenericValue n(name);
- return AddMember(n, value, allocator);
- }
-
- //! Add a constant string value as member (name-value pair) to the object.
- /*! \param name A constant string reference as name of member.
- \param value constant string reference as value of member.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \pre IsObject()
- \note This overload is needed to avoid clashes with the generic primitive type AddMember(StringRefType,T,Allocator&) overload below.
- \note Amortized Constant time complexity.
- */
- GenericValue& AddMember(StringRefType name, StringRefType value, Allocator& allocator) {
- GenericValue v(value);
- return AddMember(name, v, allocator);
- }
-
- //! Add any primitive value as member (name-value pair) to the object.
- /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
- \param name A constant string reference as name of member.
- \param value Value of primitive type \c T as value of member
- \param allocator Allocator for reallocating memory. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \pre IsObject()
-
- \note The source type \c T explicitly disallows all pointer types,
- especially (\c const) \ref Ch*. This helps avoiding implicitly
- referencing character strings with insufficient lifetime, use
- \ref AddMember(StringRefType, GenericValue&, Allocator&) or \ref
- AddMember(StringRefType, StringRefType, Allocator&).
- All other pointer types would implicitly convert to \c bool,
- use an explicit cast instead, if needed.
- \note Amortized Constant time complexity.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
- AddMember(StringRefType name, T value, Allocator& allocator) {
- GenericValue n(name);
- return AddMember(n, value, allocator);
- }
-
- //! Remove all members in the object.
- /*! This function do not deallocate memory in the object, i.e. the capacity is unchanged.
- \note Linear time complexity.
- */
- void RemoveAllMembers() {
- RAPIDJSON_ASSERT(IsObject());
- DoClearMembers();
- }
-
- //! Remove a member in object by its name.
- /*! \param name Name of member to be removed.
- \return Whether the member existed.
- \note This function may reorder the object members. Use \ref
- EraseMember(ConstMemberIterator) if you need to preserve the
- relative order of the remaining members.
- \note Linear time complexity.
- */
- bool RemoveMember(const Ch* name) {
- GenericValue n(StringRef(name));
- return RemoveMember(n);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool RemoveMember(const std::basic_string<Ch>& name) { return RemoveMember(GenericValue(StringRef(name))); }
-#endif
-
- template <typename SourceAllocator>
- bool RemoveMember(const GenericValue<Encoding, SourceAllocator>& name) {
- MemberIterator m = FindMember(name);
- if (m != MemberEnd()) {
- RemoveMember(m);
- return true;
- }
- else
- return false;
- }
-
- //! Remove a member in object by iterator.
- /*! \param m member iterator (obtained by FindMember() or MemberBegin()).
- \return the new iterator after removal.
- \note This function may reorder the object members. Use \ref
- EraseMember(ConstMemberIterator) if you need to preserve the
- relative order of the remaining members.
- \note Constant time complexity.
- */
- MemberIterator RemoveMember(MemberIterator m) {
- RAPIDJSON_ASSERT(IsObject());
- RAPIDJSON_ASSERT(data_.o.size > 0);
- RAPIDJSON_ASSERT(GetMembersPointer() != 0);
- RAPIDJSON_ASSERT(m >= MemberBegin() && m < MemberEnd());
- return DoRemoveMember(m);
- }
-
- //! Remove a member from an object by iterator.
- /*! \param pos iterator to the member to remove
- \pre IsObject() == true && \ref MemberBegin() <= \c pos < \ref MemberEnd()
- \return Iterator following the removed element.
- If the iterator \c pos refers to the last element, the \ref MemberEnd() iterator is returned.
- \note This function preserves the relative order of the remaining object
- members. If you do not need this, use the more efficient \ref RemoveMember(MemberIterator).
- \note Linear time complexity.
- */
- MemberIterator EraseMember(ConstMemberIterator pos) {
- return EraseMember(pos, pos +1);
- }
-
- //! Remove members in the range [first, last) from an object.
- /*! \param first iterator to the first member to remove
- \param last iterator following the last member to remove
- \pre IsObject() == true && \ref MemberBegin() <= \c first <= \c last <= \ref MemberEnd()
- \return Iterator following the last removed element.
- \note This function preserves the relative order of the remaining object
- members.
- \note Linear time complexity.
- */
- MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) {
- RAPIDJSON_ASSERT(IsObject());
- RAPIDJSON_ASSERT(data_.o.size > 0);
- RAPIDJSON_ASSERT(GetMembersPointer() != 0);
- RAPIDJSON_ASSERT(first >= MemberBegin());
- RAPIDJSON_ASSERT(first <= last);
- RAPIDJSON_ASSERT(last <= MemberEnd());
- return DoEraseMembers(first, last);
- }
-
- //! Erase a member in object by its name.
- /*! \param name Name of member to be removed.
- \return Whether the member existed.
- \note Linear time complexity.
- */
- bool EraseMember(const Ch* name) {
- GenericValue n(StringRef(name));
- return EraseMember(n);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool EraseMember(const std::basic_string<Ch>& name) { return EraseMember(GenericValue(StringRef(name))); }
-#endif
-
- template <typename SourceAllocator>
- bool EraseMember(const GenericValue<Encoding, SourceAllocator>& name) {
- MemberIterator m = FindMember(name);
- if (m != MemberEnd()) {
- EraseMember(m);
- return true;
- }
- else
- return false;
- }
-
- Object GetObject() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); }
- Object GetObj() { RAPIDJSON_ASSERT(IsObject()); return Object(*this); }
- ConstObject GetObject() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); }
- ConstObject GetObj() const { RAPIDJSON_ASSERT(IsObject()); return ConstObject(*this); }
-
- //@}
-
- //!@name Array
- //@{
-
- //! Set this value as an empty array.
- /*! \post IsArray == true */
- GenericValue& SetArray() { this->~GenericValue(); new (this) GenericValue(kArrayType); return *this; }
-
- //! Get the number of elements in array.
- SizeType Size() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size; }
-
- //! Get the capacity of array.
- SizeType Capacity() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.capacity; }
-
- //! Check whether the array is empty.
- bool Empty() const { RAPIDJSON_ASSERT(IsArray()); return data_.a.size == 0; }
-
- //! Remove all elements in the array.
- /*! This function do not deallocate memory in the array, i.e. the capacity is unchanged.
- \note Linear time complexity.
- */
- void Clear() {
- RAPIDJSON_ASSERT(IsArray());
- GenericValue* e = GetElementsPointer();
- for (GenericValue* v = e; v != e + data_.a.size; ++v)
- v->~GenericValue();
- data_.a.size = 0;
- }
-
- //! Get an element from array by index.
- /*! \pre IsArray() == true
- \param index Zero-based index of element.
- \see operator[](T*)
- */
- GenericValue& operator[](SizeType index) {
- RAPIDJSON_ASSERT(IsArray());
- RAPIDJSON_ASSERT(index < data_.a.size);
- return GetElementsPointer()[index];
- }
- const GenericValue& operator[](SizeType index) const { return const_cast<GenericValue&>(*this)[index]; }
-
- //! Element iterator
- /*! \pre IsArray() == true */
- ValueIterator Begin() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer(); }
- //! \em Past-the-end element iterator
- /*! \pre IsArray() == true */
- ValueIterator End() { RAPIDJSON_ASSERT(IsArray()); return GetElementsPointer() + data_.a.size; }
- //! Constant element iterator
- /*! \pre IsArray() == true */
- ConstValueIterator Begin() const { return const_cast<GenericValue&>(*this).Begin(); }
- //! Constant \em past-the-end element iterator
- /*! \pre IsArray() == true */
- ConstValueIterator End() const { return const_cast<GenericValue&>(*this).End(); }
-
- //! Request the array to have enough capacity to store elements.
- /*! \param newCapacity The capacity that the array at least need to have.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \note Linear time complexity.
- */
- GenericValue& Reserve(SizeType newCapacity, Allocator &allocator) {
- RAPIDJSON_ASSERT(IsArray());
- if (newCapacity > data_.a.capacity) {
- SetElementsPointer(reinterpret_cast<GenericValue*>(allocator.Realloc(GetElementsPointer(), data_.a.capacity * sizeof(GenericValue), newCapacity * sizeof(GenericValue))));
- data_.a.capacity = newCapacity;
- }
- return *this;
- }
-
- //! Append a GenericValue at the end of the array.
- /*! \param value Value to be appended.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \pre IsArray() == true
- \post value.IsNull() == true
- \return The value itself for fluent API.
- \note The ownership of \c value will be transferred to this array on success.
- \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
- \note Amortized constant time complexity.
- */
- GenericValue& PushBack(GenericValue& value, Allocator& allocator) {
- RAPIDJSON_ASSERT(IsArray());
- if (data_.a.size >= data_.a.capacity)
- Reserve(data_.a.capacity == 0 ? kDefaultArrayCapacity : (data_.a.capacity + (data_.a.capacity + 1) / 2), allocator);
- GetElementsPointer()[data_.a.size++].RawAssign(value);
- return *this;
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericValue& PushBack(GenericValue&& value, Allocator& allocator) {
- return PushBack(value, allocator);
- }
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
- //! Append a constant string reference at the end of the array.
- /*! \param value Constant string reference to be appended.
- \param allocator Allocator for reallocating memory. It must be the same one used previously. Commonly use GenericDocument::GetAllocator().
- \pre IsArray() == true
- \return The value itself for fluent API.
- \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
- \note Amortized constant time complexity.
- \see GenericStringRef
- */
- GenericValue& PushBack(StringRefType value, Allocator& allocator) {
- return (*this).template PushBack<StringRefType>(value, allocator);
- }
-
- //! Append a primitive value at the end of the array.
- /*! \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t
- \param value Value of primitive type T to be appended.
- \param allocator Allocator for reallocating memory. It must be the same one as used before. Commonly use GenericDocument::GetAllocator().
- \pre IsArray() == true
- \return The value itself for fluent API.
- \note If the number of elements to be appended is known, calls Reserve() once first may be more efficient.
-
- \note The source type \c T explicitly disallows all pointer types,
- especially (\c const) \ref Ch*. This helps avoiding implicitly
- referencing character strings with insufficient lifetime, use
- \ref PushBack(GenericValue&, Allocator&) or \ref
- PushBack(StringRefType, Allocator&).
- All other pointer types would implicitly convert to \c bool,
- use an explicit cast instead, if needed.
- \note Amortized constant time complexity.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericValue&))
- PushBack(T value, Allocator& allocator) {
- GenericValue v(value);
- return PushBack(v, allocator);
- }
-
- //! Remove the last element in the array.
- /*!
- \note Constant time complexity.
- */
- GenericValue& PopBack() {
- RAPIDJSON_ASSERT(IsArray());
- RAPIDJSON_ASSERT(!Empty());
- GetElementsPointer()[--data_.a.size].~GenericValue();
- return *this;
- }
-
- //! Remove an element of array by iterator.
- /*!
- \param pos iterator to the element to remove
- \pre IsArray() == true && \ref Begin() <= \c pos < \ref End()
- \return Iterator following the removed element. If the iterator pos refers to the last element, the End() iterator is returned.
- \note Linear time complexity.
- */
- ValueIterator Erase(ConstValueIterator pos) {
- return Erase(pos, pos + 1);
- }
-
- //! Remove elements in the range [first, last) of the array.
- /*!
- \param first iterator to the first element to remove
- \param last iterator following the last element to remove
- \pre IsArray() == true && \ref Begin() <= \c first <= \c last <= \ref End()
- \return Iterator following the last removed element.
- \note Linear time complexity.
- */
- ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) {
- RAPIDJSON_ASSERT(IsArray());
- RAPIDJSON_ASSERT(data_.a.size > 0);
- RAPIDJSON_ASSERT(GetElementsPointer() != 0);
- RAPIDJSON_ASSERT(first >= Begin());
- RAPIDJSON_ASSERT(first <= last);
- RAPIDJSON_ASSERT(last <= End());
- ValueIterator pos = Begin() + (first - Begin());
- for (ValueIterator itr = pos; itr != last; ++itr)
- itr->~GenericValue();
- std::memmove(static_cast<void*>(pos), last, static_cast<size_t>(End() - last) * sizeof(GenericValue));
- data_.a.size -= static_cast<SizeType>(last - first);
- return pos;
- }
-
- Array GetArray() { RAPIDJSON_ASSERT(IsArray()); return Array(*this); }
- ConstArray GetArray() const { RAPIDJSON_ASSERT(IsArray()); return ConstArray(*this); }
-
- //@}
-
- //!@name Number
- //@{
-
- int GetInt() const { RAPIDJSON_ASSERT(data_.f.flags & kIntFlag); return data_.n.i.i; }
- unsigned GetUint() const { RAPIDJSON_ASSERT(data_.f.flags & kUintFlag); return data_.n.u.u; }
- int64_t GetInt64() const { RAPIDJSON_ASSERT(data_.f.flags & kInt64Flag); return data_.n.i64; }
- uint64_t GetUint64() const { RAPIDJSON_ASSERT(data_.f.flags & kUint64Flag); return data_.n.u64; }
-
- //! Get the value as double type.
- /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless.
- */
- double GetDouble() const {
- RAPIDJSON_ASSERT(IsNumber());
- if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion.
- if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double
- if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double
- if ((data_.f.flags & kInt64Flag) != 0) return static_cast<double>(data_.n.i64); // int64_t -> double (may lose precision)
- RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast<double>(data_.n.u64); // uint64_t -> double (may lose precision)
- }
-
- //! Get the value as float type.
- /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless.
- */
- float GetFloat() const {
- return static_cast<float>(GetDouble());
- }
-
- GenericValue& SetInt(int i) { this->~GenericValue(); new (this) GenericValue(i); return *this; }
- GenericValue& SetUint(unsigned u) { this->~GenericValue(); new (this) GenericValue(u); return *this; }
- GenericValue& SetInt64(int64_t i64) { this->~GenericValue(); new (this) GenericValue(i64); return *this; }
- GenericValue& SetUint64(uint64_t u64) { this->~GenericValue(); new (this) GenericValue(u64); return *this; }
- GenericValue& SetDouble(double d) { this->~GenericValue(); new (this) GenericValue(d); return *this; }
- GenericValue& SetFloat(float f) { this->~GenericValue(); new (this) GenericValue(static_cast<double>(f)); return *this; }
-
- //@}
-
- //!@name String
- //@{
-
- const Ch* GetString() const { RAPIDJSON_ASSERT(IsString()); return DataString(data_); }
-
- //! Get the length of string.
- /*! Since rapidjson permits "\\u0000" in the json string, strlen(v.GetString()) may not equal to v.GetStringLength().
- */
- SizeType GetStringLength() const { RAPIDJSON_ASSERT(IsString()); return DataStringLength(data_); }
-
- //! Set this value as a string without copying source string.
- /*! This version has better performance with supplied length, and also support string containing null character.
- \param s source string pointer.
- \param length The length of source string, excluding the trailing null terminator.
- \return The value itself for fluent API.
- \post IsString() == true && GetString() == s && GetStringLength() == length
- \see SetString(StringRefType)
- */
- GenericValue& SetString(const Ch* s, SizeType length) { return SetString(StringRef(s, length)); }
-
- //! Set this value as a string without copying source string.
- /*! \param s source string reference
- \return The value itself for fluent API.
- \post IsString() == true && GetString() == s && GetStringLength() == s.length
- */
- GenericValue& SetString(StringRefType s) { this->~GenericValue(); SetStringRaw(s); return *this; }
-
- //! Set this value as a string by copying from source string.
- /*! This version has better performance with supplied length, and also support string containing null character.
- \param s source string.
- \param length The length of source string, excluding the trailing null terminator.
- \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length
- */
- GenericValue& SetString(const Ch* s, SizeType length, Allocator& allocator) { return SetString(StringRef(s, length), allocator); }
-
- //! Set this value as a string by copying from source string.
- /*! \param s source string.
- \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \post IsString() == true && GetString() != s && strcmp(GetString(),s) == 0 && GetStringLength() == length
- */
- GenericValue& SetString(const Ch* s, Allocator& allocator) { return SetString(StringRef(s), allocator); }
-
- //! Set this value as a string by copying from source string.
- /*! \param s source string reference
- \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \post IsString() == true && GetString() != s.s && strcmp(GetString(),s) == 0 && GetStringLength() == length
- */
- GenericValue& SetString(StringRefType s, Allocator& allocator) { this->~GenericValue(); SetStringRaw(s, allocator); return *this; }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Set this value as a string by copying from source string.
- /*! \param s source string.
- \param allocator Allocator for allocating copied buffer. Commonly use GenericDocument::GetAllocator().
- \return The value itself for fluent API.
- \post IsString() == true && GetString() != s.data() && strcmp(GetString(),s.data() == 0 && GetStringLength() == s.size()
- \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
- */
- GenericValue& SetString(const std::basic_string<Ch>& s, Allocator& allocator) { return SetString(StringRef(s), allocator); }
-#endif
-
- //@}
-
- //!@name Array
- //@{
-
- //! Templated version for checking whether this value is type T.
- /*!
- \tparam T Either \c bool, \c int, \c unsigned, \c int64_t, \c uint64_t, \c double, \c float, \c const \c char*, \c std::basic_string<Ch>
- */
- template <typename T>
- bool Is() const { return internal::TypeHelper<ValueType, T>::Is(*this); }
-
- template <typename T>
- T Get() const { return internal::TypeHelper<ValueType, T>::Get(*this); }
-
- template <typename T>
- T Get() { return internal::TypeHelper<ValueType, T>::Get(*this); }
-
- template<typename T>
- ValueType& Set(const T& data) { return internal::TypeHelper<ValueType, T>::Set(*this, data); }
-
- template<typename T>
- ValueType& Set(const T& data, AllocatorType& allocator) { return internal::TypeHelper<ValueType, T>::Set(*this, data, allocator); }
-
- //@}
-
- //! Generate events of this value to a Handler.
- /*! This function adopts the GoF visitor pattern.
- Typical usage is to output this JSON value as JSON text via Writer, which is a Handler.
- It can also be used to deep clone this value via GenericDocument, which is also a Handler.
- \tparam Handler type of handler.
- \param handler An object implementing concept Handler.
- */
- template <typename Handler>
- bool Accept(Handler& handler) const {
- switch(GetType()) {
- case kNullType: return handler.Null();
- case kFalseType: return handler.Bool(false);
- case kTrueType: return handler.Bool(true);
-
- case kObjectType:
- if (RAPIDJSON_UNLIKELY(!handler.StartObject()))
- return false;
- for (ConstMemberIterator m = MemberBegin(); m != MemberEnd(); ++m) {
- RAPIDJSON_ASSERT(m->name.IsString()); // User may change the type of name by MemberIterator.
- if (RAPIDJSON_UNLIKELY(!handler.Key(m->name.GetString(), m->name.GetStringLength(), (m->name.data_.f.flags & kCopyFlag) != 0)))
- return false;
- if (RAPIDJSON_UNLIKELY(!m->value.Accept(handler)))
- return false;
- }
- return handler.EndObject(data_.o.size);
-
- case kArrayType:
- if (RAPIDJSON_UNLIKELY(!handler.StartArray()))
- return false;
- for (ConstValueIterator v = Begin(); v != End(); ++v)
- if (RAPIDJSON_UNLIKELY(!v->Accept(handler)))
- return false;
- return handler.EndArray(data_.a.size);
-
- case kStringType:
- return handler.String(GetString(), GetStringLength(), (data_.f.flags & kCopyFlag) != 0);
-
- default:
- RAPIDJSON_ASSERT(GetType() == kNumberType);
- if (IsDouble()) return handler.Double(data_.n.d);
- else if (IsInt()) return handler.Int(data_.n.i.i);
- else if (IsUint()) return handler.Uint(data_.n.u.u);
- else if (IsInt64()) return handler.Int64(data_.n.i64);
- else return handler.Uint64(data_.n.u64);
- }
- }
-
-private:
- template <typename, typename> friend class GenericValue;
- template <typename, typename, typename> friend class GenericDocument;
-
- enum {
- kBoolFlag = 0x0008,
- kNumberFlag = 0x0010,
- kIntFlag = 0x0020,
- kUintFlag = 0x0040,
- kInt64Flag = 0x0080,
- kUint64Flag = 0x0100,
- kDoubleFlag = 0x0200,
- kStringFlag = 0x0400,
- kCopyFlag = 0x0800,
- kInlineStrFlag = 0x1000,
-
- // Initial flags of different types.
- kNullFlag = kNullType,
- // These casts are added to suppress the warning on MSVC about bitwise operations between enums of different types.
- kTrueFlag = static_cast<int>(kTrueType) | static_cast<int>(kBoolFlag),
- kFalseFlag = static_cast<int>(kFalseType) | static_cast<int>(kBoolFlag),
- kNumberIntFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag),
- kNumberUintFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUintFlag | kUint64Flag | kInt64Flag),
- kNumberInt64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kInt64Flag),
- kNumberUint64Flag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kUint64Flag),
- kNumberDoubleFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kDoubleFlag),
- kNumberAnyFlag = static_cast<int>(kNumberType) | static_cast<int>(kNumberFlag | kIntFlag | kInt64Flag | kUintFlag | kUint64Flag | kDoubleFlag),
- kConstStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag),
- kCopyStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag),
- kShortStringFlag = static_cast<int>(kStringType) | static_cast<int>(kStringFlag | kCopyFlag | kInlineStrFlag),
- kObjectFlag = kObjectType,
- kArrayFlag = kArrayType,
-
- kTypeMask = 0x07
- };
-
- static const SizeType kDefaultArrayCapacity = RAPIDJSON_VALUE_DEFAULT_ARRAY_CAPACITY;
- static const SizeType kDefaultObjectCapacity = RAPIDJSON_VALUE_DEFAULT_OBJECT_CAPACITY;
-
- struct Flag {
-#if RAPIDJSON_48BITPOINTER_OPTIMIZATION
- char payload[sizeof(SizeType) * 2 + 6]; // 2 x SizeType + lower 48-bit pointer
-#elif RAPIDJSON_64BIT
- char payload[sizeof(SizeType) * 2 + sizeof(void*) + 6]; // 6 padding bytes
-#else
- char payload[sizeof(SizeType) * 2 + sizeof(void*) + 2]; // 2 padding bytes
-#endif
- uint16_t flags;
- };
-
- struct String {
- SizeType length;
- SizeType hashcode; //!< reserved
- const Ch* str;
- }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
-
- // implementation detail: ShortString can represent zero-terminated strings up to MaxSize chars
- // (excluding the terminating zero) and store a value to determine the length of the contained
- // string in the last character str[LenPos] by storing "MaxSize - length" there. If the string
- // to store has the maximal length of MaxSize then str[LenPos] will be 0 and therefore act as
- // the string terminator as well. For getting the string length back from that value just use
- // "MaxSize - str[LenPos]".
- // This allows to store 13-chars strings in 32-bit mode, 21-chars strings in 64-bit mode,
- // 13-chars strings for RAPIDJSON_48BITPOINTER_OPTIMIZATION=1 inline (for `UTF8`-encoded strings).
- struct ShortString {
- enum { MaxChars = sizeof(static_cast<Flag*>(0)->payload) / sizeof(Ch), MaxSize = MaxChars - 1, LenPos = MaxSize };
- Ch str[MaxChars];
-
- inline static bool Usable(SizeType len) { return (MaxSize >= len); }
- inline void SetLength(SizeType len) { str[LenPos] = static_cast<Ch>(MaxSize - len); }
- inline SizeType GetLength() const { return static_cast<SizeType>(MaxSize - str[LenPos]); }
- }; // at most as many bytes as "String" above => 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
-
- // By using proper binary layout, retrieval of different integer types do not need conversions.
- union Number {
-#if RAPIDJSON_ENDIAN == RAPIDJSON_LITTLEENDIAN
- struct I {
- int i;
- char padding[4];
- }i;
- struct U {
- unsigned u;
- char padding2[4];
- }u;
-#else
- struct I {
- char padding[4];
- int i;
- }i;
- struct U {
- char padding2[4];
- unsigned u;
- }u;
-#endif
- int64_t i64;
- uint64_t u64;
- double d;
- }; // 8 bytes
-
- struct ObjectData {
- SizeType size;
- SizeType capacity;
- Member* members;
- }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
-
- struct ArrayData {
- SizeType size;
- SizeType capacity;
- GenericValue* elements;
- }; // 12 bytes in 32-bit mode, 16 bytes in 64-bit mode
-
- union Data {
- String s;
- ShortString ss;
- Number n;
- ObjectData o;
- ArrayData a;
- Flag f;
- }; // 16 bytes in 32-bit mode, 24 bytes in 64-bit mode, 16 bytes in 64-bit with RAPIDJSON_48BITPOINTER_OPTIMIZATION
-
- static RAPIDJSON_FORCEINLINE const Ch* DataString(const Data& data) {
- return (data.f.flags & kInlineStrFlag) ? data.ss.str : RAPIDJSON_GETPOINTER(Ch, data.s.str);
- }
- static RAPIDJSON_FORCEINLINE SizeType DataStringLength(const Data& data) {
- return (data.f.flags & kInlineStrFlag) ? data.ss.GetLength() : data.s.length;
- }
-
- RAPIDJSON_FORCEINLINE const Ch* GetStringPointer() const { return RAPIDJSON_GETPOINTER(Ch, data_.s.str); }
- RAPIDJSON_FORCEINLINE const Ch* SetStringPointer(const Ch* str) { return RAPIDJSON_SETPOINTER(Ch, data_.s.str, str); }
- RAPIDJSON_FORCEINLINE GenericValue* GetElementsPointer() const { return RAPIDJSON_GETPOINTER(GenericValue, data_.a.elements); }
- RAPIDJSON_FORCEINLINE GenericValue* SetElementsPointer(GenericValue* elements) { return RAPIDJSON_SETPOINTER(GenericValue, data_.a.elements, elements); }
- RAPIDJSON_FORCEINLINE Member* GetMembersPointer() const { return RAPIDJSON_GETPOINTER(Member, data_.o.members); }
- RAPIDJSON_FORCEINLINE Member* SetMembersPointer(Member* members) { return RAPIDJSON_SETPOINTER(Member, data_.o.members, members); }
-
-#if RAPIDJSON_USE_MEMBERSMAP
-
- struct MapTraits {
- struct Less {
- bool operator()(const Data& s1, const Data& s2) const {
- SizeType n1 = DataStringLength(s1), n2 = DataStringLength(s2);
- int cmp = std::memcmp(DataString(s1), DataString(s2), sizeof(Ch) * (n1 < n2 ? n1 : n2));
- return cmp < 0 || (cmp == 0 && n1 < n2);
- }
- };
- typedef std::pair<const Data, SizeType> Pair;
- typedef std::multimap<Data, SizeType, Less, StdAllocator<Pair, Allocator> > Map;
- typedef typename Map::iterator Iterator;
- };
- typedef typename MapTraits::Map Map;
- typedef typename MapTraits::Less MapLess;
- typedef typename MapTraits::Pair MapPair;
- typedef typename MapTraits::Iterator MapIterator;
-
- //
- // Layout of the members' map/array, re(al)located according to the needed capacity:
- //
- // {Map*}<>{capacity}<>{Member[capacity]}<>{MapIterator[capacity]}
- //
- // (where <> stands for the RAPIDJSON_ALIGN-ment, if needed)
- //
-
- static RAPIDJSON_FORCEINLINE size_t GetMapLayoutSize(SizeType capacity) {
- return RAPIDJSON_ALIGN(sizeof(Map*)) +
- RAPIDJSON_ALIGN(sizeof(SizeType)) +
- RAPIDJSON_ALIGN(capacity * sizeof(Member)) +
- capacity * sizeof(MapIterator);
- }
-
- static RAPIDJSON_FORCEINLINE SizeType &GetMapCapacity(Map* &map) {
- return *reinterpret_cast<SizeType*>(reinterpret_cast<uintptr_t>(&map) +
- RAPIDJSON_ALIGN(sizeof(Map*)));
- }
-
- static RAPIDJSON_FORCEINLINE Member* GetMapMembers(Map* &map) {
- return reinterpret_cast<Member*>(reinterpret_cast<uintptr_t>(&map) +
- RAPIDJSON_ALIGN(sizeof(Map*)) +
- RAPIDJSON_ALIGN(sizeof(SizeType)));
- }
-
- static RAPIDJSON_FORCEINLINE MapIterator* GetMapIterators(Map* &map) {
- return reinterpret_cast<MapIterator*>(reinterpret_cast<uintptr_t>(&map) +
- RAPIDJSON_ALIGN(sizeof(Map*)) +
- RAPIDJSON_ALIGN(sizeof(SizeType)) +
- RAPIDJSON_ALIGN(GetMapCapacity(map) * sizeof(Member)));
- }
-
- static RAPIDJSON_FORCEINLINE Map* &GetMap(Member* members) {
- RAPIDJSON_ASSERT(members != 0);
- return *reinterpret_cast<Map**>(reinterpret_cast<uintptr_t>(members) -
- RAPIDJSON_ALIGN(sizeof(SizeType)) -
- RAPIDJSON_ALIGN(sizeof(Map*)));
- }
-
- // Some compilers' debug mechanisms want all iterators to be destroyed, for their accounting..
- RAPIDJSON_FORCEINLINE MapIterator DropMapIterator(MapIterator& rhs) {
-#if RAPIDJSON_HAS_CXX11
- MapIterator ret = std::move(rhs);
-#else
- MapIterator ret = rhs;
-#endif
- rhs.~MapIterator();
- return ret;
- }
-
- Map* &DoReallocMap(Map** oldMap, SizeType newCapacity, Allocator& allocator) {
- Map **newMap = static_cast<Map**>(allocator.Malloc(GetMapLayoutSize(newCapacity)));
- GetMapCapacity(*newMap) = newCapacity;
- if (!oldMap) {
- *newMap = new (allocator.Malloc(sizeof(Map))) Map(MapLess(), allocator);
- }
- else {
- *newMap = *oldMap;
- size_t count = (*oldMap)->size();
- std::memcpy(static_cast<void*>(GetMapMembers(*newMap)),
- static_cast<void*>(GetMapMembers(*oldMap)),
- count * sizeof(Member));
- MapIterator *oldIt = GetMapIterators(*oldMap),
- *newIt = GetMapIterators(*newMap);
- while (count--) {
- new (&newIt[count]) MapIterator(DropMapIterator(oldIt[count]));
- }
- Allocator::Free(oldMap);
- }
- return *newMap;
- }
-
- RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) {
- return GetMapMembers(DoReallocMap(0, capacity, allocator));
- }
-
- void DoReserveMembers(SizeType newCapacity, Allocator& allocator) {
- ObjectData& o = data_.o;
- if (newCapacity > o.capacity) {
- Member* oldMembers = GetMembersPointer();
- Map **oldMap = oldMembers ? &GetMap(oldMembers) : 0,
- *&newMap = DoReallocMap(oldMap, newCapacity, allocator);
- RAPIDJSON_SETPOINTER(Member, o.members, GetMapMembers(newMap));
- o.capacity = newCapacity;
- }
- }
-
- template <typename SourceAllocator>
- MemberIterator DoFindMember(const GenericValue<Encoding, SourceAllocator>& name) {
- if (Member* members = GetMembersPointer()) {
- Map* &map = GetMap(members);
- MapIterator mit = map->find(reinterpret_cast<const Data&>(name.data_));
- if (mit != map->end()) {
- return MemberIterator(&members[mit->second]);
- }
- }
- return MemberEnd();
- }
-
- void DoClearMembers() {
- if (Member* members = GetMembersPointer()) {
- Map* &map = GetMap(members);
- MapIterator* mit = GetMapIterators(map);
- for (SizeType i = 0; i < data_.o.size; i++) {
- map->erase(DropMapIterator(mit[i]));
- members[i].~Member();
- }
- data_.o.size = 0;
- }
- }
-
- void DoFreeMembers() {
- if (Member* members = GetMembersPointer()) {
- GetMap(members)->~Map();
- for (SizeType i = 0; i < data_.o.size; i++) {
- members[i].~Member();
- }
- if (Allocator::kNeedFree) { // Shortcut by Allocator's trait
- Map** map = &GetMap(members);
- Allocator::Free(*map);
- Allocator::Free(map);
- }
- }
- }
-
-#else // !RAPIDJSON_USE_MEMBERSMAP
-
- RAPIDJSON_FORCEINLINE Member* DoAllocMembers(SizeType capacity, Allocator& allocator) {
- return Malloc<Member>(allocator, capacity);
- }
-
- void DoReserveMembers(SizeType newCapacity, Allocator& allocator) {
- ObjectData& o = data_.o;
- if (newCapacity > o.capacity) {
- Member* newMembers = Realloc<Member>(allocator, GetMembersPointer(), o.capacity, newCapacity);
- RAPIDJSON_SETPOINTER(Member, o.members, newMembers);
- o.capacity = newCapacity;
- }
- }
-
- template <typename SourceAllocator>
- MemberIterator DoFindMember(const GenericValue<Encoding, SourceAllocator>& name) {
- MemberIterator member = MemberBegin();
- for ( ; member != MemberEnd(); ++member)
- if (name.StringEqual(member->name))
- break;
- return member;
- }
-
- void DoClearMembers() {
- for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
- m->~Member();
- data_.o.size = 0;
- }
-
- void DoFreeMembers() {
- for (MemberIterator m = MemberBegin(); m != MemberEnd(); ++m)
- m->~Member();
- Allocator::Free(GetMembersPointer());
- }
-
-#endif // !RAPIDJSON_USE_MEMBERSMAP
-
- void DoAddMember(GenericValue& name, GenericValue& value, Allocator& allocator) {
- ObjectData& o = data_.o;
- if (o.size >= o.capacity)
- DoReserveMembers(o.capacity ? (o.capacity + (o.capacity + 1) / 2) : kDefaultObjectCapacity, allocator);
- Member* members = GetMembersPointer();
- Member* m = members + o.size;
- m->name.RawAssign(name);
- m->value.RawAssign(value);
-#if RAPIDJSON_USE_MEMBERSMAP
- Map* &map = GetMap(members);
- MapIterator* mit = GetMapIterators(map);
- new (&mit[o.size]) MapIterator(map->insert(MapPair(m->name.data_, o.size)));
-#endif
- ++o.size;
- }
-
- MemberIterator DoRemoveMember(MemberIterator m) {
- ObjectData& o = data_.o;
- Member* members = GetMembersPointer();
-#if RAPIDJSON_USE_MEMBERSMAP
- Map* &map = GetMap(members);
- MapIterator* mit = GetMapIterators(map);
- SizeType mpos = static_cast<SizeType>(&*m - members);
- map->erase(DropMapIterator(mit[mpos]));
-#endif
- MemberIterator last(members + (o.size - 1));
- if (o.size > 1 && m != last) {
-#if RAPIDJSON_USE_MEMBERSMAP
- new (&mit[mpos]) MapIterator(DropMapIterator(mit[&*last - members]));
- mit[mpos]->second = mpos;
-#endif
- *m = *last; // Move the last one to this place
- }
- else {
- m->~Member(); // Only one left, just destroy
- }
- --o.size;
- return m;
- }
-
- MemberIterator DoEraseMembers(ConstMemberIterator first, ConstMemberIterator last) {
- ObjectData& o = data_.o;
- MemberIterator beg = MemberBegin(),
- pos = beg + (first - beg),
- end = MemberEnd();
-#if RAPIDJSON_USE_MEMBERSMAP
- Map* &map = GetMap(GetMembersPointer());
- MapIterator* mit = GetMapIterators(map);
-#endif
- for (MemberIterator itr = pos; itr != last; ++itr) {
-#if RAPIDJSON_USE_MEMBERSMAP
- map->erase(DropMapIterator(mit[itr - beg]));
-#endif
- itr->~Member();
- }
-#if RAPIDJSON_USE_MEMBERSMAP
- if (first != last) {
- // Move remaining members/iterators
- MemberIterator next = pos + (last - first);
- for (MemberIterator itr = pos; next != end; ++itr, ++next) {
- std::memcpy(static_cast<void*>(&*itr), &*next, sizeof(Member));
- SizeType mpos = static_cast<SizeType>(itr - beg);
- new (&mit[mpos]) MapIterator(DropMapIterator(mit[next - beg]));
- mit[mpos]->second = mpos;
- }
- }
-#else
- std::memmove(static_cast<void*>(&*pos), &*last,
- static_cast<size_t>(end - last) * sizeof(Member));
-#endif
- o.size -= static_cast<SizeType>(last - first);
- return pos;
- }
-
- template <typename SourceAllocator>
- void DoCopyMembers(const GenericValue<Encoding,SourceAllocator>& rhs, Allocator& allocator, bool copyConstStrings) {
- RAPIDJSON_ASSERT(rhs.GetType() == kObjectType);
-
- data_.f.flags = kObjectFlag;
- SizeType count = rhs.data_.o.size;
- Member* lm = DoAllocMembers(count, allocator);
- const typename GenericValue<Encoding,SourceAllocator>::Member* rm = rhs.GetMembersPointer();
-#if RAPIDJSON_USE_MEMBERSMAP
- Map* &map = GetMap(lm);
- MapIterator* mit = GetMapIterators(map);
-#endif
- for (SizeType i = 0; i < count; i++) {
- new (&lm[i].name) GenericValue(rm[i].name, allocator, copyConstStrings);
- new (&lm[i].value) GenericValue(rm[i].value, allocator, copyConstStrings);
-#if RAPIDJSON_USE_MEMBERSMAP
- new (&mit[i]) MapIterator(map->insert(MapPair(lm[i].name.data_, i)));
-#endif
- }
- data_.o.size = data_.o.capacity = count;
- SetMembersPointer(lm);
- }
-
- // Initialize this value as array with initial data, without calling destructor.
- void SetArrayRaw(GenericValue* values, SizeType count, Allocator& allocator) {
- data_.f.flags = kArrayFlag;
- if (count) {
- GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
- SetElementsPointer(e);
- std::memcpy(static_cast<void*>(e), values, count * sizeof(GenericValue));
- }
- else
- SetElementsPointer(0);
- data_.a.size = data_.a.capacity = count;
- }
-
- //! Initialize this value as object with initial data, without calling destructor.
- void SetObjectRaw(Member* members, SizeType count, Allocator& allocator) {
- data_.f.flags = kObjectFlag;
- if (count) {
- Member* m = DoAllocMembers(count, allocator);
- SetMembersPointer(m);
- std::memcpy(static_cast<void*>(m), members, count * sizeof(Member));
-#if RAPIDJSON_USE_MEMBERSMAP
- Map* &map = GetMap(m);
- MapIterator* mit = GetMapIterators(map);
- for (SizeType i = 0; i < count; i++) {
- new (&mit[i]) MapIterator(map->insert(MapPair(m[i].name.data_, i)));
- }
-#endif
- }
- else
- SetMembersPointer(0);
- data_.o.size = data_.o.capacity = count;
- }
-
- //! Initialize this value as constant string, without calling destructor.
- void SetStringRaw(StringRefType s) RAPIDJSON_NOEXCEPT {
- data_.f.flags = kConstStringFlag;
- SetStringPointer(s);
- data_.s.length = s.length;
- }
-
- //! Initialize this value as copy string with initial data, without calling destructor.
- void SetStringRaw(StringRefType s, Allocator& allocator) {
- Ch* str = 0;
- if (ShortString::Usable(s.length)) {
- data_.f.flags = kShortStringFlag;
- data_.ss.SetLength(s.length);
- str = data_.ss.str;
- } else {
- data_.f.flags = kCopyStringFlag;
- data_.s.length = s.length;
- str = static_cast<Ch *>(allocator.Malloc((s.length + 1) * sizeof(Ch)));
- SetStringPointer(str);
- }
- std::memcpy(str, s, s.length * sizeof(Ch));
- str[s.length] = '\0';
- }
-
- //! Assignment without calling destructor
- void RawAssign(GenericValue& rhs) RAPIDJSON_NOEXCEPT {
- data_ = rhs.data_;
- // data_.f.flags = rhs.data_.f.flags;
- rhs.data_.f.flags = kNullFlag;
- }
-
- template <typename SourceAllocator>
- bool StringEqual(const GenericValue<Encoding, SourceAllocator>& rhs) const {
- RAPIDJSON_ASSERT(IsString());
- RAPIDJSON_ASSERT(rhs.IsString());
-
- const SizeType len1 = GetStringLength();
- const SizeType len2 = rhs.GetStringLength();
- if(len1 != len2) { return false; }
-
- const Ch* const str1 = GetString();
- const Ch* const str2 = rhs.GetString();
- if(str1 == str2) { return true; } // fast path for constant string
-
- return (std::memcmp(str1, str2, sizeof(Ch) * len1) == 0);
- }
-
- Data data_;
-};
-
-//! GenericValue with UTF8 encoding
-typedef GenericValue<UTF8<> > Value;
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericDocument
-
-//! A document for parsing JSON text as DOM.
-/*!
- \note implements Handler concept
- \tparam Encoding Encoding for both parsing and string storage.
- \tparam Allocator Allocator for allocating memory for the DOM
- \tparam StackAllocator Allocator for allocating memory for stack during parsing.
- \warning Although GenericDocument inherits from GenericValue, the API does \b not provide any virtual functions, especially no virtual destructor. To avoid memory leaks, do not \c delete a GenericDocument object via a pointer to a GenericValue.
-*/
-template <typename Encoding, typename Allocator = RAPIDJSON_DEFAULT_ALLOCATOR, typename StackAllocator = RAPIDJSON_DEFAULT_STACK_ALLOCATOR >
-class GenericDocument : public GenericValue<Encoding, Allocator> {
-public:
- typedef typename Encoding::Ch Ch; //!< Character type derived from Encoding.
- typedef GenericValue<Encoding, Allocator> ValueType; //!< Value type of the document.
- typedef Allocator AllocatorType; //!< Allocator type from template parameter.
- typedef StackAllocator StackAllocatorType; //!< StackAllocator type from template parameter.
-
- //! Constructor
- /*! Creates an empty document of specified type.
- \param type Mandatory type of object to create.
- \param allocator Optional allocator for allocating memory.
- \param stackCapacity Optional initial capacity of stack in bytes.
- \param stackAllocator Optional allocator for allocating memory for stack.
- */
- explicit GenericDocument(Type type, Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
- GenericValue<Encoding, Allocator>(type), allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()
- {
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
- }
-
- //! Constructor
- /*! Creates an empty document which type is Null.
- \param allocator Optional allocator for allocating memory.
- \param stackCapacity Optional initial capacity of stack in bytes.
- \param stackAllocator Optional allocator for allocating memory for stack.
- */
- GenericDocument(Allocator* allocator = 0, size_t stackCapacity = kDefaultStackCapacity, StackAllocator* stackAllocator = 0) :
- allocator_(allocator), ownAllocator_(0), stack_(stackAllocator, stackCapacity), parseResult_()
- {
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move constructor in C++11
- GenericDocument(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT
- : ValueType(std::forward<ValueType>(rhs)), // explicit cast to avoid prohibited move from Document
- allocator_(rhs.allocator_),
- ownAllocator_(rhs.ownAllocator_),
- stack_(std::move(rhs.stack_)),
- parseResult_(rhs.parseResult_)
- {
- rhs.allocator_ = 0;
- rhs.ownAllocator_ = 0;
- rhs.parseResult_ = ParseResult();
- }
-#endif
-
- ~GenericDocument() {
- // Clear the ::ValueType before ownAllocator is destroyed, ~ValueType()
- // runs last and may access its elements or members which would be freed
- // with an allocator like MemoryPoolAllocator (CrtAllocator does not
- // free its data when destroyed, but MemoryPoolAllocator does).
- if (ownAllocator_) {
- ValueType::SetNull();
- }
- Destroy();
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move assignment in C++11
- GenericDocument& operator=(GenericDocument&& rhs) RAPIDJSON_NOEXCEPT
- {
- // The cast to ValueType is necessary here, because otherwise it would
- // attempt to call GenericValue's templated assignment operator.
- ValueType::operator=(std::forward<ValueType>(rhs));
-
- // Calling the destructor here would prematurely call stack_'s destructor
- Destroy();
-
- allocator_ = rhs.allocator_;
- ownAllocator_ = rhs.ownAllocator_;
- stack_ = std::move(rhs.stack_);
- parseResult_ = rhs.parseResult_;
-
- rhs.allocator_ = 0;
- rhs.ownAllocator_ = 0;
- rhs.parseResult_ = ParseResult();
-
- return *this;
- }
-#endif
-
- //! Exchange the contents of this document with those of another.
- /*!
- \param rhs Another document.
- \note Constant complexity.
- \see GenericValue::Swap
- */
- GenericDocument& Swap(GenericDocument& rhs) RAPIDJSON_NOEXCEPT {
- ValueType::Swap(rhs);
- stack_.Swap(rhs.stack_);
- internal::Swap(allocator_, rhs.allocator_);
- internal::Swap(ownAllocator_, rhs.ownAllocator_);
- internal::Swap(parseResult_, rhs.parseResult_);
- return *this;
- }
-
- // Allow Swap with ValueType.
- // Refer to Effective C++ 3rd Edition/Item 33: Avoid hiding inherited names.
- using ValueType::Swap;
-
- //! free-standing swap function helper
- /*!
- Helper function to enable support for common swap implementation pattern based on \c std::swap:
- \code
- void swap(MyClass& a, MyClass& b) {
- using std::swap;
- swap(a.doc, b.doc);
- // ...
- }
- \endcode
- \see Swap()
- */
- friend inline void swap(GenericDocument& a, GenericDocument& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
-
- //! Populate this document by a generator which produces SAX events.
- /*! \tparam Generator A functor with <tt>bool f(Handler)</tt> prototype.
- \param g Generator functor which sends SAX events to the parameter.
- \return The document itself for fluent API.
- */
- template <typename Generator>
- GenericDocument& Populate(Generator& g) {
- ClearStackOnExit scope(*this);
- if (g(*this)) {
- RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object
- ValueType::operator=(*stack_.template Pop<ValueType>(1));// Move value from stack to document
- }
- return *this;
- }
-
- //!@name Parse from stream
- //!@{
-
- //! Parse JSON text from an input stream (with Encoding conversion)
- /*! \tparam parseFlags Combination of \ref ParseFlag.
- \tparam SourceEncoding Encoding of input stream
- \tparam InputStream Type of input stream, implementing Stream concept
- \param is Input stream to be parsed.
- \return The document itself for fluent API.
- */
- template <unsigned parseFlags, typename SourceEncoding, typename InputStream>
- GenericDocument& ParseStream(InputStream& is) {
- GenericReader<SourceEncoding, Encoding, StackAllocator> reader(
- stack_.HasAllocator() ? &stack_.GetAllocator() : 0);
- ClearStackOnExit scope(*this);
- parseResult_ = reader.template Parse<parseFlags>(is, *this);
- if (parseResult_) {
- RAPIDJSON_ASSERT(stack_.GetSize() == sizeof(ValueType)); // Got one and only one root object
- ValueType::operator=(*stack_.template Pop<ValueType>(1));// Move value from stack to document
- }
- return *this;
- }
-
- //! Parse JSON text from an input stream
- /*! \tparam parseFlags Combination of \ref ParseFlag.
- \tparam InputStream Type of input stream, implementing Stream concept
- \param is Input stream to be parsed.
- \return The document itself for fluent API.
- */
- template <unsigned parseFlags, typename InputStream>
- GenericDocument& ParseStream(InputStream& is) {
- return ParseStream<parseFlags, Encoding, InputStream>(is);
- }
-
- //! Parse JSON text from an input stream (with \ref kParseDefaultFlags)
- /*! \tparam InputStream Type of input stream, implementing Stream concept
- \param is Input stream to be parsed.
- \return The document itself for fluent API.
- */
- template <typename InputStream>
- GenericDocument& ParseStream(InputStream& is) {
- return ParseStream<kParseDefaultFlags, Encoding, InputStream>(is);
- }
- //!@}
-
- //!@name Parse in-place from mutable string
- //!@{
-
- //! Parse JSON text from a mutable string
- /*! \tparam parseFlags Combination of \ref ParseFlag.
- \param str Mutable zero-terminated string to be parsed.
- \return The document itself for fluent API.
- */
- template <unsigned parseFlags>
- GenericDocument& ParseInsitu(Ch* str) {
- GenericInsituStringStream<Encoding> s(str);
- return ParseStream<parseFlags | kParseInsituFlag>(s);
- }
-
- //! Parse JSON text from a mutable string (with \ref kParseDefaultFlags)
- /*! \param str Mutable zero-terminated string to be parsed.
- \return The document itself for fluent API.
- */
- GenericDocument& ParseInsitu(Ch* str) {
- return ParseInsitu<kParseDefaultFlags>(str);
- }
- //!@}
-
- //!@name Parse from read-only string
- //!@{
-
- //! Parse JSON text from a read-only string (with Encoding conversion)
- /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag).
- \tparam SourceEncoding Transcoding from input Encoding
- \param str Read-only zero-terminated string to be parsed.
- */
- template <unsigned parseFlags, typename SourceEncoding>
- GenericDocument& Parse(const typename SourceEncoding::Ch* str) {
- RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));
- GenericStringStream<SourceEncoding> s(str);
- return ParseStream<parseFlags, SourceEncoding>(s);
- }
-
- //! Parse JSON text from a read-only string
- /*! \tparam parseFlags Combination of \ref ParseFlag (must not contain \ref kParseInsituFlag).
- \param str Read-only zero-terminated string to be parsed.
- */
- template <unsigned parseFlags>
- GenericDocument& Parse(const Ch* str) {
- return Parse<parseFlags, Encoding>(str);
- }
-
- //! Parse JSON text from a read-only string (with \ref kParseDefaultFlags)
- /*! \param str Read-only zero-terminated string to be parsed.
- */
- GenericDocument& Parse(const Ch* str) {
- return Parse<kParseDefaultFlags>(str);
- }
-
- template <unsigned parseFlags, typename SourceEncoding>
- GenericDocument& Parse(const typename SourceEncoding::Ch* str, size_t length) {
- RAPIDJSON_ASSERT(!(parseFlags & kParseInsituFlag));
- MemoryStream ms(reinterpret_cast<const char*>(str), length * sizeof(typename SourceEncoding::Ch));
- EncodedInputStream<SourceEncoding, MemoryStream> is(ms);
- ParseStream<parseFlags, SourceEncoding>(is);
- return *this;
- }
-
- template <unsigned parseFlags>
- GenericDocument& Parse(const Ch* str, size_t length) {
- return Parse<parseFlags, Encoding>(str, length);
- }
-
- GenericDocument& Parse(const Ch* str, size_t length) {
- return Parse<kParseDefaultFlags>(str, length);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- template <unsigned parseFlags, typename SourceEncoding>
- GenericDocument& Parse(const std::basic_string<typename SourceEncoding::Ch>& str) {
- // c_str() is constant complexity according to standard. Should be faster than Parse(const char*, size_t)
- return Parse<parseFlags, SourceEncoding>(str.c_str());
- }
-
- template <unsigned parseFlags>
- GenericDocument& Parse(const std::basic_string<Ch>& str) {
- return Parse<parseFlags, Encoding>(str.c_str());
- }
-
- GenericDocument& Parse(const std::basic_string<Ch>& str) {
- return Parse<kParseDefaultFlags>(str);
- }
-#endif // RAPIDJSON_HAS_STDSTRING
-
- //!@}
-
- //!@name Handling parse errors
- //!@{
-
- //! Whether a parse error has occurred in the last parsing.
- bool HasParseError() const { return parseResult_.IsError(); }
-
- //! Get the \ref ParseErrorCode of last parsing.
- ParseErrorCode GetParseError() const { return parseResult_.Code(); }
-
- //! Get the position of last parsing error in input, 0 otherwise.
- size_t GetErrorOffset() const { return parseResult_.Offset(); }
-
- //! Implicit conversion to get the last parse result
-#ifndef __clang // -Wdocumentation
- /*! \return \ref ParseResult of the last parse operation
-
- \code
- Document doc;
- ParseResult ok = doc.Parse(json);
- if (!ok)
- printf( "JSON parse error: %s (%u)\n", GetParseError_En(ok.Code()), ok.Offset());
- \endcode
- */
-#endif
- operator ParseResult() const { return parseResult_; }
- //!@}
-
- //! Get the allocator of this document.
- Allocator& GetAllocator() {
- RAPIDJSON_ASSERT(allocator_);
- return *allocator_;
- }
-
- //! Get the capacity of stack in bytes.
- size_t GetStackCapacity() const { return stack_.GetCapacity(); }
-
-private:
- // clear stack on any exit from ParseStream, e.g. due to exception
- struct ClearStackOnExit {
- explicit ClearStackOnExit(GenericDocument& d) : d_(d) {}
- ~ClearStackOnExit() { d_.ClearStack(); }
- private:
- ClearStackOnExit(const ClearStackOnExit&);
- ClearStackOnExit& operator=(const ClearStackOnExit&);
- GenericDocument& d_;
- };
-
- // callers of the following private Handler functions
- // template <typename,typename,typename> friend class GenericReader; // for parsing
- template <typename, typename> friend class GenericValue; // for deep copying
-
-public:
- // Implementation of Handler
- bool Null() { new (stack_.template Push<ValueType>()) ValueType(); return true; }
- bool Bool(bool b) { new (stack_.template Push<ValueType>()) ValueType(b); return true; }
- bool Int(int i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
- bool Uint(unsigned i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
- bool Int64(int64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
- bool Uint64(uint64_t i) { new (stack_.template Push<ValueType>()) ValueType(i); return true; }
- bool Double(double d) { new (stack_.template Push<ValueType>()) ValueType(d); return true; }
-
- bool RawNumber(const Ch* str, SizeType length, bool copy) {
- if (copy)
- new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());
- else
- new (stack_.template Push<ValueType>()) ValueType(str, length);
- return true;
- }
-
- bool String(const Ch* str, SizeType length, bool copy) {
- if (copy)
- new (stack_.template Push<ValueType>()) ValueType(str, length, GetAllocator());
- else
- new (stack_.template Push<ValueType>()) ValueType(str, length);
- return true;
- }
-
- bool StartObject() { new (stack_.template Push<ValueType>()) ValueType(kObjectType); return true; }
-
- bool Key(const Ch* str, SizeType length, bool copy) { return String(str, length, copy); }
-
- bool EndObject(SizeType memberCount) {
- typename ValueType::Member* members = stack_.template Pop<typename ValueType::Member>(memberCount);
- stack_.template Top<ValueType>()->SetObjectRaw(members, memberCount, GetAllocator());
- return true;
- }
-
- bool StartArray() { new (stack_.template Push<ValueType>()) ValueType(kArrayType); return true; }
-
- bool EndArray(SizeType elementCount) {
- ValueType* elements = stack_.template Pop<ValueType>(elementCount);
- stack_.template Top<ValueType>()->SetArrayRaw(elements, elementCount, GetAllocator());
- return true;
- }
-
-private:
- //! Prohibit copying
- GenericDocument(const GenericDocument&);
- //! Prohibit assignment
- GenericDocument& operator=(const GenericDocument&);
-
- void ClearStack() {
- if (Allocator::kNeedFree)
- while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects)
- (stack_.template Pop<ValueType>(1))->~ValueType();
- else
- stack_.Clear();
- stack_.ShrinkToFit();
- }
-
- void Destroy() {
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- static const size_t kDefaultStackCapacity = 1024;
- Allocator* allocator_;
- Allocator* ownAllocator_;
- internal::Stack<StackAllocator> stack_;
- ParseResult parseResult_;
-};
-
-//! GenericDocument with UTF8 encoding
-typedef GenericDocument<UTF8<> > Document;
-
-
-//! Helper class for accessing Value of array type.
-/*!
- Instance of this helper class is obtained by \c GenericValue::GetArray().
- In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1.
-*/
-template <bool Const, typename ValueT>
-class GenericArray {
-public:
- typedef GenericArray<true, ValueT> ConstArray;
- typedef GenericArray<false, ValueT> Array;
- typedef ValueT PlainType;
- typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
- typedef ValueType* ValueIterator; // This may be const or non-const iterator
- typedef const ValueT* ConstValueIterator;
- typedef typename ValueType::AllocatorType AllocatorType;
- typedef typename ValueType::StringRefType StringRefType;
-
- template <typename, typename>
- friend class GenericValue;
-
- GenericArray(const GenericArray& rhs) : value_(rhs.value_) {}
- GenericArray& operator=(const GenericArray& rhs) { value_ = rhs.value_; return *this; }
- ~GenericArray() {}
-
- operator ValueType&() const { return value_; }
- SizeType Size() const { return value_.Size(); }
- SizeType Capacity() const { return value_.Capacity(); }
- bool Empty() const { return value_.Empty(); }
- void Clear() const { value_.Clear(); }
- ValueType& operator[](SizeType index) const { return value_[index]; }
- ValueIterator Begin() const { return value_.Begin(); }
- ValueIterator End() const { return value_.End(); }
- GenericArray Reserve(SizeType newCapacity, AllocatorType &allocator) const { value_.Reserve(newCapacity, allocator); return *this; }
- GenericArray PushBack(ValueType& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; }
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericArray PushBack(ValueType&& value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; }
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericArray PushBack(StringRefType value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; }
- template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (const GenericArray&)) PushBack(T value, AllocatorType& allocator) const { value_.PushBack(value, allocator); return *this; }
- GenericArray PopBack() const { value_.PopBack(); return *this; }
- ValueIterator Erase(ConstValueIterator pos) const { return value_.Erase(pos); }
- ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) const { return value_.Erase(first, last); }
-
-#if RAPIDJSON_HAS_CXX11_RANGE_FOR
- ValueIterator begin() const { return value_.Begin(); }
- ValueIterator end() const { return value_.End(); }
-#endif
-
-private:
- GenericArray();
- GenericArray(ValueType& value) : value_(value) {}
- ValueType& value_;
-};
-
-//! Helper class for accessing Value of object type.
-/*!
- Instance of this helper class is obtained by \c GenericValue::GetObject().
- In addition to all APIs for array type, it provides range-based for loop if \c RAPIDJSON_HAS_CXX11_RANGE_FOR=1.
-*/
-template <bool Const, typename ValueT>
-class GenericObject {
-public:
- typedef GenericObject<true, ValueT> ConstObject;
- typedef GenericObject<false, ValueT> Object;
- typedef ValueT PlainType;
- typedef typename internal::MaybeAddConst<Const,PlainType>::Type ValueType;
- typedef GenericMemberIterator<Const, typename ValueT::EncodingType, typename ValueT::AllocatorType> MemberIterator; // This may be const or non-const iterator
- typedef GenericMemberIterator<true, typename ValueT::EncodingType, typename ValueT::AllocatorType> ConstMemberIterator;
- typedef typename ValueType::AllocatorType AllocatorType;
- typedef typename ValueType::StringRefType StringRefType;
- typedef typename ValueType::EncodingType EncodingType;
- typedef typename ValueType::Ch Ch;
-
- template <typename, typename>
- friend class GenericValue;
-
- GenericObject(const GenericObject& rhs) : value_(rhs.value_) {}
- GenericObject& operator=(const GenericObject& rhs) { value_ = rhs.value_; return *this; }
- ~GenericObject() {}
-
- operator ValueType&() const { return value_; }
- SizeType MemberCount() const { return value_.MemberCount(); }
- SizeType MemberCapacity() const { return value_.MemberCapacity(); }
- bool ObjectEmpty() const { return value_.ObjectEmpty(); }
- template <typename T> ValueType& operator[](T* name) const { return value_[name]; }
- template <typename SourceAllocator> ValueType& operator[](const GenericValue<EncodingType, SourceAllocator>& name) const { return value_[name]; }
-#if RAPIDJSON_HAS_STDSTRING
- ValueType& operator[](const std::basic_string<Ch>& name) const { return value_[name]; }
-#endif
- MemberIterator MemberBegin() const { return value_.MemberBegin(); }
- MemberIterator MemberEnd() const { return value_.MemberEnd(); }
- GenericObject MemberReserve(SizeType newCapacity, AllocatorType &allocator) const { value_.MemberReserve(newCapacity, allocator); return *this; }
- bool HasMember(const Ch* name) const { return value_.HasMember(name); }
-#if RAPIDJSON_HAS_STDSTRING
- bool HasMember(const std::basic_string<Ch>& name) const { return value_.HasMember(name); }
-#endif
- template <typename SourceAllocator> bool HasMember(const GenericValue<EncodingType, SourceAllocator>& name) const { return value_.HasMember(name); }
- MemberIterator FindMember(const Ch* name) const { return value_.FindMember(name); }
- template <typename SourceAllocator> MemberIterator FindMember(const GenericValue<EncodingType, SourceAllocator>& name) const { return value_.FindMember(name); }
-#if RAPIDJSON_HAS_STDSTRING
- MemberIterator FindMember(const std::basic_string<Ch>& name) const { return value_.FindMember(name); }
-#endif
- GenericObject AddMember(ValueType& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- GenericObject AddMember(ValueType& name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
-#if RAPIDJSON_HAS_STDSTRING
- GenericObject AddMember(ValueType& name, std::basic_string<Ch>& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
-#endif
- template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&)) AddMember(ValueType& name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericObject AddMember(ValueType&& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- GenericObject AddMember(ValueType&& name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- GenericObject AddMember(ValueType& name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- GenericObject AddMember(StringRefType name, ValueType&& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericObject AddMember(StringRefType name, ValueType& value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- GenericObject AddMember(StringRefType name, StringRefType value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- template <typename T> RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (GenericObject)) AddMember(StringRefType name, T value, AllocatorType& allocator) const { value_.AddMember(name, value, allocator); return *this; }
- void RemoveAllMembers() { value_.RemoveAllMembers(); }
- bool RemoveMember(const Ch* name) const { return value_.RemoveMember(name); }
-#if RAPIDJSON_HAS_STDSTRING
- bool RemoveMember(const std::basic_string<Ch>& name) const { return value_.RemoveMember(name); }
-#endif
- template <typename SourceAllocator> bool RemoveMember(const GenericValue<EncodingType, SourceAllocator>& name) const { return value_.RemoveMember(name); }
- MemberIterator RemoveMember(MemberIterator m) const { return value_.RemoveMember(m); }
- MemberIterator EraseMember(ConstMemberIterator pos) const { return value_.EraseMember(pos); }
- MemberIterator EraseMember(ConstMemberIterator first, ConstMemberIterator last) const { return value_.EraseMember(first, last); }
- bool EraseMember(const Ch* name) const { return value_.EraseMember(name); }
-#if RAPIDJSON_HAS_STDSTRING
- bool EraseMember(const std::basic_string<Ch>& name) const { return EraseMember(ValueType(StringRef(name))); }
-#endif
- template <typename SourceAllocator> bool EraseMember(const GenericValue<EncodingType, SourceAllocator>& name) const { return value_.EraseMember(name); }
-
-#if RAPIDJSON_HAS_CXX11_RANGE_FOR
- MemberIterator begin() const { return value_.MemberBegin(); }
- MemberIterator end() const { return value_.MemberEnd(); }
-#endif
-
-private:
- GenericObject();
- GenericObject(ValueType& value) : value_(value) {}
- ValueType& value_;
-};
-
-RAPIDJSON_NAMESPACE_END
-RAPIDJSON_DIAG_POP
-
-#ifdef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED
-#pragma pop_macro("GetObject")
-#undef RAPIDJSON_WINDOWS_GETOBJECT_WORKAROUND_APPLIED
-#endif
-
-#endif // RAPIDJSON_DOCUMENT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodedstream.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodedstream.h
deleted file mode 100644
index 309499dc6b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodedstream.h
+++ /dev/null
@@ -1,299 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ENCODEDSTREAM_H_
-#define RAPIDJSON_ENCODEDSTREAM_H_
-
-#include "stream.h"
-#include "memorystream.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Input byte stream wrapper with a statically bound encoding.
-/*!
- \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
- \tparam InputByteStream Type of input byte stream. For example, FileReadStream.
-*/
-template <typename Encoding, typename InputByteStream>
-class EncodedInputStream {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
-public:
- typedef typename Encoding::Ch Ch;
-
- EncodedInputStream(InputByteStream& is) : is_(is) {
- current_ = Encoding::TakeBOM(is_);
- }
-
- Ch Peek() const { return current_; }
- Ch Take() { Ch c = current_; current_ = Encoding::Take(is_); return c; }
- size_t Tell() const { return is_.Tell(); }
-
- // Not implemented
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- EncodedInputStream(const EncodedInputStream&);
- EncodedInputStream& operator=(const EncodedInputStream&);
-
- InputByteStream& is_;
- Ch current_;
-};
-
-//! Specialized for UTF8 MemoryStream.
-template <>
-class EncodedInputStream<UTF8<>, MemoryStream> {
-public:
- typedef UTF8<>::Ch Ch;
-
- EncodedInputStream(MemoryStream& is) : is_(is) {
- if (static_cast<unsigned char>(is_.Peek()) == 0xEFu) is_.Take();
- if (static_cast<unsigned char>(is_.Peek()) == 0xBBu) is_.Take();
- if (static_cast<unsigned char>(is_.Peek()) == 0xBFu) is_.Take();
- }
- Ch Peek() const { return is_.Peek(); }
- Ch Take() { return is_.Take(); }
- size_t Tell() const { return is_.Tell(); }
-
- // Not implemented
- void Put(Ch) {}
- void Flush() {}
- Ch* PutBegin() { return 0; }
- size_t PutEnd(Ch*) { return 0; }
-
- MemoryStream& is_;
-
-private:
- EncodedInputStream(const EncodedInputStream&);
- EncodedInputStream& operator=(const EncodedInputStream&);
-};
-
-//! Output byte stream wrapper with statically bound encoding.
-/*!
- \tparam Encoding The interpretation of encoding of the stream. Either UTF8, UTF16LE, UTF16BE, UTF32LE, UTF32BE.
- \tparam OutputByteStream Type of input byte stream. For example, FileWriteStream.
-*/
-template <typename Encoding, typename OutputByteStream>
-class EncodedOutputStream {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
-public:
- typedef typename Encoding::Ch Ch;
-
- EncodedOutputStream(OutputByteStream& os, bool putBOM = true) : os_(os) {
- if (putBOM)
- Encoding::PutBOM(os_);
- }
-
- void Put(Ch c) { Encoding::Put(os_, c); }
- void Flush() { os_.Flush(); }
-
- // Not implemented
- Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
- Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
- size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- EncodedOutputStream(const EncodedOutputStream&);
- EncodedOutputStream& operator=(const EncodedOutputStream&);
-
- OutputByteStream& os_;
-};
-
-#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
-
-//! Input stream wrapper with dynamically bound encoding and automatic encoding detection.
-/*!
- \tparam CharType Type of character for reading.
- \tparam InputByteStream type of input byte stream to be wrapped.
-*/
-template <typename CharType, typename InputByteStream>
-class AutoUTFInputStream {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
-public:
- typedef CharType Ch;
-
- //! Constructor.
- /*!
- \param is input stream to be wrapped.
- \param type UTF encoding type if it is not detected from the stream.
- */
- AutoUTFInputStream(InputByteStream& is, UTFType type = kUTF8) : is_(&is), type_(type), hasBOM_(false) {
- RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
- DetectType();
- static const TakeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Take) };
- takeFunc_ = f[type_];
- current_ = takeFunc_(*is_);
- }
-
- UTFType GetType() const { return type_; }
- bool HasBOM() const { return hasBOM_; }
-
- Ch Peek() const { return current_; }
- Ch Take() { Ch c = current_; current_ = takeFunc_(*is_); return c; }
- size_t Tell() const { return is_->Tell(); }
-
- // Not implemented
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- AutoUTFInputStream(const AutoUTFInputStream&);
- AutoUTFInputStream& operator=(const AutoUTFInputStream&);
-
- // Detect encoding type with BOM or RFC 4627
- void DetectType() {
- // BOM (Byte Order Mark):
- // 00 00 FE FF UTF-32BE
- // FF FE 00 00 UTF-32LE
- // FE FF UTF-16BE
- // FF FE UTF-16LE
- // EF BB BF UTF-8
-
- const unsigned char* c = reinterpret_cast<const unsigned char *>(is_->Peek4());
- if (!c)
- return;
-
- unsigned bom = static_cast<unsigned>(c[0] | (c[1] << 8) | (c[2] << 16) | (c[3] << 24));
- hasBOM_ = false;
- if (bom == 0xFFFE0000) { type_ = kUTF32BE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
- else if (bom == 0x0000FEFF) { type_ = kUTF32LE; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); is_->Take(); }
- else if ((bom & 0xFFFF) == 0xFFFE) { type_ = kUTF16BE; hasBOM_ = true; is_->Take(); is_->Take(); }
- else if ((bom & 0xFFFF) == 0xFEFF) { type_ = kUTF16LE; hasBOM_ = true; is_->Take(); is_->Take(); }
- else if ((bom & 0xFFFFFF) == 0xBFBBEF) { type_ = kUTF8; hasBOM_ = true; is_->Take(); is_->Take(); is_->Take(); }
-
- // RFC 4627: Section 3
- // "Since the first two characters of a JSON text will always be ASCII
- // characters [RFC0020], it is possible to determine whether an octet
- // stream is UTF-8, UTF-16 (BE or LE), or UTF-32 (BE or LE) by looking
- // at the pattern of nulls in the first four octets."
- // 00 00 00 xx UTF-32BE
- // 00 xx 00 xx UTF-16BE
- // xx 00 00 00 UTF-32LE
- // xx 00 xx 00 UTF-16LE
- // xx xx xx xx UTF-8
-
- if (!hasBOM_) {
- int pattern = (c[0] ? 1 : 0) | (c[1] ? 2 : 0) | (c[2] ? 4 : 0) | (c[3] ? 8 : 0);
- switch (pattern) {
- case 0x08: type_ = kUTF32BE; break;
- case 0x0A: type_ = kUTF16BE; break;
- case 0x01: type_ = kUTF32LE; break;
- case 0x05: type_ = kUTF16LE; break;
- case 0x0F: type_ = kUTF8; break;
- default: break; // Use type defined by user.
- }
- }
-
- // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
- if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
- if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
- }
-
- typedef Ch (*TakeFunc)(InputByteStream& is);
- InputByteStream* is_;
- UTFType type_;
- Ch current_;
- TakeFunc takeFunc_;
- bool hasBOM_;
-};
-
-//! Output stream wrapper with dynamically bound encoding and automatic encoding detection.
-/*!
- \tparam CharType Type of character for writing.
- \tparam OutputByteStream type of output byte stream to be wrapped.
-*/
-template <typename CharType, typename OutputByteStream>
-class AutoUTFOutputStream {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
-public:
- typedef CharType Ch;
-
- //! Constructor.
- /*!
- \param os output stream to be wrapped.
- \param type UTF encoding type.
- \param putBOM Whether to write BOM at the beginning of the stream.
- */
- AutoUTFOutputStream(OutputByteStream& os, UTFType type, bool putBOM) : os_(&os), type_(type) {
- RAPIDJSON_ASSERT(type >= kUTF8 && type <= kUTF32BE);
-
- // Runtime check whether the size of character type is sufficient. It only perform checks with assertion.
- if (type_ == kUTF16LE || type_ == kUTF16BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 2);
- if (type_ == kUTF32LE || type_ == kUTF32BE) RAPIDJSON_ASSERT(sizeof(Ch) >= 4);
-
- static const PutFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Put) };
- putFunc_ = f[type_];
-
- if (putBOM)
- PutBOM();
- }
-
- UTFType GetType() const { return type_; }
-
- void Put(Ch c) { putFunc_(*os_, c); }
- void Flush() { os_->Flush(); }
-
- // Not implemented
- Ch Peek() const { RAPIDJSON_ASSERT(false); return 0;}
- Ch Take() { RAPIDJSON_ASSERT(false); return 0;}
- size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- AutoUTFOutputStream(const AutoUTFOutputStream&);
- AutoUTFOutputStream& operator=(const AutoUTFOutputStream&);
-
- void PutBOM() {
- typedef void (*PutBOMFunc)(OutputByteStream&);
- static const PutBOMFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(PutBOM) };
- f[type_](*os_);
- }
-
- typedef void (*PutFunc)(OutputByteStream&, Ch);
-
- OutputByteStream* os_;
- UTFType type_;
- PutFunc putFunc_;
-};
-
-#undef RAPIDJSON_ENCODINGS_FUNC
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodings.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodings.h
deleted file mode 100644
index f9f1ed181e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/encodings.h
+++ /dev/null
@@ -1,716 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ENCODINGS_H_
-#define RAPIDJSON_ENCODINGS_H_
-
-#include "rapidjson.h"
-
-#if defined(_MSC_VER) && !defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4244) // conversion from 'type1' to 'type2', possible loss of data
-RAPIDJSON_DIAG_OFF(4702) // unreachable code
-#elif defined(__GNUC__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-RAPIDJSON_DIAG_OFF(overflow)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// Encoding
-
-/*! \class rapidjson::Encoding
- \brief Concept for encoding of Unicode characters.
-
-\code
-concept Encoding {
- typename Ch; //! Type of character. A "character" is actually a code unit in unicode's definition.
-
- enum { supportUnicode = 1 }; // or 0 if not supporting unicode
-
- //! \brief Encode a Unicode codepoint to an output stream.
- //! \param os Output stream.
- //! \param codepoint An unicode codepoint, ranging from 0x0 to 0x10FFFF inclusively.
- template<typename OutputStream>
- static void Encode(OutputStream& os, unsigned codepoint);
-
- //! \brief Decode a Unicode codepoint from an input stream.
- //! \param is Input stream.
- //! \param codepoint Output of the unicode codepoint.
- //! \return true if a valid codepoint can be decoded from the stream.
- template <typename InputStream>
- static bool Decode(InputStream& is, unsigned* codepoint);
-
- //! \brief Validate one Unicode codepoint from an encoded stream.
- //! \param is Input stream to obtain codepoint.
- //! \param os Output for copying one codepoint.
- //! \return true if it is valid.
- //! \note This function just validating and copying the codepoint without actually decode it.
- template <typename InputStream, typename OutputStream>
- static bool Validate(InputStream& is, OutputStream& os);
-
- // The following functions are deal with byte streams.
-
- //! Take a character from input byte stream, skip BOM if exist.
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is);
-
- //! Take a character from input byte stream.
- template <typename InputByteStream>
- static Ch Take(InputByteStream& is);
-
- //! Put BOM to output byte stream.
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os);
-
- //! Put a character to output byte stream.
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, Ch c);
-};
-\endcode
-*/
-
-///////////////////////////////////////////////////////////////////////////////
-// UTF8
-
-//! UTF-8 encoding.
-/*! http://en.wikipedia.org/wiki/UTF-8
- http://tools.ietf.org/html/rfc3629
- \tparam CharType Code unit for storing 8-bit UTF-8 data. Default is char.
- \note implements Encoding concept
-*/
-template<typename CharType = char>
-struct UTF8 {
- typedef CharType Ch;
-
- enum { supportUnicode = 1 };
-
- template<typename OutputStream>
- static void Encode(OutputStream& os, unsigned codepoint) {
- if (codepoint <= 0x7F)
- os.Put(static_cast<Ch>(codepoint & 0xFF));
- else if (codepoint <= 0x7FF) {
- os.Put(static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
- os.Put(static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
- }
- else if (codepoint <= 0xFFFF) {
- os.Put(static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
- os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
- os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
- }
- else {
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- os.Put(static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
- os.Put(static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
- os.Put(static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
- os.Put(static_cast<Ch>(0x80 | (codepoint & 0x3F)));
- }
- }
-
- template<typename OutputStream>
- static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
- if (codepoint <= 0x7F)
- PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
- else if (codepoint <= 0x7FF) {
- PutUnsafe(os, static_cast<Ch>(0xC0 | ((codepoint >> 6) & 0xFF)));
- PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint & 0x3F))));
- }
- else if (codepoint <= 0xFFFF) {
- PutUnsafe(os, static_cast<Ch>(0xE0 | ((codepoint >> 12) & 0xFF)));
- PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
- PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
- }
- else {
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- PutUnsafe(os, static_cast<Ch>(0xF0 | ((codepoint >> 18) & 0xFF)));
- PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 12) & 0x3F)));
- PutUnsafe(os, static_cast<Ch>(0x80 | ((codepoint >> 6) & 0x3F)));
- PutUnsafe(os, static_cast<Ch>(0x80 | (codepoint & 0x3F)));
- }
- }
-
- template <typename InputStream>
- static bool Decode(InputStream& is, unsigned* codepoint) {
-#define RAPIDJSON_COPY() c = is.Take(); *codepoint = (*codepoint << 6) | (static_cast<unsigned char>(c) & 0x3Fu)
-#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
-#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70)
- typename InputStream::Ch c = is.Take();
- if (!(c & 0x80)) {
- *codepoint = static_cast<unsigned char>(c);
- return true;
- }
-
- unsigned char type = GetRange(static_cast<unsigned char>(c));
- if (type >= 32) {
- *codepoint = 0;
- } else {
- *codepoint = (0xFFu >> type) & static_cast<unsigned char>(c);
- }
- bool result = true;
- switch (type) {
- case 2: RAPIDJSON_TAIL(); return result;
- case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result;
- case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result;
- case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- default: return false;
- }
-#undef RAPIDJSON_COPY
-#undef RAPIDJSON_TRANS
-#undef RAPIDJSON_TAIL
- }
-
- template <typename InputStream, typename OutputStream>
- static bool Validate(InputStream& is, OutputStream& os) {
-#define RAPIDJSON_COPY() os.Put(c = is.Take())
-#define RAPIDJSON_TRANS(mask) result &= ((GetRange(static_cast<unsigned char>(c)) & mask) != 0)
-#define RAPIDJSON_TAIL() RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x70)
- Ch c;
- RAPIDJSON_COPY();
- if (!(c & 0x80))
- return true;
-
- bool result = true;
- switch (GetRange(static_cast<unsigned char>(c))) {
- case 2: RAPIDJSON_TAIL(); return result;
- case 3: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 4: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x50); RAPIDJSON_TAIL(); return result;
- case 5: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x10); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 6: RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- case 10: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x20); RAPIDJSON_TAIL(); return result;
- case 11: RAPIDJSON_COPY(); RAPIDJSON_TRANS(0x60); RAPIDJSON_TAIL(); RAPIDJSON_TAIL(); return result;
- default: return false;
- }
-#undef RAPIDJSON_COPY
-#undef RAPIDJSON_TRANS
-#undef RAPIDJSON_TAIL
- }
-
- static unsigned char GetRange(unsigned char c) {
- // Referring to DFA of http://bjoern.hoehrmann.de/utf-8/decoder/dfa/
- // With new mapping 1 -> 0x10, 7 -> 0x20, 9 -> 0x40, such that AND operation can test multiple types.
- static const unsigned char type[] = {
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
- 0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x40,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,
- 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
- };
- return type[c];
- }
-
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- typename InputByteStream::Ch c = Take(is);
- if (static_cast<unsigned char>(c) != 0xEFu) return c;
- c = is.Take();
- if (static_cast<unsigned char>(c) != 0xBBu) return c;
- c = is.Take();
- if (static_cast<unsigned char>(c) != 0xBFu) return c;
- c = is.Take();
- return c;
- }
-
- template <typename InputByteStream>
- static Ch Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- return static_cast<Ch>(is.Take());
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(0xEFu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xBBu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xBFu));
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, Ch c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(c));
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// UTF16
-
-//! UTF-16 encoding.
-/*! http://en.wikipedia.org/wiki/UTF-16
- http://tools.ietf.org/html/rfc2781
- \tparam CharType Type for storing 16-bit UTF-16 data. Default is wchar_t. C++11 may use char16_t instead.
- \note implements Encoding concept
-
- \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
- For streaming, use UTF16LE and UTF16BE, which handle endianness.
-*/
-template<typename CharType = wchar_t>
-struct UTF16 {
- typedef CharType Ch;
- RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 2);
-
- enum { supportUnicode = 1 };
-
- template<typename OutputStream>
- static void Encode(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
- if (codepoint <= 0xFFFF) {
- RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
- os.Put(static_cast<typename OutputStream::Ch>(codepoint));
- }
- else {
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- unsigned v = codepoint - 0x10000;
- os.Put(static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
- os.Put(static_cast<typename OutputStream::Ch>((v & 0x3FF) | 0xDC00));
- }
- }
-
-
- template<typename OutputStream>
- static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
- if (codepoint <= 0xFFFF) {
- RAPIDJSON_ASSERT(codepoint < 0xD800 || codepoint > 0xDFFF); // Code point itself cannot be surrogate pair
- PutUnsafe(os, static_cast<typename OutputStream::Ch>(codepoint));
- }
- else {
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- unsigned v = codepoint - 0x10000;
- PutUnsafe(os, static_cast<typename OutputStream::Ch>((v >> 10) | 0xD800));
- PutUnsafe(os, static_cast<typename OutputStream::Ch>((v & 0x3FF) | 0xDC00));
- }
- }
-
- template <typename InputStream>
- static bool Decode(InputStream& is, unsigned* codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
- typename InputStream::Ch c = is.Take();
- if (c < 0xD800 || c > 0xDFFF) {
- *codepoint = static_cast<unsigned>(c);
- return true;
- }
- else if (c <= 0xDBFF) {
- *codepoint = (static_cast<unsigned>(c) & 0x3FF) << 10;
- c = is.Take();
- *codepoint |= (static_cast<unsigned>(c) & 0x3FF);
- *codepoint += 0x10000;
- return c >= 0xDC00 && c <= 0xDFFF;
- }
- return false;
- }
-
- template <typename InputStream, typename OutputStream>
- static bool Validate(InputStream& is, OutputStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 2);
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 2);
- typename InputStream::Ch c;
- os.Put(static_cast<typename OutputStream::Ch>(c = is.Take()));
- if (c < 0xD800 || c > 0xDFFF)
- return true;
- else if (c <= 0xDBFF) {
- os.Put(c = is.Take());
- return c >= 0xDC00 && c <= 0xDFFF;
- }
- return false;
- }
-};
-
-//! UTF-16 little endian encoding.
-template<typename CharType = wchar_t>
-struct UTF16LE : UTF16<CharType> {
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- CharType c = Take(is);
- return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
- }
-
- template <typename InputByteStream>
- static CharType Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- unsigned c = static_cast<uint8_t>(is.Take());
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
- return static_cast<CharType>(c);
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, CharType c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
- }
-};
-
-//! UTF-16 big endian encoding.
-template<typename CharType = wchar_t>
-struct UTF16BE : UTF16<CharType> {
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- CharType c = Take(is);
- return static_cast<uint16_t>(c) == 0xFEFFu ? Take(is) : c;
- }
-
- template <typename InputByteStream>
- static CharType Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take()));
- return static_cast<CharType>(c);
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, CharType c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>((static_cast<unsigned>(c) >> 8) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>(static_cast<unsigned>(c) & 0xFFu));
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// UTF32
-
-//! UTF-32 encoding.
-/*! http://en.wikipedia.org/wiki/UTF-32
- \tparam CharType Type for storing 32-bit UTF-32 data. Default is unsigned. C++11 may use char32_t instead.
- \note implements Encoding concept
-
- \note For in-memory access, no need to concern endianness. The code units and code points are represented by CPU's endianness.
- For streaming, use UTF32LE and UTF32BE, which handle endianness.
-*/
-template<typename CharType = unsigned>
-struct UTF32 {
- typedef CharType Ch;
- RAPIDJSON_STATIC_ASSERT(sizeof(Ch) >= 4);
-
- enum { supportUnicode = 1 };
-
- template<typename OutputStream>
- static void Encode(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- os.Put(codepoint);
- }
-
- template<typename OutputStream>
- static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputStream::Ch) >= 4);
- RAPIDJSON_ASSERT(codepoint <= 0x10FFFF);
- PutUnsafe(os, codepoint);
- }
-
- template <typename InputStream>
- static bool Decode(InputStream& is, unsigned* codepoint) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
- Ch c = is.Take();
- *codepoint = c;
- return c <= 0x10FFFF;
- }
-
- template <typename InputStream, typename OutputStream>
- static bool Validate(InputStream& is, OutputStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputStream::Ch) >= 4);
- Ch c;
- os.Put(c = is.Take());
- return c <= 0x10FFFF;
- }
-};
-
-//! UTF-32 little endian enocoding.
-template<typename CharType = unsigned>
-struct UTF32LE : UTF32<CharType> {
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- CharType c = Take(is);
- return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
- }
-
- template <typename InputByteStream>
- static CharType Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- unsigned c = static_cast<uint8_t>(is.Take());
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
- return static_cast<CharType>(c);
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
- os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, CharType c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
- }
-};
-
-//! UTF-32 big endian encoding.
-template<typename CharType = unsigned>
-struct UTF32BE : UTF32<CharType> {
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- CharType c = Take(is);
- return static_cast<uint32_t>(c) == 0x0000FEFFu ? Take(is) : c;
- }
-
- template <typename InputByteStream>
- static CharType Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- unsigned c = static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 24;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 16;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take())) << 8;
- c |= static_cast<unsigned>(static_cast<uint8_t>(is.Take()));
- return static_cast<CharType>(c);
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
- os.Put(static_cast<typename OutputByteStream::Ch>(0x00u));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFEu));
- os.Put(static_cast<typename OutputByteStream::Ch>(0xFFu));
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, CharType c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 24) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 16) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>((c >> 8) & 0xFFu));
- os.Put(static_cast<typename OutputByteStream::Ch>(c & 0xFFu));
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// ASCII
-
-//! ASCII encoding.
-/*! http://en.wikipedia.org/wiki/ASCII
- \tparam CharType Code unit for storing 7-bit ASCII data. Default is char.
- \note implements Encoding concept
-*/
-template<typename CharType = char>
-struct ASCII {
- typedef CharType Ch;
-
- enum { supportUnicode = 0 };
-
- template<typename OutputStream>
- static void Encode(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_ASSERT(codepoint <= 0x7F);
- os.Put(static_cast<Ch>(codepoint & 0xFF));
- }
-
- template<typename OutputStream>
- static void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
- RAPIDJSON_ASSERT(codepoint <= 0x7F);
- PutUnsafe(os, static_cast<Ch>(codepoint & 0xFF));
- }
-
- template <typename InputStream>
- static bool Decode(InputStream& is, unsigned* codepoint) {
- uint8_t c = static_cast<uint8_t>(is.Take());
- *codepoint = c;
- return c <= 0X7F;
- }
-
- template <typename InputStream, typename OutputStream>
- static bool Validate(InputStream& is, OutputStream& os) {
- uint8_t c = static_cast<uint8_t>(is.Take());
- os.Put(static_cast<typename OutputStream::Ch>(c));
- return c <= 0x7F;
- }
-
- template <typename InputByteStream>
- static CharType TakeBOM(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- uint8_t c = static_cast<uint8_t>(Take(is));
- return static_cast<Ch>(c);
- }
-
- template <typename InputByteStream>
- static Ch Take(InputByteStream& is) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename InputByteStream::Ch) == 1);
- return static_cast<Ch>(is.Take());
- }
-
- template <typename OutputByteStream>
- static void PutBOM(OutputByteStream& os) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- (void)os;
- }
-
- template <typename OutputByteStream>
- static void Put(OutputByteStream& os, Ch c) {
- RAPIDJSON_STATIC_ASSERT(sizeof(typename OutputByteStream::Ch) == 1);
- os.Put(static_cast<typename OutputByteStream::Ch>(c));
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// AutoUTF
-
-//! Runtime-specified UTF encoding type of a stream.
-enum UTFType {
- kUTF8 = 0, //!< UTF-8.
- kUTF16LE = 1, //!< UTF-16 little endian.
- kUTF16BE = 2, //!< UTF-16 big endian.
- kUTF32LE = 3, //!< UTF-32 little endian.
- kUTF32BE = 4 //!< UTF-32 big endian.
-};
-
-//! Dynamically select encoding according to stream's runtime-specified UTF encoding type.
-/*! \note This class can be used with AutoUTFInputtStream and AutoUTFOutputStream, which provides GetType().
-*/
-template<typename CharType>
-struct AutoUTF {
- typedef CharType Ch;
-
- enum { supportUnicode = 1 };
-
-#define RAPIDJSON_ENCODINGS_FUNC(x) UTF8<Ch>::x, UTF16LE<Ch>::x, UTF16BE<Ch>::x, UTF32LE<Ch>::x, UTF32BE<Ch>::x
-
- template<typename OutputStream>
- static RAPIDJSON_FORCEINLINE void Encode(OutputStream& os, unsigned codepoint) {
- typedef void (*EncodeFunc)(OutputStream&, unsigned);
- static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Encode) };
- (*f[os.GetType()])(os, codepoint);
- }
-
- template<typename OutputStream>
- static RAPIDJSON_FORCEINLINE void EncodeUnsafe(OutputStream& os, unsigned codepoint) {
- typedef void (*EncodeFunc)(OutputStream&, unsigned);
- static const EncodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(EncodeUnsafe) };
- (*f[os.GetType()])(os, codepoint);
- }
-
- template <typename InputStream>
- static RAPIDJSON_FORCEINLINE bool Decode(InputStream& is, unsigned* codepoint) {
- typedef bool (*DecodeFunc)(InputStream&, unsigned*);
- static const DecodeFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Decode) };
- return (*f[is.GetType()])(is, codepoint);
- }
-
- template <typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
- typedef bool (*ValidateFunc)(InputStream&, OutputStream&);
- static const ValidateFunc f[] = { RAPIDJSON_ENCODINGS_FUNC(Validate) };
- return (*f[is.GetType()])(is, os);
- }
-
-#undef RAPIDJSON_ENCODINGS_FUNC
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Transcoder
-
-//! Encoding conversion.
-template<typename SourceEncoding, typename TargetEncoding>
-struct Transcoder {
- //! Take one Unicode codepoint from source encoding, convert it to target encoding and put it to the output stream.
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) {
- unsigned codepoint;
- if (!SourceEncoding::Decode(is, &codepoint))
- return false;
- TargetEncoding::Encode(os, codepoint);
- return true;
- }
-
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
- unsigned codepoint;
- if (!SourceEncoding::Decode(is, &codepoint))
- return false;
- TargetEncoding::EncodeUnsafe(os, codepoint);
- return true;
- }
-
- //! Validate one Unicode codepoint from an encoded stream.
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
- return Transcode(is, os); // Since source/target encoding is different, must transcode.
- }
-};
-
-// Forward declaration.
-template<typename Stream>
-inline void PutUnsafe(Stream& stream, typename Stream::Ch c);
-
-//! Specialization of Transcoder with same source and target encoding.
-template<typename Encoding>
-struct Transcoder<Encoding, Encoding> {
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool Transcode(InputStream& is, OutputStream& os) {
- os.Put(is.Take()); // Just copy one code unit. This semantic is different from primary template class.
- return true;
- }
-
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool TranscodeUnsafe(InputStream& is, OutputStream& os) {
- PutUnsafe(os, is.Take()); // Just copy one code unit. This semantic is different from primary template class.
- return true;
- }
-
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE bool Validate(InputStream& is, OutputStream& os) {
- return Encoding::Validate(is, os); // source/target encoding are the same
- }
-};
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__GNUC__) || (defined(_MSC_VER) && !defined(__clang__))
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_ENCODINGS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/en.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/en.h
deleted file mode 100644
index c87b04eb13..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/en.h
+++ /dev/null
@@ -1,176 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ERROR_EN_H_
-#define RAPIDJSON_ERROR_EN_H_
-
-#include "error.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(switch-enum)
-RAPIDJSON_DIAG_OFF(covered-switch-default)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Maps error code of parsing into error message.
-/*!
- \ingroup RAPIDJSON_ERRORS
- \param parseErrorCode Error code obtained in parsing.
- \return the error message.
- \note User can make a copy of this function for localization.
- Using switch-case is safer for future modification of error codes.
-*/
-inline const RAPIDJSON_ERROR_CHARTYPE* GetParseError_En(ParseErrorCode parseErrorCode) {
- switch (parseErrorCode) {
- case kParseErrorNone: return RAPIDJSON_ERROR_STRING("No error.");
-
- case kParseErrorDocumentEmpty: return RAPIDJSON_ERROR_STRING("The document is empty.");
- case kParseErrorDocumentRootNotSingular: return RAPIDJSON_ERROR_STRING("The document root must not be followed by other values.");
-
- case kParseErrorValueInvalid: return RAPIDJSON_ERROR_STRING("Invalid value.");
-
- case kParseErrorObjectMissName: return RAPIDJSON_ERROR_STRING("Missing a name for object member.");
- case kParseErrorObjectMissColon: return RAPIDJSON_ERROR_STRING("Missing a colon after a name of object member.");
- case kParseErrorObjectMissCommaOrCurlyBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or '}' after an object member.");
-
- case kParseErrorArrayMissCommaOrSquareBracket: return RAPIDJSON_ERROR_STRING("Missing a comma or ']' after an array element.");
-
- case kParseErrorStringUnicodeEscapeInvalidHex: return RAPIDJSON_ERROR_STRING("Incorrect hex digit after \\u escape in string.");
- case kParseErrorStringUnicodeSurrogateInvalid: return RAPIDJSON_ERROR_STRING("The surrogate pair in string is invalid.");
- case kParseErrorStringEscapeInvalid: return RAPIDJSON_ERROR_STRING("Invalid escape character in string.");
- case kParseErrorStringMissQuotationMark: return RAPIDJSON_ERROR_STRING("Missing a closing quotation mark in string.");
- case kParseErrorStringInvalidEncoding: return RAPIDJSON_ERROR_STRING("Invalid encoding in string.");
-
- case kParseErrorNumberTooBig: return RAPIDJSON_ERROR_STRING("Number too big to be stored in double.");
- case kParseErrorNumberMissFraction: return RAPIDJSON_ERROR_STRING("Miss fraction part in number.");
- case kParseErrorNumberMissExponent: return RAPIDJSON_ERROR_STRING("Miss exponent in number.");
-
- case kParseErrorTermination: return RAPIDJSON_ERROR_STRING("Terminate parsing due to Handler error.");
- case kParseErrorUnspecificSyntaxError: return RAPIDJSON_ERROR_STRING("Unspecific syntax error.");
-
- default: return RAPIDJSON_ERROR_STRING("Unknown error.");
- }
-}
-
-//! Maps error code of validation into error message.
-/*!
- \ingroup RAPIDJSON_ERRORS
- \param validateErrorCode Error code obtained from validator.
- \return the error message.
- \note User can make a copy of this function for localization.
- Using switch-case is safer for future modification of error codes.
-*/
-inline const RAPIDJSON_ERROR_CHARTYPE* GetValidateError_En(ValidateErrorCode validateErrorCode) {
- switch (validateErrorCode) {
- case kValidateErrors: return RAPIDJSON_ERROR_STRING("One or more validation errors have occurred");
- case kValidateErrorNone: return RAPIDJSON_ERROR_STRING("No error.");
-
- case kValidateErrorMultipleOf: return RAPIDJSON_ERROR_STRING("Number '%actual' is not a multiple of the 'multipleOf' value '%expected'.");
- case kValidateErrorMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than the 'maximum' value '%expected'.");
- case kValidateErrorExclusiveMaximum: return RAPIDJSON_ERROR_STRING("Number '%actual' is greater than or equal to the 'exclusiveMaximum' value '%expected'.");
- case kValidateErrorMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than the 'minimum' value '%expected'.");
- case kValidateErrorExclusiveMinimum: return RAPIDJSON_ERROR_STRING("Number '%actual' is less than or equal to the 'exclusiveMinimum' value '%expected'.");
-
- case kValidateErrorMaxLength: return RAPIDJSON_ERROR_STRING("String '%actual' is longer than the 'maxLength' value '%expected'.");
- case kValidateErrorMinLength: return RAPIDJSON_ERROR_STRING("String '%actual' is shorter than the 'minLength' value '%expected'.");
- case kValidateErrorPattern: return RAPIDJSON_ERROR_STRING("String '%actual' does not match the 'pattern' regular expression.");
-
- case kValidateErrorMaxItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is longer than the 'maxItems' value '%expected'.");
- case kValidateErrorMinItems: return RAPIDJSON_ERROR_STRING("Array of length '%actual' is shorter than the 'minItems' value '%expected'.");
- case kValidateErrorUniqueItems: return RAPIDJSON_ERROR_STRING("Array has duplicate items at indices '%duplicates' but 'uniqueItems' is true.");
- case kValidateErrorAdditionalItems: return RAPIDJSON_ERROR_STRING("Array has an additional item at index '%disallowed' that is not allowed by the schema.");
-
- case kValidateErrorMaxProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is more than 'maxProperties' value '%expected'.");
- case kValidateErrorMinProperties: return RAPIDJSON_ERROR_STRING("Object has '%actual' members which is less than 'minProperties' value '%expected'.");
- case kValidateErrorRequired: return RAPIDJSON_ERROR_STRING("Object is missing the following members required by the schema: '%missing'.");
- case kValidateErrorAdditionalProperties: return RAPIDJSON_ERROR_STRING("Object has an additional member '%disallowed' that is not allowed by the schema.");
- case kValidateErrorPatternProperties: return RAPIDJSON_ERROR_STRING("Object has 'patternProperties' that are not allowed by the schema.");
- case kValidateErrorDependencies: return RAPIDJSON_ERROR_STRING("Object has missing property or schema dependencies, refer to following errors.");
-
- case kValidateErrorEnum: return RAPIDJSON_ERROR_STRING("Property has a value that is not one of its allowed enumerated values.");
- case kValidateErrorType: return RAPIDJSON_ERROR_STRING("Property has a type '%actual' that is not in the following list: '%expected'.");
-
- case kValidateErrorOneOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'oneOf', refer to following errors.");
- case kValidateErrorOneOfMatch: return RAPIDJSON_ERROR_STRING("Property matched more than one of the sub-schemas specified by 'oneOf', indices '%matches'.");
- case kValidateErrorAllOf: return RAPIDJSON_ERROR_STRING("Property did not match all of the sub-schemas specified by 'allOf', refer to following errors.");
- case kValidateErrorAnyOf: return RAPIDJSON_ERROR_STRING("Property did not match any of the sub-schemas specified by 'anyOf', refer to following errors.");
- case kValidateErrorNot: return RAPIDJSON_ERROR_STRING("Property matched the sub-schema specified by 'not'.");
-
- case kValidateErrorReadOnly: return RAPIDJSON_ERROR_STRING("Property is read-only but has been provided when validation is for writing.");
- case kValidateErrorWriteOnly: return RAPIDJSON_ERROR_STRING("Property is write-only but has been provided when validation is for reading.");
-
- default: return RAPIDJSON_ERROR_STRING("Unknown error.");
- }
-}
-
-//! Maps error code of schema document compilation into error message.
-/*!
- \ingroup RAPIDJSON_ERRORS
- \param schemaErrorCode Error code obtained from compiling the schema document.
- \return the error message.
- \note User can make a copy of this function for localization.
- Using switch-case is safer for future modification of error codes.
-*/
- inline const RAPIDJSON_ERROR_CHARTYPE* GetSchemaError_En(SchemaErrorCode schemaErrorCode) {
- switch (schemaErrorCode) {
- case kSchemaErrorNone: return RAPIDJSON_ERROR_STRING("No error.");
-
- case kSchemaErrorStartUnknown: return RAPIDJSON_ERROR_STRING("Pointer '%value' to start of schema does not resolve to a location in the document.");
- case kSchemaErrorRefPlainName: return RAPIDJSON_ERROR_STRING("$ref fragment '%value' must be a JSON pointer.");
- case kSchemaErrorRefInvalid: return RAPIDJSON_ERROR_STRING("$ref must not be an empty string.");
- case kSchemaErrorRefPointerInvalid: return RAPIDJSON_ERROR_STRING("$ref fragment '%value' is not a valid JSON pointer at offset '%offset'.");
- case kSchemaErrorRefUnknown: return RAPIDJSON_ERROR_STRING("$ref '%value' does not resolve to a location in the target document.");
- case kSchemaErrorRefCyclical: return RAPIDJSON_ERROR_STRING("$ref '%value' is cyclical.");
- case kSchemaErrorRefNoRemoteProvider: return RAPIDJSON_ERROR_STRING("$ref is remote but there is no remote provider.");
- case kSchemaErrorRefNoRemoteSchema: return RAPIDJSON_ERROR_STRING("$ref '%value' is remote but the remote provider did not return a schema.");
- case kSchemaErrorRegexInvalid: return RAPIDJSON_ERROR_STRING("Invalid regular expression '%value' in 'pattern' or 'patternProperties'.");
- case kSchemaErrorSpecUnknown: return RAPIDJSON_ERROR_STRING("JSON schema draft or OpenAPI version is not recognized.");
- case kSchemaErrorSpecUnsupported: return RAPIDJSON_ERROR_STRING("JSON schema draft or OpenAPI version is not supported.");
- case kSchemaErrorSpecIllegal: return RAPIDJSON_ERROR_STRING("Both JSON schema draft and OpenAPI version found in document.");
- case kSchemaErrorReadOnlyAndWriteOnly: return RAPIDJSON_ERROR_STRING("Property must not be both 'readOnly' and 'writeOnly'.");
-
- default: return RAPIDJSON_ERROR_STRING("Unknown error.");
- }
- }
-
-//! Maps error code of pointer parse into error message.
-/*!
- \ingroup RAPIDJSON_ERRORS
- \param pointerParseErrorCode Error code obtained from pointer parse.
- \return the error message.
- \note User can make a copy of this function for localization.
- Using switch-case is safer for future modification of error codes.
-*/
-inline const RAPIDJSON_ERROR_CHARTYPE* GetPointerParseError_En(PointerParseErrorCode pointerParseErrorCode) {
- switch (pointerParseErrorCode) {
- case kPointerParseErrorNone: return RAPIDJSON_ERROR_STRING("No error.");
-
- case kPointerParseErrorTokenMustBeginWithSolidus: return RAPIDJSON_ERROR_STRING("A token must begin with a '/'.");
- case kPointerParseErrorInvalidEscape: return RAPIDJSON_ERROR_STRING("Invalid escape.");
- case kPointerParseErrorInvalidPercentEncoding: return RAPIDJSON_ERROR_STRING("Invalid percent encoding in URI fragment.");
- case kPointerParseErrorCharacterMustPercentEncode: return RAPIDJSON_ERROR_STRING("A character must be percent encoded in a URI fragment.");
-
- default: return RAPIDJSON_ERROR_STRING("Unknown error.");
- }
-}
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_ERROR_EN_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/error.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/error.h
deleted file mode 100644
index cae345db36..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/error/error.h
+++ /dev/null
@@ -1,285 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ERROR_ERROR_H_
-#define RAPIDJSON_ERROR_ERROR_H_
-
-#include "../rapidjson.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-#endif
-
-/*! \file error.h */
-
-/*! \defgroup RAPIDJSON_ERRORS RapidJSON error handling */
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_ERROR_CHARTYPE
-
-//! Character type of error messages.
-/*! \ingroup RAPIDJSON_ERRORS
- The default character type is \c char.
- On Windows, user can define this macro as \c TCHAR for supporting both
- unicode/non-unicode settings.
-*/
-#ifndef RAPIDJSON_ERROR_CHARTYPE
-#define RAPIDJSON_ERROR_CHARTYPE char
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_ERROR_STRING
-
-//! Macro for converting string literal to \ref RAPIDJSON_ERROR_CHARTYPE[].
-/*! \ingroup RAPIDJSON_ERRORS
- By default this conversion macro does nothing.
- On Windows, user can define this macro as \c _T(x) for supporting both
- unicode/non-unicode settings.
-*/
-#ifndef RAPIDJSON_ERROR_STRING
-#define RAPIDJSON_ERROR_STRING(x) x
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// ParseErrorCode
-
-//! Error code of parsing.
-/*! \ingroup RAPIDJSON_ERRORS
- \see GenericReader::Parse, GenericReader::GetParseErrorCode
-*/
-enum ParseErrorCode {
- kParseErrorNone = 0, //!< No error.
-
- kParseErrorDocumentEmpty, //!< The document is empty.
- kParseErrorDocumentRootNotSingular, //!< The document root must not follow by other values.
-
- kParseErrorValueInvalid, //!< Invalid value.
-
- kParseErrorObjectMissName, //!< Missing a name for object member.
- kParseErrorObjectMissColon, //!< Missing a colon after a name of object member.
- kParseErrorObjectMissCommaOrCurlyBracket, //!< Missing a comma or '}' after an object member.
-
- kParseErrorArrayMissCommaOrSquareBracket, //!< Missing a comma or ']' after an array element.
-
- kParseErrorStringUnicodeEscapeInvalidHex, //!< Incorrect hex digit after \\u escape in string.
- kParseErrorStringUnicodeSurrogateInvalid, //!< The surrogate pair in string is invalid.
- kParseErrorStringEscapeInvalid, //!< Invalid escape character in string.
- kParseErrorStringMissQuotationMark, //!< Missing a closing quotation mark in string.
- kParseErrorStringInvalidEncoding, //!< Invalid encoding in string.
-
- kParseErrorNumberTooBig, //!< Number too big to be stored in double.
- kParseErrorNumberMissFraction, //!< Miss fraction part in number.
- kParseErrorNumberMissExponent, //!< Miss exponent in number.
-
- kParseErrorTermination, //!< Parsing was terminated.
- kParseErrorUnspecificSyntaxError //!< Unspecific syntax error.
-};
-
-//! Result of parsing (wraps ParseErrorCode)
-/*!
- \ingroup RAPIDJSON_ERRORS
- \code
- Document doc;
- ParseResult ok = doc.Parse("[42]");
- if (!ok) {
- fprintf(stderr, "JSON parse error: %s (%u)",
- GetParseError_En(ok.Code()), ok.Offset());
- exit(EXIT_FAILURE);
- }
- \endcode
- \see GenericReader::Parse, GenericDocument::Parse
-*/
-struct ParseResult {
- //!! Unspecified boolean type
- typedef bool (ParseResult::*BooleanType)() const;
-public:
- //! Default constructor, no error.
- ParseResult() : code_(kParseErrorNone), offset_(0) {}
- //! Constructor to set an error.
- ParseResult(ParseErrorCode code, size_t offset) : code_(code), offset_(offset) {}
-
- //! Get the error code.
- ParseErrorCode Code() const { return code_; }
- //! Get the error offset, if \ref IsError(), 0 otherwise.
- size_t Offset() const { return offset_; }
-
- //! Explicit conversion to \c bool, returns \c true, iff !\ref IsError().
- operator BooleanType() const { return !IsError() ? &ParseResult::IsError : NULL; }
- //! Whether the result is an error.
- bool IsError() const { return code_ != kParseErrorNone; }
-
- bool operator==(const ParseResult& that) const { return code_ == that.code_; }
- bool operator==(ParseErrorCode code) const { return code_ == code; }
- friend bool operator==(ParseErrorCode code, const ParseResult & err) { return code == err.code_; }
-
- bool operator!=(const ParseResult& that) const { return !(*this == that); }
- bool operator!=(ParseErrorCode code) const { return !(*this == code); }
- friend bool operator!=(ParseErrorCode code, const ParseResult & err) { return err != code; }
-
- //! Reset error code.
- void Clear() { Set(kParseErrorNone); }
- //! Update error code and offset.
- void Set(ParseErrorCode code, size_t offset = 0) { code_ = code; offset_ = offset; }
-
-private:
- ParseErrorCode code_;
- size_t offset_;
-};
-
-//! Function pointer type of GetParseError().
-/*! \ingroup RAPIDJSON_ERRORS
-
- This is the prototype for \c GetParseError_X(), where \c X is a locale.
- User can dynamically change locale in runtime, e.g.:
-\code
- GetParseErrorFunc GetParseError = GetParseError_En; // or whatever
- const RAPIDJSON_ERROR_CHARTYPE* s = GetParseError(document.GetParseErrorCode());
-\endcode
-*/
-typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetParseErrorFunc)(ParseErrorCode);
-
-///////////////////////////////////////////////////////////////////////////////
-// ValidateErrorCode
-
-//! Error codes when validating.
-/*! \ingroup RAPIDJSON_ERRORS
- \see GenericSchemaValidator
-*/
-enum ValidateErrorCode {
- kValidateErrors = -1, //!< Top level error code when kValidateContinueOnErrorsFlag set.
- kValidateErrorNone = 0, //!< No error.
-
- kValidateErrorMultipleOf, //!< Number is not a multiple of the 'multipleOf' value.
- kValidateErrorMaximum, //!< Number is greater than the 'maximum' value.
- kValidateErrorExclusiveMaximum, //!< Number is greater than or equal to the 'maximum' value.
- kValidateErrorMinimum, //!< Number is less than the 'minimum' value.
- kValidateErrorExclusiveMinimum, //!< Number is less than or equal to the 'minimum' value.
-
- kValidateErrorMaxLength, //!< String is longer than the 'maxLength' value.
- kValidateErrorMinLength, //!< String is longer than the 'maxLength' value.
- kValidateErrorPattern, //!< String does not match the 'pattern' regular expression.
-
- kValidateErrorMaxItems, //!< Array is longer than the 'maxItems' value.
- kValidateErrorMinItems, //!< Array is shorter than the 'minItems' value.
- kValidateErrorUniqueItems, //!< Array has duplicate items but 'uniqueItems' is true.
- kValidateErrorAdditionalItems, //!< Array has additional items that are not allowed by the schema.
-
- kValidateErrorMaxProperties, //!< Object has more members than 'maxProperties' value.
- kValidateErrorMinProperties, //!< Object has less members than 'minProperties' value.
- kValidateErrorRequired, //!< Object is missing one or more members required by the schema.
- kValidateErrorAdditionalProperties, //!< Object has additional members that are not allowed by the schema.
- kValidateErrorPatternProperties, //!< See other errors.
- kValidateErrorDependencies, //!< Object has missing property or schema dependencies.
-
- kValidateErrorEnum, //!< Property has a value that is not one of its allowed enumerated values.
- kValidateErrorType, //!< Property has a type that is not allowed by the schema.
-
- kValidateErrorOneOf, //!< Property did not match any of the sub-schemas specified by 'oneOf'.
- kValidateErrorOneOfMatch, //!< Property matched more than one of the sub-schemas specified by 'oneOf'.
- kValidateErrorAllOf, //!< Property did not match all of the sub-schemas specified by 'allOf'.
- kValidateErrorAnyOf, //!< Property did not match any of the sub-schemas specified by 'anyOf'.
- kValidateErrorNot, //!< Property matched the sub-schema specified by 'not'.
-
- kValidateErrorReadOnly, //!< Property is read-only but has been provided when validation is for writing
- kValidateErrorWriteOnly //!< Property is write-only but has been provided when validation is for reading
-};
-
-//! Function pointer type of GetValidateError().
-/*! \ingroup RAPIDJSON_ERRORS
-
- This is the prototype for \c GetValidateError_X(), where \c X is a locale.
- User can dynamically change locale in runtime, e.g.:
-\code
- GetValidateErrorFunc GetValidateError = GetValidateError_En; // or whatever
- const RAPIDJSON_ERROR_CHARTYPE* s = GetValidateError(validator.GetInvalidSchemaCode());
-\endcode
-*/
-typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetValidateErrorFunc)(ValidateErrorCode);
-
-///////////////////////////////////////////////////////////////////////////////
-// SchemaErrorCode
-
-//! Error codes when validating.
-/*! \ingroup RAPIDJSON_ERRORS
- \see GenericSchemaValidator
-*/
-enum SchemaErrorCode {
- kSchemaErrorNone = 0, //!< No error.
-
- kSchemaErrorStartUnknown, //!< Pointer to start of schema does not resolve to a location in the document
- kSchemaErrorRefPlainName, //!< $ref fragment must be a JSON pointer
- kSchemaErrorRefInvalid, //!< $ref must not be an empty string
- kSchemaErrorRefPointerInvalid, //!< $ref fragment is not a valid JSON pointer at offset
- kSchemaErrorRefUnknown, //!< $ref does not resolve to a location in the target document
- kSchemaErrorRefCyclical, //!< $ref is cyclical
- kSchemaErrorRefNoRemoteProvider, //!< $ref is remote but there is no remote provider
- kSchemaErrorRefNoRemoteSchema, //!< $ref is remote but the remote provider did not return a schema
- kSchemaErrorRegexInvalid, //!< Invalid regular expression in 'pattern' or 'patternProperties'
- kSchemaErrorSpecUnknown, //!< JSON schema draft or OpenAPI version is not recognized
- kSchemaErrorSpecUnsupported, //!< JSON schema draft or OpenAPI version is not supported
- kSchemaErrorSpecIllegal, //!< Both JSON schema draft and OpenAPI version found in document
- kSchemaErrorReadOnlyAndWriteOnly //!< Property must not be both 'readOnly' and 'writeOnly'
-};
-
-//! Function pointer type of GetSchemaError().
-/*! \ingroup RAPIDJSON_ERRORS
-
- This is the prototype for \c GetSchemaError_X(), where \c X is a locale.
- User can dynamically change locale in runtime, e.g.:
-\code
- GetSchemaErrorFunc GetSchemaError = GetSchemaError_En; // or whatever
- const RAPIDJSON_ERROR_CHARTYPE* s = GetSchemaError(validator.GetInvalidSchemaCode());
-\endcode
-*/
-typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetSchemaErrorFunc)(SchemaErrorCode);
-
-///////////////////////////////////////////////////////////////////////////////
-// PointerParseErrorCode
-
-//! Error code of JSON pointer parsing.
-/*! \ingroup RAPIDJSON_ERRORS
- \see GenericPointer::GenericPointer, GenericPointer::GetParseErrorCode
-*/
-enum PointerParseErrorCode {
- kPointerParseErrorNone = 0, //!< The parse is successful
-
- kPointerParseErrorTokenMustBeginWithSolidus, //!< A token must begin with a '/'
- kPointerParseErrorInvalidEscape, //!< Invalid escape
- kPointerParseErrorInvalidPercentEncoding, //!< Invalid percent encoding in URI fragment
- kPointerParseErrorCharacterMustPercentEncode //!< A character must percent encoded in URI fragment
-};
-
-//! Function pointer type of GetPointerParseError().
-/*! \ingroup RAPIDJSON_ERRORS
-
- This is the prototype for \c GetPointerParseError_X(), where \c X is a locale.
- User can dynamically change locale in runtime, e.g.:
-\code
- GetPointerParseErrorFunc GetPointerParseError = GetPointerParseError_En; // or whatever
- const RAPIDJSON_ERROR_CHARTYPE* s = GetPointerParseError(pointer.GetParseErrorCode());
-\endcode
-*/
-typedef const RAPIDJSON_ERROR_CHARTYPE* (*GetPointerParseErrorFunc)(PointerParseErrorCode);
-
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_ERROR_ERROR_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filereadstream.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filereadstream.h
deleted file mode 100644
index 3daff09279..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filereadstream.h
+++ /dev/null
@@ -1,99 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_FILEREADSTREAM_H_
-#define RAPIDJSON_FILEREADSTREAM_H_
-
-#include "stream.h"
-#include <cstdio>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-RAPIDJSON_DIAG_OFF(unreachable-code)
-RAPIDJSON_DIAG_OFF(missing-noreturn)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! File byte stream for input using fread().
-/*!
- \note implements Stream concept
-*/
-class FileReadStream {
-public:
- typedef char Ch; //!< Character type (byte).
-
- //! Constructor.
- /*!
- \param fp File pointer opened for read.
- \param buffer user-supplied buffer.
- \param bufferSize size of buffer in bytes. Must >=4 bytes.
- */
- FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
- RAPIDJSON_ASSERT(fp_ != 0);
- RAPIDJSON_ASSERT(bufferSize >= 4);
- Read();
- }
-
- Ch Peek() const { return *current_; }
- Ch Take() { Ch c = *current_; Read(); return c; }
- size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }
-
- // Not implemented
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
- // For encoding detection only.
- const Ch* Peek4() const {
- return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0;
- }
-
-private:
- void Read() {
- if (current_ < bufferLast_)
- ++current_;
- else if (!eof_) {
- count_ += readCount_;
- readCount_ = std::fread(buffer_, 1, bufferSize_, fp_);
- bufferLast_ = buffer_ + readCount_ - 1;
- current_ = buffer_;
-
- if (readCount_ < bufferSize_) {
- buffer_[readCount_] = '\0';
- ++bufferLast_;
- eof_ = true;
- }
- }
- }
-
- std::FILE* fp_;
- Ch *buffer_;
- size_t bufferSize_;
- Ch *bufferLast_;
- Ch *current_;
- size_t readCount_;
- size_t count_; //!< Number of characters read
- bool eof_;
-};
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filewritestream.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filewritestream.h
deleted file mode 100644
index 8a78ef7f09..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/filewritestream.h
+++ /dev/null
@@ -1,104 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_FILEWRITESTREAM_H_
-#define RAPIDJSON_FILEWRITESTREAM_H_
-
-#include "stream.h"
-#include <cstdio>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(unreachable-code)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Wrapper of C file stream for output using fwrite().
-/*!
- \note implements Stream concept
-*/
-class FileWriteStream {
-public:
- typedef char Ch; //!< Character type. Only support char.
-
- FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) {
- RAPIDJSON_ASSERT(fp_ != 0);
- }
-
- void Put(char c) {
- if (current_ >= bufferEnd_)
- Flush();
-
- *current_++ = c;
- }
-
- void PutN(char c, size_t n) {
- size_t avail = static_cast<size_t>(bufferEnd_ - current_);
- while (n > avail) {
- std::memset(current_, c, avail);
- current_ += avail;
- Flush();
- n -= avail;
- avail = static_cast<size_t>(bufferEnd_ - current_);
- }
-
- if (n > 0) {
- std::memset(current_, c, n);
- current_ += n;
- }
- }
-
- void Flush() {
- if (current_ != buffer_) {
- size_t result = std::fwrite(buffer_, 1, static_cast<size_t>(current_ - buffer_), fp_);
- if (result < static_cast<size_t>(current_ - buffer_)) {
- // failure deliberately ignored at this time
- // added to avoid warn_unused_result build errors
- }
- current_ = buffer_;
- }
- }
-
- // Not implemented
- char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
- char Take() { RAPIDJSON_ASSERT(false); return 0; }
- size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
- char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- // Prohibit copy constructor & assignment operator.
- FileWriteStream(const FileWriteStream&);
- FileWriteStream& operator=(const FileWriteStream&);
-
- std::FILE* fp_;
- char *buffer_;
- char *bufferEnd_;
- char *current_;
-};
-
-//! Implement specialized version of PutN() with memset() for better performance.
-template<>
-inline void PutN(FileWriteStream& stream, char c, size_t n) {
- stream.PutN(c, n);
-}
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_FILESTREAM_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/fwd.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/fwd.h
deleted file mode 100644
index 07358d8cc9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/fwd.h
+++ /dev/null
@@ -1,151 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_FWD_H_
-#define RAPIDJSON_FWD_H_
-
-#include "rapidjson.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-// encodings.h
-
-template<typename CharType> struct UTF8;
-template<typename CharType> struct UTF16;
-template<typename CharType> struct UTF16BE;
-template<typename CharType> struct UTF16LE;
-template<typename CharType> struct UTF32;
-template<typename CharType> struct UTF32BE;
-template<typename CharType> struct UTF32LE;
-template<typename CharType> struct ASCII;
-template<typename CharType> struct AutoUTF;
-
-template<typename SourceEncoding, typename TargetEncoding>
-struct Transcoder;
-
-// allocators.h
-
-class CrtAllocator;
-
-template <typename BaseAllocator>
-class MemoryPoolAllocator;
-
-// stream.h
-
-template <typename Encoding>
-struct GenericStringStream;
-
-typedef GenericStringStream<UTF8<char> > StringStream;
-
-template <typename Encoding>
-struct GenericInsituStringStream;
-
-typedef GenericInsituStringStream<UTF8<char> > InsituStringStream;
-
-// stringbuffer.h
-
-template <typename Encoding, typename Allocator>
-class GenericStringBuffer;
-
-typedef GenericStringBuffer<UTF8<char>, CrtAllocator> StringBuffer;
-
-// filereadstream.h
-
-class FileReadStream;
-
-// filewritestream.h
-
-class FileWriteStream;
-
-// memorybuffer.h
-
-template <typename Allocator>
-struct GenericMemoryBuffer;
-
-typedef GenericMemoryBuffer<CrtAllocator> MemoryBuffer;
-
-// memorystream.h
-
-struct MemoryStream;
-
-// reader.h
-
-template<typename Encoding, typename Derived>
-struct BaseReaderHandler;
-
-template <typename SourceEncoding, typename TargetEncoding, typename StackAllocator>
-class GenericReader;
-
-typedef GenericReader<UTF8<char>, UTF8<char>, CrtAllocator> Reader;
-
-// writer.h
-
-template<typename OutputStream, typename SourceEncoding, typename TargetEncoding, typename StackAllocator, unsigned writeFlags>
-class Writer;
-
-// prettywriter.h
-
-template<typename OutputStream, typename SourceEncoding, typename TargetEncoding, typename StackAllocator, unsigned writeFlags>
-class PrettyWriter;
-
-// document.h
-
-template <typename Encoding, typename Allocator>
-class GenericMember;
-
-template <bool Const, typename Encoding, typename Allocator>
-class GenericMemberIterator;
-
-template<typename CharType>
-struct GenericStringRef;
-
-template <typename Encoding, typename Allocator>
-class GenericValue;
-
-typedef GenericValue<UTF8<char>, MemoryPoolAllocator<CrtAllocator> > Value;
-
-template <typename Encoding, typename Allocator, typename StackAllocator>
-class GenericDocument;
-
-typedef GenericDocument<UTF8<char>, MemoryPoolAllocator<CrtAllocator>, CrtAllocator> Document;
-
-// pointer.h
-
-template <typename ValueType, typename Allocator>
-class GenericPointer;
-
-typedef GenericPointer<Value, CrtAllocator> Pointer;
-
-// schema.h
-
-template <typename SchemaDocumentType>
-class IGenericRemoteSchemaDocumentProvider;
-
-template <typename ValueT, typename Allocator>
-class GenericSchemaDocument;
-
-typedef GenericSchemaDocument<Value, CrtAllocator> SchemaDocument;
-typedef IGenericRemoteSchemaDocumentProvider<SchemaDocument> IRemoteSchemaDocumentProvider;
-
-template <
- typename SchemaDocumentType,
- typename OutputHandler,
- typename StateAllocator>
-class GenericSchemaValidator;
-
-typedef GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<char>, void>, CrtAllocator> SchemaValidator;
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_RAPIDJSONFWD_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/biginteger.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/biginteger.h
deleted file mode 100644
index 09d0387fe6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/biginteger.h
+++ /dev/null
@@ -1,297 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_BIGINTEGER_H_
-#define RAPIDJSON_BIGINTEGER_H_
-
-#include "../rapidjson.h"
-
-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && defined(_M_AMD64)
-#include <intrin.h> // for _umul128
-#if !defined(_ARM64EC_)
-#pragma intrinsic(_umul128)
-#else
-#pragma comment(lib,"softintrin")
-#endif
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-class BigInteger {
-public:
- typedef uint64_t Type;
-
- BigInteger(const BigInteger& rhs) : count_(rhs.count_) {
- std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
- }
-
- explicit BigInteger(uint64_t u) : count_(1) {
- digits_[0] = u;
- }
-
- template<typename Ch>
- BigInteger(const Ch* decimals, size_t length) : count_(1) {
- RAPIDJSON_ASSERT(length > 0);
- digits_[0] = 0;
- size_t i = 0;
- const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19
- while (length >= kMaxDigitPerIteration) {
- AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration);
- length -= kMaxDigitPerIteration;
- i += kMaxDigitPerIteration;
- }
-
- if (length > 0)
- AppendDecimal64(decimals + i, decimals + i + length);
- }
-
- BigInteger& operator=(const BigInteger &rhs)
- {
- if (this != &rhs) {
- count_ = rhs.count_;
- std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type));
- }
- return *this;
- }
-
- BigInteger& operator=(uint64_t u) {
- digits_[0] = u;
- count_ = 1;
- return *this;
- }
-
- BigInteger& operator+=(uint64_t u) {
- Type backup = digits_[0];
- digits_[0] += u;
- for (size_t i = 0; i < count_ - 1; i++) {
- if (digits_[i] >= backup)
- return *this; // no carry
- backup = digits_[i + 1];
- digits_[i + 1] += 1;
- }
-
- // Last carry
- if (digits_[count_ - 1] < backup)
- PushBack(1);
-
- return *this;
- }
-
- BigInteger& operator*=(uint64_t u) {
- if (u == 0) return *this = 0;
- if (u == 1) return *this;
- if (*this == 1) return *this = u;
-
- uint64_t k = 0;
- for (size_t i = 0; i < count_; i++) {
- uint64_t hi;
- digits_[i] = MulAdd64(digits_[i], u, k, &hi);
- k = hi;
- }
-
- if (k > 0)
- PushBack(k);
-
- return *this;
- }
-
- BigInteger& operator*=(uint32_t u) {
- if (u == 0) return *this = 0;
- if (u == 1) return *this;
- if (*this == 1) return *this = u;
-
- uint64_t k = 0;
- for (size_t i = 0; i < count_; i++) {
- const uint64_t c = digits_[i] >> 32;
- const uint64_t d = digits_[i] & 0xFFFFFFFF;
- const uint64_t uc = u * c;
- const uint64_t ud = u * d;
- const uint64_t p0 = ud + k;
- const uint64_t p1 = uc + (p0 >> 32);
- digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32);
- k = p1 >> 32;
- }
-
- if (k > 0)
- PushBack(k);
-
- return *this;
- }
-
- BigInteger& operator<<=(size_t shift) {
- if (IsZero() || shift == 0) return *this;
-
- size_t offset = shift / kTypeBit;
- size_t interShift = shift % kTypeBit;
- RAPIDJSON_ASSERT(count_ + offset <= kCapacity);
-
- if (interShift == 0) {
- std::memmove(digits_ + offset, digits_, count_ * sizeof(Type));
- count_ += offset;
- }
- else {
- digits_[count_] = 0;
- for (size_t i = count_; i > 0; i--)
- digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift));
- digits_[offset] = digits_[0] << interShift;
- count_ += offset;
- if (digits_[count_])
- count_++;
- }
-
- std::memset(digits_, 0, offset * sizeof(Type));
-
- return *this;
- }
-
- bool operator==(const BigInteger& rhs) const {
- return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0;
- }
-
- bool operator==(const Type rhs) const {
- return count_ == 1 && digits_[0] == rhs;
- }
-
- BigInteger& MultiplyPow5(unsigned exp) {
- static const uint32_t kPow5[12] = {
- 5,
- 5 * 5,
- 5 * 5 * 5,
- 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5,
- 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5
- };
- if (exp == 0) return *this;
- for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27
- for (; exp >= 13; exp -= 13) *this *= static_cast<uint32_t>(1220703125u); // 5^13
- if (exp > 0) *this *= kPow5[exp - 1];
- return *this;
- }
-
- // Compute absolute difference of this and rhs.
- // Assume this != rhs
- bool Difference(const BigInteger& rhs, BigInteger* out) const {
- int cmp = Compare(rhs);
- RAPIDJSON_ASSERT(cmp != 0);
- const BigInteger *a, *b; // Makes a > b
- bool ret;
- if (cmp < 0) { a = &rhs; b = this; ret = true; }
- else { a = this; b = &rhs; ret = false; }
-
- Type borrow = 0;
- for (size_t i = 0; i < a->count_; i++) {
- Type d = a->digits_[i] - borrow;
- if (i < b->count_)
- d -= b->digits_[i];
- borrow = (d > a->digits_[i]) ? 1 : 0;
- out->digits_[i] = d;
- if (d != 0)
- out->count_ = i + 1;
- }
-
- return ret;
- }
-
- int Compare(const BigInteger& rhs) const {
- if (count_ != rhs.count_)
- return count_ < rhs.count_ ? -1 : 1;
-
- for (size_t i = count_; i-- > 0;)
- if (digits_[i] != rhs.digits_[i])
- return digits_[i] < rhs.digits_[i] ? -1 : 1;
-
- return 0;
- }
-
- size_t GetCount() const { return count_; }
- Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; }
- bool IsZero() const { return count_ == 1 && digits_[0] == 0; }
-
-private:
- template<typename Ch>
- void AppendDecimal64(const Ch* begin, const Ch* end) {
- uint64_t u = ParseUint64(begin, end);
- if (IsZero())
- *this = u;
- else {
- unsigned exp = static_cast<unsigned>(end - begin);
- (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u
- }
- }
-
- void PushBack(Type digit) {
- RAPIDJSON_ASSERT(count_ < kCapacity);
- digits_[count_++] = digit;
- }
-
- template<typename Ch>
- static uint64_t ParseUint64(const Ch* begin, const Ch* end) {
- uint64_t r = 0;
- for (const Ch* p = begin; p != end; ++p) {
- RAPIDJSON_ASSERT(*p >= Ch('0') && *p <= Ch('9'));
- r = r * 10u + static_cast<unsigned>(*p - Ch('0'));
- }
- return r;
- }
-
- // Assume a * b + k < 2^128
- static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) {
-#if defined(_MSC_VER) && defined(_M_AMD64)
- uint64_t low = _umul128(a, b, outHigh) + k;
- if (low < k)
- (*outHigh)++;
- return low;
-#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
- __extension__ typedef unsigned __int128 uint128;
- uint128 p = static_cast<uint128>(a) * static_cast<uint128>(b);
- p += k;
- *outHigh = static_cast<uint64_t>(p >> 64);
- return static_cast<uint64_t>(p);
-#else
- const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32;
- uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1;
- x1 += (x0 >> 32); // can't give carry
- x1 += x2;
- if (x1 < x2)
- x3 += (static_cast<uint64_t>(1) << 32);
- uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF);
- uint64_t hi = x3 + (x1 >> 32);
-
- lo += k;
- if (lo < k)
- hi++;
- *outHigh = hi;
- return lo;
-#endif
- }
-
- static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000
- static const size_t kCapacity = kBitCount / sizeof(Type);
- static const size_t kTypeBit = sizeof(Type) * 8;
-
- Type digits_[kCapacity];
- size_t count_;
-};
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_BIGINTEGER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/clzll.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/clzll.h
deleted file mode 100644
index 8fc5118aa4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/clzll.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_CLZLL_H_
-#define RAPIDJSON_CLZLL_H_
-
-#include "../rapidjson.h"
-
-#if defined(_MSC_VER) && !defined(UNDER_CE)
-#include <intrin.h>
-#if defined(_WIN64)
-#pragma intrinsic(_BitScanReverse64)
-#else
-#pragma intrinsic(_BitScanReverse)
-#endif
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-inline uint32_t clzll(uint64_t x) {
- // Passing 0 to __builtin_clzll is UB in GCC and results in an
- // infinite loop in the software implementation.
- RAPIDJSON_ASSERT(x != 0);
-
-#if defined(_MSC_VER) && !defined(UNDER_CE)
- unsigned long r = 0;
-#if defined(_WIN64)
- _BitScanReverse64(&r, x);
-#else
- // Scan the high 32 bits.
- if (_BitScanReverse(&r, static_cast<uint32_t>(x >> 32)))
- return 63 - (r + 32);
-
- // Scan the low 32 bits.
- _BitScanReverse(&r, static_cast<uint32_t>(x & 0xFFFFFFFF));
-#endif // _WIN64
-
- return 63 - r;
-#elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll)
- // __builtin_clzll wrapper
- return static_cast<uint32_t>(__builtin_clzll(x));
-#else
- // naive version
- uint32_t r = 0;
- while (!(x & (static_cast<uint64_t>(1) << 63))) {
- x <<= 1;
- ++r;
- }
-
- return r;
-#endif // _MSC_VER
-}
-
-#define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_CLZLL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/diyfp.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/diyfp.h
deleted file mode 100644
index 1f60fb60ca..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/diyfp.h
+++ /dev/null
@@ -1,261 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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.
-
-// This is a C++ header-only implementation of Grisu2 algorithm from the publication:
-// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with
-// integers." ACM Sigplan Notices 45.6 (2010): 233-243.
-
-#ifndef RAPIDJSON_DIYFP_H_
-#define RAPIDJSON_DIYFP_H_
-
-#include "../rapidjson.h"
-#include "clzll.h"
-#include <limits>
-
-#if defined(_MSC_VER) && defined(_M_AMD64) && !defined(__INTEL_COMPILER)
-#include <intrin.h>
-#if !defined(_ARM64EC_)
-#pragma intrinsic(_umul128)
-#else
-#pragma comment(lib,"softintrin")
-#endif
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-#endif
-
-struct DiyFp {
- DiyFp() : f(), e() {}
-
- DiyFp(uint64_t fp, int exp) : f(fp), e(exp) {}
-
- explicit DiyFp(double d) {
- union {
- double d;
- uint64_t u64;
- } u = { d };
-
- int biased_e = static_cast<int>((u.u64 & kDpExponentMask) >> kDpSignificandSize);
- uint64_t significand = (u.u64 & kDpSignificandMask);
- if (biased_e != 0) {
- f = significand + kDpHiddenBit;
- e = biased_e - kDpExponentBias;
- }
- else {
- f = significand;
- e = kDpMinExponent + 1;
- }
- }
-
- DiyFp operator-(const DiyFp& rhs) const {
- return DiyFp(f - rhs.f, e);
- }
-
- DiyFp operator*(const DiyFp& rhs) const {
-#if defined(_MSC_VER) && defined(_M_AMD64)
- uint64_t h;
- uint64_t l = _umul128(f, rhs.f, &h);
- if (l & (uint64_t(1) << 63)) // rounding
- h++;
- return DiyFp(h, e + rhs.e + 64);
-#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__)
- __extension__ typedef unsigned __int128 uint128;
- uint128 p = static_cast<uint128>(f) * static_cast<uint128>(rhs.f);
- uint64_t h = static_cast<uint64_t>(p >> 64);
- uint64_t l = static_cast<uint64_t>(p);
- if (l & (uint64_t(1) << 63)) // rounding
- h++;
- return DiyFp(h, e + rhs.e + 64);
-#else
- const uint64_t M32 = 0xFFFFFFFF;
- const uint64_t a = f >> 32;
- const uint64_t b = f & M32;
- const uint64_t c = rhs.f >> 32;
- const uint64_t d = rhs.f & M32;
- const uint64_t ac = a * c;
- const uint64_t bc = b * c;
- const uint64_t ad = a * d;
- const uint64_t bd = b * d;
- uint64_t tmp = (bd >> 32) + (ad & M32) + (bc & M32);
- tmp += 1U << 31; /// mult_round
- return DiyFp(ac + (ad >> 32) + (bc >> 32) + (tmp >> 32), e + rhs.e + 64);
-#endif
- }
-
- DiyFp Normalize() const {
- int s = static_cast<int>(clzll(f));
- return DiyFp(f << s, e - s);
- }
-
- DiyFp NormalizeBoundary() const {
- DiyFp res = *this;
- while (!(res.f & (kDpHiddenBit << 1))) {
- res.f <<= 1;
- res.e--;
- }
- res.f <<= (kDiySignificandSize - kDpSignificandSize - 2);
- res.e = res.e - (kDiySignificandSize - kDpSignificandSize - 2);
- return res;
- }
-
- void NormalizedBoundaries(DiyFp* minus, DiyFp* plus) const {
- DiyFp pl = DiyFp((f << 1) + 1, e - 1).NormalizeBoundary();
- DiyFp mi = (f == kDpHiddenBit) ? DiyFp((f << 2) - 1, e - 2) : DiyFp((f << 1) - 1, e - 1);
- mi.f <<= mi.e - pl.e;
- mi.e = pl.e;
- *plus = pl;
- *minus = mi;
- }
-
- double ToDouble() const {
- union {
- double d;
- uint64_t u64;
- }u;
- RAPIDJSON_ASSERT(f <= kDpHiddenBit + kDpSignificandMask);
- if (e < kDpDenormalExponent) {
- // Underflow.
- return 0.0;
- }
- if (e >= kDpMaxExponent) {
- // Overflow.
- return std::numeric_limits<double>::infinity();
- }
- const uint64_t be = (e == kDpDenormalExponent && (f & kDpHiddenBit) == 0) ? 0 :
- static_cast<uint64_t>(e + kDpExponentBias);
- u.u64 = (f & kDpSignificandMask) | (be << kDpSignificandSize);
- return u.d;
- }
-
- static const int kDiySignificandSize = 64;
- static const int kDpSignificandSize = 52;
- static const int kDpExponentBias = 0x3FF + kDpSignificandSize;
- static const int kDpMaxExponent = 0x7FF - kDpExponentBias;
- static const int kDpMinExponent = -kDpExponentBias;
- static const int kDpDenormalExponent = -kDpExponentBias + 1;
- static const uint64_t kDpExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
- static const uint64_t kDpSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
- static const uint64_t kDpHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
-
- uint64_t f;
- int e;
-};
-
-inline DiyFp GetCachedPowerByIndex(size_t index) {
- // 10^-348, 10^-340, ..., 10^340
- static const uint64_t kCachedPowers_F[] = {
- RAPIDJSON_UINT64_C2(0xfa8fd5a0, 0x081c0288), RAPIDJSON_UINT64_C2(0xbaaee17f, 0xa23ebf76),
- RAPIDJSON_UINT64_C2(0x8b16fb20, 0x3055ac76), RAPIDJSON_UINT64_C2(0xcf42894a, 0x5dce35ea),
- RAPIDJSON_UINT64_C2(0x9a6bb0aa, 0x55653b2d), RAPIDJSON_UINT64_C2(0xe61acf03, 0x3d1a45df),
- RAPIDJSON_UINT64_C2(0xab70fe17, 0xc79ac6ca), RAPIDJSON_UINT64_C2(0xff77b1fc, 0xbebcdc4f),
- RAPIDJSON_UINT64_C2(0xbe5691ef, 0x416bd60c), RAPIDJSON_UINT64_C2(0x8dd01fad, 0x907ffc3c),
- RAPIDJSON_UINT64_C2(0xd3515c28, 0x31559a83), RAPIDJSON_UINT64_C2(0x9d71ac8f, 0xada6c9b5),
- RAPIDJSON_UINT64_C2(0xea9c2277, 0x23ee8bcb), RAPIDJSON_UINT64_C2(0xaecc4991, 0x4078536d),
- RAPIDJSON_UINT64_C2(0x823c1279, 0x5db6ce57), RAPIDJSON_UINT64_C2(0xc2109436, 0x4dfb5637),
- RAPIDJSON_UINT64_C2(0x9096ea6f, 0x3848984f), RAPIDJSON_UINT64_C2(0xd77485cb, 0x25823ac7),
- RAPIDJSON_UINT64_C2(0xa086cfcd, 0x97bf97f4), RAPIDJSON_UINT64_C2(0xef340a98, 0x172aace5),
- RAPIDJSON_UINT64_C2(0xb23867fb, 0x2a35b28e), RAPIDJSON_UINT64_C2(0x84c8d4df, 0xd2c63f3b),
- RAPIDJSON_UINT64_C2(0xc5dd4427, 0x1ad3cdba), RAPIDJSON_UINT64_C2(0x936b9fce, 0xbb25c996),
- RAPIDJSON_UINT64_C2(0xdbac6c24, 0x7d62a584), RAPIDJSON_UINT64_C2(0xa3ab6658, 0x0d5fdaf6),
- RAPIDJSON_UINT64_C2(0xf3e2f893, 0xdec3f126), RAPIDJSON_UINT64_C2(0xb5b5ada8, 0xaaff80b8),
- RAPIDJSON_UINT64_C2(0x87625f05, 0x6c7c4a8b), RAPIDJSON_UINT64_C2(0xc9bcff60, 0x34c13053),
- RAPIDJSON_UINT64_C2(0x964e858c, 0x91ba2655), RAPIDJSON_UINT64_C2(0xdff97724, 0x70297ebd),
- RAPIDJSON_UINT64_C2(0xa6dfbd9f, 0xb8e5b88f), RAPIDJSON_UINT64_C2(0xf8a95fcf, 0x88747d94),
- RAPIDJSON_UINT64_C2(0xb9447093, 0x8fa89bcf), RAPIDJSON_UINT64_C2(0x8a08f0f8, 0xbf0f156b),
- RAPIDJSON_UINT64_C2(0xcdb02555, 0x653131b6), RAPIDJSON_UINT64_C2(0x993fe2c6, 0xd07b7fac),
- RAPIDJSON_UINT64_C2(0xe45c10c4, 0x2a2b3b06), RAPIDJSON_UINT64_C2(0xaa242499, 0x697392d3),
- RAPIDJSON_UINT64_C2(0xfd87b5f2, 0x8300ca0e), RAPIDJSON_UINT64_C2(0xbce50864, 0x92111aeb),
- RAPIDJSON_UINT64_C2(0x8cbccc09, 0x6f5088cc), RAPIDJSON_UINT64_C2(0xd1b71758, 0xe219652c),
- RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), RAPIDJSON_UINT64_C2(0xe8d4a510, 0x00000000),
- RAPIDJSON_UINT64_C2(0xad78ebc5, 0xac620000), RAPIDJSON_UINT64_C2(0x813f3978, 0xf8940984),
- RAPIDJSON_UINT64_C2(0xc097ce7b, 0xc90715b3), RAPIDJSON_UINT64_C2(0x8f7e32ce, 0x7bea5c70),
- RAPIDJSON_UINT64_C2(0xd5d238a4, 0xabe98068), RAPIDJSON_UINT64_C2(0x9f4f2726, 0x179a2245),
- RAPIDJSON_UINT64_C2(0xed63a231, 0xd4c4fb27), RAPIDJSON_UINT64_C2(0xb0de6538, 0x8cc8ada8),
- RAPIDJSON_UINT64_C2(0x83c7088e, 0x1aab65db), RAPIDJSON_UINT64_C2(0xc45d1df9, 0x42711d9a),
- RAPIDJSON_UINT64_C2(0x924d692c, 0xa61be758), RAPIDJSON_UINT64_C2(0xda01ee64, 0x1a708dea),
- RAPIDJSON_UINT64_C2(0xa26da399, 0x9aef774a), RAPIDJSON_UINT64_C2(0xf209787b, 0xb47d6b85),
- RAPIDJSON_UINT64_C2(0xb454e4a1, 0x79dd1877), RAPIDJSON_UINT64_C2(0x865b8692, 0x5b9bc5c2),
- RAPIDJSON_UINT64_C2(0xc83553c5, 0xc8965d3d), RAPIDJSON_UINT64_C2(0x952ab45c, 0xfa97a0b3),
- RAPIDJSON_UINT64_C2(0xde469fbd, 0x99a05fe3), RAPIDJSON_UINT64_C2(0xa59bc234, 0xdb398c25),
- RAPIDJSON_UINT64_C2(0xf6c69a72, 0xa3989f5c), RAPIDJSON_UINT64_C2(0xb7dcbf53, 0x54e9bece),
- RAPIDJSON_UINT64_C2(0x88fcf317, 0xf22241e2), RAPIDJSON_UINT64_C2(0xcc20ce9b, 0xd35c78a5),
- RAPIDJSON_UINT64_C2(0x98165af3, 0x7b2153df), RAPIDJSON_UINT64_C2(0xe2a0b5dc, 0x971f303a),
- RAPIDJSON_UINT64_C2(0xa8d9d153, 0x5ce3b396), RAPIDJSON_UINT64_C2(0xfb9b7cd9, 0xa4a7443c),
- RAPIDJSON_UINT64_C2(0xbb764c4c, 0xa7a44410), RAPIDJSON_UINT64_C2(0x8bab8eef, 0xb6409c1a),
- RAPIDJSON_UINT64_C2(0xd01fef10, 0xa657842c), RAPIDJSON_UINT64_C2(0x9b10a4e5, 0xe9913129),
- RAPIDJSON_UINT64_C2(0xe7109bfb, 0xa19c0c9d), RAPIDJSON_UINT64_C2(0xac2820d9, 0x623bf429),
- RAPIDJSON_UINT64_C2(0x80444b5e, 0x7aa7cf85), RAPIDJSON_UINT64_C2(0xbf21e440, 0x03acdd2d),
- RAPIDJSON_UINT64_C2(0x8e679c2f, 0x5e44ff8f), RAPIDJSON_UINT64_C2(0xd433179d, 0x9c8cb841),
- RAPIDJSON_UINT64_C2(0x9e19db92, 0xb4e31ba9), RAPIDJSON_UINT64_C2(0xeb96bf6e, 0xbadf77d9),
- RAPIDJSON_UINT64_C2(0xaf87023b, 0x9bf0ee6b)
- };
- static const int16_t kCachedPowers_E[] = {
- -1220, -1193, -1166, -1140, -1113, -1087, -1060, -1034, -1007, -980,
- -954, -927, -901, -874, -847, -821, -794, -768, -741, -715,
- -688, -661, -635, -608, -582, -555, -529, -502, -475, -449,
- -422, -396, -369, -343, -316, -289, -263, -236, -210, -183,
- -157, -130, -103, -77, -50, -24, 3, 30, 56, 83,
- 109, 136, 162, 189, 216, 242, 269, 295, 322, 348,
- 375, 402, 428, 455, 481, 508, 534, 561, 588, 614,
- 641, 667, 694, 720, 747, 774, 800, 827, 853, 880,
- 907, 933, 960, 986, 1013, 1039, 1066
- };
- RAPIDJSON_ASSERT(index < 87);
- return DiyFp(kCachedPowers_F[index], kCachedPowers_E[index]);
-}
-
-inline DiyFp GetCachedPower(int e, int* K) {
-
- //int k = static_cast<int>(ceil((-61 - e) * 0.30102999566398114)) + 374;
- double dk = (-61 - e) * 0.30102999566398114 + 347; // dk must be positive, so can do ceiling in positive
- int k = static_cast<int>(dk);
- if (dk - k > 0.0)
- k++;
-
- unsigned index = static_cast<unsigned>((k >> 3) + 1);
- *K = -(-348 + static_cast<int>(index << 3)); // decimal exponent no need lookup table
-
- return GetCachedPowerByIndex(index);
-}
-
-inline DiyFp GetCachedPower10(int exp, int *outExp) {
- RAPIDJSON_ASSERT(exp >= -348);
- unsigned index = static_cast<unsigned>(exp + 348) / 8u;
- *outExp = -348 + static_cast<int>(index) * 8;
- return GetCachedPowerByIndex(index);
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-RAPIDJSON_DIAG_OFF(padded)
-#endif
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_DIYFP_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/dtoa.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/dtoa.h
deleted file mode 100644
index 91c5756d92..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/dtoa.h
+++ /dev/null
@@ -1,249 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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.
-
-// This is a C++ header-only implementation of Grisu2 algorithm from the publication:
-// Loitsch, Florian. "Printing floating-point numbers quickly and accurately with
-// integers." ACM Sigplan Notices 45.6 (2010): 233-243.
-
-#ifndef RAPIDJSON_DTOA_
-#define RAPIDJSON_DTOA_
-
-#include "itoa.h" // GetDigitsLut()
-#include "diyfp.h"
-#include "ieee754.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124
-#endif
-
-inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) {
- while (rest < wp_w && delta - rest >= ten_kappa &&
- (rest + ten_kappa < wp_w || /// closer
- wp_w - rest > rest + ten_kappa - wp_w)) {
- buffer[len - 1]--;
- rest += ten_kappa;
- }
-}
-
-inline int CountDecimalDigit32(uint32_t n) {
- // Simple pure C++ implementation was faster than __builtin_clz version in this situation.
- if (n < 10) return 1;
- if (n < 100) return 2;
- if (n < 1000) return 3;
- if (n < 10000) return 4;
- if (n < 100000) return 5;
- if (n < 1000000) return 6;
- if (n < 10000000) return 7;
- if (n < 100000000) return 8;
- // Will not reach 10 digits in DigitGen()
- //if (n < 1000000000) return 9;
- //return 10;
- return 9;
-}
-
-inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) {
- static const uint64_t kPow10[] = { 1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL, 100000ULL, 1000000ULL, 10000000ULL, 100000000ULL,
- 1000000000ULL, 10000000000ULL, 100000000000ULL, 1000000000000ULL,
- 10000000000000ULL, 100000000000000ULL, 1000000000000000ULL,
- 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL,
- 10000000000000000000ULL };
- const DiyFp one(uint64_t(1) << -Mp.e, Mp.e);
- const DiyFp wp_w = Mp - W;
- uint32_t p1 = static_cast<uint32_t>(Mp.f >> -one.e);
- uint64_t p2 = Mp.f & (one.f - 1);
- int kappa = CountDecimalDigit32(p1); // kappa in [0, 9]
- *len = 0;
-
- while (kappa > 0) {
- uint32_t d = 0;
- switch (kappa) {
- case 9: d = p1 / 100000000; p1 %= 100000000; break;
- case 8: d = p1 / 10000000; p1 %= 10000000; break;
- case 7: d = p1 / 1000000; p1 %= 1000000; break;
- case 6: d = p1 / 100000; p1 %= 100000; break;
- case 5: d = p1 / 10000; p1 %= 10000; break;
- case 4: d = p1 / 1000; p1 %= 1000; break;
- case 3: d = p1 / 100; p1 %= 100; break;
- case 2: d = p1 / 10; p1 %= 10; break;
- case 1: d = p1; p1 = 0; break;
- default:;
- }
- if (d || *len)
- buffer[(*len)++] = static_cast<char>('0' + static_cast<char>(d));
- kappa--;
- uint64_t tmp = (static_cast<uint64_t>(p1) << -one.e) + p2;
- if (tmp <= delta) {
- *K += kappa;
- GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f);
- return;
- }
- }
-
- // kappa = 0
- for (;;) {
- p2 *= 10;
- delta *= 10;
- char d = static_cast<char>(p2 >> -one.e);
- if (d || *len)
- buffer[(*len)++] = static_cast<char>('0' + d);
- p2 &= one.f - 1;
- kappa--;
- if (p2 < delta) {
- *K += kappa;
- int index = -kappa;
- GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 20 ? kPow10[index] : 0));
- return;
- }
- }
-}
-
-inline void Grisu2(double value, char* buffer, int* length, int* K) {
- const DiyFp v(value);
- DiyFp w_m, w_p;
- v.NormalizedBoundaries(&w_m, &w_p);
-
- const DiyFp c_mk = GetCachedPower(w_p.e, K);
- const DiyFp W = v.Normalize() * c_mk;
- DiyFp Wp = w_p * c_mk;
- DiyFp Wm = w_m * c_mk;
- Wm.f++;
- Wp.f--;
- DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K);
-}
-
-inline char* WriteExponent(int K, char* buffer) {
- if (K < 0) {
- *buffer++ = '-';
- K = -K;
- }
-
- if (K >= 100) {
- *buffer++ = static_cast<char>('0' + static_cast<char>(K / 100));
- K %= 100;
- const char* d = GetDigitsLut() + K * 2;
- *buffer++ = d[0];
- *buffer++ = d[1];
- }
- else if (K >= 10) {
- const char* d = GetDigitsLut() + K * 2;
- *buffer++ = d[0];
- *buffer++ = d[1];
- }
- else
- *buffer++ = static_cast<char>('0' + static_cast<char>(K));
-
- return buffer;
-}
-
-inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) {
- const int kk = length + k; // 10^(kk-1) <= v < 10^kk
-
- if (0 <= k && kk <= 21) {
- // 1234e7 -> 12340000000
- for (int i = length; i < kk; i++)
- buffer[i] = '0';
- buffer[kk] = '.';
- buffer[kk + 1] = '0';
- return &buffer[kk + 2];
- }
- else if (0 < kk && kk <= 21) {
- // 1234e-2 -> 12.34
- std::memmove(&buffer[kk + 1], &buffer[kk], static_cast<size_t>(length - kk));
- buffer[kk] = '.';
- if (0 > k + maxDecimalPlaces) {
- // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1
- // Remove extra trailing zeros (at least one) after truncation.
- for (int i = kk + maxDecimalPlaces; i > kk + 1; i--)
- if (buffer[i] != '0')
- return &buffer[i + 1];
- return &buffer[kk + 2]; // Reserve one zero
- }
- else
- return &buffer[length + 1];
- }
- else if (-6 < kk && kk <= 0) {
- // 1234e-6 -> 0.001234
- const int offset = 2 - kk;
- std::memmove(&buffer[offset], &buffer[0], static_cast<size_t>(length));
- buffer[0] = '0';
- buffer[1] = '.';
- for (int i = 2; i < offset; i++)
- buffer[i] = '0';
- if (length - kk > maxDecimalPlaces) {
- // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1
- // Remove extra trailing zeros (at least one) after truncation.
- for (int i = maxDecimalPlaces + 1; i > 2; i--)
- if (buffer[i] != '0')
- return &buffer[i + 1];
- return &buffer[3]; // Reserve one zero
- }
- else
- return &buffer[length + offset];
- }
- else if (kk < -maxDecimalPlaces) {
- // Truncate to zero
- buffer[0] = '0';
- buffer[1] = '.';
- buffer[2] = '0';
- return &buffer[3];
- }
- else if (length == 1) {
- // 1e30
- buffer[1] = 'e';
- return WriteExponent(kk - 1, &buffer[2]);
- }
- else {
- // 1234e30 -> 1.234e33
- std::memmove(&buffer[2], &buffer[1], static_cast<size_t>(length - 1));
- buffer[1] = '.';
- buffer[length + 1] = 'e';
- return WriteExponent(kk - 1, &buffer[0 + length + 2]);
- }
-}
-
-inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) {
- RAPIDJSON_ASSERT(maxDecimalPlaces >= 1);
- Double d(value);
- if (d.IsZero()) {
- if (d.Sign())
- *buffer++ = '-'; // -0.0, Issue #289
- buffer[0] = '0';
- buffer[1] = '.';
- buffer[2] = '0';
- return &buffer[3];
- }
- else {
- if (value < 0) {
- *buffer++ = '-';
- value = -value;
- }
- int length, K;
- Grisu2(value, buffer, &length, &K);
- return Prettify(buffer, length, K, maxDecimalPlaces);
- }
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_DTOA_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/ieee754.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/ieee754.h
deleted file mode 100644
index f887d1b27c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/ieee754.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_IEEE754_
-#define RAPIDJSON_IEEE754_
-
-#include "../rapidjson.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-class Double {
-public:
- Double() {}
- Double(double d) : d_(d) {}
- Double(uint64_t u) : u_(u) {}
-
- double Value() const { return d_; }
- uint64_t Uint64Value() const { return u_; }
-
- double NextPositiveDouble() const {
- RAPIDJSON_ASSERT(!Sign());
- return Double(u_ + 1).Value();
- }
-
- bool Sign() const { return (u_ & kSignMask) != 0; }
- uint64_t Significand() const { return u_ & kSignificandMask; }
- int Exponent() const { return static_cast<int>(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); }
-
- bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; }
- bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; }
- bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; }
- bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; }
- bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; }
-
- uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); }
- int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; }
- uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; }
-
- static int EffectiveSignificandSize(int order) {
- if (order >= -1021)
- return 53;
- else if (order <= -1074)
- return 0;
- else
- return order + 1074;
- }
-
-private:
- static const int kSignificandSize = 52;
- static const int kExponentBias = 0x3FF;
- static const int kDenormalExponent = 1 - kExponentBias;
- static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000);
- static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
- static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
- static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
-
- union {
- double d_;
- uint64_t u_;
- };
-};
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_IEEE754_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/itoa.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/itoa.h
deleted file mode 100644
index 9fe8c932ff..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/itoa.h
+++ /dev/null
@@ -1,308 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ITOA_
-#define RAPIDJSON_ITOA_
-
-#include "../rapidjson.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-inline const char* GetDigitsLut() {
- static const char cDigitsLut[200] = {
- '0','0','0','1','0','2','0','3','0','4','0','5','0','6','0','7','0','8','0','9',
- '1','0','1','1','1','2','1','3','1','4','1','5','1','6','1','7','1','8','1','9',
- '2','0','2','1','2','2','2','3','2','4','2','5','2','6','2','7','2','8','2','9',
- '3','0','3','1','3','2','3','3','3','4','3','5','3','6','3','7','3','8','3','9',
- '4','0','4','1','4','2','4','3','4','4','4','5','4','6','4','7','4','8','4','9',
- '5','0','5','1','5','2','5','3','5','4','5','5','5','6','5','7','5','8','5','9',
- '6','0','6','1','6','2','6','3','6','4','6','5','6','6','6','7','6','8','6','9',
- '7','0','7','1','7','2','7','3','7','4','7','5','7','6','7','7','7','8','7','9',
- '8','0','8','1','8','2','8','3','8','4','8','5','8','6','8','7','8','8','8','9',
- '9','0','9','1','9','2','9','3','9','4','9','5','9','6','9','7','9','8','9','9'
- };
- return cDigitsLut;
-}
-
-inline char* u32toa(uint32_t value, char* buffer) {
- RAPIDJSON_ASSERT(buffer != 0);
-
- const char* cDigitsLut = GetDigitsLut();
-
- if (value < 10000) {
- const uint32_t d1 = (value / 100) << 1;
- const uint32_t d2 = (value % 100) << 1;
-
- if (value >= 1000)
- *buffer++ = cDigitsLut[d1];
- if (value >= 100)
- *buffer++ = cDigitsLut[d1 + 1];
- if (value >= 10)
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
- }
- else if (value < 100000000) {
- // value = bbbbcccc
- const uint32_t b = value / 10000;
- const uint32_t c = value % 10000;
-
- const uint32_t d1 = (b / 100) << 1;
- const uint32_t d2 = (b % 100) << 1;
-
- const uint32_t d3 = (c / 100) << 1;
- const uint32_t d4 = (c % 100) << 1;
-
- if (value >= 10000000)
- *buffer++ = cDigitsLut[d1];
- if (value >= 1000000)
- *buffer++ = cDigitsLut[d1 + 1];
- if (value >= 100000)
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
-
- *buffer++ = cDigitsLut[d3];
- *buffer++ = cDigitsLut[d3 + 1];
- *buffer++ = cDigitsLut[d4];
- *buffer++ = cDigitsLut[d4 + 1];
- }
- else {
- // value = aabbbbcccc in decimal
-
- const uint32_t a = value / 100000000; // 1 to 42
- value %= 100000000;
-
- if (a >= 10) {
- const unsigned i = a << 1;
- *buffer++ = cDigitsLut[i];
- *buffer++ = cDigitsLut[i + 1];
- }
- else
- *buffer++ = static_cast<char>('0' + static_cast<char>(a));
-
- const uint32_t b = value / 10000; // 0 to 9999
- const uint32_t c = value % 10000; // 0 to 9999
-
- const uint32_t d1 = (b / 100) << 1;
- const uint32_t d2 = (b % 100) << 1;
-
- const uint32_t d3 = (c / 100) << 1;
- const uint32_t d4 = (c % 100) << 1;
-
- *buffer++ = cDigitsLut[d1];
- *buffer++ = cDigitsLut[d1 + 1];
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
- *buffer++ = cDigitsLut[d3];
- *buffer++ = cDigitsLut[d3 + 1];
- *buffer++ = cDigitsLut[d4];
- *buffer++ = cDigitsLut[d4 + 1];
- }
- return buffer;
-}
-
-inline char* i32toa(int32_t value, char* buffer) {
- RAPIDJSON_ASSERT(buffer != 0);
- uint32_t u = static_cast<uint32_t>(value);
- if (value < 0) {
- *buffer++ = '-';
- u = ~u + 1;
- }
-
- return u32toa(u, buffer);
-}
-
-inline char* u64toa(uint64_t value, char* buffer) {
- RAPIDJSON_ASSERT(buffer != 0);
- const char* cDigitsLut = GetDigitsLut();
- const uint64_t kTen8 = 100000000;
- const uint64_t kTen9 = kTen8 * 10;
- const uint64_t kTen10 = kTen8 * 100;
- const uint64_t kTen11 = kTen8 * 1000;
- const uint64_t kTen12 = kTen8 * 10000;
- const uint64_t kTen13 = kTen8 * 100000;
- const uint64_t kTen14 = kTen8 * 1000000;
- const uint64_t kTen15 = kTen8 * 10000000;
- const uint64_t kTen16 = kTen8 * kTen8;
-
- if (value < kTen8) {
- uint32_t v = static_cast<uint32_t>(value);
- if (v < 10000) {
- const uint32_t d1 = (v / 100) << 1;
- const uint32_t d2 = (v % 100) << 1;
-
- if (v >= 1000)
- *buffer++ = cDigitsLut[d1];
- if (v >= 100)
- *buffer++ = cDigitsLut[d1 + 1];
- if (v >= 10)
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
- }
- else {
- // value = bbbbcccc
- const uint32_t b = v / 10000;
- const uint32_t c = v % 10000;
-
- const uint32_t d1 = (b / 100) << 1;
- const uint32_t d2 = (b % 100) << 1;
-
- const uint32_t d3 = (c / 100) << 1;
- const uint32_t d4 = (c % 100) << 1;
-
- if (value >= 10000000)
- *buffer++ = cDigitsLut[d1];
- if (value >= 1000000)
- *buffer++ = cDigitsLut[d1 + 1];
- if (value >= 100000)
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
-
- *buffer++ = cDigitsLut[d3];
- *buffer++ = cDigitsLut[d3 + 1];
- *buffer++ = cDigitsLut[d4];
- *buffer++ = cDigitsLut[d4 + 1];
- }
- }
- else if (value < kTen16) {
- const uint32_t v0 = static_cast<uint32_t>(value / kTen8);
- const uint32_t v1 = static_cast<uint32_t>(value % kTen8);
-
- const uint32_t b0 = v0 / 10000;
- const uint32_t c0 = v0 % 10000;
-
- const uint32_t d1 = (b0 / 100) << 1;
- const uint32_t d2 = (b0 % 100) << 1;
-
- const uint32_t d3 = (c0 / 100) << 1;
- const uint32_t d4 = (c0 % 100) << 1;
-
- const uint32_t b1 = v1 / 10000;
- const uint32_t c1 = v1 % 10000;
-
- const uint32_t d5 = (b1 / 100) << 1;
- const uint32_t d6 = (b1 % 100) << 1;
-
- const uint32_t d7 = (c1 / 100) << 1;
- const uint32_t d8 = (c1 % 100) << 1;
-
- if (value >= kTen15)
- *buffer++ = cDigitsLut[d1];
- if (value >= kTen14)
- *buffer++ = cDigitsLut[d1 + 1];
- if (value >= kTen13)
- *buffer++ = cDigitsLut[d2];
- if (value >= kTen12)
- *buffer++ = cDigitsLut[d2 + 1];
- if (value >= kTen11)
- *buffer++ = cDigitsLut[d3];
- if (value >= kTen10)
- *buffer++ = cDigitsLut[d3 + 1];
- if (value >= kTen9)
- *buffer++ = cDigitsLut[d4];
-
- *buffer++ = cDigitsLut[d4 + 1];
- *buffer++ = cDigitsLut[d5];
- *buffer++ = cDigitsLut[d5 + 1];
- *buffer++ = cDigitsLut[d6];
- *buffer++ = cDigitsLut[d6 + 1];
- *buffer++ = cDigitsLut[d7];
- *buffer++ = cDigitsLut[d7 + 1];
- *buffer++ = cDigitsLut[d8];
- *buffer++ = cDigitsLut[d8 + 1];
- }
- else {
- const uint32_t a = static_cast<uint32_t>(value / kTen16); // 1 to 1844
- value %= kTen16;
-
- if (a < 10)
- *buffer++ = static_cast<char>('0' + static_cast<char>(a));
- else if (a < 100) {
- const uint32_t i = a << 1;
- *buffer++ = cDigitsLut[i];
- *buffer++ = cDigitsLut[i + 1];
- }
- else if (a < 1000) {
- *buffer++ = static_cast<char>('0' + static_cast<char>(a / 100));
-
- const uint32_t i = (a % 100) << 1;
- *buffer++ = cDigitsLut[i];
- *buffer++ = cDigitsLut[i + 1];
- }
- else {
- const uint32_t i = (a / 100) << 1;
- const uint32_t j = (a % 100) << 1;
- *buffer++ = cDigitsLut[i];
- *buffer++ = cDigitsLut[i + 1];
- *buffer++ = cDigitsLut[j];
- *buffer++ = cDigitsLut[j + 1];
- }
-
- const uint32_t v0 = static_cast<uint32_t>(value / kTen8);
- const uint32_t v1 = static_cast<uint32_t>(value % kTen8);
-
- const uint32_t b0 = v0 / 10000;
- const uint32_t c0 = v0 % 10000;
-
- const uint32_t d1 = (b0 / 100) << 1;
- const uint32_t d2 = (b0 % 100) << 1;
-
- const uint32_t d3 = (c0 / 100) << 1;
- const uint32_t d4 = (c0 % 100) << 1;
-
- const uint32_t b1 = v1 / 10000;
- const uint32_t c1 = v1 % 10000;
-
- const uint32_t d5 = (b1 / 100) << 1;
- const uint32_t d6 = (b1 % 100) << 1;
-
- const uint32_t d7 = (c1 / 100) << 1;
- const uint32_t d8 = (c1 % 100) << 1;
-
- *buffer++ = cDigitsLut[d1];
- *buffer++ = cDigitsLut[d1 + 1];
- *buffer++ = cDigitsLut[d2];
- *buffer++ = cDigitsLut[d2 + 1];
- *buffer++ = cDigitsLut[d3];
- *buffer++ = cDigitsLut[d3 + 1];
- *buffer++ = cDigitsLut[d4];
- *buffer++ = cDigitsLut[d4 + 1];
- *buffer++ = cDigitsLut[d5];
- *buffer++ = cDigitsLut[d5 + 1];
- *buffer++ = cDigitsLut[d6];
- *buffer++ = cDigitsLut[d6 + 1];
- *buffer++ = cDigitsLut[d7];
- *buffer++ = cDigitsLut[d7 + 1];
- *buffer++ = cDigitsLut[d8];
- *buffer++ = cDigitsLut[d8 + 1];
- }
-
- return buffer;
-}
-
-inline char* i64toa(int64_t value, char* buffer) {
- RAPIDJSON_ASSERT(buffer != 0);
- uint64_t u = static_cast<uint64_t>(value);
- if (value < 0) {
- *buffer++ = '-';
- u = ~u + 1;
- }
-
- return u64toa(u, buffer);
-}
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_ITOA_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/meta.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/meta.h
deleted file mode 100644
index 76a1d5be46..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/meta.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_INTERNAL_META_H_
-#define RAPIDJSON_INTERNAL_META_H_
-
-#include "../rapidjson.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#if defined(_MSC_VER) && !defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(6334)
-#endif
-
-#if RAPIDJSON_HAS_CXX11_TYPETRAITS
-#include <type_traits>
-#endif
-
-//@cond RAPIDJSON_INTERNAL
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-// Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching
-template <typename T> struct Void { typedef void Type; };
-
-///////////////////////////////////////////////////////////////////////////////
-// BoolType, TrueType, FalseType
-//
-template <bool Cond> struct BoolType {
- static const bool Value = Cond;
- typedef BoolType Type;
-};
-typedef BoolType<true> TrueType;
-typedef BoolType<false> FalseType;
-
-
-///////////////////////////////////////////////////////////////////////////////
-// SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr
-//
-
-template <bool C> struct SelectIfImpl { template <typename T1, typename T2> struct Apply { typedef T1 Type; }; };
-template <> struct SelectIfImpl<false> { template <typename T1, typename T2> struct Apply { typedef T2 Type; }; };
-template <bool C, typename T1, typename T2> struct SelectIfCond : SelectIfImpl<C>::template Apply<T1,T2> {};
-template <typename C, typename T1, typename T2> struct SelectIf : SelectIfCond<C::Value, T1, T2> {};
-
-template <bool Cond1, bool Cond2> struct AndExprCond : FalseType {};
-template <> struct AndExprCond<true, true> : TrueType {};
-template <bool Cond1, bool Cond2> struct OrExprCond : TrueType {};
-template <> struct OrExprCond<false, false> : FalseType {};
-
-template <typename C> struct BoolExpr : SelectIf<C,TrueType,FalseType>::Type {};
-template <typename C> struct NotExpr : SelectIf<C,FalseType,TrueType>::Type {};
-template <typename C1, typename C2> struct AndExpr : AndExprCond<C1::Value, C2::Value>::Type {};
-template <typename C1, typename C2> struct OrExpr : OrExprCond<C1::Value, C2::Value>::Type {};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// AddConst, MaybeAddConst, RemoveConst
-template <typename T> struct AddConst { typedef const T Type; };
-template <bool Constify, typename T> struct MaybeAddConst : SelectIfCond<Constify, const T, T> {};
-template <typename T> struct RemoveConst { typedef T Type; };
-template <typename T> struct RemoveConst<const T> { typedef T Type; };
-
-
-///////////////////////////////////////////////////////////////////////////////
-// IsSame, IsConst, IsMoreConst, IsPointer
-//
-template <typename T, typename U> struct IsSame : FalseType {};
-template <typename T> struct IsSame<T, T> : TrueType {};
-
-template <typename T> struct IsConst : FalseType {};
-template <typename T> struct IsConst<const T> : TrueType {};
-
-template <typename CT, typename T>
-struct IsMoreConst
- : AndExpr<IsSame<typename RemoveConst<CT>::Type, typename RemoveConst<T>::Type>,
- BoolType<IsConst<CT>::Value >= IsConst<T>::Value> >::Type {};
-
-template <typename T> struct IsPointer : FalseType {};
-template <typename T> struct IsPointer<T*> : TrueType {};
-
-///////////////////////////////////////////////////////////////////////////////
-// IsBaseOf
-//
-#if RAPIDJSON_HAS_CXX11_TYPETRAITS
-
-template <typename B, typename D> struct IsBaseOf
- : BoolType< ::std::is_base_of<B,D>::value> {};
-
-#else // simplified version adopted from Boost
-
-template<typename B, typename D> struct IsBaseOfImpl {
- RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0);
- RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0);
-
- typedef char (&Yes)[1];
- typedef char (&No) [2];
-
- template <typename T>
- static Yes Check(const D*, T);
- static No Check(const B*, int);
-
- struct Host {
- operator const B*() const;
- operator const D*();
- };
-
- enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) };
-};
-
-template <typename B, typename D> struct IsBaseOf
- : OrExpr<IsSame<B, D>, BoolExpr<IsBaseOfImpl<B, D> > >::Type {};
-
-#endif // RAPIDJSON_HAS_CXX11_TYPETRAITS
-
-
-//////////////////////////////////////////////////////////////////////////
-// EnableIf / DisableIf
-//
-template <bool Condition, typename T = void> struct EnableIfCond { typedef T Type; };
-template <typename T> struct EnableIfCond<false, T> { /* empty */ };
-
-template <bool Condition, typename T = void> struct DisableIfCond { typedef T Type; };
-template <typename T> struct DisableIfCond<true, T> { /* empty */ };
-
-template <typename Condition, typename T = void>
-struct EnableIf : EnableIfCond<Condition::Value, T> {};
-
-template <typename Condition, typename T = void>
-struct DisableIf : DisableIfCond<Condition::Value, T> {};
-
-// SFINAE helpers
-struct SfinaeTag {};
-template <typename T> struct RemoveSfinaeTag;
-template <typename T> struct RemoveSfinaeTag<SfinaeTag&(*)(T)> { typedef T Type; };
-
-#define RAPIDJSON_REMOVEFPTR_(type) \
- typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \
- < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type
-
-#define RAPIDJSON_ENABLEIF(cond) \
- typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
- <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
-
-#define RAPIDJSON_DISABLEIF(cond) \
- typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
- <RAPIDJSON_REMOVEFPTR_(cond)>::Type * = NULL
-
-#define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \
- typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \
- <RAPIDJSON_REMOVEFPTR_(cond), \
- RAPIDJSON_REMOVEFPTR_(returntype)>::Type
-
-#define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \
- typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \
- <RAPIDJSON_REMOVEFPTR_(cond), \
- RAPIDJSON_REMOVEFPTR_(returntype)>::Type
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-//@endcond
-
-#if defined(_MSC_VER) && !defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_INTERNAL_META_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/pow10.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/pow10.h
deleted file mode 100644
index 04ee1f6b44..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/pow10.h
+++ /dev/null
@@ -1,55 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_POW10_
-#define RAPIDJSON_POW10_
-
-#include "../rapidjson.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-//! Computes integer powers of 10 in double (10.0^n).
-/*! This function uses lookup table for fast and accurate results.
- \param n non-negative exponent. Must <= 308.
- \return 10.0^n
-*/
-inline double Pow10(int n) {
- static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes
- 1e+0,
- 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20,
- 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40,
- 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60,
- 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80,
- 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100,
- 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120,
- 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140,
- 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160,
- 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180,
- 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200,
- 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220,
- 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240,
- 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260,
- 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280,
- 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300,
- 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308
- };
- RAPIDJSON_ASSERT(n >= 0 && n <= 308);
- return e[n];
-}
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_POW10_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/regex.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/regex.h
deleted file mode 100644
index e37126109f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/regex.h
+++ /dev/null
@@ -1,739 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_INTERNAL_REGEX_H_
-#define RAPIDJSON_INTERNAL_REGEX_H_
-
-#include "../allocators.h"
-#include "../stream.h"
-#include "stack.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-RAPIDJSON_DIAG_OFF(switch-enum)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#ifndef RAPIDJSON_REGEX_VERBOSE
-#define RAPIDJSON_REGEX_VERBOSE 0
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-///////////////////////////////////////////////////////////////////////////////
-// DecodedStream
-
-template <typename SourceStream, typename Encoding>
-class DecodedStream {
-public:
- DecodedStream(SourceStream& ss) : ss_(ss), codepoint_() { Decode(); }
- unsigned Peek() { return codepoint_; }
- unsigned Take() {
- unsigned c = codepoint_;
- if (c) // No further decoding when '\0'
- Decode();
- return c;
- }
-
-private:
- void Decode() {
- if (!Encoding::Decode(ss_, &codepoint_))
- codepoint_ = 0;
- }
-
- SourceStream& ss_;
- unsigned codepoint_;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericRegex
-
-static const SizeType kRegexInvalidState = ~SizeType(0); //!< Represents an invalid index in GenericRegex::State::out, out1
-static const SizeType kRegexInvalidRange = ~SizeType(0);
-
-template <typename Encoding, typename Allocator>
-class GenericRegexSearch;
-
-//! Regular expression engine with subset of ECMAscript grammar.
-/*!
- Supported regular expression syntax:
- - \c ab Concatenation
- - \c a|b Alternation
- - \c a? Zero or one
- - \c a* Zero or more
- - \c a+ One or more
- - \c a{3} Exactly 3 times
- - \c a{3,} At least 3 times
- - \c a{3,5} 3 to 5 times
- - \c (ab) Grouping
- - \c ^a At the beginning
- - \c a$ At the end
- - \c . Any character
- - \c [abc] Character classes
- - \c [a-c] Character class range
- - \c [a-z0-9_] Character class combination
- - \c [^abc] Negated character classes
- - \c [^a-c] Negated character class range
- - \c [\b] Backspace (U+0008)
- - \c \\| \\\\ ... Escape characters
- - \c \\f Form feed (U+000C)
- - \c \\n Line feed (U+000A)
- - \c \\r Carriage return (U+000D)
- - \c \\t Tab (U+0009)
- - \c \\v Vertical tab (U+000B)
-
- \note This is a Thompson NFA engine, implemented with reference to
- Cox, Russ. "Regular Expression Matching Can Be Simple And Fast (but is slow in Java, Perl, PHP, Python, Ruby,...).",
- https://swtch.com/~rsc/regexp/regexp1.html
-*/
-template <typename Encoding, typename Allocator = CrtAllocator>
-class GenericRegex {
-public:
- typedef Encoding EncodingType;
- typedef typename Encoding::Ch Ch;
- template <typename, typename> friend class GenericRegexSearch;
-
- GenericRegex(const Ch* source, Allocator* allocator = 0) :
- ownAllocator_(allocator ? 0 : RAPIDJSON_NEW(Allocator)()), allocator_(allocator ? allocator : ownAllocator_),
- states_(allocator_, 256), ranges_(allocator_, 256), root_(kRegexInvalidState), stateCount_(), rangeCount_(),
- anchorBegin_(), anchorEnd_()
- {
- GenericStringStream<Encoding> ss(source);
- DecodedStream<GenericStringStream<Encoding>, Encoding> ds(ss);
- Parse(ds);
- }
-
- ~GenericRegex()
- {
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- bool IsValid() const {
- return root_ != kRegexInvalidState;
- }
-
-private:
- enum Operator {
- kZeroOrOne,
- kZeroOrMore,
- kOneOrMore,
- kConcatenation,
- kAlternation,
- kLeftParenthesis
- };
-
- static const unsigned kAnyCharacterClass = 0xFFFFFFFF; //!< For '.'
- static const unsigned kRangeCharacterClass = 0xFFFFFFFE;
- static const unsigned kRangeNegationFlag = 0x80000000;
-
- struct Range {
- unsigned start; //
- unsigned end;
- SizeType next;
- };
-
- struct State {
- SizeType out; //!< Equals to kInvalid for matching state
- SizeType out1; //!< Equals to non-kInvalid for split
- SizeType rangeStart;
- unsigned codepoint;
- };
-
- struct Frag {
- Frag(SizeType s, SizeType o, SizeType m) : start(s), out(o), minIndex(m) {}
- SizeType start;
- SizeType out; //!< link-list of all output states
- SizeType minIndex;
- };
-
- State& GetState(SizeType index) {
- RAPIDJSON_ASSERT(index < stateCount_);
- return states_.template Bottom<State>()[index];
- }
-
- const State& GetState(SizeType index) const {
- RAPIDJSON_ASSERT(index < stateCount_);
- return states_.template Bottom<State>()[index];
- }
-
- Range& GetRange(SizeType index) {
- RAPIDJSON_ASSERT(index < rangeCount_);
- return ranges_.template Bottom<Range>()[index];
- }
-
- const Range& GetRange(SizeType index) const {
- RAPIDJSON_ASSERT(index < rangeCount_);
- return ranges_.template Bottom<Range>()[index];
- }
-
- template <typename InputStream>
- void Parse(DecodedStream<InputStream, Encoding>& ds) {
- Stack<Allocator> operandStack(allocator_, 256); // Frag
- Stack<Allocator> operatorStack(allocator_, 256); // Operator
- Stack<Allocator> atomCountStack(allocator_, 256); // unsigned (Atom per parenthesis)
-
- *atomCountStack.template Push<unsigned>() = 0;
-
- unsigned codepoint;
- while (ds.Peek() != 0) {
- switch (codepoint = ds.Take()) {
- case '^':
- anchorBegin_ = true;
- break;
-
- case '$':
- anchorEnd_ = true;
- break;
-
- case '|':
- while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() < kAlternation)
- if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
- return;
- *operatorStack.template Push<Operator>() = kAlternation;
- *atomCountStack.template Top<unsigned>() = 0;
- break;
-
- case '(':
- *operatorStack.template Push<Operator>() = kLeftParenthesis;
- *atomCountStack.template Push<unsigned>() = 0;
- break;
-
- case ')':
- while (!operatorStack.Empty() && *operatorStack.template Top<Operator>() != kLeftParenthesis)
- if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
- return;
- if (operatorStack.Empty())
- return;
- operatorStack.template Pop<Operator>(1);
- atomCountStack.template Pop<unsigned>(1);
- ImplicitConcatenation(atomCountStack, operatorStack);
- break;
-
- case '?':
- if (!Eval(operandStack, kZeroOrOne))
- return;
- break;
-
- case '*':
- if (!Eval(operandStack, kZeroOrMore))
- return;
- break;
-
- case '+':
- if (!Eval(operandStack, kOneOrMore))
- return;
- break;
-
- case '{':
- {
- unsigned n, m;
- if (!ParseUnsigned(ds, &n))
- return;
-
- if (ds.Peek() == ',') {
- ds.Take();
- if (ds.Peek() == '}')
- m = kInfinityQuantifier;
- else if (!ParseUnsigned(ds, &m) || m < n)
- return;
- }
- else
- m = n;
-
- if (!EvalQuantifier(operandStack, n, m) || ds.Peek() != '}')
- return;
- ds.Take();
- }
- break;
-
- case '.':
- PushOperand(operandStack, kAnyCharacterClass);
- ImplicitConcatenation(atomCountStack, operatorStack);
- break;
-
- case '[':
- {
- SizeType range;
- if (!ParseRange(ds, &range))
- return;
- SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, kRangeCharacterClass);
- GetState(s).rangeStart = range;
- *operandStack.template Push<Frag>() = Frag(s, s, s);
- }
- ImplicitConcatenation(atomCountStack, operatorStack);
- break;
-
- case '\\': // Escape character
- if (!CharacterEscape(ds, &codepoint))
- return; // Unsupported escape character
- // fall through to default
- RAPIDJSON_DELIBERATE_FALLTHROUGH;
-
- default: // Pattern character
- PushOperand(operandStack, codepoint);
- ImplicitConcatenation(atomCountStack, operatorStack);
- }
- }
-
- while (!operatorStack.Empty())
- if (!Eval(operandStack, *operatorStack.template Pop<Operator>(1)))
- return;
-
- // Link the operand to matching state.
- if (operandStack.GetSize() == sizeof(Frag)) {
- Frag* e = operandStack.template Pop<Frag>(1);
- Patch(e->out, NewState(kRegexInvalidState, kRegexInvalidState, 0));
- root_ = e->start;
-
-#if RAPIDJSON_REGEX_VERBOSE
- printf("root: %d\n", root_);
- for (SizeType i = 0; i < stateCount_ ; i++) {
- State& s = GetState(i);
- printf("[%2d] out: %2d out1: %2d c: '%c'\n", i, s.out, s.out1, (char)s.codepoint);
- }
- printf("\n");
-#endif
- }
- }
-
- SizeType NewState(SizeType out, SizeType out1, unsigned codepoint) {
- State* s = states_.template Push<State>();
- s->out = out;
- s->out1 = out1;
- s->codepoint = codepoint;
- s->rangeStart = kRegexInvalidRange;
- return stateCount_++;
- }
-
- void PushOperand(Stack<Allocator>& operandStack, unsigned codepoint) {
- SizeType s = NewState(kRegexInvalidState, kRegexInvalidState, codepoint);
- *operandStack.template Push<Frag>() = Frag(s, s, s);
- }
-
- void ImplicitConcatenation(Stack<Allocator>& atomCountStack, Stack<Allocator>& operatorStack) {
- if (*atomCountStack.template Top<unsigned>())
- *operatorStack.template Push<Operator>() = kConcatenation;
- (*atomCountStack.template Top<unsigned>())++;
- }
-
- SizeType Append(SizeType l1, SizeType l2) {
- SizeType old = l1;
- while (GetState(l1).out != kRegexInvalidState)
- l1 = GetState(l1).out;
- GetState(l1).out = l2;
- return old;
- }
-
- void Patch(SizeType l, SizeType s) {
- for (SizeType next; l != kRegexInvalidState; l = next) {
- next = GetState(l).out;
- GetState(l).out = s;
- }
- }
-
- bool Eval(Stack<Allocator>& operandStack, Operator op) {
- switch (op) {
- case kConcatenation:
- RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag) * 2);
- {
- Frag e2 = *operandStack.template Pop<Frag>(1);
- Frag e1 = *operandStack.template Pop<Frag>(1);
- Patch(e1.out, e2.start);
- *operandStack.template Push<Frag>() = Frag(e1.start, e2.out, Min(e1.minIndex, e2.minIndex));
- }
- return true;
-
- case kAlternation:
- if (operandStack.GetSize() >= sizeof(Frag) * 2) {
- Frag e2 = *operandStack.template Pop<Frag>(1);
- Frag e1 = *operandStack.template Pop<Frag>(1);
- SizeType s = NewState(e1.start, e2.start, 0);
- *operandStack.template Push<Frag>() = Frag(s, Append(e1.out, e2.out), Min(e1.minIndex, e2.minIndex));
- return true;
- }
- return false;
-
- case kZeroOrOne:
- if (operandStack.GetSize() >= sizeof(Frag)) {
- Frag e = *operandStack.template Pop<Frag>(1);
- SizeType s = NewState(kRegexInvalidState, e.start, 0);
- *operandStack.template Push<Frag>() = Frag(s, Append(e.out, s), e.minIndex);
- return true;
- }
- return false;
-
- case kZeroOrMore:
- if (operandStack.GetSize() >= sizeof(Frag)) {
- Frag e = *operandStack.template Pop<Frag>(1);
- SizeType s = NewState(kRegexInvalidState, e.start, 0);
- Patch(e.out, s);
- *operandStack.template Push<Frag>() = Frag(s, s, e.minIndex);
- return true;
- }
- return false;
-
- case kOneOrMore:
- if (operandStack.GetSize() >= sizeof(Frag)) {
- Frag e = *operandStack.template Pop<Frag>(1);
- SizeType s = NewState(kRegexInvalidState, e.start, 0);
- Patch(e.out, s);
- *operandStack.template Push<Frag>() = Frag(e.start, s, e.minIndex);
- return true;
- }
- return false;
-
- default:
- // syntax error (e.g. unclosed kLeftParenthesis)
- return false;
- }
- }
-
- bool EvalQuantifier(Stack<Allocator>& operandStack, unsigned n, unsigned m) {
- RAPIDJSON_ASSERT(n <= m);
- RAPIDJSON_ASSERT(operandStack.GetSize() >= sizeof(Frag));
-
- if (n == 0) {
- if (m == 0) // a{0} not support
- return false;
- else if (m == kInfinityQuantifier)
- Eval(operandStack, kZeroOrMore); // a{0,} -> a*
- else {
- Eval(operandStack, kZeroOrOne); // a{0,5} -> a?
- for (unsigned i = 0; i < m - 1; i++)
- CloneTopOperand(operandStack); // a{0,5} -> a? a? a? a? a?
- for (unsigned i = 0; i < m - 1; i++)
- Eval(operandStack, kConcatenation); // a{0,5} -> a?a?a?a?a?
- }
- return true;
- }
-
- for (unsigned i = 0; i < n - 1; i++) // a{3} -> a a a
- CloneTopOperand(operandStack);
-
- if (m == kInfinityQuantifier)
- Eval(operandStack, kOneOrMore); // a{3,} -> a a a+
- else if (m > n) {
- CloneTopOperand(operandStack); // a{3,5} -> a a a a
- Eval(operandStack, kZeroOrOne); // a{3,5} -> a a a a?
- for (unsigned i = n; i < m - 1; i++)
- CloneTopOperand(operandStack); // a{3,5} -> a a a a? a?
- for (unsigned i = n; i < m; i++)
- Eval(operandStack, kConcatenation); // a{3,5} -> a a aa?a?
- }
-
- for (unsigned i = 0; i < n - 1; i++)
- Eval(operandStack, kConcatenation); // a{3} -> aaa, a{3,} -> aaa+, a{3.5} -> aaaa?a?
-
- return true;
- }
-
- static SizeType Min(SizeType a, SizeType b) { return a < b ? a : b; }
-
- void CloneTopOperand(Stack<Allocator>& operandStack) {
- const Frag src = *operandStack.template Top<Frag>(); // Copy constructor to prevent invalidation
- SizeType count = stateCount_ - src.minIndex; // Assumes top operand contains states in [src->minIndex, stateCount_)
- State* s = states_.template Push<State>(count);
- memcpy(s, &GetState(src.minIndex), count * sizeof(State));
- for (SizeType j = 0; j < count; j++) {
- if (s[j].out != kRegexInvalidState)
- s[j].out += count;
- if (s[j].out1 != kRegexInvalidState)
- s[j].out1 += count;
- }
- *operandStack.template Push<Frag>() = Frag(src.start + count, src.out + count, src.minIndex + count);
- stateCount_ += count;
- }
-
- template <typename InputStream>
- bool ParseUnsigned(DecodedStream<InputStream, Encoding>& ds, unsigned* u) {
- unsigned r = 0;
- if (ds.Peek() < '0' || ds.Peek() > '9')
- return false;
- while (ds.Peek() >= '0' && ds.Peek() <= '9') {
- if (r >= 429496729 && ds.Peek() > '5') // 2^32 - 1 = 4294967295
- return false; // overflow
- r = r * 10 + (ds.Take() - '0');
- }
- *u = r;
- return true;
- }
-
- template <typename InputStream>
- bool ParseRange(DecodedStream<InputStream, Encoding>& ds, SizeType* range) {
- bool isBegin = true;
- bool negate = false;
- int step = 0;
- SizeType start = kRegexInvalidRange;
- SizeType current = kRegexInvalidRange;
- unsigned codepoint;
- while ((codepoint = ds.Take()) != 0) {
- if (isBegin) {
- isBegin = false;
- if (codepoint == '^') {
- negate = true;
- continue;
- }
- }
-
- switch (codepoint) {
- case ']':
- if (start == kRegexInvalidRange)
- return false; // Error: nothing inside []
- if (step == 2) { // Add trailing '-'
- SizeType r = NewRange('-');
- RAPIDJSON_ASSERT(current != kRegexInvalidRange);
- GetRange(current).next = r;
- }
- if (negate)
- GetRange(start).start |= kRangeNegationFlag;
- *range = start;
- return true;
-
- case '\\':
- if (ds.Peek() == 'b') {
- ds.Take();
- codepoint = 0x0008; // Escape backspace character
- }
- else if (!CharacterEscape(ds, &codepoint))
- return false;
- // fall through to default
- RAPIDJSON_DELIBERATE_FALLTHROUGH;
-
- default:
- switch (step) {
- case 1:
- if (codepoint == '-') {
- step++;
- break;
- }
- // fall through to step 0 for other characters
- RAPIDJSON_DELIBERATE_FALLTHROUGH;
-
- case 0:
- {
- SizeType r = NewRange(codepoint);
- if (current != kRegexInvalidRange)
- GetRange(current).next = r;
- if (start == kRegexInvalidRange)
- start = r;
- current = r;
- }
- step = 1;
- break;
-
- default:
- RAPIDJSON_ASSERT(step == 2);
- GetRange(current).end = codepoint;
- step = 0;
- }
- }
- }
- return false;
- }
-
- SizeType NewRange(unsigned codepoint) {
- Range* r = ranges_.template Push<Range>();
- r->start = r->end = codepoint;
- r->next = kRegexInvalidRange;
- return rangeCount_++;
- }
-
- template <typename InputStream>
- bool CharacterEscape(DecodedStream<InputStream, Encoding>& ds, unsigned* escapedCodepoint) {
- unsigned codepoint;
- switch (codepoint = ds.Take()) {
- case '^':
- case '$':
- case '|':
- case '(':
- case ')':
- case '?':
- case '*':
- case '+':
- case '.':
- case '[':
- case ']':
- case '{':
- case '}':
- case '\\':
- *escapedCodepoint = codepoint; return true;
- case 'f': *escapedCodepoint = 0x000C; return true;
- case 'n': *escapedCodepoint = 0x000A; return true;
- case 'r': *escapedCodepoint = 0x000D; return true;
- case 't': *escapedCodepoint = 0x0009; return true;
- case 'v': *escapedCodepoint = 0x000B; return true;
- default:
- return false; // Unsupported escape character
- }
- }
-
- Allocator* ownAllocator_;
- Allocator* allocator_;
- Stack<Allocator> states_;
- Stack<Allocator> ranges_;
- SizeType root_;
- SizeType stateCount_;
- SizeType rangeCount_;
-
- static const unsigned kInfinityQuantifier = ~0u;
-
- // For SearchWithAnchoring()
- bool anchorBegin_;
- bool anchorEnd_;
-};
-
-template <typename RegexType, typename Allocator = CrtAllocator>
-class GenericRegexSearch {
-public:
- typedef typename RegexType::EncodingType Encoding;
- typedef typename Encoding::Ch Ch;
-
- GenericRegexSearch(const RegexType& regex, Allocator* allocator = 0) :
- regex_(regex), allocator_(allocator), ownAllocator_(0),
- state0_(allocator, 0), state1_(allocator, 0), stateSet_()
- {
- RAPIDJSON_ASSERT(regex_.IsValid());
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
- stateSet_ = static_cast<unsigned*>(allocator_->Malloc(GetStateSetSize()));
- state0_.template Reserve<SizeType>(regex_.stateCount_);
- state1_.template Reserve<SizeType>(regex_.stateCount_);
- }
-
- ~GenericRegexSearch() {
- Allocator::Free(stateSet_);
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- template <typename InputStream>
- bool Match(InputStream& is) {
- return SearchWithAnchoring(is, true, true);
- }
-
- bool Match(const Ch* s) {
- GenericStringStream<Encoding> is(s);
- return Match(is);
- }
-
- template <typename InputStream>
- bool Search(InputStream& is) {
- return SearchWithAnchoring(is, regex_.anchorBegin_, regex_.anchorEnd_);
- }
-
- bool Search(const Ch* s) {
- GenericStringStream<Encoding> is(s);
- return Search(is);
- }
-
-private:
- typedef typename RegexType::State State;
- typedef typename RegexType::Range Range;
-
- template <typename InputStream>
- bool SearchWithAnchoring(InputStream& is, bool anchorBegin, bool anchorEnd) {
- DecodedStream<InputStream, Encoding> ds(is);
-
- state0_.Clear();
- Stack<Allocator> *current = &state0_, *next = &state1_;
- const size_t stateSetSize = GetStateSetSize();
- std::memset(stateSet_, 0, stateSetSize);
-
- bool matched = AddState(*current, regex_.root_);
- unsigned codepoint;
- while (!current->Empty() && (codepoint = ds.Take()) != 0) {
- std::memset(stateSet_, 0, stateSetSize);
- next->Clear();
- matched = false;
- for (const SizeType* s = current->template Bottom<SizeType>(); s != current->template End<SizeType>(); ++s) {
- const State& sr = regex_.GetState(*s);
- if (sr.codepoint == codepoint ||
- sr.codepoint == RegexType::kAnyCharacterClass ||
- (sr.codepoint == RegexType::kRangeCharacterClass && MatchRange(sr.rangeStart, codepoint)))
- {
- matched = AddState(*next, sr.out) || matched;
- if (!anchorEnd && matched)
- return true;
- }
- if (!anchorBegin)
- AddState(*next, regex_.root_);
- }
- internal::Swap(current, next);
- }
-
- return matched;
- }
-
- size_t GetStateSetSize() const {
- return (regex_.stateCount_ + 31) / 32 * 4;
- }
-
- // Return whether the added states is a match state
- bool AddState(Stack<Allocator>& l, SizeType index) {
- RAPIDJSON_ASSERT(index != kRegexInvalidState);
-
- const State& s = regex_.GetState(index);
- if (s.out1 != kRegexInvalidState) { // Split
- bool matched = AddState(l, s.out);
- return AddState(l, s.out1) || matched;
- }
- else if (!(stateSet_[index >> 5] & (1u << (index & 31)))) {
- stateSet_[index >> 5] |= (1u << (index & 31));
- *l.template PushUnsafe<SizeType>() = index;
- }
- return s.out == kRegexInvalidState; // by using PushUnsafe() above, we can ensure s is not validated due to reallocation.
- }
-
- bool MatchRange(SizeType rangeIndex, unsigned codepoint) const {
- bool yes = (regex_.GetRange(rangeIndex).start & RegexType::kRangeNegationFlag) == 0;
- while (rangeIndex != kRegexInvalidRange) {
- const Range& r = regex_.GetRange(rangeIndex);
- if (codepoint >= (r.start & ~RegexType::kRangeNegationFlag) && codepoint <= r.end)
- return yes;
- rangeIndex = r.next;
- }
- return !yes;
- }
-
- const RegexType& regex_;
- Allocator* allocator_;
- Allocator* ownAllocator_;
- Stack<Allocator> state0_;
- Stack<Allocator> state1_;
- uint32_t* stateSet_;
-};
-
-typedef GenericRegex<UTF8<> > Regex;
-typedef GenericRegexSearch<Regex> RegexSearch;
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#if defined(__clang__) || defined(_MSC_VER)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_INTERNAL_REGEX_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/stack.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/stack.h
deleted file mode 100644
index ceead44907..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/stack.h
+++ /dev/null
@@ -1,232 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_INTERNAL_STACK_H_
-#define RAPIDJSON_INTERNAL_STACK_H_
-
-#include "../allocators.h"
-#include "swap.h"
-#include <cstddef>
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-///////////////////////////////////////////////////////////////////////////////
-// Stack
-
-//! A type-unsafe stack for storing different types of data.
-/*! \tparam Allocator Allocator for allocating stack memory.
-*/
-template <typename Allocator>
-class Stack {
-public:
- // Optimization note: Do not allocate memory for stack_ in constructor.
- // Do it lazily when first Push() -> Expand() -> Resize().
- Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) {
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- Stack(Stack&& rhs)
- : allocator_(rhs.allocator_),
- ownAllocator_(rhs.ownAllocator_),
- stack_(rhs.stack_),
- stackTop_(rhs.stackTop_),
- stackEnd_(rhs.stackEnd_),
- initialCapacity_(rhs.initialCapacity_)
- {
- rhs.allocator_ = 0;
- rhs.ownAllocator_ = 0;
- rhs.stack_ = 0;
- rhs.stackTop_ = 0;
- rhs.stackEnd_ = 0;
- rhs.initialCapacity_ = 0;
- }
-#endif
-
- ~Stack() {
- Destroy();
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- Stack& operator=(Stack&& rhs) {
- if (&rhs != this)
- {
- Destroy();
-
- allocator_ = rhs.allocator_;
- ownAllocator_ = rhs.ownAllocator_;
- stack_ = rhs.stack_;
- stackTop_ = rhs.stackTop_;
- stackEnd_ = rhs.stackEnd_;
- initialCapacity_ = rhs.initialCapacity_;
-
- rhs.allocator_ = 0;
- rhs.ownAllocator_ = 0;
- rhs.stack_ = 0;
- rhs.stackTop_ = 0;
- rhs.stackEnd_ = 0;
- rhs.initialCapacity_ = 0;
- }
- return *this;
- }
-#endif
-
- void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT {
- internal::Swap(allocator_, rhs.allocator_);
- internal::Swap(ownAllocator_, rhs.ownAllocator_);
- internal::Swap(stack_, rhs.stack_);
- internal::Swap(stackTop_, rhs.stackTop_);
- internal::Swap(stackEnd_, rhs.stackEnd_);
- internal::Swap(initialCapacity_, rhs.initialCapacity_);
- }
-
- void Clear() { stackTop_ = stack_; }
-
- void ShrinkToFit() {
- if (Empty()) {
- // If the stack is empty, completely deallocate the memory.
- Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc)
- stack_ = 0;
- stackTop_ = 0;
- stackEnd_ = 0;
- }
- else
- Resize(GetSize());
- }
-
- // Optimization note: try to minimize the size of this function for force inline.
- // Expansion is run very infrequently, so it is moved to another (probably non-inline) function.
- template<typename T>
- RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) {
- // Expand the stack if needed
- if (RAPIDJSON_UNLIKELY(static_cast<std::ptrdiff_t>(sizeof(T) * count) > (stackEnd_ - stackTop_)))
- Expand<T>(count);
- }
-
- template<typename T>
- RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) {
- Reserve<T>(count);
- return PushUnsafe<T>(count);
- }
-
- template<typename T>
- RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) {
- RAPIDJSON_ASSERT(stackTop_);
- RAPIDJSON_ASSERT(static_cast<std::ptrdiff_t>(sizeof(T) * count) <= (stackEnd_ - stackTop_));
- T* ret = reinterpret_cast<T*>(stackTop_);
- stackTop_ += sizeof(T) * count;
- return ret;
- }
-
- template<typename T>
- T* Pop(size_t count) {
- RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T));
- stackTop_ -= count * sizeof(T);
- return reinterpret_cast<T*>(stackTop_);
- }
-
- template<typename T>
- T* Top() {
- RAPIDJSON_ASSERT(GetSize() >= sizeof(T));
- return reinterpret_cast<T*>(stackTop_ - sizeof(T));
- }
-
- template<typename T>
- const T* Top() const {
- RAPIDJSON_ASSERT(GetSize() >= sizeof(T));
- return reinterpret_cast<T*>(stackTop_ - sizeof(T));
- }
-
- template<typename T>
- T* End() { return reinterpret_cast<T*>(stackTop_); }
-
- template<typename T>
- const T* End() const { return reinterpret_cast<T*>(stackTop_); }
-
- template<typename T>
- T* Bottom() { return reinterpret_cast<T*>(stack_); }
-
- template<typename T>
- const T* Bottom() const { return reinterpret_cast<T*>(stack_); }
-
- bool HasAllocator() const {
- return allocator_ != 0;
- }
-
- Allocator& GetAllocator() {
- RAPIDJSON_ASSERT(allocator_);
- return *allocator_;
- }
-
- bool Empty() const { return stackTop_ == stack_; }
- size_t GetSize() const { return static_cast<size_t>(stackTop_ - stack_); }
- size_t GetCapacity() const { return static_cast<size_t>(stackEnd_ - stack_); }
-
-private:
- template<typename T>
- void Expand(size_t count) {
- // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity.
- size_t newCapacity;
- if (stack_ == 0) {
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
- newCapacity = initialCapacity_;
- } else {
- newCapacity = GetCapacity();
- newCapacity += (newCapacity + 1) / 2;
- }
- size_t newSize = GetSize() + sizeof(T) * count;
- if (newCapacity < newSize)
- newCapacity = newSize;
-
- Resize(newCapacity);
- }
-
- void Resize(size_t newCapacity) {
- const size_t size = GetSize(); // Backup the current size
- stack_ = static_cast<char*>(allocator_->Realloc(stack_, GetCapacity(), newCapacity));
- stackTop_ = stack_ + size;
- stackEnd_ = stack_ + newCapacity;
- }
-
- void Destroy() {
- Allocator::Free(stack_);
- RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack
- }
-
- // Prohibit copy constructor & assignment operator.
- Stack(const Stack&);
- Stack& operator=(const Stack&);
-
- Allocator* allocator_;
- Allocator* ownAllocator_;
- char *stack_;
- char *stackTop_;
- char *stackEnd_;
- size_t initialCapacity_;
-};
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_STACK_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strfunc.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strfunc.h
deleted file mode 100644
index 1a88f49bba..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strfunc.h
+++ /dev/null
@@ -1,83 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_INTERNAL_STRFUNC_H_
-#define RAPIDJSON_INTERNAL_STRFUNC_H_
-
-#include "../stream.h"
-#include <cwchar>
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-//! Custom strlen() which works on different character types.
-/*! \tparam Ch Character type (e.g. char, wchar_t, short)
- \param s Null-terminated input string.
- \return Number of characters in the string.
- \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints.
-*/
-template <typename Ch>
-inline SizeType StrLen(const Ch* s) {
- RAPIDJSON_ASSERT(s != 0);
- const Ch* p = s;
- while (*p) ++p;
- return SizeType(p - s);
-}
-
-template <>
-inline SizeType StrLen(const char* s) {
- return SizeType(std::strlen(s));
-}
-
-template <>
-inline SizeType StrLen(const wchar_t* s) {
- return SizeType(std::wcslen(s));
-}
-
-//! Custom strcmpn() which works on different character types.
-/*! \tparam Ch Character type (e.g. char, wchar_t, short)
- \param s1 Null-terminated input string.
- \param s2 Null-terminated input string.
- \return 0 if equal
-*/
-template<typename Ch>
-inline int StrCmp(const Ch* s1, const Ch* s2) {
- RAPIDJSON_ASSERT(s1 != 0);
- RAPIDJSON_ASSERT(s2 != 0);
- while(*s1 && (*s1 == *s2)) { s1++; s2++; }
- return static_cast<unsigned>(*s1) < static_cast<unsigned>(*s2) ? -1 : static_cast<unsigned>(*s1) > static_cast<unsigned>(*s2);
-}
-
-//! Returns number of code points in a encoded string.
-template<typename Encoding>
-bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) {
- RAPIDJSON_ASSERT(s != 0);
- RAPIDJSON_ASSERT(outCount != 0);
- GenericStringStream<Encoding> is(s);
- const typename Encoding::Ch* end = s + length;
- SizeType count = 0;
- while (is.src_ < end) {
- unsigned codepoint;
- if (!Encoding::Decode(is, &codepoint))
- return false;
- count++;
- }
- *outCount = count;
- return true;
-}
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_INTERNAL_STRFUNC_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strtod.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strtod.h
deleted file mode 100644
index 62a42c69d8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/strtod.h
+++ /dev/null
@@ -1,293 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_STRTOD_
-#define RAPIDJSON_STRTOD_
-
-#include "ieee754.h"
-#include "biginteger.h"
-#include "diyfp.h"
-#include "pow10.h"
-#include <climits>
-#include <limits>
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-inline double FastPath(double significand, int exp) {
- if (exp < -308)
- return 0.0;
- else if (exp >= 0)
- return significand * internal::Pow10(exp);
- else
- return significand / internal::Pow10(-exp);
-}
-
-inline double StrtodNormalPrecision(double d, int p) {
- if (p < -308) {
- // Prevent expSum < -308, making Pow10(p) = 0
- d = FastPath(d, -308);
- d = FastPath(d, p + 308);
- }
- else
- d = FastPath(d, p);
- return d;
-}
-
-template <typename T>
-inline T Min3(T a, T b, T c) {
- T m = a;
- if (m > b) m = b;
- if (m > c) m = c;
- return m;
-}
-
-inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) {
- const Double db(b);
- const uint64_t bInt = db.IntegerSignificand();
- const int bExp = db.IntegerExponent();
- const int hExp = bExp - 1;
-
- int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0;
-
- // Adjust for decimal exponent
- if (dExp >= 0) {
- dS_Exp2 += dExp;
- dS_Exp5 += dExp;
- }
- else {
- bS_Exp2 -= dExp;
- bS_Exp5 -= dExp;
- hS_Exp2 -= dExp;
- hS_Exp5 -= dExp;
- }
-
- // Adjust for binary exponent
- if (bExp >= 0)
- bS_Exp2 += bExp;
- else {
- dS_Exp2 -= bExp;
- hS_Exp2 -= bExp;
- }
-
- // Adjust for half ulp exponent
- if (hExp >= 0)
- hS_Exp2 += hExp;
- else {
- dS_Exp2 -= hExp;
- bS_Exp2 -= hExp;
- }
-
- // Remove common power of two factor from all three scaled values
- int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2);
- dS_Exp2 -= common_Exp2;
- bS_Exp2 -= common_Exp2;
- hS_Exp2 -= common_Exp2;
-
- BigInteger dS = d;
- dS.MultiplyPow5(static_cast<unsigned>(dS_Exp5)) <<= static_cast<unsigned>(dS_Exp2);
-
- BigInteger bS(bInt);
- bS.MultiplyPow5(static_cast<unsigned>(bS_Exp5)) <<= static_cast<unsigned>(bS_Exp2);
-
- BigInteger hS(1);
- hS.MultiplyPow5(static_cast<unsigned>(hS_Exp5)) <<= static_cast<unsigned>(hS_Exp2);
-
- BigInteger delta(0);
- dS.Difference(bS, &delta);
-
- return delta.Compare(hS);
-}
-
-inline bool StrtodFast(double d, int p, double* result) {
- // Use fast path for string-to-double conversion if possible
- // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/
- if (p > 22 && p < 22 + 16) {
- // Fast Path Cases In Disguise
- d *= internal::Pow10(p - 22);
- p = 22;
- }
-
- if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1
- *result = FastPath(d, p);
- return true;
- }
- else
- return false;
-}
-
-// Compute an approximation and see if it is within 1/2 ULP
-template<typename Ch>
-inline bool StrtodDiyFp(const Ch* decimals, int dLen, int dExp, double* result) {
- uint64_t significand = 0;
- int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999
- for (; i < dLen; i++) {
- if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) ||
- (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > Ch('5')))
- break;
- significand = significand * 10u + static_cast<unsigned>(decimals[i] - Ch('0'));
- }
-
- if (i < dLen && decimals[i] >= Ch('5')) // Rounding
- significand++;
-
- int remaining = dLen - i;
- const int kUlpShift = 3;
- const int kUlp = 1 << kUlpShift;
- int64_t error = (remaining == 0) ? 0 : kUlp / 2;
-
- DiyFp v(significand, 0);
- v = v.Normalize();
- error <<= -v.e;
-
- dExp += remaining;
-
- int actualExp;
- DiyFp cachedPower = GetCachedPower10(dExp, &actualExp);
- if (actualExp != dExp) {
- static const DiyFp kPow10[] = {
- DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1
- DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2
- DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3
- DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4
- DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5
- DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6
- DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7
- };
- int adjustment = dExp - actualExp;
- RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8);
- v = v * kPow10[adjustment - 1];
- if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit
- error += kUlp / 2;
- }
-
- v = v * cachedPower;
-
- error += kUlp + (error == 0 ? 0 : 1);
-
- const int oldExp = v.e;
- v = v.Normalize();
- error <<= oldExp - v.e;
-
- const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e);
- int precisionSize = 64 - effectiveSignificandSize;
- if (precisionSize + kUlpShift >= 64) {
- int scaleExp = (precisionSize + kUlpShift) - 63;
- v.f >>= scaleExp;
- v.e += scaleExp;
- error = (error >> scaleExp) + 1 + kUlp;
- precisionSize -= scaleExp;
- }
-
- DiyFp rounded(v.f >> precisionSize, v.e + precisionSize);
- const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp;
- const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp;
- if (precisionBits >= halfWay + static_cast<unsigned>(error)) {
- rounded.f++;
- if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340)
- rounded.f >>= 1;
- rounded.e++;
- }
- }
-
- *result = rounded.ToDouble();
-
- return halfWay - static_cast<unsigned>(error) >= precisionBits || precisionBits >= halfWay + static_cast<unsigned>(error);
-}
-
-template<typename Ch>
-inline double StrtodBigInteger(double approx, const Ch* decimals, int dLen, int dExp) {
- RAPIDJSON_ASSERT(dLen >= 0);
- const BigInteger dInt(decimals, static_cast<unsigned>(dLen));
- Double a(approx);
- int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp);
- if (cmp < 0)
- return a.Value(); // within half ULP
- else if (cmp == 0) {
- // Round towards even
- if (a.Significand() & 1)
- return a.NextPositiveDouble();
- else
- return a.Value();
- }
- else // adjustment
- return a.NextPositiveDouble();
-}
-
-template<typename Ch>
-inline double StrtodFullPrecision(double d, int p, const Ch* decimals, size_t length, size_t decimalPosition, int exp) {
- RAPIDJSON_ASSERT(d >= 0.0);
- RAPIDJSON_ASSERT(length >= 1);
-
- double result = 0.0;
- if (StrtodFast(d, p, &result))
- return result;
-
- RAPIDJSON_ASSERT(length <= INT_MAX);
- int dLen = static_cast<int>(length);
-
- RAPIDJSON_ASSERT(length >= decimalPosition);
- RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX);
- int dExpAdjust = static_cast<int>(length - decimalPosition);
-
- RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust);
- int dExp = exp - dExpAdjust;
-
- // Make sure length+dExp does not overflow
- RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen);
-
- // Trim leading zeros
- while (dLen > 0 && *decimals == '0') {
- dLen--;
- decimals++;
- }
-
- // Trim trailing zeros
- while (dLen > 0 && decimals[dLen - 1] == '0') {
- dLen--;
- dExp++;
- }
-
- if (dLen == 0) { // Buffer only contains zeros.
- return 0.0;
- }
-
- // Trim right-most digits
- const int kMaxDecimalDigit = 767 + 1;
- if (dLen > kMaxDecimalDigit) {
- dExp += dLen - kMaxDecimalDigit;
- dLen = kMaxDecimalDigit;
- }
-
- // If too small, underflow to zero.
- // Any x <= 10^-324 is interpreted as zero.
- if (dLen + dExp <= -324)
- return 0.0;
-
- // If too large, overflow to infinity.
- // Any x >= 10^309 is interpreted as +infinity.
- if (dLen + dExp > 309)
- return std::numeric_limits<double>::infinity();
-
- if (StrtodDiyFp(decimals, dLen, dExp, &result))
- return result;
-
- // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison
- return StrtodBigInteger(result, decimals, dLen, dExp);
-}
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_STRTOD_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/swap.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/swap.h
deleted file mode 100644
index 2cf92f93a1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/internal/swap.h
+++ /dev/null
@@ -1,46 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_INTERNAL_SWAP_H_
-#define RAPIDJSON_INTERNAL_SWAP_H_
-
-#include "../rapidjson.h"
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-namespace internal {
-
-//! Custom swap() to avoid dependency on C++ <algorithm> header
-/*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only.
- \note This has the same semantics as std::swap().
-*/
-template <typename T>
-inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT {
- T tmp = a;
- a = b;
- b = tmp;
-}
-
-} // namespace internal
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_INTERNAL_SWAP_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/istreamwrapper.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/istreamwrapper.h
deleted file mode 100644
index 23dd83e96c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/istreamwrapper.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_ISTREAMWRAPPER_H_
-#define RAPIDJSON_ISTREAMWRAPPER_H_
-
-#include "stream.h"
-#include <iosfwd>
-#include <ios>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Wrapper of \c std::basic_istream into RapidJSON's Stream concept.
-/*!
- The classes can be wrapped including but not limited to:
-
- - \c std::istringstream
- - \c std::stringstream
- - \c std::wistringstream
- - \c std::wstringstream
- - \c std::ifstream
- - \c std::fstream
- - \c std::wifstream
- - \c std::wfstream
-
- \tparam StreamType Class derived from \c std::basic_istream.
-*/
-
-template <typename StreamType>
-class BasicIStreamWrapper {
-public:
- typedef typename StreamType::char_type Ch;
-
- //! Constructor.
- /*!
- \param stream stream opened for read.
- */
- BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
- Read();
- }
-
- //! Constructor.
- /*!
- \param stream stream opened for read.
- \param buffer user-supplied buffer.
- \param bufferSize size of buffer in bytes. Must >=4 bytes.
- */
- BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) {
- RAPIDJSON_ASSERT(bufferSize >= 4);
- Read();
- }
-
- Ch Peek() const { return *current_; }
- Ch Take() { Ch c = *current_; Read(); return c; }
- size_t Tell() const { return count_ + static_cast<size_t>(current_ - buffer_); }
-
- // Not implemented
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
- // For encoding detection only.
- const Ch* Peek4() const {
- return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0;
- }
-
-private:
- BasicIStreamWrapper();
- BasicIStreamWrapper(const BasicIStreamWrapper&);
- BasicIStreamWrapper& operator=(const BasicIStreamWrapper&);
-
- void Read() {
- if (current_ < bufferLast_)
- ++current_;
- else if (!eof_) {
- count_ += readCount_;
- readCount_ = bufferSize_;
- bufferLast_ = buffer_ + readCount_ - 1;
- current_ = buffer_;
-
- if (!stream_.read(buffer_, static_cast<std::streamsize>(bufferSize_))) {
- readCount_ = static_cast<size_t>(stream_.gcount());
- *(bufferLast_ = buffer_ + readCount_) = '\0';
- eof_ = true;
- }
- }
- }
-
- StreamType &stream_;
- Ch peekBuffer_[4], *buffer_;
- size_t bufferSize_;
- Ch *bufferLast_;
- Ch *current_;
- size_t readCount_;
- size_t count_; //!< Number of characters read
- bool eof_;
-};
-
-typedef BasicIStreamWrapper<std::istream> IStreamWrapper;
-typedef BasicIStreamWrapper<std::wistream> WIStreamWrapper;
-
-#if defined(__clang__) || defined(_MSC_VER)
-RAPIDJSON_DIAG_POP
-#endif
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_ISTREAMWRAPPER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorybuffer.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorybuffer.h
deleted file mode 100644
index 14aad68636..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorybuffer.h
+++ /dev/null
@@ -1,70 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_MEMORYBUFFER_H_
-#define RAPIDJSON_MEMORYBUFFER_H_
-
-#include "stream.h"
-#include "internal/stack.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Represents an in-memory output byte stream.
-/*!
- This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream.
-
- It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file.
-
- Differences between MemoryBuffer and StringBuffer:
- 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer.
- 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator.
-
- \tparam Allocator type for allocating memory buffer.
- \note implements Stream concept
-*/
-template <typename Allocator = CrtAllocator>
-struct GenericMemoryBuffer {
- typedef char Ch; // byte
-
- GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
-
- void Put(Ch c) { *stack_.template Push<Ch>() = c; }
- void Flush() {}
-
- void Clear() { stack_.Clear(); }
- void ShrinkToFit() { stack_.ShrinkToFit(); }
- Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
- void Pop(size_t count) { stack_.template Pop<Ch>(count); }
-
- const Ch* GetBuffer() const {
- return stack_.template Bottom<Ch>();
- }
-
- size_t GetSize() const { return stack_.GetSize(); }
-
- static const size_t kDefaultCapacity = 256;
- mutable internal::Stack<Allocator> stack_;
-};
-
-typedef GenericMemoryBuffer<> MemoryBuffer;
-
-//! Implement specialized version of PutN() with memset() for better performance.
-template<>
-inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) {
- std::memset(memoryBuffer.stack_.Push<char>(n), c, n * sizeof(c));
-}
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_MEMORYBUFFER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorystream.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorystream.h
deleted file mode 100644
index 1bc393f282..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/memorystream.h
+++ /dev/null
@@ -1,71 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_MEMORYSTREAM_H_
-#define RAPIDJSON_MEMORYSTREAM_H_
-
-#include "stream.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(unreachable-code)
-RAPIDJSON_DIAG_OFF(missing-noreturn)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Represents an in-memory input byte stream.
-/*!
- This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream.
-
- It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file.
-
- Differences between MemoryStream and StringStream:
- 1. StringStream has encoding but MemoryStream is a byte stream.
- 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source.
- 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4().
- \note implements Stream concept
-*/
-struct MemoryStream {
- typedef char Ch; // byte
-
- MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {}
-
- Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; }
- Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; }
- size_t Tell() const { return static_cast<size_t>(src_ - begin_); }
-
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
- // For encoding detection only.
- const Ch* Peek4() const {
- return Tell() + 4 <= size_ ? src_ : 0;
- }
-
- const Ch* src_; //!< Current read position.
- const Ch* begin_; //!< Original head of the string.
- const Ch* end_; //!< End of stream.
- size_t size_; //!< Size of the stream.
-};
-
-RAPIDJSON_NAMESPACE_END
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_MEMORYBUFFER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/inttypes.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/inttypes.h
deleted file mode 100644
index 1620402e01..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/inttypes.h
+++ /dev/null
@@ -1,316 +0,0 @@
-// ISO C9x compliant inttypes.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
-// Copyright (c) 2006-2013 Alexander Chemeris
-//
-// 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 product 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 AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-// The above software in this distribution may have been modified by
-// THL A29 Limited ("Tencent Modifications").
-// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_INTTYPES_H_ // [
-#define _MSC_INTTYPES_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#include "stdint.h"
-
-// miloyip: VC supports inttypes.h since VC2013
-#if _MSC_VER >= 1800
-#include <inttypes.h>
-#else
-
-// 7.8 Format conversion of integer types
-
-typedef struct {
- intmax_t quot;
- intmax_t rem;
-} imaxdiv_t;
-
-// 7.8.1 Macros for format specifiers
-
-#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198
-
-// The fprintf macros for signed integers are:
-#define PRId8 "d"
-#define PRIi8 "i"
-#define PRIdLEAST8 "d"
-#define PRIiLEAST8 "i"
-#define PRIdFAST8 "d"
-#define PRIiFAST8 "i"
-
-#define PRId16 "hd"
-#define PRIi16 "hi"
-#define PRIdLEAST16 "hd"
-#define PRIiLEAST16 "hi"
-#define PRIdFAST16 "hd"
-#define PRIiFAST16 "hi"
-
-#define PRId32 "I32d"
-#define PRIi32 "I32i"
-#define PRIdLEAST32 "I32d"
-#define PRIiLEAST32 "I32i"
-#define PRIdFAST32 "I32d"
-#define PRIiFAST32 "I32i"
-
-#define PRId64 "I64d"
-#define PRIi64 "I64i"
-#define PRIdLEAST64 "I64d"
-#define PRIiLEAST64 "I64i"
-#define PRIdFAST64 "I64d"
-#define PRIiFAST64 "I64i"
-
-#define PRIdMAX "I64d"
-#define PRIiMAX "I64i"
-
-#define PRIdPTR "Id"
-#define PRIiPTR "Ii"
-
-// The fprintf macros for unsigned integers are:
-#define PRIo8 "o"
-#define PRIu8 "u"
-#define PRIx8 "x"
-#define PRIX8 "X"
-#define PRIoLEAST8 "o"
-#define PRIuLEAST8 "u"
-#define PRIxLEAST8 "x"
-#define PRIXLEAST8 "X"
-#define PRIoFAST8 "o"
-#define PRIuFAST8 "u"
-#define PRIxFAST8 "x"
-#define PRIXFAST8 "X"
-
-#define PRIo16 "ho"
-#define PRIu16 "hu"
-#define PRIx16 "hx"
-#define PRIX16 "hX"
-#define PRIoLEAST16 "ho"
-#define PRIuLEAST16 "hu"
-#define PRIxLEAST16 "hx"
-#define PRIXLEAST16 "hX"
-#define PRIoFAST16 "ho"
-#define PRIuFAST16 "hu"
-#define PRIxFAST16 "hx"
-#define PRIXFAST16 "hX"
-
-#define PRIo32 "I32o"
-#define PRIu32 "I32u"
-#define PRIx32 "I32x"
-#define PRIX32 "I32X"
-#define PRIoLEAST32 "I32o"
-#define PRIuLEAST32 "I32u"
-#define PRIxLEAST32 "I32x"
-#define PRIXLEAST32 "I32X"
-#define PRIoFAST32 "I32o"
-#define PRIuFAST32 "I32u"
-#define PRIxFAST32 "I32x"
-#define PRIXFAST32 "I32X"
-
-#define PRIo64 "I64o"
-#define PRIu64 "I64u"
-#define PRIx64 "I64x"
-#define PRIX64 "I64X"
-#define PRIoLEAST64 "I64o"
-#define PRIuLEAST64 "I64u"
-#define PRIxLEAST64 "I64x"
-#define PRIXLEAST64 "I64X"
-#define PRIoFAST64 "I64o"
-#define PRIuFAST64 "I64u"
-#define PRIxFAST64 "I64x"
-#define PRIXFAST64 "I64X"
-
-#define PRIoMAX "I64o"
-#define PRIuMAX "I64u"
-#define PRIxMAX "I64x"
-#define PRIXMAX "I64X"
-
-#define PRIoPTR "Io"
-#define PRIuPTR "Iu"
-#define PRIxPTR "Ix"
-#define PRIXPTR "IX"
-
-// The fscanf macros for signed integers are:
-#define SCNd8 "d"
-#define SCNi8 "i"
-#define SCNdLEAST8 "d"
-#define SCNiLEAST8 "i"
-#define SCNdFAST8 "d"
-#define SCNiFAST8 "i"
-
-#define SCNd16 "hd"
-#define SCNi16 "hi"
-#define SCNdLEAST16 "hd"
-#define SCNiLEAST16 "hi"
-#define SCNdFAST16 "hd"
-#define SCNiFAST16 "hi"
-
-#define SCNd32 "ld"
-#define SCNi32 "li"
-#define SCNdLEAST32 "ld"
-#define SCNiLEAST32 "li"
-#define SCNdFAST32 "ld"
-#define SCNiFAST32 "li"
-
-#define SCNd64 "I64d"
-#define SCNi64 "I64i"
-#define SCNdLEAST64 "I64d"
-#define SCNiLEAST64 "I64i"
-#define SCNdFAST64 "I64d"
-#define SCNiFAST64 "I64i"
-
-#define SCNdMAX "I64d"
-#define SCNiMAX "I64i"
-
-#ifdef _WIN64 // [
-# define SCNdPTR "I64d"
-# define SCNiPTR "I64i"
-#else // _WIN64 ][
-# define SCNdPTR "ld"
-# define SCNiPTR "li"
-#endif // _WIN64 ]
-
-// The fscanf macros for unsigned integers are:
-#define SCNo8 "o"
-#define SCNu8 "u"
-#define SCNx8 "x"
-#define SCNX8 "X"
-#define SCNoLEAST8 "o"
-#define SCNuLEAST8 "u"
-#define SCNxLEAST8 "x"
-#define SCNXLEAST8 "X"
-#define SCNoFAST8 "o"
-#define SCNuFAST8 "u"
-#define SCNxFAST8 "x"
-#define SCNXFAST8 "X"
-
-#define SCNo16 "ho"
-#define SCNu16 "hu"
-#define SCNx16 "hx"
-#define SCNX16 "hX"
-#define SCNoLEAST16 "ho"
-#define SCNuLEAST16 "hu"
-#define SCNxLEAST16 "hx"
-#define SCNXLEAST16 "hX"
-#define SCNoFAST16 "ho"
-#define SCNuFAST16 "hu"
-#define SCNxFAST16 "hx"
-#define SCNXFAST16 "hX"
-
-#define SCNo32 "lo"
-#define SCNu32 "lu"
-#define SCNx32 "lx"
-#define SCNX32 "lX"
-#define SCNoLEAST32 "lo"
-#define SCNuLEAST32 "lu"
-#define SCNxLEAST32 "lx"
-#define SCNXLEAST32 "lX"
-#define SCNoFAST32 "lo"
-#define SCNuFAST32 "lu"
-#define SCNxFAST32 "lx"
-#define SCNXFAST32 "lX"
-
-#define SCNo64 "I64o"
-#define SCNu64 "I64u"
-#define SCNx64 "I64x"
-#define SCNX64 "I64X"
-#define SCNoLEAST64 "I64o"
-#define SCNuLEAST64 "I64u"
-#define SCNxLEAST64 "I64x"
-#define SCNXLEAST64 "I64X"
-#define SCNoFAST64 "I64o"
-#define SCNuFAST64 "I64u"
-#define SCNxFAST64 "I64x"
-#define SCNXFAST64 "I64X"
-
-#define SCNoMAX "I64o"
-#define SCNuMAX "I64u"
-#define SCNxMAX "I64x"
-#define SCNXMAX "I64X"
-
-#ifdef _WIN64 // [
-# define SCNoPTR "I64o"
-# define SCNuPTR "I64u"
-# define SCNxPTR "I64x"
-# define SCNXPTR "I64X"
-#else // _WIN64 ][
-# define SCNoPTR "lo"
-# define SCNuPTR "lu"
-# define SCNxPTR "lx"
-# define SCNXPTR "lX"
-#endif // _WIN64 ]
-
-#endif // __STDC_FORMAT_MACROS ]
-
-// 7.8.2 Functions for greatest-width integer types
-
-// 7.8.2.1 The imaxabs function
-#define imaxabs _abs64
-
-// 7.8.2.2 The imaxdiv function
-
-// This is modified version of div() function from Microsoft's div.c found
-// in %MSVC.NET%\crt\src\div.c
-#ifdef STATIC_IMAXDIV // [
-static
-#else // STATIC_IMAXDIV ][
-_inline
-#endif // STATIC_IMAXDIV ]
-imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom)
-{
- imaxdiv_t result;
-
- result.quot = numer / denom;
- result.rem = numer % denom;
-
- if (numer < 0 && result.rem > 0) {
- // did division wrong; must fix up
- ++result.quot;
- result.rem -= denom;
- }
-
- return result;
-}
-
-// 7.8.2.3 The strtoimax and strtoumax functions
-#define strtoimax _strtoi64
-#define strtoumax _strtoui64
-
-// 7.8.2.4 The wcstoimax and wcstoumax functions
-#define wcstoimax _wcstoi64
-#define wcstoumax _wcstoui64
-
-#endif // _MSC_VER >= 1800
-
-#endif // _MSC_INTTYPES_H_ ]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/stdint.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/stdint.h
deleted file mode 100644
index 1c266ecfe6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/msinttypes/stdint.h
+++ /dev/null
@@ -1,300 +0,0 @@
-// ISO C9x compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
-// Copyright (c) 2006-2013 Alexander Chemeris
-//
-// 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 product 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 AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-// The above software in this distribution may have been modified by
-// THL A29 Limited ("Tencent Modifications").
-// All Tencent Modifications are Copyright (C) 2015 THL A29 Limited.
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_STDINT_H_ // [
-#define _MSC_STDINT_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-// miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010.
-#if _MSC_VER >= 1600 // [
-#include <stdint.h>
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
-
-#undef INT8_C
-#undef INT16_C
-#undef INT32_C
-#undef INT64_C
-#undef UINT8_C
-#undef UINT16_C
-#undef UINT32_C
-#undef UINT64_C
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val) val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val) val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
-// Check out Issue 9 for the details.
-#ifndef INTMAX_C // [
-# define INTMAX_C INT64_C
-#endif // INTMAX_C ]
-#ifndef UINTMAX_C // [
-# define UINTMAX_C UINT64_C
-#endif // UINTMAX_C ]
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-#else // ] _MSC_VER >= 1700 [
-
-#include <limits.h>
-
-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
-// compiling for ARM we have to wrap <wchar.h> include with 'extern "C++" {}'
-// or compiler would give many errors like this:
-// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
-#if defined(__cplusplus) && !defined(_M_ARM)
-extern "C" {
-#endif
-# include <wchar.h>
-#if defined(__cplusplus) && !defined(_M_ARM)
-}
-#endif
-
-// Define _W64 macros to mark types changing their size, like intptr_t.
-#ifndef _W64
-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
-# define _W64 __w64
-# else
-# define _W64
-# endif
-#endif
-
-
-// 7.18.1 Integer types
-
-// 7.18.1.1 Exact-width integer types
-
-// Visual Studio 6 and Embedded Visual C++ 4 doesn't
-// realize that, e.g. char has the same size as __int8
-// so we give up on __intX for them.
-#if (_MSC_VER < 1300)
- typedef signed char int8_t;
- typedef signed short int16_t;
- typedef signed int int32_t;
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
- typedef unsigned int uint32_t;
-#else
- typedef signed __int8 int8_t;
- typedef signed __int16 int16_t;
- typedef signed __int32 int32_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
-#endif
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-
-// 7.18.1.2 Minimum-width integer types
-typedef int8_t int_least8_t;
-typedef int16_t int_least16_t;
-typedef int32_t int_least32_t;
-typedef int64_t int_least64_t;
-typedef uint8_t uint_least8_t;
-typedef uint16_t uint_least16_t;
-typedef uint32_t uint_least32_t;
-typedef uint64_t uint_least64_t;
-
-// 7.18.1.3 Fastest minimum-width integer types
-typedef int8_t int_fast8_t;
-typedef int16_t int_fast16_t;
-typedef int32_t int_fast32_t;
-typedef int64_t int_fast64_t;
-typedef uint8_t uint_fast8_t;
-typedef uint16_t uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-typedef uint64_t uint_fast64_t;
-
-// 7.18.1.4 Integer types capable of holding object pointers
-#ifdef _WIN64 // [
- typedef signed __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
-#else // _WIN64 ][
- typedef _W64 signed int intptr_t;
- typedef _W64 unsigned int uintptr_t;
-#endif // _WIN64 ]
-
-// 7.18.1.5 Greatest-width integer types
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-
-
-// 7.18.2 Limits of specified-width integer types
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
-
-// 7.18.2.1 Limits of exact-width integer types
-#define INT8_MIN ((int8_t)_I8_MIN)
-#define INT8_MAX _I8_MAX
-#define INT16_MIN ((int16_t)_I16_MIN)
-#define INT16_MAX _I16_MAX
-#define INT32_MIN ((int32_t)_I32_MIN)
-#define INT32_MAX _I32_MAX
-#define INT64_MIN ((int64_t)_I64_MIN)
-#define INT64_MAX _I64_MAX
-#define UINT8_MAX _UI8_MAX
-#define UINT16_MAX _UI16_MAX
-#define UINT32_MAX _UI32_MAX
-#define UINT64_MAX _UI64_MAX
-
-// 7.18.2.2 Limits of minimum-width integer types
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MIN INT64_MIN
-#define INT_LEAST64_MAX INT64_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-// 7.18.2.3 Limits of fastest minimum-width integer types
-#define INT_FAST8_MIN INT8_MIN
-#define INT_FAST8_MAX INT8_MAX
-#define INT_FAST16_MIN INT16_MIN
-#define INT_FAST16_MAX INT16_MAX
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-// 7.18.2.4 Limits of integer types capable of holding object pointers
-#ifdef _WIN64 // [
-# define INTPTR_MIN INT64_MIN
-# define INTPTR_MAX INT64_MAX
-# define UINTPTR_MAX UINT64_MAX
-#else // _WIN64 ][
-# define INTPTR_MIN INT32_MIN
-# define INTPTR_MAX INT32_MAX
-# define UINTPTR_MAX UINT32_MAX
-#endif // _WIN64 ]
-
-// 7.18.2.5 Limits of greatest-width integer types
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-// 7.18.3 Limits of other integer types
-
-#ifdef _WIN64 // [
-# define PTRDIFF_MIN _I64_MIN
-# define PTRDIFF_MAX _I64_MAX
-#else // _WIN64 ][
-# define PTRDIFF_MIN _I32_MIN
-# define PTRDIFF_MAX _I32_MAX
-#endif // _WIN64 ]
-
-#define SIG_ATOMIC_MIN INT_MIN
-#define SIG_ATOMIC_MAX INT_MAX
-
-#ifndef SIZE_MAX // [
-# ifdef _WIN64 // [
-# define SIZE_MAX _UI64_MAX
-# else // _WIN64 ][
-# define SIZE_MAX _UI32_MAX
-# endif // _WIN64 ]
-#endif // SIZE_MAX ]
-
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
-#ifndef WCHAR_MIN // [
-# define WCHAR_MIN 0
-#endif // WCHAR_MIN ]
-#ifndef WCHAR_MAX // [
-# define WCHAR_MAX _UI16_MAX
-#endif // WCHAR_MAX ]
-
-#define WINT_MIN 0
-#define WINT_MAX _UI16_MAX
-
-#endif // __STDC_LIMIT_MACROS ]
-
-
-// 7.18.4 Limits of other integer types
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val) val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val) val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-// These #ifndef's are needed to prevent collisions with <boost/cstdint.hpp>.
-// Check out Issue 9 for the details.
-#ifndef INTMAX_C // [
-# define INTMAX_C INT64_C
-#endif // INTMAX_C ]
-#ifndef UINTMAX_C // [
-# define UINTMAX_C UINT64_C
-#endif // UINTMAX_C ]
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-#endif // _MSC_VER >= 1600 ]
-
-#endif // _MSC_STDINT_H_ ]
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/ostreamwrapper.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/ostreamwrapper.h
deleted file mode 100644
index bfd4d6dab0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/ostreamwrapper.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_OSTREAMWRAPPER_H_
-#define RAPIDJSON_OSTREAMWRAPPER_H_
-
-#include "stream.h"
-#include <iosfwd>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept.
-/*!
- The classes can be wrapped including but not limited to:
-
- - \c std::ostringstream
- - \c std::stringstream
- - \c std::wpstringstream
- - \c std::wstringstream
- - \c std::ifstream
- - \c std::fstream
- - \c std::wofstream
- - \c std::wfstream
-
- \tparam StreamType Class derived from \c std::basic_ostream.
-*/
-
-template <typename StreamType>
-class BasicOStreamWrapper {
-public:
- typedef typename StreamType::char_type Ch;
- BasicOStreamWrapper(StreamType& stream) : stream_(stream) {}
-
- void Put(Ch c) {
- stream_.put(c);
- }
-
- void Flush() {
- stream_.flush();
- }
-
- // Not implemented
- char Peek() const { RAPIDJSON_ASSERT(false); return 0; }
- char Take() { RAPIDJSON_ASSERT(false); return 0; }
- size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; }
- char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- BasicOStreamWrapper(const BasicOStreamWrapper&);
- BasicOStreamWrapper& operator=(const BasicOStreamWrapper&);
-
- StreamType& stream_;
-};
-
-typedef BasicOStreamWrapper<std::ostream> OStreamWrapper;
-typedef BasicOStreamWrapper<std::wostream> WOStreamWrapper;
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_OSTREAMWRAPPER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/pointer.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/pointer.h
deleted file mode 100644
index fb1a5ae267..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/pointer.h
+++ /dev/null
@@ -1,1476 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_POINTER_H_
-#define RAPIDJSON_POINTER_H_
-
-#include "document.h"
-#include "uri.h"
-#include "internal/itoa.h"
-#include "error/error.h" // PointerParseErrorCode
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(switch-enum)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-static const SizeType kPointerInvalidIndex = ~SizeType(0); //!< Represents an invalid index in GenericPointer::Token
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericPointer
-
-//! Represents a JSON Pointer. Use Pointer for UTF8 encoding and default allocator.
-/*!
- This class implements RFC 6901 "JavaScript Object Notation (JSON) Pointer"
- (https://tools.ietf.org/html/rfc6901).
-
- A JSON pointer is for identifying a specific value in a JSON document
- (GenericDocument). It can simplify coding of DOM tree manipulation, because it
- can access multiple-level depth of DOM tree with single API call.
-
- After it parses a string representation (e.g. "/foo/0" or URI fragment
- representation (e.g. "#/foo/0") into its internal representation (tokens),
- it can be used to resolve a specific value in multiple documents, or sub-tree
- of documents.
-
- Contrary to GenericValue, Pointer can be copy constructed and copy assigned.
- Apart from assignment, a Pointer cannot be modified after construction.
-
- Although Pointer is very convenient, please aware that constructing Pointer
- involves parsing and dynamic memory allocation. A special constructor with user-
- supplied tokens eliminates these.
-
- GenericPointer depends on GenericDocument and GenericValue.
-
- \tparam ValueType The value type of the DOM tree. E.g. GenericValue<UTF8<> >
- \tparam Allocator The allocator type for allocating memory for internal representation.
-
- \note GenericPointer uses same encoding of ValueType.
- However, Allocator of GenericPointer is independent of Allocator of Value.
-*/
-template <typename ValueType, typename Allocator = CrtAllocator>
-class GenericPointer {
-public:
- typedef typename ValueType::EncodingType EncodingType; //!< Encoding type from Value
- typedef typename ValueType::Ch Ch; //!< Character type from Value
- typedef GenericUri<ValueType, Allocator> UriType;
-
-
- //! A token is the basic units of internal representation.
- /*!
- A JSON pointer string representation "/foo/123" is parsed to two tokens:
- "foo" and 123. 123 will be represented in both numeric form and string form.
- They are resolved according to the actual value type (object or array).
-
- For token that are not numbers, or the numeric value is out of bound
- (greater than limits of SizeType), they are only treated as string form
- (i.e. the token's index will be equal to kPointerInvalidIndex).
-
- This struct is public so that user can create a Pointer without parsing and
- allocation, using a special constructor.
- */
- struct Token {
- const Ch* name; //!< Name of the token. It has null character at the end but it can contain null character.
- SizeType length; //!< Length of the name.
- SizeType index; //!< A valid array index, if it is not equal to kPointerInvalidIndex.
- };
-
- //!@name Constructors and destructor.
- //@{
-
- //! Default constructor.
- GenericPointer(Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
-
- //! Constructor that parses a string or URI fragment representation.
- /*!
- \param source A null-terminated, string or URI fragment representation of JSON pointer.
- \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
- */
- explicit GenericPointer(const Ch* source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
- Parse(source, internal::StrLen(source));
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Constructor that parses a string or URI fragment representation.
- /*!
- \param source A string or URI fragment representation of JSON pointer.
- \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
- \note Requires the definition of the preprocessor symbol \ref RAPIDJSON_HAS_STDSTRING.
- */
- explicit GenericPointer(const std::basic_string<Ch>& source, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
- Parse(source.c_str(), source.size());
- }
-#endif
-
- //! Constructor that parses a string or URI fragment representation, with length of the source string.
- /*!
- \param source A string or URI fragment representation of JSON pointer.
- \param length Length of source.
- \param allocator User supplied allocator for this pointer. If no allocator is provided, it creates a self-owned one.
- \note Slightly faster than the overload without length.
- */
- GenericPointer(const Ch* source, size_t length, Allocator* allocator = 0) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
- Parse(source, length);
- }
-
- //! Constructor with user-supplied tokens.
- /*!
- This constructor let user supplies const array of tokens.
- This prevents the parsing process and eliminates allocation.
- This is preferred for memory constrained environments.
-
- \param tokens An constant array of tokens representing the JSON pointer.
- \param tokenCount Number of tokens.
-
- \b Example
- \code
- #define NAME(s) { s, sizeof(s) / sizeof(s[0]) - 1, kPointerInvalidIndex }
- #define INDEX(i) { #i, sizeof(#i) - 1, i }
-
- static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(123) };
- static const Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
- // Equivalent to static const Pointer p("/foo/123");
-
- #undef NAME
- #undef INDEX
- \endcode
- */
- GenericPointer(const Token* tokens, size_t tokenCount) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(const_cast<Token*>(tokens)), tokenCount_(tokenCount), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {}
-
- //! Copy constructor.
- GenericPointer(const GenericPointer& rhs) : allocator_(), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
- *this = rhs;
- }
-
- //! Copy constructor.
- GenericPointer(const GenericPointer& rhs, Allocator* allocator) : allocator_(allocator), ownAllocator_(), nameBuffer_(), tokens_(), tokenCount_(), parseErrorOffset_(), parseErrorCode_(kPointerParseErrorNone) {
- *this = rhs;
- }
-
- //! Destructor.
- ~GenericPointer() {
- if (nameBuffer_) // If user-supplied tokens constructor is used, nameBuffer_ is nullptr and tokens_ are not deallocated.
- Allocator::Free(tokens_);
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- //! Assignment operator.
- GenericPointer& operator=(const GenericPointer& rhs) {
- if (this != &rhs) {
- // Do not delete ownAllcator
- if (nameBuffer_)
- Allocator::Free(tokens_);
-
- tokenCount_ = rhs.tokenCount_;
- parseErrorOffset_ = rhs.parseErrorOffset_;
- parseErrorCode_ = rhs.parseErrorCode_;
-
- if (rhs.nameBuffer_)
- CopyFromRaw(rhs); // Normally parsed tokens.
- else {
- tokens_ = rhs.tokens_; // User supplied const tokens.
- nameBuffer_ = 0;
- }
- }
- return *this;
- }
-
- //! Swap the content of this pointer with an other.
- /*!
- \param other The pointer to swap with.
- \note Constant complexity.
- */
- GenericPointer& Swap(GenericPointer& other) RAPIDJSON_NOEXCEPT {
- internal::Swap(allocator_, other.allocator_);
- internal::Swap(ownAllocator_, other.ownAllocator_);
- internal::Swap(nameBuffer_, other.nameBuffer_);
- internal::Swap(tokens_, other.tokens_);
- internal::Swap(tokenCount_, other.tokenCount_);
- internal::Swap(parseErrorOffset_, other.parseErrorOffset_);
- internal::Swap(parseErrorCode_, other.parseErrorCode_);
- return *this;
- }
-
- //! free-standing swap function helper
- /*!
- Helper function to enable support for common swap implementation pattern based on \c std::swap:
- \code
- void swap(MyClass& a, MyClass& b) {
- using std::swap;
- swap(a.pointer, b.pointer);
- // ...
- }
- \endcode
- \see Swap()
- */
- friend inline void swap(GenericPointer& a, GenericPointer& b) RAPIDJSON_NOEXCEPT { a.Swap(b); }
-
- //@}
-
- //!@name Append token
- //@{
-
- //! Append a token and return a new Pointer
- /*!
- \param token Token to be appended.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- GenericPointer Append(const Token& token, Allocator* allocator = 0) const {
- GenericPointer r;
- r.allocator_ = allocator;
- Ch *p = r.CopyFromRaw(*this, 1, token.length + 1);
- std::memcpy(p, token.name, (token.length + 1) * sizeof(Ch));
- r.tokens_[tokenCount_].name = p;
- r.tokens_[tokenCount_].length = token.length;
- r.tokens_[tokenCount_].index = token.index;
- return r;
- }
-
- //! Append a name token with length, and return a new Pointer
- /*!
- \param name Name to be appended.
- \param length Length of name.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- GenericPointer Append(const Ch* name, SizeType length, Allocator* allocator = 0) const {
- Token token = { name, length, kPointerInvalidIndex };
- return Append(token, allocator);
- }
-
- //! Append a name token without length, and return a new Pointer
- /*!
- \param name Name (const Ch*) to be appended.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::NotExpr<internal::IsSame<typename internal::RemoveConst<T>::Type, Ch> >), (GenericPointer))
- Append(T* name, Allocator* allocator = 0) const {
- return Append(name, internal::StrLen(name), allocator);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Append a name token, and return a new Pointer
- /*!
- \param name Name to be appended.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- GenericPointer Append(const std::basic_string<Ch>& name, Allocator* allocator = 0) const {
- return Append(name.c_str(), static_cast<SizeType>(name.size()), allocator);
- }
-#endif
-
- //! Append a index token, and return a new Pointer
- /*!
- \param index Index to be appended.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- GenericPointer Append(SizeType index, Allocator* allocator = 0) const {
- char buffer[21];
- char* end = sizeof(SizeType) == 4 ? internal::u32toa(index, buffer) : internal::u64toa(index, buffer);
- SizeType length = static_cast<SizeType>(end - buffer);
- buffer[length] = '\0';
-
- if (sizeof(Ch) == 1) {
- Token token = { reinterpret_cast<Ch*>(buffer), length, index };
- return Append(token, allocator);
- }
- else {
- Ch name[21];
- for (size_t i = 0; i <= length; i++)
- name[i] = static_cast<Ch>(buffer[i]);
- Token token = { name, length, index };
- return Append(token, allocator);
- }
- }
-
- //! Append a token by value, and return a new Pointer
- /*!
- \param token token to be appended.
- \param allocator Allocator for the newly return Pointer.
- \return A new Pointer with appended token.
- */
- GenericPointer Append(const ValueType& token, Allocator* allocator = 0) const {
- if (token.IsString())
- return Append(token.GetString(), token.GetStringLength(), allocator);
- else {
- RAPIDJSON_ASSERT(token.IsUint64());
- RAPIDJSON_ASSERT(token.GetUint64() <= SizeType(~0));
- return Append(static_cast<SizeType>(token.GetUint64()), allocator);
- }
- }
-
- //!@name Handling Parse Error
- //@{
-
- //! Check whether this is a valid pointer.
- bool IsValid() const { return parseErrorCode_ == kPointerParseErrorNone; }
-
- //! Get the parsing error offset in code unit.
- size_t GetParseErrorOffset() const { return parseErrorOffset_; }
-
- //! Get the parsing error code.
- PointerParseErrorCode GetParseErrorCode() const { return parseErrorCode_; }
-
- //@}
-
- //! Get the allocator of this pointer.
- Allocator& GetAllocator() { return *allocator_; }
-
- //!@name Tokens
- //@{
-
- //! Get the token array (const version only).
- const Token* GetTokens() const { return tokens_; }
-
- //! Get the number of tokens.
- size_t GetTokenCount() const { return tokenCount_; }
-
- //@}
-
- //!@name Equality/inequality operators
- //@{
-
- //! Equality operator.
- /*!
- \note When any pointers are invalid, always returns false.
- */
- bool operator==(const GenericPointer& rhs) const {
- if (!IsValid() || !rhs.IsValid() || tokenCount_ != rhs.tokenCount_)
- return false;
-
- for (size_t i = 0; i < tokenCount_; i++) {
- if (tokens_[i].index != rhs.tokens_[i].index ||
- tokens_[i].length != rhs.tokens_[i].length ||
- (tokens_[i].length != 0 && std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch)* tokens_[i].length) != 0))
- {
- return false;
- }
- }
-
- return true;
- }
-
- //! Inequality operator.
- /*!
- \note When any pointers are invalid, always returns true.
- */
- bool operator!=(const GenericPointer& rhs) const { return !(*this == rhs); }
-
- //! Less than operator.
- /*!
- \note Invalid pointers are always greater than valid ones.
- */
- bool operator<(const GenericPointer& rhs) const {
- if (!IsValid())
- return false;
- if (!rhs.IsValid())
- return true;
-
- if (tokenCount_ != rhs.tokenCount_)
- return tokenCount_ < rhs.tokenCount_;
-
- for (size_t i = 0; i < tokenCount_; i++) {
- if (tokens_[i].index != rhs.tokens_[i].index)
- return tokens_[i].index < rhs.tokens_[i].index;
-
- if (tokens_[i].length != rhs.tokens_[i].length)
- return tokens_[i].length < rhs.tokens_[i].length;
-
- if (int cmp = std::memcmp(tokens_[i].name, rhs.tokens_[i].name, sizeof(Ch) * tokens_[i].length))
- return cmp < 0;
- }
-
- return false;
- }
-
- //@}
-
- //!@name Stringify
- //@{
-
- //! Stringify the pointer into string representation.
- /*!
- \tparam OutputStream Type of output stream.
- \param os The output stream.
- */
- template<typename OutputStream>
- bool Stringify(OutputStream& os) const {
- return Stringify<false, OutputStream>(os);
- }
-
- //! Stringify the pointer into URI fragment representation.
- /*!
- \tparam OutputStream Type of output stream.
- \param os The output stream.
- */
- template<typename OutputStream>
- bool StringifyUriFragment(OutputStream& os) const {
- return Stringify<true, OutputStream>(os);
- }
-
- //@}
-
- //!@name Create value
- //@{
-
- //! Create a value in a subtree.
- /*!
- If the value is not exist, it creates all parent values and a JSON Null value.
- So it always succeed and return the newly created or existing value.
-
- Remind that it may change types of parents according to tokens, so it
- potentially removes previously stored values. For example, if a document
- was an array, and "/foo" is used to create a value, then the document
- will be changed to an object, and all existing array elements are lost.
-
- \param root Root value of a DOM subtree to be resolved. It can be any value other than document root.
- \param allocator Allocator for creating the values if the specified value or its parents are not exist.
- \param alreadyExist If non-null, it stores whether the resolved value is already exist.
- \return The resolved newly created (a JSON Null value), or already exists value.
- */
- ValueType& Create(ValueType& root, typename ValueType::AllocatorType& allocator, bool* alreadyExist = 0) const {
- RAPIDJSON_ASSERT(IsValid());
- ValueType* v = &root;
- bool exist = true;
- for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
- if (v->IsArray() && t->name[0] == '-' && t->length == 1) {
- v->PushBack(ValueType().Move(), allocator);
- v = &((*v)[v->Size() - 1]);
- exist = false;
- }
- else {
- if (t->index == kPointerInvalidIndex) { // must be object name
- if (!v->IsObject())
- v->SetObject(); // Change to Object
- }
- else { // object name or array index
- if (!v->IsArray() && !v->IsObject())
- v->SetArray(); // Change to Array
- }
-
- if (v->IsArray()) {
- if (t->index >= v->Size()) {
- v->Reserve(t->index + 1, allocator);
- while (t->index >= v->Size())
- v->PushBack(ValueType().Move(), allocator);
- exist = false;
- }
- v = &((*v)[t->index]);
- }
- else {
- typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
- if (m == v->MemberEnd()) {
- v->AddMember(ValueType(t->name, t->length, allocator).Move(), ValueType().Move(), allocator);
- m = v->MemberEnd();
- v = &(--m)->value; // Assumes AddMember() appends at the end
- exist = false;
- }
- else
- v = &m->value;
- }
- }
- }
-
- if (alreadyExist)
- *alreadyExist = exist;
-
- return *v;
- }
-
- //! Creates a value in a document.
- /*!
- \param document A document to be resolved.
- \param alreadyExist If non-null, it stores whether the resolved value is already exist.
- \return The resolved newly created, or already exists value.
- */
- template <typename stackAllocator>
- ValueType& Create(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, bool* alreadyExist = 0) const {
- return Create(document, document.GetAllocator(), alreadyExist);
- }
-
- //@}
-
- //!@name Compute URI
- //@{
-
- //! Compute the in-scope URI for a subtree.
- // For use with JSON pointers into JSON schema documents.
- /*!
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \param rootUri Root URI
- \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token.
- \param allocator Allocator for Uris
- \return Uri if it can be resolved. Otherwise null.
-
- \note
- There are only 3 situations when a URI cannot be resolved:
- 1. A value in the path is not an array nor object.
- 2. An object value does not contain the token.
- 3. A token is out of range of an array value.
-
- Use unresolvedTokenIndex to retrieve the token index.
- */
- UriType GetUri(ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const {
- static const Ch kIdString[] = { 'i', 'd', '\0' };
- static const ValueType kIdValue(kIdString, 2);
- UriType base = UriType(rootUri, allocator);
- RAPIDJSON_ASSERT(IsValid());
- ValueType* v = &root;
- for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
- switch (v->GetType()) {
- case kObjectType:
- {
- // See if we have an id, and if so resolve with the current base
- typename ValueType::MemberIterator m = v->FindMember(kIdValue);
- if (m != v->MemberEnd() && (m->value).IsString()) {
- UriType here = UriType(m->value, allocator).Resolve(base, allocator);
- base = here;
- }
- m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
- if (m == v->MemberEnd())
- break;
- v = &m->value;
- }
- continue;
- case kArrayType:
- if (t->index == kPointerInvalidIndex || t->index >= v->Size())
- break;
- v = &((*v)[t->index]);
- continue;
- default:
- break;
- }
-
- // Error: unresolved token
- if (unresolvedTokenIndex)
- *unresolvedTokenIndex = static_cast<size_t>(t - tokens_);
- return UriType(allocator);
- }
- return base;
- }
-
- UriType GetUri(const ValueType& root, const UriType& rootUri, size_t* unresolvedTokenIndex = 0, Allocator* allocator = 0) const {
- return GetUri(const_cast<ValueType&>(root), rootUri, unresolvedTokenIndex, allocator);
- }
-
-
- //!@name Query value
- //@{
-
- //! Query a value in a subtree.
- /*!
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \param unresolvedTokenIndex If the pointer cannot resolve a token in the pointer, this parameter can obtain the index of unresolved token.
- \return Pointer to the value if it can be resolved. Otherwise null.
-
- \note
- There are only 3 situations when a value cannot be resolved:
- 1. A value in the path is not an array nor object.
- 2. An object value does not contain the token.
- 3. A token is out of range of an array value.
-
- Use unresolvedTokenIndex to retrieve the token index.
- */
- ValueType* Get(ValueType& root, size_t* unresolvedTokenIndex = 0) const {
- RAPIDJSON_ASSERT(IsValid());
- ValueType* v = &root;
- for (const Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
- switch (v->GetType()) {
- case kObjectType:
- {
- typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
- if (m == v->MemberEnd())
- break;
- v = &m->value;
- }
- continue;
- case kArrayType:
- if (t->index == kPointerInvalidIndex || t->index >= v->Size())
- break;
- v = &((*v)[t->index]);
- continue;
- default:
- break;
- }
-
- // Error: unresolved token
- if (unresolvedTokenIndex)
- *unresolvedTokenIndex = static_cast<size_t>(t - tokens_);
- return 0;
- }
- return v;
- }
-
- //! Query a const value in a const subtree.
- /*!
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \return Pointer to the value if it can be resolved. Otherwise null.
- */
- const ValueType* Get(const ValueType& root, size_t* unresolvedTokenIndex = 0) const {
- return Get(const_cast<ValueType&>(root), unresolvedTokenIndex);
- }
-
- //@}
-
- //!@name Query a value with default
- //@{
-
- //! Query a value in a subtree with default value.
- /*!
- Similar to Get(), but if the specified value do not exists, it creates all parents and clone the default value.
- So that this function always succeed.
-
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \param defaultValue Default value to be cloned if the value was not exists.
- \param allocator Allocator for creating the values if the specified value or its parents are not exist.
- \see Create()
- */
- ValueType& GetWithDefault(ValueType& root, const ValueType& defaultValue, typename ValueType::AllocatorType& allocator) const {
- bool alreadyExist;
- ValueType& v = Create(root, allocator, &alreadyExist);
- return alreadyExist ? v : v.CopyFrom(defaultValue, allocator);
- }
-
- //! Query a value in a subtree with default null-terminated string.
- ValueType& GetWithDefault(ValueType& root, const Ch* defaultValue, typename ValueType::AllocatorType& allocator) const {
- bool alreadyExist;
- ValueType& v = Create(root, allocator, &alreadyExist);
- return alreadyExist ? v : v.SetString(defaultValue, allocator);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Query a value in a subtree with default std::basic_string.
- ValueType& GetWithDefault(ValueType& root, const std::basic_string<Ch>& defaultValue, typename ValueType::AllocatorType& allocator) const {
- bool alreadyExist;
- ValueType& v = Create(root, allocator, &alreadyExist);
- return alreadyExist ? v : v.SetString(defaultValue, allocator);
- }
-#endif
-
- //! Query a value in a subtree with default primitive value.
- /*!
- \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
- GetWithDefault(ValueType& root, T defaultValue, typename ValueType::AllocatorType& allocator) const {
- return GetWithDefault(root, ValueType(defaultValue).Move(), allocator);
- }
-
- //! Query a value in a document with default value.
- template <typename stackAllocator>
- ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& defaultValue) const {
- return GetWithDefault(document, defaultValue, document.GetAllocator());
- }
-
- //! Query a value in a document with default null-terminated string.
- template <typename stackAllocator>
- ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* defaultValue) const {
- return GetWithDefault(document, defaultValue, document.GetAllocator());
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Query a value in a document with default std::basic_string.
- template <typename stackAllocator>
- ValueType& GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& defaultValue) const {
- return GetWithDefault(document, defaultValue, document.GetAllocator());
- }
-#endif
-
- //! Query a value in a document with default primitive value.
- /*!
- \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
- */
- template <typename T, typename stackAllocator>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
- GetWithDefault(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T defaultValue) const {
- return GetWithDefault(document, defaultValue, document.GetAllocator());
- }
-
- //@}
-
- //!@name Set a value
- //@{
-
- //! Set a value in a subtree, with move semantics.
- /*!
- It creates all parents if they are not exist or types are different to the tokens.
- So this function always succeeds but potentially remove existing values.
-
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \param value Value to be set.
- \param allocator Allocator for creating the values if the specified value or its parents are not exist.
- \see Create()
- */
- ValueType& Set(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator) = value;
- }
-
- //! Set a value in a subtree, with copy semantics.
- ValueType& Set(ValueType& root, const ValueType& value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator).CopyFrom(value, allocator);
- }
-
- //! Set a null-terminated string in a subtree.
- ValueType& Set(ValueType& root, const Ch* value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator) = ValueType(value, allocator).Move();
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Set a std::basic_string in a subtree.
- ValueType& Set(ValueType& root, const std::basic_string<Ch>& value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator) = ValueType(value, allocator).Move();
- }
-#endif
-
- //! Set a primitive value in a subtree.
- /*!
- \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
- */
- template <typename T>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
- Set(ValueType& root, T value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator) = ValueType(value).Move();
- }
-
- //! Set a value in a document, with move semantics.
- template <typename stackAllocator>
- ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
- return Create(document) = value;
- }
-
- //! Set a value in a document, with copy semantics.
- template <typename stackAllocator>
- ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const ValueType& value) const {
- return Create(document).CopyFrom(value, document.GetAllocator());
- }
-
- //! Set a null-terminated string in a document.
- template <typename stackAllocator>
- ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const Ch* value) const {
- return Create(document) = ValueType(value, document.GetAllocator()).Move();
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- //! Sets a std::basic_string in a document.
- template <typename stackAllocator>
- ValueType& Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, const std::basic_string<Ch>& value) const {
- return Create(document) = ValueType(value, document.GetAllocator()).Move();
- }
-#endif
-
- //! Set a primitive value in a document.
- /*!
- \tparam T Either \ref Type, \c int, \c unsigned, \c int64_t, \c uint64_t, \c bool
- */
- template <typename T, typename stackAllocator>
- RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T>, internal::IsGenericValue<T> >), (ValueType&))
- Set(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, T value) const {
- return Create(document) = value;
- }
-
- //@}
-
- //!@name Swap a value
- //@{
-
- //! Swap a value with a value in a subtree.
- /*!
- It creates all parents if they are not exist or types are different to the tokens.
- So this function always succeeds but potentially remove existing values.
-
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \param value Value to be swapped.
- \param allocator Allocator for creating the values if the specified value or its parents are not exist.
- \see Create()
- */
- ValueType& Swap(ValueType& root, ValueType& value, typename ValueType::AllocatorType& allocator) const {
- return Create(root, allocator).Swap(value);
- }
-
- //! Swap a value with a value in a document.
- template <typename stackAllocator>
- ValueType& Swap(GenericDocument<EncodingType, typename ValueType::AllocatorType, stackAllocator>& document, ValueType& value) const {
- return Create(document).Swap(value);
- }
-
- //@}
-
- //! Erase a value in a subtree.
- /*!
- \param root Root value of a DOM sub-tree to be resolved. It can be any value other than document root.
- \return Whether the resolved value is found and erased.
-
- \note Erasing with an empty pointer \c Pointer(""), i.e. the root, always fail and return false.
- */
- bool Erase(ValueType& root) const {
- RAPIDJSON_ASSERT(IsValid());
- if (tokenCount_ == 0) // Cannot erase the root
- return false;
-
- ValueType* v = &root;
- const Token* last = tokens_ + (tokenCount_ - 1);
- for (const Token *t = tokens_; t != last; ++t) {
- switch (v->GetType()) {
- case kObjectType:
- {
- typename ValueType::MemberIterator m = v->FindMember(GenericValue<EncodingType>(GenericStringRef<Ch>(t->name, t->length)));
- if (m == v->MemberEnd())
- return false;
- v = &m->value;
- }
- break;
- case kArrayType:
- if (t->index == kPointerInvalidIndex || t->index >= v->Size())
- return false;
- v = &((*v)[t->index]);
- break;
- default:
- return false;
- }
- }
-
- switch (v->GetType()) {
- case kObjectType:
- return v->EraseMember(GenericStringRef<Ch>(last->name, last->length));
- case kArrayType:
- if (last->index == kPointerInvalidIndex || last->index >= v->Size())
- return false;
- v->Erase(v->Begin() + last->index);
- return true;
- default:
- return false;
- }
- }
-
-private:
- //! Clone the content from rhs to this.
- /*!
- \param rhs Source pointer.
- \param extraToken Extra tokens to be allocated.
- \param extraNameBufferSize Extra name buffer size (in number of Ch) to be allocated.
- \return Start of non-occupied name buffer, for storing extra names.
- */
- Ch* CopyFromRaw(const GenericPointer& rhs, size_t extraToken = 0, size_t extraNameBufferSize = 0) {
- if (!allocator_) // allocator is independently owned.
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
-
- size_t nameBufferSize = rhs.tokenCount_; // null terminators for tokens
- for (Token *t = rhs.tokens_; t != rhs.tokens_ + rhs.tokenCount_; ++t)
- nameBufferSize += t->length;
-
- tokenCount_ = rhs.tokenCount_ + extraToken;
- tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + (nameBufferSize + extraNameBufferSize) * sizeof(Ch)));
- nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
- if (rhs.tokenCount_ > 0) {
- std::memcpy(tokens_, rhs.tokens_, rhs.tokenCount_ * sizeof(Token));
- }
- if (nameBufferSize > 0) {
- std::memcpy(nameBuffer_, rhs.nameBuffer_, nameBufferSize * sizeof(Ch));
- }
-
- // The names of each token point to a string in the nameBuffer_. The
- // previous memcpy copied over string pointers into the rhs.nameBuffer_,
- // but they should point to the strings in the new nameBuffer_.
- for (size_t i = 0; i < rhs.tokenCount_; ++i) {
- // The offset between the string address and the name buffer should
- // still be constant, so we can just get this offset and set each new
- // token name according the new buffer start + the known offset.
- std::ptrdiff_t name_offset = rhs.tokens_[i].name - rhs.nameBuffer_;
- tokens_[i].name = nameBuffer_ + name_offset;
- }
-
- return nameBuffer_ + nameBufferSize;
- }
-
- //! Check whether a character should be percent-encoded.
- /*!
- According to RFC 3986 2.3 Unreserved Characters.
- \param c The character (code unit) to be tested.
- */
- bool NeedPercentEncode(Ch c) const {
- return !((c >= '0' && c <= '9') || (c >= 'A' && c <='Z') || (c >= 'a' && c <= 'z') || c == '-' || c == '.' || c == '_' || c =='~');
- }
-
- //! Parse a JSON String or its URI fragment representation into tokens.
-#ifndef __clang__ // -Wdocumentation
- /*!
- \param source Either a JSON Pointer string, or its URI fragment representation. Not need to be null terminated.
- \param length Length of the source string.
- \note Source cannot be JSON String Representation of JSON Pointer, e.g. In "/\u0000", \u0000 will not be unescaped.
- */
-#endif
- void Parse(const Ch* source, size_t length) {
- RAPIDJSON_ASSERT(source != NULL);
- RAPIDJSON_ASSERT(nameBuffer_ == 0);
- RAPIDJSON_ASSERT(tokens_ == 0);
-
- // Create own allocator if user did not supply.
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
-
- // Count number of '/' as tokenCount
- tokenCount_ = 0;
- for (const Ch* s = source; s != source + length; s++)
- if (*s == '/')
- tokenCount_++;
-
- Token* token = tokens_ = static_cast<Token *>(allocator_->Malloc(tokenCount_ * sizeof(Token) + length * sizeof(Ch)));
- Ch* name = nameBuffer_ = reinterpret_cast<Ch *>(tokens_ + tokenCount_);
- size_t i = 0;
-
- // Detect if it is a URI fragment
- bool uriFragment = false;
- if (source[i] == '#') {
- uriFragment = true;
- i++;
- }
-
- if (i != length && source[i] != '/') {
- parseErrorCode_ = kPointerParseErrorTokenMustBeginWithSolidus;
- goto error;
- }
-
- while (i < length) {
- RAPIDJSON_ASSERT(source[i] == '/');
- i++; // consumes '/'
-
- token->name = name;
- bool isNumber = true;
-
- while (i < length && source[i] != '/') {
- Ch c = source[i];
- if (uriFragment) {
- // Decoding percent-encoding for URI fragment
- if (c == '%') {
- PercentDecodeStream is(&source[i], source + length);
- GenericInsituStringStream<EncodingType> os(name);
- Ch* begin = os.PutBegin();
- if (!Transcoder<UTF8<>, EncodingType>().Validate(is, os) || !is.IsValid()) {
- parseErrorCode_ = kPointerParseErrorInvalidPercentEncoding;
- goto error;
- }
- size_t len = os.PutEnd(begin);
- i += is.Tell() - 1;
- if (len == 1)
- c = *name;
- else {
- name += len;
- isNumber = false;
- i++;
- continue;
- }
- }
- else if (NeedPercentEncode(c)) {
- parseErrorCode_ = kPointerParseErrorCharacterMustPercentEncode;
- goto error;
- }
- }
-
- i++;
-
- // Escaping "~0" -> '~', "~1" -> '/'
- if (c == '~') {
- if (i < length) {
- c = source[i];
- if (c == '0') c = '~';
- else if (c == '1') c = '/';
- else {
- parseErrorCode_ = kPointerParseErrorInvalidEscape;
- goto error;
- }
- i++;
- }
- else {
- parseErrorCode_ = kPointerParseErrorInvalidEscape;
- goto error;
- }
- }
-
- // First check for index: all of characters are digit
- if (c < '0' || c > '9')
- isNumber = false;
-
- *name++ = c;
- }
- token->length = static_cast<SizeType>(name - token->name);
- if (token->length == 0)
- isNumber = false;
- *name++ = '\0'; // Null terminator
-
- // Second check for index: more than one digit cannot have leading zero
- if (isNumber && token->length > 1 && token->name[0] == '0')
- isNumber = false;
-
- // String to SizeType conversion
- SizeType n = 0;
- if (isNumber) {
- for (size_t j = 0; j < token->length; j++) {
- SizeType m = n * 10 + static_cast<SizeType>(token->name[j] - '0');
- if (m < n) { // overflow detection
- isNumber = false;
- break;
- }
- n = m;
- }
- }
-
- token->index = isNumber ? n : kPointerInvalidIndex;
- token++;
- }
-
- RAPIDJSON_ASSERT(name <= nameBuffer_ + length); // Should not overflow buffer
- parseErrorCode_ = kPointerParseErrorNone;
- return;
-
- error:
- Allocator::Free(tokens_);
- nameBuffer_ = 0;
- tokens_ = 0;
- tokenCount_ = 0;
- parseErrorOffset_ = i;
- return;
- }
-
- //! Stringify to string or URI fragment representation.
- /*!
- \tparam uriFragment True for stringifying to URI fragment representation. False for string representation.
- \tparam OutputStream type of output stream.
- \param os The output stream.
- */
- template<bool uriFragment, typename OutputStream>
- bool Stringify(OutputStream& os) const {
- RAPIDJSON_ASSERT(IsValid());
-
- if (uriFragment)
- os.Put('#');
-
- for (Token *t = tokens_; t != tokens_ + tokenCount_; ++t) {
- os.Put('/');
- for (size_t j = 0; j < t->length; j++) {
- Ch c = t->name[j];
- if (c == '~') {
- os.Put('~');
- os.Put('0');
- }
- else if (c == '/') {
- os.Put('~');
- os.Put('1');
- }
- else if (uriFragment && NeedPercentEncode(c)) {
- // Transcode to UTF8 sequence
- GenericStringStream<typename ValueType::EncodingType> source(&t->name[j]);
- PercentEncodeStream<OutputStream> target(os);
- if (!Transcoder<EncodingType, UTF8<> >().Validate(source, target))
- return false;
- j += source.Tell() - 1;
- }
- else
- os.Put(c);
- }
- }
- return true;
- }
-
- //! A helper stream for decoding a percent-encoded sequence into code unit.
- /*!
- This stream decodes %XY triplet into code unit (0-255).
- If it encounters invalid characters, it sets output code unit as 0 and
- mark invalid, and to be checked by IsValid().
- */
- class PercentDecodeStream {
- public:
- typedef typename ValueType::Ch Ch;
-
- //! Constructor
- /*!
- \param source Start of the stream
- \param end Past-the-end of the stream.
- */
- PercentDecodeStream(const Ch* source, const Ch* end) : src_(source), head_(source), end_(end), valid_(true) {}
-
- Ch Take() {
- if (*src_ != '%' || src_ + 3 > end_) { // %XY triplet
- valid_ = false;
- return 0;
- }
- src_++;
- Ch c = 0;
- for (int j = 0; j < 2; j++) {
- c = static_cast<Ch>(c << 4);
- Ch h = *src_;
- if (h >= '0' && h <= '9') c = static_cast<Ch>(c + h - '0');
- else if (h >= 'A' && h <= 'F') c = static_cast<Ch>(c + h - 'A' + 10);
- else if (h >= 'a' && h <= 'f') c = static_cast<Ch>(c + h - 'a' + 10);
- else {
- valid_ = false;
- return 0;
- }
- src_++;
- }
- return c;
- }
-
- size_t Tell() const { return static_cast<size_t>(src_ - head_); }
- bool IsValid() const { return valid_; }
-
- private:
- const Ch* src_; //!< Current read position.
- const Ch* head_; //!< Original head of the string.
- const Ch* end_; //!< Past-the-end position.
- bool valid_; //!< Whether the parsing is valid.
- };
-
- //! A helper stream to encode character (UTF-8 code unit) into percent-encoded sequence.
- template <typename OutputStream>
- class PercentEncodeStream {
- public:
- PercentEncodeStream(OutputStream& os) : os_(os) {}
- void Put(char c) { // UTF-8 must be byte
- unsigned char u = static_cast<unsigned char>(c);
- static const char hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- os_.Put('%');
- os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u >> 4]));
- os_.Put(static_cast<typename OutputStream::Ch>(hexDigits[u & 15]));
- }
- private:
- OutputStream& os_;
- };
-
- Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_.
- Allocator* ownAllocator_; //!< Allocator owned by this Pointer.
- Ch* nameBuffer_; //!< A buffer containing all names in tokens.
- Token* tokens_; //!< A list of tokens.
- size_t tokenCount_; //!< Number of tokens in tokens_.
- size_t parseErrorOffset_; //!< Offset in code unit when parsing fail.
- PointerParseErrorCode parseErrorCode_; //!< Parsing error code.
-};
-
-//! GenericPointer for Value (UTF-8, default allocator).
-typedef GenericPointer<Value> Pointer;
-
-//!@name Helper functions for GenericPointer
-//@{
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-typename T::ValueType& CreateValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::AllocatorType& a) {
- return pointer.Create(root, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& CreateValueByPointer(T& root, const CharType(&source)[N], typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Create(root, a);
-}
-
-// No allocator parameter
-
-template <typename DocumentType>
-typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer) {
- return pointer.Create(document);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& CreateValueByPointer(DocumentType& document, const CharType(&source)[N]) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Create(document);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-typename T::ValueType* GetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
- return pointer.Get(root, unresolvedTokenIndex);
-}
-
-template <typename T>
-const typename T::ValueType* GetValueByPointer(const T& root, const GenericPointer<typename T::ValueType>& pointer, size_t* unresolvedTokenIndex = 0) {
- return pointer.Get(root, unresolvedTokenIndex);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType* GetValueByPointer(T& root, const CharType (&source)[N], size_t* unresolvedTokenIndex = 0) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
-}
-
-template <typename T, typename CharType, size_t N>
-const typename T::ValueType* GetValueByPointer(const T& root, const CharType(&source)[N], size_t* unresolvedTokenIndex = 0) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Get(root, unresolvedTokenIndex);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
- return pointer.GetWithDefault(root, defaultValue, a);
-}
-
-template <typename T>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
- return pointer.GetWithDefault(root, defaultValue, a);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename T>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
- return pointer.GetWithDefault(root, defaultValue, a);
-}
-#endif
-
-template <typename T, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
-GetValueByPointerWithDefault(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 defaultValue, typename T::AllocatorType& a) {
- return pointer.GetWithDefault(root, defaultValue, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::ValueType& defaultValue, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const typename T::Ch* defaultValue, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& GetValueByPointerWithDefault(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& defaultValue, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
-}
-#endif
-
-template <typename T, typename CharType, size_t N, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
-GetValueByPointerWithDefault(T& root, const CharType(&source)[N], T2 defaultValue, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).GetWithDefault(root, defaultValue, a);
-}
-
-// No allocator parameter
-
-template <typename DocumentType>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& defaultValue) {
- return pointer.GetWithDefault(document, defaultValue);
-}
-
-template <typename DocumentType>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* defaultValue) {
- return pointer.GetWithDefault(document, defaultValue);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename DocumentType>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& defaultValue) {
- return pointer.GetWithDefault(document, defaultValue);
-}
-#endif
-
-template <typename DocumentType, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
-GetValueByPointerWithDefault(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 defaultValue) {
- return pointer.GetWithDefault(document, defaultValue);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& defaultValue) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* defaultValue) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& defaultValue) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
-}
-#endif
-
-template <typename DocumentType, typename CharType, size_t N, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
-GetValueByPointerWithDefault(DocumentType& document, const CharType(&source)[N], T2 defaultValue) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).GetWithDefault(document, defaultValue);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
- return pointer.Set(root, value, a);
-}
-
-template <typename T>
-typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::ValueType& value, typename T::AllocatorType& a) {
- return pointer.Set(root, value, a);
-}
-
-template <typename T>
-typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const typename T::Ch* value, typename T::AllocatorType& a) {
- return pointer.Set(root, value, a);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename T>
-typename T::ValueType& SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
- return pointer.Set(root, value, a);
-}
-#endif
-
-template <typename T, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
-SetValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, T2 value, typename T::AllocatorType& a) {
- return pointer.Set(root, value, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::ValueType& value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const typename T::Ch* value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& SetValueByPointer(T& root, const CharType(&source)[N], const std::basic_string<typename T::Ch>& value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
-}
-#endif
-
-template <typename T, typename CharType, size_t N, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename T::ValueType&))
-SetValueByPointer(T& root, const CharType(&source)[N], T2 value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Set(root, value, a);
-}
-
-// No allocator parameter
-
-template <typename DocumentType>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
- return pointer.Set(document, value);
-}
-
-template <typename DocumentType>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::ValueType& value) {
- return pointer.Set(document, value);
-}
-
-template <typename DocumentType>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const typename DocumentType::Ch* value) {
- return pointer.Set(document, value);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename DocumentType>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, const std::basic_string<typename DocumentType::Ch>& value) {
- return pointer.Set(document, value);
-}
-#endif
-
-template <typename DocumentType, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
-SetValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, T2 value) {
- return pointer.Set(document, value);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::ValueType& value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const typename DocumentType::Ch* value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& SetValueByPointer(DocumentType& document, const CharType(&source)[N], const std::basic_string<typename DocumentType::Ch>& value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
-}
-#endif
-
-template <typename DocumentType, typename CharType, size_t N, typename T2>
-RAPIDJSON_DISABLEIF_RETURN((internal::OrExpr<internal::IsPointer<T2>, internal::IsGenericValue<T2> >), (typename DocumentType::ValueType&))
-SetValueByPointer(DocumentType& document, const CharType(&source)[N], T2 value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Set(document, value);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-typename T::ValueType& SwapValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer, typename T::ValueType& value, typename T::AllocatorType& a) {
- return pointer.Swap(root, value, a);
-}
-
-template <typename T, typename CharType, size_t N>
-typename T::ValueType& SwapValueByPointer(T& root, const CharType(&source)[N], typename T::ValueType& value, typename T::AllocatorType& a) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Swap(root, value, a);
-}
-
-template <typename DocumentType>
-typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const GenericPointer<typename DocumentType::ValueType>& pointer, typename DocumentType::ValueType& value) {
- return pointer.Swap(document, value);
-}
-
-template <typename DocumentType, typename CharType, size_t N>
-typename DocumentType::ValueType& SwapValueByPointer(DocumentType& document, const CharType(&source)[N], typename DocumentType::ValueType& value) {
- return GenericPointer<typename DocumentType::ValueType>(source, N - 1).Swap(document, value);
-}
-
-//////////////////////////////////////////////////////////////////////////////
-
-template <typename T>
-bool EraseValueByPointer(T& root, const GenericPointer<typename T::ValueType>& pointer) {
- return pointer.Erase(root);
-}
-
-template <typename T, typename CharType, size_t N>
-bool EraseValueByPointer(T& root, const CharType(&source)[N]) {
- return GenericPointer<typename T::ValueType>(source, N - 1).Erase(root);
-}
-
-//@}
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__) || defined(_MSC_VER)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_POINTER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/prettywriter.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/prettywriter.h
deleted file mode 100644
index cea596ef58..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/prettywriter.h
+++ /dev/null
@@ -1,277 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_PRETTYWRITER_H_
-#define RAPIDJSON_PRETTYWRITER_H_
-
-#include "writer.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Combination of PrettyWriter format flags.
-/*! \see PrettyWriter::SetFormatOptions
- */
-enum PrettyFormatOptions {
- kFormatDefault = 0, //!< Default pretty formatting.
- kFormatSingleLineArray = 1 //!< Format arrays on a single line.
-};
-
-//! Writer with indentation and spacing.
-/*!
- \tparam OutputStream Type of output os.
- \tparam SourceEncoding Encoding of source string.
- \tparam TargetEncoding Encoding of output stream.
- \tparam StackAllocator Type of allocator for allocating memory of stack.
-*/
-template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
-class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
-public:
- typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Base;
- typedef typename Base::Ch Ch;
-
- //! Constructor
- /*! \param os Output stream.
- \param allocator User supplied allocator. If it is null, it will create a private one.
- \param levelDepth Initial capacity of stack.
- */
- explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
- Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {}
-
-
- explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
- Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- PrettyWriter(PrettyWriter&& rhs) :
- Base(std::forward<PrettyWriter>(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {}
-#endif
-
- //! Set custom indentation.
- /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r').
- \param indentCharCount Number of indent characters for each indentation level.
- \note The default indentation is 4 spaces.
- */
- PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) {
- RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r');
- indentChar_ = indentChar;
- indentCharCount_ = indentCharCount;
- return *this;
- }
-
- //! Set pretty writer formatting options.
- /*! \param options Formatting options.
- */
- PrettyWriter& SetFormatOptions(PrettyFormatOptions options) {
- formatOptions_ = options;
- return *this;
- }
-
- /*! @name Implementation of Handler
- \see Handler
- */
- //@{
-
- bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); }
- bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); }
- bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); }
- bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); }
- bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); }
- bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); }
- bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); }
-
- bool RawNumber(const Ch* str, SizeType length, bool copy = false) {
- RAPIDJSON_ASSERT(str != 0);
- (void)copy;
- PrettyPrefix(kNumberType);
- return Base::EndValue(Base::WriteString(str, length));
- }
-
- bool String(const Ch* str, SizeType length, bool copy = false) {
- RAPIDJSON_ASSERT(str != 0);
- (void)copy;
- PrettyPrefix(kStringType);
- return Base::EndValue(Base::WriteString(str, length));
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool String(const std::basic_string<Ch>& str) {
- return String(str.data(), SizeType(str.size()));
- }
-#endif
-
- bool StartObject() {
- PrettyPrefix(kObjectType);
- new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(false);
- return Base::WriteStartObject();
- }
-
- bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool Key(const std::basic_string<Ch>& str) {
- return Key(str.data(), SizeType(str.size()));
- }
-#endif
-
- bool EndObject(SizeType memberCount = 0) {
- (void)memberCount;
- RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object
- RAPIDJSON_ASSERT(!Base::level_stack_.template Top<typename Base::Level>()->inArray); // currently inside an Array, not Object
- RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top<typename Base::Level>()->valueCount % 2); // Object has a Key without a Value
-
- bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
-
- if (!empty) {
- Base::os_->Put('\n');
- WriteIndent();
- }
- bool ret = Base::EndValue(Base::WriteEndObject());
- (void)ret;
- RAPIDJSON_ASSERT(ret == true);
- if (Base::level_stack_.Empty()) // end of json text
- Base::Flush();
- return true;
- }
-
- bool StartArray() {
- PrettyPrefix(kArrayType);
- new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(true);
- return Base::WriteStartArray();
- }
-
- bool EndArray(SizeType memberCount = 0) {
- (void)memberCount;
- RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));
- RAPIDJSON_ASSERT(Base::level_stack_.template Top<typename Base::Level>()->inArray);
- bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
-
- if (!empty && !(formatOptions_ & kFormatSingleLineArray)) {
- Base::os_->Put('\n');
- WriteIndent();
- }
- bool ret = Base::EndValue(Base::WriteEndArray());
- (void)ret;
- RAPIDJSON_ASSERT(ret == true);
- if (Base::level_stack_.Empty()) // end of json text
- Base::Flush();
- return true;
- }
-
- //@}
-
- /*! @name Convenience extensions */
- //@{
-
- //! Simpler but slower overload.
- bool String(const Ch* str) { return String(str, internal::StrLen(str)); }
- bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }
-
- //@}
-
- //! Write a raw JSON value.
- /*!
- For user to write a stringified JSON as a value.
-
- \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
- \param length Length of the json.
- \param type Type of the root of json.
- \note When using PrettyWriter::RawValue(), the result json may not be indented correctly.
- */
- bool RawValue(const Ch* json, size_t length, Type type) {
- RAPIDJSON_ASSERT(json != 0);
- PrettyPrefix(type);
- return Base::EndValue(Base::WriteRawValue(json, length));
- }
-
-protected:
- void PrettyPrefix(Type type) {
- (void)type;
- if (Base::level_stack_.GetSize() != 0) { // this value is not at root
- typename Base::Level* level = Base::level_stack_.template Top<typename Base::Level>();
-
- if (level->inArray) {
- if (level->valueCount > 0) {
- Base::os_->Put(','); // add comma if it is not the first element in array
- if (formatOptions_ & kFormatSingleLineArray)
- Base::os_->Put(' ');
- }
-
- if (!(formatOptions_ & kFormatSingleLineArray)) {
- Base::os_->Put('\n');
- WriteIndent();
- }
- }
- else { // in object
- if (level->valueCount > 0) {
- if (level->valueCount % 2 == 0) {
- Base::os_->Put(',');
- Base::os_->Put('\n');
- }
- else {
- Base::os_->Put(':');
- Base::os_->Put(' ');
- }
- }
- else
- Base::os_->Put('\n');
-
- if (level->valueCount % 2 == 0)
- WriteIndent();
- }
- if (!level->inArray && level->valueCount % 2 == 0)
- RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
- level->valueCount++;
- }
- else {
- RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root.
- Base::hasRoot_ = true;
- }
- }
-
- void WriteIndent() {
- size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;
- PutN(*Base::os_, static_cast<typename OutputStream::Ch>(indentChar_), count);
- }
-
- Ch indentChar_;
- unsigned indentCharCount_;
- PrettyFormatOptions formatOptions_;
-
-private:
- // Prohibit copy constructor & assignment operator.
- PrettyWriter(const PrettyWriter&);
- PrettyWriter& operator=(const PrettyWriter&);
-};
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/rapidjson.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/rapidjson.h
deleted file mode 100644
index 89de838619..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/rapidjson.h
+++ /dev/null
@@ -1,741 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_RAPIDJSON_H_
-#define RAPIDJSON_RAPIDJSON_H_
-
-/*!\file rapidjson.h
- \brief common definitions and configuration
-
- \see RAPIDJSON_CONFIG
- */
-
-/*! \defgroup RAPIDJSON_CONFIG RapidJSON configuration
- \brief Configuration macros for library features
-
- Some RapidJSON features are configurable to adapt the library to a wide
- variety of platforms, environments and usage scenarios. Most of the
- features can be configured in terms of overridden or predefined
- preprocessor macros at compile-time.
-
- Some additional customization is available in the \ref RAPIDJSON_ERRORS APIs.
-
- \note These macros should be given on the compiler command-line
- (where applicable) to avoid inconsistent values when compiling
- different translation units of a single application.
- */
-
-#include <cstdlib> // malloc(), realloc(), free(), size_t
-#include <cstring> // memset(), memcpy(), memmove(), memcmp()
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_VERSION_STRING
-//
-// ALWAYS synchronize the following 3 macros with corresponding variables in /CMakeLists.txt.
-//
-
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-// token stringification
-#define RAPIDJSON_STRINGIFY(x) RAPIDJSON_DO_STRINGIFY(x)
-#define RAPIDJSON_DO_STRINGIFY(x) #x
-
-// token concatenation
-#define RAPIDJSON_JOIN(X, Y) RAPIDJSON_DO_JOIN(X, Y)
-#define RAPIDJSON_DO_JOIN(X, Y) RAPIDJSON_DO_JOIN2(X, Y)
-#define RAPIDJSON_DO_JOIN2(X, Y) X##Y
-//!@endcond
-
-/*! \def RAPIDJSON_MAJOR_VERSION
- \ingroup RAPIDJSON_CONFIG
- \brief Major version of RapidJSON in integer.
-*/
-/*! \def RAPIDJSON_MINOR_VERSION
- \ingroup RAPIDJSON_CONFIG
- \brief Minor version of RapidJSON in integer.
-*/
-/*! \def RAPIDJSON_PATCH_VERSION
- \ingroup RAPIDJSON_CONFIG
- \brief Patch version of RapidJSON in integer.
-*/
-/*! \def RAPIDJSON_VERSION_STRING
- \ingroup RAPIDJSON_CONFIG
- \brief Version of RapidJSON in "<major>.<minor>.<patch>" string format.
-*/
-#define RAPIDJSON_MAJOR_VERSION 1
-#define RAPIDJSON_MINOR_VERSION 1
-#define RAPIDJSON_PATCH_VERSION 0
-#define RAPIDJSON_VERSION_STRING \
- RAPIDJSON_STRINGIFY(RAPIDJSON_MAJOR_VERSION.RAPIDJSON_MINOR_VERSION.RAPIDJSON_PATCH_VERSION)
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_NAMESPACE_(BEGIN|END)
-/*! \def RAPIDJSON_NAMESPACE
- \ingroup RAPIDJSON_CONFIG
- \brief provide custom rapidjson namespace
-
- In order to avoid symbol clashes and/or "One Definition Rule" errors
- between multiple inclusions of (different versions of) RapidJSON in
- a single binary, users can customize the name of the main RapidJSON
- namespace.
-
- In case of a single nesting level, defining \c RAPIDJSON_NAMESPACE
- to a custom name (e.g. \c MyRapidJSON) is sufficient. If multiple
- levels are needed, both \ref RAPIDJSON_NAMESPACE_BEGIN and \ref
- RAPIDJSON_NAMESPACE_END need to be defined as well:
-
- \code
- // in some .cpp file
- #define RAPIDJSON_NAMESPACE my::rapidjson
- #define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapidjson {
- #define RAPIDJSON_NAMESPACE_END } }
- #include "rapidjson/..."
- \endcode
-
- \see rapidjson
- */
-/*! \def RAPIDJSON_NAMESPACE_BEGIN
- \ingroup RAPIDJSON_CONFIG
- \brief provide custom rapidjson namespace (opening expression)
- \see RAPIDJSON_NAMESPACE
-*/
-/*! \def RAPIDJSON_NAMESPACE_END
- \ingroup RAPIDJSON_CONFIG
- \brief provide custom rapidjson namespace (closing expression)
- \see RAPIDJSON_NAMESPACE
-*/
-#ifndef RAPIDJSON_NAMESPACE
-#define RAPIDJSON_NAMESPACE rapidjson
-#endif
-#ifndef RAPIDJSON_NAMESPACE_BEGIN
-#define RAPIDJSON_NAMESPACE_BEGIN namespace RAPIDJSON_NAMESPACE {
-#endif
-#ifndef RAPIDJSON_NAMESPACE_END
-#define RAPIDJSON_NAMESPACE_END }
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// __cplusplus macro
-
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-
-#if defined(_MSC_VER)
-#define RAPIDJSON_CPLUSPLUS _MSVC_LANG
-#else
-#define RAPIDJSON_CPLUSPLUS __cplusplus
-#endif
-
-//!@endcond
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_HAS_STDSTRING
-
-#ifndef RAPIDJSON_HAS_STDSTRING
-#ifdef RAPIDJSON_DOXYGEN_RUNNING
-#define RAPIDJSON_HAS_STDSTRING 1 // force generation of documentation
-#else
-#define RAPIDJSON_HAS_STDSTRING 0 // no std::string support by default
-#endif
-/*! \def RAPIDJSON_HAS_STDSTRING
- \ingroup RAPIDJSON_CONFIG
- \brief Enable RapidJSON support for \c std::string
-
- By defining this preprocessor symbol to \c 1, several convenience functions for using
- \ref rapidjson::GenericValue with \c std::string are enabled, especially
- for construction and comparison.
-
- \hideinitializer
-*/
-#endif // !defined(RAPIDJSON_HAS_STDSTRING)
-
-#if RAPIDJSON_HAS_STDSTRING
-#include <string>
-#endif // RAPIDJSON_HAS_STDSTRING
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_USE_MEMBERSMAP
-
-/*! \def RAPIDJSON_USE_MEMBERSMAP
- \ingroup RAPIDJSON_CONFIG
- \brief Enable RapidJSON support for object members handling in a \c std::multimap
-
- By defining this preprocessor symbol to \c 1, \ref rapidjson::GenericValue object
- members are stored in a \c std::multimap for faster lookup and deletion times, a
- trade off with a slightly slower insertion time and a small object allocat(or)ed
- memory overhead.
-
- \hideinitializer
-*/
-#ifndef RAPIDJSON_USE_MEMBERSMAP
-#define RAPIDJSON_USE_MEMBERSMAP 0 // not by default
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_NO_INT64DEFINE
-
-/*! \def RAPIDJSON_NO_INT64DEFINE
- \ingroup RAPIDJSON_CONFIG
- \brief Use external 64-bit integer types.
-
- RapidJSON requires the 64-bit integer types \c int64_t and \c uint64_t types
- to be available at global scope.
-
- If users have their own definition, define RAPIDJSON_NO_INT64DEFINE to
- prevent RapidJSON from defining its own types.
-*/
-#ifndef RAPIDJSON_NO_INT64DEFINE
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#if defined(_MSC_VER) && (_MSC_VER < 1800) // Visual Studio 2013
-#include "msinttypes/stdint.h"
-#include "msinttypes/inttypes.h"
-#else
-// Other compilers should have this.
-#include <stdint.h>
-#include <inttypes.h>
-#endif
-//!@endcond
-#ifdef RAPIDJSON_DOXYGEN_RUNNING
-#define RAPIDJSON_NO_INT64DEFINE
-#endif
-#endif // RAPIDJSON_NO_INT64TYPEDEF
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_FORCEINLINE
-
-#ifndef RAPIDJSON_FORCEINLINE
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#if defined(_MSC_VER) && defined(NDEBUG)
-#define RAPIDJSON_FORCEINLINE __forceinline
-#elif defined(__GNUC__) && __GNUC__ >= 4 && defined(NDEBUG)
-#define RAPIDJSON_FORCEINLINE __attribute__((always_inline))
-#else
-#define RAPIDJSON_FORCEINLINE
-#endif
-//!@endcond
-#endif // RAPIDJSON_FORCEINLINE
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_ENDIAN
-#define RAPIDJSON_LITTLEENDIAN 0 //!< Little endian machine
-#define RAPIDJSON_BIGENDIAN 1 //!< Big endian machine
-
-//! Endianness of the machine.
-/*!
- \def RAPIDJSON_ENDIAN
- \ingroup RAPIDJSON_CONFIG
-
- GCC 4.6 provided macro for detecting endianness of the target machine. But other
- compilers may not have this. User can define RAPIDJSON_ENDIAN to either
- \ref RAPIDJSON_LITTLEENDIAN or \ref RAPIDJSON_BIGENDIAN.
-
- Default detection implemented with reference to
- \li https://gcc.gnu.org/onlinedocs/gcc-4.6.0/cpp/Common-Predefined-Macros.html
- \li http://www.boost.org/doc/libs/1_42_0/boost/detail/endian.hpp
-*/
-#ifndef RAPIDJSON_ENDIAN
-// Detect with GCC 4.6's macro
-# ifdef __BYTE_ORDER__
-# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
-# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
-# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
-# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
-# else
-# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
-# endif // __BYTE_ORDER__
-// Detect with GLIBC's endian.h
-# elif defined(__GLIBC__)
-# include <endian.h>
-# if (__BYTE_ORDER == __LITTLE_ENDIAN)
-# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
-# elif (__BYTE_ORDER == __BIG_ENDIAN)
-# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
-# else
-# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
-# endif // __GLIBC__
-// Detect with _LITTLE_ENDIAN and _BIG_ENDIAN macro
-# elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
-# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
-# elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
-# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
-// Detect with architecture macros
-# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__)
-# define RAPIDJSON_ENDIAN RAPIDJSON_BIGENDIAN
-# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__)
-# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
-# elif defined(_MSC_VER) && (defined(_M_ARM) || defined(_M_ARM64))
-# define RAPIDJSON_ENDIAN RAPIDJSON_LITTLEENDIAN
-# elif defined(RAPIDJSON_DOXYGEN_RUNNING)
-# define RAPIDJSON_ENDIAN
-# else
-# error Unknown machine endianness detected. User needs to define RAPIDJSON_ENDIAN.
-# endif
-#endif // RAPIDJSON_ENDIAN
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_64BIT
-
-//! Whether using 64-bit architecture
-#ifndef RAPIDJSON_64BIT
-#if defined(__LP64__) || (defined(__x86_64__) && defined(__ILP32__)) || defined(_WIN64) || defined(__EMSCRIPTEN__)
-#define RAPIDJSON_64BIT 1
-#else
-#define RAPIDJSON_64BIT 0
-#endif
-#endif // RAPIDJSON_64BIT
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_ALIGN
-
-//! Data alignment of the machine.
-/*! \ingroup RAPIDJSON_CONFIG
- \param x pointer to align
-
- Some machines require strict data alignment. The default is 8 bytes.
- User can customize by defining the RAPIDJSON_ALIGN function macro.
-*/
-#ifndef RAPIDJSON_ALIGN
-#define RAPIDJSON_ALIGN(x) (((x) + static_cast<size_t>(7u)) & ~static_cast<size_t>(7u))
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_UINT64_C2
-
-//! Construct a 64-bit literal by a pair of 32-bit integer.
-/*!
- 64-bit literal with or without ULL suffix is prone to compiler warnings.
- UINT64_C() is C macro which cause compilation problems.
- Use this macro to define 64-bit constants by a pair of 32-bit integer.
-*/
-#ifndef RAPIDJSON_UINT64_C2
-#define RAPIDJSON_UINT64_C2(high32, low32) ((static_cast<uint64_t>(high32) << 32) | static_cast<uint64_t>(low32))
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_48BITPOINTER_OPTIMIZATION
-
-//! Use only lower 48-bit address for some pointers.
-/*!
- \ingroup RAPIDJSON_CONFIG
-
- This optimization uses the fact that current X86-64 architecture only implement lower 48-bit virtual address.
- The higher 16-bit can be used for storing other data.
- \c GenericValue uses this optimization to reduce its size form 24 bytes to 16 bytes in 64-bit architecture.
-*/
-#ifndef RAPIDJSON_48BITPOINTER_OPTIMIZATION
-#if defined(__amd64__) || defined(__amd64) || defined(__x86_64__) || defined(__x86_64) || defined(_M_X64) || defined(_M_AMD64)
-#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 1
-#else
-#define RAPIDJSON_48BITPOINTER_OPTIMIZATION 0
-#endif
-#endif // RAPIDJSON_48BITPOINTER_OPTIMIZATION
-
-#if RAPIDJSON_48BITPOINTER_OPTIMIZATION == 1
-#if RAPIDJSON_64BIT != 1
-#error RAPIDJSON_48BITPOINTER_OPTIMIZATION can only be set to 1 when RAPIDJSON_64BIT=1
-#endif
-#define RAPIDJSON_SETPOINTER(type, p, x) (p = reinterpret_cast<type *>((reinterpret_cast<uintptr_t>(p) & static_cast<uintptr_t>(RAPIDJSON_UINT64_C2(0xFFFF0000, 0x00000000))) | reinterpret_cast<uintptr_t>(reinterpret_cast<const void*>(x))))
-#define RAPIDJSON_GETPOINTER(type, p) (reinterpret_cast<type *>(reinterpret_cast<uintptr_t>(p) & static_cast<uintptr_t>(RAPIDJSON_UINT64_C2(0x0000FFFF, 0xFFFFFFFF))))
-#else
-#define RAPIDJSON_SETPOINTER(type, p, x) (p = (x))
-#define RAPIDJSON_GETPOINTER(type, p) (p)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_SSE2/RAPIDJSON_SSE42/RAPIDJSON_NEON/RAPIDJSON_SIMD
-
-/*! \def RAPIDJSON_SIMD
- \ingroup RAPIDJSON_CONFIG
- \brief Enable SSE2/SSE4.2/Neon optimization.
-
- RapidJSON supports optimized implementations for some parsing operations
- based on the SSE2, SSE4.2 or NEon SIMD extensions on modern Intel
- or ARM compatible processors.
-
- To enable these optimizations, three different symbols can be defined;
- \code
- // Enable SSE2 optimization.
- #define RAPIDJSON_SSE2
-
- // Enable SSE4.2 optimization.
- #define RAPIDJSON_SSE42
- \endcode
-
- // Enable ARM Neon optimization.
- #define RAPIDJSON_NEON
- \endcode
-
- \c RAPIDJSON_SSE42 takes precedence over SSE2, if both are defined.
-
- If any of these symbols is defined, RapidJSON defines the macro
- \c RAPIDJSON_SIMD to indicate the availability of the optimized code.
-*/
-#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42) \
- || defined(RAPIDJSON_NEON) || defined(RAPIDJSON_DOXYGEN_RUNNING)
-#define RAPIDJSON_SIMD
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_NO_SIZETYPEDEFINE
-
-#ifndef RAPIDJSON_NO_SIZETYPEDEFINE
-/*! \def RAPIDJSON_NO_SIZETYPEDEFINE
- \ingroup RAPIDJSON_CONFIG
- \brief User-provided \c SizeType definition.
-
- In order to avoid using 32-bit size types for indexing strings and arrays,
- define this preprocessor symbol and provide the type rapidjson::SizeType
- before including RapidJSON:
- \code
- #define RAPIDJSON_NO_SIZETYPEDEFINE
- namespace rapidjson { typedef ::std::size_t SizeType; }
- #include "rapidjson/..."
- \endcode
-
- \see rapidjson::SizeType
-*/
-#ifdef RAPIDJSON_DOXYGEN_RUNNING
-#define RAPIDJSON_NO_SIZETYPEDEFINE
-#endif
-RAPIDJSON_NAMESPACE_BEGIN
-//! Size type (for string lengths, array sizes, etc.)
-/*! RapidJSON uses 32-bit array/string indices even on 64-bit platforms,
- instead of using \c size_t. Users may override the SizeType by defining
- \ref RAPIDJSON_NO_SIZETYPEDEFINE.
-*/
-typedef unsigned SizeType;
-RAPIDJSON_NAMESPACE_END
-#endif
-
-// always import std::size_t to rapidjson namespace
-RAPIDJSON_NAMESPACE_BEGIN
-using std::size_t;
-RAPIDJSON_NAMESPACE_END
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_ASSERT
-
-//! Assertion.
-/*! \ingroup RAPIDJSON_CONFIG
- By default, rapidjson uses C \c assert() for internal assertions.
- User can override it by defining RAPIDJSON_ASSERT(x) macro.
-
- \note Parsing errors are handled and can be customized by the
- \ref RAPIDJSON_ERRORS APIs.
-*/
-#ifndef RAPIDJSON_ASSERT
-#include <cassert>
-#define RAPIDJSON_ASSERT(x) assert(x)
-#endif // RAPIDJSON_ASSERT
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_STATIC_ASSERT
-
-// Prefer C++11 static_assert, if available
-#ifndef RAPIDJSON_STATIC_ASSERT
-#if RAPIDJSON_CPLUSPLUS >= 201103L || ( defined(_MSC_VER) && _MSC_VER >= 1800 )
-#define RAPIDJSON_STATIC_ASSERT(x) \
- static_assert(x, RAPIDJSON_STRINGIFY(x))
-#endif // C++11
-#endif // RAPIDJSON_STATIC_ASSERT
-
-// Adopt C++03 implementation from boost
-#ifndef RAPIDJSON_STATIC_ASSERT
-#ifndef __clang__
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#endif
-RAPIDJSON_NAMESPACE_BEGIN
-template <bool x> struct STATIC_ASSERTION_FAILURE;
-template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; };
-template <size_t x> struct StaticAssertTest {};
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__GNUC__) || defined(__clang__)
-#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE __attribute__((unused))
-#else
-#define RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
-#endif
-#ifndef __clang__
-//!@endcond
-#endif
-
-/*! \def RAPIDJSON_STATIC_ASSERT
- \brief (Internal) macro to check for conditions at compile-time
- \param x compile-time condition
- \hideinitializer
- */
-#define RAPIDJSON_STATIC_ASSERT(x) \
- typedef ::RAPIDJSON_NAMESPACE::StaticAssertTest< \
- sizeof(::RAPIDJSON_NAMESPACE::STATIC_ASSERTION_FAILURE<bool(x) >)> \
- RAPIDJSON_JOIN(StaticAssertTypedef, __LINE__) RAPIDJSON_STATIC_ASSERT_UNUSED_ATTRIBUTE
-#endif // RAPIDJSON_STATIC_ASSERT
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_LIKELY, RAPIDJSON_UNLIKELY
-
-//! Compiler branching hint for expression with high probability to be true.
-/*!
- \ingroup RAPIDJSON_CONFIG
- \param x Boolean expression likely to be true.
-*/
-#ifndef RAPIDJSON_LIKELY
-#if defined(__GNUC__) || defined(__clang__)
-#define RAPIDJSON_LIKELY(x) __builtin_expect(!!(x), 1)
-#else
-#define RAPIDJSON_LIKELY(x) (x)
-#endif
-#endif
-
-//! Compiler branching hint for expression with low probability to be true.
-/*!
- \ingroup RAPIDJSON_CONFIG
- \param x Boolean expression unlikely to be true.
-*/
-#ifndef RAPIDJSON_UNLIKELY
-#if defined(__GNUC__) || defined(__clang__)
-#define RAPIDJSON_UNLIKELY(x) __builtin_expect(!!(x), 0)
-#else
-#define RAPIDJSON_UNLIKELY(x) (x)
-#endif
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// Helpers
-
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-
-#define RAPIDJSON_MULTILINEMACRO_BEGIN do {
-#define RAPIDJSON_MULTILINEMACRO_END \
-} while((void)0, 0)
-
-// adopted from Boost
-#define RAPIDJSON_VERSION_CODE(x,y,z) \
- (((x)*100000) + ((y)*100) + (z))
-
-#if defined(__has_builtin)
-#define RAPIDJSON_HAS_BUILTIN(x) __has_builtin(x)
-#else
-#define RAPIDJSON_HAS_BUILTIN(x) 0
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_DIAG_PUSH/POP, RAPIDJSON_DIAG_OFF
-
-#if defined(__GNUC__)
-#define RAPIDJSON_GNUC \
- RAPIDJSON_VERSION_CODE(__GNUC__,__GNUC_MINOR__,__GNUC_PATCHLEVEL__)
-#endif
-
-#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,2,0))
-
-#define RAPIDJSON_PRAGMA(x) _Pragma(RAPIDJSON_STRINGIFY(x))
-#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(GCC diagnostic x)
-#define RAPIDJSON_DIAG_OFF(x) \
- RAPIDJSON_DIAG_PRAGMA(ignored RAPIDJSON_STRINGIFY(RAPIDJSON_JOIN(-W,x)))
-
-// push/pop support in Clang and GCC>=4.6
-#if defined(__clang__) || (defined(RAPIDJSON_GNUC) && RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0))
-#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
-#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
-#else // GCC >= 4.2, < 4.6
-#define RAPIDJSON_DIAG_PUSH /* ignored */
-#define RAPIDJSON_DIAG_POP /* ignored */
-#endif
-
-#elif defined(_MSC_VER)
-
-// pragma (MSVC specific)
-#define RAPIDJSON_PRAGMA(x) __pragma(x)
-#define RAPIDJSON_DIAG_PRAGMA(x) RAPIDJSON_PRAGMA(warning(x))
-
-#define RAPIDJSON_DIAG_OFF(x) RAPIDJSON_DIAG_PRAGMA(disable: x)
-#define RAPIDJSON_DIAG_PUSH RAPIDJSON_DIAG_PRAGMA(push)
-#define RAPIDJSON_DIAG_POP RAPIDJSON_DIAG_PRAGMA(pop)
-
-#else
-
-#define RAPIDJSON_DIAG_OFF(x) /* ignored */
-#define RAPIDJSON_DIAG_PUSH /* ignored */
-#define RAPIDJSON_DIAG_POP /* ignored */
-
-#endif // RAPIDJSON_DIAG_*
-
-///////////////////////////////////////////////////////////////////////////////
-// C++11 features
-
-#ifndef RAPIDJSON_HAS_CXX11
-#define RAPIDJSON_HAS_CXX11 (RAPIDJSON_CPLUSPLUS >= 201103L)
-#endif
-
-#ifndef RAPIDJSON_HAS_CXX11_RVALUE_REFS
-#if RAPIDJSON_HAS_CXX11
-#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
-#elif defined(__clang__)
-#if __has_feature(cxx_rvalue_references) && \
- (defined(_MSC_VER) || defined(_LIBCPP_VERSION) || defined(__GLIBCXX__) && __GLIBCXX__ >= 20080306)
-#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
-#else
-#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
-#endif
-#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,3,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
- (defined(_MSC_VER) && _MSC_VER >= 1600) || \
- (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
-
-#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 1
-#else
-#define RAPIDJSON_HAS_CXX11_RVALUE_REFS 0
-#endif
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-#include <utility> // std::move
-#endif
-
-#ifndef RAPIDJSON_HAS_CXX11_NOEXCEPT
-#if RAPIDJSON_HAS_CXX11
-#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
-#elif defined(__clang__)
-#define RAPIDJSON_HAS_CXX11_NOEXCEPT __has_feature(cxx_noexcept)
-#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
- (defined(_MSC_VER) && _MSC_VER >= 1900) || \
- (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
-#define RAPIDJSON_HAS_CXX11_NOEXCEPT 1
-#else
-#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
-#endif
-#endif
-#ifndef RAPIDJSON_NOEXCEPT
-#if RAPIDJSON_HAS_CXX11_NOEXCEPT
-#define RAPIDJSON_NOEXCEPT noexcept
-#else
-#define RAPIDJSON_NOEXCEPT throw()
-#endif // RAPIDJSON_HAS_CXX11_NOEXCEPT
-#endif
-
-// no automatic detection, yet
-#ifndef RAPIDJSON_HAS_CXX11_TYPETRAITS
-#if (defined(_MSC_VER) && _MSC_VER >= 1700)
-#define RAPIDJSON_HAS_CXX11_TYPETRAITS 1
-#else
-#define RAPIDJSON_HAS_CXX11_TYPETRAITS 0
-#endif
-#endif
-
-#ifndef RAPIDJSON_HAS_CXX11_RANGE_FOR
-#if defined(__clang__)
-#define RAPIDJSON_HAS_CXX11_RANGE_FOR __has_feature(cxx_range_for)
-#elif (defined(RAPIDJSON_GNUC) && (RAPIDJSON_GNUC >= RAPIDJSON_VERSION_CODE(4,6,0)) && defined(__GXX_EXPERIMENTAL_CXX0X__)) || \
- (defined(_MSC_VER) && _MSC_VER >= 1700) || \
- (defined(__SUNPRO_CC) && __SUNPRO_CC >= 0x5140 && defined(__GXX_EXPERIMENTAL_CXX0X__))
-#define RAPIDJSON_HAS_CXX11_RANGE_FOR 1
-#else
-#define RAPIDJSON_HAS_CXX11_RANGE_FOR 0
-#endif
-#endif // RAPIDJSON_HAS_CXX11_RANGE_FOR
-
-///////////////////////////////////////////////////////////////////////////////
-// C++17 features
-
-#ifndef RAPIDJSON_HAS_CXX17
-#define RAPIDJSON_HAS_CXX17 (RAPIDJSON_CPLUSPLUS >= 201703L)
-#endif
-
-#if RAPIDJSON_HAS_CXX17
-# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[fallthrough]]
-#elif defined(__has_cpp_attribute)
-# if __has_cpp_attribute(clang::fallthrough)
-# define RAPIDJSON_DELIBERATE_FALLTHROUGH [[clang::fallthrough]]
-# elif __has_cpp_attribute(fallthrough)
-# define RAPIDJSON_DELIBERATE_FALLTHROUGH __attribute__((fallthrough))
-# else
-# define RAPIDJSON_DELIBERATE_FALLTHROUGH
-# endif
-#else
-# define RAPIDJSON_DELIBERATE_FALLTHROUGH
-#endif
-
-//!@endcond
-
-//! Assertion (in non-throwing contexts).
- /*! \ingroup RAPIDJSON_CONFIG
- Some functions provide a \c noexcept guarantee, if the compiler supports it.
- In these cases, the \ref RAPIDJSON_ASSERT macro cannot be overridden to
- throw an exception. This macro adds a separate customization point for
- such cases.
-
- Defaults to C \c assert() (as \ref RAPIDJSON_ASSERT), if \c noexcept is
- supported, and to \ref RAPIDJSON_ASSERT otherwise.
- */
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_NOEXCEPT_ASSERT
-
-#ifndef RAPIDJSON_NOEXCEPT_ASSERT
-#ifdef RAPIDJSON_ASSERT_THROWS
-#include <cassert>
-#define RAPIDJSON_NOEXCEPT_ASSERT(x) assert(x)
-#else
-#define RAPIDJSON_NOEXCEPT_ASSERT(x) RAPIDJSON_ASSERT(x)
-#endif // RAPIDJSON_ASSERT_THROWS
-#endif // RAPIDJSON_NOEXCEPT_ASSERT
-
-///////////////////////////////////////////////////////////////////////////////
-// malloc/realloc/free
-
-#ifndef RAPIDJSON_MALLOC
-///! customization point for global \c malloc
-#define RAPIDJSON_MALLOC(size) std::malloc(size)
-#endif
-#ifndef RAPIDJSON_REALLOC
-///! customization point for global \c realloc
-#define RAPIDJSON_REALLOC(ptr, new_size) std::realloc(ptr, new_size)
-#endif
-#ifndef RAPIDJSON_FREE
-///! customization point for global \c free
-#define RAPIDJSON_FREE(ptr) std::free(ptr)
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// new/delete
-
-#ifndef RAPIDJSON_NEW
-///! customization point for global \c new
-#define RAPIDJSON_NEW(TypeName) new TypeName
-#endif
-#ifndef RAPIDJSON_DELETE
-///! customization point for global \c delete
-#define RAPIDJSON_DELETE(x) delete x
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// Type
-
-/*! \namespace rapidjson
- \brief main RapidJSON namespace
- \see RAPIDJSON_NAMESPACE
-*/
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Type of JSON value
-enum Type {
- kNullType = 0, //!< null
- kFalseType = 1, //!< false
- kTrueType = 2, //!< true
- kObjectType = 3, //!< object
- kArrayType = 4, //!< array
- kStringType = 5, //!< string
- kNumberType = 6 //!< number
-};
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/reader.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/reader.h
deleted file mode 100644
index 55546601e2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/reader.h
+++ /dev/null
@@ -1,2246 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_READER_H_
-#define RAPIDJSON_READER_H_
-
-/*! \file reader.h */
-
-#include "allocators.h"
-#include "stream.h"
-#include "encodedstream.h"
-#include "internal/clzll.h"
-#include "internal/meta.h"
-#include "internal/stack.h"
-#include "internal/strtod.h"
-#include <limits>
-
-#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
-#include <intrin.h>
-#pragma intrinsic(_BitScanForward)
-#endif
-#ifdef RAPIDJSON_SSE42
-#include <nmmintrin.h>
-#elif defined(RAPIDJSON_SSE2)
-#include <emmintrin.h>
-#elif defined(RAPIDJSON_NEON)
-#include <arm_neon.h>
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(old-style-cast)
-RAPIDJSON_DIAG_OFF(padded)
-RAPIDJSON_DIAG_OFF(switch-enum)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
-RAPIDJSON_DIAG_OFF(4702) // unreachable code
-#endif
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#define RAPIDJSON_NOTHING /* deliberately empty */
-#ifndef RAPIDJSON_PARSE_ERROR_EARLY_RETURN
-#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN(value) \
- RAPIDJSON_MULTILINEMACRO_BEGIN \
- if (RAPIDJSON_UNLIKELY(HasParseError())) { return value; } \
- RAPIDJSON_MULTILINEMACRO_END
-#endif
-#define RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID \
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(RAPIDJSON_NOTHING)
-//!@endcond
-
-/*! \def RAPIDJSON_PARSE_ERROR_NORETURN
- \ingroup RAPIDJSON_ERRORS
- \brief Macro to indicate a parse error.
- \param parseErrorCode \ref rapidjson::ParseErrorCode of the error
- \param offset position of the error in JSON input (\c size_t)
-
- This macros can be used as a customization point for the internal
- error handling mechanism of RapidJSON.
-
- A common usage model is to throw an exception instead of requiring the
- caller to explicitly check the \ref rapidjson::GenericReader::Parse's
- return value:
-
- \code
- #define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode,offset) \
- throw ParseException(parseErrorCode, #parseErrorCode, offset)
-
- #include <stdexcept> // std::runtime_error
- #include "rapidjson/error/error.h" // rapidjson::ParseResult
-
- struct ParseException : std::runtime_error, rapidjson::ParseResult {
- ParseException(rapidjson::ParseErrorCode code, const char* msg, size_t offset)
- : std::runtime_error(msg), ParseResult(code, offset) {}
- };
-
- #include "rapidjson/reader.h"
- \endcode
-
- \see RAPIDJSON_PARSE_ERROR, rapidjson::GenericReader::Parse
- */
-#ifndef RAPIDJSON_PARSE_ERROR_NORETURN
-#define RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset) \
- RAPIDJSON_MULTILINEMACRO_BEGIN \
- RAPIDJSON_ASSERT(!HasParseError()); /* Error can only be assigned once */ \
- SetParseError(parseErrorCode, offset); \
- RAPIDJSON_MULTILINEMACRO_END
-#endif
-
-/*! \def RAPIDJSON_PARSE_ERROR
- \ingroup RAPIDJSON_ERRORS
- \brief (Internal) macro to indicate and handle a parse error.
- \param parseErrorCode \ref rapidjson::ParseErrorCode of the error
- \param offset position of the error in JSON input (\c size_t)
-
- Invokes RAPIDJSON_PARSE_ERROR_NORETURN and stops the parsing.
-
- \see RAPIDJSON_PARSE_ERROR_NORETURN
- \hideinitializer
- */
-#ifndef RAPIDJSON_PARSE_ERROR
-#define RAPIDJSON_PARSE_ERROR(parseErrorCode, offset) \
- RAPIDJSON_MULTILINEMACRO_BEGIN \
- RAPIDJSON_PARSE_ERROR_NORETURN(parseErrorCode, offset); \
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID; \
- RAPIDJSON_MULTILINEMACRO_END
-#endif
-
-#include "error/error.h" // ParseErrorCode, ParseResult
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// ParseFlag
-
-/*! \def RAPIDJSON_PARSE_DEFAULT_FLAGS
- \ingroup RAPIDJSON_CONFIG
- \brief User-defined kParseDefaultFlags definition.
-
- User can define this as any \c ParseFlag combinations.
-*/
-#ifndef RAPIDJSON_PARSE_DEFAULT_FLAGS
-#define RAPIDJSON_PARSE_DEFAULT_FLAGS kParseNoFlags
-#endif
-
-//! Combination of parseFlags
-/*! \see Reader::Parse, Document::Parse, Document::ParseInsitu, Document::ParseStream
- */
-enum ParseFlag {
- kParseNoFlags = 0, //!< No flags are set.
- kParseInsituFlag = 1, //!< In-situ(destructive) parsing.
- kParseValidateEncodingFlag = 2, //!< Validate encoding of JSON strings.
- kParseIterativeFlag = 4, //!< Iterative(constant complexity in terms of function call stack size) parsing.
- kParseStopWhenDoneFlag = 8, //!< After parsing a complete JSON root from stream, stop further processing the rest of stream. When this flag is used, parser will not generate kParseErrorDocumentRootNotSingular error.
- kParseFullPrecisionFlag = 16, //!< Parse number in full precision (but slower).
- kParseCommentsFlag = 32, //!< Allow one-line (//) and multi-line (/**/) comments.
- kParseNumbersAsStringsFlag = 64, //!< Parse all numbers (ints/doubles) as strings.
- kParseTrailingCommasFlag = 128, //!< Allow trailing commas at the end of objects and arrays.
- kParseNanAndInfFlag = 256, //!< Allow parsing NaN, Inf, Infinity, -Inf and -Infinity as doubles.
- kParseEscapedApostropheFlag = 512, //!< Allow escaped apostrophe in strings.
- kParseDefaultFlags = RAPIDJSON_PARSE_DEFAULT_FLAGS //!< Default parse flags. Can be customized by defining RAPIDJSON_PARSE_DEFAULT_FLAGS
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Handler
-
-/*! \class rapidjson::Handler
- \brief Concept for receiving events from GenericReader upon parsing.
- The functions return true if no error occurs. If they return false,
- the event publisher should terminate the process.
-\code
-concept Handler {
- typename Ch;
-
- bool Null();
- bool Bool(bool b);
- bool Int(int i);
- bool Uint(unsigned i);
- bool Int64(int64_t i);
- bool Uint64(uint64_t i);
- bool Double(double d);
- /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length)
- bool RawNumber(const Ch* str, SizeType length, bool copy);
- bool String(const Ch* str, SizeType length, bool copy);
- bool StartObject();
- bool Key(const Ch* str, SizeType length, bool copy);
- bool EndObject(SizeType memberCount);
- bool StartArray();
- bool EndArray(SizeType elementCount);
-};
-\endcode
-*/
-///////////////////////////////////////////////////////////////////////////////
-// BaseReaderHandler
-
-//! Default implementation of Handler.
-/*! This can be used as base class of any reader handler.
- \note implements Handler concept
-*/
-template<typename Encoding = UTF8<>, typename Derived = void>
-struct BaseReaderHandler {
- typedef typename Encoding::Ch Ch;
-
- typedef typename internal::SelectIf<internal::IsSame<Derived, void>, BaseReaderHandler, Derived>::Type Override;
-
- bool Default() { return true; }
- bool Null() { return static_cast<Override&>(*this).Default(); }
- bool Bool(bool) { return static_cast<Override&>(*this).Default(); }
- bool Int(int) { return static_cast<Override&>(*this).Default(); }
- bool Uint(unsigned) { return static_cast<Override&>(*this).Default(); }
- bool Int64(int64_t) { return static_cast<Override&>(*this).Default(); }
- bool Uint64(uint64_t) { return static_cast<Override&>(*this).Default(); }
- bool Double(double) { return static_cast<Override&>(*this).Default(); }
- /// enabled via kParseNumbersAsStringsFlag, string is not null-terminated (use length)
- bool RawNumber(const Ch* str, SizeType len, bool copy) { return static_cast<Override&>(*this).String(str, len, copy); }
- bool String(const Ch*, SizeType, bool) { return static_cast<Override&>(*this).Default(); }
- bool StartObject() { return static_cast<Override&>(*this).Default(); }
- bool Key(const Ch* str, SizeType len, bool copy) { return static_cast<Override&>(*this).String(str, len, copy); }
- bool EndObject(SizeType) { return static_cast<Override&>(*this).Default(); }
- bool StartArray() { return static_cast<Override&>(*this).Default(); }
- bool EndArray(SizeType) { return static_cast<Override&>(*this).Default(); }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// StreamLocalCopy
-
-namespace internal {
-
-template<typename Stream, int = StreamTraits<Stream>::copyOptimization>
-class StreamLocalCopy;
-
-//! Do copy optimization.
-template<typename Stream>
-class StreamLocalCopy<Stream, 1> {
-public:
- StreamLocalCopy(Stream& original) : s(original), original_(original) {}
- ~StreamLocalCopy() { original_ = s; }
-
- Stream s;
-
-private:
- StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;
-
- Stream& original_;
-};
-
-//! Keep reference.
-template<typename Stream>
-class StreamLocalCopy<Stream, 0> {
-public:
- StreamLocalCopy(Stream& original) : s(original) {}
-
- Stream& s;
-
-private:
- StreamLocalCopy& operator=(const StreamLocalCopy&) /* = delete */;
-};
-
-} // namespace internal
-
-///////////////////////////////////////////////////////////////////////////////
-// SkipWhitespace
-
-//! Skip the JSON white spaces in a stream.
-/*! \param is A input stream for skipping white spaces.
- \note This function has SSE2/SSE4.2 specialization.
-*/
-template<typename InputStream>
-void SkipWhitespace(InputStream& is) {
- internal::StreamLocalCopy<InputStream> copy(is);
- InputStream& s(copy.s);
-
- typename InputStream::Ch c;
- while ((c = s.Peek()) == ' ' || c == '\n' || c == '\r' || c == '\t')
- s.Take();
-}
-
-inline const char* SkipWhitespace(const char* p, const char* end) {
- while (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t'))
- ++p;
- return p;
-}
-
-#ifdef RAPIDJSON_SSE42
-//! Skip whitespace with SSE 4.2 pcmpistrm instruction, testing 16 8-byte characters at once.
-inline const char *SkipWhitespace_SIMD(const char* p) {
- // Fast return for single non-whitespace
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- // 16-byte align to the next boundary
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- // The rest of string using SIMD
- static const char whitespace[16] = " \n\r\t";
- const __m128i w = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespace[0]));
-
- for (;; p += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY);
- if (r != 16) // some of characters is non-whitespace
- return p + r;
- }
-}
-
-inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
- // Fast return for single non-whitespace
- if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t'))
- ++p;
- else
- return p;
-
- // The middle of string using SIMD
- static const char whitespace[16] = " \n\r\t";
- const __m128i w = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespace[0]));
-
- for (; p <= end - 16; p += 16) {
- const __m128i s = _mm_loadu_si128(reinterpret_cast<const __m128i *>(p));
- const int r = _mm_cmpistri(w, s, _SIDD_UBYTE_OPS | _SIDD_CMP_EQUAL_ANY | _SIDD_LEAST_SIGNIFICANT | _SIDD_NEGATIVE_POLARITY);
- if (r != 16) // some of characters is non-whitespace
- return p + r;
- }
-
- return SkipWhitespace(p, end);
-}
-
-#elif defined(RAPIDJSON_SSE2)
-
-//! Skip whitespace with SSE2 instructions, testing 16 8-byte characters at once.
-inline const char *SkipWhitespace_SIMD(const char* p) {
- // Fast return for single non-whitespace
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- // 16-byte align to the next boundary
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- // The rest of string
- #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c }
- static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') };
- #undef C16
-
- const __m128i w0 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[0][0]));
- const __m128i w1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[1][0]));
- const __m128i w2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[2][0]));
- const __m128i w3 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[3][0]));
-
- for (;; p += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- __m128i x = _mm_cmpeq_epi8(s, w0);
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1));
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2));
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3));
- unsigned short r = static_cast<unsigned short>(~_mm_movemask_epi8(x));
- if (r != 0) { // some of characters may be non-whitespace
-#ifdef _MSC_VER // Find the index of first non-whitespace
- unsigned long offset;
- _BitScanForward(&offset, r);
- return p + offset;
-#else
- return p + __builtin_ffs(r) - 1;
-#endif
- }
- }
-}
-
-inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
- // Fast return for single non-whitespace
- if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t'))
- ++p;
- else
- return p;
-
- // The rest of string
- #define C16(c) { c, c, c, c, c, c, c, c, c, c, c, c, c, c, c, c }
- static const char whitespaces[4][16] = { C16(' '), C16('\n'), C16('\r'), C16('\t') };
- #undef C16
-
- const __m128i w0 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[0][0]));
- const __m128i w1 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[1][0]));
- const __m128i w2 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[2][0]));
- const __m128i w3 = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&whitespaces[3][0]));
-
- for (; p <= end - 16; p += 16) {
- const __m128i s = _mm_loadu_si128(reinterpret_cast<const __m128i *>(p));
- __m128i x = _mm_cmpeq_epi8(s, w0);
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w1));
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w2));
- x = _mm_or_si128(x, _mm_cmpeq_epi8(s, w3));
- unsigned short r = static_cast<unsigned short>(~_mm_movemask_epi8(x));
- if (r != 0) { // some of characters may be non-whitespace
-#ifdef _MSC_VER // Find the index of first non-whitespace
- unsigned long offset;
- _BitScanForward(&offset, r);
- return p + offset;
-#else
- return p + __builtin_ffs(r) - 1;
-#endif
- }
- }
-
- return SkipWhitespace(p, end);
-}
-
-#elif defined(RAPIDJSON_NEON)
-
-//! Skip whitespace with ARM Neon instructions, testing 16 8-byte characters at once.
-inline const char *SkipWhitespace_SIMD(const char* p) {
- // Fast return for single non-whitespace
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- // 16-byte align to the next boundary
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t')
- ++p;
- else
- return p;
-
- const uint8x16_t w0 = vmovq_n_u8(' ');
- const uint8x16_t w1 = vmovq_n_u8('\n');
- const uint8x16_t w2 = vmovq_n_u8('\r');
- const uint8x16_t w3 = vmovq_n_u8('\t');
-
- for (;; p += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<const uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, w0);
- x = vorrq_u8(x, vceqq_u8(s, w1));
- x = vorrq_u8(x, vceqq_u8(s, w2));
- x = vorrq_u8(x, vceqq_u8(s, w3));
-
- x = vmvnq_u8(x); // Negate
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- return p + 8 + (lz >> 3);
- }
- } else {
- uint32_t lz = internal::clzll(low);
- return p + (lz >> 3);
- }
- }
-}
-
-inline const char *SkipWhitespace_SIMD(const char* p, const char* end) {
- // Fast return for single non-whitespace
- if (p != end && (*p == ' ' || *p == '\n' || *p == '\r' || *p == '\t'))
- ++p;
- else
- return p;
-
- const uint8x16_t w0 = vmovq_n_u8(' ');
- const uint8x16_t w1 = vmovq_n_u8('\n');
- const uint8x16_t w2 = vmovq_n_u8('\r');
- const uint8x16_t w3 = vmovq_n_u8('\t');
-
- for (; p <= end - 16; p += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<const uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, w0);
- x = vorrq_u8(x, vceqq_u8(s, w1));
- x = vorrq_u8(x, vceqq_u8(s, w2));
- x = vorrq_u8(x, vceqq_u8(s, w3));
-
- x = vmvnq_u8(x); // Negate
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- return p + 8 + (lz >> 3);
- }
- } else {
- uint32_t lz = internal::clzll(low);
- return p + (lz >> 3);
- }
- }
-
- return SkipWhitespace(p, end);
-}
-
-#endif // RAPIDJSON_NEON
-
-#ifdef RAPIDJSON_SIMD
-//! Template function specialization for InsituStringStream
-template<> inline void SkipWhitespace(InsituStringStream& is) {
- is.src_ = const_cast<char*>(SkipWhitespace_SIMD(is.src_));
-}
-
-//! Template function specialization for StringStream
-template<> inline void SkipWhitespace(StringStream& is) {
- is.src_ = SkipWhitespace_SIMD(is.src_);
-}
-
-template<> inline void SkipWhitespace(EncodedInputStream<UTF8<>, MemoryStream>& is) {
- is.is_.src_ = SkipWhitespace_SIMD(is.is_.src_, is.is_.end_);
-}
-#endif // RAPIDJSON_SIMD
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericReader
-
-//! SAX-style JSON parser. Use \ref Reader for UTF8 encoding and default allocator.
-/*! GenericReader parses JSON text from a stream, and send events synchronously to an
- object implementing Handler concept.
-
- It needs to allocate a stack for storing a single decoded string during
- non-destructive parsing.
-
- For in-situ parsing, the decoded string is directly written to the source
- text string, no temporary buffer is required.
-
- A GenericReader object can be reused for parsing multiple JSON text.
-
- \tparam SourceEncoding Encoding of the input stream.
- \tparam TargetEncoding Encoding of the parse output.
- \tparam StackAllocator Allocator type for stack.
-*/
-template <typename SourceEncoding, typename TargetEncoding, typename StackAllocator = CrtAllocator>
-class GenericReader {
-public:
- typedef typename SourceEncoding::Ch Ch; //!< SourceEncoding character type
-
- //! Constructor.
- /*! \param stackAllocator Optional allocator for allocating stack memory. (Only use for non-destructive parsing)
- \param stackCapacity stack capacity in bytes for storing a single decoded string. (Only use for non-destructive parsing)
- */
- GenericReader(StackAllocator* stackAllocator = 0, size_t stackCapacity = kDefaultStackCapacity) :
- stack_(stackAllocator, stackCapacity), parseResult_(), state_(IterativeParsingStartState) {}
-
- //! Parse JSON text.
- /*! \tparam parseFlags Combination of \ref ParseFlag.
- \tparam InputStream Type of input stream, implementing Stream concept.
- \tparam Handler Type of handler, implementing Handler concept.
- \param is Input stream to be parsed.
- \param handler The handler to receive events.
- \return Whether the parsing is successful.
- */
- template <unsigned parseFlags, typename InputStream, typename Handler>
- ParseResult Parse(InputStream& is, Handler& handler) {
- if (parseFlags & kParseIterativeFlag)
- return IterativeParse<parseFlags>(is, handler);
-
- parseResult_.Clear();
-
- ClearStackOnExit scope(*this);
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
-
- if (RAPIDJSON_UNLIKELY(is.Peek() == '\0')) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentEmpty, is.Tell());
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
- }
- else {
- ParseValue<parseFlags>(is, handler);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
-
- if (!(parseFlags & kParseStopWhenDoneFlag)) {
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
-
- if (RAPIDJSON_UNLIKELY(is.Peek() != '\0')) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorDocumentRootNotSingular, is.Tell());
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
- }
- }
- }
-
- return parseResult_;
- }
-
- //! Parse JSON text (with \ref kParseDefaultFlags)
- /*! \tparam InputStream Type of input stream, implementing Stream concept
- \tparam Handler Type of handler, implementing Handler concept.
- \param is Input stream to be parsed.
- \param handler The handler to receive events.
- \return Whether the parsing is successful.
- */
- template <typename InputStream, typename Handler>
- ParseResult Parse(InputStream& is, Handler& handler) {
- return Parse<kParseDefaultFlags>(is, handler);
- }
-
- //! Initialize JSON text token-by-token parsing
- /*!
- */
- void IterativeParseInit() {
- parseResult_.Clear();
- state_ = IterativeParsingStartState;
- }
-
- //! Parse one token from JSON text
- /*! \tparam InputStream Type of input stream, implementing Stream concept
- \tparam Handler Type of handler, implementing Handler concept.
- \param is Input stream to be parsed.
- \param handler The handler to receive events.
- \return Whether the parsing is successful.
- */
- template <unsigned parseFlags, typename InputStream, typename Handler>
- bool IterativeParseNext(InputStream& is, Handler& handler) {
- while (RAPIDJSON_LIKELY(is.Peek() != '\0')) {
- SkipWhitespaceAndComments<parseFlags>(is);
-
- Token t = Tokenize(is.Peek());
- IterativeParsingState n = Predict(state_, t);
- IterativeParsingState d = Transit<parseFlags>(state_, t, n, is, handler);
-
- // If we've finished or hit an error...
- if (RAPIDJSON_UNLIKELY(IsIterativeParsingCompleteState(d))) {
- // Report errors.
- if (d == IterativeParsingErrorState) {
- HandleError(state_, is);
- return false;
- }
-
- // Transition to the finish state.
- RAPIDJSON_ASSERT(d == IterativeParsingFinishState);
- state_ = d;
-
- // If StopWhenDone is not set...
- if (!(parseFlags & kParseStopWhenDoneFlag)) {
- // ... and extra non-whitespace data is found...
- SkipWhitespaceAndComments<parseFlags>(is);
- if (is.Peek() != '\0') {
- // ... this is considered an error.
- HandleError(state_, is);
- return false;
- }
- }
-
- // Success! We are done!
- return true;
- }
-
- // Transition to the new state.
- state_ = d;
-
- // If we parsed anything other than a delimiter, we invoked the handler, so we can return true now.
- if (!IsIterativeParsingDelimiterState(n))
- return true;
- }
-
- // We reached the end of file.
- stack_.Clear();
-
- if (state_ != IterativeParsingFinishState) {
- HandleError(state_, is);
- return false;
- }
-
- return true;
- }
-
- //! Check if token-by-token parsing JSON text is complete
- /*! \return Whether the JSON has been fully decoded.
- */
- RAPIDJSON_FORCEINLINE bool IterativeParseComplete() const {
- return IsIterativeParsingCompleteState(state_);
- }
-
- //! Whether a parse error has occurred in the last parsing.
- bool HasParseError() const { return parseResult_.IsError(); }
-
- //! Get the \ref ParseErrorCode of last parsing.
- ParseErrorCode GetParseErrorCode() const { return parseResult_.Code(); }
-
- //! Get the position of last parsing error in input, 0 otherwise.
- size_t GetErrorOffset() const { return parseResult_.Offset(); }
-
-protected:
- void SetParseError(ParseErrorCode code, size_t offset) { parseResult_.Set(code, offset); }
-
-private:
- // Prohibit copy constructor & assignment operator.
- GenericReader(const GenericReader&);
- GenericReader& operator=(const GenericReader&);
-
- void ClearStack() { stack_.Clear(); }
-
- // clear stack on any exit from ParseStream, e.g. due to exception
- struct ClearStackOnExit {
- explicit ClearStackOnExit(GenericReader& r) : r_(r) {}
- ~ClearStackOnExit() { r_.ClearStack(); }
- private:
- GenericReader& r_;
- ClearStackOnExit(const ClearStackOnExit&);
- ClearStackOnExit& operator=(const ClearStackOnExit&);
- };
-
- template<unsigned parseFlags, typename InputStream>
- void SkipWhitespaceAndComments(InputStream& is) {
- SkipWhitespace(is);
-
- if (parseFlags & kParseCommentsFlag) {
- while (RAPIDJSON_UNLIKELY(Consume(is, '/'))) {
- if (Consume(is, '*')) {
- while (true) {
- if (RAPIDJSON_UNLIKELY(is.Peek() == '\0'))
- RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());
- else if (Consume(is, '*')) {
- if (Consume(is, '/'))
- break;
- }
- else
- is.Take();
- }
- }
- else if (RAPIDJSON_LIKELY(Consume(is, '/')))
- while (is.Peek() != '\0' && is.Take() != '\n') {}
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorUnspecificSyntaxError, is.Tell());
-
- SkipWhitespace(is);
- }
- }
- }
-
- // Parse object: { string : value, ... }
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseObject(InputStream& is, Handler& handler) {
- RAPIDJSON_ASSERT(is.Peek() == '{');
- is.Take(); // Skip '{'
-
- if (RAPIDJSON_UNLIKELY(!handler.StartObject()))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- if (Consume(is, '}')) {
- if (RAPIDJSON_UNLIKELY(!handler.EndObject(0))) // empty object
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- return;
- }
-
- for (SizeType memberCount = 0;;) {
- if (RAPIDJSON_UNLIKELY(is.Peek() != '"'))
- RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell());
-
- ParseString<parseFlags>(is, handler, true);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- if (RAPIDJSON_UNLIKELY(!Consume(is, ':')))
- RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell());
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- ParseValue<parseFlags>(is, handler);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- ++memberCount;
-
- switch (is.Peek()) {
- case ',':
- is.Take();
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- break;
- case '}':
- is.Take();
- if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- return;
- default:
- RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); break; // This useless break is only for making warning and coverage happy
- }
-
- if (parseFlags & kParseTrailingCommasFlag) {
- if (is.Peek() == '}') {
- if (RAPIDJSON_UNLIKELY(!handler.EndObject(memberCount)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- is.Take();
- return;
- }
- }
- }
- }
-
- // Parse array: [ value, ... ]
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseArray(InputStream& is, Handler& handler) {
- RAPIDJSON_ASSERT(is.Peek() == '[');
- is.Take(); // Skip '['
-
- if (RAPIDJSON_UNLIKELY(!handler.StartArray()))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- if (Consume(is, ']')) {
- if (RAPIDJSON_UNLIKELY(!handler.EndArray(0))) // empty array
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- return;
- }
-
- for (SizeType elementCount = 0;;) {
- ParseValue<parseFlags>(is, handler);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- ++elementCount;
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
-
- if (Consume(is, ',')) {
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- }
- else if (Consume(is, ']')) {
- if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- return;
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell());
-
- if (parseFlags & kParseTrailingCommasFlag) {
- if (is.Peek() == ']') {
- if (RAPIDJSON_UNLIKELY(!handler.EndArray(elementCount)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- is.Take();
- return;
- }
- }
- }
- }
-
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseNull(InputStream& is, Handler& handler) {
- RAPIDJSON_ASSERT(is.Peek() == 'n');
- is.Take();
-
- if (RAPIDJSON_LIKELY(Consume(is, 'u') && Consume(is, 'l') && Consume(is, 'l'))) {
- if (RAPIDJSON_UNLIKELY(!handler.Null()))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
- }
-
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseTrue(InputStream& is, Handler& handler) {
- RAPIDJSON_ASSERT(is.Peek() == 't');
- is.Take();
-
- if (RAPIDJSON_LIKELY(Consume(is, 'r') && Consume(is, 'u') && Consume(is, 'e'))) {
- if (RAPIDJSON_UNLIKELY(!handler.Bool(true)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
- }
-
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseFalse(InputStream& is, Handler& handler) {
- RAPIDJSON_ASSERT(is.Peek() == 'f');
- is.Take();
-
- if (RAPIDJSON_LIKELY(Consume(is, 'a') && Consume(is, 'l') && Consume(is, 's') && Consume(is, 'e'))) {
- if (RAPIDJSON_UNLIKELY(!handler.Bool(false)))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, is.Tell());
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell());
- }
-
- template<typename InputStream>
- RAPIDJSON_FORCEINLINE static bool Consume(InputStream& is, typename InputStream::Ch expect) {
- if (RAPIDJSON_LIKELY(is.Peek() == expect)) {
- is.Take();
- return true;
- }
- else
- return false;
- }
-
- // Helper function to parse four hexadecimal digits in \uXXXX in ParseString().
- template<typename InputStream>
- unsigned ParseHex4(InputStream& is, size_t escapeOffset) {
- unsigned codepoint = 0;
- for (int i = 0; i < 4; i++) {
- Ch c = is.Peek();
- codepoint <<= 4;
- codepoint += static_cast<unsigned>(c);
- if (c >= '0' && c <= '9')
- codepoint -= '0';
- else if (c >= 'A' && c <= 'F')
- codepoint -= 'A' - 10;
- else if (c >= 'a' && c <= 'f')
- codepoint -= 'a' - 10;
- else {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorStringUnicodeEscapeInvalidHex, escapeOffset);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(0);
- }
- is.Take();
- }
- return codepoint;
- }
-
- template <typename CharType>
- class StackStream {
- public:
- typedef CharType Ch;
-
- StackStream(internal::Stack<StackAllocator>& stack) : stack_(stack), length_(0) {}
- RAPIDJSON_FORCEINLINE void Put(Ch c) {
- *stack_.template Push<Ch>() = c;
- ++length_;
- }
-
- RAPIDJSON_FORCEINLINE void* Push(SizeType count) {
- length_ += count;
- return stack_.template Push<Ch>(count);
- }
-
- size_t Length() const { return length_; }
-
- Ch* Pop() {
- return stack_.template Pop<Ch>(length_);
- }
-
- private:
- StackStream(const StackStream&);
- StackStream& operator=(const StackStream&);
-
- internal::Stack<StackAllocator>& stack_;
- SizeType length_;
- };
-
- // Parse string and generate String event. Different code paths for kParseInsituFlag.
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseString(InputStream& is, Handler& handler, bool isKey = false) {
- internal::StreamLocalCopy<InputStream> copy(is);
- InputStream& s(copy.s);
-
- RAPIDJSON_ASSERT(s.Peek() == '\"');
- s.Take(); // Skip '\"'
-
- bool success = false;
- if (parseFlags & kParseInsituFlag) {
- typename InputStream::Ch *head = s.PutBegin();
- ParseStringToStream<parseFlags, SourceEncoding, SourceEncoding>(s, s);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- size_t length = s.PutEnd(head) - 1;
- RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);
- const typename TargetEncoding::Ch* const str = reinterpret_cast<typename TargetEncoding::Ch*>(head);
- success = (isKey ? handler.Key(str, SizeType(length), false) : handler.String(str, SizeType(length), false));
- }
- else {
- StackStream<typename TargetEncoding::Ch> stackStream(stack_);
- ParseStringToStream<parseFlags, SourceEncoding, TargetEncoding>(s, stackStream);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- SizeType length = static_cast<SizeType>(stackStream.Length()) - 1;
- const typename TargetEncoding::Ch* const str = stackStream.Pop();
- success = (isKey ? handler.Key(str, length, true) : handler.String(str, length, true));
- }
- if (RAPIDJSON_UNLIKELY(!success))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, s.Tell());
- }
-
- // Parse string to an output is
- // This function handles the prefix/suffix double quotes, escaping, and optional encoding validation.
- template<unsigned parseFlags, typename SEncoding, typename TEncoding, typename InputStream, typename OutputStream>
- RAPIDJSON_FORCEINLINE void ParseStringToStream(InputStream& is, OutputStream& os) {
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- static const char escape[256] = {
- Z16, Z16, 0, 0,'\"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '/',
- Z16, Z16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0,
- 0, 0,'\b', 0, 0, 0,'\f', 0, 0, 0, 0, 0, 0, 0,'\n', 0,
- 0, 0,'\r', 0,'\t', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16
- };
-#undef Z16
-//!@endcond
-
- for (;;) {
- // Scan and copy string before "\\\"" or < 0x20. This is an optional optimzation.
- if (!(parseFlags & kParseValidateEncodingFlag))
- ScanCopyUnescapedString(is, os);
-
- Ch c = is.Peek();
- if (RAPIDJSON_UNLIKELY(c == '\\')) { // Escape
- size_t escapeOffset = is.Tell(); // For invalid escaping, report the initial '\\' as error offset
- is.Take();
- Ch e = is.Peek();
- if ((sizeof(Ch) == 1 || unsigned(e) < 256) && RAPIDJSON_LIKELY(escape[static_cast<unsigned char>(e)])) {
- is.Take();
- os.Put(static_cast<typename TEncoding::Ch>(escape[static_cast<unsigned char>(e)]));
- }
- else if ((parseFlags & kParseEscapedApostropheFlag) && RAPIDJSON_LIKELY(e == '\'')) { // Allow escaped apostrophe
- is.Take();
- os.Put('\'');
- }
- else if (RAPIDJSON_LIKELY(e == 'u')) { // Unicode
- is.Take();
- unsigned codepoint = ParseHex4(is, escapeOffset);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- if (RAPIDJSON_UNLIKELY(codepoint >= 0xD800 && codepoint <= 0xDFFF)) {
- // high surrogate, check if followed by valid low surrogate
- if (RAPIDJSON_LIKELY(codepoint <= 0xDBFF)) {
- // Handle UTF-16 surrogate pair
- if (RAPIDJSON_UNLIKELY(!Consume(is, '\\') || !Consume(is, 'u')))
- RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
- unsigned codepoint2 = ParseHex4(is, escapeOffset);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN_VOID;
- if (RAPIDJSON_UNLIKELY(codepoint2 < 0xDC00 || codepoint2 > 0xDFFF))
- RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
- codepoint = (((codepoint - 0xD800) << 10) | (codepoint2 - 0xDC00)) + 0x10000;
- }
- // single low surrogate
- else
- {
- RAPIDJSON_PARSE_ERROR(kParseErrorStringUnicodeSurrogateInvalid, escapeOffset);
- }
- }
- TEncoding::Encode(os, codepoint);
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorStringEscapeInvalid, escapeOffset);
- }
- else if (RAPIDJSON_UNLIKELY(c == '"')) { // Closing double quote
- is.Take();
- os.Put('\0'); // null-terminate the string
- return;
- }
- else if (RAPIDJSON_UNLIKELY(static_cast<unsigned>(c) < 0x20)) { // RFC 4627: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF
- if (c == '\0')
- RAPIDJSON_PARSE_ERROR(kParseErrorStringMissQuotationMark, is.Tell());
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, is.Tell());
- }
- else {
- size_t offset = is.Tell();
- if (RAPIDJSON_UNLIKELY((parseFlags & kParseValidateEncodingFlag ?
- !Transcoder<SEncoding, TEncoding>::Validate(is, os) :
- !Transcoder<SEncoding, TEncoding>::Transcode(is, os))))
- RAPIDJSON_PARSE_ERROR(kParseErrorStringInvalidEncoding, offset);
- }
- }
- }
-
- template<typename InputStream, typename OutputStream>
- static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InputStream&, OutputStream&) {
- // Do nothing for generic version
- }
-
-#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
- // StringStream -> StackStream<char>
- static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream<char>& os) {
- const char* p = is.src_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = p;
- return;
- }
- else
- os.Put(*p++);
-
- // The rest of string using SIMD
- static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
- static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
- static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F };
- const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
- const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
- const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
-
- for (;; p += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- const __m128i t1 = _mm_cmpeq_epi8(s, dq);
- const __m128i t2 = _mm_cmpeq_epi8(s, bs);
- const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F
- const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
- unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
- if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
- SizeType length;
- #ifdef _MSC_VER // Find the index of first escaped
- unsigned long offset;
- _BitScanForward(&offset, r);
- length = offset;
- #else
- length = static_cast<SizeType>(__builtin_ffs(r) - 1);
- #endif
- if (length != 0) {
- char* q = reinterpret_cast<char*>(os.Push(length));
- for (size_t i = 0; i < length; i++)
- q[i] = p[i];
-
- p += length;
- }
- break;
- }
- _mm_storeu_si128(reinterpret_cast<__m128i *>(os.Push(16)), s);
- }
-
- is.src_ = p;
- }
-
- // InsituStringStream -> InsituStringStream
- static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) {
- RAPIDJSON_ASSERT(&is == &os);
- (void)os;
-
- if (is.src_ == is.dst_) {
- SkipUnescapedString(is);
- return;
- }
-
- char* p = is.src_;
- char *q = is.dst_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = p;
- is.dst_ = q;
- return;
- }
- else
- *q++ = *p++;
-
- // The rest of string using SIMD
- static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
- static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
- static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F };
- const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
- const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
- const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
-
- for (;; p += 16, q += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- const __m128i t1 = _mm_cmpeq_epi8(s, dq);
- const __m128i t2 = _mm_cmpeq_epi8(s, bs);
- const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F
- const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
- unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
- if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
- size_t length;
-#ifdef _MSC_VER // Find the index of first escaped
- unsigned long offset;
- _BitScanForward(&offset, r);
- length = offset;
-#else
- length = static_cast<size_t>(__builtin_ffs(r) - 1);
-#endif
- for (const char* pend = p + length; p != pend; )
- *q++ = *p++;
- break;
- }
- _mm_storeu_si128(reinterpret_cast<__m128i *>(q), s);
- }
-
- is.src_ = p;
- is.dst_ = q;
- }
-
- // When read/write pointers are the same for insitu stream, just skip unescaped characters
- static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) {
- RAPIDJSON_ASSERT(is.src_ == is.dst_);
- char* p = is.src_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- for (; p != nextAligned; p++)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = is.dst_ = p;
- return;
- }
-
- // The rest of string using SIMD
- static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
- static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
- static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F };
- const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
- const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
- const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
-
- for (;; p += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- const __m128i t1 = _mm_cmpeq_epi8(s, dq);
- const __m128i t2 = _mm_cmpeq_epi8(s, bs);
- const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F
- const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
- unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
- if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
- size_t length;
-#ifdef _MSC_VER // Find the index of first escaped
- unsigned long offset;
- _BitScanForward(&offset, r);
- length = offset;
-#else
- length = static_cast<size_t>(__builtin_ffs(r) - 1);
-#endif
- p += length;
- break;
- }
- }
-
- is.src_ = is.dst_ = p;
- }
-#elif defined(RAPIDJSON_NEON)
- // StringStream -> StackStream<char>
- static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(StringStream& is, StackStream<char>& os) {
- const char* p = is.src_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = p;
- return;
- }
- else
- os.Put(*p++);
-
- // The rest of string using SIMD
- const uint8x16_t s0 = vmovq_n_u8('"');
- const uint8x16_t s1 = vmovq_n_u8('\\');
- const uint8x16_t s2 = vmovq_n_u8('\b');
- const uint8x16_t s3 = vmovq_n_u8(32);
-
- for (;; p += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<const uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, s0);
- x = vorrq_u8(x, vceqq_u8(s, s1));
- x = vorrq_u8(x, vceqq_u8(s, s2));
- x = vorrq_u8(x, vcltq_u8(s, s3));
-
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- SizeType length = 0;
- bool escaped = false;
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- length = 8 + (lz >> 3);
- escaped = true;
- }
- } else {
- uint32_t lz = internal::clzll(low);
- length = lz >> 3;
- escaped = true;
- }
- if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped
- if (length != 0) {
- char* q = reinterpret_cast<char*>(os.Push(length));
- for (size_t i = 0; i < length; i++)
- q[i] = p[i];
-
- p += length;
- }
- break;
- }
- vst1q_u8(reinterpret_cast<uint8_t *>(os.Push(16)), s);
- }
-
- is.src_ = p;
- }
-
- // InsituStringStream -> InsituStringStream
- static RAPIDJSON_FORCEINLINE void ScanCopyUnescapedString(InsituStringStream& is, InsituStringStream& os) {
- RAPIDJSON_ASSERT(&is == &os);
- (void)os;
-
- if (is.src_ == is.dst_) {
- SkipUnescapedString(is);
- return;
- }
-
- char* p = is.src_;
- char *q = is.dst_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- while (p != nextAligned)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = p;
- is.dst_ = q;
- return;
- }
- else
- *q++ = *p++;
-
- // The rest of string using SIMD
- const uint8x16_t s0 = vmovq_n_u8('"');
- const uint8x16_t s1 = vmovq_n_u8('\\');
- const uint8x16_t s2 = vmovq_n_u8('\b');
- const uint8x16_t s3 = vmovq_n_u8(32);
-
- for (;; p += 16, q += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, s0);
- x = vorrq_u8(x, vceqq_u8(s, s1));
- x = vorrq_u8(x, vceqq_u8(s, s2));
- x = vorrq_u8(x, vcltq_u8(s, s3));
-
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- SizeType length = 0;
- bool escaped = false;
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- length = 8 + (lz >> 3);
- escaped = true;
- }
- } else {
- uint32_t lz = internal::clzll(low);
- length = lz >> 3;
- escaped = true;
- }
- if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped
- for (const char* pend = p + length; p != pend; ) {
- *q++ = *p++;
- }
- break;
- }
- vst1q_u8(reinterpret_cast<uint8_t *>(q), s);
- }
-
- is.src_ = p;
- is.dst_ = q;
- }
-
- // When read/write pointers are the same for insitu stream, just skip unescaped characters
- static RAPIDJSON_FORCEINLINE void SkipUnescapedString(InsituStringStream& is) {
- RAPIDJSON_ASSERT(is.src_ == is.dst_);
- char* p = is.src_;
-
- // Scan one by one until alignment (unaligned load may cross page boundary and cause crash)
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- for (; p != nextAligned; p++)
- if (RAPIDJSON_UNLIKELY(*p == '\"') || RAPIDJSON_UNLIKELY(*p == '\\') || RAPIDJSON_UNLIKELY(static_cast<unsigned>(*p) < 0x20)) {
- is.src_ = is.dst_ = p;
- return;
- }
-
- // The rest of string using SIMD
- const uint8x16_t s0 = vmovq_n_u8('"');
- const uint8x16_t s1 = vmovq_n_u8('\\');
- const uint8x16_t s2 = vmovq_n_u8('\b');
- const uint8x16_t s3 = vmovq_n_u8(32);
-
- for (;; p += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, s0);
- x = vorrq_u8(x, vceqq_u8(s, s1));
- x = vorrq_u8(x, vceqq_u8(s, s2));
- x = vorrq_u8(x, vcltq_u8(s, s3));
-
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- p += 8 + (lz >> 3);
- break;
- }
- } else {
- uint32_t lz = internal::clzll(low);
- p += lz >> 3;
- break;
- }
- }
-
- is.src_ = is.dst_ = p;
- }
-#endif // RAPIDJSON_NEON
-
- template<typename InputStream, typename StackCharacter, bool backup, bool pushOnTake>
- class NumberStream;
-
- template<typename InputStream, typename StackCharacter>
- class NumberStream<InputStream, StackCharacter, false, false> {
- public:
- typedef typename InputStream::Ch Ch;
-
- NumberStream(GenericReader& reader, InputStream& s) : is(s) { (void)reader; }
-
- RAPIDJSON_FORCEINLINE Ch Peek() const { return is.Peek(); }
- RAPIDJSON_FORCEINLINE Ch TakePush() { return is.Take(); }
- RAPIDJSON_FORCEINLINE Ch Take() { return is.Take(); }
- RAPIDJSON_FORCEINLINE void Push(char) {}
-
- size_t Tell() { return is.Tell(); }
- size_t Length() { return 0; }
- const StackCharacter* Pop() { return 0; }
-
- protected:
- NumberStream& operator=(const NumberStream&);
-
- InputStream& is;
- };
-
- template<typename InputStream, typename StackCharacter>
- class NumberStream<InputStream, StackCharacter, true, false> : public NumberStream<InputStream, StackCharacter, false, false> {
- typedef NumberStream<InputStream, StackCharacter, false, false> Base;
- public:
- NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s), stackStream(reader.stack_) {}
-
- RAPIDJSON_FORCEINLINE Ch TakePush() {
- stackStream.Put(static_cast<StackCharacter>(Base::is.Peek()));
- return Base::is.Take();
- }
-
- RAPIDJSON_FORCEINLINE void Push(StackCharacter c) {
- stackStream.Put(c);
- }
-
- size_t Length() { return stackStream.Length(); }
-
- const StackCharacter* Pop() {
- stackStream.Put('\0');
- return stackStream.Pop();
- }
-
- private:
- StackStream<StackCharacter> stackStream;
- };
-
- template<typename InputStream, typename StackCharacter>
- class NumberStream<InputStream, StackCharacter, true, true> : public NumberStream<InputStream, StackCharacter, true, false> {
- typedef NumberStream<InputStream, StackCharacter, true, false> Base;
- public:
- NumberStream(GenericReader& reader, InputStream& s) : Base(reader, s) {}
-
- RAPIDJSON_FORCEINLINE Ch Take() { return Base::TakePush(); }
- };
-
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseNumber(InputStream& is, Handler& handler) {
- typedef typename internal::SelectIf<internal::BoolType<(parseFlags & kParseNumbersAsStringsFlag) != 0>, typename TargetEncoding::Ch, char>::Type NumberCharacter;
-
- internal::StreamLocalCopy<InputStream> copy(is);
- NumberStream<InputStream, NumberCharacter,
- ((parseFlags & kParseNumbersAsStringsFlag) != 0) ?
- ((parseFlags & kParseInsituFlag) == 0) :
- ((parseFlags & kParseFullPrecisionFlag) != 0),
- (parseFlags & kParseNumbersAsStringsFlag) != 0 &&
- (parseFlags & kParseInsituFlag) == 0> s(*this, copy.s);
-
- size_t startOffset = s.Tell();
- double d = 0.0;
- bool useNanOrInf = false;
-
- // Parse minus
- bool minus = Consume(s, '-');
-
- // Parse int: zero / ( digit1-9 *DIGIT )
- unsigned i = 0;
- uint64_t i64 = 0;
- bool use64bit = false;
- int significandDigit = 0;
- if (RAPIDJSON_UNLIKELY(s.Peek() == '0')) {
- i = 0;
- s.TakePush();
- }
- else if (RAPIDJSON_LIKELY(s.Peek() >= '1' && s.Peek() <= '9')) {
- i = static_cast<unsigned>(s.TakePush() - '0');
-
- if (minus)
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (RAPIDJSON_UNLIKELY(i >= 214748364)) { // 2^31 = 2147483648
- if (RAPIDJSON_LIKELY(i != 214748364 || s.Peek() > '8')) {
- i64 = i;
- use64bit = true;
- break;
- }
- }
- i = i * 10 + static_cast<unsigned>(s.TakePush() - '0');
- significandDigit++;
- }
- else
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (RAPIDJSON_UNLIKELY(i >= 429496729)) { // 2^32 - 1 = 4294967295
- if (RAPIDJSON_LIKELY(i != 429496729 || s.Peek() > '5')) {
- i64 = i;
- use64bit = true;
- break;
- }
- }
- i = i * 10 + static_cast<unsigned>(s.TakePush() - '0');
- significandDigit++;
- }
- }
- // Parse NaN or Infinity here
- else if ((parseFlags & kParseNanAndInfFlag) && RAPIDJSON_LIKELY((s.Peek() == 'I' || s.Peek() == 'N'))) {
- if (Consume(s, 'N')) {
- if (Consume(s, 'a') && Consume(s, 'N')) {
- d = std::numeric_limits<double>::quiet_NaN();
- useNanOrInf = true;
- }
- }
- else if (RAPIDJSON_LIKELY(Consume(s, 'I'))) {
- if (Consume(s, 'n') && Consume(s, 'f')) {
- d = (minus ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity());
- useNanOrInf = true;
-
- if (RAPIDJSON_UNLIKELY(s.Peek() == 'i' && !(Consume(s, 'i') && Consume(s, 'n')
- && Consume(s, 'i') && Consume(s, 't') && Consume(s, 'y')))) {
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());
- }
- }
- }
-
- if (RAPIDJSON_UNLIKELY(!useNanOrInf)) {
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());
- }
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, s.Tell());
-
- // Parse 64bit int
- bool useDouble = false;
- if (use64bit) {
- if (minus)
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC))) // 2^63 = 9223372036854775808
- if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x0CCCCCCC, 0xCCCCCCCC) || s.Peek() > '8')) {
- d = static_cast<double>(i64);
- useDouble = true;
- break;
- }
- i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
- significandDigit++;
- }
- else
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (RAPIDJSON_UNLIKELY(i64 >= RAPIDJSON_UINT64_C2(0x19999999, 0x99999999))) // 2^64 - 1 = 18446744073709551615
- if (RAPIDJSON_LIKELY(i64 != RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || s.Peek() > '5')) {
- d = static_cast<double>(i64);
- useDouble = true;
- break;
- }
- i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
- significandDigit++;
- }
- }
-
- // Force double for big integer
- if (useDouble) {
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- d = d * 10 + (s.TakePush() - '0');
- }
- }
-
- // Parse frac = decimal-point 1*DIGIT
- int expFrac = 0;
- size_t decimalPosition;
- if (Consume(s, '.')) {
- decimalPosition = s.Length();
-
- if (RAPIDJSON_UNLIKELY(!(s.Peek() >= '0' && s.Peek() <= '9')))
- RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissFraction, s.Tell());
-
- if (!useDouble) {
-#if RAPIDJSON_64BIT
- // Use i64 to store significand in 64-bit architecture
- if (!use64bit)
- i64 = i;
-
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (i64 > RAPIDJSON_UINT64_C2(0x1FFFFF, 0xFFFFFFFF)) // 2^53 - 1 for fast path
- break;
- else {
- i64 = i64 * 10 + static_cast<unsigned>(s.TakePush() - '0');
- --expFrac;
- if (i64 != 0)
- significandDigit++;
- }
- }
-
- d = static_cast<double>(i64);
-#else
- // Use double to store significand in 32-bit architecture
- d = static_cast<double>(use64bit ? i64 : i);
-#endif
- useDouble = true;
- }
-
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- if (significandDigit < 17) {
- d = d * 10.0 + (s.TakePush() - '0');
- --expFrac;
- if (RAPIDJSON_LIKELY(d > 0.0))
- significandDigit++;
- }
- else
- s.TakePush();
- }
- }
- else
- decimalPosition = s.Length(); // decimal position at the end of integer.
-
- // Parse exp = e [ minus / plus ] 1*DIGIT
- int exp = 0;
- if (Consume(s, 'e') || Consume(s, 'E')) {
- if (!useDouble) {
- d = static_cast<double>(use64bit ? i64 : i);
- useDouble = true;
- }
-
- bool expMinus = false;
- if (Consume(s, '+'))
- ;
- else if (Consume(s, '-'))
- expMinus = true;
-
- if (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- exp = static_cast<int>(s.Take() - '0');
- if (expMinus) {
- // (exp + expFrac) must not underflow int => we're detecting when -exp gets
- // dangerously close to INT_MIN (a pessimistic next digit 9 would push it into
- // underflow territory):
- //
- // -(exp * 10 + 9) + expFrac >= INT_MIN
- // <=> exp <= (expFrac - INT_MIN - 9) / 10
- RAPIDJSON_ASSERT(expFrac <= 0);
- int maxExp = (expFrac + 2147483639) / 10;
-
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- exp = exp * 10 + static_cast<int>(s.Take() - '0');
- if (RAPIDJSON_UNLIKELY(exp > maxExp)) {
- while (RAPIDJSON_UNLIKELY(s.Peek() >= '0' && s.Peek() <= '9')) // Consume the rest of exponent
- s.Take();
- }
- }
- }
- else { // positive exp
- int maxExp = 308 - expFrac;
- while (RAPIDJSON_LIKELY(s.Peek() >= '0' && s.Peek() <= '9')) {
- exp = exp * 10 + static_cast<int>(s.Take() - '0');
- if (RAPIDJSON_UNLIKELY(exp > maxExp))
- RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);
- }
- }
- }
- else
- RAPIDJSON_PARSE_ERROR(kParseErrorNumberMissExponent, s.Tell());
-
- if (expMinus)
- exp = -exp;
- }
-
- // Finish parsing, call event according to the type of number.
- bool cont = true;
-
- if (parseFlags & kParseNumbersAsStringsFlag) {
- if (parseFlags & kParseInsituFlag) {
- s.Pop(); // Pop stack no matter if it will be used or not.
- typename InputStream::Ch* head = is.PutBegin();
- const size_t length = s.Tell() - startOffset;
- RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);
- // unable to insert the \0 character here, it will erase the comma after this number
- const typename TargetEncoding::Ch* const str = reinterpret_cast<typename TargetEncoding::Ch*>(head);
- cont = handler.RawNumber(str, SizeType(length), false);
- }
- else {
- SizeType numCharsToCopy = static_cast<SizeType>(s.Length());
- GenericStringStream<UTF8<NumberCharacter> > srcStream(s.Pop());
- StackStream<typename TargetEncoding::Ch> dstStream(stack_);
- while (numCharsToCopy--) {
- Transcoder<UTF8<typename TargetEncoding::Ch>, TargetEncoding>::Transcode(srcStream, dstStream);
- }
- dstStream.Put('\0');
- const typename TargetEncoding::Ch* str = dstStream.Pop();
- const SizeType length = static_cast<SizeType>(dstStream.Length()) - 1;
- cont = handler.RawNumber(str, SizeType(length), true);
- }
- }
- else {
- size_t length = s.Length();
- const NumberCharacter* decimal = s.Pop(); // Pop stack no matter if it will be used or not.
-
- if (useDouble) {
- int p = exp + expFrac;
- if (parseFlags & kParseFullPrecisionFlag)
- d = internal::StrtodFullPrecision(d, p, decimal, length, decimalPosition, exp);
- else
- d = internal::StrtodNormalPrecision(d, p);
-
- // Use > max, instead of == inf, to fix bogus warning -Wfloat-equal
- if (d > (std::numeric_limits<double>::max)()) {
- // Overflow
- // TODO: internal::StrtodX should report overflow (or underflow)
- RAPIDJSON_PARSE_ERROR(kParseErrorNumberTooBig, startOffset);
- }
-
- cont = handler.Double(minus ? -d : d);
- }
- else if (useNanOrInf) {
- cont = handler.Double(d);
- }
- else {
- if (use64bit) {
- if (minus)
- cont = handler.Int64(static_cast<int64_t>(~i64 + 1));
- else
- cont = handler.Uint64(i64);
- }
- else {
- if (minus)
- cont = handler.Int(static_cast<int32_t>(~i + 1));
- else
- cont = handler.Uint(i);
- }
- }
- }
- if (RAPIDJSON_UNLIKELY(!cont))
- RAPIDJSON_PARSE_ERROR(kParseErrorTermination, startOffset);
- }
-
- // Parse any JSON value
- template<unsigned parseFlags, typename InputStream, typename Handler>
- void ParseValue(InputStream& is, Handler& handler) {
- switch (is.Peek()) {
- case 'n': ParseNull <parseFlags>(is, handler); break;
- case 't': ParseTrue <parseFlags>(is, handler); break;
- case 'f': ParseFalse <parseFlags>(is, handler); break;
- case '"': ParseString<parseFlags>(is, handler); break;
- case '{': ParseObject<parseFlags>(is, handler); break;
- case '[': ParseArray <parseFlags>(is, handler); break;
- default :
- ParseNumber<parseFlags>(is, handler);
- break;
-
- }
- }
-
- // Iterative Parsing
-
- // States
- enum IterativeParsingState {
- IterativeParsingFinishState = 0, // sink states at top
- IterativeParsingErrorState, // sink states at top
- IterativeParsingStartState,
-
- // Object states
- IterativeParsingObjectInitialState,
- IterativeParsingMemberKeyState,
- IterativeParsingMemberValueState,
- IterativeParsingObjectFinishState,
-
- // Array states
- IterativeParsingArrayInitialState,
- IterativeParsingElementState,
- IterativeParsingArrayFinishState,
-
- // Single value state
- IterativeParsingValueState,
-
- // Delimiter states (at bottom)
- IterativeParsingElementDelimiterState,
- IterativeParsingMemberDelimiterState,
- IterativeParsingKeyValueDelimiterState,
-
- cIterativeParsingStateCount
- };
-
- // Tokens
- enum Token {
- LeftBracketToken = 0,
- RightBracketToken,
-
- LeftCurlyBracketToken,
- RightCurlyBracketToken,
-
- CommaToken,
- ColonToken,
-
- StringToken,
- FalseToken,
- TrueToken,
- NullToken,
- NumberToken,
-
- kTokenCount
- };
-
- RAPIDJSON_FORCEINLINE Token Tokenize(Ch c) const {
-
-//!@cond RAPIDJSON_HIDDEN_FROM_DOXYGEN
-#define N NumberToken
-#define N16 N,N,N,N,N,N,N,N,N,N,N,N,N,N,N,N
- // Maps from ASCII to Token
- static const unsigned char tokenMap[256] = {
- N16, // 00~0F
- N16, // 10~1F
- N, N, StringToken, N, N, N, N, N, N, N, N, N, CommaToken, N, N, N, // 20~2F
- N, N, N, N, N, N, N, N, N, N, ColonToken, N, N, N, N, N, // 30~3F
- N16, // 40~4F
- N, N, N, N, N, N, N, N, N, N, N, LeftBracketToken, N, RightBracketToken, N, N, // 50~5F
- N, N, N, N, N, N, FalseToken, N, N, N, N, N, N, N, NullToken, N, // 60~6F
- N, N, N, N, TrueToken, N, N, N, N, N, N, LeftCurlyBracketToken, N, RightCurlyBracketToken, N, N, // 70~7F
- N16, N16, N16, N16, N16, N16, N16, N16 // 80~FF
- };
-#undef N
-#undef N16
-//!@endcond
-
- if (sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256)
- return static_cast<Token>(tokenMap[static_cast<unsigned char>(c)]);
- else
- return NumberToken;
- }
-
- RAPIDJSON_FORCEINLINE IterativeParsingState Predict(IterativeParsingState state, Token token) const {
- // current state x one lookahead token -> new state
- static const char G[cIterativeParsingStateCount][kTokenCount] = {
- // Finish(sink state)
- {
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState
- },
- // Error(sink state)
- {
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState
- },
- // Start
- {
- IterativeParsingArrayInitialState, // Left bracket
- IterativeParsingErrorState, // Right bracket
- IterativeParsingObjectInitialState, // Left curly bracket
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingValueState, // String
- IterativeParsingValueState, // False
- IterativeParsingValueState, // True
- IterativeParsingValueState, // Null
- IterativeParsingValueState // Number
- },
- // ObjectInitial
- {
- IterativeParsingErrorState, // Left bracket
- IterativeParsingErrorState, // Right bracket
- IterativeParsingErrorState, // Left curly bracket
- IterativeParsingObjectFinishState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingMemberKeyState, // String
- IterativeParsingErrorState, // False
- IterativeParsingErrorState, // True
- IterativeParsingErrorState, // Null
- IterativeParsingErrorState // Number
- },
- // MemberKey
- {
- IterativeParsingErrorState, // Left bracket
- IterativeParsingErrorState, // Right bracket
- IterativeParsingErrorState, // Left curly bracket
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingKeyValueDelimiterState, // Colon
- IterativeParsingErrorState, // String
- IterativeParsingErrorState, // False
- IterativeParsingErrorState, // True
- IterativeParsingErrorState, // Null
- IterativeParsingErrorState // Number
- },
- // MemberValue
- {
- IterativeParsingErrorState, // Left bracket
- IterativeParsingErrorState, // Right bracket
- IterativeParsingErrorState, // Left curly bracket
- IterativeParsingObjectFinishState, // Right curly bracket
- IterativeParsingMemberDelimiterState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingErrorState, // String
- IterativeParsingErrorState, // False
- IterativeParsingErrorState, // True
- IterativeParsingErrorState, // Null
- IterativeParsingErrorState // Number
- },
- // ObjectFinish(sink state)
- {
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState
- },
- // ArrayInitial
- {
- IterativeParsingArrayInitialState, // Left bracket(push Element state)
- IterativeParsingArrayFinishState, // Right bracket
- IterativeParsingObjectInitialState, // Left curly bracket(push Element state)
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingElementState, // String
- IterativeParsingElementState, // False
- IterativeParsingElementState, // True
- IterativeParsingElementState, // Null
- IterativeParsingElementState // Number
- },
- // Element
- {
- IterativeParsingErrorState, // Left bracket
- IterativeParsingArrayFinishState, // Right bracket
- IterativeParsingErrorState, // Left curly bracket
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingElementDelimiterState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingErrorState, // String
- IterativeParsingErrorState, // False
- IterativeParsingErrorState, // True
- IterativeParsingErrorState, // Null
- IterativeParsingErrorState // Number
- },
- // ArrayFinish(sink state)
- {
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState
- },
- // Single Value (sink state)
- {
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState, IterativeParsingErrorState,
- IterativeParsingErrorState
- },
- // ElementDelimiter
- {
- IterativeParsingArrayInitialState, // Left bracket(push Element state)
- IterativeParsingArrayFinishState, // Right bracket
- IterativeParsingObjectInitialState, // Left curly bracket(push Element state)
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingElementState, // String
- IterativeParsingElementState, // False
- IterativeParsingElementState, // True
- IterativeParsingElementState, // Null
- IterativeParsingElementState // Number
- },
- // MemberDelimiter
- {
- IterativeParsingErrorState, // Left bracket
- IterativeParsingErrorState, // Right bracket
- IterativeParsingErrorState, // Left curly bracket
- IterativeParsingObjectFinishState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingMemberKeyState, // String
- IterativeParsingErrorState, // False
- IterativeParsingErrorState, // True
- IterativeParsingErrorState, // Null
- IterativeParsingErrorState // Number
- },
- // KeyValueDelimiter
- {
- IterativeParsingArrayInitialState, // Left bracket(push MemberValue state)
- IterativeParsingErrorState, // Right bracket
- IterativeParsingObjectInitialState, // Left curly bracket(push MemberValue state)
- IterativeParsingErrorState, // Right curly bracket
- IterativeParsingErrorState, // Comma
- IterativeParsingErrorState, // Colon
- IterativeParsingMemberValueState, // String
- IterativeParsingMemberValueState, // False
- IterativeParsingMemberValueState, // True
- IterativeParsingMemberValueState, // Null
- IterativeParsingMemberValueState // Number
- },
- }; // End of G
-
- return static_cast<IterativeParsingState>(G[state][token]);
- }
-
- // Make an advance in the token stream and state based on the candidate destination state which was returned by Transit().
- // May return a new state on state pop.
- template <unsigned parseFlags, typename InputStream, typename Handler>
- RAPIDJSON_FORCEINLINE IterativeParsingState Transit(IterativeParsingState src, Token token, IterativeParsingState dst, InputStream& is, Handler& handler) {
- (void)token;
-
- switch (dst) {
- case IterativeParsingErrorState:
- return dst;
-
- case IterativeParsingObjectInitialState:
- case IterativeParsingArrayInitialState:
- {
- // Push the state(Element or MemeberValue) if we are nested in another array or value of member.
- // In this way we can get the correct state on ObjectFinish or ArrayFinish by frame pop.
- IterativeParsingState n = src;
- if (src == IterativeParsingArrayInitialState || src == IterativeParsingElementDelimiterState)
- n = IterativeParsingElementState;
- else if (src == IterativeParsingKeyValueDelimiterState)
- n = IterativeParsingMemberValueState;
- // Push current state.
- *stack_.template Push<SizeType>(1) = n;
- // Initialize and push the member/element count.
- *stack_.template Push<SizeType>(1) = 0;
- // Call handler
- bool hr = (dst == IterativeParsingObjectInitialState) ? handler.StartObject() : handler.StartArray();
- // On handler short circuits the parsing.
- if (!hr) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
- return IterativeParsingErrorState;
- }
- else {
- is.Take();
- return dst;
- }
- }
-
- case IterativeParsingMemberKeyState:
- ParseString<parseFlags>(is, handler, true);
- if (HasParseError())
- return IterativeParsingErrorState;
- else
- return dst;
-
- case IterativeParsingKeyValueDelimiterState:
- RAPIDJSON_ASSERT(token == ColonToken);
- is.Take();
- return dst;
-
- case IterativeParsingMemberValueState:
- // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
- ParseValue<parseFlags>(is, handler);
- if (HasParseError()) {
- return IterativeParsingErrorState;
- }
- return dst;
-
- case IterativeParsingElementState:
- // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
- ParseValue<parseFlags>(is, handler);
- if (HasParseError()) {
- return IterativeParsingErrorState;
- }
- return dst;
-
- case IterativeParsingMemberDelimiterState:
- case IterativeParsingElementDelimiterState:
- is.Take();
- // Update member/element count.
- *stack_.template Top<SizeType>() = *stack_.template Top<SizeType>() + 1;
- return dst;
-
- case IterativeParsingObjectFinishState:
- {
- // Transit from delimiter is only allowed when trailing commas are enabled
- if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingMemberDelimiterState) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorObjectMissName, is.Tell());
- return IterativeParsingErrorState;
- }
- // Get member count.
- SizeType c = *stack_.template Pop<SizeType>(1);
- // If the object is not empty, count the last member.
- if (src == IterativeParsingMemberValueState)
- ++c;
- // Restore the state.
- IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));
- // Transit to Finish state if this is the topmost scope.
- if (n == IterativeParsingStartState)
- n = IterativeParsingFinishState;
- // Call handler
- bool hr = handler.EndObject(c);
- // On handler short circuits the parsing.
- if (!hr) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
- return IterativeParsingErrorState;
- }
- else {
- is.Take();
- return n;
- }
- }
-
- case IterativeParsingArrayFinishState:
- {
- // Transit from delimiter is only allowed when trailing commas are enabled
- if (!(parseFlags & kParseTrailingCommasFlag) && src == IterativeParsingElementDelimiterState) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorValueInvalid, is.Tell());
- return IterativeParsingErrorState;
- }
- // Get element count.
- SizeType c = *stack_.template Pop<SizeType>(1);
- // If the array is not empty, count the last element.
- if (src == IterativeParsingElementState)
- ++c;
- // Restore the state.
- IterativeParsingState n = static_cast<IterativeParsingState>(*stack_.template Pop<SizeType>(1));
- // Transit to Finish state if this is the topmost scope.
- if (n == IterativeParsingStartState)
- n = IterativeParsingFinishState;
- // Call handler
- bool hr = handler.EndArray(c);
- // On handler short circuits the parsing.
- if (!hr) {
- RAPIDJSON_PARSE_ERROR_NORETURN(kParseErrorTermination, is.Tell());
- return IterativeParsingErrorState;
- }
- else {
- is.Take();
- return n;
- }
- }
-
- default:
- // This branch is for IterativeParsingValueState actually.
- // Use `default:` rather than
- // `case IterativeParsingValueState:` is for code coverage.
-
- // The IterativeParsingStartState is not enumerated in this switch-case.
- // It is impossible for that case. And it can be caught by following assertion.
-
- // The IterativeParsingFinishState is not enumerated in this switch-case either.
- // It is a "derivative" state which cannot triggered from Predict() directly.
- // Therefore it cannot happen here. And it can be caught by following assertion.
- RAPIDJSON_ASSERT(dst == IterativeParsingValueState);
-
- // Must be non-compound value. Or it would be ObjectInitial or ArrayInitial state.
- ParseValue<parseFlags>(is, handler);
- if (HasParseError()) {
- return IterativeParsingErrorState;
- }
- return IterativeParsingFinishState;
- }
- }
-
- template <typename InputStream>
- void HandleError(IterativeParsingState src, InputStream& is) {
- if (HasParseError()) {
- // Error flag has been set.
- return;
- }
-
- switch (src) {
- case IterativeParsingStartState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentEmpty, is.Tell()); return;
- case IterativeParsingFinishState: RAPIDJSON_PARSE_ERROR(kParseErrorDocumentRootNotSingular, is.Tell()); return;
- case IterativeParsingObjectInitialState:
- case IterativeParsingMemberDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissName, is.Tell()); return;
- case IterativeParsingMemberKeyState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissColon, is.Tell()); return;
- case IterativeParsingMemberValueState: RAPIDJSON_PARSE_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, is.Tell()); return;
- case IterativeParsingKeyValueDelimiterState:
- case IterativeParsingArrayInitialState:
- case IterativeParsingElementDelimiterState: RAPIDJSON_PARSE_ERROR(kParseErrorValueInvalid, is.Tell()); return;
- default: RAPIDJSON_ASSERT(src == IterativeParsingElementState); RAPIDJSON_PARSE_ERROR(kParseErrorArrayMissCommaOrSquareBracket, is.Tell()); return;
- }
- }
-
- RAPIDJSON_FORCEINLINE bool IsIterativeParsingDelimiterState(IterativeParsingState s) const {
- return s >= IterativeParsingElementDelimiterState;
- }
-
- RAPIDJSON_FORCEINLINE bool IsIterativeParsingCompleteState(IterativeParsingState s) const {
- return s <= IterativeParsingErrorState;
- }
-
- template <unsigned parseFlags, typename InputStream, typename Handler>
- ParseResult IterativeParse(InputStream& is, Handler& handler) {
- parseResult_.Clear();
- ClearStackOnExit scope(*this);
- IterativeParsingState state = IterativeParsingStartState;
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
- while (is.Peek() != '\0') {
- Token t = Tokenize(is.Peek());
- IterativeParsingState n = Predict(state, t);
- IterativeParsingState d = Transit<parseFlags>(state, t, n, is, handler);
-
- if (d == IterativeParsingErrorState) {
- HandleError(state, is);
- break;
- }
-
- state = d;
-
- // Do not further consume streams if a root JSON has been parsed.
- if ((parseFlags & kParseStopWhenDoneFlag) && state == IterativeParsingFinishState)
- break;
-
- SkipWhitespaceAndComments<parseFlags>(is);
- RAPIDJSON_PARSE_ERROR_EARLY_RETURN(parseResult_);
- }
-
- // Handle the end of file.
- if (state != IterativeParsingFinishState)
- HandleError(state, is);
-
- return parseResult_;
- }
-
- static const size_t kDefaultStackCapacity = 256; //!< Default stack capacity in bytes for storing a single decoded string.
- internal::Stack<StackAllocator> stack_; //!< A stack for storing decoded string temporarily during non-destructive parsing.
- ParseResult parseResult_;
- IterativeParsingState state_;
-}; // class GenericReader
-
-//! Reader with UTF8 encoding and default allocator.
-typedef GenericReader<UTF8<>, UTF8<> > Reader;
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__) || defined(_MSC_VER)
-RAPIDJSON_DIAG_POP
-#endif
-
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_READER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/schema.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/schema.h
deleted file mode 100644
index cb799cbacf..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/schema.h
+++ /dev/null
@@ -1,3262 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available->
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip-> All rights reserved->
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License-> You may obtain a copy of the License at
-//
-// http://opensource->org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied-> See the License for the
-// specific language governing permissions and limitations under the License->
-
-#ifndef RAPIDJSON_SCHEMA_H_
-#define RAPIDJSON_SCHEMA_H_
-
-#include "document.h"
-#include "pointer.h"
-#include "stringbuffer.h"
-#include "error/en.h"
-#include "uri.h"
-#include <cmath> // abs, floor
-
-#if !defined(RAPIDJSON_SCHEMA_USE_INTERNALREGEX)
-#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 1
-#else
-#define RAPIDJSON_SCHEMA_USE_INTERNALREGEX 0
-#endif
-
-#if !RAPIDJSON_SCHEMA_USE_INTERNALREGEX && defined(RAPIDJSON_SCHEMA_USE_STDREGEX) && (__cplusplus >=201103L || (defined(_MSC_VER) && _MSC_VER >= 1800))
-#define RAPIDJSON_SCHEMA_USE_STDREGEX 1
-#else
-#define RAPIDJSON_SCHEMA_USE_STDREGEX 0
-#endif
-
-#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
-#include "internal/regex.h"
-#elif RAPIDJSON_SCHEMA_USE_STDREGEX
-#include <regex>
-#endif
-
-#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX || RAPIDJSON_SCHEMA_USE_STDREGEX
-#define RAPIDJSON_SCHEMA_HAS_REGEX 1
-#else
-#define RAPIDJSON_SCHEMA_HAS_REGEX 0
-#endif
-
-#ifndef RAPIDJSON_SCHEMA_VERBOSE
-#define RAPIDJSON_SCHEMA_VERBOSE 0
-#endif
-
-RAPIDJSON_DIAG_PUSH
-
-#if defined(__GNUC__)
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_OFF(weak-vtables)
-RAPIDJSON_DIAG_OFF(exit-time-destructors)
-RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
-RAPIDJSON_DIAG_OFF(variadic-macros)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// Verbose Utilities
-
-#if RAPIDJSON_SCHEMA_VERBOSE
-
-namespace internal {
-
-inline void PrintInvalidKeywordData(const char* keyword) {
- printf(" Fail keyword: '%s'\n", keyword);
-}
-
-inline void PrintInvalidKeywordData(const wchar_t* keyword) {
- wprintf(L" Fail keyword: '%ls'\n", keyword);
-}
-
-inline void PrintInvalidDocumentData(const char* document) {
- printf(" Fail document: '%s'\n", document);
-}
-
-inline void PrintInvalidDocumentData(const wchar_t* document) {
- wprintf(L" Fail document: '%ls'\n", document);
-}
-
-inline void PrintValidatorPointersData(const char* s, const char* d, unsigned depth) {
- printf(" Sch: %*s'%s'\n Doc: %*s'%s'\n", depth * 4, " ", s, depth * 4, " ", d);
-}
-
-inline void PrintValidatorPointersData(const wchar_t* s, const wchar_t* d, unsigned depth) {
- wprintf(L" Sch: %*ls'%ls'\n Doc: %*ls'%ls'\n", depth * 4, L" ", s, depth * 4, L" ", d);
-}
-
-inline void PrintSchemaIdsData(const char* base, const char* local, const char* resolved) {
- printf(" Resolving id: Base: '%s', Local: '%s', Resolved: '%s'\n", base, local, resolved);
-}
-
-inline void PrintSchemaIdsData(const wchar_t* base, const wchar_t* local, const wchar_t* resolved) {
- wprintf(L" Resolving id: Base: '%ls', Local: '%ls', Resolved: '%ls'\n", base, local, resolved);
-}
-
-inline void PrintMethodData(const char* method) {
- printf("%s\n", method);
-}
-
-inline void PrintMethodData(const char* method, bool b) {
- printf("%s, Data: '%s'\n", method, b ? "true" : "false");
-}
-
-inline void PrintMethodData(const char* method, int64_t i) {
- printf("%s, Data: '%" PRId64 "'\n", method, i);
-}
-
-inline void PrintMethodData(const char* method, uint64_t u) {
- printf("%s, Data: '%" PRIu64 "'\n", method, u);
-}
-
-inline void PrintMethodData(const char* method, double d) {
- printf("%s, Data: '%lf'\n", method, d);
-}
-
-inline void PrintMethodData(const char* method, const char* s) {
- printf("%s, Data: '%s'\n", method, s);
-}
-
-inline void PrintMethodData(const char* method, const wchar_t* s) {
- wprintf(L"%hs, Data: '%ls'\n", method, s);
-}
-
-inline void PrintMethodData(const char* method, const char* s1, const char* s2) {
- printf("%s, Data: '%s', '%s'\n", method, s1, s2);
-}
-
-inline void PrintMethodData(const char* method, const wchar_t* s1, const wchar_t* s2) {
- wprintf(L"%hs, Data: '%ls', '%ls'\n", method, s1, s2);
-}
-
-} // namespace internal
-
-#endif // RAPIDJSON_SCHEMA_VERBOSE
-
-#ifndef RAPIDJSON_SCHEMA_PRINT
-#if RAPIDJSON_SCHEMA_VERBOSE
-#define RAPIDJSON_SCHEMA_PRINT(name, ...) internal::Print##name##Data(__VA_ARGS__)
-#else
-#define RAPIDJSON_SCHEMA_PRINT(name, ...)
-#endif
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// RAPIDJSON_INVALID_KEYWORD_RETURN
-
-#define RAPIDJSON_INVALID_KEYWORD_RETURN(code)\
-RAPIDJSON_MULTILINEMACRO_BEGIN\
- context.invalidCode = code;\
- context.invalidKeyword = SchemaType::GetValidateErrorKeyword(code).GetString();\
- RAPIDJSON_SCHEMA_PRINT(InvalidKeyword, context.invalidKeyword);\
- return false;\
-RAPIDJSON_MULTILINEMACRO_END
-
-///////////////////////////////////////////////////////////////////////////////
-// ValidateFlag
-
-/*! \def RAPIDJSON_VALIDATE_DEFAULT_FLAGS
- \ingroup RAPIDJSON_CONFIG
- \brief User-defined kValidateDefaultFlags definition.
-
- User can define this as any \c ValidateFlag combinations.
-*/
-#ifndef RAPIDJSON_VALIDATE_DEFAULT_FLAGS
-#define RAPIDJSON_VALIDATE_DEFAULT_FLAGS kValidateNoFlags
-#endif
-
-//! Combination of validate flags
-/*! \see
- */
-enum ValidateFlag {
- kValidateNoFlags = 0, //!< No flags are set.
- kValidateContinueOnErrorFlag = 1, //!< Don't stop after first validation error.
- kValidateReadFlag = 2, //!< Validation is for a read semantic.
- kValidateWriteFlag = 4, //!< Validation is for a write semantic.
- kValidateDefaultFlags = RAPIDJSON_VALIDATE_DEFAULT_FLAGS //!< Default validate flags. Can be customized by defining RAPIDJSON_VALIDATE_DEFAULT_FLAGS
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Specification
-enum SchemaDraft {
- kDraftUnknown = -1,
- kDraftNone = 0,
- kDraft03 = 3,
- kDraftMin = 4, //!< Current minimum supported draft
- kDraft04 = 4,
- kDraft05 = 5,
- kDraftMax = 5, //!< Current maximum supported draft
- kDraft06 = 6,
- kDraft07 = 7,
- kDraft2019_09 = 8,
- kDraft2020_12 = 9
-};
-
-enum OpenApiVersion {
- kVersionUnknown = -1,
- kVersionNone = 0,
- kVersionMin = 2, //!< Current minimum supported version
- kVersion20 = 2,
- kVersion30 = 3,
- kVersionMax = 3, //!< Current maximum supported version
- kVersion31 = 4,
-};
-
-struct Specification {
- Specification(SchemaDraft d) : draft(d), oapi(kVersionNone) {}
- Specification(OpenApiVersion o) : oapi(o) {
- if (oapi == kVersion20) draft = kDraft04;
- else if (oapi == kVersion30) draft = kDraft05;
- else if (oapi == kVersion31) draft = kDraft2020_12;
- else draft = kDraft04;
- }
- ~Specification() {}
- bool IsSupported() const {
- return ((draft >= kDraftMin && draft <= kDraftMax) && ((oapi == kVersionNone) || (oapi >= kVersionMin && oapi <= kVersionMax)));
- }
- SchemaDraft draft;
- OpenApiVersion oapi;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Forward declarations
-
-template <typename ValueType, typename Allocator>
-class GenericSchemaDocument;
-
-namespace internal {
-
-template <typename SchemaDocumentType>
-class Schema;
-
-///////////////////////////////////////////////////////////////////////////////
-// ISchemaValidator
-
-class ISchemaValidator {
-public:
- virtual ~ISchemaValidator() {}
- virtual bool IsValid() const = 0;
- virtual void SetValidateFlags(unsigned flags) = 0;
- virtual unsigned GetValidateFlags() const = 0;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// ISchemaStateFactory
-
-template <typename SchemaType>
-class ISchemaStateFactory {
-public:
- virtual ~ISchemaStateFactory() {}
- virtual ISchemaValidator* CreateSchemaValidator(const SchemaType&, const bool inheritContinueOnErrors) = 0;
- virtual void DestroySchemaValidator(ISchemaValidator* validator) = 0;
- virtual void* CreateHasher() = 0;
- virtual uint64_t GetHashCode(void* hasher) = 0;
- virtual void DestroryHasher(void* hasher) = 0;
- virtual void* MallocState(size_t size) = 0;
- virtual void FreeState(void* p) = 0;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// IValidationErrorHandler
-
-template <typename SchemaType>
-class IValidationErrorHandler {
-public:
- typedef typename SchemaType::Ch Ch;
- typedef typename SchemaType::SValue SValue;
-
- virtual ~IValidationErrorHandler() {}
-
- virtual void NotMultipleOf(int64_t actual, const SValue& expected) = 0;
- virtual void NotMultipleOf(uint64_t actual, const SValue& expected) = 0;
- virtual void NotMultipleOf(double actual, const SValue& expected) = 0;
- virtual void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) = 0;
- virtual void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) = 0;
- virtual void AboveMaximum(double actual, const SValue& expected, bool exclusive) = 0;
- virtual void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) = 0;
- virtual void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) = 0;
- virtual void BelowMinimum(double actual, const SValue& expected, bool exclusive) = 0;
-
- virtual void TooLong(const Ch* str, SizeType length, SizeType expected) = 0;
- virtual void TooShort(const Ch* str, SizeType length, SizeType expected) = 0;
- virtual void DoesNotMatch(const Ch* str, SizeType length) = 0;
-
- virtual void DisallowedItem(SizeType index) = 0;
- virtual void TooFewItems(SizeType actualCount, SizeType expectedCount) = 0;
- virtual void TooManyItems(SizeType actualCount, SizeType expectedCount) = 0;
- virtual void DuplicateItems(SizeType index1, SizeType index2) = 0;
-
- virtual void TooManyProperties(SizeType actualCount, SizeType expectedCount) = 0;
- virtual void TooFewProperties(SizeType actualCount, SizeType expectedCount) = 0;
- virtual void StartMissingProperties() = 0;
- virtual void AddMissingProperty(const SValue& name) = 0;
- virtual bool EndMissingProperties() = 0;
- virtual void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) = 0;
- virtual void DisallowedProperty(const Ch* name, SizeType length) = 0;
-
- virtual void StartDependencyErrors() = 0;
- virtual void StartMissingDependentProperties() = 0;
- virtual void AddMissingDependentProperty(const SValue& targetName) = 0;
- virtual void EndMissingDependentProperties(const SValue& sourceName) = 0;
- virtual void AddDependencySchemaError(const SValue& souceName, ISchemaValidator* subvalidator) = 0;
- virtual bool EndDependencyErrors() = 0;
-
- virtual void DisallowedValue(const ValidateErrorCode code) = 0;
- virtual void StartDisallowedType() = 0;
- virtual void AddExpectedType(const typename SchemaType::ValueType& expectedType) = 0;
- virtual void EndDisallowedType(const typename SchemaType::ValueType& actualType) = 0;
- virtual void NotAllOf(ISchemaValidator** subvalidators, SizeType count) = 0;
- virtual void NoneOf(ISchemaValidator** subvalidators, SizeType count) = 0;
- virtual void NotOneOf(ISchemaValidator** subvalidators, SizeType count) = 0;
- virtual void MultipleOneOf(SizeType index1, SizeType index2) = 0;
- virtual void Disallowed() = 0;
- virtual void DisallowedWhenWriting() = 0;
- virtual void DisallowedWhenReading() = 0;
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// Hasher
-
-// For comparison of compound value
-template<typename Encoding, typename Allocator>
-class Hasher {
-public:
- typedef typename Encoding::Ch Ch;
-
- Hasher(Allocator* allocator = 0, size_t stackCapacity = kDefaultSize) : stack_(allocator, stackCapacity) {}
-
- bool Null() { return WriteType(kNullType); }
- bool Bool(bool b) { return WriteType(b ? kTrueType : kFalseType); }
- bool Int(int i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
- bool Uint(unsigned u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
- bool Int64(int64_t i) { Number n; n.u.i = i; n.d = static_cast<double>(i); return WriteNumber(n); }
- bool Uint64(uint64_t u) { Number n; n.u.u = u; n.d = static_cast<double>(u); return WriteNumber(n); }
- bool Double(double d) {
- Number n;
- if (d < 0) n.u.i = static_cast<int64_t>(d);
- else n.u.u = static_cast<uint64_t>(d);
- n.d = d;
- return WriteNumber(n);
- }
-
- bool RawNumber(const Ch* str, SizeType len, bool) {
- WriteBuffer(kNumberType, str, len * sizeof(Ch));
- return true;
- }
-
- bool String(const Ch* str, SizeType len, bool) {
- WriteBuffer(kStringType, str, len * sizeof(Ch));
- return true;
- }
-
- bool StartObject() { return true; }
- bool Key(const Ch* str, SizeType len, bool copy) { return String(str, len, copy); }
- bool EndObject(SizeType memberCount) {
- uint64_t h = Hash(0, kObjectType);
- uint64_t* kv = stack_.template Pop<uint64_t>(memberCount * 2);
- for (SizeType i = 0; i < memberCount; i++)
- h ^= Hash(kv[i * 2], kv[i * 2 + 1]); // Use xor to achieve member order insensitive
- *stack_.template Push<uint64_t>() = h;
- return true;
- }
-
- bool StartArray() { return true; }
- bool EndArray(SizeType elementCount) {
- uint64_t h = Hash(0, kArrayType);
- uint64_t* e = stack_.template Pop<uint64_t>(elementCount);
- for (SizeType i = 0; i < elementCount; i++)
- h = Hash(h, e[i]); // Use hash to achieve element order sensitive
- *stack_.template Push<uint64_t>() = h;
- return true;
- }
-
- bool IsValid() const { return stack_.GetSize() == sizeof(uint64_t); }
-
- uint64_t GetHashCode() const {
- RAPIDJSON_ASSERT(IsValid());
- return *stack_.template Top<uint64_t>();
- }
-
-private:
- static const size_t kDefaultSize = 256;
- struct Number {
- union U {
- uint64_t u;
- int64_t i;
- }u;
- double d;
- };
-
- bool WriteType(Type type) { return WriteBuffer(type, 0, 0); }
-
- bool WriteNumber(const Number& n) { return WriteBuffer(kNumberType, &n, sizeof(n)); }
-
- bool WriteBuffer(Type type, const void* data, size_t len) {
- // FNV-1a from http://isthe.com/chongo/tech/comp/fnv/
- uint64_t h = Hash(RAPIDJSON_UINT64_C2(0x84222325, 0xcbf29ce4), type);
- const unsigned char* d = static_cast<const unsigned char*>(data);
- for (size_t i = 0; i < len; i++)
- h = Hash(h, d[i]);
- *stack_.template Push<uint64_t>() = h;
- return true;
- }
-
- static uint64_t Hash(uint64_t h, uint64_t d) {
- static const uint64_t kPrime = RAPIDJSON_UINT64_C2(0x00000100, 0x000001b3);
- h ^= d;
- h *= kPrime;
- return h;
- }
-
- Stack<Allocator> stack_;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// SchemaValidationContext
-
-template <typename SchemaDocumentType>
-struct SchemaValidationContext {
- typedef Schema<SchemaDocumentType> SchemaType;
- typedef ISchemaStateFactory<SchemaType> SchemaValidatorFactoryType;
- typedef IValidationErrorHandler<SchemaType> ErrorHandlerType;
- typedef typename SchemaType::ValueType ValueType;
- typedef typename ValueType::Ch Ch;
-
- enum PatternValidatorType {
- kPatternValidatorOnly,
- kPatternValidatorWithProperty,
- kPatternValidatorWithAdditionalProperty
- };
-
- SchemaValidationContext(SchemaValidatorFactoryType& f, ErrorHandlerType& eh, const SchemaType* s, unsigned fl = 0) :
- factory(f),
- error_handler(eh),
- schema(s),
- flags(fl),
- valueSchema(),
- invalidKeyword(),
- invalidCode(),
- hasher(),
- arrayElementHashCodes(),
- validators(),
- validatorCount(),
- patternPropertiesValidators(),
- patternPropertiesValidatorCount(),
- patternPropertiesSchemas(),
- patternPropertiesSchemaCount(),
- valuePatternValidatorType(kPatternValidatorOnly),
- propertyExist(),
- inArray(false),
- valueUniqueness(false),
- arrayUniqueness(false)
- {
- }
-
- ~SchemaValidationContext() {
- if (hasher)
- factory.DestroryHasher(hasher);
- if (validators) {
- for (SizeType i = 0; i < validatorCount; i++) {
- if (validators[i]) {
- factory.DestroySchemaValidator(validators[i]);
- }
- }
- factory.FreeState(validators);
- }
- if (patternPropertiesValidators) {
- for (SizeType i = 0; i < patternPropertiesValidatorCount; i++) {
- if (patternPropertiesValidators[i]) {
- factory.DestroySchemaValidator(patternPropertiesValidators[i]);
- }
- }
- factory.FreeState(patternPropertiesValidators);
- }
- if (patternPropertiesSchemas)
- factory.FreeState(patternPropertiesSchemas);
- if (propertyExist)
- factory.FreeState(propertyExist);
- }
-
- SchemaValidatorFactoryType& factory;
- ErrorHandlerType& error_handler;
- const SchemaType* schema;
- unsigned flags;
- const SchemaType* valueSchema;
- const Ch* invalidKeyword;
- ValidateErrorCode invalidCode;
- void* hasher; // Only validator access
- void* arrayElementHashCodes; // Only validator access this
- ISchemaValidator** validators;
- SizeType validatorCount;
- ISchemaValidator** patternPropertiesValidators;
- SizeType patternPropertiesValidatorCount;
- const SchemaType** patternPropertiesSchemas;
- SizeType patternPropertiesSchemaCount;
- PatternValidatorType valuePatternValidatorType;
- PatternValidatorType objectPatternValidatorType;
- SizeType arrayElementIndex;
- bool* propertyExist;
- bool inArray;
- bool valueUniqueness;
- bool arrayUniqueness;
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// Schema
-
-template <typename SchemaDocumentType>
-class Schema {
-public:
- typedef typename SchemaDocumentType::ValueType ValueType;
- typedef typename SchemaDocumentType::AllocatorType AllocatorType;
- typedef typename SchemaDocumentType::PointerType PointerType;
- typedef typename ValueType::EncodingType EncodingType;
- typedef typename EncodingType::Ch Ch;
- typedef SchemaValidationContext<SchemaDocumentType> Context;
- typedef Schema<SchemaDocumentType> SchemaType;
- typedef GenericValue<EncodingType, AllocatorType> SValue;
- typedef IValidationErrorHandler<Schema> ErrorHandler;
- typedef GenericUri<ValueType, AllocatorType> UriType;
- friend class GenericSchemaDocument<ValueType, AllocatorType>;
-
- Schema(SchemaDocumentType* schemaDocument, const PointerType& p, const ValueType& value, const ValueType& document, AllocatorType* allocator, const UriType& id = UriType()) :
- allocator_(allocator),
- uri_(schemaDocument->GetURI(), *allocator),
- id_(id, allocator),
- spec_(schemaDocument->GetSpecification()),
- pointer_(p, allocator),
- typeless_(schemaDocument->GetTypeless()),
- enum_(),
- enumCount_(),
- not_(),
- type_((1 << kTotalSchemaType) - 1), // typeless
- validatorCount_(),
- notValidatorIndex_(),
- properties_(),
- additionalPropertiesSchema_(),
- patternProperties_(),
- patternPropertyCount_(),
- propertyCount_(),
- minProperties_(),
- maxProperties_(SizeType(~0)),
- additionalProperties_(true),
- hasDependencies_(),
- hasRequired_(),
- hasSchemaDependencies_(),
- additionalItemsSchema_(),
- itemsList_(),
- itemsTuple_(),
- itemsTupleCount_(),
- minItems_(),
- maxItems_(SizeType(~0)),
- additionalItems_(true),
- uniqueItems_(false),
- pattern_(),
- minLength_(0),
- maxLength_(~SizeType(0)),
- exclusiveMinimum_(false),
- exclusiveMaximum_(false),
- defaultValueLength_(0),
- readOnly_(false),
- writeOnly_(false),
- nullable_(false)
- {
- GenericStringBuffer<EncodingType> sb;
- p.StringifyUriFragment(sb);
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Schema", sb.GetString(), id.GetString());
-
- typedef typename ValueType::ConstValueIterator ConstValueIterator;
- typedef typename ValueType::ConstMemberIterator ConstMemberIterator;
-
- // PR #1393
- // Early add this Schema and its $ref(s) in schemaDocument's map to avoid infinite
- // recursion (with recursive schemas), since schemaDocument->getSchema() is always
- // checked before creating a new one. Don't cache typeless_, though.
- if (this != typeless_) {
- typedef typename SchemaDocumentType::SchemaEntry SchemaEntry;
- SchemaEntry *entry = schemaDocument->schemaMap_.template Push<SchemaEntry>();
- new (entry) SchemaEntry(pointer_, this, true, allocator_);
- schemaDocument->AddSchemaRefs(this);
- }
-
- if (!value.IsObject())
- return;
-
- // If we have an id property, resolve it with the in-scope id
- // Not supported for open api 2.0 or 3.0
- if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30)
- if (const ValueType* v = GetMember(value, GetIdString())) {
- if (v->IsString()) {
- UriType local(*v, allocator);
- id_ = local.Resolve(id_, allocator);
- RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), v->GetString(), id_.GetString());
- }
- }
-
- if (const ValueType* v = GetMember(value, GetTypeString())) {
- type_ = 0;
- if (v->IsString())
- AddType(*v);
- else if (v->IsArray())
- for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr)
- AddType(*itr);
- }
-
- if (const ValueType* v = GetMember(value, GetEnumString())) {
- if (v->IsArray() && v->Size() > 0) {
- enum_ = static_cast<uint64_t*>(allocator_->Malloc(sizeof(uint64_t) * v->Size()));
- for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr) {
- typedef Hasher<EncodingType, MemoryPoolAllocator<AllocatorType> > EnumHasherType;
- char buffer[256u + 24];
- MemoryPoolAllocator<AllocatorType> hasherAllocator(buffer, sizeof(buffer));
- EnumHasherType h(&hasherAllocator, 256);
- itr->Accept(h);
- enum_[enumCount_++] = h.GetHashCode();
- }
- }
- }
-
- if (schemaDocument)
- AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document);
-
- // AnyOf, OneOf, Not not supported for open api 2.0
- if (schemaDocument && spec_.oapi != kVersion20) {
- AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document);
- AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document);
-
- if (const ValueType* v = GetMember(value, GetNotString())) {
- schemaDocument->CreateSchema(&not_, p.Append(GetNotString(), allocator_), *v, document, id_);
- notValidatorIndex_ = validatorCount_;
- validatorCount_++;
- }
- }
-
- // Object
-
- const ValueType* properties = GetMember(value, GetPropertiesString());
- const ValueType* required = GetMember(value, GetRequiredString());
- const ValueType* dependencies = GetMember(value, GetDependenciesString());
- {
- // Gather properties from properties/required/dependencies
- SValue allProperties(kArrayType);
-
- if (properties && properties->IsObject())
- for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr)
- AddUniqueElement(allProperties, itr->name);
-
- if (required && required->IsArray())
- for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
- if (itr->IsString())
- AddUniqueElement(allProperties, *itr);
-
- // Dependencies not supported for open api 2.0 and 3.0
- if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30)
- if (dependencies && dependencies->IsObject())
- for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
- AddUniqueElement(allProperties, itr->name);
- if (itr->value.IsArray())
- for (ConstValueIterator i = itr->value.Begin(); i != itr->value.End(); ++i)
- if (i->IsString())
- AddUniqueElement(allProperties, *i);
- }
-
- if (allProperties.Size() > 0) {
- propertyCount_ = allProperties.Size();
- properties_ = static_cast<Property*>(allocator_->Malloc(sizeof(Property) * propertyCount_));
- for (SizeType i = 0; i < propertyCount_; i++) {
- new (&properties_[i]) Property();
- properties_[i].name = allProperties[i];
- properties_[i].schema = typeless_;
- }
- }
- }
-
- if (properties && properties->IsObject()) {
- PointerType q = p.Append(GetPropertiesString(), allocator_);
- for (ConstMemberIterator itr = properties->MemberBegin(); itr != properties->MemberEnd(); ++itr) {
- SizeType index;
- if (FindPropertyIndex(itr->name, &index))
- schemaDocument->CreateSchema(&properties_[index].schema, q.Append(itr->name, allocator_), itr->value, document, id_);
- }
- }
-
- // PatternProperties not supported for open api 2.0 and 3.0
- if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30)
- if (const ValueType* v = GetMember(value, GetPatternPropertiesString())) {
- PointerType q = p.Append(GetPatternPropertiesString(), allocator_);
- patternProperties_ = static_cast<PatternProperty*>(allocator_->Malloc(sizeof(PatternProperty) * v->MemberCount()));
- patternPropertyCount_ = 0;
-
- for (ConstMemberIterator itr = v->MemberBegin(); itr != v->MemberEnd(); ++itr) {
- new (&patternProperties_[patternPropertyCount_]) PatternProperty();
- PointerType r = q.Append(itr->name, allocator_);
- patternProperties_[patternPropertyCount_].pattern = CreatePattern(itr->name, schemaDocument, r);
- schemaDocument->CreateSchema(&patternProperties_[patternPropertyCount_].schema, r, itr->value, document, id_);
- patternPropertyCount_++;
- }
- }
-
- if (required && required->IsArray())
- for (ConstValueIterator itr = required->Begin(); itr != required->End(); ++itr)
- if (itr->IsString()) {
- SizeType index;
- if (FindPropertyIndex(*itr, &index)) {
- properties_[index].required = true;
- hasRequired_ = true;
- }
- }
-
- // Dependencies not supported for open api 2.0 and 3.0
- if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30)
- if (dependencies && dependencies->IsObject()) {
- PointerType q = p.Append(GetDependenciesString(), allocator_);
- hasDependencies_ = true;
- for (ConstMemberIterator itr = dependencies->MemberBegin(); itr != dependencies->MemberEnd(); ++itr) {
- SizeType sourceIndex;
- if (FindPropertyIndex(itr->name, &sourceIndex)) {
- if (itr->value.IsArray()) {
- properties_[sourceIndex].dependencies = static_cast<bool*>(allocator_->Malloc(sizeof(bool) * propertyCount_));
- std::memset(properties_[sourceIndex].dependencies, 0, sizeof(bool)* propertyCount_);
- for (ConstValueIterator targetItr = itr->value.Begin(); targetItr != itr->value.End(); ++targetItr) {
- SizeType targetIndex;
- if (FindPropertyIndex(*targetItr, &targetIndex))
- properties_[sourceIndex].dependencies[targetIndex] = true;
- }
- }
- else if (itr->value.IsObject()) {
- hasSchemaDependencies_ = true;
- schemaDocument->CreateSchema(&properties_[sourceIndex].dependenciesSchema, q.Append(itr->name, allocator_), itr->value, document, id_);
- properties_[sourceIndex].dependenciesValidatorIndex = validatorCount_;
- validatorCount_++;
- }
- }
- }
- }
-
- if (const ValueType* v = GetMember(value, GetAdditionalPropertiesString())) {
- if (v->IsBool())
- additionalProperties_ = v->GetBool();
- else if (v->IsObject())
- schemaDocument->CreateSchema(&additionalPropertiesSchema_, p.Append(GetAdditionalPropertiesString(), allocator_), *v, document, id_);
- }
-
- AssignIfExist(minProperties_, value, GetMinPropertiesString());
- AssignIfExist(maxProperties_, value, GetMaxPropertiesString());
-
- // Array
- if (const ValueType* v = GetMember(value, GetItemsString())) {
- PointerType q = p.Append(GetItemsString(), allocator_);
- if (v->IsObject()) // List validation
- schemaDocument->CreateSchema(&itemsList_, q, *v, document, id_);
- else if (v->IsArray()) { // Tuple validation
- itemsTuple_ = static_cast<const Schema**>(allocator_->Malloc(sizeof(const Schema*) * v->Size()));
- SizeType index = 0;
- for (ConstValueIterator itr = v->Begin(); itr != v->End(); ++itr, index++)
- schemaDocument->CreateSchema(&itemsTuple_[itemsTupleCount_++], q.Append(index, allocator_), *itr, document, id_);
- }
- }
-
- AssignIfExist(minItems_, value, GetMinItemsString());
- AssignIfExist(maxItems_, value, GetMaxItemsString());
-
- // AdditionalItems not supported for openapi 2.0 and 3.0
- if (spec_.oapi != kVersion20 && spec_.oapi != kVersion30)
- if (const ValueType* v = GetMember(value, GetAdditionalItemsString())) {
- if (v->IsBool())
- additionalItems_ = v->GetBool();
- else if (v->IsObject())
- schemaDocument->CreateSchema(&additionalItemsSchema_, p.Append(GetAdditionalItemsString(), allocator_), *v, document, id_);
- }
-
- AssignIfExist(uniqueItems_, value, GetUniqueItemsString());
-
- // String
- AssignIfExist(minLength_, value, GetMinLengthString());
- AssignIfExist(maxLength_, value, GetMaxLengthString());
-
- if (const ValueType* v = GetMember(value, GetPatternString()))
- pattern_ = CreatePattern(*v, schemaDocument, p.Append(GetPatternString(), allocator_));
-
- // Number
- if (const ValueType* v = GetMember(value, GetMinimumString()))
- if (v->IsNumber())
- minimum_.CopyFrom(*v, *allocator_);
-
- if (const ValueType* v = GetMember(value, GetMaximumString()))
- if (v->IsNumber())
- maximum_.CopyFrom(*v, *allocator_);
-
- AssignIfExist(exclusiveMinimum_, value, GetExclusiveMinimumString());
- AssignIfExist(exclusiveMaximum_, value, GetExclusiveMaximumString());
-
- if (const ValueType* v = GetMember(value, GetMultipleOfString()))
- if (v->IsNumber() && v->GetDouble() > 0.0)
- multipleOf_.CopyFrom(*v, *allocator_);
-
- // Default
- if (const ValueType* v = GetMember(value, GetDefaultValueString()))
- if (v->IsString())
- defaultValueLength_ = v->GetStringLength();
-
- // ReadOnly - open api only (until draft 7 supported)
- // WriteOnly - open api 3 only (until draft 7 supported)
- // Both can't be true
- if (spec_.oapi != kVersionNone)
- AssignIfExist(readOnly_, value, GetReadOnlyString());
- if (spec_.oapi >= kVersion30)
- AssignIfExist(writeOnly_, value, GetWriteOnlyString());
- if (readOnly_ && writeOnly_)
- schemaDocument->SchemaError(kSchemaErrorReadOnlyAndWriteOnly, p);
-
- // Nullable - open api 3 only
- // If true add 'null' as allowable type
- if (spec_.oapi >= kVersion30) {
- AssignIfExist(nullable_, value, GetNullableString());
- if (nullable_)
- AddType(GetNullString());
- }
- }
-
- ~Schema() {
- AllocatorType::Free(enum_);
- if (properties_) {
- for (SizeType i = 0; i < propertyCount_; i++)
- properties_[i].~Property();
- AllocatorType::Free(properties_);
- }
- if (patternProperties_) {
- for (SizeType i = 0; i < patternPropertyCount_; i++)
- patternProperties_[i].~PatternProperty();
- AllocatorType::Free(patternProperties_);
- }
- AllocatorType::Free(itemsTuple_);
-#if RAPIDJSON_SCHEMA_HAS_REGEX
- if (pattern_) {
- pattern_->~RegexType();
- AllocatorType::Free(pattern_);
- }
-#endif
- }
-
- const SValue& GetURI() const {
- return uri_;
- }
-
- const UriType& GetId() const {
- return id_;
- }
-
- const Specification& GetSpecification() const {
- return spec_;
- }
-
- const PointerType& GetPointer() const {
- return pointer_;
- }
-
- bool BeginValue(Context& context) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::BeginValue");
- if (context.inArray) {
- if (uniqueItems_)
- context.valueUniqueness = true;
-
- if (itemsList_)
- context.valueSchema = itemsList_;
- else if (itemsTuple_) {
- if (context.arrayElementIndex < itemsTupleCount_)
- context.valueSchema = itemsTuple_[context.arrayElementIndex];
- else if (additionalItemsSchema_)
- context.valueSchema = additionalItemsSchema_;
- else if (additionalItems_)
- context.valueSchema = typeless_;
- else {
- context.error_handler.DisallowedItem(context.arrayElementIndex);
- // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error
- context.valueSchema = typeless_;
- // Must bump arrayElementIndex for when kValidateContinueOnErrorFlag is set
- context.arrayElementIndex++;
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalItems);
- }
- }
- else
- context.valueSchema = typeless_;
-
- context.arrayElementIndex++;
- }
- return true;
- }
-
- RAPIDJSON_FORCEINLINE bool EndValue(Context& context) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndValue");
- // Only check pattern properties if we have validators
- if (context.patternPropertiesValidatorCount > 0) {
- bool otherValid = false;
- SizeType count = context.patternPropertiesValidatorCount;
- if (context.objectPatternValidatorType != Context::kPatternValidatorOnly)
- otherValid = context.patternPropertiesValidators[--count]->IsValid();
-
- bool patternValid = true;
- for (SizeType i = 0; i < count; i++)
- if (!context.patternPropertiesValidators[i]->IsValid()) {
- patternValid = false;
- break;
- }
-
- if (context.objectPatternValidatorType == Context::kPatternValidatorOnly) {
- if (!patternValid) {
- context.error_handler.PropertyViolations(context.patternPropertiesValidators, count);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties);
- }
- }
- else if (context.objectPatternValidatorType == Context::kPatternValidatorWithProperty) {
- if (!patternValid || !otherValid) {
- context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties);
- }
- }
- else if (!patternValid && !otherValid) { // kPatternValidatorWithAdditionalProperty)
- context.error_handler.PropertyViolations(context.patternPropertiesValidators, count + 1);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPatternProperties);
- }
- }
-
- // For enums only check if we have a hasher
- if (enum_ && context.hasher) {
- const uint64_t h = context.factory.GetHashCode(context.hasher);
- for (SizeType i = 0; i < enumCount_; i++)
- if (enum_[i] == h)
- goto foundEnum;
- context.error_handler.DisallowedValue(kValidateErrorEnum);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorEnum);
- foundEnum:;
- }
-
- // Only check allOf etc if we have validators
- if (context.validatorCount > 0) {
- if (allOf_.schemas)
- for (SizeType i = allOf_.begin; i < allOf_.begin + allOf_.count; i++)
- if (!context.validators[i]->IsValid()) {
- context.error_handler.NotAllOf(&context.validators[allOf_.begin], allOf_.count);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAllOf);
- }
-
- if (anyOf_.schemas) {
- for (SizeType i = anyOf_.begin; i < anyOf_.begin + anyOf_.count; i++)
- if (context.validators[i]->IsValid())
- goto foundAny;
- context.error_handler.NoneOf(&context.validators[anyOf_.begin], anyOf_.count);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAnyOf);
- foundAny:;
- }
-
- if (oneOf_.schemas) {
- bool oneValid = false;
- SizeType firstMatch = 0;
- for (SizeType i = oneOf_.begin; i < oneOf_.begin + oneOf_.count; i++)
- if (context.validators[i]->IsValid()) {
- if (oneValid) {
- context.error_handler.MultipleOneOf(firstMatch, i - oneOf_.begin);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOfMatch);
- } else {
- oneValid = true;
- firstMatch = i - oneOf_.begin;
- }
- }
- if (!oneValid) {
- context.error_handler.NotOneOf(&context.validators[oneOf_.begin], oneOf_.count);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorOneOf);
- }
- }
-
- if (not_ && context.validators[notValidatorIndex_]->IsValid()) {
- context.error_handler.Disallowed();
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorNot);
- }
- }
-
- return true;
- }
-
- bool Null(Context& context) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Null");
- if (!(type_ & (1 << kNullSchemaType))) {
- DisallowedType(context, GetNullString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
- return CreateParallelValidator(context);
- }
-
- bool Bool(Context& context, bool b) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Bool", b);
- if (!CheckBool(context, b))
- return false;
- return CreateParallelValidator(context);
- }
-
- bool Int(Context& context, int i) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Int", (int64_t)i);
- if (!CheckInt(context, i))
- return false;
- return CreateParallelValidator(context);
- }
-
- bool Uint(Context& context, unsigned u) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Uint", (uint64_t)u);
- if (!CheckUint(context, u))
- return false;
- return CreateParallelValidator(context);
- }
-
- bool Int64(Context& context, int64_t i) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Int64", i);
- if (!CheckInt(context, i))
- return false;
- return CreateParallelValidator(context);
- }
-
- bool Uint64(Context& context, uint64_t u) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Uint64", u);
- if (!CheckUint(context, u))
- return false;
- return CreateParallelValidator(context);
- }
-
- bool Double(Context& context, double d) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Double", d);
- if (!(type_ & (1 << kNumberSchemaType))) {
- DisallowedType(context, GetNumberString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- if (!minimum_.IsNull() && !CheckDoubleMinimum(context, d))
- return false;
-
- if (!maximum_.IsNull() && !CheckDoubleMaximum(context, d))
- return false;
-
- if (!multipleOf_.IsNull() && !CheckDoubleMultipleOf(context, d))
- return false;
-
- return CreateParallelValidator(context);
- }
-
- bool String(Context& context, const Ch* str, SizeType length, bool) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::String", str);
- if (!(type_ & (1 << kStringSchemaType))) {
- DisallowedType(context, GetStringString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- if (minLength_ != 0 || maxLength_ != SizeType(~0)) {
- SizeType count;
- if (internal::CountStringCodePoint<EncodingType>(str, length, &count)) {
- if (count < minLength_) {
- context.error_handler.TooShort(str, length, minLength_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinLength);
- }
- if (count > maxLength_) {
- context.error_handler.TooLong(str, length, maxLength_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxLength);
- }
- }
- }
-
- if (pattern_ && !IsPatternMatch(pattern_, str, length)) {
- context.error_handler.DoesNotMatch(str, length);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorPattern);
- }
-
- return CreateParallelValidator(context);
- }
-
- bool StartObject(Context& context) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::StartObject");
- if (!(type_ & (1 << kObjectSchemaType))) {
- DisallowedType(context, GetObjectString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- if (hasDependencies_ || hasRequired_) {
- context.propertyExist = static_cast<bool*>(context.factory.MallocState(sizeof(bool) * propertyCount_));
- std::memset(context.propertyExist, 0, sizeof(bool) * propertyCount_);
- }
-
- if (patternProperties_) { // pre-allocate schema array
- SizeType count = patternPropertyCount_ + 1; // extra for valuePatternValidatorType
- context.patternPropertiesSchemas = static_cast<const SchemaType**>(context.factory.MallocState(sizeof(const SchemaType*) * count));
- context.patternPropertiesSchemaCount = 0;
- std::memset(context.patternPropertiesSchemas, 0, sizeof(SchemaType*) * count);
- }
-
- return CreateParallelValidator(context);
- }
-
- bool Key(Context& context, const Ch* str, SizeType len, bool) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::Key", str);
-
- if (patternProperties_) {
- context.patternPropertiesSchemaCount = 0;
- for (SizeType i = 0; i < patternPropertyCount_; i++)
- if (patternProperties_[i].pattern && IsPatternMatch(patternProperties_[i].pattern, str, len)) {
- context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = patternProperties_[i].schema;
- context.valueSchema = typeless_;
- }
- }
-
- SizeType index = 0;
- if (FindPropertyIndex(ValueType(str, len).Move(), &index)) {
- if (context.patternPropertiesSchemaCount > 0) {
- context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = properties_[index].schema;
- context.valueSchema = typeless_;
- context.valuePatternValidatorType = Context::kPatternValidatorWithProperty;
- }
- else
- context.valueSchema = properties_[index].schema;
-
- if (context.propertyExist)
- context.propertyExist[index] = true;
-
- return true;
- }
-
- if (additionalPropertiesSchema_) {
- if (context.patternPropertiesSchemaCount > 0) {
- context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_;
- context.valueSchema = typeless_;
- context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty;
- }
- else
- context.valueSchema = additionalPropertiesSchema_;
- return true;
- }
- else if (additionalProperties_) {
- context.valueSchema = typeless_;
- return true;
- }
-
- if (context.patternPropertiesSchemaCount == 0) { // patternProperties are not additional properties
- // Must set valueSchema for when kValidateContinueOnErrorFlag is set, else reports spurious type error
- context.valueSchema = typeless_;
- context.error_handler.DisallowedProperty(str, len);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorAdditionalProperties);
- }
-
- return true;
- }
-
- bool EndObject(Context& context, SizeType memberCount) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndObject");
- if (hasRequired_) {
- context.error_handler.StartMissingProperties();
- for (SizeType index = 0; index < propertyCount_; index++)
- if (properties_[index].required && !context.propertyExist[index])
- if (properties_[index].schema->defaultValueLength_ == 0 )
- context.error_handler.AddMissingProperty(properties_[index].name);
- if (context.error_handler.EndMissingProperties())
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorRequired);
- }
-
- if (memberCount < minProperties_) {
- context.error_handler.TooFewProperties(memberCount, minProperties_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinProperties);
- }
-
- if (memberCount > maxProperties_) {
- context.error_handler.TooManyProperties(memberCount, maxProperties_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxProperties);
- }
-
- if (hasDependencies_) {
- context.error_handler.StartDependencyErrors();
- for (SizeType sourceIndex = 0; sourceIndex < propertyCount_; sourceIndex++) {
- const Property& source = properties_[sourceIndex];
- if (context.propertyExist[sourceIndex]) {
- if (source.dependencies) {
- context.error_handler.StartMissingDependentProperties();
- for (SizeType targetIndex = 0; targetIndex < propertyCount_; targetIndex++)
- if (source.dependencies[targetIndex] && !context.propertyExist[targetIndex])
- context.error_handler.AddMissingDependentProperty(properties_[targetIndex].name);
- context.error_handler.EndMissingDependentProperties(source.name);
- }
- else if (source.dependenciesSchema) {
- ISchemaValidator* dependenciesValidator = context.validators[source.dependenciesValidatorIndex];
- if (!dependenciesValidator->IsValid())
- context.error_handler.AddDependencySchemaError(source.name, dependenciesValidator);
- }
- }
- }
- if (context.error_handler.EndDependencyErrors())
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorDependencies);
- }
-
- return true;
- }
-
- bool StartArray(Context& context) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::StartArray");
- context.arrayElementIndex = 0;
- context.inArray = true; // Ensure we note that we are in an array
-
- if (!(type_ & (1 << kArraySchemaType))) {
- DisallowedType(context, GetArrayString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- return CreateParallelValidator(context);
- }
-
- bool EndArray(Context& context, SizeType elementCount) const {
- RAPIDJSON_SCHEMA_PRINT(Method, "Schema::EndArray");
- context.inArray = false;
-
- if (elementCount < minItems_) {
- context.error_handler.TooFewItems(elementCount, minItems_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMinItems);
- }
-
- if (elementCount > maxItems_) {
- context.error_handler.TooManyItems(elementCount, maxItems_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMaxItems);
- }
-
- return true;
- }
-
- static const ValueType& GetValidateErrorKeyword(ValidateErrorCode validateErrorCode) {
- switch (validateErrorCode) {
- case kValidateErrorMultipleOf: return GetMultipleOfString();
- case kValidateErrorMaximum: return GetMaximumString();
- case kValidateErrorExclusiveMaximum: return GetMaximumString(); // Same
- case kValidateErrorMinimum: return GetMinimumString();
- case kValidateErrorExclusiveMinimum: return GetMinimumString(); // Same
-
- case kValidateErrorMaxLength: return GetMaxLengthString();
- case kValidateErrorMinLength: return GetMinLengthString();
- case kValidateErrorPattern: return GetPatternString();
-
- case kValidateErrorMaxItems: return GetMaxItemsString();
- case kValidateErrorMinItems: return GetMinItemsString();
- case kValidateErrorUniqueItems: return GetUniqueItemsString();
- case kValidateErrorAdditionalItems: return GetAdditionalItemsString();
-
- case kValidateErrorMaxProperties: return GetMaxPropertiesString();
- case kValidateErrorMinProperties: return GetMinPropertiesString();
- case kValidateErrorRequired: return GetRequiredString();
- case kValidateErrorAdditionalProperties: return GetAdditionalPropertiesString();
- case kValidateErrorPatternProperties: return GetPatternPropertiesString();
- case kValidateErrorDependencies: return GetDependenciesString();
-
- case kValidateErrorEnum: return GetEnumString();
- case kValidateErrorType: return GetTypeString();
-
- case kValidateErrorOneOf: return GetOneOfString();
- case kValidateErrorOneOfMatch: return GetOneOfString(); // Same
- case kValidateErrorAllOf: return GetAllOfString();
- case kValidateErrorAnyOf: return GetAnyOfString();
- case kValidateErrorNot: return GetNotString();
-
- case kValidateErrorReadOnly: return GetReadOnlyString();
- case kValidateErrorWriteOnly: return GetWriteOnlyString();
-
- default: return GetNullString();
- }
- }
-
-
- // Generate functions for string literal according to Ch
-#define RAPIDJSON_STRING_(name, ...) \
- static const ValueType& Get##name##String() {\
- static const Ch s[] = { __VA_ARGS__, '\0' };\
- static const ValueType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1));\
- return v;\
- }
-
- RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l')
- RAPIDJSON_STRING_(Boolean, 'b', 'o', 'o', 'l', 'e', 'a', 'n')
- RAPIDJSON_STRING_(Object, 'o', 'b', 'j', 'e', 'c', 't')
- RAPIDJSON_STRING_(Array, 'a', 'r', 'r', 'a', 'y')
- RAPIDJSON_STRING_(String, 's', 't', 'r', 'i', 'n', 'g')
- RAPIDJSON_STRING_(Number, 'n', 'u', 'm', 'b', 'e', 'r')
- RAPIDJSON_STRING_(Integer, 'i', 'n', 't', 'e', 'g', 'e', 'r')
- RAPIDJSON_STRING_(Type, 't', 'y', 'p', 'e')
- RAPIDJSON_STRING_(Enum, 'e', 'n', 'u', 'm')
- RAPIDJSON_STRING_(AllOf, 'a', 'l', 'l', 'O', 'f')
- RAPIDJSON_STRING_(AnyOf, 'a', 'n', 'y', 'O', 'f')
- RAPIDJSON_STRING_(OneOf, 'o', 'n', 'e', 'O', 'f')
- RAPIDJSON_STRING_(Not, 'n', 'o', 't')
- RAPIDJSON_STRING_(Properties, 'p', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
- RAPIDJSON_STRING_(Required, 'r', 'e', 'q', 'u', 'i', 'r', 'e', 'd')
- RAPIDJSON_STRING_(Dependencies, 'd', 'e', 'p', 'e', 'n', 'd', 'e', 'n', 'c', 'i', 'e', 's')
- RAPIDJSON_STRING_(PatternProperties, 'p', 'a', 't', 't', 'e', 'r', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
- RAPIDJSON_STRING_(AdditionalProperties, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
- RAPIDJSON_STRING_(MinProperties, 'm', 'i', 'n', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
- RAPIDJSON_STRING_(MaxProperties, 'm', 'a', 'x', 'P', 'r', 'o', 'p', 'e', 'r', 't', 'i', 'e', 's')
- RAPIDJSON_STRING_(Items, 'i', 't', 'e', 'm', 's')
- RAPIDJSON_STRING_(MinItems, 'm', 'i', 'n', 'I', 't', 'e', 'm', 's')
- RAPIDJSON_STRING_(MaxItems, 'm', 'a', 'x', 'I', 't', 'e', 'm', 's')
- RAPIDJSON_STRING_(AdditionalItems, 'a', 'd', 'd', 'i', 't', 'i', 'o', 'n', 'a', 'l', 'I', 't', 'e', 'm', 's')
- RAPIDJSON_STRING_(UniqueItems, 'u', 'n', 'i', 'q', 'u', 'e', 'I', 't', 'e', 'm', 's')
- RAPIDJSON_STRING_(MinLength, 'm', 'i', 'n', 'L', 'e', 'n', 'g', 't', 'h')
- RAPIDJSON_STRING_(MaxLength, 'm', 'a', 'x', 'L', 'e', 'n', 'g', 't', 'h')
- RAPIDJSON_STRING_(Pattern, 'p', 'a', 't', 't', 'e', 'r', 'n')
- RAPIDJSON_STRING_(Minimum, 'm', 'i', 'n', 'i', 'm', 'u', 'm')
- RAPIDJSON_STRING_(Maximum, 'm', 'a', 'x', 'i', 'm', 'u', 'm')
- RAPIDJSON_STRING_(ExclusiveMinimum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'i', 'n', 'i', 'm', 'u', 'm')
- RAPIDJSON_STRING_(ExclusiveMaximum, 'e', 'x', 'c', 'l', 'u', 's', 'i', 'v', 'e', 'M', 'a', 'x', 'i', 'm', 'u', 'm')
- RAPIDJSON_STRING_(MultipleOf, 'm', 'u', 'l', 't', 'i', 'p', 'l', 'e', 'O', 'f')
- RAPIDJSON_STRING_(DefaultValue, 'd', 'e', 'f', 'a', 'u', 'l', 't')
- RAPIDJSON_STRING_(Schema, '$', 's', 'c', 'h', 'e', 'm', 'a')
- RAPIDJSON_STRING_(Ref, '$', 'r', 'e', 'f')
- RAPIDJSON_STRING_(Id, 'i', 'd')
- RAPIDJSON_STRING_(Swagger, 's', 'w', 'a', 'g', 'g', 'e', 'r')
- RAPIDJSON_STRING_(OpenApi, 'o', 'p', 'e', 'n', 'a', 'p', 'i')
- RAPIDJSON_STRING_(ReadOnly, 'r', 'e', 'a', 'd', 'O', 'n', 'l', 'y')
- RAPIDJSON_STRING_(WriteOnly, 'w', 'r', 'i', 't', 'e', 'O', 'n', 'l', 'y')
- RAPIDJSON_STRING_(Nullable, 'n', 'u', 'l', 'l', 'a', 'b', 'l', 'e')
-
-#undef RAPIDJSON_STRING_
-
-private:
- enum SchemaValueType {
- kNullSchemaType,
- kBooleanSchemaType,
- kObjectSchemaType,
- kArraySchemaType,
- kStringSchemaType,
- kNumberSchemaType,
- kIntegerSchemaType,
- kTotalSchemaType
- };
-
-#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
- typedef internal::GenericRegex<EncodingType, AllocatorType> RegexType;
-#elif RAPIDJSON_SCHEMA_USE_STDREGEX
- typedef std::basic_regex<Ch> RegexType;
-#else
- typedef char RegexType;
-#endif
-
- struct SchemaArray {
- SchemaArray() : schemas(), count() {}
- ~SchemaArray() { AllocatorType::Free(schemas); }
- const SchemaType** schemas;
- SizeType begin; // begin index of context.validators
- SizeType count;
- };
-
- template <typename V1, typename V2>
- void AddUniqueElement(V1& a, const V2& v) {
- for (typename V1::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)
- if (*itr == v)
- return;
- V1 c(v, *allocator_);
- a.PushBack(c, *allocator_);
- }
-
- static const ValueType* GetMember(const ValueType& value, const ValueType& name) {
- typename ValueType::ConstMemberIterator itr = value.FindMember(name);
- return itr != value.MemberEnd() ? &(itr->value) : 0;
- }
-
- static void AssignIfExist(bool& out, const ValueType& value, const ValueType& name) {
- if (const ValueType* v = GetMember(value, name))
- if (v->IsBool())
- out = v->GetBool();
- }
-
- static void AssignIfExist(SizeType& out, const ValueType& value, const ValueType& name) {
- if (const ValueType* v = GetMember(value, name))
- if (v->IsUint64() && v->GetUint64() <= SizeType(~0))
- out = static_cast<SizeType>(v->GetUint64());
- }
-
- void AssignIfExist(SchemaArray& out, SchemaDocumentType& schemaDocument, const PointerType& p, const ValueType& value, const ValueType& name, const ValueType& document) {
- if (const ValueType* v = GetMember(value, name)) {
- if (v->IsArray() && v->Size() > 0) {
- PointerType q = p.Append(name, allocator_);
- out.count = v->Size();
- out.schemas = static_cast<const Schema**>(allocator_->Malloc(out.count * sizeof(const Schema*)));
- memset(out.schemas, 0, sizeof(Schema*)* out.count);
- for (SizeType i = 0; i < out.count; i++)
- schemaDocument.CreateSchema(&out.schemas[i], q.Append(i, allocator_), (*v)[i], document, id_);
- out.begin = validatorCount_;
- validatorCount_ += out.count;
- }
- }
- }
-
-#if RAPIDJSON_SCHEMA_USE_INTERNALREGEX
- template <typename ValueType>
- RegexType* CreatePattern(const ValueType& value, SchemaDocumentType* sd, const PointerType& p) {
- if (value.IsString()) {
- RegexType* r = new (allocator_->Malloc(sizeof(RegexType))) RegexType(value.GetString(), allocator_);
- if (!r->IsValid()) {
- sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength());
- r->~RegexType();
- AllocatorType::Free(r);
- r = 0;
- }
- return r;
- }
- return 0;
- }
-
- static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType) {
- GenericRegexSearch<RegexType> rs(*pattern);
- return rs.Search(str);
- }
-#elif RAPIDJSON_SCHEMA_USE_STDREGEX
- template <typename ValueType>
- RegexType* CreatePattern(const ValueType& value, SchemaDocumentType* sd, const PointerType& p) {
- if (value.IsString()) {
- RegexType *r = static_cast<RegexType*>(allocator_->Malloc(sizeof(RegexType)));
- try {
- return new (r) RegexType(value.GetString(), std::size_t(value.GetStringLength()), std::regex_constants::ECMAScript);
- }
- catch (const std::regex_error& e) {
- sd->SchemaErrorValue(kSchemaErrorRegexInvalid, p, value.GetString(), value.GetStringLength());
- AllocatorType::Free(r);
- }
- }
- return 0;
- }
-
- static bool IsPatternMatch(const RegexType* pattern, const Ch *str, SizeType length) {
- std::match_results<const Ch*> r;
- return std::regex_search(str, str + length, r, *pattern);
- }
-#else
- template <typename ValueType>
- RegexType* CreatePattern(const ValueType&) {
- return 0;
- }
-
- static bool IsPatternMatch(const RegexType*, const Ch *, SizeType) { return true; }
-#endif // RAPIDJSON_SCHEMA_USE_STDREGEX
-
- void AddType(const ValueType& type) {
- if (type == GetNullString() ) type_ |= 1 << kNullSchemaType;
- else if (type == GetBooleanString()) type_ |= 1 << kBooleanSchemaType;
- else if (type == GetObjectString() ) type_ |= 1 << kObjectSchemaType;
- else if (type == GetArrayString() ) type_ |= 1 << kArraySchemaType;
- else if (type == GetStringString() ) type_ |= 1 << kStringSchemaType;
- else if (type == GetIntegerString()) type_ |= 1 << kIntegerSchemaType;
- else if (type == GetNumberString() ) type_ |= (1 << kNumberSchemaType) | (1 << kIntegerSchemaType);
- }
-
- // Creates parallel validators for allOf, anyOf, oneOf, not and schema dependencies, if required.
- // Also creates a hasher for enums and array uniqueness, if required.
- // Also a useful place to add type-independent error checks.
- bool CreateParallelValidator(Context& context) const {
- if (enum_ || context.arrayUniqueness)
- context.hasher = context.factory.CreateHasher();
-
- if (validatorCount_) {
- RAPIDJSON_ASSERT(context.validators == 0);
- context.validators = static_cast<ISchemaValidator**>(context.factory.MallocState(sizeof(ISchemaValidator*) * validatorCount_));
- std::memset(context.validators, 0, sizeof(ISchemaValidator*) * validatorCount_);
- context.validatorCount = validatorCount_;
-
- // Always return after first failure for these sub-validators
- if (allOf_.schemas)
- CreateSchemaValidators(context, allOf_, false);
-
- if (anyOf_.schemas)
- CreateSchemaValidators(context, anyOf_, false);
-
- if (oneOf_.schemas)
- CreateSchemaValidators(context, oneOf_, false);
-
- if (not_)
- context.validators[notValidatorIndex_] = context.factory.CreateSchemaValidator(*not_, false);
-
- if (hasSchemaDependencies_) {
- for (SizeType i = 0; i < propertyCount_; i++)
- if (properties_[i].dependenciesSchema)
- context.validators[properties_[i].dependenciesValidatorIndex] = context.factory.CreateSchemaValidator(*properties_[i].dependenciesSchema, false);
- }
- }
-
- // Add any other type-independent checks here
- if (readOnly_ && (context.flags & kValidateWriteFlag)) {
- context.error_handler.DisallowedWhenWriting();
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorReadOnly);
- }
- if (writeOnly_ && (context.flags & kValidateReadFlag)) {
- context.error_handler.DisallowedWhenReading();
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorWriteOnly);
- }
-
- return true;
- }
-
- void CreateSchemaValidators(Context& context, const SchemaArray& schemas, const bool inheritContinueOnErrors) const {
- for (SizeType i = 0; i < schemas.count; i++)
- context.validators[schemas.begin + i] = context.factory.CreateSchemaValidator(*schemas.schemas[i], inheritContinueOnErrors);
- }
-
- // O(n)
- bool FindPropertyIndex(const ValueType& name, SizeType* outIndex) const {
- SizeType len = name.GetStringLength();
- const Ch* str = name.GetString();
- for (SizeType index = 0; index < propertyCount_; index++)
- if (properties_[index].name.GetStringLength() == len &&
- (std::memcmp(properties_[index].name.GetString(), str, sizeof(Ch) * len) == 0))
- {
- *outIndex = index;
- return true;
- }
- return false;
- }
-
- bool CheckBool(Context& context, bool) const {
- if (!(type_ & (1 << kBooleanSchemaType))) {
- DisallowedType(context, GetBooleanString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
- return true;
- }
-
- bool CheckInt(Context& context, int64_t i) const {
- if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) {
- DisallowedType(context, GetIntegerString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- if (!minimum_.IsNull()) {
- if (minimum_.IsInt64()) {
- if (exclusiveMinimum_ ? i <= minimum_.GetInt64() : i < minimum_.GetInt64()) {
- context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum);
- }
- }
- else if (minimum_.IsUint64()) {
- context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum); // i <= max(int64_t) < minimum.GetUint64()
- }
- else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
- return false;
- }
-
- if (!maximum_.IsNull()) {
- if (maximum_.IsInt64()) {
- if (exclusiveMaximum_ ? i >= maximum_.GetInt64() : i > maximum_.GetInt64()) {
- context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum);
- }
- }
- else if (maximum_.IsUint64()) { }
- /* do nothing */ // i <= max(int64_t) < maximum_.GetUint64()
- else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
- return false;
- }
-
- if (!multipleOf_.IsNull()) {
- if (multipleOf_.IsUint64()) {
- if (static_cast<uint64_t>(i >= 0 ? i : -i) % multipleOf_.GetUint64() != 0) {
- context.error_handler.NotMultipleOf(i, multipleOf_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
- }
- }
- else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
- return false;
- }
-
- return true;
- }
-
- bool CheckUint(Context& context, uint64_t i) const {
- if (!(type_ & ((1 << kIntegerSchemaType) | (1 << kNumberSchemaType)))) {
- DisallowedType(context, GetIntegerString());
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorType);
- }
-
- if (!minimum_.IsNull()) {
- if (minimum_.IsUint64()) {
- if (exclusiveMinimum_ ? i <= minimum_.GetUint64() : i < minimum_.GetUint64()) {
- context.error_handler.BelowMinimum(i, minimum_, exclusiveMinimum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum);
- }
- }
- else if (minimum_.IsInt64())
- /* do nothing */; // i >= 0 > minimum.Getint64()
- else if (!CheckDoubleMinimum(context, static_cast<double>(i)))
- return false;
- }
-
- if (!maximum_.IsNull()) {
- if (maximum_.IsUint64()) {
- if (exclusiveMaximum_ ? i >= maximum_.GetUint64() : i > maximum_.GetUint64()) {
- context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum);
- }
- }
- else if (maximum_.IsInt64()) {
- context.error_handler.AboveMaximum(i, maximum_, exclusiveMaximum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum); // i >= 0 > maximum_
- }
- else if (!CheckDoubleMaximum(context, static_cast<double>(i)))
- return false;
- }
-
- if (!multipleOf_.IsNull()) {
- if (multipleOf_.IsUint64()) {
- if (i % multipleOf_.GetUint64() != 0) {
- context.error_handler.NotMultipleOf(i, multipleOf_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
- }
- }
- else if (!CheckDoubleMultipleOf(context, static_cast<double>(i)))
- return false;
- }
-
- return true;
- }
-
- bool CheckDoubleMinimum(Context& context, double d) const {
- if (exclusiveMinimum_ ? d <= minimum_.GetDouble() : d < minimum_.GetDouble()) {
- context.error_handler.BelowMinimum(d, minimum_, exclusiveMinimum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMinimum_ ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum);
- }
- return true;
- }
-
- bool CheckDoubleMaximum(Context& context, double d) const {
- if (exclusiveMaximum_ ? d >= maximum_.GetDouble() : d > maximum_.GetDouble()) {
- context.error_handler.AboveMaximum(d, maximum_, exclusiveMaximum_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(exclusiveMaximum_ ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum);
- }
- return true;
- }
-
- bool CheckDoubleMultipleOf(Context& context, double d) const {
- double a = std::abs(d), b = std::abs(multipleOf_.GetDouble());
- double q = std::floor(a / b);
- double r = a - q * b;
- if (r > 0.0) {
- context.error_handler.NotMultipleOf(d, multipleOf_);
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorMultipleOf);
- }
- return true;
- }
-
- void DisallowedType(Context& context, const ValueType& actualType) const {
- ErrorHandler& eh = context.error_handler;
- eh.StartDisallowedType();
-
- if (type_ & (1 << kNullSchemaType)) eh.AddExpectedType(GetNullString());
- if (type_ & (1 << kBooleanSchemaType)) eh.AddExpectedType(GetBooleanString());
- if (type_ & (1 << kObjectSchemaType)) eh.AddExpectedType(GetObjectString());
- if (type_ & (1 << kArraySchemaType)) eh.AddExpectedType(GetArrayString());
- if (type_ & (1 << kStringSchemaType)) eh.AddExpectedType(GetStringString());
-
- if (type_ & (1 << kNumberSchemaType)) eh.AddExpectedType(GetNumberString());
- else if (type_ & (1 << kIntegerSchemaType)) eh.AddExpectedType(GetIntegerString());
-
- eh.EndDisallowedType(actualType);
- }
-
- struct Property {
- Property() : schema(), dependenciesSchema(), dependenciesValidatorIndex(), dependencies(), required(false) {}
- ~Property() { AllocatorType::Free(dependencies); }
- SValue name;
- const SchemaType* schema;
- const SchemaType* dependenciesSchema;
- SizeType dependenciesValidatorIndex;
- bool* dependencies;
- bool required;
- };
-
- struct PatternProperty {
- PatternProperty() : schema(), pattern() {}
- ~PatternProperty() {
- if (pattern) {
- pattern->~RegexType();
- AllocatorType::Free(pattern);
- }
- }
- const SchemaType* schema;
- RegexType* pattern;
- };
-
- AllocatorType* allocator_;
- SValue uri_;
- UriType id_;
- Specification spec_;
- PointerType pointer_;
- const SchemaType* typeless_;
- uint64_t* enum_;
- SizeType enumCount_;
- SchemaArray allOf_;
- SchemaArray anyOf_;
- SchemaArray oneOf_;
- const SchemaType* not_;
- unsigned type_; // bitmask of kSchemaType
- SizeType validatorCount_;
- SizeType notValidatorIndex_;
-
- Property* properties_;
- const SchemaType* additionalPropertiesSchema_;
- PatternProperty* patternProperties_;
- SizeType patternPropertyCount_;
- SizeType propertyCount_;
- SizeType minProperties_;
- SizeType maxProperties_;
- bool additionalProperties_;
- bool hasDependencies_;
- bool hasRequired_;
- bool hasSchemaDependencies_;
-
- const SchemaType* additionalItemsSchema_;
- const SchemaType* itemsList_;
- const SchemaType** itemsTuple_;
- SizeType itemsTupleCount_;
- SizeType minItems_;
- SizeType maxItems_;
- bool additionalItems_;
- bool uniqueItems_;
-
- RegexType* pattern_;
- SizeType minLength_;
- SizeType maxLength_;
-
- SValue minimum_;
- SValue maximum_;
- SValue multipleOf_;
- bool exclusiveMinimum_;
- bool exclusiveMaximum_;
-
- SizeType defaultValueLength_;
-
- bool readOnly_;
- bool writeOnly_;
- bool nullable_;
-};
-
-template<typename Stack, typename Ch>
-struct TokenHelper {
- RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
- *documentStack.template Push<Ch>() = '/';
- char buffer[21];
- size_t length = static_cast<size_t>((sizeof(SizeType) == 4 ? u32toa(index, buffer) : u64toa(index, buffer)) - buffer);
- for (size_t i = 0; i < length; i++)
- *documentStack.template Push<Ch>() = static_cast<Ch>(buffer[i]);
- }
-};
-
-// Partial specialized version for char to prevent buffer copying.
-template <typename Stack>
-struct TokenHelper<Stack, char> {
- RAPIDJSON_FORCEINLINE static void AppendIndexToken(Stack& documentStack, SizeType index) {
- if (sizeof(SizeType) == 4) {
- char *buffer = documentStack.template Push<char>(1 + 10); // '/' + uint
- *buffer++ = '/';
- const char* end = internal::u32toa(index, buffer);
- documentStack.template Pop<char>(static_cast<size_t>(10 - (end - buffer)));
- }
- else {
- char *buffer = documentStack.template Push<char>(1 + 20); // '/' + uint64
- *buffer++ = '/';
- const char* end = internal::u64toa(index, buffer);
- documentStack.template Pop<char>(static_cast<size_t>(20 - (end - buffer)));
- }
- }
-};
-
-} // namespace internal
-
-///////////////////////////////////////////////////////////////////////////////
-// IGenericRemoteSchemaDocumentProvider
-
-template <typename SchemaDocumentType>
-class IGenericRemoteSchemaDocumentProvider {
-public:
- typedef typename SchemaDocumentType::Ch Ch;
- typedef typename SchemaDocumentType::ValueType ValueType;
- typedef typename SchemaDocumentType::AllocatorType AllocatorType;
-
- virtual ~IGenericRemoteSchemaDocumentProvider() {}
- virtual const SchemaDocumentType* GetRemoteDocument(const Ch* uri, SizeType length) = 0;
- virtual const SchemaDocumentType* GetRemoteDocument(const GenericUri<ValueType, AllocatorType> uri, Specification& spec) {
- // Default implementation just calls through for compatibility
- // Following line suppresses unused parameter warning
- (void)spec;
- // printf("GetRemoteDocument: %d %d\n", spec.draft, spec.oapi);
- return GetRemoteDocument(uri.GetBaseString(), uri.GetBaseStringLength());
- }
-};
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericSchemaDocument
-
-//! JSON schema document.
-/*!
- A JSON schema document is a compiled version of a JSON schema.
- It is basically a tree of internal::Schema.
-
- \note This is an immutable class (i.e. its instance cannot be modified after construction).
- \tparam ValueT Type of JSON value (e.g. \c Value ), which also determine the encoding.
- \tparam Allocator Allocator type for allocating memory of this document.
-*/
-template <typename ValueT, typename Allocator = CrtAllocator>
-class GenericSchemaDocument {
-public:
- typedef ValueT ValueType;
- typedef IGenericRemoteSchemaDocumentProvider<GenericSchemaDocument> IRemoteSchemaDocumentProviderType;
- typedef Allocator AllocatorType;
- typedef typename ValueType::EncodingType EncodingType;
- typedef typename EncodingType::Ch Ch;
- typedef internal::Schema<GenericSchemaDocument> SchemaType;
- typedef GenericPointer<ValueType, Allocator> PointerType;
- typedef GenericValue<EncodingType, AllocatorType> GValue;
- typedef GenericUri<ValueType, Allocator> UriType;
- typedef GenericStringRef<Ch> StringRefType;
- friend class internal::Schema<GenericSchemaDocument>;
- template <typename, typename, typename>
- friend class GenericSchemaValidator;
-
- //! Constructor.
- /*!
- Compile a JSON document into schema document.
-
- \param document A JSON document as source.
- \param uri The base URI of this schema document for purposes of violation reporting.
- \param uriLength Length of \c name, in code points.
- \param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null.
- \param allocator An optional allocator instance for allocating memory. Can be null.
- \param pointer An optional JSON pointer to the start of the schema document
- \param spec Optional schema draft or OpenAPI version. Used if no specification in document. Defaults to draft-04.
- */
- explicit GenericSchemaDocument(const ValueType& document, const Ch* uri = 0, SizeType uriLength = 0,
- IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0,
- const PointerType& pointer = PointerType(), // PR #1393
- const Specification& spec = Specification(kDraft04)) :
- remoteProvider_(remoteProvider),
- allocator_(allocator),
- ownAllocator_(),
- root_(),
- typeless_(),
- schemaMap_(allocator, kInitialSchemaMapSize),
- schemaRef_(allocator, kInitialSchemaRefSize),
- spec_(spec),
- error_(kObjectType),
- currentError_()
- {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::GenericSchemaDocument");
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
-
- Ch noUri[1] = {0};
- uri_.SetString(uri ? uri : noUri, uriLength, *allocator_);
- docId_ = UriType(uri_, allocator_);
-
- typeless_ = static_cast<SchemaType*>(allocator_->Malloc(sizeof(SchemaType)));
- new (typeless_) SchemaType(this, PointerType(), ValueType(kObjectType).Move(), ValueType(kObjectType).Move(), allocator_, docId_);
-
- // Establish the schema draft or open api version.
- // We only ever look for '$schema' or 'swagger' or 'openapi' at the root of the document.
- SetSchemaSpecification(document);
-
- // Generate root schema, it will call CreateSchema() to create sub-schemas,
- // And call HandleRefSchema() if there are $ref.
- // PR #1393 use input pointer if supplied
- root_ = typeless_;
- if (pointer.GetTokenCount() == 0) {
- CreateSchemaRecursive(&root_, pointer, document, document, docId_);
- }
- else if (const ValueType* v = pointer.Get(document)) {
- CreateSchema(&root_, pointer, *v, document, docId_);
- }
- else {
- GenericStringBuffer<EncodingType> sb;
- pointer.StringifyUriFragment(sb);
- SchemaErrorValue(kSchemaErrorStartUnknown, PointerType(), sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)));
- }
-
- RAPIDJSON_ASSERT(root_ != 0);
-
- schemaRef_.ShrinkToFit(); // Deallocate all memory for ref
- }
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- //! Move constructor in C++11
- GenericSchemaDocument(GenericSchemaDocument&& rhs) RAPIDJSON_NOEXCEPT :
- remoteProvider_(rhs.remoteProvider_),
- allocator_(rhs.allocator_),
- ownAllocator_(rhs.ownAllocator_),
- root_(rhs.root_),
- typeless_(rhs.typeless_),
- schemaMap_(std::move(rhs.schemaMap_)),
- schemaRef_(std::move(rhs.schemaRef_)),
- uri_(std::move(rhs.uri_)),
- docId_(std::move(rhs.docId_)),
- spec_(rhs.spec_),
- error_(std::move(rhs.error_)),
- currentError_(std::move(rhs.currentError_))
- {
- rhs.remoteProvider_ = 0;
- rhs.allocator_ = 0;
- rhs.ownAllocator_ = 0;
- rhs.typeless_ = 0;
- }
-#endif
-
- //! Destructor
- ~GenericSchemaDocument() {
- while (!schemaMap_.Empty())
- schemaMap_.template Pop<SchemaEntry>(1)->~SchemaEntry();
-
- if (typeless_) {
- typeless_->~SchemaType();
- Allocator::Free(typeless_);
- }
-
- // these may contain some allocator data so clear before deleting ownAllocator_
- uri_.SetNull();
- error_.SetNull();
- currentError_.SetNull();
-
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- const GValue& GetURI() const { return uri_; }
-
- const Specification& GetSpecification() const { return spec_; }
- bool IsSupportedSpecification() const { return spec_.IsSupported(); }
-
- //! Static method to get the specification of any schema document
- // Returns kDraftNone if document is silent
- static const Specification GetSpecification(const ValueType& document) {
- SchemaDraft draft = GetSchemaDraft(document);
- if (draft != kDraftNone)
- return Specification(draft);
- else {
- OpenApiVersion oapi = GetOpenApiVersion(document);
- if (oapi != kVersionNone)
- return Specification(oapi);
- }
- return Specification(kDraftNone);
- }
-
- //! Get the root schema.
- const SchemaType& GetRoot() const { return *root_; }
-
- //! Gets the error object.
- GValue& GetError() { return error_; }
- const GValue& GetError() const { return error_; }
-
- static const StringRefType& GetSchemaErrorKeyword(SchemaErrorCode schemaErrorCode) {
- switch (schemaErrorCode) {
- case kSchemaErrorStartUnknown: return GetStartUnknownString();
- case kSchemaErrorRefPlainName: return GetRefPlainNameString();
- case kSchemaErrorRefInvalid: return GetRefInvalidString();
- case kSchemaErrorRefPointerInvalid: return GetRefPointerInvalidString();
- case kSchemaErrorRefUnknown: return GetRefUnknownString();
- case kSchemaErrorRefCyclical: return GetRefCyclicalString();
- case kSchemaErrorRefNoRemoteProvider: return GetRefNoRemoteProviderString();
- case kSchemaErrorRefNoRemoteSchema: return GetRefNoRemoteSchemaString();
- case kSchemaErrorRegexInvalid: return GetRegexInvalidString();
- case kSchemaErrorSpecUnknown: return GetSpecUnknownString();
- case kSchemaErrorSpecUnsupported: return GetSpecUnsupportedString();
- case kSchemaErrorSpecIllegal: return GetSpecIllegalString();
- case kSchemaErrorReadOnlyAndWriteOnly: return GetReadOnlyAndWriteOnlyString();
- default: return GetNullString();
- }
- }
-
- //! Default error method
- void SchemaError(const SchemaErrorCode code, const PointerType& location) {
- currentError_ = GValue(kObjectType);
- AddCurrentError(code, location);
- }
-
- //! Method for error with single string value insert
- void SchemaErrorValue(const SchemaErrorCode code, const PointerType& location, const Ch* value, SizeType length) {
- currentError_ = GValue(kObjectType);
- currentError_.AddMember(GetValueString(), GValue(value, length, *allocator_).Move(), *allocator_);
- AddCurrentError(code, location);
- }
-
- //! Method for error with invalid pointer
- void SchemaErrorPointer(const SchemaErrorCode code, const PointerType& location, const Ch* value, SizeType length, const PointerType& pointer) {
- currentError_ = GValue(kObjectType);
- currentError_.AddMember(GetValueString(), GValue(value, length, *allocator_).Move(), *allocator_);
- currentError_.AddMember(GetOffsetString(), static_cast<SizeType>(pointer.GetParseErrorOffset() / sizeof(Ch)), *allocator_);
- AddCurrentError(code, location);
- }
-
- private:
- //! Prohibit copying
- GenericSchemaDocument(const GenericSchemaDocument&);
- //! Prohibit assignment
- GenericSchemaDocument& operator=(const GenericSchemaDocument&);
-
- typedef const PointerType* SchemaRefPtr; // PR #1393
-
- struct SchemaEntry {
- SchemaEntry(const PointerType& p, SchemaType* s, bool o, Allocator* allocator) : pointer(p, allocator), schema(s), owned(o) {}
- ~SchemaEntry() {
- if (owned) {
- schema->~SchemaType();
- Allocator::Free(schema);
- }
- }
- PointerType pointer;
- SchemaType* schema;
- bool owned;
- };
-
- void AddErrorInstanceLocation(GValue& result, const PointerType& location) {
- GenericStringBuffer<EncodingType> sb;
- location.StringifyUriFragment(sb);
- GValue instanceRef(sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)), *allocator_);
- result.AddMember(GetInstanceRefString(), instanceRef, *allocator_);
- }
-
- void AddError(GValue& keyword, GValue& error) {
- typename GValue::MemberIterator member = error_.FindMember(keyword);
- if (member == error_.MemberEnd())
- error_.AddMember(keyword, error, *allocator_);
- else {
- if (member->value.IsObject()) {
- GValue errors(kArrayType);
- errors.PushBack(member->value, *allocator_);
- member->value = errors;
- }
- member->value.PushBack(error, *allocator_);
- }
- }
-
- void AddCurrentError(const SchemaErrorCode code, const PointerType& location) {
- RAPIDJSON_SCHEMA_PRINT(InvalidKeyword, GetSchemaErrorKeyword(code));
- currentError_.AddMember(GetErrorCodeString(), code, *allocator_);
- AddErrorInstanceLocation(currentError_, location);
- AddError(GValue(GetSchemaErrorKeyword(code)).Move(), currentError_);
- }
-
-#define RAPIDJSON_STRING_(name, ...) \
- static const StringRefType& Get##name##String() {\
- static const Ch s[] = { __VA_ARGS__, '\0' };\
- static const StringRefType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1)); \
- return v;\
- }
-
- RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f')
- RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e')
- RAPIDJSON_STRING_(Value, 'v', 'a', 'l', 'u', 'e')
- RAPIDJSON_STRING_(Offset, 'o', 'f', 'f', 's', 'e', 't')
-
- RAPIDJSON_STRING_(Null, 'n', 'u', 'l', 'l')
- RAPIDJSON_STRING_(SpecUnknown, 'S', 'p', 'e', 'c', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
- RAPIDJSON_STRING_(SpecUnsupported, 'S', 'p', 'e', 'c', 'U', 'n', 's', 'u', 'p', 'p', 'o', 'r', 't', 'e', 'd')
- RAPIDJSON_STRING_(SpecIllegal, 'S', 'p', 'e', 'c', 'I', 'l', 'l', 'e', 'g', 'a', 'l')
- RAPIDJSON_STRING_(StartUnknown, 'S', 't', 'a', 'r', 't', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
- RAPIDJSON_STRING_(RefPlainName, 'R', 'e', 'f', 'P', 'l', 'a', 'i', 'n', 'N', 'a', 'm', 'e')
- RAPIDJSON_STRING_(RefInvalid, 'R', 'e', 'f', 'I', 'n', 'v', 'a', 'l', 'i', 'd')
- RAPIDJSON_STRING_(RefPointerInvalid, 'R', 'e', 'f', 'P', 'o', 'i', 'n', 't', 'e', 'r', 'I', 'n', 'v', 'a', 'l', 'i', 'd')
- RAPIDJSON_STRING_(RefUnknown, 'R', 'e', 'f', 'U', 'n', 'k', 'n', 'o', 'w', 'n')
- RAPIDJSON_STRING_(RefCyclical, 'R', 'e', 'f', 'C', 'y', 'c', 'l', 'i', 'c', 'a', 'l')
- RAPIDJSON_STRING_(RefNoRemoteProvider, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'P', 'r', 'o', 'v', 'i', 'd', 'e', 'r')
- RAPIDJSON_STRING_(RefNoRemoteSchema, 'R', 'e', 'f', 'N', 'o', 'R', 'e', 'm', 'o', 't', 'e', 'S', 'c', 'h', 'e', 'm', 'a')
- RAPIDJSON_STRING_(ReadOnlyAndWriteOnly, 'R', 'e', 'a', 'd', 'O', 'n', 'l', 'y', 'A', 'n', 'd', 'W', 'r', 'i', 't', 'e', 'O', 'n', 'l', 'y')
- RAPIDJSON_STRING_(RegexInvalid, 'R', 'e', 'g', 'e', 'x', 'I', 'n', 'v', 'a', 'l', 'i', 'd')
-
-#undef RAPIDJSON_STRING_
-
- // Static method to get schema draft of any schema document
- static SchemaDraft GetSchemaDraft(const ValueType& document) {
- static const Ch kDraft03String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '3', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' };
- static const Ch kDraft04String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '4', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' };
- static const Ch kDraft05String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '5', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' };
- static const Ch kDraft06String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '6', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' };
- static const Ch kDraft07String[] = { 'h', 't', 't', 'p', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '-', '0', '7', '/', 's', 'c', 'h', 'e', 'm', 'a', '#', '\0' };
- static const Ch kDraft2019_09String[] = { 'h', 't', 't', 'p', 's', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '/', '2', '0', '1', '9', '-', '0', '9', '/', 's', 'c', 'h', 'e', 'm', 'a', '\0' };
- static const Ch kDraft2020_12String[] = { 'h', 't', 't', 'p', 's', ':', '/', '/', 'j', 's', 'o', 'n', '-', 's', 'c', 'h', 'e', 'm', 'a', '.', 'o', 'r', 'g', '/', 'd', 'r', 'a', 'f', 't', '/', '2', '0', '2', '0', '-', '1', '2', '/', 's', 'c', 'h', 'e', 'm', 'a', '\0' };
-
- if (!document.IsObject()) {
- return kDraftNone;
- }
-
- // Get the schema draft from the $schema keyword at the supplied location
- typename ValueType::ConstMemberIterator itr = document.FindMember(SchemaType::GetSchemaString());
- if (itr != document.MemberEnd()) {
- if (!itr->value.IsString()) return kDraftUnknown;
- const UriType draftUri(itr->value);
- // Check base uri for match
- if (draftUri.Match(UriType(kDraft04String), false)) return kDraft04;
- if (draftUri.Match(UriType(kDraft05String), false)) return kDraft05;
- if (draftUri.Match(UriType(kDraft06String), false)) return kDraft06;
- if (draftUri.Match(UriType(kDraft07String), false)) return kDraft07;
- if (draftUri.Match(UriType(kDraft03String), false)) return kDraft03;
- if (draftUri.Match(UriType(kDraft2019_09String), false)) return kDraft2019_09;
- if (draftUri.Match(UriType(kDraft2020_12String), false)) return kDraft2020_12;
- return kDraftUnknown;
- }
- // $schema not found
- return kDraftNone;
- }
-
-
- // Get open api version of any schema document
- static OpenApiVersion GetOpenApiVersion(const ValueType& document) {
- static const Ch kVersion20String[] = { '2', '.', '0', '\0' };
- static const Ch kVersion30String[] = { '3', '.', '0', '.', '\0' }; // ignore patch level
- static const Ch kVersion31String[] = { '3', '.', '1', '.', '\0' }; // ignore patch level
- static SizeType len = internal::StrLen<Ch>(kVersion30String);
-
- if (!document.IsObject()) {
- return kVersionNone;
- }
-
- // Get the open api version from the swagger / openapi keyword at the supplied location
- typename ValueType::ConstMemberIterator itr = document.FindMember(SchemaType::GetSwaggerString());
- if (itr == document.MemberEnd()) itr = document.FindMember(SchemaType::GetOpenApiString());
- if (itr != document.MemberEnd()) {
- if (!itr->value.IsString()) return kVersionUnknown;
- const ValueType kVersion20Value(kVersion20String);
- if (kVersion20Value == itr->value) return kVersion20; // must match 2.0 exactly
- const ValueType kVersion30Value(kVersion30String);
- if (itr->value.GetStringLength() > len && kVersion30Value == ValueType(itr->value.GetString(), len)) return kVersion30; // must match 3.0.x
- const ValueType kVersion31Value(kVersion31String);
- if (itr->value.GetStringLength() > len && kVersion31Value == ValueType(itr->value.GetString(), len)) return kVersion31; // must match 3.1.x
- return kVersionUnknown;
- }
- // swagger or openapi not found
- return kVersionNone;
- }
-
- // Get the draft of the schema or the open api version (which implies the draft).
- // Report an error if schema draft or open api version not supported or not recognized, or both in document, and carry on.
- void SetSchemaSpecification(const ValueType& document) {
- // Look for '$schema', 'swagger' or 'openapi' keyword at document root
- SchemaDraft docDraft = GetSchemaDraft(document);
- OpenApiVersion docOapi = GetOpenApiVersion(document);
- // Error if both in document
- if (docDraft != kDraftNone && docOapi != kVersionNone)
- SchemaError(kSchemaErrorSpecIllegal, PointerType());
- // Use document draft or open api version if present or use spec from constructor
- if (docDraft != kDraftNone)
- spec_ = Specification(docDraft);
- else if (docOapi != kVersionNone)
- spec_ = Specification(docOapi);
- // Error if draft or version unknown
- if (spec_.draft == kDraftUnknown || spec_.oapi == kVersionUnknown)
- SchemaError(kSchemaErrorSpecUnknown, PointerType());
- else if (!spec_.IsSupported())
- SchemaError(kSchemaErrorSpecUnsupported, PointerType());
- }
-
- // Changed by PR #1393
- void CreateSchemaRecursive(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) {
- if (v.GetType() == kObjectType) {
- UriType newid = UriType(CreateSchema(schema, pointer, v, document, id), allocator_);
-
- for (typename ValueType::ConstMemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr)
- CreateSchemaRecursive(0, pointer.Append(itr->name, allocator_), itr->value, document, newid);
- }
- else if (v.GetType() == kArrayType)
- for (SizeType i = 0; i < v.Size(); i++)
- CreateSchemaRecursive(0, pointer.Append(i, allocator_), v[i], document, id);
- }
-
- // Changed by PR #1393
- const UriType& CreateSchema(const SchemaType** schema, const PointerType& pointer, const ValueType& v, const ValueType& document, const UriType& id) {
- RAPIDJSON_ASSERT(pointer.IsValid());
- GenericStringBuffer<EncodingType> sb;
- pointer.StringifyUriFragment(sb);
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::CreateSchema", sb.GetString(), id.GetString());
- if (v.IsObject()) {
- if (const SchemaType* sc = GetSchema(pointer)) {
- if (schema)
- *schema = sc;
- AddSchemaRefs(const_cast<SchemaType*>(sc));
- }
- else if (!HandleRefSchema(pointer, schema, v, document, id)) {
- // The new schema constructor adds itself and its $ref(s) to schemaMap_
- SchemaType* s = new (allocator_->Malloc(sizeof(SchemaType))) SchemaType(this, pointer, v, document, allocator_, id);
- if (schema)
- *schema = s;
- return s->GetId();
- }
- }
- else {
- if (schema)
- *schema = typeless_;
- AddSchemaRefs(typeless_);
- }
- return id;
- }
-
- // Changed by PR #1393
- // TODO should this return a UriType& ?
- bool HandleRefSchema(const PointerType& source, const SchemaType** schema, const ValueType& v, const ValueType& document, const UriType& id) {
- typename ValueType::ConstMemberIterator itr = v.FindMember(SchemaType::GetRefString());
- if (itr == v.MemberEnd())
- return false;
-
- GenericStringBuffer<EncodingType> sb;
- source.StringifyUriFragment(sb);
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::HandleRefSchema", sb.GetString(), id.GetString());
- // Resolve the source pointer to the $ref'ed schema (finally)
- new (schemaRef_.template Push<SchemaRefPtr>()) SchemaRefPtr(&source);
-
- if (itr->value.IsString()) {
- SizeType len = itr->value.GetStringLength();
- if (len == 0)
- SchemaError(kSchemaErrorRefInvalid, source);
- else {
- // First resolve $ref against the in-scope id
- UriType scopeId = UriType(id, allocator_);
- UriType ref = UriType(itr->value, allocator_).Resolve(scopeId, allocator_);
- RAPIDJSON_SCHEMA_PRINT(SchemaIds, id.GetString(), itr->value.GetString(), ref.GetString());
- // See if the resolved $ref minus the fragment matches a resolved id in this document
- // Search from the root. Returns the subschema in the document and its absolute JSON pointer.
- PointerType basePointer = PointerType();
- const ValueType *base = FindId(document, ref, basePointer, docId_, false);
- if (!base) {
- // Remote reference - call the remote document provider
- if (!remoteProvider_)
- SchemaError(kSchemaErrorRefNoRemoteProvider, source);
- else {
- if (const GenericSchemaDocument* remoteDocument = remoteProvider_->GetRemoteDocument(ref, spec_)) {
- const Ch* s = ref.GetFragString();
- len = ref.GetFragStringLength();
- if (len <= 1 || s[1] == '/') {
- // JSON pointer fragment, absolute in the remote schema
- const PointerType pointer(s, len, allocator_);
- if (!pointer.IsValid())
- SchemaErrorPointer(kSchemaErrorRefPointerInvalid, source, s, len, pointer);
- else {
- // Get the subschema
- if (const SchemaType *sc = remoteDocument->GetSchema(pointer)) {
- if (schema)
- *schema = sc;
- AddSchemaRefs(const_cast<SchemaType *>(sc));
- return true;
- } else
- SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength());
- }
- } else
- // Plain name fragment, not allowed in remote schema
- SchemaErrorValue(kSchemaErrorRefPlainName, source, s, len);
- } else
- SchemaErrorValue(kSchemaErrorRefNoRemoteSchema, source, ref.GetString(), ref.GetStringLength());
- }
- }
- else { // Local reference
- const Ch* s = ref.GetFragString();
- len = ref.GetFragStringLength();
- if (len <= 1 || s[1] == '/') {
- // JSON pointer fragment, relative to the resolved URI
- const PointerType relPointer(s, len, allocator_);
- if (!relPointer.IsValid())
- SchemaErrorPointer(kSchemaErrorRefPointerInvalid, source, s, len, relPointer);
- else {
- // Get the subschema
- if (const ValueType *pv = relPointer.Get(*base)) {
- // Now get the absolute JSON pointer by adding relative to base
- PointerType pointer(basePointer, allocator_);
- for (SizeType i = 0; i < relPointer.GetTokenCount(); i++)
- pointer = pointer.Append(relPointer.GetTokens()[i], allocator_);
- if (IsCyclicRef(pointer))
- SchemaErrorValue(kSchemaErrorRefCyclical, source, ref.GetString(), ref.GetStringLength());
- else {
- // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
- // TODO: cache pointer <-> id mapping
- size_t unresolvedTokenIndex;
- scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_);
- CreateSchema(schema, pointer, *pv, document, scopeId);
- return true;
- }
- } else
- SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength());
- }
- } else {
- // Plain name fragment, relative to the resolved URI
- // Not supported in open api 2.0 and 3.0
- PointerType pointer(allocator_);
- if (spec_.oapi == kVersion20 || spec_.oapi == kVersion30)
- SchemaErrorValue(kSchemaErrorRefPlainName, source, s, len);
- // See if the fragment matches an id in this document.
- // Search from the base we just established. Returns the subschema in the document and its absolute JSON pointer.
- else if (const ValueType *pv = FindId(*base, ref, pointer, UriType(ref.GetBaseString(), ref.GetBaseStringLength(), allocator_), true, basePointer)) {
- if (IsCyclicRef(pointer))
- SchemaErrorValue(kSchemaErrorRefCyclical, source, ref.GetString(), ref.GetStringLength());
- else {
- // Call CreateSchema recursively, but first compute the in-scope id for the $ref target as we have jumped there
- // TODO: cache pointer <-> id mapping
- size_t unresolvedTokenIndex;
- scopeId = pointer.GetUri(document, docId_, &unresolvedTokenIndex, allocator_);
- CreateSchema(schema, pointer, *pv, document, scopeId);
- return true;
- }
- } else
- SchemaErrorValue(kSchemaErrorRefUnknown, source, ref.GetString(), ref.GetStringLength());
- }
- }
- }
- }
-
- // Invalid/Unknown $ref
- if (schema)
- *schema = typeless_;
- AddSchemaRefs(typeless_);
- return true;
- }
-
- //! Find the first subschema with a resolved 'id' that matches the specified URI.
- // If full specified use all URI else ignore fragment.
- // If found, return a pointer to the subschema and its JSON pointer.
- // TODO cache pointer <-> id mapping
- ValueType* FindId(const ValueType& doc, const UriType& finduri, PointerType& resptr, const UriType& baseuri, bool full, const PointerType& here = PointerType()) const {
- SizeType i = 0;
- ValueType* resval = 0;
- UriType tempuri = UriType(finduri, allocator_);
- UriType localuri = UriType(baseuri, allocator_);
- if (doc.GetType() == kObjectType) {
- // Establish the base URI of this object
- typename ValueType::ConstMemberIterator m = doc.FindMember(SchemaType::GetIdString());
- if (m != doc.MemberEnd() && m->value.GetType() == kStringType) {
- localuri = UriType(m->value, allocator_).Resolve(baseuri, allocator_);
- }
- // See if it matches
- if (localuri.Match(finduri, full)) {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::FindId (match)", full ? localuri.GetString() : localuri.GetBaseString());
- resval = const_cast<ValueType *>(&doc);
- resptr = here;
- return resval;
- }
- // No match, continue looking
- for (m = doc.MemberBegin(); m != doc.MemberEnd(); ++m) {
- if (m->value.GetType() == kObjectType || m->value.GetType() == kArrayType) {
- resval = FindId(m->value, finduri, resptr, localuri, full, here.Append(m->name.GetString(), m->name.GetStringLength(), allocator_));
- }
- if (resval) break;
- }
- } else if (doc.GetType() == kArrayType) {
- // Continue looking
- for (typename ValueType::ConstValueIterator v = doc.Begin(); v != doc.End(); ++v) {
- if (v->GetType() == kObjectType || v->GetType() == kArrayType) {
- resval = FindId(*v, finduri, resptr, localuri, full, here.Append(i, allocator_));
- }
- if (resval) break;
- i++;
- }
- }
- return resval;
- }
-
- // Added by PR #1393
- void AddSchemaRefs(SchemaType* schema) {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaDocument::AddSchemaRefs");
- while (!schemaRef_.Empty()) {
- SchemaRefPtr *ref = schemaRef_.template Pop<SchemaRefPtr>(1);
- SchemaEntry *entry = schemaMap_.template Push<SchemaEntry>();
- new (entry) SchemaEntry(**ref, schema, false, allocator_);
- }
- }
-
- // Added by PR #1393
- bool IsCyclicRef(const PointerType& pointer) const {
- for (const SchemaRefPtr* ref = schemaRef_.template Bottom<SchemaRefPtr>(); ref != schemaRef_.template End<SchemaRefPtr>(); ++ref)
- if (pointer == **ref)
- return true;
- return false;
- }
-
- const SchemaType* GetSchema(const PointerType& pointer) const {
- for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
- if (pointer == target->pointer)
- return target->schema;
- return 0;
- }
-
- PointerType GetPointer(const SchemaType* schema) const {
- for (const SchemaEntry* target = schemaMap_.template Bottom<SchemaEntry>(); target != schemaMap_.template End<SchemaEntry>(); ++target)
- if (schema == target->schema)
- return target->pointer;
- return PointerType();
- }
-
- const SchemaType* GetTypeless() const { return typeless_; }
-
- static const size_t kInitialSchemaMapSize = 64;
- static const size_t kInitialSchemaRefSize = 64;
-
- IRemoteSchemaDocumentProviderType* remoteProvider_;
- Allocator *allocator_;
- Allocator *ownAllocator_;
- const SchemaType* root_; //!< Root schema.
- SchemaType* typeless_;
- internal::Stack<Allocator> schemaMap_; // Stores created Pointer -> Schemas
- internal::Stack<Allocator> schemaRef_; // Stores Pointer(s) from $ref(s) until resolved
- GValue uri_; // Schema document URI
- UriType docId_;
- Specification spec_;
- GValue error_;
- GValue currentError_;
-};
-
-//! GenericSchemaDocument using Value type.
-typedef GenericSchemaDocument<Value> SchemaDocument;
-//! IGenericRemoteSchemaDocumentProvider using SchemaDocument.
-typedef IGenericRemoteSchemaDocumentProvider<SchemaDocument> IRemoteSchemaDocumentProvider;
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericSchemaValidator
-
-//! JSON Schema Validator.
-/*!
- A SAX style JSON schema validator.
- It uses a \c GenericSchemaDocument to validate SAX events.
- It delegates the incoming SAX events to an output handler.
- The default output handler does nothing.
- It can be reused multiple times by calling \c Reset().
-
- \tparam SchemaDocumentType Type of schema document.
- \tparam OutputHandler Type of output handler. Default handler does nothing.
- \tparam StateAllocator Allocator for storing the internal validation states.
-*/
-template <
- typename SchemaDocumentType,
- typename OutputHandler = BaseReaderHandler<typename SchemaDocumentType::SchemaType::EncodingType>,
- typename StateAllocator = CrtAllocator>
-class GenericSchemaValidator :
- public internal::ISchemaStateFactory<typename SchemaDocumentType::SchemaType>,
- public internal::ISchemaValidator,
- public internal::IValidationErrorHandler<typename SchemaDocumentType::SchemaType> {
-public:
- typedef typename SchemaDocumentType::SchemaType SchemaType;
- typedef typename SchemaDocumentType::PointerType PointerType;
- typedef typename SchemaType::EncodingType EncodingType;
- typedef typename SchemaType::SValue SValue;
- typedef typename EncodingType::Ch Ch;
- typedef GenericStringRef<Ch> StringRefType;
- typedef GenericValue<EncodingType, StateAllocator> ValueType;
-
- //! Constructor without output handler.
- /*!
- \param schemaDocument The schema document to conform to.
- \param allocator Optional allocator for storing internal validation states.
- \param schemaStackCapacity Optional initial capacity of schema path stack.
- \param documentStackCapacity Optional initial capacity of document path stack.
- */
- GenericSchemaValidator(
- const SchemaDocumentType& schemaDocument,
- StateAllocator* allocator = 0,
- size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
- size_t documentStackCapacity = kDefaultDocumentStackCapacity)
- :
- schemaDocument_(&schemaDocument),
- root_(schemaDocument.GetRoot()),
- stateAllocator_(allocator),
- ownStateAllocator_(0),
- schemaStack_(allocator, schemaStackCapacity),
- documentStack_(allocator, documentStackCapacity),
- outputHandler_(0),
- error_(kObjectType),
- currentError_(),
- missingDependents_(),
- valid_(true),
- flags_(kValidateDefaultFlags),
- depth_(0)
- {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator");
- }
-
- //! Constructor with output handler.
- /*!
- \param schemaDocument The schema document to conform to.
- \param allocator Optional allocator for storing internal validation states.
- \param schemaStackCapacity Optional initial capacity of schema path stack.
- \param documentStackCapacity Optional initial capacity of document path stack.
- */
- GenericSchemaValidator(
- const SchemaDocumentType& schemaDocument,
- OutputHandler& outputHandler,
- StateAllocator* allocator = 0,
- size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
- size_t documentStackCapacity = kDefaultDocumentStackCapacity)
- :
- schemaDocument_(&schemaDocument),
- root_(schemaDocument.GetRoot()),
- stateAllocator_(allocator),
- ownStateAllocator_(0),
- schemaStack_(allocator, schemaStackCapacity),
- documentStack_(allocator, documentStackCapacity),
- outputHandler_(&outputHandler),
- error_(kObjectType),
- currentError_(),
- missingDependents_(),
- valid_(true),
- flags_(kValidateDefaultFlags),
- depth_(0)
- {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator (output handler)");
- }
-
- //! Destructor.
- ~GenericSchemaValidator() {
- Reset();
- RAPIDJSON_DELETE(ownStateAllocator_);
- }
-
- //! Reset the internal states.
- void Reset() {
- while (!schemaStack_.Empty())
- PopSchema();
- documentStack_.Clear();
- ResetError();
- }
-
- //! Reset the error state.
- void ResetError() {
- error_.SetObject();
- currentError_.SetNull();
- missingDependents_.SetNull();
- valid_ = true;
- }
-
- //! Implementation of ISchemaValidator
- void SetValidateFlags(unsigned flags) {
- flags_ = flags;
- }
- virtual unsigned GetValidateFlags() const {
- return flags_;
- }
-
- virtual bool IsValid() const {
- if (!valid_) return false;
- if (GetContinueOnErrors() && !error_.ObjectEmpty()) return false;
- return true;
- }
- //! End of Implementation of ISchemaValidator
-
- //! Gets the error object.
- ValueType& GetError() { return error_; }
- const ValueType& GetError() const { return error_; }
-
- //! Gets the JSON pointer pointed to the invalid schema.
- // If reporting all errors, the stack will be empty.
- PointerType GetInvalidSchemaPointer() const {
- return schemaStack_.Empty() ? PointerType() : CurrentSchema().GetPointer();
- }
-
- //! Gets the keyword of invalid schema.
- // If reporting all errors, the stack will be empty, so return "errors".
- const Ch* GetInvalidSchemaKeyword() const {
- if (!schemaStack_.Empty()) return CurrentContext().invalidKeyword;
- if (GetContinueOnErrors() && !error_.ObjectEmpty()) return (const Ch*)GetErrorsString();
- return 0;
- }
-
- //! Gets the error code of invalid schema.
- // If reporting all errors, the stack will be empty, so return kValidateErrors.
- ValidateErrorCode GetInvalidSchemaCode() const {
- if (!schemaStack_.Empty()) return CurrentContext().invalidCode;
- if (GetContinueOnErrors() && !error_.ObjectEmpty()) return kValidateErrors;
- return kValidateErrorNone;
- }
-
- //! Gets the JSON pointer pointed to the invalid value.
- // If reporting all errors, the stack will be empty.
- PointerType GetInvalidDocumentPointer() const {
- if (documentStack_.Empty()) {
- return PointerType();
- }
- else {
- return PointerType(documentStack_.template Bottom<Ch>(), documentStack_.GetSize() / sizeof(Ch));
- }
- }
-
- void NotMultipleOf(int64_t actual, const SValue& expected) {
- AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected);
- }
- void NotMultipleOf(uint64_t actual, const SValue& expected) {
- AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected);
- }
- void NotMultipleOf(double actual, const SValue& expected) {
- AddNumberError(kValidateErrorMultipleOf, ValueType(actual).Move(), expected);
- }
- void AboveMaximum(int64_t actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
- }
- void AboveMaximum(uint64_t actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
- }
- void AboveMaximum(double actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMaximum : kValidateErrorMaximum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMaximumString : 0);
- }
- void BelowMinimum(int64_t actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
- }
- void BelowMinimum(uint64_t actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
- }
- void BelowMinimum(double actual, const SValue& expected, bool exclusive) {
- AddNumberError(exclusive ? kValidateErrorExclusiveMinimum : kValidateErrorMinimum, ValueType(actual).Move(), expected,
- exclusive ? &SchemaType::GetExclusiveMinimumString : 0);
- }
-
- void TooLong(const Ch* str, SizeType length, SizeType expected) {
- AddNumberError(kValidateErrorMaxLength,
- ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move());
- }
- void TooShort(const Ch* str, SizeType length, SizeType expected) {
- AddNumberError(kValidateErrorMinLength,
- ValueType(str, length, GetStateAllocator()).Move(), SValue(expected).Move());
- }
- void DoesNotMatch(const Ch* str, SizeType length) {
- currentError_.SetObject();
- currentError_.AddMember(GetActualString(), ValueType(str, length, GetStateAllocator()).Move(), GetStateAllocator());
- AddCurrentError(kValidateErrorPattern);
- }
-
- void DisallowedItem(SizeType index) {
- currentError_.SetObject();
- currentError_.AddMember(GetDisallowedString(), ValueType(index).Move(), GetStateAllocator());
- AddCurrentError(kValidateErrorAdditionalItems, true);
- }
- void TooFewItems(SizeType actualCount, SizeType expectedCount) {
- AddNumberError(kValidateErrorMinItems,
- ValueType(actualCount).Move(), SValue(expectedCount).Move());
- }
- void TooManyItems(SizeType actualCount, SizeType expectedCount) {
- AddNumberError(kValidateErrorMaxItems,
- ValueType(actualCount).Move(), SValue(expectedCount).Move());
- }
- void DuplicateItems(SizeType index1, SizeType index2) {
- ValueType duplicates(kArrayType);
- duplicates.PushBack(index1, GetStateAllocator());
- duplicates.PushBack(index2, GetStateAllocator());
- currentError_.SetObject();
- currentError_.AddMember(GetDuplicatesString(), duplicates, GetStateAllocator());
- AddCurrentError(kValidateErrorUniqueItems, true);
- }
-
- void TooManyProperties(SizeType actualCount, SizeType expectedCount) {
- AddNumberError(kValidateErrorMaxProperties,
- ValueType(actualCount).Move(), SValue(expectedCount).Move());
- }
- void TooFewProperties(SizeType actualCount, SizeType expectedCount) {
- AddNumberError(kValidateErrorMinProperties,
- ValueType(actualCount).Move(), SValue(expectedCount).Move());
- }
- void StartMissingProperties() {
- currentError_.SetArray();
- }
- void AddMissingProperty(const SValue& name) {
- currentError_.PushBack(ValueType(name, GetStateAllocator()).Move(), GetStateAllocator());
- }
- bool EndMissingProperties() {
- if (currentError_.Empty())
- return false;
- ValueType error(kObjectType);
- error.AddMember(GetMissingString(), currentError_, GetStateAllocator());
- currentError_ = error;
- AddCurrentError(kValidateErrorRequired);
- return true;
- }
- void PropertyViolations(ISchemaValidator** subvalidators, SizeType count) {
- for (SizeType i = 0; i < count; ++i)
- MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
- }
- void DisallowedProperty(const Ch* name, SizeType length) {
- currentError_.SetObject();
- currentError_.AddMember(GetDisallowedString(), ValueType(name, length, GetStateAllocator()).Move(), GetStateAllocator());
- AddCurrentError(kValidateErrorAdditionalProperties, true);
- }
-
- void StartDependencyErrors() {
- currentError_.SetObject();
- }
- void StartMissingDependentProperties() {
- missingDependents_.SetArray();
- }
- void AddMissingDependentProperty(const SValue& targetName) {
- missingDependents_.PushBack(ValueType(targetName, GetStateAllocator()).Move(), GetStateAllocator());
- }
- void EndMissingDependentProperties(const SValue& sourceName) {
- if (!missingDependents_.Empty()) {
- // Create equivalent 'required' error
- ValueType error(kObjectType);
- ValidateErrorCode code = kValidateErrorRequired;
- error.AddMember(GetMissingString(), missingDependents_.Move(), GetStateAllocator());
- AddErrorCode(error, code);
- AddErrorInstanceLocation(error, false);
- // When appending to a pointer ensure its allocator is used
- PointerType schemaRef = GetInvalidSchemaPointer().Append(SchemaType::GetValidateErrorKeyword(kValidateErrorDependencies), &GetInvalidSchemaPointer().GetAllocator());
- AddErrorSchemaLocation(error, schemaRef.Append(sourceName.GetString(), sourceName.GetStringLength(), &GetInvalidSchemaPointer().GetAllocator()));
- ValueType wrapper(kObjectType);
- wrapper.AddMember(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator()).Move(), error, GetStateAllocator());
- currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(), wrapper, GetStateAllocator());
- }
- }
- void AddDependencySchemaError(const SValue& sourceName, ISchemaValidator* subvalidator) {
- currentError_.AddMember(ValueType(sourceName, GetStateAllocator()).Move(),
- static_cast<GenericSchemaValidator*>(subvalidator)->GetError(), GetStateAllocator());
- }
- bool EndDependencyErrors() {
- if (currentError_.ObjectEmpty())
- return false;
- ValueType error(kObjectType);
- error.AddMember(GetErrorsString(), currentError_, GetStateAllocator());
- currentError_ = error;
- AddCurrentError(kValidateErrorDependencies);
- return true;
- }
-
- void DisallowedValue(const ValidateErrorCode code = kValidateErrorEnum) {
- currentError_.SetObject();
- AddCurrentError(code);
- }
- void StartDisallowedType() {
- currentError_.SetArray();
- }
- void AddExpectedType(const typename SchemaType::ValueType& expectedType) {
- currentError_.PushBack(ValueType(expectedType, GetStateAllocator()).Move(), GetStateAllocator());
- }
- void EndDisallowedType(const typename SchemaType::ValueType& actualType) {
- ValueType error(kObjectType);
- error.AddMember(GetExpectedString(), currentError_, GetStateAllocator());
- error.AddMember(GetActualString(), ValueType(actualType, GetStateAllocator()).Move(), GetStateAllocator());
- currentError_ = error;
- AddCurrentError(kValidateErrorType);
- }
- void NotAllOf(ISchemaValidator** subvalidators, SizeType count) {
- // Treat allOf like oneOf and anyOf to match https://rapidjson.org/md_doc_schema.html#allOf-anyOf-oneOf
- AddErrorArray(kValidateErrorAllOf, subvalidators, count);
- //for (SizeType i = 0; i < count; ++i) {
- // MergeError(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError());
- //}
- }
- void NoneOf(ISchemaValidator** subvalidators, SizeType count) {
- AddErrorArray(kValidateErrorAnyOf, subvalidators, count);
- }
- void NotOneOf(ISchemaValidator** subvalidators, SizeType count) {
- AddErrorArray(kValidateErrorOneOf, subvalidators, count);
- }
- void MultipleOneOf(SizeType index1, SizeType index2) {
- ValueType matches(kArrayType);
- matches.PushBack(index1, GetStateAllocator());
- matches.PushBack(index2, GetStateAllocator());
- currentError_.SetObject();
- currentError_.AddMember(GetMatchesString(), matches, GetStateAllocator());
- AddCurrentError(kValidateErrorOneOfMatch);
- }
- void Disallowed() {
- currentError_.SetObject();
- AddCurrentError(kValidateErrorNot);
- }
- void DisallowedWhenWriting() {
- currentError_.SetObject();
- AddCurrentError(kValidateErrorReadOnly);
- }
- void DisallowedWhenReading() {
- currentError_.SetObject();
- AddCurrentError(kValidateErrorWriteOnly);
- }
-
-#define RAPIDJSON_STRING_(name, ...) \
- static const StringRefType& Get##name##String() {\
- static const Ch s[] = { __VA_ARGS__, '\0' };\
- static const StringRefType v(s, static_cast<SizeType>(sizeof(s) / sizeof(Ch) - 1)); \
- return v;\
- }
-
- RAPIDJSON_STRING_(InstanceRef, 'i', 'n', 's', 't', 'a', 'n', 'c', 'e', 'R', 'e', 'f')
- RAPIDJSON_STRING_(SchemaRef, 's', 'c', 'h', 'e', 'm', 'a', 'R', 'e', 'f')
- RAPIDJSON_STRING_(Expected, 'e', 'x', 'p', 'e', 'c', 't', 'e', 'd')
- RAPIDJSON_STRING_(Actual, 'a', 'c', 't', 'u', 'a', 'l')
- RAPIDJSON_STRING_(Disallowed, 'd', 'i', 's', 'a', 'l', 'l', 'o', 'w', 'e', 'd')
- RAPIDJSON_STRING_(Missing, 'm', 'i', 's', 's', 'i', 'n', 'g')
- RAPIDJSON_STRING_(Errors, 'e', 'r', 'r', 'o', 'r', 's')
- RAPIDJSON_STRING_(ErrorCode, 'e', 'r', 'r', 'o', 'r', 'C', 'o', 'd', 'e')
- RAPIDJSON_STRING_(ErrorMessage, 'e', 'r', 'r', 'o', 'r', 'M', 'e', 's', 's', 'a', 'g', 'e')
- RAPIDJSON_STRING_(Duplicates, 'd', 'u', 'p', 'l', 'i', 'c', 'a', 't', 'e', 's')
- RAPIDJSON_STRING_(Matches, 'm', 'a', 't', 'c', 'h', 'e', 's')
-
-#undef RAPIDJSON_STRING_
-
-#define RAPIDJSON_SCHEMA_HANDLE_BEGIN_(method, arg1)\
- if (!valid_) return false; \
- if ((!BeginValue() && !GetContinueOnErrors()) || (!CurrentSchema().method arg1 && !GetContinueOnErrors())) {\
- *documentStack_.template Push<Ch>() = '\0';\
- documentStack_.template Pop<Ch>(1);\
- RAPIDJSON_SCHEMA_PRINT(InvalidDocument, documentStack_.template Bottom<Ch>());\
- valid_ = false;\
- return valid_;\
- }
-
-#define RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2)\
- for (Context* context = schemaStack_.template Bottom<Context>(); context != schemaStack_.template End<Context>(); context++) {\
- if (context->hasher)\
- static_cast<HasherType*>(context->hasher)->method arg2;\
- if (context->validators)\
- for (SizeType i_ = 0; i_ < context->validatorCount; i_++)\
- static_cast<GenericSchemaValidator*>(context->validators[i_])->method arg2;\
- if (context->patternPropertiesValidators)\
- for (SizeType i_ = 0; i_ < context->patternPropertiesValidatorCount; i_++)\
- static_cast<GenericSchemaValidator*>(context->patternPropertiesValidators[i_])->method arg2;\
- }
-
-#define RAPIDJSON_SCHEMA_HANDLE_END_(method, arg2)\
- valid_ = (EndValue() || GetContinueOnErrors()) && (!outputHandler_ || outputHandler_->method arg2);\
- return valid_;
-
-#define RAPIDJSON_SCHEMA_HANDLE_VALUE_(method, arg1, arg2) \
- RAPIDJSON_SCHEMA_HANDLE_BEGIN_ (method, arg1);\
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(method, arg2);\
- RAPIDJSON_SCHEMA_HANDLE_END_ (method, arg2)
-
- bool Null() { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Null, (CurrentContext()), ( )); }
- bool Bool(bool b) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Bool, (CurrentContext(), b), (b)); }
- bool Int(int i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int, (CurrentContext(), i), (i)); }
- bool Uint(unsigned u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint, (CurrentContext(), u), (u)); }
- bool Int64(int64_t i) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Int64, (CurrentContext(), i), (i)); }
- bool Uint64(uint64_t u) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Uint64, (CurrentContext(), u), (u)); }
- bool Double(double d) { RAPIDJSON_SCHEMA_HANDLE_VALUE_(Double, (CurrentContext(), d), (d)); }
- bool RawNumber(const Ch* str, SizeType length, bool copy)
- { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
- bool String(const Ch* str, SizeType length, bool copy)
- { RAPIDJSON_SCHEMA_HANDLE_VALUE_(String, (CurrentContext(), str, length, copy), (str, length, copy)); }
-
- bool StartObject() {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::StartObject");
- RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartObject, (CurrentContext()));
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartObject, ());
- valid_ = !outputHandler_ || outputHandler_->StartObject();
- return valid_;
- }
-
- bool Key(const Ch* str, SizeType len, bool copy) {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::Key", str);
- if (!valid_) return false;
- AppendToken(str, len);
- if (!CurrentSchema().Key(CurrentContext(), str, len, copy) && !GetContinueOnErrors()) {
- valid_ = false;
- return valid_;
- }
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(Key, (str, len, copy));
- valid_ = !outputHandler_ || outputHandler_->Key(str, len, copy);
- return valid_;
- }
-
- bool EndObject(SizeType memberCount) {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndObject");
- if (!valid_) return false;
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndObject, (memberCount));
- if (!CurrentSchema().EndObject(CurrentContext(), memberCount) && !GetContinueOnErrors()) {
- valid_ = false;
- return valid_;
- }
- RAPIDJSON_SCHEMA_HANDLE_END_(EndObject, (memberCount));
- }
-
- bool StartArray() {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::StartArray");
- RAPIDJSON_SCHEMA_HANDLE_BEGIN_(StartArray, (CurrentContext()));
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(StartArray, ());
- valid_ = !outputHandler_ || outputHandler_->StartArray();
- return valid_;
- }
-
- bool EndArray(SizeType elementCount) {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndArray");
- if (!valid_) return false;
- RAPIDJSON_SCHEMA_HANDLE_PARALLEL_(EndArray, (elementCount));
- if (!CurrentSchema().EndArray(CurrentContext(), elementCount) && !GetContinueOnErrors()) {
- valid_ = false;
- return valid_;
- }
- RAPIDJSON_SCHEMA_HANDLE_END_(EndArray, (elementCount));
- }
-
-#undef RAPIDJSON_SCHEMA_HANDLE_BEGIN_
-#undef RAPIDJSON_SCHEMA_HANDLE_PARALLEL_
-#undef RAPIDJSON_SCHEMA_HANDLE_VALUE_
-
- // Implementation of ISchemaStateFactory<SchemaType>
- virtual ISchemaValidator* CreateSchemaValidator(const SchemaType& root, const bool inheritContinueOnErrors) {
- *documentStack_.template Push<Ch>() = '\0';
- documentStack_.template Pop<Ch>(1);
- ISchemaValidator* sv = new (GetStateAllocator().Malloc(sizeof(GenericSchemaValidator))) GenericSchemaValidator(*schemaDocument_, root, documentStack_.template Bottom<char>(), documentStack_.GetSize(),
- depth_ + 1,
- &GetStateAllocator());
- sv->SetValidateFlags(inheritContinueOnErrors ? GetValidateFlags() : GetValidateFlags() & ~(unsigned)kValidateContinueOnErrorFlag);
- return sv;
- }
-
- virtual void DestroySchemaValidator(ISchemaValidator* validator) {
- GenericSchemaValidator* v = static_cast<GenericSchemaValidator*>(validator);
- v->~GenericSchemaValidator();
- StateAllocator::Free(v);
- }
-
- virtual void* CreateHasher() {
- return new (GetStateAllocator().Malloc(sizeof(HasherType))) HasherType(&GetStateAllocator());
- }
-
- virtual uint64_t GetHashCode(void* hasher) {
- return static_cast<HasherType*>(hasher)->GetHashCode();
- }
-
- virtual void DestroryHasher(void* hasher) {
- HasherType* h = static_cast<HasherType*>(hasher);
- h->~HasherType();
- StateAllocator::Free(h);
- }
-
- virtual void* MallocState(size_t size) {
- return GetStateAllocator().Malloc(size);
- }
-
- virtual void FreeState(void* p) {
- StateAllocator::Free(p);
- }
- // End of implementation of ISchemaStateFactory<SchemaType>
-
-private:
- typedef typename SchemaType::Context Context;
- typedef GenericValue<UTF8<>, StateAllocator> HashCodeArray;
- typedef internal::Hasher<EncodingType, StateAllocator> HasherType;
-
- GenericSchemaValidator(
- const SchemaDocumentType& schemaDocument,
- const SchemaType& root,
- const char* basePath, size_t basePathSize,
- unsigned depth,
- StateAllocator* allocator = 0,
- size_t schemaStackCapacity = kDefaultSchemaStackCapacity,
- size_t documentStackCapacity = kDefaultDocumentStackCapacity)
- :
- schemaDocument_(&schemaDocument),
- root_(root),
- stateAllocator_(allocator),
- ownStateAllocator_(0),
- schemaStack_(allocator, schemaStackCapacity),
- documentStack_(allocator, documentStackCapacity),
- outputHandler_(0),
- error_(kObjectType),
- currentError_(),
- missingDependents_(),
- valid_(true),
- flags_(kValidateDefaultFlags),
- depth_(depth)
- {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::GenericSchemaValidator (internal)", basePath && basePathSize ? basePath : "");
- if (basePath && basePathSize)
- memcpy(documentStack_.template Push<char>(basePathSize), basePath, basePathSize);
- }
-
- StateAllocator& GetStateAllocator() {
- if (!stateAllocator_)
- stateAllocator_ = ownStateAllocator_ = RAPIDJSON_NEW(StateAllocator)();
- return *stateAllocator_;
- }
-
- bool GetContinueOnErrors() const {
- return flags_ & kValidateContinueOnErrorFlag;
- }
-
- bool BeginValue() {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::BeginValue");
- if (schemaStack_.Empty())
- PushSchema(root_);
- else {
- if (CurrentContext().inArray)
- internal::TokenHelper<internal::Stack<StateAllocator>, Ch>::AppendIndexToken(documentStack_, CurrentContext().arrayElementIndex);
-
- if (!CurrentSchema().BeginValue(CurrentContext()) && !GetContinueOnErrors())
- return false;
-
- SizeType count = CurrentContext().patternPropertiesSchemaCount;
- const SchemaType** sa = CurrentContext().patternPropertiesSchemas;
- typename Context::PatternValidatorType patternValidatorType = CurrentContext().valuePatternValidatorType;
- bool valueUniqueness = CurrentContext().valueUniqueness;
- RAPIDJSON_ASSERT(CurrentContext().valueSchema);
- PushSchema(*CurrentContext().valueSchema);
-
- if (count > 0) {
- CurrentContext().objectPatternValidatorType = patternValidatorType;
- ISchemaValidator**& va = CurrentContext().patternPropertiesValidators;
- SizeType& validatorCount = CurrentContext().patternPropertiesValidatorCount;
- va = static_cast<ISchemaValidator**>(MallocState(sizeof(ISchemaValidator*) * count));
- std::memset(va, 0, sizeof(ISchemaValidator*) * count);
- for (SizeType i = 0; i < count; i++)
- va[validatorCount++] = CreateSchemaValidator(*sa[i], true); // Inherit continueOnError
- }
-
- CurrentContext().arrayUniqueness = valueUniqueness;
- }
- return true;
- }
-
- bool EndValue() {
- RAPIDJSON_SCHEMA_PRINT(Method, "GenericSchemaValidator::EndValue");
- if (!CurrentSchema().EndValue(CurrentContext()) && !GetContinueOnErrors())
- return false;
-
- GenericStringBuffer<EncodingType> sb;
- schemaDocument_->GetPointer(&CurrentSchema()).StringifyUriFragment(sb);
- *documentStack_.template Push<Ch>() = '\0';
- documentStack_.template Pop<Ch>(1);
- RAPIDJSON_SCHEMA_PRINT(ValidatorPointers, sb.GetString(), documentStack_.template Bottom<Ch>(), depth_);
- void* hasher = CurrentContext().hasher;
- uint64_t h = hasher && CurrentContext().arrayUniqueness ? static_cast<HasherType*>(hasher)->GetHashCode() : 0;
-
- PopSchema();
-
- if (!schemaStack_.Empty()) {
- Context& context = CurrentContext();
- // Only check uniqueness if there is a hasher
- if (hasher && context.valueUniqueness) {
- HashCodeArray* a = static_cast<HashCodeArray*>(context.arrayElementHashCodes);
- if (!a)
- CurrentContext().arrayElementHashCodes = a = new (GetStateAllocator().Malloc(sizeof(HashCodeArray))) HashCodeArray(kArrayType);
- for (typename HashCodeArray::ConstValueIterator itr = a->Begin(); itr != a->End(); ++itr)
- if (itr->GetUint64() == h) {
- DuplicateItems(static_cast<SizeType>(itr - a->Begin()), a->Size());
- // Cleanup before returning if continuing
- if (GetContinueOnErrors()) {
- a->PushBack(h, GetStateAllocator());
- while (!documentStack_.Empty() && *documentStack_.template Pop<Ch>(1) != '/');
- }
- RAPIDJSON_INVALID_KEYWORD_RETURN(kValidateErrorUniqueItems);
- }
- a->PushBack(h, GetStateAllocator());
- }
- }
-
- // Remove the last token of document pointer
- while (!documentStack_.Empty() && *documentStack_.template Pop<Ch>(1) != '/')
- ;
-
- return true;
- }
-
- void AppendToken(const Ch* str, SizeType len) {
- documentStack_.template Reserve<Ch>(1 + len * 2); // worst case all characters are escaped as two characters
- *documentStack_.template PushUnsafe<Ch>() = '/';
- for (SizeType i = 0; i < len; i++) {
- if (str[i] == '~') {
- *documentStack_.template PushUnsafe<Ch>() = '~';
- *documentStack_.template PushUnsafe<Ch>() = '0';
- }
- else if (str[i] == '/') {
- *documentStack_.template PushUnsafe<Ch>() = '~';
- *documentStack_.template PushUnsafe<Ch>() = '1';
- }
- else
- *documentStack_.template PushUnsafe<Ch>() = str[i];
- }
- }
-
- RAPIDJSON_FORCEINLINE void PushSchema(const SchemaType& schema) { new (schemaStack_.template Push<Context>()) Context(*this, *this, &schema, flags_); }
-
- RAPIDJSON_FORCEINLINE void PopSchema() {
- Context* c = schemaStack_.template Pop<Context>(1);
- if (HashCodeArray* a = static_cast<HashCodeArray*>(c->arrayElementHashCodes)) {
- a->~HashCodeArray();
- StateAllocator::Free(a);
- }
- c->~Context();
- }
-
- void AddErrorInstanceLocation(ValueType& result, bool parent) {
- GenericStringBuffer<EncodingType> sb;
- PointerType instancePointer = GetInvalidDocumentPointer();
- ((parent && instancePointer.GetTokenCount() > 0)
- ? PointerType(instancePointer.GetTokens(), instancePointer.GetTokenCount() - 1)
- : instancePointer).StringifyUriFragment(sb);
- ValueType instanceRef(sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)),
- GetStateAllocator());
- result.AddMember(GetInstanceRefString(), instanceRef, GetStateAllocator());
- }
-
- void AddErrorSchemaLocation(ValueType& result, PointerType schema = PointerType()) {
- GenericStringBuffer<EncodingType> sb;
- SizeType len = CurrentSchema().GetURI().GetStringLength();
- if (len) memcpy(sb.Push(len), CurrentSchema().GetURI().GetString(), len * sizeof(Ch));
- if (schema.GetTokenCount()) schema.StringifyUriFragment(sb);
- else GetInvalidSchemaPointer().StringifyUriFragment(sb);
- ValueType schemaRef(sb.GetString(), static_cast<SizeType>(sb.GetSize() / sizeof(Ch)),
- GetStateAllocator());
- result.AddMember(GetSchemaRefString(), schemaRef, GetStateAllocator());
- }
-
- void AddErrorCode(ValueType& result, const ValidateErrorCode code) {
- result.AddMember(GetErrorCodeString(), code, GetStateAllocator());
- }
-
- void AddError(ValueType& keyword, ValueType& error) {
- typename ValueType::MemberIterator member = error_.FindMember(keyword);
- if (member == error_.MemberEnd())
- error_.AddMember(keyword, error, GetStateAllocator());
- else {
- if (member->value.IsObject()) {
- ValueType errors(kArrayType);
- errors.PushBack(member->value, GetStateAllocator());
- member->value = errors;
- }
- member->value.PushBack(error, GetStateAllocator());
- }
- }
-
- void AddCurrentError(const ValidateErrorCode code, bool parent = false) {
- AddErrorCode(currentError_, code);
- AddErrorInstanceLocation(currentError_, parent);
- AddErrorSchemaLocation(currentError_);
- AddError(ValueType(SchemaType::GetValidateErrorKeyword(code), GetStateAllocator(), false).Move(), currentError_);
- }
-
- void MergeError(ValueType& other) {
- for (typename ValueType::MemberIterator it = other.MemberBegin(), end = other.MemberEnd(); it != end; ++it) {
- AddError(it->name, it->value);
- }
- }
-
- void AddNumberError(const ValidateErrorCode code, ValueType& actual, const SValue& expected,
- const typename SchemaType::ValueType& (*exclusive)() = 0) {
- currentError_.SetObject();
- currentError_.AddMember(GetActualString(), actual, GetStateAllocator());
- currentError_.AddMember(GetExpectedString(), ValueType(expected, GetStateAllocator()).Move(), GetStateAllocator());
- if (exclusive)
- currentError_.AddMember(ValueType(exclusive(), GetStateAllocator()).Move(), true, GetStateAllocator());
- AddCurrentError(code);
- }
-
- void AddErrorArray(const ValidateErrorCode code,
- ISchemaValidator** subvalidators, SizeType count) {
- ValueType errors(kArrayType);
- for (SizeType i = 0; i < count; ++i)
- errors.PushBack(static_cast<GenericSchemaValidator*>(subvalidators[i])->GetError(), GetStateAllocator());
- currentError_.SetObject();
- currentError_.AddMember(GetErrorsString(), errors, GetStateAllocator());
- AddCurrentError(code);
- }
-
- const SchemaType& CurrentSchema() const { return *schemaStack_.template Top<Context>()->schema; }
- Context& CurrentContext() { return *schemaStack_.template Top<Context>(); }
- const Context& CurrentContext() const { return *schemaStack_.template Top<Context>(); }
-
- static const size_t kDefaultSchemaStackCapacity = 1024;
- static const size_t kDefaultDocumentStackCapacity = 256;
- const SchemaDocumentType* schemaDocument_;
- const SchemaType& root_;
- StateAllocator* stateAllocator_;
- StateAllocator* ownStateAllocator_;
- internal::Stack<StateAllocator> schemaStack_; //!< stack to store the current path of schema (BaseSchemaType *)
- internal::Stack<StateAllocator> documentStack_; //!< stack to store the current path of validating document (Ch)
- OutputHandler* outputHandler_;
- ValueType error_;
- ValueType currentError_;
- ValueType missingDependents_;
- bool valid_;
- unsigned flags_;
- unsigned depth_;
-};
-
-typedef GenericSchemaValidator<SchemaDocument> SchemaValidator;
-
-///////////////////////////////////////////////////////////////////////////////
-// SchemaValidatingReader
-
-//! A helper class for parsing with validation.
-/*!
- This helper class is a functor, designed as a parameter of \ref GenericDocument::Populate().
-
- \tparam parseFlags Combination of \ref ParseFlag.
- \tparam InputStream Type of input stream, implementing Stream concept.
- \tparam SourceEncoding Encoding of the input stream.
- \tparam SchemaDocumentType Type of schema document.
- \tparam StackAllocator Allocator type for stack.
-*/
-template <
- unsigned parseFlags,
- typename InputStream,
- typename SourceEncoding,
- typename SchemaDocumentType = SchemaDocument,
- typename StackAllocator = CrtAllocator>
-class SchemaValidatingReader {
-public:
- typedef typename SchemaDocumentType::PointerType PointerType;
- typedef typename InputStream::Ch Ch;
- typedef GenericValue<SourceEncoding, StackAllocator> ValueType;
-
- //! Constructor
- /*!
- \param is Input stream.
- \param sd Schema document.
- */
- SchemaValidatingReader(InputStream& is, const SchemaDocumentType& sd) : is_(is), sd_(sd), invalidSchemaKeyword_(), invalidSchemaCode_(kValidateErrorNone), error_(kObjectType), isValid_(true) {}
-
- template <typename Handler>
- bool operator()(Handler& handler) {
- GenericReader<SourceEncoding, typename SchemaDocumentType::EncodingType, StackAllocator> reader;
- GenericSchemaValidator<SchemaDocumentType, Handler> validator(sd_, handler);
- parseResult_ = reader.template Parse<parseFlags>(is_, validator);
-
- isValid_ = validator.IsValid();
- if (isValid_) {
- invalidSchemaPointer_ = PointerType();
- invalidSchemaKeyword_ = 0;
- invalidDocumentPointer_ = PointerType();
- error_.SetObject();
- }
- else {
- invalidSchemaPointer_ = validator.GetInvalidSchemaPointer();
- invalidSchemaKeyword_ = validator.GetInvalidSchemaKeyword();
- invalidSchemaCode_ = validator.GetInvalidSchemaCode();
- invalidDocumentPointer_ = validator.GetInvalidDocumentPointer();
- error_.CopyFrom(validator.GetError(), allocator_);
- }
-
- return parseResult_;
- }
-
- const ParseResult& GetParseResult() const { return parseResult_; }
- bool IsValid() const { return isValid_; }
- const PointerType& GetInvalidSchemaPointer() const { return invalidSchemaPointer_; }
- const Ch* GetInvalidSchemaKeyword() const { return invalidSchemaKeyword_; }
- const PointerType& GetInvalidDocumentPointer() const { return invalidDocumentPointer_; }
- const ValueType& GetError() const { return error_; }
- ValidateErrorCode GetInvalidSchemaCode() const { return invalidSchemaCode_; }
-
-private:
- InputStream& is_;
- const SchemaDocumentType& sd_;
-
- ParseResult parseResult_;
- PointerType invalidSchemaPointer_;
- const Ch* invalidSchemaKeyword_;
- PointerType invalidDocumentPointer_;
- ValidateErrorCode invalidSchemaCode_;
- StackAllocator allocator_;
- ValueType error_;
- bool isValid_;
-};
-
-RAPIDJSON_NAMESPACE_END
-RAPIDJSON_DIAG_POP
-
-#endif // RAPIDJSON_SCHEMA_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stream.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stream.h
deleted file mode 100644
index 1fd70915c5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stream.h
+++ /dev/null
@@ -1,223 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "rapidjson.h"
-
-#ifndef RAPIDJSON_STREAM_H_
-#define RAPIDJSON_STREAM_H_
-
-#include "encodings.h"
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// Stream
-
-/*! \class rapidjson::Stream
- \brief Concept for reading and writing characters.
-
- For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd().
-
- For write-only stream, only need to implement Put() and Flush().
-
-\code
-concept Stream {
- typename Ch; //!< Character type of the stream.
-
- //! Read the current character from stream without moving the read cursor.
- Ch Peek() const;
-
- //! Read the current character from stream and moving the read cursor to next character.
- Ch Take();
-
- //! Get the current read cursor.
- //! \return Number of characters read from start.
- size_t Tell();
-
- //! Begin writing operation at the current read pointer.
- //! \return The begin writer pointer.
- Ch* PutBegin();
-
- //! Write a character.
- void Put(Ch c);
-
- //! Flush the buffer.
- void Flush();
-
- //! End the writing operation.
- //! \param begin The begin write pointer returned by PutBegin().
- //! \return Number of characters written.
- size_t PutEnd(Ch* begin);
-}
-\endcode
-*/
-
-//! Provides additional information for stream.
-/*!
- By using traits pattern, this type provides a default configuration for stream.
- For custom stream, this type can be specialized for other configuration.
- See TEST(Reader, CustomStringStream) in readertest.cpp for example.
-*/
-template<typename Stream>
-struct StreamTraits {
- //! Whether to make local copy of stream for optimization during parsing.
- /*!
- By default, for safety, streams do not use local copy optimization.
- Stream that can be copied fast should specialize this, like StreamTraits<StringStream>.
- */
- enum { copyOptimization = 0 };
-};
-
-//! Reserve n characters for writing to a stream.
-template<typename Stream>
-inline void PutReserve(Stream& stream, size_t count) {
- (void)stream;
- (void)count;
-}
-
-//! Write character to a stream, presuming buffer is reserved.
-template<typename Stream>
-inline void PutUnsafe(Stream& stream, typename Stream::Ch c) {
- stream.Put(c);
-}
-
-//! Put N copies of a character to a stream.
-template<typename Stream, typename Ch>
-inline void PutN(Stream& stream, Ch c, size_t n) {
- PutReserve(stream, n);
- for (size_t i = 0; i < n; i++)
- PutUnsafe(stream, c);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericStreamWrapper
-
-//! A Stream Wrapper
-/*! \tThis string stream is a wrapper for any stream by just forwarding any
- \treceived message to the origin stream.
- \note implements Stream concept
-*/
-
-#if defined(_MSC_VER) && _MSC_VER <= 1800
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4702) // unreachable code
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-template <typename InputStream, typename Encoding = UTF8<> >
-class GenericStreamWrapper {
-public:
- typedef typename Encoding::Ch Ch;
- GenericStreamWrapper(InputStream& is): is_(is) {}
-
- Ch Peek() const { return is_.Peek(); }
- Ch Take() { return is_.Take(); }
- size_t Tell() { return is_.Tell(); }
- Ch* PutBegin() { return is_.PutBegin(); }
- void Put(Ch ch) { is_.Put(ch); }
- void Flush() { is_.Flush(); }
- size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); }
-
- // wrapper for MemoryStream
- const Ch* Peek4() const { return is_.Peek4(); }
-
- // wrapper for AutoUTFInputStream
- UTFType GetType() const { return is_.GetType(); }
- bool HasBOM() const { return is_.HasBOM(); }
-
-protected:
- InputStream& is_;
-};
-
-#if defined(_MSC_VER) && _MSC_VER <= 1800
-RAPIDJSON_DIAG_POP
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-// StringStream
-
-//! Read-only string stream.
-/*! \note implements Stream concept
-*/
-template <typename Encoding>
-struct GenericStringStream {
- typedef typename Encoding::Ch Ch;
-
- GenericStringStream(const Ch *src) : src_(src), head_(src) {}
-
- Ch Peek() const { return *src_; }
- Ch Take() { return *src_++; }
- size_t Tell() const { return static_cast<size_t>(src_ - head_); }
-
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
- const Ch* src_; //!< Current read position.
- const Ch* head_; //!< Original head of the string.
-};
-
-template <typename Encoding>
-struct StreamTraits<GenericStringStream<Encoding> > {
- enum { copyOptimization = 1 };
-};
-
-//! String stream with UTF8 encoding.
-typedef GenericStringStream<UTF8<> > StringStream;
-
-///////////////////////////////////////////////////////////////////////////////
-// InsituStringStream
-
-//! A read-write string stream.
-/*! This string stream is particularly designed for in-situ parsing.
- \note implements Stream concept
-*/
-template <typename Encoding>
-struct GenericInsituStringStream {
- typedef typename Encoding::Ch Ch;
-
- GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {}
-
- // Read
- Ch Peek() { return *src_; }
- Ch Take() { return *src_++; }
- size_t Tell() { return static_cast<size_t>(src_ - head_); }
-
- // Write
- void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; }
-
- Ch* PutBegin() { return dst_ = src_; }
- size_t PutEnd(Ch* begin) { return static_cast<size_t>(dst_ - begin); }
- void Flush() {}
-
- Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; }
- void Pop(size_t count) { dst_ -= count; }
-
- Ch* src_;
- Ch* dst_;
- Ch* head_;
-};
-
-template <typename Encoding>
-struct StreamTraits<GenericInsituStringStream<Encoding> > {
- enum { copyOptimization = 1 };
-};
-
-//! Insitu string stream with UTF8 encoding.
-typedef GenericInsituStringStream<UTF8<> > InsituStringStream;
-
-RAPIDJSON_NAMESPACE_END
-
-#endif // RAPIDJSON_STREAM_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stringbuffer.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stringbuffer.h
deleted file mode 100644
index 17bfeac9f3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/stringbuffer.h
+++ /dev/null
@@ -1,121 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_STRINGBUFFER_H_
-#define RAPIDJSON_STRINGBUFFER_H_
-
-#include "stream.h"
-#include "internal/stack.h"
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-#include <utility> // std::move
-#endif
-
-#include "internal/stack.h"
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-//! Represents an in-memory output stream.
-/*!
- \tparam Encoding Encoding of the stream.
- \tparam Allocator type for allocating memory buffer.
- \note implements Stream concept
-*/
-template <typename Encoding, typename Allocator = CrtAllocator>
-class GenericStringBuffer {
-public:
- typedef typename Encoding::Ch Ch;
-
- GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {}
- GenericStringBuffer& operator=(GenericStringBuffer&& rhs) {
- if (&rhs != this)
- stack_ = std::move(rhs.stack_);
- return *this;
- }
-#endif
-
- void Put(Ch c) { *stack_.template Push<Ch>() = c; }
- void PutUnsafe(Ch c) { *stack_.template PushUnsafe<Ch>() = c; }
- void Flush() {}
-
- void Clear() { stack_.Clear(); }
- void ShrinkToFit() {
- // Push and pop a null terminator. This is safe.
- *stack_.template Push<Ch>() = '\0';
- stack_.ShrinkToFit();
- stack_.template Pop<Ch>(1);
- }
-
- void Reserve(size_t count) { stack_.template Reserve<Ch>(count); }
- Ch* Push(size_t count) { return stack_.template Push<Ch>(count); }
- Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe<Ch>(count); }
- void Pop(size_t count) { stack_.template Pop<Ch>(count); }
-
- const Ch* GetString() const {
- // Push and pop a null terminator. This is safe.
- *stack_.template Push<Ch>() = '\0';
- stack_.template Pop<Ch>(1);
-
- return stack_.template Bottom<Ch>();
- }
-
- //! Get the size of string in bytes in the string buffer.
- size_t GetSize() const { return stack_.GetSize(); }
-
- //! Get the length of string in Ch in the string buffer.
- size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); }
-
- static const size_t kDefaultCapacity = 256;
- mutable internal::Stack<Allocator> stack_;
-
-private:
- // Prohibit copy constructor & assignment operator.
- GenericStringBuffer(const GenericStringBuffer&);
- GenericStringBuffer& operator=(const GenericStringBuffer&);
-};
-
-//! String buffer with UTF8 encoding
-typedef GenericStringBuffer<UTF8<> > StringBuffer;
-
-template<typename Encoding, typename Allocator>
-inline void PutReserve(GenericStringBuffer<Encoding, Allocator>& stream, size_t count) {
- stream.Reserve(count);
-}
-
-template<typename Encoding, typename Allocator>
-inline void PutUnsafe(GenericStringBuffer<Encoding, Allocator>& stream, typename Encoding::Ch c) {
- stream.PutUnsafe(c);
-}
-
-//! Implement specialized version of PutN() with memset() for better performance.
-template<>
-inline void PutN(GenericStringBuffer<UTF8<> >& stream, char c, size_t n) {
- std::memset(stream.stack_.Push<char>(n), c, n * sizeof(c));
-}
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_STRINGBUFFER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/uri.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/uri.h
deleted file mode 100644
index f93e508a4f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/uri.h
+++ /dev/null
@@ -1,481 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// (C) Copyright IBM Corporation 2021
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_URI_H_
-#define RAPIDJSON_URI_H_
-
-#include "internal/strfunc.h"
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// GenericUri
-
-template <typename ValueType, typename Allocator=CrtAllocator>
-class GenericUri {
-public:
- typedef typename ValueType::Ch Ch;
-#if RAPIDJSON_HAS_STDSTRING
- typedef std::basic_string<Ch> String;
-#endif
-
- //! Constructors
- GenericUri(Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- }
-
- GenericUri(const Ch* uri, SizeType len, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- Parse(uri, len);
- }
-
- GenericUri(const Ch* uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- Parse(uri, internal::StrLen<Ch>(uri));
- }
-
- // Use with specializations of GenericValue
- template<typename T> GenericUri(const T& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- const Ch* u = uri.template Get<const Ch*>(); // TypeHelper from document.h
- Parse(u, internal::StrLen<Ch>(u));
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- GenericUri(const String& uri, Allocator* allocator = 0) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- Parse(uri.c_str(), internal::StrLen<Ch>(uri.c_str()));
- }
-#endif
-
- //! Copy constructor
- GenericUri(const GenericUri& rhs) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(), ownAllocator_() {
- *this = rhs;
- }
-
- //! Copy constructor
- GenericUri(const GenericUri& rhs, Allocator* allocator) : uri_(), base_(), scheme_(), auth_(), path_(), query_(), frag_(), allocator_(allocator), ownAllocator_() {
- *this = rhs;
- }
-
- //! Destructor.
- ~GenericUri() {
- Free();
- RAPIDJSON_DELETE(ownAllocator_);
- }
-
- //! Assignment operator
- GenericUri& operator=(const GenericUri& rhs) {
- if (this != &rhs) {
- // Do not delete ownAllocator
- Free();
- Allocate(rhs.GetStringLength());
- auth_ = CopyPart(scheme_, rhs.scheme_, rhs.GetSchemeStringLength());
- path_ = CopyPart(auth_, rhs.auth_, rhs.GetAuthStringLength());
- query_ = CopyPart(path_, rhs.path_, rhs.GetPathStringLength());
- frag_ = CopyPart(query_, rhs.query_, rhs.GetQueryStringLength());
- base_ = CopyPart(frag_, rhs.frag_, rhs.GetFragStringLength());
- uri_ = CopyPart(base_, rhs.base_, rhs.GetBaseStringLength());
- CopyPart(uri_, rhs.uri_, rhs.GetStringLength());
- }
- return *this;
- }
-
- //! Getters
- // Use with specializations of GenericValue
- template<typename T> void Get(T& uri, Allocator& allocator) {
- uri.template Set<const Ch*>(this->GetString(), allocator); // TypeHelper from document.h
- }
-
- const Ch* GetString() const { return uri_; }
- SizeType GetStringLength() const { return uri_ == 0 ? 0 : internal::StrLen<Ch>(uri_); }
- const Ch* GetBaseString() const { return base_; }
- SizeType GetBaseStringLength() const { return base_ == 0 ? 0 : internal::StrLen<Ch>(base_); }
- const Ch* GetSchemeString() const { return scheme_; }
- SizeType GetSchemeStringLength() const { return scheme_ == 0 ? 0 : internal::StrLen<Ch>(scheme_); }
- const Ch* GetAuthString() const { return auth_; }
- SizeType GetAuthStringLength() const { return auth_ == 0 ? 0 : internal::StrLen<Ch>(auth_); }
- const Ch* GetPathString() const { return path_; }
- SizeType GetPathStringLength() const { return path_ == 0 ? 0 : internal::StrLen<Ch>(path_); }
- const Ch* GetQueryString() const { return query_; }
- SizeType GetQueryStringLength() const { return query_ == 0 ? 0 : internal::StrLen<Ch>(query_); }
- const Ch* GetFragString() const { return frag_; }
- SizeType GetFragStringLength() const { return frag_ == 0 ? 0 : internal::StrLen<Ch>(frag_); }
-
-#if RAPIDJSON_HAS_STDSTRING
- static String Get(const GenericUri& uri) { return String(uri.GetString(), uri.GetStringLength()); }
- static String GetBase(const GenericUri& uri) { return String(uri.GetBaseString(), uri.GetBaseStringLength()); }
- static String GetScheme(const GenericUri& uri) { return String(uri.GetSchemeString(), uri.GetSchemeStringLength()); }
- static String GetAuth(const GenericUri& uri) { return String(uri.GetAuthString(), uri.GetAuthStringLength()); }
- static String GetPath(const GenericUri& uri) { return String(uri.GetPathString(), uri.GetPathStringLength()); }
- static String GetQuery(const GenericUri& uri) { return String(uri.GetQueryString(), uri.GetQueryStringLength()); }
- static String GetFrag(const GenericUri& uri) { return String(uri.GetFragString(), uri.GetFragStringLength()); }
-#endif
-
- //! Equality operators
- bool operator==(const GenericUri& rhs) const {
- return Match(rhs, true);
- }
-
- bool operator!=(const GenericUri& rhs) const {
- return !Match(rhs, true);
- }
-
- bool Match(const GenericUri& uri, bool full = true) const {
- Ch* s1;
- Ch* s2;
- if (full) {
- s1 = uri_;
- s2 = uri.uri_;
- } else {
- s1 = base_;
- s2 = uri.base_;
- }
- if (s1 == s2) return true;
- if (s1 == 0 || s2 == 0) return false;
- return internal::StrCmp<Ch>(s1, s2) == 0;
- }
-
- //! Resolve this URI against another (base) URI in accordance with URI resolution rules.
- // See https://tools.ietf.org/html/rfc3986
- // Use for resolving an id or $ref with an in-scope id.
- // Returns a new GenericUri for the resolved URI.
- GenericUri Resolve(const GenericUri& baseuri, Allocator* allocator = 0) {
- GenericUri resuri;
- resuri.allocator_ = allocator;
- // Ensure enough space for combining paths
- resuri.Allocate(GetStringLength() + baseuri.GetStringLength() + 1); // + 1 for joining slash
-
- if (!(GetSchemeStringLength() == 0)) {
- // Use all of this URI
- resuri.auth_ = CopyPart(resuri.scheme_, scheme_, GetSchemeStringLength());
- resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength());
- resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
- resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
- resuri.RemoveDotSegments();
- } else {
- // Use the base scheme
- resuri.auth_ = CopyPart(resuri.scheme_, baseuri.scheme_, baseuri.GetSchemeStringLength());
- if (!(GetAuthStringLength() == 0)) {
- // Use this auth, path, query
- resuri.path_ = CopyPart(resuri.auth_, auth_, GetAuthStringLength());
- resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
- resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
- resuri.RemoveDotSegments();
- } else {
- // Use the base auth
- resuri.path_ = CopyPart(resuri.auth_, baseuri.auth_, baseuri.GetAuthStringLength());
- if (GetPathStringLength() == 0) {
- // Use the base path
- resuri.query_ = CopyPart(resuri.path_, baseuri.path_, baseuri.GetPathStringLength());
- if (GetQueryStringLength() == 0) {
- // Use the base query
- resuri.frag_ = CopyPart(resuri.query_, baseuri.query_, baseuri.GetQueryStringLength());
- } else {
- // Use this query
- resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
- }
- } else {
- if (path_[0] == '/') {
- // Absolute path - use all of this path
- resuri.query_ = CopyPart(resuri.path_, path_, GetPathStringLength());
- resuri.RemoveDotSegments();
- } else {
- // Relative path - append this path to base path after base path's last slash
- size_t pos = 0;
- if (!(baseuri.GetAuthStringLength() == 0) && baseuri.GetPathStringLength() == 0) {
- resuri.path_[pos] = '/';
- pos++;
- }
- size_t lastslashpos = baseuri.GetPathStringLength();
- while (lastslashpos > 0) {
- if (baseuri.path_[lastslashpos - 1] == '/') break;
- lastslashpos--;
- }
- std::memcpy(&resuri.path_[pos], baseuri.path_, lastslashpos * sizeof(Ch));
- pos += lastslashpos;
- resuri.query_ = CopyPart(&resuri.path_[pos], path_, GetPathStringLength());
- resuri.RemoveDotSegments();
- }
- // Use this query
- resuri.frag_ = CopyPart(resuri.query_, query_, GetQueryStringLength());
- }
- }
- }
- // Always use this frag
- resuri.base_ = CopyPart(resuri.frag_, frag_, GetFragStringLength());
-
- // Re-constitute base_ and uri_
- resuri.SetBase();
- resuri.uri_ = resuri.base_ + resuri.GetBaseStringLength() + 1;
- resuri.SetUri();
- return resuri;
- }
-
- //! Get the allocator of this GenericUri.
- Allocator& GetAllocator() { return *allocator_; }
-
-private:
- // Allocate memory for a URI
- // Returns total amount allocated
- std::size_t Allocate(std::size_t len) {
- // Create own allocator if user did not supply.
- if (!allocator_)
- ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)();
-
- // Allocate one block containing each part of the URI (5) plus base plus full URI, all null terminated.
- // Order: scheme, auth, path, query, frag, base, uri
- // Note need to set, increment, assign in 3 stages to avoid compiler warning bug.
- size_t total = (3 * len + 7) * sizeof(Ch);
- scheme_ = static_cast<Ch*>(allocator_->Malloc(total));
- *scheme_ = '\0';
- auth_ = scheme_;
- auth_++;
- *auth_ = '\0';
- path_ = auth_;
- path_++;
- *path_ = '\0';
- query_ = path_;
- query_++;
- *query_ = '\0';
- frag_ = query_;
- frag_++;
- *frag_ = '\0';
- base_ = frag_;
- base_++;
- *base_ = '\0';
- uri_ = base_;
- uri_++;
- *uri_ = '\0';
- return total;
- }
-
- // Free memory for a URI
- void Free() {
- if (scheme_) {
- Allocator::Free(scheme_);
- scheme_ = 0;
- }
- }
-
- // Parse a URI into constituent scheme, authority, path, query, & fragment parts
- // Supports URIs that match regex ^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))? as per
- // https://tools.ietf.org/html/rfc3986
- void Parse(const Ch* uri, std::size_t len) {
- std::size_t start = 0, pos1 = 0, pos2 = 0;
- Allocate(len);
-
- // Look for scheme ([^:/?#]+):)?
- if (start < len) {
- while (pos1 < len) {
- if (uri[pos1] == ':') break;
- pos1++;
- }
- if (pos1 != len) {
- while (pos2 < len) {
- if (uri[pos2] == '/') break;
- if (uri[pos2] == '?') break;
- if (uri[pos2] == '#') break;
- pos2++;
- }
- if (pos1 < pos2) {
- pos1++;
- std::memcpy(scheme_, &uri[start], pos1 * sizeof(Ch));
- scheme_[pos1] = '\0';
- start = pos1;
- }
- }
- }
- // Look for auth (//([^/?#]*))?
- // Note need to set, increment, assign in 3 stages to avoid compiler warning bug.
- auth_ = scheme_ + GetSchemeStringLength();
- auth_++;
- *auth_ = '\0';
- if (start < len - 1 && uri[start] == '/' && uri[start + 1] == '/') {
- pos2 = start + 2;
- while (pos2 < len) {
- if (uri[pos2] == '/') break;
- if (uri[pos2] == '?') break;
- if (uri[pos2] == '#') break;
- pos2++;
- }
- std::memcpy(auth_, &uri[start], (pos2 - start) * sizeof(Ch));
- auth_[pos2 - start] = '\0';
- start = pos2;
- }
- // Look for path ([^?#]*)
- // Note need to set, increment, assign in 3 stages to avoid compiler warning bug.
- path_ = auth_ + GetAuthStringLength();
- path_++;
- *path_ = '\0';
- if (start < len) {
- pos2 = start;
- while (pos2 < len) {
- if (uri[pos2] == '?') break;
- if (uri[pos2] == '#') break;
- pos2++;
- }
- if (start != pos2) {
- std::memcpy(path_, &uri[start], (pos2 - start) * sizeof(Ch));
- path_[pos2 - start] = '\0';
- if (path_[0] == '/')
- RemoveDotSegments(); // absolute path - normalize
- start = pos2;
- }
- }
- // Look for query (\?([^#]*))?
- // Note need to set, increment, assign in 3 stages to avoid compiler warning bug.
- query_ = path_ + GetPathStringLength();
- query_++;
- *query_ = '\0';
- if (start < len && uri[start] == '?') {
- pos2 = start + 1;
- while (pos2 < len) {
- if (uri[pos2] == '#') break;
- pos2++;
- }
- if (start != pos2) {
- std::memcpy(query_, &uri[start], (pos2 - start) * sizeof(Ch));
- query_[pos2 - start] = '\0';
- start = pos2;
- }
- }
- // Look for fragment (#(.*))?
- // Note need to set, increment, assign in 3 stages to avoid compiler warning bug.
- frag_ = query_ + GetQueryStringLength();
- frag_++;
- *frag_ = '\0';
- if (start < len && uri[start] == '#') {
- std::memcpy(frag_, &uri[start], (len - start) * sizeof(Ch));
- frag_[len - start] = '\0';
- }
-
- // Re-constitute base_ and uri_
- base_ = frag_ + GetFragStringLength() + 1;
- SetBase();
- uri_ = base_ + GetBaseStringLength() + 1;
- SetUri();
- }
-
- // Reconstitute base
- void SetBase() {
- Ch* next = base_;
- std::memcpy(next, scheme_, GetSchemeStringLength() * sizeof(Ch));
- next+= GetSchemeStringLength();
- std::memcpy(next, auth_, GetAuthStringLength() * sizeof(Ch));
- next+= GetAuthStringLength();
- std::memcpy(next, path_, GetPathStringLength() * sizeof(Ch));
- next+= GetPathStringLength();
- std::memcpy(next, query_, GetQueryStringLength() * sizeof(Ch));
- next+= GetQueryStringLength();
- *next = '\0';
- }
-
- // Reconstitute uri
- void SetUri() {
- Ch* next = uri_;
- std::memcpy(next, base_, GetBaseStringLength() * sizeof(Ch));
- next+= GetBaseStringLength();
- std::memcpy(next, frag_, GetFragStringLength() * sizeof(Ch));
- next+= GetFragStringLength();
- *next = '\0';
- }
-
- // Copy a part from one GenericUri to another
- // Return the pointer to the next part to be copied to
- Ch* CopyPart(Ch* to, Ch* from, std::size_t len) {
- RAPIDJSON_ASSERT(to != 0);
- RAPIDJSON_ASSERT(from != 0);
- std::memcpy(to, from, len * sizeof(Ch));
- to[len] = '\0';
- Ch* next = to + len + 1;
- return next;
- }
-
- // Remove . and .. segments from the path_ member.
- // https://tools.ietf.org/html/rfc3986
- // This is done in place as we are only removing segments.
- void RemoveDotSegments() {
- std::size_t pathlen = GetPathStringLength();
- std::size_t pathpos = 0; // Position in path_
- std::size_t newpos = 0; // Position in new path_
-
- // Loop through each segment in original path_
- while (pathpos < pathlen) {
- // Get next segment, bounded by '/' or end
- size_t slashpos = 0;
- while ((pathpos + slashpos) < pathlen) {
- if (path_[pathpos + slashpos] == '/') break;
- slashpos++;
- }
- // Check for .. and . segments
- if (slashpos == 2 && path_[pathpos] == '.' && path_[pathpos + 1] == '.') {
- // Backup a .. segment in the new path_
- // We expect to find a previously added slash at the end or nothing
- RAPIDJSON_ASSERT(newpos == 0 || path_[newpos - 1] == '/');
- size_t lastslashpos = newpos;
- // Make sure we don't go beyond the start segment
- if (lastslashpos > 1) {
- // Find the next to last slash and back up to it
- lastslashpos--;
- while (lastslashpos > 0) {
- if (path_[lastslashpos - 1] == '/') break;
- lastslashpos--;
- }
- // Set the new path_ position
- newpos = lastslashpos;
- }
- } else if (slashpos == 1 && path_[pathpos] == '.') {
- // Discard . segment, leaves new path_ unchanged
- } else {
- // Move any other kind of segment to the new path_
- RAPIDJSON_ASSERT(newpos <= pathpos);
- std::memmove(&path_[newpos], &path_[pathpos], slashpos * sizeof(Ch));
- newpos += slashpos;
- // Add slash if not at end
- if ((pathpos + slashpos) < pathlen) {
- path_[newpos] = '/';
- newpos++;
- }
- }
- // Move to next segment
- pathpos += slashpos + 1;
- }
- path_[newpos] = '\0';
- }
-
- Ch* uri_; // Everything
- Ch* base_; // Everything except fragment
- Ch* scheme_; // Includes the :
- Ch* auth_; // Includes the //
- Ch* path_; // Absolute if starts with /
- Ch* query_; // Includes the ?
- Ch* frag_; // Includes the #
-
- Allocator* allocator_; //!< The current allocator. It is either user-supplied or equal to ownAllocator_.
- Allocator* ownAllocator_; //!< Allocator owned by this Uri.
-};
-
-//! GenericUri for Value (UTF-8, default allocator).
-typedef GenericUri<Value> Uri;
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_URI_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/writer.h b/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/writer.h
deleted file mode 100644
index 81f34fc80d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include/rapidjson/writer.h
+++ /dev/null
@@ -1,710 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef RAPIDJSON_WRITER_H_
-#define RAPIDJSON_WRITER_H_
-
-#include "stream.h"
-#include "internal/clzll.h"
-#include "internal/meta.h"
-#include "internal/stack.h"
-#include "internal/strfunc.h"
-#include "internal/dtoa.h"
-#include "internal/itoa.h"
-#include "stringbuffer.h"
-#include <new> // placement new
-
-#if defined(RAPIDJSON_SIMD) && defined(_MSC_VER)
-#include <intrin.h>
-#pragma intrinsic(_BitScanForward)
-#endif
-#ifdef RAPIDJSON_SSE42
-#include <nmmintrin.h>
-#elif defined(RAPIDJSON_SSE2)
-#include <emmintrin.h>
-#elif defined(RAPIDJSON_NEON)
-#include <arm_neon.h>
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(padded)
-RAPIDJSON_DIAG_OFF(unreachable-code)
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4127) // conditional expression is constant
-#endif
-
-RAPIDJSON_NAMESPACE_BEGIN
-
-///////////////////////////////////////////////////////////////////////////////
-// WriteFlag
-
-/*! \def RAPIDJSON_WRITE_DEFAULT_FLAGS
- \ingroup RAPIDJSON_CONFIG
- \brief User-defined kWriteDefaultFlags definition.
-
- User can define this as any \c WriteFlag combinations.
-*/
-#ifndef RAPIDJSON_WRITE_DEFAULT_FLAGS
-#define RAPIDJSON_WRITE_DEFAULT_FLAGS kWriteNoFlags
-#endif
-
-//! Combination of writeFlags
-enum WriteFlag {
- kWriteNoFlags = 0, //!< No flags are set.
- kWriteValidateEncodingFlag = 1, //!< Validate encoding of JSON strings.
- kWriteNanAndInfFlag = 2, //!< Allow writing of Infinity, -Infinity and NaN.
- kWriteDefaultFlags = RAPIDJSON_WRITE_DEFAULT_FLAGS //!< Default write flags. Can be customized by defining RAPIDJSON_WRITE_DEFAULT_FLAGS
-};
-
-//! JSON writer
-/*! Writer implements the concept Handler.
- It generates JSON text by events to an output os.
-
- User may programmatically calls the functions of a writer to generate JSON text.
-
- On the other side, a writer can also be passed to objects that generates events,
-
- for example Reader::Parse() and Document::Accept().
-
- \tparam OutputStream Type of output stream.
- \tparam SourceEncoding Encoding of source string.
- \tparam TargetEncoding Encoding of output stream.
- \tparam StackAllocator Type of allocator for allocating memory of stack.
- \note implements Handler concept
-*/
-template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
-class Writer {
-public:
- typedef typename SourceEncoding::Ch Ch;
-
- static const int kDefaultMaxDecimalPlaces = 324;
-
- //! Constructor
- /*! \param os Output stream.
- \param stackAllocator User supplied allocator. If it is null, it will create a private one.
- \param levelDepth Initial capacity of stack.
- */
- explicit
- Writer(OutputStream& os, StackAllocator* stackAllocator = 0, size_t levelDepth = kDefaultLevelDepth) :
- os_(&os), level_stack_(stackAllocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
-
- explicit
- Writer(StackAllocator* allocator = 0, size_t levelDepth = kDefaultLevelDepth) :
- os_(0), level_stack_(allocator, levelDepth * sizeof(Level)), maxDecimalPlaces_(kDefaultMaxDecimalPlaces), hasRoot_(false) {}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- Writer(Writer&& rhs) :
- os_(rhs.os_), level_stack_(std::move(rhs.level_stack_)), maxDecimalPlaces_(rhs.maxDecimalPlaces_), hasRoot_(rhs.hasRoot_) {
- rhs.os_ = 0;
- }
-#endif
-
- //! Reset the writer with a new stream.
- /*!
- This function reset the writer with a new stream and default settings,
- in order to make a Writer object reusable for output multiple JSONs.
-
- \param os New output stream.
- \code
- Writer<OutputStream> writer(os1);
- writer.StartObject();
- // ...
- writer.EndObject();
-
- writer.Reset(os2);
- writer.StartObject();
- // ...
- writer.EndObject();
- \endcode
- */
- void Reset(OutputStream& os) {
- os_ = &os;
- hasRoot_ = false;
- level_stack_.Clear();
- }
-
- //! Checks whether the output is a complete JSON.
- /*!
- A complete JSON has a complete root object or array.
- */
- bool IsComplete() const {
- return hasRoot_ && level_stack_.Empty();
- }
-
- int GetMaxDecimalPlaces() const {
- return maxDecimalPlaces_;
- }
-
- //! Sets the maximum number of decimal places for double output.
- /*!
- This setting truncates the output with specified number of decimal places.
-
- For example,
-
- \code
- writer.SetMaxDecimalPlaces(3);
- writer.StartArray();
- writer.Double(0.12345); // "0.123"
- writer.Double(0.0001); // "0.0"
- writer.Double(1.234567890123456e30); // "1.234567890123456e30" (do not truncate significand for positive exponent)
- writer.Double(1.23e-4); // "0.0" (do truncate significand for negative exponent)
- writer.EndArray();
- \endcode
-
- The default setting does not truncate any decimal places. You can restore to this setting by calling
- \code
- writer.SetMaxDecimalPlaces(Writer::kDefaultMaxDecimalPlaces);
- \endcode
- */
- void SetMaxDecimalPlaces(int maxDecimalPlaces) {
- maxDecimalPlaces_ = maxDecimalPlaces;
- }
-
- /*!@name Implementation of Handler
- \see Handler
- */
- //@{
-
- bool Null() { Prefix(kNullType); return EndValue(WriteNull()); }
- bool Bool(bool b) { Prefix(b ? kTrueType : kFalseType); return EndValue(WriteBool(b)); }
- bool Int(int i) { Prefix(kNumberType); return EndValue(WriteInt(i)); }
- bool Uint(unsigned u) { Prefix(kNumberType); return EndValue(WriteUint(u)); }
- bool Int64(int64_t i64) { Prefix(kNumberType); return EndValue(WriteInt64(i64)); }
- bool Uint64(uint64_t u64) { Prefix(kNumberType); return EndValue(WriteUint64(u64)); }
-
- //! Writes the given \c double value to the stream
- /*!
- \param d The value to be written.
- \return Whether it is succeed.
- */
- bool Double(double d) { Prefix(kNumberType); return EndValue(WriteDouble(d)); }
-
- bool RawNumber(const Ch* str, SizeType length, bool copy = false) {
- RAPIDJSON_ASSERT(str != 0);
- (void)copy;
- Prefix(kNumberType);
- return EndValue(WriteString(str, length));
- }
-
- bool String(const Ch* str, SizeType length, bool copy = false) {
- RAPIDJSON_ASSERT(str != 0);
- (void)copy;
- Prefix(kStringType);
- return EndValue(WriteString(str, length));
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool String(const std::basic_string<Ch>& str) {
- return String(str.data(), SizeType(str.size()));
- }
-#endif
-
- bool StartObject() {
- Prefix(kObjectType);
- new (level_stack_.template Push<Level>()) Level(false);
- return WriteStartObject();
- }
-
- bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
-
-#if RAPIDJSON_HAS_STDSTRING
- bool Key(const std::basic_string<Ch>& str)
- {
- return Key(str.data(), SizeType(str.size()));
- }
-#endif
-
- bool EndObject(SizeType memberCount = 0) {
- (void)memberCount;
- RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level)); // not inside an Object
- RAPIDJSON_ASSERT(!level_stack_.template Top<Level>()->inArray); // currently inside an Array, not Object
- RAPIDJSON_ASSERT(0 == level_stack_.template Top<Level>()->valueCount % 2); // Object has a Key without a Value
- level_stack_.template Pop<Level>(1);
- return EndValue(WriteEndObject());
- }
-
- bool StartArray() {
- Prefix(kArrayType);
- new (level_stack_.template Push<Level>()) Level(true);
- return WriteStartArray();
- }
-
- bool EndArray(SizeType elementCount = 0) {
- (void)elementCount;
- RAPIDJSON_ASSERT(level_stack_.GetSize() >= sizeof(Level));
- RAPIDJSON_ASSERT(level_stack_.template Top<Level>()->inArray);
- level_stack_.template Pop<Level>(1);
- return EndValue(WriteEndArray());
- }
- //@}
-
- /*! @name Convenience extensions */
- //@{
-
- //! Simpler but slower overload.
- bool String(const Ch* const& str) { return String(str, internal::StrLen(str)); }
- bool Key(const Ch* const& str) { return Key(str, internal::StrLen(str)); }
-
- //@}
-
- //! Write a raw JSON value.
- /*!
- For user to write a stringified JSON as a value.
-
- \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
- \param length Length of the json.
- \param type Type of the root of json.
- */
- bool RawValue(const Ch* json, size_t length, Type type) {
- RAPIDJSON_ASSERT(json != 0);
- Prefix(type);
- return EndValue(WriteRawValue(json, length));
- }
-
- //! Flush the output stream.
- /*!
- Allows the user to flush the output stream immediately.
- */
- void Flush() {
- os_->Flush();
- }
-
- static const size_t kDefaultLevelDepth = 32;
-
-protected:
- //! Information for each nested level
- struct Level {
- Level(bool inArray_) : valueCount(0), inArray(inArray_) {}
- size_t valueCount; //!< number of values in this level
- bool inArray; //!< true if in array, otherwise in object
- };
-
- bool WriteNull() {
- PutReserve(*os_, 4);
- PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 'l'); return true;
- }
-
- bool WriteBool(bool b) {
- if (b) {
- PutReserve(*os_, 4);
- PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'r'); PutUnsafe(*os_, 'u'); PutUnsafe(*os_, 'e');
- }
- else {
- PutReserve(*os_, 5);
- PutUnsafe(*os_, 'f'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'l'); PutUnsafe(*os_, 's'); PutUnsafe(*os_, 'e');
- }
- return true;
- }
-
- bool WriteInt(int i) {
- char buffer[11];
- const char* end = internal::i32toa(i, buffer);
- PutReserve(*os_, static_cast<size_t>(end - buffer));
- for (const char* p = buffer; p != end; ++p)
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
- return true;
- }
-
- bool WriteUint(unsigned u) {
- char buffer[10];
- const char* end = internal::u32toa(u, buffer);
- PutReserve(*os_, static_cast<size_t>(end - buffer));
- for (const char* p = buffer; p != end; ++p)
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
- return true;
- }
-
- bool WriteInt64(int64_t i64) {
- char buffer[21];
- const char* end = internal::i64toa(i64, buffer);
- PutReserve(*os_, static_cast<size_t>(end - buffer));
- for (const char* p = buffer; p != end; ++p)
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
- return true;
- }
-
- bool WriteUint64(uint64_t u64) {
- char buffer[20];
- char* end = internal::u64toa(u64, buffer);
- PutReserve(*os_, static_cast<size_t>(end - buffer));
- for (char* p = buffer; p != end; ++p)
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
- return true;
- }
-
- bool WriteDouble(double d) {
- if (internal::Double(d).IsNanOrInf()) {
- if (!(writeFlags & kWriteNanAndInfFlag))
- return false;
- if (internal::Double(d).IsNan()) {
- PutReserve(*os_, 3);
- PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N');
- return true;
- }
- if (internal::Double(d).Sign()) {
- PutReserve(*os_, 9);
- PutUnsafe(*os_, '-');
- }
- else
- PutReserve(*os_, 8);
- PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
- PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
- return true;
- }
-
- char buffer[25];
- char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
- PutReserve(*os_, static_cast<size_t>(end - buffer));
- for (char* p = buffer; p != end; ++p)
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(*p));
- return true;
- }
-
- bool WriteString(const Ch* str, SizeType length) {
- static const typename OutputStream::Ch hexDigits[16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
- static const char escape[256] = {
-#define Z16 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
- //0 1 2 3 4 5 6 7 8 9 A B C D E F
- 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'b', 't', 'n', 'u', 'f', 'r', 'u', 'u', // 00
- 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', 'u', // 10
- 0, 0, '"', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 20
- Z16, Z16, // 30~4F
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,'\\', 0, 0, 0, // 50
- Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16, Z16 // 60~FF
-#undef Z16
- };
-
- if (TargetEncoding::supportUnicode)
- PutReserve(*os_, 2 + length * 6); // "\uxxxx..."
- else
- PutReserve(*os_, 2 + length * 12); // "\uxxxx\uyyyy..."
-
- PutUnsafe(*os_, '\"');
- GenericStringStream<SourceEncoding> is(str);
- while (ScanWriteUnescapedString(is, length)) {
- const Ch c = is.Peek();
- if (!TargetEncoding::supportUnicode && static_cast<unsigned>(c) >= 0x80) {
- // Unicode escaping
- unsigned codepoint;
- if (RAPIDJSON_UNLIKELY(!SourceEncoding::Decode(is, &codepoint)))
- return false;
- PutUnsafe(*os_, '\\');
- PutUnsafe(*os_, 'u');
- if (codepoint <= 0xD7FF || (codepoint >= 0xE000 && codepoint <= 0xFFFF)) {
- PutUnsafe(*os_, hexDigits[(codepoint >> 12) & 15]);
- PutUnsafe(*os_, hexDigits[(codepoint >> 8) & 15]);
- PutUnsafe(*os_, hexDigits[(codepoint >> 4) & 15]);
- PutUnsafe(*os_, hexDigits[(codepoint ) & 15]);
- }
- else {
- RAPIDJSON_ASSERT(codepoint >= 0x010000 && codepoint <= 0x10FFFF);
- // Surrogate pair
- unsigned s = codepoint - 0x010000;
- unsigned lead = (s >> 10) + 0xD800;
- unsigned trail = (s & 0x3FF) + 0xDC00;
- PutUnsafe(*os_, hexDigits[(lead >> 12) & 15]);
- PutUnsafe(*os_, hexDigits[(lead >> 8) & 15]);
- PutUnsafe(*os_, hexDigits[(lead >> 4) & 15]);
- PutUnsafe(*os_, hexDigits[(lead ) & 15]);
- PutUnsafe(*os_, '\\');
- PutUnsafe(*os_, 'u');
- PutUnsafe(*os_, hexDigits[(trail >> 12) & 15]);
- PutUnsafe(*os_, hexDigits[(trail >> 8) & 15]);
- PutUnsafe(*os_, hexDigits[(trail >> 4) & 15]);
- PutUnsafe(*os_, hexDigits[(trail ) & 15]);
- }
- }
- else if ((sizeof(Ch) == 1 || static_cast<unsigned>(c) < 256) && RAPIDJSON_UNLIKELY(escape[static_cast<unsigned char>(c)])) {
- is.Take();
- PutUnsafe(*os_, '\\');
- PutUnsafe(*os_, static_cast<typename OutputStream::Ch>(escape[static_cast<unsigned char>(c)]));
- if (escape[static_cast<unsigned char>(c)] == 'u') {
- PutUnsafe(*os_, '0');
- PutUnsafe(*os_, '0');
- PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) >> 4]);
- PutUnsafe(*os_, hexDigits[static_cast<unsigned char>(c) & 0xF]);
- }
- }
- else if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
- Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
- Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
- return false;
- }
- PutUnsafe(*os_, '\"');
- return true;
- }
-
- bool ScanWriteUnescapedString(GenericStringStream<SourceEncoding>& is, size_t length) {
- return RAPIDJSON_LIKELY(is.Tell() < length);
- }
-
- bool WriteStartObject() { os_->Put('{'); return true; }
- bool WriteEndObject() { os_->Put('}'); return true; }
- bool WriteStartArray() { os_->Put('['); return true; }
- bool WriteEndArray() { os_->Put(']'); return true; }
-
- bool WriteRawValue(const Ch* json, size_t length) {
- PutReserve(*os_, length);
- GenericStringStream<SourceEncoding> is(json);
- while (RAPIDJSON_LIKELY(is.Tell() < length)) {
- RAPIDJSON_ASSERT(is.Peek() != '\0');
- if (RAPIDJSON_UNLIKELY(!(writeFlags & kWriteValidateEncodingFlag ?
- Transcoder<SourceEncoding, TargetEncoding>::Validate(is, *os_) :
- Transcoder<SourceEncoding, TargetEncoding>::TranscodeUnsafe(is, *os_))))
- return false;
- }
- return true;
- }
-
- void Prefix(Type type) {
- (void)type;
- if (RAPIDJSON_LIKELY(level_stack_.GetSize() != 0)) { // this value is not at root
- Level* level = level_stack_.template Top<Level>();
- if (level->valueCount > 0) {
- if (level->inArray)
- os_->Put(','); // add comma if it is not the first element in array
- else // in object
- os_->Put((level->valueCount % 2 == 0) ? ',' : ':');
- }
- if (!level->inArray && level->valueCount % 2 == 0)
- RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
- level->valueCount++;
- }
- else {
- RAPIDJSON_ASSERT(!hasRoot_); // Should only has one and only one root.
- hasRoot_ = true;
- }
- }
-
- // Flush the value if it is the top level one.
- bool EndValue(bool ret) {
- if (RAPIDJSON_UNLIKELY(level_stack_.Empty())) // end of json text
- Flush();
- return ret;
- }
-
- OutputStream* os_;
- internal::Stack<StackAllocator> level_stack_;
- int maxDecimalPlaces_;
- bool hasRoot_;
-
-private:
- // Prohibit copy constructor & assignment operator.
- Writer(const Writer&);
- Writer& operator=(const Writer&);
-};
-
-// Full specialization for StringStream to prevent memory copying
-
-template<>
-inline bool Writer<StringBuffer>::WriteInt(int i) {
- char *buffer = os_->Push(11);
- const char* end = internal::i32toa(i, buffer);
- os_->Pop(static_cast<size_t>(11 - (end - buffer)));
- return true;
-}
-
-template<>
-inline bool Writer<StringBuffer>::WriteUint(unsigned u) {
- char *buffer = os_->Push(10);
- const char* end = internal::u32toa(u, buffer);
- os_->Pop(static_cast<size_t>(10 - (end - buffer)));
- return true;
-}
-
-template<>
-inline bool Writer<StringBuffer>::WriteInt64(int64_t i64) {
- char *buffer = os_->Push(21);
- const char* end = internal::i64toa(i64, buffer);
- os_->Pop(static_cast<size_t>(21 - (end - buffer)));
- return true;
-}
-
-template<>
-inline bool Writer<StringBuffer>::WriteUint64(uint64_t u) {
- char *buffer = os_->Push(20);
- const char* end = internal::u64toa(u, buffer);
- os_->Pop(static_cast<size_t>(20 - (end - buffer)));
- return true;
-}
-
-template<>
-inline bool Writer<StringBuffer>::WriteDouble(double d) {
- if (internal::Double(d).IsNanOrInf()) {
- // Note: This code path can only be reached if (RAPIDJSON_WRITE_DEFAULT_FLAGS & kWriteNanAndInfFlag).
- if (!(kWriteDefaultFlags & kWriteNanAndInfFlag))
- return false;
- if (internal::Double(d).IsNan()) {
- PutReserve(*os_, 3);
- PutUnsafe(*os_, 'N'); PutUnsafe(*os_, 'a'); PutUnsafe(*os_, 'N');
- return true;
- }
- if (internal::Double(d).Sign()) {
- PutReserve(*os_, 9);
- PutUnsafe(*os_, '-');
- }
- else
- PutReserve(*os_, 8);
- PutUnsafe(*os_, 'I'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'f');
- PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 'n'); PutUnsafe(*os_, 'i'); PutUnsafe(*os_, 't'); PutUnsafe(*os_, 'y');
- return true;
- }
-
- char *buffer = os_->Push(25);
- char* end = internal::dtoa(d, buffer, maxDecimalPlaces_);
- os_->Pop(static_cast<size_t>(25 - (end - buffer)));
- return true;
-}
-
-#if defined(RAPIDJSON_SSE2) || defined(RAPIDJSON_SSE42)
-template<>
-inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, size_t length) {
- if (length < 16)
- return RAPIDJSON_LIKELY(is.Tell() < length);
-
- if (!RAPIDJSON_LIKELY(is.Tell() < length))
- return false;
-
- const char* p = is.src_;
- const char* end = is.head_ + length;
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- const char* endAligned = reinterpret_cast<const char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
- if (nextAligned > end)
- return true;
-
- while (p != nextAligned)
- if (*p < 0x20 || *p == '\"' || *p == '\\') {
- is.src_ = p;
- return RAPIDJSON_LIKELY(is.Tell() < length);
- }
- else
- os_->PutUnsafe(*p++);
-
- // The rest of string using SIMD
- static const char dquote[16] = { '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"', '\"' };
- static const char bslash[16] = { '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\', '\\' };
- static const char space[16] = { 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F };
- const __m128i dq = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&dquote[0]));
- const __m128i bs = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&bslash[0]));
- const __m128i sp = _mm_loadu_si128(reinterpret_cast<const __m128i *>(&space[0]));
-
- for (; p != endAligned; p += 16) {
- const __m128i s = _mm_load_si128(reinterpret_cast<const __m128i *>(p));
- const __m128i t1 = _mm_cmpeq_epi8(s, dq);
- const __m128i t2 = _mm_cmpeq_epi8(s, bs);
- const __m128i t3 = _mm_cmpeq_epi8(_mm_max_epu8(s, sp), sp); // s < 0x20 <=> max(s, 0x1F) == 0x1F
- const __m128i x = _mm_or_si128(_mm_or_si128(t1, t2), t3);
- unsigned short r = static_cast<unsigned short>(_mm_movemask_epi8(x));
- if (RAPIDJSON_UNLIKELY(r != 0)) { // some of characters is escaped
- SizeType len;
-#ifdef _MSC_VER // Find the index of first escaped
- unsigned long offset;
- _BitScanForward(&offset, r);
- len = offset;
-#else
- len = static_cast<SizeType>(__builtin_ffs(r) - 1);
-#endif
- char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
- for (size_t i = 0; i < len; i++)
- q[i] = p[i];
-
- p += len;
- break;
- }
- _mm_storeu_si128(reinterpret_cast<__m128i *>(os_->PushUnsafe(16)), s);
- }
-
- is.src_ = p;
- return RAPIDJSON_LIKELY(is.Tell() < length);
-}
-#elif defined(RAPIDJSON_NEON)
-template<>
-inline bool Writer<StringBuffer>::ScanWriteUnescapedString(StringStream& is, size_t length) {
- if (length < 16)
- return RAPIDJSON_LIKELY(is.Tell() < length);
-
- if (!RAPIDJSON_LIKELY(is.Tell() < length))
- return false;
-
- const char* p = is.src_;
- const char* end = is.head_ + length;
- const char* nextAligned = reinterpret_cast<const char*>((reinterpret_cast<size_t>(p) + 15) & static_cast<size_t>(~15));
- const char* endAligned = reinterpret_cast<const char*>(reinterpret_cast<size_t>(end) & static_cast<size_t>(~15));
- if (nextAligned > end)
- return true;
-
- while (p != nextAligned)
- if (*p < 0x20 || *p == '\"' || *p == '\\') {
- is.src_ = p;
- return RAPIDJSON_LIKELY(is.Tell() < length);
- }
- else
- os_->PutUnsafe(*p++);
-
- // The rest of string using SIMD
- const uint8x16_t s0 = vmovq_n_u8('"');
- const uint8x16_t s1 = vmovq_n_u8('\\');
- const uint8x16_t s2 = vmovq_n_u8('\b');
- const uint8x16_t s3 = vmovq_n_u8(32);
-
- for (; p != endAligned; p += 16) {
- const uint8x16_t s = vld1q_u8(reinterpret_cast<const uint8_t *>(p));
- uint8x16_t x = vceqq_u8(s, s0);
- x = vorrq_u8(x, vceqq_u8(s, s1));
- x = vorrq_u8(x, vceqq_u8(s, s2));
- x = vorrq_u8(x, vcltq_u8(s, s3));
-
- x = vrev64q_u8(x); // Rev in 64
- uint64_t low = vgetq_lane_u64(vreinterpretq_u64_u8(x), 0); // extract
- uint64_t high = vgetq_lane_u64(vreinterpretq_u64_u8(x), 1); // extract
-
- SizeType len = 0;
- bool escaped = false;
- if (low == 0) {
- if (high != 0) {
- uint32_t lz = internal::clzll(high);
- len = 8 + (lz >> 3);
- escaped = true;
- }
- } else {
- uint32_t lz = internal::clzll(low);
- len = lz >> 3;
- escaped = true;
- }
- if (RAPIDJSON_UNLIKELY(escaped)) { // some of characters is escaped
- char* q = reinterpret_cast<char*>(os_->PushUnsafe(len));
- for (size_t i = 0; i < len; i++)
- q[i] = p[i];
-
- p += len;
- break;
- }
- vst1q_u8(reinterpret_cast<uint8_t *>(os_->PushUnsafe(16)), s);
- }
-
- is.src_ = p;
- return RAPIDJSON_LIKELY(is.Tell() < length);
-}
-#endif // RAPIDJSON_NEON
-
-RAPIDJSON_NAMESPACE_END
-
-#if defined(_MSC_VER) || defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
-
-#endif // RAPIDJSON_RAPIDJSON_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/include_dirs.js b/graphics/asymptote/LspCpp/third_party/rapidjson/include_dirs.js
deleted file mode 100644
index b373e85f5a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/include_dirs.js
+++ /dev/null
@@ -1,2 +0,0 @@
-var path = require('path');
-console.log(path.join(path.relative('.', __dirname), 'include'));
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/library.json b/graphics/asymptote/LspCpp/third_party/rapidjson/library.json
deleted file mode 100644
index 2210fcd617..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/library.json
+++ /dev/null
@@ -1,15 +0,0 @@
-{
- "name": "RapidJSON",
- "version": "1.1.0",
- "keywords": "json, sax, dom, parser, generator",
- "description": "A fast JSON parser/generator for C++ with both SAX/DOM style API",
- "export": {
- "include": "include"
- },
- "examples": "example/*/*.cpp",
- "repository":
- {
- "type": "git",
- "url": "https://github.com/Tencent/rapidjson"
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/license.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/license.txt
deleted file mode 100644
index 7ccc161c84..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/license.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-Tencent is pleased to support the open source community by making RapidJSON available.
-
-Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
-
-If you have downloaded a copy of the RapidJSON binary from Tencent, please note that the RapidJSON binary is licensed under the MIT License.
-If you have downloaded a copy of the RapidJSON source code from Tencent, please note that RapidJSON source code is licensed under the MIT License, except for the third-party components listed below which are subject to different license terms. Your integration of RapidJSON into your own projects may require compliance with the MIT License, as well as the other licenses applicable to the third-party components included within RapidJSON. To avoid the problematic JSON license in your own projects, it's sufficient to exclude the bin/jsonchecker/ directory, as it's the only code under the JSON license.
-A copy of the MIT License is included in this file.
-
-Other dependencies and licenses:
-
-Open Source Software Licensed Under the BSD License:
---------------------------------------------------------------------
-
-The msinttypes r29
-Copyright (c) 2006-2013 Alexander Chemeris
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
-* Neither the name of 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 REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND 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.
-
-Open Source Software Licensed Under the JSON License:
---------------------------------------------------------------------
-
-json.org
-Copyright (c) 2002 JSON.org
-All Rights Reserved.
-
-JSON_checker
-Copyright (c) 2002 JSON.org
-All Rights Reserved.
-
-
-Terms of the JSON License:
----------------------------------------------------
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-The Software shall be used for Good, not Evil.
-
-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.
-
-
-Terms of the MIT License:
---------------------------------------------------------------------
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/package.json b/graphics/asymptote/LspCpp/third_party/rapidjson/package.json
deleted file mode 100644
index 129581a633..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "rapidjson",
- "version": "1.0.4",
- "description": "![](doc/logo/rapidjson.png)",
- "main": "include_dirs.js",
- "directories": {
- "doc": "doc",
- "example": "example",
- "test": "test"
- },
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "repository": {
- "type": "git",
- "url": "git+https://github.com/Tencent/rapidjson.git"
- },
- "author": "",
- "license": "ISC",
- "bugs": {
- "url": "https://github.com/Tencent/rapidjson/issues"
- },
- "homepage": "https://github.com/Tencent/rapidjson#readme"
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/rapidjson.autopkg b/graphics/asymptote/LspCpp/third_party/rapidjson/rapidjson.autopkg
deleted file mode 100644
index fe72030a9a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/rapidjson.autopkg
+++ /dev/null
@@ -1,77 +0,0 @@
-nuget {
- //Usage: Write-NuGetPackage rapidjson.autopkg -defines:MYVERSION=1.1.0
- //Be sure you are running Powershell 3.0 and have the CoApp powershell extensions installed properly.
- nuspec {
- id = rapidjson;
- version : ${MYVERSION};
- title: "rapidjson";
- authors: {"https://github.com/Tencent/rapidjson/releases/tag/v1.1.0"};
- owners: {"@lsantos (github)"};
- licenseUrl: "https://github.com/Tencent/rapidjson/blob/master/license.txt";
- projectUrl: "https://github.com/Tencent/rapidjson/";
- iconUrl: "https://cdn1.iconfinder.com/data/icons/fatcow/32x32/json.png";
- requireLicenseAcceptance:false;
- summary: @"A fast JSON parser/generator for C++ with both SAX/DOM style API";
-
- // if you need to span several lines you can prefix a string with an @ symbol (exactly like c# does).
- description: @"Rapidjson is an attempt to create the fastest JSON parser and generator.
-
- - Small but complete. Supports both SAX and DOM style API. SAX parser only a few hundred lines of code.
- - Fast. In the order of magnitude of strlen(). Optionally supports SSE2/SSE4.2 for acceleration.
- - Self-contained. Minimal dependency on standard libraries. No BOOST, not even STL.
- - Compact. Each JSON value is 16 or 20 bytes for 32 or 64-bit machines respectively (excluding text string storage). With the custom memory allocator, parser allocates memory compactly during parsing.
- - Full RFC4627 compliance. Supports UTF-8, UTF-16 and UTF-32.
- - Support both in-situ parsing (directly decode strings into the source JSON text) and non-destructive parsing (decode strings into new buffers).
- - Parse number to int/unsigned/int64_t/uint64_t/double depending on input
- - Support custom memory allocation. Also, the default memory pool allocator can also be supplied with a user buffer (such as a buffer allocated on user's heap or - programme stack) to minimize allocation.
-
- As the name implies, rapidjson is inspired by rapidxml.";
-
- releaseNotes: @"
-Added
- Add Value::XXXMember(...) overloads for std::string (#335)
-
-Fixed
- Include rapidjson.h for all internal/error headers.
- Parsing some numbers incorrectly in full-precision mode (kFullPrecisionParseFlag) (#342)
- Fix alignment of 64bit platforms (#328)
- Fix MemoryPoolAllocator::Clear() to clear user-buffer (0691502)
-
-Changed
- CMakeLists for include as a thirdparty in projects (#334, #337)
- Change Document::ParseStream() to use stack allocator for Reader (ffbe386)";
-
- copyright: "Copyright 2015";
- tags: { native, coapp, JSON, nativepackage };
- language: en-US;
- };
-
- dependencies {
- packages : {
- //TODO: Add dependencies here in [pkg.name]/[version] form per newline
- //zlib/[1.2.8],
- };
- }
-
- // the files that go into the content folders
- files {
- #defines {
- SDK_ROOT = .\;
- }
-
- // grab all the files in the include folder
- // the folder that contains all the .h files will
- // automatically get added to the Includes path.
- nestedinclude += {
- #destination = ${d_include}rapidjson;
- "${SDK_ROOT}include\rapidjson\**\*.h"
- };
- };
-
- targets {
- // We're trying to be standard about these sorts of thing. (Will help with config.h later :D)
- //Defines += HAS_EQCORE;
- // Fix creating the package with Raggles' fork of CoApp
- Includes += "$(MSBuildThisFileDirectory)../..${d_include}";
- };
-} \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/readme.md b/graphics/asymptote/LspCpp/third_party/rapidjson/readme.md
deleted file mode 100644
index ac683b0514..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/readme.md
+++ /dev/null
@@ -1,210 +0,0 @@
-![RapidJSON logo](doc/logo/rapidjson.png)
-
-![Release version](https://img.shields.io/badge/release-v1.1.0-blue.svg)
-
-## A fast JSON parser/generator for C++ with both SAX/DOM style API
-
-Tencent is pleased to support the open source community by making RapidJSON available.
-
-Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-
-* [RapidJSON GitHub](https://github.com/Tencent/rapidjson/)
-* RapidJSON Documentation
- * [English](http://rapidjson.org/)
- * [简体中文](http://rapidjson.org/zh-cn/)
- * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/) with downloadable PDF/EPUB/MOBI, without API reference.
-
-## Build status
-
-| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
-| :---------------: | :-----------------: | :-------------------: |
-| ![lin-badge] | ![win-badge] | ![cov-badge] |
-
-[lin-badge]: https://travis-ci.org/Tencent/rapidjson.svg?branch=master "Travis build status"
-[lin-link]: https://travis-ci.org/Tencent/rapidjson "Travis build status"
-[win-badge]: https://ci.appveyor.com/api/projects/status/l6qulgqahcayidrf/branch/master?svg=true "AppVeyor build status"
-[win-link]: https://ci.appveyor.com/project/miloyip/rapidjson-0fdqj/branch/master "AppVeyor build status"
-[cov-badge]: https://coveralls.io/repos/Tencent/rapidjson/badge.svg?branch=master "Coveralls coverage"
-[cov-link]: https://coveralls.io/r/Tencent/rapidjson?branch=master "Coveralls coverage"
-
-## Introduction
-
-RapidJSON is a JSON parser and generator for C++. It was inspired by [RapidXml](http://rapidxml.sourceforge.net/).
-
-* RapidJSON is **small** but **complete**. It supports both SAX and DOM style API. The SAX parser is only a half thousand lines of code.
-
-* RapidJSON is **fast**. Its performance can be comparable to `strlen()`. It also optionally supports SSE2/SSE4.2 for acceleration.
-
-* RapidJSON is **self-contained** and **header-only**. It does not depend on external libraries such as BOOST. It even does not depend on STL.
-
-* RapidJSON is **memory-friendly**. Each JSON value occupies exactly 16 bytes for most 32/64-bit machines (excluding text string). By default it uses a fast memory allocator, and the parser allocates memory compactly during parsing.
-
-* RapidJSON is **Unicode-friendly**. It supports UTF-8, UTF-16, UTF-32 (LE & BE), and their detection, validation and transcoding internally. For example, you can read a UTF-8 file and let RapidJSON transcode the JSON strings into UTF-16 in the DOM. It also supports surrogates and "\u0000" (null character).
-
-More features can be read [here](doc/features.md).
-
-JSON(JavaScript Object Notation) is a light-weight data exchange format. RapidJSON should be in full compliance with RFC7159/ECMA-404, with optional support of relaxed syntax. More information about JSON can be obtained at
-* [Introducing JSON](http://json.org/)
-* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc7159)
-* [Standard ECMA-404: The JSON Data Interchange Format](https://www.ecma-international.org/publications/standards/Ecma-404.htm)
-
-## Highlights in v1.1 (2016-8-25)
-
-* Added [JSON Pointer](doc/pointer.md)
-* Added [JSON Schema](doc/schema.md)
-* Added [relaxed JSON syntax](doc/dom.md) (comment, trailing comma, NaN/Infinity)
-* Iterating array/object with [C++11 Range-based for loop](doc/tutorial.md)
-* Reduce memory overhead of each `Value` from 24 bytes to 16 bytes in x86-64 architecture.
-
-For other changes please refer to [change log](CHANGELOG.md).
-
-## Compatibility
-
-RapidJSON is cross-platform. Some platform/compiler combinations which have been tested are shown as follows.
-* Visual C++ 2008/2010/2013 on Windows (32/64-bit)
-* GNU C++ 3.8.x on Cygwin
-* Clang 3.4 on Mac OS X (32/64-bit) and iOS
-* Clang 3.4 on Android NDK
-
-Users can build and run the unit tests on their platform/compiler.
-
-## Installation
-
-RapidJSON is a header-only C++ library. Just copy the `include/rapidjson` folder to system or project's include path.
-
-Alternatively, if you are using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager you can download and install rapidjson with CMake integration in a single command:
-* vcpkg install rapidjson
-
-RapidJSON uses following software as its dependencies:
-* [CMake](https://cmake.org/) as a general build tool
-* (optional) [Doxygen](http://www.doxygen.org) to build documentation
-* (optional) [googletest](https://github.com/google/googletest) for unit and performance testing
-
-To generate user documentation and run tests please proceed with the steps below:
-
-1. Execute `git submodule update --init` to get the files of thirdparty submodules (google test).
-2. Create directory called `build` in rapidjson source directory.
-3. Change to `build` directory and run `cmake ..` command to configure your build. Windows users can do the same with cmake-gui application.
-4. On Windows, build the solution found in the build directory. On Linux, run `make` from the build directory.
-
-On successful build you will find compiled test and example binaries in `bin`
-directory. The generated documentation will be available in `doc/html`
-directory of the build tree. To run tests after finished build please run `make
-test` or `ctest` from your build tree. You can get detailed output using `ctest
--V` command.
-
-It is possible to install library system-wide by running `make install` command
-from the build tree with administrative privileges. This will install all files
-according to system preferences. Once RapidJSON is installed, it is possible
-to use it from other CMake projects by adding `find_package(RapidJSON)` line to
-your CMakeLists.txt.
-
-## Usage at a glance
-
-This simple example parses a JSON string into a document (DOM), make a simple modification of the DOM, and finally stringify the DOM to a JSON string.
-
-~~~~~~~~~~cpp
-// rapidjson/example/simpledom/simpledom.cpp`
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-
-int main() {
- // 1. Parse a JSON string into DOM.
- const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
- Document d;
- d.Parse(json);
-
- // 2. Modify it by DOM.
- Value& s = d["stars"];
- s.SetInt(s.GetInt() + 1);
-
- // 3. Stringify the DOM
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- d.Accept(writer);
-
- // Output {"project":"rapidjson","stars":11}
- std::cout << buffer.GetString() << std::endl;
- return 0;
-}
-~~~~~~~~~~
-
-Note that this example did not handle potential errors.
-
-The following diagram shows the process.
-
-![simpledom](doc/diagram/simpledom.png)
-
-More [examples](https://github.com/Tencent/rapidjson/tree/master/example) are available:
-
-* DOM API
- * [tutorial](https://github.com/Tencent/rapidjson/blob/master/example/tutorial/tutorial.cpp): Basic usage of DOM API.
-
-* SAX API
- * [simplereader](https://github.com/Tencent/rapidjson/blob/master/example/simplereader/simplereader.cpp): Dumps all SAX events while parsing a JSON by `Reader`.
- * [condense](https://github.com/Tencent/rapidjson/blob/master/example/condense/condense.cpp): A command line tool to rewrite a JSON, with all whitespaces removed.
- * [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp): A command line tool to rewrite a JSON with indents and newlines by `PrettyWriter`.
- * [capitalize](https://github.com/Tencent/rapidjson/blob/master/example/capitalize/capitalize.cpp): A command line tool to capitalize strings in JSON.
- * [messagereader](https://github.com/Tencent/rapidjson/blob/master/example/messagereader/messagereader.cpp): Parse a JSON message with SAX API.
- * [serialize](https://github.com/Tencent/rapidjson/blob/master/example/serialize/serialize.cpp): Serialize a C++ object into JSON with SAX API.
- * [jsonx](https://github.com/Tencent/rapidjson/blob/master/example/jsonx/jsonx.cpp): Implements a `JsonxWriter` which stringify SAX events into [JSONx](https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html) (a kind of XML) format. The example is a command line tool which converts input JSON into JSONx format.
-
-* Schema
- * [schemavalidator](https://github.com/Tencent/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp) : A command line tool to validate a JSON with a JSON schema.
-
-* Advanced
- * [prettyauto](https://github.com/Tencent/rapidjson/blob/master/example/prettyauto/prettyauto.cpp): A modified version of [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp) to automatically handle JSON with any UTF encodings.
- * [parsebyparts](https://github.com/Tencent/rapidjson/blob/master/example/parsebyparts/parsebyparts.cpp): Implements an `AsyncDocumentParser` which can parse JSON in parts, using C++11 thread.
- * [filterkey](https://github.com/Tencent/rapidjson/blob/master/example/filterkey/filterkey.cpp): A command line tool to remove all values with user-specified key.
- * [filterkeydom](https://github.com/Tencent/rapidjson/blob/master/example/filterkeydom/filterkeydom.cpp): Same tool as above, but it demonstrates how to use a generator to populate a `Document`.
-
-## Contributing
-
-RapidJSON welcomes contributions. When contributing, please follow the code below.
-
-### Issues
-
-Feel free to submit issues and enhancement requests.
-
-Please help us by providing **minimal reproducible examples**, because source code is easier to let other people understand what happens.
-For crash problems on certain platforms, please bring stack dump content with the detail of the OS, compiler, etc.
-
-Please try breakpoint debugging first, tell us what you found, see if we can start exploring based on more information been prepared.
-
-### Workflow
-
-In general, we follow the "fork-and-pull" Git workflow.
-
- 1. **Fork** the repo on GitHub
- 2. **Clone** the project to your own machine
- 3. **Checkout** a new branch on your fork, start developing on the branch
- 4. **Test** the change before commit, Make sure the changes pass all the tests, including `unittest` and `preftest`, please add test case for each new feature or bug-fix if needed.
- 5. **Commit** changes to your own branch
- 6. **Push** your work back up to your fork
- 7. Submit a **Pull request** so that we can review your changes
-
-NOTE: Be sure to merge the latest from "upstream" before making a pull request!
-
-### Copyright and Licensing
-
-You can copy and paste the license summary from below.
-
-```
-Tencent is pleased to support the open source community by making RapidJSON available.
-
-Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-
-Licensed under the MIT License (the "License"); you may not use this file except
-in compliance with the License. You may obtain a copy of the License at
-
-http://opensource.org/licenses/MIT
-
-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.
-```
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/readme.zh-cn.md b/graphics/asymptote/LspCpp/third_party/rapidjson/readme.zh-cn.md
deleted file mode 100644
index 216802e1b3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/readme.zh-cn.md
+++ /dev/null
@@ -1,152 +0,0 @@
-![RapidJSON logo](doc/logo/rapidjson.png)
-
-![Release version](https://img.shields.io/badge/release-v1.1.0-blue.svg)
-
-## 高效的 C++ JSON 解æžï¼ç”Ÿæˆå™¨ï¼Œæä¾› SAX åŠ DOM 风格 API
-
-Tencent is pleased to support the open source community by making RapidJSON available.
-
-Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-
-* [RapidJSON GitHub](https://github.com/Tencent/rapidjson/)
-* RapidJSON 文档
- * [English](http://rapidjson.org/)
- * [简体中文](http://rapidjson.org/zh-cn/)
- * [GitBook](https://www.gitbook.com/book/miloyip/rapidjson/details/zh-cn) å¯ä¸‹è½½ PDF/EPUB/MOBI,但ä¸å« API å‚考手册。
-
-## Build 状æ€
-
-| [Linux][lin-link] | [Windows][win-link] | [Coveralls][cov-link] |
-| :---------------: | :-----------------: | :-------------------: |
-| ![lin-badge] | ![win-badge] | ![cov-badge] |
-
-[lin-badge]: https://travis-ci.org/Tencent/rapidjson.svg?branch=master "Travis build status"
-[lin-link]: https://travis-ci.org/Tencent/rapidjson "Travis build status"
-[win-badge]: https://ci.appveyor.com/api/projects/status/l6qulgqahcayidrf/branch/master?svg=true "AppVeyor build status"
-[win-link]: https://ci.appveyor.com/project/miloyip/rapidjson-0fdqj/branch/master "AppVeyor build status"
-[cov-badge]: https://coveralls.io/repos/Tencent/rapidjson/badge.svg?branch=master "Coveralls coverage"
-[cov-link]: https://coveralls.io/r/Tencent/rapidjson?branch=master "Coveralls coverage"
-
-## 简介
-
-RapidJSON 是一个 C++ çš„ JSON 解æžå™¨åŠç”Ÿæˆå™¨ã€‚它的çµæ„Ÿæ¥è‡ª [RapidXml](http://rapidxml.sourceforge.net/)。
-
-* RapidJSON å°è€Œå…¨ã€‚它åŒæ—¶æ”¯æŒ SAX å’Œ DOM 风格的 API。SAX 解æžå™¨åªæœ‰çº¦ 500 行代ç ã€‚
-
-* RapidJSON 快。它的性能å¯ä¸Ž `strlen()` 相比。å¯æ”¯æŒ SSE2/SSE4.2 加速。
-
-* RapidJSON 独立。它ä¸ä¾èµ–于 BOOST 等外部库。它甚至ä¸ä¾èµ–于 STL。
-
-* RapidJSON 对内存å‹å¥½ã€‚在大部分 32/64 ä½æœºå™¨ä¸Šï¼Œæ¯ä¸ª JSON 值åªå  16 字节(除字符串外)。它预设使用一个快速的内存分é…器,令分æžå™¨å¯ä»¥ç´§å‡‘地分é…内存。
-
-* RapidJSON 对 Unicode å‹å¥½ã€‚å®ƒæ”¯æŒ UTF-8ã€UTF-16ã€UTF-32 (大端åºï¼å°ç«¯åº),并内部支æŒè¿™äº›ç¼–ç çš„检测ã€æ ¡éªŒåŠè½¬ç ã€‚例如,RapidJSON å¯ä»¥åœ¨åˆ†æžä¸€ä¸ª UTF-8 文件至 DOM 时,把当中的 JSON 字符串转ç è‡³ UTF-16。它也支æŒä»£ç†å¯¹ï¼ˆsurrogate pairï¼‰åŠ `"\u0000"`(空字符)。
-
-在 [这里](doc/features.zh-cn.md) å¯è¯»å–更多特点。
-
-JSON(JavaScript Object Notation)是一个轻é‡çš„æ•°æ®äº¤æ¢æ ¼å¼ã€‚RapidJSON 应该完全éµä»Ž RFC7159/ECMA-404,并支æŒå¯é€‰çš„放宽语法。 关于 JSON 的更多信æ¯å¯å‚考:
-* [Introducing JSON](http://json.org/)
-* [RFC7159: The JavaScript Object Notation (JSON) Data Interchange Format](https://tools.ietf.org/html/rfc7159)
-* [Standard ECMA-404: The JSON Data Interchange Format](https://www.ecma-international.org/publications/standards/Ecma-404.htm)
-
-## v1.1 中的亮点 (2016-8-25)
-
-* 加入 [JSON Pointer](doc/pointer.zh-cn.md) 功能,å¯æ›´ç®€å•åœ°è®¿é—®åŠæ›´æ”¹ DOM。
-* 加入 [JSON Schema](doc/schema.zh-cn.md) 功能,å¯åœ¨è§£æžæˆ–ç”Ÿæˆ JSON 时进行校验。
-* 加入 [放宽的 JSON 语法](doc/dom.zh-cn.md) (注释ã€å°¾éšé€—å·ã€NaN/Infinity)
-* 使用 [C++11 范围 for 循环](doc/tutorial.zh-cn.md) 去é历 array å’Œ object。
-* 在 x86-64 架构下,缩å‡æ¯ä¸ª `Value` 的内存开销从 24 字节至 16 字节。
-
-其他改动请å‚考 [change log](CHANGELOG.md).
-
-## 兼容性
-
-RapidJSON 是跨平å°çš„。以下是一些曾测试的平å°ï¼ç¼–译器组åˆï¼š
-* Visual C++ 2008/2010/2013 在 Windows (32/64-bit)
-* GNU C++ 3.8.x 在 Cygwin
-* Clang 3.4 在 Mac OS X (32/64-bit) åŠ iOS
-* Clang 3.4 在 Android NDK
-
-用户也å¯ä»¥åœ¨ä»–们的平å°ä¸Šç”ŸæˆåŠæ‰§è¡Œå•å…ƒæµ‹è¯•ã€‚
-
-## 安装
-
-RapidJSON 是åªæœ‰å¤´æ–‡ä»¶çš„ C++ 库。åªéœ€æŠŠ `include/rapidjson` 目录å¤åˆ¶è‡³ç³»ç»Ÿæˆ–项目的 include 目录中。
-
-RapidJSON ä¾èµ–于以下软件:
-* [CMake](https://cmake.org/) 作为通用生æˆå·¥å…·
-* (optional) [Doxygen](http://www.doxygen.org) 用于生æˆæ–‡æ¡£
-* (optional) [googletest](https://github.com/google/googletest) 用于å•å…ƒåŠæ€§èƒ½æµ‹è¯•
-
-生æˆæµ‹è¯•åŠä¾‹å­çš„步骤:
-
-1. 执行 `git submodule update --init` åŽ»èŽ·å– thirdparty submodules (google test)。
-2. 在 rapidjson 目录下,建立一个 `build` 目录。
-3. 在 `build` 目录下执行 `cmake ..` 命令以设置生æˆã€‚Windows 用户å¯ä½¿ç”¨ cmake-gui 应用程åºã€‚
-4. 在 Windows 下,编译生æˆåœ¨ build 目录中的 solution。在 Linux 下,于 build 目录è¿è¡Œ `make`。
-
-æˆåŠŸç”ŸæˆåŽï¼Œä½ ä¼šåœ¨ `bin` 的目录下找到编译åŽçš„测试åŠä¾‹å­å¯æ‰§è¡Œæ–‡ä»¶ã€‚而生æˆçš„文档将ä½äºŽ build 下的 `doc/html` 目录。è¦æ‰§è¡Œæµ‹è¯•ï¼Œè¯·åœ¨ build 下执行 `make test` 或 `ctest`。使用 `ctest -V` 命令å¯èŽ·å–详细的输出。
-
-我们也å¯ä»¥æŠŠç¨‹åºåº“安装至全系统中,åªè¦åœ¨å…·ç®¡ç†æƒé™ä¸‹ä»Ž build 目录执行 `make install` 命令。这样会按系统的å好设置安装所有文件。当安装 RapidJSON åŽï¼Œå…¶ä»–çš„ CMake 项目需è¦ä½¿ç”¨å®ƒæ—¶ï¼Œå¯ä»¥é€šè¿‡åœ¨ `CMakeLists.txt` åŠ å…¥ä¸€å¥ `find_package(RapidJSON)`。
-
-## 用法一览
-
-此简å•ä¾‹å­è§£æžä¸€ä¸ª JSON 字符串至一个 document (DOM),对 DOM 作出简å•ä¿®æ”¹ï¼Œæœ€ç»ˆæŠŠ DOM 转æ¢ï¼ˆstringify)至 JSON 字符串。
-
-~~~~~~~~~~cpp
-// rapidjson/example/simpledom/simpledom.cpp`
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include <iostream>
-
-using namespace rapidjson;
-
-int main() {
- // 1. 把 JSON 解æžè‡³ DOM。
- const char* json = "{\"project\":\"rapidjson\",\"stars\":10}";
- Document d;
- d.Parse(json);
-
- // 2. 利用 DOM 作出修改。
- Value& s = d["stars"];
- s.SetInt(s.GetInt() + 1);
-
- // 3. 把 DOM 转æ¢ï¼ˆstringifyï¼‰æˆ JSON。
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- d.Accept(writer);
-
- // Output {"project":"rapidjson","stars":11}
- std::cout << buffer.GetString() << std::endl;
- return 0;
-}
-~~~~~~~~~~
-
-注æ„此例å­å¹¶æ²¡æœ‰å¤„ç†æ½œåœ¨é”™è¯¯ã€‚
-
-下图展示执行过程。
-
-![simpledom](doc/diagram/simpledom.png)
-
-还有许多 [例å­](https://github.com/Tencent/rapidjson/tree/master/example) å¯ä¾›å‚考:
-
-* DOM API
- * [tutorial](https://github.com/Tencent/rapidjson/blob/master/example/tutorial/tutorial.cpp): DOM API 的基本使用方法。
-
-* SAX API
- * [simplereader](https://github.com/Tencent/rapidjson/blob/master/example/simplereader/simplereader.cpp): 使用 `Reader` è§£æž JSON 时,打å°æ‰€æœ‰ SAX 事件。
- * [condense](https://github.com/Tencent/rapidjson/blob/master/example/condense/condense.cpp): 移除 JSON 中所有空白符的命令行工具。
- * [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp): 为 JSON 加入缩进与æ¢è¡Œçš„命令行工具,当中使用了 `PrettyWriter`。
- * [capitalize](https://github.com/Tencent/rapidjson/blob/master/example/capitalize/capitalize.cpp): 把 JSON 中所有字符串改为大写的命令行工具。
- * [messagereader](https://github.com/Tencent/rapidjson/blob/master/example/messagereader/messagereader.cpp): 使用 SAX API 去解æžä¸€ä¸ª JSON 报文。
- * [serialize](https://github.com/Tencent/rapidjson/blob/master/example/serialize/serialize.cpp): 使用 SAX API 去åºåˆ—化 C++ å¯¹è±¡ï¼Œç”Ÿæˆ JSON。
- * [jsonx](https://github.com/Tencent/rapidjson/blob/master/example/jsonx/jsonx.cpp): 实现了一个 `JsonxWriter`,它能把 SAX äº‹ä»¶å†™æˆ [JSONx](https://www-01.ibm.com/support/knowledgecenter/SS9H2Y_7.1.0/com.ibm.dp.doc/json_jsonx.html)ï¼ˆä¸€ç§ XML)格å¼ã€‚这个例å­æ˜¯æŠŠ JSON 输入转æ¢æˆ JSONx æ ¼å¼çš„命令行工具。
-
-* Schema API
- * [schemavalidator](https://github.com/Tencent/rapidjson/blob/master/example/schemavalidator/schemavalidator.cpp): 使用 JSON Schema 去校验 JSON 的命令行工具。
-
-* 进阶
- * [prettyauto](https://github.com/Tencent/rapidjson/blob/master/example/prettyauto/prettyauto.cpp): [pretty](https://github.com/Tencent/rapidjson/blob/master/example/pretty/pretty.cpp) 的修改版本,å¯è‡ªåŠ¨å¤„ç†ä»»ä½• UTF ç¼–ç çš„ JSON。
- * [parsebyparts](https://github.com/Tencent/rapidjson/blob/master/example/parsebyparts/parsebyparts.cpp): 这例å­ä¸­çš„ `AsyncDocumentParser` 类使用 C++ 线程æ¥é€æ®µè§£æž JSON。
- * [filterkey](https://github.com/Tencent/rapidjson/blob/master/example/filterkey/filterkey.cpp): 移å–使用者指定的键值的命令行工具。
- * [filterkeydom](https://github.com/Tencent/rapidjson/blob/master/example/filterkey/filterkey.cpp): 如上的工具,但展示如何使用生æˆå™¨ï¼ˆgenerator)去填充一个 `Document`。
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/test/CMakeLists.txt
deleted file mode 100644
index 11c1b04c7d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-find_package(GTestSrc)
-
-IF(GTESTSRC_FOUND)
- enable_testing()
-
- if (WIN32 AND (NOT CYGWIN) AND (NOT MINGW))
- set(gtest_disable_pthreads ON)
- set(gtest_force_shared_crt ON)
- endif()
-
- add_subdirectory(${GTEST_SOURCE_DIR} ${CMAKE_BINARY_DIR}/googletest)
- include_directories(SYSTEM ${GTEST_INCLUDE_DIR})
-
- set(TEST_LIBRARIES gtest gtest_main)
-
- add_custom_target(tests ALL)
- add_subdirectory(perftest)
- add_subdirectory(unittest)
-
-ENDIF(GTESTSRC_FOUND)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/CMakeLists.txt
deleted file mode 100644
index 035e544d91..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/CMakeLists.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-set(PERFTEST_SOURCES
- misctest.cpp
- perftest.cpp
- platformtest.cpp
- rapidjsontest.cpp
- schematest.cpp)
-
-add_executable(perftest ${PERFTEST_SOURCES})
-target_link_libraries(perftest ${TEST_LIBRARIES})
-
-add_dependencies(tests perftest)
-
-find_program(CCACHE_FOUND ccache)
-if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
- endif()
-endif(CCACHE_FOUND)
-
-set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
-
-IF(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug"))
-add_test(NAME perftest
- COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/perftest
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
-ENDIF()
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/misctest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/misctest.cpp
deleted file mode 100644
index f7bf8a985f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/misctest.cpp
+++ /dev/null
@@ -1,974 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "perftest.h"
-
-#if TEST_MISC
-
-#define __STDC_FORMAT_MACROS
-#include "rapidjson/stringbuffer.h"
-
-#define protected public
-#include "rapidjson/writer.h"
-#undef private
-
-class Misc : public PerfTest {
-};
-
-// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
-// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
-
-#define UTF8_ACCEPT 0
-#define UTF8_REJECT 12
-
-static const unsigned char utf8d[] = {
- // The first part of the table maps bytes to character classes that
- // to reduce the size of the transition table and create bitmasks.
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
-
- // The second part is a transition table that maps a combination
- // of a state of the automaton and a character class to a state.
- 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
- 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
- 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
- 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
- 12,36,12,12,12,12,12,12,12,12,12,12,
-};
-
-static unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {
- unsigned type = utf8d[byte];
-
- *codep = (*state != UTF8_ACCEPT) ?
- (byte & 0x3fu) | (*codep << 6) :
- (0xff >> type) & (byte);
-
- *state = utf8d[256 + *state + type];
- return *state;
-}
-
-static bool IsUTF8(unsigned char* s) {
- unsigned codepoint, state = 0;
-
- while (*s)
- decode(&state, &codepoint, *s++);
-
- return state == UTF8_ACCEPT;
-}
-
-TEST_F(Misc, Hoehrmann_IsUTF8) {
- for (size_t i = 0; i < kTrialCount; i++) {
- EXPECT_TRUE(IsUTF8((unsigned char*)json_));
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// CountDecimalDigit: Count number of decimal places
-
-inline unsigned CountDecimalDigit_naive(unsigned n) {
- unsigned count = 1;
- while (n >= 10) {
- n /= 10;
- count++;
- }
- return count;
-}
-
-inline unsigned CountDecimalDigit_enroll4(unsigned n) {
- unsigned count = 1;
- while (n >= 10000) {
- n /= 10000u;
- count += 4;
- }
- if (n < 10) return count;
- if (n < 100) return count + 1;
- if (n < 1000) return count + 2;
- return count + 3;
-}
-
-inline unsigned CountDecimalDigit64_enroll4(uint64_t n) {
- unsigned count = 1;
- while (n >= 10000) {
- n /= 10000u;
- count += 4;
- }
- if (n < 10) return count;
- if (n < 100) return count + 1;
- if (n < 1000) return count + 2;
- return count + 3;
-}
-
-inline unsigned CountDecimalDigit_fast(unsigned n) {
- static const uint32_t powers_of_10[] = {
- 0,
- 10,
- 100,
- 1000,
- 10000,
- 100000,
- 1000000,
- 10000000,
- 100000000,
- 1000000000
- };
-
-#if defined(_M_IX86) || defined(_M_X64)
- unsigned long i = 0;
- _BitScanReverse(&i, n | 1);
- uint32_t t = (i + 1) * 1233 >> 12;
-#elif defined(__GNUC__)
- uint32_t t = (32 - __builtin_clz(n | 1)) * 1233 >> 12;
-#else
-#error
-#endif
- return t - (n < powers_of_10[t]) + 1;
-}
-
-inline unsigned CountDecimalDigit64_fast(uint64_t n) {
- static const uint64_t powers_of_10[] = {
- 0,
- 10,
- 100,
- 1000,
- 10000,
- 100000,
- 1000000,
- 10000000,
- 100000000,
- 1000000000,
- 10000000000,
- 100000000000,
- 1000000000000,
- 10000000000000,
- 100000000000000,
- 1000000000000000,
- 10000000000000000,
- 100000000000000000,
- 1000000000000000000,
- 10000000000000000000U
- };
-
-#if defined(_M_IX86)
- uint64_t m = n | 1;
- unsigned long i = 0;
- if (_BitScanReverse(&i, m >> 32))
- i += 32;
- else
- _BitScanReverse(&i, m & 0xFFFFFFFF);
- uint32_t t = (i + 1) * 1233 >> 12;
-#elif defined(_M_X64)
- unsigned long i = 0;
- _BitScanReverse64(&i, n | 1);
- uint32_t t = (i + 1) * 1233 >> 12;
-#elif defined(__GNUC__)
- uint32_t t = (64 - __builtin_clzll(n | 1)) * 1233 >> 12;
-#else
-#error
-#endif
-
- return t - (n < powers_of_10[t]) + 1;
-}
-
-#if 0
-// Exhaustive, very slow
-TEST_F(Misc, CountDecimalDigit_Verify) {
- unsigned i = 0;
- do {
- if (i % (65536 * 256) == 0)
- printf("%u\n", i);
- ASSERT_EQ(CountDecimalDigit_enroll4(i), CountDecimalDigit_fast(i));
- i++;
- } while (i != 0);
-}
-
-static const unsigned kDigits10Trial = 1000000000u;
-TEST_F(Misc, CountDecimalDigit_naive) {
- unsigned sum = 0;
- for (unsigned i = 0; i < kDigits10Trial; i++)
- sum += CountDecimalDigit_naive(i);
- printf("%u\n", sum);
-}
-
-TEST_F(Misc, CountDecimalDigit_enroll4) {
- unsigned sum = 0;
- for (unsigned i = 0; i < kDigits10Trial; i++)
- sum += CountDecimalDigit_enroll4(i);
- printf("%u\n", sum);
-}
-
-TEST_F(Misc, CountDecimalDigit_fast) {
- unsigned sum = 0;
- for (unsigned i = 0; i < kDigits10Trial; i++)
- sum += CountDecimalDigit_fast(i);
- printf("%u\n", sum);
-}
-#endif
-
-TEST_F(Misc, CountDecimalDigit64_VerifyFast) {
- uint64_t i = 1, j;
- do {
- //printf("%" PRIu64 "\n", i);
- ASSERT_EQ(CountDecimalDigit64_enroll4(i), CountDecimalDigit64_fast(i));
- j = i;
- i *= 3;
- } while (j < i);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// integer-to-string conversion
-
-// https://gist.github.com/anonymous/7179097
-static const int randval[] ={
- 936116, 369532, 453755, -72860, 209713, 268347, 435278, -360266, -416287, -182064,
- -644712, 944969, 640463, -366588, 471577, -69401, -744294, -505829, 923883, 831785,
- -601136, -636767, -437054, 591718, 100758, 231907, -719038, 973540, -605220, 506659,
- -871653, 462533, 764843, -919138, 404305, -630931, -288711, -751454, -173726, -718208,
- 432689, -281157, 360737, 659827, 19174, -376450, 769984, -858198, 439127, 734703,
- -683426, 7, 386135, 186997, -643900, -744422, -604708, -629545, 42313, -933592,
- -635566, 182308, 439024, -367219, -73924, -516649, 421935, -470515, 413507, -78952,
- -427917, -561158, 737176, 94538, 572322, 405217, 709266, -357278, -908099, -425447,
- 601119, 750712, -862285, -177869, 900102, 384877, 157859, -641680, 503738, -702558,
- 278225, 463290, 268378, -212840, 580090, 347346, -473985, -950968, -114547, -839893,
- -738032, -789424, 409540, 493495, 432099, 119755, 905004, -174834, 338266, 234298,
- 74641, -965136, -754593, 685273, 466924, 920560, 385062, 796402, -67229, 994864,
- 376974, 299869, -647540, -128724, 469890, -163167, -547803, -743363, 486463, -621028,
- 612288, 27459, -514224, 126342, -66612, 803409, -777155, -336453, -284002, 472451,
- 342390, -163630, 908356, -456147, -825607, 268092, -974715, 287227, 227890, -524101,
- 616370, -782456, 922098, -624001, -813690, 171605, -192962, 796151, 707183, -95696,
- -23163, -721260, 508892, 430715, 791331, 482048, -996102, 863274, 275406, -8279,
- -556239, -902076, 268647, -818565, 260069, -798232, -172924, -566311, -806503, -885992,
- 813969, -78468, 956632, 304288, 494867, -508784, 381751, 151264, 762953, 76352,
- 594902, 375424, 271700, -743062, 390176, 924237, 772574, 676610, 435752, -153847,
- 3959, -971937, -294181, -538049, -344620, -170136, 19120, -703157, 868152, -657961,
- -818631, 219015, -872729, -940001, -956570, 880727, -345910, 942913, -942271, -788115,
- 225294, 701108, -517736, -416071, 281940, 488730, 942698, 711494, 838382, -892302,
- -533028, 103052, 528823, 901515, 949577, 159364, 718227, -241814, -733661, -462928,
- -495829, 165170, 513580, -629188, -509571, -459083, 198437, 77198, -644612, 811276,
- -422298, -860842, -52584, 920369, 686424, -530667, -243476, 49763, 345866, -411960,
- -114863, 470810, -302860, 683007, -509080, 2, -174981, -772163, -48697, 447770,
- -268246, 213268, 269215, 78810, -236340, -639140, -864323, 505113, -986569, -325215,
- 541859, 163070, -819998, -645161, -583336, 573414, 696417, -132375, 3, -294501,
- 320435, 682591, 840008, 351740, 426951, 609354, 898154, -943254, 227321, -859793,
- -727993, 44137, -497965, -782239, 14955, -746080, -243366, 9837, -233083, 606507,
- -995864, -615287, -994307, 602715, 770771, -315040, 610860, 446102, -307120, 710728,
- -590392, -230474, -762625, -637525, 134963, -202700, -766902, -985541, 218163, 682009,
- 926051, 525156, -61195, 403211, -810098, 245539, -431733, 179998, -806533, 745943,
- 447597, 131973, -187130, 826019, 286107, -937230, -577419, 20254, 681802, -340500,
- 323080, 266283, -667617, 309656, 416386, 611863, 759991, -534257, 523112, -634892,
- -169913, -204905, -909867, -882185, -944908, 741811, -717675, 967007, -317396, 407230,
- -412805, 792905, 994873, 744793, -456797, 713493, 355232, 116900, -945199, 880539,
- 342505, -580824, -262273, 982968, -349497, -735488, 311767, -455191, 570918, 389734,
- -958386, 10262, -99267, 155481, 304210, 204724, 704367, -144893, -233664, -671441,
- 896849, 408613, 762236, 322697, 981321, 688476, 13663, -970704, -379507, 896412,
- 977084, 348869, 875948, 341348, 318710, 512081, 6163, 669044, 833295, 811883,
- 708756, -802534, -536057, 608413, -389625, -694603, 541106, -110037, 720322, -540581,
- 645420, 32980, 62442, 510157, -981870, -87093, -325960, -500494, -718291, -67889,
- 991501, 374804, 769026, -978869, 294747, 714623, 413327, -199164, 671368, 804789,
- -362507, 798196, -170790, -568895, -869379, 62020, -316693, -837793, 644994, -39341,
- -417504, -243068, -957756, 99072, 622234, -739992, 225668, 8863, -505910, 82483,
- -559244, 241572, 1315, -36175, -54990, 376813, -11, 162647, -688204, -486163,
- -54934, -197470, 744223, -762707, 732540, 996618, 351561, -445933, -898491, 486531,
- 456151, 15276, 290186, -817110, -52995, 313046, -452533, -96267, 94470, -500176,
- -818026, -398071, -810548, -143325, -819741, 1338, -897676, -101577, -855445, 37309,
- 285742, 953804, -777927, -926962, -811217, -936744, -952245, -802300, -490188, -964953,
- -552279, 329142, -570048, -505756, 682898, -381089, -14352, 175138, 152390, -582268,
- -485137, 717035, 805329, 239572, -730409, 209643, -184403, -385864, 675086, 819648,
- 629058, -527109, -488666, -171981, 532788, 552441, 174666, 984921, 766514, 758787,
- 716309, 338801, -978004, -412163, 876079, -734212, 789557, -160491, -522719, 56644,
- -991, -286038, -53983, 663740, 809812, 919889, -717502, -137704, 220511, 184396,
- -825740, -588447, 430870, 124309, 135956, 558662, -307087, -788055, -451328, 812260,
- 931601, 324347, -482989, -117858, -278861, 189068, -172774, 929057, 293787, 198161,
- -342386, -47173, 906555, -759955, -12779, 777604, -97869, 899320, 927486, -25284,
- -848550, 259450, -485856, -17820, 88, 171400, 235492, -326783, -340793, 886886,
- 112428, -246280, 5979, 648444, -114982, 991013, -56489, -9497, 419706, 632820,
- -341664, 393926, -848977, -22538, 257307, 773731, -905319, 491153, 734883, -868212,
- -951053, 644458, -580758, 764735, 584316, 297077, 28852, -397710, -953669, 201772,
- 879050, -198237, -588468, 448102, -116837, 770007, -231812, 642906, -582166, -885828,
- 9, 305082, -996577, 303559, 75008, -772956, -447960, 599825, -295552, 870739,
- -386278, -950300, 485359, -457081, 629461, -850276, 550496, -451755, -620841, -11766,
- -950137, 832337, 28711, -273398, -507197, 91921, -271360, -705991, -753220, -388968,
- 967945, 340434, -320883, -662793, -554617, -574568, 477946, -6148, -129519, 689217,
- 920020, -656315, -974523, -212525, 80921, -612532, 645096, 545655, 655713, -591631,
- -307385, -816688, -618823, -113713, 526430, 673063, 735916, -809095, -850417, 639004,
- 432281, -388185, 270708, 860146, -39902, -786157, -258180, -246169, -966720, -264957,
- 548072, -306010, -57367, -635665, 933824, 70553, -989936, -488741, 72411, -452509,
- 529831, 956277, 449019, -577850, -360986, -803418, 48833, 296073, 203430, 609591,
- 715483, 470964, 658106, -718254, -96424, 790163, 334739, 181070, -373578, 5,
- -435088, 329841, 330939, -256602, 394355, 912412, 231910, 927278, -661933, 788539,
- -769664, -893274, -96856, 298205, 901043, -608122, -527430, 183618, -553963, -35246,
- -393924, 948832, -483198, 594501, 35460, -407007, 93494, -336881, -634072, 984205,
- -812161, 944664, -31062, 753872, 823933, -69566, 50445, 290147, 85134, 34706,
- 551902, 405202, -991246, -84642, 154341, 316432, -695101, -651588, -5030, 137564,
- -294665, 332541, 528307, -90572, -344923, 523766, -758498, -968047, 339028, 494578,
- 593129, -725773, 31834, -718406, -208638, 159665, -2043, 673344, -442767, 75816,
- 755442, 769257, -158730, -410272, 691688, 589550, -878398, -184121, 460679, 346312,
- 294163, -544602, 653308, 254167, -276979, 52073, -892684, 887653, -41222, 983065,
- -68258, -408799, -99069, -674069, -863635, -32890, 622757, -743862, 40872, -4837,
- -967228, 522370, -903951, -818669, 524459, 514702, 925801, 20007, -299229, 579348,
- 626021, 430089, 348139, -562692, -607728, -130606, -928451, -424793, -458647, -448892,
- -312230, 143337, 109746, 880042, -339658, -785614, 938995, 540916, 118429, 661351,
- -402967, 404729, -40918, -976535, 743230, 713110, 440182, -381314, -499252, 74613,
- 193652, 912717, 491323, 583633, 324691, 459397, 281253, 195540, -2764, -888651,
- 892449, 132663, -478373, -430002, -314551, 527826, 247165, 557966, 554778, 481531,
- -946634, 431685, -769059, -348371, 174046, 184597, -354867, 584422, 227390, -850397,
- -542924, -849093, -737769, 325359, 736314, 269101, 767940, 674809, 81413, -447458,
- 445076, 189072, 906218, 502688, -718476, -863827, -731381, 100660, 623249, 710008,
- 572060, 922203, 685740, 55096, 263394, -243695, -353910, -516788, 388471, 455165,
- 844103, -643772, 363976, 268875, -899450, 104470, 104029, -238874, -274659, 732969,
- -676443, 953291, -916289, -861849, -242344, 958083, -479593, -970395, 799831, 277841,
- -243236, -283462, -201510, 166263, -259105, -575706, 878926, 891064, 895297, 655262,
- -34807, -809833, -89281, 342585, 554920, 1, 902141, -333425, 139703, 852318,
- -618438, 329498, -932596, -692836, -513372, 733656, -523411, 85779, 500478, -682697,
- -502836, 138776, 156341, -420037, -557964, -556378, 710993, -50383, -877159, 916334,
- 132996, 583516, -603392, -111615, -12288, -780214, 476780, 123327, 137607, 519956,
- 745837, 17358, -158581, -53490
-};
-static const size_t randvalCount = sizeof(randval) / sizeof(randval[0]);
-static const size_t kItoaTrialCount = 10000;
-
-static const char digits[201] =
-"0001020304050607080910111213141516171819"
-"2021222324252627282930313233343536373839"
-"4041424344454647484950515253545556575859"
-"6061626364656667686970717273747576777879"
-"8081828384858687888990919293949596979899";
-
-// Prevent code being optimized out
-//#define OUTPUT_LENGTH(length) printf("", length)
-#define OUTPUT_LENGTH(length) printf("%u\n", (unsigned)length)
-
-template<typename OutputStream>
-class Writer1 {
-public:
- Writer1() : os_() {}
- Writer1(OutputStream& os) : os_(&os) {}
-
- void Reset(OutputStream& os) {
- os_ = &os;
- }
-
- bool WriteInt(int i) {
- if (i < 0) {
- os_->Put('-');
- i = -i;
- }
- return WriteUint((unsigned)i);
- }
-
- bool WriteUint(unsigned u) {
- char buffer[10];
- char *p = buffer;
- do {
- *p++ = char(u % 10) + '0';
- u /= 10;
- } while (u > 0);
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
- bool WriteInt64(int64_t i64) {
- if (i64 < 0) {
- os_->Put('-');
- i64 = -i64;
- }
- WriteUint64((uint64_t)i64);
- return true;
- }
-
- bool WriteUint64(uint64_t u64) {
- char buffer[20];
- char *p = buffer;
- do {
- *p++ = char(u64 % 10) + '0';
- u64 /= 10;
- } while (u64 > 0);
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
-private:
- OutputStream* os_;
-};
-
-template<>
-bool Writer1<rapidjson::StringBuffer>::WriteUint(unsigned u) {
- char buffer[10];
- char* p = buffer;
- do {
- *p++ = char(u % 10) + '0';
- u /= 10;
- } while (u > 0);
-
- char* d = os_->Push(p - buffer);
- do {
- --p;
- *d++ = *p;
- } while (p != buffer);
- return true;
-}
-
-// Using digits LUT to reduce division/modulo
-template<typename OutputStream>
-class Writer2 {
-public:
- Writer2() : os_() {}
- Writer2(OutputStream& os) : os_(&os) {}
-
- void Reset(OutputStream& os) {
- os_ = &os;
- }
-
- bool WriteInt(int i) {
- if (i < 0) {
- os_->Put('-');
- i = -i;
- }
- return WriteUint((unsigned)i);
- }
-
- bool WriteUint(unsigned u) {
- char buffer[10];
- char* p = buffer;
- while (u >= 100) {
- const unsigned i = (u % 100) << 1;
- u /= 100;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
- if (u < 10)
- *p++ = char(u) + '0';
- else {
- const unsigned i = u << 1;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
- bool WriteInt64(int64_t i64) {
- if (i64 < 0) {
- os_->Put('-');
- i64 = -i64;
- }
- WriteUint64((uint64_t)i64);
- return true;
- }
-
- bool WriteUint64(uint64_t u64) {
- char buffer[20];
- char* p = buffer;
- while (u64 >= 100) {
- const unsigned i = static_cast<unsigned>(u64 % 100) << 1;
- u64 /= 100;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
- if (u64 < 10)
- *p++ = char(u64) + '0';
- else {
- const unsigned i = static_cast<unsigned>(u64) << 1;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
-private:
- OutputStream* os_;
-};
-
-// First pass to count digits
-template<typename OutputStream>
-class Writer3 {
-public:
- Writer3() : os_() {}
- Writer3(OutputStream& os) : os_(&os) {}
-
- void Reset(OutputStream& os) {
- os_ = &os;
- }
-
- bool WriteInt(int i) {
- if (i < 0) {
- os_->Put('-');
- i = -i;
- }
- return WriteUint((unsigned)i);
- }
-
- bool WriteUint(unsigned u) {
- char buffer[10];
- char *p = buffer;
- do {
- *p++ = char(u % 10) + '0';
- u /= 10;
- } while (u > 0);
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
- bool WriteInt64(int64_t i64) {
- if (i64 < 0) {
- os_->Put('-');
- i64 = -i64;
- }
- WriteUint64((uint64_t)i64);
- return true;
- }
-
- bool WriteUint64(uint64_t u64) {
- char buffer[20];
- char *p = buffer;
- do {
- *p++ = char(u64 % 10) + '0';
- u64 /= 10;
- } while (u64 > 0);
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
-private:
- void WriteUintReverse(char* d, unsigned u) {
- do {
- *--d = char(u % 10) + '0';
- u /= 10;
- } while (u > 0);
- }
-
- void WriteUint64Reverse(char* d, uint64_t u) {
- do {
- *--d = char(u % 10) + '0';
- u /= 10;
- } while (u > 0);
- }
-
- OutputStream* os_;
-};
-
-template<>
-inline bool Writer3<rapidjson::StringBuffer>::WriteUint(unsigned u) {
- unsigned digit = CountDecimalDigit_fast(u);
- WriteUintReverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer3<rapidjson::InsituStringStream>::WriteUint(unsigned u) {
- unsigned digit = CountDecimalDigit_fast(u);
- WriteUintReverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer3<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {
- unsigned digit = CountDecimalDigit64_fast(u);
- WriteUint64Reverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer3<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {
- unsigned digit = CountDecimalDigit64_fast(u);
- WriteUint64Reverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-// Using digits LUT to reduce division/modulo, two passes
-template<typename OutputStream>
-class Writer4 {
-public:
- Writer4() : os_() {}
- Writer4(OutputStream& os) : os_(&os) {}
-
- void Reset(OutputStream& os) {
- os_ = &os;
- }
-
- bool WriteInt(int i) {
- if (i < 0) {
- os_->Put('-');
- i = -i;
- }
- return WriteUint((unsigned)i);
- }
-
- bool WriteUint(unsigned u) {
- char buffer[10];
- char* p = buffer;
- while (u >= 100) {
- const unsigned i = (u % 100) << 1;
- u /= 100;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
- if (u < 10)
- *p++ = char(u) + '0';
- else {
- const unsigned i = u << 1;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
- bool WriteInt64(int64_t i64) {
- if (i64 < 0) {
- os_->Put('-');
- i64 = -i64;
- }
- WriteUint64((uint64_t)i64);
- return true;
- }
-
- bool WriteUint64(uint64_t u64) {
- char buffer[20];
- char* p = buffer;
- while (u64 >= 100) {
- const unsigned i = static_cast<unsigned>(u64 % 100) << 1;
- u64 /= 100;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
- if (u64 < 10)
- *p++ = char(u64) + '0';
- else {
- const unsigned i = static_cast<unsigned>(u64) << 1;
- *p++ = digits[i + 1];
- *p++ = digits[i];
- }
-
- do {
- --p;
- os_->Put(*p);
- } while (p != buffer);
- return true;
- }
-
-private:
- void WriteUintReverse(char* d, unsigned u) {
- while (u >= 100) {
- const unsigned i = (u % 100) << 1;
- u /= 100;
- *--d = digits[i + 1];
- *--d = digits[i];
- }
- if (u < 10) {
- *--d = char(u) + '0';
- }
- else {
- const unsigned i = u << 1;
- *--d = digits[i + 1];
- *--d = digits[i];
- }
- }
-
- void WriteUint64Reverse(char* d, uint64_t u) {
- while (u >= 100) {
- const unsigned i = (u % 100) << 1;
- u /= 100;
- *--d = digits[i + 1];
- *--d = digits[i];
- }
- if (u < 10) {
- *--d = char(u) + '0';
- }
- else {
- const unsigned i = u << 1;
- *--d = digits[i + 1];
- *--d = digits[i];
- }
- }
-
- OutputStream* os_;
-};
-
-template<>
-inline bool Writer4<rapidjson::StringBuffer>::WriteUint(unsigned u) {
- unsigned digit = CountDecimalDigit_fast(u);
- WriteUintReverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer4<rapidjson::InsituStringStream>::WriteUint(unsigned u) {
- unsigned digit = CountDecimalDigit_fast(u);
- WriteUintReverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer4<rapidjson::StringBuffer>::WriteUint64(uint64_t u) {
- unsigned digit = CountDecimalDigit64_fast(u);
- WriteUint64Reverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template<>
-inline bool Writer4<rapidjson::InsituStringStream>::WriteUint64(uint64_t u) {
- unsigned digit = CountDecimalDigit64_fast(u);
- WriteUint64Reverse(os_->Push(digit) + digit, u);
- return true;
-}
-
-template <typename Writer>
-void itoa_Writer_StringBufferVerify() {
- rapidjson::StringBuffer sb;
- Writer writer(sb);
- for (size_t j = 0; j < randvalCount; j++) {
- char buffer[32];
- sprintf(buffer, "%d", randval[j]);
- writer.WriteInt(randval[j]);
- ASSERT_STREQ(buffer, sb.GetString());
- sb.Clear();
- }
-}
-
-template <typename Writer>
-void itoa_Writer_InsituStringStreamVerify() {
- Writer writer;
- for (size_t j = 0; j < randvalCount; j++) {
- char buffer[32];
- sprintf(buffer, "%d", randval[j]);
- char buffer2[32];
- rapidjson::InsituStringStream ss(buffer2);
- writer.Reset(ss);
- char* begin = ss.PutBegin();
- writer.WriteInt(randval[j]);
- ss.Put('\0');
- ss.PutEnd(begin);
- ASSERT_STREQ(buffer, buffer2);
- }
-}
-
-template <typename Writer>
-void itoa_Writer_StringBuffer() {
- size_t length = 0;
-
- rapidjson::StringBuffer sb;
- Writer writer(sb);
-
- for (size_t i = 0; i < kItoaTrialCount; i++) {
- for (size_t j = 0; j < randvalCount; j++) {
- writer.WriteInt(randval[j]);
- length += sb.GetSize();
- sb.Clear();
- }
- }
- OUTPUT_LENGTH(length);
-}
-
-template <typename Writer>
-void itoa_Writer_InsituStringStream() {
- size_t length = 0;
-
- char buffer[32];
- Writer writer;
- for (size_t i = 0; i < kItoaTrialCount; i++) {
- for (size_t j = 0; j < randvalCount; j++) {
- rapidjson::InsituStringStream ss(buffer);
- writer.Reset(ss);
- char* begin = ss.PutBegin();
- writer.WriteInt(randval[j]);
- length += ss.PutEnd(begin);
- }
- }
- OUTPUT_LENGTH(length);
-};
-
-template <typename Writer>
-void itoa64_Writer_StringBufferVerify() {
- rapidjson::StringBuffer sb;
- Writer writer(sb);
- for (size_t j = 0; j < randvalCount; j++) {
- char buffer[32];
- int64_t x = randval[j] * randval[j];
- sprintf(buffer, "%" PRIi64, x);
- writer.WriteInt64(x);
- ASSERT_STREQ(buffer, sb.GetString());
- sb.Clear();
- }
-}
-
-template <typename Writer>
-void itoa64_Writer_InsituStringStreamVerify() {
- Writer writer;
- for (size_t j = 0; j < randvalCount; j++) {
- char buffer[32];
- int64_t x = randval[j] * randval[j];
- sprintf(buffer, "%" PRIi64, x);
- char buffer2[32];
- rapidjson::InsituStringStream ss(buffer2);
- writer.Reset(ss);
- char* begin = ss.PutBegin();
- writer.WriteInt64(x);
- ss.Put('\0');
- ss.PutEnd(begin);
- ASSERT_STREQ(buffer, buffer2);
- }
-}
-
-template <typename Writer>
-void itoa64_Writer_StringBuffer() {
- size_t length = 0;
-
- rapidjson::StringBuffer sb;
- Writer writer(sb);
-
- for (size_t i = 0; i < kItoaTrialCount; i++) {
- for (size_t j = 0; j < randvalCount; j++) {
- writer.WriteInt64(randval[j] * randval[j]);
- length += sb.GetSize();
- sb.Clear();
- }
- }
- OUTPUT_LENGTH(length);
-}
-
-template <typename Writer>
-void itoa64_Writer_InsituStringStream() {
- size_t length = 0;
-
- char buffer[32];
- Writer writer;
- for (size_t i = 0; i < kItoaTrialCount; i++) {
- for (size_t j = 0; j < randvalCount; j++) {
- rapidjson::InsituStringStream ss(buffer);
- writer.Reset(ss);
- char* begin = ss.PutBegin();
- writer.WriteInt64(randval[j] * randval[j]);
- length += ss.PutEnd(begin);
- }
- }
- OUTPUT_LENGTH(length);
-};
-
-// Full specialization for InsituStringStream to prevent memory copying
-// (normally we will not use InsituStringStream for writing, just for testing)
-
-namespace rapidjson {
-
-template<>
-bool rapidjson::Writer<InsituStringStream>::WriteInt(int i) {
- char *buffer = os_->Push(11);
- const char* end = internal::i32toa(i, buffer);
- os_->Pop(11 - (end - buffer));
- return true;
-}
-
-template<>
-bool Writer<InsituStringStream>::WriteUint(unsigned u) {
- char *buffer = os_->Push(10);
- const char* end = internal::u32toa(u, buffer);
- os_->Pop(10 - (end - buffer));
- return true;
-}
-
-template<>
-bool Writer<InsituStringStream>::WriteInt64(int64_t i64) {
- char *buffer = os_->Push(21);
- const char* end = internal::i64toa(i64, buffer);
- os_->Pop(21 - (end - buffer));
- return true;
-}
-
-template<>
-bool Writer<InsituStringStream>::WriteUint64(uint64_t u) {
- char *buffer = os_->Push(20);
- const char* end = internal::u64toa(u, buffer);
- os_->Pop(20 - (end - buffer));
- return true;
-}
-
-} // namespace rapidjson
-
-TEST_F(Misc, itoa_Writer_StringBufferVerify) { itoa_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer1_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer2_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer3_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer4_StringBufferVerify) { itoa_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer1_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer2_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer3_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer4_InsituStringStreamVerify) { itoa_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer_StringBuffer) { itoa_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer1_StringBuffer) { itoa_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer2_StringBuffer) { itoa_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer3_StringBuffer) { itoa_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer4_StringBuffer) { itoa_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa_Writer_InsituStringStream) { itoa_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer1_InsituStringStream) { itoa_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer2_InsituStringStream) { itoa_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer3_InsituStringStream) { itoa_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa_Writer4_InsituStringStream) { itoa_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }
-
-TEST_F(Misc, itoa64_Writer_StringBufferVerify) { itoa64_Writer_StringBufferVerify<rapidjson::Writer<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer1_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer1<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer2_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer2<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer3_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer3<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer4_StringBufferVerify) { itoa64_Writer_StringBufferVerify<Writer4<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer1_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer1<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer2_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer2<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer3_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer3<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer4_InsituStringStreamVerify) { itoa64_Writer_InsituStringStreamVerify<Writer4<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer_StringBuffer) { itoa64_Writer_StringBuffer<rapidjson::Writer<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer1_StringBuffer) { itoa64_Writer_StringBuffer<Writer1<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer2_StringBuffer) { itoa64_Writer_StringBuffer<Writer2<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer3_StringBuffer) { itoa64_Writer_StringBuffer<Writer3<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer4_StringBuffer) { itoa64_Writer_StringBuffer<Writer4<rapidjson::StringBuffer> >(); }
-TEST_F(Misc, itoa64_Writer_InsituStringStream) { itoa64_Writer_InsituStringStream<rapidjson::Writer<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer1_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer1<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer2_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer2<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer3_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer3<rapidjson::InsituStringStream> >(); }
-TEST_F(Misc, itoa64_Writer4_InsituStringStream) { itoa64_Writer_InsituStringStream<Writer4<rapidjson::InsituStringStream> >(); }
-
-#endif // TEST_MISC
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.cpp
deleted file mode 100644
index 13d7b8a3e4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "perftest.h"
-
-int main(int argc, char **argv) {
-#if _MSC_VER
- _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF );
- //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
-#endif
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.h b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.h
deleted file mode 100644
index 01fc1eb5e2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/perftest.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef PERFTEST_H_
-#define PERFTEST_H_
-
-#define TEST_RAPIDJSON 1
-#define TEST_PLATFORM 0
-#define TEST_MISC 0
-
-#define TEST_VERSION_CODE(x,y,z) \
- (((x)*100000) + ((y)*100) + (z))
-
-// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
-// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
-// Likewise, __ARM_NEON is used to detect Neon.
-#if defined(__SSE4_2__)
-# define RAPIDJSON_SSE42
-#elif defined(__SSE2__)
-# define RAPIDJSON_SSE2
-#elif defined(__ARM_NEON)
-# define RAPIDJSON_NEON
-#endif
-
-#define RAPIDJSON_HAS_STDSTRING 1
-
-////////////////////////////////////////////////////////////////////////////////
-// Google Test
-
-#ifdef __cplusplus
-
-// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.
-#ifndef __STDC_CONSTANT_MACROS
-# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
-#endif
-
-#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
-#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#pragma GCC diagnostic push
-#endif
-#pragma GCC diagnostic ignored "-Weffc++"
-#endif
-
-#include "gtest/gtest.h"
-
-#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#pragma GCC diagnostic pop
-#endif
-
-#ifdef _MSC_VER
-#define _CRTDBG_MAP_ALLOC
-#include <crtdbg.h>
-#pragma warning(disable : 4996) // 'function': was declared deprecated
-#endif
-
-//! Base class for all performance tests
-class PerfTest : public ::testing::Test {
-public:
- PerfTest() : filename_(), json_(), length_(), whitespace_(), whitespace_length_() {}
-
- virtual void SetUp() {
- {
- const char *paths[] = {
- "data/sample.json",
- "bin/data/sample.json",
- "../bin/data/sample.json",
- "../../bin/data/sample.json",
- "../../../bin/data/sample.json"
- };
-
- FILE *fp = 0;
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- fp = fopen(filename_ = paths[i], "rb");
- if (fp)
- break;
- }
- ASSERT_TRUE(fp != 0);
-
- fseek(fp, 0, SEEK_END);
- length_ = (size_t)ftell(fp);
- fseek(fp, 0, SEEK_SET);
- json_ = (char*)malloc(length_ + 1);
- ASSERT_EQ(length_, fread(json_, 1, length_, fp));
- json_[length_] = '\0';
- fclose(fp);
- }
-
- // whitespace test
- {
- whitespace_length_ = 1024 * 1024;
- whitespace_ = (char *)malloc(whitespace_length_ + 4);
- char *p = whitespace_;
- for (size_t i = 0; i < whitespace_length_; i += 4) {
- *p++ = ' ';
- *p++ = '\n';
- *p++ = '\r';
- *p++ = '\t';
- }
- *p++ = '[';
- *p++ = '0';
- *p++ = ']';
- *p++ = '\0';
- }
-
- // types test
- {
- const char *typespaths[] = {
- "data/types",
- "bin/types",
- "../bin/types",
- "../../bin/types/",
- "../../../bin/types"
- };
-
- const char* typesfilenames[] = {
- "booleans.json",
- "floats.json",
- "guids.json",
- "integers.json",
- "mixed.json",
- "nulls.json",
- "paragraphs.json",
- "alotofkeys.json"
- };
-
- for (size_t j = 0; j < sizeof(typesfilenames) / sizeof(typesfilenames[0]); j++) {
- types_[j] = 0;
- for (size_t i = 0; i < sizeof(typespaths) / sizeof(typespaths[0]); i++) {
- char filename[256];
- sprintf(filename, "%s/%s", typespaths[i], typesfilenames[j]);
- if (FILE* fp = fopen(filename, "rb")) {
- fseek(fp, 0, SEEK_END);
- typesLength_[j] = (size_t)ftell(fp);
- fseek(fp, 0, SEEK_SET);
- types_[j] = (char*)malloc(typesLength_[j] + 1);
- ASSERT_EQ(typesLength_[j], fread(types_[j], 1, typesLength_[j], fp));
- types_[j][typesLength_[j]] = '\0';
- fclose(fp);
- break;
- }
- }
- }
- }
- }
-
- virtual void TearDown() {
- free(json_);
- free(whitespace_);
- json_ = 0;
- whitespace_ = 0;
- for (size_t i = 0; i < 8; i++) {
- free(types_[i]);
- types_[i] = 0;
- }
- }
-
-private:
- PerfTest(const PerfTest&);
- PerfTest& operator=(const PerfTest&);
-
-protected:
- const char* filename_;
- char *json_;
- size_t length_;
- char *whitespace_;
- size_t whitespace_length_;
- char *types_[8];
- size_t typesLength_[8];
-
- static const size_t kTrialCount = 1000;
-};
-
-#endif // __cplusplus
-
-#endif // PERFTEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/platformtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/platformtest.cpp
deleted file mode 100644
index ff7bf4fea9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/platformtest.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "perftest.h"
-
-// This file is for giving the performance characteristics of the platform (compiler/OS/CPU).
-
-#if TEST_PLATFORM
-
-#include <cmath>
-#include <fcntl.h>
-
-// Windows
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-// UNIX
-#if defined(unix) || defined(__unix__) || defined(__unix)
-#include <unistd.h>
-#ifdef _POSIX_MAPPED_FILES
-#include <sys/mman.h>
-#endif
-#endif
-
-class Platform : public PerfTest {
-public:
- virtual void SetUp() {
- PerfTest::SetUp();
-
- // temp buffer for testing
- temp_ = (char *)malloc(length_ + 1);
- memcpy(temp_, json_, length_);
- checkSum_ = CheckSum();
- }
-
- char CheckSum() {
- char c = 0;
- for (size_t i = 0; i < length_; ++i)
- c += temp_[i];
- return c;
- }
-
- virtual void TearDown() {
- PerfTest::TearDown();
- free(temp_);
- }
-
-protected:
- char *temp_;
- char checkSum_;
-};
-
-TEST_F(Platform, CheckSum) {
- for (int i = 0; i < kTrialCount; i++)
- EXPECT_EQ(checkSum_, CheckSum());
-}
-
-TEST_F(Platform, strlen) {
- for (int i = 0; i < kTrialCount; i++) {
- size_t l = strlen(json_);
- EXPECT_EQ(length_, l);
- }
-}
-
-TEST_F(Platform, memcmp) {
- for (int i = 0; i < kTrialCount; i++) {
- EXPECT_EQ(0u, memcmp(temp_, json_, length_));
- }
-}
-
-TEST_F(Platform, pow) {
- double sum = 0;
- for (int i = 0; i < kTrialCount * kTrialCount; i++)
- sum += pow(10.0, i & 255);
- EXPECT_GT(sum, 0.0);
-}
-
-TEST_F(Platform, Whitespace_strlen) {
- for (int i = 0; i < kTrialCount; i++) {
- size_t l = strlen(whitespace_);
- EXPECT_GT(l, whitespace_length_);
- }
-}
-
-TEST_F(Platform, Whitespace_strspn) {
- for (int i = 0; i < kTrialCount; i++) {
- size_t l = strspn(whitespace_, " \n\r\t");
- EXPECT_EQ(whitespace_length_, l);
- }
-}
-
-TEST_F(Platform, fread) {
- for (int i = 0; i < kTrialCount; i++) {
- FILE *fp = fopen(filename_, "rb");
- ASSERT_EQ(length_, fread(temp_, 1, length_, fp));
- EXPECT_EQ(checkSum_, CheckSum());
- fclose(fp);
- }
-}
-
-#ifdef _MSC_VER
-TEST_F(Platform, read) {
- for (int i = 0; i < kTrialCount; i++) {
- int fd = _open(filename_, _O_BINARY | _O_RDONLY);
- ASSERT_NE(-1, fd);
- ASSERT_EQ(length_, _read(fd, temp_, length_));
- EXPECT_EQ(checkSum_, CheckSum());
- _close(fd);
- }
-}
-#else
-TEST_F(Platform, read) {
- for (int i = 0; i < kTrialCount; i++) {
- int fd = open(filename_, O_RDONLY);
- ASSERT_NE(-1, fd);
- ASSERT_EQ(length_, read(fd, temp_, length_));
- EXPECT_EQ(checkSum_, CheckSum());
- close(fd);
- }
-}
-#endif
-
-#ifdef _WIN32
-TEST_F(Platform, MapViewOfFile) {
- for (int i = 0; i < kTrialCount; i++) {
- HANDLE file = CreateFile(filename_, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, file);
- HANDLE mapObject = CreateFileMapping(file, NULL, PAGE_READONLY, 0, length_, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, mapObject);
- void *p = MapViewOfFile(mapObject, FILE_MAP_READ, 0, 0, length_);
- ASSERT_TRUE(p != NULL);
- EXPECT_EQ(checkSum_, CheckSum());
- ASSERT_TRUE(UnmapViewOfFile(p) == TRUE);
- ASSERT_TRUE(CloseHandle(mapObject) == TRUE);
- ASSERT_TRUE(CloseHandle(file) == TRUE);
- }
-}
-#endif
-
-#ifdef _POSIX_MAPPED_FILES
-TEST_F(Platform, mmap) {
- for (int i = 0; i < kTrialCount; i++) {
- int fd = open(filename_, O_RDONLY);
- ASSERT_NE(-1, fd);
- void *p = mmap(NULL, length_, PROT_READ, MAP_PRIVATE, fd, 0);
- ASSERT_TRUE(p != NULL);
- EXPECT_EQ(checkSum_, CheckSum());
- munmap(p, length_);
- close(fd);
- }
-}
-#endif
-
-#endif // TEST_PLATFORM
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/rapidjsontest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/rapidjsontest.cpp
deleted file mode 100644
index 5afefcbecb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/rapidjsontest.cpp
+++ /dev/null
@@ -1,564 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "perftest.h"
-
-#if TEST_RAPIDJSON
-
-#include "rapidjson/rapidjson.h"
-#include "rapidjson/document.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/istreamwrapper.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/memorystream.h"
-
-#include <fstream>
-#include <vector>
-
-#ifdef RAPIDJSON_SSE2
-#define SIMD_SUFFIX(name) name##_SSE2
-#elif defined(RAPIDJSON_SSE42)
-#define SIMD_SUFFIX(name) name##_SSE42
-#elif defined(RAPIDJSON_NEON)
-#define SIMD_SUFFIX(name) name##_NEON
-#else
-#define SIMD_SUFFIX(name) name
-#endif
-
-using namespace rapidjson;
-
-class RapidJson : public PerfTest {
-public:
- RapidJson() : temp_(), doc_() {}
-
- virtual void SetUp() {
- PerfTest::SetUp();
-
- // temp buffer for insitu parsing.
- temp_ = (char *)malloc(length_ + 1);
-
- // Parse as a document
- EXPECT_FALSE(doc_.Parse(json_).HasParseError());
-
- for (size_t i = 0; i < 8; i++)
- EXPECT_FALSE(typesDoc_[i].Parse(types_[i]).HasParseError());
- }
-
- virtual void TearDown() {
- PerfTest::TearDown();
- free(temp_);
- }
-
-private:
- RapidJson(const RapidJson&);
- RapidJson& operator=(const RapidJson&);
-
-protected:
- char *temp_;
- Document doc_;
- Document typesDoc_[8];
-};
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- InsituStringStream s(temp_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_ValidateEncoding)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- InsituStringStream s(temp_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream s(json_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse(s, h));
- }
-}
-
-#define TEST_TYPED(index, Name)\
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_##Name)) {\
- for (size_t i = 0; i < kTrialCount * 10; i++) {\
- StringStream s(types_[index]);\
- BaseReaderHandler<> h;\
- Reader reader;\
- EXPECT_TRUE(reader.Parse(s, h));\
- }\
-}\
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseInsitu_DummyHandler_##Name)) {\
- for (size_t i = 0; i < kTrialCount * 10; i++) {\
- memcpy(temp_, types_[index], typesLength_[index] + 1);\
- InsituStringStream s(temp_);\
- BaseReaderHandler<> h;\
- Reader reader;\
- EXPECT_TRUE(reader.Parse<kParseInsituFlag>(s, h));\
- }\
-}
-
-TEST_TYPED(0, Booleans)
-TEST_TYPED(1, Floats)
-TEST_TYPED(2, Guids)
-TEST_TYPED(3, Integers)
-TEST_TYPED(4, Mixed)
-TEST_TYPED(5, Nulls)
-TEST_TYPED(6, Paragraphs)
-
-#undef TEST_TYPED
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FullPrecision)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream s(json_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseFullPrecisionFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterative_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream s(json_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseIterativeFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterativeInsitu_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- InsituStringStream s(temp_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseIterativeFlag|kParseInsituFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterativePull_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream s(json_);
- BaseReaderHandler<> h;
- Reader reader;
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- if (!reader.IterativeParseNext<kParseDefaultFlags>(s, h))
- break;
- }
- EXPECT_FALSE(reader.HasParseError());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParseIterativePullInsitu_DummyHandler)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- InsituStringStream s(temp_);
- BaseReaderHandler<> h;
- Reader reader;
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- if (!reader.IterativeParseNext<kParseDefaultFlags|kParseInsituFlag>(s, h))
- break;
- }
- EXPECT_FALSE(reader.HasParseError());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_ValidateEncoding)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream s(json_);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseValidateEncodingFlag>(s, h));
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseInsitu_MemoryPoolAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- Document doc;
- doc.ParseInsitu(temp_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterativeInsitu_MemoryPoolAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- Document doc;
- doc.ParseInsitu<kParseIterativeFlag>(temp_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_MemoryPoolAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- Document doc;
- doc.Parse(json_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseLength_MemoryPoolAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- Document doc;
- doc.Parse(json_, length_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseStdString_MemoryPoolAllocator)) {
- const std::string s(json_, length_);
- for (size_t i = 0; i < kTrialCount; i++) {
- Document doc;
- doc.Parse(s);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-#endif
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseIterative_MemoryPoolAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- Document doc;
- doc.Parse<kParseIterativeFlag>(json_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParse_CrtAllocator)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- memcpy(temp_, json_, length_ + 1);
- GenericDocument<UTF8<>, CrtAllocator> doc;
- doc.Parse(temp_);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseEncodedInputStream_MemoryStream)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- MemoryStream ms(json_, length_);
- EncodedInputStream<UTF8<>, MemoryStream> is(ms);
- Document doc;
- doc.ParseStream<0, UTF8<> >(is);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(DocumentParseAutoUTFInputStream_MemoryStream)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- MemoryStream ms(json_, length_);
- AutoUTFInputStream<unsigned, MemoryStream> is(ms);
- Document doc;
- doc.ParseStream<0, AutoUTF<unsigned> >(is);
- ASSERT_TRUE(doc.IsObject());
- }
-}
-
-template<typename T>
-size_t Traverse(const T& value) {
- size_t count = 1;
- switch(value.GetType()) {
- case kObjectType:
- for (typename T::ConstMemberIterator itr = value.MemberBegin(); itr != value.MemberEnd(); ++itr) {
- count++; // name
- count += Traverse(itr->value);
- }
- break;
-
- case kArrayType:
- for (typename T::ConstValueIterator itr = value.Begin(); itr != value.End(); ++itr)
- count += Traverse(*itr);
- break;
-
- default:
- // Do nothing.
- break;
- }
- return count;
-}
-
-TEST_F(RapidJson, DocumentTraverse) {
- for (size_t i = 0; i < kTrialCount; i++) {
- size_t count = Traverse(doc_);
- EXPECT_EQ(4339u, count);
- //if (i == 0)
- // std::cout << count << std::endl;
- }
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-struct ValueCounter : public BaseReaderHandler<> {
- ValueCounter() : count_(1) {} // root
-
- bool EndObject(SizeType memberCount) { count_ += memberCount * 2; return true; }
- bool EndArray(SizeType elementCount) { count_ += elementCount; return true; }
-
- SizeType count_;
-};
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
-
-TEST_F(RapidJson, DocumentAccept) {
- for (size_t i = 0; i < kTrialCount; i++) {
- ValueCounter counter;
- doc_.Accept(counter);
- EXPECT_EQ(4339u, counter.count_);
- }
-}
-
-TEST_F(RapidJson, DocumentFind) {
- typedef Document::ValueType ValueType;
- typedef ValueType::ConstMemberIterator ConstMemberIterator;
- const Document &doc = typesDoc_[7]; // alotofkeys.json
- if (doc.IsObject()) {
- std::vector<const ValueType*> keys;
- for (ConstMemberIterator it = doc.MemberBegin(); it != doc.MemberEnd(); ++it) {
- keys.push_back(&it->name);
- }
- for (size_t i = 0; i < kTrialCount; i++) {
- for (size_t j = 0; j < keys.size(); j++) {
- EXPECT_TRUE(doc.FindMember(*keys[j]) != doc.MemberEnd());
- }
- }
- }
-}
-
-struct NullStream {
- typedef char Ch;
-
- NullStream() /*: length_(0)*/ {}
- void Put(Ch) { /*++length_;*/ }
- void Flush() {}
- //size_t length_;
-};
-
-TEST_F(RapidJson, Writer_NullStream) {
- for (size_t i = 0; i < kTrialCount; i++) {
- NullStream s;
- Writer<NullStream> writer(s);
- doc_.Accept(writer);
- //if (i == 0)
- // std::cout << s.length_ << std::endl;
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(Writer_StringBuffer)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringBuffer s(0, 1024 * 1024);
- Writer<StringBuffer> writer(s);
- doc_.Accept(writer);
- const char* str = s.GetString();
- (void)str;
- //if (i == 0)
- // std::cout << strlen(str) << std::endl;
- }
-}
-
-#define TEST_TYPED(index, Name)\
-TEST_F(RapidJson, SIMD_SUFFIX(Writer_StringBuffer_##Name)) {\
- for (size_t i = 0; i < kTrialCount * 10; i++) {\
- StringBuffer s(0, 1024 * 1024);\
- Writer<StringBuffer> writer(s);\
- typesDoc_[index].Accept(writer);\
- const char* str = s.GetString();\
- (void)str;\
- }\
-}
-
-TEST_TYPED(0, Booleans)
-TEST_TYPED(1, Floats)
-TEST_TYPED(2, Guids)
-TEST_TYPED(3, Integers)
-TEST_TYPED(4, Mixed)
-TEST_TYPED(5, Nulls)
-TEST_TYPED(6, Paragraphs)
-
-#undef TEST_TYPED
-
-TEST_F(RapidJson, SIMD_SUFFIX(PrettyWriter_StringBuffer)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- StringBuffer s(0, 2048 * 1024);
- PrettyWriter<StringBuffer> writer(s);
- writer.SetIndent(' ', 1);
- doc_.Accept(writer);
- const char* str = s.GetString();
- (void)str;
- //if (i == 0)
- // std::cout << strlen(str) << std::endl;
- }
-}
-
-TEST_F(RapidJson, internal_Pow10) {
- double sum = 0;
- for (size_t i = 0; i < kTrialCount * kTrialCount; i++)
- sum += internal::Pow10(int(i & 255));
- EXPECT_GT(sum, 0.0);
-}
-
-TEST_F(RapidJson, SkipWhitespace_Basic) {
- for (size_t i = 0; i < kTrialCount; i++) {
- rapidjson::StringStream s(whitespace_);
- while (s.Peek() == ' ' || s.Peek() == '\n' || s.Peek() == '\r' || s.Peek() == '\t')
- s.Take();
- ASSERT_EQ('[', s.Peek());
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(SkipWhitespace)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- rapidjson::StringStream s(whitespace_);
- rapidjson::SkipWhitespace(s);
- ASSERT_EQ('[', s.Peek());
- }
-}
-
-TEST_F(RapidJson, SkipWhitespace_strspn) {
- for (size_t i = 0; i < kTrialCount; i++) {
- const char* s = whitespace_ + std::strspn(whitespace_, " \t\r\n");
- ASSERT_EQ('[', *s);
- }
-}
-
-TEST_F(RapidJson, UTF8_Validate) {
- NullStream os;
-
- for (size_t i = 0; i < kTrialCount; i++) {
- StringStream is(json_);
- bool result = true;
- while (is.Peek() != '\0')
- result &= UTF8<>::Validate(is, os);
- EXPECT_TRUE(result);
- }
-}
-
-TEST_F(RapidJson, FileReadStream) {
- for (size_t i = 0; i < kTrialCount; i++) {
- FILE *fp = fopen(filename_, "rb");
- char buffer[65536];
- FileReadStream s(fp, buffer, sizeof(buffer));
- while (s.Take() != '\0')
- ;
- fclose(fp);
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_FileReadStream)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- FILE *fp = fopen(filename_, "rb");
- char buffer[65536];
- FileReadStream s(fp, buffer, sizeof(buffer));
- BaseReaderHandler<> h;
- Reader reader;
- reader.Parse(s, h);
- fclose(fp);
- }
-}
-
-TEST_F(RapidJson, IStreamWrapper) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is(filename_, std::ios::in | std::ios::binary);
- char buffer[65536];
- IStreamWrapper isw(is, buffer, sizeof(buffer));
- while (isw.Take() != '\0')
- ;
- is.close();
- }
-}
-
-TEST_F(RapidJson, IStreamWrapper_Unbuffered) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is(filename_, std::ios::in | std::ios::binary);
- IStreamWrapper isw(is);
- while (isw.Take() != '\0')
- ;
- is.close();
- }
-}
-
-TEST_F(RapidJson, IStreamWrapper_Setbuffered) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is;
- char buffer[65536];
- is.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
- is.open(filename_, std::ios::in | std::ios::binary);
- IStreamWrapper isw(is);
- while (isw.Take() != '\0')
- ;
- is.close();
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_IStreamWrapper)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is(filename_, std::ios::in | std::ios::binary);
- char buffer[65536];
- IStreamWrapper isw(is, buffer, sizeof(buffer));
- BaseReaderHandler<> h;
- Reader reader;
- reader.Parse(isw, h);
- is.close();
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_IStreamWrapper_Unbuffered)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is(filename_, std::ios::in | std::ios::binary);
- IStreamWrapper isw(is);
- BaseReaderHandler<> h;
- Reader reader;
- reader.Parse(isw, h);
- is.close();
- }
-}
-
-TEST_F(RapidJson, SIMD_SUFFIX(ReaderParse_DummyHandler_IStreamWrapper_Setbuffered)) {
- for (size_t i = 0; i < kTrialCount; i++) {
- std::ifstream is;
- char buffer[65536];
- is.rdbuf()->pubsetbuf(buffer, sizeof(buffer));
- is.open(filename_, std::ios::in | std::ios::binary);
- IStreamWrapper isw(is);
- BaseReaderHandler<> h;
- Reader reader;
- reader.Parse(isw, h);
- is.close();
- }
-}
-
-TEST_F(RapidJson, StringBuffer) {
- StringBuffer sb;
- for (int i = 0; i < 32 * 1024 * 1024; i++)
- sb.Put(i & 0x7f);
-}
-
-#endif // TEST_RAPIDJSON
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/schematest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/schematest.cpp
deleted file mode 100644
index 7d27344b5c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/perftest/schematest.cpp
+++ /dev/null
@@ -1,223 +0,0 @@
-#include "perftest.h"
-
-#if TEST_RAPIDJSON
-
-#include "rapidjson/schema.h"
-#include <ctime>
-#include <string>
-#include <vector>
-
-#define ARRAY_SIZE(a) sizeof(a) / sizeof(a[0])
-
-using namespace rapidjson;
-
-RAPIDJSON_DIAG_PUSH
-#if defined(__GNUC__) && __GNUC__ >= 7
-RAPIDJSON_DIAG_OFF(format-overflow)
-#endif
-
-template <typename Allocator>
-static char* ReadFile(const char* filename, Allocator& allocator) {
- const char *paths[] = {
- "",
- "bin/",
- "../bin/",
- "../../bin/",
- "../../../bin/"
- };
- char buffer[1024];
- FILE *fp = 0;
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s%s", paths[i], filename);
- fp = fopen(buffer, "rb");
- if (fp)
- break;
- }
-
- if (!fp)
- return 0;
-
- fseek(fp, 0, SEEK_END);
- size_t length = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- char* json = reinterpret_cast<char*>(allocator.Malloc(length + 1));
- size_t readLength = fread(json, 1, length, fp);
- json[readLength] = '\0';
- fclose(fp);
- return json;
-}
-
-RAPIDJSON_DIAG_POP
-
-class Schema : public PerfTest {
-public:
- Schema() {}
-
- virtual void SetUp() {
- PerfTest::SetUp();
-
- const char* filenames[] = {
- "additionalItems.json",
- "additionalProperties.json",
- "allOf.json",
- "anyOf.json",
- "default.json",
- "definitions.json",
- "dependencies.json",
- "enum.json",
- "items.json",
- "maximum.json",
- "maxItems.json",
- "maxLength.json",
- "maxProperties.json",
- "minimum.json",
- "minItems.json",
- "minLength.json",
- "minProperties.json",
- "multipleOf.json",
- "not.json",
- "oneOf.json",
- "pattern.json",
- "patternProperties.json",
- "properties.json",
- "ref.json",
- "refRemote.json",
- "required.json",
- "type.json",
- "uniqueItems.json"
- };
-
- char jsonBuffer[65536];
- MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
-
- for (size_t i = 0; i < ARRAY_SIZE(filenames); i++) {
- char filename[FILENAME_MAX];
- sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
- char* json = ReadFile(filename, jsonAllocator);
- if (!json) {
- printf("json test suite file %s not found", filename);
- return;
- }
-
- Document d;
- d.Parse(json);
- if (d.HasParseError()) {
- printf("json test suite file %s has parse error", filename);
- return;
- }
-
- for (Value::ConstValueIterator schemaItr = d.Begin(); schemaItr != d.End(); ++schemaItr) {
- std::string schemaDescription = (*schemaItr)["description"].GetString();
- if (IsExcludeTestSuite(schemaDescription))
- continue;
-
- TestSuite* ts = new TestSuite;
- ts->schema = new SchemaDocument((*schemaItr)["schema"]);
-
- const Value& tests = (*schemaItr)["tests"];
- for (Value::ConstValueIterator testItr = tests.Begin(); testItr != tests.End(); ++testItr) {
- if (IsExcludeTest(schemaDescription + ", " + (*testItr)["description"].GetString()))
- continue;
-
- Document* d2 = new Document;
- d2->CopyFrom((*testItr)["data"], d2->GetAllocator());
- ts->tests.push_back(d2);
- }
- testSuites.push_back(ts);
- }
- }
- }
-
- virtual void TearDown() {
- PerfTest::TearDown();
- for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr)
- delete *itr;
- testSuites.clear();
- }
-
-private:
- // Using the same exclusion in https://github.com/json-schema/JSON-Schema-Test-Suite
- static bool IsExcludeTestSuite(const std::string& description) {
- const char* excludeTestSuites[] = {
- //lost failing these tests
- "remote ref",
- "remote ref, containing refs itself",
- "fragment within remote ref",
- "ref within remote ref",
- "change resolution scope",
- // these below were added to get jsck in the benchmarks)
- "uniqueItems validation",
- "valid definition",
- "invalid definition"
- };
-
- for (size_t i = 0; i < ARRAY_SIZE(excludeTestSuites); i++)
- if (excludeTestSuites[i] == description)
- return true;
- return false;
- }
-
- // Using the same exclusion in https://github.com/json-schema/JSON-Schema-Test-Suite
- static bool IsExcludeTest(const std::string& description) {
- const char* excludeTests[] = {
- //lots of validators fail these
- "invalid definition, invalid definition schema",
- "maxLength validation, two supplementary Unicode code points is long enough",
- "minLength validation, one supplementary Unicode code point is not long enough",
- //this is to get tv4 in the benchmarks
- "heterogeneous enum validation, something else is invalid"
- };
-
- for (size_t i = 0; i < ARRAY_SIZE(excludeTests); i++)
- if (excludeTests[i] == description)
- return true;
- return false;
- }
-
- Schema(const Schema&);
- Schema& operator=(const Schema&);
-
-protected:
- typedef std::vector<Document*> DocumentList;
-
- struct TestSuite {
- TestSuite() : schema() {}
- ~TestSuite() {
- delete schema;
- for (DocumentList::iterator itr = tests.begin(); itr != tests.end(); ++itr)
- delete *itr;
- }
- SchemaDocument* schema;
- DocumentList tests;
- };
-
- typedef std::vector<TestSuite* > TestSuiteList;
- TestSuiteList testSuites;
-};
-
-TEST_F(Schema, TestSuite) {
- char validatorBuffer[65536];
- MemoryPoolAllocator<> validatorAllocator(validatorBuffer, sizeof(validatorBuffer));
-
- const int trialCount = 100000;
- int testCount = 0;
- clock_t start = clock();
- for (int i = 0; i < trialCount; i++) {
- for (TestSuiteList::const_iterator itr = testSuites.begin(); itr != testSuites.end(); ++itr) {
- const TestSuite& ts = **itr;
- GenericSchemaValidator<SchemaDocument, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > validator(*ts.schema, &validatorAllocator);
- for (DocumentList::const_iterator testItr = ts.tests.begin(); testItr != ts.tests.end(); ++testItr) {
- validator.Reset();
- (*testItr)->Accept(validator);
- testCount++;
- }
- validatorAllocator.Clear();
- }
- }
- clock_t end = clock();
- double duration = double(end - start) / CLOCKS_PER_SEC;
- printf("%d trials in %f s -> %f trials per sec\n", trialCount, duration, trialCount / duration);
- printf("%d tests per trial\n", testCount / trialCount);
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/CMakeLists.txt
deleted file mode 100644
index 565ed98239..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/CMakeLists.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-include(CheckCXXCompilerFlag)
-
-set(UNITTEST_SOURCES
- allocatorstest.cpp
- bigintegertest.cpp
- clzlltest.cpp
- cursorstreamwrappertest.cpp
- documenttest.cpp
- dtoatest.cpp
- encodedstreamtest.cpp
- encodingstest.cpp
- fwdtest.cpp
- filestreamtest.cpp
- itoatest.cpp
- istreamwrappertest.cpp
- jsoncheckertest.cpp
- namespacetest.cpp
- pointertest.cpp
- platformtest.cpp
- prettywritertest.cpp
- ostreamwrappertest.cpp
- readertest.cpp
- regextest.cpp
- schematest.cpp
- simdtest.cpp
- strfunctest.cpp
- stringbuffertest.cpp
- strtodtest.cpp
- unittest.cpp
- uritest.cpp
- valuetest.cpp
- writertest.cpp)
-
-find_program(CCACHE_FOUND ccache)
-if(CCACHE_FOUND)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
- if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -fcolor-diagnostics")
- endif()
-endif(CCACHE_FOUND)
-
-set_property(DIRECTORY PROPERTY COMPILE_OPTIONS ${EXTRA_CXX_FLAGS})
-
-if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- # If the user is running a newer version of Clang that includes the
- # -Wdouble-promotion, we will ignore that warning.
- if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.7)
- CHECK_CXX_COMPILER_FLAG("-Wno-double-promotion" HAS_NO_DOUBLE_PROMOTION)
- if (HAS_NO_DOUBLE_PROMOTION)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-double-promotion")
- endif()
- endif()
-elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
- # Force to always compile with /W4
- if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
- string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
- endif()
-
- # Force to always compile with /WX
- if(CMAKE_CXX_FLAGS MATCHES "/WX-")
- string(REGEX REPLACE "/WX-" "/WX" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
- else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
- endif()
-endif()
-
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DRAPIDJSON_HAS_STDSTRING=1")
-
-add_library(namespacetest STATIC namespacetest.cpp)
-
-add_executable(unittest ${UNITTEST_SOURCES})
-target_link_libraries(unittest ${TEST_LIBRARIES} namespacetest)
-
-add_dependencies(tests unittest)
-
-add_test(NAME unittest
- COMMAND ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
-
-if(NOT MSVC)
- # Not running SIMD.* unit test cases for Valgrind
- add_test(NAME valgrind_unittest
- COMMAND valgrind --suppressions=${CMAKE_SOURCE_DIR}/test/valgrind.supp --leak-check=full --error-exitcode=1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/unittest --gtest_filter=-SIMD.*
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
-
- if(CMAKE_BUILD_TYPE STREQUAL "Debug")
- add_test(NAME symbol_check
- COMMAND sh -c "objdump -t -C libnamespacetest.a | grep rapidjson ; test $? -ne 0"
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
- endif(CMAKE_BUILD_TYPE STREQUAL "Debug")
-
-endif(NOT MSVC)
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/allocatorstest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/allocatorstest.cpp
deleted file mode 100644
index 4f08cad48e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/allocatorstest.cpp
+++ /dev/null
@@ -1,292 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/allocators.h"
-
-#include <map>
-#include <string>
-#include <utility>
-#include <functional>
-
-using namespace rapidjson;
-
-template <typename Allocator>
-void TestAllocator(Allocator& a) {
- EXPECT_TRUE(a.Malloc(0) == 0);
-
- uint8_t* p = static_cast<uint8_t*>(a.Malloc(100));
- EXPECT_TRUE(p != 0);
- for (size_t i = 0; i < 100; i++)
- p[i] = static_cast<uint8_t>(i);
-
- // Expand
- uint8_t* q = static_cast<uint8_t*>(a.Realloc(p, 100, 200));
- EXPECT_TRUE(q != 0);
- for (size_t i = 0; i < 100; i++)
- EXPECT_EQ(i, q[i]);
- for (size_t i = 100; i < 200; i++)
- q[i] = static_cast<uint8_t>(i);
-
- // Shrink
- uint8_t *r = static_cast<uint8_t*>(a.Realloc(q, 200, 150));
- EXPECT_TRUE(r != 0);
- for (size_t i = 0; i < 150; i++)
- EXPECT_EQ(i, r[i]);
-
- Allocator::Free(r);
-
- // Realloc to zero size
- EXPECT_TRUE(a.Realloc(a.Malloc(1), 1, 0) == 0);
-}
-
-struct TestStdAllocatorData {
- TestStdAllocatorData(int &constructions, int &destructions) :
- constructions_(&constructions),
- destructions_(&destructions)
- {
- ++*constructions_;
- }
- TestStdAllocatorData(const TestStdAllocatorData& rhs) :
- constructions_(rhs.constructions_),
- destructions_(rhs.destructions_)
- {
- ++*constructions_;
- }
- TestStdAllocatorData& operator=(const TestStdAllocatorData& rhs)
- {
- this->~TestStdAllocatorData();
- constructions_ = rhs.constructions_;
- destructions_ = rhs.destructions_;
- ++*constructions_;
- return *this;
- }
- ~TestStdAllocatorData()
- {
- ++*destructions_;
- }
-private:
- TestStdAllocatorData();
- int *constructions_,
- *destructions_;
-};
-
-template <typename Allocator>
-void TestStdAllocator(const Allocator& a) {
-#if RAPIDJSON_HAS_CXX17
- typedef StdAllocator<bool, Allocator> BoolAllocator;
-#else
- typedef StdAllocator<void, Allocator> VoidAllocator;
- typedef typename VoidAllocator::template rebind<bool>::other BoolAllocator;
-#endif
- BoolAllocator ba(a), ba2(a);
- EXPECT_TRUE(ba == ba2);
- EXPECT_FALSE(ba!= ba2);
- ba.deallocate(ba.allocate());
- EXPECT_TRUE(ba == ba2);
- EXPECT_FALSE(ba != ba2);
-
- unsigned long long ll = 0, *llp = &ll;
- const unsigned long long cll = 0, *cllp = &cll;
- StdAllocator<unsigned long long, Allocator> lla(a);
- EXPECT_EQ(lla.address(ll), llp);
- EXPECT_EQ(lla.address(cll), cllp);
- EXPECT_TRUE(lla.max_size() > 0 && lla.max_size() <= SIZE_MAX / sizeof(unsigned long long));
-
- int *arr;
- StdAllocator<int, Allocator> ia(a);
- arr = ia.allocate(10 * sizeof(int));
- EXPECT_TRUE(arr != 0);
- for (int i = 0; i < 10; ++i) {
- arr[i] = 0x0f0f0f0f;
- }
- ia.deallocate(arr, 10);
- arr = Malloc<int>(ia, 10);
- EXPECT_TRUE(arr != 0);
- for (int i = 0; i < 10; ++i) {
- arr[i] = 0x0f0f0f0f;
- }
- arr = Realloc<int>(ia, arr, 10, 20);
- EXPECT_TRUE(arr != 0);
- for (int i = 0; i < 10; ++i) {
- EXPECT_EQ(arr[i], 0x0f0f0f0f);
- }
- for (int i = 10; i < 20; i++) {
- arr[i] = 0x0f0f0f0f;
- }
- Free<int>(ia, arr, 20);
-
- int cons = 0, dest = 0;
- StdAllocator<TestStdAllocatorData, Allocator> da(a);
- for (int i = 1; i < 10; i++) {
- TestStdAllocatorData *d = da.allocate();
- EXPECT_TRUE(d != 0);
-
- da.destroy(new(d) TestStdAllocatorData(cons, dest));
- EXPECT_EQ(cons, i);
- EXPECT_EQ(dest, i);
-
- da.deallocate(d);
- }
-
- typedef StdAllocator<char, Allocator> CharAllocator;
- typedef std::basic_string<char, std::char_traits<char>, CharAllocator> String;
-#if RAPIDJSON_HAS_CXX11
- String s(CharAllocator{a});
-#else
- CharAllocator ca(a);
- String s(ca);
-#endif
- for (int i = 0; i < 26; i++) {
- s.push_back(static_cast<char>('A' + i));
- }
- EXPECT_TRUE(s == "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
-
- typedef StdAllocator<std::pair<const int, bool>, Allocator> MapAllocator;
- typedef std::map<int, bool, std::less<int>, MapAllocator> Map;
-#if RAPIDJSON_HAS_CXX11
- Map map(std::less<int>(), MapAllocator{a});
-#else
- MapAllocator ma(a);
- Map map(std::less<int>(), ma);
-#endif
- for (int i = 0; i < 10; i++) {
- map.insert(std::make_pair(i, (i % 2) == 0));
- }
- EXPECT_TRUE(map.size() == 10);
- for (int i = 0; i < 10; i++) {
- typename Map::iterator it = map.find(i);
- EXPECT_TRUE(it != map.end());
- EXPECT_TRUE(it->second == ((i % 2) == 0));
- }
-}
-
-TEST(Allocator, CrtAllocator) {
- CrtAllocator a;
-
- TestAllocator(a);
- TestStdAllocator(a);
-
- CrtAllocator a2;
- EXPECT_TRUE(a == a2);
- EXPECT_FALSE(a != a2);
- a2.Free(a2.Malloc(1));
- EXPECT_TRUE(a == a2);
- EXPECT_FALSE(a != a2);
-}
-
-TEST(Allocator, MemoryPoolAllocator) {
- const size_t capacity = RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY;
- MemoryPoolAllocator<> a(capacity);
-
- a.Clear(); // noop
- EXPECT_EQ(a.Size(), 0u);
- EXPECT_EQ(a.Capacity(), 0u);
- EXPECT_EQ(a.Shared(), false);
- {
- MemoryPoolAllocator<> a2(a);
- EXPECT_EQ(a2.Shared(), true);
- EXPECT_EQ(a.Shared(), true);
- EXPECT_TRUE(a == a2);
- EXPECT_FALSE(a != a2);
- a2.Free(a2.Malloc(1));
- EXPECT_TRUE(a == a2);
- EXPECT_FALSE(a != a2);
- }
- EXPECT_EQ(a.Shared(), false);
- EXPECT_EQ(a.Capacity(), capacity);
- EXPECT_EQ(a.Size(), 8u); // aligned
- a.Clear();
- EXPECT_EQ(a.Capacity(), 0u);
- EXPECT_EQ(a.Size(), 0u);
-
- TestAllocator(a);
- TestStdAllocator(a);
-
- for (size_t i = 1; i < 1000; i++) {
- EXPECT_TRUE(a.Malloc(i) != 0);
- EXPECT_LE(a.Size(), a.Capacity());
- }
-
- CrtAllocator baseAllocator;
- a = MemoryPoolAllocator<>(capacity, &baseAllocator);
- EXPECT_EQ(a.Capacity(), 0u);
- EXPECT_EQ(a.Size(), 0u);
- a.Free(a.Malloc(1));
- EXPECT_EQ(a.Capacity(), capacity);
- EXPECT_EQ(a.Size(), 8u); // aligned
-
- {
- a.Clear();
- const size_t bufSize = 1024;
- char *buffer = (char *)a.Malloc(bufSize);
- MemoryPoolAllocator<> aligned_a(buffer, bufSize);
- EXPECT_TRUE(aligned_a.Capacity() > 0 && aligned_a.Capacity() <= bufSize);
- EXPECT_EQ(aligned_a.Size(), 0u);
- aligned_a.Free(aligned_a.Malloc(1));
- EXPECT_TRUE(aligned_a.Capacity() > 0 && aligned_a.Capacity() <= bufSize);
- EXPECT_EQ(aligned_a.Size(), 8u); // aligned
- }
-
- {
- a.Clear();
- const size_t bufSize = 1024;
- char *buffer = (char *)a.Malloc(bufSize);
- RAPIDJSON_ASSERT(bufSize % sizeof(void*) == 0);
- MemoryPoolAllocator<> unaligned_a(buffer + 1, bufSize - 1);
- EXPECT_TRUE(unaligned_a.Capacity() > 0 && unaligned_a.Capacity() <= bufSize - sizeof(void*));
- EXPECT_EQ(unaligned_a.Size(), 0u);
- unaligned_a.Free(unaligned_a.Malloc(1));
- EXPECT_TRUE(unaligned_a.Capacity() > 0 && unaligned_a.Capacity() <= bufSize - sizeof(void*));
- EXPECT_EQ(unaligned_a.Size(), 8u); // aligned
- }
-}
-
-TEST(Allocator, Alignment) {
- if (sizeof(size_t) >= 8) {
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000000), RAPIDJSON_ALIGN(0));
- for (uint64_t i = 1; i < 8; i++) {
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000008), RAPIDJSON_ALIGN(i));
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000000, 0x00000010), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0x00000000, 0x00000008) + i));
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0x00000001, 0x00000000), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0x00000000, 0xFFFFFFF8) + i));
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF8), RAPIDJSON_ALIGN(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0) + i));
- }
- }
-
- EXPECT_EQ(0u, RAPIDJSON_ALIGN(0u));
- for (uint32_t i = 1; i < 8; i++) {
- EXPECT_EQ(8u, RAPIDJSON_ALIGN(i));
- EXPECT_EQ(0xFFFFFFF8u, RAPIDJSON_ALIGN(0xFFFFFFF0u + i));
- }
-}
-
-TEST(Allocator, Issue399) {
- MemoryPoolAllocator<> a;
- void* p = a.Malloc(100);
- void* q = a.Realloc(p, 100, 200);
- EXPECT_EQ(p, q);
-
- // exhuasive testing
- for (size_t j = 1; j < 32; j++) {
- a.Clear();
- a.Malloc(j); // some unaligned size
- p = a.Malloc(1);
- for (size_t i = 1; i < 1024; i++) {
- q = a.Realloc(p, i, i + 1);
- EXPECT_EQ(p, q);
- p = q;
- }
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/bigintegertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/bigintegertest.cpp
deleted file mode 100644
index b448b4dce2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/bigintegertest.cpp
+++ /dev/null
@@ -1,138 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/internal/biginteger.h"
-
-using namespace rapidjson::internal;
-
-#define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1)
-
-static const BigInteger kZero(0);
-static const BigInteger kOne(1);
-static const BigInteger kUint64Max = BIGINTEGER_LITERAL("18446744073709551615");
-static const BigInteger kTwo64 = BIGINTEGER_LITERAL("18446744073709551616");
-
-TEST(BigInteger, Constructor) {
- EXPECT_TRUE(kZero.IsZero());
- EXPECT_TRUE(kZero == kZero);
- EXPECT_TRUE(kZero == BIGINTEGER_LITERAL("0"));
- EXPECT_TRUE(kZero == BIGINTEGER_LITERAL("00"));
-
- const BigInteger a(123);
- EXPECT_TRUE(a == a);
- EXPECT_TRUE(a == BIGINTEGER_LITERAL("123"));
- EXPECT_TRUE(a == BIGINTEGER_LITERAL("0123"));
-
- EXPECT_EQ(2u, kTwo64.GetCount());
- EXPECT_EQ(0u, kTwo64.GetDigit(0));
- EXPECT_EQ(1u, kTwo64.GetDigit(1));
-}
-
-TEST(BigInteger, AddUint64) {
- BigInteger a = kZero;
- a += 0u;
- EXPECT_TRUE(kZero == a);
-
- a += 1u;
- EXPECT_TRUE(kOne == a);
-
- a += 1u;
- EXPECT_TRUE(BigInteger(2) == a);
-
- EXPECT_TRUE(BigInteger(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)) == kUint64Max);
- BigInteger b = kUint64Max;
- b += 1u;
- EXPECT_TRUE(kTwo64 == b);
- b += RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
- EXPECT_TRUE(BIGINTEGER_LITERAL("36893488147419103231") == b);
-}
-
-TEST(BigInteger, MultiplyUint64) {
- BigInteger a = kZero;
- a *= static_cast <uint64_t>(0);
- EXPECT_TRUE(kZero == a);
- a *= static_cast <uint64_t>(123);
- EXPECT_TRUE(kZero == a);
-
- BigInteger b = kOne;
- b *= static_cast<uint64_t>(1);
- EXPECT_TRUE(kOne == b);
- b *= static_cast<uint64_t>(0);
- EXPECT_TRUE(kZero == b);
-
- BigInteger c(123);
- c *= static_cast<uint64_t>(456u);
- EXPECT_TRUE(BigInteger(123u * 456u) == c);
- c *= RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
- EXPECT_TRUE(BIGINTEGER_LITERAL("1034640981606221330982120") == c);
- c *= RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF);
- EXPECT_TRUE(BIGINTEGER_LITERAL("19085757395861596536664473018420572782123800") == c);
-}
-
-TEST(BigInteger, MultiplyUint32) {
- BigInteger a = kZero;
- a *= static_cast <uint32_t>(0);
- EXPECT_TRUE(kZero == a);
- a *= static_cast <uint32_t>(123);
- EXPECT_TRUE(kZero == a);
-
- BigInteger b = kOne;
- b *= static_cast<uint32_t>(1);
- EXPECT_TRUE(kOne == b);
- b *= static_cast<uint32_t>(0);
- EXPECT_TRUE(kZero == b);
-
- BigInteger c(123);
- c *= static_cast<uint32_t>(456u);
- EXPECT_TRUE(BigInteger(123u * 456u) == c);
- c *= 0xFFFFFFFFu;
- EXPECT_TRUE(BIGINTEGER_LITERAL("240896125641960") == c);
- c *= 0xFFFFFFFFu;
- EXPECT_TRUE(BIGINTEGER_LITERAL("1034640981124429079698200") == c);
-}
-
-TEST(BigInteger, LeftShift) {
- BigInteger a = kZero;
- a <<= 1;
- EXPECT_TRUE(kZero == a);
- a <<= 64;
- EXPECT_TRUE(kZero == a);
-
- a = BigInteger(123);
- a <<= 0;
- EXPECT_TRUE(BigInteger(123) == a);
- a <<= 1;
- EXPECT_TRUE(BigInteger(246) == a);
- a <<= 64;
- EXPECT_TRUE(BIGINTEGER_LITERAL("4537899042132549697536") == a);
- a <<= 99;
- EXPECT_TRUE(BIGINTEGER_LITERAL("2876235222267216943024851750785644982682875244576768") == a);
-
- a = 1;
- a <<= 64; // a.count_ != 1
- a <<= 256; // interShift == 0
- EXPECT_TRUE(BIGINTEGER_LITERAL("2135987035920910082395021706169552114602704522356652769947041607822219725780640550022962086936576") == a);
-}
-
-TEST(BigInteger, Compare) {
- EXPECT_EQ(0, kZero.Compare(kZero));
- EXPECT_EQ(1, kOne.Compare(kZero));
- EXPECT_EQ(-1, kZero.Compare(kOne));
- EXPECT_EQ(0, kUint64Max.Compare(kUint64Max));
- EXPECT_EQ(0, kTwo64.Compare(kTwo64));
- EXPECT_EQ(-1, kUint64Max.Compare(kTwo64));
- EXPECT_EQ(1, kTwo64.Compare(kUint64Max));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/clzlltest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/clzlltest.cpp
deleted file mode 100644
index 3e9cfc2415..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/clzlltest.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/internal/clzll.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-#endif
-
-using namespace rapidjson::internal;
-
-TEST(clzll, normal) {
- EXPECT_EQ(clzll(1), 63U);
- EXPECT_EQ(clzll(2), 62U);
- EXPECT_EQ(clzll(12), 60U);
- EXPECT_EQ(clzll(0x0000000080000001UL), 32U);
- EXPECT_EQ(clzll(0x8000000000000001UL), 0U);
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/cursorstreamwrappertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/cursorstreamwrappertest.cpp
deleted file mode 100644
index 49e3d5e549..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/cursorstreamwrappertest.cpp
+++ /dev/null
@@ -1,115 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/document.h"
-#include "rapidjson/cursorstreamwrapper.h"
-
-using namespace rapidjson;
-
-// static const char json[] = "{\"string\"\n\n:\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"]}";
-
-static bool testJson(const char *json, size_t &line, size_t &col) {
- StringStream ss(json);
- CursorStreamWrapper<StringStream> csw(ss);
- Document document;
- document.ParseStream(csw);
- bool ret = document.HasParseError();
- if (ret) {
- col = csw.GetColumn();
- line = csw.GetLine();
- }
- return ret;
-}
-
-TEST(CursorStreamWrapper, MissingFirstBracket) {
- const char json[] = "\"string\"\n\n:\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 3u);
- EXPECT_EQ(col, 0u);
-}
-
-TEST(CursorStreamWrapper, MissingQuotes) {
- const char json[] = "{\"string\n\n:\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 1u);
- EXPECT_EQ(col, 8u);
-}
-
-TEST(CursorStreamWrapper, MissingColon) {
- const char json[] = "{\"string\"\n\n\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 3u);
- EXPECT_EQ(col, 0u);
-}
-
-TEST(CursorStreamWrapper, MissingSecondQuotes) {
- const char json[] = "{\"string\"\n\n:my string\",\"array\"\n:[\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 3u);
- EXPECT_EQ(col, 1u);
-}
-
-TEST(CursorStreamWrapper, MissingComma) {
- const char json[] = "{\"string\"\n\n:\"my string\"\"array\"\n:[\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 3u);
- EXPECT_EQ(col, 12u);
-}
-
-TEST(CursorStreamWrapper, MissingArrayBracket) {
- const char json[] = "{\"string\"\n\n:\"my string\",\"array\"\n:\"1\", \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 4u);
- EXPECT_EQ(col, 9u);
-}
-
-TEST(CursorStreamWrapper, MissingArrayComma) {
- const char json[] = "{\"string\"\n\n:\"my string\",\"array\"\n:[\"1\" \"2\", \"3\"]}";
- size_t col, line;
- bool ret = testJson(json, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 4u);
- EXPECT_EQ(col, 6u);
-}
-
-TEST(CursorStreamWrapper, MissingLastArrayBracket) {
- const char json8[] = "{\"string\"\n\n:\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"}";
- size_t col, line;
- bool ret = testJson(json8, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 4u);
- EXPECT_EQ(col, 15u);
-}
-
-TEST(CursorStreamWrapper, MissingLastBracket) {
- const char json9[] = "{\"string\"\n\n:\"my string\",\"array\"\n:[\"1\", \"2\", \"3\"]";
- size_t col, line;
- bool ret = testJson(json9, line, col);
- EXPECT_TRUE(ret);
- EXPECT_EQ(line, 4u);
- EXPECT_EQ(col, 16u);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/documenttest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/documenttest.cpp
deleted file mode 100644
index 74432ba39a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/documenttest.cpp
+++ /dev/null
@@ -1,674 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/stringbuffer.h"
-#include <sstream>
-#include <algorithm>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-RAPIDJSON_DIAG_OFF(missing-variable-declarations)
-#endif
-
-using namespace rapidjson;
-
-template <typename DocumentType>
-void ParseCheck(DocumentType& doc) {
- typedef typename DocumentType::ValueType ValueType;
-
- EXPECT_FALSE(doc.HasParseError());
- if (doc.HasParseError())
- printf("Error: %d at %zu\n", static_cast<int>(doc.GetParseError()), doc.GetErrorOffset());
- EXPECT_TRUE(static_cast<ParseResult>(doc));
-
- EXPECT_TRUE(doc.IsObject());
-
- EXPECT_TRUE(doc.HasMember("hello"));
- const ValueType& hello = doc["hello"];
- EXPECT_TRUE(hello.IsString());
- EXPECT_STREQ("world", hello.GetString());
-
- EXPECT_TRUE(doc.HasMember("t"));
- const ValueType& t = doc["t"];
- EXPECT_TRUE(t.IsTrue());
-
- EXPECT_TRUE(doc.HasMember("f"));
- const ValueType& f = doc["f"];
- EXPECT_TRUE(f.IsFalse());
-
- EXPECT_TRUE(doc.HasMember("n"));
- const ValueType& n = doc["n"];
- EXPECT_TRUE(n.IsNull());
-
- EXPECT_TRUE(doc.HasMember("i"));
- const ValueType& i = doc["i"];
- EXPECT_TRUE(i.IsNumber());
- EXPECT_EQ(123, i.GetInt());
-
- EXPECT_TRUE(doc.HasMember("pi"));
- const ValueType& pi = doc["pi"];
- EXPECT_TRUE(pi.IsNumber());
- EXPECT_DOUBLE_EQ(3.1416, pi.GetDouble());
-
- EXPECT_TRUE(doc.HasMember("a"));
- const ValueType& a = doc["a"];
- EXPECT_TRUE(a.IsArray());
- EXPECT_EQ(4u, a.Size());
- for (SizeType j = 0; j < 4; j++)
- EXPECT_EQ(j + 1, a[j].GetUint());
-}
-
-template <typename Allocator, typename StackAllocator>
-void ParseTest() {
- typedef GenericDocument<UTF8<>, Allocator, StackAllocator> DocumentType;
- DocumentType doc;
-
- const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- doc.Parse(json);
- ParseCheck(doc);
-
- doc.SetNull();
- StringStream s(json);
- doc.template ParseStream<0>(s);
- ParseCheck(doc);
-
- doc.SetNull();
- char *buffer = strdup(json);
- doc.ParseInsitu(buffer);
- ParseCheck(doc);
- free(buffer);
-
- // Parse(const Ch*, size_t)
- size_t length = strlen(json);
- buffer = reinterpret_cast<char*>(malloc(length * 2));
- memcpy(buffer, json, length);
- memset(buffer + length, 'X', length);
-#if RAPIDJSON_HAS_STDSTRING
- std::string s2(buffer, length); // backup buffer
-#endif
- doc.SetNull();
- doc.Parse(buffer, length);
- free(buffer);
- ParseCheck(doc);
-
-#if RAPIDJSON_HAS_STDSTRING
- // Parse(std::string)
- doc.SetNull();
- doc.Parse(s2);
- ParseCheck(doc);
-#endif
-}
-
-TEST(Document, Parse) {
- ParseTest<MemoryPoolAllocator<>, CrtAllocator>();
- ParseTest<MemoryPoolAllocator<>, MemoryPoolAllocator<> >();
- ParseTest<CrtAllocator, MemoryPoolAllocator<> >();
- ParseTest<CrtAllocator, CrtAllocator>();
-}
-
-TEST(Document, UnchangedOnParseError) {
- Document doc;
- doc.SetArray().PushBack(0, doc.GetAllocator());
-
- ParseResult noError;
- EXPECT_TRUE(noError);
-
- ParseResult err = doc.Parse("{]");
- EXPECT_TRUE(doc.HasParseError());
- EXPECT_NE(err, noError);
- EXPECT_NE(err.Code(), noError);
- EXPECT_NE(noError, doc.GetParseError());
- EXPECT_EQ(err.Code(), doc.GetParseError());
- EXPECT_EQ(err.Offset(), doc.GetErrorOffset());
- EXPECT_TRUE(doc.IsArray());
- EXPECT_EQ(doc.Size(), 1u);
-
- err = doc.Parse("{}");
- EXPECT_FALSE(doc.HasParseError());
- EXPECT_FALSE(err.IsError());
- EXPECT_TRUE(err);
- EXPECT_EQ(err, noError);
- EXPECT_EQ(err.Code(), noError);
- EXPECT_EQ(err.Code(), doc.GetParseError());
- EXPECT_EQ(err.Offset(), doc.GetErrorOffset());
- EXPECT_TRUE(doc.IsObject());
- EXPECT_EQ(doc.MemberCount(), 0u);
-}
-
-static FILE* OpenEncodedFile(const char* filename) {
- const char *paths[] = {
- "encodings",
- "bin/encodings",
- "../bin/encodings",
- "../../bin/encodings",
- "../../../bin/encodings"
- };
- char buffer[1024];
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s/%s", paths[i], filename);
- FILE *fp = fopen(buffer, "rb");
- if (fp)
- return fp;
- }
- return 0;
-}
-
-TEST(Document, Parse_Encoding) {
- const char* json = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";
-
- typedef GenericDocument<UTF16<> > DocumentType;
- DocumentType doc;
-
- // Parse<unsigned, SourceEncoding>(const SourceEncoding::Ch*)
- // doc.Parse<kParseDefaultFlags, UTF8<> >(json);
- // EXPECT_FALSE(doc.HasParseError());
- // EXPECT_EQ(0, StrCmp(doc[L"hello"].GetString(), L"world"));
-
- // Parse<unsigned, SourceEncoding>(const SourceEncoding::Ch*, size_t)
- size_t length = strlen(json);
- char* buffer = reinterpret_cast<char*>(malloc(length * 2));
- memcpy(buffer, json, length);
- memset(buffer + length, 'X', length);
-#if RAPIDJSON_HAS_STDSTRING
- std::string s2(buffer, length); // backup buffer
-#endif
- doc.SetNull();
- doc.Parse<kParseDefaultFlags, UTF8<> >(buffer, length);
- free(buffer);
- EXPECT_FALSE(doc.HasParseError());
- if (doc.HasParseError())
- printf("Error: %d at %zu\n", static_cast<int>(doc.GetParseError()), doc.GetErrorOffset());
- EXPECT_EQ(0, StrCmp(doc[L"hello"].GetString(), L"world"));
-
-#if RAPIDJSON_HAS_STDSTRING
- // Parse<unsigned, SourceEncoding>(std::string)
- doc.SetNull();
-
-#if defined(_MSC_VER) && _MSC_VER < 1800
- doc.Parse<kParseDefaultFlags, UTF8<> >(s2.c_str()); // VS2010 or below cannot handle templated function overloading. Use const char* instead.
-#else
- doc.Parse<kParseDefaultFlags, UTF8<> >(s2);
-#endif
- EXPECT_FALSE(doc.HasParseError());
- EXPECT_EQ(0, StrCmp(doc[L"hello"].GetString(), L"world"));
-#endif
-}
-
-TEST(Document, ParseStream_EncodedInputStream) {
- // UTF8 -> UTF16
- FILE* fp = OpenEncodedFile("utf8.json");
- char buffer[256];
- FileReadStream bis(fp, buffer, sizeof(buffer));
- EncodedInputStream<UTF8<>, FileReadStream> eis(bis);
-
- GenericDocument<UTF16<> > d;
- d.ParseStream<0, UTF8<> >(eis);
- EXPECT_FALSE(d.HasParseError());
-
- fclose(fp);
-
- wchar_t expected[] = L"I can eat glass and it doesn't hurt me.";
- GenericValue<UTF16<> >& v = d[L"en"];
- EXPECT_TRUE(v.IsString());
- EXPECT_EQ(sizeof(expected) / sizeof(wchar_t) - 1, v.GetStringLength());
- EXPECT_EQ(0, StrCmp(expected, v.GetString()));
-
- // UTF16 -> UTF8 in memory
- StringBuffer bos;
- typedef EncodedOutputStream<UTF8<>, StringBuffer> OutputStream;
- OutputStream eos(bos, false); // Not writing BOM
- {
- Writer<OutputStream, UTF16<>, UTF8<> > writer(eos);
- d.Accept(writer);
- }
-
- // Condense the original file and compare.
- fp = OpenEncodedFile("utf8.json");
- FileReadStream is(fp, buffer, sizeof(buffer));
- Reader reader;
- StringBuffer bos2;
- Writer<StringBuffer> writer2(bos2);
- reader.Parse(is, writer2);
- fclose(fp);
-
- EXPECT_EQ(bos.GetSize(), bos2.GetSize());
- EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));
-}
-
-TEST(Document, ParseStream_AutoUTFInputStream) {
- // Any -> UTF8
- FILE* fp = OpenEncodedFile("utf32be.json");
- char buffer[256];
- FileReadStream bis(fp, buffer, sizeof(buffer));
- AutoUTFInputStream<unsigned, FileReadStream> eis(bis);
-
- Document d;
- d.ParseStream<0, AutoUTF<unsigned> >(eis);
- EXPECT_FALSE(d.HasParseError());
-
- fclose(fp);
-
- char expected[] = "I can eat glass and it doesn't hurt me.";
- Value& v = d["en"];
- EXPECT_TRUE(v.IsString());
- EXPECT_EQ(sizeof(expected) - 1, v.GetStringLength());
- EXPECT_EQ(0, StrCmp(expected, v.GetString()));
-
- // UTF8 -> UTF8 in memory
- StringBuffer bos;
- Writer<StringBuffer> writer(bos);
- d.Accept(writer);
-
- // Condense the original file and compare.
- fp = OpenEncodedFile("utf8.json");
- FileReadStream is(fp, buffer, sizeof(buffer));
- Reader reader;
- StringBuffer bos2;
- Writer<StringBuffer> writer2(bos2);
- reader.Parse(is, writer2);
- fclose(fp);
-
- EXPECT_EQ(bos.GetSize(), bos2.GetSize());
- EXPECT_EQ(0, memcmp(bos.GetString(), bos2.GetString(), bos2.GetSize()));
-}
-
-TEST(Document, Swap) {
- Document d1;
- Document::AllocatorType& a = d1.GetAllocator();
-
- d1.SetArray().PushBack(1, a).PushBack(2, a);
-
- Value o;
- o.SetObject().AddMember("a", 1, a);
-
- // Swap between Document and Value
- d1.Swap(o);
- EXPECT_TRUE(d1.IsObject());
- EXPECT_TRUE(o.IsArray());
-
- d1.Swap(o);
- EXPECT_TRUE(d1.IsArray());
- EXPECT_TRUE(o.IsObject());
-
- o.Swap(d1);
- EXPECT_TRUE(d1.IsObject());
- EXPECT_TRUE(o.IsArray());
-
- // Swap between Document and Document
- Document d2;
- d2.SetArray().PushBack(3, a);
- d1.Swap(d2);
- EXPECT_TRUE(d1.IsArray());
- EXPECT_TRUE(d2.IsObject());
- EXPECT_EQ(&d2.GetAllocator(), &a);
-
- // reset value
- Value().Swap(d1);
- EXPECT_TRUE(d1.IsNull());
-
- // reset document, including allocator
- // so clear o before so that it doesnt contain dangling elements
- o.Clear();
- Document().Swap(d2);
- EXPECT_TRUE(d2.IsNull());
- EXPECT_NE(&d2.GetAllocator(), &a);
-
- // testing std::swap compatibility
- d1.SetBool(true);
- using std::swap;
- swap(d1, d2);
- EXPECT_TRUE(d1.IsNull());
- EXPECT_TRUE(d2.IsTrue());
-
- swap(o, d2);
- EXPECT_TRUE(o.IsTrue());
- EXPECT_TRUE(d2.IsArray());
-}
-
-
-// This should be slow due to assignment in inner-loop.
-struct OutputStringStream : public std::ostringstream {
- typedef char Ch;
-
- virtual ~OutputStringStream();
-
- void Put(char c) {
- put(c);
- }
- void Flush() {}
-};
-
-OutputStringStream::~OutputStringStream() {}
-
-TEST(Document, AcceptWriter) {
- Document doc;
- doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
-
- OutputStringStream os;
- Writer<OutputStringStream> writer(os);
- doc.Accept(writer);
-
- EXPECT_EQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,4]}", os.str());
-}
-
-TEST(Document, UserBuffer) {
- typedef GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<> > DocumentType;
- char valueBuffer[4096];
- char parseBuffer[1024];
- MemoryPoolAllocator<> valueAllocator(valueBuffer, sizeof(valueBuffer));
- MemoryPoolAllocator<> parseAllocator(parseBuffer, sizeof(parseBuffer));
- DocumentType doc(&valueAllocator, sizeof(parseBuffer) / 2, &parseAllocator);
- doc.Parse(" { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ");
- EXPECT_FALSE(doc.HasParseError());
- EXPECT_LE(valueAllocator.Size(), sizeof(valueBuffer));
- EXPECT_LE(parseAllocator.Size(), sizeof(parseBuffer));
-
- // Cover MemoryPoolAllocator::Capacity()
- EXPECT_LE(valueAllocator.Size(), valueAllocator.Capacity());
- EXPECT_LE(parseAllocator.Size(), parseAllocator.Capacity());
-}
-
-// Issue 226: Value of string type should not point to NULL
-TEST(Document, AssertAcceptInvalidNameType) {
- Document doc;
- doc.SetObject();
- doc.AddMember("a", 0, doc.GetAllocator());
- doc.FindMember("a")->name.SetNull(); // Change name to non-string type.
-
- OutputStringStream os;
- Writer<OutputStringStream> writer(os);
- ASSERT_THROW(doc.Accept(writer), AssertException);
-}
-
-// Issue 44: SetStringRaw doesn't work with wchar_t
-TEST(Document, UTF16_Document) {
- GenericDocument< UTF16<> > json;
- json.Parse<kParseValidateEncodingFlag>(L"[{\"created_at\":\"Wed Oct 30 17:13:20 +0000 2012\"}]");
-
- ASSERT_TRUE(json.IsArray());
- GenericValue< UTF16<> >& v = json[0];
- ASSERT_TRUE(v.IsObject());
-
- GenericValue< UTF16<> >& s = v[L"created_at"];
- ASSERT_TRUE(s.IsString());
-
- EXPECT_EQ(0, memcmp(L"Wed Oct 30 17:13:20 +0000 2012", s.GetString(), (s.GetStringLength() + 1) * sizeof(wchar_t)));
-}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-#if 0 // Many old compiler does not support these. Turn it off temporaily.
-
-#include <type_traits>
-
-TEST(Document, Traits) {
- static_assert(std::is_constructible<Document>::value, "");
- static_assert(std::is_default_constructible<Document>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_constructible<Document>::value, "");
-#endif
- static_assert(std::is_move_constructible<Document>::value, "");
-
- static_assert(!std::is_nothrow_constructible<Document>::value, "");
- static_assert(!std::is_nothrow_default_constructible<Document>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_nothrow_copy_constructible<Document>::value, "");
- static_assert(std::is_nothrow_move_constructible<Document>::value, "");
-#endif
-
- static_assert(std::is_assignable<Document,Document>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_assignable<Document>::value, "");
-#endif
- static_assert(std::is_move_assignable<Document>::value, "");
-
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_assignable<Document, Document>::value, "");
-#endif
- static_assert(!std::is_nothrow_copy_assignable<Document>::value, "");
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_move_assignable<Document>::value, "");
-#endif
-
- static_assert( std::is_destructible<Document>::value, "");
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_destructible<Document>::value, "");
-#endif
-}
-
-#endif
-
-template <typename Allocator>
-struct DocumentMove: public ::testing::Test {
-};
-
-typedef ::testing::Types< CrtAllocator, MemoryPoolAllocator<> > MoveAllocatorTypes;
-TYPED_TEST_CASE(DocumentMove, MoveAllocatorTypes);
-
-TYPED_TEST(DocumentMove, MoveConstructor) {
- typedef TypeParam Allocator;
- typedef GenericDocument<UTF8<>, Allocator> D;
- Allocator allocator;
-
- D a(&allocator);
- a.Parse("[\"one\", \"two\", \"three\"]");
- EXPECT_FALSE(a.HasParseError());
- EXPECT_TRUE(a.IsArray());
- EXPECT_EQ(3u, a.Size());
- EXPECT_EQ(&a.GetAllocator(), &allocator);
-
- // Document b(a); // does not compile (!is_copy_constructible)
- D b(std::move(a));
- EXPECT_TRUE(a.IsNull());
- EXPECT_TRUE(b.IsArray());
- EXPECT_EQ(3u, b.Size());
- EXPECT_THROW(a.GetAllocator(), AssertException);
- EXPECT_EQ(&b.GetAllocator(), &allocator);
-
- b.Parse("{\"Foo\": \"Bar\", \"Baz\": 42}");
- EXPECT_FALSE(b.HasParseError());
- EXPECT_TRUE(b.IsObject());
- EXPECT_EQ(2u, b.MemberCount());
-
- // Document c = a; // does not compile (!is_copy_constructible)
- D c = std::move(b);
- EXPECT_TRUE(b.IsNull());
- EXPECT_TRUE(c.IsObject());
- EXPECT_EQ(2u, c.MemberCount());
- EXPECT_THROW(b.GetAllocator(), AssertException);
- EXPECT_EQ(&c.GetAllocator(), &allocator);
-}
-
-TYPED_TEST(DocumentMove, MoveConstructorParseError) {
- typedef TypeParam Allocator;
- typedef GenericDocument<UTF8<>, Allocator> D;
-
- ParseResult noError;
- D a;
- a.Parse("{ 4 = 4]");
- ParseResult error(a.GetParseError(), a.GetErrorOffset());
- EXPECT_TRUE(a.HasParseError());
- EXPECT_NE(error, noError);
- EXPECT_NE(error.Code(), noError);
- EXPECT_NE(error.Code(), noError.Code());
- EXPECT_NE(error.Offset(), noError.Offset());
-
- D b(std::move(a));
- EXPECT_FALSE(a.HasParseError());
- EXPECT_TRUE(b.HasParseError());
- EXPECT_EQ(a.GetParseError(), noError);
- EXPECT_EQ(a.GetParseError(), noError.Code());
- EXPECT_EQ(a.GetErrorOffset(), noError.Offset());
- EXPECT_EQ(b.GetParseError(), error);
- EXPECT_EQ(b.GetParseError(), error.Code());
- EXPECT_EQ(b.GetErrorOffset(), error.Offset());
-
- D c(std::move(b));
- EXPECT_FALSE(b.HasParseError());
- EXPECT_TRUE(c.HasParseError());
- EXPECT_EQ(b.GetParseError(), noError.Code());
- EXPECT_EQ(c.GetParseError(), error.Code());
- EXPECT_EQ(b.GetErrorOffset(), noError.Offset());
- EXPECT_EQ(c.GetErrorOffset(), error.Offset());
-}
-
-// This test does not properly use parsing, just for testing.
-// It must call ClearStack() explicitly to prevent memory leak.
-// But here we cannot as ClearStack() is private.
-#if 0
-TYPED_TEST(DocumentMove, MoveConstructorStack) {
- typedef TypeParam Allocator;
- typedef UTF8<> Encoding;
- typedef GenericDocument<Encoding, Allocator> Document;
-
- Document a;
- size_t defaultCapacity = a.GetStackCapacity();
-
- // Trick Document into getting GetStackCapacity() to return non-zero
- typedef GenericReader<Encoding, Encoding, Allocator> Reader;
- Reader reader(&a.GetAllocator());
- GenericStringStream<Encoding> is("[\"one\", \"two\", \"three\"]");
- reader.template Parse<kParseDefaultFlags>(is, a);
- size_t capacity = a.GetStackCapacity();
- EXPECT_GT(capacity, 0u);
-
- Document b(std::move(a));
- EXPECT_EQ(a.GetStackCapacity(), defaultCapacity);
- EXPECT_EQ(b.GetStackCapacity(), capacity);
-
- Document c = std::move(b);
- EXPECT_EQ(b.GetStackCapacity(), defaultCapacity);
- EXPECT_EQ(c.GetStackCapacity(), capacity);
-}
-#endif
-
-TYPED_TEST(DocumentMove, MoveAssignment) {
- typedef TypeParam Allocator;
- typedef GenericDocument<UTF8<>, Allocator> D;
- Allocator allocator;
-
- D a(&allocator);
- a.Parse("[\"one\", \"two\", \"three\"]");
- EXPECT_FALSE(a.HasParseError());
- EXPECT_TRUE(a.IsArray());
- EXPECT_EQ(3u, a.Size());
- EXPECT_EQ(&a.GetAllocator(), &allocator);
-
- // Document b; b = a; // does not compile (!is_copy_assignable)
- D b;
- b = std::move(a);
- EXPECT_TRUE(a.IsNull());
- EXPECT_TRUE(b.IsArray());
- EXPECT_EQ(3u, b.Size());
- EXPECT_THROW(a.GetAllocator(), AssertException);
- EXPECT_EQ(&b.GetAllocator(), &allocator);
-
- b.Parse("{\"Foo\": \"Bar\", \"Baz\": 42}");
- EXPECT_FALSE(b.HasParseError());
- EXPECT_TRUE(b.IsObject());
- EXPECT_EQ(2u, b.MemberCount());
-
- // Document c; c = a; // does not compile (see static_assert)
- D c;
- c = std::move(b);
- EXPECT_TRUE(b.IsNull());
- EXPECT_TRUE(c.IsObject());
- EXPECT_EQ(2u, c.MemberCount());
- EXPECT_THROW(b.GetAllocator(), AssertException);
- EXPECT_EQ(&c.GetAllocator(), &allocator);
-}
-
-TYPED_TEST(DocumentMove, MoveAssignmentParseError) {
- typedef TypeParam Allocator;
- typedef GenericDocument<UTF8<>, Allocator> D;
-
- ParseResult noError;
- D a;
- a.Parse("{ 4 = 4]");
- ParseResult error(a.GetParseError(), a.GetErrorOffset());
- EXPECT_TRUE(a.HasParseError());
- EXPECT_NE(error.Code(), noError.Code());
- EXPECT_NE(error.Offset(), noError.Offset());
-
- D b;
- b = std::move(a);
- EXPECT_FALSE(a.HasParseError());
- EXPECT_TRUE(b.HasParseError());
- EXPECT_EQ(a.GetParseError(), noError.Code());
- EXPECT_EQ(b.GetParseError(), error.Code());
- EXPECT_EQ(a.GetErrorOffset(), noError.Offset());
- EXPECT_EQ(b.GetErrorOffset(), error.Offset());
-
- D c;
- c = std::move(b);
- EXPECT_FALSE(b.HasParseError());
- EXPECT_TRUE(c.HasParseError());
- EXPECT_EQ(b.GetParseError(), noError.Code());
- EXPECT_EQ(c.GetParseError(), error.Code());
- EXPECT_EQ(b.GetErrorOffset(), noError.Offset());
- EXPECT_EQ(c.GetErrorOffset(), error.Offset());
-}
-
-// This test does not properly use parsing, just for testing.
-// It must call ClearStack() explicitly to prevent memory leak.
-// But here we cannot as ClearStack() is private.
-#if 0
-TYPED_TEST(DocumentMove, MoveAssignmentStack) {
- typedef TypeParam Allocator;
- typedef UTF8<> Encoding;
- typedef GenericDocument<Encoding, Allocator> D;
-
- D a;
- size_t defaultCapacity = a.GetStackCapacity();
-
- // Trick Document into getting GetStackCapacity() to return non-zero
- typedef GenericReader<Encoding, Encoding, Allocator> Reader;
- Reader reader(&a.GetAllocator());
- GenericStringStream<Encoding> is("[\"one\", \"two\", \"three\"]");
- reader.template Parse<kParseDefaultFlags>(is, a);
- size_t capacity = a.GetStackCapacity();
- EXPECT_GT(capacity, 0u);
-
- D b;
- b = std::move(a);
- EXPECT_EQ(a.GetStackCapacity(), defaultCapacity);
- EXPECT_EQ(b.GetStackCapacity(), capacity);
-
- D c;
- c = std::move(b);
- EXPECT_EQ(b.GetStackCapacity(), defaultCapacity);
- EXPECT_EQ(c.GetStackCapacity(), capacity);
-}
-#endif
-
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-// Issue 22: Memory corruption via operator=
-// Fixed by making unimplemented assignment operator private.
-//TEST(Document, Assignment) {
-// Document d1;
-// Document d2;
-// d1 = d2;
-//}
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/dtoatest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/dtoatest.cpp
deleted file mode 100644
index 69e2256b6c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/dtoatest.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/internal/dtoa.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(type-limits)
-#endif
-
-using namespace rapidjson::internal;
-
-TEST(dtoa, normal) {
- char buffer[30];
-
-#define TEST_DTOA(d, a)\
- *dtoa(d, buffer) = '\0';\
- EXPECT_STREQ(a, buffer)
-
- TEST_DTOA(0.0, "0.0");
- TEST_DTOA(-0.0, "-0.0");
- TEST_DTOA(1.0, "1.0");
- TEST_DTOA(-1.0, "-1.0");
- TEST_DTOA(1.2345, "1.2345");
- TEST_DTOA(1.2345678, "1.2345678");
- TEST_DTOA(0.123456789012, "0.123456789012");
- TEST_DTOA(1234567.8, "1234567.8");
- TEST_DTOA(-79.39773355813419, "-79.39773355813419");
- TEST_DTOA(-36.973846435546875, "-36.973846435546875");
- TEST_DTOA(0.000001, "0.000001");
- TEST_DTOA(0.0000001, "1e-7");
- TEST_DTOA(1e30, "1e30");
- TEST_DTOA(1.234567890123456e30, "1.234567890123456e30");
- TEST_DTOA(5e-324, "5e-324"); // Min subnormal positive double
- TEST_DTOA(2.225073858507201e-308, "2.225073858507201e-308"); // Max subnormal positive double
- TEST_DTOA(2.2250738585072014e-308, "2.2250738585072014e-308"); // Min normal positive double
- TEST_DTOA(1.7976931348623157e308, "1.7976931348623157e308"); // Max double
-
-#undef TEST_DTOA
-}
-
-TEST(dtoa, maxDecimalPlaces) {
- char buffer[30];
-
-#define TEST_DTOA(m, d, a)\
- *dtoa(d, buffer, m) = '\0';\
- EXPECT_STREQ(a, buffer)
-
- TEST_DTOA(3, 0.0, "0.0");
- TEST_DTOA(1, 0.0, "0.0");
- TEST_DTOA(3, -0.0, "-0.0");
- TEST_DTOA(3, 1.0, "1.0");
- TEST_DTOA(3, -1.0, "-1.0");
- TEST_DTOA(3, 1.2345, "1.234");
- TEST_DTOA(2, 1.2345, "1.23");
- TEST_DTOA(1, 1.2345, "1.2");
- TEST_DTOA(3, 1.2345678, "1.234");
- TEST_DTOA(3, 1.0001, "1.0");
- TEST_DTOA(2, 1.0001, "1.0");
- TEST_DTOA(1, 1.0001, "1.0");
- TEST_DTOA(3, 0.123456789012, "0.123");
- TEST_DTOA(2, 0.123456789012, "0.12");
- TEST_DTOA(1, 0.123456789012, "0.1");
- TEST_DTOA(4, 0.0001, "0.0001");
- TEST_DTOA(3, 0.0001, "0.0");
- TEST_DTOA(2, 0.0001, "0.0");
- TEST_DTOA(1, 0.0001, "0.0");
- TEST_DTOA(3, 1234567.8, "1234567.8");
- TEST_DTOA(3, 1e30, "1e30");
- TEST_DTOA(3, 5e-324, "0.0"); // Min subnormal positive double
- TEST_DTOA(3, 2.225073858507201e-308, "0.0"); // Max subnormal positive double
- TEST_DTOA(3, 2.2250738585072014e-308, "0.0"); // Min normal positive double
- TEST_DTOA(3, 1.7976931348623157e308, "1.7976931348623157e308"); // Max double
- TEST_DTOA(5, -0.14000000000000001, "-0.14");
- TEST_DTOA(4, -0.14000000000000001, "-0.14");
- TEST_DTOA(3, -0.14000000000000001, "-0.14");
- TEST_DTOA(3, -0.10000000000000001, "-0.1");
- TEST_DTOA(2, -0.10000000000000001, "-0.1");
- TEST_DTOA(1, -0.10000000000000001, "-0.1");
-
-#undef TEST_DTOA
-}
-
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodedstreamtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodedstreamtest.cpp
deleted file mode 100644
index 72a3441107..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodedstreamtest.cpp
+++ /dev/null
@@ -1,313 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/memorystream.h"
-#include "rapidjson/memorybuffer.h"
-
-using namespace rapidjson;
-
-class EncodedStreamTest : public ::testing::Test {
-public:
- EncodedStreamTest() : json_(), length_() {}
- virtual ~EncodedStreamTest();
-
- virtual void SetUp() {
- json_ = ReadFile("utf8.json", true, &length_);
- }
-
- virtual void TearDown() {
- free(json_);
- json_ = 0;
- }
-
-private:
- EncodedStreamTest(const EncodedStreamTest&);
- EncodedStreamTest& operator=(const EncodedStreamTest&);
-
-protected:
- static FILE* Open(const char* filename) {
- const char *paths[] = {
- "encodings",
- "bin/encodings",
- "../bin/encodings",
- "../../bin/encodings",
- "../../../bin/encodings"
- };
- char buffer[1024];
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s/%s", paths[i], filename);
- FILE *fp = fopen(buffer, "rb");
- if (fp)
- return fp;
- }
- return 0;
- }
-
- static char *ReadFile(const char* filename, bool appendPath, size_t* outLength) {
- FILE *fp = appendPath ? Open(filename) : fopen(filename, "rb");
-
- if (!fp) {
- *outLength = 0;
- return 0;
- }
-
- fseek(fp, 0, SEEK_END);
- *outLength = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- char* buffer = static_cast<char*>(malloc(*outLength + 1));
- size_t readLength = fread(buffer, 1, *outLength, fp);
- buffer[readLength] = '\0';
- fclose(fp);
- return buffer;
- }
-
- template <typename FileEncoding, typename MemoryEncoding>
- void TestEncodedInputStream(const char* filename) {
- // Test FileReadStream
- {
- char buffer[16];
- FILE *fp = Open(filename);
- ASSERT_TRUE(fp != 0);
- FileReadStream fs(fp, buffer, sizeof(buffer));
- EncodedInputStream<FileEncoding, FileReadStream> eis(fs);
- StringStream s(json_);
-
- while (eis.Peek() != '\0') {
- unsigned expected, actual;
- EXPECT_TRUE(UTF8<>::Decode(s, &expected));
- EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));
- EXPECT_EQ(expected, actual);
- }
- EXPECT_EQ('\0', s.Peek());
- fclose(fp);
- }
-
- // Test MemoryStream
- {
- size_t size;
- char* data = ReadFile(filename, true, &size);
- MemoryStream ms(data, size);
- EncodedInputStream<FileEncoding, MemoryStream> eis(ms);
- StringStream s(json_);
-
- while (eis.Peek() != '\0') {
- unsigned expected, actual;
- EXPECT_TRUE(UTF8<>::Decode(s, &expected));
- EXPECT_TRUE(MemoryEncoding::Decode(eis, &actual));
- EXPECT_EQ(expected, actual);
- }
- EXPECT_EQ('\0', s.Peek());
- EXPECT_EQ(size, eis.Tell());
- free(data);
- }
- }
-
- void TestAutoUTFInputStream(const char *filename, bool expectHasBOM) {
- // Test FileReadStream
- {
- char buffer[16];
- FILE *fp = Open(filename);
- ASSERT_TRUE(fp != 0);
- FileReadStream fs(fp, buffer, sizeof(buffer));
- AutoUTFInputStream<unsigned, FileReadStream> eis(fs);
- EXPECT_EQ(expectHasBOM, eis.HasBOM());
- StringStream s(json_);
- while (eis.Peek() != '\0') {
- unsigned expected, actual;
- EXPECT_TRUE(UTF8<>::Decode(s, &expected));
- EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));
- EXPECT_EQ(expected, actual);
- }
- EXPECT_EQ('\0', s.Peek());
- fclose(fp);
- }
-
- // Test MemoryStream
- {
- size_t size;
- char* data = ReadFile(filename, true, &size);
- MemoryStream ms(data, size);
- AutoUTFInputStream<unsigned, MemoryStream> eis(ms);
- EXPECT_EQ(expectHasBOM, eis.HasBOM());
- StringStream s(json_);
-
- while (eis.Peek() != '\0') {
- unsigned expected, actual;
- EXPECT_TRUE(UTF8<>::Decode(s, &expected));
- EXPECT_TRUE(AutoUTF<unsigned>::Decode(eis, &actual));
- EXPECT_EQ(expected, actual);
- }
- EXPECT_EQ('\0', s.Peek());
- free(data);
- EXPECT_EQ(size, eis.Tell());
- }
- }
-
- template <typename FileEncoding, typename MemoryEncoding>
- void TestEncodedOutputStream(const char* expectedFilename, bool putBOM) {
- // Test FileWriteStream
- {
- char filename[L_tmpnam];
- FILE* fp = TempFile(filename);
- char buffer[16];
- FileWriteStream os(fp, buffer, sizeof(buffer));
- EncodedOutputStream<FileEncoding, FileWriteStream> eos(os, putBOM);
- StringStream s(json_);
- while (s.Peek() != '\0') {
- bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);
- EXPECT_TRUE(success);
- }
- eos.Flush();
- fclose(fp);
- EXPECT_TRUE(CompareFile(filename, expectedFilename));
- remove(filename);
- }
-
- // Test MemoryBuffer
- {
- MemoryBuffer mb;
- EncodedOutputStream<FileEncoding, MemoryBuffer> eos(mb, putBOM);
- StringStream s(json_);
- while (s.Peek() != '\0') {
- bool success = Transcoder<UTF8<>, MemoryEncoding>::Transcode(s, eos);
- EXPECT_TRUE(success);
- }
- eos.Flush();
- EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));
- }
- }
-
- void TestAutoUTFOutputStream(UTFType type, bool putBOM, const char *expectedFilename) {
- // Test FileWriteStream
- {
- char filename[L_tmpnam];
- FILE* fp = TempFile(filename);
-
- char buffer[16];
- FileWriteStream os(fp, buffer, sizeof(buffer));
- AutoUTFOutputStream<unsigned, FileWriteStream> eos(os, type, putBOM);
- StringStream s(json_);
- while (s.Peek() != '\0') {
- bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);
- EXPECT_TRUE(success);
- }
- eos.Flush();
- fclose(fp);
- EXPECT_TRUE(CompareFile(filename, expectedFilename));
- remove(filename);
- }
-
- // Test MemoryBuffer
- {
- MemoryBuffer mb;
- AutoUTFOutputStream<unsigned, MemoryBuffer> eos(mb, type, putBOM);
- StringStream s(json_);
- while (s.Peek() != '\0') {
- bool success = Transcoder<UTF8<>, AutoUTF<unsigned> >::Transcode(s, eos);
- EXPECT_TRUE(success);
- }
- eos.Flush();
- EXPECT_TRUE(CompareBufferFile(mb.GetBuffer(), mb.GetSize(), expectedFilename));
- }
- }
-
- bool CompareFile(const char* filename, const char* expectedFilename) {
- size_t actualLength, expectedLength;
- char* actualBuffer = ReadFile(filename, false, &actualLength);
- char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);
- bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;
- free(actualBuffer);
- free(expectedBuffer);
- return ret;
- }
-
- bool CompareBufferFile(const char* actualBuffer, size_t actualLength, const char* expectedFilename) {
- size_t expectedLength;
- char* expectedBuffer = ReadFile(expectedFilename, true, &expectedLength);
- bool ret = (expectedLength == actualLength) && memcmp(expectedBuffer, actualBuffer, actualLength) == 0;
- free(expectedBuffer);
- return ret;
- }
-
- char *json_;
- size_t length_;
-};
-
-EncodedStreamTest::~EncodedStreamTest() {}
-
-TEST_F(EncodedStreamTest, EncodedInputStream) {
- TestEncodedInputStream<UTF8<>, UTF8<> >("utf8.json");
- TestEncodedInputStream<UTF8<>, UTF8<> >("utf8bom.json");
- TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16le.json");
- TestEncodedInputStream<UTF16LE<>, UTF16<> >("utf16lebom.json");
- TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16be.json");
- TestEncodedInputStream<UTF16BE<>, UTF16<> >("utf16bebom.json");
- TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32le.json");
- TestEncodedInputStream<UTF32LE<>, UTF32<> >("utf32lebom.json");
- TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32be.json");
- TestEncodedInputStream<UTF32BE<>, UTF32<> >("utf32bebom.json");
-}
-
-TEST_F(EncodedStreamTest, AutoUTFInputStream) {
- TestAutoUTFInputStream("utf8.json", false);
- TestAutoUTFInputStream("utf8bom.json", true);
- TestAutoUTFInputStream("utf16le.json", false);
- TestAutoUTFInputStream("utf16lebom.json",true);
- TestAutoUTFInputStream("utf16be.json", false);
- TestAutoUTFInputStream("utf16bebom.json",true);
- TestAutoUTFInputStream("utf32le.json", false);
- TestAutoUTFInputStream("utf32lebom.json",true);
- TestAutoUTFInputStream("utf32be.json", false);
- TestAutoUTFInputStream("utf32bebom.json", true);
-
- {
- // Auto detection fail, use user defined UTF type
- const char json[] = "{ }";
- MemoryStream ms(json, sizeof(json));
- AutoUTFInputStream<unsigned, MemoryStream> eis(ms, kUTF8);
- EXPECT_FALSE(eis.HasBOM());
- EXPECT_EQ(kUTF8, eis.GetType());
- }
-}
-
-TEST_F(EncodedStreamTest, EncodedOutputStream) {
- TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8.json", false);
- TestEncodedOutputStream<UTF8<>, UTF8<> >("utf8bom.json", true);
- TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16le.json", false);
- TestEncodedOutputStream<UTF16LE<>, UTF16<> >("utf16lebom.json",true);
- TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16be.json", false);
- TestEncodedOutputStream<UTF16BE<>, UTF16<> >("utf16bebom.json",true);
- TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32le.json", false);
- TestEncodedOutputStream<UTF32LE<>, UTF32<> >("utf32lebom.json",true);
- TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32be.json", false);
- TestEncodedOutputStream<UTF32BE<>, UTF32<> >("utf32bebom.json",true);
-}
-
-TEST_F(EncodedStreamTest, AutoUTFOutputStream) {
- TestAutoUTFOutputStream(kUTF8, false, "utf8.json");
- TestAutoUTFOutputStream(kUTF8, true, "utf8bom.json");
- TestAutoUTFOutputStream(kUTF16LE, false, "utf16le.json");
- TestAutoUTFOutputStream(kUTF16LE, true, "utf16lebom.json");
- TestAutoUTFOutputStream(kUTF16BE, false, "utf16be.json");
- TestAutoUTFOutputStream(kUTF16BE, true, "utf16bebom.json");
- TestAutoUTFOutputStream(kUTF32LE, false, "utf32le.json");
- TestAutoUTFOutputStream(kUTF32LE, true, "utf32lebom.json");
- TestAutoUTFOutputStream(kUTF32BE, false, "utf32be.json");
- TestAutoUTFOutputStream(kUTF32BE, true, "utf32bebom.json");
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodingstest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodingstest.cpp
deleted file mode 100644
index ab0175a780..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/encodingstest.cpp
+++ /dev/null
@@ -1,451 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/stringbuffer.h"
-
-using namespace rapidjson;
-
-// Verification of encoders/decoders with Hoehrmann's UTF8 decoder
-
-// http://www.unicode.org/Public/UNIDATA/Blocks.txt
-static const unsigned kCodepointRanges[] = {
- 0x0000, 0x007F, // Basic Latin
- 0x0080, 0x00FF, // Latin-1 Supplement
- 0x0100, 0x017F, // Latin Extended-A
- 0x0180, 0x024F, // Latin Extended-B
- 0x0250, 0x02AF, // IPA Extensions
- 0x02B0, 0x02FF, // Spacing Modifier Letters
- 0x0300, 0x036F, // Combining Diacritical Marks
- 0x0370, 0x03FF, // Greek and Coptic
- 0x0400, 0x04FF, // Cyrillic
- 0x0500, 0x052F, // Cyrillic Supplement
- 0x0530, 0x058F, // Armenian
- 0x0590, 0x05FF, // Hebrew
- 0x0600, 0x06FF, // Arabic
- 0x0700, 0x074F, // Syriac
- 0x0750, 0x077F, // Arabic Supplement
- 0x0780, 0x07BF, // Thaana
- 0x07C0, 0x07FF, // NKo
- 0x0800, 0x083F, // Samaritan
- 0x0840, 0x085F, // Mandaic
- 0x0900, 0x097F, // Devanagari
- 0x0980, 0x09FF, // Bengali
- 0x0A00, 0x0A7F, // Gurmukhi
- 0x0A80, 0x0AFF, // Gujarati
- 0x0B00, 0x0B7F, // Oriya
- 0x0B80, 0x0BFF, // Tamil
- 0x0C00, 0x0C7F, // Telugu
- 0x0C80, 0x0CFF, // Kannada
- 0x0D00, 0x0D7F, // Malayalam
- 0x0D80, 0x0DFF, // Sinhala
- 0x0E00, 0x0E7F, // Thai
- 0x0E80, 0x0EFF, // Lao
- 0x0F00, 0x0FFF, // Tibetan
- 0x1000, 0x109F, // Myanmar
- 0x10A0, 0x10FF, // Georgian
- 0x1100, 0x11FF, // Hangul Jamo
- 0x1200, 0x137F, // Ethiopic
- 0x1380, 0x139F, // Ethiopic Supplement
- 0x13A0, 0x13FF, // Cherokee
- 0x1400, 0x167F, // Unified Canadian Aboriginal Syllabics
- 0x1680, 0x169F, // Ogham
- 0x16A0, 0x16FF, // Runic
- 0x1700, 0x171F, // Tagalog
- 0x1720, 0x173F, // Hanunoo
- 0x1740, 0x175F, // Buhid
- 0x1760, 0x177F, // Tagbanwa
- 0x1780, 0x17FF, // Khmer
- 0x1800, 0x18AF, // Mongolian
- 0x18B0, 0x18FF, // Unified Canadian Aboriginal Syllabics Extended
- 0x1900, 0x194F, // Limbu
- 0x1950, 0x197F, // Tai Le
- 0x1980, 0x19DF, // New Tai Lue
- 0x19E0, 0x19FF, // Khmer Symbols
- 0x1A00, 0x1A1F, // Buginese
- 0x1A20, 0x1AAF, // Tai Tham
- 0x1B00, 0x1B7F, // Balinese
- 0x1B80, 0x1BBF, // Sundanese
- 0x1BC0, 0x1BFF, // Batak
- 0x1C00, 0x1C4F, // Lepcha
- 0x1C50, 0x1C7F, // Ol Chiki
- 0x1CD0, 0x1CFF, // Vedic Extensions
- 0x1D00, 0x1D7F, // Phonetic Extensions
- 0x1D80, 0x1DBF, // Phonetic Extensions Supplement
- 0x1DC0, 0x1DFF, // Combining Diacritical Marks Supplement
- 0x1E00, 0x1EFF, // Latin Extended Additional
- 0x1F00, 0x1FFF, // Greek Extended
- 0x2000, 0x206F, // General Punctuation
- 0x2070, 0x209F, // Superscripts and Subscripts
- 0x20A0, 0x20CF, // Currency Symbols
- 0x20D0, 0x20FF, // Combining Diacritical Marks for Symbols
- 0x2100, 0x214F, // Letterlike Symbols
- 0x2150, 0x218F, // Number Forms
- 0x2190, 0x21FF, // Arrows
- 0x2200, 0x22FF, // Mathematical Operators
- 0x2300, 0x23FF, // Miscellaneous Technical
- 0x2400, 0x243F, // Control Pictures
- 0x2440, 0x245F, // Optical Character Recognition
- 0x2460, 0x24FF, // Enclosed Alphanumerics
- 0x2500, 0x257F, // Box Drawing
- 0x2580, 0x259F, // Block Elements
- 0x25A0, 0x25FF, // Geometric Shapes
- 0x2600, 0x26FF, // Miscellaneous Symbols
- 0x2700, 0x27BF, // Dingbats
- 0x27C0, 0x27EF, // Miscellaneous Mathematical Symbols-A
- 0x27F0, 0x27FF, // Supplemental Arrows-A
- 0x2800, 0x28FF, // Braille Patterns
- 0x2900, 0x297F, // Supplemental Arrows-B
- 0x2980, 0x29FF, // Miscellaneous Mathematical Symbols-B
- 0x2A00, 0x2AFF, // Supplemental Mathematical Operators
- 0x2B00, 0x2BFF, // Miscellaneous Symbols and Arrows
- 0x2C00, 0x2C5F, // Glagolitic
- 0x2C60, 0x2C7F, // Latin Extended-C
- 0x2C80, 0x2CFF, // Coptic
- 0x2D00, 0x2D2F, // Georgian Supplement
- 0x2D30, 0x2D7F, // Tifinagh
- 0x2D80, 0x2DDF, // Ethiopic Extended
- 0x2DE0, 0x2DFF, // Cyrillic Extended-A
- 0x2E00, 0x2E7F, // Supplemental Punctuation
- 0x2E80, 0x2EFF, // CJK Radicals Supplement
- 0x2F00, 0x2FDF, // Kangxi Radicals
- 0x2FF0, 0x2FFF, // Ideographic Description Characters
- 0x3000, 0x303F, // CJK Symbols and Punctuation
- 0x3040, 0x309F, // Hiragana
- 0x30A0, 0x30FF, // Katakana
- 0x3100, 0x312F, // Bopomofo
- 0x3130, 0x318F, // Hangul Compatibility Jamo
- 0x3190, 0x319F, // Kanbun
- 0x31A0, 0x31BF, // Bopomofo Extended
- 0x31C0, 0x31EF, // CJK Strokes
- 0x31F0, 0x31FF, // Katakana Phonetic Extensions
- 0x3200, 0x32FF, // Enclosed CJK Letters and Months
- 0x3300, 0x33FF, // CJK Compatibility
- 0x3400, 0x4DBF, // CJK Unified Ideographs Extension A
- 0x4DC0, 0x4DFF, // Yijing Hexagram Symbols
- 0x4E00, 0x9FFF, // CJK Unified Ideographs
- 0xA000, 0xA48F, // Yi Syllables
- 0xA490, 0xA4CF, // Yi Radicals
- 0xA4D0, 0xA4FF, // Lisu
- 0xA500, 0xA63F, // Vai
- 0xA640, 0xA69F, // Cyrillic Extended-B
- 0xA6A0, 0xA6FF, // Bamum
- 0xA700, 0xA71F, // Modifier Tone Letters
- 0xA720, 0xA7FF, // Latin Extended-D
- 0xA800, 0xA82F, // Syloti Nagri
- 0xA830, 0xA83F, // Common Indic Number Forms
- 0xA840, 0xA87F, // Phags-pa
- 0xA880, 0xA8DF, // Saurashtra
- 0xA8E0, 0xA8FF, // Devanagari Extended
- 0xA900, 0xA92F, // Kayah Li
- 0xA930, 0xA95F, // Rejang
- 0xA960, 0xA97F, // Hangul Jamo Extended-A
- 0xA980, 0xA9DF, // Javanese
- 0xAA00, 0xAA5F, // Cham
- 0xAA60, 0xAA7F, // Myanmar Extended-A
- 0xAA80, 0xAADF, // Tai Viet
- 0xAB00, 0xAB2F, // Ethiopic Extended-A
- 0xABC0, 0xABFF, // Meetei Mayek
- 0xAC00, 0xD7AF, // Hangul Syllables
- 0xD7B0, 0xD7FF, // Hangul Jamo Extended-B
- //0xD800, 0xDB7F, // High Surrogates
- //0xDB80, 0xDBFF, // High Private Use Surrogates
- //0xDC00, 0xDFFF, // Low Surrogates
- 0xE000, 0xF8FF, // Private Use Area
- 0xF900, 0xFAFF, // CJK Compatibility Ideographs
- 0xFB00, 0xFB4F, // Alphabetic Presentation Forms
- 0xFB50, 0xFDFF, // Arabic Presentation Forms-A
- 0xFE00, 0xFE0F, // Variation Selectors
- 0xFE10, 0xFE1F, // Vertical Forms
- 0xFE20, 0xFE2F, // Combining Half Marks
- 0xFE30, 0xFE4F, // CJK Compatibility Forms
- 0xFE50, 0xFE6F, // Small Form Variants
- 0xFE70, 0xFEFF, // Arabic Presentation Forms-B
- 0xFF00, 0xFFEF, // Halfwidth and Fullwidth Forms
- 0xFFF0, 0xFFFF, // Specials
- 0x10000, 0x1007F, // Linear B Syllabary
- 0x10080, 0x100FF, // Linear B Ideograms
- 0x10100, 0x1013F, // Aegean Numbers
- 0x10140, 0x1018F, // Ancient Greek Numbers
- 0x10190, 0x101CF, // Ancient Symbols
- 0x101D0, 0x101FF, // Phaistos Disc
- 0x10280, 0x1029F, // Lycian
- 0x102A0, 0x102DF, // Carian
- 0x10300, 0x1032F, // Old Italic
- 0x10330, 0x1034F, // Gothic
- 0x10380, 0x1039F, // Ugaritic
- 0x103A0, 0x103DF, // Old Persian
- 0x10400, 0x1044F, // Deseret
- 0x10450, 0x1047F, // Shavian
- 0x10480, 0x104AF, // Osmanya
- 0x10800, 0x1083F, // Cypriot Syllabary
- 0x10840, 0x1085F, // Imperial Aramaic
- 0x10900, 0x1091F, // Phoenician
- 0x10920, 0x1093F, // Lydian
- 0x10A00, 0x10A5F, // Kharoshthi
- 0x10A60, 0x10A7F, // Old South Arabian
- 0x10B00, 0x10B3F, // Avestan
- 0x10B40, 0x10B5F, // Inscriptional Parthian
- 0x10B60, 0x10B7F, // Inscriptional Pahlavi
- 0x10C00, 0x10C4F, // Old Turkic
- 0x10E60, 0x10E7F, // Rumi Numeral Symbols
- 0x11000, 0x1107F, // Brahmi
- 0x11080, 0x110CF, // Kaithi
- 0x12000, 0x123FF, // Cuneiform
- 0x12400, 0x1247F, // Cuneiform Numbers and Punctuation
- 0x13000, 0x1342F, // Egyptian Hieroglyphs
- 0x16800, 0x16A3F, // Bamum Supplement
- 0x1B000, 0x1B0FF, // Kana Supplement
- 0x1D000, 0x1D0FF, // Byzantine Musical Symbols
- 0x1D100, 0x1D1FF, // Musical Symbols
- 0x1D200, 0x1D24F, // Ancient Greek Musical Notation
- 0x1D300, 0x1D35F, // Tai Xuan Jing Symbols
- 0x1D360, 0x1D37F, // Counting Rod Numerals
- 0x1D400, 0x1D7FF, // Mathematical Alphanumeric Symbols
- 0x1F000, 0x1F02F, // Mahjong Tiles
- 0x1F030, 0x1F09F, // Domino Tiles
- 0x1F0A0, 0x1F0FF, // Playing Cards
- 0x1F100, 0x1F1FF, // Enclosed Alphanumeric Supplement
- 0x1F200, 0x1F2FF, // Enclosed Ideographic Supplement
- 0x1F300, 0x1F5FF, // Miscellaneous Symbols And Pictographs
- 0x1F600, 0x1F64F, // Emoticons
- 0x1F680, 0x1F6FF, // Transport And Map Symbols
- 0x1F700, 0x1F77F, // Alchemical Symbols
- 0x20000, 0x2A6DF, // CJK Unified Ideographs Extension B
- 0x2A700, 0x2B73F, // CJK Unified Ideographs Extension C
- 0x2B740, 0x2B81F, // CJK Unified Ideographs Extension D
- 0x2F800, 0x2FA1F, // CJK Compatibility Ideographs Supplement
- 0xE0000, 0xE007F, // Tags
- 0xE0100, 0xE01EF, // Variation Selectors Supplement
- 0xF0000, 0xFFFFF, // Supplementary Private Use Area-A
- 0x100000, 0x10FFFF, // Supplementary Private Use Area-B
- 0xFFFFFFFF
-};
-
-// Copyright (c) 2008-2010 Bjoern Hoehrmann <bjoern@hoehrmann.de>
-// See http://bjoern.hoehrmann.de/utf-8/decoder/dfa/ for details.
-
-#define UTF8_ACCEPT 0u
-
-static const unsigned char utf8d[] = {
- // The first part of the table maps bytes to character classes that
- // to reduce the size of the transition table and create bitmasks.
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
- 8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8,
-
- // The second part is a transition table that maps a combination
- // of a state of the automaton and a character class to a state.
- 0,12,24,36,60,96,84,12,12,12,48,72, 12,12,12,12,12,12,12,12,12,12,12,12,
- 12, 0,12,12,12,12,12, 0,12, 0,12,12, 12,24,12,12,12,12,12,24,12,24,12,12,
- 12,12,12,12,12,12,12,24,12,12,12,12, 12,24,12,12,12,12,12,12,12,24,12,12,
- 12,12,12,12,12,12,12,36,12,36,12,12, 12,36,12,12,12,12,12,36,12,36,12,12,
- 12,36,12,12,12,12,12,12,12,12,12,12,
-};
-
-static unsigned inline decode(unsigned* state, unsigned* codep, unsigned byte) {
- unsigned type = utf8d[byte];
-
- *codep = (*state != UTF8_ACCEPT) ?
- (byte & 0x3fu) | (*codep << 6) :
- (0xffu >> type) & (byte);
-
- *state = utf8d[256 + *state + type];
- return *state;
-}
-
-//static bool IsUTF8(unsigned char* s) {
-// unsigned codepoint, state = 0;
-//
-// while (*s)
-// decode(&state, &codepoint, *s++);
-//
-// return state == UTF8_ACCEPT;
-//}
-
-TEST(EncodingsTest, UTF8) {
- StringBuffer os, os2;
- for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
- for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
- os.Clear();
- UTF8<>::Encode(os, codepoint);
- const char* encodedStr = os.GetString();
-
- // Decode with Hoehrmann
- {
- unsigned decodedCodepoint = 0;
- unsigned state = 0;
-
- unsigned decodedCount = 0;
- for (const char* s = encodedStr; *s; ++s)
- if (!decode(&state, &decodedCodepoint, static_cast<unsigned char>(*s))) {
- EXPECT_EQ(codepoint, decodedCodepoint);
- decodedCount++;
- }
-
- if (*encodedStr) { // This decoder cannot handle U+0000
- EXPECT_EQ(1u, decodedCount); // Should only contain one code point
- }
-
- EXPECT_EQ(UTF8_ACCEPT, state);
- if (UTF8_ACCEPT != state)
- std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
- }
-
- // Decode
- {
- StringStream is(encodedStr);
- unsigned decodedCodepoint;
- bool result = UTF8<>::Decode(is, &decodedCodepoint);
- EXPECT_TRUE(result);
- EXPECT_EQ(codepoint, decodedCodepoint);
- if (!result || codepoint != decodedCodepoint)
- std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
- }
-
- // Validate
- {
- StringStream is(encodedStr);
- os2.Clear();
- bool result = UTF8<>::Validate(is, os2);
- EXPECT_TRUE(result);
- EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
- }
- }
- }
-}
-
-TEST(EncodingsTest, UTF16) {
- GenericStringBuffer<UTF16<> > os, os2;
- GenericStringBuffer<UTF8<> > utf8os;
- for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
- for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
- os.Clear();
- UTF16<>::Encode(os, codepoint);
- const UTF16<>::Ch* encodedStr = os.GetString();
-
- // Encode with Hoehrmann's code
- if (codepoint != 0) // cannot handle U+0000
- {
- // encode with UTF8<> first
- utf8os.Clear();
- UTF8<>::Encode(utf8os, codepoint);
-
- // transcode from UTF8 to UTF16 with Hoehrmann's code
- unsigned decodedCodepoint = 0;
- unsigned state = 0;
- UTF16<>::Ch buffer[3], *p = &buffer[0];
- for (const char* s = utf8os.GetString(); *s; ++s) {
- if (!decode(&state, &decodedCodepoint, static_cast<unsigned char>(*s)))
- break;
- }
-
- if (codepoint <= 0xFFFF)
- *p++ = static_cast<UTF16<>::Ch>(decodedCodepoint);
- else {
- // Encode code points above U+FFFF as surrogate pair.
- *p++ = static_cast<UTF16<>::Ch>(0xD7C0 + (decodedCodepoint >> 10));
- *p++ = static_cast<UTF16<>::Ch>(0xDC00 + (decodedCodepoint & 0x3FF));
- }
- *p++ = '\0';
-
- EXPECT_EQ(0, StrCmp(buffer, encodedStr));
- }
-
- // Decode
- {
- GenericStringStream<UTF16<> > is(encodedStr);
- unsigned decodedCodepoint;
- bool result = UTF16<>::Decode(is, &decodedCodepoint);
- EXPECT_TRUE(result);
- EXPECT_EQ(codepoint, decodedCodepoint);
- if (!result || codepoint != decodedCodepoint)
- std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
- }
-
- // Validate
- {
- GenericStringStream<UTF16<> > is(encodedStr);
- os2.Clear();
- bool result = UTF16<>::Validate(is, os2);
- EXPECT_TRUE(result);
- EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
- }
- }
- }
-}
-
-TEST(EncodingsTest, UTF32) {
- GenericStringBuffer<UTF32<> > os, os2;
- for (const unsigned* range = kCodepointRanges; *range != 0xFFFFFFFF; range += 2) {
- for (unsigned codepoint = range[0]; codepoint <= range[1]; ++codepoint) {
- os.Clear();
- UTF32<>::Encode(os, codepoint);
- const UTF32<>::Ch* encodedStr = os.GetString();
-
- // Decode
- {
- GenericStringStream<UTF32<> > is(encodedStr);
- unsigned decodedCodepoint;
- bool result = UTF32<>::Decode(is, &decodedCodepoint);
- EXPECT_TRUE(result);
- EXPECT_EQ(codepoint, decodedCodepoint);
- if (!result || codepoint != decodedCodepoint)
- std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
- }
-
- // Validate
- {
- GenericStringStream<UTF32<> > is(encodedStr);
- os2.Clear();
- bool result = UTF32<>::Validate(is, os2);
- EXPECT_TRUE(result);
- EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
- }
- }
- }
-}
-
-TEST(EncodingsTest, ASCII) {
- StringBuffer os, os2;
- for (unsigned codepoint = 0; codepoint < 128; codepoint++) {
- os.Clear();
- ASCII<>::Encode(os, codepoint);
- const ASCII<>::Ch* encodedStr = os.GetString();
- {
- StringStream is(encodedStr);
- unsigned decodedCodepoint;
- bool result = ASCII<>::Decode(is, &decodedCodepoint);
- if (!result || codepoint != decodedCodepoint)
- std::cout << std::hex << codepoint << " " << decodedCodepoint << std::endl;
- }
-
- // Validate
- {
- StringStream is(encodedStr);
- os2.Clear();
- bool result = ASCII<>::Validate(is, os2);
- EXPECT_TRUE(result);
- EXPECT_EQ(0, StrCmp(encodedStr, os2.GetString()));
- }
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/filestreamtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/filestreamtest.cpp
deleted file mode 100644
index 34da56cef8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/filestreamtest.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/encodedstream.h"
-
-using namespace rapidjson;
-
-class FileStreamTest : public ::testing::Test {
-public:
- FileStreamTest() : filename_(), json_(), length_(), abcde_() {}
- virtual ~FileStreamTest();
-
- virtual void SetUp() {
- const char *paths[] = {
- "data/sample.json",
- "bin/data/sample.json",
- "../bin/data/sample.json",
- "../../bin/data/sample.json",
- "../../../bin/data/sample.json"
- };
- FILE* fp = 0;
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- fp = fopen(paths[i], "rb");
- if (fp) {
- filename_ = paths[i];
- break;
- }
- }
- ASSERT_TRUE(fp != 0);
-
- fseek(fp, 0, SEEK_END);
- length_ = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- json_ = static_cast<char*>(malloc(length_ + 1));
- size_t readLength = fread(json_, 1, length_, fp);
- json_[readLength] = '\0';
- fclose(fp);
-
- const char *abcde_paths[] = {
- "data/abcde.txt",
- "bin/data/abcde.txt",
- "../bin/data/abcde.txt",
- "../../bin/data/abcde.txt",
- "../../../bin/data/abcde.txt"
- };
- fp = 0;
- for (size_t i = 0; i < sizeof(abcde_paths) / sizeof(abcde_paths[0]); i++) {
- fp = fopen(abcde_paths[i], "rb");
- if (fp) {
- abcde_ = abcde_paths[i];
- break;
- }
- }
- ASSERT_TRUE(fp != 0);
- fclose(fp);
- }
-
- virtual void TearDown() {
- free(json_);
- json_ = 0;
- }
-
-private:
- FileStreamTest(const FileStreamTest&);
- FileStreamTest& operator=(const FileStreamTest&);
-
-protected:
- const char* filename_;
- char *json_;
- size_t length_;
- const char* abcde_;
-};
-
-FileStreamTest::~FileStreamTest() {}
-
-TEST_F(FileStreamTest, FileReadStream) {
- FILE *fp = fopen(filename_, "rb");
- ASSERT_TRUE(fp != 0);
- char buffer[65536];
- FileReadStream s(fp, buffer, sizeof(buffer));
-
- for (size_t i = 0; i < length_; i++) {
- EXPECT_EQ(json_[i], s.Peek());
- EXPECT_EQ(json_[i], s.Peek()); // 2nd time should be the same
- EXPECT_EQ(json_[i], s.Take());
- }
-
- EXPECT_EQ(length_, s.Tell());
- EXPECT_EQ('\0', s.Peek());
-
- fclose(fp);
-}
-
-TEST_F(FileStreamTest, FileReadStream_Peek4) {
- FILE *fp = fopen(abcde_, "rb");
- ASSERT_TRUE(fp != 0);
- char buffer[4];
- FileReadStream s(fp, buffer, sizeof(buffer));
-
- const char* c = s.Peek4();
- for (int i = 0; i < 4; i++)
- EXPECT_EQ('a' + i, c[i]);
- EXPECT_EQ(0u, s.Tell());
-
- for (int i = 0; i < 5; i++) {
- EXPECT_EQ(static_cast<size_t>(i), s.Tell());
- EXPECT_EQ('a' + i, s.Peek());
- EXPECT_EQ('a' + i, s.Peek());
- EXPECT_EQ('a' + i, s.Take());
- }
- EXPECT_EQ(5u, s.Tell());
- EXPECT_EQ(0, s.Peek());
- EXPECT_EQ(0, s.Take());
-
- fclose(fp);
-}
-
-TEST_F(FileStreamTest, FileWriteStream) {
- char filename[L_tmpnam];
- FILE* fp = TempFile(filename);
-
- char buffer[65536];
- FileWriteStream os(fp, buffer, sizeof(buffer));
- for (size_t i = 0; i < length_; i++)
- os.Put(json_[i]);
- os.Flush();
- fclose(fp);
-
- // Read it back to verify
- fp = fopen(filename, "rb");
- FileReadStream is(fp, buffer, sizeof(buffer));
-
- for (size_t i = 0; i < length_; i++)
- EXPECT_EQ(json_[i], is.Take());
-
- EXPECT_EQ(length_, is.Tell());
- fclose(fp);
-
- //std::cout << filename << std::endl;
- remove(filename);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/fwdtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/fwdtest.cpp
deleted file mode 100644
index 62ab5a0344..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/fwdtest.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-// Using forward declared types here.
-
-#include "rapidjson/fwd.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-using namespace rapidjson;
-
-struct Foo {
- Foo();
- ~Foo();
-
- // encodings.h
- UTF8<char>* utf8;
- UTF16<wchar_t>* utf16;
- UTF16BE<wchar_t>* utf16be;
- UTF16LE<wchar_t>* utf16le;
- UTF32<unsigned>* utf32;
- UTF32BE<unsigned>* utf32be;
- UTF32LE<unsigned>* utf32le;
- ASCII<char>* ascii;
- AutoUTF<unsigned>* autoutf;
- Transcoder<UTF8<char>, UTF8<char> >* transcoder;
-
- // allocators.h
- CrtAllocator* crtallocator;
- MemoryPoolAllocator<CrtAllocator>* memorypoolallocator;
-
- // stream.h
- StringStream* stringstream;
- InsituStringStream* insitustringstream;
-
- // stringbuffer.h
- StringBuffer* stringbuffer;
-
- // // filereadstream.h
- // FileReadStream* filereadstream;
-
- // // filewritestream.h
- // FileWriteStream* filewritestream;
-
- // memorybuffer.h
- MemoryBuffer* memorybuffer;
-
- // memorystream.h
- MemoryStream* memorystream;
-
- // reader.h
- BaseReaderHandler<UTF8<char>, void>* basereaderhandler;
- Reader* reader;
-
- // writer.h
- Writer<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* writer;
-
- // prettywriter.h
- PrettyWriter<StringBuffer, UTF8<char>, UTF8<char>, CrtAllocator, 0>* prettywriter;
-
- // document.h
- Value* value;
- Document* document;
-
- // pointer.h
- Pointer* pointer;
-
- // schema.h
- SchemaDocument* schemadocument;
- SchemaValidator* schemavalidator;
-
- // char buffer[16];
-};
-
-// Using type definitions here.
-
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/memorybuffer.h"
-#include "rapidjson/memorystream.h"
-#include "rapidjson/document.h" // -> reader.h
-#include "rapidjson/writer.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/schema.h" // -> pointer.h
-
-typedef Transcoder<UTF8<>, UTF8<> > TranscoderUtf8ToUtf8;
-typedef BaseReaderHandler<UTF8<>, void> BaseReaderHandlerUtf8Void;
-
-Foo::Foo() :
- // encodings.h
- utf8(RAPIDJSON_NEW(UTF8<>)),
- utf16(RAPIDJSON_NEW(UTF16<>)),
- utf16be(RAPIDJSON_NEW(UTF16BE<>)),
- utf16le(RAPIDJSON_NEW(UTF16LE<>)),
- utf32(RAPIDJSON_NEW(UTF32<>)),
- utf32be(RAPIDJSON_NEW(UTF32BE<>)),
- utf32le(RAPIDJSON_NEW(UTF32LE<>)),
- ascii(RAPIDJSON_NEW(ASCII<>)),
- autoutf(RAPIDJSON_NEW(AutoUTF<unsigned>)),
- transcoder(RAPIDJSON_NEW(TranscoderUtf8ToUtf8)),
-
- // allocators.h
- crtallocator(RAPIDJSON_NEW(CrtAllocator)),
- memorypoolallocator(RAPIDJSON_NEW(MemoryPoolAllocator<>)),
-
- // stream.h
- stringstream(RAPIDJSON_NEW(StringStream)(NULL)),
- insitustringstream(RAPIDJSON_NEW(InsituStringStream)(NULL)),
-
- // stringbuffer.h
- stringbuffer(RAPIDJSON_NEW(StringBuffer)),
-
- // // filereadstream.h
- // filereadstream(RAPIDJSON_NEW(FileReadStream)(stdout, buffer, sizeof(buffer))),
-
- // // filewritestream.h
- // filewritestream(RAPIDJSON_NEW(FileWriteStream)(stdout, buffer, sizeof(buffer))),
-
- // memorybuffer.h
- memorybuffer(RAPIDJSON_NEW(MemoryBuffer)),
-
- // memorystream.h
- memorystream(RAPIDJSON_NEW(MemoryStream)(NULL, 0)),
-
- // reader.h
- basereaderhandler(RAPIDJSON_NEW(BaseReaderHandlerUtf8Void)),
- reader(RAPIDJSON_NEW(Reader)),
-
- // writer.h
- writer(RAPIDJSON_NEW(Writer<StringBuffer>)),
-
- // prettywriter.h
- prettywriter(RAPIDJSON_NEW(PrettyWriter<StringBuffer>)),
-
- // document.h
- value(RAPIDJSON_NEW(Value)),
- document(RAPIDJSON_NEW(Document)),
-
- // pointer.h
- pointer(RAPIDJSON_NEW(Pointer)),
-
- // schema.h
- schemadocument(RAPIDJSON_NEW(SchemaDocument)(*document)),
- schemavalidator(RAPIDJSON_NEW(SchemaValidator)(*schemadocument))
-{
-
-}
-
-Foo::~Foo() {
- // encodings.h
- RAPIDJSON_DELETE(utf8);
- RAPIDJSON_DELETE(utf16);
- RAPIDJSON_DELETE(utf16be);
- RAPIDJSON_DELETE(utf16le);
- RAPIDJSON_DELETE(utf32);
- RAPIDJSON_DELETE(utf32be);
- RAPIDJSON_DELETE(utf32le);
- RAPIDJSON_DELETE(ascii);
- RAPIDJSON_DELETE(autoutf);
- RAPIDJSON_DELETE(transcoder);
-
- // allocators.h
- RAPIDJSON_DELETE(crtallocator);
- RAPIDJSON_DELETE(memorypoolallocator);
-
- // stream.h
- RAPIDJSON_DELETE(stringstream);
- RAPIDJSON_DELETE(insitustringstream);
-
- // stringbuffer.h
- RAPIDJSON_DELETE(stringbuffer);
-
- // // filereadstream.h
- // RAPIDJSON_DELETE(filereadstream);
-
- // // filewritestream.h
- // RAPIDJSON_DELETE(filewritestream);
-
- // memorybuffer.h
- RAPIDJSON_DELETE(memorybuffer);
-
- // memorystream.h
- RAPIDJSON_DELETE(memorystream);
-
- // reader.h
- RAPIDJSON_DELETE(basereaderhandler);
- RAPIDJSON_DELETE(reader);
-
- // writer.h
- RAPIDJSON_DELETE(writer);
-
- // prettywriter.h
- RAPIDJSON_DELETE(prettywriter);
-
- // document.h
- RAPIDJSON_DELETE(value);
- RAPIDJSON_DELETE(document);
-
- // pointer.h
- RAPIDJSON_DELETE(pointer);
-
- // schema.h
- RAPIDJSON_DELETE(schemadocument);
- RAPIDJSON_DELETE(schemavalidator);
-}
-
-TEST(Fwd, Fwd) {
- Foo f;
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/istreamwrappertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/istreamwrappertest.cpp
deleted file mode 100644
index 57634caf4d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/istreamwrappertest.cpp
+++ /dev/null
@@ -1,181 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/istreamwrapper.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/document.h"
-#include <sstream>
-#include <fstream>
-
-#if defined(_MSC_VER) && !defined(__clang__)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4702) // unreachable code
-#endif
-
-using namespace rapidjson;
-using namespace std;
-
-template <typename StringStreamType>
-static void TestStringStream() {
- typedef typename StringStreamType::char_type Ch;
-
- {
- StringStreamType iss;
- BasicIStreamWrapper<StringStreamType> is(iss);
- EXPECT_EQ(0u, is.Tell());
- if (sizeof(Ch) == 1) {
- EXPECT_EQ(0, is.Peek4());
- EXPECT_EQ(0u, is.Tell());
- }
- EXPECT_EQ(0, is.Peek());
- EXPECT_EQ(0, is.Take());
- EXPECT_EQ(0u, is.Tell());
- }
-
- {
- Ch s[] = { 'A', 'B', 'C', '\0' };
- StringStreamType iss(s);
- BasicIStreamWrapper<StringStreamType> is(iss);
- EXPECT_EQ(0u, is.Tell());
- if (sizeof(Ch) == 1) {
- EXPECT_EQ(0, is.Peek4()); // less than 4 bytes
- }
- for (int i = 0; i < 3; i++) {
- EXPECT_EQ(static_cast<size_t>(i), is.Tell());
- EXPECT_EQ('A' + i, is.Peek());
- EXPECT_EQ('A' + i, is.Peek());
- EXPECT_EQ('A' + i, is.Take());
- }
- EXPECT_EQ(3u, is.Tell());
- EXPECT_EQ(0, is.Peek());
- EXPECT_EQ(0, is.Take());
- }
-
- {
- Ch s[] = { 'A', 'B', 'C', 'D', 'E', '\0' };
- StringStreamType iss(s);
- BasicIStreamWrapper<StringStreamType> is(iss);
- if (sizeof(Ch) == 1) {
- const Ch* c = is.Peek4();
- for (int i = 0; i < 4; i++)
- EXPECT_EQ('A' + i, c[i]);
- EXPECT_EQ(0u, is.Tell());
- }
- for (int i = 0; i < 5; i++) {
- EXPECT_EQ(static_cast<size_t>(i), is.Tell());
- EXPECT_EQ('A' + i, is.Peek());
- EXPECT_EQ('A' + i, is.Peek());
- EXPECT_EQ('A' + i, is.Take());
- }
- EXPECT_EQ(5u, is.Tell());
- EXPECT_EQ(0, is.Peek());
- EXPECT_EQ(0, is.Take());
- }
-}
-
-TEST(IStreamWrapper, istringstream) {
- TestStringStream<istringstream>();
-}
-
-TEST(IStreamWrapper, stringstream) {
- TestStringStream<stringstream>();
-}
-
-TEST(IStreamWrapper, wistringstream) {
- TestStringStream<wistringstream>();
-}
-
-TEST(IStreamWrapper, wstringstream) {
- TestStringStream<wstringstream>();
-}
-
-template <typename FileStreamType>
-static bool Open(FileStreamType& fs, const char* filename) {
- const char *paths[] = {
- "encodings",
- "bin/encodings",
- "../bin/encodings",
- "../../bin/encodings",
- "../../../bin/encodings"
- };
- char buffer[1024];
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s/%s", paths[i], filename);
- fs.open(buffer, ios_base::in | ios_base::binary);
- if (fs.is_open())
- return true;
- }
- return false;
-}
-
-TEST(IStreamWrapper, ifstream) {
- ifstream ifs;
- ASSERT_TRUE(Open(ifs, "utf8bom.json"));
- IStreamWrapper isw(ifs);
- EncodedInputStream<UTF8<>, IStreamWrapper> eis(isw);
- Document d;
- EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
- EXPECT_TRUE(d.IsObject());
- EXPECT_EQ(5u, d.MemberCount());
-}
-
-TEST(IStreamWrapper, fstream) {
- fstream fs;
- ASSERT_TRUE(Open(fs, "utf8bom.json"));
- IStreamWrapper isw(fs);
- EncodedInputStream<UTF8<>, IStreamWrapper> eis(isw);
- Document d;
- EXPECT_TRUE(!d.ParseStream(eis).HasParseError());
- EXPECT_TRUE(d.IsObject());
- EXPECT_EQ(5u, d.MemberCount());
-}
-
-// wifstream/wfstream only works on C++11 with codecvt_utf16
-// But many C++11 library still not have it.
-#if 0
-#include <codecvt>
-
-TEST(IStreamWrapper, wifstream) {
- wifstream ifs;
- ASSERT_TRUE(Open(ifs, "utf16bebom.json"));
- ifs.imbue(std::locale(ifs.getloc(),
- new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
- WIStreamWrapper isw(ifs);
- GenericDocument<UTF16<> > d;
- d.ParseStream<kParseDefaultFlags, UTF16<>, WIStreamWrapper>(isw);
- EXPECT_TRUE(!d.HasParseError());
- EXPECT_TRUE(d.IsObject());
- EXPECT_EQ(5, d.MemberCount());
-}
-
-TEST(IStreamWrapper, wfstream) {
- wfstream fs;
- ASSERT_TRUE(Open(fs, "utf16bebom.json"));
- fs.imbue(std::locale(fs.getloc(),
- new std::codecvt_utf16<wchar_t, 0x10ffff, std::consume_header>));
- WIStreamWrapper isw(fs);
- GenericDocument<UTF16<> > d;
- d.ParseStream<kParseDefaultFlags, UTF16<>, WIStreamWrapper>(isw);
- EXPECT_TRUE(!d.HasParseError());
- EXPECT_TRUE(d.IsObject());
- EXPECT_EQ(5, d.MemberCount());
-}
-
-#endif
-
-#if defined(_MSC_VER) && !defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/itoatest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/itoatest.cpp
deleted file mode 100644
index 4c834de373..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/itoatest.cpp
+++ /dev/null
@@ -1,160 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/internal/itoa.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(type-limits)
-#endif
-
-using namespace rapidjson::internal;
-
-template <typename T>
-struct Traits {
-};
-
-template <>
-struct Traits<uint32_t> {
- enum { kBufferSize = 11 };
- enum { kMaxDigit = 10 };
- static uint32_t Negate(uint32_t x) { return x; }
-};
-
-template <>
-struct Traits<int32_t> {
- enum { kBufferSize = 12 };
- enum { kMaxDigit = 10 };
- static int32_t Negate(int32_t x) { return -x; }
-};
-
-template <>
-struct Traits<uint64_t> {
- enum { kBufferSize = 21 };
- enum { kMaxDigit = 20 };
- static uint64_t Negate(uint64_t x) { return x; }
-};
-
-template <>
-struct Traits<int64_t> {
- enum { kBufferSize = 22 };
- enum { kMaxDigit = 20 };
- static int64_t Negate(int64_t x) { return -x; }
-};
-
-template <typename T>
-static void VerifyValue(T value, void(*f)(T, char*), char* (*g)(T, char*)) {
- char buffer1[Traits<T>::kBufferSize];
- char buffer2[Traits<T>::kBufferSize];
-
- f(value, buffer1);
- *g(value, buffer2) = '\0';
-
-
- EXPECT_STREQ(buffer1, buffer2);
-}
-
-template <typename T>
-static void Verify(void(*f)(T, char*), char* (*g)(T, char*)) {
- // Boundary cases
- VerifyValue<T>(0, f, g);
- VerifyValue<T>((std::numeric_limits<T>::min)(), f, g);
- VerifyValue<T>((std::numeric_limits<T>::max)(), f, g);
-
- // 2^n - 1, 2^n, 10^n - 1, 10^n until overflow
- for (int power = 2; power <= 10; power += 8) {
- T i = 1, last;
- do {
- VerifyValue<T>(i - 1, f, g);
- VerifyValue<T>(i, f, g);
- if ((std::numeric_limits<T>::min)() < 0) {
- VerifyValue<T>(Traits<T>::Negate(i), f, g);
- VerifyValue<T>(Traits<T>::Negate(i + 1), f, g);
- }
- last = i;
- if (i > static_cast<T>((std::numeric_limits<T>::max)() / static_cast<T>(power)))
- break;
- i *= static_cast<T>(power);
- } while (last < i);
- }
-}
-
-static void u32toa_naive(uint32_t value, char* buffer) {
- char temp[10];
- char *p = temp;
- do {
- *p++ = static_cast<char>(char(value % 10) + '0');
- value /= 10;
- } while (value > 0);
-
- do {
- *buffer++ = *--p;
- } while (p != temp);
-
- *buffer = '\0';
-}
-
-static void i32toa_naive(int32_t value, char* buffer) {
- uint32_t u = static_cast<uint32_t>(value);
- if (value < 0) {
- *buffer++ = '-';
- u = ~u + 1;
- }
- u32toa_naive(u, buffer);
-}
-
-static void u64toa_naive(uint64_t value, char* buffer) {
- char temp[20];
- char *p = temp;
- do {
- *p++ = static_cast<char>(char(value % 10) + '0');
- value /= 10;
- } while (value > 0);
-
- do {
- *buffer++ = *--p;
- } while (p != temp);
-
- *buffer = '\0';
-}
-
-static void i64toa_naive(int64_t value, char* buffer) {
- uint64_t u = static_cast<uint64_t>(value);
- if (value < 0) {
- *buffer++ = '-';
- u = ~u + 1;
- }
- u64toa_naive(u, buffer);
-}
-
-TEST(itoa, u32toa) {
- Verify(u32toa_naive, u32toa);
-}
-
-TEST(itoa, i32toa) {
- Verify(i32toa_naive, i32toa);
-}
-
-TEST(itoa, u64toa) {
- Verify(u64toa_naive, u64toa);
-}
-
-TEST(itoa, i64toa) {
- Verify(i64toa_naive, i64toa);
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/jsoncheckertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/jsoncheckertest.cpp
deleted file mode 100644
index aadce0a060..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/jsoncheckertest.cpp
+++ /dev/null
@@ -1,143 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/document.h"
-
-using namespace rapidjson;
-
-static char* ReadFile(const char* filename, size_t& length) {
- const char *paths[] = {
- "jsonchecker",
- "bin/jsonchecker",
- "../bin/jsonchecker",
- "../../bin/jsonchecker",
- "../../../bin/jsonchecker"
- };
- char buffer[1024];
- FILE *fp = 0;
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s/%s", paths[i], filename);
- fp = fopen(buffer, "rb");
- if (fp)
- break;
- }
-
- if (!fp)
- return 0;
-
- fseek(fp, 0, SEEK_END);
- length = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- char* json = static_cast<char*>(malloc(length + 1));
- size_t readLength = fread(json, 1, length, fp);
- json[readLength] = '\0';
- fclose(fp);
- return json;
-}
-
-struct NoOpHandler {
- bool Null() { return true; }
- bool Bool(bool) { return true; }
- bool Int(int) { return true; }
- bool Uint(unsigned) { return true; }
- bool Int64(int64_t) { return true; }
- bool Uint64(uint64_t) { return true; }
- bool Double(double) { return true; }
- bool RawNumber(const char*, SizeType, bool) { return true; }
- bool String(const char*, SizeType, bool) { return true; }
- bool StartObject() { return true; }
- bool Key(const char*, SizeType, bool) { return true; }
- bool EndObject(SizeType) { return true; }
- bool StartArray() { return true; }
- bool EndArray(SizeType) { return true; }
-};
-
-
-TEST(JsonChecker, Reader) {
- char filename[256];
-
- // jsonchecker/failXX.json
- for (int i = 1; i <= 33; i++) {
- if (i == 1) // fail1.json is valid in rapidjson, which has no limitation on type of root element (RFC 7159).
- continue;
- if (i == 18) // fail18.json is valid in rapidjson, which has no limitation on depth of nesting.
- continue;
-
- sprintf(filename, "fail%d.json", i);
- size_t length;
- char* json = ReadFile(filename, length);
- if (!json) {
- printf("jsonchecker file %s not found", filename);
- ADD_FAILURE();
- continue;
- }
-
- // Test stack-based parsing.
- GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
- document.Parse(json);
- EXPECT_TRUE(document.HasParseError()) << filename;
-
- // Test iterative parsing.
- document.Parse<kParseIterativeFlag>(json);
- EXPECT_TRUE(document.HasParseError()) << filename;
-
- // Test iterative pull-parsing.
- Reader reader;
- StringStream ss(json);
- NoOpHandler h;
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- if (!reader.IterativeParseNext<kParseDefaultFlags>(ss, h))
- break;
- }
- EXPECT_TRUE(reader.HasParseError()) << filename;
-
- free(json);
- }
-
- // passX.json
- for (int i = 1; i <= 3; i++) {
- sprintf(filename, "pass%d.json", i);
- size_t length;
- char* json = ReadFile(filename, length);
- if (!json) {
- printf("jsonchecker file %s not found", filename);
- continue;
- }
-
- // Test stack-based parsing.
- GenericDocument<UTF8<>, CrtAllocator> document; // Use Crt allocator to check exception-safety (no memory leak)
- document.Parse(json);
- EXPECT_FALSE(document.HasParseError()) << filename;
-
- // Test iterative parsing.
- document.Parse<kParseIterativeFlag>(json);
- EXPECT_FALSE(document.HasParseError()) << filename;
-
- // Test iterative pull-parsing.
- Reader reader;
- StringStream ss(json);
- NoOpHandler h;
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- if (!reader.IterativeParseNext<kParseDefaultFlags>(ss, h))
- break;
- }
- EXPECT_FALSE(reader.HasParseError()) << filename;
-
- free(json);
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/namespacetest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/namespacetest.cpp
deleted file mode 100644
index 2755d6f16f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/namespacetest.cpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-// test another instantiation of RapidJSON in a different namespace
-
-#define RAPIDJSON_NAMESPACE my::rapid::json
-#define RAPIDJSON_NAMESPACE_BEGIN namespace my { namespace rapid { namespace json {
-#define RAPIDJSON_NAMESPACE_END } } }
-
-// include lots of RapidJSON files
-
-#include "rapidjson/document.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/filereadstream.h"
-#include "rapidjson/filewritestream.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/stringbuffer.h"
-
-static const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,4]}";
-
-TEST(NamespaceTest,Using) {
- using namespace RAPIDJSON_NAMESPACE;
- typedef GenericDocument<UTF8<>, CrtAllocator> DocumentType;
- DocumentType doc;
-
- doc.Parse(json);
- EXPECT_TRUE(!doc.HasParseError());
-}
-
-TEST(NamespaceTest,Direct) {
- typedef RAPIDJSON_NAMESPACE::Document Document;
- typedef RAPIDJSON_NAMESPACE::Reader Reader;
- typedef RAPIDJSON_NAMESPACE::StringStream StringStream;
- typedef RAPIDJSON_NAMESPACE::StringBuffer StringBuffer;
- typedef RAPIDJSON_NAMESPACE::Writer<StringBuffer> WriterType;
-
- StringStream s(json);
- StringBuffer buffer;
- WriterType writer(buffer);
- buffer.ShrinkToFit();
- Reader reader;
- reader.Parse(s, writer);
-
- EXPECT_STREQ(json, buffer.GetString());
- EXPECT_EQ(sizeof(json)-1, buffer.GetSize());
- EXPECT_TRUE(writer.IsComplete());
-
- Document doc;
- doc.Parse(buffer.GetString());
- EXPECT_TRUE(!doc.HasParseError());
-
- buffer.Clear();
- writer.Reset(buffer);
- doc.Accept(writer);
- EXPECT_STREQ(json, buffer.GetString());
- EXPECT_TRUE(writer.IsComplete());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/ostreamwrappertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/ostreamwrappertest.cpp
deleted file mode 100644
index 707d3647d0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/ostreamwrappertest.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/ostreamwrapper.h"
-#include "rapidjson/encodedstream.h"
-#include "rapidjson/document.h"
-#include <sstream>
-#include <fstream>
-
-using namespace rapidjson;
-using namespace std;
-
-template <typename StringStreamType>
-static void TestStringStream() {
- typedef typename StringStreamType::char_type Ch;
-
- Ch s[] = { 'A', 'B', 'C', '\0' };
- StringStreamType oss(s);
- BasicOStreamWrapper<StringStreamType> os(oss);
- for (size_t i = 0; i < 3; i++)
- os.Put(s[i]);
- os.Flush();
- for (size_t i = 0; i < 3; i++)
- EXPECT_EQ(s[i], oss.str()[i]);
-}
-
-TEST(OStreamWrapper, ostringstream) {
- TestStringStream<ostringstream>();
-}
-
-TEST(OStreamWrapper, stringstream) {
- TestStringStream<stringstream>();
-}
-
-TEST(OStreamWrapper, wostringstream) {
- TestStringStream<wostringstream>();
-}
-
-TEST(OStreamWrapper, wstringstream) {
- TestStringStream<wstringstream>();
-}
-
-TEST(OStreamWrapper, cout) {
- OStreamWrapper os(cout);
- const char* s = "Hello World!\n";
- while (*s)
- os.Put(*s++);
- os.Flush();
-}
-
-template <typename FileStreamType>
-static void TestFileStream() {
- char filename[L_tmpnam];
- FILE* fp = TempFile(filename);
- fclose(fp);
-
- const char* s = "Hello World!\n";
- {
- FileStreamType ofs(filename, ios::out | ios::binary);
- BasicOStreamWrapper<FileStreamType> osw(ofs);
- for (const char* p = s; *p; p++)
- osw.Put(*p);
- osw.Flush();
- }
-
- fp = fopen(filename, "r");
- ASSERT_TRUE( fp != NULL );
- for (const char* p = s; *p; p++)
- EXPECT_EQ(*p, static_cast<char>(fgetc(fp)));
- fclose(fp);
-}
-
-TEST(OStreamWrapper, ofstream) {
- TestFileStream<ofstream>();
-}
-
-TEST(OStreamWrapper, fstream) {
- TestFileStream<fstream>();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/platformtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/platformtest.cpp
deleted file mode 100644
index e03fe8f099..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/platformtest.cpp
+++ /dev/null
@@ -1,40 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2021 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-// see https://github.com/Tencent/rapidjson/issues/1448
-// including windows.h on purpose to provoke a compile time problem as GetObject is a
-// macro that gets defined when windows.h is included
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#include "rapidjson/document.h"
-#undef GetObject
-
-using namespace rapidjson;
-
-TEST(Platform, GetObject) {
- Document doc;
- doc.Parse(" { \"object\" : { \"pi\": 3.1416} } ");
- EXPECT_TRUE(doc.IsObject());
- EXPECT_TRUE(doc.HasMember("object"));
- const Document::ValueType& o = doc["object"];
- EXPECT_TRUE(o.IsObject());
- Value::ConstObject sub = o.GetObject();
- EXPECT_TRUE(sub.HasMember("pi"));
- Value::ConstObject sub2 = o.GetObj();
- EXPECT_TRUE(sub2.HasMember("pi"));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/pointertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/pointertest.cpp
deleted file mode 100644
index 471ed7effc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/pointertest.cpp
+++ /dev/null
@@ -1,1730 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/pointer.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/ostreamwrapper.h"
-#include <sstream>
-#include <map>
-#include <algorithm>
-
-using namespace rapidjson;
-
-static const char kJson[] = "{\n"
-" \"foo\":[\"bar\", \"baz\"],\n"
-" \"\" : 0,\n"
-" \"a/b\" : 1,\n"
-" \"c%d\" : 2,\n"
-" \"e^f\" : 3,\n"
-" \"g|h\" : 4,\n"
-" \"i\\\\j\" : 5,\n"
-" \"k\\\"l\" : 6,\n"
-" \" \" : 7,\n"
-" \"m~n\" : 8\n"
-"}";
-
-TEST(Pointer, DefaultConstructor) {
- Pointer p;
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(0u, p.GetTokenCount());
-}
-
-TEST(Pointer, Parse) {
- {
- Pointer p("");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(0u, p.GetTokenCount());
- }
-
- {
- Pointer p("/");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(0u, p.GetTokens()[0].length);
- EXPECT_STREQ("", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- {
- Pointer p("/foo");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- #if RAPIDJSON_HAS_STDSTRING
- {
- Pointer p(std::string("/foo"));
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
- #endif
-
- {
- Pointer p("/foo/0");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("0", p.GetTokens()[1].name);
- EXPECT_EQ(0u, p.GetTokens()[1].index);
- }
-
- {
- // Unescape ~1
- Pointer p("/a~1b");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("a/b", p.GetTokens()[0].name);
- }
-
- {
- // Unescape ~0
- Pointer p("/m~0n");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("m~n", p.GetTokens()[0].name);
- }
-
- {
- // empty name
- Pointer p("/");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(0u, p.GetTokens()[0].length);
- EXPECT_STREQ("", p.GetTokens()[0].name);
- }
-
- {
- // empty and non-empty name
- Pointer p("//a");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(0u, p.GetTokens()[0].length);
- EXPECT_STREQ("", p.GetTokens()[0].name);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("a", p.GetTokens()[1].name);
- }
-
- {
- // Null characters
- Pointer p("/\0\0", 3);
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(2u, p.GetTokens()[0].length);
- EXPECT_EQ('\0', p.GetTokens()[0].name[0]);
- EXPECT_EQ('\0', p.GetTokens()[0].name[1]);
- EXPECT_EQ('\0', p.GetTokens()[0].name[2]);
- }
-
- {
- // Valid index
- Pointer p("/123");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("123", p.GetTokens()[0].name);
- EXPECT_EQ(123u, p.GetTokens()[0].index);
- }
-
- {
- // Invalid index (with leading zero)
- Pointer p("/01");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("01", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- if (sizeof(SizeType) == 4) {
- // Invalid index (overflow)
- Pointer p("/4294967296");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("4294967296", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- {
- // kPointerParseErrorTokenMustBeginWithSolidus
- Pointer p(" ");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorTokenMustBeginWithSolidus, p.GetParseErrorCode());
- EXPECT_EQ(0u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidEscape
- Pointer p("/~");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidEscape
- Pointer p("/~2");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-}
-
-TEST(Pointer, Parse_URIFragment) {
- {
- Pointer p("#");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(0u, p.GetTokenCount());
- }
-
- {
- Pointer p("#/foo");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- }
-
- {
- Pointer p("#/foo/0");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("0", p.GetTokens()[1].name);
- EXPECT_EQ(0u, p.GetTokens()[1].index);
- }
-
- {
- // Unescape ~1
- Pointer p("#/a~1b");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("a/b", p.GetTokens()[0].name);
- }
-
- {
- // Unescape ~0
- Pointer p("#/m~0n");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("m~n", p.GetTokens()[0].name);
- }
-
- {
- // empty name
- Pointer p("#/");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(0u, p.GetTokens()[0].length);
- EXPECT_STREQ("", p.GetTokens()[0].name);
- }
-
- {
- // empty and non-empty name
- Pointer p("#//a");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(0u, p.GetTokens()[0].length);
- EXPECT_STREQ("", p.GetTokens()[0].name);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("a", p.GetTokens()[1].name);
- }
-
- {
- // Null characters
- Pointer p("#/%00%00");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(2u, p.GetTokens()[0].length);
- EXPECT_EQ('\0', p.GetTokens()[0].name[0]);
- EXPECT_EQ('\0', p.GetTokens()[0].name[1]);
- EXPECT_EQ('\0', p.GetTokens()[0].name[2]);
- }
-
- {
- // Percentage Escapes
- EXPECT_STREQ("c%d", Pointer("#/c%25d").GetTokens()[0].name);
- EXPECT_STREQ("e^f", Pointer("#/e%5Ef").GetTokens()[0].name);
- EXPECT_STREQ("g|h", Pointer("#/g%7Ch").GetTokens()[0].name);
- EXPECT_STREQ("i\\j", Pointer("#/i%5Cj").GetTokens()[0].name);
- EXPECT_STREQ("k\"l", Pointer("#/k%22l").GetTokens()[0].name);
- EXPECT_STREQ(" ", Pointer("#/%20").GetTokens()[0].name);
- }
-
- {
- // Valid index
- Pointer p("#/123");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("123", p.GetTokens()[0].name);
- EXPECT_EQ(123u, p.GetTokens()[0].index);
- }
-
- {
- // Invalid index (with leading zero)
- Pointer p("#/01");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("01", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- if (sizeof(SizeType) == 4) {
- // Invalid index (overflow)
- Pointer p("#/4294967296");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("4294967296", p.GetTokens()[0].name);
- EXPECT_EQ(kPointerInvalidIndex, p.GetTokens()[0].index);
- }
-
- {
- // Decode UTF-8 percent encoding to UTF-8
- Pointer p("#/%C2%A2");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_STREQ("\xC2\xA2", p.GetTokens()[0].name);
- }
-
- {
- // Decode UTF-8 percent encoding to UTF-16
- GenericPointer<GenericValue<UTF16<> > > p(L"#/%C2%A2");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(static_cast<UTF16<>::Ch>(0x00A2), p.GetTokens()[0].name[0]);
- EXPECT_EQ(1u, p.GetTokens()[0].length);
- }
-
- {
- // Decode UTF-8 percent encoding to UTF-16
- GenericPointer<GenericValue<UTF16<> > > p(L"#/%E2%82%AC");
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(1u, p.GetTokenCount());
- EXPECT_EQ(static_cast<UTF16<>::Ch>(0x20AC), p.GetTokens()[0].name[0]);
- EXPECT_EQ(1u, p.GetTokens()[0].length);
- }
-
- {
- // kPointerParseErrorTokenMustBeginWithSolidus
- Pointer p("# ");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorTokenMustBeginWithSolidus, p.GetParseErrorCode());
- EXPECT_EQ(1u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidEscape
- Pointer p("#/~");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
- EXPECT_EQ(3u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidEscape
- Pointer p("#/~2");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidEscape, p.GetParseErrorCode());
- EXPECT_EQ(3u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidPercentEncoding
- Pointer p("#/%");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidPercentEncoding (invalid hex)
- Pointer p("#/%g0");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidPercentEncoding (invalid hex)
- Pointer p("#/%0g");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorInvalidPercentEncoding (incomplete UTF-8 sequence)
- Pointer p("#/%C2");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorInvalidPercentEncoding, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorCharacterMustPercentEncode
- Pointer p("#/ ");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorCharacterMustPercentEncode, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-
- {
- // kPointerParseErrorCharacterMustPercentEncode
- Pointer p("#/\n");
- EXPECT_FALSE(p.IsValid());
- EXPECT_EQ(kPointerParseErrorCharacterMustPercentEncode, p.GetParseErrorCode());
- EXPECT_EQ(2u, p.GetParseErrorOffset());
- }
-}
-
-TEST(Pointer, Stringify) {
- // Test by roundtrip
- const char* sources[] = {
- "",
- "/foo",
- "/foo/0",
- "/",
- "/a~1b",
- "/c%d",
- "/e^f",
- "/g|h",
- "/i\\j",
- "/k\"l",
- "/ ",
- "/m~0n",
- "/\xC2\xA2",
- "/\xE2\x82\xAC",
- "/\xF0\x9D\x84\x9E"
- };
-
- for (size_t i = 0; i < sizeof(sources) / sizeof(sources[0]); i++) {
- Pointer p(sources[i]);
- StringBuffer s;
- EXPECT_TRUE(p.Stringify(s));
- EXPECT_STREQ(sources[i], s.GetString());
-
- // Stringify to URI fragment
- StringBuffer s2;
- EXPECT_TRUE(p.StringifyUriFragment(s2));
- Pointer p2(s2.GetString(), s2.GetSize());
- EXPECT_TRUE(p2.IsValid());
- EXPECT_TRUE(p == p2);
- }
-
- {
- // Strigify to URI fragment with an invalid UTF-8 sequence
- Pointer p("/\xC2");
- StringBuffer s;
- EXPECT_FALSE(p.StringifyUriFragment(s));
- }
-}
-
-// Construct a Pointer with static tokens, no dynamic allocation involved.
-#define NAME(s) { s, static_cast<SizeType>(sizeof(s) / sizeof(s[0]) - 1), kPointerInvalidIndex }
-#define INDEX(i) { #i, static_cast<SizeType>(sizeof(#i) - 1), i }
-
-static const Pointer::Token kTokens[] = { NAME("foo"), INDEX(0) }; // equivalent to "/foo/0"
-
-#undef NAME
-#undef INDEX
-
-TEST(Pointer, ConstructorWithToken) {
- Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("0", p.GetTokens()[1].name);
- EXPECT_EQ(0u, p.GetTokens()[1].index);
-}
-
-TEST(Pointer, CopyConstructor) {
- {
- CrtAllocator allocator;
- Pointer p("/foo/0", &allocator);
- Pointer q(p);
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
-
- // Copied pointer needs to have its own allocator
- EXPECT_NE(&p.GetAllocator(), &q.GetAllocator());
- }
-
- // Static tokens
- {
- Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
- Pointer q(p);
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
- }
-}
-
-TEST(Pointer, Assignment) {
- {
- CrtAllocator allocator;
- Pointer p("/foo/0", &allocator);
- Pointer q;
- q = p;
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
- EXPECT_NE(&p.GetAllocator(), &q.GetAllocator());
- q = static_cast<const Pointer &>(q);
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
- EXPECT_NE(&p.GetAllocator(), &q.GetAllocator());
- }
-
- // Static tokens
- {
- Pointer p(kTokens, sizeof(kTokens) / sizeof(kTokens[0]));
- Pointer q;
- q = p;
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
- }
-}
-
-TEST(Pointer, Swap) {
- Pointer p("/foo/0");
- Pointer q(&p.GetAllocator());
-
- q.Swap(p);
- EXPECT_EQ(&q.GetAllocator(), &p.GetAllocator());
- EXPECT_TRUE(p.IsValid());
- EXPECT_TRUE(q.IsValid());
- EXPECT_EQ(0u, p.GetTokenCount());
- EXPECT_EQ(2u, q.GetTokenCount());
- EXPECT_EQ(3u, q.GetTokens()[0].length);
- EXPECT_STREQ("foo", q.GetTokens()[0].name);
- EXPECT_EQ(1u, q.GetTokens()[1].length);
- EXPECT_STREQ("0", q.GetTokens()[1].name);
- EXPECT_EQ(0u, q.GetTokens()[1].index);
-
- // std::swap compatibility
- std::swap(p, q);
- EXPECT_EQ(&p.GetAllocator(), &q.GetAllocator());
- EXPECT_TRUE(q.IsValid());
- EXPECT_TRUE(p.IsValid());
- EXPECT_EQ(0u, q.GetTokenCount());
- EXPECT_EQ(2u, p.GetTokenCount());
- EXPECT_EQ(3u, p.GetTokens()[0].length);
- EXPECT_STREQ("foo", p.GetTokens()[0].name);
- EXPECT_EQ(1u, p.GetTokens()[1].length);
- EXPECT_STREQ("0", p.GetTokens()[1].name);
- EXPECT_EQ(0u, p.GetTokens()[1].index);
-}
-
-TEST(Pointer, Append) {
- {
- Pointer p;
- Pointer q = p.Append("foo");
- EXPECT_TRUE(Pointer("/foo") == q);
- q = q.Append(1234);
- EXPECT_TRUE(Pointer("/foo/1234") == q);
- q = q.Append("");
- EXPECT_TRUE(Pointer("/foo/1234/") == q);
- }
-
- {
- Pointer p;
- Pointer q = p.Append(Value("foo").Move());
- EXPECT_TRUE(Pointer("/foo") == q);
- q = q.Append(Value(1234).Move());
- EXPECT_TRUE(Pointer("/foo/1234") == q);
- q = q.Append(Value(kStringType).Move());
- EXPECT_TRUE(Pointer("/foo/1234/") == q);
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- {
- Pointer p;
- Pointer q = p.Append(std::string("foo"));
- EXPECT_TRUE(Pointer("/foo") == q);
- }
-#endif
-}
-
-TEST(Pointer, Equality) {
- EXPECT_TRUE(Pointer("/foo/0") == Pointer("/foo/0"));
- EXPECT_FALSE(Pointer("/foo/0") == Pointer("/foo/1"));
- EXPECT_FALSE(Pointer("/foo/0") == Pointer("/foo/0/1"));
- EXPECT_FALSE(Pointer("/foo/0") == Pointer("a"));
- EXPECT_FALSE(Pointer("a") == Pointer("a")); // Invalid always not equal
-}
-
-TEST(Pointer, Inequality) {
- EXPECT_FALSE(Pointer("/foo/0") != Pointer("/foo/0"));
- EXPECT_TRUE(Pointer("/foo/0") != Pointer("/foo/1"));
- EXPECT_TRUE(Pointer("/foo/0") != Pointer("/foo/0/1"));
- EXPECT_TRUE(Pointer("/foo/0") != Pointer("a"));
- EXPECT_TRUE(Pointer("a") != Pointer("a")); // Invalid always not equal
-}
-
-TEST(Pointer, Create) {
- Document d;
- {
- Value* v = &Pointer("").Create(d, d.GetAllocator());
- EXPECT_EQ(&d, v);
- }
- {
- Value* v = &Pointer("/foo").Create(d, d.GetAllocator());
- EXPECT_EQ(&d["foo"], v);
- }
- {
- Value* v = &Pointer("/foo/0").Create(d, d.GetAllocator());
- EXPECT_EQ(&d["foo"][0], v);
- }
- {
- Value* v = &Pointer("/foo/-").Create(d, d.GetAllocator());
- EXPECT_EQ(&d["foo"][1], v);
- }
-
- {
- Value* v = &Pointer("/foo/-/-").Create(d, d.GetAllocator());
- // "foo/-" is a newly created null value x.
- // "foo/-/-" finds that x is not an array, it converts x to empty object
- // and treats - as "-" member name
- EXPECT_EQ(&d["foo"][2]["-"], v);
- }
-
- {
- // Document with no allocator
- Value* v = &Pointer("/foo/-").Create(d);
- EXPECT_EQ(&d["foo"][3], v);
- }
-
- {
- // Value (not document) must give allocator
- Value* v = &Pointer("/-").Create(d["foo"], d.GetAllocator());
- EXPECT_EQ(&d["foo"][4], v);
- }
-}
-
-static const char kJsonIds[] = "{\n"
- " \"id\": \"/root/\","
- " \"foo\":[\"bar\", \"baz\", {\"id\": \"inarray\", \"child\": 1}],\n"
- " \"int\" : 2,\n"
- " \"str\" : \"val\",\n"
- " \"obj\": {\"id\": \"inobj\", \"child\": 3},\n"
- " \"jbo\": {\"id\": true, \"child\": 4}\n"
- "}";
-
-
-TEST(Pointer, GetUri) {
- CrtAllocator allocator;
- Document d;
- d.Parse(kJsonIds);
- Pointer::UriType doc("http://doc");
- Pointer::UriType root("http://doc/root/");
- Pointer::UriType empty = Pointer::UriType();
-
- EXPECT_TRUE(Pointer("").GetUri(d, doc) == doc);
- EXPECT_TRUE(Pointer("/foo").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/foo/0").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/foo/2").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/foo/2/child").GetUri(d, doc) == Pointer::UriType("http://doc/root/inarray"));
- EXPECT_TRUE(Pointer("/int").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/str").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/obj").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/obj/child").GetUri(d, doc) == Pointer::UriType("http://doc/root/inobj"));
- EXPECT_TRUE(Pointer("/jbo").GetUri(d, doc) == root);
- EXPECT_TRUE(Pointer("/jbo/child").GetUri(d, doc) == root); // id not string
-
- size_t unresolvedTokenIndex;
- EXPECT_TRUE(Pointer("/abc").GetUri(d, doc, &unresolvedTokenIndex, &allocator) == empty); // Out of boundary
- EXPECT_EQ(0u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/3").GetUri(d, doc, &unresolvedTokenIndex, &allocator) == empty); // Out of boundary
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/a").GetUri(d, doc, &unresolvedTokenIndex, &allocator) == empty); // "/foo" is an array, cannot query by "a"
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/0/0").GetUri(d, doc, &unresolvedTokenIndex, &allocator) == empty); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/0/a").GetUri(d, doc, &unresolvedTokenIndex, &allocator) == empty); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
-
- Pointer::Token tokens[] = { { "foo ...", 3, kPointerInvalidIndex } };
- EXPECT_TRUE(Pointer(tokens, 1).GetUri(d, doc) == root);
-}
-
-TEST(Pointer, Get) {
- Document d;
- d.Parse(kJson);
-
- EXPECT_EQ(&d, Pointer("").Get(d));
- EXPECT_EQ(&d["foo"], Pointer("/foo").Get(d));
- EXPECT_EQ(&d["foo"][0], Pointer("/foo/0").Get(d));
- EXPECT_EQ(&d[""], Pointer("/").Get(d));
- EXPECT_EQ(&d["a/b"], Pointer("/a~1b").Get(d));
- EXPECT_EQ(&d["c%d"], Pointer("/c%d").Get(d));
- EXPECT_EQ(&d["e^f"], Pointer("/e^f").Get(d));
- EXPECT_EQ(&d["g|h"], Pointer("/g|h").Get(d));
- EXPECT_EQ(&d["i\\j"], Pointer("/i\\j").Get(d));
- EXPECT_EQ(&d["k\"l"], Pointer("/k\"l").Get(d));
- EXPECT_EQ(&d[" "], Pointer("/ ").Get(d));
- EXPECT_EQ(&d["m~n"], Pointer("/m~0n").Get(d));
-
- EXPECT_TRUE(Pointer("/abc").Get(d) == 0); // Out of boundary
- size_t unresolvedTokenIndex;
- EXPECT_TRUE(Pointer("/foo/2").Get(d, &unresolvedTokenIndex) == 0); // Out of boundary
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/a").Get(d, &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/0/0").Get(d, &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
- EXPECT_TRUE(Pointer("/foo/0/a").Get(d, &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
-
- Pointer::Token tokens[] = { { "foo ...", 3, kPointerInvalidIndex } };
- EXPECT_EQ(&d["foo"], Pointer(tokens, 1).Get(d));
-}
-
-TEST(Pointer, GetWithDefault) {
- Document d;
- d.Parse(kJson);
-
- // Value version
- Document::AllocatorType& a = d.GetAllocator();
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == Pointer("/foo/0").GetWithDefault(d, v, a));
- EXPECT_TRUE(Value("baz") == Pointer("/foo/1").GetWithDefault(d, v, a));
- EXPECT_TRUE(Value("qux") == Pointer("/foo/2").GetWithDefault(d, v, a));
- EXPECT_TRUE(Value("last") == Pointer("/foo/-").GetWithDefault(d, Value("last").Move(), a));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, Value().Move(), a).IsNull());
- EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, "x", a).IsNull());
-
- // Generic version
- EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -1, a).GetInt());
- EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -2, a).GetInt());
- EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x87654321, a).GetUint());
- EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x12345678, a).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64, a).GetInt64());
- EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64 + 1, a).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64, a).GetUint64());
- EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64 - 1, a).GetUint64());
-
- EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, true, a).IsTrue());
- EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, false, a).IsTrue());
-
- EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, false, a).IsFalse());
- EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, true, a).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", Pointer("/foo/hello").GetWithDefault(d, "Hello", a).GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", Pointer("/foo/world").GetWithDefault(d, buffer, a).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", Pointer("/foo/C++").GetWithDefault(d, std::string("C++"), a).GetString());
-#endif
-}
-
-TEST(Pointer, GetWithDefault_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- // Value version
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == Pointer("/foo/0").GetWithDefault(d, v));
- EXPECT_TRUE(Value("baz") == Pointer("/foo/1").GetWithDefault(d, v));
- EXPECT_TRUE(Value("qux") == Pointer("/foo/2").GetWithDefault(d, v));
- EXPECT_TRUE(Value("last") == Pointer("/foo/-").GetWithDefault(d, Value("last").Move()));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, Value().Move()).IsNull());
- EXPECT_TRUE(Pointer("/foo/null").GetWithDefault(d, "x").IsNull());
-
- // Generic version
- EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -1).GetInt());
- EXPECT_EQ(-1, Pointer("/foo/int").GetWithDefault(d, -2).GetInt());
- EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x87654321).GetUint());
- EXPECT_EQ(0x87654321, Pointer("/foo/uint").GetWithDefault(d, 0x12345678).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64).GetInt64());
- EXPECT_EQ(i64, Pointer("/foo/int64").GetWithDefault(d, i64 + 1).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64).GetUint64());
- EXPECT_EQ(u64, Pointer("/foo/uint64").GetWithDefault(d, u64 - 1).GetUint64());
-
- EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, true).IsTrue());
- EXPECT_TRUE(Pointer("/foo/true").GetWithDefault(d, false).IsTrue());
-
- EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, false).IsFalse());
- EXPECT_TRUE(Pointer("/foo/false").GetWithDefault(d, true).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", Pointer("/foo/hello").GetWithDefault(d, "Hello").GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", Pointer("/foo/world").GetWithDefault(d, buffer).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", Pointer("/foo/C++").GetWithDefault(d, std::string("C++")).GetString());
-#endif
-}
-
-TEST(Pointer, Set) {
- Document d;
- d.Parse(kJson);
- Document::AllocatorType& a = d.GetAllocator();
-
- // Value version
- Pointer("/foo/0").Set(d, Value(123).Move(), a);
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- Pointer("/foo/-").Set(d, Value(456).Move(), a);
- EXPECT_EQ(456, d["foo"][2].GetInt());
-
- Pointer("/foo/null").Set(d, Value().Move(), a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], a);
- Pointer("/clone").Set(d, foo, a);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- Pointer("/foo/int").Set(d, -1, a);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- Pointer("/foo/uint").Set(d, 0x87654321, a);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- Pointer("/foo/int64").Set(d, i64, a);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- Pointer("/foo/uint64").Set(d, u64, a);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- Pointer("/foo/true").Set(d, true, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- Pointer("/foo/false").Set(d, false, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- Pointer("/foo/hello").Set(d, "Hello", a);
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- Pointer("/foo/world").Set(d, buffer, a);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- Pointer("/foo/c++").Set(d, std::string("C++"), a);
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, Set_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- // Value version
- Pointer("/foo/0").Set(d, Value(123).Move());
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- Pointer("/foo/-").Set(d, Value(456).Move());
- EXPECT_EQ(456, d["foo"][2].GetInt());
-
- Pointer("/foo/null").Set(d, Value().Move());
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], d.GetAllocator());
- Pointer("/clone").Set(d, foo);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- Pointer("/foo/int").Set(d, -1);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- Pointer("/foo/uint").Set(d, 0x87654321);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- Pointer("/foo/int64").Set(d, i64);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- Pointer("/foo/uint64").Set(d, u64);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- Pointer("/foo/true").Set(d, true);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- Pointer("/foo/false").Set(d, false);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- Pointer("/foo/hello").Set(d, "Hello");
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- Pointer("/foo/world").Set(d, buffer);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- Pointer("/foo/c++").Set(d, std::string("C++"));
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, Swap_Value) {
- Document d;
- d.Parse(kJson);
- Document::AllocatorType& a = d.GetAllocator();
- Pointer("/foo/0").Swap(d, *Pointer("/foo/1").Get(d), a);
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_STREQ("bar", d["foo"][1].GetString());
-}
-
-TEST(Pointer, Swap_Value_NoAllocator) {
- Document d;
- d.Parse(kJson);
- Pointer("/foo/0").Swap(d, *Pointer("/foo/1").Get(d));
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_STREQ("bar", d["foo"][1].GetString());
-}
-
-TEST(Pointer, Erase) {
- Document d;
- d.Parse(kJson);
-
- EXPECT_FALSE(Pointer("").Erase(d));
- EXPECT_FALSE(Pointer("/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/nonexist/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/foo/nonexist/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/foo/0/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/foo/0/nonexist/nonexist").Erase(d));
- EXPECT_FALSE(Pointer("/foo/2/nonexist").Erase(d));
- EXPECT_TRUE(Pointer("/foo/0").Erase(d));
- EXPECT_EQ(1u, d["foo"].Size());
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_TRUE(Pointer("/foo/0").Erase(d));
- EXPECT_TRUE(d["foo"].Empty());
- EXPECT_TRUE(Pointer("/foo").Erase(d));
- EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
-
- Pointer("/a/0/b/0").Create(d);
-
- EXPECT_TRUE(Pointer("/a/0/b/0").Get(d) != 0);
- EXPECT_TRUE(Pointer("/a/0/b/0").Erase(d));
- EXPECT_TRUE(Pointer("/a/0/b/0").Get(d) == 0);
-
- EXPECT_TRUE(Pointer("/a/0/b").Get(d) != 0);
- EXPECT_TRUE(Pointer("/a/0/b").Erase(d));
- EXPECT_TRUE(Pointer("/a/0/b").Get(d) == 0);
-
- EXPECT_TRUE(Pointer("/a/0").Get(d) != 0);
- EXPECT_TRUE(Pointer("/a/0").Erase(d));
- EXPECT_TRUE(Pointer("/a/0").Get(d) == 0);
-
- EXPECT_TRUE(Pointer("/a").Get(d) != 0);
- EXPECT_TRUE(Pointer("/a").Erase(d));
- EXPECT_TRUE(Pointer("/a").Get(d) == 0);
-}
-
-TEST(Pointer, CreateValueByPointer) {
- Document d;
- Document::AllocatorType& a = d.GetAllocator();
-
- {
- Value& v = CreateValueByPointer(d, Pointer("/foo/0"), a);
- EXPECT_EQ(&d["foo"][0], &v);
- }
- {
- Value& v = CreateValueByPointer(d, "/foo/1", a);
- EXPECT_EQ(&d["foo"][1], &v);
- }
-}
-
-TEST(Pointer, CreateValueByPointer_NoAllocator) {
- Document d;
-
- {
- Value& v = CreateValueByPointer(d, Pointer("/foo/0"));
- EXPECT_EQ(&d["foo"][0], &v);
- }
- {
- Value& v = CreateValueByPointer(d, "/foo/1");
- EXPECT_EQ(&d["foo"][1], &v);
- }
-}
-
-TEST(Pointer, GetValueByPointer) {
- Document d;
- d.Parse(kJson);
-
- EXPECT_EQ(&d["foo"][0], GetValueByPointer(d, Pointer("/foo/0")));
- EXPECT_EQ(&d["foo"][0], GetValueByPointer(d, "/foo/0"));
-
- size_t unresolvedTokenIndex;
- EXPECT_TRUE(GetValueByPointer(d, "/foo/2", &unresolvedTokenIndex) == 0); // Out of boundary
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/a", &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/0/0", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/0/a", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
-
- // const version
- const Value& v = d;
- EXPECT_EQ(&d["foo"][0], GetValueByPointer(v, Pointer("/foo/0")));
- EXPECT_EQ(&d["foo"][0], GetValueByPointer(v, "/foo/0"));
-
- EXPECT_TRUE(GetValueByPointer(v, "/foo/2", &unresolvedTokenIndex) == 0); // Out of boundary
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(v, "/foo/a", &unresolvedTokenIndex) == 0); // "/foo" is an array, cannot query by "a"
- EXPECT_EQ(1u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(v, "/foo/0/0", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
- EXPECT_TRUE(GetValueByPointer(v, "/foo/0/a", &unresolvedTokenIndex) == 0); // "/foo/0" is an string, cannot further query
- EXPECT_EQ(2u, unresolvedTokenIndex);
-
-}
-
-TEST(Pointer, GetValueByPointerWithDefault_Pointer) {
- Document d;
- d.Parse(kJson);
-
- Document::AllocatorType& a = d.GetAllocator();
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v, a));
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v, a));
- EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, Pointer("/foo/1"), v, a));
- EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, Pointer("/foo/2"), v, a));
- EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, Pointer("/foo/-"), Value("last").Move(), a));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), Value().Move(), a).IsNull());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), "x", a).IsNull());
-
- // Generic version
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -1, a).GetInt());
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -2, a).GetInt());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x87654321, a).GetUint());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x12345678, a).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64, a).GetInt64());
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64 + 1, a).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64, a).GetUint64());
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64 - 1, a).GetUint64());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), true, a).IsTrue());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), false, a).IsTrue());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), false, a).IsFalse());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), true, a).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, Pointer("/foo/hello"), "Hello", a).GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", GetValueByPointerWithDefault(d, Pointer("/foo/world"), buffer, a).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, Pointer("/foo/world"))->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++"), a).GetString());
-#endif
-}
-
-TEST(Pointer, GetValueByPointerWithDefault_String) {
- Document d;
- d.Parse(kJson);
-
- Document::AllocatorType& a = d.GetAllocator();
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v, a));
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v, a));
- EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, "/foo/1", v, a));
- EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, "/foo/2", v, a));
- EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, "/foo/-", Value("last").Move(), a));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", Value().Move(), a).IsNull());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", "x", a).IsNull());
-
- // Generic version
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -1, a).GetInt());
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -2, a).GetInt());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x87654321, a).GetUint());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x12345678, a).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64, a).GetInt64());
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64 + 1, a).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64, a).GetUint64());
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64 - 1, a).GetUint64());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", true, a).IsTrue());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", false, a).IsTrue());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", false, a).IsFalse());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", true, a).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, "/foo/hello", "Hello", a).GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", GetValueByPointerWithDefault(d, "/foo/world", buffer, a).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, "/foo/C++", std::string("C++"), a).GetString());
-#endif
-}
-
-TEST(Pointer, GetValueByPointerWithDefault_Pointer_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v));
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, Pointer("/foo/0"), v));
- EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, Pointer("/foo/1"), v));
- EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, Pointer("/foo/2"), v));
- EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, Pointer("/foo/-"), Value("last").Move()));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), Value().Move()).IsNull());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/null"), "x").IsNull());
-
- // Generic version
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -1).GetInt());
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, Pointer("/foo/int"), -2).GetInt());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x87654321).GetUint());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, Pointer("/foo/uint"), 0x12345678).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64).GetInt64());
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, Pointer("/foo/int64"), i64 + 1).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64).GetUint64());
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, Pointer("/foo/uint64"), u64 - 1).GetUint64());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), true).IsTrue());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/true"), false).IsTrue());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), false).IsFalse());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, Pointer("/foo/false"), true).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, Pointer("/foo/hello"), "Hello").GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", GetValueByPointerWithDefault(d, Pointer("/foo/world"), buffer).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, Pointer("/foo/world"))->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++")).GetString());
-#endif
-}
-
-TEST(Pointer, GetValueByPointerWithDefault_String_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- const Value v("qux");
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v));
- EXPECT_TRUE(Value("bar") == GetValueByPointerWithDefault(d, "/foo/0", v));
- EXPECT_TRUE(Value("baz") == GetValueByPointerWithDefault(d, "/foo/1", v));
- EXPECT_TRUE(Value("qux") == GetValueByPointerWithDefault(d, "/foo/2", v));
- EXPECT_TRUE(Value("last") == GetValueByPointerWithDefault(d, "/foo/-", Value("last").Move()));
- EXPECT_STREQ("last", d["foo"][3].GetString());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", Value().Move()).IsNull());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/null", "x").IsNull());
-
- // Generic version
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -1).GetInt());
- EXPECT_EQ(-1, GetValueByPointerWithDefault(d, "/foo/int", -2).GetInt());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x87654321).GetUint());
- EXPECT_EQ(0x87654321, GetValueByPointerWithDefault(d, "/foo/uint", 0x12345678).GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64).GetInt64());
- EXPECT_EQ(i64, GetValueByPointerWithDefault(d, "/foo/int64", i64 + 1).GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64).GetUint64());
- EXPECT_EQ(u64, GetValueByPointerWithDefault(d, "/foo/uint64", u64 - 1).GetUint64());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", true).IsTrue());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/true", false).IsTrue());
-
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", false).IsFalse());
- EXPECT_TRUE(GetValueByPointerWithDefault(d, "/foo/false", true).IsFalse());
-
- // StringRef version
- EXPECT_STREQ("Hello", GetValueByPointerWithDefault(d, "/foo/hello", "Hello").GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- EXPECT_STREQ("World", GetValueByPointerWithDefault(d, "/foo/world", buffer).GetString());
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("C++", GetValueByPointerWithDefault(d, Pointer("/foo/C++"), std::string("C++")).GetString());
-#endif
-}
-
-TEST(Pointer, SetValueByPointer_Pointer) {
- Document d;
- d.Parse(kJson);
- Document::AllocatorType& a = d.GetAllocator();
-
- // Value version
- SetValueByPointer(d, Pointer("/foo/0"), Value(123).Move(), a);
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- SetValueByPointer(d, Pointer("/foo/null"), Value().Move(), a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], d.GetAllocator());
- SetValueByPointer(d, Pointer("/clone"), foo, a);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- SetValueByPointer(d, Pointer("/foo/int"), -1, a);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- SetValueByPointer(d, Pointer("/foo/uint"), 0x87654321, a);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- SetValueByPointer(d, Pointer("/foo/int64"), i64, a);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- SetValueByPointer(d, Pointer("/foo/uint64"), u64, a);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- SetValueByPointer(d, Pointer("/foo/true"), true, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- SetValueByPointer(d, Pointer("/foo/false"), false, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- SetValueByPointer(d, Pointer("/foo/hello"), "Hello", a);
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- SetValueByPointer(d, Pointer("/foo/world"), buffer, a);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- SetValueByPointer(d, Pointer("/foo/c++"), std::string("C++"), a);
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, SetValueByPointer_String) {
- Document d;
- d.Parse(kJson);
- Document::AllocatorType& a = d.GetAllocator();
-
- // Value version
- SetValueByPointer(d, "/foo/0", Value(123).Move(), a);
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- SetValueByPointer(d, "/foo/null", Value().Move(), a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], d.GetAllocator());
- SetValueByPointer(d, "/clone", foo, a);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- SetValueByPointer(d, "/foo/int", -1, a);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- SetValueByPointer(d, "/foo/uint", 0x87654321, a);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- SetValueByPointer(d, "/foo/int64", i64, a);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- SetValueByPointer(d, "/foo/uint64", u64, a);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- SetValueByPointer(d, "/foo/true", true, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- SetValueByPointer(d, "/foo/false", false, a);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- SetValueByPointer(d, "/foo/hello", "Hello", a);
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- SetValueByPointer(d, "/foo/world", buffer, a);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- SetValueByPointer(d, "/foo/c++", std::string("C++"), a);
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, SetValueByPointer_Pointer_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- // Value version
- SetValueByPointer(d, Pointer("/foo/0"), Value(123).Move());
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- SetValueByPointer(d, Pointer("/foo/null"), Value().Move());
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], d.GetAllocator());
- SetValueByPointer(d, Pointer("/clone"), foo);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- SetValueByPointer(d, Pointer("/foo/int"), -1);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- SetValueByPointer(d, Pointer("/foo/uint"), 0x87654321);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- SetValueByPointer(d, Pointer("/foo/int64"), i64);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- SetValueByPointer(d, Pointer("/foo/uint64"), u64);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- SetValueByPointer(d, Pointer("/foo/true"), true);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- SetValueByPointer(d, Pointer("/foo/false"), false);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- SetValueByPointer(d, Pointer("/foo/hello"), "Hello");
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- SetValueByPointer(d, Pointer("/foo/world"), buffer);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- SetValueByPointer(d, Pointer("/foo/c++"), std::string("C++"));
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, SetValueByPointer_String_NoAllocator) {
- Document d;
- d.Parse(kJson);
-
- // Value version
- SetValueByPointer(d, "/foo/0", Value(123).Move());
- EXPECT_EQ(123, d["foo"][0].GetInt());
-
- SetValueByPointer(d, "/foo/null", Value().Move());
- EXPECT_TRUE(GetValueByPointer(d, "/foo/null")->IsNull());
-
- // Const Value version
- const Value foo(d["foo"], d.GetAllocator());
- SetValueByPointer(d, "/clone", foo);
- EXPECT_EQ(foo, *GetValueByPointer(d, "/clone"));
-
- // Generic version
- SetValueByPointer(d, "/foo/int", -1);
- EXPECT_EQ(-1, GetValueByPointer(d, "/foo/int")->GetInt());
-
- SetValueByPointer(d, "/foo/uint", 0x87654321);
- EXPECT_EQ(0x87654321, GetValueByPointer(d, "/foo/uint")->GetUint());
-
- const int64_t i64 = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0));
- SetValueByPointer(d, "/foo/int64", i64);
- EXPECT_EQ(i64, GetValueByPointer(d, "/foo/int64")->GetInt64());
-
- const uint64_t u64 = RAPIDJSON_UINT64_C2(0xFFFFFFFFF, 0xFFFFFFFFF);
- SetValueByPointer(d, "/foo/uint64", u64);
- EXPECT_EQ(u64, GetValueByPointer(d, "/foo/uint64")->GetUint64());
-
- SetValueByPointer(d, "/foo/true", true);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/true")->IsTrue());
-
- SetValueByPointer(d, "/foo/false", false);
- EXPECT_TRUE(GetValueByPointer(d, "/foo/false")->IsFalse());
-
- // StringRef version
- SetValueByPointer(d, "/foo/hello", "Hello");
- EXPECT_STREQ("Hello", GetValueByPointer(d, "/foo/hello")->GetString());
-
- // Copy string version
- {
- char buffer[256];
- strcpy(buffer, "World");
- SetValueByPointer(d, "/foo/world", buffer);
- memset(buffer, 0, sizeof(buffer));
- }
- EXPECT_STREQ("World", GetValueByPointer(d, "/foo/world")->GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- SetValueByPointer(d, "/foo/c++", std::string("C++"));
- EXPECT_STREQ("C++", GetValueByPointer(d, "/foo/c++")->GetString());
-#endif
-}
-
-TEST(Pointer, SwapValueByPointer) {
- Document d;
- d.Parse(kJson);
- Document::AllocatorType& a = d.GetAllocator();
- SwapValueByPointer(d, Pointer("/foo/0"), *GetValueByPointer(d, "/foo/1"), a);
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_STREQ("bar", d["foo"][1].GetString());
-
- SwapValueByPointer(d, "/foo/0", *GetValueByPointer(d, "/foo/1"), a);
- EXPECT_STREQ("bar", d["foo"][0].GetString());
- EXPECT_STREQ("baz", d["foo"][1].GetString());
-}
-
-TEST(Pointer, SwapValueByPointer_NoAllocator) {
- Document d;
- d.Parse(kJson);
- SwapValueByPointer(d, Pointer("/foo/0"), *GetValueByPointer(d, "/foo/1"));
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_STREQ("bar", d["foo"][1].GetString());
-
- SwapValueByPointer(d, "/foo/0", *GetValueByPointer(d, "/foo/1"));
- EXPECT_STREQ("bar", d["foo"][0].GetString());
- EXPECT_STREQ("baz", d["foo"][1].GetString());
-}
-
-TEST(Pointer, EraseValueByPointer_Pointer) {
- Document d;
- d.Parse(kJson);
-
- EXPECT_FALSE(EraseValueByPointer(d, Pointer("")));
- EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
- EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo/0")));
- EXPECT_EQ(1u, d["foo"].Size());
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo/0")));
- EXPECT_TRUE(d["foo"].Empty());
- EXPECT_TRUE(EraseValueByPointer(d, Pointer("/foo")));
- EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
-}
-
-TEST(Pointer, EraseValueByPointer_String) {
- Document d;
- d.Parse(kJson);
-
- EXPECT_FALSE(EraseValueByPointer(d, ""));
- EXPECT_FALSE(Pointer("/foo/nonexist").Erase(d));
- EXPECT_TRUE(EraseValueByPointer(d, "/foo/0"));
- EXPECT_EQ(1u, d["foo"].Size());
- EXPECT_STREQ("baz", d["foo"][0].GetString());
- EXPECT_TRUE(EraseValueByPointer(d, "/foo/0"));
- EXPECT_TRUE(d["foo"].Empty());
- EXPECT_TRUE(EraseValueByPointer(d, "/foo"));
- EXPECT_TRUE(Pointer("/foo").Get(d) == 0);
-}
-
-TEST(Pointer, Ambiguity) {
- {
- Document d;
- d.Parse("{\"0\" : [123]}");
- EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
- Pointer("/0/a").Set(d, 456); // Change array [123] to object {456}
- EXPECT_EQ(456, Pointer("/0/a").Get(d)->GetInt());
- }
-
- {
- Document d;
- EXPECT_FALSE(d.Parse("[{\"0\": 123}]").HasParseError());
- EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
- Pointer("/0/1").Set(d, 456); // 1 is treated as "1" to index object
- EXPECT_EQ(123, Pointer("/0/0").Get(d)->GetInt());
- EXPECT_EQ(456, Pointer("/0/1").Get(d)->GetInt());
- }
-}
-
-TEST(Pointer, ResolveOnObject) {
- Document d;
- EXPECT_FALSE(d.Parse("{\"a\": 123}").HasParseError());
-
- {
- Value::ConstObject o = static_cast<const Document&>(d).GetObject();
- EXPECT_EQ(123, Pointer("/a").Get(o)->GetInt());
- }
-
- {
- Value::Object o = d.GetObject();
- Pointer("/a").Set(o, 456, d.GetAllocator());
- EXPECT_EQ(456, Pointer("/a").Get(o)->GetInt());
- }
-}
-
-TEST(Pointer, ResolveOnArray) {
- Document d;
- EXPECT_FALSE(d.Parse("[1, 2, 3]").HasParseError());
-
- {
- Value::ConstArray a = static_cast<const Document&>(d).GetArray();
- EXPECT_EQ(2, Pointer("/1").Get(a)->GetInt());
- }
-
- {
- Value::Array a = d.GetArray();
- Pointer("/1").Set(a, 123, d.GetAllocator());
- EXPECT_EQ(123, Pointer("/1").Get(a)->GetInt());
- }
-}
-
-TEST(Pointer, LessThan) {
- static const struct {
- const char *str;
- bool valid;
- } pointers[] = {
- { "/a/b", true },
- { "/a", true },
- { "/d/1", true },
- { "/d/2/z", true },
- { "/d/2/3", true },
- { "/d/2", true },
- { "/a/c", true },
- { "/e/f~g", false },
- { "/d/2/zz", true },
- { "/d/1", true },
- { "/d/2/z", true },
- { "/e/f~~g", false },
- { "/e/f~0g", true },
- { "/e/f~1g", true },
- { "/e/f.g", true },
- { "", true }
- };
- static const char *ordered_pointers[] = {
- "",
- "/a",
- "/a/b",
- "/a/c",
- "/d/1",
- "/d/1",
- "/d/2",
- "/e/f.g",
- "/e/f~1g",
- "/e/f~0g",
- "/d/2/3",
- "/d/2/z",
- "/d/2/z",
- "/d/2/zz",
- NULL, // was invalid "/e/f~g"
- NULL // was invalid "/e/f~~g"
- };
- typedef MemoryPoolAllocator<> AllocatorType;
- typedef GenericPointer<Value, AllocatorType> PointerType;
- typedef std::multimap<PointerType, size_t> PointerMap;
- PointerMap map;
- PointerMap::iterator it;
- AllocatorType allocator;
- size_t i;
-
- EXPECT_EQ(sizeof(pointers) / sizeof(pointers[0]),
- sizeof(ordered_pointers) / sizeof(ordered_pointers[0]));
-
- for (i = 0; i < sizeof(pointers) / sizeof(pointers[0]); ++i) {
- it = map.insert(PointerMap::value_type(PointerType(pointers[i].str, &allocator), i));
- if (!it->first.IsValid()) {
- EXPECT_EQ(++it, map.end());
- }
- }
-
- for (i = 0, it = map.begin(); it != map.end(); ++it, ++i) {
- EXPECT_TRUE(it->second < sizeof(pointers) / sizeof(pointers[0]));
- EXPECT_EQ(it->first.IsValid(), pointers[it->second].valid);
- EXPECT_TRUE(i < sizeof(ordered_pointers) / sizeof(ordered_pointers[0]));
- EXPECT_EQ(it->first.IsValid(), !!ordered_pointers[i]);
- if (it->first.IsValid()) {
- std::stringstream ss;
- OStreamWrapper os(ss);
- EXPECT_TRUE(it->first.Stringify(os));
- EXPECT_EQ(ss.str(), pointers[it->second].str);
- EXPECT_EQ(ss.str(), ordered_pointers[i]);
- }
- }
-}
-
-// https://github.com/Tencent/rapidjson/issues/483
-namespace myjson {
-
-class MyAllocator
-{
-public:
- static const bool kNeedFree = true;
- void * Malloc(size_t _size) { return malloc(_size); }
- void * Realloc(void *_org_p, size_t _org_size, size_t _new_size) { (void)_org_size; return realloc(_org_p, _new_size); }
- static void Free(void *_p) { return free(_p); }
-};
-
-typedef rapidjson::GenericDocument<
- rapidjson::UTF8<>,
- rapidjson::MemoryPoolAllocator< MyAllocator >,
- MyAllocator
- > Document;
-
-typedef rapidjson::GenericPointer<
- ::myjson::Document::ValueType,
- MyAllocator
- > Pointer;
-
-typedef ::myjson::Document::ValueType Value;
-
-}
-
-TEST(Pointer, Issue483) {
- std::string mystr, path;
- myjson::Document document;
- myjson::Value value(rapidjson::kStringType);
- value.SetString(mystr.c_str(), static_cast<SizeType>(mystr.length()), document.GetAllocator());
- myjson::Pointer(path.c_str()).Set(document, value, document.GetAllocator());
-}
-
-TEST(Pointer, Issue1899) {
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- PointerType p;
- PointerType q = p.Append("foo");
- EXPECT_TRUE(PointerType("/foo") == q);
- q = q.Append(1234);
- EXPECT_TRUE(PointerType("/foo/1234") == q);
- q = q.Append("");
- EXPECT_TRUE(PointerType("/foo/1234/") == q);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/prettywritertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/prettywritertest.cpp
deleted file mode 100644
index 3b3608097c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/prettywritertest.cpp
+++ /dev/null
@@ -1,373 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/reader.h"
-#include "rapidjson/prettywriter.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/filewritestream.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-using namespace rapidjson;
-
-static const char kJson[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3,-1],\"u64\":1234567890123456789,\"i64\":-1234567890123456789}";
-static const char kPrettyJson[] =
-"{\n"
-" \"hello\": \"world\",\n"
-" \"t\": true,\n"
-" \"f\": false,\n"
-" \"n\": null,\n"
-" \"i\": 123,\n"
-" \"pi\": 3.1416,\n"
-" \"a\": [\n"
-" 1,\n"
-" 2,\n"
-" 3,\n"
-" -1\n"
-" ],\n"
-" \"u64\": 1234567890123456789,\n"
-" \"i64\": -1234567890123456789\n"
-"}";
-
-static const char kPrettyJson_FormatOptions_SLA[] =
-"{\n"
-" \"hello\": \"world\",\n"
-" \"t\": true,\n"
-" \"f\": false,\n"
-" \"n\": null,\n"
-" \"i\": 123,\n"
-" \"pi\": 3.1416,\n"
-" \"a\": [1, 2, 3, -1],\n"
-" \"u64\": 1234567890123456789,\n"
-" \"i64\": -1234567890123456789\n"
-"}";
-
-TEST(PrettyWriter, Basic) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- Reader reader;
- StringStream s(kJson);
- reader.Parse(s, writer);
- EXPECT_STREQ(kPrettyJson, buffer.GetString());
-}
-
-TEST(PrettyWriter, FormatOptions) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.SetFormatOptions(kFormatSingleLineArray);
- Reader reader;
- StringStream s(kJson);
- reader.Parse(s, writer);
- EXPECT_STREQ(kPrettyJson_FormatOptions_SLA, buffer.GetString());
-}
-
-TEST(PrettyWriter, SetIndent) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.SetIndent('\t', 1);
- Reader reader;
- StringStream s(kJson);
- reader.Parse(s, writer);
- EXPECT_STREQ(
- "{\n"
- "\t\"hello\": \"world\",\n"
- "\t\"t\": true,\n"
- "\t\"f\": false,\n"
- "\t\"n\": null,\n"
- "\t\"i\": 123,\n"
- "\t\"pi\": 3.1416,\n"
- "\t\"a\": [\n"
- "\t\t1,\n"
- "\t\t2,\n"
- "\t\t3,\n"
- "\t\t-1\n"
- "\t],\n"
- "\t\"u64\": 1234567890123456789,\n"
- "\t\"i64\": -1234567890123456789\n"
- "}",
- buffer.GetString());
-}
-
-TEST(PrettyWriter, String) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- EXPECT_TRUE(writer.StartArray());
- EXPECT_TRUE(writer.String("Hello\n"));
- EXPECT_TRUE(writer.EndArray());
- EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-TEST(PrettyWriter, String_STDSTRING) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- EXPECT_TRUE(writer.StartArray());
- EXPECT_TRUE(writer.String(std::string("Hello\n")));
- EXPECT_TRUE(writer.EndArray());
- EXPECT_STREQ("[\n \"Hello\\n\"\n]", buffer.GetString());
-}
-#endif
-
-#include <sstream>
-
-class OStreamWrapper {
-public:
- typedef char Ch;
-
- OStreamWrapper(std::ostream& os) : os_(os) {}
-
- Ch Peek() const { assert(false); return '\0'; }
- Ch Take() { assert(false); return '\0'; }
- size_t Tell() const { return 0; }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch c) { os_.put(c); }
- void Flush() { os_.flush(); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- OStreamWrapper(const OStreamWrapper&);
- OStreamWrapper& operator=(const OStreamWrapper&);
-
- std::ostream& os_;
-};
-
-// For covering PutN() generic version
-TEST(PrettyWriter, OStreamWrapper) {
- StringStream s(kJson);
-
- std::stringstream ss;
- OStreamWrapper os(ss);
-
- PrettyWriter<OStreamWrapper> writer(os);
-
- Reader reader;
- reader.Parse(s, writer);
-
- std::string actual = ss.str();
- EXPECT_STREQ(kPrettyJson, actual.c_str());
-}
-
-// For covering FileWriteStream::PutN()
-TEST(PrettyWriter, FileWriteStream) {
- char filename[L_tmpnam];
- FILE* fp = TempFile(filename);
- ASSERT_TRUE(fp!=NULL);
- char buffer[16];
- FileWriteStream os(fp, buffer, sizeof(buffer));
- PrettyWriter<FileWriteStream> writer(os);
- Reader reader;
- StringStream s(kJson);
- reader.Parse(s, writer);
- fclose(fp);
-
- fp = fopen(filename, "rb");
- fseek(fp, 0, SEEK_END);
- size_t size = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- char* json = static_cast<char*>(malloc(size + 1));
- size_t readLength = fread(json, 1, size, fp);
- json[readLength] = '\0';
- fclose(fp);
- remove(filename);
- EXPECT_STREQ(kPrettyJson, json);
- free(json);
-}
-
-TEST(PrettyWriter, RawValue) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- writer.Int(1);
- writer.Key("raw");
- const char json[] = "[\"Hello\\nWorld\", 123.456]";
- writer.RawValue(json, strlen(json), kArrayType);
- writer.EndObject();
- EXPECT_TRUE(writer.IsComplete());
- EXPECT_STREQ(
- "{\n"
- " \"a\": 1,\n"
- " \"raw\": [\"Hello\\nWorld\", 123.456]\n" // no indentation within raw value
- "}",
- buffer.GetString());
-}
-
-TEST(PrettyWriter, InvalidEventSequence) {
- // {]
- {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartObject();
- EXPECT_THROW(writer.EndArray(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // [}
- {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartArray();
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 1:
- {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartObject();
- EXPECT_THROW(writer.Int(1), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 'a' }
- {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 'a':'b','c' }
- {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- writer.String("b");
- writer.Key("c");
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-}
-
-TEST(PrettyWriter, NaN) {
- double nan = std::numeric_limits<double>::quiet_NaN();
-
- EXPECT_TRUE(internal::Double(nan).IsNan());
- StringBuffer buffer;
- {
- PrettyWriter<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(nan));
- }
- {
- PrettyWriter<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(nan));
- EXPECT_STREQ("NaN", buffer.GetString());
- }
- GenericStringBuffer<UTF16<> > buffer2;
- PrettyWriter<GenericStringBuffer<UTF16<> > > writer2(buffer2);
- EXPECT_FALSE(writer2.Double(nan));
-}
-
-TEST(PrettyWriter, Inf) {
- double inf = std::numeric_limits<double>::infinity();
-
- EXPECT_TRUE(internal::Double(inf).IsInf());
- StringBuffer buffer;
- {
- PrettyWriter<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(inf));
- }
- {
- PrettyWriter<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(-inf));
- }
- {
- PrettyWriter<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(inf));
- }
- {
- PrettyWriter<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(-inf));
- }
- EXPECT_STREQ("Infinity-Infinity", buffer.GetString());
-}
-
-TEST(PrettyWriter, Issue_889) {
- char buf[100] = "Hello";
-
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.StartArray();
- writer.String(buf);
- writer.EndArray();
-
- EXPECT_STREQ("[\n \"Hello\"\n]", buffer.GetString());
- EXPECT_TRUE(writer.IsComplete()); \
-}
-
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-static PrettyWriter<StringBuffer> WriterGen(StringBuffer &target) {
- PrettyWriter<StringBuffer> writer(target);
- writer.StartObject();
- writer.Key("a");
- writer.Int(1);
- return writer;
-}
-
-TEST(PrettyWriter, MoveCtor) {
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(WriterGen(buffer));
- writer.EndObject();
- EXPECT_TRUE(writer.IsComplete());
- EXPECT_STREQ(
- "{\n"
- " \"a\": 1\n"
- "}",
- buffer.GetString());
-}
-#endif
-
-TEST(PrettyWriter, Issue_1336) {
-#define T(meth, val, expected) \
- { \
- StringBuffer buffer; \
- PrettyWriter<StringBuffer> writer(buffer); \
- writer.meth(val); \
- \
- EXPECT_STREQ(expected, buffer.GetString()); \
- EXPECT_TRUE(writer.IsComplete()); \
- }
-
- T(Bool, false, "false");
- T(Bool, true, "true");
- T(Int, 0, "0");
- T(Uint, 0, "0");
- T(Int64, 0, "0");
- T(Uint64, 0, "0");
- T(Double, 0, "0.0");
- T(String, "Hello", "\"Hello\"");
-#undef T
-
- StringBuffer buffer;
- PrettyWriter<StringBuffer> writer(buffer);
- writer.Null();
-
- EXPECT_STREQ("null", buffer.GetString());
- EXPECT_TRUE(writer.IsComplete());
-}
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/readertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/readertest.cpp
deleted file mode 100644
index f828dbbe25..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/readertest.cpp
+++ /dev/null
@@ -1,2370 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/reader.h"
-#include "rapidjson/internal/dtoa.h"
-#include "rapidjson/internal/itoa.h"
-#include "rapidjson/memorystream.h"
-
-#include <limits>
-
-using namespace rapidjson;
-
-RAPIDJSON_DIAG_PUSH
-#ifdef __GNUC__
-RAPIDJSON_DIAG_OFF(effc++)
-RAPIDJSON_DIAG_OFF(float-equal)
-RAPIDJSON_DIAG_OFF(missing-noreturn)
-#if __GNUC__ >= 7
-RAPIDJSON_DIAG_OFF(dangling-else)
-#endif
-#endif // __GNUC__
-
-#ifdef __clang__
-RAPIDJSON_DIAG_OFF(variadic-macros)
-RAPIDJSON_DIAG_OFF(c++98-compat-pedantic)
-#endif
-
-template<bool expect>
-struct ParseBoolHandler : BaseReaderHandler<UTF8<>, ParseBoolHandler<expect> > {
- ParseBoolHandler() : step_(0) {}
- bool Default() { ADD_FAILURE(); return false; }
- // gcc 4.8.x generates warning in EXPECT_EQ(bool, bool) on this gtest version.
- // Workaround with EXPECT_TRUE().
- bool Bool(bool b) { /*EXPECT_EQ(expect, b); */EXPECT_TRUE(expect == b); ++step_; return true; }
-
- unsigned step_;
-};
-
-TEST(Reader, ParseTrue) {
- StringStream s("true");
- ParseBoolHandler<true> h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(1u, h.step_);
-}
-
-TEST(Reader, ParseFalse) {
- StringStream s("false");
- ParseBoolHandler<false> h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(1u, h.step_);
-}
-
-struct ParseIntHandler : BaseReaderHandler<UTF8<>, ParseIntHandler> {
- ParseIntHandler() : step_(0), actual_() {}
- bool Default() { ADD_FAILURE(); return false; }
- bool Int(int i) { actual_ = i; step_++; return true; }
-
- unsigned step_;
- int actual_;
-};
-
-struct ParseUintHandler : BaseReaderHandler<UTF8<>, ParseUintHandler> {
- ParseUintHandler() : step_(0), actual_() {}
- bool Default() { ADD_FAILURE(); return false; }
- bool Uint(unsigned i) { actual_ = i; step_++; return true; }
-
- unsigned step_;
- unsigned actual_;
-};
-
-struct ParseInt64Handler : BaseReaderHandler<UTF8<>, ParseInt64Handler> {
- ParseInt64Handler() : step_(0), actual_() {}
- bool Default() { ADD_FAILURE(); return false; }
- bool Int64(int64_t i) { actual_ = i; step_++; return true; }
-
- unsigned step_;
- int64_t actual_;
-};
-
-struct ParseUint64Handler : BaseReaderHandler<UTF8<>, ParseUint64Handler> {
- ParseUint64Handler() : step_(0), actual_() {}
- bool Default() { ADD_FAILURE(); return false; }
- bool Uint64(uint64_t i) { actual_ = i; step_++; return true; }
-
- unsigned step_;
- uint64_t actual_;
-};
-
-struct ParseDoubleHandler : BaseReaderHandler<UTF8<>, ParseDoubleHandler> {
- ParseDoubleHandler() : step_(0), actual_() {}
- bool Default() { ADD_FAILURE(); return false; }
- bool Double(double d) { actual_ = d; step_++; return true; }
-
- unsigned step_;
- double actual_;
-};
-
-TEST(Reader, ParseNumber_Integer) {
-#define TEST_INTEGER(Handler, str, x) \
- { \
- StringStream s(str); \
- Handler h; \
- Reader reader; \
- reader.Parse(s, h); \
- EXPECT_EQ(1u, h.step_); \
- EXPECT_EQ(x, h.actual_); \
- }
-
- TEST_INTEGER(ParseUintHandler, "0", 0u);
- TEST_INTEGER(ParseUintHandler, "123", 123u);
- TEST_INTEGER(ParseUintHandler, "2147483648", 2147483648u); // 2^31 - 1 (cannot be stored in int)
- TEST_INTEGER(ParseUintHandler, "4294967295", 4294967295u);
-
- TEST_INTEGER(ParseIntHandler, "-123", -123);
- TEST_INTEGER(ParseIntHandler, "-2147483648", static_cast<int32_t>(0x80000000)); // -2^31 (min of int)
-
- TEST_INTEGER(ParseUint64Handler, "4294967296", RAPIDJSON_UINT64_C2(1, 0)); // 2^32 (max of unsigned + 1, force to use uint64_t)
- TEST_INTEGER(ParseUint64Handler, "18446744073709551615", RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)); // 2^64 - 1 (max of uint64_t)
-
- TEST_INTEGER(ParseInt64Handler, "-2147483649", static_cast<int64_t>(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0x7FFFFFFF))); // -2^31 -1 (min of int - 1, force to use int64_t)
- TEST_INTEGER(ParseInt64Handler, "-9223372036854775808", static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 0x00000000))); // -2^63 (min of int64_t)
-
- // Random test for uint32_t/int32_t
- {
- union {
- uint32_t u;
- int32_t i;
- }u;
- Random r;
-
- for (unsigned i = 0; i < 100000; i++) {
- u.u = r();
-
- char buffer[32];
- *internal::u32toa(u.u, buffer) = '\0';
- TEST_INTEGER(ParseUintHandler, buffer, u.u);
-
- if (u.i < 0) {
- *internal::i32toa(u.i, buffer) = '\0';
- TEST_INTEGER(ParseIntHandler, buffer, u.i);
- }
- }
- }
-
- // Random test for uint64_t/int64_t
- {
- union {
- uint64_t u;
- int64_t i;
- }u;
- Random r;
-
- for (unsigned i = 0; i < 100000; i++) {
- u.u = uint64_t(r()) << 32;
- u.u |= r();
-
- char buffer[32];
- if (u.u > uint64_t(4294967295u)) {
- *internal::u64toa(u.u, buffer) = '\0';
- TEST_INTEGER(ParseUint64Handler, buffer, u.u);
- }
-
- if (u.i < -int64_t(2147483648u)) {
- *internal::i64toa(u.i, buffer) = '\0';
- TEST_INTEGER(ParseInt64Handler, buffer, u.i);
- }
- }
- }
-#undef TEST_INTEGER
-}
-
-template<bool fullPrecision>
-static void TestParseDouble() {
-#define TEST_DOUBLE(fullPrecision, str, x) \
- { \
- StringStream s(str); \
- ParseDoubleHandler h; \
- Reader reader; \
- ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code()); \
- EXPECT_EQ(1u, h.step_); \
- internal::Double e(x), a(h.actual_); \
- if (fullPrecision) { \
- EXPECT_EQ(e.Uint64Value(), a.Uint64Value()); \
- if (e.Uint64Value() != a.Uint64Value()) \
- printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", str, h.actual_, x); \
- } \
- else { \
- EXPECT_EQ(e.Sign(), a.Sign()); /* for 0.0 != -0.0 */ \
- EXPECT_DOUBLE_EQ(x, h.actual_); \
- } \
- }
-
- TEST_DOUBLE(fullPrecision, "0.0", 0.0);
- TEST_DOUBLE(fullPrecision, "-0.0", -0.0); // For checking issue #289
- TEST_DOUBLE(fullPrecision, "0e100", 0.0); // For checking issue #1249
- TEST_DOUBLE(fullPrecision, "1.0", 1.0);
- TEST_DOUBLE(fullPrecision, "-1.0", -1.0);
- TEST_DOUBLE(fullPrecision, "1.5", 1.5);
- TEST_DOUBLE(fullPrecision, "-1.5", -1.5);
- TEST_DOUBLE(fullPrecision, "3.1416", 3.1416);
- TEST_DOUBLE(fullPrecision, "1E10", 1E10);
- TEST_DOUBLE(fullPrecision, "1e10", 1e10);
- TEST_DOUBLE(fullPrecision, "1E+10", 1E+10);
- TEST_DOUBLE(fullPrecision, "1E-10", 1E-10);
- TEST_DOUBLE(fullPrecision, "-1E10", -1E10);
- TEST_DOUBLE(fullPrecision, "-1e10", -1e10);
- TEST_DOUBLE(fullPrecision, "-1E+10", -1E+10);
- TEST_DOUBLE(fullPrecision, "-1E-10", -1E-10);
- TEST_DOUBLE(fullPrecision, "1.234E+10", 1.234E+10);
- TEST_DOUBLE(fullPrecision, "1.234E-10", 1.234E-10);
- TEST_DOUBLE(fullPrecision, "1.79769e+308", 1.79769e+308);
- TEST_DOUBLE(fullPrecision, "2.22507e-308", 2.22507e-308);
- TEST_DOUBLE(fullPrecision, "-1.79769e+308", -1.79769e+308);
- TEST_DOUBLE(fullPrecision, "-2.22507e-308", -2.22507e-308);
- TEST_DOUBLE(fullPrecision, "4.9406564584124654e-324", 4.9406564584124654e-324); // minimum denormal
- TEST_DOUBLE(fullPrecision, "2.2250738585072009e-308", 2.2250738585072009e-308); // Max subnormal double
- TEST_DOUBLE(fullPrecision, "2.2250738585072014e-308", 2.2250738585072014e-308); // Min normal positive double
- TEST_DOUBLE(fullPrecision, "1.7976931348623157e+308", 1.7976931348623157e+308); // Max double
- TEST_DOUBLE(fullPrecision, "1e-10000", 0.0); // must underflow
- TEST_DOUBLE(fullPrecision, "18446744073709551616", 18446744073709551616.0); // 2^64 (max of uint64_t + 1, force to use double)
- TEST_DOUBLE(fullPrecision, "-9223372036854775809", -9223372036854775809.0); // -2^63 - 1(min of int64_t + 1, force to use double)
- TEST_DOUBLE(fullPrecision, "0.9868011474609375", 0.9868011474609375); // https://github.com/Tencent/rapidjson/issues/120
- TEST_DOUBLE(fullPrecision, "123e34", 123e34); // Fast Path Cases In Disguise
- TEST_DOUBLE(fullPrecision, "45913141877270640000.0", 45913141877270640000.0);
- TEST_DOUBLE(fullPrecision, "2.2250738585072011e-308", 2.2250738585072011e-308); // http://www.exploringbinary.com/php-hangs-on-numeric-value-2-2250738585072011e-308/
- TEST_DOUBLE(fullPrecision, "1e-00011111111111", 0.0); // Issue #313
- TEST_DOUBLE(fullPrecision, "-1e-00011111111111", -0.0);
- TEST_DOUBLE(fullPrecision, "1e-214748363", 0.0); // Maximum supported negative exponent
- TEST_DOUBLE(fullPrecision, "1e-214748364", 0.0);
- TEST_DOUBLE(fullPrecision, "1e-21474836311", 0.0);
- TEST_DOUBLE(fullPrecision, "1.00000000001e-2147483638", 0.0);
- TEST_DOUBLE(fullPrecision, "0.017976931348623157e+310", 1.7976931348623157e+308); // Max double in another form
- TEST_DOUBLE(fullPrecision, "128.74836467836484838364836483643636483648e-336", 0.0); // Issue #1251
-
- // Since
- // abs((2^-1022 - 2^-1074) - 2.2250738585072012e-308) = 3.109754131239141401123495768877590405345064751974375599... x 10^-324
- // abs((2^-1022) - 2.2250738585072012e-308) = 1.830902327173324040642192159804623318305533274168872044... x 10 ^ -324
- // So 2.2250738585072012e-308 should round to 2^-1022 = 2.2250738585072014e-308
- TEST_DOUBLE(fullPrecision, "2.2250738585072012e-308", 2.2250738585072014e-308); // http://www.exploringbinary.com/java-hangs-when-converting-2-2250738585072012e-308/
-
- // More closer to normal/subnormal boundary
- // boundary = 2^-1022 - 2^-1075 = 2.225073858507201136057409796709131975934819546351645648... x 10^-308
- TEST_DOUBLE(fullPrecision, "2.22507385850720113605740979670913197593481954635164564e-308", 2.2250738585072009e-308);
- TEST_DOUBLE(fullPrecision, "2.22507385850720113605740979670913197593481954635164565e-308", 2.2250738585072014e-308);
-
- // 1.0 is in (1.0 - 2^-54, 1.0 + 2^-53)
- // 1.0 - 2^-54 = 0.999999999999999944488848768742172978818416595458984375
- TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984375", 1.0); // round to even
- TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984374", 0.99999999999999989); // previous double
- TEST_DOUBLE(fullPrecision, "0.999999999999999944488848768742172978818416595458984376", 1.0); // next double
- // 1.0 + 2^-53 = 1.00000000000000011102230246251565404236316680908203125
- TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203125", 1.0); // round to even
- TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203124", 1.0); // previous double
- TEST_DOUBLE(fullPrecision, "1.00000000000000011102230246251565404236316680908203126", 1.00000000000000022); // next double
-
- // Numbers from https://github.com/floitsch/double-conversion/blob/master/test/cctest/test-strtod.cc
-
- TEST_DOUBLE(fullPrecision, "72057594037927928.0", 72057594037927928.0);
- TEST_DOUBLE(fullPrecision, "72057594037927936.0", 72057594037927936.0);
- TEST_DOUBLE(fullPrecision, "72057594037927932.0", 72057594037927936.0);
- TEST_DOUBLE(fullPrecision, "7205759403792793199999e-5", 72057594037927928.0);
- TEST_DOUBLE(fullPrecision, "7205759403792793200001e-5", 72057594037927936.0);
-
- TEST_DOUBLE(fullPrecision, "9223372036854774784.0", 9223372036854774784.0);
- TEST_DOUBLE(fullPrecision, "9223372036854775808.0", 9223372036854775808.0);
- TEST_DOUBLE(fullPrecision, "9223372036854775296.0", 9223372036854775808.0);
- TEST_DOUBLE(fullPrecision, "922337203685477529599999e-5", 9223372036854774784.0);
- TEST_DOUBLE(fullPrecision, "922337203685477529600001e-5", 9223372036854775808.0);
-
- TEST_DOUBLE(fullPrecision, "10141204801825834086073718800384", 10141204801825834086073718800384.0);
- TEST_DOUBLE(fullPrecision, "10141204801825835211973625643008", 10141204801825835211973625643008.0);
- TEST_DOUBLE(fullPrecision, "10141204801825834649023672221696", 10141204801825835211973625643008.0);
- TEST_DOUBLE(fullPrecision, "1014120480182583464902367222169599999e-5", 10141204801825834086073718800384.0);
- TEST_DOUBLE(fullPrecision, "1014120480182583464902367222169600001e-5", 10141204801825835211973625643008.0);
-
- TEST_DOUBLE(fullPrecision, "5708990770823838890407843763683279797179383808", 5708990770823838890407843763683279797179383808.0);
- TEST_DOUBLE(fullPrecision, "5708990770823839524233143877797980545530986496", 5708990770823839524233143877797980545530986496.0);
- TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185152", 5708990770823839524233143877797980545530986496.0);
- TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185151999e-3", 5708990770823838890407843763683279797179383808.0);
- TEST_DOUBLE(fullPrecision, "5708990770823839207320493820740630171355185152001e-3", 5708990770823839524233143877797980545530986496.0);
-
- {
- char n1e308[310]; // '1' followed by 308 '0'
- n1e308[0] = '1';
- for (int i = 1; i < 309; i++)
- n1e308[i] = '0';
- n1e308[309] = '\0';
- TEST_DOUBLE(fullPrecision, n1e308, 1E308);
- }
-
- // Cover trimming
- TEST_DOUBLE(fullPrecision,
-"2.22507385850720113605740979670913197593481954635164564802342610972482222202107694551652952390813508"
-"7914149158913039621106870086438694594645527657207407820621743379988141063267329253552286881372149012"
-"9811224514518898490572223072852551331557550159143974763979834118019993239625482890171070818506906306"
-"6665599493827577257201576306269066333264756530000924588831643303777979186961204949739037782970490505"
-"1080609940730262937128958950003583799967207254304360284078895771796150945516748243471030702609144621"
-"5722898802581825451803257070188608721131280795122334262883686223215037756666225039825343359745688844"
-"2390026549819838548794829220689472168983109969836584681402285424333066033985088644580400103493397042"
-"7567186443383770486037861622771738545623065874679014086723327636718751234567890123456789012345678901"
-"e-308",
- 2.2250738585072014e-308);
-
- {
- static const unsigned count = 100; // Tested with 1000000 locally
- Random r;
- Reader reader; // Reusing reader to prevent heap allocation
-
- // Exhaustively test different exponents with random significant
- for (uint64_t exp = 0; exp < 2047; exp++) {
- ;
- for (unsigned i = 0; i < count; i++) {
- // Need to call r() in two statements for cross-platform coherent sequence.
- uint64_t u = (exp << 52) | uint64_t(r() & 0x000FFFFF) << 32;
- u |= uint64_t(r());
- internal::Double d = internal::Double(u);
-
- char buffer[32];
- *internal::dtoa(d.Value(), buffer) = '\0';
-
- StringStream s(buffer);
- ParseDoubleHandler h;
- ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code());
- EXPECT_EQ(1u, h.step_);
- internal::Double a(h.actual_);
- if (fullPrecision) {
- EXPECT_EQ(d.Uint64Value(), a.Uint64Value());
- if (d.Uint64Value() != a.Uint64Value())
- printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", buffer, h.actual_, d.Value());
- }
- else {
- EXPECT_EQ(d.Sign(), a.Sign()); // for 0.0 != -0.0
- EXPECT_DOUBLE_EQ(d.Value(), h.actual_);
- }
- }
- }
- }
-
- // Issue #340
- TEST_DOUBLE(fullPrecision, "7.450580596923828e-9", 7.450580596923828e-9);
- {
- internal::Double d(1.0);
- for (int i = 0; i < 324; i++) {
- char buffer[32];
- *internal::dtoa(d.Value(), buffer) = '\0';
-
- StringStream s(buffer);
- ParseDoubleHandler h;
- Reader reader;
- ASSERT_EQ(kParseErrorNone, reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h).Code());
- EXPECT_EQ(1u, h.step_);
- internal::Double a(h.actual_);
- if (fullPrecision) {
- EXPECT_EQ(d.Uint64Value(), a.Uint64Value());
- if (d.Uint64Value() != a.Uint64Value())
- printf(" String: %s\n Actual: %.17g\nExpected: %.17g\n", buffer, h.actual_, d.Value());
- }
- else {
- EXPECT_EQ(d.Sign(), a.Sign()); // for 0.0 != -0.0
- EXPECT_DOUBLE_EQ(d.Value(), h.actual_);
- }
-
-
- d = d.Value() * 0.5;
- }
- }
-
- // Issue 1249
- TEST_DOUBLE(fullPrecision, "0e100", 0.0);
-
- // Issue 1251
- TEST_DOUBLE(fullPrecision, "128.74836467836484838364836483643636483648e-336", 0.0);
-
- // Issue 1256
- TEST_DOUBLE(fullPrecision,
- "6223372036854775296.1701512723685473547372536854755293372036854685477"
- "529752233737201701512337200972013723685473123372036872036854236854737"
- "247372368372367752975258547752975254729752547372368737201701512354737"
- "83723677529752585477247372368372368547354737253685475529752",
- 6223372036854775808.0);
-
-#if 0
- // Test (length + exponent) overflow
- TEST_DOUBLE(fullPrecision, "0e+2147483647", 0.0);
- TEST_DOUBLE(fullPrecision, "0e-2147483648", 0.0);
- TEST_DOUBLE(fullPrecision, "1e-2147483648", 0.0);
- TEST_DOUBLE(fullPrecision, "0e+9223372036854775807", 0.0);
- TEST_DOUBLE(fullPrecision, "0e-9223372036854775808", 0.0);
-#endif
-
- if (fullPrecision)
- {
- TEST_DOUBLE(fullPrecision, "1e-325", 0.0);
- TEST_DOUBLE(fullPrecision, "1e-324", 0.0);
- TEST_DOUBLE(fullPrecision, "2e-324", 0.0);
- TEST_DOUBLE(fullPrecision, "2.4703282292062327e-324", 0.0);
- TEST_DOUBLE(fullPrecision, "2.4703282292062328e-324", 5e-324);
- TEST_DOUBLE(fullPrecision, "2.48e-324",5e-324);
- TEST_DOUBLE(fullPrecision, "2.5e-324", 5e-324);
-
- // Slightly above max-normal
- TEST_DOUBLE(fullPrecision, "1.7976931348623158e+308", 1.7976931348623158e+308);
-
- TEST_DOUBLE(fullPrecision,
- "17976931348623157081452742373170435679807056752584499659891747680315726"
- "07800285387605895586327668781715404589535143824642343213268894641827684"
- "67546703537516986049910576551282076245490090389328944075868508455133942"
- "30458323690322294816580855933212334827479782620414472316873817718091929"
- "9881250404026184124858368",
- (std::numeric_limits<double>::max)());
-
- TEST_DOUBLE(fullPrecision,
- "243546080556034731077856379609316893158278902575447060151047"
- "212703405344938119816206067372775299130836050315842578309818"
- "316450894337978612745889730079163798234256495613858256849283"
- "467066859489192118352020514036083287319232435355752493038825"
- "828481044358810649108367633313557305310641892225870327827273"
- "41408256.000000",
- 2.4354608055603473e+307);
- // 9007199254740991 * 2^971 (max normal)
- TEST_DOUBLE(fullPrecision,
- "1.797693134862315708145274237317043567980705675258449965989174768031572607800285"
- "38760589558632766878171540458953514382464234321326889464182768467546703537516986"
- "04991057655128207624549009038932894407586850845513394230458323690322294816580855"
- "9332123348274797826204144723168738177180919299881250404026184124858368e+308",
- 1.797693134862315708e+308 // 0x1.fffffffffffffp1023
- );
-#if 0
- // TODO:
- // Should work at least in full-precision mode...
- TEST_DOUBLE(fullPrecision,
- "0.00000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000024703282292062327208828439643411068618252"
- "9901307162382212792841250337753635104375932649918180817996189"
- "8982823477228588654633283551779698981993873980053909390631503"
- "5659515570226392290858392449105184435931802849936536152500319"
- "3704576782492193656236698636584807570015857692699037063119282"
- "7955855133292783433840935197801553124659726357957462276646527"
- "2827220056374006485499977096599470454020828166226237857393450"
- "7363390079677619305775067401763246736009689513405355374585166"
- "6113422376667860416215968046191446729184030053005753084904876"
- "5391711386591646239524912623653881879636239373280423891018672"
- "3484976682350898633885879256283027559956575244555072551893136"
- "9083625477918694866799496832404970582102851318545139621383772"
- "2826145437693412532098591327667236328125",
- 0.0);
-#endif
- // 9007199254740991 * 2^-1074 = (2^53 - 1) * 2^-1074
- TEST_DOUBLE(fullPrecision,
- "4.450147717014402272114819593418263951869639092703291296046852219449644444042153"
- "89103305904781627017582829831782607924221374017287738918929105531441481564124348"
- "67599762821265346585071045737627442980259622449029037796981144446145705102663115"
- "10031828794952795966823603998647925096578034214163701381261333311989876551545144"
- "03152612538132666529513060001849177663286607555958373922409899478075565940981010"
- "21612198814605258742579179000071675999344145086087205681577915435923018910334964"
- "86942061405218289243144579760516365090360651414037721744226256159024466852576737"
- "24464300755133324500796506867194913776884780053099639677097589658441378944337966"
- "21993967316936280457084866613206797017728916080020698679408551343728867675409720"
- "757232455434770912461317493580281734466552734375e-308",
- 4.450147717014402272e-308 // 0x1.fffffffffffffp-1022
- );
- // 9007199254740990 * 2^-1074
- TEST_DOUBLE(fullPrecision,
- "4.450147717014401778049173752171719775300846224481918930987049605124880018456471"
- "39035755177760751831052846195619008686241717547743167145836439860405887584484471"
- "19639655002484083577939142623582164522087943959208000909794783876158397872163051"
- "22622675229968408654350206725478309956546318828765627255022767720818849892988457"
- "26333908582101604036318532842699932130356061901518261174396928478121372742040102"
- "17446565569357687263889031732270082446958029584739170416643195242132750803227473"
- "16608838720742955671061336566907126801014814608027120593609275183716632624844904"
- "31985250929886016737037234388448352929102742708402644340627409931664203093081360"
- "70794835812045179006047003875039546061891526346421705014598610179523165038319441"
- "51446491086954182492263498716056346893310546875e-308",
- 4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
- );
- // half way between the two numbers above.
- // round to nearest even.
- TEST_DOUBLE(fullPrecision,
- "4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
- "64069530541271189424317838013700808305231545782515453032382772695923684574304409"
- "93619708911874715081505094180604803751173783204118519353387964161152051487413083"
- "16327252012460602310586905362063117526562176521464664318142050516404363222266800"
- "64743260560117135282915796422274554896821334728738317548403413978098469341510556"
- "19529382191981473003234105366170879223151087335413188049110555339027884856781219"
- "01775450062980622457102958163711745945687733011032421168917765671370549738710820"
- "78224775842509670618916870627821633352993761380751142008862499795052791018709663"
- "46394401564490729731565935244123171539810221213221201847003580761626016356864581"
- "1358486831521563686919762403704226016998291015625e-308",
- 4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
- );
- TEST_DOUBLE(fullPrecision,
- "4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
- "64069530541271189424317838013700808305231545782515453032382772695923684574304409"
- "93619708911874715081505094180604803751173783204118519353387964161152051487413083"
- "16327252012460602310586905362063117526562176521464664318142050516404363222266800"
- "64743260560117135282915796422274554896821334728738317548403413978098469341510556"
- "19529382191981473003234105366170879223151087335413188049110555339027884856781219"
- "01775450062980622457102958163711745945687733011032421168917765671370549738710820"
- "78224775842509670618916870627821633352993761380751142008862499795052791018709663"
- "46394401564490729731565935244123171539810221213221201847003580761626016356864581"
- "13584868315215636869197624037042260169982910156250000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000e-308",
- 4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
- );
-#if 0
- // ... round up
- // TODO:
- // Should work at least in full-precision mode...
- TEST_DOUBLE(fullPrecision,
- "4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
- "64069530541271189424317838013700808305231545782515453032382772695923684574304409"
- "93619708911874715081505094180604803751173783204118519353387964161152051487413083"
- "16327252012460602310586905362063117526562176521464664318142050516404363222266800"
- "64743260560117135282915796422274554896821334728738317548403413978098469341510556"
- "19529382191981473003234105366170879223151087335413188049110555339027884856781219"
- "01775450062980622457102958163711745945687733011032421168917765671370549738710820"
- "78224775842509670618916870627821633352993761380751142008862499795052791018709663"
- "46394401564490729731565935244123171539810221213221201847003580761626016356864581"
- "13584868315215636869197624037042260169982910156250000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000001e-308",
- 4.450147717014402272e-308 // 0x1.fffffffffffffp-1022
- );
-#endif
- // ... round down
- TEST_DOUBLE(fullPrecision,
- "4.450147717014402025081996672794991863585242658592605113516950912287262231249312"
- "64069530541271189424317838013700808305231545782515453032382772695923684574304409"
- "93619708911874715081505094180604803751173783204118519353387964161152051487413083"
- "16327252012460602310586905362063117526562176521464664318142050516404363222266800"
- "64743260560117135282915796422274554896821334728738317548403413978098469341510556"
- "19529382191981473003234105366170879223151087335413188049110555339027884856781219"
- "01775450062980622457102958163711745945687733011032421168917765671370549738710820"
- "78224775842509670618916870627821633352993761380751142008862499795052791018709663"
- "46394401564490729731565935244123171539810221213221201847003580761626016356864581"
- "13584868315215636869197624037042260169982910156249999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999e-308",
- 4.450147717014401778e-308 // 0x1.ffffffffffffep-1022
- );
- // Slightly below half way between max-normal and infinity.
- // Should round down.
- TEST_DOUBLE(fullPrecision,
- "1.797693134862315807937289714053034150799341327100378269361737789804449682927647"
- "50946649017977587207096330286416692887910946555547851940402630657488671505820681"
- "90890200070838367627385484581771153176447573027006985557136695962284291481986083"
- "49364752927190741684443655107043427115596995080930428801779041744977919999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999"
- "99999999999999999999999999999999999999999999999999999999999999999999999999999999e+308",
- 1.797693134862315708e+308 // 0x1.fffffffffffffp1023
- );
- }
-
-#undef TEST_DOUBLE
-}
-
-TEST(Reader, ParseNumber_NormalPrecisionDouble) {
- TestParseDouble<false>();
-}
-
-TEST(Reader, ParseNumber_FullPrecisionDouble) {
- TestParseDouble<true>();
-}
-
-TEST(Reader, ParseNumber_NormalPrecisionError) {
- static unsigned count = 1000000;
- Random r;
-
- double ulpSum = 0.0;
- double ulpMax = 0.0;
- for (unsigned i = 0; i < count; i++) {
- internal::Double e, a;
- do {
- // Need to call r() in two statements for cross-platform coherent sequence.
- uint64_t u = uint64_t(r()) << 32;
- u |= uint64_t(r());
- e = u;
- } while (e.IsNan() || e.IsInf() || !e.IsNormal());
-
- char buffer[32];
- *internal::dtoa(e.Value(), buffer) = '\0';
-
- StringStream s(buffer);
- ParseDoubleHandler h;
- Reader reader;
- ASSERT_EQ(kParseErrorNone, reader.Parse(s, h).Code());
- EXPECT_EQ(1u, h.step_);
-
- a = h.actual_;
- uint64_t bias1 = e.ToBias();
- uint64_t bias2 = a.ToBias();
- double ulp = static_cast<double>(bias1 >= bias2 ? bias1 - bias2 : bias2 - bias1);
- ulpMax = (std::max)(ulpMax, ulp);
- ulpSum += ulp;
- }
- printf("ULP Average = %g, Max = %g \n", ulpSum / count, ulpMax);
-}
-
-template<bool fullPrecision>
-static void TestParseNumberError() {
-#define TEST_NUMBER_ERROR(errorCode, str, errorOffset, streamPos) \
- { \
- char buffer[2048]; \
- ASSERT_LT(std::strlen(str), 2048u); \
- sprintf(buffer, "%s", str); \
- InsituStringStream s(buffer); \
- BaseReaderHandler<> h; \
- Reader reader; \
- EXPECT_FALSE(reader.Parse<fullPrecision ? kParseFullPrecisionFlag : 0>(s, h)); \
- EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
- EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
- EXPECT_EQ(streamPos, s.Tell());\
- }
-
- // Number too big to be stored in double.
- {
- char n1e309[311]; // '1' followed by 309 '0'
- n1e309[0] = '1';
- for (int i = 1; i < 310; i++)
- n1e309[i] = '0';
- n1e309[310] = '\0';
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, n1e309, 0u, 310u);
- }
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e309", 0u, 5u);
-
- // Miss fraction part in number.
- TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.", 2u, 2u);
- TEST_NUMBER_ERROR(kParseErrorNumberMissFraction, "1.a", 2u, 2u);
-
- // Miss exponent in number.
- TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, "1e", 2u, 2u);
- TEST_NUMBER_ERROR(kParseErrorNumberMissExponent, "1e_", 2u, 2u);
-
- // Issue 849
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1.8e308", 0u, 7u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "5e308", 0u, 5u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e309", 0u, 5u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1.0e310", 0u, 7u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1.00e310", 0u, 8u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "-1.8e308", 0u, 8u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "-1e309", 0u, 6u);
-
- // Issue 1253
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "2e308", 0u, 5u);
-
- // Issue 1259
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig,
- "88474320368547737236837236775298547354737253685475547552933720368546854775297525"
- "29337203685468547770151233720097201372368547312337203687203685423685123372036872"
- "03685473724737236837236775297525854775297525472975254737236873720170151235473783"
- "7236737247372368772473723683723456789012E66", 0u, 283u);
-
-#if 0
- // Test (length + exponent) overflow
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e+2147483647", 0u, 13u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e+9223372036854775807", 0u, 22u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e+10000", 0u, 8u);
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig, "1e+50000", 0u, 8u);
-#endif
-
- // 9007199254740992 * 2^971 ("infinity")
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig,
- "1.797693134862315907729305190789024733617976978942306572734300811577326758055009"
- "63132708477322407536021120113879871393357658789768814416622492847430639474124377"
- "76789342486548527630221960124609411945308295208500576883815068234246288147391311"
- "0540827237163350510684586298239947245938479716304835356329624224137216e+308", 0u, 315u);
-
- // TODO:
- // These tests (currently) fail in normal-precision mode
- if (fullPrecision)
- {
- // Half way between max-normal and infinity
- // Should round to infinity in nearest-even mode.
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig,
- "1.797693134862315807937289714053034150799341327100378269361737789804449682927647"
- "50946649017977587207096330286416692887910946555547851940402630657488671505820681"
- "90890200070838367627385484581771153176447573027006985557136695962284291481986083"
- "49364752927190741684443655107043427115596995080930428801779041744977920000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000e+308", 0u, 1125u);
- // ...round up
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig,
- "1.797693134862315807937289714053034150799341327100378269361737789804449682927647"
- "50946649017977587207096330286416692887910946555547851940402630657488671505820681"
- "90890200070838367627385484581771153176447573027006985557136695962284291481986083"
- "49364752927190741684443655107043427115596995080930428801779041744977920000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000001e+308", 0u, 1205u);
- }
-
- TEST_NUMBER_ERROR(kParseErrorNumberTooBig,
- "10000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "00000000000000000000000000000000000000000000000000000000000000000000000000000000"
- "0000000000000000000000000000000000000000000000000000000000000000000001", 0u, 310u);
-
-#undef TEST_NUMBER_ERROR
-}
-
-TEST(Reader, ParseNumberError_NormalPrecisionDouble) {
- TestParseNumberError<false>();
-}
-
-TEST(Reader, ParseNumberError_FullPrecisionDouble) {
- TestParseNumberError<true>();
-}
-
-template <typename Encoding>
-struct ParseStringHandler : BaseReaderHandler<Encoding, ParseStringHandler<Encoding> > {
- ParseStringHandler() : str_(0), length_(0), copy_() {}
- ~ParseStringHandler() { EXPECT_TRUE(str_ != 0); if (copy_) free(const_cast<typename Encoding::Ch*>(str_)); }
-
- ParseStringHandler(const ParseStringHandler&);
- ParseStringHandler& operator=(const ParseStringHandler&);
-
- bool Default() { ADD_FAILURE(); return false; }
- bool String(const typename Encoding::Ch* str, size_t length, bool copy) {
- EXPECT_EQ(0, str_);
- if (copy) {
- str_ = static_cast<typename Encoding::Ch*>(malloc((length + 1) * sizeof(typename Encoding::Ch)));
- memcpy(const_cast<typename Encoding::Ch*>(str_), str, (length + 1) * sizeof(typename Encoding::Ch));
- }
- else
- str_ = str;
- length_ = length;
- copy_ = copy;
- return true;
- }
-
- const typename Encoding::Ch* str_;
- size_t length_;
- bool copy_;
-};
-
-TEST(Reader, ParseString) {
-#define TEST_STRING(Encoding, e, x) \
- { \
- Encoding::Ch* buffer = StrDup(x); \
- GenericInsituStringStream<Encoding> is(buffer); \
- ParseStringHandler<Encoding> h; \
- GenericReader<Encoding, Encoding> reader; \
- reader.Parse<kParseInsituFlag | kParseValidateEncodingFlag>(is, h); \
- EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h.str_)); \
- EXPECT_EQ(StrLen(e), h.length_); \
- free(buffer); \
- GenericStringStream<Encoding> s(x); \
- ParseStringHandler<Encoding> h2; \
- GenericReader<Encoding, Encoding> reader2; \
- reader2.Parse(s, h2); \
- EXPECT_EQ(0, StrCmp<Encoding::Ch>(e, h2.str_)); \
- EXPECT_EQ(StrLen(e), h2.length_); \
- }
-
- // String constant L"\xXX" can only specify character code in bytes, which is not endianness-neutral.
- // And old compiler does not support u"" and U"" string literal. So here specify string literal by array of Ch.
- // In addition, GCC 4.8 generates -Wnarrowing warnings when character code >= 128 are assigned to signed integer types.
- // Therefore, utype is added for declaring unsigned array, and then cast it to Encoding::Ch.
-#define ARRAY(...) { __VA_ARGS__ }
-#define TEST_STRINGARRAY(Encoding, utype, array, x) \
- { \
- static const utype ue[] = array; \
- static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
- TEST_STRING(Encoding, e, x); \
- }
-
-#define TEST_STRINGARRAY2(Encoding, utype, earray, xarray) \
- { \
- static const utype ue[] = earray; \
- static const utype xe[] = xarray; \
- static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
- static const Encoding::Ch* x = reinterpret_cast<const Encoding::Ch *>(&xe[0]); \
- TEST_STRING(Encoding, e, x); \
- }
-
- TEST_STRING(UTF8<>, "", "\"\"");
- TEST_STRING(UTF8<>, "Hello", "\"Hello\"");
- TEST_STRING(UTF8<>, "Hello\nWorld", "\"Hello\\nWorld\"");
- TEST_STRING(UTF8<>, "\"\\/\b\f\n\r\t", "\"\\\"\\\\/\\b\\f\\n\\r\\t\"");
- TEST_STRING(UTF8<>, "\x24", "\"\\u0024\""); // Dollar sign U+0024
- TEST_STRING(UTF8<>, "\xC2\xA2", "\"\\u00A2\""); // Cents sign U+00A2
- TEST_STRING(UTF8<>, "\xE2\x82\xAC", "\"\\u20AC\""); // Euro sign U+20AC
- TEST_STRING(UTF8<>, "\xF0\x9D\x84\x9E", "\"\\uD834\\uDD1E\""); // G clef sign U+1D11E
-
- // UTF16
- TEST_STRING(UTF16<>, L"", L"\"\"");
- TEST_STRING(UTF16<>, L"Hello", L"\"Hello\"");
- TEST_STRING(UTF16<>, L"Hello\nWorld", L"\"Hello\\nWorld\"");
- TEST_STRING(UTF16<>, L"\"\\/\b\f\n\r\t", L"\"\\\"\\\\/\\b\\f\\n\\r\\t\"");
- TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x0024, 0x0000), L"\"\\u0024\"");
- TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x00A2, 0x0000), L"\"\\u00A2\""); // Cents sign U+00A2
- TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0x20AC, 0x0000), L"\"\\u20AC\""); // Euro sign U+20AC
- TEST_STRINGARRAY(UTF16<>, wchar_t, ARRAY(0xD834, 0xDD1E, 0x0000), L"\"\\uD834\\uDD1E\""); // G clef sign U+1D11E
-
- // UTF32
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\0'), ARRAY('\"', '\"', '\0'));
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\0'), ARRAY('\"', 'H', 'e', 'l', 'l', 'o', '\"', '\0'));
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('H', 'e', 'l', 'l', 'o', '\n', 'W', 'o', 'r', 'l', 'd', '\0'), ARRAY('\"', 'H', 'e', 'l', 'l', 'o', '\\', 'n', 'W', 'o', 'r', 'l', 'd', '\"', '\0'));
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY('\"', '\\', '/', '\b', '\f', '\n', '\r', '\t', '\0'), ARRAY('\"', '\\', '\"', '\\', '\\', '/', '\\', 'b', '\\', 'f', '\\', 'n', '\\', 'r', '\\', 't', '\"', '\0'));
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x00024, 0x0000), ARRAY('\"', '\\', 'u', '0', '0', '2', '4', '\"', '\0'));
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x000A2, 0x0000), ARRAY('\"', '\\', 'u', '0', '0', 'A', '2', '\"', '\0')); // Cents sign U+00A2
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x020AC, 0x0000), ARRAY('\"', '\\', 'u', '2', '0', 'A', 'C', '\"', '\0')); // Euro sign U+20AC
- TEST_STRINGARRAY2(UTF32<>, unsigned, ARRAY(0x1D11E, 0x0000), ARRAY('\"', '\\', 'u', 'D', '8', '3', '4', '\\', 'u', 'D', 'D', '1', 'E', '\"', '\0')); // G clef sign U+1D11E
-
-#undef TEST_STRINGARRAY
-#undef ARRAY
-#undef TEST_STRING
-
- // Support of null character in string
- {
- StringStream s("\"Hello\\u0000World\"");
- const char e[] = "Hello\0World";
- ParseStringHandler<UTF8<> > h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(0, memcmp(e, h.str_, h.length_ + 1));
- EXPECT_EQ(11u, h.length_);
- }
-}
-
-TEST(Reader, ParseString_Transcoding) {
- const char* x = "\"Hello\"";
- const wchar_t* e = L"Hello";
- GenericStringStream<UTF8<> > is(x);
- GenericReader<UTF8<>, UTF16<> > reader;
- ParseStringHandler<UTF16<> > h;
- reader.Parse(is, h);
- EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));
- EXPECT_EQ(StrLen(e), h.length_);
-}
-
-TEST(Reader, ParseString_TranscodingWithValidation) {
- const char* x = "\"Hello\"";
- const wchar_t* e = L"Hello";
- GenericStringStream<UTF8<> > is(x);
- GenericReader<UTF8<>, UTF16<> > reader;
- ParseStringHandler<UTF16<> > h;
- reader.Parse<kParseValidateEncodingFlag>(is, h);
- EXPECT_EQ(0, StrCmp<UTF16<>::Ch>(e, h.str_));
- EXPECT_EQ(StrLen(e), h.length_);
-}
-
-TEST(Reader, ParseString_NonDestructive) {
- StringStream s("\"Hello\\nWorld\"");
- ParseStringHandler<UTF8<> > h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(0, StrCmp("Hello\nWorld", h.str_));
- EXPECT_EQ(11u, h.length_);
-}
-
-template <typename Encoding>
-ParseErrorCode TestString(const typename Encoding::Ch* str) {
- GenericStringStream<Encoding> s(str);
- BaseReaderHandler<Encoding> h;
- GenericReader<Encoding, Encoding> reader;
- reader.template Parse<kParseValidateEncodingFlag>(s, h);
- return reader.GetParseErrorCode();
-}
-
-TEST(Reader, ParseString_Error) {
-#define TEST_STRING_ERROR(errorCode, str, errorOffset, streamPos)\
-{\
- GenericStringStream<UTF8<> > s(str);\
- BaseReaderHandler<UTF8<> > h;\
- GenericReader<UTF8<> , UTF8<> > reader;\
- reader.Parse<kParseValidateEncodingFlag>(s, h);\
- EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
- EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
- EXPECT_EQ(streamPos, s.Tell());\
-}
-
-#define ARRAY(...) { __VA_ARGS__ }
-#define TEST_STRINGENCODING_ERROR(Encoding, TargetEncoding, utype, array) \
- { \
- static const utype ue[] = array; \
- static const Encoding::Ch* e = reinterpret_cast<const Encoding::Ch *>(&ue[0]); \
- EXPECT_EQ(kParseErrorStringInvalidEncoding, TestString<Encoding>(e));\
- /* decode error */\
- GenericStringStream<Encoding> s(e);\
- BaseReaderHandler<TargetEncoding> h;\
- GenericReader<Encoding, TargetEncoding> reader;\
- reader.Parse(s, h);\
- EXPECT_EQ(kParseErrorStringInvalidEncoding, reader.GetParseErrorCode());\
- }
-
- // Invalid escape character in string.
- TEST_STRING_ERROR(kParseErrorStringEscapeInvalid, "[\"\\a\"]", 2u, 3u);
-
- // Incorrect hex digit after \\u escape in string.
- TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uABCG\"]", 2u, 7u);
-
- // Quotation in \\u escape in string (Issue #288)
- TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uaaa\"]", 2u, 7u);
- TEST_STRING_ERROR(kParseErrorStringUnicodeEscapeInvalidHex, "[\"\\uD800\\uFFF\"]", 2u, 13u);
-
- // The surrogate pair in string is invalid.
- TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, "[\"\\uD800X\"]", 2u, 8u);
- TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, "[\"\\uD800\\uFFFF\"]", 2u, 14u);
-
- // Single low surrogate pair in string is invalid.
- TEST_STRING_ERROR(kParseErrorStringUnicodeSurrogateInvalid, "[\"\\udc4d\"]", 2u, 8u);
-
- // Missing a closing quotation mark in string.
- TEST_STRING_ERROR(kParseErrorStringMissQuotationMark, "[\"Test]", 7u, 7u);
-
- // http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
-
- // 3 Malformed sequences
-
- // 3.1 Unexpected continuation bytes
- {
- char e[] = { '[', '\"', 0, '\"', ']', '\0' };
- for (unsigned char c = 0x80u; c <= 0xBFu; c++) {
- e[2] = static_cast<char>(c);
- ParseErrorCode error = TestString<UTF8<> >(e);
- EXPECT_EQ(kParseErrorStringInvalidEncoding, error);
- if (error != kParseErrorStringInvalidEncoding)
- std::cout << static_cast<unsigned>(c) << std::endl;
- }
- }
-
- // 3.2 Lonely start characters, 3.5 Impossible bytes
- {
- char e[] = { '[', '\"', 0, ' ', '\"', ']', '\0' };
- for (unsigned c = 0xC0u; c <= 0xFFu; c++) {
- e[2] = static_cast<char>(c);
- unsigned streamPos;
- if (c <= 0xC1u)
- streamPos = 3; // 0xC0 - 0xC1
- else if (c <= 0xDFu)
- streamPos = 4; // 0xC2 - 0xDF
- else if (c <= 0xEFu)
- streamPos = 5; // 0xE0 - 0xEF
- else if (c <= 0xF4u)
- streamPos = 6; // 0xF0 - 0xF4
- else
- streamPos = 3; // 0xF5 - 0xFF
- TEST_STRING_ERROR(kParseErrorStringInvalidEncoding, e, 2u, streamPos);
- }
- }
-
- // 4 Overlong sequences
-
- // 4.1 Examples of an overlong ASCII character
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC0u, 0xAFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x80u, 0xAFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x80u, 0x80u, 0xAFu, '\"', ']', '\0'));
-
- // 4.2 Maximum overlong sequences
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC1u, 0xBFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x9Fu, 0xBFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x8Fu, 0xBFu, 0xBFu, '\"', ']', '\0'));
-
- // 4.3 Overlong representation of the NUL character
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xC0u, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xE0u, 0x80u, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xF0u, 0x80u, 0x80u, 0x80u, '\"', ']', '\0'));
-
- // 5 Illegal code positions
-
- // 5.1 Single UTF-16 surrogates
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xA0u, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xADu, 0xBFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xAEu, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xAFu, 0xBFu, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xB0u, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xBEu, 0x80u, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF8<>, UTF16<>, unsigned char, ARRAY('[', '\"', 0xEDu, 0xBFu, 0xBFu, '\"', ']', '\0'));
-
- // Malform UTF-16 sequences
- TEST_STRINGENCODING_ERROR(UTF16<>, UTF8<>, wchar_t, ARRAY('[', '\"', 0xDC00, 0xDC00, '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(UTF16<>, UTF8<>, wchar_t, ARRAY('[', '\"', 0xD800, 0xD800, '\"', ']', '\0'));
-
- // Malform UTF-32 sequence
- TEST_STRINGENCODING_ERROR(UTF32<>, UTF8<>, unsigned, ARRAY('[', '\"', 0x110000, '\"', ']', '\0'));
-
- // Malform ASCII sequence
- TEST_STRINGENCODING_ERROR(ASCII<>, UTF8<>, char, ARRAY('[', '\"', char(0x80u), '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(ASCII<>, UTF8<>, char, ARRAY('[', '\"', char(0x01u), '\"', ']', '\0'));
- TEST_STRINGENCODING_ERROR(ASCII<>, UTF8<>, char, ARRAY('[', '\"', char(0x1Cu), '\"', ']', '\0'));
-
-#undef ARRAY
-#undef TEST_STRINGARRAY_ERROR
-}
-
-template <unsigned count>
-struct ParseArrayHandler : BaseReaderHandler<UTF8<>, ParseArrayHandler<count> > {
- ParseArrayHandler() : step_(0) {}
-
- bool Default() { ADD_FAILURE(); return false; }
- bool Uint(unsigned i) { EXPECT_EQ(step_, i); step_++; return true; }
- bool StartArray() { EXPECT_EQ(0u, step_); step_++; return true; }
- bool EndArray(SizeType) { step_++; return true; }
-
- unsigned step_;
-};
-
-TEST(Reader, ParseEmptyArray) {
- char *json = StrDup("[ ] ");
- InsituStringStream s(json);
- ParseArrayHandler<0> h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(2u, h.step_);
- free(json);
-}
-
-TEST(Reader, ParseArray) {
- char *json = StrDup("[1, 2, 3, 4]");
- InsituStringStream s(json);
- ParseArrayHandler<4> h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(6u, h.step_);
- free(json);
-}
-
-TEST(Reader, ParseArray_Error) {
-#define TEST_ARRAY_ERROR(errorCode, str, errorOffset) \
- { \
- unsigned streamPos = errorOffset; \
- char buffer[1001]; \
- strncpy(buffer, str, 1000); \
- InsituStringStream s(buffer); \
- BaseReaderHandler<> h; \
- GenericReader<UTF8<>, UTF8<>, CrtAllocator> reader; \
- EXPECT_FALSE(reader.Parse(s, h)); \
- EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
- EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
- EXPECT_EQ(streamPos, s.Tell());\
- }
-
- // Missing a comma or ']' after an array element.
- TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1", 2u);
- TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1}", 2u);
- TEST_ARRAY_ERROR(kParseErrorArrayMissCommaOrSquareBracket, "[1 2]", 3u);
-
- // Array cannot have a trailing comma (without kParseTrailingCommasFlag);
- // a value must follow a comma
- TEST_ARRAY_ERROR(kParseErrorValueInvalid, "[1,]", 3u);
-
-#undef TEST_ARRAY_ERROR
-}
-
-struct ParseObjectHandler : BaseReaderHandler<UTF8<>, ParseObjectHandler> {
- ParseObjectHandler() : step_(0) {}
-
- bool Default() { ADD_FAILURE(); return false; }
- bool Null() { EXPECT_EQ(8u, step_); step_++; return true; }
- bool Bool(bool b) {
- switch(step_) {
- case 4: EXPECT_TRUE(b); step_++; return true;
- case 6: EXPECT_FALSE(b); step_++; return true;
- default: ADD_FAILURE(); return false;
- }
- }
- bool Int(int i) {
- switch(step_) {
- case 10: EXPECT_EQ(123, i); step_++; return true;
- case 15: EXPECT_EQ(1, i); step_++; return true;
- case 16: EXPECT_EQ(2, i); step_++; return true;
- case 17: EXPECT_EQ(3, i); step_++; return true;
- default: ADD_FAILURE(); return false;
- }
- }
- bool Uint(unsigned i) { return Int(static_cast<int>(i)); }
- bool Double(double d) { EXPECT_EQ(12u, step_); EXPECT_DOUBLE_EQ(3.1416, d); step_++; return true; }
- bool String(const char* str, size_t, bool) {
- switch(step_) {
- case 1: EXPECT_STREQ("hello", str); step_++; return true;
- case 2: EXPECT_STREQ("world", str); step_++; return true;
- case 3: EXPECT_STREQ("t", str); step_++; return true;
- case 5: EXPECT_STREQ("f", str); step_++; return true;
- case 7: EXPECT_STREQ("n", str); step_++; return true;
- case 9: EXPECT_STREQ("i", str); step_++; return true;
- case 11: EXPECT_STREQ("pi", str); step_++; return true;
- case 13: EXPECT_STREQ("a", str); step_++; return true;
- default: ADD_FAILURE(); return false;
- }
- }
- bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
- bool EndObject(SizeType memberCount) { EXPECT_EQ(19u, step_); EXPECT_EQ(7u, memberCount); step_++; return true; }
- bool StartArray() { EXPECT_EQ(14u, step_); step_++; return true; }
- bool EndArray(SizeType elementCount) { EXPECT_EQ(18u, step_); EXPECT_EQ(3u, elementCount); step_++; return true; }
-
- unsigned step_;
-};
-
-TEST(Reader, ParseObject) {
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ";
-
- // Insitu
- {
- char* json2 = StrDup(json);
- InsituStringStream s(json2);
- ParseObjectHandler h;
- Reader reader;
- reader.Parse<kParseInsituFlag>(s, h);
- EXPECT_EQ(20u, h.step_);
- free(json2);
- }
-
- // Normal
- {
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(20u, h.step_);
- }
-}
-
-struct ParseEmptyObjectHandler : BaseReaderHandler<UTF8<>, ParseEmptyObjectHandler> {
- ParseEmptyObjectHandler() : step_(0) {}
-
- bool Default() { ADD_FAILURE(); return false; }
- bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
- bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }
-
- unsigned step_;
-};
-
-TEST(Reader, Parse_EmptyObject) {
- StringStream s("{ } ");
- ParseEmptyObjectHandler h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(2u, h.step_);
-}
-
-struct ParseMultipleRootHandler : BaseReaderHandler<UTF8<>, ParseMultipleRootHandler> {
- ParseMultipleRootHandler() : step_(0) {}
-
- bool Default() { ADD_FAILURE(); return false; }
- bool StartObject() { EXPECT_EQ(0u, step_); step_++; return true; }
- bool EndObject(SizeType) { EXPECT_EQ(1u, step_); step_++; return true; }
- bool StartArray() { EXPECT_EQ(2u, step_); step_++; return true; }
- bool EndArray(SizeType) { EXPECT_EQ(3u, step_); step_++; return true; }
-
- unsigned step_;
-};
-
-template <unsigned parseFlags>
-void TestMultipleRoot() {
- StringStream s("{}[] a");
- ParseMultipleRootHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
- EXPECT_EQ(2u, h.step_);
- EXPECT_TRUE(reader.Parse<parseFlags>(s, h));
- EXPECT_EQ(4u, h.step_);
- EXPECT_EQ(' ', s.Take());
- EXPECT_EQ('a', s.Take());
-}
-
-TEST(Reader, Parse_MultipleRoot) {
- TestMultipleRoot<kParseStopWhenDoneFlag>();
-}
-
-TEST(Reader, ParseIterative_MultipleRoot) {
- TestMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();
-}
-
-template <unsigned parseFlags>
-void TestInsituMultipleRoot() {
- char* buffer = strdup("{}[] a");
- InsituStringStream s(buffer);
- ParseMultipleRootHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));
- EXPECT_EQ(2u, h.step_);
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | parseFlags>(s, h));
- EXPECT_EQ(4u, h.step_);
- EXPECT_EQ(' ', s.Take());
- EXPECT_EQ('a', s.Take());
- free(buffer);
-}
-
-TEST(Reader, ParseInsitu_MultipleRoot) {
- TestInsituMultipleRoot<kParseStopWhenDoneFlag>();
-}
-
-TEST(Reader, ParseInsituIterative_MultipleRoot) {
- TestInsituMultipleRoot<kParseIterativeFlag | kParseStopWhenDoneFlag>();
-}
-
-#define TEST_ERROR(errorCode, str, errorOffset) \
- { \
- unsigned streamPos = errorOffset; \
- char buffer[1001]; \
- strncpy(buffer, str, 1000); \
- InsituStringStream s(buffer); \
- BaseReaderHandler<> h; \
- Reader reader; \
- EXPECT_FALSE(reader.Parse(s, h)); \
- EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
- EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
- EXPECT_EQ(streamPos, s.Tell());\
- }
-
-TEST(Reader, ParseDocument_Error) {
- // The document is empty.
- TEST_ERROR(kParseErrorDocumentEmpty, "", 0u);
- TEST_ERROR(kParseErrorDocumentEmpty, " ", 1u);
- TEST_ERROR(kParseErrorDocumentEmpty, " \n", 2u);
-
- // The document root must not follow by other values.
- TEST_ERROR(kParseErrorDocumentRootNotSingular, "[] 0", 3u);
- TEST_ERROR(kParseErrorDocumentRootNotSingular, "{} 0", 3u);
- TEST_ERROR(kParseErrorDocumentRootNotSingular, "null []", 5u);
- TEST_ERROR(kParseErrorDocumentRootNotSingular, "0 {}", 2u);
-}
-
-TEST(Reader, ParseValue_Error) {
- // Invalid value.
- TEST_ERROR(kParseErrorValueInvalid, "nulL", 3u);
- TEST_ERROR(kParseErrorValueInvalid, "truE", 3u);
- TEST_ERROR(kParseErrorValueInvalid, "falsE", 4u);
- TEST_ERROR(kParseErrorValueInvalid, "a]", 0u);
- TEST_ERROR(kParseErrorValueInvalid, ".1", 0u);
-}
-
-TEST(Reader, ParseObject_Error) {
- // Missing a name for object member.
- TEST_ERROR(kParseErrorObjectMissName, "{1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{null:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{true:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{false:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{1:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{[]:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{{}:1}", 1u);
- TEST_ERROR(kParseErrorObjectMissName, "{xyz:1}", 1u);
-
- // Missing a colon after a name of object member.
- TEST_ERROR(kParseErrorObjectMissColon, "{\"a\" 1}", 5u);
- TEST_ERROR(kParseErrorObjectMissColon, "{\"a\",1}", 4u);
-
- // Must be a comma or '}' after an object member
- TEST_ERROR(kParseErrorObjectMissCommaOrCurlyBracket, "{\"a\":1]", 6u);
-
- // Object cannot have a trailing comma (without kParseTrailingCommasFlag);
- // an object member name must follow a comma
- TEST_ERROR(kParseErrorObjectMissName, "{\"a\":1,}", 7u);
-
- // This tests that MemoryStream is checking the length in Peek().
- {
- MemoryStream ms("{\"a\"", 1);
- BaseReaderHandler<> h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseStopWhenDoneFlag>(ms, h));
- EXPECT_EQ(kParseErrorObjectMissName, reader.GetParseErrorCode());
- }
-}
-
-#undef TEST_ERROR
-
-TEST(Reader, SkipWhitespace) {
- StringStream ss(" A \t\tB\n \n\nC\r\r \rD \t\n\r E");
- const char* expected = "ABCDE";
- for (size_t i = 0; i < 5; i++) {
- SkipWhitespace(ss);
- EXPECT_EQ(expected[i], ss.Take());
- }
-}
-
-// Test implementing a stream without copy stream optimization.
-// Clone from GenericStringStream except that copy constructor is disabled.
-template <typename Encoding>
-class CustomStringStream {
-public:
- typedef typename Encoding::Ch Ch;
-
- CustomStringStream(const Ch *src) : src_(src), head_(src) {}
-
- Ch Peek() const { return *src_; }
- Ch Take() { return *src_++; }
- size_t Tell() const { return static_cast<size_t>(src_ - head_); }
-
- Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; }
- void Put(Ch) { RAPIDJSON_ASSERT(false); }
- void Flush() { RAPIDJSON_ASSERT(false); }
- size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; }
-
-private:
- // Prohibit copy constructor & assignment operator.
- CustomStringStream(const CustomStringStream&);
- CustomStringStream& operator=(const CustomStringStream&);
-
- const Ch* src_; //!< Current read position.
- const Ch* head_; //!< Original head of the string.
-};
-
-// If the following code is compiled, it should generate compilation error as predicted.
-// Because CustomStringStream<> is not copyable via making copy constructor private.
-#if 0
-namespace rapidjson {
-
-template <typename Encoding>
-struct StreamTraits<CustomStringStream<Encoding> > {
- enum { copyOptimization = 1 };
-};
-
-} // namespace rapidjson
-#endif
-
-TEST(Reader, CustomStringStream) {
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ";
- CustomStringStream<UTF8<char> > s(json);
- ParseObjectHandler h;
- Reader reader;
- reader.Parse(s, h);
- EXPECT_EQ(20u, h.step_);
-}
-
-#include <sstream>
-
-class IStreamWrapper {
-public:
- typedef char Ch;
-
- IStreamWrapper(std::istream& is) : is_(is) {}
-
- Ch Peek() const {
- int c = is_.peek();
- return c == std::char_traits<char>::eof() ? '\0' : static_cast<Ch>(c);
- }
-
- Ch Take() {
- int c = is_.get();
- return c == std::char_traits<char>::eof() ? '\0' : static_cast<Ch>(c);
- }
-
- size_t Tell() const { return static_cast<size_t>(is_.tellg()); }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch) { assert(false); }
- void Flush() { assert(false); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- IStreamWrapper(const IStreamWrapper&);
- IStreamWrapper& operator=(const IStreamWrapper&);
-
- std::istream& is_;
-};
-
-class WIStreamWrapper {
-public:
- typedef wchar_t Ch;
-
- WIStreamWrapper(std::wistream& is) : is_(is) {}
-
- Ch Peek() const {
- unsigned c = is_.peek();
- return c == std::char_traits<wchar_t>::eof() ? Ch('\0') : static_cast<Ch>(c);
- }
-
- Ch Take() {
- unsigned c = is_.get();
- return c == std::char_traits<wchar_t>::eof() ? Ch('\0') : static_cast<Ch>(c);
- }
-
- size_t Tell() const { return static_cast<size_t>(is_.tellg()); }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch) { assert(false); }
- void Flush() { assert(false); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- WIStreamWrapper(const WIStreamWrapper&);
- WIStreamWrapper& operator=(const WIStreamWrapper&);
-
- std::wistream& is_;
-};
-
-TEST(Reader, Parse_IStreamWrapper_StringStream) {
- const char* json = "[1,2,3,4]";
-
- std::stringstream ss(json);
- IStreamWrapper is(ss);
-
- Reader reader;
- ParseArrayHandler<4> h;
- reader.Parse(is, h);
- EXPECT_FALSE(reader.HasParseError());
-}
-
-// Test iterative parsing.
-
-#define TESTERRORHANDLING(text, errorCode, offset)\
-{\
- unsigned streamPos = offset; \
- StringStream json(text); \
- BaseReaderHandler<> handler; \
- Reader reader; \
- reader.Parse<kParseIterativeFlag>(json, handler); \
- EXPECT_TRUE(reader.HasParseError()); \
- EXPECT_EQ(errorCode, reader.GetParseErrorCode()); \
- EXPECT_EQ(offset, reader.GetErrorOffset()); \
- EXPECT_EQ(streamPos, json.Tell()); \
-}
-
-TEST(Reader, IterativeParsing_ErrorHandling) {
- TESTERRORHANDLING("{\"a\": a}", kParseErrorValueInvalid, 6u);
-
- TESTERRORHANDLING("", kParseErrorDocumentEmpty, 0u);
- TESTERRORHANDLING("{}{}", kParseErrorDocumentRootNotSingular, 2u);
-
- TESTERRORHANDLING("{1}", kParseErrorObjectMissName, 1u);
- TESTERRORHANDLING("{\"a\", 1}", kParseErrorObjectMissColon, 4u);
- TESTERRORHANDLING("{\"a\"}", kParseErrorObjectMissColon, 4u);
- TESTERRORHANDLING("{\"a\": 1", kParseErrorObjectMissCommaOrCurlyBracket, 7u);
- TESTERRORHANDLING("[1 2 3]", kParseErrorArrayMissCommaOrSquareBracket, 3u);
- TESTERRORHANDLING("{\"a: 1", kParseErrorStringMissQuotationMark, 6u);
- TESTERRORHANDLING("{\"a\":}", kParseErrorValueInvalid, 5u);
- TESTERRORHANDLING("{\"a\":]", kParseErrorValueInvalid, 5u);
- TESTERRORHANDLING("[1,2,}", kParseErrorValueInvalid, 5u);
- TESTERRORHANDLING("[}]", kParseErrorValueInvalid, 1u);
- TESTERRORHANDLING("[,]", kParseErrorValueInvalid, 1u);
- TESTERRORHANDLING("[1,,]", kParseErrorValueInvalid, 3u);
-
- // Trailing commas are not allowed without kParseTrailingCommasFlag
- TESTERRORHANDLING("{\"a\": 1,}", kParseErrorObjectMissName, 8u);
- TESTERRORHANDLING("[1,2,3,]", kParseErrorValueInvalid, 7u);
-
- // Any JSON value can be a valid root element in RFC7159.
- TESTERRORHANDLING("\"ab", kParseErrorStringMissQuotationMark, 3u);
- TESTERRORHANDLING("truE", kParseErrorValueInvalid, 3u);
- TESTERRORHANDLING("False", kParseErrorValueInvalid, 0u);
- TESTERRORHANDLING("true, false", kParseErrorDocumentRootNotSingular, 4u);
- TESTERRORHANDLING("false, false", kParseErrorDocumentRootNotSingular, 5u);
- TESTERRORHANDLING("nulL", kParseErrorValueInvalid, 3u);
- TESTERRORHANDLING("null , null", kParseErrorDocumentRootNotSingular, 5u);
- TESTERRORHANDLING("1a", kParseErrorDocumentRootNotSingular, 1u);
-}
-
-template<typename Encoding = UTF8<> >
-struct IterativeParsingReaderHandler {
- typedef typename Encoding::Ch Ch;
-
- const static uint32_t LOG_NULL = 0x10000000;
- const static uint32_t LOG_BOOL = 0x20000000;
- const static uint32_t LOG_INT = 0x30000000;
- const static uint32_t LOG_UINT = 0x40000000;
- const static uint32_t LOG_INT64 = 0x50000000;
- const static uint32_t LOG_UINT64 = 0x60000000;
- const static uint32_t LOG_DOUBLE = 0x70000000;
- const static uint32_t LOG_STRING = 0x80000000;
- const static uint32_t LOG_STARTOBJECT = 0x90000000;
- const static uint32_t LOG_KEY = 0xA0000000;
- const static uint32_t LOG_ENDOBJECT = 0xB0000000;
- const static uint32_t LOG_STARTARRAY = 0xC0000000;
- const static uint32_t LOG_ENDARRAY = 0xD0000000;
-
- const static size_t LogCapacity = 256;
- uint32_t Logs[LogCapacity];
- size_t LogCount;
-
- IterativeParsingReaderHandler() : LogCount(0) {
- }
-
- bool Null() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_NULL; return true; }
-
- bool Bool(bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_BOOL; return true; }
-
- bool Int(int) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }
-
- bool Uint(unsigned) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT; return true; }
-
- bool Int64(int64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_INT64; return true; }
-
- bool Uint64(uint64_t) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_UINT64; return true; }
-
- bool Double(double) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_DOUBLE; return true; }
-
- bool RawNumber(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; }
-
- bool String(const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STRING; return true; }
-
- bool StartObject() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTOBJECT; return true; }
-
- bool Key (const Ch*, SizeType, bool) { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_KEY; return true; }
-
- bool EndObject(SizeType c) {
- RAPIDJSON_ASSERT(LogCount < LogCapacity);
- RAPIDJSON_ASSERT((static_cast<uint32_t>(c) & 0xF0000000) == 0);
- Logs[LogCount++] = LOG_ENDOBJECT | static_cast<uint32_t>(c);
- return true;
- }
-
- bool StartArray() { RAPIDJSON_ASSERT(LogCount < LogCapacity); Logs[LogCount++] = LOG_STARTARRAY; return true; }
-
- bool EndArray(SizeType c) {
- RAPIDJSON_ASSERT(LogCount < LogCapacity);
- RAPIDJSON_ASSERT((static_cast<uint32_t>(c) & 0xF0000000) == 0);
- Logs[LogCount++] = LOG_ENDARRAY | static_cast<uint32_t>(c);
- return true;
- }
-};
-
-TEST(Reader, IterativeParsing_General) {
- {
- StringStream is("[1, {\"k\": [1, 2]}, null, false, true, \"string\", 1.2]");
- Reader reader;
- IterativeParsingReaderHandler<> handler;
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_FALSE(r.IsError());
- EXPECT_FALSE(reader.HasParseError());
-
- uint32_t e[] = {
- handler.LOG_STARTARRAY,
- handler.LOG_INT,
- handler.LOG_STARTOBJECT,
- handler.LOG_KEY,
- handler.LOG_STARTARRAY,
- handler.LOG_INT,
- handler.LOG_INT,
- handler.LOG_ENDARRAY | 2,
- handler.LOG_ENDOBJECT | 1,
- handler.LOG_NULL,
- handler.LOG_BOOL,
- handler.LOG_BOOL,
- handler.LOG_STRING,
- handler.LOG_DOUBLE,
- handler.LOG_ENDARRAY | 7
- };
-
- EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);
-
- for (size_t i = 0; i < handler.LogCount; ++i) {
- EXPECT_EQ(e[i], handler.Logs[i]) << "i = " << i;
- }
- }
-}
-
-TEST(Reader, IterativeParsing_Count) {
- {
- StringStream is("[{}, {\"k\": 1}, [1], []]");
- Reader reader;
- IterativeParsingReaderHandler<> handler;
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_FALSE(r.IsError());
- EXPECT_FALSE(reader.HasParseError());
-
- uint32_t e[] = {
- handler.LOG_STARTARRAY,
- handler.LOG_STARTOBJECT,
- handler.LOG_ENDOBJECT | 0,
- handler.LOG_STARTOBJECT,
- handler.LOG_KEY,
- handler.LOG_INT,
- handler.LOG_ENDOBJECT | 1,
- handler.LOG_STARTARRAY,
- handler.LOG_INT,
- handler.LOG_ENDARRAY | 1,
- handler.LOG_STARTARRAY,
- handler.LOG_ENDARRAY | 0,
- handler.LOG_ENDARRAY | 4
- };
-
- EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount);
-
- for (size_t i = 0; i < handler.LogCount; ++i) {
- EXPECT_EQ(e[i], handler.Logs[i]) << "i = " << i;
- }
- }
-}
-
-TEST(Reader, IterativePullParsing_General) {
- {
- IterativeParsingReaderHandler<> handler;
- uint32_t e[] = {
- handler.LOG_STARTARRAY,
- handler.LOG_INT,
- handler.LOG_STARTOBJECT,
- handler.LOG_KEY,
- handler.LOG_STARTARRAY,
- handler.LOG_INT,
- handler.LOG_INT,
- handler.LOG_ENDARRAY | 2,
- handler.LOG_ENDOBJECT | 1,
- handler.LOG_NULL,
- handler.LOG_BOOL,
- handler.LOG_BOOL,
- handler.LOG_STRING,
- handler.LOG_DOUBLE,
- handler.LOG_ENDARRAY | 7
- };
-
- StringStream is("[1, {\"k\": [1, 2]}, null, false, true, \"string\", 1.2]");
- Reader reader;
-
- reader.IterativeParseInit();
- while (!reader.IterativeParseComplete()) {
- size_t oldLogCount = handler.LogCount;
- EXPECT_TRUE(oldLogCount < sizeof(e) / sizeof(int)) << "overrun";
-
- EXPECT_TRUE(reader.IterativeParseNext<kParseDefaultFlags>(is, handler)) << "parse fail";
- EXPECT_EQ(handler.LogCount, oldLogCount + 1) << "handler should be invoked exactly once each time";
- EXPECT_EQ(e[oldLogCount], handler.Logs[oldLogCount]) << "wrong event returned";
- }
-
- EXPECT_FALSE(reader.HasParseError());
- EXPECT_EQ(sizeof(e) / sizeof(int), handler.LogCount) << "handler invoked wrong number of times";
-
- // The handler should not be invoked when the JSON has been fully read, but it should not fail
- size_t oldLogCount = handler.LogCount;
- EXPECT_TRUE(reader.IterativeParseNext<kParseDefaultFlags>(is, handler)) << "parse-next past complete is allowed";
- EXPECT_EQ(handler.LogCount, oldLogCount) << "parse-next past complete should not invoke handler";
- EXPECT_FALSE(reader.HasParseError()) << "parse-next past complete should not generate parse error";
- }
-}
-
-// Test iterative parsing on kParseErrorTermination.
-struct HandlerTerminateAtStartObject : public IterativeParsingReaderHandler<> {
- bool StartObject() { return false; }
-};
-
-struct HandlerTerminateAtStartArray : public IterativeParsingReaderHandler<> {
- bool StartArray() { return false; }
-};
-
-struct HandlerTerminateAtEndObject : public IterativeParsingReaderHandler<> {
- bool EndObject(SizeType) { return false; }
-};
-
-struct HandlerTerminateAtEndArray : public IterativeParsingReaderHandler<> {
- bool EndArray(SizeType) { return false; }
-};
-
-TEST(Reader, IterativeParsing_ShortCircuit) {
- {
- HandlerTerminateAtStartObject handler;
- Reader reader;
- StringStream is("[1, {}]");
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(4u, r.Offset());
- }
-
- {
- HandlerTerminateAtStartArray handler;
- Reader reader;
- StringStream is("{\"a\": []}");
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(6u, r.Offset());
- }
-
- {
- HandlerTerminateAtEndObject handler;
- Reader reader;
- StringStream is("[1, {}]");
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(5u, r.Offset());
- }
-
- {
- HandlerTerminateAtEndArray handler;
- Reader reader;
- StringStream is("{\"a\": []}");
-
- ParseResult r = reader.Parse<kParseIterativeFlag>(is, handler);
-
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(7u, r.Offset());
- }
-}
-
-// For covering BaseReaderHandler default functions
-TEST(Reader, BaseReaderHandler_Default) {
- BaseReaderHandler<> h;
- Reader reader;
- StringStream is("[null, true, -1, 1, -1234567890123456789, 1234567890123456789, 3.14, \"s\", { \"a\" : 1 }]");
- EXPECT_TRUE(reader.Parse(is, h));
-}
-
-template <int e>
-struct TerminateHandler {
- bool Null() { return e != 0; }
- bool Bool(bool) { return e != 1; }
- bool Int(int) { return e != 2; }
- bool Uint(unsigned) { return e != 3; }
- bool Int64(int64_t) { return e != 4; }
- bool Uint64(uint64_t) { return e != 5; }
- bool Double(double) { return e != 6; }
- bool RawNumber(const char*, SizeType, bool) { return e != 7; }
- bool String(const char*, SizeType, bool) { return e != 8; }
- bool StartObject() { return e != 9; }
- bool Key(const char*, SizeType, bool) { return e != 10; }
- bool EndObject(SizeType) { return e != 11; }
- bool StartArray() { return e != 12; }
- bool EndArray(SizeType) { return e != 13; }
-};
-
-#define TEST_TERMINATION(e, json)\
-{\
- Reader reader;\
- TerminateHandler<e> h;\
- StringStream is(json);\
- EXPECT_FALSE(reader.Parse(is, h));\
- EXPECT_EQ(kParseErrorTermination, reader.GetParseErrorCode());\
-}
-
-TEST(Reader, ParseTerminationByHandler) {
- TEST_TERMINATION(0, "[null");
- TEST_TERMINATION(1, "[true");
- TEST_TERMINATION(1, "[false");
- TEST_TERMINATION(2, "[-1");
- TEST_TERMINATION(3, "[1");
- TEST_TERMINATION(4, "[-1234567890123456789");
- TEST_TERMINATION(5, "[1234567890123456789");
- TEST_TERMINATION(6, "[0.5]");
- // RawNumber() is never called
- TEST_TERMINATION(8, "[\"a\"");
- TEST_TERMINATION(9, "[{");
- TEST_TERMINATION(10, "[{\"a\"");
- TEST_TERMINATION(11, "[{}");
- TEST_TERMINATION(11, "[{\"a\":1}"); // non-empty object
- TEST_TERMINATION(12, "{\"a\":[");
- TEST_TERMINATION(13, "{\"a\":[]");
- TEST_TERMINATION(13, "{\"a\":[1]"); // non-empty array
-}
-
-TEST(Reader, ParseComments) {
- const char* json =
- "// Here is a one-line comment.\n"
- "{// And here's another one\n"
- " /*And here's an in-line one.*/\"hello\" : \"world\","
- " \"t\" :/* And one with '*' symbol*/true ,"
- "/* A multiline comment\n"
- " goes here*/"
- " \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3]"
- "}/*And the last one to be sure */";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
-}
-
-TEST(Reader, ParseEmptyInlineComment) {
- const char* json = "{/**/\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
-}
-
-TEST(Reader, ParseEmptyOnelineComment) {
- const char* json = "{//\n\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
-}
-
-TEST(Reader, ParseMultipleCommentsInARow) {
- const char* json =
- "{/* first comment *//* second */\n"
- "/* third */ /*fourth*/// last one\n"
- "\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
-}
-
-TEST(Reader, InlineCommentsAreDisabledByDefault) {
- {
- const char* json = "{/* Inline comment. */\"hello\" : \"world\", \"t\" : true, \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
- }
-
- {
- const char* json =
- "{\"hello\" : /* Multiline comment starts here\n"
- " continues here\n"
- " and ends here */\"world\", \"t\" :true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
- }
-}
-
-TEST(Reader, OnelineCommentsAreDisabledByDefault) {
- const char* json = "{// One-line comment\n\"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseDefaultFlags>(s, h));
-}
-
-TEST(Reader, EofAfterOneLineComment) {
- const char* json = "{\"hello\" : \"world\" // EOF is here -->\0 \n}";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(kParseErrorObjectMissCommaOrCurlyBracket, reader.GetParseErrorCode());
-}
-
-TEST(Reader, IncompleteMultilineComment) {
- const char* json = "{\"hello\" : \"world\" /* EOF is here -->\0 */}";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
-}
-
-TEST(Reader, IncompleteMultilineComment2) {
- const char* json = "{\"hello\" : \"world\" /* *\0 */}";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
-}
-
-TEST(Reader, UnrecognizedComment) {
- const char* json = "{\"hello\" : \"world\" /! }";
-
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_FALSE(reader.Parse<kParseCommentsFlag>(s, h));
- EXPECT_EQ(kParseErrorUnspecificSyntaxError, reader.GetParseErrorCode());
-}
-
-struct NumbersAsStringsHandler {
- bool Null() { return true; }
- bool Bool(bool) { return true; }
- bool Int(int) { return true; }
- bool Uint(unsigned) { return true; }
- bool Int64(int64_t) { return true; }
- bool Uint64(uint64_t) { return true; }
- bool Double(double) { return true; }
- // 'str' is not null-terminated
- bool RawNumber(const char* str, SizeType length, bool) {
- EXPECT_TRUE(str != 0);
- EXPECT_TRUE(expected_len_ == length);
- EXPECT_TRUE(strncmp(str, expected_, length) == 0);
- return true;
- }
- bool String(const char*, SizeType, bool) { return true; }
- bool StartObject() { return true; }
- bool Key(const char*, SizeType, bool) { return true; }
- bool EndObject(SizeType) { return true; }
- bool StartArray() { return true; }
- bool EndArray(SizeType) { return true; }
-
- NumbersAsStringsHandler(const char* expected)
- : expected_(expected)
- , expected_len_(strlen(expected)) {}
-
- const char* expected_;
- size_t expected_len_;
-};
-
-TEST(Reader, NumbersAsStrings) {
- {
- const char* json = "{ \"pi\": 3.1416 } ";
- StringStream s(json);
- NumbersAsStringsHandler h("3.1416");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- char* json = StrDup("{ \"pi\": 3.1416 } ");
- InsituStringStream s(json);
- NumbersAsStringsHandler h("3.1416");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag|kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const char* json = "{ \"gigabyte\": 1.0e9 } ";
- StringStream s(json);
- NumbersAsStringsHandler h("1.0e9");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- char* json = StrDup("{ \"gigabyte\": 1.0e9 } ");
- InsituStringStream s(json);
- NumbersAsStringsHandler h("1.0e9");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag|kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const char* json = "{ \"pi\": 314.159e-2 } ";
- StringStream s(json);
- NumbersAsStringsHandler h("314.159e-2");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- char* json = StrDup("{ \"gigabyte\": 314.159e-2 } ");
- InsituStringStream s(json);
- NumbersAsStringsHandler h("314.159e-2");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag|kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const char* json = "{ \"negative\": -1.54321 } ";
- StringStream s(json);
- NumbersAsStringsHandler h("-1.54321");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- char* json = StrDup("{ \"negative\": -1.54321 } ");
- InsituStringStream s(json);
- NumbersAsStringsHandler h("-1.54321");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag|kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const char* json = "{ \"pi\": 314.159e-2 } ";
- std::stringstream ss(json);
- IStreamWrapper s(ss);
- NumbersAsStringsHandler h("314.159e-2");
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- char n1e319[321]; // '1' followed by 319 '0'
- n1e319[0] = '1';
- for (int i = 1; i < 320; i++)
- n1e319[i] = '0';
- n1e319[320] = '\0';
- StringStream s(n1e319);
- NumbersAsStringsHandler h(n1e319);
- Reader reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
-}
-
-struct NumbersAsStringsHandlerWChar_t {
- bool Null() { return true; }
- bool Bool(bool) { return true; }
- bool Int(int) { return true; }
- bool Uint(unsigned) { return true; }
- bool Int64(int64_t) { return true; }
- bool Uint64(uint64_t) { return true; }
- bool Double(double) { return true; }
- // 'str' is not null-terminated
- bool RawNumber(const wchar_t* str, SizeType length, bool) {
- EXPECT_TRUE(str != 0);
- EXPECT_TRUE(expected_len_ == length);
- EXPECT_TRUE(wcsncmp(str, expected_, length) == 0);
- return true;
- }
- bool String(const wchar_t*, SizeType, bool) { return true; }
- bool StartObject() { return true; }
- bool Key(const wchar_t*, SizeType, bool) { return true; }
- bool EndObject(SizeType) { return true; }
- bool StartArray() { return true; }
- bool EndArray(SizeType) { return true; }
-
- NumbersAsStringsHandlerWChar_t(const wchar_t* expected)
- : expected_(expected)
- , expected_len_(wcslen(expected)) {}
-
- const wchar_t* expected_;
- size_t expected_len_;
-};
-
-TEST(Reader, NumbersAsStringsWChar_t) {
- {
- const wchar_t* json = L"{ \"pi\": 3.1416 } ";
- GenericStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"3.1416");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- wchar_t* json = StrDup(L"{ \"pi\": 3.1416 } ");
- GenericInsituStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"3.1416");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const wchar_t* json = L"{ \"gigabyte\": 1.0e9 } ";
- GenericStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"1.0e9");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- wchar_t* json = StrDup(L"{ \"gigabyte\": 1.0e9 } ");
- GenericInsituStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"1.0e9");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const wchar_t* json = L"{ \"pi\": 314.159e-2 } ";
- GenericStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"314.159e-2");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- wchar_t* json = StrDup(L"{ \"gigabyte\": 314.159e-2 } ");
- GenericInsituStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"314.159e-2");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const wchar_t* json = L"{ \"negative\": -1.54321 } ";
- GenericStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"-1.54321");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- wchar_t* json = StrDup(L"{ \"negative\": -1.54321 } ");
- GenericInsituStringStream<UTF16<> > s(json);
- NumbersAsStringsHandlerWChar_t h(L"-1.54321");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseInsituFlag | kParseNumbersAsStringsFlag>(s, h));
- free(json);
- }
- {
- const wchar_t* json = L"{ \"pi\": 314.159e-2 } ";
- std::wstringstream ss(json);
- WIStreamWrapper s(ss);
- NumbersAsStringsHandlerWChar_t h(L"314.159e-2");
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
- {
- wchar_t n1e319[321]; // '1' followed by 319 '0'
- n1e319[0] = L'1';
- for(int i = 1; i < 320; i++)
- n1e319[i] = L'0';
- n1e319[320] = L'\0';
- GenericStringStream<UTF16<> > s(n1e319);
- NumbersAsStringsHandlerWChar_t h(n1e319);
- GenericReader<UTF16<>, UTF16<> > reader;
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag>(s, h));
- }
-}
-
-template <unsigned extraFlags>
-void TestTrailingCommas() {
- {
- StringStream s("[1,2,3,]");
- ParseArrayHandler<3> h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h));
- EXPECT_EQ(5u, h.step_);
- }
- {
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false,"
- "\"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3],}";
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
- }
- {
- // whitespace around trailing commas
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false,"
- "\"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3\n,\n]\n,\n} ";
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
- }
- {
- // comments around trailing commas
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null,"
- "\"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3/*test*/,/*test*/]/*test*/,/*test*/}";
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- EXPECT_TRUE(reader.Parse<extraFlags|kParseTrailingCommasFlag|kParseCommentsFlag>(s, h));
- EXPECT_EQ(20u, h.step_);
- }
-}
-
-TEST(Reader, TrailingCommas) {
- TestTrailingCommas<kParseNoFlags>();
-}
-
-TEST(Reader, TrailingCommasIterative) {
- TestTrailingCommas<kParseIterativeFlag>();
-}
-
-template <unsigned extraFlags>
-void TestMultipleTrailingCommaErrors() {
- // only a single trailing comma is allowed.
- {
- StringStream s("[1,2,3,,]");
- ParseArrayHandler<3> h;
- Reader reader;
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorValueInvalid, r.Code());
- EXPECT_EQ(7u, r.Offset());
- }
- {
- const char* json = "{ \"hello\" : \"world\", \"t\" : true , \"f\" : false,"
- "\"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3,],,}";
- StringStream s(json);
- ParseObjectHandler h;
- Reader reader;
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorObjectMissName, r.Code());
- EXPECT_EQ(95u, r.Offset());
- }
-}
-
-TEST(Reader, MultipleTrailingCommaErrors) {
- TestMultipleTrailingCommaErrors<kParseNoFlags>();
-}
-
-TEST(Reader, MultipleTrailingCommaErrorsIterative) {
- TestMultipleTrailingCommaErrors<kParseIterativeFlag>();
-}
-
-template <unsigned extraFlags>
-void TestEmptyExceptForCommaErrors() {
- // not allowed even with trailing commas enabled; the
- // trailing comma must follow a value.
- {
- StringStream s("[,]");
- ParseArrayHandler<3> h;
- Reader reader;
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorValueInvalid, r.Code());
- EXPECT_EQ(1u, r.Offset());
- }
- {
- StringStream s("{,}");
- ParseObjectHandler h;
- Reader reader;
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorObjectMissName, r.Code());
- EXPECT_EQ(1u, r.Offset());
- }
-}
-
-TEST(Reader, EmptyExceptForCommaErrors) {
- TestEmptyExceptForCommaErrors<kParseNoFlags>();
-}
-
-TEST(Reader, EmptyExceptForCommaErrorsIterative) {
- TestEmptyExceptForCommaErrors<kParseIterativeFlag>();
-}
-
-template <unsigned extraFlags>
-void TestTrailingCommaHandlerTermination() {
- {
- HandlerTerminateAtEndArray h;
- Reader reader;
- StringStream s("[1,2,3,]");
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(7u, r.Offset());
- }
- {
- HandlerTerminateAtEndObject h;
- Reader reader;
- StringStream s("{\"t\": true, \"f\": false,}");
- ParseResult r = reader.Parse<extraFlags|kParseTrailingCommasFlag>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorTermination, r.Code());
- EXPECT_EQ(23u, r.Offset());
- }
-}
-
-TEST(Reader, TrailingCommaHandlerTermination) {
- TestTrailingCommaHandlerTermination<kParseNoFlags>();
-}
-
-TEST(Reader, TrailingCommaHandlerTerminationIterative) {
- TestTrailingCommaHandlerTermination<kParseIterativeFlag>();
-}
-
-TEST(Reader, ParseNanAndInfinity) {
-#define TEST_NAN_INF(str, x) \
- { \
- { \
- StringStream s(str); \
- ParseDoubleHandler h; \
- Reader reader; \
- ASSERT_EQ(kParseErrorNone, reader.Parse<kParseNanAndInfFlag>(s, h).Code()); \
- EXPECT_EQ(1u, h.step_); \
- internal::Double e(x), a(h.actual_); \
- EXPECT_EQ(e.IsNan(), a.IsNan()); \
- EXPECT_EQ(e.IsInf(), a.IsInf()); \
- if (!e.IsNan()) \
- EXPECT_EQ(e.Sign(), a.Sign()); \
- } \
- { \
- const char* json = "{ \"naninfdouble\": " str " } "; \
- StringStream s(json); \
- NumbersAsStringsHandler h(str); \
- Reader reader; \
- EXPECT_TRUE(reader.Parse<kParseNumbersAsStringsFlag|kParseNanAndInfFlag>(s, h)); \
- } \
- { \
- char* json = StrDup("{ \"naninfdouble\": " str " } "); \
- InsituStringStream s(json); \
- NumbersAsStringsHandler h(str); \
- Reader reader; \
- EXPECT_TRUE(reader.Parse<kParseInsituFlag|kParseNumbersAsStringsFlag|kParseNanAndInfFlag>(s, h)); \
- free(json); \
- } \
- }
-#define TEST_NAN_INF_ERROR(errorCode, str, errorOffset) \
- { \
- unsigned streamPos = errorOffset; \
- char buffer[1001]; \
- strncpy(buffer, str, 1000); \
- InsituStringStream s(buffer); \
- BaseReaderHandler<> h; \
- Reader reader; \
- EXPECT_FALSE(reader.Parse<kParseNanAndInfFlag>(s, h)); \
- EXPECT_EQ(errorCode, reader.GetParseErrorCode());\
- EXPECT_EQ(errorOffset, reader.GetErrorOffset());\
- EXPECT_EQ(streamPos, s.Tell());\
- }
-
- double nan = std::numeric_limits<double>::quiet_NaN();
- double inf = std::numeric_limits<double>::infinity();
-
- TEST_NAN_INF("NaN", nan);
- TEST_NAN_INF("-NaN", nan);
- TEST_NAN_INF("Inf", inf);
- TEST_NAN_INF("Infinity", inf);
- TEST_NAN_INF("-Inf", -inf);
- TEST_NAN_INF("-Infinity", -inf);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "NInf", 1u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "NaInf", 2u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "INan", 1u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "InNan", 2u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "nan", 1u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "-nan", 1u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "NAN", 1u);
- TEST_NAN_INF_ERROR(kParseErrorValueInvalid, "-Infinty", 6u);
-
-#undef TEST_NAN_INF_ERROR
-#undef TEST_NAN_INF
-}
-
-TEST(Reader, EscapedApostrophe) {
- const char json[] = " { \"foo\": \"bar\\'buzz\" } ";
-
- BaseReaderHandler<> h;
-
- {
- StringStream s(json);
- Reader reader;
- ParseResult r = reader.Parse<kParseNoFlags>(s, h);
- EXPECT_TRUE(reader.HasParseError());
- EXPECT_EQ(kParseErrorStringEscapeInvalid, r.Code());
- EXPECT_EQ(14u, r.Offset());
- }
-
- {
- StringStream s(json);
- Reader reader;
- ParseResult r = reader.Parse<kParseEscapedApostropheFlag>(s, h);
- EXPECT_FALSE(reader.HasParseError());
- EXPECT_EQ(kParseErrorNone, r.Code());
- EXPECT_EQ(0u, r.Offset());
- }
-}
-
-RAPIDJSON_DIAG_POP
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/regextest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/regextest.cpp
deleted file mode 100644
index 2296ba2980..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/regextest.cpp
+++ /dev/null
@@ -1,639 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/internal/regex.h"
-
-using namespace rapidjson::internal;
-
-TEST(Regex, Single) {
- Regex re("a");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("b"));
-}
-
-TEST(Regex, Concatenation) {
- Regex re("abc");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("abcd"));
-}
-
-TEST(Regex, Alternation1) {
- Regex re("abab|abbb");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abab"));
- EXPECT_TRUE(rs.Match("abbb"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("ababa"));
- EXPECT_FALSE(rs.Match("abb"));
- EXPECT_FALSE(rs.Match("abbbb"));
-}
-
-TEST(Regex, Alternation2) {
- Regex re("a|b|c");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("c"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match("ab"));
-}
-
-TEST(Regex, Parenthesis1) {
- Regex re("(ab)c");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("abcd"));
-}
-
-TEST(Regex, Parenthesis2) {
- Regex re("a(bc)");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("abcd"));
-}
-
-TEST(Regex, Parenthesis3) {
- Regex re("(a|b)(c|d)");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ac"));
- EXPECT_TRUE(rs.Match("ad"));
- EXPECT_TRUE(rs.Match("bc"));
- EXPECT_TRUE(rs.Match("bd"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("cd"));
-}
-
-TEST(Regex, ZeroOrOne1) {
- Regex re("a?");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match(""));
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, ZeroOrOne2) {
- Regex re("a?b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match("bb"));
- EXPECT_FALSE(rs.Match("ba"));
-}
-
-TEST(Regex, ZeroOrOne3) {
- Regex re("ab?");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match("bb"));
- EXPECT_FALSE(rs.Match("ba"));
-}
-
-TEST(Regex, ZeroOrOne4) {
- Regex re("a?b?");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match(""));
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_FALSE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match("bb"));
- EXPECT_FALSE(rs.Match("ba"));
- EXPECT_FALSE(rs.Match("abc"));
-}
-
-TEST(Regex, ZeroOrOne5) {
- Regex re("a(ab)?b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aabb"));
- EXPECT_FALSE(rs.Match("aab"));
- EXPECT_FALSE(rs.Match("abb"));
-}
-
-TEST(Regex, ZeroOrMore1) {
- Regex re("a*");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match(""));
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ab"));
-}
-
-TEST(Regex, ZeroOrMore2) {
- Regex re("a*b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aab"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("bb"));
-}
-
-TEST(Regex, ZeroOrMore3) {
- Regex re("a*b*");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match(""));
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("aa"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("bb"));
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aabb"));
- EXPECT_FALSE(rs.Match("ba"));
-}
-
-TEST(Regex, ZeroOrMore4) {
- Regex re("a(ab)*b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aabb"));
- EXPECT_TRUE(rs.Match("aababb"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, OneOrMore1) {
- Regex re("a+");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("aa"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ab"));
-}
-
-TEST(Regex, OneOrMore2) {
- Regex re("a+b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aab"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("b"));
-}
-
-TEST(Regex, OneOrMore3) {
- Regex re("a+b+");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ab"));
- EXPECT_TRUE(rs.Match("aab"));
- EXPECT_TRUE(rs.Match("abb"));
- EXPECT_TRUE(rs.Match("aabb"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("ba"));
-}
-
-TEST(Regex, OneOrMore4) {
- Regex re("a(ab)+b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("aabb"));
- EXPECT_TRUE(rs.Match("aababb"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("ab"));
-}
-
-TEST(Regex, QuantifierExact1) {
- Regex re("ab{3}c");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbc"));
- EXPECT_FALSE(rs.Match("ac"));
- EXPECT_FALSE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match("abbc"));
- EXPECT_FALSE(rs.Match("abbbbc"));
-}
-
-TEST(Regex, QuantifierExact2) {
- Regex re("a(bc){3}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abcbcbcd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abcd"));
- EXPECT_FALSE(rs.Match("abcbcd"));
- EXPECT_FALSE(rs.Match("abcbcbcbcd"));
-}
-
-TEST(Regex, QuantifierExact3) {
- Regex re("a(b|c){3}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbd"));
- EXPECT_TRUE(rs.Match("acccd"));
- EXPECT_TRUE(rs.Match("abcbd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abbd"));
- EXPECT_FALSE(rs.Match("accccd"));
- EXPECT_FALSE(rs.Match("abbbbd"));
-}
-
-TEST(Regex, QuantifierMin1) {
- Regex re("ab{3,}c");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbc"));
- EXPECT_TRUE(rs.Match("abbbbc"));
- EXPECT_TRUE(rs.Match("abbbbbc"));
- EXPECT_FALSE(rs.Match("ac"));
- EXPECT_FALSE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match("abbc"));
-}
-
-TEST(Regex, QuantifierMin2) {
- Regex re("a(bc){3,}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abcbcbcd"));
- EXPECT_TRUE(rs.Match("abcbcbcbcd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abcd"));
- EXPECT_FALSE(rs.Match("abcbcd"));
-}
-
-TEST(Regex, QuantifierMin3) {
- Regex re("a(b|c){3,}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbd"));
- EXPECT_TRUE(rs.Match("acccd"));
- EXPECT_TRUE(rs.Match("abcbd"));
- EXPECT_TRUE(rs.Match("accccd"));
- EXPECT_TRUE(rs.Match("abbbbd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abbd"));
-}
-
-TEST(Regex, QuantifierMinMax1) {
- Regex re("ab{3,5}c");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbc"));
- EXPECT_TRUE(rs.Match("abbbbc"));
- EXPECT_TRUE(rs.Match("abbbbbc"));
- EXPECT_FALSE(rs.Match("ac"));
- EXPECT_FALSE(rs.Match("abc"));
- EXPECT_FALSE(rs.Match("abbc"));
- EXPECT_FALSE(rs.Match("abbbbbbc"));
-}
-
-TEST(Regex, QuantifierMinMax2) {
- Regex re("a(bc){3,5}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abcbcbcd"));
- EXPECT_TRUE(rs.Match("abcbcbcbcd"));
- EXPECT_TRUE(rs.Match("abcbcbcbcbcd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abcd"));
- EXPECT_FALSE(rs.Match("abcbcd"));
- EXPECT_FALSE(rs.Match("abcbcbcbcbcbcd"));
-}
-
-TEST(Regex, QuantifierMinMax3) {
- Regex re("a(b|c){3,5}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("abbbd"));
- EXPECT_TRUE(rs.Match("acccd"));
- EXPECT_TRUE(rs.Match("abcbd"));
- EXPECT_TRUE(rs.Match("accccd"));
- EXPECT_TRUE(rs.Match("abbbbd"));
- EXPECT_TRUE(rs.Match("acccccd"));
- EXPECT_TRUE(rs.Match("abbbbbd"));
- EXPECT_FALSE(rs.Match("ad"));
- EXPECT_FALSE(rs.Match("abbd"));
- EXPECT_FALSE(rs.Match("accccccd"));
- EXPECT_FALSE(rs.Match("abbbbbbd"));
-}
-
-// Issue538
-TEST(Regex, QuantifierMinMax4) {
- Regex re("a(b|c){0,3}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ad"));
- EXPECT_TRUE(rs.Match("abd"));
- EXPECT_TRUE(rs.Match("acd"));
- EXPECT_TRUE(rs.Match("abbd"));
- EXPECT_TRUE(rs.Match("accd"));
- EXPECT_TRUE(rs.Match("abcd"));
- EXPECT_TRUE(rs.Match("abbbd"));
- EXPECT_TRUE(rs.Match("acccd"));
- EXPECT_FALSE(rs.Match("abbbbd"));
- EXPECT_FALSE(rs.Match("add"));
- EXPECT_FALSE(rs.Match("accccd"));
- EXPECT_FALSE(rs.Match("abcbcd"));
-}
-
-// Issue538
-TEST(Regex, QuantifierMinMax5) {
- Regex re("a(b|c){0,}d");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("ad"));
- EXPECT_TRUE(rs.Match("abd"));
- EXPECT_TRUE(rs.Match("acd"));
- EXPECT_TRUE(rs.Match("abbd"));
- EXPECT_TRUE(rs.Match("accd"));
- EXPECT_TRUE(rs.Match("abcd"));
- EXPECT_TRUE(rs.Match("abbbd"));
- EXPECT_TRUE(rs.Match("acccd"));
- EXPECT_TRUE(rs.Match("abbbbd"));
- EXPECT_TRUE(rs.Match("accccd"));
- EXPECT_TRUE(rs.Match("abcbcd"));
- EXPECT_FALSE(rs.Match("add"));
- EXPECT_FALSE(rs.Match("aad"));
-}
-
-#define EURO "\xE2\x82\xAC" // "\xE2\x82\xAC" is UTF-8 rsquence of Euro sign U+20AC
-
-TEST(Regex, Unicode) {
- Regex re("a" EURO "+b");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a" EURO "b"));
- EXPECT_TRUE(rs.Match("a" EURO EURO "b"));
- EXPECT_FALSE(rs.Match("a?b"));
- EXPECT_FALSE(rs.Match("a" EURO "\xAC" "b")); // unaware of UTF-8 will match
-}
-
-TEST(Regex, AnyCharacter) {
- Regex re(".");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match(EURO));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, CharacterRange1) {
- Regex re("[abc]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("c"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("`"));
- EXPECT_FALSE(rs.Match("d"));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, CharacterRange2) {
- Regex re("[^abc]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("`"));
- EXPECT_TRUE(rs.Match("d"));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("c"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, CharacterRange3) {
- Regex re("[a-c]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("b"));
- EXPECT_TRUE(rs.Match("c"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("`"));
- EXPECT_FALSE(rs.Match("d"));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, CharacterRange4) {
- Regex re("[^a-c]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("`"));
- EXPECT_TRUE(rs.Match("d"));
- EXPECT_FALSE(rs.Match("a"));
- EXPECT_FALSE(rs.Match("b"));
- EXPECT_FALSE(rs.Match("c"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("aa"));
-}
-
-TEST(Regex, CharacterRange5) {
- Regex re("[-]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("-"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("a"));
-}
-
-TEST(Regex, CharacterRange6) {
- Regex re("[a-]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("-"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("`"));
- EXPECT_FALSE(rs.Match("b"));
-}
-
-TEST(Regex, CharacterRange7) {
- Regex re("[-a]");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("a"));
- EXPECT_TRUE(rs.Match("-"));
- EXPECT_FALSE(rs.Match(""));
- EXPECT_FALSE(rs.Match("`"));
- EXPECT_FALSE(rs.Match("b"));
-}
-
-TEST(Regex, CharacterRange8) {
- Regex re("[a-zA-Z0-9]*");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("Milo"));
- EXPECT_TRUE(rs.Match("MT19937"));
- EXPECT_TRUE(rs.Match("43"));
- EXPECT_FALSE(rs.Match("a_b"));
- EXPECT_FALSE(rs.Match("!"));
-}
-
-TEST(Regex, Search) {
- Regex re("abc");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Search("abc"));
- EXPECT_TRUE(rs.Search("_abc"));
- EXPECT_TRUE(rs.Search("abc_"));
- EXPECT_TRUE(rs.Search("_abc_"));
- EXPECT_TRUE(rs.Search("__abc__"));
- EXPECT_TRUE(rs.Search("abcabc"));
- EXPECT_FALSE(rs.Search("a"));
- EXPECT_FALSE(rs.Search("ab"));
- EXPECT_FALSE(rs.Search("bc"));
- EXPECT_FALSE(rs.Search("cba"));
-}
-
-TEST(Regex, Search_BeginAnchor) {
- Regex re("^abc");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Search("abc"));
- EXPECT_TRUE(rs.Search("abc_"));
- EXPECT_TRUE(rs.Search("abcabc"));
- EXPECT_FALSE(rs.Search("_abc"));
- EXPECT_FALSE(rs.Search("_abc_"));
- EXPECT_FALSE(rs.Search("a"));
- EXPECT_FALSE(rs.Search("ab"));
- EXPECT_FALSE(rs.Search("bc"));
- EXPECT_FALSE(rs.Search("cba"));
-}
-
-TEST(Regex, Search_EndAnchor) {
- Regex re("abc$");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Search("abc"));
- EXPECT_TRUE(rs.Search("_abc"));
- EXPECT_TRUE(rs.Search("abcabc"));
- EXPECT_FALSE(rs.Search("abc_"));
- EXPECT_FALSE(rs.Search("_abc_"));
- EXPECT_FALSE(rs.Search("a"));
- EXPECT_FALSE(rs.Search("ab"));
- EXPECT_FALSE(rs.Search("bc"));
- EXPECT_FALSE(rs.Search("cba"));
-}
-
-TEST(Regex, Search_BothAnchor) {
- Regex re("^abc$");
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Search("abc"));
- EXPECT_FALSE(rs.Search(""));
- EXPECT_FALSE(rs.Search("a"));
- EXPECT_FALSE(rs.Search("b"));
- EXPECT_FALSE(rs.Search("ab"));
- EXPECT_FALSE(rs.Search("abcd"));
-}
-
-TEST(Regex, Escape) {
- const char* s = "\\^\\$\\|\\(\\)\\?\\*\\+\\.\\[\\]\\{\\}\\\\\\f\\n\\r\\t\\v[\\b][\\[][\\]]";
- Regex re(s);
- ASSERT_TRUE(re.IsValid());
- RegexSearch rs(re);
- EXPECT_TRUE(rs.Match("^$|()?*+.[]{}\\\x0C\n\r\t\x0B\b[]"));
- EXPECT_FALSE(rs.Match(s)); // Not escaping
-}
-
-TEST(Regex, Invalid) {
-#define TEST_INVALID(s) \
- {\
- Regex re(s);\
- EXPECT_FALSE(re.IsValid());\
- }
-
- TEST_INVALID("");
- TEST_INVALID("a|");
- TEST_INVALID("()");
- TEST_INVALID("(");
- TEST_INVALID(")");
- TEST_INVALID("(a))");
- TEST_INVALID("(a|)");
- TEST_INVALID("(a||b)");
- TEST_INVALID("(|b)");
- TEST_INVALID("?");
- TEST_INVALID("*");
- TEST_INVALID("+");
- TEST_INVALID("{");
- TEST_INVALID("{}");
- TEST_INVALID("a{a}");
- TEST_INVALID("a{0}");
- TEST_INVALID("a{-1}");
- TEST_INVALID("a{}");
- // TEST_INVALID("a{0,}"); // Support now
- TEST_INVALID("a{,0}");
- TEST_INVALID("a{1,0}");
- TEST_INVALID("a{-1,0}");
- TEST_INVALID("a{-1,1}");
- TEST_INVALID("a{4294967296}"); // overflow of unsigned
- TEST_INVALID("a{1a}");
- TEST_INVALID("[");
- TEST_INVALID("[]");
- TEST_INVALID("[^]");
- TEST_INVALID("[\\a]");
- TEST_INVALID("\\a");
-
-#undef TEST_INVALID
-}
-
-TEST(Regex, Issue538) {
- Regex re("^[0-9]+(\\\\.[0-9]+){0,2}");
- EXPECT_TRUE(re.IsValid());
-}
-
-TEST(Regex, Issue583) {
- Regex re("[0-9]{99999}");
- ASSERT_TRUE(re.IsValid());
-}
-
-#undef EURO
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/schematest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/schematest.cpp
deleted file mode 100644
index 3f511b3e17..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/schematest.cpp
+++ /dev/null
@@ -1,3575 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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.
-
-#define RAPIDJSON_SCHEMA_VERBOSE 0
-#define RAPIDJSON_HAS_STDSTRING 1
-
-#include "unittest.h"
-#include "rapidjson/schema.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/error/error.h"
-#include "rapidjson/error/en.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(variadic-macros)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4822) // local class member function does not have a body
-#endif
-
-using namespace rapidjson;
-
-#define TEST_HASHER(json1, json2, expected) \
-{\
- Document d1, d2;\
- d1.Parse(json1);\
- ASSERT_FALSE(d1.HasParseError());\
- d2.Parse(json2);\
- ASSERT_FALSE(d2.HasParseError());\
- internal::Hasher<Value, CrtAllocator> h1, h2;\
- d1.Accept(h1);\
- d2.Accept(h2);\
- ASSERT_TRUE(h1.IsValid());\
- ASSERT_TRUE(h2.IsValid());\
- /*printf("%s: 0x%016llx\n%s: 0x%016llx\n\n", json1, h1.GetHashCode(), json2, h2.GetHashCode());*/\
- EXPECT_TRUE(expected == (h1.GetHashCode() == h2.GetHashCode()));\
-}
-
-TEST(SchemaValidator, Hasher) {
- TEST_HASHER("null", "null", true);
-
- TEST_HASHER("true", "true", true);
- TEST_HASHER("false", "false", true);
- TEST_HASHER("true", "false", false);
- TEST_HASHER("false", "true", false);
- TEST_HASHER("true", "null", false);
- TEST_HASHER("false", "null", false);
-
- TEST_HASHER("1", "1", true);
- TEST_HASHER("2147483648", "2147483648", true); // 2^31 can only be fit in unsigned
- TEST_HASHER("-2147483649", "-2147483649", true); // -2^31 - 1 can only be fit in int64_t
- TEST_HASHER("2147483648", "2147483648", true); // 2^31 can only be fit in unsigned
- TEST_HASHER("4294967296", "4294967296", true); // 2^32 can only be fit in int64_t
- TEST_HASHER("9223372036854775808", "9223372036854775808", true); // 2^63 can only be fit in uint64_t
- TEST_HASHER("1.5", "1.5", true);
- TEST_HASHER("1", "1.0", true);
- TEST_HASHER("1", "-1", false);
- TEST_HASHER("0.0", "-0.0", false);
- TEST_HASHER("1", "true", false);
- TEST_HASHER("0", "false", false);
- TEST_HASHER("0", "null", false);
-
- TEST_HASHER("\"\"", "\"\"", true);
- TEST_HASHER("\"\"", "\"\\u0000\"", false);
- TEST_HASHER("\"Hello\"", "\"Hello\"", true);
- TEST_HASHER("\"Hello\"", "\"World\"", false);
- TEST_HASHER("\"Hello\"", "null", false);
- TEST_HASHER("\"Hello\\u0000\"", "\"Hello\"", false);
- TEST_HASHER("\"\"", "null", false);
- TEST_HASHER("\"\"", "true", false);
- TEST_HASHER("\"\"", "false", false);
-
- TEST_HASHER("[]", "[ ]", true);
- TEST_HASHER("[1, true, false]", "[1, true, false]", true);
- TEST_HASHER("[1, true, false]", "[1, true]", false);
- TEST_HASHER("[1, 2]", "[2, 1]", false);
- TEST_HASHER("[[1], 2]", "[[1, 2]]", false);
- TEST_HASHER("[1, 2]", "[1, [2]]", false);
- TEST_HASHER("[]", "null", false);
- TEST_HASHER("[]", "true", false);
- TEST_HASHER("[]", "false", false);
- TEST_HASHER("[]", "0", false);
- TEST_HASHER("[]", "0.0", false);
- TEST_HASHER("[]", "\"\"", false);
-
- TEST_HASHER("{}", "{ }", true);
- TEST_HASHER("{\"a\":1}", "{\"a\":1}", true);
- TEST_HASHER("{\"a\":1}", "{\"b\":1}", false);
- TEST_HASHER("{\"a\":1}", "{\"a\":2}", false);
- TEST_HASHER("{\"a\":1, \"b\":2}", "{\"b\":2, \"a\":1}", true); // Member order insensitive
- TEST_HASHER("{}", "null", false);
- TEST_HASHER("{}", "false", false);
- TEST_HASHER("{}", "true", false);
- TEST_HASHER("{}", "0", false);
- TEST_HASHER("{}", "0.0", false);
- TEST_HASHER("{}", "\"\"", false);
-}
-
-// Test cases following http://spacetelescope.github.io/understanding-json-schema
-
-#define VALIDATE(schema, json, expected) \
-{\
- VALIDATE_(schema, json, expected, true) \
-}
-
-#define VALIDATE_(schema, json, expected, expected2) \
-{\
- EXPECT_TRUE(expected2 == schema.GetError().ObjectEmpty());\
- EXPECT_TRUE(schema.IsSupportedSpecification());\
- SchemaValidator validator(schema);\
- Document d;\
- /*printf("\n%s\n", json);*/\
- d.Parse(json);\
- EXPECT_FALSE(d.HasParseError());\
- EXPECT_TRUE(expected == d.Accept(validator));\
- EXPECT_TRUE(expected == validator.IsValid());\
- ValidateErrorCode code = validator.GetInvalidSchemaCode();\
- if (expected) {\
- EXPECT_TRUE(code == kValidateErrorNone);\
- EXPECT_TRUE(validator.GetInvalidSchemaKeyword() == 0);\
- }\
- if ((expected) && !validator.IsValid()) {\
- StringBuffer sb;\
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);\
- printf("Invalid schema: %s\n", sb.GetString());\
- printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());\
- printf("Invalid code: %d\n", code);\
- printf("Invalid message: %s\n", GetValidateError_En(code));\
- sb.Clear();\
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);\
- printf("Invalid document: %s\n", sb.GetString());\
- sb.Clear();\
- Writer<StringBuffer> w(sb);\
- validator.GetError().Accept(w);\
- printf("Validation error: %s\n", sb.GetString());\
- }\
-}
-
-#define INVALIDATE(schema, json, invalidSchemaPointer, invalidSchemaKeyword, invalidDocumentPointer, error) \
-{\
- INVALIDATE_(schema, json, invalidSchemaPointer, invalidSchemaKeyword, invalidDocumentPointer, error, kValidateDefaultFlags, SchemaValidator, Pointer) \
-}
-
-#define INVALIDATE_(schema, json, invalidSchemaPointer, invalidSchemaKeyword, invalidDocumentPointer, error, \
- flags, SchemaValidatorType, PointerType) \
-{\
- EXPECT_TRUE(schema.GetError().ObjectEmpty());\
- EXPECT_TRUE(schema.IsSupportedSpecification());\
- SchemaValidatorType validator(schema);\
- validator.SetValidateFlags(flags);\
- Document d;\
- /*printf("\n%s\n", json);*/\
- d.Parse(json);\
- EXPECT_FALSE(d.HasParseError());\
- d.Accept(validator);\
- EXPECT_FALSE(validator.IsValid());\
- ValidateErrorCode code = validator.GetInvalidSchemaCode();\
- ASSERT_TRUE(code != kValidateErrorNone);\
- ASSERT_TRUE(strcmp(GetValidateError_En(code), "Unknown error.") != 0);\
- if (validator.GetInvalidSchemaPointer() != PointerType(invalidSchemaPointer)) {\
- StringBuffer sb;\
- validator.GetInvalidSchemaPointer().Stringify(sb);\
- printf("GetInvalidSchemaPointer() Expected: %s Actual: %s\n", invalidSchemaPointer, sb.GetString());\
- ADD_FAILURE();\
- }\
- ASSERT_TRUE(validator.GetInvalidSchemaKeyword() != 0);\
- if (strcmp(validator.GetInvalidSchemaKeyword(), invalidSchemaKeyword) != 0) {\
- printf("GetInvalidSchemaKeyword() Expected: %s Actual %s\n", invalidSchemaKeyword, validator.GetInvalidSchemaKeyword());\
- ADD_FAILURE();\
- }\
- if (validator.GetInvalidDocumentPointer() != PointerType(invalidDocumentPointer)) {\
- StringBuffer sb;\
- validator.GetInvalidDocumentPointer().Stringify(sb);\
- printf("GetInvalidDocumentPointer() Expected: %s Actual: %s\n", invalidDocumentPointer, sb.GetString());\
- ADD_FAILURE();\
- }\
- Document e;\
- e.Parse(error);\
- if (validator.GetError() != e) {\
- StringBuffer sb;\
- Writer<StringBuffer> w(sb);\
- validator.GetError().Accept(w);\
- printf("GetError() Expected: %s Actual: %s\n", error, sb.GetString());\
- ADD_FAILURE();\
- }\
-}
-
-// Use for checking whether a compiled schema document contains errors
-#define SCHEMAERROR(schema, error) \
-{\
- Document e;\
- e.Parse(error);\
- if (schema.GetError() != e) {\
- StringBuffer sb;\
- Writer<StringBuffer> w(sb);\
- schema.GetError().Accept(w);\
- printf("GetError() Expected: %s Actual: %s\n", error, sb.GetString());\
- ADD_FAILURE();\
- }\
-}
-
-TEST(SchemaValidator, Typeless) {
- Document sd;
- sd.Parse("{}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "42", true);
- VALIDATE(s, "\"I'm a string\"", true);
- VALIDATE(s, "{ \"an\": [ \"arbitrarily\", \"nested\" ], \"data\": \"structure\" }", true);
-}
-
-TEST(SchemaValidator, MultiType) {
- Document sd;
- sd.Parse("{ \"type\": [\"number\", \"string\"] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "42", true);
- VALIDATE(s, "\"Life, the universe, and everything\"", true);
- INVALIDATE(s, "[\"Life\", \"the universe\", \"and everything\"]", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\", \"number\"], \"actual\": \"array\""
- "}}");
-}
-
-TEST(SchemaValidator, Enum_Typed) {
- Document sd;
- sd.Parse("{ \"type\": \"string\", \"enum\" : [\"red\", \"amber\", \"green\"] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"red\"", true);
- INVALIDATE(s, "\"blue\"", "", "enum", "",
- "{ \"enum\": { \"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#\" }}");
-}
-
-TEST(SchemaValidator, Enum_Typeless) {
- Document sd;
- sd.Parse("{ \"enum\": [\"red\", \"amber\", \"green\", null, 42] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"red\"", true);
- VALIDATE(s, "null", true);
- VALIDATE(s, "42", true);
- INVALIDATE(s, "0", "", "enum", "",
- "{ \"enum\": { \"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#\" }}");
-}
-
-TEST(SchemaValidator, Enum_InvalidType) {
- Document sd;
- sd.Parse("{ \"type\": \"string\", \"enum\": [\"red\", \"amber\", \"green\", null] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"red\"", true);
- INVALIDATE(s, "null", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"null\""
- "}}");
-}
-
-TEST(SchemaValidator, AllOf) {
- {
- Document sd;
- sd.Parse("{\"allOf\": [{ \"type\": \"string\" }, { \"type\": \"string\", \"maxLength\": 5 }]}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"ok\"", true);
- INVALIDATE(s, "\"too long\"", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {},"
- " {\"maxLength\": {\"errorCode\": 6, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/1\", \"expected\": 5, \"actual\": \"too long\"}}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- "}}");
- }
- {
- Document sd;
- sd.Parse("{\"allOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" } ] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"No way\"", false);
- INVALIDATE(s, "-1", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {\"type\": { \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/0\", \"errorCode\": 20, \"expected\": [\"string\"], \"actual\": \"integer\"}},"
- " {}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- "}}");
- }
-}
-
-TEST(SchemaValidator, AnyOf) {
- Document sd;
- sd.Parse("{\"anyOf\": [{ \"type\": \"string\" }, { \"type\": \"number\" } ] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"Yes\"", true);
- VALIDATE(s, "42", true);
- INVALIDATE(s, "{ \"Not a\": \"string or number\" }", "", "anyOf", "",
- "{ \"anyOf\": {"
- " \"errorCode\": 24,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\", "
- " \"errors\": ["
- " { \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/anyOf/0\","
- " \"expected\": [\"string\"], \"actual\": \"object\""
- " }},"
- " { \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/anyOf/1\","
- " \"expected\": [\"number\"], \"actual\": \"object\""
- " }}"
- " ]"
- "}}");
-}
-
-TEST(SchemaValidator, OneOf) {
- Document sd;
- sd.Parse("{\"oneOf\": [{ \"type\": \"number\", \"multipleOf\": 5 }, { \"type\": \"number\", \"multipleOf\": 3 } ] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "10", true);
- VALIDATE(s, "9", true);
- INVALIDATE(s, "2", "", "oneOf", "",
- "{ \"oneOf\": {"
- " \"errorCode\": 21,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"errors\": ["
- " { \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/oneOf/0\","
- " \"expected\": 5, \"actual\": 2"
- " }},"
- " { \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/oneOf/1\","
- " \"expected\": 3, \"actual\": 2"
- " }}"
- " ]"
- "}}");
- INVALIDATE(s, "15", "", "oneOf", "",
- "{ \"oneOf\": { \"errorCode\": 22, \"instanceRef\": \"#\", \"schemaRef\": \"#\", \"matches\": [0,1]}}");
-}
-
-TEST(SchemaValidator, Not) {
- Document sd;
- sd.Parse("{\"not\":{ \"type\": \"string\"}}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "42", true);
- VALIDATE(s, "{ \"key\": \"value\" }", true);
- INVALIDATE(s, "\"I am a string\"", "", "not", "",
- "{ \"not\": { \"errorCode\": 25, \"instanceRef\": \"#\", \"schemaRef\": \"#\" }}");
-}
-
-TEST(SchemaValidator, Ref) {
- Document sd;
- sd.Parse(
- "{"
- " \"$schema\": \"http://json-schema.org/draft-04/schema#\","
- ""
- " \"definitions\": {"
- " \"address\": {"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"street_address\": { \"type\": \"string\" },"
- " \"city\": { \"type\": \"string\" },"
- " \"state\": { \"type\": \"string\" }"
- " },"
- " \"required\": [\"street_address\", \"city\", \"state\"]"
- " }"
- " },"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"billing_address\": { \"$ref\": \"#/definitions/address\" },"
- " \"shipping_address\": { \"$ref\": \"#/definitions/address\" }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\"}, \"billing_address\": {\"street_address\": \"1st Street SE\", \"city\": \"Washington\", \"state\": \"DC\"} }", true);
-}
-
-TEST(SchemaValidator, Ref_AllOf) {
- Document sd;
- sd.Parse(
- "{"
- " \"$schema\": \"http://json-schema.org/draft-04/schema#\","
- ""
- " \"definitions\": {"
- " \"address\": {"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"street_address\": { \"type\": \"string\" },"
- " \"city\": { \"type\": \"string\" },"
- " \"state\": { \"type\": \"string\" }"
- " },"
- " \"required\": [\"street_address\", \"city\", \"state\"]"
- " }"
- " },"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"billing_address\": { \"$ref\": \"#/definitions/address\" },"
- " \"shipping_address\": {"
- " \"allOf\": ["
- " { \"$ref\": \"#/definitions/address\" },"
- " { \"properties\":"
- " { \"type\": { \"enum\": [ \"residential\", \"business\" ] } },"
- " \"required\": [\"type\"]"
- " }"
- " ]"
- " }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\"} }", "/properties/shipping_address", "allOf", "/shipping_address",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {},"
- " {\"required\": {\"errorCode\": 15, \"instanceRef\": \"#/shipping_address\", \"schemaRef\": \"#/properties/shipping_address/allOf/1\", \"missing\": [\"type\"]}}"
- " ],"
- " \"errorCode\":23,\"instanceRef\":\"#/shipping_address\",\"schemaRef\":\"#/properties/shipping_address\""
- "}}");
- VALIDATE(s, "{\"shipping_address\": {\"street_address\": \"1600 Pennsylvania Avenue NW\", \"city\": \"Washington\", \"state\": \"DC\", \"type\": \"business\"} }", true);
-}
-
-TEST(SchemaValidator, String) {
- Document sd;
- sd.Parse("{\"type\":\"string\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"I'm a string\"", true);
- INVALIDATE(s, "42", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}");
- INVALIDATE(s, "2147483648", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}"); // 2^31 can only be fit in unsigned
- INVALIDATE(s, "-2147483649", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}"); // -2^31 - 1 can only be fit in int64_t
- INVALIDATE(s, "4294967296", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}"); // 2^32 can only be fit in int64_t
- INVALIDATE(s, "3.1415926", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"number\""
- "}}");
-}
-
-TEST(SchemaValidator, String_LengthRange) {
- Document sd;
- sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "\"A\"", "", "minLength", "",
- "{ \"minLength\": {"
- " \"errorCode\": 7,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 2, \"actual\": \"A\""
- "}}");
- VALIDATE(s, "\"AB\"", true);
- VALIDATE(s, "\"ABC\"", true);
- INVALIDATE(s, "\"ABCD\"", "", "maxLength", "",
- "{ \"maxLength\": {"
- " \"errorCode\": 6,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 3, \"actual\": \"ABCD\""
- "}}");
-}
-
-#if RAPIDJSON_SCHEMA_HAS_REGEX
-TEST(SchemaValidator, String_Pattern) {
- Document sd;
- sd.Parse("{\"type\":\"string\",\"pattern\":\"^(\\\\([0-9]{3}\\\\))?[0-9]{3}-[0-9]{4}$\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"555-1212\"", true);
- VALIDATE(s, "\"(888)555-1212\"", true);
- INVALIDATE(s, "\"(888)555-1212 ext. 532\"", "", "pattern", "",
- "{ \"pattern\": {"
- " \"errorCode\": 8,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"actual\": \"(888)555-1212 ext. 532\""
- "}}");
- INVALIDATE(s, "\"(800)FLOWERS\"", "", "pattern", "",
- "{ \"pattern\": {"
- " \"errorCode\": 8,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"actual\": \"(800)FLOWERS\""
- "}}");
-}
-
-TEST(SchemaValidator, String_Pattern_Invalid) {
- Document sd;
- sd.Parse("{\"type\":\"string\",\"pattern\":\"a{0}\"}");
- SchemaDocument s(sd);
- SCHEMAERROR(s, "{\"RegexInvalid\":{\"errorCode\":9,\"instanceRef\":\"#/pattern\",\"value\":\"a{0}\"}}");
-
- VALIDATE_(s, "\"\"", true, false);
- VALIDATE_(s, "\"a\"", true, false);
- VALIDATE_(s, "\"aa\"", true, false);
-}
-#endif
-
-TEST(SchemaValidator, Integer) {
- Document sd;
- sd.Parse("{\"type\":\"integer\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "42", true);
- VALIDATE(s, "-1", true);
- VALIDATE(s, "2147483648", true); // 2^31 can only be fit in unsigned
- VALIDATE(s, "-2147483649", true); // -2^31 - 1 can only be fit in int64_t
- VALIDATE(s, "2147483648", true); // 2^31 can only be fit in unsigned
- VALIDATE(s, "4294967296", true); // 2^32 can only be fit in int64_t
- INVALIDATE(s, "3.1415926", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"integer\"], \"actual\": \"number\""
- "}}");
- INVALIDATE(s, "\"42\"", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"integer\"], \"actual\": \"string\""
- "}}");
-}
-
-TEST(SchemaValidator, Integer_Range) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"minimum\":0,\"maximum\":100,\"exclusiveMaximum\":true}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-1", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 0, \"actual\": -1"
- "}}");
- VALIDATE(s, "0", true);
- VALIDATE(s, "10", true);
- VALIDATE(s, "99", true);
- INVALIDATE(s, "100", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100, \"exclusiveMaximum\": true, \"actual\": 100"
- "}}");
- INVALIDATE(s, "101", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100, \"exclusiveMaximum\": true, \"actual\": 101"
- "}}");
-}
-
-TEST(SchemaValidator, Integer_Range64Boundary) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"minimum\":-9223372036854775807,\"maximum\":9223372036854775806}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-9223372036854775808", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -9223372036854775807, \"actual\": -9223372036854775808"
- "}}");
- VALIDATE(s, "-9223372036854775807", true);
- VALIDATE(s, "-2147483648", true); // int min
- VALIDATE(s, "0", true);
- VALIDATE(s, "2147483647", true); // int max
- VALIDATE(s, "2147483648", true); // unsigned first
- VALIDATE(s, "4294967295", true); // unsigned max
- VALIDATE(s, "9223372036854775806", true);
- INVALIDATE(s, "9223372036854775807", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 2,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775806, \"actual\": 9223372036854775807"
- "}}");
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 2,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775806, \"actual\": 18446744073709551615"
- "}}"); // uint64_t max
-}
-
-TEST(SchemaValidator, Integer_RangeU64Boundary) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"minimum\":9223372036854775808,\"maximum\":18446744073709551614}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-9223372036854775808", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": -9223372036854775808"
- "}}");
- INVALIDATE(s, "9223372036854775807", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": 9223372036854775807"
- "}}");
- INVALIDATE(s, "-2147483648", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": -2147483648"
- "}}"); // int min
- INVALIDATE(s, "0", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": 0"
- "}}");
- INVALIDATE(s, "2147483647", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": 2147483647"
- "}}"); // int max
- INVALIDATE(s, "2147483648", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": 2147483648"
- "}}"); // unsigned first
- INVALIDATE(s, "4294967295", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808, \"actual\": 4294967295"
- "}}"); // unsigned max
- VALIDATE(s, "9223372036854775808", true);
- VALIDATE(s, "18446744073709551614", true);
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 2,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 18446744073709551614, \"actual\": 18446744073709551615"
- "}}");
-}
-
-TEST(SchemaValidator, Integer_Range64BoundaryExclusive) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"minimum\":-9223372036854775808,\"maximum\":18446744073709551615,\"exclusiveMinimum\":true,\"exclusiveMaximum\":true}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-9223372036854775808", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 5,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -9223372036854775808, \"exclusiveMinimum\": true, "
- " \"actual\": -9223372036854775808"
- "}}");
- VALIDATE(s, "-9223372036854775807", true);
- VALIDATE(s, "18446744073709551614", true);
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 18446744073709551615, \"exclusiveMaximum\": true, "
- " \"actual\": 18446744073709551615"
- "}}");
-}
-
-TEST(SchemaValidator, Integer_MultipleOf) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"multipleOf\":10}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "0", true);
- VALIDATE(s, "10", true);
- VALIDATE(s, "-10", true);
- VALIDATE(s, "20", true);
- INVALIDATE(s, "23", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10, \"actual\": 23"
- "}}");
- INVALIDATE(s, "-23", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10, \"actual\": -23"
- "}}");
-}
-
-TEST(SchemaValidator, Integer_MultipleOf64Boundary) {
- Document sd;
- sd.Parse("{\"type\":\"integer\",\"multipleOf\":18446744073709551615}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "0", true);
- VALIDATE(s, "18446744073709551615", true);
- INVALIDATE(s, "18446744073709551614", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 18446744073709551615, \"actual\": 18446744073709551614"
- "}}");
-}
-
-TEST(SchemaValidator, Number_Range) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"minimum\":0,\"maximum\":100,\"exclusiveMaximum\":true}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-1", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 0, \"actual\": -1"
- "}}");
- VALIDATE(s, "0", true);
- VALIDATE(s, "0.1", true);
- VALIDATE(s, "10", true);
- VALIDATE(s, "99", true);
- VALIDATE(s, "99.9", true);
- INVALIDATE(s, "100", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100, \"exclusiveMaximum\": true, \"actual\": 100"
- "}}");
- INVALIDATE(s, "100.0", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100, \"exclusiveMaximum\": true, \"actual\": 100.0"
- "}}");
- INVALIDATE(s, "101.5", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100, \"exclusiveMaximum\": true, \"actual\": 101.5"
- "}}");
-}
-
-TEST(SchemaValidator, Number_RangeInt) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"minimum\":-100,\"maximum\":-1,\"exclusiveMaximum\":true}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-101", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -100, \"actual\": -101"
- "}}");
- INVALIDATE(s, "-100.1", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -100, \"actual\": -100.1"
- "}}");
- VALIDATE(s, "-100", true);
- VALIDATE(s, "-2", true);
- INVALIDATE(s, "-1", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": -1"
- "}}");
- INVALIDATE(s, "-0.9", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": -0.9"
- "}}");
- INVALIDATE(s, "0", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 0"
- "}}");
- INVALIDATE(s, "2147483647", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 2147483647"
- "}}"); // int max
- INVALIDATE(s, "2147483648", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 2147483648"
- "}}"); // unsigned first
- INVALIDATE(s, "4294967295", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 4294967295"
- "}}"); // unsigned max
- INVALIDATE(s, "9223372036854775808", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 9223372036854775808"
- "}}");
- INVALIDATE(s, "18446744073709551614", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551614"
- "}}");
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": -1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551615"
- "}}");
-}
-
-TEST(SchemaValidator, Number_RangeDouble) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"minimum\":0.1,\"maximum\":100.1,\"exclusiveMaximum\":true}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-9223372036854775808", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 0.1, \"actual\": -9223372036854775808"
- "}}");
- INVALIDATE(s, "-2147483648", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 0.1, \"actual\": -2147483648"
- "}}"); // int min
- INVALIDATE(s, "-1", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 0.1, \"actual\": -1"
- "}}");
- VALIDATE(s, "0.1", true);
- VALIDATE(s, "10", true);
- VALIDATE(s, "99", true);
- VALIDATE(s, "100", true);
- INVALIDATE(s, "101", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 101"
- "}}");
- INVALIDATE(s, "101.5", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 101.5"
- "}}");
- INVALIDATE(s, "18446744073709551614", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551614"
- "}}");
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551615"
- "}}");
- INVALIDATE(s, "2147483647", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 2147483647"
- "}}"); // int max
- INVALIDATE(s, "2147483648", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 2147483648"
- "}}"); // unsigned first
- INVALIDATE(s, "4294967295", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 4294967295"
- "}}"); // unsigned max
- INVALIDATE(s, "9223372036854775808", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 9223372036854775808"
- "}}");
- INVALIDATE(s, "18446744073709551614", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551614"
- "}}");
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 3,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 100.1, \"exclusiveMaximum\": true, \"actual\": 18446744073709551615"
- "}}");
-}
-
-TEST(SchemaValidator, Number_RangeDoubleU64Boundary) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"minimum\":9223372036854775808.0,\"maximum\":18446744073709550000.0}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "-9223372036854775808", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": -9223372036854775808"
- "}}");
- INVALIDATE(s, "-2147483648", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": -2147483648"
- "}}"); // int min
- INVALIDATE(s, "0", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": 0"
- "}}");
- INVALIDATE(s, "2147483647", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": 2147483647"
- "}}"); // int max
- INVALIDATE(s, "2147483648", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": 2147483648"
- "}}"); // unsigned first
- INVALIDATE(s, "4294967295", "", "minimum", "",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 9223372036854775808.0, \"actual\": 4294967295"
- "}}"); // unsigned max
- VALIDATE(s, "9223372036854775808", true);
- VALIDATE(s, "18446744073709540000", true);
- INVALIDATE(s, "18446744073709551615", "", "maximum", "",
- "{ \"maximum\": {"
- " \"errorCode\": 2,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 18446744073709550000.0, \"actual\": 18446744073709551615"
- "}}");
-}
-
-TEST(SchemaValidator, Number_MultipleOf) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"multipleOf\":10.0}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "0", true);
- VALIDATE(s, "10", true);
- VALIDATE(s, "-10", true);
- VALIDATE(s, "20", true);
- INVALIDATE(s, "23", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10.0, \"actual\": 23"
- "}}");
- INVALIDATE(s, "-2147483648", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10.0, \"actual\": -2147483648"
- "}}"); // int min
- VALIDATE(s, "-2147483640", true);
- INVALIDATE(s, "2147483647", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10.0, \"actual\": 2147483647"
- "}}"); // int max
- INVALIDATE(s, "2147483648", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10.0, \"actual\": 2147483648"
- "}}"); // unsigned first
- VALIDATE(s, "2147483650", true);
- INVALIDATE(s, "4294967295", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 10.0, \"actual\": 4294967295"
- "}}"); // unsigned max
- VALIDATE(s, "4294967300", true);
-}
-
-TEST(SchemaValidator, Number_MultipleOfOne) {
- Document sd;
- sd.Parse("{\"type\":\"number\",\"multipleOf\":1}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "42", true);
- VALIDATE(s, "42.0", true);
- INVALIDATE(s, "3.1415926", "", "multipleOf", "",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 1, \"actual\": 3.1415926"
- "}}");
-}
-
-TEST(SchemaValidator, Object) {
- Document sd;
- sd.Parse("{\"type\":\"object\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{\"key\":\"value\",\"another_key\":\"another_value\"}", true);
- VALIDATE(s, "{\"Sun\":1.9891e30,\"Jupiter\":1.8986e27,\"Saturn\":5.6846e26,\"Neptune\":10.243e25,\"Uranus\":8.6810e25,\"Earth\":5.9736e24,\"Venus\":4.8685e24,\"Mars\":6.4185e23,\"Mercury\":3.3022e23,\"Moon\":7.349e22,\"Pluto\":1.25e22}", true);
- INVALIDATE(s, "[\"An\", \"array\", \"not\", \"an\", \"object\"]", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"object\"], \"actual\": \"array\""
- "}}");
- INVALIDATE(s, "\"Not an object\"", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"object\"], \"actual\": \"string\""
- "}}");
-}
-
-TEST(SchemaValidator, Object_Properties) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"number\": { \"type\": \"number\" },"
- " \"street_name\" : { \"type\": \"string\" },"
- " \"street_type\" : { \"type\": \"string\", \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"] }"
- " }"
- "}");
-
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
- INVALIDATE(s, "{ \"number\": \"1600\", \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", "/properties/number", "type", "/number",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/number\", \"schemaRef\": \"#/properties/number\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}");
- INVALIDATE(s, "{ \"number\": \"One\", \"street_name\": \"Microsoft\", \"street_type\": \"Way\" }",
- "/properties/number", "type", "/number",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/number\", \"schemaRef\": \"#/properties/number\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}"); // fail fast
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\" }", true);
- VALIDATE(s, "{}", true);
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", true);
-}
-
-TEST(SchemaValidator, Object_AdditionalPropertiesBoolean) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"number\": { \"type\": \"number\" },"
- " \"street_name\" : { \"type\": \"string\" },"
- " \"street_type\" : { \"type\": \"string\","
- " \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"]"
- " }"
- " },"
- " \"additionalProperties\": false"
- "}");
-
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
- INVALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", "", "additionalProperties", "/direction",
- "{ \"additionalProperties\": {"
- " \"errorCode\": 16,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"disallowed\": \"direction\""
- "}}");
-}
-
-TEST(SchemaValidator, Object_AdditionalPropertiesObject) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"number\": { \"type\": \"number\" },"
- " \"street_name\" : { \"type\": \"string\" },"
- " \"street_type\" : { \"type\": \"string\","
- " \"enum\" : [\"Street\", \"Avenue\", \"Boulevard\"]"
- " }"
- " },"
- " \"additionalProperties\": { \"type\": \"string\" }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\" }", true);
- VALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"direction\": \"NW\" }", true);
- INVALIDATE(s, "{ \"number\": 1600, \"street_name\": \"Pennsylvania\", \"street_type\": \"Avenue\", \"office_number\": 201 }", "/additionalProperties", "type", "/office_number",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/office_number\", \"schemaRef\": \"#/additionalProperties\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}");
-}
-
-TEST(SchemaValidator, Object_Required) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"name\": { \"type\": \"string\" },"
- " \"email\" : { \"type\": \"string\" },"
- " \"address\" : { \"type\": \"string\" },"
- " \"telephone\" : { \"type\": \"string\" }"
- " },"
- " \"required\":[\"name\", \"email\"]"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"name\": \"William Shakespeare\", \"email\" : \"bill@stratford-upon-avon.co.uk\" }", true);
- VALIDATE(s, "{ \"name\": \"William Shakespeare\", \"email\" : \"bill@stratford-upon-avon.co.uk\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\", \"authorship\" : \"in question\"}", true);
- INVALIDATE(s, "{ \"name\": \"William Shakespeare\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\" }", "", "required", "",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"missing\": [\"email\"]"
- "}}");
- INVALIDATE(s, "{}", "", "required", "",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"missing\": [\"name\", \"email\"]"
- "}}");
-}
-
-TEST(SchemaValidator, Object_Required_PassWithDefault) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"name\": { \"type\": \"string\", \"default\": \"William Shakespeare\" },"
- " \"email\" : { \"type\": \"string\", \"default\": \"\" },"
- " \"address\" : { \"type\": \"string\" },"
- " \"telephone\" : { \"type\": \"string\" }"
- " },"
- " \"required\":[\"name\", \"email\"]"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"email\" : \"bill@stratford-upon-avon.co.uk\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\", \"authorship\" : \"in question\"}", true);
- INVALIDATE(s, "{ \"name\": \"William Shakespeare\", \"address\" : \"Henley Street, Stratford-upon-Avon, Warwickshire, England\" }", "", "required", "",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"missing\": [\"email\"]"
- "}}");
- INVALIDATE(s, "{}", "", "required", "",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"missing\": [\"email\"]"
- "}}");
-}
-
-TEST(SchemaValidator, Object_PropertiesRange) {
- Document sd;
- sd.Parse("{\"type\":\"object\", \"minProperties\":2, \"maxProperties\":3}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "{}", "", "minProperties", "",
- "{ \"minProperties\": {"
- " \"errorCode\": 14,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 2, \"actual\": 0"
- "}}");
- INVALIDATE(s, "{\"a\":0}", "", "minProperties", "",
- "{ \"minProperties\": {"
- " \"errorCode\": 14,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 2, \"actual\": 1"
- "}}");
- VALIDATE(s, "{\"a\":0,\"b\":1}", true);
- VALIDATE(s, "{\"a\":0,\"b\":1,\"c\":2}", true);
- INVALIDATE(s, "{\"a\":0,\"b\":1,\"c\":2,\"d\":3}", "", "maxProperties", "",
- "{ \"maxProperties\": {"
- " \"errorCode\": 13,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\", "
- " \"expected\": 3, \"actual\": 4"
- "}}");
-}
-
-TEST(SchemaValidator, Object_PropertyDependencies) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"name\": { \"type\": \"string\" },"
- " \"credit_card\": { \"type\": \"number\" },"
- " \"cvv_code\": { \"type\": \"number\" },"
- " \"billing_address\": { \"type\": \"string\" }"
- " },"
- " \"required\": [\"name\"],"
- " \"dependencies\": {"
- " \"credit_card\": [\"cvv_code\", \"billing_address\"]"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"name\": \"John Doe\", \"credit_card\": 5555555555555555, \"cvv_code\": 777, "
- "\"billing_address\": \"555 Debtor's Lane\" }", true);
- INVALIDATE(s, "{ \"name\": \"John Doe\", \"credit_card\": 5555555555555555 }", "", "dependencies", "",
- "{ \"dependencies\": {"
- " \"errorCode\": 18,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"errors\": {"
- " \"credit_card\": {"
- " \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/credit_card\","
- " \"missing\": [\"cvv_code\", \"billing_address\"]"
- " } } }"
- "}}");
- VALIDATE(s, "{ \"name\": \"John Doe\"}", true);
- VALIDATE(s, "{ \"name\": \"John Doe\", \"cvv_code\": 777, \"billing_address\": \"555 Debtor's Lane\" }", true);
-}
-
-TEST(SchemaValidator, Object_SchemaDependencies) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\" : {"
- " \"name\": { \"type\": \"string\" },"
- " \"credit_card\" : { \"type\": \"number\" }"
- " },"
- " \"required\" : [\"name\"],"
- " \"dependencies\" : {"
- " \"credit_card\": {"
- " \"properties\": {"
- " \"billing_address\": { \"type\": \"string\" }"
- " },"
- " \"required\" : [\"billing_address\"]"
- " }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{\"name\": \"John Doe\", \"credit_card\" : 5555555555555555,\"billing_address\" : \"555 Debtor's Lane\"}", true);
- INVALIDATE(s, "{\"name\": \"John Doe\", \"credit_card\" : 5555555555555555 }", "", "dependencies", "",
- "{ \"dependencies\": {"
- " \"errorCode\": 18,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"errors\": {"
- " \"credit_card\": {"
- " \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/credit_card\","
- " \"missing\": [\"billing_address\"]"
- " } } }"
- "}}");
- VALIDATE(s, "{\"name\": \"John Doe\", \"billing_address\" : \"555 Debtor's Lane\"}", true);
-}
-
-#if RAPIDJSON_SCHEMA_HAS_REGEX
-TEST(SchemaValidator, Object_PatternProperties) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"patternProperties\": {"
- " \"^S_\": { \"type\": \"string\" },"
- " \"^I_\": { \"type\": \"integer\" }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"S_25\": \"This is a string\" }", true);
- VALIDATE(s, "{ \"I_0\": 42 }", true);
- INVALIDATE(s, "{ \"S_0\": 42 }", "", "patternProperties", "/S_0",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/S_0\", \"schemaRef\": \"#/patternProperties/%5ES_\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}");
- INVALIDATE(s, "{ \"I_42\": \"This is a string\" }", "", "patternProperties", "/I_42",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/I_42\", \"schemaRef\": \"#/patternProperties/%5EI_\","
- " \"expected\": [\"integer\"], \"actual\": \"string\""
- "}}");
- VALIDATE(s, "{ \"keyword\": \"value\" }", true);
-}
-
-TEST(SchemaValidator, Object_PatternProperties_ErrorConflict) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"patternProperties\": {"
- " \"^I_\": { \"multipleOf\": 5 },"
- " \"30$\": { \"multipleOf\": 6 }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"I_30\": 30 }", true);
- INVALIDATE(s, "{ \"I_30\": 7 }", "", "patternProperties", "/I_30",
- "{ \"multipleOf\": ["
- " {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#/I_30\", \"schemaRef\": \"#/patternProperties/%5EI_\","
- " \"expected\": 5, \"actual\": 7"
- " }, {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#/I_30\", \"schemaRef\": \"#/patternProperties/30%24\","
- " \"expected\": 6, \"actual\": 7"
- " }"
- "]}");
-}
-
-TEST(SchemaValidator, Object_Properties_PatternProperties) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"I_42\": { \"type\": \"integer\", \"minimum\": 73 }"
- " },"
- " \"patternProperties\": {"
- " \"^I_\": { \"type\": \"integer\", \"multipleOf\": 6 }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"I_6\": 6 }", true);
- VALIDATE(s, "{ \"I_42\": 78 }", true);
- INVALIDATE(s, "{ \"I_42\": 42 }", "", "patternProperties", "/I_42",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#/I_42\", \"schemaRef\": \"#/properties/I_42\","
- " \"expected\": 73, \"actual\": 42"
- "}}");
- INVALIDATE(s, "{ \"I_42\": 7 }", "", "patternProperties", "/I_42",
- "{ \"minimum\": {"
- " \"errorCode\": 4,"
- " \"instanceRef\": \"#/I_42\", \"schemaRef\": \"#/properties/I_42\","
- " \"expected\": 73, \"actual\": 7"
- " },"
- " \"multipleOf\": {"
- " \"errorCode\": 1,"
- " \"instanceRef\": \"#/I_42\", \"schemaRef\": \"#/patternProperties/%5EI_\","
- " \"expected\": 6, \"actual\": 7"
- " }"
- "}");
-}
-
-TEST(SchemaValidator, Object_PatternProperties_AdditionalPropertiesObject) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"builtin\": { \"type\": \"number\" }"
- " },"
- " \"patternProperties\": {"
- " \"^S_\": { \"type\": \"string\" },"
- " \"^I_\": { \"type\": \"integer\" }"
- " },"
- " \"additionalProperties\": { \"type\": \"string\" }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"builtin\": 42 }", true);
- VALIDATE(s, "{ \"keyword\": \"value\" }", true);
- INVALIDATE(s, "{ \"keyword\": 42 }", "/additionalProperties", "type", "/keyword",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/keyword\", \"schemaRef\": \"#/additionalProperties\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}");
-}
-
-// Replaces test Issue285 and tests failure as well as success
-TEST(SchemaValidator, Object_PatternProperties_AdditionalPropertiesBoolean) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"patternProperties\": {"
- " \"^S_\": { \"type\": \"string\" },"
- " \"^I_\": { \"type\": \"integer\" }"
- " },"
- " \"additionalProperties\": false"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"S_25\": \"This is a string\" }", true);
- VALIDATE(s, "{ \"I_0\": 42 }", true);
- INVALIDATE(s, "{ \"keyword\": \"value\" }", "", "additionalProperties", "/keyword",
- "{ \"additionalProperties\": {"
- " \"errorCode\": 16,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"disallowed\": \"keyword\""
- "}}");
-}
-#endif
-
-TEST(SchemaValidator, Array) {
- Document sd;
- sd.Parse("{\"type\":\"array\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[1, 2, 3, 4, 5]", true);
- VALIDATE(s, "[3, \"different\", { \"types\" : \"of values\" }]", true);
- INVALIDATE(s, "{\"Not\": \"an array\"}", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"array\"], \"actual\": \"object\""
- "}}");
-}
-
-TEST(SchemaValidator, Array_ItemsList) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"array\","
- " \"items\" : {"
- " \"type\": \"number\""
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[1, 2, 3, 4, 5]", true);
- INVALIDATE(s, "[1, 2, \"3\", 4, 5]", "/items", "type", "/2",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/2\", \"schemaRef\": \"#/items\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}");
- VALIDATE(s, "[]", true);
-}
-
-TEST(SchemaValidator, Array_ItemsTuple) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"array\","
- " \"items\": ["
- " {"
- " \"type\": \"number\""
- " },"
- " {"
- " \"type\": \"string\""
- " },"
- " {"
- " \"type\": \"string\","
- " \"enum\": [\"Street\", \"Avenue\", \"Boulevard\"]"
- " },"
- " {"
- " \"type\": \"string\","
- " \"enum\": [\"NW\", \"NE\", \"SW\", \"SE\"]"
- " }"
- " ]"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\"]", true);
- INVALIDATE(s, "[24, \"Sussex\", \"Drive\"]", "/items/2", "enum", "/2",
- "{ \"enum\": { \"errorCode\": 19, \"instanceRef\": \"#/2\", \"schemaRef\": \"#/items/2\" }}");
- INVALIDATE(s, "[\"Palais de l'Elysee\"]", "/items/0", "type", "/0",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/0\", \"schemaRef\": \"#/items/0\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}");
- INVALIDATE(s, "[\"Twenty-four\", \"Sussex\", \"Drive\"]", "/items/0", "type", "/0",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/0\", \"schemaRef\": \"#/items/0\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}"); // fail fast
- VALIDATE(s, "[10, \"Downing\", \"Street\"]", true);
- VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\", \"Washington\"]", true);
-}
-
-TEST(SchemaValidator, Array_AdditionalItems) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"array\","
- " \"items\": ["
- " {"
- " \"type\": \"number\""
- " },"
- " {"
- " \"type\": \"string\""
- " },"
- " {"
- " \"type\": \"string\","
- " \"enum\": [\"Street\", \"Avenue\", \"Boulevard\"]"
- " },"
- " {"
- " \"type\": \"string\","
- " \"enum\": [\"NW\", \"NE\", \"SW\", \"SE\"]"
- " }"
- " ],"
- " \"additionalItems\": false"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\"]", true);
- VALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\"]", true);
- INVALIDATE(s, "[1600, \"Pennsylvania\", \"Avenue\", \"NW\", \"Washington\"]", "", "additionalItems", "/4",
- "{ \"additionalItems\": {"
- " \"errorCode\": 12,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"disallowed\": 4"
- "}}");
-}
-
-TEST(SchemaValidator, Array_ItemsRange) {
- Document sd;
- sd.Parse("{\"type\": \"array\",\"minItems\": 2,\"maxItems\" : 3}");
- SchemaDocument s(sd);
-
- INVALIDATE(s, "[]", "", "minItems", "",
- "{ \"minItems\": {"
- " \"errorCode\": 10,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 2, \"actual\": 0"
- "}}");
- INVALIDATE(s, "[1]", "", "minItems", "",
- "{ \"minItems\": {"
- " \"errorCode\": 10,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 2, \"actual\": 1"
- "}}");
- VALIDATE(s, "[1, 2]", true);
- VALIDATE(s, "[1, 2, 3]", true);
- INVALIDATE(s, "[1, 2, 3, 4]", "", "maxItems", "",
- "{ \"maxItems\": {"
- " \"errorCode\": 9,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 3, \"actual\": 4"
- "}}");
-}
-
-TEST(SchemaValidator, Array_UniqueItems) {
- Document sd;
- sd.Parse("{\"type\": \"array\", \"uniqueItems\": true}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[1, 2, 3, 4, 5]", true);
- INVALIDATE(s, "[1, 2, 3, 3, 4]", "", "uniqueItems", "/3",
- "{ \"uniqueItems\": {"
- " \"errorCode\": 11,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"duplicates\": [2, 3]"
- "}}");
- INVALIDATE(s, "[1, 2, 3, 3, 3]", "", "uniqueItems", "/3",
- "{ \"uniqueItems\": {"
- " \"errorCode\": 11,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"duplicates\": [2, 3]"
- "}}"); // fail fast
- VALIDATE(s, "[]", true);
-}
-
-TEST(SchemaValidator, Boolean) {
- Document sd;
- sd.Parse("{\"type\":\"boolean\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "true", true);
- VALIDATE(s, "false", true);
- INVALIDATE(s, "\"true\"", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"boolean\"], \"actual\": \"string\""
- "}}");
- INVALIDATE(s, "0", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"boolean\"], \"actual\": \"integer\""
- "}}");
-}
-
-TEST(SchemaValidator, Null) {
- Document sd;
- sd.Parse("{\"type\":\"null\"}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "null", true);
- INVALIDATE(s, "false", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"null\"], \"actual\": \"boolean\""
- "}}");
- INVALIDATE(s, "0", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"null\"], \"actual\": \"integer\""
- "}}");
- INVALIDATE(s, "\"\"", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"null\"], \"actual\": \"string\""
- "}}");
-}
-
-// Additional tests
-
-TEST(SchemaValidator, ObjectInArray) {
- Document sd;
- sd.Parse("{\"type\":\"array\", \"items\": { \"type\":\"string\" }}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "[\"a\"]", true);
- INVALIDATE(s, "[1]", "/items", "type", "/0",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/0\", \"schemaRef\": \"#/items\","
- " \"expected\": [\"string\"], \"actual\": \"integer\""
- "}}");
- INVALIDATE(s, "[{}]", "/items", "type", "/0",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/0\", \"schemaRef\": \"#/items\","
- " \"expected\": [\"string\"], \"actual\": \"object\""
- "}}");
-}
-
-TEST(SchemaValidator, MultiTypeInObject) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\":\"object\","
- " \"properties\": {"
- " \"tel\" : {"
- " \"type\":[\"integer\", \"string\"]"
- " }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{ \"tel\": 999 }", true);
- VALIDATE(s, "{ \"tel\": \"123-456\" }", true);
- INVALIDATE(s, "{ \"tel\": true }", "/properties/tel", "type", "/tel",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/tel\", \"schemaRef\": \"#/properties/tel\","
- " \"expected\": [\"string\", \"integer\"], \"actual\": \"boolean\""
- "}}");
-}
-
-TEST(SchemaValidator, MultiTypeWithObject) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": [\"object\",\"string\"],"
- " \"properties\": {"
- " \"tel\" : {"
- " \"type\": \"integer\""
- " }"
- " }"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"Hello\"", true);
- VALIDATE(s, "{ \"tel\": 999 }", true);
- INVALIDATE(s, "{ \"tel\": \"fail\" }", "/properties/tel", "type", "/tel",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/tel\", \"schemaRef\": \"#/properties/tel\","
- " \"expected\": [\"integer\"], \"actual\": \"string\""
- "}}");
-}
-
-TEST(SchemaValidator, AllOf_Nested) {
- Document sd;
- sd.Parse(
- "{"
- " \"allOf\": ["
- " { \"type\": \"string\", \"minLength\": 2 },"
- " { \"type\": \"string\", \"maxLength\": 5 },"
- " { \"allOf\": [ { \"enum\" : [\"ok\", \"okay\", \"OK\", \"o\"] }, { \"enum\" : [\"ok\", \"OK\", \"o\"]} ] }"
- " ]"
- "}");
- SchemaDocument s(sd);
-
- VALIDATE(s, "\"ok\"", true);
- VALIDATE(s, "\"OK\"", true);
- INVALIDATE(s, "\"okay\"", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {},{},"
- " { \"allOf\": {"
- " \"errors\": ["
- " {},"
- " { \"enum\": {\"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/1\" }}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2\""
- " }}],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- "}}");
- INVALIDATE(s, "\"o\"", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " { \"minLength\": {\"actual\": \"o\", \"expected\": 2, \"errorCode\": 7, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/0\" }},"
- " {},{}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- "}}");
- INVALIDATE(s, "\"n\"", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " { \"minLength\": {\"actual\": \"n\", \"expected\": 2, \"errorCode\": 7, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/0\" }},"
- " {},"
- " { \"allOf\": {"
- " \"errors\": ["
- " { \"enum\": {\"errorCode\": 19 ,\"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/0\"}},"
- " { \"enum\": {\"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/1\"}}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2\""
- " }}"
- " ],"
- " \"errorCode\":23,\"instanceRef\":\"#\",\"schemaRef\":\"#\""
- "}}");
- INVALIDATE(s, "\"too long\"", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {},"
- " { \"maxLength\": {\"actual\": \"too long\", \"expected\": 5, \"errorCode\": 6, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/1\" }},"
- " { \"allOf\": {"
- " \"errors\": ["
- " { \"enum\": {\"errorCode\": 19 ,\"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/0\"}},"
- " { \"enum\": {\"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/1\"}}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2\""
- " }}"
- " ],"
- " \"errorCode\":23,\"instanceRef\":\"#\",\"schemaRef\":\"#\""
- "}}");
- INVALIDATE(s, "123", "", "allOf", "",
- "{ \"allOf\": {"
- " \"errors\": ["
- " {\"type\": {\"expected\": [\"string\"], \"actual\": \"integer\", \"errorCode\": 20, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/0\"}},"
- " {\"type\": {\"expected\": [\"string\"], \"actual\": \"integer\", \"errorCode\": 20, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/1\"}},"
- " { \"allOf\": {"
- " \"errors\": ["
- " { \"enum\": {\"errorCode\": 19 ,\"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/0\"}},"
- " { \"enum\": {\"errorCode\": 19, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2/allOf/1\"}}"
- " ],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#/allOf/2\""
- " }}"
- " ],"
- " \"errorCode\":23,\"instanceRef\":\"#\",\"schemaRef\":\"#\""
- "}}");
-}
-
-TEST(SchemaValidator, EscapedPointer) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\": \"object\","
- " \"properties\": {"
- " \"~/\": { \"type\": \"number\" }"
- " }"
- "}");
- SchemaDocument s(sd);
- INVALIDATE(s, "{\"~/\":true}", "/properties/~0~1", "type", "/~0~1",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/~0~1\", \"schemaRef\": \"#/properties/~0~1\","
- " \"expected\": [\"number\"], \"actual\": \"boolean\""
- "}}");
-}
-
-TEST(SchemaValidator, SchemaPointer) {
- Document sd;
- sd.Parse(
- "{"
- " \"swagger\": \"2.0\","
- " \"paths\": {"
- " \"/some/path\": {"
- " \"post\": {"
- " \"parameters\": ["
- " {"
- " \"in\": \"body\","
- " \"name\": \"body\","
- " \"schema\": {"
- " \"properties\": {"
- " \"a\": {"
- " \"$ref\": \"#/definitions/Prop_a\""
- " },"
- " \"b\": {"
- " \"type\": \"integer\""
- " }"
- " },"
- " \"type\": \"object\""
- " }"
- " }"
- " ],"
- " \"responses\": {"
- " \"200\": {"
- " \"schema\": {"
- " \"$ref\": \"#/definitions/Resp_200\""
- " }"
- " }"
- " }"
- " }"
- " }"
- " },"
- " \"definitions\": {"
- " \"Prop_a\": {"
- " \"properties\": {"
- " \"c\": {"
- " \"enum\": ["
- " \"C1\","
- " \"C2\","
- " \"C3\""
- " ],"
- " \"type\": \"string\""
- " },"
- " \"d\": {"
- " \"$ref\": \"#/definitions/Prop_d\""
- " },"
- " \"s\": {"
- " \"type\": \"string\""
- " }"
- " },"
- " \"required\": [\"c\"],"
- " \"type\": \"object\""
- " },"
- " \"Prop_d\": {"
- " \"properties\": {"
- " \"a\": {"
- " \"$ref\": \"#/definitions/Prop_a\""
- " },"
- " \"c\": {"
- " \"$ref\": \"#/definitions/Prop_a/properties/c\""
- " }"
- " },"
- " \"type\": \"object\""
- " },"
- " \"Resp_200\": {"
- " \"properties\": {"
- " \"e\": {"
- " \"type\": \"string\""
- " },"
- " \"f\": {"
- " \"type\": \"boolean\""
- " }"
- " },"
- " \"type\": \"object\""
- " }"
- " }"
- "}");
- SchemaDocument s1(sd, NULL, 0, NULL, NULL, Pointer("#/paths/~1some~1path/post/parameters/0/schema"));
- VALIDATE(s1,
- "{"
- " \"a\": {"
- " \"c\": \"C1\","
- " \"d\": {"
- " \"a\": {"
- " \"c\": \"C2\""
- " },"
- " \"c\": \"C3\""
- " }"
- " },"
- " \"b\": 123"
- "}",
- true);
- INVALIDATE(s1,
- "{"
- " \"a\": {"
- " \"c\": \"C1\","
- " \"d\": {"
- " \"a\": {"
- " \"c\": \"C2\""
- " },"
- " \"c\": \"C3\""
- " }"
- " },"
- " \"b\": \"should be an int\""
- "}",
- "#/paths/~1some~1path/post/parameters/0/schema/properties/b", "type", "#/b",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\":\"#/b\","
- " \"schemaRef\":\"#/paths/~1some~1path/post/parameters/0/schema/properties/b\","
- " \"expected\": [\"integer\"], \"actual\":\"string\""
- "}}");
- INVALIDATE(s1,
- "{"
- " \"a\": {"
- " \"c\": \"C1\","
- " \"d\": {"
- " \"a\": {"
- " \"c\": \"should be within enum\""
- " },"
- " \"c\": \"C3\""
- " }"
- " },"
- " \"b\": 123"
- "}",
- "#/definitions/Prop_a/properties/c", "enum", "#/a/d/a/c",
- "{ \"enum\": {"
- " \"errorCode\": 19,"
- " \"instanceRef\":\"#/a/d/a/c\","
- " \"schemaRef\":\"#/definitions/Prop_a/properties/c\""
- "}}");
- INVALIDATE(s1,
- "{"
- " \"a\": {"
- " \"c\": \"C1\","
- " \"d\": {"
- " \"a\": {"
- " \"s\": \"required 'c' is missing\""
- " }"
- " }"
- " },"
- " \"b\": 123"
- "}",
- "#/definitions/Prop_a", "required", "#/a/d/a",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"missing\":[\"c\"],"
- " \"instanceRef\":\"#/a/d/a\","
- " \"schemaRef\":\"#/definitions/Prop_a\""
- "}}");
- SchemaDocument s2(sd, NULL, 0, NULL, NULL, Pointer("#/paths/~1some~1path/post/responses/200/schema"));
- VALIDATE(s2,
- "{ \"e\": \"some string\", \"f\": false }",
- true);
- INVALIDATE(s2,
- "{ \"e\": true, \"f\": false }",
- "#/definitions/Resp_200/properties/e", "type", "#/e",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\":\"#/e\","
- " \"schemaRef\":\"#/definitions/Resp_200/properties/e\","
- " \"expected\": [\"string\"], \"actual\":\"boolean\""
- "}}");
- INVALIDATE(s2,
- "{ \"e\": \"some string\", \"f\": 123 }",
- "#/definitions/Resp_200/properties/f", "type", "#/f",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\":\"#/f\","
- " \"schemaRef\":\"#/definitions/Resp_200/properties/f\","
- " \"expected\": [\"boolean\"], \"actual\":\"integer\""
- "}}");
-}
-
-template <typename Allocator>
-static char* ReadFile(const char* filename, Allocator& allocator) {
- const char *paths[] = {
- "",
- "bin/",
- "../bin/",
- "../../bin/",
- "../../../bin/"
- };
- char buffer[1024];
- FILE *fp = 0;
- for (size_t i = 0; i < sizeof(paths) / sizeof(paths[0]); i++) {
- sprintf(buffer, "%s%s", paths[i], filename);
- fp = fopen(buffer, "rb");
- if (fp)
- break;
- }
-
- if (!fp)
- return 0;
-
- fseek(fp, 0, SEEK_END);
- size_t length = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
- char* json = reinterpret_cast<char*>(allocator.Malloc(length + 1));
- size_t readLength = fread(json, 1, length, fp);
- json[readLength] = '\0';
- fclose(fp);
- return json;
-}
-
-TEST(SchemaValidator, ValidateMetaSchema) {
- CrtAllocator allocator;
- char* json = ReadFile("draft-04/schema", allocator);
- Document d;
- d.Parse(json);
- ASSERT_FALSE(d.HasParseError());
- SchemaDocument sd(d);
- SchemaValidator validator(sd);
- d.Accept(validator);
- if (!validator.IsValid()) {
- StringBuffer sb;
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- printf("Invalid schema: %s\n", sb.GetString());
- printf("Invalid keyword: %s\n", validator.GetInvalidSchemaKeyword());
- printf("Invalid code: %d\n", validator.GetInvalidSchemaCode());
- printf("Invalid message: %s\n", GetValidateError_En(validator.GetInvalidSchemaCode()));
- sb.Clear();
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- printf("Invalid document: %s\n", sb.GetString());
- sb.Clear();
- Writer<StringBuffer> w(sb);
- validator.GetError().Accept(w);
- printf("Validation error: %s\n", sb.GetString());
- ADD_FAILURE();
- }
- CrtAllocator::Free(json);
-}
-
-TEST(SchemaValidator, ValidateMetaSchema_UTF16) {
- typedef GenericDocument<UTF16<> > D;
- typedef GenericSchemaDocument<D::ValueType> SD;
- typedef GenericSchemaValidator<SD> SV;
-
- CrtAllocator allocator;
- char* json = ReadFile("draft-04/schema", allocator);
-
- D d;
- StringStream ss(json);
- d.ParseStream<0, UTF8<> >(ss);
- ASSERT_FALSE(d.HasParseError());
- SD sd(d);
- SV validator(sd);
- d.Accept(validator);
- if (!validator.IsValid()) {
- GenericStringBuffer<UTF16<> > sb;
- validator.GetInvalidSchemaPointer().StringifyUriFragment(sb);
- wprintf(L"Invalid schema: %ls\n", sb.GetString());
- wprintf(L"Invalid keyword: %ls\n", validator.GetInvalidSchemaKeyword());
- sb.Clear();
- validator.GetInvalidDocumentPointer().StringifyUriFragment(sb);
- wprintf(L"Invalid document: %ls\n", sb.GetString());
- sb.Clear();
- Writer<GenericStringBuffer<UTF16<> >, UTF16<> > w(sb);
- validator.GetError().Accept(w);
- printf("Validation error: %ls\n", sb.GetString());
- ADD_FAILURE();
- }
- CrtAllocator::Free(json);
-}
-
-template <typename SchemaDocumentType = SchemaDocument>
-class RemoteSchemaDocumentProvider : public IGenericRemoteSchemaDocumentProvider<SchemaDocumentType> {
-public:
- RemoteSchemaDocumentProvider() :
- documentAllocator_(documentBuffer_, sizeof(documentBuffer_)),
- schemaAllocator_(schemaBuffer_, sizeof(schemaBuffer_))
- {
- const char* filenames[kCount] = {
- "jsonschema/remotes/integer.json",
- "jsonschema/remotes/subSchemas.json",
- "jsonschema/remotes/folder/folderInteger.json",
- "draft-04/schema",
- "unittestschema/address.json"
- };
- const char* uris[kCount] = {
- "http://localhost:1234/integer.json",
- "http://localhost:1234/subSchemas.json",
- "http://localhost:1234/folder/folderInteger.json",
- "http://json-schema.org/draft-04/schema",
- "http://localhost:1234/address.json"
- };
-
- for (size_t i = 0; i < kCount; i++) {
- sd_[i] = 0;
-
- char jsonBuffer[8192];
- MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
- char* json = ReadFile(filenames[i], jsonAllocator);
- if (!json) {
- printf("json remote file %s not found", filenames[i]);
- ADD_FAILURE();
- }
- else {
- char stackBuffer[4096];
- MemoryPoolAllocator<> stackAllocator(stackBuffer, sizeof(stackBuffer));
- DocumentType d(&documentAllocator_, 1024, &stackAllocator);
- d.Parse(json);
- sd_[i] = new SchemaDocumentType(d, uris[i], static_cast<SizeType>(strlen(uris[i])), 0, &schemaAllocator_);
- MemoryPoolAllocator<>::Free(json);
- }
- };
- }
-
- ~RemoteSchemaDocumentProvider() {
- for (size_t i = 0; i < kCount; i++)
- delete sd_[i];
- }
-
- virtual const SchemaDocumentType* GetRemoteDocument(const char* uri, SizeType length) {
- //printf("GetRemoteDocument : %s\n", uri);
- for (size_t i = 0; i < kCount; i++)
- if (typename SchemaDocumentType::GValue(uri, length) == sd_[i]->GetURI()) {
- //printf("Matched document");
- return sd_[i];
- }
- //printf("No matched document");
- return 0;
- }
-
-private:
- typedef GenericDocument<typename SchemaDocumentType::EncodingType, MemoryPoolAllocator<>, MemoryPoolAllocator<> > DocumentType;
-
- RemoteSchemaDocumentProvider(const RemoteSchemaDocumentProvider&);
- RemoteSchemaDocumentProvider& operator=(const RemoteSchemaDocumentProvider&);
-
- static const size_t kCount = 5;
- SchemaDocumentType* sd_[kCount];
- typename DocumentType::AllocatorType documentAllocator_;
- typename SchemaDocumentType::AllocatorType schemaAllocator_;
- char documentBuffer_[16384];
- char schemaBuffer_[128u * 1024];
-};
-
-TEST(SchemaValidator, TestSuite) {
- const char* filenames[] = {
- "additionalItems.json",
- "additionalProperties.json",
- "allOf.json",
- "anyOf.json",
- "default.json",
- "definitions.json",
- "dependencies.json",
- "enum.json",
- "items.json",
- "maximum.json",
- "maxItems.json",
- "maxLength.json",
- "maxProperties.json",
- "minimum.json",
- "minItems.json",
- "minLength.json",
- "minProperties.json",
- "multipleOf.json",
- "not.json",
- "oneOf.json",
- "pattern.json",
- "patternProperties.json",
- "properties.json",
- "ref.json",
- "refRemote.json",
- "required.json",
- "type.json",
- "uniqueItems.json"
- };
-
- const char* onlyRunDescription = 0;
- //const char* onlyRunDescription = "a string is a string";
-
- unsigned testCount = 0;
- unsigned passCount = 0;
-
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
-
- char jsonBuffer[65536];
- char documentBuffer[65536];
- char documentStackBuffer[65536];
- char schemaBuffer[65536];
- char validatorBuffer[65536];
- MemoryPoolAllocator<> jsonAllocator(jsonBuffer, sizeof(jsonBuffer));
- MemoryPoolAllocator<> documentAllocator(documentBuffer, sizeof(documentBuffer));
- MemoryPoolAllocator<> documentStackAllocator(documentStackBuffer, sizeof(documentStackBuffer));
- MemoryPoolAllocator<> schemaAllocator(schemaBuffer, sizeof(schemaBuffer));
- MemoryPoolAllocator<> validatorAllocator(validatorBuffer, sizeof(validatorBuffer));
-
- for (size_t i = 0; i < sizeof(filenames) / sizeof(filenames[0]); i++) {
- char filename[FILENAME_MAX];
- sprintf(filename, "jsonschema/tests/draft4/%s", filenames[i]);
- char* json = ReadFile(filename, jsonAllocator);
- if (!json) {
- printf("json test suite file %s not found", filename);
- ADD_FAILURE();
- }
- else {
- //printf("\njson test suite file %s parsed ok\n", filename);
- GenericDocument<UTF8<>, MemoryPoolAllocator<>, MemoryPoolAllocator<> > d(&documentAllocator, 1024, &documentStackAllocator);
- d.Parse(json);
- if (d.HasParseError()) {
- printf("json test suite file %s has parse error", filename);
- ADD_FAILURE();
- }
- else {
- for (Value::ConstValueIterator schemaItr = d.Begin(); schemaItr != d.End(); ++schemaItr) {
- {
- const char* description1 = (*schemaItr)["description"].GetString();
- //printf("\ncompiling schema for json test %s \n", description1);
- SchemaDocumentType schema((*schemaItr)["schema"], filenames[i], static_cast<SizeType>(strlen(filenames[i])), &provider, &schemaAllocator);
- GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > validator(schema, &validatorAllocator);
- const Value& tests = (*schemaItr)["tests"];
- for (Value::ConstValueIterator testItr = tests.Begin(); testItr != tests.End(); ++testItr) {
- const char* description2 = (*testItr)["description"].GetString();
- //printf("running json test %s \n", description2);
- if (!onlyRunDescription || strcmp(description2, onlyRunDescription) == 0) {
- const Value& data = (*testItr)["data"];
- bool expected = (*testItr)["valid"].GetBool();
- testCount++;
- validator.Reset();
- data.Accept(validator);
- bool actual = validator.IsValid();
- if (expected != actual)
- printf("Fail: %30s \"%s\" \"%s\"\n", filename, description1, description2);
- else {
- //printf("Passed: %30s \"%s\" \"%s\"\n", filename, description1, description2);
- passCount++;
- }
- }
- }
- //printf("%zu %zu %zu\n", documentAllocator.Size(), schemaAllocator.Size(), validatorAllocator.Size());
- }
- schemaAllocator.Clear();
- validatorAllocator.Clear();
- }
- }
- }
- documentAllocator.Clear();
- MemoryPoolAllocator<>::Free(json);
- jsonAllocator.Clear();
- }
- printf("%d / %d passed (%2d%%)\n", passCount, testCount, passCount * 100 / testCount);
- if (passCount != testCount)
- ADD_FAILURE();
-}
-
-TEST(SchemaValidatingReader, Simple) {
- Document sd;
- sd.Parse("{ \"type\": \"string\", \"enum\" : [\"red\", \"amber\", \"green\"] }");
- SchemaDocument s(sd);
-
- Document d;
- StringStream ss("\"red\"");
- SchemaValidatingReader<kParseDefaultFlags, StringStream, UTF8<> > reader(ss, s);
- d.Populate(reader);
- EXPECT_TRUE(reader.GetParseResult());
- EXPECT_TRUE(reader.IsValid());
- EXPECT_TRUE(d.IsString());
- EXPECT_STREQ("red", d.GetString());
-}
-
-TEST(SchemaValidatingReader, Invalid) {
- Document sd;
- sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
- SchemaDocument s(sd);
-
- Document d;
- StringStream ss("\"ABCD\"");
- SchemaValidatingReader<kParseDefaultFlags, StringStream, UTF8<> > reader(ss, s);
- d.Populate(reader);
- EXPECT_FALSE(reader.GetParseResult());
- EXPECT_FALSE(reader.IsValid());
- EXPECT_EQ(kParseErrorTermination, reader.GetParseResult().Code());
- EXPECT_STREQ("maxLength", reader.GetInvalidSchemaKeyword());
- EXPECT_TRUE(reader.GetInvalidSchemaCode() == kValidateErrorMaxLength);
- EXPECT_TRUE(reader.GetInvalidSchemaPointer() == SchemaDocument::PointerType(""));
- EXPECT_TRUE(reader.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
- EXPECT_TRUE(d.IsNull());
- Document e;
- e.Parse(
- "{ \"maxLength\": {"
- " \"errorCode\": 6,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 3, \"actual\": \"ABCD\""
- "}}");
- if (e != reader.GetError()) {
- ADD_FAILURE();
- }
-}
-
-TEST(SchemaValidatingWriter, Simple) {
- Document sd;
- sd.Parse("{\"type\":\"string\",\"minLength\":2,\"maxLength\":3}");
- SchemaDocument s(sd);
-
- Document d;
- StringBuffer sb;
- Writer<StringBuffer> writer(sb);
- GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
-
- d.Parse("\"red\"");
- EXPECT_TRUE(d.Accept(validator));
- EXPECT_TRUE(validator.IsValid());
- EXPECT_STREQ("\"red\"", sb.GetString());
-
- sb.Clear();
- validator.Reset();
- d.Parse("\"ABCD\"");
- EXPECT_FALSE(d.Accept(validator));
- EXPECT_FALSE(validator.IsValid());
- EXPECT_TRUE(validator.GetInvalidSchemaPointer() == SchemaDocument::PointerType(""));
- EXPECT_TRUE(validator.GetInvalidDocumentPointer() == SchemaDocument::PointerType(""));
- EXPECT_TRUE(validator.GetInvalidSchemaCode() == kValidateErrorMaxLength);
- Document e;
- e.Parse(
- "{ \"maxLength\": {"
-" \"errorCode\": 6,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": 3, \"actual\": \"ABCD\""
- "}}");
- EXPECT_EQ(e, validator.GetError());
-}
-
-TEST(Schema, Issue848) {
- rapidjson::Document d;
- rapidjson::SchemaDocument s(d);
- rapidjson::GenericSchemaValidator<rapidjson::SchemaDocument, rapidjson::Document> v(s);
-}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-static SchemaDocument ReturnSchemaDocument() {
- Document sd;
- sd.Parse("{ \"type\": [\"number\", \"string\"] }");
- SchemaDocument s(sd);
- return s;
-}
-
-TEST(Schema, Issue552) {
- SchemaDocument s = ReturnSchemaDocument();
- VALIDATE(s, "42", true);
- VALIDATE(s, "\"Life, the universe, and everything\"", true);
- INVALIDATE(s, "[\"Life\", \"the universe\", \"and everything\"]", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\", \"number\"], \"actual\": \"array\""
- "}}");
-}
-
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-TEST(SchemaValidator, Issue608) {
- Document sd;
- sd.Parse("{\"required\": [\"a\", \"b\"] }");
- SchemaDocument s(sd);
-
- VALIDATE(s, "{\"a\" : null, \"b\": null}", true);
- INVALIDATE(s, "{\"a\" : null, \"a\" : null}", "", "required", "",
- "{ \"required\": {"
- " \"errorCode\": 15,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"missing\": [\"b\"]"
- "}}");
-}
-
-// Fail to resolve $ref in allOf causes crash in SchemaValidator::StartObject()
-TEST(SchemaValidator, Issue728_AllOfRef) {
- Document sd;
- sd.Parse("{\"allOf\": [{\"$ref\": \"#/abc\"}]}");
- SchemaDocument s(sd);
- SCHEMAERROR(s, "{\"RefUnknown\":{\"errorCode\":5,\"instanceRef\":\"#/allOf/0\",\"value\":\"#/abc\"}}");
-
- VALIDATE_(s, "{\"key1\": \"abc\", \"key2\": \"def\"}", true, false);
-}
-
-TEST(SchemaValidator, Issue1017_allOfHandler) {
- Document sd;
- sd.Parse("{\"allOf\": [{\"type\": \"object\",\"properties\": {\"cyanArray2\": {\"type\": \"array\",\"items\": { \"type\": \"string\" }}}},{\"type\": \"object\",\"properties\": {\"blackArray\": {\"type\": \"array\",\"items\": { \"type\": \"string\" }}},\"required\": [ \"blackArray\" ]}]}");
- SchemaDocument s(sd);
- StringBuffer sb;
- Writer<StringBuffer> writer(sb);
- GenericSchemaValidator<SchemaDocument, Writer<StringBuffer> > validator(s, writer);
- EXPECT_TRUE(validator.StartObject());
- EXPECT_TRUE(validator.Key("cyanArray2", 10, false));
- EXPECT_TRUE(validator.StartArray());
- EXPECT_TRUE(validator.EndArray(0));
- EXPECT_TRUE(validator.Key("blackArray", 10, false));
- EXPECT_TRUE(validator.StartArray());
- EXPECT_TRUE(validator.EndArray(0));
- EXPECT_TRUE(validator.EndObject(0));
- EXPECT_TRUE(validator.IsValid());
- EXPECT_STREQ("{\"cyanArray2\":[],\"blackArray\":[]}", sb.GetString());
-}
-
-TEST(SchemaValidator, Ref_remote) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"$ref\": \"http://localhost:1234/subSchemas.json#/integer\"}");
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "null", "/integer", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\","
- " \"schemaRef\": \"http://localhost:1234/subSchemas.json#/integer\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// Merge with id where $ref is full URI
-TEST(SchemaValidator, Ref_remote_change_resolution_scope_uri) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"id\": \"http://ignore/blah#/ref\", \"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"http://localhost:1234/subSchemas.json#/integer\"}}}");
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt\": null}", "/integer", "type", "/myInt",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt\","
- " \"schemaRef\": \"http://localhost:1234/subSchemas.json#/integer\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// Merge with id where $ref is a relative path
-TEST(SchemaValidator, Ref_remote_change_resolution_scope_relative_path) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"id\": \"http://localhost:1234/\", \"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"subSchemas.json#/integer\"}}}");
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt\": null}", "/integer", "type", "/myInt",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt\","
- " \"schemaRef\": \"http://localhost:1234/subSchemas.json#/integer\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// Merge with id where $ref is an absolute path
-TEST(SchemaValidator, Ref_remote_change_resolution_scope_absolute_path) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"id\": \"http://localhost:1234/xxxx\", \"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#/integer\"}}}");
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt\": null}", "/integer", "type", "/myInt",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt\","
- " \"schemaRef\": \"http://localhost:1234/subSchemas.json#/integer\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// Merge with id where $ref is an absolute path, and the document has a base URI
-TEST(SchemaValidator, Ref_remote_change_resolution_scope_absolute_path_document) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#/integer\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt\": null}", "/integer", "type", "/myInt",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt\","
- " \"schemaRef\": \"http://localhost:1234/subSchemas.json#/integer\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// $ref is a non-JSON pointer fragment and there a matching id
-TEST(SchemaValidator, Ref_internal_id_1) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"#myId\"}, \"myStr\": {\"type\": \"string\", \"id\": \"#myStrId\"}, \"myInt2\": {\"type\": \"integer\", \"id\": \"#myId\"}}}");
- SchemaDocumentType s(sd);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt1\": null}", "/properties/myInt2", "type", "/myInt1",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt1\","
- " \"schemaRef\": \"#/properties/myInt2\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// $ref is a non-JSON pointer fragment and there are two matching ids so we take the first
-TEST(SchemaValidator, Ref_internal_id_2) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"#myId\"}, \"myInt2\": {\"type\": \"integer\", \"id\": \"#myId\"}, \"myStr\": {\"type\": \"string\", \"id\": \"#myId\"}}}");
- SchemaDocumentType s(sd);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt1\": null}", "/properties/myInt2", "type", "/myInt1",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt1\","
- " \"schemaRef\": \"#/properties/myInt2\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// $ref is a non-JSON pointer fragment and there is a matching id within array
-TEST(SchemaValidator, Ref_internal_id_in_array) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"#myId\"}, \"myInt2\": {\"anyOf\": [{\"type\": \"string\", \"id\": \"#myStrId\"}, {\"type\": \"integer\", \"id\": \"#myId\"}]}}}");
- SchemaDocumentType s(sd);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"myInt1\": null}", "/properties/myInt2/anyOf/1", "type", "/myInt1",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt1\","
- " \"schemaRef\": \"#/properties/myInt2/anyOf/1\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// $ref is a non-JSON pointer fragment and there is a matching id, and the schema is embedded in the document
-TEST(SchemaValidator, Ref_internal_id_and_schema_pointer) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{ \"schema\": {\"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"#myId\"}, \"myInt2\": {\"anyOf\": [{\"type\": \"integer\", \"id\": \"#myId\"}]}}}}");
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- SchemaDocumentType s(sd, 0, 0, 0, 0, PointerType("/schema"));
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- INVALIDATE_(s, "{\"myInt1\": null}", "/schema/properties/myInt2/anyOf/0", "type", "/myInt1",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#/myInt1\","
- " \"schemaRef\": \"#/schema/properties/myInt2/anyOf/0\","
- " \"expected\": [\"integer\"], \"actual\": \"null\""
- "}}",
- kValidateDefaultFlags, SchemaValidatorType, PointerType);
-}
-
-// Test that $refs are correctly resolved when intermediate multiple ids are present
-// Includes $ref to a part of the document with a different in-scope id, which also contains $ref..
-TEST(SchemaValidator, Ref_internal_multiple_ids) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- //RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/idandref.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocumentType s(sd, "http://xyz", 10/*, &provider*/);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"PA1\": \"s\", \"PA2\": \"t\", \"PA3\": \"r\", \"PX1\": 1, \"PX2Y\": 2, \"PX3Z\": 3, \"PX4\": 4, \"PX5\": 5, \"PX6\": 6, \"PX7W\": 7, \"PX8N\": { \"NX\": 8}}", "#", "errors", "#",
- "{ \"type\": ["
- " {\"errorCode\": 20, \"instanceRef\": \"#/PA1\", \"schemaRef\": \"http://xyz#/definitions/A\", \"expected\": [\"integer\"], \"actual\": \"string\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PA2\", \"schemaRef\": \"http://xyz#/definitions/A\", \"expected\": [\"integer\"], \"actual\": \"string\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PA3\", \"schemaRef\": \"http://xyz#/definitions/A\", \"expected\": [\"integer\"], \"actual\": \"string\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX1\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX2Y\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX3Z\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX4\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX5\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX6\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX7W\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"},"
- " {\"errorCode\": 20, \"instanceRef\": \"#/PX8N/NX\", \"schemaRef\": \"http://xyz#/definitions/B/definitions/X\", \"expected\": [\"boolean\"], \"actual\": \"integer\"}"
- "]}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidatorType, PointerType);
- CrtAllocator::Free(schema);
-}
-
-TEST(SchemaValidator, Ref_remote_issue1210) {
- class SchemaDocumentProvider : public IRemoteSchemaDocumentProvider {
- SchemaDocument** collection;
-
- // Dummy private copy constructor & assignment operator.
- // Function bodies added so that they compile in MSVC 2019.
- SchemaDocumentProvider(const SchemaDocumentProvider&) : collection(NULL) {
- }
- SchemaDocumentProvider& operator=(const SchemaDocumentProvider&) {
- return *this;
- }
-
- public:
- SchemaDocumentProvider(SchemaDocument** collection) : collection(collection) { }
- virtual const SchemaDocument* GetRemoteDocument(const char* uri, SizeType length) {
- int i = 0;
- while (collection[i] && SchemaDocument::GValue(uri, length) != collection[i]->GetURI()) ++i;
- return collection[i];
- }
- };
- SchemaDocument* collection[] = { 0, 0, 0 };
- SchemaDocumentProvider provider(collection);
-
- Document x, y, z;
- x.Parse("{\"properties\":{\"country\":{\"$ref\":\"y.json#/definitions/country_remote\"}},\"type\":\"object\"}");
- y.Parse("{\"definitions\":{\"country_remote\":{\"$ref\":\"z.json#/definitions/country_list\"}}}");
- z.Parse("{\"definitions\":{\"country_list\":{\"enum\":[\"US\"]}}}");
-
- SchemaDocument sz(z, "z.json", 6, &provider);
- collection[0] = &sz;
- SchemaDocument sy(y, "y.json", 6, &provider);
- collection[1] = &sy;
- SchemaDocument sx(x, "x.json", 6, &provider);
-
- VALIDATE(sx, "{\"country\":\"UK\"}", false);
- VALIDATE(sx, "{\"country\":\"US\"}", true);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, all errors are reported.
-TEST(SchemaValidator, ContinueOnErrors) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- VALIDATE(s, "{\"version\": 1.0, \"address\": {\"number\": 24, \"street1\": \"The Woodlands\", \"street3\": \"Ham\", \"city\": \"Romsey\", \"area\": \"Kent\", \"country\": \"UK\", \"postcode\": \"SO51 0GP\"}, \"phones\": [\"0111-222333\", \"0777-666888\"], \"names\": [\"Fred\", \"Bloggs\"]}", true);
- INVALIDATE_(s, "{\"version\": 1.01, \"address\": {\"number\": 0, \"street2\": false, \"street3\": \"Ham\", \"city\": \"RomseyTownFC\", \"area\": \"Narnia\", \"country\": \"USA\", \"postcode\": \"999ABC\"}, \"phones\": [], \"planet\": \"Earth\", \"extra\": {\"S_xxx\": 123}}", "#", "errors", "#",
- "{ \"multipleOf\": {"
- " \"errorCode\": 1, \"instanceRef\": \"#/version\", \"schemaRef\": \"#/definitions/decimal_type\", \"expected\": 1.0, \"actual\": 1.01"
- " },"
- " \"minimum\": {"
- " \"errorCode\": 5, \"instanceRef\": \"#/address/number\", \"schemaRef\": \"#/definitions/positiveInt_type\", \"expected\": 0, \"actual\": 0, \"exclusiveMinimum\": true"
- " },"
- " \"type\": ["
- " {\"expected\": [\"null\", \"string\"], \"actual\": \"boolean\", \"errorCode\": 20, \"instanceRef\": \"#/address/street2\", \"schemaRef\": \"#/definitions/address_type/properties/street2\"},"
- " {\"expected\": [\"string\"], \"actual\": \"integer\", \"errorCode\": 20, \"instanceRef\": \"#/extra/S_xxx\", \"schemaRef\": \"#/properties/extra/patternProperties/%5ES_\"}"
- " ],"
- " \"maxLength\": {"
- " \"actual\": \"RomseyTownFC\", \"expected\": 10, \"errorCode\": 6, \"instanceRef\": \"#/address/city\", \"schemaRef\": \"#/definitions/address_type/properties/city\""
- " },"
- " \"anyOf\": {"
- " \"errors\":["
- " {\"pattern\": {\"actual\": \"999ABC\", \"errorCode\": 8, \"instanceRef\": \"#/address/postcode\", \"schemaRef\": \"#/definitions/address_type/properties/postcode/anyOf/0\"}},"
- " {\"pattern\": {\"actual\": \"999ABC\", \"errorCode\": 8, \"instanceRef\": \"#/address/postcode\", \"schemaRef\": \"#/definitions/address_type/properties/postcode/anyOf/1\"}}"
- " ],"
- " \"errorCode\": 24, \"instanceRef\": \"#/address/postcode\", \"schemaRef\": \"#/definitions/address_type/properties/postcode\""
- " },"
- " \"allOf\": {"
- " \"errors\":["
- " {\"enum\":{\"errorCode\":19,\"instanceRef\":\"#/address/country\",\"schemaRef\":\"#/definitions/country_type\"}}"
- " ],"
- " \"errorCode\":23,\"instanceRef\":\"#/address/country\",\"schemaRef\":\"#/definitions/address_type/properties/country\""
- " },"
- " \"minItems\": {"
- " \"actual\": 0, \"expected\": 1, \"errorCode\": 10, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\""
- " },"
- " \"additionalProperties\": {"
- " \"disallowed\": \"planet\", \"errorCode\": 16, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " },"
- " \"required\": {"
- " \"missing\": [\"street1\"], \"errorCode\": 15, \"instanceRef\": \"#/address\", \"schemaRef\": \"#/definitions/address_type\""
- " },"
- " \"oneOf\": {"
- " \"matches\": [0, 1], \"errorCode\": 22, \"instanceRef\": \"#/address/area\", \"schemaRef\": \"#/definitions/address_type/properties/area\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- INVALIDATE_(s, "{\"address\": {\"number\": 200, \"street1\": {}, \"street3\": null, \"city\": \"Rom\", \"area\": \"Dorset\", \"postcode\": \"SO51 0GP\"}, \"phones\": [\"0111-222333\", \"0777-666888\", \"0777-666888\"], \"names\": [\"Fred\", \"S\", \"M\", \"Bloggs\"]}", "#", "errors", "#",
- "{ \"maximum\": {"
- " \"errorCode\": 3, \"instanceRef\": \"#/address/number\", \"schemaRef\": \"#/definitions/positiveInt_type\", \"expected\": 100, \"actual\": 200, \"exclusiveMaximum\": true"
- " },"
- " \"type\": {"
- " \"expected\": [\"string\"], \"actual\": \"object\", \"errorCode\": 20, \"instanceRef\": \"#/address/street1\", \"schemaRef\": \"#/definitions/address_type/properties/street1\""
- " },"
- " \"not\": {"
- " \"errorCode\": 25, \"instanceRef\": \"#/address/street3\", \"schemaRef\": \"#/definitions/address_type/properties/street3\""
- " },"
- " \"minLength\": {"
- " \"actual\": \"Rom\", \"expected\": 4, \"errorCode\": 7, \"instanceRef\": \"#/address/city\", \"schemaRef\": \"#/definitions/address_type/properties/city\""
- " },"
- " \"maxItems\": {"
- " \"actual\": 3, \"expected\": 2, \"errorCode\": 9, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\""
- " },"
- " \"uniqueItems\": {"
- " \"duplicates\": [1, 2], \"errorCode\": 11, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\""
- " },"
- " \"minProperties\": {\"actual\": 6, \"expected\": 7, \"errorCode\": 14, \"instanceRef\": \"#/address\", \"schemaRef\": \"#/definitions/address_type\""
- " },"
- " \"additionalItems\": ["
- " {\"disallowed\": 2, \"errorCode\": 12, \"instanceRef\": \"#/names\", \"schemaRef\": \"#/properties/names\"},"
- " {\"disallowed\": 3, \"errorCode\": 12, \"instanceRef\": \"#/names\", \"schemaRef\": \"#/properties/names\"}"
- " ],"
- " \"dependencies\": {"
- " \"errors\": {"
- " \"address\": {\"required\": {\"missing\": [\"version\"], \"errorCode\": 15, \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/address\"}},"
- " \"names\": {\"required\": {\"missing\": [\"version\"], \"errorCode\": 15, \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/names\"}}"
- " },"
- " \"errorCode\": 18, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " },"
- " \"oneOf\": {"
- " \"errors\": ["
- " {\"enum\": {\"errorCode\": 19, \"instanceRef\": \"#/address/area\", \"schemaRef\": \"#/definitions/county_type\"}},"
- " {\"enum\": {\"errorCode\": 19, \"instanceRef\": \"#/address/area\", \"schemaRef\": \"#/definitions/province_type\"}}"
- " ],"
- " \"errorCode\": 21, \"instanceRef\": \"#/address/area\", \"schemaRef\": \"#/definitions/address_type/properties/area\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
-
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, it is not propagated to oneOf sub-validator so we only get the first error.
-TEST(SchemaValidator, ContinueOnErrors_OneOf) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/oneOf_address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"version\": 1.01, \"address\": {\"number\": 0, \"street2\": false, \"street3\": \"Ham\", \"city\": \"RomseyTownFC\", \"area\": \"BC\", \"country\": \"USA\", \"postcode\": \"999ABC\"}, \"phones\": [], \"planet\": \"Earth\", \"extra\": {\"S_xxx\": 123}}", "#", "errors", "#",
- "{ \"oneOf\": {"
- " \"errors\": [{"
- " \"multipleOf\": {"
- " \"errorCode\": 1, \"instanceRef\": \"#/version\", \"schemaRef\": \"http://localhost:1234/address.json#/definitions/decimal_type\", \"expected\": 1.0, \"actual\": 1.01"
- " }"
- " }],"
- " \"errorCode\": 21, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidatorType, PointerType);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, it is not propagated to allOf sub-validator so we only get the first error.
-TEST(SchemaValidator, ContinueOnErrors_AllOf) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/allOf_address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"version\": 1.01, \"address\": {\"number\": 0, \"street2\": false, \"street3\": \"Ham\", \"city\": \"RomseyTownFC\", \"area\": \"BC\", \"country\": \"USA\", \"postcode\": \"999ABC\"}, \"phones\": [], \"planet\": \"Earth\", \"extra\": {\"S_xxx\": 123}}", "#", "errors", "#",
- "{ \"allOf\": {"
- " \"errors\": [{"
- " \"multipleOf\": {"
- " \"errorCode\": 1, \"instanceRef\": \"#/version\", \"schemaRef\": \"http://localhost:1234/address.json#/definitions/decimal_type\", \"expected\": 1.0, \"actual\": 1.01"
- " }"
- " }],"
- " \"errorCode\": 23, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidatorType, PointerType);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, it is not propagated to anyOf sub-validator so we only get the first error.
-TEST(SchemaValidator, ContinueOnErrors_AnyOf) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/anyOf_address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocumentType s(sd, 0, 0, &provider);
- typedef GenericSchemaValidator<SchemaDocumentType, BaseReaderHandler<UTF8<> >, MemoryPoolAllocator<> > SchemaValidatorType;
- typedef GenericPointer<Value, MemoryPoolAllocator<> > PointerType;
- INVALIDATE_(s, "{\"version\": 1.01, \"address\": {\"number\": 0, \"street2\": false, \"street3\": \"Ham\", \"city\": \"RomseyTownFC\", \"area\": \"BC\", \"country\": \"USA\", \"postcode\": \"999ABC\"}, \"phones\": [], \"planet\": \"Earth\", \"extra\": {\"S_xxx\": 123}}", "#", "errors", "#",
- "{ \"anyOf\": {"
- " \"errors\": [{"
- " \"multipleOf\": {"
- " \"errorCode\": 1, \"instanceRef\": \"#/version\", \"schemaRef\": \"http://localhost:1234/address.json#/definitions/decimal_type\", \"expected\": 1.0, \"actual\": 1.01"
- " }"
- " }],"
- " \"errorCode\": 24, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidatorType, PointerType);
-
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, arrays with uniqueItems:true are correctly processed when an item is invalid.
-// This tests that we don't blow up if a hasher does not get created.
-TEST(SchemaValidator, ContinueOnErrors_UniqueItems) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- VALIDATE(s, "{\"phones\":[\"12-34\",\"56-78\"]}", true);
- INVALIDATE_(s, "{\"phones\":[\"12-34\",\"12-34\"]}", "#", "errors", "#",
- "{\"uniqueItems\": {\"duplicates\": [0,1], \"errorCode\": 11, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- INVALIDATE_(s, "{\"phones\":[\"ab-34\",\"cd-78\"]}", "#", "errors", "#",
- "{\"pattern\": ["
- " {\"actual\": \"ab-34\", \"errorCode\": 8, \"instanceRef\": \"#/phones/0\", \"schemaRef\": \"#/definitions/phone_type\"},"
- " {\"actual\": \"cd-78\", \"errorCode\": 8, \"instanceRef\": \"#/phones/1\", \"schemaRef\": \"#/definitions/phone_type\"}"
- "]}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, an enum field is correctly processed when it has an invalid value.
-// This tests that we don't blow up if a hasher does not get created.
-TEST(SchemaValidator, ContinueOnErrors_Enum) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- VALIDATE(s, "{\"gender\":\"M\"}", true);
- INVALIDATE_(s, "{\"gender\":\"X\"}", "#", "errors", "#",
- "{\"enum\": {\"errorCode\": 19, \"instanceRef\": \"#/gender\", \"schemaRef\": \"#/properties/gender\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- INVALIDATE_(s, "{\"gender\":1}", "#", "errors", "#",
- "{\"type\": {\"expected\":[\"string\"], \"actual\": \"integer\", \"errorCode\": 20, \"instanceRef\": \"#/gender\", \"schemaRef\": \"#/properties/gender\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, an array appearing for an object property is handled
-// This tests that we don't blow up when there is a type mismatch.
-TEST(SchemaValidator, ContinueOnErrors_RogueArray) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- INVALIDATE_(s, "{\"address\":[{\"number\": 0}]}", "#", "errors", "#",
- "{\"type\": {\"expected\":[\"object\"], \"actual\": \"array\", \"errorCode\": 20, \"instanceRef\": \"#/address\", \"schemaRef\": \"#/definitions/address_type\"},"
- " \"dependencies\": {"
- " \"errors\": {"
- " \"address\": {\"required\": {\"missing\": [\"version\"], \"errorCode\": 15, \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/address\"}}"
- " },\"errorCode\": 18, \"instanceRef\": \"#\", \"schemaRef\": \"#\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, an object appearing for an array property is handled
-// This tests that we don't blow up when there is a type mismatch.
-TEST(SchemaValidator, ContinueOnErrors_RogueObject) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- INVALIDATE_(s, "{\"phones\":{\"number\": 0}}", "#", "errors", "#",
- "{\"type\": {\"expected\":[\"array\"], \"actual\": \"object\", \"errorCode\": 20, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, a string appearing for an array or object property is handled
-// This tests that we don't blow up when there is a type mismatch.
-TEST(SchemaValidator, ContinueOnErrors_RogueString) {
- CrtAllocator allocator;
- char* schema = ReadFile("unittestschema/address.json", allocator);
- Document sd;
- sd.Parse(schema);
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- INVALIDATE_(s, "{\"address\":\"number\"}", "#", "errors", "#",
- "{\"type\": {\"expected\":[\"object\"], \"actual\": \"string\", \"errorCode\": 20, \"instanceRef\": \"#/address\", \"schemaRef\": \"#/definitions/address_type\"},"
- " \"dependencies\": {"
- " \"errors\": {"
- " \"address\": {\"required\": {\"missing\": [\"version\"], \"errorCode\": 15, \"instanceRef\": \"#\", \"schemaRef\": \"#/dependencies/address\"}}"
- " },\"errorCode\": 18, \"instanceRef\": \"#\", \"schemaRef\": \"#\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- INVALIDATE_(s, "{\"phones\":\"number\"}", "#", "errors", "#",
- "{\"type\": {\"expected\":[\"array\"], \"actual\": \"string\", \"errorCode\": 20, \"instanceRef\": \"#/phones\", \"schemaRef\": \"#/properties/phones\"}}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- CrtAllocator::Free(schema);
-}
-
-// Test that when kValidateContinueOnErrorFlag is set, an incorrect simple type with a sub-schema is handled correctly.
-// This tests that we don't blow up when there is a type mismatch but there is a sub-schema present
-TEST(SchemaValidator, ContinueOnErrors_BadSimpleType) {
- Document sd;
- sd.Parse("{\"type\":\"string\", \"anyOf\":[{\"maxLength\":2}]}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- VALIDATE(s, "\"AB\"", true);
- INVALIDATE_(s, "\"ABC\"", "#", "errors", "#",
- "{ \"anyOf\": {"
- " \"errors\": [{"
- " \"maxLength\": {"
- " \"errorCode\": 6, \"instanceRef\": \"#\", \"schemaRef\": \"#/anyOf/0\", \"expected\": 2, \"actual\": \"ABC\""
- " }"
- " }],"
- " \"errorCode\": 24, \"instanceRef\": \"#\", \"schemaRef\": \"#\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
- // Invalid type
- INVALIDATE_(s, "333", "#", "errors", "#",
- "{ \"type\": {"
- " \"errorCode\": 20, \"instanceRef\": \"#\", \"schemaRef\": \"#\", \"expected\": [\"string\"], \"actual\": \"integer\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateContinueOnErrorFlag, SchemaValidator, Pointer);
-}
-
-
-TEST(SchemaValidator, UnknownValidationError) {
- ASSERT_TRUE(SchemaValidator::SchemaType::GetValidateErrorKeyword(kValidateErrors).GetString() == std::string("null"));
-}
-
-// The first occurrence of a duplicate keyword is taken
-TEST(SchemaValidator, DuplicateKeyword) {
- Document sd;
- sd.Parse("{ \"title\": \"test\",\"type\": \"number\", \"type\": \"string\" }");
- EXPECT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- VALIDATE(s, "42", true);
- INVALIDATE(s, "\"Life, the universe, and everything\"", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"number\"], \"actual\": \"string\""
- "}}");
-}
-
-
-// SchemaDocument tests
-
-// Specification (schema draft, open api version)
-TEST(SchemaValidator, Schema_SupportedNotObject) {
- Document sd;
- sd.Parse("true");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedNoSpec) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedNoSpecStatic) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- Specification spec = SchemaDocumentType::GetSpecification(sd);
- ASSERT_FALSE(spec.IsSupported());
- ASSERT_TRUE(spec.draft == kDraftNone);
- ASSERT_TRUE(spec.oapi == kVersionNone);
-}
-
-TEST(SchemaValidator, Schema_SupportedDraft5Static) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-05/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- Specification spec = SchemaDocumentType::GetSpecification(sd);
- ASSERT_TRUE(spec.IsSupported());
- ASSERT_TRUE(spec.draft == kDraft05);
- ASSERT_TRUE(spec.oapi == kVersionNone);
-}
-
-TEST(SchemaValidator, Schema_SupportedDraft4) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-04/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedDraft4NoFrag) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-04/schema\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedDraft5) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-05/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft05);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedDraft5NoFrag) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-05/schema\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft05);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_IgnoreDraftEmbedded) {
- Document sd;
- sd.Parse("{\"root\": {\"$schema\":\"http://json-schema.org/draft-05/schema#\", \"type\": \"integer\"}}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, SchemaDocument::PointerType("/root"));
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedDraftOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kDraft04));
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_UnknownDraftOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kDraftUnknown));
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraftUnknown);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraftOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kDraft03));
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft03);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnknownDraft) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-xxx/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraftUnknown);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnknownDraftNotString) {
- Document sd;
- sd.Parse("{\"$schema\": 4, \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraftUnknown);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraft3) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-03/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft03);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraft6) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-06/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft06);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraft7) {
- Document sd;
- sd.Parse("{\"$schema\":\"http://json-schema.org/draft-07/schema#\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft07);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraft2019_09) {
- Document sd;
- sd.Parse("{\"$schema\":\"https://json-schema.org/draft/2019-09/schema\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft2019_09);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedDraft2020_12) {
- Document sd;
- sd.Parse("{\"$schema\":\"https://json-schema.org/draft/2020-12/schema\", \"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().draft == kDraft2020_12);
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionNone);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_SupportedVersion20Static) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"swagger\":\"2.0\"}");
- ASSERT_FALSE(sd.HasParseError());
- Specification spec = SchemaDocumentType::GetSpecification(sd);
- ASSERT_TRUE(spec.IsSupported());
- ASSERT_TRUE(spec.draft == kDraft04);
- ASSERT_TRUE(spec.oapi == kVersion20);
-}
-
-TEST(SchemaValidator, Schema_SupportedVersion20) {
- Document sd;
- sd.Parse("{\"swagger\":\"2.0\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersion20);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedVersion30x) {
- Document sd;
- sd.Parse("{\"openapi\":\"3.0.0\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersion30);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft05);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_SupportedVersionOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kVersion20));
- ASSERT_TRUE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersion20);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- EXPECT_TRUE(s.GetError().ObjectEmpty());
-}
-
-TEST(SchemaValidator, Schema_UnknownVersionOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kVersionUnknown));
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionUnknown);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedVersionOverride) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kVersion31));
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersion31);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft2020_12);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnknownVersion) {
- Document sd;
- sd.Parse("{\"openapi\":\"1.0\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionUnknown);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnknownVersionShort) {
- Document sd;
- sd.Parse("{\"openapi\":\"3.0.\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionUnknown);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnknownVersionNotString) {
- Document sd;
- sd.Parse("{\"swagger\": 2}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersionUnknown);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft04);
- SCHEMAERROR(s, "{\"SpecUnknown\":{\"errorCode\":10,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_UnsupportedVersion31) {
- Document sd;
- sd.Parse("{\"openapi\":\"3.1.0\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_FALSE(s.IsSupportedSpecification());
- ASSERT_TRUE(s.GetSpecification().oapi == kVersion31);
- ASSERT_TRUE(s.GetSpecification().draft == kDraft2020_12);
- SCHEMAERROR(s, "{\"SpecUnsupported\":{\"errorCode\":11,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_DraftAndVersion) {
- Document sd;
- sd.Parse("{\"swagger\": \"2.0\", \"$schema\": \"http://json-schema.org/draft-04/schema#\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- ASSERT_TRUE(s.IsSupportedSpecification());
- SCHEMAERROR(s, "{\"SpecIllegal\":{\"errorCode\":12,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, Schema_StartUnknown) {
- Document sd;
- sd.Parse("{\"type\": \"integer\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd, 0, 0, 0, 0, SchemaDocument::PointerType("/nowhere"));
- SCHEMAERROR(s, "{\"StartUnknown\":{\"errorCode\":1,\"instanceRef\":\"#\", \"value\":\"#/nowhere\"}}");
-}
-
-TEST(SchemaValidator, Schema_MultipleErrors) {
- Document sd;
- sd.Parse("{\"swagger\": \"foo\", \"$schema\": \"bar\"}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s(sd);
- SCHEMAERROR(s, "{ \"SpecUnknown\": {\"errorCode\":10,\"instanceRef\":\"#\"},"
- " \"SpecIllegal\": {\"errorCode\":12,\"instanceRef\":\"#\"}"
- "}");
-}
-
-// $ref is a non-JSON pointer fragment - not allowed when OpenAPI
-TEST(SchemaValidator, Schema_RefPlainNameOpenApi) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"swagger\": \"2.0\", \"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"#myId\"}, \"myStr\": {\"type\": \"string\", \"id\": \"#myStrId\"}, \"myInt2\": {\"type\": \"integer\", \"id\": \"#myId\"}}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefPlainName\":{\"errorCode\":2,\"instanceRef\":\"#/properties/myInt1\",\"value\":\"#myId\"}}");
-}
-
-// $ref is a non-JSON pointer fragment - not allowed when remote document
-TEST(SchemaValidator, Schema_RefPlainNameRemote) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#plainname\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, &provider);
- SCHEMAERROR(s, "{\"RefPlainName\":{\"errorCode\":2,\"instanceRef\":\"#/properties/myInt\",\"value\":\"#plainname\"}}");
-}
-
-// $ref is an empty string
-TEST(SchemaValidator, Schema_RefEmptyString) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt1\": {\"$ref\": \"\"}}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefInvalid\":{\"errorCode\":3,\"instanceRef\":\"#/properties/myInt1\"}}");
-}
-
-// $ref is remote but no provider
-TEST(SchemaValidator, Schema_RefNoRemoteProvider) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#plainname\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, 0);
- SCHEMAERROR(s, "{\"RefNoRemoteProvider\":{\"errorCode\":7,\"instanceRef\":\"#/properties/myInt\"}}");
-}
-
-// $ref is remote but no schema returned
-TEST(SchemaValidator, Schema_RefNoRemoteSchema) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/will-not-resolve.json\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, &provider);
- SCHEMAERROR(s, "{\"RefNoRemoteSchema\":{\"errorCode\":8,\"instanceRef\":\"#/properties/myInt\",\"value\":\"http://localhost:1234/will-not-resolve.json\"}}");
-}
-
-// $ref pointer is invalid
-TEST(SchemaValidator, Schema_RefPointerInvalid) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"#/&&&&&\"}}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefPointerInvalid\":{\"errorCode\":4,\"instanceRef\":\"#/properties/myInt\",\"value\":\"#/&&&&&\",\"offset\":2}}");
-}
-
-// $ref is remote and pointer is invalid
-TEST(SchemaValidator, Schema_RefPointerInvalidRemote) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#/abc&&&&&\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, &provider);
- SCHEMAERROR(s, "{\"RefPointerInvalid\":{\"errorCode\":4,\"instanceRef\":\"#/properties/myInt\",\"value\":\"#/abc&&&&&\",\"offset\":5}}");
-}
-
-// $ref is unknown non-pointer
-TEST(SchemaValidator, Schema_RefUnknownPlainName) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"#plainname\"}}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefUnknown\":{\"errorCode\":5,\"instanceRef\":\"#/properties/myInt\",\"value\":\"#plainname\"}}");
-}
-
-/// $ref is unknown pointer
-TEST(SchemaValidator, Schema_RefUnknownPointer) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"#/a/b\"}}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefUnknown\":{\"errorCode\":5,\"instanceRef\":\"#/properties/myInt\",\"value\":\"#/a/b\"}}");
-}
-
-// $ref is remote and unknown pointer
-TEST(SchemaValidator, Schema_RefUnknownPointerRemote) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- RemoteSchemaDocumentProvider<SchemaDocumentType> provider;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {\"myInt\": {\"$ref\": \"/subSchemas.json#/a/b\"}}}");
- SchemaDocumentType s(sd, "http://localhost:1234/xxxx", 26, &provider);
- SCHEMAERROR(s, "{\"RefUnknown\":{\"errorCode\":5,\"instanceRef\":\"#/properties/myInt\",\"value\":\"http://localhost:1234/subSchemas.json#/a/b\"}}");
-}
-
-// $ref is cyclical
-TEST(SchemaValidator, Schema_RefCyclical) {
- typedef GenericSchemaDocument<Value, MemoryPoolAllocator<> > SchemaDocumentType;
- Document sd;
- sd.Parse("{\"type\": \"object\", \"properties\": {"
- " \"cyclic_source\": {"
- " \"$ref\": \"#/properties/cyclic_target\""
- " },"
- " \"cyclic_target\": {"
- " \"$ref\": \"#/properties/cyclic_source\""
- " }"
- "}}");
- SchemaDocumentType s(sd);
- SCHEMAERROR(s, "{\"RefCyclical\":{\"errorCode\":6,\"instanceRef\":\"#/properties/cyclic_target\",\"value\":\"#/properties/cyclic_source\"}}");
-}
-
-TEST(SchemaValidator, Schema_ReadOnlyAndWriteOnly) {
- Document sd;
- sd.Parse("{\"type\": \"integer\", \"readOnly\": true, \"writeOnly\": true}");
- ASSERT_FALSE(sd.HasParseError());
- SchemaDocument s1(sd, 0, 0, 0, 0, 0, Specification(kDraft04));
- EXPECT_TRUE(s1.GetError().ObjectEmpty());
- SchemaDocument s2(sd, 0, 0, 0, 0, 0, Specification(kVersion30));
- SCHEMAERROR(s2, "{\"ReadOnlyAndWriteOnly\":{\"errorCode\":13,\"instanceRef\":\"#\"}}");
-}
-
-TEST(SchemaValidator, ReadOnlyWhenWriting) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\":\"object\","
- " \"properties\": {"
- " \"rprop\" : {"
- " \"type\": \"string\","
- " \"readOnly\": true"
- " }"
- " }"
- "}");
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kVersion20));
- VALIDATE(s, "{ \"rprop\": \"hello\" }", true);
- INVALIDATE_(s, "{ \"rprop\": \"hello\" }", "/properties/rprop", "readOnly", "/rprop",
- "{ \"readOnly\": {"
- " \"errorCode\": 26, \"instanceRef\": \"#/rprop\", \"schemaRef\": \"#/properties/rprop\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateWriteFlag, SchemaValidator, Pointer);
-}
-
-TEST(SchemaValidator, WriteOnlyWhenReading) {
- Document sd;
- sd.Parse(
- "{"
- " \"type\":\"object\","
- " \"properties\": {"
- " \"wprop\" : {"
- " \"type\": \"boolean\","
- " \"writeOnly\": true"
- " }"
- " }"
- "}");
- SchemaDocument s(sd, 0, 0, 0, 0, 0, Specification(kVersion30));
- VALIDATE(s, "{ \"wprop\": true }", true);
- INVALIDATE_(s, "{ \"wprop\": true }", "/properties/wprop", "writeOnly", "/wprop",
- "{ \"writeOnly\": {"
- " \"errorCode\": 27, \"instanceRef\": \"#/wprop\", \"schemaRef\": \"#/properties/wprop\""
- " }"
- "}",
- kValidateDefaultFlags | kValidateReadFlag, SchemaValidator, Pointer);
-}
-
-TEST(SchemaValidator, NullableTrue) {
- Document sd;
- sd.Parse("{\"type\": \"string\", \"nullable\": true}");
- SchemaDocument s(sd, 0, 0, 0, 0, 0, kVersion20);
-
- VALIDATE(s, "\"hello\"", true);
- INVALIDATE(s, "null", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"null\""
- "}}");
- INVALIDATE(s, "false", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"boolean\""
- "}}");
-
- SchemaDocument s30(sd, 0, 0, 0, 0, 0, kVersion30);
-
- VALIDATE(s30, "\"hello\"", true);
- VALIDATE(s30, "null", true);
- INVALIDATE(s30, "false", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"null\", \"string\"], \"actual\": \"boolean\""
- "}}");
-}
-
-TEST(SchemaValidator, NullableFalse) {
- Document sd;
- sd.Parse("{\"type\": \"string\", \"nullable\": false}");
- SchemaDocument s(sd, 0, 0, 0, 0, 0, kVersion20);
-
- VALIDATE(s, "\"hello\"", true);
- INVALIDATE(s, "null", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"null\""
- "}}");
- INVALIDATE(s, "false", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"boolean\""
- "}}");
-
- SchemaDocument s30(sd, 0, 0, 0, 0, 0, kVersion30);
-
- VALIDATE(s30, "\"hello\"", true);
- INVALIDATE(s, "null", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"null\""
- "}}");
- INVALIDATE(s30, "false", "", "type", "",
- "{ \"type\": {"
- " \"errorCode\": 20,"
- " \"instanceRef\": \"#\", \"schemaRef\": \"#\","
- " \"expected\": [\"string\"], \"actual\": \"boolean\""
- "}}");
-}
-
-#if defined(_MSC_VER) || defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/simdtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/simdtest.cpp
deleted file mode 100644
index 1e1b937cf3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/simdtest.cpp
+++ /dev/null
@@ -1,219 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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.
-
-// Since Travis CI installs old Valgrind 3.7.0, which fails with some SSE4.2
-// The unit tests prefix with SIMD should be skipped by Valgrind test
-
-// __SSE2__ and __SSE4_2__ are recognized by gcc, clang, and the Intel compiler.
-// We use -march=native with gmake to enable -msse2 and -msse4.2, if supported.
-#if defined(__SSE4_2__)
-# define RAPIDJSON_SSE42
-#elif defined(__SSE2__)
-# define RAPIDJSON_SSE2
-#elif defined(__ARM_NEON)
-# define RAPIDJSON_NEON
-#endif
-
-#define RAPIDJSON_NAMESPACE rapidjson_simd
-
-#include "unittest.h"
-
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(effc++)
-#endif
-
-using namespace rapidjson_simd;
-
-#ifdef RAPIDJSON_SSE2
-#define SIMD_SUFFIX(name) name##_SSE2
-#elif defined(RAPIDJSON_SSE42)
-#define SIMD_SUFFIX(name) name##_SSE42
-#elif defined(RAPIDJSON_NEON)
-#define SIMD_SUFFIX(name) name##_NEON
-#else
-#define SIMD_SUFFIX(name) name
-#endif
-
-#define SIMD_SIZE_ALIGN(n) ((size_t(n) + 15) & ~size_t(15))
-
-template <typename StreamType>
-void TestSkipWhitespace() {
- for (size_t step = 1; step < 32; step++) {
- char buffer[SIMD_SIZE_ALIGN(1025)];
- for (size_t i = 0; i < 1024; i++)
- buffer[i] = " \t\r\n"[i % 4];
- for (size_t i = 0; i < 1024; i += step)
- buffer[i] = 'X';
- buffer[1024] = '\0';
-
- StreamType s(buffer);
- size_t i = 0;
- for (;;) {
- SkipWhitespace(s);
- if (s.Peek() == '\0')
- break;
- EXPECT_EQ(i, s.Tell());
- EXPECT_EQ('X', s.Take());
- i += step;
- }
- }
-}
-
-TEST(SIMD, SIMD_SUFFIX(SkipWhitespace)) {
- TestSkipWhitespace<StringStream>();
- TestSkipWhitespace<InsituStringStream>();
-}
-
-TEST(SIMD, SIMD_SUFFIX(SkipWhitespace_EncodedMemoryStream)) {
- for (size_t step = 1; step < 32; step++) {
- char buffer[SIMD_SIZE_ALIGN(1024)];
- for (size_t i = 0; i < 1024; i++)
- buffer[i] = " \t\r\n"[i % 4];
- for (size_t i = 0; i < 1024; i += step)
- buffer[i] = 'X';
-
- MemoryStream ms(buffer, 1024);
- EncodedInputStream<UTF8<>, MemoryStream> s(ms);
- for (;;) {
- SkipWhitespace(s);
- if (s.Peek() == '\0')
- break;
- //EXPECT_EQ(i, s.Tell());
- EXPECT_EQ('X', s.Take());
- }
- }
-}
-
-struct ScanCopyUnescapedStringHandler : BaseReaderHandler<UTF8<>, ScanCopyUnescapedStringHandler> {
- bool String(const char* str, size_t length, bool) {
- memcpy(buffer, str, length + 1);
- return true;
- }
- char buffer[1024 + 5 + 32];
-};
-
-template <unsigned parseFlags, typename StreamType>
-void TestScanCopyUnescapedString() {
- char buffer[SIMD_SIZE_ALIGN(1024u + 5 + 32)];
- char backup[SIMD_SIZE_ALIGN(1024u + 5 + 32)];
-
- // Test "ABCDABCD...\\"
- for (size_t offset = 0; offset < 32; offset++) {
- for (size_t step = 0; step < 1024; step++) {
- char* json = buffer + offset;
- char *p = json;
- *p++ = '\"';
- for (size_t i = 0; i < step; i++)
- *p++ = "ABCD"[i % 4];
- *p++ = '\\';
- *p++ = '\\';
- *p++ = '\"';
- *p++ = '\0';
- strcpy(backup, json); // insitu parsing will overwrite buffer, so need to backup first
-
- StreamType s(json);
- Reader reader;
- ScanCopyUnescapedStringHandler h;
- reader.Parse<parseFlags>(s, h);
- EXPECT_TRUE(memcmp(h.buffer, backup + 1, step) == 0);
- EXPECT_EQ('\\', h.buffer[step]); // escaped
- EXPECT_EQ('\0', h.buffer[step + 1]);
- }
- }
-
- // Test "\\ABCDABCD..."
- for (size_t offset = 0; offset < 32; offset++) {
- for (size_t step = 0; step < 1024; step++) {
- char* json = buffer + offset;
- char *p = json;
- *p++ = '\"';
- *p++ = '\\';
- *p++ = '\\';
- for (size_t i = 0; i < step; i++)
- *p++ = "ABCD"[i % 4];
- *p++ = '\"';
- *p++ = '\0';
- strcpy(backup, json); // insitu parsing will overwrite buffer, so need to backup first
-
- StreamType s(json);
- Reader reader;
- ScanCopyUnescapedStringHandler h;
- reader.Parse<parseFlags>(s, h);
- EXPECT_TRUE(memcmp(h.buffer + 1, backup + 3, step) == 0);
- EXPECT_EQ('\\', h.buffer[0]); // escaped
- EXPECT_EQ('\0', h.buffer[step + 1]);
- }
- }
-}
-
-TEST(SIMD, SIMD_SUFFIX(ScanCopyUnescapedString)) {
- TestScanCopyUnescapedString<kParseDefaultFlags, StringStream>();
- TestScanCopyUnescapedString<kParseInsituFlag, InsituStringStream>();
-}
-
-TEST(SIMD, SIMD_SUFFIX(ScanWriteUnescapedString)) {
- char buffer[SIMD_SIZE_ALIGN(2048 + 1 + 32)];
- for (size_t offset = 0; offset < 32; offset++) {
- for (size_t step = 0; step < 1024; step++) {
- char* s = buffer + offset;
- char* p = s;
- for (size_t i = 0; i < step; i++)
- *p++ = "ABCD"[i % 4];
- char escape = "\0\n\\\""[step % 4];
- *p++ = escape;
- for (size_t i = 0; i < step; i++)
- *p++ = "ABCD"[i % 4];
-
- StringBuffer sb;
- Writer<StringBuffer> writer(sb);
- writer.String(s, SizeType(step * 2 + 1));
- const char* q = sb.GetString();
- EXPECT_EQ('\"', *q++);
- for (size_t i = 0; i < step; i++)
- EXPECT_EQ("ABCD"[i % 4], *q++);
- if (escape == '\0') {
- EXPECT_EQ('\\', *q++);
- EXPECT_EQ('u', *q++);
- EXPECT_EQ('0', *q++);
- EXPECT_EQ('0', *q++);
- EXPECT_EQ('0', *q++);
- EXPECT_EQ('0', *q++);
- }
- else if (escape == '\n') {
- EXPECT_EQ('\\', *q++);
- EXPECT_EQ('n', *q++);
- }
- else if (escape == '\\') {
- EXPECT_EQ('\\', *q++);
- EXPECT_EQ('\\', *q++);
- }
- else if (escape == '\"') {
- EXPECT_EQ('\\', *q++);
- EXPECT_EQ('\"', *q++);
- }
- for (size_t i = 0; i < step; i++)
- EXPECT_EQ("ABCD"[i % 4], *q++);
- EXPECT_EQ('\"', *q++);
- EXPECT_EQ('\0', *q++);
- }
- }
-}
-
-#ifdef __GNUC__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strfunctest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strfunctest.cpp
deleted file mode 100644
index a8d0aad158..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strfunctest.cpp
+++ /dev/null
@@ -1,30 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/internal/strfunc.h"
-
-using namespace rapidjson;
-using namespace rapidjson::internal;
-
-TEST(StrFunc, CountStringCodePoint) {
- SizeType count;
- EXPECT_TRUE(CountStringCodePoint<UTF8<> >("", 0, &count));
- EXPECT_EQ(0u, count);
- EXPECT_TRUE(CountStringCodePoint<UTF8<> >("Hello", 5, &count));
- EXPECT_EQ(5u, count);
- EXPECT_TRUE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E", 9, &count)); // cents euro G-clef
- EXPECT_EQ(3u, count);
- EXPECT_FALSE(CountStringCodePoint<UTF8<> >("\xC2\xA2\xE2\x82\xAC\xF0\x9D\x84\x9E\x80", 10, &count));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/stringbuffertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/stringbuffertest.cpp
deleted file mode 100644
index a7ec2b6af6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/stringbuffertest.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/writer.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-using namespace rapidjson;
-
-TEST(StringBuffer, InitialSize) {
- StringBuffer buffer;
- EXPECT_EQ(0u, buffer.GetSize());
- EXPECT_EQ(0u, buffer.GetLength());
- EXPECT_STREQ("", buffer.GetString());
-}
-
-TEST(StringBuffer, Put) {
- StringBuffer buffer;
- buffer.Put('A');
-
- EXPECT_EQ(1u, buffer.GetSize());
- EXPECT_EQ(1u, buffer.GetLength());
- EXPECT_STREQ("A", buffer.GetString());
-}
-
-TEST(StringBuffer, PutN_Issue672) {
- GenericStringBuffer<UTF8<>, MemoryPoolAllocator<> > buffer;
- EXPECT_EQ(0u, buffer.GetSize());
- EXPECT_EQ(0u, buffer.GetLength());
- rapidjson::PutN(buffer, ' ', 1);
- EXPECT_EQ(1u, buffer.GetSize());
- EXPECT_EQ(1u, buffer.GetLength());
-}
-
-TEST(StringBuffer, Clear) {
- StringBuffer buffer;
- buffer.Put('A');
- buffer.Put('B');
- buffer.Put('C');
- buffer.Clear();
-
- EXPECT_EQ(0u, buffer.GetSize());
- EXPECT_EQ(0u, buffer.GetLength());
- EXPECT_STREQ("", buffer.GetString());
-}
-
-TEST(StringBuffer, Push) {
- StringBuffer buffer;
- buffer.Push(5);
-
- EXPECT_EQ(5u, buffer.GetSize());
- EXPECT_EQ(5u, buffer.GetLength());
-
- // Causes sudden expansion to make the stack's capacity equal to size
- buffer.Push(65536u);
- EXPECT_EQ(5u + 65536u, buffer.GetSize());
-}
-
-TEST(StringBuffer, Pop) {
- StringBuffer buffer;
- buffer.Put('A');
- buffer.Put('B');
- buffer.Put('C');
- buffer.Put('D');
- buffer.Put('E');
- buffer.Pop(3);
-
- EXPECT_EQ(2u, buffer.GetSize());
- EXPECT_EQ(2u, buffer.GetLength());
- EXPECT_STREQ("AB", buffer.GetString());
-}
-
-TEST(StringBuffer, GetLength_Issue744) {
- GenericStringBuffer<UTF16<wchar_t> > buffer;
- buffer.Put('A');
- buffer.Put('B');
- buffer.Put('C');
- EXPECT_EQ(3u * sizeof(wchar_t), buffer.GetSize());
- EXPECT_EQ(3u, buffer.GetLength());
-}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-#if 0 // Many old compiler does not support these. Turn it off temporaily.
-
-#include <type_traits>
-
-TEST(StringBuffer, Traits) {
- static_assert( std::is_constructible<StringBuffer>::value, "");
- static_assert( std::is_default_constructible<StringBuffer>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_constructible<StringBuffer>::value, "");
-#endif
- static_assert( std::is_move_constructible<StringBuffer>::value, "");
-
- static_assert(!std::is_nothrow_constructible<StringBuffer>::value, "");
- static_assert(!std::is_nothrow_default_constructible<StringBuffer>::value, "");
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1800
- static_assert(!std::is_nothrow_copy_constructible<StringBuffer>::value, "");
- static_assert(!std::is_nothrow_move_constructible<StringBuffer>::value, "");
-#endif
-
- static_assert( std::is_assignable<StringBuffer,StringBuffer>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_assignable<StringBuffer>::value, "");
-#endif
- static_assert( std::is_move_assignable<StringBuffer>::value, "");
-
-#if !defined(_MSC_VER) || _MSC_VER >= 1800
- static_assert(!std::is_nothrow_assignable<StringBuffer, StringBuffer>::value, "");
-#endif
-
- static_assert(!std::is_nothrow_copy_assignable<StringBuffer>::value, "");
- static_assert(!std::is_nothrow_move_assignable<StringBuffer>::value, "");
-
- static_assert( std::is_destructible<StringBuffer>::value, "");
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_destructible<StringBuffer>::value, "");
-#endif
-}
-
-#endif
-
-TEST(StringBuffer, MoveConstructor) {
- StringBuffer x;
- x.Put('A');
- x.Put('B');
- x.Put('C');
- x.Put('D');
-
- EXPECT_EQ(4u, x.GetSize());
- EXPECT_EQ(4u, x.GetLength());
- EXPECT_STREQ("ABCD", x.GetString());
-
- // StringBuffer y(x); // does not compile (!is_copy_constructible)
- StringBuffer y(std::move(x));
- EXPECT_EQ(0u, x.GetSize());
- EXPECT_EQ(0u, x.GetLength());
- EXPECT_EQ(4u, y.GetSize());
- EXPECT_EQ(4u, y.GetLength());
- EXPECT_STREQ("ABCD", y.GetString());
-
- // StringBuffer z = y; // does not compile (!is_copy_assignable)
- StringBuffer z = std::move(y);
- EXPECT_EQ(0u, y.GetSize());
- EXPECT_EQ(0u, y.GetLength());
- EXPECT_EQ(4u, z.GetSize());
- EXPECT_EQ(4u, z.GetLength());
- EXPECT_STREQ("ABCD", z.GetString());
-}
-
-TEST(StringBuffer, MoveAssignment) {
- StringBuffer x;
- x.Put('A');
- x.Put('B');
- x.Put('C');
- x.Put('D');
-
- EXPECT_EQ(4u, x.GetSize());
- EXPECT_EQ(4u, x.GetLength());
- EXPECT_STREQ("ABCD", x.GetString());
-
- StringBuffer y;
- // y = x; // does not compile (!is_copy_assignable)
- y = std::move(x);
- EXPECT_EQ(0u, x.GetSize());
- EXPECT_EQ(4u, y.GetLength());
- EXPECT_STREQ("ABCD", y.GetString());
-}
-
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strtodtest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strtodtest.cpp
deleted file mode 100644
index 2fcb63524f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/strtodtest.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/internal/strtod.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(unreachable-code)
-#endif
-
-#define BIGINTEGER_LITERAL(s) BigInteger(s, sizeof(s) - 1)
-
-using namespace rapidjson::internal;
-
-TEST(Strtod, CheckApproximationCase) {
- static const int kSignificandSize = 52;
- static const int kExponentBias = 0x3FF;
- static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000);
- static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF);
- static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000);
-
- // http://www.exploringbinary.com/using-integers-to-check-a-floating-point-approximation/
- // Let b = 0x1.465a72e467d88p-149
- // = 5741268244528520 x 2^-201
- union {
- double d;
- uint64_t u;
- }u;
- u.u = 0x465a72e467d88 | ((static_cast<uint64_t>(-149 + kExponentBias)) << kSignificandSize);
- const double b = u.d;
- const uint64_t bInt = (u.u & kSignificandMask) | kHiddenBit;
- const int bExp = static_cast<int>(((u.u & kExponentMask) >> kSignificandSize) - kExponentBias - kSignificandSize);
- EXPECT_DOUBLE_EQ(1.7864e-45, b);
- EXPECT_EQ(RAPIDJSON_UINT64_C2(0x001465a7, 0x2e467d88), bInt);
- EXPECT_EQ(-201, bExp);
-
- // Let d = 17864 x 10-49
- const char dInt[] = "17864";
- const int dExp = -49;
-
- // Let h = 2^(bExp-1)
- const int hExp = bExp - 1;
- EXPECT_EQ(-202, hExp);
-
- int dS_Exp2 = 0;
- int dS_Exp5 = 0;
- int bS_Exp2 = 0;
- int bS_Exp5 = 0;
- int hS_Exp2 = 0;
- int hS_Exp5 = 0;
-
- // Adjust for decimal exponent
- if (dExp >= 0) {
- dS_Exp2 += dExp;
- dS_Exp5 += dExp;
- }
- else {
- bS_Exp2 -= dExp;
- bS_Exp5 -= dExp;
- hS_Exp2 -= dExp;
- hS_Exp5 -= dExp;
- }
-
- // Adjust for binary exponent
- if (bExp >= 0)
- bS_Exp2 += bExp;
- else {
- dS_Exp2 -= bExp;
- hS_Exp2 -= bExp;
- }
-
- // Adjust for half ulp exponent
- if (hExp >= 0)
- hS_Exp2 += hExp;
- else {
- dS_Exp2 -= hExp;
- bS_Exp2 -= hExp;
- }
-
- // Remove common power of two factor from all three scaled values
- int common_Exp2 = (std::min)(dS_Exp2, (std::min)(bS_Exp2, hS_Exp2));
- dS_Exp2 -= common_Exp2;
- bS_Exp2 -= common_Exp2;
- hS_Exp2 -= common_Exp2;
-
- EXPECT_EQ(153, dS_Exp2);
- EXPECT_EQ(0, dS_Exp5);
- EXPECT_EQ(1, bS_Exp2);
- EXPECT_EQ(49, bS_Exp5);
- EXPECT_EQ(0, hS_Exp2);
- EXPECT_EQ(49, hS_Exp5);
-
- BigInteger dS = BIGINTEGER_LITERAL(dInt);
- dS.MultiplyPow5(static_cast<unsigned>(dS_Exp5)) <<= static_cast<size_t>(dS_Exp2);
-
- BigInteger bS(bInt);
- bS.MultiplyPow5(static_cast<unsigned>(bS_Exp5)) <<= static_cast<size_t>(bS_Exp2);
-
- BigInteger hS(1);
- hS.MultiplyPow5(static_cast<unsigned>(hS_Exp5)) <<= static_cast<size_t>(hS_Exp2);
-
- EXPECT_TRUE(BIGINTEGER_LITERAL("203970822259994138521801764465966248930731085529088") == dS);
- EXPECT_TRUE(BIGINTEGER_LITERAL("203970822259994122305215569213032722473144531250000") == bS);
- EXPECT_TRUE(BIGINTEGER_LITERAL("17763568394002504646778106689453125") == hS);
-
- EXPECT_EQ(1, dS.Compare(bS));
-
- BigInteger delta(0);
- EXPECT_FALSE(dS.Difference(bS, &delta));
- EXPECT_TRUE(BIGINTEGER_LITERAL("16216586195252933526457586554279088") == delta);
- EXPECT_TRUE(bS.Difference(dS, &delta));
- EXPECT_TRUE(BIGINTEGER_LITERAL("16216586195252933526457586554279088") == delta);
-
- EXPECT_EQ(-1, delta.Compare(hS));
-}
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.cpp
deleted file mode 100644
index c5b6f2710a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.cpp
+++ /dev/null
@@ -1,51 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/rapidjson.h"
-
-#ifdef __clang__
-#pragma GCC diagnostic push
-#if __has_warning("-Wdeprecated")
-#pragma GCC diagnostic ignored "-Wdeprecated"
-#endif
-#endif
-
-AssertException::~AssertException() throw() {}
-
-#ifdef __clang__
-#pragma GCC diagnostic pop
-#endif
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- std::cout << "RapidJSON v" << RAPIDJSON_VERSION_STRING << std::endl;
-
-#ifdef _MSC_VER
- _CrtMemState memoryState = { 0 };
- (void)memoryState;
- _CrtMemCheckpoint(&memoryState);
- //_CrtSetBreakAlloc(X);
- //void *testWhetherMemoryLeakDetectionWorks = malloc(1);
-#endif
-
- int ret = RUN_ALL_TESTS();
-
-#ifdef _MSC_VER
- // Current gtest constantly leak 2 blocks at exit
- _CrtMemDumpAllObjectsSince(&memoryState);
-#endif
- return ret;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.h b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.h
deleted file mode 100644
index 567389a17a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/unittest.h
+++ /dev/null
@@ -1,143 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// Unless required by applicable law or agreed to in writing, software distributed
-// under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
-// CONDITIONS OF ANY KIND, either express or implied. See the License for the
-// specific language governing permissions and limitations under the License.
-
-#ifndef UNITTEST_H_
-#define UNITTEST_H_
-
-// gtest indirectly included inttypes.h, without __STDC_CONSTANT_MACROS.
-#ifndef __STDC_CONSTANT_MACROS
-#ifdef __clang__
-#pragma GCC diagnostic push
-#if __has_warning("-Wreserved-id-macro")
-#pragma GCC diagnostic ignored "-Wreserved-id-macro"
-#endif
-#endif
-
-# define __STDC_CONSTANT_MACROS 1 // required by C++ standard
-
-#ifdef __clang__
-#pragma GCC diagnostic pop
-#endif
-#endif
-
-#ifdef _MSC_VER
-#define _CRTDBG_MAP_ALLOC
-#include <crtdbg.h>
-#pragma warning(disable : 4996) // 'function': was declared deprecated
-#endif
-
-#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2))
-#if defined(__clang__) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#pragma GCC diagnostic push
-#endif
-#pragma GCC diagnostic ignored "-Weffc++"
-#endif
-
-#include "gtest/gtest.h"
-#include <stdexcept>
-
-#if defined(__clang__) || defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
-#pragma GCC diagnostic pop
-#endif
-
-#ifdef __clang__
-// All TEST() macro generated this warning, disable globally
-#pragma GCC diagnostic ignored "-Wglobal-constructors"
-#endif
-
-template <typename Ch>
-inline unsigned StrLen(const Ch* s) {
- const Ch* p = s;
- while (*p) p++;
- return unsigned(p - s);
-}
-
-template<typename Ch>
-inline int StrCmp(const Ch* s1, const Ch* s2) {
- while(*s1 && (*s1 == *s2)) { s1++; s2++; }
- return static_cast<unsigned>(*s1) < static_cast<unsigned>(*s2) ? -1 : static_cast<unsigned>(*s1) > static_cast<unsigned>(*s2);
-}
-
-template <typename Ch>
-inline Ch* StrDup(const Ch* str) {
- size_t bufferSize = sizeof(Ch) * (StrLen(str) + 1);
- Ch* buffer = static_cast<Ch*>(malloc(bufferSize));
- memcpy(buffer, str, bufferSize);
- return buffer;
-}
-
-inline FILE* TempFile(char *filename) {
-#if defined(__WIN32__) || defined(_MSC_VER)
- filename = tmpnam(filename);
-
- // For Visual Studio, tmpnam() adds a backslash in front. Remove it.
- if (filename[0] == '\\')
- for (int i = 0; filename[i] != '\0'; i++)
- filename[i] = filename[i + 1];
-
- return fopen(filename, "wb");
-#else
- strcpy(filename, "/tmp/fileXXXXXX");
- int fd = mkstemp(filename);
- return fdopen(fd, "w");
-#endif
-}
-
-// Use exception for catching assert
-#ifdef _MSC_VER
-#pragma warning(disable : 4127)
-#endif
-
-#ifdef __clang__
-#pragma GCC diagnostic push
-#if __has_warning("-Wdeprecated")
-#pragma GCC diagnostic ignored "-Wdeprecated"
-#endif
-#endif
-
-class AssertException : public std::logic_error {
-public:
- AssertException(const char* w) : std::logic_error(w) {}
- AssertException(const AssertException& rhs) : std::logic_error(rhs) {}
- virtual ~AssertException() throw();
-};
-
-#ifdef __clang__
-#pragma GCC diagnostic pop
-#endif
-
-// Not using noexcept for testing RAPIDJSON_ASSERT()
-#define RAPIDJSON_HAS_CXX11_NOEXCEPT 0
-
-#ifndef RAPIDJSON_ASSERT
-#define RAPIDJSON_ASSERT(x) (!(x) ? throw AssertException(RAPIDJSON_STRINGIFY(x)) : (void)0u)
-#ifndef RAPIDJSON_ASSERT_THROWS
-#define RAPIDJSON_ASSERT_THROWS
-#endif
-#endif
-
-class Random {
-public:
- Random(unsigned seed = 0) : mSeed(seed) {}
-
- unsigned operator()() {
- mSeed = 214013 * mSeed + 2531011;
- return mSeed;
- }
-
-private:
- unsigned mSeed;
-};
-
-#endif // UNITTEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/uritest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/uritest.cpp
deleted file mode 100644
index 789c9dd828..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/uritest.cpp
+++ /dev/null
@@ -1,725 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// (C) Copyright IBM Corporation 2021
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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.
-
-#define RAPIDJSON_SCHEMA_VERBOSE 0
-#define RAPIDJSON_HAS_STDSTRING 1
-
-#include "unittest.h"
-#include "rapidjson/document.h"
-#include "rapidjson/uri.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(variadic-macros)
-#elif defined(_MSC_VER)
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(4822) // local class member function does not have a body
-#endif
-
-using namespace rapidjson;
-
-TEST(Uri, DefaultConstructor) {
- typedef GenericUri<Value> UriType;
- UriType u;
- EXPECT_TRUE(u.GetSchemeString() == 0);
- EXPECT_TRUE(u.GetAuthString() == 0);
- EXPECT_TRUE(u.GetPathString() == 0);
- EXPECT_TRUE(u.GetBaseString() == 0);
- EXPECT_TRUE(u.GetQueryString() == 0);
- EXPECT_TRUE(u.GetFragString() == 0);
- EXPECT_TRUE(u.GetString() == 0);
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(u.GetPathStringLength() == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
- EXPECT_TRUE(u.GetStringLength() == 0);
-}
-
-TEST(Uri, Parse) {
- typedef GenericUri<Value, MemoryPoolAllocator<> > UriType;
- MemoryPoolAllocator<CrtAllocator> allocator;
- Value v;
- Value w;
-
- v.SetString("http://auth/path/xxx?query#frag", allocator);
- UriType u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "/path/xxx") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth/path/xxx?query") == 0);
- EXPECT_TRUE(StrCmp(u.GetQueryString(), "?query") == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag") == 0);
- u.Get(w, allocator);
- EXPECT_TRUE(*w.GetString() == *v.GetString());
-
- v.SetString("urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), "urn:") == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
- u.Get(w, allocator);
- EXPECT_TRUE(*w.GetString() == *v.GetString());
-
- v.SetString("", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(u.GetPathStringLength() == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- v.SetString("http://auth/", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth/") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- u = UriType("/path/sub");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "/path/sub") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "/path/sub") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- // absolute path gets normalized
- u = UriType("/path/../sub/");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "/sub/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "/sub/") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- // relative path does not
- u = UriType("path/../sub");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "path/../sub") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "path/../sub") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- u = UriType("http://auth#frag/stuff");
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), "//auth") == 0);
- EXPECT_TRUE(u.GetPathStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "http://auth") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
- EXPECT_TRUE(StrCmp(u.GetString(), "http://auth#frag/stuff") == 0);
-
- const Value::Ch c[] = { '#', 'f', 'r', 'a', 'g', '/', 's', 't', 'u', 'f', 'f', '\0'};
- SizeType len = internal::StrLen<Value::Ch>(c);
- u = UriType(c, len);
- EXPECT_TRUE(StrCmp(u.GetString(), "#frag/stuff") == 0);
- EXPECT_TRUE(u.GetStringLength() == len);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "") == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
- EXPECT_TRUE(u.GetFragStringLength() == len);
-
- u = UriType(c);
- EXPECT_TRUE(StrCmp(u.GetString(), "#frag/stuff") == 0);
- EXPECT_TRUE(u.GetStringLength() == len);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "") == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), "#frag/stuff") == 0);
- EXPECT_TRUE(u.GetFragStringLength() == len);
-
- // Incomplete auth treated as path
- u = UriType("http:/");
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), "http:") == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), "/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), "http:/") == 0);
-}
-
-TEST(Uri, Parse_UTF16) {
- typedef GenericValue<UTF16<> > Value16;
- typedef GenericUri<Value16, MemoryPoolAllocator<> > UriType;
- MemoryPoolAllocator<CrtAllocator> allocator;
- Value16 v;
- Value16 w;
-
- v.SetString(L"http://auth/path/xxx?query#frag", allocator);
- UriType u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"/path/xxx") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth/path/xxx?query") == 0);
- EXPECT_TRUE(StrCmp(u.GetQueryString(), L"?query") == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag") == 0);
- u.Get(w, allocator);
- EXPECT_TRUE(*w.GetString() == *v.GetString());
-
- v.SetString(L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"urn:") == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
- u.Get(w, allocator);
- EXPECT_TRUE(*w.GetString() == *v.GetString());
-
- v.SetString(L"", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(u.GetPathStringLength() == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- v.SetString(L"http://auth/", allocator);
- u = UriType(v, &allocator);
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth/") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- u = UriType(L"/path/sub");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"/path/sub") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"/path/sub") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- // absolute path gets normalized
- u = UriType(L"/path/../sub/");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"/sub/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"/sub/") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- // relative path does not
- u = UriType(L"path/../sub");
- EXPECT_TRUE(u.GetSchemeStringLength() == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"path/../sub") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"path/../sub") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(u.GetFragStringLength() == 0);
-
- u = UriType(L"http://auth#frag/stuff");
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
- EXPECT_TRUE(StrCmp(u.GetAuthString(), L"//auth") == 0);
- EXPECT_TRUE(u.GetPathStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http://auth") == 0);
- EXPECT_TRUE(u.GetQueryStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
- EXPECT_TRUE(StrCmp(u.GetString(), L"http://auth#frag/stuff") == 0);
-
- const Value16::Ch c[] = { '#', 'f', 'r', 'a', 'g', '/', 's', 't', 'u', 'f', 'f', '\0'};
- SizeType len = internal::StrLen<Value16::Ch>(c);
- u = UriType(c, len);
- EXPECT_TRUE(StrCmp(u.GetString(), L"#frag/stuff") == 0);
- EXPECT_TRUE(u.GetStringLength() == len);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"") == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
- EXPECT_TRUE(u.GetFragStringLength() == len);
-
- u = UriType(c);
- EXPECT_TRUE(StrCmp(u.GetString(), L"#frag/stuff") == 0);
- EXPECT_TRUE(u.GetStringLength() == len);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"") == 0);
- EXPECT_TRUE(u.GetBaseStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetFragString(), L"#frag/stuff") == 0);
- EXPECT_TRUE(u.GetFragStringLength() == len);
-
- // Incomplete auth treated as path
- u = UriType(L"http:/");
- EXPECT_TRUE(StrCmp(u.GetSchemeString(), L"http:") == 0);
- EXPECT_TRUE(u.GetAuthStringLength() == 0);
- EXPECT_TRUE(StrCmp(u.GetPathString(), L"/") == 0);
- EXPECT_TRUE(StrCmp(u.GetBaseString(), L"http:/") == 0);
-}
-
-#if RAPIDJSON_HAS_STDSTRING
-TEST(Uri, Parse_Std) {
- typedef GenericUri<Value, MemoryPoolAllocator<> > UriType;
- MemoryPoolAllocator<CrtAllocator> allocator;
- typedef std::basic_string<Value::Ch> String;
-
- String str = "http://auth/path/xxx?query#frag";
- const UriType uri = UriType(str, &allocator);
- EXPECT_TRUE(UriType::GetScheme(uri) == "http:");
- EXPECT_TRUE(UriType::GetAuth(uri) == "//auth");
- EXPECT_TRUE(UriType::GetPath(uri) == "/path/xxx");
- EXPECT_TRUE(UriType::GetBase(uri) == "http://auth/path/xxx?query");
- EXPECT_TRUE(UriType::GetQuery(uri) == "?query");
- EXPECT_TRUE(UriType::GetFrag(uri) == "#frag");
- EXPECT_TRUE(UriType::Get(uri) == str);
-}
-
-TEST(Uri, Parse_UTF16_Std) {
- typedef GenericValue<UTF16<> > Value16;
- typedef GenericUri<Value16, MemoryPoolAllocator<> > UriType;
- MemoryPoolAllocator<CrtAllocator> allocator;
- typedef std::basic_string<Value16::Ch> String;
-
- String str = L"http://auth/path/xxx?query#frag";
- const UriType uri = UriType(str, &allocator);
- EXPECT_TRUE(UriType::GetScheme(uri) == L"http:");
- EXPECT_TRUE(UriType::GetAuth(uri) == L"//auth");
- EXPECT_TRUE(UriType::GetPath(uri) == L"/path/xxx");
- EXPECT_TRUE(UriType::GetBase(uri) == L"http://auth/path/xxx?query");
- EXPECT_TRUE(UriType::GetQuery(uri) == L"?query");
- EXPECT_TRUE(UriType::GetFrag(uri) == L"#frag");
- EXPECT_TRUE(UriType::Get(uri) == str);
-}
-#endif
-
-TEST(Uri, CopyConstructor) {
- typedef GenericUri<Value> UriType;
- CrtAllocator allocator;
-
- UriType u("http://auth/path/xxx?query#frag", &allocator);
- UriType u2(u);
- EXPECT_TRUE(u == u2);
- EXPECT_NE(&u.GetAllocator(), &u2.GetAllocator());
-}
-
-TEST(Uri, Assignment) {
- typedef GenericUri<Value> UriType;
- CrtAllocator allocator;
-
- UriType u("http://auth/path/xxx?query#frag", &allocator);
- UriType u2;
- u2 = u;
- EXPECT_TRUE(u == u2);
- EXPECT_NE(&u.GetAllocator(), &u2.GetAllocator());
-}
-
-TEST(Uri, Resolve) {
- typedef GenericUri<Value> UriType;
- CrtAllocator allocator;
-
- // ref is full uri
- UriType base = UriType("http://auth/path/#frag");
- UriType ref = UriType("http://newauth/newpath#newfrag");
- UriType res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
-
- base = UriType("/path/#frag", &allocator);
- ref = UriType("http://newauth/newpath#newfrag", &allocator);
- res = ref.Resolve(base, &allocator);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
-
- // ref is alternate uri
- base = UriType("http://auth/path/#frag");
- ref = UriType("urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
-
- // ref is absolute path
- base = UriType("http://auth/path/#");
- ref = UriType("/newpath#newfrag");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/newpath#newfrag") == 0);
-
- // ref is relative path
- base = UriType("http://auth/path/file.json#frag");
- ref = UriType("newfile.json#");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/path/newfile.json#") == 0);
-
- base = UriType("http://auth/path/file.json#frag/stuff");
- ref = UriType("newfile.json#newfrag/newstuff");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/path/newfile.json#newfrag/newstuff") == 0);
-
- base = UriType("file.json", &allocator);
- ref = UriType("newfile.json", &base.GetAllocator());
- res = ref.Resolve(base, &ref.GetAllocator());
- EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
-
- base = UriType("file.json", &allocator);
- ref = UriType("./newfile.json", &allocator);
- res = ref.Resolve(base, &allocator);
- EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
-
- base = UriType("file.json");
- ref = UriType("parent/../newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
-
- base = UriType("file.json");
- ref = UriType("parent/./newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "parent/newfile.json") == 0);
-
- base = UriType("file.json");
- ref = UriType("../../parent/.././newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "newfile.json") == 0);
-
- // This adds a joining slash so resolved length is base length + ref length + 1
- base = UriType("http://auth");
- ref = UriType("newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://auth/newfile.json") == 0);
-
- // ref is fragment
- base = UriType("#frag/stuff");
- ref = UriType("#newfrag/newstuff");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "#newfrag/newstuff") == 0);
-
- // test ref fragment always wins
- base = UriType("/path#frag");
- ref = UriType("");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "/path") == 0);
-
- // Examples from RFC3896
- base = UriType("http://a/b/c/d;p?q");
- ref = UriType("g:h");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "g:h") == 0);
- ref = UriType("g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g") == 0);
- ref = UriType("./g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g") == 0);
- ref = UriType("g/");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g/") == 0);
- ref = UriType("/g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("//g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://g") == 0);
- ref = UriType("?y");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?y") == 0);
- ref = UriType("g?y");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g?y") == 0);
- ref = UriType("#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?q#s") == 0);
- ref = UriType("g#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g#s") == 0);
- ref = UriType("g?y#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g?y#s") == 0);
- ref = UriType(";x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/;x") == 0);
- ref = UriType("g;x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g;x") == 0);
- ref = UriType("g;x?y#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g;x?y#s") == 0);
- ref = UriType("");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/d;p?q") == 0);
- ref = UriType(".");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/") == 0);
- ref = UriType("./");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/") == 0);
- ref = UriType("..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/") == 0);
- ref = UriType("../");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/") == 0);
- ref = UriType("../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/g") == 0);
- ref = UriType("../..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/") == 0);
- ref = UriType("../../");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/") == 0);
- ref = UriType("../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("../../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("../../../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("/./g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("/../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/g") == 0);
- ref = UriType("g.");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g.") == 0);
- ref = UriType(".g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/.g") == 0);
- ref = UriType("g..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g..") == 0);
- ref = UriType("..g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/..g") == 0);
- ref = UriType("g#s/../x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://a/b/c/g#s/../x") == 0);
-}
-
-TEST(Uri, Resolve_UTF16) {
- typedef GenericValue<UTF16<> > Value16;
- typedef GenericUri<Value16> UriType;
- CrtAllocator allocator;
-
- // ref is full uri
- UriType base = UriType(L"http://auth/path/#frag");
- UriType ref = UriType(L"http://newauth/newpath#newfrag");
- UriType res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://newauth/newpath#newfrag") == 0);
-
- base = UriType(L"/path/#frag");
- ref = UriType(L"http://newauth/newpath#newfrag");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://newauth/newpath#newfrag") == 0);
-
- // ref is alternate uri
- base = UriType(L"http://auth/path/#frag");
- ref = UriType(L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"urn:uuid:ee564b8a-7a87-4125-8c96-e9f123d6766f") == 0);
-
- // ref is absolute path
- base = UriType(L"http://auth/path/#");
- ref = UriType(L"/newpath#newfrag");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/newpath#newfrag") == 0);
-
- // ref is relative path
- base = UriType(L"http://auth/path/file.json#frag");
- ref = UriType(L"newfile.json#");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/path/newfile.json#") == 0);
-
- base = UriType(L"http://auth/path/file.json#frag/stuff");
- ref = UriType(L"newfile.json#newfrag/newstuff");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/path/newfile.json#newfrag/newstuff") == 0);
-
- base = UriType(L"file.json", &allocator);
- ref = UriType(L"newfile.json", &base.GetAllocator());
- res = ref.Resolve(base, &ref.GetAllocator());
- EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
-
- base = UriType(L"file.json", &allocator);
- ref = UriType(L"./newfile.json", &allocator);
- res = ref.Resolve(base, &allocator);
- EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
-
- base = UriType(L"file.json");
- ref = UriType(L"parent/../newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
-
- base = UriType(L"file.json");
- ref = UriType(L"parent/./newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"parent/newfile.json") == 0);
-
- base = UriType(L"file.json");
- ref = UriType(L"../../parent/.././newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"newfile.json") == 0);
-
- // This adds a joining slash so resolved length is base length + ref length + 1
- base = UriType(L"http://auth");
- ref = UriType(L"newfile.json");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://auth/newfile.json") == 0);
-
- // ref is fragment
- base = UriType(L"#frag/stuff");
- ref = UriType(L"#newfrag/newstuff");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"#newfrag/newstuff") == 0);
-
- // test ref fragment always wins
- base = UriType(L"/path#frag");
- ref = UriType(L"");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"/path") == 0);
-
- // Examples from RFC3896
- base = UriType(L"http://a/b/c/d;p?q");
- ref = UriType(L"g:h");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"g:h") == 0);
- ref = UriType(L"g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g") == 0);
- ref = UriType(L"./g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g") == 0);
- ref = UriType(L"g/");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g/") == 0);
- ref = UriType(L"/g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"//g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://g") == 0);
- ref = UriType(L"?y");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?y") == 0);
- ref = UriType(L"g?y");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g?y") == 0);
- ref = UriType(L"#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?q#s") == 0);
- ref = UriType(L"g#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g#s") == 0);
- ref = UriType(L"g?y#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g?y#s") == 0);
- ref = UriType(L";x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/;x") == 0);
- ref = UriType(L"g;x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g;x") == 0);
- ref = UriType(L"g;x?y#s");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g;x?y#s") == 0);
- ref = UriType(L"");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/d;p?q") == 0);
- ref = UriType(L".");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/") == 0);
- ref = UriType(L"./");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/") == 0);
- ref = UriType(L"..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/") == 0);
- ref = UriType(L"../");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/") == 0);
- ref = UriType(L"../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/g") == 0);
- ref = UriType(L"../..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/") == 0);
- ref = UriType(L"../../");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/") == 0);
- ref = UriType(L"../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"../../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"../../../../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"/./g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"/../g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/g") == 0);
- ref = UriType(L"g.");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g.") == 0);
- ref = UriType(L".g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/.g") == 0);
- ref = UriType(L"g..");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g..") == 0);
- ref = UriType(L"..g");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/..g") == 0);
- ref = UriType(L"g#s/../x");
- res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), L"http://a/b/c/g#s/../x") == 0);
-}
-
-TEST(Uri, Equals) {
- typedef GenericUri<Value> UriType;
-
- UriType a = UriType("http://a/a#a");
- UriType b = UriType("http://a/a#b");
- UriType c = a;
-
- EXPECT_TRUE(a == a);
- EXPECT_TRUE(a == c);
- EXPECT_TRUE(a != b);
-}
-
-TEST(Uri, Match) {
- typedef GenericUri<Value> UriType;
-
- UriType a = UriType("http://a/a#a");
- UriType b = UriType("http://a/a#b");
- UriType c = a;
- UriType d;
-
- EXPECT_TRUE(a.Match(a));
- EXPECT_TRUE(a.Match(c));
- EXPECT_FALSE(a.Match(b));
- EXPECT_FALSE(a.Match(b, true));
- EXPECT_TRUE(a.Match(b, false)); // Base Uri same
- EXPECT_FALSE(a.Match(d));
- EXPECT_FALSE(d.Match(a));
-}
-
-TEST(Uri, Issue1899) {
- typedef GenericUri<Value, MemoryPoolAllocator<> > UriType;
-
- UriType base = UriType("http://auth/path/#frag");
- UriType ref = UriType("http://newauth/newpath#newfrag");
- UriType res = ref.Resolve(base);
- EXPECT_TRUE(StrCmp(res.GetString(), "http://newauth/newpath#newfrag") == 0);
-}
-
-#if defined(_MSC_VER) || defined(__clang__)
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/valuetest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/valuetest.cpp
deleted file mode 100644
index e0e40a2652..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/valuetest.cpp
+++ /dev/null
@@ -1,1861 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-#include "rapidjson/document.h"
-#include <algorithm>
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-using namespace rapidjson;
-
-TEST(Value, Size) {
- if (sizeof(SizeType) == 4) {
-#if RAPIDJSON_48BITPOINTER_OPTIMIZATION
- EXPECT_EQ(16u, sizeof(Value));
-#elif RAPIDJSON_64BIT
- EXPECT_EQ(24u, sizeof(Value));
-#else
- EXPECT_EQ(16u, sizeof(Value));
-#endif
- }
-}
-
-TEST(Value, DefaultConstructor) {
- Value x;
- EXPECT_EQ(kNullType, x.GetType());
- EXPECT_TRUE(x.IsNull());
-
- //std::cout << "sizeof(Value): " << sizeof(x) << std::endl;
-}
-
-// Should not pass compilation
-//TEST(Value, copy_constructor) {
-// Value x(1234);
-// Value y = x;
-//}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-#if 0 // Many old compiler does not support these. Turn it off temporaily.
-
-#include <type_traits>
-
-TEST(Value, Traits) {
- typedef GenericValue<UTF8<>, CrtAllocator> Value;
- static_assert(std::is_constructible<Value>::value, "");
- static_assert(std::is_default_constructible<Value>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_constructible<Value>::value, "");
-#endif
- static_assert(std::is_move_constructible<Value>::value, "");
-
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_constructible<Value>::value, "");
- static_assert(std::is_nothrow_default_constructible<Value>::value, "");
- static_assert(!std::is_nothrow_copy_constructible<Value>::value, "");
- static_assert(std::is_nothrow_move_constructible<Value>::value, "");
-#endif
-
- static_assert(std::is_assignable<Value,Value>::value, "");
-#ifndef _MSC_VER
- static_assert(!std::is_copy_assignable<Value>::value, "");
-#endif
- static_assert(std::is_move_assignable<Value>::value, "");
-
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_assignable<Value, Value>::value, "");
-#endif
- static_assert(!std::is_nothrow_copy_assignable<Value>::value, "");
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_move_assignable<Value>::value, "");
-#endif
-
- static_assert(std::is_destructible<Value>::value, "");
-#ifndef _MSC_VER
- static_assert(std::is_nothrow_destructible<Value>::value, "");
-#endif
-}
-
-#endif
-
-TEST(Value, MoveConstructor) {
- typedef GenericValue<UTF8<>, CrtAllocator> V;
- V::AllocatorType allocator;
-
- V x((V(kArrayType)));
- x.Reserve(4u, allocator);
- x.PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator).PushBack(4, allocator);
- EXPECT_TRUE(x.IsArray());
- EXPECT_EQ(4u, x.Size());
-
- // Value y(x); // does not compile (!is_copy_constructible)
- V y(std::move(x));
- EXPECT_TRUE(x.IsNull());
- EXPECT_TRUE(y.IsArray());
- EXPECT_EQ(4u, y.Size());
-
- // Value z = y; // does not compile (!is_copy_assignable)
- V z = std::move(y);
- EXPECT_TRUE(y.IsNull());
- EXPECT_TRUE(z.IsArray());
- EXPECT_EQ(4u, z.Size());
-}
-
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-
-TEST(Value, AssignmentOperator) {
- Value x(1234);
- Value y;
- y = x;
- EXPECT_TRUE(x.IsNull()); // move semantic
- EXPECT_EQ(1234, y.GetInt());
-
- y = 5678;
- EXPECT_TRUE(y.IsInt());
- EXPECT_EQ(5678, y.GetInt());
-
- x = "Hello";
- EXPECT_TRUE(x.IsString());
- EXPECT_STREQ(x.GetString(),"Hello");
-
- y = StringRef(x.GetString(),x.GetStringLength());
- EXPECT_TRUE(y.IsString());
- EXPECT_EQ(y.GetString(),x.GetString());
- EXPECT_EQ(y.GetStringLength(),x.GetStringLength());
-
- static char mstr[] = "mutable";
- // y = mstr; // should not compile
- y = StringRef(mstr);
- EXPECT_TRUE(y.IsString());
- EXPECT_EQ(y.GetString(),mstr);
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- // C++11 move assignment
- x = Value("World");
- EXPECT_TRUE(x.IsString());
- EXPECT_STREQ("World", x.GetString());
-
- x = std::move(y);
- EXPECT_TRUE(y.IsNull());
- EXPECT_TRUE(x.IsString());
- EXPECT_EQ(x.GetString(), mstr);
-
- y = std::move(Value().SetInt(1234));
- EXPECT_TRUE(y.IsInt());
- EXPECT_EQ(1234, y);
-#endif // RAPIDJSON_HAS_CXX11_RVALUE_REFS
-}
-
-template <typename A, typename B>
-void TestEqual(const A& a, const B& b) {
- EXPECT_TRUE (a == b);
- EXPECT_FALSE(a != b);
- EXPECT_TRUE (b == a);
- EXPECT_FALSE(b != a);
-}
-
-template <typename A, typename B>
-void TestUnequal(const A& a, const B& b) {
- EXPECT_FALSE(a == b);
- EXPECT_TRUE (a != b);
- EXPECT_FALSE(b == a);
- EXPECT_TRUE (b != a);
-}
-
-TEST(Value, EqualtoOperator) {
- Value::AllocatorType allocator;
- Value x(kObjectType);
- x.AddMember("hello", "world", allocator)
- .AddMember("t", Value(true).Move(), allocator)
- .AddMember("f", Value(false).Move(), allocator)
- .AddMember("n", Value(kNullType).Move(), allocator)
- .AddMember("i", 123, allocator)
- .AddMember("pi", 3.14, allocator)
- .AddMember("a", Value(kArrayType).Move().PushBack(1, allocator).PushBack(2, allocator).PushBack(3, allocator), allocator);
-
- // Test templated operator==() and operator!=()
- TestEqual(x["hello"], "world");
- const char* cc = "world";
- TestEqual(x["hello"], cc);
- char* c = strdup("world");
- TestEqual(x["hello"], c);
- free(c);
-
- TestEqual(x["t"], true);
- TestEqual(x["f"], false);
- TestEqual(x["i"], 123);
- TestEqual(x["pi"], 3.14);
-
- // Test operator==() (including different allocators)
- CrtAllocator crtAllocator;
- GenericValue<UTF8<>, CrtAllocator> y;
- GenericDocument<UTF8<>, CrtAllocator> z(&crtAllocator);
- y.CopyFrom(x, crtAllocator);
- z.CopyFrom(y, z.GetAllocator());
- TestEqual(x, y);
- TestEqual(y, z);
- TestEqual(z, x);
-
- // Swapping member order should be fine.
- EXPECT_TRUE(y.RemoveMember("t"));
- TestUnequal(x, y);
- TestUnequal(z, y);
- EXPECT_TRUE(z.RemoveMember("t"));
- TestUnequal(x, z);
- TestEqual(y, z);
- y.AddMember("t", false, crtAllocator);
- z.AddMember("t", false, z.GetAllocator());
- TestUnequal(x, y);
- TestUnequal(z, x);
- y["t"] = true;
- z["t"] = true;
- TestEqual(x, y);
- TestEqual(y, z);
- TestEqual(z, x);
-
- // Swapping element order is not OK
- x["a"][0].Swap(x["a"][1]);
- TestUnequal(x, y);
- x["a"][0].Swap(x["a"][1]);
- TestEqual(x, y);
-
- // Array of different size
- x["a"].PushBack(4, allocator);
- TestUnequal(x, y);
- x["a"].PopBack();
- TestEqual(x, y);
-
- // Issue #129: compare Uint64
- x.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFF0));
- y.SetUint64(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF));
- TestUnequal(x, y);
-}
-
-template <typename Value>
-void TestCopyFrom() {
- typename Value::AllocatorType a;
- Value v1(1234);
- Value v2(v1, a); // deep copy constructor
- EXPECT_TRUE(v1.GetType() == v2.GetType());
- EXPECT_EQ(v1.GetInt(), v2.GetInt());
-
- v1.SetString("foo");
- v2.CopyFrom(v1, a);
- EXPECT_TRUE(v1.GetType() == v2.GetType());
- EXPECT_STREQ(v1.GetString(), v2.GetString());
- EXPECT_EQ(v1.GetString(), v2.GetString()); // string NOT copied
-
- v1.SetString("bar", a); // copy string
- v2.CopyFrom(v1, a);
- EXPECT_TRUE(v1.GetType() == v2.GetType());
- EXPECT_STREQ(v1.GetString(), v2.GetString());
- EXPECT_NE(v1.GetString(), v2.GetString()); // string copied
-
-
- v1.SetArray().PushBack(1234, a);
- v2.CopyFrom(v1, a);
- EXPECT_TRUE(v2.IsArray());
- EXPECT_EQ(v1.Size(), v2.Size());
-
- v1.PushBack(Value().SetString("foo", a), a); // push string copy
- EXPECT_TRUE(v1.Size() != v2.Size());
- v2.CopyFrom(v1, a);
- EXPECT_TRUE(v1.Size() == v2.Size());
- EXPECT_STREQ(v1[1].GetString(), v2[1].GetString());
- EXPECT_NE(v1[1].GetString(), v2[1].GetString()); // string got copied
-}
-
-TEST(Value, CopyFrom) {
- TestCopyFrom<Value>();
- TestCopyFrom<GenericValue<UTF8<>, CrtAllocator> >();
-}
-
-TEST(Value, Swap) {
- Value v1(1234);
- Value v2(kObjectType);
-
- EXPECT_EQ(&v1, &v1.Swap(v2));
- EXPECT_TRUE(v1.IsObject());
- EXPECT_TRUE(v2.IsInt());
- EXPECT_EQ(1234, v2.GetInt());
-
- // testing std::swap compatibility
- using std::swap;
- swap(v1, v2);
- EXPECT_TRUE(v1.IsInt());
- EXPECT_TRUE(v2.IsObject());
-}
-
-TEST(Value, Null) {
- // Default constructor
- Value x;
- EXPECT_EQ(kNullType, x.GetType());
- EXPECT_TRUE(x.IsNull());
-
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsNumber());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // Constructor with type
- Value y(kNullType);
- EXPECT_TRUE(y.IsNull());
-
- // SetNull();
- Value z(true);
- z.SetNull();
- EXPECT_TRUE(z.IsNull());
-}
-
-TEST(Value, True) {
- // Constructor with bool
- Value x(true);
- EXPECT_EQ(kTrueType, x.GetType());
- EXPECT_TRUE(x.GetBool());
- EXPECT_TRUE(x.IsBool());
- EXPECT_TRUE(x.IsTrue());
-
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsNumber());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // Constructor with type
- Value y(kTrueType);
- EXPECT_TRUE(y.IsTrue());
-
- // SetBool()
- Value z;
- z.SetBool(true);
- EXPECT_TRUE(z.IsTrue());
-
- // Templated functions
- EXPECT_TRUE(z.Is<bool>());
- EXPECT_TRUE(z.Get<bool>());
- EXPECT_FALSE(z.Set<bool>(false).Get<bool>());
- EXPECT_TRUE(z.Set(true).Get<bool>());
-}
-
-TEST(Value, False) {
- // Constructor with bool
- Value x(false);
- EXPECT_EQ(kFalseType, x.GetType());
- EXPECT_TRUE(x.IsBool());
- EXPECT_TRUE(x.IsFalse());
-
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.GetBool());
- //EXPECT_FALSE((bool)x);
- EXPECT_FALSE(x.IsNumber());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // Constructor with type
- Value y(kFalseType);
- EXPECT_TRUE(y.IsFalse());
-
- // SetBool()
- Value z;
- z.SetBool(false);
- EXPECT_TRUE(z.IsFalse());
-}
-
-TEST(Value, Int) {
- // Constructor with int
- Value x(1234);
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_EQ(1234, x.GetInt());
- EXPECT_EQ(1234u, x.GetUint());
- EXPECT_EQ(1234, x.GetInt64());
- EXPECT_EQ(1234u, x.GetUint64());
- EXPECT_NEAR(1234.0, x.GetDouble(), 0.0);
- //EXPECT_EQ(1234, (int)x);
- //EXPECT_EQ(1234, (unsigned)x);
- //EXPECT_EQ(1234, (int64_t)x);
- //EXPECT_EQ(1234, (uint64_t)x);
- //EXPECT_EQ(1234, (double)x);
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsInt());
- EXPECT_TRUE(x.IsUint());
- EXPECT_TRUE(x.IsInt64());
- EXPECT_TRUE(x.IsUint64());
-
- EXPECT_FALSE(x.IsDouble());
- EXPECT_FALSE(x.IsFloat());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- Value nx(-1234);
- EXPECT_EQ(-1234, nx.GetInt());
- EXPECT_EQ(-1234, nx.GetInt64());
- EXPECT_TRUE(nx.IsInt());
- EXPECT_TRUE(nx.IsInt64());
- EXPECT_FALSE(nx.IsUint());
- EXPECT_FALSE(nx.IsUint64());
-
- // Constructor with type
- Value y(kNumberType);
- EXPECT_TRUE(y.IsNumber());
- EXPECT_TRUE(y.IsInt());
- EXPECT_EQ(0, y.GetInt());
-
- // SetInt()
- Value z;
- z.SetInt(1234);
- EXPECT_EQ(1234, z.GetInt());
-
- // operator=(int)
- z = 5678;
- EXPECT_EQ(5678, z.GetInt());
-
- // Templated functions
- EXPECT_TRUE(z.Is<int>());
- EXPECT_EQ(5678, z.Get<int>());
- EXPECT_EQ(5679, z.Set(5679).Get<int>());
- EXPECT_EQ(5680, z.Set<int>(5680).Get<int>());
-
-#ifdef _MSC_VER
- // long as int on MSC platforms
- RAPIDJSON_STATIC_ASSERT(sizeof(long) == sizeof(int));
- z.SetInt(2222);
- EXPECT_TRUE(z.Is<long>());
- EXPECT_EQ(2222l, z.Get<long>());
- EXPECT_EQ(3333l, z.Set(3333l).Get<long>());
- EXPECT_EQ(4444l, z.Set<long>(4444l).Get<long>());
- EXPECT_TRUE(z.IsInt());
-#endif
-}
-
-TEST(Value, Uint) {
- // Constructor with int
- Value x(1234u);
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_EQ(1234, x.GetInt());
- EXPECT_EQ(1234u, x.GetUint());
- EXPECT_EQ(1234, x.GetInt64());
- EXPECT_EQ(1234u, x.GetUint64());
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsInt());
- EXPECT_TRUE(x.IsUint());
- EXPECT_TRUE(x.IsInt64());
- EXPECT_TRUE(x.IsUint64());
- EXPECT_NEAR(1234.0, x.GetDouble(), 0.0); // Number can always be cast as double but !IsDouble().
-
- EXPECT_FALSE(x.IsDouble());
- EXPECT_FALSE(x.IsFloat());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // SetUint()
- Value z;
- z.SetUint(1234);
- EXPECT_EQ(1234u, z.GetUint());
-
- // operator=(unsigned)
- z = 5678u;
- EXPECT_EQ(5678u, z.GetUint());
-
- z = 2147483648u; // 2^31, cannot cast as int
- EXPECT_EQ(2147483648u, z.GetUint());
- EXPECT_FALSE(z.IsInt());
- EXPECT_TRUE(z.IsInt64()); // Issue 41: Incorrect parsing of unsigned int number types
-
- // Templated functions
- EXPECT_TRUE(z.Is<unsigned>());
- EXPECT_EQ(2147483648u, z.Get<unsigned>());
- EXPECT_EQ(2147483649u, z.Set(2147483649u).Get<unsigned>());
- EXPECT_EQ(2147483650u, z.Set<unsigned>(2147483650u).Get<unsigned>());
-
-#ifdef _MSC_VER
- // unsigned long as unsigned on MSC platforms
- RAPIDJSON_STATIC_ASSERT(sizeof(unsigned long) == sizeof(unsigned));
- z.SetUint(2222);
- EXPECT_TRUE(z.Is<unsigned long>());
- EXPECT_EQ(2222ul, z.Get<unsigned long>());
- EXPECT_EQ(3333ul, z.Set(3333ul).Get<unsigned long>());
- EXPECT_EQ(4444ul, z.Set<unsigned long>(4444ul).Get<unsigned long>());
- EXPECT_TRUE(x.IsUint());
-#endif
-}
-
-TEST(Value, Int64) {
- // Constructor with int
- Value x(int64_t(1234));
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_EQ(1234, x.GetInt());
- EXPECT_EQ(1234u, x.GetUint());
- EXPECT_EQ(1234, x.GetInt64());
- EXPECT_EQ(1234u, x.GetUint64());
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsInt());
- EXPECT_TRUE(x.IsUint());
- EXPECT_TRUE(x.IsInt64());
- EXPECT_TRUE(x.IsUint64());
-
- EXPECT_FALSE(x.IsDouble());
- EXPECT_FALSE(x.IsFloat());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- Value nx(int64_t(-1234));
- EXPECT_EQ(-1234, nx.GetInt());
- EXPECT_EQ(-1234, nx.GetInt64());
- EXPECT_TRUE(nx.IsInt());
- EXPECT_TRUE(nx.IsInt64());
- EXPECT_FALSE(nx.IsUint());
- EXPECT_FALSE(nx.IsUint64());
-
- // SetInt64()
- Value z;
- z.SetInt64(1234);
- EXPECT_EQ(1234, z.GetInt64());
-
- z.SetInt64(2147483648u); // 2^31, cannot cast as int
- EXPECT_FALSE(z.IsInt());
- EXPECT_TRUE(z.IsUint());
- EXPECT_NEAR(2147483648.0, z.GetDouble(), 0.0);
-
- z.SetInt64(int64_t(4294967295u) + 1); // 2^32, cannot cast as uint
- EXPECT_FALSE(z.IsInt());
- EXPECT_FALSE(z.IsUint());
- EXPECT_NEAR(4294967296.0, z.GetDouble(), 0.0);
-
- z.SetInt64(-int64_t(2147483648u) - 1); // -2^31-1, cannot cast as int
- EXPECT_FALSE(z.IsInt());
- EXPECT_NEAR(-2147483649.0, z.GetDouble(), 0.0);
-
- int64_t i = static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x80000000, 00000000));
- z.SetInt64(i);
- EXPECT_DOUBLE_EQ(-9223372036854775808.0, z.GetDouble());
-
- // Templated functions
- EXPECT_TRUE(z.Is<int64_t>());
- EXPECT_EQ(i, z.Get<int64_t>());
-#if 0 // signed integer underflow is undefined behaviour
- EXPECT_EQ(i - 1, z.Set(i - 1).Get<int64_t>());
- EXPECT_EQ(i - 2, z.Set<int64_t>(i - 2).Get<int64_t>());
-#endif
-}
-
-TEST(Value, Uint64) {
- // Constructor with int
- Value x(uint64_t(1234));
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_EQ(1234, x.GetInt());
- EXPECT_EQ(1234u, x.GetUint());
- EXPECT_EQ(1234, x.GetInt64());
- EXPECT_EQ(1234u, x.GetUint64());
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsInt());
- EXPECT_TRUE(x.IsUint());
- EXPECT_TRUE(x.IsInt64());
- EXPECT_TRUE(x.IsUint64());
-
- EXPECT_FALSE(x.IsDouble());
- EXPECT_FALSE(x.IsFloat());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // SetUint64()
- Value z;
- z.SetUint64(1234);
- EXPECT_EQ(1234u, z.GetUint64());
-
- z.SetUint64(uint64_t(2147483648u)); // 2^31, cannot cast as int
- EXPECT_FALSE(z.IsInt());
- EXPECT_TRUE(z.IsUint());
- EXPECT_TRUE(z.IsInt64());
-
- z.SetUint64(uint64_t(4294967295u) + 1); // 2^32, cannot cast as uint
- EXPECT_FALSE(z.IsInt());
- EXPECT_FALSE(z.IsUint());
- EXPECT_TRUE(z.IsInt64());
-
- uint64_t u = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000);
- z.SetUint64(u); // 2^63 cannot cast as int64
- EXPECT_FALSE(z.IsInt64());
- EXPECT_EQ(u, z.GetUint64()); // Issue 48
- EXPECT_DOUBLE_EQ(9223372036854775808.0, z.GetDouble());
-
- // Templated functions
- EXPECT_TRUE(z.Is<uint64_t>());
- EXPECT_EQ(u, z.Get<uint64_t>());
- EXPECT_EQ(u + 1, z.Set(u + 1).Get<uint64_t>());
- EXPECT_EQ(u + 2, z.Set<uint64_t>(u + 2).Get<uint64_t>());
-}
-
-TEST(Value, Double) {
- // Constructor with double
- Value x(12.34);
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_NEAR(12.34, x.GetDouble(), 0.0);
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsDouble());
-
- EXPECT_FALSE(x.IsInt());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // SetDouble()
- Value z;
- z.SetDouble(12.34);
- EXPECT_NEAR(12.34, z.GetDouble(), 0.0);
-
- z = 56.78;
- EXPECT_NEAR(56.78, z.GetDouble(), 0.0);
-
- // Templated functions
- EXPECT_TRUE(z.Is<double>());
- EXPECT_EQ(56.78, z.Get<double>());
- EXPECT_EQ(57.78, z.Set(57.78).Get<double>());
- EXPECT_EQ(58.78, z.Set<double>(58.78).Get<double>());
-}
-
-TEST(Value, Float) {
- // Constructor with double
- Value x(12.34f);
- EXPECT_EQ(kNumberType, x.GetType());
- EXPECT_NEAR(12.34f, x.GetFloat(), 0.0);
- EXPECT_TRUE(x.IsNumber());
- EXPECT_TRUE(x.IsDouble());
- EXPECT_TRUE(x.IsFloat());
-
- EXPECT_FALSE(x.IsInt());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- // SetFloat()
- Value z;
- z.SetFloat(12.34f);
- EXPECT_NEAR(12.34f, z.GetFloat(), 0.0f);
-
- // Issue 573
- z.SetInt(0);
- EXPECT_EQ(0.0f, z.GetFloat());
-
- z = 56.78f;
- EXPECT_NEAR(56.78f, z.GetFloat(), 0.0f);
-
- // Templated functions
- EXPECT_TRUE(z.Is<float>());
- EXPECT_EQ(56.78f, z.Get<float>());
- EXPECT_EQ(57.78f, z.Set(57.78f).Get<float>());
- EXPECT_EQ(58.78f, z.Set<float>(58.78f).Get<float>());
-}
-
-TEST(Value, IsLosslessDouble) {
- EXPECT_TRUE(Value(0.0).IsLosslessDouble());
- EXPECT_TRUE(Value(12.34).IsLosslessDouble());
- EXPECT_TRUE(Value(-123).IsLosslessDouble());
- EXPECT_TRUE(Value(2147483648u).IsLosslessDouble());
- EXPECT_TRUE(Value(-static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x40000000, 0x00000000))).IsLosslessDouble());
-#if !(defined(_MSC_VER) && _MSC_VER < 1800) // VC2010 has problem
- EXPECT_TRUE(Value(RAPIDJSON_UINT64_C2(0xA0000000, 0x00000000)).IsLosslessDouble());
-#endif
-
- EXPECT_FALSE(Value(static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble()); // INT64_MAX
- EXPECT_FALSE(Value(-static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF))).IsLosslessDouble()); // -INT64_MAX
- EXPECT_TRUE(Value(-static_cast<int64_t>(RAPIDJSON_UINT64_C2(0x7FFFFFFF, 0xFFFFFFFF)) - 1).IsLosslessDouble()); // INT64_MIN
- EXPECT_FALSE(Value(RAPIDJSON_UINT64_C2(0xFFFFFFFF, 0xFFFFFFFF)).IsLosslessDouble()); // UINT64_MAX
-
- EXPECT_TRUE(Value(3.4028234e38f).IsLosslessDouble()); // FLT_MAX
- EXPECT_TRUE(Value(-3.4028234e38f).IsLosslessDouble()); // -FLT_MAX
- EXPECT_TRUE(Value(1.17549435e-38f).IsLosslessDouble()); // FLT_MIN
- EXPECT_TRUE(Value(-1.17549435e-38f).IsLosslessDouble()); // -FLT_MIN
- EXPECT_TRUE(Value(1.7976931348623157e+308).IsLosslessDouble()); // DBL_MAX
- EXPECT_TRUE(Value(-1.7976931348623157e+308).IsLosslessDouble()); // -DBL_MAX
- EXPECT_TRUE(Value(2.2250738585072014e-308).IsLosslessDouble()); // DBL_MIN
- EXPECT_TRUE(Value(-2.2250738585072014e-308).IsLosslessDouble()); // -DBL_MIN
-}
-
-TEST(Value, IsLosslessFloat) {
- EXPECT_TRUE(Value(12.25).IsLosslessFloat());
- EXPECT_TRUE(Value(-123).IsLosslessFloat());
- EXPECT_TRUE(Value(2147483648u).IsLosslessFloat());
- EXPECT_TRUE(Value(3.4028234e38f).IsLosslessFloat());
- EXPECT_TRUE(Value(-3.4028234e38f).IsLosslessFloat());
- EXPECT_FALSE(Value(3.4028235e38).IsLosslessFloat());
- EXPECT_FALSE(Value(0.3).IsLosslessFloat());
-}
-
-TEST(Value, String) {
- // Construction with const string
- Value x("Hello", 5); // literal
- EXPECT_EQ(kStringType, x.GetType());
- EXPECT_TRUE(x.IsString());
- EXPECT_STREQ("Hello", x.GetString());
- EXPECT_EQ(5u, x.GetStringLength());
-
- EXPECT_FALSE(x.IsNumber());
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsObject());
- EXPECT_FALSE(x.IsArray());
-
- static const char cstr[] = "World"; // const array
- Value(cstr).Swap(x);
- EXPECT_TRUE(x.IsString());
- EXPECT_EQ(x.GetString(), cstr);
- EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);
-
- static char mstr[] = "Howdy"; // non-const array
- // Value(mstr).Swap(x); // should not compile
- Value(StringRef(mstr)).Swap(x);
- EXPECT_TRUE(x.IsString());
- EXPECT_EQ(x.GetString(), mstr);
- EXPECT_EQ(x.GetStringLength(), sizeof(mstr)-1);
- strncpy(mstr,"Hello", sizeof(mstr));
- EXPECT_STREQ(x.GetString(), "Hello");
-
- const char* pstr = cstr;
- //Value(pstr).Swap(x); // should not compile
- Value(StringRef(pstr)).Swap(x);
- EXPECT_TRUE(x.IsString());
- EXPECT_EQ(x.GetString(), cstr);
- EXPECT_EQ(x.GetStringLength(), sizeof(cstr)-1);
-
- char* mpstr = mstr;
- Value(StringRef(mpstr,sizeof(mstr)-1)).Swap(x);
- EXPECT_TRUE(x.IsString());
- EXPECT_EQ(x.GetString(), mstr);
- EXPECT_EQ(x.GetStringLength(), 5u);
- EXPECT_STREQ(x.GetString(), "Hello");
-
- // Constructor with copy string
- MemoryPoolAllocator<> allocator;
- Value c(x.GetString(), x.GetStringLength(), allocator);
- EXPECT_NE(x.GetString(), c.GetString());
- EXPECT_EQ(x.GetStringLength(), c.GetStringLength());
- EXPECT_STREQ(x.GetString(), c.GetString());
- //x.SetString("World");
- x.SetString("World", 5);
- EXPECT_STREQ("Hello", c.GetString());
- EXPECT_EQ(5u, c.GetStringLength());
-
- // Constructor with type
- Value y(kStringType);
- EXPECT_TRUE(y.IsString());
- EXPECT_STREQ("", y.GetString()); // Empty string should be "" instead of 0 (issue 226)
- EXPECT_EQ(0u, y.GetStringLength());
-
- // SetConsttring()
- Value z;
- z.SetString("Hello");
- EXPECT_TRUE(x.IsString());
- z.SetString("Hello", 5);
- EXPECT_STREQ("Hello", z.GetString());
- EXPECT_STREQ("Hello", z.GetString());
- EXPECT_EQ(5u, z.GetStringLength());
-
- z.SetString("Hello");
- EXPECT_TRUE(z.IsString());
- EXPECT_STREQ("Hello", z.GetString());
-
- //z.SetString(mstr); // should not compile
- //z.SetString(pstr); // should not compile
- z.SetString(StringRef(mstr));
- EXPECT_TRUE(z.IsString());
- EXPECT_STREQ(z.GetString(), mstr);
-
- z.SetString(cstr);
- EXPECT_TRUE(z.IsString());
- EXPECT_EQ(cstr, z.GetString());
-
- z = cstr;
- EXPECT_TRUE(z.IsString());
- EXPECT_EQ(cstr, z.GetString());
-
- // SetString()
- char s[] = "World";
- Value w;
- w.SetString(s, static_cast<SizeType>(strlen(s)), allocator);
- s[0] = '\0';
- EXPECT_STREQ("World", w.GetString());
- EXPECT_EQ(5u, w.GetStringLength());
-
- // templated functions
- EXPECT_TRUE(z.Is<const char*>());
- EXPECT_STREQ(cstr, z.Get<const char*>());
- EXPECT_STREQ("Apple", z.Set<const char*>("Apple").Get<const char*>());
-
-#if RAPIDJSON_HAS_STDSTRING
- {
- std::string str = "Hello World";
- str[5] = '\0';
- EXPECT_STREQ(str.data(),"Hello"); // embedded '\0'
- EXPECT_EQ(str.size(), 11u);
-
- // no copy
- Value vs0(StringRef(str));
- EXPECT_TRUE(vs0.IsString());
- EXPECT_EQ(vs0.GetString(), str.data());
- EXPECT_EQ(vs0.GetStringLength(), str.size());
- TestEqual(vs0, str);
-
- // do copy
- Value vs1(str, allocator);
- EXPECT_TRUE(vs1.IsString());
- EXPECT_NE(vs1.GetString(), str.data());
- EXPECT_NE(vs1.GetString(), str); // not equal due to embedded '\0'
- EXPECT_EQ(vs1.GetStringLength(), str.size());
- TestEqual(vs1, str);
-
- // SetString
- str = "World";
- vs0.SetNull().SetString(str, allocator);
- EXPECT_TRUE(vs0.IsString());
- EXPECT_STREQ(vs0.GetString(), str.c_str());
- EXPECT_EQ(vs0.GetStringLength(), str.size());
- TestEqual(str, vs0);
- TestUnequal(str, vs1);
-
- // vs1 = str; // should not compile
- vs1 = StringRef(str);
- TestEqual(str, vs1);
- TestEqual(vs0, vs1);
-
- // Templated function.
- EXPECT_TRUE(vs0.Is<std::string>());
- EXPECT_EQ(str, vs0.Get<std::string>());
- vs0.Set<std::string>(std::string("Apple"), allocator);
- EXPECT_EQ(std::string("Apple"), vs0.Get<std::string>());
- vs0.Set(std::string("Orange"), allocator);
- EXPECT_EQ(std::string("Orange"), vs0.Get<std::string>());
- }
-#endif // RAPIDJSON_HAS_STDSTRING
-}
-
-// Issue 226: Value of string type should not point to NULL
-TEST(Value, SetStringNull) {
-
- MemoryPoolAllocator<> allocator;
- const char* nullPtr = 0;
- {
- // Construction with string type creates empty string
- Value v(kStringType);
- EXPECT_NE(v.GetString(), nullPtr); // non-null string returned
- EXPECT_EQ(v.GetStringLength(), 0u);
-
- // Construction from/setting to null without length not allowed
- EXPECT_THROW(Value(StringRef(nullPtr)), AssertException);
- EXPECT_THROW(Value(StringRef(nullPtr), allocator), AssertException);
- EXPECT_THROW(v.SetString(nullPtr, allocator), AssertException);
-
- // Non-empty length with null string is not allowed
- EXPECT_THROW(v.SetString(nullPtr, 17u), AssertException);
- EXPECT_THROW(v.SetString(nullPtr, 42u, allocator), AssertException);
-
- // Setting to null string with empty length is allowed
- v.SetString(nullPtr, 0u);
- EXPECT_NE(v.GetString(), nullPtr); // non-null string returned
- EXPECT_EQ(v.GetStringLength(), 0u);
-
- v.SetNull();
- v.SetString(nullPtr, 0u, allocator);
- EXPECT_NE(v.GetString(), nullPtr); // non-null string returned
- EXPECT_EQ(v.GetStringLength(), 0u);
- }
- // Construction with null string and empty length is allowed
- {
- Value v(nullPtr,0u);
- EXPECT_NE(v.GetString(), nullPtr); // non-null string returned
- EXPECT_EQ(v.GetStringLength(), 0u);
- }
- {
- Value v(nullPtr, 0u, allocator);
- EXPECT_NE(v.GetString(), nullPtr); // non-null string returned
- EXPECT_EQ(v.GetStringLength(), 0u);
- }
-}
-
-template <typename T, typename Allocator>
-static void TestArray(T& x, Allocator& allocator) {
- const T& y = x;
-
- // PushBack()
- Value v;
- x.PushBack(v, allocator);
- v.SetBool(true);
- x.PushBack(v, allocator);
- v.SetBool(false);
- x.PushBack(v, allocator);
- v.SetInt(123);
- x.PushBack(v, allocator);
- //x.PushBack((const char*)"foo", allocator); // should not compile
- x.PushBack("foo", allocator);
-
- EXPECT_FALSE(x.Empty());
- EXPECT_EQ(5u, x.Size());
- EXPECT_FALSE(y.Empty());
- EXPECT_EQ(5u, y.Size());
- EXPECT_TRUE(x[SizeType(0)].IsNull());
- EXPECT_TRUE(x[1].IsTrue());
- EXPECT_TRUE(x[2].IsFalse());
- EXPECT_TRUE(x[3].IsInt());
- EXPECT_EQ(123, x[3].GetInt());
- EXPECT_TRUE(y[SizeType(0)].IsNull());
- EXPECT_TRUE(y[1].IsTrue());
- EXPECT_TRUE(y[2].IsFalse());
- EXPECT_TRUE(y[3].IsInt());
- EXPECT_EQ(123, y[3].GetInt());
- EXPECT_TRUE(y[4].IsString());
- EXPECT_STREQ("foo", y[4].GetString());
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- // PushBack(GenericValue&&, Allocator&);
- {
- Value y2(kArrayType);
- y2.PushBack(Value(true), allocator);
- y2.PushBack(std::move(Value(kArrayType).PushBack(Value(1), allocator).PushBack("foo", allocator)), allocator);
- EXPECT_EQ(2u, y2.Size());
- EXPECT_TRUE(y2[0].IsTrue());
- EXPECT_TRUE(y2[1].IsArray());
- EXPECT_EQ(2u, y2[1].Size());
- EXPECT_TRUE(y2[1][0].IsInt());
- EXPECT_TRUE(y2[1][1].IsString());
- }
-#endif
-
- // iterator
- typename T::ValueIterator itr = x.Begin();
- EXPECT_TRUE(itr != x.End());
- EXPECT_TRUE(itr->IsNull());
- ++itr;
- EXPECT_TRUE(itr != x.End());
- EXPECT_TRUE(itr->IsTrue());
- ++itr;
- EXPECT_TRUE(itr != x.End());
- EXPECT_TRUE(itr->IsFalse());
- ++itr;
- EXPECT_TRUE(itr != x.End());
- EXPECT_TRUE(itr->IsInt());
- EXPECT_EQ(123, itr->GetInt());
- ++itr;
- EXPECT_TRUE(itr != x.End());
- EXPECT_TRUE(itr->IsString());
- EXPECT_STREQ("foo", itr->GetString());
-
- // const iterator
- typename T::ConstValueIterator citr = y.Begin();
- EXPECT_TRUE(citr != y.End());
- EXPECT_TRUE(citr->IsNull());
- ++citr;
- EXPECT_TRUE(citr != y.End());
- EXPECT_TRUE(citr->IsTrue());
- ++citr;
- EXPECT_TRUE(citr != y.End());
- EXPECT_TRUE(citr->IsFalse());
- ++citr;
- EXPECT_TRUE(citr != y.End());
- EXPECT_TRUE(citr->IsInt());
- EXPECT_EQ(123, citr->GetInt());
- ++citr;
- EXPECT_TRUE(citr != y.End());
- EXPECT_TRUE(citr->IsString());
- EXPECT_STREQ("foo", citr->GetString());
-
- // PopBack()
- x.PopBack();
- EXPECT_EQ(4u, x.Size());
- EXPECT_TRUE(y[SizeType(0)].IsNull());
- EXPECT_TRUE(y[1].IsTrue());
- EXPECT_TRUE(y[2].IsFalse());
- EXPECT_TRUE(y[3].IsInt());
-
- // Clear()
- x.Clear();
- EXPECT_TRUE(x.Empty());
- EXPECT_EQ(0u, x.Size());
- EXPECT_TRUE(y.Empty());
- EXPECT_EQ(0u, y.Size());
-
- // Erase(ValueIterator)
-
- // Use array of array to ensure removed elements' destructor is called.
- // [[0],[1],[2],...]
- for (int i = 0; i < 10; i++)
- x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
-
- // Erase the first
- itr = x.Erase(x.Begin());
- EXPECT_EQ(x.Begin(), itr);
- EXPECT_EQ(9u, x.Size());
- for (int i = 0; i < 9; i++)
- EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
-
- // Ease the last
- itr = x.Erase(x.End() - 1);
- EXPECT_EQ(x.End(), itr);
- EXPECT_EQ(8u, x.Size());
- for (int i = 0; i < 8; i++)
- EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
-
- // Erase the middle
- itr = x.Erase(x.Begin() + 4);
- EXPECT_EQ(x.Begin() + 4, itr);
- EXPECT_EQ(7u, x.Size());
- for (int i = 0; i < 4; i++)
- EXPECT_EQ(i + 1, x[static_cast<SizeType>(i)][0].GetInt());
- for (int i = 4; i < 7; i++)
- EXPECT_EQ(i + 2, x[static_cast<SizeType>(i)][0].GetInt());
-
- // Erase(ValueIterator, ValueIterator)
- // Exhaustive test with all 0 <= first < n, first <= last <= n cases
- const unsigned n = 10;
- for (unsigned first = 0; first < n; first++) {
- for (unsigned last = first; last <= n; last++) {
- x.Clear();
- for (unsigned i = 0; i < n; i++)
- x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
-
- itr = x.Erase(x.Begin() + first, x.Begin() + last);
- if (last == n)
- EXPECT_EQ(x.End(), itr);
- else
- EXPECT_EQ(x.Begin() + first, itr);
-
- size_t removeCount = last - first;
- EXPECT_EQ(n - removeCount, x.Size());
- for (unsigned i = 0; i < first; i++)
- EXPECT_EQ(i, x[i][0].GetUint());
- for (unsigned i = first; i < n - removeCount; i++)
- EXPECT_EQ(i + removeCount, x[static_cast<SizeType>(i)][0].GetUint());
- }
- }
-}
-
-TEST(Value, Array) {
- Value::AllocatorType allocator;
- Value x(kArrayType);
- const Value& y = x;
-
- EXPECT_EQ(kArrayType, x.GetType());
- EXPECT_TRUE(x.IsArray());
- EXPECT_TRUE(x.Empty());
- EXPECT_EQ(0u, x.Size());
- EXPECT_TRUE(y.IsArray());
- EXPECT_TRUE(y.Empty());
- EXPECT_EQ(0u, y.Size());
-
- EXPECT_FALSE(x.IsNull());
- EXPECT_FALSE(x.IsBool());
- EXPECT_FALSE(x.IsFalse());
- EXPECT_FALSE(x.IsTrue());
- EXPECT_FALSE(x.IsString());
- EXPECT_FALSE(x.IsObject());
-
- TestArray(x, allocator);
-
- // Working in gcc without C++11, but VS2013 cannot compile. To be diagnosed.
- // http://en.wikipedia.org/wiki/Erase-remove_idiom
- x.Clear();
- for (int i = 0; i < 10; i++)
- if (i % 2 == 0)
- x.PushBack(i, allocator);
- else
- x.PushBack(Value(kNullType).Move(), allocator);
-
- const Value null(kNullType);
- x.Erase(std::remove(x.Begin(), x.End(), null), x.End());
- EXPECT_EQ(5u, x.Size());
- for (int i = 0; i < 5; i++)
- EXPECT_EQ(i * 2, x[static_cast<SizeType>(i)]);
-
- // SetArray()
- Value z;
- z.SetArray();
- EXPECT_TRUE(z.IsArray());
- EXPECT_TRUE(z.Empty());
-
- // PR #1503: assign from inner Value
- {
- CrtAllocator a; // Free() is not a noop
- GenericValue<UTF8<>, CrtAllocator> nullValue;
- GenericValue<UTF8<>, CrtAllocator> arrayValue(kArrayType);
- arrayValue.PushBack(nullValue, a);
- arrayValue = arrayValue[0]; // shouldn't crash (use after free)
- EXPECT_TRUE(arrayValue.IsNull());
- }
-}
-
-TEST(Value, ArrayHelper) {
- Value::AllocatorType allocator;
- {
- Value x(kArrayType);
- Value::Array a = x.GetArray();
- TestArray(a, allocator);
- }
-
- {
- Value x(kArrayType);
- Value::Array a = x.GetArray();
- a.PushBack(1, allocator);
-
- Value::Array a2(a); // copy constructor
- EXPECT_EQ(1u, a2.Size());
-
- Value::Array a3 = a;
- EXPECT_EQ(1u, a3.Size());
-
- Value::ConstArray y = static_cast<const Value&>(x).GetArray();
- (void)y;
- // y.PushBack(1, allocator); // should not compile
-
- // Templated functions
- x.Clear();
- EXPECT_TRUE(x.Is<Value::Array>());
- EXPECT_TRUE(x.Is<Value::ConstArray>());
- a.PushBack(1, allocator);
- EXPECT_EQ(1, x.Get<Value::Array>()[0].GetInt());
- EXPECT_EQ(1, x.Get<Value::ConstArray>()[0].GetInt());
-
- Value x2;
- x2.Set<Value::Array>(a);
- EXPECT_TRUE(x.IsArray()); // IsArray() is invariant after moving.
- EXPECT_EQ(1, x2.Get<Value::Array>()[0].GetInt());
- }
-
- {
- Value y(kArrayType);
- y.PushBack(123, allocator);
-
- Value x(y.GetArray()); // Construct value form array.
- EXPECT_TRUE(x.IsArray());
- EXPECT_EQ(123, x[0].GetInt());
- EXPECT_TRUE(y.IsArray()); // Invariant
- EXPECT_TRUE(y.Empty());
- }
-
- {
- Value x(kArrayType);
- Value y(kArrayType);
- y.PushBack(123, allocator);
- x.PushBack(y.GetArray(), allocator); // Implicit constructor to convert Array to GenericValue
-
- EXPECT_EQ(1u, x.Size());
- EXPECT_EQ(123, x[0][0].GetInt());
- EXPECT_TRUE(y.IsArray());
- EXPECT_TRUE(y.Empty());
- }
-}
-
-#if RAPIDJSON_HAS_CXX11_RANGE_FOR
-TEST(Value, ArrayHelperRangeFor) {
- Value::AllocatorType allocator;
- Value x(kArrayType);
-
- for (int i = 0; i < 10; i++)
- x.PushBack(i, allocator);
-
- {
- int i = 0;
- for (auto& v : x.GetArray()) {
- EXPECT_EQ(i, v.GetInt());
- i++;
- }
- EXPECT_EQ(i, 10);
- }
- {
- int i = 0;
- for (const auto& v : const_cast<const Value&>(x).GetArray()) {
- EXPECT_EQ(i, v.GetInt());
- i++;
- }
- EXPECT_EQ(i, 10);
- }
-
- // Array a = x.GetArray();
- // Array ca = const_cast<const Value&>(x).GetArray();
-}
-#endif
-
-template <typename T, typename Allocator>
-static void TestObject(T& x, Allocator& allocator) {
- const T& y = x; // const version
-
- // AddMember()
- x.AddMember("A", "Apple", allocator);
- EXPECT_FALSE(x.ObjectEmpty());
- EXPECT_EQ(1u, x.MemberCount());
-
- Value value("Banana", 6);
- x.AddMember("B", "Banana", allocator);
- EXPECT_EQ(2u, x.MemberCount());
-
- // AddMember<T>(StringRefType, T, Allocator)
- {
- Value o(kObjectType);
- o.AddMember("true", true, allocator);
- o.AddMember("false", false, allocator);
- o.AddMember("int", -1, allocator);
- o.AddMember("uint", 1u, allocator);
- o.AddMember("int64", int64_t(-4294967296), allocator);
- o.AddMember("uint64", uint64_t(4294967296), allocator);
- o.AddMember("double", 3.14, allocator);
- o.AddMember("string", "Jelly", allocator);
-
- EXPECT_TRUE(o["true"].GetBool());
- EXPECT_FALSE(o["false"].GetBool());
- EXPECT_EQ(-1, o["int"].GetInt());
- EXPECT_EQ(1u, o["uint"].GetUint());
- EXPECT_EQ(int64_t(-4294967296), o["int64"].GetInt64());
- EXPECT_EQ(uint64_t(4294967296), o["uint64"].GetUint64());
- EXPECT_STREQ("Jelly",o["string"].GetString());
- EXPECT_EQ(8u, o.MemberCount());
- }
-
- // AddMember<T>(Value&, T, Allocator)
- {
- Value o(kObjectType);
-
- Value n("s");
- o.AddMember(n, "string", allocator);
- EXPECT_EQ(1u, o.MemberCount());
-
- Value count("#");
- o.AddMember(count, o.MemberCount(), allocator);
- EXPECT_EQ(2u, o.MemberCount());
- }
-
-#if RAPIDJSON_HAS_STDSTRING
- {
- // AddMember(StringRefType, const std::string&, Allocator)
- Value o(kObjectType);
- o.AddMember("b", std::string("Banana"), allocator);
- EXPECT_STREQ("Banana", o["b"].GetString());
-
- // RemoveMember(const std::string&)
- o.RemoveMember(std::string("b"));
- EXPECT_TRUE(o.ObjectEmpty());
- }
-#endif
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
- // AddMember(GenericValue&&, ...) variants
- {
- Value o(kObjectType);
- o.AddMember(Value("true"), Value(true), allocator);
- o.AddMember(Value("false"), Value(false).Move(), allocator); // value is lvalue ref
- o.AddMember(Value("int").Move(), Value(-1), allocator); // name is lvalue ref
- o.AddMember("uint", std::move(Value().SetUint(1u)), allocator); // name is literal, value is rvalue
- EXPECT_TRUE(o["true"].GetBool());
- EXPECT_FALSE(o["false"].GetBool());
- EXPECT_EQ(-1, o["int"].GetInt());
- EXPECT_EQ(1u, o["uint"].GetUint());
- EXPECT_EQ(4u, o.MemberCount());
- }
-#endif
-
- // Tests a member with null character
- Value name;
- const Value C0D("C\0D", 3);
- name.SetString(C0D.GetString(), 3);
- value.SetString("CherryD", 7);
- x.AddMember(name, value, allocator);
-
- // HasMember()
- EXPECT_TRUE(x.HasMember("A"));
- EXPECT_TRUE(x.HasMember("B"));
- EXPECT_TRUE(y.HasMember("A"));
- EXPECT_TRUE(y.HasMember("B"));
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_TRUE(x.HasMember(std::string("A")));
-#endif
-
- name.SetString("C\0D");
- EXPECT_TRUE(x.HasMember(name));
- EXPECT_TRUE(y.HasMember(name));
-
- GenericValue<UTF8<>, CrtAllocator> othername("A");
- EXPECT_TRUE(x.HasMember(othername));
- EXPECT_TRUE(y.HasMember(othername));
- othername.SetString("C\0D");
- EXPECT_TRUE(x.HasMember(othername));
- EXPECT_TRUE(y.HasMember(othername));
-
- // operator[]
- EXPECT_STREQ("Apple", x["A"].GetString());
- EXPECT_STREQ("Banana", x["B"].GetString());
- EXPECT_STREQ("CherryD", x[C0D].GetString());
- EXPECT_STREQ("CherryD", x[othername].GetString());
- EXPECT_THROW(x["nonexist"], AssertException);
-
- // const operator[]
- EXPECT_STREQ("Apple", y["A"].GetString());
- EXPECT_STREQ("Banana", y["B"].GetString());
- EXPECT_STREQ("CherryD", y[C0D].GetString());
-
-#if RAPIDJSON_HAS_STDSTRING
- EXPECT_STREQ("Apple", x["A"].GetString());
- EXPECT_STREQ("Apple", y[std::string("A")].GetString());
-#endif
-
- // member iterator
- Value::MemberIterator itr = x.MemberBegin();
- EXPECT_TRUE(itr != x.MemberEnd());
- EXPECT_STREQ("A", itr->name.GetString());
- EXPECT_STREQ("Apple", itr->value.GetString());
- ++itr;
- EXPECT_TRUE(itr != x.MemberEnd());
- EXPECT_STREQ("B", itr->name.GetString());
- EXPECT_STREQ("Banana", itr->value.GetString());
- ++itr;
- EXPECT_TRUE(itr != x.MemberEnd());
- EXPECT_TRUE(memcmp(itr->name.GetString(), "C\0D", 4) == 0);
- EXPECT_STREQ("CherryD", itr->value.GetString());
- ++itr;
- EXPECT_FALSE(itr != x.MemberEnd());
-
- // const member iterator
- Value::ConstMemberIterator citr = y.MemberBegin();
- EXPECT_TRUE(citr != y.MemberEnd());
- EXPECT_STREQ("A", citr->name.GetString());
- EXPECT_STREQ("Apple", citr->value.GetString());
- ++citr;
- EXPECT_TRUE(citr != y.MemberEnd());
- EXPECT_STREQ("B", citr->name.GetString());
- EXPECT_STREQ("Banana", citr->value.GetString());
- ++citr;
- EXPECT_TRUE(citr != y.MemberEnd());
- EXPECT_TRUE(memcmp(citr->name.GetString(), "C\0D", 4) == 0);
- EXPECT_STREQ("CherryD", citr->value.GetString());
- ++citr;
- EXPECT_FALSE(citr != y.MemberEnd());
-
- // member iterator conversions/relations
- itr = x.MemberBegin();
- citr = x.MemberBegin(); // const conversion
- TestEqual(itr, citr);
- EXPECT_TRUE(itr < x.MemberEnd());
- EXPECT_FALSE(itr > y.MemberEnd());
- EXPECT_TRUE(citr < x.MemberEnd());
- EXPECT_FALSE(citr > y.MemberEnd());
- ++citr;
- TestUnequal(itr, citr);
- EXPECT_FALSE(itr < itr);
- EXPECT_TRUE(itr < citr);
- EXPECT_FALSE(itr > itr);
- EXPECT_TRUE(citr > itr);
- EXPECT_EQ(1, citr - x.MemberBegin());
- EXPECT_EQ(0, itr - y.MemberBegin());
- itr += citr - x.MemberBegin();
- EXPECT_EQ(1, itr - y.MemberBegin());
- TestEqual(citr, itr);
- EXPECT_TRUE(itr <= citr);
- EXPECT_TRUE(citr <= itr);
- itr++;
- EXPECT_TRUE(itr >= citr);
- EXPECT_FALSE(citr >= itr);
-
- // RemoveMember()
- EXPECT_TRUE(x.RemoveMember("A"));
- EXPECT_FALSE(x.HasMember("A"));
-
- EXPECT_TRUE(x.RemoveMember("B"));
- EXPECT_FALSE(x.HasMember("B"));
-
- EXPECT_FALSE(x.RemoveMember("nonexist"));
-
- EXPECT_TRUE(x.RemoveMember(othername));
- EXPECT_FALSE(x.HasMember(name));
-
- EXPECT_TRUE(x.MemberBegin() == x.MemberEnd());
-
- // EraseMember(ConstMemberIterator)
-
- // Use array members to ensure removed elements' destructor is called.
- // { "a": [0], "b": [1],[2],...]
- const char keys[][2] = { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j" };
- for (int i = 0; i < 10; i++)
- x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);
-
- // MemberCount, iterator difference
- EXPECT_EQ(x.MemberCount(), SizeType(x.MemberEnd() - x.MemberBegin()));
-
- // Erase the first
- itr = x.EraseMember(x.MemberBegin());
- EXPECT_FALSE(x.HasMember(keys[0]));
- EXPECT_EQ(x.MemberBegin(), itr);
- EXPECT_EQ(9u, x.MemberCount());
- for (; itr != x.MemberEnd(); ++itr) {
- size_t i = static_cast<size_t>((itr - x.MemberBegin())) + 1;
- EXPECT_STREQ(itr->name.GetString(), keys[i]);
- EXPECT_EQ(static_cast<int>(i), itr->value[0].GetInt());
- }
-
- // Erase the last
- itr = x.EraseMember(x.MemberEnd() - 1);
- EXPECT_FALSE(x.HasMember(keys[9]));
- EXPECT_EQ(x.MemberEnd(), itr);
- EXPECT_EQ(8u, x.MemberCount());
- for (; itr != x.MemberEnd(); ++itr) {
- size_t i = static_cast<size_t>(itr - x.MemberBegin()) + 1;
- EXPECT_STREQ(itr->name.GetString(), keys[i]);
- EXPECT_EQ(static_cast<int>(i), itr->value[0].GetInt());
- }
-
- // Erase the middle
- itr = x.EraseMember(x.MemberBegin() + 4);
- EXPECT_FALSE(x.HasMember(keys[5]));
- EXPECT_EQ(x.MemberBegin() + 4, itr);
- EXPECT_EQ(7u, x.MemberCount());
- for (; itr != x.MemberEnd(); ++itr) {
- size_t i = static_cast<size_t>(itr - x.MemberBegin());
- i += (i < 4) ? 1 : 2;
- EXPECT_STREQ(itr->name.GetString(), keys[i]);
- EXPECT_EQ(static_cast<int>(i), itr->value[0].GetInt());
- }
-
- // EraseMember(ConstMemberIterator, ConstMemberIterator)
- // Exhaustive test with all 0 <= first < n, first <= last <= n cases
- const unsigned n = 10;
- for (unsigned first = 0; first < n; first++) {
- for (unsigned last = first; last <= n; last++) {
- x.RemoveAllMembers();
- for (unsigned i = 0; i < n; i++)
- x.AddMember(keys[i], Value(kArrayType).PushBack(i, allocator), allocator);
-
- itr = x.EraseMember(x.MemberBegin() + static_cast<int>(first), x.MemberBegin() + static_cast<int>(last));
- if (last == n)
- EXPECT_EQ(x.MemberEnd(), itr);
- else
- EXPECT_EQ(x.MemberBegin() + static_cast<int>(first), itr);
-
- size_t removeCount = last - first;
- EXPECT_EQ(n - removeCount, x.MemberCount());
- for (unsigned i = 0; i < first; i++)
- EXPECT_EQ(i, x[keys[i]][0].GetUint());
- for (unsigned i = first; i < n - removeCount; i++)
- EXPECT_EQ(i + removeCount, x[keys[i+removeCount]][0].GetUint());
- }
- }
-
- // RemoveAllMembers()
- x.RemoveAllMembers();
- EXPECT_TRUE(x.ObjectEmpty());
- EXPECT_EQ(0u, x.MemberCount());
-}
-
-TEST(Value, Object) {
- Value::AllocatorType allocator;
- Value x(kObjectType);
- const Value& y = x; // const version
-
- EXPECT_EQ(kObjectType, x.GetType());
- EXPECT_TRUE(x.IsObject());
- EXPECT_TRUE(x.ObjectEmpty());
- EXPECT_EQ(0u, x.MemberCount());
- EXPECT_EQ(kObjectType, y.GetType());
- EXPECT_TRUE(y.IsObject());
- EXPECT_TRUE(y.ObjectEmpty());
- EXPECT_EQ(0u, y.MemberCount());
-
- TestObject(x, allocator);
-
- // SetObject()
- Value z;
- z.SetObject();
- EXPECT_TRUE(z.IsObject());
-}
-
-TEST(Value, ObjectHelper) {
- Value::AllocatorType allocator;
- {
- Value x(kObjectType);
- Value::Object o = x.GetObject();
- TestObject(o, allocator);
- }
-
- {
- Value x(kObjectType);
- Value::Object o = x.GetObject();
- o.AddMember("1", 1, allocator);
-
- Value::Object o2(o); // copy constructor
- EXPECT_EQ(1u, o2.MemberCount());
-
- Value::Object o3 = o;
- EXPECT_EQ(1u, o3.MemberCount());
-
- Value::ConstObject y = static_cast<const Value&>(x).GetObject();
- (void)y;
- // y.AddMember("1", 1, allocator); // should not compile
-
- // Templated functions
- x.RemoveAllMembers();
- EXPECT_TRUE(x.Is<Value::Object>());
- EXPECT_TRUE(x.Is<Value::ConstObject>());
- o.AddMember("1", 1, allocator);
- EXPECT_EQ(1, x.Get<Value::Object>()["1"].GetInt());
- EXPECT_EQ(1, x.Get<Value::ConstObject>()["1"].GetInt());
-
- Value x2;
- x2.Set<Value::Object>(o);
- EXPECT_TRUE(x.IsObject()); // IsObject() is invariant after moving
- EXPECT_EQ(1, x2.Get<Value::Object>()["1"].GetInt());
- }
-
- {
- Value x(kObjectType);
- x.AddMember("a", "apple", allocator);
- Value y(x.GetObject());
- EXPECT_STREQ("apple", y["a"].GetString());
- EXPECT_TRUE(x.IsObject()); // Invariant
- }
-
- {
- Value x(kObjectType);
- x.AddMember("a", "apple", allocator);
- Value y(kObjectType);
- y.AddMember("fruits", x.GetObject(), allocator);
- EXPECT_STREQ("apple", y["fruits"]["a"].GetString());
- EXPECT_TRUE(x.IsObject()); // Invariant
- }
-}
-
-#if RAPIDJSON_HAS_CXX11_RANGE_FOR
-TEST(Value, ObjectHelperRangeFor) {
- Value::AllocatorType allocator;
- Value x(kObjectType);
-
- for (int i = 0; i < 10; i++) {
- char name[10];
- Value n(name, static_cast<SizeType>(sprintf(name, "%d", i)), allocator);
- x.AddMember(n, i, allocator);
- }
-
- {
- int i = 0;
- for (auto& m : x.GetObject()) {
- char name[11];
- sprintf(name, "%d", i);
- EXPECT_STREQ(name, m.name.GetString());
- EXPECT_EQ(i, m.value.GetInt());
- i++;
- }
- EXPECT_EQ(i, 10);
- }
- {
- int i = 0;
- for (const auto& m : const_cast<const Value&>(x).GetObject()) {
- char name[11];
- sprintf(name, "%d", i);
- EXPECT_STREQ(name, m.name.GetString());
- EXPECT_EQ(i, m.value.GetInt());
- i++;
- }
- EXPECT_EQ(i, 10);
- }
-
- // Object a = x.GetObject();
- // Object ca = const_cast<const Value&>(x).GetObject();
-}
-#endif
-
-TEST(Value, EraseMember_String) {
- Value::AllocatorType allocator;
- Value x(kObjectType);
- x.AddMember("A", "Apple", allocator);
- x.AddMember("B", "Banana", allocator);
-
- EXPECT_TRUE(x.EraseMember("B"));
- EXPECT_FALSE(x.HasMember("B"));
-
- EXPECT_FALSE(x.EraseMember("nonexist"));
-
- GenericValue<UTF8<>, CrtAllocator> othername("A");
- EXPECT_TRUE(x.EraseMember(othername));
- EXPECT_FALSE(x.HasMember("A"));
-
- EXPECT_TRUE(x.MemberBegin() == x.MemberEnd());
-}
-
-TEST(Value, BigNestedArray) {
- MemoryPoolAllocator<> allocator;
- Value x(kArrayType);
- static const SizeType n = 200;
-
- for (SizeType i = 0; i < n; i++) {
- Value y(kArrayType);
- for (SizeType j = 0; j < n; j++) {
- Value number(static_cast<int>(i * n + j));
- y.PushBack(number, allocator);
- }
- x.PushBack(y, allocator);
- }
-
- for (SizeType i = 0; i < n; i++)
- for (SizeType j = 0; j < n; j++) {
- EXPECT_TRUE(x[i][j].IsInt());
- EXPECT_EQ(static_cast<int>(i * n + j), x[i][j].GetInt());
- }
-}
-
-TEST(Value, BigNestedObject) {
- MemoryPoolAllocator<> allocator;
- Value x(kObjectType);
- static const SizeType n = 200;
-
- for (SizeType i = 0; i < n; i++) {
- char name1[10];
- sprintf(name1, "%d", i);
-
- // Value name(name1); // should not compile
- Value name(name1, static_cast<SizeType>(strlen(name1)), allocator);
- Value object(kObjectType);
-
- for (SizeType j = 0; j < n; j++) {
- char name2[10];
- sprintf(name2, "%d", j);
-
- Value name3(name2, static_cast<SizeType>(strlen(name2)), allocator);
- Value number(static_cast<int>(i * n + j));
- object.AddMember(name3, number, allocator);
- }
-
- // x.AddMember(name1, object, allocator); // should not compile
- x.AddMember(name, object, allocator);
- }
-
- for (SizeType i = 0; i < n; i++) {
- char name1[10];
- sprintf(name1, "%d", i);
-
- for (SizeType j = 0; j < n; j++) {
- char name2[10];
- sprintf(name2, "%d", j);
- x[name1];
- EXPECT_EQ(static_cast<int>(i * n + j), x[name1][name2].GetInt());
- }
- }
-}
-
-// Issue 18: Error removing last element of object
-// http://code.google.com/p/rapidjson/issues/detail?id=18
-TEST(Value, RemoveLastElement) {
- rapidjson::Document doc;
- rapidjson::Document::AllocatorType& allocator = doc.GetAllocator();
- rapidjson::Value objVal(rapidjson::kObjectType);
- objVal.AddMember("var1", 123, allocator);
- objVal.AddMember("var2", "444", allocator);
- objVal.AddMember("var3", 555, allocator);
- EXPECT_TRUE(objVal.HasMember("var3"));
- objVal.RemoveMember("var3"); // Assertion here in r61
- EXPECT_FALSE(objVal.HasMember("var3"));
-}
-
-// Issue 38: Segmentation fault with CrtAllocator
-TEST(Document, CrtAllocator) {
- typedef GenericValue<UTF8<>, CrtAllocator> V;
-
- V::AllocatorType allocator;
- V o(kObjectType);
- o.AddMember("x", 1, allocator); // Should not call destructor on uninitialized name/value of newly allocated members.
-
- V a(kArrayType);
- a.PushBack(1, allocator); // Should not call destructor on uninitialized Value of newly allocated elements.
-}
-
-static void TestShortStringOptimization(const char* str) {
- const rapidjson::SizeType len = static_cast<rapidjson::SizeType>(strlen(str));
-
- rapidjson::Document doc;
- rapidjson::Value val;
- val.SetString(str, len, doc.GetAllocator());
-
- EXPECT_EQ(val.GetStringLength(), len);
- EXPECT_STREQ(val.GetString(), str);
-}
-
-TEST(Value, AllocateShortString) {
- TestShortStringOptimization(""); // edge case: empty string
- TestShortStringOptimization("12345678"); // regular case for short strings: 8 chars
- TestShortStringOptimization("12345678901"); // edge case: 11 chars in 32-bit mode (=> short string)
- TestShortStringOptimization("123456789012"); // edge case: 12 chars in 32-bit mode (=> regular string)
- TestShortStringOptimization("123456789012345"); // edge case: 15 chars in 64-bit mode (=> short string)
- TestShortStringOptimization("1234567890123456"); // edge case: 16 chars in 64-bit mode (=> regular string)
-}
-
-template <int e>
-struct TerminateHandler {
- bool Null() { return e != 0; }
- bool Bool(bool) { return e != 1; }
- bool Int(int) { return e != 2; }
- bool Uint(unsigned) { return e != 3; }
- bool Int64(int64_t) { return e != 4; }
- bool Uint64(uint64_t) { return e != 5; }
- bool Double(double) { return e != 6; }
- bool RawNumber(const char*, SizeType, bool) { return e != 7; }
- bool String(const char*, SizeType, bool) { return e != 8; }
- bool StartObject() { return e != 9; }
- bool Key(const char*, SizeType, bool) { return e != 10; }
- bool EndObject(SizeType) { return e != 11; }
- bool StartArray() { return e != 12; }
- bool EndArray(SizeType) { return e != 13; }
-};
-
-#define TEST_TERMINATION(e, json)\
-{\
- Document d; \
- EXPECT_FALSE(d.Parse(json).HasParseError()); \
- Reader reader; \
- TerminateHandler<e> h;\
- EXPECT_FALSE(d.Accept(h));\
-}
-
-TEST(Value, AcceptTerminationByHandler) {
- TEST_TERMINATION(0, "[null]");
- TEST_TERMINATION(1, "[true]");
- TEST_TERMINATION(1, "[false]");
- TEST_TERMINATION(2, "[-1]");
- TEST_TERMINATION(3, "[2147483648]");
- TEST_TERMINATION(4, "[-1234567890123456789]");
- TEST_TERMINATION(5, "[9223372036854775808]");
- TEST_TERMINATION(6, "[0.5]");
- // RawNumber() is never called
- TEST_TERMINATION(8, "[\"a\"]");
- TEST_TERMINATION(9, "[{}]");
- TEST_TERMINATION(10, "[{\"a\":1}]");
- TEST_TERMINATION(11, "[{}]");
- TEST_TERMINATION(12, "{\"a\":[]}");
- TEST_TERMINATION(13, "{\"a\":[]}");
-}
-
-struct ValueIntComparer {
- bool operator()(const Value& lhs, const Value& rhs) const {
- return lhs.GetInt() < rhs.GetInt();
- }
-};
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-TEST(Value, Sorting) {
- Value::AllocatorType allocator;
- Value a(kArrayType);
- a.PushBack(5, allocator);
- a.PushBack(1, allocator);
- a.PushBack(3, allocator);
- std::sort(a.Begin(), a.End(), ValueIntComparer());
- EXPECT_EQ(1, a[0].GetInt());
- EXPECT_EQ(3, a[1].GetInt());
- EXPECT_EQ(5, a[2].GetInt());
-}
-#endif
-
-// http://stackoverflow.com/questions/35222230/
-
-static void MergeDuplicateKey(Value& v, Value::AllocatorType& a) {
- if (v.IsObject()) {
- // Convert all key:value into key:[value]
- for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr)
- itr->value = Value(kArrayType).Move().PushBack(itr->value, a);
-
- // Merge arrays if key is duplicated
- for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd();) {
- Value::MemberIterator itr2 = v.FindMember(itr->name);
- if (itr != itr2) {
- itr2->value.PushBack(itr->value[0], a);
- itr = v.EraseMember(itr);
- }
- else
- ++itr;
- }
-
- // Convert key:[values] back to key:value if there is only one value
- for (Value::MemberIterator itr = v.MemberBegin(); itr != v.MemberEnd(); ++itr) {
- if (itr->value.Size() == 1)
- itr->value = itr->value[0];
- MergeDuplicateKey(itr->value, a); // Recursion on the value
- }
- }
- else if (v.IsArray())
- for (Value::ValueIterator itr = v.Begin(); itr != v.End(); ++itr)
- MergeDuplicateKey(*itr, a);
-}
-
-TEST(Value, MergeDuplicateKey) {
- Document d;
- d.Parse(
- "{"
- " \"key1\": {"
- " \"a\": \"asdf\","
- " \"b\": \"foo\","
- " \"b\": \"bar\","
- " \"c\": \"fdas\""
- " }"
- "}");
-
- Document d2;
- d2.Parse(
- "{"
- " \"key1\": {"
- " \"a\": \"asdf\","
- " \"b\": ["
- " \"foo\","
- " \"bar\""
- " ],"
- " \"c\": \"fdas\""
- " }"
- "}");
-
- EXPECT_NE(d2, d);
- MergeDuplicateKey(d, d.GetAllocator());
- EXPECT_EQ(d2, d);
-}
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/writertest.cpp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/writertest.cpp
deleted file mode 100644
index bfbd71c4c9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/unittest/writertest.cpp
+++ /dev/null
@@ -1,598 +0,0 @@
-// Tencent is pleased to support the open source community by making RapidJSON available.
-//
-// Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip.
-//
-// Licensed under the MIT License (the "License"); you may not use this file except
-// in compliance with the License. You may obtain a copy of the License at
-//
-// http://opensource.org/licenses/MIT
-//
-// 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 "unittest.h"
-
-#include "rapidjson/document.h"
-#include "rapidjson/reader.h"
-#include "rapidjson/writer.h"
-#include "rapidjson/stringbuffer.h"
-#include "rapidjson/memorybuffer.h"
-
-#ifdef __clang__
-RAPIDJSON_DIAG_PUSH
-RAPIDJSON_DIAG_OFF(c++98-compat)
-#endif
-
-using namespace rapidjson;
-
-TEST(Writer, Compact) {
- StringStream s("{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3] } ");
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- buffer.ShrinkToFit();
- Reader reader;
- reader.Parse<0>(s, writer);
- EXPECT_STREQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3]}", buffer.GetString());
- EXPECT_EQ(77u, buffer.GetSize());
- EXPECT_TRUE(writer.IsComplete());
-}
-
-// json -> parse -> writer -> json
-#define TEST_ROUNDTRIP(json) \
- { \
- StringStream s(json); \
- StringBuffer buffer; \
- Writer<StringBuffer> writer(buffer); \
- Reader reader; \
- reader.Parse<kParseFullPrecisionFlag>(s, writer); \
- EXPECT_STREQ(json, buffer.GetString()); \
- EXPECT_TRUE(writer.IsComplete()); \
- }
-
-TEST(Writer, Root) {
- TEST_ROUNDTRIP("null");
- TEST_ROUNDTRIP("true");
- TEST_ROUNDTRIP("false");
- TEST_ROUNDTRIP("0");
- TEST_ROUNDTRIP("\"foo\"");
- TEST_ROUNDTRIP("[]");
- TEST_ROUNDTRIP("{}");
-}
-
-TEST(Writer, Int) {
- TEST_ROUNDTRIP("[-1]");
- TEST_ROUNDTRIP("[-123]");
- TEST_ROUNDTRIP("[-2147483648]");
-}
-
-TEST(Writer, UInt) {
- TEST_ROUNDTRIP("[0]");
- TEST_ROUNDTRIP("[1]");
- TEST_ROUNDTRIP("[123]");
- TEST_ROUNDTRIP("[2147483647]");
- TEST_ROUNDTRIP("[4294967295]");
-}
-
-TEST(Writer, Int64) {
- TEST_ROUNDTRIP("[-1234567890123456789]");
- TEST_ROUNDTRIP("[-9223372036854775808]");
-}
-
-TEST(Writer, Uint64) {
- TEST_ROUNDTRIP("[1234567890123456789]");
- TEST_ROUNDTRIP("[9223372036854775807]");
-}
-
-TEST(Writer, String) {
- TEST_ROUNDTRIP("[\"Hello\"]");
- TEST_ROUNDTRIP("[\"Hello\\u0000World\"]");
- TEST_ROUNDTRIP("[\"\\\"\\\\/\\b\\f\\n\\r\\t\"]");
-
-#if RAPIDJSON_HAS_STDSTRING
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.String(std::string("Hello\n"));
- EXPECT_STREQ("\"Hello\\n\"", buffer.GetString());
- }
-#endif
-}
-
-TEST(Writer, Issue_889) {
- char buf[100] = "Hello";
-
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartArray();
- writer.String(buf);
- writer.EndArray();
-
- EXPECT_STREQ("[\"Hello\"]", buffer.GetString());
- EXPECT_TRUE(writer.IsComplete()); \
-}
-
-TEST(Writer, ScanWriteUnescapedString) {
- const char json[] = "[\" \\\"0123456789ABCDEF\"]";
- // ^ scanning stops here.
- char buffer2[sizeof(json) + 32];
-
- // Use different offset to test different alignments
- for (int i = 0; i < 32; i++) {
- char* p = buffer2 + i;
- memcpy(p, json, sizeof(json));
- TEST_ROUNDTRIP(p);
- }
-}
-
-TEST(Writer, Double) {
- TEST_ROUNDTRIP("[1.2345,1.2345678,0.123456789012,1234567.8]");
- TEST_ROUNDTRIP("0.0");
- TEST_ROUNDTRIP("-0.0"); // Issue #289
- TEST_ROUNDTRIP("1e30");
- TEST_ROUNDTRIP("1.0");
- TEST_ROUNDTRIP("5e-324"); // Min subnormal positive double
- TEST_ROUNDTRIP("2.225073858507201e-308"); // Max subnormal positive double
- TEST_ROUNDTRIP("2.2250738585072014e-308"); // Min normal positive double
- TEST_ROUNDTRIP("1.7976931348623157e308"); // Max double
-
-}
-
-// UTF8 -> TargetEncoding -> UTF8
-template <typename TargetEncoding>
-void TestTranscode(const char* json) {
- StringStream s(json);
- GenericStringBuffer<TargetEncoding> buffer;
- Writer<GenericStringBuffer<TargetEncoding>, UTF8<>, TargetEncoding> writer(buffer);
- Reader reader;
- reader.Parse(s, writer);
-
- StringBuffer buffer2;
- Writer<StringBuffer> writer2(buffer2);
- GenericReader<TargetEncoding, UTF8<> > reader2;
- GenericStringStream<TargetEncoding> s2(buffer.GetString());
- reader2.Parse(s2, writer2);
-
- EXPECT_STREQ(json, buffer2.GetString());
-}
-
-TEST(Writer, Transcode) {
- const char json[] = "{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3],\"dollar\":\"\x24\",\"cents\":\"\xC2\xA2\",\"euro\":\"\xE2\x82\xAC\",\"gclef\":\"\xF0\x9D\x84\x9E\"}";
-
- // UTF8 -> UTF16 -> UTF8
- TestTranscode<UTF8<> >(json);
-
- // UTF8 -> ASCII -> UTF8
- TestTranscode<ASCII<> >(json);
-
- // UTF8 -> UTF16 -> UTF8
- TestTranscode<UTF16<> >(json);
-
- // UTF8 -> UTF32 -> UTF8
- TestTranscode<UTF32<> >(json);
-
- // UTF8 -> AutoUTF -> UTF8
- UTFType types[] = { kUTF8, kUTF16LE , kUTF16BE, kUTF32LE , kUTF32BE };
- for (size_t i = 0; i < 5; i++) {
- StringStream s(json);
- MemoryBuffer buffer;
- AutoUTFOutputStream<unsigned, MemoryBuffer> os(buffer, types[i], true);
- Writer<AutoUTFOutputStream<unsigned, MemoryBuffer>, UTF8<>, AutoUTF<unsigned> > writer(os);
- Reader reader;
- reader.Parse(s, writer);
-
- StringBuffer buffer2;
- Writer<StringBuffer> writer2(buffer2);
- GenericReader<AutoUTF<unsigned>, UTF8<> > reader2;
- MemoryStream s2(buffer.GetBuffer(), buffer.GetSize());
- AutoUTFInputStream<unsigned, MemoryStream> is(s2);
- reader2.Parse(is, writer2);
-
- EXPECT_STREQ(json, buffer2.GetString());
- }
-
-}
-
-#include <sstream>
-
-class OStreamWrapper {
-public:
- typedef char Ch;
-
- OStreamWrapper(std::ostream& os) : os_(os) {}
-
- Ch Peek() const { assert(false); return '\0'; }
- Ch Take() { assert(false); return '\0'; }
- size_t Tell() const { return 0; }
-
- Ch* PutBegin() { assert(false); return 0; }
- void Put(Ch c) { os_.put(c); }
- void Flush() { os_.flush(); }
- size_t PutEnd(Ch*) { assert(false); return 0; }
-
-private:
- OStreamWrapper(const OStreamWrapper&);
- OStreamWrapper& operator=(const OStreamWrapper&);
-
- std::ostream& os_;
-};
-
-TEST(Writer, OStreamWrapper) {
- StringStream s("{ \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3], \"u64\": 1234567890123456789, \"i64\":-1234567890123456789 } ");
-
- std::stringstream ss;
- OStreamWrapper os(ss);
-
- Writer<OStreamWrapper> writer(os);
-
- Reader reader;
- reader.Parse<0>(s, writer);
-
- std::string actual = ss.str();
- EXPECT_STREQ("{\"hello\":\"world\",\"t\":true,\"f\":false,\"n\":null,\"i\":123,\"pi\":3.1416,\"a\":[1,2,3],\"u64\":1234567890123456789,\"i64\":-1234567890123456789}", actual.c_str());
-}
-
-TEST(Writer, AssertRootMayBeAnyValue) {
-#define T(x)\
- {\
- StringBuffer buffer;\
- Writer<StringBuffer> writer(buffer);\
- EXPECT_TRUE(x);\
- }
- T(writer.Bool(false));
- T(writer.Bool(true));
- T(writer.Null());
- T(writer.Int(0));
- T(writer.Uint(0));
- T(writer.Int64(0));
- T(writer.Uint64(0));
- T(writer.Double(0));
- T(writer.String("foo"));
-#undef T
-}
-
-TEST(Writer, AssertIncorrectObjectLevel) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.EndObject();
- ASSERT_THROW(writer.EndObject(), AssertException);
-}
-
-TEST(Writer, AssertIncorrectArrayLevel) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartArray();
- writer.EndArray();
- ASSERT_THROW(writer.EndArray(), AssertException);
-}
-
-TEST(Writer, AssertIncorrectEndObject) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- ASSERT_THROW(writer.EndArray(), AssertException);
-}
-
-TEST(Writer, AssertIncorrectEndArray) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- ASSERT_THROW(writer.EndArray(), AssertException);
-}
-
-TEST(Writer, AssertObjectKeyNotString) {
-#define T(x)\
- {\
- StringBuffer buffer;\
- Writer<StringBuffer> writer(buffer);\
- writer.StartObject();\
- ASSERT_THROW(x, AssertException); \
- }
- T(writer.Bool(false));
- T(writer.Bool(true));
- T(writer.Null());
- T(writer.Int(0));
- T(writer.Uint(0));
- T(writer.Int64(0));
- T(writer.Uint64(0));
- T(writer.Double(0));
- T(writer.StartObject());
- T(writer.StartArray());
-#undef T
-}
-
-TEST(Writer, AssertMultipleRoot) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
-
- writer.StartObject();
- writer.EndObject();
- ASSERT_THROW(writer.StartObject(), AssertException);
-
- writer.Reset(buffer);
- writer.Null();
- ASSERT_THROW(writer.Int(0), AssertException);
-
- writer.Reset(buffer);
- writer.String("foo");
- ASSERT_THROW(writer.StartArray(), AssertException);
-
- writer.Reset(buffer);
- writer.StartArray();
- writer.EndArray();
- //ASSERT_THROW(writer.Double(3.14), AssertException);
-}
-
-TEST(Writer, RootObjectIsComplete) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.IsComplete());
- writer.StartObject();
- EXPECT_FALSE(writer.IsComplete());
- writer.String("foo");
- EXPECT_FALSE(writer.IsComplete());
- writer.Int(1);
- EXPECT_FALSE(writer.IsComplete());
- writer.EndObject();
- EXPECT_TRUE(writer.IsComplete());
-}
-
-TEST(Writer, RootArrayIsComplete) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.IsComplete());
- writer.StartArray();
- EXPECT_FALSE(writer.IsComplete());
- writer.String("foo");
- EXPECT_FALSE(writer.IsComplete());
- writer.Int(1);
- EXPECT_FALSE(writer.IsComplete());
- writer.EndArray();
- EXPECT_TRUE(writer.IsComplete());
-}
-
-TEST(Writer, RootValueIsComplete) {
-#define T(x)\
- {\
- StringBuffer buffer;\
- Writer<StringBuffer> writer(buffer);\
- EXPECT_FALSE(writer.IsComplete()); \
- x; \
- EXPECT_TRUE(writer.IsComplete()); \
- }
- T(writer.Null());
- T(writer.Bool(true));
- T(writer.Bool(false));
- T(writer.Int(0));
- T(writer.Uint(0));
- T(writer.Int64(0));
- T(writer.Uint64(0));
- T(writer.Double(0));
- T(writer.String(""));
-#undef T
-}
-
-TEST(Writer, InvalidEncoding) {
- // Fail in decoding invalid UTF-8 sequence http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
- {
- GenericStringBuffer<UTF16<> > buffer;
- Writer<GenericStringBuffer<UTF16<> >, UTF8<>, UTF16<> > writer(buffer);
- writer.StartArray();
- EXPECT_FALSE(writer.String("\xfe"));
- EXPECT_FALSE(writer.String("\xff"));
- EXPECT_FALSE(writer.String("\xfe\xfe\xff\xff"));
- writer.EndArray();
- }
-
- // Fail in encoding
- {
- StringBuffer buffer;
- Writer<StringBuffer, UTF32<> > writer(buffer);
- static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF
- EXPECT_FALSE(writer.String(s));
- }
-
- // Fail in unicode escaping in ASCII output
- {
- StringBuffer buffer;
- Writer<StringBuffer, UTF32<>, ASCII<> > writer(buffer);
- static const UTF32<>::Ch s[] = { 0x110000, 0 }; // Out of U+0000 to U+10FFFF
- EXPECT_FALSE(writer.String(s));
- }
-}
-
-TEST(Writer, ValidateEncoding) {
- {
- StringBuffer buffer;
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteValidateEncodingFlag> writer(buffer);
- writer.StartArray();
- EXPECT_TRUE(writer.String("\x24")); // Dollar sign U+0024
- EXPECT_TRUE(writer.String("\xC2\xA2")); // Cents sign U+00A2
- EXPECT_TRUE(writer.String("\xE2\x82\xAC")); // Euro sign U+20AC
- EXPECT_TRUE(writer.String("\xF0\x9D\x84\x9E")); // G clef sign U+1D11E
- EXPECT_TRUE(writer.String("\x01")); // SOH control U+0001
- EXPECT_TRUE(writer.String("\x1B")); // Escape control U+001B
- writer.EndArray();
- EXPECT_STREQ("[\"\x24\",\"\xC2\xA2\",\"\xE2\x82\xAC\",\"\xF0\x9D\x84\x9E\",\"\\u0001\",\"\\u001B\"]", buffer.GetString());
- }
-
- // Fail in decoding invalid UTF-8 sequence http://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
- {
- StringBuffer buffer;
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteValidateEncodingFlag> writer(buffer);
- writer.StartArray();
- EXPECT_FALSE(writer.String("\xfe"));
- EXPECT_FALSE(writer.String("\xff"));
- EXPECT_FALSE(writer.String("\xfe\xfe\xff\xff"));
- writer.EndArray();
- }
-}
-
-TEST(Writer, InvalidEventSequence) {
- // {]
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- EXPECT_THROW(writer.EndArray(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // [}
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartArray();
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 1:
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- EXPECT_THROW(writer.Int(1), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 'a' }
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-
- // { 'a':'b','c' }
- {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- writer.String("b");
- writer.Key("c");
- EXPECT_THROW(writer.EndObject(), AssertException);
- EXPECT_FALSE(writer.IsComplete());
- }
-}
-
-TEST(Writer, NaN) {
- double nan = std::numeric_limits<double>::quiet_NaN();
-
- EXPECT_TRUE(internal::Double(nan).IsNan());
- StringBuffer buffer;
- {
- Writer<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(nan));
- }
- {
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(nan));
- EXPECT_STREQ("NaN", buffer.GetString());
- }
- GenericStringBuffer<UTF16<> > buffer2;
- Writer<GenericStringBuffer<UTF16<> > > writer2(buffer2);
- EXPECT_FALSE(writer2.Double(nan));
-}
-
-TEST(Writer, Inf) {
- double inf = std::numeric_limits<double>::infinity();
-
- EXPECT_TRUE(internal::Double(inf).IsInf());
- StringBuffer buffer;
- {
- Writer<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(inf));
- }
- {
- Writer<StringBuffer> writer(buffer);
- EXPECT_FALSE(writer.Double(-inf));
- }
- {
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(inf));
- }
- {
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteNanAndInfFlag> writer(buffer);
- EXPECT_TRUE(writer.Double(-inf));
- }
- EXPECT_STREQ("Infinity-Infinity", buffer.GetString());
-}
-
-TEST(Writer, RawValue) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(buffer);
- writer.StartObject();
- writer.Key("a");
- writer.Int(1);
- writer.Key("raw");
- const char json[] = "[\"Hello\\nWorld\", 123.456]";
- writer.RawValue(json, strlen(json), kArrayType);
- writer.EndObject();
- EXPECT_TRUE(writer.IsComplete());
- EXPECT_STREQ("{\"a\":1,\"raw\":[\"Hello\\nWorld\", 123.456]}", buffer.GetString());
-}
-
-TEST(Write, RawValue_Issue1152) {
- {
- GenericStringBuffer<UTF32<> > sb;
- Writer<GenericStringBuffer<UTF32<> >, UTF8<>, UTF32<> > writer(sb);
- writer.RawValue("null", 4, kNullType);
- EXPECT_TRUE(writer.IsComplete());
- const unsigned *out = sb.GetString();
- EXPECT_EQ(static_cast<unsigned>('n'), out[0]);
- EXPECT_EQ(static_cast<unsigned>('u'), out[1]);
- EXPECT_EQ(static_cast<unsigned>('l'), out[2]);
- EXPECT_EQ(static_cast<unsigned>('l'), out[3]);
- EXPECT_EQ(static_cast<unsigned>(0 ), out[4]);
- }
-
- {
- GenericStringBuffer<UTF8<> > sb;
- Writer<GenericStringBuffer<UTF8<> >, UTF16<>, UTF8<> > writer(sb);
- writer.RawValue(L"null", 4, kNullType);
- EXPECT_TRUE(writer.IsComplete());
- EXPECT_STREQ("null", sb.GetString());
- }
-
- {
- // Fail in transcoding
- GenericStringBuffer<UTF16<> > buffer;
- Writer<GenericStringBuffer<UTF16<> >, UTF8<>, UTF16<> > writer(buffer);
- EXPECT_FALSE(writer.RawValue("\"\xfe\"", 3, kStringType));
- }
-
- {
- // Fail in encoding validation
- StringBuffer buffer;
- Writer<StringBuffer, UTF8<>, UTF8<>, CrtAllocator, kWriteValidateEncodingFlag> writer(buffer);
- EXPECT_FALSE(writer.RawValue("\"\xfe\"", 3, kStringType));
- }
-}
-
-#if RAPIDJSON_HAS_CXX11_RVALUE_REFS
-static Writer<StringBuffer> WriterGen(StringBuffer &target) {
- Writer<StringBuffer> writer(target);
- writer.StartObject();
- writer.Key("a");
- writer.Int(1);
- return writer;
-}
-
-TEST(Writer, MoveCtor) {
- StringBuffer buffer;
- Writer<StringBuffer> writer(WriterGen(buffer));
- writer.EndObject();
- EXPECT_TRUE(writer.IsComplete());
- EXPECT_STREQ("{\"a\":1}", buffer.GetString());
-}
-#endif
-
-#ifdef __clang__
-RAPIDJSON_DIAG_POP
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/test/valgrind.supp b/graphics/asymptote/LspCpp/third_party/rapidjson/test/valgrind.supp
deleted file mode 100644
index c9d3d22656..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/test/valgrind.supp
+++ /dev/null
@@ -1,26 +0,0 @@
-{
- Suppress wcslen valgrind report 1
- Memcheck:Cond
- fun:__wcslen_sse2
-}
-
-{
- Suppress wcslen valgrind report 2
- Memcheck:Addr8
- fun:__wcslen_sse2
-}
-
-{
- Suppress wcslen valgrind report 3
- Memcheck:Value8
- fun:__wcslen_sse2
-}
-
-{
- Suppress wmemcmp valgrind report 4
- Memcheck:Addr32
- fun:__wmemcmp_avx2_movbe
- ...
- fun:*Uri*Parse_UTF16_Std*
-}
-
diff --git a/graphics/asymptote/LspCpp/third_party/rapidjson/travis-doxygen.sh b/graphics/asymptote/LspCpp/third_party/rapidjson/travis-doxygen.sh
deleted file mode 100755
index cf18dc3432..0000000000
--- a/graphics/asymptote/LspCpp/third_party/rapidjson/travis-doxygen.sh
+++ /dev/null
@@ -1,128 +0,0 @@
-#!/bin/bash
-# Update Doxygen documentation after push to 'master'.
-# Author: @pah
-
-set -e
-
-DOXYGEN_VER=1_8_16
-DOXYGEN_URL="https://codeload.github.com/doxygen/doxygen/tar.gz/Release_${DOXYGEN_VER}"
-
-: ${GITHUB_REPO:="Tencent/rapidjson"}
-GITHUB_HOST="github.com"
-GITHUB_CLONE="git://${GITHUB_HOST}/${GITHUB_REPO}"
-GITHUB_URL="https://${GITHUB_HOST}/${GITHUB_PUSH-${GITHUB_REPO}}"
-
-# if not set, ignore password
-#GIT_ASKPASS="${TRAVIS_BUILD_DIR}/gh_ignore_askpass.sh"
-
-skip() {
- echo "$@" 1>&2
- echo "Exiting..." 1>&2
- exit 0
-}
-
-abort() {
- echo "Error: $@" 1>&2
- echo "Exiting..." 1>&2
- exit 1
-}
-
-# TRAVIS_BUILD_DIR not set, exiting
-[ -d "${TRAVIS_BUILD_DIR-/nonexistent}" ] || \
- abort '${TRAVIS_BUILD_DIR} not set or nonexistent.'
-
-# check for pull-requests
-[ "${TRAVIS_PULL_REQUEST}" = "false" ] || \
- skip "Not running Doxygen for pull-requests."
-
-# check for branch name
-[ "${TRAVIS_BRANCH}" = "master" ] || \
- skip "Running Doxygen only for updates on 'master' branch (current: ${TRAVIS_BRANCH})."
-
-# check for job number
-# [ "${TRAVIS_JOB_NUMBER}" = "${TRAVIS_BUILD_NUMBER}.1" ] || \
-# skip "Running Doxygen only on first job of build ${TRAVIS_BUILD_NUMBER} (current: ${TRAVIS_JOB_NUMBER})."
-
-# install doxygen binary distribution
-doxygen_install()
-{
- cd ${TMPDIR-/tmp}
- curl ${DOXYGEN_URL} -o doxygen.tar.gz
- tar zxvf doxygen.tar.gz
- mkdir doxygen_build
- cd doxygen_build
- cmake ../doxygen-Release_${DOXYGEN_VER}/
- make
-
- export PATH="${TMPDIR-/tmp}/doxygen_build/bin:$PATH"
-
- cd ../../
-}
-
-doxygen_run()
-{
- cd "${TRAVIS_BUILD_DIR}";
- doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile;
- doxygen ${TRAVIS_BUILD_DIR}/build/doc/Doxyfile.zh-cn;
-}
-
-gh_pages_prepare()
-{
- cd "${TRAVIS_BUILD_DIR}/build/doc";
- [ ! -d "html" ] || \
- abort "Doxygen target directory already exists."
- git --version
- git clone --single-branch -b gh-pages "${GITHUB_CLONE}" html
- cd html
- # setup git config (with defaults)
- git config user.name "${GIT_NAME-travis}"
- git config user.email "${GIT_EMAIL-"travis@localhost"}"
- # clean working dir
- rm -f .git/index
- git clean -df
-}
-
-gh_pages_commit() {
- cd "${TRAVIS_BUILD_DIR}/build/doc/html";
- echo "rapidjson.org" > CNAME
- git add --all;
- git diff-index --quiet HEAD || git commit -m "Automatic doxygen build";
-}
-
-gh_setup_askpass() {
- cat > ${GIT_ASKPASS} <<EOF
-#!/bin/bash
-echo
-exit 0
-EOF
- chmod a+x "$GIT_ASKPASS"
-}
-
-gh_pages_push() {
- # check for secure variables
- [ "${TRAVIS_SECURE_ENV_VARS}" = "true" ] || \
- skip "Secure variables not available, not updating GitHub pages."
- # check for GitHub access token
- [ "${GH_TOKEN+set}" = set ] || \
- skip "GitHub access token not available, not updating GitHub pages."
- [ "${#GH_TOKEN}" -eq 40 ] || \
- abort "GitHub token invalid: found ${#GH_TOKEN} characters, expected 40."
-
- cd "${TRAVIS_BUILD_DIR}/build/doc/html";
- # setup credentials (hide in "set -x" mode)
- git remote set-url --push origin "${GITHUB_URL}"
- git config credential.helper 'store'
- # ( set +x ; git config credential.username "${GH_TOKEN}" )
- ( set +x ; [ -f ${HOME}/.git-credentials ] || \
- ( echo "https://${GH_TOKEN}:@${GITHUB_HOST}" > ${HOME}/.git-credentials ; \
- chmod go-rw ${HOME}/.git-credentials ) )
- # push to GitHub
- git push origin gh-pages
-}
-
-doxygen_install
-gh_pages_prepare
-doxygen_run
-gh_pages_commit
-gh_pages_push
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CHANGELOG.md b/graphics/asymptote/LspCpp/third_party/uri/CHANGELOG.md
deleted file mode 100644
index aa399f4527..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CHANGELOG.md
+++ /dev/null
@@ -1,42 +0,0 @@
-# Changelog
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-## [1.1.0] - 2018-11-24
-### Fixed
-- Query percent encoding
-
-## [1.0.4] - 2018-10-21
-### Fixed
-- Bug in path normalization
-
-## [1.0.3] - 2018-10-18
-### Added
-- AppVeyor for Visual Studio 2015
-
-### Fixed
-- Bug in percent encoding non-ASCII characters
-- Percent encoding query part
-
-## [1.0.2] - 2018-10-13
-### Fixed
-- Bug in `string_view` implementation
-- Incorrect port copy constructor implementation
-
-## [1.0.1] - 2018-08-11
-### Changed
-- Build defaults to C++11
-
-### Fixed
-- Fix to `network::uri_builder` to allow URIs that have a scheme and absolute path
-- Other minor bug fixes and optimizations
-
-## [1.0.0] - 2018-05-27
-### Added
-- A class, `network::uri` that models a URI, including URI parsing on construction
- according to [RFC 3986](https://tools.ietf.org/html/rfc3986)
-- A class, `network::uri_builder` that allows a user to construct valid URIs
-- Member functions to allow URI normalization, resolution, and comparison
-- Support for URI percent encoding
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake
deleted file mode 100644
index c8d9fc1d4a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/CMakeDirectoryInformation.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Relative path conversion top directories.
-set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.92/LspCpp")
-set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.92/LspCpp")
-
-# Force unix paths in dependencies.
-set(CMAKE_FORCE_UNIX_PATHS 1)
-
-
-# The C and CXX include file regular expressions for this directory.
-set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
-set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
-set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
-set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake
deleted file mode 100644
index 29b95a515e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake
+++ /dev/null
@@ -1,22 +0,0 @@
-
-# Consider dependencies only in project.
-set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
-
-# The set of languages for which implicit dependencies are needed:
-set(CMAKE_DEPENDS_LANGUAGES
- )
-
-# The set of dependency files which are needed:
-set(CMAKE_DEPENDS_DEPENDENCY_FILES
- )
-
-# Targets to which this target links which contain Fortran sources.
-set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES
- )
-
-# Targets to which this target links which contain Fortran sources.
-set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES
- )
-
-# Fortran module output directory.
-set(CMAKE_Fortran_TARGET_MODULE_DIR "")
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make
deleted file mode 100644
index b526c86343..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/build.make
+++ /dev/null
@@ -1,91 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Delete rule output on recipe failure.
-.DELETE_ON_ERROR:
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Disable VCS-based implicit rules.
-% : %,v
-
-# Disable VCS-based implicit rules.
-% : RCS/%
-
-# Disable VCS-based implicit rules.
-% : RCS/%,v
-
-# Disable VCS-based implicit rules.
-% : SCCS/s.%
-
-# Disable VCS-based implicit rules.
-% : s.%
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Produce verbose output by default.
-VERBOSE = 1
-
-# Command-line flag to silence nested $(MAKE).
-$(VERBOSE)MAKESILENT = -s
-
-#Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E rm -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# Utility rule file for doc.
-
-# Include any custom commands dependencies for this target.
-include third_party/uri/CMakeFiles/doc.dir/compiler_depend.make
-
-# Include the progress variables for this target.
-include third_party/uri/CMakeFiles/doc.dir/progress.make
-
-third_party/uri/CMakeFiles/doc:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --blue --bold --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Generating API documentation with Doxygen"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri && /bin/doxygen /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/Doxyfile
-
-doc: third_party/uri/CMakeFiles/doc
-doc: third_party/uri/CMakeFiles/doc.dir/build.make
-.PHONY : doc
-
-# Rule to build all files generated by this target.
-third_party/uri/CMakeFiles/doc.dir/build: doc
-.PHONY : third_party/uri/CMakeFiles/doc.dir/build
-
-third_party/uri/CMakeFiles/doc.dir/clean:
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri && $(CMAKE_COMMAND) -P CMakeFiles/doc.dir/cmake_clean.cmake
-.PHONY : third_party/uri/CMakeFiles/doc.dir/clean
-
-third_party/uri/CMakeFiles/doc.dir/depend:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.92/LspCpp /usr/local/src/asymptote-2.92/LspCpp/third_party/uri /usr/local/src/asymptote-2.92/LspCpp /usr/local/src/asymptote-2.92/LspCpp/third_party/uri /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/CMakeFiles/doc.dir/DependInfo.cmake "--color=$(COLOR)"
-.PHONY : third_party/uri/CMakeFiles/doc.dir/depend
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/cmake_clean.cmake b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/cmake_clean.cmake
deleted file mode 100644
index d009c980e0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/cmake_clean.cmake
+++ /dev/null
@@ -1,8 +0,0 @@
-file(REMOVE_RECURSE
- "CMakeFiles/doc"
-)
-
-# Per-language clean rules from dependency scanning.
-foreach(lang )
- include(CMakeFiles/doc.dir/cmake_clean_${lang}.cmake OPTIONAL)
-endforeach()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.make b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.make
deleted file mode 100644
index 585baf2797..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.make
+++ /dev/null
@@ -1,2 +0,0 @@
-# Empty custom commands generated dependencies file for doc.
-# This may be replaced when dependencies are built.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.ts b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.ts
deleted file mode 100644
index 3de913dc49..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/compiler_depend.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Timestamp file for custom commands dependencies management for doc.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/progress.make b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/progress.make
deleted file mode 100644
index 781c7de277..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/doc.dir/progress.make
+++ /dev/null
@@ -1,2 +0,0 @@
-CMAKE_PROGRESS_1 = 1
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/progress.marks b/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/progress.marks
deleted file mode 100644
index ec635144f6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeFiles/progress.marks
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/graphics/asymptote/LspCpp/third_party/uri/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/CMakeLists.txt
deleted file mode 100644
index 6863668e87..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/CMakeLists.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-# Copyright (c) Glyn Matthews 2012-2017.
-# 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)
-
-
-cmake_minimum_required(VERSION 3.13)
-project(Uri)
-
-option(Uri_BUILD_TESTS "Build the URI tests." ON)
-option(Uri_BUILD_DOCS "Build the URI documentation." ON)
-option(Uri_FULL_WARNINGS "Build the library with all warnings turned on." ON)
-option(Uri_WARNINGS_AS_ERRORS "Treat warnings as errors." ON)
-option(Uri_USE_STATIC_CRT "Use static C Runtime library (/MT or MTd)." ON)
-option(Uri_DISABLE_LIBCXX "Disable libc++ (only applies if compiler is clang)" OFF)
-
-find_package(Threads REQUIRED)
-
-set(CMAKE_VERBOSE_MAKEFILE true)
-
-message(STATUS "Configure compiler")
-message("Using ${CMAKE_CXX_COMPILER_ID}")
-if (${CMAKE_CXX_COMPILER_ID} MATCHES GNU)
- INCLUDE(CheckCXXCompilerFlag)
- CHECK_CXX_COMPILER_FLAG(-std=c++11 HAVE_STD11)
-
- if (HAVE_STD11)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
- else()
- message(FATAL_ERROR "No C++ 11 support (Compiler does not define -std=c++11).")
- endif()
-
- if (Uri_FULL_WARNINGS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
- endif()
-
- if (Uri_WARNINGS_AS_ERRORS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-parentheses")
- endif()
-
- message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
-elseif(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
-
- if (NOT Uri_DISABLE_LIBCXX)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
- endif()
-
- if (Uri_FULL_WARNINGS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
- endif()
-
- if (Uri_WARNINGS_AS_ERRORS)
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror -Wno-parentheses")
- endif()
-
- message("C++ Flags: ${CMAKE_CXX_FLAGS} link flags: ${CMAKE_CXX_LINK_FLAGS}")
-endif()
-
-
-if (MSVC)
- if(DEFINED MSVC_VERSION AND MSVC_VERSION LESS 1900)
- message(FATAL_ERROR "Requires VS 2015 or later")
- endif()
-
- if (Uri_USE_STATIC_CRT)
- # Replace dynamic MSVCRT linker flags with static version.
- foreach(flag_var
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- if(${flag_var} MATCHES "/MD")
- string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
- endif(${flag_var} MATCHES "/MD")
- endforeach(flag_var)
- endif(Uri_USE_STATIC_CRT)
-
- add_definitions(-D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_DEPRECATE)
-endif(MSVC)
-
-include_directories(${Uri_SOURCE_DIR}/src ${Uri_SOURCE_DIR}/include)
-
-add_subdirectory(src)
-
-# Testing
-if (Uri_BUILD_TESTS)
- message(STATUS "Configuring tests")
- enable_testing()
- add_subdirectory(deps/googletest)
- add_subdirectory(test)
-endif()
-
-# Documentation
-if (Uri_BUILD_DOCS)
- message("Configuring documentation")
- find_package(Doxygen)
- if (DOXYGEN_FOUND)
- configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY)
- add_custom_target(doc
- ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
- COMMENT "Generating API documentation with Doxygen" VERBATIM)
- endif()
-endif()
-
-install(DIRECTORY include DESTINATION ".")
diff --git a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile b/graphics/asymptote/LspCpp/third_party/uri/Doxyfile
deleted file mode 100644
index 82d911654f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile
+++ /dev/null
@@ -1,1742 +0,0 @@
-# Doxyfile 1.7.6.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
-
-PROJECT_NAME = "C++ Network Library: URI"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = 1.0
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
-
-FILE_PATTERNS = *.hpp
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE = /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS = *-inl.hpp
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
-
-FILTER_SOURCE_PATTERNS =
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX = /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/uri/src/
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# style sheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
-
-GENERATE_TREEVIEW = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the
-# mathjax.org site, so you can quickly see the result without installing
-# MathJax, but it is strongly recommended to install a local copy of MathJax
-# before deployment.
-
-MATHJAX_RELPATH = http://www.mathjax.org/mathjax
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
-
-MATHJAX_EXTENSIONS =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvantages are that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
-
-LATEX_FOOTER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS = 0
-
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
-
-INTERACTIVE_SVG = NO
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
-
-MSCFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile.in b/graphics/asymptote/LspCpp/third_party/uri/Doxyfile.in
deleted file mode 100644
index b8affcf99a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/Doxyfile.in
+++ /dev/null
@@ -1,1742 +0,0 @@
-# Doxyfile 1.7.6.1
-
-# This file describes the settings to be used by the documentation system
-# doxygen (www.doxygen.org) for a project.
-#
-# All text after a hash (#) is considered a comment and will be ignored.
-# The format is:
-# TAG = value [value, ...]
-# For lists items can also be appended using:
-# TAG += value [value, ...]
-# Values that contain spaces should be placed between quotes (" ").
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-
-# This tag specifies the encoding used for all characters in the config file
-# that follow. The default is UTF-8 which is also the encoding used for all
-# text before the first occurrence of this tag. Doxygen uses libiconv (or the
-# iconv built into libc) for the transcoding. See
-# http://www.gnu.org/software/libiconv for the list of possible encodings.
-
-DOXYFILE_ENCODING = UTF-8
-
-# The PROJECT_NAME tag is a single word (or sequence of words) that should
-# identify the project. Note that if you do not use Doxywizard you need
-# to put quotes around the project name if it contains spaces.
-
-PROJECT_NAME = "C++ Network Library: URI"
-
-# The PROJECT_NUMBER tag can be used to enter a project or revision number.
-# This could be handy for archiving the generated documentation or
-# if some version control system is used.
-
-PROJECT_NUMBER = 1.0
-
-# Using the PROJECT_BRIEF tag one can provide an optional one line description
-# for a project that appears at the top of each page and should give viewer
-# a quick idea about the purpose of the project. Keep the description short.
-
-PROJECT_BRIEF =
-
-# With the PROJECT_LOGO tag one can specify an logo or icon that is
-# included in the documentation. The maximum height of the logo should not
-# exceed 55 pixels and the maximum width should not exceed 200 pixels.
-# Doxygen will copy the logo to the output directory.
-
-PROJECT_LOGO =
-
-# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
-# base path where the generated documentation will be put.
-# If a relative path is entered, it will be relative to the location
-# where doxygen was started. If left blank the current directory will be used.
-
-OUTPUT_DIRECTORY =
-
-# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
-# 4096 sub-directories (in 2 levels) under the output directory of each output
-# format and will distribute the generated files over these directories.
-# Enabling this option can be useful when feeding doxygen a huge amount of
-# source files, where putting all generated files in the same directory would
-# otherwise cause performance problems for the file system.
-
-CREATE_SUBDIRS = NO
-
-# The OUTPUT_LANGUAGE tag is used to specify the language in which all
-# documentation generated by doxygen is written. Doxygen will use this
-# information to generate all constant output in the proper language.
-# The default language is English, other supported languages are:
-# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
-# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
-# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
-# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
-# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak,
-# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
-
-OUTPUT_LANGUAGE = English
-
-# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
-# include brief member descriptions after the members that are listed in
-# the file and class documentation (similar to JavaDoc).
-# Set to NO to disable this.
-
-BRIEF_MEMBER_DESC = YES
-
-# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
-# the brief description of a member or function before the detailed description.
-# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
-# brief descriptions will be completely suppressed.
-
-REPEAT_BRIEF = YES
-
-# This tag implements a quasi-intelligent brief description abbreviator
-# that is used to form the text in various listings. Each string
-# in this list, if found as the leading text of the brief description, will be
-# stripped from the text and the result after processing the whole list, is
-# used as the annotated text. Otherwise, the brief description is used as-is.
-# If left blank, the following values are used ("$name" is automatically
-# replaced with the name of the entity): "The $name class" "The $name widget"
-# "The $name file" "is" "provides" "specifies" "contains"
-# "represents" "a" "an" "the"
-
-ABBREVIATE_BRIEF =
-
-# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
-# Doxygen will generate a detailed section even if there is only a brief
-# description.
-
-ALWAYS_DETAILED_SEC = NO
-
-# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
-# inherited members of a class in the documentation of that class as if those
-# members were ordinary class members. Constructors, destructors and assignment
-# operators of the base classes will not be shown.
-
-INLINE_INHERITED_MEMB = NO
-
-# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
-# path before files name in the file list and in the header files. If set
-# to NO the shortest path that makes the file name unique will be used.
-
-FULL_PATH_NAMES = YES
-
-# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
-# can be used to strip a user-defined part of the path. Stripping is
-# only done if one of the specified strings matches the left-hand part of
-# the path. The tag can be used to show relative paths in the file list.
-# If left blank the directory from which doxygen is run is used as the
-# path to strip.
-
-STRIP_FROM_PATH = @CMAKE_CURRENT_SOURCE_DIR@/include/
-
-# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
-# the path mentioned in the documentation of a class, which tells
-# the reader which header file to include in order to use a class.
-# If left blank only the name of the header file containing the class
-# definition is used. Otherwise one should specify the include paths that
-# are normally passed to the compiler using the -I flag.
-
-STRIP_FROM_INC_PATH =
-
-# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
-# (but less readable) file names. This can be useful if your file system
-# doesn't support long names like on DOS, Mac, or CD-ROM.
-
-SHORT_NAMES = NO
-
-# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
-# will interpret the first line (until the first dot) of a JavaDoc-style
-# comment as the brief description. If set to NO, the JavaDoc
-# comments will behave just like regular Qt-style comments
-# (thus requiring an explicit @brief command for a brief description.)
-
-JAVADOC_AUTOBRIEF = NO
-
-# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
-# interpret the first line (until the first dot) of a Qt-style
-# comment as the brief description. If set to NO, the comments
-# will behave just like regular Qt-style comments (thus requiring
-# an explicit \brief command for a brief description.)
-
-QT_AUTOBRIEF = NO
-
-# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
-# treat a multi-line C++ special comment block (i.e. a block of //! or ///
-# comments) as a brief description. This used to be the default behaviour.
-# The new default is to treat a multi-line C++ comment block as a detailed
-# description. Set this tag to YES if you prefer the old behaviour instead.
-
-MULTILINE_CPP_IS_BRIEF = NO
-
-# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
-# member inherits the documentation from any documented member that it
-# re-implements.
-
-INHERIT_DOCS = YES
-
-# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
-# a new page for each member. If set to NO, the documentation of a member will
-# be part of the file/class/namespace that contains it.
-
-SEPARATE_MEMBER_PAGES = NO
-
-# The TAB_SIZE tag can be used to set the number of spaces in a tab.
-# Doxygen uses this value to replace tabs by spaces in code fragments.
-
-TAB_SIZE = 8
-
-# This tag can be used to specify a number of aliases that acts
-# as commands in the documentation. An alias has the form "name=value".
-# For example adding "sideeffect=\par Side Effects:\n" will allow you to
-# put the command \sideeffect (or @sideeffect) in the documentation, which
-# will result in a user-defined paragraph with heading "Side Effects:".
-# You can put \n's in the value part of an alias to insert newlines.
-
-ALIASES =
-
-# This tag can be used to specify a number of word-keyword mappings (TCL only).
-# A mapping has the form "name=value". For example adding
-# "class=itcl::class" will allow you to use the command class in the
-# itcl::class meaning.
-
-TCL_SUBST =
-
-# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
-# sources only. Doxygen will then generate output that is more tailored for C.
-# For instance, some of the names that are used will be different. The list
-# of all members will be omitted, etc.
-
-OPTIMIZE_OUTPUT_FOR_C = NO
-
-# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
-# sources only. Doxygen will then generate output that is more tailored for
-# Java. For instance, namespaces will be presented as packages, qualified
-# scopes will look different, etc.
-
-OPTIMIZE_OUTPUT_JAVA = NO
-
-# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
-# sources only. Doxygen will then generate output that is more tailored for
-# Fortran.
-
-OPTIMIZE_FOR_FORTRAN = NO
-
-# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
-# sources. Doxygen will then generate output that is tailored for
-# VHDL.
-
-OPTIMIZE_OUTPUT_VHDL = NO
-
-# Doxygen selects the parser to use depending on the extension of the files it
-# parses. With this tag you can assign which parser to use for a given extension.
-# Doxygen has a built-in mapping, but you can override or extend it using this
-# tag. The format is ext=language, where ext is a file extension, and language
-# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C,
-# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make
-# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C
-# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions
-# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
-
-EXTENSION_MAPPING =
-
-# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
-# to include (a tag file for) the STL sources as input, then you should
-# set this tag to YES in order to let doxygen match functions declarations and
-# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
-# func(std::string) {}). This also makes the inheritance and collaboration
-# diagrams that involve STL classes more complete and accurate.
-
-BUILTIN_STL_SUPPORT = NO
-
-# If you use Microsoft's C++/CLI language, you should set this option to YES to
-# enable parsing support.
-
-CPP_CLI_SUPPORT = NO
-
-# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
-# Doxygen will parse them like normal C++ but will assume all classes use public
-# instead of private inheritance when no explicit protection keyword is present.
-
-SIP_SUPPORT = NO
-
-# For Microsoft's IDL there are propget and propput attributes to indicate getter
-# and setter methods for a property. Setting this option to YES (the default)
-# will make doxygen replace the get and set methods by a property in the
-# documentation. This will only work if the methods are indeed getting or
-# setting a simple type. If this is not the case, or you want to show the
-# methods anyway, you should set this option to NO.
-
-IDL_PROPERTY_SUPPORT = YES
-
-# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
-# tag is set to YES, then doxygen will reuse the documentation of the first
-# member in the group (if any) for the other members of the group. By default
-# all members of a group must be documented explicitly.
-
-DISTRIBUTE_GROUP_DOC = NO
-
-# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
-# the same type (for instance a group of public functions) to be put as a
-# subgroup of that type (e.g. under the Public Functions section). Set it to
-# NO to prevent subgrouping. Alternatively, this can be done per class using
-# the \nosubgrouping command.
-
-SUBGROUPING = YES
-
-# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and
-# unions are shown inside the group in which they are included (e.g. using
-# @ingroup) instead of on a separate page (for HTML and Man pages) or
-# section (for LaTeX and RTF).
-
-INLINE_GROUPED_CLASSES = NO
-
-# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and
-# unions with only public data fields will be shown inline in the documentation
-# of the scope in which they are defined (i.e. file, namespace, or group
-# documentation), provided this scope is documented. If set to NO (the default),
-# structs, classes, and unions are shown on a separate page (for HTML and Man
-# pages) or section (for LaTeX and RTF).
-
-INLINE_SIMPLE_STRUCTS = NO
-
-# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
-# is documented as struct, union, or enum with the name of the typedef. So
-# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
-# with name TypeT. When disabled the typedef will appear as a member of a file,
-# namespace, or class. And the struct will be named TypeS. This can typically
-# be useful for C code in case the coding convention dictates that all compound
-# types are typedef'ed and only the typedef is referenced, never the tag name.
-
-TYPEDEF_HIDES_STRUCT = NO
-
-# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be
-# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given
-# their name and scope. Since this can be an expensive process and often the
-# same symbol appear multiple times in the code, doxygen keeps a cache of
-# pre-resolved symbols. If the cache is too small doxygen will become slower.
-# If the cache is too large, memory is wasted. The cache size is given by this
-# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0,
-# corresponding to a cache size of 2^16 = 65536 symbols.
-
-LOOKUP_CACHE_SIZE = 0
-
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-
-# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
-# documentation are documented, even if no documentation was available.
-# Private class members and static file members will be hidden unless
-# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
-
-EXTRACT_ALL = NO
-
-# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
-# will be included in the documentation.
-
-EXTRACT_PRIVATE = NO
-
-# If the EXTRACT_STATIC tag is set to YES all static members of a file
-# will be included in the documentation.
-
-EXTRACT_STATIC = NO
-
-# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
-# defined locally in source files will be included in the documentation.
-# If set to NO only classes defined in header files are included.
-
-EXTRACT_LOCAL_CLASSES = YES
-
-# This flag is only useful for Objective-C code. When set to YES local
-# methods, which are defined in the implementation section but not in
-# the interface are included in the documentation.
-# If set to NO (the default) only methods in the interface are included.
-
-EXTRACT_LOCAL_METHODS = NO
-
-# If this flag is set to YES, the members of anonymous namespaces will be
-# extracted and appear in the documentation as a namespace called
-# 'anonymous_namespace{file}', where file will be replaced with the base
-# name of the file that contains the anonymous namespace. By default
-# anonymous namespaces are hidden.
-
-EXTRACT_ANON_NSPACES = NO
-
-# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
-# undocumented members of documented classes, files or namespaces.
-# If set to NO (the default) these members will be included in the
-# various overviews, but no documentation section is generated.
-# This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_MEMBERS = NO
-
-# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
-# undocumented classes that are normally visible in the class hierarchy.
-# If set to NO (the default) these classes will be included in the various
-# overviews. This option has no effect if EXTRACT_ALL is enabled.
-
-HIDE_UNDOC_CLASSES = NO
-
-# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
-# friend (class|struct|union) declarations.
-# If set to NO (the default) these declarations will be included in the
-# documentation.
-
-HIDE_FRIEND_COMPOUNDS = NO
-
-# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
-# documentation blocks found inside the body of a function.
-# If set to NO (the default) these blocks will be appended to the
-# function's detailed documentation block.
-
-HIDE_IN_BODY_DOCS = NO
-
-# The INTERNAL_DOCS tag determines if documentation
-# that is typed after a \internal command is included. If the tag is set
-# to NO (the default) then the documentation will be excluded.
-# Set it to YES to include the internal documentation.
-
-INTERNAL_DOCS = NO
-
-# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
-# file names in lower-case letters. If set to YES upper-case letters are also
-# allowed. This is useful if you have classes or files whose names only differ
-# in case and if your file system supports case sensitive file names. Windows
-# and Mac users are advised to set this option to NO.
-
-CASE_SENSE_NAMES = YES
-
-# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
-# will show members with their full class and namespace scopes in the
-# documentation. If set to YES the scope will be hidden.
-
-HIDE_SCOPE_NAMES = NO
-
-# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
-# will put a list of the files that are included by a file in the documentation
-# of that file.
-
-SHOW_INCLUDE_FILES = YES
-
-# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
-# will list include files with double quotes in the documentation
-# rather than with sharp brackets.
-
-FORCE_LOCAL_INCLUDES = NO
-
-# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
-# is inserted in the documentation for inline members.
-
-INLINE_INFO = YES
-
-# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
-# will sort the (detailed) documentation of file and class members
-# alphabetically by member name. If set to NO the members will appear in
-# declaration order.
-
-SORT_MEMBER_DOCS = YES
-
-# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
-# brief documentation of file, namespace and class members alphabetically
-# by member name. If set to NO (the default) the members will appear in
-# declaration order.
-
-SORT_BRIEF_DOCS = NO
-
-# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen
-# will sort the (brief and detailed) documentation of class members so that
-# constructors and destructors are listed first. If set to NO (the default)
-# the constructors will appear in the respective orders defined by
-# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS.
-# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO
-# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
-
-SORT_MEMBERS_CTORS_1ST = NO
-
-# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
-# hierarchy of group names into alphabetical order. If set to NO (the default)
-# the group names will appear in their defined order.
-
-SORT_GROUP_NAMES = NO
-
-# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
-# sorted by fully-qualified names, including namespaces. If set to
-# NO (the default), the class list will be sorted only by class name,
-# not including the namespace part.
-# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
-# Note: This option applies only to the class list, not to the
-# alphabetical list.
-
-SORT_BY_SCOPE_NAME = NO
-
-# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to
-# do proper type resolution of all parameters of a function it will reject a
-# match between the prototype and the implementation of a member function even
-# if there is only one candidate or it is obvious which candidate to choose
-# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen
-# will still accept a match between prototype and implementation in such cases.
-
-STRICT_PROTO_MATCHING = NO
-
-# The GENERATE_TODOLIST tag can be used to enable (YES) or
-# disable (NO) the todo list. This list is created by putting \todo
-# commands in the documentation.
-
-GENERATE_TODOLIST = YES
-
-# The GENERATE_TESTLIST tag can be used to enable (YES) or
-# disable (NO) the test list. This list is created by putting \test
-# commands in the documentation.
-
-GENERATE_TESTLIST = YES
-
-# The GENERATE_BUGLIST tag can be used to enable (YES) or
-# disable (NO) the bug list. This list is created by putting \bug
-# commands in the documentation.
-
-GENERATE_BUGLIST = YES
-
-# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
-# disable (NO) the deprecated list. This list is created by putting
-# \deprecated commands in the documentation.
-
-GENERATE_DEPRECATEDLIST= YES
-
-# The ENABLED_SECTIONS tag can be used to enable conditional
-# documentation sections, marked by \if sectionname ... \endif.
-
-ENABLED_SECTIONS =
-
-# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
-# the initial value of a variable or macro consists of for it to appear in
-# the documentation. If the initializer consists of more lines than specified
-# here it will be hidden. Use a value of 0 to hide initializers completely.
-# The appearance of the initializer of individual variables and macros in the
-# documentation can be controlled using \showinitializer or \hideinitializer
-# command in the documentation regardless of this setting.
-
-MAX_INITIALIZER_LINES = 30
-
-# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
-# at the bottom of the documentation of classes and structs. If set to YES the
-# list will mention the files that were used to generate the documentation.
-
-SHOW_USED_FILES = YES
-
-# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
-# This will remove the Files entry from the Quick Index and from the
-# Folder Tree View (if specified). The default is YES.
-
-SHOW_FILES = YES
-
-# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
-# Namespaces page.
-# This will remove the Namespaces entry from the Quick Index
-# and from the Folder Tree View (if specified). The default is YES.
-
-SHOW_NAMESPACES = YES
-
-# The FILE_VERSION_FILTER tag can be used to specify a program or script that
-# doxygen should invoke to get the current version for each file (typically from
-# the version control system). Doxygen will invoke the program by executing (via
-# popen()) the command <command> <input-file>, where <command> is the value of
-# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
-# provided by doxygen. Whatever the program writes to standard output
-# is used as the file version. See the manual for examples.
-
-FILE_VERSION_FILTER =
-
-# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed
-# by doxygen. The layout file controls the global structure of the generated
-# output files in an output format independent way. The create the layout file
-# that represents doxygen's defaults, run doxygen with the -l option.
-# You can optionally specify a file name after the option, if omitted
-# DoxygenLayout.xml will be used as the name of the layout file.
-
-LAYOUT_FILE =
-
-# The CITE_BIB_FILES tag can be used to specify one or more bib files
-# containing the references data. This must be a list of .bib files. The
-# .bib extension is automatically appended if omitted. Using this command
-# requires the bibtex tool to be installed. See also
-# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
-# feature you need bibtex and perl available in the search path.
-
-CITE_BIB_FILES =
-
-#---------------------------------------------------------------------------
-# configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-
-# The QUIET tag can be used to turn on/off the messages that are generated
-# by doxygen. Possible values are YES and NO. If left blank NO is used.
-
-QUIET = NO
-
-# The WARNINGS tag can be used to turn on/off the warning messages that are
-# generated by doxygen. Possible values are YES and NO. If left blank
-# NO is used.
-
-WARNINGS = YES
-
-# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
-# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
-# automatically be disabled.
-
-WARN_IF_UNDOCUMENTED = YES
-
-# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
-# potential errors in the documentation, such as not documenting some
-# parameters in a documented function, or documenting parameters that
-# don't exist or using markup commands wrongly.
-
-WARN_IF_DOC_ERROR = YES
-
-# The WARN_NO_PARAMDOC option can be enabled to get warnings for
-# functions that are documented, but have no documentation for their parameters
-# or return value. If set to NO (the default) doxygen will only warn about
-# wrong or incomplete parameter documentation, but not about the absence of
-# documentation.
-
-WARN_NO_PARAMDOC = NO
-
-# The WARN_FORMAT tag determines the format of the warning messages that
-# doxygen can produce. The string should contain the $file, $line, and $text
-# tags, which will be replaced by the file and line number from which the
-# warning originated and the warning text. Optionally the format may contain
-# $version, which will be replaced by the version of the file (if it could
-# be obtained via FILE_VERSION_FILTER)
-
-WARN_FORMAT = "$file:$line: $text"
-
-# The WARN_LOGFILE tag can be used to specify a file to which warning
-# and error messages should be written. If left blank the output is written
-# to stderr.
-
-WARN_LOGFILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the input files
-#---------------------------------------------------------------------------
-
-# The INPUT tag can be used to specify the files and/or directories that contain
-# documented source files. You may enter file names like "myfile.cpp" or
-# directories like "/usr/src/myproject". Separate the files or directories
-# with spaces.
-
-INPUT = @CMAKE_CURRENT_SOURCE_DIR@/include
-
-# This tag can be used to specify the character encoding of the source files
-# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
-# also the default input encoding. Doxygen uses libiconv (or the iconv built
-# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
-# the list of possible encodings.
-
-INPUT_ENCODING = UTF-8
-
-# If the value of the INPUT tag contains directories, you can use the
-# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank the following patterns are tested:
-# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh
-# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py
-# *.f90 *.f *.for *.vhd *.vhdl
-
-FILE_PATTERNS = *.hpp
-
-# The RECURSIVE tag can be used to turn specify whether or not subdirectories
-# should be searched for input files as well. Possible values are YES and NO.
-# If left blank NO is used.
-
-RECURSIVE = YES
-
-# The EXCLUDE tag can be used to specify files and/or directories that should be
-# excluded from the INPUT source files. This way you can easily exclude a
-# subdirectory from a directory tree whose root is specified with the INPUT tag.
-# Note that relative paths are relative to the directory from which doxygen is
-# run.
-
-EXCLUDE = @CMAKE_CURRENT_SOURCE_DIR@/include/network/uri/detail
-
-# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
-# directories that are symbolic links (a Unix file system feature) are excluded
-# from the input.
-
-EXCLUDE_SYMLINKS = NO
-
-# If the value of the INPUT tag contains directories, you can use the
-# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
-# certain files from those directories. Note that the wildcards are matched
-# against the file with absolute path, so to exclude all test directories
-# for example use the pattern */test/*
-
-EXCLUDE_PATTERNS = *-inl.hpp
-
-# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
-# (namespaces, classes, functions, etc.) that should be excluded from the
-# output. The symbol name can be a fully qualified name, a word, or if the
-# wildcard * is used, a substring. Examples: ANamespace, AClass,
-# AClass::ANamespace, ANamespace::*Test
-
-EXCLUDE_SYMBOLS =
-
-# The EXAMPLE_PATH tag can be used to specify one or more files or
-# directories that contain example code fragments that are included (see
-# the \include command).
-
-EXAMPLE_PATH =
-
-# If the value of the EXAMPLE_PATH tag contains directories, you can use the
-# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
-# and *.h) to filter out the source-files in the directories. If left
-# blank all files are included.
-
-EXAMPLE_PATTERNS =
-
-# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
-# searched for input files to be used with the \include or \dontinclude
-# commands irrespective of the value of the RECURSIVE tag.
-# Possible values are YES and NO. If left blank NO is used.
-
-EXAMPLE_RECURSIVE = NO
-
-# The IMAGE_PATH tag can be used to specify one or more files or
-# directories that contain image that are included in the documentation (see
-# the \image command).
-
-IMAGE_PATH =
-
-# The INPUT_FILTER tag can be used to specify a program that doxygen should
-# invoke to filter for each input file. Doxygen will invoke the filter program
-# by executing (via popen()) the command <filter> <input-file>, where <filter>
-# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
-# input file. Doxygen will then use the output that the filter program writes
-# to standard output.
-# If FILTER_PATTERNS is specified, this tag will be
-# ignored.
-
-INPUT_FILTER =
-
-# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
-# basis.
-# Doxygen will compare the file name with each pattern and apply the
-# filter if there is a match.
-# The filters are a list of the form:
-# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
-# info on how filters are used. If FILTER_PATTERNS is empty or if
-# non of the patterns match the file name, INPUT_FILTER is applied.
-
-FILTER_PATTERNS =
-
-# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
-# INPUT_FILTER) will be used to filter the input files when producing source
-# files to browse (i.e. when SOURCE_BROWSER is set to YES).
-
-FILTER_SOURCE_FILES = NO
-
-# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file
-# pattern. A pattern will override the setting for FILTER_PATTERN (if any)
-# and it is also possible to disable source filtering for a specific pattern
-# using *.ext= (so without naming a filter). This option only has effect when
-# FILTER_SOURCE_FILES is enabled.
-
-FILTER_SOURCE_PATTERNS =
-
-#---------------------------------------------------------------------------
-# configuration options related to source browsing
-#---------------------------------------------------------------------------
-
-# If the SOURCE_BROWSER tag is set to YES then a list of source files will
-# be generated. Documented entities will be cross-referenced with these sources.
-# Note: To get rid of all source code in the generated output, make sure also
-# VERBATIM_HEADERS is set to NO.
-
-SOURCE_BROWSER = NO
-
-# Setting the INLINE_SOURCES tag to YES will include the body
-# of functions and classes directly in the documentation.
-
-INLINE_SOURCES = NO
-
-# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
-# doxygen to hide any special comment blocks from generated source code
-# fragments. Normal C and C++ comments will always remain visible.
-
-STRIP_CODE_COMMENTS = YES
-
-# If the REFERENCED_BY_RELATION tag is set to YES
-# then for each documented function all documented
-# functions referencing it will be listed.
-
-REFERENCED_BY_RELATION = NO
-
-# If the REFERENCES_RELATION tag is set to YES
-# then for each documented function all documented entities
-# called/used by that function will be listed.
-
-REFERENCES_RELATION = NO
-
-# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
-# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
-# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
-# link to the source code.
-# Otherwise they will link to the documentation.
-
-REFERENCES_LINK_SOURCE = YES
-
-# If the USE_HTAGS tag is set to YES then the references to source code
-# will point to the HTML generated by the htags(1) tool instead of doxygen
-# built-in source browser. The htags tool is part of GNU's global source
-# tagging system (see http://www.gnu.org/software/global/global.html). You
-# will need version 4.8.6 or higher.
-
-USE_HTAGS = NO
-
-# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
-# will generate a verbatim copy of the header file for each class for
-# which an include is specified. Set to NO to disable this.
-
-VERBATIM_HEADERS = YES
-
-#---------------------------------------------------------------------------
-# configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-
-# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
-# of all compounds will be generated. Enable this if the project
-# contains a lot of classes, structs, unions or interfaces.
-
-ALPHABETICAL_INDEX = YES
-
-# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
-# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
-# in which this list will be split (can be a number in the range [1..20])
-
-COLS_IN_ALPHA_INDEX = 5
-
-# In case all classes in a project start with a common prefix, all
-# classes will be put under the same header in the alphabetical index.
-# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
-# should be ignored while generating the index headers.
-
-IGNORE_PREFIX = @CMAKE_CURRENT_SOURCE_DIR@/uri/src/
-
-#---------------------------------------------------------------------------
-# configuration options related to the HTML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
-# generate HTML output.
-
-GENERATE_HTML = YES
-
-# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `html' will be used as the default path.
-
-HTML_OUTPUT = html
-
-# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
-# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
-# doxygen will generate files with .html extension.
-
-HTML_FILE_EXTENSION = .html
-
-# The HTML_HEADER tag can be used to specify a personal HTML header for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard header. Note that when using a custom header you are responsible
-# for the proper inclusion of any scripts and style sheets that doxygen
-# needs, which is dependent on the configuration options used.
-# It is advised to generate a default header using "doxygen -w html
-# header.html footer.html stylesheet.css YourConfigFile" and then modify
-# that header. Note that the header is subject to change so you typically
-# have to redo this when upgrading to a newer version of doxygen or when
-# changing the value of configuration settings such as GENERATE_TREEVIEW!
-
-HTML_HEADER =
-
-# The HTML_FOOTER tag can be used to specify a personal HTML footer for
-# each generated HTML page. If it is left blank doxygen will generate a
-# standard footer.
-
-HTML_FOOTER =
-
-# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
-# style sheet that is used by each HTML page. It can be used to
-# fine-tune the look of the HTML output. If the tag is left blank doxygen
-# will generate a default style sheet. Note that doxygen will try to copy
-# the style sheet file to the HTML output directory, so don't put your own
-# style sheet in the HTML output directory as well, or it will be erased!
-
-HTML_STYLESHEET =
-
-# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
-# other source files which should be copied to the HTML output directory. Note
-# that these files will be copied to the base HTML output directory. Use the
-# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these
-# files. In the HTML_STYLESHEET file, use the file name only. Also note that
-# the files will be copied as-is; there are no commands or markers available.
-
-HTML_EXTRA_FILES =
-
-# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
-# Doxygen will adjust the colors in the style sheet and background images
-# according to this color. Hue is specified as an angle on a colorwheel,
-# see http://en.wikipedia.org/wiki/Hue for more information.
-# For instance the value 0 represents red, 60 is yellow, 120 is green,
-# 180 is cyan, 240 is blue, 300 purple, and 360 is red again.
-# The allowed range is 0 to 359.
-
-HTML_COLORSTYLE_HUE = 220
-
-# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
-# the colors in the HTML output. For a value of 0 the output will use
-# grayscales only. A value of 255 will produce the most vivid colors.
-
-HTML_COLORSTYLE_SAT = 100
-
-# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to
-# the luminance component of the colors in the HTML output. Values below
-# 100 gradually make the output lighter, whereas values above 100 make
-# the output darker. The value divided by 100 is the actual gamma applied,
-# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2,
-# and 100 does not change the gamma.
-
-HTML_COLORSTYLE_GAMMA = 80
-
-# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
-# page will contain the date and time when the page was generated. Setting
-# this to NO can help when comparing the output of multiple runs.
-
-HTML_TIMESTAMP = YES
-
-# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
-# documentation will contain sections that can be hidden and shown after the
-# page has loaded. For this to work a browser that supports
-# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
-# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
-
-HTML_DYNAMIC_SECTIONS = NO
-
-# If the GENERATE_DOCSET tag is set to YES, additional index files
-# will be generated that can be used as input for Apple's Xcode 3
-# integrated development environment, introduced with OSX 10.5 (Leopard).
-# To create a documentation set, doxygen will generate a Makefile in the
-# HTML output directory. Running make will produce the docset in that
-# directory and running "make install" will install the docset in
-# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
-# it at startup.
-# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html
-# for more information.
-
-GENERATE_DOCSET = NO
-
-# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
-# feed. A documentation feed provides an umbrella under which multiple
-# documentation sets from a single provider (such as a company or product suite)
-# can be grouped.
-
-DOCSET_FEEDNAME = "Doxygen generated docs"
-
-# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
-# should uniquely identify the documentation set bundle. This should be a
-# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
-# will append .docset to the name.
-
-DOCSET_BUNDLE_ID = org.doxygen.Project
-
-# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify
-# the documentation publisher. This should be a reverse domain-name style
-# string, e.g. com.mycompany.MyDocSet.documentation.
-
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-
-# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher.
-
-DOCSET_PUBLISHER_NAME = Publisher
-
-# If the GENERATE_HTMLHELP tag is set to YES, additional index files
-# will be generated that can be used as input for tools like the
-# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
-# of the generated HTML documentation.
-
-GENERATE_HTMLHELP = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
-# be used to specify the file name of the resulting .chm file. You
-# can add a path in front of the file if the result should not be
-# written to the html output directory.
-
-CHM_FILE =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
-# be used to specify the location (absolute path including file name) of
-# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
-# the HTML help compiler on the generated index.hhp.
-
-HHC_LOCATION =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
-# controls if a separate .chi index file is generated (YES) or that
-# it should be included in the master .chm file (NO).
-
-GENERATE_CHI = NO
-
-# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
-# is used to encode HtmlHelp index (hhk), content (hhc) and project file
-# content.
-
-CHM_INDEX_ENCODING =
-
-# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
-# controls whether a binary table of contents is generated (YES) or a
-# normal table of contents (NO) in the .chm file.
-
-BINARY_TOC = NO
-
-# The TOC_EXPAND flag can be set to YES to add extra items for group members
-# to the contents of the HTML help documentation and to the tree view.
-
-TOC_EXPAND = NO
-
-# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and
-# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated
-# that can be used as input for Qt's qhelpgenerator to generate a
-# Qt Compressed Help (.qch) of the generated HTML documentation.
-
-GENERATE_QHP = NO
-
-# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
-# be used to specify the file name of the resulting .qch file.
-# The path specified is relative to the HTML output folder.
-
-QCH_FILE =
-
-# The QHP_NAMESPACE tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#namespace
-
-QHP_NAMESPACE = org.doxygen.Project
-
-# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
-# Qt Help Project output. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#virtual-folders
-
-QHP_VIRTUAL_FOLDER = doc
-
-# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to
-# add. For more information please see
-# http://doc.trolltech.com/qthelpproject.html#custom-filters
-
-QHP_CUST_FILTER_NAME =
-
-# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the
-# custom filter to add. For more information please see
-# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">
-# Qt Help Project / Custom Filters</a>.
-
-QHP_CUST_FILTER_ATTRS =
-
-# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
-# project's
-# filter section matches.
-# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">
-# Qt Help Project / Filter Attributes</a>.
-
-QHP_SECT_FILTER_ATTRS =
-
-# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
-# be used to specify the location of Qt's qhelpgenerator.
-# If non-empty doxygen will try to run qhelpgenerator on the generated
-# .qhp file.
-
-QHG_LOCATION =
-
-# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
-# will be generated, which together with the HTML files, form an Eclipse help
-# plugin. To install this plugin and make it available under the help contents
-# menu in Eclipse, the contents of the directory containing the HTML and XML
-# files needs to be copied into the plugins directory of eclipse. The name of
-# the directory within the plugins directory should be the same as
-# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before
-# the help appears.
-
-GENERATE_ECLIPSEHELP = NO
-
-# A unique identifier for the eclipse help plugin. When installing the plugin
-# the directory name containing the HTML and XML files should also have
-# this name.
-
-ECLIPSE_DOC_ID = org.doxygen.Project
-
-# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs)
-# at top of each HTML page. The value NO (the default) enables the index and
-# the value YES disables it. Since the tabs have the same information as the
-# navigation tree you can set this option to NO if you already set
-# GENERATE_TREEVIEW to YES.
-
-DISABLE_INDEX = NO
-
-# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
-# structure should be generated to display hierarchical information.
-# If the tag value is set to YES, a side panel will be generated
-# containing a tree-like index structure (just like the one that
-# is generated for HTML Help). For this to work a browser that supports
-# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
-# Windows users are probably better off using the HTML help feature.
-# Since the tree basically has the same information as the tab index you
-# could consider to set DISABLE_INDEX to NO when enabling this option.
-
-GENERATE_TREEVIEW = NO
-
-# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-# (range [0,1..20]) that doxygen will group on one line in the generated HTML
-# documentation. Note that a value of 0 will completely suppress the enum
-# values from appearing in the overview section.
-
-ENUM_VALUES_PER_LINE = 4
-
-# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
-# used to set the initial width (in pixels) of the frame in which the tree
-# is shown.
-
-TREEVIEW_WIDTH = 250
-
-# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open
-# links to external symbols imported via tag files in a separate window.
-
-EXT_LINKS_IN_WINDOW = NO
-
-# Use this tag to change the font size of Latex formulas included
-# as images in the HTML documentation. The default is 10. Note that
-# when you change the font size after a successful doxygen run you need
-# to manually remove any form_*.png images from the HTML output directory
-# to force them to be regenerated.
-
-FORMULA_FONTSIZE = 10
-
-# Use the FORMULA_TRANPARENT tag to determine whether or not the images
-# generated for formulas are transparent PNGs. Transparent PNGs are
-# not supported properly for IE 6.0, but are supported on all modern browsers.
-# Note that when changing this option you need to delete any form_*.png files
-# in the HTML output before the changes have effect.
-
-FORMULA_TRANSPARENT = YES
-
-# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax
-# (see http://www.mathjax.org) which uses client side Javascript for the
-# rendering instead of using prerendered bitmaps. Use this if you do not
-# have LaTeX installed or if you want to formulas look prettier in the HTML
-# output. When enabled you also need to install MathJax separately and
-# configure the path to it using the MATHJAX_RELPATH option.
-
-USE_MATHJAX = NO
-
-# When MathJax is enabled you need to specify the location relative to the
-# HTML output directory using the MATHJAX_RELPATH option. The destination
-# directory should contain the MathJax.js script. For instance, if the mathjax
-# directory is located at the same level as the HTML output directory, then
-# MATHJAX_RELPATH should be ../mathjax. The default value points to the
-# mathjax.org site, so you can quickly see the result without installing
-# MathJax, but it is strongly recommended to install a local copy of MathJax
-# before deployment.
-
-MATHJAX_RELPATH = http://www.mathjax.org/mathjax
-
-# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension
-# names that should be enabled during MathJax rendering.
-
-MATHJAX_EXTENSIONS =
-
-# When the SEARCHENGINE tag is enabled doxygen will generate a search box
-# for the HTML output. The underlying search engine uses javascript
-# and DHTML and should work on any modern browser. Note that when using
-# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets
-# (GENERATE_DOCSET) there is already a search function so this one should
-# typically be disabled. For large projects the javascript based search engine
-# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
-
-SEARCHENGINE = YES
-
-# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
-# implemented using a PHP enabled web server instead of at the web client
-# using Javascript. Doxygen will generate the search PHP script and index
-# file to put on the web server. The advantage of the server
-# based approach is that it scales better to large projects and allows
-# full text search. The disadvantages are that it is more difficult to setup
-# and does not have live searching capabilities.
-
-SERVER_BASED_SEARCH = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
-# generate Latex output.
-
-GENERATE_LATEX = NO
-
-# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `latex' will be used as the default path.
-
-LATEX_OUTPUT = latex
-
-# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
-# invoked. If left blank `latex' will be used as the default command name.
-# Note that when enabling USE_PDFLATEX this option is only used for
-# generating bitmaps for formulas in the HTML output, but not in the
-# Makefile that is written to the output directory.
-
-LATEX_CMD_NAME = latex
-
-# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
-# generate index for LaTeX. If left blank `makeindex' will be used as the
-# default command name.
-
-MAKEINDEX_CMD_NAME = makeindex
-
-# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
-# LaTeX documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_LATEX = NO
-
-# The PAPER_TYPE tag can be used to set the paper type that is used
-# by the printer. Possible values are: a4, letter, legal and
-# executive. If left blank a4wide will be used.
-
-PAPER_TYPE = a4
-
-# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
-# packages that should be included in the LaTeX output.
-
-EXTRA_PACKAGES =
-
-# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
-# the generated latex document. The header should contain everything until
-# the first chapter. If it is left blank doxygen will generate a
-# standard header. Notice: only use this tag if you know what you are doing!
-
-LATEX_HEADER =
-
-# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for
-# the generated latex document. The footer should contain everything after
-# the last chapter. If it is left blank doxygen will generate a
-# standard footer. Notice: only use this tag if you know what you are doing!
-
-LATEX_FOOTER =
-
-# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
-# is prepared for conversion to pdf (using ps2pdf). The pdf file will
-# contain links (just like the HTML output) instead of page references
-# This makes the output suitable for online browsing using a pdf viewer.
-
-PDF_HYPERLINKS = YES
-
-# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
-# plain latex in the generated Makefile. Set this option to YES to get a
-# higher quality PDF documentation.
-
-USE_PDFLATEX = YES
-
-# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
-# command to the generated LaTeX files. This will instruct LaTeX to keep
-# running if errors occur, instead of asking the user for help.
-# This option is also used when generating formulas in HTML.
-
-LATEX_BATCHMODE = NO
-
-# If LATEX_HIDE_INDICES is set to YES then doxygen will not
-# include the index chapters (such as File Index, Compound Index, etc.)
-# in the output.
-
-LATEX_HIDE_INDICES = NO
-
-# If LATEX_SOURCE_CODE is set to YES then doxygen will include
-# source code with syntax highlighting in the LaTeX output.
-# Note that which sources are shown also depends on other settings
-# such as SOURCE_BROWSER.
-
-LATEX_SOURCE_CODE = NO
-
-# The LATEX_BIB_STYLE tag can be used to specify the style to use for the
-# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See
-# http://en.wikipedia.org/wiki/BibTeX for more info.
-
-LATEX_BIB_STYLE = plain
-
-#---------------------------------------------------------------------------
-# configuration options related to the RTF output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
-# The RTF output is optimized for Word 97 and may not look very pretty with
-# other RTF readers or editors.
-
-GENERATE_RTF = NO
-
-# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `rtf' will be used as the default path.
-
-RTF_OUTPUT = rtf
-
-# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
-# RTF documents. This may be useful for small projects and may help to
-# save some trees in general.
-
-COMPACT_RTF = NO
-
-# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
-# will contain hyperlink fields. The RTF file will
-# contain links (just like the HTML output) instead of page references.
-# This makes the output suitable for online browsing using WORD or other
-# programs which support those fields.
-# Note: wordpad (write) and others do not support links.
-
-RTF_HYPERLINKS = NO
-
-# Load style sheet definitions from file. Syntax is similar to doxygen's
-# config file, i.e. a series of assignments. You only have to provide
-# replacements, missing definitions are set to their default value.
-
-RTF_STYLESHEET_FILE =
-
-# Set optional variables used in the generation of an rtf document.
-# Syntax is similar to doxygen's config file.
-
-RTF_EXTENSIONS_FILE =
-
-#---------------------------------------------------------------------------
-# configuration options related to the man page output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
-# generate man pages
-
-GENERATE_MAN = NO
-
-# The MAN_OUTPUT tag is used to specify where the man pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `man' will be used as the default path.
-
-MAN_OUTPUT = man
-
-# The MAN_EXTENSION tag determines the extension that is added to
-# the generated man pages (default is the subroutine's section .3)
-
-MAN_EXTENSION = .3
-
-# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
-# then it will generate one additional man file for each entity
-# documented in the real man page(s). These additional files
-# only source the real man page, but without them the man command
-# would be unable to find the correct page. The default is NO.
-
-MAN_LINKS = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the XML output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_XML tag is set to YES Doxygen will
-# generate an XML file that captures the structure of
-# the code including all documentation.
-
-GENERATE_XML = NO
-
-# The XML_OUTPUT tag is used to specify where the XML pages will be put.
-# If a relative path is entered the value of OUTPUT_DIRECTORY will be
-# put in front of it. If left blank `xml' will be used as the default path.
-
-XML_OUTPUT = xml
-
-# The XML_SCHEMA tag can be used to specify an XML schema,
-# which can be used by a validating XML parser to check the
-# syntax of the XML files.
-
-XML_SCHEMA =
-
-# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
-# dump the program listings (including syntax highlighting
-# and cross-referencing information) to the XML output. Note that
-# enabling this will significantly increase the size of the XML output.
-
-XML_PROGRAMLISTING = YES
-
-#---------------------------------------------------------------------------
-# configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
-# generate an AutoGen Definitions (see autogen.sf.net) file
-# that captures the structure of the code including all
-# documentation. Note that this feature is still experimental
-# and incomplete at the moment.
-
-GENERATE_AUTOGEN_DEF = NO
-
-#---------------------------------------------------------------------------
-# configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-
-# If the GENERATE_PERLMOD tag is set to YES Doxygen will
-# generate a Perl module file that captures the structure of
-# the code including all documentation. Note that this
-# feature is still experimental and incomplete at the
-# moment.
-
-GENERATE_PERLMOD = NO
-
-# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
-# the necessary Makefile rules, Perl scripts and LaTeX code to be able
-# to generate PDF and DVI output from the Perl module output.
-
-PERLMOD_LATEX = NO
-
-# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
-# nicely formatted so it can be parsed by a human reader.
-# This is useful
-# if you want to understand what is going on.
-# On the other hand, if this
-# tag is set to NO the size of the Perl module output will be much smaller
-# and Perl will parse it just the same.
-
-PERLMOD_PRETTY = YES
-
-# The names of the make variables in the generated doxyrules.make file
-# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
-# This is useful so different doxyrules.make files included by the same
-# Makefile don't overwrite each other's variables.
-
-PERLMOD_MAKEVAR_PREFIX =
-
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-
-# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
-# evaluate all C-preprocessor directives found in the sources and include
-# files.
-
-ENABLE_PREPROCESSING = YES
-
-# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
-# names in the source code. If set to NO (the default) only conditional
-# compilation will be performed. Macro expansion can be done in a controlled
-# way by setting EXPAND_ONLY_PREDEF to YES.
-
-MACRO_EXPANSION = NO
-
-# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
-# then the macro expansion is limited to the macros specified with the
-# PREDEFINED and EXPAND_AS_DEFINED tags.
-
-EXPAND_ONLY_PREDEF = NO
-
-# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
-# pointed to by INCLUDE_PATH will be searched when a #include is found.
-
-SEARCH_INCLUDES = YES
-
-# The INCLUDE_PATH tag can be used to specify one or more directories that
-# contain include files that are not input files but should be processed by
-# the preprocessor.
-
-INCLUDE_PATH =
-
-# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
-# patterns (like *.h and *.hpp) to filter out the header-files in the
-# directories. If left blank, the patterns specified with FILE_PATTERNS will
-# be used.
-
-INCLUDE_FILE_PATTERNS =
-
-# The PREDEFINED tag can be used to specify one or more macro names that
-# are defined before the preprocessor is started (similar to the -D option of
-# gcc). The argument of the tag is a list of macros of the form: name
-# or name=definition (no spaces). If the definition and the = are
-# omitted =1 is assumed. To prevent a macro definition from being
-# undefined via #undef or recursively expanded use the := operator
-# instead of the = operator.
-
-PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS
-
-# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
-# this tag can be used to specify a list of macro names that should be expanded.
-# The macro definition that is found in the sources will be used.
-# Use the PREDEFINED tag if you want to use a different macro definition that
-# overrules the definition found in the source code.
-
-EXPAND_AS_DEFINED =
-
-# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
-# doxygen's preprocessor will remove all references to function-like macros
-# that are alone on a line, have an all uppercase name, and do not end with a
-# semicolon, because these will confuse the parser if not removed.
-
-SKIP_FUNCTION_MACROS = YES
-
-#---------------------------------------------------------------------------
-# Configuration::additions related to external references
-#---------------------------------------------------------------------------
-
-# The TAGFILES option can be used to specify one or more tagfiles.
-# Optionally an initial location of the external documentation
-# can be added for each tagfile. The format of a tag file without
-# this location is as follows:
-#
-# TAGFILES = file1 file2 ...
-# Adding location for the tag files is done as follows:
-#
-# TAGFILES = file1=loc1 "file2 = loc2" ...
-# where "loc1" and "loc2" can be relative or absolute paths or
-# URLs. If a location is present for each tag, the installdox tool
-# does not have to be run to correct the links.
-# Note that each tag file must have a unique name
-# (where the name does NOT include the path)
-# If a tag file is not located in the directory in which doxygen
-# is run, you must also specify the path to the tagfile here.
-
-TAGFILES =
-
-# When a file name is specified after GENERATE_TAGFILE, doxygen will create
-# a tag file that is based on the input files it reads.
-
-GENERATE_TAGFILE =
-
-# If the ALLEXTERNALS tag is set to YES all external classes will be listed
-# in the class index. If set to NO only the inherited external classes
-# will be listed.
-
-ALLEXTERNALS = NO
-
-# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
-# in the modules index. If set to NO, only the current project's groups will
-# be listed.
-
-EXTERNAL_GROUPS = YES
-
-# The PERL_PATH should be the absolute path and name of the perl script
-# interpreter (i.e. the result of `which perl').
-
-PERL_PATH = /usr/bin/perl
-
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-
-# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
-# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
-# or super classes. Setting the tag to NO turns the diagrams off. Note that
-# this option also works with HAVE_DOT disabled, but it is recommended to
-# install and use dot, since it yields more powerful graphs.
-
-CLASS_DIAGRAMS = YES
-
-# You can define message sequence charts within doxygen comments using the \msc
-# command. Doxygen will then run the mscgen tool (see
-# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
-# documentation. The MSCGEN_PATH tag allows you to specify the directory where
-# the mscgen tool resides. If left empty the tool is assumed to be found in the
-# default search path.
-
-MSCGEN_PATH =
-
-# If set to YES, the inheritance and collaboration graphs will hide
-# inheritance and usage relations if the target is undocumented
-# or is not a class.
-
-HIDE_UNDOC_RELATIONS = YES
-
-# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
-# available from the path. This tool is part of Graphviz, a graph visualization
-# toolkit from AT&T and Lucent Bell Labs. The other options in this section
-# have no effect if this option is set to NO (the default)
-
-HAVE_DOT = NO
-
-# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is
-# allowed to run in parallel. When set to 0 (the default) doxygen will
-# base this on the number of processors available in the system. You can set it
-# explicitly to a value larger than 0 to get control over the balance
-# between CPU load and processing speed.
-
-DOT_NUM_THREADS = 0
-
-# By default doxygen will use the Helvetica font for all dot files that
-# doxygen generates. When you want a differently looking font you can specify
-# the font name using DOT_FONTNAME. You need to make sure dot is able to find
-# the font, which can be done by putting it in a standard location or by setting
-# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the
-# directory containing the font.
-
-DOT_FONTNAME = Helvetica
-
-# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
-# The default size is 10pt.
-
-DOT_FONTSIZE = 10
-
-# By default doxygen will tell dot to use the Helvetica font.
-# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to
-# set the path where dot can find it.
-
-DOT_FONTPATH =
-
-# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect inheritance relations. Setting this tag to YES will force the
-# CLASS_DIAGRAMS tag to NO.
-
-CLASS_GRAPH = YES
-
-# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for each documented class showing the direct and
-# indirect implementation dependencies (inheritance, containment, and
-# class references variables) of the class with other documented classes.
-
-COLLABORATION_GRAPH = YES
-
-# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
-# will generate a graph for groups, showing the direct groups dependencies
-
-GROUP_GRAPHS = YES
-
-# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
-# collaboration diagrams in a style similar to the OMG's Unified Modeling
-# Language.
-
-UML_LOOK = NO
-
-# If set to YES, the inheritance and collaboration graphs will show the
-# relations between templates and their instances.
-
-TEMPLATE_RELATIONS = NO
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
-# tags are set to YES then doxygen will generate a graph for each documented
-# file showing the direct and indirect include dependencies of the file with
-# other documented files.
-
-INCLUDE_GRAPH = YES
-
-# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
-# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
-# documented header file showing the documented files that directly or
-# indirectly include this file.
-
-INCLUDED_BY_GRAPH = YES
-
-# If the CALL_GRAPH and HAVE_DOT options are set to YES then
-# doxygen will generate a call dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable call graphs
-# for selected functions only using the \callgraph command.
-
-CALL_GRAPH = NO
-
-# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
-# doxygen will generate a caller dependency graph for every global function
-# or class method. Note that enabling this option will significantly increase
-# the time of a run. So in most cases it will be better to enable caller
-# graphs for selected functions only using the \callergraph command.
-
-CALLER_GRAPH = NO
-
-# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
-# will generate a graphical hierarchy of all classes instead of a textual one.
-
-GRAPHICAL_HIERARCHY = YES
-
-# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
-# then doxygen will show the dependencies a directory has on other directories
-# in a graphical way. The dependency relations are determined by the #include
-# relations between the files in the directories.
-
-DIRECTORY_GRAPH = YES
-
-# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
-# generated by dot. Possible values are svg, png, jpg, or gif.
-# If left blank png will be used. If you choose svg you need to set
-# HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible in IE 9+ (other browsers do not have this requirement).
-
-DOT_IMAGE_FORMAT = png
-
-# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to
-# enable generation of interactive SVG images that allow zooming and panning.
-# Note that this requires a modern browser other than Internet Explorer.
-# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you
-# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files
-# visible. Older versions of IE do not have SVG support.
-
-INTERACTIVE_SVG = NO
-
-# The tag DOT_PATH can be used to specify the path where the dot tool can be
-# found. If left blank, it is assumed the dot tool can be found in the path.
-
-DOT_PATH =
-
-# The DOTFILE_DIRS tag can be used to specify one or more directories that
-# contain dot files that are included in the documentation (see the
-# \dotfile command).
-
-DOTFILE_DIRS =
-
-# The MSCFILE_DIRS tag can be used to specify one or more directories that
-# contain msc files that are included in the documentation (see the
-# \mscfile command).
-
-MSCFILE_DIRS =
-
-# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
-# nodes that will be shown in the graph. If the number of nodes in a graph
-# becomes larger than this value, doxygen will truncate the graph, which is
-# visualized by representing a node as a red box. Note that doxygen if the
-# number of direct children of the root node in a graph is already larger than
-# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
-# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
-
-DOT_GRAPH_MAX_NODES = 50
-
-# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
-# graphs generated by dot. A depth value of 3 means that only nodes reachable
-# from the root by following a path via at most 3 edges will be shown. Nodes
-# that lay further from the root node will be omitted. Note that setting this
-# option to 1 or 2 may greatly reduce the computation time needed for large
-# code bases. Also note that the size of a graph can be further restricted by
-# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
-
-MAX_DOT_GRAPH_DEPTH = 0
-
-# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
-# background. This is disabled by default, because dot on Windows does not
-# seem to support this out of the box. Warning: Depending on the platform used,
-# enabling this option may lead to badly anti-aliased labels on the edges of
-# a graph (i.e. they become hard to read).
-
-DOT_TRANSPARENT = NO
-
-# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
-# files in one run (i.e. multiple -o and -T options on the command line). This
-# makes dot run faster, but since only newer versions of dot (>1.8.10)
-# support this, this feature is disabled by default.
-
-DOT_MULTI_TARGETS = YES
-
-# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
-# generate a legend page explaining the meaning of the various boxes and
-# arrows in the dot generated graphs.
-
-GENERATE_LEGEND = YES
-
-# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
-# remove the intermediate dot files that are used to generate
-# the various graphs.
-
-DOT_CLEANUP = YES
diff --git a/graphics/asymptote/LspCpp/third_party/uri/LICENSE_1_0.txt b/graphics/asymptote/LspCpp/third_party/uri/LICENSE_1_0.txt
deleted file mode 100644
index 36b7cd93cd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/LICENSE_1_0.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/Makefile b/graphics/asymptote/LspCpp/third_party/uri/Makefile
deleted file mode 100644
index e8ae0f2c19..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/Makefile
+++ /dev/null
@@ -1,207 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
-
-# Allow only one "make -f Makefile2" at a time, but pass parallelism.
-.NOTPARALLEL:
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Disable VCS-based implicit rules.
-% : %,v
-
-# Disable VCS-based implicit rules.
-% : RCS/%
-
-# Disable VCS-based implicit rules.
-% : RCS/%,v
-
-# Disable VCS-based implicit rules.
-% : SCCS/s.%
-
-# Disable VCS-based implicit rules.
-% : s.%
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Produce verbose output by default.
-VERBOSE = 1
-
-# Command-line flag to silence nested $(MAKE).
-$(VERBOSE)MAKESILENT = -s
-
-#Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E rm -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target edit_cache
-edit_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
- /usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-.PHONY : edit_cache/fast
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
- /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
-
-# Special rule for the target list_install_components
-list_install_components:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\""
-.PHONY : list_install_components
-
-# Special rule for the target list_install_components
-list_install_components/fast: list_install_components
-.PHONY : list_install_components/fast
-
-# Special rule for the target install
-install: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install
-
-# Special rule for the target install
-install/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install/fast
-
-# Special rule for the target install/local
-install/local: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local
-
-# Special rule for the target install/local
-install/local/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local/fast
-
-# Special rule for the target install/strip
-install/strip: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip
-
-# Special rule for the target install/strip
-install/strip/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip/fast
-
-# The main all target
-all: cmake_check_build_system
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.92/LspCpp/CMakeFiles /usr/local/src/asymptote-2.92/LspCpp/third_party/uri//CMakeFiles/progress.marks
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/all
- $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.92/LspCpp/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-# Convenience name for target.
-third_party/uri/CMakeFiles/doc.dir/rule:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/CMakeFiles/doc.dir/rule
-.PHONY : third_party/uri/CMakeFiles/doc.dir/rule
-
-# Convenience name for target.
-doc: third_party/uri/CMakeFiles/doc.dir/rule
-.PHONY : doc
-
-# fast build rule for target.
-doc/fast:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/CMakeFiles/doc.dir/build.make third_party/uri/CMakeFiles/doc.dir/build
-.PHONY : doc/fast
-
-# Help Target
-help:
- @echo "The following are some of the valid targets for this Makefile:"
- @echo "... all (the default if no target is provided)"
- @echo "... clean"
- @echo "... depend"
- @echo "... edit_cache"
- @echo "... install"
- @echo "... install/local"
- @echo "... install/strip"
- @echo "... list_install_components"
- @echo "... rebuild_cache"
- @echo "... doc"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/README.rst b/graphics/asymptote/LspCpp/third_party/uri/README.rst
deleted file mode 100644
index 4a70f7386a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/README.rst
+++ /dev/null
@@ -1,82 +0,0 @@
-.. :Authors: Glyn Matthews <glyn.matthews@gmail.com>
-.. :Date: Jan 01, 2013
-.. :Description: Source code for the cpp-netlib URI class.
-
-###################
-Deprecation warning
-###################
-
-This library is still missing some features (including full Unicode
-support), and does not work on some of the newest compiler versions.
-Therefore, please prefer to use the
-`WhatWG URL implementation`_ that
-is intended to supersede this library.
-
-.. _`WhatWG URL implementation`: https://github.com/cpp-netlib/url
-
-################
- C++ Network URI
-################
-
-.. image:: https://travis-ci.org/cpp-netlib/uri.png?branch=master
- :target: https://travis-ci.org/cpp-netlib/uri
-
-.. image:: https://ci.appveyor.com/api/projects/status/rjt0nbbtdhsjdjv4?svg=true
- :target: https://ci.appveyor.com/project/glynos/uri-6fkuc
-
-.. image:: https://img.shields.io/badge/license-boost-blue.svg
- :target: https://github.com/cpp-netlib/uri/blob/master/LICENSE_1_0.txt
-
-This project contains the source code that was originally meant to
-track the proposal for a C++ URI at
-http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3975.html
-
-This package provides:
-
- * A ``network::uri`` class that implements a generic URI parser,
- compatible with `RFC 3986`_ and `RFC 3987`_
- * Accessors to the underlying URI parts
- * A range-compatible interface
- * Methods to normalize and compare URIs
- * Percent encoding and decoding functions
- * A URI builder to build consistent URIs from parts, including
- case, percent encoding and path normalization
-
-.. _`RFC 3986`: http://tools.ietf.org/html/rfc3986
-.. _`RFC 3987`: http://tools.ietf.org/html/rfc3987
-
-Building the project
-====================
-
-Building with ``CMake``
------------------------
-
-::
-
- $ mkdir _build
- $ cd _build
- $ cmake ..
- $ make -j4
-
-Running the tests with ``CTest``
---------------------------------
-
-::
-
- $ ctest
-
-License
-=======
-
-This library is released under the Boost Software License (please see
-http://boost.org/LICENSE_1_0.txt or the accompanying LICENSE_1_0.txt
-file for the full text.
-
-Contact
-=======
-
-Any questions about this library can be addressed to the cpp-netlib
-`developers mailing list`_. Issues can be filed using Github at
-http://github.com/cpp-netlib/uri/issues.
-
-.. _`developers mailing list`: cpp-netlib@googlegroups.com
diff --git a/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake b/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake
deleted file mode 100644
index 5212b101ec..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/cmake_install.cmake
+++ /dev/null
@@ -1,54 +0,0 @@
-# Install script for directory: /usr/local/src/asymptote-2.92/LspCpp/third_party/uri
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
- set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
- if(BUILD_TYPE)
- string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
- CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
- else()
- set(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
- endif()
- message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
- if(COMPONENT)
- message(STATUS "Install component: \"${COMPONENT}\"")
- set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
- else()
- set(CMAKE_INSTALL_COMPONENT)
- endif()
-endif()
-
-# Install shared libraries without execute permission?
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
- set(CMAKE_INSTALL_SO_NO_EXE "0")
-endif()
-
-# Is this installation the result of a crosscompile?
-if(NOT DEFINED CMAKE_CROSSCOMPILING)
- set(CMAKE_CROSSCOMPILING "FALSE")
-endif()
-
-# Set default install directory permissions.
-if(NOT DEFINED CMAKE_OBJDUMP)
- set(CMAKE_OBJDUMP "/bin/objdump")
-endif()
-
-if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
- file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/." TYPE DIRECTORY FILES "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include")
-endif()
-
-if(NOT CMAKE_INSTALL_LOCAL_ONLY)
- # Include the install script for each subdirectory.
- include("/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/cmake_install.cmake")
-
-endif()
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/BUILD.bazel b/graphics/asymptote/LspCpp/third_party/uri/deps/BUILD.bazel
deleted file mode 100644
index 1df5ff5f99..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/BUILD.bazel
+++ /dev/null
@@ -1,207 +0,0 @@
-# Copyright 2017 Google Inc.
-# All Rights Reserved.
-#
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Bazel Build for Google C++ Testing Framework(Google Test)
-
-package(default_visibility = ["//visibility:public"])
-
-licenses(["notice"])
-
-exports_files(["LICENSE"])
-
-config_setting(
- name = "qnx",
- constraint_values = ["@platforms//os:qnx"],
-)
-
-config_setting(
- name = "windows",
- constraint_values = ["@platforms//os:windows"],
-)
-
-config_setting(
- name = "freebsd",
- constraint_values = ["@platforms//os:freebsd"],
-)
-
-config_setting(
- name = "openbsd",
- constraint_values = ["@platforms//os:openbsd"],
-)
-
-config_setting(
- name = "msvc_compiler",
- flag_values = {
- "@bazel_tools//tools/cpp:compiler": "msvc-cl",
- },
- visibility = [":__subpackages__"],
-)
-
-config_setting(
- name = "has_absl",
- values = {"define": "absl=1"},
-)
-
-# Library that defines the FRIEND_TEST macro.
-cc_library(
- name = "gtest_prod",
- hdrs = ["googletest/include/gtest/gtest_prod.h"],
- includes = ["googletest/include"],
-)
-
-# Google Test including Google Mock
-cc_library(
- name = "gtest",
- srcs = glob(
- include = [
- "googletest/src/*.cc",
- "googletest/src/*.h",
- "googletest/include/gtest/**/*.h",
- "googlemock/src/*.cc",
- "googlemock/include/gmock/**/*.h",
- ],
- exclude = [
- "googletest/src/gtest-all.cc",
- "googletest/src/gtest_main.cc",
- "googlemock/src/gmock-all.cc",
- "googlemock/src/gmock_main.cc",
- ],
- ),
- hdrs = glob([
- "googletest/include/gtest/*.h",
- "googlemock/include/gmock/*.h",
- ]),
- copts = select({
- ":qnx": [],
- ":windows": [],
- "//conditions:default": ["-pthread"],
- }),
- defines = select({
- ":has_absl": ["GTEST_HAS_ABSL=1"],
- "//conditions:default": [],
- }),
- features = select({
- ":windows": ["windows_export_all_symbols"],
- "//conditions:default": [],
- }),
- includes = [
- "googlemock",
- "googlemock/include",
- "googletest",
- "googletest/include",
- ],
- linkopts = select({
- ":qnx": ["-lregex"],
- ":windows": [],
- ":freebsd": ["-lm", "-pthread"],
- ":openbsd": ["-lm", "-pthread"],
- "//conditions:default": ["-pthread"],
- }),
- deps = select({
- ":has_absl": [
- "@com_google_absl//absl/debugging:failure_signal_handler",
- "@com_google_absl//absl/debugging:stacktrace",
- "@com_google_absl//absl/debugging:symbolize",
- "@com_google_absl//absl/strings",
- "@com_google_absl//absl/types:any",
- "@com_google_absl//absl/types:optional",
- "@com_google_absl//absl/types:variant",
- ],
- "//conditions:default": [],
- }),
-)
-
-cc_library(
- name = "gtest_main",
- srcs = ["googlemock/src/gmock_main.cc"],
- features = select({
- ":windows": ["windows_export_all_symbols"],
- "//conditions:default": [],
- }),
- deps = [":gtest"],
-)
-
-# The following rules build samples of how to use gTest.
-cc_library(
- name = "gtest_sample_lib",
- srcs = [
- "googletest/samples/sample1.cc",
- "googletest/samples/sample2.cc",
- "googletest/samples/sample4.cc",
- ],
- hdrs = [
- "googletest/samples/prime_tables.h",
- "googletest/samples/sample1.h",
- "googletest/samples/sample2.h",
- "googletest/samples/sample3-inl.h",
- "googletest/samples/sample4.h",
- ],
- features = select({
- ":windows": ["windows_export_all_symbols"],
- "//conditions:default": [],
- }),
-)
-
-cc_test(
- name = "gtest_samples",
- size = "small",
- # All Samples except:
- # sample9 (main)
- # sample10 (main and takes a command line option and needs to be separate)
- srcs = [
- "googletest/samples/sample1_unittest.cc",
- "googletest/samples/sample2_unittest.cc",
- "googletest/samples/sample3_unittest.cc",
- "googletest/samples/sample4_unittest.cc",
- "googletest/samples/sample5_unittest.cc",
- "googletest/samples/sample6_unittest.cc",
- "googletest/samples/sample7_unittest.cc",
- "googletest/samples/sample8_unittest.cc",
- ],
- linkstatic = 0,
- deps = [
- "gtest_sample_lib",
- ":gtest_main",
- ],
-)
-
-cc_test(
- name = "sample9_unittest",
- size = "small",
- srcs = ["googletest/samples/sample9_unittest.cc"],
- deps = [":gtest"],
-)
-
-cc_test(
- name = "sample10_unittest",
- size = "small",
- srcs = ["googletest/samples/sample10_unittest.cc"],
- deps = [":gtest"],
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/deps/CMakeLists.txt
deleted file mode 100644
index 7d2eb81028..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/CMakeLists.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-# Note: CMake support is community-based. The maintainers do not use CMake
-# internally.
-
-cmake_minimum_required(VERSION 3.5)
-
-if (POLICY CMP0048)
- cmake_policy(SET CMP0048 NEW)
-endif (POLICY CMP0048)
-
-project(googletest-distribution)
-set(GOOGLETEST_VERSION 1.11.0)
-
-if(NOT CYGWIN AND NOT MSYS AND NOT ${CMAKE_SYSTEM_NAME} STREQUAL QNX)
- set(CMAKE_CXX_EXTENSIONS OFF)
-endif()
-
-enable_testing()
-
-include(CMakeDependentOption)
-include(GNUInstallDirs)
-
-#Note that googlemock target already builds googletest
-option(BUILD_GMOCK "Builds the googlemock subproject" ON)
-option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
-
-if(BUILD_GMOCK)
- add_subdirectory( googlemock )
-else()
- add_subdirectory( googletest )
-endif()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTING.md b/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTING.md
deleted file mode 100644
index 5bdead5389..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTING.md
+++ /dev/null
@@ -1,131 +0,0 @@
-# How to become a contributor and submit your own code
-
-## Contributor License Agreements
-
-We'd love to accept your patches! Before we can take them, we have to jump a
-couple of legal hurdles.
-
-Please fill out either the individual or corporate Contributor License Agreement
-(CLA).
-
-* If you are an individual writing original source code and you're sure you
- own the intellectual property, then you'll need to sign an
- [individual CLA](https://developers.google.com/open-source/cla/individual).
-* If you work for a company that wants to allow you to contribute your work,
- then you'll need to sign a
- [corporate CLA](https://developers.google.com/open-source/cla/corporate).
-
-Follow either of the two links above to access the appropriate CLA and
-instructions for how to sign and return it. Once we receive it, we'll be able to
-accept your pull requests.
-
-## Are you a Googler?
-
-If you are a Googler, please make an attempt to submit an internal change rather
-than a GitHub Pull Request. If you are not able to submit an internal change a
-PR is acceptable as an alternative.
-
-## Contributing A Patch
-
-1. Submit an issue describing your proposed change to the
- [issue tracker](https://github.com/google/googletest/issues).
-2. Please don't mix more than one logical change per submittal, because it
- makes the history hard to follow. If you want to make a change that doesn't
- have a corresponding issue in the issue tracker, please create one.
-3. Also, coordinate with team members that are listed on the issue in question.
- This ensures that work isn't being duplicated and communicating your plan
- early also generally leads to better patches.
-4. If your proposed change is accepted, and you haven't already done so, sign a
- Contributor License Agreement
- ([see details above](#contributor-license-agreements)).
-5. Fork the desired repo, develop and test your code changes.
-6. Ensure that your code adheres to the existing style in the sample to which
- you are contributing.
-7. Ensure that your code has an appropriate set of unit tests which all pass.
-8. Submit a pull request.
-
-## The Google Test and Google Mock Communities
-
-The Google Test community exists primarily through the
-[discussion group](http://groups.google.com/group/googletestframework) and the
-GitHub repository. Likewise, the Google Mock community exists primarily through
-their own [discussion group](http://groups.google.com/group/googlemock). You are
-definitely encouraged to contribute to the discussion and you can also help us
-to keep the effectiveness of the group high by following and promoting the
-guidelines listed here.
-
-### Please Be Friendly
-
-Showing courtesy and respect to others is a vital part of the Google culture,
-and we strongly encourage everyone participating in Google Test development to
-join us in accepting nothing less. Of course, being courteous is not the same as
-failing to constructively disagree with each other, but it does mean that we
-should be respectful of each other when enumerating the 42 technical reasons
-that a particular proposal may not be the best choice. There's never a reason to
-be antagonistic or dismissive toward anyone who is sincerely trying to
-contribute to a discussion.
-
-Sure, C++ testing is serious business and all that, but it's also a lot of fun.
-Let's keep it that way. Let's strive to be one of the friendliest communities in
-all of open source.
-
-As always, discuss Google Test in the official GoogleTest discussion group. You
-don't have to actually submit code in order to sign up. Your participation
-itself is a valuable contribution.
-
-## Style
-
-To keep the source consistent, readable, diffable and easy to merge, we use a
-fairly rigid coding style, as defined by the
-[google-styleguide](https://github.com/google/styleguide) project. All patches
-will be expected to conform to the style outlined
-[here](https://google.github.io/styleguide/cppguide.html). Use
-[.clang-format](https://github.com/google/googletest/blob/master/.clang-format)
-to check your formatting.
-
-## Requirements for Contributors
-
-If you plan to contribute a patch, you need to build Google Test, Google Mock,
-and their own tests from a git checkout, which has further requirements:
-
-* [Python](https://www.python.org/) v2.3 or newer (for running some of the
- tests and re-generating certain source files from templates)
-* [CMake](https://cmake.org/) v2.8.12 or newer
-
-## Developing Google Test and Google Mock
-
-This section discusses how to make your own changes to the Google Test project.
-
-### Testing Google Test and Google Mock Themselves
-
-To make sure your changes work as intended and don't break existing
-functionality, you'll want to compile and run Google Test and GoogleMock's own
-tests. For that you can use CMake:
-
- mkdir mybuild
- cd mybuild
- cmake -Dgtest_build_tests=ON -Dgmock_build_tests=ON ${GTEST_REPO_DIR}
-
-To choose between building only Google Test or Google Mock, you may modify your
-cmake command to be one of each
-
- cmake -Dgtest_build_tests=ON ${GTEST_DIR} # sets up Google Test tests
- cmake -Dgmock_build_tests=ON ${GMOCK_DIR} # sets up Google Mock tests
-
-Make sure you have Python installed, as some of Google Test's tests are written
-in Python. If the cmake command complains about not being able to find Python
-(`Could NOT find PythonInterp (missing: PYTHON_EXECUTABLE)`), try telling it
-explicitly where your Python executable can be found:
-
- cmake -DPYTHON_EXECUTABLE=path/to/python ...
-
-Next, you can build Google Test and / or Google Mock and all desired tests. On
-\*nix, this is usually done by
-
- make
-
-To run the tests, do
-
- make test
-
-All tests should pass.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTORS b/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTORS
deleted file mode 100644
index d9bc587b1b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/CONTRIBUTORS
+++ /dev/null
@@ -1,64 +0,0 @@
-# This file contains a list of people who've made non-trivial
-# contribution to the Google C++ Testing Framework project. People
-# who commit code to the project are encouraged to add their names
-# here. Please keep the list sorted by first names.
-
-Ajay Joshi <jaj@google.com>
-Balázs Dán <balazs.dan@gmail.com>
-Benoit Sigoure <tsuna@google.com>
-Bharat Mediratta <bharat@menalto.com>
-Bogdan Piloca <boo@google.com>
-Chandler Carruth <chandlerc@google.com>
-Chris Prince <cprince@google.com>
-Chris Taylor <taylorc@google.com>
-Dan Egnor <egnor@google.com>
-Dave MacLachlan <dmaclach@gmail.com>
-David Anderson <danderson@google.com>
-Dean Sturtevant
-Eric Roman <eroman@chromium.org>
-Gene Volovich <gv@cite.com>
-Hady Zalek <hady.zalek@gmail.com>
-Hal Burch <gmock@hburch.com>
-Jeffrey Yasskin <jyasskin@google.com>
-Jim Keller <jimkeller@google.com>
-Joe Walnes <joe@truemesh.com>
-Jon Wray <jwray@google.com>
-Jói Sigurðsson <joi@google.com>
-Keir Mierle <mierle@gmail.com>
-Keith Ray <keith.ray@gmail.com>
-Kenton Varda <kenton@google.com>
-Kostya Serebryany <kcc@google.com>
-Krystian Kuzniarek <krystian.kuzniarek@gmail.com>
-Lev Makhlis
-Manuel Klimek <klimek@google.com>
-Mario Tanev <radix@google.com>
-Mark Paskin
-Markus Heule <markus.heule@gmail.com>
-Martijn Vels <mvels@google.com>
-Matthew Simmons <simmonmt@acm.org>
-Mika Raento <mikie@iki.fi>
-Mike Bland <mbland@google.com>
-Miklós Fazekas <mfazekas@szemafor.com>
-Neal Norwitz <nnorwitz@gmail.com>
-Nermin Ozkiranartli <nermin@google.com>
-Owen Carlsen <ocarlsen@google.com>
-Paneendra Ba <paneendra@google.com>
-Pasi Valminen <pasi.valminen@gmail.com>
-Patrick Hanna <phanna@google.com>
-Patrick Riley <pfr@google.com>
-Paul Menage <menage@google.com>
-Peter Kaminski <piotrk@google.com>
-Piotr Kaminski <piotrk@google.com>
-Preston Jackson <preston.a.jackson@gmail.com>
-Rainer Klaffenboeck <rainer.klaffenboeck@dynatrace.com>
-Russ Cox <rsc@google.com>
-Russ Rufer <russ@pentad.com>
-Sean Mcafee <eefacm@gmail.com>
-Sigurður Ãsgeirsson <siggi@google.com>
-Sverre Sundsdal <sundsdal@gmail.com>
-Takeshi Yoshino <tyoshino@google.com>
-Tracy Bialik <tracy@pentad.com>
-Vadim Berman <vadimb@google.com>
-Vlad Losev <vladl@google.com>
-Wolfgang Klier <wklier@google.com>
-Zhanyong Wan <wan@google.com>
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/LICENSE b/graphics/asymptote/LspCpp/third_party/uri/deps/LICENSE
deleted file mode 100644
index 1941a11f8c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright 2008, Google Inc.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/README.md
deleted file mode 100644
index 29e5a4ea72..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/README.md
+++ /dev/null
@@ -1,140 +0,0 @@
-# GoogleTest
-
-### Announcements
-
-#### Live at Head
-
-GoogleTest now follows the
-[Abseil Live at Head philosophy](https://abseil.io/about/philosophy#upgrade-support).
-We recommend using the latest commit in the `main` branch in your projects.
-
-#### Documentation Updates
-
-Our documentation is now live on GitHub Pages at
-https://google.github.io/googletest/. We recommend browsing the documentation on
-GitHub Pages rather than directly in the repository.
-
-#### Release 1.11.0
-
-[Release 1.11.0](https://github.com/google/googletest/releases/tag/release-1.11.0)
-is now available.
-
-#### Coming Soon
-
-* We are planning to take a dependency on
- [Abseil](https://github.com/abseil/abseil-cpp).
-* More documentation improvements are planned.
-
-## Welcome to **GoogleTest**, Google's C++ test framework!
-
-This repository is a merger of the formerly separate GoogleTest and GoogleMock
-projects. These were so closely related that it makes sense to maintain and
-release them together.
-
-### Getting Started
-
-See the [GoogleTest User's Guide](https://google.github.io/googletest/) for
-documentation. We recommend starting with the
-[GoogleTest Primer](https://google.github.io/googletest/primer.html).
-
-More information about building GoogleTest can be found at
-[googletest/README.md](googletest/README.md).
-
-## Features
-
-* An [xUnit](https://en.wikipedia.org/wiki/XUnit) test framework.
-* Test discovery.
-* A rich set of assertions.
-* User-defined assertions.
-* Death tests.
-* Fatal and non-fatal failures.
-* Value-parameterized tests.
-* Type-parameterized tests.
-* Various options for running the tests.
-* XML test report generation.
-
-## Supported Platforms
-
-GoogleTest requires a codebase and compiler compliant with the C++11 standard or
-newer.
-
-The GoogleTest code is officially supported on the following platforms.
-Operating systems or tools not listed below are community-supported. For
-community-supported platforms, patches that do not complicate the code may be
-considered.
-
-If you notice any problems on your platform, please file an issue on the
-[GoogleTest GitHub Issue Tracker](https://github.com/google/googletest/issues).
-Pull requests containing fixes are welcome!
-
-### Operating Systems
-
-* Linux
-* macOS
-* Windows
-
-### Compilers
-
-* gcc 5.0+
-* clang 5.0+
-* MSVC 2015+
-
-**macOS users:** Xcode 9.3+ provides clang 5.0+.
-
-### Build Systems
-
-* [Bazel](https://bazel.build/)
-* [CMake](https://cmake.org/)
-
-**Note:** Bazel is the build system used by the team internally and in tests.
-CMake is supported on a best-effort basis and by the community.
-
-## Who Is Using GoogleTest?
-
-In addition to many internal projects at Google, GoogleTest is also used by the
-following notable projects:
-
-* The [Chromium projects](http://www.chromium.org/) (behind the Chrome browser
- and Chrome OS).
-* The [LLVM](http://llvm.org/) compiler.
-* [Protocol Buffers](https://github.com/google/protobuf), Google's data
- interchange format.
-* The [OpenCV](http://opencv.org/) computer vision library.
-
-## Related Open Source Projects
-
-[GTest Runner](https://github.com/nholthaus/gtest-runner) is a Qt5 based
-automated test-runner and Graphical User Interface with powerful features for
-Windows and Linux platforms.
-
-[GoogleTest UI](https://github.com/ospector/gtest-gbar) is a test runner that
-runs your test binary, allows you to track its progress via a progress bar, and
-displays a list of test failures. Clicking on one shows failure text. GoogleTest
-UI is written in C#.
-
-[GTest TAP Listener](https://github.com/kinow/gtest-tap-listener) is an event
-listener for GoogleTest that implements the
-[TAP protocol](https://en.wikipedia.org/wiki/Test_Anything_Protocol) for test
-result output. If your test runner understands TAP, you may find it useful.
-
-[gtest-parallel](https://github.com/google/gtest-parallel) is a test runner that
-runs tests from your binary in parallel to provide significant speed-up.
-
-[GoogleTest Adapter](https://marketplace.visualstudio.com/items?itemName=DavidSchuldenfrei.gtest-adapter)
-is a VS Code extension allowing to view GoogleTest in a tree view, and run/debug
-your tests.
-
-[C++ TestMate](https://github.com/matepek/vscode-catch2-test-adapter) is a VS
-Code extension allowing to view GoogleTest in a tree view, and run/debug your
-tests.
-
-[Cornichon](https://pypi.org/project/cornichon/) is a small Gherkin DSL parser
-that generates stub code for GoogleTest.
-
-## Contributing Changes
-
-Please read
-[`CONTRIBUTING.md`](https://github.com/google/googletest/blob/master/CONTRIBUTING.md)
-for details on how to contribute to this project.
-
-Happy testing!
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/WORKSPACE b/graphics/asymptote/LspCpp/third_party/uri/deps/WORKSPACE
deleted file mode 100644
index 7eb18eb984..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/WORKSPACE
+++ /dev/null
@@ -1,17 +0,0 @@
-workspace(name = "com_google_googletest")
-
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-http_archive(
- name = "com_google_absl",
- sha256 = "aeba534f7307e36fe084b452299e49b97420667a8d28102cf9a0daeed340b859",
- strip_prefix = "abseil-cpp-7971fb358ae376e016d2d4fc9327aad95659b25e",
- urls = ["https://github.com/abseil/abseil-cpp/archive/7971fb358ae376e016d2d4fc9327aad95659b25e.zip"], # 2021-05-20T02:59:16Z
-)
-
-http_archive(
- name = "rules_python",
- sha256 = "98b3c592faea9636ac8444bfd9de7f3fb4c60590932d6e6ac5946e3f8dbd5ff6",
- strip_prefix = "rules_python-ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2",
- urls = ["https://github.com/bazelbuild/rules_python/archive/ed6cc8f2c3692a6a7f013ff8bc185ba77eb9b4d2.zip"], # 2021-05-17T00:24:16Z
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/ci/linux-presubmit.sh b/graphics/asymptote/LspCpp/third_party/uri/deps/ci/linux-presubmit.sh
deleted file mode 100644
index 0818ef0b9c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/ci/linux-presubmit.sh
+++ /dev/null
@@ -1,126 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2020, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-set -euox pipefail
-
-readonly LINUX_LATEST_CONTAINER="gcr.io/google.com/absl-177019/linux_hybrid-latest:20220113"
-readonly LINUX_GCC_FLOOR_CONTAINER="gcr.io/google.com/absl-177019/linux_gcc-floor:20210617"
-
-if [[ -z ${GTEST_ROOT:-} ]]; then
- GTEST_ROOT="$(realpath $(dirname ${0})/..)"
-fi
-
-if [[ -z ${STD:-} ]]; then
- STD="c++11 c++14 c++17 c++20"
-fi
-
-# Test the CMake build
-for cc in /usr/local/bin/gcc /opt/llvm/clang/bin/clang; do
- for cmake_off_on in OFF ON; do
- time docker run \
- --volume="${GTEST_ROOT}:/src:ro" \
- --tmpfs="/build:exec" \
- --workdir="/build" \
- --rm \
- --env="CC=${cc}" \
- --env="CXX_FLAGS=\"-Werror -Wdeprecated\"" \
- ${LINUX_LATEST_CONTAINER} \
- /bin/bash -c "
- cmake /src \
- -DCMAKE_CXX_STANDARD=11 \
- -Dgtest_build_samples=ON \
- -Dgtest_build_tests=ON \
- -Dgmock_build_tests=ON \
- -Dcxx_no_exception=${cmake_off_on} \
- -Dcxx_no_rtti=${cmake_off_on} && \
- make -j$(nproc) && \
- ctest -j$(nproc) --output-on-failure"
- done
-done
-
-# Do one test with an older version of GCC
-time docker run \
- --volume="${GTEST_ROOT}:/src:ro" \
- --workdir="/src" \
- --rm \
- --env="CC=/usr/local/bin/gcc" \
- ${LINUX_GCC_FLOOR_CONTAINER} \
- /usr/local/bin/bazel test ... \
- --copt="-Wall" \
- --copt="-Werror" \
- --copt="-Wno-error=pragmas" \
- --keep_going \
- --show_timestamps \
- --test_output=errors
-
-# Test GCC
-for std in ${STD}; do
- for absl in 0 1; do
- time docker run \
- --volume="${GTEST_ROOT}:/src:ro" \
- --workdir="/src" \
- --rm \
- --env="CC=/usr/local/bin/gcc" \
- --env="BAZEL_CXXOPTS=-std=${std}" \
- ${LINUX_LATEST_CONTAINER} \
- /usr/local/bin/bazel test ... \
- --copt="-Wall" \
- --copt="-Werror" \
- --define="absl=${absl}" \
- --distdir="/bazel-distdir" \
- --keep_going \
- --show_timestamps \
- --test_output=errors
- done
-done
-
-# Test Clang
-for std in ${STD}; do
- for absl in 0 1; do
- time docker run \
- --volume="${GTEST_ROOT}:/src:ro" \
- --workdir="/src" \
- --rm \
- --env="CC=/opt/llvm/clang/bin/clang" \
- --env="BAZEL_CXXOPTS=-std=${std}" \
- ${LINUX_LATEST_CONTAINER} \
- /usr/local/bin/bazel test ... \
- --copt="--gcc-toolchain=/usr/local" \
- --copt="-Wall" \
- --copt="-Werror" \
- --define="absl=${absl}" \
- --distdir="/bazel-distdir" \
- --keep_going \
- --linkopt="--gcc-toolchain=/usr/local" \
- --show_timestamps \
- --test_output=errors
- done
-done
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/ci/macos-presubmit.sh b/graphics/asymptote/LspCpp/third_party/uri/deps/ci/macos-presubmit.sh
deleted file mode 100644
index d6423faacc..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/ci/macos-presubmit.sh
+++ /dev/null
@@ -1,73 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2020, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-set -euox pipefail
-
-if [[ -z ${GTEST_ROOT:-} ]]; then
- GTEST_ROOT="$(realpath $(dirname ${0})/..)"
-fi
-
-# Test the CMake build
-for cmake_off_on in OFF ON; do
- BUILD_DIR=$(mktemp -d build_dir.XXXXXXXX)
- cd ${BUILD_DIR}
- time cmake ${GTEST_ROOT} \
- -DCMAKE_CXX_STANDARD=11 \
- -Dgtest_build_samples=ON \
- -Dgtest_build_tests=ON \
- -Dgmock_build_tests=ON \
- -Dcxx_no_exception=${cmake_off_on} \
- -Dcxx_no_rtti=${cmake_off_on}
- time make
- time ctest -j$(nproc) --output-on-failure
-done
-
-# Test the Bazel build
-
-# If we are running on Kokoro, check for a versioned Bazel binary.
-KOKORO_GFILE_BAZEL_BIN="bazel-3.7.0-darwin-x86_64"
-if [[ ${KOKORO_GFILE_DIR:-} ]] && [[ -f ${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN} ]]; then
- BAZEL_BIN="${KOKORO_GFILE_DIR}/${KOKORO_GFILE_BAZEL_BIN}"
- chmod +x ${BAZEL_BIN}
-else
- BAZEL_BIN="bazel"
-fi
-
-cd ${GTEST_ROOT}
-for absl in 0 1; do
- ${BAZEL_BIN} test ... \
- --copt="-Wall" \
- --copt="-Werror" \
- --define="absl=${absl}" \
- --keep_going \
- --show_timestamps \
- --test_output=errors
-done
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_config.yml b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_config.yml
deleted file mode 100644
index d12867eab6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_config.yml
+++ /dev/null
@@ -1 +0,0 @@
-title: GoogleTest
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_data/navigation.yml b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_data/navigation.yml
deleted file mode 100644
index 9f3332708e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_data/navigation.yml
+++ /dev/null
@@ -1,43 +0,0 @@
-nav:
-- section: "Get Started"
- items:
- - title: "Supported Platforms"
- url: "/platforms.html"
- - title: "Quickstart: Bazel"
- url: "/quickstart-bazel.html"
- - title: "Quickstart: CMake"
- url: "/quickstart-cmake.html"
-- section: "Guides"
- items:
- - title: "GoogleTest Primer"
- url: "/primer.html"
- - title: "Advanced Topics"
- url: "/advanced.html"
- - title: "Mocking for Dummies"
- url: "/gmock_for_dummies.html"
- - title: "Mocking Cookbook"
- url: "/gmock_cook_book.html"
- - title: "Mocking Cheat Sheet"
- url: "/gmock_cheat_sheet.html"
-- section: "References"
- items:
- - title: "Testing Reference"
- url: "/reference/testing.html"
- - title: "Mocking Reference"
- url: "/reference/mocking.html"
- - title: "Assertions"
- url: "/reference/assertions.html"
- - title: "Matchers"
- url: "/reference/matchers.html"
- - title: "Actions"
- url: "/reference/actions.html"
- - title: "Testing FAQ"
- url: "/faq.html"
- - title: "Mocking FAQ"
- url: "/gmock_faq.html"
- - title: "Code Samples"
- url: "/samples.html"
- - title: "Using pkg-config"
- url: "/pkgconfig.html"
- - title: "Community Documentation"
- url: "/community_created_documentation.html"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_layouts/default.html b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_layouts/default.html
deleted file mode 100644
index dcb42d9191..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_layouts/default.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html>
-<html lang="{{ site.lang | default: "en-US" }}">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
-{% seo %}
- <link rel="stylesheet" href="{{ "/assets/css/style.css?v=" | append: site.github.build_revision | relative_url }}">
- <script>
- window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
- ga('create', 'UA-197576187-1', { 'storage': 'none' });
- ga('set', 'referrer', document.referrer.split('?')[0]);
- ga('set', 'location', window.location.href.split('?')[0]);
- ga('set', 'anonymizeIp', true);
- ga('send', 'pageview');
- </script>
- <script async src='https://www.google-analytics.com/analytics.js'></script>
- </head>
- <body>
- <div class="sidebar">
- <div class="header">
- <h1><a href="{{ "/" | relative_url }}">{{ site.title | default: "Documentation" }}</a></h1>
- </div>
- <input type="checkbox" id="nav-toggle" class="nav-toggle">
- <label for="nav-toggle" class="expander">
- <span class="arrow"></span>
- </label>
- <nav>
- {% for item in site.data.navigation.nav %}
- <h2>{{ item.section }}</h2>
- <ul>
- {% for subitem in item.items %}
- <a href="{{subitem.url | relative_url }}">
- <li class="{% if subitem.url == page.url %}active{% endif %}">
- {{ subitem.title }}
- </li>
- </a>
- {% endfor %}
- </ul>
- {% endfor %}
- </nav>
- </div>
- <div class="main markdown-body">
- <div class="main-inner">
- {{ content }}
- </div>
- <div class="footer">
- GoogleTest &middot;
- <a href="https://github.com/google/googletest">GitHub Repository</a> &middot;
- <a href="https://github.com/google/googletest/blob/master/LICENSE">License</a> &middot;
- <a href="https://policies.google.com/privacy">Privacy Policy</a>
- </div>
- </div>
- <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
- <script>anchors.add('.main h2, .main h3, .main h4, .main h5, .main h6');</script>
- </body>
-</html>
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_sass/main.scss b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_sass/main.scss
deleted file mode 100644
index 92edc877a5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/_sass/main.scss
+++ /dev/null
@@ -1,200 +0,0 @@
-// Styles for GoogleTest docs website on GitHub Pages.
-// Color variables are defined in
-// https://github.com/pages-themes/primer/tree/master/_sass/primer-support/lib/variables
-
-$sidebar-width: 260px;
-
-body {
- display: flex;
- margin: 0;
-}
-
-.sidebar {
- background: $black;
- color: $text-white;
- flex-shrink: 0;
- height: 100vh;
- overflow: auto;
- position: sticky;
- top: 0;
- width: $sidebar-width;
-}
-
-.sidebar h1 {
- font-size: 1.5em;
-}
-
-.sidebar h2 {
- color: $gray-light;
- font-size: 0.8em;
- font-weight: normal;
- margin-bottom: 0.8em;
- padding-left: 2.5em;
- text-transform: uppercase;
-}
-
-.sidebar .header {
- background: $black;
- padding: 2em;
- position: sticky;
- top: 0;
- width: 100%;
-}
-
-.sidebar .header a {
- color: $text-white;
- text-decoration: none;
-}
-
-.sidebar .nav-toggle {
- display: none;
-}
-
-.sidebar .expander {
- cursor: pointer;
- display: none;
- height: 3em;
- position: absolute;
- right: 1em;
- top: 1.5em;
- width: 3em;
-}
-
-.sidebar .expander .arrow {
- border: solid $white;
- border-width: 0 3px 3px 0;
- display: block;
- height: 0.7em;
- margin: 1em auto;
- transform: rotate(45deg);
- transition: transform 0.5s;
- width: 0.7em;
-}
-
-.sidebar nav {
- width: 100%;
-}
-
-.sidebar nav ul {
- list-style-type: none;
- margin-bottom: 1em;
- padding: 0;
-
- &:last-child {
- margin-bottom: 2em;
- }
-
- a {
- text-decoration: none;
- }
-
- li {
- color: $text-white;
- padding-left: 2em;
- text-decoration: none;
- }
-
- li.active {
- background: $border-gray-darker;
- font-weight: bold;
- }
-
- li:hover {
- background: $border-gray-darker;
- }
-}
-
-.main {
- background-color: $bg-gray;
- width: calc(100% - #{$sidebar-width});
-}
-
-.main .main-inner {
- background-color: $white;
- padding: 2em;
-}
-
-.main .footer {
- margin: 0;
- padding: 2em;
-}
-
-.main table th {
- text-align: left;
-}
-
-.main .callout {
- border-left: 0.25em solid $white;
- padding: 1em;
-
- a {
- text-decoration: underline;
- }
-
- &.important {
- background-color: $bg-yellow-light;
- border-color: $bg-yellow;
- color: $black;
- }
-
- &.note {
- background-color: $bg-blue-light;
- border-color: $text-blue;
- color: $text-blue;
- }
-
- &.tip {
- background-color: $green-000;
- border-color: $green-700;
- color: $green-700;
- }
-
- &.warning {
- background-color: $red-000;
- border-color: $text-red;
- color: $text-red;
- }
-}
-
-.main .good pre {
- background-color: $bg-green-light;
-}
-
-.main .bad pre {
- background-color: $red-000;
-}
-
-@media all and (max-width: 768px) {
- body {
- flex-direction: column;
- }
-
- .sidebar {
- height: auto;
- position: relative;
- width: 100%;
- }
-
- .sidebar .expander {
- display: block;
- }
-
- .sidebar nav {
- height: 0;
- overflow: hidden;
- }
-
- .sidebar .nav-toggle:checked {
- & ~ nav {
- height: auto;
- }
-
- & + .expander .arrow {
- transform: rotate(-135deg);
- }
- }
-
- .main {
- width: 100%;
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/advanced.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/advanced.md
deleted file mode 100644
index f2f8854bf3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/advanced.md
+++ /dev/null
@@ -1,2379 +0,0 @@
-# Advanced googletest Topics
-
-## Introduction
-
-Now that you have read the [googletest Primer](primer.md) and learned how to
-write tests using googletest, it's time to learn some new tricks. This document
-will show you more assertions as well as how to construct complex failure
-messages, propagate fatal failures, reuse and speed up your test fixtures, and
-use various flags with your tests.
-
-## More Assertions
-
-This section covers some less frequently used, but still significant,
-assertions.
-
-### Explicit Success and Failure
-
-See [Explicit Success and Failure](reference/assertions.md#success-failure) in
-the Assertions Reference.
-
-### Exception Assertions
-
-See [Exception Assertions](reference/assertions.md#exceptions) in the Assertions
-Reference.
-
-### Predicate Assertions for Better Error Messages
-
-Even though googletest has a rich set of assertions, they can never be complete,
-as it's impossible (nor a good idea) to anticipate all scenarios a user might
-run into. Therefore, sometimes a user has to use `EXPECT_TRUE()` to check a
-complex expression, for lack of a better macro. This has the problem of not
-showing you the values of the parts of the expression, making it hard to
-understand what went wrong. As a workaround, some users choose to construct the
-failure message by themselves, streaming it into `EXPECT_TRUE()`. However, this
-is awkward especially when the expression has side-effects or is expensive to
-evaluate.
-
-googletest gives you three different options to solve this problem:
-
-#### Using an Existing Boolean Function
-
-If you already have a function or functor that returns `bool` (or a type that
-can be implicitly converted to `bool`), you can use it in a *predicate
-assertion* to get the function arguments printed for free. See
-[`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) in the Assertions
-Reference for details.
-
-#### Using a Function That Returns an AssertionResult
-
-While `EXPECT_PRED*()` and friends are handy for a quick job, the syntax is not
-satisfactory: you have to use different macros for different arities, and it
-feels more like Lisp than C++. The `::testing::AssertionResult` class solves
-this problem.
-
-An `AssertionResult` object represents the result of an assertion (whether it's
-a success or a failure, and an associated message). You can create an
-`AssertionResult` using one of these factory functions:
-
-```c++
-namespace testing {
-
-// Returns an AssertionResult object to indicate that an assertion has
-// succeeded.
-AssertionResult AssertionSuccess();
-
-// Returns an AssertionResult object to indicate that an assertion has
-// failed.
-AssertionResult AssertionFailure();
-
-}
-```
-
-You can then use the `<<` operator to stream messages to the `AssertionResult`
-object.
-
-To provide more readable messages in Boolean assertions (e.g. `EXPECT_TRUE()`),
-write a predicate function that returns `AssertionResult` instead of `bool`. For
-example, if you define `IsEven()` as:
-
-```c++
-testing::AssertionResult IsEven(int n) {
- if ((n % 2) == 0)
- return testing::AssertionSuccess();
- else
- return testing::AssertionFailure() << n << " is odd";
-}
-```
-
-instead of:
-
-```c++
-bool IsEven(int n) {
- return (n % 2) == 0;
-}
-```
-
-the failed assertion `EXPECT_TRUE(IsEven(Fib(4)))` will print:
-
-```none
-Value of: IsEven(Fib(4))
- Actual: false (3 is odd)
-Expected: true
-```
-
-instead of a more opaque
-
-```none
-Value of: IsEven(Fib(4))
- Actual: false
-Expected: true
-```
-
-If you want informative messages in `EXPECT_FALSE` and `ASSERT_FALSE` as well
-(one third of Boolean assertions in the Google code base are negative ones), and
-are fine with making the predicate slower in the success case, you can supply a
-success message:
-
-```c++
-testing::AssertionResult IsEven(int n) {
- if ((n % 2) == 0)
- return testing::AssertionSuccess() << n << " is even";
- else
- return testing::AssertionFailure() << n << " is odd";
-}
-```
-
-Then the statement `EXPECT_FALSE(IsEven(Fib(6)))` will print
-
-```none
- Value of: IsEven(Fib(6))
- Actual: true (8 is even)
- Expected: false
-```
-
-#### Using a Predicate-Formatter
-
-If you find the default message generated by
-[`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) and
-[`EXPECT_TRUE`](reference/assertions.md#EXPECT_TRUE) unsatisfactory, or some
-arguments to your predicate do not support streaming to `ostream`, you can
-instead use *predicate-formatter assertions* to *fully* customize how the
-message is formatted. See
-[`EXPECT_PRED_FORMAT*`](reference/assertions.md#EXPECT_PRED_FORMAT) in the
-Assertions Reference for details.
-
-### Floating-Point Comparison
-
-See [Floating-Point Comparison](reference/assertions.md#floating-point) in the
-Assertions Reference.
-
-#### Floating-Point Predicate-Format Functions
-
-Some floating-point operations are useful, but not that often used. In order to
-avoid an explosion of new macros, we provide them as predicate-format functions
-that can be used in the predicate assertion macro
-[`EXPECT_PRED_FORMAT2`](reference/assertions.md#EXPECT_PRED_FORMAT), for
-example:
-
-```c++
-using ::testing::FloatLE;
-using ::testing::DoubleLE;
-...
-EXPECT_PRED_FORMAT2(FloatLE, val1, val2);
-EXPECT_PRED_FORMAT2(DoubleLE, val1, val2);
-```
-
-The above code verifies that `val1` is less than, or approximately equal to,
-`val2`.
-
-### Asserting Using gMock Matchers
-
-See [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) in the Assertions
-Reference.
-
-### More String Assertions
-
-(Please read the [previous](#asserting-using-gmock-matchers) section first if
-you haven't.)
-
-You can use the gMock [string matchers](reference/matchers.md#string-matchers)
-with [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) to do more string
-comparison tricks (sub-string, prefix, suffix, regular expression, and etc). For
-example,
-
-```c++
-using ::testing::HasSubstr;
-using ::testing::MatchesRegex;
-...
- ASSERT_THAT(foo_string, HasSubstr("needle"));
- EXPECT_THAT(bar_string, MatchesRegex("\\w*\\d+"));
-```
-
-### Windows HRESULT assertions
-
-See [Windows HRESULT Assertions](reference/assertions.md#HRESULT) in the
-Assertions Reference.
-
-### Type Assertions
-
-You can call the function
-
-```c++
-::testing::StaticAssertTypeEq<T1, T2>();
-```
-
-to assert that types `T1` and `T2` are the same. The function does nothing if
-the assertion is satisfied. If the types are different, the function call will
-fail to compile, the compiler error message will say that `T1 and T2 are not the
-same type` and most likely (depending on the compiler) show you the actual
-values of `T1` and `T2`. This is mainly useful inside template code.
-
-**Caveat**: When used inside a member function of a class template or a function
-template, `StaticAssertTypeEq<T1, T2>()` is effective only if the function is
-instantiated. For example, given:
-
-```c++
-template <typename T> class Foo {
- public:
- void Bar() { testing::StaticAssertTypeEq<int, T>(); }
-};
-```
-
-the code:
-
-```c++
-void Test1() { Foo<bool> foo; }
-```
-
-will not generate a compiler error, as `Foo<bool>::Bar()` is never actually
-instantiated. Instead, you need:
-
-```c++
-void Test2() { Foo<bool> foo; foo.Bar(); }
-```
-
-to cause a compiler error.
-
-### Assertion Placement
-
-You can use assertions in any C++ function. In particular, it doesn't have to be
-a method of the test fixture class. The one constraint is that assertions that
-generate a fatal failure (`FAIL*` and `ASSERT_*`) can only be used in
-void-returning functions. This is a consequence of Google's not using
-exceptions. By placing it in a non-void function you'll get a confusing compile
-error like `"error: void value not ignored as it ought to be"` or `"cannot
-initialize return object of type 'bool' with an rvalue of type 'void'"` or
-`"error: no viable conversion from 'void' to 'string'"`.
-
-If you need to use fatal assertions in a function that returns non-void, one
-option is to make the function return the value in an out parameter instead. For
-example, you can rewrite `T2 Foo(T1 x)` to `void Foo(T1 x, T2* result)`. You
-need to make sure that `*result` contains some sensible value even when the
-function returns prematurely. As the function now returns `void`, you can use
-any assertion inside of it.
-
-If changing the function's type is not an option, you should just use assertions
-that generate non-fatal failures, such as `ADD_FAILURE*` and `EXPECT_*`.
-
-{: .callout .note}
-NOTE: Constructors and destructors are not considered void-returning functions,
-according to the C++ language specification, and so you may not use fatal
-assertions in them; you'll get a compilation error if you try. Instead, either
-call `abort` and crash the entire test executable, or put the fatal assertion in
-a `SetUp`/`TearDown` function; see
-[constructor/destructor vs. `SetUp`/`TearDown`](faq.md#CtorVsSetUp)
-
-{: .callout .warning}
-WARNING: A fatal assertion in a helper function (private void-returning method)
-called from a constructor or destructor does not terminate the current test, as
-your intuition might suggest: it merely returns from the constructor or
-destructor early, possibly leaving your object in a partially-constructed or
-partially-destructed state! You almost certainly want to `abort` or use
-`SetUp`/`TearDown` instead.
-
-## Skipping test execution
-
-Related to the assertions `SUCCEED()` and `FAIL()`, you can prevent further test
-execution at runtime with the `GTEST_SKIP()` macro. This is useful when you need
-to check for preconditions of the system under test during runtime and skip
-tests in a meaningful way.
-
-`GTEST_SKIP()` can be used in individual test cases or in the `SetUp()` methods
-of classes derived from either `::testing::Environment` or `::testing::Test`.
-For example:
-
-```c++
-TEST(SkipTest, DoesSkip) {
- GTEST_SKIP() << "Skipping single test";
- EXPECT_EQ(0, 1); // Won't fail; it won't be executed
-}
-
-class SkipFixture : public ::testing::Test {
- protected:
- void SetUp() override {
- GTEST_SKIP() << "Skipping all tests for this fixture";
- }
-};
-
-// Tests for SkipFixture won't be executed.
-TEST_F(SkipFixture, SkipsOneTest) {
- EXPECT_EQ(5, 7); // Won't fail
-}
-```
-
-As with assertion macros, you can stream a custom message into `GTEST_SKIP()`.
-
-## Teaching googletest How to Print Your Values
-
-When a test assertion such as `EXPECT_EQ` fails, googletest prints the argument
-values to help you debug. It does this using a user-extensible value printer.
-
-This printer knows how to print built-in C++ types, native arrays, STL
-containers, and any type that supports the `<<` operator. For other types, it
-prints the raw bytes in the value and hopes that you the user can figure it out.
-
-As mentioned earlier, the printer is *extensible*. That means you can teach it
-to do a better job at printing your particular type than to dump the bytes. To
-do that, define `<<` for your type:
-
-```c++
-#include <ostream>
-
-namespace foo {
-
-class Bar { // We want googletest to be able to print instances of this.
-...
- // Create a free inline friend function.
- friend std::ostream& operator<<(std::ostream& os, const Bar& bar) {
- return os << bar.DebugString(); // whatever needed to print bar to os
- }
-};
-
-// If you can't declare the function in the class it's important that the
-// << operator is defined in the SAME namespace that defines Bar. C++'s look-up
-// rules rely on that.
-std::ostream& operator<<(std::ostream& os, const Bar& bar) {
- return os << bar.DebugString(); // whatever needed to print bar to os
-}
-
-} // namespace foo
-```
-
-Sometimes, this might not be an option: your team may consider it bad style to
-have a `<<` operator for `Bar`, or `Bar` may already have a `<<` operator that
-doesn't do what you want (and you cannot change it). If so, you can instead
-define a `PrintTo()` function like this:
-
-```c++
-#include <ostream>
-
-namespace foo {
-
-class Bar {
- ...
- friend void PrintTo(const Bar& bar, std::ostream* os) {
- *os << bar.DebugString(); // whatever needed to print bar to os
- }
-};
-
-// If you can't declare the function in the class it's important that PrintTo()
-// is defined in the SAME namespace that defines Bar. C++'s look-up rules rely
-// on that.
-void PrintTo(const Bar& bar, std::ostream* os) {
- *os << bar.DebugString(); // whatever needed to print bar to os
-}
-
-} // namespace foo
-```
-
-If you have defined both `<<` and `PrintTo()`, the latter will be used when
-googletest is concerned. This allows you to customize how the value appears in
-googletest's output without affecting code that relies on the behavior of its
-`<<` operator.
-
-If you want to print a value `x` using googletest's value printer yourself, just
-call `::testing::PrintToString(x)`, which returns an `std::string`:
-
-```c++
-vector<pair<Bar, int> > bar_ints = GetBarIntVector();
-
-EXPECT_TRUE(IsCorrectBarIntVector(bar_ints))
- << "bar_ints = " << testing::PrintToString(bar_ints);
-```
-
-## Death Tests
-
-In many applications, there are assertions that can cause application failure if
-a condition is not met. These consistency checks, which ensure that the program
-is in a known good state, are there to fail at the earliest possible time after
-some program state is corrupted. If the assertion checks the wrong condition,
-then the program may proceed in an erroneous state, which could lead to memory
-corruption, security holes, or worse. Hence it is vitally important to test that
-such assertion statements work as expected.
-
-Since these precondition checks cause the processes to die, we call such tests
-_death tests_. More generally, any test that checks that a program terminates
-(except by throwing an exception) in an expected fashion is also a death test.
-
-Note that if a piece of code throws an exception, we don't consider it "death"
-for the purpose of death tests, as the caller of the code could catch the
-exception and avoid the crash. If you want to verify exceptions thrown by your
-code, see [Exception Assertions](#ExceptionAssertions).
-
-If you want to test `EXPECT_*()/ASSERT_*()` failures in your test code, see
-["Catching" Failures](#catching-failures).
-
-### How to Write a Death Test
-
-GoogleTest provides assertion macros to support death tests. See
-[Death Assertions](reference/assertions.md#death) in the Assertions Reference
-for details.
-
-To write a death test, simply use one of the macros inside your test function.
-For example,
-
-```c++
-TEST(MyDeathTest, Foo) {
- // This death test uses a compound statement.
- ASSERT_DEATH({
- int n = 5;
- Foo(&n);
- }, "Error on line .* of Foo()");
-}
-
-TEST(MyDeathTest, NormalExit) {
- EXPECT_EXIT(NormalExit(), testing::ExitedWithCode(0), "Success");
-}
-
-TEST(MyDeathTest, KillProcess) {
- EXPECT_EXIT(KillProcess(), testing::KilledBySignal(SIGKILL),
- "Sending myself unblockable signal");
-}
-```
-
-verifies that:
-
-* calling `Foo(5)` causes the process to die with the given error message,
-* calling `NormalExit()` causes the process to print `"Success"` to stderr and
- exit with exit code 0, and
-* calling `KillProcess()` kills the process with signal `SIGKILL`.
-
-The test function body may contain other assertions and statements as well, if
-necessary.
-
-Note that a death test only cares about three things:
-
-1. does `statement` abort or exit the process?
-2. (in the case of `ASSERT_EXIT` and `EXPECT_EXIT`) does the exit status
- satisfy `predicate`? Or (in the case of `ASSERT_DEATH` and `EXPECT_DEATH`)
- is the exit status non-zero? And
-3. does the stderr output match `matcher`?
-
-In particular, if `statement` generates an `ASSERT_*` or `EXPECT_*` failure, it
-will **not** cause the death test to fail, as googletest assertions don't abort
-the process.
-
-### Death Test Naming
-
-{: .callout .important}
-IMPORTANT: We strongly recommend you to follow the convention of naming your
-**test suite** (not test) `*DeathTest` when it contains a death test, as
-demonstrated in the above example. The
-[Death Tests And Threads](#death-tests-and-threads) section below explains why.
-
-If a test fixture class is shared by normal tests and death tests, you can use
-`using` or `typedef` to introduce an alias for the fixture class and avoid
-duplicating its code:
-
-```c++
-class FooTest : public testing::Test { ... };
-
-using FooDeathTest = FooTest;
-
-TEST_F(FooTest, DoesThis) {
- // normal test
-}
-
-TEST_F(FooDeathTest, DoesThat) {
- // death test
-}
-```
-
-### Regular Expression Syntax
-
-On POSIX systems (e.g. Linux, Cygwin, and Mac), googletest uses the
-[POSIX extended regular expression](http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html#tag_09_04)
-syntax. To learn about this syntax, you may want to read this
-[Wikipedia entry](http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions).
-
-On Windows, googletest uses its own simple regular expression implementation. It
-lacks many features. For example, we don't support union (`"x|y"`), grouping
-(`"(xy)"`), brackets (`"[xy]"`), and repetition count (`"x{5,7}"`), among
-others. Below is what we do support (`A` denotes a literal character, period
-(`.`), or a single `\\ ` escape sequence; `x` and `y` denote regular
-expressions.):
-
-Expression | Meaning
----------- | --------------------------------------------------------------
-`c` | matches any literal character `c`
-`\\d` | matches any decimal digit
-`\\D` | matches any character that's not a decimal digit
-`\\f` | matches `\f`
-`\\n` | matches `\n`
-`\\r` | matches `\r`
-`\\s` | matches any ASCII whitespace, including `\n`
-`\\S` | matches any character that's not a whitespace
-`\\t` | matches `\t`
-`\\v` | matches `\v`
-`\\w` | matches any letter, `_`, or decimal digit
-`\\W` | matches any character that `\\w` doesn't match
-`\\c` | matches any literal character `c`, which must be a punctuation
-`.` | matches any single character except `\n`
-`A?` | matches 0 or 1 occurrences of `A`
-`A*` | matches 0 or many occurrences of `A`
-`A+` | matches 1 or many occurrences of `A`
-`^` | matches the beginning of a string (not that of each line)
-`$` | matches the end of a string (not that of each line)
-`xy` | matches `x` followed by `y`
-
-To help you determine which capability is available on your system, googletest
-defines macros to govern which regular expression it is using. The macros are:
-`GTEST_USES_SIMPLE_RE=1` or `GTEST_USES_POSIX_RE=1`. If you want your death
-tests to work in all cases, you can either `#if` on these macros or use the more
-limited syntax only.
-
-### How It Works
-
-See [Death Assertions](reference/assertions.md#death) in the Assertions
-Reference.
-
-### Death Tests And Threads
-
-The reason for the two death test styles has to do with thread safety. Due to
-well-known problems with forking in the presence of threads, death tests should
-be run in a single-threaded context. Sometimes, however, it isn't feasible to
-arrange that kind of environment. For example, statically-initialized modules
-may start threads before main is ever reached. Once threads have been created,
-it may be difficult or impossible to clean them up.
-
-googletest has three features intended to raise awareness of threading issues.
-
-1. A warning is emitted if multiple threads are running when a death test is
- encountered.
-2. Test suites with a name ending in "DeathTest" are run before all other
- tests.
-3. It uses `clone()` instead of `fork()` to spawn the child process on Linux
- (`clone()` is not available on Cygwin and Mac), as `fork()` is more likely
- to cause the child to hang when the parent process has multiple threads.
-
-It's perfectly fine to create threads inside a death test statement; they are
-executed in a separate process and cannot affect the parent.
-
-### Death Test Styles
-
-The "threadsafe" death test style was introduced in order to help mitigate the
-risks of testing in a possibly multithreaded environment. It trades increased
-test execution time (potentially dramatically so) for improved thread safety.
-
-The automated testing framework does not set the style flag. You can choose a
-particular style of death tests by setting the flag programmatically:
-
-```c++
-GTEST_FLAG_SET(death_test_style, "threadsafe")
-```
-
-You can do this in `main()` to set the style for all death tests in the binary,
-or in individual tests. Recall that flags are saved before running each test and
-restored afterwards, so you need not do that yourself. For example:
-
-```c++
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- GTEST_FLAG_SET(death_test_style, "fast");
- return RUN_ALL_TESTS();
-}
-
-TEST(MyDeathTest, TestOne) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- // This test is run in the "threadsafe" style:
- ASSERT_DEATH(ThisShouldDie(), "");
-}
-
-TEST(MyDeathTest, TestTwo) {
- // This test is run in the "fast" style:
- ASSERT_DEATH(ThisShouldDie(), "");
-}
-```
-
-### Caveats
-
-The `statement` argument of `ASSERT_EXIT()` can be any valid C++ statement. If
-it leaves the current function via a `return` statement or by throwing an
-exception, the death test is considered to have failed. Some googletest macros
-may return from the current function (e.g. `ASSERT_TRUE()`), so be sure to avoid
-them in `statement`.
-
-Since `statement` runs in the child process, any in-memory side effect (e.g.
-modifying a variable, releasing memory, etc) it causes will *not* be observable
-in the parent process. In particular, if you release memory in a death test,
-your program will fail the heap check as the parent process will never see the
-memory reclaimed. To solve this problem, you can
-
-1. try not to free memory in a death test;
-2. free the memory again in the parent process; or
-3. do not use the heap checker in your program.
-
-Due to an implementation detail, you cannot place multiple death test assertions
-on the same line; otherwise, compilation will fail with an unobvious error
-message.
-
-Despite the improved thread safety afforded by the "threadsafe" style of death
-test, thread problems such as deadlock are still possible in the presence of
-handlers registered with `pthread_atfork(3)`.
-
-## Using Assertions in Sub-routines
-
-{: .callout .note}
-Note: If you want to put a series of test assertions in a subroutine to check
-for a complex condition, consider using
-[a custom GMock matcher](gmock_cook_book.md#NewMatchers) instead. This lets you
-provide a more readable error message in case of failure and avoid all of the
-issues described below.
-
-### Adding Traces to Assertions
-
-If a test sub-routine is called from several places, when an assertion inside it
-fails, it can be hard to tell which invocation of the sub-routine the failure is
-from. You can alleviate this problem using extra logging or custom failure
-messages, but that usually clutters up your tests. A better solution is to use
-the `SCOPED_TRACE` macro or the `ScopedTrace` utility:
-
-```c++
-SCOPED_TRACE(message);
-```
-
-```c++
-ScopedTrace trace("file_path", line_number, message);
-```
-
-where `message` can be anything streamable to `std::ostream`. `SCOPED_TRACE`
-macro will cause the current file name, line number, and the given message to be
-added in every failure message. `ScopedTrace` accepts explicit file name and
-line number in arguments, which is useful for writing test helpers. The effect
-will be undone when the control leaves the current lexical scope.
-
-For example,
-
-```c++
-10: void Sub1(int n) {
-11: EXPECT_EQ(Bar(n), 1);
-12: EXPECT_EQ(Bar(n + 1), 2);
-13: }
-14:
-15: TEST(FooTest, Bar) {
-16: {
-17: SCOPED_TRACE("A"); // This trace point will be included in
-18: // every failure in this scope.
-19: Sub1(1);
-20: }
-21: // Now it won't.
-22: Sub1(9);
-23: }
-```
-
-could result in messages like these:
-
-```none
-path/to/foo_test.cc:11: Failure
-Value of: Bar(n)
-Expected: 1
- Actual: 2
-Google Test trace:
-path/to/foo_test.cc:17: A
-
-path/to/foo_test.cc:12: Failure
-Value of: Bar(n + 1)
-Expected: 2
- Actual: 3
-```
-
-Without the trace, it would've been difficult to know which invocation of
-`Sub1()` the two failures come from respectively. (You could add an extra
-message to each assertion in `Sub1()` to indicate the value of `n`, but that's
-tedious.)
-
-Some tips on using `SCOPED_TRACE`:
-
-1. With a suitable message, it's often enough to use `SCOPED_TRACE` at the
- beginning of a sub-routine, instead of at each call site.
-2. When calling sub-routines inside a loop, make the loop iterator part of the
- message in `SCOPED_TRACE` such that you can know which iteration the failure
- is from.
-3. Sometimes the line number of the trace point is enough for identifying the
- particular invocation of a sub-routine. In this case, you don't have to
- choose a unique message for `SCOPED_TRACE`. You can simply use `""`.
-4. You can use `SCOPED_TRACE` in an inner scope when there is one in the outer
- scope. In this case, all active trace points will be included in the failure
- messages, in reverse order they are encountered.
-5. The trace dump is clickable in Emacs - hit `return` on a line number and
- you'll be taken to that line in the source file!
-
-### Propagating Fatal Failures
-
-A common pitfall when using `ASSERT_*` and `FAIL*` is not understanding that
-when they fail they only abort the _current function_, not the entire test. For
-example, the following test will segfault:
-
-```c++
-void Subroutine() {
- // Generates a fatal failure and aborts the current function.
- ASSERT_EQ(1, 2);
-
- // The following won't be executed.
- ...
-}
-
-TEST(FooTest, Bar) {
- Subroutine(); // The intended behavior is for the fatal failure
- // in Subroutine() to abort the entire test.
-
- // The actual behavior: the function goes on after Subroutine() returns.
- int* p = nullptr;
- *p = 3; // Segfault!
-}
-```
-
-To alleviate this, googletest provides three different solutions. You could use
-either exceptions, the `(ASSERT|EXPECT)_NO_FATAL_FAILURE` assertions or the
-`HasFatalFailure()` function. They are described in the following two
-subsections.
-
-#### Asserting on Subroutines with an exception
-
-The following code can turn ASSERT-failure into an exception:
-
-```c++
-class ThrowListener : public testing::EmptyTestEventListener {
- void OnTestPartResult(const testing::TestPartResult& result) override {
- if (result.type() == testing::TestPartResult::kFatalFailure) {
- throw testing::AssertionException(result);
- }
- }
-};
-int main(int argc, char** argv) {
- ...
- testing::UnitTest::GetInstance()->listeners().Append(new ThrowListener);
- return RUN_ALL_TESTS();
-}
-```
-
-This listener should be added after other listeners if you have any, otherwise
-they won't see failed `OnTestPartResult`.
-
-#### Asserting on Subroutines
-
-As shown above, if your test calls a subroutine that has an `ASSERT_*` failure
-in it, the test will continue after the subroutine returns. This may not be what
-you want.
-
-Often people want fatal failures to propagate like exceptions. For that
-googletest offers the following macros:
-
-Fatal assertion | Nonfatal assertion | Verifies
-------------------------------------- | ------------------------------------- | --------
-`ASSERT_NO_FATAL_FAILURE(statement);` | `EXPECT_NO_FATAL_FAILURE(statement);` | `statement` doesn't generate any new fatal failures in the current thread.
-
-Only failures in the thread that executes the assertion are checked to determine
-the result of this type of assertions. If `statement` creates new threads,
-failures in these threads are ignored.
-
-Examples:
-
-```c++
-ASSERT_NO_FATAL_FAILURE(Foo());
-
-int i;
-EXPECT_NO_FATAL_FAILURE({
- i = Bar();
-});
-```
-
-Assertions from multiple threads are currently not supported on Windows.
-
-#### Checking for Failures in the Current Test
-
-`HasFatalFailure()` in the `::testing::Test` class returns `true` if an
-assertion in the current test has suffered a fatal failure. This allows
-functions to catch fatal failures in a sub-routine and return early.
-
-```c++
-class Test {
- public:
- ...
- static bool HasFatalFailure();
-};
-```
-
-The typical usage, which basically simulates the behavior of a thrown exception,
-is:
-
-```c++
-TEST(FooTest, Bar) {
- Subroutine();
- // Aborts if Subroutine() had a fatal failure.
- if (HasFatalFailure()) return;
-
- // The following won't be executed.
- ...
-}
-```
-
-If `HasFatalFailure()` is used outside of `TEST()` , `TEST_F()` , or a test
-fixture, you must add the `::testing::Test::` prefix, as in:
-
-```c++
-if (testing::Test::HasFatalFailure()) return;
-```
-
-Similarly, `HasNonfatalFailure()` returns `true` if the current test has at
-least one non-fatal failure, and `HasFailure()` returns `true` if the current
-test has at least one failure of either kind.
-
-## Logging Additional Information
-
-In your test code, you can call `RecordProperty("key", value)` to log additional
-information, where `value` can be either a string or an `int`. The *last* value
-recorded for a key will be emitted to the
-[XML output](#generating-an-xml-report) if you specify one. For example, the
-test
-
-```c++
-TEST_F(WidgetUsageTest, MinAndMaxWidgets) {
- RecordProperty("MaximumWidgets", ComputeMaxUsage());
- RecordProperty("MinimumWidgets", ComputeMinUsage());
-}
-```
-
-will output XML like this:
-
-```xml
- ...
- <testcase name="MinAndMaxWidgets" status="run" time="0.006" classname="WidgetUsageTest" MaximumWidgets="12" MinimumWidgets="9" />
- ...
-```
-
-{: .callout .note}
-> NOTE:
->
-> * `RecordProperty()` is a static member of the `Test` class. Therefore it
-> needs to be prefixed with `::testing::Test::` if used outside of the
-> `TEST` body and the test fixture class.
-> * *`key`* must be a valid XML attribute name, and cannot conflict with the
-> ones already used by googletest (`name`, `status`, `time`, `classname`,
-> `type_param`, and `value_param`).
-> * Calling `RecordProperty()` outside of the lifespan of a test is allowed.
-> If it's called outside of a test but between a test suite's
-> `SetUpTestSuite()` and `TearDownTestSuite()` methods, it will be
-> attributed to the XML element for the test suite. If it's called outside
-> of all test suites (e.g. in a test environment), it will be attributed to
-> the top-level XML element.
-
-## Sharing Resources Between Tests in the Same Test Suite
-
-googletest creates a new test fixture object for each test in order to make
-tests independent and easier to debug. However, sometimes tests use resources
-that are expensive to set up, making the one-copy-per-test model prohibitively
-expensive.
-
-If the tests don't change the resource, there's no harm in their sharing a
-single resource copy. So, in addition to per-test set-up/tear-down, googletest
-also supports per-test-suite set-up/tear-down. To use it:
-
-1. In your test fixture class (say `FooTest` ), declare as `static` some member
- variables to hold the shared resources.
-2. Outside your test fixture class (typically just below it), define those
- member variables, optionally giving them initial values.
-3. In the same test fixture class, define a `static void SetUpTestSuite()`
- function (remember not to spell it as **`SetupTestSuite`** with a small
- `u`!) to set up the shared resources and a `static void TearDownTestSuite()`
- function to tear them down.
-
-That's it! googletest automatically calls `SetUpTestSuite()` before running the
-*first test* in the `FooTest` test suite (i.e. before creating the first
-`FooTest` object), and calls `TearDownTestSuite()` after running the *last test*
-in it (i.e. after deleting the last `FooTest` object). In between, the tests can
-use the shared resources.
-
-Remember that the test order is undefined, so your code can't depend on a test
-preceding or following another. Also, the tests must either not modify the state
-of any shared resource, or, if they do modify the state, they must restore the
-state to its original value before passing control to the next test.
-
-Note that `SetUpTestSuite()` may be called multiple times for a test fixture
-class that has derived classes, so you should not expect code in the function
-body to be run only once. Also, derived classes still have access to shared
-resources defined as static members, so careful consideration is needed when
-managing shared resources to avoid memory leaks.
-
-Here's an example of per-test-suite set-up and tear-down:
-
-```c++
-class FooTest : public testing::Test {
- protected:
- // Per-test-suite set-up.
- // Called before the first test in this test suite.
- // Can be omitted if not needed.
- static void SetUpTestSuite() {
- // Avoid reallocating static objects if called in subclasses of FooTest.
- if (shared_resource_ == nullptr) {
- shared_resource_ = new ...;
- }
- }
-
- // Per-test-suite tear-down.
- // Called after the last test in this test suite.
- // Can be omitted if not needed.
- static void TearDownTestSuite() {
- delete shared_resource_;
- shared_resource_ = nullptr;
- }
-
- // You can define per-test set-up logic as usual.
- void SetUp() override { ... }
-
- // You can define per-test tear-down logic as usual.
- void TearDown() override { ... }
-
- // Some expensive resource shared by all tests.
- static T* shared_resource_;
-};
-
-T* FooTest::shared_resource_ = nullptr;
-
-TEST_F(FooTest, Test1) {
- ... you can refer to shared_resource_ here ...
-}
-
-TEST_F(FooTest, Test2) {
- ... you can refer to shared_resource_ here ...
-}
-```
-
-{: .callout .note}
-NOTE: Though the above code declares `SetUpTestSuite()` protected, it may
-sometimes be necessary to declare it public, such as when using it with
-`TEST_P`.
-
-## Global Set-Up and Tear-Down
-
-Just as you can do set-up and tear-down at the test level and the test suite
-level, you can also do it at the test program level. Here's how.
-
-First, you subclass the `::testing::Environment` class to define a test
-environment, which knows how to set-up and tear-down:
-
-```c++
-class Environment : public ::testing::Environment {
- public:
- ~Environment() override {}
-
- // Override this to define how to set up the environment.
- void SetUp() override {}
-
- // Override this to define how to tear down the environment.
- void TearDown() override {}
-};
-```
-
-Then, you register an instance of your environment class with googletest by
-calling the `::testing::AddGlobalTestEnvironment()` function:
-
-```c++
-Environment* AddGlobalTestEnvironment(Environment* env);
-```
-
-Now, when `RUN_ALL_TESTS()` is called, it first calls the `SetUp()` method of
-each environment object, then runs the tests if none of the environments
-reported fatal failures and `GTEST_SKIP()` was not called. `RUN_ALL_TESTS()`
-always calls `TearDown()` with each environment object, regardless of whether or
-not the tests were run.
-
-It's OK to register multiple environment objects. In this suite, their `SetUp()`
-will be called in the order they are registered, and their `TearDown()` will be
-called in the reverse order.
-
-Note that googletest takes ownership of the registered environment objects.
-Therefore **do not delete them** by yourself.
-
-You should call `AddGlobalTestEnvironment()` before `RUN_ALL_TESTS()` is called,
-probably in `main()`. If you use `gtest_main`, you need to call this before
-`main()` starts for it to take effect. One way to do this is to define a global
-variable like this:
-
-```c++
-testing::Environment* const foo_env =
- testing::AddGlobalTestEnvironment(new FooEnvironment);
-```
-
-However, we strongly recommend you to write your own `main()` and call
-`AddGlobalTestEnvironment()` there, as relying on initialization of global
-variables makes the code harder to read and may cause problems when you register
-multiple environments from different translation units and the environments have
-dependencies among them (remember that the compiler doesn't guarantee the order
-in which global variables from different translation units are initialized).
-
-## Value-Parameterized Tests
-
-*Value-parameterized tests* allow you to test your code with different
-parameters without writing multiple copies of the same test. This is useful in a
-number of situations, for example:
-
-* You have a piece of code whose behavior is affected by one or more
- command-line flags. You want to make sure your code performs correctly for
- various values of those flags.
-* You want to test different implementations of an OO interface.
-* You want to test your code over various inputs (a.k.a. data-driven testing).
- This feature is easy to abuse, so please exercise your good sense when doing
- it!
-
-### How to Write Value-Parameterized Tests
-
-To write value-parameterized tests, first you should define a fixture class. It
-must be derived from both `testing::Test` and `testing::WithParamInterface<T>`
-(the latter is a pure interface), where `T` is the type of your parameter
-values. For convenience, you can just derive the fixture class from
-`testing::TestWithParam<T>`, which itself is derived from both `testing::Test`
-and `testing::WithParamInterface<T>`. `T` can be any copyable type. If it's a
-raw pointer, you are responsible for managing the lifespan of the pointed
-values.
-
-{: .callout .note}
-NOTE: If your test fixture defines `SetUpTestSuite()` or `TearDownTestSuite()`
-they must be declared **public** rather than **protected** in order to use
-`TEST_P`.
-
-```c++
-class FooTest :
- public testing::TestWithParam<const char*> {
- // You can implement all the usual fixture class members here.
- // To access the test parameter, call GetParam() from class
- // TestWithParam<T>.
-};
-
-// Or, when you want to add parameters to a pre-existing fixture class:
-class BaseTest : public testing::Test {
- ...
-};
-class BarTest : public BaseTest,
- public testing::WithParamInterface<const char*> {
- ...
-};
-```
-
-Then, use the `TEST_P` macro to define as many test patterns using this fixture
-as you want. The `_P` suffix is for "parameterized" or "pattern", whichever you
-prefer to think.
-
-```c++
-TEST_P(FooTest, DoesBlah) {
- // Inside a test, access the test parameter with the GetParam() method
- // of the TestWithParam<T> class:
- EXPECT_TRUE(foo.Blah(GetParam()));
- ...
-}
-
-TEST_P(FooTest, HasBlahBlah) {
- ...
-}
-```
-
-Finally, you can use the `INSTANTIATE_TEST_SUITE_P` macro to instantiate the
-test suite with any set of parameters you want. GoogleTest defines a number of
-functions for generating test parameters—see details at
-[`INSTANTIATE_TEST_SUITE_P`](reference/testing.md#INSTANTIATE_TEST_SUITE_P) in
-the Testing Reference.
-
-For example, the following statement will instantiate tests from the `FooTest`
-test suite each with parameter values `"meeny"`, `"miny"`, and `"moe"` using the
-[`Values`](reference/testing.md#param-generators) parameter generator:
-
-```c++
-INSTANTIATE_TEST_SUITE_P(MeenyMinyMoe,
- FooTest,
- testing::Values("meeny", "miny", "moe"));
-```
-
-{: .callout .note}
-NOTE: The code above must be placed at global or namespace scope, not at
-function scope.
-
-The first argument to `INSTANTIATE_TEST_SUITE_P` is a unique name for the
-instantiation of the test suite. The next argument is the name of the test
-pattern, and the last is the
-[parameter generator](reference/testing.md#param-generators).
-
-You can instantiate a test pattern more than once, so to distinguish different
-instances of the pattern, the instantiation name is added as a prefix to the
-actual test suite name. Remember to pick unique prefixes for different
-instantiations. The tests from the instantiation above will have these names:
-
-* `MeenyMinyMoe/FooTest.DoesBlah/0` for `"meeny"`
-* `MeenyMinyMoe/FooTest.DoesBlah/1` for `"miny"`
-* `MeenyMinyMoe/FooTest.DoesBlah/2` for `"moe"`
-* `MeenyMinyMoe/FooTest.HasBlahBlah/0` for `"meeny"`
-* `MeenyMinyMoe/FooTest.HasBlahBlah/1` for `"miny"`
-* `MeenyMinyMoe/FooTest.HasBlahBlah/2` for `"moe"`
-
-You can use these names in [`--gtest_filter`](#running-a-subset-of-the-tests).
-
-The following statement will instantiate all tests from `FooTest` again, each
-with parameter values `"cat"` and `"dog"` using the
-[`ValuesIn`](reference/testing.md#param-generators) parameter generator:
-
-```c++
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_SUITE_P(Pets, FooTest, testing::ValuesIn(pets));
-```
-
-The tests from the instantiation above will have these names:
-
-* `Pets/FooTest.DoesBlah/0` for `"cat"`
-* `Pets/FooTest.DoesBlah/1` for `"dog"`
-* `Pets/FooTest.HasBlahBlah/0` for `"cat"`
-* `Pets/FooTest.HasBlahBlah/1` for `"dog"`
-
-Please note that `INSTANTIATE_TEST_SUITE_P` will instantiate *all* tests in the
-given test suite, whether their definitions come before or *after* the
-`INSTANTIATE_TEST_SUITE_P` statement.
-
-Additionally, by default, every `TEST_P` without a corresponding
-`INSTANTIATE_TEST_SUITE_P` causes a failing test in test suite
-`GoogleTestVerification`. If you have a test suite where that omission is not an
-error, for example it is in a library that may be linked in for other reasons or
-where the list of test cases is dynamic and may be empty, then this check can be
-suppressed by tagging the test suite:
-
-```c++
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(FooTest);
-```
-
-You can see [sample7_unittest.cc] and [sample8_unittest.cc] for more examples.
-
-[sample7_unittest.cc]: https://github.com/google/googletest/blob/master/googletest/samples/sample7_unittest.cc "Parameterized Test example"
-[sample8_unittest.cc]: https://github.com/google/googletest/blob/master/googletest/samples/sample8_unittest.cc "Parameterized Test example with multiple parameters"
-
-### Creating Value-Parameterized Abstract Tests
-
-In the above, we define and instantiate `FooTest` in the *same* source file.
-Sometimes you may want to define value-parameterized tests in a library and let
-other people instantiate them later. This pattern is known as *abstract tests*.
-As an example of its application, when you are designing an interface you can
-write a standard suite of abstract tests (perhaps using a factory function as
-the test parameter) that all implementations of the interface are expected to
-pass. When someone implements the interface, they can instantiate your suite to
-get all the interface-conformance tests for free.
-
-To define abstract tests, you should organize your code like this:
-
-1. Put the definition of the parameterized test fixture class (e.g. `FooTest`)
- in a header file, say `foo_param_test.h`. Think of this as *declaring* your
- abstract tests.
-2. Put the `TEST_P` definitions in `foo_param_test.cc`, which includes
- `foo_param_test.h`. Think of this as *implementing* your abstract tests.
-
-Once they are defined, you can instantiate them by including `foo_param_test.h`,
-invoking `INSTANTIATE_TEST_SUITE_P()`, and depending on the library target that
-contains `foo_param_test.cc`. You can instantiate the same abstract test suite
-multiple times, possibly in different source files.
-
-### Specifying Names for Value-Parameterized Test Parameters
-
-The optional last argument to `INSTANTIATE_TEST_SUITE_P()` allows the user to
-specify a function or functor that generates custom test name suffixes based on
-the test parameters. The function should accept one argument of type
-`testing::TestParamInfo<class ParamType>`, and return `std::string`.
-
-`testing::PrintToStringParamName` is a builtin test suffix generator that
-returns the value of `testing::PrintToString(GetParam())`. It does not work for
-`std::string` or C strings.
-
-{: .callout .note}
-NOTE: test names must be non-empty, unique, and may only contain ASCII
-alphanumeric characters. In particular, they
-[should not contain underscores](faq.md#why-should-test-suite-names-and-test-names-not-contain-underscore)
-
-```c++
-class MyTestSuite : public testing::TestWithParam<int> {};
-
-TEST_P(MyTestSuite, MyTest)
-{
- std::cout << "Example Test Param: " << GetParam() << std::endl;
-}
-
-INSTANTIATE_TEST_SUITE_P(MyGroup, MyTestSuite, testing::Range(0, 10),
- testing::PrintToStringParamName());
-```
-
-Providing a custom functor allows for more control over test parameter name
-generation, especially for types where the automatic conversion does not
-generate helpful parameter names (e.g. strings as demonstrated above). The
-following example illustrates this for multiple parameters, an enumeration type
-and a string, and also demonstrates how to combine generators. It uses a lambda
-for conciseness:
-
-```c++
-enum class MyType { MY_FOO = 0, MY_BAR = 1 };
-
-class MyTestSuite : public testing::TestWithParam<std::tuple<MyType, std::string>> {
-};
-
-INSTANTIATE_TEST_SUITE_P(
- MyGroup, MyTestSuite,
- testing::Combine(
- testing::Values(MyType::MY_FOO, MyType::MY_BAR),
- testing::Values("A", "B")),
- [](const testing::TestParamInfo<MyTestSuite::ParamType>& info) {
- std::string name = absl::StrCat(
- std::get<0>(info.param) == MyType::MY_FOO ? "Foo" : "Bar",
- std::get<1>(info.param));
- absl::c_replace_if(name, [](char c) { return !std::isalnum(c); }, '_');
- return name;
- });
-```
-
-## Typed Tests
-
-Suppose you have multiple implementations of the same interface and want to make
-sure that all of them satisfy some common requirements. Or, you may have defined
-several types that are supposed to conform to the same "concept" and you want to
-verify it. In both cases, you want the same test logic repeated for different
-types.
-
-While you can write one `TEST` or `TEST_F` for each type you want to test (and
-you may even factor the test logic into a function template that you invoke from
-the `TEST`), it's tedious and doesn't scale: if you want `m` tests over `n`
-types, you'll end up writing `m*n` `TEST`s.
-
-*Typed tests* allow you to repeat the same test logic over a list of types. You
-only need to write the test logic once, although you must know the type list
-when writing typed tests. Here's how you do it:
-
-First, define a fixture class template. It should be parameterized by a type.
-Remember to derive it from `::testing::Test`:
-
-```c++
-template <typename T>
-class FooTest : public testing::Test {
- public:
- ...
- using List = std::list<T>;
- static T shared_;
- T value_;
-};
-```
-
-Next, associate a list of types with the test suite, which will be repeated for
-each type in the list:
-
-```c++
-using MyTypes = ::testing::Types<char, int, unsigned int>;
-TYPED_TEST_SUITE(FooTest, MyTypes);
-```
-
-The type alias (`using` or `typedef`) is necessary for the `TYPED_TEST_SUITE`
-macro to parse correctly. Otherwise the compiler will think that each comma in
-the type list introduces a new macro argument.
-
-Then, use `TYPED_TEST()` instead of `TEST_F()` to define a typed test for this
-test suite. You can repeat this as many times as you want:
-
-```c++
-TYPED_TEST(FooTest, DoesBlah) {
- // Inside a test, refer to the special name TypeParam to get the type
- // parameter. Since we are inside a derived class template, C++ requires
- // us to visit the members of FooTest via 'this'.
- TypeParam n = this->value_;
-
- // To visit static members of the fixture, add the 'TestFixture::'
- // prefix.
- n += TestFixture::shared_;
-
- // To refer to typedefs in the fixture, add the 'typename TestFixture::'
- // prefix. The 'typename' is required to satisfy the compiler.
- typename TestFixture::List values;
-
- values.push_back(n);
- ...
-}
-
-TYPED_TEST(FooTest, HasPropertyA) { ... }
-```
-
-You can see [sample6_unittest.cc] for a complete example.
-
-[sample6_unittest.cc]: https://github.com/google/googletest/blob/master/googletest/samples/sample6_unittest.cc "Typed Test example"
-
-## Type-Parameterized Tests
-
-*Type-parameterized tests* are like typed tests, except that they don't require
-you to know the list of types ahead of time. Instead, you can define the test
-logic first and instantiate it with different type lists later. You can even
-instantiate it more than once in the same program.
-
-If you are designing an interface or concept, you can define a suite of
-type-parameterized tests to verify properties that any valid implementation of
-the interface/concept should have. Then, the author of each implementation can
-just instantiate the test suite with their type to verify that it conforms to
-the requirements, without having to write similar tests repeatedly. Here's an
-example:
-
-First, define a fixture class template, as we did with typed tests:
-
-```c++
-template <typename T>
-class FooTest : public testing::Test {
- ...
-};
-```
-
-Next, declare that you will define a type-parameterized test suite:
-
-```c++
-TYPED_TEST_SUITE_P(FooTest);
-```
-
-Then, use `TYPED_TEST_P()` to define a type-parameterized test. You can repeat
-this as many times as you want:
-
-```c++
-TYPED_TEST_P(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- TypeParam n = 0;
- ...
-}
-
-TYPED_TEST_P(FooTest, HasPropertyA) { ... }
-```
-
-Now the tricky part: you need to register all test patterns using the
-`REGISTER_TYPED_TEST_SUITE_P` macro before you can instantiate them. The first
-argument of the macro is the test suite name; the rest are the names of the
-tests in this test suite:
-
-```c++
-REGISTER_TYPED_TEST_SUITE_P(FooTest,
- DoesBlah, HasPropertyA);
-```
-
-Finally, you are free to instantiate the pattern with the types you want. If you
-put the above code in a header file, you can `#include` it in multiple C++
-source files and instantiate it multiple times.
-
-```c++
-using MyTypes = ::testing::Types<char, int, unsigned int>;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes);
-```
-
-To distinguish different instances of the pattern, the first argument to the
-`INSTANTIATE_TYPED_TEST_SUITE_P` macro is a prefix that will be added to the
-actual test suite name. Remember to pick unique prefixes for different
-instances.
-
-In the special case where the type list contains only one type, you can write
-that type directly without `::testing::Types<...>`, like this:
-
-```c++
-INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int);
-```
-
-You can see [sample6_unittest.cc] for a complete example.
-
-## Testing Private Code
-
-If you change your software's internal implementation, your tests should not
-break as long as the change is not observable by users. Therefore, **per the
-black-box testing principle, most of the time you should test your code through
-its public interfaces.**
-
-**If you still find yourself needing to test internal implementation code,
-consider if there's a better design.** The desire to test internal
-implementation is often a sign that the class is doing too much. Consider
-extracting an implementation class, and testing it. Then use that implementation
-class in the original class.
-
-If you absolutely have to test non-public interface code though, you can. There
-are two cases to consider:
-
-* Static functions ( *not* the same as static member functions!) or unnamed
- namespaces, and
-* Private or protected class members
-
-To test them, we use the following special techniques:
-
-* Both static functions and definitions/declarations in an unnamed namespace
- are only visible within the same translation unit. To test them, you can
- `#include` the entire `.cc` file being tested in your `*_test.cc` file.
- (#including `.cc` files is not a good way to reuse code - you should not do
- this in production code!)
-
- However, a better approach is to move the private code into the
- `foo::internal` namespace, where `foo` is the namespace your project
- normally uses, and put the private declarations in a `*-internal.h` file.
- Your production `.cc` files and your tests are allowed to include this
- internal header, but your clients are not. This way, you can fully test your
- internal implementation without leaking it to your clients.
-
-* Private class members are only accessible from within the class or by
- friends. To access a class' private members, you can declare your test
- fixture as a friend to the class and define accessors in your fixture. Tests
- using the fixture can then access the private members of your production
- class via the accessors in the fixture. Note that even though your fixture
- is a friend to your production class, your tests are not automatically
- friends to it, as they are technically defined in sub-classes of the
- fixture.
-
- Another way to test private members is to refactor them into an
- implementation class, which is then declared in a `*-internal.h` file. Your
- clients aren't allowed to include this header but your tests can. Such is
- called the
- [Pimpl](https://www.gamedev.net/articles/programming/general-and-gameplay-programming/the-c-pimpl-r1794/)
- (Private Implementation) idiom.
-
- Or, you can declare an individual test as a friend of your class by adding
- this line in the class body:
-
- ```c++
- FRIEND_TEST(TestSuiteName, TestName);
- ```
-
- For example,
-
- ```c++
- // foo.h
- class Foo {
- ...
- private:
- FRIEND_TEST(FooTest, BarReturnsZeroOnNull);
-
- int Bar(void* x);
- };
-
- // foo_test.cc
- ...
- TEST(FooTest, BarReturnsZeroOnNull) {
- Foo foo;
- EXPECT_EQ(foo.Bar(NULL), 0); // Uses Foo's private member Bar().
- }
- ```
-
- Pay special attention when your class is defined in a namespace. If you want
- your test fixtures and tests to be friends of your class, then they must be
- defined in the exact same namespace (no anonymous or inline namespaces).
-
- For example, if the code to be tested looks like:
-
- ```c++
- namespace my_namespace {
-
- class Foo {
- friend class FooTest;
- FRIEND_TEST(FooTest, Bar);
- FRIEND_TEST(FooTest, Baz);
- ... definition of the class Foo ...
- };
-
- } // namespace my_namespace
- ```
-
- Your test code should be something like:
-
- ```c++
- namespace my_namespace {
-
- class FooTest : public testing::Test {
- protected:
- ...
- };
-
- TEST_F(FooTest, Bar) { ... }
- TEST_F(FooTest, Baz) { ... }
-
- } // namespace my_namespace
- ```
-
-## "Catching" Failures
-
-If you are building a testing utility on top of googletest, you'll want to test
-your utility. What framework would you use to test it? googletest, of course.
-
-The challenge is to verify that your testing utility reports failures correctly.
-In frameworks that report a failure by throwing an exception, you could catch
-the exception and assert on it. But googletest doesn't use exceptions, so how do
-we test that a piece of code generates an expected failure?
-
-`"gtest/gtest-spi.h"` contains some constructs to do this.
-After #including this header, you can use
-
-```c++
- EXPECT_FATAL_FAILURE(statement, substring);
-```
-
-to assert that `statement` generates a fatal (e.g. `ASSERT_*`) failure in the
-current thread whose message contains the given `substring`, or use
-
-```c++
- EXPECT_NONFATAL_FAILURE(statement, substring);
-```
-
-if you are expecting a non-fatal (e.g. `EXPECT_*`) failure.
-
-Only failures in the current thread are checked to determine the result of this
-type of expectations. If `statement` creates new threads, failures in these
-threads are also ignored. If you want to catch failures in other threads as
-well, use one of the following macros instead:
-
-```c++
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substring);
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substring);
-```
-
-{: .callout .note}
-NOTE: Assertions from multiple threads are currently not supported on Windows.
-
-For technical reasons, there are some caveats:
-
-1. You cannot stream a failure message to either macro.
-
-2. `statement` in `EXPECT_FATAL_FAILURE{_ON_ALL_THREADS}()` cannot reference
- local non-static variables or non-static members of `this` object.
-
-3. `statement` in `EXPECT_FATAL_FAILURE{_ON_ALL_THREADS}()` cannot return a
- value.
-
-## Registering tests programmatically
-
-The `TEST` macros handle the vast majority of all use cases, but there are few
-where runtime registration logic is required. For those cases, the framework
-provides the `::testing::RegisterTest` that allows callers to register arbitrary
-tests dynamically.
-
-This is an advanced API only to be used when the `TEST` macros are insufficient.
-The macros should be preferred when possible, as they avoid most of the
-complexity of calling this function.
-
-It provides the following signature:
-
-```c++
-template <typename Factory>
-TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
- const char* type_param, const char* value_param,
- const char* file, int line, Factory factory);
-```
-
-The `factory` argument is a factory callable (move-constructible) object or
-function pointer that creates a new instance of the Test object. It handles
-ownership to the caller. The signature of the callable is `Fixture*()`, where
-`Fixture` is the test fixture class for the test. All tests registered with the
-same `test_suite_name` must return the same fixture type. This is checked at
-runtime.
-
-The framework will infer the fixture class from the factory and will call the
-`SetUpTestSuite` and `TearDownTestSuite` for it.
-
-Must be called before `RUN_ALL_TESTS()` is invoked, otherwise behavior is
-undefined.
-
-Use case example:
-
-```c++
-class MyFixture : public testing::Test {
- public:
- // All of these optional, just like in regular macro usage.
- static void SetUpTestSuite() { ... }
- static void TearDownTestSuite() { ... }
- void SetUp() override { ... }
- void TearDown() override { ... }
-};
-
-class MyTest : public MyFixture {
- public:
- explicit MyTest(int data) : data_(data) {}
- void TestBody() override { ... }
-
- private:
- int data_;
-};
-
-void RegisterMyTests(const std::vector<int>& values) {
- for (int v : values) {
- testing::RegisterTest(
- "MyFixture", ("Test" + std::to_string(v)).c_str(), nullptr,
- std::to_string(v).c_str(),
- __FILE__, __LINE__,
- // Important to use the fixture type as the return type here.
- [=]() -> MyFixture* { return new MyTest(v); });
- }
-}
-...
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- std::vector<int> values_to_test = LoadValuesFromConfig();
- RegisterMyTests(values_to_test);
- ...
- return RUN_ALL_TESTS();
-}
-```
-
-## Getting the Current Test's Name
-
-Sometimes a function may need to know the name of the currently running test.
-For example, you may be using the `SetUp()` method of your test fixture to set
-the golden file name based on which test is running. The
-[`TestInfo`](reference/testing.md#TestInfo) class has this information.
-
-To obtain a `TestInfo` object for the currently running test, call
-`current_test_info()` on the [`UnitTest`](reference/testing.md#UnitTest)
-singleton object:
-
-```c++
- // Gets information about the currently running test.
- // Do NOT delete the returned object - it's managed by the UnitTest class.
- const testing::TestInfo* const test_info =
- testing::UnitTest::GetInstance()->current_test_info();
-
- printf("We are in test %s of test suite %s.\n",
- test_info->name(),
- test_info->test_suite_name());
-```
-
-`current_test_info()` returns a null pointer if no test is running. In
-particular, you cannot find the test suite name in `SetUpTestSuite()`,
-`TearDownTestSuite()` (where you know the test suite name implicitly), or
-functions called from them.
-
-## Extending googletest by Handling Test Events
-
-googletest provides an **event listener API** to let you receive notifications
-about the progress of a test program and test failures. The events you can
-listen to include the start and end of the test program, a test suite, or a test
-method, among others. You may use this API to augment or replace the standard
-console output, replace the XML output, or provide a completely different form
-of output, such as a GUI or a database. You can also use test events as
-checkpoints to implement a resource leak checker, for example.
-
-### Defining Event Listeners
-
-To define a event listener, you subclass either
-[`testing::TestEventListener`](reference/testing.md#TestEventListener) or
-[`testing::EmptyTestEventListener`](reference/testing.md#EmptyTestEventListener)
-The former is an (abstract) interface, where *each pure virtual method can be
-overridden to handle a test event* (For example, when a test starts, the
-`OnTestStart()` method will be called.). The latter provides an empty
-implementation of all methods in the interface, such that a subclass only needs
-to override the methods it cares about.
-
-When an event is fired, its context is passed to the handler function as an
-argument. The following argument types are used:
-
-* UnitTest reflects the state of the entire test program,
-* TestSuite has information about a test suite, which can contain one or more
- tests,
-* TestInfo contains the state of a test, and
-* TestPartResult represents the result of a test assertion.
-
-An event handler function can examine the argument it receives to find out
-interesting information about the event and the test program's state.
-
-Here's an example:
-
-```c++
- class MinimalistPrinter : public testing::EmptyTestEventListener {
- // Called before a test starts.
- void OnTestStart(const testing::TestInfo& test_info) override {
- printf("*** Test %s.%s starting.\n",
- test_info.test_suite_name(), test_info.name());
- }
-
- // Called after a failed assertion or a SUCCESS().
- void OnTestPartResult(const testing::TestPartResult& test_part_result) override {
- printf("%s in %s:%d\n%s\n",
- test_part_result.failed() ? "*** Failure" : "Success",
- test_part_result.file_name(),
- test_part_result.line_number(),
- test_part_result.summary());
- }
-
- // Called after a test ends.
- void OnTestEnd(const testing::TestInfo& test_info) override {
- printf("*** Test %s.%s ending.\n",
- test_info.test_suite_name(), test_info.name());
- }
- };
-```
-
-### Using Event Listeners
-
-To use the event listener you have defined, add an instance of it to the
-googletest event listener list (represented by class
-[`TestEventListeners`](reference/testing.md#TestEventListeners) - note the "s"
-at the end of the name) in your `main()` function, before calling
-`RUN_ALL_TESTS()`:
-
-```c++
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- // Gets hold of the event listener list.
- testing::TestEventListeners& listeners =
- testing::UnitTest::GetInstance()->listeners();
- // Adds a listener to the end. googletest takes the ownership.
- listeners.Append(new MinimalistPrinter);
- return RUN_ALL_TESTS();
-}
-```
-
-There's only one problem: the default test result printer is still in effect, so
-its output will mingle with the output from your minimalist printer. To suppress
-the default printer, just release it from the event listener list and delete it.
-You can do so by adding one line:
-
-```c++
- ...
- delete listeners.Release(listeners.default_result_printer());
- listeners.Append(new MinimalistPrinter);
- return RUN_ALL_TESTS();
-```
-
-Now, sit back and enjoy a completely different output from your tests. For more
-details, see [sample9_unittest.cc].
-
-[sample9_unittest.cc]: https://github.com/google/googletest/blob/master/googletest/samples/sample9_unittest.cc "Event listener example"
-
-You may append more than one listener to the list. When an `On*Start()` or
-`OnTestPartResult()` event is fired, the listeners will receive it in the order
-they appear in the list (since new listeners are added to the end of the list,
-the default text printer and the default XML generator will receive the event
-first). An `On*End()` event will be received by the listeners in the *reverse*
-order. This allows output by listeners added later to be framed by output from
-listeners added earlier.
-
-### Generating Failures in Listeners
-
-You may use failure-raising macros (`EXPECT_*()`, `ASSERT_*()`, `FAIL()`, etc)
-when processing an event. There are some restrictions:
-
-1. You cannot generate any failure in `OnTestPartResult()` (otherwise it will
- cause `OnTestPartResult()` to be called recursively).
-2. A listener that handles `OnTestPartResult()` is not allowed to generate any
- failure.
-
-When you add listeners to the listener list, you should put listeners that
-handle `OnTestPartResult()` *before* listeners that can generate failures. This
-ensures that failures generated by the latter are attributed to the right test
-by the former.
-
-See [sample10_unittest.cc] for an example of a failure-raising listener.
-
-[sample10_unittest.cc]: https://github.com/google/googletest/blob/master/googletest/samples/sample10_unittest.cc "Failure-raising listener example"
-
-## Running Test Programs: Advanced Options
-
-googletest test programs are ordinary executables. Once built, you can run them
-directly and affect their behavior via the following environment variables
-and/or command line flags. For the flags to work, your programs must call
-`::testing::InitGoogleTest()` before calling `RUN_ALL_TESTS()`.
-
-To see a list of supported flags and their usage, please run your test program
-with the `--help` flag. You can also use `-h`, `-?`, or `/?` for short.
-
-If an option is specified both by an environment variable and by a flag, the
-latter takes precedence.
-
-### Selecting Tests
-
-#### Listing Test Names
-
-Sometimes it is necessary to list the available tests in a program before
-running them so that a filter may be applied if needed. Including the flag
-`--gtest_list_tests` overrides all other flags and lists tests in the following
-format:
-
-```none
-TestSuite1.
- TestName1
- TestName2
-TestSuite2.
- TestName
-```
-
-None of the tests listed are actually run if the flag is provided. There is no
-corresponding environment variable for this flag.
-
-#### Running a Subset of the Tests
-
-By default, a googletest program runs all tests the user has defined. Sometimes,
-you want to run only a subset of the tests (e.g. for debugging or quickly
-verifying a change). If you set the `GTEST_FILTER` environment variable or the
-`--gtest_filter` flag to a filter string, googletest will only run the tests
-whose full names (in the form of `TestSuiteName.TestName`) match the filter.
-
-The format of a filter is a '`:`'-separated list of wildcard patterns (called
-the *positive patterns*) optionally followed by a '`-`' and another
-'`:`'-separated pattern list (called the *negative patterns*). A test matches
-the filter if and only if it matches any of the positive patterns but does not
-match any of the negative patterns.
-
-A pattern may contain `'*'` (matches any string) or `'?'` (matches any single
-character). For convenience, the filter `'*-NegativePatterns'` can be also
-written as `'-NegativePatterns'`.
-
-For example:
-
-* `./foo_test` Has no flag, and thus runs all its tests.
-* `./foo_test --gtest_filter=*` Also runs everything, due to the single
- match-everything `*` value.
-* `./foo_test --gtest_filter=FooTest.*` Runs everything in test suite
- `FooTest` .
-* `./foo_test --gtest_filter=*Null*:*Constructor*` Runs any test whose full
- name contains either `"Null"` or `"Constructor"` .
-* `./foo_test --gtest_filter=-*DeathTest.*` Runs all non-death tests.
-* `./foo_test --gtest_filter=FooTest.*-FooTest.Bar` Runs everything in test
- suite `FooTest` except `FooTest.Bar`.
-* `./foo_test --gtest_filter=FooTest.*:BarTest.*-FooTest.Bar:BarTest.Foo` Runs
- everything in test suite `FooTest` except `FooTest.Bar` and everything in
- test suite `BarTest` except `BarTest.Foo`.
-
-#### Stop test execution upon first failure
-
-By default, a googletest program runs all tests the user has defined. In some
-cases (e.g. iterative test development & execution) it may be desirable stop
-test execution upon first failure (trading improved latency for completeness).
-If `GTEST_FAIL_FAST` environment variable or `--gtest_fail_fast` flag is set,
-the test runner will stop execution as soon as the first test failure is found.
-
-#### Temporarily Disabling Tests
-
-If you have a broken test that you cannot fix right away, you can add the
-`DISABLED_` prefix to its name. This will exclude it from execution. This is
-better than commenting out the code or using `#if 0`, as disabled tests are
-still compiled (and thus won't rot).
-
-If you need to disable all tests in a test suite, you can either add `DISABLED_`
-to the front of the name of each test, or alternatively add it to the front of
-the test suite name.
-
-For example, the following tests won't be run by googletest, even though they
-will still be compiled:
-
-```c++
-// Tests that Foo does Abc.
-TEST(FooTest, DISABLED_DoesAbc) { ... }
-
-class DISABLED_BarTest : public testing::Test { ... };
-
-// Tests that Bar does Xyz.
-TEST_F(DISABLED_BarTest, DoesXyz) { ... }
-```
-
-{: .callout .note}
-NOTE: This feature should only be used for temporary pain-relief. You still have
-to fix the disabled tests at a later date. As a reminder, googletest will print
-a banner warning you if a test program contains any disabled tests.
-
-{: .callout .tip}
-TIP: You can easily count the number of disabled tests you have using
-`grep`. This number can be used as a metric for
-improving your test quality.
-
-#### Temporarily Enabling Disabled Tests
-
-To include disabled tests in test execution, just invoke the test program with
-the `--gtest_also_run_disabled_tests` flag or set the
-`GTEST_ALSO_RUN_DISABLED_TESTS` environment variable to a value other than `0`.
-You can combine this with the `--gtest_filter` flag to further select which
-disabled tests to run.
-
-### Repeating the Tests
-
-Once in a while you'll run into a test whose result is hit-or-miss. Perhaps it
-will fail only 1% of the time, making it rather hard to reproduce the bug under
-a debugger. This can be a major source of frustration.
-
-The `--gtest_repeat` flag allows you to repeat all (or selected) test methods in
-a program many times. Hopefully, a flaky test will eventually fail and give you
-a chance to debug. Here's how to use it:
-
-```none
-$ foo_test --gtest_repeat=1000
-Repeat foo_test 1000 times and don't stop at failures.
-
-$ foo_test --gtest_repeat=-1
-A negative count means repeating forever.
-
-$ foo_test --gtest_repeat=1000 --gtest_break_on_failure
-Repeat foo_test 1000 times, stopping at the first failure. This
-is especially useful when running under a debugger: when the test
-fails, it will drop into the debugger and you can then inspect
-variables and stacks.
-
-$ foo_test --gtest_repeat=1000 --gtest_filter=FooBar.*
-Repeat the tests whose name matches the filter 1000 times.
-```
-
-If your test program contains
-[global set-up/tear-down](#global-set-up-and-tear-down) code, it will be
-repeated in each iteration as well, as the flakiness may be in it. You can also
-specify the repeat count by setting the `GTEST_REPEAT` environment variable.
-
-### Shuffling the Tests
-
-You can specify the `--gtest_shuffle` flag (or set the `GTEST_SHUFFLE`
-environment variable to `1`) to run the tests in a program in a random order.
-This helps to reveal bad dependencies between tests.
-
-By default, googletest uses a random seed calculated from the current time.
-Therefore you'll get a different order every time. The console output includes
-the random seed value, such that you can reproduce an order-related test failure
-later. To specify the random seed explicitly, use the `--gtest_random_seed=SEED`
-flag (or set the `GTEST_RANDOM_SEED` environment variable), where `SEED` is an
-integer in the range [0, 99999]. The seed value 0 is special: it tells
-googletest to do the default behavior of calculating the seed from the current
-time.
-
-If you combine this with `--gtest_repeat=N`, googletest will pick a different
-random seed and re-shuffle the tests in each iteration.
-
-### Distributing Test Functions to Multiple Machines
-
-If you have more than one machine you can use to run a test program, you might
-want to run the test functions in parallel and get the result faster. We call
-this technique *sharding*, where each machine is called a *shard*.
-
-GoogleTest is compatible with test sharding. To take advantage of this feature,
-your test runner (not part of GoogleTest) needs to do the following:
-
-1. Allocate a number of machines (shards) to run the tests.
-1. On each shard, set the `GTEST_TOTAL_SHARDS` environment variable to the total
- number of shards. It must be the same for all shards.
-1. On each shard, set the `GTEST_SHARD_INDEX` environment variable to the index
- of the shard. Different shards must be assigned different indices, which
- must be in the range `[0, GTEST_TOTAL_SHARDS - 1]`.
-1. Run the same test program on all shards. When GoogleTest sees the above two
- environment variables, it will select a subset of the test functions to run.
- Across all shards, each test function in the program will be run exactly
- once.
-1. Wait for all shards to finish, then collect and report the results.
-
-Your project may have tests that were written without GoogleTest and thus don't
-understand this protocol. In order for your test runner to figure out which test
-supports sharding, it can set the environment variable `GTEST_SHARD_STATUS_FILE`
-to a non-existent file path. If a test program supports sharding, it will create
-this file to acknowledge that fact; otherwise it will not create it. The actual
-contents of the file are not important at this time, although we may put some
-useful information in it in the future.
-
-Here's an example to make it clear. Suppose you have a test program `foo_test`
-that contains the following 5 test functions:
-
-```
-TEST(A, V)
-TEST(A, W)
-TEST(B, X)
-TEST(B, Y)
-TEST(B, Z)
-```
-
-Suppose you have 3 machines at your disposal. To run the test functions in
-parallel, you would set `GTEST_TOTAL_SHARDS` to 3 on all machines, and set
-`GTEST_SHARD_INDEX` to 0, 1, and 2 on the machines respectively. Then you would
-run the same `foo_test` on each machine.
-
-GoogleTest reserves the right to change how the work is distributed across the
-shards, but here's one possible scenario:
-
-* Machine #0 runs `A.V` and `B.X`.
-* Machine #1 runs `A.W` and `B.Y`.
-* Machine #2 runs `B.Z`.
-
-### Controlling Test Output
-
-#### Colored Terminal Output
-
-googletest can use colors in its terminal output to make it easier to spot the
-important information:
-
-<pre>...
-<font color="green">[----------]</font> 1 test from FooTest
-<font color="green">[ RUN ]</font> FooTest.DoesAbc
-<font color="green">[ OK ]</font> FooTest.DoesAbc
-<font color="green">[----------]</font> 2 tests from BarTest
-<font color="green">[ RUN ]</font> BarTest.HasXyzProperty
-<font color="green">[ OK ]</font> BarTest.HasXyzProperty
-<font color="green">[ RUN ]</font> BarTest.ReturnsTrueOnSuccess
-... some error messages ...
-<font color="red">[ FAILED ]</font> BarTest.ReturnsTrueOnSuccess
-...
-<font color="green">[==========]</font> 30 tests from 14 test suites ran.
-<font color="green">[ PASSED ]</font> 28 tests.
-<font color="red">[ FAILED ]</font> 2 tests, listed below:
-<font color="red">[ FAILED ]</font> BarTest.ReturnsTrueOnSuccess
-<font color="red">[ FAILED ]</font> AnotherTest.DoesXyz
-
- 2 FAILED TESTS
-</pre>
-
-You can set the `GTEST_COLOR` environment variable or the `--gtest_color`
-command line flag to `yes`, `no`, or `auto` (the default) to enable colors,
-disable colors, or let googletest decide. When the value is `auto`, googletest
-will use colors if and only if the output goes to a terminal and (on non-Windows
-platforms) the `TERM` environment variable is set to `xterm` or `xterm-color`.
-
-#### Suppressing test passes
-
-By default, googletest prints 1 line of output for each test, indicating if it
-passed or failed. To show only test failures, run the test program with
-`--gtest_brief=1`, or set the GTEST_BRIEF environment variable to `1`.
-
-#### Suppressing the Elapsed Time
-
-By default, googletest prints the time it takes to run each test. To disable
-that, run the test program with the `--gtest_print_time=0` command line flag, or
-set the GTEST_PRINT_TIME environment variable to `0`.
-
-#### Suppressing UTF-8 Text Output
-
-In case of assertion failures, googletest prints expected and actual values of
-type `string` both as hex-encoded strings as well as in readable UTF-8 text if
-they contain valid non-ASCII UTF-8 characters. If you want to suppress the UTF-8
-text because, for example, you don't have an UTF-8 compatible output medium, run
-the test program with `--gtest_print_utf8=0` or set the `GTEST_PRINT_UTF8`
-environment variable to `0`.
-
-#### Generating an XML Report
-
-googletest can emit a detailed XML report to a file in addition to its normal
-textual output. The report contains the duration of each test, and thus can help
-you identify slow tests.
-
-To generate the XML report, set the `GTEST_OUTPUT` environment variable or the
-`--gtest_output` flag to the string `"xml:path_to_output_file"`, which will
-create the file at the given location. You can also just use the string `"xml"`,
-in which case the output can be found in the `test_detail.xml` file in the
-current directory.
-
-If you specify a directory (for example, `"xml:output/directory/"` on Linux or
-`"xml:output\directory\"` on Windows), googletest will create the XML file in
-that directory, named after the test executable (e.g. `foo_test.xml` for test
-program `foo_test` or `foo_test.exe`). If the file already exists (perhaps left
-over from a previous run), googletest will pick a different name (e.g.
-`foo_test_1.xml`) to avoid overwriting it.
-
-The report is based on the `junitreport` Ant task. Since that format was
-originally intended for Java, a little interpretation is required to make it
-apply to googletest tests, as shown here:
-
-```xml
-<testsuites name="AllTests" ...>
- <testsuite name="test_case_name" ...>
- <testcase name="test_name" ...>
- <failure message="..."/>
- <failure message="..."/>
- <failure message="..."/>
- </testcase>
- </testsuite>
-</testsuites>
-```
-
-* The root `<testsuites>` element corresponds to the entire test program.
-* `<testsuite>` elements correspond to googletest test suites.
-* `<testcase>` elements correspond to googletest test functions.
-
-For instance, the following program
-
-```c++
-TEST(MathTest, Addition) { ... }
-TEST(MathTest, Subtraction) { ... }
-TEST(LogicTest, NonContradiction) { ... }
-```
-
-could generate this report:
-
-```xml
-<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="3" failures="1" errors="0" time="0.035" timestamp="2011-10-31T18:52:42" name="AllTests">
- <testsuite name="MathTest" tests="2" failures="1" errors="0" time="0.015">
- <testcase name="Addition" status="run" time="0.007" classname="">
- <failure message="Value of: add(1, 1)&#x0A; Actual: 3&#x0A;Expected: 2" type="">...</failure>
- <failure message="Value of: add(1, -1)&#x0A; Actual: 1&#x0A;Expected: 0" type="">...</failure>
- </testcase>
- <testcase name="Subtraction" status="run" time="0.005" classname="">
- </testcase>
- </testsuite>
- <testsuite name="LogicTest" tests="1" failures="0" errors="0" time="0.005">
- <testcase name="NonContradiction" status="run" time="0.005" classname="">
- </testcase>
- </testsuite>
-</testsuites>
-```
-
-Things to note:
-
-* The `tests` attribute of a `<testsuites>` or `<testsuite>` element tells how
- many test functions the googletest program or test suite contains, while the
- `failures` attribute tells how many of them failed.
-
-* The `time` attribute expresses the duration of the test, test suite, or
- entire test program in seconds.
-
-* The `timestamp` attribute records the local date and time of the test
- execution.
-
-* Each `<failure>` element corresponds to a single failed googletest
- assertion.
-
-#### Generating a JSON Report
-
-googletest can also emit a JSON report as an alternative format to XML. To
-generate the JSON report, set the `GTEST_OUTPUT` environment variable or the
-`--gtest_output` flag to the string `"json:path_to_output_file"`, which will
-create the file at the given location. You can also just use the string
-`"json"`, in which case the output can be found in the `test_detail.json` file
-in the current directory.
-
-The report format conforms to the following JSON Schema:
-
-```json
-{
- "$schema": "http://json-schema.org/schema#",
- "type": "object",
- "definitions": {
- "TestCase": {
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "tests": { "type": "integer" },
- "failures": { "type": "integer" },
- "disabled": { "type": "integer" },
- "time": { "type": "string" },
- "testsuite": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TestInfo"
- }
- }
- }
- },
- "TestInfo": {
- "type": "object",
- "properties": {
- "name": { "type": "string" },
- "status": {
- "type": "string",
- "enum": ["RUN", "NOTRUN"]
- },
- "time": { "type": "string" },
- "classname": { "type": "string" },
- "failures": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/Failure"
- }
- }
- }
- },
- "Failure": {
- "type": "object",
- "properties": {
- "failures": { "type": "string" },
- "type": { "type": "string" }
- }
- }
- },
- "properties": {
- "tests": { "type": "integer" },
- "failures": { "type": "integer" },
- "disabled": { "type": "integer" },
- "errors": { "type": "integer" },
- "timestamp": {
- "type": "string",
- "format": "date-time"
- },
- "time": { "type": "string" },
- "name": { "type": "string" },
- "testsuites": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/TestCase"
- }
- }
- }
-}
-```
-
-The report uses the format that conforms to the following Proto3 using the
-[JSON encoding](https://developers.google.com/protocol-buffers/docs/proto3#json):
-
-```proto
-syntax = "proto3";
-
-package googletest;
-
-import "google/protobuf/timestamp.proto";
-import "google/protobuf/duration.proto";
-
-message UnitTest {
- int32 tests = 1;
- int32 failures = 2;
- int32 disabled = 3;
- int32 errors = 4;
- google.protobuf.Timestamp timestamp = 5;
- google.protobuf.Duration time = 6;
- string name = 7;
- repeated TestCase testsuites = 8;
-}
-
-message TestCase {
- string name = 1;
- int32 tests = 2;
- int32 failures = 3;
- int32 disabled = 4;
- int32 errors = 5;
- google.protobuf.Duration time = 6;
- repeated TestInfo testsuite = 7;
-}
-
-message TestInfo {
- string name = 1;
- enum Status {
- RUN = 0;
- NOTRUN = 1;
- }
- Status status = 2;
- google.protobuf.Duration time = 3;
- string classname = 4;
- message Failure {
- string failures = 1;
- string type = 2;
- }
- repeated Failure failures = 5;
-}
-```
-
-For instance, the following program
-
-```c++
-TEST(MathTest, Addition) { ... }
-TEST(MathTest, Subtraction) { ... }
-TEST(LogicTest, NonContradiction) { ... }
-```
-
-could generate this report:
-
-```json
-{
- "tests": 3,
- "failures": 1,
- "errors": 0,
- "time": "0.035s",
- "timestamp": "2011-10-31T18:52:42Z",
- "name": "AllTests",
- "testsuites": [
- {
- "name": "MathTest",
- "tests": 2,
- "failures": 1,
- "errors": 0,
- "time": "0.015s",
- "testsuite": [
- {
- "name": "Addition",
- "status": "RUN",
- "time": "0.007s",
- "classname": "",
- "failures": [
- {
- "message": "Value of: add(1, 1)\n Actual: 3\nExpected: 2",
- "type": ""
- },
- {
- "message": "Value of: add(1, -1)\n Actual: 1\nExpected: 0",
- "type": ""
- }
- ]
- },
- {
- "name": "Subtraction",
- "status": "RUN",
- "time": "0.005s",
- "classname": ""
- }
- ]
- },
- {
- "name": "LogicTest",
- "tests": 1,
- "failures": 0,
- "errors": 0,
- "time": "0.005s",
- "testsuite": [
- {
- "name": "NonContradiction",
- "status": "RUN",
- "time": "0.005s",
- "classname": ""
- }
- ]
- }
- ]
-}
-```
-
-{: .callout .important}
-IMPORTANT: The exact format of the JSON document is subject to change.
-
-### Controlling How Failures Are Reported
-
-#### Detecting Test Premature Exit
-
-Google Test implements the _premature-exit-file_ protocol for test runners to
-catch any kind of unexpected exits of test programs. Upon start, Google Test
-creates the file which will be automatically deleted after all work has been
-finished. Then, the test runner can check if this file exists. In case the file
-remains undeleted, the inspected test has exited prematurely.
-
-This feature is enabled only if the `TEST_PREMATURE_EXIT_FILE` environment
-variable has been set.
-
-#### Turning Assertion Failures into Break-Points
-
-When running test programs under a debugger, it's very convenient if the
-debugger can catch an assertion failure and automatically drop into interactive
-mode. googletest's *break-on-failure* mode supports this behavior.
-
-To enable it, set the `GTEST_BREAK_ON_FAILURE` environment variable to a value
-other than `0`. Alternatively, you can use the `--gtest_break_on_failure`
-command line flag.
-
-#### Disabling Catching Test-Thrown Exceptions
-
-googletest can be used either with or without exceptions enabled. If a test
-throws a C++ exception or (on Windows) a structured exception (SEH), by default
-googletest catches it, reports it as a test failure, and continues with the next
-test method. This maximizes the coverage of a test run. Also, on Windows an
-uncaught exception will cause a pop-up window, so catching the exceptions allows
-you to run the tests automatically.
-
-When debugging the test failures, however, you may instead want the exceptions
-to be handled by the debugger, such that you can examine the call stack when an
-exception is thrown. To achieve that, set the `GTEST_CATCH_EXCEPTIONS`
-environment variable to `0`, or use the `--gtest_catch_exceptions=0` flag when
-running the tests.
-
-### Sanitizer Integration
-
-The
-[Undefined Behavior Sanitizer](https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html),
-[Address Sanitizer](https://github.com/google/sanitizers/wiki/AddressSanitizer),
-and
-[Thread Sanitizer](https://github.com/google/sanitizers/wiki/ThreadSanitizerCppManual)
-all provide weak functions that you can override to trigger explicit failures
-when they detect sanitizer errors, such as creating a reference from `nullptr`.
-To override these functions, place definitions for them in a source file that
-you compile as part of your main binary:
-
-```
-extern "C" {
-void __ubsan_on_report() {
- FAIL() << "Encountered an undefined behavior sanitizer error";
-}
-void __asan_on_error() {
- FAIL() << "Encountered an address sanitizer error";
-}
-void __tsan_on_report() {
- FAIL() << "Encountered a thread sanitizer error";
-}
-} // extern "C"
-```
-
-After compiling your project with one of the sanitizers enabled, if a particular
-test triggers a sanitizer error, googletest will report that it failed.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/community_created_documentation.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/community_created_documentation.md
deleted file mode 100644
index 4569075ff2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/community_created_documentation.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# Community-Created Documentation
-
-The following is a list, in no particular order, of links to documentation
-created by the Googletest community.
-
-* [Googlemock Insights](https://github.com/ElectricRCAircraftGuy/eRCaGuy_dotfiles/blob/master/googletest/insights.md),
- by [ElectricRCAircraftGuy](https://github.com/ElectricRCAircraftGuy)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/faq.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/faq.md
deleted file mode 100644
index b2db186f13..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/faq.md
+++ /dev/null
@@ -1,692 +0,0 @@
-# Googletest FAQ
-
-## Why should test suite names and test names not contain underscore?
-
-{: .callout .note}
-Note: Googletest reserves underscore (`_`) for special purpose keywords, such as
-[the `DISABLED_` prefix](advanced.md#temporarily-disabling-tests), in addition
-to the following rationale.
-
-Underscore (`_`) is special, as C++ reserves the following to be used by the
-compiler and the standard library:
-
-1. any identifier that starts with an `_` followed by an upper-case letter, and
-2. any identifier that contains two consecutive underscores (i.e. `__`)
- *anywhere* in its name.
-
-User code is *prohibited* from using such identifiers.
-
-Now let's look at what this means for `TEST` and `TEST_F`.
-
-Currently `TEST(TestSuiteName, TestName)` generates a class named
-`TestSuiteName_TestName_Test`. What happens if `TestSuiteName` or `TestName`
-contains `_`?
-
-1. If `TestSuiteName` starts with an `_` followed by an upper-case letter (say,
- `_Foo`), we end up with `_Foo_TestName_Test`, which is reserved and thus
- invalid.
-2. If `TestSuiteName` ends with an `_` (say, `Foo_`), we get
- `Foo__TestName_Test`, which is invalid.
-3. If `TestName` starts with an `_` (say, `_Bar`), we get
- `TestSuiteName__Bar_Test`, which is invalid.
-4. If `TestName` ends with an `_` (say, `Bar_`), we get
- `TestSuiteName_Bar__Test`, which is invalid.
-
-So clearly `TestSuiteName` and `TestName` cannot start or end with `_`
-(Actually, `TestSuiteName` can start with `_` -- as long as the `_` isn't
-followed by an upper-case letter. But that's getting complicated. So for
-simplicity we just say that it cannot start with `_`.).
-
-It may seem fine for `TestSuiteName` and `TestName` to contain `_` in the
-middle. However, consider this:
-
-```c++
-TEST(Time, Flies_Like_An_Arrow) { ... }
-TEST(Time_Flies, Like_An_Arrow) { ... }
-```
-
-Now, the two `TEST`s will both generate the same class
-(`Time_Flies_Like_An_Arrow_Test`). That's not good.
-
-So for simplicity, we just ask the users to avoid `_` in `TestSuiteName` and
-`TestName`. The rule is more constraining than necessary, but it's simple and
-easy to remember. It also gives googletest some wiggle room in case its
-implementation needs to change in the future.
-
-If you violate the rule, there may not be immediate consequences, but your test
-may (just may) break with a new compiler (or a new version of the compiler you
-are using) or with a new version of googletest. Therefore it's best to follow
-the rule.
-
-## Why does googletest support `EXPECT_EQ(NULL, ptr)` and `ASSERT_EQ(NULL, ptr)` but not `EXPECT_NE(NULL, ptr)` and `ASSERT_NE(NULL, ptr)`?
-
-First of all, you can use `nullptr` with each of these macros, e.g.
-`EXPECT_EQ(ptr, nullptr)`, `EXPECT_NE(ptr, nullptr)`, `ASSERT_EQ(ptr, nullptr)`,
-`ASSERT_NE(ptr, nullptr)`. This is the preferred syntax in the style guide
-because `nullptr` does not have the type problems that `NULL` does.
-
-Due to some peculiarity of C++, it requires some non-trivial template meta
-programming tricks to support using `NULL` as an argument of the `EXPECT_XX()`
-and `ASSERT_XX()` macros. Therefore we only do it where it's most needed
-(otherwise we make the implementation of googletest harder to maintain and more
-error-prone than necessary).
-
-Historically, the `EXPECT_EQ()` macro took the *expected* value as its first
-argument and the *actual* value as the second, though this argument order is now
-discouraged. It was reasonable that someone wanted
-to write `EXPECT_EQ(NULL, some_expression)`, and this indeed was requested
-several times. Therefore we implemented it.
-
-The need for `EXPECT_NE(NULL, ptr)` wasn't nearly as strong. When the assertion
-fails, you already know that `ptr` must be `NULL`, so it doesn't add any
-information to print `ptr` in this case. That means `EXPECT_TRUE(ptr != NULL)`
-works just as well.
-
-If we were to support `EXPECT_NE(NULL, ptr)`, for consistency we'd have to
-support `EXPECT_NE(ptr, NULL)` as well. This means using the template meta
-programming tricks twice in the implementation, making it even harder to
-understand and maintain. We believe the benefit doesn't justify the cost.
-
-Finally, with the growth of the gMock matcher library, we are encouraging people
-to use the unified `EXPECT_THAT(value, matcher)` syntax more often in tests. One
-significant advantage of the matcher approach is that matchers can be easily
-combined to form new matchers, while the `EXPECT_NE`, etc, macros cannot be
-easily combined. Therefore we want to invest more in the matchers than in the
-`EXPECT_XX()` macros.
-
-## I need to test that different implementations of an interface satisfy some common requirements. Should I use typed tests or value-parameterized tests?
-
-For testing various implementations of the same interface, either typed tests or
-value-parameterized tests can get it done. It's really up to you the user to
-decide which is more convenient for you, depending on your particular case. Some
-rough guidelines:
-
-* Typed tests can be easier to write if instances of the different
- implementations can be created the same way, modulo the type. For example,
- if all these implementations have a public default constructor (such that
- you can write `new TypeParam`), or if their factory functions have the same
- form (e.g. `CreateInstance<TypeParam>()`).
-* Value-parameterized tests can be easier to write if you need different code
- patterns to create different implementations' instances, e.g. `new Foo` vs
- `new Bar(5)`. To accommodate for the differences, you can write factory
- function wrappers and pass these function pointers to the tests as their
- parameters.
-* When a typed test fails, the default output includes the name of the type,
- which can help you quickly identify which implementation is wrong.
- Value-parameterized tests only show the number of the failed iteration by
- default. You will need to define a function that returns the iteration name
- and pass it as the third parameter to INSTANTIATE_TEST_SUITE_P to have more
- useful output.
-* When using typed tests, you need to make sure you are testing against the
- interface type, not the concrete types (in other words, you want to make
- sure `implicit_cast<MyInterface*>(my_concrete_impl)` works, not just that
- `my_concrete_impl` works). It's less likely to make mistakes in this area
- when using value-parameterized tests.
-
-I hope I didn't confuse you more. :-) If you don't mind, I'd suggest you to give
-both approaches a try. Practice is a much better way to grasp the subtle
-differences between the two tools. Once you have some concrete experience, you
-can much more easily decide which one to use the next time.
-
-## I got some run-time errors about invalid proto descriptors when using `ProtocolMessageEquals`. Help!
-
-{: .callout .note}
-**Note:** `ProtocolMessageEquals` and `ProtocolMessageEquiv` are *deprecated*
-now. Please use `EqualsProto`, etc instead.
-
-`ProtocolMessageEquals` and `ProtocolMessageEquiv` were redefined recently and
-are now less tolerant of invalid protocol buffer definitions. In particular, if
-you have a `foo.proto` that doesn't fully qualify the type of a protocol message
-it references (e.g. `message<Bar>` where it should be `message<blah.Bar>`), you
-will now get run-time errors like:
-
-```
-... descriptor.cc:...] Invalid proto descriptor for file "path/to/foo.proto":
-... descriptor.cc:...] blah.MyMessage.my_field: ".Bar" is not defined.
-```
-
-If you see this, your `.proto` file is broken and needs to be fixed by making
-the types fully qualified. The new definition of `ProtocolMessageEquals` and
-`ProtocolMessageEquiv` just happen to reveal your bug.
-
-## My death test modifies some state, but the change seems lost after the death test finishes. Why?
-
-Death tests (`EXPECT_DEATH`, etc) are executed in a sub-process s.t. the
-expected crash won't kill the test program (i.e. the parent process). As a
-result, any in-memory side effects they incur are observable in their respective
-sub-processes, but not in the parent process. You can think of them as running
-in a parallel universe, more or less.
-
-In particular, if you use mocking and the death test statement invokes some mock
-methods, the parent process will think the calls have never occurred. Therefore,
-you may want to move your `EXPECT_CALL` statements inside the `EXPECT_DEATH`
-macro.
-
-## EXPECT_EQ(htonl(blah), blah_blah) generates weird compiler errors in opt mode. Is this a googletest bug?
-
-Actually, the bug is in `htonl()`.
-
-According to `'man htonl'`, `htonl()` is a *function*, which means it's valid to
-use `htonl` as a function pointer. However, in opt mode `htonl()` is defined as
-a *macro*, which breaks this usage.
-
-Worse, the macro definition of `htonl()` uses a `gcc` extension and is *not*
-standard C++. That hacky implementation has some ad hoc limitations. In
-particular, it prevents you from writing `Foo<sizeof(htonl(x))>()`, where `Foo`
-is a template that has an integral argument.
-
-The implementation of `EXPECT_EQ(a, b)` uses `sizeof(... a ...)` inside a
-template argument, and thus doesn't compile in opt mode when `a` contains a call
-to `htonl()`. It is difficult to make `EXPECT_EQ` bypass the `htonl()` bug, as
-the solution must work with different compilers on various platforms.
-
-## The compiler complains about "undefined references" to some static const member variables, but I did define them in the class body. What's wrong?
-
-If your class has a static data member:
-
-```c++
-// foo.h
-class Foo {
- ...
- static const int kBar = 100;
-};
-```
-
-You also need to define it *outside* of the class body in `foo.cc`:
-
-```c++
-const int Foo::kBar; // No initializer here.
-```
-
-Otherwise your code is **invalid C++**, and may break in unexpected ways. In
-particular, using it in googletest comparison assertions (`EXPECT_EQ`, etc) will
-generate an "undefined reference" linker error. The fact that "it used to work"
-doesn't mean it's valid. It just means that you were lucky. :-)
-
-If the declaration of the static data member is `constexpr` then it is
-implicitly an `inline` definition, and a separate definition in `foo.cc` is not
-needed:
-
-```c++
-// foo.h
-class Foo {
- ...
- static constexpr int kBar = 100; // Defines kBar, no need to do it in foo.cc.
-};
-```
-
-## Can I derive a test fixture from another?
-
-Yes.
-
-Each test fixture has a corresponding and same named test suite. This means only
-one test suite can use a particular fixture. Sometimes, however, multiple test
-cases may want to use the same or slightly different fixtures. For example, you
-may want to make sure that all of a GUI library's test suites don't leak
-important system resources like fonts and brushes.
-
-In googletest, you share a fixture among test suites by putting the shared logic
-in a base test fixture, then deriving from that base a separate fixture for each
-test suite that wants to use this common logic. You then use `TEST_F()` to write
-tests using each derived fixture.
-
-Typically, your code looks like this:
-
-```c++
-// Defines a base test fixture.
-class BaseTest : public ::testing::Test {
- protected:
- ...
-};
-
-// Derives a fixture FooTest from BaseTest.
-class FooTest : public BaseTest {
- protected:
- void SetUp() override {
- BaseTest::SetUp(); // Sets up the base fixture first.
- ... additional set-up work ...
- }
-
- void TearDown() override {
- ... clean-up work for FooTest ...
- BaseTest::TearDown(); // Remember to tear down the base fixture
- // after cleaning up FooTest!
- }
-
- ... functions and variables for FooTest ...
-};
-
-// Tests that use the fixture FooTest.
-TEST_F(FooTest, Bar) { ... }
-TEST_F(FooTest, Baz) { ... }
-
-... additional fixtures derived from BaseTest ...
-```
-
-If necessary, you can continue to derive test fixtures from a derived fixture.
-googletest has no limit on how deep the hierarchy can be.
-
-For a complete example using derived test fixtures, see
-[sample5_unittest.cc](https://github.com/google/googletest/blob/master/googletest/samples/sample5_unittest.cc).
-
-## My compiler complains "void value not ignored as it ought to be." What does this mean?
-
-You're probably using an `ASSERT_*()` in a function that doesn't return `void`.
-`ASSERT_*()` can only be used in `void` functions, due to exceptions being
-disabled by our build system. Please see more details
-[here](advanced.md#assertion-placement).
-
-## My death test hangs (or seg-faults). How do I fix it?
-
-In googletest, death tests are run in a child process and the way they work is
-delicate. To write death tests you really need to understand how they work—see
-the details at [Death Assertions](reference/assertions.md#death) in the
-Assertions Reference.
-
-In particular, death tests don't like having multiple threads in the parent
-process. So the first thing you can try is to eliminate creating threads outside
-of `EXPECT_DEATH()`. For example, you may want to use mocks or fake objects
-instead of real ones in your tests.
-
-Sometimes this is impossible as some library you must use may be creating
-threads before `main()` is even reached. In this case, you can try to minimize
-the chance of conflicts by either moving as many activities as possible inside
-`EXPECT_DEATH()` (in the extreme case, you want to move everything inside), or
-leaving as few things as possible in it. Also, you can try to set the death test
-style to `"threadsafe"`, which is safer but slower, and see if it helps.
-
-If you go with thread-safe death tests, remember that they rerun the test
-program from the beginning in the child process. Therefore make sure your
-program can run side-by-side with itself and is deterministic.
-
-In the end, this boils down to good concurrent programming. You have to make
-sure that there are no race conditions or deadlocks in your program. No silver
-bullet - sorry!
-
-## Should I use the constructor/destructor of the test fixture or SetUp()/TearDown()? {#CtorVsSetUp}
-
-The first thing to remember is that googletest does **not** reuse the same test
-fixture object across multiple tests. For each `TEST_F`, googletest will create
-a **fresh** test fixture object, immediately call `SetUp()`, run the test body,
-call `TearDown()`, and then delete the test fixture object.
-
-When you need to write per-test set-up and tear-down logic, you have the choice
-between using the test fixture constructor/destructor or `SetUp()/TearDown()`.
-The former is usually preferred, as it has the following benefits:
-
-* By initializing a member variable in the constructor, we have the option to
- make it `const`, which helps prevent accidental changes to its value and
- makes the tests more obviously correct.
-* In case we need to subclass the test fixture class, the subclass'
- constructor is guaranteed to call the base class' constructor *first*, and
- the subclass' destructor is guaranteed to call the base class' destructor
- *afterward*. With `SetUp()/TearDown()`, a subclass may make the mistake of
- forgetting to call the base class' `SetUp()/TearDown()` or call them at the
- wrong time.
-
-You may still want to use `SetUp()/TearDown()` in the following cases:
-
-* C++ does not allow virtual function calls in constructors and destructors.
- You can call a method declared as virtual, but it will not use dynamic
- dispatch. It will use the definition from the class the constructor of which
- is currently executing. This is because calling a virtual method before the
- derived class constructor has a chance to run is very dangerous - the
- virtual method might operate on uninitialized data. Therefore, if you need
- to call a method that will be overridden in a derived class, you have to use
- `SetUp()/TearDown()`.
-* In the body of a constructor (or destructor), it's not possible to use the
- `ASSERT_xx` macros. Therefore, if the set-up operation could cause a fatal
- test failure that should prevent the test from running, it's necessary to
- use `abort` and abort the whole test
- executable, or to use `SetUp()` instead of a constructor.
-* If the tear-down operation could throw an exception, you must use
- `TearDown()` as opposed to the destructor, as throwing in a destructor leads
- to undefined behavior and usually will kill your program right away. Note
- that many standard libraries (like STL) may throw when exceptions are
- enabled in the compiler. Therefore you should prefer `TearDown()` if you
- want to write portable tests that work with or without exceptions.
-* The googletest team is considering making the assertion macros throw on
- platforms where exceptions are enabled (e.g. Windows, Mac OS, and Linux
- client-side), which will eliminate the need for the user to propagate
- failures from a subroutine to its caller. Therefore, you shouldn't use
- googletest assertions in a destructor if your code could run on such a
- platform.
-
-## The compiler complains "no matching function to call" when I use ASSERT_PRED*. How do I fix it?
-
-See details for [`EXPECT_PRED*`](reference/assertions.md#EXPECT_PRED) in the
-Assertions Reference.
-
-## My compiler complains about "ignoring return value" when I call RUN_ALL_TESTS(). Why?
-
-Some people had been ignoring the return value of `RUN_ALL_TESTS()`. That is,
-instead of
-
-```c++
- return RUN_ALL_TESTS();
-```
-
-they write
-
-```c++
- RUN_ALL_TESTS();
-```
-
-This is **wrong and dangerous**. The testing services needs to see the return
-value of `RUN_ALL_TESTS()` in order to determine if a test has passed. If your
-`main()` function ignores it, your test will be considered successful even if it
-has a googletest assertion failure. Very bad.
-
-We have decided to fix this (thanks to Michael Chastain for the idea). Now, your
-code will no longer be able to ignore `RUN_ALL_TESTS()` when compiled with
-`gcc`. If you do so, you'll get a compiler error.
-
-If you see the compiler complaining about you ignoring the return value of
-`RUN_ALL_TESTS()`, the fix is simple: just make sure its value is used as the
-return value of `main()`.
-
-But how could we introduce a change that breaks existing tests? Well, in this
-case, the code was already broken in the first place, so we didn't break it. :-)
-
-## My compiler complains that a constructor (or destructor) cannot return a value. What's going on?
-
-Due to a peculiarity of C++, in order to support the syntax for streaming
-messages to an `ASSERT_*`, e.g.
-
-```c++
- ASSERT_EQ(1, Foo()) << "blah blah" << foo;
-```
-
-we had to give up using `ASSERT*` and `FAIL*` (but not `EXPECT*` and
-`ADD_FAILURE*`) in constructors and destructors. The workaround is to move the
-content of your constructor/destructor to a private void member function, or
-switch to `EXPECT_*()` if that works. This
-[section](advanced.md#assertion-placement) in the user's guide explains it.
-
-## My SetUp() function is not called. Why?
-
-C++ is case-sensitive. Did you spell it as `Setup()`?
-
-Similarly, sometimes people spell `SetUpTestSuite()` as `SetupTestSuite()` and
-wonder why it's never called.
-
-## I have several test suites which share the same test fixture logic, do I have to define a new test fixture class for each of them? This seems pretty tedious.
-
-You don't have to. Instead of
-
-```c++
-class FooTest : public BaseTest {};
-
-TEST_F(FooTest, Abc) { ... }
-TEST_F(FooTest, Def) { ... }
-
-class BarTest : public BaseTest {};
-
-TEST_F(BarTest, Abc) { ... }
-TEST_F(BarTest, Def) { ... }
-```
-
-you can simply `typedef` the test fixtures:
-
-```c++
-typedef BaseTest FooTest;
-
-TEST_F(FooTest, Abc) { ... }
-TEST_F(FooTest, Def) { ... }
-
-typedef BaseTest BarTest;
-
-TEST_F(BarTest, Abc) { ... }
-TEST_F(BarTest, Def) { ... }
-```
-
-## googletest output is buried in a whole bunch of LOG messages. What do I do?
-
-The googletest output is meant to be a concise and human-friendly report. If
-your test generates textual output itself, it will mix with the googletest
-output, making it hard to read. However, there is an easy solution to this
-problem.
-
-Since `LOG` messages go to stderr, we decided to let googletest output go to
-stdout. This way, you can easily separate the two using redirection. For
-example:
-
-```shell
-$ ./my_test > gtest_output.txt
-```
-
-## Why should I prefer test fixtures over global variables?
-
-There are several good reasons:
-
-1. It's likely your test needs to change the states of its global variables.
- This makes it difficult to keep side effects from escaping one test and
- contaminating others, making debugging difficult. By using fixtures, each
- test has a fresh set of variables that's different (but with the same
- names). Thus, tests are kept independent of each other.
-2. Global variables pollute the global namespace.
-3. Test fixtures can be reused via subclassing, which cannot be done easily
- with global variables. This is useful if many test suites have something in
- common.
-
-## What can the statement argument in ASSERT_DEATH() be?
-
-`ASSERT_DEATH(statement, matcher)` (or any death assertion macro) can be used
-wherever *`statement`* is valid. So basically *`statement`* can be any C++
-statement that makes sense in the current context. In particular, it can
-reference global and/or local variables, and can be:
-
-* a simple function call (often the case),
-* a complex expression, or
-* a compound statement.
-
-Some examples are shown here:
-
-```c++
-// A death test can be a simple function call.
-TEST(MyDeathTest, FunctionCall) {
- ASSERT_DEATH(Xyz(5), "Xyz failed");
-}
-
-// Or a complex expression that references variables and functions.
-TEST(MyDeathTest, ComplexExpression) {
- const bool c = Condition();
- ASSERT_DEATH((c ? Func1(0) : object2.Method("test")),
- "(Func1|Method) failed");
-}
-
-// Death assertions can be used anywhere in a function. In
-// particular, they can be inside a loop.
-TEST(MyDeathTest, InsideLoop) {
- // Verifies that Foo(0), Foo(1), ..., and Foo(4) all die.
- for (int i = 0; i < 5; i++) {
- EXPECT_DEATH_M(Foo(i), "Foo has \\d+ errors",
- ::testing::Message() << "where i is " << i);
- }
-}
-
-// A death assertion can contain a compound statement.
-TEST(MyDeathTest, CompoundStatement) {
- // Verifies that at lease one of Bar(0), Bar(1), ..., and
- // Bar(4) dies.
- ASSERT_DEATH({
- for (int i = 0; i < 5; i++) {
- Bar(i);
- }
- },
- "Bar has \\d+ errors");
-}
-```
-
-## I have a fixture class `FooTest`, but `TEST_F(FooTest, Bar)` gives me error ``"no matching function for call to `FooTest::FooTest()'"``. Why?
-
-Googletest needs to be able to create objects of your test fixture class, so it
-must have a default constructor. Normally the compiler will define one for you.
-However, there are cases where you have to define your own:
-
-* If you explicitly declare a non-default constructor for class `FooTest`
- (`DISALLOW_EVIL_CONSTRUCTORS()` does this), then you need to define a
- default constructor, even if it would be empty.
-* If `FooTest` has a const non-static data member, then you have to define the
- default constructor *and* initialize the const member in the initializer
- list of the constructor. (Early versions of `gcc` doesn't force you to
- initialize the const member. It's a bug that has been fixed in `gcc 4`.)
-
-## Why does ASSERT_DEATH complain about previous threads that were already joined?
-
-With the Linux pthread library, there is no turning back once you cross the line
-from a single thread to multiple threads. The first time you create a thread, a
-manager thread is created in addition, so you get 3, not 2, threads. Later when
-the thread you create joins the main thread, the thread count decrements by 1,
-but the manager thread will never be killed, so you still have 2 threads, which
-means you cannot safely run a death test.
-
-The new NPTL thread library doesn't suffer from this problem, as it doesn't
-create a manager thread. However, if you don't control which machine your test
-runs on, you shouldn't depend on this.
-
-## Why does googletest require the entire test suite, instead of individual tests, to be named *DeathTest when it uses ASSERT_DEATH?
-
-googletest does not interleave tests from different test suites. That is, it
-runs all tests in one test suite first, and then runs all tests in the next test
-suite, and so on. googletest does this because it needs to set up a test suite
-before the first test in it is run, and tear it down afterwards. Splitting up
-the test case would require multiple set-up and tear-down processes, which is
-inefficient and makes the semantics unclean.
-
-If we were to determine the order of tests based on test name instead of test
-case name, then we would have a problem with the following situation:
-
-```c++
-TEST_F(FooTest, AbcDeathTest) { ... }
-TEST_F(FooTest, Uvw) { ... }
-
-TEST_F(BarTest, DefDeathTest) { ... }
-TEST_F(BarTest, Xyz) { ... }
-```
-
-Since `FooTest.AbcDeathTest` needs to run before `BarTest.Xyz`, and we don't
-interleave tests from different test suites, we need to run all tests in the
-`FooTest` case before running any test in the `BarTest` case. This contradicts
-with the requirement to run `BarTest.DefDeathTest` before `FooTest.Uvw`.
-
-## But I don't like calling my entire test suite \*DeathTest when it contains both death tests and non-death tests. What do I do?
-
-You don't have to, but if you like, you may split up the test suite into
-`FooTest` and `FooDeathTest`, where the names make it clear that they are
-related:
-
-```c++
-class FooTest : public ::testing::Test { ... };
-
-TEST_F(FooTest, Abc) { ... }
-TEST_F(FooTest, Def) { ... }
-
-using FooDeathTest = FooTest;
-
-TEST_F(FooDeathTest, Uvw) { ... EXPECT_DEATH(...) ... }
-TEST_F(FooDeathTest, Xyz) { ... ASSERT_DEATH(...) ... }
-```
-
-## googletest prints the LOG messages in a death test's child process only when the test fails. How can I see the LOG messages when the death test succeeds?
-
-Printing the LOG messages generated by the statement inside `EXPECT_DEATH()`
-makes it harder to search for real problems in the parent's log. Therefore,
-googletest only prints them when the death test has failed.
-
-If you really need to see such LOG messages, a workaround is to temporarily
-break the death test (e.g. by changing the regex pattern it is expected to
-match). Admittedly, this is a hack. We'll consider a more permanent solution
-after the fork-and-exec-style death tests are implemented.
-
-## The compiler complains about `no match for 'operator<<'` when I use an assertion. What gives?
-
-If you use a user-defined type `FooType` in an assertion, you must make sure
-there is an `std::ostream& operator<<(std::ostream&, const FooType&)` function
-defined such that we can print a value of `FooType`.
-
-In addition, if `FooType` is declared in a name space, the `<<` operator also
-needs to be defined in the *same* name space. See
-[Tip of the Week #49](http://abseil.io/tips/49) for details.
-
-## How do I suppress the memory leak messages on Windows?
-
-Since the statically initialized googletest singleton requires allocations on
-the heap, the Visual C++ memory leak detector will report memory leaks at the
-end of the program run. The easiest way to avoid this is to use the
-`_CrtMemCheckpoint` and `_CrtMemDumpAllObjectsSince` calls to not report any
-statically initialized heap objects. See MSDN for more details and additional
-heap check/debug routines.
-
-## How can my code detect if it is running in a test?
-
-If you write code that sniffs whether it's running in a test and does different
-things accordingly, you are leaking test-only logic into production code and
-there is no easy way to ensure that the test-only code paths aren't run by
-mistake in production. Such cleverness also leads to
-[Heisenbugs](https://en.wikipedia.org/wiki/Heisenbug). Therefore we strongly
-advise against the practice, and googletest doesn't provide a way to do it.
-
-In general, the recommended way to cause the code to behave differently under
-test is [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection). You can inject
-different functionality from the test and from the production code. Since your
-production code doesn't link in the for-test logic at all (the
-[`testonly`](http://docs.bazel.build/versions/master/be/common-definitions.html#common.testonly) attribute for BUILD targets helps to ensure
-that), there is no danger in accidentally running it.
-
-However, if you *really*, *really*, *really* have no choice, and if you follow
-the rule of ending your test program names with `_test`, you can use the
-*horrible* hack of sniffing your executable name (`argv[0]` in `main()`) to know
-whether the code is under test.
-
-## How do I temporarily disable a test?
-
-If you have a broken test that you cannot fix right away, you can add the
-`DISABLED_` prefix to its name. This will exclude it from execution. This is
-better than commenting out the code or using `#if 0`, as disabled tests are
-still compiled (and thus won't rot).
-
-To include disabled tests in test execution, just invoke the test program with
-the `--gtest_also_run_disabled_tests` flag.
-
-## Is it OK if I have two separate `TEST(Foo, Bar)` test methods defined in different namespaces?
-
-Yes.
-
-The rule is **all test methods in the same test suite must use the same fixture
-class.** This means that the following is **allowed** because both tests use the
-same fixture class (`::testing::Test`).
-
-```c++
-namespace foo {
-TEST(CoolTest, DoSomething) {
- SUCCEED();
-}
-} // namespace foo
-
-namespace bar {
-TEST(CoolTest, DoSomething) {
- SUCCEED();
-}
-} // namespace bar
-```
-
-However, the following code is **not allowed** and will produce a runtime error
-from googletest because the test methods are using different test fixture
-classes with the same test suite name.
-
-```c++
-namespace foo {
-class CoolTest : public ::testing::Test {}; // Fixture foo::CoolTest
-TEST_F(CoolTest, DoSomething) {
- SUCCEED();
-}
-} // namespace foo
-
-namespace bar {
-class CoolTest : public ::testing::Test {}; // Fixture: bar::CoolTest
-TEST_F(CoolTest, DoSomething) {
- SUCCEED();
-}
-} // namespace bar
-```
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cheat_sheet.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cheat_sheet.md
deleted file mode 100644
index 3d164ad629..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cheat_sheet.md
+++ /dev/null
@@ -1,241 +0,0 @@
-# gMock Cheat Sheet
-
-## Defining a Mock Class
-
-### Mocking a Normal Class {#MockClass}
-
-Given
-
-```cpp
-class Foo {
- ...
- virtual ~Foo();
- virtual int GetSize() const = 0;
- virtual string Describe(const char* name) = 0;
- virtual string Describe(int type) = 0;
- virtual bool Process(Bar elem, int count) = 0;
-};
-```
-
-(note that `~Foo()` **must** be virtual) we can define its mock as
-
-```cpp
-#include "gmock/gmock.h"
-
-class MockFoo : public Foo {
- ...
- MOCK_METHOD(int, GetSize, (), (const, override));
- MOCK_METHOD(string, Describe, (const char* name), (override));
- MOCK_METHOD(string, Describe, (int type), (override));
- MOCK_METHOD(bool, Process, (Bar elem, int count), (override));
-};
-```
-
-To create a "nice" mock, which ignores all uninteresting calls, a "naggy" mock,
-which warns on all uninteresting calls, or a "strict" mock, which treats them as
-failures:
-
-```cpp
-using ::testing::NiceMock;
-using ::testing::NaggyMock;
-using ::testing::StrictMock;
-
-NiceMock<MockFoo> nice_foo; // The type is a subclass of MockFoo.
-NaggyMock<MockFoo> naggy_foo; // The type is a subclass of MockFoo.
-StrictMock<MockFoo> strict_foo; // The type is a subclass of MockFoo.
-```
-
-{: .callout .note}
-**Note:** A mock object is currently naggy by default. We may make it nice by
-default in the future.
-
-### Mocking a Class Template {#MockTemplate}
-
-Class templates can be mocked just like any class.
-
-To mock
-
-```cpp
-template <typename Elem>
-class StackInterface {
- ...
- virtual ~StackInterface();
- virtual int GetSize() const = 0;
- virtual void Push(const Elem& x) = 0;
-};
-```
-
-(note that all member functions that are mocked, including `~StackInterface()`
-**must** be virtual).
-
-```cpp
-template <typename Elem>
-class MockStack : public StackInterface<Elem> {
- ...
- MOCK_METHOD(int, GetSize, (), (const, override));
- MOCK_METHOD(void, Push, (const Elem& x), (override));
-};
-```
-
-### Specifying Calling Conventions for Mock Functions
-
-If your mock function doesn't use the default calling convention, you can
-specify it by adding `Calltype(convention)` to `MOCK_METHOD`'s 4th parameter.
-For example,
-
-```cpp
- MOCK_METHOD(bool, Foo, (int n), (Calltype(STDMETHODCALLTYPE)));
- MOCK_METHOD(int, Bar, (double x, double y),
- (const, Calltype(STDMETHODCALLTYPE)));
-```
-
-where `STDMETHODCALLTYPE` is defined by `<objbase.h>` on Windows.
-
-## Using Mocks in Tests {#UsingMocks}
-
-The typical work flow is:
-
-1. Import the gMock names you need to use. All gMock symbols are in the
- `testing` namespace unless they are macros or otherwise noted.
-2. Create the mock objects.
-3. Optionally, set the default actions of the mock objects.
-4. Set your expectations on the mock objects (How will they be called? What
- will they do?).
-5. Exercise code that uses the mock objects; if necessary, check the result
- using googletest assertions.
-6. When a mock object is destructed, gMock automatically verifies that all
- expectations on it have been satisfied.
-
-Here's an example:
-
-```cpp
-using ::testing::Return; // #1
-
-TEST(BarTest, DoesThis) {
- MockFoo foo; // #2
-
- ON_CALL(foo, GetSize()) // #3
- .WillByDefault(Return(1));
- // ... other default actions ...
-
- EXPECT_CALL(foo, Describe(5)) // #4
- .Times(3)
- .WillRepeatedly(Return("Category 5"));
- // ... other expectations ...
-
- EXPECT_EQ(MyProductionFunction(&foo), "good"); // #5
-} // #6
-```
-
-## Setting Default Actions {#OnCall}
-
-gMock has a **built-in default action** for any function that returns `void`,
-`bool`, a numeric value, or a pointer. In C++11, it will additionally returns
-the default-constructed value, if one exists for the given type.
-
-To customize the default action for functions with return type `T`, use
-[`DefaultValue<T>`](reference/mocking.md#DefaultValue). For example:
-
-```cpp
- // Sets the default action for return type std::unique_ptr<Buzz> to
- // creating a new Buzz every time.
- DefaultValue<std::unique_ptr<Buzz>>::SetFactory(
- [] { return MakeUnique<Buzz>(AccessLevel::kInternal); });
-
- // When this fires, the default action of MakeBuzz() will run, which
- // will return a new Buzz object.
- EXPECT_CALL(mock_buzzer_, MakeBuzz("hello")).Times(AnyNumber());
-
- auto buzz1 = mock_buzzer_.MakeBuzz("hello");
- auto buzz2 = mock_buzzer_.MakeBuzz("hello");
- EXPECT_NE(buzz1, nullptr);
- EXPECT_NE(buzz2, nullptr);
- EXPECT_NE(buzz1, buzz2);
-
- // Resets the default action for return type std::unique_ptr<Buzz>,
- // to avoid interfere with other tests.
- DefaultValue<std::unique_ptr<Buzz>>::Clear();
-```
-
-To customize the default action for a particular method of a specific mock
-object, use [`ON_CALL`](reference/mocking.md#ON_CALL). `ON_CALL` has a similar
-syntax to `EXPECT_CALL`, but it is used for setting default behaviors when you
-do not require that the mock method is called. See
-[Knowing When to Expect](gmock_cook_book.md#UseOnCall) for a more detailed
-discussion.
-
-## Setting Expectations {#ExpectCall}
-
-See [`EXPECT_CALL`](reference/mocking.md#EXPECT_CALL) in the Mocking Reference.
-
-## Matchers {#MatcherList}
-
-See the [Matchers Reference](reference/matchers.md).
-
-## Actions {#ActionList}
-
-See the [Actions Reference](reference/actions.md).
-
-## Cardinalities {#CardinalityList}
-
-See the [`Times` clause](reference/mocking.md#EXPECT_CALL.Times) of
-`EXPECT_CALL` in the Mocking Reference.
-
-## Expectation Order
-
-By default, expectations can be matched in *any* order. If some or all
-expectations must be matched in a given order, you can use the
-[`After` clause](reference/mocking.md#EXPECT_CALL.After) or
-[`InSequence` clause](reference/mocking.md#EXPECT_CALL.InSequence) of
-`EXPECT_CALL`, or use an [`InSequence` object](reference/mocking.md#InSequence).
-
-## Verifying and Resetting a Mock
-
-gMock will verify the expectations on a mock object when it is destructed, or
-you can do it earlier:
-
-```cpp
-using ::testing::Mock;
-...
-// Verifies and removes the expectations on mock_obj;
-// returns true if and only if successful.
-Mock::VerifyAndClearExpectations(&mock_obj);
-...
-// Verifies and removes the expectations on mock_obj;
-// also removes the default actions set by ON_CALL();
-// returns true if and only if successful.
-Mock::VerifyAndClear(&mock_obj);
-```
-
-Do not set new expectations after verifying and clearing a mock after its use.
-Setting expectations after code that exercises the mock has undefined behavior.
-See [Using Mocks in Tests](gmock_for_dummies.md#using-mocks-in-tests) for more
-information.
-
-You can also tell gMock that a mock object can be leaked and doesn't need to be
-verified:
-
-```cpp
-Mock::AllowLeak(&mock_obj);
-```
-
-## Mock Classes
-
-gMock defines a convenient mock class template
-
-```cpp
-class MockFunction<R(A1, ..., An)> {
- public:
- MOCK_METHOD(R, Call, (A1, ..., An));
-};
-```
-
-See this [recipe](gmock_cook_book.md#UsingCheckPoints) for one application of
-it.
-
-## Flags
-
-| Flag | Description |
-| :----------------------------- | :---------------------------------------- |
-| `--gmock_catch_leaked_mocks=0` | Don't report leaked mock objects as failures. |
-| `--gmock_verbose=LEVEL` | Sets the default verbosity level (`info`, `warning`, or `error`) of Google Mock messages. |
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cook_book.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cook_book.md
deleted file mode 100644
index 9494f1222f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_cook_book.md
+++ /dev/null
@@ -1,4299 +0,0 @@
-# gMock Cookbook
-
-You can find recipes for using gMock here. If you haven't yet, please read
-[the dummy guide](gmock_for_dummies.md) first to make sure you understand the
-basics.
-
-{: .callout .note}
-**Note:** gMock lives in the `testing` name space. For readability, it is
-recommended to write `using ::testing::Foo;` once in your file before using the
-name `Foo` defined by gMock. We omit such `using` statements in this section for
-brevity, but you should do it in your own code.
-
-## Creating Mock Classes
-
-Mock classes are defined as normal classes, using the `MOCK_METHOD` macro to
-generate mocked methods. The macro gets 3 or 4 parameters:
-
-```cpp
-class MyMock {
- public:
- MOCK_METHOD(ReturnType, MethodName, (Args...));
- MOCK_METHOD(ReturnType, MethodName, (Args...), (Specs...));
-};
-```
-
-The first 3 parameters are simply the method declaration, split into 3 parts.
-The 4th parameter accepts a closed list of qualifiers, which affect the
-generated method:
-
-* **`const`** - Makes the mocked method a `const` method. Required if
- overriding a `const` method.
-* **`override`** - Marks the method with `override`. Recommended if overriding
- a `virtual` method.
-* **`noexcept`** - Marks the method with `noexcept`. Required if overriding a
- `noexcept` method.
-* **`Calltype(...)`** - Sets the call type for the method (e.g. to
- `STDMETHODCALLTYPE`), useful in Windows.
-* **`ref(...)`** - Marks the method with the reference qualification
- specified. Required if overriding a method that has reference
- qualifications. Eg `ref(&)` or `ref(&&)`.
-
-### Dealing with unprotected commas
-
-Unprotected commas, i.e. commas which are not surrounded by parentheses, prevent
-`MOCK_METHOD` from parsing its arguments correctly:
-
-{: .bad}
-```cpp
-class MockFoo {
- public:
- MOCK_METHOD(std::pair<bool, int>, GetPair, ()); // Won't compile!
- MOCK_METHOD(bool, CheckMap, (std::map<int, double>, bool)); // Won't compile!
-};
-```
-
-Solution 1 - wrap with parentheses:
-
-{: .good}
-```cpp
-class MockFoo {
- public:
- MOCK_METHOD((std::pair<bool, int>), GetPair, ());
- MOCK_METHOD(bool, CheckMap, ((std::map<int, double>), bool));
-};
-```
-
-Note that wrapping a return or argument type with parentheses is, in general,
-invalid C++. `MOCK_METHOD` removes the parentheses.
-
-Solution 2 - define an alias:
-
-{: .good}
-```cpp
-class MockFoo {
- public:
- using BoolAndInt = std::pair<bool, int>;
- MOCK_METHOD(BoolAndInt, GetPair, ());
- using MapIntDouble = std::map<int, double>;
- MOCK_METHOD(bool, CheckMap, (MapIntDouble, bool));
-};
-```
-
-### Mocking Private or Protected Methods
-
-You must always put a mock method definition (`MOCK_METHOD`) in a `public:`
-section of the mock class, regardless of the method being mocked being `public`,
-`protected`, or `private` in the base class. This allows `ON_CALL` and
-`EXPECT_CALL` to reference the mock function from outside of the mock class.
-(Yes, C++ allows a subclass to change the access level of a virtual function in
-the base class.) Example:
-
-```cpp
-class Foo {
- public:
- ...
- virtual bool Transform(Gadget* g) = 0;
-
- protected:
- virtual void Resume();
-
- private:
- virtual int GetTimeOut();
-};
-
-class MockFoo : public Foo {
- public:
- ...
- MOCK_METHOD(bool, Transform, (Gadget* g), (override));
-
- // The following must be in the public section, even though the
- // methods are protected or private in the base class.
- MOCK_METHOD(void, Resume, (), (override));
- MOCK_METHOD(int, GetTimeOut, (), (override));
-};
-```
-
-### Mocking Overloaded Methods
-
-You can mock overloaded functions as usual. No special attention is required:
-
-```cpp
-class Foo {
- ...
-
- // Must be virtual as we'll inherit from Foo.
- virtual ~Foo();
-
- // Overloaded on the types and/or numbers of arguments.
- virtual int Add(Element x);
- virtual int Add(int times, Element x);
-
- // Overloaded on the const-ness of this object.
- virtual Bar& GetBar();
- virtual const Bar& GetBar() const;
-};
-
-class MockFoo : public Foo {
- ...
- MOCK_METHOD(int, Add, (Element x), (override));
- MOCK_METHOD(int, Add, (int times, Element x), (override));
-
- MOCK_METHOD(Bar&, GetBar, (), (override));
- MOCK_METHOD(const Bar&, GetBar, (), (const, override));
-};
-```
-
-{: .callout .note}
-**Note:** if you don't mock all versions of the overloaded method, the compiler
-will give you a warning about some methods in the base class being hidden. To
-fix that, use `using` to bring them in scope:
-
-```cpp
-class MockFoo : public Foo {
- ...
- using Foo::Add;
- MOCK_METHOD(int, Add, (Element x), (override));
- // We don't want to mock int Add(int times, Element x);
- ...
-};
-```
-
-### Mocking Class Templates
-
-You can mock class templates just like any class.
-
-```cpp
-template <typename Elem>
-class StackInterface {
- ...
- // Must be virtual as we'll inherit from StackInterface.
- virtual ~StackInterface();
-
- virtual int GetSize() const = 0;
- virtual void Push(const Elem& x) = 0;
-};
-
-template <typename Elem>
-class MockStack : public StackInterface<Elem> {
- ...
- MOCK_METHOD(int, GetSize, (), (override));
- MOCK_METHOD(void, Push, (const Elem& x), (override));
-};
-```
-
-### Mocking Non-virtual Methods {#MockingNonVirtualMethods}
-
-gMock can mock non-virtual functions to be used in Hi-perf dependency injection.
-
-In this case, instead of sharing a common base class with the real class, your
-mock class will be *unrelated* to the real class, but contain methods with the
-same signatures. The syntax for mocking non-virtual methods is the *same* as
-mocking virtual methods (just don't add `override`):
-
-```cpp
-// A simple packet stream class. None of its members is virtual.
-class ConcretePacketStream {
- public:
- void AppendPacket(Packet* new_packet);
- const Packet* GetPacket(size_t packet_number) const;
- size_t NumberOfPackets() const;
- ...
-};
-
-// A mock packet stream class. It inherits from no other, but defines
-// GetPacket() and NumberOfPackets().
-class MockPacketStream {
- public:
- MOCK_METHOD(const Packet*, GetPacket, (size_t packet_number), (const));
- MOCK_METHOD(size_t, NumberOfPackets, (), (const));
- ...
-};
-```
-
-Note that the mock class doesn't define `AppendPacket()`, unlike the real class.
-That's fine as long as the test doesn't need to call it.
-
-Next, you need a way to say that you want to use `ConcretePacketStream` in
-production code, and use `MockPacketStream` in tests. Since the functions are
-not virtual and the two classes are unrelated, you must specify your choice at
-*compile time* (as opposed to run time).
-
-One way to do it is to templatize your code that needs to use a packet stream.
-More specifically, you will give your code a template type argument for the type
-of the packet stream. In production, you will instantiate your template with
-`ConcretePacketStream` as the type argument. In tests, you will instantiate the
-same template with `MockPacketStream`. For example, you may write:
-
-```cpp
-template <class PacketStream>
-void CreateConnection(PacketStream* stream) { ... }
-
-template <class PacketStream>
-class PacketReader {
- public:
- void ReadPackets(PacketStream* stream, size_t packet_num);
-};
-```
-
-Then you can use `CreateConnection<ConcretePacketStream>()` and
-`PacketReader<ConcretePacketStream>` in production code, and use
-`CreateConnection<MockPacketStream>()` and `PacketReader<MockPacketStream>` in
-tests.
-
-```cpp
- MockPacketStream mock_stream;
- EXPECT_CALL(mock_stream, ...)...;
- .. set more expectations on mock_stream ...
- PacketReader<MockPacketStream> reader(&mock_stream);
- ... exercise reader ...
-```
-
-### Mocking Free Functions
-
-It is not possible to directly mock a free function (i.e. a C-style function or
-a static method). If you need to, you can rewrite your code to use an interface
-(abstract class).
-
-Instead of calling a free function (say, `OpenFile`) directly, introduce an
-interface for it and have a concrete subclass that calls the free function:
-
-```cpp
-class FileInterface {
- public:
- ...
- virtual bool Open(const char* path, const char* mode) = 0;
-};
-
-class File : public FileInterface {
- public:
- ...
- bool Open(const char* path, const char* mode) override {
- return OpenFile(path, mode);
- }
-};
-```
-
-Your code should talk to `FileInterface` to open a file. Now it's easy to mock
-out the function.
-
-This may seem like a lot of hassle, but in practice you often have multiple
-related functions that you can put in the same interface, so the per-function
-syntactic overhead will be much lower.
-
-If you are concerned about the performance overhead incurred by virtual
-functions, and profiling confirms your concern, you can combine this with the
-recipe for [mocking non-virtual methods](#MockingNonVirtualMethods).
-
-### Old-Style `MOCK_METHODn` Macros
-
-Before the generic `MOCK_METHOD` macro
-[was introduced in 2018](https://github.com/google/googletest/commit/c5f08bf91944ce1b19bcf414fa1760e69d20afc2),
-mocks where created using a family of macros collectively called `MOCK_METHODn`.
-These macros are still supported, though migration to the new `MOCK_METHOD` is
-recommended.
-
-The macros in the `MOCK_METHODn` family differ from `MOCK_METHOD`:
-
-* The general structure is `MOCK_METHODn(MethodName, ReturnType(Args))`,
- instead of `MOCK_METHOD(ReturnType, MethodName, (Args))`.
-* The number `n` must equal the number of arguments.
-* When mocking a const method, one must use `MOCK_CONST_METHODn`.
-* When mocking a class template, the macro name must be suffixed with `_T`.
-* In order to specify the call type, the macro name must be suffixed with
- `_WITH_CALLTYPE`, and the call type is the first macro argument.
-
-Old macros and their new equivalents:
-
-<table>
- <tr><th colspan=2>Simple</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_METHOD1(Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int))</code></td>
- </tr>
-
- <tr><th colspan=2>Const Method</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_CONST_METHOD1(Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (const))</code></td>
- </tr>
-
- <tr><th colspan=2>Method in a Class Template</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_METHOD1_T(Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int))</code></td>
- </tr>
-
- <tr><th colspan=2>Const Method in a Class Template</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_CONST_METHOD1_T(Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (const))</code></td>
- </tr>
-
- <tr><th colspan=2>Method with Call Type</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))</code></td>
- </tr>
-
- <tr><th colspan=2>Const Method with Call Type</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))</code></td>
- </tr>
-
- <tr><th colspan=2>Method with Call Type in a Class Template</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (Calltype(STDMETHODCALLTYPE)))</code></td>
- </tr>
-
- <tr><th colspan=2>Const Method with Call Type in a Class Template</th></tr>
- <tr>
- <td>Old</td>
- <td><code>MOCK_CONST_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Foo, bool(int))</code></td>
- </tr>
- <tr>
- <td>New</td>
- <td><code>MOCK_METHOD(bool, Foo, (int), (const, Calltype(STDMETHODCALLTYPE)))</code></td>
- </tr>
-</table>
-
-### The Nice, the Strict, and the Naggy {#NiceStrictNaggy}
-
-If a mock method has no `EXPECT_CALL` spec but is called, we say that it's an
-"uninteresting call", and the default action (which can be specified using
-`ON_CALL()`) of the method will be taken. Currently, an uninteresting call will
-also by default cause gMock to print a warning. (In the future, we might remove
-this warning by default.)
-
-However, sometimes you may want to ignore these uninteresting calls, and
-sometimes you may want to treat them as errors. gMock lets you make the decision
-on a per-mock-object basis.
-
-Suppose your test uses a mock class `MockFoo`:
-
-```cpp
-TEST(...) {
- MockFoo mock_foo;
- EXPECT_CALL(mock_foo, DoThis());
- ... code that uses mock_foo ...
-}
-```
-
-If a method of `mock_foo` other than `DoThis()` is called, you will get a
-warning. However, if you rewrite your test to use `NiceMock<MockFoo>` instead,
-you can suppress the warning:
-
-```cpp
-using ::testing::NiceMock;
-
-TEST(...) {
- NiceMock<MockFoo> mock_foo;
- EXPECT_CALL(mock_foo, DoThis());
- ... code that uses mock_foo ...
-}
-```
-
-`NiceMock<MockFoo>` is a subclass of `MockFoo`, so it can be used wherever
-`MockFoo` is accepted.
-
-It also works if `MockFoo`'s constructor takes some arguments, as
-`NiceMock<MockFoo>` "inherits" `MockFoo`'s constructors:
-
-```cpp
-using ::testing::NiceMock;
-
-TEST(...) {
- NiceMock<MockFoo> mock_foo(5, "hi"); // Calls MockFoo(5, "hi").
- EXPECT_CALL(mock_foo, DoThis());
- ... code that uses mock_foo ...
-}
-```
-
-The usage of `StrictMock` is similar, except that it makes all uninteresting
-calls failures:
-
-```cpp
-using ::testing::StrictMock;
-
-TEST(...) {
- StrictMock<MockFoo> mock_foo;
- EXPECT_CALL(mock_foo, DoThis());
- ... code that uses mock_foo ...
-
- // The test will fail if a method of mock_foo other than DoThis()
- // is called.
-}
-```
-
-{: .callout .note}
-NOTE: `NiceMock` and `StrictMock` only affects *uninteresting* calls (calls of
-*methods* with no expectations); they do not affect *unexpected* calls (calls of
-methods with expectations, but they don't match). See
-[Understanding Uninteresting vs Unexpected Calls](#uninteresting-vs-unexpected).
-
-There are some caveats though (sadly they are side effects of C++'s
-limitations):
-
-1. `NiceMock<MockFoo>` and `StrictMock<MockFoo>` only work for mock methods
- defined using the `MOCK_METHOD` macro **directly** in the `MockFoo` class.
- If a mock method is defined in a **base class** of `MockFoo`, the "nice" or
- "strict" modifier may not affect it, depending on the compiler. In
- particular, nesting `NiceMock` and `StrictMock` (e.g.
- `NiceMock<StrictMock<MockFoo> >`) is **not** supported.
-2. `NiceMock<MockFoo>` and `StrictMock<MockFoo>` may not work correctly if the
- destructor of `MockFoo` is not virtual. We would like to fix this, but it
- requires cleaning up existing tests.
-
-Finally, you should be **very cautious** about when to use naggy or strict
-mocks, as they tend to make tests more brittle and harder to maintain. When you
-refactor your code without changing its externally visible behavior, ideally you
-shouldn't need to update any tests. If your code interacts with a naggy mock,
-however, you may start to get spammed with warnings as the result of your
-change. Worse, if your code interacts with a strict mock, your tests may start
-to fail and you'll be forced to fix them. Our general recommendation is to use
-nice mocks (not yet the default) most of the time, use naggy mocks (the current
-default) when developing or debugging tests, and use strict mocks only as the
-last resort.
-
-### Simplifying the Interface without Breaking Existing Code {#SimplerInterfaces}
-
-Sometimes a method has a long list of arguments that is mostly uninteresting.
-For example:
-
-```cpp
-class LogSink {
- public:
- ...
- virtual void send(LogSeverity severity, const char* full_filename,
- const char* base_filename, int line,
- const struct tm* tm_time,
- const char* message, size_t message_len) = 0;
-};
-```
-
-This method's argument list is lengthy and hard to work with (the `message`
-argument is not even 0-terminated). If we mock it as is, using the mock will be
-awkward. If, however, we try to simplify this interface, we'll need to fix all
-clients depending on it, which is often infeasible.
-
-The trick is to redispatch the method in the mock class:
-
-```cpp
-class ScopedMockLog : public LogSink {
- public:
- ...
- void send(LogSeverity severity, const char* full_filename,
- const char* base_filename, int line, const tm* tm_time,
- const char* message, size_t message_len) override {
- // We are only interested in the log severity, full file name, and
- // log message.
- Log(severity, full_filename, std::string(message, message_len));
- }
-
- // Implements the mock method:
- //
- // void Log(LogSeverity severity,
- // const string& file_path,
- // const string& message);
- MOCK_METHOD(void, Log,
- (LogSeverity severity, const string& file_path,
- const string& message));
-};
-```
-
-By defining a new mock method with a trimmed argument list, we make the mock
-class more user-friendly.
-
-This technique may also be applied to make overloaded methods more amenable to
-mocking. For example, when overloads have been used to implement default
-arguments:
-
-```cpp
-class MockTurtleFactory : public TurtleFactory {
- public:
- Turtle* MakeTurtle(int length, int weight) override { ... }
- Turtle* MakeTurtle(int length, int weight, int speed) override { ... }
-
- // the above methods delegate to this one:
- MOCK_METHOD(Turtle*, DoMakeTurtle, ());
-};
-```
-
-This allows tests that don't care which overload was invoked to avoid specifying
-argument matchers:
-
-```cpp
-ON_CALL(factory, DoMakeTurtle)
- .WillByDefault(Return(MakeMockTurtle()));
-```
-
-### Alternative to Mocking Concrete Classes
-
-Often you may find yourself using classes that don't implement interfaces. In
-order to test your code that uses such a class (let's call it `Concrete`), you
-may be tempted to make the methods of `Concrete` virtual and then mock it.
-
-Try not to do that.
-
-Making a non-virtual function virtual is a big decision. It creates an extension
-point where subclasses can tweak your class' behavior. This weakens your control
-on the class because now it's harder to maintain the class invariants. You
-should make a function virtual only when there is a valid reason for a subclass
-to override it.
-
-Mocking concrete classes directly is problematic as it creates a tight coupling
-between the class and the tests - any small change in the class may invalidate
-your tests and make test maintenance a pain.
-
-To avoid such problems, many programmers have been practicing "coding to
-interfaces": instead of talking to the `Concrete` class, your code would define
-an interface and talk to it. Then you implement that interface as an adaptor on
-top of `Concrete`. In tests, you can easily mock that interface to observe how
-your code is doing.
-
-This technique incurs some overhead:
-
-* You pay the cost of virtual function calls (usually not a problem).
-* There is more abstraction for the programmers to learn.
-
-However, it can also bring significant benefits in addition to better
-testability:
-
-* `Concrete`'s API may not fit your problem domain very well, as you may not
- be the only client it tries to serve. By designing your own interface, you
- have a chance to tailor it to your need - you may add higher-level
- functionalities, rename stuff, etc instead of just trimming the class. This
- allows you to write your code (user of the interface) in a more natural way,
- which means it will be more readable, more maintainable, and you'll be more
- productive.
-* If `Concrete`'s implementation ever has to change, you don't have to rewrite
- everywhere it is used. Instead, you can absorb the change in your
- implementation of the interface, and your other code and tests will be
- insulated from this change.
-
-Some people worry that if everyone is practicing this technique, they will end
-up writing lots of redundant code. This concern is totally understandable.
-However, there are two reasons why it may not be the case:
-
-* Different projects may need to use `Concrete` in different ways, so the best
- interfaces for them will be different. Therefore, each of them will have its
- own domain-specific interface on top of `Concrete`, and they will not be the
- same code.
-* If enough projects want to use the same interface, they can always share it,
- just like they have been sharing `Concrete`. You can check in the interface
- and the adaptor somewhere near `Concrete` (perhaps in a `contrib`
- sub-directory) and let many projects use it.
-
-You need to weigh the pros and cons carefully for your particular problem, but
-I'd like to assure you that the Java community has been practicing this for a
-long time and it's a proven effective technique applicable in a wide variety of
-situations. :-)
-
-### Delegating Calls to a Fake {#DelegatingToFake}
-
-Some times you have a non-trivial fake implementation of an interface. For
-example:
-
-```cpp
-class Foo {
- public:
- virtual ~Foo() {}
- virtual char DoThis(int n) = 0;
- virtual void DoThat(const char* s, int* p) = 0;
-};
-
-class FakeFoo : public Foo {
- public:
- char DoThis(int n) override {
- return (n > 0) ? '+' :
- (n < 0) ? '-' : '0';
- }
-
- void DoThat(const char* s, int* p) override {
- *p = strlen(s);
- }
-};
-```
-
-Now you want to mock this interface such that you can set expectations on it.
-However, you also want to use `FakeFoo` for the default behavior, as duplicating
-it in the mock object is, well, a lot of work.
-
-When you define the mock class using gMock, you can have it delegate its default
-action to a fake class you already have, using this pattern:
-
-```cpp
-class MockFoo : public Foo {
- public:
- // Normal mock method definitions using gMock.
- MOCK_METHOD(char, DoThis, (int n), (override));
- MOCK_METHOD(void, DoThat, (const char* s, int* p), (override));
-
- // Delegates the default actions of the methods to a FakeFoo object.
- // This must be called *before* the custom ON_CALL() statements.
- void DelegateToFake() {
- ON_CALL(*this, DoThis).WillByDefault([this](int n) {
- return fake_.DoThis(n);
- });
- ON_CALL(*this, DoThat).WillByDefault([this](const char* s, int* p) {
- fake_.DoThat(s, p);
- });
- }
-
- private:
- FakeFoo fake_; // Keeps an instance of the fake in the mock.
-};
-```
-
-With that, you can use `MockFoo` in your tests as usual. Just remember that if
-you don't explicitly set an action in an `ON_CALL()` or `EXPECT_CALL()`, the
-fake will be called upon to do it.:
-
-```cpp
-using ::testing::_;
-
-TEST(AbcTest, Xyz) {
- MockFoo foo;
-
- foo.DelegateToFake(); // Enables the fake for delegation.
-
- // Put your ON_CALL(foo, ...)s here, if any.
-
- // No action specified, meaning to use the default action.
- EXPECT_CALL(foo, DoThis(5));
- EXPECT_CALL(foo, DoThat(_, _));
-
- int n = 0;
- EXPECT_EQ('+', foo.DoThis(5)); // FakeFoo::DoThis() is invoked.
- foo.DoThat("Hi", &n); // FakeFoo::DoThat() is invoked.
- EXPECT_EQ(2, n);
-}
-```
-
-**Some tips:**
-
-* If you want, you can still override the default action by providing your own
- `ON_CALL()` or using `.WillOnce()` / `.WillRepeatedly()` in `EXPECT_CALL()`.
-* In `DelegateToFake()`, you only need to delegate the methods whose fake
- implementation you intend to use.
-
-* The general technique discussed here works for overloaded methods, but
- you'll need to tell the compiler which version you mean. To disambiguate a
- mock function (the one you specify inside the parentheses of `ON_CALL()`),
- use [this technique](#SelectOverload); to disambiguate a fake function (the
- one you place inside `Invoke()`), use a `static_cast` to specify the
- function's type. For instance, if class `Foo` has methods `char DoThis(int
- n)` and `bool DoThis(double x) const`, and you want to invoke the latter,
- you need to write `Invoke(&fake_, static_cast<bool (FakeFoo::*)(double)
- const>(&FakeFoo::DoThis))` instead of `Invoke(&fake_, &FakeFoo::DoThis)`
- (The strange-looking thing inside the angled brackets of `static_cast` is
- the type of a function pointer to the second `DoThis()` method.).
-
-* Having to mix a mock and a fake is often a sign of something gone wrong.
- Perhaps you haven't got used to the interaction-based way of testing yet. Or
- perhaps your interface is taking on too many roles and should be split up.
- Therefore, **don't abuse this**. We would only recommend to do it as an
- intermediate step when you are refactoring your code.
-
-Regarding the tip on mixing a mock and a fake, here's an example on why it may
-be a bad sign: Suppose you have a class `System` for low-level system
-operations. In particular, it does file and I/O operations. And suppose you want
-to test how your code uses `System` to do I/O, and you just want the file
-operations to work normally. If you mock out the entire `System` class, you'll
-have to provide a fake implementation for the file operation part, which
-suggests that `System` is taking on too many roles.
-
-Instead, you can define a `FileOps` interface and an `IOOps` interface and split
-`System`'s functionalities into the two. Then you can mock `IOOps` without
-mocking `FileOps`.
-
-### Delegating Calls to a Real Object
-
-When using testing doubles (mocks, fakes, stubs, and etc), sometimes their
-behaviors will differ from those of the real objects. This difference could be
-either intentional (as in simulating an error such that you can test the error
-handling code) or unintentional. If your mocks have different behaviors than the
-real objects by mistake, you could end up with code that passes the tests but
-fails in production.
-
-You can use the *delegating-to-real* technique to ensure that your mock has the
-same behavior as the real object while retaining the ability to validate calls.
-This technique is very similar to the [delegating-to-fake](#DelegatingToFake)
-technique, the difference being that we use a real object instead of a fake.
-Here's an example:
-
-```cpp
-using ::testing::AtLeast;
-
-class MockFoo : public Foo {
- public:
- MockFoo() {
- // By default, all calls are delegated to the real object.
- ON_CALL(*this, DoThis).WillByDefault([this](int n) {
- return real_.DoThis(n);
- });
- ON_CALL(*this, DoThat).WillByDefault([this](const char* s, int* p) {
- real_.DoThat(s, p);
- });
- ...
- }
- MOCK_METHOD(char, DoThis, ...);
- MOCK_METHOD(void, DoThat, ...);
- ...
- private:
- Foo real_;
-};
-
-...
- MockFoo mock;
- EXPECT_CALL(mock, DoThis())
- .Times(3);
- EXPECT_CALL(mock, DoThat("Hi"))
- .Times(AtLeast(1));
- ... use mock in test ...
-```
-
-With this, gMock will verify that your code made the right calls (with the right
-arguments, in the right order, called the right number of times, etc), and a
-real object will answer the calls (so the behavior will be the same as in
-production). This gives you the best of both worlds.
-
-### Delegating Calls to a Parent Class
-
-Ideally, you should code to interfaces, whose methods are all pure virtual. In
-reality, sometimes you do need to mock a virtual method that is not pure (i.e,
-it already has an implementation). For example:
-
-```cpp
-class Foo {
- public:
- virtual ~Foo();
-
- virtual void Pure(int n) = 0;
- virtual int Concrete(const char* str) { ... }
-};
-
-class MockFoo : public Foo {
- public:
- // Mocking a pure method.
- MOCK_METHOD(void, Pure, (int n), (override));
- // Mocking a concrete method. Foo::Concrete() is shadowed.
- MOCK_METHOD(int, Concrete, (const char* str), (override));
-};
-```
-
-Sometimes you may want to call `Foo::Concrete()` instead of
-`MockFoo::Concrete()`. Perhaps you want to do it as part of a stub action, or
-perhaps your test doesn't need to mock `Concrete()` at all (but it would be
-oh-so painful to have to define a new mock class whenever you don't need to mock
-one of its methods).
-
-You can call `Foo::Concrete()` inside an action by:
-
-```cpp
-...
- EXPECT_CALL(foo, Concrete).WillOnce([&foo](const char* str) {
- return foo.Foo::Concrete(str);
- });
-```
-
-or tell the mock object that you don't want to mock `Concrete()`:
-
-```cpp
-...
- ON_CALL(foo, Concrete).WillByDefault([&foo](const char* str) {
- return foo.Foo::Concrete(str);
- });
-```
-
-(Why don't we just write `{ return foo.Concrete(str); }`? If you do that,
-`MockFoo::Concrete()` will be called (and cause an infinite recursion) since
-`Foo::Concrete()` is virtual. That's just how C++ works.)
-
-## Using Matchers
-
-### Matching Argument Values Exactly
-
-You can specify exactly which arguments a mock method is expecting:
-
-```cpp
-using ::testing::Return;
-...
- EXPECT_CALL(foo, DoThis(5))
- .WillOnce(Return('a'));
- EXPECT_CALL(foo, DoThat("Hello", bar));
-```
-
-### Using Simple Matchers
-
-You can use matchers to match arguments that have a certain property:
-
-```cpp
-using ::testing::NotNull;
-using ::testing::Return;
-...
- EXPECT_CALL(foo, DoThis(Ge(5))) // The argument must be >= 5.
- .WillOnce(Return('a'));
- EXPECT_CALL(foo, DoThat("Hello", NotNull()));
- // The second argument must not be NULL.
-```
-
-A frequently used matcher is `_`, which matches anything:
-
-```cpp
- EXPECT_CALL(foo, DoThat(_, NotNull()));
-```
-
-### Combining Matchers {#CombiningMatchers}
-
-You can build complex matchers from existing ones using `AllOf()`,
-`AllOfArray()`, `AnyOf()`, `AnyOfArray()` and `Not()`:
-
-```cpp
-using ::testing::AllOf;
-using ::testing::Gt;
-using ::testing::HasSubstr;
-using ::testing::Ne;
-using ::testing::Not;
-...
- // The argument must be > 5 and != 10.
- EXPECT_CALL(foo, DoThis(AllOf(Gt(5),
- Ne(10))));
-
- // The first argument must not contain sub-string "blah".
- EXPECT_CALL(foo, DoThat(Not(HasSubstr("blah")),
- NULL));
-```
-
-Matchers are function objects, and parametrized matchers can be composed just
-like any other function. However because their types can be long and rarely
-provide meaningful information, it can be easier to express them with C++14
-generic lambdas to avoid specifying types. For example,
-
-```cpp
-using ::testing::Contains;
-using ::testing::Property;
-
-inline constexpr auto HasFoo = [](const auto& f) {
- return Property(&MyClass::foo, Contains(f));
-};
-...
- EXPECT_THAT(x, HasFoo("blah"));
-```
-
-### Casting Matchers {#SafeMatcherCast}
-
-gMock matchers are statically typed, meaning that the compiler can catch your
-mistake if you use a matcher of the wrong type (for example, if you use `Eq(5)`
-to match a `string` argument). Good for you!
-
-Sometimes, however, you know what you're doing and want the compiler to give you
-some slack. One example is that you have a matcher for `long` and the argument
-you want to match is `int`. While the two types aren't exactly the same, there
-is nothing really wrong with using a `Matcher<long>` to match an `int` - after
-all, we can first convert the `int` argument to a `long` losslessly before
-giving it to the matcher.
-
-To support this need, gMock gives you the `SafeMatcherCast<T>(m)` function. It
-casts a matcher `m` to type `Matcher<T>`. To ensure safety, gMock checks that
-(let `U` be the type `m` accepts :
-
-1. Type `T` can be *implicitly* cast to type `U`;
-2. When both `T` and `U` are built-in arithmetic types (`bool`, integers, and
- floating-point numbers), the conversion from `T` to `U` is not lossy (in
- other words, any value representable by `T` can also be represented by `U`);
- and
-3. When `U` is a reference, `T` must also be a reference (as the underlying
- matcher may be interested in the address of the `U` value).
-
-The code won't compile if any of these conditions isn't met.
-
-Here's one example:
-
-```cpp
-using ::testing::SafeMatcherCast;
-
-// A base class and a child class.
-class Base { ... };
-class Derived : public Base { ... };
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(void, DoThis, (Derived* derived), (override));
-};
-
-...
- MockFoo foo;
- // m is a Matcher<Base*> we got from somewhere.
- EXPECT_CALL(foo, DoThis(SafeMatcherCast<Derived*>(m)));
-```
-
-If you find `SafeMatcherCast<T>(m)` too limiting, you can use a similar function
-`MatcherCast<T>(m)`. The difference is that `MatcherCast` works as long as you
-can `static_cast` type `T` to type `U`.
-
-`MatcherCast` essentially lets you bypass C++'s type system (`static_cast` isn't
-always safe as it could throw away information, for example), so be careful not
-to misuse/abuse it.
-
-### Selecting Between Overloaded Functions {#SelectOverload}
-
-If you expect an overloaded function to be called, the compiler may need some
-help on which overloaded version it is.
-
-To disambiguate functions overloaded on the const-ness of this object, use the
-`Const()` argument wrapper.
-
-```cpp
-using ::testing::ReturnRef;
-
-class MockFoo : public Foo {
- ...
- MOCK_METHOD(Bar&, GetBar, (), (override));
- MOCK_METHOD(const Bar&, GetBar, (), (const, override));
-};
-
-...
- MockFoo foo;
- Bar bar1, bar2;
- EXPECT_CALL(foo, GetBar()) // The non-const GetBar().
- .WillOnce(ReturnRef(bar1));
- EXPECT_CALL(Const(foo), GetBar()) // The const GetBar().
- .WillOnce(ReturnRef(bar2));
-```
-
-(`Const()` is defined by gMock and returns a `const` reference to its argument.)
-
-To disambiguate overloaded functions with the same number of arguments but
-different argument types, you may need to specify the exact type of a matcher,
-either by wrapping your matcher in `Matcher<type>()`, or using a matcher whose
-type is fixed (`TypedEq<type>`, `An<type>()`, etc):
-
-```cpp
-using ::testing::An;
-using ::testing::Matcher;
-using ::testing::TypedEq;
-
-class MockPrinter : public Printer {
- public:
- MOCK_METHOD(void, Print, (int n), (override));
- MOCK_METHOD(void, Print, (char c), (override));
-};
-
-TEST(PrinterTest, Print) {
- MockPrinter printer;
-
- EXPECT_CALL(printer, Print(An<int>())); // void Print(int);
- EXPECT_CALL(printer, Print(Matcher<int>(Lt(5)))); // void Print(int);
- EXPECT_CALL(printer, Print(TypedEq<char>('a'))); // void Print(char);
-
- printer.Print(3);
- printer.Print(6);
- printer.Print('a');
-}
-```
-
-### Performing Different Actions Based on the Arguments
-
-When a mock method is called, the *last* matching expectation that's still
-active will be selected (think "newer overrides older"). So, you can make a
-method do different things depending on its argument values like this:
-
-```cpp
-using ::testing::_;
-using ::testing::Lt;
-using ::testing::Return;
-...
- // The default case.
- EXPECT_CALL(foo, DoThis(_))
- .WillRepeatedly(Return('b'));
- // The more specific case.
- EXPECT_CALL(foo, DoThis(Lt(5)))
- .WillRepeatedly(Return('a'));
-```
-
-Now, if `foo.DoThis()` is called with a value less than 5, `'a'` will be
-returned; otherwise `'b'` will be returned.
-
-### Matching Multiple Arguments as a Whole
-
-Sometimes it's not enough to match the arguments individually. For example, we
-may want to say that the first argument must be less than the second argument.
-The `With()` clause allows us to match all arguments of a mock function as a
-whole. For example,
-
-```cpp
-using ::testing::_;
-using ::testing::Ne;
-using ::testing::Lt;
-...
- EXPECT_CALL(foo, InRange(Ne(0), _))
- .With(Lt());
-```
-
-says that the first argument of `InRange()` must not be 0, and must be less than
-the second argument.
-
-The expression inside `With()` must be a matcher of type `Matcher<std::tuple<A1,
-..., An>>`, where `A1`, ..., `An` are the types of the function arguments.
-
-You can also write `AllArgs(m)` instead of `m` inside `.With()`. The two forms
-are equivalent, but `.With(AllArgs(Lt()))` is more readable than `.With(Lt())`.
-
-You can use `Args<k1, ..., kn>(m)` to match the `n` selected arguments (as a
-tuple) against `m`. For example,
-
-```cpp
-using ::testing::_;
-using ::testing::AllOf;
-using ::testing::Args;
-using ::testing::Lt;
-...
- EXPECT_CALL(foo, Blah)
- .With(AllOf(Args<0, 1>(Lt()), Args<1, 2>(Lt())));
-```
-
-says that `Blah` will be called with arguments `x`, `y`, and `z` where `x < y <
-z`. Note that in this example, it wasn't necessary to specify the positional
-matchers.
-
-As a convenience and example, gMock provides some matchers for 2-tuples,
-including the `Lt()` matcher above. See
-[Multi-argument Matchers](reference/matchers.md#MultiArgMatchers) for the
-complete list.
-
-Note that if you want to pass the arguments to a predicate of your own (e.g.
-`.With(Args<0, 1>(Truly(&MyPredicate)))`), that predicate MUST be written to
-take a `std::tuple` as its argument; gMock will pass the `n` selected arguments
-as *one* single tuple to the predicate.
-
-### Using Matchers as Predicates
-
-Have you noticed that a matcher is just a fancy predicate that also knows how to
-describe itself? Many existing algorithms take predicates as arguments (e.g.
-those defined in STL's `<algorithm>` header), and it would be a shame if gMock
-matchers were not allowed to participate.
-
-Luckily, you can use a matcher where a unary predicate functor is expected by
-wrapping it inside the `Matches()` function. For example,
-
-```cpp
-#include <algorithm>
-#include <vector>
-
-using ::testing::Matches;
-using ::testing::Ge;
-
-vector<int> v;
-...
-// How many elements in v are >= 10?
-const int count = count_if(v.begin(), v.end(), Matches(Ge(10)));
-```
-
-Since you can build complex matchers from simpler ones easily using gMock, this
-gives you a way to conveniently construct composite predicates (doing the same
-using STL's `<functional>` header is just painful). For example, here's a
-predicate that's satisfied by any number that is >= 0, <= 100, and != 50:
-
-```cpp
-using testing::AllOf;
-using testing::Ge;
-using testing::Le;
-using testing::Matches;
-using testing::Ne;
-...
-Matches(AllOf(Ge(0), Le(100), Ne(50)))
-```
-
-### Using Matchers in googletest Assertions
-
-See [`EXPECT_THAT`](reference/assertions.md#EXPECT_THAT) in the Assertions
-Reference.
-
-### Using Predicates as Matchers
-
-gMock provides a set of built-in matchers for matching arguments with expected
-values—see the [Matchers Reference](reference/matchers.md) for more information.
-In case you find the built-in set lacking, you can use an arbitrary unary
-predicate function or functor as a matcher - as long as the predicate accepts a
-value of the type you want. You do this by wrapping the predicate inside the
-`Truly()` function, for example:
-
-```cpp
-using ::testing::Truly;
-
-int IsEven(int n) { return (n % 2) == 0 ? 1 : 0; }
-...
- // Bar() must be called with an even number.
- EXPECT_CALL(foo, Bar(Truly(IsEven)));
-```
-
-Note that the predicate function / functor doesn't have to return `bool`. It
-works as long as the return value can be used as the condition in in statement
-`if (condition) ...`.
-
-### Matching Arguments that Are Not Copyable
-
-When you do an `EXPECT_CALL(mock_obj, Foo(bar))`, gMock saves away a copy of
-`bar`. When `Foo()` is called later, gMock compares the argument to `Foo()` with
-the saved copy of `bar`. This way, you don't need to worry about `bar` being
-modified or destroyed after the `EXPECT_CALL()` is executed. The same is true
-when you use matchers like `Eq(bar)`, `Le(bar)`, and so on.
-
-But what if `bar` cannot be copied (i.e. has no copy constructor)? You could
-define your own matcher function or callback and use it with `Truly()`, as the
-previous couple of recipes have shown. Or, you may be able to get away from it
-if you can guarantee that `bar` won't be changed after the `EXPECT_CALL()` is
-executed. Just tell gMock that it should save a reference to `bar`, instead of a
-copy of it. Here's how:
-
-```cpp
-using ::testing::Eq;
-using ::testing::Lt;
-...
- // Expects that Foo()'s argument == bar.
- EXPECT_CALL(mock_obj, Foo(Eq(std::ref(bar))));
-
- // Expects that Foo()'s argument < bar.
- EXPECT_CALL(mock_obj, Foo(Lt(std::ref(bar))));
-```
-
-Remember: if you do this, don't change `bar` after the `EXPECT_CALL()`, or the
-result is undefined.
-
-### Validating a Member of an Object
-
-Often a mock function takes a reference to object as an argument. When matching
-the argument, you may not want to compare the entire object against a fixed
-object, as that may be over-specification. Instead, you may need to validate a
-certain member variable or the result of a certain getter method of the object.
-You can do this with `Field()` and `Property()`. More specifically,
-
-```cpp
-Field(&Foo::bar, m)
-```
-
-is a matcher that matches a `Foo` object whose `bar` member variable satisfies
-matcher `m`.
-
-```cpp
-Property(&Foo::baz, m)
-```
-
-is a matcher that matches a `Foo` object whose `baz()` method returns a value
-that satisfies matcher `m`.
-
-For example:
-
-| Expression | Description |
-| :--------------------------- | :--------------------------------------- |
-| `Field(&Foo::number, Ge(3))` | Matches `x` where `x.number >= 3`. |
-| `Property(&Foo::name, StartsWith("John "))` | Matches `x` where `x.name()` starts with `"John "`. |
-
-Note that in `Property(&Foo::baz, ...)`, method `baz()` must take no argument
-and be declared as `const`. Don't use `Property()` against member functions that
-you do not own, because taking addresses of functions is fragile and generally
-not part of the contract of the function.
-
-`Field()` and `Property()` can also match plain pointers to objects. For
-instance,
-
-```cpp
-using ::testing::Field;
-using ::testing::Ge;
-...
-Field(&Foo::number, Ge(3))
-```
-
-matches a plain pointer `p` where `p->number >= 3`. If `p` is `NULL`, the match
-will always fail regardless of the inner matcher.
-
-What if you want to validate more than one members at the same time? Remember
-that there are [`AllOf()` and `AllOfArray()`](#CombiningMatchers).
-
-Finally `Field()` and `Property()` provide overloads that take the field or
-property names as the first argument to include it in the error message. This
-can be useful when creating combined matchers.
-
-```cpp
-using ::testing::AllOf;
-using ::testing::Field;
-using ::testing::Matcher;
-using ::testing::SafeMatcherCast;
-
-Matcher<Foo> IsFoo(const Foo& foo) {
- return AllOf(Field("some_field", &Foo::some_field, foo.some_field),
- Field("other_field", &Foo::other_field, foo.other_field),
- Field("last_field", &Foo::last_field, foo.last_field));
-}
-```
-
-### Validating the Value Pointed to by a Pointer Argument
-
-C++ functions often take pointers as arguments. You can use matchers like
-`IsNull()`, `NotNull()`, and other comparison matchers to match a pointer, but
-what if you want to make sure the value *pointed to* by the pointer, instead of
-the pointer itself, has a certain property? Well, you can use the `Pointee(m)`
-matcher.
-
-`Pointee(m)` matches a pointer if and only if `m` matches the value the pointer
-points to. For example:
-
-```cpp
-using ::testing::Ge;
-using ::testing::Pointee;
-...
- EXPECT_CALL(foo, Bar(Pointee(Ge(3))));
-```
-
-expects `foo.Bar()` to be called with a pointer that points to a value greater
-than or equal to 3.
-
-One nice thing about `Pointee()` is that it treats a `NULL` pointer as a match
-failure, so you can write `Pointee(m)` instead of
-
-```cpp
-using ::testing::AllOf;
-using ::testing::NotNull;
-using ::testing::Pointee;
-...
- AllOf(NotNull(), Pointee(m))
-```
-
-without worrying that a `NULL` pointer will crash your test.
-
-Also, did we tell you that `Pointee()` works with both raw pointers **and**
-smart pointers (`std::unique_ptr`, `std::shared_ptr`, etc)?
-
-What if you have a pointer to pointer? You guessed it - you can use nested
-`Pointee()` to probe deeper inside the value. For example,
-`Pointee(Pointee(Lt(3)))` matches a pointer that points to a pointer that points
-to a number less than 3 (what a mouthful...).
-
-### Testing a Certain Property of an Object
-
-Sometimes you want to specify that an object argument has a certain property,
-but there is no existing matcher that does this. If you want good error
-messages, you should [define a matcher](#NewMatchers). If you want to do it
-quick and dirty, you could get away with writing an ordinary function.
-
-Let's say you have a mock function that takes an object of type `Foo`, which has
-an `int bar()` method and an `int baz()` method, and you want to constrain that
-the argument's `bar()` value plus its `baz()` value is a given number. Here's
-how you can define a matcher to do it:
-
-```cpp
-using ::testing::Matcher;
-
-class BarPlusBazEqMatcher {
- public:
- explicit BarPlusBazEqMatcher(int expected_sum)
- : expected_sum_(expected_sum) {}
-
- bool MatchAndExplain(const Foo& foo,
- std::ostream* /* listener */) const {
- return (foo.bar() + foo.baz()) == expected_sum_;
- }
-
- void DescribeTo(std::ostream& os) const {
- os << "bar() + baz() equals " << expected_sum_;
- }
-
- void DescribeNegationTo(std::ostream& os) const {
- os << "bar() + baz() does not equal " << expected_sum_;
- }
- private:
- const int expected_sum_;
-};
-
-Matcher<const Foo&> BarPlusBazEq(int expected_sum) {
- return BarPlusBazEqMatcher(expected_sum);
-}
-
-...
- EXPECT_CALL(..., DoThis(BarPlusBazEq(5)))...;
-```
-
-### Matching Containers
-
-Sometimes an STL container (e.g. list, vector, map, ...) is passed to a mock
-function and you may want to validate it. Since most STL containers support the
-`==` operator, you can write `Eq(expected_container)` or simply
-`expected_container` to match a container exactly.
-
-Sometimes, though, you may want to be more flexible (for example, the first
-element must be an exact match, but the second element can be any positive
-number, and so on). Also, containers used in tests often have a small number of
-elements, and having to define the expected container out-of-line is a bit of a
-hassle.
-
-You can use the `ElementsAre()` or `UnorderedElementsAre()` matcher in such
-cases:
-
-```cpp
-using ::testing::_;
-using ::testing::ElementsAre;
-using ::testing::Gt;
-...
- MOCK_METHOD(void, Foo, (const vector<int>& numbers), (override));
-...
- EXPECT_CALL(mock, Foo(ElementsAre(1, Gt(0), _, 5)));
-```
-
-The above matcher says that the container must have 4 elements, which must be 1,
-greater than 0, anything, and 5 respectively.
-
-If you instead write:
-
-```cpp
-using ::testing::_;
-using ::testing::Gt;
-using ::testing::UnorderedElementsAre;
-...
- MOCK_METHOD(void, Foo, (const vector<int>& numbers), (override));
-...
- EXPECT_CALL(mock, Foo(UnorderedElementsAre(1, Gt(0), _, 5)));
-```
-
-It means that the container must have 4 elements, which (under some permutation)
-must be 1, greater than 0, anything, and 5 respectively.
-
-As an alternative you can place the arguments in a C-style array and use
-`ElementsAreArray()` or `UnorderedElementsAreArray()` instead:
-
-```cpp
-using ::testing::ElementsAreArray;
-...
- // ElementsAreArray accepts an array of element values.
- const int expected_vector1[] = {1, 5, 2, 4, ...};
- EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector1)));
-
- // Or, an array of element matchers.
- Matcher<int> expected_vector2[] = {1, Gt(2), _, 3, ...};
- EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector2)));
-```
-
-In case the array needs to be dynamically created (and therefore the array size
-cannot be inferred by the compiler), you can give `ElementsAreArray()` an
-additional argument to specify the array size:
-
-```cpp
-using ::testing::ElementsAreArray;
-...
- int* const expected_vector3 = new int[count];
- ... fill expected_vector3 with values ...
- EXPECT_CALL(mock, Foo(ElementsAreArray(expected_vector3, count)));
-```
-
-Use `Pair` when comparing maps or other associative containers.
-
-{% raw %}
-
-```cpp
-using testing::ElementsAre;
-using testing::Pair;
-...
- std::map<string, int> m = {{"a", 1}, {"b", 2}, {"c", 3}};
- EXPECT_THAT(m, ElementsAre(Pair("a", 1), Pair("b", 2), Pair("c", 3)));
-```
-
-{% endraw %}
-
-**Tips:**
-
-* `ElementsAre*()` can be used to match *any* container that implements the
- STL iterator pattern (i.e. it has a `const_iterator` type and supports
- `begin()/end()`), not just the ones defined in STL. It will even work with
- container types yet to be written - as long as they follows the above
- pattern.
-* You can use nested `ElementsAre*()` to match nested (multi-dimensional)
- containers.
-* If the container is passed by pointer instead of by reference, just write
- `Pointee(ElementsAre*(...))`.
-* The order of elements *matters* for `ElementsAre*()`. If you are using it
- with containers whose element order are undefined (e.g. `hash_map`) you
- should use `WhenSorted` around `ElementsAre`.
-
-### Sharing Matchers
-
-Under the hood, a gMock matcher object consists of a pointer to a ref-counted
-implementation object. Copying matchers is allowed and very efficient, as only
-the pointer is copied. When the last matcher that references the implementation
-object dies, the implementation object will be deleted.
-
-Therefore, if you have some complex matcher that you want to use again and
-again, there is no need to build it every time. Just assign it to a matcher
-variable and use that variable repeatedly! For example,
-
-```cpp
-using ::testing::AllOf;
-using ::testing::Gt;
-using ::testing::Le;
-using ::testing::Matcher;
-...
- Matcher<int> in_range = AllOf(Gt(5), Le(10));
- ... use in_range as a matcher in multiple EXPECT_CALLs ...
-```
-
-### Matchers must have no side-effects {#PureMatchers}
-
-{: .callout .warning}
-WARNING: gMock does not guarantee when or how many times a matcher will be
-invoked. Therefore, all matchers must be *purely functional*: they cannot have
-any side effects, and the match result must not depend on anything other than
-the matcher's parameters and the value being matched.
-
-This requirement must be satisfied no matter how a matcher is defined (e.g., if
-it is one of the standard matchers, or a custom matcher). In particular, a
-matcher can never call a mock function, as that will affect the state of the
-mock object and gMock.
-
-## Setting Expectations
-
-### Knowing When to Expect {#UseOnCall}
-
-**`ON_CALL`** is likely the *single most under-utilized construct* in gMock.
-
-There are basically two constructs for defining the behavior of a mock object:
-`ON_CALL` and `EXPECT_CALL`. The difference? `ON_CALL` defines what happens when
-a mock method is called, but <em>doesn't imply any expectation on the method
-being called</em>. `EXPECT_CALL` not only defines the behavior, but also sets an
-expectation that <em>the method will be called with the given arguments, for the
-given number of times</em> (and *in the given order* when you specify the order
-too).
-
-Since `EXPECT_CALL` does more, isn't it better than `ON_CALL`? Not really. Every
-`EXPECT_CALL` adds a constraint on the behavior of the code under test. Having
-more constraints than necessary is *baaad* - even worse than not having enough
-constraints.
-
-This may be counter-intuitive. How could tests that verify more be worse than
-tests that verify less? Isn't verification the whole point of tests?
-
-The answer lies in *what* a test should verify. **A good test verifies the
-contract of the code.** If a test over-specifies, it doesn't leave enough
-freedom to the implementation. As a result, changing the implementation without
-breaking the contract (e.g. refactoring and optimization), which should be
-perfectly fine to do, can break such tests. Then you have to spend time fixing
-them, only to see them broken again the next time the implementation is changed.
-
-Keep in mind that one doesn't have to verify more than one property in one test.
-In fact, **it's a good style to verify only one thing in one test.** If you do
-that, a bug will likely break only one or two tests instead of dozens (which
-case would you rather debug?). If you are also in the habit of giving tests
-descriptive names that tell what they verify, you can often easily guess what's
-wrong just from the test log itself.
-
-So use `ON_CALL` by default, and only use `EXPECT_CALL` when you actually intend
-to verify that the call is made. For example, you may have a bunch of `ON_CALL`s
-in your test fixture to set the common mock behavior shared by all tests in the
-same group, and write (scarcely) different `EXPECT_CALL`s in different `TEST_F`s
-to verify different aspects of the code's behavior. Compared with the style
-where each `TEST` has many `EXPECT_CALL`s, this leads to tests that are more
-resilient to implementational changes (and thus less likely to require
-maintenance) and makes the intent of the tests more obvious (so they are easier
-to maintain when you do need to maintain them).
-
-If you are bothered by the "Uninteresting mock function call" message printed
-when a mock method without an `EXPECT_CALL` is called, you may use a `NiceMock`
-instead to suppress all such messages for the mock object, or suppress the
-message for specific methods by adding `EXPECT_CALL(...).Times(AnyNumber())`. DO
-NOT suppress it by blindly adding an `EXPECT_CALL(...)`, or you'll have a test
-that's a pain to maintain.
-
-### Ignoring Uninteresting Calls
-
-If you are not interested in how a mock method is called, just don't say
-anything about it. In this case, if the method is ever called, gMock will
-perform its default action to allow the test program to continue. If you are not
-happy with the default action taken by gMock, you can override it using
-`DefaultValue<T>::Set()` (described [here](#DefaultValue)) or `ON_CALL()`.
-
-Please note that once you expressed interest in a particular mock method (via
-`EXPECT_CALL()`), all invocations to it must match some expectation. If this
-function is called but the arguments don't match any `EXPECT_CALL()` statement,
-it will be an error.
-
-### Disallowing Unexpected Calls
-
-If a mock method shouldn't be called at all, explicitly say so:
-
-```cpp
-using ::testing::_;
-...
- EXPECT_CALL(foo, Bar(_))
- .Times(0);
-```
-
-If some calls to the method are allowed, but the rest are not, just list all the
-expected calls:
-
-```cpp
-using ::testing::AnyNumber;
-using ::testing::Gt;
-...
- EXPECT_CALL(foo, Bar(5));
- EXPECT_CALL(foo, Bar(Gt(10)))
- .Times(AnyNumber());
-```
-
-A call to `foo.Bar()` that doesn't match any of the `EXPECT_CALL()` statements
-will be an error.
-
-### Understanding Uninteresting vs Unexpected Calls {#uninteresting-vs-unexpected}
-
-*Uninteresting* calls and *unexpected* calls are different concepts in gMock.
-*Very* different.
-
-A call `x.Y(...)` is **uninteresting** if there's *not even a single*
-`EXPECT_CALL(x, Y(...))` set. In other words, the test isn't interested in the
-`x.Y()` method at all, as evident in that the test doesn't care to say anything
-about it.
-
-A call `x.Y(...)` is **unexpected** if there are *some* `EXPECT_CALL(x,
-Y(...))`s set, but none of them matches the call. Put another way, the test is
-interested in the `x.Y()` method (therefore it explicitly sets some
-`EXPECT_CALL` to verify how it's called); however, the verification fails as the
-test doesn't expect this particular call to happen.
-
-**An unexpected call is always an error,** as the code under test doesn't behave
-the way the test expects it to behave.
-
-**By default, an uninteresting call is not an error,** as it violates no
-constraint specified by the test. (gMock's philosophy is that saying nothing
-means there is no constraint.) However, it leads to a warning, as it *might*
-indicate a problem (e.g. the test author might have forgotten to specify a
-constraint).
-
-In gMock, `NiceMock` and `StrictMock` can be used to make a mock class "nice" or
-"strict". How does this affect uninteresting calls and unexpected calls?
-
-A **nice mock** suppresses uninteresting call *warnings*. It is less chatty than
-the default mock, but otherwise is the same. If a test fails with a default
-mock, it will also fail using a nice mock instead. And vice versa. Don't expect
-making a mock nice to change the test's result.
-
-A **strict mock** turns uninteresting call warnings into errors. So making a
-mock strict may change the test's result.
-
-Let's look at an example:
-
-```cpp
-TEST(...) {
- NiceMock<MockDomainRegistry> mock_registry;
- EXPECT_CALL(mock_registry, GetDomainOwner("google.com"))
- .WillRepeatedly(Return("Larry Page"));
-
- // Use mock_registry in code under test.
- ... &mock_registry ...
-}
-```
-
-The sole `EXPECT_CALL` here says that all calls to `GetDomainOwner()` must have
-`"google.com"` as the argument. If `GetDomainOwner("yahoo.com")` is called, it
-will be an unexpected call, and thus an error. *Having a nice mock doesn't
-change the severity of an unexpected call.*
-
-So how do we tell gMock that `GetDomainOwner()` can be called with some other
-arguments as well? The standard technique is to add a "catch all" `EXPECT_CALL`:
-
-```cpp
- EXPECT_CALL(mock_registry, GetDomainOwner(_))
- .Times(AnyNumber()); // catches all other calls to this method.
- EXPECT_CALL(mock_registry, GetDomainOwner("google.com"))
- .WillRepeatedly(Return("Larry Page"));
-```
-
-Remember that `_` is the wildcard matcher that matches anything. With this, if
-`GetDomainOwner("google.com")` is called, it will do what the second
-`EXPECT_CALL` says; if it is called with a different argument, it will do what
-the first `EXPECT_CALL` says.
-
-Note that the order of the two `EXPECT_CALL`s is important, as a newer
-`EXPECT_CALL` takes precedence over an older one.
-
-For more on uninteresting calls, nice mocks, and strict mocks, read
-["The Nice, the Strict, and the Naggy"](#NiceStrictNaggy).
-
-### Ignoring Uninteresting Arguments {#ParameterlessExpectations}
-
-If your test doesn't care about the parameters (it only cares about the number
-or order of calls), you can often simply omit the parameter list:
-
-```cpp
- // Expect foo.Bar( ... ) twice with any arguments.
- EXPECT_CALL(foo, Bar).Times(2);
-
- // Delegate to the given method whenever the factory is invoked.
- ON_CALL(foo_factory, MakeFoo)
- .WillByDefault(&BuildFooForTest);
-```
-
-This functionality is only available when a method is not overloaded; to prevent
-unexpected behavior it is a compilation error to try to set an expectation on a
-method where the specific overload is ambiguous. You can work around this by
-supplying a [simpler mock interface](#SimplerInterfaces) than the mocked class
-provides.
-
-This pattern is also useful when the arguments are interesting, but match logic
-is substantially complex. You can leave the argument list unspecified and use
-SaveArg actions to [save the values for later verification](#SaveArgVerify). If
-you do that, you can easily differentiate calling the method the wrong number of
-times from calling it with the wrong arguments.
-
-### Expecting Ordered Calls {#OrderedCalls}
-
-Although an `EXPECT_CALL()` statement defined later takes precedence when gMock
-tries to match a function call with an expectation, by default calls don't have
-to happen in the order `EXPECT_CALL()` statements are written. For example, if
-the arguments match the matchers in the second `EXPECT_CALL()`, but not those in
-the first and third, then the second expectation will be used.
-
-If you would rather have all calls occur in the order of the expectations, put
-the `EXPECT_CALL()` statements in a block where you define a variable of type
-`InSequence`:
-
-```cpp
-using ::testing::_;
-using ::testing::InSequence;
-
- {
- InSequence s;
-
- EXPECT_CALL(foo, DoThis(5));
- EXPECT_CALL(bar, DoThat(_))
- .Times(2);
- EXPECT_CALL(foo, DoThis(6));
- }
-```
-
-In this example, we expect a call to `foo.DoThis(5)`, followed by two calls to
-`bar.DoThat()` where the argument can be anything, which are in turn followed by
-a call to `foo.DoThis(6)`. If a call occurred out-of-order, gMock will report an
-error.
-
-### Expecting Partially Ordered Calls {#PartialOrder}
-
-Sometimes requiring everything to occur in a predetermined order can lead to
-brittle tests. For example, we may care about `A` occurring before both `B` and
-`C`, but aren't interested in the relative order of `B` and `C`. In this case,
-the test should reflect our real intent, instead of being overly constraining.
-
-gMock allows you to impose an arbitrary DAG (directed acyclic graph) on the
-calls. One way to express the DAG is to use the
-[`After` clause](reference/mocking.md#EXPECT_CALL.After) of `EXPECT_CALL`.
-
-Another way is via the `InSequence()` clause (not the same as the `InSequence`
-class), which we borrowed from jMock 2. It's less flexible than `After()`, but
-more convenient when you have long chains of sequential calls, as it doesn't
-require you to come up with different names for the expectations in the chains.
-Here's how it works:
-
-If we view `EXPECT_CALL()` statements as nodes in a graph, and add an edge from
-node A to node B wherever A must occur before B, we can get a DAG. We use the
-term "sequence" to mean a directed path in this DAG. Now, if we decompose the
-DAG into sequences, we just need to know which sequences each `EXPECT_CALL()`
-belongs to in order to be able to reconstruct the original DAG.
-
-So, to specify the partial order on the expectations we need to do two things:
-first to define some `Sequence` objects, and then for each `EXPECT_CALL()` say
-which `Sequence` objects it is part of.
-
-Expectations in the same sequence must occur in the order they are written. For
-example,
-
-```cpp
-using ::testing::Sequence;
-...
- Sequence s1, s2;
-
- EXPECT_CALL(foo, A())
- .InSequence(s1, s2);
- EXPECT_CALL(bar, B())
- .InSequence(s1);
- EXPECT_CALL(bar, C())
- .InSequence(s2);
- EXPECT_CALL(foo, D())
- .InSequence(s2);
-```
-
-specifies the following DAG (where `s1` is `A -> B`, and `s2` is `A -> C -> D`):
-
-```text
- +---> B
- |
- A ---|
- |
- +---> C ---> D
-```
-
-This means that A must occur before B and C, and C must occur before D. There's
-no restriction about the order other than these.
-
-### Controlling When an Expectation Retires
-
-When a mock method is called, gMock only considers expectations that are still
-active. An expectation is active when created, and becomes inactive (aka
-*retires*) when a call that has to occur later has occurred. For example, in
-
-```cpp
-using ::testing::_;
-using ::testing::Sequence;
-...
- Sequence s1, s2;
-
- EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #1
- .Times(AnyNumber())
- .InSequence(s1, s2);
- EXPECT_CALL(log, Log(WARNING, _, "Data set is empty.")) // #2
- .InSequence(s1);
- EXPECT_CALL(log, Log(WARNING, _, "User not found.")) // #3
- .InSequence(s2);
-```
-
-as soon as either #2 or #3 is matched, #1 will retire. If a warning `"File too
-large."` is logged after this, it will be an error.
-
-Note that an expectation doesn't retire automatically when it's saturated. For
-example,
-
-```cpp
-using ::testing::_;
-...
- EXPECT_CALL(log, Log(WARNING, _, _)); // #1
- EXPECT_CALL(log, Log(WARNING, _, "File too large.")); // #2
-```
-
-says that there will be exactly one warning with the message `"File too
-large."`. If the second warning contains this message too, #2 will match again
-and result in an upper-bound-violated error.
-
-If this is not what you want, you can ask an expectation to retire as soon as it
-becomes saturated:
-
-```cpp
-using ::testing::_;
-...
- EXPECT_CALL(log, Log(WARNING, _, _)); // #1
- EXPECT_CALL(log, Log(WARNING, _, "File too large.")) // #2
- .RetiresOnSaturation();
-```
-
-Here #2 can be used only once, so if you have two warnings with the message
-`"File too large."`, the first will match #2 and the second will match #1 -
-there will be no error.
-
-## Using Actions
-
-### Returning References from Mock Methods
-
-If a mock function's return type is a reference, you need to use `ReturnRef()`
-instead of `Return()` to return a result:
-
-```cpp
-using ::testing::ReturnRef;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(Bar&, GetBar, (), (override));
-};
-...
- MockFoo foo;
- Bar bar;
- EXPECT_CALL(foo, GetBar())
- .WillOnce(ReturnRef(bar));
-...
-```
-
-### Returning Live Values from Mock Methods
-
-The `Return(x)` action saves a copy of `x` when the action is created, and
-always returns the same value whenever it's executed. Sometimes you may want to
-instead return the *live* value of `x` (i.e. its value at the time when the
-action is *executed*.). Use either `ReturnRef()` or `ReturnPointee()` for this
-purpose.
-
-If the mock function's return type is a reference, you can do it using
-`ReturnRef(x)`, as shown in the previous recipe ("Returning References from Mock
-Methods"). However, gMock doesn't let you use `ReturnRef()` in a mock function
-whose return type is not a reference, as doing that usually indicates a user
-error. So, what shall you do?
-
-Though you may be tempted, DO NOT use `std::ref()`:
-
-```cpp
-using testing::Return;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(int, GetValue, (), (override));
-};
-...
- int x = 0;
- MockFoo foo;
- EXPECT_CALL(foo, GetValue())
- .WillRepeatedly(Return(std::ref(x))); // Wrong!
- x = 42;
- EXPECT_EQ(42, foo.GetValue());
-```
-
-Unfortunately, it doesn't work here. The above code will fail with error:
-
-```text
-Value of: foo.GetValue()
- Actual: 0
-Expected: 42
-```
-
-The reason is that `Return(*value*)` converts `value` to the actual return type
-of the mock function at the time when the action is *created*, not when it is
-*executed*. (This behavior was chosen for the action to be safe when `value` is
-a proxy object that references some temporary objects.) As a result,
-`std::ref(x)` is converted to an `int` value (instead of a `const int&`) when
-the expectation is set, and `Return(std::ref(x))` will always return 0.
-
-`ReturnPointee(pointer)` was provided to solve this problem specifically. It
-returns the value pointed to by `pointer` at the time the action is *executed*:
-
-```cpp
-using testing::ReturnPointee;
-...
- int x = 0;
- MockFoo foo;
- EXPECT_CALL(foo, GetValue())
- .WillRepeatedly(ReturnPointee(&x)); // Note the & here.
- x = 42;
- EXPECT_EQ(42, foo.GetValue()); // This will succeed now.
-```
-
-### Combining Actions
-
-Want to do more than one thing when a function is called? That's fine. `DoAll()`
-allow you to do sequence of actions every time. Only the return value of the
-last action in the sequence will be used.
-
-```cpp
-using ::testing::_;
-using ::testing::DoAll;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(bool, Bar, (int n), (override));
-};
-...
- EXPECT_CALL(foo, Bar(_))
- .WillOnce(DoAll(action_1,
- action_2,
- ...
- action_n));
-```
-
-### Verifying Complex Arguments {#SaveArgVerify}
-
-If you want to verify that a method is called with a particular argument but the
-match criteria is complex, it can be difficult to distinguish between
-cardinality failures (calling the method the wrong number of times) and argument
-match failures. Similarly, if you are matching multiple parameters, it may not
-be easy to distinguishing which argument failed to match. For example:
-
-```cpp
- // Not ideal: this could fail because of a problem with arg1 or arg2, or maybe
- // just the method wasn't called.
- EXPECT_CALL(foo, SendValues(_, ElementsAre(1, 4, 4, 7), EqualsProto( ... )));
-```
-
-You can instead save the arguments and test them individually:
-
-```cpp
- EXPECT_CALL(foo, SendValues)
- .WillOnce(DoAll(SaveArg<1>(&actual_array), SaveArg<2>(&actual_proto)));
- ... run the test
- EXPECT_THAT(actual_array, ElementsAre(1, 4, 4, 7));
- EXPECT_THAT(actual_proto, EqualsProto( ... ));
-```
-
-### Mocking Side Effects {#MockingSideEffects}
-
-Sometimes a method exhibits its effect not via returning a value but via side
-effects. For example, it may change some global state or modify an output
-argument. To mock side effects, in general you can define your own action by
-implementing `::testing::ActionInterface`.
-
-If all you need to do is to change an output argument, the built-in
-`SetArgPointee()` action is convenient:
-
-```cpp
-using ::testing::_;
-using ::testing::SetArgPointee;
-
-class MockMutator : public Mutator {
- public:
- MOCK_METHOD(void, Mutate, (bool mutate, int* value), (override));
- ...
-}
-...
- MockMutator mutator;
- EXPECT_CALL(mutator, Mutate(true, _))
- .WillOnce(SetArgPointee<1>(5));
-```
-
-In this example, when `mutator.Mutate()` is called, we will assign 5 to the
-`int` variable pointed to by argument #1 (0-based).
-
-`SetArgPointee()` conveniently makes an internal copy of the value you pass to
-it, removing the need to keep the value in scope and alive. The implication
-however is that the value must have a copy constructor and assignment operator.
-
-If the mock method also needs to return a value as well, you can chain
-`SetArgPointee()` with `Return()` using `DoAll()`, remembering to put the
-`Return()` statement last:
-
-```cpp
-using ::testing::_;
-using ::testing::DoAll;
-using ::testing::Return;
-using ::testing::SetArgPointee;
-
-class MockMutator : public Mutator {
- public:
- ...
- MOCK_METHOD(bool, MutateInt, (int* value), (override));
-}
-...
- MockMutator mutator;
- EXPECT_CALL(mutator, MutateInt(_))
- .WillOnce(DoAll(SetArgPointee<0>(5),
- Return(true)));
-```
-
-Note, however, that if you use the `ReturnOKWith()` method, it will override the
-values provided by `SetArgPointee()` in the response parameters of your function
-call.
-
-If the output argument is an array, use the `SetArrayArgument<N>(first, last)`
-action instead. It copies the elements in source range `[first, last)` to the
-array pointed to by the `N`-th (0-based) argument:
-
-```cpp
-using ::testing::NotNull;
-using ::testing::SetArrayArgument;
-
-class MockArrayMutator : public ArrayMutator {
- public:
- MOCK_METHOD(void, Mutate, (int* values, int num_values), (override));
- ...
-}
-...
- MockArrayMutator mutator;
- int values[5] = {1, 2, 3, 4, 5};
- EXPECT_CALL(mutator, Mutate(NotNull(), 5))
- .WillOnce(SetArrayArgument<0>(values, values + 5));
-```
-
-This also works when the argument is an output iterator:
-
-```cpp
-using ::testing::_;
-using ::testing::SetArrayArgument;
-
-class MockRolodex : public Rolodex {
- public:
- MOCK_METHOD(void, GetNames, (std::back_insert_iterator<vector<string>>),
- (override));
- ...
-}
-...
- MockRolodex rolodex;
- vector<string> names = {"George", "John", "Thomas"};
- EXPECT_CALL(rolodex, GetNames(_))
- .WillOnce(SetArrayArgument<0>(names.begin(), names.end()));
-```
-
-### Changing a Mock Object's Behavior Based on the State
-
-If you expect a call to change the behavior of a mock object, you can use
-`::testing::InSequence` to specify different behaviors before and after the
-call:
-
-```cpp
-using ::testing::InSequence;
-using ::testing::Return;
-
-...
- {
- InSequence seq;
- EXPECT_CALL(my_mock, IsDirty())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(my_mock, Flush());
- EXPECT_CALL(my_mock, IsDirty())
- .WillRepeatedly(Return(false));
- }
- my_mock.FlushIfDirty();
-```
-
-This makes `my_mock.IsDirty()` return `true` before `my_mock.Flush()` is called
-and return `false` afterwards.
-
-If the behavior change is more complex, you can store the effects in a variable
-and make a mock method get its return value from that variable:
-
-```cpp
-using ::testing::_;
-using ::testing::SaveArg;
-using ::testing::Return;
-
-ACTION_P(ReturnPointee, p) { return *p; }
-...
- int previous_value = 0;
- EXPECT_CALL(my_mock, GetPrevValue)
- .WillRepeatedly(ReturnPointee(&previous_value));
- EXPECT_CALL(my_mock, UpdateValue)
- .WillRepeatedly(SaveArg<0>(&previous_value));
- my_mock.DoSomethingToUpdateValue();
-```
-
-Here `my_mock.GetPrevValue()` will always return the argument of the last
-`UpdateValue()` call.
-
-### Setting the Default Value for a Return Type {#DefaultValue}
-
-If a mock method's return type is a built-in C++ type or pointer, by default it
-will return 0 when invoked. Also, in C++ 11 and above, a mock method whose
-return type has a default constructor will return a default-constructed value by
-default. You only need to specify an action if this default value doesn't work
-for you.
-
-Sometimes, you may want to change this default value, or you may want to specify
-a default value for types gMock doesn't know about. You can do this using the
-`::testing::DefaultValue` class template:
-
-```cpp
-using ::testing::DefaultValue;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(Bar, CalculateBar, (), (override));
-};
-
-
-...
- Bar default_bar;
- // Sets the default return value for type Bar.
- DefaultValue<Bar>::Set(default_bar);
-
- MockFoo foo;
-
- // We don't need to specify an action here, as the default
- // return value works for us.
- EXPECT_CALL(foo, CalculateBar());
-
- foo.CalculateBar(); // This should return default_bar.
-
- // Unsets the default return value.
- DefaultValue<Bar>::Clear();
-```
-
-Please note that changing the default value for a type can make your tests hard
-to understand. We recommend you to use this feature judiciously. For example,
-you may want to make sure the `Set()` and `Clear()` calls are right next to the
-code that uses your mock.
-
-### Setting the Default Actions for a Mock Method
-
-You've learned how to change the default value of a given type. However, this
-may be too coarse for your purpose: perhaps you have two mock methods with the
-same return type and you want them to have different behaviors. The `ON_CALL()`
-macro allows you to customize your mock's behavior at the method level:
-
-```cpp
-using ::testing::_;
-using ::testing::AnyNumber;
-using ::testing::Gt;
-using ::testing::Return;
-...
- ON_CALL(foo, Sign(_))
- .WillByDefault(Return(-1));
- ON_CALL(foo, Sign(0))
- .WillByDefault(Return(0));
- ON_CALL(foo, Sign(Gt(0)))
- .WillByDefault(Return(1));
-
- EXPECT_CALL(foo, Sign(_))
- .Times(AnyNumber());
-
- foo.Sign(5); // This should return 1.
- foo.Sign(-9); // This should return -1.
- foo.Sign(0); // This should return 0.
-```
-
-As you may have guessed, when there are more than one `ON_CALL()` statements,
-the newer ones in the order take precedence over the older ones. In other words,
-the **last** one that matches the function arguments will be used. This matching
-order allows you to set up the common behavior in a mock object's constructor or
-the test fixture's set-up phase and specialize the mock's behavior later.
-
-Note that both `ON_CALL` and `EXPECT_CALL` have the same "later statements take
-precedence" rule, but they don't interact. That is, `EXPECT_CALL`s have their
-own precedence order distinct from the `ON_CALL` precedence order.
-
-### Using Functions/Methods/Functors/Lambdas as Actions {#FunctionsAsActions}
-
-If the built-in actions don't suit you, you can use an existing callable
-(function, `std::function`, method, functor, lambda) as an action.
-
-```cpp
-using ::testing::_; using ::testing::Invoke;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(int, Sum, (int x, int y), (override));
- MOCK_METHOD(bool, ComplexJob, (int x), (override));
-};
-
-int CalculateSum(int x, int y) { return x + y; }
-int Sum3(int x, int y, int z) { return x + y + z; }
-
-class Helper {
- public:
- bool ComplexJob(int x);
-};
-
-...
- MockFoo foo;
- Helper helper;
- EXPECT_CALL(foo, Sum(_, _))
- .WillOnce(&CalculateSum)
- .WillRepeatedly(Invoke(NewPermanentCallback(Sum3, 1)));
- EXPECT_CALL(foo, ComplexJob(_))
- .WillOnce(Invoke(&helper, &Helper::ComplexJob))
- .WillOnce([] { return true; })
- .WillRepeatedly([](int x) { return x > 0; });
-
- foo.Sum(5, 6); // Invokes CalculateSum(5, 6).
- foo.Sum(2, 3); // Invokes Sum3(1, 2, 3).
- foo.ComplexJob(10); // Invokes helper.ComplexJob(10).
- foo.ComplexJob(-1); // Invokes the inline lambda.
-```
-
-The only requirement is that the type of the function, etc must be *compatible*
-with the signature of the mock function, meaning that the latter's arguments (if
-it takes any) can be implicitly converted to the corresponding arguments of the
-former, and the former's return type can be implicitly converted to that of the
-latter. So, you can invoke something whose type is *not* exactly the same as the
-mock function, as long as it's safe to do so - nice, huh?
-
-Note that:
-
-* The action takes ownership of the callback and will delete it when the
- action itself is destructed.
-* If the type of a callback is derived from a base callback type `C`, you need
- to implicitly cast it to `C` to resolve the overloading, e.g.
-
- ```cpp
- using ::testing::Invoke;
- ...
- ResultCallback<bool>* is_ok = ...;
- ... Invoke(is_ok) ...; // This works.
-
- BlockingClosure* done = new BlockingClosure;
- ... Invoke(implicit_cast<Closure*>(done)) ...; // The cast is necessary.
- ```
-
-### Using Functions with Extra Info as Actions
-
-The function or functor you call using `Invoke()` must have the same number of
-arguments as the mock function you use it for. Sometimes you may have a function
-that takes more arguments, and you are willing to pass in the extra arguments
-yourself to fill the gap. You can do this in gMock using callbacks with
-pre-bound arguments. Here's an example:
-
-```cpp
-using ::testing::Invoke;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(char, DoThis, (int n), (override));
-};
-
-char SignOfSum(int x, int y) {
- const int sum = x + y;
- return (sum > 0) ? '+' : (sum < 0) ? '-' : '0';
-}
-
-TEST_F(FooTest, Test) {
- MockFoo foo;
-
- EXPECT_CALL(foo, DoThis(2))
- .WillOnce(Invoke(NewPermanentCallback(SignOfSum, 5)));
- EXPECT_EQ('+', foo.DoThis(2)); // Invokes SignOfSum(5, 2).
-}
-```
-
-### Invoking a Function/Method/Functor/Lambda/Callback Without Arguments
-
-`Invoke()` passes the mock function's arguments to the function, etc being
-invoked such that the callee has the full context of the call to work with. If
-the invoked function is not interested in some or all of the arguments, it can
-simply ignore them.
-
-Yet, a common pattern is that a test author wants to invoke a function without
-the arguments of the mock function. She could do that using a wrapper function
-that throws away the arguments before invoking an underlining nullary function.
-Needless to say, this can be tedious and obscures the intent of the test.
-
-There are two solutions to this problem. First, you can pass any callable of
-zero args as an action. Alternatively, use `InvokeWithoutArgs()`, which is like
-`Invoke()` except that it doesn't pass the mock function's arguments to the
-callee. Here's an example of each:
-
-```cpp
-using ::testing::_;
-using ::testing::InvokeWithoutArgs;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(bool, ComplexJob, (int n), (override));
-};
-
-bool Job1() { ... }
-bool Job2(int n, char c) { ... }
-
-...
- MockFoo foo;
- EXPECT_CALL(foo, ComplexJob(_))
- .WillOnce([] { Job1(); });
- .WillOnce(InvokeWithoutArgs(NewPermanentCallback(Job2, 5, 'a')));
-
- foo.ComplexJob(10); // Invokes Job1().
- foo.ComplexJob(20); // Invokes Job2(5, 'a').
-```
-
-Note that:
-
-* The action takes ownership of the callback and will delete it when the
- action itself is destructed.
-* If the type of a callback is derived from a base callback type `C`, you need
- to implicitly cast it to `C` to resolve the overloading, e.g.
-
- ```cpp
- using ::testing::InvokeWithoutArgs;
- ...
- ResultCallback<bool>* is_ok = ...;
- ... InvokeWithoutArgs(is_ok) ...; // This works.
-
- BlockingClosure* done = ...;
- ... InvokeWithoutArgs(implicit_cast<Closure*>(done)) ...;
- // The cast is necessary.
- ```
-
-### Invoking an Argument of the Mock Function
-
-Sometimes a mock function will receive a function pointer, a functor (in other
-words, a "callable") as an argument, e.g.
-
-```cpp
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(bool, DoThis, (int n, (ResultCallback1<bool, int>* callback)),
- (override));
-};
-```
-
-and you may want to invoke this callable argument:
-
-```cpp
-using ::testing::_;
-...
- MockFoo foo;
- EXPECT_CALL(foo, DoThis(_, _))
- .WillOnce(...);
- // Will execute callback->Run(5), where callback is the
- // second argument DoThis() receives.
-```
-
-{: .callout .note}
-NOTE: The section below is legacy documentation from before C++ had lambdas:
-
-Arghh, you need to refer to a mock function argument but C++ has no lambda
-(yet), so you have to define your own action. :-( Or do you really?
-
-Well, gMock has an action to solve *exactly* this problem:
-
-```cpp
-InvokeArgument<N>(arg_1, arg_2, ..., arg_m)
-```
-
-will invoke the `N`-th (0-based) argument the mock function receives, with
-`arg_1`, `arg_2`, ..., and `arg_m`. No matter if the argument is a function
-pointer, a functor, or a callback. gMock handles them all.
-
-With that, you could write:
-
-```cpp
-using ::testing::_;
-using ::testing::InvokeArgument;
-...
- EXPECT_CALL(foo, DoThis(_, _))
- .WillOnce(InvokeArgument<1>(5));
- // Will execute callback->Run(5), where callback is the
- // second argument DoThis() receives.
-```
-
-What if the callable takes an argument by reference? No problem - just wrap it
-inside `std::ref()`:
-
-```cpp
- ...
- MOCK_METHOD(bool, Bar,
- ((ResultCallback2<bool, int, const Helper&>* callback)),
- (override));
- ...
- using ::testing::_;
- using ::testing::InvokeArgument;
- ...
- MockFoo foo;
- Helper helper;
- ...
- EXPECT_CALL(foo, Bar(_))
- .WillOnce(InvokeArgument<0>(5, std::ref(helper)));
- // std::ref(helper) guarantees that a reference to helper, not a copy of
- // it, will be passed to the callback.
-```
-
-What if the callable takes an argument by reference and we do **not** wrap the
-argument in `std::ref()`? Then `InvokeArgument()` will *make a copy* of the
-argument, and pass a *reference to the copy*, instead of a reference to the
-original value, to the callable. This is especially handy when the argument is a
-temporary value:
-
-```cpp
- ...
- MOCK_METHOD(bool, DoThat, (bool (*f)(const double& x, const string& s)),
- (override));
- ...
- using ::testing::_;
- using ::testing::InvokeArgument;
- ...
- MockFoo foo;
- ...
- EXPECT_CALL(foo, DoThat(_))
- .WillOnce(InvokeArgument<0>(5.0, string("Hi")));
- // Will execute (*f)(5.0, string("Hi")), where f is the function pointer
- // DoThat() receives. Note that the values 5.0 and string("Hi") are
- // temporary and dead once the EXPECT_CALL() statement finishes. Yet
- // it's fine to perform this action later, since a copy of the values
- // are kept inside the InvokeArgument action.
-```
-
-### Ignoring an Action's Result
-
-Sometimes you have an action that returns *something*, but you need an action
-that returns `void` (perhaps you want to use it in a mock function that returns
-`void`, or perhaps it needs to be used in `DoAll()` and it's not the last in the
-list). `IgnoreResult()` lets you do that. For example:
-
-```cpp
-using ::testing::_;
-using ::testing::DoAll;
-using ::testing::IgnoreResult;
-using ::testing::Return;
-
-int Process(const MyData& data);
-string DoSomething();
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(void, Abc, (const MyData& data), (override));
- MOCK_METHOD(bool, Xyz, (), (override));
-};
-
- ...
- MockFoo foo;
- EXPECT_CALL(foo, Abc(_))
- // .WillOnce(Invoke(Process));
- // The above line won't compile as Process() returns int but Abc() needs
- // to return void.
- .WillOnce(IgnoreResult(Process));
- EXPECT_CALL(foo, Xyz())
- .WillOnce(DoAll(IgnoreResult(DoSomething),
- // Ignores the string DoSomething() returns.
- Return(true)));
-```
-
-Note that you **cannot** use `IgnoreResult()` on an action that already returns
-`void`. Doing so will lead to ugly compiler errors.
-
-### Selecting an Action's Arguments {#SelectingArgs}
-
-Say you have a mock function `Foo()` that takes seven arguments, and you have a
-custom action that you want to invoke when `Foo()` is called. Trouble is, the
-custom action only wants three arguments:
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
-...
- MOCK_METHOD(bool, Foo,
- (bool visible, const string& name, int x, int y,
- (const map<pair<int, int>>), double& weight, double min_weight,
- double max_wight));
-...
-bool IsVisibleInQuadrant1(bool visible, int x, int y) {
- return visible && x >= 0 && y >= 0;
-}
-...
- EXPECT_CALL(mock, Foo)
- .WillOnce(Invoke(IsVisibleInQuadrant1)); // Uh, won't compile. :-(
-```
-
-To please the compiler God, you need to define an "adaptor" that has the same
-signature as `Foo()` and calls the custom action with the right arguments:
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
-...
-bool MyIsVisibleInQuadrant1(bool visible, const string& name, int x, int y,
- const map<pair<int, int>, double>& weight,
- double min_weight, double max_wight) {
- return IsVisibleInQuadrant1(visible, x, y);
-}
-...
- EXPECT_CALL(mock, Foo)
- .WillOnce(Invoke(MyIsVisibleInQuadrant1)); // Now it works.
-```
-
-But isn't this awkward?
-
-gMock provides a generic *action adaptor*, so you can spend your time minding
-more important business than writing your own adaptors. Here's the syntax:
-
-```cpp
-WithArgs<N1, N2, ..., Nk>(action)
-```
-
-creates an action that passes the arguments of the mock function at the given
-indices (0-based) to the inner `action` and performs it. Using `WithArgs`, our
-original example can be written as:
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
-using ::testing::WithArgs;
-...
- EXPECT_CALL(mock, Foo)
- .WillOnce(WithArgs<0, 2, 3>(Invoke(IsVisibleInQuadrant1))); // No need to define your own adaptor.
-```
-
-For better readability, gMock also gives you:
-
-* `WithoutArgs(action)` when the inner `action` takes *no* argument, and
-* `WithArg<N>(action)` (no `s` after `Arg`) when the inner `action` takes
- *one* argument.
-
-As you may have realized, `InvokeWithoutArgs(...)` is just syntactic sugar for
-`WithoutArgs(Invoke(...))`.
-
-Here are more tips:
-
-* The inner action used in `WithArgs` and friends does not have to be
- `Invoke()` -- it can be anything.
-* You can repeat an argument in the argument list if necessary, e.g.
- `WithArgs<2, 3, 3, 5>(...)`.
-* You can change the order of the arguments, e.g. `WithArgs<3, 2, 1>(...)`.
-* The types of the selected arguments do *not* have to match the signature of
- the inner action exactly. It works as long as they can be implicitly
- converted to the corresponding arguments of the inner action. For example,
- if the 4-th argument of the mock function is an `int` and `my_action` takes
- a `double`, `WithArg<4>(my_action)` will work.
-
-### Ignoring Arguments in Action Functions
-
-The [selecting-an-action's-arguments](#SelectingArgs) recipe showed us one way
-to make a mock function and an action with incompatible argument lists fit
-together. The downside is that wrapping the action in `WithArgs<...>()` can get
-tedious for people writing the tests.
-
-If you are defining a function (or method, functor, lambda, callback) to be used
-with `Invoke*()`, and you are not interested in some of its arguments, an
-alternative to `WithArgs` is to declare the uninteresting arguments as `Unused`.
-This makes the definition less cluttered and less fragile in case the types of
-the uninteresting arguments change. It could also increase the chance the action
-function can be reused. For example, given
-
-```cpp
- public:
- MOCK_METHOD(double, Foo, double(const string& label, double x, double y),
- (override));
- MOCK_METHOD(double, Bar, (int index, double x, double y), (override));
-```
-
-instead of
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
-
-double DistanceToOriginWithLabel(const string& label, double x, double y) {
- return sqrt(x*x + y*y);
-}
-double DistanceToOriginWithIndex(int index, double x, double y) {
- return sqrt(x*x + y*y);
-}
-...
- EXPECT_CALL(mock, Foo("abc", _, _))
- .WillOnce(Invoke(DistanceToOriginWithLabel));
- EXPECT_CALL(mock, Bar(5, _, _))
- .WillOnce(Invoke(DistanceToOriginWithIndex));
-```
-
-you could write
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
-using ::testing::Unused;
-
-double DistanceToOrigin(Unused, double x, double y) {
- return sqrt(x*x + y*y);
-}
-...
- EXPECT_CALL(mock, Foo("abc", _, _))
- .WillOnce(Invoke(DistanceToOrigin));
- EXPECT_CALL(mock, Bar(5, _, _))
- .WillOnce(Invoke(DistanceToOrigin));
-```
-
-### Sharing Actions
-
-Just like matchers, a gMock action object consists of a pointer to a ref-counted
-implementation object. Therefore copying actions is also allowed and very
-efficient. When the last action that references the implementation object dies,
-the implementation object will be deleted.
-
-If you have some complex action that you want to use again and again, you may
-not have to build it from scratch every time. If the action doesn't have an
-internal state (i.e. if it always does the same thing no matter how many times
-it has been called), you can assign it to an action variable and use that
-variable repeatedly. For example:
-
-```cpp
-using ::testing::Action;
-using ::testing::DoAll;
-using ::testing::Return;
-using ::testing::SetArgPointee;
-...
- Action<bool(int*)> set_flag = DoAll(SetArgPointee<0>(5),
- Return(true));
- ... use set_flag in .WillOnce() and .WillRepeatedly() ...
-```
-
-However, if the action has its own state, you may be surprised if you share the
-action object. Suppose you have an action factory `IncrementCounter(init)` which
-creates an action that increments and returns a counter whose initial value is
-`init`, using two actions created from the same expression and using a shared
-action will exhibit different behaviors. Example:
-
-```cpp
- EXPECT_CALL(foo, DoThis())
- .WillRepeatedly(IncrementCounter(0));
- EXPECT_CALL(foo, DoThat())
- .WillRepeatedly(IncrementCounter(0));
- foo.DoThis(); // Returns 1.
- foo.DoThis(); // Returns 2.
- foo.DoThat(); // Returns 1 - Blah() uses a different
- // counter than Bar()'s.
-```
-
-versus
-
-```cpp
-using ::testing::Action;
-...
- Action<int()> increment = IncrementCounter(0);
- EXPECT_CALL(foo, DoThis())
- .WillRepeatedly(increment);
- EXPECT_CALL(foo, DoThat())
- .WillRepeatedly(increment);
- foo.DoThis(); // Returns 1.
- foo.DoThis(); // Returns 2.
- foo.DoThat(); // Returns 3 - the counter is shared.
-```
-
-### Testing Asynchronous Behavior
-
-One oft-encountered problem with gMock is that it can be hard to test
-asynchronous behavior. Suppose you had a `EventQueue` class that you wanted to
-test, and you created a separate `EventDispatcher` interface so that you could
-easily mock it out. However, the implementation of the class fired all the
-events on a background thread, which made test timings difficult. You could just
-insert `sleep()` statements and hope for the best, but that makes your test
-behavior nondeterministic. A better way is to use gMock actions and
-`Notification` objects to force your asynchronous test to behave synchronously.
-
-```cpp
-class MockEventDispatcher : public EventDispatcher {
- MOCK_METHOD(bool, DispatchEvent, (int32), (override));
-};
-
-TEST(EventQueueTest, EnqueueEventTest) {
- MockEventDispatcher mock_event_dispatcher;
- EventQueue event_queue(&mock_event_dispatcher);
-
- const int32 kEventId = 321;
- absl::Notification done;
- EXPECT_CALL(mock_event_dispatcher, DispatchEvent(kEventId))
- .WillOnce([&done] { done.Notify(); });
-
- event_queue.EnqueueEvent(kEventId);
- done.WaitForNotification();
-}
-```
-
-In the example above, we set our normal gMock expectations, but then add an
-additional action to notify the `Notification` object. Now we can just call
-`Notification::WaitForNotification()` in the main thread to wait for the
-asynchronous call to finish. After that, our test suite is complete and we can
-safely exit.
-
-{: .callout .note}
-Note: this example has a downside: namely, if the expectation is not satisfied,
-our test will run forever. It will eventually time-out and fail, but it will
-take longer and be slightly harder to debug. To alleviate this problem, you can
-use `WaitForNotificationWithTimeout(ms)` instead of `WaitForNotification()`.
-
-## Misc Recipes on Using gMock
-
-### Mocking Methods That Use Move-Only Types
-
-C++11 introduced *move-only types*. A move-only-typed value can be moved from
-one object to another, but cannot be copied. `std::unique_ptr<T>` is probably
-the most commonly used move-only type.
-
-Mocking a method that takes and/or returns move-only types presents some
-challenges, but nothing insurmountable. This recipe shows you how you can do it.
-Note that the support for move-only method arguments was only introduced to
-gMock in April 2017; in older code, you may find more complex
-[workarounds](#LegacyMoveOnly) for lack of this feature.
-
-Let’s say we are working on a fictional project that lets one post and share
-snippets called “buzzesâ€. Your code uses these types:
-
-```cpp
-enum class AccessLevel { kInternal, kPublic };
-
-class Buzz {
- public:
- explicit Buzz(AccessLevel access) { ... }
- ...
-};
-
-class Buzzer {
- public:
- virtual ~Buzzer() {}
- virtual std::unique_ptr<Buzz> MakeBuzz(StringPiece text) = 0;
- virtual bool ShareBuzz(std::unique_ptr<Buzz> buzz, int64_t timestamp) = 0;
- ...
-};
-```
-
-A `Buzz` object represents a snippet being posted. A class that implements the
-`Buzzer` interface is capable of creating and sharing `Buzz`es. Methods in
-`Buzzer` may return a `unique_ptr<Buzz>` or take a `unique_ptr<Buzz>`. Now we
-need to mock `Buzzer` in our tests.
-
-To mock a method that accepts or returns move-only types, you just use the
-familiar `MOCK_METHOD` syntax as usual:
-
-```cpp
-class MockBuzzer : public Buzzer {
- public:
- MOCK_METHOD(std::unique_ptr<Buzz>, MakeBuzz, (StringPiece text), (override));
- MOCK_METHOD(bool, ShareBuzz, (std::unique_ptr<Buzz> buzz, int64_t timestamp),
- (override));
-};
-```
-
-Now that we have the mock class defined, we can use it in tests. In the
-following code examples, we assume that we have defined a `MockBuzzer` object
-named `mock_buzzer_`:
-
-```cpp
- MockBuzzer mock_buzzer_;
-```
-
-First let’s see how we can set expectations on the `MakeBuzz()` method, which
-returns a `unique_ptr<Buzz>`.
-
-As usual, if you set an expectation without an action (i.e. the `.WillOnce()` or
-`.WillRepeatedly()` clause), when that expectation fires, the default action for
-that method will be taken. Since `unique_ptr<>` has a default constructor that
-returns a null `unique_ptr`, that’s what you’ll get if you don’t specify an
-action:
-
-```cpp
- // Use the default action.
- EXPECT_CALL(mock_buzzer_, MakeBuzz("hello"));
-
- // Triggers the previous EXPECT_CALL.
- EXPECT_EQ(nullptr, mock_buzzer_.MakeBuzz("hello"));
-```
-
-If you are not happy with the default action, you can tweak it as usual; see
-[Setting Default Actions](#OnCall).
-
-If you just need to return a pre-defined move-only value, you can use the
-`Return(ByMove(...))` action:
-
-```cpp
- // When this fires, the unique_ptr<> specified by ByMove(...) will
- // be returned.
- EXPECT_CALL(mock_buzzer_, MakeBuzz("world"))
- .WillOnce(Return(ByMove(MakeUnique<Buzz>(AccessLevel::kInternal))));
-
- EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("world"));
-```
-
-Note that `ByMove()` is essential here - if you drop it, the code won’t compile.
-
-Quiz time! What do you think will happen if a `Return(ByMove(...))` action is
-performed more than once (e.g. you write `...
-.WillRepeatedly(Return(ByMove(...)));`)? Come think of it, after the first time
-the action runs, the source value will be consumed (since it’s a move-only
-value), so the next time around, there’s no value to move from -- you’ll get a
-run-time error that `Return(ByMove(...))` can only be run once.
-
-If you need your mock method to do more than just moving a pre-defined value,
-remember that you can always use a lambda or a callable object, which can do
-pretty much anything you want:
-
-```cpp
- EXPECT_CALL(mock_buzzer_, MakeBuzz("x"))
- .WillRepeatedly([](StringPiece text) {
- return MakeUnique<Buzz>(AccessLevel::kInternal);
- });
-
- EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x"));
- EXPECT_NE(nullptr, mock_buzzer_.MakeBuzz("x"));
-```
-
-Every time this `EXPECT_CALL` fires, a new `unique_ptr<Buzz>` will be created
-and returned. You cannot do this with `Return(ByMove(...))`.
-
-That covers returning move-only values; but how do we work with methods
-accepting move-only arguments? The answer is that they work normally, although
-some actions will not compile when any of method's arguments are move-only. You
-can always use `Return`, or a [lambda or functor](#FunctionsAsActions):
-
-```cpp
- using ::testing::Unused;
-
- EXPECT_CALL(mock_buzzer_, ShareBuzz(NotNull(), _)).WillOnce(Return(true));
- EXPECT_TRUE(mock_buzzer_.ShareBuzz(MakeUnique<Buzz>(AccessLevel::kInternal)),
- 0);
-
- EXPECT_CALL(mock_buzzer_, ShareBuzz(_, _)).WillOnce(
- [](std::unique_ptr<Buzz> buzz, Unused) { return buzz != nullptr; });
- EXPECT_FALSE(mock_buzzer_.ShareBuzz(nullptr, 0));
-```
-
-Many built-in actions (`WithArgs`, `WithoutArgs`,`DeleteArg`, `SaveArg`, ...)
-could in principle support move-only arguments, but the support for this is not
-implemented yet. If this is blocking you, please file a bug.
-
-A few actions (e.g. `DoAll`) copy their arguments internally, so they can never
-work with non-copyable objects; you'll have to use functors instead.
-
-#### Legacy workarounds for move-only types {#LegacyMoveOnly}
-
-Support for move-only function arguments was only introduced to gMock in April
-of 2017. In older code, you may encounter the following workaround for the lack
-of this feature (it is no longer necessary - we're including it just for
-reference):
-
-```cpp
-class MockBuzzer : public Buzzer {
- public:
- MOCK_METHOD(bool, DoShareBuzz, (Buzz* buzz, Time timestamp));
- bool ShareBuzz(std::unique_ptr<Buzz> buzz, Time timestamp) override {
- return DoShareBuzz(buzz.get(), timestamp);
- }
-};
-```
-
-The trick is to delegate the `ShareBuzz()` method to a mock method (let’s call
-it `DoShareBuzz()`) that does not take move-only parameters. Then, instead of
-setting expectations on `ShareBuzz()`, you set them on the `DoShareBuzz()` mock
-method:
-
-```cpp
- MockBuzzer mock_buzzer_;
- EXPECT_CALL(mock_buzzer_, DoShareBuzz(NotNull(), _));
-
- // When one calls ShareBuzz() on the MockBuzzer like this, the call is
- // forwarded to DoShareBuzz(), which is mocked. Therefore this statement
- // will trigger the above EXPECT_CALL.
- mock_buzzer_.ShareBuzz(MakeUnique<Buzz>(AccessLevel::kInternal), 0);
-```
-
-### Making the Compilation Faster
-
-Believe it or not, the *vast majority* of the time spent on compiling a mock
-class is in generating its constructor and destructor, as they perform
-non-trivial tasks (e.g. verification of the expectations). What's more, mock
-methods with different signatures have different types and thus their
-constructors/destructors need to be generated by the compiler separately. As a
-result, if you mock many different types of methods, compiling your mock class
-can get really slow.
-
-If you are experiencing slow compilation, you can move the definition of your
-mock class' constructor and destructor out of the class body and into a `.cc`
-file. This way, even if you `#include` your mock class in N files, the compiler
-only needs to generate its constructor and destructor once, resulting in a much
-faster compilation.
-
-Let's illustrate the idea using an example. Here's the definition of a mock
-class before applying this recipe:
-
-```cpp
-// File mock_foo.h.
-...
-class MockFoo : public Foo {
- public:
- // Since we don't declare the constructor or the destructor,
- // the compiler will generate them in every translation unit
- // where this mock class is used.
-
- MOCK_METHOD(int, DoThis, (), (override));
- MOCK_METHOD(bool, DoThat, (const char* str), (override));
- ... more mock methods ...
-};
-```
-
-After the change, it would look like:
-
-```cpp
-// File mock_foo.h.
-...
-class MockFoo : public Foo {
- public:
- // The constructor and destructor are declared, but not defined, here.
- MockFoo();
- virtual ~MockFoo();
-
- MOCK_METHOD(int, DoThis, (), (override));
- MOCK_METHOD(bool, DoThat, (const char* str), (override));
- ... more mock methods ...
-};
-```
-
-and
-
-```cpp
-// File mock_foo.cc.
-#include "path/to/mock_foo.h"
-
-// The definitions may appear trivial, but the functions actually do a
-// lot of things through the constructors/destructors of the member
-// variables used to implement the mock methods.
-MockFoo::MockFoo() {}
-MockFoo::~MockFoo() {}
-```
-
-### Forcing a Verification
-
-When it's being destroyed, your friendly mock object will automatically verify
-that all expectations on it have been satisfied, and will generate googletest
-failures if not. This is convenient as it leaves you with one less thing to
-worry about. That is, unless you are not sure if your mock object will be
-destroyed.
-
-How could it be that your mock object won't eventually be destroyed? Well, it
-might be created on the heap and owned by the code you are testing. Suppose
-there's a bug in that code and it doesn't delete the mock object properly - you
-could end up with a passing test when there's actually a bug.
-
-Using a heap checker is a good idea and can alleviate the concern, but its
-implementation is not 100% reliable. So, sometimes you do want to *force* gMock
-to verify a mock object before it is (hopefully) destructed. You can do this
-with `Mock::VerifyAndClearExpectations(&mock_object)`:
-
-```cpp
-TEST(MyServerTest, ProcessesRequest) {
- using ::testing::Mock;
-
- MockFoo* const foo = new MockFoo;
- EXPECT_CALL(*foo, ...)...;
- // ... other expectations ...
-
- // server now owns foo.
- MyServer server(foo);
- server.ProcessRequest(...);
-
- // In case that server's destructor will forget to delete foo,
- // this will verify the expectations anyway.
- Mock::VerifyAndClearExpectations(foo);
-} // server is destroyed when it goes out of scope here.
-```
-
-{: .callout .tip}
-**Tip:** The `Mock::VerifyAndClearExpectations()` function returns a `bool` to
-indicate whether the verification was successful (`true` for yes), so you can
-wrap that function call inside a `ASSERT_TRUE()` if there is no point going
-further when the verification has failed.
-
-Do not set new expectations after verifying and clearing a mock after its use.
-Setting expectations after code that exercises the mock has undefined behavior.
-See [Using Mocks in Tests](gmock_for_dummies.md#using-mocks-in-tests) for more
-information.
-
-### Using Checkpoints {#UsingCheckPoints}
-
-Sometimes you might want to test a mock object's behavior in phases whose sizes
-are each manageable, or you might want to set more detailed expectations about
-which API calls invoke which mock functions.
-
-A technique you can use is to put the expectations in a sequence and insert
-calls to a dummy "checkpoint" function at specific places. Then you can verify
-that the mock function calls do happen at the right time. For example, if you
-are exercising the code:
-
-```cpp
- Foo(1);
- Foo(2);
- Foo(3);
-```
-
-and want to verify that `Foo(1)` and `Foo(3)` both invoke `mock.Bar("a")`, but
-`Foo(2)` doesn't invoke anything, you can write:
-
-```cpp
-using ::testing::MockFunction;
-
-TEST(FooTest, InvokesBarCorrectly) {
- MyMock mock;
- // Class MockFunction<F> has exactly one mock method. It is named
- // Call() and has type F.
- MockFunction<void(string check_point_name)> check;
- {
- InSequence s;
-
- EXPECT_CALL(mock, Bar("a"));
- EXPECT_CALL(check, Call("1"));
- EXPECT_CALL(check, Call("2"));
- EXPECT_CALL(mock, Bar("a"));
- }
- Foo(1);
- check.Call("1");
- Foo(2);
- check.Call("2");
- Foo(3);
-}
-```
-
-The expectation spec says that the first `Bar("a")` call must happen before
-checkpoint "1", the second `Bar("a")` call must happen after checkpoint "2", and
-nothing should happen between the two checkpoints. The explicit checkpoints make
-it clear which `Bar("a")` is called by which call to `Foo()`.
-
-### Mocking Destructors
-
-Sometimes you want to make sure a mock object is destructed at the right time,
-e.g. after `bar->A()` is called but before `bar->B()` is called. We already know
-that you can specify constraints on the [order](#OrderedCalls) of mock function
-calls, so all we need to do is to mock the destructor of the mock function.
-
-This sounds simple, except for one problem: a destructor is a special function
-with special syntax and special semantics, and the `MOCK_METHOD` macro doesn't
-work for it:
-
-```cpp
-MOCK_METHOD(void, ~MockFoo, ()); // Won't compile!
-```
-
-The good news is that you can use a simple pattern to achieve the same effect.
-First, add a mock function `Die()` to your mock class and call it in the
-destructor, like this:
-
-```cpp
-class MockFoo : public Foo {
- ...
- // Add the following two lines to the mock class.
- MOCK_METHOD(void, Die, ());
- ~MockFoo() override { Die(); }
-};
-```
-
-(If the name `Die()` clashes with an existing symbol, choose another name.) Now,
-we have translated the problem of testing when a `MockFoo` object dies to
-testing when its `Die()` method is called:
-
-```cpp
- MockFoo* foo = new MockFoo;
- MockBar* bar = new MockBar;
- ...
- {
- InSequence s;
-
- // Expects *foo to die after bar->A() and before bar->B().
- EXPECT_CALL(*bar, A());
- EXPECT_CALL(*foo, Die());
- EXPECT_CALL(*bar, B());
- }
-```
-
-And that's that.
-
-### Using gMock and Threads {#UsingThreads}
-
-In a **unit** test, it's best if you could isolate and test a piece of code in a
-single-threaded context. That avoids race conditions and dead locks, and makes
-debugging your test much easier.
-
-Yet most programs are multi-threaded, and sometimes to test something we need to
-pound on it from more than one thread. gMock works for this purpose too.
-
-Remember the steps for using a mock:
-
-1. Create a mock object `foo`.
-2. Set its default actions and expectations using `ON_CALL()` and
- `EXPECT_CALL()`.
-3. The code under test calls methods of `foo`.
-4. Optionally, verify and reset the mock.
-5. Destroy the mock yourself, or let the code under test destroy it. The
- destructor will automatically verify it.
-
-If you follow the following simple rules, your mocks and threads can live
-happily together:
-
-* Execute your *test code* (as opposed to the code being tested) in *one*
- thread. This makes your test easy to follow.
-* Obviously, you can do step #1 without locking.
-* When doing step #2 and #5, make sure no other thread is accessing `foo`.
- Obvious too, huh?
-* #3 and #4 can be done either in one thread or in multiple threads - anyway
- you want. gMock takes care of the locking, so you don't have to do any -
- unless required by your test logic.
-
-If you violate the rules (for example, if you set expectations on a mock while
-another thread is calling its methods), you get undefined behavior. That's not
-fun, so don't do it.
-
-gMock guarantees that the action for a mock function is done in the same thread
-that called the mock function. For example, in
-
-```cpp
- EXPECT_CALL(mock, Foo(1))
- .WillOnce(action1);
- EXPECT_CALL(mock, Foo(2))
- .WillOnce(action2);
-```
-
-if `Foo(1)` is called in thread 1 and `Foo(2)` is called in thread 2, gMock will
-execute `action1` in thread 1 and `action2` in thread 2.
-
-gMock does *not* impose a sequence on actions performed in different threads
-(doing so may create deadlocks as the actions may need to cooperate). This means
-that the execution of `action1` and `action2` in the above example *may*
-interleave. If this is a problem, you should add proper synchronization logic to
-`action1` and `action2` to make the test thread-safe.
-
-Also, remember that `DefaultValue<T>` is a global resource that potentially
-affects *all* living mock objects in your program. Naturally, you won't want to
-mess with it from multiple threads or when there still are mocks in action.
-
-### Controlling How Much Information gMock Prints
-
-When gMock sees something that has the potential of being an error (e.g. a mock
-function with no expectation is called, a.k.a. an uninteresting call, which is
-allowed but perhaps you forgot to explicitly ban the call), it prints some
-warning messages, including the arguments of the function, the return value, and
-the stack trace. Hopefully this will remind you to take a look and see if there
-is indeed a problem.
-
-Sometimes you are confident that your tests are correct and may not appreciate
-such friendly messages. Some other times, you are debugging your tests or
-learning about the behavior of the code you are testing, and wish you could
-observe every mock call that happens (including argument values, the return
-value, and the stack trace). Clearly, one size doesn't fit all.
-
-You can control how much gMock tells you using the `--gmock_verbose=LEVEL`
-command-line flag, where `LEVEL` is a string with three possible values:
-
-* `info`: gMock will print all informational messages, warnings, and errors
- (most verbose). At this setting, gMock will also log any calls to the
- `ON_CALL/EXPECT_CALL` macros. It will include a stack trace in
- "uninteresting call" warnings.
-* `warning`: gMock will print both warnings and errors (less verbose); it will
- omit the stack traces in "uninteresting call" warnings. This is the default.
-* `error`: gMock will print errors only (least verbose).
-
-Alternatively, you can adjust the value of that flag from within your tests like
-so:
-
-```cpp
- ::testing::FLAGS_gmock_verbose = "error";
-```
-
-If you find gMock printing too many stack frames with its informational or
-warning messages, remember that you can control their amount with the
-`--gtest_stack_trace_depth=max_depth` flag.
-
-Now, judiciously use the right flag to enable gMock serve you better!
-
-### Gaining Super Vision into Mock Calls
-
-You have a test using gMock. It fails: gMock tells you some expectations aren't
-satisfied. However, you aren't sure why: Is there a typo somewhere in the
-matchers? Did you mess up the order of the `EXPECT_CALL`s? Or is the code under
-test doing something wrong? How can you find out the cause?
-
-Won't it be nice if you have X-ray vision and can actually see the trace of all
-`EXPECT_CALL`s and mock method calls as they are made? For each call, would you
-like to see its actual argument values and which `EXPECT_CALL` gMock thinks it
-matches? If you still need some help to figure out who made these calls, how
-about being able to see the complete stack trace at each mock call?
-
-You can unlock this power by running your test with the `--gmock_verbose=info`
-flag. For example, given the test program:
-
-```cpp
-#include "gmock/gmock.h"
-
-using testing::_;
-using testing::HasSubstr;
-using testing::Return;
-
-class MockFoo {
- public:
- MOCK_METHOD(void, F, (const string& x, const string& y));
-};
-
-TEST(Foo, Bar) {
- MockFoo mock;
- EXPECT_CALL(mock, F(_, _)).WillRepeatedly(Return());
- EXPECT_CALL(mock, F("a", "b"));
- EXPECT_CALL(mock, F("c", HasSubstr("d")));
-
- mock.F("a", "good");
- mock.F("a", "b");
-}
-```
-
-if you run it with `--gmock_verbose=info`, you will see this output:
-
-```shell
-[ RUN ] Foo.Bar
-
-foo_test.cc:14: EXPECT_CALL(mock, F(_, _)) invoked
-Stack trace: ...
-
-foo_test.cc:15: EXPECT_CALL(mock, F("a", "b")) invoked
-Stack trace: ...
-
-foo_test.cc:16: EXPECT_CALL(mock, F("c", HasSubstr("d"))) invoked
-Stack trace: ...
-
-foo_test.cc:14: Mock function call matches EXPECT_CALL(mock, F(_, _))...
- Function call: F(@0x7fff7c8dad40"a",@0x7fff7c8dad10"good")
-Stack trace: ...
-
-foo_test.cc:15: Mock function call matches EXPECT_CALL(mock, F("a", "b"))...
- Function call: F(@0x7fff7c8dada0"a",@0x7fff7c8dad70"b")
-Stack trace: ...
-
-foo_test.cc:16: Failure
-Actual function call count doesn't match EXPECT_CALL(mock, F("c", HasSubstr("d")))...
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] Foo.Bar
-```
-
-Suppose the bug is that the `"c"` in the third `EXPECT_CALL` is a typo and
-should actually be `"a"`. With the above message, you should see that the actual
-`F("a", "good")` call is matched by the first `EXPECT_CALL`, not the third as
-you thought. From that it should be obvious that the third `EXPECT_CALL` is
-written wrong. Case solved.
-
-If you are interested in the mock call trace but not the stack traces, you can
-combine `--gmock_verbose=info` with `--gtest_stack_trace_depth=0` on the test
-command line.
-
-### Running Tests in Emacs
-
-If you build and run your tests in Emacs using the `M-x google-compile` command
-(as many googletest users do), the source file locations of gMock and googletest
-errors will be highlighted. Just press `<Enter>` on one of them and you'll be
-taken to the offending line. Or, you can just type `C-x`` to jump to the next
-error.
-
-To make it even easier, you can add the following lines to your `~/.emacs` file:
-
-```text
-(global-set-key "\M-m" 'google-compile) ; m is for make
-(global-set-key [M-down] 'next-error)
-(global-set-key [M-up] '(lambda () (interactive) (next-error -1)))
-```
-
-Then you can type `M-m` to start a build (if you want to run the test as well,
-just make sure `foo_test.run` or `runtests` is in the build command you supply
-after typing `M-m`), or `M-up`/`M-down` to move back and forth between errors.
-
-## Extending gMock
-
-### Writing New Matchers Quickly {#NewMatchers}
-
-{: .callout .warning}
-WARNING: gMock does not guarantee when or how many times a matcher will be
-invoked. Therefore, all matchers must be functionally pure. See
-[this section](#PureMatchers) for more details.
-
-The `MATCHER*` family of macros can be used to define custom matchers easily.
-The syntax:
-
-```cpp
-MATCHER(name, description_string_expression) { statements; }
-```
-
-will define a matcher with the given name that executes the statements, which
-must return a `bool` to indicate if the match succeeds. Inside the statements,
-you can refer to the value being matched by `arg`, and refer to its type by
-`arg_type`.
-
-The *description string* is a `string`-typed expression that documents what the
-matcher does, and is used to generate the failure message when the match fails.
-It can (and should) reference the special `bool` variable `negation`, and should
-evaluate to the description of the matcher when `negation` is `false`, or that
-of the matcher's negation when `negation` is `true`.
-
-For convenience, we allow the description string to be empty (`""`), in which
-case gMock will use the sequence of words in the matcher name as the
-description.
-
-For example:
-
-```cpp
-MATCHER(IsDivisibleBy7, "") { return (arg % 7) == 0; }
-```
-
-allows you to write
-
-```cpp
- // Expects mock_foo.Bar(n) to be called where n is divisible by 7.
- EXPECT_CALL(mock_foo, Bar(IsDivisibleBy7()));
-```
-
-or,
-
-```cpp
- using ::testing::Not;
- ...
- // Verifies that a value is divisible by 7 and the other is not.
- EXPECT_THAT(some_expression, IsDivisibleBy7());
- EXPECT_THAT(some_other_expression, Not(IsDivisibleBy7()));
-```
-
-If the above assertions fail, they will print something like:
-
-```shell
- Value of: some_expression
- Expected: is divisible by 7
- Actual: 27
- ...
- Value of: some_other_expression
- Expected: not (is divisible by 7)
- Actual: 21
-```
-
-where the descriptions `"is divisible by 7"` and `"not (is divisible by 7)"` are
-automatically calculated from the matcher name `IsDivisibleBy7`.
-
-As you may have noticed, the auto-generated descriptions (especially those for
-the negation) may not be so great. You can always override them with a `string`
-expression of your own:
-
-```cpp
-MATCHER(IsDivisibleBy7,
- absl::StrCat(negation ? "isn't" : "is", " divisible by 7")) {
- return (arg % 7) == 0;
-}
-```
-
-Optionally, you can stream additional information to a hidden argument named
-`result_listener` to explain the match result. For example, a better definition
-of `IsDivisibleBy7` is:
-
-```cpp
-MATCHER(IsDivisibleBy7, "") {
- if ((arg % 7) == 0)
- return true;
-
- *result_listener << "the remainder is " << (arg % 7);
- return false;
-}
-```
-
-With this definition, the above assertion will give a better message:
-
-```shell
- Value of: some_expression
- Expected: is divisible by 7
- Actual: 27 (the remainder is 6)
-```
-
-You should let `MatchAndExplain()` print *any additional information* that can
-help a user understand the match result. Note that it should explain why the
-match succeeds in case of a success (unless it's obvious) - this is useful when
-the matcher is used inside `Not()`. There is no need to print the argument value
-itself, as gMock already prints it for you.
-
-{: .callout .note}
-NOTE: The type of the value being matched (`arg_type`) is determined by the
-context in which you use the matcher and is supplied to you by the compiler, so
-you don't need to worry about declaring it (nor can you). This allows the
-matcher to be polymorphic. For example, `IsDivisibleBy7()` can be used to match
-any type where the value of `(arg % 7) == 0` can be implicitly converted to a
-`bool`. In the `Bar(IsDivisibleBy7())` example above, if method `Bar()` takes an
-`int`, `arg_type` will be `int`; if it takes an `unsigned long`, `arg_type` will
-be `unsigned long`; and so on.
-
-### Writing New Parameterized Matchers Quickly
-
-Sometimes you'll want to define a matcher that has parameters. For that you can
-use the macro:
-
-```cpp
-MATCHER_P(name, param_name, description_string) { statements; }
-```
-
-where the description string can be either `""` or a `string` expression that
-references `negation` and `param_name`.
-
-For example:
-
-```cpp
-MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
-```
-
-will allow you to write:
-
-```cpp
- EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
-```
-
-which may lead to this message (assuming `n` is 10):
-
-```shell
- Value of: Blah("a")
- Expected: has absolute value 10
- Actual: -9
-```
-
-Note that both the matcher description and its parameter are printed, making the
-message human-friendly.
-
-In the matcher definition body, you can write `foo_type` to reference the type
-of a parameter named `foo`. For example, in the body of
-`MATCHER_P(HasAbsoluteValue, value)` above, you can write `value_type` to refer
-to the type of `value`.
-
-gMock also provides `MATCHER_P2`, `MATCHER_P3`, ..., up to `MATCHER_P10` to
-support multi-parameter matchers:
-
-```cpp
-MATCHER_Pk(name, param_1, ..., param_k, description_string) { statements; }
-```
-
-Please note that the custom description string is for a particular *instance* of
-the matcher, where the parameters have been bound to actual values. Therefore
-usually you'll want the parameter values to be part of the description. gMock
-lets you do that by referencing the matcher parameters in the description string
-expression.
-
-For example,
-
-```cpp
-using ::testing::PrintToString;
-MATCHER_P2(InClosedRange, low, hi,
- absl::StrFormat("%s in range [%s, %s]", negation ? "isn't" : "is",
- PrintToString(low), PrintToString(hi))) {
- return low <= arg && arg <= hi;
-}
-...
-EXPECT_THAT(3, InClosedRange(4, 6));
-```
-
-would generate a failure that contains the message:
-
-```shell
- Expected: is in range [4, 6]
-```
-
-If you specify `""` as the description, the failure message will contain the
-sequence of words in the matcher name followed by the parameter values printed
-as a tuple. For example,
-
-```cpp
- MATCHER_P2(InClosedRange, low, hi, "") { ... }
- ...
- EXPECT_THAT(3, InClosedRange(4, 6));
-```
-
-would generate a failure that contains the text:
-
-```shell
- Expected: in closed range (4, 6)
-```
-
-For the purpose of typing, you can view
-
-```cpp
-MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
-```
-
-as shorthand for
-
-```cpp
-template <typename p1_type, ..., typename pk_type>
-FooMatcherPk<p1_type, ..., pk_type>
-Foo(p1_type p1, ..., pk_type pk) { ... }
-```
-
-When you write `Foo(v1, ..., vk)`, the compiler infers the types of the
-parameters `v1`, ..., and `vk` for you. If you are not happy with the result of
-the type inference, you can specify the types by explicitly instantiating the
-template, as in `Foo<long, bool>(5, false)`. As said earlier, you don't get to
-(or need to) specify `arg_type` as that's determined by the context in which the
-matcher is used.
-
-You can assign the result of expression `Foo(p1, ..., pk)` to a variable of type
-`FooMatcherPk<p1_type, ..., pk_type>`. This can be useful when composing
-matchers. Matchers that don't have a parameter or have only one parameter have
-special types: you can assign `Foo()` to a `FooMatcher`-typed variable, and
-assign `Foo(p)` to a `FooMatcherP<p_type>`-typed variable.
-
-While you can instantiate a matcher template with reference types, passing the
-parameters by pointer usually makes your code more readable. If, however, you
-still want to pass a parameter by reference, be aware that in the failure
-message generated by the matcher you will see the value of the referenced object
-but not its address.
-
-You can overload matchers with different numbers of parameters:
-
-```cpp
-MATCHER_P(Blah, a, description_string_1) { ... }
-MATCHER_P2(Blah, a, b, description_string_2) { ... }
-```
-
-While it's tempting to always use the `MATCHER*` macros when defining a new
-matcher, you should also consider implementing the matcher interface directly
-instead (see the recipes that follow), especially if you need to use the matcher
-a lot. While these approaches require more work, they give you more control on
-the types of the value being matched and the matcher parameters, which in
-general leads to better compiler error messages that pay off in the long run.
-They also allow overloading matchers based on parameter types (as opposed to
-just based on the number of parameters).
-
-### Writing New Monomorphic Matchers
-
-A matcher of argument type `T` implements the matcher interface for `T` and does
-two things: it tests whether a value of type `T` matches the matcher, and can
-describe what kind of values it matches. The latter ability is used for
-generating readable error messages when expectations are violated.
-
-A matcher of `T` must declare a typedef like:
-
-```cpp
-using is_gtest_matcher = void;
-```
-
-and supports the following operations:
-
-```cpp
-// Match a value and optionally explain into an ostream.
-bool matched = matcher.MatchAndExplain(value, maybe_os);
-// where `value` is of type `T` and
-// `maybe_os` is of type `std::ostream*`, where it can be null if the caller
-// is not interested in there textual explanation.
-
-matcher.DescribeTo(os);
-matcher.DescribeNegationTo(os);
-// where `os` is of type `std::ostream*`.
-```
-
-If you need a custom matcher but `Truly()` is not a good option (for example,
-you may not be happy with the way `Truly(predicate)` describes itself, or you
-may want your matcher to be polymorphic as `Eq(value)` is), you can define a
-matcher to do whatever you want in two steps: first implement the matcher
-interface, and then define a factory function to create a matcher instance. The
-second step is not strictly needed but it makes the syntax of using the matcher
-nicer.
-
-For example, you can define a matcher to test whether an `int` is divisible by 7
-and then use it like this:
-
-```cpp
-using ::testing::Matcher;
-
-class DivisibleBy7Matcher {
- public:
- using is_gtest_matcher = void;
-
- bool MatchAndExplain(int n, std::ostream*) const {
- return (n % 7) == 0;
- }
-
- void DescribeTo(std::ostream* os) const {
- *os << "is divisible by 7";
- }
-
- void DescribeNegationTo(std::ostream* os) const {
- *os << "is not divisible by 7";
- }
-};
-
-Matcher<int> DivisibleBy7() {
- return DivisibleBy7Matcher();
-}
-
-...
- EXPECT_CALL(foo, Bar(DivisibleBy7()));
-```
-
-You may improve the matcher message by streaming additional information to the
-`os` argument in `MatchAndExplain()`:
-
-```cpp
-class DivisibleBy7Matcher {
- public:
- bool MatchAndExplain(int n, std::ostream* os) const {
- const int remainder = n % 7;
- if (remainder != 0 && os != nullptr) {
- *os << "the remainder is " << remainder;
- }
- return remainder == 0;
- }
- ...
-};
-```
-
-Then, `EXPECT_THAT(x, DivisibleBy7());` may generate a message like this:
-
-```shell
-Value of: x
-Expected: is divisible by 7
- Actual: 23 (the remainder is 2)
-```
-
-{: .callout .tip}
-Tip: for convenience, `MatchAndExplain()` can take a `MatchResultListener*`
-instead of `std::ostream*`.
-
-### Writing New Polymorphic Matchers
-
-Expanding what we learned above to *polymorphic* matchers is now just as simple
-as adding templates in the right place.
-
-```cpp
-
-class NotNullMatcher {
- public:
- using is_gtest_matcher = void;
-
- // To implement a polymorphic matcher, we just need to make MatchAndExplain a
- // template on its first argument.
-
- // In this example, we want to use NotNull() with any pointer, so
- // MatchAndExplain() accepts a pointer of any type as its first argument.
- // In general, you can define MatchAndExplain() as an ordinary method or
- // a method template, or even overload it.
- template <typename T>
- bool MatchAndExplain(T* p, std::ostream*) const {
- return p != nullptr;
- }
-
- // Describes the property of a value matching this matcher.
- void DescribeTo(std::ostream* os) const { *os << "is not NULL"; }
-
- // Describes the property of a value NOT matching this matcher.
- void DescribeNegationTo(std::ostream* os) const { *os << "is NULL"; }
-};
-
-NotNullMatcher NotNull() {
- return NotNullMatcher();
-}
-
-...
-
- EXPECT_CALL(foo, Bar(NotNull())); // The argument must be a non-NULL pointer.
-```
-
-### Legacy Matcher Implementation
-
-Defining matchers used to be somewhat more complicated, in which it required
-several supporting classes and virtual functions. To implement a matcher for
-type `T` using the legacy API you have to derive from `MatcherInterface<T>` and
-call `MakeMatcher` to construct the object.
-
-The interface looks like this:
-
-```cpp
-class MatchResultListener {
- public:
- ...
- // Streams x to the underlying ostream; does nothing if the ostream
- // is NULL.
- template <typename T>
- MatchResultListener& operator<<(const T& x);
-
- // Returns the underlying ostream.
- std::ostream* stream();
-};
-
-template <typename T>
-class MatcherInterface {
- public:
- virtual ~MatcherInterface();
-
- // Returns true if and only if the matcher matches x; also explains the match
- // result to 'listener'.
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
-
- // Describes this matcher to an ostream.
- virtual void DescribeTo(std::ostream* os) const = 0;
-
- // Describes the negation of this matcher to an ostream.
- virtual void DescribeNegationTo(std::ostream* os) const;
-};
-```
-
-Fortunately, most of the time you can define a polymorphic matcher easily with
-the help of `MakePolymorphicMatcher()`. Here's how you can define `NotNull()` as
-an example:
-
-```cpp
-using ::testing::MakePolymorphicMatcher;
-using ::testing::MatchResultListener;
-using ::testing::PolymorphicMatcher;
-
-class NotNullMatcher {
- public:
- // To implement a polymorphic matcher, first define a COPYABLE class
- // that has three members MatchAndExplain(), DescribeTo(), and
- // DescribeNegationTo(), like the following.
-
- // In this example, we want to use NotNull() with any pointer, so
- // MatchAndExplain() accepts a pointer of any type as its first argument.
- // In general, you can define MatchAndExplain() as an ordinary method or
- // a method template, or even overload it.
- template <typename T>
- bool MatchAndExplain(T* p,
- MatchResultListener* /* listener */) const {
- return p != NULL;
- }
-
- // Describes the property of a value matching this matcher.
- void DescribeTo(std::ostream* os) const { *os << "is not NULL"; }
-
- // Describes the property of a value NOT matching this matcher.
- void DescribeNegationTo(std::ostream* os) const { *os << "is NULL"; }
-};
-
-// To construct a polymorphic matcher, pass an instance of the class
-// to MakePolymorphicMatcher(). Note the return type.
-PolymorphicMatcher<NotNullMatcher> NotNull() {
- return MakePolymorphicMatcher(NotNullMatcher());
-}
-
-...
-
- EXPECT_CALL(foo, Bar(NotNull())); // The argument must be a non-NULL pointer.
-```
-
-{: .callout .note}
-**Note:** Your polymorphic matcher class does **not** need to inherit from
-`MatcherInterface` or any other class, and its methods do **not** need to be
-virtual.
-
-Like in a monomorphic matcher, you may explain the match result by streaming
-additional information to the `listener` argument in `MatchAndExplain()`.
-
-### Writing New Cardinalities
-
-A cardinality is used in `Times()` to tell gMock how many times you expect a
-call to occur. It doesn't have to be exact. For example, you can say
-`AtLeast(5)` or `Between(2, 4)`.
-
-If the [built-in set](gmock_cheat_sheet.md#CardinalityList) of cardinalities
-doesn't suit you, you are free to define your own by implementing the following
-interface (in namespace `testing`):
-
-```cpp
-class CardinalityInterface {
- public:
- virtual ~CardinalityInterface();
-
- // Returns true if and only if call_count calls will satisfy this cardinality.
- virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
-
- // Returns true if and only if call_count calls will saturate this
- // cardinality.
- virtual bool IsSaturatedByCallCount(int call_count) const = 0;
-
- // Describes self to an ostream.
- virtual void DescribeTo(std::ostream* os) const = 0;
-};
-```
-
-For example, to specify that a call must occur even number of times, you can
-write
-
-```cpp
-using ::testing::Cardinality;
-using ::testing::CardinalityInterface;
-using ::testing::MakeCardinality;
-
-class EvenNumberCardinality : public CardinalityInterface {
- public:
- bool IsSatisfiedByCallCount(int call_count) const override {
- return (call_count % 2) == 0;
- }
-
- bool IsSaturatedByCallCount(int call_count) const override {
- return false;
- }
-
- void DescribeTo(std::ostream* os) const {
- *os << "called even number of times";
- }
-};
-
-Cardinality EvenNumber() {
- return MakeCardinality(new EvenNumberCardinality);
-}
-
-...
- EXPECT_CALL(foo, Bar(3))
- .Times(EvenNumber());
-```
-
-### Writing New Actions Quickly {#QuickNewActions}
-
-If the built-in actions don't work for you, you can easily define your own one.
-Just define a functor class with a (possibly templated) call operator, matching
-the signature of your action.
-
-```cpp
-struct Increment {
- template <typename T>
- T operator()(T* arg) {
- return ++(*arg);
- }
-}
-```
-
-The same approach works with stateful functors (or any callable, really):
-
-```
-struct MultiplyBy {
- template <typename T>
- T operator()(T arg) { return arg * multiplier; }
-
- int multiplier;
-}
-
-// Then use:
-// EXPECT_CALL(...).WillOnce(MultiplyBy{7});
-```
-
-#### Legacy macro-based Actions
-
-Before C++11, the functor-based actions were not supported; the old way of
-writing actions was through a set of `ACTION*` macros. We suggest to avoid them
-in new code; they hide a lot of logic behind the macro, potentially leading to
-harder-to-understand compiler errors. Nevertheless, we cover them here for
-completeness.
-
-By writing
-
-```cpp
-ACTION(name) { statements; }
-```
-
-in a namespace scope (i.e. not inside a class or function), you will define an
-action with the given name that executes the statements. The value returned by
-`statements` will be used as the return value of the action. Inside the
-statements, you can refer to the K-th (0-based) argument of the mock function as
-`argK`. For example:
-
-```cpp
-ACTION(IncrementArg1) { return ++(*arg1); }
-```
-
-allows you to write
-
-```cpp
-... WillOnce(IncrementArg1());
-```
-
-Note that you don't need to specify the types of the mock function arguments.
-Rest assured that your code is type-safe though: you'll get a compiler error if
-`*arg1` doesn't support the `++` operator, or if the type of `++(*arg1)` isn't
-compatible with the mock function's return type.
-
-Another example:
-
-```cpp
-ACTION(Foo) {
- (*arg2)(5);
- Blah();
- *arg1 = 0;
- return arg0;
-}
-```
-
-defines an action `Foo()` that invokes argument #2 (a function pointer) with 5,
-calls function `Blah()`, sets the value pointed to by argument #1 to 0, and
-returns argument #0.
-
-For more convenience and flexibility, you can also use the following pre-defined
-symbols in the body of `ACTION`:
-
-`argK_type` | The type of the K-th (0-based) argument of the mock function
-:-------------- | :-----------------------------------------------------------
-`args` | All arguments of the mock function as a tuple
-`args_type` | The type of all arguments of the mock function as a tuple
-`return_type` | The return type of the mock function
-`function_type` | The type of the mock function
-
-For example, when using an `ACTION` as a stub action for mock function:
-
-```cpp
-int DoSomething(bool flag, int* ptr);
-```
-
-we have:
-
-Pre-defined Symbol | Is Bound To
------------------- | ---------------------------------
-`arg0` | the value of `flag`
-`arg0_type` | the type `bool`
-`arg1` | the value of `ptr`
-`arg1_type` | the type `int*`
-`args` | the tuple `(flag, ptr)`
-`args_type` | the type `std::tuple<bool, int*>`
-`return_type` | the type `int`
-`function_type` | the type `int(bool, int*)`
-
-#### Legacy macro-based parameterized Actions
-
-Sometimes you'll want to parameterize an action you define. For that we have
-another macro
-
-```cpp
-ACTION_P(name, param) { statements; }
-```
-
-For example,
-
-```cpp
-ACTION_P(Add, n) { return arg0 + n; }
-```
-
-will allow you to write
-
-```cpp
-// Returns argument #0 + 5.
-... WillOnce(Add(5));
-```
-
-For convenience, we use the term *arguments* for the values used to invoke the
-mock function, and the term *parameters* for the values used to instantiate an
-action.
-
-Note that you don't need to provide the type of the parameter either. Suppose
-the parameter is named `param`, you can also use the gMock-defined symbol
-`param_type` to refer to the type of the parameter as inferred by the compiler.
-For example, in the body of `ACTION_P(Add, n)` above, you can write `n_type` for
-the type of `n`.
-
-gMock also provides `ACTION_P2`, `ACTION_P3`, and etc to support multi-parameter
-actions. For example,
-
-```cpp
-ACTION_P2(ReturnDistanceTo, x, y) {
- double dx = arg0 - x;
- double dy = arg1 - y;
- return sqrt(dx*dx + dy*dy);
-}
-```
-
-lets you write
-
-```cpp
-... WillOnce(ReturnDistanceTo(5.0, 26.5));
-```
-
-You can view `ACTION` as a degenerated parameterized action where the number of
-parameters is 0.
-
-You can also easily define actions overloaded on the number of parameters:
-
-```cpp
-ACTION_P(Plus, a) { ... }
-ACTION_P2(Plus, a, b) { ... }
-```
-
-### Restricting the Type of an Argument or Parameter in an ACTION
-
-For maximum brevity and reusability, the `ACTION*` macros don't ask you to
-provide the types of the mock function arguments and the action parameters.
-Instead, we let the compiler infer the types for us.
-
-Sometimes, however, we may want to be more explicit about the types. There are
-several tricks to do that. For example:
-
-```cpp
-ACTION(Foo) {
- // Makes sure arg0 can be converted to int.
- int n = arg0;
- ... use n instead of arg0 here ...
-}
-
-ACTION_P(Bar, param) {
- // Makes sure the type of arg1 is const char*.
- ::testing::StaticAssertTypeEq<const char*, arg1_type>();
-
- // Makes sure param can be converted to bool.
- bool flag = param;
-}
-```
-
-where `StaticAssertTypeEq` is a compile-time assertion in googletest that
-verifies two types are the same.
-
-### Writing New Action Templates Quickly
-
-Sometimes you want to give an action explicit template parameters that cannot be
-inferred from its value parameters. `ACTION_TEMPLATE()` supports that and can be
-viewed as an extension to `ACTION()` and `ACTION_P*()`.
-
-The syntax:
-
-```cpp
-ACTION_TEMPLATE(ActionName,
- HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
- AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
-```
-
-defines an action template that takes *m* explicit template parameters and *n*
-value parameters, where *m* is in [1, 10] and *n* is in [0, 10]. `name_i` is the
-name of the *i*-th template parameter, and `kind_i` specifies whether it's a
-`typename`, an integral constant, or a template. `p_i` is the name of the *i*-th
-value parameter.
-
-Example:
-
-```cpp
-// DuplicateArg<k, T>(output) converts the k-th argument of the mock
-// function to type T and copies it to *output.
-ACTION_TEMPLATE(DuplicateArg,
- // Note the comma between int and k:
- HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
- AND_1_VALUE_PARAMS(output)) {
- *output = T(std::get<k>(args));
-}
-```
-
-To create an instance of an action template, write:
-
-```cpp
-ActionName<t1, ..., t_m>(v1, ..., v_n)
-```
-
-where the `t`s are the template arguments and the `v`s are the value arguments.
-The value argument types are inferred by the compiler. For example:
-
-```cpp
-using ::testing::_;
-...
- int n;
- EXPECT_CALL(mock, Foo).WillOnce(DuplicateArg<1, unsigned char>(&n));
-```
-
-If you want to explicitly specify the value argument types, you can provide
-additional template arguments:
-
-```cpp
-ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
-```
-
-where `u_i` is the desired type of `v_i`.
-
-`ACTION_TEMPLATE` and `ACTION`/`ACTION_P*` can be overloaded on the number of
-value parameters, but not on the number of template parameters. Without the
-restriction, the meaning of the following is unclear:
-
-```cpp
- OverloadedAction<int, bool>(x);
-```
-
-Are we using a single-template-parameter action where `bool` refers to the type
-of `x`, or a two-template-parameter action where the compiler is asked to infer
-the type of `x`?
-
-### Using the ACTION Object's Type
-
-If you are writing a function that returns an `ACTION` object, you'll need to
-know its type. The type depends on the macro used to define the action and the
-parameter types. The rule is relatively simple:
-
-
-| Given Definition | Expression | Has Type |
-| ----------------------------- | ------------------- | --------------------- |
-| `ACTION(Foo)` | `Foo()` | `FooAction` |
-| `ACTION_TEMPLATE(Foo, HAS_m_TEMPLATE_PARAMS(...), AND_0_VALUE_PARAMS())` | `Foo<t1, ..., t_m>()` | `FooAction<t1, ..., t_m>` |
-| `ACTION_P(Bar, param)` | `Bar(int_value)` | `BarActionP<int>` |
-| `ACTION_TEMPLATE(Bar, HAS_m_TEMPLATE_PARAMS(...), AND_1_VALUE_PARAMS(p1))` | `Bar<t1, ..., t_m>(int_value)` | `BarActionP<t1, ..., t_m, int>` |
-| `ACTION_P2(Baz, p1, p2)` | `Baz(bool_value, int_value)` | `BazActionP2<bool, int>` |
-| `ACTION_TEMPLATE(Baz, HAS_m_TEMPLATE_PARAMS(...), AND_2_VALUE_PARAMS(p1, p2))` | `Baz<t1, ..., t_m>(bool_value, int_value)` | `BazActionP2<t1, ..., t_m, bool, int>` |
-| ... | ... | ... |
-
-
-Note that we have to pick different suffixes (`Action`, `ActionP`, `ActionP2`,
-and etc) for actions with different numbers of value parameters, or the action
-definitions cannot be overloaded on the number of them.
-
-### Writing New Monomorphic Actions {#NewMonoActions}
-
-While the `ACTION*` macros are very convenient, sometimes they are
-inappropriate. For example, despite the tricks shown in the previous recipes,
-they don't let you directly specify the types of the mock function arguments and
-the action parameters, which in general leads to unoptimized compiler error
-messages that can baffle unfamiliar users. They also don't allow overloading
-actions based on parameter types without jumping through some hoops.
-
-An alternative to the `ACTION*` macros is to implement
-`::testing::ActionInterface<F>`, where `F` is the type of the mock function in
-which the action will be used. For example:
-
-```cpp
-template <typename F>
-class ActionInterface {
- public:
- virtual ~ActionInterface();
-
- // Performs the action. Result is the return type of function type
- // F, and ArgumentTuple is the tuple of arguments of F.
- //
-
- // For example, if F is int(bool, const string&), then Result would
- // be int, and ArgumentTuple would be std::tuple<bool, const string&>.
- virtual Result Perform(const ArgumentTuple& args) = 0;
-};
-```
-
-```cpp
-using ::testing::_;
-using ::testing::Action;
-using ::testing::ActionInterface;
-using ::testing::MakeAction;
-
-typedef int IncrementMethod(int*);
-
-class IncrementArgumentAction : public ActionInterface<IncrementMethod> {
- public:
- int Perform(const std::tuple<int*>& args) override {
- int* p = std::get<0>(args); // Grabs the first argument.
- return *p++;
- }
-};
-
-Action<IncrementMethod> IncrementArgument() {
- return MakeAction(new IncrementArgumentAction);
-}
-
-...
- EXPECT_CALL(foo, Baz(_))
- .WillOnce(IncrementArgument());
-
- int n = 5;
- foo.Baz(&n); // Should return 5 and change n to 6.
-```
-
-### Writing New Polymorphic Actions {#NewPolyActions}
-
-The previous recipe showed you how to define your own action. This is all good,
-except that you need to know the type of the function in which the action will
-be used. Sometimes that can be a problem. For example, if you want to use the
-action in functions with *different* types (e.g. like `Return()` and
-`SetArgPointee()`).
-
-If an action can be used in several types of mock functions, we say it's
-*polymorphic*. The `MakePolymorphicAction()` function template makes it easy to
-define such an action:
-
-```cpp
-namespace testing {
-template <typename Impl>
-PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl);
-} // namespace testing
-```
-
-As an example, let's define an action that returns the second argument in the
-mock function's argument list. The first step is to define an implementation
-class:
-
-```cpp
-class ReturnSecondArgumentAction {
- public:
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) const {
- // To get the i-th (0-based) argument, use std::get(args).
- return std::get<1>(args);
- }
-};
-```
-
-This implementation class does *not* need to inherit from any particular class.
-What matters is that it must have a `Perform()` method template. This method
-template takes the mock function's arguments as a tuple in a **single**
-argument, and returns the result of the action. It can be either `const` or not,
-but must be invocable with exactly one template argument, which is the result
-type. In other words, you must be able to call `Perform<R>(args)` where `R` is
-the mock function's return type and `args` is its arguments in a tuple.
-
-Next, we use `MakePolymorphicAction()` to turn an instance of the implementation
-class into the polymorphic action we need. It will be convenient to have a
-wrapper for this:
-
-```cpp
-using ::testing::MakePolymorphicAction;
-using ::testing::PolymorphicAction;
-
-PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
- return MakePolymorphicAction(ReturnSecondArgumentAction());
-}
-```
-
-Now, you can use this polymorphic action the same way you use the built-in ones:
-
-```cpp
-using ::testing::_;
-
-class MockFoo : public Foo {
- public:
- MOCK_METHOD(int, DoThis, (bool flag, int n), (override));
- MOCK_METHOD(string, DoThat, (int x, const char* str1, const char* str2),
- (override));
-};
-
- ...
- MockFoo foo;
- EXPECT_CALL(foo, DoThis).WillOnce(ReturnSecondArgument());
- EXPECT_CALL(foo, DoThat).WillOnce(ReturnSecondArgument());
- ...
- foo.DoThis(true, 5); // Will return 5.
- foo.DoThat(1, "Hi", "Bye"); // Will return "Hi".
-```
-
-### Teaching gMock How to Print Your Values
-
-When an uninteresting or unexpected call occurs, gMock prints the argument
-values and the stack trace to help you debug. Assertion macros like
-`EXPECT_THAT` and `EXPECT_EQ` also print the values in question when the
-assertion fails. gMock and googletest do this using googletest's user-extensible
-value printer.
-
-This printer knows how to print built-in C++ types, native arrays, STL
-containers, and any type that supports the `<<` operator. For other types, it
-prints the raw bytes in the value and hopes that you the user can figure it out.
-[The GoogleTest advanced guide](advanced.md#teaching-googletest-how-to-print-your-values)
-explains how to extend the printer to do a better job at printing your
-particular type than to dump the bytes.
-
-## Useful Mocks Created Using gMock
-
-<!--#include file="includes/g3_testing_LOGs.md"-->
-<!--#include file="includes/g3_mock_callbacks.md"-->
-
-### Mock std::function {#MockFunction}
-
-`std::function` is a general function type introduced in C++11. It is a
-preferred way of passing callbacks to new interfaces. Functions are copiable,
-and are not usually passed around by pointer, which makes them tricky to mock.
-But fear not - `MockFunction` can help you with that.
-
-`MockFunction<R(T1, ..., Tn)>` has a mock method `Call()` with the signature:
-
-```cpp
- R Call(T1, ..., Tn);
-```
-
-It also has a `AsStdFunction()` method, which creates a `std::function` proxy
-forwarding to Call:
-
-```cpp
- std::function<R(T1, ..., Tn)> AsStdFunction();
-```
-
-To use `MockFunction`, first create `MockFunction` object and set up
-expectations on its `Call` method. Then pass proxy obtained from
-`AsStdFunction()` to the code you are testing. For example:
-
-```cpp
-TEST(FooTest, RunsCallbackWithBarArgument) {
- // 1. Create a mock object.
- MockFunction<int(string)> mock_function;
-
- // 2. Set expectations on Call() method.
- EXPECT_CALL(mock_function, Call("bar")).WillOnce(Return(1));
-
- // 3. Exercise code that uses std::function.
- Foo(mock_function.AsStdFunction());
- // Foo's signature can be either of:
- // void Foo(const std::function<int(string)>& fun);
- // void Foo(std::function<int(string)> fun);
-
- // 4. All expectations will be verified when mock_function
- // goes out of scope and is destroyed.
-}
-```
-
-Remember that function objects created with `AsStdFunction()` are just
-forwarders. If you create multiple of them, they will share the same set of
-expectations.
-
-Although `std::function` supports unlimited number of arguments, `MockFunction`
-implementation is limited to ten. If you ever hit that limit... well, your
-callback has bigger problems than being mockable. :-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_faq.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_faq.md
deleted file mode 100644
index 8f220bf7a8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_faq.md
+++ /dev/null
@@ -1,390 +0,0 @@
-# Legacy gMock FAQ
-
-### When I call a method on my mock object, the method for the real object is invoked instead. What's the problem?
-
-In order for a method to be mocked, it must be *virtual*, unless you use the
-[high-perf dependency injection technique](gmock_cook_book.md#MockingNonVirtualMethods).
-
-### Can I mock a variadic function?
-
-You cannot mock a variadic function (i.e. a function taking ellipsis (`...`)
-arguments) directly in gMock.
-
-The problem is that in general, there is *no way* for a mock object to know how
-many arguments are passed to the variadic method, and what the arguments' types
-are. Only the *author of the base class* knows the protocol, and we cannot look
-into his or her head.
-
-Therefore, to mock such a function, the *user* must teach the mock object how to
-figure out the number of arguments and their types. One way to do it is to
-provide overloaded versions of the function.
-
-Ellipsis arguments are inherited from C and not really a C++ feature. They are
-unsafe to use and don't work with arguments that have constructors or
-destructors. Therefore we recommend to avoid them in C++ as much as possible.
-
-### MSVC gives me warning C4301 or C4373 when I define a mock method with a const parameter. Why?
-
-If you compile this using Microsoft Visual C++ 2005 SP1:
-
-```cpp
-class Foo {
- ...
- virtual void Bar(const int i) = 0;
-};
-
-class MockFoo : public Foo {
- ...
- MOCK_METHOD(void, Bar, (const int i), (override));
-};
-```
-
-You may get the following warning:
-
-```shell
-warning C4301: 'MockFoo::Bar': overriding virtual function only differs from 'Foo::Bar' by const/volatile qualifier
-```
-
-This is a MSVC bug. The same code compiles fine with gcc, for example. If you
-use Visual C++ 2008 SP1, you would get the warning:
-
-```shell
-warning C4373: 'MockFoo::Bar': virtual function overrides 'Foo::Bar', previous versions of the compiler did not override when parameters only differed by const/volatile qualifiers
-```
-
-In C++, if you *declare* a function with a `const` parameter, the `const`
-modifier is ignored. Therefore, the `Foo` base class above is equivalent to:
-
-```cpp
-class Foo {
- ...
- virtual void Bar(int i) = 0; // int or const int? Makes no difference.
-};
-```
-
-In fact, you can *declare* `Bar()` with an `int` parameter, and define it with a
-`const int` parameter. The compiler will still match them up.
-
-Since making a parameter `const` is meaningless in the method declaration, we
-recommend to remove it in both `Foo` and `MockFoo`. That should workaround the
-VC bug.
-
-Note that we are talking about the *top-level* `const` modifier here. If the
-function parameter is passed by pointer or reference, declaring the pointee or
-referee as `const` is still meaningful. For example, the following two
-declarations are *not* equivalent:
-
-```cpp
-void Bar(int* p); // Neither p nor *p is const.
-void Bar(const int* p); // p is not const, but *p is.
-```
-
-### I can't figure out why gMock thinks my expectations are not satisfied. What should I do?
-
-You might want to run your test with `--gmock_verbose=info`. This flag lets
-gMock print a trace of every mock function call it receives. By studying the
-trace, you'll gain insights on why the expectations you set are not met.
-
-If you see the message "The mock function has no default action set, and its
-return type has no default value set.", then try
-[adding a default action](gmock_cheat_sheet.md#OnCall). Due to a known issue,
-unexpected calls on mocks without default actions don't print out a detailed
-comparison between the actual arguments and the expected arguments.
-
-### My program crashed and `ScopedMockLog` spit out tons of messages. Is it a gMock bug?
-
-gMock and `ScopedMockLog` are likely doing the right thing here.
-
-When a test crashes, the failure signal handler will try to log a lot of
-information (the stack trace, and the address map, for example). The messages
-are compounded if you have many threads with depth stacks. When `ScopedMockLog`
-intercepts these messages and finds that they don't match any expectations, it
-prints an error for each of them.
-
-You can learn to ignore the errors, or you can rewrite your expectations to make
-your test more robust, for example, by adding something like:
-
-```cpp
-using ::testing::AnyNumber;
-using ::testing::Not;
-...
- // Ignores any log not done by us.
- EXPECT_CALL(log, Log(_, Not(EndsWith("/my_file.cc")), _))
- .Times(AnyNumber());
-```
-
-### How can I assert that a function is NEVER called?
-
-```cpp
-using ::testing::_;
-...
- EXPECT_CALL(foo, Bar(_))
- .Times(0);
-```
-
-### I have a failed test where gMock tells me TWICE that a particular expectation is not satisfied. Isn't this redundant?
-
-When gMock detects a failure, it prints relevant information (the mock function
-arguments, the state of relevant expectations, and etc) to help the user debug.
-If another failure is detected, gMock will do the same, including printing the
-state of relevant expectations.
-
-Sometimes an expectation's state didn't change between two failures, and you'll
-see the same description of the state twice. They are however *not* redundant,
-as they refer to *different points in time*. The fact they are the same *is*
-interesting information.
-
-### I get a heapcheck failure when using a mock object, but using a real object is fine. What can be wrong?
-
-Does the class (hopefully a pure interface) you are mocking have a virtual
-destructor?
-
-Whenever you derive from a base class, make sure its destructor is virtual.
-Otherwise Bad Things will happen. Consider the following code:
-
-```cpp
-class Base {
- public:
- // Not virtual, but should be.
- ~Base() { ... }
- ...
-};
-
-class Derived : public Base {
- public:
- ...
- private:
- std::string value_;
-};
-
-...
- Base* p = new Derived;
- ...
- delete p; // Surprise! ~Base() will be called, but ~Derived() will not
- // - value_ is leaked.
-```
-
-By changing `~Base()` to virtual, `~Derived()` will be correctly called when
-`delete p` is executed, and the heap checker will be happy.
-
-### The "newer expectations override older ones" rule makes writing expectations awkward. Why does gMock do that?
-
-When people complain about this, often they are referring to code like:
-
-```cpp
-using ::testing::Return;
-...
- // foo.Bar() should be called twice, return 1 the first time, and return
- // 2 the second time. However, I have to write the expectations in the
- // reverse order. This sucks big time!!!
- EXPECT_CALL(foo, Bar())
- .WillOnce(Return(2))
- .RetiresOnSaturation();
- EXPECT_CALL(foo, Bar())
- .WillOnce(Return(1))
- .RetiresOnSaturation();
-```
-
-The problem, is that they didn't pick the **best** way to express the test's
-intent.
-
-By default, expectations don't have to be matched in *any* particular order. If
-you want them to match in a certain order, you need to be explicit. This is
-gMock's (and jMock's) fundamental philosophy: it's easy to accidentally
-over-specify your tests, and we want to make it harder to do so.
-
-There are two better ways to write the test spec. You could either put the
-expectations in sequence:
-
-```cpp
-using ::testing::Return;
-...
- // foo.Bar() should be called twice, return 1 the first time, and return
- // 2 the second time. Using a sequence, we can write the expectations
- // in their natural order.
- {
- InSequence s;
- EXPECT_CALL(foo, Bar())
- .WillOnce(Return(1))
- .RetiresOnSaturation();
- EXPECT_CALL(foo, Bar())
- .WillOnce(Return(2))
- .RetiresOnSaturation();
- }
-```
-
-or you can put the sequence of actions in the same expectation:
-
-```cpp
-using ::testing::Return;
-...
- // foo.Bar() should be called twice, return 1 the first time, and return
- // 2 the second time.
- EXPECT_CALL(foo, Bar())
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .RetiresOnSaturation();
-```
-
-Back to the original questions: why does gMock search the expectations (and
-`ON_CALL`s) from back to front? Because this allows a user to set up a mock's
-behavior for the common case early (e.g. in the mock's constructor or the test
-fixture's set-up phase) and customize it with more specific rules later. If
-gMock searches from front to back, this very useful pattern won't be possible.
-
-### gMock prints a warning when a function without EXPECT_CALL is called, even if I have set its behavior using ON_CALL. Would it be reasonable not to show the warning in this case?
-
-When choosing between being neat and being safe, we lean toward the latter. So
-the answer is that we think it's better to show the warning.
-
-Often people write `ON_CALL`s in the mock object's constructor or `SetUp()`, as
-the default behavior rarely changes from test to test. Then in the test body
-they set the expectations, which are often different for each test. Having an
-`ON_CALL` in the set-up part of a test doesn't mean that the calls are expected.
-If there's no `EXPECT_CALL` and the method is called, it's possibly an error. If
-we quietly let the call go through without notifying the user, bugs may creep in
-unnoticed.
-
-If, however, you are sure that the calls are OK, you can write
-
-```cpp
-using ::testing::_;
-...
- EXPECT_CALL(foo, Bar(_))
- .WillRepeatedly(...);
-```
-
-instead of
-
-```cpp
-using ::testing::_;
-...
- ON_CALL(foo, Bar(_))
- .WillByDefault(...);
-```
-
-This tells gMock that you do expect the calls and no warning should be printed.
-
-Also, you can control the verbosity by specifying `--gmock_verbose=error`. Other
-values are `info` and `warning`. If you find the output too noisy when
-debugging, just choose a less verbose level.
-
-### How can I delete the mock function's argument in an action?
-
-If your mock function takes a pointer argument and you want to delete that
-argument, you can use testing::DeleteArg<N>() to delete the N'th (zero-indexed)
-argument:
-
-```cpp
-using ::testing::_;
- ...
- MOCK_METHOD(void, Bar, (X* x, const Y& y));
- ...
- EXPECT_CALL(mock_foo_, Bar(_, _))
- .WillOnce(testing::DeleteArg<0>()));
-```
-
-### How can I perform an arbitrary action on a mock function's argument?
-
-If you find yourself needing to perform some action that's not supported by
-gMock directly, remember that you can define your own actions using
-[`MakeAction()`](#NewMonoActions) or
-[`MakePolymorphicAction()`](#NewPolyActions), or you can write a stub function
-and invoke it using [`Invoke()`](#FunctionsAsActions).
-
-```cpp
-using ::testing::_;
-using ::testing::Invoke;
- ...
- MOCK_METHOD(void, Bar, (X* p));
- ...
- EXPECT_CALL(mock_foo_, Bar(_))
- .WillOnce(Invoke(MyAction(...)));
-```
-
-### My code calls a static/global function. Can I mock it?
-
-You can, but you need to make some changes.
-
-In general, if you find yourself needing to mock a static function, it's a sign
-that your modules are too tightly coupled (and less flexible, less reusable,
-less testable, etc). You are probably better off defining a small interface and
-call the function through that interface, which then can be easily mocked. It's
-a bit of work initially, but usually pays for itself quickly.
-
-This Google Testing Blog
-[post](https://testing.googleblog.com/2008/06/defeat-static-cling.html) says it
-excellently. Check it out.
-
-### My mock object needs to do complex stuff. It's a lot of pain to specify the actions. gMock sucks!
-
-I know it's not a question, but you get an answer for free any way. :-)
-
-With gMock, you can create mocks in C++ easily. And people might be tempted to
-use them everywhere. Sometimes they work great, and sometimes you may find them,
-well, a pain to use. So, what's wrong in the latter case?
-
-When you write a test without using mocks, you exercise the code and assert that
-it returns the correct value or that the system is in an expected state. This is
-sometimes called "state-based testing".
-
-Mocks are great for what some call "interaction-based" testing: instead of
-checking the system state at the very end, mock objects verify that they are
-invoked the right way and report an error as soon as it arises, giving you a
-handle on the precise context in which the error was triggered. This is often
-more effective and economical to do than state-based testing.
-
-If you are doing state-based testing and using a test double just to simulate
-the real object, you are probably better off using a fake. Using a mock in this
-case causes pain, as it's not a strong point for mocks to perform complex
-actions. If you experience this and think that mocks suck, you are just not
-using the right tool for your problem. Or, you might be trying to solve the
-wrong problem. :-)
-
-### I got a warning "Uninteresting function call encountered - default action taken.." Should I panic?
-
-By all means, NO! It's just an FYI. :-)
-
-What it means is that you have a mock function, you haven't set any expectations
-on it (by gMock's rule this means that you are not interested in calls to this
-function and therefore it can be called any number of times), and it is called.
-That's OK - you didn't say it's not OK to call the function!
-
-What if you actually meant to disallow this function to be called, but forgot to
-write `EXPECT_CALL(foo, Bar()).Times(0)`? While one can argue that it's the
-user's fault, gMock tries to be nice and prints you a note.
-
-So, when you see the message and believe that there shouldn't be any
-uninteresting calls, you should investigate what's going on. To make your life
-easier, gMock dumps the stack trace when an uninteresting call is encountered.
-From that you can figure out which mock function it is, and how it is called.
-
-### I want to define a custom action. Should I use Invoke() or implement the ActionInterface interface?
-
-Either way is fine - you want to choose the one that's more convenient for your
-circumstance.
-
-Usually, if your action is for a particular function type, defining it using
-`Invoke()` should be easier; if your action can be used in functions of
-different types (e.g. if you are defining `Return(*value*)`),
-`MakePolymorphicAction()` is easiest. Sometimes you want precise control on what
-types of functions the action can be used in, and implementing `ActionInterface`
-is the way to go here. See the implementation of `Return()` in `gmock-actions.h`
-for an example.
-
-### I use SetArgPointee() in WillOnce(), but gcc complains about "conflicting return type specified". What does it mean?
-
-You got this error as gMock has no idea what value it should return when the
-mock method is called. `SetArgPointee()` says what the side effect is, but
-doesn't say what the return value should be. You need `DoAll()` to chain a
-`SetArgPointee()` with a `Return()` that provides a value appropriate to the API
-being mocked.
-
-See this [recipe](gmock_cook_book.md#mocking-side-effects) for more details and
-an example.
-
-### I have a huge mock class, and Microsoft Visual C++ runs out of memory when compiling it. What can I do?
-
-We've noticed that when the `/clr` compiler flag is used, Visual C++ uses 5~6
-times as much memory when compiling a mock class. We suggest to avoid `/clr`
-when compiling native C++ mocks.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_for_dummies.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_for_dummies.md
deleted file mode 100644
index fa1296eebe..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/gmock_for_dummies.md
+++ /dev/null
@@ -1,700 +0,0 @@
-# gMock for Dummies
-
-## What Is gMock?
-
-When you write a prototype or test, often it's not feasible or wise to rely on
-real objects entirely. A **mock object** implements the same interface as a real
-object (so it can be used as one), but lets you specify at run time how it will
-be used and what it should do (which methods will be called? in which order? how
-many times? with what arguments? what will they return? etc).
-
-It is easy to confuse the term *fake objects* with mock objects. Fakes and mocks
-actually mean very different things in the Test-Driven Development (TDD)
-community:
-
-* **Fake** objects have working implementations, but usually take some
- shortcut (perhaps to make the operations less expensive), which makes them
- not suitable for production. An in-memory file system would be an example of
- a fake.
-* **Mocks** are objects pre-programmed with *expectations*, which form a
- specification of the calls they are expected to receive.
-
-If all this seems too abstract for you, don't worry - the most important thing
-to remember is that a mock allows you to check the *interaction* between itself
-and code that uses it. The difference between fakes and mocks shall become much
-clearer once you start to use mocks.
-
-**gMock** is a library (sometimes we also call it a "framework" to make it sound
-cool) for creating mock classes and using them. It does to C++ what
-jMock/EasyMock does to Java (well, more or less).
-
-When using gMock,
-
-1. first, you use some simple macros to describe the interface you want to
- mock, and they will expand to the implementation of your mock class;
-2. next, you create some mock objects and specify its expectations and behavior
- using an intuitive syntax;
-3. then you exercise code that uses the mock objects. gMock will catch any
- violation to the expectations as soon as it arises.
-
-## Why gMock?
-
-While mock objects help you remove unnecessary dependencies in tests and make
-them fast and reliable, using mocks manually in C++ is *hard*:
-
-* Someone has to implement the mocks. The job is usually tedious and
- error-prone. No wonder people go great distance to avoid it.
-* The quality of those manually written mocks is a bit, uh, unpredictable. You
- may see some really polished ones, but you may also see some that were
- hacked up in a hurry and have all sorts of ad hoc restrictions.
-* The knowledge you gained from using one mock doesn't transfer to the next
- one.
-
-In contrast, Java and Python programmers have some fine mock frameworks (jMock,
-EasyMock, etc), which automate the creation of mocks. As a result, mocking is a
-proven effective technique and widely adopted practice in those communities.
-Having the right tool absolutely makes the difference.
-
-gMock was built to help C++ programmers. It was inspired by jMock and EasyMock,
-but designed with C++'s specifics in mind. It is your friend if any of the
-following problems is bothering you:
-
-* You are stuck with a sub-optimal design and wish you had done more
- prototyping before it was too late, but prototyping in C++ is by no means
- "rapid".
-* Your tests are slow as they depend on too many libraries or use expensive
- resources (e.g. a database).
-* Your tests are brittle as some resources they use are unreliable (e.g. the
- network).
-* You want to test how your code handles a failure (e.g. a file checksum
- error), but it's not easy to cause one.
-* You need to make sure that your module interacts with other modules in the
- right way, but it's hard to observe the interaction; therefore you resort to
- observing the side effects at the end of the action, but it's awkward at
- best.
-* You want to "mock out" your dependencies, except that they don't have mock
- implementations yet; and, frankly, you aren't thrilled by some of those
- hand-written mocks.
-
-We encourage you to use gMock as
-
-* a *design* tool, for it lets you experiment with your interface design early
- and often. More iterations lead to better designs!
-* a *testing* tool to cut your tests' outbound dependencies and probe the
- interaction between your module and its collaborators.
-
-## Getting Started
-
-gMock is bundled with googletest.
-
-## A Case for Mock Turtles
-
-Let's look at an example. Suppose you are developing a graphics program that
-relies on a [LOGO](http://en.wikipedia.org/wiki/Logo_programming_language)-like
-API for drawing. How would you test that it does the right thing? Well, you can
-run it and compare the screen with a golden screen snapshot, but let's admit it:
-tests like this are expensive to run and fragile (What if you just upgraded to a
-shiny new graphics card that has better anti-aliasing? Suddenly you have to
-update all your golden images.). It would be too painful if all your tests are
-like this. Fortunately, you learned about
-[Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection) and know the right thing
-to do: instead of having your application talk to the system API directly, wrap
-the API in an interface (say, `Turtle`) and code to that interface:
-
-```cpp
-class Turtle {
- ...
- virtual ~Turtle() {}
- virtual void PenUp() = 0;
- virtual void PenDown() = 0;
- virtual void Forward(int distance) = 0;
- virtual void Turn(int degrees) = 0;
- virtual void GoTo(int x, int y) = 0;
- virtual int GetX() const = 0;
- virtual int GetY() const = 0;
-};
-```
-
-(Note that the destructor of `Turtle` **must** be virtual, as is the case for
-**all** classes you intend to inherit from - otherwise the destructor of the
-derived class will not be called when you delete an object through a base
-pointer, and you'll get corrupted program states like memory leaks.)
-
-You can control whether the turtle's movement will leave a trace using `PenUp()`
-and `PenDown()`, and control its movement using `Forward()`, `Turn()`, and
-`GoTo()`. Finally, `GetX()` and `GetY()` tell you the current position of the
-turtle.
-
-Your program will normally use a real implementation of this interface. In
-tests, you can use a mock implementation instead. This allows you to easily
-check what drawing primitives your program is calling, with what arguments, and
-in which order. Tests written this way are much more robust (they won't break
-because your new machine does anti-aliasing differently), easier to read and
-maintain (the intent of a test is expressed in the code, not in some binary
-images), and run *much, much faster*.
-
-## Writing the Mock Class
-
-If you are lucky, the mocks you need to use have already been implemented by
-some nice people. If, however, you find yourself in the position to write a mock
-class, relax - gMock turns this task into a fun game! (Well, almost.)
-
-### How to Define It
-
-Using the `Turtle` interface as example, here are the simple steps you need to
-follow:
-
-* Derive a class `MockTurtle` from `Turtle`.
-* Take a *virtual* function of `Turtle` (while it's possible to
- [mock non-virtual methods using templates](gmock_cook_book.md#MockingNonVirtualMethods),
- it's much more involved).
-* In the `public:` section of the child class, write `MOCK_METHOD();`
-* Now comes the fun part: you take the function signature, cut-and-paste it
- into the macro, and add two commas - one between the return type and the
- name, another between the name and the argument list.
-* If you're mocking a const method, add a 4th parameter containing `(const)`
- (the parentheses are required).
-* Since you're overriding a virtual method, we suggest adding the `override`
- keyword. For const methods the 4th parameter becomes `(const, override)`,
- for non-const methods just `(override)`. This isn't mandatory.
-* Repeat until all virtual functions you want to mock are done. (It goes
- without saying that *all* pure virtual methods in your abstract class must
- be either mocked or overridden.)
-
-After the process, you should have something like:
-
-```cpp
-#include "gmock/gmock.h" // Brings in gMock.
-
-class MockTurtle : public Turtle {
- public:
- ...
- MOCK_METHOD(void, PenUp, (), (override));
- MOCK_METHOD(void, PenDown, (), (override));
- MOCK_METHOD(void, Forward, (int distance), (override));
- MOCK_METHOD(void, Turn, (int degrees), (override));
- MOCK_METHOD(void, GoTo, (int x, int y), (override));
- MOCK_METHOD(int, GetX, (), (const, override));
- MOCK_METHOD(int, GetY, (), (const, override));
-};
-```
-
-You don't need to define these mock methods somewhere else - the `MOCK_METHOD`
-macro will generate the definitions for you. It's that simple!
-
-### Where to Put It
-
-When you define a mock class, you need to decide where to put its definition.
-Some people put it in a `_test.cc`. This is fine when the interface being mocked
-(say, `Foo`) is owned by the same person or team. Otherwise, when the owner of
-`Foo` changes it, your test could break. (You can't really expect `Foo`'s
-maintainer to fix every test that uses `Foo`, can you?)
-
-Generally, you should not define mock classes you don't own. If you must mock
-such a class owned by others, define the mock class in `Foo`'s Bazel package
-(usually the same directory or a `testing` sub-directory), and put it in a `.h`
-and a `cc_library` with `testonly=True`. Then everyone can reference them from
-their tests. If `Foo` ever changes, there is only one copy of `MockFoo` to
-change, and only tests that depend on the changed methods need to be fixed.
-
-Another way to do it: you can introduce a thin layer `FooAdaptor` on top of
-`Foo` and code to this new interface. Since you own `FooAdaptor`, you can absorb
-changes in `Foo` much more easily. While this is more work initially, carefully
-choosing the adaptor interface can make your code easier to write and more
-readable (a net win in the long run), as you can choose `FooAdaptor` to fit your
-specific domain much better than `Foo` does.
-
-## Using Mocks in Tests
-
-Once you have a mock class, using it is easy. The typical work flow is:
-
-1. Import the gMock names from the `testing` namespace such that you can use
- them unqualified (You only have to do it once per file). Remember that
- namespaces are a good idea.
-2. Create some mock objects.
-3. Specify your expectations on them (How many times will a method be called?
- With what arguments? What should it do? etc.).
-4. Exercise some code that uses the mocks; optionally, check the result using
- googletest assertions. If a mock method is called more than expected or with
- wrong arguments, you'll get an error immediately.
-5. When a mock is destructed, gMock will automatically check whether all
- expectations on it have been satisfied.
-
-Here's an example:
-
-```cpp
-#include "path/to/mock-turtle.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-using ::testing::AtLeast; // #1
-
-TEST(PainterTest, CanDrawSomething) {
- MockTurtle turtle; // #2
- EXPECT_CALL(turtle, PenDown()) // #3
- .Times(AtLeast(1));
-
- Painter painter(&turtle); // #4
-
- EXPECT_TRUE(painter.DrawCircle(0, 0, 10)); // #5
-}
-```
-
-As you might have guessed, this test checks that `PenDown()` is called at least
-once. If the `painter` object didn't call this method, your test will fail with
-a message like this:
-
-```text
-path/to/my_test.cc:119: Failure
-Actual function call count doesn't match this expectation:
-Actually: never called;
-Expected: called at least once.
-Stack trace:
-...
-```
-
-**Tip 1:** If you run the test from an Emacs buffer, you can hit `<Enter>` on
-the line number to jump right to the failed expectation.
-
-**Tip 2:** If your mock objects are never deleted, the final verification won't
-happen. Therefore it's a good idea to turn on the heap checker in your tests
-when you allocate mocks on the heap. You get that automatically if you use the
-`gtest_main` library already.
-
-**Important note:** gMock requires expectations to be set **before** the mock
-functions are called, otherwise the behavior is **undefined**. Do not alternate
-between calls to `EXPECT_CALL()` and calls to the mock functions, and do not set
-any expectations on a mock after passing the mock to an API.
-
-This means `EXPECT_CALL()` should be read as expecting that a call will occur
-*in the future*, not that a call has occurred. Why does gMock work like that?
-Well, specifying the expectation beforehand allows gMock to report a violation
-as soon as it rises, when the context (stack trace, etc) is still available.
-This makes debugging much easier.
-
-Admittedly, this test is contrived and doesn't do much. You can easily achieve
-the same effect without using gMock. However, as we shall reveal soon, gMock
-allows you to do *so much more* with the mocks.
-
-## Setting Expectations
-
-The key to using a mock object successfully is to set the *right expectations*
-on it. If you set the expectations too strict, your test will fail as the result
-of unrelated changes. If you set them too loose, bugs can slip through. You want
-to do it just right such that your test can catch exactly the kind of bugs you
-intend it to catch. gMock provides the necessary means for you to do it "just
-right."
-
-### General Syntax
-
-In gMock we use the `EXPECT_CALL()` macro to set an expectation on a mock
-method. The general syntax is:
-
-```cpp
-EXPECT_CALL(mock_object, method(matchers))
- .Times(cardinality)
- .WillOnce(action)
- .WillRepeatedly(action);
-```
-
-The macro has two arguments: first the mock object, and then the method and its
-arguments. Note that the two are separated by a comma (`,`), not a period (`.`).
-(Why using a comma? The answer is that it was necessary for technical reasons.)
-If the method is not overloaded, the macro can also be called without matchers:
-
-```cpp
-EXPECT_CALL(mock_object, non-overloaded-method)
- .Times(cardinality)
- .WillOnce(action)
- .WillRepeatedly(action);
-```
-
-This syntax allows the test writer to specify "called with any arguments"
-without explicitly specifying the number or types of arguments. To avoid
-unintended ambiguity, this syntax may only be used for methods that are not
-overloaded.
-
-Either form of the macro can be followed by some optional *clauses* that provide
-more information about the expectation. We'll discuss how each clause works in
-the coming sections.
-
-This syntax is designed to make an expectation read like English. For example,
-you can probably guess that
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(turtle, GetX())
- .Times(5)
- .WillOnce(Return(100))
- .WillOnce(Return(150))
- .WillRepeatedly(Return(200));
-```
-
-says that the `turtle` object's `GetX()` method will be called five times, it
-will return 100 the first time, 150 the second time, and then 200 every time.
-Some people like to call this style of syntax a Domain-Specific Language (DSL).
-
-{: .callout .note}
-**Note:** Why do we use a macro to do this? Well it serves two purposes: first
-it makes expectations easily identifiable (either by `grep` or by a human
-reader), and second it allows gMock to include the source file location of a
-failed expectation in messages, making debugging easier.
-
-### Matchers: What Arguments Do We Expect?
-
-When a mock function takes arguments, we may specify what arguments we are
-expecting, for example:
-
-```cpp
-// Expects the turtle to move forward by 100 units.
-EXPECT_CALL(turtle, Forward(100));
-```
-
-Oftentimes you do not want to be too specific. Remember that talk about tests
-being too rigid? Over specification leads to brittle tests and obscures the
-intent of tests. Therefore we encourage you to specify only what's necessary—no
-more, no less. If you aren't interested in the value of an argument, write `_`
-as the argument, which means "anything goes":
-
-```cpp
-using ::testing::_;
-...
-// Expects that the turtle jumps to somewhere on the x=50 line.
-EXPECT_CALL(turtle, GoTo(50, _));
-```
-
-`_` is an instance of what we call **matchers**. A matcher is like a predicate
-and can test whether an argument is what we'd expect. You can use a matcher
-inside `EXPECT_CALL()` wherever a function argument is expected. `_` is a
-convenient way of saying "any value".
-
-In the above examples, `100` and `50` are also matchers; implicitly, they are
-the same as `Eq(100)` and `Eq(50)`, which specify that the argument must be
-equal (using `operator==`) to the matcher argument. There are many
-[built-in matchers](reference/matchers.md) for common types (as well as
-[custom matchers](gmock_cook_book.md#NewMatchers)); for example:
-
-```cpp
-using ::testing::Ge;
-...
-// Expects the turtle moves forward by at least 100.
-EXPECT_CALL(turtle, Forward(Ge(100)));
-```
-
-If you don't care about *any* arguments, rather than specify `_` for each of
-them you may instead omit the parameter list:
-
-```cpp
-// Expects the turtle to move forward.
-EXPECT_CALL(turtle, Forward);
-// Expects the turtle to jump somewhere.
-EXPECT_CALL(turtle, GoTo);
-```
-
-This works for all non-overloaded methods; if a method is overloaded, you need
-to help gMock resolve which overload is expected by specifying the number of
-arguments and possibly also the
-[types of the arguments](gmock_cook_book.md#SelectOverload).
-
-### Cardinalities: How Many Times Will It Be Called?
-
-The first clause we can specify following an `EXPECT_CALL()` is `Times()`. We
-call its argument a **cardinality** as it tells *how many times* the call should
-occur. It allows us to repeat an expectation many times without actually writing
-it as many times. More importantly, a cardinality can be "fuzzy", just like a
-matcher can be. This allows a user to express the intent of a test exactly.
-
-An interesting special case is when we say `Times(0)`. You may have guessed - it
-means that the function shouldn't be called with the given arguments at all, and
-gMock will report a googletest failure whenever the function is (wrongfully)
-called.
-
-We've seen `AtLeast(n)` as an example of fuzzy cardinalities earlier. For the
-list of built-in cardinalities you can use, see
-[here](gmock_cheat_sheet.md#CardinalityList).
-
-The `Times()` clause can be omitted. **If you omit `Times()`, gMock will infer
-the cardinality for you.** The rules are easy to remember:
-
-* If **neither** `WillOnce()` **nor** `WillRepeatedly()` is in the
- `EXPECT_CALL()`, the inferred cardinality is `Times(1)`.
-* If there are *n* `WillOnce()`'s but **no** `WillRepeatedly()`, where *n* >=
- 1, the cardinality is `Times(n)`.
-* If there are *n* `WillOnce()`'s and **one** `WillRepeatedly()`, where *n* >=
- 0, the cardinality is `Times(AtLeast(n))`.
-
-**Quick quiz:** what do you think will happen if a function is expected to be
-called twice but actually called four times?
-
-### Actions: What Should It Do?
-
-Remember that a mock object doesn't really have a working implementation? We as
-users have to tell it what to do when a method is invoked. This is easy in
-gMock.
-
-First, if the return type of a mock function is a built-in type or a pointer,
-the function has a **default action** (a `void` function will just return, a
-`bool` function will return `false`, and other functions will return 0). In
-addition, in C++ 11 and above, a mock function whose return type is
-default-constructible (i.e. has a default constructor) has a default action of
-returning a default-constructed value. If you don't say anything, this behavior
-will be used.
-
-Second, if a mock function doesn't have a default action, or the default action
-doesn't suit you, you can specify the action to be taken each time the
-expectation matches using a series of `WillOnce()` clauses followed by an
-optional `WillRepeatedly()`. For example,
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(turtle, GetX())
- .WillOnce(Return(100))
- .WillOnce(Return(200))
- .WillOnce(Return(300));
-```
-
-says that `turtle.GetX()` will be called *exactly three times* (gMock inferred
-this from how many `WillOnce()` clauses we've written, since we didn't
-explicitly write `Times()`), and will return 100, 200, and 300 respectively.
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(turtle, GetY())
- .WillOnce(Return(100))
- .WillOnce(Return(200))
- .WillRepeatedly(Return(300));
-```
-
-says that `turtle.GetY()` will be called *at least twice* (gMock knows this as
-we've written two `WillOnce()` clauses and a `WillRepeatedly()` while having no
-explicit `Times()`), will return 100 and 200 respectively the first two times,
-and 300 from the third time on.
-
-Of course, if you explicitly write a `Times()`, gMock will not try to infer the
-cardinality itself. What if the number you specified is larger than there are
-`WillOnce()` clauses? Well, after all `WillOnce()`s are used up, gMock will do
-the *default* action for the function every time (unless, of course, you have a
-`WillRepeatedly()`.).
-
-What can we do inside `WillOnce()` besides `Return()`? You can return a
-reference using `ReturnRef(`*`variable`*`)`, or invoke a pre-defined function,
-among [others](gmock_cook_book.md#using-actions).
-
-**Important note:** The `EXPECT_CALL()` statement evaluates the action clause
-only once, even though the action may be performed many times. Therefore you
-must be careful about side effects. The following may not do what you want:
-
-```cpp
-using ::testing::Return;
-...
-int n = 100;
-EXPECT_CALL(turtle, GetX())
- .Times(4)
- .WillRepeatedly(Return(n++));
-```
-
-Instead of returning 100, 101, 102, ..., consecutively, this mock function will
-always return 100 as `n++` is only evaluated once. Similarly, `Return(new Foo)`
-will create a new `Foo` object when the `EXPECT_CALL()` is executed, and will
-return the same pointer every time. If you want the side effect to happen every
-time, you need to define a custom action, which we'll teach in the
-[cook book](gmock_cook_book.md).
-
-Time for another quiz! What do you think the following means?
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(turtle, GetY())
- .Times(4)
- .WillOnce(Return(100));
-```
-
-Obviously `turtle.GetY()` is expected to be called four times. But if you think
-it will return 100 every time, think twice! Remember that one `WillOnce()`
-clause will be consumed each time the function is invoked and the default action
-will be taken afterwards. So the right answer is that `turtle.GetY()` will
-return 100 the first time, but **return 0 from the second time on**, as
-returning 0 is the default action for `int` functions.
-
-### Using Multiple Expectations {#MultiExpectations}
-
-So far we've only shown examples where you have a single expectation. More
-realistically, you'll specify expectations on multiple mock methods which may be
-from multiple mock objects.
-
-By default, when a mock method is invoked, gMock will search the expectations in
-the **reverse order** they are defined, and stop when an active expectation that
-matches the arguments is found (you can think of it as "newer rules override
-older ones."). If the matching expectation cannot take any more calls, you will
-get an upper-bound-violated failure. Here's an example:
-
-```cpp
-using ::testing::_;
-...
-EXPECT_CALL(turtle, Forward(_)); // #1
-EXPECT_CALL(turtle, Forward(10)) // #2
- .Times(2);
-```
-
-If `Forward(10)` is called three times in a row, the third time it will be an
-error, as the last matching expectation (#2) has been saturated. If, however,
-the third `Forward(10)` call is replaced by `Forward(20)`, then it would be OK,
-as now #1 will be the matching expectation.
-
-{: .callout .note}
-**Note:** Why does gMock search for a match in the *reverse* order of the
-expectations? The reason is that this allows a user to set up the default
-expectations in a mock object's constructor or the test fixture's set-up phase
-and then customize the mock by writing more specific expectations in the test
-body. So, if you have two expectations on the same method, you want to put the
-one with more specific matchers **after** the other, or the more specific rule
-would be shadowed by the more general one that comes after it.
-
-{: .callout .tip}
-**Tip:** It is very common to start with a catch-all expectation for a method
-and `Times(AnyNumber())` (omitting arguments, or with `_` for all arguments, if
-overloaded). This makes any calls to the method expected. This is not necessary
-for methods that are not mentioned at all (these are "uninteresting"), but is
-useful for methods that have some expectations, but for which other calls are
-ok. See
-[Understanding Uninteresting vs Unexpected Calls](gmock_cook_book.md#uninteresting-vs-unexpected).
-
-### Ordered vs Unordered Calls {#OrderedCalls}
-
-By default, an expectation can match a call even though an earlier expectation
-hasn't been satisfied. In other words, the calls don't have to occur in the
-order the expectations are specified.
-
-Sometimes, you may want all the expected calls to occur in a strict order. To
-say this in gMock is easy:
-
-```cpp
-using ::testing::InSequence;
-...
-TEST(FooTest, DrawsLineSegment) {
- ...
- {
- InSequence seq;
-
- EXPECT_CALL(turtle, PenDown());
- EXPECT_CALL(turtle, Forward(100));
- EXPECT_CALL(turtle, PenUp());
- }
- Foo();
-}
-```
-
-By creating an object of type `InSequence`, all expectations in its scope are
-put into a *sequence* and have to occur *sequentially*. Since we are just
-relying on the constructor and destructor of this object to do the actual work,
-its name is really irrelevant.
-
-In this example, we test that `Foo()` calls the three expected functions in the
-order as written. If a call is made out-of-order, it will be an error.
-
-(What if you care about the relative order of some of the calls, but not all of
-them? Can you specify an arbitrary partial order? The answer is ... yes! The
-details can be found [here](gmock_cook_book.md#OrderedCalls).)
-
-### All Expectations Are Sticky (Unless Said Otherwise) {#StickyExpectations}
-
-Now let's do a quick quiz to see how well you can use this mock stuff already.
-How would you test that the turtle is asked to go to the origin *exactly twice*
-(you want to ignore any other instructions it receives)?
-
-After you've come up with your answer, take a look at ours and compare notes
-(solve it yourself first - don't cheat!):
-
-```cpp
-using ::testing::_;
-using ::testing::AnyNumber;
-...
-EXPECT_CALL(turtle, GoTo(_, _)) // #1
- .Times(AnyNumber());
-EXPECT_CALL(turtle, GoTo(0, 0)) // #2
- .Times(2);
-```
-
-Suppose `turtle.GoTo(0, 0)` is called three times. In the third time, gMock will
-see that the arguments match expectation #2 (remember that we always pick the
-last matching expectation). Now, since we said that there should be only two
-such calls, gMock will report an error immediately. This is basically what we've
-told you in the [Using Multiple Expectations](#MultiExpectations) section above.
-
-This example shows that **expectations in gMock are "sticky" by default**, in
-the sense that they remain active even after we have reached their invocation
-upper bounds. This is an important rule to remember, as it affects the meaning
-of the spec, and is **different** to how it's done in many other mocking
-frameworks (Why'd we do that? Because we think our rule makes the common cases
-easier to express and understand.).
-
-Simple? Let's see if you've really understood it: what does the following code
-say?
-
-```cpp
-using ::testing::Return;
-...
-for (int i = n; i > 0; i--) {
- EXPECT_CALL(turtle, GetX())
- .WillOnce(Return(10*i));
-}
-```
-
-If you think it says that `turtle.GetX()` will be called `n` times and will
-return 10, 20, 30, ..., consecutively, think twice! The problem is that, as we
-said, expectations are sticky. So, the second time `turtle.GetX()` is called,
-the last (latest) `EXPECT_CALL()` statement will match, and will immediately
-lead to an "upper bound violated" error - this piece of code is not very useful!
-
-One correct way of saying that `turtle.GetX()` will return 10, 20, 30, ..., is
-to explicitly say that the expectations are *not* sticky. In other words, they
-should *retire* as soon as they are saturated:
-
-```cpp
-using ::testing::Return;
-...
-for (int i = n; i > 0; i--) {
- EXPECT_CALL(turtle, GetX())
- .WillOnce(Return(10*i))
- .RetiresOnSaturation();
-}
-```
-
-And, there's a better way to do it: in this case, we expect the calls to occur
-in a specific order, and we line up the actions to match the order. Since the
-order is important here, we should make it explicit using a sequence:
-
-```cpp
-using ::testing::InSequence;
-using ::testing::Return;
-...
-{
- InSequence s;
-
- for (int i = 1; i <= n; i++) {
- EXPECT_CALL(turtle, GetX())
- .WillOnce(Return(10*i))
- .RetiresOnSaturation();
- }
-}
-```
-
-By the way, the other situation where an expectation may *not* be sticky is when
-it's in a sequence - as soon as another expectation that comes after it in the
-sequence has been used, it automatically retires (and will never be used to
-match any call).
-
-### Uninteresting Calls
-
-A mock object may have many methods, and not all of them are that interesting.
-For example, in some tests we may not care about how many times `GetX()` and
-`GetY()` get called.
-
-In gMock, if you are not interested in a method, just don't say anything about
-it. If a call to this method occurs, you'll see a warning in the test output,
-but it won't be a failure. This is called "naggy" behavior; to change, see
-[The Nice, the Strict, and the Naggy](gmock_cook_book.md#NiceStrictNaggy).
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/index.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/index.md
deleted file mode 100644
index b162c74011..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/index.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# GoogleTest User's Guide
-
-## Welcome to GoogleTest!
-
-GoogleTest is Google's C++ testing and mocking framework. This user's guide has
-the following contents:
-
-* [GoogleTest Primer](primer.md) - Teaches you how to write simple tests using
- GoogleTest. Read this first if you are new to GoogleTest.
-* [GoogleTest Advanced](advanced.md) - Read this when you've finished the
- Primer and want to utilize GoogleTest to its full potential.
-* [GoogleTest Samples](samples.md) - Describes some GoogleTest samples.
-* [GoogleTest FAQ](faq.md) - Have a question? Want some tips? Check here
- first.
-* [Mocking for Dummies](gmock_for_dummies.md) - Teaches you how to create mock
- objects and use them in tests.
-* [Mocking Cookbook](gmock_cook_book.md) - Includes tips and approaches to
- common mocking use cases.
-* [Mocking Cheat Sheet](gmock_cheat_sheet.md) - A handy reference for
- matchers, actions, invariants, and more.
-* [Mocking FAQ](gmock_faq.md) - Contains answers to some mocking-specific
- questions.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/pkgconfig.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/pkgconfig.md
deleted file mode 100644
index 18a2546a38..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/pkgconfig.md
+++ /dev/null
@@ -1,148 +0,0 @@
-## Using GoogleTest from various build systems
-
-GoogleTest comes with pkg-config files that can be used to determine all
-necessary flags for compiling and linking to GoogleTest (and GoogleMock).
-Pkg-config is a standardised plain-text format containing
-
-* the includedir (-I) path
-* necessary macro (-D) definitions
-* further required flags (-pthread)
-* the library (-L) path
-* the library (-l) to link to
-
-All current build systems support pkg-config in one way or another. For all
-examples here we assume you want to compile the sample
-`samples/sample3_unittest.cc`.
-
-### CMake
-
-Using `pkg-config` in CMake is fairly easy:
-
-```cmake
-cmake_minimum_required(VERSION 3.0)
-
-cmake_policy(SET CMP0048 NEW)
-project(my_gtest_pkgconfig VERSION 0.0.1 LANGUAGES CXX)
-
-find_package(PkgConfig)
-pkg_search_module(GTEST REQUIRED gtest_main)
-
-add_executable(testapp samples/sample3_unittest.cc)
-target_link_libraries(testapp ${GTEST_LDFLAGS})
-target_compile_options(testapp PUBLIC ${GTEST_CFLAGS})
-
-include(CTest)
-add_test(first_and_only_test testapp)
-```
-
-It is generally recommended that you use `target_compile_options` + `_CFLAGS`
-over `target_include_directories` + `_INCLUDE_DIRS` as the former includes not
-just -I flags (GoogleTest might require a macro indicating to internal headers
-that all libraries have been compiled with threading enabled. In addition,
-GoogleTest might also require `-pthread` in the compiling step, and as such
-splitting the pkg-config `Cflags` variable into include dirs and macros for
-`target_compile_definitions()` might still miss this). The same recommendation
-goes for using `_LDFLAGS` over the more commonplace `_LIBRARIES`, which happens
-to discard `-L` flags and `-pthread`.
-
-### Help! pkg-config can't find GoogleTest!
-
-Let's say you have a `CMakeLists.txt` along the lines of the one in this
-tutorial and you try to run `cmake`. It is very possible that you get a failure
-along the lines of:
-
-```
--- Checking for one of the modules 'gtest_main'
-CMake Error at /usr/share/cmake/Modules/FindPkgConfig.cmake:640 (message):
- None of the required 'gtest_main' found
-```
-
-These failures are common if you installed GoogleTest yourself and have not
-sourced it from a distro or other package manager. If so, you need to tell
-pkg-config where it can find the `.pc` files containing the information. Say you
-installed GoogleTest to `/usr/local`, then it might be that the `.pc` files are
-installed under `/usr/local/lib64/pkgconfig`. If you set
-
-```
-export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig
-```
-
-pkg-config will also try to look in `PKG_CONFIG_PATH` to find `gtest_main.pc`.
-
-### Using pkg-config in a cross-compilation setting
-
-Pkg-config can be used in a cross-compilation setting too. To do this, let's
-assume the final prefix of the cross-compiled installation will be `/usr`, and
-your sysroot is `/home/MYUSER/sysroot`. Configure and install GTest using
-
-```
-mkdir build && cmake -DCMAKE_INSTALL_PREFIX=/usr ..
-```
-
-Install into the sysroot using `DESTDIR`:
-
-```
-make -j install DESTDIR=/home/MYUSER/sysroot
-```
-
-Before we continue, it is recommended to **always** define the following two
-variables for pkg-config in a cross-compilation setting:
-
-```
-export PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=yes
-export PKG_CONFIG_ALLOW_SYSTEM_LIBS=yes
-```
-
-otherwise `pkg-config` will filter `-I` and `-L` flags against standard prefixes
-such as `/usr` (see https://bugs.freedesktop.org/show_bug.cgi?id=28264#c3 for
-reasons why this stripping needs to occur usually).
-
-If you look at the generated pkg-config file, it will look something like
-
-```
-libdir=/usr/lib64
-includedir=/usr/include
-
-Name: gtest
-Description: GoogleTest (without main() function)
-Version: 1.11.0
-URL: https://github.com/google/googletest
-Libs: -L${libdir} -lgtest -lpthread
-Cflags: -I${includedir} -DGTEST_HAS_PTHREAD=1 -lpthread
-```
-
-Notice that the sysroot is not included in `libdir` and `includedir`! If you try
-to run `pkg-config` with the correct
-`PKG_CONFIG_LIBDIR=/home/MYUSER/sysroot/usr/lib64/pkgconfig` against this `.pc`
-file, you will get
-
-```
-$ pkg-config --cflags gtest
--DGTEST_HAS_PTHREAD=1 -lpthread -I/usr/include
-$ pkg-config --libs gtest
--L/usr/lib64 -lgtest -lpthread
-```
-
-which is obviously wrong and points to the `CBUILD` and not `CHOST` root. In
-order to use this in a cross-compilation setting, we need to tell pkg-config to
-inject the actual sysroot into `-I` and `-L` variables. Let us now tell
-pkg-config about the actual sysroot
-
-```
-export PKG_CONFIG_DIR=
-export PKG_CONFIG_SYSROOT_DIR=/home/MYUSER/sysroot
-export PKG_CONFIG_LIBDIR=${PKG_CONFIG_SYSROOT_DIR}/usr/lib64/pkgconfig
-```
-
-and running `pkg-config` again we get
-
-```
-$ pkg-config --cflags gtest
--DGTEST_HAS_PTHREAD=1 -lpthread -I/home/MYUSER/sysroot/usr/include
-$ pkg-config --libs gtest
--L/home/MYUSER/sysroot/usr/lib64 -lgtest -lpthread
-```
-
-which contains the correct sysroot now. For a more comprehensive guide to also
-including `${CHOST}` in build system calls, see the excellent tutorial by Diego
-Elio Pettenò: <https://autotools.io/pkgconfig/cross-compiling.html>
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/platforms.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/platforms.md
deleted file mode 100644
index eba6ef8056..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/platforms.md
+++ /dev/null
@@ -1,35 +0,0 @@
-# Supported Platforms
-
-GoogleTest requires a codebase and compiler compliant with the C++11 standard or
-newer.
-
-The GoogleTest code is officially supported on the following platforms.
-Operating systems or tools not listed below are community-supported. For
-community-supported platforms, patches that do not complicate the code may be
-considered.
-
-If you notice any problems on your platform, please file an issue on the
-[GoogleTest GitHub Issue Tracker](https://github.com/google/googletest/issues).
-Pull requests containing fixes are welcome!
-
-### Operating systems
-
-* Linux
-* macOS
-* Windows
-
-### Compilers
-
-* gcc 5.0+
-* clang 5.0+
-* MSVC 2015+
-
-**macOS users:** Xcode 9.3+ provides clang 5.0+.
-
-### Build systems
-
-* [Bazel](https://bazel.build/)
-* [CMake](https://cmake.org/)
-
-Bazel is the build system used by the team internally and in tests. CMake is
-supported on a best-effort basis and by the community.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/primer.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/primer.md
deleted file mode 100644
index f6318a5dbe..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/primer.md
+++ /dev/null
@@ -1,482 +0,0 @@
-# Googletest Primer
-
-## Introduction: Why googletest?
-
-*googletest* helps you write better C++ tests.
-
-googletest is a testing framework developed by the Testing Technology team with
-Google's specific requirements and constraints in mind. Whether you work on
-Linux, Windows, or a Mac, if you write C++ code, googletest can help you. And it
-supports *any* kind of tests, not just unit tests.
-
-So what makes a good test, and how does googletest fit in? We believe:
-
-1. Tests should be *independent* and *repeatable*. It's a pain to debug a test
- that succeeds or fails as a result of other tests. googletest isolates the
- tests by running each of them on a different object. When a test fails,
- googletest allows you to run it in isolation for quick debugging.
-2. Tests should be well *organized* and reflect the structure of the tested
- code. googletest groups related tests into test suites that can share data
- and subroutines. This common pattern is easy to recognize and makes tests
- easy to maintain. Such consistency is especially helpful when people switch
- projects and start to work on a new code base.
-3. Tests should be *portable* and *reusable*. Google has a lot of code that is
- platform-neutral; its tests should also be platform-neutral. googletest
- works on different OSes, with different compilers, with or without
- exceptions, so googletest tests can work with a variety of configurations.
-4. When tests fail, they should provide as much *information* about the problem
- as possible. googletest doesn't stop at the first test failure. Instead, it
- only stops the current test and continues with the next. You can also set up
- tests that report non-fatal failures after which the current test continues.
- Thus, you can detect and fix multiple bugs in a single run-edit-compile
- cycle.
-5. The testing framework should liberate test writers from housekeeping chores
- and let them focus on the test *content*. googletest automatically keeps
- track of all tests defined, and doesn't require the user to enumerate them
- in order to run them.
-6. Tests should be *fast*. With googletest, you can reuse shared resources
- across tests and pay for the set-up/tear-down only once, without making
- tests depend on each other.
-
-Since googletest is based on the popular xUnit architecture, you'll feel right
-at home if you've used JUnit or PyUnit before. If not, it will take you about 10
-minutes to learn the basics and get started. So let's go!
-
-## Beware of the nomenclature
-
-{: .callout .note}
-_Note:_ There might be some confusion arising from different definitions of the
-terms _Test_, _Test Case_ and _Test Suite_, so beware of misunderstanding these.
-
-Historically, googletest started to use the term _Test Case_ for grouping
-related tests, whereas current publications, including International Software
-Testing Qualifications Board ([ISTQB](http://www.istqb.org/)) materials and
-various textbooks on software quality, use the term
-_[Test Suite][istqb test suite]_ for this.
-
-The related term _Test_, as it is used in googletest, corresponds to the term
-_[Test Case][istqb test case]_ of ISTQB and others.
-
-The term _Test_ is commonly of broad enough sense, including ISTQB's definition
-of _Test Case_, so it's not much of a problem here. But the term _Test Case_ as
-was used in Google Test is of contradictory sense and thus confusing.
-
-googletest recently started replacing the term _Test Case_ with _Test Suite_.
-The preferred API is *TestSuite*. The older TestCase API is being slowly
-deprecated and refactored away.
-
-So please be aware of the different definitions of the terms:
-
-
-Meaning | googletest Term | [ISTQB](http://www.istqb.org/) Term
-:----------------------------------------------------------------------------------- | :---------------------- | :----------------------------------
-Exercise a particular program path with specific input values and verify the results | [TEST()](#simple-tests) | [Test Case][istqb test case]
-
-
-[istqb test case]: http://glossary.istqb.org/en/search/test%20case
-[istqb test suite]: http://glossary.istqb.org/en/search/test%20suite
-
-## Basic Concepts
-
-When using googletest, you start by writing *assertions*, which are statements
-that check whether a condition is true. An assertion's result can be *success*,
-*nonfatal failure*, or *fatal failure*. If a fatal failure occurs, it aborts the
-current function; otherwise the program continues normally.
-
-*Tests* use assertions to verify the tested code's behavior. If a test crashes
-or has a failed assertion, then it *fails*; otherwise it *succeeds*.
-
-A *test suite* contains one or many tests. You should group your tests into test
-suites that reflect the structure of the tested code. When multiple tests in a
-test suite need to share common objects and subroutines, you can put them into a
-*test fixture* class.
-
-A *test program* can contain multiple test suites.
-
-We'll now explain how to write a test program, starting at the individual
-assertion level and building up to tests and test suites.
-
-## Assertions
-
-googletest assertions are macros that resemble function calls. You test a class
-or function by making assertions about its behavior. When an assertion fails,
-googletest prints the assertion's source file and line number location, along
-with a failure message. You may also supply a custom failure message which will
-be appended to googletest's message.
-
-The assertions come in pairs that test the same thing but have different effects
-on the current function. `ASSERT_*` versions generate fatal failures when they
-fail, and **abort the current function**. `EXPECT_*` versions generate nonfatal
-failures, which don't abort the current function. Usually `EXPECT_*` are
-preferred, as they allow more than one failure to be reported in a test.
-However, you should use `ASSERT_*` if it doesn't make sense to continue when the
-assertion in question fails.
-
-Since a failed `ASSERT_*` returns from the current function immediately,
-possibly skipping clean-up code that comes after it, it may cause a space leak.
-Depending on the nature of the leak, it may or may not be worth fixing - so keep
-this in mind if you get a heap checker error in addition to assertion errors.
-
-To provide a custom failure message, simply stream it into the macro using the
-`<<` operator or a sequence of such operators. See the following example, using
-the [`ASSERT_EQ` and `EXPECT_EQ`](reference/assertions.md#EXPECT_EQ) macros to
-verify value equality:
-
-```c++
-ASSERT_EQ(x.size(), y.size()) << "Vectors x and y are of unequal length";
-
-for (int i = 0; i < x.size(); ++i) {
- EXPECT_EQ(x[i], y[i]) << "Vectors x and y differ at index " << i;
-}
-```
-
-Anything that can be streamed to an `ostream` can be streamed to an assertion
-macro--in particular, C strings and `string` objects. If a wide string
-(`wchar_t*`, `TCHAR*` in `UNICODE` mode on Windows, or `std::wstring`) is
-streamed to an assertion, it will be translated to UTF-8 when printed.
-
-GoogleTest provides a collection of assertions for verifying the behavior of
-your code in various ways. You can check Boolean conditions, compare values
-based on relational operators, verify string values, floating-point values, and
-much more. There are even assertions that enable you to verify more complex
-states by providing custom predicates. For the complete list of assertions
-provided by GoogleTest, see the [Assertions Reference](reference/assertions.md).
-
-## Simple Tests
-
-To create a test:
-
-1. Use the `TEST()` macro to define and name a test function. These are
- ordinary C++ functions that don't return a value.
-2. In this function, along with any valid C++ statements you want to include,
- use the various googletest assertions to check values.
-3. The test's result is determined by the assertions; if any assertion in the
- test fails (either fatally or non-fatally), or if the test crashes, the
- entire test fails. Otherwise, it succeeds.
-
-```c++
-TEST(TestSuiteName, TestName) {
- ... test body ...
-}
-```
-
-`TEST()` arguments go from general to specific. The *first* argument is the name
-of the test suite, and the *second* argument is the test's name within the test
-suite. Both names must be valid C++ identifiers, and they should not contain any
-underscores (`_`). A test's *full name* consists of its containing test suite
-and its individual name. Tests from different test suites can have the same
-individual name.
-
-For example, let's take a simple integer function:
-
-```c++
-int Factorial(int n); // Returns the factorial of n
-```
-
-A test suite for this function might look like:
-
-```c++
-// Tests factorial of 0.
-TEST(FactorialTest, HandlesZeroInput) {
- EXPECT_EQ(Factorial(0), 1);
-}
-
-// Tests factorial of positive numbers.
-TEST(FactorialTest, HandlesPositiveInput) {
- EXPECT_EQ(Factorial(1), 1);
- EXPECT_EQ(Factorial(2), 2);
- EXPECT_EQ(Factorial(3), 6);
- EXPECT_EQ(Factorial(8), 40320);
-}
-```
-
-googletest groups the test results by test suites, so logically related tests
-should be in the same test suite; in other words, the first argument to their
-`TEST()` should be the same. In the above example, we have two tests,
-`HandlesZeroInput` and `HandlesPositiveInput`, that belong to the same test
-suite `FactorialTest`.
-
-When naming your test suites and tests, you should follow the same convention as
-for
-[naming functions and classes](https://google.github.io/styleguide/cppguide.html#Function_Names).
-
-**Availability**: Linux, Windows, Mac.
-
-## Test Fixtures: Using the Same Data Configuration for Multiple Tests {#same-data-multiple-tests}
-
-If you find yourself writing two or more tests that operate on similar data, you
-can use a *test fixture*. This allows you to reuse the same configuration of
-objects for several different tests.
-
-To create a fixture:
-
-1. Derive a class from `::testing::Test` . Start its body with `protected:`, as
- we'll want to access fixture members from sub-classes.
-2. Inside the class, declare any objects you plan to use.
-3. If necessary, write a default constructor or `SetUp()` function to prepare
- the objects for each test. A common mistake is to spell `SetUp()` as
- **`Setup()`** with a small `u` - Use `override` in C++11 to make sure you
- spelled it correctly.
-4. If necessary, write a destructor or `TearDown()` function to release any
- resources you allocated in `SetUp()` . To learn when you should use the
- constructor/destructor and when you should use `SetUp()/TearDown()`, read
- the [FAQ](faq.md#CtorVsSetUp).
-5. If needed, define subroutines for your tests to share.
-
-When using a fixture, use `TEST_F()` instead of `TEST()` as it allows you to
-access objects and subroutines in the test fixture:
-
-```c++
-TEST_F(TestFixtureName, TestName) {
- ... test body ...
-}
-```
-
-Like `TEST()`, the first argument is the test suite name, but for `TEST_F()`
-this must be the name of the test fixture class. You've probably guessed: `_F`
-is for fixture.
-
-Unfortunately, the C++ macro system does not allow us to create a single macro
-that can handle both types of tests. Using the wrong macro causes a compiler
-error.
-
-Also, you must first define a test fixture class before using it in a
-`TEST_F()`, or you'll get the compiler error "`virtual outside class
-declaration`".
-
-For each test defined with `TEST_F()`, googletest will create a *fresh* test
-fixture at runtime, immediately initialize it via `SetUp()`, run the test, clean
-up by calling `TearDown()`, and then delete the test fixture. Note that
-different tests in the same test suite have different test fixture objects, and
-googletest always deletes a test fixture before it creates the next one.
-googletest does **not** reuse the same test fixture for multiple tests. Any
-changes one test makes to the fixture do not affect other tests.
-
-As an example, let's write tests for a FIFO queue class named `Queue`, which has
-the following interface:
-
-```c++
-template <typename E> // E is the element type.
-class Queue {
- public:
- Queue();
- void Enqueue(const E& element);
- E* Dequeue(); // Returns NULL if the queue is empty.
- size_t size() const;
- ...
-};
-```
-
-First, define a fixture class. By convention, you should give it the name
-`FooTest` where `Foo` is the class being tested.
-
-```c++
-class QueueTest : public ::testing::Test {
- protected:
- void SetUp() override {
- q0_.Enqueue(1);
- q1_.Enqueue(2);
- q2_.Enqueue(3);
- }
-
- // void TearDown() override {}
-
- Queue<int> q0_;
- Queue<int> q1_;
- Queue<int> q2_;
-};
-```
-
-In this case, `TearDown()` is not needed since we don't have to clean up after
-each test, other than what's already done by the destructor.
-
-Now we'll write tests using `TEST_F()` and this fixture.
-
-```c++
-TEST_F(QueueTest, IsEmptyInitially) {
- EXPECT_EQ(q0_.size(), 0);
-}
-
-TEST_F(QueueTest, DequeueWorks) {
- int* n = q0_.Dequeue();
- EXPECT_EQ(n, nullptr);
-
- n = q1_.Dequeue();
- ASSERT_NE(n, nullptr);
- EXPECT_EQ(*n, 1);
- EXPECT_EQ(q1_.size(), 0);
- delete n;
-
- n = q2_.Dequeue();
- ASSERT_NE(n, nullptr);
- EXPECT_EQ(*n, 2);
- EXPECT_EQ(q2_.size(), 1);
- delete n;
-}
-```
-
-The above uses both `ASSERT_*` and `EXPECT_*` assertions. The rule of thumb is
-to use `EXPECT_*` when you want the test to continue to reveal more errors after
-the assertion failure, and use `ASSERT_*` when continuing after failure doesn't
-make sense. For example, the second assertion in the `Dequeue` test is
-`ASSERT_NE(n, nullptr)`, as we need to dereference the pointer `n` later, which
-would lead to a segfault when `n` is `NULL`.
-
-When these tests run, the following happens:
-
-1. googletest constructs a `QueueTest` object (let's call it `t1`).
-2. `t1.SetUp()` initializes `t1`.
-3. The first test (`IsEmptyInitially`) runs on `t1`.
-4. `t1.TearDown()` cleans up after the test finishes.
-5. `t1` is destructed.
-6. The above steps are repeated on another `QueueTest` object, this time
- running the `DequeueWorks` test.
-
-**Availability**: Linux, Windows, Mac.
-
-## Invoking the Tests
-
-`TEST()` and `TEST_F()` implicitly register their tests with googletest. So,
-unlike with many other C++ testing frameworks, you don't have to re-list all
-your defined tests in order to run them.
-
-After defining your tests, you can run them with `RUN_ALL_TESTS()`, which
-returns `0` if all the tests are successful, or `1` otherwise. Note that
-`RUN_ALL_TESTS()` runs *all tests* in your link unit--they can be from different
-test suites, or even different source files.
-
-When invoked, the `RUN_ALL_TESTS()` macro:
-
-* Saves the state of all googletest flags.
-
-* Creates a test fixture object for the first test.
-
-* Initializes it via `SetUp()`.
-
-* Runs the test on the fixture object.
-
-* Cleans up the fixture via `TearDown()`.
-
-* Deletes the fixture.
-
-* Restores the state of all googletest flags.
-
-* Repeats the above steps for the next test, until all tests have run.
-
-If a fatal failure happens the subsequent steps will be skipped.
-
-{: .callout .important}
-> IMPORTANT: You must **not** ignore the return value of `RUN_ALL_TESTS()`, or
-> you will get a compiler error. The rationale for this design is that the
-> automated testing service determines whether a test has passed based on its
-> exit code, not on its stdout/stderr output; thus your `main()` function must
-> return the value of `RUN_ALL_TESTS()`.
->
-> Also, you should call `RUN_ALL_TESTS()` only **once**. Calling it more than
-> once conflicts with some advanced googletest features (e.g., thread-safe
-> [death tests](advanced.md#death-tests)) and thus is not supported.
-
-**Availability**: Linux, Windows, Mac.
-
-## Writing the main() Function
-
-Most users should _not_ need to write their own `main` function and instead link
-with `gtest_main` (as opposed to with `gtest`), which defines a suitable entry
-point. See the end of this section for details. The remainder of this section
-should only apply when you need to do something custom before the tests run that
-cannot be expressed within the framework of fixtures and test suites.
-
-If you write your own `main` function, it should return the value of
-`RUN_ALL_TESTS()`.
-
-You can start from this boilerplate:
-
-```c++
-#include "this/package/foo.h"
-
-#include "gtest/gtest.h"
-
-namespace my {
-namespace project {
-namespace {
-
-// The fixture for testing class Foo.
-class FooTest : public ::testing::Test {
- protected:
- // You can remove any or all of the following functions if their bodies would
- // be empty.
-
- FooTest() {
- // You can do set-up work for each test here.
- }
-
- ~FooTest() override {
- // You can do clean-up work that doesn't throw exceptions here.
- }
-
- // If the constructor and destructor are not enough for setting up
- // and cleaning up each test, you can define the following methods:
-
- void SetUp() override {
- // Code here will be called immediately after the constructor (right
- // before each test).
- }
-
- void TearDown() override {
- // Code here will be called immediately after each test (right
- // before the destructor).
- }
-
- // Class members declared here can be used by all tests in the test suite
- // for Foo.
-};
-
-// Tests that the Foo::Bar() method does Abc.
-TEST_F(FooTest, MethodBarDoesAbc) {
- const std::string input_filepath = "this/package/testdata/myinputfile.dat";
- const std::string output_filepath = "this/package/testdata/myoutputfile.dat";
- Foo f;
- EXPECT_EQ(f.Bar(input_filepath, output_filepath), 0);
-}
-
-// Tests that Foo does Xyz.
-TEST_F(FooTest, DoesXyz) {
- // Exercises the Xyz feature of Foo.
-}
-
-} // namespace
-} // namespace project
-} // namespace my
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-```
-
-The `::testing::InitGoogleTest()` function parses the command line for
-googletest flags, and removes all recognized flags. This allows the user to
-control a test program's behavior via various flags, which we'll cover in the
-[AdvancedGuide](advanced.md). You **must** call this function before calling
-`RUN_ALL_TESTS()`, or the flags won't be properly initialized.
-
-On Windows, `InitGoogleTest()` also works with wide strings, so it can be used
-in programs compiled in `UNICODE` mode as well.
-
-But maybe you think that writing all those `main` functions is too much work? We
-agree with you completely, and that's why Google Test provides a basic
-implementation of main(). If it fits your needs, then just link your test with
-the `gtest_main` library and you are good to go.
-
-{: .callout .note}
-NOTE: `ParseGUnitFlags()` is deprecated in favor of `InitGoogleTest()`.
-
-## Known Limitations
-
-* Google Test is designed to be thread-safe. The implementation is thread-safe
- on systems where the `pthreads` library is available. It is currently
- _unsafe_ to use Google Test assertions from two threads concurrently on
- other systems (e.g. Windows). In most tests this is not an issue as usually
- the assertions are done in the main thread. If you want to help, you can
- volunteer to implement the necessary synchronization primitives in
- `gtest-port.h` for your platform.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-bazel.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-bazel.md
deleted file mode 100644
index 5d6e9c68ad..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-bazel.md
+++ /dev/null
@@ -1,147 +0,0 @@
-# Quickstart: Building with Bazel
-
-This tutorial aims to get you up and running with GoogleTest using the Bazel
-build system. If you're using GoogleTest for the first time or need a refresher,
-we recommend this tutorial as a starting point.
-
-## Prerequisites
-
-To complete this tutorial, you'll need:
-
-* A compatible operating system (e.g. Linux, macOS, Windows).
-* A compatible C++ compiler that supports at least C++11.
-* [Bazel](https://bazel.build/), the preferred build system used by the
- GoogleTest team.
-
-See [Supported Platforms](platforms.md) for more information about platforms
-compatible with GoogleTest.
-
-If you don't already have Bazel installed, see the
-[Bazel installation guide](https://docs.bazel.build/versions/main/install.html).
-
-{: .callout .note}
-Note: The terminal commands in this tutorial show a Unix shell prompt, but the
-commands work on the Windows command line as well.
-
-## Set up a Bazel workspace
-
-A
-[Bazel workspace](https://docs.bazel.build/versions/main/build-ref.html#workspace)
-is a directory on your filesystem that you use to manage source files for the
-software you want to build. Each workspace directory has a text file named
-`WORKSPACE` which may be empty, or may contain references to external
-dependencies required to build the outputs.
-
-First, create a directory for your workspace:
-
-```
-$ mkdir my_workspace && cd my_workspace
-```
-
-Next, you’ll create the `WORKSPACE` file to specify dependencies. A common and
-recommended way to depend on GoogleTest is to use a
-[Bazel external dependency](https://docs.bazel.build/versions/main/external.html)
-via the
-[`http_archive` rule](https://docs.bazel.build/versions/main/repo/http.html#http_archive).
-To do this, in the root directory of your workspace (`my_workspace/`), create a
-file named `WORKSPACE` with the following contents:
-
-```
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-http_archive(
- name = "com_google_googletest",
- urls = ["https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip"],
- strip_prefix = "googletest-609281088cfefc76f9d0ce82e1ff6c30cc3591e5",
-)
-```
-
-The above configuration declares a dependency on GoogleTest which is downloaded
-as a ZIP archive from GitHub. In the above example,
-`609281088cfefc76f9d0ce82e1ff6c30cc3591e5` is the Git commit hash of the
-GoogleTest version to use; we recommend updating the hash often to point to the
-latest version.
-
-Now you're ready to build C++ code that uses GoogleTest.
-
-## Create and run a binary
-
-With your Bazel workspace set up, you can now use GoogleTest code within your
-own project.
-
-As an example, create a file named `hello_test.cc` in your `my_workspace`
-directory with the following contents:
-
-```cpp
-#include <gtest/gtest.h>
-
-// Demonstrate some basic assertions.
-TEST(HelloTest, BasicAssertions) {
- // Expect two strings not to be equal.
- EXPECT_STRNE("hello", "world");
- // Expect equality.
- EXPECT_EQ(7 * 6, 42);
-}
-```
-
-GoogleTest provides [assertions](primer.md#assertions) that you use to test the
-behavior of your code. The above sample includes the main GoogleTest header file
-and demonstrates some basic assertions.
-
-To build the code, create a file named `BUILD` in the same directory with the
-following contents:
-
-```
-cc_test(
- name = "hello_test",
- size = "small",
- srcs = ["hello_test.cc"],
- deps = ["@com_google_googletest//:gtest_main"],
-)
-```
-
-This `cc_test` rule declares the C++ test binary you want to build, and links to
-GoogleTest (`//:gtest_main`) using the prefix you specified in the `WORKSPACE`
-file (`@com_google_googletest`). For more information about Bazel `BUILD` files,
-see the
-[Bazel C++ Tutorial](https://docs.bazel.build/versions/main/tutorial/cpp.html).
-
-Now you can build and run your test:
-
-<pre>
-<strong>my_workspace$ bazel test --test_output=all //:hello_test</strong>
-INFO: Analyzed target //:hello_test (26 packages loaded, 362 targets configured).
-INFO: Found 1 test target...
-INFO: From Testing //:hello_test:
-==================== Test output for //:hello_test:
-Running main() from gmock_main.cc
-[==========] Running 1 test from 1 test suite.
-[----------] Global test environment set-up.
-[----------] 1 test from HelloTest
-[ RUN ] HelloTest.BasicAssertions
-[ OK ] HelloTest.BasicAssertions (0 ms)
-[----------] 1 test from HelloTest (0 ms total)
-
-[----------] Global test environment tear-down
-[==========] 1 test from 1 test suite ran. (0 ms total)
-[ PASSED ] 1 test.
-================================================================================
-Target //:hello_test up-to-date:
- bazel-bin/hello_test
-INFO: Elapsed time: 4.190s, Critical Path: 3.05s
-INFO: 27 processes: 8 internal, 19 linux-sandbox.
-INFO: Build completed successfully, 27 total actions
-//:hello_test PASSED in 0.1s
-
-INFO: Build completed successfully, 27 total actions
-</pre>
-
-Congratulations! You've successfully built and run a test binary using
-GoogleTest.
-
-## Next steps
-
-* [Check out the Primer](primer.md) to start learning how to write simple
- tests.
-* [See the code samples](samples.md) for more examples showing how to use a
- variety of GoogleTest features.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-cmake.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-cmake.md
deleted file mode 100644
index 420f1d3a3c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/quickstart-cmake.md
+++ /dev/null
@@ -1,156 +0,0 @@
-# Quickstart: Building with CMake
-
-This tutorial aims to get you up and running with GoogleTest using CMake. If
-you're using GoogleTest for the first time or need a refresher, we recommend
-this tutorial as a starting point. If your project uses Bazel, see the
-[Quickstart for Bazel](quickstart-bazel.md) instead.
-
-## Prerequisites
-
-To complete this tutorial, you'll need:
-
-* A compatible operating system (e.g. Linux, macOS, Windows).
-* A compatible C++ compiler that supports at least C++11.
-* [CMake](https://cmake.org/) and a compatible build tool for building the
- project.
- * Compatible build tools include
- [Make](https://www.gnu.org/software/make/),
- [Ninja](https://ninja-build.org/), and others - see
- [CMake Generators](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
- for more information.
-
-See [Supported Platforms](platforms.md) for more information about platforms
-compatible with GoogleTest.
-
-If you don't already have CMake installed, see the
-[CMake installation guide](https://cmake.org/install).
-
-{: .callout .note}
-Note: The terminal commands in this tutorial show a Unix shell prompt, but the
-commands work on the Windows command line as well.
-
-## Set up a project
-
-CMake uses a file named `CMakeLists.txt` to configure the build system for a
-project. You'll use this file to set up your project and declare a dependency on
-GoogleTest.
-
-First, create a directory for your project:
-
-```
-$ mkdir my_project && cd my_project
-```
-
-Next, you'll create the `CMakeLists.txt` file and declare a dependency on
-GoogleTest. There are many ways to express dependencies in the CMake ecosystem;
-in this quickstart, you'll use the
-[`FetchContent` CMake module](https://cmake.org/cmake/help/latest/module/FetchContent.html).
-To do this, in your project directory (`my_project`), create a file named
-`CMakeLists.txt` with the following contents:
-
-```cmake
-cmake_minimum_required(VERSION 3.14)
-project(my_project)
-
-# GoogleTest requires at least C++11
-set(CMAKE_CXX_STANDARD 11)
-
-include(FetchContent)
-FetchContent_Declare(
- googletest
- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
-)
-# For Windows: Prevent overriding the parent project's compiler/linker settings
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-FetchContent_MakeAvailable(googletest)
-```
-
-The above configuration declares a dependency on GoogleTest which is downloaded
-from GitHub. In the above example, `609281088cfefc76f9d0ce82e1ff6c30cc3591e5` is
-the Git commit hash of the GoogleTest version to use; we recommend updating the
-hash often to point to the latest version.
-
-For more information about how to create `CMakeLists.txt` files, see the
-[CMake Tutorial](https://cmake.org/cmake/help/latest/guide/tutorial/index.html).
-
-## Create and run a binary
-
-With GoogleTest declared as a dependency, you can use GoogleTest code within
-your own project.
-
-As an example, create a file named `hello_test.cc` in your `my_project`
-directory with the following contents:
-
-```cpp
-#include <gtest/gtest.h>
-
-// Demonstrate some basic assertions.
-TEST(HelloTest, BasicAssertions) {
- // Expect two strings not to be equal.
- EXPECT_STRNE("hello", "world");
- // Expect equality.
- EXPECT_EQ(7 * 6, 42);
-}
-```
-
-GoogleTest provides [assertions](primer.md#assertions) that you use to test the
-behavior of your code. The above sample includes the main GoogleTest header file
-and demonstrates some basic assertions.
-
-To build the code, add the following to the end of your `CMakeLists.txt` file:
-
-```cmake
-enable_testing()
-
-add_executable(
- hello_test
- hello_test.cc
-)
-target_link_libraries(
- hello_test
- gtest_main
-)
-
-include(GoogleTest)
-gtest_discover_tests(hello_test)
-```
-
-The above configuration enables testing in CMake, declares the C++ test binary
-you want to build (`hello_test`), and links it to GoogleTest (`gtest_main`). The
-last two lines enable CMake's test runner to discover the tests included in the
-binary, using the
-[`GoogleTest` CMake module](https://cmake.org/cmake/help/git-stage/module/GoogleTest.html).
-
-Now you can build and run your test:
-
-<pre>
-<strong>my_project$ cmake -S . -B build</strong>
--- The C compiler identification is GNU 10.2.1
--- The CXX compiler identification is GNU 10.2.1
-...
--- Build files have been written to: .../my_project/build
-
-<strong>my_project$ cmake --build build</strong>
-Scanning dependencies of target gtest
-...
-[100%] Built target gmock_main
-
-<strong>my_project$ cd build && ctest</strong>
-Test project .../my_project/build
- Start 1: HelloTest.BasicAssertions
-1/1 Test #1: HelloTest.BasicAssertions ........ Passed 0.00 sec
-
-100% tests passed, 0 tests failed out of 1
-
-Total Test time (real) = 0.01 sec
-</pre>
-
-Congratulations! You've successfully built and run a test binary using
-GoogleTest.
-
-## Next steps
-
-* [Check out the Primer](primer.md) to start learning how to write simple
- tests.
-* [See the code samples](samples.md) for more examples showing how to use a
- variety of GoogleTest features.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/actions.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/actions.md
deleted file mode 100644
index ab81a129ef..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/actions.md
+++ /dev/null
@@ -1,115 +0,0 @@
-# Actions Reference
-
-[**Actions**](../gmock_for_dummies.md#actions-what-should-it-do) specify what a
-mock function should do when invoked. This page lists the built-in actions
-provided by GoogleTest. All actions are defined in the `::testing` namespace.
-
-## Returning a Value
-
-| Action | Description |
-| :-------------------------------- | :-------------------------------------------- |
-| `Return()` | Return from a `void` mock function. |
-| `Return(value)` | Return `value`. If the type of `value` is different to the mock function's return type, `value` is converted to the latter type <i>at the time the expectation is set</i>, not when the action is executed. |
-| `ReturnArg<N>()` | Return the `N`-th (0-based) argument. |
-| `ReturnNew<T>(a1, ..., ak)` | Return `new T(a1, ..., ak)`; a different object is created each time. |
-| `ReturnNull()` | Return a null pointer. |
-| `ReturnPointee(ptr)` | Return the value pointed to by `ptr`. |
-| `ReturnRef(variable)` | Return a reference to `variable`. |
-| `ReturnRefOfCopy(value)` | Return a reference to a copy of `value`; the copy lives as long as the action. |
-| `ReturnRoundRobin({a1, ..., ak})` | Each call will return the next `ai` in the list, starting at the beginning when the end of the list is reached. |
-
-## Side Effects
-
-| Action | Description |
-| :--------------------------------- | :-------------------------------------- |
-| `Assign(&variable, value)` | Assign `value` to variable. |
-| `DeleteArg<N>()` | Delete the `N`-th (0-based) argument, which must be a pointer. |
-| `SaveArg<N>(pointer)` | Save the `N`-th (0-based) argument to `*pointer`. |
-| `SaveArgPointee<N>(pointer)` | Save the value pointed to by the `N`-th (0-based) argument to `*pointer`. |
-| `SetArgReferee<N>(value)` | Assign `value` to the variable referenced by the `N`-th (0-based) argument. |
-| `SetArgPointee<N>(value)` | Assign `value` to the variable pointed by the `N`-th (0-based) argument. |
-| `SetArgumentPointee<N>(value)` | Same as `SetArgPointee<N>(value)`. Deprecated. Will be removed in v1.7.0. |
-| `SetArrayArgument<N>(first, last)` | Copies the elements in source range [`first`, `last`) to the array pointed to by the `N`-th (0-based) argument, which can be either a pointer or an iterator. The action does not take ownership of the elements in the source range. |
-| `SetErrnoAndReturn(error, value)` | Set `errno` to `error` and return `value`. |
-| `Throw(exception)` | Throws the given exception, which can be any copyable value. Available since v1.1.0. |
-
-## Using a Function, Functor, or Lambda as an Action
-
-In the following, by "callable" we mean a free function, `std::function`,
-functor, or lambda.
-
-| Action | Description |
-| :---------------------------------- | :------------------------------------- |
-| `f` | Invoke `f` with the arguments passed to the mock function, where `f` is a callable. |
-| `Invoke(f)` | Invoke `f` with the arguments passed to the mock function, where `f` can be a global/static function or a functor. |
-| `Invoke(object_pointer, &class::method)` | Invoke the method on the object with the arguments passed to the mock function. |
-| `InvokeWithoutArgs(f)` | Invoke `f`, which can be a global/static function or a functor. `f` must take no arguments. |
-| `InvokeWithoutArgs(object_pointer, &class::method)` | Invoke the method on the object, which takes no arguments. |
-| `InvokeArgument<N>(arg1, arg2, ..., argk)` | Invoke the mock function's `N`-th (0-based) argument, which must be a function or a functor, with the `k` arguments. |
-
-The return value of the invoked function is used as the return value of the
-action.
-
-When defining a callable to be used with `Invoke*()`, you can declare any unused
-parameters as `Unused`:
-
-```cpp
-using ::testing::Invoke;
-double Distance(Unused, double x, double y) { return sqrt(x*x + y*y); }
-...
-EXPECT_CALL(mock, Foo("Hi", _, _)).WillOnce(Invoke(Distance));
-```
-
-`Invoke(callback)` and `InvokeWithoutArgs(callback)` take ownership of
-`callback`, which must be permanent. The type of `callback` must be a base
-callback type instead of a derived one, e.g.
-
-```cpp
- BlockingClosure* done = new BlockingClosure;
- ... Invoke(done) ...; // This won't compile!
-
- Closure* done2 = new BlockingClosure;
- ... Invoke(done2) ...; // This works.
-```
-
-In `InvokeArgument<N>(...)`, if an argument needs to be passed by reference,
-wrap it inside `std::ref()`. For example,
-
-```cpp
-using ::testing::InvokeArgument;
-...
-InvokeArgument<2>(5, string("Hi"), std::ref(foo))
-```
-
-calls the mock function's #2 argument, passing to it `5` and `string("Hi")` by
-value, and `foo` by reference.
-
-## Default Action
-
-| Action | Description |
-| :------------ | :----------------------------------------------------- |
-| `DoDefault()` | Do the default action (specified by `ON_CALL()` or the built-in one). |
-
-{: .callout .note}
-**Note:** due to technical reasons, `DoDefault()` cannot be used inside a
-composite action - trying to do so will result in a run-time error.
-
-## Composite Actions
-
-| Action | Description |
-| :----------------------------- | :------------------------------------------ |
-| `DoAll(a1, a2, ..., an)` | Do all actions `a1` to `an` and return the result of `an` in each invocation. The first `n - 1` sub-actions must return void and will receive a readonly view of the arguments. |
-| `IgnoreResult(a)` | Perform action `a` and ignore its result. `a` must not return void. |
-| `WithArg<N>(a)` | Pass the `N`-th (0-based) argument of the mock function to action `a` and perform it. |
-| `WithArgs<N1, N2, ..., Nk>(a)` | Pass the selected (0-based) arguments of the mock function to action `a` and perform it. |
-| `WithoutArgs(a)` | Perform action `a` without any arguments. |
-
-## Defining Actions
-
-| Macro | Description |
-| :--------------------------------- | :-------------------------------------- |
-| `ACTION(Sum) { return arg0 + arg1; }` | Defines an action `Sum()` to return the sum of the mock function's argument #0 and #1. |
-| `ACTION_P(Plus, n) { return arg0 + n; }` | Defines an action `Plus(n)` to return the sum of the mock function's argument #0 and `n`. |
-| `ACTION_Pk(Foo, p1, ..., pk) { statements; }` | Defines a parameterized action `Foo(p1, ..., pk)` to execute the given `statements`. |
-
-The `ACTION*` macros cannot be used inside a function or class.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/assertions.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/assertions.md
deleted file mode 100644
index 7bf03a3dde..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/assertions.md
+++ /dev/null
@@ -1,633 +0,0 @@
-# Assertions Reference
-
-This page lists the assertion macros provided by GoogleTest for verifying code
-behavior. To use them, include the header `gtest/gtest.h`.
-
-The majority of the macros listed below come as a pair with an `EXPECT_` variant
-and an `ASSERT_` variant. Upon failure, `EXPECT_` macros generate nonfatal
-failures and allow the current function to continue running, while `ASSERT_`
-macros generate fatal failures and abort the current function.
-
-All assertion macros support streaming a custom failure message into them with
-the `<<` operator, for example:
-
-```cpp
-EXPECT_TRUE(my_condition) << "My condition is not true";
-```
-
-Anything that can be streamed to an `ostream` can be streamed to an assertion
-macro—in particular, C strings and string objects. If a wide string (`wchar_t*`,
-`TCHAR*` in `UNICODE` mode on Windows, or `std::wstring`) is streamed to an
-assertion, it will be translated to UTF-8 when printed.
-
-## Explicit Success and Failure {#success-failure}
-
-The assertions in this section generate a success or failure directly instead of
-testing a value or expression. These are useful when control flow, rather than a
-Boolean expression, determines the test's success or failure, as shown by the
-following example:
-
-```c++
-switch(expression) {
- case 1:
- ... some checks ...
- case 2:
- ... some other checks ...
- default:
- FAIL() << "We shouldn't get here.";
-}
-```
-
-### SUCCEED {#SUCCEED}
-
-`SUCCEED()`
-
-Generates a success. This *does not* make the overall test succeed. A test is
-considered successful only if none of its assertions fail during its execution.
-
-The `SUCCEED` assertion is purely documentary and currently doesn't generate any
-user-visible output. However, we may add `SUCCEED` messages to GoogleTest output
-in the future.
-
-### FAIL {#FAIL}
-
-`FAIL()`
-
-Generates a fatal failure, which returns from the current function.
-
-Can only be used in functions that return `void`. See
-[Assertion Placement](../advanced.md#assertion-placement) for more information.
-
-### ADD_FAILURE {#ADD_FAILURE}
-
-`ADD_FAILURE()`
-
-Generates a nonfatal failure, which allows the current function to continue
-running.
-
-### ADD_FAILURE_AT {#ADD_FAILURE_AT}
-
-`ADD_FAILURE_AT(`*`file_path`*`,`*`line_number`*`)`
-
-Generates a nonfatal failure at the file and line number specified.
-
-## Generalized Assertion {#generalized}
-
-The following assertion allows [matchers](matchers.md) to be used to verify
-values.
-
-### EXPECT_THAT {#EXPECT_THAT}
-
-`EXPECT_THAT(`*`value`*`,`*`matcher`*`)` \
-`ASSERT_THAT(`*`value`*`,`*`matcher`*`)`
-
-Verifies that *`value`* matches the [matcher](matchers.md) *`matcher`*.
-
-For example, the following code verifies that the string `value1` starts with
-`"Hello"`, `value2` matches a regular expression, and `value3` is between 5 and
-10:
-
-```cpp
-#include "gmock/gmock.h"
-
-using ::testing::AllOf;
-using ::testing::Gt;
-using ::testing::Lt;
-using ::testing::MatchesRegex;
-using ::testing::StartsWith;
-
-...
-EXPECT_THAT(value1, StartsWith("Hello"));
-EXPECT_THAT(value2, MatchesRegex("Line \\d+"));
-ASSERT_THAT(value3, AllOf(Gt(5), Lt(10)));
-```
-
-Matchers enable assertions of this form to read like English and generate
-informative failure messages. For example, if the above assertion on `value1`
-fails, the resulting message will be similar to the following:
-
-```
-Value of: value1
- Actual: "Hi, world!"
-Expected: starts with "Hello"
-```
-
-GoogleTest provides a built-in library of matchers—see the
-[Matchers Reference](matchers.md). It is also possible to write your own
-matchers—see [Writing New Matchers Quickly](../gmock_cook_book.md#NewMatchers).
-The use of matchers makes `EXPECT_THAT` a powerful, extensible assertion.
-
-*The idea for this assertion was borrowed from Joe Walnes' Hamcrest project,
-which adds `assertThat()` to JUnit.*
-
-## Boolean Conditions {#boolean}
-
-The following assertions test Boolean conditions.
-
-### EXPECT_TRUE {#EXPECT_TRUE}
-
-`EXPECT_TRUE(`*`condition`*`)` \
-`ASSERT_TRUE(`*`condition`*`)`
-
-Verifies that *`condition`* is true.
-
-### EXPECT_FALSE {#EXPECT_FALSE}
-
-`EXPECT_FALSE(`*`condition`*`)` \
-`ASSERT_FALSE(`*`condition`*`)`
-
-Verifies that *`condition`* is false.
-
-## Binary Comparison {#binary-comparison}
-
-The following assertions compare two values. The value arguments must be
-comparable by the assertion's comparison operator, otherwise a compiler error
-will result.
-
-If an argument supports the `<<` operator, it will be called to print the
-argument when the assertion fails. Otherwise, GoogleTest will attempt to print
-them in the best way it can—see
-[Teaching GoogleTest How to Print Your Values](../advanced.md#teaching-googletest-how-to-print-your-values).
-
-Arguments are always evaluated exactly once, so it's OK for the arguments to
-have side effects. However, the argument evaluation order is undefined and
-programs should not depend on any particular argument evaluation order.
-
-These assertions work with both narrow and wide string objects (`string` and
-`wstring`).
-
-See also the [Floating-Point Comparison](#floating-point) assertions to compare
-floating-point numbers and avoid problems caused by rounding.
-
-### EXPECT_EQ {#EXPECT_EQ}
-
-`EXPECT_EQ(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_EQ(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`==`*`val2`*.
-
-Does pointer equality on pointers. If used on two C strings, it tests if they
-are in the same memory location, not if they have the same value. Use
-[`EXPECT_STREQ`](#EXPECT_STREQ) to compare C strings (e.g. `const char*`) by
-value.
-
-When comparing a pointer to `NULL`, use `EXPECT_EQ(`*`ptr`*`, nullptr)` instead
-of `EXPECT_EQ(`*`ptr`*`, NULL)`.
-
-### EXPECT_NE {#EXPECT_NE}
-
-`EXPECT_NE(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_NE(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`!=`*`val2`*.
-
-Does pointer equality on pointers. If used on two C strings, it tests if they
-are in different memory locations, not if they have different values. Use
-[`EXPECT_STRNE`](#EXPECT_STRNE) to compare C strings (e.g. `const char*`) by
-value.
-
-When comparing a pointer to `NULL`, use `EXPECT_NE(`*`ptr`*`, nullptr)` instead
-of `EXPECT_NE(`*`ptr`*`, NULL)`.
-
-### EXPECT_LT {#EXPECT_LT}
-
-`EXPECT_LT(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_LT(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`<`*`val2`*.
-
-### EXPECT_LE {#EXPECT_LE}
-
-`EXPECT_LE(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_LE(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`<=`*`val2`*.
-
-### EXPECT_GT {#EXPECT_GT}
-
-`EXPECT_GT(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_GT(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`>`*`val2`*.
-
-### EXPECT_GE {#EXPECT_GE}
-
-`EXPECT_GE(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_GE(`*`val1`*`,`*`val2`*`)`
-
-Verifies that *`val1`*`>=`*`val2`*.
-
-## String Comparison {#c-strings}
-
-The following assertions compare two **C strings**. To compare two `string`
-objects, use [`EXPECT_EQ`](#EXPECT_EQ) or [`EXPECT_NE`](#EXPECT_NE) instead.
-
-These assertions also accept wide C strings (`wchar_t*`). If a comparison of two
-wide strings fails, their values will be printed as UTF-8 narrow strings.
-
-To compare a C string with `NULL`, use `EXPECT_EQ(`*`c_string`*`, nullptr)` or
-`EXPECT_NE(`*`c_string`*`, nullptr)`.
-
-### EXPECT_STREQ {#EXPECT_STREQ}
-
-`EXPECT_STREQ(`*`str1`*`,`*`str2`*`)` \
-`ASSERT_STREQ(`*`str1`*`,`*`str2`*`)`
-
-Verifies that the two C strings *`str1`* and *`str2`* have the same contents.
-
-### EXPECT_STRNE {#EXPECT_STRNE}
-
-`EXPECT_STRNE(`*`str1`*`,`*`str2`*`)` \
-`ASSERT_STRNE(`*`str1`*`,`*`str2`*`)`
-
-Verifies that the two C strings *`str1`* and *`str2`* have different contents.
-
-### EXPECT_STRCASEEQ {#EXPECT_STRCASEEQ}
-
-`EXPECT_STRCASEEQ(`*`str1`*`,`*`str2`*`)` \
-`ASSERT_STRCASEEQ(`*`str1`*`,`*`str2`*`)`
-
-Verifies that the two C strings *`str1`* and *`str2`* have the same contents,
-ignoring case.
-
-### EXPECT_STRCASENE {#EXPECT_STRCASENE}
-
-`EXPECT_STRCASENE(`*`str1`*`,`*`str2`*`)` \
-`ASSERT_STRCASENE(`*`str1`*`,`*`str2`*`)`
-
-Verifies that the two C strings *`str1`* and *`str2`* have different contents,
-ignoring case.
-
-## Floating-Point Comparison {#floating-point}
-
-The following assertions compare two floating-point values.
-
-Due to rounding errors, it is very unlikely that two floating-point values will
-match exactly, so `EXPECT_EQ` is not suitable. In general, for floating-point
-comparison to make sense, the user needs to carefully choose the error bound.
-
-GoogleTest also provides assertions that use a default error bound based on
-Units in the Last Place (ULPs). To learn more about ULPs, see the article
-[Comparing Floating Point Numbers](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/).
-
-### EXPECT_FLOAT_EQ {#EXPECT_FLOAT_EQ}
-
-`EXPECT_FLOAT_EQ(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_FLOAT_EQ(`*`val1`*`,`*`val2`*`)`
-
-Verifies that the two `float` values *`val1`* and *`val2`* are approximately
-equal, to within 4 ULPs from each other.
-
-### EXPECT_DOUBLE_EQ {#EXPECT_DOUBLE_EQ}
-
-`EXPECT_DOUBLE_EQ(`*`val1`*`,`*`val2`*`)` \
-`ASSERT_DOUBLE_EQ(`*`val1`*`,`*`val2`*`)`
-
-Verifies that the two `double` values *`val1`* and *`val2`* are approximately
-equal, to within 4 ULPs from each other.
-
-### EXPECT_NEAR {#EXPECT_NEAR}
-
-`EXPECT_NEAR(`*`val1`*`,`*`val2`*`,`*`abs_error`*`)` \
-`ASSERT_NEAR(`*`val1`*`,`*`val2`*`,`*`abs_error`*`)`
-
-Verifies that the difference between *`val1`* and *`val2`* does not exceed the
-absolute error bound *`abs_error`*.
-
-## Exception Assertions {#exceptions}
-
-The following assertions verify that a piece of code throws, or does not throw,
-an exception. Usage requires exceptions to be enabled in the build environment.
-
-Note that the piece of code under test can be a compound statement, for example:
-
-```cpp
-EXPECT_NO_THROW({
- int n = 5;
- DoSomething(&n);
-});
-```
-
-### EXPECT_THROW {#EXPECT_THROW}
-
-`EXPECT_THROW(`*`statement`*`,`*`exception_type`*`)` \
-`ASSERT_THROW(`*`statement`*`,`*`exception_type`*`)`
-
-Verifies that *`statement`* throws an exception of type *`exception_type`*.
-
-### EXPECT_ANY_THROW {#EXPECT_ANY_THROW}
-
-`EXPECT_ANY_THROW(`*`statement`*`)` \
-`ASSERT_ANY_THROW(`*`statement`*`)`
-
-Verifies that *`statement`* throws an exception of any type.
-
-### EXPECT_NO_THROW {#EXPECT_NO_THROW}
-
-`EXPECT_NO_THROW(`*`statement`*`)` \
-`ASSERT_NO_THROW(`*`statement`*`)`
-
-Verifies that *`statement`* does not throw any exception.
-
-## Predicate Assertions {#predicates}
-
-The following assertions enable more complex predicates to be verified while
-printing a more clear failure message than if `EXPECT_TRUE` were used alone.
-
-### EXPECT_PRED* {#EXPECT_PRED}
-
-`EXPECT_PRED1(`*`pred`*`,`*`val1`*`)` \
-`EXPECT_PRED2(`*`pred`*`,`*`val1`*`,`*`val2`*`)` \
-`EXPECT_PRED3(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \
-`EXPECT_PRED4(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` \
-`EXPECT_PRED5(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)`
-
-`ASSERT_PRED1(`*`pred`*`,`*`val1`*`)` \
-`ASSERT_PRED2(`*`pred`*`,`*`val1`*`,`*`val2`*`)` \
-`ASSERT_PRED3(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \
-`ASSERT_PRED4(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)` \
-`ASSERT_PRED5(`*`pred`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)`
-
-Verifies that the predicate *`pred`* returns `true` when passed the given values
-as arguments.
-
-The parameter *`pred`* is a function or functor that accepts as many arguments
-as the corresponding macro accepts values. If *`pred`* returns `true` for the
-given arguments, the assertion succeeds, otherwise the assertion fails.
-
-When the assertion fails, it prints the value of each argument. Arguments are
-always evaluated exactly once.
-
-As an example, see the following code:
-
-```cpp
-// Returns true if m and n have no common divisors except 1.
-bool MutuallyPrime(int m, int n) { ... }
-...
-const int a = 3;
-const int b = 4;
-const int c = 10;
-...
-EXPECT_PRED2(MutuallyPrime, a, b); // Succeeds
-EXPECT_PRED2(MutuallyPrime, b, c); // Fails
-```
-
-In the above example, the first assertion succeeds, and the second fails with
-the following message:
-
-```
-MutuallyPrime(b, c) is false, where
-b is 4
-c is 10
-```
-
-Note that if the given predicate is an overloaded function or a function
-template, the assertion macro might not be able to determine which version to
-use, and it might be necessary to explicitly specify the type of the function.
-For example, for a Boolean function `IsPositive()` overloaded to take either a
-single `int` or `double` argument, it would be necessary to write one of the
-following:
-
-```cpp
-EXPECT_PRED1(static_cast<bool (*)(int)>(IsPositive), 5);
-EXPECT_PRED1(static_cast<bool (*)(double)>(IsPositive), 3.14);
-```
-
-Writing simply `EXPECT_PRED1(IsPositive, 5);` would result in a compiler error.
-Similarly, to use a template function, specify the template arguments:
-
-```cpp
-template <typename T>
-bool IsNegative(T x) {
- return x < 0;
-}
-...
-EXPECT_PRED1(IsNegative<int>, -5); // Must specify type for IsNegative
-```
-
-If a template has multiple parameters, wrap the predicate in parentheses so the
-macro arguments are parsed correctly:
-
-```cpp
-ASSERT_PRED2((MyPredicate<int, int>), 5, 0);
-```
-
-### EXPECT_PRED_FORMAT* {#EXPECT_PRED_FORMAT}
-
-`EXPECT_PRED_FORMAT1(`*`pred_formatter`*`,`*`val1`*`)` \
-`EXPECT_PRED_FORMAT2(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`)` \
-`EXPECT_PRED_FORMAT3(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \
-`EXPECT_PRED_FORMAT4(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)`
-\
-`EXPECT_PRED_FORMAT5(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)`
-
-`ASSERT_PRED_FORMAT1(`*`pred_formatter`*`,`*`val1`*`)` \
-`ASSERT_PRED_FORMAT2(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`)` \
-`ASSERT_PRED_FORMAT3(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`)` \
-`ASSERT_PRED_FORMAT4(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`)`
-\
-`ASSERT_PRED_FORMAT5(`*`pred_formatter`*`,`*`val1`*`,`*`val2`*`,`*`val3`*`,`*`val4`*`,`*`val5`*`)`
-
-Verifies that the predicate *`pred_formatter`* succeeds when passed the given
-values as arguments.
-
-The parameter *`pred_formatter`* is a *predicate-formatter*, which is a function
-or functor with the signature:
-
-```cpp
-testing::AssertionResult PredicateFormatter(const char* expr1,
- const char* expr2,
- ...
- const char* exprn,
- T1 val1,
- T2 val2,
- ...
- Tn valn);
-```
-
-where *`val1`*, *`val2`*, ..., *`valn`* are the values of the predicate
-arguments, and *`expr1`*, *`expr2`*, ..., *`exprn`* are the corresponding
-expressions as they appear in the source code. The types `T1`, `T2`, ..., `Tn`
-can be either value types or reference types; if an argument has type `T`, it
-can be declared as either `T` or `const T&`, whichever is appropriate. For more
-about the return type `testing::AssertionResult`, see
-[Using a Function That Returns an AssertionResult](../advanced.md#using-a-function-that-returns-an-assertionresult).
-
-As an example, see the following code:
-
-```cpp
-// Returns the smallest prime common divisor of m and n,
-// or 1 when m and n are mutually prime.
-int SmallestPrimeCommonDivisor(int m, int n) { ... }
-
-// Returns true if m and n have no common divisors except 1.
-bool MutuallyPrime(int m, int n) { ... }
-
-// A predicate-formatter for asserting that two integers are mutually prime.
-testing::AssertionResult AssertMutuallyPrime(const char* m_expr,
- const char* n_expr,
- int m,
- int n) {
- if (MutuallyPrime(m, n)) return testing::AssertionSuccess();
-
- return testing::AssertionFailure() << m_expr << " and " << n_expr
- << " (" << m << " and " << n << ") are not mutually prime, "
- << "as they have a common divisor " << SmallestPrimeCommonDivisor(m, n);
-}
-
-...
-const int a = 3;
-const int b = 4;
-const int c = 10;
-...
-EXPECT_PRED_FORMAT2(AssertMutuallyPrime, a, b); // Succeeds
-EXPECT_PRED_FORMAT2(AssertMutuallyPrime, b, c); // Fails
-```
-
-In the above example, the final assertion fails and the predicate-formatter
-produces the following failure message:
-
-```
-b and c (4 and 10) are not mutually prime, as they have a common divisor 2
-```
-
-## Windows HRESULT Assertions {#HRESULT}
-
-The following assertions test for `HRESULT` success or failure. For example:
-
-```cpp
-CComPtr<IShellDispatch2> shell;
-ASSERT_HRESULT_SUCCEEDED(shell.CoCreateInstance(L"Shell.Application"));
-CComVariant empty;
-ASSERT_HRESULT_SUCCEEDED(shell->ShellExecute(CComBSTR(url), empty, empty, empty, empty));
-```
-
-The generated output contains the human-readable error message associated with
-the returned `HRESULT` code.
-
-### EXPECT_HRESULT_SUCCEEDED {#EXPECT_HRESULT_SUCCEEDED}
-
-`EXPECT_HRESULT_SUCCEEDED(`*`expression`*`)` \
-`ASSERT_HRESULT_SUCCEEDED(`*`expression`*`)`
-
-Verifies that *`expression`* is a success `HRESULT`.
-
-### EXPECT_HRESULT_FAILED {#EXPECT_HRESULT_FAILED}
-
-`EXPECT_HRESULT_FAILED(`*`expression`*`)` \
-`EXPECT_HRESULT_FAILED(`*`expression`*`)`
-
-Verifies that *`expression`* is a failure `HRESULT`.
-
-## Death Assertions {#death}
-
-The following assertions verify that a piece of code causes the process to
-terminate. For context, see [Death Tests](../advanced.md#death-tests).
-
-These assertions spawn a new process and execute the code under test in that
-process. How that happens depends on the platform and the variable
-`::testing::GTEST_FLAG(death_test_style)`, which is initialized from the
-command-line flag `--gtest_death_test_style`.
-
-* On POSIX systems, `fork()` (or `clone()` on Linux) is used to spawn the
- child, after which:
- * If the variable's value is `"fast"`, the death test statement is
- immediately executed.
- * If the variable's value is `"threadsafe"`, the child process re-executes
- the unit test binary just as it was originally invoked, but with some
- extra flags to cause just the single death test under consideration to
- be run.
-* On Windows, the child is spawned using the `CreateProcess()` API, and
- re-executes the binary to cause just the single death test under
- consideration to be run - much like the `"threadsafe"` mode on POSIX.
-
-Other values for the variable are illegal and will cause the death test to fail.
-Currently, the flag's default value is
-**`"fast"`**.
-
-If the death test statement runs to completion without dying, the child process
-will nonetheless terminate, and the assertion fails.
-
-Note that the piece of code under test can be a compound statement, for example:
-
-```cpp
-EXPECT_DEATH({
- int n = 5;
- DoSomething(&n);
-}, "Error on line .* of DoSomething()");
-```
-
-### EXPECT_DEATH {#EXPECT_DEATH}
-
-`EXPECT_DEATH(`*`statement`*`,`*`matcher`*`)` \
-`ASSERT_DEATH(`*`statement`*`,`*`matcher`*`)`
-
-Verifies that *`statement`* causes the process to terminate with a nonzero exit
-status and produces `stderr` output that matches *`matcher`*.
-
-The parameter *`matcher`* is either a [matcher](matchers.md) for a `const
-std::string&`, or a regular expression (see
-[Regular Expression Syntax](../advanced.md#regular-expression-syntax))—a bare
-string *`s`* (with no matcher) is treated as
-[`ContainsRegex(s)`](matchers.md#string-matchers), **not**
-[`Eq(s)`](matchers.md#generic-comparison).
-
-For example, the following code verifies that calling `DoSomething(42)` causes
-the process to die with an error message that contains the text `My error`:
-
-```cpp
-EXPECT_DEATH(DoSomething(42), "My error");
-```
-
-### EXPECT_DEATH_IF_SUPPORTED {#EXPECT_DEATH_IF_SUPPORTED}
-
-`EXPECT_DEATH_IF_SUPPORTED(`*`statement`*`,`*`matcher`*`)` \
-`ASSERT_DEATH_IF_SUPPORTED(`*`statement`*`,`*`matcher`*`)`
-
-If death tests are supported, behaves the same as
-[`EXPECT_DEATH`](#EXPECT_DEATH). Otherwise, verifies nothing.
-
-### EXPECT_DEBUG_DEATH {#EXPECT_DEBUG_DEATH}
-
-`EXPECT_DEBUG_DEATH(`*`statement`*`,`*`matcher`*`)` \
-`ASSERT_DEBUG_DEATH(`*`statement`*`,`*`matcher`*`)`
-
-In debug mode, behaves the same as [`EXPECT_DEATH`](#EXPECT_DEATH). When not in
-debug mode (i.e. `NDEBUG` is defined), just executes *`statement`*.
-
-### EXPECT_EXIT {#EXPECT_EXIT}
-
-`EXPECT_EXIT(`*`statement`*`,`*`predicate`*`,`*`matcher`*`)` \
-`ASSERT_EXIT(`*`statement`*`,`*`predicate`*`,`*`matcher`*`)`
-
-Verifies that *`statement`* causes the process to terminate with an exit status
-that satisfies *`predicate`*, and produces `stderr` output that matches
-*`matcher`*.
-
-The parameter *`predicate`* is a function or functor that accepts an `int` exit
-status and returns a `bool`. GoogleTest provides two predicates to handle common
-cases:
-
-```cpp
-// Returns true if the program exited normally with the given exit status code.
-::testing::ExitedWithCode(exit_code);
-
-// Returns true if the program was killed by the given signal.
-// Not available on Windows.
-::testing::KilledBySignal(signal_number);
-```
-
-The parameter *`matcher`* is either a [matcher](matchers.md) for a `const
-std::string&`, or a regular expression (see
-[Regular Expression Syntax](../advanced.md#regular-expression-syntax))—a bare
-string *`s`* (with no matcher) is treated as
-[`ContainsRegex(s)`](matchers.md#string-matchers), **not**
-[`Eq(s)`](matchers.md#generic-comparison).
-
-For example, the following code verifies that calling `NormalExit()` causes the
-process to print a message containing the text `Success` to `stderr` and exit
-with exit status code 0:
-
-```cpp
-EXPECT_EXIT(NormalExit(), testing::ExitedWithCode(0), "Success");
-```
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/matchers.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/matchers.md
deleted file mode 100644
index 47d2808c3b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/matchers.md
+++ /dev/null
@@ -1,285 +0,0 @@
-# Matchers Reference
-
-A **matcher** matches a *single* argument. You can use it inside `ON_CALL()` or
-`EXPECT_CALL()`, or use it to validate a value directly using two macros:
-
-| Macro | Description |
-| :----------------------------------- | :------------------------------------ |
-| `EXPECT_THAT(actual_value, matcher)` | Asserts that `actual_value` matches `matcher`. |
-| `ASSERT_THAT(actual_value, matcher)` | The same as `EXPECT_THAT(actual_value, matcher)`, except that it generates a **fatal** failure. |
-
-{: .callout .note}
-**Note:** Although equality matching via `EXPECT_THAT(actual_value,
-expected_value)` is supported, prefer to make the comparison explicit via
-`EXPECT_THAT(actual_value, Eq(expected_value))` or `EXPECT_EQ(actual_value,
-expected_value)`.
-
-Built-in matchers (where `argument` is the function argument, e.g.
-`actual_value` in the example above, or when used in the context of
-`EXPECT_CALL(mock_object, method(matchers))`, the arguments of `method`) are
-divided into several categories. All matchers are defined in the `::testing`
-namespace unless otherwise noted.
-
-## Wildcard
-
-Matcher | Description
-:-------------------------- | :-----------------------------------------------
-`_` | `argument` can be any value of the correct type.
-`A<type>()` or `An<type>()` | `argument` can be any value of type `type`.
-
-## Generic Comparison
-
-| Matcher | Description |
-| :--------------------- | :-------------------------------------------------- |
-| `Eq(value)` or `value` | `argument == value` |
-| `Ge(value)` | `argument >= value` |
-| `Gt(value)` | `argument > value` |
-| `Le(value)` | `argument <= value` |
-| `Lt(value)` | `argument < value` |
-| `Ne(value)` | `argument != value` |
-| `IsFalse()` | `argument` evaluates to `false` in a Boolean context. |
-| `IsTrue()` | `argument` evaluates to `true` in a Boolean context. |
-| `IsNull()` | `argument` is a `NULL` pointer (raw or smart). |
-| `NotNull()` | `argument` is a non-null pointer (raw or smart). |
-| `Optional(m)` | `argument` is `optional<>` that contains a value matching `m`. (For testing whether an `optional<>` is set, check for equality with `nullopt`. You may need to use `Eq(nullopt)` if the inner type doesn't have `==`.)|
-| `VariantWith<T>(m)` | `argument` is `variant<>` that holds the alternative of type T with a value matching `m`. |
-| `Ref(variable)` | `argument` is a reference to `variable`. |
-| `TypedEq<type>(value)` | `argument` has type `type` and is equal to `value`. You may need to use this instead of `Eq(value)` when the mock function is overloaded. |
-
-Except `Ref()`, these matchers make a *copy* of `value` in case it's modified or
-destructed later. If the compiler complains that `value` doesn't have a public
-copy constructor, try wrap it in `std::ref()`, e.g.
-`Eq(std::ref(non_copyable_value))`. If you do that, make sure
-`non_copyable_value` is not changed afterwards, or the meaning of your matcher
-will be changed.
-
-`IsTrue` and `IsFalse` are useful when you need to use a matcher, or for types
-that can be explicitly converted to Boolean, but are not implicitly converted to
-Boolean. In other cases, you can use the basic
-[`EXPECT_TRUE` and `EXPECT_FALSE`](assertions.md#boolean) assertions.
-
-## Floating-Point Matchers {#FpMatchers}
-
-| Matcher | Description |
-| :------------------------------- | :--------------------------------- |
-| `DoubleEq(a_double)` | `argument` is a `double` value approximately equal to `a_double`, treating two NaNs as unequal. |
-| `FloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as unequal. |
-| `NanSensitiveDoubleEq(a_double)` | `argument` is a `double` value approximately equal to `a_double`, treating two NaNs as equal. |
-| `NanSensitiveFloatEq(a_float)` | `argument` is a `float` value approximately equal to `a_float`, treating two NaNs as equal. |
-| `IsNan()` | `argument` is any floating-point type with a NaN value. |
-
-The above matchers use ULP-based comparison (the same as used in googletest).
-They automatically pick a reasonable error bound based on the absolute value of
-the expected value. `DoubleEq()` and `FloatEq()` conform to the IEEE standard,
-which requires comparing two NaNs for equality to return false. The
-`NanSensitive*` version instead treats two NaNs as equal, which is often what a
-user wants.
-
-| Matcher | Description |
-| :------------------------------------------------ | :----------------------- |
-| `DoubleNear(a_double, max_abs_error)` | `argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as unequal. |
-| `FloatNear(a_float, max_abs_error)` | `argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as unequal. |
-| `NanSensitiveDoubleNear(a_double, max_abs_error)` | `argument` is a `double` value close to `a_double` (absolute error <= `max_abs_error`), treating two NaNs as equal. |
-| `NanSensitiveFloatNear(a_float, max_abs_error)` | `argument` is a `float` value close to `a_float` (absolute error <= `max_abs_error`), treating two NaNs as equal. |
-
-## String Matchers
-
-The `argument` can be either a C string or a C++ string object:
-
-| Matcher | Description |
-| :---------------------- | :------------------------------------------------- |
-| `ContainsRegex(string)` | `argument` matches the given regular expression. |
-| `EndsWith(suffix)` | `argument` ends with string `suffix`. |
-| `HasSubstr(string)` | `argument` contains `string` as a sub-string. |
-| `IsEmpty()` | `argument` is an empty string. |
-| `MatchesRegex(string)` | `argument` matches the given regular expression with the match starting at the first character and ending at the last character. |
-| `StartsWith(prefix)` | `argument` starts with string `prefix`. |
-| `StrCaseEq(string)` | `argument` is equal to `string`, ignoring case. |
-| `StrCaseNe(string)` | `argument` is not equal to `string`, ignoring case. |
-| `StrEq(string)` | `argument` is equal to `string`. |
-| `StrNe(string)` | `argument` is not equal to `string`. |
-| `WhenBase64Unescaped(m)` | `argument` is a base-64 escaped string whose unescaped string matches `m`. |
-
-`ContainsRegex()` and `MatchesRegex()` take ownership of the `RE` object. They
-use the regular expression syntax defined
-[here](../advanced.md#regular-expression-syntax). All of these matchers, except
-`ContainsRegex()` and `MatchesRegex()` work for wide strings as well.
-
-## Container Matchers
-
-Most STL-style containers support `==`, so you can use `Eq(expected_container)`
-or simply `expected_container` to match a container exactly. If you want to
-write the elements in-line, match them more flexibly, or get more informative
-messages, you can use:
-
-| Matcher | Description |
-| :---------------------------------------- | :------------------------------- |
-| `BeginEndDistanceIs(m)` | `argument` is a container whose `begin()` and `end()` iterators are separated by a number of increments matching `m`. E.g. `BeginEndDistanceIs(2)` or `BeginEndDistanceIs(Lt(2))`. For containers that define a `size()` method, `SizeIs(m)` may be more efficient. |
-| `ContainerEq(container)` | The same as `Eq(container)` except that the failure message also includes which elements are in one container but not the other. |
-| `Contains(e)` | `argument` contains an element that matches `e`, which can be either a value or a matcher. |
-| `Contains(e).Times(n)` | `argument` contains elements that match `e`, which can be either a value or a matcher, and the number of matches is `n`, which can be either a value or a matcher. Unlike the plain `Contains` and `Each` this allows to check for arbitrary occurrences including testing for absence with `Contains(e).Times(0)`. |
-| `Each(e)` | `argument` is a container where *every* element matches `e`, which can be either a value or a matcher. |
-| `ElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, where the *i*-th element matches `ei`, which can be a value or a matcher. |
-| `ElementsAreArray({e0, e1, ..., en})`, `ElementsAreArray(a_container)`, `ElementsAreArray(begin, end)`, `ElementsAreArray(array)`, or `ElementsAreArray(array, count)` | The same as `ElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, iterator range, or C-style array. |
-| `IsEmpty()` | `argument` is an empty container (`container.empty()`). |
-| `IsSubsetOf({e0, e1, ..., en})`, `IsSubsetOf(a_container)`, `IsSubsetOf(begin, end)`, `IsSubsetOf(array)`, or `IsSubsetOf(array, count)` | `argument` matches `UnorderedElementsAre(x0, x1, ..., xk)` for some subset `{x0, x1, ..., xk}` of the expected matchers. |
-| `IsSupersetOf({e0, e1, ..., en})`, `IsSupersetOf(a_container)`, `IsSupersetOf(begin, end)`, `IsSupersetOf(array)`, or `IsSupersetOf(array, count)` | Some subset of `argument` matches `UnorderedElementsAre(`expected matchers`)`. |
-| `Pointwise(m, container)`, `Pointwise(m, {e0, e1, ..., en})` | `argument` contains the same number of elements as in `container`, and for all i, (the i-th element in `argument`, the i-th element in `container`) match `m`, which is a matcher on 2-tuples. E.g. `Pointwise(Le(), upper_bounds)` verifies that each element in `argument` doesn't exceed the corresponding element in `upper_bounds`. See more detail below. |
-| `SizeIs(m)` | `argument` is a container whose size matches `m`. E.g. `SizeIs(2)` or `SizeIs(Lt(2))`. |
-| `UnorderedElementsAre(e0, e1, ..., en)` | `argument` has `n + 1` elements, and under *some* permutation of the elements, each element matches an `ei` (for a different `i`), which can be a value or a matcher. |
-| `UnorderedElementsAreArray({e0, e1, ..., en})`, `UnorderedElementsAreArray(a_container)`, `UnorderedElementsAreArray(begin, end)`, `UnorderedElementsAreArray(array)`, or `UnorderedElementsAreArray(array, count)` | The same as `UnorderedElementsAre()` except that the expected element values/matchers come from an initializer list, STL-style container, iterator range, or C-style array. |
-| `UnorderedPointwise(m, container)`, `UnorderedPointwise(m, {e0, e1, ..., en})` | Like `Pointwise(m, container)`, but ignores the order of elements. |
-| `WhenSorted(m)` | When `argument` is sorted using the `<` operator, it matches container matcher `m`. E.g. `WhenSorted(ElementsAre(1, 2, 3))` verifies that `argument` contains elements 1, 2, and 3, ignoring order. |
-| `WhenSortedBy(comparator, m)` | The same as `WhenSorted(m)`, except that the given comparator instead of `<` is used to sort `argument`. E.g. `WhenSortedBy(std::greater(), ElementsAre(3, 2, 1))`. |
-
-**Notes:**
-
-* These matchers can also match:
- 1. a native array passed by reference (e.g. in `Foo(const int (&a)[5])`),
- and
- 2. an array passed as a pointer and a count (e.g. in `Bar(const T* buffer,
- int len)` -- see [Multi-argument Matchers](#MultiArgMatchers)).
-* The array being matched may be multi-dimensional (i.e. its elements can be
- arrays).
-* `m` in `Pointwise(m, ...)` and `UnorderedPointwise(m, ...)` should be a
- matcher for `::std::tuple<T, U>` where `T` and `U` are the element type of
- the actual container and the expected container, respectively. For example,
- to compare two `Foo` containers where `Foo` doesn't support `operator==`,
- one might write:
-
- ```cpp
- MATCHER(FooEq, "") {
- return std::get<0>(arg).Equals(std::get<1>(arg));
- }
- ...
- EXPECT_THAT(actual_foos, Pointwise(FooEq(), expected_foos));
- ```
-
-## Member Matchers
-
-| Matcher | Description |
-| :------------------------------ | :----------------------------------------- |
-| `Field(&class::field, m)` | `argument.field` (or `argument->field` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. |
-| `Field(field_name, &class::field, m)` | The same as the two-parameter version, but provides a better error message. |
-| `Key(e)` | `argument.first` matches `e`, which can be either a value or a matcher. E.g. `Contains(Key(Le(5)))` can verify that a `map` contains a key `<= 5`. |
-| `Pair(m1, m2)` | `argument` is an `std::pair` whose `first` field matches `m1` and `second` field matches `m2`. |
-| `FieldsAre(m...)` | `argument` is a compatible object where each field matches piecewise with the matchers `m...`. A compatible object is any that supports the `std::tuple_size<Obj>`+`get<I>(obj)` protocol. In C++17 and up this also supports types compatible with structured bindings, like aggregates. |
-| `Property(&class::property, m)` | `argument.property()` (or `argument->property()` when `argument` is a plain pointer) matches matcher `m`, where `argument` is an object of type _class_. The method `property()` must take no argument and be declared as `const`. |
-| `Property(property_name, &class::property, m)` | The same as the two-parameter version, but provides a better error message.
-
-**Notes:**
-
-* You can use `FieldsAre()` to match any type that supports structured
- bindings, such as `std::tuple`, `std::pair`, `std::array`, and aggregate
- types. For example:
-
- ```cpp
- std::tuple<int, std::string> my_tuple{7, "hello world"};
- EXPECT_THAT(my_tuple, FieldsAre(Ge(0), HasSubstr("hello")));
-
- struct MyStruct {
- int value = 42;
- std::string greeting = "aloha";
- };
- MyStruct s;
- EXPECT_THAT(s, FieldsAre(42, "aloha"));
- ```
-
-* Don't use `Property()` against member functions that you do not own, because
- taking addresses of functions is fragile and generally not part of the
- contract of the function.
-
-## Matching the Result of a Function, Functor, or Callback
-
-| Matcher | Description |
-| :--------------- | :------------------------------------------------ |
-| `ResultOf(f, m)` | `f(argument)` matches matcher `m`, where `f` is a function or functor. |
-
-## Pointer Matchers
-
-| Matcher | Description |
-| :------------------------ | :---------------------------------------------- |
-| `Address(m)` | the result of `std::addressof(argument)` matches `m`. |
-| `Pointee(m)` | `argument` (either a smart pointer or a raw pointer) points to a value that matches matcher `m`. |
-| `Pointer(m)` | `argument` (either a smart pointer or a raw pointer) contains a pointer that matches `m`. `m` will match against the raw pointer regardless of the type of `argument`. |
-| `WhenDynamicCastTo<T>(m)` | when `argument` is passed through `dynamic_cast<T>()`, it matches matcher `m`. |
-
-## Multi-argument Matchers {#MultiArgMatchers}
-
-Technically, all matchers match a *single* value. A "multi-argument" matcher is
-just one that matches a *tuple*. The following matchers can be used to match a
-tuple `(x, y)`:
-
-Matcher | Description
-:------ | :----------
-`Eq()` | `x == y`
-`Ge()` | `x >= y`
-`Gt()` | `x > y`
-`Le()` | `x <= y`
-`Lt()` | `x < y`
-`Ne()` | `x != y`
-
-You can use the following selectors to pick a subset of the arguments (or
-reorder them) to participate in the matching:
-
-| Matcher | Description |
-| :------------------------- | :---------------------------------------------- |
-| `AllArgs(m)` | Equivalent to `m`. Useful as syntactic sugar in `.With(AllArgs(m))`. |
-| `Args<N1, N2, ..., Nk>(m)` | The tuple of the `k` selected (using 0-based indices) arguments matches `m`, e.g. `Args<1, 2>(Eq())`. |
-
-## Composite Matchers
-
-You can make a matcher from one or more other matchers:
-
-| Matcher | Description |
-| :------------------------------- | :-------------------------------------- |
-| `AllOf(m1, m2, ..., mn)` | `argument` matches all of the matchers `m1` to `mn`. |
-| `AllOfArray({m0, m1, ..., mn})`, `AllOfArray(a_container)`, `AllOfArray(begin, end)`, `AllOfArray(array)`, or `AllOfArray(array, count)` | The same as `AllOf()` except that the matchers come from an initializer list, STL-style container, iterator range, or C-style array. |
-| `AnyOf(m1, m2, ..., mn)` | `argument` matches at least one of the matchers `m1` to `mn`. |
-| `AnyOfArray({m0, m1, ..., mn})`, `AnyOfArray(a_container)`, `AnyOfArray(begin, end)`, `AnyOfArray(array)`, or `AnyOfArray(array, count)` | The same as `AnyOf()` except that the matchers come from an initializer list, STL-style container, iterator range, or C-style array. |
-| `Not(m)` | `argument` doesn't match matcher `m`. |
-| `Conditional(cond, m1, m2)` | Matches matcher `m1` if `cond` evaluates to true, else matches `m2`.|
-
-## Adapters for Matchers
-
-| Matcher | Description |
-| :---------------------- | :------------------------------------ |
-| `MatcherCast<T>(m)` | casts matcher `m` to type `Matcher<T>`. |
-| `SafeMatcherCast<T>(m)` | [safely casts](../gmock_cook_book.md#SafeMatcherCast) matcher `m` to type `Matcher<T>`. |
-| `Truly(predicate)` | `predicate(argument)` returns something considered by C++ to be true, where `predicate` is a function or functor. |
-
-`AddressSatisfies(callback)` and `Truly(callback)` take ownership of `callback`,
-which must be a permanent callback.
-
-## Using Matchers as Predicates {#MatchersAsPredicatesCheat}
-
-| Matcher | Description |
-| :---------------------------- | :------------------------------------------ |
-| `Matches(m)(value)` | evaluates to `true` if `value` matches `m`. You can use `Matches(m)` alone as a unary functor. |
-| `ExplainMatchResult(m, value, result_listener)` | evaluates to `true` if `value` matches `m`, explaining the result to `result_listener`. |
-| `Value(value, m)` | evaluates to `true` if `value` matches `m`. |
-
-## Defining Matchers
-
-| Macro | Description |
-| :----------------------------------- | :------------------------------------ |
-| `MATCHER(IsEven, "") { return (arg % 2) == 0; }` | Defines a matcher `IsEven()` to match an even number. |
-| `MATCHER_P(IsDivisibleBy, n, "") { *result_listener << "where the remainder is " << (arg % n); return (arg % n) == 0; }` | Defines a matcher `IsDivisibleBy(n)` to match a number divisible by `n`. |
-| `MATCHER_P2(IsBetween, a, b, absl::StrCat(negation ? "isn't" : "is", " between ", PrintToString(a), " and ", PrintToString(b))) { return a <= arg && arg <= b; }` | Defines a matcher `IsBetween(a, b)` to match a value in the range [`a`, `b`]. |
-
-**Notes:**
-
-1. The `MATCHER*` macros cannot be used inside a function or class.
-2. The matcher body must be *purely functional* (i.e. it cannot have any side
- effect, and the result must not depend on anything other than the value
- being matched and the matcher parameters).
-3. You can use `PrintToString(x)` to convert a value `x` of any type to a
- string.
-4. You can use `ExplainMatchResult()` in a custom matcher to wrap another
- matcher, for example:
-
- ```cpp
- MATCHER_P(NestedPropertyMatches, matcher, "") {
- return ExplainMatchResult(matcher, arg.nested().property(), result_listener);
- }
- ```
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/mocking.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/mocking.md
deleted file mode 100644
index c29f71603f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/mocking.md
+++ /dev/null
@@ -1,587 +0,0 @@
-# Mocking Reference
-
-This page lists the facilities provided by GoogleTest for creating and working
-with mock objects. To use them, include the header
-`gmock/gmock.h`.
-
-## Macros {#macros}
-
-GoogleTest defines the following macros for working with mocks.
-
-### MOCK_METHOD {#MOCK_METHOD}
-
-`MOCK_METHOD(`*`return_type`*`,`*`method_name`*`, (`*`args...`*`));` \
-`MOCK_METHOD(`*`return_type`*`,`*`method_name`*`, (`*`args...`*`),
-(`*`specs...`*`));`
-
-Defines a mock method *`method_name`* with arguments `(`*`args...`*`)` and
-return type *`return_type`* within a mock class.
-
-The parameters of `MOCK_METHOD` mirror the method declaration. The optional
-fourth parameter *`specs...`* is a comma-separated list of qualifiers. The
-following qualifiers are accepted:
-
-| Qualifier | Meaning |
-| -------------------------- | -------------------------------------------- |
-| `const` | Makes the mocked method a `const` method. Required if overriding a `const` method. |
-| `override` | Marks the method with `override`. Recommended if overriding a `virtual` method. |
-| `noexcept` | Marks the method with `noexcept`. Required if overriding a `noexcept` method. |
-| `Calltype(`*`calltype`*`)` | Sets the call type for the method, for example `Calltype(STDMETHODCALLTYPE)`. Useful on Windows. |
-| `ref(`*`qualifier`*`)` | Marks the method with the given reference qualifier, for example `ref(&)` or `ref(&&)`. Required if overriding a method that has a reference qualifier. |
-
-Note that commas in arguments prevent `MOCK_METHOD` from parsing the arguments
-correctly if they are not appropriately surrounded by parentheses. See the
-following example:
-
-```cpp
-class MyMock {
- public:
- // The following 2 lines will not compile due to commas in the arguments:
- MOCK_METHOD(std::pair<bool, int>, GetPair, ()); // Error!
- MOCK_METHOD(bool, CheckMap, (std::map<int, double>, bool)); // Error!
-
- // One solution - wrap arguments that contain commas in parentheses:
- MOCK_METHOD((std::pair<bool, int>), GetPair, ());
- MOCK_METHOD(bool, CheckMap, ((std::map<int, double>), bool));
-
- // Another solution - use type aliases:
- using BoolAndInt = std::pair<bool, int>;
- MOCK_METHOD(BoolAndInt, GetPair, ());
- using MapIntDouble = std::map<int, double>;
- MOCK_METHOD(bool, CheckMap, (MapIntDouble, bool));
-};
-```
-
-`MOCK_METHOD` must be used in the `public:` section of a mock class definition,
-regardless of whether the method being mocked is `public`, `protected`, or
-`private` in the base class.
-
-### EXPECT_CALL {#EXPECT_CALL}
-
-`EXPECT_CALL(`*`mock_object`*`,`*`method_name`*`(`*`matchers...`*`))`
-
-Creates an [expectation](../gmock_for_dummies.md#setting-expectations) that the
-method *`method_name`* of the object *`mock_object`* is called with arguments
-that match the given matchers *`matchers...`*. `EXPECT_CALL` must precede any
-code that exercises the mock object.
-
-The parameter *`matchers...`* is a comma-separated list of
-[matchers](../gmock_for_dummies.md#matchers-what-arguments-do-we-expect) that
-correspond to each argument of the method *`method_name`*. The expectation will
-apply only to calls of *`method_name`* whose arguments match all of the
-matchers. If `(`*`matchers...`*`)` is omitted, the expectation behaves as if
-each argument's matcher were a [wildcard matcher (`_`)](matchers.md#wildcard).
-See the [Matchers Reference](matchers.md) for a list of all built-in matchers.
-
-The following chainable clauses can be used to modify the expectation, and they
-must be used in the following order:
-
-```cpp
-EXPECT_CALL(mock_object, method_name(matchers...))
- .With(multi_argument_matcher) // Can be used at most once
- .Times(cardinality) // Can be used at most once
- .InSequence(sequences...) // Can be used any number of times
- .After(expectations...) // Can be used any number of times
- .WillOnce(action) // Can be used any number of times
- .WillRepeatedly(action) // Can be used at most once
- .RetiresOnSaturation(); // Can be used at most once
-```
-
-See details for each modifier clause below.
-
-#### With {#EXPECT_CALL.With}
-
-`.With(`*`multi_argument_matcher`*`)`
-
-Restricts the expectation to apply only to mock function calls whose arguments
-as a whole match the multi-argument matcher *`multi_argument_matcher`*.
-
-GoogleTest passes all of the arguments as one tuple into the matcher. The
-parameter *`multi_argument_matcher`* must thus be a matcher of type
-`Matcher<std::tuple<A1, ..., An>>`, where `A1, ..., An` are the types of the
-function arguments.
-
-For example, the following code sets the expectation that
-`my_mock.SetPosition()` is called with any two arguments, the first argument
-being less than the second:
-
-```cpp
-using ::testing::_;
-using ::testing::Lt;
-...
-EXPECT_CALL(my_mock, SetPosition(_, _))
- .With(Lt());
-```
-
-GoogleTest provides some built-in matchers for 2-tuples, including the `Lt()`
-matcher above. See [Multi-argument Matchers](matchers.md#MultiArgMatchers).
-
-The `With` clause can be used at most once on an expectation and must be the
-first clause.
-
-#### Times {#EXPECT_CALL.Times}
-
-`.Times(`*`cardinality`*`)`
-
-Specifies how many times the mock function call is expected.
-
-The parameter *`cardinality`* represents the number of expected calls and can be
-one of the following, all defined in the `::testing` namespace:
-
-| Cardinality | Meaning |
-| ------------------- | --------------------------------------------------- |
-| `AnyNumber()` | The function can be called any number of times. |
-| `AtLeast(n)` | The function call is expected at least *n* times. |
-| `AtMost(n)` | The function call is expected at most *n* times. |
-| `Between(m, n)` | The function call is expected between *m* and *n* times, inclusive. |
-| `Exactly(n)` or `n` | The function call is expected exactly *n* times. If *n* is 0, the call should never happen. |
-
-If the `Times` clause is omitted, GoogleTest infers the cardinality as follows:
-
-* If neither [`WillOnce`](#EXPECT_CALL.WillOnce) nor
- [`WillRepeatedly`](#EXPECT_CALL.WillRepeatedly) are specified, the inferred
- cardinality is `Times(1)`.
-* If there are *n* `WillOnce` clauses and no `WillRepeatedly` clause, where
- *n* >= 1, the inferred cardinality is `Times(n)`.
-* If there are *n* `WillOnce` clauses and one `WillRepeatedly` clause, where
- *n* >= 0, the inferred cardinality is `Times(AtLeast(n))`.
-
-The `Times` clause can be used at most once on an expectation.
-
-#### InSequence {#EXPECT_CALL.InSequence}
-
-`.InSequence(`*`sequences...`*`)`
-
-Specifies that the mock function call is expected in a certain sequence.
-
-The parameter *`sequences...`* is any number of [`Sequence`](#Sequence) objects.
-Expected calls assigned to the same sequence are expected to occur in the order
-the expectations are declared.
-
-For example, the following code sets the expectation that the `Reset()` method
-of `my_mock` is called before both `GetSize()` and `Describe()`, and `GetSize()`
-and `Describe()` can occur in any order relative to each other:
-
-```cpp
-using ::testing::Sequence;
-Sequence s1, s2;
-...
-EXPECT_CALL(my_mock, Reset())
- .InSequence(s1, s2);
-EXPECT_CALL(my_mock, GetSize())
- .InSequence(s1);
-EXPECT_CALL(my_mock, Describe())
- .InSequence(s2);
-```
-
-The `InSequence` clause can be used any number of times on an expectation.
-
-See also the [`InSequence` class](#InSequence).
-
-#### After {#EXPECT_CALL.After}
-
-`.After(`*`expectations...`*`)`
-
-Specifies that the mock function call is expected to occur after one or more
-other calls.
-
-The parameter *`expectations...`* can be up to five
-[`Expectation`](#Expectation) or [`ExpectationSet`](#ExpectationSet) objects.
-The mock function call is expected to occur after all of the given expectations.
-
-For example, the following code sets the expectation that the `Describe()`
-method of `my_mock` is called only after both `InitX()` and `InitY()` have been
-called.
-
-```cpp
-using ::testing::Expectation;
-...
-Expectation init_x = EXPECT_CALL(my_mock, InitX());
-Expectation init_y = EXPECT_CALL(my_mock, InitY());
-EXPECT_CALL(my_mock, Describe())
- .After(init_x, init_y);
-```
-
-The `ExpectationSet` object is helpful when the number of prerequisites for an
-expectation is large or variable, for example:
-
-```cpp
-using ::testing::ExpectationSet;
-...
-ExpectationSet all_inits;
-// Collect all expectations of InitElement() calls
-for (int i = 0; i < element_count; i++) {
- all_inits += EXPECT_CALL(my_mock, InitElement(i));
-}
-EXPECT_CALL(my_mock, Describe())
- .After(all_inits); // Expect Describe() call after all InitElement() calls
-```
-
-The `After` clause can be used any number of times on an expectation.
-
-#### WillOnce {#EXPECT_CALL.WillOnce}
-
-`.WillOnce(`*`action`*`)`
-
-Specifies the mock function's actual behavior when invoked, for a single
-matching function call.
-
-The parameter *`action`* represents the
-[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function
-call will perform. See the [Actions Reference](actions.md) for a list of
-built-in actions.
-
-The use of `WillOnce` implicitly sets a cardinality on the expectation when
-`Times` is not specified. See [`Times`](#EXPECT_CALL.Times).
-
-Each matching function call will perform the next action in the order declared.
-For example, the following code specifies that `my_mock.GetNumber()` is expected
-to be called exactly 3 times and will return `1`, `2`, and `3` respectively on
-the first, second, and third calls:
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(my_mock, GetNumber())
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .WillOnce(Return(3));
-```
-
-The `WillOnce` clause can be used any number of times on an expectation.
-
-#### WillRepeatedly {#EXPECT_CALL.WillRepeatedly}
-
-`.WillRepeatedly(`*`action`*`)`
-
-Specifies the mock function's actual behavior when invoked, for all subsequent
-matching function calls. Takes effect after the actions specified in the
-[`WillOnce`](#EXPECT_CALL.WillOnce) clauses, if any, have been performed.
-
-The parameter *`action`* represents the
-[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function
-call will perform. See the [Actions Reference](actions.md) for a list of
-built-in actions.
-
-The use of `WillRepeatedly` implicitly sets a cardinality on the expectation
-when `Times` is not specified. See [`Times`](#EXPECT_CALL.Times).
-
-If any `WillOnce` clauses have been specified, matching function calls will
-perform those actions before the action specified by `WillRepeatedly`. See the
-following example:
-
-```cpp
-using ::testing::Return;
-...
-EXPECT_CALL(my_mock, GetName())
- .WillRepeatedly(Return("John Doe")); // Return "John Doe" on all calls
-
-EXPECT_CALL(my_mock, GetNumber())
- .WillOnce(Return(42)) // Return 42 on the first call
- .WillRepeatedly(Return(7)); // Return 7 on all subsequent calls
-```
-
-The `WillRepeatedly` clause can be used at most once on an expectation.
-
-#### RetiresOnSaturation {#EXPECT_CALL.RetiresOnSaturation}
-
-`.RetiresOnSaturation()`
-
-Indicates that the expectation will no longer be active after the expected
-number of matching function calls has been reached.
-
-The `RetiresOnSaturation` clause is only meaningful for expectations with an
-upper-bounded cardinality. The expectation will *retire* (no longer match any
-function calls) after it has been *saturated* (the upper bound has been
-reached). See the following example:
-
-```cpp
-using ::testing::_;
-using ::testing::AnyNumber;
-...
-EXPECT_CALL(my_mock, SetNumber(_)) // Expectation 1
- .Times(AnyNumber());
-EXPECT_CALL(my_mock, SetNumber(7)) // Expectation 2
- .Times(2)
- .RetiresOnSaturation();
-```
-
-In the above example, the first two calls to `my_mock.SetNumber(7)` match
-expectation 2, which then becomes inactive and no longer matches any calls. A
-third call to `my_mock.SetNumber(7)` would then match expectation 1. Without
-`RetiresOnSaturation()` on expectation 2, a third call to `my_mock.SetNumber(7)`
-would match expectation 2 again, producing a failure since the limit of 2 calls
-was exceeded.
-
-The `RetiresOnSaturation` clause can be used at most once on an expectation and
-must be the last clause.
-
-### ON_CALL {#ON_CALL}
-
-`ON_CALL(`*`mock_object`*`,`*`method_name`*`(`*`matchers...`*`))`
-
-Defines what happens when the method *`method_name`* of the object
-*`mock_object`* is called with arguments that match the given matchers
-*`matchers...`*. Requires a modifier clause to specify the method's behavior.
-*Does not* set any expectations that the method will be called.
-
-The parameter *`matchers...`* is a comma-separated list of
-[matchers](../gmock_for_dummies.md#matchers-what-arguments-do-we-expect) that
-correspond to each argument of the method *`method_name`*. The `ON_CALL`
-specification will apply only to calls of *`method_name`* whose arguments match
-all of the matchers. If `(`*`matchers...`*`)` is omitted, the behavior is as if
-each argument's matcher were a [wildcard matcher (`_`)](matchers.md#wildcard).
-See the [Matchers Reference](matchers.md) for a list of all built-in matchers.
-
-The following chainable clauses can be used to set the method's behavior, and
-they must be used in the following order:
-
-```cpp
-ON_CALL(mock_object, method_name(matchers...))
- .With(multi_argument_matcher) // Can be used at most once
- .WillByDefault(action); // Required
-```
-
-See details for each modifier clause below.
-
-#### With {#ON_CALL.With}
-
-`.With(`*`multi_argument_matcher`*`)`
-
-Restricts the specification to only mock function calls whose arguments as a
-whole match the multi-argument matcher *`multi_argument_matcher`*.
-
-GoogleTest passes all of the arguments as one tuple into the matcher. The
-parameter *`multi_argument_matcher`* must thus be a matcher of type
-`Matcher<std::tuple<A1, ..., An>>`, where `A1, ..., An` are the types of the
-function arguments.
-
-For example, the following code sets the default behavior when
-`my_mock.SetPosition()` is called with any two arguments, the first argument
-being less than the second:
-
-```cpp
-using ::testing::_;
-using ::testing::Lt;
-using ::testing::Return;
-...
-ON_CALL(my_mock, SetPosition(_, _))
- .With(Lt())
- .WillByDefault(Return(true));
-```
-
-GoogleTest provides some built-in matchers for 2-tuples, including the `Lt()`
-matcher above. See [Multi-argument Matchers](matchers.md#MultiArgMatchers).
-
-The `With` clause can be used at most once with each `ON_CALL` statement.
-
-#### WillByDefault {#ON_CALL.WillByDefault}
-
-`.WillByDefault(`*`action`*`)`
-
-Specifies the default behavior of a matching mock function call.
-
-The parameter *`action`* represents the
-[action](../gmock_for_dummies.md#actions-what-should-it-do) that the function
-call will perform. See the [Actions Reference](actions.md) for a list of
-built-in actions.
-
-For example, the following code specifies that by default, a call to
-`my_mock.Greet()` will return `"hello"`:
-
-```cpp
-using ::testing::Return;
-...
-ON_CALL(my_mock, Greet())
- .WillByDefault(Return("hello"));
-```
-
-The action specified by `WillByDefault` is superseded by the actions specified
-on a matching `EXPECT_CALL` statement, if any. See the
-[`WillOnce`](#EXPECT_CALL.WillOnce) and
-[`WillRepeatedly`](#EXPECT_CALL.WillRepeatedly) clauses of `EXPECT_CALL`.
-
-The `WillByDefault` clause must be used exactly once with each `ON_CALL`
-statement.
-
-## Classes {#classes}
-
-GoogleTest defines the following classes for working with mocks.
-
-### DefaultValue {#DefaultValue}
-
-`::testing::DefaultValue<T>`
-
-Allows a user to specify the default value for a type `T` that is both copyable
-and publicly destructible (i.e. anything that can be used as a function return
-type). For mock functions with a return type of `T`, this default value is
-returned from function calls that do not specify an action.
-
-Provides the static methods `Set()`, `SetFactory()`, and `Clear()` to manage the
-default value:
-
-```cpp
-// Sets the default value to be returned. T must be copy constructible.
-DefaultValue<T>::Set(value);
-
-// Sets a factory. Will be invoked on demand. T must be move constructible.
-T MakeT();
-DefaultValue<T>::SetFactory(&MakeT);
-
-// Unsets the default value.
-DefaultValue<T>::Clear();
-```
-
-### NiceMock {#NiceMock}
-
-`::testing::NiceMock<T>`
-
-Represents a mock object that suppresses warnings on
-[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The
-template parameter `T` is any mock class, except for another `NiceMock`,
-`NaggyMock`, or `StrictMock`.
-
-Usage of `NiceMock<T>` is analogous to usage of `T`. `NiceMock<T>` is a subclass
-of `T`, so it can be used wherever an object of type `T` is accepted. In
-addition, `NiceMock<T>` can be constructed with any arguments that a constructor
-of `T` accepts.
-
-For example, the following code suppresses warnings on the mock `my_mock` of
-type `MockClass` if a method other than `DoSomething()` is called:
-
-```cpp
-using ::testing::NiceMock;
-...
-NiceMock<MockClass> my_mock("some", "args");
-EXPECT_CALL(my_mock, DoSomething());
-... code that uses my_mock ...
-```
-
-`NiceMock<T>` only works for mock methods defined using the `MOCK_METHOD` macro
-directly in the definition of class `T`. If a mock method is defined in a base
-class of `T`, a warning might still be generated.
-
-`NiceMock<T>` might not work correctly if the destructor of `T` is not virtual.
-
-### NaggyMock {#NaggyMock}
-
-`::testing::NaggyMock<T>`
-
-Represents a mock object that generates warnings on
-[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The
-template parameter `T` is any mock class, except for another `NiceMock`,
-`NaggyMock`, or `StrictMock`.
-
-Usage of `NaggyMock<T>` is analogous to usage of `T`. `NaggyMock<T>` is a
-subclass of `T`, so it can be used wherever an object of type `T` is accepted.
-In addition, `NaggyMock<T>` can be constructed with any arguments that a
-constructor of `T` accepts.
-
-For example, the following code generates warnings on the mock `my_mock` of type
-`MockClass` if a method other than `DoSomething()` is called:
-
-```cpp
-using ::testing::NaggyMock;
-...
-NaggyMock<MockClass> my_mock("some", "args");
-EXPECT_CALL(my_mock, DoSomething());
-... code that uses my_mock ...
-```
-
-Mock objects of type `T` by default behave the same way as `NaggyMock<T>`.
-
-### StrictMock {#StrictMock}
-
-`::testing::StrictMock<T>`
-
-Represents a mock object that generates test failures on
-[uninteresting calls](../gmock_cook_book.md#uninteresting-vs-unexpected). The
-template parameter `T` is any mock class, except for another `NiceMock`,
-`NaggyMock`, or `StrictMock`.
-
-Usage of `StrictMock<T>` is analogous to usage of `T`. `StrictMock<T>` is a
-subclass of `T`, so it can be used wherever an object of type `T` is accepted.
-In addition, `StrictMock<T>` can be constructed with any arguments that a
-constructor of `T` accepts.
-
-For example, the following code generates a test failure on the mock `my_mock`
-of type `MockClass` if a method other than `DoSomething()` is called:
-
-```cpp
-using ::testing::StrictMock;
-...
-StrictMock<MockClass> my_mock("some", "args");
-EXPECT_CALL(my_mock, DoSomething());
-... code that uses my_mock ...
-```
-
-`StrictMock<T>` only works for mock methods defined using the `MOCK_METHOD`
-macro directly in the definition of class `T`. If a mock method is defined in a
-base class of `T`, a failure might not be generated.
-
-`StrictMock<T>` might not work correctly if the destructor of `T` is not
-virtual.
-
-### Sequence {#Sequence}
-
-`::testing::Sequence`
-
-Represents a chronological sequence of expectations. See the
-[`InSequence`](#EXPECT_CALL.InSequence) clause of `EXPECT_CALL` for usage.
-
-### InSequence {#InSequence}
-
-`::testing::InSequence`
-
-An object of this type causes all expectations encountered in its scope to be
-put in an anonymous sequence.
-
-This allows more convenient expression of multiple expectations in a single
-sequence:
-
-```cpp
-using ::testing::InSequence;
-{
- InSequence seq;
-
- // The following are expected to occur in the order declared.
- EXPECT_CALL(...);
- EXPECT_CALL(...);
- ...
- EXPECT_CALL(...);
-}
-```
-
-The name of the `InSequence` object does not matter.
-
-### Expectation {#Expectation}
-
-`::testing::Expectation`
-
-Represents a mock function call expectation as created by
-[`EXPECT_CALL`](#EXPECT_CALL):
-
-```cpp
-using ::testing::Expectation;
-Expectation my_expectation = EXPECT_CALL(...);
-```
-
-Useful for specifying sequences of expectations; see the
-[`After`](#EXPECT_CALL.After) clause of `EXPECT_CALL`.
-
-### ExpectationSet {#ExpectationSet}
-
-`::testing::ExpectationSet`
-
-Represents a set of mock function call expectations.
-
-Use the `+=` operator to add [`Expectation`](#Expectation) objects to the set:
-
-```cpp
-using ::testing::ExpectationSet;
-ExpectationSet my_expectations;
-my_expectations += EXPECT_CALL(...);
-```
-
-Useful for specifying sequences of expectations; see the
-[`After`](#EXPECT_CALL.After) clause of `EXPECT_CALL`.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/testing.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/testing.md
deleted file mode 100644
index 554d6c9584..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/reference/testing.md
+++ /dev/null
@@ -1,1431 +0,0 @@
-# Testing Reference
-
-<!--* toc_depth: 3 *-->
-
-This page lists the facilities provided by GoogleTest for writing test programs.
-To use them, include the header `gtest/gtest.h`.
-
-## Macros
-
-GoogleTest defines the following macros for writing tests.
-
-### TEST {#TEST}
-
-<pre>
-TEST(<em>TestSuiteName</em>, <em>TestName</em>) {
- ... <em>statements</em> ...
-}
-</pre>
-
-Defines an individual test named *`TestName`* in the test suite
-*`TestSuiteName`*, consisting of the given statements.
-
-Both arguments *`TestSuiteName`* and *`TestName`* must be valid C++ identifiers
-and must not contain underscores (`_`). Tests in different test suites can have
-the same individual name.
-
-The statements within the test body can be any code under test.
-[Assertions](assertions.md) used within the test body determine the outcome of
-the test.
-
-### TEST_F {#TEST_F}
-
-<pre>
-TEST_F(<em>TestFixtureName</em>, <em>TestName</em>) {
- ... <em>statements</em> ...
-}
-</pre>
-
-Defines an individual test named *`TestName`* that uses the test fixture class
-*`TestFixtureName`*. The test suite name is *`TestFixtureName`*.
-
-Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++
-identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be
-the name of a test fixture class—see
-[Test Fixtures](../primer.md#same-data-multiple-tests).
-
-The statements within the test body can be any code under test.
-[Assertions](assertions.md) used within the test body determine the outcome of
-the test.
-
-### TEST_P {#TEST_P}
-
-<pre>
-TEST_P(<em>TestFixtureName</em>, <em>TestName</em>) {
- ... <em>statements</em> ...
-}
-</pre>
-
-Defines an individual value-parameterized test named *`TestName`* that uses the
-test fixture class *`TestFixtureName`*. The test suite name is
-*`TestFixtureName`*.
-
-Both arguments *`TestFixtureName`* and *`TestName`* must be valid C++
-identifiers and must not contain underscores (`_`). *`TestFixtureName`* must be
-the name of a value-parameterized test fixture class—see
-[Value-Parameterized Tests](../advanced.md#value-parameterized-tests).
-
-The statements within the test body can be any code under test. Within the test
-body, the test parameter can be accessed with the `GetParam()` function (see
-[`WithParamInterface`](#WithParamInterface)). For example:
-
-```cpp
-TEST_P(MyTestSuite, DoesSomething) {
- ...
- EXPECT_TRUE(DoSomething(GetParam()));
- ...
-}
-```
-
-[Assertions](assertions.md) used within the test body determine the outcome of
-the test.
-
-See also [`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P).
-
-### INSTANTIATE_TEST_SUITE_P {#INSTANTIATE_TEST_SUITE_P}
-
-`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`)`
-\
-`INSTANTIATE_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`param_generator`*`,`*`name_generator`*`)`
-
-Instantiates the value-parameterized test suite *`TestSuiteName`* (defined with
-[`TEST_P`](#TEST_P)).
-
-The argument *`InstantiationName`* is a unique name for the instantiation of the
-test suite, to distinguish between multiple instantiations. In test output, the
-instantiation name is added as a prefix to the test suite name
-*`TestSuiteName`*.
-
-The argument *`param_generator`* is one of the following GoogleTest-provided
-functions that generate the test parameters, all defined in the `::testing`
-namespace:
-
-<span id="param-generators"></span>
-
-| Parameter Generator | Behavior |
-| ------------------- | ---------------------------------------------------- |
-| `Range(begin, end [, step])` | Yields values `{begin, begin+step, begin+step+step, ...}`. The values do not include `end`. `step` defaults to 1. |
-| `Values(v1, v2, ..., vN)` | Yields values `{v1, v2, ..., vN}`. |
-| `ValuesIn(container)` or `ValuesIn(begin,end)` | Yields values from a C-style array, an STL-style container, or an iterator range `[begin, end)`. |
-| `Bool()` | Yields sequence `{false, true}`. |
-| `Combine(g1, g2, ..., gN)` | Yields as `std::tuple` *n*-tuples all combinations (Cartesian product) of the values generated by the given *n* generators `g1`, `g2`, ..., `gN`. |
-
-The optional last argument *`name_generator`* is a function or functor that
-generates custom test name suffixes based on the test parameters. The function
-must accept an argument of type
-[`TestParamInfo<class ParamType>`](#TestParamInfo) and return a `std::string`.
-The test name suffix can only contain alphanumeric characters and underscores.
-GoogleTest provides [`PrintToStringParamName`](#PrintToStringParamName), or a
-custom function can be used for more control:
-
-```cpp
-INSTANTIATE_TEST_SUITE_P(
- MyInstantiation, MyTestSuite,
- ::testing::Values(...),
- [](const ::testing::TestParamInfo<MyTestSuite::ParamType>& info) {
- // Can use info.param here to generate the test suffix
- std::string name = ...
- return name;
- });
-```
-
-For more information, see
-[Value-Parameterized Tests](../advanced.md#value-parameterized-tests).
-
-See also
-[`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST`](#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST).
-
-### TYPED_TEST_SUITE {#TYPED_TEST_SUITE}
-
-`TYPED_TEST_SUITE(`*`TestFixtureName`*`,`*`Types`*`)`
-
-Defines a typed test suite based on the test fixture *`TestFixtureName`*. The
-test suite name is *`TestFixtureName`*.
-
-The argument *`TestFixtureName`* is a fixture class template, parameterized by a
-type, for example:
-
-```cpp
-template <typename T>
-class MyFixture : public ::testing::Test {
- public:
- ...
- using List = std::list<T>;
- static T shared_;
- T value_;
-};
-```
-
-The argument *`Types`* is a [`Types`](#Types) object representing the list of
-types to run the tests on, for example:
-
-```cpp
-using MyTypes = ::testing::Types<char, int, unsigned int>;
-TYPED_TEST_SUITE(MyFixture, MyTypes);
-```
-
-The type alias (`using` or `typedef`) is necessary for the `TYPED_TEST_SUITE`
-macro to parse correctly.
-
-See also [`TYPED_TEST`](#TYPED_TEST) and
-[Typed Tests](../advanced.md#typed-tests) for more information.
-
-### TYPED_TEST {#TYPED_TEST}
-
-<pre>
-TYPED_TEST(<em>TestSuiteName</em>, <em>TestName</em>) {
- ... <em>statements</em> ...
-}
-</pre>
-
-Defines an individual typed test named *`TestName`* in the typed test suite
-*`TestSuiteName`*. The test suite must be defined with
-[`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE).
-
-Within the test body, the special name `TypeParam` refers to the type parameter,
-and `TestFixture` refers to the fixture class. See the following example:
-
-```cpp
-TYPED_TEST(MyFixture, Example) {
- // Inside a test, refer to the special name TypeParam to get the type
- // parameter. Since we are inside a derived class template, C++ requires
- // us to visit the members of MyFixture via 'this'.
- TypeParam n = this->value_;
-
- // To visit static members of the fixture, add the 'TestFixture::'
- // prefix.
- n += TestFixture::shared_;
-
- // To refer to typedefs in the fixture, add the 'typename TestFixture::'
- // prefix. The 'typename' is required to satisfy the compiler.
- typename TestFixture::List values;
-
- values.push_back(n);
- ...
-}
-```
-
-For more information, see [Typed Tests](../advanced.md#typed-tests).
-
-### TYPED_TEST_SUITE_P {#TYPED_TEST_SUITE_P}
-
-`TYPED_TEST_SUITE_P(`*`TestFixtureName`*`)`
-
-Defines a type-parameterized test suite based on the test fixture
-*`TestFixtureName`*. The test suite name is *`TestFixtureName`*.
-
-The argument *`TestFixtureName`* is a fixture class template, parameterized by a
-type. See [`TYPED_TEST_SUITE`](#TYPED_TEST_SUITE) for an example.
-
-See also [`TYPED_TEST_P`](#TYPED_TEST_P) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more
-information.
-
-### TYPED_TEST_P {#TYPED_TEST_P}
-
-<pre>
-TYPED_TEST_P(<em>TestSuiteName</em>, <em>TestName</em>) {
- ... <em>statements</em> ...
-}
-</pre>
-
-Defines an individual type-parameterized test named *`TestName`* in the
-type-parameterized test suite *`TestSuiteName`*. The test suite must be defined
-with [`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P).
-
-Within the test body, the special name `TypeParam` refers to the type parameter,
-and `TestFixture` refers to the fixture class. See [`TYPED_TEST`](#TYPED_TEST)
-for an example.
-
-See also [`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more
-information.
-
-### REGISTER_TYPED_TEST_SUITE_P {#REGISTER_TYPED_TEST_SUITE_P}
-
-`REGISTER_TYPED_TEST_SUITE_P(`*`TestSuiteName`*`,`*`TestNames...`*`)`
-
-Registers the type-parameterized tests *`TestNames...`* of the test suite
-*`TestSuiteName`*. The test suite and tests must be defined with
-[`TYPED_TEST_SUITE_P`](#TYPED_TEST_SUITE_P) and [`TYPED_TEST_P`](#TYPED_TEST_P).
-
-For example:
-
-```cpp
-// Define the test suite and tests.
-TYPED_TEST_SUITE_P(MyFixture);
-TYPED_TEST_P(MyFixture, HasPropertyA) { ... }
-TYPED_TEST_P(MyFixture, HasPropertyB) { ... }
-
-// Register the tests in the test suite.
-REGISTER_TYPED_TEST_SUITE_P(MyFixture, HasPropertyA, HasPropertyB);
-```
-
-See also [`INSTANTIATE_TYPED_TEST_SUITE_P`](#INSTANTIATE_TYPED_TEST_SUITE_P) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more
-information.
-
-### INSTANTIATE_TYPED_TEST_SUITE_P {#INSTANTIATE_TYPED_TEST_SUITE_P}
-
-`INSTANTIATE_TYPED_TEST_SUITE_P(`*`InstantiationName`*`,`*`TestSuiteName`*`,`*`Types`*`)`
-
-Instantiates the type-parameterized test suite *`TestSuiteName`*. The test suite
-must be registered with
-[`REGISTER_TYPED_TEST_SUITE_P`](#REGISTER_TYPED_TEST_SUITE_P).
-
-The argument *`InstantiationName`* is a unique name for the instantiation of the
-test suite, to distinguish between multiple instantiations. In test output, the
-instantiation name is added as a prefix to the test suite name
-*`TestSuiteName`*.
-
-The argument *`Types`* is a [`Types`](#Types) object representing the list of
-types to run the tests on, for example:
-
-```cpp
-using MyTypes = ::testing::Types<char, int, unsigned int>;
-INSTANTIATE_TYPED_TEST_SUITE_P(MyInstantiation, MyFixture, MyTypes);
-```
-
-The type alias (`using` or `typedef`) is necessary for the
-`INSTANTIATE_TYPED_TEST_SUITE_P` macro to parse correctly.
-
-For more information, see
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests).
-
-### FRIEND_TEST {#FRIEND_TEST}
-
-`FRIEND_TEST(`*`TestSuiteName`*`,`*`TestName`*`)`
-
-Within a class body, declares an individual test as a friend of the class,
-enabling the test to access private class members.
-
-If the class is defined in a namespace, then in order to be friends of the
-class, test fixtures and tests must be defined in the exact same namespace,
-without inline or anonymous namespaces.
-
-For example, if the class definition looks like the following:
-
-```cpp
-namespace my_namespace {
-
-class MyClass {
- friend class MyClassTest;
- FRIEND_TEST(MyClassTest, HasPropertyA);
- FRIEND_TEST(MyClassTest, HasPropertyB);
- ... definition of class MyClass ...
-};
-
-} // namespace my_namespace
-```
-
-Then the test code should look like:
-
-```cpp
-namespace my_namespace {
-
-class MyClassTest : public ::testing::Test {
- ...
-};
-
-TEST_F(MyClassTest, HasPropertyA) { ... }
-TEST_F(MyClassTest, HasPropertyB) { ... }
-
-} // namespace my_namespace
-```
-
-See [Testing Private Code](../advanced.md#testing-private-code) for more
-information.
-
-### SCOPED_TRACE {#SCOPED_TRACE}
-
-`SCOPED_TRACE(`*`message`*`)`
-
-Causes the current file name, line number, and the given message *`message`* to
-be added to the failure message for each assertion failure that occurs in the
-scope.
-
-For more information, see
-[Adding Traces to Assertions](../advanced.md#adding-traces-to-assertions).
-
-See also the [`ScopedTrace` class](#ScopedTrace).
-
-### GTEST_SKIP {#GTEST_SKIP}
-
-`GTEST_SKIP()`
-
-Prevents further test execution at runtime.
-
-Can be used in individual test cases or in the `SetUp()` methods of test
-environments or test fixtures (classes derived from the
-[`Environment`](#Environment) or [`Test`](#Test) classes). If used in a global
-test environment `SetUp()` method, it skips all tests in the test program. If
-used in a test fixture `SetUp()` method, it skips all tests in the corresponding
-test suite.
-
-Similar to assertions, `GTEST_SKIP` allows streaming a custom message into it.
-
-See [Skipping Test Execution](../advanced.md#skipping-test-execution) for more
-information.
-
-### GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST {#GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST}
-
-`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(`*`TestSuiteName`*`)`
-
-Allows the value-parameterized test suite *`TestSuiteName`* to be
-uninstantiated.
-
-By default, every [`TEST_P`](#TEST_P) call without a corresponding
-[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P) call causes a failing
-test in the test suite `GoogleTestVerification`.
-`GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST` suppresses this failure for the
-given test suite.
-
-## Classes and types
-
-GoogleTest defines the following classes and types to help with writing tests.
-
-### AssertionResult {#AssertionResult}
-
-`::testing::AssertionResult`
-
-A class for indicating whether an assertion was successful.
-
-When the assertion wasn't successful, the `AssertionResult` object stores a
-non-empty failure message that can be retrieved with the object's `message()`
-method.
-
-To create an instance of this class, use one of the factory functions
-[`AssertionSuccess()`](#AssertionSuccess) or
-[`AssertionFailure()`](#AssertionFailure).
-
-### AssertionException {#AssertionException}
-
-`::testing::AssertionException`
-
-Exception which can be thrown from
-[`TestEventListener::OnTestPartResult`](#TestEventListener::OnTestPartResult).
-
-### EmptyTestEventListener {#EmptyTestEventListener}
-
-`::testing::EmptyTestEventListener`
-
-Provides an empty implementation of all methods in the
-[`TestEventListener`](#TestEventListener) interface, such that a subclass only
-needs to override the methods it cares about.
-
-### Environment {#Environment}
-
-`::testing::Environment`
-
-Represents a global test environment. See
-[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down).
-
-#### Protected Methods {#Environment-protected}
-
-##### SetUp {#Environment::SetUp}
-
-`virtual void Environment::SetUp()`
-
-Override this to define how to set up the environment.
-
-##### TearDown {#Environment::TearDown}
-
-`virtual void Environment::TearDown()`
-
-Override this to define how to tear down the environment.
-
-### ScopedTrace {#ScopedTrace}
-
-`::testing::ScopedTrace`
-
-An instance of this class causes a trace to be included in every test failure
-message generated by code in the scope of the lifetime of the `ScopedTrace`
-instance. The effect is undone with the destruction of the instance.
-
-The `ScopedTrace` constructor has the following form:
-
-```cpp
-template <typename T>
-ScopedTrace(const char* file, int line, const T& message)
-```
-
-Example usage:
-
-```cpp
-::testing::ScopedTrace trace("file.cc", 123, "message");
-```
-
-The resulting trace includes the given source file path and line number, and the
-given message. The `message` argument can be anything streamable to
-`std::ostream`.
-
-See also [`SCOPED_TRACE`](#SCOPED_TRACE).
-
-### Test {#Test}
-
-`::testing::Test`
-
-The abstract class that all tests inherit from. `Test` is not copyable.
-
-#### Public Methods {#Test-public}
-
-##### SetUpTestSuite {#Test::SetUpTestSuite}
-
-`static void Test::SetUpTestSuite()`
-
-Performs shared setup for all tests in the test suite. GoogleTest calls
-`SetUpTestSuite()` before running the first test in the test suite.
-
-##### TearDownTestSuite {#Test::TearDownTestSuite}
-
-`static void Test::TearDownTestSuite()`
-
-Performs shared teardown for all tests in the test suite. GoogleTest calls
-`TearDownTestSuite()` after running the last test in the test suite.
-
-##### HasFatalFailure {#Test::HasFatalFailure}
-
-`static bool Test::HasFatalFailure()`
-
-Returns true if and only if the current test has a fatal failure.
-
-##### HasNonfatalFailure {#Test::HasNonfatalFailure}
-
-`static bool Test::HasNonfatalFailure()`
-
-Returns true if and only if the current test has a nonfatal failure.
-
-##### HasFailure {#Test::HasFailure}
-
-`static bool Test::HasFailure()`
-
-Returns true if and only if the current test has any failure, either fatal or
-nonfatal.
-
-##### IsSkipped {#Test::IsSkipped}
-
-`static bool Test::IsSkipped()`
-
-Returns true if and only if the current test was skipped.
-
-##### RecordProperty {#Test::RecordProperty}
-
-`static void Test::RecordProperty(const std::string& key, const std::string&
-value)` \
-`static void Test::RecordProperty(const std::string& key, int value)`
-
-Logs a property for the current test, test suite, or entire invocation of the
-test program. Only the last value for a given key is logged.
-
-The key must be a valid XML attribute name, and cannot conflict with the ones
-already used by GoogleTest (`name`, `status`, `time`, `classname`, `type_param`,
-and `value_param`).
-
-`RecordProperty` is `public static` so it can be called from utility functions
-that are not members of the test fixture.
-
-Calls to `RecordProperty` made during the lifespan of the test (from the moment
-its constructor starts to the moment its destructor finishes) are output in XML
-as attributes of the `<testcase>` element. Properties recorded from a fixture's
-`SetUpTestSuite` or `TearDownTestSuite` methods are logged as attributes of the
-corresponding `<testsuite>` element. Calls to `RecordProperty` made in the
-global context (before or after invocation of `RUN_ALL_TESTS` or from the
-`SetUp`/`TearDown` methods of registered `Environment` objects) are output as
-attributes of the `<testsuites>` element.
-
-#### Protected Methods {#Test-protected}
-
-##### SetUp {#Test::SetUp}
-
-`virtual void Test::SetUp()`
-
-Override this to perform test fixture setup. GoogleTest calls `SetUp()` before
-running each individual test.
-
-##### TearDown {#Test::TearDown}
-
-`virtual void Test::TearDown()`
-
-Override this to perform test fixture teardown. GoogleTest calls `TearDown()`
-after running each individual test.
-
-### TestWithParam {#TestWithParam}
-
-`::testing::TestWithParam<T>`
-
-A convenience class which inherits from both [`Test`](#Test) and
-[`WithParamInterface<T>`](#WithParamInterface).
-
-### TestSuite {#TestSuite}
-
-Represents a test suite. `TestSuite` is not copyable.
-
-#### Public Methods {#TestSuite-public}
-
-##### name {#TestSuite::name}
-
-`const char* TestSuite::name() const`
-
-Gets the name of the test suite.
-
-##### type_param {#TestSuite::type_param}
-
-`const char* TestSuite::type_param() const`
-
-Returns the name of the parameter type, or `NULL` if this is not a typed or
-type-parameterized test suite. See [Typed Tests](../advanced.md#typed-tests) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests).
-
-##### should_run {#TestSuite::should_run}
-
-`bool TestSuite::should_run() const`
-
-Returns true if any test in this test suite should run.
-
-##### successful_test_count {#TestSuite::successful_test_count}
-
-`int TestSuite::successful_test_count() const`
-
-Gets the number of successful tests in this test suite.
-
-##### skipped_test_count {#TestSuite::skipped_test_count}
-
-`int TestSuite::skipped_test_count() const`
-
-Gets the number of skipped tests in this test suite.
-
-##### failed_test_count {#TestSuite::failed_test_count}
-
-`int TestSuite::failed_test_count() const`
-
-Gets the number of failed tests in this test suite.
-
-##### reportable_disabled_test_count {#TestSuite::reportable_disabled_test_count}
-
-`int TestSuite::reportable_disabled_test_count() const`
-
-Gets the number of disabled tests that will be reported in the XML report.
-
-##### disabled_test_count {#TestSuite::disabled_test_count}
-
-`int TestSuite::disabled_test_count() const`
-
-Gets the number of disabled tests in this test suite.
-
-##### reportable_test_count {#TestSuite::reportable_test_count}
-
-`int TestSuite::reportable_test_count() const`
-
-Gets the number of tests to be printed in the XML report.
-
-##### test_to_run_count {#TestSuite::test_to_run_count}
-
-`int TestSuite::test_to_run_count() const`
-
-Get the number of tests in this test suite that should run.
-
-##### total_test_count {#TestSuite::total_test_count}
-
-`int TestSuite::total_test_count() const`
-
-Gets the number of all tests in this test suite.
-
-##### Passed {#TestSuite::Passed}
-
-`bool TestSuite::Passed() const`
-
-Returns true if and only if the test suite passed.
-
-##### Failed {#TestSuite::Failed}
-
-`bool TestSuite::Failed() const`
-
-Returns true if and only if the test suite failed.
-
-##### elapsed_time {#TestSuite::elapsed_time}
-
-`TimeInMillis TestSuite::elapsed_time() const`
-
-Returns the elapsed time, in milliseconds.
-
-##### start_timestamp {#TestSuite::start_timestamp}
-
-`TimeInMillis TestSuite::start_timestamp() const`
-
-Gets the time of the test suite start, in ms from the start of the UNIX epoch.
-
-##### GetTestInfo {#TestSuite::GetTestInfo}
-
-`const TestInfo* TestSuite::GetTestInfo(int i) const`
-
-Returns the [`TestInfo`](#TestInfo) for the `i`-th test among all the tests. `i`
-can range from 0 to `total_test_count() - 1`. If `i` is not in that range,
-returns `NULL`.
-
-##### ad_hoc_test_result {#TestSuite::ad_hoc_test_result}
-
-`const TestResult& TestSuite::ad_hoc_test_result() const`
-
-Returns the [`TestResult`](#TestResult) that holds test properties recorded
-during execution of `SetUpTestSuite` and `TearDownTestSuite`.
-
-### TestInfo {#TestInfo}
-
-`::testing::TestInfo`
-
-Stores information about a test.
-
-#### Public Methods {#TestInfo-public}
-
-##### test_suite_name {#TestInfo::test_suite_name}
-
-`const char* TestInfo::test_suite_name() const`
-
-Returns the test suite name.
-
-##### name {#TestInfo::name}
-
-`const char* TestInfo::name() const`
-
-Returns the test name.
-
-##### type_param {#TestInfo::type_param}
-
-`const char* TestInfo::type_param() const`
-
-Returns the name of the parameter type, or `NULL` if this is not a typed or
-type-parameterized test. See [Typed Tests](../advanced.md#typed-tests) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests).
-
-##### value_param {#TestInfo::value_param}
-
-`const char* TestInfo::value_param() const`
-
-Returns the text representation of the value parameter, or `NULL` if this is not
-a value-parameterized test. See
-[Value-Parameterized Tests](../advanced.md#value-parameterized-tests).
-
-##### file {#TestInfo::file}
-
-`const char* TestInfo::file() const`
-
-Returns the file name where this test is defined.
-
-##### line {#TestInfo::line}
-
-`int TestInfo::line() const`
-
-Returns the line where this test is defined.
-
-##### is_in_another_shard {#TestInfo::is_in_another_shard}
-
-`bool TestInfo::is_in_another_shard() const`
-
-Returns true if this test should not be run because it's in another shard.
-
-##### should_run {#TestInfo::should_run}
-
-`bool TestInfo::should_run() const`
-
-Returns true if this test should run, that is if the test is not disabled (or it
-is disabled but the `also_run_disabled_tests` flag has been specified) and its
-full name matches the user-specified filter.
-
-GoogleTest allows the user to filter the tests by their full names. Only the
-tests that match the filter will run. See
-[Running a Subset of the Tests](../advanced.md#running-a-subset-of-the-tests)
-for more information.
-
-##### is_reportable {#TestInfo::is_reportable}
-
-`bool TestInfo::is_reportable() const`
-
-Returns true if and only if this test will appear in the XML report.
-
-##### result {#TestInfo::result}
-
-`const TestResult* TestInfo::result() const`
-
-Returns the result of the test. See [`TestResult`](#TestResult).
-
-### TestParamInfo {#TestParamInfo}
-
-`::testing::TestParamInfo<T>`
-
-Describes a parameter to a value-parameterized test. The type `T` is the type of
-the parameter.
-
-Contains the fields `param` and `index` which hold the value of the parameter
-and its integer index respectively.
-
-### UnitTest {#UnitTest}
-
-`::testing::UnitTest`
-
-This class contains information about the test program.
-
-`UnitTest` is a singleton class. The only instance is created when
-`UnitTest::GetInstance()` is first called. This instance is never deleted.
-
-`UnitTest` is not copyable.
-
-#### Public Methods {#UnitTest-public}
-
-##### GetInstance {#UnitTest::GetInstance}
-
-`static UnitTest* UnitTest::GetInstance()`
-
-Gets the singleton `UnitTest` object. The first time this method is called, a
-`UnitTest` object is constructed and returned. Consecutive calls will return the
-same object.
-
-##### original_working_dir {#UnitTest::original_working_dir}
-
-`const char* UnitTest::original_working_dir() const`
-
-Returns the working directory when the first [`TEST()`](#TEST) or
-[`TEST_F()`](#TEST_F) was executed. The `UnitTest` object owns the string.
-
-##### current_test_suite {#UnitTest::current_test_suite}
-
-`const TestSuite* UnitTest::current_test_suite() const`
-
-Returns the [`TestSuite`](#TestSuite) object for the test that's currently
-running, or `NULL` if no test is running.
-
-##### current_test_info {#UnitTest::current_test_info}
-
-`const TestInfo* UnitTest::current_test_info() const`
-
-Returns the [`TestInfo`](#TestInfo) object for the test that's currently
-running, or `NULL` if no test is running.
-
-##### random_seed {#UnitTest::random_seed}
-
-`int UnitTest::random_seed() const`
-
-Returns the random seed used at the start of the current test run.
-
-##### successful_test_suite_count {#UnitTest::successful_test_suite_count}
-
-`int UnitTest::successful_test_suite_count() const`
-
-Gets the number of successful test suites.
-
-##### failed_test_suite_count {#UnitTest::failed_test_suite_count}
-
-`int UnitTest::failed_test_suite_count() const`
-
-Gets the number of failed test suites.
-
-##### total_test_suite_count {#UnitTest::total_test_suite_count}
-
-`int UnitTest::total_test_suite_count() const`
-
-Gets the number of all test suites.
-
-##### test_suite_to_run_count {#UnitTest::test_suite_to_run_count}
-
-`int UnitTest::test_suite_to_run_count() const`
-
-Gets the number of all test suites that contain at least one test that should
-run.
-
-##### successful_test_count {#UnitTest::successful_test_count}
-
-`int UnitTest::successful_test_count() const`
-
-Gets the number of successful tests.
-
-##### skipped_test_count {#UnitTest::skipped_test_count}
-
-`int UnitTest::skipped_test_count() const`
-
-Gets the number of skipped tests.
-
-##### failed_test_count {#UnitTest::failed_test_count}
-
-`int UnitTest::failed_test_count() const`
-
-Gets the number of failed tests.
-
-##### reportable_disabled_test_count {#UnitTest::reportable_disabled_test_count}
-
-`int UnitTest::reportable_disabled_test_count() const`
-
-Gets the number of disabled tests that will be reported in the XML report.
-
-##### disabled_test_count {#UnitTest::disabled_test_count}
-
-`int UnitTest::disabled_test_count() const`
-
-Gets the number of disabled tests.
-
-##### reportable_test_count {#UnitTest::reportable_test_count}
-
-`int UnitTest::reportable_test_count() const`
-
-Gets the number of tests to be printed in the XML report.
-
-##### total_test_count {#UnitTest::total_test_count}
-
-`int UnitTest::total_test_count() const`
-
-Gets the number of all tests.
-
-##### test_to_run_count {#UnitTest::test_to_run_count}
-
-`int UnitTest::test_to_run_count() const`
-
-Gets the number of tests that should run.
-
-##### start_timestamp {#UnitTest::start_timestamp}
-
-`TimeInMillis UnitTest::start_timestamp() const`
-
-Gets the time of the test program start, in ms from the start of the UNIX epoch.
-
-##### elapsed_time {#UnitTest::elapsed_time}
-
-`TimeInMillis UnitTest::elapsed_time() const`
-
-Gets the elapsed time, in milliseconds.
-
-##### Passed {#UnitTest::Passed}
-
-`bool UnitTest::Passed() const`
-
-Returns true if and only if the unit test passed (i.e. all test suites passed).
-
-##### Failed {#UnitTest::Failed}
-
-`bool UnitTest::Failed() const`
-
-Returns true if and only if the unit test failed (i.e. some test suite failed or
-something outside of all tests failed).
-
-##### GetTestSuite {#UnitTest::GetTestSuite}
-
-`const TestSuite* UnitTest::GetTestSuite(int i) const`
-
-Gets the [`TestSuite`](#TestSuite) object for the `i`-th test suite among all
-the test suites. `i` can range from 0 to `total_test_suite_count() - 1`. If `i`
-is not in that range, returns `NULL`.
-
-##### ad_hoc_test_result {#UnitTest::ad_hoc_test_result}
-
-`const TestResult& UnitTest::ad_hoc_test_result() const`
-
-Returns the [`TestResult`](#TestResult) containing information on test failures
-and properties logged outside of individual test suites.
-
-##### listeners {#UnitTest::listeners}
-
-`TestEventListeners& UnitTest::listeners()`
-
-Returns the list of event listeners that can be used to track events inside
-GoogleTest. See [`TestEventListeners`](#TestEventListeners).
-
-### TestEventListener {#TestEventListener}
-
-`::testing::TestEventListener`
-
-The interface for tracing execution of tests. The methods below are listed in
-the order the corresponding events are fired.
-
-#### Public Methods {#TestEventListener-public}
-
-##### OnTestProgramStart {#TestEventListener::OnTestProgramStart}
-
-`virtual void TestEventListener::OnTestProgramStart(const UnitTest& unit_test)`
-
-Fired before any test activity starts.
-
-##### OnTestIterationStart {#TestEventListener::OnTestIterationStart}
-
-`virtual void TestEventListener::OnTestIterationStart(const UnitTest& unit_test,
-int iteration)`
-
-Fired before each iteration of tests starts. There may be more than one
-iteration if `GTEST_FLAG(repeat)` is set. `iteration` is the iteration index,
-starting from 0.
-
-##### OnEnvironmentsSetUpStart {#TestEventListener::OnEnvironmentsSetUpStart}
-
-`virtual void TestEventListener::OnEnvironmentsSetUpStart(const UnitTest&
-unit_test)`
-
-Fired before environment set-up for each iteration of tests starts.
-
-##### OnEnvironmentsSetUpEnd {#TestEventListener::OnEnvironmentsSetUpEnd}
-
-`virtual void TestEventListener::OnEnvironmentsSetUpEnd(const UnitTest&
-unit_test)`
-
-Fired after environment set-up for each iteration of tests ends.
-
-##### OnTestSuiteStart {#TestEventListener::OnTestSuiteStart}
-
-`virtual void TestEventListener::OnTestSuiteStart(const TestSuite& test_suite)`
-
-Fired before the test suite starts.
-
-##### OnTestStart {#TestEventListener::OnTestStart}
-
-`virtual void TestEventListener::OnTestStart(const TestInfo& test_info)`
-
-Fired before the test starts.
-
-##### OnTestPartResult {#TestEventListener::OnTestPartResult}
-
-`virtual void TestEventListener::OnTestPartResult(const TestPartResult&
-test_part_result)`
-
-Fired after a failed assertion or a `SUCCEED()` invocation. If you want to throw
-an exception from this function to skip to the next test, it must be an
-[`AssertionException`](#AssertionException) or inherited from it.
-
-##### OnTestEnd {#TestEventListener::OnTestEnd}
-
-`virtual void TestEventListener::OnTestEnd(const TestInfo& test_info)`
-
-Fired after the test ends.
-
-##### OnTestSuiteEnd {#TestEventListener::OnTestSuiteEnd}
-
-`virtual void TestEventListener::OnTestSuiteEnd(const TestSuite& test_suite)`
-
-Fired after the test suite ends.
-
-##### OnEnvironmentsTearDownStart {#TestEventListener::OnEnvironmentsTearDownStart}
-
-`virtual void TestEventListener::OnEnvironmentsTearDownStart(const UnitTest&
-unit_test)`
-
-Fired before environment tear-down for each iteration of tests starts.
-
-##### OnEnvironmentsTearDownEnd {#TestEventListener::OnEnvironmentsTearDownEnd}
-
-`virtual void TestEventListener::OnEnvironmentsTearDownEnd(const UnitTest&
-unit_test)`
-
-Fired after environment tear-down for each iteration of tests ends.
-
-##### OnTestIterationEnd {#TestEventListener::OnTestIterationEnd}
-
-`virtual void TestEventListener::OnTestIterationEnd(const UnitTest& unit_test,
-int iteration)`
-
-Fired after each iteration of tests finishes.
-
-##### OnTestProgramEnd {#TestEventListener::OnTestProgramEnd}
-
-`virtual void TestEventListener::OnTestProgramEnd(const UnitTest& unit_test)`
-
-Fired after all test activities have ended.
-
-### TestEventListeners {#TestEventListeners}
-
-`::testing::TestEventListeners`
-
-Lets users add listeners to track events in GoogleTest.
-
-#### Public Methods {#TestEventListeners-public}
-
-##### Append {#TestEventListeners::Append}
-
-`void TestEventListeners::Append(TestEventListener* listener)`
-
-Appends an event listener to the end of the list. GoogleTest assumes ownership
-of the listener (i.e. it will delete the listener when the test program
-finishes).
-
-##### Release {#TestEventListeners::Release}
-
-`TestEventListener* TestEventListeners::Release(TestEventListener* listener)`
-
-Removes the given event listener from the list and returns it. It then becomes
-the caller's responsibility to delete the listener. Returns `NULL` if the
-listener is not found in the list.
-
-##### default_result_printer {#TestEventListeners::default_result_printer}
-
-`TestEventListener* TestEventListeners::default_result_printer() const`
-
-Returns the standard listener responsible for the default console output. Can be
-removed from the listeners list to shut down default console output. Note that
-removing this object from the listener list with
-[`Release()`](#TestEventListeners::Release) transfers its ownership to the
-caller and makes this function return `NULL` the next time.
-
-##### default_xml_generator {#TestEventListeners::default_xml_generator}
-
-`TestEventListener* TestEventListeners::default_xml_generator() const`
-
-Returns the standard listener responsible for the default XML output controlled
-by the `--gtest_output=xml` flag. Can be removed from the listeners list by
-users who want to shut down the default XML output controlled by this flag and
-substitute it with custom one. Note that removing this object from the listener
-list with [`Release()`](#TestEventListeners::Release) transfers its ownership to
-the caller and makes this function return `NULL` the next time.
-
-### TestPartResult {#TestPartResult}
-
-`::testing::TestPartResult`
-
-A copyable object representing the result of a test part (i.e. an assertion or
-an explicit `FAIL()`, `ADD_FAILURE()`, or `SUCCESS()`).
-
-#### Public Methods {#TestPartResult-public}
-
-##### type {#TestPartResult::type}
-
-`Type TestPartResult::type() const`
-
-Gets the outcome of the test part.
-
-The return type `Type` is an enum defined as follows:
-
-```cpp
-enum Type {
- kSuccess, // Succeeded.
- kNonFatalFailure, // Failed but the test can continue.
- kFatalFailure, // Failed and the test should be terminated.
- kSkip // Skipped.
-};
-```
-
-##### file_name {#TestPartResult::file_name}
-
-`const char* TestPartResult::file_name() const`
-
-Gets the name of the source file where the test part took place, or `NULL` if
-it's unknown.
-
-##### line_number {#TestPartResult::line_number}
-
-`int TestPartResult::line_number() const`
-
-Gets the line in the source file where the test part took place, or `-1` if it's
-unknown.
-
-##### summary {#TestPartResult::summary}
-
-`const char* TestPartResult::summary() const`
-
-Gets the summary of the failure message.
-
-##### message {#TestPartResult::message}
-
-`const char* TestPartResult::message() const`
-
-Gets the message associated with the test part.
-
-##### skipped {#TestPartResult::skipped}
-
-`bool TestPartResult::skipped() const`
-
-Returns true if and only if the test part was skipped.
-
-##### passed {#TestPartResult::passed}
-
-`bool TestPartResult::passed() const`
-
-Returns true if and only if the test part passed.
-
-##### nonfatally_failed {#TestPartResult::nonfatally_failed}
-
-`bool TestPartResult::nonfatally_failed() const`
-
-Returns true if and only if the test part non-fatally failed.
-
-##### fatally_failed {#TestPartResult::fatally_failed}
-
-`bool TestPartResult::fatally_failed() const`
-
-Returns true if and only if the test part fatally failed.
-
-##### failed {#TestPartResult::failed}
-
-`bool TestPartResult::failed() const`
-
-Returns true if and only if the test part failed.
-
-### TestProperty {#TestProperty}
-
-`::testing::TestProperty`
-
-A copyable object representing a user-specified test property which can be
-output as a key/value string pair.
-
-#### Public Methods {#TestProperty-public}
-
-##### key {#key}
-
-`const char* key() const`
-
-Gets the user-supplied key.
-
-##### value {#value}
-
-`const char* value() const`
-
-Gets the user-supplied value.
-
-##### SetValue {#SetValue}
-
-`void SetValue(const std::string& new_value)`
-
-Sets a new value, overriding the previous one.
-
-### TestResult {#TestResult}
-
-`::testing::TestResult`
-
-Contains information about the result of a single test.
-
-`TestResult` is not copyable.
-
-#### Public Methods {#TestResult-public}
-
-##### total_part_count {#TestResult::total_part_count}
-
-`int TestResult::total_part_count() const`
-
-Gets the number of all test parts. This is the sum of the number of successful
-test parts and the number of failed test parts.
-
-##### test_property_count {#TestResult::test_property_count}
-
-`int TestResult::test_property_count() const`
-
-Returns the number of test properties.
-
-##### Passed {#TestResult::Passed}
-
-`bool TestResult::Passed() const`
-
-Returns true if and only if the test passed (i.e. no test part failed).
-
-##### Skipped {#TestResult::Skipped}
-
-`bool TestResult::Skipped() const`
-
-Returns true if and only if the test was skipped.
-
-##### Failed {#TestResult::Failed}
-
-`bool TestResult::Failed() const`
-
-Returns true if and only if the test failed.
-
-##### HasFatalFailure {#TestResult::HasFatalFailure}
-
-`bool TestResult::HasFatalFailure() const`
-
-Returns true if and only if the test fatally failed.
-
-##### HasNonfatalFailure {#TestResult::HasNonfatalFailure}
-
-`bool TestResult::HasNonfatalFailure() const`
-
-Returns true if and only if the test has a non-fatal failure.
-
-##### elapsed_time {#TestResult::elapsed_time}
-
-`TimeInMillis TestResult::elapsed_time() const`
-
-Returns the elapsed time, in milliseconds.
-
-##### start_timestamp {#TestResult::start_timestamp}
-
-`TimeInMillis TestResult::start_timestamp() const`
-
-Gets the time of the test case start, in ms from the start of the UNIX epoch.
-
-##### GetTestPartResult {#TestResult::GetTestPartResult}
-
-`const TestPartResult& TestResult::GetTestPartResult(int i) const`
-
-Returns the [`TestPartResult`](#TestPartResult) for the `i`-th test part result
-among all the results. `i` can range from 0 to `total_part_count() - 1`. If `i`
-is not in that range, aborts the program.
-
-##### GetTestProperty {#TestResult::GetTestProperty}
-
-`const TestProperty& TestResult::GetTestProperty(int i) const`
-
-Returns the [`TestProperty`](#TestProperty) object for the `i`-th test property.
-`i` can range from 0 to `test_property_count() - 1`. If `i` is not in that
-range, aborts the program.
-
-### TimeInMillis {#TimeInMillis}
-
-`::testing::TimeInMillis`
-
-An integer type representing time in milliseconds.
-
-### Types {#Types}
-
-`::testing::Types<T...>`
-
-Represents a list of types for use in typed tests and type-parameterized tests.
-
-The template argument `T...` can be any number of types, for example:
-
-```
-::testing::Types<char, int, unsigned int>
-```
-
-See [Typed Tests](../advanced.md#typed-tests) and
-[Type-Parameterized Tests](../advanced.md#type-parameterized-tests) for more
-information.
-
-### WithParamInterface {#WithParamInterface}
-
-`::testing::WithParamInterface<T>`
-
-The pure interface class that all value-parameterized tests inherit from.
-
-A value-parameterized test fixture class must inherit from both [`Test`](#Test)
-and `WithParamInterface`. In most cases that just means inheriting from
-[`TestWithParam`](#TestWithParam), but more complicated test hierarchies may
-need to inherit from `Test` and `WithParamInterface` at different levels.
-
-This interface defines the type alias `ParamType` for the parameter type `T` and
-has support for accessing the test parameter value via the `GetParam()` method:
-
-```
-static const ParamType& GetParam()
-```
-
-For more information, see
-[Value-Parameterized Tests](../advanced.md#value-parameterized-tests).
-
-## Functions
-
-GoogleTest defines the following functions to help with writing and running
-tests.
-
-### InitGoogleTest {#InitGoogleTest}
-
-`void ::testing::InitGoogleTest(int* argc, char** argv)` \
-`void ::testing::InitGoogleTest(int* argc, wchar_t** argv)` \
-`void ::testing::InitGoogleTest()`
-
-Initializes GoogleTest. This must be called before calling
-[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS). In particular, it parses the command line
-for the flags that GoogleTest recognizes. Whenever a GoogleTest flag is seen, it
-is removed from `argv`, and `*argc` is decremented.
-
-No value is returned. Instead, the GoogleTest flag variables are updated.
-
-The `InitGoogleTest(int* argc, wchar_t** argv)` overload can be used in Windows
-programs compiled in `UNICODE` mode.
-
-The argument-less `InitGoogleTest()` overload can be used on Arduino/embedded
-platforms where there is no `argc`/`argv`.
-
-### AddGlobalTestEnvironment {#AddGlobalTestEnvironment}
-
-`Environment* ::testing::AddGlobalTestEnvironment(Environment* env)`
-
-Adds a test environment to the test program. Must be called before
-[`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is called. See
-[Global Set-Up and Tear-Down](../advanced.md#global-set-up-and-tear-down) for
-more information.
-
-See also [`Environment`](#Environment).
-
-### RegisterTest {#RegisterTest}
-
-```cpp
-template <typename Factory>
-TestInfo* ::testing::RegisterTest(const char* test_suite_name, const char* test_name,
- const char* type_param, const char* value_param,
- const char* file, int line, Factory factory)
-```
-
-Dynamically registers a test with the framework.
-
-The `factory` argument is a factory callable (move-constructible) object or
-function pointer that creates a new instance of the `Test` object. It handles
-ownership to the caller. The signature of the callable is `Fixture*()`, where
-`Fixture` is the test fixture class for the test. All tests registered with the
-same `test_suite_name` must return the same fixture type. This is checked at
-runtime.
-
-The framework will infer the fixture class from the factory and will call the
-`SetUpTestSuite` and `TearDownTestSuite` methods for it.
-
-Must be called before [`RUN_ALL_TESTS()`](#RUN_ALL_TESTS) is invoked, otherwise
-behavior is undefined.
-
-See
-[Registering tests programmatically](../advanced.md#registering-tests-programmatically)
-for more information.
-
-### RUN_ALL_TESTS {#RUN_ALL_TESTS}
-
-`int RUN_ALL_TESTS()`
-
-Use this function in `main()` to run all tests. It returns `0` if all tests are
-successful, or `1` otherwise.
-
-`RUN_ALL_TESTS()` should be invoked after the command line has been parsed by
-[`InitGoogleTest()`](#InitGoogleTest).
-
-This function was formerly a macro; thus, it is in the global namespace and has
-an all-caps name.
-
-### AssertionSuccess {#AssertionSuccess}
-
-`AssertionResult ::testing::AssertionSuccess()`
-
-Creates a successful assertion result. See
-[`AssertionResult`](#AssertionResult).
-
-### AssertionFailure {#AssertionFailure}
-
-`AssertionResult ::testing::AssertionFailure()`
-
-Creates a failed assertion result. Use the `<<` operator to store a failure
-message:
-
-```cpp
-::testing::AssertionFailure() << "My failure message";
-```
-
-See [`AssertionResult`](#AssertionResult).
-
-### StaticAssertTypeEq {#StaticAssertTypeEq}
-
-`::testing::StaticAssertTypeEq<T1, T2>()`
-
-Compile-time assertion for type equality. Compiles if and only if `T1` and `T2`
-are the same type. The value it returns is irrelevant.
-
-See [Type Assertions](../advanced.md#type-assertions) for more information.
-
-### PrintToString {#PrintToString}
-
-`std::string ::testing::PrintToString(x)`
-
-Prints any value `x` using GoogleTest's value printer.
-
-See
-[Teaching GoogleTest How to Print Your Values](../advanced.md#teaching-googletest-how-to-print-your-values)
-for more information.
-
-### PrintToStringParamName {#PrintToStringParamName}
-
-`std::string ::testing::PrintToStringParamName(TestParamInfo<T>& info)`
-
-A built-in parameterized test name generator which returns the result of
-[`PrintToString`](#PrintToString) called on `info.param`. Does not work when the
-test parameter is a `std::string` or C string. See
-[Specifying Names for Value-Parameterized Test Parameters](../advanced.md#specifying-names-for-value-parameterized-test-parameters)
-for more information.
-
-See also [`TestParamInfo`](#TestParamInfo) and
-[`INSTANTIATE_TEST_SUITE_P`](#INSTANTIATE_TEST_SUITE_P).
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/samples.md b/graphics/asymptote/LspCpp/third_party/uri/deps/docs/samples.md
deleted file mode 100644
index 2d97ca55b2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/docs/samples.md
+++ /dev/null
@@ -1,22 +0,0 @@
-# Googletest Samples
-
-If you're like us, you'd like to look at
-[googletest samples.](https://github.com/google/googletest/tree/master/googletest/samples)
-The sample directory has a number of well-commented samples showing how to use a
-variety of googletest features.
-
-* Sample #1 shows the basic steps of using googletest to test C++ functions.
-* Sample #2 shows a more complex unit test for a class with multiple member
- functions.
-* Sample #3 uses a test fixture.
-* Sample #4 teaches you how to use googletest and `googletest.h` together to
- get the best of both libraries.
-* Sample #5 puts shared testing logic in a base test fixture, and reuses it in
- derived fixtures.
-* Sample #6 demonstrates type-parameterized tests.
-* Sample #7 teaches the basics of value-parameterized tests.
-* Sample #8 shows using `Combine()` in value-parameterized tests.
-* Sample #9 shows use of the listener API to modify Google Test's console
- output and the use of its reflection API to inspect test results.
-* Sample #10 shows use of the listener API to implement a primitive memory
- leak checker.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/CMakeLists.txt
deleted file mode 100644
index 2b55ba1583..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/CMakeLists.txt
+++ /dev/null
@@ -1,214 +0,0 @@
-########################################################################
-# Note: CMake support is community-based. The maintainers do not use CMake
-# internally.
-#
-# CMake build script for Google Mock.
-#
-# To run the tests for Google Mock itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
-# For more options, run 'ctest --help'.
-
-option(gmock_build_tests "Build all of Google Mock's own tests." OFF)
-
-# A directory to find Google Test sources.
-if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/gtest/CMakeLists.txt")
- set(gtest_dir gtest)
-else()
- set(gtest_dir ../googletest)
-endif()
-
-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
-include("${gtest_dir}/cmake/hermetic_build.cmake" OPTIONAL)
-
-if (COMMAND pre_project_set_up_hermetic_build)
- # Google Test also calls hermetic setup functions from add_subdirectory,
- # although its changes will not affect things at the current scope.
- pre_project_set_up_hermetic_build()
-endif()
-
-########################################################################
-#
-# Project-wide settings
-
-# Name of the project.
-#
-# CMake files in this project can refer to the root source directory
-# as ${gmock_SOURCE_DIR} and to the root binary directory as
-# ${gmock_BINARY_DIR}.
-# Language "C" is required for find_package(Threads).
-cmake_minimum_required(VERSION 3.5)
-cmake_policy(SET CMP0048 NEW)
-project(gmock VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
-
-if (COMMAND set_up_hermetic_build)
- set_up_hermetic_build()
-endif()
-
-# Instructs CMake to process Google Test's CMakeLists.txt and add its
-# targets to the current scope. We are placing Google Test's binary
-# directory in a subdirectory of our own as VC compilation may break
-# if they are the same (the default).
-add_subdirectory("${gtest_dir}" "${gmock_BINARY_DIR}/${gtest_dir}")
-
-
-# These commands only run if this is the main project
-if(CMAKE_PROJECT_NAME STREQUAL "gmock" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
- # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
- # make it prominent in the GUI.
- option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-else()
- mark_as_advanced(gmock_build_tests)
-endif()
-
-# Although Google Test's CMakeLists.txt calls this function, the
-# changes there don't affect the current scope. Therefore we have to
-# call it again here.
-config_compiler_and_linker() # from ${gtest_dir}/cmake/internal_utils.cmake
-
-# Adds Google Mock's and Google Test's header directories to the search path.
-set(gmock_build_include_dirs
- "${gmock_SOURCE_DIR}/include"
- "${gmock_SOURCE_DIR}"
- "${gtest_SOURCE_DIR}/include"
- # This directory is needed to build directly from Google Test sources.
- "${gtest_SOURCE_DIR}")
-include_directories(${gmock_build_include_dirs})
-
-########################################################################
-#
-# Defines the gmock & gmock_main libraries. User tests should link
-# with one of them.
-
-# Google Mock libraries. We build them using more strict warnings than what
-# are used for other targets, to ensure that Google Mock can be compiled by
-# a user aggressive about warnings.
-if (MSVC)
- cxx_library(gmock
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc)
-
- cxx_library(gmock_main
- "${cxx_strict}"
- "${gtest_dir}/src/gtest-all.cc"
- src/gmock-all.cc
- src/gmock_main.cc)
-else()
- cxx_library(gmock "${cxx_strict}" src/gmock-all.cc)
- target_link_libraries(gmock PUBLIC gtest)
- set_target_properties(gmock PROPERTIES VERSION ${GOOGLETEST_VERSION})
- cxx_library(gmock_main "${cxx_strict}" src/gmock_main.cc)
- target_link_libraries(gmock_main PUBLIC gmock)
- set_target_properties(gmock_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
-endif()
-# If the CMake version supports it, attach header directory information
-# to the targets for when we are part of a parent build (ie being pulled
-# in via add_subdirectory() rather than being a standalone build).
-if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
- target_include_directories(gmock SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
- target_include_directories(gmock_main SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
-endif()
-
-########################################################################
-#
-# Install rules
-install_project(gmock gmock_main)
-
-########################################################################
-#
-# Google Mock's own tests.
-#
-# You can skip this section if you aren't interested in testing
-# Google Mock itself.
-#
-# The tests are not built by default. To build them, set the
-# gmock_build_tests option to ON. You can do it by running ccmake
-# or specifying the -Dgmock_build_tests=ON flag when running cmake.
-
-if (gmock_build_tests)
- # This must be set in the root directory for the tests to be run by
- # 'make test' or ctest.
- enable_testing()
-
- if (MINGW OR CYGWIN)
- if (CMAKE_VERSION VERSION_LESS "2.8.12")
- add_compile_options("-Wa,-mbig-obj")
- else()
- add_definitions("-Wa,-mbig-obj")
- endif()
- endif()
-
- ############################################################
- # C++ tests built with standard compiler flags.
-
- cxx_test(gmock-actions_test gmock_main)
- cxx_test(gmock-cardinalities_test gmock_main)
- cxx_test(gmock_ex_test gmock_main)
- cxx_test(gmock-function-mocker_test gmock_main)
- cxx_test(gmock-internal-utils_test gmock_main)
- cxx_test(gmock-matchers_test gmock_main)
- cxx_test(gmock-more-actions_test gmock_main)
- cxx_test(gmock-nice-strict_test gmock_main)
- cxx_test(gmock-port_test gmock_main)
- cxx_test(gmock-spec-builders_test gmock_main)
- cxx_test(gmock_link_test gmock_main test/gmock_link2_test.cc)
- cxx_test(gmock_test gmock_main)
-
- if (DEFINED GTEST_HAS_PTHREAD)
- cxx_test(gmock_stress_test gmock)
- endif()
-
- # gmock_all_test is commented to save time building and running tests.
- # Uncomment if necessary.
- # cxx_test(gmock_all_test gmock_main)
-
- ############################################################
- # C++ tests built with non-standard compiler flags.
-
- if (MSVC)
- cxx_library(gmock_main_no_exception "${cxx_no_exception}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- cxx_library(gmock_main_no_rtti "${cxx_no_rtti}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- else()
- cxx_library(gmock_main_no_exception "${cxx_no_exception}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_exception PUBLIC gmock)
-
- cxx_library(gmock_main_no_rtti "${cxx_no_rtti}" src/gmock_main.cc)
- target_link_libraries(gmock_main_no_rtti PUBLIC gmock)
- endif()
- cxx_test_with_flags(gmock-more-actions_no_exception_test "${cxx_no_exception}"
- gmock_main_no_exception test/gmock-more-actions_test.cc)
-
- cxx_test_with_flags(gmock_no_rtti_test "${cxx_no_rtti}"
- gmock_main_no_rtti test/gmock-spec-builders_test.cc)
-
- cxx_shared_library(shared_gmock_main "${cxx_default}"
- "${gtest_dir}/src/gtest-all.cc" src/gmock-all.cc src/gmock_main.cc)
-
- # Tests that a binary can be built with Google Mock as a shared library. On
- # some system configurations, it may not possible to run the binary without
- # knowing more details about the system configurations. We do not try to run
- # this binary. To get a more robust shared library coverage, configure with
- # -DBUILD_SHARED_LIBS=ON.
- cxx_executable_with_flags(shared_gmock_test_ "${cxx_default}"
- shared_gmock_main test/gmock-spec-builders_test.cc)
- set_target_properties(shared_gmock_test_
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-
- ############################################################
- # Python tests.
-
- cxx_executable(gmock_leak_test_ test gmock_main)
- py_test(gmock_leak_test)
-
- cxx_executable(gmock_output_test_ test gmock)
- py_test(gmock_output_test)
-endif()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/README.md
deleted file mode 100644
index 7da60655db..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/README.md
+++ /dev/null
@@ -1,40 +0,0 @@
-# Googletest Mocking (gMock) Framework
-
-### Overview
-
-Google's framework for writing and using C++ mock classes. It can help you
-derive better designs of your system and write better tests.
-
-It is inspired by:
-
-* [jMock](http://www.jmock.org/)
-* [EasyMock](http://www.easymock.org/)
-* [Hamcrest](http://code.google.com/p/hamcrest/)
-
-It is designed with C++'s specifics in mind.
-
-gMock:
-
-- Provides a declarative syntax for defining mocks.
-- Can define partial (hybrid) mocks, which are a cross of real and mock
- objects.
-- Handles functions of arbitrary types and overloaded functions.
-- Comes with a rich set of matchers for validating function arguments.
-- Uses an intuitive syntax for controlling the behavior of a mock.
-- Does automatic verification of expectations (no record-and-replay needed).
-- Allows arbitrary (partial) ordering constraints on function calls to be
- expressed.
-- Lets a user extend it by defining new matchers and actions.
-- Does not use exceptions.
-- Is easy to learn and use.
-
-Details and examples can be found here:
-
-* [gMock for Dummies](https://google.github.io/googletest/gmock_for_dummies.html)
-* [Legacy gMock FAQ](https://google.github.io/googletest/gmock_faq.html)
-* [gMock Cookbook](https://google.github.io/googletest/gmock_cook_book.html)
-* [gMock Cheat Sheet](https://google.github.io/googletest/gmock_cheat_sheet.html)
-
-GoogleMock is a part of
-[GoogleTest C++ testing framework](http://github.com/google/googletest/) and a
-subject to the same requirements.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock.pc.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock.pc.in
deleted file mode 100644
index 23c67b5c88..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gmock
-Description: GoogleMock (without main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Requires: gtest = @PROJECT_VERSION@
-Libs: -L${libdir} -lgmock @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock_main.pc.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock_main.pc.in
deleted file mode 100644
index 66ffea7f44..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/cmake/gmock_main.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gmock_main
-Description: GoogleMock (with main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Requires: gmock = @PROJECT_VERSION@
-Libs: -L${libdir} -lgmock_main @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/docs/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/docs/README.md
deleted file mode 100644
index 1bc57b799c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/docs/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Content Moved
-
-We are working on updates to the GoogleTest documentation, which has moved to
-the top-level [docs](../../docs) directory.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-actions.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-actions.h
deleted file mode 100644
index 72663c8583..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-actions.h
+++ /dev/null
@@ -1,1687 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// The ACTION* family of macros can be used in a namespace scope to
-// define custom actions easily. The syntax:
-//
-// ACTION(name) { statements; }
-//
-// will define an action with the given name that executes the
-// statements. The value returned by the statements will be used as
-// the return value of the action. Inside the statements, you can
-// refer to the K-th (0-based) argument of the mock function by
-// 'argK', and refer to its type by 'argK_type'. For example:
-//
-// ACTION(IncrementArg1) {
-// arg1_type temp = arg1;
-// return ++(*temp);
-// }
-//
-// allows you to write
-//
-// ...WillOnce(IncrementArg1());
-//
-// You can also refer to the entire argument tuple and its type by
-// 'args' and 'args_type', and refer to the mock function type and its
-// return type by 'function_type' and 'return_type'.
-//
-// Note that you don't need to specify the types of the mock function
-// arguments. However rest assured that your code is still type-safe:
-// you'll get a compiler error if *arg1 doesn't support the ++
-// operator, or if the type of ++(*arg1) isn't compatible with the
-// mock function's return type, for example.
-//
-// Sometimes you'll want to parameterize the action. For that you can use
-// another macro:
-//
-// ACTION_P(name, param_name) { statements; }
-//
-// For example:
-//
-// ACTION_P(Add, n) { return arg0 + n; }
-//
-// will allow you to write:
-//
-// ...WillOnce(Add(5));
-//
-// Note that you don't need to provide the type of the parameter
-// either. If you need to reference the type of a parameter named
-// 'foo', you can write 'foo_type'. For example, in the body of
-// ACTION_P(Add, n) above, you can write 'n_type' to refer to the type
-// of 'n'.
-//
-// We also provide ACTION_P2, ACTION_P3, ..., up to ACTION_P10 to support
-// multi-parameter actions.
-//
-// For the purpose of typing, you can view
-//
-// ACTION_Pk(Foo, p1, ..., pk) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooActionPk<p1_type, ..., pk_type> Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// In particular, you can provide the template type arguments
-// explicitly when invoking Foo(), as in Foo<long, bool>(5, false);
-// although usually you can rely on the compiler to infer the types
-// for you automatically. You can assign the result of expression
-// Foo(p1, ..., pk) to a variable of type FooActionPk<p1_type, ...,
-// pk_type>. This can be useful when composing actions.
-//
-// You can also overload actions with different numbers of parameters:
-//
-// ACTION_P(Plus, a) { ... }
-// ACTION_P2(Plus, a, b) { ... }
-//
-// While it's tempting to always use the ACTION* macros when defining
-// a new action, you should also consider implementing ActionInterface
-// or using MakePolymorphicAction() instead, especially if you need to
-// use the action a lot. While these approaches require more work,
-// they give you more control on the types of the mock function
-// arguments and the action parameters, which in general leads to
-// better compiler error messages that pay off in the long run. They
-// also allow overloading actions based on parameter types (as opposed
-// to just based on the number of parameters).
-//
-// CAVEAT:
-//
-// ACTION*() can only be used in a namespace scope as templates cannot be
-// declared inside of a local class.
-// Users can, however, define any local functors (e.g. a lambda) that
-// can be used as actions.
-//
-// MORE INFORMATION:
-//
-// To learn more about using these macros, please search for 'ACTION' on
-// https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
-
-#ifndef _WIN32_WCE
-# include <errno.h>
-#endif
-
-#include <algorithm>
-#include <functional>
-#include <memory>
-#include <string>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gmock/internal/gmock-pp.h"
-
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-namespace testing {
-
-// To implement an action Foo, define:
-// 1. a class FooAction that implements the ActionInterface interface, and
-// 2. a factory function that creates an Action object from a
-// const FooAction*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Action objects can now be copied like plain values.
-
-namespace internal {
-
-// BuiltInDefaultValueGetter<T, true>::Get() returns a
-// default-constructed T value. BuiltInDefaultValueGetter<T,
-// false>::Get() crashes with an error.
-//
-// This primary template is used when kDefaultConstructible is true.
-template <typename T, bool kDefaultConstructible>
-struct BuiltInDefaultValueGetter {
- static T Get() { return T(); }
-};
-template <typename T>
-struct BuiltInDefaultValueGetter<T, false> {
- static T Get() {
- Assert(false, __FILE__, __LINE__,
- "Default action undefined for the function return type.");
- return internal::Invalid<T>();
- // The above statement will never be reached, but is required in
- // order for this function to compile.
- }
-};
-
-// BuiltInDefaultValue<T>::Get() returns the "built-in" default value
-// for type T, which is NULL when T is a raw pointer type, 0 when T is
-// a numeric type, false when T is bool, or "" when T is string or
-// std::string. In addition, in C++11 and above, it turns a
-// default-constructed T value if T is default constructible. For any
-// other type T, the built-in default T value is undefined, and the
-// function will abort the process.
-template <typename T>
-class BuiltInDefaultValue {
- public:
- // This function returns true if and only if type T has a built-in default
- // value.
- static bool Exists() {
- return ::std::is_default_constructible<T>::value;
- }
-
- static T Get() {
- return BuiltInDefaultValueGetter<
- T, ::std::is_default_constructible<T>::value>::Get();
- }
-};
-
-// This partial specialization says that we use the same built-in
-// default value for T and const T.
-template <typename T>
-class BuiltInDefaultValue<const T> {
- public:
- static bool Exists() { return BuiltInDefaultValue<T>::Exists(); }
- static T Get() { return BuiltInDefaultValue<T>::Get(); }
-};
-
-// This partial specialization defines the default values for pointer
-// types.
-template <typename T>
-class BuiltInDefaultValue<T*> {
- public:
- static bool Exists() { return true; }
- static T* Get() { return nullptr; }
-};
-
-// The following specializations define the default values for
-// specific types we care about.
-#define GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(type, value) \
- template <> \
- class BuiltInDefaultValue<type> { \
- public: \
- static bool Exists() { return true; } \
- static type Get() { return value; } \
- }
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(void, ); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(::std::string, "");
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(bool, false);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed char, '\0');
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(char, '\0');
-
-// There's no need for a default action for signed wchar_t, as that
-// type is the same as wchar_t for gcc, and invalid for MSVC.
-//
-// There's also no need for a default action for unsigned wchar_t, as
-// that type is the same as unsigned int for gcc, and invalid for
-// MSVC.
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(wchar_t, 0U); // NOLINT
-#endif
-
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned short, 0U); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed short, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned int, 0U);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed int, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long, 0UL); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long, 0L); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(unsigned long long, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(signed long long, 0); // NOLINT
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(float, 0);
-GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_(double, 0);
-
-#undef GMOCK_DEFINE_DEFAULT_ACTION_FOR_RETURN_TYPE_
-
-// Simple two-arg form of std::disjunction.
-template <typename P, typename Q>
-using disjunction = typename ::std::conditional<P::value, P, Q>::type;
-
-} // namespace internal
-
-// When an unexpected function call is encountered, Google Mock will
-// let it return a default value if the user has specified one for its
-// return type, or if the return type has a built-in default value;
-// otherwise Google Mock won't know what value to return and will have
-// to abort the process.
-//
-// The DefaultValue<T> class allows a user to specify the
-// default value for a type T that is both copyable and publicly
-// destructible (i.e. anything that can be used as a function return
-// type). The usage is:
-//
-// // Sets the default value for type T to be foo.
-// DefaultValue<T>::Set(foo);
-template <typename T>
-class DefaultValue {
- public:
- // Sets the default value for type T; requires T to be
- // copy-constructable and have a public destructor.
- static void Set(T x) {
- delete producer_;
- producer_ = new FixedValueProducer(x);
- }
-
- // Provides a factory function to be called to generate the default value.
- // This method can be used even if T is only move-constructible, but it is not
- // limited to that case.
- typedef T (*FactoryFunction)();
- static void SetFactory(FactoryFunction factory) {
- delete producer_;
- producer_ = new FactoryValueProducer(factory);
- }
-
- // Unsets the default value for type T.
- static void Clear() {
- delete producer_;
- producer_ = nullptr;
- }
-
- // Returns true if and only if the user has set the default value for type T.
- static bool IsSet() { return producer_ != nullptr; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue<T>::Exists();
- }
-
- // Returns the default value for type T if the user has set one;
- // otherwise returns the built-in default value. Requires that Exists()
- // is true, which ensures that the return value is well-defined.
- static T Get() {
- return producer_ == nullptr ? internal::BuiltInDefaultValue<T>::Get()
- : producer_->Produce();
- }
-
- private:
- class ValueProducer {
- public:
- virtual ~ValueProducer() {}
- virtual T Produce() = 0;
- };
-
- class FixedValueProducer : public ValueProducer {
- public:
- explicit FixedValueProducer(T value) : value_(value) {}
- T Produce() override { return value_; }
-
- private:
- const T value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(FixedValueProducer);
- };
-
- class FactoryValueProducer : public ValueProducer {
- public:
- explicit FactoryValueProducer(FactoryFunction factory)
- : factory_(factory) {}
- T Produce() override { return factory_(); }
-
- private:
- const FactoryFunction factory_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(FactoryValueProducer);
- };
-
- static ValueProducer* producer_;
-};
-
-// This partial specialization allows a user to set default values for
-// reference types.
-template <typename T>
-class DefaultValue<T&> {
- public:
- // Sets the default value for type T&.
- static void Set(T& x) { // NOLINT
- address_ = &x;
- }
-
- // Unsets the default value for type T&.
- static void Clear() { address_ = nullptr; }
-
- // Returns true if and only if the user has set the default value for type T&.
- static bool IsSet() { return address_ != nullptr; }
-
- // Returns true if T has a default return value set by the user or there
- // exists a built-in default value.
- static bool Exists() {
- return IsSet() || internal::BuiltInDefaultValue<T&>::Exists();
- }
-
- // Returns the default value for type T& if the user has set one;
- // otherwise returns the built-in default value if there is one;
- // otherwise aborts the process.
- static T& Get() {
- return address_ == nullptr ? internal::BuiltInDefaultValue<T&>::Get()
- : *address_;
- }
-
- private:
- static T* address_;
-};
-
-// This specialization allows DefaultValue<void>::Get() to
-// compile.
-template <>
-class DefaultValue<void> {
- public:
- static bool Exists() { return true; }
- static void Get() {}
-};
-
-// Points to the user-set default value for type T.
-template <typename T>
-typename DefaultValue<T>::ValueProducer* DefaultValue<T>::producer_ = nullptr;
-
-// Points to the user-set default value for type T&.
-template <typename T>
-T* DefaultValue<T&>::address_ = nullptr;
-
-// Implement this interface to define an action for function type F.
-template <typename F>
-class ActionInterface {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- ActionInterface() {}
- virtual ~ActionInterface() {}
-
- // Performs the action. This method is not const, as in general an
- // action can have side effects and be stateful. For example, a
- // get-the-next-element-from-the-collection action will need to
- // remember the current element.
- virtual Result Perform(const ArgumentTuple& args) = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionInterface);
-};
-
-// An Action<F> is a copyable and IMMUTABLE (except by assignment)
-// object that represents an action to be taken when a mock function
-// of type F is called. The implementation of Action<T> is just a
-// std::shared_ptr to const ActionInterface<T>. Don't inherit from Action!
-// You can view an object implementing ActionInterface<F> as a
-// concrete action (including its current state), and an Action<F>
-// object as a handle to it.
-template <typename F>
-class Action {
- // Adapter class to allow constructing Action from a legacy ActionInterface.
- // New code should create Actions from functors instead.
- struct ActionAdapter {
- // Adapter must be copyable to satisfy std::function requirements.
- ::std::shared_ptr<ActionInterface<F>> impl_;
-
- template <typename... Args>
- typename internal::Function<F>::Result operator()(Args&&... args) {
- return impl_->Perform(
- ::std::forward_as_tuple(::std::forward<Args>(args)...));
- }
- };
-
- template <typename G>
- using IsCompatibleFunctor = std::is_constructible<std::function<F>, G>;
-
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- // Constructs a null Action. Needed for storing Action objects in
- // STL containers.
- Action() {}
-
- // Construct an Action from a specified callable.
- // This cannot take std::function directly, because then Action would not be
- // directly constructible from lambda (it would require two conversions).
- template <
- typename G,
- typename = typename std::enable_if<internal::disjunction<
- IsCompatibleFunctor<G>, std::is_constructible<std::function<Result()>,
- G>>::value>::type>
- Action(G&& fun) { // NOLINT
- Init(::std::forward<G>(fun), IsCompatibleFunctor<G>());
- }
-
- // Constructs an Action from its implementation.
- explicit Action(ActionInterface<F>* impl)
- : fun_(ActionAdapter{::std::shared_ptr<ActionInterface<F>>(impl)}) {}
-
- // This constructor allows us to turn an Action<Func> object into an
- // Action<F>, as long as F's arguments can be implicitly converted
- // to Func's and Func's return type can be implicitly converted to F's.
- template <typename Func>
- explicit Action(const Action<Func>& action) : fun_(action.fun_) {}
-
- // Returns true if and only if this is the DoDefault() action.
- bool IsDoDefault() const { return fun_ == nullptr; }
-
- // Performs the action. Note that this method is const even though
- // the corresponding method in ActionInterface is not. The reason
- // is that a const Action<F> means that it cannot be re-bound to
- // another concrete action, not that the concrete action it binds to
- // cannot change state. (Think of the difference between a const
- // pointer and a pointer to const.)
- Result Perform(ArgumentTuple args) const {
- if (IsDoDefault()) {
- internal::IllegalDoDefault(__FILE__, __LINE__);
- }
- return internal::Apply(fun_, ::std::move(args));
- }
-
- private:
- template <typename G>
- friend class Action;
-
- template <typename G>
- void Init(G&& g, ::std::true_type) {
- fun_ = ::std::forward<G>(g);
- }
-
- template <typename G>
- void Init(G&& g, ::std::false_type) {
- fun_ = IgnoreArgs<typename ::std::decay<G>::type>{::std::forward<G>(g)};
- }
-
- template <typename FunctionImpl>
- struct IgnoreArgs {
- template <typename... Args>
- Result operator()(const Args&...) const {
- return function_impl();
- }
-
- FunctionImpl function_impl;
- };
-
- // fun_ is an empty function if and only if this is the DoDefault() action.
- ::std::function<F> fun_;
-};
-
-// The PolymorphicAction class template makes it easy to implement a
-// polymorphic action (i.e. an action that can be used in mock
-// functions of than one type, e.g. Return()).
-//
-// To define a polymorphic action, a user first provides a COPYABLE
-// implementation class that has a Perform() method template:
-//
-// class FooAction {
-// public:
-// template <typename Result, typename ArgumentTuple>
-// Result Perform(const ArgumentTuple& args) const {
-// // Processes the arguments and returns a result, using
-// // std::get<N>(args) to get the N-th (0-based) argument in the tuple.
-// }
-// ...
-// };
-//
-// Then the user creates the polymorphic action using
-// MakePolymorphicAction(object) where object has type FooAction. See
-// the definition of Return(void) and SetArgumentPointee<N>(value) for
-// complete examples.
-template <typename Impl>
-class PolymorphicAction {
- public:
- explicit PolymorphicAction(const Impl& impl) : impl_(impl) {}
-
- template <typename F>
- operator Action<F>() const {
- return Action<F>(new MonomorphicImpl<F>(impl_));
- }
-
- private:
- template <typename F>
- class MonomorphicImpl : public ActionInterface<F> {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
-
- Result Perform(const ArgumentTuple& args) override {
- return impl_.template Perform<Result>(args);
- }
-
- private:
- Impl impl_;
- };
-
- Impl impl_;
-};
-
-// Creates an Action from its implementation and returns it. The
-// created Action object owns the implementation.
-template <typename F>
-Action<F> MakeAction(ActionInterface<F>* impl) {
- return Action<F>(impl);
-}
-
-// Creates a polymorphic action from its implementation. This is
-// easier to use than the PolymorphicAction<Impl> constructor as it
-// doesn't require you to explicitly write the template argument, e.g.
-//
-// MakePolymorphicAction(foo);
-// vs
-// PolymorphicAction<TypeOfFoo>(foo);
-template <typename Impl>
-inline PolymorphicAction<Impl> MakePolymorphicAction(const Impl& impl) {
- return PolymorphicAction<Impl>(impl);
-}
-
-namespace internal {
-
-// Helper struct to specialize ReturnAction to execute a move instead of a copy
-// on return. Useful for move-only types, but could be used on any type.
-template <typename T>
-struct ByMoveWrapper {
- explicit ByMoveWrapper(T value) : payload(std::move(value)) {}
- T payload;
-};
-
-// Implements the polymorphic Return(x) action, which can be used in
-// any function that returns the type of x, regardless of the argument
-// types.
-//
-// Note: The value passed into Return must be converted into
-// Function<F>::Result when this action is cast to Action<F> rather than
-// when that action is performed. This is important in scenarios like
-//
-// MOCK_METHOD1(Method, T(U));
-// ...
-// {
-// Foo foo;
-// X x(&foo);
-// EXPECT_CALL(mock, Method(_)).WillOnce(Return(x));
-// }
-//
-// In the example above the variable x holds reference to foo which leaves
-// scope and gets destroyed. If copying X just copies a reference to foo,
-// that copy will be left with a hanging reference. If conversion to T
-// makes a copy of foo, the above code is safe. To support that scenario, we
-// need to make sure that the type conversion happens inside the EXPECT_CALL
-// statement, and conversion of the result of Return to Action<T(U)> is a
-// good place for that.
-//
-// The real life example of the above scenario happens when an invocation
-// of gtl::Container() is passed into Return.
-//
-template <typename R>
-class ReturnAction {
- public:
- // Constructs a ReturnAction object from the value to be returned.
- // 'value' is passed by value instead of by const reference in order
- // to allow Return("string literal") to compile.
- explicit ReturnAction(R value) : value_(new R(std::move(value))) {}
-
- // This template type conversion operator allows Return(x) to be
- // used in ANY function that returns x's type.
- template <typename F>
- operator Action<F>() const { // NOLINT
- // Assert statement belongs here because this is the best place to verify
- // conditions on F. It produces the clearest error messages
- // in most compilers.
- // Impl really belongs in this scope as a local class but can't
- // because MSVC produces duplicate symbols in different translation units
- // in this case. Until MS fixes that bug we put Impl into the class scope
- // and put the typedef both here (for use in assert statement) and
- // in the Impl class. But both definitions must be the same.
- typedef typename Function<F>::Result Result;
- GTEST_COMPILE_ASSERT_(
- !std::is_reference<Result>::value,
- use_ReturnRef_instead_of_Return_to_return_a_reference);
- static_assert(!std::is_void<Result>::value,
- "Can't use Return() on an action expected to return `void`.");
- return Action<F>(new Impl<R, F>(value_));
- }
-
- private:
- // Implements the Return(x) action for a particular function type F.
- template <typename R_, typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- // The implicit cast is necessary when Result has more than one
- // single-argument constructor (e.g. Result is std::vector<int>) and R
- // has a type conversion operator template. In that case, value_(value)
- // won't compile as the compiler doesn't known which constructor of
- // Result to call. ImplicitCast_ forces the compiler to convert R to
- // Result without considering explicit constructors, thus resolving the
- // ambiguity. value_ is then initialized using its copy constructor.
- explicit Impl(const std::shared_ptr<R>& value)
- : value_before_cast_(*value),
- value_(ImplicitCast_<Result>(value_before_cast_)) {}
-
- Result Perform(const ArgumentTuple&) override { return value_; }
-
- private:
- GTEST_COMPILE_ASSERT_(!std::is_reference<Result>::value,
- Result_cannot_be_a_reference_type);
- // We save the value before casting just in case it is being cast to a
- // wrapper type.
- R value_before_cast_;
- Result value_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
- };
-
- // Partially specialize for ByMoveWrapper. This version of ReturnAction will
- // move its contents instead.
- template <typename R_, typename F>
- class Impl<ByMoveWrapper<R_>, F> : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const std::shared_ptr<R>& wrapper)
- : performed_(false), wrapper_(wrapper) {}
-
- Result Perform(const ArgumentTuple&) override {
- GTEST_CHECK_(!performed_)
- << "A ByMove() action should only be performed once.";
- performed_ = true;
- return std::move(wrapper_->payload);
- }
-
- private:
- bool performed_;
- const std::shared_ptr<R> wrapper_;
- };
-
- const std::shared_ptr<R> value_;
-};
-
-// Implements the ReturnNull() action.
-class ReturnNullAction {
- public:
- // Allows ReturnNull() to be used in any pointer-returning function. In C++11
- // this is enforced by returning nullptr, and in non-C++11 by asserting a
- // pointer type on compile time.
- template <typename Result, typename ArgumentTuple>
- static Result Perform(const ArgumentTuple&) {
- return nullptr;
- }
-};
-
-// Implements the Return() action.
-class ReturnVoidAction {
- public:
- // Allows Return() to be used in any void-returning function.
- template <typename Result, typename ArgumentTuple>
- static void Perform(const ArgumentTuple&) {
- static_assert(std::is_void<Result>::value, "Result should be void.");
- }
-};
-
-// Implements the polymorphic ReturnRef(x) action, which can be used
-// in any function that returns a reference to the type of x,
-// regardless of the argument types.
-template <typename T>
-class ReturnRefAction {
- public:
- // Constructs a ReturnRefAction object from the reference to be returned.
- explicit ReturnRefAction(T& ref) : ref_(ref) {} // NOLINT
-
- // This template type conversion operator allows ReturnRef(x) to be
- // used in ANY function that returns a reference to x's type.
- template <typename F>
- operator Action<F>() const {
- typedef typename Function<F>::Result Result;
- // Asserts that the function return type is a reference. This
- // catches the user error of using ReturnRef(x) when Return(x)
- // should be used, and generates some helpful error message.
- GTEST_COMPILE_ASSERT_(std::is_reference<Result>::value,
- use_Return_instead_of_ReturnRef_to_return_a_value);
- return Action<F>(new Impl<F>(ref_));
- }
-
- private:
- // Implements the ReturnRef(x) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(T& ref) : ref_(ref) {} // NOLINT
-
- Result Perform(const ArgumentTuple&) override { return ref_; }
-
- private:
- T& ref_;
- };
-
- T& ref_;
-};
-
-// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
-// used in any function that returns a reference to the type of x,
-// regardless of the argument types.
-template <typename T>
-class ReturnRefOfCopyAction {
- public:
- // Constructs a ReturnRefOfCopyAction object from the reference to
- // be returned.
- explicit ReturnRefOfCopyAction(const T& value) : value_(value) {} // NOLINT
-
- // This template type conversion operator allows ReturnRefOfCopy(x) to be
- // used in ANY function that returns a reference to x's type.
- template <typename F>
- operator Action<F>() const {
- typedef typename Function<F>::Result Result;
- // Asserts that the function return type is a reference. This
- // catches the user error of using ReturnRefOfCopy(x) when Return(x)
- // should be used, and generates some helpful error message.
- GTEST_COMPILE_ASSERT_(
- std::is_reference<Result>::value,
- use_Return_instead_of_ReturnRefOfCopy_to_return_a_value);
- return Action<F>(new Impl<F>(value_));
- }
-
- private:
- // Implements the ReturnRefOfCopy(x) action for a particular function type F.
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename Function<F>::Result Result;
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const T& value) : value_(value) {} // NOLINT
-
- Result Perform(const ArgumentTuple&) override { return value_; }
-
- private:
- T value_;
- };
-
- const T value_;
-};
-
-// Implements the polymorphic ReturnRoundRobin(v) action, which can be
-// used in any function that returns the element_type of v.
-template <typename T>
-class ReturnRoundRobinAction {
- public:
- explicit ReturnRoundRobinAction(std::vector<T> values) {
- GTEST_CHECK_(!values.empty())
- << "ReturnRoundRobin requires at least one element.";
- state_->values = std::move(values);
- }
-
- template <typename... Args>
- T operator()(Args&&...) const {
- return state_->Next();
- }
-
- private:
- struct State {
- T Next() {
- T ret_val = values[i++];
- if (i == values.size()) i = 0;
- return ret_val;
- }
-
- std::vector<T> values;
- size_t i = 0;
- };
- std::shared_ptr<State> state_ = std::make_shared<State>();
-};
-
-// Implements the polymorphic DoDefault() action.
-class DoDefaultAction {
- public:
- // This template type conversion operator allows DoDefault() to be
- // used in any function.
- template <typename F>
- operator Action<F>() const { return Action<F>(); } // NOLINT
-};
-
-// Implements the Assign action to set a given pointer referent to a
-// particular value.
-template <typename T1, typename T2>
-class AssignAction {
- public:
- AssignAction(T1* ptr, T2 value) : ptr_(ptr), value_(value) {}
-
- template <typename Result, typename ArgumentTuple>
- void Perform(const ArgumentTuple& /* args */) const {
- *ptr_ = value_;
- }
-
- private:
- T1* const ptr_;
- const T2 value_;
-};
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Implements the SetErrnoAndReturn action to simulate return from
-// various system calls and libc functions.
-template <typename T>
-class SetErrnoAndReturnAction {
- public:
- SetErrnoAndReturnAction(int errno_value, T result)
- : errno_(errno_value),
- result_(result) {}
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& /* args */) const {
- errno = errno_;
- return result_;
- }
-
- private:
- const int errno_;
- const T result_;
-};
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Implements the SetArgumentPointee<N>(x) action for any function
-// whose N-th argument (0-based) is a pointer to x's type.
-template <size_t N, typename A, typename = void>
-struct SetArgumentPointeeAction {
- A value;
-
- template <typename... Args>
- void operator()(const Args&... args) const {
- *::std::get<N>(std::tie(args...)) = value;
- }
-};
-
-// Implements the Invoke(object_ptr, &Class::Method) action.
-template <class Class, typename MethodPtr>
-struct InvokeMethodAction {
- Class* const obj_ptr;
- const MethodPtr method_ptr;
-
- template <typename... Args>
- auto operator()(Args&&... args) const
- -> decltype((obj_ptr->*method_ptr)(std::forward<Args>(args)...)) {
- return (obj_ptr->*method_ptr)(std::forward<Args>(args)...);
- }
-};
-
-// Implements the InvokeWithoutArgs(f) action. The template argument
-// FunctionImpl is the implementation type of f, which can be either a
-// function pointer or a functor. InvokeWithoutArgs(f) can be used as an
-// Action<F> as long as f's type is compatible with F.
-template <typename FunctionImpl>
-struct InvokeWithoutArgsAction {
- FunctionImpl function_impl;
-
- // Allows InvokeWithoutArgs(f) to be used as any action whose type is
- // compatible with f.
- template <typename... Args>
- auto operator()(const Args&...) -> decltype(function_impl()) {
- return function_impl();
- }
-};
-
-// Implements the InvokeWithoutArgs(object_ptr, &Class::Method) action.
-template <class Class, typename MethodPtr>
-struct InvokeMethodWithoutArgsAction {
- Class* const obj_ptr;
- const MethodPtr method_ptr;
-
- using ReturnType =
- decltype((std::declval<Class*>()->*std::declval<MethodPtr>())());
-
- template <typename... Args>
- ReturnType operator()(const Args&...) const {
- return (obj_ptr->*method_ptr)();
- }
-};
-
-// Implements the IgnoreResult(action) action.
-template <typename A>
-class IgnoreResultAction {
- public:
- explicit IgnoreResultAction(const A& action) : action_(action) {}
-
- template <typename F>
- operator Action<F>() const {
- // Assert statement belongs here because this is the best place to verify
- // conditions on F. It produces the clearest error messages
- // in most compilers.
- // Impl really belongs in this scope as a local class but can't
- // because MSVC produces duplicate symbols in different translation units
- // in this case. Until MS fixes that bug we put Impl into the class scope
- // and put the typedef both here (for use in assert statement) and
- // in the Impl class. But both definitions must be the same.
- typedef typename internal::Function<F>::Result Result;
-
- // Asserts at compile time that F returns void.
- static_assert(std::is_void<Result>::value, "Result type should be void.");
-
- return Action<F>(new Impl<F>(action_));
- }
-
- private:
- template <typename F>
- class Impl : public ActionInterface<F> {
- public:
- typedef typename internal::Function<F>::Result Result;
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
-
- explicit Impl(const A& action) : action_(action) {}
-
- void Perform(const ArgumentTuple& args) override {
- // Performs the action and ignores its result.
- action_.Perform(args);
- }
-
- private:
- // Type OriginalFunction is the same as F except that its return
- // type is IgnoredValue.
- typedef typename internal::Function<F>::MakeResultIgnoredValue
- OriginalFunction;
-
- const Action<OriginalFunction> action_;
- };
-
- const A action_;
-};
-
-template <typename InnerAction, size_t... I>
-struct WithArgsAction {
- InnerAction action;
-
- // The inner action could be anything convertible to Action<X>.
- // We use the conversion operator to detect the signature of the inner Action.
- template <typename R, typename... Args>
- operator Action<R(Args...)>() const { // NOLINT
- using TupleType = std::tuple<Args...>;
- Action<R(typename std::tuple_element<I, TupleType>::type...)>
- converted(action);
-
- return [converted](Args... args) -> R {
- return converted.Perform(std::forward_as_tuple(
- std::get<I>(std::forward_as_tuple(std::forward<Args>(args)...))...));
- };
- }
-};
-
-template <typename... Actions>
-struct DoAllAction {
- private:
- template <typename T>
- using NonFinalType =
- typename std::conditional<std::is_scalar<T>::value, T, const T&>::type;
-
- template <typename ActionT, size_t... I>
- std::vector<ActionT> Convert(IndexSequence<I...>) const {
- return {ActionT(std::get<I>(actions))...};
- }
-
- public:
- std::tuple<Actions...> actions;
-
- template <typename R, typename... Args>
- operator Action<R(Args...)>() const { // NOLINT
- struct Op {
- std::vector<Action<void(NonFinalType<Args>...)>> converted;
- Action<R(Args...)> last;
- R operator()(Args... args) const {
- auto tuple_args = std::forward_as_tuple(std::forward<Args>(args)...);
- for (auto& a : converted) {
- a.Perform(tuple_args);
- }
- return last.Perform(std::move(tuple_args));
- }
- };
- return Op{Convert<Action<void(NonFinalType<Args>...)>>(
- MakeIndexSequence<sizeof...(Actions) - 1>()),
- std::get<sizeof...(Actions) - 1>(actions)};
- }
-};
-
-template <typename T, typename... Params>
-struct ReturnNewAction {
- T* operator()() const {
- return internal::Apply(
- [](const Params&... unpacked_params) {
- return new T(unpacked_params...);
- },
- params);
- }
- std::tuple<Params...> params;
-};
-
-template <size_t k>
-struct ReturnArgAction {
- template <typename... Args>
- auto operator()(const Args&... args) const ->
- typename std::tuple_element<k, std::tuple<Args...>>::type {
- return std::get<k>(std::tie(args...));
- }
-};
-
-template <size_t k, typename Ptr>
-struct SaveArgAction {
- Ptr pointer;
-
- template <typename... Args>
- void operator()(const Args&... args) const {
- *pointer = std::get<k>(std::tie(args...));
- }
-};
-
-template <size_t k, typename Ptr>
-struct SaveArgPointeeAction {
- Ptr pointer;
-
- template <typename... Args>
- void operator()(const Args&... args) const {
- *pointer = *std::get<k>(std::tie(args...));
- }
-};
-
-template <size_t k, typename T>
-struct SetArgRefereeAction {
- T value;
-
- template <typename... Args>
- void operator()(Args&&... args) const {
- using argk_type =
- typename ::std::tuple_element<k, std::tuple<Args...>>::type;
- static_assert(std::is_lvalue_reference<argk_type>::value,
- "Argument must be a reference type.");
- std::get<k>(std::tie(args...)) = value;
- }
-};
-
-template <size_t k, typename I1, typename I2>
-struct SetArrayArgumentAction {
- I1 first;
- I2 last;
-
- template <typename... Args>
- void operator()(const Args&... args) const {
- auto value = std::get<k>(std::tie(args...));
- for (auto it = first; it != last; ++it, (void)++value) {
- *value = *it;
- }
- }
-};
-
-template <size_t k>
-struct DeleteArgAction {
- template <typename... Args>
- void operator()(const Args&... args) const {
- delete std::get<k>(std::tie(args...));
- }
-};
-
-template <typename Ptr>
-struct ReturnPointeeAction {
- Ptr pointer;
- template <typename... Args>
- auto operator()(const Args&...) const -> decltype(*pointer) {
- return *pointer;
- }
-};
-
-#if GTEST_HAS_EXCEPTIONS
-template <typename T>
-struct ThrowAction {
- T exception;
- // We use a conversion operator to adapt to any return type.
- template <typename R, typename... Args>
- operator Action<R(Args...)>() const { // NOLINT
- T copy = exception;
- return [copy](Args...) -> R { throw copy; };
- }
-};
-#endif // GTEST_HAS_EXCEPTIONS
-
-} // namespace internal
-
-// An Unused object can be implicitly constructed from ANY value.
-// This is handy when defining actions that ignore some or all of the
-// mock function arguments. For example, given
-//
-// MOCK_METHOD3(Foo, double(const string& label, double x, double y));
-// MOCK_METHOD3(Bar, double(int index, double x, double y));
-//
-// instead of
-//
-// double DistanceToOriginWithLabel(const string& label, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// double DistanceToOriginWithIndex(int index, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// ...
-// EXPECT_CALL(mock, Foo("abc", _, _))
-// .WillOnce(Invoke(DistanceToOriginWithLabel));
-// EXPECT_CALL(mock, Bar(5, _, _))
-// .WillOnce(Invoke(DistanceToOriginWithIndex));
-//
-// you could write
-//
-// // We can declare any uninteresting argument as Unused.
-// double DistanceToOrigin(Unused, double x, double y) {
-// return sqrt(x*x + y*y);
-// }
-// ...
-// EXPECT_CALL(mock, Foo("abc", _, _)).WillOnce(Invoke(DistanceToOrigin));
-// EXPECT_CALL(mock, Bar(5, _, _)).WillOnce(Invoke(DistanceToOrigin));
-typedef internal::IgnoredValue Unused;
-
-// Creates an action that does actions a1, a2, ..., sequentially in
-// each invocation. All but the last action will have a readonly view of the
-// arguments.
-template <typename... Action>
-internal::DoAllAction<typename std::decay<Action>::type...> DoAll(
- Action&&... action) {
- return {std::forward_as_tuple(std::forward<Action>(action)...)};
-}
-
-// WithArg<k>(an_action) creates an action that passes the k-th
-// (0-based) argument of the mock function to an_action and performs
-// it. It adapts an action accepting one argument to one that accepts
-// multiple arguments. For convenience, we also provide
-// WithArgs<k>(an_action) (defined below) as a synonym.
-template <size_t k, typename InnerAction>
-internal::WithArgsAction<typename std::decay<InnerAction>::type, k>
-WithArg(InnerAction&& action) {
- return {std::forward<InnerAction>(action)};
-}
-
-// WithArgs<N1, N2, ..., Nk>(an_action) creates an action that passes
-// the selected arguments of the mock function to an_action and
-// performs it. It serves as an adaptor between actions with
-// different argument lists.
-template <size_t k, size_t... ks, typename InnerAction>
-internal::WithArgsAction<typename std::decay<InnerAction>::type, k, ks...>
-WithArgs(InnerAction&& action) {
- return {std::forward<InnerAction>(action)};
-}
-
-// WithoutArgs(inner_action) can be used in a mock function with a
-// non-empty argument list to perform inner_action, which takes no
-// argument. In other words, it adapts an action accepting no
-// argument to one that accepts (and ignores) arguments.
-template <typename InnerAction>
-internal::WithArgsAction<typename std::decay<InnerAction>::type>
-WithoutArgs(InnerAction&& action) {
- return {std::forward<InnerAction>(action)};
-}
-
-// Creates an action that returns 'value'. 'value' is passed by value
-// instead of const reference - otherwise Return("string literal")
-// will trigger a compiler error about using array as initializer.
-template <typename R>
-internal::ReturnAction<R> Return(R value) {
- return internal::ReturnAction<R>(std::move(value));
-}
-
-// Creates an action that returns NULL.
-inline PolymorphicAction<internal::ReturnNullAction> ReturnNull() {
- return MakePolymorphicAction(internal::ReturnNullAction());
-}
-
-// Creates an action that returns from a void function.
-inline PolymorphicAction<internal::ReturnVoidAction> Return() {
- return MakePolymorphicAction(internal::ReturnVoidAction());
-}
-
-// Creates an action that returns the reference to a variable.
-template <typename R>
-inline internal::ReturnRefAction<R> ReturnRef(R& x) { // NOLINT
- return internal::ReturnRefAction<R>(x);
-}
-
-// Prevent using ReturnRef on reference to temporary.
-template <typename R, R* = nullptr>
-internal::ReturnRefAction<R> ReturnRef(R&&) = delete;
-
-// Creates an action that returns the reference to a copy of the
-// argument. The copy is created when the action is constructed and
-// lives as long as the action.
-template <typename R>
-inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) {
- return internal::ReturnRefOfCopyAction<R>(x);
-}
-
-// Modifies the parent action (a Return() action) to perform a move of the
-// argument instead of a copy.
-// Return(ByMove()) actions can only be executed once and will assert this
-// invariant.
-template <typename R>
-internal::ByMoveWrapper<R> ByMove(R x) {
- return internal::ByMoveWrapper<R>(std::move(x));
-}
-
-// Creates an action that returns an element of `vals`. Calling this action will
-// repeatedly return the next value from `vals` until it reaches the end and
-// will restart from the beginning.
-template <typename T>
-internal::ReturnRoundRobinAction<T> ReturnRoundRobin(std::vector<T> vals) {
- return internal::ReturnRoundRobinAction<T>(std::move(vals));
-}
-
-// Creates an action that returns an element of `vals`. Calling this action will
-// repeatedly return the next value from `vals` until it reaches the end and
-// will restart from the beginning.
-template <typename T>
-internal::ReturnRoundRobinAction<T> ReturnRoundRobin(
- std::initializer_list<T> vals) {
- return internal::ReturnRoundRobinAction<T>(std::vector<T>(vals));
-}
-
-// Creates an action that does the default action for the give mock function.
-inline internal::DoDefaultAction DoDefault() {
- return internal::DoDefaultAction();
-}
-
-// Creates an action that sets the variable pointed by the N-th
-// (0-based) function argument to 'value'.
-template <size_t N, typename T>
-internal::SetArgumentPointeeAction<N, T> SetArgPointee(T value) {
- return {std::move(value)};
-}
-
-// The following version is DEPRECATED.
-template <size_t N, typename T>
-internal::SetArgumentPointeeAction<N, T> SetArgumentPointee(T value) {
- return {std::move(value)};
-}
-
-// Creates an action that sets a pointer referent to a given value.
-template <typename T1, typename T2>
-PolymorphicAction<internal::AssignAction<T1, T2> > Assign(T1* ptr, T2 val) {
- return MakePolymorphicAction(internal::AssignAction<T1, T2>(ptr, val));
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Creates an action that sets errno and returns the appropriate error.
-template <typename T>
-PolymorphicAction<internal::SetErrnoAndReturnAction<T> >
-SetErrnoAndReturn(int errval, T result) {
- return MakePolymorphicAction(
- internal::SetErrnoAndReturnAction<T>(errval, result));
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Various overloads for Invoke().
-
-// Legacy function.
-// Actions can now be implicitly constructed from callables. No need to create
-// wrapper objects.
-// This function exists for backwards compatibility.
-template <typename FunctionImpl>
-typename std::decay<FunctionImpl>::type Invoke(FunctionImpl&& function_impl) {
- return std::forward<FunctionImpl>(function_impl);
-}
-
-// Creates an action that invokes the given method on the given object
-// with the mock function's arguments.
-template <class Class, typename MethodPtr>
-internal::InvokeMethodAction<Class, MethodPtr> Invoke(Class* obj_ptr,
- MethodPtr method_ptr) {
- return {obj_ptr, method_ptr};
-}
-
-// Creates an action that invokes 'function_impl' with no argument.
-template <typename FunctionImpl>
-internal::InvokeWithoutArgsAction<typename std::decay<FunctionImpl>::type>
-InvokeWithoutArgs(FunctionImpl function_impl) {
- return {std::move(function_impl)};
-}
-
-// Creates an action that invokes the given method on the given object
-// with no argument.
-template <class Class, typename MethodPtr>
-internal::InvokeMethodWithoutArgsAction<Class, MethodPtr> InvokeWithoutArgs(
- Class* obj_ptr, MethodPtr method_ptr) {
- return {obj_ptr, method_ptr};
-}
-
-// Creates an action that performs an_action and throws away its
-// result. In other words, it changes the return type of an_action to
-// void. an_action MUST NOT return void, or the code won't compile.
-template <typename A>
-inline internal::IgnoreResultAction<A> IgnoreResult(const A& an_action) {
- return internal::IgnoreResultAction<A>(an_action);
-}
-
-// Creates a reference wrapper for the given L-value. If necessary,
-// you can explicitly specify the type of the reference. For example,
-// suppose 'derived' is an object of type Derived, ByRef(derived)
-// would wrap a Derived&. If you want to wrap a const Base& instead,
-// where Base is a base class of Derived, just write:
-//
-// ByRef<const Base>(derived)
-//
-// N.B. ByRef is redundant with std::ref, std::cref and std::reference_wrapper.
-// However, it may still be used for consistency with ByMove().
-template <typename T>
-inline ::std::reference_wrapper<T> ByRef(T& l_value) { // NOLINT
- return ::std::reference_wrapper<T>(l_value);
-}
-
-// The ReturnNew<T>(a1, a2, ..., a_k) action returns a pointer to a new
-// instance of type T, constructed on the heap with constructor arguments
-// a1, a2, ..., and a_k. The caller assumes ownership of the returned value.
-template <typename T, typename... Params>
-internal::ReturnNewAction<T, typename std::decay<Params>::type...> ReturnNew(
- Params&&... params) {
- return {std::forward_as_tuple(std::forward<Params>(params)...)};
-}
-
-// Action ReturnArg<k>() returns the k-th argument of the mock function.
-template <size_t k>
-internal::ReturnArgAction<k> ReturnArg() {
- return {};
-}
-
-// Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the
-// mock function to *pointer.
-template <size_t k, typename Ptr>
-internal::SaveArgAction<k, Ptr> SaveArg(Ptr pointer) {
- return {pointer};
-}
-
-// Action SaveArgPointee<k>(pointer) saves the value pointed to
-// by the k-th (0-based) argument of the mock function to *pointer.
-template <size_t k, typename Ptr>
-internal::SaveArgPointeeAction<k, Ptr> SaveArgPointee(Ptr pointer) {
- return {pointer};
-}
-
-// Action SetArgReferee<k>(value) assigns 'value' to the variable
-// referenced by the k-th (0-based) argument of the mock function.
-template <size_t k, typename T>
-internal::SetArgRefereeAction<k, typename std::decay<T>::type> SetArgReferee(
- T&& value) {
- return {std::forward<T>(value)};
-}
-
-// Action SetArrayArgument<k>(first, last) copies the elements in
-// source range [first, last) to the array pointed to by the k-th
-// (0-based) argument, which can be either a pointer or an
-// iterator. The action does not take ownership of the elements in the
-// source range.
-template <size_t k, typename I1, typename I2>
-internal::SetArrayArgumentAction<k, I1, I2> SetArrayArgument(I1 first,
- I2 last) {
- return {first, last};
-}
-
-// Action DeleteArg<k>() deletes the k-th (0-based) argument of the mock
-// function.
-template <size_t k>
-internal::DeleteArgAction<k> DeleteArg() {
- return {};
-}
-
-// This action returns the value pointed to by 'pointer'.
-template <typename Ptr>
-internal::ReturnPointeeAction<Ptr> ReturnPointee(Ptr pointer) {
- return {pointer};
-}
-
-// Action Throw(exception) can be used in a mock function of any type
-// to throw the given exception. Any copyable value can be thrown.
-#if GTEST_HAS_EXCEPTIONS
-template <typename T>
-internal::ThrowAction<typename std::decay<T>::type> Throw(T&& exception) {
- return {std::forward<T>(exception)};
-}
-#endif // GTEST_HAS_EXCEPTIONS
-
-namespace internal {
-
-// A macro from the ACTION* family (defined later in gmock-generated-actions.h)
-// defines an action that can be used in a mock function. Typically,
-// these actions only care about a subset of the arguments of the mock
-// function. For example, if such an action only uses the second
-// argument, it can be used in any mock function that takes >= 2
-// arguments where the type of the second argument is compatible.
-//
-// Therefore, the action implementation must be prepared to take more
-// arguments than it needs. The ExcessiveArg type is used to
-// represent those excessive arguments. In order to keep the compiler
-// error messages tractable, we define it in the testing namespace
-// instead of testing::internal. However, this is an INTERNAL TYPE
-// and subject to change without notice, so a user MUST NOT USE THIS
-// TYPE DIRECTLY.
-struct ExcessiveArg {};
-
-// Builds an implementation of an Action<> for some particular signature, using
-// a class defined by an ACTION* macro.
-template <typename F, typename Impl> struct ActionImpl;
-
-template <typename Impl>
-struct ImplBase {
- struct Holder {
- // Allows each copy of the Action<> to get to the Impl.
- explicit operator const Impl&() const { return *ptr; }
- std::shared_ptr<Impl> ptr;
- };
- using type = typename std::conditional<std::is_constructible<Impl>::value,
- Impl, Holder>::type;
-};
-
-template <typename R, typename... Args, typename Impl>
-struct ActionImpl<R(Args...), Impl> : ImplBase<Impl>::type {
- using Base = typename ImplBase<Impl>::type;
- using function_type = R(Args...);
- using args_type = std::tuple<Args...>;
-
- ActionImpl() = default; // Only defined if appropriate for Base.
- explicit ActionImpl(std::shared_ptr<Impl> impl) : Base{std::move(impl)} { }
-
- R operator()(Args&&... arg) const {
- static constexpr size_t kMaxArgs =
- sizeof...(Args) <= 10 ? sizeof...(Args) : 10;
- return Apply(MakeIndexSequence<kMaxArgs>{},
- MakeIndexSequence<10 - kMaxArgs>{},
- args_type{std::forward<Args>(arg)...});
- }
-
- template <std::size_t... arg_id, std::size_t... excess_id>
- R Apply(IndexSequence<arg_id...>, IndexSequence<excess_id...>,
- const args_type& args) const {
- // Impl need not be specific to the signature of action being implemented;
- // only the implementing function body needs to have all of the specific
- // types instantiated. Up to 10 of the args that are provided by the
- // args_type get passed, followed by a dummy of unspecified type for the
- // remainder up to 10 explicit args.
- static constexpr ExcessiveArg kExcessArg{};
- return static_cast<const Impl&>(*this).template gmock_PerformImpl<
- /*function_type=*/function_type, /*return_type=*/R,
- /*args_type=*/args_type,
- /*argN_type=*/typename std::tuple_element<arg_id, args_type>::type...>(
- /*args=*/args, std::get<arg_id>(args)...,
- ((void)excess_id, kExcessArg)...);
- }
-};
-
-// Stores a default-constructed Impl as part of the Action<>'s
-// std::function<>. The Impl should be trivial to copy.
-template <typename F, typename Impl>
-::testing::Action<F> MakeAction() {
- return ::testing::Action<F>(ActionImpl<F, Impl>());
-}
-
-// Stores just the one given instance of Impl.
-template <typename F, typename Impl>
-::testing::Action<F> MakeAction(std::shared_ptr<Impl> impl) {
- return ::testing::Action<F>(ActionImpl<F, Impl>(std::move(impl)));
-}
-
-#define GMOCK_INTERNAL_ARG_UNUSED(i, data, el) \
- , const arg##i##_type& arg##i GTEST_ATTRIBUTE_UNUSED_
-#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_ \
- const args_type& args GTEST_ATTRIBUTE_UNUSED_ GMOCK_PP_REPEAT( \
- GMOCK_INTERNAL_ARG_UNUSED, , 10)
-
-#define GMOCK_INTERNAL_ARG(i, data, el) , const arg##i##_type& arg##i
-#define GMOCK_ACTION_ARG_TYPES_AND_NAMES_ \
- const args_type& args GMOCK_PP_REPEAT(GMOCK_INTERNAL_ARG, , 10)
-
-#define GMOCK_INTERNAL_TEMPLATE_ARG(i, data, el) , typename arg##i##_type
-#define GMOCK_ACTION_TEMPLATE_ARGS_NAMES_ \
- GMOCK_PP_TAIL(GMOCK_PP_REPEAT(GMOCK_INTERNAL_TEMPLATE_ARG, , 10))
-
-#define GMOCK_INTERNAL_TYPENAME_PARAM(i, data, param) , typename param##_type
-#define GMOCK_ACTION_TYPENAME_PARAMS_(params) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPENAME_PARAM, , params))
-
-#define GMOCK_INTERNAL_TYPE_PARAM(i, data, param) , param##_type
-#define GMOCK_ACTION_TYPE_PARAMS_(params) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_PARAM, , params))
-
-#define GMOCK_INTERNAL_TYPE_GVALUE_PARAM(i, data, param) \
- , param##_type gmock_p##i
-#define GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_TYPE_GVALUE_PARAM, , params))
-
-#define GMOCK_INTERNAL_GVALUE_PARAM(i, data, param) \
- , std::forward<param##_type>(gmock_p##i)
-#define GMOCK_ACTION_GVALUE_PARAMS_(params) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GVALUE_PARAM, , params))
-
-#define GMOCK_INTERNAL_INIT_PARAM(i, data, param) \
- , param(::std::forward<param##_type>(gmock_p##i))
-#define GMOCK_ACTION_INIT_PARAMS_(params) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_INIT_PARAM, , params))
-
-#define GMOCK_INTERNAL_FIELD_PARAM(i, data, param) param##_type param;
-#define GMOCK_ACTION_FIELD_PARAMS_(params) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_FIELD_PARAM, , params)
-
-#define GMOCK_INTERNAL_ACTION(name, full_name, params) \
- template <GMOCK_ACTION_TYPENAME_PARAMS_(params)> \
- class full_name { \
- public: \
- explicit full_name(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \
- : impl_(std::make_shared<gmock_Impl>( \
- GMOCK_ACTION_GVALUE_PARAMS_(params))) { } \
- full_name(const full_name&) = default; \
- full_name(full_name&&) noexcept = default; \
- template <typename F> \
- operator ::testing::Action<F>() const { \
- return ::testing::internal::MakeAction<F>(impl_); \
- } \
- private: \
- class gmock_Impl { \
- public: \
- explicit gmock_Impl(GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) \
- : GMOCK_ACTION_INIT_PARAMS_(params) {} \
- template <typename function_type, typename return_type, \
- typename args_type, GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
- GMOCK_ACTION_FIELD_PARAMS_(params) \
- }; \
- std::shared_ptr<const gmock_Impl> impl_; \
- }; \
- template <GMOCK_ACTION_TYPENAME_PARAMS_(params)> \
- inline full_name<GMOCK_ACTION_TYPE_PARAMS_(params)> name( \
- GMOCK_ACTION_TYPE_GVALUE_PARAMS_(params)) { \
- return full_name<GMOCK_ACTION_TYPE_PARAMS_(params)>( \
- GMOCK_ACTION_GVALUE_PARAMS_(params)); \
- } \
- template <GMOCK_ACTION_TYPENAME_PARAMS_(params)> \
- template <typename function_type, typename return_type, typename args_type, \
- GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type full_name<GMOCK_ACTION_TYPE_PARAMS_(params)>::gmock_Impl:: \
- gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-} // namespace internal
-
-// Similar to GMOCK_INTERNAL_ACTION, but no bound parameters are stored.
-#define ACTION(name) \
- class name##Action { \
- public: \
- explicit name##Action() noexcept {} \
- name##Action(const name##Action&) noexcept {} \
- template <typename F> \
- operator ::testing::Action<F>() const { \
- return ::testing::internal::MakeAction<F, gmock_Impl>(); \
- } \
- private: \
- class gmock_Impl { \
- public: \
- template <typename function_type, typename return_type, \
- typename args_type, GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
- }; \
- }; \
- inline name##Action name() GTEST_MUST_USE_RESULT_; \
- inline name##Action name() { return name##Action(); } \
- template <typename function_type, typename return_type, typename args_type, \
- GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type name##Action::gmock_Impl::gmock_PerformImpl( \
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-#define ACTION_P(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP, (__VA_ARGS__))
-
-#define ACTION_P2(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP2, (__VA_ARGS__))
-
-#define ACTION_P3(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP3, (__VA_ARGS__))
-
-#define ACTION_P4(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP4, (__VA_ARGS__))
-
-#define ACTION_P5(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP5, (__VA_ARGS__))
-
-#define ACTION_P6(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP6, (__VA_ARGS__))
-
-#define ACTION_P7(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP7, (__VA_ARGS__))
-
-#define ACTION_P8(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP8, (__VA_ARGS__))
-
-#define ACTION_P9(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP9, (__VA_ARGS__))
-
-#define ACTION_P10(name, ...) \
- GMOCK_INTERNAL_ACTION(name, name##ActionP10, (__VA_ARGS__))
-
-} // namespace testing
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_ACTIONS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-cardinalities.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-cardinalities.h
deleted file mode 100644
index 48196dd2f4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-cardinalities.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used cardinalities. More
-// cardinalities can be defined by the user implementing the
-// CardinalityInterface interface if necessary.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
-
-#include <limits.h>
-#include <memory>
-#include <ostream> // NOLINT
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-namespace testing {
-
-// To implement a cardinality Foo, define:
-// 1. a class FooCardinality that implements the
-// CardinalityInterface interface, and
-// 2. a factory function that creates a Cardinality object from a
-// const FooCardinality*.
-//
-// The two-level delegation design follows that of Matcher, providing
-// consistency for extension developers. It also eases ownership
-// management as Cardinality objects can now be copied like plain values.
-
-// The implementation of a cardinality.
-class CardinalityInterface {
- public:
- virtual ~CardinalityInterface() {}
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- virtual int ConservativeLowerBound() const { return 0; }
- virtual int ConservativeUpperBound() const { return INT_MAX; }
-
- // Returns true if and only if call_count calls will satisfy this
- // cardinality.
- virtual bool IsSatisfiedByCallCount(int call_count) const = 0;
-
- // Returns true if and only if call_count calls will saturate this
- // cardinality.
- virtual bool IsSaturatedByCallCount(int call_count) const = 0;
-
- // Describes self to an ostream.
- virtual void DescribeTo(::std::ostream* os) const = 0;
-};
-
-// A Cardinality is a copyable and IMMUTABLE (except by assignment)
-// object that specifies how many times a mock function is expected to
-// be called. The implementation of Cardinality is just a std::shared_ptr
-// to const CardinalityInterface. Don't inherit from Cardinality!
-class GTEST_API_ Cardinality {
- public:
- // Constructs a null cardinality. Needed for storing Cardinality
- // objects in STL containers.
- Cardinality() {}
-
- // Constructs a Cardinality from its implementation.
- explicit Cardinality(const CardinalityInterface* impl) : impl_(impl) {}
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- int ConservativeLowerBound() const { return impl_->ConservativeLowerBound(); }
- int ConservativeUpperBound() const { return impl_->ConservativeUpperBound(); }
-
- // Returns true if and only if call_count calls will satisfy this
- // cardinality.
- bool IsSatisfiedByCallCount(int call_count) const {
- return impl_->IsSatisfiedByCallCount(call_count);
- }
-
- // Returns true if and only if call_count calls will saturate this
- // cardinality.
- bool IsSaturatedByCallCount(int call_count) const {
- return impl_->IsSaturatedByCallCount(call_count);
- }
-
- // Returns true if and only if call_count calls will over-saturate this
- // cardinality, i.e. exceed the maximum number of allowed calls.
- bool IsOverSaturatedByCallCount(int call_count) const {
- return impl_->IsSaturatedByCallCount(call_count) &&
- !impl_->IsSatisfiedByCallCount(call_count);
- }
-
- // Describes self to an ostream
- void DescribeTo(::std::ostream* os) const { impl_->DescribeTo(os); }
-
- // Describes the given actual call count to an ostream.
- static void DescribeActualCallCountTo(int actual_call_count,
- ::std::ostream* os);
-
- private:
- std::shared_ptr<const CardinalityInterface> impl_;
-};
-
-// Creates a cardinality that allows at least n calls.
-GTEST_API_ Cardinality AtLeast(int n);
-
-// Creates a cardinality that allows at most n calls.
-GTEST_API_ Cardinality AtMost(int n);
-
-// Creates a cardinality that allows any number of calls.
-GTEST_API_ Cardinality AnyNumber();
-
-// Creates a cardinality that allows between min and max calls.
-GTEST_API_ Cardinality Between(int min, int max);
-
-// Creates a cardinality that allows exactly n calls.
-GTEST_API_ Cardinality Exactly(int n);
-
-// Creates a cardinality from its implementation.
-inline Cardinality MakeCardinality(const CardinalityInterface* c) {
- return Cardinality(c);
-}
-
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_CARDINALITIES_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-function-mocker.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-function-mocker.h
deleted file mode 100644
index 2de1d41b1a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-function-mocker.h
+++ /dev/null
@@ -1,514 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements MOCK_METHOD.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_ // NOLINT
-
-#include <type_traits> // IWYU pragma: keep
-#include <utility> // IWYU pragma: keep
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-pp.h"
-
-namespace testing {
-namespace internal {
-template <typename T>
-using identity_t = T;
-
-template <typename Pattern>
-struct ThisRefAdjuster {
- template <typename T>
- using AdjustT = typename std::conditional<
- std::is_const<typename std::remove_reference<Pattern>::type>::value,
- typename std::conditional<std::is_lvalue_reference<Pattern>::value,
- const T&, const T&&>::type,
- typename std::conditional<std::is_lvalue_reference<Pattern>::value, T&,
- T&&>::type>::type;
-
- template <typename MockType>
- static AdjustT<MockType> Adjust(const MockType& mock) {
- return static_cast<AdjustT<MockType>>(const_cast<MockType&>(mock));
- }
-};
-
-constexpr bool PrefixOf(const char* a, const char* b) {
- return *a == 0 || (*a == *b && internal::PrefixOf(a + 1, b + 1));
-}
-
-template <int N, int M>
-constexpr bool StartsWith(const char (&prefix)[N], const char (&str)[M]) {
- return N <= M && internal::PrefixOf(prefix, str);
-}
-
-template <int N, int M>
-constexpr bool EndsWith(const char (&suffix)[N], const char (&str)[M]) {
- return N <= M && internal::PrefixOf(suffix, str + M - N);
-}
-
-template <int N, int M>
-constexpr bool Equals(const char (&a)[N], const char (&b)[M]) {
- return N == M && internal::PrefixOf(a, b);
-}
-
-template <int N>
-constexpr bool ValidateSpec(const char (&spec)[N]) {
- return internal::Equals("const", spec) ||
- internal::Equals("override", spec) ||
- internal::Equals("final", spec) ||
- internal::Equals("noexcept", spec) ||
- (internal::StartsWith("noexcept(", spec) &&
- internal::EndsWith(")", spec)) ||
- internal::Equals("ref(&)", spec) ||
- internal::Equals("ref(&&)", spec) ||
- (internal::StartsWith("Calltype(", spec) &&
- internal::EndsWith(")", spec));
-}
-
-} // namespace internal
-
-// The style guide prohibits "using" statements in a namespace scope
-// inside a header file. However, the FunctionMocker class template
-// is meant to be defined in the ::testing namespace. The following
-// line is just a trick for working around a bug in MSVC 8.0, which
-// cannot handle it if we define FunctionMocker in ::testing.
-using internal::FunctionMocker;
-} // namespace testing
-
-#define MOCK_METHOD(...) \
- GMOCK_PP_VARIADIC_CALL(GMOCK_INTERNAL_MOCK_METHOD_ARG_, __VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_1(...) \
- GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_2(...) \
- GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_3(_Ret, _MethodName, _Args) \
- GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, ())
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_4(_Ret, _MethodName, _Args, _Spec) \
- GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Args); \
- GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Spec); \
- GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \
- GMOCK_PP_NARG0 _Args, GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)); \
- GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \
- GMOCK_INTERNAL_MOCK_METHOD_IMPL( \
- GMOCK_PP_NARG0 _Args, _MethodName, GMOCK_INTERNAL_HAS_CONST(_Spec), \
- GMOCK_INTERNAL_HAS_OVERRIDE(_Spec), GMOCK_INTERNAL_HAS_FINAL(_Spec), \
- GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Spec), \
- GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Spec), \
- GMOCK_INTERNAL_GET_REF_SPEC(_Spec), \
- (GMOCK_INTERNAL_SIGNATURE(_Ret, _Args)))
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_5(...) \
- GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_6(...) \
- GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_ARG_7(...) \
- GMOCK_INTERNAL_WRONG_ARITY(__VA_ARGS__)
-
-#define GMOCK_INTERNAL_WRONG_ARITY(...) \
- static_assert( \
- false, \
- "MOCK_METHOD must be called with 3 or 4 arguments. _Ret, " \
- "_MethodName, _Args and optionally _Spec. _Args and _Spec must be " \
- "enclosed in parentheses. If _Ret is a type with unprotected commas, " \
- "it must also be enclosed in parentheses.")
-
-#define GMOCK_INTERNAL_ASSERT_PARENTHESIS(_Tuple) \
- static_assert( \
- GMOCK_PP_IS_ENCLOSED_PARENS(_Tuple), \
- GMOCK_PP_STRINGIZE(_Tuple) " should be enclosed in parentheses.")
-
-#define GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE(_N, ...) \
- static_assert( \
- std::is_function<__VA_ARGS__>::value, \
- "Signature must be a function type, maybe return type contains " \
- "unprotected comma."); \
- static_assert( \
- ::testing::tuple_size<typename ::testing::internal::Function< \
- __VA_ARGS__>::ArgumentTuple>::value == _N, \
- "This method does not take " GMOCK_PP_STRINGIZE( \
- _N) " arguments. Parenthesize all types with unprotected commas.")
-
-#define GMOCK_INTERNAL_ASSERT_VALID_SPEC(_Spec) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT, ~, _Spec)
-
-#define GMOCK_INTERNAL_MOCK_METHOD_IMPL(_N, _MethodName, _Constness, \
- _Override, _Final, _NoexceptSpec, \
- _CallType, _RefSpec, _Signature) \
- typename ::testing::internal::Function<GMOCK_PP_REMOVE_PARENS( \
- _Signature)>::Result \
- GMOCK_INTERNAL_EXPAND(_CallType) \
- _MethodName(GMOCK_PP_REPEAT(GMOCK_INTERNAL_PARAMETER, _Signature, _N)) \
- GMOCK_PP_IF(_Constness, const, ) _RefSpec _NoexceptSpec \
- GMOCK_PP_IF(_Override, override, ) GMOCK_PP_IF(_Final, final, ) { \
- GMOCK_MOCKER_(_N, _Constness, _MethodName) \
- .SetOwnerAndName(this, #_MethodName); \
- return GMOCK_MOCKER_(_N, _Constness, _MethodName) \
- .Invoke(GMOCK_PP_REPEAT(GMOCK_INTERNAL_FORWARD_ARG, _Signature, _N)); \
- } \
- ::testing::MockSpec<GMOCK_PP_REMOVE_PARENS(_Signature)> gmock_##_MethodName( \
- GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_PARAMETER, _Signature, _N)) \
- GMOCK_PP_IF(_Constness, const, ) _RefSpec { \
- GMOCK_MOCKER_(_N, _Constness, _MethodName).RegisterOwner(this); \
- return GMOCK_MOCKER_(_N, _Constness, _MethodName) \
- .With(GMOCK_PP_REPEAT(GMOCK_INTERNAL_MATCHER_ARGUMENT, , _N)); \
- } \
- ::testing::MockSpec<GMOCK_PP_REMOVE_PARENS(_Signature)> gmock_##_MethodName( \
- const ::testing::internal::WithoutMatchers&, \
- GMOCK_PP_IF(_Constness, const, )::testing::internal::Function< \
- GMOCK_PP_REMOVE_PARENS(_Signature)>*) const _RefSpec _NoexceptSpec { \
- return ::testing::internal::ThisRefAdjuster<GMOCK_PP_IF( \
- _Constness, const, ) int _RefSpec>::Adjust(*this) \
- .gmock_##_MethodName(GMOCK_PP_REPEAT( \
- GMOCK_INTERNAL_A_MATCHER_ARGUMENT, _Signature, _N)); \
- } \
- mutable ::testing::FunctionMocker<GMOCK_PP_REMOVE_PARENS(_Signature)> \
- GMOCK_MOCKER_(_N, _Constness, _MethodName)
-
-#define GMOCK_INTERNAL_EXPAND(...) __VA_ARGS__
-
-// Valid modifiers.
-#define GMOCK_INTERNAL_HAS_CONST(_Tuple) \
- GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_CONST, ~, _Tuple))
-
-#define GMOCK_INTERNAL_HAS_OVERRIDE(_Tuple) \
- GMOCK_PP_HAS_COMMA( \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_OVERRIDE, ~, _Tuple))
-
-#define GMOCK_INTERNAL_HAS_FINAL(_Tuple) \
- GMOCK_PP_HAS_COMMA(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_DETECT_FINAL, ~, _Tuple))
-
-#define GMOCK_INTERNAL_GET_NOEXCEPT_SPEC(_Tuple) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT, ~, _Tuple)
-
-#define GMOCK_INTERNAL_NOEXCEPT_SPEC_IF_NOEXCEPT(_i, _, _elem) \
- GMOCK_PP_IF( \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)), \
- _elem, )
-
-#define GMOCK_INTERNAL_GET_CALLTYPE_SPEC(_Tuple) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE, ~, _Tuple)
-
-#define GMOCK_INTERNAL_CALLTYPE_SPEC_IF_CALLTYPE(_i, _, _elem) \
- GMOCK_PP_IF( \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem)), \
- GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), )
-
-#define GMOCK_INTERNAL_GET_REF_SPEC(_Tuple) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_REF_SPEC_IF_REF, ~, _Tuple)
-
-#define GMOCK_INTERNAL_REF_SPEC_IF_REF(_i, _, _elem) \
- GMOCK_PP_IF(GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)), \
- GMOCK_PP_CAT(GMOCK_INTERNAL_UNPACK_, _elem), )
-
-#ifdef GMOCK_INTERNAL_STRICT_SPEC_ASSERT
-#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \
- static_assert( \
- ::testing::internal::ValidateSpec(GMOCK_PP_STRINGIZE(_elem)), \
- "Token \'" GMOCK_PP_STRINGIZE( \
- _elem) "\' cannot be recognized as a valid specification " \
- "modifier. Is a ',' missing?");
-#else
-#define GMOCK_INTERNAL_ASSERT_VALID_SPEC_ELEMENT(_i, _, _elem) \
- static_assert( \
- (GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem)) + \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem)) + \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem)) + \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem)) + \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_REF(_i, _, _elem)) + \
- GMOCK_PP_HAS_COMMA(GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem))) == 1, \
- GMOCK_PP_STRINGIZE( \
- _elem) " cannot be recognized as a valid specification modifier.");
-#endif // GMOCK_INTERNAL_STRICT_SPEC_ASSERT
-
-// Modifiers implementation.
-#define GMOCK_INTERNAL_DETECT_CONST(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CONST_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_CONST_I_const ,
-
-#define GMOCK_INTERNAL_DETECT_OVERRIDE(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_OVERRIDE_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_OVERRIDE_I_override ,
-
-#define GMOCK_INTERNAL_DETECT_FINAL(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_FINAL_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_FINAL_I_final ,
-
-#define GMOCK_INTERNAL_DETECT_NOEXCEPT(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_NOEXCEPT_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_NOEXCEPT_I_noexcept ,
-
-#define GMOCK_INTERNAL_DETECT_REF(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_REF_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_REF_I_ref ,
-
-#define GMOCK_INTERNAL_UNPACK_ref(x) x
-
-#define GMOCK_INTERNAL_DETECT_CALLTYPE(_i, _, _elem) \
- GMOCK_PP_CAT(GMOCK_INTERNAL_DETECT_CALLTYPE_I_, _elem)
-
-#define GMOCK_INTERNAL_DETECT_CALLTYPE_I_Calltype ,
-
-#define GMOCK_INTERNAL_UNPACK_Calltype(...) __VA_ARGS__
-
-// Note: The use of `identity_t` here allows _Ret to represent return types that
-// would normally need to be specified in a different way. For example, a method
-// returning a function pointer must be written as
-//
-// fn_ptr_return_t (*method(method_args_t...))(fn_ptr_args_t...)
-//
-// But we only support placing the return type at the beginning. To handle this,
-// we wrap all calls in identity_t, so that a declaration will be expanded to
-//
-// identity_t<fn_ptr_return_t (*)(fn_ptr_args_t...)> method(method_args_t...)
-//
-// This allows us to work around the syntactic oddities of function/method
-// types.
-#define GMOCK_INTERNAL_SIGNATURE(_Ret, _Args) \
- ::testing::internal::identity_t<GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(_Ret), \
- GMOCK_PP_REMOVE_PARENS, \
- GMOCK_PP_IDENTITY)(_Ret)>( \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_GET_TYPE, _, _Args))
-
-#define GMOCK_INTERNAL_GET_TYPE(_i, _, _elem) \
- GMOCK_PP_COMMA_IF(_i) \
- GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(_elem), GMOCK_PP_REMOVE_PARENS, \
- GMOCK_PP_IDENTITY) \
- (_elem)
-
-#define GMOCK_INTERNAL_PARAMETER(_i, _Signature, _) \
- GMOCK_PP_COMMA_IF(_i) \
- GMOCK_INTERNAL_ARG_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \
- gmock_a##_i
-
-#define GMOCK_INTERNAL_FORWARD_ARG(_i, _Signature, _) \
- GMOCK_PP_COMMA_IF(_i) \
- ::std::forward<GMOCK_INTERNAL_ARG_O( \
- _i, GMOCK_PP_REMOVE_PARENS(_Signature))>(gmock_a##_i)
-
-#define GMOCK_INTERNAL_MATCHER_PARAMETER(_i, _Signature, _) \
- GMOCK_PP_COMMA_IF(_i) \
- GMOCK_INTERNAL_MATCHER_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature)) \
- gmock_a##_i
-
-#define GMOCK_INTERNAL_MATCHER_ARGUMENT(_i, _1, _2) \
- GMOCK_PP_COMMA_IF(_i) \
- gmock_a##_i
-
-#define GMOCK_INTERNAL_A_MATCHER_ARGUMENT(_i, _Signature, _) \
- GMOCK_PP_COMMA_IF(_i) \
- ::testing::A<GMOCK_INTERNAL_ARG_O(_i, GMOCK_PP_REMOVE_PARENS(_Signature))>()
-
-#define GMOCK_INTERNAL_ARG_O(_i, ...) \
- typename ::testing::internal::Function<__VA_ARGS__>::template Arg<_i>::type
-
-#define GMOCK_INTERNAL_MATCHER_O(_i, ...) \
- const ::testing::Matcher<typename ::testing::internal::Function< \
- __VA_ARGS__>::template Arg<_i>::type>&
-
-#define MOCK_METHOD0(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 0, __VA_ARGS__)
-#define MOCK_METHOD1(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 1, __VA_ARGS__)
-#define MOCK_METHOD2(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 2, __VA_ARGS__)
-#define MOCK_METHOD3(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 3, __VA_ARGS__)
-#define MOCK_METHOD4(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 4, __VA_ARGS__)
-#define MOCK_METHOD5(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 5, __VA_ARGS__)
-#define MOCK_METHOD6(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 6, __VA_ARGS__)
-#define MOCK_METHOD7(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 7, __VA_ARGS__)
-#define MOCK_METHOD8(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 8, __VA_ARGS__)
-#define MOCK_METHOD9(m, ...) GMOCK_INTERNAL_MOCK_METHODN(, , m, 9, __VA_ARGS__)
-#define MOCK_METHOD10(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, , m, 10, __VA_ARGS__)
-
-#define MOCK_CONST_METHOD0(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 0, __VA_ARGS__)
-#define MOCK_CONST_METHOD1(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 1, __VA_ARGS__)
-#define MOCK_CONST_METHOD2(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 2, __VA_ARGS__)
-#define MOCK_CONST_METHOD3(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 3, __VA_ARGS__)
-#define MOCK_CONST_METHOD4(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 4, __VA_ARGS__)
-#define MOCK_CONST_METHOD5(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 5, __VA_ARGS__)
-#define MOCK_CONST_METHOD6(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 6, __VA_ARGS__)
-#define MOCK_CONST_METHOD7(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 7, __VA_ARGS__)
-#define MOCK_CONST_METHOD8(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 8, __VA_ARGS__)
-#define MOCK_CONST_METHOD9(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 9, __VA_ARGS__)
-#define MOCK_CONST_METHOD10(m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, , m, 10, __VA_ARGS__)
-
-#define MOCK_METHOD0_T(m, ...) MOCK_METHOD0(m, __VA_ARGS__)
-#define MOCK_METHOD1_T(m, ...) MOCK_METHOD1(m, __VA_ARGS__)
-#define MOCK_METHOD2_T(m, ...) MOCK_METHOD2(m, __VA_ARGS__)
-#define MOCK_METHOD3_T(m, ...) MOCK_METHOD3(m, __VA_ARGS__)
-#define MOCK_METHOD4_T(m, ...) MOCK_METHOD4(m, __VA_ARGS__)
-#define MOCK_METHOD5_T(m, ...) MOCK_METHOD5(m, __VA_ARGS__)
-#define MOCK_METHOD6_T(m, ...) MOCK_METHOD6(m, __VA_ARGS__)
-#define MOCK_METHOD7_T(m, ...) MOCK_METHOD7(m, __VA_ARGS__)
-#define MOCK_METHOD8_T(m, ...) MOCK_METHOD8(m, __VA_ARGS__)
-#define MOCK_METHOD9_T(m, ...) MOCK_METHOD9(m, __VA_ARGS__)
-#define MOCK_METHOD10_T(m, ...) MOCK_METHOD10(m, __VA_ARGS__)
-
-#define MOCK_CONST_METHOD0_T(m, ...) MOCK_CONST_METHOD0(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD1_T(m, ...) MOCK_CONST_METHOD1(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD2_T(m, ...) MOCK_CONST_METHOD2(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD3_T(m, ...) MOCK_CONST_METHOD3(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD4_T(m, ...) MOCK_CONST_METHOD4(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD5_T(m, ...) MOCK_CONST_METHOD5(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD6_T(m, ...) MOCK_CONST_METHOD6(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD7_T(m, ...) MOCK_CONST_METHOD7(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD8_T(m, ...) MOCK_CONST_METHOD8(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD9_T(m, ...) MOCK_CONST_METHOD9(m, __VA_ARGS__)
-#define MOCK_CONST_METHOD10_T(m, ...) MOCK_CONST_METHOD10(m, __VA_ARGS__)
-
-#define MOCK_METHOD0_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 0, __VA_ARGS__)
-#define MOCK_METHOD1_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 1, __VA_ARGS__)
-#define MOCK_METHOD2_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 2, __VA_ARGS__)
-#define MOCK_METHOD3_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 3, __VA_ARGS__)
-#define MOCK_METHOD4_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 4, __VA_ARGS__)
-#define MOCK_METHOD5_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 5, __VA_ARGS__)
-#define MOCK_METHOD6_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 6, __VA_ARGS__)
-#define MOCK_METHOD7_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 7, __VA_ARGS__)
-#define MOCK_METHOD8_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 8, __VA_ARGS__)
-#define MOCK_METHOD9_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 9, __VA_ARGS__)
-#define MOCK_METHOD10_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(, ct, m, 10, __VA_ARGS__)
-
-#define MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 0, __VA_ARGS__)
-#define MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 1, __VA_ARGS__)
-#define MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 2, __VA_ARGS__)
-#define MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 3, __VA_ARGS__)
-#define MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 4, __VA_ARGS__)
-#define MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 5, __VA_ARGS__)
-#define MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 6, __VA_ARGS__)
-#define MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 7, __VA_ARGS__)
-#define MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 8, __VA_ARGS__)
-#define MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 9, __VA_ARGS__)
-#define MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, ...) \
- GMOCK_INTERNAL_MOCK_METHODN(const, ct, m, 10, __VA_ARGS__)
-
-#define MOCK_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-
-#define MOCK_CONST_METHOD0_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD0_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD1_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD1_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD2_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD2_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD3_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD3_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD4_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD4_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD5_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD5_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD6_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD6_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD7_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD7_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD8_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD8_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD9_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD9_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-#define MOCK_CONST_METHOD10_T_WITH_CALLTYPE(ct, m, ...) \
- MOCK_CONST_METHOD10_WITH_CALLTYPE(ct, m, __VA_ARGS__)
-
-#define GMOCK_INTERNAL_MOCK_METHODN(constness, ct, Method, args_num, ...) \
- GMOCK_INTERNAL_ASSERT_VALID_SIGNATURE( \
- args_num, ::testing::internal::identity_t<__VA_ARGS__>); \
- GMOCK_INTERNAL_MOCK_METHOD_IMPL( \
- args_num, Method, GMOCK_PP_NARG0(constness), 0, 0, , ct, , \
- (::testing::internal::identity_t<__VA_ARGS__>))
-
-#define GMOCK_MOCKER_(arity, constness, Method) \
- GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__)
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_FUNCTION_MOCKER_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-matchers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-matchers.h
deleted file mode 100644
index 5cf5019d52..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-matchers.h
+++ /dev/null
@@ -1,5572 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// The MATCHER* family of macros can be used in a namespace scope to
-// define custom matchers easily.
-//
-// Basic Usage
-// ===========
-//
-// The syntax
-//
-// MATCHER(name, description_string) { statements; }
-//
-// defines a matcher with the given name that executes the statements,
-// which must return a bool to indicate if the match succeeds. Inside
-// the statements, you can refer to the value being matched by 'arg',
-// and refer to its type by 'arg_type'.
-//
-// The description string documents what the matcher does, and is used
-// to generate the failure message when the match fails. Since a
-// MATCHER() is usually defined in a header file shared by multiple
-// C++ source files, we require the description to be a C-string
-// literal to avoid possible side effects. It can be empty, in which
-// case we'll use the sequence of words in the matcher name as the
-// description.
-//
-// For example:
-//
-// MATCHER(IsEven, "") { return (arg % 2) == 0; }
-//
-// allows you to write
-//
-// // Expects mock_foo.Bar(n) to be called where n is even.
-// EXPECT_CALL(mock_foo, Bar(IsEven()));
-//
-// or,
-//
-// // Verifies that the value of some_expression is even.
-// EXPECT_THAT(some_expression, IsEven());
-//
-// If the above assertion fails, it will print something like:
-//
-// Value of: some_expression
-// Expected: is even
-// Actual: 7
-//
-// where the description "is even" is automatically calculated from the
-// matcher name IsEven.
-//
-// Argument Type
-// =============
-//
-// Note that the type of the value being matched (arg_type) is
-// determined by the context in which you use the matcher and is
-// supplied to you by the compiler, so you don't need to worry about
-// declaring it (nor can you). This allows the matcher to be
-// polymorphic. For example, IsEven() can be used to match any type
-// where the value of "(arg % 2) == 0" can be implicitly converted to
-// a bool. In the "Bar(IsEven())" example above, if method Bar()
-// takes an int, 'arg_type' will be int; if it takes an unsigned long,
-// 'arg_type' will be unsigned long; and so on.
-//
-// Parameterizing Matchers
-// =======================
-//
-// Sometimes you'll want to parameterize the matcher. For that you
-// can use another macro:
-//
-// MATCHER_P(name, param_name, description_string) { statements; }
-//
-// For example:
-//
-// MATCHER_P(HasAbsoluteValue, value, "") { return abs(arg) == value; }
-//
-// will allow you to write:
-//
-// EXPECT_THAT(Blah("a"), HasAbsoluteValue(n));
-//
-// which may lead to this message (assuming n is 10):
-//
-// Value of: Blah("a")
-// Expected: has absolute value 10
-// Actual: -9
-//
-// Note that both the matcher description and its parameter are
-// printed, making the message human-friendly.
-//
-// In the matcher definition body, you can write 'foo_type' to
-// reference the type of a parameter named 'foo'. For example, in the
-// body of MATCHER_P(HasAbsoluteValue, value) above, you can write
-// 'value_type' to refer to the type of 'value'.
-//
-// We also provide MATCHER_P2, MATCHER_P3, ..., up to MATCHER_P$n to
-// support multi-parameter matchers.
-//
-// Describing Parameterized Matchers
-// =================================
-//
-// The last argument to MATCHER*() is a string-typed expression. The
-// expression can reference all of the matcher's parameters and a
-// special bool-typed variable named 'negation'. When 'negation' is
-// false, the expression should evaluate to the matcher's description;
-// otherwise it should evaluate to the description of the negation of
-// the matcher. For example,
-//
-// using testing::PrintToString;
-//
-// MATCHER_P2(InClosedRange, low, hi,
-// std::string(negation ? "is not" : "is") + " in range [" +
-// PrintToString(low) + ", " + PrintToString(hi) + "]") {
-// return low <= arg && arg <= hi;
-// }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: is in range [4, 6]
-// ...
-// Expected: is not in range [2, 4]
-//
-// If you specify "" as the description, the failure message will
-// contain the sequence of words in the matcher name followed by the
-// parameter values printed as a tuple. For example,
-//
-// MATCHER_P2(InClosedRange, low, hi, "") { ... }
-// ...
-// EXPECT_THAT(3, InClosedRange(4, 6));
-// EXPECT_THAT(3, Not(InClosedRange(2, 4)));
-//
-// would generate two failures that contain the text:
-//
-// Expected: in closed range (4, 6)
-// ...
-// Expected: not (in closed range (2, 4))
-//
-// Types of Matcher Parameters
-// ===========================
-//
-// For the purpose of typing, you can view
-//
-// MATCHER_Pk(Foo, p1, ..., pk, description_string) { ... }
-//
-// as shorthand for
-//
-// template <typename p1_type, ..., typename pk_type>
-// FooMatcherPk<p1_type, ..., pk_type>
-// Foo(p1_type p1, ..., pk_type pk) { ... }
-//
-// When you write Foo(v1, ..., vk), the compiler infers the types of
-// the parameters v1, ..., and vk for you. If you are not happy with
-// the result of the type inference, you can specify the types by
-// explicitly instantiating the template, as in Foo<long, bool>(5,
-// false). As said earlier, you don't get to (or need to) specify
-// 'arg_type' as that's determined by the context in which the matcher
-// is used. You can assign the result of expression Foo(p1, ..., pk)
-// to a variable of type FooMatcherPk<p1_type, ..., pk_type>. This
-// can be useful when composing matchers.
-//
-// While you can instantiate a matcher template with reference types,
-// passing the parameters by pointer usually makes your code more
-// readable. If, however, you still want to pass a parameter by
-// reference, be aware that in the failure message generated by the
-// matcher you will see the value of the referenced object but not its
-// address.
-//
-// Explaining Match Results
-// ========================
-//
-// Sometimes the matcher description alone isn't enough to explain why
-// the match has failed or succeeded. For example, when expecting a
-// long string, it can be very helpful to also print the diff between
-// the expected string and the actual one. To achieve that, you can
-// optionally stream additional information to a special variable
-// named result_listener, whose type is a pointer to class
-// MatchResultListener:
-//
-// MATCHER_P(EqualsLongString, str, "") {
-// if (arg == str) return true;
-//
-// *result_listener << "the difference: "
-/// << DiffStrings(str, arg);
-// return false;
-// }
-//
-// Overloading Matchers
-// ====================
-//
-// You can overload matchers with different numbers of parameters:
-//
-// MATCHER_P(Blah, a, description_string1) { ... }
-// MATCHER_P2(Blah, a, b, description_string2) { ... }
-//
-// Caveats
-// =======
-//
-// When defining a new matcher, you should also consider implementing
-// MatcherInterface or using MakePolymorphicMatcher(). These
-// approaches require more work than the MATCHER* macros, but also
-// give you more control on the types of the value being matched and
-// the matcher parameters, which may leads to better compiler error
-// messages when the matcher is used wrong. They also allow
-// overloading matchers based on parameter types (as opposed to just
-// based on the number of parameters).
-//
-// MATCHER*() can only be used in a namespace scope as templates cannot be
-// declared inside of a local class.
-//
-// More Information
-// ================
-//
-// To learn more about using these macros, please search for 'MATCHER'
-// on
-// https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md
-//
-// This file also implements some commonly used argument matchers. More
-// matchers can be defined by the user implementing the
-// MatcherInterface<T> interface if necessary.
-//
-// See googletest/include/gtest/gtest-matchers.h for the definition of class
-// Matcher, class MatcherInterface, and others.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
-
-#include <algorithm>
-#include <cmath>
-#include <initializer_list>
-#include <iterator>
-#include <limits>
-#include <memory>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include <type_traits>
-#include <utility>
-#include <vector>
-
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gmock/internal/gmock-pp.h"
-#include "gtest/gtest.h"
-
-// MSVC warning C5046 is new as of VS2017 version 15.8.
-#if defined(_MSC_VER) && _MSC_VER >= 1915
-#define GMOCK_MAYBE_5046_ 5046
-#else
-#define GMOCK_MAYBE_5046_
-#endif
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(
- 4251 GMOCK_MAYBE_5046_ /* class A needs to have dll-interface to be used by
- clients of class B */
- /* Symbol involving type with internal linkage not defined */)
-
-namespace testing {
-
-// To implement a matcher Foo for type T, define:
-// 1. a class FooMatcherImpl that implements the
-// MatcherInterface<T> interface, and
-// 2. a factory function that creates a Matcher<T> object from a
-// FooMatcherImpl*.
-//
-// The two-level delegation design makes it possible to allow a user
-// to write "v" instead of "Eq(v)" where a Matcher is expected, which
-// is impossible if we pass matchers by pointers. It also eases
-// ownership management as Matcher objects can now be copied like
-// plain values.
-
-// A match result listener that stores the explanation in a string.
-class StringMatchResultListener : public MatchResultListener {
- public:
- StringMatchResultListener() : MatchResultListener(&ss_) {}
-
- // Returns the explanation accumulated so far.
- std::string str() const { return ss_.str(); }
-
- // Clears the explanation accumulated so far.
- void Clear() { ss_.str(""); }
-
- private:
- ::std::stringstream ss_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StringMatchResultListener);
-};
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// The MatcherCastImpl class template is a helper for implementing
-// MatcherCast(). We need this helper in order to partially
-// specialize the implementation of MatcherCast() (C++ allows
-// class/struct templates to be partially specialized, but not
-// function templates.).
-
-// This general version is used when MatcherCast()'s argument is a
-// polymorphic matcher (i.e. something that can be converted to a
-// Matcher but is not one yet; for example, Eq(value)) or a value (for
-// example, "hello").
-template <typename T, typename M>
-class MatcherCastImpl {
- public:
- static Matcher<T> Cast(const M& polymorphic_matcher_or_value) {
- // M can be a polymorphic matcher, in which case we want to use
- // its conversion operator to create Matcher<T>. Or it can be a value
- // that should be passed to the Matcher<T>'s constructor.
- //
- // We can't call Matcher<T>(polymorphic_matcher_or_value) when M is a
- // polymorphic matcher because it'll be ambiguous if T has an implicit
- // constructor from M (this usually happens when T has an implicit
- // constructor from any type).
- //
- // It won't work to unconditionally implicit_cast
- // polymorphic_matcher_or_value to Matcher<T> because it won't trigger
- // a user-defined conversion from M to T if one exists (assuming M is
- // a value).
- return CastImpl(polymorphic_matcher_or_value,
- std::is_convertible<M, Matcher<T>>{},
- std::is_convertible<M, T>{});
- }
-
- private:
- template <bool Ignore>
- static Matcher<T> CastImpl(const M& polymorphic_matcher_or_value,
- std::true_type /* convertible_to_matcher */,
- std::integral_constant<bool, Ignore>) {
- // M is implicitly convertible to Matcher<T>, which means that either
- // M is a polymorphic matcher or Matcher<T> has an implicit constructor
- // from M. In both cases using the implicit conversion will produce a
- // matcher.
- //
- // Even if T has an implicit constructor from M, it won't be called because
- // creating Matcher<T> would require a chain of two user-defined conversions
- // (first to create T from M and then to create Matcher<T> from T).
- return polymorphic_matcher_or_value;
- }
-
- // M can't be implicitly converted to Matcher<T>, so M isn't a polymorphic
- // matcher. It's a value of a type implicitly convertible to T. Use direct
- // initialization to create a matcher.
- static Matcher<T> CastImpl(const M& value,
- std::false_type /* convertible_to_matcher */,
- std::true_type /* convertible_to_T */) {
- return Matcher<T>(ImplicitCast_<T>(value));
- }
-
- // M can't be implicitly converted to either Matcher<T> or T. Attempt to use
- // polymorphic matcher Eq(value) in this case.
- //
- // Note that we first attempt to perform an implicit cast on the value and
- // only fall back to the polymorphic Eq() matcher afterwards because the
- // latter calls bool operator==(const Lhs& lhs, const Rhs& rhs) in the end
- // which might be undefined even when Rhs is implicitly convertible to Lhs
- // (e.g. std::pair<const int, int> vs. std::pair<int, int>).
- //
- // We don't define this method inline as we need the declaration of Eq().
- static Matcher<T> CastImpl(const M& value,
- std::false_type /* convertible_to_matcher */,
- std::false_type /* convertible_to_T */);
-};
-
-// This more specialized version is used when MatcherCast()'s argument
-// is already a Matcher. This only compiles when type T can be
-// statically converted to type U.
-template <typename T, typename U>
-class MatcherCastImpl<T, Matcher<U>> {
- public:
- static Matcher<T> Cast(const Matcher<U>& source_matcher) {
- return Matcher<T>(new Impl(source_matcher));
- }
-
- private:
- class Impl : public MatcherInterface<T> {
- public:
- explicit Impl(const Matcher<U>& source_matcher)
- : source_matcher_(source_matcher) {}
-
- // We delegate the matching logic to the source matcher.
- bool MatchAndExplain(T x, MatchResultListener* listener) const override {
- using FromType = typename std::remove_cv<typename std::remove_pointer<
- typename std::remove_reference<T>::type>::type>::type;
- using ToType = typename std::remove_cv<typename std::remove_pointer<
- typename std::remove_reference<U>::type>::type>::type;
- // Do not allow implicitly converting base*/& to derived*/&.
- static_assert(
- // Do not trigger if only one of them is a pointer. That implies a
- // regular conversion and not a down_cast.
- (std::is_pointer<typename std::remove_reference<T>::type>::value !=
- std::is_pointer<typename std::remove_reference<U>::type>::value) ||
- std::is_same<FromType, ToType>::value ||
- !std::is_base_of<FromType, ToType>::value,
- "Can't implicitly convert from <base> to <derived>");
-
- // Do the cast to `U` explicitly if necessary.
- // Otherwise, let implicit conversions do the trick.
- using CastType =
- typename std::conditional<std::is_convertible<T&, const U&>::value,
- T&, U>::type;
-
- return source_matcher_.MatchAndExplain(static_cast<CastType>(x),
- listener);
- }
-
- void DescribeTo(::std::ostream* os) const override {
- source_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- source_matcher_.DescribeNegationTo(os);
- }
-
- private:
- const Matcher<U> source_matcher_;
- };
-};
-
-// This even more specialized version is used for efficiently casting
-// a matcher to its own type.
-template <typename T>
-class MatcherCastImpl<T, Matcher<T>> {
- public:
- static Matcher<T> Cast(const Matcher<T>& matcher) { return matcher; }
-};
-
-// Template specialization for parameterless Matcher.
-template <typename Derived>
-class MatcherBaseImpl {
- public:
- MatcherBaseImpl() = default;
-
- template <typename T>
- operator ::testing::Matcher<T>() const { // NOLINT(runtime/explicit)
- return ::testing::Matcher<T>(new
- typename Derived::template gmock_Impl<T>());
- }
-};
-
-// Template specialization for Matcher with parameters.
-template <template <typename...> class Derived, typename... Ts>
-class MatcherBaseImpl<Derived<Ts...>> {
- public:
- // Mark the constructor explicit for single argument T to avoid implicit
- // conversions.
- template <typename E = std::enable_if<sizeof...(Ts) == 1>,
- typename E::type* = nullptr>
- explicit MatcherBaseImpl(Ts... params)
- : params_(std::forward<Ts>(params)...) {}
- template <typename E = std::enable_if<sizeof...(Ts) != 1>,
- typename = typename E::type>
- MatcherBaseImpl(Ts... params) // NOLINT
- : params_(std::forward<Ts>(params)...) {}
-
- template <typename F>
- operator ::testing::Matcher<F>() const { // NOLINT(runtime/explicit)
- return Apply<F>(MakeIndexSequence<sizeof...(Ts)>{});
- }
-
- private:
- template <typename F, std::size_t... tuple_ids>
- ::testing::Matcher<F> Apply(IndexSequence<tuple_ids...>) const {
- return ::testing::Matcher<F>(
- new typename Derived<Ts...>::template gmock_Impl<F>(
- std::get<tuple_ids>(params_)...));
- }
-
- const std::tuple<Ts...> params_;
-};
-
-} // namespace internal
-
-// In order to be safe and clear, casting between different matcher
-// types is done explicitly via MatcherCast<T>(m), which takes a
-// matcher m and returns a Matcher<T>. It compiles only when T can be
-// statically converted to the argument type of m.
-template <typename T, typename M>
-inline Matcher<T> MatcherCast(const M& matcher) {
- return internal::MatcherCastImpl<T, M>::Cast(matcher);
-}
-
-// This overload handles polymorphic matchers and values only since
-// monomorphic matchers are handled by the next one.
-template <typename T, typename M>
-inline Matcher<T> SafeMatcherCast(const M& polymorphic_matcher_or_value) {
- return MatcherCast<T>(polymorphic_matcher_or_value);
-}
-
-// This overload handles monomorphic matchers.
-//
-// In general, if type T can be implicitly converted to type U, we can
-// safely convert a Matcher<U> to a Matcher<T> (i.e. Matcher is
-// contravariant): just keep a copy of the original Matcher<U>, convert the
-// argument from type T to U, and then pass it to the underlying Matcher<U>.
-// The only exception is when U is a reference and T is not, as the
-// underlying Matcher<U> may be interested in the argument's address, which
-// is not preserved in the conversion from T to U.
-template <typename T, typename U>
-inline Matcher<T> SafeMatcherCast(const Matcher<U>& matcher) {
- // Enforce that T can be implicitly converted to U.
- static_assert(std::is_convertible<const T&, const U&>::value,
- "T must be implicitly convertible to U");
- // Enforce that we are not converting a non-reference type T to a reference
- // type U.
- GTEST_COMPILE_ASSERT_(
- std::is_reference<T>::value || !std::is_reference<U>::value,
- cannot_convert_non_reference_arg_to_reference);
- // In case both T and U are arithmetic types, enforce that the
- // conversion is not lossy.
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(T) RawT;
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(U) RawU;
- constexpr bool kTIsOther = GMOCK_KIND_OF_(RawT) == internal::kOther;
- constexpr bool kUIsOther = GMOCK_KIND_OF_(RawU) == internal::kOther;
- GTEST_COMPILE_ASSERT_(
- kTIsOther || kUIsOther ||
- (internal::LosslessArithmeticConvertible<RawT, RawU>::value),
- conversion_of_arithmetic_types_must_be_lossless);
- return MatcherCast<T>(matcher);
-}
-
-// A<T>() returns a matcher that matches any value of type T.
-template <typename T>
-Matcher<T> A();
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// If the explanation is not empty, prints it to the ostream.
-inline void PrintIfNotEmpty(const std::string& explanation,
- ::std::ostream* os) {
- if (explanation != "" && os != nullptr) {
- *os << ", " << explanation;
- }
-}
-
-// Returns true if the given type name is easy to read by a human.
-// This is used to decide whether printing the type of a value might
-// be helpful.
-inline bool IsReadableTypeName(const std::string& type_name) {
- // We consider a type name readable if it's short or doesn't contain
- // a template or function type.
- return (type_name.length() <= 20 ||
- type_name.find_first_of("<(") == std::string::npos);
-}
-
-// Matches the value against the given matcher, prints the value and explains
-// the match result to the listener. Returns the match result.
-// 'listener' must not be NULL.
-// Value cannot be passed by const reference, because some matchers take a
-// non-const argument.
-template <typename Value, typename T>
-bool MatchPrintAndExplain(Value& value, const Matcher<T>& matcher,
- MatchResultListener* listener) {
- if (!listener->IsInterested()) {
- // If the listener is not interested, we do not need to construct the
- // inner explanation.
- return matcher.Matches(value);
- }
-
- StringMatchResultListener inner_listener;
- const bool match = matcher.MatchAndExplain(value, &inner_listener);
-
- UniversalPrint(value, listener->stream());
-#if GTEST_HAS_RTTI
- const std::string& type_name = GetTypeName<Value>();
- if (IsReadableTypeName(type_name))
- *listener->stream() << " (of type " << type_name << ")";
-#endif
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
-
- return match;
-}
-
-// An internal helper class for doing compile-time loop on a tuple's
-// fields.
-template <size_t N>
-class TuplePrefix {
- public:
- // TuplePrefix<N>::Matches(matcher_tuple, value_tuple) returns true
- // if and only if the first N fields of matcher_tuple matches
- // the first N fields of value_tuple, respectively.
- template <typename MatcherTuple, typename ValueTuple>
- static bool Matches(const MatcherTuple& matcher_tuple,
- const ValueTuple& value_tuple) {
- return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) &&
- std::get<N - 1>(matcher_tuple).Matches(std::get<N - 1>(value_tuple));
- }
-
- // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os)
- // describes failures in matching the first N fields of matchers
- // against the first N fields of values. If there is no failure,
- // nothing will be streamed to os.
- template <typename MatcherTuple, typename ValueTuple>
- static void ExplainMatchFailuresTo(const MatcherTuple& matchers,
- const ValueTuple& values,
- ::std::ostream* os) {
- // First, describes failures in the first N - 1 fields.
- TuplePrefix<N - 1>::ExplainMatchFailuresTo(matchers, values, os);
-
- // Then describes the failure (if any) in the (N - 1)-th (0-based)
- // field.
- typename std::tuple_element<N - 1, MatcherTuple>::type matcher =
- std::get<N - 1>(matchers);
- typedef typename std::tuple_element<N - 1, ValueTuple>::type Value;
- const Value& value = std::get<N - 1>(values);
- StringMatchResultListener listener;
- if (!matcher.MatchAndExplain(value, &listener)) {
- *os << " Expected arg #" << N - 1 << ": ";
- std::get<N - 1>(matchers).DescribeTo(os);
- *os << "\n Actual: ";
- // We remove the reference in type Value to prevent the
- // universal printer from printing the address of value, which
- // isn't interesting to the user most of the time. The
- // matcher's MatchAndExplain() method handles the case when
- // the address is interesting.
- internal::UniversalPrint(value, os);
- PrintIfNotEmpty(listener.str(), os);
- *os << "\n";
- }
- }
-};
-
-// The base case.
-template <>
-class TuplePrefix<0> {
- public:
- template <typename MatcherTuple, typename ValueTuple>
- static bool Matches(const MatcherTuple& /* matcher_tuple */,
- const ValueTuple& /* value_tuple */) {
- return true;
- }
-
- template <typename MatcherTuple, typename ValueTuple>
- static void ExplainMatchFailuresTo(const MatcherTuple& /* matchers */,
- const ValueTuple& /* values */,
- ::std::ostream* /* os */) {}
-};
-
-// TupleMatches(matcher_tuple, value_tuple) returns true if and only if
-// all matchers in matcher_tuple match the corresponding fields in
-// value_tuple. It is a compiler error if matcher_tuple and
-// value_tuple have different number of fields or incompatible field
-// types.
-template <typename MatcherTuple, typename ValueTuple>
-bool TupleMatches(const MatcherTuple& matcher_tuple,
- const ValueTuple& value_tuple) {
- // Makes sure that matcher_tuple and value_tuple have the same
- // number of fields.
- GTEST_COMPILE_ASSERT_(std::tuple_size<MatcherTuple>::value ==
- std::tuple_size<ValueTuple>::value,
- matcher_and_value_have_different_numbers_of_fields);
- return TuplePrefix<std::tuple_size<ValueTuple>::value>::Matches(matcher_tuple,
- value_tuple);
-}
-
-// Describes failures in matching matchers against values. If there
-// is no failure, nothing will be streamed to os.
-template <typename MatcherTuple, typename ValueTuple>
-void ExplainMatchFailureTupleTo(const MatcherTuple& matchers,
- const ValueTuple& values, ::std::ostream* os) {
- TuplePrefix<std::tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo(
- matchers, values, os);
-}
-
-// TransformTupleValues and its helper.
-//
-// TransformTupleValuesHelper hides the internal machinery that
-// TransformTupleValues uses to implement a tuple traversal.
-template <typename Tuple, typename Func, typename OutIter>
-class TransformTupleValuesHelper {
- private:
- typedef ::std::tuple_size<Tuple> TupleSize;
-
- public:
- // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'.
- // Returns the final value of 'out' in case the caller needs it.
- static OutIter Run(Func f, const Tuple& t, OutIter out) {
- return IterateOverTuple<Tuple, TupleSize::value>()(f, t, out);
- }
-
- private:
- template <typename Tup, size_t kRemainingSize>
- struct IterateOverTuple {
- OutIter operator()(Func f, const Tup& t, OutIter out) const {
- *out++ = f(::std::get<TupleSize::value - kRemainingSize>(t));
- return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out);
- }
- };
- template <typename Tup>
- struct IterateOverTuple<Tup, 0> {
- OutIter operator()(Func /* f */, const Tup& /* t */, OutIter out) const {
- return out;
- }
- };
-};
-
-// Successively invokes 'f(element)' on each element of the tuple 't',
-// appending each result to the 'out' iterator. Returns the final value
-// of 'out'.
-template <typename Tuple, typename Func, typename OutIter>
-OutIter TransformTupleValues(Func f, const Tuple& t, OutIter out) {
- return TransformTupleValuesHelper<Tuple, Func, OutIter>::Run(f, t, out);
-}
-
-// Implements _, a matcher that matches any value of any
-// type. This is a polymorphic matcher, so we need a template type
-// conversion operator to make it appearing as a Matcher<T> for any
-// type T.
-class AnythingMatcher {
- public:
- using is_gtest_matcher = void;
-
- template <typename T>
- bool MatchAndExplain(const T& /* x */, std::ostream* /* listener */) const {
- return true;
- }
- void DescribeTo(std::ostream* os) const { *os << "is anything"; }
- void DescribeNegationTo(::std::ostream* os) const {
- // This is mostly for completeness' sake, as it's not very useful
- // to write Not(A<bool>()). However we cannot completely rule out
- // such a possibility, and it doesn't hurt to be prepared.
- *os << "never matches";
- }
-};
-
-// Implements the polymorphic IsNull() matcher, which matches any raw or smart
-// pointer that is NULL.
-class IsNullMatcher {
- public:
- template <typename Pointer>
- bool MatchAndExplain(const Pointer& p,
- MatchResultListener* /* listener */) const {
- return p == nullptr;
- }
-
- void DescribeTo(::std::ostream* os) const { *os << "is NULL"; }
- void DescribeNegationTo(::std::ostream* os) const { *os << "isn't NULL"; }
-};
-
-// Implements the polymorphic NotNull() matcher, which matches any raw or smart
-// pointer that is not NULL.
-class NotNullMatcher {
- public:
- template <typename Pointer>
- bool MatchAndExplain(const Pointer& p,
- MatchResultListener* /* listener */) const {
- return p != nullptr;
- }
-
- void DescribeTo(::std::ostream* os) const { *os << "isn't NULL"; }
- void DescribeNegationTo(::std::ostream* os) const { *os << "is NULL"; }
-};
-
-// Ref(variable) matches any argument that is a reference to
-// 'variable'. This matcher is polymorphic as it can match any
-// super type of the type of 'variable'.
-//
-// The RefMatcher template class implements Ref(variable). It can
-// only be instantiated with a reference type. This prevents a user
-// from mistakenly using Ref(x) to match a non-reference function
-// argument. For example, the following will righteously cause a
-// compiler error:
-//
-// int n;
-// Matcher<int> m1 = Ref(n); // This won't compile.
-// Matcher<int&> m2 = Ref(n); // This will compile.
-template <typename T>
-class RefMatcher;
-
-template <typename T>
-class RefMatcher<T&> {
- // Google Mock is a generic framework and thus needs to support
- // mocking any function types, including those that take non-const
- // reference arguments. Therefore the template parameter T (and
- // Super below) can be instantiated to either a const type or a
- // non-const type.
- public:
- // RefMatcher() takes a T& instead of const T&, as we want the
- // compiler to catch using Ref(const_value) as a matcher for a
- // non-const reference.
- explicit RefMatcher(T& x) : object_(x) {} // NOLINT
-
- template <typename Super>
- operator Matcher<Super&>() const {
- // By passing object_ (type T&) to Impl(), which expects a Super&,
- // we make sure that Super is a super type of T. In particular,
- // this catches using Ref(const_value) as a matcher for a
- // non-const reference, as you cannot implicitly convert a const
- // reference to a non-const reference.
- return MakeMatcher(new Impl<Super>(object_));
- }
-
- private:
- template <typename Super>
- class Impl : public MatcherInterface<Super&> {
- public:
- explicit Impl(Super& x) : object_(x) {} // NOLINT
-
- // MatchAndExplain() takes a Super& (as opposed to const Super&)
- // in order to match the interface MatcherInterface<Super&>.
- bool MatchAndExplain(Super& x,
- MatchResultListener* listener) const override {
- *listener << "which is located @" << static_cast<const void*>(&x);
- return &x == &object_;
- }
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "references the variable ";
- UniversalPrinter<Super&>::Print(object_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "does not reference the variable ";
- UniversalPrinter<Super&>::Print(object_, os);
- }
-
- private:
- const Super& object_;
- };
-
- T& object_;
-};
-
-// Polymorphic helper functions for narrow and wide string matchers.
-inline bool CaseInsensitiveCStringEquals(const char* lhs, const char* rhs) {
- return String::CaseInsensitiveCStringEquals(lhs, rhs);
-}
-
-inline bool CaseInsensitiveCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs) {
- return String::CaseInsensitiveWideCStringEquals(lhs, rhs);
-}
-
-// String comparison for narrow or wide strings that can have embedded NUL
-// characters.
-template <typename StringType>
-bool CaseInsensitiveStringEquals(const StringType& s1, const StringType& s2) {
- // Are the heads equal?
- if (!CaseInsensitiveCStringEquals(s1.c_str(), s2.c_str())) {
- return false;
- }
-
- // Skip the equal heads.
- const typename StringType::value_type nul = 0;
- const size_t i1 = s1.find(nul), i2 = s2.find(nul);
-
- // Are we at the end of either s1 or s2?
- if (i1 == StringType::npos || i2 == StringType::npos) {
- return i1 == i2;
- }
-
- // Are the tails equal?
- return CaseInsensitiveStringEquals(s1.substr(i1 + 1), s2.substr(i2 + 1));
-}
-
-// String matchers.
-
-// Implements equality-based string matchers like StrEq, StrCaseNe, and etc.
-template <typename StringType>
-class StrEqualityMatcher {
- public:
- StrEqualityMatcher(StringType str, bool expect_eq, bool case_sensitive)
- : string_(std::move(str)),
- expect_eq_(expect_eq),
- case_sensitive_(case_sensitive) {}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- bool MatchAndExplain(const internal::StringView& s,
- MatchResultListener* listener) const {
- // This should fail to compile if StringView is used with wide
- // strings.
- const StringType& str = std::string(s);
- return MatchAndExplain(str, listener);
- }
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Accepts pointer types, particularly:
- // const char*
- // char*
- // const wchar_t*
- // wchar_t*
- template <typename CharType>
- bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
- if (s == nullptr) {
- return !expect_eq_;
- }
- return MatchAndExplain(StringType(s), listener);
- }
-
- // Matches anything that can convert to StringType.
- //
- // This is a template, not just a plain function with const StringType&,
- // because StringView has some interfering non-explicit constructors.
- template <typename MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* /* listener */) const {
- const StringType s2(s);
- const bool eq = case_sensitive_ ? s2 == string_
- : CaseInsensitiveStringEquals(s2, string_);
- return expect_eq_ == eq;
- }
-
- void DescribeTo(::std::ostream* os) const {
- DescribeToHelper(expect_eq_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- DescribeToHelper(!expect_eq_, os);
- }
-
- private:
- void DescribeToHelper(bool expect_eq, ::std::ostream* os) const {
- *os << (expect_eq ? "is " : "isn't ");
- *os << "equal to ";
- if (!case_sensitive_) {
- *os << "(ignoring case) ";
- }
- UniversalPrint(string_, os);
- }
-
- const StringType string_;
- const bool expect_eq_;
- const bool case_sensitive_;
-};
-
-// Implements the polymorphic HasSubstr(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class HasSubstrMatcher {
- public:
- explicit HasSubstrMatcher(const StringType& substring)
- : substring_(substring) {}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- bool MatchAndExplain(const internal::StringView& s,
- MatchResultListener* listener) const {
- // This should fail to compile if StringView is used with wide
- // strings.
- const StringType& str = std::string(s);
- return MatchAndExplain(str, listener);
- }
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Accepts pointer types, particularly:
- // const char*
- // char*
- // const wchar_t*
- // wchar_t*
- template <typename CharType>
- bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
- return s != nullptr && MatchAndExplain(StringType(s), listener);
- }
-
- // Matches anything that can convert to StringType.
- //
- // This is a template, not just a plain function with const StringType&,
- // because StringView has some interfering non-explicit constructors.
- template <typename MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* /* listener */) const {
- return StringType(s).find(substring_) != StringType::npos;
- }
-
- // Describes what this matcher matches.
- void DescribeTo(::std::ostream* os) const {
- *os << "has substring ";
- UniversalPrint(substring_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "has no substring ";
- UniversalPrint(substring_, os);
- }
-
- private:
- const StringType substring_;
-};
-
-// Implements the polymorphic StartsWith(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class StartsWithMatcher {
- public:
- explicit StartsWithMatcher(const StringType& prefix) : prefix_(prefix) {}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- bool MatchAndExplain(const internal::StringView& s,
- MatchResultListener* listener) const {
- // This should fail to compile if StringView is used with wide
- // strings.
- const StringType& str = std::string(s);
- return MatchAndExplain(str, listener);
- }
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Accepts pointer types, particularly:
- // const char*
- // char*
- // const wchar_t*
- // wchar_t*
- template <typename CharType>
- bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
- return s != nullptr && MatchAndExplain(StringType(s), listener);
- }
-
- // Matches anything that can convert to StringType.
- //
- // This is a template, not just a plain function with const StringType&,
- // because StringView has some interfering non-explicit constructors.
- template <typename MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* /* listener */) const {
- const StringType& s2(s);
- return s2.length() >= prefix_.length() &&
- s2.substr(0, prefix_.length()) == prefix_;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "starts with ";
- UniversalPrint(prefix_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't start with ";
- UniversalPrint(prefix_, os);
- }
-
- private:
- const StringType prefix_;
-};
-
-// Implements the polymorphic EndsWith(substring) matcher, which
-// can be used as a Matcher<T> as long as T can be converted to a
-// string.
-template <typename StringType>
-class EndsWithMatcher {
- public:
- explicit EndsWithMatcher(const StringType& suffix) : suffix_(suffix) {}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- bool MatchAndExplain(const internal::StringView& s,
- MatchResultListener* listener) const {
- // This should fail to compile if StringView is used with wide
- // strings.
- const StringType& str = std::string(s);
- return MatchAndExplain(str, listener);
- }
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Accepts pointer types, particularly:
- // const char*
- // char*
- // const wchar_t*
- // wchar_t*
- template <typename CharType>
- bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
- return s != nullptr && MatchAndExplain(StringType(s), listener);
- }
-
- // Matches anything that can convert to StringType.
- //
- // This is a template, not just a plain function with const StringType&,
- // because StringView has some interfering non-explicit constructors.
- template <typename MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* /* listener */) const {
- const StringType& s2(s);
- return s2.length() >= suffix_.length() &&
- s2.substr(s2.length() - suffix_.length()) == suffix_;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "ends with ";
- UniversalPrint(suffix_, os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't end with ";
- UniversalPrint(suffix_, os);
- }
-
- private:
- const StringType suffix_;
-};
-
-// Implements the polymorphic WhenBase64Unescaped(matcher) matcher, which can be
-// used as a Matcher<T> as long as T can be converted to a string.
-class WhenBase64UnescapedMatcher {
- public:
- using is_gtest_matcher = void;
-
- explicit WhenBase64UnescapedMatcher(
- const Matcher<const std::string&>& internal_matcher)
- : internal_matcher_(internal_matcher) {}
-
- // Matches anything that can convert to std::string.
- template <typename MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* listener) const {
- const std::string s2(s); // NOLINT (needed for working with string_view).
- std::string unescaped;
- if (!internal::Base64Unescape(s2, &unescaped)) {
- if (listener != nullptr) {
- *listener << "is not a valid base64 escaped string";
- }
- return false;
- }
- return MatchPrintAndExplain(unescaped, internal_matcher_, listener);
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "matches after Base64Unescape ";
- internal_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "does not match after Base64Unescape ";
- internal_matcher_.DescribeTo(os);
- }
-
- private:
- const Matcher<const std::string&> internal_matcher_;
-};
-
-// Implements a matcher that compares the two fields of a 2-tuple
-// using one of the ==, <=, <, etc, operators. The two fields being
-// compared don't have to have the same type.
-//
-// The matcher defined here is polymorphic (for example, Eq() can be
-// used to match a std::tuple<int, short>, a std::tuple<const long&, double>,
-// etc). Therefore we use a template type conversion operator in the
-// implementation.
-template <typename D, typename Op>
-class PairMatchBase {
- public:
- template <typename T1, typename T2>
- operator Matcher<::std::tuple<T1, T2>>() const {
- return Matcher<::std::tuple<T1, T2>>(new Impl<const ::std::tuple<T1, T2>&>);
- }
- template <typename T1, typename T2>
- operator Matcher<const ::std::tuple<T1, T2>&>() const {
- return MakeMatcher(new Impl<const ::std::tuple<T1, T2>&>);
- }
-
- private:
- static ::std::ostream& GetDesc(::std::ostream& os) { // NOLINT
- return os << D::Desc();
- }
-
- template <typename Tuple>
- class Impl : public MatcherInterface<Tuple> {
- public:
- bool MatchAndExplain(Tuple args,
- MatchResultListener* /* listener */) const override {
- return Op()(::std::get<0>(args), ::std::get<1>(args));
- }
- void DescribeTo(::std::ostream* os) const override {
- *os << "are " << GetDesc;
- }
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "aren't " << GetDesc;
- }
- };
-};
-
-class Eq2Matcher : public PairMatchBase<Eq2Matcher, AnyEq> {
- public:
- static const char* Desc() { return "an equal pair"; }
-};
-class Ne2Matcher : public PairMatchBase<Ne2Matcher, AnyNe> {
- public:
- static const char* Desc() { return "an unequal pair"; }
-};
-class Lt2Matcher : public PairMatchBase<Lt2Matcher, AnyLt> {
- public:
- static const char* Desc() { return "a pair where the first < the second"; }
-};
-class Gt2Matcher : public PairMatchBase<Gt2Matcher, AnyGt> {
- public:
- static const char* Desc() { return "a pair where the first > the second"; }
-};
-class Le2Matcher : public PairMatchBase<Le2Matcher, AnyLe> {
- public:
- static const char* Desc() { return "a pair where the first <= the second"; }
-};
-class Ge2Matcher : public PairMatchBase<Ge2Matcher, AnyGe> {
- public:
- static const char* Desc() { return "a pair where the first >= the second"; }
-};
-
-// Implements the Not(...) matcher for a particular argument type T.
-// We do not nest it inside the NotMatcher class template, as that
-// will prevent different instantiations of NotMatcher from sharing
-// the same NotMatcherImpl<T> class.
-template <typename T>
-class NotMatcherImpl : public MatcherInterface<const T&> {
- public:
- explicit NotMatcherImpl(const Matcher<T>& matcher) : matcher_(matcher) {}
-
- bool MatchAndExplain(const T& x,
- MatchResultListener* listener) const override {
- return !matcher_.MatchAndExplain(x, listener);
- }
-
- void DescribeTo(::std::ostream* os) const override {
- matcher_.DescribeNegationTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- matcher_.DescribeTo(os);
- }
-
- private:
- const Matcher<T> matcher_;
-};
-
-// Implements the Not(m) matcher, which matches a value that doesn't
-// match matcher m.
-template <typename InnerMatcher>
-class NotMatcher {
- public:
- explicit NotMatcher(InnerMatcher matcher) : matcher_(matcher) {}
-
- // This template type conversion operator allows Not(m) to be used
- // to match any type m can match.
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new NotMatcherImpl<T>(SafeMatcherCast<T>(matcher_)));
- }
-
- private:
- InnerMatcher matcher_;
-};
-
-// Implements the AllOf(m1, m2) matcher for a particular argument type
-// T. We do not nest it inside the BothOfMatcher class template, as
-// that will prevent different instantiations of BothOfMatcher from
-// sharing the same BothOfMatcherImpl<T> class.
-template <typename T>
-class AllOfMatcherImpl : public MatcherInterface<const T&> {
- public:
- explicit AllOfMatcherImpl(std::vector<Matcher<T>> matchers)
- : matchers_(std::move(matchers)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "(";
- for (size_t i = 0; i < matchers_.size(); ++i) {
- if (i != 0) *os << ") and (";
- matchers_[i].DescribeTo(os);
- }
- *os << ")";
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "(";
- for (size_t i = 0; i < matchers_.size(); ++i) {
- if (i != 0) *os << ") or (";
- matchers_[i].DescribeNegationTo(os);
- }
- *os << ")";
- }
-
- bool MatchAndExplain(const T& x,
- MatchResultListener* listener) const override {
- // If either matcher1_ or matcher2_ doesn't match x, we only need
- // to explain why one of them fails.
- std::string all_match_result;
-
- for (size_t i = 0; i < matchers_.size(); ++i) {
- StringMatchResultListener slistener;
- if (matchers_[i].MatchAndExplain(x, &slistener)) {
- if (all_match_result.empty()) {
- all_match_result = slistener.str();
- } else {
- std::string result = slistener.str();
- if (!result.empty()) {
- all_match_result += ", and ";
- all_match_result += result;
- }
- }
- } else {
- *listener << slistener.str();
- return false;
- }
- }
-
- // Otherwise we need to explain why *both* of them match.
- *listener << all_match_result;
- return true;
- }
-
- private:
- const std::vector<Matcher<T>> matchers_;
-};
-
-// VariadicMatcher is used for the variadic implementation of
-// AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...).
-// CombiningMatcher<T> is used to recursively combine the provided matchers
-// (of type Args...).
-template <template <typename T> class CombiningMatcher, typename... Args>
-class VariadicMatcher {
- public:
- VariadicMatcher(const Args&... matchers) // NOLINT
- : matchers_(matchers...) {
- static_assert(sizeof...(Args) > 0, "Must have at least one matcher.");
- }
-
- VariadicMatcher(const VariadicMatcher&) = default;
- VariadicMatcher& operator=(const VariadicMatcher&) = delete;
-
- // This template type conversion operator allows an
- // VariadicMatcher<Matcher1, Matcher2...> object to match any type that
- // all of the provided matchers (Matcher1, Matcher2, ...) can match.
- template <typename T>
- operator Matcher<T>() const {
- std::vector<Matcher<T>> values;
- CreateVariadicMatcher<T>(&values, std::integral_constant<size_t, 0>());
- return Matcher<T>(new CombiningMatcher<T>(std::move(values)));
- }
-
- private:
- template <typename T, size_t I>
- void CreateVariadicMatcher(std::vector<Matcher<T>>* values,
- std::integral_constant<size_t, I>) const {
- values->push_back(SafeMatcherCast<T>(std::get<I>(matchers_)));
- CreateVariadicMatcher<T>(values, std::integral_constant<size_t, I + 1>());
- }
-
- template <typename T>
- void CreateVariadicMatcher(
- std::vector<Matcher<T>>*,
- std::integral_constant<size_t, sizeof...(Args)>) const {}
-
- std::tuple<Args...> matchers_;
-};
-
-template <typename... Args>
-using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>;
-
-// Implements the AnyOf(m1, m2) matcher for a particular argument type
-// T. We do not nest it inside the AnyOfMatcher class template, as
-// that will prevent different instantiations of AnyOfMatcher from
-// sharing the same EitherOfMatcherImpl<T> class.
-template <typename T>
-class AnyOfMatcherImpl : public MatcherInterface<const T&> {
- public:
- explicit AnyOfMatcherImpl(std::vector<Matcher<T>> matchers)
- : matchers_(std::move(matchers)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "(";
- for (size_t i = 0; i < matchers_.size(); ++i) {
- if (i != 0) *os << ") or (";
- matchers_[i].DescribeTo(os);
- }
- *os << ")";
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "(";
- for (size_t i = 0; i < matchers_.size(); ++i) {
- if (i != 0) *os << ") and (";
- matchers_[i].DescribeNegationTo(os);
- }
- *os << ")";
- }
-
- bool MatchAndExplain(const T& x,
- MatchResultListener* listener) const override {
- std::string no_match_result;
-
- // If either matcher1_ or matcher2_ matches x, we just need to
- // explain why *one* of them matches.
- for (size_t i = 0; i < matchers_.size(); ++i) {
- StringMatchResultListener slistener;
- if (matchers_[i].MatchAndExplain(x, &slistener)) {
- *listener << slistener.str();
- return true;
- } else {
- if (no_match_result.empty()) {
- no_match_result = slistener.str();
- } else {
- std::string result = slistener.str();
- if (!result.empty()) {
- no_match_result += ", and ";
- no_match_result += result;
- }
- }
- }
- }
-
- // Otherwise we need to explain why *both* of them fail.
- *listener << no_match_result;
- return false;
- }
-
- private:
- const std::vector<Matcher<T>> matchers_;
-};
-
-// AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...).
-template <typename... Args>
-using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>;
-
-// ConditionalMatcher is the implementation of Conditional(cond, m1, m2)
-template <typename MatcherTrue, typename MatcherFalse>
-class ConditionalMatcher {
- public:
- ConditionalMatcher(bool condition, MatcherTrue matcher_true,
- MatcherFalse matcher_false)
- : condition_(condition),
- matcher_true_(std::move(matcher_true)),
- matcher_false_(std::move(matcher_false)) {}
-
- template <typename T>
- operator Matcher<T>() const { // NOLINT(runtime/explicit)
- return condition_ ? SafeMatcherCast<T>(matcher_true_)
- : SafeMatcherCast<T>(matcher_false_);
- }
-
- private:
- bool condition_;
- MatcherTrue matcher_true_;
- MatcherFalse matcher_false_;
-};
-
-// Wrapper for implementation of Any/AllOfArray().
-template <template <class> class MatcherImpl, typename T>
-class SomeOfArrayMatcher {
- public:
- // Constructs the matcher from a sequence of element values or
- // element matchers.
- template <typename Iter>
- SomeOfArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
-
- template <typename U>
- operator Matcher<U>() const { // NOLINT
- using RawU = typename std::decay<U>::type;
- std::vector<Matcher<RawU>> matchers;
- for (const auto& matcher : matchers_) {
- matchers.push_back(MatcherCast<RawU>(matcher));
- }
- return Matcher<U>(new MatcherImpl<RawU>(std::move(matchers)));
- }
-
- private:
- const ::std::vector<T> matchers_;
-};
-
-template <typename T>
-using AllOfArrayMatcher = SomeOfArrayMatcher<AllOfMatcherImpl, T>;
-
-template <typename T>
-using AnyOfArrayMatcher = SomeOfArrayMatcher<AnyOfMatcherImpl, T>;
-
-// Used for implementing Truly(pred), which turns a predicate into a
-// matcher.
-template <typename Predicate>
-class TrulyMatcher {
- public:
- explicit TrulyMatcher(Predicate pred) : predicate_(pred) {}
-
- // This method template allows Truly(pred) to be used as a matcher
- // for type T where T is the argument type of predicate 'pred'. The
- // argument is passed by reference as the predicate may be
- // interested in the address of the argument.
- template <typename T>
- bool MatchAndExplain(T& x, // NOLINT
- MatchResultListener* listener) const {
- // Without the if-statement, MSVC sometimes warns about converting
- // a value to bool (warning 4800).
- //
- // We cannot write 'return !!predicate_(x);' as that doesn't work
- // when predicate_(x) returns a class convertible to bool but
- // having no operator!().
- if (predicate_(x)) return true;
- *listener << "didn't satisfy the given predicate";
- return false;
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << "satisfies the given predicate";
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't satisfy the given predicate";
- }
-
- private:
- Predicate predicate_;
-};
-
-// Used for implementing Matches(matcher), which turns a matcher into
-// a predicate.
-template <typename M>
-class MatcherAsPredicate {
- public:
- explicit MatcherAsPredicate(M matcher) : matcher_(matcher) {}
-
- // This template operator() allows Matches(m) to be used as a
- // predicate on type T where m is a matcher on type T.
- //
- // The argument x is passed by reference instead of by value, as
- // some matcher may be interested in its address (e.g. as in
- // Matches(Ref(n))(x)).
- template <typename T>
- bool operator()(const T& x) const {
- // We let matcher_ commit to a particular type here instead of
- // when the MatcherAsPredicate object was constructed. This
- // allows us to write Matches(m) where m is a polymorphic matcher
- // (e.g. Eq(5)).
- //
- // If we write Matcher<T>(matcher_).Matches(x) here, it won't
- // compile when matcher_ has type Matcher<const T&>; if we write
- // Matcher<const T&>(matcher_).Matches(x) here, it won't compile
- // when matcher_ has type Matcher<T>; if we just write
- // matcher_.Matches(x), it won't compile when matcher_ is
- // polymorphic, e.g. Eq(5).
- //
- // MatcherCast<const T&>() is necessary for making the code work
- // in all of the above situations.
- return MatcherCast<const T&>(matcher_).Matches(x);
- }
-
- private:
- M matcher_;
-};
-
-// For implementing ASSERT_THAT() and EXPECT_THAT(). The template
-// argument M must be a type that can be converted to a matcher.
-template <typename M>
-class PredicateFormatterFromMatcher {
- public:
- explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {}
-
- // This template () operator allows a PredicateFormatterFromMatcher
- // object to act as a predicate-formatter suitable for using with
- // Google Test's EXPECT_PRED_FORMAT1() macro.
- template <typename T>
- AssertionResult operator()(const char* value_text, const T& x) const {
- // We convert matcher_ to a Matcher<const T&> *now* instead of
- // when the PredicateFormatterFromMatcher object was constructed,
- // as matcher_ may be polymorphic (e.g. NotNull()) and we won't
- // know which type to instantiate it to until we actually see the
- // type of x here.
- //
- // We write SafeMatcherCast<const T&>(matcher_) instead of
- // Matcher<const T&>(matcher_), as the latter won't compile when
- // matcher_ has type Matcher<T> (e.g. An<int>()).
- // We don't write MatcherCast<const T&> either, as that allows
- // potentially unsafe downcasting of the matcher argument.
- const Matcher<const T&> matcher = SafeMatcherCast<const T&>(matcher_);
-
- // The expected path here is that the matcher should match (i.e. that most
- // tests pass) so optimize for this case.
- if (matcher.Matches(x)) {
- return AssertionSuccess();
- }
-
- ::std::stringstream ss;
- ss << "Value of: " << value_text << "\n"
- << "Expected: ";
- matcher.DescribeTo(&ss);
-
- // Rerun the matcher to "PrintAndExplain" the failure.
- StringMatchResultListener listener;
- if (MatchPrintAndExplain(x, matcher, &listener)) {
- ss << "\n The matcher failed on the initial attempt; but passed when "
- "rerun to generate the explanation.";
- }
- ss << "\n Actual: " << listener.str();
- return AssertionFailure() << ss.str();
- }
-
- private:
- const M matcher_;
-};
-
-// A helper function for converting a matcher to a predicate-formatter
-// without the user needing to explicitly write the type. This is
-// used for implementing ASSERT_THAT() and EXPECT_THAT().
-// Implementation detail: 'matcher' is received by-value to force decaying.
-template <typename M>
-inline PredicateFormatterFromMatcher<M> MakePredicateFormatterFromMatcher(
- M matcher) {
- return PredicateFormatterFromMatcher<M>(std::move(matcher));
-}
-
-// Implements the polymorphic IsNan() matcher, which matches any floating type
-// value that is Nan.
-class IsNanMatcher {
- public:
- template <typename FloatType>
- bool MatchAndExplain(const FloatType& f,
- MatchResultListener* /* listener */) const {
- return (::std::isnan)(f);
- }
-
- void DescribeTo(::std::ostream* os) const { *os << "is NaN"; }
- void DescribeNegationTo(::std::ostream* os) const { *os << "isn't NaN"; }
-};
-
-// Implements the polymorphic floating point equality matcher, which matches
-// two float values using ULP-based approximation or, optionally, a
-// user-specified epsilon. The template is meant to be instantiated with
-// FloatType being either float or double.
-template <typename FloatType>
-class FloatingEqMatcher {
- public:
- // Constructor for FloatingEqMatcher.
- // The matcher's input will be compared with expected. The matcher treats two
- // NANs as equal if nan_eq_nan is true. Otherwise, under IEEE standards,
- // equality comparisons between NANs will always return false. We specify a
- // negative max_abs_error_ term to indicate that ULP-based approximation will
- // be used for comparison.
- FloatingEqMatcher(FloatType expected, bool nan_eq_nan)
- : expected_(expected), nan_eq_nan_(nan_eq_nan), max_abs_error_(-1) {}
-
- // Constructor that supports a user-specified max_abs_error that will be used
- // for comparison instead of ULP-based approximation. The max absolute
- // should be non-negative.
- FloatingEqMatcher(FloatType expected, bool nan_eq_nan,
- FloatType max_abs_error)
- : expected_(expected),
- nan_eq_nan_(nan_eq_nan),
- max_abs_error_(max_abs_error) {
- GTEST_CHECK_(max_abs_error >= 0)
- << ", where max_abs_error is" << max_abs_error;
- }
-
- // Implements floating point equality matcher as a Matcher<T>.
- template <typename T>
- class Impl : public MatcherInterface<T> {
- public:
- Impl(FloatType expected, bool nan_eq_nan, FloatType max_abs_error)
- : expected_(expected),
- nan_eq_nan_(nan_eq_nan),
- max_abs_error_(max_abs_error) {}
-
- bool MatchAndExplain(T value,
- MatchResultListener* listener) const override {
- const FloatingPoint<FloatType> actual(value), expected(expected_);
-
- // Compares NaNs first, if nan_eq_nan_ is true.
- if (actual.is_nan() || expected.is_nan()) {
- if (actual.is_nan() && expected.is_nan()) {
- return nan_eq_nan_;
- }
- // One is nan; the other is not nan.
- return false;
- }
- if (HasMaxAbsError()) {
- // We perform an equality check so that inf will match inf, regardless
- // of error bounds. If the result of value - expected_ would result in
- // overflow or if either value is inf, the default result is infinity,
- // which should only match if max_abs_error_ is also infinity.
- if (value == expected_) {
- return true;
- }
-
- const FloatType diff = value - expected_;
- if (::std::fabs(diff) <= max_abs_error_) {
- return true;
- }
-
- if (listener->IsInterested()) {
- *listener << "which is " << diff << " from " << expected_;
- }
- return false;
- } else {
- return actual.AlmostEquals(expected);
- }
- }
-
- void DescribeTo(::std::ostream* os) const override {
- // os->precision() returns the previously set precision, which we
- // store to restore the ostream to its original configuration
- // after outputting.
- const ::std::streamsize old_precision =
- os->precision(::std::numeric_limits<FloatType>::digits10 + 2);
- if (FloatingPoint<FloatType>(expected_).is_nan()) {
- if (nan_eq_nan_) {
- *os << "is NaN";
- } else {
- *os << "never matches";
- }
- } else {
- *os << "is approximately " << expected_;
- if (HasMaxAbsError()) {
- *os << " (absolute error <= " << max_abs_error_ << ")";
- }
- }
- os->precision(old_precision);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- // As before, get original precision.
- const ::std::streamsize old_precision =
- os->precision(::std::numeric_limits<FloatType>::digits10 + 2);
- if (FloatingPoint<FloatType>(expected_).is_nan()) {
- if (nan_eq_nan_) {
- *os << "isn't NaN";
- } else {
- *os << "is anything";
- }
- } else {
- *os << "isn't approximately " << expected_;
- if (HasMaxAbsError()) {
- *os << " (absolute error > " << max_abs_error_ << ")";
- }
- }
- // Restore original precision.
- os->precision(old_precision);
- }
-
- private:
- bool HasMaxAbsError() const { return max_abs_error_ >= 0; }
-
- const FloatType expected_;
- const bool nan_eq_nan_;
- // max_abs_error will be used for value comparison when >= 0.
- const FloatType max_abs_error_;
- };
-
- // The following 3 type conversion operators allow FloatEq(expected) and
- // NanSensitiveFloatEq(expected) to be used as a Matcher<float>, a
- // Matcher<const float&>, or a Matcher<float&>, but nothing else.
- operator Matcher<FloatType>() const {
- return MakeMatcher(
- new Impl<FloatType>(expected_, nan_eq_nan_, max_abs_error_));
- }
-
- operator Matcher<const FloatType&>() const {
- return MakeMatcher(
- new Impl<const FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
- }
-
- operator Matcher<FloatType&>() const {
- return MakeMatcher(
- new Impl<FloatType&>(expected_, nan_eq_nan_, max_abs_error_));
- }
-
- private:
- const FloatType expected_;
- const bool nan_eq_nan_;
- // max_abs_error will be used for value comparison when >= 0.
- const FloatType max_abs_error_;
-};
-
-// A 2-tuple ("binary") wrapper around FloatingEqMatcher:
-// FloatingEq2Matcher() matches (x, y) by matching FloatingEqMatcher(x, false)
-// against y, and FloatingEq2Matcher(e) matches FloatingEqMatcher(x, false, e)
-// against y. The former implements "Eq", the latter "Near". At present, there
-// is no version that compares NaNs as equal.
-template <typename FloatType>
-class FloatingEq2Matcher {
- public:
- FloatingEq2Matcher() { Init(-1, false); }
-
- explicit FloatingEq2Matcher(bool nan_eq_nan) { Init(-1, nan_eq_nan); }
-
- explicit FloatingEq2Matcher(FloatType max_abs_error) {
- Init(max_abs_error, false);
- }
-
- FloatingEq2Matcher(FloatType max_abs_error, bool nan_eq_nan) {
- Init(max_abs_error, nan_eq_nan);
- }
-
- template <typename T1, typename T2>
- operator Matcher<::std::tuple<T1, T2>>() const {
- return MakeMatcher(
- new Impl<::std::tuple<T1, T2>>(max_abs_error_, nan_eq_nan_));
- }
- template <typename T1, typename T2>
- operator Matcher<const ::std::tuple<T1, T2>&>() const {
- return MakeMatcher(
- new Impl<const ::std::tuple<T1, T2>&>(max_abs_error_, nan_eq_nan_));
- }
-
- private:
- static ::std::ostream& GetDesc(::std::ostream& os) { // NOLINT
- return os << "an almost-equal pair";
- }
-
- template <typename Tuple>
- class Impl : public MatcherInterface<Tuple> {
- public:
- Impl(FloatType max_abs_error, bool nan_eq_nan)
- : max_abs_error_(max_abs_error), nan_eq_nan_(nan_eq_nan) {}
-
- bool MatchAndExplain(Tuple args,
- MatchResultListener* listener) const override {
- if (max_abs_error_ == -1) {
- FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_);
- return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
- ::std::get<1>(args), listener);
- } else {
- FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_,
- max_abs_error_);
- return static_cast<Matcher<FloatType>>(fm).MatchAndExplain(
- ::std::get<1>(args), listener);
- }
- }
- void DescribeTo(::std::ostream* os) const override {
- *os << "are " << GetDesc;
- }
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "aren't " << GetDesc;
- }
-
- private:
- FloatType max_abs_error_;
- const bool nan_eq_nan_;
- };
-
- void Init(FloatType max_abs_error_val, bool nan_eq_nan_val) {
- max_abs_error_ = max_abs_error_val;
- nan_eq_nan_ = nan_eq_nan_val;
- }
- FloatType max_abs_error_;
- bool nan_eq_nan_;
-};
-
-// Implements the Pointee(m) matcher for matching a pointer whose
-// pointee matches matcher m. The pointer can be either raw or smart.
-template <typename InnerMatcher>
-class PointeeMatcher {
- public:
- explicit PointeeMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
-
- // This type conversion operator template allows Pointee(m) to be
- // used as a matcher for any pointer type whose pointee type is
- // compatible with the inner matcher, where type Pointer can be
- // either a raw pointer or a smart pointer.
- //
- // The reason we do this instead of relying on
- // MakePolymorphicMatcher() is that the latter is not flexible
- // enough for implementing the DescribeTo() method of Pointee().
- template <typename Pointer>
- operator Matcher<Pointer>() const {
- return Matcher<Pointer>(new Impl<const Pointer&>(matcher_));
- }
-
- private:
- // The monomorphic implementation that works for a particular pointer type.
- template <typename Pointer>
- class Impl : public MatcherInterface<Pointer> {
- public:
- using Pointee =
- typename std::pointer_traits<GTEST_REMOVE_REFERENCE_AND_CONST_(
- Pointer)>::element_type;
-
- explicit Impl(const InnerMatcher& matcher)
- : matcher_(MatcherCast<const Pointee&>(matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "points to a value that ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "does not point to a value that ";
- matcher_.DescribeTo(os);
- }
-
- bool MatchAndExplain(Pointer pointer,
- MatchResultListener* listener) const override {
- if (GetRawPointer(pointer) == nullptr) return false;
-
- *listener << "which points to ";
- return MatchPrintAndExplain(*pointer, matcher_, listener);
- }
-
- private:
- const Matcher<const Pointee&> matcher_;
- };
-
- const InnerMatcher matcher_;
-};
-
-// Implements the Pointer(m) matcher
-// Implements the Pointer(m) matcher for matching a pointer that matches matcher
-// m. The pointer can be either raw or smart, and will match `m` against the
-// raw pointer.
-template <typename InnerMatcher>
-class PointerMatcher {
- public:
- explicit PointerMatcher(const InnerMatcher& matcher) : matcher_(matcher) {}
-
- // This type conversion operator template allows Pointer(m) to be
- // used as a matcher for any pointer type whose pointer type is
- // compatible with the inner matcher, where type PointerType can be
- // either a raw pointer or a smart pointer.
- //
- // The reason we do this instead of relying on
- // MakePolymorphicMatcher() is that the latter is not flexible
- // enough for implementing the DescribeTo() method of Pointer().
- template <typename PointerType>
- operator Matcher<PointerType>() const { // NOLINT
- return Matcher<PointerType>(new Impl<const PointerType&>(matcher_));
- }
-
- private:
- // The monomorphic implementation that works for a particular pointer type.
- template <typename PointerType>
- class Impl : public MatcherInterface<PointerType> {
- public:
- using Pointer =
- const typename std::pointer_traits<GTEST_REMOVE_REFERENCE_AND_CONST_(
- PointerType)>::element_type*;
-
- explicit Impl(const InnerMatcher& matcher)
- : matcher_(MatcherCast<Pointer>(matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "is a pointer that ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "is not a pointer that ";
- matcher_.DescribeTo(os);
- }
-
- bool MatchAndExplain(PointerType pointer,
- MatchResultListener* listener) const override {
- *listener << "which is a pointer that ";
- Pointer p = GetRawPointer(pointer);
- return MatchPrintAndExplain(p, matcher_, listener);
- }
-
- private:
- Matcher<Pointer> matcher_;
- };
-
- const InnerMatcher matcher_;
-};
-
-#if GTEST_HAS_RTTI
-// Implements the WhenDynamicCastTo<T>(m) matcher that matches a pointer or
-// reference that matches inner_matcher when dynamic_cast<T> is applied.
-// The result of dynamic_cast<To> is forwarded to the inner matcher.
-// If To is a pointer and the cast fails, the inner matcher will receive NULL.
-// If To is a reference and the cast fails, this matcher returns false
-// immediately.
-template <typename To>
-class WhenDynamicCastToMatcherBase {
- public:
- explicit WhenDynamicCastToMatcherBase(const Matcher<To>& matcher)
- : matcher_(matcher) {}
-
- void DescribeTo(::std::ostream* os) const {
- GetCastTypeDescription(os);
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- GetCastTypeDescription(os);
- matcher_.DescribeNegationTo(os);
- }
-
- protected:
- const Matcher<To> matcher_;
-
- static std::string GetToName() { return GetTypeName<To>(); }
-
- private:
- static void GetCastTypeDescription(::std::ostream* os) {
- *os << "when dynamic_cast to " << GetToName() << ", ";
- }
-};
-
-// Primary template.
-// To is a pointer. Cast and forward the result.
-template <typename To>
-class WhenDynamicCastToMatcher : public WhenDynamicCastToMatcherBase<To> {
- public:
- explicit WhenDynamicCastToMatcher(const Matcher<To>& matcher)
- : WhenDynamicCastToMatcherBase<To>(matcher) {}
-
- template <typename From>
- bool MatchAndExplain(From from, MatchResultListener* listener) const {
- To to = dynamic_cast<To>(from);
- return MatchPrintAndExplain(to, this->matcher_, listener);
- }
-};
-
-// Specialize for references.
-// In this case we return false if the dynamic_cast fails.
-template <typename To>
-class WhenDynamicCastToMatcher<To&> : public WhenDynamicCastToMatcherBase<To&> {
- public:
- explicit WhenDynamicCastToMatcher(const Matcher<To&>& matcher)
- : WhenDynamicCastToMatcherBase<To&>(matcher) {}
-
- template <typename From>
- bool MatchAndExplain(From& from, MatchResultListener* listener) const {
- // We don't want an std::bad_cast here, so do the cast with pointers.
- To* to = dynamic_cast<To*>(&from);
- if (to == nullptr) {
- *listener << "which cannot be dynamic_cast to " << this->GetToName();
- return false;
- }
- return MatchPrintAndExplain(*to, this->matcher_, listener);
- }
-};
-#endif // GTEST_HAS_RTTI
-
-// Implements the Field() matcher for matching a field (i.e. member
-// variable) of an object.
-template <typename Class, typename FieldType>
-class FieldMatcher {
- public:
- FieldMatcher(FieldType Class::*field,
- const Matcher<const FieldType&>& matcher)
- : field_(field), matcher_(matcher), whose_field_("whose given field ") {}
-
- FieldMatcher(const std::string& field_name, FieldType Class::*field,
- const Matcher<const FieldType&>& matcher)
- : field_(field),
- matcher_(matcher),
- whose_field_("whose field `" + field_name + "` ") {}
-
- void DescribeTo(::std::ostream* os) const {
- *os << "is an object " << whose_field_;
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "is an object " << whose_field_;
- matcher_.DescribeNegationTo(os);
- }
-
- template <typename T>
- bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
- // FIXME: The dispatch on std::is_pointer was introduced as a workaround for
- // a compiler bug, and can now be removed.
- return MatchAndExplainImpl(
- typename std::is_pointer<typename std::remove_const<T>::type>::type(),
- value, listener);
- }
-
- private:
- bool MatchAndExplainImpl(std::false_type /* is_not_pointer */,
- const Class& obj,
- MatchResultListener* listener) const {
- *listener << whose_field_ << "is ";
- return MatchPrintAndExplain(obj.*field_, matcher_, listener);
- }
-
- bool MatchAndExplainImpl(std::true_type /* is_pointer */, const Class* p,
- MatchResultListener* listener) const {
- if (p == nullptr) return false;
-
- *listener << "which points to an object ";
- // Since *p has a field, it must be a class/struct/union type and
- // thus cannot be a pointer. Therefore we pass false_type() as
- // the first argument.
- return MatchAndExplainImpl(std::false_type(), *p, listener);
- }
-
- const FieldType Class::*field_;
- const Matcher<const FieldType&> matcher_;
-
- // Contains either "whose given field " if the name of the field is unknown
- // or "whose field `name_of_field` " if the name is known.
- const std::string whose_field_;
-};
-
-// Implements the Property() matcher for matching a property
-// (i.e. return value of a getter method) of an object.
-//
-// Property is a const-qualified member function of Class returning
-// PropertyType.
-template <typename Class, typename PropertyType, typename Property>
-class PropertyMatcher {
- public:
- typedef const PropertyType& RefToConstProperty;
-
- PropertyMatcher(Property property, const Matcher<RefToConstProperty>& matcher)
- : property_(property),
- matcher_(matcher),
- whose_property_("whose given property ") {}
-
- PropertyMatcher(const std::string& property_name, Property property,
- const Matcher<RefToConstProperty>& matcher)
- : property_(property),
- matcher_(matcher),
- whose_property_("whose property `" + property_name + "` ") {}
-
- void DescribeTo(::std::ostream* os) const {
- *os << "is an object " << whose_property_;
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "is an object " << whose_property_;
- matcher_.DescribeNegationTo(os);
- }
-
- template <typename T>
- bool MatchAndExplain(const T& value, MatchResultListener* listener) const {
- return MatchAndExplainImpl(
- typename std::is_pointer<typename std::remove_const<T>::type>::type(),
- value, listener);
- }
-
- private:
- bool MatchAndExplainImpl(std::false_type /* is_not_pointer */,
- const Class& obj,
- MatchResultListener* listener) const {
- *listener << whose_property_ << "is ";
- // Cannot pass the return value (for example, int) to MatchPrintAndExplain,
- // which takes a non-const reference as argument.
- RefToConstProperty result = (obj.*property_)();
- return MatchPrintAndExplain(result, matcher_, listener);
- }
-
- bool MatchAndExplainImpl(std::true_type /* is_pointer */, const Class* p,
- MatchResultListener* listener) const {
- if (p == nullptr) return false;
-
- *listener << "which points to an object ";
- // Since *p has a property method, it must be a class/struct/union
- // type and thus cannot be a pointer. Therefore we pass
- // false_type() as the first argument.
- return MatchAndExplainImpl(std::false_type(), *p, listener);
- }
-
- Property property_;
- const Matcher<RefToConstProperty> matcher_;
-
- // Contains either "whose given property " if the name of the property is
- // unknown or "whose property `name_of_property` " if the name is known.
- const std::string whose_property_;
-};
-
-// Type traits specifying various features of different functors for ResultOf.
-// The default template specifies features for functor objects.
-template <typename Functor>
-struct CallableTraits {
- typedef Functor StorageType;
-
- static void CheckIsValid(Functor /* functor */) {}
-
- template <typename T>
- static auto Invoke(Functor f, const T& arg) -> decltype(f(arg)) {
- return f(arg);
- }
-};
-
-// Specialization for function pointers.
-template <typename ArgType, typename ResType>
-struct CallableTraits<ResType (*)(ArgType)> {
- typedef ResType ResultType;
- typedef ResType (*StorageType)(ArgType);
-
- static void CheckIsValid(ResType (*f)(ArgType)) {
- GTEST_CHECK_(f != nullptr)
- << "NULL function pointer is passed into ResultOf().";
- }
- template <typename T>
- static ResType Invoke(ResType (*f)(ArgType), T arg) {
- return (*f)(arg);
- }
-};
-
-// Implements the ResultOf() matcher for matching a return value of a
-// unary function of an object.
-template <typename Callable, typename InnerMatcher>
-class ResultOfMatcher {
- public:
- ResultOfMatcher(Callable callable, InnerMatcher matcher)
- : callable_(std::move(callable)), matcher_(std::move(matcher)) {
- CallableTraits<Callable>::CheckIsValid(callable_);
- }
-
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new Impl<const T&>(callable_, matcher_));
- }
-
- private:
- typedef typename CallableTraits<Callable>::StorageType CallableStorageType;
-
- template <typename T>
- class Impl : public MatcherInterface<T> {
- using ResultType = decltype(CallableTraits<Callable>::template Invoke<T>(
- std::declval<CallableStorageType>(), std::declval<T>()));
-
- public:
- template <typename M>
- Impl(const CallableStorageType& callable, const M& matcher)
- : callable_(callable), matcher_(MatcherCast<ResultType>(matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "is mapped by the given callable to a value that ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "is mapped by the given callable to a value that ";
- matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(T obj, MatchResultListener* listener) const override {
- *listener << "which is mapped by the given callable to ";
- // Cannot pass the return value directly to MatchPrintAndExplain, which
- // takes a non-const reference as argument.
- // Also, specifying template argument explicitly is needed because T could
- // be a non-const reference (e.g. Matcher<Uncopyable&>).
- ResultType result =
- CallableTraits<Callable>::template Invoke<T>(callable_, obj);
- return MatchPrintAndExplain(result, matcher_, listener);
- }
-
- private:
- // Functors often define operator() as non-const method even though
- // they are actually stateless. But we need to use them even when
- // 'this' is a const pointer. It's the user's responsibility not to
- // use stateful callables with ResultOf(), which doesn't guarantee
- // how many times the callable will be invoked.
- mutable CallableStorageType callable_;
- const Matcher<ResultType> matcher_;
- }; // class Impl
-
- const CallableStorageType callable_;
- const InnerMatcher matcher_;
-};
-
-// Implements a matcher that checks the size of an STL-style container.
-template <typename SizeMatcher>
-class SizeIsMatcher {
- public:
- explicit SizeIsMatcher(const SizeMatcher& size_matcher)
- : size_matcher_(size_matcher) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- return Matcher<Container>(new Impl<const Container&>(size_matcher_));
- }
-
- template <typename Container>
- class Impl : public MatcherInterface<Container> {
- public:
- using SizeType = decltype(std::declval<Container>().size());
- explicit Impl(const SizeMatcher& size_matcher)
- : size_matcher_(MatcherCast<SizeType>(size_matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "size ";
- size_matcher_.DescribeTo(os);
- }
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "size ";
- size_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- SizeType size = container.size();
- StringMatchResultListener size_listener;
- const bool result = size_matcher_.MatchAndExplain(size, &size_listener);
- *listener << "whose size " << size
- << (result ? " matches" : " doesn't match");
- PrintIfNotEmpty(size_listener.str(), listener->stream());
- return result;
- }
-
- private:
- const Matcher<SizeType> size_matcher_;
- };
-
- private:
- const SizeMatcher size_matcher_;
-};
-
-// Implements a matcher that checks the begin()..end() distance of an STL-style
-// container.
-template <typename DistanceMatcher>
-class BeginEndDistanceIsMatcher {
- public:
- explicit BeginEndDistanceIsMatcher(const DistanceMatcher& distance_matcher)
- : distance_matcher_(distance_matcher) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- return Matcher<Container>(new Impl<const Container&>(distance_matcher_));
- }
-
- template <typename Container>
- class Impl : public MatcherInterface<Container> {
- public:
- typedef internal::StlContainerView<GTEST_REMOVE_REFERENCE_AND_CONST_(
- Container)>
- ContainerView;
- typedef typename std::iterator_traits<
- typename ContainerView::type::const_iterator>::difference_type
- DistanceType;
- explicit Impl(const DistanceMatcher& distance_matcher)
- : distance_matcher_(MatcherCast<DistanceType>(distance_matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "distance between begin() and end() ";
- distance_matcher_.DescribeTo(os);
- }
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "distance between begin() and end() ";
- distance_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- using std::begin;
- using std::end;
- DistanceType distance = std::distance(begin(container), end(container));
- StringMatchResultListener distance_listener;
- const bool result =
- distance_matcher_.MatchAndExplain(distance, &distance_listener);
- *listener << "whose distance between begin() and end() " << distance
- << (result ? " matches" : " doesn't match");
- PrintIfNotEmpty(distance_listener.str(), listener->stream());
- return result;
- }
-
- private:
- const Matcher<DistanceType> distance_matcher_;
- };
-
- private:
- const DistanceMatcher distance_matcher_;
-};
-
-// Implements an equality matcher for any STL-style container whose elements
-// support ==. This matcher is like Eq(), but its failure explanations provide
-// more detailed information that is useful when the container is used as a set.
-// The failure message reports elements that are in one of the operands but not
-// the other. The failure messages do not report duplicate or out-of-order
-// elements in the containers (which don't properly matter to sets, but can
-// occur if the containers are vectors or lists, for example).
-//
-// Uses the container's const_iterator, value_type, operator ==,
-// begin(), and end().
-template <typename Container>
-class ContainerEqMatcher {
- public:
- typedef internal::StlContainerView<Container> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
-
- static_assert(!std::is_const<Container>::value,
- "Container type must not be const");
- static_assert(!std::is_reference<Container>::value,
- "Container type must not be a reference");
-
- // We make a copy of expected in case the elements in it are modified
- // after this matcher is created.
- explicit ContainerEqMatcher(const Container& expected)
- : expected_(View::Copy(expected)) {}
-
- void DescribeTo(::std::ostream* os) const {
- *os << "equals ";
- UniversalPrint(expected_, os);
- }
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "does not equal ";
- UniversalPrint(expected_, os);
- }
-
- template <typename LhsContainer>
- bool MatchAndExplain(const LhsContainer& lhs,
- MatchResultListener* listener) const {
- typedef internal::StlContainerView<
- typename std::remove_const<LhsContainer>::type>
- LhsView;
- StlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- if (lhs_stl_container == expected_) return true;
-
- ::std::ostream* const os = listener->stream();
- if (os != nullptr) {
- // Something is different. Check for extra values first.
- bool printed_header = false;
- for (auto it = lhs_stl_container.begin(); it != lhs_stl_container.end();
- ++it) {
- if (internal::ArrayAwareFind(expected_.begin(), expected_.end(), *it) ==
- expected_.end()) {
- if (printed_header) {
- *os << ", ";
- } else {
- *os << "which has these unexpected elements: ";
- printed_header = true;
- }
- UniversalPrint(*it, os);
- }
- }
-
- // Now check for missing values.
- bool printed_header2 = false;
- for (auto it = expected_.begin(); it != expected_.end(); ++it) {
- if (internal::ArrayAwareFind(lhs_stl_container.begin(),
- lhs_stl_container.end(),
- *it) == lhs_stl_container.end()) {
- if (printed_header2) {
- *os << ", ";
- } else {
- *os << (printed_header ? ",\nand" : "which")
- << " doesn't have these expected elements: ";
- printed_header2 = true;
- }
- UniversalPrint(*it, os);
- }
- }
- }
-
- return false;
- }
-
- private:
- const StlContainer expected_;
-};
-
-// A comparator functor that uses the < operator to compare two values.
-struct LessComparator {
- template <typename T, typename U>
- bool operator()(const T& lhs, const U& rhs) const {
- return lhs < rhs;
- }
-};
-
-// Implements WhenSortedBy(comparator, container_matcher).
-template <typename Comparator, typename ContainerMatcher>
-class WhenSortedByMatcher {
- public:
- WhenSortedByMatcher(const Comparator& comparator,
- const ContainerMatcher& matcher)
- : comparator_(comparator), matcher_(matcher) {}
-
- template <typename LhsContainer>
- operator Matcher<LhsContainer>() const {
- return MakeMatcher(new Impl<LhsContainer>(comparator_, matcher_));
- }
-
- template <typename LhsContainer>
- class Impl : public MatcherInterface<LhsContainer> {
- public:
- typedef internal::StlContainerView<GTEST_REMOVE_REFERENCE_AND_CONST_(
- LhsContainer)>
- LhsView;
- typedef typename LhsView::type LhsStlContainer;
- typedef typename LhsView::const_reference LhsStlContainerReference;
- // Transforms std::pair<const Key, Value> into std::pair<Key, Value>
- // so that we can match associative containers.
- typedef
- typename RemoveConstFromKey<typename LhsStlContainer::value_type>::type
- LhsValue;
-
- Impl(const Comparator& comparator, const ContainerMatcher& matcher)
- : comparator_(comparator), matcher_(matcher) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "(when sorted) ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "(when sorted) ";
- matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(LhsContainer lhs,
- MatchResultListener* listener) const override {
- LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- ::std::vector<LhsValue> sorted_container(lhs_stl_container.begin(),
- lhs_stl_container.end());
- ::std::sort(sorted_container.begin(), sorted_container.end(),
- comparator_);
-
- if (!listener->IsInterested()) {
- // If the listener is not interested, we do not need to
- // construct the inner explanation.
- return matcher_.Matches(sorted_container);
- }
-
- *listener << "which is ";
- UniversalPrint(sorted_container, listener->stream());
- *listener << " when sorted";
-
- StringMatchResultListener inner_listener;
- const bool match =
- matcher_.MatchAndExplain(sorted_container, &inner_listener);
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return match;
- }
-
- private:
- const Comparator comparator_;
- const Matcher<const ::std::vector<LhsValue>&> matcher_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Impl);
- };
-
- private:
- const Comparator comparator_;
- const ContainerMatcher matcher_;
-};
-
-// Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher
-// must be able to be safely cast to Matcher<std::tuple<const T1&, const
-// T2&> >, where T1 and T2 are the types of elements in the LHS
-// container and the RHS container respectively.
-template <typename TupleMatcher, typename RhsContainer>
-class PointwiseMatcher {
- GTEST_COMPILE_ASSERT_(
- !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(RhsContainer)>::value,
- use_UnorderedPointwise_with_hash_tables);
-
- public:
- typedef internal::StlContainerView<RhsContainer> RhsView;
- typedef typename RhsView::type RhsStlContainer;
- typedef typename RhsStlContainer::value_type RhsValue;
-
- static_assert(!std::is_const<RhsContainer>::value,
- "RhsContainer type must not be const");
- static_assert(!std::is_reference<RhsContainer>::value,
- "RhsContainer type must not be a reference");
-
- // Like ContainerEq, we make a copy of rhs in case the elements in
- // it are modified after this matcher is created.
- PointwiseMatcher(const TupleMatcher& tuple_matcher, const RhsContainer& rhs)
- : tuple_matcher_(tuple_matcher), rhs_(RhsView::Copy(rhs)) {}
-
- template <typename LhsContainer>
- operator Matcher<LhsContainer>() const {
- GTEST_COMPILE_ASSERT_(
- !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(LhsContainer)>::value,
- use_UnorderedPointwise_with_hash_tables);
-
- return Matcher<LhsContainer>(
- new Impl<const LhsContainer&>(tuple_matcher_, rhs_));
- }
-
- template <typename LhsContainer>
- class Impl : public MatcherInterface<LhsContainer> {
- public:
- typedef internal::StlContainerView<GTEST_REMOVE_REFERENCE_AND_CONST_(
- LhsContainer)>
- LhsView;
- typedef typename LhsView::type LhsStlContainer;
- typedef typename LhsView::const_reference LhsStlContainerReference;
- typedef typename LhsStlContainer::value_type LhsValue;
- // We pass the LHS value and the RHS value to the inner matcher by
- // reference, as they may be expensive to copy. We must use tuple
- // instead of pair here, as a pair cannot hold references (C++ 98,
- // 20.2.2 [lib.pairs]).
- typedef ::std::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg;
-
- Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs)
- // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher.
- : mono_tuple_matcher_(SafeMatcherCast<InnerMatcherArg>(tuple_matcher)),
- rhs_(rhs) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "contains " << rhs_.size()
- << " values, where each value and its corresponding value in ";
- UniversalPrinter<RhsStlContainer>::Print(rhs_, os);
- *os << " ";
- mono_tuple_matcher_.DescribeTo(os);
- }
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "doesn't contain exactly " << rhs_.size()
- << " values, or contains a value x at some index i"
- << " where x and the i-th value of ";
- UniversalPrint(rhs_, os);
- *os << " ";
- mono_tuple_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(LhsContainer lhs,
- MatchResultListener* listener) const override {
- LhsStlContainerReference lhs_stl_container = LhsView::ConstReference(lhs);
- const size_t actual_size = lhs_stl_container.size();
- if (actual_size != rhs_.size()) {
- *listener << "which contains " << actual_size << " values";
- return false;
- }
-
- auto left = lhs_stl_container.begin();
- auto right = rhs_.begin();
- for (size_t i = 0; i != actual_size; ++i, ++left, ++right) {
- if (listener->IsInterested()) {
- StringMatchResultListener inner_listener;
- // Create InnerMatcherArg as a temporarily object to avoid it outlives
- // *left and *right. Dereference or the conversion to `const T&` may
- // return temp objects, e.g. for vector<bool>.
- if (!mono_tuple_matcher_.MatchAndExplain(
- InnerMatcherArg(ImplicitCast_<const LhsValue&>(*left),
- ImplicitCast_<const RhsValue&>(*right)),
- &inner_listener)) {
- *listener << "where the value pair (";
- UniversalPrint(*left, listener->stream());
- *listener << ", ";
- UniversalPrint(*right, listener->stream());
- *listener << ") at index #" << i << " don't match";
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return false;
- }
- } else {
- if (!mono_tuple_matcher_.Matches(
- InnerMatcherArg(ImplicitCast_<const LhsValue&>(*left),
- ImplicitCast_<const RhsValue&>(*right))))
- return false;
- }
- }
-
- return true;
- }
-
- private:
- const Matcher<InnerMatcherArg> mono_tuple_matcher_;
- const RhsStlContainer rhs_;
- };
-
- private:
- const TupleMatcher tuple_matcher_;
- const RhsStlContainer rhs_;
-};
-
-// Holds the logic common to ContainsMatcherImpl and EachMatcherImpl.
-template <typename Container>
-class QuantifierMatcherImpl : public MatcherInterface<Container> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef StlContainerView<RawContainer> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
- typedef typename StlContainer::value_type Element;
-
- template <typename InnerMatcher>
- explicit QuantifierMatcherImpl(InnerMatcher inner_matcher)
- : inner_matcher_(
- testing::SafeMatcherCast<const Element&>(inner_matcher)) {}
-
- // Checks whether:
- // * All elements in the container match, if all_elements_should_match.
- // * Any element in the container matches, if !all_elements_should_match.
- bool MatchAndExplainImpl(bool all_elements_should_match, Container container,
- MatchResultListener* listener) const {
- StlContainerReference stl_container = View::ConstReference(container);
- size_t i = 0;
- for (auto it = stl_container.begin(); it != stl_container.end();
- ++it, ++i) {
- StringMatchResultListener inner_listener;
- const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
-
- if (matches != all_elements_should_match) {
- *listener << "whose element #" << i
- << (matches ? " matches" : " doesn't match");
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return !all_elements_should_match;
- }
- }
- return all_elements_should_match;
- }
-
- bool MatchAndExplainImpl(const Matcher<size_t>& count_matcher,
- Container container,
- MatchResultListener* listener) const {
- StlContainerReference stl_container = View::ConstReference(container);
- size_t i = 0;
- std::vector<size_t> match_elements;
- for (auto it = stl_container.begin(); it != stl_container.end();
- ++it, ++i) {
- StringMatchResultListener inner_listener;
- const bool matches = inner_matcher_.MatchAndExplain(*it, &inner_listener);
- if (matches) {
- match_elements.push_back(i);
- }
- }
- if (listener->IsInterested()) {
- if (match_elements.empty()) {
- *listener << "has no element that matches";
- } else if (match_elements.size() == 1) {
- *listener << "whose element #" << match_elements[0] << " matches";
- } else {
- *listener << "whose elements (";
- std::string sep = "";
- for (size_t e : match_elements) {
- *listener << sep << e;
- sep = ", ";
- }
- *listener << ") match";
- }
- }
- StringMatchResultListener count_listener;
- if (count_matcher.MatchAndExplain(match_elements.size(), &count_listener)) {
- *listener << " and whose match quantity of " << match_elements.size()
- << " matches";
- PrintIfNotEmpty(count_listener.str(), listener->stream());
- return true;
- } else {
- if (match_elements.empty()) {
- *listener << " and";
- } else {
- *listener << " but";
- }
- *listener << " whose match quantity of " << match_elements.size()
- << " does not match";
- PrintIfNotEmpty(count_listener.str(), listener->stream());
- return false;
- }
- }
-
- protected:
- const Matcher<const Element&> inner_matcher_;
-};
-
-// Implements Contains(element_matcher) for the given argument type Container.
-// Symmetric to EachMatcherImpl.
-template <typename Container>
-class ContainsMatcherImpl : public QuantifierMatcherImpl<Container> {
- public:
- template <typename InnerMatcher>
- explicit ContainsMatcherImpl(InnerMatcher inner_matcher)
- : QuantifierMatcherImpl<Container>(inner_matcher) {}
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- *os << "contains at least one element that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "doesn't contain any element that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- return this->MatchAndExplainImpl(false, container, listener);
- }
-};
-
-// Implements Each(element_matcher) for the given argument type Container.
-// Symmetric to ContainsMatcherImpl.
-template <typename Container>
-class EachMatcherImpl : public QuantifierMatcherImpl<Container> {
- public:
- template <typename InnerMatcher>
- explicit EachMatcherImpl(InnerMatcher inner_matcher)
- : QuantifierMatcherImpl<Container>(inner_matcher) {}
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- *os << "only contains elements that ";
- this->inner_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "contains some element that ";
- this->inner_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- return this->MatchAndExplainImpl(true, container, listener);
- }
-};
-
-// Implements Contains(element_matcher).Times(n) for the given argument type
-// Container.
-template <typename Container>
-class ContainsTimesMatcherImpl : public QuantifierMatcherImpl<Container> {
- public:
- template <typename InnerMatcher>
- explicit ContainsTimesMatcherImpl(InnerMatcher inner_matcher,
- Matcher<size_t> count_matcher)
- : QuantifierMatcherImpl<Container>(inner_matcher),
- count_matcher_(std::move(count_matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "quantity of elements that match ";
- this->inner_matcher_.DescribeTo(os);
- *os << " ";
- count_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "quantity of elements that match ";
- this->inner_matcher_.DescribeTo(os);
- *os << " ";
- count_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- return this->MatchAndExplainImpl(count_matcher_, container, listener);
- }
-
- private:
- const Matcher<size_t> count_matcher_;
-};
-
-// Implements polymorphic Contains(element_matcher).Times(n).
-template <typename M>
-class ContainsTimesMatcher {
- public:
- explicit ContainsTimesMatcher(M m, Matcher<size_t> count_matcher)
- : inner_matcher_(m), count_matcher_(std::move(count_matcher)) {}
-
- template <typename Container>
- operator Matcher<Container>() const { // NOLINT
- return Matcher<Container>(new ContainsTimesMatcherImpl<const Container&>(
- inner_matcher_, count_matcher_));
- }
-
- private:
- const M inner_matcher_;
- const Matcher<size_t> count_matcher_;
-};
-
-// Implements polymorphic Contains(element_matcher).
-template <typename M>
-class ContainsMatcher {
- public:
- explicit ContainsMatcher(M m) : inner_matcher_(m) {}
-
- template <typename Container>
- operator Matcher<Container>() const { // NOLINT
- return Matcher<Container>(
- new ContainsMatcherImpl<const Container&>(inner_matcher_));
- }
-
- ContainsTimesMatcher<M> Times(Matcher<size_t> count_matcher) const {
- return ContainsTimesMatcher<M>(inner_matcher_, std::move(count_matcher));
- }
-
- private:
- const M inner_matcher_;
-};
-
-// Implements polymorphic Each(element_matcher).
-template <typename M>
-class EachMatcher {
- public:
- explicit EachMatcher(M m) : inner_matcher_(m) {}
-
- template <typename Container>
- operator Matcher<Container>() const { // NOLINT
- return Matcher<Container>(
- new EachMatcherImpl<const Container&>(inner_matcher_));
- }
-
- private:
- const M inner_matcher_;
-};
-
-struct Rank1 {};
-struct Rank0 : Rank1 {};
-
-namespace pair_getters {
-using std::get;
-template <typename T>
-auto First(T& x, Rank1) -> decltype(get<0>(x)) { // NOLINT
- return get<0>(x);
-}
-template <typename T>
-auto First(T& x, Rank0) -> decltype((x.first)) { // NOLINT
- return x.first;
-}
-
-template <typename T>
-auto Second(T& x, Rank1) -> decltype(get<1>(x)) { // NOLINT
- return get<1>(x);
-}
-template <typename T>
-auto Second(T& x, Rank0) -> decltype((x.second)) { // NOLINT
- return x.second;
-}
-} // namespace pair_getters
-
-// Implements Key(inner_matcher) for the given argument pair type.
-// Key(inner_matcher) matches an std::pair whose 'first' field matches
-// inner_matcher. For example, Contains(Key(Ge(5))) can be used to match an
-// std::map that contains at least one element whose key is >= 5.
-template <typename PairType>
-class KeyMatcherImpl : public MatcherInterface<PairType> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
- typedef typename RawPairType::first_type KeyType;
-
- template <typename InnerMatcher>
- explicit KeyMatcherImpl(InnerMatcher inner_matcher)
- : inner_matcher_(
- testing::SafeMatcherCast<const KeyType&>(inner_matcher)) {}
-
- // Returns true if and only if 'key_value.first' (the key) matches the inner
- // matcher.
- bool MatchAndExplain(PairType key_value,
- MatchResultListener* listener) const override {
- StringMatchResultListener inner_listener;
- const bool match = inner_matcher_.MatchAndExplain(
- pair_getters::First(key_value, Rank0()), &inner_listener);
- const std::string explanation = inner_listener.str();
- if (explanation != "") {
- *listener << "whose first field is a value " << explanation;
- }
- return match;
- }
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- *os << "has a key that ";
- inner_matcher_.DescribeTo(os);
- }
-
- // Describes what the negation of this matcher does.
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "doesn't have a key that ";
- inner_matcher_.DescribeTo(os);
- }
-
- private:
- const Matcher<const KeyType&> inner_matcher_;
-};
-
-// Implements polymorphic Key(matcher_for_key).
-template <typename M>
-class KeyMatcher {
- public:
- explicit KeyMatcher(M m) : matcher_for_key_(m) {}
-
- template <typename PairType>
- operator Matcher<PairType>() const {
- return Matcher<PairType>(
- new KeyMatcherImpl<const PairType&>(matcher_for_key_));
- }
-
- private:
- const M matcher_for_key_;
-};
-
-// Implements polymorphic Address(matcher_for_address).
-template <typename InnerMatcher>
-class AddressMatcher {
- public:
- explicit AddressMatcher(InnerMatcher m) : matcher_(m) {}
-
- template <typename Type>
- operator Matcher<Type>() const { // NOLINT
- return Matcher<Type>(new Impl<const Type&>(matcher_));
- }
-
- private:
- // The monomorphic implementation that works for a particular object type.
- template <typename Type>
- class Impl : public MatcherInterface<Type> {
- public:
- using Address = const GTEST_REMOVE_REFERENCE_AND_CONST_(Type) *;
- explicit Impl(const InnerMatcher& matcher)
- : matcher_(MatcherCast<Address>(matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "has address that ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "does not have address that ";
- matcher_.DescribeTo(os);
- }
-
- bool MatchAndExplain(Type object,
- MatchResultListener* listener) const override {
- *listener << "which has address ";
- Address address = std::addressof(object);
- return MatchPrintAndExplain(address, matcher_, listener);
- }
-
- private:
- const Matcher<Address> matcher_;
- };
- const InnerMatcher matcher_;
-};
-
-// Implements Pair(first_matcher, second_matcher) for the given argument pair
-// type with its two matchers. See Pair() function below.
-template <typename PairType>
-class PairMatcherImpl : public MatcherInterface<PairType> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(PairType) RawPairType;
- typedef typename RawPairType::first_type FirstType;
- typedef typename RawPairType::second_type SecondType;
-
- template <typename FirstMatcher, typename SecondMatcher>
- PairMatcherImpl(FirstMatcher first_matcher, SecondMatcher second_matcher)
- : first_matcher_(
- testing::SafeMatcherCast<const FirstType&>(first_matcher)),
- second_matcher_(
- testing::SafeMatcherCast<const SecondType&>(second_matcher)) {}
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- *os << "has a first field that ";
- first_matcher_.DescribeTo(os);
- *os << ", and has a second field that ";
- second_matcher_.DescribeTo(os);
- }
-
- // Describes what the negation of this matcher does.
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "has a first field that ";
- first_matcher_.DescribeNegationTo(os);
- *os << ", or has a second field that ";
- second_matcher_.DescribeNegationTo(os);
- }
-
- // Returns true if and only if 'a_pair.first' matches first_matcher and
- // 'a_pair.second' matches second_matcher.
- bool MatchAndExplain(PairType a_pair,
- MatchResultListener* listener) const override {
- if (!listener->IsInterested()) {
- // If the listener is not interested, we don't need to construct the
- // explanation.
- return first_matcher_.Matches(pair_getters::First(a_pair, Rank0())) &&
- second_matcher_.Matches(pair_getters::Second(a_pair, Rank0()));
- }
- StringMatchResultListener first_inner_listener;
- if (!first_matcher_.MatchAndExplain(pair_getters::First(a_pair, Rank0()),
- &first_inner_listener)) {
- *listener << "whose first field does not match";
- PrintIfNotEmpty(first_inner_listener.str(), listener->stream());
- return false;
- }
- StringMatchResultListener second_inner_listener;
- if (!second_matcher_.MatchAndExplain(pair_getters::Second(a_pair, Rank0()),
- &second_inner_listener)) {
- *listener << "whose second field does not match";
- PrintIfNotEmpty(second_inner_listener.str(), listener->stream());
- return false;
- }
- ExplainSuccess(first_inner_listener.str(), second_inner_listener.str(),
- listener);
- return true;
- }
-
- private:
- void ExplainSuccess(const std::string& first_explanation,
- const std::string& second_explanation,
- MatchResultListener* listener) const {
- *listener << "whose both fields match";
- if (first_explanation != "") {
- *listener << ", where the first field is a value " << first_explanation;
- }
- if (second_explanation != "") {
- *listener << ", ";
- if (first_explanation != "") {
- *listener << "and ";
- } else {
- *listener << "where ";
- }
- *listener << "the second field is a value " << second_explanation;
- }
- }
-
- const Matcher<const FirstType&> first_matcher_;
- const Matcher<const SecondType&> second_matcher_;
-};
-
-// Implements polymorphic Pair(first_matcher, second_matcher).
-template <typename FirstMatcher, typename SecondMatcher>
-class PairMatcher {
- public:
- PairMatcher(FirstMatcher first_matcher, SecondMatcher second_matcher)
- : first_matcher_(first_matcher), second_matcher_(second_matcher) {}
-
- template <typename PairType>
- operator Matcher<PairType>() const {
- return Matcher<PairType>(
- new PairMatcherImpl<const PairType&>(first_matcher_, second_matcher_));
- }
-
- private:
- const FirstMatcher first_matcher_;
- const SecondMatcher second_matcher_;
-};
-
-template <typename T, size_t... I>
-auto UnpackStructImpl(const T& t, IndexSequence<I...>, int)
- -> decltype(std::tie(get<I>(t)...)) {
- static_assert(std::tuple_size<T>::value == sizeof...(I),
- "Number of arguments doesn't match the number of fields.");
- return std::tie(get<I>(t)...);
-}
-
-#if defined(__cpp_structured_bindings) && __cpp_structured_bindings >= 201606
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<1>, char) {
- const auto& [a] = t;
- return std::tie(a);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<2>, char) {
- const auto& [a, b] = t;
- return std::tie(a, b);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<3>, char) {
- const auto& [a, b, c] = t;
- return std::tie(a, b, c);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<4>, char) {
- const auto& [a, b, c, d] = t;
- return std::tie(a, b, c, d);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<5>, char) {
- const auto& [a, b, c, d, e] = t;
- return std::tie(a, b, c, d, e);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<6>, char) {
- const auto& [a, b, c, d, e, f] = t;
- return std::tie(a, b, c, d, e, f);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<7>, char) {
- const auto& [a, b, c, d, e, f, g] = t;
- return std::tie(a, b, c, d, e, f, g);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<8>, char) {
- const auto& [a, b, c, d, e, f, g, h] = t;
- return std::tie(a, b, c, d, e, f, g, h);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<9>, char) {
- const auto& [a, b, c, d, e, f, g, h, i] = t;
- return std::tie(a, b, c, d, e, f, g, h, i);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<10>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<11>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<12>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k, l] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k, l);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<13>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<14>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<15>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o);
-}
-template <typename T>
-auto UnpackStructImpl(const T& t, MakeIndexSequence<16>, char) {
- const auto& [a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p] = t;
- return std::tie(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p);
-}
-#endif // defined(__cpp_structured_bindings)
-
-template <size_t I, typename T>
-auto UnpackStruct(const T& t)
- -> decltype((UnpackStructImpl)(t, MakeIndexSequence<I>{}, 0)) {
- return (UnpackStructImpl)(t, MakeIndexSequence<I>{}, 0);
-}
-
-// Helper function to do comma folding in C++11.
-// The array ensures left-to-right order of evaluation.
-// Usage: VariadicExpand({expr...});
-template <typename T, size_t N>
-void VariadicExpand(const T (&)[N]) {}
-
-template <typename Struct, typename StructSize>
-class FieldsAreMatcherImpl;
-
-template <typename Struct, size_t... I>
-class FieldsAreMatcherImpl<Struct, IndexSequence<I...>>
- : public MatcherInterface<Struct> {
- using UnpackedType =
- decltype(UnpackStruct<sizeof...(I)>(std::declval<const Struct&>()));
- using MatchersType = std::tuple<
- Matcher<const typename std::tuple_element<I, UnpackedType>::type&>...>;
-
- public:
- template <typename Inner>
- explicit FieldsAreMatcherImpl(const Inner& matchers)
- : matchers_(testing::SafeMatcherCast<
- const typename std::tuple_element<I, UnpackedType>::type&>(
- std::get<I>(matchers))...) {}
-
- void DescribeTo(::std::ostream* os) const override {
- const char* separator = "";
- VariadicExpand(
- {(*os << separator << "has field #" << I << " that ",
- std::get<I>(matchers_).DescribeTo(os), separator = ", and ")...});
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- const char* separator = "";
- VariadicExpand({(*os << separator << "has field #" << I << " that ",
- std::get<I>(matchers_).DescribeNegationTo(os),
- separator = ", or ")...});
- }
-
- bool MatchAndExplain(Struct t, MatchResultListener* listener) const override {
- return MatchInternal((UnpackStruct<sizeof...(I)>)(t), listener);
- }
-
- private:
- bool MatchInternal(UnpackedType tuple, MatchResultListener* listener) const {
- if (!listener->IsInterested()) {
- // If the listener is not interested, we don't need to construct the
- // explanation.
- bool good = true;
- VariadicExpand({good = good && std::get<I>(matchers_).Matches(
- std::get<I>(tuple))...});
- return good;
- }
-
- size_t failed_pos = ~size_t{};
-
- std::vector<StringMatchResultListener> inner_listener(sizeof...(I));
-
- VariadicExpand(
- {failed_pos == ~size_t{} && !std::get<I>(matchers_).MatchAndExplain(
- std::get<I>(tuple), &inner_listener[I])
- ? failed_pos = I
- : 0 ...});
- if (failed_pos != ~size_t{}) {
- *listener << "whose field #" << failed_pos << " does not match";
- PrintIfNotEmpty(inner_listener[failed_pos].str(), listener->stream());
- return false;
- }
-
- *listener << "whose all elements match";
- const char* separator = ", where";
- for (size_t index = 0; index < sizeof...(I); ++index) {
- const std::string str = inner_listener[index].str();
- if (!str.empty()) {
- *listener << separator << " field #" << index << " is a value " << str;
- separator = ", and";
- }
- }
-
- return true;
- }
-
- MatchersType matchers_;
-};
-
-template <typename... Inner>
-class FieldsAreMatcher {
- public:
- explicit FieldsAreMatcher(Inner... inner) : matchers_(std::move(inner)...) {}
-
- template <typename Struct>
- operator Matcher<Struct>() const { // NOLINT
- return Matcher<Struct>(
- new FieldsAreMatcherImpl<const Struct&, IndexSequenceFor<Inner...>>(
- matchers_));
- }
-
- private:
- std::tuple<Inner...> matchers_;
-};
-
-// Implements ElementsAre() and ElementsAreArray().
-template <typename Container>
-class ElementsAreMatcherImpl : public MatcherInterface<Container> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef internal::StlContainerView<RawContainer> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
- typedef typename StlContainer::value_type Element;
-
- // Constructs the matcher from a sequence of element values or
- // element matchers.
- template <typename InputIter>
- ElementsAreMatcherImpl(InputIter first, InputIter last) {
- while (first != last) {
- matchers_.push_back(MatcherCast<const Element&>(*first++));
- }
- }
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- if (count() == 0) {
- *os << "is empty";
- } else if (count() == 1) {
- *os << "has 1 element that ";
- matchers_[0].DescribeTo(os);
- } else {
- *os << "has " << Elements(count()) << " where\n";
- for (size_t i = 0; i != count(); ++i) {
- *os << "element #" << i << " ";
- matchers_[i].DescribeTo(os);
- if (i + 1 < count()) {
- *os << ",\n";
- }
- }
- }
- }
-
- // Describes what the negation of this matcher does.
- void DescribeNegationTo(::std::ostream* os) const override {
- if (count() == 0) {
- *os << "isn't empty";
- return;
- }
-
- *os << "doesn't have " << Elements(count()) << ", or\n";
- for (size_t i = 0; i != count(); ++i) {
- *os << "element #" << i << " ";
- matchers_[i].DescribeNegationTo(os);
- if (i + 1 < count()) {
- *os << ", or\n";
- }
- }
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- // To work with stream-like "containers", we must only walk
- // through the elements in one pass.
-
- const bool listener_interested = listener->IsInterested();
-
- // explanations[i] is the explanation of the element at index i.
- ::std::vector<std::string> explanations(count());
- StlContainerReference stl_container = View::ConstReference(container);
- auto it = stl_container.begin();
- size_t exam_pos = 0;
- bool mismatch_found = false; // Have we found a mismatched element yet?
-
- // Go through the elements and matchers in pairs, until we reach
- // the end of either the elements or the matchers, or until we find a
- // mismatch.
- for (; it != stl_container.end() && exam_pos != count(); ++it, ++exam_pos) {
- bool match; // Does the current element match the current matcher?
- if (listener_interested) {
- StringMatchResultListener s;
- match = matchers_[exam_pos].MatchAndExplain(*it, &s);
- explanations[exam_pos] = s.str();
- } else {
- match = matchers_[exam_pos].Matches(*it);
- }
-
- if (!match) {
- mismatch_found = true;
- break;
- }
- }
- // If mismatch_found is true, 'exam_pos' is the index of the mismatch.
-
- // Find how many elements the actual container has. We avoid
- // calling size() s.t. this code works for stream-like "containers"
- // that don't define size().
- size_t actual_count = exam_pos;
- for (; it != stl_container.end(); ++it) {
- ++actual_count;
- }
-
- if (actual_count != count()) {
- // The element count doesn't match. If the container is empty,
- // there's no need to explain anything as Google Mock already
- // prints the empty container. Otherwise we just need to show
- // how many elements there actually are.
- if (listener_interested && (actual_count != 0)) {
- *listener << "which has " << Elements(actual_count);
- }
- return false;
- }
-
- if (mismatch_found) {
- // The element count matches, but the exam_pos-th element doesn't match.
- if (listener_interested) {
- *listener << "whose element #" << exam_pos << " doesn't match";
- PrintIfNotEmpty(explanations[exam_pos], listener->stream());
- }
- return false;
- }
-
- // Every element matches its expectation. We need to explain why
- // (the obvious ones can be skipped).
- if (listener_interested) {
- bool reason_printed = false;
- for (size_t i = 0; i != count(); ++i) {
- const std::string& s = explanations[i];
- if (!s.empty()) {
- if (reason_printed) {
- *listener << ",\nand ";
- }
- *listener << "whose element #" << i << " matches, " << s;
- reason_printed = true;
- }
- }
- }
- return true;
- }
-
- private:
- static Message Elements(size_t count) {
- return Message() << count << (count == 1 ? " element" : " elements");
- }
-
- size_t count() const { return matchers_.size(); }
-
- ::std::vector<Matcher<const Element&>> matchers_;
-};
-
-// Connectivity matrix of (elements X matchers), in element-major order.
-// Initially, there are no edges.
-// Use NextGraph() to iterate over all possible edge configurations.
-// Use Randomize() to generate a random edge configuration.
-class GTEST_API_ MatchMatrix {
- public:
- MatchMatrix(size_t num_elements, size_t num_matchers)
- : num_elements_(num_elements),
- num_matchers_(num_matchers),
- matched_(num_elements_ * num_matchers_, 0) {}
-
- size_t LhsSize() const { return num_elements_; }
- size_t RhsSize() const { return num_matchers_; }
- bool HasEdge(size_t ilhs, size_t irhs) const {
- return matched_[SpaceIndex(ilhs, irhs)] == 1;
- }
- void SetEdge(size_t ilhs, size_t irhs, bool b) {
- matched_[SpaceIndex(ilhs, irhs)] = b ? 1 : 0;
- }
-
- // Treating the connectivity matrix as a (LhsSize()*RhsSize())-bit number,
- // adds 1 to that number; returns false if incrementing the graph left it
- // empty.
- bool NextGraph();
-
- void Randomize();
-
- std::string DebugString() const;
-
- private:
- size_t SpaceIndex(size_t ilhs, size_t irhs) const {
- return ilhs * num_matchers_ + irhs;
- }
-
- size_t num_elements_;
- size_t num_matchers_;
-
- // Each element is a char interpreted as bool. They are stored as a
- // flattened array in lhs-major order, use 'SpaceIndex()' to translate
- // a (ilhs, irhs) matrix coordinate into an offset.
- ::std::vector<char> matched_;
-};
-
-typedef ::std::pair<size_t, size_t> ElementMatcherPair;
-typedef ::std::vector<ElementMatcherPair> ElementMatcherPairs;
-
-// Returns a maximum bipartite matching for the specified graph 'g'.
-// The matching is represented as a vector of {element, matcher} pairs.
-GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix& g);
-
-struct UnorderedMatcherRequire {
- enum Flags {
- Superset = 1 << 0,
- Subset = 1 << 1,
- ExactMatch = Superset | Subset,
- };
-};
-
-// Untyped base class for implementing UnorderedElementsAre. By
-// putting logic that's not specific to the element type here, we
-// reduce binary bloat and increase compilation speed.
-class GTEST_API_ UnorderedElementsAreMatcherImplBase {
- protected:
- explicit UnorderedElementsAreMatcherImplBase(
- UnorderedMatcherRequire::Flags matcher_flags)
- : match_flags_(matcher_flags) {}
-
- // A vector of matcher describers, one for each element matcher.
- // Does not own the describers (and thus can be used only when the
- // element matchers are alive).
- typedef ::std::vector<const MatcherDescriberInterface*> MatcherDescriberVec;
-
- // Describes this UnorderedElementsAre matcher.
- void DescribeToImpl(::std::ostream* os) const;
-
- // Describes the negation of this UnorderedElementsAre matcher.
- void DescribeNegationToImpl(::std::ostream* os) const;
-
- bool VerifyMatchMatrix(const ::std::vector<std::string>& element_printouts,
- const MatchMatrix& matrix,
- MatchResultListener* listener) const;
-
- bool FindPairing(const MatchMatrix& matrix,
- MatchResultListener* listener) const;
-
- MatcherDescriberVec& matcher_describers() { return matcher_describers_; }
-
- static Message Elements(size_t n) {
- return Message() << n << " element" << (n == 1 ? "" : "s");
- }
-
- UnorderedMatcherRequire::Flags match_flags() const { return match_flags_; }
-
- private:
- UnorderedMatcherRequire::Flags match_flags_;
- MatcherDescriberVec matcher_describers_;
-};
-
-// Implements UnorderedElementsAre, UnorderedElementsAreArray, IsSubsetOf, and
-// IsSupersetOf.
-template <typename Container>
-class UnorderedElementsAreMatcherImpl
- : public MatcherInterface<Container>,
- public UnorderedElementsAreMatcherImplBase {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef internal::StlContainerView<RawContainer> View;
- typedef typename View::type StlContainer;
- typedef typename View::const_reference StlContainerReference;
- typedef typename StlContainer::value_type Element;
-
- template <typename InputIter>
- UnorderedElementsAreMatcherImpl(UnorderedMatcherRequire::Flags matcher_flags,
- InputIter first, InputIter last)
- : UnorderedElementsAreMatcherImplBase(matcher_flags) {
- for (; first != last; ++first) {
- matchers_.push_back(MatcherCast<const Element&>(*first));
- }
- for (const auto& m : matchers_) {
- matcher_describers().push_back(m.GetDescriber());
- }
- }
-
- // Describes what this matcher does.
- void DescribeTo(::std::ostream* os) const override {
- return UnorderedElementsAreMatcherImplBase::DescribeToImpl(os);
- }
-
- // Describes what the negation of this matcher does.
- void DescribeNegationTo(::std::ostream* os) const override {
- return UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(os);
- }
-
- bool MatchAndExplain(Container container,
- MatchResultListener* listener) const override {
- StlContainerReference stl_container = View::ConstReference(container);
- ::std::vector<std::string> element_printouts;
- MatchMatrix matrix =
- AnalyzeElements(stl_container.begin(), stl_container.end(),
- &element_printouts, listener);
-
- if (matrix.LhsSize() == 0 && matrix.RhsSize() == 0) {
- return true;
- }
-
- if (match_flags() == UnorderedMatcherRequire::ExactMatch) {
- if (matrix.LhsSize() != matrix.RhsSize()) {
- // The element count doesn't match. If the container is empty,
- // there's no need to explain anything as Google Mock already
- // prints the empty container. Otherwise we just need to show
- // how many elements there actually are.
- if (matrix.LhsSize() != 0 && listener->IsInterested()) {
- *listener << "which has " << Elements(matrix.LhsSize());
- }
- return false;
- }
- }
-
- return VerifyMatchMatrix(element_printouts, matrix, listener) &&
- FindPairing(matrix, listener);
- }
-
- private:
- template <typename ElementIter>
- MatchMatrix AnalyzeElements(ElementIter elem_first, ElementIter elem_last,
- ::std::vector<std::string>* element_printouts,
- MatchResultListener* listener) const {
- element_printouts->clear();
- ::std::vector<char> did_match;
- size_t num_elements = 0;
- DummyMatchResultListener dummy;
- for (; elem_first != elem_last; ++num_elements, ++elem_first) {
- if (listener->IsInterested()) {
- element_printouts->push_back(PrintToString(*elem_first));
- }
- for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
- did_match.push_back(
- matchers_[irhs].MatchAndExplain(*elem_first, &dummy));
- }
- }
-
- MatchMatrix matrix(num_elements, matchers_.size());
- ::std::vector<char>::const_iterator did_match_iter = did_match.begin();
- for (size_t ilhs = 0; ilhs != num_elements; ++ilhs) {
- for (size_t irhs = 0; irhs != matchers_.size(); ++irhs) {
- matrix.SetEdge(ilhs, irhs, *did_match_iter++ != 0);
- }
- }
- return matrix;
- }
-
- ::std::vector<Matcher<const Element&>> matchers_;
-};
-
-// Functor for use in TransformTuple.
-// Performs MatcherCast<Target> on an input argument of any type.
-template <typename Target>
-struct CastAndAppendTransform {
- template <typename Arg>
- Matcher<Target> operator()(const Arg& a) const {
- return MatcherCast<Target>(a);
- }
-};
-
-// Implements UnorderedElementsAre.
-template <typename MatcherTuple>
-class UnorderedElementsAreMatcher {
- public:
- explicit UnorderedElementsAreMatcher(const MatcherTuple& args)
- : matchers_(args) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type View;
- typedef typename View::value_type Element;
- typedef ::std::vector<Matcher<const Element&>> MatcherVec;
- MatcherVec matchers;
- matchers.reserve(::std::tuple_size<MatcherTuple>::value);
- TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
- ::std::back_inserter(matchers));
- return Matcher<Container>(
- new UnorderedElementsAreMatcherImpl<const Container&>(
- UnorderedMatcherRequire::ExactMatch, matchers.begin(),
- matchers.end()));
- }
-
- private:
- const MatcherTuple matchers_;
-};
-
-// Implements ElementsAre.
-template <typename MatcherTuple>
-class ElementsAreMatcher {
- public:
- explicit ElementsAreMatcher(const MatcherTuple& args) : matchers_(args) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- GTEST_COMPILE_ASSERT_(
- !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value ||
- ::std::tuple_size<MatcherTuple>::value < 2,
- use_UnorderedElementsAre_with_hash_tables);
-
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer;
- typedef typename internal::StlContainerView<RawContainer>::type View;
- typedef typename View::value_type Element;
- typedef ::std::vector<Matcher<const Element&>> MatcherVec;
- MatcherVec matchers;
- matchers.reserve(::std::tuple_size<MatcherTuple>::value);
- TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_,
- ::std::back_inserter(matchers));
- return Matcher<Container>(new ElementsAreMatcherImpl<const Container&>(
- matchers.begin(), matchers.end()));
- }
-
- private:
- const MatcherTuple matchers_;
-};
-
-// Implements UnorderedElementsAreArray(), IsSubsetOf(), and IsSupersetOf().
-template <typename T>
-class UnorderedElementsAreArrayMatcher {
- public:
- template <typename Iter>
- UnorderedElementsAreArrayMatcher(UnorderedMatcherRequire::Flags match_flags,
- Iter first, Iter last)
- : match_flags_(match_flags), matchers_(first, last) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- return Matcher<Container>(
- new UnorderedElementsAreMatcherImpl<const Container&>(
- match_flags_, matchers_.begin(), matchers_.end()));
- }
-
- private:
- UnorderedMatcherRequire::Flags match_flags_;
- ::std::vector<T> matchers_;
-};
-
-// Implements ElementsAreArray().
-template <typename T>
-class ElementsAreArrayMatcher {
- public:
- template <typename Iter>
- ElementsAreArrayMatcher(Iter first, Iter last) : matchers_(first, last) {}
-
- template <typename Container>
- operator Matcher<Container>() const {
- GTEST_COMPILE_ASSERT_(
- !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value,
- use_UnorderedElementsAreArray_with_hash_tables);
-
- return Matcher<Container>(new ElementsAreMatcherImpl<const Container&>(
- matchers_.begin(), matchers_.end()));
- }
-
- private:
- const ::std::vector<T> matchers_;
-};
-
-// Given a 2-tuple matcher tm of type Tuple2Matcher and a value second
-// of type Second, BoundSecondMatcher<Tuple2Matcher, Second>(tm,
-// second) is a polymorphic matcher that matches a value x if and only if
-// tm matches tuple (x, second). Useful for implementing
-// UnorderedPointwise() in terms of UnorderedElementsAreArray().
-//
-// BoundSecondMatcher is copyable and assignable, as we need to put
-// instances of this class in a vector when implementing
-// UnorderedPointwise().
-template <typename Tuple2Matcher, typename Second>
-class BoundSecondMatcher {
- public:
- BoundSecondMatcher(const Tuple2Matcher& tm, const Second& second)
- : tuple2_matcher_(tm), second_value_(second) {}
-
- BoundSecondMatcher(const BoundSecondMatcher& other) = default;
-
- template <typename T>
- operator Matcher<T>() const {
- return MakeMatcher(new Impl<T>(tuple2_matcher_, second_value_));
- }
-
- // We have to define this for UnorderedPointwise() to compile in
- // C++98 mode, as it puts BoundSecondMatcher instances in a vector,
- // which requires the elements to be assignable in C++98. The
- // compiler cannot generate the operator= for us, as Tuple2Matcher
- // and Second may not be assignable.
- //
- // However, this should never be called, so the implementation just
- // need to assert.
- void operator=(const BoundSecondMatcher& /*rhs*/) {
- GTEST_LOG_(FATAL) << "BoundSecondMatcher should never be assigned.";
- }
-
- private:
- template <typename T>
- class Impl : public MatcherInterface<T> {
- public:
- typedef ::std::tuple<T, Second> ArgTuple;
-
- Impl(const Tuple2Matcher& tm, const Second& second)
- : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)),
- second_value_(second) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "and ";
- UniversalPrint(second_value_, os);
- *os << " ";
- mono_tuple2_matcher_.DescribeTo(os);
- }
-
- bool MatchAndExplain(T x, MatchResultListener* listener) const override {
- return mono_tuple2_matcher_.MatchAndExplain(ArgTuple(x, second_value_),
- listener);
- }
-
- private:
- const Matcher<const ArgTuple&> mono_tuple2_matcher_;
- const Second second_value_;
- };
-
- const Tuple2Matcher tuple2_matcher_;
- const Second second_value_;
-};
-
-// Given a 2-tuple matcher tm and a value second,
-// MatcherBindSecond(tm, second) returns a matcher that matches a
-// value x if and only if tm matches tuple (x, second). Useful for
-// implementing UnorderedPointwise() in terms of UnorderedElementsAreArray().
-template <typename Tuple2Matcher, typename Second>
-BoundSecondMatcher<Tuple2Matcher, Second> MatcherBindSecond(
- const Tuple2Matcher& tm, const Second& second) {
- return BoundSecondMatcher<Tuple2Matcher, Second>(tm, second);
-}
-
-// Returns the description for a matcher defined using the MATCHER*()
-// macro where the user-supplied description string is "", if
-// 'negation' is false; otherwise returns the description of the
-// negation of the matcher. 'param_values' contains a list of strings
-// that are the print-out of the matcher's parameters.
-GTEST_API_ std::string FormatMatcherDescription(
- bool negation, const char* matcher_name,
- const std::vector<const char*>& param_names, const Strings& param_values);
-
-// Implements a matcher that checks the value of a optional<> type variable.
-template <typename ValueMatcher>
-class OptionalMatcher {
- public:
- explicit OptionalMatcher(const ValueMatcher& value_matcher)
- : value_matcher_(value_matcher) {}
-
- template <typename Optional>
- operator Matcher<Optional>() const {
- return Matcher<Optional>(new Impl<const Optional&>(value_matcher_));
- }
-
- template <typename Optional>
- class Impl : public MatcherInterface<Optional> {
- public:
- typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Optional) OptionalView;
- typedef typename OptionalView::value_type ValueType;
- explicit Impl(const ValueMatcher& value_matcher)
- : value_matcher_(MatcherCast<ValueType>(value_matcher)) {}
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "value ";
- value_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "value ";
- value_matcher_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(Optional optional,
- MatchResultListener* listener) const override {
- if (!optional) {
- *listener << "which is not engaged";
- return false;
- }
- const ValueType& value = *optional;
- StringMatchResultListener value_listener;
- const bool match = value_matcher_.MatchAndExplain(value, &value_listener);
- *listener << "whose value " << PrintToString(value)
- << (match ? " matches" : " doesn't match");
- PrintIfNotEmpty(value_listener.str(), listener->stream());
- return match;
- }
-
- private:
- const Matcher<ValueType> value_matcher_;
- };
-
- private:
- const ValueMatcher value_matcher_;
-};
-
-namespace variant_matcher {
-// Overloads to allow VariantMatcher to do proper ADL lookup.
-template <typename T>
-void holds_alternative() {}
-template <typename T>
-void get() {}
-
-// Implements a matcher that checks the value of a variant<> type variable.
-template <typename T>
-class VariantMatcher {
- public:
- explicit VariantMatcher(::testing::Matcher<const T&> matcher)
- : matcher_(std::move(matcher)) {}
-
- template <typename Variant>
- bool MatchAndExplain(const Variant& value,
- ::testing::MatchResultListener* listener) const {
- using std::get;
- if (!listener->IsInterested()) {
- return holds_alternative<T>(value) && matcher_.Matches(get<T>(value));
- }
-
- if (!holds_alternative<T>(value)) {
- *listener << "whose value is not of type '" << GetTypeName() << "'";
- return false;
- }
-
- const T& elem = get<T>(value);
- StringMatchResultListener elem_listener;
- const bool match = matcher_.MatchAndExplain(elem, &elem_listener);
- *listener << "whose value " << PrintToString(elem)
- << (match ? " matches" : " doesn't match");
- PrintIfNotEmpty(elem_listener.str(), listener->stream());
- return match;
- }
-
- void DescribeTo(std::ostream* os) const {
- *os << "is a variant<> with value of type '" << GetTypeName()
- << "' and the value ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(std::ostream* os) const {
- *os << "is a variant<> with value of type other than '" << GetTypeName()
- << "' or the value ";
- matcher_.DescribeNegationTo(os);
- }
-
- private:
- static std::string GetTypeName() {
-#if GTEST_HAS_RTTI
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
- return internal::GetTypeName<T>());
-#endif
- return "the element type";
- }
-
- const ::testing::Matcher<const T&> matcher_;
-};
-
-} // namespace variant_matcher
-
-namespace any_cast_matcher {
-
-// Overloads to allow AnyCastMatcher to do proper ADL lookup.
-template <typename T>
-void any_cast() {}
-
-// Implements a matcher that any_casts the value.
-template <typename T>
-class AnyCastMatcher {
- public:
- explicit AnyCastMatcher(const ::testing::Matcher<const T&>& matcher)
- : matcher_(matcher) {}
-
- template <typename AnyType>
- bool MatchAndExplain(const AnyType& value,
- ::testing::MatchResultListener* listener) const {
- if (!listener->IsInterested()) {
- const T* ptr = any_cast<T>(&value);
- return ptr != nullptr && matcher_.Matches(*ptr);
- }
-
- const T* elem = any_cast<T>(&value);
- if (elem == nullptr) {
- *listener << "whose value is not of type '" << GetTypeName() << "'";
- return false;
- }
-
- StringMatchResultListener elem_listener;
- const bool match = matcher_.MatchAndExplain(*elem, &elem_listener);
- *listener << "whose value " << PrintToString(*elem)
- << (match ? " matches" : " doesn't match");
- PrintIfNotEmpty(elem_listener.str(), listener->stream());
- return match;
- }
-
- void DescribeTo(std::ostream* os) const {
- *os << "is an 'any' type with value of type '" << GetTypeName()
- << "' and the value ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(std::ostream* os) const {
- *os << "is an 'any' type with value of type other than '" << GetTypeName()
- << "' or the value ";
- matcher_.DescribeNegationTo(os);
- }
-
- private:
- static std::string GetTypeName() {
-#if GTEST_HAS_RTTI
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
- return internal::GetTypeName<T>());
-#endif
- return "the element type";
- }
-
- const ::testing::Matcher<const T&> matcher_;
-};
-
-} // namespace any_cast_matcher
-
-// Implements the Args() matcher.
-template <class ArgsTuple, size_t... k>
-class ArgsMatcherImpl : public MatcherInterface<ArgsTuple> {
- public:
- using RawArgsTuple = typename std::decay<ArgsTuple>::type;
- using SelectedArgs =
- std::tuple<typename std::tuple_element<k, RawArgsTuple>::type...>;
- using MonomorphicInnerMatcher = Matcher<const SelectedArgs&>;
-
- template <typename InnerMatcher>
- explicit ArgsMatcherImpl(const InnerMatcher& inner_matcher)
- : inner_matcher_(SafeMatcherCast<const SelectedArgs&>(inner_matcher)) {}
-
- bool MatchAndExplain(ArgsTuple args,
- MatchResultListener* listener) const override {
- // Workaround spurious C4100 on MSVC<=15.7 when k is empty.
- (void)args;
- const SelectedArgs& selected_args =
- std::forward_as_tuple(std::get<k>(args)...);
- if (!listener->IsInterested()) return inner_matcher_.Matches(selected_args);
-
- PrintIndices(listener->stream());
- *listener << "are " << PrintToString(selected_args);
-
- StringMatchResultListener inner_listener;
- const bool match =
- inner_matcher_.MatchAndExplain(selected_args, &inner_listener);
- PrintIfNotEmpty(inner_listener.str(), listener->stream());
- return match;
- }
-
- void DescribeTo(::std::ostream* os) const override {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- *os << "are a tuple ";
- PrintIndices(os);
- inner_matcher_.DescribeNegationTo(os);
- }
-
- private:
- // Prints the indices of the selected fields.
- static void PrintIndices(::std::ostream* os) {
- *os << "whose fields (";
- const char* sep = "";
- // Workaround spurious C4189 on MSVC<=15.7 when k is empty.
- (void)sep;
- const char* dummy[] = {"", (*os << sep << "#" << k, sep = ", ")...};
- (void)dummy;
- *os << ") ";
- }
-
- MonomorphicInnerMatcher inner_matcher_;
-};
-
-template <class InnerMatcher, size_t... k>
-class ArgsMatcher {
- public:
- explicit ArgsMatcher(InnerMatcher inner_matcher)
- : inner_matcher_(std::move(inner_matcher)) {}
-
- template <typename ArgsTuple>
- operator Matcher<ArgsTuple>() const { // NOLINT
- return MakeMatcher(new ArgsMatcherImpl<ArgsTuple, k...>(inner_matcher_));
- }
-
- private:
- InnerMatcher inner_matcher_;
-};
-
-} // namespace internal
-
-// ElementsAreArray(iterator_first, iterator_last)
-// ElementsAreArray(pointer, count)
-// ElementsAreArray(array)
-// ElementsAreArray(container)
-// ElementsAreArray({ e1, e2, ..., en })
-//
-// The ElementsAreArray() functions are like ElementsAre(...), except
-// that they are given a homogeneous sequence rather than taking each
-// element as a function argument. The sequence can be specified as an
-// array, a pointer and count, a vector, an initializer list, or an
-// STL iterator range. In each of these cases, the underlying sequence
-// can be either a sequence of values or a sequence of matchers.
-//
-// All forms of ElementsAreArray() make a copy of the input matcher sequence.
-
-template <typename Iter>
-inline internal::ElementsAreArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-ElementsAreArray(Iter first, Iter last) {
- typedef typename ::std::iterator_traits<Iter>::value_type T;
- return internal::ElementsAreArrayMatcher<T>(first, last);
-}
-
-template <typename T>
-inline auto ElementsAreArray(const T* pointer, size_t count)
- -> decltype(ElementsAreArray(pointer, pointer + count)) {
- return ElementsAreArray(pointer, pointer + count);
-}
-
-template <typename T, size_t N>
-inline auto ElementsAreArray(const T (&array)[N])
- -> decltype(ElementsAreArray(array, N)) {
- return ElementsAreArray(array, N);
-}
-
-template <typename Container>
-inline auto ElementsAreArray(const Container& container)
- -> decltype(ElementsAreArray(container.begin(), container.end())) {
- return ElementsAreArray(container.begin(), container.end());
-}
-
-template <typename T>
-inline auto ElementsAreArray(::std::initializer_list<T> xs)
- -> decltype(ElementsAreArray(xs.begin(), xs.end())) {
- return ElementsAreArray(xs.begin(), xs.end());
-}
-
-// UnorderedElementsAreArray(iterator_first, iterator_last)
-// UnorderedElementsAreArray(pointer, count)
-// UnorderedElementsAreArray(array)
-// UnorderedElementsAreArray(container)
-// UnorderedElementsAreArray({ e1, e2, ..., en })
-//
-// UnorderedElementsAreArray() verifies that a bijective mapping onto a
-// collection of matchers exists.
-//
-// The matchers can be specified as an array, a pointer and count, a container,
-// an initializer list, or an STL iterator range. In each of these cases, the
-// underlying matchers can be either values or matchers.
-
-template <typename Iter>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-UnorderedElementsAreArray(Iter first, Iter last) {
- typedef typename ::std::iterator_traits<Iter>::value_type T;
- return internal::UnorderedElementsAreArrayMatcher<T>(
- internal::UnorderedMatcherRequire::ExactMatch, first, last);
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> UnorderedElementsAreArray(
- const T* pointer, size_t count) {
- return UnorderedElementsAreArray(pointer, pointer + count);
-}
-
-template <typename T, size_t N>
-inline internal::UnorderedElementsAreArrayMatcher<T> UnorderedElementsAreArray(
- const T (&array)[N]) {
- return UnorderedElementsAreArray(array, N);
-}
-
-template <typename Container>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename Container::value_type>
-UnorderedElementsAreArray(const Container& container) {
- return UnorderedElementsAreArray(container.begin(), container.end());
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> UnorderedElementsAreArray(
- ::std::initializer_list<T> xs) {
- return UnorderedElementsAreArray(xs.begin(), xs.end());
-}
-
-// _ is a matcher that matches anything of any type.
-//
-// This definition is fine as:
-//
-// 1. The C++ standard permits using the name _ in a namespace that
-// is not the global namespace or ::std.
-// 2. The AnythingMatcher class has no data member or constructor,
-// so it's OK to create global variables of this type.
-// 3. c-style has approved of using _ in this case.
-const internal::AnythingMatcher _ = {};
-// Creates a matcher that matches any value of the given type T.
-template <typename T>
-inline Matcher<T> A() {
- return _;
-}
-
-// Creates a matcher that matches any value of the given type T.
-template <typename T>
-inline Matcher<T> An() {
- return _;
-}
-
-template <typename T, typename M>
-Matcher<T> internal::MatcherCastImpl<T, M>::CastImpl(
- const M& value, std::false_type /* convertible_to_matcher */,
- std::false_type /* convertible_to_T */) {
- return Eq(value);
-}
-
-// Creates a polymorphic matcher that matches any NULL pointer.
-inline PolymorphicMatcher<internal::IsNullMatcher> IsNull() {
- return MakePolymorphicMatcher(internal::IsNullMatcher());
-}
-
-// Creates a polymorphic matcher that matches any non-NULL pointer.
-// This is convenient as Not(NULL) doesn't compile (the compiler
-// thinks that that expression is comparing a pointer with an integer).
-inline PolymorphicMatcher<internal::NotNullMatcher> NotNull() {
- return MakePolymorphicMatcher(internal::NotNullMatcher());
-}
-
-// Creates a polymorphic matcher that matches any argument that
-// references variable x.
-template <typename T>
-inline internal::RefMatcher<T&> Ref(T& x) { // NOLINT
- return internal::RefMatcher<T&>(x);
-}
-
-// Creates a polymorphic matcher that matches any NaN floating point.
-inline PolymorphicMatcher<internal::IsNanMatcher> IsNan() {
- return MakePolymorphicMatcher(internal::IsNanMatcher());
-}
-
-// Creates a matcher that matches any double argument approximately
-// equal to rhs, where two NANs are considered unequal.
-inline internal::FloatingEqMatcher<double> DoubleEq(double rhs) {
- return internal::FloatingEqMatcher<double>(rhs, false);
-}
-
-// Creates a matcher that matches any double argument approximately
-// equal to rhs, including NaN values when rhs is NaN.
-inline internal::FloatingEqMatcher<double> NanSensitiveDoubleEq(double rhs) {
- return internal::FloatingEqMatcher<double>(rhs, true);
-}
-
-// Creates a matcher that matches any double argument approximately equal to
-// rhs, up to the specified max absolute error bound, where two NANs are
-// considered unequal. The max absolute error bound must be non-negative.
-inline internal::FloatingEqMatcher<double> DoubleNear(double rhs,
- double max_abs_error) {
- return internal::FloatingEqMatcher<double>(rhs, false, max_abs_error);
-}
-
-// Creates a matcher that matches any double argument approximately equal to
-// rhs, up to the specified max absolute error bound, including NaN values when
-// rhs is NaN. The max absolute error bound must be non-negative.
-inline internal::FloatingEqMatcher<double> NanSensitiveDoubleNear(
- double rhs, double max_abs_error) {
- return internal::FloatingEqMatcher<double>(rhs, true, max_abs_error);
-}
-
-// Creates a matcher that matches any float argument approximately
-// equal to rhs, where two NANs are considered unequal.
-inline internal::FloatingEqMatcher<float> FloatEq(float rhs) {
- return internal::FloatingEqMatcher<float>(rhs, false);
-}
-
-// Creates a matcher that matches any float argument approximately
-// equal to rhs, including NaN values when rhs is NaN.
-inline internal::FloatingEqMatcher<float> NanSensitiveFloatEq(float rhs) {
- return internal::FloatingEqMatcher<float>(rhs, true);
-}
-
-// Creates a matcher that matches any float argument approximately equal to
-// rhs, up to the specified max absolute error bound, where two NANs are
-// considered unequal. The max absolute error bound must be non-negative.
-inline internal::FloatingEqMatcher<float> FloatNear(float rhs,
- float max_abs_error) {
- return internal::FloatingEqMatcher<float>(rhs, false, max_abs_error);
-}
-
-// Creates a matcher that matches any float argument approximately equal to
-// rhs, up to the specified max absolute error bound, including NaN values when
-// rhs is NaN. The max absolute error bound must be non-negative.
-inline internal::FloatingEqMatcher<float> NanSensitiveFloatNear(
- float rhs, float max_abs_error) {
- return internal::FloatingEqMatcher<float>(rhs, true, max_abs_error);
-}
-
-// Creates a matcher that matches a pointer (raw or smart) that points
-// to a value that matches inner_matcher.
-template <typename InnerMatcher>
-inline internal::PointeeMatcher<InnerMatcher> Pointee(
- const InnerMatcher& inner_matcher) {
- return internal::PointeeMatcher<InnerMatcher>(inner_matcher);
-}
-
-#if GTEST_HAS_RTTI
-// Creates a matcher that matches a pointer or reference that matches
-// inner_matcher when dynamic_cast<To> is applied.
-// The result of dynamic_cast<To> is forwarded to the inner matcher.
-// If To is a pointer and the cast fails, the inner matcher will receive NULL.
-// If To is a reference and the cast fails, this matcher returns false
-// immediately.
-template <typename To>
-inline PolymorphicMatcher<internal::WhenDynamicCastToMatcher<To>>
-WhenDynamicCastTo(const Matcher<To>& inner_matcher) {
- return MakePolymorphicMatcher(
- internal::WhenDynamicCastToMatcher<To>(inner_matcher));
-}
-#endif // GTEST_HAS_RTTI
-
-// Creates a matcher that matches an object whose given field matches
-// 'matcher'. For example,
-// Field(&Foo::number, Ge(5))
-// matches a Foo object x if and only if x.number >= 5.
-template <typename Class, typename FieldType, typename FieldMatcher>
-inline PolymorphicMatcher<internal::FieldMatcher<Class, FieldType>> Field(
- FieldType Class::*field, const FieldMatcher& matcher) {
- return MakePolymorphicMatcher(internal::FieldMatcher<Class, FieldType>(
- field, MatcherCast<const FieldType&>(matcher)));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // Field(&Foo::bar, m)
- // to compile where bar is an int32 and m is a matcher for int64.
-}
-
-// Same as Field() but also takes the name of the field to provide better error
-// messages.
-template <typename Class, typename FieldType, typename FieldMatcher>
-inline PolymorphicMatcher<internal::FieldMatcher<Class, FieldType>> Field(
- const std::string& field_name, FieldType Class::*field,
- const FieldMatcher& matcher) {
- return MakePolymorphicMatcher(internal::FieldMatcher<Class, FieldType>(
- field_name, field, MatcherCast<const FieldType&>(matcher)));
-}
-
-// Creates a matcher that matches an object whose given property
-// matches 'matcher'. For example,
-// Property(&Foo::str, StartsWith("hi"))
-// matches a Foo object x if and only if x.str() starts with "hi".
-template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<internal::PropertyMatcher<
- Class, PropertyType, PropertyType (Class::*)() const>>
-Property(PropertyType (Class::*property)() const,
- const PropertyMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType,
- PropertyType (Class::*)() const>(
- property, MatcherCast<const PropertyType&>(matcher)));
- // The call to MatcherCast() is required for supporting inner
- // matchers of compatible types. For example, it allows
- // Property(&Foo::bar, m)
- // to compile where bar() returns an int32 and m is a matcher for int64.
-}
-
-// Same as Property() above, but also takes the name of the property to provide
-// better error messages.
-template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<internal::PropertyMatcher<
- Class, PropertyType, PropertyType (Class::*)() const>>
-Property(const std::string& property_name,
- PropertyType (Class::*property)() const,
- const PropertyMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType,
- PropertyType (Class::*)() const>(
- property_name, property, MatcherCast<const PropertyType&>(matcher)));
-}
-
-// The same as above but for reference-qualified member functions.
-template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<internal::PropertyMatcher<
- Class, PropertyType, PropertyType (Class::*)() const&>>
-Property(PropertyType (Class::*property)() const&,
- const PropertyMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType,
- PropertyType (Class::*)() const&>(
- property, MatcherCast<const PropertyType&>(matcher)));
-}
-
-// Three-argument form for reference-qualified member functions.
-template <typename Class, typename PropertyType, typename PropertyMatcher>
-inline PolymorphicMatcher<internal::PropertyMatcher<
- Class, PropertyType, PropertyType (Class::*)() const&>>
-Property(const std::string& property_name,
- PropertyType (Class::*property)() const&,
- const PropertyMatcher& matcher) {
- return MakePolymorphicMatcher(
- internal::PropertyMatcher<Class, PropertyType,
- PropertyType (Class::*)() const&>(
- property_name, property, MatcherCast<const PropertyType&>(matcher)));
-}
-
-// Creates a matcher that matches an object if and only if the result of
-// applying a callable to x matches 'matcher'. For example,
-// ResultOf(f, StartsWith("hi"))
-// matches a Foo object x if and only if f(x) starts with "hi".
-// `callable` parameter can be a function, function pointer, or a functor. It is
-// required to keep no state affecting the results of the calls on it and make
-// no assumptions about how many calls will be made. Any state it keeps must be
-// protected from the concurrent access.
-template <typename Callable, typename InnerMatcher>
-internal::ResultOfMatcher<Callable, InnerMatcher> ResultOf(
- Callable callable, InnerMatcher matcher) {
- return internal::ResultOfMatcher<Callable, InnerMatcher>(std::move(callable),
- std::move(matcher));
-}
-
-// String matchers.
-
-// Matches a string equal to str.
-template <typename T = std::string>
-PolymorphicMatcher<internal::StrEqualityMatcher<std::string>> StrEq(
- const internal::StringLike<T>& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::string>(std::string(str), true, true));
-}
-
-// Matches a string not equal to str.
-template <typename T = std::string>
-PolymorphicMatcher<internal::StrEqualityMatcher<std::string>> StrNe(
- const internal::StringLike<T>& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::string>(std::string(str), false, true));
-}
-
-// Matches a string equal to str, ignoring case.
-template <typename T = std::string>
-PolymorphicMatcher<internal::StrEqualityMatcher<std::string>> StrCaseEq(
- const internal::StringLike<T>& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::string>(std::string(str), true, false));
-}
-
-// Matches a string not equal to str, ignoring case.
-template <typename T = std::string>
-PolymorphicMatcher<internal::StrEqualityMatcher<std::string>> StrCaseNe(
- const internal::StringLike<T>& str) {
- return MakePolymorphicMatcher(internal::StrEqualityMatcher<std::string>(
- std::string(str), false, false));
-}
-
-// Creates a matcher that matches any string, std::string, or C string
-// that contains the given substring.
-template <typename T = std::string>
-PolymorphicMatcher<internal::HasSubstrMatcher<std::string>> HasSubstr(
- const internal::StringLike<T>& substring) {
- return MakePolymorphicMatcher(
- internal::HasSubstrMatcher<std::string>(std::string(substring)));
-}
-
-// Matches a string that starts with 'prefix' (case-sensitive).
-template <typename T = std::string>
-PolymorphicMatcher<internal::StartsWithMatcher<std::string>> StartsWith(
- const internal::StringLike<T>& prefix) {
- return MakePolymorphicMatcher(
- internal::StartsWithMatcher<std::string>(std::string(prefix)));
-}
-
-// Matches a string that ends with 'suffix' (case-sensitive).
-template <typename T = std::string>
-PolymorphicMatcher<internal::EndsWithMatcher<std::string>> EndsWith(
- const internal::StringLike<T>& suffix) {
- return MakePolymorphicMatcher(
- internal::EndsWithMatcher<std::string>(std::string(suffix)));
-}
-
-#if GTEST_HAS_STD_WSTRING
-// Wide string matchers.
-
-// Matches a string equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<std::wstring>> StrEq(
- const std::wstring& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::wstring>(str, true, true));
-}
-
-// Matches a string not equal to str.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<std::wstring>> StrNe(
- const std::wstring& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::wstring>(str, false, true));
-}
-
-// Matches a string equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<std::wstring>> StrCaseEq(
- const std::wstring& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::wstring>(str, true, false));
-}
-
-// Matches a string not equal to str, ignoring case.
-inline PolymorphicMatcher<internal::StrEqualityMatcher<std::wstring>> StrCaseNe(
- const std::wstring& str) {
- return MakePolymorphicMatcher(
- internal::StrEqualityMatcher<std::wstring>(str, false, false));
-}
-
-// Creates a matcher that matches any ::wstring, std::wstring, or C wide string
-// that contains the given substring.
-inline PolymorphicMatcher<internal::HasSubstrMatcher<std::wstring>> HasSubstr(
- const std::wstring& substring) {
- return MakePolymorphicMatcher(
- internal::HasSubstrMatcher<std::wstring>(substring));
-}
-
-// Matches a string that starts with 'prefix' (case-sensitive).
-inline PolymorphicMatcher<internal::StartsWithMatcher<std::wstring>> StartsWith(
- const std::wstring& prefix) {
- return MakePolymorphicMatcher(
- internal::StartsWithMatcher<std::wstring>(prefix));
-}
-
-// Matches a string that ends with 'suffix' (case-sensitive).
-inline PolymorphicMatcher<internal::EndsWithMatcher<std::wstring>> EndsWith(
- const std::wstring& suffix) {
- return MakePolymorphicMatcher(
- internal::EndsWithMatcher<std::wstring>(suffix));
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field == the second field.
-inline internal::Eq2Matcher Eq() { return internal::Eq2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field >= the second field.
-inline internal::Ge2Matcher Ge() { return internal::Ge2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field > the second field.
-inline internal::Gt2Matcher Gt() { return internal::Gt2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field <= the second field.
-inline internal::Le2Matcher Le() { return internal::Le2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field < the second field.
-inline internal::Lt2Matcher Lt() { return internal::Lt2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where the
-// first field != the second field.
-inline internal::Ne2Matcher Ne() { return internal::Ne2Matcher(); }
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// FloatEq(first field) matches the second field.
-inline internal::FloatingEq2Matcher<float> FloatEq() {
- return internal::FloatingEq2Matcher<float>();
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// DoubleEq(first field) matches the second field.
-inline internal::FloatingEq2Matcher<double> DoubleEq() {
- return internal::FloatingEq2Matcher<double>();
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// FloatEq(first field) matches the second field with NaN equality.
-inline internal::FloatingEq2Matcher<float> NanSensitiveFloatEq() {
- return internal::FloatingEq2Matcher<float>(true);
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// DoubleEq(first field) matches the second field with NaN equality.
-inline internal::FloatingEq2Matcher<double> NanSensitiveDoubleEq() {
- return internal::FloatingEq2Matcher<double>(true);
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// FloatNear(first field, max_abs_error) matches the second field.
-inline internal::FloatingEq2Matcher<float> FloatNear(float max_abs_error) {
- return internal::FloatingEq2Matcher<float>(max_abs_error);
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// DoubleNear(first field, max_abs_error) matches the second field.
-inline internal::FloatingEq2Matcher<double> DoubleNear(double max_abs_error) {
- return internal::FloatingEq2Matcher<double>(max_abs_error);
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// FloatNear(first field, max_abs_error) matches the second field with NaN
-// equality.
-inline internal::FloatingEq2Matcher<float> NanSensitiveFloatNear(
- float max_abs_error) {
- return internal::FloatingEq2Matcher<float>(max_abs_error, true);
-}
-
-// Creates a polymorphic matcher that matches a 2-tuple where
-// DoubleNear(first field, max_abs_error) matches the second field with NaN
-// equality.
-inline internal::FloatingEq2Matcher<double> NanSensitiveDoubleNear(
- double max_abs_error) {
- return internal::FloatingEq2Matcher<double>(max_abs_error, true);
-}
-
-// Creates a matcher that matches any value of type T that m doesn't
-// match.
-template <typename InnerMatcher>
-inline internal::NotMatcher<InnerMatcher> Not(InnerMatcher m) {
- return internal::NotMatcher<InnerMatcher>(m);
-}
-
-// Returns a matcher that matches anything that satisfies the given
-// predicate. The predicate can be any unary function or functor
-// whose return type can be implicitly converted to bool.
-template <typename Predicate>
-inline PolymorphicMatcher<internal::TrulyMatcher<Predicate>> Truly(
- Predicate pred) {
- return MakePolymorphicMatcher(internal::TrulyMatcher<Predicate>(pred));
-}
-
-// Returns a matcher that matches the container size. The container must
-// support both size() and size_type which all STL-like containers provide.
-// Note that the parameter 'size' can be a value of type size_type as well as
-// matcher. For instance:
-// EXPECT_THAT(container, SizeIs(2)); // Checks container has 2 elements.
-// EXPECT_THAT(container, SizeIs(Le(2)); // Checks container has at most 2.
-template <typename SizeMatcher>
-inline internal::SizeIsMatcher<SizeMatcher> SizeIs(
- const SizeMatcher& size_matcher) {
- return internal::SizeIsMatcher<SizeMatcher>(size_matcher);
-}
-
-// Returns a matcher that matches the distance between the container's begin()
-// iterator and its end() iterator, i.e. the size of the container. This matcher
-// can be used instead of SizeIs with containers such as std::forward_list which
-// do not implement size(). The container must provide const_iterator (with
-// valid iterator_traits), begin() and end().
-template <typename DistanceMatcher>
-inline internal::BeginEndDistanceIsMatcher<DistanceMatcher> BeginEndDistanceIs(
- const DistanceMatcher& distance_matcher) {
- return internal::BeginEndDistanceIsMatcher<DistanceMatcher>(distance_matcher);
-}
-
-// Returns a matcher that matches an equal container.
-// This matcher behaves like Eq(), but in the event of mismatch lists the
-// values that are included in one container but not the other. (Duplicate
-// values and order differences are not explained.)
-template <typename Container>
-inline PolymorphicMatcher<
- internal::ContainerEqMatcher<typename std::remove_const<Container>::type>>
-ContainerEq(const Container& rhs) {
- return MakePolymorphicMatcher(internal::ContainerEqMatcher<Container>(rhs));
-}
-
-// Returns a matcher that matches a container that, when sorted using
-// the given comparator, matches container_matcher.
-template <typename Comparator, typename ContainerMatcher>
-inline internal::WhenSortedByMatcher<Comparator, ContainerMatcher> WhenSortedBy(
- const Comparator& comparator, const ContainerMatcher& container_matcher) {
- return internal::WhenSortedByMatcher<Comparator, ContainerMatcher>(
- comparator, container_matcher);
-}
-
-// Returns a matcher that matches a container that, when sorted using
-// the < operator, matches container_matcher.
-template <typename ContainerMatcher>
-inline internal::WhenSortedByMatcher<internal::LessComparator, ContainerMatcher>
-WhenSorted(const ContainerMatcher& container_matcher) {
- return internal::WhenSortedByMatcher<internal::LessComparator,
- ContainerMatcher>(
- internal::LessComparator(), container_matcher);
-}
-
-// Matches an STL-style container or a native array that contains the
-// same number of elements as in rhs, where its i-th element and rhs's
-// i-th element (as a pair) satisfy the given pair matcher, for all i.
-// TupleMatcher must be able to be safely cast to Matcher<std::tuple<const
-// T1&, const T2&> >, where T1 and T2 are the types of elements in the
-// LHS container and the RHS container respectively.
-template <typename TupleMatcher, typename Container>
-inline internal::PointwiseMatcher<TupleMatcher,
- typename std::remove_const<Container>::type>
-Pointwise(const TupleMatcher& tuple_matcher, const Container& rhs) {
- return internal::PointwiseMatcher<TupleMatcher, Container>(tuple_matcher,
- rhs);
-}
-
-// Supports the Pointwise(m, {a, b, c}) syntax.
-template <typename TupleMatcher, typename T>
-inline internal::PointwiseMatcher<TupleMatcher, std::vector<T>> Pointwise(
- const TupleMatcher& tuple_matcher, std::initializer_list<T> rhs) {
- return Pointwise(tuple_matcher, std::vector<T>(rhs));
-}
-
-// UnorderedPointwise(pair_matcher, rhs) matches an STL-style
-// container or a native array that contains the same number of
-// elements as in rhs, where in some permutation of the container, its
-// i-th element and rhs's i-th element (as a pair) satisfy the given
-// pair matcher, for all i. Tuple2Matcher must be able to be safely
-// cast to Matcher<std::tuple<const T1&, const T2&> >, where T1 and T2 are
-// the types of elements in the LHS container and the RHS container
-// respectively.
-//
-// This is like Pointwise(pair_matcher, rhs), except that the element
-// order doesn't matter.
-template <typename Tuple2Matcher, typename RhsContainer>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename internal::BoundSecondMatcher<
- Tuple2Matcher,
- typename internal::StlContainerView<
- typename std::remove_const<RhsContainer>::type>::type::value_type>>
-UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
- const RhsContainer& rhs_container) {
- // RhsView allows the same code to handle RhsContainer being a
- // STL-style container and it being a native C-style array.
- typedef typename internal::StlContainerView<RhsContainer> RhsView;
- typedef typename RhsView::type RhsStlContainer;
- typedef typename RhsStlContainer::value_type Second;
- const RhsStlContainer& rhs_stl_container =
- RhsView::ConstReference(rhs_container);
-
- // Create a matcher for each element in rhs_container.
- ::std::vector<internal::BoundSecondMatcher<Tuple2Matcher, Second>> matchers;
- for (auto it = rhs_stl_container.begin(); it != rhs_stl_container.end();
- ++it) {
- matchers.push_back(internal::MatcherBindSecond(tuple2_matcher, *it));
- }
-
- // Delegate the work to UnorderedElementsAreArray().
- return UnorderedElementsAreArray(matchers);
-}
-
-// Supports the UnorderedPointwise(m, {a, b, c}) syntax.
-template <typename Tuple2Matcher, typename T>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename internal::BoundSecondMatcher<Tuple2Matcher, T>>
-UnorderedPointwise(const Tuple2Matcher& tuple2_matcher,
- std::initializer_list<T> rhs) {
- return UnorderedPointwise(tuple2_matcher, std::vector<T>(rhs));
-}
-
-// Matches an STL-style container or a native array that contains at
-// least one element matching the given value or matcher.
-//
-// Examples:
-// ::std::set<int> page_ids;
-// page_ids.insert(3);
-// page_ids.insert(1);
-// EXPECT_THAT(page_ids, Contains(1));
-// EXPECT_THAT(page_ids, Contains(Gt(2)));
-// EXPECT_THAT(page_ids, Not(Contains(4))); // See below for Times(0)
-//
-// ::std::map<int, size_t> page_lengths;
-// page_lengths[1] = 100;
-// EXPECT_THAT(page_lengths,
-// Contains(::std::pair<const int, size_t>(1, 100)));
-//
-// const char* user_ids[] = { "joe", "mike", "tom" };
-// EXPECT_THAT(user_ids, Contains(Eq(::std::string("tom"))));
-//
-// The matcher supports a modifier `Times` that allows to check for arbitrary
-// occurrences including testing for absence with Times(0).
-//
-// Examples:
-// ::std::vector<int> ids;
-// ids.insert(1);
-// ids.insert(1);
-// ids.insert(3);
-// EXPECT_THAT(ids, Contains(1).Times(2)); // 1 occurs 2 times
-// EXPECT_THAT(ids, Contains(2).Times(0)); // 2 is not present
-// EXPECT_THAT(ids, Contains(3).Times(Ge(1))); // 3 occurs at least once
-
-template <typename M>
-inline internal::ContainsMatcher<M> Contains(M matcher) {
- return internal::ContainsMatcher<M>(matcher);
-}
-
-// IsSupersetOf(iterator_first, iterator_last)
-// IsSupersetOf(pointer, count)
-// IsSupersetOf(array)
-// IsSupersetOf(container)
-// IsSupersetOf({e1, e2, ..., en})
-//
-// IsSupersetOf() verifies that a surjective partial mapping onto a collection
-// of matchers exists. In other words, a container matches
-// IsSupersetOf({e1, ..., en}) if and only if there is a permutation
-// {y1, ..., yn} of some of the container's elements where y1 matches e1,
-// ..., and yn matches en. Obviously, the size of the container must be >= n
-// in order to have a match. Examples:
-//
-// - {1, 2, 3} matches IsSupersetOf({Ge(3), Ne(0)}), as 3 matches Ge(3) and
-// 1 matches Ne(0).
-// - {1, 2} doesn't match IsSupersetOf({Eq(1), Lt(2)}), even though 1 matches
-// both Eq(1) and Lt(2). The reason is that different matchers must be used
-// for elements in different slots of the container.
-// - {1, 1, 2} matches IsSupersetOf({Eq(1), Lt(2)}), as (the first) 1 matches
-// Eq(1) and (the second) 1 matches Lt(2).
-// - {1, 2, 3} matches IsSupersetOf(Gt(1), Gt(1)), as 2 matches (the first)
-// Gt(1) and 3 matches (the second) Gt(1).
-//
-// The matchers can be specified as an array, a pointer and count, a container,
-// an initializer list, or an STL iterator range. In each of these cases, the
-// underlying matchers can be either values or matchers.
-
-template <typename Iter>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-IsSupersetOf(Iter first, Iter last) {
- typedef typename ::std::iterator_traits<Iter>::value_type T;
- return internal::UnorderedElementsAreArrayMatcher<T>(
- internal::UnorderedMatcherRequire::Superset, first, last);
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSupersetOf(
- const T* pointer, size_t count) {
- return IsSupersetOf(pointer, pointer + count);
-}
-
-template <typename T, size_t N>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSupersetOf(
- const T (&array)[N]) {
- return IsSupersetOf(array, N);
-}
-
-template <typename Container>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename Container::value_type>
-IsSupersetOf(const Container& container) {
- return IsSupersetOf(container.begin(), container.end());
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSupersetOf(
- ::std::initializer_list<T> xs) {
- return IsSupersetOf(xs.begin(), xs.end());
-}
-
-// IsSubsetOf(iterator_first, iterator_last)
-// IsSubsetOf(pointer, count)
-// IsSubsetOf(array)
-// IsSubsetOf(container)
-// IsSubsetOf({e1, e2, ..., en})
-//
-// IsSubsetOf() verifies that an injective mapping onto a collection of matchers
-// exists. In other words, a container matches IsSubsetOf({e1, ..., en}) if and
-// only if there is a subset of matchers {m1, ..., mk} which would match the
-// container using UnorderedElementsAre. Obviously, the size of the container
-// must be <= n in order to have a match. Examples:
-//
-// - {1} matches IsSubsetOf({Gt(0), Lt(0)}), as 1 matches Gt(0).
-// - {1, -1} matches IsSubsetOf({Lt(0), Gt(0)}), as 1 matches Gt(0) and -1
-// matches Lt(0).
-// - {1, 2} doesn't matches IsSubsetOf({Gt(0), Lt(0)}), even though 1 and 2 both
-// match Gt(0). The reason is that different matchers must be used for
-// elements in different slots of the container.
-//
-// The matchers can be specified as an array, a pointer and count, a container,
-// an initializer list, or an STL iterator range. In each of these cases, the
-// underlying matchers can be either values or matchers.
-
-template <typename Iter>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-IsSubsetOf(Iter first, Iter last) {
- typedef typename ::std::iterator_traits<Iter>::value_type T;
- return internal::UnorderedElementsAreArrayMatcher<T>(
- internal::UnorderedMatcherRequire::Subset, first, last);
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSubsetOf(
- const T* pointer, size_t count) {
- return IsSubsetOf(pointer, pointer + count);
-}
-
-template <typename T, size_t N>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSubsetOf(
- const T (&array)[N]) {
- return IsSubsetOf(array, N);
-}
-
-template <typename Container>
-inline internal::UnorderedElementsAreArrayMatcher<
- typename Container::value_type>
-IsSubsetOf(const Container& container) {
- return IsSubsetOf(container.begin(), container.end());
-}
-
-template <typename T>
-inline internal::UnorderedElementsAreArrayMatcher<T> IsSubsetOf(
- ::std::initializer_list<T> xs) {
- return IsSubsetOf(xs.begin(), xs.end());
-}
-
-// Matches an STL-style container or a native array that contains only
-// elements matching the given value or matcher.
-//
-// Each(m) is semantically equivalent to `Not(Contains(Not(m)))`. Only
-// the messages are different.
-//
-// Examples:
-// ::std::set<int> page_ids;
-// // Each(m) matches an empty container, regardless of what m is.
-// EXPECT_THAT(page_ids, Each(Eq(1)));
-// EXPECT_THAT(page_ids, Each(Eq(77)));
-//
-// page_ids.insert(3);
-// EXPECT_THAT(page_ids, Each(Gt(0)));
-// EXPECT_THAT(page_ids, Not(Each(Gt(4))));
-// page_ids.insert(1);
-// EXPECT_THAT(page_ids, Not(Each(Lt(2))));
-//
-// ::std::map<int, size_t> page_lengths;
-// page_lengths[1] = 100;
-// page_lengths[2] = 200;
-// page_lengths[3] = 300;
-// EXPECT_THAT(page_lengths, Not(Each(Pair(1, 100))));
-// EXPECT_THAT(page_lengths, Each(Key(Le(3))));
-//
-// const char* user_ids[] = { "joe", "mike", "tom" };
-// EXPECT_THAT(user_ids, Not(Each(Eq(::std::string("tom")))));
-template <typename M>
-inline internal::EachMatcher<M> Each(M matcher) {
- return internal::EachMatcher<M>(matcher);
-}
-
-// Key(inner_matcher) matches an std::pair whose 'first' field matches
-// inner_matcher. For example, Contains(Key(Ge(5))) can be used to match an
-// std::map that contains at least one element whose key is >= 5.
-template <typename M>
-inline internal::KeyMatcher<M> Key(M inner_matcher) {
- return internal::KeyMatcher<M>(inner_matcher);
-}
-
-// Pair(first_matcher, second_matcher) matches a std::pair whose 'first' field
-// matches first_matcher and whose 'second' field matches second_matcher. For
-// example, EXPECT_THAT(map_type, ElementsAre(Pair(Ge(5), "foo"))) can be used
-// to match a std::map<int, string> that contains exactly one element whose key
-// is >= 5 and whose value equals "foo".
-template <typename FirstMatcher, typename SecondMatcher>
-inline internal::PairMatcher<FirstMatcher, SecondMatcher> Pair(
- FirstMatcher first_matcher, SecondMatcher second_matcher) {
- return internal::PairMatcher<FirstMatcher, SecondMatcher>(first_matcher,
- second_matcher);
-}
-
-namespace no_adl {
-// Conditional() creates a matcher that conditionally uses either the first or
-// second matcher provided. For example, we could create an `equal if, and only
-// if' matcher using the Conditional wrapper as follows:
-//
-// EXPECT_THAT(result, Conditional(condition, Eq(expected), Ne(expected)));
-template <typename MatcherTrue, typename MatcherFalse>
-internal::ConditionalMatcher<MatcherTrue, MatcherFalse> Conditional(
- bool condition, MatcherTrue matcher_true, MatcherFalse matcher_false) {
- return internal::ConditionalMatcher<MatcherTrue, MatcherFalse>(
- condition, std::move(matcher_true), std::move(matcher_false));
-}
-
-// FieldsAre(matchers...) matches piecewise the fields of compatible structs.
-// These include those that support `get<I>(obj)`, and when structured bindings
-// are enabled any class that supports them.
-// In particular, `std::tuple`, `std::pair`, `std::array` and aggregate types.
-template <typename... M>
-internal::FieldsAreMatcher<typename std::decay<M>::type...> FieldsAre(
- M&&... matchers) {
- return internal::FieldsAreMatcher<typename std::decay<M>::type...>(
- std::forward<M>(matchers)...);
-}
-
-// Creates a matcher that matches a pointer (raw or smart) that matches
-// inner_matcher.
-template <typename InnerMatcher>
-inline internal::PointerMatcher<InnerMatcher> Pointer(
- const InnerMatcher& inner_matcher) {
- return internal::PointerMatcher<InnerMatcher>(inner_matcher);
-}
-
-// Creates a matcher that matches an object that has an address that matches
-// inner_matcher.
-template <typename InnerMatcher>
-inline internal::AddressMatcher<InnerMatcher> Address(
- const InnerMatcher& inner_matcher) {
- return internal::AddressMatcher<InnerMatcher>(inner_matcher);
-}
-
-// Matches a base64 escaped string, when the unescaped string matches the
-// internal matcher.
-template <typename MatcherType>
-internal::WhenBase64UnescapedMatcher WhenBase64Unescaped(
- const MatcherType& internal_matcher) {
- return internal::WhenBase64UnescapedMatcher(internal_matcher);
-}
-} // namespace no_adl
-
-// Returns a predicate that is satisfied by anything that matches the
-// given matcher.
-template <typename M>
-inline internal::MatcherAsPredicate<M> Matches(M matcher) {
- return internal::MatcherAsPredicate<M>(matcher);
-}
-
-// Returns true if and only if the value matches the matcher.
-template <typename T, typename M>
-inline bool Value(const T& value, M matcher) {
- return testing::Matches(matcher)(value);
-}
-
-// Matches the value against the given matcher and explains the match
-// result to listener.
-template <typename T, typename M>
-inline bool ExplainMatchResult(M matcher, const T& value,
- MatchResultListener* listener) {
- return SafeMatcherCast<const T&>(matcher).MatchAndExplain(value, listener);
-}
-
-// Returns a string representation of the given matcher. Useful for description
-// strings of matchers defined using MATCHER_P* macros that accept matchers as
-// their arguments. For example:
-//
-// MATCHER_P(XAndYThat, matcher,
-// "X that " + DescribeMatcher<int>(matcher, negation) +
-// " and Y that " + DescribeMatcher<double>(matcher, negation)) {
-// return ExplainMatchResult(matcher, arg.x(), result_listener) &&
-// ExplainMatchResult(matcher, arg.y(), result_listener);
-// }
-template <typename T, typename M>
-std::string DescribeMatcher(const M& matcher, bool negation = false) {
- ::std::stringstream ss;
- Matcher<T> monomorphic_matcher = SafeMatcherCast<T>(matcher);
- if (negation) {
- monomorphic_matcher.DescribeNegationTo(&ss);
- } else {
- monomorphic_matcher.DescribeTo(&ss);
- }
- return ss.str();
-}
-
-template <typename... Args>
-internal::ElementsAreMatcher<
- std::tuple<typename std::decay<const Args&>::type...>>
-ElementsAre(const Args&... matchers) {
- return internal::ElementsAreMatcher<
- std::tuple<typename std::decay<const Args&>::type...>>(
- std::make_tuple(matchers...));
-}
-
-template <typename... Args>
-internal::UnorderedElementsAreMatcher<
- std::tuple<typename std::decay<const Args&>::type...>>
-UnorderedElementsAre(const Args&... matchers) {
- return internal::UnorderedElementsAreMatcher<
- std::tuple<typename std::decay<const Args&>::type...>>(
- std::make_tuple(matchers...));
-}
-
-// Define variadic matcher versions.
-template <typename... Args>
-internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf(
- const Args&... matchers) {
- return internal::AllOfMatcher<typename std::decay<const Args&>::type...>(
- matchers...);
-}
-
-template <typename... Args>
-internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf(
- const Args&... matchers) {
- return internal::AnyOfMatcher<typename std::decay<const Args&>::type...>(
- matchers...);
-}
-
-// AnyOfArray(array)
-// AnyOfArray(pointer, count)
-// AnyOfArray(container)
-// AnyOfArray({ e1, e2, ..., en })
-// AnyOfArray(iterator_first, iterator_last)
-//
-// AnyOfArray() verifies whether a given value matches any member of a
-// collection of matchers.
-//
-// AllOfArray(array)
-// AllOfArray(pointer, count)
-// AllOfArray(container)
-// AllOfArray({ e1, e2, ..., en })
-// AllOfArray(iterator_first, iterator_last)
-//
-// AllOfArray() verifies whether a given value matches all members of a
-// collection of matchers.
-//
-// The matchers can be specified as an array, a pointer and count, a container,
-// an initializer list, or an STL iterator range. In each of these cases, the
-// underlying matchers can be either values or matchers.
-
-template <typename Iter>
-inline internal::AnyOfArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-AnyOfArray(Iter first, Iter last) {
- return internal::AnyOfArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>(first, last);
-}
-
-template <typename Iter>
-inline internal::AllOfArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>
-AllOfArray(Iter first, Iter last) {
- return internal::AllOfArrayMatcher<
- typename ::std::iterator_traits<Iter>::value_type>(first, last);
-}
-
-template <typename T>
-inline internal::AnyOfArrayMatcher<T> AnyOfArray(const T* ptr, size_t count) {
- return AnyOfArray(ptr, ptr + count);
-}
-
-template <typename T>
-inline internal::AllOfArrayMatcher<T> AllOfArray(const T* ptr, size_t count) {
- return AllOfArray(ptr, ptr + count);
-}
-
-template <typename T, size_t N>
-inline internal::AnyOfArrayMatcher<T> AnyOfArray(const T (&array)[N]) {
- return AnyOfArray(array, N);
-}
-
-template <typename T, size_t N>
-inline internal::AllOfArrayMatcher<T> AllOfArray(const T (&array)[N]) {
- return AllOfArray(array, N);
-}
-
-template <typename Container>
-inline internal::AnyOfArrayMatcher<typename Container::value_type> AnyOfArray(
- const Container& container) {
- return AnyOfArray(container.begin(), container.end());
-}
-
-template <typename Container>
-inline internal::AllOfArrayMatcher<typename Container::value_type> AllOfArray(
- const Container& container) {
- return AllOfArray(container.begin(), container.end());
-}
-
-template <typename T>
-inline internal::AnyOfArrayMatcher<T> AnyOfArray(
- ::std::initializer_list<T> xs) {
- return AnyOfArray(xs.begin(), xs.end());
-}
-
-template <typename T>
-inline internal::AllOfArrayMatcher<T> AllOfArray(
- ::std::initializer_list<T> xs) {
- return AllOfArray(xs.begin(), xs.end());
-}
-
-// Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected
-// fields of it matches a_matcher. C++ doesn't support default
-// arguments for function templates, so we have to overload it.
-template <size_t... k, typename InnerMatcher>
-internal::ArgsMatcher<typename std::decay<InnerMatcher>::type, k...> Args(
- InnerMatcher&& matcher) {
- return internal::ArgsMatcher<typename std::decay<InnerMatcher>::type, k...>(
- std::forward<InnerMatcher>(matcher));
-}
-
-// AllArgs(m) is a synonym of m. This is useful in
-//
-// EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq()));
-//
-// which is easier to read than
-//
-// EXPECT_CALL(foo, Bar(_, _)).With(Eq());
-template <typename InnerMatcher>
-inline InnerMatcher AllArgs(const InnerMatcher& matcher) {
- return matcher;
-}
-
-// Returns a matcher that matches the value of an optional<> type variable.
-// The matcher implementation only uses '!arg' and requires that the optional<>
-// type has a 'value_type' member type and that '*arg' is of type 'value_type'
-// and is printable using 'PrintToString'. It is compatible with
-// std::optional/std::experimental::optional.
-// Note that to compare an optional type variable against nullopt you should
-// use Eq(nullopt) and not Eq(Optional(nullopt)). The latter implies that the
-// optional value contains an optional itself.
-template <typename ValueMatcher>
-inline internal::OptionalMatcher<ValueMatcher> Optional(
- const ValueMatcher& value_matcher) {
- return internal::OptionalMatcher<ValueMatcher>(value_matcher);
-}
-
-// Returns a matcher that matches the value of a absl::any type variable.
-template <typename T>
-PolymorphicMatcher<internal::any_cast_matcher::AnyCastMatcher<T>> AnyWith(
- const Matcher<const T&>& matcher) {
- return MakePolymorphicMatcher(
- internal::any_cast_matcher::AnyCastMatcher<T>(matcher));
-}
-
-// Returns a matcher that matches the value of a variant<> type variable.
-// The matcher implementation uses ADL to find the holds_alternative and get
-// functions.
-// It is compatible with std::variant.
-template <typename T>
-PolymorphicMatcher<internal::variant_matcher::VariantMatcher<T>> VariantWith(
- const Matcher<const T&>& matcher) {
- return MakePolymorphicMatcher(
- internal::variant_matcher::VariantMatcher<T>(matcher));
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Anything inside the `internal` namespace is internal to the implementation
-// and must not be used in user code!
-namespace internal {
-
-class WithWhatMatcherImpl {
- public:
- WithWhatMatcherImpl(Matcher<std::string> matcher)
- : matcher_(std::move(matcher)) {}
-
- void DescribeTo(std::ostream* os) const {
- *os << "contains .what() that ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(std::ostream* os) const {
- *os << "contains .what() that does not ";
- matcher_.DescribeTo(os);
- }
-
- template <typename Err>
- bool MatchAndExplain(const Err& err, MatchResultListener* listener) const {
- *listener << "which contains .what() (of value = " << err.what()
- << ") that ";
- return matcher_.MatchAndExplain(err.what(), listener);
- }
-
- private:
- const Matcher<std::string> matcher_;
-};
-
-inline PolymorphicMatcher<WithWhatMatcherImpl> WithWhat(
- Matcher<std::string> m) {
- return MakePolymorphicMatcher(WithWhatMatcherImpl(std::move(m)));
-}
-
-template <typename Err>
-class ExceptionMatcherImpl {
- class NeverThrown {
- public:
- const char* what() const noexcept {
- return "this exception should never be thrown";
- }
- };
-
- // If the matchee raises an exception of a wrong type, we'd like to
- // catch it and print its message and type. To do that, we add an additional
- // catch clause:
- //
- // try { ... }
- // catch (const Err&) { /* an expected exception */ }
- // catch (const std::exception&) { /* exception of a wrong type */ }
- //
- // However, if the `Err` itself is `std::exception`, we'd end up with two
- // identical `catch` clauses:
- //
- // try { ... }
- // catch (const std::exception&) { /* an expected exception */ }
- // catch (const std::exception&) { /* exception of a wrong type */ }
- //
- // This can cause a warning or an error in some compilers. To resolve
- // the issue, we use a fake error type whenever `Err` is `std::exception`:
- //
- // try { ... }
- // catch (const std::exception&) { /* an expected exception */ }
- // catch (const NeverThrown&) { /* exception of a wrong type */ }
- using DefaultExceptionType = typename std::conditional<
- std::is_same<typename std::remove_cv<
- typename std::remove_reference<Err>::type>::type,
- std::exception>::value,
- const NeverThrown&, const std::exception&>::type;
-
- public:
- ExceptionMatcherImpl(Matcher<const Err&> matcher)
- : matcher_(std::move(matcher)) {}
-
- void DescribeTo(std::ostream* os) const {
- *os << "throws an exception which is a " << GetTypeName<Err>();
- *os << " which ";
- matcher_.DescribeTo(os);
- }
-
- void DescribeNegationTo(std::ostream* os) const {
- *os << "throws an exception which is not a " << GetTypeName<Err>();
- *os << " which ";
- matcher_.DescribeNegationTo(os);
- }
-
- template <typename T>
- bool MatchAndExplain(T&& x, MatchResultListener* listener) const {
- try {
- (void)(std::forward<T>(x)());
- } catch (const Err& err) {
- *listener << "throws an exception which is a " << GetTypeName<Err>();
- *listener << " ";
- return matcher_.MatchAndExplain(err, listener);
- } catch (DefaultExceptionType err) {
-#if GTEST_HAS_RTTI
- *listener << "throws an exception of type " << GetTypeName(typeid(err));
- *listener << " ";
-#else
- *listener << "throws an std::exception-derived type ";
-#endif
- *listener << "with description \"" << err.what() << "\"";
- return false;
- } catch (...) {
- *listener << "throws an exception of an unknown type";
- return false;
- }
-
- *listener << "does not throw any exception";
- return false;
- }
-
- private:
- const Matcher<const Err&> matcher_;
-};
-
-} // namespace internal
-
-// Throws()
-// Throws(exceptionMatcher)
-// ThrowsMessage(messageMatcher)
-//
-// This matcher accepts a callable and verifies that when invoked, it throws
-// an exception with the given type and properties.
-//
-// Examples:
-//
-// EXPECT_THAT(
-// []() { throw std::runtime_error("message"); },
-// Throws<std::runtime_error>());
-//
-// EXPECT_THAT(
-// []() { throw std::runtime_error("message"); },
-// ThrowsMessage<std::runtime_error>(HasSubstr("message")));
-//
-// EXPECT_THAT(
-// []() { throw std::runtime_error("message"); },
-// Throws<std::runtime_error>(
-// Property(&std::runtime_error::what, HasSubstr("message"))));
-
-template <typename Err>
-PolymorphicMatcher<internal::ExceptionMatcherImpl<Err>> Throws() {
- return MakePolymorphicMatcher(
- internal::ExceptionMatcherImpl<Err>(A<const Err&>()));
-}
-
-template <typename Err, typename ExceptionMatcher>
-PolymorphicMatcher<internal::ExceptionMatcherImpl<Err>> Throws(
- const ExceptionMatcher& exception_matcher) {
- // Using matcher cast allows users to pass a matcher of a more broad type.
- // For example user may want to pass Matcher<std::exception>
- // to Throws<std::runtime_error>, or Matcher<int64> to Throws<int32>.
- return MakePolymorphicMatcher(internal::ExceptionMatcherImpl<Err>(
- SafeMatcherCast<const Err&>(exception_matcher)));
-}
-
-template <typename Err, typename MessageMatcher>
-PolymorphicMatcher<internal::ExceptionMatcherImpl<Err>> ThrowsMessage(
- MessageMatcher&& message_matcher) {
- static_assert(std::is_base_of<std::exception, Err>::value,
- "expected an std::exception-derived type");
- return Throws<Err>(internal::WithWhat(
- MatcherCast<std::string>(std::forward<MessageMatcher>(message_matcher))));
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// These macros allow using matchers to check values in Google Test
-// tests. ASSERT_THAT(value, matcher) and EXPECT_THAT(value, matcher)
-// succeed if and only if the value matches the matcher. If the assertion
-// fails, the value and the description of the matcher will be printed.
-#define ASSERT_THAT(value, matcher) \
- ASSERT_PRED_FORMAT1( \
- ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
-#define EXPECT_THAT(value, matcher) \
- EXPECT_PRED_FORMAT1( \
- ::testing::internal::MakePredicateFormatterFromMatcher(matcher), value)
-
-// MATCHER* macros itself are listed below.
-#define MATCHER(name, description) \
- class name##Matcher \
- : public ::testing::internal::MatcherBaseImpl<name##Matcher> { \
- public: \
- template <typename arg_type> \
- class gmock_Impl : public ::testing::MatcherInterface<const arg_type&> { \
- public: \
- gmock_Impl() {} \
- bool MatchAndExplain( \
- const arg_type& arg, \
- ::testing::MatchResultListener* result_listener) const override; \
- void DescribeTo(::std::ostream* gmock_os) const override { \
- *gmock_os << FormatDescription(false); \
- } \
- void DescribeNegationTo(::std::ostream* gmock_os) const override { \
- *gmock_os << FormatDescription(true); \
- } \
- \
- private: \
- ::std::string FormatDescription(bool negation) const { \
- /* NOLINTNEXTLINE readability-redundant-string-init */ \
- ::std::string gmock_description = (description); \
- if (!gmock_description.empty()) { \
- return gmock_description; \
- } \
- return ::testing::internal::FormatMatcherDescription(negation, #name, \
- {}, {}); \
- } \
- }; \
- }; \
- GTEST_ATTRIBUTE_UNUSED_ inline name##Matcher name() { return {}; } \
- template <typename arg_type> \
- bool name##Matcher::gmock_Impl<arg_type>::MatchAndExplain( \
- const arg_type& arg, \
- ::testing::MatchResultListener* result_listener GTEST_ATTRIBUTE_UNUSED_) \
- const
-
-#define MATCHER_P(name, p0, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP, description, (#p0), (p0))
-#define MATCHER_P2(name, p0, p1, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP2, description, (#p0, #p1), \
- (p0, p1))
-#define MATCHER_P3(name, p0, p1, p2, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP3, description, (#p0, #p1, #p2), \
- (p0, p1, p2))
-#define MATCHER_P4(name, p0, p1, p2, p3, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP4, description, \
- (#p0, #p1, #p2, #p3), (p0, p1, p2, p3))
-#define MATCHER_P5(name, p0, p1, p2, p3, p4, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP5, description, \
- (#p0, #p1, #p2, #p3, #p4), (p0, p1, p2, p3, p4))
-#define MATCHER_P6(name, p0, p1, p2, p3, p4, p5, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP6, description, \
- (#p0, #p1, #p2, #p3, #p4, #p5), \
- (p0, p1, p2, p3, p4, p5))
-#define MATCHER_P7(name, p0, p1, p2, p3, p4, p5, p6, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP7, description, \
- (#p0, #p1, #p2, #p3, #p4, #p5, #p6), \
- (p0, p1, p2, p3, p4, p5, p6))
-#define MATCHER_P8(name, p0, p1, p2, p3, p4, p5, p6, p7, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP8, description, \
- (#p0, #p1, #p2, #p3, #p4, #p5, #p6, #p7), \
- (p0, p1, p2, p3, p4, p5, p6, p7))
-#define MATCHER_P9(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP9, description, \
- (#p0, #p1, #p2, #p3, #p4, #p5, #p6, #p7, #p8), \
- (p0, p1, p2, p3, p4, p5, p6, p7, p8))
-#define MATCHER_P10(name, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, description) \
- GMOCK_INTERNAL_MATCHER(name, name##MatcherP10, description, \
- (#p0, #p1, #p2, #p3, #p4, #p5, #p6, #p7, #p8, #p9), \
- (p0, p1, p2, p3, p4, p5, p6, p7, p8, p9))
-
-#define GMOCK_INTERNAL_MATCHER(name, full_name, description, arg_names, args) \
- template <GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args)> \
- class full_name : public ::testing::internal::MatcherBaseImpl< \
- full_name<GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)>> { \
- public: \
- using full_name::MatcherBaseImpl::MatcherBaseImpl; \
- template <typename arg_type> \
- class gmock_Impl : public ::testing::MatcherInterface<const arg_type&> { \
- public: \
- explicit gmock_Impl(GMOCK_INTERNAL_MATCHER_FUNCTION_ARGS(args)) \
- : GMOCK_INTERNAL_MATCHER_FORWARD_ARGS(args) {} \
- bool MatchAndExplain( \
- const arg_type& arg, \
- ::testing::MatchResultListener* result_listener) const override; \
- void DescribeTo(::std::ostream* gmock_os) const override { \
- *gmock_os << FormatDescription(false); \
- } \
- void DescribeNegationTo(::std::ostream* gmock_os) const override { \
- *gmock_os << FormatDescription(true); \
- } \
- GMOCK_INTERNAL_MATCHER_MEMBERS(args) \
- \
- private: \
- ::std::string FormatDescription(bool negation) const { \
- ::std::string gmock_description = (description); \
- if (!gmock_description.empty()) { \
- return gmock_description; \
- } \
- return ::testing::internal::FormatMatcherDescription( \
- negation, #name, {GMOCK_PP_REMOVE_PARENS(arg_names)}, \
- ::testing::internal::UniversalTersePrintTupleFieldsToStrings( \
- ::std::tuple<GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)>( \
- GMOCK_INTERNAL_MATCHER_MEMBERS_USAGE(args)))); \
- } \
- }; \
- }; \
- template <GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args)> \
- inline full_name<GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)> name( \
- GMOCK_INTERNAL_MATCHER_FUNCTION_ARGS(args)) { \
- return full_name<GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)>( \
- GMOCK_INTERNAL_MATCHER_ARGS_USAGE(args)); \
- } \
- template <GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args)> \
- template <typename arg_type> \
- bool full_name<GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args)>::gmock_Impl< \
- arg_type>::MatchAndExplain(const arg_type& arg, \
- ::testing::MatchResultListener* \
- result_listener GTEST_ATTRIBUTE_UNUSED_) \
- const
-
-#define GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAMS(args) \
- GMOCK_PP_TAIL( \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAM, , args))
-#define GMOCK_INTERNAL_MATCHER_TEMPLATE_PARAM(i_unused, data_unused, arg) \
- , typename arg##_type
-
-#define GMOCK_INTERNAL_MATCHER_TYPE_PARAMS(args) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_TYPE_PARAM, , args))
-#define GMOCK_INTERNAL_MATCHER_TYPE_PARAM(i_unused, data_unused, arg) \
- , arg##_type
-
-#define GMOCK_INTERNAL_MATCHER_FUNCTION_ARGS(args) \
- GMOCK_PP_TAIL(dummy_first GMOCK_PP_FOR_EACH( \
- GMOCK_INTERNAL_MATCHER_FUNCTION_ARG, , args))
-#define GMOCK_INTERNAL_MATCHER_FUNCTION_ARG(i, data_unused, arg) \
- , arg##_type gmock_p##i
-
-#define GMOCK_INTERNAL_MATCHER_FORWARD_ARGS(args) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_FORWARD_ARG, , args))
-#define GMOCK_INTERNAL_MATCHER_FORWARD_ARG(i, data_unused, arg) \
- , arg(::std::forward<arg##_type>(gmock_p##i))
-
-#define GMOCK_INTERNAL_MATCHER_MEMBERS(args) \
- GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_MEMBER, , args)
-#define GMOCK_INTERNAL_MATCHER_MEMBER(i_unused, data_unused, arg) \
- const arg##_type arg;
-
-#define GMOCK_INTERNAL_MATCHER_MEMBERS_USAGE(args) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_MEMBER_USAGE, , args))
-#define GMOCK_INTERNAL_MATCHER_MEMBER_USAGE(i_unused, data_unused, arg) , arg
-
-#define GMOCK_INTERNAL_MATCHER_ARGS_USAGE(args) \
- GMOCK_PP_TAIL(GMOCK_PP_FOR_EACH(GMOCK_INTERNAL_MATCHER_ARG_USAGE, , args))
-#define GMOCK_INTERNAL_MATCHER_ARG_USAGE(i, data_unused, arg_unused) \
- , gmock_p##i
-
-// To prevent ADL on certain functions we put them on a separate namespace.
-using namespace no_adl; // NOLINT
-
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046
-
-// Include any custom callback matchers added by the local installation.
-// We must include this header at the end to make sure it can use the
-// declarations from this file.
-#include "gmock/internal/custom/gmock-matchers.h"
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MATCHERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-actions.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-actions.h
deleted file mode 100644
index bf85ff51c6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-actions.h
+++ /dev/null
@@ -1,573 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some commonly used variadic actions.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
-
-#include <memory>
-#include <utility>
-
-#include "gmock/gmock-actions.h"
-#include "gmock/internal/gmock-port.h"
-
-// Include any custom callback actions added by the local installation.
-#include "gmock/internal/custom/gmock-generated-actions.h"
-
-// Sometimes you want to give an action explicit template parameters
-// that cannot be inferred from its value parameters. ACTION() and
-// ACTION_P*() don't support that. ACTION_TEMPLATE() remedies that
-// and can be viewed as an extension to ACTION() and ACTION_P*().
-//
-// The syntax:
-//
-// ACTION_TEMPLATE(ActionName,
-// HAS_m_TEMPLATE_PARAMS(kind1, name1, ..., kind_m, name_m),
-// AND_n_VALUE_PARAMS(p1, ..., p_n)) { statements; }
-//
-// defines an action template that takes m explicit template
-// parameters and n value parameters. name_i is the name of the i-th
-// template parameter, and kind_i specifies whether it's a typename,
-// an integral constant, or a template. p_i is the name of the i-th
-// value parameter.
-//
-// Example:
-//
-// // DuplicateArg<k, T>(output) converts the k-th argument of the mock
-// // function to type T and copies it to *output.
-// ACTION_TEMPLATE(DuplicateArg,
-// HAS_2_TEMPLATE_PARAMS(int, k, typename, T),
-// AND_1_VALUE_PARAMS(output)) {
-// *output = T(::std::get<k>(args));
-// }
-// ...
-// int n;
-// EXPECT_CALL(mock, Foo(_, _))
-// .WillOnce(DuplicateArg<1, unsigned char>(&n));
-//
-// To create an instance of an action template, write:
-//
-// ActionName<t1, ..., t_m>(v1, ..., v_n)
-//
-// where the ts are the template arguments and the vs are the value
-// arguments. The value argument types are inferred by the compiler.
-// If you want to explicitly specify the value argument types, you can
-// provide additional template arguments:
-//
-// ActionName<t1, ..., t_m, u1, ..., u_k>(v1, ..., v_n)
-//
-// where u_i is the desired type of v_i.
-//
-// ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded on the
-// number of value parameters, but not on the number of template
-// parameters. Without the restriction, the meaning of the following
-// is unclear:
-//
-// OverloadedAction<int, bool>(x);
-//
-// Are we using a single-template-parameter action where 'bool' refers
-// to the type of x, or are we using a two-template-parameter action
-// where the compiler is asked to infer the type of x?
-//
-// Implementation notes:
-//
-// GMOCK_INTERNAL_*_HAS_m_TEMPLATE_PARAMS and
-// GMOCK_INTERNAL_*_AND_n_VALUE_PARAMS are internal macros for
-// implementing ACTION_TEMPLATE. The main trick we use is to create
-// new macro invocations when expanding a macro. For example, we have
-//
-// #define ACTION_TEMPLATE(name, template_params, value_params)
-// ... GMOCK_INTERNAL_DECL_##template_params ...
-//
-// which causes ACTION_TEMPLATE(..., HAS_1_TEMPLATE_PARAMS(typename, T), ...)
-// to expand to
-//
-// ... GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(typename, T) ...
-//
-// Since GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS is a macro, the
-// preprocessor will continue to expand it to
-//
-// ... typename T ...
-//
-// This technique conforms to the C++ standard and is portable. It
-// allows us to implement action templates using O(N) code, where N is
-// the maximum number of template/value parameters supported. Without
-// using it, we'd have to devote O(N^2) amount of code to implement all
-// combinations of m and n.
-
-// Declares the template parameters.
-#define GMOCK_INTERNAL_DECL_HAS_1_TEMPLATE_PARAMS(kind0, name0) kind0 name0
-#define GMOCK_INTERNAL_DECL_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1) kind0 name0, kind1 name1
-#define GMOCK_INTERNAL_DECL_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2) kind0 name0, kind1 name1, kind2 name2
-#define GMOCK_INTERNAL_DECL_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3) kind0 name0, kind1 name1, kind2 name2, \
- kind3 name3
-#define GMOCK_INTERNAL_DECL_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4) kind0 name0, kind1 name1, \
- kind2 name2, kind3 name3, kind4 name4
-#define GMOCK_INTERNAL_DECL_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5) kind0 name0, \
- kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5
-#define GMOCK_INTERNAL_DECL_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6) kind0 name0, kind1 name1, kind2 name2, kind3 name3, kind4 name4, \
- kind5 name5, kind6 name6
-#define GMOCK_INTERNAL_DECL_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7) kind0 name0, kind1 name1, kind2 name2, kind3 name3, \
- kind4 name4, kind5 name5, kind6 name6, kind7 name7
-#define GMOCK_INTERNAL_DECL_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7, kind8, name8) kind0 name0, kind1 name1, kind2 name2, \
- kind3 name3, kind4 name4, kind5 name5, kind6 name6, kind7 name7, \
- kind8 name8
-#define GMOCK_INTERNAL_DECL_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6, kind7, name7, kind8, name8, kind9, name9) kind0 name0, \
- kind1 name1, kind2 name2, kind3 name3, kind4 name4, kind5 name5, \
- kind6 name6, kind7 name7, kind8 name8, kind9 name9
-
-// Lists the template parameters.
-#define GMOCK_INTERNAL_LIST_HAS_1_TEMPLATE_PARAMS(kind0, name0) name0
-#define GMOCK_INTERNAL_LIST_HAS_2_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1) name0, name1
-#define GMOCK_INTERNAL_LIST_HAS_3_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2) name0, name1, name2
-#define GMOCK_INTERNAL_LIST_HAS_4_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3) name0, name1, name2, name3
-#define GMOCK_INTERNAL_LIST_HAS_5_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4) name0, name1, name2, name3, \
- name4
-#define GMOCK_INTERNAL_LIST_HAS_6_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5) name0, name1, \
- name2, name3, name4, name5
-#define GMOCK_INTERNAL_LIST_HAS_7_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6) name0, name1, name2, name3, name4, name5, name6
-#define GMOCK_INTERNAL_LIST_HAS_8_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7) name0, name1, name2, name3, name4, name5, name6, name7
-#define GMOCK_INTERNAL_LIST_HAS_9_TEMPLATE_PARAMS(kind0, name0, kind1, name1, \
- kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, name6, \
- kind7, name7, kind8, name8) name0, name1, name2, name3, name4, name5, \
- name6, name7, name8
-#define GMOCK_INTERNAL_LIST_HAS_10_TEMPLATE_PARAMS(kind0, name0, kind1, \
- name1, kind2, name2, kind3, name3, kind4, name4, kind5, name5, kind6, \
- name6, kind7, name7, kind8, name8, kind9, name9) name0, name1, name2, \
- name3, name4, name5, name6, name7, name8, name9
-
-// Declares the types of value parameters.
-#define GMOCK_INTERNAL_DECL_TYPE_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DECL_TYPE_AND_1_VALUE_PARAMS(p0) , typename p0##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_2_VALUE_PARAMS(p0, p1) , \
- typename p0##_type, typename p1##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , \
- typename p0##_type, typename p1##_type, typename p2##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
- typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8) , typename p0##_type, typename p1##_type, typename p2##_type, \
- typename p3##_type, typename p4##_type, typename p5##_type, \
- typename p6##_type, typename p7##_type, typename p8##_type
-#define GMOCK_INTERNAL_DECL_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8, p9) , typename p0##_type, typename p1##_type, \
- typename p2##_type, typename p3##_type, typename p4##_type, \
- typename p5##_type, typename p6##_type, typename p7##_type, \
- typename p8##_type, typename p9##_type
-
-// Initializes the value parameters.
-#define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\
- ()
-#define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\
- (p0##_type gmock_p0) : p0(::std::move(gmock_p0))
-#define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\
- (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1))
-#define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\
- (p0##_type gmock_p0, p1##_type gmock_p1, \
- p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2))
-#define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3))
-#define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4))
-#define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, \
- p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
- p5(::std::move(gmock_p5))
-#define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
- p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6))
-#define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
- p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
- p7(::std::move(gmock_p7))
-#define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, \
- p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
- p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
- p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8))
-#define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9)\
- (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \
- p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \
- p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \
- p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \
- p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \
- p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \
- p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \
- p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \
- p9(::std::move(gmock_p9))
-
-// Defines the copy constructor
-#define GMOCK_INTERNAL_DEFN_COPY_AND_0_VALUE_PARAMS() \
- {} // Avoid https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82134
-#define GMOCK_INTERNAL_DEFN_COPY_AND_1_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_2_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_3_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_4_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_5_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_6_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_7_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_8_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_9_VALUE_PARAMS(...) = default;
-#define GMOCK_INTERNAL_DEFN_COPY_AND_10_VALUE_PARAMS(...) = default;
-
-// Declares the fields for storing the value parameters.
-#define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DEFN_AND_1_VALUE_PARAMS(p0) p0##_type p0;
-#define GMOCK_INTERNAL_DEFN_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0; \
- p1##_type p1;
-#define GMOCK_INTERNAL_DEFN_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0; \
- p1##_type p1; p2##_type p2;
-#define GMOCK_INTERNAL_DEFN_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0; \
- p1##_type p1; p2##_type p2; p3##_type p3;
-#define GMOCK_INTERNAL_DEFN_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
- p4) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4;
-#define GMOCK_INTERNAL_DEFN_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
- p5) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5;
-#define GMOCK_INTERNAL_DEFN_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5; p6##_type p6;
-#define GMOCK_INTERNAL_DEFN_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; p4##_type p4; \
- p5##_type p5; p6##_type p6; p7##_type p7;
-#define GMOCK_INTERNAL_DEFN_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
- p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8;
-#define GMOCK_INTERNAL_DEFN_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0##_type p0; p1##_type p1; p2##_type p2; p3##_type p3; \
- p4##_type p4; p5##_type p5; p6##_type p6; p7##_type p7; p8##_type p8; \
- p9##_type p9;
-
-// Lists the value parameters.
-#define GMOCK_INTERNAL_LIST_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_LIST_AND_1_VALUE_PARAMS(p0) p0
-#define GMOCK_INTERNAL_LIST_AND_2_VALUE_PARAMS(p0, p1) p0, p1
-#define GMOCK_INTERNAL_LIST_AND_3_VALUE_PARAMS(p0, p1, p2) p0, p1, p2
-#define GMOCK_INTERNAL_LIST_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0, p1, p2, p3
-#define GMOCK_INTERNAL_LIST_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) p0, p1, \
- p2, p3, p4
-#define GMOCK_INTERNAL_LIST_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) p0, \
- p1, p2, p3, p4, p5
-#define GMOCK_INTERNAL_LIST_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0, p1, p2, p3, p4, p5, p6
-#define GMOCK_INTERNAL_LIST_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0, p1, p2, p3, p4, p5, p6, p7
-#define GMOCK_INTERNAL_LIST_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0, p1, p2, p3, p4, p5, p6, p7, p8
-#define GMOCK_INTERNAL_LIST_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0, p1, p2, p3, p4, p5, p6, p7, p8, p9
-
-// Lists the value parameter types.
-#define GMOCK_INTERNAL_LIST_TYPE_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_LIST_TYPE_AND_1_VALUE_PARAMS(p0) , p0##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_2_VALUE_PARAMS(p0, p1) , p0##_type, \
- p1##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_3_VALUE_PARAMS(p0, p1, p2) , p0##_type, \
- p1##_type, p2##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_4_VALUE_PARAMS(p0, p1, p2, p3) , \
- p0##_type, p1##_type, p2##_type, p3##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) , \
- p0##_type, p1##_type, p2##_type, p3##_type, p4##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) , \
- p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, p5##_type, \
- p6##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, p8##_type
-#define GMOCK_INTERNAL_LIST_TYPE_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6, p7, p8, p9) , p0##_type, p1##_type, p2##_type, p3##_type, p4##_type, \
- p5##_type, p6##_type, p7##_type, p8##_type, p9##_type
-
-// Declares the value parameters.
-#define GMOCK_INTERNAL_DECL_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_DECL_AND_1_VALUE_PARAMS(p0) p0##_type p0
-#define GMOCK_INTERNAL_DECL_AND_2_VALUE_PARAMS(p0, p1) p0##_type p0, \
- p1##_type p1
-#define GMOCK_INTERNAL_DECL_AND_3_VALUE_PARAMS(p0, p1, p2) p0##_type p0, \
- p1##_type p1, p2##_type p2
-#define GMOCK_INTERNAL_DECL_AND_4_VALUE_PARAMS(p0, p1, p2, p3) p0##_type p0, \
- p1##_type p1, p2##_type p2, p3##_type p3
-#define GMOCK_INTERNAL_DECL_AND_5_VALUE_PARAMS(p0, p1, p2, p3, \
- p4) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4
-#define GMOCK_INTERNAL_DECL_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, \
- p5) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5
-#define GMOCK_INTERNAL_DECL_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, \
- p6) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5, p6##_type p6
-#define GMOCK_INTERNAL_DECL_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, p4##_type p4, \
- p5##_type p5, p6##_type p6, p7##_type p7
-#define GMOCK_INTERNAL_DECL_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8
-#define GMOCK_INTERNAL_DECL_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) p0##_type p0, p1##_type p1, p2##_type p2, p3##_type p3, \
- p4##_type p4, p5##_type p5, p6##_type p6, p7##_type p7, p8##_type p8, \
- p9##_type p9
-
-// The suffix of the class template implementing the action template.
-#define GMOCK_INTERNAL_COUNT_AND_0_VALUE_PARAMS()
-#define GMOCK_INTERNAL_COUNT_AND_1_VALUE_PARAMS(p0) P
-#define GMOCK_INTERNAL_COUNT_AND_2_VALUE_PARAMS(p0, p1) P2
-#define GMOCK_INTERNAL_COUNT_AND_3_VALUE_PARAMS(p0, p1, p2) P3
-#define GMOCK_INTERNAL_COUNT_AND_4_VALUE_PARAMS(p0, p1, p2, p3) P4
-#define GMOCK_INTERNAL_COUNT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4) P5
-#define GMOCK_INTERNAL_COUNT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5) P6
-#define GMOCK_INTERNAL_COUNT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6) P7
-#define GMOCK_INTERNAL_COUNT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7) P8
-#define GMOCK_INTERNAL_COUNT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8) P9
-#define GMOCK_INTERNAL_COUNT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \
- p7, p8, p9) P10
-
-// The name of the class template implementing the action template.
-#define GMOCK_ACTION_CLASS_(name, value_params)\
- GTEST_CONCAT_TOKEN_(name##Action, GMOCK_INTERNAL_COUNT_##value_params)
-
-#define ACTION_TEMPLATE(name, template_params, value_params) \
- template <GMOCK_INTERNAL_DECL_##template_params \
- GMOCK_INTERNAL_DECL_TYPE_##value_params> \
- class GMOCK_ACTION_CLASS_(name, value_params) { \
- public: \
- explicit GMOCK_ACTION_CLASS_(name, value_params)( \
- GMOCK_INTERNAL_DECL_##value_params) \
- GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
- = default; , \
- : impl_(std::make_shared<gmock_Impl>( \
- GMOCK_INTERNAL_LIST_##value_params)) { }) \
- GMOCK_ACTION_CLASS_(name, value_params)( \
- const GMOCK_ACTION_CLASS_(name, value_params)&) noexcept \
- GMOCK_INTERNAL_DEFN_COPY_##value_params \
- GMOCK_ACTION_CLASS_(name, value_params)( \
- GMOCK_ACTION_CLASS_(name, value_params)&&) noexcept \
- GMOCK_INTERNAL_DEFN_COPY_##value_params \
- template <typename F> \
- operator ::testing::Action<F>() const { \
- return GMOCK_PP_IF( \
- GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
- (::testing::internal::MakeAction<F, gmock_Impl>()), \
- (::testing::internal::MakeAction<F>(impl_))); \
- } \
- private: \
- class gmock_Impl { \
- public: \
- explicit gmock_Impl GMOCK_INTERNAL_INIT_##value_params {} \
- template <typename function_type, typename return_type, \
- typename args_type, GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type gmock_PerformImpl(GMOCK_ACTION_ARG_TYPES_AND_NAMES_) const; \
- GMOCK_INTERNAL_DEFN_##value_params \
- }; \
- GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(GMOCK_INTERNAL_COUNT_##value_params), \
- , std::shared_ptr<const gmock_Impl> impl_;) \
- }; \
- template <GMOCK_INTERNAL_DECL_##template_params \
- GMOCK_INTERNAL_DECL_TYPE_##value_params> \
- GMOCK_ACTION_CLASS_(name, value_params)< \
- GMOCK_INTERNAL_LIST_##template_params \
- GMOCK_INTERNAL_LIST_TYPE_##value_params> name( \
- GMOCK_INTERNAL_DECL_##value_params) GTEST_MUST_USE_RESULT_; \
- template <GMOCK_INTERNAL_DECL_##template_params \
- GMOCK_INTERNAL_DECL_TYPE_##value_params> \
- inline GMOCK_ACTION_CLASS_(name, value_params)< \
- GMOCK_INTERNAL_LIST_##template_params \
- GMOCK_INTERNAL_LIST_TYPE_##value_params> name( \
- GMOCK_INTERNAL_DECL_##value_params) { \
- return GMOCK_ACTION_CLASS_(name, value_params)< \
- GMOCK_INTERNAL_LIST_##template_params \
- GMOCK_INTERNAL_LIST_TYPE_##value_params>( \
- GMOCK_INTERNAL_LIST_##value_params); \
- } \
- template <GMOCK_INTERNAL_DECL_##template_params \
- GMOCK_INTERNAL_DECL_TYPE_##value_params> \
- template <typename function_type, typename return_type, typename args_type, \
- GMOCK_ACTION_TEMPLATE_ARGS_NAMES_> \
- return_type GMOCK_ACTION_CLASS_(name, value_params)< \
- GMOCK_INTERNAL_LIST_##template_params \
- GMOCK_INTERNAL_LIST_TYPE_##value_params>::gmock_Impl::gmock_PerformImpl( \
- GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_) const
-
-namespace testing {
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-namespace internal {
-
-// internal::InvokeArgument - a helper for InvokeArgument action.
-// The basic overloads are provided here for generic functors.
-// Overloads for other custom-callables are provided in the
-// internal/custom/gmock-generated-actions.h header.
-template <typename F, typename... Args>
-auto InvokeArgument(F f, Args... args) -> decltype(f(args...)) {
- return f(args...);
-}
-
-template <std::size_t index, typename... Params>
-struct InvokeArgumentAction {
- template <typename... Args>
- auto operator()(Args&&... args) const -> decltype(internal::InvokeArgument(
- std::get<index>(std::forward_as_tuple(std::forward<Args>(args)...)),
- std::declval<const Params&>()...)) {
- internal::FlatTuple<Args&&...> args_tuple(FlatTupleConstructTag{},
- std::forward<Args>(args)...);
- return params.Apply([&](const Params&... unpacked_params) {
- auto&& callable = args_tuple.template Get<index>();
- return internal::InvokeArgument(
- std::forward<decltype(callable)>(callable), unpacked_params...);
- });
- }
-
- internal::FlatTuple<Params...> params;
-};
-
-} // namespace internal
-
-// The InvokeArgument<N>(a1, a2, ..., a_k) action invokes the N-th
-// (0-based) argument, which must be a k-ary callable, of the mock
-// function, with arguments a1, a2, ..., a_k.
-//
-// Notes:
-//
-// 1. The arguments are passed by value by default. If you need to
-// pass an argument by reference, wrap it inside std::ref(). For
-// example,
-//
-// InvokeArgument<1>(5, string("Hello"), std::ref(foo))
-//
-// passes 5 and string("Hello") by value, and passes foo by
-// reference.
-//
-// 2. If the callable takes an argument by reference but std::ref() is
-// not used, it will receive the reference to a copy of the value,
-// instead of the original value. For example, when the 0-th
-// argument of the mock function takes a const string&, the action
-//
-// InvokeArgument<0>(string("Hello"))
-//
-// makes a copy of the temporary string("Hello") object and passes a
-// reference of the copy, instead of the original temporary object,
-// to the callable. This makes it easy for a user to define an
-// InvokeArgument action from temporary values and have it performed
-// later.
-template <std::size_t index, typename... Params>
-internal::InvokeArgumentAction<index, typename std::decay<Params>::type...>
-InvokeArgument(Params&&... params) {
- return {internal::FlatTuple<typename std::decay<Params>::type...>(
- internal::FlatTupleConstructTag{}, std::forward<Params>(params)...)};
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace testing
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_ACTIONS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-matchers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-matchers.h
deleted file mode 100644
index 6442d2fa78..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-more-matchers.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements some matchers that depend on gmock-matchers.h.
-//
-// Note that tests are implemented in gmock-matchers_test.cc rather than
-// gmock-more-matchers-test.cc.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_MATCHERS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_MATCHERS_H_
-
-#include "gmock/gmock-matchers.h"
-
-namespace testing {
-
-// Silence C4100 (unreferenced formal
-// parameter) for MSVC
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#if (_MSC_VER == 1900)
-// and silence C4800 (C4800: 'int *const ': forcing value
-// to bool 'true' or 'false') for MSVC 14
-# pragma warning(disable:4800)
- #endif
-#endif
-
-// Defines a matcher that matches an empty container. The container must
-// support both size() and empty(), which all STL-like containers provide.
-MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") {
- if (arg.empty()) {
- return true;
- }
- *result_listener << "whose size is " << arg.size();
- return false;
-}
-
-// Define a matcher that matches a value that evaluates in boolean
-// context to true. Useful for types that define "explicit operator
-// bool" operators and so can't be compared for equality with true
-// and false.
-MATCHER(IsTrue, negation ? "is false" : "is true") {
- return static_cast<bool>(arg);
-}
-
-// Define a matcher that matches a value that evaluates in boolean
-// context to false. Useful for types that define "explicit operator
-// bool" operators and so can't be compared for equality with true
-// and false.
-MATCHER(IsFalse, negation ? "is true" : "is false") {
- return !static_cast<bool>(arg);
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-
-} // namespace testing
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_MORE_MATCHERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-nice-strict.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-nice-strict.h
deleted file mode 100644
index f421deaf43..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-nice-strict.h
+++ /dev/null
@@ -1,261 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Implements class templates NiceMock, NaggyMock, and StrictMock.
-//
-// Given a mock class MockFoo that is created using Google Mock,
-// NiceMock<MockFoo> is a subclass of MockFoo that allows
-// uninteresting calls (i.e. calls to mock methods that have no
-// EXPECT_CALL specs), NaggyMock<MockFoo> is a subclass of MockFoo
-// that prints a warning when an uninteresting call occurs, and
-// StrictMock<MockFoo> is a subclass of MockFoo that treats all
-// uninteresting calls as errors.
-//
-// Currently a mock is naggy by default, so MockFoo and
-// NaggyMock<MockFoo> behave like the same. However, we will soon
-// switch the default behavior of mocks to be nice, as that in general
-// leads to more maintainable tests. When that happens, MockFoo will
-// stop behaving like NaggyMock<MockFoo> and start behaving like
-// NiceMock<MockFoo>.
-//
-// NiceMock, NaggyMock, and StrictMock "inherit" the constructors of
-// their respective base class. Therefore you can write
-// NiceMock<MockFoo>(5, "a") to construct a nice mock where MockFoo
-// has a constructor that accepts (int, const char*), for example.
-//
-// A known limitation is that NiceMock<MockFoo>, NaggyMock<MockFoo>,
-// and StrictMock<MockFoo> only works for mock methods defined using
-// the MOCK_METHOD* family of macros DIRECTLY in the MockFoo class.
-// If a mock method is defined in a base class of MockFoo, the "nice"
-// or "strict" modifier may not affect it, depending on the compiler.
-// In particular, nesting NiceMock, NaggyMock, and StrictMock is NOT
-// supported.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
-
-#include <type_traits>
-
-#include "gmock/gmock-spec-builders.h"
-#include "gmock/internal/gmock-port.h"
-
-namespace testing {
-template <class MockClass>
-class NiceMock;
-template <class MockClass>
-class NaggyMock;
-template <class MockClass>
-class StrictMock;
-
-namespace internal {
-template <typename T>
-std::true_type StrictnessModifierProbe(const NiceMock<T>&);
-template <typename T>
-std::true_type StrictnessModifierProbe(const NaggyMock<T>&);
-template <typename T>
-std::true_type StrictnessModifierProbe(const StrictMock<T>&);
-std::false_type StrictnessModifierProbe(...);
-
-template <typename T>
-constexpr bool HasStrictnessModifier() {
- return decltype(StrictnessModifierProbe(std::declval<const T&>()))::value;
-}
-
-// Base classes that register and deregister with testing::Mock to alter the
-// default behavior around uninteresting calls. Inheriting from one of these
-// classes first and then MockClass ensures the MockClass constructor is run
-// after registration, and that the MockClass destructor runs before
-// deregistration. This guarantees that MockClass's constructor and destructor
-// run with the same level of strictness as its instance methods.
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW && \
- (defined(_MSC_VER) || defined(__clang__))
-// We need to mark these classes with this declspec to ensure that
-// the empty base class optimization is performed.
-#define GTEST_INTERNAL_EMPTY_BASE_CLASS __declspec(empty_bases)
-#else
-#define GTEST_INTERNAL_EMPTY_BASE_CLASS
-#endif
-
-template <typename Base>
-class NiceMockImpl {
- public:
- NiceMockImpl() { ::testing::Mock::AllowUninterestingCalls(this); }
-
- ~NiceMockImpl() { ::testing::Mock::UnregisterCallReaction(this); }
-};
-
-template <typename Base>
-class NaggyMockImpl {
- public:
- NaggyMockImpl() { ::testing::Mock::WarnUninterestingCalls(this); }
-
- ~NaggyMockImpl() { ::testing::Mock::UnregisterCallReaction(this); }
-};
-
-template <typename Base>
-class StrictMockImpl {
- public:
- StrictMockImpl() { ::testing::Mock::FailUninterestingCalls(this); }
-
- ~StrictMockImpl() { ::testing::Mock::UnregisterCallReaction(this); }
-};
-
-} // namespace internal
-
-template <class MockClass>
-class GTEST_INTERNAL_EMPTY_BASE_CLASS NiceMock
- : private internal::NiceMockImpl<MockClass>,
- public MockClass {
- public:
- static_assert(!internal::HasStrictnessModifier<MockClass>(),
- "Can't apply NiceMock to a class hierarchy that already has a "
- "strictness modifier. See "
- "https://google.github.io/googletest/"
- "gmock_cook_book.html#NiceStrictNaggy");
- NiceMock() : MockClass() {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- // Ideally, we would inherit base class's constructors through a using
- // declaration, which would preserve their visibility. However, many existing
- // tests rely on the fact that current implementation reexports protected
- // constructors as public. These tests would need to be cleaned up first.
-
- // Single argument constructor is special-cased so that it can be
- // made explicit.
- template <typename A>
- explicit NiceMock(A&& arg) : MockClass(std::forward<A>(arg)) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- template <typename TArg1, typename TArg2, typename... An>
- NiceMock(TArg1&& arg1, TArg2&& arg2, An&&... args)
- : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
- std::forward<An>(args)...) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NiceMock);
-};
-
-template <class MockClass>
-class GTEST_INTERNAL_EMPTY_BASE_CLASS NaggyMock
- : private internal::NaggyMockImpl<MockClass>,
- public MockClass {
- static_assert(!internal::HasStrictnessModifier<MockClass>(),
- "Can't apply NaggyMock to a class hierarchy that already has a "
- "strictness modifier. See "
- "https://google.github.io/googletest/"
- "gmock_cook_book.html#NiceStrictNaggy");
-
- public:
- NaggyMock() : MockClass() {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- // Ideally, we would inherit base class's constructors through a using
- // declaration, which would preserve their visibility. However, many existing
- // tests rely on the fact that current implementation reexports protected
- // constructors as public. These tests would need to be cleaned up first.
-
- // Single argument constructor is special-cased so that it can be
- // made explicit.
- template <typename A>
- explicit NaggyMock(A&& arg) : MockClass(std::forward<A>(arg)) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- template <typename TArg1, typename TArg2, typename... An>
- NaggyMock(TArg1&& arg1, TArg2&& arg2, An&&... args)
- : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
- std::forward<An>(args)...) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NaggyMock);
-};
-
-template <class MockClass>
-class GTEST_INTERNAL_EMPTY_BASE_CLASS StrictMock
- : private internal::StrictMockImpl<MockClass>,
- public MockClass {
- public:
- static_assert(
- !internal::HasStrictnessModifier<MockClass>(),
- "Can't apply StrictMock to a class hierarchy that already has a "
- "strictness modifier. See "
- "https://google.github.io/googletest/"
- "gmock_cook_book.html#NiceStrictNaggy");
- StrictMock() : MockClass() {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- // Ideally, we would inherit base class's constructors through a using
- // declaration, which would preserve their visibility. However, many existing
- // tests rely on the fact that current implementation reexports protected
- // constructors as public. These tests would need to be cleaned up first.
-
- // Single argument constructor is special-cased so that it can be
- // made explicit.
- template <typename A>
- explicit StrictMock(A&& arg) : MockClass(std::forward<A>(arg)) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- template <typename TArg1, typename TArg2, typename... An>
- StrictMock(TArg1&& arg1, TArg2&& arg2, An&&... args)
- : MockClass(std::forward<TArg1>(arg1), std::forward<TArg2>(arg2),
- std::forward<An>(args)...) {
- static_assert(sizeof(*this) == sizeof(MockClass),
- "The impl subclass shouldn't introduce any padding");
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StrictMock);
-};
-
-#undef GTEST_INTERNAL_EMPTY_BASE_CLASS
-
-} // namespace testing
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_NICE_STRICT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-spec-builders.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-spec-builders.h
deleted file mode 100644
index dfe642dcc3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock-spec-builders.h
+++ /dev/null
@@ -1,2038 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements the ON_CALL() and EXPECT_CALL() macros.
-//
-// A user can use the ON_CALL() macro to specify the default action of
-// a mock method. The syntax is:
-//
-// ON_CALL(mock_object, Method(argument-matchers))
-// .With(multi-argument-matcher)
-// .WillByDefault(action);
-//
-// where the .With() clause is optional.
-//
-// A user can use the EXPECT_CALL() macro to specify an expectation on
-// a mock method. The syntax is:
-//
-// EXPECT_CALL(mock_object, Method(argument-matchers))
-// .With(multi-argument-matchers)
-// .Times(cardinality)
-// .InSequence(sequences)
-// .After(expectations)
-// .WillOnce(action)
-// .WillRepeatedly(action)
-// .RetiresOnSaturation();
-//
-// where all clauses are optional, and .InSequence()/.After()/
-// .WillOnce() can appear any number of times.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
-
-#include <functional>
-#include <map>
-#include <memory>
-#include <set>
-#include <sstream>
-#include <string>
-#include <type_traits>
-#include <utility>
-#include <vector>
-#include "gmock/gmock-actions.h"
-#include "gmock/gmock-cardinalities.h"
-#include "gmock/gmock-matchers.h"
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_EXCEPTIONS
-# include <stdexcept> // NOLINT
-#endif
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-namespace testing {
-
-// An abstract handle of an expectation.
-class Expectation;
-
-// A set of expectation handles.
-class ExpectationSet;
-
-// Anything inside the 'internal' namespace IS INTERNAL IMPLEMENTATION
-// and MUST NOT BE USED IN USER CODE!!!
-namespace internal {
-
-// Implements a mock function.
-template <typename F> class FunctionMocker;
-
-// Base class for expectations.
-class ExpectationBase;
-
-// Implements an expectation.
-template <typename F> class TypedExpectation;
-
-// Helper class for testing the Expectation class template.
-class ExpectationTester;
-
-// Helper classes for implementing NiceMock, StrictMock, and NaggyMock.
-template <typename MockClass>
-class NiceMockImpl;
-template <typename MockClass>
-class StrictMockImpl;
-template <typename MockClass>
-class NaggyMockImpl;
-
-// Protects the mock object registry (in class Mock), all function
-// mockers, and all expectations.
-//
-// The reason we don't use more fine-grained protection is: when a
-// mock function Foo() is called, it needs to consult its expectations
-// to see which one should be picked. If another thread is allowed to
-// call a mock function (either Foo() or a different one) at the same
-// time, it could affect the "retired" attributes of Foo()'s
-// expectations when InSequence() is used, and thus affect which
-// expectation gets picked. Therefore, we sequence all mock function
-// calls to ensure the integrity of the mock objects' states.
-GTEST_API_ GTEST_DECLARE_STATIC_MUTEX_(g_gmock_mutex);
-
-// Untyped base class for ActionResultHolder<R>.
-class UntypedActionResultHolderBase;
-
-// Abstract base class of FunctionMocker. This is the
-// type-agnostic part of the function mocker interface. Its pure
-// virtual methods are implemented by FunctionMocker.
-class GTEST_API_ UntypedFunctionMockerBase {
- public:
- UntypedFunctionMockerBase();
- virtual ~UntypedFunctionMockerBase();
-
- // Verifies that all expectations on this mock function have been
- // satisfied. Reports one or more Google Test non-fatal failures
- // and returns false if not.
- bool VerifyAndClearExpectationsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Clears the ON_CALL()s set on this mock function.
- virtual void ClearDefaultActionsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) = 0;
-
- // In all of the following Untyped* functions, it's the caller's
- // responsibility to guarantee the correctness of the arguments'
- // types.
-
- // Performs the default action with the given arguments and returns
- // the action's result. The call description string will be used in
- // the error message to describe the call in the case the default
- // action fails.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformDefaultAction(
- void* untyped_args, const std::string& call_description) const = 0;
-
- // Performs the given action with the given arguments and returns
- // the action's result.
- // L = *
- virtual UntypedActionResultHolderBase* UntypedPerformAction(
- const void* untyped_action, void* untyped_args) const = 0;
-
- // Writes a message that the call is uninteresting (i.e. neither
- // explicitly expected nor explicitly unexpected) to the given
- // ostream.
- virtual void UntypedDescribeUninterestingCall(
- const void* untyped_args,
- ::std::ostream* os) const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
-
- // Returns the expectation that matches the given function arguments
- // (or NULL is there's no match); when a match is found,
- // untyped_action is set to point to the action that should be
- // performed (or NULL if the action is "do default"), and
- // is_excessive is modified to indicate whether the call exceeds the
- // expected number.
- virtual const ExpectationBase* UntypedFindMatchingExpectation(
- const void* untyped_args,
- const void** untyped_action, bool* is_excessive,
- ::std::ostream* what, ::std::ostream* why)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) = 0;
-
- // Prints the given function arguments to the ostream.
- virtual void UntypedPrintArgs(const void* untyped_args,
- ::std::ostream* os) const = 0;
-
- // Sets the mock object this mock method belongs to, and registers
- // this information in the global mock registry. Will be called
- // whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
- // method.
- void RegisterOwner(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Sets the mock object this mock method belongs to, and sets the
- // name of the mock function. Will be called upon each invocation
- // of this mock function.
- void SetOwnerAndName(const void* mock_obj, const char* name)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the mock object this mock method belongs to. Must be
- // called after RegisterOwner() or SetOwnerAndName() has been
- // called.
- const void* MockObject() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the name of this mock method. Must be called after
- // SetOwnerAndName() has been called.
- const char* Name() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- // Returns the result of invoking this mock function with the given
- // arguments. This function can be safely called from multiple
- // threads concurrently. The caller is responsible for deleting the
- // result.
- UntypedActionResultHolderBase* UntypedInvokeWith(void* untyped_args)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex);
-
- protected:
- typedef std::vector<const void*> UntypedOnCallSpecs;
-
- using UntypedExpectations = std::vector<std::shared_ptr<ExpectationBase>>;
-
- // Returns an Expectation object that references and co-owns exp,
- // which must be an expectation on this mock function.
- Expectation GetHandleOf(ExpectationBase* exp);
-
- // Address of the mock object this mock method belongs to. Only
- // valid after this mock method has been called or
- // ON_CALL/EXPECT_CALL has been invoked on it.
- const void* mock_obj_; // Protected by g_gmock_mutex.
-
- // Name of the function being mocked. Only valid after this mock
- // method has been called.
- const char* name_; // Protected by g_gmock_mutex.
-
- // All default action specs for this function mocker.
- UntypedOnCallSpecs untyped_on_call_specs_;
-
- // All expectations for this function mocker.
- //
- // It's undefined behavior to interleave expectations (EXPECT_CALLs
- // or ON_CALLs) and mock function calls. Also, the order of
- // expectations is important. Therefore it's a logic race condition
- // to read/write untyped_expectations_ concurrently. In order for
- // tools like tsan to catch concurrent read/write accesses to
- // untyped_expectations, we deliberately leave accesses to it
- // unprotected.
- UntypedExpectations untyped_expectations_;
-}; // class UntypedFunctionMockerBase
-
-// Untyped base class for OnCallSpec<F>.
-class UntypedOnCallSpecBase {
- public:
- // The arguments are the location of the ON_CALL() statement.
- UntypedOnCallSpecBase(const char* a_file, int a_line)
- : file_(a_file), line_(a_line), last_clause_(kNone) {}
-
- // Where in the source file was the default action spec defined?
- const char* file() const { return file_; }
- int line() const { return line_; }
-
- protected:
- // Gives each clause in the ON_CALL() statement a name.
- enum Clause {
- // Do not change the order of the enum members! The run-time
- // syntax checking relies on it.
- kNone,
- kWith,
- kWillByDefault
- };
-
- // Asserts that the ON_CALL() statement has a certain property.
- void AssertSpecProperty(bool property,
- const std::string& failure_message) const {
- Assert(property, file_, line_, failure_message);
- }
-
- // Expects that the ON_CALL() statement has a certain property.
- void ExpectSpecProperty(bool property,
- const std::string& failure_message) const {
- Expect(property, file_, line_, failure_message);
- }
-
- const char* file_;
- int line_;
-
- // The last clause in the ON_CALL() statement as seen so far.
- // Initially kNone and changes as the statement is parsed.
- Clause last_clause_;
-}; // class UntypedOnCallSpecBase
-
-// This template class implements an ON_CALL spec.
-template <typename F>
-class OnCallSpec : public UntypedOnCallSpecBase {
- public:
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
-
- // Constructs an OnCallSpec object from the information inside
- // the parenthesis of an ON_CALL() statement.
- OnCallSpec(const char* a_file, int a_line,
- const ArgumentMatcherTuple& matchers)
- : UntypedOnCallSpecBase(a_file, a_line),
- matchers_(matchers),
- // By default, extra_matcher_ should match anything. However,
- // we cannot initialize it with _ as that causes ambiguity between
- // Matcher's copy and move constructor for some argument types.
- extra_matcher_(A<const ArgumentTuple&>()) {}
-
- // Implements the .With() clause.
- OnCallSpec& With(const Matcher<const ArgumentTuple&>& m) {
- // Makes sure this is called at most once.
- ExpectSpecProperty(last_clause_ < kWith,
- ".With() cannot appear "
- "more than once in an ON_CALL().");
- last_clause_ = kWith;
-
- extra_matcher_ = m;
- return *this;
- }
-
- // Implements the .WillByDefault() clause.
- OnCallSpec& WillByDefault(const Action<F>& action) {
- ExpectSpecProperty(last_clause_ < kWillByDefault,
- ".WillByDefault() must appear "
- "exactly once in an ON_CALL().");
- last_clause_ = kWillByDefault;
-
- ExpectSpecProperty(!action.IsDoDefault(),
- "DoDefault() cannot be used in ON_CALL().");
- action_ = action;
- return *this;
- }
-
- // Returns true if and only if the given arguments match the matchers.
- bool Matches(const ArgumentTuple& args) const {
- return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
- }
-
- // Returns the action specified by the user.
- const Action<F>& GetAction() const {
- AssertSpecProperty(last_clause_ == kWillByDefault,
- ".WillByDefault() must appear exactly "
- "once in an ON_CALL().");
- return action_;
- }
-
- private:
- // The information in statement
- //
- // ON_CALL(mock_object, Method(matchers))
- // .With(multi-argument-matcher)
- // .WillByDefault(action);
- //
- // is recorded in the data members like this:
- //
- // source file that contains the statement => file_
- // line number of the statement => line_
- // matchers => matchers_
- // multi-argument-matcher => extra_matcher_
- // action => action_
- ArgumentMatcherTuple matchers_;
- Matcher<const ArgumentTuple&> extra_matcher_;
- Action<F> action_;
-}; // class OnCallSpec
-
-// Possible reactions on uninteresting calls.
-enum CallReaction {
- kAllow,
- kWarn,
- kFail,
-};
-
-} // namespace internal
-
-// Utilities for manipulating mock objects.
-class GTEST_API_ Mock {
- public:
- // The following public methods can be called concurrently.
-
- // Tells Google Mock to ignore mock_obj when checking for leaked
- // mock objects.
- static void AllowLeak(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies and clears all expectations on the given mock object.
- // If the expectations aren't satisfied, generates one or more
- // Google Test non-fatal failures and returns false.
- static bool VerifyAndClearExpectations(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies all expectations on the given mock object and clears its
- // default actions and expectations. Returns true if and only if the
- // verification was successful.
- static bool VerifyAndClear(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Returns whether the mock was created as a naggy mock (default)
- static bool IsNaggy(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
- // Returns whether the mock was created as a nice mock
- static bool IsNice(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
- // Returns whether the mock was created as a strict mock
- static bool IsStrict(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- private:
- friend class internal::UntypedFunctionMockerBase;
-
- // Needed for a function mocker to register itself (so that we know
- // how to clear a mock object).
- template <typename F>
- friend class internal::FunctionMocker;
-
- template <typename MockClass>
- friend class internal::NiceMockImpl;
- template <typename MockClass>
- friend class internal::NaggyMockImpl;
- template <typename MockClass>
- friend class internal::StrictMockImpl;
-
- // Tells Google Mock to allow uninteresting calls on the given mock
- // object.
- static void AllowUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock to warn the user about uninteresting calls on
- // the given mock object.
- static void WarnUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock to fail uninteresting calls on the given mock
- // object.
- static void FailUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock the given mock object is being destroyed and
- // its entry in the call-reaction table should be removed.
- static void UnregisterCallReaction(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Returns the reaction Google Mock will have on uninteresting calls
- // made on the given mock object.
- static internal::CallReaction GetReactionOnUninterestingCalls(
- const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Verifies that all expectations on the given mock object have been
- // satisfied. Reports one or more Google Test non-fatal failures
- // and returns false if not.
- static bool VerifyAndClearExpectationsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
- // Clears all ON_CALL()s set on the given mock object.
- static void ClearDefaultActionsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-
- // Registers a mock object and a mock method it owns.
- static void Register(
- const void* mock_obj,
- internal::UntypedFunctionMockerBase* mocker)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Tells Google Mock where in the source code mock_obj is used in an
- // ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this
- // information helps the user identify which object it is.
- static void RegisterUseByOnCallOrExpectCall(
- const void* mock_obj, const char* file, int line)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex);
-
- // Unregisters a mock method; removes the owning mock object from
- // the registry when the last mock method associated with it has
- // been unregistered. This is called only in the destructor of
- // FunctionMocker.
- static void UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex);
-}; // class Mock
-
-// An abstract handle of an expectation. Useful in the .After()
-// clause of EXPECT_CALL() for setting the (partial) order of
-// expectations. The syntax:
-//
-// Expectation e1 = EXPECT_CALL(...)...;
-// EXPECT_CALL(...).After(e1)...;
-//
-// sets two expectations where the latter can only be matched after
-// the former has been satisfied.
-//
-// Notes:
-// - This class is copyable and has value semantics.
-// - Constness is shallow: a const Expectation object itself cannot
-// be modified, but the mutable methods of the ExpectationBase
-// object it references can be called via expectation_base().
-
-class GTEST_API_ Expectation {
- public:
- // Constructs a null object that doesn't reference any expectation.
- Expectation();
- Expectation(Expectation&&) = default;
- Expectation(const Expectation&) = default;
- Expectation& operator=(Expectation&&) = default;
- Expectation& operator=(const Expectation&) = default;
- ~Expectation();
-
- // This single-argument ctor must not be explicit, in order to support the
- // Expectation e = EXPECT_CALL(...);
- // syntax.
- //
- // A TypedExpectation object stores its pre-requisites as
- // Expectation objects, and needs to call the non-const Retire()
- // method on the ExpectationBase objects they reference. Therefore
- // Expectation must receive a *non-const* reference to the
- // ExpectationBase object.
- Expectation(internal::ExpectationBase& exp); // NOLINT
-
- // The compiler-generated copy ctor and operator= work exactly as
- // intended, so we don't need to define our own.
-
- // Returns true if and only if rhs references the same expectation as this
- // object does.
- bool operator==(const Expectation& rhs) const {
- return expectation_base_ == rhs.expectation_base_;
- }
-
- bool operator!=(const Expectation& rhs) const { return !(*this == rhs); }
-
- private:
- friend class ExpectationSet;
- friend class Sequence;
- friend class ::testing::internal::ExpectationBase;
- friend class ::testing::internal::UntypedFunctionMockerBase;
-
- template <typename F>
- friend class ::testing::internal::FunctionMocker;
-
- template <typename F>
- friend class ::testing::internal::TypedExpectation;
-
- // This comparator is needed for putting Expectation objects into a set.
- class Less {
- public:
- bool operator()(const Expectation& lhs, const Expectation& rhs) const {
- return lhs.expectation_base_.get() < rhs.expectation_base_.get();
- }
- };
-
- typedef ::std::set<Expectation, Less> Set;
-
- Expectation(
- const std::shared_ptr<internal::ExpectationBase>& expectation_base);
-
- // Returns the expectation this object references.
- const std::shared_ptr<internal::ExpectationBase>& expectation_base() const {
- return expectation_base_;
- }
-
- // A shared_ptr that co-owns the expectation this handle references.
- std::shared_ptr<internal::ExpectationBase> expectation_base_;
-};
-
-// A set of expectation handles. Useful in the .After() clause of
-// EXPECT_CALL() for setting the (partial) order of expectations. The
-// syntax:
-//
-// ExpectationSet es;
-// es += EXPECT_CALL(...)...;
-// es += EXPECT_CALL(...)...;
-// EXPECT_CALL(...).After(es)...;
-//
-// sets three expectations where the last one can only be matched
-// after the first two have both been satisfied.
-//
-// This class is copyable and has value semantics.
-class ExpectationSet {
- public:
- // A bidirectional iterator that can read a const element in the set.
- typedef Expectation::Set::const_iterator const_iterator;
-
- // An object stored in the set. This is an alias of Expectation.
- typedef Expectation::Set::value_type value_type;
-
- // Constructs an empty set.
- ExpectationSet() {}
-
- // This single-argument ctor must not be explicit, in order to support the
- // ExpectationSet es = EXPECT_CALL(...);
- // syntax.
- ExpectationSet(internal::ExpectationBase& exp) { // NOLINT
- *this += Expectation(exp);
- }
-
- // This single-argument ctor implements implicit conversion from
- // Expectation and thus must not be explicit. This allows either an
- // Expectation or an ExpectationSet to be used in .After().
- ExpectationSet(const Expectation& e) { // NOLINT
- *this += e;
- }
-
- // The compiler-generator ctor and operator= works exactly as
- // intended, so we don't need to define our own.
-
- // Returns true if and only if rhs contains the same set of Expectation
- // objects as this does.
- bool operator==(const ExpectationSet& rhs) const {
- return expectations_ == rhs.expectations_;
- }
-
- bool operator!=(const ExpectationSet& rhs) const { return !(*this == rhs); }
-
- // Implements the syntax
- // expectation_set += EXPECT_CALL(...);
- ExpectationSet& operator+=(const Expectation& e) {
- expectations_.insert(e);
- return *this;
- }
-
- int size() const { return static_cast<int>(expectations_.size()); }
-
- const_iterator begin() const { return expectations_.begin(); }
- const_iterator end() const { return expectations_.end(); }
-
- private:
- Expectation::Set expectations_;
-};
-
-
-// Sequence objects are used by a user to specify the relative order
-// in which the expectations should match. They are copyable (we rely
-// on the compiler-defined copy constructor and assignment operator).
-class GTEST_API_ Sequence {
- public:
- // Constructs an empty sequence.
- Sequence() : last_expectation_(new Expectation) {}
-
- // Adds an expectation to this sequence. The caller must ensure
- // that no other thread is accessing this Sequence object.
- void AddExpectation(const Expectation& expectation) const;
-
- private:
- // The last expectation in this sequence.
- std::shared_ptr<Expectation> last_expectation_;
-}; // class Sequence
-
-// An object of this type causes all EXPECT_CALL() statements
-// encountered in its scope to be put in an anonymous sequence. The
-// work is done in the constructor and destructor. You should only
-// create an InSequence object on the stack.
-//
-// The sole purpose for this class is to support easy definition of
-// sequential expectations, e.g.
-//
-// {
-// InSequence dummy; // The name of the object doesn't matter.
-//
-// // The following expectations must match in the order they appear.
-// EXPECT_CALL(a, Bar())...;
-// EXPECT_CALL(a, Baz())...;
-// ...
-// EXPECT_CALL(b, Xyz())...;
-// }
-//
-// You can create InSequence objects in multiple threads, as long as
-// they are used to affect different mock objects. The idea is that
-// each thread can create and set up its own mocks as if it's the only
-// thread. However, for clarity of your tests we recommend you to set
-// up mocks in the main thread unless you have a good reason not to do
-// so.
-class GTEST_API_ InSequence {
- public:
- InSequence();
- ~InSequence();
- private:
- bool sequence_created_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InSequence); // NOLINT
-} GTEST_ATTRIBUTE_UNUSED_;
-
-namespace internal {
-
-// Points to the implicit sequence introduced by a living InSequence
-// object (if any) in the current thread or NULL.
-GTEST_API_ extern ThreadLocal<Sequence*> g_gmock_implicit_sequence;
-
-// Base class for implementing expectations.
-//
-// There are two reasons for having a type-agnostic base class for
-// Expectation:
-//
-// 1. We need to store collections of expectations of different
-// types (e.g. all pre-requisites of a particular expectation, all
-// expectations in a sequence). Therefore these expectation objects
-// must share a common base class.
-//
-// 2. We can avoid binary code bloat by moving methods not depending
-// on the template argument of Expectation to the base class.
-//
-// This class is internal and mustn't be used by user code directly.
-class GTEST_API_ ExpectationBase {
- public:
- // source_text is the EXPECT_CALL(...) source that created this Expectation.
- ExpectationBase(const char* file, int line, const std::string& source_text);
-
- virtual ~ExpectationBase();
-
- // Where in the source file was the expectation spec defined?
- const char* file() const { return file_; }
- int line() const { return line_; }
- const char* source_text() const { return source_text_.c_str(); }
- // Returns the cardinality specified in the expectation spec.
- const Cardinality& cardinality() const { return cardinality_; }
-
- // Describes the source file location of this expectation.
- void DescribeLocationTo(::std::ostream* os) const {
- *os << FormatFileLocation(file(), line()) << " ";
- }
-
- // Describes how many times a function call matching this
- // expectation has occurred.
- void DescribeCallCountTo(::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // If this mock method has an extra matcher (i.e. .With(matcher)),
- // describes it to the ostream.
- virtual void MaybeDescribeExtraMatcherTo(::std::ostream* os) = 0;
-
- protected:
- friend class ::testing::Expectation;
- friend class UntypedFunctionMockerBase;
-
- enum Clause {
- // Don't change the order of the enum members!
- kNone,
- kWith,
- kTimes,
- kInSequence,
- kAfter,
- kWillOnce,
- kWillRepeatedly,
- kRetiresOnSaturation
- };
-
- typedef std::vector<const void*> UntypedActions;
-
- // Returns an Expectation object that references and co-owns this
- // expectation.
- virtual Expectation GetHandle() = 0;
-
- // Asserts that the EXPECT_CALL() statement has the given property.
- void AssertSpecProperty(bool property,
- const std::string& failure_message) const {
- Assert(property, file_, line_, failure_message);
- }
-
- // Expects that the EXPECT_CALL() statement has the given property.
- void ExpectSpecProperty(bool property,
- const std::string& failure_message) const {
- Expect(property, file_, line_, failure_message);
- }
-
- // Explicitly specifies the cardinality of this expectation. Used
- // by the subclasses to implement the .Times() clause.
- void SpecifyCardinality(const Cardinality& cardinality);
-
- // Returns true if and only if the user specified the cardinality
- // explicitly using a .Times().
- bool cardinality_specified() const { return cardinality_specified_; }
-
- // Sets the cardinality of this expectation spec.
- void set_cardinality(const Cardinality& a_cardinality) {
- cardinality_ = a_cardinality;
- }
-
- // The following group of methods should only be called after the
- // EXPECT_CALL() statement, and only when g_gmock_mutex is held by
- // the current thread.
-
- // Retires all pre-requisites of this expectation.
- void RetireAllPreRequisites()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Returns true if and only if this expectation is retired.
- bool is_retired() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return retired_;
- }
-
- // Retires this expectation.
- void Retire()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- retired_ = true;
- }
-
- // Returns true if and only if this expectation is satisfied.
- bool IsSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsSatisfiedByCallCount(call_count_);
- }
-
- // Returns true if and only if this expectation is saturated.
- bool IsSaturated() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsSaturatedByCallCount(call_count_);
- }
-
- // Returns true if and only if this expectation is over-saturated.
- bool IsOverSaturated() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return cardinality().IsOverSaturatedByCallCount(call_count_);
- }
-
- // Returns true if and only if all pre-requisites of this expectation are
- // satisfied.
- bool AllPrerequisitesAreSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Adds unsatisfied pre-requisites of this expectation to 'result'.
- void FindUnsatisfiedPrerequisites(ExpectationSet* result) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex);
-
- // Returns the number this expectation has been invoked.
- int call_count() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return call_count_;
- }
-
- // Increments the number this expectation has been invoked.
- void IncrementCallCount()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- call_count_++;
- }
-
- // Checks the action count (i.e. the number of WillOnce() and
- // WillRepeatedly() clauses) against the cardinality if this hasn't
- // been done before. Prints a warning if there are too many or too
- // few actions.
- void CheckActionCountIfNotDone() const
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- friend class ::testing::Sequence;
- friend class ::testing::internal::ExpectationTester;
-
- template <typename Function>
- friend class TypedExpectation;
-
- // Implements the .Times() clause.
- void UntypedTimes(const Cardinality& a_cardinality);
-
- // This group of fields are part of the spec and won't change after
- // an EXPECT_CALL() statement finishes.
- const char* file_; // The file that contains the expectation.
- int line_; // The line number of the expectation.
- const std::string source_text_; // The EXPECT_CALL(...) source text.
- // True if and only if the cardinality is specified explicitly.
- bool cardinality_specified_;
- Cardinality cardinality_; // The cardinality of the expectation.
- // The immediate pre-requisites (i.e. expectations that must be
- // satisfied before this expectation can be matched) of this
- // expectation. We use std::shared_ptr in the set because we want an
- // Expectation object to be co-owned by its FunctionMocker and its
- // successors. This allows multiple mock objects to be deleted at
- // different times.
- ExpectationSet immediate_prerequisites_;
-
- // This group of fields are the current state of the expectation,
- // and can change as the mock function is called.
- int call_count_; // How many times this expectation has been invoked.
- bool retired_; // True if and only if this expectation has retired.
- UntypedActions untyped_actions_;
- bool extra_matcher_specified_;
- bool repeated_action_specified_; // True if a WillRepeatedly() was specified.
- bool retires_on_saturation_;
- Clause last_clause_;
- mutable bool action_count_checked_; // Under mutex_.
- mutable Mutex mutex_; // Protects action_count_checked_.
-}; // class ExpectationBase
-
-// Implements an expectation for the given function type.
-template <typename F>
-class TypedExpectation : public ExpectationBase {
- public:
- typedef typename Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename Function<F>::ArgumentMatcherTuple ArgumentMatcherTuple;
- typedef typename Function<F>::Result Result;
-
- TypedExpectation(FunctionMocker<F>* owner, const char* a_file, int a_line,
- const std::string& a_source_text,
- const ArgumentMatcherTuple& m)
- : ExpectationBase(a_file, a_line, a_source_text),
- owner_(owner),
- matchers_(m),
- // By default, extra_matcher_ should match anything. However,
- // we cannot initialize it with _ as that causes ambiguity between
- // Matcher's copy and move constructor for some argument types.
- extra_matcher_(A<const ArgumentTuple&>()),
- repeated_action_(DoDefault()) {}
-
- ~TypedExpectation() override {
- // Check the validity of the action count if it hasn't been done
- // yet (for example, if the expectation was never used).
- CheckActionCountIfNotDone();
- for (UntypedActions::const_iterator it = untyped_actions_.begin();
- it != untyped_actions_.end(); ++it) {
- delete static_cast<const Action<F>*>(*it);
- }
- }
-
- // Implements the .With() clause.
- TypedExpectation& With(const Matcher<const ArgumentTuple&>& m) {
- if (last_clause_ == kWith) {
- ExpectSpecProperty(false,
- ".With() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(last_clause_ < kWith,
- ".With() must be the first "
- "clause in an EXPECT_CALL().");
- }
- last_clause_ = kWith;
-
- extra_matcher_ = m;
- extra_matcher_specified_ = true;
- return *this;
- }
-
- // Implements the .Times() clause.
- TypedExpectation& Times(const Cardinality& a_cardinality) {
- ExpectationBase::UntypedTimes(a_cardinality);
- return *this;
- }
-
- // Implements the .Times() clause.
- TypedExpectation& Times(int n) {
- return Times(Exactly(n));
- }
-
- // Implements the .InSequence() clause.
- TypedExpectation& InSequence(const Sequence& s) {
- ExpectSpecProperty(last_clause_ <= kInSequence,
- ".InSequence() cannot appear after .After(),"
- " .WillOnce(), .WillRepeatedly(), or "
- ".RetiresOnSaturation().");
- last_clause_ = kInSequence;
-
- s.AddExpectation(GetHandle());
- return *this;
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
- return InSequence(s1).InSequence(s2);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3) {
- return InSequence(s1, s2).InSequence(s3);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3, const Sequence& s4) {
- return InSequence(s1, s2, s3).InSequence(s4);
- }
- TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
- const Sequence& s3, const Sequence& s4,
- const Sequence& s5) {
- return InSequence(s1, s2, s3, s4).InSequence(s5);
- }
-
- // Implements that .After() clause.
- TypedExpectation& After(const ExpectationSet& s) {
- ExpectSpecProperty(last_clause_ <= kAfter,
- ".After() cannot appear after .WillOnce(),"
- " .WillRepeatedly(), or "
- ".RetiresOnSaturation().");
- last_clause_ = kAfter;
-
- for (ExpectationSet::const_iterator it = s.begin(); it != s.end(); ++it) {
- immediate_prerequisites_ += *it;
- }
- return *this;
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2) {
- return After(s1).After(s2);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3) {
- return After(s1, s2).After(s3);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3, const ExpectationSet& s4) {
- return After(s1, s2, s3).After(s4);
- }
- TypedExpectation& After(const ExpectationSet& s1, const ExpectationSet& s2,
- const ExpectationSet& s3, const ExpectationSet& s4,
- const ExpectationSet& s5) {
- return After(s1, s2, s3, s4).After(s5);
- }
-
- // Implements the .WillOnce() clause.
- TypedExpectation& WillOnce(const Action<F>& action) {
- ExpectSpecProperty(last_clause_ <= kWillOnce,
- ".WillOnce() cannot appear after "
- ".WillRepeatedly() or .RetiresOnSaturation().");
- last_clause_ = kWillOnce;
-
- untyped_actions_.push_back(new Action<F>(action));
- if (!cardinality_specified()) {
- set_cardinality(Exactly(static_cast<int>(untyped_actions_.size())));
- }
- return *this;
- }
-
- // Implements the .WillRepeatedly() clause.
- TypedExpectation& WillRepeatedly(const Action<F>& action) {
- if (last_clause_ == kWillRepeatedly) {
- ExpectSpecProperty(false,
- ".WillRepeatedly() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(last_clause_ < kWillRepeatedly,
- ".WillRepeatedly() cannot appear "
- "after .RetiresOnSaturation().");
- }
- last_clause_ = kWillRepeatedly;
- repeated_action_specified_ = true;
-
- repeated_action_ = action;
- if (!cardinality_specified()) {
- set_cardinality(AtLeast(static_cast<int>(untyped_actions_.size())));
- }
-
- // Now that no more action clauses can be specified, we check
- // whether their count makes sense.
- CheckActionCountIfNotDone();
- return *this;
- }
-
- // Implements the .RetiresOnSaturation() clause.
- TypedExpectation& RetiresOnSaturation() {
- ExpectSpecProperty(last_clause_ < kRetiresOnSaturation,
- ".RetiresOnSaturation() cannot appear "
- "more than once.");
- last_clause_ = kRetiresOnSaturation;
- retires_on_saturation_ = true;
-
- // Now that no more action clauses can be specified, we check
- // whether their count makes sense.
- CheckActionCountIfNotDone();
- return *this;
- }
-
- // Returns the matchers for the arguments as specified inside the
- // EXPECT_CALL() macro.
- const ArgumentMatcherTuple& matchers() const {
- return matchers_;
- }
-
- // Returns the matcher specified by the .With() clause.
- const Matcher<const ArgumentTuple&>& extra_matcher() const {
- return extra_matcher_;
- }
-
- // Returns the action specified by the .WillRepeatedly() clause.
- const Action<F>& repeated_action() const { return repeated_action_; }
-
- // If this mock method has an extra matcher (i.e. .With(matcher)),
- // describes it to the ostream.
- void MaybeDescribeExtraMatcherTo(::std::ostream* os) override {
- if (extra_matcher_specified_) {
- *os << " Expected args: ";
- extra_matcher_.DescribeTo(os);
- *os << "\n";
- }
- }
-
- private:
- template <typename Function>
- friend class FunctionMocker;
-
- // Returns an Expectation object that references and co-owns this
- // expectation.
- Expectation GetHandle() override { return owner_->GetHandleOf(this); }
-
- // The following methods will be called only after the EXPECT_CALL()
- // statement finishes and when the current thread holds
- // g_gmock_mutex.
-
- // Returns true if and only if this expectation matches the given arguments.
- bool Matches(const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- return TupleMatches(matchers_, args) && extra_matcher_.Matches(args);
- }
-
- // Returns true if and only if this expectation should handle the given
- // arguments.
- bool ShouldHandleArguments(const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // In case the action count wasn't checked when the expectation
- // was defined (e.g. if this expectation has no WillRepeatedly()
- // or RetiresOnSaturation() clause), we check it when the
- // expectation is used for the first time.
- CheckActionCountIfNotDone();
- return !is_retired() && AllPrerequisitesAreSatisfied() && Matches(args);
- }
-
- // Describes the result of matching the arguments against this
- // expectation to the given ostream.
- void ExplainMatchResultTo(
- const ArgumentTuple& args,
- ::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- if (is_retired()) {
- *os << " Expected: the expectation is active\n"
- << " Actual: it is retired\n";
- } else if (!Matches(args)) {
- if (!TupleMatches(matchers_, args)) {
- ExplainMatchFailureTupleTo(matchers_, args, os);
- }
- StringMatchResultListener listener;
- if (!extra_matcher_.MatchAndExplain(args, &listener)) {
- *os << " Expected args: ";
- extra_matcher_.DescribeTo(os);
- *os << "\n Actual: don't match";
-
- internal::PrintIfNotEmpty(listener.str(), os);
- *os << "\n";
- }
- } else if (!AllPrerequisitesAreSatisfied()) {
- *os << " Expected: all pre-requisites are satisfied\n"
- << " Actual: the following immediate pre-requisites "
- << "are not satisfied:\n";
- ExpectationSet unsatisfied_prereqs;
- FindUnsatisfiedPrerequisites(&unsatisfied_prereqs);
- int i = 0;
- for (ExpectationSet::const_iterator it = unsatisfied_prereqs.begin();
- it != unsatisfied_prereqs.end(); ++it) {
- it->expectation_base()->DescribeLocationTo(os);
- *os << "pre-requisite #" << i++ << "\n";
- }
- *os << " (end of pre-requisites)\n";
- } else {
- // This line is here just for completeness' sake. It will never
- // be executed as currently the ExplainMatchResultTo() function
- // is called only when the mock function call does NOT match the
- // expectation.
- *os << "The call matches the expectation.\n";
- }
- }
-
- // Returns the action that should be taken for the current invocation.
- const Action<F>& GetCurrentAction(const FunctionMocker<F>* mocker,
- const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- const int count = call_count();
- Assert(count >= 1, __FILE__, __LINE__,
- "call_count() is <= 0 when GetCurrentAction() is "
- "called - this should never happen.");
-
- const int action_count = static_cast<int>(untyped_actions_.size());
- if (action_count > 0 && !repeated_action_specified_ &&
- count > action_count) {
- // If there is at least one WillOnce() and no WillRepeatedly(),
- // we warn the user when the WillOnce() clauses ran out.
- ::std::stringstream ss;
- DescribeLocationTo(&ss);
- ss << "Actions ran out in " << source_text() << "...\n"
- << "Called " << count << " times, but only "
- << action_count << " WillOnce()"
- << (action_count == 1 ? " is" : "s are") << " specified - ";
- mocker->DescribeDefaultActionTo(args, &ss);
- Log(kWarning, ss.str(), 1);
- }
-
- return count <= action_count
- ? *static_cast<const Action<F>*>(
- untyped_actions_[static_cast<size_t>(count - 1)])
- : repeated_action();
- }
-
- // Given the arguments of a mock function call, if the call will
- // over-saturate this expectation, returns the default action;
- // otherwise, returns the next action in this expectation. Also
- // describes *what* happened to 'what', and explains *why* Google
- // Mock does it to 'why'. This method is not const as it calls
- // IncrementCallCount(). A return value of NULL means the default
- // action.
- const Action<F>* GetActionForArguments(const FunctionMocker<F>* mocker,
- const ArgumentTuple& args,
- ::std::ostream* what,
- ::std::ostream* why)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- if (IsSaturated()) {
- // We have an excessive call.
- IncrementCallCount();
- *what << "Mock function called more times than expected - ";
- mocker->DescribeDefaultActionTo(args, what);
- DescribeCallCountTo(why);
-
- return nullptr;
- }
-
- IncrementCallCount();
- RetireAllPreRequisites();
-
- if (retires_on_saturation_ && IsSaturated()) {
- Retire();
- }
-
- // Must be done after IncrementCount()!
- *what << "Mock function call matches " << source_text() <<"...\n";
- return &(GetCurrentAction(mocker, args));
- }
-
- // All the fields below won't change once the EXPECT_CALL()
- // statement finishes.
- FunctionMocker<F>* const owner_;
- ArgumentMatcherTuple matchers_;
- Matcher<const ArgumentTuple&> extra_matcher_;
- Action<F> repeated_action_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TypedExpectation);
-}; // class TypedExpectation
-
-// A MockSpec object is used by ON_CALL() or EXPECT_CALL() for
-// specifying the default behavior of, or expectation on, a mock
-// function.
-
-// Note: class MockSpec really belongs to the ::testing namespace.
-// However if we define it in ::testing, MSVC will complain when
-// classes in ::testing::internal declare it as a friend class
-// template. To workaround this compiler bug, we define MockSpec in
-// ::testing::internal and import it into ::testing.
-
-// Logs a message including file and line number information.
-GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
- const char* file, int line,
- const std::string& message);
-
-template <typename F>
-class MockSpec {
- public:
- typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple;
- typedef typename internal::Function<F>::ArgumentMatcherTuple
- ArgumentMatcherTuple;
-
- // Constructs a MockSpec object, given the function mocker object
- // that the spec is associated with.
- MockSpec(internal::FunctionMocker<F>* function_mocker,
- const ArgumentMatcherTuple& matchers)
- : function_mocker_(function_mocker), matchers_(matchers) {}
-
- // Adds a new default action spec to the function mocker and returns
- // the newly created spec.
- internal::OnCallSpec<F>& InternalDefaultActionSetAt(
- const char* file, int line, const char* obj, const char* call) {
- LogWithLocation(internal::kInfo, file, line,
- std::string("ON_CALL(") + obj + ", " + call + ") invoked");
- return function_mocker_->AddNewOnCallSpec(file, line, matchers_);
- }
-
- // Adds a new expectation spec to the function mocker and returns
- // the newly created spec.
- internal::TypedExpectation<F>& InternalExpectedAt(
- const char* file, int line, const char* obj, const char* call) {
- const std::string source_text(std::string("EXPECT_CALL(") + obj + ", " +
- call + ")");
- LogWithLocation(internal::kInfo, file, line, source_text + " invoked");
- return function_mocker_->AddNewExpectation(
- file, line, source_text, matchers_);
- }
-
- // This operator overload is used to swallow the superfluous parameter list
- // introduced by the ON/EXPECT_CALL macros. See the macro comments for more
- // explanation.
- MockSpec<F>& operator()(const internal::WithoutMatchers&, void* const) {
- return *this;
- }
-
- private:
- template <typename Function>
- friend class internal::FunctionMocker;
-
- // The function mocker that owns this spec.
- internal::FunctionMocker<F>* const function_mocker_;
- // The argument matchers specified in the spec.
- ArgumentMatcherTuple matchers_;
-}; // class MockSpec
-
-// Wrapper type for generically holding an ordinary value or lvalue reference.
-// If T is not a reference type, it must be copyable or movable.
-// ReferenceOrValueWrapper<T> is movable, and will also be copyable unless
-// T is a move-only value type (which means that it will always be copyable
-// if the current platform does not support move semantics).
-//
-// The primary template defines handling for values, but function header
-// comments describe the contract for the whole template (including
-// specializations).
-template <typename T>
-class ReferenceOrValueWrapper {
- public:
- // Constructs a wrapper from the given value/reference.
- explicit ReferenceOrValueWrapper(T value)
- : value_(std::move(value)) {
- }
-
- // Unwraps and returns the underlying value/reference, exactly as
- // originally passed. The behavior of calling this more than once on
- // the same object is unspecified.
- T Unwrap() { return std::move(value_); }
-
- // Provides nondestructive access to the underlying value/reference.
- // Always returns a const reference (more precisely,
- // const std::add_lvalue_reference<T>::type). The behavior of calling this
- // after calling Unwrap on the same object is unspecified.
- const T& Peek() const {
- return value_;
- }
-
- private:
- T value_;
-};
-
-// Specialization for lvalue reference types. See primary template
-// for documentation.
-template <typename T>
-class ReferenceOrValueWrapper<T&> {
- public:
- // Workaround for debatable pass-by-reference lint warning (c-library-team
- // policy precludes NOLINT in this context)
- typedef T& reference;
- explicit ReferenceOrValueWrapper(reference ref)
- : value_ptr_(&ref) {}
- T& Unwrap() { return *value_ptr_; }
- const T& Peek() const { return *value_ptr_; }
-
- private:
- T* value_ptr_;
-};
-
-// C++ treats the void type specially. For example, you cannot define
-// a void-typed variable or pass a void value to a function.
-// ActionResultHolder<T> holds a value of type T, where T must be a
-// copyable type or void (T doesn't need to be default-constructable).
-// It hides the syntactic difference between void and other types, and
-// is used to unify the code for invoking both void-returning and
-// non-void-returning mock functions.
-
-// Untyped base class for ActionResultHolder<T>.
-class UntypedActionResultHolderBase {
- public:
- virtual ~UntypedActionResultHolderBase() {}
-
- // Prints the held value as an action's result to os.
- virtual void PrintAsActionResult(::std::ostream* os) const = 0;
-};
-
-// This generic definition is used when T is not void.
-template <typename T>
-class ActionResultHolder : public UntypedActionResultHolderBase {
- public:
- // Returns the held value. Must not be called more than once.
- T Unwrap() {
- return result_.Unwrap();
- }
-
- // Prints the held value as an action's result to os.
- void PrintAsActionResult(::std::ostream* os) const override {
- *os << "\n Returns: ";
- // T may be a reference type, so we don't use UniversalPrint().
- UniversalPrinter<T>::Print(result_.Peek(), os);
- }
-
- // Performs the given mock function's default action and returns the
- // result in a new-ed ActionResultHolder.
- template <typename F>
- static ActionResultHolder* PerformDefaultAction(
- const FunctionMocker<F>* func_mocker,
- typename Function<F>::ArgumentTuple&& args,
- const std::string& call_description) {
- return new ActionResultHolder(Wrapper(func_mocker->PerformDefaultAction(
- std::move(args), call_description)));
- }
-
- // Performs the given action and returns the result in a new-ed
- // ActionResultHolder.
- template <typename F>
- static ActionResultHolder* PerformAction(
- const Action<F>& action, typename Function<F>::ArgumentTuple&& args) {
- return new ActionResultHolder(
- Wrapper(action.Perform(std::move(args))));
- }
-
- private:
- typedef ReferenceOrValueWrapper<T> Wrapper;
-
- explicit ActionResultHolder(Wrapper result)
- : result_(std::move(result)) {
- }
-
- Wrapper result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
-};
-
-// Specialization for T = void.
-template <>
-class ActionResultHolder<void> : public UntypedActionResultHolderBase {
- public:
- void Unwrap() { }
-
- void PrintAsActionResult(::std::ostream* /* os */) const override {}
-
- // Performs the given mock function's default action and returns ownership
- // of an empty ActionResultHolder*.
- template <typename F>
- static ActionResultHolder* PerformDefaultAction(
- const FunctionMocker<F>* func_mocker,
- typename Function<F>::ArgumentTuple&& args,
- const std::string& call_description) {
- func_mocker->PerformDefaultAction(std::move(args), call_description);
- return new ActionResultHolder;
- }
-
- // Performs the given action and returns ownership of an empty
- // ActionResultHolder*.
- template <typename F>
- static ActionResultHolder* PerformAction(
- const Action<F>& action, typename Function<F>::ArgumentTuple&& args) {
- action.Perform(std::move(args));
- return new ActionResultHolder;
- }
-
- private:
- ActionResultHolder() {}
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ActionResultHolder);
-};
-
-template <typename F>
-class FunctionMocker;
-
-template <typename R, typename... Args>
-class FunctionMocker<R(Args...)> final : public UntypedFunctionMockerBase {
- using F = R(Args...);
-
- public:
- using Result = R;
- using ArgumentTuple = std::tuple<Args...>;
- using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>;
-
- FunctionMocker() {}
-
- // There is no generally useful and implementable semantics of
- // copying a mock object, so copying a mock is usually a user error.
- // Thus we disallow copying function mockers. If the user really
- // wants to copy a mock object, they should implement their own copy
- // operation, for example:
- //
- // class MockFoo : public Foo {
- // public:
- // // Defines a copy constructor explicitly.
- // MockFoo(const MockFoo& src) {}
- // ...
- // };
- FunctionMocker(const FunctionMocker&) = delete;
- FunctionMocker& operator=(const FunctionMocker&) = delete;
-
- // The destructor verifies that all expectations on this mock
- // function have been satisfied. If not, it will report Google Test
- // non-fatal failures for the violations.
- ~FunctionMocker() override GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- MutexLock l(&g_gmock_mutex);
- VerifyAndClearExpectationsLocked();
- Mock::UnregisterLocked(this);
- ClearDefaultActionsLocked();
- }
-
- // Returns the ON_CALL spec that matches this mock function with the
- // given arguments; returns NULL if no matching ON_CALL is found.
- // L = *
- const OnCallSpec<F>* FindOnCallSpec(
- const ArgumentTuple& args) const {
- for (UntypedOnCallSpecs::const_reverse_iterator it
- = untyped_on_call_specs_.rbegin();
- it != untyped_on_call_specs_.rend(); ++it) {
- const OnCallSpec<F>* spec = static_cast<const OnCallSpec<F>*>(*it);
- if (spec->Matches(args))
- return spec;
- }
-
- return nullptr;
- }
-
- // Performs the default action of this mock function on the given
- // arguments and returns the result. Asserts (or throws if
- // exceptions are enabled) with a helpful call description if there
- // is no valid return value. This method doesn't depend on the
- // mutable state of this object, and thus can be called concurrently
- // without locking.
- // L = *
- Result PerformDefaultAction(ArgumentTuple&& args,
- const std::string& call_description) const {
- const OnCallSpec<F>* const spec =
- this->FindOnCallSpec(args);
- if (spec != nullptr) {
- return spec->GetAction().Perform(std::move(args));
- }
- const std::string message =
- call_description +
- "\n The mock function has no default action "
- "set, and its return type has no default value set.";
-#if GTEST_HAS_EXCEPTIONS
- if (!DefaultValue<Result>::Exists()) {
- throw std::runtime_error(message);
- }
-#else
- Assert(DefaultValue<Result>::Exists(), "", -1, message);
-#endif
- return DefaultValue<Result>::Get();
- }
-
- // Performs the default action with the given arguments and returns
- // the action's result. The call description string will be used in
- // the error message to describe the call in the case the default
- // action fails. The caller is responsible for deleting the result.
- // L = *
- UntypedActionResultHolderBase* UntypedPerformDefaultAction(
- void* untyped_args, // must point to an ArgumentTuple
- const std::string& call_description) const override {
- ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args);
- return ResultHolder::PerformDefaultAction(this, std::move(*args),
- call_description);
- }
-
- // Performs the given action with the given arguments and returns
- // the action's result. The caller is responsible for deleting the
- // result.
- // L = *
- UntypedActionResultHolderBase* UntypedPerformAction(
- const void* untyped_action, void* untyped_args) const override {
- // Make a copy of the action before performing it, in case the
- // action deletes the mock object (and thus deletes itself).
- const Action<F> action = *static_cast<const Action<F>*>(untyped_action);
- ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args);
- return ResultHolder::PerformAction(action, std::move(*args));
- }
-
- // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked():
- // clears the ON_CALL()s set on this mock function.
- void ClearDefaultActionsLocked() override
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // Deleting our default actions may trigger other mock objects to be
- // deleted, for example if an action contains a reference counted smart
- // pointer to that mock object, and that is the last reference. So if we
- // delete our actions within the context of the global mutex we may deadlock
- // when this method is called again. Instead, make a copy of the set of
- // actions to delete, clear our set within the mutex, and then delete the
- // actions outside of the mutex.
- UntypedOnCallSpecs specs_to_delete;
- untyped_on_call_specs_.swap(specs_to_delete);
-
- g_gmock_mutex.Unlock();
- for (UntypedOnCallSpecs::const_iterator it =
- specs_to_delete.begin();
- it != specs_to_delete.end(); ++it) {
- delete static_cast<const OnCallSpec<F>*>(*it);
- }
-
- // Lock the mutex again, since the caller expects it to be locked when we
- // return.
- g_gmock_mutex.Lock();
- }
-
- // Returns the result of invoking this mock function with the given
- // arguments. This function can be safely called from multiple
- // threads concurrently.
- Result Invoke(Args... args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- ArgumentTuple tuple(std::forward<Args>(args)...);
- std::unique_ptr<ResultHolder> holder(DownCast_<ResultHolder*>(
- this->UntypedInvokeWith(static_cast<void*>(&tuple))));
- return holder->Unwrap();
- }
-
- MockSpec<F> With(Matcher<Args>... m) {
- return MockSpec<F>(this, ::std::make_tuple(std::move(m)...));
- }
-
- protected:
- template <typename Function>
- friend class MockSpec;
-
- typedef ActionResultHolder<Result> ResultHolder;
-
- // Adds and returns a default action spec for this mock function.
- OnCallSpec<F>& AddNewOnCallSpec(
- const char* file, int line,
- const ArgumentMatcherTuple& m)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
- OnCallSpec<F>* const on_call_spec = new OnCallSpec<F>(file, line, m);
- untyped_on_call_specs_.push_back(on_call_spec);
- return *on_call_spec;
- }
-
- // Adds and returns an expectation spec for this mock function.
- TypedExpectation<F>& AddNewExpectation(const char* file, int line,
- const std::string& source_text,
- const ArgumentMatcherTuple& m)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- Mock::RegisterUseByOnCallOrExpectCall(MockObject(), file, line);
- TypedExpectation<F>* const expectation =
- new TypedExpectation<F>(this, file, line, source_text, m);
- const std::shared_ptr<ExpectationBase> untyped_expectation(expectation);
- // See the definition of untyped_expectations_ for why access to
- // it is unprotected here.
- untyped_expectations_.push_back(untyped_expectation);
-
- // Adds this expectation into the implicit sequence if there is one.
- Sequence* const implicit_sequence = g_gmock_implicit_sequence.get();
- if (implicit_sequence != nullptr) {
- implicit_sequence->AddExpectation(Expectation(untyped_expectation));
- }
-
- return *expectation;
- }
-
- private:
- template <typename Func> friend class TypedExpectation;
-
- // Some utilities needed for implementing UntypedInvokeWith().
-
- // Describes what default action will be performed for the given
- // arguments.
- // L = *
- void DescribeDefaultActionTo(const ArgumentTuple& args,
- ::std::ostream* os) const {
- const OnCallSpec<F>* const spec = FindOnCallSpec(args);
-
- if (spec == nullptr) {
- *os << (std::is_void<Result>::value ? "returning directly.\n"
- : "returning default value.\n");
- } else {
- *os << "taking default action specified at:\n"
- << FormatFileLocation(spec->file(), spec->line()) << "\n";
- }
- }
-
- // Writes a message that the call is uninteresting (i.e. neither
- // explicitly expected nor explicitly unexpected) to the given
- // ostream.
- void UntypedDescribeUninterestingCall(const void* untyped_args,
- ::std::ostream* os) const override
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- *os << "Uninteresting mock function call - ";
- DescribeDefaultActionTo(args, os);
- *os << " Function call: " << Name();
- UniversalPrint(args, os);
- }
-
- // Returns the expectation that matches the given function arguments
- // (or NULL is there's no match); when a match is found,
- // untyped_action is set to point to the action that should be
- // performed (or NULL if the action is "do default"), and
- // is_excessive is modified to indicate whether the call exceeds the
- // expected number.
- //
- // Critical section: We must find the matching expectation and the
- // corresponding action that needs to be taken in an ATOMIC
- // transaction. Otherwise another thread may call this mock
- // method in the middle and mess up the state.
- //
- // However, performing the action has to be left out of the critical
- // section. The reason is that we have no control on what the
- // action does (it can invoke an arbitrary user function or even a
- // mock function) and excessive locking could cause a dead lock.
- const ExpectationBase* UntypedFindMatchingExpectation(
- const void* untyped_args, const void** untyped_action, bool* is_excessive,
- ::std::ostream* what, ::std::ostream* why) override
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- MutexLock l(&g_gmock_mutex);
- TypedExpectation<F>* exp = this->FindMatchingExpectationLocked(args);
- if (exp == nullptr) { // A match wasn't found.
- this->FormatUnexpectedCallMessageLocked(args, what, why);
- return nullptr;
- }
-
- // This line must be done before calling GetActionForArguments(),
- // which will increment the call count for *exp and thus affect
- // its saturation status.
- *is_excessive = exp->IsSaturated();
- const Action<F>* action = exp->GetActionForArguments(this, args, what, why);
- if (action != nullptr && action->IsDoDefault())
- action = nullptr; // Normalize "do default" to NULL.
- *untyped_action = action;
- return exp;
- }
-
- // Prints the given function arguments to the ostream.
- void UntypedPrintArgs(const void* untyped_args,
- ::std::ostream* os) const override {
- const ArgumentTuple& args =
- *static_cast<const ArgumentTuple*>(untyped_args);
- UniversalPrint(args, os);
- }
-
- // Returns the expectation that matches the arguments, or NULL if no
- // expectation matches them.
- TypedExpectation<F>* FindMatchingExpectationLocked(
- const ArgumentTuple& args) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- // See the definition of untyped_expectations_ for why access to
- // it is unprotected here.
- for (typename UntypedExpectations::const_reverse_iterator it =
- untyped_expectations_.rbegin();
- it != untyped_expectations_.rend(); ++it) {
- TypedExpectation<F>* const exp =
- static_cast<TypedExpectation<F>*>(it->get());
- if (exp->ShouldHandleArguments(args)) {
- return exp;
- }
- }
- return nullptr;
- }
-
- // Returns a message that the arguments don't match any expectation.
- void FormatUnexpectedCallMessageLocked(
- const ArgumentTuple& args,
- ::std::ostream* os,
- ::std::ostream* why) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- *os << "\nUnexpected mock function call - ";
- DescribeDefaultActionTo(args, os);
- PrintTriedExpectationsLocked(args, why);
- }
-
- // Prints a list of expectations that have been tried against the
- // current mock function call.
- void PrintTriedExpectationsLocked(
- const ArgumentTuple& args,
- ::std::ostream* why) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- const size_t count = untyped_expectations_.size();
- *why << "Google Mock tried the following " << count << " "
- << (count == 1 ? "expectation, but it didn't match" :
- "expectations, but none matched")
- << ":\n";
- for (size_t i = 0; i < count; i++) {
- TypedExpectation<F>* const expectation =
- static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get());
- *why << "\n";
- expectation->DescribeLocationTo(why);
- if (count > 1) {
- *why << "tried expectation #" << i << ": ";
- }
- *why << expectation->source_text() << "...\n";
- expectation->ExplainMatchResultTo(args, why);
- expectation->DescribeCallCountTo(why);
- }
- }
-}; // class FunctionMocker
-
-// Reports an uninteresting call (whose description is in msg) in the
-// manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const std::string& msg);
-
-} // namespace internal
-
-namespace internal {
-
-template <typename F>
-class MockFunction;
-
-template <typename R, typename... Args>
-class MockFunction<R(Args...)> {
- public:
- MockFunction(const MockFunction&) = delete;
- MockFunction& operator=(const MockFunction&) = delete;
-
- std::function<R(Args...)> AsStdFunction() {
- return [this](Args... args) -> R {
- return this->Call(std::forward<Args>(args)...);
- };
- }
-
- // Implementation detail: the expansion of the MOCK_METHOD macro.
- R Call(Args... args) {
- mock_.SetOwnerAndName(this, "Call");
- return mock_.Invoke(std::forward<Args>(args)...);
- }
-
- MockSpec<R(Args...)> gmock_Call(Matcher<Args>... m) {
- mock_.RegisterOwner(this);
- return mock_.With(std::move(m)...);
- }
-
- MockSpec<R(Args...)> gmock_Call(const WithoutMatchers&, R (*)(Args...)) {
- return this->gmock_Call(::testing::A<Args>()...);
- }
-
- protected:
- MockFunction() = default;
- ~MockFunction() = default;
-
- private:
- FunctionMocker<R(Args...)> mock_;
-};
-
-/*
-The SignatureOf<F> struct is a meta-function returning function signature
-corresponding to the provided F argument.
-
-It makes use of MockFunction easier by allowing it to accept more F arguments
-than just function signatures.
-
-Specializations provided here cover a signature type itself and any template
-that can be parameterized with a signature, including std::function and
-boost::function.
-*/
-
-template <typename F, typename = void>
-struct SignatureOf;
-
-template <typename R, typename... Args>
-struct SignatureOf<R(Args...)> {
- using type = R(Args...);
-};
-
-template <template <typename> class C, typename F>
-struct SignatureOf<C<F>,
- typename std::enable_if<std::is_function<F>::value>::type>
- : SignatureOf<F> {};
-
-template <typename F>
-using SignatureOfT = typename SignatureOf<F>::type;
-
-} // namespace internal
-
-// A MockFunction<F> type has one mock method whose type is
-// internal::SignatureOfT<F>. It is useful when you just want your
-// test code to emit some messages and have Google Mock verify the
-// right messages are sent (and perhaps at the right times). For
-// example, if you are exercising code:
-//
-// Foo(1);
-// Foo(2);
-// Foo(3);
-//
-// and want to verify that Foo(1) and Foo(3) both invoke
-// mock.Bar("a"), but Foo(2) doesn't invoke anything, you can write:
-//
-// TEST(FooTest, InvokesBarCorrectly) {
-// MyMock mock;
-// MockFunction<void(string check_point_name)> check;
-// {
-// InSequence s;
-//
-// EXPECT_CALL(mock, Bar("a"));
-// EXPECT_CALL(check, Call("1"));
-// EXPECT_CALL(check, Call("2"));
-// EXPECT_CALL(mock, Bar("a"));
-// }
-// Foo(1);
-// check.Call("1");
-// Foo(2);
-// check.Call("2");
-// Foo(3);
-// }
-//
-// The expectation spec says that the first Bar("a") must happen
-// before check point "1", the second Bar("a") must happen after check
-// point "2", and nothing should happen between the two check
-// points. The explicit check points make it easy to tell which
-// Bar("a") is called by which call to Foo().
-//
-// MockFunction<F> can also be used to exercise code that accepts
-// std::function<internal::SignatureOfT<F>> callbacks. To do so, use
-// AsStdFunction() method to create std::function proxy forwarding to
-// original object's Call. Example:
-//
-// TEST(FooTest, RunsCallbackWithBarArgument) {
-// MockFunction<int(string)> callback;
-// EXPECT_CALL(callback, Call("bar")).WillOnce(Return(1));
-// Foo(callback.AsStdFunction());
-// }
-//
-// The internal::SignatureOfT<F> indirection allows to use other types
-// than just function signature type. This is typically useful when
-// providing a mock for a predefined std::function type. Example:
-//
-// using FilterPredicate = std::function<bool(string)>;
-// void MyFilterAlgorithm(FilterPredicate predicate);
-//
-// TEST(FooTest, FilterPredicateAlwaysAccepts) {
-// MockFunction<FilterPredicate> predicateMock;
-// EXPECT_CALL(predicateMock, Call(_)).WillRepeatedly(Return(true));
-// MyFilterAlgorithm(predicateMock.AsStdFunction());
-// }
-template <typename F>
-class MockFunction : public internal::MockFunction<internal::SignatureOfT<F>> {
- using Base = internal::MockFunction<internal::SignatureOfT<F>>;
-
- public:
- using Base::Base;
-};
-
-// The style guide prohibits "using" statements in a namespace scope
-// inside a header file. However, the MockSpec class template is
-// meant to be defined in the ::testing namespace. The following line
-// is just a trick for working around a bug in MSVC 8.0, which cannot
-// handle it if we define MockSpec in ::testing.
-using internal::MockSpec;
-
-// Const(x) is a convenient function for obtaining a const reference
-// to x. This is useful for setting expectations on an overloaded
-// const mock method, e.g.
-//
-// class MockFoo : public FooInterface {
-// public:
-// MOCK_METHOD0(Bar, int());
-// MOCK_CONST_METHOD0(Bar, int&());
-// };
-//
-// MockFoo foo;
-// // Expects a call to non-const MockFoo::Bar().
-// EXPECT_CALL(foo, Bar());
-// // Expects a call to const MockFoo::Bar().
-// EXPECT_CALL(Const(foo), Bar());
-template <typename T>
-inline const T& Const(const T& x) { return x; }
-
-// Constructs an Expectation object that references and co-owns exp.
-inline Expectation::Expectation(internal::ExpectationBase& exp) // NOLINT
- : expectation_base_(exp.GetHandle().expectation_base()) {}
-
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-// Implementation for ON_CALL and EXPECT_CALL macros. A separate macro is
-// required to avoid compile errors when the name of the method used in call is
-// a result of macro expansion. See CompilesWithMethodNameExpandedFromMacro
-// tests in internal/gmock-spec-builders_test.cc for more details.
-//
-// This macro supports statements both with and without parameter matchers. If
-// the parameter list is omitted, gMock will accept any parameters, which allows
-// tests to be written that don't need to encode the number of method
-// parameter. This technique may only be used for non-overloaded methods.
-//
-// // These are the same:
-// ON_CALL(mock, NoArgsMethod()).WillByDefault(...);
-// ON_CALL(mock, NoArgsMethod).WillByDefault(...);
-//
-// // As are these:
-// ON_CALL(mock, TwoArgsMethod(_, _)).WillByDefault(...);
-// ON_CALL(mock, TwoArgsMethod).WillByDefault(...);
-//
-// // Can also specify args if you want, of course:
-// ON_CALL(mock, TwoArgsMethod(_, 45)).WillByDefault(...);
-//
-// // Overloads work as long as you specify parameters:
-// ON_CALL(mock, OverloadedMethod(_)).WillByDefault(...);
-// ON_CALL(mock, OverloadedMethod(_, _)).WillByDefault(...);
-//
-// // Oops! Which overload did you want?
-// ON_CALL(mock, OverloadedMethod).WillByDefault(...);
-// => ERROR: call to member function 'gmock_OverloadedMethod' is ambiguous
-//
-// How this works: The mock class uses two overloads of the gmock_Method
-// expectation setter method plus an operator() overload on the MockSpec object.
-// In the matcher list form, the macro expands to:
-//
-// // This statement:
-// ON_CALL(mock, TwoArgsMethod(_, 45))...
-//
-// // ...expands to:
-// mock.gmock_TwoArgsMethod(_, 45)(WithoutMatchers(), nullptr)...
-// |-------------v---------------||------------v-------------|
-// invokes first overload swallowed by operator()
-//
-// // ...which is essentially:
-// mock.gmock_TwoArgsMethod(_, 45)...
-//
-// Whereas the form without a matcher list:
-//
-// // This statement:
-// ON_CALL(mock, TwoArgsMethod)...
-//
-// // ...expands to:
-// mock.gmock_TwoArgsMethod(WithoutMatchers(), nullptr)...
-// |-----------------------v--------------------------|
-// invokes second overload
-//
-// // ...which is essentially:
-// mock.gmock_TwoArgsMethod(_, _)...
-//
-// The WithoutMatchers() argument is used to disambiguate overloads and to
-// block the caller from accidentally invoking the second overload directly. The
-// second argument is an internal type derived from the method signature. The
-// failure to disambiguate two overloads of this method in the ON_CALL statement
-// is how we block callers from setting expectations on overloaded methods.
-#define GMOCK_ON_CALL_IMPL_(mock_expr, Setter, call) \
- ((mock_expr).gmock_##call)(::testing::internal::GetWithoutMatchers(), \
- nullptr) \
- .Setter(__FILE__, __LINE__, #mock_expr, #call)
-
-#define ON_CALL(obj, call) \
- GMOCK_ON_CALL_IMPL_(obj, InternalDefaultActionSetAt, call)
-
-#define EXPECT_CALL(obj, call) \
- GMOCK_ON_CALL_IMPL_(obj, InternalExpectedAt, call)
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_SPEC_BUILDERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock.h
deleted file mode 100644
index 568c8c71d7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/gmock.h
+++ /dev/null
@@ -1,96 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This is the main header file a user should include.
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_H_
-
-// This file implements the following syntax:
-//
-// ON_CALL(mock_object, Method(...))
-// .With(...) ?
-// .WillByDefault(...);
-//
-// where With() is optional and WillByDefault() must appear exactly
-// once.
-//
-// EXPECT_CALL(mock_object, Method(...))
-// .With(...) ?
-// .Times(...) ?
-// .InSequence(...) *
-// .WillOnce(...) *
-// .WillRepeatedly(...) ?
-// .RetiresOnSaturation() ? ;
-//
-// where all clauses are optional and WillOnce() can be repeated.
-
-#include "gmock/gmock-actions.h"
-#include "gmock/gmock-cardinalities.h"
-#include "gmock/gmock-function-mocker.h"
-#include "gmock/gmock-matchers.h"
-#include "gmock/gmock-more-actions.h"
-#include "gmock/gmock-more-matchers.h"
-#include "gmock/gmock-nice-strict.h"
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gmock/internal/gmock-port.h"
-
-// Declares Google Mock flags that we want a user to use programmatically.
-GMOCK_DECLARE_bool_(catch_leaked_mocks);
-GMOCK_DECLARE_string_(verbose);
-GMOCK_DECLARE_int32_(default_mock_behavior);
-
-namespace testing {
-
-// Initializes Google Mock. This must be called before running the
-// tests. In particular, it parses the command line for the flags
-// that Google Mock recognizes. Whenever a Google Mock flag is seen,
-// it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Mock flag variables are
-// updated.
-//
-// Since Google Test is needed for Google Mock to work, this function
-// also initializes Google Test and parses its flags, if that hasn't
-// been done.
-GTEST_API_ void InitGoogleMock(int* argc, char** argv);
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv);
-
-// This overloaded version can be used on Arduino/embedded platforms where
-// there is no argc/argv.
-GTEST_API_ void InitGoogleMock();
-
-} // namespace testing
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_GMOCK_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/README.md
deleted file mode 100644
index 9c4874fd0c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/README.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Customization Points
-
-The custom directory is an injection point for custom user configurations.
-
-## Header `gmock-port.h`
-
-The following macros can be defined:
-
-### Flag related macros:
-
-* `GMOCK_DECLARE_bool_(name)`
-* `GMOCK_DECLARE_int32_(name)`
-* `GMOCK_DECLARE_string_(name)`
-* `GMOCK_DEFINE_bool_(name, default_val, doc)`
-* `GMOCK_DEFINE_int32_(name, default_val, doc)`
-* `GMOCK_DEFINE_string_(name, default_val, doc)`
-* `GMOCK_FLAG_GET(flag_name)`
-* `GMOCK_FLAG_SET(flag_name, value)`
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-generated-actions.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
deleted file mode 100644
index bbcad31c76..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-generated-actions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_GENERATED_ACTIONS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-matchers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-matchers.h
deleted file mode 100644
index bb7dcbaa4c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-matchers.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Injection point for custom user configurations. See README for details
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_MATCHERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-port.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-port.h
deleted file mode 100644
index f055f7506b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/custom/gmock-port.h
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Injection point for custom user configurations. See README for details
-//
-// ** Custom implementation starts here **
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_CUSTOM_GMOCK_PORT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-internal-utils.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-internal-utils.h
deleted file mode 100644
index d9d812a368..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-internal-utils.h
+++ /dev/null
@@ -1,472 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file defines some utilities useful for implementing Google
-// Mock. They are subject to change without notice, so please DO NOT
-// USE THEM IN USER CODE.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
-
-#include <stdio.h>
-
-#include <ostream> // NOLINT
-#include <string>
-#include <type_traits>
-#include <vector>
-
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-template <typename>
-class Matcher;
-
-namespace internal {
-
-// Silence MSVC C4100 (unreferenced formal parameter) and
-// C4805('==': unsafe mix of type 'const int' and type 'const bool')
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-# pragma warning(disable:4805)
-#endif
-
-// Joins a vector of strings as if they are fields of a tuple; returns
-// the joined string.
-GTEST_API_ std::string JoinAsKeyValueTuple(
- const std::vector<const char*>& names, const Strings& values);
-
-// Converts an identifier name to a space-separated list of lower-case
-// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
-// treated as one word. For example, both "FooBar123" and
-// "foo_bar_123" are converted to "foo bar 123".
-GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name);
-
-// GetRawPointer(p) returns the raw pointer underlying p when p is a
-// smart pointer, or returns p itself when p is already a raw pointer.
-// The following default implementation is for the smart pointer case.
-template <typename Pointer>
-inline const typename Pointer::element_type* GetRawPointer(const Pointer& p) {
- return p.get();
-}
-// This overload version is for std::reference_wrapper, which does not work with
-// the overload above, as it does not have an `element_type`.
-template <typename Element>
-inline const Element* GetRawPointer(const std::reference_wrapper<Element>& r) {
- return &r.get();
-}
-
-// This overloaded version is for the raw pointer case.
-template <typename Element>
-inline Element* GetRawPointer(Element* p) { return p; }
-
-// MSVC treats wchar_t as a native type usually, but treats it as the
-// same as unsigned short when the compiler option /Zc:wchar_t- is
-// specified. It defines _NATIVE_WCHAR_T_DEFINED symbol when wchar_t
-// is a native type.
-#if defined(_MSC_VER) && !defined(_NATIVE_WCHAR_T_DEFINED)
-// wchar_t is a typedef.
-#else
-# define GMOCK_WCHAR_T_IS_NATIVE_ 1
-#endif
-
-// In what follows, we use the term "kind" to indicate whether a type
-// is bool, an integer type (excluding bool), a floating-point type,
-// or none of them. This categorization is useful for determining
-// when a matcher argument type can be safely converted to another
-// type in the implementation of SafeMatcherCast.
-enum TypeKind {
- kBool, kInteger, kFloatingPoint, kOther
-};
-
-// KindOf<T>::value is the kind of type T.
-template <typename T> struct KindOf {
- enum { value = kOther }; // The default kind.
-};
-
-// This macro declares that the kind of 'type' is 'kind'.
-#define GMOCK_DECLARE_KIND_(type, kind) \
- template <> struct KindOf<type> { enum { value = kind }; }
-
-GMOCK_DECLARE_KIND_(bool, kBool);
-
-// All standard integer types.
-GMOCK_DECLARE_KIND_(char, kInteger);
-GMOCK_DECLARE_KIND_(signed char, kInteger);
-GMOCK_DECLARE_KIND_(unsigned char, kInteger);
-GMOCK_DECLARE_KIND_(short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned short, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(int, kInteger);
-GMOCK_DECLARE_KIND_(unsigned int, kInteger);
-GMOCK_DECLARE_KIND_(long, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned long, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(long long, kInteger); // NOLINT
-GMOCK_DECLARE_KIND_(unsigned long long, kInteger); // NOLINT
-
-#if GMOCK_WCHAR_T_IS_NATIVE_
-GMOCK_DECLARE_KIND_(wchar_t, kInteger);
-#endif
-
-// All standard floating-point types.
-GMOCK_DECLARE_KIND_(float, kFloatingPoint);
-GMOCK_DECLARE_KIND_(double, kFloatingPoint);
-GMOCK_DECLARE_KIND_(long double, kFloatingPoint);
-
-#undef GMOCK_DECLARE_KIND_
-
-// Evaluates to the kind of 'type'.
-#define GMOCK_KIND_OF_(type) \
- static_cast< ::testing::internal::TypeKind>( \
- ::testing::internal::KindOf<type>::value)
-
-// LosslessArithmeticConvertibleImpl<kFromKind, From, kToKind, To>::value
-// is true if and only if arithmetic type From can be losslessly converted to
-// arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types, kFromKind is the kind of
-// From, and kToKind is the kind of To; the value is
-// implementation-defined when the above pre-condition is violated.
-template <TypeKind kFromKind, typename From, TypeKind kToKind, typename To>
-using LosslessArithmeticConvertibleImpl = std::integral_constant<
- bool,
- // clang-format off
- // Converting from bool is always lossless
- (kFromKind == kBool) ? true
- // Converting between any other type kinds will be lossy if the type
- // kinds are not the same.
- : (kFromKind != kToKind) ? false
- : (kFromKind == kInteger &&
- // Converting between integers of different widths is allowed so long
- // as the conversion does not go from signed to unsigned.
- (((sizeof(From) < sizeof(To)) &&
- !(std::is_signed<From>::value && !std::is_signed<To>::value)) ||
- // Converting between integers of the same width only requires the
- // two types to have the same signedness.
- ((sizeof(From) == sizeof(To)) &&
- (std::is_signed<From>::value == std::is_signed<To>::value)))
- ) ? true
- // Floating point conversions are lossless if and only if `To` is at least
- // as wide as `From`.
- : (kFromKind == kFloatingPoint && (sizeof(From) <= sizeof(To))) ? true
- : false
- // clang-format on
- >;
-
-// LosslessArithmeticConvertible<From, To>::value is true if and only if
-// arithmetic type From can be losslessly converted to arithmetic type To.
-//
-// It's the user's responsibility to ensure that both From and To are
-// raw (i.e. has no CV modifier, is not a pointer, and is not a
-// reference) built-in arithmetic types; the value is
-// implementation-defined when the above pre-condition is violated.
-template <typename From, typename To>
-using LosslessArithmeticConvertible =
- LosslessArithmeticConvertibleImpl<GMOCK_KIND_OF_(From), From,
- GMOCK_KIND_OF_(To), To>;
-
-// This interface knows how to report a Google Mock failure (either
-// non-fatal or fatal).
-class FailureReporterInterface {
- public:
- // The type of a failure (either non-fatal or fatal).
- enum FailureType {
- kNonfatal, kFatal
- };
-
- virtual ~FailureReporterInterface() {}
-
- // Reports a failure that occurred at the given source file location.
- virtual void ReportFailure(FailureType type, const char* file, int line,
- const std::string& message) = 0;
-};
-
-// Returns the failure reporter used by Google Mock.
-GTEST_API_ FailureReporterInterface* GetFailureReporter();
-
-// Asserts that condition is true; aborts the process with the given
-// message if condition is false. We cannot use LOG(FATAL) or CHECK()
-// as Google Mock might be used to mock the log sink itself. We
-// inline this function to prevent it from showing up in the stack
-// trace.
-inline void Assert(bool condition, const char* file, int line,
- const std::string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kFatal,
- file, line, msg);
- }
-}
-inline void Assert(bool condition, const char* file, int line) {
- Assert(condition, file, line, "Assertion failed.");
-}
-
-// Verifies that condition is true; generates a non-fatal failure if
-// condition is false.
-inline void Expect(bool condition, const char* file, int line,
- const std::string& msg) {
- if (!condition) {
- GetFailureReporter()->ReportFailure(FailureReporterInterface::kNonfatal,
- file, line, msg);
- }
-}
-inline void Expect(bool condition, const char* file, int line) {
- Expect(condition, file, line, "Expectation failed.");
-}
-
-// Severity level of a log.
-enum LogSeverity {
- kInfo = 0,
- kWarning = 1
-};
-
-// Valid values for the --gmock_verbose flag.
-
-// All logs (informational and warnings) are printed.
-const char kInfoVerbosity[] = "info";
-// Only warnings are printed.
-const char kWarningVerbosity[] = "warning";
-// No logs are printed.
-const char kErrorVerbosity[] = "error";
-
-// Returns true if and only if a log with the given severity is visible
-// according to the --gmock_verbose flag.
-GTEST_API_ bool LogIsVisible(LogSeverity severity);
-
-// Prints the given message to stdout if and only if 'severity' >= the level
-// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
-// 0, also prints the stack trace excluding the top
-// stack_frames_to_skip frames. In opt mode, any positive
-// stack_frames_to_skip is treated as 0, since we don't know which
-// function calls will be inlined by the compiler and need to be
-// conservative.
-GTEST_API_ void Log(LogSeverity severity, const std::string& message,
- int stack_frames_to_skip);
-
-// A marker class that is used to resolve parameterless expectations to the
-// correct overload. This must not be instantiable, to prevent client code from
-// accidentally resolving to the overload; for example:
-//
-// ON_CALL(mock, Method({}, nullptr))...
-//
-class WithoutMatchers {
- private:
- WithoutMatchers() {}
- friend GTEST_API_ WithoutMatchers GetWithoutMatchers();
-};
-
-// Internal use only: access the singleton instance of WithoutMatchers.
-GTEST_API_ WithoutMatchers GetWithoutMatchers();
-
-// Disable MSVC warnings for infinite recursion, since in this case the
-// recursion is unreachable.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4717)
-#endif
-
-// Invalid<T>() is usable as an expression of type T, but will terminate
-// the program with an assertion failure if actually run. This is useful
-// when a value of type T is needed for compilation, but the statement
-// will not really be executed (or we don't care if the statement
-// crashes).
-template <typename T>
-inline T Invalid() {
- Assert(false, "", -1, "Internal error: attempt to return invalid value");
- // This statement is unreachable, and would never terminate even if it
- // could be reached. It is provided only to placate compiler warnings
- // about missing return statements.
- return Invalid<T>();
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-// Given a raw type (i.e. having no top-level reference or const
-// modifier) RawContainer that's either an STL-style container or a
-// native array, class StlContainerView<RawContainer> has the
-// following members:
-//
-// - type is a type that provides an STL-style container view to
-// (i.e. implements the STL container concept for) RawContainer;
-// - const_reference is a type that provides a reference to a const
-// RawContainer;
-// - ConstReference(raw_container) returns a const reference to an STL-style
-// container view to raw_container, which is a RawContainer.
-// - Copy(raw_container) returns an STL-style container view of a
-// copy of raw_container, which is a RawContainer.
-//
-// This generic version is used when RawContainer itself is already an
-// STL-style container.
-template <class RawContainer>
-class StlContainerView {
- public:
- typedef RawContainer type;
- typedef const type& const_reference;
-
- static const_reference ConstReference(const RawContainer& container) {
- static_assert(!std::is_const<RawContainer>::value,
- "RawContainer type must not be const");
- return container;
- }
- static type Copy(const RawContainer& container) { return container; }
-};
-
-// This specialization is used when RawContainer is a native array type.
-template <typename Element, size_t N>
-class StlContainerView<Element[N]> {
- public:
- typedef typename std::remove_const<Element>::type RawElement;
- typedef internal::NativeArray<RawElement> type;
- // NativeArray<T> can represent a native array either by value or by
- // reference (selected by a constructor argument), so 'const type'
- // can be used to reference a const native array. We cannot
- // 'typedef const type& const_reference' here, as that would mean
- // ConstReference() has to return a reference to a local variable.
- typedef const type const_reference;
-
- static const_reference ConstReference(const Element (&array)[N]) {
- static_assert(std::is_same<Element, RawElement>::value,
- "Element type must not be const");
- return type(array, N, RelationToSourceReference());
- }
- static type Copy(const Element (&array)[N]) {
- return type(array, N, RelationToSourceCopy());
- }
-};
-
-// This specialization is used when RawContainer is a native array
-// represented as a (pointer, size) tuple.
-template <typename ElementPointer, typename Size>
-class StlContainerView< ::std::tuple<ElementPointer, Size> > {
- public:
- typedef typename std::remove_const<
- typename std::pointer_traits<ElementPointer>::element_type>::type
- RawElement;
- typedef internal::NativeArray<RawElement> type;
- typedef const type const_reference;
-
- static const_reference ConstReference(
- const ::std::tuple<ElementPointer, Size>& array) {
- return type(std::get<0>(array), std::get<1>(array),
- RelationToSourceReference());
- }
- static type Copy(const ::std::tuple<ElementPointer, Size>& array) {
- return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy());
- }
-};
-
-// The following specialization prevents the user from instantiating
-// StlContainer with a reference type.
-template <typename T> class StlContainerView<T&>;
-
-// A type transform to remove constness from the first part of a pair.
-// Pairs like that are used as the value_type of associative containers,
-// and this transform produces a similar but assignable pair.
-template <typename T>
-struct RemoveConstFromKey {
- typedef T type;
-};
-
-// Partially specialized to remove constness from std::pair<const K, V>.
-template <typename K, typename V>
-struct RemoveConstFromKey<std::pair<const K, V> > {
- typedef std::pair<K, V> type;
-};
-
-// Emit an assertion failure due to incorrect DoDefault() usage. Out-of-lined to
-// reduce code size.
-GTEST_API_ void IllegalDoDefault(const char* file, int line);
-
-template <typename F, typename Tuple, size_t... Idx>
-auto ApplyImpl(F&& f, Tuple&& args, IndexSequence<Idx...>) -> decltype(
- std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...)) {
- return std::forward<F>(f)(std::get<Idx>(std::forward<Tuple>(args))...);
-}
-
-// Apply the function to a tuple of arguments.
-template <typename F, typename Tuple>
-auto Apply(F&& f, Tuple&& args) -> decltype(
- ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args),
- MakeIndexSequence<std::tuple_size<
- typename std::remove_reference<Tuple>::type>::value>())) {
- return ApplyImpl(std::forward<F>(f), std::forward<Tuple>(args),
- MakeIndexSequence<std::tuple_size<
- typename std::remove_reference<Tuple>::type>::value>());
-}
-
-// Template struct Function<F>, where F must be a function type, contains
-// the following typedefs:
-//
-// Result: the function's return type.
-// Arg<N>: the type of the N-th argument, where N starts with 0.
-// ArgumentTuple: the tuple type consisting of all parameters of F.
-// ArgumentMatcherTuple: the tuple type consisting of Matchers for all
-// parameters of F.
-// MakeResultVoid: the function type obtained by substituting void
-// for the return type of F.
-// MakeResultIgnoredValue:
-// the function type obtained by substituting Something
-// for the return type of F.
-template <typename T>
-struct Function;
-
-template <typename R, typename... Args>
-struct Function<R(Args...)> {
- using Result = R;
- static constexpr size_t ArgumentCount = sizeof...(Args);
- template <size_t I>
- using Arg = ElemFromList<I, Args...>;
- using ArgumentTuple = std::tuple<Args...>;
- using ArgumentMatcherTuple = std::tuple<Matcher<Args>...>;
- using MakeResultVoid = void(Args...);
- using MakeResultIgnoredValue = IgnoredValue(Args...);
-};
-
-template <typename R, typename... Args>
-constexpr size_t Function<R(Args...)>::ArgumentCount;
-
-bool Base64Unescape(const std::string& encoded, std::string* decoded);
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-} // namespace internal
-} // namespace testing
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_INTERNAL_UTILS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-port.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-port.h
deleted file mode 100644
index 998f6c7937..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-port.h
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Low-level types and utilities for porting Google Mock to various
-// platforms. All macros ending with _ and symbols defined in an
-// internal namespace are subject to change without notice. Code
-// outside Google Mock MUST NOT USE THEM DIRECTLY. Macros that don't
-// end with _ are part of Google Mock's public API and can be used by
-// code outside Google Mock.
-
-// IWYU pragma: private, include "gmock/gmock.h"
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
-
-#include <assert.h>
-#include <stdlib.h>
-#include <cstdint>
-#include <iostream>
-
-// Most of the utilities needed for porting Google Mock are also
-// required for Google Test and are defined in gtest-port.h.
-//
-// Note to maintainers: to reduce code duplication, prefer adding
-// portability utilities to Google Test's gtest-port.h instead of
-// here, as Google Mock depends on Google Test. Only add a utility
-// here if it's truly specific to Google Mock.
-
-#include "gtest/internal/gtest-port.h"
-#include "gmock/internal/custom/gmock-port.h"
-
-// For MS Visual C++, check the compiler version. At least VS 2015 is
-// required to compile Google Mock.
-#if defined(_MSC_VER) && _MSC_VER < 1900
-# error "At least Visual C++ 2015 (14.0) is required to compile Google Mock."
-#endif
-
-// Macro for referencing flags. This is public as we want the user to
-// use this syntax to reference Google Mock flags.
-#define GMOCK_FLAG(name) FLAGS_gmock_##name
-
-#if !defined(GMOCK_DECLARE_bool_)
-
-// Macros for declaring flags.
-#define GMOCK_DECLARE_bool_(name) \
- namespace testing { \
- GTEST_API_ extern bool GMOCK_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GMOCK_DECLARE_int32_(name) \
- namespace testing { \
- GTEST_API_ extern int32_t GMOCK_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GMOCK_DECLARE_string_(name) \
- namespace testing { \
- GTEST_API_ extern ::std::string GMOCK_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-
-// Macros for defining flags.
-#define GMOCK_DEFINE_bool_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ bool GMOCK_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GMOCK_DEFINE_int32_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ int32_t GMOCK_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GMOCK_DEFINE_string_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ ::std::string GMOCK_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-#endif // !defined(GMOCK_DECLARE_bool_)
-
-#if !defined(GMOCK_FLAG_GET)
-#define GMOCK_FLAG_GET(name) ::testing::GMOCK_FLAG(name)
-#define GMOCK_FLAG_SET(name, value) (void)(::testing::GMOCK_FLAG(name) = value)
-#endif // !defined(GMOCK_FLAG_GET)
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PORT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-pp.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-pp.h
deleted file mode 100644
index 94d61c09c8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/include/gmock/internal/gmock-pp.h
+++ /dev/null
@@ -1,279 +0,0 @@
-#ifndef GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_
-#define GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_
-
-// Expands and concatenates the arguments. Constructed macros reevaluate.
-#define GMOCK_PP_CAT(_1, _2) GMOCK_PP_INTERNAL_CAT(_1, _2)
-
-// Expands and stringifies the only argument.
-#define GMOCK_PP_STRINGIZE(...) GMOCK_PP_INTERNAL_STRINGIZE(__VA_ARGS__)
-
-// Returns empty. Given a variadic number of arguments.
-#define GMOCK_PP_EMPTY(...)
-
-// Returns a comma. Given a variadic number of arguments.
-#define GMOCK_PP_COMMA(...) ,
-
-// Returns the only argument.
-#define GMOCK_PP_IDENTITY(_1) _1
-
-// Evaluates to the number of arguments after expansion.
-//
-// #define PAIR x, y
-//
-// GMOCK_PP_NARG() => 1
-// GMOCK_PP_NARG(x) => 1
-// GMOCK_PP_NARG(x, y) => 2
-// GMOCK_PP_NARG(PAIR) => 2
-//
-// Requires: the number of arguments after expansion is at most 15.
-#define GMOCK_PP_NARG(...) \
- GMOCK_PP_INTERNAL_16TH( \
- (__VA_ARGS__, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0))
-
-// Returns 1 if the expansion of arguments has an unprotected comma. Otherwise
-// returns 0. Requires no more than 15 unprotected commas.
-#define GMOCK_PP_HAS_COMMA(...) \
- GMOCK_PP_INTERNAL_16TH( \
- (__VA_ARGS__, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0))
-
-// Returns the first argument.
-#define GMOCK_PP_HEAD(...) GMOCK_PP_INTERNAL_HEAD((__VA_ARGS__, unusedArg))
-
-// Returns the tail. A variadic list of all arguments minus the first. Requires
-// at least one argument.
-#define GMOCK_PP_TAIL(...) GMOCK_PP_INTERNAL_TAIL((__VA_ARGS__))
-
-// Calls CAT(_Macro, NARG(__VA_ARGS__))(__VA_ARGS__)
-#define GMOCK_PP_VARIADIC_CALL(_Macro, ...) \
- GMOCK_PP_IDENTITY( \
- GMOCK_PP_CAT(_Macro, GMOCK_PP_NARG(__VA_ARGS__))(__VA_ARGS__))
-
-// If the arguments after expansion have no tokens, evaluates to `1`. Otherwise
-// evaluates to `0`.
-//
-// Requires: * the number of arguments after expansion is at most 15.
-// * If the argument is a macro, it must be able to be called with one
-// argument.
-//
-// Implementation details:
-//
-// There is one case when it generates a compile error: if the argument is macro
-// that cannot be called with one argument.
-//
-// #define M(a, b) // it doesn't matter what it expands to
-//
-// // Expected: expands to `0`.
-// // Actual: compile error.
-// GMOCK_PP_IS_EMPTY(M)
-//
-// There are 4 cases tested:
-//
-// * __VA_ARGS__ possible expansion has no unparen'd commas. Expected 0.
-// * __VA_ARGS__ possible expansion is not enclosed in parenthesis. Expected 0.
-// * __VA_ARGS__ possible expansion is not a macro that ()-evaluates to a comma.
-// Expected 0
-// * __VA_ARGS__ is empty, or has unparen'd commas, or is enclosed in
-// parenthesis, or is a macro that ()-evaluates to comma. Expected 1.
-//
-// We trigger detection on '0001', i.e. on empty.
-#define GMOCK_PP_IS_EMPTY(...) \
- GMOCK_PP_INTERNAL_IS_EMPTY(GMOCK_PP_HAS_COMMA(__VA_ARGS__), \
- GMOCK_PP_HAS_COMMA(GMOCK_PP_COMMA __VA_ARGS__), \
- GMOCK_PP_HAS_COMMA(__VA_ARGS__()), \
- GMOCK_PP_HAS_COMMA(GMOCK_PP_COMMA __VA_ARGS__()))
-
-// Evaluates to _Then if _Cond is 1 and _Else if _Cond is 0.
-#define GMOCK_PP_IF(_Cond, _Then, _Else) \
- GMOCK_PP_CAT(GMOCK_PP_INTERNAL_IF_, _Cond)(_Then, _Else)
-
-// Similar to GMOCK_PP_IF but takes _Then and _Else in parentheses.
-//
-// GMOCK_PP_GENERIC_IF(1, (a, b, c), (d, e, f)) => a, b, c
-// GMOCK_PP_GENERIC_IF(0, (a, b, c), (d, e, f)) => d, e, f
-//
-#define GMOCK_PP_GENERIC_IF(_Cond, _Then, _Else) \
- GMOCK_PP_REMOVE_PARENS(GMOCK_PP_IF(_Cond, _Then, _Else))
-
-// Evaluates to the number of arguments after expansion. Identifies 'empty' as
-// 0.
-//
-// #define PAIR x, y
-//
-// GMOCK_PP_NARG0() => 0
-// GMOCK_PP_NARG0(x) => 1
-// GMOCK_PP_NARG0(x, y) => 2
-// GMOCK_PP_NARG0(PAIR) => 2
-//
-// Requires: * the number of arguments after expansion is at most 15.
-// * If the argument is a macro, it must be able to be called with one
-// argument.
-#define GMOCK_PP_NARG0(...) \
- GMOCK_PP_IF(GMOCK_PP_IS_EMPTY(__VA_ARGS__), 0, GMOCK_PP_NARG(__VA_ARGS__))
-
-// Expands to 1 if the first argument starts with something in parentheses,
-// otherwise to 0.
-#define GMOCK_PP_IS_BEGIN_PARENS(...) \
- GMOCK_PP_HEAD(GMOCK_PP_CAT(GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_, \
- GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C __VA_ARGS__))
-
-// Expands to 1 is there is only one argument and it is enclosed in parentheses.
-#define GMOCK_PP_IS_ENCLOSED_PARENS(...) \
- GMOCK_PP_IF(GMOCK_PP_IS_BEGIN_PARENS(__VA_ARGS__), \
- GMOCK_PP_IS_EMPTY(GMOCK_PP_EMPTY __VA_ARGS__), 0)
-
-// Remove the parens, requires GMOCK_PP_IS_ENCLOSED_PARENS(args) => 1.
-#define GMOCK_PP_REMOVE_PARENS(...) GMOCK_PP_INTERNAL_REMOVE_PARENS __VA_ARGS__
-
-// Expands to _Macro(0, _Data, e1) _Macro(1, _Data, e2) ... _Macro(K -1, _Data,
-// eK) as many of GMOCK_INTERNAL_NARG0 _Tuple.
-// Requires: * |_Macro| can be called with 3 arguments.
-// * |_Tuple| expansion has no more than 15 elements.
-#define GMOCK_PP_FOR_EACH(_Macro, _Data, _Tuple) \
- GMOCK_PP_CAT(GMOCK_PP_INTERNAL_FOR_EACH_IMPL_, GMOCK_PP_NARG0 _Tuple) \
- (0, _Macro, _Data, _Tuple)
-
-// Expands to _Macro(0, _Data, ) _Macro(1, _Data, ) ... _Macro(K - 1, _Data, )
-// Empty if _K = 0.
-// Requires: * |_Macro| can be called with 3 arguments.
-// * |_K| literal between 0 and 15
-#define GMOCK_PP_REPEAT(_Macro, _Data, _N) \
- GMOCK_PP_CAT(GMOCK_PP_INTERNAL_FOR_EACH_IMPL_, _N) \
- (0, _Macro, _Data, GMOCK_PP_INTENRAL_EMPTY_TUPLE)
-
-// Increments the argument, requires the argument to be between 0 and 15.
-#define GMOCK_PP_INC(_i) GMOCK_PP_CAT(GMOCK_PP_INTERNAL_INC_, _i)
-
-// Returns comma if _i != 0. Requires _i to be between 0 and 15.
-#define GMOCK_PP_COMMA_IF(_i) GMOCK_PP_CAT(GMOCK_PP_INTERNAL_COMMA_IF_, _i)
-
-// Internal details follow. Do not use any of these symbols outside of this
-// file or we will break your code.
-#define GMOCK_PP_INTENRAL_EMPTY_TUPLE (, , , , , , , , , , , , , , , )
-#define GMOCK_PP_INTERNAL_CAT(_1, _2) _1##_2
-#define GMOCK_PP_INTERNAL_STRINGIZE(...) #__VA_ARGS__
-#define GMOCK_PP_INTERNAL_CAT_5(_1, _2, _3, _4, _5) _1##_2##_3##_4##_5
-#define GMOCK_PP_INTERNAL_IS_EMPTY(_1, _2, _3, _4) \
- GMOCK_PP_HAS_COMMA(GMOCK_PP_INTERNAL_CAT_5(GMOCK_PP_INTERNAL_IS_EMPTY_CASE_, \
- _1, _2, _3, _4))
-#define GMOCK_PP_INTERNAL_IS_EMPTY_CASE_0001 ,
-#define GMOCK_PP_INTERNAL_IF_1(_Then, _Else) _Then
-#define GMOCK_PP_INTERNAL_IF_0(_Then, _Else) _Else
-
-// Because of MSVC treating a token with a comma in it as a single token when
-// passed to another macro, we need to force it to evaluate it as multiple
-// tokens. We do that by using a "IDENTITY(MACRO PARENTHESIZED_ARGS)" macro. We
-// define one per possible macro that relies on this behavior. Note "_Args" must
-// be parenthesized.
-#define GMOCK_PP_INTERNAL_INTERNAL_16TH(_1, _2, _3, _4, _5, _6, _7, _8, _9, \
- _10, _11, _12, _13, _14, _15, _16, \
- ...) \
- _16
-#define GMOCK_PP_INTERNAL_16TH(_Args) \
- GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_16TH _Args)
-#define GMOCK_PP_INTERNAL_INTERNAL_HEAD(_1, ...) _1
-#define GMOCK_PP_INTERNAL_HEAD(_Args) \
- GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_HEAD _Args)
-#define GMOCK_PP_INTERNAL_INTERNAL_TAIL(_1, ...) __VA_ARGS__
-#define GMOCK_PP_INTERNAL_TAIL(_Args) \
- GMOCK_PP_IDENTITY(GMOCK_PP_INTERNAL_INTERNAL_TAIL _Args)
-
-#define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C(...) 1 _
-#define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_1 1,
-#define GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_R_GMOCK_PP_INTERNAL_IBP_IS_VARIADIC_C \
- 0,
-#define GMOCK_PP_INTERNAL_REMOVE_PARENS(...) __VA_ARGS__
-#define GMOCK_PP_INTERNAL_INC_0 1
-#define GMOCK_PP_INTERNAL_INC_1 2
-#define GMOCK_PP_INTERNAL_INC_2 3
-#define GMOCK_PP_INTERNAL_INC_3 4
-#define GMOCK_PP_INTERNAL_INC_4 5
-#define GMOCK_PP_INTERNAL_INC_5 6
-#define GMOCK_PP_INTERNAL_INC_6 7
-#define GMOCK_PP_INTERNAL_INC_7 8
-#define GMOCK_PP_INTERNAL_INC_8 9
-#define GMOCK_PP_INTERNAL_INC_9 10
-#define GMOCK_PP_INTERNAL_INC_10 11
-#define GMOCK_PP_INTERNAL_INC_11 12
-#define GMOCK_PP_INTERNAL_INC_12 13
-#define GMOCK_PP_INTERNAL_INC_13 14
-#define GMOCK_PP_INTERNAL_INC_14 15
-#define GMOCK_PP_INTERNAL_INC_15 16
-#define GMOCK_PP_INTERNAL_COMMA_IF_0
-#define GMOCK_PP_INTERNAL_COMMA_IF_1 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_2 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_3 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_4 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_5 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_6 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_7 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_8 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_9 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_10 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_11 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_12 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_13 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_14 ,
-#define GMOCK_PP_INTERNAL_COMMA_IF_15 ,
-#define GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, _element) \
- _Macro(_i, _Data, _element)
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_0(_i, _Macro, _Data, _Tuple)
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_1(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple)
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_2(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_1(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_3(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_2(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_4(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_3(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_5(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_4(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_6(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_5(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_7(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_6(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_8(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_7(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_9(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_8(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_10(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_9(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_11(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_10(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_12(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_11(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_13(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_12(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_14(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_13(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-#define GMOCK_PP_INTERNAL_FOR_EACH_IMPL_15(_i, _Macro, _Data, _Tuple) \
- GMOCK_PP_INTERNAL_CALL_MACRO(_Macro, _i, _Data, GMOCK_PP_HEAD _Tuple) \
- GMOCK_PP_INTERNAL_FOR_EACH_IMPL_14(GMOCK_PP_INC(_i), _Macro, _Data, \
- (GMOCK_PP_TAIL _Tuple))
-
-#endif // GOOGLEMOCK_INCLUDE_GMOCK_INTERNAL_GMOCK_PP_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-all.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-all.cc
deleted file mode 100644
index e43c9b7b4c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-all.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Google C++ Mocking Framework (Google Mock)
-//
-// This file #includes all Google Mock implementation .cc files. The
-// purpose is to allow a user to build Google Mock by compiling this
-// file alone.
-
-// This line ensures that gmock.h can be compiled on its own, even
-// when it's fused.
-#include "gmock/gmock.h"
-
-// The following lines pull in the real gmock *.cc files.
-#include "src/gmock-cardinalities.cc"
-#include "src/gmock-internal-utils.cc"
-#include "src/gmock-matchers.cc"
-#include "src/gmock-spec-builders.cc"
-#include "src/gmock.cc"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-cardinalities.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-cardinalities.cc
deleted file mode 100644
index 7463f43832..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-cardinalities.cc
+++ /dev/null
@@ -1,155 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements cardinalities.
-
-#include "gmock/gmock-cardinalities.h"
-
-#include <limits.h>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include "gmock/internal/gmock-internal-utils.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-
-namespace {
-
-// Implements the Between(m, n) cardinality.
-class BetweenCardinalityImpl : public CardinalityInterface {
- public:
- BetweenCardinalityImpl(int min, int max)
- : min_(min >= 0 ? min : 0),
- max_(max >= min_ ? max : min_) {
- std::stringstream ss;
- if (min < 0) {
- ss << "The invocation lower bound must be >= 0, "
- << "but is actually " << min << ".";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- } else if (max < 0) {
- ss << "The invocation upper bound must be >= 0, "
- << "but is actually " << max << ".";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- } else if (min > max) {
- ss << "The invocation upper bound (" << max
- << ") must be >= the invocation lower bound (" << min
- << ").";
- internal::Expect(false, __FILE__, __LINE__, ss.str());
- }
- }
-
- // Conservative estimate on the lower/upper bound of the number of
- // calls allowed.
- int ConservativeLowerBound() const override { return min_; }
- int ConservativeUpperBound() const override { return max_; }
-
- bool IsSatisfiedByCallCount(int call_count) const override {
- return min_ <= call_count && call_count <= max_;
- }
-
- bool IsSaturatedByCallCount(int call_count) const override {
- return call_count >= max_;
- }
-
- void DescribeTo(::std::ostream* os) const override;
-
- private:
- const int min_;
- const int max_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(BetweenCardinalityImpl);
-};
-
-// Formats "n times" in a human-friendly way.
-inline std::string FormatTimes(int n) {
- if (n == 1) {
- return "once";
- } else if (n == 2) {
- return "twice";
- } else {
- std::stringstream ss;
- ss << n << " times";
- return ss.str();
- }
-}
-
-// Describes the Between(m, n) cardinality in human-friendly text.
-void BetweenCardinalityImpl::DescribeTo(::std::ostream* os) const {
- if (min_ == 0) {
- if (max_ == 0) {
- *os << "never called";
- } else if (max_ == INT_MAX) {
- *os << "called any number of times";
- } else {
- *os << "called at most " << FormatTimes(max_);
- }
- } else if (min_ == max_) {
- *os << "called " << FormatTimes(min_);
- } else if (max_ == INT_MAX) {
- *os << "called at least " << FormatTimes(min_);
- } else {
- // 0 < min_ < max_ < INT_MAX
- *os << "called between " << min_ << " and " << max_ << " times";
- }
-}
-
-} // Unnamed namespace
-
-// Describes the given call count to an ostream.
-void Cardinality::DescribeActualCallCountTo(int actual_call_count,
- ::std::ostream* os) {
- if (actual_call_count > 0) {
- *os << "called " << FormatTimes(actual_call_count);
- } else {
- *os << "never called";
- }
-}
-
-// Creates a cardinality that allows at least n calls.
-GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
-
-// Creates a cardinality that allows at most n calls.
-GTEST_API_ Cardinality AtMost(int n) { return Between(0, n); }
-
-// Creates a cardinality that allows any number of calls.
-GTEST_API_ Cardinality AnyNumber() { return AtLeast(0); }
-
-// Creates a cardinality that allows between min and max calls.
-GTEST_API_ Cardinality Between(int min, int max) {
- return Cardinality(new BetweenCardinalityImpl(min, max));
-}
-
-// Creates a cardinality that allows exactly n calls.
-GTEST_API_ Cardinality Exactly(int n) { return Between(n, n); }
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-internal-utils.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-internal-utils.cc
deleted file mode 100644
index 6020736eb5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-internal-utils.cc
+++ /dev/null
@@ -1,256 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file defines some utilities useful for implementing Google
-// Mock. They are subject to change without notice, so please DO NOT
-// USE THEM IN USER CODE.
-
-#include "gmock/internal/gmock-internal-utils.h"
-
-#include <ctype.h>
-
-#include <array>
-#include <cctype>
-#include <cstdint>
-#include <cstring>
-#include <ostream> // NOLINT
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace internal {
-
-// Joins a vector of strings as if they are fields of a tuple; returns
-// the joined string.
-GTEST_API_ std::string JoinAsKeyValueTuple(
- const std::vector<const char*>& names, const Strings& values) {
- GTEST_CHECK_(names.size() == values.size());
- if (values.empty()) {
- return "";
- }
- const auto build_one = [&](const size_t i) {
- return std::string(names[i]) + ": " + values[i];
- };
- std::string result = "(" + build_one(0);
- for (size_t i = 1; i < values.size(); i++) {
- result += ", ";
- result += build_one(i);
- }
- result += ")";
- return result;
-}
-
-// Converts an identifier name to a space-separated list of lower-case
-// words. Each maximum substring of the form [A-Za-z][a-z]*|\d+ is
-// treated as one word. For example, both "FooBar123" and
-// "foo_bar_123" are converted to "foo bar 123".
-GTEST_API_ std::string ConvertIdentifierNameToWords(const char* id_name) {
- std::string result;
- char prev_char = '\0';
- for (const char* p = id_name; *p != '\0'; prev_char = *(p++)) {
- // We don't care about the current locale as the input is
- // guaranteed to be a valid C++ identifier name.
- const bool starts_new_word = IsUpper(*p) ||
- (!IsAlpha(prev_char) && IsLower(*p)) ||
- (!IsDigit(prev_char) && IsDigit(*p));
-
- if (IsAlNum(*p)) {
- if (starts_new_word && result != "")
- result += ' ';
- result += ToLower(*p);
- }
- }
- return result;
-}
-
-// This class reports Google Mock failures as Google Test failures. A
-// user can define another class in a similar fashion if they intend to
-// use Google Mock with a testing framework other than Google Test.
-class GoogleTestFailureReporter : public FailureReporterInterface {
- public:
- void ReportFailure(FailureType type, const char* file, int line,
- const std::string& message) override {
- AssertHelper(type == kFatal ?
- TestPartResult::kFatalFailure :
- TestPartResult::kNonFatalFailure,
- file,
- line,
- message.c_str()) = Message();
- if (type == kFatal) {
- posix::Abort();
- }
- }
-};
-
-// Returns the global failure reporter. Will create a
-// GoogleTestFailureReporter and return it the first time called.
-GTEST_API_ FailureReporterInterface* GetFailureReporter() {
- // Points to the global failure reporter used by Google Mock. gcc
- // guarantees that the following use of failure_reporter is
- // thread-safe. We may need to add additional synchronization to
- // protect failure_reporter if we port Google Mock to other
- // compilers.
- static FailureReporterInterface* const failure_reporter =
- new GoogleTestFailureReporter();
- return failure_reporter;
-}
-
-// Protects global resources (stdout in particular) used by Log().
-static GTEST_DEFINE_STATIC_MUTEX_(g_log_mutex);
-
-// Returns true if and only if a log with the given severity is visible
-// according to the --gmock_verbose flag.
-GTEST_API_ bool LogIsVisible(LogSeverity severity) {
- if (GMOCK_FLAG_GET(verbose) == kInfoVerbosity) {
- // Always show the log if --gmock_verbose=info.
- return true;
- } else if (GMOCK_FLAG_GET(verbose) == kErrorVerbosity) {
- // Always hide it if --gmock_verbose=error.
- return false;
- } else {
- // If --gmock_verbose is neither "info" nor "error", we treat it
- // as "warning" (its default value).
- return severity == kWarning;
- }
-}
-
-// Prints the given message to stdout if and only if 'severity' >= the level
-// specified by the --gmock_verbose flag. If stack_frames_to_skip >=
-// 0, also prints the stack trace excluding the top
-// stack_frames_to_skip frames. In opt mode, any positive
-// stack_frames_to_skip is treated as 0, since we don't know which
-// function calls will be inlined by the compiler and need to be
-// conservative.
-GTEST_API_ void Log(LogSeverity severity, const std::string& message,
- int stack_frames_to_skip) {
- if (!LogIsVisible(severity))
- return;
-
- // Ensures that logs from different threads don't interleave.
- MutexLock l(&g_log_mutex);
-
- if (severity == kWarning) {
- // Prints a GMOCK WARNING marker to make the warnings easily searchable.
- std::cout << "\nGMOCK WARNING:";
- }
- // Pre-pends a new-line to message if it doesn't start with one.
- if (message.empty() || message[0] != '\n') {
- std::cout << "\n";
- }
- std::cout << message;
- if (stack_frames_to_skip >= 0) {
-#ifdef NDEBUG
- // In opt mode, we have to be conservative and skip no stack frame.
- const int actual_to_skip = 0;
-#else
- // In dbg mode, we can do what the caller tell us to do (plus one
- // for skipping this function's stack frame).
- const int actual_to_skip = stack_frames_to_skip + 1;
-#endif // NDEBUG
-
- // Appends a new-line to message if it doesn't end with one.
- if (!message.empty() && *message.rbegin() != '\n') {
- std::cout << "\n";
- }
- std::cout << "Stack trace:\n"
- << ::testing::internal::GetCurrentOsStackTraceExceptTop(
- ::testing::UnitTest::GetInstance(), actual_to_skip);
- }
- std::cout << ::std::flush;
-}
-
-GTEST_API_ WithoutMatchers GetWithoutMatchers() { return WithoutMatchers(); }
-
-GTEST_API_ void IllegalDoDefault(const char* file, int line) {
- internal::Assert(
- false, file, line,
- "You are using DoDefault() inside a composite action like "
- "DoAll() or WithArgs(). This is not supported for technical "
- "reasons. Please instead spell out the default action, or "
- "assign the default action to an Action variable and use "
- "the variable in various places.");
-}
-
-constexpr char UnBase64Impl(char c, const char* const base64, char carry) {
- return *base64 == 0 ? static_cast<char>(65)
- : *base64 == c ? carry
- : UnBase64Impl(c, base64 + 1, carry + 1);
-}
-
-template <size_t... I>
-constexpr std::array<char, 256> UnBase64Impl(IndexSequence<I...>,
- const char* const base64) {
- return {{UnBase64Impl(static_cast<char>(I), base64, 0)...}};
-}
-
-constexpr std::array<char, 256> UnBase64(const char* const base64) {
- return UnBase64Impl(MakeIndexSequence<256>{}, base64);
-}
-
-static constexpr char kBase64[] =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-static constexpr std::array<char, 256> kUnBase64 = UnBase64(kBase64);
-
-bool Base64Unescape(const std::string& encoded, std::string* decoded) {
- decoded->clear();
- size_t encoded_len = encoded.size();
- decoded->reserve(3 * (encoded_len / 4) + (encoded_len % 4));
- int bit_pos = 0;
- char dst = 0;
- for (int src : encoded) {
- if (std::isspace(src) || src == '=') {
- continue;
- }
- char src_bin = kUnBase64[static_cast<size_t>(src)];
- if (src_bin >= 64) {
- decoded->clear();
- return false;
- }
- if (bit_pos == 0) {
- dst |= src_bin << 2;
- bit_pos = 6;
- } else {
- dst |= static_cast<char>(src_bin >> (bit_pos - 2));
- decoded->push_back(dst);
- dst = static_cast<char>(src_bin << (10 - bit_pos));
- bit_pos = (bit_pos + 6) % 8;
- }
- }
- return true;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-matchers.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-matchers.cc
deleted file mode 100644
index 873527b11f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-matchers.cc
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements Matcher<const string&>, Matcher<string>, and
-// utilities for defining matchers.
-
-#include "gmock/gmock-matchers.h"
-
-#include <string.h>
-
-#include <iostream>
-#include <sstream>
-#include <string>
-#include <vector>
-
-namespace testing {
-namespace internal {
-
-// Returns the description for a matcher defined using the MATCHER*()
-// macro where the user-supplied description string is "", if
-// 'negation' is false; otherwise returns the description of the
-// negation of the matcher. 'param_values' contains a list of strings
-// that are the print-out of the matcher's parameters.
-GTEST_API_ std::string FormatMatcherDescription(
- bool negation, const char* matcher_name,
- const std::vector<const char*>& param_names, const Strings& param_values) {
- std::string result = ConvertIdentifierNameToWords(matcher_name);
- if (param_values.size() >= 1) {
- result += " " + JoinAsKeyValueTuple(param_names, param_values);
- }
- return negation ? "not (" + result + ")" : result;
-}
-
-// FindMaxBipartiteMatching and its helper class.
-//
-// Uses the well-known Ford-Fulkerson max flow method to find a maximum
-// bipartite matching. Flow is considered to be from left to right.
-// There is an implicit source node that is connected to all of the left
-// nodes, and an implicit sink node that is connected to all of the
-// right nodes. All edges have unit capacity.
-//
-// Neither the flow graph nor the residual flow graph are represented
-// explicitly. Instead, they are implied by the information in 'graph' and
-// a vector<int> called 'left_' whose elements are initialized to the
-// value kUnused. This represents the initial state of the algorithm,
-// where the flow graph is empty, and the residual flow graph has the
-// following edges:
-// - An edge from source to each left_ node
-// - An edge from each right_ node to sink
-// - An edge from each left_ node to each right_ node, if the
-// corresponding edge exists in 'graph'.
-//
-// When the TryAugment() method adds a flow, it sets left_[l] = r for some
-// nodes l and r. This induces the following changes:
-// - The edges (source, l), (l, r), and (r, sink) are added to the
-// flow graph.
-// - The same three edges are removed from the residual flow graph.
-// - The reverse edges (l, source), (r, l), and (sink, r) are added
-// to the residual flow graph, which is a directional graph
-// representing unused flow capacity.
-//
-// When the method augments a flow (moving left_[l] from some r1 to some
-// other r2), this can be thought of as "undoing" the above steps with
-// respect to r1 and "redoing" them with respect to r2.
-//
-// It bears repeating that the flow graph and residual flow graph are
-// never represented explicitly, but can be derived by looking at the
-// information in 'graph' and in left_.
-//
-// As an optimization, there is a second vector<int> called right_ which
-// does not provide any new information. Instead, it enables more
-// efficient queries about edges entering or leaving the right-side nodes
-// of the flow or residual flow graphs. The following invariants are
-// maintained:
-//
-// left[l] == kUnused or right[left[l]] == l
-// right[r] == kUnused or left[right[r]] == r
-//
-// . [ source ] .
-// . ||| .
-// . ||| .
-// . ||\--> left[0]=1 ---\ right[0]=-1 ----\ .
-// . || | | .
-// . |\---> left[1]=-1 \--> right[1]=0 ---\| .
-// . | || .
-// . \----> left[2]=2 ------> right[2]=2 --\|| .
-// . ||| .
-// . elements matchers vvv .
-// . [ sink ] .
-//
-// See Also:
-// [1] Cormen, et al (2001). "Section 26.2: The Ford-Fulkerson method".
-// "Introduction to Algorithms (Second ed.)", pp. 651-664.
-// [2] "Ford-Fulkerson algorithm", Wikipedia,
-// 'http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm'
-class MaxBipartiteMatchState {
- public:
- explicit MaxBipartiteMatchState(const MatchMatrix& graph)
- : graph_(&graph),
- left_(graph_->LhsSize(), kUnused),
- right_(graph_->RhsSize(), kUnused) {}
-
- // Returns the edges of a maximal match, each in the form {left, right}.
- ElementMatcherPairs Compute() {
- // 'seen' is used for path finding { 0: unseen, 1: seen }.
- ::std::vector<char> seen;
- // Searches the residual flow graph for a path from each left node to
- // the sink in the residual flow graph, and if one is found, add flow
- // to the graph. It's okay to search through the left nodes once. The
- // edge from the implicit source node to each previously-visited left
- // node will have flow if that left node has any path to the sink
- // whatsoever. Subsequent augmentations can only add flow to the
- // network, and cannot take away that previous flow unit from the source.
- // Since the source-to-left edge can only carry one flow unit (or,
- // each element can be matched to only one matcher), there is no need
- // to visit the left nodes more than once looking for augmented paths.
- // The flow is known to be possible or impossible by looking at the
- // node once.
- for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {
- // Reset the path-marking vector and try to find a path from
- // source to sink starting at the left_[ilhs] node.
- GTEST_CHECK_(left_[ilhs] == kUnused)
- << "ilhs: " << ilhs << ", left_[ilhs]: " << left_[ilhs];
- // 'seen' initialized to 'graph_->RhsSize()' copies of 0.
- seen.assign(graph_->RhsSize(), 0);
- TryAugment(ilhs, &seen);
- }
- ElementMatcherPairs result;
- for (size_t ilhs = 0; ilhs < left_.size(); ++ilhs) {
- size_t irhs = left_[ilhs];
- if (irhs == kUnused) continue;
- result.push_back(ElementMatcherPair(ilhs, irhs));
- }
- return result;
- }
-
- private:
- static const size_t kUnused = static_cast<size_t>(-1);
-
- // Perform a depth-first search from left node ilhs to the sink. If a
- // path is found, flow is added to the network by linking the left and
- // right vector elements corresponding each segment of the path.
- // Returns true if a path to sink was found, which means that a unit of
- // flow was added to the network. The 'seen' vector elements correspond
- // to right nodes and are marked to eliminate cycles from the search.
- //
- // Left nodes will only be explored at most once because they
- // are accessible from at most one right node in the residual flow
- // graph.
- //
- // Note that left_[ilhs] is the only element of left_ that TryAugment will
- // potentially transition from kUnused to another value. Any other
- // left_ element holding kUnused before TryAugment will be holding it
- // when TryAugment returns.
- //
- bool TryAugment(size_t ilhs, ::std::vector<char>* seen) {
- for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {
- if ((*seen)[irhs]) continue;
- if (!graph_->HasEdge(ilhs, irhs)) continue;
- // There's an available edge from ilhs to irhs.
- (*seen)[irhs] = 1;
- // Next a search is performed to determine whether
- // this edge is a dead end or leads to the sink.
- //
- // right_[irhs] == kUnused means that there is residual flow from
- // right node irhs to the sink, so we can use that to finish this
- // flow path and return success.
- //
- // Otherwise there is residual flow to some ilhs. We push flow
- // along that path and call ourselves recursively to see if this
- // ultimately leads to sink.
- if (right_[irhs] == kUnused || TryAugment(right_[irhs], seen)) {
- // Add flow from left_[ilhs] to right_[irhs].
- left_[ilhs] = irhs;
- right_[irhs] = ilhs;
- return true;
- }
- }
- return false;
- }
-
- const MatchMatrix* graph_; // not owned
- // Each element of the left_ vector represents a left hand side node
- // (i.e. an element) and each element of right_ is a right hand side
- // node (i.e. a matcher). The values in the left_ vector indicate
- // outflow from that node to a node on the right_ side. The values
- // in the right_ indicate inflow, and specify which left_ node is
- // feeding that right_ node, if any. For example, left_[3] == 1 means
- // there's a flow from element #3 to matcher #1. Such a flow would also
- // be redundantly represented in the right_ vector as right_[1] == 3.
- // Elements of left_ and right_ are either kUnused or mutually
- // referent. Mutually referent means that left_[right_[i]] = i and
- // right_[left_[i]] = i.
- ::std::vector<size_t> left_;
- ::std::vector<size_t> right_;
-};
-
-const size_t MaxBipartiteMatchState::kUnused;
-
-GTEST_API_ ElementMatcherPairs FindMaxBipartiteMatching(const MatchMatrix& g) {
- return MaxBipartiteMatchState(g).Compute();
-}
-
-static void LogElementMatcherPairVec(const ElementMatcherPairs& pairs,
- ::std::ostream* stream) {
- typedef ElementMatcherPairs::const_iterator Iter;
- ::std::ostream& os = *stream;
- os << "{";
- const char* sep = "";
- for (Iter it = pairs.begin(); it != pairs.end(); ++it) {
- os << sep << "\n ("
- << "element #" << it->first << ", "
- << "matcher #" << it->second << ")";
- sep = ",";
- }
- os << "\n}";
-}
-
-bool MatchMatrix::NextGraph() {
- for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
- for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
- char& b = matched_[SpaceIndex(ilhs, irhs)];
- if (!b) {
- b = 1;
- return true;
- }
- b = 0;
- }
- }
- return false;
-}
-
-void MatchMatrix::Randomize() {
- for (size_t ilhs = 0; ilhs < LhsSize(); ++ilhs) {
- for (size_t irhs = 0; irhs < RhsSize(); ++irhs) {
- char& b = matched_[SpaceIndex(ilhs, irhs)];
- b = static_cast<char>(rand() & 1); // NOLINT
- }
- }
-}
-
-std::string MatchMatrix::DebugString() const {
- ::std::stringstream ss;
- const char* sep = "";
- for (size_t i = 0; i < LhsSize(); ++i) {
- ss << sep;
- for (size_t j = 0; j < RhsSize(); ++j) {
- ss << HasEdge(i, j);
- }
- sep = ";";
- }
- return ss.str();
-}
-
-void UnorderedElementsAreMatcherImplBase::DescribeToImpl(
- ::std::ostream* os) const {
- switch (match_flags()) {
- case UnorderedMatcherRequire::ExactMatch:
- if (matcher_describers_.empty()) {
- *os << "is empty";
- return;
- }
- if (matcher_describers_.size() == 1) {
- *os << "has " << Elements(1) << " and that element ";
- matcher_describers_[0]->DescribeTo(os);
- return;
- }
- *os << "has " << Elements(matcher_describers_.size())
- << " and there exists some permutation of elements such that:\n";
- break;
- case UnorderedMatcherRequire::Superset:
- *os << "a surjection from elements to requirements exists such that:\n";
- break;
- case UnorderedMatcherRequire::Subset:
- *os << "an injection from elements to requirements exists such that:\n";
- break;
- }
-
- const char* sep = "";
- for (size_t i = 0; i != matcher_describers_.size(); ++i) {
- *os << sep;
- if (match_flags() == UnorderedMatcherRequire::ExactMatch) {
- *os << " - element #" << i << " ";
- } else {
- *os << " - an element ";
- }
- matcher_describers_[i]->DescribeTo(os);
- if (match_flags() == UnorderedMatcherRequire::ExactMatch) {
- sep = ", and\n";
- } else {
- sep = "\n";
- }
- }
-}
-
-void UnorderedElementsAreMatcherImplBase::DescribeNegationToImpl(
- ::std::ostream* os) const {
- switch (match_flags()) {
- case UnorderedMatcherRequire::ExactMatch:
- if (matcher_describers_.empty()) {
- *os << "isn't empty";
- return;
- }
- if (matcher_describers_.size() == 1) {
- *os << "doesn't have " << Elements(1) << ", or has " << Elements(1)
- << " that ";
- matcher_describers_[0]->DescribeNegationTo(os);
- return;
- }
- *os << "doesn't have " << Elements(matcher_describers_.size())
- << ", or there exists no permutation of elements such that:\n";
- break;
- case UnorderedMatcherRequire::Superset:
- *os << "no surjection from elements to requirements exists such that:\n";
- break;
- case UnorderedMatcherRequire::Subset:
- *os << "no injection from elements to requirements exists such that:\n";
- break;
- }
- const char* sep = "";
- for (size_t i = 0; i != matcher_describers_.size(); ++i) {
- *os << sep;
- if (match_flags() == UnorderedMatcherRequire::ExactMatch) {
- *os << " - element #" << i << " ";
- } else {
- *os << " - an element ";
- }
- matcher_describers_[i]->DescribeTo(os);
- if (match_flags() == UnorderedMatcherRequire::ExactMatch) {
- sep = ", and\n";
- } else {
- sep = "\n";
- }
- }
-}
-
-// Checks that all matchers match at least one element, and that all
-// elements match at least one matcher. This enables faster matching
-// and better error reporting.
-// Returns false, writing an explanation to 'listener', if and only
-// if the success criteria are not met.
-bool UnorderedElementsAreMatcherImplBase::VerifyMatchMatrix(
- const ::std::vector<std::string>& element_printouts,
- const MatchMatrix& matrix, MatchResultListener* listener) const {
- bool result = true;
- ::std::vector<char> element_matched(matrix.LhsSize(), 0);
- ::std::vector<char> matcher_matched(matrix.RhsSize(), 0);
-
- for (size_t ilhs = 0; ilhs < matrix.LhsSize(); ilhs++) {
- for (size_t irhs = 0; irhs < matrix.RhsSize(); irhs++) {
- char matched = matrix.HasEdge(ilhs, irhs);
- element_matched[ilhs] |= matched;
- matcher_matched[irhs] |= matched;
- }
- }
-
- if (match_flags() & UnorderedMatcherRequire::Superset) {
- const char* sep =
- "where the following matchers don't match any elements:\n";
- for (size_t mi = 0; mi < matcher_matched.size(); ++mi) {
- if (matcher_matched[mi]) continue;
- result = false;
- if (listener->IsInterested()) {
- *listener << sep << "matcher #" << mi << ": ";
- matcher_describers_[mi]->DescribeTo(listener->stream());
- sep = ",\n";
- }
- }
- }
-
- if (match_flags() & UnorderedMatcherRequire::Subset) {
- const char* sep =
- "where the following elements don't match any matchers:\n";
- const char* outer_sep = "";
- if (!result) {
- outer_sep = "\nand ";
- }
- for (size_t ei = 0; ei < element_matched.size(); ++ei) {
- if (element_matched[ei]) continue;
- result = false;
- if (listener->IsInterested()) {
- *listener << outer_sep << sep << "element #" << ei << ": "
- << element_printouts[ei];
- sep = ",\n";
- outer_sep = "";
- }
- }
- }
- return result;
-}
-
-bool UnorderedElementsAreMatcherImplBase::FindPairing(
- const MatchMatrix& matrix, MatchResultListener* listener) const {
- ElementMatcherPairs matches = FindMaxBipartiteMatching(matrix);
-
- size_t max_flow = matches.size();
- if ((match_flags() & UnorderedMatcherRequire::Superset) &&
- max_flow < matrix.RhsSize()) {
- if (listener->IsInterested()) {
- *listener << "where no permutation of the elements can satisfy all "
- "matchers, and the closest match is "
- << max_flow << " of " << matrix.RhsSize()
- << " matchers with the pairings:\n";
- LogElementMatcherPairVec(matches, listener->stream());
- }
- return false;
- }
- if ((match_flags() & UnorderedMatcherRequire::Subset) &&
- max_flow < matrix.LhsSize()) {
- if (listener->IsInterested()) {
- *listener
- << "where not all elements can be matched, and the closest match is "
- << max_flow << " of " << matrix.RhsSize()
- << " matchers with the pairings:\n";
- LogElementMatcherPairVec(matches, listener->stream());
- }
- return false;
- }
-
- if (matches.size() > 1) {
- if (listener->IsInterested()) {
- const char* sep = "where:\n";
- for (size_t mi = 0; mi < matches.size(); ++mi) {
- *listener << sep << " - element #" << matches[mi].first
- << " is matched by matcher #" << matches[mi].second;
- sep = ",\n";
- }
- }
- }
- return true;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-spec-builders.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-spec-builders.cc
deleted file mode 100644
index 7b4a38bd10..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock-spec-builders.cc
+++ /dev/null
@@ -1,908 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file implements the spec builder syntax (ON_CALL and
-// EXPECT_CALL).
-
-#include "gmock/gmock-spec-builders.h"
-
-#include <stdlib.h>
-
-#include <iostream> // NOLINT
-#include <map>
-#include <memory>
-#include <set>
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_OS_CYGWIN || GTEST_OS_LINUX || GTEST_OS_MAC
-# include <unistd.h> // NOLINT
-#endif
-
-// Silence C4800 (C4800: 'int *const ': forcing value
-// to bool 'true' or 'false') for MSVC 15
-#ifdef _MSC_VER
-#if _MSC_VER == 1900
-# pragma warning(push)
-# pragma warning(disable:4800)
-#endif
-#endif
-
-namespace testing {
-namespace internal {
-
-// Protects the mock object registry (in class Mock), all function
-// mockers, and all expectations.
-GTEST_API_ GTEST_DEFINE_STATIC_MUTEX_(g_gmock_mutex);
-
-// Logs a message including file and line number information.
-GTEST_API_ void LogWithLocation(testing::internal::LogSeverity severity,
- const char* file, int line,
- const std::string& message) {
- ::std::ostringstream s;
- s << internal::FormatFileLocation(file, line) << " " << message
- << ::std::endl;
- Log(severity, s.str(), 0);
-}
-
-// Constructs an ExpectationBase object.
-ExpectationBase::ExpectationBase(const char* a_file, int a_line,
- const std::string& a_source_text)
- : file_(a_file),
- line_(a_line),
- source_text_(a_source_text),
- cardinality_specified_(false),
- cardinality_(Exactly(1)),
- call_count_(0),
- retired_(false),
- extra_matcher_specified_(false),
- repeated_action_specified_(false),
- retires_on_saturation_(false),
- last_clause_(kNone),
- action_count_checked_(false) {}
-
-// Destructs an ExpectationBase object.
-ExpectationBase::~ExpectationBase() {}
-
-// Explicitly specifies the cardinality of this expectation. Used by
-// the subclasses to implement the .Times() clause.
-void ExpectationBase::SpecifyCardinality(const Cardinality& a_cardinality) {
- cardinality_specified_ = true;
- cardinality_ = a_cardinality;
-}
-
-// Retires all pre-requisites of this expectation.
-void ExpectationBase::RetireAllPreRequisites()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- if (is_retired()) {
- // We can take this short-cut as we never retire an expectation
- // until we have retired all its pre-requisites.
- return;
- }
-
- ::std::vector<ExpectationBase*> expectations(1, this);
- while (!expectations.empty()) {
- ExpectationBase* exp = expectations.back();
- expectations.pop_back();
-
- for (ExpectationSet::const_iterator it =
- exp->immediate_prerequisites_.begin();
- it != exp->immediate_prerequisites_.end(); ++it) {
- ExpectationBase* next = it->expectation_base().get();
- if (!next->is_retired()) {
- next->Retire();
- expectations.push_back(next);
- }
- }
- }
-}
-
-// Returns true if and only if all pre-requisites of this expectation
-// have been satisfied.
-bool ExpectationBase::AllPrerequisitesAreSatisfied() const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- ::std::vector<const ExpectationBase*> expectations(1, this);
- while (!expectations.empty()) {
- const ExpectationBase* exp = expectations.back();
- expectations.pop_back();
-
- for (ExpectationSet::const_iterator it =
- exp->immediate_prerequisites_.begin();
- it != exp->immediate_prerequisites_.end(); ++it) {
- const ExpectationBase* next = it->expectation_base().get();
- if (!next->IsSatisfied()) return false;
- expectations.push_back(next);
- }
- }
- return true;
-}
-
-// Adds unsatisfied pre-requisites of this expectation to 'result'.
-void ExpectationBase::FindUnsatisfiedPrerequisites(ExpectationSet* result) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- ::std::vector<const ExpectationBase*> expectations(1, this);
- while (!expectations.empty()) {
- const ExpectationBase* exp = expectations.back();
- expectations.pop_back();
-
- for (ExpectationSet::const_iterator it =
- exp->immediate_prerequisites_.begin();
- it != exp->immediate_prerequisites_.end(); ++it) {
- const ExpectationBase* next = it->expectation_base().get();
-
- if (next->IsSatisfied()) {
- // If *it is satisfied and has a call count of 0, some of its
- // pre-requisites may not be satisfied yet.
- if (next->call_count_ == 0) {
- expectations.push_back(next);
- }
- } else {
- // Now that we know next is unsatisfied, we are not so interested
- // in whether its pre-requisites are satisfied. Therefore we
- // don't iterate into it here.
- *result += *it;
- }
- }
- }
-}
-
-// Describes how many times a function call matching this
-// expectation has occurred.
-void ExpectationBase::DescribeCallCountTo(::std::ostream* os) const
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
-
- // Describes how many times the function is expected to be called.
- *os << " Expected: to be ";
- cardinality().DescribeTo(os);
- *os << "\n Actual: ";
- Cardinality::DescribeActualCallCountTo(call_count(), os);
-
- // Describes the state of the expectation (e.g. is it satisfied?
- // is it active?).
- *os << " - " << (IsOverSaturated() ? "over-saturated" :
- IsSaturated() ? "saturated" :
- IsSatisfied() ? "satisfied" : "unsatisfied")
- << " and "
- << (is_retired() ? "retired" : "active");
-}
-
-// Checks the action count (i.e. the number of WillOnce() and
-// WillRepeatedly() clauses) against the cardinality if this hasn't
-// been done before. Prints a warning if there are too many or too
-// few actions.
-void ExpectationBase::CheckActionCountIfNotDone() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- bool should_check = false;
- {
- MutexLock l(&mutex_);
- if (!action_count_checked_) {
- action_count_checked_ = true;
- should_check = true;
- }
- }
-
- if (should_check) {
- if (!cardinality_specified_) {
- // The cardinality was inferred - no need to check the action
- // count against it.
- return;
- }
-
- // The cardinality was explicitly specified.
- const int action_count = static_cast<int>(untyped_actions_.size());
- const int upper_bound = cardinality().ConservativeUpperBound();
- const int lower_bound = cardinality().ConservativeLowerBound();
- bool too_many; // True if there are too many actions, or false
- // if there are too few.
- if (action_count > upper_bound ||
- (action_count == upper_bound && repeated_action_specified_)) {
- too_many = true;
- } else if (0 < action_count && action_count < lower_bound &&
- !repeated_action_specified_) {
- too_many = false;
- } else {
- return;
- }
-
- ::std::stringstream ss;
- DescribeLocationTo(&ss);
- ss << "Too " << (too_many ? "many" : "few")
- << " actions specified in " << source_text() << "...\n"
- << "Expected to be ";
- cardinality().DescribeTo(&ss);
- ss << ", but has " << (too_many ? "" : "only ")
- << action_count << " WillOnce()"
- << (action_count == 1 ? "" : "s");
- if (repeated_action_specified_) {
- ss << " and a WillRepeatedly()";
- }
- ss << ".";
- Log(kWarning, ss.str(), -1); // -1 means "don't print stack trace".
- }
-}
-
-// Implements the .Times() clause.
-void ExpectationBase::UntypedTimes(const Cardinality& a_cardinality) {
- if (last_clause_ == kTimes) {
- ExpectSpecProperty(false,
- ".Times() cannot appear "
- "more than once in an EXPECT_CALL().");
- } else {
- ExpectSpecProperty(
- last_clause_ < kTimes,
- ".Times() may only appear *before* .InSequence(), .WillOnce(), "
- ".WillRepeatedly(), or .RetiresOnSaturation(), not after.");
- }
- last_clause_ = kTimes;
-
- SpecifyCardinality(a_cardinality);
-}
-
-// Points to the implicit sequence introduced by a living InSequence
-// object (if any) in the current thread or NULL.
-GTEST_API_ ThreadLocal<Sequence*> g_gmock_implicit_sequence;
-
-// Reports an uninteresting call (whose description is in msg) in the
-// manner specified by 'reaction'.
-void ReportUninterestingCall(CallReaction reaction, const std::string& msg) {
- // Include a stack trace only if --gmock_verbose=info is specified.
- const int stack_frames_to_skip =
- GMOCK_FLAG_GET(verbose) == kInfoVerbosity ? 3 : -1;
- switch (reaction) {
- case kAllow:
- Log(kInfo, msg, stack_frames_to_skip);
- break;
- case kWarn:
- Log(kWarning,
- msg +
- "\nNOTE: You can safely ignore the above warning unless this "
- "call should not happen. Do not suppress it by blindly adding "
- "an EXPECT_CALL() if you don't mean to enforce the call. "
- "See "
- "https://github.com/google/googletest/blob/master/docs/"
- "gmock_cook_book.md#"
- "knowing-when-to-expect for details.\n",
- stack_frames_to_skip);
- break;
- default: // FAIL
- Expect(false, nullptr, -1, msg);
- }
-}
-
-UntypedFunctionMockerBase::UntypedFunctionMockerBase()
- : mock_obj_(nullptr), name_("") {}
-
-UntypedFunctionMockerBase::~UntypedFunctionMockerBase() {}
-
-// Sets the mock object this mock method belongs to, and registers
-// this information in the global mock registry. Will be called
-// whenever an EXPECT_CALL() or ON_CALL() is executed on this mock
-// method.
-void UntypedFunctionMockerBase::RegisterOwner(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- {
- MutexLock l(&g_gmock_mutex);
- mock_obj_ = mock_obj;
- }
- Mock::Register(mock_obj, this);
-}
-
-// Sets the mock object this mock method belongs to, and sets the name
-// of the mock function. Will be called upon each invocation of this
-// mock function.
-void UntypedFunctionMockerBase::SetOwnerAndName(const void* mock_obj,
- const char* name)
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- // We protect name_ under g_gmock_mutex in case this mock function
- // is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- mock_obj_ = mock_obj;
- name_ = name;
-}
-
-// Returns the name of the function being mocked. Must be called
-// after RegisterOwner() or SetOwnerAndName() has been called.
-const void* UntypedFunctionMockerBase::MockObject() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const void* mock_obj;
- {
- // We protect mock_obj_ under g_gmock_mutex in case this mock
- // function is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- Assert(mock_obj_ != nullptr, __FILE__, __LINE__,
- "MockObject() must not be called before RegisterOwner() or "
- "SetOwnerAndName() has been called.");
- mock_obj = mock_obj_;
- }
- return mock_obj;
-}
-
-// Returns the name of this mock method. Must be called after
-// SetOwnerAndName() has been called.
-const char* UntypedFunctionMockerBase::Name() const
- GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- const char* name;
- {
- // We protect name_ under g_gmock_mutex in case this mock
- // function is called from two threads concurrently.
- MutexLock l(&g_gmock_mutex);
- Assert(name_ != nullptr, __FILE__, __LINE__,
- "Name() must not be called before SetOwnerAndName() has "
- "been called.");
- name = name_;
- }
- return name;
-}
-
-// Calculates the result of invoking this mock function with the given
-// arguments, prints it, and returns it. The caller is responsible
-// for deleting the result.
-UntypedActionResultHolderBase* UntypedFunctionMockerBase::UntypedInvokeWith(
- void* const untyped_args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex) {
- // See the definition of untyped_expectations_ for why access to it
- // is unprotected here.
- if (untyped_expectations_.size() == 0) {
- // No expectation is set on this mock method - we have an
- // uninteresting call.
-
- // We must get Google Mock's reaction on uninteresting calls
- // made on this mock object BEFORE performing the action,
- // because the action may DELETE the mock object and make the
- // following expression meaningless.
- const CallReaction reaction =
- Mock::GetReactionOnUninterestingCalls(MockObject());
-
- // True if and only if we need to print this call's arguments and return
- // value. This definition must be kept in sync with
- // the behavior of ReportUninterestingCall().
- const bool need_to_report_uninteresting_call =
- // If the user allows this uninteresting call, we print it
- // only when they want informational messages.
- reaction == kAllow ? LogIsVisible(kInfo) :
- // If the user wants this to be a warning, we print
- // it only when they want to see warnings.
- reaction == kWarn
- ? LogIsVisible(kWarning)
- :
- // Otherwise, the user wants this to be an error, and we
- // should always print detailed information in the error.
- true;
-
- if (!need_to_report_uninteresting_call) {
- // Perform the action without printing the call information.
- return this->UntypedPerformDefaultAction(
- untyped_args, "Function call: " + std::string(Name()));
- }
-
- // Warns about the uninteresting call.
- ::std::stringstream ss;
- this->UntypedDescribeUninterestingCall(untyped_args, &ss);
-
- // Calculates the function result.
- UntypedActionResultHolderBase* const result =
- this->UntypedPerformDefaultAction(untyped_args, ss.str());
-
- // Prints the function result.
- if (result != nullptr) result->PrintAsActionResult(&ss);
-
- ReportUninterestingCall(reaction, ss.str());
- return result;
- }
-
- bool is_excessive = false;
- ::std::stringstream ss;
- ::std::stringstream why;
- ::std::stringstream loc;
- const void* untyped_action = nullptr;
-
- // The UntypedFindMatchingExpectation() function acquires and
- // releases g_gmock_mutex.
-
- const ExpectationBase* const untyped_expectation =
- this->UntypedFindMatchingExpectation(untyped_args, &untyped_action,
- &is_excessive, &ss, &why);
- const bool found = untyped_expectation != nullptr;
-
- // True if and only if we need to print the call's arguments
- // and return value.
- // This definition must be kept in sync with the uses of Expect()
- // and Log() in this function.
- const bool need_to_report_call =
- !found || is_excessive || LogIsVisible(kInfo);
- if (!need_to_report_call) {
- // Perform the action without printing the call information.
- return untyped_action == nullptr
- ? this->UntypedPerformDefaultAction(untyped_args, "")
- : this->UntypedPerformAction(untyped_action, untyped_args);
- }
-
- ss << " Function call: " << Name();
- this->UntypedPrintArgs(untyped_args, &ss);
-
- // In case the action deletes a piece of the expectation, we
- // generate the message beforehand.
- if (found && !is_excessive) {
- untyped_expectation->DescribeLocationTo(&loc);
- }
-
- UntypedActionResultHolderBase* result = nullptr;
-
- auto perform_action = [&] {
- return untyped_action == nullptr
- ? this->UntypedPerformDefaultAction(untyped_args, ss.str())
- : this->UntypedPerformAction(untyped_action, untyped_args);
- };
- auto handle_failures = [&] {
- ss << "\n" << why.str();
-
- if (!found) {
- // No expectation matches this call - reports a failure.
- Expect(false, nullptr, -1, ss.str());
- } else if (is_excessive) {
- // We had an upper-bound violation and the failure message is in ss.
- Expect(false, untyped_expectation->file(), untyped_expectation->line(),
- ss.str());
- } else {
- // We had an expected call and the matching expectation is
- // described in ss.
- Log(kInfo, loc.str() + ss.str(), 2);
- }
- };
-#if GTEST_HAS_EXCEPTIONS
- try {
- result = perform_action();
- } catch (...) {
- handle_failures();
- throw;
- }
-#else
- result = perform_action();
-#endif
-
- if (result != nullptr) result->PrintAsActionResult(&ss);
- handle_failures();
- return result;
-}
-
-// Returns an Expectation object that references and co-owns exp,
-// which must be an expectation on this mock function.
-Expectation UntypedFunctionMockerBase::GetHandleOf(ExpectationBase* exp) {
- // See the definition of untyped_expectations_ for why access to it
- // is unprotected here.
- for (UntypedExpectations::const_iterator it =
- untyped_expectations_.begin();
- it != untyped_expectations_.end(); ++it) {
- if (it->get() == exp) {
- return Expectation(*it);
- }
- }
-
- Assert(false, __FILE__, __LINE__, "Cannot find expectation.");
- return Expectation();
- // The above statement is just to make the code compile, and will
- // never be executed.
-}
-
-// Verifies that all expectations on this mock function have been
-// satisfied. Reports one or more Google Test non-fatal failures
-// and returns false if not.
-bool UntypedFunctionMockerBase::VerifyAndClearExpectationsLocked()
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) {
- g_gmock_mutex.AssertHeld();
- bool expectations_met = true;
- for (UntypedExpectations::const_iterator it =
- untyped_expectations_.begin();
- it != untyped_expectations_.end(); ++it) {
- ExpectationBase* const untyped_expectation = it->get();
- if (untyped_expectation->IsOverSaturated()) {
- // There was an upper-bound violation. Since the error was
- // already reported when it occurred, there is no need to do
- // anything here.
- expectations_met = false;
- } else if (!untyped_expectation->IsSatisfied()) {
- expectations_met = false;
- ::std::stringstream ss;
- ss << "Actual function call count doesn't match "
- << untyped_expectation->source_text() << "...\n";
- // No need to show the source file location of the expectation
- // in the description, as the Expect() call that follows already
- // takes care of it.
- untyped_expectation->MaybeDescribeExtraMatcherTo(&ss);
- untyped_expectation->DescribeCallCountTo(&ss);
- Expect(false, untyped_expectation->file(),
- untyped_expectation->line(), ss.str());
- }
- }
-
- // Deleting our expectations may trigger other mock objects to be deleted, for
- // example if an action contains a reference counted smart pointer to that
- // mock object, and that is the last reference. So if we delete our
- // expectations within the context of the global mutex we may deadlock when
- // this method is called again. Instead, make a copy of the set of
- // expectations to delete, clear our set within the mutex, and then clear the
- // copied set outside of it.
- UntypedExpectations expectations_to_delete;
- untyped_expectations_.swap(expectations_to_delete);
-
- g_gmock_mutex.Unlock();
- expectations_to_delete.clear();
- g_gmock_mutex.Lock();
-
- return expectations_met;
-}
-
-CallReaction intToCallReaction(int mock_behavior) {
- if (mock_behavior >= kAllow && mock_behavior <= kFail) {
- return static_cast<internal::CallReaction>(mock_behavior);
- }
- return kWarn;
-}
-
-} // namespace internal
-
-// Class Mock.
-
-namespace {
-
-typedef std::set<internal::UntypedFunctionMockerBase*> FunctionMockers;
-
-// The current state of a mock object. Such information is needed for
-// detecting leaked mock objects and explicitly verifying a mock's
-// expectations.
-struct MockObjectState {
- MockObjectState()
- : first_used_file(nullptr), first_used_line(-1), leakable(false) {}
-
- // Where in the source file an ON_CALL or EXPECT_CALL is first
- // invoked on this mock object.
- const char* first_used_file;
- int first_used_line;
- ::std::string first_used_test_suite;
- ::std::string first_used_test;
- bool leakable; // true if and only if it's OK to leak the object.
- FunctionMockers function_mockers; // All registered methods of the object.
-};
-
-// A global registry holding the state of all mock objects that are
-// alive. A mock object is added to this registry the first time
-// Mock::AllowLeak(), ON_CALL(), or EXPECT_CALL() is called on it. It
-// is removed from the registry in the mock object's destructor.
-class MockObjectRegistry {
- public:
- // Maps a mock object (identified by its address) to its state.
- typedef std::map<const void*, MockObjectState> StateMap;
-
- // This destructor will be called when a program exits, after all
- // tests in it have been run. By then, there should be no mock
- // object alive. Therefore we report any living object as test
- // failure, unless the user explicitly asked us to ignore it.
- ~MockObjectRegistry() {
- if (!GMOCK_FLAG_GET(catch_leaked_mocks)) return;
-
- int leaked_count = 0;
- for (StateMap::const_iterator it = states_.begin(); it != states_.end();
- ++it) {
- if (it->second.leakable) // The user said it's fine to leak this object.
- continue;
-
- // FIXME: Print the type of the leaked object.
- // This can help the user identify the leaked object.
- std::cout << "\n";
- const MockObjectState& state = it->second;
- std::cout << internal::FormatFileLocation(state.first_used_file,
- state.first_used_line);
- std::cout << " ERROR: this mock object";
- if (state.first_used_test != "") {
- std::cout << " (used in test " << state.first_used_test_suite << "."
- << state.first_used_test << ")";
- }
- std::cout << " should be deleted but never is. Its address is @"
- << it->first << ".";
- leaked_count++;
- }
- if (leaked_count > 0) {
- std::cout << "\nERROR: " << leaked_count << " leaked mock "
- << (leaked_count == 1 ? "object" : "objects")
- << " found at program exit. Expectations on a mock object are "
- "verified when the object is destructed. Leaking a mock "
- "means that its expectations aren't verified, which is "
- "usually a test bug. If you really intend to leak a mock, "
- "you can suppress this error using "
- "testing::Mock::AllowLeak(mock_object), or you may use a "
- "fake or stub instead of a mock.\n";
- std::cout.flush();
- ::std::cerr.flush();
- // RUN_ALL_TESTS() has already returned when this destructor is
- // called. Therefore we cannot use the normal Google Test
- // failure reporting mechanism.
- _exit(1); // We cannot call exit() as it is not reentrant and
- // may already have been called.
- }
- }
-
- StateMap& states() { return states_; }
-
- private:
- StateMap states_;
-};
-
-// Protected by g_gmock_mutex.
-MockObjectRegistry g_mock_object_registry;
-
-// Maps a mock object to the reaction Google Mock should have when an
-// uninteresting method is called. Protected by g_gmock_mutex.
-std::map<const void*, internal::CallReaction> g_uninteresting_call_reaction;
-
-// Sets the reaction Google Mock should have when an uninteresting
-// method of the given mock object is called.
-void SetReactionOnUninterestingCalls(const void* mock_obj,
- internal::CallReaction reaction)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_uninteresting_call_reaction[mock_obj] = reaction;
-}
-
-} // namespace
-
-// Tells Google Mock to allow uninteresting calls on the given mock
-// object.
-void Mock::AllowUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kAllow);
-}
-
-// Tells Google Mock to warn the user about uninteresting calls on the
-// given mock object.
-void Mock::WarnUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kWarn);
-}
-
-// Tells Google Mock to fail uninteresting calls on the given mock
-// object.
-void Mock::FailUninterestingCalls(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- SetReactionOnUninterestingCalls(mock_obj, internal::kFail);
-}
-
-// Tells Google Mock the given mock object is being destroyed and its
-// entry in the call-reaction table should be removed.
-void Mock::UnregisterCallReaction(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_uninteresting_call_reaction.erase(mock_obj);
-}
-
-// Returns the reaction Google Mock will have on uninteresting calls
-// made on the given mock object.
-internal::CallReaction Mock::GetReactionOnUninterestingCalls(
- const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- return (g_uninteresting_call_reaction.count(mock_obj) == 0)
- ? internal::intToCallReaction(
- GMOCK_FLAG_GET(default_mock_behavior))
- : g_uninteresting_call_reaction[mock_obj];
-}
-
-// Tells Google Mock to ignore mock_obj when checking for leaked mock
-// objects.
-void Mock::AllowLeak(const void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_mock_object_registry.states()[mock_obj].leakable = true;
-}
-
-// Verifies and clears all expectations on the given mock object. If
-// the expectations aren't satisfied, generates one or more Google
-// Test non-fatal failures and returns false.
-bool Mock::VerifyAndClearExpectations(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- return VerifyAndClearExpectationsLocked(mock_obj);
-}
-
-// Verifies all expectations on the given mock object and clears its
-// default actions and expectations. Returns true if and only if the
-// verification was successful.
-bool Mock::VerifyAndClear(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- ClearDefaultActionsLocked(mock_obj);
- return VerifyAndClearExpectationsLocked(mock_obj);
-}
-
-// Verifies and clears all expectations on the given mock object. If
-// the expectations aren't satisfied, generates one or more Google
-// Test non-fatal failures and returns false.
-bool Mock::VerifyAndClearExpectationsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
- if (g_mock_object_registry.states().count(mock_obj) == 0) {
- // No EXPECT_CALL() was set on the given mock object.
- return true;
- }
-
- // Verifies and clears the expectations on each mock method in the
- // given mock object.
- bool expectations_met = true;
- FunctionMockers& mockers =
- g_mock_object_registry.states()[mock_obj].function_mockers;
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- if (!(*it)->VerifyAndClearExpectationsLocked()) {
- expectations_met = false;
- }
- }
-
- // We don't clear the content of mockers, as they may still be
- // needed by ClearDefaultActionsLocked().
- return expectations_met;
-}
-
-bool Mock::IsNaggy(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- return Mock::GetReactionOnUninterestingCalls(mock_obj) == internal::kWarn;
-}
-bool Mock::IsNice(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- return Mock::GetReactionOnUninterestingCalls(mock_obj) == internal::kAllow;
-}
-bool Mock::IsStrict(void* mock_obj)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- return Mock::GetReactionOnUninterestingCalls(mock_obj) == internal::kFail;
-}
-
-// Registers a mock object and a mock method it owns.
-void Mock::Register(const void* mock_obj,
- internal::UntypedFunctionMockerBase* mocker)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- g_mock_object_registry.states()[mock_obj].function_mockers.insert(mocker);
-}
-
-// Tells Google Mock where in the source code mock_obj is used in an
-// ON_CALL or EXPECT_CALL. In case mock_obj is leaked, this
-// information helps the user identify which object it is.
-void Mock::RegisterUseByOnCallOrExpectCall(const void* mock_obj,
- const char* file, int line)
- GTEST_LOCK_EXCLUDED_(internal::g_gmock_mutex) {
- internal::MutexLock l(&internal::g_gmock_mutex);
- MockObjectState& state = g_mock_object_registry.states()[mock_obj];
- if (state.first_used_file == nullptr) {
- state.first_used_file = file;
- state.first_used_line = line;
- const TestInfo* const test_info =
- UnitTest::GetInstance()->current_test_info();
- if (test_info != nullptr) {
- state.first_used_test_suite = test_info->test_suite_name();
- state.first_used_test = test_info->name();
- }
- }
-}
-
-// Unregisters a mock method; removes the owning mock object from the
-// registry when the last mock method associated with it has been
-// unregistered. This is called only in the destructor of
-// FunctionMockerBase.
-void Mock::UnregisterLocked(internal::UntypedFunctionMockerBase* mocker)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
- for (MockObjectRegistry::StateMap::iterator it =
- g_mock_object_registry.states().begin();
- it != g_mock_object_registry.states().end(); ++it) {
- FunctionMockers& mockers = it->second.function_mockers;
- if (mockers.erase(mocker) > 0) {
- // mocker was in mockers and has been just removed.
- if (mockers.empty()) {
- g_mock_object_registry.states().erase(it);
- }
- return;
- }
- }
-}
-
-// Clears all ON_CALL()s set on the given mock object.
-void Mock::ClearDefaultActionsLocked(void* mock_obj)
- GTEST_EXCLUSIVE_LOCK_REQUIRED_(internal::g_gmock_mutex) {
- internal::g_gmock_mutex.AssertHeld();
-
- if (g_mock_object_registry.states().count(mock_obj) == 0) {
- // No ON_CALL() was set on the given mock object.
- return;
- }
-
- // Clears the default actions for each mock method in the given mock
- // object.
- FunctionMockers& mockers =
- g_mock_object_registry.states()[mock_obj].function_mockers;
- for (FunctionMockers::const_iterator it = mockers.begin();
- it != mockers.end(); ++it) {
- (*it)->ClearDefaultActionsLocked();
- }
-
- // We don't clear the content of mockers, as they may still be
- // needed by VerifyAndClearExpectationsLocked().
-}
-
-Expectation::Expectation() {}
-
-Expectation::Expectation(
- const std::shared_ptr<internal::ExpectationBase>& an_expectation_base)
- : expectation_base_(an_expectation_base) {}
-
-Expectation::~Expectation() {}
-
-// Adds an expectation to a sequence.
-void Sequence::AddExpectation(const Expectation& expectation) const {
- if (*last_expectation_ != expectation) {
- if (last_expectation_->expectation_base() != nullptr) {
- expectation.expectation_base()->immediate_prerequisites_
- += *last_expectation_;
- }
- *last_expectation_ = expectation;
- }
-}
-
-// Creates the implicit sequence if there isn't one.
-InSequence::InSequence() {
- if (internal::g_gmock_implicit_sequence.get() == nullptr) {
- internal::g_gmock_implicit_sequence.set(new Sequence);
- sequence_created_ = true;
- } else {
- sequence_created_ = false;
- }
-}
-
-// Deletes the implicit sequence if it was created by the constructor
-// of this object.
-InSequence::~InSequence() {
- if (sequence_created_) {
- delete internal::g_gmock_implicit_sequence.get();
- internal::g_gmock_implicit_sequence.set(nullptr);
- }
-}
-
-} // namespace testing
-
-#ifdef _MSC_VER
-#if _MSC_VER == 1900
-# pragma warning(pop)
-#endif
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock.cc
deleted file mode 100644
index a20aed80fa..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock.cc
+++ /dev/null
@@ -1,223 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-
-GMOCK_DEFINE_bool_(catch_leaked_mocks, true,
- "true if and only if Google Mock should report leaked "
- "mock objects as failures.");
-
-GMOCK_DEFINE_string_(verbose, testing::internal::kWarningVerbosity,
- "Controls how verbose Google Mock's output is."
- " Valid values:\n"
- " info - prints all messages.\n"
- " warning - prints warnings and errors.\n"
- " error - prints errors only.");
-
-GMOCK_DEFINE_int32_(default_mock_behavior, 1,
- "Controls the default behavior of mocks."
- " Valid values:\n"
- " 0 - by default, mocks act as NiceMocks.\n"
- " 1 - by default, mocks act as NaggyMocks.\n"
- " 2 - by default, mocks act as StrictMocks.");
-
-namespace testing {
-namespace internal {
-
-// Parses a string as a command line flag. The string should have the
-// format "--gmock_flag=value". When def_optional is true, the
-// "=value" part can be omitted.
-//
-// Returns the value of the flag, or NULL if the parsing failed.
-static const char* ParseGoogleMockFlagValue(const char* str,
- const char* flag_name,
- bool def_optional) {
- // str and flag must not be NULL.
- if (str == nullptr || flag_name == nullptr) return nullptr;
-
- // The flag must start with "--gmock_".
- const std::string flag_name_str = std::string("--gmock_") + flag_name;
- const size_t flag_name_len = flag_name_str.length();
- if (strncmp(str, flag_name_str.c_str(), flag_name_len) != 0) return nullptr;
-
- // Skips the flag name.
- const char* flag_end = str + flag_name_len;
-
- // When def_optional is true, it's OK to not have a "=value" part.
- if (def_optional && (flag_end[0] == '\0')) {
- return flag_end;
- }
-
- // If def_optional is true and there are more characters after the
- // flag name, or if def_optional is false, there must be a '=' after
- // the flag name.
- if (flag_end[0] != '=') return nullptr;
-
- // Returns the string after "=".
- return flag_end + 1;
-}
-
-// Parses a string for a Google Mock bool flag, in the form of
-// "--gmock_flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-static bool ParseGoogleMockFlag(const char* str, const char* flag_name,
- bool* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseGoogleMockFlagValue(str, flag_name, true);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Converts the string value to a bool.
- *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
- return true;
-}
-
-// Parses a string for a Google Mock string flag, in the form of
-// "--gmock_flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-template <typename String>
-static bool ParseGoogleMockFlag(const char* str, const char* flag_name,
- String* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseGoogleMockFlagValue(str, flag_name, false);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Sets *value to the value of the flag.
- *value = value_str;
- return true;
-}
-
-static bool ParseGoogleMockFlag(const char* str, const char* flag_name,
- int32_t* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseGoogleMockFlagValue(str, flag_name, true);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Sets *value to the value of the flag.
- return ParseInt32(Message() << "The value of flag --" << flag_name, value_str,
- value);
-}
-
-// The internal implementation of InitGoogleMock().
-//
-// The type parameter CharType can be instantiated to either char or
-// wchar_t.
-template <typename CharType>
-void InitGoogleMockImpl(int* argc, CharType** argv) {
- // Makes sure Google Test is initialized. InitGoogleTest() is
- // idempotent, so it's fine if the user has already called it.
- InitGoogleTest(argc, argv);
- if (*argc <= 0) return;
-
- for (int i = 1; i != *argc; i++) {
- const std::string arg_string = StreamableToString(argv[i]);
- const char* const arg = arg_string.c_str();
-
- // Do we see a Google Mock flag?
- bool found_gmock_flag = false;
-
-#define GMOCK_INTERNAL_PARSE_FLAG(flag_name) \
- if (!found_gmock_flag) { \
- auto value = GMOCK_FLAG_GET(flag_name); \
- if (ParseGoogleMockFlag(arg, #flag_name, &value)) { \
- GMOCK_FLAG_SET(flag_name, value); \
- found_gmock_flag = true; \
- } \
- }
-
- GMOCK_INTERNAL_PARSE_FLAG(catch_leaked_mocks)
- GMOCK_INTERNAL_PARSE_FLAG(verbose)
- GMOCK_INTERNAL_PARSE_FLAG(default_mock_behavior)
-
- if (found_gmock_flag) {
- // Yes. Shift the remainder of the argv list left by one. Note
- // that argv has (*argc + 1) elements, the last one always being
- // NULL. The following loop moves the trailing NULL element as
- // well.
- for (int j = i; j != *argc; j++) {
- argv[j] = argv[j + 1];
- }
-
- // Decrements the argument count.
- (*argc)--;
-
- // We also need to decrement the iterator as we just removed
- // an element.
- i--;
- }
- }
-}
-
-} // namespace internal
-
-// Initializes Google Mock. This must be called before running the
-// tests. In particular, it parses a command line for the flags that
-// Google Mock recognizes. Whenever a Google Mock flag is seen, it is
-// removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Mock flag variables are
-// updated.
-//
-// Since Google Test is needed for Google Mock to work, this function
-// also initializes Google Test and parses its flags, if that hasn't
-// been done.
-GTEST_API_ void InitGoogleMock(int* argc, char** argv) {
- internal::InitGoogleMockImpl(argc, argv);
-}
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleMock(int* argc, wchar_t** argv) {
- internal::InitGoogleMockImpl(argc, argv);
-}
-
-// This overloaded version can be used on Arduino/embedded platforms where
-// there is no argc/argv.
-GTEST_API_ void InitGoogleMock() {
- // Since Arduino doesn't have a command line, fake out the argc/argv arguments
- int argc = 1;
- const auto arg0 = "dummy";
- char* argv0 = const_cast<char*>(arg0);
- char** argv = &argv0;
-
- internal::InitGoogleMockImpl(&argc, argv);
-}
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock_main.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock_main.cc
deleted file mode 100644
index 18c500f663..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/src/gmock_main.cc
+++ /dev/null
@@ -1,72 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include <iostream>
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-#if GTEST_OS_ESP8266 || GTEST_OS_ESP32
-#if GTEST_OS_ESP8266
-extern "C" {
-#endif
-void setup() {
- // Since Google Mock depends on Google Test, InitGoogleMock() is
- // also responsible for initializing Google Test. Therefore there's
- // no need for calling testing::InitGoogleTest() separately.
- testing::InitGoogleMock();
-}
-void loop() { RUN_ALL_TESTS(); }
-#if GTEST_OS_ESP8266
-}
-#endif
-
-#else
-
-// MS C++ compiler/linker has a bug on Windows (not on Windows CE), which
-// causes a link error when _tmain is defined in a static library and UNICODE
-// is enabled. For this reason instead of _tmain, main function is used on
-// Windows. See the following link to track the current status of this bug:
-// https://web.archive.org/web/20170912203238/connect.microsoft.com/VisualStudio/feedback/details/394464/wmain-link-error-in-the-static-library
-// // NOLINT
-#if GTEST_OS_WINDOWS_MOBILE
-# include <tchar.h> // NOLINT
-
-GTEST_API_ int _tmain(int argc, TCHAR** argv) {
-#else
-GTEST_API_ int main(int argc, char** argv) {
-#endif // GTEST_OS_WINDOWS_MOBILE
- std::cout << "Running main() from gmock_main.cc\n";
- // Since Google Mock depends on Google Test, InitGoogleMock() is
- // also responsible for initializing Google Test. Therefore there's
- // no need for calling testing::InitGoogleTest() separately.
- testing::InitGoogleMock(&argc, argv);
- return RUN_ALL_TESTS();
-}
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/BUILD.bazel b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/BUILD.bazel
deleted file mode 100644
index 004da12af6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/BUILD.bazel
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 2017 Google Inc.
-# All Rights Reserved.
-#
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Bazel Build for Google C++ Testing Framework(Google Test)-googlemock
-
-load("@rules_python//python:defs.bzl", "py_library", "py_test")
-
-licenses(["notice"])
-
-# Tests for GMock itself
-cc_test(
- name = "gmock_all_test",
- size = "small",
- srcs = glob(include = ["gmock-*.cc"]),
- linkopts = select({
- "//:qnx": [],
- "//:windows": [],
- "//conditions:default": ["-pthread"],
- }),
- deps = ["//:gtest"],
-)
-
-# Python tests
-py_library(
- name = "gmock_test_utils",
- testonly = 1,
- srcs = ["gmock_test_utils.py"],
- deps = [
- "//googletest/test:gtest_test_utils",
- ],
-)
-
-cc_binary(
- name = "gmock_leak_test_",
- testonly = 1,
- srcs = ["gmock_leak_test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "gmock_leak_test",
- size = "medium",
- srcs = ["gmock_leak_test.py"],
- data = [
- ":gmock_leak_test_",
- ":gmock_test_utils",
- ],
- tags = [
- "no_test_msvc2015",
- "no_test_msvc2017",
- ],
-)
-
-cc_test(
- name = "gmock_link_test",
- size = "small",
- srcs = [
- "gmock_link2_test.cc",
- "gmock_link_test.cc",
- "gmock_link_test.h",
- ],
- deps = ["//:gtest_main"],
-)
-
-cc_binary(
- name = "gmock_output_test_",
- srcs = ["gmock_output_test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "gmock_output_test",
- size = "medium",
- srcs = ["gmock_output_test.py"],
- data = [
- ":gmock_output_test_",
- ":gmock_output_test_golden.txt",
- ],
- tags = [
- "no_test_msvc2015",
- "no_test_msvc2017",
- ],
- deps = [":gmock_test_utils"],
-)
-
-cc_test(
- name = "gmock_test",
- size = "small",
- srcs = ["gmock_test.cc"],
- deps = ["//:gtest_main"],
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-actions_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-actions_test.cc
deleted file mode 100644
index fc628937c1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-actions_test.cc
+++ /dev/null
@@ -1,1583 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in actions.
-
-// Silence C4100 (unreferenced formal parameter) for MSVC
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#if _MSC_VER == 1900
-// and silence C4800 (C4800: 'int *const ': forcing value
-// to bool 'true' or 'false') for MSVC 15
-# pragma warning(disable:4800)
-#endif
-#endif
-
-#include "gmock/gmock-actions.h"
-#include <algorithm>
-#include <iterator>
-#include <memory>
-#include <string>
-#include <type_traits>
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace {
-
-using ::testing::_;
-using ::testing::Action;
-using ::testing::ActionInterface;
-using ::testing::Assign;
-using ::testing::ByMove;
-using ::testing::ByRef;
-using ::testing::DefaultValue;
-using ::testing::DoAll;
-using ::testing::DoDefault;
-using ::testing::IgnoreResult;
-using ::testing::Invoke;
-using ::testing::InvokeWithoutArgs;
-using ::testing::MakePolymorphicAction;
-using ::testing::PolymorphicAction;
-using ::testing::Return;
-using ::testing::ReturnNew;
-using ::testing::ReturnNull;
-using ::testing::ReturnRef;
-using ::testing::ReturnRefOfCopy;
-using ::testing::ReturnRoundRobin;
-using ::testing::SetArgPointee;
-using ::testing::SetArgumentPointee;
-using ::testing::Unused;
-using ::testing::WithArgs;
-using ::testing::internal::BuiltInDefaultValue;
-
-#if !GTEST_OS_WINDOWS_MOBILE
-using ::testing::SetErrnoAndReturn;
-#endif
-
-// Tests that BuiltInDefaultValue<T*>::Get() returns NULL.
-TEST(BuiltInDefaultValueTest, IsNullForPointerTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Get() == nullptr);
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Get() == nullptr);
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Get() == nullptr);
-}
-
-// Tests that BuiltInDefaultValue<T*>::Exists() return true.
-TEST(BuiltInDefaultValueTest, ExistsForPointerTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<int*>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<const char*>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<void*>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T>::Get() returns 0 when T is a
-// built-in numeric type.
-TEST(BuiltInDefaultValueTest, IsZeroForNumericTypes) {
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned char>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<signed char>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<char>::Get());
-#if GMOCK_WCHAR_T_IS_NATIVE_
-#if !defined(__WCHAR_UNSIGNED__)
- EXPECT_EQ(0, BuiltInDefaultValue<wchar_t>::Get());
-#else
- EXPECT_EQ(0U, BuiltInDefaultValue<wchar_t>::Get());
-#endif
-#endif
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned short>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<signed short>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<short>::Get()); // NOLINT
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned int>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<signed int>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<int>::Get());
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<signed long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<long>::Get()); // NOLINT
- EXPECT_EQ(0U, BuiltInDefaultValue<unsigned long long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<signed long long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<long long>::Get()); // NOLINT
- EXPECT_EQ(0, BuiltInDefaultValue<float>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<double>::Get());
-}
-
-// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
-// built-in numeric type.
-TEST(BuiltInDefaultValueTest, ExistsForNumericTypes) {
- EXPECT_TRUE(BuiltInDefaultValue<unsigned char>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<signed char>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<char>::Exists());
-#if GMOCK_WCHAR_T_IS_NATIVE_
- EXPECT_TRUE(BuiltInDefaultValue<wchar_t>::Exists());
-#endif
- EXPECT_TRUE(BuiltInDefaultValue<unsigned short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<signed short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<short>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<unsigned int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<signed int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<int>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<unsigned long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<signed long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<unsigned long long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<signed long long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<long long>::Exists()); // NOLINT
- EXPECT_TRUE(BuiltInDefaultValue<float>::Exists());
- EXPECT_TRUE(BuiltInDefaultValue<double>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<bool>::Get() returns false.
-TEST(BuiltInDefaultValueTest, IsFalseForBool) {
- EXPECT_FALSE(BuiltInDefaultValue<bool>::Get());
-}
-
-// Tests that BuiltInDefaultValue<bool>::Exists() returns true.
-TEST(BuiltInDefaultValueTest, BoolExists) {
- EXPECT_TRUE(BuiltInDefaultValue<bool>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T>::Get() returns "" when T is a
-// string type.
-TEST(BuiltInDefaultValueTest, IsEmptyStringForString) {
- EXPECT_EQ("", BuiltInDefaultValue< ::std::string>::Get());
-}
-
-// Tests that BuiltInDefaultValue<T>::Exists() returns true when T is a
-// string type.
-TEST(BuiltInDefaultValueTest, ExistsForString) {
- EXPECT_TRUE(BuiltInDefaultValue< ::std::string>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<const T>::Get() returns the same
-// value as BuiltInDefaultValue<T>::Get() does.
-TEST(BuiltInDefaultValueTest, WorksForConstTypes) {
- EXPECT_EQ("", BuiltInDefaultValue<const std::string>::Get());
- EXPECT_EQ(0, BuiltInDefaultValue<const int>::Get());
- EXPECT_TRUE(BuiltInDefaultValue<char* const>::Get() == nullptr);
- EXPECT_FALSE(BuiltInDefaultValue<const bool>::Get());
-}
-
-// A type that's default constructible.
-class MyDefaultConstructible {
- public:
- MyDefaultConstructible() : value_(42) {}
-
- int value() const { return value_; }
-
- private:
- int value_;
-};
-
-// A type that's not default constructible.
-class MyNonDefaultConstructible {
- public:
- // Does not have a default ctor.
- explicit MyNonDefaultConstructible(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
-
- private:
- int value_;
-};
-
-
-TEST(BuiltInDefaultValueTest, ExistsForDefaultConstructibleType) {
- EXPECT_TRUE(BuiltInDefaultValue<MyDefaultConstructible>::Exists());
-}
-
-TEST(BuiltInDefaultValueTest, IsDefaultConstructedForDefaultConstructibleType) {
- EXPECT_EQ(42, BuiltInDefaultValue<MyDefaultConstructible>::Get().value());
-}
-
-
-TEST(BuiltInDefaultValueTest, DoesNotExistForNonDefaultConstructibleType) {
- EXPECT_FALSE(BuiltInDefaultValue<MyNonDefaultConstructible>::Exists());
-}
-
-// Tests that BuiltInDefaultValue<T&>::Get() aborts the program.
-TEST(BuiltInDefaultValueDeathTest, IsUndefinedForReferences) {
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<int&>::Get();
- }, "");
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<const char&>::Get();
- }, "");
-}
-
-TEST(BuiltInDefaultValueDeathTest, IsUndefinedForNonDefaultConstructibleType) {
- EXPECT_DEATH_IF_SUPPORTED({
- BuiltInDefaultValue<MyNonDefaultConstructible>::Get();
- }, "");
-}
-
-// Tests that DefaultValue<T>::IsSet() is false initially.
-TEST(DefaultValueTest, IsInitiallyUnset) {
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible>::IsSet());
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
-}
-
-// Tests that DefaultValue<T> can be set and then unset.
-TEST(DefaultValueTest, CanBeSetAndUnset) {
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
-
- DefaultValue<int>::Set(1);
- DefaultValue<const MyNonDefaultConstructible>::Set(
- MyNonDefaultConstructible(42));
-
- EXPECT_EQ(1, DefaultValue<int>::Get());
- EXPECT_EQ(42, DefaultValue<const MyNonDefaultConstructible>::Get().value());
-
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_TRUE(DefaultValue<const MyNonDefaultConstructible>::Exists());
-
- DefaultValue<int>::Clear();
- DefaultValue<const MyNonDefaultConstructible>::Clear();
-
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::IsSet());
-
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<const MyNonDefaultConstructible>::Exists());
-}
-
-// Tests that DefaultValue<T>::Get() returns the
-// BuiltInDefaultValue<T>::Get() when DefaultValue<T>::IsSet() is
-// false.
-TEST(DefaultValueDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
- EXPECT_FALSE(DefaultValue<int>::IsSet());
- EXPECT_TRUE(DefaultValue<int>::Exists());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::IsSet());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible>::Exists());
-
- EXPECT_EQ(0, DefaultValue<int>::Get());
-
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<MyNonDefaultConstructible>::Get();
- }, "");
-}
-
-TEST(DefaultValueTest, GetWorksForMoveOnlyIfSet) {
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Get() == nullptr);
- DefaultValue<std::unique_ptr<int>>::SetFactory([] {
- return std::unique_ptr<int>(new int(42));
- });
- EXPECT_TRUE(DefaultValue<std::unique_ptr<int>>::Exists());
- std::unique_ptr<int> i = DefaultValue<std::unique_ptr<int>>::Get();
- EXPECT_EQ(42, *i);
-}
-
-// Tests that DefaultValue<void>::Get() returns void.
-TEST(DefaultValueTest, GetWorksForVoid) {
- return DefaultValue<void>::Get();
-}
-
-// Tests using DefaultValue with a reference type.
-
-// Tests that DefaultValue<T&>::IsSet() is false initially.
-TEST(DefaultValueOfReferenceTest, IsInitiallyUnset) {
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::IsSet());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
-}
-
-// Tests that DefaultValue<T&>::Exists is false initiallly.
-TEST(DefaultValueOfReferenceTest, IsInitiallyNotExisting) {
- EXPECT_FALSE(DefaultValue<int&>::Exists());
- EXPECT_FALSE(DefaultValue<MyDefaultConstructible&>::Exists());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
-}
-
-// Tests that DefaultValue<T&> can be set and then unset.
-TEST(DefaultValueOfReferenceTest, CanBeSetAndUnset) {
- int n = 1;
- DefaultValue<const int&>::Set(n);
- MyNonDefaultConstructible x(42);
- DefaultValue<MyNonDefaultConstructible&>::Set(x);
-
- EXPECT_TRUE(DefaultValue<const int&>::Exists());
- EXPECT_TRUE(DefaultValue<MyNonDefaultConstructible&>::Exists());
-
- EXPECT_EQ(&n, &(DefaultValue<const int&>::Get()));
- EXPECT_EQ(&x, &(DefaultValue<MyNonDefaultConstructible&>::Get()));
-
- DefaultValue<const int&>::Clear();
- DefaultValue<MyNonDefaultConstructible&>::Clear();
-
- EXPECT_FALSE(DefaultValue<const int&>::Exists());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::Exists());
-
- EXPECT_FALSE(DefaultValue<const int&>::IsSet());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
-}
-
-// Tests that DefaultValue<T&>::Get() returns the
-// BuiltInDefaultValue<T&>::Get() when DefaultValue<T&>::IsSet() is
-// false.
-TEST(DefaultValueOfReferenceDeathTest, GetReturnsBuiltInDefaultValueWhenUnset) {
- EXPECT_FALSE(DefaultValue<int&>::IsSet());
- EXPECT_FALSE(DefaultValue<MyNonDefaultConstructible&>::IsSet());
-
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<int&>::Get();
- }, "");
- EXPECT_DEATH_IF_SUPPORTED({
- DefaultValue<MyNonDefaultConstructible>::Get();
- }, "");
-}
-
-// Tests that ActionInterface can be implemented by defining the
-// Perform method.
-
-typedef int MyGlobalFunction(bool, int);
-
-class MyActionImpl : public ActionInterface<MyGlobalFunction> {
- public:
- int Perform(const std::tuple<bool, int>& args) override {
- return std::get<0>(args) ? std::get<1>(args) : 0;
- }
-};
-
-TEST(ActionInterfaceTest, CanBeImplementedByDefiningPerform) {
- MyActionImpl my_action_impl;
- (void)my_action_impl;
-}
-
-TEST(ActionInterfaceTest, MakeAction) {
- Action<MyGlobalFunction> action = MakeAction(new MyActionImpl);
-
- // When exercising the Perform() method of Action<F>, we must pass
- // it a tuple whose size and type are compatible with F's argument
- // types. For example, if F is int(), then Perform() takes a
- // 0-tuple; if F is void(bool, int), then Perform() takes a
- // std::tuple<bool, int>, and so on.
- EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
-}
-
-// Tests that Action<F> can be constructed from a pointer to
-// ActionInterface<F>.
-TEST(ActionTest, CanBeConstructedFromActionInterface) {
- Action<MyGlobalFunction> action(new MyActionImpl);
-}
-
-// Tests that Action<F> delegates actual work to ActionInterface<F>.
-TEST(ActionTest, DelegatesWorkToActionInterface) {
- const Action<MyGlobalFunction> action(new MyActionImpl);
-
- EXPECT_EQ(5, action.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, action.Perform(std::make_tuple(false, 1)));
-}
-
-// Tests that Action<F> can be copied.
-TEST(ActionTest, IsCopyable) {
- Action<MyGlobalFunction> a1(new MyActionImpl);
- Action<MyGlobalFunction> a2(a1); // Tests the copy constructor.
-
- // a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
-
- // a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
-
- a2 = a1; // Tests the assignment operator.
-
- // a1 should continue to work after being copied from.
- EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 1)));
-
- // a2 should work like the action it was copied from.
- EXPECT_EQ(5, a2.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, a2.Perform(std::make_tuple(false, 1)));
-}
-
-// Tests that an Action<From> object can be converted to a
-// compatible Action<To> object.
-
-class IsNotZero : public ActionInterface<bool(int)> { // NOLINT
- public:
- bool Perform(const std::tuple<int>& arg) override {
- return std::get<0>(arg) != 0;
- }
-};
-
-TEST(ActionTest, CanBeConvertedToOtherActionType) {
- const Action<bool(int)> a1(new IsNotZero); // NOLINT
- const Action<int(char)> a2 = Action<int(char)>(a1); // NOLINT
- EXPECT_EQ(1, a2.Perform(std::make_tuple('a')));
- EXPECT_EQ(0, a2.Perform(std::make_tuple('\0')));
-}
-
-// The following two classes are for testing MakePolymorphicAction().
-
-// Implements a polymorphic action that returns the second of the
-// arguments it receives.
-class ReturnSecondArgumentAction {
- public:
- // We want to verify that MakePolymorphicAction() can work with a
- // polymorphic action whose Perform() method template is either
- // const or not. This lets us verify the non-const case.
- template <typename Result, typename ArgumentTuple>
- Result Perform(const ArgumentTuple& args) {
- return std::get<1>(args);
- }
-};
-
-// Implements a polymorphic action that can be used in a nullary
-// function to return 0.
-class ReturnZeroFromNullaryFunctionAction {
- public:
- // For testing that MakePolymorphicAction() works when the
- // implementation class' Perform() method template takes only one
- // template parameter.
- //
- // We want to verify that MakePolymorphicAction() can work with a
- // polymorphic action whose Perform() method template is either
- // const or not. This lets us verify the const case.
- template <typename Result>
- Result Perform(const std::tuple<>&) const {
- return 0;
- }
-};
-
-// These functions verify that MakePolymorphicAction() returns a
-// PolymorphicAction<T> where T is the argument's type.
-
-PolymorphicAction<ReturnSecondArgumentAction> ReturnSecondArgument() {
- return MakePolymorphicAction(ReturnSecondArgumentAction());
-}
-
-PolymorphicAction<ReturnZeroFromNullaryFunctionAction>
-ReturnZeroFromNullaryFunction() {
- return MakePolymorphicAction(ReturnZeroFromNullaryFunctionAction());
-}
-
-// Tests that MakePolymorphicAction() turns a polymorphic action
-// implementation class into a polymorphic action.
-TEST(MakePolymorphicActionTest, ConstructsActionFromImpl) {
- Action<int(bool, int, double)> a1 = ReturnSecondArgument(); // NOLINT
- EXPECT_EQ(5, a1.Perform(std::make_tuple(false, 5, 2.0)));
-}
-
-// Tests that MakePolymorphicAction() works when the implementation
-// class' Perform() method template has only one template parameter.
-TEST(MakePolymorphicActionTest, WorksWhenPerformHasOneTemplateParameter) {
- Action<int()> a1 = ReturnZeroFromNullaryFunction();
- EXPECT_EQ(0, a1.Perform(std::make_tuple()));
-
- Action<void*()> a2 = ReturnZeroFromNullaryFunction();
- EXPECT_TRUE(a2.Perform(std::make_tuple()) == nullptr);
-}
-
-// Tests that Return() works as an action for void-returning
-// functions.
-TEST(ReturnTest, WorksForVoid) {
- const Action<void(int)> ret = Return(); // NOLINT
- return ret.Perform(std::make_tuple(1));
-}
-
-// Tests that Return(v) returns v.
-TEST(ReturnTest, ReturnsGivenValue) {
- Action<int()> ret = Return(1); // NOLINT
- EXPECT_EQ(1, ret.Perform(std::make_tuple()));
-
- ret = Return(-5);
- EXPECT_EQ(-5, ret.Perform(std::make_tuple()));
-}
-
-// Tests that Return("string literal") works.
-TEST(ReturnTest, AcceptsStringLiteral) {
- Action<const char*()> a1 = Return("Hello");
- EXPECT_STREQ("Hello", a1.Perform(std::make_tuple()));
-
- Action<std::string()> a2 = Return("world");
- EXPECT_EQ("world", a2.Perform(std::make_tuple()));
-}
-
-// Test struct which wraps a vector of integers. Used in
-// 'SupportsWrapperReturnType' test.
-struct IntegerVectorWrapper {
- std::vector<int> * v;
- IntegerVectorWrapper(std::vector<int>& _v) : v(&_v) {} // NOLINT
-};
-
-// Tests that Return() works when return type is a wrapper type.
-TEST(ReturnTest, SupportsWrapperReturnType) {
- // Initialize vector of integers.
- std::vector<int> v;
- for (int i = 0; i < 5; ++i) v.push_back(i);
-
- // Return() called with 'v' as argument. The Action will return the same data
- // as 'v' (copy) but it will be wrapped in an IntegerVectorWrapper.
- Action<IntegerVectorWrapper()> a = Return(v);
- const std::vector<int>& result = *(a.Perform(std::make_tuple()).v);
- EXPECT_THAT(result, ::testing::ElementsAre(0, 1, 2, 3, 4));
-}
-
-// Tests that Return(v) is covaraint.
-
-struct Base {
- bool operator==(const Base&) { return true; }
-};
-
-struct Derived : public Base {
- bool operator==(const Derived&) { return true; }
-};
-
-TEST(ReturnTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base*()> ret = Return(&base);
- EXPECT_EQ(&base, ret.Perform(std::make_tuple()));
-
- ret = Return(&derived);
- EXPECT_EQ(&derived, ret.Perform(std::make_tuple()));
-}
-
-// Tests that the type of the value passed into Return is converted into T
-// when the action is cast to Action<T(...)> rather than when the action is
-// performed. See comments on testing::internal::ReturnAction in
-// gmock-actions.h for more information.
-class FromType {
- public:
- explicit FromType(bool* is_converted) : converted_(is_converted) {}
- bool* converted() const { return converted_; }
-
- private:
- bool* const converted_;
-};
-
-class ToType {
- public:
- // Must allow implicit conversion due to use in ImplicitCast_<T>.
- ToType(const FromType& x) { *x.converted() = true; } // NOLINT
-};
-
-TEST(ReturnTest, ConvertsArgumentWhenConverted) {
- bool converted = false;
- FromType x(&converted);
- Action<ToType()> action(Return(x));
- EXPECT_TRUE(converted) << "Return must convert its argument in its own "
- << "conversion operator.";
- converted = false;
- action.Perform(std::tuple<>());
- EXPECT_FALSE(converted) << "Action must NOT convert its argument "
- << "when performed.";
-}
-
-class DestinationType {};
-
-class SourceType {
- public:
- // Note: a non-const typecast operator.
- operator DestinationType() { return DestinationType(); }
-};
-
-TEST(ReturnTest, CanConvertArgumentUsingNonConstTypeCastOperator) {
- SourceType s;
- Action<DestinationType()> action(Return(s));
-}
-
-// Tests that ReturnNull() returns NULL in a pointer-returning function.
-TEST(ReturnNullTest, WorksInPointerReturningFunction) {
- const Action<int*()> a1 = ReturnNull();
- EXPECT_TRUE(a1.Perform(std::make_tuple()) == nullptr);
-
- const Action<const char*(bool)> a2 = ReturnNull(); // NOLINT
- EXPECT_TRUE(a2.Perform(std::make_tuple(true)) == nullptr);
-}
-
-// Tests that ReturnNull() returns NULL for shared_ptr and unique_ptr returning
-// functions.
-TEST(ReturnNullTest, WorksInSmartPointerReturningFunction) {
- const Action<std::unique_ptr<const int>()> a1 = ReturnNull();
- EXPECT_TRUE(a1.Perform(std::make_tuple()) == nullptr);
-
- const Action<std::shared_ptr<int>(std::string)> a2 = ReturnNull();
- EXPECT_TRUE(a2.Perform(std::make_tuple("foo")) == nullptr);
-}
-
-// Tests that ReturnRef(v) works for reference types.
-TEST(ReturnRefTest, WorksForReference) {
- const int n = 0;
- const Action<const int&(bool)> ret = ReturnRef(n); // NOLINT
-
- EXPECT_EQ(&n, &ret.Perform(std::make_tuple(true)));
-}
-
-// Tests that ReturnRef(v) is covariant.
-TEST(ReturnRefTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base&()> a = ReturnRef(base);
- EXPECT_EQ(&base, &a.Perform(std::make_tuple()));
-
- a = ReturnRef(derived);
- EXPECT_EQ(&derived, &a.Perform(std::make_tuple()));
-}
-
-template <typename T, typename = decltype(ReturnRef(std::declval<T&&>()))>
-bool CanCallReturnRef(T&&) { return true; }
-bool CanCallReturnRef(Unused) { return false; }
-
-// Tests that ReturnRef(v) is working with non-temporaries (T&)
-TEST(ReturnRefTest, WorksForNonTemporary) {
- int scalar_value = 123;
- EXPECT_TRUE(CanCallReturnRef(scalar_value));
-
- std::string non_scalar_value("ABC");
- EXPECT_TRUE(CanCallReturnRef(non_scalar_value));
-
- const int const_scalar_value{321};
- EXPECT_TRUE(CanCallReturnRef(const_scalar_value));
-
- const std::string const_non_scalar_value("CBA");
- EXPECT_TRUE(CanCallReturnRef(const_non_scalar_value));
-}
-
-// Tests that ReturnRef(v) is not working with temporaries (T&&)
-TEST(ReturnRefTest, DoesNotWorkForTemporary) {
- auto scalar_value = []() -> int { return 123; };
- EXPECT_FALSE(CanCallReturnRef(scalar_value()));
-
- auto non_scalar_value = []() -> std::string { return "ABC"; };
- EXPECT_FALSE(CanCallReturnRef(non_scalar_value()));
-
- // cannot use here callable returning "const scalar type",
- // because such const for scalar return type is ignored
- EXPECT_FALSE(CanCallReturnRef(static_cast<const int>(321)));
-
- auto const_non_scalar_value = []() -> const std::string { return "CBA"; };
- EXPECT_FALSE(CanCallReturnRef(const_non_scalar_value()));
-}
-
-// Tests that ReturnRefOfCopy(v) works for reference types.
-TEST(ReturnRefOfCopyTest, WorksForReference) {
- int n = 42;
- const Action<const int&()> ret = ReturnRefOfCopy(n);
-
- EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
- EXPECT_EQ(42, ret.Perform(std::make_tuple()));
-
- n = 43;
- EXPECT_NE(&n, &ret.Perform(std::make_tuple()));
- EXPECT_EQ(42, ret.Perform(std::make_tuple()));
-}
-
-// Tests that ReturnRefOfCopy(v) is covariant.
-TEST(ReturnRefOfCopyTest, IsCovariant) {
- Base base;
- Derived derived;
- Action<Base&()> a = ReturnRefOfCopy(base);
- EXPECT_NE(&base, &a.Perform(std::make_tuple()));
-
- a = ReturnRefOfCopy(derived);
- EXPECT_NE(&derived, &a.Perform(std::make_tuple()));
-}
-
-// Tests that ReturnRoundRobin(v) works with initializer lists
-TEST(ReturnRoundRobinTest, WorksForInitList) {
- Action<int()> ret = ReturnRoundRobin({1, 2, 3});
-
- EXPECT_EQ(1, ret.Perform(std::make_tuple()));
- EXPECT_EQ(2, ret.Perform(std::make_tuple()));
- EXPECT_EQ(3, ret.Perform(std::make_tuple()));
- EXPECT_EQ(1, ret.Perform(std::make_tuple()));
- EXPECT_EQ(2, ret.Perform(std::make_tuple()));
- EXPECT_EQ(3, ret.Perform(std::make_tuple()));
-}
-
-// Tests that ReturnRoundRobin(v) works with vectors
-TEST(ReturnRoundRobinTest, WorksForVector) {
- std::vector<double> v = {4.4, 5.5, 6.6};
- Action<double()> ret = ReturnRoundRobin(v);
-
- EXPECT_EQ(4.4, ret.Perform(std::make_tuple()));
- EXPECT_EQ(5.5, ret.Perform(std::make_tuple()));
- EXPECT_EQ(6.6, ret.Perform(std::make_tuple()));
- EXPECT_EQ(4.4, ret.Perform(std::make_tuple()));
- EXPECT_EQ(5.5, ret.Perform(std::make_tuple()));
- EXPECT_EQ(6.6, ret.Perform(std::make_tuple()));
-}
-
-// Tests that DoDefault() does the default action for the mock method.
-
-class MockClass {
- public:
- MockClass() {}
-
- MOCK_METHOD1(IntFunc, int(bool flag)); // NOLINT
- MOCK_METHOD0(Foo, MyNonDefaultConstructible());
- MOCK_METHOD0(MakeUnique, std::unique_ptr<int>());
- MOCK_METHOD0(MakeUniqueBase, std::unique_ptr<Base>());
- MOCK_METHOD0(MakeVectorUnique, std::vector<std::unique_ptr<int>>());
- MOCK_METHOD1(TakeUnique, int(std::unique_ptr<int>));
- MOCK_METHOD2(TakeUnique,
- int(const std::unique_ptr<int>&, std::unique_ptr<int>));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockClass);
-};
-
-// Tests that DoDefault() returns the built-in default value for the
-// return type by default.
-TEST(DoDefaultTest, ReturnsBuiltInDefaultValueByDefault) {
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(0, mock.IntFunc(true));
-}
-
-// Tests that DoDefault() throws (when exceptions are enabled) or aborts
-// the process when there is no built-in default value for the return type.
-TEST(DoDefaultDeathTest, DiesForUnknowType) {
- MockClass mock;
- EXPECT_CALL(mock, Foo())
- .WillRepeatedly(DoDefault());
-#if GTEST_HAS_EXCEPTIONS
- EXPECT_ANY_THROW(mock.Foo());
-#else
- EXPECT_DEATH_IF_SUPPORTED({
- mock.Foo();
- }, "");
-#endif
-}
-
-// Tests that using DoDefault() inside a composite action leads to a
-// run-time error.
-
-void VoidFunc(bool /* flag */) {}
-
-TEST(DoDefaultDeathTest, DiesIfUsedInCompositeAction) {
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillRepeatedly(DoAll(Invoke(VoidFunc),
- DoDefault()));
-
- // Ideally we should verify the error message as well. Sadly,
- // EXPECT_DEATH() can only capture stderr, while Google Mock's
- // errors are printed on stdout. Therefore we have to settle for
- // not verifying the message.
- EXPECT_DEATH_IF_SUPPORTED({
- mock.IntFunc(true);
- }, "");
-}
-
-// Tests that DoDefault() returns the default value set by
-// DefaultValue<T>::Set() when it's not overridden by an ON_CALL().
-TEST(DoDefaultTest, ReturnsUserSpecifiedPerTypeDefaultValueWhenThereIsOne) {
- DefaultValue<int>::Set(1);
- MockClass mock;
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(1, mock.IntFunc(false));
- DefaultValue<int>::Clear();
-}
-
-// Tests that DoDefault() does the action specified by ON_CALL().
-TEST(DoDefaultTest, DoesWhatOnCallSpecifies) {
- MockClass mock;
- ON_CALL(mock, IntFunc(_))
- .WillByDefault(Return(2));
- EXPECT_CALL(mock, IntFunc(_))
- .WillOnce(DoDefault());
- EXPECT_EQ(2, mock.IntFunc(false));
-}
-
-// Tests that using DoDefault() in ON_CALL() leads to a run-time failure.
-TEST(DoDefaultTest, CannotBeUsedInOnCall) {
- MockClass mock;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(mock, IntFunc(_))
- .WillByDefault(DoDefault());
- }, "DoDefault() cannot be used in ON_CALL()");
-}
-
-// Tests that SetArgPointee<N>(v) sets the variable pointed to by
-// the N-th (0-based) argument to v.
-TEST(SetArgPointeeTest, SetsTheNthPointee) {
- typedef void MyFunction(bool, int*, char*);
- Action<MyFunction> a = SetArgPointee<1>(2);
-
- int n = 0;
- char ch = '\0';
- a.Perform(std::make_tuple(true, &n, &ch));
- EXPECT_EQ(2, n);
- EXPECT_EQ('\0', ch);
-
- a = SetArgPointee<2>('a');
- n = 0;
- ch = '\0';
- a.Perform(std::make_tuple(true, &n, &ch));
- EXPECT_EQ(0, n);
- EXPECT_EQ('a', ch);
-}
-
-// Tests that SetArgPointee<N>() accepts a string literal.
-TEST(SetArgPointeeTest, AcceptsStringLiteral) {
- typedef void MyFunction(std::string*, const char**);
- Action<MyFunction> a = SetArgPointee<0>("hi");
- std::string str;
- const char* ptr = nullptr;
- a.Perform(std::make_tuple(&str, &ptr));
- EXPECT_EQ("hi", str);
- EXPECT_TRUE(ptr == nullptr);
-
- a = SetArgPointee<1>("world");
- str = "";
- a.Perform(std::make_tuple(&str, &ptr));
- EXPECT_EQ("", str);
- EXPECT_STREQ("world", ptr);
-}
-
-TEST(SetArgPointeeTest, AcceptsWideStringLiteral) {
- typedef void MyFunction(const wchar_t**);
- Action<MyFunction> a = SetArgPointee<0>(L"world");
- const wchar_t* ptr = nullptr;
- a.Perform(std::make_tuple(&ptr));
- EXPECT_STREQ(L"world", ptr);
-
-# if GTEST_HAS_STD_WSTRING
-
- typedef void MyStringFunction(std::wstring*);
- Action<MyStringFunction> a2 = SetArgPointee<0>(L"world");
- std::wstring str = L"";
- a2.Perform(std::make_tuple(&str));
- EXPECT_EQ(L"world", str);
-
-# endif
-}
-
-// Tests that SetArgPointee<N>() accepts a char pointer.
-TEST(SetArgPointeeTest, AcceptsCharPointer) {
- typedef void MyFunction(bool, std::string*, const char**);
- const char* const hi = "hi";
- Action<MyFunction> a = SetArgPointee<1>(hi);
- std::string str;
- const char* ptr = nullptr;
- a.Perform(std::make_tuple(true, &str, &ptr));
- EXPECT_EQ("hi", str);
- EXPECT_TRUE(ptr == nullptr);
-
- char world_array[] = "world";
- char* const world = world_array;
- a = SetArgPointee<2>(world);
- str = "";
- a.Perform(std::make_tuple(true, &str, &ptr));
- EXPECT_EQ("", str);
- EXPECT_EQ(world, ptr);
-}
-
-TEST(SetArgPointeeTest, AcceptsWideCharPointer) {
- typedef void MyFunction(bool, const wchar_t**);
- const wchar_t* const hi = L"hi";
- Action<MyFunction> a = SetArgPointee<1>(hi);
- const wchar_t* ptr = nullptr;
- a.Perform(std::make_tuple(true, &ptr));
- EXPECT_EQ(hi, ptr);
-
-# if GTEST_HAS_STD_WSTRING
-
- typedef void MyStringFunction(bool, std::wstring*);
- wchar_t world_array[] = L"world";
- wchar_t* const world = world_array;
- Action<MyStringFunction> a2 = SetArgPointee<1>(world);
- std::wstring str;
- a2.Perform(std::make_tuple(true, &str));
- EXPECT_EQ(world_array, str);
-# endif
-}
-
-// Tests that SetArgumentPointee<N>(v) sets the variable pointed to by
-// the N-th (0-based) argument to v.
-TEST(SetArgumentPointeeTest, SetsTheNthPointee) {
- typedef void MyFunction(bool, int*, char*);
- Action<MyFunction> a = SetArgumentPointee<1>(2);
-
- int n = 0;
- char ch = '\0';
- a.Perform(std::make_tuple(true, &n, &ch));
- EXPECT_EQ(2, n);
- EXPECT_EQ('\0', ch);
-
- a = SetArgumentPointee<2>('a');
- n = 0;
- ch = '\0';
- a.Perform(std::make_tuple(true, &n, &ch));
- EXPECT_EQ(0, n);
- EXPECT_EQ('a', ch);
-}
-
-// Sample functions and functors for testing Invoke() and etc.
-int Nullary() { return 1; }
-
-class NullaryFunctor {
- public:
- int operator()() { return 2; }
-};
-
-bool g_done = false;
-void VoidNullary() { g_done = true; }
-
-class VoidNullaryFunctor {
- public:
- void operator()() { g_done = true; }
-};
-
-short Short(short n) { return n; } // NOLINT
-char Char(char ch) { return ch; }
-
-const char* CharPtr(const char* s) { return s; }
-
-bool Unary(int x) { return x < 0; }
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-void VoidBinary(int, char) { g_done = true; }
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-class Foo {
- public:
- Foo() : value_(123) {}
-
- int Nullary() const { return value_; }
-
- private:
- int value_;
-};
-
-// Tests InvokeWithoutArgs(function).
-TEST(InvokeWithoutArgsTest, Function) {
- // As an action that takes one argument.
- Action<int(int)> a = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(std::make_tuple(2)));
-
- // As an action that takes two arguments.
- Action<int(int, double)> a2 = InvokeWithoutArgs(Nullary); // NOLINT
- EXPECT_EQ(1, a2.Perform(std::make_tuple(2, 3.5)));
-
- // As an action that returns void.
- Action<void(int)> a3 = InvokeWithoutArgs(VoidNullary); // NOLINT
- g_done = false;
- a3.Perform(std::make_tuple(1));
- EXPECT_TRUE(g_done);
-}
-
-// Tests InvokeWithoutArgs(functor).
-TEST(InvokeWithoutArgsTest, Functor) {
- // As an action that takes no argument.
- Action<int()> a = InvokeWithoutArgs(NullaryFunctor()); // NOLINT
- EXPECT_EQ(2, a.Perform(std::make_tuple()));
-
- // As an action that takes three arguments.
- Action<int(int, double, char)> a2 = // NOLINT
- InvokeWithoutArgs(NullaryFunctor());
- EXPECT_EQ(2, a2.Perform(std::make_tuple(3, 3.5, 'a')));
-
- // As an action that returns void.
- Action<void()> a3 = InvokeWithoutArgs(VoidNullaryFunctor());
- g_done = false;
- a3.Perform(std::make_tuple());
- EXPECT_TRUE(g_done);
-}
-
-// Tests InvokeWithoutArgs(obj_ptr, method).
-TEST(InvokeWithoutArgsTest, Method) {
- Foo foo;
- Action<int(bool, char)> a = // NOLINT
- InvokeWithoutArgs(&foo, &Foo::Nullary);
- EXPECT_EQ(123, a.Perform(std::make_tuple(true, 'a')));
-}
-
-// Tests using IgnoreResult() on a polymorphic action.
-TEST(IgnoreResultTest, PolymorphicAction) {
- Action<void(int)> a = IgnoreResult(Return(5)); // NOLINT
- a.Perform(std::make_tuple(1));
-}
-
-// Tests using IgnoreResult() on a monomorphic action.
-
-int ReturnOne() {
- g_done = true;
- return 1;
-}
-
-TEST(IgnoreResultTest, MonomorphicAction) {
- g_done = false;
- Action<void()> a = IgnoreResult(Invoke(ReturnOne));
- a.Perform(std::make_tuple());
- EXPECT_TRUE(g_done);
-}
-
-// Tests using IgnoreResult() on an action that returns a class type.
-
-MyNonDefaultConstructible ReturnMyNonDefaultConstructible(double /* x */) {
- g_done = true;
- return MyNonDefaultConstructible(42);
-}
-
-TEST(IgnoreResultTest, ActionReturningClass) {
- g_done = false;
- Action<void(int)> a =
- IgnoreResult(Invoke(ReturnMyNonDefaultConstructible)); // NOLINT
- a.Perform(std::make_tuple(2));
- EXPECT_TRUE(g_done);
-}
-
-TEST(AssignTest, Int) {
- int x = 0;
- Action<void(int)> a = Assign(&x, 5);
- a.Perform(std::make_tuple(0));
- EXPECT_EQ(5, x);
-}
-
-TEST(AssignTest, String) {
- ::std::string x;
- Action<void(void)> a = Assign(&x, "Hello, world");
- a.Perform(std::make_tuple());
- EXPECT_EQ("Hello, world", x);
-}
-
-TEST(AssignTest, CompatibleTypes) {
- double x = 0;
- Action<void(int)> a = Assign(&x, 5);
- a.Perform(std::make_tuple(0));
- EXPECT_DOUBLE_EQ(5, x);
-}
-
-
-// Tests using WithArgs and with an action that takes 1 argument.
-TEST(WithArgsTest, OneArg) {
- Action<bool(double x, int n)> a = WithArgs<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(a.Perform(std::make_tuple(1.5, -1)));
- EXPECT_FALSE(a.Perform(std::make_tuple(1.5, 1)));
-}
-
-// Tests using WithArgs with an action that takes 2 arguments.
-TEST(WithArgsTest, TwoArgs) {
- Action<const char*(const char* s, double x, short n)> a = // NOLINT
- WithArgs<0, 2>(Invoke(Binary));
- const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(std::make_tuple(CharPtr(s), 0.5, Short(2))));
-}
-
-struct ConcatAll {
- std::string operator()() const { return {}; }
- template <typename... I>
- std::string operator()(const char* a, I... i) const {
- return a + ConcatAll()(i...);
- }
-};
-
-// Tests using WithArgs with an action that takes 10 arguments.
-TEST(WithArgsTest, TenArgs) {
- Action<std::string(const char*, const char*, const char*, const char*)> a =
- WithArgs<0, 1, 2, 3, 2, 1, 0, 1, 2, 3>(Invoke(ConcatAll{}));
- EXPECT_EQ("0123210123",
- a.Perform(std::make_tuple(CharPtr("0"), CharPtr("1"), CharPtr("2"),
- CharPtr("3"))));
-}
-
-// Tests using WithArgs with an action that is not Invoke().
-class SubtractAction : public ActionInterface<int(int, int)> {
- public:
- int Perform(const std::tuple<int, int>& args) override {
- return std::get<0>(args) - std::get<1>(args);
- }
-};
-
-TEST(WithArgsTest, NonInvokeAction) {
- Action<int(const std::string&, int, int)> a =
- WithArgs<2, 1>(MakeAction(new SubtractAction));
- std::tuple<std::string, int, int> dummy =
- std::make_tuple(std::string("hi"), 2, 10);
- EXPECT_EQ(8, a.Perform(dummy));
-}
-
-// Tests using WithArgs to pass all original arguments in the original order.
-TEST(WithArgsTest, Identity) {
- Action<int(int x, char y, short z)> a = // NOLINT
- WithArgs<0, 1, 2>(Invoke(Ternary));
- EXPECT_EQ(123, a.Perform(std::make_tuple(100, Char(20), Short(3))));
-}
-
-// Tests using WithArgs with repeated arguments.
-TEST(WithArgsTest, RepeatedArguments) {
- Action<int(bool, int m, int n)> a = // NOLINT
- WithArgs<1, 1, 1, 1>(Invoke(SumOf4));
- EXPECT_EQ(4, a.Perform(std::make_tuple(false, 1, 10)));
-}
-
-// Tests using WithArgs with reversed argument order.
-TEST(WithArgsTest, ReversedArgumentOrder) {
- Action<const char*(short n, const char* input)> a = // NOLINT
- WithArgs<1, 0>(Invoke(Binary));
- const char s[] = "Hello";
- EXPECT_EQ(s + 2, a.Perform(std::make_tuple(Short(2), CharPtr(s))));
-}
-
-// Tests using WithArgs with compatible, but not identical, argument types.
-TEST(WithArgsTest, ArgsOfCompatibleTypes) {
- Action<long(short x, char y, double z, char c)> a = // NOLINT
- WithArgs<0, 1, 3>(Invoke(Ternary));
- EXPECT_EQ(123,
- a.Perform(std::make_tuple(Short(100), Char(20), 5.6, Char(3))));
-}
-
-// Tests using WithArgs with an action that returns void.
-TEST(WithArgsTest, VoidAction) {
- Action<void(double x, char c, int n)> a = WithArgs<2, 1>(Invoke(VoidBinary));
- g_done = false;
- a.Perform(std::make_tuple(1.5, 'a', 3));
- EXPECT_TRUE(g_done);
-}
-
-TEST(WithArgsTest, ReturnReference) {
- Action<int&(int&, void*)> aa = WithArgs<0>([](int& a) -> int& { return a; });
- int i = 0;
- const int& res = aa.Perform(std::forward_as_tuple(i, nullptr));
- EXPECT_EQ(&i, &res);
-}
-
-TEST(WithArgsTest, InnerActionWithConversion) {
- Action<Derived*()> inner = [] { return nullptr; };
- Action<Base*(double)> a = testing::WithoutArgs(inner);
- EXPECT_EQ(nullptr, a.Perform(std::make_tuple(1.1)));
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-class SetErrnoAndReturnTest : public testing::Test {
- protected:
- void SetUp() override { errno = 0; }
- void TearDown() override { errno = 0; }
-};
-
-TEST_F(SetErrnoAndReturnTest, Int) {
- Action<int(void)> a = SetErrnoAndReturn(ENOTTY, -5);
- EXPECT_EQ(-5, a.Perform(std::make_tuple()));
- EXPECT_EQ(ENOTTY, errno);
-}
-
-TEST_F(SetErrnoAndReturnTest, Ptr) {
- int x;
- Action<int*(void)> a = SetErrnoAndReturn(ENOTTY, &x);
- EXPECT_EQ(&x, a.Perform(std::make_tuple()));
- EXPECT_EQ(ENOTTY, errno);
-}
-
-TEST_F(SetErrnoAndReturnTest, CompatibleTypes) {
- Action<double()> a = SetErrnoAndReturn(EINVAL, 5);
- EXPECT_DOUBLE_EQ(5.0, a.Perform(std::make_tuple()));
- EXPECT_EQ(EINVAL, errno);
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests ByRef().
-
-// Tests that the result of ByRef() is copyable.
-TEST(ByRefTest, IsCopyable) {
- const std::string s1 = "Hi";
- const std::string s2 = "Hello";
-
- auto ref_wrapper = ByRef(s1);
- const std::string& r1 = ref_wrapper;
- EXPECT_EQ(&s1, &r1);
-
- // Assigns a new value to ref_wrapper.
- ref_wrapper = ByRef(s2);
- const std::string& r2 = ref_wrapper;
- EXPECT_EQ(&s2, &r2);
-
- auto ref_wrapper1 = ByRef(s1);
- // Copies ref_wrapper1 to ref_wrapper.
- ref_wrapper = ref_wrapper1;
- const std::string& r3 = ref_wrapper;
- EXPECT_EQ(&s1, &r3);
-}
-
-// Tests using ByRef() on a const value.
-TEST(ByRefTest, ConstValue) {
- const int n = 0;
- // int& ref = ByRef(n); // This shouldn't compile - we have a
- // negative compilation test to catch it.
- const int& const_ref = ByRef(n);
- EXPECT_EQ(&n, &const_ref);
-}
-
-// Tests using ByRef() on a non-const value.
-TEST(ByRefTest, NonConstValue) {
- int n = 0;
-
- // ByRef(n) can be used as either an int&,
- int& ref = ByRef(n);
- EXPECT_EQ(&n, &ref);
-
- // or a const int&.
- const int& const_ref = ByRef(n);
- EXPECT_EQ(&n, &const_ref);
-}
-
-// Tests explicitly specifying the type when using ByRef().
-TEST(ByRefTest, ExplicitType) {
- int n = 0;
- const int& r1 = ByRef<const int>(n);
- EXPECT_EQ(&n, &r1);
-
- // ByRef<char>(n); // This shouldn't compile - we have a negative
- // compilation test to catch it.
-
- Derived d;
- Derived& r2 = ByRef<Derived>(d);
- EXPECT_EQ(&d, &r2);
-
- const Derived& r3 = ByRef<const Derived>(d);
- EXPECT_EQ(&d, &r3);
-
- Base& r4 = ByRef<Base>(d);
- EXPECT_EQ(&d, &r4);
-
- const Base& r5 = ByRef<const Base>(d);
- EXPECT_EQ(&d, &r5);
-
- // The following shouldn't compile - we have a negative compilation
- // test for it.
- //
- // Base b;
- // ByRef<Derived>(b);
-}
-
-// Tests that Google Mock prints expression ByRef(x) as a reference to x.
-TEST(ByRefTest, PrintsCorrectly) {
- int n = 42;
- ::std::stringstream expected, actual;
- testing::internal::UniversalPrinter<const int&>::Print(n, &expected);
- testing::internal::UniversalPrint(ByRef(n), &actual);
- EXPECT_EQ(expected.str(), actual.str());
-}
-
-struct UnaryConstructorClass {
- explicit UnaryConstructorClass(int v) : value(v) {}
- int value;
-};
-
-// Tests using ReturnNew() with a unary constructor.
-TEST(ReturnNewTest, Unary) {
- Action<UnaryConstructorClass*()> a = ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(std::make_tuple());
- EXPECT_EQ(4000, c->value);
- delete c;
-}
-
-TEST(ReturnNewTest, UnaryWorksWhenMockMethodHasArgs) {
- Action<UnaryConstructorClass*(bool, int)> a =
- ReturnNew<UnaryConstructorClass>(4000);
- UnaryConstructorClass* c = a.Perform(std::make_tuple(false, 5));
- EXPECT_EQ(4000, c->value);
- delete c;
-}
-
-TEST(ReturnNewTest, UnaryWorksWhenMockMethodReturnsPointerToConst) {
- Action<const UnaryConstructorClass*()> a =
- ReturnNew<UnaryConstructorClass>(4000);
- const UnaryConstructorClass* c = a.Perform(std::make_tuple());
- EXPECT_EQ(4000, c->value);
- delete c;
-}
-
-class TenArgConstructorClass {
- public:
- TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10)
- : value_(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10) {}
- int value_;
-};
-
-// Tests using ReturnNew() with a 10-argument constructor.
-TEST(ReturnNewTest, ConstructorThatTakes10Arguments) {
- Action<TenArgConstructorClass*()> a = ReturnNew<TenArgConstructorClass>(
- 1000000000, 200000000, 30000000, 4000000, 500000, 60000, 7000, 800, 90,
- 0);
- TenArgConstructorClass* c = a.Perform(std::make_tuple());
- EXPECT_EQ(1234567890, c->value_);
- delete c;
-}
-
-std::unique_ptr<int> UniquePtrSource() {
- return std::unique_ptr<int>(new int(19));
-}
-
-std::vector<std::unique_ptr<int>> VectorUniquePtrSource() {
- std::vector<std::unique_ptr<int>> out;
- out.emplace_back(new int(7));
- return out;
-}
-
-TEST(MockMethodTest, CanReturnMoveOnlyValue_Return) {
- MockClass mock;
- std::unique_ptr<int> i(new int(19));
- EXPECT_CALL(mock, MakeUnique()).WillOnce(Return(ByMove(std::move(i))));
- EXPECT_CALL(mock, MakeVectorUnique())
- .WillOnce(Return(ByMove(VectorUniquePtrSource())));
- Derived* d = new Derived;
- EXPECT_CALL(mock, MakeUniqueBase())
- .WillOnce(Return(ByMove(std::unique_ptr<Derived>(d))));
-
- std::unique_ptr<int> result1 = mock.MakeUnique();
- EXPECT_EQ(19, *result1);
-
- std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
- EXPECT_EQ(1u, vresult.size());
- EXPECT_NE(nullptr, vresult[0]);
- EXPECT_EQ(7, *vresult[0]);
-
- std::unique_ptr<Base> result2 = mock.MakeUniqueBase();
- EXPECT_EQ(d, result2.get());
-}
-
-TEST(MockMethodTest, CanReturnMoveOnlyValue_DoAllReturn) {
- testing::MockFunction<void()> mock_function;
- MockClass mock;
- std::unique_ptr<int> i(new int(19));
- EXPECT_CALL(mock_function, Call());
- EXPECT_CALL(mock, MakeUnique()).WillOnce(DoAll(
- InvokeWithoutArgs(&mock_function, &testing::MockFunction<void()>::Call),
- Return(ByMove(std::move(i)))));
-
- std::unique_ptr<int> result1 = mock.MakeUnique();
- EXPECT_EQ(19, *result1);
-}
-
-TEST(MockMethodTest, CanReturnMoveOnlyValue_Invoke) {
- MockClass mock;
-
- // Check default value
- DefaultValue<std::unique_ptr<int>>::SetFactory([] {
- return std::unique_ptr<int>(new int(42));
- });
- EXPECT_EQ(42, *mock.MakeUnique());
-
- EXPECT_CALL(mock, MakeUnique()).WillRepeatedly(Invoke(UniquePtrSource));
- EXPECT_CALL(mock, MakeVectorUnique())
- .WillRepeatedly(Invoke(VectorUniquePtrSource));
- std::unique_ptr<int> result1 = mock.MakeUnique();
- EXPECT_EQ(19, *result1);
- std::unique_ptr<int> result2 = mock.MakeUnique();
- EXPECT_EQ(19, *result2);
- EXPECT_NE(result1, result2);
-
- std::vector<std::unique_ptr<int>> vresult = mock.MakeVectorUnique();
- EXPECT_EQ(1u, vresult.size());
- EXPECT_NE(nullptr, vresult[0]);
- EXPECT_EQ(7, *vresult[0]);
-}
-
-TEST(MockMethodTest, CanTakeMoveOnlyValue) {
- MockClass mock;
- auto make = [](int i) { return std::unique_ptr<int>(new int(i)); };
-
- EXPECT_CALL(mock, TakeUnique(_)).WillRepeatedly([](std::unique_ptr<int> i) {
- return *i;
- });
- // DoAll() does not compile, since it would move from its arguments twice.
- // EXPECT_CALL(mock, TakeUnique(_, _))
- // .WillRepeatedly(DoAll(Invoke([](std::unique_ptr<int> j) {}),
- // Return(1)));
- EXPECT_CALL(mock, TakeUnique(testing::Pointee(7)))
- .WillOnce(Return(-7))
- .RetiresOnSaturation();
- EXPECT_CALL(mock, TakeUnique(testing::IsNull()))
- .WillOnce(Return(-1))
- .RetiresOnSaturation();
-
- EXPECT_EQ(5, mock.TakeUnique(make(5)));
- EXPECT_EQ(-7, mock.TakeUnique(make(7)));
- EXPECT_EQ(7, mock.TakeUnique(make(7)));
- EXPECT_EQ(7, mock.TakeUnique(make(7)));
- EXPECT_EQ(-1, mock.TakeUnique({}));
-
- // Some arguments are moved, some passed by reference.
- auto lvalue = make(6);
- EXPECT_CALL(mock, TakeUnique(_, _))
- .WillOnce([](const std::unique_ptr<int>& i, std::unique_ptr<int> j) {
- return *i * *j;
- });
- EXPECT_EQ(42, mock.TakeUnique(lvalue, make(7)));
-
- // The unique_ptr can be saved by the action.
- std::unique_ptr<int> saved;
- EXPECT_CALL(mock, TakeUnique(_)).WillOnce([&saved](std::unique_ptr<int> i) {
- saved = std::move(i);
- return 0;
- });
- EXPECT_EQ(0, mock.TakeUnique(make(42)));
- EXPECT_EQ(42, *saved);
-}
-
-
-// Tests for std::function based action.
-
-int Add(int val, int& ref, int* ptr) { // NOLINT
- int result = val + ref + *ptr;
- ref = 42;
- *ptr = 43;
- return result;
-}
-
-int Deref(std::unique_ptr<int> ptr) { return *ptr; }
-
-struct Double {
- template <typename T>
- T operator()(T t) { return 2 * t; }
-};
-
-std::unique_ptr<int> UniqueInt(int i) {
- return std::unique_ptr<int>(new int(i));
-}
-
-TEST(FunctorActionTest, ActionFromFunction) {
- Action<int(int, int&, int*)> a = &Add;
- int x = 1, y = 2, z = 3;
- EXPECT_EQ(6, a.Perform(std::forward_as_tuple(x, y, &z)));
- EXPECT_EQ(42, y);
- EXPECT_EQ(43, z);
-
- Action<int(std::unique_ptr<int>)> a1 = &Deref;
- EXPECT_EQ(7, a1.Perform(std::make_tuple(UniqueInt(7))));
-}
-
-TEST(FunctorActionTest, ActionFromLambda) {
- Action<int(bool, int)> a1 = [](bool b, int i) { return b ? i : 0; };
- EXPECT_EQ(5, a1.Perform(std::make_tuple(true, 5)));
- EXPECT_EQ(0, a1.Perform(std::make_tuple(false, 5)));
-
- std::unique_ptr<int> saved;
- Action<void(std::unique_ptr<int>)> a2 = [&saved](std::unique_ptr<int> p) {
- saved = std::move(p);
- };
- a2.Perform(std::make_tuple(UniqueInt(5)));
- EXPECT_EQ(5, *saved);
-}
-
-TEST(FunctorActionTest, PolymorphicFunctor) {
- Action<int(int)> ai = Double();
- EXPECT_EQ(2, ai.Perform(std::make_tuple(1)));
- Action<double(double)> ad = Double(); // Double? Double double!
- EXPECT_EQ(3.0, ad.Perform(std::make_tuple(1.5)));
-}
-
-TEST(FunctorActionTest, TypeConversion) {
- // Numeric promotions are allowed.
- const Action<bool(int)> a1 = [](int i) { return i > 1; };
- const Action<int(bool)> a2 = Action<int(bool)>(a1);
- EXPECT_EQ(1, a1.Perform(std::make_tuple(42)));
- EXPECT_EQ(0, a2.Perform(std::make_tuple(42)));
-
- // Implicit constructors are allowed.
- const Action<bool(std::string)> s1 = [](std::string s) { return !s.empty(); };
- const Action<int(const char*)> s2 = Action<int(const char*)>(s1);
- EXPECT_EQ(0, s2.Perform(std::make_tuple("")));
- EXPECT_EQ(1, s2.Perform(std::make_tuple("hello")));
-
- // Also between the lambda and the action itself.
- const Action<bool(std::string)> x1 = [](Unused) { return 42; };
- const Action<bool(std::string)> x2 = [] { return 42; };
- EXPECT_TRUE(x1.Perform(std::make_tuple("hello")));
- EXPECT_TRUE(x2.Perform(std::make_tuple("hello")));
-
- // Ensure decay occurs where required.
- std::function<int()> f = [] { return 7; };
- Action<int(int)> d = f;
- f = nullptr;
- EXPECT_EQ(7, d.Perform(std::make_tuple(1)));
-
- // Ensure creation of an empty action succeeds.
- Action<void(int)>(nullptr);
-}
-
-TEST(FunctorActionTest, UnusedArguments) {
- // Verify that users can ignore uninteresting arguments.
- Action<int(int, double y, double z)> a =
- [](int i, Unused, Unused) { return 2 * i; };
- std::tuple<int, double, double> dummy = std::make_tuple(3, 7.3, 9.44);
- EXPECT_EQ(6, a.Perform(dummy));
-}
-
-// Test that basic built-in actions work with move-only arguments.
-TEST(MoveOnlyArgumentsTest, ReturningActions) {
- Action<int(std::unique_ptr<int>)> a = Return(1);
- EXPECT_EQ(1, a.Perform(std::make_tuple(nullptr)));
-
- a = testing::WithoutArgs([]() { return 7; });
- EXPECT_EQ(7, a.Perform(std::make_tuple(nullptr)));
-
- Action<void(std::unique_ptr<int>, int*)> a2 = testing::SetArgPointee<1>(3);
- int x = 0;
- a2.Perform(std::make_tuple(nullptr, &x));
- EXPECT_EQ(x, 3);
-}
-
-ACTION(ReturnArity) {
- return std::tuple_size<args_type>::value;
-}
-
-TEST(ActionMacro, LargeArity) {
- EXPECT_EQ(
- 1, testing::Action<int(int)>(ReturnArity()).Perform(std::make_tuple(0)));
- EXPECT_EQ(
- 10,
- testing::Action<int(int, int, int, int, int, int, int, int, int, int)>(
- ReturnArity())
- .Perform(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)));
- EXPECT_EQ(
- 20,
- testing::Action<int(int, int, int, int, int, int, int, int, int, int, int,
- int, int, int, int, int, int, int, int, int)>(
- ReturnArity())
- .Perform(std::make_tuple(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
- 14, 15, 16, 17, 18, 19)));
-}
-
-} // Unnamed namespace
-
-#ifdef _MSC_VER
-#if _MSC_VER == 1900
-# pragma warning(pop)
-#endif
-#endif
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-cardinalities_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-cardinalities_test.cc
deleted file mode 100644
index ca97cae249..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-cardinalities_test.cc
+++ /dev/null
@@ -1,429 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in cardinalities.
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-namespace {
-
-using std::stringstream;
-using testing::AnyNumber;
-using testing::AtLeast;
-using testing::AtMost;
-using testing::Between;
-using testing::Cardinality;
-using testing::CardinalityInterface;
-using testing::Exactly;
-using testing::IsSubstring;
-using testing::MakeCardinality;
-
-class MockFoo {
- public:
- MockFoo() {}
- MOCK_METHOD0(Bar, int()); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-// Tests that Cardinality objects can be default constructed.
-TEST(CardinalityTest, IsDefaultConstructable) {
- Cardinality c;
-}
-
-// Tests that Cardinality objects are copyable.
-TEST(CardinalityTest, IsCopyable) {
- // Tests the copy constructor.
- Cardinality c = Exactly(1);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- // Tests the assignment operator.
- c = Exactly(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-}
-
-TEST(CardinalityTest, IsOverSaturatedByCallCountWorks) {
- const Cardinality c = AtMost(5);
- EXPECT_FALSE(c.IsOverSaturatedByCallCount(4));
- EXPECT_FALSE(c.IsOverSaturatedByCallCount(5));
- EXPECT_TRUE(c.IsOverSaturatedByCallCount(6));
-}
-
-// Tests that Cardinality::DescribeActualCallCountTo() creates the
-// correct description.
-TEST(CardinalityTest, CanDescribeActualCallCount) {
- stringstream ss0;
- Cardinality::DescribeActualCallCountTo(0, &ss0);
- EXPECT_EQ("never called", ss0.str());
-
- stringstream ss1;
- Cardinality::DescribeActualCallCountTo(1, &ss1);
- EXPECT_EQ("called once", ss1.str());
-
- stringstream ss2;
- Cardinality::DescribeActualCallCountTo(2, &ss2);
- EXPECT_EQ("called twice", ss2.str());
-
- stringstream ss3;
- Cardinality::DescribeActualCallCountTo(3, &ss3);
- EXPECT_EQ("called 3 times", ss3.str());
-}
-
-// Tests AnyNumber()
-TEST(AnyNumber, Works) {
- const Cardinality c = AnyNumber();
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(9));
- EXPECT_FALSE(c.IsSaturatedByCallCount(9));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called any number of times",
- ss.str());
-}
-
-TEST(AnyNumberTest, HasCorrectBounds) {
- const Cardinality c = AnyNumber();
- EXPECT_EQ(0, c.ConservativeLowerBound());
- EXPECT_EQ(INT_MAX, c.ConservativeUpperBound());
-}
-
-// Tests AtLeast(n).
-
-TEST(AtLeastTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- AtLeast(-1);
- }, "The invocation lower bound must be >= 0");
-}
-
-TEST(AtLeastTest, OnZero) {
- const Cardinality c = AtLeast(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "any number of times",
- ss.str());
-}
-
-TEST(AtLeastTest, OnPositiveNumber) {
- const Cardinality c = AtLeast(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- AtLeast(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least twice",
- ss2.str());
-
- stringstream ss3;
- AtLeast(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "at least 3 times",
- ss3.str());
-}
-
-TEST(AtLeastTest, HasCorrectBounds) {
- const Cardinality c = AtLeast(2);
- EXPECT_EQ(2, c.ConservativeLowerBound());
- EXPECT_EQ(INT_MAX, c.ConservativeUpperBound());
-}
-
-// Tests AtMost(n).
-
-TEST(AtMostTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- AtMost(-1);
- }, "The invocation upper bound must be >= 0");
-}
-
-TEST(AtMostTest, OnZero) {
- const Cardinality c = AtMost(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(AtMostTest, OnPositiveNumber) {
- const Cardinality c = AtMost(2);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(1));
- EXPECT_FALSE(c.IsSaturatedByCallCount(1));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- AtMost(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most twice",
- ss2.str());
-
- stringstream ss3;
- AtMost(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most 3 times",
- ss3.str());
-}
-
-TEST(AtMostTest, HasCorrectBounds) {
- const Cardinality c = AtMost(2);
- EXPECT_EQ(0, c.ConservativeLowerBound());
- EXPECT_EQ(2, c.ConservativeUpperBound());
-}
-
-// Tests Between(m, n).
-
-TEST(BetweenTest, OnNegativeStart) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(-1, 2);
- }, "The invocation lower bound must be >= 0, but is actually -1");
-}
-
-TEST(BetweenTest, OnNegativeEnd) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(1, -2);
- }, "The invocation upper bound must be >= 0, but is actually -2");
-}
-
-TEST(BetweenTest, OnStartBiggerThanEnd) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Between(2, 1);
- }, "The invocation upper bound (1) must be >= "
- "the invocation lower bound (2)");
-}
-
-TEST(BetweenTest, OnZeroStartAndZeroEnd) {
- const Cardinality c = Between(0, 0);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(BetweenTest, OnZeroStartAndNonZeroEnd) {
- const Cardinality c = Between(0, 2);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(4));
- EXPECT_TRUE(c.IsSaturatedByCallCount(4));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called at most twice",
- ss.str());
-}
-
-TEST(BetweenTest, OnSameStartAndEnd) {
- const Cardinality c = Between(3, 3);
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(3));
- EXPECT_TRUE(c.IsSaturatedByCallCount(3));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(4));
- EXPECT_TRUE(c.IsSaturatedByCallCount(4));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called 3 times",
- ss.str());
-}
-
-TEST(BetweenTest, OnDifferentStartAndEnd) {
- const Cardinality c = Between(3, 5);
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSaturatedByCallCount(2));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(3));
- EXPECT_FALSE(c.IsSaturatedByCallCount(3));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(5));
- EXPECT_TRUE(c.IsSaturatedByCallCount(5));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(6));
- EXPECT_TRUE(c.IsSaturatedByCallCount(6));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "called between 3 and 5 times",
- ss.str());
-}
-
-TEST(BetweenTest, HasCorrectBounds) {
- const Cardinality c = Between(3, 5);
- EXPECT_EQ(3, c.ConservativeLowerBound());
- EXPECT_EQ(5, c.ConservativeUpperBound());
-}
-
-// Tests Exactly(n).
-
-TEST(ExactlyTest, OnNegativeNumber) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Exactly(-1);
- }, "The invocation lower bound must be >= 0");
-}
-
-TEST(ExactlyTest, OnZero) {
- const Cardinality c = Exactly(0);
- EXPECT_TRUE(c.IsSatisfiedByCallCount(0));
- EXPECT_TRUE(c.IsSaturatedByCallCount(0));
-
- EXPECT_FALSE(c.IsSatisfiedByCallCount(1));
- EXPECT_TRUE(c.IsSaturatedByCallCount(1));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_PRED_FORMAT2(IsSubstring, "never called",
- ss.str());
-}
-
-TEST(ExactlyTest, OnPositiveNumber) {
- const Cardinality c = Exactly(2);
- EXPECT_FALSE(c.IsSatisfiedByCallCount(0));
- EXPECT_FALSE(c.IsSaturatedByCallCount(0));
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_TRUE(c.IsSaturatedByCallCount(2));
-
- stringstream ss1;
- Exactly(1).DescribeTo(&ss1);
- EXPECT_PRED_FORMAT2(IsSubstring, "called once",
- ss1.str());
-
- stringstream ss2;
- c.DescribeTo(&ss2);
- EXPECT_PRED_FORMAT2(IsSubstring, "called twice",
- ss2.str());
-
- stringstream ss3;
- Exactly(3).DescribeTo(&ss3);
- EXPECT_PRED_FORMAT2(IsSubstring, "called 3 times",
- ss3.str());
-}
-
-TEST(ExactlyTest, HasCorrectBounds) {
- const Cardinality c = Exactly(3);
- EXPECT_EQ(3, c.ConservativeLowerBound());
- EXPECT_EQ(3, c.ConservativeUpperBound());
-}
-
-// Tests that a user can make their own cardinality by implementing
-// CardinalityInterface and calling MakeCardinality().
-
-class EvenCardinality : public CardinalityInterface {
- public:
- // Returns true if and only if call_count calls will satisfy this
- // cardinality.
- bool IsSatisfiedByCallCount(int call_count) const override {
- return (call_count % 2 == 0);
- }
-
- // Returns true if and only if call_count calls will saturate this
- // cardinality.
- bool IsSaturatedByCallCount(int /* call_count */) const override {
- return false;
- }
-
- // Describes self to an ostream.
- void DescribeTo(::std::ostream* ss) const override {
- *ss << "called even number of times";
- }
-};
-
-TEST(MakeCardinalityTest, ConstructsCardinalityFromInterface) {
- const Cardinality c = MakeCardinality(new EvenCardinality);
-
- EXPECT_TRUE(c.IsSatisfiedByCallCount(2));
- EXPECT_FALSE(c.IsSatisfiedByCallCount(3));
-
- EXPECT_FALSE(c.IsSaturatedByCallCount(10000));
-
- stringstream ss;
- c.DescribeTo(&ss);
- EXPECT_EQ("called even number of times", ss.str());
-}
-
-} // Unnamed namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-function-mocker_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-function-mocker_test.cc
deleted file mode 100644
index cf76fa99f2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-function-mocker_test.cc
+++ /dev/null
@@ -1,986 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the function mocker classes.
-#include "gmock/gmock-function-mocker.h"
-
-#if GTEST_OS_WINDOWS
-// MSDN says the header file to be included for STDMETHOD is BaseTyps.h but
-// we are getting compiler errors if we use basetyps.h, hence including
-// objbase.h for definition of STDMETHOD.
-# include <objbase.h>
-#endif // GTEST_OS_WINDOWS
-
-#include <functional>
-#include <map>
-#include <string>
-#include <type_traits>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace gmock_function_mocker_test {
-
-using testing::_;
-using testing::A;
-using testing::An;
-using testing::AnyNumber;
-using testing::Const;
-using testing::DoDefault;
-using testing::Eq;
-using testing::Lt;
-using testing::MockFunction;
-using testing::Ref;
-using testing::Return;
-using testing::ReturnRef;
-using testing::TypedEq;
-
-template<typename T>
-class TemplatedCopyable {
- public:
- TemplatedCopyable() {}
-
- template <typename U>
- TemplatedCopyable(const U& other) {} // NOLINT
-};
-
-class FooInterface {
- public:
- virtual ~FooInterface() {}
-
- virtual void VoidReturning(int x) = 0;
-
- virtual int Nullary() = 0;
- virtual bool Unary(int x) = 0;
- virtual long Binary(short x, int y) = 0; // NOLINT
- virtual int Decimal(bool b, char c, short d, int e, long f, // NOLINT
- float g, double h, unsigned i, char* j,
- const std::string& k) = 0;
-
- virtual bool TakesNonConstReference(int& n) = 0; // NOLINT
- virtual std::string TakesConstReference(const int& n) = 0;
- virtual bool TakesConst(const int x) = 0;
-
- virtual int OverloadedOnArgumentNumber() = 0;
- virtual int OverloadedOnArgumentNumber(int n) = 0;
-
- virtual int OverloadedOnArgumentType(int n) = 0;
- virtual char OverloadedOnArgumentType(char c) = 0;
-
- virtual int OverloadedOnConstness() = 0;
- virtual char OverloadedOnConstness() const = 0;
-
- virtual int TypeWithHole(int (*func)()) = 0;
- virtual int TypeWithComma(const std::map<int, std::string>& a_map) = 0;
- virtual int TypeWithTemplatedCopyCtor(const TemplatedCopyable<int>&) = 0;
-
- virtual int (*ReturnsFunctionPointer1(int))(bool) = 0;
- using fn_ptr = int (*)(bool);
- virtual fn_ptr ReturnsFunctionPointer2(int) = 0;
-
- virtual int RefQualifiedConstRef() const& = 0;
- virtual int RefQualifiedConstRefRef() const&& = 0;
- virtual int RefQualifiedRef() & = 0;
- virtual int RefQualifiedRefRef() && = 0;
-
- virtual int RefQualifiedOverloaded() const& = 0;
- virtual int RefQualifiedOverloaded() const&& = 0;
- virtual int RefQualifiedOverloaded() & = 0;
- virtual int RefQualifiedOverloaded() && = 0;
-
-#if GTEST_OS_WINDOWS
- STDMETHOD_(int, CTNullary)() = 0;
- STDMETHOD_(bool, CTUnary)(int x) = 0;
- STDMETHOD_(int, CTDecimal)
- (bool b, char c, short d, int e, long f, // NOLINT
- float g, double h, unsigned i, char* j, const std::string& k) = 0;
- STDMETHOD_(char, CTConst)(int x) const = 0;
-#endif // GTEST_OS_WINDOWS
-};
-
-// Const qualifiers on arguments were once (incorrectly) considered
-// significant in determining whether two virtual functions had the same
-// signature. This was fixed in Visual Studio 2008. However, the compiler
-// still emits a warning that alerts about this change in behavior.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable : 4373)
-#endif
-class MockFoo : public FooInterface {
- public:
- MockFoo() {}
-
- // Makes sure that a mock function parameter can be named.
- MOCK_METHOD(void, VoidReturning, (int n)); // NOLINT
-
- MOCK_METHOD(int, Nullary, ()); // NOLINT
-
- // Makes sure that a mock function parameter can be unnamed.
- MOCK_METHOD(bool, Unary, (int)); // NOLINT
- MOCK_METHOD(long, Binary, (short, int)); // NOLINT
- MOCK_METHOD(int, Decimal,
- (bool, char, short, int, long, float, // NOLINT
- double, unsigned, char*, const std::string& str),
- (override));
-
- MOCK_METHOD(bool, TakesNonConstReference, (int&)); // NOLINT
- MOCK_METHOD(std::string, TakesConstReference, (const int&));
- MOCK_METHOD(bool, TakesConst, (const int)); // NOLINT
-
- // Tests that the function return type can contain unprotected comma.
- MOCK_METHOD((std::map<int, std::string>), ReturnTypeWithComma, (), ());
- MOCK_METHOD((std::map<int, std::string>), ReturnTypeWithComma, (int),
- (const)); // NOLINT
-
- MOCK_METHOD(int, OverloadedOnArgumentNumber, ()); // NOLINT
- MOCK_METHOD(int, OverloadedOnArgumentNumber, (int)); // NOLINT
-
- MOCK_METHOD(int, OverloadedOnArgumentType, (int)); // NOLINT
- MOCK_METHOD(char, OverloadedOnArgumentType, (char)); // NOLINT
-
- MOCK_METHOD(int, OverloadedOnConstness, (), (override)); // NOLINT
- MOCK_METHOD(char, OverloadedOnConstness, (), (override, const)); // NOLINT
-
- MOCK_METHOD(int, TypeWithHole, (int (*)()), ()); // NOLINT
- MOCK_METHOD(int, TypeWithComma, ((const std::map<int, std::string>&)));
- MOCK_METHOD(int, TypeWithTemplatedCopyCtor,
- (const TemplatedCopyable<int>&)); // NOLINT
-
- MOCK_METHOD(int (*)(bool), ReturnsFunctionPointer1, (int), ());
- MOCK_METHOD(fn_ptr, ReturnsFunctionPointer2, (int), ());
-
-#if GTEST_OS_WINDOWS
- MOCK_METHOD(int, CTNullary, (), (Calltype(STDMETHODCALLTYPE)));
- MOCK_METHOD(bool, CTUnary, (int), (Calltype(STDMETHODCALLTYPE)));
- MOCK_METHOD(int, CTDecimal,
- (bool b, char c, short d, int e, long f, float g, double h,
- unsigned i, char* j, const std::string& k),
- (Calltype(STDMETHODCALLTYPE)));
- MOCK_METHOD(char, CTConst, (int), (const, Calltype(STDMETHODCALLTYPE)));
- MOCK_METHOD((std::map<int, std::string>), CTReturnTypeWithComma, (),
- (Calltype(STDMETHODCALLTYPE)));
-#endif // GTEST_OS_WINDOWS
-
- // Test reference qualified functions.
- MOCK_METHOD(int, RefQualifiedConstRef, (), (const, ref(&), override));
- MOCK_METHOD(int, RefQualifiedConstRefRef, (), (const, ref(&&), override));
- MOCK_METHOD(int, RefQualifiedRef, (), (ref(&), override));
- MOCK_METHOD(int, RefQualifiedRefRef, (), (ref(&&), override));
-
- MOCK_METHOD(int, RefQualifiedOverloaded, (), (const, ref(&), override));
- MOCK_METHOD(int, RefQualifiedOverloaded, (), (const, ref(&&), override));
- MOCK_METHOD(int, RefQualifiedOverloaded, (), (ref(&), override));
- MOCK_METHOD(int, RefQualifiedOverloaded, (), (ref(&&), override));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class LegacyMockFoo : public FooInterface {
- public:
- LegacyMockFoo() {}
-
- // Makes sure that a mock function parameter can be named.
- MOCK_METHOD1(VoidReturning, void(int n)); // NOLINT
-
- MOCK_METHOD0(Nullary, int()); // NOLINT
-
- // Makes sure that a mock function parameter can be unnamed.
- MOCK_METHOD1(Unary, bool(int)); // NOLINT
- MOCK_METHOD2(Binary, long(short, int)); // NOLINT
- MOCK_METHOD10(Decimal, int(bool, char, short, int, long, float, // NOLINT
- double, unsigned, char*, const std::string& str));
-
- MOCK_METHOD1(TakesNonConstReference, bool(int&)); // NOLINT
- MOCK_METHOD1(TakesConstReference, std::string(const int&));
- MOCK_METHOD1(TakesConst, bool(const int)); // NOLINT
-
- // Tests that the function return type can contain unprotected comma.
- MOCK_METHOD0(ReturnTypeWithComma, std::map<int, std::string>());
- MOCK_CONST_METHOD1(ReturnTypeWithComma,
- std::map<int, std::string>(int)); // NOLINT
-
- MOCK_METHOD0(OverloadedOnArgumentNumber, int()); // NOLINT
- MOCK_METHOD1(OverloadedOnArgumentNumber, int(int)); // NOLINT
-
- MOCK_METHOD1(OverloadedOnArgumentType, int(int)); // NOLINT
- MOCK_METHOD1(OverloadedOnArgumentType, char(char)); // NOLINT
-
- MOCK_METHOD0(OverloadedOnConstness, int()); // NOLINT
- MOCK_CONST_METHOD0(OverloadedOnConstness, char()); // NOLINT
-
- MOCK_METHOD1(TypeWithHole, int(int (*)())); // NOLINT
- MOCK_METHOD1(TypeWithComma,
- int(const std::map<int, std::string>&)); // NOLINT
- MOCK_METHOD1(TypeWithTemplatedCopyCtor,
- int(const TemplatedCopyable<int>&)); // NOLINT
-
- MOCK_METHOD1(ReturnsFunctionPointer1, int (*(int))(bool));
- MOCK_METHOD1(ReturnsFunctionPointer2, fn_ptr(int));
-
-#if GTEST_OS_WINDOWS
- MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTNullary, int());
- MOCK_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTUnary, bool(int)); // NOLINT
- MOCK_METHOD10_WITH_CALLTYPE(STDMETHODCALLTYPE, CTDecimal,
- int(bool b, char c, short d, int e, // NOLINT
- long f, float g, double h, // NOLINT
- unsigned i, char* j, const std::string& k));
- MOCK_CONST_METHOD1_WITH_CALLTYPE(STDMETHODCALLTYPE, CTConst,
- char(int)); // NOLINT
-
- // Tests that the function return type can contain unprotected comma.
- MOCK_METHOD0_WITH_CALLTYPE(STDMETHODCALLTYPE, CTReturnTypeWithComma,
- std::map<int, std::string>());
-#endif // GTEST_OS_WINDOWS
-
- // We can't mock these with the old macros, but we need to define them to make
- // it concrete.
- int RefQualifiedConstRef() const& override { return 0; }
- int RefQualifiedConstRefRef() const&& override { return 0; }
- int RefQualifiedRef() & override { return 0; }
- int RefQualifiedRefRef() && override { return 0; }
- int RefQualifiedOverloaded() const& override { return 0; }
- int RefQualifiedOverloaded() const&& override { return 0; }
- int RefQualifiedOverloaded() & override { return 0; }
- int RefQualifiedOverloaded() && override { return 0; }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockFoo);
-};
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-template <class T>
-class FunctionMockerTest : public testing::Test {
- protected:
- FunctionMockerTest() : foo_(&mock_foo_) {}
-
- FooInterface* const foo_;
- T mock_foo_;
-};
-using FunctionMockerTestTypes = ::testing::Types<MockFoo, LegacyMockFoo>;
-TYPED_TEST_SUITE(FunctionMockerTest, FunctionMockerTestTypes);
-
-// Tests mocking a void-returning function.
-TYPED_TEST(FunctionMockerTest, MocksVoidFunction) {
- EXPECT_CALL(this->mock_foo_, VoidReturning(Lt(100)));
- this->foo_->VoidReturning(0);
-}
-
-// Tests mocking a nullary function.
-TYPED_TEST(FunctionMockerTest, MocksNullaryFunction) {
- EXPECT_CALL(this->mock_foo_, Nullary())
- .WillOnce(DoDefault())
- .WillOnce(Return(1));
-
- EXPECT_EQ(0, this->foo_->Nullary());
- EXPECT_EQ(1, this->foo_->Nullary());
-}
-
-// Tests mocking a unary function.
-TYPED_TEST(FunctionMockerTest, MocksUnaryFunction) {
- EXPECT_CALL(this->mock_foo_, Unary(Eq(2))).Times(2).WillOnce(Return(true));
-
- EXPECT_TRUE(this->foo_->Unary(2));
- EXPECT_FALSE(this->foo_->Unary(2));
-}
-
-// Tests mocking a binary function.
-TYPED_TEST(FunctionMockerTest, MocksBinaryFunction) {
- EXPECT_CALL(this->mock_foo_, Binary(2, _)).WillOnce(Return(3));
-
- EXPECT_EQ(3, this->foo_->Binary(2, 1));
-}
-
-// Tests mocking a decimal function.
-TYPED_TEST(FunctionMockerTest, MocksDecimalFunction) {
- EXPECT_CALL(this->mock_foo_,
- Decimal(true, 'a', 0, 0, 1L, A<float>(), Lt(100), 5U, NULL, "hi"))
- .WillOnce(Return(5));
-
- EXPECT_EQ(5, this->foo_->Decimal(true, 'a', 0, 0, 1, 0, 0, 5, nullptr, "hi"));
-}
-
-// Tests mocking a function that takes a non-const reference.
-TYPED_TEST(FunctionMockerTest, MocksFunctionWithNonConstReferenceArgument) {
- int a = 0;
- EXPECT_CALL(this->mock_foo_, TakesNonConstReference(Ref(a)))
- .WillOnce(Return(true));
-
- EXPECT_TRUE(this->foo_->TakesNonConstReference(a));
-}
-
-// Tests mocking a function that takes a const reference.
-TYPED_TEST(FunctionMockerTest, MocksFunctionWithConstReferenceArgument) {
- int a = 0;
- EXPECT_CALL(this->mock_foo_, TakesConstReference(Ref(a)))
- .WillOnce(Return("Hello"));
-
- EXPECT_EQ("Hello", this->foo_->TakesConstReference(a));
-}
-
-// Tests mocking a function that takes a const variable.
-TYPED_TEST(FunctionMockerTest, MocksFunctionWithConstArgument) {
- EXPECT_CALL(this->mock_foo_, TakesConst(Lt(10))).WillOnce(DoDefault());
-
- EXPECT_FALSE(this->foo_->TakesConst(5));
-}
-
-// Tests mocking functions overloaded on the number of arguments.
-TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentNumber) {
- EXPECT_CALL(this->mock_foo_, OverloadedOnArgumentNumber())
- .WillOnce(Return(1));
- EXPECT_CALL(this->mock_foo_, OverloadedOnArgumentNumber(_))
- .WillOnce(Return(2));
-
- EXPECT_EQ(2, this->foo_->OverloadedOnArgumentNumber(1));
- EXPECT_EQ(1, this->foo_->OverloadedOnArgumentNumber());
-}
-
-// Tests mocking functions overloaded on the types of argument.
-TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnArgumentType) {
- EXPECT_CALL(this->mock_foo_, OverloadedOnArgumentType(An<int>()))
- .WillOnce(Return(1));
- EXPECT_CALL(this->mock_foo_, OverloadedOnArgumentType(TypedEq<char>('a')))
- .WillOnce(Return('b'));
-
- EXPECT_EQ(1, this->foo_->OverloadedOnArgumentType(0));
- EXPECT_EQ('b', this->foo_->OverloadedOnArgumentType('a'));
-}
-
-// Tests mocking functions overloaded on the const-ness of this object.
-TYPED_TEST(FunctionMockerTest, MocksFunctionsOverloadedOnConstnessOfThis) {
- EXPECT_CALL(this->mock_foo_, OverloadedOnConstness());
- EXPECT_CALL(Const(this->mock_foo_), OverloadedOnConstness())
- .WillOnce(Return('a'));
-
- EXPECT_EQ(0, this->foo_->OverloadedOnConstness());
- EXPECT_EQ('a', Const(*this->foo_).OverloadedOnConstness());
-}
-
-TYPED_TEST(FunctionMockerTest, MocksReturnTypeWithComma) {
- const std::map<int, std::string> a_map;
- EXPECT_CALL(this->mock_foo_, ReturnTypeWithComma()).WillOnce(Return(a_map));
- EXPECT_CALL(this->mock_foo_, ReturnTypeWithComma(42)).WillOnce(Return(a_map));
-
- EXPECT_EQ(a_map, this->mock_foo_.ReturnTypeWithComma());
- EXPECT_EQ(a_map, this->mock_foo_.ReturnTypeWithComma(42));
-}
-
-TYPED_TEST(FunctionMockerTest, MocksTypeWithTemplatedCopyCtor) {
- EXPECT_CALL(this->mock_foo_, TypeWithTemplatedCopyCtor(_))
- .WillOnce(Return(true));
- EXPECT_TRUE(this->foo_->TypeWithTemplatedCopyCtor(TemplatedCopyable<int>()));
-}
-
-#if GTEST_OS_WINDOWS
-// Tests mocking a nullary function with calltype.
-TYPED_TEST(FunctionMockerTest, MocksNullaryFunctionWithCallType) {
- EXPECT_CALL(this->mock_foo_, CTNullary())
- .WillOnce(Return(-1))
- .WillOnce(Return(0));
-
- EXPECT_EQ(-1, this->foo_->CTNullary());
- EXPECT_EQ(0, this->foo_->CTNullary());
-}
-
-// Tests mocking a unary function with calltype.
-TYPED_TEST(FunctionMockerTest, MocksUnaryFunctionWithCallType) {
- EXPECT_CALL(this->mock_foo_, CTUnary(Eq(2)))
- .Times(2)
- .WillOnce(Return(true))
- .WillOnce(Return(false));
-
- EXPECT_TRUE(this->foo_->CTUnary(2));
- EXPECT_FALSE(this->foo_->CTUnary(2));
-}
-
-// Tests mocking a decimal function with calltype.
-TYPED_TEST(FunctionMockerTest, MocksDecimalFunctionWithCallType) {
- EXPECT_CALL(this->mock_foo_, CTDecimal(true, 'a', 0, 0, 1L, A<float>(),
- Lt(100), 5U, NULL, "hi"))
- .WillOnce(Return(10));
-
- EXPECT_EQ(10, this->foo_->CTDecimal(true, 'a', 0, 0, 1, 0, 0, 5, NULL, "hi"));
-}
-
-// Tests mocking functions overloaded on the const-ness of this object.
-TYPED_TEST(FunctionMockerTest, MocksFunctionsConstFunctionWithCallType) {
- EXPECT_CALL(Const(this->mock_foo_), CTConst(_)).WillOnce(Return('a'));
-
- EXPECT_EQ('a', Const(*this->foo_).CTConst(0));
-}
-
-TYPED_TEST(FunctionMockerTest, MocksReturnTypeWithCommaAndCallType) {
- const std::map<int, std::string> a_map;
- EXPECT_CALL(this->mock_foo_, CTReturnTypeWithComma()).WillOnce(Return(a_map));
-
- EXPECT_EQ(a_map, this->mock_foo_.CTReturnTypeWithComma());
-}
-
-#endif // GTEST_OS_WINDOWS
-
-TEST(FunctionMockerTest, RefQualified) {
- MockFoo mock_foo;
-
- EXPECT_CALL(mock_foo, RefQualifiedConstRef).WillOnce(Return(1));
- EXPECT_CALL(std::move(mock_foo), // NOLINT
- RefQualifiedConstRefRef)
- .WillOnce(Return(2));
- EXPECT_CALL(mock_foo, RefQualifiedRef).WillOnce(Return(3));
- EXPECT_CALL(std::move(mock_foo), // NOLINT
- RefQualifiedRefRef)
- .WillOnce(Return(4));
-
- EXPECT_CALL(static_cast<const MockFoo&>(mock_foo), RefQualifiedOverloaded())
- .WillOnce(Return(5));
- EXPECT_CALL(static_cast<const MockFoo&&>(mock_foo), RefQualifiedOverloaded())
- .WillOnce(Return(6));
- EXPECT_CALL(static_cast<MockFoo&>(mock_foo), RefQualifiedOverloaded())
- .WillOnce(Return(7));
- EXPECT_CALL(static_cast<MockFoo&&>(mock_foo), RefQualifiedOverloaded())
- .WillOnce(Return(8));
-
- EXPECT_EQ(mock_foo.RefQualifiedConstRef(), 1);
- EXPECT_EQ(std::move(mock_foo).RefQualifiedConstRefRef(), 2); // NOLINT
- EXPECT_EQ(mock_foo.RefQualifiedRef(), 3);
- EXPECT_EQ(std::move(mock_foo).RefQualifiedRefRef(), 4); // NOLINT
-
- EXPECT_EQ(std::cref(mock_foo).get().RefQualifiedOverloaded(), 5);
- EXPECT_EQ(std::move(std::cref(mock_foo).get()) // NOLINT
- .RefQualifiedOverloaded(),
- 6);
- EXPECT_EQ(mock_foo.RefQualifiedOverloaded(), 7);
- EXPECT_EQ(std::move(mock_foo).RefQualifiedOverloaded(), 8); // NOLINT
-}
-
-class MockB {
- public:
- MockB() {}
-
- MOCK_METHOD(void, DoB, ());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
-};
-
-class LegacyMockB {
- public:
- LegacyMockB() {}
-
- MOCK_METHOD0(DoB, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockB);
-};
-
-template <typename T>
-class ExpectCallTest : public ::testing::Test {};
-using ExpectCallTestTypes = ::testing::Types<MockB, LegacyMockB>;
-TYPED_TEST_SUITE(ExpectCallTest, ExpectCallTestTypes);
-
-// Tests that functions with no EXPECT_CALL() rules can be called any
-// number of times.
-TYPED_TEST(ExpectCallTest, UnmentionedFunctionCanBeCalledAnyNumberOfTimes) {
- { TypeParam b; }
-
- {
- TypeParam b;
- b.DoB();
- }
-
- {
- TypeParam b;
- b.DoB();
- b.DoB();
- }
-}
-
-// Tests mocking template interfaces.
-
-template <typename T>
-class StackInterface {
- public:
- virtual ~StackInterface() {}
-
- // Template parameter appears in function parameter.
- virtual void Push(const T& value) = 0;
- virtual void Pop() = 0;
- virtual int GetSize() const = 0;
- // Template parameter appears in function return type.
- virtual const T& GetTop() const = 0;
-};
-
-template <typename T>
-class MockStack : public StackInterface<T> {
- public:
- MockStack() {}
-
- MOCK_METHOD(void, Push, (const T& elem), ());
- MOCK_METHOD(void, Pop, (), (final));
- MOCK_METHOD(int, GetSize, (), (const, override));
- MOCK_METHOD(const T&, GetTop, (), (const));
-
- // Tests that the function return type can contain unprotected comma.
- MOCK_METHOD((std::map<int, int>), ReturnTypeWithComma, (), ());
- MOCK_METHOD((std::map<int, int>), ReturnTypeWithComma, (int), (const));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStack);
-};
-
-template <typename T>
-class LegacyMockStack : public StackInterface<T> {
- public:
- LegacyMockStack() {}
-
- MOCK_METHOD1_T(Push, void(const T& elem));
- MOCK_METHOD0_T(Pop, void());
- MOCK_CONST_METHOD0_T(GetSize, int()); // NOLINT
- MOCK_CONST_METHOD0_T(GetTop, const T&());
-
- // Tests that the function return type can contain unprotected comma.
- MOCK_METHOD0_T(ReturnTypeWithComma, std::map<int, int>());
- MOCK_CONST_METHOD1_T(ReturnTypeWithComma, std::map<int, int>(int)); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockStack);
-};
-
-template <typename T>
-class TemplateMockTest : public ::testing::Test {};
-using TemplateMockTestTypes =
- ::testing::Types<MockStack<int>, LegacyMockStack<int>>;
-TYPED_TEST_SUITE(TemplateMockTest, TemplateMockTestTypes);
-
-// Tests that template mock works.
-TYPED_TEST(TemplateMockTest, Works) {
- TypeParam mock;
-
- EXPECT_CALL(mock, GetSize())
- .WillOnce(Return(0))
- .WillOnce(Return(1))
- .WillOnce(Return(0));
- EXPECT_CALL(mock, Push(_));
- int n = 5;
- EXPECT_CALL(mock, GetTop())
- .WillOnce(ReturnRef(n));
- EXPECT_CALL(mock, Pop())
- .Times(AnyNumber());
-
- EXPECT_EQ(0, mock.GetSize());
- mock.Push(5);
- EXPECT_EQ(1, mock.GetSize());
- EXPECT_EQ(5, mock.GetTop());
- mock.Pop();
- EXPECT_EQ(0, mock.GetSize());
-}
-
-TYPED_TEST(TemplateMockTest, MethodWithCommaInReturnTypeWorks) {
- TypeParam mock;
-
- const std::map<int, int> a_map;
- EXPECT_CALL(mock, ReturnTypeWithComma())
- .WillOnce(Return(a_map));
- EXPECT_CALL(mock, ReturnTypeWithComma(1))
- .WillOnce(Return(a_map));
-
- EXPECT_EQ(a_map, mock.ReturnTypeWithComma());
- EXPECT_EQ(a_map, mock.ReturnTypeWithComma(1));
-}
-
-#if GTEST_OS_WINDOWS
-// Tests mocking template interfaces with calltype.
-
-template <typename T>
-class StackInterfaceWithCallType {
- public:
- virtual ~StackInterfaceWithCallType() {}
-
- // Template parameter appears in function parameter.
- STDMETHOD_(void, Push)(const T& value) = 0;
- STDMETHOD_(void, Pop)() = 0;
- STDMETHOD_(int, GetSize)() const = 0;
- // Template parameter appears in function return type.
- STDMETHOD_(const T&, GetTop)() const = 0;
-};
-
-template <typename T>
-class MockStackWithCallType : public StackInterfaceWithCallType<T> {
- public:
- MockStackWithCallType() {}
-
- MOCK_METHOD(void, Push, (const T& elem),
- (Calltype(STDMETHODCALLTYPE), override));
- MOCK_METHOD(void, Pop, (), (Calltype(STDMETHODCALLTYPE), override));
- MOCK_METHOD(int, GetSize, (), (Calltype(STDMETHODCALLTYPE), override, const));
- MOCK_METHOD(const T&, GetTop, (),
- (Calltype(STDMETHODCALLTYPE), override, const));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockStackWithCallType);
-};
-
-template <typename T>
-class LegacyMockStackWithCallType : public StackInterfaceWithCallType<T> {
- public:
- LegacyMockStackWithCallType() {}
-
- MOCK_METHOD1_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Push, void(const T& elem));
- MOCK_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, Pop, void());
- MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetSize, int());
- MOCK_CONST_METHOD0_T_WITH_CALLTYPE(STDMETHODCALLTYPE, GetTop, const T&());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockStackWithCallType);
-};
-
-template <typename T>
-class TemplateMockTestWithCallType : public ::testing::Test {};
-using TemplateMockTestWithCallTypeTypes =
- ::testing::Types<MockStackWithCallType<int>,
- LegacyMockStackWithCallType<int>>;
-TYPED_TEST_SUITE(TemplateMockTestWithCallType,
- TemplateMockTestWithCallTypeTypes);
-
-// Tests that template mock with calltype works.
-TYPED_TEST(TemplateMockTestWithCallType, Works) {
- TypeParam mock;
-
- EXPECT_CALL(mock, GetSize())
- .WillOnce(Return(0))
- .WillOnce(Return(1))
- .WillOnce(Return(0));
- EXPECT_CALL(mock, Push(_));
- int n = 5;
- EXPECT_CALL(mock, GetTop())
- .WillOnce(ReturnRef(n));
- EXPECT_CALL(mock, Pop())
- .Times(AnyNumber());
-
- EXPECT_EQ(0, mock.GetSize());
- mock.Push(5);
- EXPECT_EQ(1, mock.GetSize());
- EXPECT_EQ(5, mock.GetTop());
- mock.Pop();
- EXPECT_EQ(0, mock.GetSize());
-}
-#endif // GTEST_OS_WINDOWS
-
-#define MY_MOCK_METHODS1_ \
- MOCK_METHOD(void, Overloaded, ()); \
- MOCK_METHOD(int, Overloaded, (int), (const)); \
- MOCK_METHOD(bool, Overloaded, (bool f, int n))
-
-#define LEGACY_MY_MOCK_METHODS1_ \
- MOCK_METHOD0(Overloaded, void()); \
- MOCK_CONST_METHOD1(Overloaded, int(int n)); \
- MOCK_METHOD2(Overloaded, bool(bool f, int n))
-
-class MockOverloadedOnArgNumber {
- public:
- MockOverloadedOnArgNumber() {}
-
- MY_MOCK_METHODS1_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnArgNumber);
-};
-
-class LegacyMockOverloadedOnArgNumber {
- public:
- LegacyMockOverloadedOnArgNumber() {}
-
- LEGACY_MY_MOCK_METHODS1_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LegacyMockOverloadedOnArgNumber);
-};
-
-template <typename T>
-class OverloadedMockMethodTest : public ::testing::Test {};
-using OverloadedMockMethodTestTypes =
- ::testing::Types<MockOverloadedOnArgNumber,
- LegacyMockOverloadedOnArgNumber>;
-TYPED_TEST_SUITE(OverloadedMockMethodTest, OverloadedMockMethodTestTypes);
-
-TYPED_TEST(OverloadedMockMethodTest, CanOverloadOnArgNumberInMacroBody) {
- TypeParam mock;
- EXPECT_CALL(mock, Overloaded());
- EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
- EXPECT_CALL(mock, Overloaded(true, 1)).WillOnce(Return(true));
-
- mock.Overloaded();
- EXPECT_EQ(2, mock.Overloaded(1));
- EXPECT_TRUE(mock.Overloaded(true, 1));
-}
-
-#define MY_MOCK_METHODS2_ \
- MOCK_CONST_METHOD1(Overloaded, int(int n)); \
- MOCK_METHOD1(Overloaded, int(int n))
-
-class MockOverloadedOnConstness {
- public:
- MockOverloadedOnConstness() {}
-
- MY_MOCK_METHODS2_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockOverloadedOnConstness);
-};
-
-TEST(MockMethodOverloadedMockMethodTest, CanOverloadOnConstnessInMacroBody) {
- MockOverloadedOnConstness mock;
- const MockOverloadedOnConstness* const_mock = &mock;
- EXPECT_CALL(mock, Overloaded(1)).WillOnce(Return(2));
- EXPECT_CALL(*const_mock, Overloaded(1)).WillOnce(Return(3));
-
- EXPECT_EQ(2, mock.Overloaded(1));
- EXPECT_EQ(3, const_mock->Overloaded(1));
-}
-
-TEST(MockMethodMockFunctionTest, WorksForVoidNullary) {
- MockFunction<void()> foo;
- EXPECT_CALL(foo, Call());
- foo.Call();
-}
-
-TEST(MockMethodMockFunctionTest, WorksForNonVoidNullary) {
- MockFunction<int()> foo;
- EXPECT_CALL(foo, Call())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_EQ(1, foo.Call());
- EXPECT_EQ(2, foo.Call());
-}
-
-TEST(MockMethodMockFunctionTest, WorksForVoidUnary) {
- MockFunction<void(int)> foo;
- EXPECT_CALL(foo, Call(1));
- foo.Call(1);
-}
-
-TEST(MockMethodMockFunctionTest, WorksForNonVoidBinary) {
- MockFunction<int(bool, int)> foo;
- EXPECT_CALL(foo, Call(false, 42))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_CALL(foo, Call(true, Ge(100)))
- .WillOnce(Return(3));
- EXPECT_EQ(1, foo.Call(false, 42));
- EXPECT_EQ(2, foo.Call(false, 42));
- EXPECT_EQ(3, foo.Call(true, 120));
-}
-
-TEST(MockMethodMockFunctionTest, WorksFor10Arguments) {
- MockFunction<int(bool a0, char a1, int a2, int a3, int a4,
- int a5, int a6, char a7, int a8, bool a9)> foo;
- EXPECT_CALL(foo, Call(_, 'a', _, _, _, _, _, _, _, _))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
- EXPECT_EQ(1, foo.Call(false, 'a', 0, 0, 0, 0, 0, 'b', 0, true));
- EXPECT_EQ(2, foo.Call(true, 'a', 0, 0, 0, 0, 0, 'b', 1, false));
-}
-
-TEST(MockMethodMockFunctionTest, AsStdFunction) {
- MockFunction<int(int)> foo;
- auto call = [](const std::function<int(int)> &f, int i) {
- return f(i);
- };
- EXPECT_CALL(foo, Call(1)).WillOnce(Return(-1));
- EXPECT_CALL(foo, Call(2)).WillOnce(Return(-2));
- EXPECT_EQ(-1, call(foo.AsStdFunction(), 1));
- EXPECT_EQ(-2, call(foo.AsStdFunction(), 2));
-}
-
-TEST(MockMethodMockFunctionTest, AsStdFunctionReturnsReference) {
- MockFunction<int&()> foo;
- int value = 1;
- EXPECT_CALL(foo, Call()).WillOnce(ReturnRef(value));
- int& ref = foo.AsStdFunction()();
- EXPECT_EQ(1, ref);
- value = 2;
- EXPECT_EQ(2, ref);
-}
-
-TEST(MockMethodMockFunctionTest, AsStdFunctionWithReferenceParameter) {
- MockFunction<int(int &)> foo;
- auto call = [](const std::function<int(int& )> &f, int &i) {
- return f(i);
- };
- int i = 42;
- EXPECT_CALL(foo, Call(i)).WillOnce(Return(-1));
- EXPECT_EQ(-1, call(foo.AsStdFunction(), i));
-}
-
-namespace {
-
-template <typename Expected, typename F>
-static constexpr bool IsMockFunctionTemplateArgumentDeducedTo(
- const internal::MockFunction<F>&) {
- return std::is_same<F, Expected>::value;
-}
-
-} // namespace
-
-template <typename F>
-class MockMethodMockFunctionSignatureTest : public Test {};
-
-using MockMethodMockFunctionSignatureTypes =
- Types<void(), int(), void(int), int(int), int(bool, int),
- int(bool, char, int, int, int, int, int, char, int, bool)>;
-TYPED_TEST_SUITE(MockMethodMockFunctionSignatureTest,
- MockMethodMockFunctionSignatureTypes);
-
-TYPED_TEST(MockMethodMockFunctionSignatureTest,
- IsMockFunctionTemplateArgumentDeducedForRawSignature) {
- using Argument = TypeParam;
- MockFunction<Argument> foo;
- EXPECT_TRUE(IsMockFunctionTemplateArgumentDeducedTo<TypeParam>(foo));
-}
-
-TYPED_TEST(MockMethodMockFunctionSignatureTest,
- IsMockFunctionTemplateArgumentDeducedForStdFunction) {
- using Argument = std::function<TypeParam>;
- MockFunction<Argument> foo;
- EXPECT_TRUE(IsMockFunctionTemplateArgumentDeducedTo<TypeParam>(foo));
-}
-
-TYPED_TEST(
- MockMethodMockFunctionSignatureTest,
- IsMockFunctionCallMethodSignatureTheSameForRawSignatureAndStdFunction) {
- using ForRawSignature = decltype(&MockFunction<TypeParam>::Call);
- using ForStdFunction =
- decltype(&MockFunction<std::function<TypeParam>>::Call);
- EXPECT_TRUE((std::is_same<ForRawSignature, ForStdFunction>::value));
-}
-
-template <typename F>
-struct AlternateCallable {
-};
-
-TYPED_TEST(MockMethodMockFunctionSignatureTest,
- IsMockFunctionTemplateArgumentDeducedForAlternateCallable) {
- using Argument = AlternateCallable<TypeParam>;
- MockFunction<Argument> foo;
- EXPECT_TRUE(IsMockFunctionTemplateArgumentDeducedTo<TypeParam>(foo));
-}
-
-TYPED_TEST(
- MockMethodMockFunctionSignatureTest,
- IsMockFunctionCallMethodSignatureTheSameForAlternateCallable) {
- using ForRawSignature = decltype(&MockFunction<TypeParam>::Call);
- using ForStdFunction =
- decltype(&MockFunction<std::function<TypeParam>>::Call);
- EXPECT_TRUE((std::is_same<ForRawSignature, ForStdFunction>::value));
-}
-
-
-struct MockMethodSizes0 {
- MOCK_METHOD(void, func, ());
-};
-struct MockMethodSizes1 {
- MOCK_METHOD(void, func, (int));
-};
-struct MockMethodSizes2 {
- MOCK_METHOD(void, func, (int, int));
-};
-struct MockMethodSizes3 {
- MOCK_METHOD(void, func, (int, int, int));
-};
-struct MockMethodSizes4 {
- MOCK_METHOD(void, func, (int, int, int, int));
-};
-
-struct LegacyMockMethodSizes0 {
- MOCK_METHOD0(func, void());
-};
-struct LegacyMockMethodSizes1 {
- MOCK_METHOD1(func, void(int));
-};
-struct LegacyMockMethodSizes2 {
- MOCK_METHOD2(func, void(int, int));
-};
-struct LegacyMockMethodSizes3 {
- MOCK_METHOD3(func, void(int, int, int));
-};
-struct LegacyMockMethodSizes4 {
- MOCK_METHOD4(func, void(int, int, int, int));
-};
-
-
-TEST(MockMethodMockFunctionTest, MockMethodSizeOverhead) {
- EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes1));
- EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes2));
- EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes3));
- EXPECT_EQ(sizeof(MockMethodSizes0), sizeof(MockMethodSizes4));
-
- EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(LegacyMockMethodSizes1));
- EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(LegacyMockMethodSizes2));
- EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(LegacyMockMethodSizes3));
- EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(LegacyMockMethodSizes4));
-
- EXPECT_EQ(sizeof(LegacyMockMethodSizes0), sizeof(MockMethodSizes0));
-}
-
-void hasTwoParams(int, int);
-void MaybeThrows();
-void DoesntThrow() noexcept;
-struct MockMethodNoexceptSpecifier {
- MOCK_METHOD(void, func1, (), (noexcept));
- MOCK_METHOD(void, func2, (), (noexcept(true)));
- MOCK_METHOD(void, func3, (), (noexcept(false)));
- MOCK_METHOD(void, func4, (), (noexcept(noexcept(MaybeThrows()))));
- MOCK_METHOD(void, func5, (), (noexcept(noexcept(DoesntThrow()))));
- MOCK_METHOD(void, func6, (), (noexcept(noexcept(DoesntThrow())), const));
- MOCK_METHOD(void, func7, (), (const, noexcept(noexcept(DoesntThrow()))));
- // Put commas in the noexcept expression
- MOCK_METHOD(void, func8, (), (noexcept(noexcept(hasTwoParams(1, 2))), const));
-};
-
-TEST(MockMethodMockFunctionTest, NoexceptSpecifierPreserved) {
- EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func1()));
- EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func2()));
- EXPECT_FALSE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func3()));
- EXPECT_FALSE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func4()));
- EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func5()));
- EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func6()));
- EXPECT_TRUE(noexcept(std::declval<MockMethodNoexceptSpecifier>().func7()));
- EXPECT_EQ(noexcept(std::declval<MockMethodNoexceptSpecifier>().func8()),
- noexcept(hasTwoParams(1, 2)));
-}
-
-} // namespace gmock_function_mocker_test
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-internal-utils_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-internal-utils_test.cc
deleted file mode 100644
index 800ee8add0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-internal-utils_test.cc
+++ /dev/null
@@ -1,766 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal utilities.
-
-#include "gmock/internal/gmock-internal-utils.h"
-
-#include <stdlib.h>
-
-#include <cstdint>
-#include <map>
-#include <memory>
-#include <sstream>
-#include <string>
-#include <vector>
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-
-// Indicates that this translation unit is part of Google Test's
-// implementation. It must come before gtest-internal-inl.h is
-// included, or there will be a compiler error. This trick is to
-// prevent a user from accidentally including gtest-internal-inl.h in
-// their code.
-#define GTEST_IMPLEMENTATION_ 1
-#include "src/gtest-internal-inl.h"
-#undef GTEST_IMPLEMENTATION_
-
-#if GTEST_OS_CYGWIN
-# include <sys/types.h> // For ssize_t. NOLINT
-#endif
-
-namespace proto2 {
-class Message;
-} // namespace proto2
-
-namespace testing {
-namespace internal {
-
-namespace {
-
-TEST(JoinAsKeyValueTupleTest, JoinsEmptyTuple) {
- EXPECT_EQ("", JoinAsKeyValueTuple({}, Strings()));
-}
-
-TEST(JoinAsKeyValueTupleTest, JoinsOneTuple) {
- EXPECT_EQ("(a: 1)", JoinAsKeyValueTuple({"a"}, {"1"}));
-}
-
-TEST(JoinAsKeyValueTupleTest, JoinsTwoTuple) {
- EXPECT_EQ("(a: 1, b: 2)", JoinAsKeyValueTuple({"a", "b"}, {"1", "2"}));
-}
-
-TEST(JoinAsKeyValueTupleTest, JoinsTenTuple) {
- EXPECT_EQ(
- "(a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10)",
- JoinAsKeyValueTuple({"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"},
- {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsNoWord) {
- EXPECT_EQ("", ConvertIdentifierNameToWords(""));
- EXPECT_EQ("", ConvertIdentifierNameToWords("_"));
- EXPECT_EQ("", ConvertIdentifierNameToWords("__"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsDigits) {
- EXPECT_EQ("1", ConvertIdentifierNameToWords("_1"));
- EXPECT_EQ("2", ConvertIdentifierNameToWords("2_"));
- EXPECT_EQ("34", ConvertIdentifierNameToWords("_34_"));
- EXPECT_EQ("34 56", ConvertIdentifierNameToWords("_34_56"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsCamelCaseWords) {
- EXPECT_EQ("a big word", ConvertIdentifierNameToWords("ABigWord"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("FooBar"));
- EXPECT_EQ("foo", ConvertIdentifierNameToWords("Foo_"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("_Foo_Bar_"));
- EXPECT_EQ("foo and bar", ConvertIdentifierNameToWords("_Foo__And_Bar"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContains_SeparatedWords) {
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("foo_bar"));
- EXPECT_EQ("foo", ConvertIdentifierNameToWords("_foo_"));
- EXPECT_EQ("foo bar", ConvertIdentifierNameToWords("_foo_bar_"));
- EXPECT_EQ("foo and bar", ConvertIdentifierNameToWords("_foo__and_bar"));
-}
-
-TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameIsMixture) {
- EXPECT_EQ("foo bar 123", ConvertIdentifierNameToWords("Foo_bar123"));
- EXPECT_EQ("chapter 11 section 1",
- ConvertIdentifierNameToWords("_Chapter11Section_1_"));
-}
-
-TEST(GetRawPointerTest, WorksForSmartPointers) {
- const char* const raw_p1 = new const char('a'); // NOLINT
- const std::unique_ptr<const char> p1(raw_p1);
- EXPECT_EQ(raw_p1, GetRawPointer(p1));
- double* const raw_p2 = new double(2.5); // NOLINT
- const std::shared_ptr<double> p2(raw_p2);
- EXPECT_EQ(raw_p2, GetRawPointer(p2));
-}
-
-TEST(GetRawPointerTest, WorksForRawPointers) {
- int* p = nullptr;
- EXPECT_TRUE(nullptr == GetRawPointer(p));
- int n = 1;
- EXPECT_EQ(&n, GetRawPointer(&n));
-}
-
-TEST(GetRawPointerTest, WorksForStdReferenceWrapper) {
- int n = 1;
- EXPECT_EQ(&n, GetRawPointer(std::ref(n)));
- EXPECT_EQ(&n, GetRawPointer(std::cref(n)));
-}
-
-// Tests KindOf<T>.
-
-class Base {};
-class Derived : public Base {};
-
-TEST(KindOfTest, Bool) {
- EXPECT_EQ(kBool, GMOCK_KIND_OF_(bool)); // NOLINT
-}
-
-TEST(KindOfTest, Integer) {
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(signed char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned char)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(short)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned short)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(int)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned int)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(long long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(unsigned long long)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(wchar_t)); // NOLINT
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(size_t)); // NOLINT
-#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_CYGWIN
- // ssize_t is not defined on Windows and possibly some other OSes.
- EXPECT_EQ(kInteger, GMOCK_KIND_OF_(ssize_t)); // NOLINT
-#endif
-}
-
-TEST(KindOfTest, FloatingPoint) {
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(float)); // NOLINT
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(double)); // NOLINT
- EXPECT_EQ(kFloatingPoint, GMOCK_KIND_OF_(long double)); // NOLINT
-}
-
-TEST(KindOfTest, Other) {
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(void*)); // NOLINT
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(char**)); // NOLINT
- EXPECT_EQ(kOther, GMOCK_KIND_OF_(Base)); // NOLINT
-}
-
-// Tests LosslessArithmeticConvertible<T, U>.
-
-TEST(LosslessArithmeticConvertibleTest, BoolToBool) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, BoolToInteger) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, char>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, int>::value));
- EXPECT_TRUE(
- (LosslessArithmeticConvertible<bool, unsigned long>::value)); // NOLINT
-}
-
-TEST(LosslessArithmeticConvertibleTest, BoolToFloatingPoint) {
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, float>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<bool, double>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToBool) {
- EXPECT_FALSE((LosslessArithmeticConvertible<unsigned char, bool>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToInteger) {
- // Unsigned => larger signed is fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<unsigned char, int>::value));
-
- // Unsigned => larger unsigned is fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<
- unsigned short, uint64_t>::value)); // NOLINT
-
- // Signed => unsigned is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<
- short, uint64_t>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<
- signed char, unsigned int>::value)); // NOLINT
-
- // Same size and same signedness: fine too.
- EXPECT_TRUE((LosslessArithmeticConvertible<
- unsigned char, unsigned char>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<int, int>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<wchar_t, wchar_t>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<
- unsigned long, unsigned long>::value)); // NOLINT
-
- // Same size, different signedness: not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<
- unsigned char, signed char>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, unsigned int>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<uint64_t, int64_t>::value));
-
- // Larger size => smaller size is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<long, char>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<int, signed char>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int64_t, unsigned int>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, IntegerToFloatingPoint) {
- // Integers cannot be losslessly converted to floating-points, as
- // the format of the latter is implementation-defined.
- EXPECT_FALSE((LosslessArithmeticConvertible<char, float>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<int, double>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<
- short, long double>::value)); // NOLINT
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToBool) {
- EXPECT_FALSE((LosslessArithmeticConvertible<float, bool>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<double, bool>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToInteger) {
- EXPECT_FALSE((LosslessArithmeticConvertible<float, long>::value)); // NOLINT
- EXPECT_FALSE((LosslessArithmeticConvertible<double, int64_t>::value));
- EXPECT_FALSE((LosslessArithmeticConvertible<long double, int>::value));
-}
-
-TEST(LosslessArithmeticConvertibleTest, FloatingPointToFloatingPoint) {
- // Smaller size => larger size is fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<float, double>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<float, long double>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<double, long double>::value));
-
- // Same size: fine.
- EXPECT_TRUE((LosslessArithmeticConvertible<float, float>::value));
- EXPECT_TRUE((LosslessArithmeticConvertible<double, double>::value));
-
- // Larger size => smaller size is not fine.
- EXPECT_FALSE((LosslessArithmeticConvertible<double, float>::value));
- GTEST_INTENTIONAL_CONST_COND_PUSH_()
- if (sizeof(double) == sizeof(long double)) { // NOLINT
- GTEST_INTENTIONAL_CONST_COND_POP_()
- // In some implementations (e.g. MSVC), double and long double
- // have the same size.
- EXPECT_TRUE((LosslessArithmeticConvertible<long double, double>::value));
- } else {
- EXPECT_FALSE((LosslessArithmeticConvertible<long double, double>::value));
- }
-}
-
-// Tests the TupleMatches() template function.
-
-TEST(TupleMatchesTest, WorksForSize0) {
- std::tuple<> matchers;
- std::tuple<> values;
-
- EXPECT_TRUE(TupleMatches(matchers, values));
-}
-
-TEST(TupleMatchesTest, WorksForSize1) {
- std::tuple<Matcher<int> > matchers(Eq(1));
- std::tuple<int> values1(1), values2(2);
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
-}
-
-TEST(TupleMatchesTest, WorksForSize2) {
- std::tuple<Matcher<int>, Matcher<char> > matchers(Eq(1), Eq('a'));
- std::tuple<int, char> values1(1, 'a'), values2(1, 'b'), values3(2, 'a'),
- values4(2, 'b');
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
- EXPECT_FALSE(TupleMatches(matchers, values3));
- EXPECT_FALSE(TupleMatches(matchers, values4));
-}
-
-TEST(TupleMatchesTest, WorksForSize5) {
- std::tuple<Matcher<int>, Matcher<char>, Matcher<bool>,
- Matcher<long>, // NOLINT
- Matcher<std::string> >
- matchers(Eq(1), Eq('a'), Eq(true), Eq(2L), Eq("hi"));
- std::tuple<int, char, bool, long, std::string> // NOLINT
- values1(1, 'a', true, 2L, "hi"), values2(1, 'a', true, 2L, "hello"),
- values3(2, 'a', true, 2L, "hi");
-
- EXPECT_TRUE(TupleMatches(matchers, values1));
- EXPECT_FALSE(TupleMatches(matchers, values2));
- EXPECT_FALSE(TupleMatches(matchers, values3));
-}
-
-// Tests that Assert(true, ...) succeeds.
-TEST(AssertTest, SucceedsOnTrue) {
- Assert(true, __FILE__, __LINE__, "This should succeed.");
- Assert(true, __FILE__, __LINE__); // This should succeed too.
-}
-
-// Tests that Assert(false, ...) generates a fatal failure.
-TEST(AssertTest, FailsFatallyOnFalse) {
- EXPECT_DEATH_IF_SUPPORTED({
- Assert(false, __FILE__, __LINE__, "This should fail.");
- }, "");
-
- EXPECT_DEATH_IF_SUPPORTED({
- Assert(false, __FILE__, __LINE__);
- }, "");
-}
-
-// Tests that Expect(true, ...) succeeds.
-TEST(ExpectTest, SucceedsOnTrue) {
- Expect(true, __FILE__, __LINE__, "This should succeed.");
- Expect(true, __FILE__, __LINE__); // This should succeed too.
-}
-
-// Tests that Expect(false, ...) generates a non-fatal failure.
-TEST(ExpectTest, FailsNonfatallyOnFalse) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Expect(false, __FILE__, __LINE__, "This should fail.");
- }, "This should fail");
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- Expect(false, __FILE__, __LINE__);
- }, "Expectation failed");
-}
-
-// Tests LogIsVisible().
-
-class LogIsVisibleTest : public ::testing::Test {
- protected:
- void SetUp() override { original_verbose_ = GMOCK_FLAG_GET(verbose); }
-
- void TearDown() override { GMOCK_FLAG_SET(verbose, original_verbose_); }
-
- std::string original_verbose_;
-};
-
-TEST_F(LogIsVisibleTest, AlwaysReturnsTrueIfVerbosityIsInfo) {
- GMOCK_FLAG_SET(verbose, kInfoVerbosity);
- EXPECT_TRUE(LogIsVisible(kInfo));
- EXPECT_TRUE(LogIsVisible(kWarning));
-}
-
-TEST_F(LogIsVisibleTest, AlwaysReturnsFalseIfVerbosityIsError) {
- GMOCK_FLAG_SET(verbose, kErrorVerbosity);
- EXPECT_FALSE(LogIsVisible(kInfo));
- EXPECT_FALSE(LogIsVisible(kWarning));
-}
-
-TEST_F(LogIsVisibleTest, WorksWhenVerbosityIsWarning) {
- GMOCK_FLAG_SET(verbose, kWarningVerbosity);
- EXPECT_FALSE(LogIsVisible(kInfo));
- EXPECT_TRUE(LogIsVisible(kWarning));
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests the Log() function.
-
-// Verifies that Log() behaves correctly for the given verbosity level
-// and log severity.
-void TestLogWithSeverity(const std::string& verbosity, LogSeverity severity,
- bool should_print) {
- const std::string old_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, verbosity);
- CaptureStdout();
- Log(severity, "Test log.\n", 0);
- if (should_print) {
- EXPECT_THAT(GetCapturedStdout().c_str(),
- ContainsRegex(
- severity == kWarning ?
- "^\nGMOCK WARNING:\nTest log\\.\nStack trace:\n" :
- "^\nTest log\\.\nStack trace:\n"));
- } else {
- EXPECT_STREQ("", GetCapturedStdout().c_str());
- }
- GMOCK_FLAG_SET(verbose, old_flag);
-}
-
-// Tests that when the stack_frames_to_skip parameter is negative,
-// Log() doesn't include the stack trace in the output.
-TEST(LogTest, NoStackTraceWhenStackFramesToSkipIsNegative) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, kInfoVerbosity);
- CaptureStdout();
- Log(kInfo, "Test log.\n", -1);
- EXPECT_STREQ("\nTest log.\n", GetCapturedStdout().c_str());
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-struct MockStackTraceGetter : testing::internal::OsStackTraceGetterInterface {
- std::string CurrentStackTrace(int max_depth, int skip_count) override {
- return (testing::Message() << max_depth << "::" << skip_count << "\n")
- .GetString();
- }
- void UponLeavingGTest() override {}
-};
-
-// Tests that in opt mode, a positive stack_frames_to_skip argument is
-// treated as 0.
-TEST(LogTest, NoSkippingStackFrameInOptMode) {
- MockStackTraceGetter* mock_os_stack_trace_getter = new MockStackTraceGetter;
- GetUnitTestImpl()->set_os_stack_trace_getter(mock_os_stack_trace_getter);
-
- CaptureStdout();
- Log(kWarning, "Test log.\n", 100);
- const std::string log = GetCapturedStdout();
-
- std::string expected_trace =
- (testing::Message() << GTEST_FLAG_GET(stack_trace_depth) << "::")
- .GetString();
- std::string expected_message =
- "\nGMOCK WARNING:\n"
- "Test log.\n"
- "Stack trace:\n" +
- expected_trace;
- EXPECT_THAT(log, HasSubstr(expected_message));
- int skip_count = atoi(log.substr(expected_message.size()).c_str());
-
-# if defined(NDEBUG)
- // In opt mode, no stack frame should be skipped.
- const int expected_skip_count = 0;
-# else
- // In dbg mode, the stack frames should be skipped.
- const int expected_skip_count = 100;
-# endif
-
- // Note that each inner implementation layer will +1 the number to remove
- // itself from the trace. This means that the value is a little higher than
- // expected, but close enough.
- EXPECT_THAT(skip_count,
- AllOf(Ge(expected_skip_count), Le(expected_skip_count + 10)));
-
- // Restores the default OS stack trace getter.
- GetUnitTestImpl()->set_os_stack_trace_getter(nullptr);
-}
-
-// Tests that all logs are printed when the value of the
-// --gmock_verbose flag is "info".
-TEST(LogTest, AllLogsArePrintedWhenVerbosityIsInfo) {
- TestLogWithSeverity(kInfoVerbosity, kInfo, true);
- TestLogWithSeverity(kInfoVerbosity, kWarning, true);
-}
-
-// Tests that only warnings are printed when the value of the
-// --gmock_verbose flag is "warning".
-TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsWarning) {
- TestLogWithSeverity(kWarningVerbosity, kInfo, false);
- TestLogWithSeverity(kWarningVerbosity, kWarning, true);
-}
-
-// Tests that no logs are printed when the value of the
-// --gmock_verbose flag is "error".
-TEST(LogTest, NoLogsArePrintedWhenVerbosityIsError) {
- TestLogWithSeverity(kErrorVerbosity, kInfo, false);
- TestLogWithSeverity(kErrorVerbosity, kWarning, false);
-}
-
-// Tests that only warnings are printed when the value of the
-// --gmock_verbose flag is invalid.
-TEST(LogTest, OnlyWarningsArePrintedWhenVerbosityIsInvalid) {
- TestLogWithSeverity("invalid", kInfo, false);
- TestLogWithSeverity("invalid", kWarning, true);
-}
-
-// Verifies that Log() behaves correctly for the given verbosity level
-// and log severity.
-std::string GrabOutput(void(*logger)(), const char* verbosity) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, verbosity);
- CaptureStdout();
- logger();
- GMOCK_FLAG_SET(verbose, saved_flag);
- return GetCapturedStdout();
-}
-
-class DummyMock {
- public:
- MOCK_METHOD0(TestMethod, void());
- MOCK_METHOD1(TestMethodArg, void(int dummy));
-};
-
-void ExpectCallLogger() {
- DummyMock mock;
- EXPECT_CALL(mock, TestMethod());
- mock.TestMethod();
-}
-
-// Verifies that EXPECT_CALL logs if the --gmock_verbose flag is set to "info".
-TEST(ExpectCallTest, LogsWhenVerbosityIsInfo) {
- EXPECT_THAT(std::string(GrabOutput(ExpectCallLogger, kInfoVerbosity)),
- HasSubstr("EXPECT_CALL(mock, TestMethod())"));
-}
-
-// Verifies that EXPECT_CALL doesn't log
-// if the --gmock_verbose flag is set to "warning".
-TEST(ExpectCallTest, DoesNotLogWhenVerbosityIsWarning) {
- EXPECT_STREQ("", GrabOutput(ExpectCallLogger, kWarningVerbosity).c_str());
-}
-
-// Verifies that EXPECT_CALL doesn't log
-// if the --gmock_verbose flag is set to "error".
-TEST(ExpectCallTest, DoesNotLogWhenVerbosityIsError) {
- EXPECT_STREQ("", GrabOutput(ExpectCallLogger, kErrorVerbosity).c_str());
-}
-
-void OnCallLogger() {
- DummyMock mock;
- ON_CALL(mock, TestMethod());
-}
-
-// Verifies that ON_CALL logs if the --gmock_verbose flag is set to "info".
-TEST(OnCallTest, LogsWhenVerbosityIsInfo) {
- EXPECT_THAT(std::string(GrabOutput(OnCallLogger, kInfoVerbosity)),
- HasSubstr("ON_CALL(mock, TestMethod())"));
-}
-
-// Verifies that ON_CALL doesn't log
-// if the --gmock_verbose flag is set to "warning".
-TEST(OnCallTest, DoesNotLogWhenVerbosityIsWarning) {
- EXPECT_STREQ("", GrabOutput(OnCallLogger, kWarningVerbosity).c_str());
-}
-
-// Verifies that ON_CALL doesn't log if
-// the --gmock_verbose flag is set to "error".
-TEST(OnCallTest, DoesNotLogWhenVerbosityIsError) {
- EXPECT_STREQ("", GrabOutput(OnCallLogger, kErrorVerbosity).c_str());
-}
-
-void OnCallAnyArgumentLogger() {
- DummyMock mock;
- ON_CALL(mock, TestMethodArg(_));
-}
-
-// Verifies that ON_CALL prints provided _ argument.
-TEST(OnCallTest, LogsAnythingArgument) {
- EXPECT_THAT(std::string(GrabOutput(OnCallAnyArgumentLogger, kInfoVerbosity)),
- HasSubstr("ON_CALL(mock, TestMethodArg(_)"));
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests StlContainerView.
-
-TEST(StlContainerViewTest, WorksForStlContainer) {
- StaticAssertTypeEq<std::vector<int>,
- StlContainerView<std::vector<int> >::type>();
- StaticAssertTypeEq<const std::vector<double>&,
- StlContainerView<std::vector<double> >::const_reference>();
-
- typedef std::vector<char> Chars;
- Chars v1;
- const Chars& v2(StlContainerView<Chars>::ConstReference(v1));
- EXPECT_EQ(&v1, &v2);
-
- v1.push_back('a');
- Chars v3 = StlContainerView<Chars>::Copy(v1);
- EXPECT_THAT(v3, Eq(v3));
-}
-
-TEST(StlContainerViewTest, WorksForStaticNativeArray) {
- StaticAssertTypeEq<NativeArray<int>,
- StlContainerView<int[3]>::type>();
- StaticAssertTypeEq<NativeArray<double>,
- StlContainerView<const double[4]>::type>();
- StaticAssertTypeEq<NativeArray<char[3]>,
- StlContainerView<const char[2][3]>::type>();
-
- StaticAssertTypeEq<const NativeArray<int>,
- StlContainerView<int[2]>::const_reference>();
-
- int a1[3] = { 0, 1, 2 };
- NativeArray<int> a2 = StlContainerView<int[3]>::ConstReference(a1);
- EXPECT_EQ(3U, a2.size());
- EXPECT_EQ(a1, a2.begin());
-
- const NativeArray<int> a3 = StlContainerView<int[3]>::Copy(a1);
- ASSERT_EQ(3U, a3.size());
- EXPECT_EQ(0, a3.begin()[0]);
- EXPECT_EQ(1, a3.begin()[1]);
- EXPECT_EQ(2, a3.begin()[2]);
-
- // Makes sure a1 and a3 aren't aliases.
- a1[0] = 3;
- EXPECT_EQ(0, a3.begin()[0]);
-}
-
-TEST(StlContainerViewTest, WorksForDynamicNativeArray) {
- StaticAssertTypeEq<NativeArray<int>,
- StlContainerView<std::tuple<const int*, size_t> >::type>();
- StaticAssertTypeEq<
- NativeArray<double>,
- StlContainerView<std::tuple<std::shared_ptr<double>, int> >::type>();
-
- StaticAssertTypeEq<
- const NativeArray<int>,
- StlContainerView<std::tuple<const int*, int> >::const_reference>();
-
- int a1[3] = { 0, 1, 2 };
- const int* const p1 = a1;
- NativeArray<int> a2 =
- StlContainerView<std::tuple<const int*, int> >::ConstReference(
- std::make_tuple(p1, 3));
- EXPECT_EQ(3U, a2.size());
- EXPECT_EQ(a1, a2.begin());
-
- const NativeArray<int> a3 = StlContainerView<std::tuple<int*, size_t> >::Copy(
- std::make_tuple(static_cast<int*>(a1), 3));
- ASSERT_EQ(3U, a3.size());
- EXPECT_EQ(0, a3.begin()[0]);
- EXPECT_EQ(1, a3.begin()[1]);
- EXPECT_EQ(2, a3.begin()[2]);
-
- // Makes sure a1 and a3 aren't aliases.
- a1[0] = 3;
- EXPECT_EQ(0, a3.begin()[0]);
-}
-
-// Tests the Function template struct.
-
-TEST(FunctionTest, Nullary) {
- typedef Function<int()> F; // NOLINT
- EXPECT_EQ(0u, F::ArgumentCount);
- EXPECT_TRUE((std::is_same<int, F::Result>::value));
- EXPECT_TRUE((std::is_same<std::tuple<>, F::ArgumentTuple>::value));
- EXPECT_TRUE((std::is_same<std::tuple<>, F::ArgumentMatcherTuple>::value));
- EXPECT_TRUE((std::is_same<void(), F::MakeResultVoid>::value));
- EXPECT_TRUE((std::is_same<IgnoredValue(), F::MakeResultIgnoredValue>::value));
-}
-
-TEST(FunctionTest, Unary) {
- typedef Function<int(bool)> F; // NOLINT
- EXPECT_EQ(1u, F::ArgumentCount);
- EXPECT_TRUE((std::is_same<int, F::Result>::value));
- EXPECT_TRUE((std::is_same<bool, F::Arg<0>::type>::value));
- EXPECT_TRUE((std::is_same<std::tuple<bool>, F::ArgumentTuple>::value));
- EXPECT_TRUE((
- std::is_same<std::tuple<Matcher<bool>>, F::ArgumentMatcherTuple>::value));
- EXPECT_TRUE((std::is_same<void(bool), F::MakeResultVoid>::value)); // NOLINT
- EXPECT_TRUE((std::is_same<IgnoredValue(bool), // NOLINT
- F::MakeResultIgnoredValue>::value));
-}
-
-TEST(FunctionTest, Binary) {
- typedef Function<int(bool, const long&)> F; // NOLINT
- EXPECT_EQ(2u, F::ArgumentCount);
- EXPECT_TRUE((std::is_same<int, F::Result>::value));
- EXPECT_TRUE((std::is_same<bool, F::Arg<0>::type>::value));
- EXPECT_TRUE((std::is_same<const long&, F::Arg<1>::type>::value)); // NOLINT
- EXPECT_TRUE((std::is_same<std::tuple<bool, const long&>, // NOLINT
- F::ArgumentTuple>::value));
- EXPECT_TRUE(
- (std::is_same<std::tuple<Matcher<bool>, Matcher<const long&>>, // NOLINT
- F::ArgumentMatcherTuple>::value));
- EXPECT_TRUE((std::is_same<void(bool, const long&), // NOLINT
- F::MakeResultVoid>::value));
- EXPECT_TRUE((std::is_same<IgnoredValue(bool, const long&), // NOLINT
- F::MakeResultIgnoredValue>::value));
-}
-
-TEST(FunctionTest, LongArgumentList) {
- typedef Function<char(bool, int, char*, int&, const long&)> F; // NOLINT
- EXPECT_EQ(5u, F::ArgumentCount);
- EXPECT_TRUE((std::is_same<char, F::Result>::value));
- EXPECT_TRUE((std::is_same<bool, F::Arg<0>::type>::value));
- EXPECT_TRUE((std::is_same<int, F::Arg<1>::type>::value));
- EXPECT_TRUE((std::is_same<char*, F::Arg<2>::type>::value));
- EXPECT_TRUE((std::is_same<int&, F::Arg<3>::type>::value));
- EXPECT_TRUE((std::is_same<const long&, F::Arg<4>::type>::value)); // NOLINT
- EXPECT_TRUE(
- (std::is_same<std::tuple<bool, int, char*, int&, const long&>, // NOLINT
- F::ArgumentTuple>::value));
- EXPECT_TRUE(
- (std::is_same<
- std::tuple<Matcher<bool>, Matcher<int>, Matcher<char*>, Matcher<int&>,
- Matcher<const long&>>, // NOLINT
- F::ArgumentMatcherTuple>::value));
- EXPECT_TRUE(
- (std::is_same<void(bool, int, char*, int&, const long&), // NOLINT
- F::MakeResultVoid>::value));
- EXPECT_TRUE((
- std::is_same<IgnoredValue(bool, int, char*, int&, const long&), // NOLINT
- F::MakeResultIgnoredValue>::value));
-}
-
-TEST(Base64Unescape, InvalidString) {
- std::string unescaped;
- EXPECT_FALSE(Base64Unescape("(invalid)", &unescaped));
-}
-
-TEST(Base64Unescape, ShortString) {
- std::string unescaped;
- EXPECT_TRUE(Base64Unescape("SGVsbG8gd29ybGQh", &unescaped));
- EXPECT_EQ("Hello world!", unescaped);
-}
-
-TEST(Base64Unescape, ShortStringWithPadding) {
- std::string unescaped;
- EXPECT_TRUE(Base64Unescape("SGVsbG8gd29ybGQ=", &unescaped));
- EXPECT_EQ("Hello world", unescaped);
-}
-
-TEST(Base64Unescape, ShortStringWithoutPadding) {
- std::string unescaped;
- EXPECT_TRUE(Base64Unescape("SGVsbG8gd29ybGQ", &unescaped));
- EXPECT_EQ("Hello world", unescaped);
-}
-
-TEST(Base64Unescape, LongStringWithWhiteSpaces) {
- std::string escaped =
- R"(TWFuIGlzIGRpc3Rpbmd1aXNoZWQsIG5vdCBvbmx5IGJ5IGhpcyByZWFzb24sIGJ1dCBieSB0aGlz
- IHNpbmd1bGFyIHBhc3Npb24gZnJvbSBvdGhlciBhbmltYWxzLCB3aGljaCBpcyBhIGx1c3Qgb2Yg
- dGhlIG1pbmQsIHRoYXQgYnkgYSBwZXJzZXZlcmFuY2Ugb2YgZGVsaWdodCBpbiB0aGUgY29udGlu
- dWVkIGFuZCBpbmRlZmF0aWdhYmxlIGdlbmVyYXRpb24gb2Yga25vd2xlZGdlLCBleGNlZWRzIHRo
- ZSBzaG9ydCB2ZWhlbWVuY2Ugb2YgYW55IGNhcm5hbCBwbGVhc3VyZS4=)";
- std::string expected =
- "Man is distinguished, not only by his reason, but by this singular "
- "passion from other animals, which is a lust of the mind, that by a "
- "perseverance of delight in the continued and indefatigable generation "
- "of knowledge, exceeds the short vehemence of any carnal pleasure.";
- std::string unescaped;
- EXPECT_TRUE(Base64Unescape(escaped, &unescaped));
- EXPECT_EQ(expected, unescaped);
-}
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-matchers_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-matchers_test.cc
deleted file mode 100644
index 34282e6fe7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-matchers_test.cc
+++ /dev/null
@@ -1,8692 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests some commonly used argument matchers.
-
-// Silence warning C4244: 'initializing': conversion from 'int' to 'short',
-// possible loss of data and C4100, unreferenced local parameter
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4244)
-# pragma warning(disable:4100)
-#endif
-
-#include "gmock/gmock-matchers.h"
-
-#include <string.h>
-#include <time.h>
-
-#include <array>
-#include <cstdint>
-#include <deque>
-#include <forward_list>
-#include <functional>
-#include <iostream>
-#include <iterator>
-#include <limits>
-#include <list>
-#include <map>
-#include <memory>
-#include <set>
-#include <sstream>
-#include <string>
-#include <type_traits>
-#include <unordered_map>
-#include <unordered_set>
-#include <utility>
-#include <vector>
-
-#include "gmock/gmock-more-matchers.h"
-#include "gmock/gmock.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace gmock_matchers_test {
-namespace {
-
-using std::greater;
-using std::less;
-using std::list;
-using std::make_pair;
-using std::map;
-using std::multimap;
-using std::multiset;
-using std::ostream;
-using std::pair;
-using std::set;
-using std::stringstream;
-using std::vector;
-using testing::internal::DummyMatchResultListener;
-using testing::internal::ElementMatcherPair;
-using testing::internal::ElementMatcherPairs;
-using testing::internal::ElementsAreArrayMatcher;
-using testing::internal::ExplainMatchFailureTupleTo;
-using testing::internal::FloatingEqMatcher;
-using testing::internal::FormatMatcherDescription;
-using testing::internal::IsReadableTypeName;
-using testing::internal::MatchMatrix;
-using testing::internal::PredicateFormatterFromMatcher;
-using testing::internal::RE;
-using testing::internal::StreamMatchResultListener;
-using testing::internal::Strings;
-
-// Helper for testing container-valued matchers in mock method context. It is
-// important to test matchers in this context, since it requires additional type
-// deduction beyond what EXPECT_THAT does, thus making it more restrictive.
-struct ContainerHelper {
- MOCK_METHOD1(Call, void(std::vector<std::unique_ptr<int>>));
-};
-
-std::vector<std::unique_ptr<int>> MakeUniquePtrs(const std::vector<int>& ints) {
- std::vector<std::unique_ptr<int>> pointers;
- for (int i : ints) pointers.emplace_back(new int(i));
- return pointers;
-}
-
-// For testing ExplainMatchResultTo().
-template <typename T = int>
-class GreaterThanMatcher : public MatcherInterface<T> {
- public:
- explicit GreaterThanMatcher(T rhs) : rhs_(rhs) {}
-
- void DescribeTo(ostream* os) const override { *os << "is > " << rhs_; }
-
- bool MatchAndExplain(T lhs, MatchResultListener* listener) const override {
- if (lhs > rhs_) {
- *listener << "which is " << (lhs - rhs_) << " more than " << rhs_;
- } else if (lhs == rhs_) {
- *listener << "which is the same as " << rhs_;
- } else {
- *listener << "which is " << (rhs_ - lhs) << " less than " << rhs_;
- }
-
- return lhs > rhs_;
- }
-
- private:
- const T rhs_;
-};
-
-template <typename T>
-Matcher<T> GreaterThan(T n) {
- return MakeMatcher(new GreaterThanMatcher<T>(n));
-}
-
-std::string OfType(const std::string& type_name) {
-#if GTEST_HAS_RTTI
- return IsReadableTypeName(type_name) ? " (of type " + type_name + ")" : "";
-#else
- return "";
-#endif
-}
-
-// Returns the description of the given matcher.
-template <typename T>
-std::string Describe(const Matcher<T>& m) {
- return DescribeMatcher<T>(m);
-}
-
-// Returns the description of the negation of the given matcher.
-template <typename T>
-std::string DescribeNegation(const Matcher<T>& m) {
- return DescribeMatcher<T>(m, true);
-}
-
-// Returns the reason why x matches, or doesn't match, m.
-template <typename MatcherType, typename Value>
-std::string Explain(const MatcherType& m, const Value& x) {
- StringMatchResultListener listener;
- ExplainMatchResult(m, x, &listener);
- return listener.str();
-}
-
-TEST(MonotonicMatcherTest, IsPrintable) {
- stringstream ss;
- ss << GreaterThan(5);
- EXPECT_EQ("is > 5", ss.str());
-}
-
-TEST(MatchResultListenerTest, StreamingWorks) {
- StringMatchResultListener listener;
- listener << "hi" << 5;
- EXPECT_EQ("hi5", listener.str());
-
- listener.Clear();
- EXPECT_EQ("", listener.str());
-
- listener << 42;
- EXPECT_EQ("42", listener.str());
-
- // Streaming shouldn't crash when the underlying ostream is NULL.
- DummyMatchResultListener dummy;
- dummy << "hi" << 5;
-}
-
-TEST(MatchResultListenerTest, CanAccessUnderlyingStream) {
- EXPECT_TRUE(DummyMatchResultListener().stream() == nullptr);
- EXPECT_TRUE(StreamMatchResultListener(nullptr).stream() == nullptr);
-
- EXPECT_EQ(&std::cout, StreamMatchResultListener(&std::cout).stream());
-}
-
-TEST(MatchResultListenerTest, IsInterestedWorks) {
- EXPECT_TRUE(StringMatchResultListener().IsInterested());
- EXPECT_TRUE(StreamMatchResultListener(&std::cout).IsInterested());
-
- EXPECT_FALSE(DummyMatchResultListener().IsInterested());
- EXPECT_FALSE(StreamMatchResultListener(nullptr).IsInterested());
-}
-
-// Makes sure that the MatcherInterface<T> interface doesn't
-// change.
-class EvenMatcherImpl : public MatcherInterface<int> {
- public:
- bool MatchAndExplain(int x,
- MatchResultListener* /* listener */) const override {
- return x % 2 == 0;
- }
-
- void DescribeTo(ostream* os) const override { *os << "is an even number"; }
-
- // We deliberately don't define DescribeNegationTo() and
- // ExplainMatchResultTo() here, to make sure the definition of these
- // two methods is optional.
-};
-
-// Makes sure that the MatcherInterface API doesn't change.
-TEST(MatcherInterfaceTest, CanBeImplementedUsingPublishedAPI) {
- EvenMatcherImpl m;
-}
-
-// Tests implementing a monomorphic matcher using MatchAndExplain().
-
-class NewEvenMatcherImpl : public MatcherInterface<int> {
- public:
- bool MatchAndExplain(int x, MatchResultListener* listener) const override {
- const bool match = x % 2 == 0;
- // Verifies that we can stream to a listener directly.
- *listener << "value % " << 2;
- if (listener->stream() != nullptr) {
- // Verifies that we can stream to a listener's underlying stream
- // too.
- *listener->stream() << " == " << (x % 2);
- }
- return match;
- }
-
- void DescribeTo(ostream* os) const override { *os << "is an even number"; }
-};
-
-TEST(MatcherInterfaceTest, CanBeImplementedUsingNewAPI) {
- Matcher<int> m = MakeMatcher(new NewEvenMatcherImpl);
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(3));
- EXPECT_EQ("value % 2 == 0", Explain(m, 2));
- EXPECT_EQ("value % 2 == 1", Explain(m, 3));
-}
-
-// Tests default-constructing a matcher.
-TEST(MatcherTest, CanBeDefaultConstructed) {
- Matcher<double> m;
-}
-
-// Tests that Matcher<T> can be constructed from a MatcherInterface<T>*.
-TEST(MatcherTest, CanBeConstructedFromMatcherInterface) {
- const MatcherInterface<int>* impl = new EvenMatcherImpl;
- Matcher<int> m(impl);
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(5));
-}
-
-// Tests that value can be used in place of Eq(value).
-TEST(MatcherTest, CanBeImplicitlyConstructedFromValue) {
- Matcher<int> m1 = 5;
- EXPECT_TRUE(m1.Matches(5));
- EXPECT_FALSE(m1.Matches(6));
-}
-
-// Tests that NULL can be used in place of Eq(NULL).
-TEST(MatcherTest, CanBeImplicitlyConstructedFromNULL) {
- Matcher<int*> m1 = nullptr;
- EXPECT_TRUE(m1.Matches(nullptr));
- int n = 0;
- EXPECT_FALSE(m1.Matches(&n));
-}
-
-// Tests that matchers can be constructed from a variable that is not properly
-// defined. This should be illegal, but many users rely on this accidentally.
-struct Undefined {
- virtual ~Undefined() = 0;
- static const int kInt = 1;
-};
-
-TEST(MatcherTest, CanBeConstructedFromUndefinedVariable) {
- Matcher<int> m1 = Undefined::kInt;
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_FALSE(m1.Matches(2));
-}
-
-// Test that a matcher parameterized with an abstract class compiles.
-TEST(MatcherTest, CanAcceptAbstractClass) { Matcher<const Undefined&> m = _; }
-
-// Tests that matchers are copyable.
-TEST(MatcherTest, IsCopyable) {
- // Tests the copy constructor.
- Matcher<bool> m1 = Eq(false);
- EXPECT_TRUE(m1.Matches(false));
- EXPECT_FALSE(m1.Matches(true));
-
- // Tests the assignment operator.
- m1 = Eq(true);
- EXPECT_TRUE(m1.Matches(true));
- EXPECT_FALSE(m1.Matches(false));
-}
-
-// Tests that Matcher<T>::DescribeTo() calls
-// MatcherInterface<T>::DescribeTo().
-TEST(MatcherTest, CanDescribeItself) {
- EXPECT_EQ("is an even number",
- Describe(Matcher<int>(new EvenMatcherImpl)));
-}
-
-// Tests Matcher<T>::MatchAndExplain().
-TEST(MatcherTest, MatchAndExplain) {
- Matcher<int> m = GreaterThan(0);
- StringMatchResultListener listener1;
- EXPECT_TRUE(m.MatchAndExplain(42, &listener1));
- EXPECT_EQ("which is 42 more than 0", listener1.str());
-
- StringMatchResultListener listener2;
- EXPECT_FALSE(m.MatchAndExplain(-9, &listener2));
- EXPECT_EQ("which is 9 less than 0", listener2.str());
-}
-
-// Tests that a C-string literal can be implicitly converted to a
-// Matcher<std::string> or Matcher<const std::string&>.
-TEST(StringMatcherTest, CanBeImplicitlyConstructedFromCStringLiteral) {
- Matcher<std::string> m1 = "hi";
- EXPECT_TRUE(m1.Matches("hi"));
- EXPECT_FALSE(m1.Matches("hello"));
-
- Matcher<const std::string&> m2 = "hi";
- EXPECT_TRUE(m2.Matches("hi"));
- EXPECT_FALSE(m2.Matches("hello"));
-}
-
-// Tests that a string object can be implicitly converted to a
-// Matcher<std::string> or Matcher<const std::string&>.
-TEST(StringMatcherTest, CanBeImplicitlyConstructedFromString) {
- Matcher<std::string> m1 = std::string("hi");
- EXPECT_TRUE(m1.Matches("hi"));
- EXPECT_FALSE(m1.Matches("hello"));
-
- Matcher<const std::string&> m2 = std::string("hi");
- EXPECT_TRUE(m2.Matches("hi"));
- EXPECT_FALSE(m2.Matches("hello"));
-}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-// Tests that a C-string literal can be implicitly converted to a
-// Matcher<StringView> or Matcher<const StringView&>.
-TEST(StringViewMatcherTest, CanBeImplicitlyConstructedFromCStringLiteral) {
- Matcher<internal::StringView> m1 = "cats";
- EXPECT_TRUE(m1.Matches("cats"));
- EXPECT_FALSE(m1.Matches("dogs"));
-
- Matcher<const internal::StringView&> m2 = "cats";
- EXPECT_TRUE(m2.Matches("cats"));
- EXPECT_FALSE(m2.Matches("dogs"));
-}
-
-// Tests that a std::string object can be implicitly converted to a
-// Matcher<StringView> or Matcher<const StringView&>.
-TEST(StringViewMatcherTest, CanBeImplicitlyConstructedFromString) {
- Matcher<internal::StringView> m1 = std::string("cats");
- EXPECT_TRUE(m1.Matches("cats"));
- EXPECT_FALSE(m1.Matches("dogs"));
-
- Matcher<const internal::StringView&> m2 = std::string("cats");
- EXPECT_TRUE(m2.Matches("cats"));
- EXPECT_FALSE(m2.Matches("dogs"));
-}
-
-// Tests that a StringView object can be implicitly converted to a
-// Matcher<StringView> or Matcher<const StringView&>.
-TEST(StringViewMatcherTest, CanBeImplicitlyConstructedFromStringView) {
- Matcher<internal::StringView> m1 = internal::StringView("cats");
- EXPECT_TRUE(m1.Matches("cats"));
- EXPECT_FALSE(m1.Matches("dogs"));
-
- Matcher<const internal::StringView&> m2 = internal::StringView("cats");
- EXPECT_TRUE(m2.Matches("cats"));
- EXPECT_FALSE(m2.Matches("dogs"));
-}
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-// Tests that a std::reference_wrapper<std::string> object can be implicitly
-// converted to a Matcher<std::string> or Matcher<const std::string&> via Eq().
-TEST(StringMatcherTest,
- CanBeImplicitlyConstructedFromEqReferenceWrapperString) {
- std::string value = "cats";
- Matcher<std::string> m1 = Eq(std::ref(value));
- EXPECT_TRUE(m1.Matches("cats"));
- EXPECT_FALSE(m1.Matches("dogs"));
-
- Matcher<const std::string&> m2 = Eq(std::ref(value));
- EXPECT_TRUE(m2.Matches("cats"));
- EXPECT_FALSE(m2.Matches("dogs"));
-}
-
-// Tests that MakeMatcher() constructs a Matcher<T> from a
-// MatcherInterface* without requiring the user to explicitly
-// write the type.
-TEST(MakeMatcherTest, ConstructsMatcherFromMatcherInterface) {
- const MatcherInterface<int>* dummy_impl = new EvenMatcherImpl;
- Matcher<int> m = MakeMatcher(dummy_impl);
-}
-
-// Tests that MakePolymorphicMatcher() can construct a polymorphic
-// matcher from its implementation using the old API.
-const int g_bar = 1;
-class ReferencesBarOrIsZeroImpl {
- public:
- template <typename T>
- bool MatchAndExplain(const T& x,
- MatchResultListener* /* listener */) const {
- const void* p = &x;
- return p == &g_bar || x == 0;
- }
-
- void DescribeTo(ostream* os) const { *os << "g_bar or zero"; }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "doesn't reference g_bar and is not zero";
- }
-};
-
-// This function verifies that MakePolymorphicMatcher() returns a
-// PolymorphicMatcher<T> where T is the argument's type.
-PolymorphicMatcher<ReferencesBarOrIsZeroImpl> ReferencesBarOrIsZero() {
- return MakePolymorphicMatcher(ReferencesBarOrIsZeroImpl());
-}
-
-TEST(MakePolymorphicMatcherTest, ConstructsMatcherUsingOldAPI) {
- // Using a polymorphic matcher to match a reference type.
- Matcher<const int&> m1 = ReferencesBarOrIsZero();
- EXPECT_TRUE(m1.Matches(0));
- // Verifies that the identity of a by-reference argument is preserved.
- EXPECT_TRUE(m1.Matches(g_bar));
- EXPECT_FALSE(m1.Matches(1));
- EXPECT_EQ("g_bar or zero", Describe(m1));
-
- // Using a polymorphic matcher to match a value type.
- Matcher<double> m2 = ReferencesBarOrIsZero();
- EXPECT_TRUE(m2.Matches(0.0));
- EXPECT_FALSE(m2.Matches(0.1));
- EXPECT_EQ("g_bar or zero", Describe(m2));
-}
-
-// Tests implementing a polymorphic matcher using MatchAndExplain().
-
-class PolymorphicIsEvenImpl {
- public:
- void DescribeTo(ostream* os) const { *os << "is even"; }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "is odd";
- }
-
- template <typename T>
- bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
- // Verifies that we can stream to the listener directly.
- *listener << "% " << 2;
- if (listener->stream() != nullptr) {
- // Verifies that we can stream to the listener's underlying stream
- // too.
- *listener->stream() << " == " << (x % 2);
- }
- return (x % 2) == 0;
- }
-};
-
-PolymorphicMatcher<PolymorphicIsEvenImpl> PolymorphicIsEven() {
- return MakePolymorphicMatcher(PolymorphicIsEvenImpl());
-}
-
-TEST(MakePolymorphicMatcherTest, ConstructsMatcherUsingNewAPI) {
- // Using PolymorphicIsEven() as a Matcher<int>.
- const Matcher<int> m1 = PolymorphicIsEven();
- EXPECT_TRUE(m1.Matches(42));
- EXPECT_FALSE(m1.Matches(43));
- EXPECT_EQ("is even", Describe(m1));
-
- const Matcher<int> not_m1 = Not(m1);
- EXPECT_EQ("is odd", Describe(not_m1));
-
- EXPECT_EQ("% 2 == 0", Explain(m1, 42));
-
- // Using PolymorphicIsEven() as a Matcher<char>.
- const Matcher<char> m2 = PolymorphicIsEven();
- EXPECT_TRUE(m2.Matches('\x42'));
- EXPECT_FALSE(m2.Matches('\x43'));
- EXPECT_EQ("is even", Describe(m2));
-
- const Matcher<char> not_m2 = Not(m2);
- EXPECT_EQ("is odd", Describe(not_m2));
-
- EXPECT_EQ("% 2 == 0", Explain(m2, '\x42'));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a polymorphic matcher.
-TEST(MatcherCastTest, FromPolymorphicMatcher) {
- Matcher<int> m = MatcherCast<int>(Eq(5));
- EXPECT_TRUE(m.Matches(5));
- EXPECT_FALSE(m.Matches(6));
-}
-
-// For testing casting matchers between compatible types.
-class IntValue {
- public:
- // An int can be statically (although not implicitly) cast to a
- // IntValue.
- explicit IntValue(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- private:
- int value_;
-};
-
-// For testing casting matchers between compatible types.
-bool IsPositiveIntValue(const IntValue& foo) {
- return foo.value() > 0;
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<U> where T
-// can be statically converted to U.
-TEST(MatcherCastTest, FromCompatibleType) {
- Matcher<double> m1 = Eq(2.0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(2));
- EXPECT_FALSE(m2.Matches(3));
-
- Matcher<IntValue> m3 = Truly(IsPositiveIntValue);
- Matcher<int> m4 = MatcherCast<int>(m3);
- // In the following, the arguments 1 and 0 are statically converted
- // to IntValue objects, and then tested by the IsPositiveIntValue()
- // predicate.
- EXPECT_TRUE(m4.Matches(1));
- EXPECT_FALSE(m4.Matches(0));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<const T&>.
-TEST(MatcherCastTest, FromConstReferenceToNonReference) {
- Matcher<const int&> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<T&>.
-TEST(MatcherCastTest, FromReferenceToNonReference) {
- Matcher<int&> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromNonReferenceToConstReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<const int&> m2 = MatcherCast<const int&>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<T&>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromNonReferenceToReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<int&> m2 = MatcherCast<int&>(m1);
- int n = 0;
- EXPECT_TRUE(m2.Matches(n));
- n = 1;
- EXPECT_FALSE(m2.Matches(n));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a Matcher<T>.
-TEST(MatcherCastTest, FromSameType) {
- Matcher<int> m1 = Eq(0);
- Matcher<int> m2 = MatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a value of the same type as the
-// value type of the Matcher.
-TEST(MatcherCastTest, FromAValue) {
- Matcher<int> m = MatcherCast<int>(42);
- EXPECT_TRUE(m.Matches(42));
- EXPECT_FALSE(m.Matches(239));
-}
-
-// Tests that MatcherCast<T>(m) works when m is a value of the type implicitly
-// convertible to the value type of the Matcher.
-TEST(MatcherCastTest, FromAnImplicitlyConvertibleValue) {
- const int kExpected = 'c';
- Matcher<int> m = MatcherCast<int>('c');
- EXPECT_TRUE(m.Matches(kExpected));
- EXPECT_FALSE(m.Matches(kExpected + 1));
-}
-
-struct NonImplicitlyConstructibleTypeWithOperatorEq {
- friend bool operator==(
- const NonImplicitlyConstructibleTypeWithOperatorEq& /* ignored */,
- int rhs) {
- return 42 == rhs;
- }
- friend bool operator==(
- int lhs,
- const NonImplicitlyConstructibleTypeWithOperatorEq& /* ignored */) {
- return lhs == 42;
- }
-};
-
-// Tests that MatcherCast<T>(m) works when m is a neither a matcher nor
-// implicitly convertible to the value type of the Matcher, but the value type
-// of the matcher has operator==() overload accepting m.
-TEST(MatcherCastTest, NonImplicitlyConstructibleTypeWithOperatorEq) {
- Matcher<NonImplicitlyConstructibleTypeWithOperatorEq> m1 =
- MatcherCast<NonImplicitlyConstructibleTypeWithOperatorEq>(42);
- EXPECT_TRUE(m1.Matches(NonImplicitlyConstructibleTypeWithOperatorEq()));
-
- Matcher<NonImplicitlyConstructibleTypeWithOperatorEq> m2 =
- MatcherCast<NonImplicitlyConstructibleTypeWithOperatorEq>(239);
- EXPECT_FALSE(m2.Matches(NonImplicitlyConstructibleTypeWithOperatorEq()));
-
- // When updating the following lines please also change the comment to
- // namespace convertible_from_any.
- Matcher<int> m3 =
- MatcherCast<int>(NonImplicitlyConstructibleTypeWithOperatorEq());
- EXPECT_TRUE(m3.Matches(42));
- EXPECT_FALSE(m3.Matches(239));
-}
-
-// ConvertibleFromAny does not work with MSVC. resulting in
-// error C2440: 'initializing': cannot convert from 'Eq' to 'M'
-// No constructor could take the source type, or constructor overload
-// resolution was ambiguous
-
-#if !defined _MSC_VER
-
-// The below ConvertibleFromAny struct is implicitly constructible from anything
-// and when in the same namespace can interact with other tests. In particular,
-// if it is in the same namespace as other tests and one removes
-// NonImplicitlyConstructibleTypeWithOperatorEq::operator==(int lhs, ...);
-// then the corresponding test still compiles (and it should not!) by implicitly
-// converting NonImplicitlyConstructibleTypeWithOperatorEq to ConvertibleFromAny
-// in m3.Matcher().
-namespace convertible_from_any {
-// Implicitly convertible from any type.
-struct ConvertibleFromAny {
- ConvertibleFromAny(int a_value) : value(a_value) {}
- template <typename T>
- ConvertibleFromAny(const T& /*a_value*/) : value(-1) {
- ADD_FAILURE() << "Conversion constructor called";
- }
- int value;
-};
-
-bool operator==(const ConvertibleFromAny& a, const ConvertibleFromAny& b) {
- return a.value == b.value;
-}
-
-ostream& operator<<(ostream& os, const ConvertibleFromAny& a) {
- return os << a.value;
-}
-
-TEST(MatcherCastTest, ConversionConstructorIsUsed) {
- Matcher<ConvertibleFromAny> m = MatcherCast<ConvertibleFromAny>(1);
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-TEST(MatcherCastTest, FromConvertibleFromAny) {
- Matcher<ConvertibleFromAny> m =
- MatcherCast<ConvertibleFromAny>(Eq(ConvertibleFromAny(1)));
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-} // namespace convertible_from_any
-
-#endif // !defined _MSC_VER
-
-struct IntReferenceWrapper {
- IntReferenceWrapper(const int& a_value) : value(&a_value) {}
- const int* value;
-};
-
-bool operator==(const IntReferenceWrapper& a, const IntReferenceWrapper& b) {
- return a.value == b.value;
-}
-
-TEST(MatcherCastTest, ValueIsNotCopied) {
- int n = 42;
- Matcher<IntReferenceWrapper> m = MatcherCast<IntReferenceWrapper>(n);
- // Verify that the matcher holds a reference to n, not to its temporary copy.
- EXPECT_TRUE(m.Matches(n));
-}
-
-class Base {
- public:
- virtual ~Base() {}
- Base() {}
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Base);
-};
-
-class Derived : public Base {
- public:
- Derived() : Base() {}
- int i;
-};
-
-class OtherDerived : public Base {};
-
-// Tests that SafeMatcherCast<T>(m) works when m is a polymorphic matcher.
-TEST(SafeMatcherCastTest, FromPolymorphicMatcher) {
- Matcher<char> m2 = SafeMatcherCast<char>(Eq(32));
- EXPECT_TRUE(m2.Matches(' '));
- EXPECT_FALSE(m2.Matches('\n'));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<U> where
-// T and U are arithmetic types and T can be losslessly converted to
-// U.
-TEST(SafeMatcherCastTest, FromLosslesslyConvertibleArithmeticType) {
- Matcher<double> m1 = DoubleEq(1.0);
- Matcher<float> m2 = SafeMatcherCast<float>(m1);
- EXPECT_TRUE(m2.Matches(1.0f));
- EXPECT_FALSE(m2.Matches(2.0f));
-
- Matcher<char> m3 = SafeMatcherCast<char>(TypedEq<int>('a'));
- EXPECT_TRUE(m3.Matches('a'));
- EXPECT_FALSE(m3.Matches('b'));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<U> where T and U
-// are pointers or references to a derived and a base class, correspondingly.
-TEST(SafeMatcherCastTest, FromBaseClass) {
- Derived d, d2;
- Matcher<Base*> m1 = Eq(&d);
- Matcher<Derived*> m2 = SafeMatcherCast<Derived*>(m1);
- EXPECT_TRUE(m2.Matches(&d));
- EXPECT_FALSE(m2.Matches(&d2));
-
- Matcher<Base&> m3 = Ref(d);
- Matcher<Derived&> m4 = SafeMatcherCast<Derived&>(m3);
- EXPECT_TRUE(m4.Matches(d));
- EXPECT_FALSE(m4.Matches(d2));
-}
-
-// Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<const T&>.
-TEST(SafeMatcherCastTest, FromConstReferenceToReference) {
- int n = 0;
- Matcher<const int&> m1 = Ref(n);
- Matcher<int&> m2 = SafeMatcherCast<int&>(m1);
- int n1 = 0;
- EXPECT_TRUE(m2.Matches(n));
- EXPECT_FALSE(m2.Matches(n1));
-}
-
-// Tests that MatcherCast<const T&>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromNonReferenceToConstReference) {
- Matcher<std::unique_ptr<int>> m1 = IsNull();
- Matcher<const std::unique_ptr<int>&> m2 =
- SafeMatcherCast<const std::unique_ptr<int>&>(m1);
- EXPECT_TRUE(m2.Matches(std::unique_ptr<int>()));
- EXPECT_FALSE(m2.Matches(std::unique_ptr<int>(new int)));
-}
-
-// Tests that SafeMatcherCast<T&>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromNonReferenceToReference) {
- Matcher<int> m1 = Eq(0);
- Matcher<int&> m2 = SafeMatcherCast<int&>(m1);
- int n = 0;
- EXPECT_TRUE(m2.Matches(n));
- n = 1;
- EXPECT_FALSE(m2.Matches(n));
-}
-
-// Tests that SafeMatcherCast<T>(m) works when m is a Matcher<T>.
-TEST(SafeMatcherCastTest, FromSameType) {
- Matcher<int> m1 = Eq(0);
- Matcher<int> m2 = SafeMatcherCast<int>(m1);
- EXPECT_TRUE(m2.Matches(0));
- EXPECT_FALSE(m2.Matches(1));
-}
-
-#if !defined _MSC_VER
-
-namespace convertible_from_any {
-TEST(SafeMatcherCastTest, ConversionConstructorIsUsed) {
- Matcher<ConvertibleFromAny> m = SafeMatcherCast<ConvertibleFromAny>(1);
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-
-TEST(SafeMatcherCastTest, FromConvertibleFromAny) {
- Matcher<ConvertibleFromAny> m =
- SafeMatcherCast<ConvertibleFromAny>(Eq(ConvertibleFromAny(1)));
- EXPECT_TRUE(m.Matches(ConvertibleFromAny(1)));
- EXPECT_FALSE(m.Matches(ConvertibleFromAny(2)));
-}
-} // namespace convertible_from_any
-
-#endif // !defined _MSC_VER
-
-TEST(SafeMatcherCastTest, ValueIsNotCopied) {
- int n = 42;
- Matcher<IntReferenceWrapper> m = SafeMatcherCast<IntReferenceWrapper>(n);
- // Verify that the matcher holds a reference to n, not to its temporary copy.
- EXPECT_TRUE(m.Matches(n));
-}
-
-TEST(ExpectThat, TakesLiterals) {
- EXPECT_THAT(1, 1);
- EXPECT_THAT(1.0, 1.0);
- EXPECT_THAT(std::string(), "");
-}
-
-TEST(ExpectThat, TakesFunctions) {
- struct Helper {
- static void Func() {}
- };
- void (*func)() = Helper::Func;
- EXPECT_THAT(func, Helper::Func);
- EXPECT_THAT(func, &Helper::Func);
-}
-
-// Tests that A<T>() matches any value of type T.
-TEST(ATest, MatchesAnyValue) {
- // Tests a matcher for a value type.
- Matcher<double> m1 = A<double>();
- EXPECT_TRUE(m1.Matches(91.43));
- EXPECT_TRUE(m1.Matches(-15.32));
-
- // Tests a matcher for a reference type.
- int a = 2;
- int b = -6;
- Matcher<int&> m2 = A<int&>();
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-TEST(ATest, WorksForDerivedClass) {
- Base base;
- Derived derived;
- EXPECT_THAT(&base, A<Base*>());
- // This shouldn't compile: EXPECT_THAT(&base, A<Derived*>());
- EXPECT_THAT(&derived, A<Base*>());
- EXPECT_THAT(&derived, A<Derived*>());
-}
-
-// Tests that A<T>() describes itself properly.
-TEST(ATest, CanDescribeSelf) {
- EXPECT_EQ("is anything", Describe(A<bool>()));
-}
-
-// Tests that An<T>() matches any value of type T.
-TEST(AnTest, MatchesAnyValue) {
- // Tests a matcher for a value type.
- Matcher<int> m1 = An<int>();
- EXPECT_TRUE(m1.Matches(9143));
- EXPECT_TRUE(m1.Matches(-1532));
-
- // Tests a matcher for a reference type.
- int a = 2;
- int b = -6;
- Matcher<int&> m2 = An<int&>();
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-// Tests that An<T>() describes itself properly.
-TEST(AnTest, CanDescribeSelf) {
- EXPECT_EQ("is anything", Describe(An<int>()));
-}
-
-// Tests that _ can be used as a matcher for any type and matches any
-// value of that type.
-TEST(UnderscoreTest, MatchesAnyValue) {
- // Uses _ as a matcher for a value type.
- Matcher<int> m1 = _;
- EXPECT_TRUE(m1.Matches(123));
- EXPECT_TRUE(m1.Matches(-242));
-
- // Uses _ as a matcher for a reference type.
- bool a = false;
- const bool b = true;
- Matcher<const bool&> m2 = _;
- EXPECT_TRUE(m2.Matches(a));
- EXPECT_TRUE(m2.Matches(b));
-}
-
-// Tests that _ describes itself properly.
-TEST(UnderscoreTest, CanDescribeSelf) {
- Matcher<int> m = _;
- EXPECT_EQ("is anything", Describe(m));
-}
-
-// Tests that Eq(x) matches any value equal to x.
-TEST(EqTest, MatchesEqualValue) {
- // 2 C-strings with same content but different addresses.
- const char a1[] = "hi";
- const char a2[] = "hi";
-
- Matcher<const char*> m1 = Eq(a1);
- EXPECT_TRUE(m1.Matches(a1));
- EXPECT_FALSE(m1.Matches(a2));
-}
-
-// Tests that Eq(v) describes itself properly.
-
-class Unprintable {
- public:
- Unprintable() : c_('a') {}
-
- bool operator==(const Unprintable& /* rhs */) const { return true; }
- // -Wunused-private-field: dummy accessor for `c_`.
- char dummy_c() { return c_; }
- private:
- char c_;
-};
-
-TEST(EqTest, CanDescribeSelf) {
- Matcher<Unprintable> m = Eq(Unprintable());
- EXPECT_EQ("is equal to 1-byte object <61>", Describe(m));
-}
-
-// Tests that Eq(v) can be used to match any type that supports
-// comparing with type T, where T is v's type.
-TEST(EqTest, IsPolymorphic) {
- Matcher<int> m1 = Eq(1);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_FALSE(m1.Matches(2));
-
- Matcher<char> m2 = Eq(1);
- EXPECT_TRUE(m2.Matches('\1'));
- EXPECT_FALSE(m2.Matches('a'));
-}
-
-// Tests that TypedEq<T>(v) matches values of type T that's equal to v.
-TEST(TypedEqTest, ChecksEqualityForGivenType) {
- Matcher<char> m1 = TypedEq<char>('a');
- EXPECT_TRUE(m1.Matches('a'));
- EXPECT_FALSE(m1.Matches('b'));
-
- Matcher<int> m2 = TypedEq<int>(6);
- EXPECT_TRUE(m2.Matches(6));
- EXPECT_FALSE(m2.Matches(7));
-}
-
-// Tests that TypedEq(v) describes itself properly.
-TEST(TypedEqTest, CanDescribeSelf) {
- EXPECT_EQ("is equal to 2", Describe(TypedEq<int>(2)));
-}
-
-// Tests that TypedEq<T>(v) has type Matcher<T>.
-
-// Type<T>::IsTypeOf(v) compiles if and only if the type of value v is T, where
-// T is a "bare" type (i.e. not in the form of const U or U&). If v's type is
-// not T, the compiler will generate a message about "undefined reference".
-template <typename T>
-struct Type {
- static bool IsTypeOf(const T& /* v */) { return true; }
-
- template <typename T2>
- static void IsTypeOf(T2 v);
-};
-
-TEST(TypedEqTest, HasSpecifiedType) {
- // Verfies that the type of TypedEq<T>(v) is Matcher<T>.
- Type<Matcher<int> >::IsTypeOf(TypedEq<int>(5));
- Type<Matcher<double> >::IsTypeOf(TypedEq<double>(5));
-}
-
-// Tests that Ge(v) matches anything >= v.
-TEST(GeTest, ImplementsGreaterThanOrEqual) {
- Matcher<int> m1 = Ge(0);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_TRUE(m1.Matches(0));
- EXPECT_FALSE(m1.Matches(-1));
-}
-
-// Tests that Ge(v) describes itself properly.
-TEST(GeTest, CanDescribeSelf) {
- Matcher<int> m = Ge(5);
- EXPECT_EQ("is >= 5", Describe(m));
-}
-
-// Tests that Gt(v) matches anything > v.
-TEST(GtTest, ImplementsGreaterThan) {
- Matcher<double> m1 = Gt(0);
- EXPECT_TRUE(m1.Matches(1.0));
- EXPECT_FALSE(m1.Matches(0.0));
- EXPECT_FALSE(m1.Matches(-1.0));
-}
-
-// Tests that Gt(v) describes itself properly.
-TEST(GtTest, CanDescribeSelf) {
- Matcher<int> m = Gt(5);
- EXPECT_EQ("is > 5", Describe(m));
-}
-
-// Tests that Le(v) matches anything <= v.
-TEST(LeTest, ImplementsLessThanOrEqual) {
- Matcher<char> m1 = Le('b');
- EXPECT_TRUE(m1.Matches('a'));
- EXPECT_TRUE(m1.Matches('b'));
- EXPECT_FALSE(m1.Matches('c'));
-}
-
-// Tests that Le(v) describes itself properly.
-TEST(LeTest, CanDescribeSelf) {
- Matcher<int> m = Le(5);
- EXPECT_EQ("is <= 5", Describe(m));
-}
-
-// Tests that Lt(v) matches anything < v.
-TEST(LtTest, ImplementsLessThan) {
- Matcher<const std::string&> m1 = Lt("Hello");
- EXPECT_TRUE(m1.Matches("Abc"));
- EXPECT_FALSE(m1.Matches("Hello"));
- EXPECT_FALSE(m1.Matches("Hello, world!"));
-}
-
-// Tests that Lt(v) describes itself properly.
-TEST(LtTest, CanDescribeSelf) {
- Matcher<int> m = Lt(5);
- EXPECT_EQ("is < 5", Describe(m));
-}
-
-// Tests that Ne(v) matches anything != v.
-TEST(NeTest, ImplementsNotEqual) {
- Matcher<int> m1 = Ne(0);
- EXPECT_TRUE(m1.Matches(1));
- EXPECT_TRUE(m1.Matches(-1));
- EXPECT_FALSE(m1.Matches(0));
-}
-
-// Tests that Ne(v) describes itself properly.
-TEST(NeTest, CanDescribeSelf) {
- Matcher<int> m = Ne(5);
- EXPECT_EQ("isn't equal to 5", Describe(m));
-}
-
-class MoveOnly {
- public:
- explicit MoveOnly(int i) : i_(i) {}
- MoveOnly(const MoveOnly&) = delete;
- MoveOnly(MoveOnly&&) = default;
- MoveOnly& operator=(const MoveOnly&) = delete;
- MoveOnly& operator=(MoveOnly&&) = default;
-
- bool operator==(const MoveOnly& other) const { return i_ == other.i_; }
- bool operator!=(const MoveOnly& other) const { return i_ != other.i_; }
- bool operator<(const MoveOnly& other) const { return i_ < other.i_; }
- bool operator<=(const MoveOnly& other) const { return i_ <= other.i_; }
- bool operator>(const MoveOnly& other) const { return i_ > other.i_; }
- bool operator>=(const MoveOnly& other) const { return i_ >= other.i_; }
-
- private:
- int i_;
-};
-
-struct MoveHelper {
- MOCK_METHOD1(Call, void(MoveOnly));
-};
-
-// Disable this test in VS 2015 (version 14), where it fails when SEH is enabled
-#if defined(_MSC_VER) && (_MSC_VER < 1910)
-TEST(ComparisonBaseTest, DISABLED_WorksWithMoveOnly) {
-#else
-TEST(ComparisonBaseTest, WorksWithMoveOnly) {
-#endif
- MoveOnly m{0};
- MoveHelper helper;
-
- EXPECT_CALL(helper, Call(Eq(ByRef(m))));
- helper.Call(MoveOnly(0));
- EXPECT_CALL(helper, Call(Ne(ByRef(m))));
- helper.Call(MoveOnly(1));
- EXPECT_CALL(helper, Call(Le(ByRef(m))));
- helper.Call(MoveOnly(0));
- EXPECT_CALL(helper, Call(Lt(ByRef(m))));
- helper.Call(MoveOnly(-1));
- EXPECT_CALL(helper, Call(Ge(ByRef(m))));
- helper.Call(MoveOnly(0));
- EXPECT_CALL(helper, Call(Gt(ByRef(m))));
- helper.Call(MoveOnly(1));
-}
-
-// Tests that IsNull() matches any NULL pointer of any type.
-TEST(IsNullTest, MatchesNullPointer) {
- Matcher<int*> m1 = IsNull();
- int* p1 = nullptr;
- int n = 0;
- EXPECT_TRUE(m1.Matches(p1));
- EXPECT_FALSE(m1.Matches(&n));
-
- Matcher<const char*> m2 = IsNull();
- const char* p2 = nullptr;
- EXPECT_TRUE(m2.Matches(p2));
- EXPECT_FALSE(m2.Matches("hi"));
-
- Matcher<void*> m3 = IsNull();
- void* p3 = nullptr;
- EXPECT_TRUE(m3.Matches(p3));
- EXPECT_FALSE(m3.Matches(reinterpret_cast<void*>(0xbeef)));
-}
-
-TEST(IsNullTest, StdFunction) {
- const Matcher<std::function<void()>> m = IsNull();
-
- EXPECT_TRUE(m.Matches(std::function<void()>()));
- EXPECT_FALSE(m.Matches([]{}));
-}
-
-// Tests that IsNull() describes itself properly.
-TEST(IsNullTest, CanDescribeSelf) {
- Matcher<int*> m = IsNull();
- EXPECT_EQ("is NULL", Describe(m));
- EXPECT_EQ("isn't NULL", DescribeNegation(m));
-}
-
-// Tests that NotNull() matches any non-NULL pointer of any type.
-TEST(NotNullTest, MatchesNonNullPointer) {
- Matcher<int*> m1 = NotNull();
- int* p1 = nullptr;
- int n = 0;
- EXPECT_FALSE(m1.Matches(p1));
- EXPECT_TRUE(m1.Matches(&n));
-
- Matcher<const char*> m2 = NotNull();
- const char* p2 = nullptr;
- EXPECT_FALSE(m2.Matches(p2));
- EXPECT_TRUE(m2.Matches("hi"));
-}
-
-TEST(NotNullTest, LinkedPtr) {
- const Matcher<std::shared_ptr<int>> m = NotNull();
- const std::shared_ptr<int> null_p;
- const std::shared_ptr<int> non_null_p(new int);
-
- EXPECT_FALSE(m.Matches(null_p));
- EXPECT_TRUE(m.Matches(non_null_p));
-}
-
-TEST(NotNullTest, ReferenceToConstLinkedPtr) {
- const Matcher<const std::shared_ptr<double>&> m = NotNull();
- const std::shared_ptr<double> null_p;
- const std::shared_ptr<double> non_null_p(new double);
-
- EXPECT_FALSE(m.Matches(null_p));
- EXPECT_TRUE(m.Matches(non_null_p));
-}
-
-TEST(NotNullTest, StdFunction) {
- const Matcher<std::function<void()>> m = NotNull();
-
- EXPECT_TRUE(m.Matches([]{}));
- EXPECT_FALSE(m.Matches(std::function<void()>()));
-}
-
-// Tests that NotNull() describes itself properly.
-TEST(NotNullTest, CanDescribeSelf) {
- Matcher<int*> m = NotNull();
- EXPECT_EQ("isn't NULL", Describe(m));
-}
-
-// Tests that Ref(variable) matches an argument that references
-// 'variable'.
-TEST(RefTest, MatchesSameVariable) {
- int a = 0;
- int b = 0;
- Matcher<int&> m = Ref(a);
- EXPECT_TRUE(m.Matches(a));
- EXPECT_FALSE(m.Matches(b));
-}
-
-// Tests that Ref(variable) describes itself properly.
-TEST(RefTest, CanDescribeSelf) {
- int n = 5;
- Matcher<int&> m = Ref(n);
- stringstream ss;
- ss << "references the variable @" << &n << " 5";
- EXPECT_EQ(ss.str(), Describe(m));
-}
-
-// Test that Ref(non_const_varialbe) can be used as a matcher for a
-// const reference.
-TEST(RefTest, CanBeUsedAsMatcherForConstReference) {
- int a = 0;
- int b = 0;
- Matcher<const int&> m = Ref(a);
- EXPECT_TRUE(m.Matches(a));
- EXPECT_FALSE(m.Matches(b));
-}
-
-// Tests that Ref(variable) is covariant, i.e. Ref(derived) can be
-// used wherever Ref(base) can be used (Ref(derived) is a sub-type
-// of Ref(base), but not vice versa.
-
-TEST(RefTest, IsCovariant) {
- Base base, base2;
- Derived derived;
- Matcher<const Base&> m1 = Ref(base);
- EXPECT_TRUE(m1.Matches(base));
- EXPECT_FALSE(m1.Matches(base2));
- EXPECT_FALSE(m1.Matches(derived));
-
- m1 = Ref(derived);
- EXPECT_TRUE(m1.Matches(derived));
- EXPECT_FALSE(m1.Matches(base));
- EXPECT_FALSE(m1.Matches(base2));
-}
-
-TEST(RefTest, ExplainsResult) {
- int n = 0;
- EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), n),
- StartsWith("which is located @"));
-
- int m = 0;
- EXPECT_THAT(Explain(Matcher<const int&>(Ref(n)), m),
- StartsWith("which is located @"));
-}
-
-// Tests string comparison matchers.
-
-template <typename T = std::string>
-std::string FromStringLike(internal::StringLike<T> str) {
- return std::string(str);
-}
-
-TEST(StringLike, TestConversions) {
- EXPECT_EQ("foo", FromStringLike("foo"));
- EXPECT_EQ("foo", FromStringLike(std::string("foo")));
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- EXPECT_EQ("foo", FromStringLike(internal::StringView("foo")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Non deducible types.
- EXPECT_EQ("", FromStringLike({}));
- EXPECT_EQ("foo", FromStringLike({'f', 'o', 'o'}));
- const char buf[] = "foo";
- EXPECT_EQ("foo", FromStringLike({buf, buf + 3}));
-}
-
-TEST(StrEqTest, MatchesEqualString) {
- Matcher<const char*> m = StrEq(std::string("Hello"));
- EXPECT_TRUE(m.Matches("Hello"));
- EXPECT_FALSE(m.Matches("hello"));
- EXPECT_FALSE(m.Matches(nullptr));
-
- Matcher<const std::string&> m2 = StrEq("Hello");
- EXPECT_TRUE(m2.Matches("Hello"));
- EXPECT_FALSE(m2.Matches("Hi"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView&> m3 =
- StrEq(internal::StringView("Hello"));
- EXPECT_TRUE(m3.Matches(internal::StringView("Hello")));
- EXPECT_FALSE(m3.Matches(internal::StringView("hello")));
- EXPECT_FALSE(m3.Matches(internal::StringView()));
-
- Matcher<const internal::StringView&> m_empty = StrEq("");
- EXPECT_TRUE(m_empty.Matches(internal::StringView("")));
- EXPECT_TRUE(m_empty.Matches(internal::StringView()));
- EXPECT_FALSE(m_empty.Matches(internal::StringView("hello")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(StrEqTest, CanDescribeSelf) {
- Matcher<std::string> m = StrEq("Hi-\'\"?\\\a\b\f\n\r\t\v\xD3");
- EXPECT_EQ("is equal to \"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\xD3\"",
- Describe(m));
-
- std::string str("01204500800");
- str[3] = '\0';
- Matcher<std::string> m2 = StrEq(str);
- EXPECT_EQ("is equal to \"012\\04500800\"", Describe(m2));
- str[0] = str[6] = str[7] = str[9] = str[10] = '\0';
- Matcher<std::string> m3 = StrEq(str);
- EXPECT_EQ("is equal to \"\\012\\045\\0\\08\\0\\0\"", Describe(m3));
-}
-
-TEST(StrNeTest, MatchesUnequalString) {
- Matcher<const char*> m = StrNe("Hello");
- EXPECT_TRUE(m.Matches(""));
- EXPECT_TRUE(m.Matches(nullptr));
- EXPECT_FALSE(m.Matches("Hello"));
-
- Matcher<std::string> m2 = StrNe(std::string("Hello"));
- EXPECT_TRUE(m2.Matches("hello"));
- EXPECT_FALSE(m2.Matches("Hello"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView> m3 = StrNe(internal::StringView("Hello"));
- EXPECT_TRUE(m3.Matches(internal::StringView("")));
- EXPECT_TRUE(m3.Matches(internal::StringView()));
- EXPECT_FALSE(m3.Matches(internal::StringView("Hello")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(StrNeTest, CanDescribeSelf) {
- Matcher<const char*> m = StrNe("Hi");
- EXPECT_EQ("isn't equal to \"Hi\"", Describe(m));
-}
-
-TEST(StrCaseEqTest, MatchesEqualStringIgnoringCase) {
- Matcher<const char*> m = StrCaseEq(std::string("Hello"));
- EXPECT_TRUE(m.Matches("Hello"));
- EXPECT_TRUE(m.Matches("hello"));
- EXPECT_FALSE(m.Matches("Hi"));
- EXPECT_FALSE(m.Matches(nullptr));
-
- Matcher<const std::string&> m2 = StrCaseEq("Hello");
- EXPECT_TRUE(m2.Matches("hello"));
- EXPECT_FALSE(m2.Matches("Hi"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView&> m3 =
- StrCaseEq(internal::StringView("Hello"));
- EXPECT_TRUE(m3.Matches(internal::StringView("Hello")));
- EXPECT_TRUE(m3.Matches(internal::StringView("hello")));
- EXPECT_FALSE(m3.Matches(internal::StringView("Hi")));
- EXPECT_FALSE(m3.Matches(internal::StringView()));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(StrCaseEqTest, MatchesEqualStringWith0IgnoringCase) {
- std::string str1("oabocdooeoo");
- std::string str2("OABOCDOOEOO");
- Matcher<const std::string&> m0 = StrCaseEq(str1);
- EXPECT_FALSE(m0.Matches(str2 + std::string(1, '\0')));
-
- str1[3] = str2[3] = '\0';
- Matcher<const std::string&> m1 = StrCaseEq(str1);
- EXPECT_TRUE(m1.Matches(str2));
-
- str1[0] = str1[6] = str1[7] = str1[10] = '\0';
- str2[0] = str2[6] = str2[7] = str2[10] = '\0';
- Matcher<const std::string&> m2 = StrCaseEq(str1);
- str1[9] = str2[9] = '\0';
- EXPECT_FALSE(m2.Matches(str2));
-
- Matcher<const std::string&> m3 = StrCaseEq(str1);
- EXPECT_TRUE(m3.Matches(str2));
-
- EXPECT_FALSE(m3.Matches(str2 + "x"));
- str2.append(1, '\0');
- EXPECT_FALSE(m3.Matches(str2));
- EXPECT_FALSE(m3.Matches(std::string(str2, 0, 9)));
-}
-
-TEST(StrCaseEqTest, CanDescribeSelf) {
- Matcher<std::string> m = StrCaseEq("Hi");
- EXPECT_EQ("is equal to (ignoring case) \"Hi\"", Describe(m));
-}
-
-TEST(StrCaseNeTest, MatchesUnequalStringIgnoringCase) {
- Matcher<const char*> m = StrCaseNe("Hello");
- EXPECT_TRUE(m.Matches("Hi"));
- EXPECT_TRUE(m.Matches(nullptr));
- EXPECT_FALSE(m.Matches("Hello"));
- EXPECT_FALSE(m.Matches("hello"));
-
- Matcher<std::string> m2 = StrCaseNe(std::string("Hello"));
- EXPECT_TRUE(m2.Matches(""));
- EXPECT_FALSE(m2.Matches("Hello"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView> m3 =
- StrCaseNe(internal::StringView("Hello"));
- EXPECT_TRUE(m3.Matches(internal::StringView("Hi")));
- EXPECT_TRUE(m3.Matches(internal::StringView()));
- EXPECT_FALSE(m3.Matches(internal::StringView("Hello")));
- EXPECT_FALSE(m3.Matches(internal::StringView("hello")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(StrCaseNeTest, CanDescribeSelf) {
- Matcher<const char*> m = StrCaseNe("Hi");
- EXPECT_EQ("isn't equal to (ignoring case) \"Hi\"", Describe(m));
-}
-
-// Tests that HasSubstr() works for matching string-typed values.
-TEST(HasSubstrTest, WorksForStringClasses) {
- const Matcher<std::string> m1 = HasSubstr("foo");
- EXPECT_TRUE(m1.Matches(std::string("I love food.")));
- EXPECT_FALSE(m1.Matches(std::string("tofo")));
-
- const Matcher<const std::string&> m2 = HasSubstr("foo");
- EXPECT_TRUE(m2.Matches(std::string("I love food.")));
- EXPECT_FALSE(m2.Matches(std::string("tofo")));
-
- const Matcher<std::string> m_empty = HasSubstr("");
- EXPECT_TRUE(m_empty.Matches(std::string()));
- EXPECT_TRUE(m_empty.Matches(std::string("not empty")));
-}
-
-// Tests that HasSubstr() works for matching C-string-typed values.
-TEST(HasSubstrTest, WorksForCStrings) {
- const Matcher<char*> m1 = HasSubstr("foo");
- EXPECT_TRUE(m1.Matches(const_cast<char*>("I love food.")));
- EXPECT_FALSE(m1.Matches(const_cast<char*>("tofo")));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const char*> m2 = HasSubstr("foo");
- EXPECT_TRUE(m2.Matches("I love food."));
- EXPECT_FALSE(m2.Matches("tofo"));
- EXPECT_FALSE(m2.Matches(nullptr));
-
- const Matcher<const char*> m_empty = HasSubstr("");
- EXPECT_TRUE(m_empty.Matches("not empty"));
- EXPECT_TRUE(m_empty.Matches(""));
- EXPECT_FALSE(m_empty.Matches(nullptr));
-}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-// Tests that HasSubstr() works for matching StringView-typed values.
-TEST(HasSubstrTest, WorksForStringViewClasses) {
- const Matcher<internal::StringView> m1 =
- HasSubstr(internal::StringView("foo"));
- EXPECT_TRUE(m1.Matches(internal::StringView("I love food.")));
- EXPECT_FALSE(m1.Matches(internal::StringView("tofo")));
- EXPECT_FALSE(m1.Matches(internal::StringView()));
-
- const Matcher<const internal::StringView&> m2 = HasSubstr("foo");
- EXPECT_TRUE(m2.Matches(internal::StringView("I love food.")));
- EXPECT_FALSE(m2.Matches(internal::StringView("tofo")));
- EXPECT_FALSE(m2.Matches(internal::StringView()));
-
- const Matcher<const internal::StringView&> m3 = HasSubstr("");
- EXPECT_TRUE(m3.Matches(internal::StringView("foo")));
- EXPECT_TRUE(m3.Matches(internal::StringView("")));
- EXPECT_TRUE(m3.Matches(internal::StringView()));
-}
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-// Tests that HasSubstr(s) describes itself properly.
-TEST(HasSubstrTest, CanDescribeSelf) {
- Matcher<std::string> m = HasSubstr("foo\n\"");
- EXPECT_EQ("has substring \"foo\\n\\\"\"", Describe(m));
-}
-
-TEST(KeyTest, CanDescribeSelf) {
- Matcher<const pair<std::string, int>&> m = Key("foo");
- EXPECT_EQ("has a key that is equal to \"foo\"", Describe(m));
- EXPECT_EQ("doesn't have a key that is equal to \"foo\"", DescribeNegation(m));
-}
-
-TEST(KeyTest, ExplainsResult) {
- Matcher<pair<int, bool> > m = Key(GreaterThan(10));
- EXPECT_EQ("whose first field is a value which is 5 less than 10",
- Explain(m, make_pair(5, true)));
- EXPECT_EQ("whose first field is a value which is 5 more than 10",
- Explain(m, make_pair(15, true)));
-}
-
-TEST(KeyTest, MatchesCorrectly) {
- pair<int, std::string> p(25, "foo");
- EXPECT_THAT(p, Key(25));
- EXPECT_THAT(p, Not(Key(42)));
- EXPECT_THAT(p, Key(Ge(20)));
- EXPECT_THAT(p, Not(Key(Lt(25))));
-}
-
-TEST(KeyTest, WorksWithMoveOnly) {
- pair<std::unique_ptr<int>, std::unique_ptr<int>> p;
- EXPECT_THAT(p, Key(Eq(nullptr)));
-}
-
-template <size_t I>
-struct Tag {};
-
-struct PairWithGet {
- int member_1;
- std::string member_2;
- using first_type = int;
- using second_type = std::string;
-
- const int& GetImpl(Tag<0>) const { return member_1; }
- const std::string& GetImpl(Tag<1>) const { return member_2; }
-};
-template <size_t I>
-auto get(const PairWithGet& value) -> decltype(value.GetImpl(Tag<I>())) {
- return value.GetImpl(Tag<I>());
-}
-TEST(PairTest, MatchesPairWithGetCorrectly) {
- PairWithGet p{25, "foo"};
- EXPECT_THAT(p, Key(25));
- EXPECT_THAT(p, Not(Key(42)));
- EXPECT_THAT(p, Key(Ge(20)));
- EXPECT_THAT(p, Not(Key(Lt(25))));
-
- std::vector<PairWithGet> v = {{11, "Foo"}, {29, "gMockIsBestMock"}};
- EXPECT_THAT(v, Contains(Key(29)));
-}
-
-TEST(KeyTest, SafelyCastsInnerMatcher) {
- Matcher<int> is_positive = Gt(0);
- Matcher<int> is_negative = Lt(0);
- pair<char, bool> p('a', true);
- EXPECT_THAT(p, Key(is_positive));
- EXPECT_THAT(p, Not(Key(is_negative)));
-}
-
-TEST(KeyTest, InsideContainsUsingMap) {
- map<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
- EXPECT_THAT(container, Contains(Key(1)));
- EXPECT_THAT(container, Not(Contains(Key(3))));
-}
-
-TEST(KeyTest, InsideContainsUsingMultimap) {
- multimap<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
-
- EXPECT_THAT(container, Not(Contains(Key(25))));
- container.insert(make_pair(25, 'd'));
- EXPECT_THAT(container, Contains(Key(25)));
- container.insert(make_pair(25, 'e'));
- EXPECT_THAT(container, Contains(Key(25)));
-
- EXPECT_THAT(container, Contains(Key(1)));
- EXPECT_THAT(container, Not(Contains(Key(3))));
-}
-
-TEST(PairTest, Typing) {
- // Test verifies the following type conversions can be compiled.
- Matcher<const pair<const char*, int>&> m1 = Pair("foo", 42);
- Matcher<const pair<const char*, int> > m2 = Pair("foo", 42);
- Matcher<pair<const char*, int> > m3 = Pair("foo", 42);
-
- Matcher<pair<int, const std::string> > m4 = Pair(25, "42");
- Matcher<pair<const std::string, int> > m5 = Pair("25", 42);
-}
-
-TEST(PairTest, CanDescribeSelf) {
- Matcher<const pair<std::string, int>&> m1 = Pair("foo", 42);
- EXPECT_EQ("has a first field that is equal to \"foo\""
- ", and has a second field that is equal to 42",
- Describe(m1));
- EXPECT_EQ("has a first field that isn't equal to \"foo\""
- ", or has a second field that isn't equal to 42",
- DescribeNegation(m1));
- // Double and triple negation (1 or 2 times not and description of negation).
- Matcher<const pair<int, int>&> m2 = Not(Pair(Not(13), 42));
- EXPECT_EQ("has a first field that isn't equal to 13"
- ", and has a second field that is equal to 42",
- DescribeNegation(m2));
-}
-
-TEST(PairTest, CanExplainMatchResultTo) {
- // If neither field matches, Pair() should explain about the first
- // field.
- const Matcher<pair<int, int> > m = Pair(GreaterThan(0), GreaterThan(0));
- EXPECT_EQ("whose first field does not match, which is 1 less than 0",
- Explain(m, make_pair(-1, -2)));
-
- // If the first field matches but the second doesn't, Pair() should
- // explain about the second field.
- EXPECT_EQ("whose second field does not match, which is 2 less than 0",
- Explain(m, make_pair(1, -2)));
-
- // If the first field doesn't match but the second does, Pair()
- // should explain about the first field.
- EXPECT_EQ("whose first field does not match, which is 1 less than 0",
- Explain(m, make_pair(-1, 2)));
-
- // If both fields match, Pair() should explain about them both.
- EXPECT_EQ("whose both fields match, where the first field is a value "
- "which is 1 more than 0, and the second field is a value "
- "which is 2 more than 0",
- Explain(m, make_pair(1, 2)));
-
- // If only the first match has an explanation, only this explanation should
- // be printed.
- const Matcher<pair<int, int> > explain_first = Pair(GreaterThan(0), 0);
- EXPECT_EQ("whose both fields match, where the first field is a value "
- "which is 1 more than 0",
- Explain(explain_first, make_pair(1, 0)));
-
- // If only the second match has an explanation, only this explanation should
- // be printed.
- const Matcher<pair<int, int> > explain_second = Pair(0, GreaterThan(0));
- EXPECT_EQ("whose both fields match, where the second field is a value "
- "which is 1 more than 0",
- Explain(explain_second, make_pair(0, 1)));
-}
-
-TEST(PairTest, MatchesCorrectly) {
- pair<int, std::string> p(25, "foo");
-
- // Both fields match.
- EXPECT_THAT(p, Pair(25, "foo"));
- EXPECT_THAT(p, Pair(Ge(20), HasSubstr("o")));
-
- // 'first' doesnt' match, but 'second' matches.
- EXPECT_THAT(p, Not(Pair(42, "foo")));
- EXPECT_THAT(p, Not(Pair(Lt(25), "foo")));
-
- // 'first' matches, but 'second' doesn't match.
- EXPECT_THAT(p, Not(Pair(25, "bar")));
- EXPECT_THAT(p, Not(Pair(25, Not("foo"))));
-
- // Neither field matches.
- EXPECT_THAT(p, Not(Pair(13, "bar")));
- EXPECT_THAT(p, Not(Pair(Lt(13), HasSubstr("a"))));
-}
-
-TEST(PairTest, WorksWithMoveOnly) {
- pair<std::unique_ptr<int>, std::unique_ptr<int>> p;
- p.second.reset(new int(7));
- EXPECT_THAT(p, Pair(Eq(nullptr), Ne(nullptr)));
-}
-
-TEST(PairTest, SafelyCastsInnerMatchers) {
- Matcher<int> is_positive = Gt(0);
- Matcher<int> is_negative = Lt(0);
- pair<char, bool> p('a', true);
- EXPECT_THAT(p, Pair(is_positive, _));
- EXPECT_THAT(p, Not(Pair(is_negative, _)));
- EXPECT_THAT(p, Pair(_, is_positive));
- EXPECT_THAT(p, Not(Pair(_, is_negative)));
-}
-
-TEST(PairTest, InsideContainsUsingMap) {
- map<int, char> container;
- container.insert(make_pair(1, 'a'));
- container.insert(make_pair(2, 'b'));
- container.insert(make_pair(4, 'c'));
- EXPECT_THAT(container, Contains(Pair(1, 'a')));
- EXPECT_THAT(container, Contains(Pair(1, _)));
- EXPECT_THAT(container, Contains(Pair(_, 'a')));
- EXPECT_THAT(container, Not(Contains(Pair(3, _))));
-}
-
-TEST(FieldsAreTest, MatchesCorrectly) {
- std::tuple<int, std::string, double> p(25, "foo", .5);
-
- // All fields match.
- EXPECT_THAT(p, FieldsAre(25, "foo", .5));
- EXPECT_THAT(p, FieldsAre(Ge(20), HasSubstr("o"), DoubleEq(.5)));
-
- // Some don't match.
- EXPECT_THAT(p, Not(FieldsAre(26, "foo", .5)));
- EXPECT_THAT(p, Not(FieldsAre(25, "fo", .5)));
- EXPECT_THAT(p, Not(FieldsAre(25, "foo", .6)));
-}
-
-TEST(FieldsAreTest, CanDescribeSelf) {
- Matcher<const pair<std::string, int>&> m1 = FieldsAre("foo", 42);
- EXPECT_EQ(
- "has field #0 that is equal to \"foo\""
- ", and has field #1 that is equal to 42",
- Describe(m1));
- EXPECT_EQ(
- "has field #0 that isn't equal to \"foo\""
- ", or has field #1 that isn't equal to 42",
- DescribeNegation(m1));
-}
-
-TEST(FieldsAreTest, CanExplainMatchResultTo) {
- // The first one that fails is the one that gives the error.
- Matcher<std::tuple<int, int, int>> m =
- FieldsAre(GreaterThan(0), GreaterThan(0), GreaterThan(0));
-
- EXPECT_EQ("whose field #0 does not match, which is 1 less than 0",
- Explain(m, std::make_tuple(-1, -2, -3)));
- EXPECT_EQ("whose field #1 does not match, which is 2 less than 0",
- Explain(m, std::make_tuple(1, -2, -3)));
- EXPECT_EQ("whose field #2 does not match, which is 3 less than 0",
- Explain(m, std::make_tuple(1, 2, -3)));
-
- // If they all match, we get a long explanation of success.
- EXPECT_EQ(
- "whose all elements match, "
- "where field #0 is a value which is 1 more than 0"
- ", and field #1 is a value which is 2 more than 0"
- ", and field #2 is a value which is 3 more than 0",
- Explain(m, std::make_tuple(1, 2, 3)));
-
- // Only print those that have an explanation.
- m = FieldsAre(GreaterThan(0), 0, GreaterThan(0));
- EXPECT_EQ(
- "whose all elements match, "
- "where field #0 is a value which is 1 more than 0"
- ", and field #2 is a value which is 3 more than 0",
- Explain(m, std::make_tuple(1, 0, 3)));
-
- // If only one has an explanation, then print that one.
- m = FieldsAre(0, GreaterThan(0), 0);
- EXPECT_EQ(
- "whose all elements match, "
- "where field #1 is a value which is 1 more than 0",
- Explain(m, std::make_tuple(0, 1, 0)));
-}
-
-#if defined(__cpp_structured_bindings) && __cpp_structured_bindings >= 201606
-TEST(FieldsAreTest, StructuredBindings) {
- // testing::FieldsAre can also match aggregates and such with C++17 and up.
- struct MyType {
- int i;
- std::string str;
- };
- EXPECT_THAT((MyType{17, "foo"}), FieldsAre(Eq(17), HasSubstr("oo")));
-
- // Test all the supported arities.
- struct MyVarType1 {
- int a;
- };
- EXPECT_THAT(MyVarType1{}, FieldsAre(0));
- struct MyVarType2 {
- int a, b;
- };
- EXPECT_THAT(MyVarType2{}, FieldsAre(0, 0));
- struct MyVarType3 {
- int a, b, c;
- };
- EXPECT_THAT(MyVarType3{}, FieldsAre(0, 0, 0));
- struct MyVarType4 {
- int a, b, c, d;
- };
- EXPECT_THAT(MyVarType4{}, FieldsAre(0, 0, 0, 0));
- struct MyVarType5 {
- int a, b, c, d, e;
- };
- EXPECT_THAT(MyVarType5{}, FieldsAre(0, 0, 0, 0, 0));
- struct MyVarType6 {
- int a, b, c, d, e, f;
- };
- EXPECT_THAT(MyVarType6{}, FieldsAre(0, 0, 0, 0, 0, 0));
- struct MyVarType7 {
- int a, b, c, d, e, f, g;
- };
- EXPECT_THAT(MyVarType7{}, FieldsAre(0, 0, 0, 0, 0, 0, 0));
- struct MyVarType8 {
- int a, b, c, d, e, f, g, h;
- };
- EXPECT_THAT(MyVarType8{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType9 {
- int a, b, c, d, e, f, g, h, i;
- };
- EXPECT_THAT(MyVarType9{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType10 {
- int a, b, c, d, e, f, g, h, i, j;
- };
- EXPECT_THAT(MyVarType10{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType11 {
- int a, b, c, d, e, f, g, h, i, j, k;
- };
- EXPECT_THAT(MyVarType11{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType12 {
- int a, b, c, d, e, f, g, h, i, j, k, l;
- };
- EXPECT_THAT(MyVarType12{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType13 {
- int a, b, c, d, e, f, g, h, i, j, k, l, m;
- };
- EXPECT_THAT(MyVarType13{}, FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType14 {
- int a, b, c, d, e, f, g, h, i, j, k, l, m, n;
- };
- EXPECT_THAT(MyVarType14{},
- FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType15 {
- int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o;
- };
- EXPECT_THAT(MyVarType15{},
- FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
- struct MyVarType16 {
- int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p;
- };
- EXPECT_THAT(MyVarType16{},
- FieldsAre(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));
-}
-#endif
-
-TEST(ContainsTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(Contains(Pointee(2))));
- helper.Call(MakeUniquePtrs({1, 2}));
-}
-
-TEST(PairTest, UseGetInsteadOfMembers) {
- PairWithGet pair{7, "ABC"};
- EXPECT_THAT(pair, Pair(7, "ABC"));
- EXPECT_THAT(pair, Pair(Ge(7), HasSubstr("AB")));
- EXPECT_THAT(pair, Not(Pair(Lt(7), "ABC")));
-
- std::vector<PairWithGet> v = {{11, "Foo"}, {29, "gMockIsBestMock"}};
- EXPECT_THAT(v,
- ElementsAre(Pair(11, std::string("Foo")), Pair(Ge(10), Not(""))));
-}
-
-// Tests StartsWith(s).
-
-TEST(StartsWithTest, MatchesStringWithGivenPrefix) {
- const Matcher<const char*> m1 = StartsWith(std::string(""));
- EXPECT_TRUE(m1.Matches("Hi"));
- EXPECT_TRUE(m1.Matches(""));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const std::string&> m2 = StartsWith("Hi");
- EXPECT_TRUE(m2.Matches("Hi"));
- EXPECT_TRUE(m2.Matches("Hi Hi!"));
- EXPECT_TRUE(m2.Matches("High"));
- EXPECT_FALSE(m2.Matches("H"));
- EXPECT_FALSE(m2.Matches(" Hi"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- const Matcher<internal::StringView> m_empty =
- StartsWith(internal::StringView(""));
- EXPECT_TRUE(m_empty.Matches(internal::StringView()));
- EXPECT_TRUE(m_empty.Matches(internal::StringView("")));
- EXPECT_TRUE(m_empty.Matches(internal::StringView("not empty")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(StartsWithTest, CanDescribeSelf) {
- Matcher<const std::string> m = StartsWith("Hi");
- EXPECT_EQ("starts with \"Hi\"", Describe(m));
-}
-
-// Tests EndsWith(s).
-
-TEST(EndsWithTest, MatchesStringWithGivenSuffix) {
- const Matcher<const char*> m1 = EndsWith("");
- EXPECT_TRUE(m1.Matches("Hi"));
- EXPECT_TRUE(m1.Matches(""));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const std::string&> m2 = EndsWith(std::string("Hi"));
- EXPECT_TRUE(m2.Matches("Hi"));
- EXPECT_TRUE(m2.Matches("Wow Hi Hi"));
- EXPECT_TRUE(m2.Matches("Super Hi"));
- EXPECT_FALSE(m2.Matches("i"));
- EXPECT_FALSE(m2.Matches("Hi "));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- const Matcher<const internal::StringView&> m4 =
- EndsWith(internal::StringView(""));
- EXPECT_TRUE(m4.Matches("Hi"));
- EXPECT_TRUE(m4.Matches(""));
- EXPECT_TRUE(m4.Matches(internal::StringView()));
- EXPECT_TRUE(m4.Matches(internal::StringView("")));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(EndsWithTest, CanDescribeSelf) {
- Matcher<const std::string> m = EndsWith("Hi");
- EXPECT_EQ("ends with \"Hi\"", Describe(m));
-}
-
-// Tests WhenBase64Unescaped.
-
-TEST(WhenBase64UnescapedTest, MatchesUnescapedBase64Strings) {
- const Matcher<const char*> m1 = WhenBase64Unescaped(EndsWith("!"));
- EXPECT_FALSE(m1.Matches("invalid base64"));
- EXPECT_FALSE(m1.Matches("aGVsbG8gd29ybGQ=")); // hello world
- EXPECT_TRUE(m1.Matches("aGVsbG8gd29ybGQh")); // hello world!
-
- const Matcher<const std::string&> m2 = WhenBase64Unescaped(EndsWith("!"));
- EXPECT_FALSE(m2.Matches("invalid base64"));
- EXPECT_FALSE(m2.Matches("aGVsbG8gd29ybGQ=")); // hello world
- EXPECT_TRUE(m2.Matches("aGVsbG8gd29ybGQh")); // hello world!
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- const Matcher<const internal::StringView&> m3 =
- WhenBase64Unescaped(EndsWith("!"));
- EXPECT_FALSE(m3.Matches("invalid base64"));
- EXPECT_FALSE(m3.Matches("aGVsbG8gd29ybGQ=")); // hello world
- EXPECT_TRUE(m3.Matches("aGVsbG8gd29ybGQh")); // hello world!
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(WhenBase64UnescapedTest, CanDescribeSelf) {
- const Matcher<const char*> m = WhenBase64Unescaped(EndsWith("!"));
- EXPECT_EQ("matches after Base64Unescape ends with \"!\"", Describe(m));
-}
-
-// Tests MatchesRegex().
-
-TEST(MatchesRegexTest, MatchesStringMatchingGivenRegex) {
- const Matcher<const char*> m1 = MatchesRegex("a.*z");
- EXPECT_TRUE(m1.Matches("az"));
- EXPECT_TRUE(m1.Matches("abcz"));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const std::string&> m2 = MatchesRegex(new RE("a.*z"));
- EXPECT_TRUE(m2.Matches("azbz"));
- EXPECT_FALSE(m2.Matches("az1"));
- EXPECT_FALSE(m2.Matches("1az"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- const Matcher<const internal::StringView&> m3 = MatchesRegex("a.*z");
- EXPECT_TRUE(m3.Matches(internal::StringView("az")));
- EXPECT_TRUE(m3.Matches(internal::StringView("abcz")));
- EXPECT_FALSE(m3.Matches(internal::StringView("1az")));
- EXPECT_FALSE(m3.Matches(internal::StringView()));
- const Matcher<const internal::StringView&> m4 =
- MatchesRegex(internal::StringView(""));
- EXPECT_TRUE(m4.Matches(internal::StringView("")));
- EXPECT_TRUE(m4.Matches(internal::StringView()));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(MatchesRegexTest, CanDescribeSelf) {
- Matcher<const std::string> m1 = MatchesRegex(std::string("Hi.*"));
- EXPECT_EQ("matches regular expression \"Hi.*\"", Describe(m1));
-
- Matcher<const char*> m2 = MatchesRegex(new RE("a.*"));
- EXPECT_EQ("matches regular expression \"a.*\"", Describe(m2));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView> m3 = MatchesRegex(new RE("0.*"));
- EXPECT_EQ("matches regular expression \"0.*\"", Describe(m3));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-// Tests ContainsRegex().
-
-TEST(ContainsRegexTest, MatchesStringContainingGivenRegex) {
- const Matcher<const char*> m1 = ContainsRegex(std::string("a.*z"));
- EXPECT_TRUE(m1.Matches("az"));
- EXPECT_TRUE(m1.Matches("0abcz1"));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const std::string&> m2 = ContainsRegex(new RE("a.*z"));
- EXPECT_TRUE(m2.Matches("azbz"));
- EXPECT_TRUE(m2.Matches("az1"));
- EXPECT_FALSE(m2.Matches("1a"));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- const Matcher<const internal::StringView&> m3 =
- ContainsRegex(new RE("a.*z"));
- EXPECT_TRUE(m3.Matches(internal::StringView("azbz")));
- EXPECT_TRUE(m3.Matches(internal::StringView("az1")));
- EXPECT_FALSE(m3.Matches(internal::StringView("1a")));
- EXPECT_FALSE(m3.Matches(internal::StringView()));
- const Matcher<const internal::StringView&> m4 =
- ContainsRegex(internal::StringView(""));
- EXPECT_TRUE(m4.Matches(internal::StringView("")));
- EXPECT_TRUE(m4.Matches(internal::StringView()));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-TEST(ContainsRegexTest, CanDescribeSelf) {
- Matcher<const std::string> m1 = ContainsRegex("Hi.*");
- EXPECT_EQ("contains regular expression \"Hi.*\"", Describe(m1));
-
- Matcher<const char*> m2 = ContainsRegex(new RE("a.*"));
- EXPECT_EQ("contains regular expression \"a.*\"", Describe(m2));
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- Matcher<const internal::StringView> m3 = ContainsRegex(new RE("0.*"));
- EXPECT_EQ("contains regular expression \"0.*\"", Describe(m3));
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-}
-
-// Tests for wide strings.
-#if GTEST_HAS_STD_WSTRING
-TEST(StdWideStrEqTest, MatchesEqual) {
- Matcher<const wchar_t*> m = StrEq(::std::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(nullptr));
-
- Matcher<const ::std::wstring&> m2 = StrEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"Hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-
- Matcher<const ::std::wstring&> m3 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_TRUE(m3.Matches(L"\xD3\x576\x8D3\xC74D"));
- EXPECT_FALSE(m3.Matches(L"\xD3\x576\x8D3\xC74E"));
-
- ::std::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::std::wstring&> m4 = StrEq(str);
- EXPECT_TRUE(m4.Matches(str));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::std::wstring&> m5 = StrEq(str);
- EXPECT_TRUE(m5.Matches(str));
-}
-
-TEST(StdWideStrEqTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = StrEq(L"Hi-\'\"?\\\a\b\f\n\r\t\v");
- EXPECT_EQ("is equal to L\"Hi-\'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\"",
- Describe(m));
-
- Matcher< ::std::wstring> m2 = StrEq(L"\xD3\x576\x8D3\xC74D");
- EXPECT_EQ("is equal to L\"\\xD3\\x576\\x8D3\\xC74D\"",
- Describe(m2));
-
- ::std::wstring str(L"01204500800");
- str[3] = L'\0';
- Matcher<const ::std::wstring&> m4 = StrEq(str);
- EXPECT_EQ("is equal to L\"012\\04500800\"", Describe(m4));
- str[0] = str[6] = str[7] = str[9] = str[10] = L'\0';
- Matcher<const ::std::wstring&> m5 = StrEq(str);
- EXPECT_EQ("is equal to L\"\\012\\045\\0\\08\\0\\0\"", Describe(m5));
-}
-
-TEST(StdWideStrNeTest, MatchesUnequalString) {
- Matcher<const wchar_t*> m = StrNe(L"Hello");
- EXPECT_TRUE(m.Matches(L""));
- EXPECT_TRUE(m.Matches(nullptr));
- EXPECT_FALSE(m.Matches(L"Hello"));
-
- Matcher< ::std::wstring> m2 = StrNe(::std::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(StdWideStrNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrNe(L"Hi");
- EXPECT_EQ("isn't equal to L\"Hi\"", Describe(m));
-}
-
-TEST(StdWideStrCaseEqTest, MatchesEqualStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseEq(::std::wstring(L"Hello"));
- EXPECT_TRUE(m.Matches(L"Hello"));
- EXPECT_TRUE(m.Matches(L"hello"));
- EXPECT_FALSE(m.Matches(L"Hi"));
- EXPECT_FALSE(m.Matches(nullptr));
-
- Matcher<const ::std::wstring&> m2 = StrCaseEq(L"Hello");
- EXPECT_TRUE(m2.Matches(L"hello"));
- EXPECT_FALSE(m2.Matches(L"Hi"));
-}
-
-TEST(StdWideStrCaseEqTest, MatchesEqualStringWith0IgnoringCase) {
- ::std::wstring str1(L"oabocdooeoo");
- ::std::wstring str2(L"OABOCDOOEOO");
- Matcher<const ::std::wstring&> m0 = StrCaseEq(str1);
- EXPECT_FALSE(m0.Matches(str2 + ::std::wstring(1, L'\0')));
-
- str1[3] = str2[3] = L'\0';
- Matcher<const ::std::wstring&> m1 = StrCaseEq(str1);
- EXPECT_TRUE(m1.Matches(str2));
-
- str1[0] = str1[6] = str1[7] = str1[10] = L'\0';
- str2[0] = str2[6] = str2[7] = str2[10] = L'\0';
- Matcher<const ::std::wstring&> m2 = StrCaseEq(str1);
- str1[9] = str2[9] = L'\0';
- EXPECT_FALSE(m2.Matches(str2));
-
- Matcher<const ::std::wstring&> m3 = StrCaseEq(str1);
- EXPECT_TRUE(m3.Matches(str2));
-
- EXPECT_FALSE(m3.Matches(str2 + L"x"));
- str2.append(1, L'\0');
- EXPECT_FALSE(m3.Matches(str2));
- EXPECT_FALSE(m3.Matches(::std::wstring(str2, 0, 9)));
-}
-
-TEST(StdWideStrCaseEqTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = StrCaseEq(L"Hi");
- EXPECT_EQ("is equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-TEST(StdWideStrCaseNeTest, MatchesUnequalStringIgnoringCase) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hello");
- EXPECT_TRUE(m.Matches(L"Hi"));
- EXPECT_TRUE(m.Matches(nullptr));
- EXPECT_FALSE(m.Matches(L"Hello"));
- EXPECT_FALSE(m.Matches(L"hello"));
-
- Matcher< ::std::wstring> m2 = StrCaseNe(::std::wstring(L"Hello"));
- EXPECT_TRUE(m2.Matches(L""));
- EXPECT_FALSE(m2.Matches(L"Hello"));
-}
-
-TEST(StdWideStrCaseNeTest, CanDescribeSelf) {
- Matcher<const wchar_t*> m = StrCaseNe(L"Hi");
- EXPECT_EQ("isn't equal to (ignoring case) L\"Hi\"", Describe(m));
-}
-
-// Tests that HasSubstr() works for matching wstring-typed values.
-TEST(StdWideHasSubstrTest, WorksForStringClasses) {
- const Matcher< ::std::wstring> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(::std::wstring(L"I love food.")));
- EXPECT_FALSE(m1.Matches(::std::wstring(L"tofo")));
-
- const Matcher<const ::std::wstring&> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(::std::wstring(L"I love food.")));
- EXPECT_FALSE(m2.Matches(::std::wstring(L"tofo")));
-}
-
-// Tests that HasSubstr() works for matching C-wide-string-typed values.
-TEST(StdWideHasSubstrTest, WorksForCStrings) {
- const Matcher<wchar_t*> m1 = HasSubstr(L"foo");
- EXPECT_TRUE(m1.Matches(const_cast<wchar_t*>(L"I love food.")));
- EXPECT_FALSE(m1.Matches(const_cast<wchar_t*>(L"tofo")));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const wchar_t*> m2 = HasSubstr(L"foo");
- EXPECT_TRUE(m2.Matches(L"I love food."));
- EXPECT_FALSE(m2.Matches(L"tofo"));
- EXPECT_FALSE(m2.Matches(nullptr));
-}
-
-// Tests that HasSubstr(s) describes itself properly.
-TEST(StdWideHasSubstrTest, CanDescribeSelf) {
- Matcher< ::std::wstring> m = HasSubstr(L"foo\n\"");
- EXPECT_EQ("has substring L\"foo\\n\\\"\"", Describe(m));
-}
-
-// Tests StartsWith(s).
-
-TEST(StdWideStartsWithTest, MatchesStringWithGivenPrefix) {
- const Matcher<const wchar_t*> m1 = StartsWith(::std::wstring(L""));
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const ::std::wstring&> m2 = StartsWith(L"Hi");
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi Hi!"));
- EXPECT_TRUE(m2.Matches(L"High"));
- EXPECT_FALSE(m2.Matches(L"H"));
- EXPECT_FALSE(m2.Matches(L" Hi"));
-}
-
-TEST(StdWideStartsWithTest, CanDescribeSelf) {
- Matcher<const ::std::wstring> m = StartsWith(L"Hi");
- EXPECT_EQ("starts with L\"Hi\"", Describe(m));
-}
-
-// Tests EndsWith(s).
-
-TEST(StdWideEndsWithTest, MatchesStringWithGivenSuffix) {
- const Matcher<const wchar_t*> m1 = EndsWith(L"");
- EXPECT_TRUE(m1.Matches(L"Hi"));
- EXPECT_TRUE(m1.Matches(L""));
- EXPECT_FALSE(m1.Matches(nullptr));
-
- const Matcher<const ::std::wstring&> m2 = EndsWith(::std::wstring(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Hi"));
- EXPECT_TRUE(m2.Matches(L"Wow Hi Hi"));
- EXPECT_TRUE(m2.Matches(L"Super Hi"));
- EXPECT_FALSE(m2.Matches(L"i"));
- EXPECT_FALSE(m2.Matches(L"Hi "));
-}
-
-TEST(StdWideEndsWithTest, CanDescribeSelf) {
- Matcher<const ::std::wstring> m = EndsWith(L"Hi");
- EXPECT_EQ("ends with L\"Hi\"", Describe(m));
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-typedef ::std::tuple<long, int> Tuple2; // NOLINT
-
-// Tests that Eq() matches a 2-tuple where the first field == the
-// second field.
-TEST(Eq2Test, MatchesEqualArguments) {
- Matcher<const Tuple2&> m = Eq();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Eq() describes itself properly.
-TEST(Eq2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Eq();
- EXPECT_EQ("are an equal pair", Describe(m));
-}
-
-// Tests that Ge() matches a 2-tuple where the first field >= the
-// second field.
-TEST(Ge2Test, MatchesGreaterThanOrEqualArguments) {
- Matcher<const Tuple2&> m = Ge();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Ge() describes itself properly.
-TEST(Ge2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Ge();
- EXPECT_EQ("are a pair where the first >= the second", Describe(m));
-}
-
-// Tests that Gt() matches a 2-tuple where the first field > the
-// second field.
-TEST(Gt2Test, MatchesGreaterThanArguments) {
- Matcher<const Tuple2&> m = Gt();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 6)));
-}
-
-// Tests that Gt() describes itself properly.
-TEST(Gt2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Gt();
- EXPECT_EQ("are a pair where the first > the second", Describe(m));
-}
-
-// Tests that Le() matches a 2-tuple where the first field <= the
-// second field.
-TEST(Le2Test, MatchesLessThanOrEqualArguments) {
- Matcher<const Tuple2&> m = Le();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
-}
-
-// Tests that Le() describes itself properly.
-TEST(Le2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Le();
- EXPECT_EQ("are a pair where the first <= the second", Describe(m));
-}
-
-// Tests that Lt() matches a 2-tuple where the first field < the
-// second field.
-TEST(Lt2Test, MatchesLessThanArguments) {
- Matcher<const Tuple2&> m = Lt();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 4)));
-}
-
-// Tests that Lt() describes itself properly.
-TEST(Lt2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Lt();
- EXPECT_EQ("are a pair where the first < the second", Describe(m));
-}
-
-// Tests that Ne() matches a 2-tuple where the first field != the
-// second field.
-TEST(Ne2Test, MatchesUnequalArguments) {
- Matcher<const Tuple2&> m = Ne();
- EXPECT_TRUE(m.Matches(Tuple2(5L, 6)));
- EXPECT_TRUE(m.Matches(Tuple2(5L, 4)));
- EXPECT_FALSE(m.Matches(Tuple2(5L, 5)));
-}
-
-// Tests that Ne() describes itself properly.
-TEST(Ne2Test, CanDescribeSelf) {
- Matcher<const Tuple2&> m = Ne();
- EXPECT_EQ("are an unequal pair", Describe(m));
-}
-
-TEST(PairMatchBaseTest, WorksWithMoveOnly) {
- using Pointers = std::tuple<std::unique_ptr<int>, std::unique_ptr<int>>;
- Matcher<Pointers> matcher = Eq();
- Pointers pointers;
- // Tested values don't matter; the point is that matcher does not copy the
- // matched values.
- EXPECT_TRUE(matcher.Matches(pointers));
-}
-
-// Tests that IsNan() matches a NaN, with float.
-TEST(IsNan, FloatMatchesNan) {
- float quiet_nan = std::numeric_limits<float>::quiet_NaN();
- float other_nan = std::nanf("1");
- float real_value = 1.0f;
-
- Matcher<float> m = IsNan();
- EXPECT_TRUE(m.Matches(quiet_nan));
- EXPECT_TRUE(m.Matches(other_nan));
- EXPECT_FALSE(m.Matches(real_value));
-
- Matcher<float&> m_ref = IsNan();
- EXPECT_TRUE(m_ref.Matches(quiet_nan));
- EXPECT_TRUE(m_ref.Matches(other_nan));
- EXPECT_FALSE(m_ref.Matches(real_value));
-
- Matcher<const float&> m_cref = IsNan();
- EXPECT_TRUE(m_cref.Matches(quiet_nan));
- EXPECT_TRUE(m_cref.Matches(other_nan));
- EXPECT_FALSE(m_cref.Matches(real_value));
-}
-
-// Tests that IsNan() matches a NaN, with double.
-TEST(IsNan, DoubleMatchesNan) {
- double quiet_nan = std::numeric_limits<double>::quiet_NaN();
- double other_nan = std::nan("1");
- double real_value = 1.0;
-
- Matcher<double> m = IsNan();
- EXPECT_TRUE(m.Matches(quiet_nan));
- EXPECT_TRUE(m.Matches(other_nan));
- EXPECT_FALSE(m.Matches(real_value));
-
- Matcher<double&> m_ref = IsNan();
- EXPECT_TRUE(m_ref.Matches(quiet_nan));
- EXPECT_TRUE(m_ref.Matches(other_nan));
- EXPECT_FALSE(m_ref.Matches(real_value));
-
- Matcher<const double&> m_cref = IsNan();
- EXPECT_TRUE(m_cref.Matches(quiet_nan));
- EXPECT_TRUE(m_cref.Matches(other_nan));
- EXPECT_FALSE(m_cref.Matches(real_value));
-}
-
-// Tests that IsNan() matches a NaN, with long double.
-TEST(IsNan, LongDoubleMatchesNan) {
- long double quiet_nan = std::numeric_limits<long double>::quiet_NaN();
- long double other_nan = std::nan("1");
- long double real_value = 1.0;
-
- Matcher<long double> m = IsNan();
- EXPECT_TRUE(m.Matches(quiet_nan));
- EXPECT_TRUE(m.Matches(other_nan));
- EXPECT_FALSE(m.Matches(real_value));
-
- Matcher<long double&> m_ref = IsNan();
- EXPECT_TRUE(m_ref.Matches(quiet_nan));
- EXPECT_TRUE(m_ref.Matches(other_nan));
- EXPECT_FALSE(m_ref.Matches(real_value));
-
- Matcher<const long double&> m_cref = IsNan();
- EXPECT_TRUE(m_cref.Matches(quiet_nan));
- EXPECT_TRUE(m_cref.Matches(other_nan));
- EXPECT_FALSE(m_cref.Matches(real_value));
-}
-
-// Tests that IsNan() works with Not.
-TEST(IsNan, NotMatchesNan) {
- Matcher<float> mf = Not(IsNan());
- EXPECT_FALSE(mf.Matches(std::numeric_limits<float>::quiet_NaN()));
- EXPECT_FALSE(mf.Matches(std::nanf("1")));
- EXPECT_TRUE(mf.Matches(1.0));
-
- Matcher<double> md = Not(IsNan());
- EXPECT_FALSE(md.Matches(std::numeric_limits<double>::quiet_NaN()));
- EXPECT_FALSE(md.Matches(std::nan("1")));
- EXPECT_TRUE(md.Matches(1.0));
-
- Matcher<long double> mld = Not(IsNan());
- EXPECT_FALSE(mld.Matches(std::numeric_limits<long double>::quiet_NaN()));
- EXPECT_FALSE(mld.Matches(std::nanl("1")));
- EXPECT_TRUE(mld.Matches(1.0));
-}
-
-// Tests that IsNan() can describe itself.
-TEST(IsNan, CanDescribeSelf) {
- Matcher<float> mf = IsNan();
- EXPECT_EQ("is NaN", Describe(mf));
-
- Matcher<double> md = IsNan();
- EXPECT_EQ("is NaN", Describe(md));
-
- Matcher<long double> mld = IsNan();
- EXPECT_EQ("is NaN", Describe(mld));
-}
-
-// Tests that IsNan() can describe itself with Not.
-TEST(IsNan, CanDescribeSelfWithNot) {
- Matcher<float> mf = Not(IsNan());
- EXPECT_EQ("isn't NaN", Describe(mf));
-
- Matcher<double> md = Not(IsNan());
- EXPECT_EQ("isn't NaN", Describe(md));
-
- Matcher<long double> mld = Not(IsNan());
- EXPECT_EQ("isn't NaN", Describe(mld));
-}
-
-// Tests that FloatEq() matches a 2-tuple where
-// FloatEq(first field) matches the second field.
-TEST(FloatEq2Test, MatchesEqualArguments) {
- typedef ::std::tuple<float, float> Tpl;
- Matcher<const Tpl&> m = FloatEq();
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(0.3f, 0.1f + 0.1f + 0.1f)));
- EXPECT_FALSE(m.Matches(Tpl(1.1f, 1.0f)));
-}
-
-// Tests that FloatEq() describes itself properly.
-TEST(FloatEq2Test, CanDescribeSelf) {
- Matcher<const ::std::tuple<float, float>&> m = FloatEq();
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that NanSensitiveFloatEq() matches a 2-tuple where
-// NanSensitiveFloatEq(first field) matches the second field.
-TEST(NanSensitiveFloatEqTest, MatchesEqualArgumentsWithNaN) {
- typedef ::std::tuple<float, float> Tpl;
- Matcher<const Tpl&> m = NanSensitiveFloatEq();
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<float>::quiet_NaN(),
- std::numeric_limits<float>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(1.1f, 1.0f)));
- EXPECT_FALSE(m.Matches(Tpl(1.0f, std::numeric_limits<float>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(std::numeric_limits<float>::quiet_NaN(), 1.0f)));
-}
-
-// Tests that NanSensitiveFloatEq() describes itself properly.
-TEST(NanSensitiveFloatEqTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::std::tuple<float, float>&> m = NanSensitiveFloatEq();
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that DoubleEq() matches a 2-tuple where
-// DoubleEq(first field) matches the second field.
-TEST(DoubleEq2Test, MatchesEqualArguments) {
- typedef ::std::tuple<double, double> Tpl;
- Matcher<const Tpl&> m = DoubleEq();
- EXPECT_TRUE(m.Matches(Tpl(1.0, 1.0)));
- EXPECT_TRUE(m.Matches(Tpl(0.3, 0.1 + 0.1 + 0.1)));
- EXPECT_FALSE(m.Matches(Tpl(1.1, 1.0)));
-}
-
-// Tests that DoubleEq() describes itself properly.
-TEST(DoubleEq2Test, CanDescribeSelf) {
- Matcher<const ::std::tuple<double, double>&> m = DoubleEq();
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that NanSensitiveDoubleEq() matches a 2-tuple where
-// NanSensitiveDoubleEq(first field) matches the second field.
-TEST(NanSensitiveDoubleEqTest, MatchesEqualArgumentsWithNaN) {
- typedef ::std::tuple<double, double> Tpl;
- Matcher<const Tpl&> m = NanSensitiveDoubleEq();
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<double>::quiet_NaN(),
- std::numeric_limits<double>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(1.1f, 1.0f)));
- EXPECT_FALSE(m.Matches(Tpl(1.0f, std::numeric_limits<double>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(std::numeric_limits<double>::quiet_NaN(), 1.0f)));
-}
-
-// Tests that DoubleEq() describes itself properly.
-TEST(NanSensitiveDoubleEqTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::std::tuple<double, double>&> m = NanSensitiveDoubleEq();
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that FloatEq() matches a 2-tuple where
-// FloatNear(first field, max_abs_error) matches the second field.
-TEST(FloatNear2Test, MatchesEqualArguments) {
- typedef ::std::tuple<float, float> Tpl;
- Matcher<const Tpl&> m = FloatNear(0.5f);
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(1.3f, 1.0f)));
- EXPECT_FALSE(m.Matches(Tpl(1.8f, 1.0f)));
-}
-
-// Tests that FloatNear() describes itself properly.
-TEST(FloatNear2Test, CanDescribeSelf) {
- Matcher<const ::std::tuple<float, float>&> m = FloatNear(0.5f);
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that NanSensitiveFloatNear() matches a 2-tuple where
-// NanSensitiveFloatNear(first field) matches the second field.
-TEST(NanSensitiveFloatNearTest, MatchesNearbyArgumentsWithNaN) {
- typedef ::std::tuple<float, float> Tpl;
- Matcher<const Tpl&> m = NanSensitiveFloatNear(0.5f);
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(1.1f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<float>::quiet_NaN(),
- std::numeric_limits<float>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(1.6f, 1.0f)));
- EXPECT_FALSE(m.Matches(Tpl(1.0f, std::numeric_limits<float>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(std::numeric_limits<float>::quiet_NaN(), 1.0f)));
-}
-
-// Tests that NanSensitiveFloatNear() describes itself properly.
-TEST(NanSensitiveFloatNearTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::std::tuple<float, float>&> m = NanSensitiveFloatNear(0.5f);
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that FloatEq() matches a 2-tuple where
-// DoubleNear(first field, max_abs_error) matches the second field.
-TEST(DoubleNear2Test, MatchesEqualArguments) {
- typedef ::std::tuple<double, double> Tpl;
- Matcher<const Tpl&> m = DoubleNear(0.5);
- EXPECT_TRUE(m.Matches(Tpl(1.0, 1.0)));
- EXPECT_TRUE(m.Matches(Tpl(1.3, 1.0)));
- EXPECT_FALSE(m.Matches(Tpl(1.8, 1.0)));
-}
-
-// Tests that DoubleNear() describes itself properly.
-TEST(DoubleNear2Test, CanDescribeSelf) {
- Matcher<const ::std::tuple<double, double>&> m = DoubleNear(0.5);
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that NanSensitiveDoubleNear() matches a 2-tuple where
-// NanSensitiveDoubleNear(first field) matches the second field.
-TEST(NanSensitiveDoubleNearTest, MatchesNearbyArgumentsWithNaN) {
- typedef ::std::tuple<double, double> Tpl;
- Matcher<const Tpl&> m = NanSensitiveDoubleNear(0.5f);
- EXPECT_TRUE(m.Matches(Tpl(1.0f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(1.1f, 1.0f)));
- EXPECT_TRUE(m.Matches(Tpl(std::numeric_limits<double>::quiet_NaN(),
- std::numeric_limits<double>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(1.6f, 1.0f)));
- EXPECT_FALSE(m.Matches(Tpl(1.0f, std::numeric_limits<double>::quiet_NaN())));
- EXPECT_FALSE(m.Matches(Tpl(std::numeric_limits<double>::quiet_NaN(), 1.0f)));
-}
-
-// Tests that NanSensitiveDoubleNear() describes itself properly.
-TEST(NanSensitiveDoubleNearTest, CanDescribeSelfWithNaNs) {
- Matcher<const ::std::tuple<double, double>&> m = NanSensitiveDoubleNear(0.5f);
- EXPECT_EQ("are an almost-equal pair", Describe(m));
-}
-
-// Tests that Not(m) matches any value that doesn't match m.
-TEST(NotTest, NegatesMatcher) {
- Matcher<int> m;
- m = Not(Eq(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
-}
-
-// Tests that Not(m) describes itself properly.
-TEST(NotTest, CanDescribeSelf) {
- Matcher<int> m = Not(Eq(5));
- EXPECT_EQ("isn't equal to 5", Describe(m));
-}
-
-// Tests that monomorphic matchers are safely cast by the Not matcher.
-TEST(NotTest, NotMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 is a monomorphic matcher.
- Matcher<int> greater_than_5 = Gt(5);
-
- Matcher<const int&> m = Not(greater_than_5);
- Matcher<int&> m2 = Not(greater_than_5);
- Matcher<int&> m3 = Not(m);
-}
-
-// Helper to allow easy testing of AllOf matchers with num parameters.
-void AllOfMatches(int num, const Matcher<int>& m) {
- SCOPED_TRACE(Describe(m));
- EXPECT_TRUE(m.Matches(0));
- for (int i = 1; i <= num; ++i) {
- EXPECT_FALSE(m.Matches(i));
- }
- EXPECT_TRUE(m.Matches(num + 1));
-}
-
-// Tests that AllOf(m1, ..., mn) matches any value that matches all of
-// the given matchers.
-TEST(AllOfTest, MatchesWhenAllMatch) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(0));
- EXPECT_FALSE(m.Matches(3));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
- EXPECT_FALSE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
- EXPECT_FALSE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- EXPECT_TRUE(m.Matches(0));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_FALSE(m.Matches(3));
-
- // The following tests for varying number of sub-matchers. Due to the way
- // the sub-matchers are handled it is enough to test every sub-matcher once
- // with sub-matchers using the same matcher type. Varying matcher types are
- // checked for above.
- AllOfMatches(2, AllOf(Ne(1), Ne(2)));
- AllOfMatches(3, AllOf(Ne(1), Ne(2), Ne(3)));
- AllOfMatches(4, AllOf(Ne(1), Ne(2), Ne(3), Ne(4)));
- AllOfMatches(5, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5)));
- AllOfMatches(6, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6)));
- AllOfMatches(7, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7)));
- AllOfMatches(8, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7),
- Ne(8)));
- AllOfMatches(9, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7),
- Ne(8), Ne(9)));
- AllOfMatches(10, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8),
- Ne(9), Ne(10)));
- AllOfMatches(
- 50, AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), Ne(9),
- Ne(10), Ne(11), Ne(12), Ne(13), Ne(14), Ne(15), Ne(16), Ne(17),
- Ne(18), Ne(19), Ne(20), Ne(21), Ne(22), Ne(23), Ne(24), Ne(25),
- Ne(26), Ne(27), Ne(28), Ne(29), Ne(30), Ne(31), Ne(32), Ne(33),
- Ne(34), Ne(35), Ne(36), Ne(37), Ne(38), Ne(39), Ne(40), Ne(41),
- Ne(42), Ne(43), Ne(44), Ne(45), Ne(46), Ne(47), Ne(48), Ne(49),
- Ne(50)));
-}
-
-
-// Tests that AllOf(m1, ..., mn) describes itself properly.
-TEST(AllOfTest, CanDescribeSelf) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- EXPECT_EQ("(is <= 2) and (is >= 1)", Describe(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- std::string expected_descr1 =
- "(is > 0) and (isn't equal to 1) and (isn't equal to 2)";
- EXPECT_EQ(expected_descr1, Describe(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- std::string expected_descr2 =
- "(is > 0) and (isn't equal to 1) and (isn't equal to 2) and (isn't equal "
- "to 3)";
- EXPECT_EQ(expected_descr2, Describe(m));
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- std::string expected_descr3 =
- "(is >= 0) and (is < 10) and (isn't equal to 3) and (isn't equal to 5) "
- "and (isn't equal to 7)";
- EXPECT_EQ(expected_descr3, Describe(m));
-}
-
-// Tests that AllOf(m1, ..., mn) describes its negation properly.
-TEST(AllOfTest, CanDescribeNegation) {
- Matcher<int> m;
- m = AllOf(Le(2), Ge(1));
- std::string expected_descr4 = "(isn't <= 2) or (isn't >= 1)";
- EXPECT_EQ(expected_descr4, DescribeNegation(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2));
- std::string expected_descr5 =
- "(isn't > 0) or (is equal to 1) or (is equal to 2)";
- EXPECT_EQ(expected_descr5, DescribeNegation(m));
-
- m = AllOf(Gt(0), Ne(1), Ne(2), Ne(3));
- std::string expected_descr6 =
- "(isn't > 0) or (is equal to 1) or (is equal to 2) or (is equal to 3)";
- EXPECT_EQ(expected_descr6, DescribeNegation(m));
-
- m = AllOf(Ge(0), Lt(10), Ne(3), Ne(5), Ne(7));
- std::string expected_desr7 =
- "(isn't >= 0) or (isn't < 10) or (is equal to 3) or (is equal to 5) or "
- "(is equal to 7)";
- EXPECT_EQ(expected_desr7, DescribeNegation(m));
-
- m = AllOf(Ne(1), Ne(2), Ne(3), Ne(4), Ne(5), Ne(6), Ne(7), Ne(8), Ne(9),
- Ne(10), Ne(11));
- AllOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
- EXPECT_THAT(Describe(m), EndsWith("and (isn't equal to 11)"));
- AllOfMatches(11, m);
-}
-
-// Tests that monomorphic matchers are safely cast by the AllOf matcher.
-TEST(AllOfTest, AllOfMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 and less_than_10 are monomorphic matchers.
- Matcher<int> greater_than_5 = Gt(5);
- Matcher<int> less_than_10 = Lt(10);
-
- Matcher<const int&> m = AllOf(greater_than_5, less_than_10);
- Matcher<int&> m2 = AllOf(greater_than_5, less_than_10);
- Matcher<int&> m3 = AllOf(greater_than_5, m2);
-
- // Tests that BothOf works when composing itself.
- Matcher<const int&> m4 = AllOf(greater_than_5, less_than_10, less_than_10);
- Matcher<int&> m5 = AllOf(greater_than_5, less_than_10, less_than_10);
-}
-
-TEST(AllOfTest, ExplainsResult) {
- Matcher<int> m;
-
- // Successful match. Both matchers need to explain. The second
- // matcher doesn't give an explanation, so only the first matcher's
- // explanation is printed.
- m = AllOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("which is 15 more than 10", Explain(m, 25));
-
- // Successful match. Both matchers need to explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 20 more than 10, and which is 10 more than 20",
- Explain(m, 30));
-
- // Successful match. All matchers need to explain. The second
- // matcher doesn't given an explanation.
- m = AllOf(GreaterThan(10), Lt(30), GreaterThan(20));
- EXPECT_EQ("which is 15 more than 10, and which is 5 more than 20",
- Explain(m, 25));
-
- // Successful match. All matchers need to explain.
- m = AllOf(GreaterThan(10), GreaterThan(20), GreaterThan(30));
- EXPECT_EQ("which is 30 more than 10, and which is 20 more than 20, "
- "and which is 10 more than 30",
- Explain(m, 40));
-
- // Failed match. The first matcher, which failed, needs to
- // explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 10", Explain(m, 5));
-
- // Failed match. The second matcher, which failed, needs to
- // explain. Since it doesn't given an explanation, nothing is
- // printed.
- m = AllOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("", Explain(m, 40));
-
- // Failed match. The second matcher, which failed, needs to
- // explain.
- m = AllOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 20", Explain(m, 15));
-}
-
-// Helper to allow easy testing of AnyOf matchers with num parameters.
-static void AnyOfMatches(int num, const Matcher<int>& m) {
- SCOPED_TRACE(Describe(m));
- EXPECT_FALSE(m.Matches(0));
- for (int i = 1; i <= num; ++i) {
- EXPECT_TRUE(m.Matches(i));
- }
- EXPECT_FALSE(m.Matches(num + 1));
-}
-
-static void AnyOfStringMatches(int num, const Matcher<std::string>& m) {
- SCOPED_TRACE(Describe(m));
- EXPECT_FALSE(m.Matches(std::to_string(0)));
-
- for (int i = 1; i <= num; ++i) {
- EXPECT_TRUE(m.Matches(std::to_string(i)));
- }
- EXPECT_FALSE(m.Matches(std::to_string(num + 1)));
-}
-
-// Tests that AnyOf(m1, ..., mn) matches any value that matches at
-// least one of the given matchers.
-TEST(AnyOfTest, MatchesWhenAnyMatches) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(4));
- EXPECT_FALSE(m.Matches(2));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_TRUE(m.Matches(-1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_FALSE(m.Matches(0));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_TRUE(m.Matches(-1));
- EXPECT_TRUE(m.Matches(1));
- EXPECT_TRUE(m.Matches(2));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(0));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_TRUE(m.Matches(0));
- EXPECT_TRUE(m.Matches(11));
- EXPECT_TRUE(m.Matches(3));
- EXPECT_FALSE(m.Matches(2));
-
- // The following tests for varying number of sub-matchers. Due to the way
- // the sub-matchers are handled it is enough to test every sub-matcher once
- // with sub-matchers using the same matcher type. Varying matcher types are
- // checked for above.
- AnyOfMatches(2, AnyOf(1, 2));
- AnyOfMatches(3, AnyOf(1, 2, 3));
- AnyOfMatches(4, AnyOf(1, 2, 3, 4));
- AnyOfMatches(5, AnyOf(1, 2, 3, 4, 5));
- AnyOfMatches(6, AnyOf(1, 2, 3, 4, 5, 6));
- AnyOfMatches(7, AnyOf(1, 2, 3, 4, 5, 6, 7));
- AnyOfMatches(8, AnyOf(1, 2, 3, 4, 5, 6, 7, 8));
- AnyOfMatches(9, AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9));
- AnyOfMatches(10, AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
-}
-
-// Tests the variadic version of the AnyOfMatcher.
-TEST(AnyOfTest, VariadicMatchesWhenAnyMatches) {
- // Also make sure AnyOf is defined in the right namespace and does not depend
- // on ADL.
- Matcher<int> m = ::testing::AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11);
-
- EXPECT_THAT(Describe(m), EndsWith("or (is equal to 11)"));
- AnyOfMatches(11, m);
- AnyOfMatches(50, AnyOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50));
- AnyOfStringMatches(
- 50, AnyOf("1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
- "23", "24", "25", "26", "27", "28", "29", "30", "31", "32",
- "33", "34", "35", "36", "37", "38", "39", "40", "41", "42",
- "43", "44", "45", "46", "47", "48", "49", "50"));
-}
-
-TEST(ConditionalTest, MatchesFirstIfCondition) {
- Matcher<std::string> eq_red = Eq("red");
- Matcher<std::string> ne_red = Ne("red");
- Matcher<std::string> m = Conditional(true, eq_red, ne_red);
- EXPECT_TRUE(m.Matches("red"));
- EXPECT_FALSE(m.Matches("green"));
-
- StringMatchResultListener listener;
- StringMatchResultListener expected;
- EXPECT_FALSE(m.MatchAndExplain("green", &listener));
- EXPECT_FALSE(eq_red.MatchAndExplain("green", &expected));
- EXPECT_THAT(listener.str(), Eq(expected.str()));
-}
-
-TEST(ConditionalTest, MatchesSecondIfCondition) {
- Matcher<std::string> eq_red = Eq("red");
- Matcher<std::string> ne_red = Ne("red");
- Matcher<std::string> m = Conditional(false, eq_red, ne_red);
- EXPECT_FALSE(m.Matches("red"));
- EXPECT_TRUE(m.Matches("green"));
-
- StringMatchResultListener listener;
- StringMatchResultListener expected;
- EXPECT_FALSE(m.MatchAndExplain("red", &listener));
- EXPECT_FALSE(ne_red.MatchAndExplain("red", &expected));
- EXPECT_THAT(listener.str(), Eq(expected.str()));
-}
-
-// Tests the variadic version of the ElementsAreMatcher
-TEST(ElementsAreTest, HugeMatcher) {
- vector<int> test_vector{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
-
- EXPECT_THAT(test_vector,
- ElementsAre(Eq(1), Eq(2), Lt(13), Eq(4), Eq(5), Eq(6), Eq(7),
- Eq(8), Eq(9), Eq(10), Gt(1), Eq(12)));
-}
-
-// Tests the variadic version of the UnorderedElementsAreMatcher
-TEST(ElementsAreTest, HugeMatcherStr) {
- vector<std::string> test_vector{
- "literal_string", "", "", "", "", "", "", "", "", "", "", ""};
-
- EXPECT_THAT(test_vector, UnorderedElementsAre("literal_string", _, _, _, _, _,
- _, _, _, _, _, _));
-}
-
-// Tests the variadic version of the UnorderedElementsAreMatcher
-TEST(ElementsAreTest, HugeMatcherUnordered) {
- vector<int> test_vector{2, 1, 8, 5, 4, 6, 7, 3, 9, 12, 11, 10};
-
- EXPECT_THAT(test_vector, UnorderedElementsAre(
- Eq(2), Eq(1), Gt(7), Eq(5), Eq(4), Eq(6), Eq(7),
- Eq(3), Eq(9), Eq(12), Eq(11), Ne(122)));
-}
-
-
-// Tests that AnyOf(m1, ..., mn) describes itself properly.
-TEST(AnyOfTest, CanDescribeSelf) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
-
- EXPECT_EQ("(is <= 1) or (is >= 3)",
- Describe(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_EQ("(is < 0) or (is equal to 1) or (is equal to 2)", Describe(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_EQ("(is < 0) or (is equal to 1) or (is equal to 2) or (is equal to 3)",
- Describe(m));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_EQ(
- "(is <= 0) or (is > 10) or (is equal to 3) or (is equal to 5) or (is "
- "equal to 7)",
- Describe(m));
-}
-
-// Tests that AnyOf(m1, ..., mn) describes its negation properly.
-TEST(AnyOfTest, CanDescribeNegation) {
- Matcher<int> m;
- m = AnyOf(Le(1), Ge(3));
- EXPECT_EQ("(isn't <= 1) and (isn't >= 3)",
- DescribeNegation(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2));
- EXPECT_EQ("(isn't < 0) and (isn't equal to 1) and (isn't equal to 2)",
- DescribeNegation(m));
-
- m = AnyOf(Lt(0), Eq(1), Eq(2), Eq(3));
- EXPECT_EQ(
- "(isn't < 0) and (isn't equal to 1) and (isn't equal to 2) and (isn't "
- "equal to 3)",
- DescribeNegation(m));
-
- m = AnyOf(Le(0), Gt(10), 3, 5, 7);
- EXPECT_EQ(
- "(isn't <= 0) and (isn't > 10) and (isn't equal to 3) and (isn't equal "
- "to 5) and (isn't equal to 7)",
- DescribeNegation(m));
-}
-
-// Tests that monomorphic matchers are safely cast by the AnyOf matcher.
-TEST(AnyOfTest, AnyOfMatcherSafelyCastsMonomorphicMatchers) {
- // greater_than_5 and less_than_10 are monomorphic matchers.
- Matcher<int> greater_than_5 = Gt(5);
- Matcher<int> less_than_10 = Lt(10);
-
- Matcher<const int&> m = AnyOf(greater_than_5, less_than_10);
- Matcher<int&> m2 = AnyOf(greater_than_5, less_than_10);
- Matcher<int&> m3 = AnyOf(greater_than_5, m2);
-
- // Tests that EitherOf works when composing itself.
- Matcher<const int&> m4 = AnyOf(greater_than_5, less_than_10, less_than_10);
- Matcher<int&> m5 = AnyOf(greater_than_5, less_than_10, less_than_10);
-}
-
-TEST(AnyOfTest, ExplainsResult) {
- Matcher<int> m;
-
- // Failed match. Both matchers need to explain. The second
- // matcher doesn't give an explanation, so only the first matcher's
- // explanation is printed.
- m = AnyOf(GreaterThan(10), Lt(0));
- EXPECT_EQ("which is 5 less than 10", Explain(m, 5));
-
- // Failed match. Both matchers need to explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 less than 10, and which is 15 less than 20",
- Explain(m, 5));
-
- // Failed match. All matchers need to explain. The second
- // matcher doesn't given an explanation.
- m = AnyOf(GreaterThan(10), Gt(20), GreaterThan(30));
- EXPECT_EQ("which is 5 less than 10, and which is 25 less than 30",
- Explain(m, 5));
-
- // Failed match. All matchers need to explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20), GreaterThan(30));
- EXPECT_EQ("which is 5 less than 10, and which is 15 less than 20, "
- "and which is 25 less than 30",
- Explain(m, 5));
-
- // Successful match. The first matcher, which succeeded, needs to
- // explain.
- m = AnyOf(GreaterThan(10), GreaterThan(20));
- EXPECT_EQ("which is 5 more than 10", Explain(m, 15));
-
- // Successful match. The second matcher, which succeeded, needs to
- // explain. Since it doesn't given an explanation, nothing is
- // printed.
- m = AnyOf(GreaterThan(10), Lt(30));
- EXPECT_EQ("", Explain(m, 0));
-
- // Successful match. The second matcher, which succeeded, needs to
- // explain.
- m = AnyOf(GreaterThan(30), GreaterThan(20));
- EXPECT_EQ("which is 5 more than 20", Explain(m, 25));
-}
-
-// The following predicate function and predicate functor are for
-// testing the Truly(predicate) matcher.
-
-// Returns non-zero if the input is positive. Note that the return
-// type of this function is not bool. It's OK as Truly() accepts any
-// unary function or functor whose return type can be implicitly
-// converted to bool.
-int IsPositive(double x) {
- return x > 0 ? 1 : 0;
-}
-
-// This functor returns true if the input is greater than the given
-// number.
-class IsGreaterThan {
- public:
- explicit IsGreaterThan(int threshold) : threshold_(threshold) {}
-
- bool operator()(int n) const { return n > threshold_; }
-
- private:
- int threshold_;
-};
-
-// For testing Truly().
-const int foo = 0;
-
-// This predicate returns true if and only if the argument references foo and
-// has a zero value.
-bool ReferencesFooAndIsZero(const int& n) {
- return (&n == &foo) && (n == 0);
-}
-
-// Tests that Truly(predicate) matches what satisfies the given
-// predicate.
-TEST(TrulyTest, MatchesWhatSatisfiesThePredicate) {
- Matcher<double> m = Truly(IsPositive);
- EXPECT_TRUE(m.Matches(2.0));
- EXPECT_FALSE(m.Matches(-1.5));
-}
-
-// Tests that Truly(predicate_functor) works too.
-TEST(TrulyTest, CanBeUsedWithFunctor) {
- Matcher<int> m = Truly(IsGreaterThan(5));
- EXPECT_TRUE(m.Matches(6));
- EXPECT_FALSE(m.Matches(4));
-}
-
-// A class that can be implicitly converted to bool.
-class ConvertibleToBool {
- public:
- explicit ConvertibleToBool(int number) : number_(number) {}
- operator bool() const { return number_ != 0; }
-
- private:
- int number_;
-};
-
-ConvertibleToBool IsNotZero(int number) {
- return ConvertibleToBool(number);
-}
-
-// Tests that the predicate used in Truly() may return a class that's
-// implicitly convertible to bool, even when the class has no
-// operator!().
-TEST(TrulyTest, PredicateCanReturnAClassConvertibleToBool) {
- Matcher<int> m = Truly(IsNotZero);
- EXPECT_TRUE(m.Matches(1));
- EXPECT_FALSE(m.Matches(0));
-}
-
-// Tests that Truly(predicate) can describe itself properly.
-TEST(TrulyTest, CanDescribeSelf) {
- Matcher<double> m = Truly(IsPositive);
- EXPECT_EQ("satisfies the given predicate",
- Describe(m));
-}
-
-// Tests that Truly(predicate) works when the matcher takes its
-// argument by reference.
-TEST(TrulyTest, WorksForByRefArguments) {
- Matcher<const int&> m = Truly(ReferencesFooAndIsZero);
- EXPECT_TRUE(m.Matches(foo));
- int n = 0;
- EXPECT_FALSE(m.Matches(n));
-}
-
-// Tests that Truly(predicate) provides a helpful reason when it fails.
-TEST(TrulyTest, ExplainsFailures) {
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(Truly(IsPositive), -1, &listener));
- EXPECT_EQ(listener.str(), "didn't satisfy the given predicate");
-}
-
-// Tests that Matches(m) is a predicate satisfied by whatever that
-// matches matcher m.
-TEST(MatchesTest, IsSatisfiedByWhatMatchesTheMatcher) {
- EXPECT_TRUE(Matches(Ge(0))(1));
- EXPECT_FALSE(Matches(Eq('a'))('b'));
-}
-
-// Tests that Matches(m) works when the matcher takes its argument by
-// reference.
-TEST(MatchesTest, WorksOnByRefArguments) {
- int m = 0, n = 0;
- EXPECT_TRUE(Matches(AllOf(Ref(n), Eq(0)))(n));
- EXPECT_FALSE(Matches(Ref(m))(n));
-}
-
-// Tests that a Matcher on non-reference type can be used in
-// Matches().
-TEST(MatchesTest, WorksWithMatcherOnNonRefType) {
- Matcher<int> eq5 = Eq(5);
- EXPECT_TRUE(Matches(eq5)(5));
- EXPECT_FALSE(Matches(eq5)(2));
-}
-
-// Tests Value(value, matcher). Since Value() is a simple wrapper for
-// Matches(), which has been tested already, we don't spend a lot of
-// effort on testing Value().
-TEST(ValueTest, WorksWithPolymorphicMatcher) {
- EXPECT_TRUE(Value("hi", StartsWith("h")));
- EXPECT_FALSE(Value(5, Gt(10)));
-}
-
-TEST(ValueTest, WorksWithMonomorphicMatcher) {
- const Matcher<int> is_zero = Eq(0);
- EXPECT_TRUE(Value(0, is_zero));
- EXPECT_FALSE(Value('a', is_zero));
-
- int n = 0;
- const Matcher<const int&> ref_n = Ref(n);
- EXPECT_TRUE(Value(n, ref_n));
- EXPECT_FALSE(Value(1, ref_n));
-}
-
-TEST(ExplainMatchResultTest, WorksWithPolymorphicMatcher) {
- StringMatchResultListener listener1;
- EXPECT_TRUE(ExplainMatchResult(PolymorphicIsEven(), 42, &listener1));
- EXPECT_EQ("% 2 == 0", listener1.str());
-
- StringMatchResultListener listener2;
- EXPECT_FALSE(ExplainMatchResult(Ge(42), 1.5, &listener2));
- EXPECT_EQ("", listener2.str());
-}
-
-TEST(ExplainMatchResultTest, WorksWithMonomorphicMatcher) {
- const Matcher<int> is_even = PolymorphicIsEven();
- StringMatchResultListener listener1;
- EXPECT_TRUE(ExplainMatchResult(is_even, 42, &listener1));
- EXPECT_EQ("% 2 == 0", listener1.str());
-
- const Matcher<const double&> is_zero = Eq(0);
- StringMatchResultListener listener2;
- EXPECT_FALSE(ExplainMatchResult(is_zero, 1.5, &listener2));
- EXPECT_EQ("", listener2.str());
-}
-
-MATCHER(ConstructNoArg, "") { return true; }
-MATCHER_P(Construct1Arg, arg1, "") { return true; }
-MATCHER_P2(Construct2Args, arg1, arg2, "") { return true; }
-
-TEST(MatcherConstruct, ExplicitVsImplicit) {
- {
- // No arg constructor can be constructed with empty brace.
- ConstructNoArgMatcher m = {};
- (void)m;
- // And with no args
- ConstructNoArgMatcher m2;
- (void)m2;
- }
- {
- // The one arg constructor has an explicit constructor.
- // This is to prevent the implicit conversion.
- using M = Construct1ArgMatcherP<int>;
- EXPECT_TRUE((std::is_constructible<M, int>::value));
- EXPECT_FALSE((std::is_convertible<int, M>::value));
- }
- {
- // Multiple arg matchers can be constructed with an implicit construction.
- Construct2ArgsMatcherP2<int, double> m = {1, 2.2};
- (void)m;
- }
-}
-
-MATCHER_P(Really, inner_matcher, "") {
- return ExplainMatchResult(inner_matcher, arg, result_listener);
-}
-
-TEST(ExplainMatchResultTest, WorksInsideMATCHER) {
- EXPECT_THAT(0, Really(Eq(0)));
-}
-
-TEST(DescribeMatcherTest, WorksWithValue) {
- EXPECT_EQ("is equal to 42", DescribeMatcher<int>(42));
- EXPECT_EQ("isn't equal to 42", DescribeMatcher<int>(42, true));
-}
-
-TEST(DescribeMatcherTest, WorksWithMonomorphicMatcher) {
- const Matcher<int> monomorphic = Le(0);
- EXPECT_EQ("is <= 0", DescribeMatcher<int>(monomorphic));
- EXPECT_EQ("isn't <= 0", DescribeMatcher<int>(monomorphic, true));
-}
-
-TEST(DescribeMatcherTest, WorksWithPolymorphicMatcher) {
- EXPECT_EQ("is even", DescribeMatcher<int>(PolymorphicIsEven()));
- EXPECT_EQ("is odd", DescribeMatcher<int>(PolymorphicIsEven(), true));
-}
-
-TEST(AllArgsTest, WorksForTuple) {
- EXPECT_THAT(std::make_tuple(1, 2L), AllArgs(Lt()));
- EXPECT_THAT(std::make_tuple(2L, 1), Not(AllArgs(Lt())));
-}
-
-TEST(AllArgsTest, WorksForNonTuple) {
- EXPECT_THAT(42, AllArgs(Gt(0)));
- EXPECT_THAT('a', Not(AllArgs(Eq('b'))));
-}
-
-class AllArgsHelper {
- public:
- AllArgsHelper() {}
-
- MOCK_METHOD2(Helper, int(char x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AllArgsHelper);
-};
-
-TEST(AllArgsTest, WorksInWithClause) {
- AllArgsHelper helper;
- ON_CALL(helper, Helper(_, _))
- .With(AllArgs(Lt()))
- .WillByDefault(Return(1));
- EXPECT_CALL(helper, Helper(_, _));
- EXPECT_CALL(helper, Helper(_, _))
- .With(AllArgs(Gt()))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, helper.Helper('\1', 2));
- EXPECT_EQ(2, helper.Helper('a', 1));
-}
-
-class OptionalMatchersHelper {
- public:
- OptionalMatchersHelper() {}
-
- MOCK_METHOD0(NoArgs, int());
-
- MOCK_METHOD1(OneArg, int(int y));
-
- MOCK_METHOD2(TwoArgs, int(char x, int y));
-
- MOCK_METHOD1(Overloaded, int(char x));
- MOCK_METHOD2(Overloaded, int(char x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OptionalMatchersHelper);
-};
-
-TEST(AllArgsTest, WorksWithoutMatchers) {
- OptionalMatchersHelper helper;
-
- ON_CALL(helper, NoArgs).WillByDefault(Return(10));
- ON_CALL(helper, OneArg).WillByDefault(Return(20));
- ON_CALL(helper, TwoArgs).WillByDefault(Return(30));
-
- EXPECT_EQ(10, helper.NoArgs());
- EXPECT_EQ(20, helper.OneArg(1));
- EXPECT_EQ(30, helper.TwoArgs('\1', 2));
-
- EXPECT_CALL(helper, NoArgs).Times(1);
- EXPECT_CALL(helper, OneArg).WillOnce(Return(100));
- EXPECT_CALL(helper, OneArg(17)).WillOnce(Return(200));
- EXPECT_CALL(helper, TwoArgs).Times(0);
-
- EXPECT_EQ(10, helper.NoArgs());
- EXPECT_EQ(100, helper.OneArg(1));
- EXPECT_EQ(200, helper.OneArg(17));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the value
-// matches the matcher.
-TEST(MatcherAssertionTest, WorksWhenMatcherIsSatisfied) {
- ASSERT_THAT(5, Ge(2)) << "This should succeed.";
- ASSERT_THAT("Foo", EndsWith("oo"));
- EXPECT_THAT(2, AllOf(Le(7), Ge(0))) << "This should succeed too.";
- EXPECT_THAT("Hello", StartsWith("Hell"));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the value
-// doesn't match the matcher.
-TEST(MatcherAssertionTest, WorksWhenMatcherIsNotSatisfied) {
- // 'n' must be static as it is used in an EXPECT_FATAL_FAILURE(),
- // which cannot reference auto variables.
- static unsigned short n; // NOLINT
- n = 5;
-
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, Gt(10)),
- "Value of: n\n"
- "Expected: is > 10\n"
- " Actual: 5" + OfType("unsigned short"));
- n = 0;
- EXPECT_NONFATAL_FAILURE(
- EXPECT_THAT(n, AllOf(Le(7), Ge(5))),
- "Value of: n\n"
- "Expected: (is <= 7) and (is >= 5)\n"
- " Actual: 0" + OfType("unsigned short"));
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the argument
-// has a reference type.
-TEST(MatcherAssertionTest, WorksForByRefArguments) {
- // We use a static variable here as EXPECT_FATAL_FAILURE() cannot
- // reference auto variables.
- static int n;
- n = 0;
- EXPECT_THAT(n, AllOf(Le(7), Ref(n)));
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, Not(Ref(n))),
- "Value of: n\n"
- "Expected: does not reference the variable @");
- // Tests the "Actual" part.
- EXPECT_FATAL_FAILURE(ASSERT_THAT(n, Not(Ref(n))),
- "Actual: 0" + OfType("int") + ", which is located @");
-}
-
-// Tests that ASSERT_THAT() and EXPECT_THAT() work when the matcher is
-// monomorphic.
-TEST(MatcherAssertionTest, WorksForMonomorphicMatcher) {
- Matcher<const char*> starts_with_he = StartsWith("he");
- ASSERT_THAT("hello", starts_with_he);
-
- Matcher<const std::string&> ends_with_ok = EndsWith("ok");
- ASSERT_THAT("book", ends_with_ok);
- const std::string bad = "bad";
- EXPECT_NONFATAL_FAILURE(EXPECT_THAT(bad, ends_with_ok),
- "Value of: bad\n"
- "Expected: ends with \"ok\"\n"
- " Actual: \"bad\"");
- Matcher<int> is_greater_than_5 = Gt(5);
- EXPECT_NONFATAL_FAILURE(EXPECT_THAT(5, is_greater_than_5),
- "Value of: 5\n"
- "Expected: is > 5\n"
- " Actual: 5" + OfType("int"));
-}
-
-// Tests floating-point matchers.
-template <typename RawType>
-class FloatingPointTest : public testing::Test {
- protected:
- typedef testing::internal::FloatingPoint<RawType> Floating;
- typedef typename Floating::Bits Bits;
-
- FloatingPointTest()
- : max_ulps_(Floating::kMaxUlps),
- zero_bits_(Floating(0).bits()),
- one_bits_(Floating(1).bits()),
- infinity_bits_(Floating(Floating::Infinity()).bits()),
- close_to_positive_zero_(
- Floating::ReinterpretBits(zero_bits_ + max_ulps_/2)),
- close_to_negative_zero_(
- -Floating::ReinterpretBits(zero_bits_ + max_ulps_ - max_ulps_/2)),
- further_from_negative_zero_(-Floating::ReinterpretBits(
- zero_bits_ + max_ulps_ + 1 - max_ulps_/2)),
- close_to_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_)),
- further_from_one_(Floating::ReinterpretBits(one_bits_ + max_ulps_ + 1)),
- infinity_(Floating::Infinity()),
- close_to_infinity_(
- Floating::ReinterpretBits(infinity_bits_ - max_ulps_)),
- further_from_infinity_(
- Floating::ReinterpretBits(infinity_bits_ - max_ulps_ - 1)),
- max_(Floating::Max()),
- nan1_(Floating::ReinterpretBits(Floating::kExponentBitMask | 1)),
- nan2_(Floating::ReinterpretBits(Floating::kExponentBitMask | 200)) {
- }
-
- void TestSize() {
- EXPECT_EQ(sizeof(RawType), sizeof(Bits));
- }
-
- // A battery of tests for FloatingEqMatcher::Matches.
- // matcher_maker is a pointer to a function which creates a FloatingEqMatcher.
- void TestMatches(
- testing::internal::FloatingEqMatcher<RawType> (*matcher_maker)(RawType)) {
- Matcher<RawType> m1 = matcher_maker(0.0);
- EXPECT_TRUE(m1.Matches(-0.0));
- EXPECT_TRUE(m1.Matches(close_to_positive_zero_));
- EXPECT_TRUE(m1.Matches(close_to_negative_zero_));
- EXPECT_FALSE(m1.Matches(1.0));
-
- Matcher<RawType> m2 = matcher_maker(close_to_positive_zero_);
- EXPECT_FALSE(m2.Matches(further_from_negative_zero_));
-
- Matcher<RawType> m3 = matcher_maker(1.0);
- EXPECT_TRUE(m3.Matches(close_to_one_));
- EXPECT_FALSE(m3.Matches(further_from_one_));
-
- // Test commutativity: matcher_maker(0.0).Matches(1.0) was tested above.
- EXPECT_FALSE(m3.Matches(0.0));
-
- Matcher<RawType> m4 = matcher_maker(-infinity_);
- EXPECT_TRUE(m4.Matches(-close_to_infinity_));
-
- Matcher<RawType> m5 = matcher_maker(infinity_);
- EXPECT_TRUE(m5.Matches(close_to_infinity_));
-
- // This is interesting as the representations of infinity_ and nan1_
- // are only 1 DLP apart.
- EXPECT_FALSE(m5.Matches(nan1_));
-
- // matcher_maker can produce a Matcher<const RawType&>, which is needed in
- // some cases.
- Matcher<const RawType&> m6 = matcher_maker(0.0);
- EXPECT_TRUE(m6.Matches(-0.0));
- EXPECT_TRUE(m6.Matches(close_to_positive_zero_));
- EXPECT_FALSE(m6.Matches(1.0));
-
- // matcher_maker can produce a Matcher<RawType&>, which is needed in some
- // cases.
- Matcher<RawType&> m7 = matcher_maker(0.0);
- RawType x = 0.0;
- EXPECT_TRUE(m7.Matches(x));
- x = 0.01f;
- EXPECT_FALSE(m7.Matches(x));
- }
-
- // Pre-calculated numbers to be used by the tests.
-
- const Bits max_ulps_;
-
- const Bits zero_bits_; // The bits that represent 0.0.
- const Bits one_bits_; // The bits that represent 1.0.
- const Bits infinity_bits_; // The bits that represent +infinity.
-
- // Some numbers close to 0.0.
- const RawType close_to_positive_zero_;
- const RawType close_to_negative_zero_;
- const RawType further_from_negative_zero_;
-
- // Some numbers close to 1.0.
- const RawType close_to_one_;
- const RawType further_from_one_;
-
- // Some numbers close to +infinity.
- const RawType infinity_;
- const RawType close_to_infinity_;
- const RawType further_from_infinity_;
-
- // Maximum representable value that's not infinity.
- const RawType max_;
-
- // Some NaNs.
- const RawType nan1_;
- const RawType nan2_;
-};
-
-// Tests floating-point matchers with fixed epsilons.
-template <typename RawType>
-class FloatingPointNearTest : public FloatingPointTest<RawType> {
- protected:
- typedef FloatingPointTest<RawType> ParentType;
-
- // A battery of tests for FloatingEqMatcher::Matches with a fixed epsilon.
- // matcher_maker is a pointer to a function which creates a FloatingEqMatcher.
- void TestNearMatches(
- testing::internal::FloatingEqMatcher<RawType>
- (*matcher_maker)(RawType, RawType)) {
- Matcher<RawType> m1 = matcher_maker(0.0, 0.0);
- EXPECT_TRUE(m1.Matches(0.0));
- EXPECT_TRUE(m1.Matches(-0.0));
- EXPECT_FALSE(m1.Matches(ParentType::close_to_positive_zero_));
- EXPECT_FALSE(m1.Matches(ParentType::close_to_negative_zero_));
- EXPECT_FALSE(m1.Matches(1.0));
-
- Matcher<RawType> m2 = matcher_maker(0.0, 1.0);
- EXPECT_TRUE(m2.Matches(0.0));
- EXPECT_TRUE(m2.Matches(-0.0));
- EXPECT_TRUE(m2.Matches(1.0));
- EXPECT_TRUE(m2.Matches(-1.0));
- EXPECT_FALSE(m2.Matches(ParentType::close_to_one_));
- EXPECT_FALSE(m2.Matches(-ParentType::close_to_one_));
-
- // Check that inf matches inf, regardless of the of the specified max
- // absolute error.
- Matcher<RawType> m3 = matcher_maker(ParentType::infinity_, 0.0);
- EXPECT_TRUE(m3.Matches(ParentType::infinity_));
- EXPECT_FALSE(m3.Matches(ParentType::close_to_infinity_));
- EXPECT_FALSE(m3.Matches(-ParentType::infinity_));
-
- Matcher<RawType> m4 = matcher_maker(-ParentType::infinity_, 0.0);
- EXPECT_TRUE(m4.Matches(-ParentType::infinity_));
- EXPECT_FALSE(m4.Matches(-ParentType::close_to_infinity_));
- EXPECT_FALSE(m4.Matches(ParentType::infinity_));
-
- // Test various overflow scenarios.
- Matcher<RawType> m5 = matcher_maker(ParentType::max_, ParentType::max_);
- EXPECT_TRUE(m5.Matches(ParentType::max_));
- EXPECT_FALSE(m5.Matches(-ParentType::max_));
-
- Matcher<RawType> m6 = matcher_maker(-ParentType::max_, ParentType::max_);
- EXPECT_FALSE(m6.Matches(ParentType::max_));
- EXPECT_TRUE(m6.Matches(-ParentType::max_));
-
- Matcher<RawType> m7 = matcher_maker(ParentType::max_, 0);
- EXPECT_TRUE(m7.Matches(ParentType::max_));
- EXPECT_FALSE(m7.Matches(-ParentType::max_));
-
- Matcher<RawType> m8 = matcher_maker(-ParentType::max_, 0);
- EXPECT_FALSE(m8.Matches(ParentType::max_));
- EXPECT_TRUE(m8.Matches(-ParentType::max_));
-
- // The difference between max() and -max() normally overflows to infinity,
- // but it should still match if the max_abs_error is also infinity.
- Matcher<RawType> m9 = matcher_maker(
- ParentType::max_, ParentType::infinity_);
- EXPECT_TRUE(m8.Matches(-ParentType::max_));
-
- // matcher_maker can produce a Matcher<const RawType&>, which is needed in
- // some cases.
- Matcher<const RawType&> m10 = matcher_maker(0.0, 1.0);
- EXPECT_TRUE(m10.Matches(-0.0));
- EXPECT_TRUE(m10.Matches(ParentType::close_to_positive_zero_));
- EXPECT_FALSE(m10.Matches(ParentType::close_to_one_));
-
- // matcher_maker can produce a Matcher<RawType&>, which is needed in some
- // cases.
- Matcher<RawType&> m11 = matcher_maker(0.0, 1.0);
- RawType x = 0.0;
- EXPECT_TRUE(m11.Matches(x));
- x = 1.0f;
- EXPECT_TRUE(m11.Matches(x));
- x = -1.0f;
- EXPECT_TRUE(m11.Matches(x));
- x = 1.1f;
- EXPECT_FALSE(m11.Matches(x));
- x = -1.1f;
- EXPECT_FALSE(m11.Matches(x));
- }
-};
-
-// Instantiate FloatingPointTest for testing floats.
-typedef FloatingPointTest<float> FloatTest;
-
-TEST_F(FloatTest, FloatEqApproximatelyMatchesFloats) {
- TestMatches(&FloatEq);
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqApproximatelyMatchesFloats) {
- TestMatches(&NanSensitiveFloatEq);
-}
-
-TEST_F(FloatTest, FloatEqCannotMatchNaN) {
- // FloatEq never matches NaN.
- Matcher<float> m = FloatEq(nan1_);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqCanMatchNaN) {
- // NanSensitiveFloatEq will match NaN.
- Matcher<float> m = NanSensitiveFloatEq(nan1_);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(FloatTest, FloatEqCanDescribeSelf) {
- Matcher<float> m1 = FloatEq(2.0f);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<float> m2 = FloatEq(0.5f);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<float> m3 = FloatEq(nan1_);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(FloatTest, NanSensitiveFloatEqCanDescribeSelf) {
- Matcher<float> m1 = NanSensitiveFloatEq(2.0f);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<float> m2 = NanSensitiveFloatEq(0.5f);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<float> m3 = NanSensitiveFloatEq(nan1_);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-// Instantiate FloatingPointTest for testing floats with a user-specified
-// max absolute error.
-typedef FloatingPointNearTest<float> FloatNearTest;
-
-TEST_F(FloatNearTest, FloatNearMatches) {
- TestNearMatches(&FloatNear);
-}
-
-TEST_F(FloatNearTest, NanSensitiveFloatNearApproximatelyMatchesFloats) {
- TestNearMatches(&NanSensitiveFloatNear);
-}
-
-TEST_F(FloatNearTest, FloatNearCanDescribeSelf) {
- Matcher<float> m1 = FloatNear(2.0f, 0.5f);
- EXPECT_EQ("is approximately 2 (absolute error <= 0.5)", Describe(m1));
- EXPECT_EQ(
- "isn't approximately 2 (absolute error > 0.5)", DescribeNegation(m1));
-
- Matcher<float> m2 = FloatNear(0.5f, 0.5f);
- EXPECT_EQ("is approximately 0.5 (absolute error <= 0.5)", Describe(m2));
- EXPECT_EQ(
- "isn't approximately 0.5 (absolute error > 0.5)", DescribeNegation(m2));
-
- Matcher<float> m3 = FloatNear(nan1_, 0.0);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(FloatNearTest, NanSensitiveFloatNearCanDescribeSelf) {
- Matcher<float> m1 = NanSensitiveFloatNear(2.0f, 0.5f);
- EXPECT_EQ("is approximately 2 (absolute error <= 0.5)", Describe(m1));
- EXPECT_EQ(
- "isn't approximately 2 (absolute error > 0.5)", DescribeNegation(m1));
-
- Matcher<float> m2 = NanSensitiveFloatNear(0.5f, 0.5f);
- EXPECT_EQ("is approximately 0.5 (absolute error <= 0.5)", Describe(m2));
- EXPECT_EQ(
- "isn't approximately 0.5 (absolute error > 0.5)", DescribeNegation(m2));
-
- Matcher<float> m3 = NanSensitiveFloatNear(nan1_, 0.1f);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-TEST_F(FloatNearTest, FloatNearCannotMatchNaN) {
- // FloatNear never matches NaN.
- Matcher<float> m = FloatNear(ParentType::nan1_, 0.1f);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(FloatNearTest, NanSensitiveFloatNearCanMatchNaN) {
- // NanSensitiveFloatNear will match NaN.
- Matcher<float> m = NanSensitiveFloatNear(nan1_, 0.1f);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-// Instantiate FloatingPointTest for testing doubles.
-typedef FloatingPointTest<double> DoubleTest;
-
-TEST_F(DoubleTest, DoubleEqApproximatelyMatchesDoubles) {
- TestMatches(&DoubleEq);
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqApproximatelyMatchesDoubles) {
- TestMatches(&NanSensitiveDoubleEq);
-}
-
-TEST_F(DoubleTest, DoubleEqCannotMatchNaN) {
- // DoubleEq never matches NaN.
- Matcher<double> m = DoubleEq(nan1_);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqCanMatchNaN) {
- // NanSensitiveDoubleEq will match NaN.
- Matcher<double> m = NanSensitiveDoubleEq(nan1_);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(DoubleTest, DoubleEqCanDescribeSelf) {
- Matcher<double> m1 = DoubleEq(2.0);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<double> m2 = DoubleEq(0.5);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<double> m3 = DoubleEq(nan1_);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(DoubleTest, NanSensitiveDoubleEqCanDescribeSelf) {
- Matcher<double> m1 = NanSensitiveDoubleEq(2.0);
- EXPECT_EQ("is approximately 2", Describe(m1));
- EXPECT_EQ("isn't approximately 2", DescribeNegation(m1));
-
- Matcher<double> m2 = NanSensitiveDoubleEq(0.5);
- EXPECT_EQ("is approximately 0.5", Describe(m2));
- EXPECT_EQ("isn't approximately 0.5", DescribeNegation(m2));
-
- Matcher<double> m3 = NanSensitiveDoubleEq(nan1_);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-// Instantiate FloatingPointTest for testing floats with a user-specified
-// max absolute error.
-typedef FloatingPointNearTest<double> DoubleNearTest;
-
-TEST_F(DoubleNearTest, DoubleNearMatches) {
- TestNearMatches(&DoubleNear);
-}
-
-TEST_F(DoubleNearTest, NanSensitiveDoubleNearApproximatelyMatchesDoubles) {
- TestNearMatches(&NanSensitiveDoubleNear);
-}
-
-TEST_F(DoubleNearTest, DoubleNearCanDescribeSelf) {
- Matcher<double> m1 = DoubleNear(2.0, 0.5);
- EXPECT_EQ("is approximately 2 (absolute error <= 0.5)", Describe(m1));
- EXPECT_EQ(
- "isn't approximately 2 (absolute error > 0.5)", DescribeNegation(m1));
-
- Matcher<double> m2 = DoubleNear(0.5, 0.5);
- EXPECT_EQ("is approximately 0.5 (absolute error <= 0.5)", Describe(m2));
- EXPECT_EQ(
- "isn't approximately 0.5 (absolute error > 0.5)", DescribeNegation(m2));
-
- Matcher<double> m3 = DoubleNear(nan1_, 0.0);
- EXPECT_EQ("never matches", Describe(m3));
- EXPECT_EQ("is anything", DescribeNegation(m3));
-}
-
-TEST_F(DoubleNearTest, ExplainsResultWhenMatchFails) {
- EXPECT_EQ("", Explain(DoubleNear(2.0, 0.1), 2.05));
- EXPECT_EQ("which is 0.2 from 2", Explain(DoubleNear(2.0, 0.1), 2.2));
- EXPECT_EQ("which is -0.3 from 2", Explain(DoubleNear(2.0, 0.1), 1.7));
-
- const std::string explanation =
- Explain(DoubleNear(2.1, 1e-10), 2.1 + 1.2e-10);
- // Different C++ implementations may print floating-point numbers
- // slightly differently.
- EXPECT_TRUE(explanation == "which is 1.2e-10 from 2.1" || // GCC
- explanation == "which is 1.2e-010 from 2.1") // MSVC
- << " where explanation is \"" << explanation << "\".";
-}
-
-TEST_F(DoubleNearTest, NanSensitiveDoubleNearCanDescribeSelf) {
- Matcher<double> m1 = NanSensitiveDoubleNear(2.0, 0.5);
- EXPECT_EQ("is approximately 2 (absolute error <= 0.5)", Describe(m1));
- EXPECT_EQ(
- "isn't approximately 2 (absolute error > 0.5)", DescribeNegation(m1));
-
- Matcher<double> m2 = NanSensitiveDoubleNear(0.5, 0.5);
- EXPECT_EQ("is approximately 0.5 (absolute error <= 0.5)", Describe(m2));
- EXPECT_EQ(
- "isn't approximately 0.5 (absolute error > 0.5)", DescribeNegation(m2));
-
- Matcher<double> m3 = NanSensitiveDoubleNear(nan1_, 0.1);
- EXPECT_EQ("is NaN", Describe(m3));
- EXPECT_EQ("isn't NaN", DescribeNegation(m3));
-}
-
-TEST_F(DoubleNearTest, DoubleNearCannotMatchNaN) {
- // DoubleNear never matches NaN.
- Matcher<double> m = DoubleNear(ParentType::nan1_, 0.1);
- EXPECT_FALSE(m.Matches(nan1_));
- EXPECT_FALSE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST_F(DoubleNearTest, NanSensitiveDoubleNearCanMatchNaN) {
- // NanSensitiveDoubleNear will match NaN.
- Matcher<double> m = NanSensitiveDoubleNear(nan1_, 0.1);
- EXPECT_TRUE(m.Matches(nan1_));
- EXPECT_TRUE(m.Matches(nan2_));
- EXPECT_FALSE(m.Matches(1.0));
-}
-
-TEST(PointeeTest, RawPointer) {
- const Matcher<int*> m = Pointee(Ge(0));
-
- int n = 1;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointeeTest, RawPointerToConst) {
- const Matcher<const double*> m = Pointee(Ge(0));
-
- double x = 1;
- EXPECT_TRUE(m.Matches(&x));
- x = -1;
- EXPECT_FALSE(m.Matches(&x));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointeeTest, ReferenceToConstRawPointer) {
- const Matcher<int* const &> m = Pointee(Ge(0));
-
- int n = 1;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointeeTest, ReferenceToNonConstRawPointer) {
- const Matcher<double* &> m = Pointee(Ge(0));
-
- double x = 1.0;
- double* p = &x;
- EXPECT_TRUE(m.Matches(p));
- x = -1;
- EXPECT_FALSE(m.Matches(p));
- p = nullptr;
- EXPECT_FALSE(m.Matches(p));
-}
-
-TEST(PointeeTest, SmartPointer) {
- const Matcher<std::unique_ptr<int>> m = Pointee(Ge(0));
-
- std::unique_ptr<int> n(new int(1));
- EXPECT_TRUE(m.Matches(n));
-}
-
-TEST(PointeeTest, SmartPointerToConst) {
- const Matcher<std::unique_ptr<const int>> m = Pointee(Ge(0));
-
- // There's no implicit conversion from unique_ptr<int> to const
- // unique_ptr<const int>, so we must pass a unique_ptr<const int> into the
- // matcher.
- std::unique_ptr<const int> n(new int(1));
- EXPECT_TRUE(m.Matches(n));
-}
-
-TEST(PointerTest, RawPointer) {
- int n = 1;
- const Matcher<int*> m = Pointer(Eq(&n));
-
- EXPECT_TRUE(m.Matches(&n));
-
- int* p = nullptr;
- EXPECT_FALSE(m.Matches(p));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointerTest, RawPointerToConst) {
- int n = 1;
- const Matcher<const int*> m = Pointer(Eq(&n));
-
- EXPECT_TRUE(m.Matches(&n));
-
- int* p = nullptr;
- EXPECT_FALSE(m.Matches(p));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointerTest, SmartPointer) {
- std::unique_ptr<int> n(new int(10));
- int* raw_n = n.get();
- const Matcher<std::unique_ptr<int>> m = Pointer(Eq(raw_n));
-
- EXPECT_TRUE(m.Matches(n));
-}
-
-TEST(PointerTest, SmartPointerToConst) {
- std::unique_ptr<const int> n(new int(10));
- const int* raw_n = n.get();
- const Matcher<std::unique_ptr<const int>> m = Pointer(Eq(raw_n));
-
- // There's no implicit conversion from unique_ptr<int> to const
- // unique_ptr<const int>, so we must pass a unique_ptr<const int> into the
- // matcher.
- std::unique_ptr<const int> p(new int(10));
- EXPECT_FALSE(m.Matches(p));
-}
-
-TEST(AddressTest, NonConst) {
- int n = 1;
- const Matcher<int> m = Address(Eq(&n));
-
- EXPECT_TRUE(m.Matches(n));
-
- int other = 5;
-
- EXPECT_FALSE(m.Matches(other));
-
- int& n_ref = n;
-
- EXPECT_TRUE(m.Matches(n_ref));
-}
-
-TEST(AddressTest, Const) {
- const int n = 1;
- const Matcher<int> m = Address(Eq(&n));
-
- EXPECT_TRUE(m.Matches(n));
-
- int other = 5;
-
- EXPECT_FALSE(m.Matches(other));
-}
-
-TEST(AddressTest, MatcherDoesntCopy) {
- std::unique_ptr<int> n(new int(1));
- const Matcher<std::unique_ptr<int>> m = Address(Eq(&n));
-
- EXPECT_TRUE(m.Matches(n));
-}
-
-TEST(AddressTest, Describe) {
- Matcher<int> matcher = Address(_);
- EXPECT_EQ("has address that is anything", Describe(matcher));
- EXPECT_EQ("does not have address that is anything",
- DescribeNegation(matcher));
-}
-
-MATCHER_P(FieldIIs, inner_matcher, "") {
- return ExplainMatchResult(inner_matcher, arg.i, result_listener);
-}
-
-#if GTEST_HAS_RTTI
-TEST(WhenDynamicCastToTest, SameType) {
- Derived derived;
- derived.i = 4;
-
- // Right type. A pointer is passed down.
- Base* as_base_ptr = &derived;
- EXPECT_THAT(as_base_ptr, WhenDynamicCastTo<Derived*>(Not(IsNull())));
- EXPECT_THAT(as_base_ptr, WhenDynamicCastTo<Derived*>(Pointee(FieldIIs(4))));
- EXPECT_THAT(as_base_ptr,
- Not(WhenDynamicCastTo<Derived*>(Pointee(FieldIIs(5)))));
-}
-
-TEST(WhenDynamicCastToTest, WrongTypes) {
- Base base;
- Derived derived;
- OtherDerived other_derived;
-
- // Wrong types. NULL is passed.
- EXPECT_THAT(&base, Not(WhenDynamicCastTo<Derived*>(Pointee(_))));
- EXPECT_THAT(&base, WhenDynamicCastTo<Derived*>(IsNull()));
- Base* as_base_ptr = &derived;
- EXPECT_THAT(as_base_ptr, Not(WhenDynamicCastTo<OtherDerived*>(Pointee(_))));
- EXPECT_THAT(as_base_ptr, WhenDynamicCastTo<OtherDerived*>(IsNull()));
- as_base_ptr = &other_derived;
- EXPECT_THAT(as_base_ptr, Not(WhenDynamicCastTo<Derived*>(Pointee(_))));
- EXPECT_THAT(as_base_ptr, WhenDynamicCastTo<Derived*>(IsNull()));
-}
-
-TEST(WhenDynamicCastToTest, AlreadyNull) {
- // Already NULL.
- Base* as_base_ptr = nullptr;
- EXPECT_THAT(as_base_ptr, WhenDynamicCastTo<Derived*>(IsNull()));
-}
-
-struct AmbiguousCastTypes {
- class VirtualDerived : public virtual Base {};
- class DerivedSub1 : public VirtualDerived {};
- class DerivedSub2 : public VirtualDerived {};
- class ManyDerivedInHierarchy : public DerivedSub1, public DerivedSub2 {};
-};
-
-TEST(WhenDynamicCastToTest, AmbiguousCast) {
- AmbiguousCastTypes::DerivedSub1 sub1;
- AmbiguousCastTypes::ManyDerivedInHierarchy many_derived;
- // Multiply derived from Base. dynamic_cast<> returns NULL.
- Base* as_base_ptr =
- static_cast<AmbiguousCastTypes::DerivedSub1*>(&many_derived);
- EXPECT_THAT(as_base_ptr,
- WhenDynamicCastTo<AmbiguousCastTypes::VirtualDerived*>(IsNull()));
- as_base_ptr = &sub1;
- EXPECT_THAT(
- as_base_ptr,
- WhenDynamicCastTo<AmbiguousCastTypes::VirtualDerived*>(Not(IsNull())));
-}
-
-TEST(WhenDynamicCastToTest, Describe) {
- Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
- const std::string prefix =
- "when dynamic_cast to " + internal::GetTypeName<Derived*>() + ", ";
- EXPECT_EQ(prefix + "points to a value that is anything", Describe(matcher));
- EXPECT_EQ(prefix + "does not point to a value that is anything",
- DescribeNegation(matcher));
-}
-
-TEST(WhenDynamicCastToTest, Explain) {
- Matcher<Base*> matcher = WhenDynamicCastTo<Derived*>(Pointee(_));
- Base* null = nullptr;
- EXPECT_THAT(Explain(matcher, null), HasSubstr("NULL"));
- Derived derived;
- EXPECT_TRUE(matcher.Matches(&derived));
- EXPECT_THAT(Explain(matcher, &derived), HasSubstr("which points to "));
-
- // With references, the matcher itself can fail. Test for that one.
- Matcher<const Base&> ref_matcher = WhenDynamicCastTo<const OtherDerived&>(_);
- EXPECT_THAT(Explain(ref_matcher, derived),
- HasSubstr("which cannot be dynamic_cast"));
-}
-
-TEST(WhenDynamicCastToTest, GoodReference) {
- Derived derived;
- derived.i = 4;
- Base& as_base_ref = derived;
- EXPECT_THAT(as_base_ref, WhenDynamicCastTo<const Derived&>(FieldIIs(4)));
- EXPECT_THAT(as_base_ref, WhenDynamicCastTo<const Derived&>(Not(FieldIIs(5))));
-}
-
-TEST(WhenDynamicCastToTest, BadReference) {
- Derived derived;
- Base& as_base_ref = derived;
- EXPECT_THAT(as_base_ref, Not(WhenDynamicCastTo<const OtherDerived&>(_)));
-}
-#endif // GTEST_HAS_RTTI
-
-// Minimal const-propagating pointer.
-template <typename T>
-class ConstPropagatingPtr {
- public:
- typedef T element_type;
-
- ConstPropagatingPtr() : val_() {}
- explicit ConstPropagatingPtr(T* t) : val_(t) {}
- ConstPropagatingPtr(const ConstPropagatingPtr& other) : val_(other.val_) {}
-
- T* get() { return val_; }
- T& operator*() { return *val_; }
- // Most smart pointers return non-const T* and T& from the next methods.
- const T* get() const { return val_; }
- const T& operator*() const { return *val_; }
-
- private:
- T* val_;
-};
-
-TEST(PointeeTest, WorksWithConstPropagatingPointers) {
- const Matcher< ConstPropagatingPtr<int> > m = Pointee(Lt(5));
- int three = 3;
- const ConstPropagatingPtr<int> co(&three);
- ConstPropagatingPtr<int> o(&three);
- EXPECT_TRUE(m.Matches(o));
- EXPECT_TRUE(m.Matches(co));
- *o = 6;
- EXPECT_FALSE(m.Matches(o));
- EXPECT_FALSE(m.Matches(ConstPropagatingPtr<int>()));
-}
-
-TEST(PointeeTest, NeverMatchesNull) {
- const Matcher<const char*> m = Pointee(_);
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-// Tests that we can write Pointee(value) instead of Pointee(Eq(value)).
-TEST(PointeeTest, MatchesAgainstAValue) {
- const Matcher<int*> m = Pointee(5);
-
- int n = 5;
- EXPECT_TRUE(m.Matches(&n));
- n = -1;
- EXPECT_FALSE(m.Matches(&n));
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-TEST(PointeeTest, CanDescribeSelf) {
- const Matcher<int*> m = Pointee(Gt(3));
- EXPECT_EQ("points to a value that is > 3", Describe(m));
- EXPECT_EQ("does not point to a value that is > 3",
- DescribeNegation(m));
-}
-
-TEST(PointeeTest, CanExplainMatchResult) {
- const Matcher<const std::string*> m = Pointee(StartsWith("Hi"));
-
- EXPECT_EQ("", Explain(m, static_cast<const std::string*>(nullptr)));
-
- const Matcher<long*> m2 = Pointee(GreaterThan(1)); // NOLINT
- long n = 3; // NOLINT
- EXPECT_EQ("which points to 3" + OfType("long") + ", which is 2 more than 1",
- Explain(m2, &n));
-}
-
-TEST(PointeeTest, AlwaysExplainsPointee) {
- const Matcher<int*> m = Pointee(0);
- int n = 42;
- EXPECT_EQ("which points to 42" + OfType("int"), Explain(m, &n));
-}
-
-// An uncopyable class.
-class Uncopyable {
- public:
- Uncopyable() : value_(-1) {}
- explicit Uncopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- void set_value(int i) { value_ = i; }
-
- private:
- int value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Uncopyable);
-};
-
-// Returns true if and only if x.value() is positive.
-bool ValueIsPositive(const Uncopyable& x) { return x.value() > 0; }
-
-MATCHER_P(UncopyableIs, inner_matcher, "") {
- return ExplainMatchResult(inner_matcher, arg.value(), result_listener);
-}
-
-// A user-defined struct for testing Field().
-struct AStruct {
- AStruct() : x(0), y(1.0), z(5), p(nullptr) {}
- AStruct(const AStruct& rhs)
- : x(rhs.x), y(rhs.y), z(rhs.z.value()), p(rhs.p) {}
-
- int x; // A non-const field.
- const double y; // A const field.
- Uncopyable z; // An uncopyable field.
- const char* p; // A pointer field.
-};
-
-// A derived struct for testing Field().
-struct DerivedStruct : public AStruct {
- char ch;
-};
-
-// Tests that Field(&Foo::field, ...) works when field is non-const.
-TEST(FieldTest, WorksForNonConstField) {
- Matcher<AStruct> m = Field(&AStruct::x, Ge(0));
- Matcher<AStruct> m_with_name = Field("x", &AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is const.
-TEST(FieldTest, WorksForConstField) {
- AStruct a;
-
- Matcher<AStruct> m = Field(&AStruct::y, Ge(0.0));
- Matcher<AStruct> m_with_name = Field("y", &AStruct::y, Ge(0.0));
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
- m = Field(&AStruct::y, Le(0.0));
- m_with_name = Field("y", &AStruct::y, Le(0.0));
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is not copyable.
-TEST(FieldTest, WorksForUncopyableField) {
- AStruct a;
-
- Matcher<AStruct> m = Field(&AStruct::z, Truly(ValueIsPositive));
- EXPECT_TRUE(m.Matches(a));
- m = Field(&AStruct::z, Not(Truly(ValueIsPositive)));
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when field is a pointer.
-TEST(FieldTest, WorksForPointerField) {
- // Matching against NULL.
- Matcher<AStruct> m = Field(&AStruct::p, static_cast<const char*>(nullptr));
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.p = "hi";
- EXPECT_FALSE(m.Matches(a));
-
- // Matching a pointer that is not NULL.
- m = Field(&AStruct::p, StartsWith("hi"));
- a.p = "hill";
- EXPECT_TRUE(m.Matches(a));
- a.p = "hole";
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field() works when the object is passed by reference.
-TEST(FieldTest, WorksForByRefArgument) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field(&Foo::field, ...) works when the argument's type
-// is a sub-type of Foo.
-TEST(FieldTest, WorksForArgumentOfSubType) {
- // Note that the matcher expects DerivedStruct but we say AStruct
- // inside Field().
- Matcher<const DerivedStruct&> m = Field(&AStruct::x, Ge(0));
-
- DerivedStruct d;
- EXPECT_TRUE(m.Matches(d));
- d.x = -1;
- EXPECT_FALSE(m.Matches(d));
-}
-
-// Tests that Field(&Foo::field, m) works when field's type and m's
-// argument type are compatible but not the same.
-TEST(FieldTest, WorksForCompatibleMatcherType) {
- // The field is an int, but the inner matcher expects a signed char.
- Matcher<const AStruct&> m = Field(&AStruct::x,
- Matcher<signed char>(Ge(0)));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Field() can describe itself.
-TEST(FieldTest, CanDescribeSelf) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
-}
-
-TEST(FieldTest, CanDescribeSelfWithFieldName) {
- Matcher<const AStruct&> m = Field("field_name", &AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose field `field_name` is >= 0", Describe(m));
- EXPECT_EQ("is an object whose field `field_name` isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Field() can explain the match result.
-TEST(FieldTest, CanExplainMatchResult) {
- Matcher<const AStruct&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("whose given field is 1" + OfType("int"), Explain(m, a));
-
- m = Field(&AStruct::x, GreaterThan(0));
- EXPECT_EQ(
- "whose given field is 1" + OfType("int") + ", which is 1 more than 0",
- Explain(m, a));
-}
-
-TEST(FieldTest, CanExplainMatchResultWithFieldName) {
- Matcher<const AStruct&> m = Field("field_name", &AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("whose field `field_name` is 1" + OfType("int"), Explain(m, a));
-
- m = Field("field_name", &AStruct::x, GreaterThan(0));
- EXPECT_EQ("whose field `field_name` is 1" + OfType("int") +
- ", which is 1 more than 0",
- Explain(m, a));
-}
-
-// Tests that Field() works when the argument is a pointer to const.
-TEST(FieldForPointerTest, WorksForPointerToConst) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() works when the argument is a pointer to non-const.
-TEST(FieldForPointerTest, WorksForPointerToNonConst) {
- Matcher<AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() works when the argument is a reference to a const pointer.
-TEST(FieldForPointerTest, WorksForReferenceToConstPointer) {
- Matcher<AStruct* const&> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- EXPECT_TRUE(m.Matches(&a));
- a.x = -1;
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Field() does not match the NULL pointer.
-TEST(FieldForPointerTest, DoesNotMatchNull) {
- Matcher<const AStruct*> m = Field(&AStruct::x, _);
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-// Tests that Field(&Foo::field, ...) works when the argument's type
-// is a sub-type of const Foo*.
-TEST(FieldForPointerTest, WorksForArgumentOfSubType) {
- // Note that the matcher expects DerivedStruct but we say AStruct
- // inside Field().
- Matcher<DerivedStruct*> m = Field(&AStruct::x, Ge(0));
-
- DerivedStruct d;
- EXPECT_TRUE(m.Matches(&d));
- d.x = -1;
- EXPECT_FALSE(m.Matches(&d));
-}
-
-// Tests that Field() can describe itself when used to match a pointer.
-TEST(FieldForPointerTest, CanDescribeSelf) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose given field is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given field isn't >= 0", DescribeNegation(m));
-}
-
-TEST(FieldForPointerTest, CanDescribeSelfWithFieldName) {
- Matcher<const AStruct*> m = Field("field_name", &AStruct::x, Ge(0));
-
- EXPECT_EQ("is an object whose field `field_name` is >= 0", Describe(m));
- EXPECT_EQ("is an object whose field `field_name` isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Field() can explain the result of matching a pointer.
-TEST(FieldForPointerTest, CanExplainMatchResult) {
- Matcher<const AStruct*> m = Field(&AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("", Explain(m, static_cast<const AStruct*>(nullptr)));
- EXPECT_EQ("which points to an object whose given field is 1" + OfType("int"),
- Explain(m, &a));
-
- m = Field(&AStruct::x, GreaterThan(0));
- EXPECT_EQ("which points to an object whose given field is 1" + OfType("int") +
- ", which is 1 more than 0", Explain(m, &a));
-}
-
-TEST(FieldForPointerTest, CanExplainMatchResultWithFieldName) {
- Matcher<const AStruct*> m = Field("field_name", &AStruct::x, Ge(0));
-
- AStruct a;
- a.x = 1;
- EXPECT_EQ("", Explain(m, static_cast<const AStruct*>(nullptr)));
- EXPECT_EQ(
- "which points to an object whose field `field_name` is 1" + OfType("int"),
- Explain(m, &a));
-
- m = Field("field_name", &AStruct::x, GreaterThan(0));
- EXPECT_EQ("which points to an object whose field `field_name` is 1" +
- OfType("int") + ", which is 1 more than 0",
- Explain(m, &a));
-}
-
-// A user-defined class for testing Property().
-class AClass {
- public:
- AClass() : n_(0) {}
-
- // A getter that returns a non-reference.
- int n() const { return n_; }
-
- void set_n(int new_n) { n_ = new_n; }
-
- // A getter that returns a reference to const.
- const std::string& s() const { return s_; }
-
- const std::string& s_ref() const & { return s_; }
-
- void set_s(const std::string& new_s) { s_ = new_s; }
-
- // A getter that returns a reference to non-const.
- double& x() const { return x_; }
-
- private:
- int n_;
- std::string s_;
-
- static double x_;
-};
-
-double AClass::x_ = 0.0;
-
-// A derived class for testing Property().
-class DerivedClass : public AClass {
- public:
- int k() const { return k_; }
- private:
- int k_;
-};
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a non-reference.
-TEST(PropertyTest, WorksForNonReferenceProperty) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
- Matcher<const AClass&> m_with_name = Property("n", &AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
-
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a reference to const.
-TEST(PropertyTest, WorksForReferenceToConstProperty) {
- Matcher<const AClass&> m = Property(&AClass::s, StartsWith("hi"));
- Matcher<const AClass&> m_with_name =
- Property("s", &AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when property() is
-// ref-qualified.
-TEST(PropertyTest, WorksForRefQualifiedProperty) {
- Matcher<const AClass&> m = Property(&AClass::s_ref, StartsWith("hi"));
- Matcher<const AClass&> m_with_name =
- Property("s", &AClass::s_ref, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when property()
-// returns a reference to non-const.
-TEST(PropertyTest, WorksForReferenceToNonConstProperty) {
- double x = 0.0;
- AClass a;
-
- Matcher<const AClass&> m = Property(&AClass::x, Ref(x));
- EXPECT_FALSE(m.Matches(a));
-
- m = Property(&AClass::x, Not(Ref(x)));
- EXPECT_TRUE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument is
-// passed by value.
-TEST(PropertyTest, WorksForByValueArgument) {
- Matcher<AClass> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(a));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument's
-// type is a sub-type of Foo.
-TEST(PropertyTest, WorksForArgumentOfSubType) {
- // The matcher expects a DerivedClass, but inside the Property() we
- // say AClass.
- Matcher<const DerivedClass&> m = Property(&AClass::n, Ge(0));
-
- DerivedClass d;
- d.set_n(1);
- EXPECT_TRUE(m.Matches(d));
-
- d.set_n(-1);
- EXPECT_FALSE(m.Matches(d));
-}
-
-// Tests that Property(&Foo::property, m) works when property()'s type
-// and m's argument type are compatible but different.
-TEST(PropertyTest, WorksForCompatibleMatcherType) {
- // n() returns an int but the inner matcher expects a signed char.
- Matcher<const AClass&> m = Property(&AClass::n,
- Matcher<signed char>(Ge(0)));
-
- Matcher<const AClass&> m_with_name =
- Property("n", &AClass::n, Matcher<signed char>(Ge(0)));
-
- AClass a;
- EXPECT_TRUE(m.Matches(a));
- EXPECT_TRUE(m_with_name.Matches(a));
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(a));
- EXPECT_FALSE(m_with_name.Matches(a));
-}
-
-// Tests that Property() can describe itself.
-TEST(PropertyTest, CanDescribeSelf) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose given property is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given property isn't >= 0",
- DescribeNegation(m));
-}
-
-TEST(PropertyTest, CanDescribeSelfWithPropertyName) {
- Matcher<const AClass&> m = Property("fancy_name", &AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose property `fancy_name` is >= 0", Describe(m));
- EXPECT_EQ("is an object whose property `fancy_name` isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Property() can explain the match result.
-TEST(PropertyTest, CanExplainMatchResult) {
- Matcher<const AClass&> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("whose given property is 1" + OfType("int"), Explain(m, a));
-
- m = Property(&AClass::n, GreaterThan(0));
- EXPECT_EQ(
- "whose given property is 1" + OfType("int") + ", which is 1 more than 0",
- Explain(m, a));
-}
-
-TEST(PropertyTest, CanExplainMatchResultWithPropertyName) {
- Matcher<const AClass&> m = Property("fancy_name", &AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("whose property `fancy_name` is 1" + OfType("int"), Explain(m, a));
-
- m = Property("fancy_name", &AClass::n, GreaterThan(0));
- EXPECT_EQ("whose property `fancy_name` is 1" + OfType("int") +
- ", which is 1 more than 0",
- Explain(m, a));
-}
-
-// Tests that Property() works when the argument is a pointer to const.
-TEST(PropertyForPointerTest, WorksForPointerToConst) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_n(-1);
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() works when the argument is a pointer to non-const.
-TEST(PropertyForPointerTest, WorksForPointerToNonConst) {
- Matcher<AClass*> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() works when the argument is a reference to a
-// const pointer.
-TEST(PropertyForPointerTest, WorksForReferenceToConstPointer) {
- Matcher<AClass* const&> m = Property(&AClass::s, StartsWith("hi"));
-
- AClass a;
- a.set_s("hill");
- EXPECT_TRUE(m.Matches(&a));
-
- a.set_s("hole");
- EXPECT_FALSE(m.Matches(&a));
-}
-
-// Tests that Property() does not match the NULL pointer.
-TEST(PropertyForPointerTest, WorksForReferenceToNonConstProperty) {
- Matcher<const AClass*> m = Property(&AClass::x, _);
- EXPECT_FALSE(m.Matches(nullptr));
-}
-
-// Tests that Property(&Foo::property, ...) works when the argument's
-// type is a sub-type of const Foo*.
-TEST(PropertyForPointerTest, WorksForArgumentOfSubType) {
- // The matcher expects a DerivedClass, but inside the Property() we
- // say AClass.
- Matcher<const DerivedClass*> m = Property(&AClass::n, Ge(0));
-
- DerivedClass d;
- d.set_n(1);
- EXPECT_TRUE(m.Matches(&d));
-
- d.set_n(-1);
- EXPECT_FALSE(m.Matches(&d));
-}
-
-// Tests that Property() can describe itself when used to match a pointer.
-TEST(PropertyForPointerTest, CanDescribeSelf) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose given property is >= 0", Describe(m));
- EXPECT_EQ("is an object whose given property isn't >= 0",
- DescribeNegation(m));
-}
-
-TEST(PropertyForPointerTest, CanDescribeSelfWithPropertyDescription) {
- Matcher<const AClass*> m = Property("fancy_name", &AClass::n, Ge(0));
-
- EXPECT_EQ("is an object whose property `fancy_name` is >= 0", Describe(m));
- EXPECT_EQ("is an object whose property `fancy_name` isn't >= 0",
- DescribeNegation(m));
-}
-
-// Tests that Property() can explain the result of matching a pointer.
-TEST(PropertyForPointerTest, CanExplainMatchResult) {
- Matcher<const AClass*> m = Property(&AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("", Explain(m, static_cast<const AClass*>(nullptr)));
- EXPECT_EQ(
- "which points to an object whose given property is 1" + OfType("int"),
- Explain(m, &a));
-
- m = Property(&AClass::n, GreaterThan(0));
- EXPECT_EQ("which points to an object whose given property is 1" +
- OfType("int") + ", which is 1 more than 0",
- Explain(m, &a));
-}
-
-TEST(PropertyForPointerTest, CanExplainMatchResultWithPropertyName) {
- Matcher<const AClass*> m = Property("fancy_name", &AClass::n, Ge(0));
-
- AClass a;
- a.set_n(1);
- EXPECT_EQ("", Explain(m, static_cast<const AClass*>(nullptr)));
- EXPECT_EQ("which points to an object whose property `fancy_name` is 1" +
- OfType("int"),
- Explain(m, &a));
-
- m = Property("fancy_name", &AClass::n, GreaterThan(0));
- EXPECT_EQ("which points to an object whose property `fancy_name` is 1" +
- OfType("int") + ", which is 1 more than 0",
- Explain(m, &a));
-}
-
-// Tests ResultOf.
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function pointer.
-std::string IntToStringFunction(int input) {
- return input == 1 ? "foo" : "bar";
-}
-
-TEST(ResultOfTest, WorksForFunctionPointers) {
- Matcher<int> matcher = ResultOf(&IntToStringFunction, Eq(std::string("foo")));
-
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf() can describe itself.
-TEST(ResultOfTest, CanDescribeItself) {
- Matcher<int> matcher = ResultOf(&IntToStringFunction, StrEq("foo"));
-
- EXPECT_EQ("is mapped by the given callable to a value that "
- "is equal to \"foo\"", Describe(matcher));
- EXPECT_EQ("is mapped by the given callable to a value that "
- "isn't equal to \"foo\"", DescribeNegation(matcher));
-}
-
-// Tests that ResultOf() can explain the match result.
-int IntFunction(int input) { return input == 42 ? 80 : 90; }
-
-TEST(ResultOfTest, CanExplainMatchResult) {
- Matcher<int> matcher = ResultOf(&IntFunction, Ge(85));
- EXPECT_EQ("which is mapped by the given callable to 90" + OfType("int"),
- Explain(matcher, 36));
-
- matcher = ResultOf(&IntFunction, GreaterThan(85));
- EXPECT_EQ("which is mapped by the given callable to 90" + OfType("int") +
- ", which is 5 more than 85", Explain(matcher, 36));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a non-reference.
-TEST(ResultOfTest, WorksForNonReferenceResults) {
- Matcher<int> matcher = ResultOf(&IntFunction, Eq(80));
-
- EXPECT_TRUE(matcher.Matches(42));
- EXPECT_FALSE(matcher.Matches(36));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a reference to non-const.
-double& DoubleFunction(double& input) { return input; } // NOLINT
-
-Uncopyable& RefUncopyableFunction(Uncopyable& obj) { // NOLINT
- return obj;
-}
-
-TEST(ResultOfTest, WorksForReferenceToNonConstResults) {
- double x = 3.14;
- double x2 = x;
- Matcher<double&> matcher = ResultOf(&DoubleFunction, Ref(x));
-
- EXPECT_TRUE(matcher.Matches(x));
- EXPECT_FALSE(matcher.Matches(x2));
-
- // Test that ResultOf works with uncopyable objects
- Uncopyable obj(0);
- Uncopyable obj2(0);
- Matcher<Uncopyable&> matcher2 =
- ResultOf(&RefUncopyableFunction, Ref(obj));
-
- EXPECT_TRUE(matcher2.Matches(obj));
- EXPECT_FALSE(matcher2.Matches(obj2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f(x)
-// returns a reference to const.
-const std::string& StringFunction(const std::string& input) { return input; }
-
-TEST(ResultOfTest, WorksForReferenceToConstResults) {
- std::string s = "foo";
- std::string s2 = s;
- Matcher<const std::string&> matcher = ResultOf(&StringFunction, Ref(s));
-
- EXPECT_TRUE(matcher.Matches(s));
- EXPECT_FALSE(matcher.Matches(s2));
-}
-
-// Tests that ResultOf(f, m) works when f(x) and m's
-// argument types are compatible but different.
-TEST(ResultOfTest, WorksForCompatibleMatcherTypes) {
- // IntFunction() returns int but the inner matcher expects a signed char.
- Matcher<int> matcher = ResultOf(IntFunction, Matcher<signed char>(Ge(85)));
-
- EXPECT_TRUE(matcher.Matches(36));
- EXPECT_FALSE(matcher.Matches(42));
-}
-
-// Tests that the program aborts when ResultOf is passed
-// a NULL function pointer.
-TEST(ResultOfDeathTest, DiesOnNullFunctionPointers) {
- EXPECT_DEATH_IF_SUPPORTED(
- ResultOf(static_cast<std::string (*)(int dummy)>(nullptr),
- Eq(std::string("foo"))),
- "NULL function pointer is passed into ResultOf\\(\\)\\.");
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function reference.
-TEST(ResultOfTest, WorksForFunctionReferences) {
- Matcher<int> matcher = ResultOf(IntToStringFunction, StrEq("foo"));
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// function object.
-struct Functor {
- std::string operator()(int input) const {
- return IntToStringFunction(input);
- }
-};
-
-TEST(ResultOfTest, WorksForFunctors) {
- Matcher<int> matcher = ResultOf(Functor(), Eq(std::string("foo")));
-
- EXPECT_TRUE(matcher.Matches(1));
- EXPECT_FALSE(matcher.Matches(2));
-}
-
-// Tests that ResultOf(f, ...) compiles and works as expected when f is a
-// functor with more than one operator() defined. ResultOf() must work
-// for each defined operator().
-struct PolymorphicFunctor {
- typedef int result_type;
- int operator()(int n) { return n; }
- int operator()(const char* s) { return static_cast<int>(strlen(s)); }
- std::string operator()(int *p) { return p ? "good ptr" : "null"; }
-};
-
-TEST(ResultOfTest, WorksForPolymorphicFunctors) {
- Matcher<int> matcher_int = ResultOf(PolymorphicFunctor(), Ge(5));
-
- EXPECT_TRUE(matcher_int.Matches(10));
- EXPECT_FALSE(matcher_int.Matches(2));
-
- Matcher<const char*> matcher_string = ResultOf(PolymorphicFunctor(), Ge(5));
-
- EXPECT_TRUE(matcher_string.Matches("long string"));
- EXPECT_FALSE(matcher_string.Matches("shrt"));
-}
-
-TEST(ResultOfTest, WorksForPolymorphicFunctorsIgnoringResultType) {
- Matcher<int*> matcher = ResultOf(PolymorphicFunctor(), "good ptr");
-
- int n = 0;
- EXPECT_TRUE(matcher.Matches(&n));
- EXPECT_FALSE(matcher.Matches(nullptr));
-}
-
-TEST(ResultOfTest, WorksForLambdas) {
- Matcher<int> matcher = ResultOf(
- [](int str_len) {
- return std::string(static_cast<size_t>(str_len), 'x');
- },
- "xxx");
- EXPECT_TRUE(matcher.Matches(3));
- EXPECT_FALSE(matcher.Matches(1));
-}
-
-TEST(ResultOfTest, WorksForNonCopyableArguments) {
- Matcher<std::unique_ptr<int>> matcher = ResultOf(
- [](const std::unique_ptr<int>& str_len) {
- return std::string(static_cast<size_t>(*str_len), 'x');
- },
- "xxx");
- EXPECT_TRUE(matcher.Matches(std::unique_ptr<int>(new int(3))));
- EXPECT_FALSE(matcher.Matches(std::unique_ptr<int>(new int(1))));
-}
-
-const int* ReferencingFunction(const int& n) { return &n; }
-
-struct ReferencingFunctor {
- typedef const int* result_type;
- result_type operator()(const int& n) { return &n; }
-};
-
-TEST(ResultOfTest, WorksForReferencingCallables) {
- const int n = 1;
- const int n2 = 1;
- Matcher<const int&> matcher2 = ResultOf(ReferencingFunction, Eq(&n));
- EXPECT_TRUE(matcher2.Matches(n));
- EXPECT_FALSE(matcher2.Matches(n2));
-
- Matcher<const int&> matcher3 = ResultOf(ReferencingFunctor(), Eq(&n));
- EXPECT_TRUE(matcher3.Matches(n));
- EXPECT_FALSE(matcher3.Matches(n2));
-}
-
-class DivisibleByImpl {
- public:
- explicit DivisibleByImpl(int a_divider) : divider_(a_divider) {}
-
- // For testing using ExplainMatchResultTo() with polymorphic matchers.
- template <typename T>
- bool MatchAndExplain(const T& n, MatchResultListener* listener) const {
- *listener << "which is " << (n % divider_) << " modulo "
- << divider_;
- return (n % divider_) == 0;
- }
-
- void DescribeTo(ostream* os) const {
- *os << "is divisible by " << divider_;
- }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "is not divisible by " << divider_;
- }
-
- void set_divider(int a_divider) { divider_ = a_divider; }
- int divider() const { return divider_; }
-
- private:
- int divider_;
-};
-
-PolymorphicMatcher<DivisibleByImpl> DivisibleBy(int n) {
- return MakePolymorphicMatcher(DivisibleByImpl(n));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_False_False) {
- const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
- EXPECT_EQ("which is 1 modulo 4", Explain(m, 5));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_False_True) {
- const Matcher<int> m = AllOf(DivisibleBy(4), DivisibleBy(3));
- EXPECT_EQ("which is 2 modulo 4", Explain(m, 6));
-}
-
-// Tests that when AllOf() fails, only the first failing matcher is
-// asked to explain why.
-TEST(ExplainMatchResultTest, AllOf_True_False) {
- const Matcher<int> m = AllOf(Ge(1), DivisibleBy(3));
- EXPECT_EQ("which is 2 modulo 3", Explain(m, 5));
-}
-
-// Tests that when AllOf() succeeds, all matchers are asked to explain
-// why.
-TEST(ExplainMatchResultTest, AllOf_True_True) {
- const Matcher<int> m = AllOf(DivisibleBy(2), DivisibleBy(3));
- EXPECT_EQ("which is 0 modulo 2, and which is 0 modulo 3", Explain(m, 6));
-}
-
-TEST(ExplainMatchResultTest, AllOf_True_True_2) {
- const Matcher<int> m = AllOf(Ge(2), Le(3));
- EXPECT_EQ("", Explain(m, 2));
-}
-
-TEST(ExplainmatcherResultTest, MonomorphicMatcher) {
- const Matcher<int> m = GreaterThan(5);
- EXPECT_EQ("which is 1 more than 5", Explain(m, 6));
-}
-
-// The following two tests verify that values without a public copy
-// ctor can be used as arguments to matchers like Eq(), Ge(), and etc
-// with the help of ByRef().
-
-class NotCopyable {
- public:
- explicit NotCopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
-
- bool operator==(const NotCopyable& rhs) const {
- return value() == rhs.value();
- }
-
- bool operator>=(const NotCopyable& rhs) const {
- return value() >= rhs.value();
- }
- private:
- int value_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NotCopyable);
-};
-
-TEST(ByRefTest, AllowsNotCopyableConstValueInMatchers) {
- const NotCopyable const_value1(1);
- const Matcher<const NotCopyable&> m = Eq(ByRef(const_value1));
-
- const NotCopyable n1(1), n2(2);
- EXPECT_TRUE(m.Matches(n1));
- EXPECT_FALSE(m.Matches(n2));
-}
-
-TEST(ByRefTest, AllowsNotCopyableValueInMatchers) {
- NotCopyable value2(2);
- const Matcher<NotCopyable&> m = Ge(ByRef(value2));
-
- NotCopyable n1(1), n2(2);
- EXPECT_FALSE(m.Matches(n1));
- EXPECT_TRUE(m.Matches(n2));
-}
-
-TEST(IsEmptyTest, ImplementsIsEmpty) {
- vector<int> container;
- EXPECT_THAT(container, IsEmpty());
- container.push_back(0);
- EXPECT_THAT(container, Not(IsEmpty()));
- container.push_back(1);
- EXPECT_THAT(container, Not(IsEmpty()));
-}
-
-TEST(IsEmptyTest, WorksWithString) {
- std::string text;
- EXPECT_THAT(text, IsEmpty());
- text = "foo";
- EXPECT_THAT(text, Not(IsEmpty()));
- text = std::string("\0", 1);
- EXPECT_THAT(text, Not(IsEmpty()));
-}
-
-TEST(IsEmptyTest, CanDescribeSelf) {
- Matcher<vector<int> > m = IsEmpty();
- EXPECT_EQ("is empty", Describe(m));
- EXPECT_EQ("isn't empty", DescribeNegation(m));
-}
-
-TEST(IsEmptyTest, ExplainsResult) {
- Matcher<vector<int> > m = IsEmpty();
- vector<int> container;
- EXPECT_EQ("", Explain(m, container));
- container.push_back(0);
- EXPECT_EQ("whose size is 1", Explain(m, container));
-}
-
-TEST(IsEmptyTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(IsEmpty()));
- helper.Call({});
-}
-
-TEST(IsTrueTest, IsTrueIsFalse) {
- EXPECT_THAT(true, IsTrue());
- EXPECT_THAT(false, IsFalse());
- EXPECT_THAT(true, Not(IsFalse()));
- EXPECT_THAT(false, Not(IsTrue()));
- EXPECT_THAT(0, Not(IsTrue()));
- EXPECT_THAT(0, IsFalse());
- EXPECT_THAT(nullptr, Not(IsTrue()));
- EXPECT_THAT(nullptr, IsFalse());
- EXPECT_THAT(-1, IsTrue());
- EXPECT_THAT(-1, Not(IsFalse()));
- EXPECT_THAT(1, IsTrue());
- EXPECT_THAT(1, Not(IsFalse()));
- EXPECT_THAT(2, IsTrue());
- EXPECT_THAT(2, Not(IsFalse()));
- int a = 42;
- EXPECT_THAT(a, IsTrue());
- EXPECT_THAT(a, Not(IsFalse()));
- EXPECT_THAT(&a, IsTrue());
- EXPECT_THAT(&a, Not(IsFalse()));
- EXPECT_THAT(false, Not(IsTrue()));
- EXPECT_THAT(true, Not(IsFalse()));
- EXPECT_THAT(std::true_type(), IsTrue());
- EXPECT_THAT(std::true_type(), Not(IsFalse()));
- EXPECT_THAT(std::false_type(), IsFalse());
- EXPECT_THAT(std::false_type(), Not(IsTrue()));
- EXPECT_THAT(nullptr, Not(IsTrue()));
- EXPECT_THAT(nullptr, IsFalse());
- std::unique_ptr<int> null_unique;
- std::unique_ptr<int> nonnull_unique(new int(0));
- EXPECT_THAT(null_unique, Not(IsTrue()));
- EXPECT_THAT(null_unique, IsFalse());
- EXPECT_THAT(nonnull_unique, IsTrue());
- EXPECT_THAT(nonnull_unique, Not(IsFalse()));
-}
-
-TEST(SizeIsTest, ImplementsSizeIs) {
- vector<int> container;
- EXPECT_THAT(container, SizeIs(0));
- EXPECT_THAT(container, Not(SizeIs(1)));
- container.push_back(0);
- EXPECT_THAT(container, Not(SizeIs(0)));
- EXPECT_THAT(container, SizeIs(1));
- container.push_back(0);
- EXPECT_THAT(container, Not(SizeIs(0)));
- EXPECT_THAT(container, SizeIs(2));
-}
-
-TEST(SizeIsTest, WorksWithMap) {
- map<std::string, int> container;
- EXPECT_THAT(container, SizeIs(0));
- EXPECT_THAT(container, Not(SizeIs(1)));
- container.insert(make_pair("foo", 1));
- EXPECT_THAT(container, Not(SizeIs(0)));
- EXPECT_THAT(container, SizeIs(1));
- container.insert(make_pair("bar", 2));
- EXPECT_THAT(container, Not(SizeIs(0)));
- EXPECT_THAT(container, SizeIs(2));
-}
-
-TEST(SizeIsTest, WorksWithReferences) {
- vector<int> container;
- Matcher<const vector<int>&> m = SizeIs(1);
- EXPECT_THAT(container, Not(m));
- container.push_back(0);
- EXPECT_THAT(container, m);
-}
-
-TEST(SizeIsTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(SizeIs(3)));
- helper.Call(MakeUniquePtrs({1, 2, 3}));
-}
-
-// SizeIs should work for any type that provides a size() member function.
-// For example, a size_type member type should not need to be provided.
-struct MinimalistCustomType {
- int size() const { return 1; }
-};
-TEST(SizeIsTest, WorksWithMinimalistCustomType) {
- MinimalistCustomType container;
- EXPECT_THAT(container, SizeIs(1));
- EXPECT_THAT(container, Not(SizeIs(0)));
-}
-
-TEST(SizeIsTest, CanDescribeSelf) {
- Matcher<vector<int> > m = SizeIs(2);
- EXPECT_EQ("size is equal to 2", Describe(m));
- EXPECT_EQ("size isn't equal to 2", DescribeNegation(m));
-}
-
-TEST(SizeIsTest, ExplainsResult) {
- Matcher<vector<int> > m1 = SizeIs(2);
- Matcher<vector<int> > m2 = SizeIs(Lt(2u));
- Matcher<vector<int> > m3 = SizeIs(AnyOf(0, 3));
- Matcher<vector<int> > m4 = SizeIs(Gt(1u));
- vector<int> container;
- EXPECT_EQ("whose size 0 doesn't match", Explain(m1, container));
- EXPECT_EQ("whose size 0 matches", Explain(m2, container));
- EXPECT_EQ("whose size 0 matches", Explain(m3, container));
- EXPECT_EQ("whose size 0 doesn't match", Explain(m4, container));
- container.push_back(0);
- container.push_back(0);
- EXPECT_EQ("whose size 2 matches", Explain(m1, container));
- EXPECT_EQ("whose size 2 doesn't match", Explain(m2, container));
- EXPECT_EQ("whose size 2 doesn't match", Explain(m3, container));
- EXPECT_EQ("whose size 2 matches", Explain(m4, container));
-}
-
-#if GTEST_HAS_TYPED_TEST
-// Tests ContainerEq with different container types, and
-// different element types.
-
-template <typename T>
-class ContainerEqTest : public testing::Test {};
-
-typedef testing::Types<
- set<int>,
- vector<size_t>,
- multiset<size_t>,
- list<int> >
- ContainerEqTestTypes;
-
-TYPED_TEST_SUITE(ContainerEqTest, ContainerEqTestTypes);
-
-// Tests that the filled container is equal to itself.
-TYPED_TEST(ContainerEqTest, EqualsSelf) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- TypeParam my_set(vals, vals + 6);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_TRUE(m.Matches(my_set));
- EXPECT_EQ("", Explain(m, my_set));
-}
-
-// Tests that missing values are reported.
-TYPED_TEST(ContainerEqTest, ValueMissing) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {2, 1, 8, 5};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 4);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which doesn't have these expected elements: 3",
- Explain(m, test_set));
-}
-
-// Tests that added values are reported.
-TYPED_TEST(ContainerEqTest, ValueAdded) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8, 46};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 6);
- const Matcher<const TypeParam&> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 46", Explain(m, test_set));
-}
-
-// Tests that added and missing values are reported together.
-TYPED_TEST(ContainerEqTest, ValueAddedAndRemoved) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 8, 46};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 5);
- const Matcher<TypeParam> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 46,\n"
- "and doesn't have these expected elements: 5",
- Explain(m, test_set));
-}
-
-// Tests duplicated value -- expect no explanation.
-TYPED_TEST(ContainerEqTest, DuplicateDifference) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8};
- TypeParam my_set(vals, vals + 6);
- TypeParam test_set(test_vals, test_vals + 5);
- const Matcher<const TypeParam&> m = ContainerEq(my_set);
- // Depending on the container, match may be true or false
- // But in any case there should be no explanation.
- EXPECT_EQ("", Explain(m, test_set));
-}
-#endif // GTEST_HAS_TYPED_TEST
-
-// Tests that multiple missing values are reported.
-// Using just vector here, so order is predictable.
-TEST(ContainerEqExtraTest, MultipleValuesMissing) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {2, 1, 5};
- vector<int> my_set(vals, vals + 6);
- vector<int> test_set(test_vals, test_vals + 3);
- const Matcher<vector<int> > m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which doesn't have these expected elements: 3, 8",
- Explain(m, test_set));
-}
-
-// Tests that added values are reported.
-// Using just vector here, so order is predictable.
-TEST(ContainerEqExtraTest, MultipleValuesAdded) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 92, 3, 5, 8, 46};
- list<size_t> my_set(vals, vals + 6);
- list<size_t> test_set(test_vals, test_vals + 7);
- const Matcher<const list<size_t>&> m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 92, 46",
- Explain(m, test_set));
-}
-
-// Tests that added and missing values are reported together.
-TEST(ContainerEqExtraTest, MultipleValuesAddedAndRemoved) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 92, 46};
- list<size_t> my_set(vals, vals + 6);
- list<size_t> test_set(test_vals, test_vals + 5);
- const Matcher<const list<size_t> > m = ContainerEq(my_set);
- EXPECT_FALSE(m.Matches(test_set));
- EXPECT_EQ("which has these unexpected elements: 92, 46,\n"
- "and doesn't have these expected elements: 5, 8",
- Explain(m, test_set));
-}
-
-// Tests to see that duplicate elements are detected,
-// but (as above) not reported in the explanation.
-TEST(ContainerEqExtraTest, MultiSetOfIntDuplicateDifference) {
- static const int vals[] = {1, 1, 2, 3, 5, 8};
- static const int test_vals[] = {1, 2, 3, 5, 8};
- vector<int> my_set(vals, vals + 6);
- vector<int> test_set(test_vals, test_vals + 5);
- const Matcher<vector<int> > m = ContainerEq(my_set);
- EXPECT_TRUE(m.Matches(my_set));
- EXPECT_FALSE(m.Matches(test_set));
- // There is nothing to report when both sets contain all the same values.
- EXPECT_EQ("", Explain(m, test_set));
-}
-
-// Tests that ContainerEq works for non-trivial associative containers,
-// like maps.
-TEST(ContainerEqExtraTest, WorksForMaps) {
- map<int, std::string> my_map;
- my_map[0] = "a";
- my_map[1] = "b";
-
- map<int, std::string> test_map;
- test_map[0] = "aa";
- test_map[1] = "b";
-
- const Matcher<const map<int, std::string>&> m = ContainerEq(my_map);
- EXPECT_TRUE(m.Matches(my_map));
- EXPECT_FALSE(m.Matches(test_map));
-
- EXPECT_EQ("which has these unexpected elements: (0, \"aa\"),\n"
- "and doesn't have these expected elements: (0, \"a\")",
- Explain(m, test_map));
-}
-
-TEST(ContainerEqExtraTest, WorksForNativeArray) {
- int a1[] = {1, 2, 3};
- int a2[] = {1, 2, 3};
- int b[] = {1, 2, 4};
-
- EXPECT_THAT(a1, ContainerEq(a2));
- EXPECT_THAT(a1, Not(ContainerEq(b)));
-}
-
-TEST(ContainerEqExtraTest, WorksForTwoDimensionalNativeArray) {
- const char a1[][3] = {"hi", "lo"};
- const char a2[][3] = {"hi", "lo"};
- const char b[][3] = {"lo", "hi"};
-
- // Tests using ContainerEq() in the first dimension.
- EXPECT_THAT(a1, ContainerEq(a2));
- EXPECT_THAT(a1, Not(ContainerEq(b)));
-
- // Tests using ContainerEq() in the second dimension.
- EXPECT_THAT(a1, ElementsAre(ContainerEq(a2[0]), ContainerEq(a2[1])));
- EXPECT_THAT(a1, ElementsAre(Not(ContainerEq(b[0])), ContainerEq(a2[1])));
-}
-
-TEST(ContainerEqExtraTest, WorksForNativeArrayAsTuple) {
- const int a1[] = {1, 2, 3};
- const int a2[] = {1, 2, 3};
- const int b[] = {1, 2, 3, 4};
-
- const int* const p1 = a1;
- EXPECT_THAT(std::make_tuple(p1, 3), ContainerEq(a2));
- EXPECT_THAT(std::make_tuple(p1, 3), Not(ContainerEq(b)));
-
- const int c[] = {1, 3, 2};
- EXPECT_THAT(std::make_tuple(p1, 3), Not(ContainerEq(c)));
-}
-
-TEST(ContainerEqExtraTest, CopiesNativeArrayParameter) {
- std::string a1[][3] = {
- {"hi", "hello", "ciao"},
- {"bye", "see you", "ciao"}
- };
-
- std::string a2[][3] = {
- {"hi", "hello", "ciao"},
- {"bye", "see you", "ciao"}
- };
-
- const Matcher<const std::string(&)[2][3]> m = ContainerEq(a2);
- EXPECT_THAT(a1, m);
-
- a2[0][0] = "ha";
- EXPECT_THAT(a1, m);
-}
-
-TEST(WhenSortedByTest, WorksForEmptyContainer) {
- const vector<int> numbers;
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(), ElementsAre()));
- EXPECT_THAT(numbers, Not(WhenSortedBy(less<int>(), ElementsAre(1))));
-}
-
-TEST(WhenSortedByTest, WorksForNonEmptyContainer) {
- vector<unsigned> numbers;
- numbers.push_back(3);
- numbers.push_back(1);
- numbers.push_back(2);
- numbers.push_back(2);
- EXPECT_THAT(numbers, WhenSortedBy(greater<unsigned>(),
- ElementsAre(3, 2, 2, 1)));
- EXPECT_THAT(numbers, Not(WhenSortedBy(greater<unsigned>(),
- ElementsAre(1, 2, 2, 3))));
-}
-
-TEST(WhenSortedByTest, WorksForNonVectorContainer) {
- list<std::string> words;
- words.push_back("say");
- words.push_back("hello");
- words.push_back("world");
- EXPECT_THAT(words, WhenSortedBy(less<std::string>(),
- ElementsAre("hello", "say", "world")));
- EXPECT_THAT(words, Not(WhenSortedBy(less<std::string>(),
- ElementsAre("say", "hello", "world"))));
-}
-
-TEST(WhenSortedByTest, WorksForNativeArray) {
- const int numbers[] = {1, 3, 2, 4};
- const int sorted_numbers[] = {1, 2, 3, 4};
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(), ElementsAre(1, 2, 3, 4)));
- EXPECT_THAT(numbers, WhenSortedBy(less<int>(),
- ElementsAreArray(sorted_numbers)));
- EXPECT_THAT(numbers, Not(WhenSortedBy(less<int>(), ElementsAre(1, 3, 2, 4))));
-}
-
-TEST(WhenSortedByTest, CanDescribeSelf) {
- const Matcher<vector<int> > m = WhenSortedBy(less<int>(), ElementsAre(1, 2));
- EXPECT_EQ("(when sorted) has 2 elements where\n"
- "element #0 is equal to 1,\n"
- "element #1 is equal to 2",
- Describe(m));
- EXPECT_EQ("(when sorted) doesn't have 2 elements, or\n"
- "element #0 isn't equal to 1, or\n"
- "element #1 isn't equal to 2",
- DescribeNegation(m));
-}
-
-TEST(WhenSortedByTest, ExplainsMatchResult) {
- const int a[] = {2, 1};
- EXPECT_EQ("which is { 1, 2 } when sorted, whose element #0 doesn't match",
- Explain(WhenSortedBy(less<int>(), ElementsAre(2, 3)), a));
- EXPECT_EQ("which is { 1, 2 } when sorted",
- Explain(WhenSortedBy(less<int>(), ElementsAre(1, 2)), a));
-}
-
-// WhenSorted() is a simple wrapper on WhenSortedBy(). Hence we don't
-// need to test it as exhaustively as we test the latter.
-
-TEST(WhenSortedTest, WorksForEmptyContainer) {
- const vector<int> numbers;
- EXPECT_THAT(numbers, WhenSorted(ElementsAre()));
- EXPECT_THAT(numbers, Not(WhenSorted(ElementsAre(1))));
-}
-
-TEST(WhenSortedTest, WorksForNonEmptyContainer) {
- list<std::string> words;
- words.push_back("3");
- words.push_back("1");
- words.push_back("2");
- words.push_back("2");
- EXPECT_THAT(words, WhenSorted(ElementsAre("1", "2", "2", "3")));
- EXPECT_THAT(words, Not(WhenSorted(ElementsAre("3", "1", "2", "2"))));
-}
-
-TEST(WhenSortedTest, WorksForMapTypes) {
- map<std::string, int> word_counts;
- word_counts["and"] = 1;
- word_counts["the"] = 1;
- word_counts["buffalo"] = 2;
- EXPECT_THAT(word_counts,
- WhenSorted(ElementsAre(Pair("and", 1), Pair("buffalo", 2),
- Pair("the", 1))));
- EXPECT_THAT(word_counts,
- Not(WhenSorted(ElementsAre(Pair("and", 1), Pair("the", 1),
- Pair("buffalo", 2)))));
-}
-
-TEST(WhenSortedTest, WorksForMultiMapTypes) {
- multimap<int, int> ifib;
- ifib.insert(make_pair(8, 6));
- ifib.insert(make_pair(2, 3));
- ifib.insert(make_pair(1, 1));
- ifib.insert(make_pair(3, 4));
- ifib.insert(make_pair(1, 2));
- ifib.insert(make_pair(5, 5));
- EXPECT_THAT(ifib, WhenSorted(ElementsAre(Pair(1, 1),
- Pair(1, 2),
- Pair(2, 3),
- Pair(3, 4),
- Pair(5, 5),
- Pair(8, 6))));
- EXPECT_THAT(ifib, Not(WhenSorted(ElementsAre(Pair(8, 6),
- Pair(2, 3),
- Pair(1, 1),
- Pair(3, 4),
- Pair(1, 2),
- Pair(5, 5)))));
-}
-
-TEST(WhenSortedTest, WorksForPolymorphicMatcher) {
- std::deque<int> d;
- d.push_back(2);
- d.push_back(1);
- EXPECT_THAT(d, WhenSorted(ElementsAre(1, 2)));
- EXPECT_THAT(d, Not(WhenSorted(ElementsAre(2, 1))));
-}
-
-TEST(WhenSortedTest, WorksForVectorConstRefMatcher) {
- std::deque<int> d;
- d.push_back(2);
- d.push_back(1);
- Matcher<const std::vector<int>&> vector_match = ElementsAre(1, 2);
- EXPECT_THAT(d, WhenSorted(vector_match));
- Matcher<const std::vector<int>&> not_vector_match = ElementsAre(2, 1);
- EXPECT_THAT(d, Not(WhenSorted(not_vector_match)));
-}
-
-// Deliberately bare pseudo-container.
-// Offers only begin() and end() accessors, yielding InputIterator.
-template <typename T>
-class Streamlike {
- private:
- class ConstIter;
- public:
- typedef ConstIter const_iterator;
- typedef T value_type;
-
- template <typename InIter>
- Streamlike(InIter first, InIter last) : remainder_(first, last) {}
-
- const_iterator begin() const {
- return const_iterator(this, remainder_.begin());
- }
- const_iterator end() const {
- return const_iterator(this, remainder_.end());
- }
-
- private:
- class ConstIter {
- public:
- using iterator_category = std::input_iterator_tag;
- using value_type = T;
- using difference_type = ptrdiff_t;
- using pointer = const value_type*;
- using reference = const value_type&;
-
- ConstIter(const Streamlike* s,
- typename std::list<value_type>::iterator pos)
- : s_(s), pos_(pos) {}
-
- const value_type& operator*() const { return *pos_; }
- const value_type* operator->() const { return &*pos_; }
- ConstIter& operator++() {
- s_->remainder_.erase(pos_++);
- return *this;
- }
-
- // *iter++ is required to work (see std::istreambuf_iterator).
- // (void)iter++ is also required to work.
- class PostIncrProxy {
- public:
- explicit PostIncrProxy(const value_type& value) : value_(value) {}
- value_type operator*() const { return value_; }
- private:
- value_type value_;
- };
- PostIncrProxy operator++(int) {
- PostIncrProxy proxy(**this);
- ++(*this);
- return proxy;
- }
-
- friend bool operator==(const ConstIter& a, const ConstIter& b) {
- return a.s_ == b.s_ && a.pos_ == b.pos_;
- }
- friend bool operator!=(const ConstIter& a, const ConstIter& b) {
- return !(a == b);
- }
-
- private:
- const Streamlike* s_;
- typename std::list<value_type>::iterator pos_;
- };
-
- friend std::ostream& operator<<(std::ostream& os, const Streamlike& s) {
- os << "[";
- typedef typename std::list<value_type>::const_iterator Iter;
- const char* sep = "";
- for (Iter it = s.remainder_.begin(); it != s.remainder_.end(); ++it) {
- os << sep << *it;
- sep = ",";
- }
- os << "]";
- return os;
- }
-
- mutable std::list<value_type> remainder_; // modified by iteration
-};
-
-TEST(StreamlikeTest, Iteration) {
- const int a[5] = {2, 1, 4, 5, 3};
- Streamlike<int> s(a, a + 5);
- Streamlike<int>::const_iterator it = s.begin();
- const int* ip = a;
- while (it != s.end()) {
- SCOPED_TRACE(ip - a);
- EXPECT_EQ(*ip++, *it++);
- }
-}
-
-TEST(BeginEndDistanceIsTest, WorksWithForwardList) {
- std::forward_list<int> container;
- EXPECT_THAT(container, BeginEndDistanceIs(0));
- EXPECT_THAT(container, Not(BeginEndDistanceIs(1)));
- container.push_front(0);
- EXPECT_THAT(container, Not(BeginEndDistanceIs(0)));
- EXPECT_THAT(container, BeginEndDistanceIs(1));
- container.push_front(0);
- EXPECT_THAT(container, Not(BeginEndDistanceIs(0)));
- EXPECT_THAT(container, BeginEndDistanceIs(2));
-}
-
-TEST(BeginEndDistanceIsTest, WorksWithNonStdList) {
- const int a[5] = {1, 2, 3, 4, 5};
- Streamlike<int> s(a, a + 5);
- EXPECT_THAT(s, BeginEndDistanceIs(5));
-}
-
-TEST(BeginEndDistanceIsTest, CanDescribeSelf) {
- Matcher<vector<int> > m = BeginEndDistanceIs(2);
- EXPECT_EQ("distance between begin() and end() is equal to 2", Describe(m));
- EXPECT_EQ("distance between begin() and end() isn't equal to 2",
- DescribeNegation(m));
-}
-
-TEST(BeginEndDistanceIsTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(BeginEndDistanceIs(2)));
- helper.Call(MakeUniquePtrs({1, 2}));
-}
-
-TEST(BeginEndDistanceIsTest, ExplainsResult) {
- Matcher<vector<int> > m1 = BeginEndDistanceIs(2);
- Matcher<vector<int> > m2 = BeginEndDistanceIs(Lt(2));
- Matcher<vector<int> > m3 = BeginEndDistanceIs(AnyOf(0, 3));
- Matcher<vector<int> > m4 = BeginEndDistanceIs(GreaterThan(1));
- vector<int> container;
- EXPECT_EQ("whose distance between begin() and end() 0 doesn't match",
- Explain(m1, container));
- EXPECT_EQ("whose distance between begin() and end() 0 matches",
- Explain(m2, container));
- EXPECT_EQ("whose distance between begin() and end() 0 matches",
- Explain(m3, container));
- EXPECT_EQ(
- "whose distance between begin() and end() 0 doesn't match, which is 1 "
- "less than 1",
- Explain(m4, container));
- container.push_back(0);
- container.push_back(0);
- EXPECT_EQ("whose distance between begin() and end() 2 matches",
- Explain(m1, container));
- EXPECT_EQ("whose distance between begin() and end() 2 doesn't match",
- Explain(m2, container));
- EXPECT_EQ("whose distance between begin() and end() 2 doesn't match",
- Explain(m3, container));
- EXPECT_EQ(
- "whose distance between begin() and end() 2 matches, which is 1 more "
- "than 1",
- Explain(m4, container));
-}
-
-TEST(WhenSortedTest, WorksForStreamlike) {
- // Streamlike 'container' provides only minimal iterator support.
- // Its iterators are tagged with input_iterator_tag.
- const int a[5] = {2, 1, 4, 5, 3};
- Streamlike<int> s(std::begin(a), std::end(a));
- EXPECT_THAT(s, WhenSorted(ElementsAre(1, 2, 3, 4, 5)));
- EXPECT_THAT(s, Not(WhenSorted(ElementsAre(2, 1, 4, 5, 3))));
-}
-
-TEST(WhenSortedTest, WorksForVectorConstRefMatcherOnStreamlike) {
- const int a[] = {2, 1, 4, 5, 3};
- Streamlike<int> s(std::begin(a), std::end(a));
- Matcher<const std::vector<int>&> vector_match = ElementsAre(1, 2, 3, 4, 5);
- EXPECT_THAT(s, WhenSorted(vector_match));
- EXPECT_THAT(s, Not(WhenSorted(ElementsAre(2, 1, 4, 5, 3))));
-}
-
-TEST(IsSupersetOfTest, WorksForNativeArray) {
- const int subset[] = {1, 4};
- const int superset[] = {1, 2, 4};
- const int disjoint[] = {1, 0, 3};
- EXPECT_THAT(subset, IsSupersetOf(subset));
- EXPECT_THAT(subset, Not(IsSupersetOf(superset)));
- EXPECT_THAT(superset, IsSupersetOf(subset));
- EXPECT_THAT(subset, Not(IsSupersetOf(disjoint)));
- EXPECT_THAT(disjoint, Not(IsSupersetOf(subset)));
-}
-
-TEST(IsSupersetOfTest, WorksWithDuplicates) {
- const int not_enough[] = {1, 2};
- const int enough[] = {1, 1, 2};
- const int expected[] = {1, 1};
- EXPECT_THAT(not_enough, Not(IsSupersetOf(expected)));
- EXPECT_THAT(enough, IsSupersetOf(expected));
-}
-
-TEST(IsSupersetOfTest, WorksForEmpty) {
- vector<int> numbers;
- vector<int> expected;
- EXPECT_THAT(numbers, IsSupersetOf(expected));
- expected.push_back(1);
- EXPECT_THAT(numbers, Not(IsSupersetOf(expected)));
- expected.clear();
- numbers.push_back(1);
- numbers.push_back(2);
- EXPECT_THAT(numbers, IsSupersetOf(expected));
- expected.push_back(1);
- EXPECT_THAT(numbers, IsSupersetOf(expected));
- expected.push_back(2);
- EXPECT_THAT(numbers, IsSupersetOf(expected));
- expected.push_back(3);
- EXPECT_THAT(numbers, Not(IsSupersetOf(expected)));
-}
-
-TEST(IsSupersetOfTest, WorksForStreamlike) {
- const int a[5] = {1, 2, 3, 4, 5};
- Streamlike<int> s(std::begin(a), std::end(a));
-
- vector<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- expected.push_back(5);
- EXPECT_THAT(s, IsSupersetOf(expected));
-
- expected.push_back(0);
- EXPECT_THAT(s, Not(IsSupersetOf(expected)));
-}
-
-TEST(IsSupersetOfTest, TakesStlContainer) {
- const int actual[] = {3, 1, 2};
-
- ::std::list<int> expected;
- expected.push_back(1);
- expected.push_back(3);
- EXPECT_THAT(actual, IsSupersetOf(expected));
-
- expected.push_back(4);
- EXPECT_THAT(actual, Not(IsSupersetOf(expected)));
-}
-
-TEST(IsSupersetOfTest, Describe) {
- typedef std::vector<int> IntVec;
- IntVec expected;
- expected.push_back(111);
- expected.push_back(222);
- expected.push_back(333);
- EXPECT_THAT(
- Describe<IntVec>(IsSupersetOf(expected)),
- Eq("a surjection from elements to requirements exists such that:\n"
- " - an element is equal to 111\n"
- " - an element is equal to 222\n"
- " - an element is equal to 333"));
-}
-
-TEST(IsSupersetOfTest, DescribeNegation) {
- typedef std::vector<int> IntVec;
- IntVec expected;
- expected.push_back(111);
- expected.push_back(222);
- expected.push_back(333);
- EXPECT_THAT(
- DescribeNegation<IntVec>(IsSupersetOf(expected)),
- Eq("no surjection from elements to requirements exists such that:\n"
- " - an element is equal to 111\n"
- " - an element is equal to 222\n"
- " - an element is equal to 333"));
-}
-
-TEST(IsSupersetOfTest, MatchAndExplain) {
- std::vector<int> v;
- v.push_back(2);
- v.push_back(3);
- std::vector<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- StringMatchResultListener listener;
- ASSERT_FALSE(ExplainMatchResult(IsSupersetOf(expected), v, &listener))
- << listener.str();
- EXPECT_THAT(listener.str(),
- Eq("where the following matchers don't match any elements:\n"
- "matcher #0: is equal to 1"));
-
- v.push_back(1);
- listener.Clear();
- ASSERT_TRUE(ExplainMatchResult(IsSupersetOf(expected), v, &listener))
- << listener.str();
- EXPECT_THAT(listener.str(), Eq("where:\n"
- " - element #0 is matched by matcher #1,\n"
- " - element #2 is matched by matcher #0"));
-}
-
-TEST(IsSupersetOfTest, WorksForRhsInitializerList) {
- const int numbers[] = {1, 3, 6, 2, 4, 5};
- EXPECT_THAT(numbers, IsSupersetOf({1, 2}));
- EXPECT_THAT(numbers, Not(IsSupersetOf({3, 0})));
-}
-
-TEST(IsSupersetOfTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(IsSupersetOf({Pointee(1)})));
- helper.Call(MakeUniquePtrs({1, 2}));
- EXPECT_CALL(helper, Call(Not(IsSupersetOf({Pointee(1), Pointee(2)}))));
- helper.Call(MakeUniquePtrs({2}));
-}
-
-TEST(IsSubsetOfTest, WorksForNativeArray) {
- const int subset[] = {1, 4};
- const int superset[] = {1, 2, 4};
- const int disjoint[] = {1, 0, 3};
- EXPECT_THAT(subset, IsSubsetOf(subset));
- EXPECT_THAT(subset, IsSubsetOf(superset));
- EXPECT_THAT(superset, Not(IsSubsetOf(subset)));
- EXPECT_THAT(subset, Not(IsSubsetOf(disjoint)));
- EXPECT_THAT(disjoint, Not(IsSubsetOf(subset)));
-}
-
-TEST(IsSubsetOfTest, WorksWithDuplicates) {
- const int not_enough[] = {1, 2};
- const int enough[] = {1, 1, 2};
- const int actual[] = {1, 1};
- EXPECT_THAT(actual, Not(IsSubsetOf(not_enough)));
- EXPECT_THAT(actual, IsSubsetOf(enough));
-}
-
-TEST(IsSubsetOfTest, WorksForEmpty) {
- vector<int> numbers;
- vector<int> expected;
- EXPECT_THAT(numbers, IsSubsetOf(expected));
- expected.push_back(1);
- EXPECT_THAT(numbers, IsSubsetOf(expected));
- expected.clear();
- numbers.push_back(1);
- numbers.push_back(2);
- EXPECT_THAT(numbers, Not(IsSubsetOf(expected)));
- expected.push_back(1);
- EXPECT_THAT(numbers, Not(IsSubsetOf(expected)));
- expected.push_back(2);
- EXPECT_THAT(numbers, IsSubsetOf(expected));
- expected.push_back(3);
- EXPECT_THAT(numbers, IsSubsetOf(expected));
-}
-
-TEST(IsSubsetOfTest, WorksForStreamlike) {
- const int a[5] = {1, 2};
- Streamlike<int> s(std::begin(a), std::end(a));
-
- vector<int> expected;
- expected.push_back(1);
- EXPECT_THAT(s, Not(IsSubsetOf(expected)));
- expected.push_back(2);
- expected.push_back(5);
- EXPECT_THAT(s, IsSubsetOf(expected));
-}
-
-TEST(IsSubsetOfTest, TakesStlContainer) {
- const int actual[] = {3, 1, 2};
-
- ::std::list<int> expected;
- expected.push_back(1);
- expected.push_back(3);
- EXPECT_THAT(actual, Not(IsSubsetOf(expected)));
-
- expected.push_back(2);
- expected.push_back(4);
- EXPECT_THAT(actual, IsSubsetOf(expected));
-}
-
-TEST(IsSubsetOfTest, Describe) {
- typedef std::vector<int> IntVec;
- IntVec expected;
- expected.push_back(111);
- expected.push_back(222);
- expected.push_back(333);
-
- EXPECT_THAT(
- Describe<IntVec>(IsSubsetOf(expected)),
- Eq("an injection from elements to requirements exists such that:\n"
- " - an element is equal to 111\n"
- " - an element is equal to 222\n"
- " - an element is equal to 333"));
-}
-
-TEST(IsSubsetOfTest, DescribeNegation) {
- typedef std::vector<int> IntVec;
- IntVec expected;
- expected.push_back(111);
- expected.push_back(222);
- expected.push_back(333);
- EXPECT_THAT(
- DescribeNegation<IntVec>(IsSubsetOf(expected)),
- Eq("no injection from elements to requirements exists such that:\n"
- " - an element is equal to 111\n"
- " - an element is equal to 222\n"
- " - an element is equal to 333"));
-}
-
-TEST(IsSubsetOfTest, MatchAndExplain) {
- std::vector<int> v;
- v.push_back(2);
- v.push_back(3);
- std::vector<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- StringMatchResultListener listener;
- ASSERT_FALSE(ExplainMatchResult(IsSubsetOf(expected), v, &listener))
- << listener.str();
- EXPECT_THAT(listener.str(),
- Eq("where the following elements don't match any matchers:\n"
- "element #1: 3"));
-
- expected.push_back(3);
- listener.Clear();
- ASSERT_TRUE(ExplainMatchResult(IsSubsetOf(expected), v, &listener))
- << listener.str();
- EXPECT_THAT(listener.str(), Eq("where:\n"
- " - element #0 is matched by matcher #1,\n"
- " - element #1 is matched by matcher #2"));
-}
-
-TEST(IsSubsetOfTest, WorksForRhsInitializerList) {
- const int numbers[] = {1, 2, 3};
- EXPECT_THAT(numbers, IsSubsetOf({1, 2, 3, 4}));
- EXPECT_THAT(numbers, Not(IsSubsetOf({1, 2})));
-}
-
-TEST(IsSubsetOfTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(IsSubsetOf({Pointee(1), Pointee(2)})));
- helper.Call(MakeUniquePtrs({1}));
- EXPECT_CALL(helper, Call(Not(IsSubsetOf({Pointee(1)}))));
- helper.Call(MakeUniquePtrs({2}));
-}
-
-// Tests using ElementsAre() and ElementsAreArray() with stream-like
-// "containers".
-
-TEST(ElemensAreStreamTest, WorksForStreamlike) {
- const int a[5] = {1, 2, 3, 4, 5};
- Streamlike<int> s(std::begin(a), std::end(a));
- EXPECT_THAT(s, ElementsAre(1, 2, 3, 4, 5));
- EXPECT_THAT(s, Not(ElementsAre(2, 1, 4, 5, 3)));
-}
-
-TEST(ElemensAreArrayStreamTest, WorksForStreamlike) {
- const int a[5] = {1, 2, 3, 4, 5};
- Streamlike<int> s(std::begin(a), std::end(a));
-
- vector<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- expected.push_back(3);
- expected.push_back(4);
- expected.push_back(5);
- EXPECT_THAT(s, ElementsAreArray(expected));
-
- expected[3] = 0;
- EXPECT_THAT(s, Not(ElementsAreArray(expected)));
-}
-
-TEST(ElementsAreTest, WorksWithUncopyable) {
- Uncopyable objs[2];
- objs[0].set_value(-3);
- objs[1].set_value(1);
- EXPECT_THAT(objs, ElementsAre(UncopyableIs(-3), Truly(ValueIsPositive)));
-}
-
-TEST(ElementsAreTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(ElementsAre(Pointee(1), Pointee(2))));
- helper.Call(MakeUniquePtrs({1, 2}));
-
- EXPECT_CALL(helper, Call(ElementsAreArray({Pointee(3), Pointee(4)})));
- helper.Call(MakeUniquePtrs({3, 4}));
-}
-
-TEST(ElementsAreTest, TakesStlContainer) {
- const int actual[] = {3, 1, 2};
-
- ::std::list<int> expected;
- expected.push_back(3);
- expected.push_back(1);
- expected.push_back(2);
- EXPECT_THAT(actual, ElementsAreArray(expected));
-
- expected.push_back(4);
- EXPECT_THAT(actual, Not(ElementsAreArray(expected)));
-}
-
-// Tests for UnorderedElementsAreArray()
-
-TEST(UnorderedElementsAreArrayTest, SucceedsWhenExpected) {
- const int a[] = {0, 1, 2, 3, 4};
- std::vector<int> s(std::begin(a), std::end(a));
- do {
- StringMatchResultListener listener;
- EXPECT_TRUE(ExplainMatchResult(UnorderedElementsAreArray(a),
- s, &listener)) << listener.str();
- } while (std::next_permutation(s.begin(), s.end()));
-}
-
-TEST(UnorderedElementsAreArrayTest, VectorBool) {
- const bool a[] = {0, 1, 0, 1, 1};
- const bool b[] = {1, 0, 1, 1, 0};
- std::vector<bool> expected(std::begin(a), std::end(a));
- std::vector<bool> actual(std::begin(b), std::end(b));
- StringMatchResultListener listener;
- EXPECT_TRUE(ExplainMatchResult(UnorderedElementsAreArray(expected),
- actual, &listener)) << listener.str();
-}
-
-TEST(UnorderedElementsAreArrayTest, WorksForStreamlike) {
- // Streamlike 'container' provides only minimal iterator support.
- // Its iterators are tagged with input_iterator_tag, and it has no
- // size() or empty() methods.
- const int a[5] = {2, 1, 4, 5, 3};
- Streamlike<int> s(std::begin(a), std::end(a));
-
- ::std::vector<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- expected.push_back(3);
- expected.push_back(4);
- expected.push_back(5);
- EXPECT_THAT(s, UnorderedElementsAreArray(expected));
-
- expected.push_back(6);
- EXPECT_THAT(s, Not(UnorderedElementsAreArray(expected)));
-}
-
-TEST(UnorderedElementsAreArrayTest, TakesStlContainer) {
- const int actual[] = {3, 1, 2};
-
- ::std::list<int> expected;
- expected.push_back(1);
- expected.push_back(2);
- expected.push_back(3);
- EXPECT_THAT(actual, UnorderedElementsAreArray(expected));
-
- expected.push_back(4);
- EXPECT_THAT(actual, Not(UnorderedElementsAreArray(expected)));
-}
-
-
-TEST(UnorderedElementsAreArrayTest, TakesInitializerList) {
- const int a[5] = {2, 1, 4, 5, 3};
- EXPECT_THAT(a, UnorderedElementsAreArray({1, 2, 3, 4, 5}));
- EXPECT_THAT(a, Not(UnorderedElementsAreArray({1, 2, 3, 4, 6})));
-}
-
-TEST(UnorderedElementsAreArrayTest, TakesInitializerListOfCStrings) {
- const std::string a[5] = {"a", "b", "c", "d", "e"};
- EXPECT_THAT(a, UnorderedElementsAreArray({"a", "b", "c", "d", "e"}));
- EXPECT_THAT(a, Not(UnorderedElementsAreArray({"a", "b", "c", "d", "ef"})));
-}
-
-TEST(UnorderedElementsAreArrayTest, TakesInitializerListOfSameTypedMatchers) {
- const int a[5] = {2, 1, 4, 5, 3};
- EXPECT_THAT(a, UnorderedElementsAreArray(
- {Eq(1), Eq(2), Eq(3), Eq(4), Eq(5)}));
- EXPECT_THAT(a, Not(UnorderedElementsAreArray(
- {Eq(1), Eq(2), Eq(3), Eq(4), Eq(6)})));
-}
-
-TEST(UnorderedElementsAreArrayTest,
- TakesInitializerListOfDifferentTypedMatchers) {
- const int a[5] = {2, 1, 4, 5, 3};
- // The compiler cannot infer the type of the initializer list if its
- // elements have different types. We must explicitly specify the
- // unified element type in this case.
- EXPECT_THAT(a, UnorderedElementsAreArray<Matcher<int> >(
- {Eq(1), Ne(-2), Ge(3), Le(4), Eq(5)}));
- EXPECT_THAT(a, Not(UnorderedElementsAreArray<Matcher<int> >(
- {Eq(1), Ne(-2), Ge(3), Le(4), Eq(6)})));
-}
-
-
-TEST(UnorderedElementsAreArrayTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper,
- Call(UnorderedElementsAreArray({Pointee(1), Pointee(2)})));
- helper.Call(MakeUniquePtrs({2, 1}));
-}
-
-class UnorderedElementsAreTest : public testing::Test {
- protected:
- typedef std::vector<int> IntVec;
-};
-
-TEST_F(UnorderedElementsAreTest, WorksWithUncopyable) {
- Uncopyable objs[2];
- objs[0].set_value(-3);
- objs[1].set_value(1);
- EXPECT_THAT(objs,
- UnorderedElementsAre(Truly(ValueIsPositive), UncopyableIs(-3)));
-}
-
-TEST_F(UnorderedElementsAreTest, SucceedsWhenExpected) {
- const int a[] = {1, 2, 3};
- std::vector<int> s(std::begin(a), std::end(a));
- do {
- StringMatchResultListener listener;
- EXPECT_TRUE(ExplainMatchResult(UnorderedElementsAre(1, 2, 3),
- s, &listener)) << listener.str();
- } while (std::next_permutation(s.begin(), s.end()));
-}
-
-TEST_F(UnorderedElementsAreTest, FailsWhenAnElementMatchesNoMatcher) {
- const int a[] = {1, 2, 3};
- std::vector<int> s(std::begin(a), std::end(a));
- std::vector<Matcher<int> > mv;
- mv.push_back(1);
- mv.push_back(2);
- mv.push_back(2);
- // The element with value '3' matches nothing: fail fast.
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAreArray(mv),
- s, &listener)) << listener.str();
-}
-
-TEST_F(UnorderedElementsAreTest, WorksForStreamlike) {
- // Streamlike 'container' provides only minimal iterator support.
- // Its iterators are tagged with input_iterator_tag, and it has no
- // size() or empty() methods.
- const int a[5] = {2, 1, 4, 5, 3};
- Streamlike<int> s(std::begin(a), std::end(a));
-
- EXPECT_THAT(s, UnorderedElementsAre(1, 2, 3, 4, 5));
- EXPECT_THAT(s, Not(UnorderedElementsAre(2, 2, 3, 4, 5)));
-}
-
-TEST_F(UnorderedElementsAreTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(UnorderedElementsAre(Pointee(1), Pointee(2))));
- helper.Call(MakeUniquePtrs({2, 1}));
-}
-
-// One naive implementation of the matcher runs in O(N!) time, which is too
-// slow for many real-world inputs. This test shows that our matcher can match
-// 100 inputs very quickly (a few milliseconds). An O(100!) is 10^158
-// iterations and obviously effectively incomputable.
-// [ RUN ] UnorderedElementsAreTest.Performance
-// [ OK ] UnorderedElementsAreTest.Performance (4 ms)
-TEST_F(UnorderedElementsAreTest, Performance) {
- std::vector<int> s;
- std::vector<Matcher<int> > mv;
- for (int i = 0; i < 100; ++i) {
- s.push_back(i);
- mv.push_back(_);
- }
- mv[50] = Eq(0);
- StringMatchResultListener listener;
- EXPECT_TRUE(ExplainMatchResult(UnorderedElementsAreArray(mv),
- s, &listener)) << listener.str();
-}
-
-// Another variant of 'Performance' with similar expectations.
-// [ RUN ] UnorderedElementsAreTest.PerformanceHalfStrict
-// [ OK ] UnorderedElementsAreTest.PerformanceHalfStrict (4 ms)
-TEST_F(UnorderedElementsAreTest, PerformanceHalfStrict) {
- std::vector<int> s;
- std::vector<Matcher<int> > mv;
- for (int i = 0; i < 100; ++i) {
- s.push_back(i);
- if (i & 1) {
- mv.push_back(_);
- } else {
- mv.push_back(i);
- }
- }
- StringMatchResultListener listener;
- EXPECT_TRUE(ExplainMatchResult(UnorderedElementsAreArray(mv),
- s, &listener)) << listener.str();
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageCountWrong) {
- std::vector<int> v;
- v.push_back(4);
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAre(1, 2, 3),
- v, &listener)) << listener.str();
- EXPECT_THAT(listener.str(), Eq("which has 1 element"));
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageCountWrongZero) {
- std::vector<int> v;
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAre(1, 2, 3),
- v, &listener)) << listener.str();
- EXPECT_THAT(listener.str(), Eq(""));
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageUnmatchedMatchers) {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(1);
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAre(1, 2),
- v, &listener)) << listener.str();
- EXPECT_THAT(
- listener.str(),
- Eq("where the following matchers don't match any elements:\n"
- "matcher #1: is equal to 2"));
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageUnmatchedElements) {
- std::vector<int> v;
- v.push_back(1);
- v.push_back(2);
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAre(1, 1),
- v, &listener)) << listener.str();
- EXPECT_THAT(
- listener.str(),
- Eq("where the following elements don't match any matchers:\n"
- "element #1: 2"));
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageUnmatchedMatcherAndElement) {
- std::vector<int> v;
- v.push_back(2);
- v.push_back(3);
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(UnorderedElementsAre(1, 2),
- v, &listener)) << listener.str();
- EXPECT_THAT(
- listener.str(),
- Eq("where"
- " the following matchers don't match any elements:\n"
- "matcher #0: is equal to 1\n"
- "and"
- " where"
- " the following elements don't match any matchers:\n"
- "element #1: 3"));
-}
-
-// Test helper for formatting element, matcher index pairs in expectations.
-static std::string EMString(int element, int matcher) {
- stringstream ss;
- ss << "(element #" << element << ", matcher #" << matcher << ")";
- return ss.str();
-}
-
-TEST_F(UnorderedElementsAreTest, FailMessageImperfectMatchOnly) {
- // A situation where all elements and matchers have a match
- // associated with them, but the max matching is not perfect.
- std::vector<std::string> v;
- v.push_back("a");
- v.push_back("b");
- v.push_back("c");
- StringMatchResultListener listener;
- EXPECT_FALSE(ExplainMatchResult(
- UnorderedElementsAre("a", "a", AnyOf("b", "c")), v, &listener))
- << listener.str();
-
- std::string prefix =
- "where no permutation of the elements can satisfy all matchers, "
- "and the closest match is 2 of 3 matchers with the "
- "pairings:\n";
-
- // We have to be a bit loose here, because there are 4 valid max matches.
- EXPECT_THAT(
- listener.str(),
- AnyOf(prefix + "{\n " + EMString(0, 0) +
- ",\n " + EMString(1, 2) + "\n}",
- prefix + "{\n " + EMString(0, 1) +
- ",\n " + EMString(1, 2) + "\n}",
- prefix + "{\n " + EMString(0, 0) +
- ",\n " + EMString(2, 2) + "\n}",
- prefix + "{\n " + EMString(0, 1) +
- ",\n " + EMString(2, 2) + "\n}"));
-}
-
-TEST_F(UnorderedElementsAreTest, Describe) {
- EXPECT_THAT(Describe<IntVec>(UnorderedElementsAre()),
- Eq("is empty"));
- EXPECT_THAT(
- Describe<IntVec>(UnorderedElementsAre(345)),
- Eq("has 1 element and that element is equal to 345"));
- EXPECT_THAT(
- Describe<IntVec>(UnorderedElementsAre(111, 222, 333)),
- Eq("has 3 elements and there exists some permutation "
- "of elements such that:\n"
- " - element #0 is equal to 111, and\n"
- " - element #1 is equal to 222, and\n"
- " - element #2 is equal to 333"));
-}
-
-TEST_F(UnorderedElementsAreTest, DescribeNegation) {
- EXPECT_THAT(DescribeNegation<IntVec>(UnorderedElementsAre()),
- Eq("isn't empty"));
- EXPECT_THAT(
- DescribeNegation<IntVec>(UnorderedElementsAre(345)),
- Eq("doesn't have 1 element, or has 1 element that isn't equal to 345"));
- EXPECT_THAT(
- DescribeNegation<IntVec>(UnorderedElementsAre(123, 234, 345)),
- Eq("doesn't have 3 elements, or there exists no permutation "
- "of elements such that:\n"
- " - element #0 is equal to 123, and\n"
- " - element #1 is equal to 234, and\n"
- " - element #2 is equal to 345"));
-}
-
-namespace {
-
-// Used as a check on the more complex max flow method used in the
-// real testing::internal::FindMaxBipartiteMatching. This method is
-// compatible but runs in worst-case factorial time, so we only
-// use it in testing for small problem sizes.
-template <typename Graph>
-class BacktrackingMaxBPMState {
- public:
- // Does not take ownership of 'g'.
- explicit BacktrackingMaxBPMState(const Graph* g) : graph_(g) { }
-
- ElementMatcherPairs Compute() {
- if (graph_->LhsSize() == 0 || graph_->RhsSize() == 0) {
- return best_so_far_;
- }
- lhs_used_.assign(graph_->LhsSize(), kUnused);
- rhs_used_.assign(graph_->RhsSize(), kUnused);
- for (size_t irhs = 0; irhs < graph_->RhsSize(); ++irhs) {
- matches_.clear();
- RecurseInto(irhs);
- if (best_so_far_.size() == graph_->RhsSize())
- break;
- }
- return best_so_far_;
- }
-
- private:
- static const size_t kUnused = static_cast<size_t>(-1);
-
- void PushMatch(size_t lhs, size_t rhs) {
- matches_.push_back(ElementMatcherPair(lhs, rhs));
- lhs_used_[lhs] = rhs;
- rhs_used_[rhs] = lhs;
- if (matches_.size() > best_so_far_.size()) {
- best_so_far_ = matches_;
- }
- }
-
- void PopMatch() {
- const ElementMatcherPair& back = matches_.back();
- lhs_used_[back.first] = kUnused;
- rhs_used_[back.second] = kUnused;
- matches_.pop_back();
- }
-
- bool RecurseInto(size_t irhs) {
- if (rhs_used_[irhs] != kUnused) {
- return true;
- }
- for (size_t ilhs = 0; ilhs < graph_->LhsSize(); ++ilhs) {
- if (lhs_used_[ilhs] != kUnused) {
- continue;
- }
- if (!graph_->HasEdge(ilhs, irhs)) {
- continue;
- }
- PushMatch(ilhs, irhs);
- if (best_so_far_.size() == graph_->RhsSize()) {
- return false;
- }
- for (size_t mi = irhs + 1; mi < graph_->RhsSize(); ++mi) {
- if (!RecurseInto(mi)) return false;
- }
- PopMatch();
- }
- return true;
- }
-
- const Graph* graph_; // not owned
- std::vector<size_t> lhs_used_;
- std::vector<size_t> rhs_used_;
- ElementMatcherPairs matches_;
- ElementMatcherPairs best_so_far_;
-};
-
-template <typename Graph>
-const size_t BacktrackingMaxBPMState<Graph>::kUnused;
-
-} // namespace
-
-// Implement a simple backtracking algorithm to determine if it is possible
-// to find one element per matcher, without reusing elements.
-template <typename Graph>
-ElementMatcherPairs
-FindBacktrackingMaxBPM(const Graph& g) {
- return BacktrackingMaxBPMState<Graph>(&g).Compute();
-}
-
-class BacktrackingBPMTest : public ::testing::Test { };
-
-// Tests the MaxBipartiteMatching algorithm with square matrices.
-// The single int param is the # of nodes on each of the left and right sides.
-class BipartiteTest : public ::testing::TestWithParam<size_t> {};
-
-// Verify all match graphs up to some moderate number of edges.
-TEST_P(BipartiteTest, Exhaustive) {
- size_t nodes = GetParam();
- MatchMatrix graph(nodes, nodes);
- do {
- ElementMatcherPairs matches =
- internal::FindMaxBipartiteMatching(graph);
- EXPECT_EQ(FindBacktrackingMaxBPM(graph).size(), matches.size())
- << "graph: " << graph.DebugString();
- // Check that all elements of matches are in the graph.
- // Check that elements of first and second are unique.
- std::vector<bool> seen_element(graph.LhsSize());
- std::vector<bool> seen_matcher(graph.RhsSize());
- SCOPED_TRACE(PrintToString(matches));
- for (size_t i = 0; i < matches.size(); ++i) {
- size_t ilhs = matches[i].first;
- size_t irhs = matches[i].second;
- EXPECT_TRUE(graph.HasEdge(ilhs, irhs));
- EXPECT_FALSE(seen_element[ilhs]);
- EXPECT_FALSE(seen_matcher[irhs]);
- seen_element[ilhs] = true;
- seen_matcher[irhs] = true;
- }
- } while (graph.NextGraph());
-}
-
-INSTANTIATE_TEST_SUITE_P(AllGraphs, BipartiteTest,
- ::testing::Range(size_t{0}, size_t{5}));
-
-// Parameterized by a pair interpreted as (LhsSize, RhsSize).
-class BipartiteNonSquareTest
- : public ::testing::TestWithParam<std::pair<size_t, size_t> > {
-};
-
-TEST_F(BipartiteNonSquareTest, SimpleBacktracking) {
- // .......
- // 0:-----\ :
- // 1:---\ | :
- // 2:---\ | :
- // 3:-\ | | :
- // :.......:
- // 0 1 2
- MatchMatrix g(4, 3);
- constexpr std::array<std::array<size_t, 2>, 4> kEdges = {
- {{{0, 2}}, {{1, 1}}, {{2, 1}}, {{3, 0}}}};
- for (size_t i = 0; i < kEdges.size(); ++i) {
- g.SetEdge(kEdges[i][0], kEdges[i][1], true);
- }
- EXPECT_THAT(FindBacktrackingMaxBPM(g),
- ElementsAre(Pair(3, 0),
- Pair(AnyOf(1, 2), 1),
- Pair(0, 2))) << g.DebugString();
-}
-
-// Verify a few nonsquare matrices.
-TEST_P(BipartiteNonSquareTest, Exhaustive) {
- size_t nlhs = GetParam().first;
- size_t nrhs = GetParam().second;
- MatchMatrix graph(nlhs, nrhs);
- do {
- EXPECT_EQ(FindBacktrackingMaxBPM(graph).size(),
- internal::FindMaxBipartiteMatching(graph).size())
- << "graph: " << graph.DebugString()
- << "\nbacktracking: "
- << PrintToString(FindBacktrackingMaxBPM(graph))
- << "\nmax flow: "
- << PrintToString(internal::FindMaxBipartiteMatching(graph));
- } while (graph.NextGraph());
-}
-
-INSTANTIATE_TEST_SUITE_P(AllGraphs, BipartiteNonSquareTest,
- testing::Values(
- std::make_pair(1, 2),
- std::make_pair(2, 1),
- std::make_pair(3, 2),
- std::make_pair(2, 3),
- std::make_pair(4, 1),
- std::make_pair(1, 4),
- std::make_pair(4, 3),
- std::make_pair(3, 4)));
-
-class BipartiteRandomTest
- : public ::testing::TestWithParam<std::pair<int, int> > {
-};
-
-// Verifies a large sample of larger graphs.
-TEST_P(BipartiteRandomTest, LargerNets) {
- int nodes = GetParam().first;
- int iters = GetParam().second;
- MatchMatrix graph(static_cast<size_t>(nodes), static_cast<size_t>(nodes));
-
- auto seed = static_cast<uint32_t>(GTEST_FLAG_GET(random_seed));
- if (seed == 0) {
- seed = static_cast<uint32_t>(time(nullptr));
- }
-
- for (; iters > 0; --iters, ++seed) {
- srand(static_cast<unsigned int>(seed));
- graph.Randomize();
- EXPECT_EQ(FindBacktrackingMaxBPM(graph).size(),
- internal::FindMaxBipartiteMatching(graph).size())
- << " graph: " << graph.DebugString()
- << "\nTo reproduce the failure, rerun the test with the flag"
- " --" << GTEST_FLAG_PREFIX_ << "random_seed=" << seed;
- }
-}
-
-// Test argument is a std::pair<int, int> representing (nodes, iters).
-INSTANTIATE_TEST_SUITE_P(Samples, BipartiteRandomTest,
- testing::Values(
- std::make_pair(5, 10000),
- std::make_pair(6, 5000),
- std::make_pair(7, 2000),
- std::make_pair(8, 500),
- std::make_pair(9, 100)));
-
-// Tests IsReadableTypeName().
-
-TEST(IsReadableTypeNameTest, ReturnsTrueForShortNames) {
- EXPECT_TRUE(IsReadableTypeName("int"));
- EXPECT_TRUE(IsReadableTypeName("const unsigned char*"));
- EXPECT_TRUE(IsReadableTypeName("MyMap<int, void*>"));
- EXPECT_TRUE(IsReadableTypeName("void (*)(int, bool)"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsTrueForLongNonTemplateNonFunctionNames) {
- EXPECT_TRUE(IsReadableTypeName("my_long_namespace::MyClassName"));
- EXPECT_TRUE(IsReadableTypeName("int [5][6][7][8][9][10][11]"));
- EXPECT_TRUE(IsReadableTypeName("my_namespace::MyOuterClass::MyInnerClass"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsFalseForLongTemplateNames) {
- EXPECT_FALSE(
- IsReadableTypeName("basic_string<char, std::char_traits<char> >"));
- EXPECT_FALSE(IsReadableTypeName("std::vector<int, std::alloc_traits<int> >"));
-}
-
-TEST(IsReadableTypeNameTest, ReturnsFalseForLongFunctionTypeNames) {
- EXPECT_FALSE(IsReadableTypeName("void (&)(int, bool, char, float)"));
-}
-
-// Tests FormatMatcherDescription().
-
-TEST(FormatMatcherDescriptionTest, WorksForEmptyDescription) {
- EXPECT_EQ("is even",
- FormatMatcherDescription(false, "IsEven", {}, Strings()));
- EXPECT_EQ("not (is even)",
- FormatMatcherDescription(true, "IsEven", {}, Strings()));
-
- EXPECT_EQ("equals (a: 5)",
- FormatMatcherDescription(false, "Equals", {"a"}, {"5"}));
-
- EXPECT_EQ(
- "is in range (a: 5, b: 8)",
- FormatMatcherDescription(false, "IsInRange", {"a", "b"}, {"5", "8"}));
-}
-
-// Tests PolymorphicMatcher::mutable_impl().
-TEST(PolymorphicMatcherTest, CanAccessMutableImpl) {
- PolymorphicMatcher<DivisibleByImpl> m(DivisibleByImpl(42));
- DivisibleByImpl& impl = m.mutable_impl();
- EXPECT_EQ(42, impl.divider());
-
- impl.set_divider(0);
- EXPECT_EQ(0, m.mutable_impl().divider());
-}
-
-// Tests PolymorphicMatcher::impl().
-TEST(PolymorphicMatcherTest, CanAccessImpl) {
- const PolymorphicMatcher<DivisibleByImpl> m(DivisibleByImpl(42));
- const DivisibleByImpl& impl = m.impl();
- EXPECT_EQ(42, impl.divider());
-}
-
-TEST(MatcherTupleTest, ExplainsMatchFailure) {
- stringstream ss1;
- ExplainMatchFailureTupleTo(
- std::make_tuple(Matcher<char>(Eq('a')), GreaterThan(5)),
- std::make_tuple('a', 10), &ss1);
- EXPECT_EQ("", ss1.str()); // Successful match.
-
- stringstream ss2;
- ExplainMatchFailureTupleTo(
- std::make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- std::make_tuple(2, 'b'), &ss2);
- EXPECT_EQ(" Expected arg #0: is > 5\n"
- " Actual: 2, which is 3 less than 5\n"
- " Expected arg #1: is equal to 'a' (97, 0x61)\n"
- " Actual: 'b' (98, 0x62)\n",
- ss2.str()); // Failed match where both arguments need explanation.
-
- stringstream ss3;
- ExplainMatchFailureTupleTo(
- std::make_tuple(GreaterThan(5), Matcher<char>(Eq('a'))),
- std::make_tuple(2, 'a'), &ss3);
- EXPECT_EQ(" Expected arg #0: is > 5\n"
- " Actual: 2, which is 3 less than 5\n",
- ss3.str()); // Failed match where only one argument needs
- // explanation.
-}
-
-// Tests Each().
-
-TEST(EachTest, ExplainsMatchResultCorrectly) {
- set<int> a; // empty
-
- Matcher<set<int> > m = Each(2);
- EXPECT_EQ("", Explain(m, a));
-
- Matcher<const int(&)[1]> n = Each(1); // NOLINT
-
- const int b[1] = {1};
- EXPECT_EQ("", Explain(n, b));
-
- n = Each(3);
- EXPECT_EQ("whose element #0 doesn't match", Explain(n, b));
-
- a.insert(1);
- a.insert(2);
- a.insert(3);
- m = Each(GreaterThan(0));
- EXPECT_EQ("", Explain(m, a));
-
- m = Each(GreaterThan(10));
- EXPECT_EQ("whose element #0 doesn't match, which is 9 less than 10",
- Explain(m, a));
-}
-
-TEST(EachTest, DescribesItselfCorrectly) {
- Matcher<vector<int> > m = Each(1);
- EXPECT_EQ("only contains elements that is equal to 1", Describe(m));
-
- Matcher<vector<int> > m2 = Not(m);
- EXPECT_EQ("contains some element that isn't equal to 1", Describe(m2));
-}
-
-TEST(EachTest, MatchesVectorWhenAllElementsMatch) {
- vector<int> some_vector;
- EXPECT_THAT(some_vector, Each(1));
- some_vector.push_back(3);
- EXPECT_THAT(some_vector, Not(Each(1)));
- EXPECT_THAT(some_vector, Each(3));
- some_vector.push_back(1);
- some_vector.push_back(2);
- EXPECT_THAT(some_vector, Not(Each(3)));
- EXPECT_THAT(some_vector, Each(Lt(3.5)));
-
- vector<std::string> another_vector;
- another_vector.push_back("fee");
- EXPECT_THAT(another_vector, Each(std::string("fee")));
- another_vector.push_back("fie");
- another_vector.push_back("foe");
- another_vector.push_back("fum");
- EXPECT_THAT(another_vector, Not(Each(std::string("fee"))));
-}
-
-TEST(EachTest, MatchesMapWhenAllElementsMatch) {
- map<const char*, int> my_map;
- const char* bar = "a string";
- my_map[bar] = 2;
- EXPECT_THAT(my_map, Each(make_pair(bar, 2)));
-
- map<std::string, int> another_map;
- EXPECT_THAT(another_map, Each(make_pair(std::string("fee"), 1)));
- another_map["fee"] = 1;
- EXPECT_THAT(another_map, Each(make_pair(std::string("fee"), 1)));
- another_map["fie"] = 2;
- another_map["foe"] = 3;
- another_map["fum"] = 4;
- EXPECT_THAT(another_map, Not(Each(make_pair(std::string("fee"), 1))));
- EXPECT_THAT(another_map, Not(Each(make_pair(std::string("fum"), 1))));
- EXPECT_THAT(another_map, Each(Pair(_, Gt(0))));
-}
-
-TEST(EachTest, AcceptsMatcher) {
- const int a[] = {1, 2, 3};
- EXPECT_THAT(a, Each(Gt(0)));
- EXPECT_THAT(a, Not(Each(Gt(1))));
-}
-
-TEST(EachTest, WorksForNativeArrayAsTuple) {
- const int a[] = {1, 2};
- const int* const pointer = a;
- EXPECT_THAT(std::make_tuple(pointer, 2), Each(Gt(0)));
- EXPECT_THAT(std::make_tuple(pointer, 2), Not(Each(Gt(1))));
-}
-
-TEST(EachTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(Each(Pointee(Gt(0)))));
- helper.Call(MakeUniquePtrs({1, 2}));
-}
-
-// For testing Pointwise().
-class IsHalfOfMatcher {
- public:
- template <typename T1, typename T2>
- bool MatchAndExplain(const std::tuple<T1, T2>& a_pair,
- MatchResultListener* listener) const {
- if (std::get<0>(a_pair) == std::get<1>(a_pair) / 2) {
- *listener << "where the second is " << std::get<1>(a_pair);
- return true;
- } else {
- *listener << "where the second/2 is " << std::get<1>(a_pair) / 2;
- return false;
- }
- }
-
- void DescribeTo(ostream* os) const {
- *os << "are a pair where the first is half of the second";
- }
-
- void DescribeNegationTo(ostream* os) const {
- *os << "are a pair where the first isn't half of the second";
- }
-};
-
-PolymorphicMatcher<IsHalfOfMatcher> IsHalfOf() {
- return MakePolymorphicMatcher(IsHalfOfMatcher());
-}
-
-TEST(PointwiseTest, DescribesSelf) {
- vector<int> rhs;
- rhs.push_back(1);
- rhs.push_back(2);
- rhs.push_back(3);
- const Matcher<const vector<int>&> m = Pointwise(IsHalfOf(), rhs);
- EXPECT_EQ("contains 3 values, where each value and its corresponding value "
- "in { 1, 2, 3 } are a pair where the first is half of the second",
- Describe(m));
- EXPECT_EQ("doesn't contain exactly 3 values, or contains a value x at some "
- "index i where x and the i-th value of { 1, 2, 3 } are a pair "
- "where the first isn't half of the second",
- DescribeNegation(m));
-}
-
-TEST(PointwiseTest, MakesCopyOfRhs) {
- list<signed char> rhs;
- rhs.push_back(2);
- rhs.push_back(4);
-
- int lhs[] = {1, 2};
- const Matcher<const int (&)[2]> m = Pointwise(IsHalfOf(), rhs);
- EXPECT_THAT(lhs, m);
-
- // Changing rhs now shouldn't affect m, which made a copy of rhs.
- rhs.push_back(6);
- EXPECT_THAT(lhs, m);
-}
-
-TEST(PointwiseTest, WorksForLhsNativeArray) {
- const int lhs[] = {1, 2, 3};
- vector<int> rhs;
- rhs.push_back(2);
- rhs.push_back(4);
- rhs.push_back(6);
- EXPECT_THAT(lhs, Pointwise(Lt(), rhs));
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs)));
-}
-
-TEST(PointwiseTest, WorksForRhsNativeArray) {
- const int rhs[] = {1, 2, 3};
- vector<int> lhs;
- lhs.push_back(2);
- lhs.push_back(4);
- lhs.push_back(6);
- EXPECT_THAT(lhs, Pointwise(Gt(), rhs));
- EXPECT_THAT(lhs, Not(Pointwise(Lt(), rhs)));
-}
-
-// Test is effective only with sanitizers.
-TEST(PointwiseTest, WorksForVectorOfBool) {
- vector<bool> rhs(3, false);
- rhs[1] = true;
- vector<bool> lhs = rhs;
- EXPECT_THAT(lhs, Pointwise(Eq(), rhs));
- rhs[0] = true;
- EXPECT_THAT(lhs, Not(Pointwise(Eq(), rhs)));
-}
-
-
-TEST(PointwiseTest, WorksForRhsInitializerList) {
- const vector<int> lhs{2, 4, 6};
- EXPECT_THAT(lhs, Pointwise(Gt(), {1, 2, 3}));
- EXPECT_THAT(lhs, Not(Pointwise(Lt(), {3, 3, 7})));
-}
-
-
-TEST(PointwiseTest, RejectsWrongSize) {
- const double lhs[2] = {1, 2};
- const int rhs[1] = {0};
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs)));
- EXPECT_EQ("which contains 2 values",
- Explain(Pointwise(Gt(), rhs), lhs));
-
- const int rhs2[3] = {0, 1, 2};
- EXPECT_THAT(lhs, Not(Pointwise(Gt(), rhs2)));
-}
-
-TEST(PointwiseTest, RejectsWrongContent) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {2, 6, 4};
- EXPECT_THAT(lhs, Not(Pointwise(IsHalfOf(), rhs)));
- EXPECT_EQ("where the value pair (2, 6) at index #1 don't match, "
- "where the second/2 is 3",
- Explain(Pointwise(IsHalfOf(), rhs), lhs));
-}
-
-TEST(PointwiseTest, AcceptsCorrectContent) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {2, 4, 6};
- EXPECT_THAT(lhs, Pointwise(IsHalfOf(), rhs));
- EXPECT_EQ("", Explain(Pointwise(IsHalfOf(), rhs), lhs));
-}
-
-TEST(PointwiseTest, AllowsMonomorphicInnerMatcher) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {2, 4, 6};
- const Matcher<std::tuple<const double&, const int&>> m1 = IsHalfOf();
- EXPECT_THAT(lhs, Pointwise(m1, rhs));
- EXPECT_EQ("", Explain(Pointwise(m1, rhs), lhs));
-
- // This type works as a std::tuple<const double&, const int&> can be
- // implicitly cast to std::tuple<double, int>.
- const Matcher<std::tuple<double, int>> m2 = IsHalfOf();
- EXPECT_THAT(lhs, Pointwise(m2, rhs));
- EXPECT_EQ("", Explain(Pointwise(m2, rhs), lhs));
-}
-
-MATCHER(PointeeEquals, "Points to an equal value") {
- return ExplainMatchResult(::testing::Pointee(::testing::get<1>(arg)),
- ::testing::get<0>(arg), result_listener);
-}
-
-TEST(PointwiseTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(Pointwise(PointeeEquals(), std::vector<int>{1, 2})));
- helper.Call(MakeUniquePtrs({1, 2}));
-}
-
-TEST(UnorderedPointwiseTest, DescribesSelf) {
- vector<int> rhs;
- rhs.push_back(1);
- rhs.push_back(2);
- rhs.push_back(3);
- const Matcher<const vector<int>&> m = UnorderedPointwise(IsHalfOf(), rhs);
- EXPECT_EQ(
- "has 3 elements and there exists some permutation of elements such "
- "that:\n"
- " - element #0 and 1 are a pair where the first is half of the second, "
- "and\n"
- " - element #1 and 2 are a pair where the first is half of the second, "
- "and\n"
- " - element #2 and 3 are a pair where the first is half of the second",
- Describe(m));
- EXPECT_EQ(
- "doesn't have 3 elements, or there exists no permutation of elements "
- "such that:\n"
- " - element #0 and 1 are a pair where the first is half of the second, "
- "and\n"
- " - element #1 and 2 are a pair where the first is half of the second, "
- "and\n"
- " - element #2 and 3 are a pair where the first is half of the second",
- DescribeNegation(m));
-}
-
-TEST(UnorderedPointwiseTest, MakesCopyOfRhs) {
- list<signed char> rhs;
- rhs.push_back(2);
- rhs.push_back(4);
-
- int lhs[] = {2, 1};
- const Matcher<const int (&)[2]> m = UnorderedPointwise(IsHalfOf(), rhs);
- EXPECT_THAT(lhs, m);
-
- // Changing rhs now shouldn't affect m, which made a copy of rhs.
- rhs.push_back(6);
- EXPECT_THAT(lhs, m);
-}
-
-TEST(UnorderedPointwiseTest, WorksForLhsNativeArray) {
- const int lhs[] = {1, 2, 3};
- vector<int> rhs;
- rhs.push_back(4);
- rhs.push_back(6);
- rhs.push_back(2);
- EXPECT_THAT(lhs, UnorderedPointwise(Lt(), rhs));
- EXPECT_THAT(lhs, Not(UnorderedPointwise(Gt(), rhs)));
-}
-
-TEST(UnorderedPointwiseTest, WorksForRhsNativeArray) {
- const int rhs[] = {1, 2, 3};
- vector<int> lhs;
- lhs.push_back(4);
- lhs.push_back(2);
- lhs.push_back(6);
- EXPECT_THAT(lhs, UnorderedPointwise(Gt(), rhs));
- EXPECT_THAT(lhs, Not(UnorderedPointwise(Lt(), rhs)));
-}
-
-
-TEST(UnorderedPointwiseTest, WorksForRhsInitializerList) {
- const vector<int> lhs{2, 4, 6};
- EXPECT_THAT(lhs, UnorderedPointwise(Gt(), {5, 1, 3}));
- EXPECT_THAT(lhs, Not(UnorderedPointwise(Lt(), {1, 1, 7})));
-}
-
-
-TEST(UnorderedPointwiseTest, RejectsWrongSize) {
- const double lhs[2] = {1, 2};
- const int rhs[1] = {0};
- EXPECT_THAT(lhs, Not(UnorderedPointwise(Gt(), rhs)));
- EXPECT_EQ("which has 2 elements",
- Explain(UnorderedPointwise(Gt(), rhs), lhs));
-
- const int rhs2[3] = {0, 1, 2};
- EXPECT_THAT(lhs, Not(UnorderedPointwise(Gt(), rhs2)));
-}
-
-TEST(UnorderedPointwiseTest, RejectsWrongContent) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {2, 6, 6};
- EXPECT_THAT(lhs, Not(UnorderedPointwise(IsHalfOf(), rhs)));
- EXPECT_EQ("where the following elements don't match any matchers:\n"
- "element #1: 2",
- Explain(UnorderedPointwise(IsHalfOf(), rhs), lhs));
-}
-
-TEST(UnorderedPointwiseTest, AcceptsCorrectContentInSameOrder) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {2, 4, 6};
- EXPECT_THAT(lhs, UnorderedPointwise(IsHalfOf(), rhs));
-}
-
-TEST(UnorderedPointwiseTest, AcceptsCorrectContentInDifferentOrder) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {6, 4, 2};
- EXPECT_THAT(lhs, UnorderedPointwise(IsHalfOf(), rhs));
-}
-
-TEST(UnorderedPointwiseTest, AllowsMonomorphicInnerMatcher) {
- const double lhs[3] = {1, 2, 3};
- const int rhs[3] = {4, 6, 2};
- const Matcher<std::tuple<const double&, const int&>> m1 = IsHalfOf();
- EXPECT_THAT(lhs, UnorderedPointwise(m1, rhs));
-
- // This type works as a std::tuple<const double&, const int&> can be
- // implicitly cast to std::tuple<double, int>.
- const Matcher<std::tuple<double, int>> m2 = IsHalfOf();
- EXPECT_THAT(lhs, UnorderedPointwise(m2, rhs));
-}
-
-TEST(UnorderedPointwiseTest, WorksWithMoveOnly) {
- ContainerHelper helper;
- EXPECT_CALL(helper, Call(UnorderedPointwise(PointeeEquals(),
- std::vector<int>{1, 2})));
- helper.Call(MakeUniquePtrs({2, 1}));
-}
-
-// Sample optional type implementation with minimal requirements for use with
-// Optional matcher.
-template <typename T>
-class SampleOptional {
- public:
- using value_type = T;
- explicit SampleOptional(T value)
- : value_(std::move(value)), has_value_(true) {}
- SampleOptional() : value_(), has_value_(false) {}
- operator bool() const { return has_value_; }
- const T& operator*() const { return value_; }
-
- private:
- T value_;
- bool has_value_;
-};
-
-TEST(OptionalTest, DescribesSelf) {
- const Matcher<SampleOptional<int>> m = Optional(Eq(1));
- EXPECT_EQ("value is equal to 1", Describe(m));
-}
-
-TEST(OptionalTest, ExplainsSelf) {
- const Matcher<SampleOptional<int>> m = Optional(Eq(1));
- EXPECT_EQ("whose value 1 matches", Explain(m, SampleOptional<int>(1)));
- EXPECT_EQ("whose value 2 doesn't match", Explain(m, SampleOptional<int>(2)));
-}
-
-TEST(OptionalTest, MatchesNonEmptyOptional) {
- const Matcher<SampleOptional<int>> m1 = Optional(1);
- const Matcher<SampleOptional<int>> m2 = Optional(Eq(2));
- const Matcher<SampleOptional<int>> m3 = Optional(Lt(3));
- SampleOptional<int> opt(1);
- EXPECT_TRUE(m1.Matches(opt));
- EXPECT_FALSE(m2.Matches(opt));
- EXPECT_TRUE(m3.Matches(opt));
-}
-
-TEST(OptionalTest, DoesNotMatchNullopt) {
- const Matcher<SampleOptional<int>> m = Optional(1);
- SampleOptional<int> empty;
- EXPECT_FALSE(m.Matches(empty));
-}
-
-TEST(OptionalTest, WorksWithMoveOnly) {
- Matcher<SampleOptional<std::unique_ptr<int>>> m = Optional(Eq(nullptr));
- EXPECT_TRUE(m.Matches(SampleOptional<std::unique_ptr<int>>(nullptr)));
-}
-
-class SampleVariantIntString {
- public:
- SampleVariantIntString(int i) : i_(i), has_int_(true) {}
- SampleVariantIntString(const std::string& s) : s_(s), has_int_(false) {}
-
- template <typename T>
- friend bool holds_alternative(const SampleVariantIntString& value) {
- return value.has_int_ == std::is_same<T, int>::value;
- }
-
- template <typename T>
- friend const T& get(const SampleVariantIntString& value) {
- return value.get_impl(static_cast<T*>(nullptr));
- }
-
- private:
- const int& get_impl(int*) const { return i_; }
- const std::string& get_impl(std::string*) const { return s_; }
-
- int i_;
- std::string s_;
- bool has_int_;
-};
-
-TEST(VariantTest, DescribesSelf) {
- const Matcher<SampleVariantIntString> m = VariantWith<int>(Eq(1));
- EXPECT_THAT(Describe(m), ContainsRegex("is a variant<> with value of type "
- "'.*' and the value is equal to 1"));
-}
-
-TEST(VariantTest, ExplainsSelf) {
- const Matcher<SampleVariantIntString> m = VariantWith<int>(Eq(1));
- EXPECT_THAT(Explain(m, SampleVariantIntString(1)),
- ContainsRegex("whose value 1"));
- EXPECT_THAT(Explain(m, SampleVariantIntString("A")),
- HasSubstr("whose value is not of type '"));
- EXPECT_THAT(Explain(m, SampleVariantIntString(2)),
- "whose value 2 doesn't match");
-}
-
-TEST(VariantTest, FullMatch) {
- Matcher<SampleVariantIntString> m = VariantWith<int>(Eq(1));
- EXPECT_TRUE(m.Matches(SampleVariantIntString(1)));
-
- m = VariantWith<std::string>(Eq("1"));
- EXPECT_TRUE(m.Matches(SampleVariantIntString("1")));
-}
-
-TEST(VariantTest, TypeDoesNotMatch) {
- Matcher<SampleVariantIntString> m = VariantWith<int>(Eq(1));
- EXPECT_FALSE(m.Matches(SampleVariantIntString("1")));
-
- m = VariantWith<std::string>(Eq("1"));
- EXPECT_FALSE(m.Matches(SampleVariantIntString(1)));
-}
-
-TEST(VariantTest, InnerDoesNotMatch) {
- Matcher<SampleVariantIntString> m = VariantWith<int>(Eq(1));
- EXPECT_FALSE(m.Matches(SampleVariantIntString(2)));
-
- m = VariantWith<std::string>(Eq("1"));
- EXPECT_FALSE(m.Matches(SampleVariantIntString("2")));
-}
-
-class SampleAnyType {
- public:
- explicit SampleAnyType(int i) : index_(0), i_(i) {}
- explicit SampleAnyType(const std::string& s) : index_(1), s_(s) {}
-
- template <typename T>
- friend const T* any_cast(const SampleAnyType* any) {
- return any->get_impl(static_cast<T*>(nullptr));
- }
-
- private:
- int index_;
- int i_;
- std::string s_;
-
- const int* get_impl(int*) const { return index_ == 0 ? &i_ : nullptr; }
- const std::string* get_impl(std::string*) const {
- return index_ == 1 ? &s_ : nullptr;
- }
-};
-
-TEST(AnyWithTest, FullMatch) {
- Matcher<SampleAnyType> m = AnyWith<int>(Eq(1));
- EXPECT_TRUE(m.Matches(SampleAnyType(1)));
-}
-
-TEST(AnyWithTest, TestBadCastType) {
- Matcher<SampleAnyType> m = AnyWith<std::string>(Eq("fail"));
- EXPECT_FALSE(m.Matches(SampleAnyType(1)));
-}
-
-TEST(AnyWithTest, TestUseInContainers) {
- std::vector<SampleAnyType> a;
- a.emplace_back(1);
- a.emplace_back(2);
- a.emplace_back(3);
- EXPECT_THAT(
- a, ElementsAreArray({AnyWith<int>(1), AnyWith<int>(2), AnyWith<int>(3)}));
-
- std::vector<SampleAnyType> b;
- b.emplace_back("hello");
- b.emplace_back("merhaba");
- b.emplace_back("salut");
- EXPECT_THAT(b, ElementsAreArray({AnyWith<std::string>("hello"),
- AnyWith<std::string>("merhaba"),
- AnyWith<std::string>("salut")}));
-}
-TEST(AnyWithTest, TestCompare) {
- EXPECT_THAT(SampleAnyType(1), AnyWith<int>(Gt(0)));
-}
-
-TEST(AnyWithTest, DescribesSelf) {
- const Matcher<const SampleAnyType&> m = AnyWith<int>(Eq(1));
- EXPECT_THAT(Describe(m), ContainsRegex("is an 'any' type with value of type "
- "'.*' and the value is equal to 1"));
-}
-
-TEST(AnyWithTest, ExplainsSelf) {
- const Matcher<const SampleAnyType&> m = AnyWith<int>(Eq(1));
-
- EXPECT_THAT(Explain(m, SampleAnyType(1)), ContainsRegex("whose value 1"));
- EXPECT_THAT(Explain(m, SampleAnyType("A")),
- HasSubstr("whose value is not of type '"));
- EXPECT_THAT(Explain(m, SampleAnyType(2)), "whose value 2 doesn't match");
-}
-
-TEST(PointeeTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, Pointee(Eq(3)));
- EXPECT_THAT(p, Not(Pointee(Eq(2))));
-}
-
-TEST(NotTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, Pointee(Eq(3)));
- EXPECT_THAT(p, Not(Pointee(Eq(2))));
-}
-
-// Tests Args<k0, ..., kn>(m).
-
-TEST(ArgsTest, AcceptsZeroTemplateArg) {
- const std::tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<>(Eq(std::tuple<>())));
- EXPECT_THAT(t, Not(Args<>(Ne(std::tuple<>()))));
-}
-
-TEST(ArgsTest, AcceptsOneTemplateArg) {
- const std::tuple<int, bool> t(5, true);
- EXPECT_THAT(t, Args<0>(Eq(std::make_tuple(5))));
- EXPECT_THAT(t, Args<1>(Eq(std::make_tuple(true))));
- EXPECT_THAT(t, Not(Args<1>(Eq(std::make_tuple(false)))));
-}
-
-TEST(ArgsTest, AcceptsTwoTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
-
- EXPECT_THAT(t, (Args<0, 1>(Lt())));
- EXPECT_THAT(t, (Args<1, 2>(Lt())));
- EXPECT_THAT(t, Not(Args<0, 2>(Gt())));
-}
-
-TEST(ArgsTest, AcceptsRepeatedTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
- EXPECT_THAT(t, (Args<0, 0>(Eq())));
- EXPECT_THAT(t, Not(Args<1, 1>(Ne())));
-}
-
-TEST(ArgsTest, AcceptsDecreasingTemplateArgs) {
- const std::tuple<short, int, long> t(4, 5, 6L); // NOLINT
- EXPECT_THAT(t, (Args<2, 0>(Gt())));
- EXPECT_THAT(t, Not(Args<2, 1>(Lt())));
-}
-
-MATCHER(SumIsZero, "") {
- return std::get<0>(arg) + std::get<1>(arg) + std::get<2>(arg) == 0;
-}
-
-TEST(ArgsTest, AcceptsMoreTemplateArgsThanArityOfOriginalTuple) {
- EXPECT_THAT(std::make_tuple(-1, 2), (Args<0, 0, 1>(SumIsZero())));
- EXPECT_THAT(std::make_tuple(1, 2), Not(Args<0, 0, 1>(SumIsZero())));
-}
-
-TEST(ArgsTest, CanBeNested) {
- const std::tuple<short, int, long, int> t(4, 5, 6L, 6); // NOLINT
- EXPECT_THAT(t, (Args<1, 2, 3>(Args<1, 2>(Eq()))));
- EXPECT_THAT(t, (Args<0, 1, 3>(Args<0, 2>(Lt()))));
-}
-
-TEST(ArgsTest, CanMatchTupleByValue) {
- typedef std::tuple<char, int, int> Tuple3;
- const Matcher<Tuple3> m = Args<1, 2>(Lt());
- EXPECT_TRUE(m.Matches(Tuple3('a', 1, 2)));
- EXPECT_FALSE(m.Matches(Tuple3('b', 2, 2)));
-}
-
-TEST(ArgsTest, CanMatchTupleByReference) {
- typedef std::tuple<char, char, int> Tuple3;
- const Matcher<const Tuple3&> m = Args<0, 1>(Lt());
- EXPECT_TRUE(m.Matches(Tuple3('a', 'b', 2)));
- EXPECT_FALSE(m.Matches(Tuple3('b', 'b', 2)));
-}
-
-// Validates that arg is printed as str.
-MATCHER_P(PrintsAs, str, "") {
- return testing::PrintToString(arg) == str;
-}
-
-TEST(ArgsTest, AcceptsTenTemplateArgs) {
- EXPECT_THAT(std::make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
- (Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
- PrintsAs("(9, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
- EXPECT_THAT(std::make_tuple(0, 1L, 2, 3L, 4, 5, 6, 7, 8, 9),
- Not(Args<9, 8, 7, 6, 5, 4, 3, 2, 1, 0>(
- PrintsAs("(0, 8, 7, 6, 5, 4, 3, 2, 1, 0)"))));
-}
-
-TEST(ArgsTest, DescirbesSelfCorrectly) {
- const Matcher<std::tuple<int, bool, char> > m = Args<2, 0>(Lt());
- EXPECT_EQ("are a tuple whose fields (#2, #0) are a pair where "
- "the first < the second",
- Describe(m));
-}
-
-TEST(ArgsTest, DescirbesNestedArgsCorrectly) {
- const Matcher<const std::tuple<int, bool, char, int>&> m =
- Args<0, 2, 3>(Args<2, 0>(Lt()));
- EXPECT_EQ("are a tuple whose fields (#0, #2, #3) are a tuple "
- "whose fields (#2, #0) are a pair where the first < the second",
- Describe(m));
-}
-
-TEST(ArgsTest, DescribesNegationCorrectly) {
- const Matcher<std::tuple<int, char> > m = Args<1, 0>(Gt());
- EXPECT_EQ("are a tuple whose fields (#1, #0) aren't a pair "
- "where the first > the second",
- DescribeNegation(m));
-}
-
-TEST(ArgsTest, ExplainsMatchResultWithoutInnerExplanation) {
- const Matcher<std::tuple<bool, int, int> > m = Args<1, 2>(Eq());
- EXPECT_EQ("whose fields (#1, #2) are (42, 42)",
- Explain(m, std::make_tuple(false, 42, 42)));
- EXPECT_EQ("whose fields (#1, #2) are (42, 43)",
- Explain(m, std::make_tuple(false, 42, 43)));
-}
-
-// For testing Args<>'s explanation.
-class LessThanMatcher : public MatcherInterface<std::tuple<char, int> > {
- public:
- void DescribeTo(::std::ostream* /*os*/) const override {}
-
- bool MatchAndExplain(std::tuple<char, int> value,
- MatchResultListener* listener) const override {
- const int diff = std::get<0>(value) - std::get<1>(value);
- if (diff > 0) {
- *listener << "where the first value is " << diff
- << " more than the second";
- }
- return diff < 0;
- }
-};
-
-Matcher<std::tuple<char, int> > LessThan() {
- return MakeMatcher(new LessThanMatcher);
-}
-
-TEST(ArgsTest, ExplainsMatchResultWithInnerExplanation) {
- const Matcher<std::tuple<char, int, int> > m = Args<0, 2>(LessThan());
- EXPECT_EQ(
- "whose fields (#0, #2) are ('a' (97, 0x61), 42), "
- "where the first value is 55 more than the second",
- Explain(m, std::make_tuple('a', 42, 42)));
- EXPECT_EQ("whose fields (#0, #2) are ('\\0', 43)",
- Explain(m, std::make_tuple('\0', 42, 43)));
-}
-
-class PredicateFormatterFromMatcherTest : public ::testing::Test {
- protected:
- enum Behavior { kInitialSuccess, kAlwaysFail, kFlaky };
-
- // A matcher that can return different results when used multiple times on the
- // same input. No real matcher should do this; but this lets us test that we
- // detect such behavior and fail appropriately.
- class MockMatcher : public MatcherInterface<Behavior> {
- public:
- bool MatchAndExplain(Behavior behavior,
- MatchResultListener* listener) const override {
- *listener << "[MatchAndExplain]";
- switch (behavior) {
- case kInitialSuccess:
- // The first call to MatchAndExplain should use a "not interested"
- // listener; so this is expected to return |true|. There should be no
- // subsequent calls.
- return !listener->IsInterested();
-
- case kAlwaysFail:
- return false;
-
- case kFlaky:
- // The first call to MatchAndExplain should use a "not interested"
- // listener; so this will return |false|. Subsequent calls should have
- // an "interested" listener; so this will return |true|, thus
- // simulating a flaky matcher.
- return listener->IsInterested();
- }
-
- GTEST_LOG_(FATAL) << "This should never be reached";
- return false;
- }
-
- void DescribeTo(ostream* os) const override { *os << "[DescribeTo]"; }
-
- void DescribeNegationTo(ostream* os) const override {
- *os << "[DescribeNegationTo]";
- }
- };
-
- AssertionResult RunPredicateFormatter(Behavior behavior) {
- auto matcher = MakeMatcher(new MockMatcher);
- PredicateFormatterFromMatcher<Matcher<Behavior>> predicate_formatter(
- matcher);
- return predicate_formatter("dummy-name", behavior);
- }
-};
-
-TEST_F(PredicateFormatterFromMatcherTest, ShortCircuitOnSuccess) {
- AssertionResult result = RunPredicateFormatter(kInitialSuccess);
- EXPECT_TRUE(result); // Implicit cast to bool.
- std::string expect;
- EXPECT_EQ(expect, result.message());
-}
-
-TEST_F(PredicateFormatterFromMatcherTest, NoShortCircuitOnFailure) {
- AssertionResult result = RunPredicateFormatter(kAlwaysFail);
- EXPECT_FALSE(result); // Implicit cast to bool.
- std::string expect =
- "Value of: dummy-name\nExpected: [DescribeTo]\n"
- " Actual: 1" +
- OfType(internal::GetTypeName<Behavior>()) + ", [MatchAndExplain]";
- EXPECT_EQ(expect, result.message());
-}
-
-TEST_F(PredicateFormatterFromMatcherTest, DetectsFlakyShortCircuit) {
- AssertionResult result = RunPredicateFormatter(kFlaky);
- EXPECT_FALSE(result); // Implicit cast to bool.
- std::string expect =
- "Value of: dummy-name\nExpected: [DescribeTo]\n"
- " The matcher failed on the initial attempt; but passed when rerun to "
- "generate the explanation.\n"
- " Actual: 2" +
- OfType(internal::GetTypeName<Behavior>()) + ", [MatchAndExplain]";
- EXPECT_EQ(expect, result.message());
-}
-
-// Tests for ElementsAre().
-
-TEST(ElementsAreTest, CanDescribeExpectingNoElement) {
- Matcher<const vector<int>&> m = ElementsAre();
- EXPECT_EQ("is empty", Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeExpectingOneElement) {
- Matcher<vector<int>> m = ElementsAre(Gt(5));
- EXPECT_EQ("has 1 element that is > 5", Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeExpectingManyElements) {
- Matcher<list<std::string>> m = ElementsAre(StrEq("one"), "two");
- EXPECT_EQ(
- "has 2 elements where\n"
- "element #0 is equal to \"one\",\n"
- "element #1 is equal to \"two\"",
- Describe(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingNoElement) {
- Matcher<vector<int>> m = ElementsAre();
- EXPECT_EQ("isn't empty", DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingOneElement) {
- Matcher<const list<int>&> m = ElementsAre(Gt(5));
- EXPECT_EQ(
- "doesn't have 1 element, or\n"
- "element #0 isn't > 5",
- DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, CanDescribeNegationOfExpectingManyElements) {
- Matcher<const list<std::string>&> m = ElementsAre("one", "two");
- EXPECT_EQ(
- "doesn't have 2 elements, or\n"
- "element #0 isn't equal to \"one\", or\n"
- "element #1 isn't equal to \"two\"",
- DescribeNegation(m));
-}
-
-TEST(ElementsAreTest, DoesNotExplainTrivialMatch) {
- Matcher<const list<int>&> m = ElementsAre(1, Ne(2));
-
- list<int> test_list;
- test_list.push_back(1);
- test_list.push_back(3);
- EXPECT_EQ("", Explain(m, test_list)); // No need to explain anything.
-}
-
-TEST(ElementsAreTest, ExplainsNonTrivialMatch) {
- Matcher<const vector<int>&> m =
- ElementsAre(GreaterThan(1), 0, GreaterThan(2));
-
- const int a[] = {10, 0, 100};
- vector<int> test_vector(std::begin(a), std::end(a));
- EXPECT_EQ(
- "whose element #0 matches, which is 9 more than 1,\n"
- "and whose element #2 matches, which is 98 more than 2",
- Explain(m, test_vector));
-}
-
-TEST(ElementsAreTest, CanExplainMismatchWrongSize) {
- Matcher<const list<int>&> m = ElementsAre(1, 3);
-
- list<int> test_list;
- // No need to explain when the container is empty.
- EXPECT_EQ("", Explain(m, test_list));
-
- test_list.push_back(1);
- EXPECT_EQ("which has 1 element", Explain(m, test_list));
-}
-
-TEST(ElementsAreTest, CanExplainMismatchRightSize) {
- Matcher<const vector<int>&> m = ElementsAre(1, GreaterThan(5));
-
- vector<int> v;
- v.push_back(2);
- v.push_back(1);
- EXPECT_EQ("whose element #0 doesn't match", Explain(m, v));
-
- v[0] = 1;
- EXPECT_EQ("whose element #1 doesn't match, which is 4 less than 5",
- Explain(m, v));
-}
-
-TEST(ElementsAreTest, MatchesOneElementVector) {
- vector<std::string> test_vector;
- test_vector.push_back("test string");
-
- EXPECT_THAT(test_vector, ElementsAre(StrEq("test string")));
-}
-
-TEST(ElementsAreTest, MatchesOneElementList) {
- list<std::string> test_list;
- test_list.push_back("test string");
-
- EXPECT_THAT(test_list, ElementsAre("test string"));
-}
-
-TEST(ElementsAreTest, MatchesThreeElementVector) {
- vector<std::string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("two");
- test_vector.push_back("three");
-
- EXPECT_THAT(test_vector, ElementsAre("one", StrEq("two"), _));
-}
-
-TEST(ElementsAreTest, MatchesOneElementEqMatcher) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(Eq(4)));
-}
-
-TEST(ElementsAreTest, MatchesOneElementAnyMatcher) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(_));
-}
-
-TEST(ElementsAreTest, MatchesOneElementValue) {
- vector<int> test_vector;
- test_vector.push_back(4);
-
- EXPECT_THAT(test_vector, ElementsAre(4));
-}
-
-TEST(ElementsAreTest, MatchesThreeElementsMixedMatchers) {
- vector<int> test_vector;
- test_vector.push_back(1);
- test_vector.push_back(2);
- test_vector.push_back(3);
-
- EXPECT_THAT(test_vector, ElementsAre(1, Eq(2), _));
-}
-
-TEST(ElementsAreTest, MatchesTenElementVector) {
- const int a[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
- vector<int> test_vector(std::begin(a), std::end(a));
-
- EXPECT_THAT(test_vector,
- // The element list can contain values and/or matchers
- // of different types.
- ElementsAre(0, Ge(0), _, 3, 4, Ne(2), Eq(6), 7, 8, _));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongSize) {
- vector<std::string> test_vector;
- test_vector.push_back("test string");
- test_vector.push_back("test string");
-
- Matcher<vector<std::string>> m = ElementsAre(StrEq("test string"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongValue) {
- vector<std::string> test_vector;
- test_vector.push_back("other string");
-
- Matcher<vector<std::string>> m = ElementsAre(StrEq("test string"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, DoesNotMatchWrongOrder) {
- vector<std::string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("three");
- test_vector.push_back("two");
-
- Matcher<vector<std::string>> m =
- ElementsAre(StrEq("one"), StrEq("two"), StrEq("three"));
- EXPECT_FALSE(m.Matches(test_vector));
-}
-
-TEST(ElementsAreTest, WorksForNestedContainer) {
- constexpr std::array<const char*, 2> strings = {{"Hi", "world"}};
-
- vector<list<char>> nested;
- for (const auto& s : strings) {
- nested.emplace_back(s, s + strlen(s));
- }
-
- EXPECT_THAT(nested, ElementsAre(ElementsAre('H', Ne('e')),
- ElementsAre('w', 'o', _, _, 'd')));
- EXPECT_THAT(nested, Not(ElementsAre(ElementsAre('H', 'e'),
- ElementsAre('w', 'o', _, _, 'd'))));
-}
-
-TEST(ElementsAreTest, WorksWithByRefElementMatchers) {
- int a[] = {0, 1, 2};
- vector<int> v(std::begin(a), std::end(a));
-
- EXPECT_THAT(v, ElementsAre(Ref(v[0]), Ref(v[1]), Ref(v[2])));
- EXPECT_THAT(v, Not(ElementsAre(Ref(v[0]), Ref(v[1]), Ref(a[2]))));
-}
-
-TEST(ElementsAreTest, WorksWithContainerPointerUsingPointee) {
- int a[] = {0, 1, 2};
- vector<int> v(std::begin(a), std::end(a));
-
- EXPECT_THAT(&v, Pointee(ElementsAre(0, 1, _)));
- EXPECT_THAT(&v, Not(Pointee(ElementsAre(0, _, 3))));
-}
-
-TEST(ElementsAreTest, WorksWithNativeArrayPassedByReference) {
- int array[] = {0, 1, 2};
- EXPECT_THAT(array, ElementsAre(0, 1, _));
- EXPECT_THAT(array, Not(ElementsAre(1, _, _)));
- EXPECT_THAT(array, Not(ElementsAre(0, _)));
-}
-
-class NativeArrayPassedAsPointerAndSize {
- public:
- NativeArrayPassedAsPointerAndSize() {}
-
- MOCK_METHOD(void, Helper, (int* array, int size));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(NativeArrayPassedAsPointerAndSize);
-};
-
-TEST(ElementsAreTest, WorksWithNativeArrayPassedAsPointerAndSize) {
- int array[] = {0, 1};
- ::std::tuple<int*, size_t> array_as_tuple(array, 2);
- EXPECT_THAT(array_as_tuple, ElementsAre(0, 1));
- EXPECT_THAT(array_as_tuple, Not(ElementsAre(0)));
-
- NativeArrayPassedAsPointerAndSize helper;
- EXPECT_CALL(helper, Helper(_, _)).With(ElementsAre(0, 1));
- helper.Helper(array, 2);
-}
-
-TEST(ElementsAreTest, WorksWithTwoDimensionalNativeArray) {
- const char a2[][3] = {"hi", "lo"};
- EXPECT_THAT(a2, ElementsAre(ElementsAre('h', 'i', '\0'),
- ElementsAre('l', 'o', '\0')));
- EXPECT_THAT(a2, ElementsAre(StrEq("hi"), StrEq("lo")));
- EXPECT_THAT(a2, ElementsAre(Not(ElementsAre('h', 'o', '\0')),
- ElementsAre('l', 'o', '\0')));
-}
-
-TEST(ElementsAreTest, AcceptsStringLiteral) {
- std::string array[] = {"hi", "one", "two"};
- EXPECT_THAT(array, ElementsAre("hi", "one", "two"));
- EXPECT_THAT(array, Not(ElementsAre("hi", "one", "too")));
-}
-
-// Declared here with the size unknown. Defined AFTER the following test.
-extern const char kHi[];
-
-TEST(ElementsAreTest, AcceptsArrayWithUnknownSize) {
- // The size of kHi is not known in this test, but ElementsAre() should
- // still accept it.
-
- std::string array1[] = {"hi"};
- EXPECT_THAT(array1, ElementsAre(kHi));
-
- std::string array2[] = {"ho"};
- EXPECT_THAT(array2, Not(ElementsAre(kHi)));
-}
-
-const char kHi[] = "hi";
-
-TEST(ElementsAreTest, MakesCopyOfArguments) {
- int x = 1;
- int y = 2;
- // This should make a copy of x and y.
- ::testing::internal::ElementsAreMatcher<std::tuple<int, int>>
- polymorphic_matcher = ElementsAre(x, y);
- // Changing x and y now shouldn't affect the meaning of the above matcher.
- x = y = 0;
- const int array1[] = {1, 2};
- EXPECT_THAT(array1, polymorphic_matcher);
- const int array2[] = {0, 0};
- EXPECT_THAT(array2, Not(polymorphic_matcher));
-}
-
-// Tests for ElementsAreArray(). Since ElementsAreArray() shares most
-// of the implementation with ElementsAre(), we don't test it as
-// thoroughly here.
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithValueArray) {
- const int a[] = {1, 2, 3};
-
- vector<int> test_vector(std::begin(a), std::end(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a));
-
- test_vector[2] = 0;
- EXPECT_THAT(test_vector, Not(ElementsAreArray(a)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithArraySize) {
- std::array<const char*, 3> a = {{"one", "two", "three"}};
-
- vector<std::string> test_vector(std::begin(a), std::end(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a.data(), a.size()));
-
- const char** p = a.data();
- test_vector[0] = "1";
- EXPECT_THAT(test_vector, Not(ElementsAreArray(p, a.size())));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithoutArraySize) {
- const char* a[] = {"one", "two", "three"};
-
- vector<std::string> test_vector(std::begin(a), std::end(a));
- EXPECT_THAT(test_vector, ElementsAreArray(a));
-
- test_vector[0] = "1";
- EXPECT_THAT(test_vector, Not(ElementsAreArray(a)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherArray) {
- const Matcher<std::string> kMatcherArray[] = {StrEq("one"), StrEq("two"),
- StrEq("three")};
-
- vector<std::string> test_vector;
- test_vector.push_back("one");
- test_vector.push_back("two");
- test_vector.push_back("three");
- EXPECT_THAT(test_vector, ElementsAreArray(kMatcherArray));
-
- test_vector.push_back("three");
- EXPECT_THAT(test_vector, Not(ElementsAreArray(kMatcherArray)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithVector) {
- const int a[] = {1, 2, 3};
- vector<int> test_vector(std::begin(a), std::end(a));
- const vector<int> expected(std::begin(a), std::end(a));
- EXPECT_THAT(test_vector, ElementsAreArray(expected));
- test_vector.push_back(4);
- EXPECT_THAT(test_vector, Not(ElementsAreArray(expected)));
-}
-
-TEST(ElementsAreArrayTest, TakesInitializerList) {
- const int a[5] = {1, 2, 3, 4, 5};
- EXPECT_THAT(a, ElementsAreArray({1, 2, 3, 4, 5}));
- EXPECT_THAT(a, Not(ElementsAreArray({1, 2, 3, 5, 4})));
- EXPECT_THAT(a, Not(ElementsAreArray({1, 2, 3, 4, 6})));
-}
-
-TEST(ElementsAreArrayTest, TakesInitializerListOfCStrings) {
- const std::string a[5] = {"a", "b", "c", "d", "e"};
- EXPECT_THAT(a, ElementsAreArray({"a", "b", "c", "d", "e"}));
- EXPECT_THAT(a, Not(ElementsAreArray({"a", "b", "c", "e", "d"})));
- EXPECT_THAT(a, Not(ElementsAreArray({"a", "b", "c", "d", "ef"})));
-}
-
-TEST(ElementsAreArrayTest, TakesInitializerListOfSameTypedMatchers) {
- const int a[5] = {1, 2, 3, 4, 5};
- EXPECT_THAT(a, ElementsAreArray({Eq(1), Eq(2), Eq(3), Eq(4), Eq(5)}));
- EXPECT_THAT(a, Not(ElementsAreArray({Eq(1), Eq(2), Eq(3), Eq(4), Eq(6)})));
-}
-
-TEST(ElementsAreArrayTest, TakesInitializerListOfDifferentTypedMatchers) {
- const int a[5] = {1, 2, 3, 4, 5};
- // The compiler cannot infer the type of the initializer list if its
- // elements have different types. We must explicitly specify the
- // unified element type in this case.
- EXPECT_THAT(
- a, ElementsAreArray<Matcher<int>>({Eq(1), Ne(-2), Ge(3), Le(4), Eq(5)}));
- EXPECT_THAT(a, Not(ElementsAreArray<Matcher<int>>(
- {Eq(1), Ne(-2), Ge(3), Le(4), Eq(6)})));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithMatcherVector) {
- const int a[] = {1, 2, 3};
- const Matcher<int> kMatchers[] = {Eq(1), Eq(2), Eq(3)};
- vector<int> test_vector(std::begin(a), std::end(a));
- const vector<Matcher<int>> expected(std::begin(kMatchers),
- std::end(kMatchers));
- EXPECT_THAT(test_vector, ElementsAreArray(expected));
- test_vector.push_back(4);
- EXPECT_THAT(test_vector, Not(ElementsAreArray(expected)));
-}
-
-TEST(ElementsAreArrayTest, CanBeCreatedWithIteratorRange) {
- const int a[] = {1, 2, 3};
- const vector<int> test_vector(std::begin(a), std::end(a));
- const vector<int> expected(std::begin(a), std::end(a));
- EXPECT_THAT(test_vector, ElementsAreArray(expected.begin(), expected.end()));
- // Pointers are iterators, too.
- EXPECT_THAT(test_vector, ElementsAreArray(std::begin(a), std::end(a)));
- // The empty range of NULL pointers should also be okay.
- int* const null_int = nullptr;
- EXPECT_THAT(test_vector, Not(ElementsAreArray(null_int, null_int)));
- EXPECT_THAT((vector<int>()), ElementsAreArray(null_int, null_int));
-}
-
-// Since ElementsAre() and ElementsAreArray() share much of the
-// implementation, we only do a sanity test for native arrays here.
-TEST(ElementsAreArrayTest, WorksWithNativeArray) {
- ::std::string a[] = {"hi", "ho"};
- ::std::string b[] = {"hi", "ho"};
-
- EXPECT_THAT(a, ElementsAreArray(b));
- EXPECT_THAT(a, ElementsAreArray(b, 2));
- EXPECT_THAT(a, Not(ElementsAreArray(b, 1)));
-}
-
-TEST(ElementsAreArrayTest, SourceLifeSpan) {
- const int a[] = {1, 2, 3};
- vector<int> test_vector(std::begin(a), std::end(a));
- vector<int> expect(std::begin(a), std::end(a));
- ElementsAreArrayMatcher<int> matcher_maker =
- ElementsAreArray(expect.begin(), expect.end());
- EXPECT_THAT(test_vector, matcher_maker);
- // Changing in place the values that initialized matcher_maker should not
- // affect matcher_maker anymore. It should have made its own copy of them.
- for (int& i : expect) {
- i += 10;
- }
- EXPECT_THAT(test_vector, matcher_maker);
- test_vector.push_back(3);
- EXPECT_THAT(test_vector, Not(matcher_maker));
-}
-
-// Tests for the MATCHER*() macro family.
-
-// Tests that a simple MATCHER() definition works.
-
-MATCHER(IsEven, "") { return (arg % 2) == 0; }
-
-TEST(MatcherMacroTest, Works) {
- const Matcher<int> m = IsEven();
- EXPECT_TRUE(m.Matches(6));
- EXPECT_FALSE(m.Matches(7));
-
- EXPECT_EQ("is even", Describe(m));
- EXPECT_EQ("not (is even)", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 6));
- EXPECT_EQ("", Explain(m, 7));
-}
-
-// This also tests that the description string can reference 'negation'.
-MATCHER(IsEven2, negation ? "is odd" : "is even") {
- if ((arg % 2) == 0) {
- // Verifies that we can stream to result_listener, a listener
- // supplied by the MATCHER macro implicitly.
- *result_listener << "OK";
- return true;
- } else {
- *result_listener << "% 2 == " << (arg % 2);
- return false;
- }
-}
-
-// This also tests that the description string can reference matcher
-// parameters.
-MATCHER_P2(EqSumOf, x, y,
- std::string(negation ? "doesn't equal" : "equals") + " the sum of " +
- PrintToString(x) + " and " + PrintToString(y)) {
- if (arg == (x + y)) {
- *result_listener << "OK";
- return true;
- } else {
- // Verifies that we can stream to the underlying stream of
- // result_listener.
- if (result_listener->stream() != nullptr) {
- *result_listener->stream() << "diff == " << (x + y - arg);
- }
- return false;
- }
-}
-
-// Tests that the matcher description can reference 'negation' and the
-// matcher parameters.
-TEST(MatcherMacroTest, DescriptionCanReferenceNegationAndParameters) {
- const Matcher<int> m1 = IsEven2();
- EXPECT_EQ("is even", Describe(m1));
- EXPECT_EQ("is odd", DescribeNegation(m1));
-
- const Matcher<int> m2 = EqSumOf(5, 9);
- EXPECT_EQ("equals the sum of 5 and 9", Describe(m2));
- EXPECT_EQ("doesn't equal the sum of 5 and 9", DescribeNegation(m2));
-}
-
-// Tests explaining match result in a MATCHER* macro.
-TEST(MatcherMacroTest, CanExplainMatchResult) {
- const Matcher<int> m1 = IsEven2();
- EXPECT_EQ("OK", Explain(m1, 4));
- EXPECT_EQ("% 2 == 1", Explain(m1, 5));
-
- const Matcher<int> m2 = EqSumOf(1, 2);
- EXPECT_EQ("OK", Explain(m2, 3));
- EXPECT_EQ("diff == -1", Explain(m2, 4));
-}
-
-// Tests that the body of MATCHER() can reference the type of the
-// value being matched.
-
-MATCHER(IsEmptyString, "") {
- StaticAssertTypeEq<::std::string, arg_type>();
- return arg.empty();
-}
-
-MATCHER(IsEmptyStringByRef, "") {
- StaticAssertTypeEq<const ::std::string&, arg_type>();
- return arg.empty();
-}
-
-TEST(MatcherMacroTest, CanReferenceArgType) {
- const Matcher<::std::string> m1 = IsEmptyString();
- EXPECT_TRUE(m1.Matches(""));
-
- const Matcher<const ::std::string&> m2 = IsEmptyStringByRef();
- EXPECT_TRUE(m2.Matches(""));
-}
-
-// Tests that MATCHER() can be used in a namespace.
-
-namespace matcher_test {
-MATCHER(IsOdd, "") { return (arg % 2) != 0; }
-} // namespace matcher_test
-
-TEST(MatcherMacroTest, WorksInNamespace) {
- Matcher<int> m = matcher_test::IsOdd();
- EXPECT_FALSE(m.Matches(4));
- EXPECT_TRUE(m.Matches(5));
-}
-
-// Tests that Value() can be used to compose matchers.
-MATCHER(IsPositiveOdd, "") {
- return Value(arg, matcher_test::IsOdd()) && arg > 0;
-}
-
-TEST(MatcherMacroTest, CanBeComposedUsingValue) {
- EXPECT_THAT(3, IsPositiveOdd());
- EXPECT_THAT(4, Not(IsPositiveOdd()));
- EXPECT_THAT(-1, Not(IsPositiveOdd()));
-}
-
-// Tests that a simple MATCHER_P() definition works.
-
-MATCHER_P(IsGreaterThan32And, n, "") { return arg > 32 && arg > n; }
-
-TEST(MatcherPMacroTest, Works) {
- const Matcher<int> m = IsGreaterThan32And(5);
- EXPECT_TRUE(m.Matches(36));
- EXPECT_FALSE(m.Matches(5));
-
- EXPECT_EQ("is greater than 32 and (n: 5)", Describe(m));
- EXPECT_EQ("not (is greater than 32 and (n: 5))", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36));
- EXPECT_EQ("", Explain(m, 5));
-}
-
-// Tests that the description is calculated correctly from the matcher name.
-MATCHER_P(_is_Greater_Than32and_, n, "") { return arg > 32 && arg > n; }
-
-TEST(MatcherPMacroTest, GeneratesCorrectDescription) {
- const Matcher<int> m = _is_Greater_Than32and_(5);
-
- EXPECT_EQ("is greater than 32 and (n: 5)", Describe(m));
- EXPECT_EQ("not (is greater than 32 and (n: 5))", DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36));
- EXPECT_EQ("", Explain(m, 5));
-}
-
-// Tests that a MATCHER_P matcher can be explicitly instantiated with
-// a reference parameter type.
-
-class UncopyableFoo {
- public:
- explicit UncopyableFoo(char value) : value_(value) { (void)value_; }
-
- UncopyableFoo(const UncopyableFoo&) = delete;
- void operator=(const UncopyableFoo&) = delete;
-
- private:
- char value_;
-};
-
-MATCHER_P(ReferencesUncopyable, variable, "") { return &arg == &variable; }
-
-TEST(MatcherPMacroTest, WorksWhenExplicitlyInstantiatedWithReference) {
- UncopyableFoo foo1('1'), foo2('2');
- const Matcher<const UncopyableFoo&> m =
- ReferencesUncopyable<const UncopyableFoo&>(foo1);
-
- EXPECT_TRUE(m.Matches(foo1));
- EXPECT_FALSE(m.Matches(foo2));
-
- // We don't want the address of the parameter printed, as most
- // likely it will just annoy the user. If the address is
- // interesting, the user should consider passing the parameter by
- // pointer instead.
- EXPECT_EQ("references uncopyable (variable: 1-byte object <31>)",
- Describe(m));
-}
-
-// Tests that the body of MATCHER_Pn() can reference the parameter
-// types.
-
-MATCHER_P3(ParamTypesAreIntLongAndChar, foo, bar, baz, "") {
- StaticAssertTypeEq<int, foo_type>();
- StaticAssertTypeEq<long, bar_type>(); // NOLINT
- StaticAssertTypeEq<char, baz_type>();
- return arg == 0;
-}
-
-TEST(MatcherPnMacroTest, CanReferenceParamTypes) {
- EXPECT_THAT(0, ParamTypesAreIntLongAndChar(10, 20L, 'a'));
-}
-
-// Tests that a MATCHER_Pn matcher can be explicitly instantiated with
-// reference parameter types.
-
-MATCHER_P2(ReferencesAnyOf, variable1, variable2, "") {
- return &arg == &variable1 || &arg == &variable2;
-}
-
-TEST(MatcherPnMacroTest, WorksWhenExplicitlyInstantiatedWithReferences) {
- UncopyableFoo foo1('1'), foo2('2'), foo3('3');
- const Matcher<const UncopyableFoo&> const_m =
- ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
-
- EXPECT_TRUE(const_m.Matches(foo1));
- EXPECT_TRUE(const_m.Matches(foo2));
- EXPECT_FALSE(const_m.Matches(foo3));
-
- const Matcher<UncopyableFoo&> m =
- ReferencesAnyOf<UncopyableFoo&, UncopyableFoo&>(foo1, foo2);
-
- EXPECT_TRUE(m.Matches(foo1));
- EXPECT_TRUE(m.Matches(foo2));
- EXPECT_FALSE(m.Matches(foo3));
-}
-
-TEST(MatcherPnMacroTest,
- GeneratesCorretDescriptionWhenExplicitlyInstantiatedWithReferences) {
- UncopyableFoo foo1('1'), foo2('2');
- const Matcher<const UncopyableFoo&> m =
- ReferencesAnyOf<const UncopyableFoo&, const UncopyableFoo&>(foo1, foo2);
-
- // We don't want the addresses of the parameters printed, as most
- // likely they will just annoy the user. If the addresses are
- // interesting, the user should consider passing the parameters by
- // pointers instead.
- EXPECT_EQ(
- "references any of (variable1: 1-byte object <31>, variable2: 1-byte "
- "object <32>)",
- Describe(m));
-}
-
-// Tests that a simple MATCHER_P2() definition works.
-
-MATCHER_P2(IsNotInClosedRange, low, hi, "") { return arg < low || arg > hi; }
-
-TEST(MatcherPnMacroTest, Works) {
- const Matcher<const long&> m = IsNotInClosedRange(10, 20); // NOLINT
- EXPECT_TRUE(m.Matches(36L));
- EXPECT_FALSE(m.Matches(15L));
-
- EXPECT_EQ("is not in closed range (low: 10, hi: 20)", Describe(m));
- EXPECT_EQ("not (is not in closed range (low: 10, hi: 20))",
- DescribeNegation(m));
- EXPECT_EQ("", Explain(m, 36L));
- EXPECT_EQ("", Explain(m, 15L));
-}
-
-// Tests that MATCHER*() definitions can be overloaded on the number
-// of parameters; also tests MATCHER_Pn() where n >= 3.
-
-MATCHER(EqualsSumOf, "") { return arg == 0; }
-MATCHER_P(EqualsSumOf, a, "") { return arg == a; }
-MATCHER_P2(EqualsSumOf, a, b, "") { return arg == a + b; }
-MATCHER_P3(EqualsSumOf, a, b, c, "") { return arg == a + b + c; }
-MATCHER_P4(EqualsSumOf, a, b, c, d, "") { return arg == a + b + c + d; }
-MATCHER_P5(EqualsSumOf, a, b, c, d, e, "") { return arg == a + b + c + d + e; }
-MATCHER_P6(EqualsSumOf, a, b, c, d, e, f, "") {
- return arg == a + b + c + d + e + f;
-}
-MATCHER_P7(EqualsSumOf, a, b, c, d, e, f, g, "") {
- return arg == a + b + c + d + e + f + g;
-}
-MATCHER_P8(EqualsSumOf, a, b, c, d, e, f, g, h, "") {
- return arg == a + b + c + d + e + f + g + h;
-}
-MATCHER_P9(EqualsSumOf, a, b, c, d, e, f, g, h, i, "") {
- return arg == a + b + c + d + e + f + g + h + i;
-}
-MATCHER_P10(EqualsSumOf, a, b, c, d, e, f, g, h, i, j, "") {
- return arg == a + b + c + d + e + f + g + h + i + j;
-}
-
-TEST(MatcherPnMacroTest, CanBeOverloadedOnNumberOfParameters) {
- EXPECT_THAT(0, EqualsSumOf());
- EXPECT_THAT(1, EqualsSumOf(1));
- EXPECT_THAT(12, EqualsSumOf(10, 2));
- EXPECT_THAT(123, EqualsSumOf(100, 20, 3));
- EXPECT_THAT(1234, EqualsSumOf(1000, 200, 30, 4));
- EXPECT_THAT(12345, EqualsSumOf(10000, 2000, 300, 40, 5));
- EXPECT_THAT("abcdef",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f'));
- EXPECT_THAT("abcdefg",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g'));
- EXPECT_THAT("abcdefgh", EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e",
- 'f', 'g', "h"));
- EXPECT_THAT("abcdefghi", EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e",
- 'f', 'g', "h", 'i'));
- EXPECT_THAT("abcdefghij",
- EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g', "h",
- 'i', ::std::string("j")));
-
- EXPECT_THAT(1, Not(EqualsSumOf()));
- EXPECT_THAT(-1, Not(EqualsSumOf(1)));
- EXPECT_THAT(-12, Not(EqualsSumOf(10, 2)));
- EXPECT_THAT(-123, Not(EqualsSumOf(100, 20, 3)));
- EXPECT_THAT(-1234, Not(EqualsSumOf(1000, 200, 30, 4)));
- EXPECT_THAT(-12345, Not(EqualsSumOf(10000, 2000, 300, 40, 5)));
- EXPECT_THAT("abcdef ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f')));
- EXPECT_THAT("abcdefg ", Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d",
- "e", 'f', 'g')));
- EXPECT_THAT("abcdefgh ", Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d",
- "e", 'f', 'g', "h")));
- EXPECT_THAT("abcdefghi ", Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d",
- "e", 'f', 'g', "h", 'i')));
- EXPECT_THAT("abcdefghij ",
- Not(EqualsSumOf(::std::string("a"), 'b', 'c', "d", "e", 'f', 'g',
- "h", 'i', ::std::string("j"))));
-}
-
-// Tests that a MATCHER_Pn() definition can be instantiated with any
-// compatible parameter types.
-TEST(MatcherPnMacroTest, WorksForDifferentParameterTypes) {
- EXPECT_THAT(123, EqualsSumOf(100L, 20, static_cast<char>(3)));
- EXPECT_THAT("abcd", EqualsSumOf(::std::string("a"), "b", 'c', "d"));
-
- EXPECT_THAT(124, Not(EqualsSumOf(100L, 20, static_cast<char>(3))));
- EXPECT_THAT("abcde", Not(EqualsSumOf(::std::string("a"), "b", 'c', "d")));
-}
-
-// Tests that the matcher body can promote the parameter types.
-
-MATCHER_P2(EqConcat, prefix, suffix, "") {
- // The following lines promote the two parameters to desired types.
- std::string prefix_str(prefix);
- char suffix_char = static_cast<char>(suffix);
- return arg == prefix_str + suffix_char;
-}
-
-TEST(MatcherPnMacroTest, SimpleTypePromotion) {
- Matcher<std::string> no_promo = EqConcat(std::string("foo"), 't');
- Matcher<const std::string&> promo = EqConcat("foo", static_cast<int>('t'));
- EXPECT_FALSE(no_promo.Matches("fool"));
- EXPECT_FALSE(promo.Matches("fool"));
- EXPECT_TRUE(no_promo.Matches("foot"));
- EXPECT_TRUE(promo.Matches("foot"));
-}
-
-// Verifies the type of a MATCHER*.
-
-TEST(MatcherPnMacroTest, TypesAreCorrect) {
- // EqualsSumOf() must be assignable to a EqualsSumOfMatcher variable.
- EqualsSumOfMatcher a0 = EqualsSumOf();
-
- // EqualsSumOf(1) must be assignable to a EqualsSumOfMatcherP variable.
- EqualsSumOfMatcherP<int> a1 = EqualsSumOf(1);
-
- // EqualsSumOf(p1, ..., pk) must be assignable to a EqualsSumOfMatcherPk
- // variable, and so on.
- EqualsSumOfMatcherP2<int, char> a2 = EqualsSumOf(1, '2');
- EqualsSumOfMatcherP3<int, int, char> a3 = EqualsSumOf(1, 2, '3');
- EqualsSumOfMatcherP4<int, int, int, char> a4 = EqualsSumOf(1, 2, 3, '4');
- EqualsSumOfMatcherP5<int, int, int, int, char> a5 =
- EqualsSumOf(1, 2, 3, 4, '5');
- EqualsSumOfMatcherP6<int, int, int, int, int, char> a6 =
- EqualsSumOf(1, 2, 3, 4, 5, '6');
- EqualsSumOfMatcherP7<int, int, int, int, int, int, char> a7 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, '7');
- EqualsSumOfMatcherP8<int, int, int, int, int, int, int, char> a8 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, '8');
- EqualsSumOfMatcherP9<int, int, int, int, int, int, int, int, char> a9 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, '9');
- EqualsSumOfMatcherP10<int, int, int, int, int, int, int, int, int, char> a10 =
- EqualsSumOf(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
-
- // Avoid "unused variable" warnings.
- (void)a0;
- (void)a1;
- (void)a2;
- (void)a3;
- (void)a4;
- (void)a5;
- (void)a6;
- (void)a7;
- (void)a8;
- (void)a9;
- (void)a10;
-}
-
-// Tests that matcher-typed parameters can be used in Value() inside a
-// MATCHER_Pn definition.
-
-// Succeeds if arg matches exactly 2 of the 3 matchers.
-MATCHER_P3(TwoOf, m1, m2, m3, "") {
- const int count = static_cast<int>(Value(arg, m1)) +
- static_cast<int>(Value(arg, m2)) +
- static_cast<int>(Value(arg, m3));
- return count == 2;
-}
-
-TEST(MatcherPnMacroTest, CanUseMatcherTypedParameterInValue) {
- EXPECT_THAT(42, TwoOf(Gt(0), Lt(50), Eq(10)));
- EXPECT_THAT(0, Not(TwoOf(Gt(-1), Lt(1), Eq(0))));
-}
-
-// Tests Contains().
-
-TEST(ContainsTest, ListMatchesWhenElementIsInContainer) {
- list<int> some_list;
- some_list.push_back(3);
- some_list.push_back(1);
- some_list.push_back(2);
- some_list.push_back(3);
- EXPECT_THAT(some_list, Contains(1));
- EXPECT_THAT(some_list, Contains(Gt(2.5)));
- EXPECT_THAT(some_list, Contains(Eq(2.0f)));
-
- list<std::string> another_list;
- another_list.push_back("fee");
- another_list.push_back("fie");
- another_list.push_back("foe");
- another_list.push_back("fum");
- EXPECT_THAT(another_list, Contains(std::string("fee")));
-}
-
-TEST(ContainsTest, ListDoesNotMatchWhenElementIsNotInContainer) {
- list<int> some_list;
- some_list.push_back(3);
- some_list.push_back(1);
- EXPECT_THAT(some_list, Not(Contains(4)));
-}
-
-TEST(ContainsTest, SetMatchesWhenElementIsInContainer) {
- set<int> some_set;
- some_set.insert(3);
- some_set.insert(1);
- some_set.insert(2);
- EXPECT_THAT(some_set, Contains(Eq(1.0)));
- EXPECT_THAT(some_set, Contains(Eq(3.0f)));
- EXPECT_THAT(some_set, Contains(2));
-
- set<std::string> another_set;
- another_set.insert("fee");
- another_set.insert("fie");
- another_set.insert("foe");
- another_set.insert("fum");
- EXPECT_THAT(another_set, Contains(Eq(std::string("fum"))));
-}
-
-TEST(ContainsTest, SetDoesNotMatchWhenElementIsNotInContainer) {
- set<int> some_set;
- some_set.insert(3);
- some_set.insert(1);
- EXPECT_THAT(some_set, Not(Contains(4)));
-
- set<std::string> c_string_set;
- c_string_set.insert("hello");
- EXPECT_THAT(c_string_set, Not(Contains(std::string("goodbye"))));
-}
-
-TEST(ContainsTest, ExplainsMatchResultCorrectly) {
- const int a[2] = {1, 2};
- Matcher<const int(&)[2]> m = Contains(2);
- EXPECT_EQ("whose element #1 matches", Explain(m, a));
-
- m = Contains(3);
- EXPECT_EQ("", Explain(m, a));
-
- m = Contains(GreaterThan(0));
- EXPECT_EQ("whose element #0 matches, which is 1 more than 0", Explain(m, a));
-
- m = Contains(GreaterThan(10));
- EXPECT_EQ("", Explain(m, a));
-}
-
-TEST(ContainsTest, DescribesItselfCorrectly) {
- Matcher<vector<int>> m = Contains(1);
- EXPECT_EQ("contains at least one element that is equal to 1", Describe(m));
-
- Matcher<vector<int>> m2 = Not(m);
- EXPECT_EQ("doesn't contain any element that is equal to 1", Describe(m2));
-}
-
-TEST(ContainsTest, MapMatchesWhenElementIsInContainer) {
- map<std::string, int> my_map;
- const char* bar = "a string";
- my_map[bar] = 2;
- EXPECT_THAT(my_map, Contains(pair<const char* const, int>(bar, 2)));
-
- map<std::string, int> another_map;
- another_map["fee"] = 1;
- another_map["fie"] = 2;
- another_map["foe"] = 3;
- another_map["fum"] = 4;
- EXPECT_THAT(another_map,
- Contains(pair<const std::string, int>(std::string("fee"), 1)));
- EXPECT_THAT(another_map, Contains(pair<const std::string, int>("fie", 2)));
-}
-
-TEST(ContainsTest, MapDoesNotMatchWhenElementIsNotInContainer) {
- map<int, int> some_map;
- some_map[1] = 11;
- some_map[2] = 22;
- EXPECT_THAT(some_map, Not(Contains(pair<const int, int>(2, 23))));
-}
-
-TEST(ContainsTest, ArrayMatchesWhenElementIsInContainer) {
- const char* string_array[] = {"fee", "fie", "foe", "fum"};
- EXPECT_THAT(string_array, Contains(Eq(std::string("fum"))));
-}
-
-TEST(ContainsTest, ArrayDoesNotMatchWhenElementIsNotInContainer) {
- int int_array[] = {1, 2, 3, 4};
- EXPECT_THAT(int_array, Not(Contains(5)));
-}
-
-TEST(ContainsTest, AcceptsMatcher) {
- const int a[] = {1, 2, 3};
- EXPECT_THAT(a, Contains(Gt(2)));
- EXPECT_THAT(a, Not(Contains(Gt(4))));
-}
-
-TEST(ContainsTest, WorksForNativeArrayAsTuple) {
- const int a[] = {1, 2};
- const int* const pointer = a;
- EXPECT_THAT(std::make_tuple(pointer, 2), Contains(1));
- EXPECT_THAT(std::make_tuple(pointer, 2), Not(Contains(Gt(3))));
-}
-
-TEST(ContainsTest, WorksForTwoDimensionalNativeArray) {
- int a[][3] = {{1, 2, 3}, {4, 5, 6}};
- EXPECT_THAT(a, Contains(ElementsAre(4, 5, 6)));
- EXPECT_THAT(a, Contains(Contains(5)));
- EXPECT_THAT(a, Not(Contains(ElementsAre(3, 4, 5))));
- EXPECT_THAT(a, Contains(Not(Contains(5))));
-}
-
-// Tests Contains().Times().
-
-TEST(ContainsTimes, ListMatchesWhenElementQuantityMatches) {
- list<int> some_list;
- some_list.push_back(3);
- some_list.push_back(1);
- some_list.push_back(2);
- some_list.push_back(3);
- EXPECT_THAT(some_list, Contains(3).Times(2));
- EXPECT_THAT(some_list, Contains(2).Times(1));
- EXPECT_THAT(some_list, Contains(Ge(2)).Times(3));
- EXPECT_THAT(some_list, Contains(Ge(2)).Times(Gt(2)));
- EXPECT_THAT(some_list, Contains(4).Times(0));
- EXPECT_THAT(some_list, Contains(_).Times(4));
- EXPECT_THAT(some_list, Not(Contains(5).Times(1)));
- EXPECT_THAT(some_list, Contains(5).Times(_)); // Times(_) always matches
- EXPECT_THAT(some_list, Not(Contains(3).Times(1)));
- EXPECT_THAT(some_list, Contains(3).Times(Not(1)));
- EXPECT_THAT(list<int>{}, Not(Contains(_)));
-}
-
-TEST(ContainsTimes, ExplainsMatchResultCorrectly) {
- const int a[2] = {1, 2};
- Matcher<const int(&)[2]> m = Contains(2).Times(3);
- EXPECT_EQ(
- "whose element #1 matches but whose match quantity of 1 does not match",
- Explain(m, a));
-
- m = Contains(3).Times(0);
- EXPECT_EQ("has no element that matches and whose match quantity of 0 matches",
- Explain(m, a));
-
- m = Contains(3).Times(4);
- EXPECT_EQ(
- "has no element that matches and whose match quantity of 0 does not "
- "match",
- Explain(m, a));
-
- m = Contains(2).Times(4);
- EXPECT_EQ(
- "whose element #1 matches but whose match quantity of 1 does not "
- "match",
- Explain(m, a));
-
- m = Contains(GreaterThan(0)).Times(2);
- EXPECT_EQ("whose elements (0, 1) match and whose match quantity of 2 matches",
- Explain(m, a));
-
- m = Contains(GreaterThan(10)).Times(Gt(1));
- EXPECT_EQ(
- "has no element that matches and whose match quantity of 0 does not "
- "match",
- Explain(m, a));
-
- m = Contains(GreaterThan(0)).Times(GreaterThan<size_t>(5));
- EXPECT_EQ(
- "whose elements (0, 1) match but whose match quantity of 2 does not "
- "match, which is 3 less than 5",
- Explain(m, a));
-}
-
-TEST(ContainsTimes, DescribesItselfCorrectly) {
- Matcher<vector<int>> m = Contains(1).Times(2);
- EXPECT_EQ("quantity of elements that match is equal to 1 is equal to 2",
- Describe(m));
-
- Matcher<vector<int>> m2 = Not(m);
- EXPECT_EQ("quantity of elements that match is equal to 1 isn't equal to 2",
- Describe(m2));
-}
-
-// Tests AllOfArray()
-
-TEST(AllOfArrayTest, BasicForms) {
- // Iterator
- std::vector<int> v0{};
- std::vector<int> v1{1};
- std::vector<int> v2{2, 3};
- std::vector<int> v3{4, 4, 4};
- EXPECT_THAT(0, AllOfArray(v0.begin(), v0.end()));
- EXPECT_THAT(1, AllOfArray(v1.begin(), v1.end()));
- EXPECT_THAT(2, Not(AllOfArray(v1.begin(), v1.end())));
- EXPECT_THAT(3, Not(AllOfArray(v2.begin(), v2.end())));
- EXPECT_THAT(4, AllOfArray(v3.begin(), v3.end()));
- // Pointer + size
- int ar[6] = {1, 2, 3, 4, 4, 4};
- EXPECT_THAT(0, AllOfArray(ar, 0));
- EXPECT_THAT(1, AllOfArray(ar, 1));
- EXPECT_THAT(2, Not(AllOfArray(ar, 1)));
- EXPECT_THAT(3, Not(AllOfArray(ar + 1, 3)));
- EXPECT_THAT(4, AllOfArray(ar + 3, 3));
- // Array
- // int ar0[0]; Not usable
- int ar1[1] = {1};
- int ar2[2] = {2, 3};
- int ar3[3] = {4, 4, 4};
- // EXPECT_THAT(0, Not(AllOfArray(ar0))); // Cannot work
- EXPECT_THAT(1, AllOfArray(ar1));
- EXPECT_THAT(2, Not(AllOfArray(ar1)));
- EXPECT_THAT(3, Not(AllOfArray(ar2)));
- EXPECT_THAT(4, AllOfArray(ar3));
- // Container
- EXPECT_THAT(0, AllOfArray(v0));
- EXPECT_THAT(1, AllOfArray(v1));
- EXPECT_THAT(2, Not(AllOfArray(v1)));
- EXPECT_THAT(3, Not(AllOfArray(v2)));
- EXPECT_THAT(4, AllOfArray(v3));
- // Initializer
- EXPECT_THAT(0, AllOfArray<int>({})); // Requires template arg.
- EXPECT_THAT(1, AllOfArray({1}));
- EXPECT_THAT(2, Not(AllOfArray({1})));
- EXPECT_THAT(3, Not(AllOfArray({2, 3})));
- EXPECT_THAT(4, AllOfArray({4, 4, 4}));
-}
-
-TEST(AllOfArrayTest, Matchers) {
- // vector
- std::vector<Matcher<int>> matchers{Ge(1), Lt(2)};
- EXPECT_THAT(0, Not(AllOfArray(matchers)));
- EXPECT_THAT(1, AllOfArray(matchers));
- EXPECT_THAT(2, Not(AllOfArray(matchers)));
- // initializer_list
- EXPECT_THAT(0, Not(AllOfArray({Ge(0), Ge(1)})));
- EXPECT_THAT(1, AllOfArray({Ge(0), Ge(1)}));
-}
-
-TEST(AnyOfArrayTest, BasicForms) {
- // Iterator
- std::vector<int> v0{};
- std::vector<int> v1{1};
- std::vector<int> v2{2, 3};
- EXPECT_THAT(0, Not(AnyOfArray(v0.begin(), v0.end())));
- EXPECT_THAT(1, AnyOfArray(v1.begin(), v1.end()));
- EXPECT_THAT(2, Not(AnyOfArray(v1.begin(), v1.end())));
- EXPECT_THAT(3, AnyOfArray(v2.begin(), v2.end()));
- EXPECT_THAT(4, Not(AnyOfArray(v2.begin(), v2.end())));
- // Pointer + size
- int ar[3] = {1, 2, 3};
- EXPECT_THAT(0, Not(AnyOfArray(ar, 0)));
- EXPECT_THAT(1, AnyOfArray(ar, 1));
- EXPECT_THAT(2, Not(AnyOfArray(ar, 1)));
- EXPECT_THAT(3, AnyOfArray(ar + 1, 2));
- EXPECT_THAT(4, Not(AnyOfArray(ar + 1, 2)));
- // Array
- // int ar0[0]; Not usable
- int ar1[1] = {1};
- int ar2[2] = {2, 3};
- // EXPECT_THAT(0, Not(AnyOfArray(ar0))); // Cannot work
- EXPECT_THAT(1, AnyOfArray(ar1));
- EXPECT_THAT(2, Not(AnyOfArray(ar1)));
- EXPECT_THAT(3, AnyOfArray(ar2));
- EXPECT_THAT(4, Not(AnyOfArray(ar2)));
- // Container
- EXPECT_THAT(0, Not(AnyOfArray(v0)));
- EXPECT_THAT(1, AnyOfArray(v1));
- EXPECT_THAT(2, Not(AnyOfArray(v1)));
- EXPECT_THAT(3, AnyOfArray(v2));
- EXPECT_THAT(4, Not(AnyOfArray(v2)));
- // Initializer
- EXPECT_THAT(0, Not(AnyOfArray<int>({}))); // Requires template arg.
- EXPECT_THAT(1, AnyOfArray({1}));
- EXPECT_THAT(2, Not(AnyOfArray({1})));
- EXPECT_THAT(3, AnyOfArray({2, 3}));
- EXPECT_THAT(4, Not(AnyOfArray({2, 3})));
-}
-
-TEST(AnyOfArrayTest, Matchers) {
- // We negate test AllOfArrayTest.Matchers.
- // vector
- std::vector<Matcher<int>> matchers{Lt(1), Ge(2)};
- EXPECT_THAT(0, AnyOfArray(matchers));
- EXPECT_THAT(1, Not(AnyOfArray(matchers)));
- EXPECT_THAT(2, AnyOfArray(matchers));
- // initializer_list
- EXPECT_THAT(0, AnyOfArray({Lt(0), Lt(1)}));
- EXPECT_THAT(1, Not(AllOfArray({Lt(0), Lt(1)})));
-}
-
-TEST(AnyOfArrayTest, ExplainsMatchResultCorrectly) {
- // AnyOfArray and AllOfArry use the same underlying template-template,
- // thus it is sufficient to test one here.
- const std::vector<int> v0{};
- const std::vector<int> v1{1};
- const std::vector<int> v2{2, 3};
- const Matcher<int> m0 = AnyOfArray(v0);
- const Matcher<int> m1 = AnyOfArray(v1);
- const Matcher<int> m2 = AnyOfArray(v2);
- EXPECT_EQ("", Explain(m0, 0));
- EXPECT_EQ("", Explain(m1, 1));
- EXPECT_EQ("", Explain(m1, 2));
- EXPECT_EQ("", Explain(m2, 3));
- EXPECT_EQ("", Explain(m2, 4));
- EXPECT_EQ("()", Describe(m0));
- EXPECT_EQ("(is equal to 1)", Describe(m1));
- EXPECT_EQ("(is equal to 2) or (is equal to 3)", Describe(m2));
- EXPECT_EQ("()", DescribeNegation(m0));
- EXPECT_EQ("(isn't equal to 1)", DescribeNegation(m1));
- EXPECT_EQ("(isn't equal to 2) and (isn't equal to 3)", DescribeNegation(m2));
- // Explain with matchers
- const Matcher<int> g1 = AnyOfArray({GreaterThan(1)});
- const Matcher<int> g2 = AnyOfArray({GreaterThan(1), GreaterThan(2)});
- // Explains the first positive match and all prior negative matches...
- EXPECT_EQ("which is 1 less than 1", Explain(g1, 0));
- EXPECT_EQ("which is the same as 1", Explain(g1, 1));
- EXPECT_EQ("which is 1 more than 1", Explain(g1, 2));
- EXPECT_EQ("which is 1 less than 1, and which is 2 less than 2",
- Explain(g2, 0));
- EXPECT_EQ("which is the same as 1, and which is 1 less than 2",
- Explain(g2, 1));
- EXPECT_EQ("which is 1 more than 1", // Only the first
- Explain(g2, 2));
-}
-
-TEST(AllOfTest, HugeMatcher) {
- // Verify that using AllOf with many arguments doesn't cause
- // the compiler to exceed template instantiation depth limit.
- EXPECT_THAT(0, testing::AllOf(_, _, _, _, _, _, _, _, _,
- testing::AllOf(_, _, _, _, _, _, _, _, _, _)));
-}
-
-TEST(AnyOfTest, HugeMatcher) {
- // Verify that using AnyOf with many arguments doesn't cause
- // the compiler to exceed template instantiation depth limit.
- EXPECT_THAT(0, testing::AnyOf(_, _, _, _, _, _, _, _, _,
- testing::AnyOf(_, _, _, _, _, _, _, _, _, _)));
-}
-
-namespace adl_test {
-
-// Verifies that the implementation of ::testing::AllOf and ::testing::AnyOf
-// don't issue unqualified recursive calls. If they do, the argument dependent
-// name lookup will cause AllOf/AnyOf in the 'adl_test' namespace to be found
-// as a candidate and the compilation will break due to an ambiguous overload.
-
-// The matcher must be in the same namespace as AllOf/AnyOf to make argument
-// dependent lookup find those.
-MATCHER(M, "") {
- (void)arg;
- return true;
-}
-
-template <typename T1, typename T2>
-bool AllOf(const T1& /*t1*/, const T2& /*t2*/) {
- return true;
-}
-
-TEST(AllOfTest, DoesNotCallAllOfUnqualified) {
- EXPECT_THAT(42,
- testing::AllOf(M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
-}
-
-template <typename T1, typename T2>
-bool AnyOf(const T1&, const T2&) {
- return true;
-}
-
-TEST(AnyOfTest, DoesNotCallAnyOfUnqualified) {
- EXPECT_THAT(42,
- testing::AnyOf(M(), M(), M(), M(), M(), M(), M(), M(), M(), M()));
-}
-
-} // namespace adl_test
-
-TEST(AllOfTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(5))));
- EXPECT_THAT(p, Not(AllOf(Pointee(Eq(3)), Pointee(Gt(0)), Pointee(Lt(3)))));
-}
-
-TEST(AnyOfTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Lt(5))));
- EXPECT_THAT(p, Not(AnyOf(Pointee(Eq(5)), Pointee(Lt(0)), Pointee(Gt(5)))));
-}
-
-MATCHER(IsNotNull, "") { return arg != nullptr; }
-
-// Verifies that a matcher defined using MATCHER() can work on
-// move-only types.
-TEST(MatcherMacroTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, IsNotNull());
- EXPECT_THAT(std::unique_ptr<int>(), Not(IsNotNull()));
-}
-
-MATCHER_P(UniquePointee, pointee, "") { return *arg == pointee; }
-
-// Verifies that a matcher defined using MATCHER_P*() can work on
-// move-only types.
-TEST(MatcherPMacroTest, WorksOnMoveOnlyType) {
- std::unique_ptr<int> p(new int(3));
- EXPECT_THAT(p, UniquePointee(3));
- EXPECT_THAT(p, Not(UniquePointee(2)));
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// std::function<void()> is used below for compatibility with older copies of
-// GCC. Normally, a raw lambda is all that is needed.
-
-// Test that examples from documentation compile
-TEST(ThrowsTest, Examples) {
- EXPECT_THAT(
- std::function<void()>([]() { throw std::runtime_error("message"); }),
- Throws<std::runtime_error>());
-
- EXPECT_THAT(
- std::function<void()>([]() { throw std::runtime_error("message"); }),
- ThrowsMessage<std::runtime_error>(HasSubstr("message")));
-}
-
-TEST(ThrowsTest, PrintsExceptionWhat) {
- EXPECT_THAT(
- std::function<void()>([]() { throw std::runtime_error("ABC123XYZ"); }),
- ThrowsMessage<std::runtime_error>(HasSubstr("ABC123XYZ")));
-}
-
-TEST(ThrowsTest, DoesNotGenerateDuplicateCatchClauseWarning) {
- EXPECT_THAT(std::function<void()>([]() { throw std::exception(); }),
- Throws<std::exception>());
-}
-
-TEST(ThrowsTest, CallableExecutedExactlyOnce) {
- size_t a = 0;
-
- EXPECT_THAT(std::function<void()>([&a]() {
- a++;
- throw 10;
- }),
- Throws<int>());
- EXPECT_EQ(a, 1u);
-
- EXPECT_THAT(std::function<void()>([&a]() {
- a++;
- throw std::runtime_error("message");
- }),
- Throws<std::runtime_error>());
- EXPECT_EQ(a, 2u);
-
- EXPECT_THAT(std::function<void()>([&a]() {
- a++;
- throw std::runtime_error("message");
- }),
- ThrowsMessage<std::runtime_error>(HasSubstr("message")));
- EXPECT_EQ(a, 3u);
-
- EXPECT_THAT(std::function<void()>([&a]() {
- a++;
- throw std::runtime_error("message");
- }),
- Throws<std::runtime_error>(
- Property(&std::runtime_error::what, HasSubstr("message"))));
- EXPECT_EQ(a, 4u);
-}
-
-TEST(ThrowsTest, Describe) {
- Matcher<std::function<void()>> matcher = Throws<std::runtime_error>();
- std::stringstream ss;
- matcher.DescribeTo(&ss);
- auto explanation = ss.str();
- EXPECT_THAT(explanation, HasSubstr("std::runtime_error"));
-}
-
-TEST(ThrowsTest, Success) {
- Matcher<std::function<void()>> matcher = Throws<std::runtime_error>();
- StringMatchResultListener listener;
- EXPECT_TRUE(matcher.MatchAndExplain(
- []() { throw std::runtime_error("error message"); }, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("std::runtime_error"));
-}
-
-TEST(ThrowsTest, FailWrongType) {
- Matcher<std::function<void()>> matcher = Throws<std::runtime_error>();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain(
- []() { throw std::logic_error("error message"); }, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("std::logic_error"));
- EXPECT_THAT(listener.str(), HasSubstr("\"error message\""));
-}
-
-TEST(ThrowsTest, FailWrongTypeNonStd) {
- Matcher<std::function<void()>> matcher = Throws<std::runtime_error>();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain([]() { throw 10; }, &listener));
- EXPECT_THAT(listener.str(),
- HasSubstr("throws an exception of an unknown type"));
-}
-
-TEST(ThrowsTest, FailNoThrow) {
- Matcher<std::function<void()>> matcher = Throws<std::runtime_error>();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain([]() { (void)0; }, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("does not throw any exception"));
-}
-
-class ThrowsPredicateTest
- : public TestWithParam<Matcher<std::function<void()>>> {};
-
-TEST_P(ThrowsPredicateTest, Describe) {
- Matcher<std::function<void()>> matcher = GetParam();
- std::stringstream ss;
- matcher.DescribeTo(&ss);
- auto explanation = ss.str();
- EXPECT_THAT(explanation, HasSubstr("std::runtime_error"));
- EXPECT_THAT(explanation, HasSubstr("error message"));
-}
-
-TEST_P(ThrowsPredicateTest, Success) {
- Matcher<std::function<void()>> matcher = GetParam();
- StringMatchResultListener listener;
- EXPECT_TRUE(matcher.MatchAndExplain(
- []() { throw std::runtime_error("error message"); }, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("std::runtime_error"));
-}
-
-TEST_P(ThrowsPredicateTest, FailWrongType) {
- Matcher<std::function<void()>> matcher = GetParam();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain(
- []() { throw std::logic_error("error message"); }, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("std::logic_error"));
- EXPECT_THAT(listener.str(), HasSubstr("\"error message\""));
-}
-
-TEST_P(ThrowsPredicateTest, FailWrongTypeNonStd) {
- Matcher<std::function<void()>> matcher = GetParam();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain([]() { throw 10; }, &listener));
- EXPECT_THAT(listener.str(),
- HasSubstr("throws an exception of an unknown type"));
-}
-
-TEST_P(ThrowsPredicateTest, FailNoThrow) {
- Matcher<std::function<void()>> matcher = GetParam();
- StringMatchResultListener listener;
- EXPECT_FALSE(matcher.MatchAndExplain([]() {}, &listener));
- EXPECT_THAT(listener.str(), HasSubstr("does not throw any exception"));
-}
-
-INSTANTIATE_TEST_SUITE_P(
- AllMessagePredicates, ThrowsPredicateTest,
- Values(Matcher<std::function<void()>>(
- ThrowsMessage<std::runtime_error>(HasSubstr("error message")))));
-
-// Tests that Throws<E1>(Matcher<E2>{}) compiles even when E2 != const E1&.
-TEST(ThrowsPredicateCompilesTest, ExceptionMatcherAcceptsBroadType) {
- {
- Matcher<std::function<void()>> matcher =
- ThrowsMessage<std::runtime_error>(HasSubstr("error message"));
- EXPECT_TRUE(
- matcher.Matches([]() { throw std::runtime_error("error message"); }));
- EXPECT_FALSE(
- matcher.Matches([]() { throw std::runtime_error("wrong message"); }));
- }
-
- {
- Matcher<uint64_t> inner = Eq(10);
- Matcher<std::function<void()>> matcher = Throws<uint32_t>(inner);
- EXPECT_TRUE(matcher.Matches([]() { throw(uint32_t) 10; }));
- EXPECT_FALSE(matcher.Matches([]() { throw(uint32_t) 11; }));
- }
-}
-
-// Tests that ThrowsMessage("message") is equivalent
-// to ThrowsMessage(Eq<std::string>("message")).
-TEST(ThrowsPredicateCompilesTest, MessageMatcherAcceptsNonMatcher) {
- Matcher<std::function<void()>> matcher =
- ThrowsMessage<std::runtime_error>("error message");
- EXPECT_TRUE(
- matcher.Matches([]() { throw std::runtime_error("error message"); }));
- EXPECT_FALSE(matcher.Matches(
- []() { throw std::runtime_error("wrong error message"); }));
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-} // namespace
-} // namespace gmock_matchers_test
-} // namespace testing
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-more-actions_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-more-actions_test.cc
deleted file mode 100644
index 53bb029f45..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-more-actions_test.cc
+++ /dev/null
@@ -1,1547 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the built-in actions in gmock-actions.h.
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4577)
-#endif
-
-#include "gmock/gmock-more-actions.h"
-
-#include <functional>
-#include <memory>
-#include <sstream>
-#include <string>
-
-#include "gmock/gmock.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace gmock_more_actions_test {
-
-using ::std::plus;
-using ::std::string;
-using testing::Action;
-using testing::DeleteArg;
-using testing::Invoke;
-using testing::ReturnArg;
-using testing::ReturnPointee;
-using testing::SaveArg;
-using testing::SaveArgPointee;
-using testing::SetArgReferee;
-using testing::Unused;
-using testing::WithArg;
-using testing::WithoutArgs;
-
-// For suppressing compiler warnings on conversion possibly losing precision.
-inline short Short(short n) { return n; } // NOLINT
-inline char Char(char ch) { return ch; }
-
-// Sample functions and functors for testing Invoke() and etc.
-int Nullary() { return 1; }
-
-bool g_done = false;
-
-bool Unary(int x) { return x < 0; }
-
-bool ByConstRef(const std::string& s) { return s == "Hi"; }
-
-const double g_double = 0;
-bool ReferencesGlobalDouble(const double& x) { return &x == &g_double; }
-
-struct UnaryFunctor {
- int operator()(bool x) { return x ? 1 : -1; }
-};
-
-const char* Binary(const char* input, short n) { return input + n; } // NOLINT
-
-int Ternary(int x, char y, short z) { return x + y + z; } // NOLINT
-
-int SumOf4(int a, int b, int c, int d) { return a + b + c + d; }
-
-int SumOfFirst2(int a, int b, Unused, Unused) { return a + b; }
-
-int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
-struct SumOf5Functor {
- int operator()(int a, int b, int c, int d, int e) {
- return a + b + c + d + e;
- }
-};
-
-int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
-}
-
-struct SumOf6Functor {
- int operator()(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-};
-
-std::string Concat7(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
-}
-
-std::string Concat8(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
-}
-
-std::string Concat9(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
-}
-
-std::string Concat10(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9,
- const char* s10) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
-}
-
-class Foo {
- public:
- Foo() : value_(123) {}
-
- int Nullary() const { return value_; }
-
- short Unary(long x) { return static_cast<short>(value_ + x); } // NOLINT
-
- std::string Binary(const std::string& str, char c) const { return str + c; }
-
- int Ternary(int x, bool y, char z) { return value_ + x + y*z; }
-
- int SumOf4(int a, int b, int c, int d) const {
- return a + b + c + d + value_;
- }
-
- int SumOfLast2(Unused, Unused, int a, int b) const { return a + b; }
-
- int SumOf5(int a, int b, int c, int d, int e) { return a + b + c + d + e; }
-
- int SumOf6(int a, int b, int c, int d, int e, int f) {
- return a + b + c + d + e + f;
- }
-
- std::string Concat7(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7;
- }
-
- std::string Concat8(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8;
- }
-
- std::string Concat9(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9;
- }
-
- std::string Concat10(const char* s1, const char* s2, const char* s3,
- const char* s4, const char* s5, const char* s6,
- const char* s7, const char* s8, const char* s9,
- const char* s10) {
- return std::string(s1) + s2 + s3 + s4 + s5 + s6 + s7 + s8 + s9 + s10;
- }
-
- private:
- int value_;
-};
-
-// Tests using Invoke() with a nullary function.
-TEST(InvokeTest, Nullary) {
- Action<int()> a = Invoke(Nullary); // NOLINT
- EXPECT_EQ(1, a.Perform(std::make_tuple()));
-}
-
-// Tests using Invoke() with a unary function.
-TEST(InvokeTest, Unary) {
- Action<bool(int)> a = Invoke(Unary); // NOLINT
- EXPECT_FALSE(a.Perform(std::make_tuple(1)));
- EXPECT_TRUE(a.Perform(std::make_tuple(-1)));
-}
-
-// Tests using Invoke() with a binary function.
-TEST(InvokeTest, Binary) {
- Action<const char*(const char*, short)> a = Invoke(Binary); // NOLINT
- const char* p = "Hello";
- EXPECT_EQ(p + 2, a.Perform(std::make_tuple(p, Short(2))));
-}
-
-// Tests using Invoke() with a ternary function.
-TEST(InvokeTest, Ternary) {
- Action<int(int, char, short)> a = Invoke(Ternary); // NOLINT
- EXPECT_EQ(6, a.Perform(std::make_tuple(1, '\2', Short(3))));
-}
-
-// Tests using Invoke() with a 4-argument function.
-TEST(InvokeTest, FunctionThatTakes4Arguments) {
- Action<int(int, int, int, int)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(1234, a.Perform(std::make_tuple(1000, 200, 30, 4)));
-}
-
-// Tests using Invoke() with a 5-argument function.
-TEST(InvokeTest, FunctionThatTakes5Arguments) {
- Action<int(int, int, int, int, int)> a = Invoke(SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(std::make_tuple(10000, 2000, 300, 40, 5)));
-}
-
-// Tests using Invoke() with a 6-argument function.
-TEST(InvokeTest, FunctionThatTakes6Arguments) {
- Action<int(int, int, int, int, int, int)> a = Invoke(SumOf6); // NOLINT
- EXPECT_EQ(123456,
- a.Perform(std::make_tuple(100000, 20000, 3000, 400, 50, 6)));
-}
-
-// A helper that turns the type of a C-string literal from const
-// char[N] to const char*.
-inline const char* CharPtr(const char* s) { return s; }
-
-// Tests using Invoke() with a 7-argument function.
-TEST(InvokeTest, FunctionThatTakes7Arguments) {
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*)>
- a = Invoke(Concat7);
- EXPECT_EQ("1234567",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
-}
-
-// Tests using Invoke() with a 8-argument function.
-TEST(InvokeTest, FunctionThatTakes8Arguments) {
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*)>
- a = Invoke(Concat8);
- EXPECT_EQ("12345678",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
-}
-
-// Tests using Invoke() with a 9-argument function.
-TEST(InvokeTest, FunctionThatTakes9Arguments) {
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*)>
- a = Invoke(Concat9);
- EXPECT_EQ("123456789", a.Perform(std::make_tuple(
- CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
-}
-
-// Tests using Invoke() with a 10-argument function.
-TEST(InvokeTest, FunctionThatTakes10Arguments) {
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*, const char*)>
- a = Invoke(Concat10);
- EXPECT_EQ("1234567890",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
-}
-
-// Tests using Invoke() with functions with parameters declared as Unused.
-TEST(InvokeTest, FunctionWithUnusedParameters) {
- Action<int(int, int, double, const std::string&)> a1 = Invoke(SumOfFirst2);
- std::tuple<int, int, double, std::string> dummy =
- std::make_tuple(10, 2, 5.6, std::string("hi"));
- EXPECT_EQ(12, a1.Perform(dummy));
-
- Action<int(int, int, bool, int*)> a2 =
- Invoke(SumOfFirst2);
- EXPECT_EQ(
- 23, a2.Perform(std::make_tuple(20, 3, true, static_cast<int*>(nullptr))));
-}
-
-// Tests using Invoke() with methods with parameters declared as Unused.
-TEST(InvokeTest, MethodWithUnusedParameters) {
- Foo foo;
- Action<int(std::string, bool, int, int)> a1 = Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(12, a1.Perform(std::make_tuple(CharPtr("hi"), true, 10, 2)));
-
- Action<int(char, double, int, int)> a2 =
- Invoke(&foo, &Foo::SumOfLast2);
- EXPECT_EQ(23, a2.Perform(std::make_tuple('a', 2.5, 20, 3)));
-}
-
-// Tests using Invoke() with a functor.
-TEST(InvokeTest, Functor) {
- Action<long(long, int)> a = Invoke(plus<long>()); // NOLINT
- EXPECT_EQ(3L, a.Perform(std::make_tuple(1, 2)));
-}
-
-// Tests using Invoke(f) as an action of a compatible type.
-TEST(InvokeTest, FunctionWithCompatibleType) {
- Action<long(int, short, char, bool)> a = Invoke(SumOf4); // NOLINT
- EXPECT_EQ(4321, a.Perform(std::make_tuple(4000, Short(300), Char(20), true)));
-}
-
-// Tests using Invoke() with an object pointer and a method pointer.
-
-// Tests using Invoke() with a nullary method.
-TEST(InvokeMethodTest, Nullary) {
- Foo foo;
- Action<int()> a = Invoke(&foo, &Foo::Nullary); // NOLINT
- EXPECT_EQ(123, a.Perform(std::make_tuple()));
-}
-
-// Tests using Invoke() with a unary method.
-TEST(InvokeMethodTest, Unary) {
- Foo foo;
- Action<short(long)> a = Invoke(&foo, &Foo::Unary); // NOLINT
- EXPECT_EQ(4123, a.Perform(std::make_tuple(4000)));
-}
-
-// Tests using Invoke() with a binary method.
-TEST(InvokeMethodTest, Binary) {
- Foo foo;
- Action<std::string(const std::string&, char)> a = Invoke(&foo, &Foo::Binary);
- std::string s("Hell");
- std::tuple<std::string, char> dummy = std::make_tuple(s, 'o');
- EXPECT_EQ("Hello", a.Perform(dummy));
-}
-
-// Tests using Invoke() with a ternary method.
-TEST(InvokeMethodTest, Ternary) {
- Foo foo;
- Action<int(int, bool, char)> a = Invoke(&foo, &Foo::Ternary); // NOLINT
- EXPECT_EQ(1124, a.Perform(std::make_tuple(1000, true, Char(1))));
-}
-
-// Tests using Invoke() with a 4-argument method.
-TEST(InvokeMethodTest, MethodThatTakes4Arguments) {
- Foo foo;
- Action<int(int, int, int, int)> a = Invoke(&foo, &Foo::SumOf4); // NOLINT
- EXPECT_EQ(1357, a.Perform(std::make_tuple(1000, 200, 30, 4)));
-}
-
-// Tests using Invoke() with a 5-argument method.
-TEST(InvokeMethodTest, MethodThatTakes5Arguments) {
- Foo foo;
- Action<int(int, int, int, int, int)> a = Invoke(&foo, &Foo::SumOf5); // NOLINT
- EXPECT_EQ(12345, a.Perform(std::make_tuple(10000, 2000, 300, 40, 5)));
-}
-
-// Tests using Invoke() with a 6-argument method.
-TEST(InvokeMethodTest, MethodThatTakes6Arguments) {
- Foo foo;
- Action<int(int, int, int, int, int, int)> a = // NOLINT
- Invoke(&foo, &Foo::SumOf6);
- EXPECT_EQ(123456,
- a.Perform(std::make_tuple(100000, 20000, 3000, 400, 50, 6)));
-}
-
-// Tests using Invoke() with a 7-argument method.
-TEST(InvokeMethodTest, MethodThatTakes7Arguments) {
- Foo foo;
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*)>
- a = Invoke(&foo, &Foo::Concat7);
- EXPECT_EQ("1234567",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"))));
-}
-
-// Tests using Invoke() with a 8-argument method.
-TEST(InvokeMethodTest, MethodThatTakes8Arguments) {
- Foo foo;
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*)>
- a = Invoke(&foo, &Foo::Concat8);
- EXPECT_EQ("12345678",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"))));
-}
-
-// Tests using Invoke() with a 9-argument method.
-TEST(InvokeMethodTest, MethodThatTakes9Arguments) {
- Foo foo;
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*)>
- a = Invoke(&foo, &Foo::Concat9);
- EXPECT_EQ("123456789", a.Perform(std::make_tuple(
- CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"))));
-}
-
-// Tests using Invoke() with a 10-argument method.
-TEST(InvokeMethodTest, MethodThatTakes10Arguments) {
- Foo foo;
- Action<std::string(const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*,
- const char*, const char*)>
- a = Invoke(&foo, &Foo::Concat10);
- EXPECT_EQ("1234567890",
- a.Perform(std::make_tuple(CharPtr("1"), CharPtr("2"), CharPtr("3"),
- CharPtr("4"), CharPtr("5"), CharPtr("6"),
- CharPtr("7"), CharPtr("8"), CharPtr("9"),
- CharPtr("0"))));
-}
-
-// Tests using Invoke(f) as an action of a compatible type.
-TEST(InvokeMethodTest, MethodWithCompatibleType) {
- Foo foo;
- Action<long(int, short, char, bool)> a = // NOLINT
- Invoke(&foo, &Foo::SumOf4);
- EXPECT_EQ(4444, a.Perform(std::make_tuple(4000, Short(300), Char(20), true)));
-}
-
-// Tests using WithoutArgs with an action that takes no argument.
-TEST(WithoutArgsTest, NoArg) {
- Action<int(int n)> a = WithoutArgs(Invoke(Nullary)); // NOLINT
- EXPECT_EQ(1, a.Perform(std::make_tuple(2)));
-}
-
-// Tests using WithArg with an action that takes 1 argument.
-TEST(WithArgTest, OneArg) {
- Action<bool(double x, int n)> b = WithArg<1>(Invoke(Unary)); // NOLINT
- EXPECT_TRUE(b.Perform(std::make_tuple(1.5, -1)));
- EXPECT_FALSE(b.Perform(std::make_tuple(1.5, 1)));
-}
-
-TEST(ReturnArgActionTest, WorksForOneArgIntArg0) {
- const Action<int(int)> a = ReturnArg<0>();
- EXPECT_EQ(5, a.Perform(std::make_tuple(5)));
-}
-
-TEST(ReturnArgActionTest, WorksForMultiArgBoolArg0) {
- const Action<bool(bool, bool, bool)> a = ReturnArg<0>();
- EXPECT_TRUE(a.Perform(std::make_tuple(true, false, false)));
-}
-
-TEST(ReturnArgActionTest, WorksForMultiArgStringArg2) {
- const Action<std::string(int, int, std::string, int)> a = ReturnArg<2>();
- EXPECT_EQ("seven", a.Perform(std::make_tuple(5, 6, std::string("seven"), 8)));
-}
-
-TEST(SaveArgActionTest, WorksForSameType) {
- int result = 0;
- const Action<void(int n)> a1 = SaveArg<0>(&result);
- a1.Perform(std::make_tuple(5));
- EXPECT_EQ(5, result);
-}
-
-TEST(SaveArgActionTest, WorksForCompatibleType) {
- int result = 0;
- const Action<void(bool, char)> a1 = SaveArg<1>(&result);
- a1.Perform(std::make_tuple(true, 'a'));
- EXPECT_EQ('a', result);
-}
-
-TEST(SaveArgPointeeActionTest, WorksForSameType) {
- int result = 0;
- const int value = 5;
- const Action<void(const int*)> a1 = SaveArgPointee<0>(&result);
- a1.Perform(std::make_tuple(&value));
- EXPECT_EQ(5, result);
-}
-
-TEST(SaveArgPointeeActionTest, WorksForCompatibleType) {
- int result = 0;
- char value = 'a';
- const Action<void(bool, char*)> a1 = SaveArgPointee<1>(&result);
- a1.Perform(std::make_tuple(true, &value));
- EXPECT_EQ('a', result);
-}
-
-TEST(SetArgRefereeActionTest, WorksForSameType) {
- int value = 0;
- const Action<void(int&)> a1 = SetArgReferee<0>(1);
- a1.Perform(std::tuple<int&>(value));
- EXPECT_EQ(1, value);
-}
-
-TEST(SetArgRefereeActionTest, WorksForCompatibleType) {
- int value = 0;
- const Action<void(int, int&)> a1 = SetArgReferee<1>('a');
- a1.Perform(std::tuple<int, int&>(0, value));
- EXPECT_EQ('a', value);
-}
-
-TEST(SetArgRefereeActionTest, WorksWithExtraArguments) {
- int value = 0;
- const Action<void(bool, int, int&, const char*)> a1 = SetArgReferee<2>('a');
- a1.Perform(std::tuple<bool, int, int&, const char*>(true, 0, value, "hi"));
- EXPECT_EQ('a', value);
-}
-
-// A class that can be used to verify that its destructor is called: it will set
-// the bool provided to the constructor to true when destroyed.
-class DeletionTester {
- public:
- explicit DeletionTester(bool* is_deleted)
- : is_deleted_(is_deleted) {
- // Make sure the bit is set to false.
- *is_deleted_ = false;
- }
-
- ~DeletionTester() {
- *is_deleted_ = true;
- }
-
- private:
- bool* is_deleted_;
-};
-
-TEST(DeleteArgActionTest, OneArg) {
- bool is_deleted = false;
- DeletionTester* t = new DeletionTester(&is_deleted);
- const Action<void(DeletionTester*)> a1 = DeleteArg<0>(); // NOLINT
- EXPECT_FALSE(is_deleted);
- a1.Perform(std::make_tuple(t));
- EXPECT_TRUE(is_deleted);
-}
-
-TEST(DeleteArgActionTest, TenArgs) {
- bool is_deleted = false;
- DeletionTester* t = new DeletionTester(&is_deleted);
- const Action<void(bool, int, int, const char*, bool,
- int, int, int, int, DeletionTester*)> a1 = DeleteArg<9>();
- EXPECT_FALSE(is_deleted);
- a1.Perform(std::make_tuple(true, 5, 6, CharPtr("hi"), false, 7, 8, 9, 10, t));
- EXPECT_TRUE(is_deleted);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInVoidFunction) {
- const Action<void(int n)> a = Throw('a');
- EXPECT_THROW(a.Perform(std::make_tuple(0)), char);
-}
-
-class MyException {};
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInNonVoidFunction) {
- const Action<double(char ch)> a = Throw(MyException());
- EXPECT_THROW(a.Perform(std::make_tuple('0')), MyException);
-}
-
-TEST(ThrowActionTest, ThrowsGivenExceptionInNullaryFunction) {
- const Action<double()> a = Throw(MyException());
- EXPECT_THROW(a.Perform(std::make_tuple()), MyException);
-}
-
-class Object {
- public:
- virtual ~Object() {}
- virtual void Func() {}
-};
-
-class MockObject : public Object {
- public:
- ~MockObject() override {}
- MOCK_METHOD(void, Func, (), (override));
-};
-
-TEST(ThrowActionTest, Times0) {
- EXPECT_NONFATAL_FAILURE(
- [] {
- try {
- MockObject m;
- ON_CALL(m, Func()).WillByDefault([] { throw "something"; });
- EXPECT_CALL(m, Func()).Times(0);
- m.Func();
- } catch (...) {
- // Exception is caught but Times(0) still triggers a failure.
- }
- }(),
- "");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that SetArrayArgument<N>(first, last) sets the elements of the array
-// pointed to by the N-th (0-based) argument to values in range [first, last).
-TEST(SetArrayArgumentTest, SetsTheNthArray) {
- using MyFunction = void(bool, int*, char*);
- int numbers[] = { 1, 2, 3 };
- Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers + 3);
-
- int n[4] = {};
- int* pn = n;
- char ch[4] = {};
- char* pch = ch;
- a.Perform(std::make_tuple(true, pn, pch));
- EXPECT_EQ(1, n[0]);
- EXPECT_EQ(2, n[1]);
- EXPECT_EQ(3, n[2]);
- EXPECT_EQ(0, n[3]);
- EXPECT_EQ('\0', ch[0]);
- EXPECT_EQ('\0', ch[1]);
- EXPECT_EQ('\0', ch[2]);
- EXPECT_EQ('\0', ch[3]);
-
- // Tests first and last are iterators.
- std::string letters = "abc";
- a = SetArrayArgument<2>(letters.begin(), letters.end());
- std::fill_n(n, 4, 0);
- std::fill_n(ch, 4, '\0');
- a.Perform(std::make_tuple(true, pn, pch));
- EXPECT_EQ(0, n[0]);
- EXPECT_EQ(0, n[1]);
- EXPECT_EQ(0, n[2]);
- EXPECT_EQ(0, n[3]);
- EXPECT_EQ('a', ch[0]);
- EXPECT_EQ('b', ch[1]);
- EXPECT_EQ('c', ch[2]);
- EXPECT_EQ('\0', ch[3]);
-}
-
-// Tests SetArrayArgument<N>(first, last) where first == last.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithEmptyRange) {
- using MyFunction = void(bool, int*);
- int numbers[] = { 1, 2, 3 };
- Action<MyFunction> a = SetArrayArgument<1>(numbers, numbers);
-
- int n[4] = {};
- int* pn = n;
- a.Perform(std::make_tuple(true, pn));
- EXPECT_EQ(0, n[0]);
- EXPECT_EQ(0, n[1]);
- EXPECT_EQ(0, n[2]);
- EXPECT_EQ(0, n[3]);
-}
-
-// Tests SetArrayArgument<N>(first, last) where *first is convertible
-// (but not equal) to the argument type.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithConvertibleType) {
- using MyFunction = void(bool, int*);
- char chars[] = { 97, 98, 99 };
- Action<MyFunction> a = SetArrayArgument<1>(chars, chars + 3);
-
- int codes[4] = { 111, 222, 333, 444 };
- int* pcodes = codes;
- a.Perform(std::make_tuple(true, pcodes));
- EXPECT_EQ(97, codes[0]);
- EXPECT_EQ(98, codes[1]);
- EXPECT_EQ(99, codes[2]);
- EXPECT_EQ(444, codes[3]);
-}
-
-// Test SetArrayArgument<N>(first, last) with iterator as argument.
-TEST(SetArrayArgumentTest, SetsTheNthArrayWithIteratorArgument) {
- using MyFunction = void(bool, std::back_insert_iterator<std::string>);
- std::string letters = "abc";
- Action<MyFunction> a = SetArrayArgument<1>(letters.begin(), letters.end());
-
- std::string s;
- a.Perform(std::make_tuple(true, back_inserter(s)));
- EXPECT_EQ(letters, s);
-}
-
-TEST(ReturnPointeeTest, Works) {
- int n = 42;
- const Action<int()> a = ReturnPointee(&n);
- EXPECT_EQ(42, a.Perform(std::make_tuple()));
-
- n = 43;
- EXPECT_EQ(43, a.Perform(std::make_tuple()));
-}
-
-// Tests InvokeArgument<N>(...).
-
-// Tests using InvokeArgument with a nullary function.
-TEST(InvokeArgumentTest, Function0) {
- Action<int(int, int (*)())> a = InvokeArgument<1>(); // NOLINT
- EXPECT_EQ(1, a.Perform(std::make_tuple(2, &Nullary)));
-}
-
-// Tests using InvokeArgument with a unary function.
-TEST(InvokeArgumentTest, Functor1) {
- Action<int(UnaryFunctor)> a = InvokeArgument<0>(true); // NOLINT
- EXPECT_EQ(1, a.Perform(std::make_tuple(UnaryFunctor())));
-}
-
-// Tests using InvokeArgument with a 5-ary function.
-TEST(InvokeArgumentTest, Function5) {
- Action<int(int (*)(int, int, int, int, int))> a = // NOLINT
- InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(std::make_tuple(&SumOf5)));
-}
-
-// Tests using InvokeArgument with a 5-ary functor.
-TEST(InvokeArgumentTest, Functor5) {
- Action<int(SumOf5Functor)> a = // NOLINT
- InvokeArgument<0>(10000, 2000, 300, 40, 5);
- EXPECT_EQ(12345, a.Perform(std::make_tuple(SumOf5Functor())));
-}
-
-// Tests using InvokeArgument with a 6-ary function.
-TEST(InvokeArgumentTest, Function6) {
- Action<int(int (*)(int, int, int, int, int, int))> a = // NOLINT
- InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(std::make_tuple(&SumOf6)));
-}
-
-// Tests using InvokeArgument with a 6-ary functor.
-TEST(InvokeArgumentTest, Functor6) {
- Action<int(SumOf6Functor)> a = // NOLINT
- InvokeArgument<0>(100000, 20000, 3000, 400, 50, 6);
- EXPECT_EQ(123456, a.Perform(std::make_tuple(SumOf6Functor())));
-}
-
-// Tests using InvokeArgument with a 7-ary function.
-TEST(InvokeArgumentTest, Function7) {
- Action<std::string(std::string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*))>
- a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7");
- EXPECT_EQ("1234567", a.Perform(std::make_tuple(&Concat7)));
-}
-
-// Tests using InvokeArgument with a 8-ary function.
-TEST(InvokeArgumentTest, Function8) {
- Action<std::string(std::string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*, const char*))>
- a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8");
- EXPECT_EQ("12345678", a.Perform(std::make_tuple(&Concat8)));
-}
-
-// Tests using InvokeArgument with a 9-ary function.
-TEST(InvokeArgumentTest, Function9) {
- Action<std::string(std::string(*)(const char*, const char*, const char*,
- const char*, const char*, const char*,
- const char*, const char*, const char*))>
- a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9");
- EXPECT_EQ("123456789", a.Perform(std::make_tuple(&Concat9)));
-}
-
-// Tests using InvokeArgument with a 10-ary function.
-TEST(InvokeArgumentTest, Function10) {
- Action<std::string(std::string(*)(
- const char*, const char*, const char*, const char*, const char*,
- const char*, const char*, const char*, const char*, const char*))>
- a = InvokeArgument<0>("1", "2", "3", "4", "5", "6", "7", "8", "9", "0");
- EXPECT_EQ("1234567890", a.Perform(std::make_tuple(&Concat10)));
-}
-
-// Tests using InvokeArgument with a function that takes a pointer argument.
-TEST(InvokeArgumentTest, ByPointerFunction) {
- Action<const char*(const char* (*)(const char* input, short n))> // NOLINT
- a = InvokeArgument<0>(static_cast<const char*>("Hi"), Short(1));
- EXPECT_STREQ("i", a.Perform(std::make_tuple(&Binary)));
-}
-
-// Tests using InvokeArgument with a function that takes a const char*
-// by passing it a C-string literal.
-TEST(InvokeArgumentTest, FunctionWithCStringLiteral) {
- Action<const char*(const char* (*)(const char* input, short n))> // NOLINT
- a = InvokeArgument<0>("Hi", Short(1));
- EXPECT_STREQ("i", a.Perform(std::make_tuple(&Binary)));
-}
-
-// Tests using InvokeArgument with a function that takes a const reference.
-TEST(InvokeArgumentTest, ByConstReferenceFunction) {
- Action<bool(bool (*function)(const std::string& s))> a = // NOLINT
- InvokeArgument<0>(std::string("Hi"));
- // When action 'a' is constructed, it makes a copy of the temporary
- // string object passed to it, so it's OK to use 'a' later, when the
- // temporary object has already died.
- EXPECT_TRUE(a.Perform(std::make_tuple(&ByConstRef)));
-}
-
-// Tests using InvokeArgument with ByRef() and a function that takes a
-// const reference.
-TEST(InvokeArgumentTest, ByExplicitConstReferenceFunction) {
- Action<bool(bool (*)(const double& x))> a = // NOLINT
- InvokeArgument<0>(ByRef(g_double));
- // The above line calls ByRef() on a const value.
- EXPECT_TRUE(a.Perform(std::make_tuple(&ReferencesGlobalDouble)));
-
- double x = 0;
- a = InvokeArgument<0>(ByRef(x)); // This calls ByRef() on a non-const.
- EXPECT_FALSE(a.Perform(std::make_tuple(&ReferencesGlobalDouble)));
-}
-
-// Tests DoAll(a1, a2).
-TEST(DoAllTest, TwoActions) {
- int n = 0;
- Action<int(int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
- Return(2));
- EXPECT_EQ(2, a.Perform(std::make_tuple(&n)));
- EXPECT_EQ(1, n);
-}
-
-// Tests DoAll(a1, a2, a3).
-TEST(DoAllTest, ThreeActions) {
- int m = 0, n = 0;
- Action<int(int*, int*)> a = DoAll(SetArgPointee<0>(1), // NOLINT
- SetArgPointee<1>(2), Return(3));
- EXPECT_EQ(3, a.Perform(std::make_tuple(&m, &n)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
-}
-
-// Tests DoAll(a1, a2, a3, a4).
-TEST(DoAllTest, FourActions) {
- int m = 0, n = 0;
- char ch = '\0';
- Action<int(int*, int*, char*)> a = // NOLINT
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- Return(3));
- EXPECT_EQ(3, a.Perform(std::make_tuple(&m, &n, &ch)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', ch);
-}
-
-// Tests DoAll(a1, a2, a3, a4, a5).
-TEST(DoAllTest, FiveActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0';
- Action<int(int*, int*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- SetArgPointee<3>('b'), Return(3));
- EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
-}
-
-// Tests DoAll(a1, a2, ..., a6).
-TEST(DoAllTest, SixActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0';
- Action<int(int*, int*, char*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- SetArgPointee<3>('b'), SetArgPointee<4>('c'), Return(3));
- EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
-}
-
-// Tests DoAll(a1, a2, ..., a7).
-TEST(DoAllTest, SevenActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0';
- Action<int(int*, int*, char*, char*, char*, char*)> action = // NOLINT
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- SetArgPointee<3>('b'), SetArgPointee<4>('c'), SetArgPointee<5>('d'),
- Return(3));
- EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
-}
-
-// Tests DoAll(a1, a2, ..., a8).
-TEST(DoAllTest, EightActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*)>
- action =
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- SetArgPointee<3>('b'), SetArgPointee<4>('c'),
- SetArgPointee<5>('d'), SetArgPointee<6>('e'), Return(3));
- EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
-}
-
-// Tests DoAll(a1, a2, ..., a9).
-TEST(DoAllTest, NineActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0', e = '\0', f = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*, char*)>
- action = DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2),
- SetArgPointee<2>('a'), SetArgPointee<3>('b'),
- SetArgPointee<4>('c'), SetArgPointee<5>('d'),
- SetArgPointee<6>('e'), SetArgPointee<7>('f'), Return(3));
- EXPECT_EQ(3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
- EXPECT_EQ('f', f);
-}
-
-// Tests DoAll(a1, a2, ..., a10).
-TEST(DoAllTest, TenActions) {
- int m = 0, n = 0;
- char a = '\0', b = '\0', c = '\0', d = '\0';
- char e = '\0', f = '\0', g = '\0';
- Action<int(int*, int*, char*, char*, char*, char*, // NOLINT
- char*, char*, char*)>
- action =
- DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2), SetArgPointee<2>('a'),
- SetArgPointee<3>('b'), SetArgPointee<4>('c'),
- SetArgPointee<5>('d'), SetArgPointee<6>('e'),
- SetArgPointee<7>('f'), SetArgPointee<8>('g'), Return(3));
- EXPECT_EQ(
- 3, action.Perform(std::make_tuple(&m, &n, &a, &b, &c, &d, &e, &f, &g)));
- EXPECT_EQ(1, m);
- EXPECT_EQ(2, n);
- EXPECT_EQ('a', a);
- EXPECT_EQ('b', b);
- EXPECT_EQ('c', c);
- EXPECT_EQ('d', d);
- EXPECT_EQ('e', e);
- EXPECT_EQ('f', f);
- EXPECT_EQ('g', g);
-}
-
-TEST(DoAllTest, NoArgs) {
- bool ran_first = false;
- Action<bool()> a =
- DoAll([&] { ran_first = true; }, [&] { return ran_first; });
- EXPECT_TRUE(a.Perform({}));
-}
-
-TEST(DoAllTest, MoveOnlyArgs) {
- bool ran_first = false;
- Action<int(std::unique_ptr<int>)> a =
- DoAll(InvokeWithoutArgs([&] { ran_first = true; }),
- [](std::unique_ptr<int> p) { return *p; });
- EXPECT_EQ(7, a.Perform(std::make_tuple(std::unique_ptr<int>(new int(7)))));
- EXPECT_TRUE(ran_first);
-}
-
-TEST(DoAllTest, ImplicitlyConvertsActionArguments) {
- bool ran_first = false;
- // Action<void(std::vector<int>)> isn't an
- // Action<void(const std::vector<int>&) but can be converted.
- Action<void(std::vector<int>)> first = [&] { ran_first = true; };
- Action<int(std::vector<int>)> a =
- DoAll(first, [](std::vector<int> arg) { return arg.front(); });
- EXPECT_EQ(7, a.Perform(std::make_tuple(std::vector<int>{7})));
- EXPECT_TRUE(ran_first);
-}
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-// Also suppress C4503 decorated name length exceeded, name was truncated
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4100)
-#pragma warning(disable : 4503)
-#endif
-// Tests the ACTION*() macro family.
-
-// Tests that ACTION() can define an action that doesn't reference the
-// mock function arguments.
-ACTION(Return5) { return 5; }
-
-TEST(ActionMacroTest, WorksWhenNotReferencingArguments) {
- Action<double()> a1 = Return5();
- EXPECT_DOUBLE_EQ(5, a1.Perform(std::make_tuple()));
-
- Action<int(double, bool)> a2 = Return5();
- EXPECT_EQ(5, a2.Perform(std::make_tuple(1, true)));
-}
-
-// Tests that ACTION() can define an action that returns void.
-ACTION(IncrementArg1) { (*arg1)++; }
-
-TEST(ActionMacroTest, WorksWhenReturningVoid) {
- Action<void(int, int*)> a1 = IncrementArg1();
- int n = 0;
- a1.Perform(std::make_tuple(5, &n));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the body of ACTION() can reference the type of the
-// argument.
-ACTION(IncrementArg2) {
- StaticAssertTypeEq<int*, arg2_type>();
- arg2_type temp = arg2;
- (*temp)++;
-}
-
-TEST(ActionMacroTest, CanReferenceArgumentType) {
- Action<void(int, bool, int*)> a1 = IncrementArg2();
- int n = 0;
- a1.Perform(std::make_tuple(5, false, &n));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the body of ACTION() can reference the argument tuple
-// via args_type and args.
-ACTION(Sum2) {
- StaticAssertTypeEq<std::tuple<int, char, int*>, args_type>();
- args_type args_copy = args;
- return std::get<0>(args_copy) + std::get<1>(args_copy);
-}
-
-TEST(ActionMacroTest, CanReferenceArgumentTuple) {
- Action<int(int, char, int*)> a1 = Sum2();
- int dummy = 0;
- EXPECT_EQ(11, a1.Perform(std::make_tuple(5, Char(6), &dummy)));
-}
-
-namespace {
-
-// Tests that the body of ACTION() can reference the mock function
-// type.
-int Dummy(bool flag) { return flag ? 1 : 0; }
-
-} // namespace
-
-ACTION(InvokeDummy) {
- StaticAssertTypeEq<int(bool), function_type>();
- function_type* fp = &Dummy;
- return (*fp)(true);
-}
-
-TEST(ActionMacroTest, CanReferenceMockFunctionType) {
- Action<int(bool)> a1 = InvokeDummy();
- EXPECT_EQ(1, a1.Perform(std::make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(std::make_tuple(false)));
-}
-
-// Tests that the body of ACTION() can reference the mock function's
-// return type.
-ACTION(InvokeDummy2) {
- StaticAssertTypeEq<int, return_type>();
- return_type result = Dummy(true);
- return result;
-}
-
-TEST(ActionMacroTest, CanReferenceMockFunctionReturnType) {
- Action<int(bool)> a1 = InvokeDummy2();
- EXPECT_EQ(1, a1.Perform(std::make_tuple(true)));
- EXPECT_EQ(1, a1.Perform(std::make_tuple(false)));
-}
-
-// Tests that ACTION() works for arguments passed by const reference.
-ACTION(ReturnAddrOfConstBoolReferenceArg) {
- StaticAssertTypeEq<const bool&, arg1_type>();
- return &arg1;
-}
-
-TEST(ActionMacroTest, WorksForConstReferenceArg) {
- Action<const bool*(int, const bool&)> a = ReturnAddrOfConstBoolReferenceArg();
- const bool b = false;
- EXPECT_EQ(&b, a.Perform(std::tuple<int, const bool&>(0, b)));
-}
-
-// Tests that ACTION() works for arguments passed by non-const reference.
-ACTION(ReturnAddrOfIntReferenceArg) {
- StaticAssertTypeEq<int&, arg0_type>();
- return &arg0;
-}
-
-TEST(ActionMacroTest, WorksForNonConstReferenceArg) {
- Action<int*(int&, bool, int)> a = ReturnAddrOfIntReferenceArg();
- int n = 0;
- EXPECT_EQ(&n, a.Perform(std::tuple<int&, bool, int>(n, true, 1)));
-}
-
-// Tests that ACTION() can be used in a namespace.
-namespace action_test {
-ACTION(Sum) { return arg0 + arg1; }
-} // namespace action_test
-
-TEST(ActionMacroTest, WorksInNamespace) {
- Action<int(int, int)> a1 = action_test::Sum();
- EXPECT_EQ(3, a1.Perform(std::make_tuple(1, 2)));
-}
-
-// Tests that the same ACTION definition works for mock functions with
-// different argument numbers.
-ACTION(PlusTwo) { return arg0 + 2; }
-
-TEST(ActionMacroTest, WorksForDifferentArgumentNumbers) {
- Action<int(int)> a1 = PlusTwo();
- EXPECT_EQ(4, a1.Perform(std::make_tuple(2)));
-
- Action<double(float, void*)> a2 = PlusTwo();
- int dummy;
- EXPECT_DOUBLE_EQ(6, a2.Perform(std::make_tuple(4.0f, &dummy)));
-}
-
-// Tests that ACTION_P can define a parameterized action.
-ACTION_P(Plus, n) { return arg0 + n; }
-
-TEST(ActionPMacroTest, DefinesParameterizedAction) {
- Action<int(int m, bool t)> a1 = Plus(9);
- EXPECT_EQ(10, a1.Perform(std::make_tuple(1, true)));
-}
-
-// Tests that the body of ACTION_P can reference the argument types
-// and the parameter type.
-ACTION_P(TypedPlus, n) {
- arg0_type t1 = arg0;
- n_type t2 = n;
- return t1 + t2;
-}
-
-TEST(ActionPMacroTest, CanReferenceArgumentAndParameterTypes) {
- Action<int(char m, bool t)> a1 = TypedPlus(9);
- EXPECT_EQ(10, a1.Perform(std::make_tuple(Char(1), true)));
-}
-
-// Tests that a parameterized action can be used in any mock function
-// whose type is compatible.
-TEST(ActionPMacroTest, WorksInCompatibleMockFunction) {
- Action<std::string(const std::string& s)> a1 = Plus("tail");
- const std::string re = "re";
- std::tuple<const std::string> dummy = std::make_tuple(re);
- EXPECT_EQ("retail", a1.Perform(dummy));
-}
-
-// Tests that we can use ACTION*() to define actions overloaded on the
-// number of parameters.
-
-ACTION(OverloadedAction) { return arg0 ? arg1 : "hello"; }
-
-ACTION_P(OverloadedAction, default_value) {
- return arg0 ? arg1 : default_value;
-}
-
-ACTION_P2(OverloadedAction, true_value, false_value) {
- return arg0 ? true_value : false_value;
-}
-
-TEST(ActionMacroTest, CanDefineOverloadedActions) {
- using MyAction = Action<const char*(bool, const char*)>;
-
- const MyAction a1 = OverloadedAction();
- EXPECT_STREQ("hello", a1.Perform(std::make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a1.Perform(std::make_tuple(true, CharPtr("world"))));
-
- const MyAction a2 = OverloadedAction("hi");
- EXPECT_STREQ("hi", a2.Perform(std::make_tuple(false, CharPtr("world"))));
- EXPECT_STREQ("world", a2.Perform(std::make_tuple(true, CharPtr("world"))));
-
- const MyAction a3 = OverloadedAction("hi", "you");
- EXPECT_STREQ("hi", a3.Perform(std::make_tuple(true, CharPtr("world"))));
- EXPECT_STREQ("you", a3.Perform(std::make_tuple(false, CharPtr("world"))));
-}
-
-// Tests ACTION_Pn where n >= 3.
-
-ACTION_P3(Plus, m, n, k) { return arg0 + m + n + k; }
-
-TEST(ActionPnMacroTest, WorksFor3Parameters) {
- Action<double(int m, bool t)> a1 = Plus(100, 20, 3.4);
- EXPECT_DOUBLE_EQ(3123.4, a1.Perform(std::make_tuple(3000, true)));
-
- Action<std::string(const std::string& s)> a2 = Plus("tail", "-", ">");
- const std::string re = "re";
- std::tuple<const std::string> dummy = std::make_tuple(re);
- EXPECT_EQ("retail->", a2.Perform(dummy));
-}
-
-ACTION_P4(Plus, p0, p1, p2, p3) { return arg0 + p0 + p1 + p2 + p3; }
-
-TEST(ActionPnMacroTest, WorksFor4Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4, a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P5(Plus, p0, p1, p2, p3, p4) { return arg0 + p0 + p1 + p2 + p3 + p4; }
-
-TEST(ActionPnMacroTest, WorksFor5Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5, a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P6(Plus, p0, p1, p2, p3, p4, p5) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5;
-}
-
-TEST(ActionPnMacroTest, WorksFor6Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6, a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P7(Plus, p0, p1, p2, p3, p4, p5, p6) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6;
-}
-
-TEST(ActionPnMacroTest, WorksFor7Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7, a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P8(Plus, p0, p1, p2, p3, p4, p5, p6, p7) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7;
-}
-
-TEST(ActionPnMacroTest, WorksFor8Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8,
- a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P9(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8) {
- return arg0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8;
-}
-
-TEST(ActionPnMacroTest, WorksFor9Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9,
- a1.Perform(std::make_tuple(10)));
-}
-
-ACTION_P10(Plus, p0, p1, p2, p3, p4, p5, p6, p7, p8, last_param) {
- arg0_type t0 = arg0;
- last_param_type t9 = last_param;
- return t0 + p0 + p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + t9;
-}
-
-TEST(ActionPnMacroTest, WorksFor10Parameters) {
- Action<int(int)> a1 = Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- EXPECT_EQ(10 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10,
- a1.Perform(std::make_tuple(10)));
-}
-
-// Tests that the action body can promote the parameter types.
-
-ACTION_P2(PadArgument, prefix, suffix) {
- // The following lines promote the two parameters to desired types.
- std::string prefix_str(prefix);
- char suffix_char = static_cast<char>(suffix);
- return prefix_str + arg0 + suffix_char;
-}
-
-TEST(ActionPnMacroTest, SimpleTypePromotion) {
- Action<std::string(const char*)> no_promo =
- PadArgument(std::string("foo"), 'r');
- Action<std::string(const char*)> promo =
- PadArgument("foo", static_cast<int>('r'));
- EXPECT_EQ("foobar", no_promo.Perform(std::make_tuple(CharPtr("ba"))));
- EXPECT_EQ("foobar", promo.Perform(std::make_tuple(CharPtr("ba"))));
-}
-
-// Tests that we can partially restrict parameter types using a
-// straight-forward pattern.
-
-// Defines a generic action that doesn't restrict the types of its
-// parameters.
-ACTION_P3(ConcatImpl, a, b, c) {
- std::stringstream ss;
- ss << a << b << c;
- return ss.str();
-}
-
-// Next, we try to restrict that either the first parameter is a
-// string, or the second parameter is an int.
-
-// Defines a partially specialized wrapper that restricts the first
-// parameter to std::string.
-template <typename T1, typename T2>
-// ConcatImplActionP3 is the class template ACTION_P3 uses to
-// implement ConcatImpl. We shouldn't change the name as this
-// pattern requires the user to use it directly.
-ConcatImplActionP3<std::string, T1, T2> Concat(const std::string& a, T1 b,
- T2 c) {
- GTEST_INTENTIONAL_CONST_COND_PUSH_()
- if (true) {
- GTEST_INTENTIONAL_CONST_COND_POP_()
- // This branch verifies that ConcatImpl() can be invoked without
- // explicit template arguments.
- return ConcatImpl(a, b, c);
- } else {
- // This branch verifies that ConcatImpl() can also be invoked with
- // explicit template arguments. It doesn't really need to be
- // executed as this is a compile-time verification.
- return ConcatImpl<std::string, T1, T2>(a, b, c);
- }
-}
-
-// Defines another partially specialized wrapper that restricts the
-// second parameter to int.
-template <typename T1, typename T2>
-ConcatImplActionP3<T1, int, T2> Concat(T1 a, int b, T2 c) {
- return ConcatImpl(a, b, c);
-}
-
-TEST(ActionPnMacroTest, CanPartiallyRestrictParameterTypes) {
- Action<const std::string()> a1 = Concat("Hello", "1", 2);
- EXPECT_EQ("Hello12", a1.Perform(std::make_tuple()));
-
- a1 = Concat(1, 2, 3);
- EXPECT_EQ("123", a1.Perform(std::make_tuple()));
-}
-
-// Verifies the type of an ACTION*.
-
-ACTION(DoFoo) {}
-ACTION_P(DoFoo, p) {}
-ACTION_P2(DoFoo, p0, p1) {}
-
-TEST(ActionPnMacroTest, TypesAreCorrect) {
- // DoFoo() must be assignable to a DoFooAction variable.
- DoFooAction a0 = DoFoo();
-
- // DoFoo(1) must be assignable to a DoFooActionP variable.
- DoFooActionP<int> a1 = DoFoo(1);
-
- // DoFoo(p1, ..., pk) must be assignable to a DoFooActionPk
- // variable, and so on.
- DoFooActionP2<int, char> a2 = DoFoo(1, '2');
- PlusActionP3<int, int, char> a3 = Plus(1, 2, '3');
- PlusActionP4<int, int, int, char> a4 = Plus(1, 2, 3, '4');
- PlusActionP5<int, int, int, int, char> a5 = Plus(1, 2, 3, 4, '5');
- PlusActionP6<int, int, int, int, int, char> a6 = Plus(1, 2, 3, 4, 5, '6');
- PlusActionP7<int, int, int, int, int, int, char> a7 =
- Plus(1, 2, 3, 4, 5, 6, '7');
- PlusActionP8<int, int, int, int, int, int, int, char> a8 =
- Plus(1, 2, 3, 4, 5, 6, 7, '8');
- PlusActionP9<int, int, int, int, int, int, int, int, char> a9 =
- Plus(1, 2, 3, 4, 5, 6, 7, 8, '9');
- PlusActionP10<int, int, int, int, int, int, int, int, int, char> a10 =
- Plus(1, 2, 3, 4, 5, 6, 7, 8, 9, '0');
-
- // Avoid "unused variable" warnings.
- (void)a0;
- (void)a1;
- (void)a2;
- (void)a3;
- (void)a4;
- (void)a5;
- (void)a6;
- (void)a7;
- (void)a8;
- (void)a9;
- (void)a10;
-}
-
-// Tests that an ACTION_P*() action can be explicitly instantiated
-// with reference-typed parameters.
-
-ACTION_P(Plus1, x) { return x; }
-ACTION_P2(Plus2, x, y) { return x + y; }
-ACTION_P3(Plus3, x, y, z) { return x + y + z; }
-ACTION_P10(Plus10, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) {
- return a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9;
-}
-
-TEST(ActionPnMacroTest, CanExplicitlyInstantiateWithReferenceTypes) {
- int x = 1, y = 2, z = 3;
- const std::tuple<> empty = std::make_tuple();
-
- Action<int()> a = Plus1<int&>(x);
- EXPECT_EQ(1, a.Perform(empty));
-
- a = Plus2<const int&, int&>(x, y);
- EXPECT_EQ(3, a.Perform(empty));
-
- a = Plus3<int&, const int&, int&>(x, y, z);
- EXPECT_EQ(6, a.Perform(empty));
-
- int n[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
- a = Plus10<const int&, int&, const int&, int&, const int&, int&, const int&,
- int&, const int&, int&>(n[0], n[1], n[2], n[3], n[4], n[5], n[6],
- n[7], n[8], n[9]);
- EXPECT_EQ(55, a.Perform(empty));
-}
-
-class TenArgConstructorClass {
- public:
- TenArgConstructorClass(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
- int a8, int a9, int a10)
- : value_(a1 + a2 + a3 + a4 + a5 + a6 + a7 + a8 + a9 + a10) {}
- int value_;
-};
-
-// Tests that ACTION_TEMPLATE works when there is no value parameter.
-ACTION_TEMPLATE(CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_0_VALUE_PARAMS()) {
- return new T;
-}
-
-TEST(ActionTemplateTest, WorksWithoutValueParam) {
- const Action<int*()> a = CreateNew<int>();
- int* p = a.Perform(std::make_tuple());
- delete p;
-}
-
-// Tests that ACTION_TEMPLATE works when there are value parameters.
-ACTION_TEMPLATE(CreateNew, HAS_1_TEMPLATE_PARAMS(typename, T),
- AND_1_VALUE_PARAMS(a0)) {
- return new T(a0);
-}
-
-TEST(ActionTemplateTest, WorksWithValueParams) {
- const Action<int*()> a = CreateNew<int>(42);
- int* p = a.Perform(std::make_tuple());
- EXPECT_EQ(42, *p);
- delete p;
-}
-
-// Tests that ACTION_TEMPLATE works for integral template parameters.
-ACTION_TEMPLATE(MyDeleteArg, HAS_1_TEMPLATE_PARAMS(int, k),
- AND_0_VALUE_PARAMS()) {
- delete std::get<k>(args);
-}
-
-// Resets a bool variable in the destructor.
-class BoolResetter {
- public:
- explicit BoolResetter(bool* value) : value_(value) {}
- ~BoolResetter() { *value_ = false; }
-
- private:
- bool* value_;
-};
-
-TEST(ActionTemplateTest, WorksForIntegralTemplateParams) {
- const Action<void(int*, BoolResetter*)> a = MyDeleteArg<1>();
- int n = 0;
- bool b = true;
- auto* resetter = new BoolResetter(&b);
- a.Perform(std::make_tuple(&n, resetter));
- EXPECT_FALSE(b); // Verifies that resetter is deleted.
-}
-
-// Tests that ACTION_TEMPLATES works for template template parameters.
-ACTION_TEMPLATE(ReturnSmartPointer,
- HAS_1_TEMPLATE_PARAMS(template <typename Pointee> class,
- Pointer),
- AND_1_VALUE_PARAMS(pointee)) {
- return Pointer<pointee_type>(new pointee_type(pointee));
-}
-
-TEST(ActionTemplateTest, WorksForTemplateTemplateParameters) {
- const Action<std::shared_ptr<int>()> a =
- ReturnSmartPointer<std::shared_ptr>(42);
- std::shared_ptr<int> p = a.Perform(std::make_tuple());
- EXPECT_EQ(42, *p);
-}
-
-// Tests that ACTION_TEMPLATE works for 10 template parameters.
-template <typename T1, typename T2, typename T3, int k4, bool k5,
- unsigned int k6, typename T7, typename T8, typename T9>
-struct GiantTemplate {
- public:
- explicit GiantTemplate(int a_value) : value(a_value) {}
- int value;
-};
-
-ACTION_TEMPLATE(ReturnGiant,
- HAS_10_TEMPLATE_PARAMS(typename, T1, typename, T2, typename, T3,
- int, k4, bool, k5, unsigned int, k6,
- class, T7, class, T8, class, T9,
- template <typename T> class, T10),
- AND_1_VALUE_PARAMS(value)) {
- return GiantTemplate<T10<T1>, T2, T3, k4, k5, k6, T7, T8, T9>(value);
-}
-
-TEST(ActionTemplateTest, WorksFor10TemplateParameters) {
- using Giant = GiantTemplate<std::shared_ptr<int>, bool, double, 5, true, 6,
- char, unsigned, int>;
- const Action<Giant()> a = ReturnGiant<int, bool, double, 5, true, 6, char,
- unsigned, int, std::shared_ptr>(42);
- Giant giant = a.Perform(std::make_tuple());
- EXPECT_EQ(42, giant.value);
-}
-
-// Tests that ACTION_TEMPLATE works for 10 value parameters.
-ACTION_TEMPLATE(ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_10_VALUE_PARAMS(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10)) {
- return static_cast<Number>(v1) + v2 + v3 + v4 + v5 + v6 + v7 + v8 + v9 + v10;
-}
-
-TEST(ActionTemplateTest, WorksFor10ValueParameters) {
- const Action<int()> a = ReturnSum<int>(1, 2, 3, 4, 5, 6, 7, 8, 9, 10);
- EXPECT_EQ(55, a.Perform(std::make_tuple()));
-}
-
-// Tests that ACTION_TEMPLATE and ACTION/ACTION_P* can be overloaded
-// on the number of value parameters.
-
-ACTION(ReturnSum) { return 0; }
-
-ACTION_P(ReturnSum, x) { return x; }
-
-ACTION_TEMPLATE(ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_2_VALUE_PARAMS(v1, v2)) {
- return static_cast<Number>(v1) + v2;
-}
-
-ACTION_TEMPLATE(ReturnSum, HAS_1_TEMPLATE_PARAMS(typename, Number),
- AND_3_VALUE_PARAMS(v1, v2, v3)) {
- return static_cast<Number>(v1) + v2 + v3;
-}
-
-ACTION_TEMPLATE(ReturnSum, HAS_2_TEMPLATE_PARAMS(typename, Number, int, k),
- AND_4_VALUE_PARAMS(v1, v2, v3, v4)) {
- return static_cast<Number>(v1) + v2 + v3 + v4 + k;
-}
-
-TEST(ActionTemplateTest, CanBeOverloadedOnNumberOfValueParameters) {
- const Action<int()> a0 = ReturnSum();
- const Action<int()> a1 = ReturnSum(1);
- const Action<int()> a2 = ReturnSum<int>(1, 2);
- const Action<int()> a3 = ReturnSum<int>(1, 2, 3);
- const Action<int()> a4 = ReturnSum<int, 10000>(2000, 300, 40, 5);
- EXPECT_EQ(0, a0.Perform(std::make_tuple()));
- EXPECT_EQ(1, a1.Perform(std::make_tuple()));
- EXPECT_EQ(3, a2.Perform(std::make_tuple()));
- EXPECT_EQ(6, a3.Perform(std::make_tuple()));
- EXPECT_EQ(12345, a4.Perform(std::make_tuple()));
-}
-
-} // namespace gmock_more_actions_test
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-nice-strict_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-nice-strict_test.cc
deleted file mode 100644
index 319b18d8ef..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-nice-strict_test.cc
+++ /dev/null
@@ -1,538 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "gmock/gmock-nice-strict.h"
-
-#include <string>
-#include <utility>
-#include "gmock/gmock.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-
-// This must not be defined inside the ::testing namespace, or it will
-// clash with ::testing::Mock.
-class Mock {
- public:
- Mock() {}
-
- MOCK_METHOD0(DoThis, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
-};
-
-namespace testing {
-namespace gmock_nice_strict_test {
-
-using testing::HasSubstr;
-using testing::NaggyMock;
-using testing::NiceMock;
-using testing::StrictMock;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-// Class without default constructor.
-class NotDefaultConstructible {
- public:
- explicit NotDefaultConstructible(int) {}
-};
-
-class CallsMockMethodInDestructor {
- public:
- ~CallsMockMethodInDestructor() { OnDestroy(); }
- MOCK_METHOD(void, OnDestroy, ());
-};
-
-// Defines some mock classes needed by the tests.
-
-class Foo {
- public:
- virtual ~Foo() {}
-
- virtual void DoThis() = 0;
- virtual int DoThat(bool flag) = 0;
-};
-
-class MockFoo : public Foo {
- public:
- MockFoo() {}
- void Delete() { delete this; }
-
- MOCK_METHOD0(DoThis, void());
- MOCK_METHOD1(DoThat, int(bool flag));
- MOCK_METHOD0(ReturnNonDefaultConstructible, NotDefaultConstructible());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class MockBar {
- public:
- explicit MockBar(const std::string& s) : str_(s) {}
-
- MockBar(char a1, char a2, std::string a3, std::string a4, int a5, int a6,
- const std::string& a7, const std::string& a8, bool a9, bool a10) {
- str_ = std::string() + a1 + a2 + a3 + a4 + static_cast<char>(a5) +
- static_cast<char>(a6) + a7 + a8 + (a9 ? 'T' : 'F') + (a10 ? 'T' : 'F');
- }
-
- virtual ~MockBar() {}
-
- const std::string& str() const { return str_; }
-
- MOCK_METHOD0(This, int());
- MOCK_METHOD2(That, std::string(int, bool));
-
- private:
- std::string str_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockBar);
-};
-
-
-class MockBaz {
- public:
- class MoveOnly {
- public:
- MoveOnly() = default;
-
- MoveOnly(const MoveOnly&) = delete;
- MoveOnly& operator=(const MoveOnly&) = delete;
-
- MoveOnly(MoveOnly&&) = default;
- MoveOnly& operator=(MoveOnly&&) = default;
- };
-
- MockBaz(MoveOnly) {}
-};
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a raw mock generates warnings for uninteresting calls.
-TEST(RawMockTest, WarningForUninterestingCall) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "warning");
-
- MockFoo raw_foo;
-
- CaptureStdout();
- raw_foo.DoThis();
- raw_foo.DoThat(true);
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-// Tests that a raw mock generates warnings for uninteresting calls
-// that delete the mock object.
-TEST(RawMockTest, WarningForUninterestingCallAfterDeath) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "warning");
-
- MockFoo* const raw_foo = new MockFoo;
-
- ON_CALL(*raw_foo, DoThis())
- .WillByDefault(Invoke(raw_foo, &MockFoo::Delete));
-
- CaptureStdout();
- raw_foo->DoThis();
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-// Tests that a raw mock generates informational logs for
-// uninteresting calls.
-TEST(RawMockTest, InfoForUninterestingCall) {
- MockFoo raw_foo;
-
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "info");
- CaptureStdout();
- raw_foo.DoThis();
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-TEST(RawMockTest, IsNaggy_IsNice_IsStrict) {
- MockFoo raw_foo;
- EXPECT_TRUE(Mock::IsNaggy(&raw_foo));
- EXPECT_FALSE(Mock::IsNice(&raw_foo));
- EXPECT_FALSE(Mock::IsStrict(&raw_foo));
-}
-
-// Tests that a nice mock generates no warning for uninteresting calls.
-TEST(NiceMockTest, NoWarningForUninterestingCall) {
- NiceMock<MockFoo> nice_foo;
-
- CaptureStdout();
- nice_foo.DoThis();
- nice_foo.DoThat(true);
- EXPECT_EQ("", GetCapturedStdout());
-}
-
-// Tests that a nice mock generates no warning for uninteresting calls
-// that delete the mock object.
-TEST(NiceMockTest, NoWarningForUninterestingCallAfterDeath) {
- NiceMock<MockFoo>* const nice_foo = new NiceMock<MockFoo>;
-
- ON_CALL(*nice_foo, DoThis())
- .WillByDefault(Invoke(nice_foo, &MockFoo::Delete));
-
- CaptureStdout();
- nice_foo->DoThis();
- EXPECT_EQ("", GetCapturedStdout());
-}
-
-// Tests that a nice mock generates informational logs for
-// uninteresting calls.
-TEST(NiceMockTest, InfoForUninterestingCall) {
- NiceMock<MockFoo> nice_foo;
-
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "info");
- CaptureStdout();
- nice_foo.DoThis();
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a nice mock allows expected calls.
-TEST(NiceMockTest, AllowsExpectedCall) {
- NiceMock<MockFoo> nice_foo;
-
- EXPECT_CALL(nice_foo, DoThis());
- nice_foo.DoThis();
-}
-
-// Tests that an unexpected call on a nice mock which returns a
-// not-default-constructible type throws an exception and the exception contains
-// the method's name.
-TEST(NiceMockTest, ThrowsExceptionForUnknownReturnTypes) {
- NiceMock<MockFoo> nice_foo;
-#if GTEST_HAS_EXCEPTIONS
- try {
- nice_foo.ReturnNonDefaultConstructible();
- FAIL();
- } catch (const std::runtime_error& ex) {
- EXPECT_THAT(ex.what(), HasSubstr("ReturnNonDefaultConstructible"));
- }
-#else
- EXPECT_DEATH_IF_SUPPORTED({ nice_foo.ReturnNonDefaultConstructible(); }, "");
-#endif
-}
-
-// Tests that an unexpected call on a nice mock fails.
-TEST(NiceMockTest, UnexpectedCallFails) {
- NiceMock<MockFoo> nice_foo;
-
- EXPECT_CALL(nice_foo, DoThis()).Times(0);
- EXPECT_NONFATAL_FAILURE(nice_foo.DoThis(), "called more times than expected");
-}
-
-// Tests that NiceMock works with a mock class that has a non-default
-// constructor.
-TEST(NiceMockTest, NonDefaultConstructor) {
- NiceMock<MockBar> nice_bar("hi");
- EXPECT_EQ("hi", nice_bar.str());
-
- nice_bar.This();
- nice_bar.That(5, true);
-}
-
-// Tests that NiceMock works with a mock class that has a 10-ary
-// non-default constructor.
-TEST(NiceMockTest, NonDefaultConstructor10) {
- NiceMock<MockBar> nice_bar('a', 'b', "c", "d", 'e', 'f',
- "g", "h", true, false);
- EXPECT_EQ("abcdefghTF", nice_bar.str());
-
- nice_bar.This();
- nice_bar.That(5, true);
-}
-
-TEST(NiceMockTest, AllowLeak) {
- NiceMock<MockFoo>* leaked = new NiceMock<MockFoo>;
- Mock::AllowLeak(leaked);
- EXPECT_CALL(*leaked, DoThis());
- leaked->DoThis();
-}
-
-TEST(NiceMockTest, MoveOnlyConstructor) {
- NiceMock<MockBaz> nice_baz(MockBaz::MoveOnly{});
-}
-
-// Tests that NiceMock<Mock> compiles where Mock is a user-defined
-// class (as opposed to ::testing::Mock).
-TEST(NiceMockTest, AcceptsClassNamedMock) {
- NiceMock< ::Mock> nice;
- EXPECT_CALL(nice, DoThis());
- nice.DoThis();
-}
-
-TEST(NiceMockTest, IsNiceInDestructor) {
- {
- NiceMock<CallsMockMethodInDestructor> nice_on_destroy;
- // Don't add an expectation for the call before the mock goes out of scope.
- }
-}
-
-TEST(NiceMockTest, IsNaggy_IsNice_IsStrict) {
- NiceMock<MockFoo> nice_foo;
- EXPECT_FALSE(Mock::IsNaggy(&nice_foo));
- EXPECT_TRUE(Mock::IsNice(&nice_foo));
- EXPECT_FALSE(Mock::IsStrict(&nice_foo));
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a naggy mock generates warnings for uninteresting calls.
-TEST(NaggyMockTest, WarningForUninterestingCall) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "warning");
-
- NaggyMock<MockFoo> naggy_foo;
-
- CaptureStdout();
- naggy_foo.DoThis();
- naggy_foo.DoThat(true);
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-// Tests that a naggy mock generates a warning for an uninteresting call
-// that deletes the mock object.
-TEST(NaggyMockTest, WarningForUninterestingCallAfterDeath) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "warning");
-
- NaggyMock<MockFoo>* const naggy_foo = new NaggyMock<MockFoo>;
-
- ON_CALL(*naggy_foo, DoThis())
- .WillByDefault(Invoke(naggy_foo, &MockFoo::Delete));
-
- CaptureStdout();
- naggy_foo->DoThis();
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that a naggy mock allows expected calls.
-TEST(NaggyMockTest, AllowsExpectedCall) {
- NaggyMock<MockFoo> naggy_foo;
-
- EXPECT_CALL(naggy_foo, DoThis());
- naggy_foo.DoThis();
-}
-
-// Tests that an unexpected call on a naggy mock fails.
-TEST(NaggyMockTest, UnexpectedCallFails) {
- NaggyMock<MockFoo> naggy_foo;
-
- EXPECT_CALL(naggy_foo, DoThis()).Times(0);
- EXPECT_NONFATAL_FAILURE(naggy_foo.DoThis(),
- "called more times than expected");
-}
-
-// Tests that NaggyMock works with a mock class that has a non-default
-// constructor.
-TEST(NaggyMockTest, NonDefaultConstructor) {
- NaggyMock<MockBar> naggy_bar("hi");
- EXPECT_EQ("hi", naggy_bar.str());
-
- naggy_bar.This();
- naggy_bar.That(5, true);
-}
-
-// Tests that NaggyMock works with a mock class that has a 10-ary
-// non-default constructor.
-TEST(NaggyMockTest, NonDefaultConstructor10) {
- NaggyMock<MockBar> naggy_bar('0', '1', "2", "3", '4', '5',
- "6", "7", true, false);
- EXPECT_EQ("01234567TF", naggy_bar.str());
-
- naggy_bar.This();
- naggy_bar.That(5, true);
-}
-
-TEST(NaggyMockTest, AllowLeak) {
- NaggyMock<MockFoo>* leaked = new NaggyMock<MockFoo>;
- Mock::AllowLeak(leaked);
- EXPECT_CALL(*leaked, DoThis());
- leaked->DoThis();
-}
-
-TEST(NaggyMockTest, MoveOnlyConstructor) {
- NaggyMock<MockBaz> naggy_baz(MockBaz::MoveOnly{});
-}
-
-// Tests that NaggyMock<Mock> compiles where Mock is a user-defined
-// class (as opposed to ::testing::Mock).
-TEST(NaggyMockTest, AcceptsClassNamedMock) {
- NaggyMock< ::Mock> naggy;
- EXPECT_CALL(naggy, DoThis());
- naggy.DoThis();
-}
-
-TEST(NaggyMockTest, IsNaggyInDestructor) {
- const std::string saved_flag = GMOCK_FLAG_GET(verbose);
- GMOCK_FLAG_SET(verbose, "warning");
- CaptureStdout();
-
- {
- NaggyMock<CallsMockMethodInDestructor> naggy_on_destroy;
- // Don't add an expectation for the call before the mock goes out of scope.
- }
-
- EXPECT_THAT(GetCapturedStdout(),
- HasSubstr("Uninteresting mock function call"));
-
- GMOCK_FLAG_SET(verbose, saved_flag);
-}
-
-TEST(NaggyMockTest, IsNaggy_IsNice_IsStrict) {
- NaggyMock<MockFoo> naggy_foo;
- EXPECT_TRUE(Mock::IsNaggy(&naggy_foo));
- EXPECT_FALSE(Mock::IsNice(&naggy_foo));
- EXPECT_FALSE(Mock::IsStrict(&naggy_foo));
-}
-
-// Tests that a strict mock allows expected calls.
-TEST(StrictMockTest, AllowsExpectedCall) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_CALL(strict_foo, DoThis());
- strict_foo.DoThis();
-}
-
-// Tests that an unexpected call on a strict mock fails.
-TEST(StrictMockTest, UnexpectedCallFails) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_CALL(strict_foo, DoThis()).Times(0);
- EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
- "called more times than expected");
-}
-
-// Tests that an uninteresting call on a strict mock fails.
-TEST(StrictMockTest, UninterestingCallFails) {
- StrictMock<MockFoo> strict_foo;
-
- EXPECT_NONFATAL_FAILURE(strict_foo.DoThis(),
- "Uninteresting mock function call");
-}
-
-// Tests that an uninteresting call on a strict mock fails, even if
-// the call deletes the mock object.
-TEST(StrictMockTest, UninterestingCallFailsAfterDeath) {
- StrictMock<MockFoo>* const strict_foo = new StrictMock<MockFoo>;
-
- ON_CALL(*strict_foo, DoThis())
- .WillByDefault(Invoke(strict_foo, &MockFoo::Delete));
-
- EXPECT_NONFATAL_FAILURE(strict_foo->DoThis(),
- "Uninteresting mock function call");
-}
-
-// Tests that StrictMock works with a mock class that has a
-// non-default constructor.
-TEST(StrictMockTest, NonDefaultConstructor) {
- StrictMock<MockBar> strict_bar("hi");
- EXPECT_EQ("hi", strict_bar.str());
-
- EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
- "Uninteresting mock function call");
-}
-
-// Tests that StrictMock works with a mock class that has a 10-ary
-// non-default constructor.
-TEST(StrictMockTest, NonDefaultConstructor10) {
- StrictMock<MockBar> strict_bar('a', 'b', "c", "d", 'e', 'f',
- "g", "h", true, false);
- EXPECT_EQ("abcdefghTF", strict_bar.str());
-
- EXPECT_NONFATAL_FAILURE(strict_bar.That(5, true),
- "Uninteresting mock function call");
-}
-
-TEST(StrictMockTest, AllowLeak) {
- StrictMock<MockFoo>* leaked = new StrictMock<MockFoo>;
- Mock::AllowLeak(leaked);
- EXPECT_CALL(*leaked, DoThis());
- leaked->DoThis();
-}
-
-TEST(StrictMockTest, MoveOnlyConstructor) {
- StrictMock<MockBaz> strict_baz(MockBaz::MoveOnly{});
-}
-
-// Tests that StrictMock<Mock> compiles where Mock is a user-defined
-// class (as opposed to ::testing::Mock).
-TEST(StrictMockTest, AcceptsClassNamedMock) {
- StrictMock< ::Mock> strict;
- EXPECT_CALL(strict, DoThis());
- strict.DoThis();
-}
-
-TEST(StrictMockTest, IsStrictInDestructor) {
- EXPECT_NONFATAL_FAILURE(
- {
- StrictMock<CallsMockMethodInDestructor> strict_on_destroy;
- // Don't add an expectation for the call before the mock goes out of
- // scope.
- },
- "Uninteresting mock function call");
-}
-
-TEST(StrictMockTest, IsNaggy_IsNice_IsStrict) {
- StrictMock<MockFoo> strict_foo;
- EXPECT_FALSE(Mock::IsNaggy(&strict_foo));
- EXPECT_FALSE(Mock::IsNice(&strict_foo));
- EXPECT_TRUE(Mock::IsStrict(&strict_foo));
-}
-
-} // namespace gmock_nice_strict_test
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-port_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-port_test.cc
deleted file mode 100644
index a2c2be2488..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-port_test.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal cross-platform support utilities.
-
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-
-// NOTE: if this file is left without tests for some reason, put a dummy
-// test here to make references to symbols in the gtest library and avoid
-// 'undefined symbol' linker errors in gmock_main:
-
-TEST(DummyTest, Dummy) {}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp-string_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp-string_test.cc
deleted file mode 100644
index 6f66cf156a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp-string_test.cc
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright 2018, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the internal preprocessor macro library.
-#include "gmock/internal/gmock-pp.h"
-
-#include <string>
-
-#include "gmock/gmock.h"
-
-namespace testing {
-namespace {
-
-// Matcher to verify that to strings are identical up to whitespace
-// Not 100% correct, because it treats "AB" as equal to "A B".
-::testing::Matcher<const std::string&> SameExceptSpaces(const std::string& s) {
- auto remove_spaces = [](std::string to_split) {
- to_split.erase(std::remove(to_split.begin(), to_split.end(), ' '),
- to_split.end());
- return to_split;
- };
- return ::testing::ResultOf(remove_spaces, remove_spaces(s));
-}
-
-// Verify that a macro expands to a given text. Ignores whitespace difference.
-// In MSVC, GMOCK_PP_STRINGIZE() returns nothing, rather than "". So concatenate
-// with an empty string.
-#define EXPECT_EXPANSION(Result, Macro) \
- EXPECT_THAT("" GMOCK_PP_STRINGIZE(Macro), SameExceptSpaces(Result))
-
-TEST(Macros, Cat) {
- EXPECT_EXPANSION("14", GMOCK_PP_CAT(1, 4));
- EXPECT_EXPANSION("+=", GMOCK_PP_CAT(+, =));
-}
-
-TEST(Macros, Narg) {
- EXPECT_EXPANSION("1", GMOCK_PP_NARG());
- EXPECT_EXPANSION("1", GMOCK_PP_NARG(x));
- EXPECT_EXPANSION("2", GMOCK_PP_NARG(x, y));
- EXPECT_EXPANSION("3", GMOCK_PP_NARG(x, y, z));
- EXPECT_EXPANSION("4", GMOCK_PP_NARG(x, y, z, w));
-
- EXPECT_EXPANSION("0", GMOCK_PP_NARG0());
- EXPECT_EXPANSION("1", GMOCK_PP_NARG0(x));
- EXPECT_EXPANSION("2", GMOCK_PP_NARG0(x, y));
-}
-
-TEST(Macros, Comma) {
- EXPECT_EXPANSION("0", GMOCK_PP_HAS_COMMA());
- EXPECT_EXPANSION("1", GMOCK_PP_HAS_COMMA(, ));
- EXPECT_EXPANSION("0", GMOCK_PP_HAS_COMMA((, )));
-}
-
-TEST(Macros, IsEmpty) {
- EXPECT_EXPANSION("1", GMOCK_PP_IS_EMPTY());
- EXPECT_EXPANSION("0", GMOCK_PP_IS_EMPTY(, ));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_EMPTY(a));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_EMPTY(()));
-
-#define GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1
- EXPECT_EXPANSION("1", GMOCK_PP_IS_EMPTY(GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1));
-}
-
-TEST(Macros, If) {
- EXPECT_EXPANSION("1", GMOCK_PP_IF(1, 1, 2));
- EXPECT_EXPANSION("2", GMOCK_PP_IF(0, 1, 2));
-}
-
-TEST(Macros, HeadTail) {
- EXPECT_EXPANSION("1", GMOCK_PP_HEAD(1));
- EXPECT_EXPANSION("1", GMOCK_PP_HEAD(1, 2));
- EXPECT_EXPANSION("1", GMOCK_PP_HEAD(1, 2, 3));
-
- EXPECT_EXPANSION("", GMOCK_PP_TAIL(1));
- EXPECT_EXPANSION("2", GMOCK_PP_TAIL(1, 2));
- EXPECT_EXPANSION("2", GMOCK_PP_HEAD(GMOCK_PP_TAIL(1, 2, 3)));
-}
-
-TEST(Macros, Parentheses) {
- EXPECT_EXPANSION("0", GMOCK_PP_IS_BEGIN_PARENS(sss));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_BEGIN_PARENS(sss()));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_BEGIN_PARENS(sss() sss));
- EXPECT_EXPANSION("1", GMOCK_PP_IS_BEGIN_PARENS((sss)));
- EXPECT_EXPANSION("1", GMOCK_PP_IS_BEGIN_PARENS((sss)ss));
-
- EXPECT_EXPANSION("0", GMOCK_PP_IS_ENCLOSED_PARENS(sss));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_ENCLOSED_PARENS(sss()));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_ENCLOSED_PARENS(sss() sss));
- EXPECT_EXPANSION("1", GMOCK_PP_IS_ENCLOSED_PARENS((sss)));
- EXPECT_EXPANSION("0", GMOCK_PP_IS_ENCLOSED_PARENS((sss)ss));
-
- EXPECT_EXPANSION("1 + 1", GMOCK_PP_REMOVE_PARENS((1 + 1)));
-}
-
-TEST(Macros, Increment) {
- EXPECT_EXPANSION("1", GMOCK_PP_INC(0));
- EXPECT_EXPANSION("2", GMOCK_PP_INC(1));
- EXPECT_EXPANSION("3", GMOCK_PP_INC(2));
- EXPECT_EXPANSION("4", GMOCK_PP_INC(3));
- EXPECT_EXPANSION("5", GMOCK_PP_INC(4));
-
- EXPECT_EXPANSION("16", GMOCK_PP_INC(15));
-}
-
-#define JOINER_CAT(a, b) a##b
-#define JOINER(_N, _Data, _Elem) JOINER_CAT(_Data, _N) = _Elem
-
-TEST(Macros, Repeat) {
- EXPECT_EXPANSION("", GMOCK_PP_REPEAT(JOINER, X, 0));
- EXPECT_EXPANSION("X0=", GMOCK_PP_REPEAT(JOINER, X, 1));
- EXPECT_EXPANSION("X0= X1=", GMOCK_PP_REPEAT(JOINER, X, 2));
- EXPECT_EXPANSION("X0= X1= X2=", GMOCK_PP_REPEAT(JOINER, X, 3));
- EXPECT_EXPANSION("X0= X1= X2= X3=", GMOCK_PP_REPEAT(JOINER, X, 4));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4=", GMOCK_PP_REPEAT(JOINER, X, 5));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5=", GMOCK_PP_REPEAT(JOINER, X, 6));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6=",
- GMOCK_PP_REPEAT(JOINER, X, 7));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7=",
- GMOCK_PP_REPEAT(JOINER, X, 8));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7= X8=",
- GMOCK_PP_REPEAT(JOINER, X, 9));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7= X8= X9=",
- GMOCK_PP_REPEAT(JOINER, X, 10));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7= X8= X9= X10=",
- GMOCK_PP_REPEAT(JOINER, X, 11));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7= X8= X9= X10= X11=",
- GMOCK_PP_REPEAT(JOINER, X, 12));
- EXPECT_EXPANSION("X0= X1= X2= X3= X4= X5= X6= X7= X8= X9= X10= X11= X12=",
- GMOCK_PP_REPEAT(JOINER, X, 13));
- EXPECT_EXPANSION(
- "X0= X1= X2= X3= X4= X5= X6= X7= X8= X9= X10= X11= X12= X13=",
- GMOCK_PP_REPEAT(JOINER, X, 14));
- EXPECT_EXPANSION(
- "X0= X1= X2= X3= X4= X5= X6= X7= X8= X9= X10= X11= X12= X13= X14=",
- GMOCK_PP_REPEAT(JOINER, X, 15));
-}
-TEST(Macros, ForEach) {
- EXPECT_EXPANSION("", GMOCK_PP_FOR_EACH(JOINER, X, ()));
- EXPECT_EXPANSION("X0=a", GMOCK_PP_FOR_EACH(JOINER, X, (a)));
- EXPECT_EXPANSION("X0=a X1=b", GMOCK_PP_FOR_EACH(JOINER, X, (a, b)));
- EXPECT_EXPANSION("X0=a X1=b X2=c", GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d X4=e",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d X4=e X5=f",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d X4=e X5=f X6=g",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h)));
- EXPECT_EXPANSION("X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i, j)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j X10=k",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i, j, k)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j X10=k X11=l",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i, j, k, l)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j X10=k X11=l X12=m",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i, j, k, l, m)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j X10=k X11=l X12=m "
- "X13=n",
- GMOCK_PP_FOR_EACH(JOINER, X, (a, b, c, d, e, f, g, h, i, j, k, l, m, n)));
- EXPECT_EXPANSION(
- "X0=a X1=b X2=c X3=d X4=e X5=f X6=g X7=h X8=i X9=j X10=k X11=l X12=m "
- "X13=n X14=o",
- GMOCK_PP_FOR_EACH(JOINER, X,
- (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o)));
-}
-
-} // namespace
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp_test.cc
deleted file mode 100644
index 5d1566e388..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-pp_test.cc
+++ /dev/null
@@ -1,83 +0,0 @@
-#include "gmock/internal/gmock-pp.h"
-
-// Used to test MSVC treating __VA_ARGS__ with a comma in it as one value
-#define GMOCK_TEST_REPLACE_comma_WITH_COMMA_I_comma ,
-#define GMOCK_TEST_REPLACE_comma_WITH_COMMA(x) \
- GMOCK_PP_CAT(GMOCK_TEST_REPLACE_comma_WITH_COMMA_I_, x)
-
-// Static assertions.
-namespace testing {
-namespace internal {
-namespace gmockpp {
-
-static_assert(GMOCK_PP_CAT(1, 4) == 14, "");
-static_assert(GMOCK_PP_INTERNAL_INTERNAL_16TH(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, 17, 18) == 16,
- "");
-static_assert(GMOCK_PP_NARG() == 1, "");
-static_assert(GMOCK_PP_NARG(x) == 1, "");
-static_assert(GMOCK_PP_NARG(x, y) == 2, "");
-static_assert(GMOCK_PP_NARG(x, y, z) == 3, "");
-static_assert(GMOCK_PP_NARG(x, y, z, w) == 4, "");
-static_assert(!GMOCK_PP_HAS_COMMA(), "");
-static_assert(GMOCK_PP_HAS_COMMA(b, ), "");
-static_assert(!GMOCK_PP_HAS_COMMA((, )), "");
-static_assert(GMOCK_PP_HAS_COMMA(GMOCK_TEST_REPLACE_comma_WITH_COMMA(comma)),
- "");
-static_assert(
- GMOCK_PP_HAS_COMMA(GMOCK_TEST_REPLACE_comma_WITH_COMMA(comma(unrelated))),
- "");
-static_assert(!GMOCK_PP_IS_EMPTY(, ), "");
-static_assert(!GMOCK_PP_IS_EMPTY(a), "");
-static_assert(!GMOCK_PP_IS_EMPTY(()), "");
-static_assert(GMOCK_PP_IF(1, 1, 2) == 1, "");
-static_assert(GMOCK_PP_IF(0, 1, 2) == 2, "");
-static_assert(GMOCK_PP_NARG0(x) == 1, "");
-static_assert(GMOCK_PP_NARG0(x, y) == 2, "");
-static_assert(GMOCK_PP_HEAD(1) == 1, "");
-static_assert(GMOCK_PP_HEAD(1, 2) == 1, "");
-static_assert(GMOCK_PP_HEAD(1, 2, 3) == 1, "");
-static_assert(GMOCK_PP_TAIL(1, 2) == 2, "");
-static_assert(GMOCK_PP_HEAD(GMOCK_PP_TAIL(1, 2, 3)) == 2, "");
-static_assert(!GMOCK_PP_IS_BEGIN_PARENS(sss), "");
-static_assert(!GMOCK_PP_IS_BEGIN_PARENS(sss()), "");
-static_assert(!GMOCK_PP_IS_BEGIN_PARENS(sss() sss), "");
-static_assert(GMOCK_PP_IS_BEGIN_PARENS((sss)), "");
-static_assert(GMOCK_PP_IS_BEGIN_PARENS((sss)ss), "");
-static_assert(!GMOCK_PP_IS_ENCLOSED_PARENS(sss), "");
-static_assert(!GMOCK_PP_IS_ENCLOSED_PARENS(sss()), "");
-static_assert(!GMOCK_PP_IS_ENCLOSED_PARENS(sss() sss), "");
-static_assert(!GMOCK_PP_IS_ENCLOSED_PARENS((sss)ss), "");
-static_assert(GMOCK_PP_REMOVE_PARENS((1 + 1)) * 2 == 3, "");
-static_assert(GMOCK_PP_INC(4) == 5, "");
-
-template <class... Args>
-struct Test {
- static constexpr int kArgs = sizeof...(Args);
-};
-#define GMOCK_PP_INTERNAL_TYPE_TEST(_i, _Data, _element) \
- GMOCK_PP_COMMA_IF(_i) _element
-static_assert(Test<GMOCK_PP_FOR_EACH(GMOCK_PP_INTERNAL_TYPE_TEST, ~,
- (int, float, double, char))>::kArgs == 4,
- "");
-#define GMOCK_PP_INTERNAL_VAR_TEST_1(_x) 1
-#define GMOCK_PP_INTERNAL_VAR_TEST_2(_x, _y) 2
-#define GMOCK_PP_INTERNAL_VAR_TEST_3(_x, _y, _z) 3
-
-#define GMOCK_PP_INTERNAL_VAR_TEST(...) \
- GMOCK_PP_VARIADIC_CALL(GMOCK_PP_INTERNAL_VAR_TEST_, __VA_ARGS__)
-static_assert(GMOCK_PP_INTERNAL_VAR_TEST(x, y) == 2, "");
-static_assert(GMOCK_PP_INTERNAL_VAR_TEST(silly) == 1, "");
-static_assert(GMOCK_PP_INTERNAL_VAR_TEST(x, y, z) == 3, "");
-
-// TODO(iserna): The following asserts fail in --config=lexan.
-#define GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1
-static_assert(GMOCK_PP_IS_EMPTY(GMOCK_PP_INTERNAL_IS_EMPTY_TEST_1), "");
-static_assert(GMOCK_PP_IS_EMPTY(), "");
-static_assert(GMOCK_PP_IS_ENCLOSED_PARENS((sss)), "");
-static_assert(GMOCK_PP_IS_EMPTY(GMOCK_PP_TAIL(1)), "");
-static_assert(GMOCK_PP_NARG0() == 0, "");
-
-} // namespace gmockpp
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-spec-builders_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-spec-builders_test.cc
deleted file mode 100644
index 7f29b6125a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock-spec-builders_test.cc
+++ /dev/null
@@ -1,2774 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests the spec builder syntax.
-
-#include "gmock/gmock-spec-builders.h"
-
-#include <memory>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-
-#include "gmock/gmock.h"
-#include "gmock/internal/gmock-port.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-namespace internal {
-
-// Helper class for testing the Expectation class template.
-class ExpectationTester {
- public:
- // Sets the call count of the given expectation to the given number.
- void SetCallCount(int n, ExpectationBase* exp) {
- exp->call_count_ = n;
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-namespace {
-
-using testing::_;
-using testing::AnyNumber;
-using testing::AtLeast;
-using testing::AtMost;
-using testing::Between;
-using testing::Cardinality;
-using testing::CardinalityInterface;
-using testing::Const;
-using testing::ContainsRegex;
-using testing::DoAll;
-using testing::DoDefault;
-using testing::Eq;
-using testing::Expectation;
-using testing::ExpectationSet;
-using testing::Gt;
-using testing::IgnoreResult;
-using testing::InSequence;
-using testing::Invoke;
-using testing::InvokeWithoutArgs;
-using testing::IsNotSubstring;
-using testing::IsSubstring;
-using testing::Lt;
-using testing::Message;
-using testing::Mock;
-using testing::NaggyMock;
-using testing::Ne;
-using testing::Return;
-using testing::SaveArg;
-using testing::Sequence;
-using testing::SetArgPointee;
-using testing::internal::ExpectationTester;
-using testing::internal::FormatFileLocation;
-using testing::internal::kAllow;
-using testing::internal::kErrorVerbosity;
-using testing::internal::kFail;
-using testing::internal::kInfoVerbosity;
-using testing::internal::kWarn;
-using testing::internal::kWarningVerbosity;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::HasSubstr;
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-class Incomplete;
-
-class MockIncomplete {
- public:
- // This line verifies that a mock method can take a by-reference
- // argument of an incomplete type.
- MOCK_METHOD1(ByRefFunc, void(const Incomplete& x));
-};
-
-// Tells Google Mock how to print a value of type Incomplete.
-void PrintTo(const Incomplete& x, ::std::ostream* os);
-
-TEST(MockMethodTest, CanInstantiateWithIncompleteArgType) {
- // Even though this mock class contains a mock method that takes
- // by-reference an argument whose type is incomplete, we can still
- // use the mock, as long as Google Mock knows how to print the
- // argument.
- MockIncomplete incomplete;
- EXPECT_CALL(incomplete, ByRefFunc(_))
- .Times(AnyNumber());
-}
-
-// The definition of the printer for the argument type doesn't have to
-// be visible where the mock is used.
-void PrintTo(const Incomplete& /* x */, ::std::ostream* os) {
- *os << "incomplete";
-}
-
-class Result {};
-
-// A type that's not default constructible.
-class NonDefaultConstructible {
- public:
- explicit NonDefaultConstructible(int /* dummy */) {}
-};
-
-class MockA {
- public:
- MockA() {}
-
- MOCK_METHOD1(DoA, void(int n));
- MOCK_METHOD1(ReturnResult, Result(int n));
- MOCK_METHOD0(ReturnNonDefaultConstructible, NonDefaultConstructible());
- MOCK_METHOD2(Binary, bool(int x, int y));
- MOCK_METHOD2(ReturnInt, int(int x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockA);
-};
-
-class MockB {
- public:
- MockB() {}
-
- MOCK_CONST_METHOD0(DoB, int()); // NOLINT
- MOCK_METHOD1(DoB, int(int n)); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockB);
-};
-
-class ReferenceHoldingMock {
- public:
- ReferenceHoldingMock() {}
-
- MOCK_METHOD1(AcceptReference, void(std::shared_ptr<MockA>*));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ReferenceHoldingMock);
-};
-
-// Tests that EXPECT_CALL and ON_CALL compile in a presence of macro
-// redefining a mock method name. This could happen, for example, when
-// the tested code #includes Win32 API headers which define many APIs
-// as macros, e.g. #define TextOut TextOutW.
-
-#define Method MethodW
-
-class CC {
- public:
- virtual ~CC() {}
- virtual int Method() = 0;
-};
-class MockCC : public CC {
- public:
- MockCC() {}
-
- MOCK_METHOD0(Method, int());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockCC);
-};
-
-// Tests that a method with expanded name compiles.
-TEST(OnCallSyntaxTest, CompilesWithMethodNameExpandedFromMacro) {
- MockCC cc;
- ON_CALL(cc, Method());
-}
-
-// Tests that the method with expanded name not only compiles but runs
-// and returns a correct value, too.
-TEST(OnCallSyntaxTest, WorksWithMethodNameExpandedFromMacro) {
- MockCC cc;
- ON_CALL(cc, Method()).WillByDefault(Return(42));
- EXPECT_EQ(42, cc.Method());
-}
-
-// Tests that a method with expanded name compiles.
-TEST(ExpectCallSyntaxTest, CompilesWithMethodNameExpandedFromMacro) {
- MockCC cc;
- EXPECT_CALL(cc, Method());
- cc.Method();
-}
-
-// Tests that it works, too.
-TEST(ExpectCallSyntaxTest, WorksWithMethodNameExpandedFromMacro) {
- MockCC cc;
- EXPECT_CALL(cc, Method()).WillOnce(Return(42));
- EXPECT_EQ(42, cc.Method());
-}
-
-#undef Method // Done with macro redefinition tests.
-
-// Tests that ON_CALL evaluates its arguments exactly once as promised
-// by Google Mock.
-TEST(OnCallSyntaxTest, EvaluatesFirstArgumentOnce) {
- MockA a;
- MockA* pa = &a;
-
- ON_CALL(*pa++, DoA(_));
- EXPECT_EQ(&a + 1, pa);
-}
-
-TEST(OnCallSyntaxTest, EvaluatesSecondArgumentOnce) {
- MockA a;
- int n = 0;
-
- ON_CALL(a, DoA(n++));
- EXPECT_EQ(1, n);
-}
-
-// Tests that the syntax of ON_CALL() is enforced at run time.
-
-TEST(OnCallSyntaxTest, WithIsOptional) {
- MockA a;
-
- ON_CALL(a, DoA(5))
- .WillByDefault(Return());
- ON_CALL(a, DoA(_))
- .With(_)
- .WillByDefault(Return());
-}
-
-TEST(OnCallSyntaxTest, WithCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(a, ReturnResult(_))
- .With(_)
- .With(_)
- .WillByDefault(Return(Result()));
- }, ".With() cannot appear more than once in an ON_CALL()");
-}
-
-TEST(OnCallSyntaxTest, WillByDefaultIsMandatory) {
- MockA a;
-
- EXPECT_DEATH_IF_SUPPORTED({
- ON_CALL(a, DoA(5));
- a.DoA(5);
- }, "");
-}
-
-TEST(OnCallSyntaxTest, WillByDefaultCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- ON_CALL(a, DoA(5))
- .WillByDefault(Return())
- .WillByDefault(Return());
- }, ".WillByDefault() must appear exactly once in an ON_CALL()");
-}
-
-// Tests that EXPECT_CALL evaluates its arguments exactly once as
-// promised by Google Mock.
-TEST(ExpectCallSyntaxTest, EvaluatesFirstArgumentOnce) {
- MockA a;
- MockA* pa = &a;
-
- EXPECT_CALL(*pa++, DoA(_));
- a.DoA(0);
- EXPECT_EQ(&a + 1, pa);
-}
-
-TEST(ExpectCallSyntaxTest, EvaluatesSecondArgumentOnce) {
- MockA a;
- int n = 0;
-
- EXPECT_CALL(a, DoA(n++));
- a.DoA(0);
- EXPECT_EQ(1, n);
-}
-
-// Tests that the syntax of EXPECT_CALL() is enforced at run time.
-
-TEST(ExpectCallSyntaxTest, WithIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(5))
- .Times(0);
- EXPECT_CALL(a, DoA(6))
- .With(_)
- .Times(0);
-}
-
-TEST(ExpectCallSyntaxTest, WithCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(6))
- .With(_)
- .With(_);
- }, ".With() cannot appear more than once in an EXPECT_CALL()");
-
- a.DoA(6);
-}
-
-TEST(ExpectCallSyntaxTest, WithMustBeFirstClause) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .Times(1)
- .With(_);
- }, ".With() must be the first clause in an EXPECT_CALL()");
-
- a.DoA(1);
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .With(_);
- }, ".With() must be the first clause in an EXPECT_CALL()");
-
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, TimesCanBeInferred) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return());
-
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .WillRepeatedly(Return());
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, TimesCanAppearAtMostOnce) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .Times(1)
- .Times(2);
- }, ".Times() cannot appear more than once in an EXPECT_CALL()");
-
- a.DoA(1);
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, TimesMustBeBeforeInSequence) {
- MockA a;
- Sequence s;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .InSequence(s)
- .Times(1);
- }, ".Times() may only appear *before* ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceIsOptional) {
- MockA a;
- Sequence s;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2))
- .InSequence(s);
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceCanAppearMultipleTimes) {
- MockA a;
- Sequence s1, s2;
-
- EXPECT_CALL(a, DoA(1))
- .InSequence(s1, s2)
- .InSequence(s1);
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceMustBeBeforeAfter) {
- MockA a;
- Sequence s;
-
- Expectation e = EXPECT_CALL(a, DoA(1))
- .Times(AnyNumber());
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(2))
- .After(e)
- .InSequence(s);
- }, ".InSequence() cannot appear after ");
-
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, InSequenceMustBeBeforeWillOnce) {
- MockA a;
- Sequence s;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return())
- .InSequence(s);
- }, ".InSequence() cannot appear after ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, AfterMustBeBeforeWillOnce) {
- MockA a;
-
- Expectation e = EXPECT_CALL(a, DoA(1));
- EXPECT_NONFATAL_FAILURE({
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .After(e);
- }, ".After() cannot appear after ");
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return());
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillCanAppearMultipleTimes) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .Times(AnyNumber())
- .WillOnce(Return())
- .WillOnce(Return())
- .WillOnce(Return());
-}
-
-TEST(ExpectCallSyntaxTest, WillMustBeBeforeWillRepeatedly) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillRepeatedly(Return())
- .WillOnce(Return());
- }, ".WillOnce() cannot appear after ");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Return());
- EXPECT_CALL(a, DoA(2))
- .WillOnce(Return())
- .WillRepeatedly(Return());
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(2);
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyCannotAppearMultipleTimes) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .WillRepeatedly(Return())
- .WillRepeatedly(Return());
- }, ".WillRepeatedly() cannot appear more than once in an "
- "EXPECT_CALL()");
-}
-
-TEST(ExpectCallSyntaxTest, WillRepeatedlyMustBeBeforeRetiresOnSaturation) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation()
- .WillRepeatedly(Return());
- }, ".WillRepeatedly() cannot appear after ");
-}
-
-TEST(ExpectCallSyntaxTest, RetiresOnSaturationIsOptional) {
- MockA a;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation();
-
- a.DoA(1);
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, RetiresOnSaturationCannotAppearMultipleTimes) {
- MockA a;
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_CALL(a, DoA(1))
- .RetiresOnSaturation()
- .RetiresOnSaturation();
- }, ".RetiresOnSaturation() cannot appear more than once");
-
- a.DoA(1);
-}
-
-TEST(ExpectCallSyntaxTest, DefaultCardinalityIsOnce) {
- {
- MockA a;
- EXPECT_CALL(a, DoA(1));
- a.DoA(1);
- }
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockA a;
- EXPECT_CALL(a, DoA(1));
- }, "to be called once");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockA a;
- EXPECT_CALL(a, DoA(1));
- a.DoA(1);
- a.DoA(1);
- }, "to be called once");
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that Google Mock doesn't print a warning when the number of
-// WillOnce() is adequate.
-TEST(ExpectCallSyntaxTest, DoesNotWarnOnAdequateActionCount) {
- CaptureStdout();
- {
- MockB b;
-
- // It's always fine to omit WillOnce() entirely.
- EXPECT_CALL(b, DoB())
- .Times(0);
- EXPECT_CALL(b, DoB(1))
- .Times(AtMost(1));
- EXPECT_CALL(b, DoB(2))
- .Times(1)
- .WillRepeatedly(Return(1));
-
- // It's fine for the number of WillOnce()s to equal the upper bound.
- EXPECT_CALL(b, DoB(3))
- .Times(Between(1, 2))
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- // It's fine for the number of WillOnce()s to be smaller than the
- // upper bound when there is a WillRepeatedly().
- EXPECT_CALL(b, DoB(4))
- .Times(AtMost(3))
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- // Satisfies the above expectations.
- b.DoB(2);
- b.DoB(3);
- }
- EXPECT_STREQ("", GetCapturedStdout().c_str());
-}
-
-// Tests that Google Mock warns on having too many actions in an
-// expectation compared to its cardinality.
-TEST(ExpectCallSyntaxTest, WarnsOnTooManyActions) {
- CaptureStdout();
- {
- MockB b;
-
- // Warns when the number of WillOnce()s is larger than the upper bound.
- EXPECT_CALL(b, DoB())
- .Times(0)
- .WillOnce(Return(1)); // #1
- EXPECT_CALL(b, DoB())
- .Times(AtMost(1))
- .WillOnce(Return(1))
- .WillOnce(Return(2)); // #2
- EXPECT_CALL(b, DoB(1))
- .Times(1)
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .RetiresOnSaturation(); // #3
-
- // Warns when the number of WillOnce()s equals the upper bound and
- // there is a WillRepeatedly().
- EXPECT_CALL(b, DoB())
- .Times(0)
- .WillRepeatedly(Return(1)); // #4
- EXPECT_CALL(b, DoB(2))
- .Times(1)
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2)); // #5
-
- // Satisfies the above expectations.
- b.DoB(1);
- b.DoB(2);
- }
- const std::string output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be never called, but has 1 WillOnce().",
- output); // #1
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be called at most once, "
- "but has 2 WillOnce()s.",
- output); // #2
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB(1))...\n"
- "Expected to be called once, but has 2 WillOnce()s.",
- output); // #3
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be never called, but has 0 WillOnce()s "
- "and a WillRepeatedly().",
- output); // #4
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too many actions specified in EXPECT_CALL(b, DoB(2))...\n"
- "Expected to be called once, but has 1 WillOnce() "
- "and a WillRepeatedly().",
- output); // #5
-}
-
-// Tests that Google Mock warns on having too few actions in an
-// expectation compared to its cardinality.
-TEST(ExpectCallSyntaxTest, WarnsOnTooFewActions) {
- MockB b;
-
- EXPECT_CALL(b, DoB())
- .Times(Between(2, 3))
- .WillOnce(Return(1));
-
- CaptureStdout();
- b.DoB();
- const std::string output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Too few actions specified in EXPECT_CALL(b, DoB())...\n"
- "Expected to be called between 2 and 3 times, "
- "but has only 1 WillOnce().",
- output);
- b.DoB();
-}
-
-TEST(ExpectCallSyntaxTest, WarningIsErrorWithFlag) {
- int original_behavior = GMOCK_FLAG_GET(default_mock_behavior);
-
- GMOCK_FLAG_SET(default_mock_behavior, kAllow);
- CaptureStdout();
- {
- MockA a;
- a.DoA(0);
- }
- std::string output = GetCapturedStdout();
- EXPECT_TRUE(output.empty()) << output;
-
- GMOCK_FLAG_SET(default_mock_behavior, kWarn);
- CaptureStdout();
- {
- MockA a;
- a.DoA(0);
- }
- std::string warning_output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", warning_output);
- EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
- warning_output);
-
- GMOCK_FLAG_SET(default_mock_behavior, kFail);
- EXPECT_NONFATAL_FAILURE({
- MockA a;
- a.DoA(0);
- }, "Uninteresting mock function call");
-
- // Out of bounds values are converted to kWarn
- GMOCK_FLAG_SET(default_mock_behavior, -1);
- CaptureStdout();
- {
- MockA a;
- a.DoA(0);
- }
- warning_output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", warning_output);
- EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
- warning_output);
- GMOCK_FLAG_SET(default_mock_behavior, 3);
- CaptureStdout();
- {
- MockA a;
- a.DoA(0);
- }
- warning_output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", warning_output);
- EXPECT_PRED_FORMAT2(IsSubstring, "Uninteresting mock function call",
- warning_output);
-
- GMOCK_FLAG_SET(default_mock_behavior, original_behavior);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests the semantics of ON_CALL().
-
-// Tests that the built-in default action is taken when no ON_CALL()
-// is specified.
-TEST(OnCallTest, TakesBuiltInDefaultActionWhenNoOnCall) {
- MockB b;
- EXPECT_CALL(b, DoB());
-
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that the built-in default action is taken when no ON_CALL()
-// matches the invocation.
-TEST(OnCallTest, TakesBuiltInDefaultActionWhenNoOnCallMatches) {
- MockB b;
- ON_CALL(b, DoB(1))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_));
-
- EXPECT_EQ(0, b.DoB(2));
-}
-
-// Tests that the last matching ON_CALL() action is taken.
-TEST(OnCallTest, PicksLastMatchingOnCall) {
- MockB b;
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(3));
- ON_CALL(b, DoB(2))
- .WillByDefault(Return(2));
- ON_CALL(b, DoB(1))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_));
-
- EXPECT_EQ(2, b.DoB(2));
-}
-
-// Tests the semantics of EXPECT_CALL().
-
-// Tests that any call is allowed when no EXPECT_CALL() is specified.
-TEST(ExpectCallTest, AllowsAnyCallWhenNoSpec) {
- MockB b;
- EXPECT_CALL(b, DoB());
- // There is no expectation on DoB(int).
-
- b.DoB();
-
- // DoB(int) can be called any number of times.
- b.DoB(1);
- b.DoB(2);
-}
-
-// Tests that the last matching EXPECT_CALL() fires.
-TEST(ExpectCallTest, PicksLastMatchingExpectCall) {
- MockB b;
- EXPECT_CALL(b, DoB(_))
- .WillRepeatedly(Return(2));
- EXPECT_CALL(b, DoB(1))
- .WillRepeatedly(Return(1));
-
- EXPECT_EQ(1, b.DoB(1));
-}
-
-// Tests lower-bound violation.
-TEST(ExpectCallTest, CatchesTooFewCalls) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB(5))
- .Times(AtLeast(2));
-
- b.DoB(5);
- }, "Actual function call count doesn't match EXPECT_CALL(b, DoB(5))...\n"
- " Expected: to be called at least twice\n"
- " Actual: called once - unsatisfied and active");
-}
-
-// Tests that the cardinality can be inferred when no Times(...) is
-// specified.
-TEST(ExpectCallTest, InfersCardinalityWhenThereIsNoWillRepeatedly) {
- {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- }, "to be called twice");
-
- { // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_NONFATAL_FAILURE(b.DoB(), "to be called twice");
- }
-}
-
-TEST(ExpectCallTest, InfersCardinality1WhenThereIsWillRepeatedly) {
- {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- }
-
- { // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(2, b.DoB());
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
- }, "to be called at least once");
-}
-
-// Tests that the n-th action is taken for the n-th matching
-// invocation.
-TEST(ExpectCallTest, NthMatchTakesNthAction) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillOnce(Return(2))
- .WillOnce(Return(3));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(3, b.DoB());
-}
-
-// Tests that the WillRepeatedly() action is taken when the WillOnce(...)
-// list is exhausted.
-TEST(ExpectCallTest, TakesRepeatedActionWhenWillListIsExhausted) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1))
- .WillRepeatedly(Return(2));
-
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- EXPECT_EQ(2, b.DoB());
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that the default action is taken when the WillOnce(...) list is
-// exhausted and there is no WillRepeatedly().
-TEST(ExpectCallTest, TakesDefaultActionWhenWillListIsExhausted) {
- MockB b;
- EXPECT_CALL(b, DoB(_))
- .Times(1);
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber())
- .WillOnce(Return(1))
- .WillOnce(Return(2));
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB(1)); // Shouldn't generate a warning as the
- // expectation has no action clause at all.
- EXPECT_EQ(1, b.DoB());
- EXPECT_EQ(2, b.DoB());
- const std::string output1 = GetCapturedStdout();
- EXPECT_STREQ("", output1.c_str());
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB());
- const std::string output2 = GetCapturedStdout();
- EXPECT_THAT(output2.c_str(),
- HasSubstr("Actions ran out in EXPECT_CALL(b, DoB())...\n"
- "Called 3 times, but only 2 WillOnce()s are specified"
- " - returning default value."));
- EXPECT_THAT(output2.c_str(),
- HasSubstr("Actions ran out in EXPECT_CALL(b, DoB())...\n"
- "Called 4 times, but only 2 WillOnce()s are specified"
- " - returning default value."));
-}
-
-TEST(FunctionMockerMessageTest, ReportsExpectCallLocationForExhausedActions) {
- MockB b;
- std::string expect_call_location = FormatFileLocation(__FILE__, __LINE__ + 1);
- EXPECT_CALL(b, DoB()).Times(AnyNumber()).WillOnce(Return(1));
-
- EXPECT_EQ(1, b.DoB());
-
- CaptureStdout();
- EXPECT_EQ(0, b.DoB());
- const std::string output = GetCapturedStdout();
- // The warning message should contain the call location.
- EXPECT_PRED_FORMAT2(IsSubstring, expect_call_location, output);
-}
-
-TEST(FunctionMockerMessageTest,
- ReportsDefaultActionLocationOfUninterestingCallsForNaggyMock) {
- std::string on_call_location;
- CaptureStdout();
- {
- NaggyMock<MockB> b;
- on_call_location = FormatFileLocation(__FILE__, __LINE__ + 1);
- ON_CALL(b, DoB(_)).WillByDefault(Return(0));
- b.DoB(0);
- }
- EXPECT_PRED_FORMAT2(IsSubstring, on_call_location, GetCapturedStdout());
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that an uninteresting call performs the default action.
-TEST(UninterestingCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_TRUE(a.Binary(1, 2));
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that an unexpected call performs the default action.
-TEST(UnexpectedCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(0, 0));
- a.Binary(0, 0);
- bool result = false;
- EXPECT_NONFATAL_FAILURE(result = a.Binary(1, 2),
- "Unexpected mock function call");
- EXPECT_TRUE(result);
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .Times(0);
- int n = -1;
- EXPECT_NONFATAL_FAILURE(n = b.DoB(1),
- "Unexpected mock function call");
- EXPECT_EQ(0, n);
-}
-
-// Tests that when an unexpected void function generates the right
-// failure message.
-TEST(UnexpectedCallTest, GeneratesFailureForVoidFunction) {
- // First, tests the message when there is only one EXPECT_CALL().
- MockA a1;
- EXPECT_CALL(a1, DoA(1));
- a1.DoA(1);
- // Ideally we should match the failure message against a regex, but
- // EXPECT_NONFATAL_FAILURE doesn't support that, so we test for
- // multiple sub-strings instead.
- EXPECT_NONFATAL_FAILURE(
- a1.DoA(9),
- "Unexpected mock function call - returning directly.\n"
- " Function call: DoA(9)\n"
- "Google Mock tried the following 1 expectation, but it didn't match:");
- EXPECT_NONFATAL_FAILURE(
- a1.DoA(9),
- " Expected arg #0: is equal to 1\n"
- " Actual: 9\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
-
- // Next, tests the message when there are more than one EXPECT_CALL().
- MockA a2;
- EXPECT_CALL(a2, DoA(1));
- EXPECT_CALL(a2, DoA(3));
- a2.DoA(1);
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "Unexpected mock function call - returning directly.\n"
- " Function call: DoA(2)\n"
- "Google Mock tried the following 2 expectations, but none matched:");
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "tried expectation #0: EXPECT_CALL(a2, DoA(1))...\n"
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
- EXPECT_NONFATAL_FAILURE(
- a2.DoA(2),
- "tried expectation #1: EXPECT_CALL(a2, DoA(3))...\n"
- " Expected arg #0: is equal to 3\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: never called - unsatisfied and active");
- a2.DoA(3);
-}
-
-// Tests that an unexpected non-void function generates the right
-// failure message.
-TEST(UnexpectedCallTest, GeneartesFailureForNonVoidFunction) {
- MockB b1;
- EXPECT_CALL(b1, DoB(1));
- b1.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b1.DoB(2),
- "Unexpected mock function call - returning default value.\n"
- " Function call: DoB(2)\n"
- " Returns: 0\n"
- "Google Mock tried the following 1 expectation, but it didn't match:");
- EXPECT_NONFATAL_FAILURE(
- b1.DoB(2),
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n"
- " Expected: to be called once\n"
- " Actual: called once - saturated and active");
-}
-
-// Tests that Google Mock explains that an retired expectation doesn't
-// match the call.
-TEST(UnexpectedCallTest, RetiredExpectation) {
- MockB b;
- EXPECT_CALL(b, DoB(1))
- .RetiresOnSaturation();
-
- b.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b.DoB(1),
- " Expected: the expectation is active\n"
- " Actual: it is retired");
-}
-
-// Tests that Google Mock explains that an expectation that doesn't
-// match the arguments doesn't match the call.
-TEST(UnexpectedCallTest, UnmatchedArguments) {
- MockB b;
- EXPECT_CALL(b, DoB(1));
-
- EXPECT_NONFATAL_FAILURE(
- b.DoB(2),
- " Expected arg #0: is equal to 1\n"
- " Actual: 2\n");
- b.DoB(1);
-}
-
-// Tests that Google Mock explains that an expectation with
-// unsatisfied pre-requisites doesn't match the call.
-TEST(UnexpectedCallTest, UnsatisifiedPrerequisites) {
- Sequence s1, s2;
- MockB b;
- EXPECT_CALL(b, DoB(1))
- .InSequence(s1);
- EXPECT_CALL(b, DoB(2))
- .Times(AnyNumber())
- .InSequence(s1);
- EXPECT_CALL(b, DoB(3))
- .InSequence(s2);
- EXPECT_CALL(b, DoB(4))
- .InSequence(s1, s2);
-
- ::testing::TestPartResultArray failures;
- {
- ::testing::ScopedFakeTestPartResultReporter reporter(&failures);
- b.DoB(4);
- // Now 'failures' contains the Google Test failures generated by
- // the above statement.
- }
-
- // There should be one non-fatal failure.
- ASSERT_EQ(1, failures.size());
- const ::testing::TestPartResult& r = failures.GetTestPartResult(0);
- EXPECT_EQ(::testing::TestPartResult::kNonFatalFailure, r.type());
-
- // Verifies that the failure message contains the two unsatisfied
- // pre-requisites but not the satisfied one.
-#if GTEST_USES_PCRE
- EXPECT_THAT(r.message(), ContainsRegex(
- // PCRE has trouble using (.|\n) to match any character, but
- // supports the (?s) prefix for using . to match any character.
- "(?s)the following immediate pre-requisites are not satisfied:\n"
- ".*: pre-requisite #0\n"
- ".*: pre-requisite #1"));
-#elif GTEST_USES_POSIX_RE
- EXPECT_THAT(r.message(), ContainsRegex(
- // POSIX RE doesn't understand the (?s) prefix, but has no trouble
- // with (.|\n).
- "the following immediate pre-requisites are not satisfied:\n"
- "(.|\n)*: pre-requisite #0\n"
- "(.|\n)*: pre-requisite #1"));
-#else
- // We can only use Google Test's own simple regex.
- EXPECT_THAT(r.message(), ContainsRegex(
- "the following immediate pre-requisites are not satisfied:"));
- EXPECT_THAT(r.message(), ContainsRegex(": pre-requisite #0"));
- EXPECT_THAT(r.message(), ContainsRegex(": pre-requisite #1"));
-#endif // GTEST_USES_PCRE
-
- b.DoB(1);
- b.DoB(3);
- b.DoB(4);
-}
-
-TEST(UndefinedReturnValueTest,
- ReturnValueIsMandatoryWhenNotDefaultConstructible) {
- MockA a;
- // FIXME: We should really verify the output message,
- // but we cannot yet due to that EXPECT_DEATH only captures stderr
- // while Google Mock logs to stdout.
-#if GTEST_HAS_EXCEPTIONS
- EXPECT_ANY_THROW(a.ReturnNonDefaultConstructible());
-#else
- EXPECT_DEATH_IF_SUPPORTED(a.ReturnNonDefaultConstructible(), "");
-#endif
-}
-
-// Tests that an excessive call (one whose arguments match the
-// matchers but is called too many times) performs the default action.
-TEST(ExcessiveCallTest, DoesDefaultAction) {
- // When there is an ON_CALL() statement, the action specified by it
- // should be taken.
- MockA a;
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(0, 0));
- a.Binary(0, 0);
- bool result = false;
- EXPECT_NONFATAL_FAILURE(result = a.Binary(0, 0),
- "Mock function called more times than expected");
- EXPECT_TRUE(result);
-
- // When there is no ON_CALL(), the default value for the return type
- // should be returned.
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .Times(0);
- int n = -1;
- EXPECT_NONFATAL_FAILURE(n = b.DoB(0),
- "Mock function called more times than expected");
- EXPECT_EQ(0, n);
-}
-
-// Tests that when a void function is called too many times,
-// the failure message contains the argument values.
-TEST(ExcessiveCallTest, GeneratesFailureForVoidFunction) {
- MockA a;
- EXPECT_CALL(a, DoA(_))
- .Times(0);
- EXPECT_NONFATAL_FAILURE(
- a.DoA(9),
- "Mock function called more times than expected - returning directly.\n"
- " Function call: DoA(9)\n"
- " Expected: to be never called\n"
- " Actual: called once - over-saturated and active");
-}
-
-// Tests that when a non-void function is called too many times, the
-// failure message contains the argument values and the return value.
-TEST(ExcessiveCallTest, GeneratesFailureForNonVoidFunction) {
- MockB b;
- EXPECT_CALL(b, DoB(_));
- b.DoB(1);
- EXPECT_NONFATAL_FAILURE(
- b.DoB(2),
- "Mock function called more times than expected - "
- "returning default value.\n"
- " Function call: DoB(2)\n"
- " Returns: 0\n"
- " Expected: to be called once\n"
- " Actual: called twice - over-saturated and active");
-}
-
-// Tests using sequences.
-
-TEST(InSequenceTest, AllExpectationInScopeAreInSequence) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2));
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(2);
- }, "Unexpected mock function call");
-
- a.DoA(1);
- a.DoA(2);
-}
-
-TEST(InSequenceTest, NestedInSequence) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- {
- InSequence dummy2;
-
- EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3));
- }
- }
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(1);
- a.DoA(3);
- }, "Unexpected mock function call");
-
- a.DoA(2);
- a.DoA(3);
-}
-
-TEST(InSequenceTest, ExpectationsOutOfScopeAreNotAffected) {
- MockA a;
- {
- InSequence dummy;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2));
- }
- EXPECT_CALL(a, DoA(3));
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- a.DoA(2);
- }, "Unexpected mock function call");
-
- a.DoA(3);
- a.DoA(1);
- a.DoA(2);
-}
-
-// Tests that any order is allowed when no sequence is used.
-TEST(SequenceTest, AnyOrderIsOkByDefault) {
- {
- MockA a;
- MockB b;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber());
-
- a.DoA(1);
- b.DoB();
- }
-
- { // NOLINT
- MockA a;
- MockB b;
-
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(b, DoB())
- .Times(AnyNumber());
-
- b.DoB();
- a.DoA(1);
- }
-}
-
-// Tests that the calls must be in strict order when a complete order
-// is specified.
-TEST(SequenceTest, CallsMustBeInStrictOrderWhenSaidSo1) {
- MockA a;
- ON_CALL(a, ReturnResult(_))
- .WillByDefault(Return(Result()));
-
- Sequence s;
- EXPECT_CALL(a, ReturnResult(1))
- .InSequence(s);
- EXPECT_CALL(a, ReturnResult(2))
- .InSequence(s);
- EXPECT_CALL(a, ReturnResult(3))
- .InSequence(s);
-
- a.ReturnResult(1);
-
- // May only be called after a.ReturnResult(2).
- EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
-
- a.ReturnResult(2);
- a.ReturnResult(3);
-}
-
-// Tests that the calls must be in strict order when a complete order
-// is specified.
-TEST(SequenceTest, CallsMustBeInStrictOrderWhenSaidSo2) {
- MockA a;
- ON_CALL(a, ReturnResult(_))
- .WillByDefault(Return(Result()));
-
- Sequence s;
- EXPECT_CALL(a, ReturnResult(1))
- .InSequence(s);
- EXPECT_CALL(a, ReturnResult(2))
- .InSequence(s);
-
- // May only be called after a.ReturnResult(1).
- EXPECT_NONFATAL_FAILURE(a.ReturnResult(2), "Unexpected mock function call");
-
- a.ReturnResult(1);
- a.ReturnResult(2);
-}
-
-// Tests specifying a DAG using multiple sequences.
-class PartialOrderTest : public testing::Test {
- protected:
- PartialOrderTest() {
- ON_CALL(a_, ReturnResult(_))
- .WillByDefault(Return(Result()));
-
- // Specifies this partial ordering:
- //
- // a.ReturnResult(1) ==>
- // a.ReturnResult(2) * n ==> a.ReturnResult(3)
- // b.DoB() * 2 ==>
- Sequence x, y;
- EXPECT_CALL(a_, ReturnResult(1))
- .InSequence(x);
- EXPECT_CALL(b_, DoB())
- .Times(2)
- .InSequence(y);
- EXPECT_CALL(a_, ReturnResult(2))
- .Times(AnyNumber())
- .InSequence(x, y);
- EXPECT_CALL(a_, ReturnResult(3))
- .InSequence(x);
- }
-
- MockA a_;
- MockB b_;
-};
-
-TEST_F(PartialOrderTest, CallsMustConformToSpecifiedDag1) {
- a_.ReturnResult(1);
- b_.DoB();
-
- // May only be called after the second DoB().
- EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
-
- b_.DoB();
- a_.ReturnResult(3);
-}
-
-TEST_F(PartialOrderTest, CallsMustConformToSpecifiedDag2) {
- // May only be called after ReturnResult(1).
- EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
-
- a_.ReturnResult(1);
- b_.DoB();
- b_.DoB();
- a_.ReturnResult(3);
-}
-
-TEST_F(PartialOrderTest, CallsMustConformToSpecifiedDag3) {
- // May only be called last.
- EXPECT_NONFATAL_FAILURE(a_.ReturnResult(3), "Unexpected mock function call");
-
- a_.ReturnResult(1);
- b_.DoB();
- b_.DoB();
- a_.ReturnResult(3);
-}
-
-TEST_F(PartialOrderTest, CallsMustConformToSpecifiedDag4) {
- a_.ReturnResult(1);
- b_.DoB();
- b_.DoB();
- a_.ReturnResult(3);
-
- // May only be called before ReturnResult(3).
- EXPECT_NONFATAL_FAILURE(a_.ReturnResult(2), "Unexpected mock function call");
-}
-
-TEST(SequenceTest, Retirement) {
- MockA a;
- Sequence s;
-
- EXPECT_CALL(a, DoA(1))
- .InSequence(s);
- EXPECT_CALL(a, DoA(_))
- .InSequence(s)
- .RetiresOnSaturation();
- EXPECT_CALL(a, DoA(1))
- .InSequence(s);
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(1);
-}
-
-// Tests Expectation.
-
-TEST(ExpectationTest, ConstrutorsWork) {
- MockA a;
- Expectation e1; // Default ctor.
-
- // Ctor from various forms of EXPECT_CALL.
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3)).With(_);
- {
- Sequence s;
- Expectation e4 = EXPECT_CALL(a, DoA(4)).Times(1);
- Expectation e5 = EXPECT_CALL(a, DoA(5)).InSequence(s);
- }
- Expectation e6 = EXPECT_CALL(a, DoA(6)).After(e2);
- Expectation e7 = EXPECT_CALL(a, DoA(7)).WillOnce(Return());
- Expectation e8 = EXPECT_CALL(a, DoA(8)).WillRepeatedly(Return());
- Expectation e9 = EXPECT_CALL(a, DoA(9)).RetiresOnSaturation();
-
- Expectation e10 = e2; // Copy ctor.
-
- EXPECT_THAT(e1, Ne(e2));
- EXPECT_THAT(e2, Eq(e10));
-
- a.DoA(2);
- a.DoA(3);
- a.DoA(4);
- a.DoA(5);
- a.DoA(6);
- a.DoA(7);
- a.DoA(8);
- a.DoA(9);
-}
-
-TEST(ExpectationTest, AssignmentWorks) {
- MockA a;
- Expectation e1;
- Expectation e2 = EXPECT_CALL(a, DoA(1));
-
- EXPECT_THAT(e1, Ne(e2));
-
- e1 = e2;
- EXPECT_THAT(e1, Eq(e2));
-
- a.DoA(1);
-}
-
-// Tests ExpectationSet.
-
-TEST(ExpectationSetTest, MemberTypesAreCorrect) {
- ::testing::StaticAssertTypeEq<Expectation, ExpectationSet::value_type>();
-}
-
-TEST(ExpectationSetTest, ConstructorsWork) {
- MockA a;
-
- Expectation e1;
- const Expectation e2;
- ExpectationSet es1; // Default ctor.
- ExpectationSet es2 = EXPECT_CALL(a, DoA(1)); // Ctor from EXPECT_CALL.
- ExpectationSet es3 = e1; // Ctor from Expectation.
- ExpectationSet es4(e1); // Ctor from Expectation; alternative syntax.
- ExpectationSet es5 = e2; // Ctor from const Expectation.
- ExpectationSet es6(e2); // Ctor from const Expectation; alternative syntax.
- ExpectationSet es7 = es2; // Copy ctor.
-
- EXPECT_EQ(0, es1.size());
- EXPECT_EQ(1, es2.size());
- EXPECT_EQ(1, es3.size());
- EXPECT_EQ(1, es4.size());
- EXPECT_EQ(1, es5.size());
- EXPECT_EQ(1, es6.size());
- EXPECT_EQ(1, es7.size());
-
- EXPECT_THAT(es3, Ne(es2));
- EXPECT_THAT(es4, Eq(es3));
- EXPECT_THAT(es5, Eq(es4));
- EXPECT_THAT(es6, Eq(es5));
- EXPECT_THAT(es7, Eq(es2));
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, AssignmentWorks) {
- ExpectationSet es1;
- ExpectationSet es2 = Expectation();
-
- es1 = es2;
- EXPECT_EQ(1, es1.size());
- EXPECT_THAT(*(es1.begin()), Eq(Expectation()));
- EXPECT_THAT(es1, Eq(es2));
-}
-
-TEST(ExpectationSetTest, InsertionWorks) {
- ExpectationSet es1;
- Expectation e1;
- es1 += e1;
- EXPECT_EQ(1, es1.size());
- EXPECT_THAT(*(es1.begin()), Eq(e1));
-
- MockA a;
- Expectation e2 = EXPECT_CALL(a, DoA(1));
- es1 += e2;
- EXPECT_EQ(2, es1.size());
-
- ExpectationSet::const_iterator it1 = es1.begin();
- ExpectationSet::const_iterator it2 = it1;
- ++it2;
- EXPECT_TRUE(*it1 == e1 || *it2 == e1); // e1 must be in the set.
- EXPECT_TRUE(*it1 == e2 || *it2 == e2); // e2 must be in the set too.
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, SizeWorks) {
- ExpectationSet es;
- EXPECT_EQ(0, es.size());
-
- es += Expectation();
- EXPECT_EQ(1, es.size());
-
- MockA a;
- es += EXPECT_CALL(a, DoA(1));
- EXPECT_EQ(2, es.size());
-
- a.DoA(1);
-}
-
-TEST(ExpectationSetTest, IsEnumerable) {
- ExpectationSet es;
- EXPECT_TRUE(es.begin() == es.end());
-
- es += Expectation();
- ExpectationSet::const_iterator it = es.begin();
- EXPECT_TRUE(it != es.end());
- EXPECT_THAT(*it, Eq(Expectation()));
- ++it;
- EXPECT_TRUE(it== es.end());
-}
-
-// Tests the .After() clause.
-
-TEST(AfterTest, SucceedsWhenPartialOrderIsSatisfied) {
- MockA a;
- ExpectationSet es;
- es += EXPECT_CALL(a, DoA(1));
- es += EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3))
- .After(es);
-
- a.DoA(1);
- a.DoA(2);
- a.DoA(3);
-}
-
-TEST(AfterTest, SucceedsWhenTotalOrderIsSatisfied) {
- MockA a;
- MockB b;
- // The following also verifies that const Expectation objects work
- // too. Do not remove the const modifiers.
- const Expectation e1 = EXPECT_CALL(a, DoA(1));
- const Expectation e2 = EXPECT_CALL(b, DoB())
- .Times(2)
- .After(e1);
- EXPECT_CALL(a, DoA(2)).After(e2);
-
- a.DoA(1);
- b.DoB();
- b.DoB();
- a.DoA(2);
-}
-
-// Calls must be in strict order when specified so using .After().
-TEST(AfterTest, CallsMustBeInStrictOrderWhenSpecifiedSo1) {
- MockA a;
- MockB b;
-
- // Define ordering:
- // a.DoA(1) ==> b.DoB() ==> a.DoA(2)
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(b, DoB())
- .After(e1);
- EXPECT_CALL(a, DoA(2))
- .After(e2);
-
- a.DoA(1);
-
- // May only be called after DoB().
- EXPECT_NONFATAL_FAILURE(a.DoA(2), "Unexpected mock function call");
-
- b.DoB();
- a.DoA(2);
-}
-
-// Calls must be in strict order when specified so using .After().
-TEST(AfterTest, CallsMustBeInStrictOrderWhenSpecifiedSo2) {
- MockA a;
- MockB b;
-
- // Define ordering:
- // a.DoA(1) ==> b.DoB() * 2 ==> a.DoA(2)
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(b, DoB())
- .Times(2)
- .After(e1);
- EXPECT_CALL(a, DoA(2))
- .After(e2);
-
- a.DoA(1);
- b.DoB();
-
- // May only be called after the second DoB().
- EXPECT_NONFATAL_FAILURE(a.DoA(2), "Unexpected mock function call");
-
- b.DoB();
- a.DoA(2);
-}
-
-// Calls must satisfy the partial order when specified so.
-TEST(AfterTest, CallsMustSatisfyPartialOrderWhenSpecifiedSo) {
- MockA a;
- ON_CALL(a, ReturnResult(_))
- .WillByDefault(Return(Result()));
-
- // Define ordering:
- // a.DoA(1) ==>
- // a.DoA(2) ==> a.ReturnResult(3)
- Expectation e = EXPECT_CALL(a, DoA(1));
- const ExpectationSet es = EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, ReturnResult(3))
- .After(e, es);
-
- // May only be called last.
- EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
-
- a.DoA(2);
- a.DoA(1);
- a.ReturnResult(3);
-}
-
-// Calls must satisfy the partial order when specified so.
-TEST(AfterTest, CallsMustSatisfyPartialOrderWhenSpecifiedSo2) {
- MockA a;
-
- // Define ordering:
- // a.DoA(1) ==>
- // a.DoA(2) ==> a.DoA(3)
- Expectation e = EXPECT_CALL(a, DoA(1));
- const ExpectationSet es = EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3))
- .After(e, es);
-
- a.DoA(2);
-
- // May only be called last.
- EXPECT_NONFATAL_FAILURE(a.DoA(3), "Unexpected mock function call");
-
- a.DoA(1);
- a.DoA(3);
-}
-
-// .After() can be combined with .InSequence().
-TEST(AfterTest, CanBeUsedWithInSequence) {
- MockA a;
- Sequence s;
- Expectation e = EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(2)).InSequence(s);
- EXPECT_CALL(a, DoA(3))
- .InSequence(s)
- .After(e);
-
- a.DoA(1);
-
- // May only be after DoA(2).
- EXPECT_NONFATAL_FAILURE(a.DoA(3), "Unexpected mock function call");
-
- a.DoA(2);
- a.DoA(3);
-}
-
-// .After() can be called multiple times.
-TEST(AfterTest, CanBeCalledManyTimes) {
- MockA a;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3));
- EXPECT_CALL(a, DoA(4))
- .After(e1)
- .After(e2)
- .After(e3);
-
- a.DoA(3);
- a.DoA(1);
- a.DoA(2);
- a.DoA(4);
-}
-
-// .After() accepts up to 5 arguments.
-TEST(AfterTest, AcceptsUpToFiveArguments) {
- MockA a;
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- Expectation e3 = EXPECT_CALL(a, DoA(3));
- ExpectationSet es1 = EXPECT_CALL(a, DoA(4));
- ExpectationSet es2 = EXPECT_CALL(a, DoA(5));
- EXPECT_CALL(a, DoA(6))
- .After(e1, e2, e3, es1, es2);
-
- a.DoA(5);
- a.DoA(2);
- a.DoA(4);
- a.DoA(1);
- a.DoA(3);
- a.DoA(6);
-}
-
-// .After() allows input to contain duplicated Expectations.
-TEST(AfterTest, AcceptsDuplicatedInput) {
- MockA a;
- ON_CALL(a, ReturnResult(_))
- .WillByDefault(Return(Result()));
-
- // Define ordering:
- // DoA(1) ==>
- // DoA(2) ==> ReturnResult(3)
- Expectation e1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- ExpectationSet es;
- es += e1;
- es += e2;
- EXPECT_CALL(a, ReturnResult(3))
- .After(e1, e2, es, e1);
-
- a.DoA(1);
-
- // May only be after DoA(2).
- EXPECT_NONFATAL_FAILURE(a.ReturnResult(3), "Unexpected mock function call");
-
- a.DoA(2);
- a.ReturnResult(3);
-}
-
-// An Expectation added to an ExpectationSet after it has been used in
-// an .After() has no effect.
-TEST(AfterTest, ChangesToExpectationSetHaveNoEffectAfterwards) {
- MockA a;
- ExpectationSet es1 = EXPECT_CALL(a, DoA(1));
- Expectation e2 = EXPECT_CALL(a, DoA(2));
- EXPECT_CALL(a, DoA(3))
- .After(es1);
- es1 += e2;
-
- a.DoA(1);
- a.DoA(3);
- a.DoA(2);
-}
-
-// Tests that Google Mock correctly handles calls to mock functions
-// after a mock object owning one of their pre-requisites has died.
-
-// Tests that calls that satisfy the original spec are successful.
-TEST(DeletingMockEarlyTest, Success1) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber())
- .WillRepeatedly(Return(true));
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- EXPECT_EQ(1, b1->DoB(1));
- delete b1;
- // a's pre-requisite has died.
- EXPECT_TRUE(a->Binary(0, 1));
- delete b2;
- // a's successor has died.
- EXPECT_TRUE(a->Binary(1, 2));
- delete a;
-}
-
-// Tests that calls that satisfy the original spec are successful.
-TEST(DeletingMockEarlyTest, Success2) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- delete a; // a is trivially satisfied.
- EXPECT_EQ(1, b1->DoB(1));
- EXPECT_EQ(2, b2->DoB(2));
- delete b1;
- delete b2;
-}
-
-// Tests that it's OK to delete a mock object itself in its action.
-
-// Suppresses warning on unreferenced formal parameter in MSVC with
-// -W4.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-ACTION_P(Delete, ptr) { delete ptr; }
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-TEST(DeletingMockEarlyTest, CanDeleteSelfInActionReturningVoid) {
- MockA* const a = new MockA;
- EXPECT_CALL(*a, DoA(_)).WillOnce(Delete(a));
- a->DoA(42); // This will cause a to be deleted.
-}
-
-TEST(DeletingMockEarlyTest, CanDeleteSelfInActionReturningValue) {
- MockA* const a = new MockA;
- EXPECT_CALL(*a, ReturnResult(_))
- .WillOnce(DoAll(Delete(a), Return(Result())));
- a->ReturnResult(42); // This will cause a to be deleted.
-}
-
-// Tests that calls that violate the original spec yield failures.
-TEST(DeletingMockEarlyTest, Failure1) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_))
- .WillOnce(Return(1));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber())
- .WillRepeatedly(Return(2));
- }
-
- delete a; // a is trivially satisfied.
- EXPECT_NONFATAL_FAILURE({
- b2->DoB(2);
- }, "Unexpected mock function call");
- EXPECT_EQ(1, b1->DoB(1));
- delete b1;
- delete b2;
-}
-
-// Tests that calls that violate the original spec yield failures.
-TEST(DeletingMockEarlyTest, Failure2) {
- MockB* const b1 = new MockB;
- MockA* const a = new MockA;
- MockB* const b2 = new MockB;
-
- {
- InSequence dummy;
- EXPECT_CALL(*b1, DoB(_));
- EXPECT_CALL(*a, Binary(_, _))
- .Times(AnyNumber());
- EXPECT_CALL(*b2, DoB(_))
- .Times(AnyNumber());
- }
-
- EXPECT_NONFATAL_FAILURE(delete b1,
- "Actual: never called");
- EXPECT_NONFATAL_FAILURE(a->Binary(0, 1),
- "Unexpected mock function call");
- EXPECT_NONFATAL_FAILURE(b2->DoB(1),
- "Unexpected mock function call");
- delete a;
- delete b2;
-}
-
-class EvenNumberCardinality : public CardinalityInterface {
- public:
- // Returns true if and only if call_count calls will satisfy this
- // cardinality.
- bool IsSatisfiedByCallCount(int call_count) const override {
- return call_count % 2 == 0;
- }
-
- // Returns true if and only if call_count calls will saturate this
- // cardinality.
- bool IsSaturatedByCallCount(int /* call_count */) const override {
- return false;
- }
-
- // Describes self to an ostream.
- void DescribeTo(::std::ostream* os) const override {
- *os << "called even number of times";
- }
-};
-
-Cardinality EvenNumber() {
- return Cardinality(new EvenNumberCardinality);
-}
-
-TEST(ExpectationBaseTest,
- AllPrerequisitesAreSatisfiedWorksForNonMonotonicCardinality) {
- MockA* a = new MockA;
- Sequence s;
-
- EXPECT_CALL(*a, DoA(1))
- .Times(EvenNumber())
- .InSequence(s);
- EXPECT_CALL(*a, DoA(2))
- .Times(AnyNumber())
- .InSequence(s);
- EXPECT_CALL(*a, DoA(3))
- .Times(AnyNumber());
-
- a->DoA(3);
- a->DoA(1);
- EXPECT_NONFATAL_FAILURE(a->DoA(2), "Unexpected mock function call");
- EXPECT_NONFATAL_FAILURE(delete a, "to be called even number of times");
-}
-
-// The following tests verify the message generated when a mock
-// function is called.
-
-struct Printable {
-};
-
-inline void operator<<(::std::ostream& os, const Printable&) {
- os << "Printable";
-}
-
-struct Unprintable {
- Unprintable() : value(0) {}
- int value;
-};
-
-class MockC {
- public:
- MockC() {}
-
- MOCK_METHOD6(VoidMethod, void(bool cond, int n, std::string s, void* p,
- const Printable& x, Unprintable y));
- MOCK_METHOD0(NonVoidMethod, int()); // NOLINT
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockC);
-};
-
-class VerboseFlagPreservingFixture : public testing::Test {
- protected:
- VerboseFlagPreservingFixture()
- : saved_verbose_flag_(GMOCK_FLAG_GET(verbose)) {}
-
- ~VerboseFlagPreservingFixture() override {
- GMOCK_FLAG_SET(verbose, saved_verbose_flag_);
- }
-
- private:
- const std::string saved_verbose_flag_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(VerboseFlagPreservingFixture);
-};
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Tests that an uninteresting mock function call on a naggy mock
-// generates a warning without the stack trace when
-// --gmock_verbose=warning is specified.
-TEST(FunctionCallMessageTest,
- UninterestingCallOnNaggyMockGeneratesNoStackTraceWhenVerboseWarning) {
- GMOCK_FLAG_SET(verbose, kWarningVerbosity);
- NaggyMock<MockC> c;
- CaptureStdout();
- c.VoidMethod(false, 5, "Hi", nullptr, Printable(), Unprintable());
- const std::string output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", output);
- EXPECT_PRED_FORMAT2(IsNotSubstring, "Stack trace:", output);
-}
-
-// Tests that an uninteresting mock function call on a naggy mock
-// generates a warning containing the stack trace when
-// --gmock_verbose=info is specified.
-TEST(FunctionCallMessageTest,
- UninterestingCallOnNaggyMockGeneratesFyiWithStackTraceWhenVerboseInfo) {
- GMOCK_FLAG_SET(verbose, kInfoVerbosity);
- NaggyMock<MockC> c;
- CaptureStdout();
- c.VoidMethod(false, 5, "Hi", nullptr, Printable(), Unprintable());
- const std::string output = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "GMOCK WARNING", output);
- EXPECT_PRED_FORMAT2(IsSubstring, "Stack trace:", output);
-
-# ifndef NDEBUG
-
- // We check the stack trace content in dbg-mode only, as opt-mode
- // may inline the call we are interested in seeing.
-
- // Verifies that a void mock function's name appears in the stack
- // trace.
- EXPECT_PRED_FORMAT2(IsSubstring, "VoidMethod(", output);
-
- // Verifies that a non-void mock function's name appears in the
- // stack trace.
- CaptureStdout();
- c.NonVoidMethod();
- const std::string output2 = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(IsSubstring, "NonVoidMethod(", output2);
-
-# endif // NDEBUG
-}
-
-// Tests that an uninteresting mock function call on a naggy mock
-// causes the function arguments and return value to be printed.
-TEST(FunctionCallMessageTest,
- UninterestingCallOnNaggyMockPrintsArgumentsAndReturnValue) {
- // A non-void mock function.
- NaggyMock<MockB> b;
- CaptureStdout();
- b.DoB();
- const std::string output1 = GetCapturedStdout();
- EXPECT_PRED_FORMAT2(
- IsSubstring,
- "Uninteresting mock function call - returning default value.\n"
- " Function call: DoB()\n"
- " Returns: 0\n", output1.c_str());
- // Makes sure the return value is printed.
-
- // A void mock function.
- NaggyMock<MockC> c;
- CaptureStdout();
- c.VoidMethod(false, 5, "Hi", nullptr, Printable(), Unprintable());
- const std::string output2 = GetCapturedStdout();
- EXPECT_THAT(output2.c_str(),
- ContainsRegex(
- "Uninteresting mock function call - returning directly\\.\n"
- " Function call: VoidMethod"
- "\\(false, 5, \"Hi\", NULL, @.+ "
- "Printable, 4-byte object <00-00 00-00>\\)"));
- // A void function has no return value to print.
-}
-
-// Tests how the --gmock_verbose flag affects Google Mock's output.
-
-class GMockVerboseFlagTest : public VerboseFlagPreservingFixture {
- public:
- // Verifies that the given Google Mock output is correct. (When
- // should_print is true, the output should match the given regex and
- // contain the given function name in the stack trace. When it's
- // false, the output should be empty.)
- void VerifyOutput(const std::string& output, bool should_print,
- const std::string& expected_substring,
- const std::string& function_name) {
- if (should_print) {
- EXPECT_THAT(output.c_str(), HasSubstr(expected_substring));
-# ifndef NDEBUG
- // We check the stack trace content in dbg-mode only, as opt-mode
- // may inline the call we are interested in seeing.
- EXPECT_THAT(output.c_str(), HasSubstr(function_name));
-# else
- // Suppresses 'unused function parameter' warnings.
- static_cast<void>(function_name);
-# endif // NDEBUG
- } else {
- EXPECT_STREQ("", output.c_str());
- }
- }
-
- // Tests how the flag affects expected calls.
- void TestExpectedCall(bool should_print) {
- MockA a;
- EXPECT_CALL(a, DoA(5));
- EXPECT_CALL(a, Binary(_, 1))
- .WillOnce(Return(true));
-
- // A void-returning function.
- CaptureStdout();
- a.DoA(5);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "Mock function call matches EXPECT_CALL(a, DoA(5))...\n"
- " Function call: DoA(5)\n"
- "Stack trace:\n",
- "DoA");
-
- // A non-void-returning function.
- CaptureStdout();
- a.Binary(2, 1);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "Mock function call matches EXPECT_CALL(a, Binary(_, 1))...\n"
- " Function call: Binary(2, 1)\n"
- " Returns: true\n"
- "Stack trace:\n",
- "Binary");
- }
-
- // Tests how the flag affects uninteresting calls on a naggy mock.
- void TestUninterestingCallOnNaggyMock(bool should_print) {
- NaggyMock<MockA> a;
- const std::string note =
- "NOTE: You can safely ignore the above warning unless this "
- "call should not happen. Do not suppress it by blindly adding "
- "an EXPECT_CALL() if you don't mean to enforce the call. "
- "See "
- "https://github.com/google/googletest/blob/master/docs/"
- "gmock_cook_book.md#"
- "knowing-when-to-expect for details.";
-
- // A void-returning function.
- CaptureStdout();
- a.DoA(5);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "\nGMOCK WARNING:\n"
- "Uninteresting mock function call - returning directly.\n"
- " Function call: DoA(5)\n" +
- note,
- "DoA");
-
- // A non-void-returning function.
- CaptureStdout();
- a.Binary(2, 1);
- VerifyOutput(
- GetCapturedStdout(),
- should_print,
- "\nGMOCK WARNING:\n"
- "Uninteresting mock function call - returning default value.\n"
- " Function call: Binary(2, 1)\n"
- " Returns: false\n" +
- note,
- "Binary");
- }
-};
-
-// Tests that --gmock_verbose=info causes both expected and
-// uninteresting calls to be reported.
-TEST_F(GMockVerboseFlagTest, Info) {
- GMOCK_FLAG_SET(verbose, kInfoVerbosity);
- TestExpectedCall(true);
- TestUninterestingCallOnNaggyMock(true);
-}
-
-// Tests that --gmock_verbose=warning causes uninteresting calls to be
-// reported.
-TEST_F(GMockVerboseFlagTest, Warning) {
- GMOCK_FLAG_SET(verbose, kWarningVerbosity);
- TestExpectedCall(false);
- TestUninterestingCallOnNaggyMock(true);
-}
-
-// Tests that --gmock_verbose=warning causes neither expected nor
-// uninteresting calls to be reported.
-TEST_F(GMockVerboseFlagTest, Error) {
- GMOCK_FLAG_SET(verbose, kErrorVerbosity);
- TestExpectedCall(false);
- TestUninterestingCallOnNaggyMock(false);
-}
-
-// Tests that --gmock_verbose=SOME_INVALID_VALUE has the same effect
-// as --gmock_verbose=warning.
-TEST_F(GMockVerboseFlagTest, InvalidFlagIsTreatedAsWarning) {
- GMOCK_FLAG_SET(verbose, "invalid"); // Treated as "warning".
- TestExpectedCall(false);
- TestUninterestingCallOnNaggyMock(true);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// A helper class that generates a failure when printed. We use it to
-// ensure that Google Mock doesn't print a value (even to an internal
-// buffer) when it is not supposed to do so.
-class PrintMeNot {};
-
-void PrintTo(PrintMeNot /* dummy */, ::std::ostream* /* os */) {
- ADD_FAILURE() << "Google Mock is printing a value that shouldn't be "
- << "printed even to an internal buffer.";
-}
-
-class LogTestHelper {
- public:
- LogTestHelper() {}
-
- MOCK_METHOD1(Foo, PrintMeNot(PrintMeNot));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(LogTestHelper);
-};
-
-class GMockLogTest : public VerboseFlagPreservingFixture {
- protected:
- LogTestHelper helper_;
-};
-
-TEST_F(GMockLogTest, DoesNotPrintGoodCallInternallyIfVerbosityIsWarning) {
- GMOCK_FLAG_SET(verbose, kWarningVerbosity);
- EXPECT_CALL(helper_, Foo(_))
- .WillOnce(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This is an expected call.
-}
-
-TEST_F(GMockLogTest, DoesNotPrintGoodCallInternallyIfVerbosityIsError) {
- GMOCK_FLAG_SET(verbose, kErrorVerbosity);
- EXPECT_CALL(helper_, Foo(_))
- .WillOnce(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This is an expected call.
-}
-
-TEST_F(GMockLogTest, DoesNotPrintWarningInternallyIfVerbosityIsError) {
- GMOCK_FLAG_SET(verbose, kErrorVerbosity);
- ON_CALL(helper_, Foo(_))
- .WillByDefault(Return(PrintMeNot()));
- helper_.Foo(PrintMeNot()); // This should generate a warning.
-}
-
-// Tests Mock::AllowLeak().
-
-TEST(AllowLeakTest, AllowsLeakingUnusedMockObject) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, CanBeCalledBeforeOnCall) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- a->DoA(0);
-}
-
-TEST(AllowLeakTest, CanBeCalledAfterOnCall) {
- MockA* a = new MockA;
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, CanBeCalledBeforeExpectCall) {
- MockA* a = new MockA;
- Mock::AllowLeak(a);
- EXPECT_CALL(*a, DoA(_));
- a->DoA(0);
-}
-
-TEST(AllowLeakTest, CanBeCalledAfterExpectCall) {
- MockA* a = new MockA;
- EXPECT_CALL(*a, DoA(_)).Times(AnyNumber());
- Mock::AllowLeak(a);
-}
-
-TEST(AllowLeakTest, WorksWhenBothOnCallAndExpectCallArePresent) {
- MockA* a = new MockA;
- ON_CALL(*a, DoA(_)).WillByDefault(Return());
- EXPECT_CALL(*a, DoA(_)).Times(AnyNumber());
- Mock::AllowLeak(a);
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when none of its methods has expectations.
-TEST(VerifyAndClearExpectationsTest, NoMethodHasExpectations) {
- MockB b;
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when some, but not all, of its methods have expectations *and* the
-// verification succeeds.
-TEST(VerifyAndClearExpectationsTest, SomeMethodsHaveExpectationsAndSucceed) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- b.DoB();
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when some, but not all, of its methods have expectations *and* the
-// verification fails.
-TEST(VerifyAndClearExpectationsTest, SomeMethodsHaveExpectationsAndFail) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClearExpectations(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when all of its methods have expectations.
-TEST(VerifyAndClearExpectationsTest, AllMethodsHaveExpectations) {
- MockB b;
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB();
- b.DoB(1);
- ASSERT_TRUE(Mock::VerifyAndClearExpectations(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can verify and clear a mock object's expectations
-// when a method has more than one expectation.
-TEST(VerifyAndClearExpectationsTest, AMethodHasManyExpectations) {
- MockB b;
- EXPECT_CALL(b, DoB(0))
- .WillOnce(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB(1);
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClearExpectations(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can call VerifyAndClearExpectations() on the same
-// mock object multiple times.
-TEST(VerifyAndClearExpectationsTest, CanCallManyTimes) {
- MockB b;
- EXPECT_CALL(b, DoB());
- b.DoB();
- Mock::VerifyAndClearExpectations(&b);
-
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(1));
- b.DoB(1);
- Mock::VerifyAndClearExpectations(&b);
- Mock::VerifyAndClearExpectations(&b);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can clear a mock object's default actions when none
-// of its methods has default actions.
-TEST(VerifyAndClearTest, NoMethodHasDefaultActions) {
- MockB b;
- // If this crashes or generates a failure, the test will catch it.
- Mock::VerifyAndClear(&b);
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that we can clear a mock object's default actions when some,
-// but not all of its methods have default actions.
-TEST(VerifyAndClearTest, SomeMethodsHaveDefaultActions) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default action of int DoB() was removed.
- EXPECT_EQ(0, b.DoB());
-}
-
-// Tests that we can clear a mock object's default actions when all of
-// its methods have default actions.
-TEST(VerifyAndClearTest, AllMethodsHaveDefaultActions) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(2));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default action of int DoB() was removed.
- EXPECT_EQ(0, b.DoB());
-
- // Verifies that the default action of int DoB(int) was removed.
- EXPECT_EQ(0, b.DoB(0));
-}
-
-// Tests that we can clear a mock object's default actions when a
-// method has more than one ON_CALL() set on it.
-TEST(VerifyAndClearTest, AMethodHasManyDefaultActions) {
- MockB b;
- ON_CALL(b, DoB(0))
- .WillByDefault(Return(1));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(2));
-
- Mock::VerifyAndClear(&b);
-
- // Verifies that the default actions (there are two) of int DoB(int)
- // were removed.
- EXPECT_EQ(0, b.DoB(0));
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can call VerifyAndClear() on a mock object multiple
-// times.
-TEST(VerifyAndClearTest, CanCallManyTimes) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- Mock::VerifyAndClear(&b);
- Mock::VerifyAndClear(&b);
-
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(1));
- Mock::VerifyAndClear(&b);
-
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the verification succeeds.
-TEST(VerifyAndClearTest, Success) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(1))
- .WillOnce(Return(2));
-
- b.DoB();
- b.DoB(1);
- ASSERT_TRUE(Mock::VerifyAndClear(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the verification fails.
-TEST(VerifyAndClearTest, Failure) {
- MockB b;
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(2));
-
- b.DoB(1);
- bool result = true;
- EXPECT_NONFATAL_FAILURE(result = Mock::VerifyAndClear(&b),
- "Actual: never called");
- ASSERT_FALSE(result);
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that VerifyAndClear() works when the default actions and
-// expectations are set on a const mock object.
-TEST(VerifyAndClearTest, Const) {
- MockB b;
- ON_CALL(Const(b), DoB())
- .WillByDefault(Return(1));
-
- EXPECT_CALL(Const(b), DoB())
- .WillOnce(DoDefault())
- .WillOnce(Return(2));
-
- b.DoB();
- b.DoB();
- ASSERT_TRUE(Mock::VerifyAndClear(&b));
-
- // There should be no expectations on the methods now, so we can
- // freely call them.
- EXPECT_EQ(0, b.DoB());
- EXPECT_EQ(0, b.DoB(1));
-}
-
-// Tests that we can set default actions and expectations on a mock
-// object after VerifyAndClear() has been called on it.
-TEST(VerifyAndClearTest, CanSetDefaultActionsAndExpectationsAfterwards) {
- MockB b;
- ON_CALL(b, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b, DoB(_))
- .WillOnce(Return(2));
- b.DoB(1);
-
- Mock::VerifyAndClear(&b);
-
- EXPECT_CALL(b, DoB())
- .WillOnce(Return(3));
- ON_CALL(b, DoB(_))
- .WillByDefault(Return(4));
-
- EXPECT_EQ(3, b.DoB());
- EXPECT_EQ(4, b.DoB(1));
-}
-
-// Tests that calling VerifyAndClear() on one mock object does not
-// affect other mock objects (either of the same type or not).
-TEST(VerifyAndClearTest, DoesNotAffectOtherMockObjects) {
- MockA a;
- MockB b1;
- MockB b2;
-
- ON_CALL(a, Binary(_, _))
- .WillByDefault(Return(true));
- EXPECT_CALL(a, Binary(_, _))
- .WillOnce(DoDefault())
- .WillOnce(Return(false));
-
- ON_CALL(b1, DoB())
- .WillByDefault(Return(1));
- EXPECT_CALL(b1, DoB(_))
- .WillOnce(Return(2));
-
- ON_CALL(b2, DoB())
- .WillByDefault(Return(3));
- EXPECT_CALL(b2, DoB(_));
-
- b2.DoB(0);
- Mock::VerifyAndClear(&b2);
-
- // Verifies that the default actions and expectations of a and b1
- // are still in effect.
- EXPECT_TRUE(a.Binary(0, 0));
- EXPECT_FALSE(a.Binary(0, 0));
-
- EXPECT_EQ(1, b1.DoB());
- EXPECT_EQ(2, b1.DoB(0));
-}
-
-TEST(VerifyAndClearTest,
- DestroyingChainedMocksDoesNotDeadlockThroughExpectations) {
- std::shared_ptr<MockA> a(new MockA);
- ReferenceHoldingMock test_mock;
-
- // EXPECT_CALL stores a reference to a inside test_mock.
- EXPECT_CALL(test_mock, AcceptReference(_))
- .WillRepeatedly(SetArgPointee<0>(a));
-
- // Throw away the reference to the mock that we have in a. After this, the
- // only reference to it is stored by test_mock.
- a.reset();
-
- // When test_mock goes out of scope, it destroys the last remaining reference
- // to the mock object originally pointed to by a. This will cause the MockA
- // destructor to be called from inside the ReferenceHoldingMock destructor.
- // The state of all mocks is protected by a single global lock, but there
- // should be no deadlock.
-}
-
-TEST(VerifyAndClearTest,
- DestroyingChainedMocksDoesNotDeadlockThroughDefaultAction) {
- std::shared_ptr<MockA> a(new MockA);
- ReferenceHoldingMock test_mock;
-
- // ON_CALL stores a reference to a inside test_mock.
- ON_CALL(test_mock, AcceptReference(_))
- .WillByDefault(SetArgPointee<0>(a));
-
- // Throw away the reference to the mock that we have in a. After this, the
- // only reference to it is stored by test_mock.
- a.reset();
-
- // When test_mock goes out of scope, it destroys the last remaining reference
- // to the mock object originally pointed to by a. This will cause the MockA
- // destructor to be called from inside the ReferenceHoldingMock destructor.
- // The state of all mocks is protected by a single global lock, but there
- // should be no deadlock.
-}
-
-// Tests that a mock function's action can call a mock function
-// (either the same function or a different one) either as an explicit
-// action or as a default action without causing a dead lock. It
-// verifies that the action is not performed inside the critical
-// section.
-TEST(SynchronizationTest, CanCallMockMethodInAction) {
- MockA a;
- MockC c;
- ON_CALL(a, DoA(_))
- .WillByDefault(IgnoreResult(InvokeWithoutArgs(&c,
- &MockC::NonVoidMethod)));
- EXPECT_CALL(a, DoA(1));
- EXPECT_CALL(a, DoA(1))
- .WillOnce(Invoke(&a, &MockA::DoA))
- .RetiresOnSaturation();
- EXPECT_CALL(c, NonVoidMethod());
-
- a.DoA(1);
- // This will match the second EXPECT_CALL() and trigger another a.DoA(1),
- // which will in turn match the first EXPECT_CALL() and trigger a call to
- // c.NonVoidMethod() that was specified by the ON_CALL() since the first
- // EXPECT_CALL() did not specify an action.
-}
-
-TEST(ParameterlessExpectationsTest, CanSetExpectationsWithoutMatchers) {
- MockA a;
- int do_a_arg0 = 0;
- ON_CALL(a, DoA).WillByDefault(SaveArg<0>(&do_a_arg0));
- int do_a_47_arg0 = 0;
- ON_CALL(a, DoA(47)).WillByDefault(SaveArg<0>(&do_a_47_arg0));
-
- a.DoA(17);
- EXPECT_THAT(do_a_arg0, 17);
- EXPECT_THAT(do_a_47_arg0, 0);
- a.DoA(47);
- EXPECT_THAT(do_a_arg0, 17);
- EXPECT_THAT(do_a_47_arg0, 47);
-
- ON_CALL(a, Binary).WillByDefault(Return(true));
- ON_CALL(a, Binary(_, 14)).WillByDefault(Return(false));
- EXPECT_THAT(a.Binary(14, 17), true);
- EXPECT_THAT(a.Binary(17, 14), false);
-}
-
-TEST(ParameterlessExpectationsTest, CanSetExpectationsForOverloadedMethods) {
- MockB b;
- ON_CALL(b, DoB()).WillByDefault(Return(9));
- ON_CALL(b, DoB(5)).WillByDefault(Return(11));
-
- EXPECT_THAT(b.DoB(), 9);
- EXPECT_THAT(b.DoB(1), 0); // default value
- EXPECT_THAT(b.DoB(5), 11);
-}
-
-struct MockWithConstMethods {
- public:
- MOCK_CONST_METHOD1(Foo, int(int));
- MOCK_CONST_METHOD2(Bar, int(int, const char*));
-};
-
-TEST(ParameterlessExpectationsTest, CanSetExpectationsForConstMethods) {
- MockWithConstMethods mock;
- ON_CALL(mock, Foo).WillByDefault(Return(7));
- ON_CALL(mock, Bar).WillByDefault(Return(33));
-
- EXPECT_THAT(mock.Foo(17), 7);
- EXPECT_THAT(mock.Bar(27, "purple"), 33);
-}
-
-class MockConstOverload {
- public:
- MOCK_METHOD1(Overloaded, int(int));
- MOCK_CONST_METHOD1(Overloaded, int(int));
-};
-
-TEST(ParameterlessExpectationsTest,
- CanSetExpectationsForConstOverloadedMethods) {
- MockConstOverload mock;
- ON_CALL(mock, Overloaded(_)).WillByDefault(Return(7));
- ON_CALL(mock, Overloaded(5)).WillByDefault(Return(9));
- ON_CALL(Const(mock), Overloaded(5)).WillByDefault(Return(11));
- ON_CALL(Const(mock), Overloaded(7)).WillByDefault(Return(13));
-
- EXPECT_THAT(mock.Overloaded(1), 7);
- EXPECT_THAT(mock.Overloaded(5), 9);
- EXPECT_THAT(mock.Overloaded(7), 7);
-
- const MockConstOverload& const_mock = mock;
- EXPECT_THAT(const_mock.Overloaded(1), 0);
- EXPECT_THAT(const_mock.Overloaded(5), 11);
- EXPECT_THAT(const_mock.Overloaded(7), 13);
-}
-
-} // namespace
-
-// Allows the user to define their own main and then invoke gmock_main
-// from it. This might be necessary on some platforms which require
-// specific setup and teardown.
-#if GMOCK_RENAME_MAIN
-int gmock_main(int argc, char **argv) {
-#else
-int main(int argc, char **argv) {
-#endif // GMOCK_RENAME_MAIN
- testing::InitGoogleMock(&argc, argv);
- // Ensures that the tests pass no matter what value of
- // --gmock_catch_leaked_mocks and --gmock_verbose the user specifies.
- GMOCK_FLAG_SET(catch_leaked_mocks, true);
- GMOCK_FLAG_SET(verbose, testing::internal::kWarningVerbosity);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_all_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_all_test.cc
deleted file mode 100644
index fffbb8b66f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_all_test.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google C++ Mocking Framework (Google Mock)
-//
-// Some users use a build system that Google Mock doesn't support directly,
-// yet they still want to build and run Google Mock's own tests. This file
-// includes most such tests, making it easier for these users to maintain
-// their build scripts (they just need to build this file, even though the
-// below list of actual *_test.cc files might change).
-#include "test/gmock-actions_test.cc"
-#include "test/gmock-cardinalities_test.cc"
-#include "test/gmock-internal-utils_test.cc"
-#include "test/gmock-matchers_test.cc"
-#include "test/gmock-more-actions_test.cc"
-#include "test/gmock-nice-strict_test.cc"
-#include "test/gmock-port_test.cc"
-#include "test/gmock-spec-builders_test.cc"
-#include "test/gmock_test.cc"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_ex_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_ex_test.cc
deleted file mode 100644
index 72eb43f74e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_ex_test.cc
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests Google Mock's functionality that depends on exceptions.
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_EXCEPTIONS
-namespace {
-
-using testing::HasSubstr;
-
-using testing::internal::GoogleTestFailureException;
-
-// A type that cannot be default constructed.
-class NonDefaultConstructible {
- public:
- explicit NonDefaultConstructible(int /* dummy */) {}
-};
-
-class MockFoo {
- public:
- // A mock method that returns a user-defined type. Google Mock
- // doesn't know what the default value for this type is.
- MOCK_METHOD0(GetNonDefaultConstructible, NonDefaultConstructible());
-};
-
-TEST(DefaultValueTest, ThrowsRuntimeErrorWhenNoDefaultValue) {
- MockFoo mock;
- try {
- // No expectation is set on this method, so Google Mock must
- // return the default value. However, since Google Mock knows
- // nothing about the return type, it doesn't know what to return,
- // and has to throw (when exceptions are enabled) or abort
- // (otherwise).
- mock.GetNonDefaultConstructible();
- FAIL() << "GetNonDefaultConstructible()'s return type has no default "
- << "value, so Google Mock should have thrown.";
- } catch (const GoogleTestFailureException& /* unused */) {
- FAIL() << "Google Test does not try to catch an exception of type "
- << "GoogleTestFailureException, which is used for reporting "
- << "a failure to other testing frameworks. Google Mock should "
- << "not throw a GoogleTestFailureException as it will kill the "
- << "entire test program instead of just the current TEST.";
- } catch (const std::exception& ex) {
- EXPECT_THAT(ex.what(), HasSubstr("has no default value"));
- }
-}
-
-
-} // unnamed namespace
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test.py
deleted file mode 100755
index 4f41c7bbd0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests that leaked mock objects can be caught be Google Mock."""
-
-from googlemock.test import gmock_test_utils
-
-PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_leak_test_')
-TEST_WITH_EXPECT_CALL = [PROGRAM_PATH, '--gtest_filter=*ExpectCall*']
-TEST_WITH_ON_CALL = [PROGRAM_PATH, '--gtest_filter=*OnCall*']
-TEST_MULTIPLE_LEAKS = [PROGRAM_PATH, '--gtest_filter=*MultipleLeaked*']
-
-environ = gmock_test_utils.environ
-SetEnvVar = gmock_test_utils.SetEnvVar
-
-# Tests in this file run a Google-Test-based test program and expect it
-# to terminate prematurely. Therefore they are incompatible with
-# the premature-exit-file protocol by design. Unset the
-# premature-exit filepath to prevent Google Test from creating
-# the file.
-SetEnvVar(gmock_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None)
-
-
-class GMockLeakTest(gmock_test_utils.TestCase):
-
- def testCatchesLeakedMockByDefault(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL,
- env=environ).exit_code)
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL,
- env=environ).exit_code)
-
- def testDoesNotCatchLeakedMockWhenDisabled(self):
- self.assertEquals(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks=0'],
- env=environ).exit_code)
- self.assertEquals(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
- ['--gmock_catch_leaked_mocks=0'],
- env=environ).exit_code)
-
- def testCatchesLeakedMockWhenEnabled(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks'],
- env=environ).exit_code)
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_ON_CALL +
- ['--gmock_catch_leaked_mocks'],
- env=environ).exit_code)
-
- def testCatchesLeakedMockWhenEnabledWithExplictFlagValue(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_WITH_EXPECT_CALL +
- ['--gmock_catch_leaked_mocks=1'],
- env=environ).exit_code)
-
- def testCatchesMultipleLeakedMocks(self):
- self.assertNotEqual(
- 0,
- gmock_test_utils.Subprocess(TEST_MULTIPLE_LEAKS +
- ['--gmock_catch_leaked_mocks'],
- env=environ).exit_code)
-
-
-if __name__ == '__main__':
- gmock_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test_.cc
deleted file mode 100644
index 2e095abcf4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_leak_test_.cc
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This program is for verifying that a leaked mock object can be
-// caught by Google Mock's leak detector.
-
-#include "gmock/gmock.h"
-
-namespace {
-
-using ::testing::Return;
-
-class FooInterface {
- public:
- virtual ~FooInterface() {}
- virtual void DoThis() = 0;
-};
-
-class MockFoo : public FooInterface {
- public:
- MockFoo() {}
-
- MOCK_METHOD0(DoThis, void());
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-TEST(LeakTest, LeakedMockWithExpectCallCausesFailureWhenLeakCheckingIsEnabled) {
- MockFoo* foo = new MockFoo;
-
- EXPECT_CALL(*foo, DoThis());
- foo->DoThis();
-
- // In order to test the leak detector, we deliberately leak foo.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-TEST(LeakTest, LeakedMockWithOnCallCausesFailureWhenLeakCheckingIsEnabled) {
- MockFoo* foo = new MockFoo;
-
- ON_CALL(*foo, DoThis()).WillByDefault(Return());
-
- // In order to test the leak detector, we deliberately leak foo.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-TEST(LeakTest, CatchesMultipleLeakedMockObjects) {
- MockFoo* foo1 = new MockFoo;
- MockFoo* foo2 = new MockFoo;
-
- ON_CALL(*foo1, DoThis()).WillByDefault(Return());
- EXPECT_CALL(*foo2, DoThis());
- foo2->DoThis();
-
- // In order to test the leak detector, we deliberately leak foo1 and
- // foo2.
-
- // Makes sure Google Mock's leak detector can change the exit code
- // to 1 even when the code is already exiting with 0.
- exit(0);
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link2_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link2_test.cc
deleted file mode 100644
index d27ce17688..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link2_test.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file is for verifying that various Google Mock constructs do not
-// produce linker errors when instantiated in different translation units.
-// Please see gmock_link_test.h for details.
-
-#define LinkTest LinkTest2
-
-#include "test/gmock_link_test.h"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.cc
deleted file mode 100644
index e7c54cc230..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.cc
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file is for verifying that various Google Mock constructs do not
-// produce linker errors when instantiated in different translation units.
-// Please see gmock_link_test.h for details.
-
-#define LinkTest LinkTest1
-
-#include "test/gmock_link_test.h"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.h
deleted file mode 100644
index 5734b2e11c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_link_test.h
+++ /dev/null
@@ -1,690 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests that:
-// a. A header file defining a mock class can be included in multiple
-// translation units without causing a link error.
-// b. Actions and matchers can be instantiated with identical template
-// arguments in different translation units without causing link
-// errors.
-// The following constructs are currently tested:
-// Actions:
-// Return()
-// Return(value)
-// ReturnNull
-// ReturnRef
-// Assign
-// SetArgPointee
-// SetArrayArgument
-// SetErrnoAndReturn
-// Invoke(function)
-// Invoke(object, method)
-// InvokeWithoutArgs(function)
-// InvokeWithoutArgs(object, method)
-// InvokeArgument
-// WithArg
-// WithArgs
-// WithoutArgs
-// DoAll
-// DoDefault
-// IgnoreResult
-// Throw
-// ACTION()-generated
-// ACTION_P()-generated
-// ACTION_P2()-generated
-// Matchers:
-// _
-// A
-// An
-// Eq
-// Gt, Lt, Ge, Le, Ne
-// NotNull
-// Ref
-// TypedEq
-// DoubleEq
-// FloatEq
-// NanSensitiveDoubleEq
-// NanSensitiveFloatEq
-// ContainsRegex
-// MatchesRegex
-// EndsWith
-// HasSubstr
-// StartsWith
-// StrCaseEq
-// StrCaseNe
-// StrEq
-// StrNe
-// ElementsAre
-// ElementsAreArray
-// ContainerEq
-// Field
-// Property
-// ResultOf(function)
-// ResultOf(callback)
-// Pointee
-// Truly(predicate)
-// AddressSatisfies
-// AllOf
-// AnyOf
-// Not
-// MatcherCast<T>
-//
-// Please note: this test does not verify the functioning of these
-// constructs, only that the programs using them will link successfully.
-//
-// Implementation note:
-// This test requires identical definitions of Interface and Mock to be
-// included in different translation units. We achieve this by writing
-// them in this header and #including it in gmock_link_test.cc and
-// gmock_link2_test.cc. Because the symbols generated by the compiler for
-// those constructs must be identical in both translation units,
-// definitions of Interface and Mock tests MUST be kept in the SAME
-// NON-ANONYMOUS namespace in this file. The test fixture class LinkTest
-// is defined as LinkTest1 in gmock_link_test.cc and as LinkTest2 in
-// gmock_link2_test.cc to avoid producing linker errors.
-
-#ifndef GOOGLEMOCK_TEST_GMOCK_LINK_TEST_H_
-#define GOOGLEMOCK_TEST_GMOCK_LINK_TEST_H_
-
-#include "gmock/gmock.h"
-
-#if !GTEST_OS_WINDOWS_MOBILE
-# include <errno.h>
-#endif
-
-#include <iostream>
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "gtest/internal/gtest-port.h"
-
-using testing::_;
-using testing::A;
-using testing::Action;
-using testing::AllOf;
-using testing::AnyOf;
-using testing::Assign;
-using testing::ContainerEq;
-using testing::DoAll;
-using testing::DoDefault;
-using testing::DoubleEq;
-using testing::ElementsAre;
-using testing::ElementsAreArray;
-using testing::EndsWith;
-using testing::Eq;
-using testing::Field;
-using testing::FloatEq;
-using testing::Ge;
-using testing::Gt;
-using testing::HasSubstr;
-using testing::IgnoreResult;
-using testing::Invoke;
-using testing::InvokeArgument;
-using testing::InvokeWithoutArgs;
-using testing::IsNull;
-using testing::IsSubsetOf;
-using testing::IsSupersetOf;
-using testing::Le;
-using testing::Lt;
-using testing::Matcher;
-using testing::MatcherCast;
-using testing::NanSensitiveDoubleEq;
-using testing::NanSensitiveFloatEq;
-using testing::Ne;
-using testing::Not;
-using testing::NotNull;
-using testing::Pointee;
-using testing::Property;
-using testing::Ref;
-using testing::ResultOf;
-using testing::Return;
-using testing::ReturnNull;
-using testing::ReturnRef;
-using testing::SetArgPointee;
-using testing::SetArrayArgument;
-using testing::StartsWith;
-using testing::StrCaseEq;
-using testing::StrCaseNe;
-using testing::StrEq;
-using testing::StrNe;
-using testing::Truly;
-using testing::TypedEq;
-using testing::WithArg;
-using testing::WithArgs;
-using testing::WithoutArgs;
-
-#if !GTEST_OS_WINDOWS_MOBILE
-using testing::SetErrnoAndReturn;
-#endif
-
-#if GTEST_HAS_EXCEPTIONS
-using testing::Throw;
-#endif
-
-using testing::ContainsRegex;
-using testing::MatchesRegex;
-
-class Interface {
- public:
- virtual ~Interface() {}
- virtual void VoidFromString(char* str) = 0;
- virtual char* StringFromString(char* str) = 0;
- virtual int IntFromString(char* str) = 0;
- virtual int& IntRefFromString(char* str) = 0;
- virtual void VoidFromFunc(void(*func)(char* str)) = 0;
- virtual void VoidFromIntRef(int& n) = 0; // NOLINT
- virtual void VoidFromFloat(float n) = 0;
- virtual void VoidFromDouble(double n) = 0;
- virtual void VoidFromVector(const std::vector<int>& v) = 0;
-};
-
-class Mock: public Interface {
- public:
- Mock() {}
-
- MOCK_METHOD1(VoidFromString, void(char* str));
- MOCK_METHOD1(StringFromString, char*(char* str));
- MOCK_METHOD1(IntFromString, int(char* str));
- MOCK_METHOD1(IntRefFromString, int&(char* str));
- MOCK_METHOD1(VoidFromFunc, void(void(*func)(char* str)));
- MOCK_METHOD1(VoidFromIntRef, void(int& n)); // NOLINT
- MOCK_METHOD1(VoidFromFloat, void(float n));
- MOCK_METHOD1(VoidFromDouble, void(double n));
- MOCK_METHOD1(VoidFromVector, void(const std::vector<int>& v));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mock);
-};
-
-class InvokeHelper {
- public:
- static void StaticVoidFromVoid() {}
- void VoidFromVoid() {}
- static void StaticVoidFromString(char* /* str */) {}
- void VoidFromString(char* /* str */) {}
- static int StaticIntFromString(char* /* str */) { return 1; }
- static bool StaticBoolFromString(const char* /* str */) { return true; }
-};
-
-class FieldHelper {
- public:
- explicit FieldHelper(int a_field) : field_(a_field) {}
- int field() const { return field_; }
- int field_; // NOLINT -- need external access to field_ to test
- // the Field matcher.
-};
-
-// Tests the linkage of the ReturnVoid action.
-TEST(LinkTest, TestReturnVoid) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the Return action.
-TEST(LinkTest, TestReturn) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, StringFromString(_)).WillOnce(Return(&ch));
- mock.StringFromString(nullptr);
-}
-
-// Tests the linkage of the ReturnNull action.
-TEST(LinkTest, TestReturnNull) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Return());
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the ReturnRef action.
-TEST(LinkTest, TestReturnRef) {
- Mock mock;
- int n = 42;
-
- EXPECT_CALL(mock, IntRefFromString(_)).WillOnce(ReturnRef(n));
- mock.IntRefFromString(nullptr);
-}
-
-// Tests the linkage of the Assign action.
-TEST(LinkTest, TestAssign) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Assign(&ch, 'y'));
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the SetArgPointee action.
-TEST(LinkTest, TestSetArgPointee) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArgPointee<0>('y'));
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the SetArrayArgument action.
-TEST(LinkTest, TestSetArrayArgument) {
- Mock mock;
- char ch = 'x';
- char ch2 = 'y';
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(SetArrayArgument<0>(&ch2,
- &ch2 + 1));
- mock.VoidFromString(&ch);
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-// Tests the linkage of the SetErrnoAndReturn action.
-TEST(LinkTest, TestSetErrnoAndReturn) {
- Mock mock;
-
- int saved_errno = errno;
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(SetErrnoAndReturn(1, -1));
- mock.IntFromString(nullptr);
- errno = saved_errno;
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests the linkage of the Invoke(function) and Invoke(object, method) actions.
-TEST(LinkTest, TestInvoke) {
- Mock mock;
- InvokeHelper test_invoke_helper;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(Invoke(&InvokeHelper::StaticVoidFromString))
- .WillOnce(Invoke(&test_invoke_helper, &InvokeHelper::VoidFromString));
- mock.VoidFromString(nullptr);
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the InvokeWithoutArgs action.
-TEST(LinkTest, TestInvokeWithoutArgs) {
- Mock mock;
- InvokeHelper test_invoke_helper;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(InvokeWithoutArgs(&InvokeHelper::StaticVoidFromVoid))
- .WillOnce(InvokeWithoutArgs(&test_invoke_helper,
- &InvokeHelper::VoidFromVoid));
- mock.VoidFromString(nullptr);
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the InvokeArgument action.
-TEST(LinkTest, TestInvokeArgument) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromFunc(_)).WillOnce(InvokeArgument<0>(&ch));
- mock.VoidFromFunc(InvokeHelper::StaticVoidFromString);
-}
-
-// Tests the linkage of the WithArg action.
-TEST(LinkTest, TestWithArg) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(WithArg<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the WithArgs action.
-TEST(LinkTest, TestWithArgs) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(WithArgs<0>(Invoke(&InvokeHelper::StaticVoidFromString)));
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the WithoutArgs action.
-TEST(LinkTest, TestWithoutArgs) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(WithoutArgs(Return()));
- mock.VoidFromString(nullptr);
-}
-
-// Tests the linkage of the DoAll action.
-TEST(LinkTest, TestDoAll) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, VoidFromString(_))
- .WillOnce(DoAll(SetArgPointee<0>('y'), Return()));
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the DoDefault action.
-TEST(LinkTest, TestDoDefault) {
- Mock mock;
- char ch = 'x';
-
- ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(DoDefault());
- mock.VoidFromString(&ch);
-}
-
-// Tests the linkage of the IgnoreResult action.
-TEST(LinkTest, TestIgnoreResult) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(IgnoreResult(Return(42)));
- mock.VoidFromString(nullptr);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-// Tests the linkage of the Throw action.
-TEST(LinkTest, TestThrow) {
- Mock mock;
-
- EXPECT_CALL(mock, VoidFromString(_)).WillOnce(Throw(42));
- EXPECT_THROW(mock.VoidFromString(nullptr), int);
-}
-#endif // GTEST_HAS_EXCEPTIONS
-
-// The ACTION*() macros trigger warning C4100 (unreferenced formal
-// parameter) in MSVC with -W4. Unfortunately they cannot be fixed in
-// the macro definition, as the warnings are generated when the macro
-// is expanded and macro expansion cannot contain #pragma. Therefore
-// we suppress them here.
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-// Tests the linkage of actions created using ACTION macro.
-namespace {
-ACTION(Return1) { return 1; }
-}
-
-TEST(LinkTest, TestActionMacro) {
- Mock mock;
-
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(Return1());
- mock.IntFromString(nullptr);
-}
-
-// Tests the linkage of actions created using ACTION_P macro.
-namespace {
-ACTION_P(ReturnArgument, ret_value) { return ret_value; }
-}
-
-TEST(LinkTest, TestActionPMacro) {
- Mock mock;
-
- EXPECT_CALL(mock, IntFromString(_)).WillOnce(ReturnArgument(42));
- mock.IntFromString(nullptr);
-}
-
-// Tests the linkage of actions created using ACTION_P2 macro.
-namespace {
-ACTION_P2(ReturnEqualsEitherOf, first, second) {
- return arg0 == first || arg0 == second;
-}
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-TEST(LinkTest, TestActionP2Macro) {
- Mock mock;
- char ch = 'x';
-
- EXPECT_CALL(mock, IntFromString(_))
- .WillOnce(ReturnEqualsEitherOf("one", "two"));
- mock.IntFromString(&ch);
-}
-
-// Tests the linkage of the "_" matcher.
-TEST(LinkTest, TestMatcherAnything) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(_)).WillByDefault(Return());
-}
-
-// Tests the linkage of the A matcher.
-TEST(LinkTest, TestMatcherA) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(A<char*>())).WillByDefault(Return());
-}
-
-// Tests the linkage of the Eq and the "bare value" matcher.
-TEST(LinkTest, TestMatchersEq) {
- Mock mock;
- const char* p = "x";
-
- ON_CALL(mock, VoidFromString(Eq(p))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(const_cast<char*>("y")))
- .WillByDefault(Return());
-}
-
-// Tests the linkage of the Lt, Gt, Le, Ge, and Ne matchers.
-TEST(LinkTest, TestMatchersRelations) {
- Mock mock;
-
- ON_CALL(mock, VoidFromFloat(Lt(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Gt(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Le(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Ge(1.0f))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(Ne(1.0f))).WillByDefault(Return());
-}
-
-// Tests the linkage of the NotNull matcher.
-TEST(LinkTest, TestMatcherNotNull) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(NotNull())).WillByDefault(Return());
-}
-
-// Tests the linkage of the IsNull matcher.
-TEST(LinkTest, TestMatcherIsNull) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(IsNull())).WillByDefault(Return());
-}
-
-// Tests the linkage of the Ref matcher.
-TEST(LinkTest, TestMatcherRef) {
- Mock mock;
- int a = 0;
-
- ON_CALL(mock, VoidFromIntRef(Ref(a))).WillByDefault(Return());
-}
-
-// Tests the linkage of the TypedEq matcher.
-TEST(LinkTest, TestMatcherTypedEq) {
- Mock mock;
- long a = 0;
-
- ON_CALL(mock, VoidFromIntRef(TypedEq<int&>(a))).WillByDefault(Return());
-}
-
-// Tests the linkage of the FloatEq, DoubleEq, NanSensitiveFloatEq and
-// NanSensitiveDoubleEq matchers.
-TEST(LinkTest, TestMatchersFloatingPoint) {
- Mock mock;
- float a = 0;
-
- ON_CALL(mock, VoidFromFloat(FloatEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromDouble(DoubleEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromFloat(NanSensitiveFloatEq(a))).WillByDefault(Return());
- ON_CALL(mock, VoidFromDouble(NanSensitiveDoubleEq(a)))
- .WillByDefault(Return());
-}
-
-// Tests the linkage of the ContainsRegex matcher.
-TEST(LinkTest, TestMatcherContainsRegex) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(ContainsRegex(".*"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the MatchesRegex matcher.
-TEST(LinkTest, TestMatcherMatchesRegex) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(MatchesRegex(".*"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the StartsWith, EndsWith, and HasSubstr matchers.
-TEST(LinkTest, TestMatchersSubstrings) {
- Mock mock;
-
- ON_CALL(mock, VoidFromString(StartsWith("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(EndsWith("c"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(HasSubstr("b"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the StrEq, StrNe, StrCaseEq, and StrCaseNe matchers.
-TEST(LinkTest, TestMatchersStringEquality) {
- Mock mock;
- ON_CALL(mock, VoidFromString(StrEq("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrNe("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrCaseEq("a"))).WillByDefault(Return());
- ON_CALL(mock, VoidFromString(StrCaseNe("a"))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ElementsAre matcher.
-TEST(LinkTest, TestMatcherElementsAre) {
- Mock mock;
-
- ON_CALL(mock, VoidFromVector(ElementsAre('a', _))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ElementsAreArray matcher.
-TEST(LinkTest, TestMatcherElementsAreArray) {
- Mock mock;
- char arr[] = { 'a', 'b' };
-
- ON_CALL(mock, VoidFromVector(ElementsAreArray(arr))).WillByDefault(Return());
-}
-
-// Tests the linkage of the IsSubsetOf matcher.
-TEST(LinkTest, TestMatcherIsSubsetOf) {
- Mock mock;
- char arr[] = {'a', 'b'};
-
- ON_CALL(mock, VoidFromVector(IsSubsetOf(arr))).WillByDefault(Return());
-}
-
-// Tests the linkage of the IsSupersetOf matcher.
-TEST(LinkTest, TestMatcherIsSupersetOf) {
- Mock mock;
- char arr[] = {'a', 'b'};
-
- ON_CALL(mock, VoidFromVector(IsSupersetOf(arr))).WillByDefault(Return());
-}
-
-// Tests the linkage of the ContainerEq matcher.
-TEST(LinkTest, TestMatcherContainerEq) {
- Mock mock;
- std::vector<int> v;
-
- ON_CALL(mock, VoidFromVector(ContainerEq(v))).WillByDefault(Return());
-}
-
-// Tests the linkage of the Field matcher.
-TEST(LinkTest, TestMatcherField) {
- FieldHelper helper(0);
-
- Matcher<const FieldHelper&> m = Field(&FieldHelper::field_, Eq(0));
- EXPECT_TRUE(m.Matches(helper));
-
- Matcher<const FieldHelper*> m2 = Field(&FieldHelper::field_, Eq(0));
- EXPECT_TRUE(m2.Matches(&helper));
-}
-
-// Tests the linkage of the Property matcher.
-TEST(LinkTest, TestMatcherProperty) {
- FieldHelper helper(0);
-
- Matcher<const FieldHelper&> m = Property(&FieldHelper::field, Eq(0));
- EXPECT_TRUE(m.Matches(helper));
-
- Matcher<const FieldHelper*> m2 = Property(&FieldHelper::field, Eq(0));
- EXPECT_TRUE(m2.Matches(&helper));
-}
-
-// Tests the linkage of the ResultOf matcher.
-TEST(LinkTest, TestMatcherResultOf) {
- Matcher<char*> m = ResultOf(&InvokeHelper::StaticIntFromString, Eq(1));
- EXPECT_TRUE(m.Matches(nullptr));
-}
-
-// Tests the linkage of the ResultOf matcher.
-TEST(LinkTest, TestMatcherPointee) {
- int n = 1;
-
- Matcher<int*> m = Pointee(Eq(1));
- EXPECT_TRUE(m.Matches(&n));
-}
-
-// Tests the linkage of the Truly matcher.
-TEST(LinkTest, TestMatcherTruly) {
- Matcher<const char*> m = Truly(&InvokeHelper::StaticBoolFromString);
- EXPECT_TRUE(m.Matches(nullptr));
-}
-
-// Tests the linkage of the AllOf matcher.
-TEST(LinkTest, TestMatcherAllOf) {
- Matcher<int> m = AllOf(_, Eq(1));
- EXPECT_TRUE(m.Matches(1));
-}
-
-// Tests the linkage of the AnyOf matcher.
-TEST(LinkTest, TestMatcherAnyOf) {
- Matcher<int> m = AnyOf(_, Eq(1));
- EXPECT_TRUE(m.Matches(1));
-}
-
-// Tests the linkage of the Not matcher.
-TEST(LinkTest, TestMatcherNot) {
- Matcher<int> m = Not(_);
- EXPECT_FALSE(m.Matches(1));
-}
-
-// Tests the linkage of the MatcherCast<T>() function.
-TEST(LinkTest, TestMatcherCast) {
- Matcher<const char*> m = MatcherCast<const char*>(_);
- EXPECT_TRUE(m.Matches(nullptr));
-}
-
-#endif // GOOGLEMOCK_TEST_GMOCK_LINK_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test.py
deleted file mode 100755
index 71532c55ee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test.py
+++ /dev/null
@@ -1,183 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-r"""Tests the text output of Google C++ Mocking Framework.
-
-To update the golden file:
-gmock_output_test.py --build_dir=BUILD/DIR --gengolden
-where BUILD/DIR contains the built gmock_output_test_ file.
-gmock_output_test.py --gengolden
-gmock_output_test.py
-
-"""
-
-from io import open # pylint: disable=redefined-builtin, g-importing-member
-import os
-import re
-import sys
-from googlemock.test import gmock_test_utils
-
-
-# The flag for generating the golden file
-GENGOLDEN_FLAG = '--gengolden'
-
-PROGRAM_PATH = gmock_test_utils.GetTestExecutablePath('gmock_output_test_')
-COMMAND = [PROGRAM_PATH, '--gtest_stack_trace_depth=0', '--gtest_print_time=0']
-GOLDEN_NAME = 'gmock_output_test_golden.txt'
-GOLDEN_PATH = os.path.join(gmock_test_utils.GetSourceDir(), GOLDEN_NAME)
-
-
-def ToUnixLineEnding(s):
- """Changes all Windows/Mac line endings in s to UNIX line endings."""
-
- return s.replace('\r\n', '\n').replace('\r', '\n')
-
-
-def RemoveReportHeaderAndFooter(output):
- """Removes Google Test result report's header and footer from the output."""
-
- output = re.sub(r'.*gtest_main.*\n', '', output)
- output = re.sub(r'\[.*\d+ tests.*\n', '', output)
- output = re.sub(r'\[.* test environment .*\n', '', output)
- output = re.sub(r'\[=+\] \d+ tests .* ran.*', '', output)
- output = re.sub(r'.* FAILED TESTS\n', '', output)
- return output
-
-
-def RemoveLocations(output):
- """Removes all file location info from a Google Test program's output.
-
- Args:
- output: the output of a Google Test program.
-
- Returns:
- output with all file location info (in the form of
- 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
- 'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
- 'FILE:#: '.
- """
-
- return re.sub(r'.*[/\\](.+)(\:\d+|\(\d+\))\:', 'FILE:#:', output)
-
-
-def NormalizeErrorMarker(output):
- """Normalizes the error marker, which is different on Windows vs on Linux."""
-
- return re.sub(r' error: ', ' Failure\n', output)
-
-
-def RemoveMemoryAddresses(output):
- """Removes memory addresses from the test output."""
-
- return re.sub(r'@\w+', '@0x#', output)
-
-
-def RemoveTestNamesOfLeakedMocks(output):
- """Removes the test names of leaked mock objects from the test output."""
-
- return re.sub(r'\(used in test .+\) ', '', output)
-
-
-def GetLeakyTests(output):
- """Returns a list of test names that leak mock objects."""
-
- # findall() returns a list of all matches of the regex in output.
- # For example, if '(used in test FooTest.Bar)' is in output, the
- # list will contain 'FooTest.Bar'.
- return re.findall(r'\(used in test (.+)\)', output)
-
-
-def GetNormalizedOutputAndLeakyTests(output):
- """Normalizes the output of gmock_output_test_.
-
- Args:
- output: The test output.
-
- Returns:
- A tuple (the normalized test output, the list of test names that have
- leaked mocks).
- """
-
- output = ToUnixLineEnding(output)
- output = RemoveReportHeaderAndFooter(output)
- output = NormalizeErrorMarker(output)
- output = RemoveLocations(output)
- output = RemoveMemoryAddresses(output)
- return (RemoveTestNamesOfLeakedMocks(output), GetLeakyTests(output))
-
-
-def GetShellCommandOutput(cmd):
- """Runs a command in a sub-process, and returns its STDOUT in a string."""
-
- return gmock_test_utils.Subprocess(cmd, capture_stderr=False).output
-
-
-def GetNormalizedCommandOutputAndLeakyTests(cmd):
- """Runs a command and returns its normalized output and a list of leaky tests.
-
- Args:
- cmd: the shell command.
- """
-
- # Disables exception pop-ups on Windows.
- os.environ['GTEST_CATCH_EXCEPTIONS'] = '1'
- return GetNormalizedOutputAndLeakyTests(GetShellCommandOutput(cmd))
-
-
-class GMockOutputTest(gmock_test_utils.TestCase):
-
- def testOutput(self):
- (output, leaky_tests) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
- golden_file = open(GOLDEN_PATH, 'rb')
- golden = golden_file.read().decode('utf-8')
- golden_file.close()
-
- # The normalized output should match the golden file.
- self.assertEquals(golden, output)
-
- # The raw output should contain 2 leaked mock object errors for
- # test GMockOutputTest.CatchesLeakedMocks.
- self.assertEquals(['GMockOutputTest.CatchesLeakedMocks',
- 'GMockOutputTest.CatchesLeakedMocks'],
- leaky_tests)
-
-
-if __name__ == '__main__':
- if sys.argv[1:] == [GENGOLDEN_FLAG]:
- (output, _) = GetNormalizedCommandOutputAndLeakyTests(COMMAND)
- golden_file = open(GOLDEN_PATH, 'wb')
- golden_file.write(output)
- golden_file.close()
- # Suppress the error "googletest was imported but a call to its main()
- # was never detected."
- os._exit(0)
- else:
- gmock_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_.cc
deleted file mode 100644
index b1dac45941..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_.cc
+++ /dev/null
@@ -1,309 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests Google Mock's output in various scenarios. This ensures that
-// Google Mock's messages are readable and useful.
-
-#include "gmock/gmock.h"
-
-#include <stdio.h>
-#include <string>
-
-#include "gtest/gtest.h"
-
-// Silence C4100 (unreferenced formal parameter)
-#ifdef _MSC_VER
-# pragma warning(push)
-# pragma warning(disable:4100)
-#endif
-
-using testing::_;
-using testing::AnyNumber;
-using testing::Ge;
-using testing::InSequence;
-using testing::NaggyMock;
-using testing::Ref;
-using testing::Return;
-using testing::Sequence;
-using testing::Value;
-
-class MockFoo {
- public:
- MockFoo() {}
-
- MOCK_METHOD3(Bar, char(const std::string& s, int i, double x));
- MOCK_METHOD2(Bar2, bool(int x, int y));
- MOCK_METHOD2(Bar3, void(int x, int y));
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MockFoo);
-};
-
-class GMockOutputTest : public testing::Test {
- protected:
- NaggyMock<MockFoo> foo_;
-};
-
-TEST_F(GMockOutputTest, ExpectedCall) {
- GMOCK_FLAG_SET(verbose, "info");
-
- EXPECT_CALL(foo_, Bar2(0, _));
- foo_.Bar2(0, 0); // Expected call
-
- GMOCK_FLAG_SET(verbose, "warning");
-}
-
-TEST_F(GMockOutputTest, ExpectedCallToVoidFunction) {
- GMOCK_FLAG_SET(verbose, "info");
-
- EXPECT_CALL(foo_, Bar3(0, _));
- foo_.Bar3(0, 0); // Expected call
-
- GMOCK_FLAG_SET(verbose, "warning");
-}
-
-TEST_F(GMockOutputTest, ExplicitActionsRunOut) {
- EXPECT_CALL(foo_, Bar2(_, _))
- .Times(2)
- .WillOnce(Return(false));
- foo_.Bar2(2, 2);
- foo_.Bar2(1, 1); // Explicit actions in EXPECT_CALL run out.
-}
-
-TEST_F(GMockOutputTest, UnexpectedCall) {
- EXPECT_CALL(foo_, Bar2(0, _));
-
- foo_.Bar2(1, 0); // Unexpected call
- foo_.Bar2(0, 0); // Expected call
-}
-
-TEST_F(GMockOutputTest, UnexpectedCallToVoidFunction) {
- EXPECT_CALL(foo_, Bar3(0, _));
-
- foo_.Bar3(1, 0); // Unexpected call
- foo_.Bar3(0, 0); // Expected call
-}
-
-TEST_F(GMockOutputTest, ExcessiveCall) {
- EXPECT_CALL(foo_, Bar2(0, _));
-
- foo_.Bar2(0, 0); // Expected call
- foo_.Bar2(0, 1); // Excessive call
-}
-
-TEST_F(GMockOutputTest, ExcessiveCallToVoidFunction) {
- EXPECT_CALL(foo_, Bar3(0, _));
-
- foo_.Bar3(0, 0); // Expected call
- foo_.Bar3(0, 1); // Excessive call
-}
-
-TEST_F(GMockOutputTest, UninterestingCall) {
- foo_.Bar2(0, 1); // Uninteresting call
-}
-
-TEST_F(GMockOutputTest, UninterestingCallToVoidFunction) {
- foo_.Bar3(0, 1); // Uninteresting call
-}
-
-TEST_F(GMockOutputTest, RetiredExpectation) {
- EXPECT_CALL(foo_, Bar2(_, _))
- .RetiresOnSaturation();
- EXPECT_CALL(foo_, Bar2(0, 0));
-
- foo_.Bar2(1, 1);
- foo_.Bar2(1, 1); // Matches a retired expectation
- foo_.Bar2(0, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedPrerequisite) {
- {
- InSequence s;
- EXPECT_CALL(foo_, Bar(_, 0, _));
- EXPECT_CALL(foo_, Bar2(0, 0));
- EXPECT_CALL(foo_, Bar2(1, _));
- }
-
- foo_.Bar2(1, 0); // Has one immediate unsatisfied pre-requisite
- foo_.Bar("Hi", 0, 0);
- foo_.Bar2(0, 0);
- foo_.Bar2(1, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedPrerequisites) {
- Sequence s1, s2;
-
- EXPECT_CALL(foo_, Bar(_, 0, _))
- .InSequence(s1);
- EXPECT_CALL(foo_, Bar2(0, 0))
- .InSequence(s2);
- EXPECT_CALL(foo_, Bar2(1, _))
- .InSequence(s1, s2);
-
- foo_.Bar2(1, 0); // Has two immediate unsatisfied pre-requisites
- foo_.Bar("Hi", 0, 0);
- foo_.Bar2(0, 0);
- foo_.Bar2(1, 0);
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedWith) {
- EXPECT_CALL(foo_, Bar2(_, _)).With(Ge());
-}
-
-TEST_F(GMockOutputTest, UnsatisfiedExpectation) {
- EXPECT_CALL(foo_, Bar(_, _, _));
- EXPECT_CALL(foo_, Bar2(0, _))
- .Times(2);
-
- foo_.Bar2(0, 1);
-}
-
-TEST_F(GMockOutputTest, MismatchArguments) {
- const std::string s = "Hi";
- EXPECT_CALL(foo_, Bar(Ref(s), _, Ge(0)));
-
- foo_.Bar("Ho", 0, -0.1); // Mismatch arguments
- foo_.Bar(s, 0, 0);
-}
-
-TEST_F(GMockOutputTest, MismatchWith) {
- EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))
- .With(Ge());
-
- foo_.Bar2(2, 3); // Mismatch With()
- foo_.Bar2(2, 1);
-}
-
-TEST_F(GMockOutputTest, MismatchArgumentsAndWith) {
- EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))
- .With(Ge());
-
- foo_.Bar2(1, 3); // Mismatch arguments and mismatch With()
- foo_.Bar2(2, 1);
-}
-
-TEST_F(GMockOutputTest, UnexpectedCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- EXPECT_CALL(foo_, Bar2(2, 2));
- foo_.Bar2(1, 0); // Unexpected call, takes default action #2.
- foo_.Bar2(0, 0); // Unexpected call, takes default action #1.
- foo_.Bar2(2, 2); // Expected call.
-}
-
-TEST_F(GMockOutputTest, ExcessiveCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- EXPECT_CALL(foo_, Bar2(2, 2));
- EXPECT_CALL(foo_, Bar2(1, 1));
-
- foo_.Bar2(2, 2); // Expected call.
- foo_.Bar2(2, 2); // Excessive call, takes default action #1.
- foo_.Bar2(1, 1); // Expected call.
- foo_.Bar2(1, 1); // Excessive call, takes default action #2.
-}
-
-TEST_F(GMockOutputTest, UninterestingCallWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
- ON_CALL(foo_, Bar2(1, _))
- .WillByDefault(Return(false)); // Default action #2
-
- foo_.Bar2(2, 2); // Uninteresting call, takes default action #1.
- foo_.Bar2(1, 1); // Uninteresting call, takes default action #2.
-}
-
-TEST_F(GMockOutputTest, ExplicitActionsRunOutWithDefaultAction) {
- ON_CALL(foo_, Bar2(_, _))
- .WillByDefault(Return(true)); // Default action #1
-
- EXPECT_CALL(foo_, Bar2(_, _))
- .Times(2)
- .WillOnce(Return(false));
- foo_.Bar2(2, 2);
- foo_.Bar2(1, 1); // Explicit actions in EXPECT_CALL run out.
-}
-
-TEST_F(GMockOutputTest, CatchesLeakedMocks) {
- MockFoo* foo1 = new MockFoo;
- MockFoo* foo2 = new MockFoo;
-
- // Invokes ON_CALL on foo1.
- ON_CALL(*foo1, Bar(_, _, _)).WillByDefault(Return('a'));
-
- // Invokes EXPECT_CALL on foo2.
- EXPECT_CALL(*foo2, Bar2(_, _));
- EXPECT_CALL(*foo2, Bar2(1, _));
- EXPECT_CALL(*foo2, Bar3(_, _)).Times(AnyNumber());
- foo2->Bar2(2, 1);
- foo2->Bar2(1, 1);
-
- // Both foo1 and foo2 are deliberately leaked.
-}
-
-MATCHER_P2(IsPair, first, second, "") {
- return Value(arg.first, first) && Value(arg.second, second);
-}
-
-TEST_F(GMockOutputTest, PrintsMatcher) {
- const testing::Matcher<int> m1 = Ge(48);
- EXPECT_THAT((std::pair<int, bool>(42, true)), IsPair(m1, true));
-}
-
-void TestCatchesLeakedMocksInAdHocTests() {
- MockFoo* foo = new MockFoo;
-
- // Invokes EXPECT_CALL on foo.
- EXPECT_CALL(*foo, Bar2(_, _));
- foo->Bar2(2, 1);
-
- // foo is deliberately leaked.
-}
-
-int main(int argc, char **argv) {
- testing::InitGoogleMock(&argc, argv);
- // Ensures that the tests pass no matter what value of
- // --gmock_catch_leaked_mocks and --gmock_verbose the user specifies.
- GMOCK_FLAG_SET(catch_leaked_mocks, true);
- GMOCK_FLAG_SET(verbose, "warning");
-
- TestCatchesLeakedMocksInAdHocTests();
- return RUN_ALL_TESTS();
-}
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_golden.txt b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_golden.txt
deleted file mode 100644
index fdf224fd0a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_output_test_golden.txt
+++ /dev/null
@@ -1,317 +0,0 @@
-[ RUN ] GMockOutputTest.ExpectedCall
-
-FILE:#: EXPECT_CALL(foo_, Bar2(0, _)) invoked
-Stack trace:
-
-FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar2(0, _))...
- Function call: Bar2(0, 0)
- Returns: false
-Stack trace:
-[ OK ] GMockOutputTest.ExpectedCall
-[ RUN ] GMockOutputTest.ExpectedCallToVoidFunction
-
-FILE:#: EXPECT_CALL(foo_, Bar3(0, _)) invoked
-Stack trace:
-
-FILE:#: Mock function call matches EXPECT_CALL(foo_, Bar3(0, _))...
- Function call: Bar3(0, 0)
-Stack trace:
-[ OK ] GMockOutputTest.ExpectedCallToVoidFunction
-[ RUN ] GMockOutputTest.ExplicitActionsRunOut
-
-GMOCK WARNING:
-FILE:#: Too few actions specified in EXPECT_CALL(foo_, Bar2(_, _))...
-Expected to be called twice, but has only 1 WillOnce().
-GMOCK WARNING:
-FILE:#: Actions ran out in EXPECT_CALL(foo_, Bar2(_, _))...
-Called 2 times, but only 1 WillOnce() is specified - returning default value.
-Stack trace:
-[ OK ] GMockOutputTest.ExplicitActionsRunOut
-[ RUN ] GMockOutputTest.UnexpectedCall
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(0, _))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCall
-[ RUN ] GMockOutputTest.UnexpectedCallToVoidFunction
-unknown file: Failure
-
-Unexpected mock function call - returning directly.
- Function call: Bar3(1, 0)
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar3(0, _))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
-[ RUN ] GMockOutputTest.ExcessiveCall
-FILE:#: Failure
-Mock function called more times than expected - returning default value.
- Function call: Bar2(0, 1)
- Returns: false
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCall
-[ RUN ] GMockOutputTest.ExcessiveCallToVoidFunction
-FILE:#: Failure
-Mock function called more times than expected - returning directly.
- Function call: Bar3(0, 1)
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCallToVoidFunction
-[ RUN ] GMockOutputTest.UninterestingCall
-
-GMOCK WARNING:
-Uninteresting mock function call - returning default value.
- Function call: Bar2(0, 1)
- Returns: false
-NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.
-[ OK ] GMockOutputTest.UninterestingCall
-[ RUN ] GMockOutputTest.UninterestingCallToVoidFunction
-
-GMOCK WARNING:
-Uninteresting mock function call - returning directly.
- Function call: Bar3(0, 1)
-NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.
-[ OK ] GMockOutputTest.UninterestingCallToVoidFunction
-[ RUN ] GMockOutputTest.RetiredExpectation
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 1)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(_, _))...
- Expected: the expectation is active
- Actual: it is retired
- Expected: to be called once
- Actual: called once - saturated and retired
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected arg #1: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.RetiredExpectation
-[ RUN ] GMockOutputTest.UnsatisfiedPrerequisite
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(1, _))...
- Expected: all pre-requisites are satisfied
- Actual: the following immediate pre-requisites are not satisfied:
-FILE:#: pre-requisite #0
- (end of pre-requisites)
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisite
-[ RUN ] GMockOutputTest.UnsatisfiedPrerequisites
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 2 expectations, but none matched:
-
-FILE:#: tried expectation #0: EXPECT_CALL(foo_, Bar2(0, 0))...
- Expected arg #0: is equal to 0
- Actual: 1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-FILE:#: tried expectation #1: EXPECT_CALL(foo_, Bar2(1, _))...
- Expected: all pre-requisites are satisfied
- Actual: the following immediate pre-requisites are not satisfied:
-FILE:#: pre-requisite #0
-FILE:#: pre-requisite #1
- (end of pre-requisites)
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisites
-[ RUN ] GMockOutputTest.UnsatisfiedWith
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(_, _))...
- Expected args: are a pair where the first >= the second
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedWith
-[ RUN ] GMockOutputTest.UnsatisfiedExpectation
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar2(0, _))...
- Expected: to be called twice
- Actual: called once - unsatisfied and active
-FILE:#: Failure
-Actual function call count doesn't match EXPECT_CALL(foo_, Bar(_, _, _))...
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnsatisfiedExpectation
-[ RUN ] GMockOutputTest.MismatchArguments
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar(@0x# "Ho", 0, -0.1)
- Returns: '\0'
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar(Ref(s), _, Ge(0)))...
- Expected arg #0: references the variable @0x# "Hi"
- Actual: "Ho", which is located @0x#
- Expected arg #2: is >= 0
- Actual: -0.1
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchArguments
-[ RUN ] GMockOutputTest.MismatchWith
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(2, 3)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
- Expected args: are a pair where the first >= the second
- Actual: don't match
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchWith
-[ RUN ] GMockOutputTest.MismatchArgumentsAndWith
-unknown file: Failure
-
-Unexpected mock function call - returning default value.
- Function call: Bar2(1, 3)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(Ge(2), Ge(1)))...
- Expected arg #0: is >= 2
- Actual: 1
- Expected args: are a pair where the first >= the second
- Actual: don't match
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.MismatchArgumentsAndWith
-[ RUN ] GMockOutputTest.UnexpectedCallWithDefaultAction
-unknown file: Failure
-
-Unexpected mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 0)
- Returns: false
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(2, 2))...
- Expected arg #0: is equal to 2
- Actual: 1
- Expected arg #1: is equal to 2
- Actual: 0
- Expected: to be called once
- Actual: never called - unsatisfied and active
-unknown file: Failure
-
-Unexpected mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(0, 0)
- Returns: true
-Google Mock tried the following 1 expectation, but it didn't match:
-
-FILE:#: EXPECT_CALL(foo_, Bar2(2, 2))...
- Expected arg #0: is equal to 2
- Actual: 0
- Expected arg #1: is equal to 2
- Actual: 0
- Expected: to be called once
- Actual: never called - unsatisfied and active
-[ FAILED ] GMockOutputTest.UnexpectedCallWithDefaultAction
-[ RUN ] GMockOutputTest.ExcessiveCallWithDefaultAction
-FILE:#: Failure
-Mock function called more times than expected - taking default action specified at:
-FILE:#:
- Function call: Bar2(2, 2)
- Returns: true
- Expected: to be called once
- Actual: called twice - over-saturated and active
-FILE:#: Failure
-Mock function called more times than expected - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 1)
- Returns: false
- Expected: to be called once
- Actual: called twice - over-saturated and active
-[ FAILED ] GMockOutputTest.ExcessiveCallWithDefaultAction
-[ RUN ] GMockOutputTest.UninterestingCallWithDefaultAction
-
-GMOCK WARNING:
-Uninteresting mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(2, 2)
- Returns: true
-NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.
-
-GMOCK WARNING:
-Uninteresting mock function call - taking default action specified at:
-FILE:#:
- Function call: Bar2(1, 1)
- Returns: false
-NOTE: You can safely ignore the above warning unless this call should not happen. Do not suppress it by blindly adding an EXPECT_CALL() if you don't mean to enforce the call. See https://github.com/google/googletest/blob/master/docs/gmock_cook_book.md#knowing-when-to-expect for details.
-[ OK ] GMockOutputTest.UninterestingCallWithDefaultAction
-[ RUN ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction
-
-GMOCK WARNING:
-FILE:#: Too few actions specified in EXPECT_CALL(foo_, Bar2(_, _))...
-Expected to be called twice, but has only 1 WillOnce().
-GMOCK WARNING:
-FILE:#: Actions ran out in EXPECT_CALL(foo_, Bar2(_, _))...
-Called 2 times, but only 1 WillOnce() is specified - taking default action specified at:
-FILE:#:
-Stack trace:
-[ OK ] GMockOutputTest.ExplicitActionsRunOutWithDefaultAction
-[ RUN ] GMockOutputTest.CatchesLeakedMocks
-[ OK ] GMockOutputTest.CatchesLeakedMocks
-[ RUN ] GMockOutputTest.PrintsMatcher
-FILE:#: Failure
-Value of: (std::pair<int, bool>(42, true))
-Expected: is pair (first: is >= 48, second: true)
- Actual: (42, true) (of type std::pair<int, bool>)
-[ FAILED ] GMockOutputTest.PrintsMatcher
-[ FAILED ] GMockOutputTest.UnexpectedCall
-[ FAILED ] GMockOutputTest.UnexpectedCallToVoidFunction
-[ FAILED ] GMockOutputTest.ExcessiveCall
-[ FAILED ] GMockOutputTest.ExcessiveCallToVoidFunction
-[ FAILED ] GMockOutputTest.RetiredExpectation
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisite
-[ FAILED ] GMockOutputTest.UnsatisfiedPrerequisites
-[ FAILED ] GMockOutputTest.UnsatisfiedWith
-[ FAILED ] GMockOutputTest.UnsatisfiedExpectation
-[ FAILED ] GMockOutputTest.MismatchArguments
-[ FAILED ] GMockOutputTest.MismatchWith
-[ FAILED ] GMockOutputTest.MismatchArgumentsAndWith
-[ FAILED ] GMockOutputTest.UnexpectedCallWithDefaultAction
-[ FAILED ] GMockOutputTest.ExcessiveCallWithDefaultAction
-[ FAILED ] GMockOutputTest.PrintsMatcher
-
-
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-FILE:#: ERROR: this mock object should be deleted but never is. Its address is @0x#.
-ERROR: 3 leaked mock objects found at program exit. Expectations on a mock object are verified when the object is destructed. Leaking a mock means that its expectations aren't verified, which is usually a test bug. If you really intend to leak a mock, you can suppress this error using testing::Mock::AllowLeak(mock_object), or you may use a fake or stub instead of a mock.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_stress_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_stress_test.cc
deleted file mode 100644
index 20725d69b7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_stress_test.cc
+++ /dev/null
@@ -1,240 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests that Google Mock constructs can be used in a large number of
-// threads concurrently.
-
-#include "gmock/gmock.h"
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace {
-
-// From gtest-port.h.
-using ::testing::internal::ThreadWithParam;
-
-// The maximum number of test threads (not including helper threads)
-// to create.
-const int kMaxTestThreads = 50;
-
-// How many times to repeat a task in a test thread.
-const int kRepeat = 50;
-
-class MockFoo {
- public:
- MOCK_METHOD1(Bar, int(int n)); // NOLINT
- MOCK_METHOD2(Baz, char(const char* s1, const std::string& s2)); // NOLINT
-};
-
-// Helper for waiting for the given thread to finish and then deleting it.
-template <typename T>
-void JoinAndDelete(ThreadWithParam<T>* t) {
- t->Join();
- delete t;
-}
-
-struct Dummy {};
-
-
-// Tests that different mock objects can be used in their respective
-// threads. This should generate no Google Test failure.
-void TestConcurrentMockObjects(Dummy /* dummy */) {
- // Creates a mock and does some typical operations on it.
- MockFoo foo;
- ON_CALL(foo, Bar(_))
- .WillByDefault(Return(1));
- ON_CALL(foo, Baz(_, _))
- .WillByDefault(Return('b'));
- ON_CALL(foo, Baz(_, "you"))
- .WillByDefault(Return('a'));
-
- EXPECT_CALL(foo, Bar(0))
- .Times(AtMost(3));
- EXPECT_CALL(foo, Baz(_, _));
- EXPECT_CALL(foo, Baz("hi", "you"))
- .WillOnce(Return('z'))
- .WillRepeatedly(DoDefault());
-
- EXPECT_EQ(1, foo.Bar(0));
- EXPECT_EQ(1, foo.Bar(0));
- EXPECT_EQ('z', foo.Baz("hi", "you"));
- EXPECT_EQ('a', foo.Baz("hi", "you"));
- EXPECT_EQ('b', foo.Baz("hi", "me"));
-}
-
-// Tests invoking methods of the same mock object in multiple threads.
-
-struct Helper1Param {
- MockFoo* mock_foo;
- int* count;
-};
-
-void Helper1(Helper1Param param) {
- for (int i = 0; i < kRepeat; i++) {
- const char ch = param.mock_foo->Baz("a", "b");
- if (ch == 'a') {
- // It was an expected call.
- (*param.count)++;
- } else {
- // It was an excessive call.
- EXPECT_EQ('\0', ch);
- }
-
- // An unexpected call.
- EXPECT_EQ('\0', param.mock_foo->Baz("x", "y")) << "Expected failure.";
-
- // An uninteresting call.
- EXPECT_EQ(1, param.mock_foo->Bar(5));
- }
-}
-
-// This should generate 3*kRepeat + 1 failures in total.
-void TestConcurrentCallsOnSameObject(Dummy /* dummy */) {
- MockFoo foo;
-
- ON_CALL(foo, Bar(_))
- .WillByDefault(Return(1));
- EXPECT_CALL(foo, Baz(_, "b"))
- .Times(kRepeat)
- .WillRepeatedly(Return('a'));
- EXPECT_CALL(foo, Baz(_, "c")); // Expected to be unsatisfied.
-
- // This chunk of code should generate kRepeat failures about
- // excessive calls, and 2*kRepeat failures about unexpected calls.
- int count1 = 0;
- const Helper1Param param = { &foo, &count1 };
- ThreadWithParam<Helper1Param>* const t =
- new ThreadWithParam<Helper1Param>(Helper1, param, nullptr);
-
- int count2 = 0;
- const Helper1Param param2 = { &foo, &count2 };
- Helper1(param2);
- JoinAndDelete(t);
-
- EXPECT_EQ(kRepeat, count1 + count2);
-
- // foo's destructor should generate one failure about unsatisfied
- // expectation.
-}
-
-// Tests using the same mock object in multiple threads when the
-// expectations are partially ordered.
-
-void Helper2(MockFoo* foo) {
- for (int i = 0; i < kRepeat; i++) {
- foo->Bar(2);
- foo->Bar(3);
- }
-}
-
-// This should generate no Google Test failures.
-void TestPartiallyOrderedExpectationsWithThreads(Dummy /* dummy */) {
- MockFoo foo;
- Sequence s1, s2;
-
- {
- InSequence dummy;
- EXPECT_CALL(foo, Bar(0));
- EXPECT_CALL(foo, Bar(1))
- .InSequence(s1, s2);
- }
-
- EXPECT_CALL(foo, Bar(2))
- .Times(2*kRepeat)
- .InSequence(s1)
- .RetiresOnSaturation();
- EXPECT_CALL(foo, Bar(3))
- .Times(2*kRepeat)
- .InSequence(s2);
-
- {
- InSequence dummy;
- EXPECT_CALL(foo, Bar(2))
- .InSequence(s1, s2);
- EXPECT_CALL(foo, Bar(4));
- }
-
- foo.Bar(0);
- foo.Bar(1);
-
- ThreadWithParam<MockFoo*>* const t =
- new ThreadWithParam<MockFoo*>(Helper2, &foo, nullptr);
- Helper2(&foo);
- JoinAndDelete(t);
-
- foo.Bar(2);
- foo.Bar(4);
-}
-
-// Tests using Google Mock constructs in many threads concurrently.
-TEST(StressTest, CanUseGMockWithThreads) {
- void (*test_routines[])(Dummy dummy) = {
- &TestConcurrentMockObjects,
- &TestConcurrentCallsOnSameObject,
- &TestPartiallyOrderedExpectationsWithThreads,
- };
-
- const int kRoutines = sizeof(test_routines)/sizeof(test_routines[0]);
- const int kCopiesOfEachRoutine = kMaxTestThreads / kRoutines;
- const int kTestThreads = kCopiesOfEachRoutine * kRoutines;
- ThreadWithParam<Dummy>* threads[kTestThreads] = {};
- for (int i = 0; i < kTestThreads; i++) {
- // Creates a thread to run the test function.
- threads[i] = new ThreadWithParam<Dummy>(test_routines[i % kRoutines],
- Dummy(), nullptr);
- GTEST_LOG_(INFO) << "Thread #" << i << " running . . .";
- }
-
- // At this point, we have many threads running.
- for (int i = 0; i < kTestThreads; i++) {
- JoinAndDelete(threads[i]);
- }
-
- // Ensures that the correct number of failures have been reported.
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult& result = *info->result();
- const int kExpectedFailures = (3*kRepeat + 1)*kCopiesOfEachRoutine;
- GTEST_CHECK_(kExpectedFailures == result.total_part_count())
- << "Expected " << kExpectedFailures << " failures, but got "
- << result.total_part_count();
-}
-
-} // namespace
-} // namespace testing
-
-int main(int argc, char **argv) {
- testing::InitGoogleMock(&argc, argv);
-
- const int exit_code = RUN_ALL_TESTS(); // Expected to fail.
- GTEST_CHECK_(exit_code != 0) << "RUN_ALL_TESTS() did not fail as expected";
-
- printf("\nPASS\n");
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test.cc
deleted file mode 100644
index 9a2bd93f7a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test.cc
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Mock - a framework for writing C++ mock classes.
-//
-// This file tests code in gmock.cc.
-
-#include "gmock/gmock.h"
-
-#include <string>
-#include "gtest/gtest.h"
-#include "gtest/internal/custom/gtest.h"
-
-#if !defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
-
-using testing::InitGoogleMock;
-
-// Verifies that calling InitGoogleMock() on argv results in new_argv,
-// and the gmock_verbose flag's value is set to expected_gmock_verbose.
-template <typename Char, int M, int N>
-void TestInitGoogleMock(const Char* (&argv)[M], const Char* (&new_argv)[N],
- const ::std::string& expected_gmock_verbose) {
- const ::std::string old_verbose = GMOCK_FLAG_GET(verbose);
-
- int argc = M - 1;
- InitGoogleMock(&argc, const_cast<Char**>(argv));
- ASSERT_EQ(N - 1, argc) << "The new argv has wrong number of elements.";
-
- for (int i = 0; i < N; i++) {
- EXPECT_STREQ(new_argv[i], argv[i]);
- }
-
- EXPECT_EQ(expected_gmock_verbose, GMOCK_FLAG_GET(verbose));
- GMOCK_FLAG_SET(verbose, old_verbose); // Restores the gmock_verbose flag.
-}
-
-TEST(InitGoogleMockTest, ParsesInvalidCommandLine) {
- const char* argv[] = {nullptr};
-
- const char* new_argv[] = {nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesEmptyCommandLine) {
- const char* argv[] = {"foo.exe", nullptr};
-
- const char* new_argv[] = {"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesSingleFlag) {
- const char* argv[] = {"foo.exe", "--gmock_verbose=info", nullptr};
-
- const char* new_argv[] = {"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "info");
-}
-
-TEST(InitGoogleMockTest, ParsesMultipleFlags) {
- int old_default_behavior = GMOCK_FLAG_GET(default_mock_behavior);
- const wchar_t* argv[] = {L"foo.exe", L"--gmock_verbose=info",
- L"--gmock_default_mock_behavior=2", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "info");
- EXPECT_EQ(2, GMOCK_FLAG_GET(default_mock_behavior));
- EXPECT_NE(2, old_default_behavior);
- GMOCK_FLAG_SET(default_mock_behavior, old_default_behavior);
-}
-
-TEST(InitGoogleMockTest, ParsesUnrecognizedFlag) {
- const char* argv[] = {"foo.exe", "--non_gmock_flag=blah", nullptr};
-
- const char* new_argv[] = {"foo.exe", "--non_gmock_flag=blah", nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(InitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
- const char* argv[] = {"foo.exe", "--non_gmock_flag=blah",
- "--gmock_verbose=error", nullptr};
-
- const char* new_argv[] = {"foo.exe", "--non_gmock_flag=blah", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "error");
-}
-
-TEST(WideInitGoogleMockTest, ParsesInvalidCommandLine) {
- const wchar_t* argv[] = {nullptr};
-
- const wchar_t* new_argv[] = {nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesEmptyCommandLine) {
- const wchar_t* argv[] = {L"foo.exe", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesSingleFlag) {
- const wchar_t* argv[] = {L"foo.exe", L"--gmock_verbose=info", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "info");
-}
-
-TEST(WideInitGoogleMockTest, ParsesMultipleFlags) {
- int old_default_behavior = GMOCK_FLAG_GET(default_mock_behavior);
- const wchar_t* argv[] = {L"foo.exe", L"--gmock_verbose=info",
- L"--gmock_default_mock_behavior=2", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "info");
- EXPECT_EQ(2, GMOCK_FLAG_GET(default_mock_behavior));
- EXPECT_NE(2, old_default_behavior);
- GMOCK_FLAG_SET(default_mock_behavior, old_default_behavior);
-}
-
-TEST(WideInitGoogleMockTest, ParsesUnrecognizedFlag) {
- const wchar_t* argv[] = {L"foo.exe", L"--non_gmock_flag=blah", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", L"--non_gmock_flag=blah", nullptr};
-
- TestInitGoogleMock(argv, new_argv, GMOCK_FLAG_GET(verbose));
-}
-
-TEST(WideInitGoogleMockTest, ParsesGoogleMockFlagAndUnrecognizedFlag) {
- const wchar_t* argv[] = {L"foo.exe", L"--non_gmock_flag=blah",
- L"--gmock_verbose=error", nullptr};
-
- const wchar_t* new_argv[] = {L"foo.exe", L"--non_gmock_flag=blah", nullptr};
-
- TestInitGoogleMock(argv, new_argv, "error");
-}
-
-#endif // !defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
-
-// Makes sure Google Mock flags can be accessed in code.
-TEST(FlagTest, IsAccessibleInCode) {
- bool dummy =
- GMOCK_FLAG_GET(catch_leaked_mocks) && GMOCK_FLAG_GET(verbose) == "";
- (void)dummy; // Avoids the "unused local variable" warning.
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test_utils.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test_utils.py
deleted file mode 100755
index d7bc0974a7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googlemock/test/gmock_test_utils.py
+++ /dev/null
@@ -1,96 +0,0 @@
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for Google C++ Mocking Framework."""
-
-import os
-
-# pylint: disable=C6204
-from googletest.test import gtest_test_utils
-
-
-def GetSourceDir():
- """Returns the absolute path of the directory where the .py files are."""
-
- return gtest_test_utils.GetSourceDir()
-
-
-def GetTestExecutablePath(executable_name):
- """Returns the absolute path of the test binary given its name.
-
- The function will print a message and abort the program if the resulting file
- doesn't exist.
-
- Args:
- executable_name: name of the test binary that the test script runs.
-
- Returns:
- The absolute path of the test binary.
- """
-
- return gtest_test_utils.GetTestExecutablePath(executable_name)
-
-
-def GetExitStatus(exit_code):
- """Returns the argument to exit(), or -1 if exit() wasn't called.
-
- Args:
- exit_code: the result value of os.system(command).
- """
-
- if os.name == 'nt':
- # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
- # the argument to exit() directly.
- return exit_code
- else:
- # On Unix, os.WEXITSTATUS() must be used to extract the exit status
- # from the result of os.system().
- if os.WIFEXITED(exit_code):
- return os.WEXITSTATUS(exit_code)
- else:
- return -1
-
-
-# Suppresses the "Invalid const name" lint complaint
-# pylint: disable-msg=C6409
-
-# Exposes utilities from gtest_test_utils.
-Subprocess = gtest_test_utils.Subprocess
-TestCase = gtest_test_utils.TestCase
-environ = gtest_test_utils.environ
-SetEnvVar = gtest_test_utils.SetEnvVar
-PREMATURE_EXIT_FILE_ENV_VAR = gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR
-
-# pylint: enable-msg=C6409
-
-
-def Main():
- """Runs the unit test."""
-
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/CMakeLists.txt
deleted file mode 100644
index eb03bfaf3e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/CMakeLists.txt
+++ /dev/null
@@ -1,321 +0,0 @@
-########################################################################
-# Note: CMake support is community-based. The maintainers do not use CMake
-# internally.
-#
-# CMake build script for Google Test.
-#
-# To run the tests for Google Test itself on Linux, use 'make test' or
-# ctest. You can select which tests to run using 'ctest -R regex'.
-# For more options, run 'ctest --help'.
-
-# When other libraries are using a shared version of runtime libraries,
-# Google Test also has to use one.
-option(
- gtest_force_shared_crt
- "Use shared (DLL) run-time lib even when Google Test is built as static lib."
- OFF)
-
-option(gtest_build_tests "Build all of gtest's own tests." OFF)
-
-option(gtest_build_samples "Build gtest's sample programs." OFF)
-
-option(gtest_disable_pthreads "Disable uses of pthreads in gtest." OFF)
-
-option(
- gtest_hide_internal_symbols
- "Build gtest with internal symbols hidden in shared libraries."
- OFF)
-
-# Defines pre_project_set_up_hermetic_build() and set_up_hermetic_build().
-include(cmake/hermetic_build.cmake OPTIONAL)
-
-if (COMMAND pre_project_set_up_hermetic_build)
- pre_project_set_up_hermetic_build()
-endif()
-
-########################################################################
-#
-# Project-wide settings
-
-# Name of the project.
-#
-# CMake files in this project can refer to the root source directory
-# as ${gtest_SOURCE_DIR} and to the root binary directory as
-# ${gtest_BINARY_DIR}.
-# Language "C" is required for find_package(Threads).
-
-# Project version:
-
-cmake_minimum_required(VERSION 3.5)
-cmake_policy(SET CMP0048 NEW)
-project(gtest VERSION ${GOOGLETEST_VERSION} LANGUAGES CXX C)
-
-if (POLICY CMP0063) # Visibility
- cmake_policy(SET CMP0063 NEW)
-endif (POLICY CMP0063)
-
-if (COMMAND set_up_hermetic_build)
- set_up_hermetic_build()
-endif()
-
-# These commands only run if this is the main project
-if(CMAKE_PROJECT_NAME STREQUAL "gtest" OR CMAKE_PROJECT_NAME STREQUAL "googletest-distribution")
-
- # BUILD_SHARED_LIBS is a standard CMake variable, but we declare it here to
- # make it prominent in the GUI.
- option(BUILD_SHARED_LIBS "Build shared libraries (DLLs)." OFF)
-
-else()
-
- mark_as_advanced(
- gtest_force_shared_crt
- gtest_build_tests
- gtest_build_samples
- gtest_disable_pthreads
- gtest_hide_internal_symbols)
-
-endif()
-
-
-if (gtest_hide_internal_symbols)
- set(CMAKE_CXX_VISIBILITY_PRESET hidden)
- set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
-endif()
-
-# Define helper functions and macros used by Google Test.
-include(cmake/internal_utils.cmake)
-
-config_compiler_and_linker() # Defined in internal_utils.cmake.
-
-# Needed to set the namespace for both the export targets and the
-# alias libraries
-set(cmake_package_name GTest CACHE INTERNAL "")
-
-# Create the CMake package file descriptors.
-if (INSTALL_GTEST)
- include(CMakePackageConfigHelpers)
- set(targets_export_name ${cmake_package_name}Targets CACHE INTERNAL "")
- set(generated_dir "${CMAKE_CURRENT_BINARY_DIR}/generated" CACHE INTERNAL "")
- set(cmake_files_install_dir "${CMAKE_INSTALL_LIBDIR}/cmake/${cmake_package_name}")
- set(version_file "${generated_dir}/${cmake_package_name}ConfigVersion.cmake")
- write_basic_package_version_file(${version_file} VERSION ${GOOGLETEST_VERSION} COMPATIBILITY AnyNewerVersion)
- install(EXPORT ${targets_export_name}
- NAMESPACE ${cmake_package_name}::
- DESTINATION ${cmake_files_install_dir})
- set(config_file "${generated_dir}/${cmake_package_name}Config.cmake")
- configure_package_config_file("${gtest_SOURCE_DIR}/cmake/Config.cmake.in"
- "${config_file}" INSTALL_DESTINATION ${cmake_files_install_dir})
- install(FILES ${version_file} ${config_file}
- DESTINATION ${cmake_files_install_dir})
-endif()
-
-# Where Google Test's .h files can be found.
-set(gtest_build_include_dirs
- "${gtest_SOURCE_DIR}/include"
- "${gtest_SOURCE_DIR}")
-include_directories(${gtest_build_include_dirs})
-
-########################################################################
-#
-# Defines the gtest & gtest_main libraries. User tests should link
-# with one of them.
-
-# Google Test libraries. We build them using more strict warnings than what
-# are used for other targets, to ensure that gtest can be compiled by a user
-# aggressive about warnings.
-cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
-set_target_properties(gtest PROPERTIES VERSION ${GOOGLETEST_VERSION})
-cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
-set_target_properties(gtest_main PROPERTIES VERSION ${GOOGLETEST_VERSION})
-# If the CMake version supports it, attach header directory information
-# to the targets for when we are part of a parent build (ie being pulled
-# in via add_subdirectory() rather than being a standalone build).
-if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
- target_include_directories(gtest SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
- target_include_directories(gtest_main SYSTEM INTERFACE
- "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
- "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
-endif()
-if(CMAKE_SYSTEM_NAME MATCHES "QNX")
- target_link_libraries(gtest PUBLIC regex)
-endif()
-target_link_libraries(gtest_main PUBLIC gtest)
-
-########################################################################
-#
-# Install rules
-install_project(gtest gtest_main)
-
-########################################################################
-#
-# Samples on how to link user tests with gtest or gtest_main.
-#
-# They are not built by default. To build them, set the
-# gtest_build_samples option to ON. You can do it by running ccmake
-# or specifying the -Dgtest_build_samples=ON flag when running cmake.
-
-if (gtest_build_samples)
- cxx_executable(sample1_unittest samples gtest_main samples/sample1.cc)
- cxx_executable(sample2_unittest samples gtest_main samples/sample2.cc)
- cxx_executable(sample3_unittest samples gtest_main)
- cxx_executable(sample4_unittest samples gtest_main samples/sample4.cc)
- cxx_executable(sample5_unittest samples gtest_main samples/sample1.cc)
- cxx_executable(sample6_unittest samples gtest_main)
- cxx_executable(sample7_unittest samples gtest_main)
- cxx_executable(sample8_unittest samples gtest_main)
- cxx_executable(sample9_unittest samples gtest)
- cxx_executable(sample10_unittest samples gtest)
-endif()
-
-########################################################################
-#
-# Google Test's own tests.
-#
-# You can skip this section if you aren't interested in testing
-# Google Test itself.
-#
-# The tests are not built by default. To build them, set the
-# gtest_build_tests option to ON. You can do it by running ccmake
-# or specifying the -Dgtest_build_tests=ON flag when running cmake.
-
-if (gtest_build_tests)
- # This must be set in the root directory for the tests to be run by
- # 'make test' or ctest.
- enable_testing()
-
- ############################################################
- # C++ tests built with standard compiler flags.
-
- cxx_test(googletest-death-test-test gtest_main)
- cxx_test(gtest_environment_test gtest)
- cxx_test(googletest-filepath-test gtest_main)
- cxx_test(googletest-listener-test gtest_main)
- cxx_test(gtest_main_unittest gtest_main)
- cxx_test(googletest-message-test gtest_main)
- cxx_test(gtest_no_test_unittest gtest)
- cxx_test(googletest-options-test gtest_main)
- cxx_test(googletest-param-test-test gtest
- test/googletest-param-test2-test.cc)
- cxx_test(googletest-port-test gtest_main)
- cxx_test(gtest_pred_impl_unittest gtest_main)
- cxx_test(gtest_premature_exit_test gtest
- test/gtest_premature_exit_test.cc)
- cxx_test(googletest-printers-test gtest_main)
- cxx_test(gtest_prod_test gtest_main
- test/production.cc)
- cxx_test(gtest_repeat_test gtest)
- cxx_test(gtest_sole_header_test gtest_main)
- cxx_test(gtest_stress_test gtest)
- cxx_test(googletest-test-part-test gtest_main)
- cxx_test(gtest_throw_on_failure_ex_test gtest)
- cxx_test(gtest-typed-test_test gtest_main
- test/gtest-typed-test2_test.cc)
- cxx_test(gtest_unittest gtest_main)
- cxx_test(gtest-unittest-api_test gtest)
- cxx_test(gtest_skip_in_environment_setup_test gtest_main)
- cxx_test(gtest_skip_test gtest_main)
-
- ############################################################
- # C++ tests built with non-standard compiler flags.
-
- # MSVC 7.1 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_library(gtest_no_exception "${cxx_no_exception}"
- src/gtest-all.cc)
- cxx_library(gtest_main_no_exception "${cxx_no_exception}"
- src/gtest-all.cc src/gtest_main.cc)
- endif()
- cxx_library(gtest_main_no_rtti "${cxx_no_rtti}"
- src/gtest-all.cc src/gtest_main.cc)
-
- cxx_test_with_flags(gtest-death-test_ex_nocatch_test
- "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=0"
- gtest test/googletest-death-test_ex_test.cc)
- cxx_test_with_flags(gtest-death-test_ex_catch_test
- "${cxx_exception} -DGTEST_ENABLE_CATCH_EXCEPTIONS_=1"
- gtest test/googletest-death-test_ex_test.cc)
-
- cxx_test_with_flags(gtest_no_rtti_unittest "${cxx_no_rtti}"
- gtest_main_no_rtti test/gtest_unittest.cc)
-
- cxx_shared_library(gtest_dll "${cxx_default}"
- src/gtest-all.cc src/gtest_main.cc)
-
- cxx_executable_with_flags(gtest_dll_test_ "${cxx_default}"
- gtest_dll test/gtest_all_test.cc)
- set_target_properties(gtest_dll_test_
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
-
- ############################################################
- # Python tests.
-
- cxx_executable(googletest-break-on-failure-unittest_ test gtest)
- py_test(googletest-break-on-failure-unittest)
-
- py_test(gtest_skip_check_output_test)
- py_test(gtest_skip_environment_check_output_test)
-
- # Visual Studio .NET 2003 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310) # 1310 is Visual Studio .NET 2003
- cxx_executable_with_flags(
- googletest-catch-exceptions-no-ex-test_
- "${cxx_no_exception}"
- gtest_main_no_exception
- test/googletest-catch-exceptions-test_.cc)
- endif()
-
- cxx_executable_with_flags(
- googletest-catch-exceptions-ex-test_
- "${cxx_exception}"
- gtest_main
- test/googletest-catch-exceptions-test_.cc)
- py_test(googletest-catch-exceptions-test)
-
- cxx_executable(googletest-color-test_ test gtest)
- py_test(googletest-color-test)
-
- cxx_executable(googletest-env-var-test_ test gtest)
- py_test(googletest-env-var-test)
-
- cxx_executable(googletest-filter-unittest_ test gtest)
- py_test(googletest-filter-unittest)
-
- cxx_executable(gtest_help_test_ test gtest_main)
- py_test(gtest_help_test)
-
- cxx_executable(googletest-list-tests-unittest_ test gtest)
- py_test(googletest-list-tests-unittest)
-
- cxx_executable(googletest-output-test_ test gtest)
- py_test(googletest-output-test --no_stacktrace_support)
-
- cxx_executable(googletest-shuffle-test_ test gtest)
- py_test(googletest-shuffle-test)
-
- # MSVC 7.1 does not support STL with exceptions disabled.
- if (NOT MSVC OR MSVC_VERSION GREATER 1310)
- cxx_executable(googletest-throw-on-failure-test_ test gtest_no_exception)
- set_target_properties(googletest-throw-on-failure-test_
- PROPERTIES
- COMPILE_FLAGS "${cxx_no_exception}")
- py_test(googletest-throw-on-failure-test)
- endif()
-
- cxx_executable(googletest-uninitialized-test_ test gtest)
- py_test(googletest-uninitialized-test)
-
- cxx_executable(gtest_list_output_unittest_ test gtest)
- py_test(gtest_list_output_unittest)
-
- cxx_executable(gtest_xml_outfile1_test_ test gtest_main)
- cxx_executable(gtest_xml_outfile2_test_ test gtest_main)
- py_test(gtest_xml_outfiles_test)
- py_test(googletest-json-outfiles-test)
-
- cxx_executable(gtest_xml_output_unittest_ test gtest)
- py_test(gtest_xml_output_unittest --no_stacktrace_support)
- py_test(googletest-json-output-unittest --no_stacktrace_support)
-endif()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/README.md
deleted file mode 100644
index 83ae6cf555..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/README.md
+++ /dev/null
@@ -1,217 +0,0 @@
-### Generic Build Instructions
-
-#### Setup
-
-To build GoogleTest and your tests that use it, you need to tell your build
-system where to find its headers and source files. The exact way to do it
-depends on which build system you use, and is usually straightforward.
-
-### Build with CMake
-
-GoogleTest comes with a CMake build script
-([CMakeLists.txt](https://github.com/google/googletest/blob/master/CMakeLists.txt))
-that can be used on a wide range of platforms ("C" stands for cross-platform.).
-If you don't have CMake installed already, you can download it for free from
-<http://www.cmake.org/>.
-
-CMake works by generating native makefiles or build projects that can be used in
-the compiler environment of your choice. You can either build GoogleTest as a
-standalone project or it can be incorporated into an existing CMake build for
-another project.
-
-#### Standalone CMake Project
-
-When building GoogleTest as a standalone project, the typical workflow starts
-with
-
-```
-git clone https://github.com/google/googletest.git -b release-1.11.0
-cd googletest # Main directory of the cloned repository.
-mkdir build # Create a directory to hold the build output.
-cd build
-cmake .. # Generate native build scripts for GoogleTest.
-```
-
-The above command also includes GoogleMock by default. And so, if you want to
-build only GoogleTest, you should replace the last command with
-
-```
-cmake .. -DBUILD_GMOCK=OFF
-```
-
-If you are on a \*nix system, you should now see a Makefile in the current
-directory. Just type `make` to build GoogleTest. And then you can simply install
-GoogleTest if you are a system administrator.
-
-```
-make
-sudo make install # Install in /usr/local/ by default
-```
-
-If you use Windows and have Visual Studio installed, a `gtest.sln` file and
-several `.vcproj` files will be created. You can then build them using Visual
-Studio.
-
-On Mac OS X with Xcode installed, a `.xcodeproj` file will be generated.
-
-#### Incorporating Into An Existing CMake Project
-
-If you want to use GoogleTest in a project which already uses CMake, the easiest
-way is to get installed libraries and headers.
-
-* Import GoogleTest by using `find_package` (or `pkg_check_modules`). For
- example, if `find_package(GTest CONFIG REQUIRED)` succeeds, you can use the
- libraries as `GTest::gtest`, `GTest::gmock`.
-
-And a more robust and flexible approach is to build GoogleTest as part of that
-project directly. This is done by making the GoogleTest source code available to
-the main build and adding it using CMake's `add_subdirectory()` command. This
-has the significant advantage that the same compiler and linker settings are
-used between GoogleTest and the rest of your project, so issues associated with
-using incompatible libraries (eg debug/release), etc. are avoided. This is
-particularly useful on Windows. Making GoogleTest's source code available to the
-main build can be done a few different ways:
-
-* Download the GoogleTest source code manually and place it at a known
- location. This is the least flexible approach and can make it more difficult
- to use with continuous integration systems, etc.
-* Embed the GoogleTest source code as a direct copy in the main project's
- source tree. This is often the simplest approach, but is also the hardest to
- keep up to date. Some organizations may not permit this method.
-* Add GoogleTest as a git submodule or equivalent. This may not always be
- possible or appropriate. Git submodules, for example, have their own set of
- advantages and drawbacks.
-* Use CMake to download GoogleTest as part of the build's configure step. This
- approach doesn't have the limitations of the other methods.
-
-The last of the above methods is implemented with a small piece of CMake code
-that downloads and pulls the GoogleTest code into the main build.
-
-Just add to your `CMakeLists.txt`:
-
-```cmake
-include(FetchContent)
-FetchContent_Declare(
- googletest
- # Specify the commit you depend on and update it regularly.
- URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip
-)
-# For Windows: Prevent overriding the parent project's compiler/linker settings
-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-FetchContent_MakeAvailable(googletest)
-
-# Now simply link against gtest or gtest_main as needed. Eg
-add_executable(example example.cpp)
-target_link_libraries(example gtest_main)
-add_test(NAME example_test COMMAND example)
-```
-
-Note that this approach requires CMake 3.14 or later due to its use of the
-`FetchContent_MakeAvailable()` command.
-
-##### Visual Studio Dynamic vs Static Runtimes
-
-By default, new Visual Studio projects link the C runtimes dynamically but
-GoogleTest links them statically. This will generate an error that looks
-something like the following: gtest.lib(gtest-all.obj) : error LNK2038: mismatch
-detected for 'RuntimeLibrary': value 'MTd_StaticDebug' doesn't match value
-'MDd_DynamicDebug' in main.obj
-
-GoogleTest already has a CMake option for this: `gtest_force_shared_crt`
-
-Enabling this option will make gtest link the runtimes dynamically too, and
-match the project in which it is included.
-
-#### C++ Standard Version
-
-An environment that supports C++11 is required in order to successfully build
-GoogleTest. One way to ensure this is to specify the standard in the top-level
-project, for example by using the `set(CMAKE_CXX_STANDARD 11)` command. If this
-is not feasible, for example in a C project using GoogleTest for validation,
-then it can be specified by adding it to the options for cmake via the
-`DCMAKE_CXX_FLAGS` option.
-
-### Tweaking GoogleTest
-
-GoogleTest can be used in diverse environments. The default configuration may
-not work (or may not work well) out of the box in some environments. However,
-you can easily tweak GoogleTest by defining control macros on the compiler
-command line. Generally, these macros are named like `GTEST_XYZ` and you define
-them to either 1 or 0 to enable or disable a certain feature.
-
-We list the most frequently used macros below. For a complete list, see file
-[include/gtest/internal/gtest-port.h](https://github.com/google/googletest/blob/master/googletest/include/gtest/internal/gtest-port.h).
-
-### Multi-threaded Tests
-
-GoogleTest is thread-safe where the pthread library is available. After
-`#include "gtest/gtest.h"`, you can check the
-`GTEST_IS_THREADSAFE` macro to see whether this is the case (yes if the macro is
-`#defined` to 1, no if it's undefined.).
-
-If GoogleTest doesn't correctly detect whether pthread is available in your
-environment, you can force it with
-
- -DGTEST_HAS_PTHREAD=1
-
-or
-
- -DGTEST_HAS_PTHREAD=0
-
-When GoogleTest uses pthread, you may need to add flags to your compiler and/or
-linker to select the pthread library, or you'll get link errors. If you use the
-CMake script, this is taken care of for you. If you use your own build script,
-you'll need to read your compiler and linker's manual to figure out what flags
-to add.
-
-### As a Shared Library (DLL)
-
-GoogleTest is compact, so most users can build and link it as a static library
-for the simplicity. You can choose to use GoogleTest as a shared library (known
-as a DLL on Windows) if you prefer.
-
-To compile *gtest* as a shared library, add
-
- -DGTEST_CREATE_SHARED_LIBRARY=1
-
-to the compiler flags. You'll also need to tell the linker to produce a shared
-library instead - consult your linker's manual for how to do it.
-
-To compile your *tests* that use the gtest shared library, add
-
- -DGTEST_LINKED_AS_SHARED_LIBRARY=1
-
-to the compiler flags.
-
-Note: while the above steps aren't technically necessary today when using some
-compilers (e.g. GCC), they may become necessary in the future, if we decide to
-improve the speed of loading the library (see
-<http://gcc.gnu.org/wiki/Visibility> for details). Therefore you are recommended
-to always add the above flags when using GoogleTest as a shared library.
-Otherwise a future release of GoogleTest may break your build script.
-
-### Avoiding Macro Name Clashes
-
-In C++, macros don't obey namespaces. Therefore two libraries that both define a
-macro of the same name will clash if you `#include` both definitions. In case a
-GoogleTest macro clashes with another library, you can force GoogleTest to
-rename its macro to avoid the conflict.
-
-Specifically, if both GoogleTest and some other code define macro FOO, you can
-add
-
- -DGTEST_DONT_DEFINE_FOO=1
-
-to the compiler flags to tell GoogleTest to change the macro's name from `FOO`
-to `GTEST_FOO`. Currently `FOO` can be `ASSERT_EQ`, `ASSERT_FALSE`, `ASSERT_GE`,
-`ASSERT_GT`, `ASSERT_LE`, `ASSERT_LT`, `ASSERT_NE`, `ASSERT_TRUE`,
-`EXPECT_FALSE`, `EXPECT_TRUE`, `FAIL`, `SUCCEED`, `TEST`, or `TEST_F`. For
-example, with `-DGTEST_DONT_DEFINE_TEST=1`, you'll need to write
-
- GTEST_TEST(SomeTest, DoesThis) { ... }
-
-instead of
-
- TEST(SomeTest, DoesThis) { ... }
-
-in order to define a test.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/Config.cmake.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/Config.cmake.in
deleted file mode 100644
index 12be4498b1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/Config.cmake.in
+++ /dev/null
@@ -1,9 +0,0 @@
-@PACKAGE_INIT@
-include(CMakeFindDependencyMacro)
-if (@GTEST_HAS_PTHREAD@)
- set(THREADS_PREFER_PTHREAD_FLAG @THREADS_PREFER_PTHREAD_FLAG@)
- find_dependency(Threads)
-endif()
-
-include("${CMAKE_CURRENT_LIST_DIR}/@targets_export_name@.cmake")
-check_required_components("@project_name@")
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest.pc.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest.pc.in
deleted file mode 100644
index b4148fae42..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gtest
-Description: GoogleTest (without main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Libs: -L${libdir} -lgtest @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest_main.pc.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest_main.pc.in
deleted file mode 100644
index 38c88c54d5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/gtest_main.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
-libdir=@CMAKE_INSTALL_FULL_LIBDIR@
-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
-
-Name: gtest_main
-Description: GoogleTest (with main() function)
-Version: @PROJECT_VERSION@
-URL: https://github.com/google/googletest
-Requires: gtest = @PROJECT_VERSION@
-Libs: -L${libdir} -lgtest_main @CMAKE_THREAD_LIBS_INIT@
-Cflags: -I${includedir} @GTEST_HAS_PTHREAD_MACRO@
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/internal_utils.cmake b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/internal_utils.cmake
deleted file mode 100644
index 0c7983aeae..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/internal_utils.cmake
+++ /dev/null
@@ -1,346 +0,0 @@
-# Defines functions and macros useful for building Google Test and
-# Google Mock.
-#
-# Note:
-#
-# - This file will be run twice when building Google Mock (once via
-# Google Test's CMakeLists.txt, and once via Google Mock's).
-# Therefore it shouldn't have any side effects other than defining
-# the functions and macros.
-#
-# - The functions/macros defined in this file may depend on Google
-# Test and Google Mock's option() definitions, and thus must be
-# called *after* the options have been defined.
-
-if (POLICY CMP0054)
- cmake_policy(SET CMP0054 NEW)
-endif (POLICY CMP0054)
-
-# Tweaks CMake's default compiler/linker settings to suit Google Test's needs.
-#
-# This must be a macro(), as inside a function string() can only
-# update variables in the function scope.
-macro(fix_default_compiler_settings_)
- if (MSVC)
- # For MSVC, CMake sets certain flags to defaults we want to override.
- # This replacement code is taken from sample in the CMake Wiki at
- # https://gitlab.kitware.com/cmake/community/wikis/FAQ#dynamic-replace.
- foreach (flag_var
- CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE
- CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO
- CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE
- CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
- if (NOT BUILD_SHARED_LIBS AND NOT gtest_force_shared_crt)
- # When Google Test is built as a shared library, it should also use
- # shared runtime libraries. Otherwise, it may end up with multiple
- # copies of runtime library data in different modules, resulting in
- # hard-to-find crashes. When it is built as a static library, it is
- # preferable to use CRT as static libraries, as we don't have to rely
- # on CRT DLLs being available. CMake always defaults to using shared
- # CRT libraries, so we override that default here.
- string(REPLACE "/MD" "-MT" ${flag_var} "${${flag_var}}")
- endif()
-
- # We prefer more strict warning checking for building Google Test.
- # Replaces /W3 with /W4 in defaults.
- string(REPLACE "/W3" "/W4" ${flag_var} "${${flag_var}}")
-
- # Prevent D9025 warning for targets that have exception handling
- # turned off (/EHs-c- flag). Where required, exceptions are explicitly
- # re-enabled using the cxx_exception_flags variable.
- string(REPLACE "/EHsc" "" ${flag_var} "${${flag_var}}")
- endforeach()
- endif()
-endmacro()
-
-# Defines the compiler/linker flags used to build Google Test and
-# Google Mock. You can tweak these definitions to suit your need. A
-# variable's value is empty before it's explicitly assigned to.
-macro(config_compiler_and_linker)
- # Note: pthreads on MinGW is not supported, even if available
- # instead, we use windows threading primitives
- unset(GTEST_HAS_PTHREAD)
- if (NOT gtest_disable_pthreads AND NOT MINGW)
- # Defines CMAKE_USE_PTHREADS_INIT and CMAKE_THREAD_LIBS_INIT.
- find_package(Threads)
- if (CMAKE_USE_PTHREADS_INIT)
- set(GTEST_HAS_PTHREAD ON)
- endif()
- endif()
-
- fix_default_compiler_settings_()
- if (MSVC)
- # Newlines inside flags variables break CMake's NMake generator.
- # TODO(vladl@google.com): Add -RTCs and -RTCu to debug builds.
- set(cxx_base_flags "-GS -W4 -WX -wd4251 -wd4275 -nologo -J")
- set(cxx_base_flags "${cxx_base_flags} -D_UNICODE -DUNICODE -DWIN32 -D_WIN32")
- set(cxx_base_flags "${cxx_base_flags} -DSTRICT -DWIN32_LEAN_AND_MEAN")
- set(cxx_exception_flags "-EHsc -D_HAS_EXCEPTIONS=1")
- set(cxx_no_exception_flags "-EHs-c- -D_HAS_EXCEPTIONS=0")
- set(cxx_no_rtti_flags "-GR-")
- # Suppress "unreachable code" warning
- # http://stackoverflow.com/questions/3232669 explains the issue.
- set(cxx_base_flags "${cxx_base_flags} -wd4702")
- # Ensure MSVC treats source files as UTF-8 encoded.
- set(cxx_base_flags "${cxx_base_flags} -utf-8")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- set(cxx_base_flags "-Wall -Wshadow -Wconversion")
- set(cxx_exception_flags "-fexceptions")
- set(cxx_no_exception_flags "-fno-exceptions")
- set(cxx_strict_flags "-W -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wredundant-decls")
- set(cxx_no_rtti_flags "-fno-rtti")
- elseif (CMAKE_COMPILER_IS_GNUCXX)
- set(cxx_base_flags "-Wall -Wshadow")
- if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 7.0.0)
- set(cxx_base_flags "${cxx_base_flags} -Wno-error=dangling-else")
- endif()
- set(cxx_exception_flags "-fexceptions")
- set(cxx_no_exception_flags "-fno-exceptions")
- # Until version 4.3.2, GCC doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
- # explicitly.
- set(cxx_no_rtti_flags "-fno-rtti -DGTEST_HAS_RTTI=0")
- set(cxx_strict_flags
- "-Wextra -Wno-unused-parameter -Wno-missing-field-initializers")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "SunPro")
- set(cxx_exception_flags "-features=except")
- # Sun Pro doesn't provide macros to indicate whether exceptions and
- # RTTI are enabled, so we define GTEST_HAS_* explicitly.
- set(cxx_no_exception_flags "-features=no%except -DGTEST_HAS_EXCEPTIONS=0")
- set(cxx_no_rtti_flags "-features=no%rtti -DGTEST_HAS_RTTI=0")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "VisualAge" OR
- CMAKE_CXX_COMPILER_ID STREQUAL "XL")
- # CMake 2.8 changes Visual Age's compiler ID to "XL".
- set(cxx_exception_flags "-qeh")
- set(cxx_no_exception_flags "-qnoeh")
- # Until version 9.0, Visual Age doesn't define a macro to indicate
- # whether RTTI is enabled. Therefore we define GTEST_HAS_RTTI
- # explicitly.
- set(cxx_no_rtti_flags "-qnortti -DGTEST_HAS_RTTI=0")
- elseif (CMAKE_CXX_COMPILER_ID STREQUAL "HP")
- set(cxx_base_flags "-AA -mt")
- set(cxx_exception_flags "-DGTEST_HAS_EXCEPTIONS=1")
- set(cxx_no_exception_flags "+noeh -DGTEST_HAS_EXCEPTIONS=0")
- # RTTI can not be disabled in HP aCC compiler.
- set(cxx_no_rtti_flags "")
- endif()
-
- # The pthreads library is available and allowed?
- if (DEFINED GTEST_HAS_PTHREAD)
- set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=1")
- else()
- set(GTEST_HAS_PTHREAD_MACRO "-DGTEST_HAS_PTHREAD=0")
- endif()
- set(cxx_base_flags "${cxx_base_flags} ${GTEST_HAS_PTHREAD_MACRO}")
-
- # For building gtest's own tests and samples.
- set(cxx_exception "${cxx_base_flags} ${cxx_exception_flags}")
- set(cxx_no_exception
- "${CMAKE_CXX_FLAGS} ${cxx_base_flags} ${cxx_no_exception_flags}")
- set(cxx_default "${cxx_exception}")
- set(cxx_no_rtti "${cxx_default} ${cxx_no_rtti_flags}")
-
- # For building the gtest libraries.
- set(cxx_strict "${cxx_default} ${cxx_strict_flags}")
-endmacro()
-
-# Defines the gtest & gtest_main libraries. User tests should link
-# with one of them.
-function(cxx_library_with_type name type cxx_flags)
- # type can be either STATIC or SHARED to denote a static or shared library.
- # ARGN refers to additional arguments after 'cxx_flags'.
- add_library(${name} ${type} ${ARGN})
- add_library(${cmake_package_name}::${name} ALIAS ${name})
- set_target_properties(${name}
- PROPERTIES
- COMPILE_FLAGS "${cxx_flags}")
- # Generate debug library name with a postfix.
- set_target_properties(${name}
- PROPERTIES
- DEBUG_POSTFIX "d")
- # Set the output directory for build artifacts
- set_target_properties(${name}
- PROPERTIES
- RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
- ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
- PDB_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
- # make PDBs match library name
- get_target_property(pdb_debug_postfix ${name} DEBUG_POSTFIX)
- set_target_properties(${name}
- PROPERTIES
- PDB_NAME "${name}"
- PDB_NAME_DEBUG "${name}${pdb_debug_postfix}"
- COMPILE_PDB_NAME "${name}"
- COMPILE_PDB_NAME_DEBUG "${name}${pdb_debug_postfix}")
-
- if (BUILD_SHARED_LIBS OR type STREQUAL "SHARED")
- set_target_properties(${name}
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1")
- if (NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
- target_compile_definitions(${name} INTERFACE
- $<INSTALL_INTERFACE:GTEST_LINKED_AS_SHARED_LIBRARY=1>)
- endif()
- endif()
- if (DEFINED GTEST_HAS_PTHREAD)
- if ("${CMAKE_VERSION}" VERSION_LESS "3.1.0")
- set(threads_spec ${CMAKE_THREAD_LIBS_INIT})
- else()
- set(threads_spec Threads::Threads)
- endif()
- target_link_libraries(${name} PUBLIC ${threads_spec})
- endif()
-
- if (NOT "${CMAKE_VERSION}" VERSION_LESS "3.8")
- target_compile_features(${name} PUBLIC cxx_std_11)
- endif()
-endfunction()
-
-########################################################################
-#
-# Helper functions for creating build targets.
-
-function(cxx_shared_library name cxx_flags)
- cxx_library_with_type(${name} SHARED "${cxx_flags}" ${ARGN})
-endfunction()
-
-function(cxx_library name cxx_flags)
- cxx_library_with_type(${name} "" "${cxx_flags}" ${ARGN})
-endfunction()
-
-# cxx_executable_with_flags(name cxx_flags libs srcs...)
-#
-# creates a named C++ executable that depends on the given libraries and
-# is built from the given source files with the given compiler flags.
-function(cxx_executable_with_flags name cxx_flags libs)
- add_executable(${name} ${ARGN})
- if (MSVC)
- # BigObj required for tests.
- set(cxx_flags "${cxx_flags} -bigobj")
- endif()
- if (cxx_flags)
- set_target_properties(${name}
- PROPERTIES
- COMPILE_FLAGS "${cxx_flags}")
- endif()
- if (BUILD_SHARED_LIBS)
- set_target_properties(${name}
- PROPERTIES
- COMPILE_DEFINITIONS "GTEST_LINKED_AS_SHARED_LIBRARY=1")
- endif()
- # To support mixing linking in static and dynamic libraries, link each
- # library in with an extra call to target_link_libraries.
- foreach (lib "${libs}")
- target_link_libraries(${name} ${lib})
- endforeach()
-endfunction()
-
-# cxx_executable(name dir lib srcs...)
-#
-# creates a named target that depends on the given libs and is built
-# from the given source files. dir/name.cc is implicitly included in
-# the source file list.
-function(cxx_executable name dir libs)
- cxx_executable_with_flags(
- ${name} "${cxx_default}" "${libs}" "${dir}/${name}.cc" ${ARGN})
-endfunction()
-
-# Sets PYTHONINTERP_FOUND and PYTHON_EXECUTABLE.
-if ("${CMAKE_VERSION}" VERSION_LESS "3.12.0")
- find_package(PythonInterp)
-else()
- find_package(Python COMPONENTS Interpreter)
- set(PYTHONINTERP_FOUND ${Python_Interpreter_FOUND})
- set(PYTHON_EXECUTABLE ${Python_EXECUTABLE})
-endif()
-
-# cxx_test_with_flags(name cxx_flags libs srcs...)
-#
-# creates a named C++ test that depends on the given libs and is built
-# from the given source files with the given compiler flags.
-function(cxx_test_with_flags name cxx_flags libs)
- cxx_executable_with_flags(${name} "${cxx_flags}" "${libs}" ${ARGN})
- add_test(NAME ${name} COMMAND "$<TARGET_FILE:${name}>")
-endfunction()
-
-# cxx_test(name libs srcs...)
-#
-# creates a named test target that depends on the given libs and is
-# built from the given source files. Unlike cxx_test_with_flags,
-# test/name.cc is already implicitly included in the source file list.
-function(cxx_test name libs)
- cxx_test_with_flags("${name}" "${cxx_default}" "${libs}"
- "test/${name}.cc" ${ARGN})
-endfunction()
-
-# py_test(name)
-#
-# creates a Python test with the given name whose main module is in
-# test/name.py. It does nothing if Python is not installed.
-function(py_test name)
- if (PYTHONINTERP_FOUND)
- if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" VERSION_GREATER 3.1)
- if (CMAKE_CONFIGURATION_TYPES)
- # Multi-configuration build generators as for Visual Studio save
- # output in a subdirectory of CMAKE_CURRENT_BINARY_DIR (Debug,
- # Release etc.), so we have to provide it here.
- add_test(NAME ${name}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
- --build_dir=${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG> ${ARGN})
- else (CMAKE_CONFIGURATION_TYPES)
- # Single-configuration build generators like Makefile generators
- # don't have subdirs below CMAKE_CURRENT_BINARY_DIR.
- add_test(NAME ${name}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
- --build_dir=${CMAKE_CURRENT_BINARY_DIR} ${ARGN})
- endif (CMAKE_CONFIGURATION_TYPES)
- else()
- # ${CMAKE_CURRENT_BINARY_DIR} is known at configuration time, so we can
- # directly bind it from cmake. ${CTEST_CONFIGURATION_TYPE} is known
- # only at ctest runtime (by calling ctest -c <Configuration>), so
- # we have to escape $ to delay variable substitution here.
- add_test(NAME ${name}
- COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test/${name}.py
- --build_dir=${CMAKE_CURRENT_BINARY_DIR}/\${CTEST_CONFIGURATION_TYPE} ${ARGN})
- endif()
- # Make the Python import path consistent between Bazel and CMake.
- set_tests_properties(${name} PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_SOURCE_DIR})
- endif(PYTHONINTERP_FOUND)
-endfunction()
-
-# install_project(targets...)
-#
-# Installs the specified targets and configures the associated pkgconfig files.
-function(install_project)
- if(INSTALL_GTEST)
- install(DIRECTORY "${PROJECT_SOURCE_DIR}/include/"
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
- # Install the project targets.
- install(TARGETS ${ARGN}
- EXPORT ${targets_export_name}
- RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
- ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
- LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
- if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
- # Install PDBs
- foreach(t ${ARGN})
- get_target_property(t_pdb_name ${t} COMPILE_PDB_NAME)
- get_target_property(t_pdb_name_debug ${t} COMPILE_PDB_NAME_DEBUG)
- get_target_property(t_pdb_output_directory ${t} PDB_OUTPUT_DIRECTORY)
- install(FILES
- "${t_pdb_output_directory}/\${CMAKE_INSTALL_CONFIG_NAME}/$<$<CONFIG:Debug>:${t_pdb_name_debug}>$<$<NOT:$<CONFIG:Debug>>:${t_pdb_name}>.pdb"
- DESTINATION ${CMAKE_INSTALL_LIBDIR}
- OPTIONAL)
- endforeach()
- endif()
- # Configure and install pkgconfig files.
- foreach(t ${ARGN})
- set(configured_pc "${generated_dir}/${t}.pc")
- configure_file("${PROJECT_SOURCE_DIR}/cmake/${t}.pc.in"
- "${configured_pc}" @ONLY)
- install(FILES "${configured_pc}"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
- endforeach()
- endif()
-endfunction()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/libgtest.la.in b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/libgtest.la.in
deleted file mode 100644
index 840c83885f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/cmake/libgtest.la.in
+++ /dev/null
@@ -1,21 +0,0 @@
-# libgtest.la - a libtool library file
-# Generated by libtool (GNU libtool) 2.4.6
-
-# Please DO NOT delete this file!
-# It is necessary for linking the library.
-
-# Names of this library.
-library_names='libgtest.so'
-
-# Is this an already installed library?
-installed=yes
-
-# Should we warn about portability when linking against -modules?
-shouldnotlink=no
-
-# Files to dlopen/dlpreopen
-dlopen=''
-dlpreopen=''
-
-# Directory that this library needs to be installed in:
-libdir='@CMAKE_INSTALL_FULL_LIBDIR@'
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/docs/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/docs/README.md
deleted file mode 100644
index 1bc57b799c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/docs/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Content Moved
-
-We are working on updates to the GoogleTest documentation, which has moved to
-the top-level [docs](../../docs) directory.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-assertion-result.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-assertion-result.h
deleted file mode 100644
index e020c48943..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-assertion-result.h
+++ /dev/null
@@ -1,232 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file implements the AssertionResult type.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_ASSERTION_RESULT_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_ASSERTION_RESULT_H_
-
-#include <memory>
-#include <ostream>
-#include <string>
-#include <type_traits>
-
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-
-// A class for indicating whether an assertion was successful. When
-// the assertion wasn't successful, the AssertionResult object
-// remembers a non-empty message that describes how it failed.
-//
-// To create an instance of this class, use one of the factory functions
-// (AssertionSuccess() and AssertionFailure()).
-//
-// This class is useful for two purposes:
-// 1. Defining predicate functions to be used with Boolean test assertions
-// EXPECT_TRUE/EXPECT_FALSE and their ASSERT_ counterparts
-// 2. Defining predicate-format functions to be
-// used with predicate assertions (ASSERT_PRED_FORMAT*, etc).
-//
-// For example, if you define IsEven predicate:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then the failed expectation EXPECT_TRUE(IsEven(Fib(5)))
-// will print the message
-//
-// Value of: IsEven(Fib(5))
-// Actual: false (5 is odd)
-// Expected: true
-//
-// instead of a more opaque
-//
-// Value of: IsEven(Fib(5))
-// Actual: false
-// Expected: true
-//
-// in case IsEven is a simple Boolean predicate.
-//
-// If you expect your predicate to be reused and want to support informative
-// messages in EXPECT_FALSE and ASSERT_FALSE (negative assertions show up
-// about half as often as positive ones in our tests), supply messages for
-// both success and failure cases:
-//
-// testing::AssertionResult IsEven(int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess() << n << " is even";
-// else
-// return testing::AssertionFailure() << n << " is odd";
-// }
-//
-// Then a statement EXPECT_FALSE(IsEven(Fib(6))) will print
-//
-// Value of: IsEven(Fib(6))
-// Actual: true (8 is even)
-// Expected: false
-//
-// NB: Predicates that support negative Boolean assertions have reduced
-// performance in positive ones so be careful not to use them in tests
-// that have lots (tens of thousands) of positive Boolean assertions.
-//
-// To use this class with EXPECT_PRED_FORMAT assertions such as:
-//
-// // Verifies that Foo() returns an even number.
-// EXPECT_PRED_FORMAT1(IsEven, Foo());
-//
-// you need to define:
-//
-// testing::AssertionResult IsEven(const char* expr, int n) {
-// if ((n % 2) == 0)
-// return testing::AssertionSuccess();
-// else
-// return testing::AssertionFailure()
-// << "Expected: " << expr << " is even\n Actual: it's " << n;
-// }
-//
-// If Foo() returns 5, you will see the following message:
-//
-// Expected: Foo() is even
-// Actual: it's 5
-//
-class GTEST_API_ AssertionResult {
- public:
- // Copy constructor.
- // Used in EXPECT_TRUE/FALSE(assertion_result).
- AssertionResult(const AssertionResult& other);
-
-// C4800 is a level 3 warning in Visual Studio 2015 and earlier.
-// This warning is not emitted in Visual Studio 2017.
-// This warning is off by default starting in Visual Studio 2019 but can be
-// enabled with command-line options.
-#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920)
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 /* forcing value to bool */)
-#endif
-
- // Used in the EXPECT_TRUE/FALSE(bool_expression).
- //
- // T must be contextually convertible to bool.
- //
- // The second parameter prevents this overload from being considered if
- // the argument is implicitly convertible to AssertionResult. In that case
- // we want AssertionResult's copy constructor to be used.
- template <typename T>
- explicit AssertionResult(
- const T& success,
- typename std::enable_if<
- !std::is_convertible<T, AssertionResult>::value>::type*
- /*enabler*/
- = nullptr)
- : success_(success) {}
-
-#if defined(_MSC_VER) && (_MSC_VER < 1910 || _MSC_VER >= 1920)
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-#endif
-
- // Assignment operator.
- AssertionResult& operator=(AssertionResult other) {
- swap(other);
- return *this;
- }
-
- // Returns true if and only if the assertion succeeded.
- operator bool() const { return success_; } // NOLINT
-
- // Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
- AssertionResult operator!() const;
-
- // Returns the text streamed into this AssertionResult. Test assertions
- // use it when they fail (i.e., the predicate's outcome doesn't match the
- // assertion's expectation). When nothing has been streamed into the
- // object, returns an empty string.
- const char* message() const {
- return message_.get() != nullptr ? message_->c_str() : "";
- }
- // Deprecated; please use message() instead.
- const char* failure_message() const { return message(); }
-
- // Streams a custom failure message into this object.
- template <typename T>
- AssertionResult& operator<<(const T& value) {
- AppendMessage(Message() << value);
- return *this;
- }
-
- // Allows streaming basic output manipulators such as endl or flush into
- // this object.
- AssertionResult& operator<<(
- ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
- AppendMessage(Message() << basic_manipulator);
- return *this;
- }
-
- private:
- // Appends the contents of message to message_.
- void AppendMessage(const Message& a_message) {
- if (message_.get() == nullptr) message_.reset(new ::std::string);
- message_->append(a_message.GetString().c_str());
- }
-
- // Swap the contents of this AssertionResult with other.
- void swap(AssertionResult& other);
-
- // Stores result of the assertion predicate.
- bool success_;
- // Stores the message describing the condition in case the expectation
- // construct is not satisfied with the predicate's outcome.
- // Referenced via a pointer to avoid taking too much stack frame space
- // with test assertions.
- std::unique_ptr< ::std::string> message_;
-};
-
-// Makes a successful assertion result.
-GTEST_API_ AssertionResult AssertionSuccess();
-
-// Makes a failed assertion result.
-GTEST_API_ AssertionResult AssertionFailure();
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << msg.
-GTEST_API_ AssertionResult AssertionFailure(const Message& msg);
-
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_ASSERTION_RESULT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-death-test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-death-test.h
deleted file mode 100644
index cd34e1f2e8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-death-test.h
+++ /dev/null
@@ -1,346 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file defines the public API for death tests. It is
-// #included by gtest.h so a user doesn't need to include this
-// directly.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
-
-#include "gtest/internal/gtest-death-test-internal.h"
-
-// This flag controls the style of death tests. Valid values are "threadsafe",
-// meaning that the death test child process will re-execute the test binary
-// from the start, running only a single death test, or "fast",
-// meaning that the child process will execute the test logic immediately
-// after forking.
-GTEST_DECLARE_string_(death_test_style);
-
-namespace testing {
-
-#if GTEST_HAS_DEATH_TEST
-
-namespace internal {
-
-// Returns a Boolean value indicating whether the caller is currently
-// executing in the context of the death test child process. Tools such as
-// Valgrind heap checkers may need this to modify their behavior in death
-// tests. IMPORTANT: This is an internal utility. Using it may break the
-// implementation of death tests. User code MUST NOT use it.
-GTEST_API_ bool InDeathTestChild();
-
-} // namespace internal
-
-// The following macros are useful for writing death tests.
-
-// Here's what happens when an ASSERT_DEATH* or EXPECT_DEATH* is
-// executed:
-//
-// 1. It generates a warning if there is more than one active
-// thread. This is because it's safe to fork() or clone() only
-// when there is a single thread.
-//
-// 2. The parent process clone()s a sub-process and runs the death
-// test in it; the sub-process exits with code 0 at the end of the
-// death test, if it hasn't exited already.
-//
-// 3. The parent process waits for the sub-process to terminate.
-//
-// 4. The parent process checks the exit code and error message of
-// the sub-process.
-//
-// Examples:
-//
-// ASSERT_DEATH(server.SendMessage(56, "Hello"), "Invalid port number");
-// for (int i = 0; i < 5; i++) {
-// EXPECT_DEATH(server.ProcessRequest(i),
-// "Invalid request .* in ProcessRequest()")
-// << "Failed to die on request " << i;
-// }
-//
-// ASSERT_EXIT(server.ExitNow(), ::testing::ExitedWithCode(0), "Exiting");
-//
-// bool KilledBySIGHUP(int exit_code) {
-// return WIFSIGNALED(exit_code) && WTERMSIG(exit_code) == SIGHUP;
-// }
-//
-// ASSERT_EXIT(client.HangUpServer(), KilledBySIGHUP, "Hanging up!");
-//
-// The final parameter to each of these macros is a matcher applied to any data
-// the sub-process wrote to stderr. For compatibility with existing tests, a
-// bare string is interpreted as a regular expression matcher.
-//
-// On the regular expressions used in death tests:
-//
-// On POSIX-compliant systems (*nix), we use the <regex.h> library,
-// which uses the POSIX extended regex syntax.
-//
-// On other platforms (e.g. Windows or Mac), we only support a simple regex
-// syntax implemented as part of Google Test. This limited
-// implementation should be enough most of the time when writing
-// death tests; though it lacks many features you can find in PCRE
-// or POSIX extended regex syntax. For example, we don't support
-// union ("x|y"), grouping ("(xy)"), brackets ("[xy]"), and
-// repetition count ("x{5,7}"), among others.
-//
-// Below is the syntax that we do support. We chose it to be a
-// subset of both PCRE and POSIX extended regex, so it's easy to
-// learn wherever you come from. In the following: 'A' denotes a
-// literal character, period (.), or a single \\ escape sequence;
-// 'x' and 'y' denote regular expressions; 'm' and 'n' are for
-// natural numbers.
-//
-// c matches any literal character c
-// \\d matches any decimal digit
-// \\D matches any character that's not a decimal digit
-// \\f matches \f
-// \\n matches \n
-// \\r matches \r
-// \\s matches any ASCII whitespace, including \n
-// \\S matches any character that's not a whitespace
-// \\t matches \t
-// \\v matches \v
-// \\w matches any letter, _, or decimal digit
-// \\W matches any character that \\w doesn't match
-// \\c matches any literal character c, which must be a punctuation
-// . matches any single character except \n
-// A? matches 0 or 1 occurrences of A
-// A* matches 0 or many occurrences of A
-// A+ matches 1 or many occurrences of A
-// ^ matches the beginning of a string (not that of each line)
-// $ matches the end of a string (not that of each line)
-// xy matches x followed by y
-//
-// If you accidentally use PCRE or POSIX extended regex features
-// not implemented by us, you will get a run-time failure. In that
-// case, please try to rewrite your regular expression within the
-// above syntax.
-//
-// This implementation is *not* meant to be as highly tuned or robust
-// as a compiled regex library, but should perform well enough for a
-// death test, which already incurs significant overhead by launching
-// a child process.
-//
-// Known caveats:
-//
-// A "threadsafe" style death test obtains the path to the test
-// program from argv[0] and re-executes it in the sub-process. For
-// simplicity, the current implementation doesn't search the PATH
-// when launching the sub-process. This means that the user must
-// invoke the test program via a path that contains at least one
-// path separator (e.g. path/to/foo_test and
-// /absolute/path/to/bar_test are fine, but foo_test is not). This
-// is rarely a problem as people usually don't put the test binary
-// directory in PATH.
-//
-
-// Asserts that a given `statement` causes the program to exit, with an
-// integer exit status that satisfies `predicate`, and emitting error output
-// that matches `matcher`.
-# define ASSERT_EXIT(statement, predicate, matcher) \
- GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_FATAL_FAILURE_)
-
-// Like `ASSERT_EXIT`, but continues on to successive tests in the
-// test suite, if any:
-# define EXPECT_EXIT(statement, predicate, matcher) \
- GTEST_DEATH_TEST_(statement, predicate, matcher, GTEST_NONFATAL_FAILURE_)
-
-// Asserts that a given `statement` causes the program to exit, either by
-// explicitly exiting with a nonzero exit code or being killed by a
-// signal, and emitting error output that matches `matcher`.
-# define ASSERT_DEATH(statement, matcher) \
- ASSERT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher)
-
-// Like `ASSERT_DEATH`, but continues on to successive tests in the
-// test suite, if any:
-# define EXPECT_DEATH(statement, matcher) \
- EXPECT_EXIT(statement, ::testing::internal::ExitedUnsuccessfully, matcher)
-
-// Two predicate classes that can be used in {ASSERT,EXPECT}_EXIT*:
-
-// Tests that an exit code describes a normal exit with a given exit code.
-class GTEST_API_ ExitedWithCode {
- public:
- explicit ExitedWithCode(int exit_code);
- ExitedWithCode(const ExitedWithCode&) = default;
- void operator=(const ExitedWithCode& other) = delete;
- bool operator()(int exit_status) const;
- private:
- const int exit_code_;
-};
-
-# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-// Tests that an exit code describes an exit due to termination by a
-// given signal.
-class GTEST_API_ KilledBySignal {
- public:
- explicit KilledBySignal(int signum);
- bool operator()(int exit_status) const;
- private:
- const int signum_;
-};
-# endif // !GTEST_OS_WINDOWS
-
-// EXPECT_DEBUG_DEATH asserts that the given statements die in debug mode.
-// The death testing framework causes this to have interesting semantics,
-// since the sideeffects of the call are only visible in opt mode, and not
-// in debug mode.
-//
-// In practice, this can be used to test functions that utilize the
-// LOG(DFATAL) macro using the following style:
-//
-// int DieInDebugOr12(int* sideeffect) {
-// if (sideeffect) {
-// *sideeffect = 12;
-// }
-// LOG(DFATAL) << "death";
-// return 12;
-// }
-//
-// TEST(TestSuite, TestDieOr12WorksInDgbAndOpt) {
-// int sideeffect = 0;
-// // Only asserts in dbg.
-// EXPECT_DEBUG_DEATH(DieInDebugOr12(&sideeffect), "death");
-//
-// #ifdef NDEBUG
-// // opt-mode has sideeffect visible.
-// EXPECT_EQ(12, sideeffect);
-// #else
-// // dbg-mode no visible sideeffect.
-// EXPECT_EQ(0, sideeffect);
-// #endif
-// }
-//
-// This will assert that DieInDebugReturn12InOpt() crashes in debug
-// mode, usually due to a DCHECK or LOG(DFATAL), but returns the
-// appropriate fallback value (12 in this case) in opt mode. If you
-// need to test that a function has appropriate side-effects in opt
-// mode, include assertions against the side-effects. A general
-// pattern for this is:
-//
-// EXPECT_DEBUG_DEATH({
-// // Side-effects here will have an effect after this statement in
-// // opt mode, but none in debug mode.
-// EXPECT_EQ(12, DieInDebugOr12(&sideeffect));
-// }, "death");
-//
-# ifdef NDEBUG
-
-# define EXPECT_DEBUG_DEATH(statement, regex) \
- GTEST_EXECUTE_STATEMENT_(statement, regex)
-
-# define ASSERT_DEBUG_DEATH(statement, regex) \
- GTEST_EXECUTE_STATEMENT_(statement, regex)
-
-# else
-
-# define EXPECT_DEBUG_DEATH(statement, regex) \
- EXPECT_DEATH(statement, regex)
-
-# define ASSERT_DEBUG_DEATH(statement, regex) \
- ASSERT_DEATH(statement, regex)
-
-# endif // NDEBUG for EXPECT_DEBUG_DEATH
-#endif // GTEST_HAS_DEATH_TEST
-
-// This macro is used for implementing macros such as
-// EXPECT_DEATH_IF_SUPPORTED and ASSERT_DEATH_IF_SUPPORTED on systems where
-// death tests are not supported. Those macros must compile on such systems
-// if and only if EXPECT_DEATH and ASSERT_DEATH compile with the same parameters
-// on systems that support death tests. This allows one to write such a macro on
-// a system that does not support death tests and be sure that it will compile
-// on a death-test supporting system. It is exposed publicly so that systems
-// that have death-tests with stricter requirements than GTEST_HAS_DEATH_TEST
-// can write their own equivalent of EXPECT_DEATH_IF_SUPPORTED and
-// ASSERT_DEATH_IF_SUPPORTED.
-//
-// Parameters:
-// statement - A statement that a macro such as EXPECT_DEATH would test
-// for program termination. This macro has to make sure this
-// statement is compiled but not executed, to ensure that
-// EXPECT_DEATH_IF_SUPPORTED compiles with a certain
-// parameter if and only if EXPECT_DEATH compiles with it.
-// regex - A regex that a macro such as EXPECT_DEATH would use to test
-// the output of statement. This parameter has to be
-// compiled but not evaluated by this macro, to ensure that
-// this macro only accepts expressions that a macro such as
-// EXPECT_DEATH would accept.
-// terminator - Must be an empty statement for EXPECT_DEATH_IF_SUPPORTED
-// and a return statement for ASSERT_DEATH_IF_SUPPORTED.
-// This ensures that ASSERT_DEATH_IF_SUPPORTED will not
-// compile inside functions where ASSERT_DEATH doesn't
-// compile.
-//
-// The branch that has an always false condition is used to ensure that
-// statement and regex are compiled (and thus syntactically correct) but
-// never executed. The unreachable code macro protects the terminator
-// statement from generating an 'unreachable code' warning in case
-// statement unconditionally returns or throws. The Message constructor at
-// the end allows the syntax of streaming additional messages into the
-// macro, for compilational compatibility with EXPECT_DEATH/ASSERT_DEATH.
-# define GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, terminator) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- GTEST_LOG_(WARNING) \
- << "Death tests are not supported on this platform.\n" \
- << "Statement '" #statement "' cannot be verified."; \
- } else if (::testing::internal::AlwaysFalse()) { \
- ::testing::internal::RE::PartialMatch(".*", (regex)); \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- terminator; \
- } else \
- ::testing::Message()
-
-// EXPECT_DEATH_IF_SUPPORTED(statement, regex) and
-// ASSERT_DEATH_IF_SUPPORTED(statement, regex) expand to real death tests if
-// death tests are supported; otherwise they just issue a warning. This is
-// useful when you are combining death test assertions with normal test
-// assertions in one test.
-#if GTEST_HAS_DEATH_TEST
-# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- EXPECT_DEATH(statement, regex)
-# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- ASSERT_DEATH(statement, regex)
-#else
-# define EXPECT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, )
-# define ASSERT_DEATH_IF_SUPPORTED(statement, regex) \
- GTEST_UNSUPPORTED_DEATH_TEST(statement, regex, return)
-#endif
-
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_DEATH_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-matchers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-matchers.h
deleted file mode 100644
index 3472db7e17..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-matchers.h
+++ /dev/null
@@ -1,934 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file implements just enough of the matcher interface to allow
-// EXPECT_DEATH and friends to accept a matcher argument.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
-
-#include <atomic>
-#include <memory>
-#include <ostream>
-#include <string>
-#include <type_traits>
-
-#include "gtest/gtest-printers.h"
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-
-// MSVC warning C5046 is new as of VS2017 version 15.8.
-#if defined(_MSC_VER) && _MSC_VER >= 1915
-#define GTEST_MAYBE_5046_ 5046
-#else
-#define GTEST_MAYBE_5046_
-#endif
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(
- 4251 GTEST_MAYBE_5046_ /* class A needs to have dll-interface to be used by
- clients of class B */
- /* Symbol involving type with internal linkage not defined */)
-
-namespace testing {
-
-// To implement a matcher Foo for type T, define:
-// 1. a class FooMatcherMatcher that implements the matcher interface:
-// using is_gtest_matcher = void;
-// bool MatchAndExplain(const T&, std::ostream*);
-// (MatchResultListener* can also be used instead of std::ostream*)
-// void DescribeTo(std::ostream*);
-// void DescribeNegationTo(std::ostream*);
-//
-// 2. a factory function that creates a Matcher<T> object from a
-// FooMatcherMatcher.
-
-class MatchResultListener {
- public:
- // Creates a listener object with the given underlying ostream. The
- // listener does not own the ostream, and does not dereference it
- // in the constructor or destructor.
- explicit MatchResultListener(::std::ostream* os) : stream_(os) {}
- virtual ~MatchResultListener() = 0; // Makes this class abstract.
-
- // Streams x to the underlying ostream; does nothing if the ostream
- // is NULL.
- template <typename T>
- MatchResultListener& operator<<(const T& x) {
- if (stream_ != nullptr) *stream_ << x;
- return *this;
- }
-
- // Returns the underlying ostream.
- ::std::ostream* stream() { return stream_; }
-
- // Returns true if and only if the listener is interested in an explanation
- // of the match result. A matcher's MatchAndExplain() method can use
- // this information to avoid generating the explanation when no one
- // intends to hear it.
- bool IsInterested() const { return stream_ != nullptr; }
-
- private:
- ::std::ostream* const stream_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MatchResultListener);
-};
-
-inline MatchResultListener::~MatchResultListener() {
-}
-
-// An instance of a subclass of this knows how to describe itself as a
-// matcher.
-class GTEST_API_ MatcherDescriberInterface {
- public:
- virtual ~MatcherDescriberInterface() {}
-
- // Describes this matcher to an ostream. The function should print
- // a verb phrase that describes the property a value matching this
- // matcher should have. The subject of the verb phrase is the value
- // being matched. For example, the DescribeTo() method of the Gt(7)
- // matcher prints "is greater than 7".
- virtual void DescribeTo(::std::ostream* os) const = 0;
-
- // Describes the negation of this matcher to an ostream. For
- // example, if the description of this matcher is "is greater than
- // 7", the negated description could be "is not greater than 7".
- // You are not required to override this when implementing
- // MatcherInterface, but it is highly advised so that your matcher
- // can produce good error messages.
- virtual void DescribeNegationTo(::std::ostream* os) const {
- *os << "not (";
- DescribeTo(os);
- *os << ")";
- }
-};
-
-// The implementation of a matcher.
-template <typename T>
-class MatcherInterface : public MatcherDescriberInterface {
- public:
- // Returns true if and only if the matcher matches x; also explains the
- // match result to 'listener' if necessary (see the next paragraph), in
- // the form of a non-restrictive relative clause ("which ...",
- // "whose ...", etc) that describes x. For example, the
- // MatchAndExplain() method of the Pointee(...) matcher should
- // generate an explanation like "which points to ...".
- //
- // Implementations of MatchAndExplain() should add an explanation of
- // the match result *if and only if* they can provide additional
- // information that's not already present (or not obvious) in the
- // print-out of x and the matcher's description. Whether the match
- // succeeds is not a factor in deciding whether an explanation is
- // needed, as sometimes the caller needs to print a failure message
- // when the match succeeds (e.g. when the matcher is used inside
- // Not()).
- //
- // For example, a "has at least 10 elements" matcher should explain
- // what the actual element count is, regardless of the match result,
- // as it is useful information to the reader; on the other hand, an
- // "is empty" matcher probably only needs to explain what the actual
- // size is when the match fails, as it's redundant to say that the
- // size is 0 when the value is already known to be empty.
- //
- // You should override this method when defining a new matcher.
- //
- // It's the responsibility of the caller (Google Test) to guarantee
- // that 'listener' is not NULL. This helps to simplify a matcher's
- // implementation when it doesn't care about the performance, as it
- // can talk to 'listener' without checking its validity first.
- // However, in order to implement dummy listeners efficiently,
- // listener->stream() may be NULL.
- virtual bool MatchAndExplain(T x, MatchResultListener* listener) const = 0;
-
- // Inherits these methods from MatcherDescriberInterface:
- // virtual void DescribeTo(::std::ostream* os) const = 0;
- // virtual void DescribeNegationTo(::std::ostream* os) const;
-};
-
-namespace internal {
-
-struct AnyEq {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a == b; }
-};
-struct AnyNe {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a != b; }
-};
-struct AnyLt {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a < b; }
-};
-struct AnyGt {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a > b; }
-};
-struct AnyLe {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a <= b; }
-};
-struct AnyGe {
- template <typename A, typename B>
- bool operator()(const A& a, const B& b) const { return a >= b; }
-};
-
-// A match result listener that ignores the explanation.
-class DummyMatchResultListener : public MatchResultListener {
- public:
- DummyMatchResultListener() : MatchResultListener(nullptr) {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DummyMatchResultListener);
-};
-
-// A match result listener that forwards the explanation to a given
-// ostream. The difference between this and MatchResultListener is
-// that the former is concrete.
-class StreamMatchResultListener : public MatchResultListener {
- public:
- explicit StreamMatchResultListener(::std::ostream* os)
- : MatchResultListener(os) {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamMatchResultListener);
-};
-
-struct SharedPayloadBase {
- std::atomic<int> ref{1};
- void Ref() { ref.fetch_add(1, std::memory_order_relaxed); }
- bool Unref() { return ref.fetch_sub(1, std::memory_order_acq_rel) == 1; }
-};
-
-template <typename T>
-struct SharedPayload : SharedPayloadBase {
- explicit SharedPayload(const T& v) : value(v) {}
- explicit SharedPayload(T&& v) : value(std::move(v)) {}
-
- static void Destroy(SharedPayloadBase* shared) {
- delete static_cast<SharedPayload*>(shared);
- }
-
- T value;
-};
-
-// An internal class for implementing Matcher<T>, which will derive
-// from it. We put functionalities common to all Matcher<T>
-// specializations here to avoid code duplication.
-template <typename T>
-class MatcherBase : private MatcherDescriberInterface {
- public:
- // Returns true if and only if the matcher matches x; also explains the
- // match result to 'listener'.
- bool MatchAndExplain(const T& x, MatchResultListener* listener) const {
- GTEST_CHECK_(vtable_ != nullptr);
- return vtable_->match_and_explain(*this, x, listener);
- }
-
- // Returns true if and only if this matcher matches x.
- bool Matches(const T& x) const {
- DummyMatchResultListener dummy;
- return MatchAndExplain(x, &dummy);
- }
-
- // Describes this matcher to an ostream.
- void DescribeTo(::std::ostream* os) const final {
- GTEST_CHECK_(vtable_ != nullptr);
- vtable_->describe(*this, os, false);
- }
-
- // Describes the negation of this matcher to an ostream.
- void DescribeNegationTo(::std::ostream* os) const final {
- GTEST_CHECK_(vtable_ != nullptr);
- vtable_->describe(*this, os, true);
- }
-
- // Explains why x matches, or doesn't match, the matcher.
- void ExplainMatchResultTo(const T& x, ::std::ostream* os) const {
- StreamMatchResultListener listener(os);
- MatchAndExplain(x, &listener);
- }
-
- // Returns the describer for this matcher object; retains ownership
- // of the describer, which is only guaranteed to be alive when
- // this matcher object is alive.
- const MatcherDescriberInterface* GetDescriber() const {
- if (vtable_ == nullptr) return nullptr;
- return vtable_->get_describer(*this);
- }
-
- protected:
- MatcherBase() : vtable_(nullptr) {}
-
- // Constructs a matcher from its implementation.
- template <typename U>
- explicit MatcherBase(const MatcherInterface<U>* impl) {
- Init(impl);
- }
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- MatcherBase(M&& m) { // NOLINT
- Init(std::forward<M>(m));
- }
-
- MatcherBase(const MatcherBase& other)
- : vtable_(other.vtable_), buffer_(other.buffer_) {
- if (IsShared()) buffer_.shared->Ref();
- }
-
- MatcherBase& operator=(const MatcherBase& other) {
- if (this == &other) return *this;
- Destroy();
- vtable_ = other.vtable_;
- buffer_ = other.buffer_;
- if (IsShared()) buffer_.shared->Ref();
- return *this;
- }
-
- MatcherBase(MatcherBase&& other)
- : vtable_(other.vtable_), buffer_(other.buffer_) {
- other.vtable_ = nullptr;
- }
-
- MatcherBase& operator=(MatcherBase&& other) {
- if (this == &other) return *this;
- Destroy();
- vtable_ = other.vtable_;
- buffer_ = other.buffer_;
- other.vtable_ = nullptr;
- return *this;
- }
-
- ~MatcherBase() override { Destroy(); }
-
- private:
- struct VTable {
- bool (*match_and_explain)(const MatcherBase&, const T&,
- MatchResultListener*);
- void (*describe)(const MatcherBase&, std::ostream*, bool negation);
- // Returns the captured object if it implements the interface, otherwise
- // returns the MatcherBase itself.
- const MatcherDescriberInterface* (*get_describer)(const MatcherBase&);
- // Called on shared instances when the reference count reaches 0.
- void (*shared_destroy)(SharedPayloadBase*);
- };
-
- bool IsShared() const {
- return vtable_ != nullptr && vtable_->shared_destroy != nullptr;
- }
-
- // If the implementation uses a listener, call that.
- template <typename P>
- static auto MatchAndExplainImpl(const MatcherBase& m, const T& value,
- MatchResultListener* listener)
- -> decltype(P::Get(m).MatchAndExplain(value, listener->stream())) {
- return P::Get(m).MatchAndExplain(value, listener->stream());
- }
-
- template <typename P>
- static auto MatchAndExplainImpl(const MatcherBase& m, const T& value,
- MatchResultListener* listener)
- -> decltype(P::Get(m).MatchAndExplain(value, listener)) {
- return P::Get(m).MatchAndExplain(value, listener);
- }
-
- template <typename P>
- static void DescribeImpl(const MatcherBase& m, std::ostream* os,
- bool negation) {
- if (negation) {
- P::Get(m).DescribeNegationTo(os);
- } else {
- P::Get(m).DescribeTo(os);
- }
- }
-
- template <typename P>
- static const MatcherDescriberInterface* GetDescriberImpl(
- const MatcherBase& m) {
- // If the impl is a MatcherDescriberInterface, then return it.
- // Otherwise use MatcherBase itself.
- // This allows us to implement the GetDescriber() function without support
- // from the impl, but some users really want to get their impl back when
- // they call GetDescriber().
- // We use std::get on a tuple as a workaround of not having `if constexpr`.
- return std::get<(
- std::is_convertible<decltype(&P::Get(m)),
- const MatcherDescriberInterface*>::value
- ? 1
- : 0)>(std::make_tuple(&m, &P::Get(m)));
- }
-
- template <typename P>
- const VTable* GetVTable() {
- static constexpr VTable kVTable = {&MatchAndExplainImpl<P>,
- &DescribeImpl<P>, &GetDescriberImpl<P>,
- P::shared_destroy};
- return &kVTable;
- }
-
- union Buffer {
- // Add some types to give Buffer some common alignment/size use cases.
- void* ptr;
- double d;
- int64_t i;
- // And add one for the out-of-line cases.
- SharedPayloadBase* shared;
- };
-
- void Destroy() {
- if (IsShared() && buffer_.shared->Unref()) {
- vtable_->shared_destroy(buffer_.shared);
- }
- }
-
- template <typename M>
- static constexpr bool IsInlined() {
- return sizeof(M) <= sizeof(Buffer) && alignof(M) <= alignof(Buffer) &&
- std::is_trivially_copy_constructible<M>::value &&
- std::is_trivially_destructible<M>::value;
- }
-
- template <typename M, bool = MatcherBase::IsInlined<M>()>
- struct ValuePolicy {
- static const M& Get(const MatcherBase& m) {
- // When inlined along with Init, need to be explicit to avoid violating
- // strict aliasing rules.
- const M *ptr = static_cast<const M*>(
- static_cast<const void*>(&m.buffer_));
- return *ptr;
- }
- static void Init(MatcherBase& m, M impl) {
- ::new (static_cast<void*>(&m.buffer_)) M(impl);
- }
- static constexpr auto shared_destroy = nullptr;
- };
-
- template <typename M>
- struct ValuePolicy<M, false> {
- using Shared = SharedPayload<M>;
- static const M& Get(const MatcherBase& m) {
- return static_cast<Shared*>(m.buffer_.shared)->value;
- }
- template <typename Arg>
- static void Init(MatcherBase& m, Arg&& arg) {
- m.buffer_.shared = new Shared(std::forward<Arg>(arg));
- }
- static constexpr auto shared_destroy = &Shared::Destroy;
- };
-
- template <typename U, bool B>
- struct ValuePolicy<const MatcherInterface<U>*, B> {
- using M = const MatcherInterface<U>;
- using Shared = SharedPayload<std::unique_ptr<M>>;
- static const M& Get(const MatcherBase& m) {
- return *static_cast<Shared*>(m.buffer_.shared)->value;
- }
- static void Init(MatcherBase& m, M* impl) {
- m.buffer_.shared = new Shared(std::unique_ptr<M>(impl));
- }
-
- static constexpr auto shared_destroy = &Shared::Destroy;
- };
-
- template <typename M>
- void Init(M&& m) {
- using MM = typename std::decay<M>::type;
- using Policy = ValuePolicy<MM>;
- vtable_ = GetVTable<Policy>();
- Policy::Init(*this, std::forward<M>(m));
- }
-
- const VTable* vtable_;
- Buffer buffer_;
-};
-
-} // namespace internal
-
-// A Matcher<T> is a copyable and IMMUTABLE (except by assignment)
-// object that can check whether a value of type T matches. The
-// implementation of Matcher<T> is just a std::shared_ptr to const
-// MatcherInterface<T>. Don't inherit from Matcher!
-template <typename T>
-class Matcher : public internal::MatcherBase<T> {
- public:
- // Constructs a null matcher. Needed for storing Matcher objects in STL
- // containers. A default-constructed matcher is not yet initialized. You
- // cannot use it until a valid value has been assigned to it.
- explicit Matcher() {} // NOLINT
-
- // Constructs a matcher from its implementation.
- explicit Matcher(const MatcherInterface<const T&>* impl)
- : internal::MatcherBase<T>(impl) {}
-
- template <typename U>
- explicit Matcher(
- const MatcherInterface<U>* impl,
- typename std::enable_if<!std::is_same<U, const U&>::value>::type* =
- nullptr)
- : internal::MatcherBase<T>(impl) {}
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- Matcher(M&& m) : internal::MatcherBase<T>(std::forward<M>(m)) {} // NOLINT
-
- // Implicit constructor here allows people to write
- // EXPECT_CALL(foo, Bar(5)) instead of EXPECT_CALL(foo, Bar(Eq(5))) sometimes
- Matcher(T value); // NOLINT
-};
-
-// The following two specializations allow the user to write str
-// instead of Eq(str) and "foo" instead of Eq("foo") when a std::string
-// matcher is expected.
-template <>
-class GTEST_API_ Matcher<const std::string&>
- : public internal::MatcherBase<const std::string&> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<const std::string&>* impl)
- : internal::MatcherBase<const std::string&>(impl) {}
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- Matcher(M&& m) // NOLINT
- : internal::MatcherBase<const std::string&>(std::forward<M>(m)) {}
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a std::string object.
- Matcher(const std::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-};
-
-template <>
-class GTEST_API_ Matcher<std::string>
- : public internal::MatcherBase<std::string> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<const std::string&>* impl)
- : internal::MatcherBase<std::string>(impl) {}
- explicit Matcher(const MatcherInterface<std::string>* impl)
- : internal::MatcherBase<std::string>(impl) {}
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- Matcher(M&& m) // NOLINT
- : internal::MatcherBase<std::string>(std::forward<M>(m)) {}
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a string object.
- Matcher(const std::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-};
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-// The following two specializations allow the user to write str
-// instead of Eq(str) and "foo" instead of Eq("foo") when a absl::string_view
-// matcher is expected.
-template <>
-class GTEST_API_ Matcher<const internal::StringView&>
- : public internal::MatcherBase<const internal::StringView&> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<const internal::StringView&>* impl)
- : internal::MatcherBase<const internal::StringView&>(impl) {}
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- Matcher(M&& m) // NOLINT
- : internal::MatcherBase<const internal::StringView&>(std::forward<M>(m)) {
- }
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a std::string object.
- Matcher(const std::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-
- // Allows the user to pass absl::string_views or std::string_views directly.
- Matcher(internal::StringView s); // NOLINT
-};
-
-template <>
-class GTEST_API_ Matcher<internal::StringView>
- : public internal::MatcherBase<internal::StringView> {
- public:
- Matcher() {}
-
- explicit Matcher(const MatcherInterface<const internal::StringView&>* impl)
- : internal::MatcherBase<internal::StringView>(impl) {}
- explicit Matcher(const MatcherInterface<internal::StringView>* impl)
- : internal::MatcherBase<internal::StringView>(impl) {}
-
- template <typename M, typename = typename std::remove_reference<
- M>::type::is_gtest_matcher>
- Matcher(M&& m) // NOLINT
- : internal::MatcherBase<internal::StringView>(std::forward<M>(m)) {}
-
- // Allows the user to write str instead of Eq(str) sometimes, where
- // str is a std::string object.
- Matcher(const std::string& s); // NOLINT
-
- // Allows the user to write "foo" instead of Eq("foo") sometimes.
- Matcher(const char* s); // NOLINT
-
- // Allows the user to pass absl::string_views or std::string_views directly.
- Matcher(internal::StringView s); // NOLINT
-};
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-// Prints a matcher in a human-readable format.
-template <typename T>
-std::ostream& operator<<(std::ostream& os, const Matcher<T>& matcher) {
- matcher.DescribeTo(&os);
- return os;
-}
-
-// The PolymorphicMatcher class template makes it easy to implement a
-// polymorphic matcher (i.e. a matcher that can match values of more
-// than one type, e.g. Eq(n) and NotNull()).
-//
-// To define a polymorphic matcher, a user should provide an Impl
-// class that has a DescribeTo() method and a DescribeNegationTo()
-// method, and define a member function (or member function template)
-//
-// bool MatchAndExplain(const Value& value,
-// MatchResultListener* listener) const;
-//
-// See the definition of NotNull() for a complete example.
-template <class Impl>
-class PolymorphicMatcher {
- public:
- explicit PolymorphicMatcher(const Impl& an_impl) : impl_(an_impl) {}
-
- // Returns a mutable reference to the underlying matcher
- // implementation object.
- Impl& mutable_impl() { return impl_; }
-
- // Returns an immutable reference to the underlying matcher
- // implementation object.
- const Impl& impl() const { return impl_; }
-
- template <typename T>
- operator Matcher<T>() const {
- return Matcher<T>(new MonomorphicImpl<const T&>(impl_));
- }
-
- private:
- template <typename T>
- class MonomorphicImpl : public MatcherInterface<T> {
- public:
- explicit MonomorphicImpl(const Impl& impl) : impl_(impl) {}
-
- void DescribeTo(::std::ostream* os) const override { impl_.DescribeTo(os); }
-
- void DescribeNegationTo(::std::ostream* os) const override {
- impl_.DescribeNegationTo(os);
- }
-
- bool MatchAndExplain(T x, MatchResultListener* listener) const override {
- return impl_.MatchAndExplain(x, listener);
- }
-
- private:
- const Impl impl_;
- };
-
- Impl impl_;
-};
-
-// Creates a matcher from its implementation.
-// DEPRECATED: Especially in the generic code, prefer:
-// Matcher<T>(new MyMatcherImpl<const T&>(...));
-//
-// MakeMatcher may create a Matcher that accepts its argument by value, which
-// leads to unnecessary copies & lack of support for non-copyable types.
-template <typename T>
-inline Matcher<T> MakeMatcher(const MatcherInterface<T>* impl) {
- return Matcher<T>(impl);
-}
-
-// Creates a polymorphic matcher from its implementation. This is
-// easier to use than the PolymorphicMatcher<Impl> constructor as it
-// doesn't require you to explicitly write the template argument, e.g.
-//
-// MakePolymorphicMatcher(foo);
-// vs
-// PolymorphicMatcher<TypeOfFoo>(foo);
-template <class Impl>
-inline PolymorphicMatcher<Impl> MakePolymorphicMatcher(const Impl& impl) {
- return PolymorphicMatcher<Impl>(impl);
-}
-
-namespace internal {
-// Implements a matcher that compares a given value with a
-// pre-supplied value using one of the ==, <=, <, etc, operators. The
-// two values being compared don't have to have the same type.
-//
-// The matcher defined here is polymorphic (for example, Eq(5) can be
-// used to match an int, a short, a double, etc). Therefore we use
-// a template type conversion operator in the implementation.
-//
-// The following template definition assumes that the Rhs parameter is
-// a "bare" type (i.e. neither 'const T' nor 'T&').
-template <typename D, typename Rhs, typename Op>
-class ComparisonBase {
- public:
- explicit ComparisonBase(const Rhs& rhs) : rhs_(rhs) {}
-
- using is_gtest_matcher = void;
-
- template <typename Lhs>
- bool MatchAndExplain(const Lhs& lhs, std::ostream*) const {
- return Op()(lhs, Unwrap(rhs_));
- }
- void DescribeTo(std::ostream* os) const {
- *os << D::Desc() << " ";
- UniversalPrint(Unwrap(rhs_), os);
- }
- void DescribeNegationTo(std::ostream* os) const {
- *os << D::NegatedDesc() << " ";
- UniversalPrint(Unwrap(rhs_), os);
- }
-
- private:
- template <typename T>
- static const T& Unwrap(const T& v) {
- return v;
- }
- template <typename T>
- static const T& Unwrap(std::reference_wrapper<T> v) {
- return v;
- }
-
- Rhs rhs_;
-};
-
-template <typename Rhs>
-class EqMatcher : public ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq> {
- public:
- explicit EqMatcher(const Rhs& rhs)
- : ComparisonBase<EqMatcher<Rhs>, Rhs, AnyEq>(rhs) { }
- static const char* Desc() { return "is equal to"; }
- static const char* NegatedDesc() { return "isn't equal to"; }
-};
-template <typename Rhs>
-class NeMatcher : public ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe> {
- public:
- explicit NeMatcher(const Rhs& rhs)
- : ComparisonBase<NeMatcher<Rhs>, Rhs, AnyNe>(rhs) { }
- static const char* Desc() { return "isn't equal to"; }
- static const char* NegatedDesc() { return "is equal to"; }
-};
-template <typename Rhs>
-class LtMatcher : public ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt> {
- public:
- explicit LtMatcher(const Rhs& rhs)
- : ComparisonBase<LtMatcher<Rhs>, Rhs, AnyLt>(rhs) { }
- static const char* Desc() { return "is <"; }
- static const char* NegatedDesc() { return "isn't <"; }
-};
-template <typename Rhs>
-class GtMatcher : public ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt> {
- public:
- explicit GtMatcher(const Rhs& rhs)
- : ComparisonBase<GtMatcher<Rhs>, Rhs, AnyGt>(rhs) { }
- static const char* Desc() { return "is >"; }
- static const char* NegatedDesc() { return "isn't >"; }
-};
-template <typename Rhs>
-class LeMatcher : public ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe> {
- public:
- explicit LeMatcher(const Rhs& rhs)
- : ComparisonBase<LeMatcher<Rhs>, Rhs, AnyLe>(rhs) { }
- static const char* Desc() { return "is <="; }
- static const char* NegatedDesc() { return "isn't <="; }
-};
-template <typename Rhs>
-class GeMatcher : public ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe> {
- public:
- explicit GeMatcher(const Rhs& rhs)
- : ComparisonBase<GeMatcher<Rhs>, Rhs, AnyGe>(rhs) { }
- static const char* Desc() { return "is >="; }
- static const char* NegatedDesc() { return "isn't >="; }
-};
-
-template <typename T, typename = typename std::enable_if<
- std::is_constructible<std::string, T>::value>::type>
-using StringLike = T;
-
-// Implements polymorphic matchers MatchesRegex(regex) and
-// ContainsRegex(regex), which can be used as a Matcher<T> as long as
-// T can be converted to a string.
-class MatchesRegexMatcher {
- public:
- MatchesRegexMatcher(const RE* regex, bool full_match)
- : regex_(regex), full_match_(full_match) {}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- bool MatchAndExplain(const internal::StringView& s,
- MatchResultListener* listener) const {
- return MatchAndExplain(std::string(s), listener);
- }
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
- // Accepts pointer types, particularly:
- // const char*
- // char*
- // const wchar_t*
- // wchar_t*
- template <typename CharType>
- bool MatchAndExplain(CharType* s, MatchResultListener* listener) const {
- return s != nullptr && MatchAndExplain(std::string(s), listener);
- }
-
- // Matches anything that can convert to std::string.
- //
- // This is a template, not just a plain function with const std::string&,
- // because absl::string_view has some interfering non-explicit constructors.
- template <class MatcheeStringType>
- bool MatchAndExplain(const MatcheeStringType& s,
- MatchResultListener* /* listener */) const {
- const std::string& s2(s);
- return full_match_ ? RE::FullMatch(s2, *regex_)
- : RE::PartialMatch(s2, *regex_);
- }
-
- void DescribeTo(::std::ostream* os) const {
- *os << (full_match_ ? "matches" : "contains") << " regular expression ";
- UniversalPrinter<std::string>::Print(regex_->pattern(), os);
- }
-
- void DescribeNegationTo(::std::ostream* os) const {
- *os << "doesn't " << (full_match_ ? "match" : "contain")
- << " regular expression ";
- UniversalPrinter<std::string>::Print(regex_->pattern(), os);
- }
-
- private:
- const std::shared_ptr<const RE> regex_;
- const bool full_match_;
-};
-} // namespace internal
-
-// Matches a string that fully matches regular expression 'regex'.
-// The matcher takes ownership of 'regex'.
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
- const internal::RE* regex) {
- return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, true));
-}
-template <typename T = std::string>
-PolymorphicMatcher<internal::MatchesRegexMatcher> MatchesRegex(
- const internal::StringLike<T>& regex) {
- return MatchesRegex(new internal::RE(std::string(regex)));
-}
-
-// Matches a string that contains regular expression 'regex'.
-// The matcher takes ownership of 'regex'.
-inline PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
- const internal::RE* regex) {
- return MakePolymorphicMatcher(internal::MatchesRegexMatcher(regex, false));
-}
-template <typename T = std::string>
-PolymorphicMatcher<internal::MatchesRegexMatcher> ContainsRegex(
- const internal::StringLike<T>& regex) {
- return ContainsRegex(new internal::RE(std::string(regex)));
-}
-
-// Creates a polymorphic matcher that matches anything equal to x.
-// Note: if the parameter of Eq() were declared as const T&, Eq("foo")
-// wouldn't compile.
-template <typename T>
-inline internal::EqMatcher<T> Eq(T x) { return internal::EqMatcher<T>(x); }
-
-// Constructs a Matcher<T> from a 'value' of type T. The constructed
-// matcher matches any value that's equal to 'value'.
-template <typename T>
-Matcher<T>::Matcher(T value) { *this = Eq(value); }
-
-// Creates a monomorphic matcher that matches anything with type Lhs
-// and equal to rhs. A user may need to use this instead of Eq(...)
-// in order to resolve an overloading ambiguity.
-//
-// TypedEq<T>(x) is just a convenient short-hand for Matcher<T>(Eq(x))
-// or Matcher<T>(x), but more readable than the latter.
-//
-// We could define similar monomorphic matchers for other comparison
-// operations (e.g. TypedLt, TypedGe, and etc), but decided not to do
-// it yet as those are used much less than Eq() in practice. A user
-// can always write Matcher<T>(Lt(5)) to be explicit about the type,
-// for example.
-template <typename Lhs, typename Rhs>
-inline Matcher<Lhs> TypedEq(const Rhs& rhs) { return Eq(rhs); }
-
-// Creates a polymorphic matcher that matches anything >= x.
-template <typename Rhs>
-inline internal::GeMatcher<Rhs> Ge(Rhs x) {
- return internal::GeMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything > x.
-template <typename Rhs>
-inline internal::GtMatcher<Rhs> Gt(Rhs x) {
- return internal::GtMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything <= x.
-template <typename Rhs>
-inline internal::LeMatcher<Rhs> Le(Rhs x) {
- return internal::LeMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything < x.
-template <typename Rhs>
-inline internal::LtMatcher<Rhs> Lt(Rhs x) {
- return internal::LtMatcher<Rhs>(x);
-}
-
-// Creates a polymorphic matcher that matches anything != x.
-template <typename Rhs>
-inline internal::NeMatcher<Rhs> Ne(Rhs x) {
- return internal::NeMatcher<Rhs>(x);
-}
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251 5046
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_MATCHERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-message.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-message.h
deleted file mode 100644
index 9419229ffa..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-message.h
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file defines the Message class.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
-
-#include <limits>
-#include <memory>
-#include <sstream>
-
-#include "gtest/internal/gtest-port.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-// Ensures that there is at least one operator<< in the global namespace.
-// See Message& operator<<(...) below for why.
-void operator<<(const testing::internal::Secret&, int);
-
-namespace testing {
-
-// The Message class works like an ostream repeater.
-//
-// Typical usage:
-//
-// 1. You stream a bunch of values to a Message object.
-// It will remember the text in a stringstream.
-// 2. Then you stream the Message object to an ostream.
-// This causes the text in the Message to be streamed
-// to the ostream.
-//
-// For example;
-//
-// testing::Message foo;
-// foo << 1 << " != " << 2;
-// std::cout << foo;
-//
-// will print "1 != 2".
-//
-// Message is not intended to be inherited from. In particular, its
-// destructor is not virtual.
-//
-// Note that stringstream behaves differently in gcc and in MSVC. You
-// can stream a NULL char pointer to it in the former, but not in the
-// latter (it causes an access violation if you do). The Message
-// class hides this difference by treating a NULL char pointer as
-// "(null)".
-class GTEST_API_ Message {
- private:
- // The type of basic IO manipulators (endl, ends, and flush) for
- // narrow streams.
- typedef std::ostream& (*BasicNarrowIoManip)(std::ostream&);
-
- public:
- // Constructs an empty Message.
- Message();
-
- // Copy constructor.
- Message(const Message& msg) : ss_(new ::std::stringstream) { // NOLINT
- *ss_ << msg.GetString();
- }
-
- // Constructs a Message from a C-string.
- explicit Message(const char* str) : ss_(new ::std::stringstream) {
- *ss_ << str;
- }
-
- // Streams a non-pointer value to this object.
- template <typename T>
- inline Message& operator <<(const T& val) {
- // Some libraries overload << for STL containers. These
- // overloads are defined in the global namespace instead of ::std.
- //
- // C++'s symbol lookup rule (i.e. Koenig lookup) says that these
- // overloads are visible in either the std namespace or the global
- // namespace, but not other namespaces, including the testing
- // namespace which Google Test's Message class is in.
- //
- // To allow STL containers (and other types that has a << operator
- // defined in the global namespace) to be used in Google Test
- // assertions, testing::Message must access the custom << operator
- // from the global namespace. With this using declaration,
- // overloads of << defined in the global namespace and those
- // visible via Koenig lookup are both exposed in this function.
- using ::operator <<;
- *ss_ << val;
- return *this;
- }
-
- // Streams a pointer value to this object.
- //
- // This function is an overload of the previous one. When you
- // stream a pointer to a Message, this definition will be used as it
- // is more specialized. (The C++ Standard, section
- // [temp.func.order].) If you stream a non-pointer, then the
- // previous definition will be used.
- //
- // The reason for this overload is that streaming a NULL pointer to
- // ostream is undefined behavior. Depending on the compiler, you
- // may get "0", "(nil)", "(null)", or an access violation. To
- // ensure consistent result across compilers, we always treat NULL
- // as "(null)".
- template <typename T>
- inline Message& operator <<(T* const& pointer) { // NOLINT
- if (pointer == nullptr) {
- *ss_ << "(null)";
- } else {
- *ss_ << pointer;
- }
- return *this;
- }
-
- // Since the basic IO manipulators are overloaded for both narrow
- // and wide streams, we have to provide this specialized definition
- // of operator <<, even though its body is the same as the
- // templatized version above. Without this definition, streaming
- // endl or other basic IO manipulators to Message will confuse the
- // compiler.
- Message& operator <<(BasicNarrowIoManip val) {
- *ss_ << val;
- return *this;
- }
-
- // Instead of 1/0, we want to see true/false for bool values.
- Message& operator <<(bool b) {
- return *this << (b ? "true" : "false");
- }
-
- // These two overloads allow streaming a wide C string to a Message
- // using the UTF-8 encoding.
- Message& operator <<(const wchar_t* wide_c_str);
- Message& operator <<(wchar_t* wide_c_str);
-
-#if GTEST_HAS_STD_WSTRING
- // Converts the given wide string to a narrow string using the UTF-8
- // encoding, and streams the result to this Message object.
- Message& operator <<(const ::std::wstring& wstr);
-#endif // GTEST_HAS_STD_WSTRING
-
- // Gets the text streamed to this object so far as an std::string.
- // Each '\0' character in the buffer is replaced with "\\0".
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- std::string GetString() const;
-
- private:
- // We'll hold the text streamed to this object here.
- const std::unique_ptr< ::std::stringstream> ss_;
-
- // We declare (but don't implement) this to prevent the compiler
- // from implementing the assignment operator.
- void operator=(const Message&);
-};
-
-// Streams a Message to an ostream.
-inline std::ostream& operator <<(std::ostream& os, const Message& sb) {
- return os << sb.GetString();
-}
-
-namespace internal {
-
-// Converts a streamable value to an std::string. A NULL pointer is
-// converted to "(null)". When the input value is a ::string,
-// ::std::string, ::wstring, or ::std::wstring object, each NUL
-// character in it is replaced with "\\0".
-template <typename T>
-std::string StreamableToString(const T& streamable) {
- return (Message() << streamable).GetString();
-}
-
-} // namespace internal
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_MESSAGE_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-param-test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-param-test.h
deleted file mode 100644
index 96c1c72254..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-param-test.h
+++ /dev/null
@@ -1,510 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Macros and functions for implementing parameterized tests
-// in Google C++ Testing and Mocking Framework (Google Test)
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
-
-// Value-parameterized tests allow you to test your code with different
-// parameters without writing multiple copies of the same test.
-//
-// Here is how you use value-parameterized tests:
-
-#if 0
-
-// To write value-parameterized tests, first you should define a fixture
-// class. It is usually derived from testing::TestWithParam<T> (see below for
-// another inheritance scheme that's sometimes useful in more complicated
-// class hierarchies), where the type of your parameter values.
-// TestWithParam<T> is itself derived from testing::Test. T can be any
-// copyable type. If it's a raw pointer, you are responsible for managing the
-// lifespan of the pointed values.
-
-class FooTest : public ::testing::TestWithParam<const char*> {
- // You can implement all the usual class fixture members here.
-};
-
-// Then, use the TEST_P macro to define as many parameterized tests
-// for this fixture as you want. The _P suffix is for "parameterized"
-// or "pattern", whichever you prefer to think.
-
-TEST_P(FooTest, DoesBlah) {
- // Inside a test, access the test parameter with the GetParam() method
- // of the TestWithParam<T> class:
- EXPECT_TRUE(foo.Blah(GetParam()));
- ...
-}
-
-TEST_P(FooTest, HasBlahBlah) {
- ...
-}
-
-// Finally, you can use INSTANTIATE_TEST_SUITE_P to instantiate the test
-// case with any set of parameters you want. Google Test defines a number
-// of functions for generating test parameters. They return what we call
-// (surprise!) parameter generators. Here is a summary of them, which
-// are all in the testing namespace:
-//
-//
-// Range(begin, end [, step]) - Yields values {begin, begin+step,
-// begin+step+step, ...}. The values do not
-// include end. step defaults to 1.
-// Values(v1, v2, ..., vN) - Yields values {v1, v2, ..., vN}.
-// ValuesIn(container) - Yields values from a C-style array, an STL
-// ValuesIn(begin,end) container, or an iterator range [begin, end).
-// Bool() - Yields sequence {false, true}.
-// Combine(g1, g2, ..., gN) - Yields all combinations (the Cartesian product
-// for the math savvy) of the values generated
-// by the N generators.
-//
-// For more details, see comments at the definitions of these functions below
-// in this file.
-//
-// The following statement will instantiate tests from the FooTest test suite
-// each with parameter values "meeny", "miny", and "moe".
-
-INSTANTIATE_TEST_SUITE_P(InstantiationName,
- FooTest,
- Values("meeny", "miny", "moe"));
-
-// To distinguish different instances of the pattern, (yes, you
-// can instantiate it more than once) the first argument to the
-// INSTANTIATE_TEST_SUITE_P macro is a prefix that will be added to the
-// actual test suite name. Remember to pick unique prefixes for different
-// instantiations. The tests from the instantiation above will have
-// these names:
-//
-// * InstantiationName/FooTest.DoesBlah/0 for "meeny"
-// * InstantiationName/FooTest.DoesBlah/1 for "miny"
-// * InstantiationName/FooTest.DoesBlah/2 for "moe"
-// * InstantiationName/FooTest.HasBlahBlah/0 for "meeny"
-// * InstantiationName/FooTest.HasBlahBlah/1 for "miny"
-// * InstantiationName/FooTest.HasBlahBlah/2 for "moe"
-//
-// You can use these names in --gtest_filter.
-//
-// This statement will instantiate all tests from FooTest again, each
-// with parameter values "cat" and "dog":
-
-const char* pets[] = {"cat", "dog"};
-INSTANTIATE_TEST_SUITE_P(AnotherInstantiationName, FooTest, ValuesIn(pets));
-
-// The tests from the instantiation above will have these names:
-//
-// * AnotherInstantiationName/FooTest.DoesBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.DoesBlah/1 for "dog"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/0 for "cat"
-// * AnotherInstantiationName/FooTest.HasBlahBlah/1 for "dog"
-//
-// Please note that INSTANTIATE_TEST_SUITE_P will instantiate all tests
-// in the given test suite, whether their definitions come before or
-// AFTER the INSTANTIATE_TEST_SUITE_P statement.
-//
-// Please also note that generator expressions (including parameters to the
-// generators) are evaluated in InitGoogleTest(), after main() has started.
-// This allows the user on one hand, to adjust generator parameters in order
-// to dynamically determine a set of tests to run and on the other hand,
-// give the user a chance to inspect the generated tests with Google Test
-// reflection API before RUN_ALL_TESTS() is executed.
-//
-// You can see samples/sample7_unittest.cc and samples/sample8_unittest.cc
-// for more examples.
-//
-// In the future, we plan to publish the API for defining new parameter
-// generators. But for now this interface remains part of the internal
-// implementation and is subject to change.
-//
-//
-// A parameterized test fixture must be derived from testing::Test and from
-// testing::WithParamInterface<T>, where T is the type of the parameter
-// values. Inheriting from TestWithParam<T> satisfies that requirement because
-// TestWithParam<T> inherits from both Test and WithParamInterface. In more
-// complicated hierarchies, however, it is occasionally useful to inherit
-// separately from Test and WithParamInterface. For example:
-
-class BaseTest : public ::testing::Test {
- // You can inherit all the usual members for a non-parameterized test
- // fixture here.
-};
-
-class DerivedTest : public BaseTest, public ::testing::WithParamInterface<int> {
- // The usual test fixture members go here too.
-};
-
-TEST_F(BaseTest, HasFoo) {
- // This is an ordinary non-parameterized test.
-}
-
-TEST_P(DerivedTest, DoesBlah) {
- // GetParam works just the same here as if you inherit from TestWithParam.
- EXPECT_TRUE(foo.Blah(GetParam()));
-}
-
-#endif // 0
-
-#include <iterator>
-#include <utility>
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-param-util.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-
-// Functions producing parameter generators.
-//
-// Google Test uses these generators to produce parameters for value-
-// parameterized tests. When a parameterized test suite is instantiated
-// with a particular generator, Google Test creates and runs tests
-// for each element in the sequence produced by the generator.
-//
-// In the following sample, tests from test suite FooTest are instantiated
-// each three times with parameter values 3, 5, and 8:
-//
-// class FooTest : public TestWithParam<int> { ... };
-//
-// TEST_P(FooTest, TestThis) {
-// }
-// TEST_P(FooTest, TestThat) {
-// }
-// INSTANTIATE_TEST_SUITE_P(TestSequence, FooTest, Values(3, 5, 8));
-//
-
-// Range() returns generators providing sequences of values in a range.
-//
-// Synopsis:
-// Range(start, end)
-// - returns a generator producing a sequence of values {start, start+1,
-// start+2, ..., }.
-// Range(start, end, step)
-// - returns a generator producing a sequence of values {start, start+step,
-// start+step+step, ..., }.
-// Notes:
-// * The generated sequences never include end. For example, Range(1, 5)
-// returns a generator producing a sequence {1, 2, 3, 4}. Range(1, 9, 2)
-// returns a generator producing {1, 3, 5, 7}.
-// * start and end must have the same type. That type may be any integral or
-// floating-point type or a user defined type satisfying these conditions:
-// * It must be assignable (have operator=() defined).
-// * It must have operator+() (operator+(int-compatible type) for
-// two-operand version).
-// * It must have operator<() defined.
-// Elements in the resulting sequences will also have that type.
-// * Condition start < end must be satisfied in order for resulting sequences
-// to contain any elements.
-//
-template <typename T, typename IncrementT>
-internal::ParamGenerator<T> Range(T start, T end, IncrementT step) {
- return internal::ParamGenerator<T>(
- new internal::RangeGenerator<T, IncrementT>(start, end, step));
-}
-
-template <typename T>
-internal::ParamGenerator<T> Range(T start, T end) {
- return Range(start, end, 1);
-}
-
-// ValuesIn() function allows generation of tests with parameters coming from
-// a container.
-//
-// Synopsis:
-// ValuesIn(const T (&array)[N])
-// - returns a generator producing sequences with elements from
-// a C-style array.
-// ValuesIn(const Container& container)
-// - returns a generator producing sequences with elements from
-// an STL-style container.
-// ValuesIn(Iterator begin, Iterator end)
-// - returns a generator producing sequences with elements from
-// a range [begin, end) defined by a pair of STL-style iterators. These
-// iterators can also be plain C pointers.
-//
-// Please note that ValuesIn copies the values from the containers
-// passed in and keeps them to generate tests in RUN_ALL_TESTS().
-//
-// Examples:
-//
-// This instantiates tests from test suite StringTest
-// each with C-string values of "foo", "bar", and "baz":
-//
-// const char* strings[] = {"foo", "bar", "baz"};
-// INSTANTIATE_TEST_SUITE_P(StringSequence, StringTest, ValuesIn(strings));
-//
-// This instantiates tests from test suite StlStringTest
-// each with STL strings with values "a" and "b":
-//
-// ::std::vector< ::std::string> GetParameterStrings() {
-// ::std::vector< ::std::string> v;
-// v.push_back("a");
-// v.push_back("b");
-// return v;
-// }
-//
-// INSTANTIATE_TEST_SUITE_P(CharSequence,
-// StlStringTest,
-// ValuesIn(GetParameterStrings()));
-//
-//
-// This will also instantiate tests from CharTest
-// each with parameter values 'a' and 'b':
-//
-// ::std::list<char> GetParameterChars() {
-// ::std::list<char> list;
-// list.push_back('a');
-// list.push_back('b');
-// return list;
-// }
-// ::std::list<char> l = GetParameterChars();
-// INSTANTIATE_TEST_SUITE_P(CharSequence2,
-// CharTest,
-// ValuesIn(l.begin(), l.end()));
-//
-template <typename ForwardIterator>
-internal::ParamGenerator<
- typename std::iterator_traits<ForwardIterator>::value_type>
-ValuesIn(ForwardIterator begin, ForwardIterator end) {
- typedef typename std::iterator_traits<ForwardIterator>::value_type ParamType;
- return internal::ParamGenerator<ParamType>(
- new internal::ValuesInIteratorRangeGenerator<ParamType>(begin, end));
-}
-
-template <typename T, size_t N>
-internal::ParamGenerator<T> ValuesIn(const T (&array)[N]) {
- return ValuesIn(array, array + N);
-}
-
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container) {
- return ValuesIn(container.begin(), container.end());
-}
-
-// Values() allows generating tests from explicitly specified list of
-// parameters.
-//
-// Synopsis:
-// Values(T v1, T v2, ..., T vN)
-// - returns a generator producing sequences with elements v1, v2, ..., vN.
-//
-// For example, this instantiates tests from test suite BarTest each
-// with values "one", "two", and "three":
-//
-// INSTANTIATE_TEST_SUITE_P(NumSequence,
-// BarTest,
-// Values("one", "two", "three"));
-//
-// This instantiates tests from test suite BazTest each with values 1, 2, 3.5.
-// The exact type of values will depend on the type of parameter in BazTest.
-//
-// INSTANTIATE_TEST_SUITE_P(FloatingNumbers, BazTest, Values(1, 2, 3.5));
-//
-//
-template <typename... T>
-internal::ValueArray<T...> Values(T... v) {
- return internal::ValueArray<T...>(std::move(v)...);
-}
-
-// Bool() allows generating tests with parameters in a set of (false, true).
-//
-// Synopsis:
-// Bool()
-// - returns a generator producing sequences with elements {false, true}.
-//
-// It is useful when testing code that depends on Boolean flags. Combinations
-// of multiple flags can be tested when several Bool()'s are combined using
-// Combine() function.
-//
-// In the following example all tests in the test suite FlagDependentTest
-// will be instantiated twice with parameters false and true.
-//
-// class FlagDependentTest : public testing::TestWithParam<bool> {
-// virtual void SetUp() {
-// external_flag = GetParam();
-// }
-// }
-// INSTANTIATE_TEST_SUITE_P(BoolSequence, FlagDependentTest, Bool());
-//
-inline internal::ParamGenerator<bool> Bool() {
- return Values(false, true);
-}
-
-// Combine() allows the user to combine two or more sequences to produce
-// values of a Cartesian product of those sequences' elements.
-//
-// Synopsis:
-// Combine(gen1, gen2, ..., genN)
-// - returns a generator producing sequences with elements coming from
-// the Cartesian product of elements from the sequences generated by
-// gen1, gen2, ..., genN. The sequence elements will have a type of
-// std::tuple<T1, T2, ..., TN> where T1, T2, ..., TN are the types
-// of elements from sequences produces by gen1, gen2, ..., genN.
-//
-// Example:
-//
-// This will instantiate tests in test suite AnimalTest each one with
-// the parameter values tuple("cat", BLACK), tuple("cat", WHITE),
-// tuple("dog", BLACK), and tuple("dog", WHITE):
-//
-// enum Color { BLACK, GRAY, WHITE };
-// class AnimalTest
-// : public testing::TestWithParam<std::tuple<const char*, Color> > {...};
-//
-// TEST_P(AnimalTest, AnimalLooksNice) {...}
-//
-// INSTANTIATE_TEST_SUITE_P(AnimalVariations, AnimalTest,
-// Combine(Values("cat", "dog"),
-// Values(BLACK, WHITE)));
-//
-// This will instantiate tests in FlagDependentTest with all variations of two
-// Boolean flags:
-//
-// class FlagDependentTest
-// : public testing::TestWithParam<std::tuple<bool, bool> > {
-// virtual void SetUp() {
-// // Assigns external_flag_1 and external_flag_2 values from the tuple.
-// std::tie(external_flag_1, external_flag_2) = GetParam();
-// }
-// };
-//
-// TEST_P(FlagDependentTest, TestFeature1) {
-// // Test your code using external_flag_1 and external_flag_2 here.
-// }
-// INSTANTIATE_TEST_SUITE_P(TwoBoolSequence, FlagDependentTest,
-// Combine(Bool(), Bool()));
-//
-template <typename... Generator>
-internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
- return internal::CartesianProductHolder<Generator...>(g...);
-}
-
-#define TEST_P(test_suite_name, test_name) \
- class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
- : public test_suite_name { \
- public: \
- GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() {} \
- void TestBody() override; \
- \
- private: \
- static int AddToRegistry() { \
- ::testing::UnitTest::GetInstance() \
- ->parameterized_test_registry() \
- .GetTestSuitePatternHolder<test_suite_name>( \
- GTEST_STRINGIFY_(test_suite_name), \
- ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
- ->AddTestPattern( \
- GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \
- new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \
- test_suite_name, test_name)>(), \
- ::testing::internal::CodeLocation(__FILE__, __LINE__)); \
- return 0; \
- } \
- static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
- test_name)); \
- }; \
- int GTEST_TEST_CLASS_NAME_(test_suite_name, \
- test_name)::gtest_registering_dummy_ = \
- GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::AddToRegistry(); \
- void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()
-
-// The last argument to INSTANTIATE_TEST_SUITE_P allows the user to specify
-// generator and an optional function or functor that generates custom test name
-// suffixes based on the test parameters. Such a function or functor should
-// accept one argument of type testing::TestParamInfo<class ParamType>, and
-// return std::string.
-//
-// testing::PrintToStringParamName is a builtin test suffix generator that
-// returns the value of testing::PrintToString(GetParam()).
-//
-// Note: test names must be non-empty, unique, and may only contain ASCII
-// alphanumeric characters or underscore. Because PrintToString adds quotes
-// to std::string and C strings, it won't work for these types.
-
-#define GTEST_EXPAND_(arg) arg
-#define GTEST_GET_FIRST_(first, ...) first
-#define GTEST_GET_SECOND_(first, second, ...) second
-
-#define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name, ...) \
- static ::testing::internal::ParamGenerator<test_suite_name::ParamType> \
- gtest_##prefix##test_suite_name##_EvalGenerator_() { \
- return GTEST_EXPAND_(GTEST_GET_FIRST_(__VA_ARGS__, DUMMY_PARAM_)); \
- } \
- static ::std::string gtest_##prefix##test_suite_name##_EvalGenerateName_( \
- const ::testing::TestParamInfo<test_suite_name::ParamType>& info) { \
- if (::testing::internal::AlwaysFalse()) { \
- ::testing::internal::TestNotEmpty(GTEST_EXPAND_(GTEST_GET_SECOND_( \
- __VA_ARGS__, \
- ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
- DUMMY_PARAM_))); \
- auto t = std::make_tuple(__VA_ARGS__); \
- static_assert(std::tuple_size<decltype(t)>::value <= 2, \
- "Too Many Args!"); \
- } \
- return ((GTEST_EXPAND_(GTEST_GET_SECOND_( \
- __VA_ARGS__, \
- ::testing::internal::DefaultParamName<test_suite_name::ParamType>, \
- DUMMY_PARAM_))))(info); \
- } \
- static int gtest_##prefix##test_suite_name##_dummy_ \
- GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::UnitTest::GetInstance() \
- ->parameterized_test_registry() \
- .GetTestSuitePatternHolder<test_suite_name>( \
- GTEST_STRINGIFY_(test_suite_name), \
- ::testing::internal::CodeLocation(__FILE__, __LINE__)) \
- ->AddTestSuiteInstantiation( \
- GTEST_STRINGIFY_(prefix), \
- &gtest_##prefix##test_suite_name##_EvalGenerator_, \
- &gtest_##prefix##test_suite_name##_EvalGenerateName_, \
- __FILE__, __LINE__)
-
-
-// Allow Marking a Parameterized test class as not needing to be instantiated.
-#define GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(T) \
- namespace gtest_do_not_use_outside_namespace_scope {} \
- static const ::testing::internal::MarkAsIgnored gtest_allow_ignore_##T( \
- GTEST_STRINGIFY_(T))
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-#define INSTANTIATE_TEST_CASE_P \
- static_assert(::testing::internal::InstantiateTestCase_P_IsDeprecated(), \
- ""); \
- INSTANTIATE_TEST_SUITE_P
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PARAM_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-printers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-printers.h
deleted file mode 100644
index b097e9886d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-printers.h
+++ /dev/null
@@ -1,1050 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Test - The Google C++ Testing and Mocking Framework
-//
-// This file implements a universal value printer that can print a
-// value of any type T:
-//
-// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
-//
-// A user can teach this function how to print a class type T by
-// defining either operator<<() or PrintTo() in the namespace that
-// defines T. More specifically, the FIRST defined function in the
-// following list will be used (assuming T is defined in namespace
-// foo):
-//
-// 1. foo::PrintTo(const T&, ostream*)
-// 2. operator<<(ostream&, const T&) defined in either foo or the
-// global namespace.
-//
-// However if T is an STL-style container then it is printed element-wise
-// unless foo::PrintTo(const T&, ostream*) is defined. Note that
-// operator<<() is ignored for container types.
-//
-// If none of the above is defined, it will print the debug string of
-// the value if it is a protocol buffer, or print the raw bytes in the
-// value otherwise.
-//
-// To aid debugging: when T is a reference type, the address of the
-// value is also printed; when T is a (const) char pointer, both the
-// pointer value and the NUL-terminated string it points to are
-// printed.
-//
-// We also provide some convenient wrappers:
-//
-// // Prints a value to a string. For a (const or not) char
-// // pointer, the NUL-terminated string (but not the pointer) is
-// // printed.
-// std::string ::testing::PrintToString(const T& value);
-//
-// // Prints a value tersely: for a reference type, the referenced
-// // value (but not the address) is printed; for a (const or not) char
-// // pointer, the NUL-terminated string (but not the pointer) is
-// // printed.
-// void ::testing::internal::UniversalTersePrint(const T& value, ostream*);
-//
-// // Prints value using the type inferred by the compiler. The difference
-// // from UniversalTersePrint() is that this function prints both the
-// // pointer and the NUL-terminated string for a (const or not) char pointer.
-// void ::testing::internal::UniversalPrint(const T& value, ostream*);
-//
-// // Prints the fields of a tuple tersely to a string vector, one
-// // element for each field. Tuple support must be enabled in
-// // gtest-port.h.
-// std::vector<string> UniversalTersePrintTupleFieldsToStrings(
-// const Tuple& value);
-//
-// Known limitation:
-//
-// The print primitives print the elements of an STL-style container
-// using the compiler-inferred type of *iter where iter is a
-// const_iterator of the container. When const_iterator is an input
-// iterator but not a forward iterator, this inferred type may not
-// match value_type, and the print output may be incorrect. In
-// practice, this is rarely a problem as for most containers
-// const_iterator is a forward iterator. We'll fix this if there's an
-// actual need for it. Note that this fix cannot rely on value_type
-// being defined as many user-defined container types don't have
-// value_type.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
-
-#include <functional>
-#include <memory>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <string>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-#include <vector>
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-
-// Definitions in the internal* namespaces are subject to change without notice.
-// DO NOT USE THEM IN USER CODE!
-namespace internal {
-
-template <typename T>
-void UniversalPrint(const T& value, ::std::ostream* os);
-
-// Used to print an STL-style container when the user doesn't define
-// a PrintTo() for it.
-struct ContainerPrinter {
- template <typename T,
- typename = typename std::enable_if<
- (sizeof(IsContainerTest<T>(0)) == sizeof(IsContainer)) &&
- !IsRecursiveContainer<T>::value>::type>
- static void PrintValue(const T& container, std::ostream* os) {
- const size_t kMaxCount = 32; // The maximum number of elements to print.
- *os << '{';
- size_t count = 0;
- for (auto&& elem : container) {
- if (count > 0) {
- *os << ',';
- if (count == kMaxCount) { // Enough has been printed.
- *os << " ...";
- break;
- }
- }
- *os << ' ';
- // We cannot call PrintTo(elem, os) here as PrintTo() doesn't
- // handle `elem` being a native array.
- internal::UniversalPrint(elem, os);
- ++count;
- }
-
- if (count > 0) {
- *os << ' ';
- }
- *os << '}';
- }
-};
-
-// Used to print a pointer that is neither a char pointer nor a member
-// pointer, when the user doesn't define PrintTo() for it. (A member
-// variable pointer or member function pointer doesn't really point to
-// a location in the address space. Their representation is
-// implementation-defined. Therefore they will be printed as raw
-// bytes.)
-struct FunctionPointerPrinter {
- template <typename T, typename = typename std::enable_if<
- std::is_function<T>::value>::type>
- static void PrintValue(T* p, ::std::ostream* os) {
- if (p == nullptr) {
- *os << "NULL";
- } else {
- // T is a function type, so '*os << p' doesn't do what we want
- // (it just prints p as bool). We want to print p as a const
- // void*.
- *os << reinterpret_cast<const void*>(p);
- }
- }
-};
-
-struct PointerPrinter {
- template <typename T>
- static void PrintValue(T* p, ::std::ostream* os) {
- if (p == nullptr) {
- *os << "NULL";
- } else {
- // T is not a function type. We just call << to print p,
- // relying on ADL to pick up user-defined << for their pointer
- // types, if any.
- *os << p;
- }
- }
-};
-
-namespace internal_stream_operator_without_lexical_name_lookup {
-
-// The presence of an operator<< here will terminate lexical scope lookup
-// straight away (even though it cannot be a match because of its argument
-// types). Thus, the two operator<< calls in StreamPrinter will find only ADL
-// candidates.
-struct LookupBlocker {};
-void operator<<(LookupBlocker, LookupBlocker);
-
-struct StreamPrinter {
- template <typename T,
- // Don't accept member pointers here. We'd print them via implicit
- // conversion to bool, which isn't useful.
- typename = typename std::enable_if<
- !std::is_member_pointer<T>::value>::type,
- // Only accept types for which we can find a streaming operator via
- // ADL (possibly involving implicit conversions).
- typename = decltype(std::declval<std::ostream&>()
- << std::declval<const T&>())>
- static void PrintValue(const T& value, ::std::ostream* os) {
- // Call streaming operator found by ADL, possibly with implicit conversions
- // of the arguments.
- *os << value;
- }
-};
-
-} // namespace internal_stream_operator_without_lexical_name_lookup
-
-struct ProtobufPrinter {
- // We print a protobuf using its ShortDebugString() when the string
- // doesn't exceed this many characters; otherwise we print it using
- // DebugString() for better readability.
- static const size_t kProtobufOneLinerMaxLength = 50;
-
- template <typename T,
- typename = typename std::enable_if<
- internal::HasDebugStringAndShortDebugString<T>::value>::type>
- static void PrintValue(const T& value, ::std::ostream* os) {
- std::string pretty_str = value.ShortDebugString();
- if (pretty_str.length() > kProtobufOneLinerMaxLength) {
- pretty_str = "\n" + value.DebugString();
- }
- *os << ("<" + pretty_str + ">");
- }
-};
-
-struct ConvertibleToIntegerPrinter {
- // Since T has no << operator or PrintTo() but can be implicitly
- // converted to BiggestInt, we print it as a BiggestInt.
- //
- // Most likely T is an enum type (either named or unnamed), in which
- // case printing it as an integer is the desired behavior. In case
- // T is not an enum, printing it as an integer is the best we can do
- // given that it has no user-defined printer.
- static void PrintValue(internal::BiggestInt value, ::std::ostream* os) {
- *os << value;
- }
-};
-
-struct ConvertibleToStringViewPrinter {
-#if GTEST_INTERNAL_HAS_STRING_VIEW
- static void PrintValue(internal::StringView value, ::std::ostream* os) {
- internal::UniversalPrint(value, os);
- }
-#endif
-};
-
-
-// Prints the given number of bytes in the given object to the given
-// ostream.
-GTEST_API_ void PrintBytesInObjectTo(const unsigned char* obj_bytes,
- size_t count,
- ::std::ostream* os);
-struct RawBytesPrinter {
- // SFINAE on `sizeof` to make sure we have a complete type.
- template <typename T, size_t = sizeof(T)>
- static void PrintValue(const T& value, ::std::ostream* os) {
- PrintBytesInObjectTo(
- static_cast<const unsigned char*>(
- // Load bearing cast to void* to support iOS
- reinterpret_cast<const void*>(std::addressof(value))),
- sizeof(value), os);
- }
-};
-
-struct FallbackPrinter {
- template <typename T>
- static void PrintValue(const T&, ::std::ostream* os) {
- *os << "(incomplete type)";
- }
-};
-
-// Try every printer in order and return the first one that works.
-template <typename T, typename E, typename Printer, typename... Printers>
-struct FindFirstPrinter : FindFirstPrinter<T, E, Printers...> {};
-
-template <typename T, typename Printer, typename... Printers>
-struct FindFirstPrinter<
- T, decltype(Printer::PrintValue(std::declval<const T&>(), nullptr)),
- Printer, Printers...> {
- using type = Printer;
-};
-
-// Select the best printer in the following order:
-// - Print containers (they have begin/end/etc).
-// - Print function pointers.
-// - Print object pointers.
-// - Use the stream operator, if available.
-// - Print protocol buffers.
-// - Print types convertible to BiggestInt.
-// - Print types convertible to StringView, if available.
-// - Fallback to printing the raw bytes of the object.
-template <typename T>
-void PrintWithFallback(const T& value, ::std::ostream* os) {
- using Printer = typename FindFirstPrinter<
- T, void, ContainerPrinter, FunctionPointerPrinter, PointerPrinter,
- internal_stream_operator_without_lexical_name_lookup::StreamPrinter,
- ProtobufPrinter, ConvertibleToIntegerPrinter,
- ConvertibleToStringViewPrinter, RawBytesPrinter, FallbackPrinter>::type;
- Printer::PrintValue(value, os);
-}
-
-// FormatForComparison<ToPrint, OtherOperand>::Format(value) formats a
-// value of type ToPrint that is an operand of a comparison assertion
-// (e.g. ASSERT_EQ). OtherOperand is the type of the other operand in
-// the comparison, and is used to help determine the best way to
-// format the value. In particular, when the value is a C string
-// (char pointer) and the other operand is an STL string object, we
-// want to format the C string as a string, since we know it is
-// compared by value with the string object. If the value is a char
-// pointer but the other operand is not an STL string object, we don't
-// know whether the pointer is supposed to point to a NUL-terminated
-// string, and thus want to print it as a pointer to be safe.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// The default case.
-template <typename ToPrint, typename OtherOperand>
-class FormatForComparison {
- public:
- static ::std::string Format(const ToPrint& value) {
- return ::testing::PrintToString(value);
- }
-};
-
-// Array.
-template <typename ToPrint, size_t N, typename OtherOperand>
-class FormatForComparison<ToPrint[N], OtherOperand> {
- public:
- static ::std::string Format(const ToPrint* value) {
- return FormatForComparison<const ToPrint*, OtherOperand>::Format(value);
- }
-};
-
-// By default, print C string as pointers to be safe, as we don't know
-// whether they actually point to a NUL-terminated string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
- template <typename OtherOperand> \
- class FormatForComparison<CharType*, OtherOperand> { \
- public: \
- static ::std::string Format(CharType* value) { \
- return ::testing::PrintToString(static_cast<const void*>(value)); \
- } \
- }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(wchar_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const wchar_t);
-#ifdef __cpp_lib_char8_t
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char8_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char8_t);
-#endif
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char16_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char16_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(char32_t);
-GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(const char32_t);
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
-
-// If a C string is compared with an STL string object, we know it's meant
-// to point to a NUL-terminated string, and thus can print it as a string.
-
-#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
- template <> \
- class FormatForComparison<CharType*, OtherStringType> { \
- public: \
- static ::std::string Format(CharType* value) { \
- return ::testing::PrintToString(value); \
- } \
- }
-
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char, ::std::string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char, ::std::string);
-#ifdef __cpp_char8_t
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char8_t, ::std::u8string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char8_t, ::std::u8string);
-#endif
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char16_t, ::std::u16string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char16_t, ::std::u16string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(char32_t, ::std::u32string);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const char32_t, ::std::u32string);
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(wchar_t, ::std::wstring);
-GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(const wchar_t, ::std::wstring);
-#endif
-
-#undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
-
-// Formats a comparison assertion (e.g. ASSERT_EQ, EXPECT_LT, and etc)
-// operand to be used in a failure message. The type (but not value)
-// of the other operand may affect the format. This allows us to
-// print a char* as a raw pointer when it is compared against another
-// char* or void*, and print it as a C string when it is compared
-// against an std::string object, for example.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename T1, typename T2>
-std::string FormatForComparisonFailureMessage(
- const T1& value, const T2& /* other_operand */) {
- return FormatForComparison<T1, T2>::Format(value);
-}
-
-// UniversalPrinter<T>::Print(value, ostream_ptr) prints the given
-// value to the given ostream. The caller must ensure that
-// 'ostream_ptr' is not NULL, or the behavior is undefined.
-//
-// We define UniversalPrinter as a class template (as opposed to a
-// function template), as we need to partially specialize it for
-// reference types, which cannot be done with function templates.
-template <typename T>
-class UniversalPrinter;
-
-// Prints the given value using the << operator if it has one;
-// otherwise prints the bytes in it. This is what
-// UniversalPrinter<T>::Print() does when PrintTo() is not specialized
-// or overloaded for type T.
-//
-// A user can override this behavior for a class type Foo by defining
-// an overload of PrintTo() in the namespace where Foo is defined. We
-// give the user this option as sometimes defining a << operator for
-// Foo is not desirable (e.g. the coding style may prevent doing it,
-// or there is already a << operator but it doesn't do what the user
-// wants).
-template <typename T>
-void PrintTo(const T& value, ::std::ostream* os) {
- internal::PrintWithFallback(value, os);
-}
-
-// The following list of PrintTo() overloads tells
-// UniversalPrinter<T>::Print() how to print standard types (built-in
-// types, strings, plain arrays, and pointers).
-
-// Overloads for various char types.
-GTEST_API_ void PrintTo(unsigned char c, ::std::ostream* os);
-GTEST_API_ void PrintTo(signed char c, ::std::ostream* os);
-inline void PrintTo(char c, ::std::ostream* os) {
- // When printing a plain char, we always treat it as unsigned. This
- // way, the output won't be affected by whether the compiler thinks
- // char is signed or not.
- PrintTo(static_cast<unsigned char>(c), os);
-}
-
-// Overloads for other simple built-in types.
-inline void PrintTo(bool x, ::std::ostream* os) {
- *os << (x ? "true" : "false");
-}
-
-// Overload for wchar_t type.
-// Prints a wchar_t as a symbol if it is printable or as its internal
-// code otherwise and also as its decimal code (except for L'\0').
-// The L'\0' char is printed as "L'\\0'". The decimal code is printed
-// as signed integer when wchar_t is implemented by the compiler
-// as a signed type and is printed as an unsigned integer when wchar_t
-// is implemented as an unsigned type.
-GTEST_API_ void PrintTo(wchar_t wc, ::std::ostream* os);
-
-GTEST_API_ void PrintTo(char32_t c, ::std::ostream* os);
-inline void PrintTo(char16_t c, ::std::ostream* os) {
- PrintTo(ImplicitCast_<char32_t>(c), os);
-}
-#ifdef __cpp_char8_t
-inline void PrintTo(char8_t c, ::std::ostream* os) {
- PrintTo(ImplicitCast_<char32_t>(c), os);
-}
-#endif
-
-// gcc/clang __{u,}int128_t
-#if defined(__SIZEOF_INT128__)
-GTEST_API_ void PrintTo(__uint128_t v, ::std::ostream* os);
-GTEST_API_ void PrintTo(__int128_t v, ::std::ostream* os);
-#endif // __SIZEOF_INT128__
-
-// Overloads for C strings.
-GTEST_API_ void PrintTo(const char* s, ::std::ostream* os);
-inline void PrintTo(char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const char*>(s), os);
-}
-
-// signed/unsigned char is often used for representing binary data, so
-// we print pointers to it as void* to be safe.
-inline void PrintTo(const signed char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(signed char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(const unsigned char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-inline void PrintTo(unsigned char* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const void*>(s), os);
-}
-#ifdef __cpp_char8_t
-// Overloads for u8 strings.
-GTEST_API_ void PrintTo(const char8_t* s, ::std::ostream* os);
-inline void PrintTo(char8_t* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const char8_t*>(s), os);
-}
-#endif
-// Overloads for u16 strings.
-GTEST_API_ void PrintTo(const char16_t* s, ::std::ostream* os);
-inline void PrintTo(char16_t* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const char16_t*>(s), os);
-}
-// Overloads for u32 strings.
-GTEST_API_ void PrintTo(const char32_t* s, ::std::ostream* os);
-inline void PrintTo(char32_t* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const char32_t*>(s), os);
-}
-
-// MSVC can be configured to define wchar_t as a typedef of unsigned
-// short. It defines _NATIVE_WCHAR_T_DEFINED when wchar_t is a native
-// type. When wchar_t is a typedef, defining an overload for const
-// wchar_t* would cause unsigned short* be printed as a wide string,
-// possibly causing invalid memory accesses.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-// Overloads for wide C strings
-GTEST_API_ void PrintTo(const wchar_t* s, ::std::ostream* os);
-inline void PrintTo(wchar_t* s, ::std::ostream* os) {
- PrintTo(ImplicitCast_<const wchar_t*>(s), os);
-}
-#endif
-
-// Overload for C arrays. Multi-dimensional arrays are printed
-// properly.
-
-// Prints the given number of elements in an array, without printing
-// the curly braces.
-template <typename T>
-void PrintRawArrayTo(const T a[], size_t count, ::std::ostream* os) {
- UniversalPrint(a[0], os);
- for (size_t i = 1; i != count; i++) {
- *os << ", ";
- UniversalPrint(a[i], os);
- }
-}
-
-// Overloads for ::std::string.
-GTEST_API_ void PrintStringTo(const ::std::string&s, ::std::ostream* os);
-inline void PrintTo(const ::std::string& s, ::std::ostream* os) {
- PrintStringTo(s, os);
-}
-
-// Overloads for ::std::u8string
-#ifdef __cpp_char8_t
-GTEST_API_ void PrintU8StringTo(const ::std::u8string& s, ::std::ostream* os);
-inline void PrintTo(const ::std::u8string& s, ::std::ostream* os) {
- PrintU8StringTo(s, os);
-}
-#endif
-
-// Overloads for ::std::u16string
-GTEST_API_ void PrintU16StringTo(const ::std::u16string& s, ::std::ostream* os);
-inline void PrintTo(const ::std::u16string& s, ::std::ostream* os) {
- PrintU16StringTo(s, os);
-}
-
-// Overloads for ::std::u32string
-GTEST_API_ void PrintU32StringTo(const ::std::u32string& s, ::std::ostream* os);
-inline void PrintTo(const ::std::u32string& s, ::std::ostream* os) {
- PrintU32StringTo(s, os);
-}
-
-// Overloads for ::std::wstring.
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ void PrintWideStringTo(const ::std::wstring&s, ::std::ostream* os);
-inline void PrintTo(const ::std::wstring& s, ::std::ostream* os) {
- PrintWideStringTo(s, os);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-// Overload for internal::StringView.
-inline void PrintTo(internal::StringView sp, ::std::ostream* os) {
- PrintTo(::std::string(sp), os);
-}
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-inline void PrintTo(std::nullptr_t, ::std::ostream* os) { *os << "(nullptr)"; }
-
-#if GTEST_HAS_RTTI
-inline void PrintTo(const std::type_info& info, std::ostream* os) {
- *os << internal::GetTypeName(info);
-}
-#endif // GTEST_HAS_RTTI
-
-template <typename T>
-void PrintTo(std::reference_wrapper<T> ref, ::std::ostream* os) {
- UniversalPrinter<T&>::Print(ref.get(), os);
-}
-
-inline const void* VoidifyPointer(const void* p) { return p; }
-inline const void* VoidifyPointer(volatile const void* p) {
- return const_cast<const void*>(p);
-}
-
-template <typename T, typename Ptr>
-void PrintSmartPointer(const Ptr& ptr, std::ostream* os, char) {
- if (ptr == nullptr) {
- *os << "(nullptr)";
- } else {
- // We can't print the value. Just print the pointer..
- *os << "(" << (VoidifyPointer)(ptr.get()) << ")";
- }
-}
-template <typename T, typename Ptr,
- typename = typename std::enable_if<!std::is_void<T>::value &&
- !std::is_array<T>::value>::type>
-void PrintSmartPointer(const Ptr& ptr, std::ostream* os, int) {
- if (ptr == nullptr) {
- *os << "(nullptr)";
- } else {
- *os << "(ptr = " << (VoidifyPointer)(ptr.get()) << ", value = ";
- UniversalPrinter<T>::Print(*ptr, os);
- *os << ")";
- }
-}
-
-template <typename T, typename D>
-void PrintTo(const std::unique_ptr<T, D>& ptr, std::ostream* os) {
- (PrintSmartPointer<T>)(ptr, os, 0);
-}
-
-template <typename T>
-void PrintTo(const std::shared_ptr<T>& ptr, std::ostream* os) {
- (PrintSmartPointer<T>)(ptr, os, 0);
-}
-
-// Helper function for printing a tuple. T must be instantiated with
-// a tuple type.
-template <typename T>
-void PrintTupleTo(const T&, std::integral_constant<size_t, 0>,
- ::std::ostream*) {}
-
-template <typename T, size_t I>
-void PrintTupleTo(const T& t, std::integral_constant<size_t, I>,
- ::std::ostream* os) {
- PrintTupleTo(t, std::integral_constant<size_t, I - 1>(), os);
- GTEST_INTENTIONAL_CONST_COND_PUSH_()
- if (I > 1) {
- GTEST_INTENTIONAL_CONST_COND_POP_()
- *os << ", ";
- }
- UniversalPrinter<typename std::tuple_element<I - 1, T>::type>::Print(
- std::get<I - 1>(t), os);
-}
-
-template <typename... Types>
-void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
- *os << "(";
- PrintTupleTo(t, std::integral_constant<size_t, sizeof...(Types)>(), os);
- *os << ")";
-}
-
-// Overload for std::pair.
-template <typename T1, typename T2>
-void PrintTo(const ::std::pair<T1, T2>& value, ::std::ostream* os) {
- *os << '(';
- // We cannot use UniversalPrint(value.first, os) here, as T1 may be
- // a reference type. The same for printing value.second.
- UniversalPrinter<T1>::Print(value.first, os);
- *os << ", ";
- UniversalPrinter<T2>::Print(value.second, os);
- *os << ')';
-}
-
-// Implements printing a non-reference type T by letting the compiler
-// pick the right overload of PrintTo() for T.
-template <typename T>
-class UniversalPrinter {
- public:
- // MSVC warns about adding const to a function type, so we want to
- // disable the warning.
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
-
- // Note: we deliberately don't call this PrintTo(), as that name
- // conflicts with ::testing::internal::PrintTo in the body of the
- // function.
- static void Print(const T& value, ::std::ostream* os) {
- // By default, ::testing::internal::PrintTo() is used for printing
- // the value.
- //
- // Thanks to Koenig look-up, if T is a class and has its own
- // PrintTo() function defined in its namespace, that function will
- // be visible here. Since it is more specific than the generic ones
- // in ::testing::internal, it will be picked by the compiler in the
- // following statement - exactly what we want.
- PrintTo(value, os);
- }
-
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-};
-
-// Remove any const-qualifiers before passing a type to UniversalPrinter.
-template <typename T>
-class UniversalPrinter<const T> : public UniversalPrinter<T> {};
-
-#if GTEST_INTERNAL_HAS_ANY
-
-// Printer for std::any / absl::any
-
-template <>
-class UniversalPrinter<Any> {
- public:
- static void Print(const Any& value, ::std::ostream* os) {
- if (value.has_value()) {
- *os << "value of type " << GetTypeName(value);
- } else {
- *os << "no value";
- }
- }
-
- private:
- static std::string GetTypeName(const Any& value) {
-#if GTEST_HAS_RTTI
- return internal::GetTypeName(value.type());
-#else
- static_cast<void>(value); // possibly unused
- return "<unknown_type>";
-#endif // GTEST_HAS_RTTI
- }
-};
-
-#endif // GTEST_INTERNAL_HAS_ANY
-
-#if GTEST_INTERNAL_HAS_OPTIONAL
-
-// Printer for std::optional / absl::optional
-
-template <typename T>
-class UniversalPrinter<Optional<T>> {
- public:
- static void Print(const Optional<T>& value, ::std::ostream* os) {
- *os << '(';
- if (!value) {
- *os << "nullopt";
- } else {
- UniversalPrint(*value, os);
- }
- *os << ')';
- }
-};
-
-template <>
-class UniversalPrinter<decltype(Nullopt())> {
- public:
- static void Print(decltype(Nullopt()), ::std::ostream* os) {
- *os << "(nullopt)";
- }
-};
-
-#endif // GTEST_INTERNAL_HAS_OPTIONAL
-
-#if GTEST_INTERNAL_HAS_VARIANT
-
-// Printer for std::variant / absl::variant
-
-template <typename... T>
-class UniversalPrinter<Variant<T...>> {
- public:
- static void Print(const Variant<T...>& value, ::std::ostream* os) {
- *os << '(';
-#if GTEST_HAS_ABSL
- absl::visit(Visitor{os, value.index()}, value);
-#else
- std::visit(Visitor{os, value.index()}, value);
-#endif // GTEST_HAS_ABSL
- *os << ')';
- }
-
- private:
- struct Visitor {
- template <typename U>
- void operator()(const U& u) const {
- *os << "'" << GetTypeName<U>() << "(index = " << index
- << ")' with value ";
- UniversalPrint(u, os);
- }
- ::std::ostream* os;
- std::size_t index;
- };
-};
-
-#endif // GTEST_INTERNAL_HAS_VARIANT
-
-// UniversalPrintArray(begin, len, os) prints an array of 'len'
-// elements, starting at address 'begin'.
-template <typename T>
-void UniversalPrintArray(const T* begin, size_t len, ::std::ostream* os) {
- if (len == 0) {
- *os << "{}";
- } else {
- *os << "{ ";
- const size_t kThreshold = 18;
- const size_t kChunkSize = 8;
- // If the array has more than kThreshold elements, we'll have to
- // omit some details by printing only the first and the last
- // kChunkSize elements.
- if (len <= kThreshold) {
- PrintRawArrayTo(begin, len, os);
- } else {
- PrintRawArrayTo(begin, kChunkSize, os);
- *os << ", ..., ";
- PrintRawArrayTo(begin + len - kChunkSize, kChunkSize, os);
- }
- *os << " }";
- }
-}
-// This overload prints a (const) char array compactly.
-GTEST_API_ void UniversalPrintArray(
- const char* begin, size_t len, ::std::ostream* os);
-
-#ifdef __cpp_char8_t
-// This overload prints a (const) char8_t array compactly.
-GTEST_API_ void UniversalPrintArray(const char8_t* begin, size_t len,
- ::std::ostream* os);
-#endif
-
-// This overload prints a (const) char16_t array compactly.
-GTEST_API_ void UniversalPrintArray(const char16_t* begin, size_t len,
- ::std::ostream* os);
-
-// This overload prints a (const) char32_t array compactly.
-GTEST_API_ void UniversalPrintArray(const char32_t* begin, size_t len,
- ::std::ostream* os);
-
-// This overload prints a (const) wchar_t array compactly.
-GTEST_API_ void UniversalPrintArray(
- const wchar_t* begin, size_t len, ::std::ostream* os);
-
-// Implements printing an array type T[N].
-template <typename T, size_t N>
-class UniversalPrinter<T[N]> {
- public:
- // Prints the given array, omitting some elements when there are too
- // many.
- static void Print(const T (&a)[N], ::std::ostream* os) {
- UniversalPrintArray(a, N, os);
- }
-};
-
-// Implements printing a reference type T&.
-template <typename T>
-class UniversalPrinter<T&> {
- public:
- // MSVC warns about adding const to a function type, so we want to
- // disable the warning.
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4180)
-
- static void Print(const T& value, ::std::ostream* os) {
- // Prints the address of the value. We use reinterpret_cast here
- // as static_cast doesn't compile when T is a function type.
- *os << "@" << reinterpret_cast<const void*>(&value) << " ";
-
- // Then prints the value itself.
- UniversalPrint(value, os);
- }
-
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-};
-
-// Prints a value tersely: for a reference type, the referenced value
-// (but not the address) is printed; for a (const) char pointer, the
-// NUL-terminated string (but not the pointer) is printed.
-
-template <typename T>
-class UniversalTersePrinter {
- public:
- static void Print(const T& value, ::std::ostream* os) {
- UniversalPrint(value, os);
- }
-};
-template <typename T>
-class UniversalTersePrinter<T&> {
- public:
- static void Print(const T& value, ::std::ostream* os) {
- UniversalPrint(value, os);
- }
-};
-template <typename T, size_t N>
-class UniversalTersePrinter<T[N]> {
- public:
- static void Print(const T (&value)[N], ::std::ostream* os) {
- UniversalPrinter<T[N]>::Print(value, os);
- }
-};
-template <>
-class UniversalTersePrinter<const char*> {
- public:
- static void Print(const char* str, ::std::ostream* os) {
- if (str == nullptr) {
- *os << "NULL";
- } else {
- UniversalPrint(std::string(str), os);
- }
- }
-};
-template <>
-class UniversalTersePrinter<char*> : public UniversalTersePrinter<const char*> {
-};
-
-#ifdef __cpp_char8_t
-template <>
-class UniversalTersePrinter<const char8_t*> {
- public:
- static void Print(const char8_t* str, ::std::ostream* os) {
- if (str == nullptr) {
- *os << "NULL";
- } else {
- UniversalPrint(::std::u8string(str), os);
- }
- }
-};
-template <>
-class UniversalTersePrinter<char8_t*>
- : public UniversalTersePrinter<const char8_t*> {};
-#endif
-
-template <>
-class UniversalTersePrinter<const char16_t*> {
- public:
- static void Print(const char16_t* str, ::std::ostream* os) {
- if (str == nullptr) {
- *os << "NULL";
- } else {
- UniversalPrint(::std::u16string(str), os);
- }
- }
-};
-template <>
-class UniversalTersePrinter<char16_t*>
- : public UniversalTersePrinter<const char16_t*> {};
-
-template <>
-class UniversalTersePrinter<const char32_t*> {
- public:
- static void Print(const char32_t* str, ::std::ostream* os) {
- if (str == nullptr) {
- *os << "NULL";
- } else {
- UniversalPrint(::std::u32string(str), os);
- }
- }
-};
-template <>
-class UniversalTersePrinter<char32_t*>
- : public UniversalTersePrinter<const char32_t*> {};
-
-#if GTEST_HAS_STD_WSTRING
-template <>
-class UniversalTersePrinter<const wchar_t*> {
- public:
- static void Print(const wchar_t* str, ::std::ostream* os) {
- if (str == nullptr) {
- *os << "NULL";
- } else {
- UniversalPrint(::std::wstring(str), os);
- }
- }
-};
-#endif
-
-template <>
-class UniversalTersePrinter<wchar_t*> {
- public:
- static void Print(wchar_t* str, ::std::ostream* os) {
- UniversalTersePrinter<const wchar_t*>::Print(str, os);
- }
-};
-
-template <typename T>
-void UniversalTersePrint(const T& value, ::std::ostream* os) {
- UniversalTersePrinter<T>::Print(value, os);
-}
-
-// Prints a value using the type inferred by the compiler. The
-// difference between this and UniversalTersePrint() is that for a
-// (const) char pointer, this prints both the pointer and the
-// NUL-terminated string.
-template <typename T>
-void UniversalPrint(const T& value, ::std::ostream* os) {
- // A workarond for the bug in VC++ 7.1 that prevents us from instantiating
- // UniversalPrinter with T directly.
- typedef T T1;
- UniversalPrinter<T1>::Print(value, os);
-}
-
-typedef ::std::vector< ::std::string> Strings;
-
- // Tersely prints the first N fields of a tuple to a string vector,
- // one element for each field.
-template <typename Tuple>
-void TersePrintPrefixToStrings(const Tuple&, std::integral_constant<size_t, 0>,
- Strings*) {}
-template <typename Tuple, size_t I>
-void TersePrintPrefixToStrings(const Tuple& t,
- std::integral_constant<size_t, I>,
- Strings* strings) {
- TersePrintPrefixToStrings(t, std::integral_constant<size_t, I - 1>(),
- strings);
- ::std::stringstream ss;
- UniversalTersePrint(std::get<I - 1>(t), &ss);
- strings->push_back(ss.str());
-}
-
-// Prints the fields of a tuple tersely to a string vector, one
-// element for each field. See the comment before
-// UniversalTersePrint() for how we define "tersely".
-template <typename Tuple>
-Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
- Strings result;
- TersePrintPrefixToStrings(
- value, std::integral_constant<size_t, std::tuple_size<Tuple>::value>(),
- &result);
- return result;
-}
-
-} // namespace internal
-
-template <typename T>
-::std::string PrintToString(const T& value) {
- ::std::stringstream ss;
- internal::UniversalTersePrinter<T>::Print(value, &ss);
- return ss.str();
-}
-
-} // namespace testing
-
-// Include any custom printer added by the local installation.
-// We must include this header at the end to make sure it can use the
-// declarations from this file.
-#include "gtest/internal/custom/gtest-printers.h"
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PRINTERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-spi.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-spi.h
deleted file mode 100644
index 12c94e4a28..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-spi.h
+++ /dev/null
@@ -1,235 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utilities for testing Google Test itself and code that uses Google Test
-// (e.g. frameworks built on top of Google Test).
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_
-
-#include "gtest/gtest.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-namespace testing {
-
-// This helper class can be used to mock out Google Test failure reporting
-// so that we can test Google Test or code that builds on Google Test.
-//
-// An object of this class appends a TestPartResult object to the
-// TestPartResultArray object given in the constructor whenever a Google Test
-// failure is reported. It can either intercept only failures that are
-// generated in the same thread that created this object or it can intercept
-// all generated failures. The scope of this mock object can be controlled with
-// the second argument to the two arguments constructor.
-class GTEST_API_ ScopedFakeTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- // The two possible mocking modes of this object.
- enum InterceptMode {
- INTERCEPT_ONLY_CURRENT_THREAD, // Intercepts only thread local failures.
- INTERCEPT_ALL_THREADS // Intercepts all failures.
- };
-
- // The c'tor sets this object as the test part result reporter used
- // by Google Test. The 'result' parameter specifies where to report the
- // results. This reporter will only catch failures generated in the current
- // thread. DEPRECATED
- explicit ScopedFakeTestPartResultReporter(TestPartResultArray* result);
-
- // Same as above, but you can choose the interception scope of this object.
- ScopedFakeTestPartResultReporter(InterceptMode intercept_mode,
- TestPartResultArray* result);
-
- // The d'tor restores the previous test part result reporter.
- ~ScopedFakeTestPartResultReporter() override;
-
- // Appends the TestPartResult object to the TestPartResultArray
- // received in the constructor.
- //
- // This method is from the TestPartResultReporterInterface
- // interface.
- void ReportTestPartResult(const TestPartResult& result) override;
-
- private:
- void Init();
-
- const InterceptMode intercept_mode_;
- TestPartResultReporterInterface* old_reporter_;
- TestPartResultArray* const result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedFakeTestPartResultReporter);
-};
-
-namespace internal {
-
-// A helper class for implementing EXPECT_FATAL_FAILURE() and
-// EXPECT_NONFATAL_FAILURE(). Its destructor verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-class GTEST_API_ SingleFailureChecker {
- public:
- // The constructor remembers the arguments.
- SingleFailureChecker(const TestPartResultArray* results,
- TestPartResult::Type type, const std::string& substr);
- ~SingleFailureChecker();
- private:
- const TestPartResultArray* const results_;
- const TestPartResult::Type type_;
- const std::string substr_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SingleFailureChecker);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-// A set of macros for testing Google Test assertions or code that's expected
-// to generate Google Test fatal failures. It verifies that the given
-// statement will cause exactly one fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_FATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_FATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - 'statement' cannot reference local non-static variables or
-// non-static members of the current object.
-// - 'statement' cannot return a value.
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. The AcceptsMacroThatExpandsToUnprotectedComma test in
-// gtest_unittest.cc will fail to compile if we do that.
-#define EXPECT_FATAL_FAILURE(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_FATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do { \
- class GTestExpectFatalFailureHelper {\
- public:\
- static void Execute() { statement; }\
- };\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kFatalFailure, (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ALL_THREADS, &gtest_failures);\
- GTestExpectFatalFailureHelper::Execute();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-// A macro for testing Google Test assertions or code that's expected to
-// generate Google Test non-fatal failures. It asserts that the given
-// statement will cause exactly one non-fatal Google Test failure with 'substr'
-// being part of the failure message.
-//
-// There are two different versions of this macro. EXPECT_NONFATAL_FAILURE only
-// affects and considers failures generated in the current thread and
-// EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS does the same but for all threads.
-//
-// 'statement' is allowed to reference local variables and members of
-// the current object.
-//
-// The verification of the assertion is done correctly even when the statement
-// throws an exception or aborts the current function.
-//
-// Known restrictions:
-// - You cannot stream a failure message to this macro.
-//
-// Note that even though the implementations of the following two
-// macros are much alike, we cannot refactor them to use a common
-// helper macro, due to some peculiarity in how the preprocessor
-// works. If we do that, the code won't compile when the user gives
-// EXPECT_NONFATAL_FAILURE() a statement that contains a macro that
-// expands to code containing an unprotected comma. The
-// AcceptsMacroThatExpandsToUnprotectedComma test in gtest_unittest.cc
-// catches that.
-//
-// For the same reason, we have to write
-// if (::testing::internal::AlwaysTrue()) { statement; }
-// instead of
-// GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
-// to avoid an MSVC warning on unreachable code.
-#define EXPECT_NONFATAL_FAILURE(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter:: \
- INTERCEPT_ONLY_CURRENT_THREAD, &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#define EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(statement, substr) \
- do {\
- ::testing::TestPartResultArray gtest_failures;\
- ::testing::internal::SingleFailureChecker gtest_checker(\
- &gtest_failures, ::testing::TestPartResult::kNonFatalFailure, \
- (substr));\
- {\
- ::testing::ScopedFakeTestPartResultReporter gtest_reporter(\
- ::testing::ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, \
- &gtest_failures);\
- if (::testing::internal::AlwaysTrue()) { statement; }\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_SPI_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-test-part.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-test-part.h
deleted file mode 100644
index 39393b212c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-test-part.h
+++ /dev/null
@@ -1,186 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
-
-#include <iosfwd>
-#include <vector>
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-namespace testing {
-
-// A copyable object representing the result of a test part (i.e. an
-// assertion or an explicit FAIL(), ADD_FAILURE(), or SUCCESS()).
-//
-// Don't inherit from TestPartResult as its destructor is not virtual.
-class GTEST_API_ TestPartResult {
- public:
- // The possible outcomes of a test part (i.e. an assertion or an
- // explicit SUCCEED(), FAIL(), or ADD_FAILURE()).
- enum Type {
- kSuccess, // Succeeded.
- kNonFatalFailure, // Failed but the test can continue.
- kFatalFailure, // Failed and the test should be terminated.
- kSkip // Skipped.
- };
-
- // C'tor. TestPartResult does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestPartResult object.
- TestPartResult(Type a_type, const char* a_file_name, int a_line_number,
- const char* a_message)
- : type_(a_type),
- file_name_(a_file_name == nullptr ? "" : a_file_name),
- line_number_(a_line_number),
- summary_(ExtractSummary(a_message)),
- message_(a_message) {}
-
- // Gets the outcome of the test part.
- Type type() const { return type_; }
-
- // Gets the name of the source file where the test part took place, or
- // NULL if it's unknown.
- const char* file_name() const {
- return file_name_.empty() ? nullptr : file_name_.c_str();
- }
-
- // Gets the line in the source file where the test part took place,
- // or -1 if it's unknown.
- int line_number() const { return line_number_; }
-
- // Gets the summary of the failure message.
- const char* summary() const { return summary_.c_str(); }
-
- // Gets the message associated with the test part.
- const char* message() const { return message_.c_str(); }
-
- // Returns true if and only if the test part was skipped.
- bool skipped() const { return type_ == kSkip; }
-
- // Returns true if and only if the test part passed.
- bool passed() const { return type_ == kSuccess; }
-
- // Returns true if and only if the test part non-fatally failed.
- bool nonfatally_failed() const { return type_ == kNonFatalFailure; }
-
- // Returns true if and only if the test part fatally failed.
- bool fatally_failed() const { return type_ == kFatalFailure; }
-
- // Returns true if and only if the test part failed.
- bool failed() const { return fatally_failed() || nonfatally_failed(); }
-
- private:
- Type type_;
-
- // Gets the summary of the failure message by omitting the stack
- // trace in it.
- static std::string ExtractSummary(const char* message);
-
- // The name of the source file where the test part took place, or
- // "" if the source file is unknown.
- std::string file_name_;
- // The line in the source file where the test part took place, or -1
- // if the line number is unknown.
- int line_number_;
- std::string summary_; // The test failure summary.
- std::string message_; // The test failure message.
-};
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result);
-
-// An array of TestPartResult objects.
-//
-// Don't inherit from TestPartResultArray as its destructor is not
-// virtual.
-class GTEST_API_ TestPartResultArray {
- public:
- TestPartResultArray() {}
-
- // Appends the given TestPartResult to the array.
- void Append(const TestPartResult& result);
-
- // Returns the TestPartResult at the given index (0-based).
- const TestPartResult& GetTestPartResult(int index) const;
-
- // Returns the number of TestPartResult objects in the array.
- int size() const;
-
- private:
- std::vector<TestPartResult> array_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestPartResultArray);
-};
-
-// This interface knows how to report a test part result.
-class GTEST_API_ TestPartResultReporterInterface {
- public:
- virtual ~TestPartResultReporterInterface() {}
-
- virtual void ReportTestPartResult(const TestPartResult& result) = 0;
-};
-
-namespace internal {
-
-// This helper class is used by {ASSERT|EXPECT}_NO_FATAL_FAILURE to check if a
-// statement generates new fatal failures. To do so it registers itself as the
-// current test part result reporter. Besides checking if fatal failures were
-// reported, it only delegates the reporting to the former result reporter.
-// The original result reporter is restored in the destructor.
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-class GTEST_API_ HasNewFatalFailureHelper
- : public TestPartResultReporterInterface {
- public:
- HasNewFatalFailureHelper();
- ~HasNewFatalFailureHelper() override;
- void ReportTestPartResult(const TestPartResult& result) override;
- bool has_new_fatal_failure() const { return has_new_fatal_failure_; }
- private:
- bool has_new_fatal_failure_;
- TestPartResultReporterInterface* original_reporter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(HasNewFatalFailureHelper);
-};
-
-} // namespace internal
-
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_TEST_PART_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-typed-test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-typed-test.h
deleted file mode 100644
index 343bf6fe98..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest-typed-test.h
+++ /dev/null
@@ -1,331 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
-
-// This header implements typed tests and type-parameterized tests.
-
-// Typed (aka type-driven) tests repeat the same test for types in a
-// list. You must know which types you want to test with when writing
-// typed tests. Here's how you do it:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- public:
- ...
- typedef std::list<T> List;
- static T shared_;
- T value_;
-};
-
-// Next, associate a list of types with the test suite, which will be
-// repeated for each type in the list. The typedef is necessary for
-// the macro to parse correctly.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-TYPED_TEST_SUITE(FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// TYPED_TEST_SUITE(FooTest, int);
-
-// Then, use TYPED_TEST() instead of TEST_F() to define as many typed
-// tests for this test suite as you want.
-TYPED_TEST(FooTest, DoesBlah) {
- // Inside a test, refer to the special name TypeParam to get the type
- // parameter. Since we are inside a derived class template, C++ requires
- // us to visit the members of FooTest via 'this'.
- TypeParam n = this->value_;
-
- // To visit static members of the fixture, add the TestFixture::
- // prefix.
- n += TestFixture::shared_;
-
- // To refer to typedefs in the fixture, add the "typename
- // TestFixture::" prefix.
- typename TestFixture::List values;
- values.push_back(n);
- ...
-}
-
-TYPED_TEST(FooTest, HasPropertyA) { ... }
-
-// TYPED_TEST_SUITE takes an optional third argument which allows to specify a
-// class that generates custom test name suffixes based on the type. This should
-// be a class which has a static template function GetName(int index) returning
-// a string for each type. The provided integer index equals the index of the
-// type in the provided type list. In many cases the index can be ignored.
-//
-// For example:
-// class MyTypeNames {
-// public:
-// template <typename T>
-// static std::string GetName(int) {
-// if (std::is_same<T, char>()) return "char";
-// if (std::is_same<T, int>()) return "int";
-// if (std::is_same<T, unsigned int>()) return "unsignedInt";
-// }
-// };
-// TYPED_TEST_SUITE(FooTest, MyTypes, MyTypeNames);
-
-#endif // 0
-
-// Type-parameterized tests are abstract test patterns parameterized
-// by a type. Compared with typed tests, type-parameterized tests
-// allow you to define the test pattern without knowing what the type
-// parameters are. The defined pattern can be instantiated with
-// different types any number of times, in any number of translation
-// units.
-//
-// If you are designing an interface or concept, you can define a
-// suite of type-parameterized tests to verify properties that any
-// valid implementation of the interface/concept should have. Then,
-// each implementation can easily instantiate the test suite to verify
-// that it conforms to the requirements, without having to write
-// similar tests repeatedly. Here's an example:
-
-#if 0
-
-// First, define a fixture class template. It should be parameterized
-// by a type. Remember to derive it from testing::Test.
-template <typename T>
-class FooTest : public testing::Test {
- ...
-};
-
-// Next, declare that you will define a type-parameterized test suite
-// (the _P suffix is for "parameterized" or "pattern", whichever you
-// prefer):
-TYPED_TEST_SUITE_P(FooTest);
-
-// Then, use TYPED_TEST_P() to define as many type-parameterized tests
-// for this type-parameterized test suite as you want.
-TYPED_TEST_P(FooTest, DoesBlah) {
- // Inside a test, refer to TypeParam to get the type parameter.
- TypeParam n = 0;
- ...
-}
-
-TYPED_TEST_P(FooTest, HasPropertyA) { ... }
-
-// Now the tricky part: you need to register all test patterns before
-// you can instantiate them. The first argument of the macro is the
-// test suite name; the rest are the names of the tests in this test
-// case.
-REGISTER_TYPED_TEST_SUITE_P(FooTest,
- DoesBlah, HasPropertyA);
-
-// Finally, you are free to instantiate the pattern with the types you
-// want. If you put the above code in a header file, you can #include
-// it in multiple C++ source files and instantiate it multiple times.
-//
-// To distinguish different instances of the pattern, the first
-// argument to the INSTANTIATE_* macro is a prefix that will be added
-// to the actual test suite name. Remember to pick unique prefixes for
-// different instances.
-typedef testing::Types<char, int, unsigned int> MyTypes;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes);
-
-// If the type list contains only one type, you can write that type
-// directly without Types<...>:
-// INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, int);
-//
-// Similar to the optional argument of TYPED_TEST_SUITE above,
-// INSTANTIATE_TEST_SUITE_P takes an optional fourth argument which allows to
-// generate custom names.
-// INSTANTIATE_TYPED_TEST_SUITE_P(My, FooTest, MyTypes, MyTypeNames);
-
-#endif // 0
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/gtest-type-util.h"
-
-// Implements typed tests.
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the typedef for the type parameters of the
-// given test suite.
-#define GTEST_TYPE_PARAMS_(TestSuiteName) gtest_type_params_##TestSuiteName##_
-
-// Expands to the name of the typedef for the NameGenerator, responsible for
-// creating the suffixes of the name.
-#define GTEST_NAME_GENERATOR_(TestSuiteName) \
- gtest_type_params_##TestSuiteName##_NameGenerator
-
-#define TYPED_TEST_SUITE(CaseName, Types, ...) \
- typedef ::testing::internal::GenerateTypeList<Types>::type \
- GTEST_TYPE_PARAMS_(CaseName); \
- typedef ::testing::internal::NameGeneratorSelector<__VA_ARGS__>::type \
- GTEST_NAME_GENERATOR_(CaseName)
-
-#define TYPED_TEST(CaseName, TestName) \
- static_assert(sizeof(GTEST_STRINGIFY_(TestName)) > 1, \
- "test-name must not be empty"); \
- template <typename gtest_TypeParam_> \
- class GTEST_TEST_CLASS_NAME_(CaseName, TestName) \
- : public CaseName<gtest_TypeParam_> { \
- private: \
- typedef CaseName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- void TestBody() override; \
- }; \
- static bool gtest_##CaseName##_##TestName##_registered_ \
- GTEST_ATTRIBUTE_UNUSED_ = ::testing::internal::TypeParameterizedTest< \
- CaseName, \
- ::testing::internal::TemplateSel<GTEST_TEST_CLASS_NAME_(CaseName, \
- TestName)>, \
- GTEST_TYPE_PARAMS_( \
- CaseName)>::Register("", \
- ::testing::internal::CodeLocation( \
- __FILE__, __LINE__), \
- GTEST_STRINGIFY_(CaseName), \
- GTEST_STRINGIFY_(TestName), 0, \
- ::testing::internal::GenerateNames< \
- GTEST_NAME_GENERATOR_(CaseName), \
- GTEST_TYPE_PARAMS_(CaseName)>()); \
- template <typename gtest_TypeParam_> \
- void GTEST_TEST_CLASS_NAME_(CaseName, \
- TestName)<gtest_TypeParam_>::TestBody()
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-#define TYPED_TEST_CASE \
- static_assert(::testing::internal::TypedTestCaseIsDeprecated(), ""); \
- TYPED_TEST_SUITE
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-// Implements type-parameterized tests.
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the namespace name that the type-parameterized tests for
-// the given type-parameterized test suite are defined in. The exact
-// name of the namespace is subject to change without notice.
-#define GTEST_SUITE_NAMESPACE_(TestSuiteName) gtest_suite_##TestSuiteName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Expands to the name of the variable used to remember the names of
-// the defined tests in the given test suite.
-#define GTEST_TYPED_TEST_SUITE_P_STATE_(TestSuiteName) \
- gtest_typed_test_suite_p_state_##TestSuiteName##_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE DIRECTLY.
-//
-// Expands to the name of the variable used to remember the names of
-// the registered tests in the given test suite.
-#define GTEST_REGISTERED_TEST_NAMES_(TestSuiteName) \
- gtest_registered_test_names_##TestSuiteName##_
-
-// The variables defined in the type-parameterized test macros are
-// static as typically these macros are used in a .h file that can be
-// #included in multiple translation units linked together.
-#define TYPED_TEST_SUITE_P(SuiteName) \
- static ::testing::internal::TypedTestSuitePState \
- GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName)
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-#define TYPED_TEST_CASE_P \
- static_assert(::testing::internal::TypedTestCase_P_IsDeprecated(), ""); \
- TYPED_TEST_SUITE_P
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-#define TYPED_TEST_P(SuiteName, TestName) \
- namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \
- template <typename gtest_TypeParam_> \
- class TestName : public SuiteName<gtest_TypeParam_> { \
- private: \
- typedef SuiteName<gtest_TypeParam_> TestFixture; \
- typedef gtest_TypeParam_ TypeParam; \
- void TestBody() override; \
- }; \
- static bool gtest_##TestName##_defined_ GTEST_ATTRIBUTE_UNUSED_ = \
- GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).AddTestName( \
- __FILE__, __LINE__, GTEST_STRINGIFY_(SuiteName), \
- GTEST_STRINGIFY_(TestName)); \
- } \
- template <typename gtest_TypeParam_> \
- void GTEST_SUITE_NAMESPACE_( \
- SuiteName)::TestName<gtest_TypeParam_>::TestBody()
-
-// Note: this won't work correctly if the trailing arguments are macros.
-#define REGISTER_TYPED_TEST_SUITE_P(SuiteName, ...) \
- namespace GTEST_SUITE_NAMESPACE_(SuiteName) { \
- typedef ::testing::internal::Templates<__VA_ARGS__> gtest_AllTests_; \
- } \
- static const char* const GTEST_REGISTERED_TEST_NAMES_( \
- SuiteName) GTEST_ATTRIBUTE_UNUSED_ = \
- GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName).VerifyRegisteredTestNames( \
- GTEST_STRINGIFY_(SuiteName), __FILE__, __LINE__, #__VA_ARGS__)
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-#define REGISTER_TYPED_TEST_CASE_P \
- static_assert(::testing::internal::RegisterTypedTestCase_P_IsDeprecated(), \
- ""); \
- REGISTER_TYPED_TEST_SUITE_P
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-#define INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, SuiteName, Types, ...) \
- static_assert(sizeof(GTEST_STRINGIFY_(Prefix)) > 1, \
- "test-suit-prefix must not be empty"); \
- static bool gtest_##Prefix##_##SuiteName GTEST_ATTRIBUTE_UNUSED_ = \
- ::testing::internal::TypeParameterizedTestSuite< \
- SuiteName, GTEST_SUITE_NAMESPACE_(SuiteName)::gtest_AllTests_, \
- ::testing::internal::GenerateTypeList<Types>::type>:: \
- Register(GTEST_STRINGIFY_(Prefix), \
- ::testing::internal::CodeLocation(__FILE__, __LINE__), \
- &GTEST_TYPED_TEST_SUITE_P_STATE_(SuiteName), \
- GTEST_STRINGIFY_(SuiteName), \
- GTEST_REGISTERED_TEST_NAMES_(SuiteName), \
- ::testing::internal::GenerateNames< \
- ::testing::internal::NameGeneratorSelector< \
- __VA_ARGS__>::type, \
- ::testing::internal::GenerateTypeList<Types>::type>())
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-#define INSTANTIATE_TYPED_TEST_CASE_P \
- static_assert( \
- ::testing::internal::InstantiateTypedTestCase_P_IsDeprecated(), ""); \
- INSTANTIATE_TYPED_TEST_SUITE_P
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_TYPED_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest.h
deleted file mode 100644
index a4174cd4e5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest.h
+++ /dev/null
@@ -1,2316 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file defines the public API for Google Test. It should be
-// included by any test program that uses Google Test.
-//
-// IMPORTANT NOTE: Due to limitation of the C++ language, we have to
-// leave some internal implementation details in this header file.
-// They are clearly marked by comments like this:
-//
-// // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-//
-// Such code is NOT meant to be used by a user directly, and is subject
-// to CHANGE WITHOUT NOTICE. Therefore DO NOT DEPEND ON IT in a user
-// program!
-//
-// Acknowledgment: Google Test borrowed the idea of automatic test
-// registration from Barthelemy Dagenais' (barthelemy@prologique.com)
-// easyUnit framework.
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_H_
-
-#include <cstddef>
-#include <limits>
-#include <memory>
-#include <ostream>
-#include <type_traits>
-#include <vector>
-
-#include "gtest/gtest-assertion-result.h"
-#include "gtest/gtest-death-test.h"
-#include "gtest/gtest-matchers.h"
-#include "gtest/gtest-message.h"
-#include "gtest/gtest-param-test.h"
-#include "gtest/gtest-printers.h"
-#include "gtest/gtest-test-part.h"
-#include "gtest/gtest-typed-test.h"
-#include "gtest/gtest_pred_impl.h"
-#include "gtest/gtest_prod.h"
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-// Declares the flags.
-
-// This flag temporary enables the disabled tests.
-GTEST_DECLARE_bool_(also_run_disabled_tests);
-
-// This flag brings the debugger on an assertion failure.
-GTEST_DECLARE_bool_(break_on_failure);
-
-// This flag controls whether Google Test catches all test-thrown exceptions
-// and logs them as failures.
-GTEST_DECLARE_bool_(catch_exceptions);
-
-// This flag enables using colors in terminal output. Available values are
-// "yes" to enable colors, "no" (disable colors), or "auto" (the default)
-// to let Google Test decide.
-GTEST_DECLARE_string_(color);
-
-// This flag controls whether the test runner should continue execution past
-// first failure.
-GTEST_DECLARE_bool_(fail_fast);
-
-// This flag sets up the filter to select by name using a glob pattern
-// the tests to run. If the filter is not given all tests are executed.
-GTEST_DECLARE_string_(filter);
-
-// This flag controls whether Google Test installs a signal handler that dumps
-// debugging information when fatal signals are raised.
-GTEST_DECLARE_bool_(install_failure_signal_handler);
-
-// This flag causes the Google Test to list tests. None of the tests listed
-// are actually run if the flag is provided.
-GTEST_DECLARE_bool_(list_tests);
-
-// This flag controls whether Google Test emits a detailed XML report to a file
-// in addition to its normal textual output.
-GTEST_DECLARE_string_(output);
-
-// This flags control whether Google Test prints only test failures.
-GTEST_DECLARE_bool_(brief);
-
-// This flags control whether Google Test prints the elapsed time for each
-// test.
-GTEST_DECLARE_bool_(print_time);
-
-// This flags control whether Google Test prints UTF8 characters as text.
-GTEST_DECLARE_bool_(print_utf8);
-
-// This flag specifies the random number seed.
-GTEST_DECLARE_int32_(random_seed);
-
-// This flag sets how many times the tests are repeated. The default value
-// is 1. If the value is -1 the tests are repeating forever.
-GTEST_DECLARE_int32_(repeat);
-
-// This flag controls whether Google Test Environments are recreated for each
-// repeat of the tests. The default value is true. If set to false the global
-// test Environment objects are only set up once, for the first iteration, and
-// only torn down once, for the last.
-GTEST_DECLARE_bool_(recreate_environments_when_repeating);
-
-// This flag controls whether Google Test includes Google Test internal
-// stack frames in failure stack traces.
-GTEST_DECLARE_bool_(show_internal_stack_frames);
-
-// When this flag is specified, tests' order is randomized on every iteration.
-GTEST_DECLARE_bool_(shuffle);
-
-// This flag specifies the maximum number of stack frames to be
-// printed in a failure message.
-GTEST_DECLARE_int32_(stack_trace_depth);
-
-// When this flag is specified, a failed assertion will throw an
-// exception if exceptions are enabled, or exit the program with a
-// non-zero code otherwise. For use with an external test framework.
-GTEST_DECLARE_bool_(throw_on_failure);
-
-// When this flag is set with a "host:port" string, on supported
-// platforms test results are streamed to the specified port on
-// the specified host machine.
-GTEST_DECLARE_string_(stream_result_to);
-
-#if GTEST_USE_OWN_FLAGFILE_FLAG_
-GTEST_DECLARE_string_(flagfile);
-#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
-
-namespace testing {
-
-// Silence C4100 (unreferenced formal parameter) and 4805
-// unsafe mix of type 'const int' and type 'const bool'
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4805)
-#pragma warning(disable : 4100)
-#endif
-
-// The upper limit for valid stack trace depths.
-const int kMaxStackTraceDepth = 100;
-
-namespace internal {
-
-class AssertHelper;
-class DefaultGlobalTestPartResultReporter;
-class ExecDeathTest;
-class NoExecDeathTest;
-class FinalSuccessChecker;
-class GTestFlagSaver;
-class StreamingListenerTest;
-class TestResultAccessor;
-class TestEventListenersAccessor;
-class TestEventRepeater;
-class UnitTestRecordPropertyTestHelper;
-class WindowsDeathTest;
-class FuchsiaDeathTest;
-class UnitTestImpl* GetUnitTestImpl();
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const std::string& message);
-std::set<std::string>* GetIgnoredParameterizedTestSuites();
-
-} // namespace internal
-
-// The friend relationship of some of these classes is cyclic.
-// If we don't forward declare them the compiler might confuse the classes
-// in friendship clauses with same named classes on the scope.
-class Test;
-class TestSuite;
-
-// Old API is still available but deprecated
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-using TestCase = TestSuite;
-#endif
-class TestInfo;
-class UnitTest;
-
-// The abstract class that all tests inherit from.
-//
-// In Google Test, a unit test program contains one or many TestSuites, and
-// each TestSuite contains one or many Tests.
-//
-// When you define a test using the TEST macro, you don't need to
-// explicitly derive from Test - the TEST macro automatically does
-// this for you.
-//
-// The only time you derive from Test is when defining a test fixture
-// to be used in a TEST_F. For example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// void SetUp() override { ... }
-// void TearDown() override { ... }
-// ...
-// };
-//
-// TEST_F(FooTest, Bar) { ... }
-// TEST_F(FooTest, Baz) { ... }
-//
-// Test is not copyable.
-class GTEST_API_ Test {
- public:
- friend class TestInfo;
-
- // The d'tor is virtual as we intend to inherit from Test.
- virtual ~Test();
-
- // Sets up the stuff shared by all tests in this test suite.
- //
- // Google Test will call Foo::SetUpTestSuite() before running the first
- // test in test suite Foo. Hence a sub-class can define its own
- // SetUpTestSuite() method to shadow the one defined in the super
- // class.
- static void SetUpTestSuite() {}
-
- // Tears down the stuff shared by all tests in this test suite.
- //
- // Google Test will call Foo::TearDownTestSuite() after running the last
- // test in test suite Foo. Hence a sub-class can define its own
- // TearDownTestSuite() method to shadow the one defined in the super
- // class.
- static void TearDownTestSuite() {}
-
- // Legacy API is deprecated but still available. Use SetUpTestSuite and
- // TearDownTestSuite instead.
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- static void TearDownTestCase() {}
- static void SetUpTestCase() {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Returns true if and only if the current test has a fatal failure.
- static bool HasFatalFailure();
-
- // Returns true if and only if the current test has a non-fatal failure.
- static bool HasNonfatalFailure();
-
- // Returns true if and only if the current test was skipped.
- static bool IsSkipped();
-
- // Returns true if and only if the current test has a (either fatal or
- // non-fatal) failure.
- static bool HasFailure() { return HasFatalFailure() || HasNonfatalFailure(); }
-
- // Logs a property for the current test, test suite, or for the entire
- // invocation of the test program when used outside of the context of a
- // test suite. Only the last value for a given key is remembered. These
- // are public static so they can be called from utility functions that are
- // not members of the test fixture. Calls to RecordProperty made during
- // lifespan of the test (from the moment its constructor starts to the
- // moment its destructor finishes) will be output in XML as attributes of
- // the <testcase> element. Properties recorded from fixture's
- // SetUpTestSuite or TearDownTestSuite are logged as attributes of the
- // corresponding <testsuite> element. Calls to RecordProperty made in the
- // global context (before or after invocation of RUN_ALL_TESTS and from
- // SetUp/TearDown method of Environment objects registered with Google
- // Test) will be output as attributes of the <testsuites> element.
- static void RecordProperty(const std::string& key, const std::string& value);
- static void RecordProperty(const std::string& key, int value);
-
- protected:
- // Creates a Test object.
- Test();
-
- // Sets up the test fixture.
- virtual void SetUp();
-
- // Tears down the test fixture.
- virtual void TearDown();
-
- private:
- // Returns true if and only if the current test has the same fixture class
- // as the first test in the current test suite.
- static bool HasSameFixtureClass();
-
- // Runs the test after the test fixture has been set up.
- //
- // A sub-class must implement this to define the test logic.
- //
- // DO NOT OVERRIDE THIS FUNCTION DIRECTLY IN A USER PROGRAM.
- // Instead, use the TEST or TEST_F macro.
- virtual void TestBody() = 0;
-
- // Sets up, executes, and tears down the test.
- void Run();
-
- // Deletes self. We deliberately pick an unusual name for this
- // internal method to avoid clashing with names used in user TESTs.
- void DeleteSelf_() { delete this; }
-
- const std::unique_ptr<GTEST_FLAG_SAVER_> gtest_flag_saver_;
-
- // Often a user misspells SetUp() as Setup() and spends a long time
- // wondering why it is never called by Google Test. The declaration of
- // the following method is solely for catching such an error at
- // compile time:
- //
- // - The return type is deliberately chosen to be not void, so it
- // will be a conflict if void Setup() is declared in the user's
- // test fixture.
- //
- // - This method is private, so it will be another compiler error
- // if the method is called from the user's test fixture.
- //
- // DO NOT OVERRIDE THIS FUNCTION.
- //
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; }
-
- // We disallow copying Tests.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Test);
-};
-
-typedef internal::TimeInMillis TimeInMillis;
-
-// A copyable object representing a user specified test property which can be
-// output as a key/value string pair.
-//
-// Don't inherit from TestProperty as its destructor is not virtual.
-class TestProperty {
- public:
- // C'tor. TestProperty does NOT have a default constructor.
- // Always use this constructor (with parameters) to create a
- // TestProperty object.
- TestProperty(const std::string& a_key, const std::string& a_value) :
- key_(a_key), value_(a_value) {
- }
-
- // Gets the user supplied key.
- const char* key() const {
- return key_.c_str();
- }
-
- // Gets the user supplied value.
- const char* value() const {
- return value_.c_str();
- }
-
- // Sets a new value, overriding the one supplied in the constructor.
- void SetValue(const std::string& new_value) {
- value_ = new_value;
- }
-
- private:
- // The key supplied by the user.
- std::string key_;
- // The value supplied by the user.
- std::string value_;
-};
-
-// The result of a single Test. This includes a list of
-// TestPartResults, a list of TestProperties, a count of how many
-// death tests there are in the Test, and how much time it took to run
-// the Test.
-//
-// TestResult is not copyable.
-class GTEST_API_ TestResult {
- public:
- // Creates an empty TestResult.
- TestResult();
-
- // D'tor. Do not inherit from TestResult.
- ~TestResult();
-
- // Gets the number of all test parts. This is the sum of the number
- // of successful test parts and the number of failed test parts.
- int total_part_count() const;
-
- // Returns the number of the test properties.
- int test_property_count() const;
-
- // Returns true if and only if the test passed (i.e. no test part failed).
- bool Passed() const { return !Skipped() && !Failed(); }
-
- // Returns true if and only if the test was skipped.
- bool Skipped() const;
-
- // Returns true if and only if the test failed.
- bool Failed() const;
-
- // Returns true if and only if the test fatally failed.
- bool HasFatalFailure() const;
-
- // Returns true if and only if the test has a non-fatal failure.
- bool HasNonfatalFailure() const;
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Gets the time of the test case start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const { return start_timestamp_; }
-
- // Returns the i-th test part result among all the results. i can range from 0
- // to total_part_count() - 1. If i is not in that range, aborts the program.
- const TestPartResult& GetTestPartResult(int i) const;
-
- // Returns the i-th test property. i can range from 0 to
- // test_property_count() - 1. If i is not in that range, aborts the
- // program.
- const TestProperty& GetTestProperty(int i) const;
-
- private:
- friend class TestInfo;
- friend class TestSuite;
- friend class UnitTest;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::ExecDeathTest;
- friend class internal::TestResultAccessor;
- friend class internal::UnitTestImpl;
- friend class internal::WindowsDeathTest;
- friend class internal::FuchsiaDeathTest;
-
- // Gets the vector of TestPartResults.
- const std::vector<TestPartResult>& test_part_results() const {
- return test_part_results_;
- }
-
- // Gets the vector of TestProperties.
- const std::vector<TestProperty>& test_properties() const {
- return test_properties_;
- }
-
- // Sets the start time.
- void set_start_timestamp(TimeInMillis start) { start_timestamp_ = start; }
-
- // Sets the elapsed time.
- void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
-
- // Adds a test property to the list. The property is validated and may add
- // a non-fatal failure if invalid (e.g., if it conflicts with reserved
- // key names). If a property is already recorded for the same key, the
- // value will be updated, rather than storing multiple values for the same
- // key. xml_element specifies the element for which the property is being
- // recorded and is used for validation.
- void RecordProperty(const std::string& xml_element,
- const TestProperty& test_property);
-
- // Adds a failure if the key is a reserved attribute of Google Test
- // testsuite tags. Returns true if the property is valid.
- // FIXME: Validate attribute names are legal and human readable.
- static bool ValidateTestProperty(const std::string& xml_element,
- const TestProperty& test_property);
-
- // Adds a test part result to the list.
- void AddTestPartResult(const TestPartResult& test_part_result);
-
- // Returns the death test count.
- int death_test_count() const { return death_test_count_; }
-
- // Increments the death test count, returning the new count.
- int increment_death_test_count() { return ++death_test_count_; }
-
- // Clears the test part results.
- void ClearTestPartResults();
-
- // Clears the object.
- void Clear();
-
- // Protects mutable state of the property vector and of owned
- // properties, whose values may be updated.
- internal::Mutex test_properties_mutex_;
-
- // The vector of TestPartResults
- std::vector<TestPartResult> test_part_results_;
- // The vector of TestProperties
- std::vector<TestProperty> test_properties_;
- // Running count of death tests.
- int death_test_count_;
- // The start time, in milliseconds since UNIX Epoch.
- TimeInMillis start_timestamp_;
- // The elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
-
- // We disallow copying TestResult.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestResult);
-}; // class TestResult
-
-// A TestInfo object stores the following information about a test:
-//
-// Test suite name
-// Test name
-// Whether the test should be run
-// A function pointer that creates the test object when invoked
-// Test result
-//
-// The constructor of TestInfo registers itself with the UnitTest
-// singleton such that the RUN_ALL_TESTS() macro knows which tests to
-// run.
-class GTEST_API_ TestInfo {
- public:
- // Destructs a TestInfo object. This function is not virtual, so
- // don't inherit from TestInfo.
- ~TestInfo();
-
- // Returns the test suite name.
- const char* test_suite_name() const { return test_suite_name_.c_str(); }
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- const char* test_case_name() const { return test_suite_name(); }
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Returns the test name.
- const char* name() const { return name_.c_str(); }
-
- // Returns the name of the parameter type, or NULL if this is not a typed
- // or a type-parameterized test.
- const char* type_param() const {
- if (type_param_.get() != nullptr) return type_param_->c_str();
- return nullptr;
- }
-
- // Returns the text representation of the value parameter, or NULL if this
- // is not a value-parameterized test.
- const char* value_param() const {
- if (value_param_.get() != nullptr) return value_param_->c_str();
- return nullptr;
- }
-
- // Returns the file name where this test is defined.
- const char* file() const { return location_.file.c_str(); }
-
- // Returns the line where this test is defined.
- int line() const { return location_.line; }
-
- // Return true if this test should not be run because it's in another shard.
- bool is_in_another_shard() const { return is_in_another_shard_; }
-
- // Returns true if this test should run, that is if the test is not
- // disabled (or it is disabled but the also_run_disabled_tests flag has
- // been specified) and its full name matches the user-specified filter.
- //
- // Google Test allows the user to filter the tests by their full names.
- // The full name of a test Bar in test suite Foo is defined as
- // "Foo.Bar". Only the tests that match the filter will run.
- //
- // A filter is a colon-separated list of glob (not regex) patterns,
- // optionally followed by a '-' and a colon-separated list of
- // negative patterns (tests to exclude). A test is run if it
- // matches one of the positive patterns and does not match any of
- // the negative patterns.
- //
- // For example, *A*:Foo.* is a filter that matches any string that
- // contains the character 'A' or starts with "Foo.".
- bool should_run() const { return should_run_; }
-
- // Returns true if and only if this test will appear in the XML report.
- bool is_reportable() const {
- // The XML report includes tests matching the filter, excluding those
- // run in other shards.
- return matches_filter_ && !is_in_another_shard_;
- }
-
- // Returns the result of the test.
- const TestResult* result() const { return &result_; }
-
- private:
-#if GTEST_HAS_DEATH_TEST
- friend class internal::DefaultDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
- friend class Test;
- friend class TestSuite;
- friend class internal::UnitTestImpl;
- friend class internal::StreamingListenerTest;
- friend TestInfo* internal::MakeAndRegisterTestInfo(
- const char* test_suite_name, const char* name, const char* type_param,
- const char* value_param, internal::CodeLocation code_location,
- internal::TypeId fixture_class_id, internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc,
- internal::TestFactoryBase* factory);
-
- // Constructs a TestInfo object. The newly constructed instance assumes
- // ownership of the factory object.
- TestInfo(const std::string& test_suite_name, const std::string& name,
- const char* a_type_param, // NULL if not a type-parameterized test
- const char* a_value_param, // NULL if not a value-parameterized test
- internal::CodeLocation a_code_location,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory);
-
- // Increments the number of death tests encountered in this test so
- // far.
- int increment_death_test_count() {
- return result_.increment_death_test_count();
- }
-
- // Creates the test object, runs it, records its result, and then
- // deletes it.
- void Run();
-
- // Skip and records the test result for this object.
- void Skip();
-
- static void ClearTestResult(TestInfo* test_info) {
- test_info->result_.Clear();
- }
-
- // These fields are immutable properties of the test.
- const std::string test_suite_name_; // test suite name
- const std::string name_; // Test name
- // Name of the parameter type, or NULL if this is not a typed or a
- // type-parameterized test.
- const std::unique_ptr<const ::std::string> type_param_;
- // Text representation of the value parameter, or NULL if this is not a
- // value-parameterized test.
- const std::unique_ptr<const ::std::string> value_param_;
- internal::CodeLocation location_;
- const internal::TypeId fixture_class_id_; // ID of the test fixture class
- bool should_run_; // True if and only if this test should run
- bool is_disabled_; // True if and only if this test is disabled
- bool matches_filter_; // True if this test matches the
- // user-specified filter.
- bool is_in_another_shard_; // Will be run in another shard.
- internal::TestFactoryBase* const factory_; // The factory that creates
- // the test object
-
- // This field is mutable and needs to be reset before running the
- // test for the second time.
- TestResult result_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestInfo);
-};
-
-// A test suite, which consists of a vector of TestInfos.
-//
-// TestSuite is not copyable.
-class GTEST_API_ TestSuite {
- public:
- // Creates a TestSuite with the given name.
- //
- // TestSuite does NOT have a default constructor. Always use this
- // constructor to create a TestSuite object.
- //
- // Arguments:
- //
- // name: name of the test suite
- // a_type_param: the name of the test's type parameter, or NULL if
- // this is not a type-parameterized test.
- // set_up_tc: pointer to the function that sets up the test suite
- // tear_down_tc: pointer to the function that tears down the test suite
- TestSuite(const char* name, const char* a_type_param,
- internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc);
-
- // Destructor of TestSuite.
- virtual ~TestSuite();
-
- // Gets the name of the TestSuite.
- const char* name() const { return name_.c_str(); }
-
- // Returns the name of the parameter type, or NULL if this is not a
- // type-parameterized test suite.
- const char* type_param() const {
- if (type_param_.get() != nullptr) return type_param_->c_str();
- return nullptr;
- }
-
- // Returns true if any test in this test suite should run.
- bool should_run() const { return should_run_; }
-
- // Gets the number of successful tests in this test suite.
- int successful_test_count() const;
-
- // Gets the number of skipped tests in this test suite.
- int skipped_test_count() const;
-
- // Gets the number of failed tests in this test suite.
- int failed_test_count() const;
-
- // Gets the number of disabled tests that will be reported in the XML report.
- int reportable_disabled_test_count() const;
-
- // Gets the number of disabled tests in this test suite.
- int disabled_test_count() const;
-
- // Gets the number of tests to be printed in the XML report.
- int reportable_test_count() const;
-
- // Get the number of tests in this test suite that should run.
- int test_to_run_count() const;
-
- // Gets the number of all tests in this test suite.
- int total_test_count() const;
-
- // Returns true if and only if the test suite passed.
- bool Passed() const { return !Failed(); }
-
- // Returns true if and only if the test suite failed.
- bool Failed() const {
- return failed_test_count() > 0 || ad_hoc_test_result().Failed();
- }
-
- // Returns the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Gets the time of the test suite start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const { return start_timestamp_; }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- const TestInfo* GetTestInfo(int i) const;
-
- // Returns the TestResult that holds test properties recorded during
- // execution of SetUpTestSuite and TearDownTestSuite.
- const TestResult& ad_hoc_test_result() const { return ad_hoc_test_result_; }
-
- private:
- friend class Test;
- friend class internal::UnitTestImpl;
-
- // Gets the (mutable) vector of TestInfos in this TestSuite.
- std::vector<TestInfo*>& test_info_list() { return test_info_list_; }
-
- // Gets the (immutable) vector of TestInfos in this TestSuite.
- const std::vector<TestInfo*>& test_info_list() const {
- return test_info_list_;
- }
-
- // Returns the i-th test among all the tests. i can range from 0 to
- // total_test_count() - 1. If i is not in that range, returns NULL.
- TestInfo* GetMutableTestInfo(int i);
-
- // Sets the should_run member.
- void set_should_run(bool should) { should_run_ = should; }
-
- // Adds a TestInfo to this test suite. Will delete the TestInfo upon
- // destruction of the TestSuite object.
- void AddTestInfo(TestInfo * test_info);
-
- // Clears the results of all tests in this test suite.
- void ClearResult();
-
- // Clears the results of all tests in the given test suite.
- static void ClearTestSuiteResult(TestSuite* test_suite) {
- test_suite->ClearResult();
- }
-
- // Runs every test in this TestSuite.
- void Run();
-
- // Skips the execution of tests under this TestSuite
- void Skip();
-
- // Runs SetUpTestSuite() for this TestSuite. This wrapper is needed
- // for catching exceptions thrown from SetUpTestSuite().
- void RunSetUpTestSuite() {
- if (set_up_tc_ != nullptr) {
- (*set_up_tc_)();
- }
- }
-
- // Runs TearDownTestSuite() for this TestSuite. This wrapper is
- // needed for catching exceptions thrown from TearDownTestSuite().
- void RunTearDownTestSuite() {
- if (tear_down_tc_ != nullptr) {
- (*tear_down_tc_)();
- }
- }
-
- // Returns true if and only if test passed.
- static bool TestPassed(const TestInfo* test_info) {
- return test_info->should_run() && test_info->result()->Passed();
- }
-
- // Returns true if and only if test skipped.
- static bool TestSkipped(const TestInfo* test_info) {
- return test_info->should_run() && test_info->result()->Skipped();
- }
-
- // Returns true if and only if test failed.
- static bool TestFailed(const TestInfo* test_info) {
- return test_info->should_run() && test_info->result()->Failed();
- }
-
- // Returns true if and only if the test is disabled and will be reported in
- // the XML report.
- static bool TestReportableDisabled(const TestInfo* test_info) {
- return test_info->is_reportable() && test_info->is_disabled_;
- }
-
- // Returns true if and only if test is disabled.
- static bool TestDisabled(const TestInfo* test_info) {
- return test_info->is_disabled_;
- }
-
- // Returns true if and only if this test will appear in the XML report.
- static bool TestReportable(const TestInfo* test_info) {
- return test_info->is_reportable();
- }
-
- // Returns true if the given test should run.
- static bool ShouldRunTest(const TestInfo* test_info) {
- return test_info->should_run();
- }
-
- // Shuffles the tests in this test suite.
- void ShuffleTests(internal::Random* random);
-
- // Restores the test order to before the first shuffle.
- void UnshuffleTests();
-
- // Name of the test suite.
- std::string name_;
- // Name of the parameter type, or NULL if this is not a typed or a
- // type-parameterized test.
- const std::unique_ptr<const ::std::string> type_param_;
- // The vector of TestInfos in their original order. It owns the
- // elements in the vector.
- std::vector<TestInfo*> test_info_list_;
- // Provides a level of indirection for the test list to allow easy
- // shuffling and restoring the test order. The i-th element in this
- // vector is the index of the i-th test in the shuffled test list.
- std::vector<int> test_indices_;
- // Pointer to the function that sets up the test suite.
- internal::SetUpTestSuiteFunc set_up_tc_;
- // Pointer to the function that tears down the test suite.
- internal::TearDownTestSuiteFunc tear_down_tc_;
- // True if and only if any test in this test suite should run.
- bool should_run_;
- // The start time, in milliseconds since UNIX Epoch.
- TimeInMillis start_timestamp_;
- // Elapsed time, in milliseconds.
- TimeInMillis elapsed_time_;
- // Holds test properties recorded during execution of SetUpTestSuite and
- // TearDownTestSuite.
- TestResult ad_hoc_test_result_;
-
- // We disallow copying TestSuites.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestSuite);
-};
-
-// An Environment object is capable of setting up and tearing down an
-// environment. You should subclass this to define your own
-// environment(s).
-//
-// An Environment object does the set-up and tear-down in virtual
-// methods SetUp() and TearDown() instead of the constructor and the
-// destructor, as:
-//
-// 1. You cannot safely throw from a destructor. This is a problem
-// as in some cases Google Test is used where exceptions are enabled, and
-// we may want to implement ASSERT_* using exceptions where they are
-// available.
-// 2. You cannot use ASSERT_* directly in a constructor or
-// destructor.
-class Environment {
- public:
- // The d'tor is virtual as we need to subclass Environment.
- virtual ~Environment() {}
-
- // Override this to define how to set up the environment.
- virtual void SetUp() {}
-
- // Override this to define how to tear down the environment.
- virtual void TearDown() {}
- private:
- // If you see an error about overriding the following function or
- // about it being private, you have mis-spelled SetUp() as Setup().
- struct Setup_should_be_spelled_SetUp {};
- virtual Setup_should_be_spelled_SetUp* Setup() { return nullptr; }
-};
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Exception which can be thrown from TestEventListener::OnTestPartResult.
-class GTEST_API_ AssertionException
- : public internal::GoogleTestFailureException {
- public:
- explicit AssertionException(const TestPartResult& result)
- : GoogleTestFailureException(result) {}
-};
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// The interface for tracing execution of tests. The methods are organized in
-// the order the corresponding events are fired.
-class TestEventListener {
- public:
- virtual ~TestEventListener() {}
-
- // Fired before any test activity starts.
- virtual void OnTestProgramStart(const UnitTest& unit_test) = 0;
-
- // Fired before each iteration of tests starts. There may be more than
- // one iteration if GTEST_FLAG(repeat) is set. iteration is the iteration
- // index, starting from 0.
- virtual void OnTestIterationStart(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired before environment set-up for each iteration of tests starts.
- virtual void OnEnvironmentsSetUpStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment set-up for each iteration of tests ends.
- virtual void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) = 0;
-
- // Fired before the test suite starts.
- virtual void OnTestSuiteStart(const TestSuite& /*test_suite*/) {}
-
- // Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- virtual void OnTestCaseStart(const TestCase& /*test_case*/) {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Fired before the test starts.
- virtual void OnTestStart(const TestInfo& test_info) = 0;
-
- // Fired when a test is disabled
- virtual void OnTestDisabled(const TestInfo& /*test_info*/) {}
-
- // Fired after a failed assertion or a SUCCEED() invocation.
- // If you want to throw an exception from this function to skip to the next
- // TEST, it must be AssertionException defined above, or inherited from it.
- virtual void OnTestPartResult(const TestPartResult& test_part_result) = 0;
-
- // Fired after the test ends.
- virtual void OnTestEnd(const TestInfo& test_info) = 0;
-
- // Fired after the test suite ends.
- virtual void OnTestSuiteEnd(const TestSuite& /*test_suite*/) {}
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- virtual void OnTestCaseEnd(const TestCase& /*test_case*/) {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Fired before environment tear-down for each iteration of tests starts.
- virtual void OnEnvironmentsTearDownStart(const UnitTest& unit_test) = 0;
-
- // Fired after environment tear-down for each iteration of tests ends.
- virtual void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) = 0;
-
- // Fired after each iteration of tests finishes.
- virtual void OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) = 0;
-
- // Fired after all test activities have ended.
- virtual void OnTestProgramEnd(const UnitTest& unit_test) = 0;
-};
-
-// The convenience class for users who need to override just one or two
-// methods and are not concerned that a possible change to a signature of
-// the methods they override will not be caught during the build. For
-// comments about each method please see the definition of TestEventListener
-// above.
-class EmptyTestEventListener : public TestEventListener {
- public:
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) override {}
- void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
- void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
- void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {}
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseStart(const TestCase& /*test_case*/) override {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnTestStart(const TestInfo& /*test_info*/) override {}
- void OnTestDisabled(const TestInfo& /*test_info*/) override {}
- void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {}
- void OnTestEnd(const TestInfo& /*test_info*/) override {}
- void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {}
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
- void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int /*iteration*/) override {}
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
-};
-
-// TestEventListeners lets users add listeners to track events in Google Test.
-class GTEST_API_ TestEventListeners {
- public:
- TestEventListeners();
- ~TestEventListeners();
-
- // Appends an event listener to the end of the list. Google Test assumes
- // the ownership of the listener (i.e. it will delete the listener when
- // the test program finishes).
- void Append(TestEventListener* listener);
-
- // Removes the given event listener from the list and returns it. It then
- // becomes the caller's responsibility to delete the listener. Returns
- // NULL if the listener is not found in the list.
- TestEventListener* Release(TestEventListener* listener);
-
- // Returns the standard listener responsible for the default console
- // output. Can be removed from the listeners list to shut down default
- // console output. Note that removing this object from the listener list
- // with Release transfers its ownership to the caller and makes this
- // function return NULL the next time.
- TestEventListener* default_result_printer() const {
- return default_result_printer_;
- }
-
- // Returns the standard listener responsible for the default XML output
- // controlled by the --gtest_output=xml flag. Can be removed from the
- // listeners list by users who want to shut down the default XML output
- // controlled by this flag and substitute it with custom one. Note that
- // removing this object from the listener list with Release transfers its
- // ownership to the caller and makes this function return NULL the next
- // time.
- TestEventListener* default_xml_generator() const {
- return default_xml_generator_;
- }
-
- private:
- friend class TestSuite;
- friend class TestInfo;
- friend class internal::DefaultGlobalTestPartResultReporter;
- friend class internal::NoExecDeathTest;
- friend class internal::TestEventListenersAccessor;
- friend class internal::UnitTestImpl;
-
- // Returns repeater that broadcasts the TestEventListener events to all
- // subscribers.
- TestEventListener* repeater();
-
- // Sets the default_result_printer attribute to the provided listener.
- // The listener is also added to the listener list and previous
- // default_result_printer is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultResultPrinter(TestEventListener* listener);
-
- // Sets the default_xml_generator attribute to the provided listener. The
- // listener is also added to the listener list and previous
- // default_xml_generator is removed from it and deleted. The listener can
- // also be NULL in which case it will not be added to the list. Does
- // nothing if the previous and the current listener objects are the same.
- void SetDefaultXmlGenerator(TestEventListener* listener);
-
- // Controls whether events will be forwarded by the repeater to the
- // listeners in the list.
- bool EventForwardingEnabled() const;
- void SuppressEventForwarding();
-
- // The actual list of listeners.
- internal::TestEventRepeater* repeater_;
- // Listener responsible for the standard result output.
- TestEventListener* default_result_printer_;
- // Listener responsible for the creation of the XML output file.
- TestEventListener* default_xml_generator_;
-
- // We disallow copying TestEventListeners.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventListeners);
-};
-
-// A UnitTest consists of a vector of TestSuites.
-//
-// This is a singleton class. The only instance of UnitTest is
-// created when UnitTest::GetInstance() is first called. This
-// instance is never deleted.
-//
-// UnitTest is not copyable.
-//
-// This class is thread-safe as long as the methods are called
-// according to their specification.
-class GTEST_API_ UnitTest {
- public:
- // Gets the singleton UnitTest object. The first time this method
- // is called, a UnitTest object is constructed and returned.
- // Consecutive calls will return the same object.
- static UnitTest* GetInstance();
-
- // Runs all tests in this UnitTest object and prints the result.
- // Returns 0 if successful, or 1 otherwise.
- //
- // This method can only be called from the main thread.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- int Run() GTEST_MUST_USE_RESULT_;
-
- // Returns the working directory when the first TEST() or TEST_F()
- // was executed. The UnitTest object owns the string.
- const char* original_working_dir() const;
-
- // Returns the TestSuite object for the test that's currently running,
- // or NULL if no test is running.
- const TestSuite* current_test_suite() const GTEST_LOCK_EXCLUDED_(mutex_);
-
-// Legacy API is still available but deprecated
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- const TestCase* current_test_case() const GTEST_LOCK_EXCLUDED_(mutex_);
-#endif
-
- // Returns the TestInfo object for the test that's currently running,
- // or NULL if no test is running.
- const TestInfo* current_test_info() const
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Returns the random seed used at the start of the current test run.
- int random_seed() const;
-
- // Returns the ParameterizedTestSuiteRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- //
- // INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
- internal::ParameterizedTestSuiteRegistry& parameterized_test_registry()
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Gets the number of successful test suites.
- int successful_test_suite_count() const;
-
- // Gets the number of failed test suites.
- int failed_test_suite_count() const;
-
- // Gets the number of all test suites.
- int total_test_suite_count() const;
-
- // Gets the number of all test suites that contain at least one test
- // that should run.
- int test_suite_to_run_count() const;
-
- // Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- int successful_test_case_count() const;
- int failed_test_case_count() const;
- int total_test_case_count() const;
- int test_case_to_run_count() const;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of skipped tests.
- int skipped_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests that will be reported in the XML report.
- int reportable_disabled_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of tests to be printed in the XML report.
- int reportable_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const;
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const;
-
- // Returns true if and only if the unit test passed (i.e. all test suites
- // passed).
- bool Passed() const;
-
- // Returns true if and only if the unit test failed (i.e. some test suite
- // failed or something outside of all tests failed).
- bool Failed() const;
-
- // Gets the i-th test suite among all the test suites. i can range from 0 to
- // total_test_suite_count() - 1. If i is not in that range, returns NULL.
- const TestSuite* GetTestSuite(int i) const;
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- const TestCase* GetTestCase(int i) const;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Returns the TestResult containing information on test failures and
- // properties logged outside of individual test suites.
- const TestResult& ad_hoc_test_result() const;
-
- // Returns the list of event listeners that can be used to track events
- // inside Google Test.
- TestEventListeners& listeners();
-
- private:
- // Registers and returns a global test environment. When a test
- // program is run, all global test environments will be set-up in
- // the order they were registered. After all tests in the program
- // have finished, all global test environments will be torn-down in
- // the *reverse* order they were registered.
- //
- // The UnitTest object takes ownership of the given environment.
- //
- // This method can only be called from the main thread.
- Environment* AddEnvironment(Environment* env);
-
- // Adds a TestPartResult to the current TestResult object. All
- // Google Test assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc)
- // eventually call this to report their results. The user code
- // should use the assertion macros instead of calling this directly.
- void AddTestPartResult(TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const std::string& message,
- const std::string& os_stack_trace)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Adds a TestProperty to the current TestResult object when invoked from
- // inside a test, to current TestSuite's ad_hoc_test_result_ when invoked
- // from SetUpTestSuite or TearDownTestSuite, or to the global property set
- // when invoked elsewhere. If the result already contains a property with
- // the same key, the value will be updated.
- void RecordProperty(const std::string& key, const std::string& value);
-
- // Gets the i-th test suite among all the test suites. i can range from 0 to
- // total_test_suite_count() - 1. If i is not in that range, returns NULL.
- TestSuite* GetMutableTestSuite(int i);
-
- // Accessors for the implementation object.
- internal::UnitTestImpl* impl() { return impl_; }
- const internal::UnitTestImpl* impl() const { return impl_; }
-
- // These classes and functions are friends as they need to access private
- // members of UnitTest.
- friend class ScopedTrace;
- friend class Test;
- friend class internal::AssertHelper;
- friend class internal::StreamingListenerTest;
- friend class internal::UnitTestRecordPropertyTestHelper;
- friend Environment* AddGlobalTestEnvironment(Environment* env);
- friend std::set<std::string>* internal::GetIgnoredParameterizedTestSuites();
- friend internal::UnitTestImpl* internal::GetUnitTestImpl();
- friend void internal::ReportFailureInUnknownLocation(
- TestPartResult::Type result_type,
- const std::string& message);
-
- // Creates an empty UnitTest.
- UnitTest();
-
- // D'tor
- virtual ~UnitTest();
-
- // Pushes a trace defined by SCOPED_TRACE() on to the per-thread
- // Google Test trace stack.
- void PushGTestTrace(const internal::TraceInfo& trace)
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Pops a trace from the per-thread Google Test trace stack.
- void PopGTestTrace()
- GTEST_LOCK_EXCLUDED_(mutex_);
-
- // Protects mutable state in *impl_. This is mutable as some const
- // methods need to lock it too.
- mutable internal::Mutex mutex_;
-
- // Opaque implementation object. This field is never changed once
- // the object is constructed. We don't mark it as const here, as
- // doing so will cause a warning in the constructor of UnitTest.
- // Mutable state in *impl_ is protected by mutex_.
- internal::UnitTestImpl* impl_;
-
- // We disallow copying UnitTest.
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTest);
-};
-
-// A convenient wrapper for adding an environment for the test
-// program.
-//
-// You should call this before RUN_ALL_TESTS() is called, probably in
-// main(). If you use gtest_main, you need to call this before main()
-// starts for it to take effect. For example, you can define a global
-// variable like this:
-//
-// testing::Environment* const foo_env =
-// testing::AddGlobalTestEnvironment(new FooEnvironment);
-//
-// However, we strongly recommend you to write your own main() and
-// call AddGlobalTestEnvironment() there, as relying on initialization
-// of global variables makes the code harder to read and may cause
-// problems when you register multiple environments from different
-// translation units and the environments have dependencies among them
-// (remember that the compiler doesn't guarantee the order in which
-// global variables from different translation units are initialized).
-inline Environment* AddGlobalTestEnvironment(Environment* env) {
- return UnitTest::GetInstance()->AddEnvironment(env);
-}
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-GTEST_API_ void InitGoogleTest(int* argc, char** argv);
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-GTEST_API_ void InitGoogleTest(int* argc, wchar_t** argv);
-
-// This overloaded version can be used on Arduino/embedded platforms where
-// there is no argc/argv.
-GTEST_API_ void InitGoogleTest();
-
-namespace internal {
-
-// Separate the error generating code from the code path to reduce the stack
-// frame size of CmpHelperEQ. This helps reduce the overhead of some sanitizers
-// when calling EXPECT_* in a tight loop.
-template <typename T1, typename T2>
-AssertionResult CmpHelperEQFailure(const char* lhs_expression,
- const char* rhs_expression,
- const T1& lhs, const T2& rhs) {
- return EqFailure(lhs_expression,
- rhs_expression,
- FormatForComparisonFailureMessage(lhs, rhs),
- FormatForComparisonFailureMessage(rhs, lhs),
- false);
-}
-
-// This block of code defines operator==/!=
-// to block lexical scope lookup.
-// It prevents using invalid operator==/!= defined at namespace scope.
-struct faketype {};
-inline bool operator==(faketype, faketype) { return true; }
-inline bool operator!=(faketype, faketype) { return false; }
-
-// The helper function for {ASSERT|EXPECT}_EQ.
-template <typename T1, typename T2>
-AssertionResult CmpHelperEQ(const char* lhs_expression,
- const char* rhs_expression,
- const T1& lhs,
- const T2& rhs) {
- if (lhs == rhs) {
- return AssertionSuccess();
- }
-
- return CmpHelperEQFailure(lhs_expression, rhs_expression, lhs, rhs);
-}
-
-class EqHelper {
- public:
- // This templatized version is for the general case.
- template <
- typename T1, typename T2,
- // Disable this overload for cases where one argument is a pointer
- // and the other is the null pointer constant.
- typename std::enable_if<!std::is_integral<T1>::value ||
- !std::is_pointer<T2>::value>::type* = nullptr>
- static AssertionResult Compare(const char* lhs_expression,
- const char* rhs_expression, const T1& lhs,
- const T2& rhs) {
- return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
- }
-
- // With this overloaded version, we allow anonymous enums to be used
- // in {ASSERT|EXPECT}_EQ when compiled with gcc 4, as anonymous
- // enums can be implicitly cast to BiggestInt.
- //
- // Even though its body looks the same as the above version, we
- // cannot merge the two, as it will make anonymous enums unhappy.
- static AssertionResult Compare(const char* lhs_expression,
- const char* rhs_expression,
- BiggestInt lhs,
- BiggestInt rhs) {
- return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
- }
-
- template <typename T>
- static AssertionResult Compare(
- const char* lhs_expression, const char* rhs_expression,
- // Handle cases where '0' is used as a null pointer literal.
- std::nullptr_t /* lhs */, T* rhs) {
- // We already know that 'lhs' is a null pointer.
- return CmpHelperEQ(lhs_expression, rhs_expression, static_cast<T*>(nullptr),
- rhs);
- }
-};
-
-// Separate the error generating code from the code path to reduce the stack
-// frame size of CmpHelperOP. This helps reduce the overhead of some sanitizers
-// when calling EXPECT_OP in a tight loop.
-template <typename T1, typename T2>
-AssertionResult CmpHelperOpFailure(const char* expr1, const char* expr2,
- const T1& val1, const T2& val2,
- const char* op) {
- return AssertionFailure()
- << "Expected: (" << expr1 << ") " << op << " (" << expr2
- << "), actual: " << FormatForComparisonFailureMessage(val1, val2)
- << " vs " << FormatForComparisonFailureMessage(val2, val1);
-}
-
-// A macro for implementing the helper functions needed to implement
-// ASSERT_?? and EXPECT_??. It is here just to avoid copy-and-paste
-// of similar code.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
-template <typename T1, typename T2>\
-AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
- const T1& val1, const T2& val2) {\
- if (val1 op val2) {\
- return AssertionSuccess();\
- } else {\
- return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
- }\
-}
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-
-// Implements the helper function for {ASSERT|EXPECT}_NE
-GTEST_IMPL_CMP_HELPER_(NE, !=)
-// Implements the helper function for {ASSERT|EXPECT}_LE
-GTEST_IMPL_CMP_HELPER_(LE, <=)
-// Implements the helper function for {ASSERT|EXPECT}_LT
-GTEST_IMPL_CMP_HELPER_(LT, <)
-// Implements the helper function for {ASSERT|EXPECT}_GE
-GTEST_IMPL_CMP_HELPER_(GE, >=)
-// Implements the helper function for {ASSERT|EXPECT}_GT
-GTEST_IMPL_CMP_HELPER_(GT, >)
-
-#undef GTEST_IMPL_CMP_HELPER_
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2);
-
-
-// Helper function for *_STREQ on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTREQ(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2);
-
-// Helper function for *_STRNE on wide strings.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2);
-
-} // namespace internal
-
-// IsSubstring() and IsNotSubstring() are intended to be used as the
-// first argument to {EXPECT,ASSERT}_PRED_FORMAT2(), not by
-// themselves. They check whether needle is a substring of haystack
-// (NULL is considered a substring of itself only), and return an
-// appropriate error message when they fail.
-//
-// The {needle,haystack}_expr arguments are the stringified
-// expressions that generated the two real arguments.
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack);
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack);
-
-#if GTEST_HAS_STD_WSTRING
-GTEST_API_ AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-GTEST_API_ AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack);
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-// Helper template function for comparing floating-points.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-template <typename RawType>
-AssertionResult CmpHelperFloatingPointEQ(const char* lhs_expression,
- const char* rhs_expression,
- RawType lhs_value,
- RawType rhs_value) {
- const FloatingPoint<RawType> lhs(lhs_value), rhs(rhs_value);
-
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- ::std::stringstream lhs_ss;
- lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << lhs_value;
-
- ::std::stringstream rhs_ss;
- rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << rhs_value;
-
- return EqFailure(lhs_expression,
- rhs_expression,
- StringStreamToString(&lhs_ss),
- StringStreamToString(&rhs_ss),
- false);
-}
-
-// Helper function for implementing ASSERT_NEAR.
-//
-// INTERNAL IMPLEMENTATION - DO NOT USE IN A USER PROGRAM.
-GTEST_API_ AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error);
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-// A class that enables one to stream messages to assertion macros
-class GTEST_API_ AssertHelper {
- public:
- // Constructor.
- AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message);
- ~AssertHelper();
-
- // Message assignment is a semantic trick to enable assertion
- // streaming; see the GTEST_MESSAGE_ macro below.
- void operator=(const Message& message) const;
-
- private:
- // We put our data in a struct so that the size of the AssertHelper class can
- // be as small as possible. This is important because gcc is incapable of
- // re-using stack space even for temporary variables, so every EXPECT_EQ
- // reserves stack space for another AssertHelper.
- struct AssertHelperData {
- AssertHelperData(TestPartResult::Type t,
- const char* srcfile,
- int line_num,
- const char* msg)
- : type(t), file(srcfile), line(line_num), message(msg) { }
-
- TestPartResult::Type const type;
- const char* const file;
- int const line;
- std::string const message;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelperData);
- };
-
- AssertHelperData* const data_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AssertHelper);
-};
-
-} // namespace internal
-
-// The pure interface class that all value-parameterized tests inherit from.
-// A value-parameterized class must inherit from both ::testing::Test and
-// ::testing::WithParamInterface. In most cases that just means inheriting
-// from ::testing::TestWithParam, but more complicated test hierarchies
-// may need to inherit from Test and WithParamInterface at different levels.
-//
-// This interface has support for accessing the test parameter value via
-// the GetParam() method.
-//
-// Use it with one of the parameter generator defining functions, like Range(),
-// Values(), ValuesIn(), Bool(), and Combine().
-//
-// class FooTest : public ::testing::TestWithParam<int> {
-// protected:
-// FooTest() {
-// // Can use GetParam() here.
-// }
-// ~FooTest() override {
-// // Can use GetParam() here.
-// }
-// void SetUp() override {
-// // Can use GetParam() here.
-// }
-// void TearDown override {
-// // Can use GetParam() here.
-// }
-// };
-// TEST_P(FooTest, DoesBar) {
-// // Can use GetParam() method here.
-// Foo foo;
-// ASSERT_TRUE(foo.DoesBar(GetParam()));
-// }
-// INSTANTIATE_TEST_SUITE_P(OneToTenRange, FooTest, ::testing::Range(1, 10));
-
-template <typename T>
-class WithParamInterface {
- public:
- typedef T ParamType;
- virtual ~WithParamInterface() {}
-
- // The current parameter value. Is also available in the test fixture's
- // constructor.
- static const ParamType& GetParam() {
- GTEST_CHECK_(parameter_ != nullptr)
- << "GetParam() can only be called inside a value-parameterized test "
- << "-- did you intend to write TEST_P instead of TEST_F?";
- return *parameter_;
- }
-
- private:
- // Sets parameter value. The caller is responsible for making sure the value
- // remains alive and unchanged throughout the current test.
- static void SetParam(const ParamType* parameter) {
- parameter_ = parameter;
- }
-
- // Static value used for accessing parameter during a test lifetime.
- static const ParamType* parameter_;
-
- // TestClass must be a subclass of WithParamInterface<T> and Test.
- template <class TestClass> friend class internal::ParameterizedTestFactory;
-};
-
-template <typename T>
-const T* WithParamInterface<T>::parameter_ = nullptr;
-
-// Most value-parameterized classes can ignore the existence of
-// WithParamInterface, and can just inherit from ::testing::TestWithParam.
-
-template <typename T>
-class TestWithParam : public Test, public WithParamInterface<T> {
-};
-
-// Macros for indicating success/failure in test code.
-
-// Skips test in runtime.
-// Skipping test aborts current function.
-// Skipped tests are neither successful nor failed.
-#define GTEST_SKIP() GTEST_SKIP_("")
-
-// ADD_FAILURE unconditionally adds a failure to the current test.
-// SUCCEED generates a success - it doesn't automatically make the
-// current test successful, as a test is only successful when it has
-// no failure.
-//
-// EXPECT_* verifies that a certain condition is satisfied. If not,
-// it behaves like ADD_FAILURE. In particular:
-//
-// EXPECT_TRUE verifies that a Boolean condition is true.
-// EXPECT_FALSE verifies that a Boolean condition is false.
-//
-// FAIL and ASSERT_* are similar to ADD_FAILURE and EXPECT_*, except
-// that they will also abort the current function on failure. People
-// usually want the fail-fast behavior of FAIL and ASSERT_*, but those
-// writing data-driven tests often find themselves using ADD_FAILURE
-// and EXPECT_* more.
-
-// Generates a nonfatal failure with a generic message.
-#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
-
-// Generates a nonfatal failure at the given source file location with
-// a generic message.
-#define ADD_FAILURE_AT(file, line) \
- GTEST_MESSAGE_AT_(file, line, "Failed", \
- ::testing::TestPartResult::kNonFatalFailure)
-
-// Generates a fatal failure with a generic message.
-#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
-
-// Like GTEST_FAIL(), but at the given source file location.
-#define GTEST_FAIL_AT(file, line) \
- GTEST_MESSAGE_AT_(file, line, "Failed", \
- ::testing::TestPartResult::kFatalFailure)
-
-// Define this macro to 1 to omit the definition of FAIL(), which is a
-// generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_FAIL
-# define FAIL() GTEST_FAIL()
-#endif
-
-// Generates a success with a generic message.
-#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
-
-// Define this macro to 1 to omit the definition of SUCCEED(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_SUCCEED
-# define SUCCEED() GTEST_SUCCEED()
-#endif
-
-// Macros for testing exceptions.
-//
-// * {ASSERT|EXPECT}_THROW(statement, expected_exception):
-// Tests that the statement throws the expected exception.
-// * {ASSERT|EXPECT}_NO_THROW(statement):
-// Tests that the statement doesn't throw any exception.
-// * {ASSERT|EXPECT}_ANY_THROW(statement):
-// Tests that the statement throws an exception.
-
-#define EXPECT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_THROW(statement, expected_exception) \
- GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
-#define ASSERT_NO_THROW(statement) \
- GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
-#define ASSERT_ANY_THROW(statement) \
- GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
-
-// Boolean assertions. Condition can be either a Boolean expression or an
-// AssertionResult. For more information on how to use AssertionResult with
-// these macros see comments on that class.
-#define GTEST_EXPECT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_NONFATAL_FAILURE_)
-#define GTEST_EXPECT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_NONFATAL_FAILURE_)
-#define GTEST_ASSERT_TRUE(condition) \
- GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
- GTEST_FATAL_FAILURE_)
-#define GTEST_ASSERT_FALSE(condition) \
- GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
- GTEST_FATAL_FAILURE_)
-
-// Define these macros to 1 to omit the definition of the corresponding
-// EXPECT or ASSERT, which clashes with some users' own code.
-
-#if !GTEST_DONT_DEFINE_EXPECT_TRUE
-#define EXPECT_TRUE(condition) GTEST_EXPECT_TRUE(condition)
-#endif
-
-#if !GTEST_DONT_DEFINE_EXPECT_FALSE
-#define EXPECT_FALSE(condition) GTEST_EXPECT_FALSE(condition)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_TRUE
-#define ASSERT_TRUE(condition) GTEST_ASSERT_TRUE(condition)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_FALSE
-#define ASSERT_FALSE(condition) GTEST_ASSERT_FALSE(condition)
-#endif
-
-// Macros for testing equalities and inequalities.
-//
-// * {ASSERT|EXPECT}_EQ(v1, v2): Tests that v1 == v2
-// * {ASSERT|EXPECT}_NE(v1, v2): Tests that v1 != v2
-// * {ASSERT|EXPECT}_LT(v1, v2): Tests that v1 < v2
-// * {ASSERT|EXPECT}_LE(v1, v2): Tests that v1 <= v2
-// * {ASSERT|EXPECT}_GT(v1, v2): Tests that v1 > v2
-// * {ASSERT|EXPECT}_GE(v1, v2): Tests that v1 >= v2
-//
-// When they are not, Google Test prints both the tested expressions and
-// their actual values. The values must be compatible built-in types,
-// or you will get a compiler error. By "compatible" we mean that the
-// values can be compared by the respective operator.
-//
-// Note:
-//
-// 1. It is possible to make a user-defined type work with
-// {ASSERT|EXPECT}_??(), but that requires overloading the
-// comparison operators and is thus discouraged by the Google C++
-// Usage Guide. Therefore, you are advised to use the
-// {ASSERT|EXPECT}_TRUE() macro to assert that two objects are
-// equal.
-//
-// 2. The {ASSERT|EXPECT}_??() macros do pointer comparisons on
-// pointers (in particular, C strings). Therefore, if you use it
-// with two C strings, you are testing how their locations in memory
-// are related, not how their content is related. To compare two C
-// strings by content, use {ASSERT|EXPECT}_STR*().
-//
-// 3. {ASSERT|EXPECT}_EQ(v1, v2) is preferred to
-// {ASSERT|EXPECT}_TRUE(v1 == v2), as the former tells you
-// what the actual value is when it fails, and similarly for the
-// other comparisons.
-//
-// 4. Do not depend on the order in which {ASSERT|EXPECT}_??()
-// evaluate their arguments, which is undefined.
-//
-// 5. These macros evaluate their arguments exactly once.
-//
-// Examples:
-//
-// EXPECT_NE(Foo(), 5);
-// EXPECT_EQ(a_pointer, NULL);
-// ASSERT_LT(i, array_size);
-// ASSERT_GT(records.size(), 0) << "There is no record left.";
-
-#define EXPECT_EQ(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
-#define EXPECT_NE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
-#define EXPECT_LE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define EXPECT_LT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define EXPECT_GE(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define EXPECT_GT(val1, val2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-#define GTEST_ASSERT_EQ(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::EqHelper::Compare, val1, val2)
-#define GTEST_ASSERT_NE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
-#define GTEST_ASSERT_LE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
-#define GTEST_ASSERT_LT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
-#define GTEST_ASSERT_GE(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
-#define GTEST_ASSERT_GT(val1, val2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
-
-// Define macro GTEST_DONT_DEFINE_ASSERT_XY to 1 to omit the definition of
-// ASSERT_XY(), which clashes with some users' own code.
-
-#if !GTEST_DONT_DEFINE_ASSERT_EQ
-# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_NE
-# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_LE
-# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_LT
-# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_GE
-# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
-#endif
-
-#if !GTEST_DONT_DEFINE_ASSERT_GT
-# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
-#endif
-
-// C-string Comparisons. All tests treat NULL and any non-NULL string
-// as different. Two NULLs are equal.
-//
-// * {ASSERT|EXPECT}_STREQ(s1, s2): Tests that s1 == s2
-// * {ASSERT|EXPECT}_STRNE(s1, s2): Tests that s1 != s2
-// * {ASSERT|EXPECT}_STRCASEEQ(s1, s2): Tests that s1 == s2, ignoring case
-// * {ASSERT|EXPECT}_STRCASENE(s1, s2): Tests that s1 != s2, ignoring case
-//
-// For wide or narrow string objects, you can use the
-// {ASSERT|EXPECT}_??() macros.
-//
-// Don't depend on the order in which the arguments are evaluated,
-// which is undefined.
-//
-// These macros evaluate their arguments exactly once.
-
-#define EXPECT_STREQ(s1, s2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
-#define EXPECT_STRNE(s1, s2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define EXPECT_STRCASEEQ(s1, s2) \
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
-#define EXPECT_STRCASENE(s1, s2)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-#define ASSERT_STREQ(s1, s2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
-#define ASSERT_STRNE(s1, s2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
-#define ASSERT_STRCASEEQ(s1, s2) \
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
-#define ASSERT_STRCASENE(s1, s2)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
-
-// Macros for comparing floating-point numbers.
-//
-// * {ASSERT|EXPECT}_FLOAT_EQ(val1, val2):
-// Tests that two float values are almost equal.
-// * {ASSERT|EXPECT}_DOUBLE_EQ(val1, val2):
-// Tests that two double values are almost equal.
-// * {ASSERT|EXPECT}_NEAR(v1, v2, abs_error):
-// Tests that v1 and v2 are within the given distance to each other.
-//
-// Google Test uses ULP-based comparison to automatically pick a default
-// error bound that is appropriate for the operands. See the
-// FloatingPoint template class in gtest-internal.h if you are
-// interested in the implementation details.
-
-#define EXPECT_FLOAT_EQ(val1, val2)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- val1, val2)
-
-#define EXPECT_DOUBLE_EQ(val1, val2)\
- EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- val1, val2)
-
-#define ASSERT_FLOAT_EQ(val1, val2)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
- val1, val2)
-
-#define ASSERT_DOUBLE_EQ(val1, val2)\
- ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
- val1, val2)
-
-#define EXPECT_NEAR(val1, val2, abs_error)\
- EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-#define ASSERT_NEAR(val1, val2, abs_error)\
- ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
- val1, val2, abs_error)
-
-// These predicate format functions work on floating-point values, and
-// can be used in {ASSERT|EXPECT}_PRED_FORMAT2*(), e.g.
-//
-// EXPECT_PRED_FORMAT2(testing::DoubleLE, Foo(), 5.0);
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-GTEST_API_ AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2);
-GTEST_API_ AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2);
-
-
-#if GTEST_OS_WINDOWS
-
-// Macros that test for HRESULT failure and success, these are only useful
-// on Windows, and rely on Windows SDK macros and APIs to compile.
-//
-// * {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}(expr)
-//
-// When expr unexpectedly fails or succeeds, Google Test prints the
-// expected result and the actual result with both a human-readable
-// string representation of the error, if available, as well as the
-// hex result code.
-# define EXPECT_HRESULT_SUCCEEDED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-# define ASSERT_HRESULT_SUCCEEDED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
-
-# define EXPECT_HRESULT_FAILED(expr) \
- EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-# define ASSERT_HRESULT_FAILED(expr) \
- ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
-
-#endif // GTEST_OS_WINDOWS
-
-// Macros that execute statement and check that it doesn't generate new fatal
-// failures in the current thread.
-//
-// * {ASSERT|EXPECT}_NO_FATAL_FAILURE(statement);
-//
-// Examples:
-//
-// EXPECT_NO_FATAL_FAILURE(Process());
-// ASSERT_NO_FATAL_FAILURE(Process()) << "Process() failed";
-//
-#define ASSERT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
-#define EXPECT_NO_FATAL_FAILURE(statement) \
- GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
-
-// Causes a trace (including the given source file path and line number,
-// and the given message) to be included in every test failure message generated
-// by code in the scope of the lifetime of an instance of this class. The effect
-// is undone with the destruction of the instance.
-//
-// The message argument can be anything streamable to std::ostream.
-//
-// Example:
-// testing::ScopedTrace trace("file.cc", 123, "message");
-//
-class GTEST_API_ ScopedTrace {
- public:
- // The c'tor pushes the given source file location and message onto
- // a trace stack maintained by Google Test.
-
- // Template version. Uses Message() to convert the values into strings.
- // Slow, but flexible.
- template <typename T>
- ScopedTrace(const char* file, int line, const T& message) {
- PushTrace(file, line, (Message() << message).GetString());
- }
-
- // Optimize for some known types.
- ScopedTrace(const char* file, int line, const char* message) {
- PushTrace(file, line, message ? message : "(null)");
- }
-
- ScopedTrace(const char* file, int line, const std::string& message) {
- PushTrace(file, line, message);
- }
-
- // The d'tor pops the info pushed by the c'tor.
- //
- // Note that the d'tor is not virtual in order to be efficient.
- // Don't inherit from ScopedTrace!
- ~ScopedTrace();
-
- private:
- void PushTrace(const char* file, int line, std::string message);
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedTrace);
-} GTEST_ATTRIBUTE_UNUSED_; // A ScopedTrace object does its job in its
- // c'tor and d'tor. Therefore it doesn't
- // need to be used otherwise.
-
-// Causes a trace (including the source file path, the current line
-// number, and the given message) to be included in every test failure
-// message generated by code in the current scope. The effect is
-// undone when the control leaves the current scope.
-//
-// The message argument can be anything streamable to std::ostream.
-//
-// In the implementation, we include the current line number as part
-// of the dummy variable name, thus allowing multiple SCOPED_TRACE()s
-// to appear in the same block - as long as they are on different
-// lines.
-//
-// Assuming that each thread maintains its own stack of traces.
-// Therefore, a SCOPED_TRACE() would (correctly) only affect the
-// assertions in its own thread.
-#define SCOPED_TRACE(message) \
- ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
- __FILE__, __LINE__, (message))
-
-// Compile-time assertion for type equality.
-// StaticAssertTypeEq<type1, type2>() compiles if and only if type1 and type2
-// are the same type. The value it returns is not interesting.
-//
-// Instead of making StaticAssertTypeEq a class template, we make it a
-// function template that invokes a helper class template. This
-// prevents a user from misusing StaticAssertTypeEq<T1, T2> by
-// defining objects of that type.
-//
-// CAVEAT:
-//
-// When used inside a method of a class template,
-// StaticAssertTypeEq<T1, T2>() is effective ONLY IF the method is
-// instantiated. For example, given:
-//
-// template <typename T> class Foo {
-// public:
-// void Bar() { testing::StaticAssertTypeEq<int, T>(); }
-// };
-//
-// the code:
-//
-// void Test1() { Foo<bool> foo; }
-//
-// will NOT generate a compiler error, as Foo<bool>::Bar() is never
-// actually instantiated. Instead, you need:
-//
-// void Test2() { Foo<bool> foo; foo.Bar(); }
-//
-// to cause a compiler error.
-template <typename T1, typename T2>
-constexpr bool StaticAssertTypeEq() noexcept {
- static_assert(std::is_same<T1, T2>::value, "T1 and T2 are not the same type");
- return true;
-}
-
-// Defines a test.
-//
-// The first parameter is the name of the test suite, and the second
-// parameter is the name of the test within the test suite.
-//
-// The convention is to end the test suite name with "Test". For
-// example, a test suite for the Foo class can be named FooTest.
-//
-// Test code should appear between braces after an invocation of
-// this macro. Example:
-//
-// TEST(FooTest, InitializesCorrectly) {
-// Foo foo;
-// EXPECT_TRUE(foo.StatusIsOK());
-// }
-
-// Note that we call GetTestTypeId() instead of GetTypeId<
-// ::testing::Test>() here to get the type ID of testing::Test. This
-// is to work around a suspected linker bug when using Google Test as
-// a framework on Mac OS X. The bug causes GetTypeId<
-// ::testing::Test>() to return different values depending on whether
-// the call is from the Google Test framework itself or from user test
-// code. GetTestTypeId() is guaranteed to always return the same
-// value, as it always calls GetTypeId<>() from the Google Test
-// framework.
-#define GTEST_TEST(test_suite_name, test_name) \
- GTEST_TEST_(test_suite_name, test_name, ::testing::Test, \
- ::testing::internal::GetTestTypeId())
-
-// Define this macro to 1 to omit the definition of TEST(), which
-// is a generic name and clashes with some other libraries.
-#if !GTEST_DONT_DEFINE_TEST
-#define TEST(test_suite_name, test_name) GTEST_TEST(test_suite_name, test_name)
-#endif
-
-// Defines a test that uses a test fixture.
-//
-// The first parameter is the name of the test fixture class, which
-// also doubles as the test suite name. The second parameter is the
-// name of the test within the test suite.
-//
-// A test fixture class must be declared earlier. The user should put
-// the test code between braces after using this macro. Example:
-//
-// class FooTest : public testing::Test {
-// protected:
-// void SetUp() override { b_.AddElement(3); }
-//
-// Foo a_;
-// Foo b_;
-// };
-//
-// TEST_F(FooTest, InitializesCorrectly) {
-// EXPECT_TRUE(a_.StatusIsOK());
-// }
-//
-// TEST_F(FooTest, ReturnsElementCountCorrectly) {
-// EXPECT_EQ(a_.size(), 0);
-// EXPECT_EQ(b_.size(), 1);
-// }
-#define GTEST_TEST_F(test_fixture, test_name)\
- GTEST_TEST_(test_fixture, test_name, test_fixture, \
- ::testing::internal::GetTypeId<test_fixture>())
-#if !GTEST_DONT_DEFINE_TEST_F
-#define TEST_F(test_fixture, test_name) GTEST_TEST_F(test_fixture, test_name)
-#endif
-
-// Returns a path to temporary directory.
-// Tries to determine an appropriate directory for the platform.
-GTEST_API_ std::string TempDir();
-
-#ifdef _MSC_VER
-# pragma warning(pop)
-#endif
-
-// Dynamically registers a test with the framework.
-//
-// This is an advanced API only to be used when the `TEST` macros are
-// insufficient. The macros should be preferred when possible, as they avoid
-// most of the complexity of calling this function.
-//
-// The `factory` argument is a factory callable (move-constructible) object or
-// function pointer that creates a new instance of the Test object. It
-// handles ownership to the caller. The signature of the callable is
-// `Fixture*()`, where `Fixture` is the test fixture class for the test. All
-// tests registered with the same `test_suite_name` must return the same
-// fixture type. This is checked at runtime.
-//
-// The framework will infer the fixture class from the factory and will call
-// the `SetUpTestSuite` and `TearDownTestSuite` for it.
-//
-// Must be called before `RUN_ALL_TESTS()` is invoked, otherwise behavior is
-// undefined.
-//
-// Use case example:
-//
-// class MyFixture : public ::testing::Test {
-// public:
-// // All of these optional, just like in regular macro usage.
-// static void SetUpTestSuite() { ... }
-// static void TearDownTestSuite() { ... }
-// void SetUp() override { ... }
-// void TearDown() override { ... }
-// };
-//
-// class MyTest : public MyFixture {
-// public:
-// explicit MyTest(int data) : data_(data) {}
-// void TestBody() override { ... }
-//
-// private:
-// int data_;
-// };
-//
-// void RegisterMyTests(const std::vector<int>& values) {
-// for (int v : values) {
-// ::testing::RegisterTest(
-// "MyFixture", ("Test" + std::to_string(v)).c_str(), nullptr,
-// std::to_string(v).c_str(),
-// __FILE__, __LINE__,
-// // Important to use the fixture type as the return type here.
-// [=]() -> MyFixture* { return new MyTest(v); });
-// }
-// }
-// ...
-// int main(int argc, char** argv) {
-// ::testing::InitGoogleTest(&argc, argv);
-// std::vector<int> values_to_test = LoadValuesFromConfig();
-// RegisterMyTests(values_to_test);
-// ...
-// return RUN_ALL_TESTS();
-// }
-//
-template <int&... ExplicitParameterBarrier, typename Factory>
-TestInfo* RegisterTest(const char* test_suite_name, const char* test_name,
- const char* type_param, const char* value_param,
- const char* file, int line, Factory factory) {
- using TestT = typename std::remove_pointer<decltype(factory())>::type;
-
- class FactoryImpl : public internal::TestFactoryBase {
- public:
- explicit FactoryImpl(Factory f) : factory_(std::move(f)) {}
- Test* CreateTest() override { return factory_(); }
-
- private:
- Factory factory_;
- };
-
- return internal::MakeAndRegisterTestInfo(
- test_suite_name, test_name, type_param, value_param,
- internal::CodeLocation(file, line), internal::GetTypeId<TestT>(),
- internal::SuiteApiResolver<TestT>::GetSetUpCaseOrSuite(file, line),
- internal::SuiteApiResolver<TestT>::GetTearDownCaseOrSuite(file, line),
- new FactoryImpl{std::move(factory)});
-}
-
-} // namespace testing
-
-// Use this function in main() to run all tests. It returns 0 if all
-// tests are successful, or 1 otherwise.
-//
-// RUN_ALL_TESTS() should be invoked after the command line has been
-// parsed by InitGoogleTest().
-//
-// This function was formerly a macro; thus, it is in the global
-// namespace and has an all-caps name.
-int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_;
-
-inline int RUN_ALL_TESTS() {
- return ::testing::UnitTest::GetInstance()->Run();
-}
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_pred_impl.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_pred_impl.h
deleted file mode 100644
index 96b36fabf5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_pred_impl.h
+++ /dev/null
@@ -1,364 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on 07/21/2021 by command
-// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
-//
-// Implements a family of generic predicate assertion macros.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
-
-#include "gtest/gtest-assertion-result.h"
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-
-// This header implements a family of generic predicate assertion
-// macros:
-//
-// ASSERT_PRED_FORMAT1(pred_format, v1)
-// ASSERT_PRED_FORMAT2(pred_format, v1, v2)
-// ...
-//
-// where pred_format is a function or functor that takes n (in the
-// case of ASSERT_PRED_FORMATn) values and their source expression
-// text, and returns a testing::AssertionResult. See the definition
-// of ASSERT_EQ in gtest.h for an example.
-//
-// If you don't care about formatting, you can use the more
-// restrictive version:
-//
-// ASSERT_PRED1(pred, v1)
-// ASSERT_PRED2(pred, v1, v2)
-// ...
-//
-// where pred is an n-ary function or functor that returns bool,
-// and the values v1, v2, ..., must support the << operator for
-// streaming to std::ostream.
-//
-// We also define the EXPECT_* variations.
-//
-// For now we only support predicates whose arity is at most 5.
-// Please email googletestframework@googlegroups.com if you need
-// support for higher arities.
-
-// GTEST_ASSERT_ is the basic statement to which all of the assertions
-// in this file reduce. Don't use this in your code.
-
-#define GTEST_ASSERT_(expression, on_failure) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar = (expression)) \
- ; \
- else \
- on_failure(gtest_ar.failure_message())
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-template <typename Pred,
- typename T1>
-AssertionResult AssertPred1Helper(const char* pred_text,
- const char* e1,
- Pred pred,
- const T1& v1) {
- if (pred(v1)) return AssertionSuccess();
-
- return AssertionFailure()
- << pred_text << "(" << e1 << ") evaluates to false, where"
- << "\n"
- << e1 << " evaluates to " << ::testing::PrintToString(v1);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT1.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT1_(pred_format, v1, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, v1), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED1. Don't use
-// this in your code.
-#define GTEST_PRED1_(pred, v1, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred1Helper(#pred, \
- #v1, \
- pred, \
- v1), on_failure)
-
-// Unary predicate assertion macros.
-#define EXPECT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT1(pred_format, v1) \
- GTEST_PRED_FORMAT1_(pred_format, v1, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED1(pred, v1) \
- GTEST_PRED1_(pred, v1, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2>
-AssertionResult AssertPred2Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- Pred pred,
- const T1& v1,
- const T2& v2) {
- if (pred(v1, v2)) return AssertionSuccess();
-
- return AssertionFailure()
- << pred_text << "(" << e1 << ", " << e2
- << ") evaluates to false, where"
- << "\n"
- << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
- << e2 << " evaluates to " << ::testing::PrintToString(v2);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT2.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT2_(pred_format, v1, v2, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, v1, v2), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED2. Don't use
-// this in your code.
-#define GTEST_PRED2_(pred, v1, v2, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred2Helper(#pred, \
- #v1, \
- #v2, \
- pred, \
- v1, \
- v2), on_failure)
-
-// Binary predicate assertion macros.
-#define EXPECT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT2(pred_format, v1, v2) \
- GTEST_PRED_FORMAT2_(pred_format, v1, v2, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED2(pred, v1, v2) \
- GTEST_PRED2_(pred, v1, v2, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3>
-AssertionResult AssertPred3Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3) {
- if (pred(v1, v2, v3)) return AssertionSuccess();
-
- return AssertionFailure()
- << pred_text << "(" << e1 << ", " << e2 << ", " << e3
- << ") evaluates to false, where"
- << "\n"
- << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
- << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
- << e3 << " evaluates to " << ::testing::PrintToString(v3);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT3.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, v1, v2, v3), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED3. Don't use
-// this in your code.
-#define GTEST_PRED3_(pred, v1, v2, v3, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred3Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- pred, \
- v1, \
- v2, \
- v3), on_failure)
-
-// Ternary predicate assertion macros.
-#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3) \
- GTEST_PRED_FORMAT3_(pred_format, v1, v2, v3, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED3(pred, v1, v2, v3) \
- GTEST_PRED3_(pred, v1, v2, v3, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4>
-AssertionResult AssertPred4Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- if (pred(v1, v2, v3, v4)) return AssertionSuccess();
-
- return AssertionFailure()
- << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4
- << ") evaluates to false, where"
- << "\n"
- << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
- << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
- << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n"
- << e4 << " evaluates to " << ::testing::PrintToString(v4);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT4.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, v1, v2, v3, v4), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED4. Don't use
-// this in your code.
-#define GTEST_PRED4_(pred, v1, v2, v3, v4, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred4Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4), on_failure)
-
-// 4-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT4(pred_format, v1, v2, v3, v4) \
- GTEST_PRED_FORMAT4_(pred_format, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED4(pred, v1, v2, v3, v4) \
- GTEST_PRED4_(pred, v1, v2, v3, v4, GTEST_FATAL_FAILURE_)
-
-
-
-// Helper function for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-template <typename Pred,
- typename T1,
- typename T2,
- typename T3,
- typename T4,
- typename T5>
-AssertionResult AssertPred5Helper(const char* pred_text,
- const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- Pred pred,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- if (pred(v1, v2, v3, v4, v5)) return AssertionSuccess();
-
- return AssertionFailure()
- << pred_text << "(" << e1 << ", " << e2 << ", " << e3 << ", " << e4
- << ", " << e5 << ") evaluates to false, where"
- << "\n"
- << e1 << " evaluates to " << ::testing::PrintToString(v1) << "\n"
- << e2 << " evaluates to " << ::testing::PrintToString(v2) << "\n"
- << e3 << " evaluates to " << ::testing::PrintToString(v3) << "\n"
- << e4 << " evaluates to " << ::testing::PrintToString(v4) << "\n"
- << e5 << " evaluates to " << ::testing::PrintToString(v5);
-}
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED_FORMAT5.
-// Don't use this in your code.
-#define GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(pred_format(#v1, #v2, #v3, #v4, #v5, v1, v2, v3, v4, v5), \
- on_failure)
-
-// Internal macro for implementing {EXPECT|ASSERT}_PRED5. Don't use
-// this in your code.
-#define GTEST_PRED5_(pred, v1, v2, v3, v4, v5, on_failure)\
- GTEST_ASSERT_(::testing::AssertPred5Helper(#pred, \
- #v1, \
- #v2, \
- #v3, \
- #v4, \
- #v5, \
- pred, \
- v1, \
- v2, \
- v3, \
- v4, \
- v5), on_failure)
-
-// 5-ary predicate assertion macros.
-#define EXPECT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define EXPECT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_NONFATAL_FAILURE_)
-#define ASSERT_PRED_FORMAT5(pred_format, v1, v2, v3, v4, v5) \
- GTEST_PRED_FORMAT5_(pred_format, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-#define ASSERT_PRED5(pred, v1, v2, v3, v4, v5) \
- GTEST_PRED5_(pred, v1, v2, v3, v4, v5, GTEST_FATAL_FAILURE_)
-
-
-
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PRED_IMPL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_prod.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_prod.h
deleted file mode 100644
index b22030a8a8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/gtest_prod.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google C++ Testing and Mocking Framework definitions useful in production
-// code.
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_
-#define GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_
-
-// When you need to test the private or protected members of a class,
-// use the FRIEND_TEST macro to declare your tests as friends of the
-// class. For example:
-//
-// class MyClass {
-// private:
-// void PrivateMethod();
-// FRIEND_TEST(MyClassTest, PrivateMethodWorks);
-// };
-//
-// class MyClassTest : public testing::Test {
-// // ...
-// };
-//
-// TEST_F(MyClassTest, PrivateMethodWorks) {
-// // Can call MyClass::PrivateMethod() here.
-// }
-//
-// Note: The test class must be in the same namespace as the class being tested.
-// For example, putting MyClassTest in an anonymous namespace will not work.
-
-#define FRIEND_TEST(test_case_name, test_name)\
-friend class test_case_name##_##test_name##_Test
-
-#endif // GOOGLETEST_INCLUDE_GTEST_GTEST_PROD_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/README.md b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/README.md
deleted file mode 100644
index 0af3539abf..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/README.md
+++ /dev/null
@@ -1,58 +0,0 @@
-# Customization Points
-
-The custom directory is an injection point for custom user configurations.
-
-## Header `gtest.h`
-
-### The following macros can be defined:
-
-* `GTEST_OS_STACK_TRACE_GETTER_` - The name of an implementation of
- `OsStackTraceGetterInterface`.
-* `GTEST_CUSTOM_TEMPDIR_FUNCTION_` - An override for `testing::TempDir()`. See
- `testing::TempDir` for semantics and signature.
-
-## Header `gtest-port.h`
-
-The following macros can be defined:
-
-### Flag related macros:
-
-* `GTEST_FLAG(flag_name)`
-* `GTEST_USE_OWN_FLAGFILE_FLAG_` - Define to 0 when the system provides its
- own flagfile flag parsing.
-* `GTEST_DECLARE_bool_(name)`
-* `GTEST_DECLARE_int32_(name)`
-* `GTEST_DECLARE_string_(name)`
-* `GTEST_DEFINE_bool_(name, default_val, doc)`
-* `GTEST_DEFINE_int32_(name, default_val, doc)`
-* `GTEST_DEFINE_string_(name, default_val, doc)`
-* `GTEST_FLAG_GET(flag_name)`
-* `GTEST_FLAG_SET(flag_name, value)`
-
-### Logging:
-
-* `GTEST_LOG_(severity)`
-* `GTEST_CHECK_(condition)`
-* Functions `LogToStderr()` and `FlushInfoLog()` have to be provided too.
-
-### Threading:
-
-* `GTEST_HAS_NOTIFICATION_` - Enabled if Notification is already provided.
-* `GTEST_HAS_MUTEX_AND_THREAD_LOCAL_` - Enabled if `Mutex` and `ThreadLocal`
- are already provided. Must also provide `GTEST_DECLARE_STATIC_MUTEX_(mutex)`
- and `GTEST_DEFINE_STATIC_MUTEX_(mutex)`
-* `GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)`
-* `GTEST_LOCK_EXCLUDED_(locks)`
-
-### Underlying library support features
-
-* `GTEST_HAS_CXXABI_H_`
-
-### Exporting API symbols:
-
-* `GTEST_API_` - Specifier for exported symbols.
-
-## Header `gtest-printers.h`
-
-* See documentation at `gtest/gtest-printers.h` for details on how to define a
- custom printer.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-port.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-port.h
deleted file mode 100644
index db02881c0c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-port.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Injection point for custom user configurations. See README for details
-//
-// ** Custom implementation starts here **
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PORT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-printers.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-printers.h
deleted file mode 100644
index b9495d8378..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest-printers.h
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// This file provides an injection point for custom printers in a local
-// installation of gTest.
-// It will be included from gtest-printers.h and the overrides in this file
-// will be visible to everyone.
-//
-// Injection point for custom user configurations. See README for details
-//
-// ** Custom implementation starts here **
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_PRINTERS_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest.h
deleted file mode 100644
index afaaf17ba2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/custom/gtest.h
+++ /dev/null
@@ -1,37 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Injection point for custom user configurations. See README for details
-//
-// ** Custom implementation starts here **
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_CUSTOM_GTEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-death-test-internal.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-death-test-internal.h
deleted file mode 100644
index 128e0f4c28..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ /dev/null
@@ -1,305 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file defines internal utilities needed for implementing
-// death tests. They are subject to change without notice.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
-
-#include "gtest/gtest-matchers.h"
-#include "gtest/internal/gtest-internal.h"
-
-#include <stdio.h>
-#include <memory>
-
-GTEST_DECLARE_string_(internal_run_death_test);
-
-namespace testing {
-namespace internal {
-
-// Names of the flags (needed for parsing Google Test flags).
-const char kDeathTestStyleFlag[] = "death_test_style";
-const char kDeathTestUseFork[] = "death_test_use_fork";
-const char kInternalRunDeathTestFlag[] = "internal_run_death_test";
-
-#if GTEST_HAS_DEATH_TEST
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-// DeathTest is a class that hides much of the complexity of the
-// GTEST_DEATH_TEST_ macro. It is abstract; its static Create method
-// returns a concrete class that depends on the prevailing death test
-// style, as defined by the --gtest_death_test_style and/or
-// --gtest_internal_run_death_test flags.
-
-// In describing the results of death tests, these terms are used with
-// the corresponding definitions:
-//
-// exit status: The integer exit information in the format specified
-// by wait(2)
-// exit code: The integer code passed to exit(3), _exit(2), or
-// returned from main()
-class GTEST_API_ DeathTest {
- public:
- // Create returns false if there was an error determining the
- // appropriate action to take for the current death test; for example,
- // if the gtest_death_test_style flag is set to an invalid value.
- // The LastMessage method will return a more detailed message in that
- // case. Otherwise, the DeathTest pointer pointed to by the "test"
- // argument is set. If the death test should be skipped, the pointer
- // is set to NULL; otherwise, it is set to the address of a new concrete
- // DeathTest object that controls the execution of the current test.
- static bool Create(const char* statement, Matcher<const std::string&> matcher,
- const char* file, int line, DeathTest** test);
- DeathTest();
- virtual ~DeathTest() { }
-
- // A helper class that aborts a death test when it's deleted.
- class ReturnSentinel {
- public:
- explicit ReturnSentinel(DeathTest* test) : test_(test) { }
- ~ReturnSentinel() { test_->Abort(TEST_ENCOUNTERED_RETURN_STATEMENT); }
- private:
- DeathTest* const test_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ReturnSentinel);
- } GTEST_ATTRIBUTE_UNUSED_;
-
- // An enumeration of possible roles that may be taken when a death
- // test is encountered. EXECUTE means that the death test logic should
- // be executed immediately. OVERSEE means that the program should prepare
- // the appropriate environment for a child process to execute the death
- // test, then wait for it to complete.
- enum TestRole { OVERSEE_TEST, EXECUTE_TEST };
-
- // An enumeration of the three reasons that a test might be aborted.
- enum AbortReason {
- TEST_ENCOUNTERED_RETURN_STATEMENT,
- TEST_THREW_EXCEPTION,
- TEST_DID_NOT_DIE
- };
-
- // Assumes one of the above roles.
- virtual TestRole AssumeRole() = 0;
-
- // Waits for the death test to finish and returns its status.
- virtual int Wait() = 0;
-
- // Returns true if the death test passed; that is, the test process
- // exited during the test, its exit status matches a user-supplied
- // predicate, and its stderr output matches a user-supplied regular
- // expression.
- // The user-supplied predicate may be a macro expression rather
- // than a function pointer or functor, or else Wait and Passed could
- // be combined.
- virtual bool Passed(bool exit_status_ok) = 0;
-
- // Signals that the death test did not die as expected.
- virtual void Abort(AbortReason reason) = 0;
-
- // Returns a human-readable outcome message regarding the outcome of
- // the last death test.
- static const char* LastMessage();
-
- static void set_last_death_test_message(const std::string& message);
-
- private:
- // A string containing a description of the outcome of the last death test.
- static std::string last_death_test_message_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DeathTest);
-};
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-// Factory interface for death tests. May be mocked out for testing.
-class DeathTestFactory {
- public:
- virtual ~DeathTestFactory() { }
- virtual bool Create(const char* statement,
- Matcher<const std::string&> matcher, const char* file,
- int line, DeathTest** test) = 0;
-};
-
-// A concrete DeathTestFactory implementation for normal use.
-class DefaultDeathTestFactory : public DeathTestFactory {
- public:
- bool Create(const char* statement, Matcher<const std::string&> matcher,
- const char* file, int line, DeathTest** test) override;
-};
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-GTEST_API_ bool ExitedUnsuccessfully(int exit_status);
-
-// A string passed to EXPECT_DEATH (etc.) is caught by one of these overloads
-// and interpreted as a regex (rather than an Eq matcher) for legacy
-// compatibility.
-inline Matcher<const ::std::string&> MakeDeathTestMatcher(
- ::testing::internal::RE regex) {
- return ContainsRegex(regex.pattern());
-}
-inline Matcher<const ::std::string&> MakeDeathTestMatcher(const char* regex) {
- return ContainsRegex(regex);
-}
-inline Matcher<const ::std::string&> MakeDeathTestMatcher(
- const ::std::string& regex) {
- return ContainsRegex(regex);
-}
-
-// If a Matcher<const ::std::string&> is passed to EXPECT_DEATH (etc.), it's
-// used directly.
-inline Matcher<const ::std::string&> MakeDeathTestMatcher(
- Matcher<const ::std::string&> matcher) {
- return matcher;
-}
-
-// Traps C++ exceptions escaping statement and reports them as test
-// failures. Note that trapping SEH exceptions is not implemented here.
-# if GTEST_HAS_EXCEPTIONS
-# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } catch (const ::std::exception& gtest_exception) { \
- fprintf(\
- stderr, \
- "\n%s: Caught std::exception-derived exception escaping the " \
- "death test statement. Exception message: %s\n", \
- ::testing::internal::FormatFileLocation(__FILE__, __LINE__).c_str(), \
- gtest_exception.what()); \
- fflush(stderr); \
- death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
- } catch (...) { \
- death_test->Abort(::testing::internal::DeathTest::TEST_THREW_EXCEPTION); \
- }
-
-# else
-# define GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, death_test) \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement)
-
-# endif
-
-// This macro is for implementing ASSERT_DEATH*, EXPECT_DEATH*,
-// ASSERT_EXIT*, and EXPECT_EXIT*.
-#define GTEST_DEATH_TEST_(statement, predicate, regex_or_matcher, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- ::testing::internal::DeathTest* gtest_dt; \
- if (!::testing::internal::DeathTest::Create( \
- #statement, \
- ::testing::internal::MakeDeathTestMatcher(regex_or_matcher), \
- __FILE__, __LINE__, &gtest_dt)) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- if (gtest_dt != nullptr) { \
- std::unique_ptr< ::testing::internal::DeathTest> gtest_dt_ptr(gtest_dt); \
- switch (gtest_dt->AssumeRole()) { \
- case ::testing::internal::DeathTest::OVERSEE_TEST: \
- if (!gtest_dt->Passed(predicate(gtest_dt->Wait()))) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__); \
- } \
- break; \
- case ::testing::internal::DeathTest::EXECUTE_TEST: { \
- ::testing::internal::DeathTest::ReturnSentinel gtest_sentinel( \
- gtest_dt); \
- GTEST_EXECUTE_DEATH_TEST_STATEMENT_(statement, gtest_dt); \
- gtest_dt->Abort(::testing::internal::DeathTest::TEST_DID_NOT_DIE); \
- break; \
- } \
- } \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_, __LINE__) \
- : fail(::testing::internal::DeathTest::LastMessage())
-// The symbol "fail" here expands to something into which a message
-// can be streamed.
-
-// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in
-// NDEBUG mode. In this case we need the statements to be executed and the macro
-// must accept a streamed message even though the message is never printed.
-// The regex object is not evaluated, but it is used to prevent "unused"
-// warnings and to avoid an expression that doesn't compile in debug mode.
-#define GTEST_EXECUTE_STATEMENT_(statement, regex_or_matcher) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } else if (!::testing::internal::AlwaysTrue()) { \
- ::testing::internal::MakeDeathTestMatcher(regex_or_matcher); \
- } else \
- ::testing::Message()
-
-// A class representing the parsed contents of the
-// --gtest_internal_run_death_test flag, as it existed when
-// RUN_ALL_TESTS was called.
-class InternalRunDeathTestFlag {
- public:
- InternalRunDeathTestFlag(const std::string& a_file,
- int a_line,
- int an_index,
- int a_write_fd)
- : file_(a_file), line_(a_line), index_(an_index),
- write_fd_(a_write_fd) {}
-
- ~InternalRunDeathTestFlag() {
- if (write_fd_ >= 0)
- posix::Close(write_fd_);
- }
-
- const std::string& file() const { return file_; }
- int line() const { return line_; }
- int index() const { return index_; }
- int write_fd() const { return write_fd_; }
-
- private:
- std::string file_;
- int line_;
- int index_;
- int write_fd_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InternalRunDeathTestFlag);
-};
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag();
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace internal
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_DEATH_TEST_INTERNAL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-filepath.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-filepath.h
deleted file mode 100644
index 4dfe2e2227..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-filepath.h
+++ /dev/null
@@ -1,213 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Google Test filepath utilities
-//
-// This header file declares classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included in gtest/internal/gtest-internal.h.
-// Do not include this header file separately!
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
-
-#include "gtest/internal/gtest-string.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-namespace testing {
-namespace internal {
-
-// FilePath - a class for file and directory pathname manipulation which
-// handles platform-specific conventions (like the pathname separator).
-// Used for helper functions for naming files in a directory for xml output.
-// Except for Set methods, all methods are const or static, which provides an
-// "immutable value object" -- useful for peace of mind.
-// A FilePath with a value ending in a path separator ("like/this/") represents
-// a directory, otherwise it is assumed to represent a file. In either case,
-// it may or may not represent an actual file or directory in the file system.
-// Names are NOT checked for syntax correctness -- no checking for illegal
-// characters, malformed paths, etc.
-
-class GTEST_API_ FilePath {
- public:
- FilePath() : pathname_("") { }
- FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { }
-
- explicit FilePath(const std::string& pathname) : pathname_(pathname) {
- Normalize();
- }
-
- FilePath& operator=(const FilePath& rhs) {
- Set(rhs);
- return *this;
- }
-
- void Set(const FilePath& rhs) {
- pathname_ = rhs.pathname_;
- }
-
- const std::string& string() const { return pathname_; }
- const char* c_str() const { return pathname_.c_str(); }
-
- // Returns the current working directory, or "" if unsuccessful.
- static FilePath GetCurrentDir();
-
- // Given directory = "dir", base_name = "test", number = 0,
- // extension = "xml", returns "dir/test.xml". If number is greater
- // than zero (e.g., 12), returns "dir/test_12.xml".
- // On Windows platform, uses \ as the separator rather than /.
- static FilePath MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension);
-
- // Given directory = "dir", relative_path = "test.xml",
- // returns "dir/test.xml".
- // On Windows, uses \ as the separator rather than /.
- static FilePath ConcatPaths(const FilePath& directory,
- const FilePath& relative_path);
-
- // Returns a pathname for a file that does not currently exist. The pathname
- // will be directory/base_name.extension or
- // directory/base_name_<number>.extension if directory/base_name.extension
- // already exists. The number will be incremented until a pathname is found
- // that does not already exist.
- // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
- // There could be a race condition if two or more processes are calling this
- // function at the same time -- they could both pick the same filename.
- static FilePath GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension);
-
- // Returns true if and only if the path is "".
- bool IsEmpty() const { return pathname_.empty(); }
-
- // If input name has a trailing separator character, removes it and returns
- // the name, otherwise return the name string unmodified.
- // On Windows platform, uses \ as the separator, other platforms use /.
- FilePath RemoveTrailingPathSeparator() const;
-
- // Returns a copy of the FilePath with the directory part removed.
- // Example: FilePath("path/to/file").RemoveDirectoryName() returns
- // FilePath("file"). If there is no directory part ("just_a_file"), it returns
- // the FilePath unmodified. If there is no file part ("just_a_dir/") it
- // returns an empty FilePath ("").
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveDirectoryName() const;
-
- // RemoveFileName returns the directory path with the filename removed.
- // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
- // If the FilePath is "a_file" or "/a_file", RemoveFileName returns
- // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
- // not have a file, like "just/a/dir/", it returns the FilePath unmodified.
- // On Windows platform, '\' is the path separator, otherwise it is '/'.
- FilePath RemoveFileName() const;
-
- // Returns a copy of the FilePath with the case-insensitive extension removed.
- // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
- // FilePath("dir/file"). If a case-insensitive extension is not
- // found, returns a copy of the original FilePath.
- FilePath RemoveExtension(const char* extension) const;
-
- // Creates directories so that path exists. Returns true if successful or if
- // the directories already exist; returns false if unable to create
- // directories for any reason. Will also return false if the FilePath does
- // not represent a directory (that is, it doesn't end with a path separator).
- bool CreateDirectoriesRecursively() const;
-
- // Create the directory so that path exists. Returns true if successful or
- // if the directory already exists; returns false if unable to create the
- // directory for any reason, including if the parent directory does not
- // exist. Not named "CreateDirectory" because that's a macro on Windows.
- bool CreateFolder() const;
-
- // Returns true if FilePath describes something in the file-system,
- // either a file, directory, or whatever, and that something exists.
- bool FileOrDirectoryExists() const;
-
- // Returns true if pathname describes a directory in the file-system
- // that exists.
- bool DirectoryExists() const;
-
- // Returns true if FilePath ends with a path separator, which indicates that
- // it is intended to represent a directory. Returns false otherwise.
- // This does NOT check that a directory (or file) actually exists.
- bool IsDirectory() const;
-
- // Returns true if pathname describes a root directory. (Windows has one
- // root directory per disk drive.)
- bool IsRootDirectory() const;
-
- // Returns true if pathname describes an absolute path.
- bool IsAbsolutePath() const;
-
- private:
- // Replaces multiple consecutive separators with a single separator.
- // For example, "bar///foo" becomes "bar/foo". Does not eliminate other
- // redundancies that might be in a pathname involving "." or "..".
- //
- // A pathname with multiple consecutive separators may occur either through
- // user error or as a result of some scripts or APIs that generate a pathname
- // with a trailing separator. On other platforms the same API or script
- // may NOT generate a pathname with a trailing "/". Then elsewhere that
- // pathname may have another "/" and pathname components added to it,
- // without checking for the separator already being there.
- // The script language and operating system may allow paths like "foo//bar"
- // but some of the functions in FilePath will not handle that correctly. In
- // particular, RemoveTrailingPathSeparator() only removes one separator, and
- // it is called in CreateDirectoriesRecursively() assuming that it will change
- // a pathname from directory syntax (trailing separator) to filename syntax.
- //
- // On Windows this method also replaces the alternate path separator '/' with
- // the primary path separator '\\', so that for example "bar\\/\\foo" becomes
- // "bar\\foo".
-
- void Normalize();
-
- // Returns a pointer to the last occurrence of a valid path separator in
- // the FilePath. On Windows, for example, both '/' and '\' are valid path
- // separators. Returns NULL if no path separator was found.
- const char* FindLastPathSeparator() const;
-
- std::string pathname_;
-}; // class FilePath
-
-} // namespace internal
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-internal.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-internal.h
deleted file mode 100644
index fc15e94785..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-internal.h
+++ /dev/null
@@ -1,1562 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file declares functions and macros used internally by
-// Google Test. They are subject to change without notice.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
-
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_OS_LINUX
-# include <stdlib.h>
-# include <sys/types.h>
-# include <sys/wait.h>
-# include <unistd.h>
-#endif // GTEST_OS_LINUX
-
-#if GTEST_HAS_EXCEPTIONS
-# include <stdexcept>
-#endif
-
-#include <ctype.h>
-#include <float.h>
-#include <string.h>
-#include <cstdint>
-#include <iomanip>
-#include <limits>
-#include <map>
-#include <set>
-#include <string>
-#include <type_traits>
-#include <vector>
-
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-filepath.h"
-#include "gtest/internal/gtest-string.h"
-#include "gtest/internal/gtest-type-util.h"
-
-// Due to C++ preprocessor weirdness, we need double indirection to
-// concatenate two tokens when one of them is __LINE__. Writing
-//
-// foo ## __LINE__
-//
-// will result in the token foo__LINE__, instead of foo followed by
-// the current line number. For more details, see
-// http://www.parashift.com/c++-faq-lite/misc-technical-issues.html#faq-39.6
-#define GTEST_CONCAT_TOKEN_(foo, bar) GTEST_CONCAT_TOKEN_IMPL_(foo, bar)
-#define GTEST_CONCAT_TOKEN_IMPL_(foo, bar) foo ## bar
-
-// Stringifies its argument.
-// Work around a bug in visual studio which doesn't accept code like this:
-//
-// #define GTEST_STRINGIFY_(name) #name
-// #define MACRO(a, b, c) ... GTEST_STRINGIFY_(a) ...
-// MACRO(, x, y)
-//
-// Complaining about the argument to GTEST_STRINGIFY_ being empty.
-// This is allowed by the spec.
-#define GTEST_STRINGIFY_HELPER_(name, ...) #name
-#define GTEST_STRINGIFY_(...) GTEST_STRINGIFY_HELPER_(__VA_ARGS__, )
-
-namespace proto2 {
-class MessageLite;
-}
-
-namespace testing {
-
-// Forward declarations.
-
-class AssertionResult; // Result of an assertion.
-class Message; // Represents a failure message.
-class Test; // Represents a test.
-class TestInfo; // Information about a test.
-class TestPartResult; // Result of a test part.
-class UnitTest; // A collection of test suites.
-
-template <typename T>
-::std::string PrintToString(const T& value);
-
-namespace internal {
-
-struct TraceInfo; // Information about a trace point.
-class TestInfoImpl; // Opaque implementation of TestInfo
-class UnitTestImpl; // Opaque implementation of UnitTest
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-GTEST_API_ extern const char kStackTraceMarker[];
-
-// An IgnoredValue object can be implicitly constructed from ANY value.
-class IgnoredValue {
- struct Sink {};
- public:
- // This constructor template allows any value to be implicitly
- // converted to IgnoredValue. The object has no data member and
- // doesn't try to remember anything about the argument. We
- // deliberately omit the 'explicit' keyword in order to allow the
- // conversion to be implicit.
- // Disable the conversion if T already has a magical conversion operator.
- // Otherwise we get ambiguity.
- template <typename T,
- typename std::enable_if<!std::is_convertible<T, Sink>::value,
- int>::type = 0>
- IgnoredValue(const T& /* ignored */) {} // NOLINT(runtime/explicit)
-};
-
-// Appends the user-supplied message to the Google-Test-generated message.
-GTEST_API_ std::string AppendUserMessage(
- const std::string& gtest_msg, const Message& user_msg);
-
-#if GTEST_HAS_EXCEPTIONS
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4275 \
-/* an exported class was derived from a class that was not exported */)
-
-// This exception is thrown by (and only by) a failed Google Test
-// assertion when GTEST_FLAG(throw_on_failure) is true (if exceptions
-// are enabled). We derive it from std::runtime_error, which is for
-// errors presumably detectable only at run time. Since
-// std::runtime_error inherits from std::exception, many testing
-// frameworks know how to extract and print the message inside it.
-class GTEST_API_ GoogleTestFailureException : public ::std::runtime_error {
- public:
- explicit GoogleTestFailureException(const TestPartResult& failure);
-};
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4275
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-namespace edit_distance {
-// Returns the optimal edits to go from 'left' to 'right'.
-// All edits cost the same, with replace having lower priority than
-// add/remove.
-// Simple implementation of the Wagner-Fischer algorithm.
-// See http://en.wikipedia.org/wiki/Wagner-Fischer_algorithm
-enum EditType { kMatch, kAdd, kRemove, kReplace };
-GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
- const std::vector<size_t>& left, const std::vector<size_t>& right);
-
-// Same as above, but the input is represented as strings.
-GTEST_API_ std::vector<EditType> CalculateOptimalEdits(
- const std::vector<std::string>& left,
- const std::vector<std::string>& right);
-
-// Create a diff of the input strings in Unified diff format.
-GTEST_API_ std::string CreateUnifiedDiff(const std::vector<std::string>& left,
- const std::vector<std::string>& right,
- size_t context = 2);
-
-} // namespace edit_distance
-
-// Calculate the diff between 'left' and 'right' and return it in unified diff
-// format.
-// If not null, stores in 'total_line_count' the total number of lines found
-// in left + right.
-GTEST_API_ std::string DiffStrings(const std::string& left,
- const std::string& right,
- size_t* total_line_count);
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// expected_expression: "foo"
-// actual_expression: "bar"
-// expected_value: "5"
-// actual_value: "6"
-//
-// The ignoring_case parameter is true if and only if the assertion is a
-// *_STRCASEEQ*. When it's true, the string " (ignoring case)" will
-// be inserted into the message.
-GTEST_API_ AssertionResult EqFailure(const char* expected_expression,
- const char* actual_expression,
- const std::string& expected_value,
- const std::string& actual_value,
- bool ignoring_case);
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-GTEST_API_ std::string GetBoolAssertionFailureMessage(
- const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value);
-
-// This template class represents an IEEE floating-point number
-// (either single-precision or double-precision, depending on the
-// template parameters).
-//
-// The purpose of this class is to do more sophisticated number
-// comparison. (Due to round-off error, etc, it's very unlikely that
-// two floating-points will be equal exactly. Hence a naive
-// comparison by the == operation often doesn't work.)
-//
-// Format of IEEE floating-point:
-//
-// The most-significant bit being the leftmost, an IEEE
-// floating-point looks like
-//
-// sign_bit exponent_bits fraction_bits
-//
-// Here, sign_bit is a single bit that designates the sign of the
-// number.
-//
-// For float, there are 8 exponent bits and 23 fraction bits.
-//
-// For double, there are 11 exponent bits and 52 fraction bits.
-//
-// More details can be found at
-// http://en.wikipedia.org/wiki/IEEE_floating-point_standard.
-//
-// Template parameter:
-//
-// RawType: the raw floating-point type (either float or double)
-template <typename RawType>
-class FloatingPoint {
- public:
- // Defines the unsigned integer type that has the same size as the
- // floating point number.
- typedef typename TypeWithSize<sizeof(RawType)>::UInt Bits;
-
- // Constants.
-
- // # of bits in a number.
- static const size_t kBitCount = 8*sizeof(RawType);
-
- // # of fraction bits in a number.
- static const size_t kFractionBitCount =
- std::numeric_limits<RawType>::digits - 1;
-
- // # of exponent bits in a number.
- static const size_t kExponentBitCount = kBitCount - 1 - kFractionBitCount;
-
- // The mask for the sign bit.
- static const Bits kSignBitMask = static_cast<Bits>(1) << (kBitCount - 1);
-
- // The mask for the fraction bits.
- static const Bits kFractionBitMask =
- ~static_cast<Bits>(0) >> (kExponentBitCount + 1);
-
- // The mask for the exponent bits.
- static const Bits kExponentBitMask = ~(kSignBitMask | kFractionBitMask);
-
- // How many ULP's (Units in the Last Place) we want to tolerate when
- // comparing two numbers. The larger the value, the more error we
- // allow. A 0 value means that two numbers must be exactly the same
- // to be considered equal.
- //
- // The maximum error of a single floating-point operation is 0.5
- // units in the last place. On Intel CPU's, all floating-point
- // calculations are done with 80-bit precision, while double has 64
- // bits. Therefore, 4 should be enough for ordinary use.
- //
- // See the following article for more details on ULP:
- // http://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
- static const uint32_t kMaxUlps = 4;
-
- // Constructs a FloatingPoint from a raw floating-point number.
- //
- // On an Intel CPU, passing a non-normalized NAN (Not a Number)
- // around may change its bits, although the new value is guaranteed
- // to be also a NAN. Therefore, don't expect this constructor to
- // preserve the bits in x when x is a NAN.
- explicit FloatingPoint(const RawType& x) { u_.value_ = x; }
-
- // Static methods
-
- // Reinterprets a bit pattern as a floating-point number.
- //
- // This function is needed to test the AlmostEquals() method.
- static RawType ReinterpretBits(const Bits bits) {
- FloatingPoint fp(0);
- fp.u_.bits_ = bits;
- return fp.u_.value_;
- }
-
- // Returns the floating-point number that represent positive infinity.
- static RawType Infinity() {
- return ReinterpretBits(kExponentBitMask);
- }
-
- // Returns the maximum representable finite floating-point number.
- static RawType Max();
-
- // Non-static methods
-
- // Returns the bits that represents this number.
- const Bits &bits() const { return u_.bits_; }
-
- // Returns the exponent bits of this number.
- Bits exponent_bits() const { return kExponentBitMask & u_.bits_; }
-
- // Returns the fraction bits of this number.
- Bits fraction_bits() const { return kFractionBitMask & u_.bits_; }
-
- // Returns the sign bit of this number.
- Bits sign_bit() const { return kSignBitMask & u_.bits_; }
-
- // Returns true if and only if this is NAN (not a number).
- bool is_nan() const {
- // It's a NAN if the exponent bits are all ones and the fraction
- // bits are not entirely zeros.
- return (exponent_bits() == kExponentBitMask) && (fraction_bits() != 0);
- }
-
- // Returns true if and only if this number is at most kMaxUlps ULP's away
- // from rhs. In particular, this function:
- //
- // - returns false if either number is (or both are) NAN.
- // - treats really large numbers as almost equal to infinity.
- // - thinks +0.0 and -0.0 are 0 DLP's apart.
- bool AlmostEquals(const FloatingPoint& rhs) const {
- // The IEEE standard says that any comparison operation involving
- // a NAN must return false.
- if (is_nan() || rhs.is_nan()) return false;
-
- return DistanceBetweenSignAndMagnitudeNumbers(u_.bits_, rhs.u_.bits_)
- <= kMaxUlps;
- }
-
- private:
- // The data type used to store the actual floating-point number.
- union FloatingPointUnion {
- RawType value_; // The raw floating-point number.
- Bits bits_; // The bits that represent the number.
- };
-
- // Converts an integer from the sign-and-magnitude representation to
- // the biased representation. More precisely, let N be 2 to the
- // power of (kBitCount - 1), an integer x is represented by the
- // unsigned number x + N.
- //
- // For instance,
- //
- // -N + 1 (the most negative number representable using
- // sign-and-magnitude) is represented by 1;
- // 0 is represented by N; and
- // N - 1 (the biggest number representable using
- // sign-and-magnitude) is represented by 2N - 1.
- //
- // Read http://en.wikipedia.org/wiki/Signed_number_representations
- // for more details on signed number representations.
- static Bits SignAndMagnitudeToBiased(const Bits &sam) {
- if (kSignBitMask & sam) {
- // sam represents a negative number.
- return ~sam + 1;
- } else {
- // sam represents a positive number.
- return kSignBitMask | sam;
- }
- }
-
- // Given two numbers in the sign-and-magnitude representation,
- // returns the distance between them as an unsigned number.
- static Bits DistanceBetweenSignAndMagnitudeNumbers(const Bits &sam1,
- const Bits &sam2) {
- const Bits biased1 = SignAndMagnitudeToBiased(sam1);
- const Bits biased2 = SignAndMagnitudeToBiased(sam2);
- return (biased1 >= biased2) ? (biased1 - biased2) : (biased2 - biased1);
- }
-
- FloatingPointUnion u_;
-};
-
-// We cannot use std::numeric_limits<T>::max() as it clashes with the max()
-// macro defined by <windows.h>.
-template <>
-inline float FloatingPoint<float>::Max() { return FLT_MAX; }
-template <>
-inline double FloatingPoint<double>::Max() { return DBL_MAX; }
-
-// Typedefs the instances of the FloatingPoint template class that we
-// care to use.
-typedef FloatingPoint<float> Float;
-typedef FloatingPoint<double> Double;
-
-// In order to catch the mistake of putting tests that use different
-// test fixture classes in the same test suite, we need to assign
-// unique IDs to fixture classes and compare them. The TypeId type is
-// used to hold such IDs. The user should treat TypeId as an opaque
-// type: the only operation allowed on TypeId values is to compare
-// them for equality using the == operator.
-typedef const void* TypeId;
-
-template <typename T>
-class TypeIdHelper {
- public:
- // dummy_ must not have a const type. Otherwise an overly eager
- // compiler (e.g. MSVC 7.1 & 8.0) may try to merge
- // TypeIdHelper<T>::dummy_ for different Ts as an "optimization".
- static bool dummy_;
-};
-
-template <typename T>
-bool TypeIdHelper<T>::dummy_ = false;
-
-// GetTypeId<T>() returns the ID of type T. Different values will be
-// returned for different types. Calling the function twice with the
-// same type argument is guaranteed to return the same ID.
-template <typename T>
-TypeId GetTypeId() {
- // The compiler is required to allocate a different
- // TypeIdHelper<T>::dummy_ variable for each T used to instantiate
- // the template. Therefore, the address of dummy_ is guaranteed to
- // be unique.
- return &(TypeIdHelper<T>::dummy_);
-}
-
-// Returns the type ID of ::testing::Test. Always call this instead
-// of GetTypeId< ::testing::Test>() to get the type ID of
-// ::testing::Test, as the latter may give the wrong result due to a
-// suspected linker bug when compiling Google Test as a Mac OS X
-// framework.
-GTEST_API_ TypeId GetTestTypeId();
-
-// Defines the abstract factory interface that creates instances
-// of a Test object.
-class TestFactoryBase {
- public:
- virtual ~TestFactoryBase() {}
-
- // Creates a test instance to run. The instance is both created and destroyed
- // within TestInfoImpl::Run()
- virtual Test* CreateTest() = 0;
-
- protected:
- TestFactoryBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestFactoryBase);
-};
-
-// This class provides implementation of TeastFactoryBase interface.
-// It is used in TEST and TEST_F macros.
-template <class TestClass>
-class TestFactoryImpl : public TestFactoryBase {
- public:
- Test* CreateTest() override { return new TestClass; }
-};
-
-#if GTEST_OS_WINDOWS
-
-// Predicate-formatters for implementing the HRESULT checking macros
-// {ASSERT|EXPECT}_HRESULT_{SUCCEEDED|FAILED}
-// We pass a long instead of HRESULT to avoid causing an
-// include dependency for the HRESULT type.
-GTEST_API_ AssertionResult IsHRESULTSuccess(const char* expr,
- long hr); // NOLINT
-GTEST_API_ AssertionResult IsHRESULTFailure(const char* expr,
- long hr); // NOLINT
-
-#endif // GTEST_OS_WINDOWS
-
-// Types of SetUpTestSuite() and TearDownTestSuite() functions.
-using SetUpTestSuiteFunc = void (*)();
-using TearDownTestSuiteFunc = void (*)();
-
-struct CodeLocation {
- CodeLocation(const std::string& a_file, int a_line)
- : file(a_file), line(a_line) {}
-
- std::string file;
- int line;
-};
-
-// Helper to identify which setup function for TestCase / TestSuite to call.
-// Only one function is allowed, either TestCase or TestSute but not both.
-
-// Utility functions to help SuiteApiResolver
-using SetUpTearDownSuiteFuncType = void (*)();
-
-inline SetUpTearDownSuiteFuncType GetNotDefaultOrNull(
- SetUpTearDownSuiteFuncType a, SetUpTearDownSuiteFuncType def) {
- return a == def ? nullptr : a;
-}
-
-template <typename T>
-// Note that SuiteApiResolver inherits from T because
-// SetUpTestSuite()/TearDownTestSuite() could be protected. This way
-// SuiteApiResolver can access them.
-struct SuiteApiResolver : T {
- // testing::Test is only forward declared at this point. So we make it a
- // dependent class for the compiler to be OK with it.
- using Test =
- typename std::conditional<sizeof(T) != 0, ::testing::Test, void>::type;
-
- static SetUpTearDownSuiteFuncType GetSetUpCaseOrSuite(const char* filename,
- int line_num) {
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- SetUpTearDownSuiteFuncType test_case_fp =
- GetNotDefaultOrNull(&T::SetUpTestCase, &Test::SetUpTestCase);
- SetUpTearDownSuiteFuncType test_suite_fp =
- GetNotDefaultOrNull(&T::SetUpTestSuite, &Test::SetUpTestSuite);
-
- GTEST_CHECK_(!test_case_fp || !test_suite_fp)
- << "Test can not provide both SetUpTestSuite and SetUpTestCase, please "
- "make sure there is only one present at "
- << filename << ":" << line_num;
-
- return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
-#else
- (void)(filename);
- (void)(line_num);
- return &T::SetUpTestSuite;
-#endif
- }
-
- static SetUpTearDownSuiteFuncType GetTearDownCaseOrSuite(const char* filename,
- int line_num) {
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- SetUpTearDownSuiteFuncType test_case_fp =
- GetNotDefaultOrNull(&T::TearDownTestCase, &Test::TearDownTestCase);
- SetUpTearDownSuiteFuncType test_suite_fp =
- GetNotDefaultOrNull(&T::TearDownTestSuite, &Test::TearDownTestSuite);
-
- GTEST_CHECK_(!test_case_fp || !test_suite_fp)
- << "Test can not provide both TearDownTestSuite and TearDownTestCase,"
- " please make sure there is only one present at"
- << filename << ":" << line_num;
-
- return test_case_fp != nullptr ? test_case_fp : test_suite_fp;
-#else
- (void)(filename);
- (void)(line_num);
- return &T::TearDownTestSuite;
-#endif
- }
-};
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_suite_name: name of the test suite
-// name: name of the test
-// type_param: the name of the test's type parameter, or NULL if
-// this is not a typed or a type-parameterized test.
-// value_param: text representation of the test's value parameter,
-// or NULL if this is not a type-parameterized test.
-// code_location: code location where the test is defined
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test suite
-// tear_down_tc: pointer to the function that tears down the test suite
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-GTEST_API_ TestInfo* MakeAndRegisterTestInfo(
- const char* test_suite_name, const char* name, const char* type_param,
- const char* value_param, CodeLocation code_location,
- TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
- TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory);
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-GTEST_API_ bool SkipPrefix(const char* prefix, const char** pstr);
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-// State of the definition of a type-parameterized test suite.
-class GTEST_API_ TypedTestSuitePState {
- public:
- TypedTestSuitePState() : registered_(false) {}
-
- // Adds the given test name to defined_test_names_ and return true
- // if the test suite hasn't been registered; otherwise aborts the
- // program.
- bool AddTestName(const char* file, int line, const char* case_name,
- const char* test_name) {
- if (registered_) {
- fprintf(stderr,
- "%s Test %s must be defined before "
- "REGISTER_TYPED_TEST_SUITE_P(%s, ...).\n",
- FormatFileLocation(file, line).c_str(), test_name, case_name);
- fflush(stderr);
- posix::Abort();
- }
- registered_tests_.insert(
- ::std::make_pair(test_name, CodeLocation(file, line)));
- return true;
- }
-
- bool TestExists(const std::string& test_name) const {
- return registered_tests_.count(test_name) > 0;
- }
-
- const CodeLocation& GetCodeLocation(const std::string& test_name) const {
- RegisteredTestsMap::const_iterator it = registered_tests_.find(test_name);
- GTEST_CHECK_(it != registered_tests_.end());
- return it->second;
- }
-
- // Verifies that registered_tests match the test names in
- // defined_test_names_; returns registered_tests if successful, or
- // aborts the program otherwise.
- const char* VerifyRegisteredTestNames(const char* test_suite_name,
- const char* file, int line,
- const char* registered_tests);
-
- private:
- typedef ::std::map<std::string, CodeLocation> RegisteredTestsMap;
-
- bool registered_;
- RegisteredTestsMap registered_tests_;
-};
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-using TypedTestCasePState = TypedTestSuitePState;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-// Skips to the first non-space char after the first comma in 'str';
-// returns NULL if no comma is found in 'str'.
-inline const char* SkipComma(const char* str) {
- const char* comma = strchr(str, ',');
- if (comma == nullptr) {
- return nullptr;
- }
- while (IsSpace(*(++comma))) {}
- return comma;
-}
-
-// Returns the prefix of 'str' before the first comma in it; returns
-// the entire string if it contains no comma.
-inline std::string GetPrefixUntilComma(const char* str) {
- const char* comma = strchr(str, ',');
- return comma == nullptr ? str : std::string(str, comma);
-}
-
-// Splits a given string on a given delimiter, populating a given
-// vector with the fields.
-void SplitString(const ::std::string& str, char delimiter,
- ::std::vector< ::std::string>* dest);
-
-// The default argument to the template below for the case when the user does
-// not provide a name generator.
-struct DefaultNameGenerator {
- template <typename T>
- static std::string GetName(int i) {
- return StreamableToString(i);
- }
-};
-
-template <typename Provided = DefaultNameGenerator>
-struct NameGeneratorSelector {
- typedef Provided type;
-};
-
-template <typename NameGenerator>
-void GenerateNamesRecursively(internal::None, std::vector<std::string>*, int) {}
-
-template <typename NameGenerator, typename Types>
-void GenerateNamesRecursively(Types, std::vector<std::string>* result, int i) {
- result->push_back(NameGenerator::template GetName<typename Types::Head>(i));
- GenerateNamesRecursively<NameGenerator>(typename Types::Tail(), result,
- i + 1);
-}
-
-template <typename NameGenerator, typename Types>
-std::vector<std::string> GenerateNames() {
- std::vector<std::string> result;
- GenerateNamesRecursively<NameGenerator>(Types(), &result, 0);
- return result;
-}
-
-// TypeParameterizedTest<Fixture, TestSel, Types>::Register()
-// registers a list of type-parameterized tests with Google Test. The
-// return value is insignificant - we just need to return something
-// such that we can call this function in a namespace scope.
-//
-// Implementation note: The GTEST_TEMPLATE_ macro declares a template
-// template parameter. It's defined in gtest-type-util.h.
-template <GTEST_TEMPLATE_ Fixture, class TestSel, typename Types>
-class TypeParameterizedTest {
- public:
- // 'index' is the index of the test in the type list 'Types'
- // specified in INSTANTIATE_TYPED_TEST_SUITE_P(Prefix, TestSuite,
- // Types). Valid values for 'index' are [0, N - 1] where N is the
- // length of Types.
- static bool Register(const char* prefix, const CodeLocation& code_location,
- const char* case_name, const char* test_names, int index,
- const std::vector<std::string>& type_names =
- GenerateNames<DefaultNameGenerator, Types>()) {
- typedef typename Types::Head Type;
- typedef Fixture<Type> FixtureClass;
- typedef typename GTEST_BIND_(TestSel, Type) TestClass;
-
- // First, registers the first type-parameterized test in the type
- // list.
- MakeAndRegisterTestInfo(
- (std::string(prefix) + (prefix[0] == '\0' ? "" : "/") + case_name +
- "/" + type_names[static_cast<size_t>(index)])
- .c_str(),
- StripTrailingSpaces(GetPrefixUntilComma(test_names)).c_str(),
- GetTypeName<Type>().c_str(),
- nullptr, // No value parameter.
- code_location, GetTypeId<FixtureClass>(),
- SuiteApiResolver<TestClass>::GetSetUpCaseOrSuite(
- code_location.file.c_str(), code_location.line),
- SuiteApiResolver<TestClass>::GetTearDownCaseOrSuite(
- code_location.file.c_str(), code_location.line),
- new TestFactoryImpl<TestClass>);
-
- // Next, recurses (at compile time) with the tail of the type list.
- return TypeParameterizedTest<Fixture, TestSel,
- typename Types::Tail>::Register(prefix,
- code_location,
- case_name,
- test_names,
- index + 1,
- type_names);
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, class TestSel>
-class TypeParameterizedTest<Fixture, TestSel, internal::None> {
- public:
- static bool Register(const char* /*prefix*/, const CodeLocation&,
- const char* /*case_name*/, const char* /*test_names*/,
- int /*index*/,
- const std::vector<std::string>& =
- std::vector<std::string>() /*type_names*/) {
- return true;
- }
-};
-
-GTEST_API_ void RegisterTypeParameterizedTestSuite(const char* test_suite_name,
- CodeLocation code_location);
-GTEST_API_ void RegisterTypeParameterizedTestSuiteInstantiation(
- const char* case_name);
-
-// TypeParameterizedTestSuite<Fixture, Tests, Types>::Register()
-// registers *all combinations* of 'Tests' and 'Types' with Google
-// Test. The return value is insignificant - we just need to return
-// something such that we can call this function in a namespace scope.
-template <GTEST_TEMPLATE_ Fixture, typename Tests, typename Types>
-class TypeParameterizedTestSuite {
- public:
- static bool Register(const char* prefix, CodeLocation code_location,
- const TypedTestSuitePState* state, const char* case_name,
- const char* test_names,
- const std::vector<std::string>& type_names =
- GenerateNames<DefaultNameGenerator, Types>()) {
- RegisterTypeParameterizedTestSuiteInstantiation(case_name);
- std::string test_name = StripTrailingSpaces(
- GetPrefixUntilComma(test_names));
- if (!state->TestExists(test_name)) {
- fprintf(stderr, "Failed to get code location for test %s.%s at %s.",
- case_name, test_name.c_str(),
- FormatFileLocation(code_location.file.c_str(),
- code_location.line).c_str());
- fflush(stderr);
- posix::Abort();
- }
- const CodeLocation& test_location = state->GetCodeLocation(test_name);
-
- typedef typename Tests::Head Head;
-
- // First, register the first test in 'Test' for each type in 'Types'.
- TypeParameterizedTest<Fixture, Head, Types>::Register(
- prefix, test_location, case_name, test_names, 0, type_names);
-
- // Next, recurses (at compile time) with the tail of the test list.
- return TypeParameterizedTestSuite<Fixture, typename Tests::Tail,
- Types>::Register(prefix, code_location,
- state, case_name,
- SkipComma(test_names),
- type_names);
- }
-};
-
-// The base case for the compile time recursion.
-template <GTEST_TEMPLATE_ Fixture, typename Types>
-class TypeParameterizedTestSuite<Fixture, internal::None, Types> {
- public:
- static bool Register(const char* /*prefix*/, const CodeLocation&,
- const TypedTestSuitePState* /*state*/,
- const char* /*case_name*/, const char* /*test_names*/,
- const std::vector<std::string>& =
- std::vector<std::string>() /*type_names*/) {
- return true;
- }
-};
-
-// Returns the current OS stack trace as an std::string.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-GTEST_API_ std::string GetCurrentOsStackTraceExceptTop(
- UnitTest* unit_test, int skip_count);
-
-// Helpers for suppressing warnings on unreachable code or constant
-// condition.
-
-// Always returns true.
-GTEST_API_ bool AlwaysTrue();
-
-// Always returns false.
-inline bool AlwaysFalse() { return !AlwaysTrue(); }
-
-// Helper for suppressing false warning from Clang on a const char*
-// variable declared in a conditional expression always being NULL in
-// the else branch.
-struct GTEST_API_ ConstCharPtr {
- ConstCharPtr(const char* str) : value(str) {}
- operator bool() const { return true; }
- const char* value;
-};
-
-// Helper for declaring std::string within 'if' statement
-// in pre C++17 build environment.
-struct TrueWithString {
- TrueWithString() = default;
- explicit TrueWithString(const char* str) : value(str) {}
- explicit TrueWithString(const std::string& str) : value(str) {}
- explicit operator bool() const { return true; }
- std::string value;
-};
-
-// A simple Linear Congruential Generator for generating random
-// numbers with a uniform distribution. Unlike rand() and srand(), it
-// doesn't use global state (and therefore can't interfere with user
-// code). Unlike rand_r(), it's portable. An LCG isn't very random,
-// but it's good enough for our purposes.
-class GTEST_API_ Random {
- public:
- static const uint32_t kMaxRange = 1u << 31;
-
- explicit Random(uint32_t seed) : state_(seed) {}
-
- void Reseed(uint32_t seed) { state_ = seed; }
-
- // Generates a random number from [0, range). Crashes if 'range' is
- // 0 or greater than kMaxRange.
- uint32_t Generate(uint32_t range);
-
- private:
- uint32_t state_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Random);
-};
-
-// Turns const U&, U&, const U, and U all into U.
-#define GTEST_REMOVE_REFERENCE_AND_CONST_(T) \
- typename std::remove_const<typename std::remove_reference<T>::type>::type
-
-// HasDebugStringAndShortDebugString<T>::value is a compile-time bool constant
-// that's true if and only if T has methods DebugString() and ShortDebugString()
-// that return std::string.
-template <typename T>
-class HasDebugStringAndShortDebugString {
- private:
- template <typename C>
- static auto CheckDebugString(C*) -> typename std::is_same<
- std::string, decltype(std::declval<const C>().DebugString())>::type;
- template <typename>
- static std::false_type CheckDebugString(...);
-
- template <typename C>
- static auto CheckShortDebugString(C*) -> typename std::is_same<
- std::string, decltype(std::declval<const C>().ShortDebugString())>::type;
- template <typename>
- static std::false_type CheckShortDebugString(...);
-
- using HasDebugStringType = decltype(CheckDebugString<T>(nullptr));
- using HasShortDebugStringType = decltype(CheckShortDebugString<T>(nullptr));
-
- public:
- static constexpr bool value =
- HasDebugStringType::value && HasShortDebugStringType::value;
-};
-
-template <typename T>
-constexpr bool HasDebugStringAndShortDebugString<T>::value;
-
-// When the compiler sees expression IsContainerTest<C>(0), if C is an
-// STL-style container class, the first overload of IsContainerTest
-// will be viable (since both C::iterator* and C::const_iterator* are
-// valid types and NULL can be implicitly converted to them). It will
-// be picked over the second overload as 'int' is a perfect match for
-// the type of argument 0. If C::iterator or C::const_iterator is not
-// a valid type, the first overload is not viable, and the second
-// overload will be picked. Therefore, we can determine whether C is
-// a container class by checking the type of IsContainerTest<C>(0).
-// The value of the expression is insignificant.
-//
-// In C++11 mode we check the existence of a const_iterator and that an
-// iterator is properly implemented for the container.
-//
-// For pre-C++11 that we look for both C::iterator and C::const_iterator.
-// The reason is that C++ injects the name of a class as a member of the
-// class itself (e.g. you can refer to class iterator as either
-// 'iterator' or 'iterator::iterator'). If we look for C::iterator
-// only, for example, we would mistakenly think that a class named
-// iterator is an STL container.
-//
-// Also note that the simpler approach of overloading
-// IsContainerTest(typename C::const_iterator*) and
-// IsContainerTest(...) doesn't work with Visual Age C++ and Sun C++.
-typedef int IsContainer;
-template <class C,
- class Iterator = decltype(::std::declval<const C&>().begin()),
- class = decltype(::std::declval<const C&>().end()),
- class = decltype(++::std::declval<Iterator&>()),
- class = decltype(*::std::declval<Iterator>()),
- class = typename C::const_iterator>
-IsContainer IsContainerTest(int /* dummy */) {
- return 0;
-}
-
-typedef char IsNotContainer;
-template <class C>
-IsNotContainer IsContainerTest(long /* dummy */) { return '\0'; }
-
-// Trait to detect whether a type T is a hash table.
-// The heuristic used is that the type contains an inner type `hasher` and does
-// not contain an inner type `reverse_iterator`.
-// If the container is iterable in reverse, then order might actually matter.
-template <typename T>
-struct IsHashTable {
- private:
- template <typename U>
- static char test(typename U::hasher*, typename U::reverse_iterator*);
- template <typename U>
- static int test(typename U::hasher*, ...);
- template <typename U>
- static char test(...);
-
- public:
- static const bool value = sizeof(test<T>(nullptr, nullptr)) == sizeof(int);
-};
-
-template <typename T>
-const bool IsHashTable<T>::value;
-
-template <typename C,
- bool = sizeof(IsContainerTest<C>(0)) == sizeof(IsContainer)>
-struct IsRecursiveContainerImpl;
-
-template <typename C>
-struct IsRecursiveContainerImpl<C, false> : public std::false_type {};
-
-// Since the IsRecursiveContainerImpl depends on the IsContainerTest we need to
-// obey the same inconsistencies as the IsContainerTest, namely check if
-// something is a container is relying on only const_iterator in C++11 and
-// is relying on both const_iterator and iterator otherwise
-template <typename C>
-struct IsRecursiveContainerImpl<C, true> {
- using value_type = decltype(*std::declval<typename C::const_iterator>());
- using type =
- std::is_same<typename std::remove_const<
- typename std::remove_reference<value_type>::type>::type,
- C>;
-};
-
-// IsRecursiveContainer<Type> is a unary compile-time predicate that
-// evaluates whether C is a recursive container type. A recursive container
-// type is a container type whose value_type is equal to the container type
-// itself. An example for a recursive container type is
-// boost::filesystem::path, whose iterator has a value_type that is equal to
-// boost::filesystem::path.
-template <typename C>
-struct IsRecursiveContainer : public IsRecursiveContainerImpl<C>::type {};
-
-// Utilities for native arrays.
-
-// ArrayEq() compares two k-dimensional native arrays using the
-// elements' operator==, where k can be any integer >= 0. When k is
-// 0, ArrayEq() degenerates into comparing a single pair of values.
-
-template <typename T, typename U>
-bool ArrayEq(const T* lhs, size_t size, const U* rhs);
-
-// This generic version is used when k is 0.
-template <typename T, typename U>
-inline bool ArrayEq(const T& lhs, const U& rhs) { return lhs == rhs; }
-
-// This overload is used when k >= 1.
-template <typename T, typename U, size_t N>
-inline bool ArrayEq(const T(&lhs)[N], const U(&rhs)[N]) {
- return internal::ArrayEq(lhs, N, rhs);
-}
-
-// This helper reduces code bloat. If we instead put its logic inside
-// the previous ArrayEq() function, arrays with different sizes would
-// lead to different copies of the template code.
-template <typename T, typename U>
-bool ArrayEq(const T* lhs, size_t size, const U* rhs) {
- for (size_t i = 0; i != size; i++) {
- if (!internal::ArrayEq(lhs[i], rhs[i]))
- return false;
- }
- return true;
-}
-
-// Finds the first element in the iterator range [begin, end) that
-// equals elem. Element may be a native array type itself.
-template <typename Iter, typename Element>
-Iter ArrayAwareFind(Iter begin, Iter end, const Element& elem) {
- for (Iter it = begin; it != end; ++it) {
- if (internal::ArrayEq(*it, elem))
- return it;
- }
- return end;
-}
-
-// CopyArray() copies a k-dimensional native array using the elements'
-// operator=, where k can be any integer >= 0. When k is 0,
-// CopyArray() degenerates into copying a single value.
-
-template <typename T, typename U>
-void CopyArray(const T* from, size_t size, U* to);
-
-// This generic version is used when k is 0.
-template <typename T, typename U>
-inline void CopyArray(const T& from, U* to) { *to = from; }
-
-// This overload is used when k >= 1.
-template <typename T, typename U, size_t N>
-inline void CopyArray(const T(&from)[N], U(*to)[N]) {
- internal::CopyArray(from, N, *to);
-}
-
-// This helper reduces code bloat. If we instead put its logic inside
-// the previous CopyArray() function, arrays with different sizes
-// would lead to different copies of the template code.
-template <typename T, typename U>
-void CopyArray(const T* from, size_t size, U* to) {
- for (size_t i = 0; i != size; i++) {
- internal::CopyArray(from[i], to + i);
- }
-}
-
-// The relation between an NativeArray object (see below) and the
-// native array it represents.
-// We use 2 different structs to allow non-copyable types to be used, as long
-// as RelationToSourceReference() is passed.
-struct RelationToSourceReference {};
-struct RelationToSourceCopy {};
-
-// Adapts a native array to a read-only STL-style container. Instead
-// of the complete STL container concept, this adaptor only implements
-// members useful for Google Mock's container matchers. New members
-// should be added as needed. To simplify the implementation, we only
-// support Element being a raw type (i.e. having no top-level const or
-// reference modifier). It's the client's responsibility to satisfy
-// this requirement. Element can be an array type itself (hence
-// multi-dimensional arrays are supported).
-template <typename Element>
-class NativeArray {
- public:
- // STL-style container typedefs.
- typedef Element value_type;
- typedef Element* iterator;
- typedef const Element* const_iterator;
-
- // Constructs from a native array. References the source.
- NativeArray(const Element* array, size_t count, RelationToSourceReference) {
- InitRef(array, count);
- }
-
- // Constructs from a native array. Copies the source.
- NativeArray(const Element* array, size_t count, RelationToSourceCopy) {
- InitCopy(array, count);
- }
-
- // Copy constructor.
- NativeArray(const NativeArray& rhs) {
- (this->*rhs.clone_)(rhs.array_, rhs.size_);
- }
-
- ~NativeArray() {
- if (clone_ != &NativeArray::InitRef)
- delete[] array_;
- }
-
- // STL-style container methods.
- size_t size() const { return size_; }
- const_iterator begin() const { return array_; }
- const_iterator end() const { return array_ + size_; }
- bool operator==(const NativeArray& rhs) const {
- return size() == rhs.size() &&
- ArrayEq(begin(), size(), rhs.begin());
- }
-
- private:
- static_assert(!std::is_const<Element>::value, "Type must not be const");
- static_assert(!std::is_reference<Element>::value,
- "Type must not be a reference");
-
- // Initializes this object with a copy of the input.
- void InitCopy(const Element* array, size_t a_size) {
- Element* const copy = new Element[a_size];
- CopyArray(array, a_size, copy);
- array_ = copy;
- size_ = a_size;
- clone_ = &NativeArray::InitCopy;
- }
-
- // Initializes this object with a reference of the input.
- void InitRef(const Element* array, size_t a_size) {
- array_ = array;
- size_ = a_size;
- clone_ = &NativeArray::InitRef;
- }
-
- const Element* array_;
- size_t size_;
- void (NativeArray::*clone_)(const Element*, size_t);
-};
-
-// Backport of std::index_sequence.
-template <size_t... Is>
-struct IndexSequence {
- using type = IndexSequence;
-};
-
-// Double the IndexSequence, and one if plus_one is true.
-template <bool plus_one, typename T, size_t sizeofT>
-struct DoubleSequence;
-template <size_t... I, size_t sizeofT>
-struct DoubleSequence<true, IndexSequence<I...>, sizeofT> {
- using type = IndexSequence<I..., (sizeofT + I)..., 2 * sizeofT>;
-};
-template <size_t... I, size_t sizeofT>
-struct DoubleSequence<false, IndexSequence<I...>, sizeofT> {
- using type = IndexSequence<I..., (sizeofT + I)...>;
-};
-
-// Backport of std::make_index_sequence.
-// It uses O(ln(N)) instantiation depth.
-template <size_t N>
-struct MakeIndexSequenceImpl
- : DoubleSequence<N % 2 == 1, typename MakeIndexSequenceImpl<N / 2>::type,
- N / 2>::type {};
-
-template <>
-struct MakeIndexSequenceImpl<0> : IndexSequence<> {};
-
-template <size_t N>
-using MakeIndexSequence = typename MakeIndexSequenceImpl<N>::type;
-
-template <typename... T>
-using IndexSequenceFor = typename MakeIndexSequence<sizeof...(T)>::type;
-
-template <size_t>
-struct Ignore {
- Ignore(...); // NOLINT
-};
-
-template <typename>
-struct ElemFromListImpl;
-template <size_t... I>
-struct ElemFromListImpl<IndexSequence<I...>> {
- // We make Ignore a template to solve a problem with MSVC.
- // A non-template Ignore would work fine with `decltype(Ignore(I))...`, but
- // MSVC doesn't understand how to deal with that pack expansion.
- // Use `0 * I` to have a single instantiation of Ignore.
- template <typename R>
- static R Apply(Ignore<0 * I>..., R (*)(), ...);
-};
-
-template <size_t N, typename... T>
-struct ElemFromList {
- using type =
- decltype(ElemFromListImpl<typename MakeIndexSequence<N>::type>::Apply(
- static_cast<T (*)()>(nullptr)...));
-};
-
-struct FlatTupleConstructTag {};
-
-template <typename... T>
-class FlatTuple;
-
-template <typename Derived, size_t I>
-struct FlatTupleElemBase;
-
-template <typename... T, size_t I>
-struct FlatTupleElemBase<FlatTuple<T...>, I> {
- using value_type = typename ElemFromList<I, T...>::type;
- FlatTupleElemBase() = default;
- template <typename Arg>
- explicit FlatTupleElemBase(FlatTupleConstructTag, Arg&& t)
- : value(std::forward<Arg>(t)) {}
- value_type value;
-};
-
-template <typename Derived, typename Idx>
-struct FlatTupleBase;
-
-template <size_t... Idx, typename... T>
-struct FlatTupleBase<FlatTuple<T...>, IndexSequence<Idx...>>
- : FlatTupleElemBase<FlatTuple<T...>, Idx>... {
- using Indices = IndexSequence<Idx...>;
- FlatTupleBase() = default;
- template <typename... Args>
- explicit FlatTupleBase(FlatTupleConstructTag, Args&&... args)
- : FlatTupleElemBase<FlatTuple<T...>, Idx>(FlatTupleConstructTag{},
- std::forward<Args>(args))... {}
-
- template <size_t I>
- const typename ElemFromList<I, T...>::type& Get() const {
- return FlatTupleElemBase<FlatTuple<T...>, I>::value;
- }
-
- template <size_t I>
- typename ElemFromList<I, T...>::type& Get() {
- return FlatTupleElemBase<FlatTuple<T...>, I>::value;
- }
-
- template <typename F>
- auto Apply(F&& f) -> decltype(std::forward<F>(f)(this->Get<Idx>()...)) {
- return std::forward<F>(f)(Get<Idx>()...);
- }
-
- template <typename F>
- auto Apply(F&& f) const -> decltype(std::forward<F>(f)(this->Get<Idx>()...)) {
- return std::forward<F>(f)(Get<Idx>()...);
- }
-};
-
-// Analog to std::tuple but with different tradeoffs.
-// This class minimizes the template instantiation depth, thus allowing more
-// elements than std::tuple would. std::tuple has been seen to require an
-// instantiation depth of more than 10x the number of elements in some
-// implementations.
-// FlatTuple and ElemFromList are not recursive and have a fixed depth
-// regardless of T...
-// MakeIndexSequence, on the other hand, it is recursive but with an
-// instantiation depth of O(ln(N)).
-template <typename... T>
-class FlatTuple
- : private FlatTupleBase<FlatTuple<T...>,
- typename MakeIndexSequence<sizeof...(T)>::type> {
- using Indices = typename FlatTupleBase<
- FlatTuple<T...>, typename MakeIndexSequence<sizeof...(T)>::type>::Indices;
-
- public:
- FlatTuple() = default;
- template <typename... Args>
- explicit FlatTuple(FlatTupleConstructTag tag, Args&&... args)
- : FlatTuple::FlatTupleBase(tag, std::forward<Args>(args)...) {}
-
- using FlatTuple::FlatTupleBase::Apply;
- using FlatTuple::FlatTupleBase::Get;
-};
-
-// Utility functions to be called with static_assert to induce deprecation
-// warnings.
-GTEST_INTERNAL_DEPRECATED(
- "INSTANTIATE_TEST_CASE_P is deprecated, please use "
- "INSTANTIATE_TEST_SUITE_P")
-constexpr bool InstantiateTestCase_P_IsDeprecated() { return true; }
-
-GTEST_INTERNAL_DEPRECATED(
- "TYPED_TEST_CASE_P is deprecated, please use "
- "TYPED_TEST_SUITE_P")
-constexpr bool TypedTestCase_P_IsDeprecated() { return true; }
-
-GTEST_INTERNAL_DEPRECATED(
- "TYPED_TEST_CASE is deprecated, please use "
- "TYPED_TEST_SUITE")
-constexpr bool TypedTestCaseIsDeprecated() { return true; }
-
-GTEST_INTERNAL_DEPRECATED(
- "REGISTER_TYPED_TEST_CASE_P is deprecated, please use "
- "REGISTER_TYPED_TEST_SUITE_P")
-constexpr bool RegisterTypedTestCase_P_IsDeprecated() { return true; }
-
-GTEST_INTERNAL_DEPRECATED(
- "INSTANTIATE_TYPED_TEST_CASE_P is deprecated, please use "
- "INSTANTIATE_TYPED_TEST_SUITE_P")
-constexpr bool InstantiateTypedTestCase_P_IsDeprecated() { return true; }
-
-} // namespace internal
-} // namespace testing
-
-namespace std {
-// Some standard library implementations use `struct tuple_size` and some use
-// `class tuple_size`. Clang warns about the mismatch.
-// https://reviews.llvm.org/D55466
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wmismatched-tags"
-#endif
-template <typename... Ts>
-struct tuple_size<testing::internal::FlatTuple<Ts...>>
- : std::integral_constant<size_t, sizeof...(Ts)> {};
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-} // namespace std
-
-#define GTEST_MESSAGE_AT_(file, line, message, result_type) \
- ::testing::internal::AssertHelper(result_type, file, line, message) \
- = ::testing::Message()
-
-#define GTEST_MESSAGE_(message, result_type) \
- GTEST_MESSAGE_AT_(__FILE__, __LINE__, message, result_type)
-
-#define GTEST_FATAL_FAILURE_(message) \
- return GTEST_MESSAGE_(message, ::testing::TestPartResult::kFatalFailure)
-
-#define GTEST_NONFATAL_FAILURE_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kNonFatalFailure)
-
-#define GTEST_SUCCESS_(message) \
- GTEST_MESSAGE_(message, ::testing::TestPartResult::kSuccess)
-
-#define GTEST_SKIP_(message) \
- return GTEST_MESSAGE_(message, ::testing::TestPartResult::kSkip)
-
-// Suppress MSVC warning 4072 (unreachable code) for the code following
-// statement if it returns or throws (or doesn't return or throw in some
-// situations).
-// NOTE: The "else" is important to keep this expansion to prevent a top-level
-// "else" from attaching to our "if".
-#define GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement) \
- if (::testing::internal::AlwaysTrue()) { \
- statement; \
- } else /* NOLINT */ \
- static_assert(true, "") // User must have a semicolon after expansion.
-
-#if GTEST_HAS_EXCEPTIONS
-
-namespace testing {
-namespace internal {
-
-class NeverThrown {
- public:
- const char* what() const noexcept {
- return "this exception should never be thrown";
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-#if GTEST_HAS_RTTI
-
-#define GTEST_EXCEPTION_TYPE_(e) ::testing::internal::GetTypeName(typeid(e))
-
-#else // GTEST_HAS_RTTI
-
-#define GTEST_EXCEPTION_TYPE_(e) \
- std::string { "an std::exception-derived error" }
-
-#endif // GTEST_HAS_RTTI
-
-#define GTEST_TEST_THROW_CATCH_STD_EXCEPTION_(statement, expected_exception) \
- catch (typename std::conditional< \
- std::is_same<typename std::remove_cv<typename std::remove_reference< \
- expected_exception>::type>::type, \
- std::exception>::value, \
- const ::testing::internal::NeverThrown&, const std::exception&>::type \
- e) { \
- gtest_msg.value = "Expected: " #statement \
- " throws an exception of type " #expected_exception \
- ".\n Actual: it throws "; \
- gtest_msg.value += GTEST_EXCEPTION_TYPE_(e); \
- gtest_msg.value += " with description \""; \
- gtest_msg.value += e.what(); \
- gtest_msg.value += "\"."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- }
-
-#else // GTEST_HAS_EXCEPTIONS
-
-#define GTEST_TEST_THROW_CATCH_STD_EXCEPTION_(statement, expected_exception)
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-#define GTEST_TEST_THROW_(statement, expected_exception, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::TrueWithString gtest_msg{}) { \
- bool gtest_caught_expected = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } catch (expected_exception const&) { \
- gtest_caught_expected = true; \
- } \
- GTEST_TEST_THROW_CATCH_STD_EXCEPTION_(statement, expected_exception) \
- catch (...) { \
- gtest_msg.value = "Expected: " #statement \
- " throws an exception of type " #expected_exception \
- ".\n Actual: it throws a different type."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- if (!gtest_caught_expected) { \
- gtest_msg.value = "Expected: " #statement \
- " throws an exception of type " #expected_exception \
- ".\n Actual: it throws nothing."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__); \
- } \
- } else /*NOLINT*/ \
- GTEST_CONCAT_TOKEN_(gtest_label_testthrow_, __LINE__) \
- : fail(gtest_msg.value.c_str())
-
-#if GTEST_HAS_EXCEPTIONS
-
-#define GTEST_TEST_NO_THROW_CATCH_STD_EXCEPTION_() \
- catch (std::exception const& e) { \
- gtest_msg.value = "it throws "; \
- gtest_msg.value += GTEST_EXCEPTION_TYPE_(e); \
- gtest_msg.value += " with description \""; \
- gtest_msg.value += e.what(); \
- gtest_msg.value += "\"."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
- }
-
-#else // GTEST_HAS_EXCEPTIONS
-
-#define GTEST_TEST_NO_THROW_CATCH_STD_EXCEPTION_()
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-#define GTEST_TEST_NO_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::TrueWithString gtest_msg{}) { \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- GTEST_TEST_NO_THROW_CATCH_STD_EXCEPTION_() \
- catch (...) { \
- gtest_msg.value = "it throws."; \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnothrow_, __LINE__): \
- fail(("Expected: " #statement " doesn't throw an exception.\n" \
- " Actual: " + gtest_msg.value).c_str())
-
-#define GTEST_TEST_ANY_THROW_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- bool gtest_caught_any = false; \
- try { \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- } \
- catch (...) { \
- gtest_caught_any = true; \
- } \
- if (!gtest_caught_any) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testanythrow_, __LINE__): \
- fail("Expected: " #statement " throws an exception.\n" \
- " Actual: it doesn't.")
-
-
-// Implements Boolean test assertions such as EXPECT_TRUE. expression can be
-// either a boolean expression or an AssertionResult. text is a textual
-// representation of expression as it was passed into the EXPECT_TRUE.
-#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (const ::testing::AssertionResult gtest_ar_ = \
- ::testing::AssertionResult(expression)) \
- ; \
- else \
- fail(::testing::internal::GetBoolAssertionFailureMessage(\
- gtest_ar_, text, #actual, #expected).c_str())
-
-#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::AlwaysTrue()) { \
- ::testing::internal::HasNewFatalFailureHelper gtest_fatal_failure_checker; \
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \
- if (gtest_fatal_failure_checker.has_new_fatal_failure()) { \
- goto GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__); \
- } \
- } else \
- GTEST_CONCAT_TOKEN_(gtest_label_testnofatal_, __LINE__): \
- fail("Expected: " #statement " doesn't generate new fatal " \
- "failures in the current thread.\n" \
- " Actual: it does.")
-
-// Expands to the name of the class that implements the given test.
-#define GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
- test_suite_name##_##test_name##_Test
-
-// Helper macro for defining tests.
-#define GTEST_TEST_(test_suite_name, test_name, parent_class, parent_id) \
- static_assert(sizeof(GTEST_STRINGIFY_(test_suite_name)) > 1, \
- "test_suite_name must not be empty"); \
- static_assert(sizeof(GTEST_STRINGIFY_(test_name)) > 1, \
- "test_name must not be empty"); \
- class GTEST_TEST_CLASS_NAME_(test_suite_name, test_name) \
- : public parent_class { \
- public: \
- GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() = default; \
- ~GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)() override = default; \
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
- test_name)); \
- GTEST_DISALLOW_MOVE_AND_ASSIGN_(GTEST_TEST_CLASS_NAME_(test_suite_name, \
- test_name)); \
- \
- private: \
- void TestBody() override; \
- static ::testing::TestInfo* const test_info_ GTEST_ATTRIBUTE_UNUSED_; \
- }; \
- \
- ::testing::TestInfo* const GTEST_TEST_CLASS_NAME_(test_suite_name, \
- test_name)::test_info_ = \
- ::testing::internal::MakeAndRegisterTestInfo( \
- #test_suite_name, #test_name, nullptr, nullptr, \
- ::testing::internal::CodeLocation(__FILE__, __LINE__), (parent_id), \
- ::testing::internal::SuiteApiResolver< \
- parent_class>::GetSetUpCaseOrSuite(__FILE__, __LINE__), \
- ::testing::internal::SuiteApiResolver< \
- parent_class>::GetTearDownCaseOrSuite(__FILE__, __LINE__), \
- new ::testing::internal::TestFactoryImpl<GTEST_TEST_CLASS_NAME_( \
- test_suite_name, test_name)>); \
- void GTEST_TEST_CLASS_NAME_(test_suite_name, test_name)::TestBody()
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_INTERNAL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-param-util.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-param-util.h
deleted file mode 100644
index ff25d9950a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-param-util.h
+++ /dev/null
@@ -1,948 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Type and function utilities for implementing parameterized tests.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
-
-#include <ctype.h>
-
-#include <cassert>
-#include <iterator>
-#include <memory>
-#include <set>
-#include <tuple>
-#include <type_traits>
-#include <utility>
-#include <vector>
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-#include "gtest/gtest-printers.h"
-#include "gtest/gtest-test-part.h"
-
-namespace testing {
-// Input to a parameterized test name generator, describing a test parameter.
-// Consists of the parameter value and the integer parameter index.
-template <class ParamType>
-struct TestParamInfo {
- TestParamInfo(const ParamType& a_param, size_t an_index) :
- param(a_param),
- index(an_index) {}
- ParamType param;
- size_t index;
-};
-
-// A builtin parameterized test name generator which returns the result of
-// testing::PrintToString.
-struct PrintToStringParamName {
- template <class ParamType>
- std::string operator()(const TestParamInfo<ParamType>& info) const {
- return PrintToString(info.param);
- }
-};
-
-namespace internal {
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-// Utility Functions
-
-// Outputs a message explaining invalid registration of different
-// fixture class for the same test suite. This may happen when
-// TEST_P macro is used to define two tests with the same name
-// but in different namespaces.
-GTEST_API_ void ReportInvalidTestSuiteType(const char* test_suite_name,
- CodeLocation code_location);
-
-template <typename> class ParamGeneratorInterface;
-template <typename> class ParamGenerator;
-
-// Interface for iterating over elements provided by an implementation
-// of ParamGeneratorInterface<T>.
-template <typename T>
-class ParamIteratorInterface {
- public:
- virtual ~ParamIteratorInterface() {}
- // A pointer to the base generator instance.
- // Used only for the purposes of iterator comparison
- // to make sure that two iterators belong to the same generator.
- virtual const ParamGeneratorInterface<T>* BaseGenerator() const = 0;
- // Advances iterator to point to the next element
- // provided by the generator. The caller is responsible
- // for not calling Advance() on an iterator equal to
- // BaseGenerator()->End().
- virtual void Advance() = 0;
- // Clones the iterator object. Used for implementing copy semantics
- // of ParamIterator<T>.
- virtual ParamIteratorInterface* Clone() const = 0;
- // Dereferences the current iterator and provides (read-only) access
- // to the pointed value. It is the caller's responsibility not to call
- // Current() on an iterator equal to BaseGenerator()->End().
- // Used for implementing ParamGenerator<T>::operator*().
- virtual const T* Current() const = 0;
- // Determines whether the given iterator and other point to the same
- // element in the sequence generated by the generator.
- // Used for implementing ParamGenerator<T>::operator==().
- virtual bool Equals(const ParamIteratorInterface& other) const = 0;
-};
-
-// Class iterating over elements provided by an implementation of
-// ParamGeneratorInterface<T>. It wraps ParamIteratorInterface<T>
-// and implements the const forward iterator concept.
-template <typename T>
-class ParamIterator {
- public:
- typedef T value_type;
- typedef const T& reference;
- typedef ptrdiff_t difference_type;
-
- // ParamIterator assumes ownership of the impl_ pointer.
- ParamIterator(const ParamIterator& other) : impl_(other.impl_->Clone()) {}
- ParamIterator& operator=(const ParamIterator& other) {
- if (this != &other)
- impl_.reset(other.impl_->Clone());
- return *this;
- }
-
- const T& operator*() const { return *impl_->Current(); }
- const T* operator->() const { return impl_->Current(); }
- // Prefix version of operator++.
- ParamIterator& operator++() {
- impl_->Advance();
- return *this;
- }
- // Postfix version of operator++.
- ParamIterator operator++(int /*unused*/) {
- ParamIteratorInterface<T>* clone = impl_->Clone();
- impl_->Advance();
- return ParamIterator(clone);
- }
- bool operator==(const ParamIterator& other) const {
- return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
- }
- bool operator!=(const ParamIterator& other) const {
- return !(*this == other);
- }
-
- private:
- friend class ParamGenerator<T>;
- explicit ParamIterator(ParamIteratorInterface<T>* impl) : impl_(impl) {}
- std::unique_ptr<ParamIteratorInterface<T> > impl_;
-};
-
-// ParamGeneratorInterface<T> is the binary interface to access generators
-// defined in other translation units.
-template <typename T>
-class ParamGeneratorInterface {
- public:
- typedef T ParamType;
-
- virtual ~ParamGeneratorInterface() {}
-
- // Generator interface definition
- virtual ParamIteratorInterface<T>* Begin() const = 0;
- virtual ParamIteratorInterface<T>* End() const = 0;
-};
-
-// Wraps ParamGeneratorInterface<T> and provides general generator syntax
-// compatible with the STL Container concept.
-// This class implements copy initialization semantics and the contained
-// ParamGeneratorInterface<T> instance is shared among all copies
-// of the original object. This is possible because that instance is immutable.
-template<typename T>
-class ParamGenerator {
- public:
- typedef ParamIterator<T> iterator;
-
- explicit ParamGenerator(ParamGeneratorInterface<T>* impl) : impl_(impl) {}
- ParamGenerator(const ParamGenerator& other) : impl_(other.impl_) {}
-
- ParamGenerator& operator=(const ParamGenerator& other) {
- impl_ = other.impl_;
- return *this;
- }
-
- iterator begin() const { return iterator(impl_->Begin()); }
- iterator end() const { return iterator(impl_->End()); }
-
- private:
- std::shared_ptr<const ParamGeneratorInterface<T> > impl_;
-};
-
-// Generates values from a range of two comparable values. Can be used to
-// generate sequences of user-defined types that implement operator+() and
-// operator<().
-// This class is used in the Range() function.
-template <typename T, typename IncrementT>
-class RangeGenerator : public ParamGeneratorInterface<T> {
- public:
- RangeGenerator(T begin, T end, IncrementT step)
- : begin_(begin), end_(end),
- step_(step), end_index_(CalculateEndIndex(begin, end, step)) {}
- ~RangeGenerator() override {}
-
- ParamIteratorInterface<T>* Begin() const override {
- return new Iterator(this, begin_, 0, step_);
- }
- ParamIteratorInterface<T>* End() const override {
- return new Iterator(this, end_, end_index_, step_);
- }
-
- private:
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base, T value, int index,
- IncrementT step)
- : base_(base), value_(value), index_(index), step_(step) {}
- ~Iterator() override {}
-
- const ParamGeneratorInterface<T>* BaseGenerator() const override {
- return base_;
- }
- void Advance() override {
- value_ = static_cast<T>(value_ + step_);
- index_++;
- }
- ParamIteratorInterface<T>* Clone() const override {
- return new Iterator(*this);
- }
- const T* Current() const override { return &value_; }
- bool Equals(const ParamIteratorInterface<T>& other) const override {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const int other_index =
- CheckedDowncastToActualType<const Iterator>(&other)->index_;
- return index_ == other_index;
- }
-
- private:
- Iterator(const Iterator& other)
- : ParamIteratorInterface<T>(),
- base_(other.base_), value_(other.value_), index_(other.index_),
- step_(other.step_) {}
-
- // No implementation - assignment is unsupported.
- void operator=(const Iterator& other);
-
- const ParamGeneratorInterface<T>* const base_;
- T value_;
- int index_;
- const IncrementT step_;
- }; // class RangeGenerator::Iterator
-
- static int CalculateEndIndex(const T& begin,
- const T& end,
- const IncrementT& step) {
- int end_index = 0;
- for (T i = begin; i < end; i = static_cast<T>(i + step))
- end_index++;
- return end_index;
- }
-
- // No implementation - assignment is unsupported.
- void operator=(const RangeGenerator& other);
-
- const T begin_;
- const T end_;
- const IncrementT step_;
- // The index for the end() iterator. All the elements in the generated
- // sequence are indexed (0-based) to aid iterator comparison.
- const int end_index_;
-}; // class RangeGenerator
-
-
-// Generates values from a pair of STL-style iterators. Used in the
-// ValuesIn() function. The elements are copied from the source range
-// since the source can be located on the stack, and the generator
-// is likely to persist beyond that stack frame.
-template <typename T>
-class ValuesInIteratorRangeGenerator : public ParamGeneratorInterface<T> {
- public:
- template <typename ForwardIterator>
- ValuesInIteratorRangeGenerator(ForwardIterator begin, ForwardIterator end)
- : container_(begin, end) {}
- ~ValuesInIteratorRangeGenerator() override {}
-
- ParamIteratorInterface<T>* Begin() const override {
- return new Iterator(this, container_.begin());
- }
- ParamIteratorInterface<T>* End() const override {
- return new Iterator(this, container_.end());
- }
-
- private:
- typedef typename ::std::vector<T> ContainerType;
-
- class Iterator : public ParamIteratorInterface<T> {
- public:
- Iterator(const ParamGeneratorInterface<T>* base,
- typename ContainerType::const_iterator iterator)
- : base_(base), iterator_(iterator) {}
- ~Iterator() override {}
-
- const ParamGeneratorInterface<T>* BaseGenerator() const override {
- return base_;
- }
- void Advance() override {
- ++iterator_;
- value_.reset();
- }
- ParamIteratorInterface<T>* Clone() const override {
- return new Iterator(*this);
- }
- // We need to use cached value referenced by iterator_ because *iterator_
- // can return a temporary object (and of type other then T), so just
- // having "return &*iterator_;" doesn't work.
- // value_ is updated here and not in Advance() because Advance()
- // can advance iterator_ beyond the end of the range, and we cannot
- // detect that fact. The client code, on the other hand, is
- // responsible for not calling Current() on an out-of-range iterator.
- const T* Current() const override {
- if (value_.get() == nullptr) value_.reset(new T(*iterator_));
- return value_.get();
- }
- bool Equals(const ParamIteratorInterface<T>& other) const override {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- return iterator_ ==
- CheckedDowncastToActualType<const Iterator>(&other)->iterator_;
- }
-
- private:
- Iterator(const Iterator& other)
- // The explicit constructor call suppresses a false warning
- // emitted by gcc when supplied with the -Wextra option.
- : ParamIteratorInterface<T>(),
- base_(other.base_),
- iterator_(other.iterator_) {}
-
- const ParamGeneratorInterface<T>* const base_;
- typename ContainerType::const_iterator iterator_;
- // A cached value of *iterator_. We keep it here to allow access by
- // pointer in the wrapping iterator's operator->().
- // value_ needs to be mutable to be accessed in Current().
- // Use of std::unique_ptr helps manage cached value's lifetime,
- // which is bound by the lifespan of the iterator itself.
- mutable std::unique_ptr<const T> value_;
- }; // class ValuesInIteratorRangeGenerator::Iterator
-
- // No implementation - assignment is unsupported.
- void operator=(const ValuesInIteratorRangeGenerator& other);
-
- const ContainerType container_;
-}; // class ValuesInIteratorRangeGenerator
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Default parameterized test name generator, returns a string containing the
-// integer test parameter index.
-template <class ParamType>
-std::string DefaultParamName(const TestParamInfo<ParamType>& info) {
- Message name_stream;
- name_stream << info.index;
- return name_stream.GetString();
-}
-
-template <typename T = int>
-void TestNotEmpty() {
- static_assert(sizeof(T) == 0, "Empty arguments are not allowed.");
-}
-template <typename T = int>
-void TestNotEmpty(const T&) {}
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Stores a parameter value and later creates tests parameterized with that
-// value.
-template <class TestClass>
-class ParameterizedTestFactory : public TestFactoryBase {
- public:
- typedef typename TestClass::ParamType ParamType;
- explicit ParameterizedTestFactory(ParamType parameter) :
- parameter_(parameter) {}
- Test* CreateTest() override {
- TestClass::SetParam(&parameter_);
- return new TestClass();
- }
-
- private:
- const ParamType parameter_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactoryBase is a base class for meta-factories that create
-// test factories for passing into MakeAndRegisterTestInfo function.
-template <class ParamType>
-class TestMetaFactoryBase {
- public:
- virtual ~TestMetaFactoryBase() {}
-
- virtual TestFactoryBase* CreateTestFactory(ParamType parameter) = 0;
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// TestMetaFactory creates test factories for passing into
-// MakeAndRegisterTestInfo function. Since MakeAndRegisterTestInfo receives
-// ownership of test factory pointer, same factory object cannot be passed
-// into that method twice. But ParameterizedTestSuiteInfo is going to call
-// it for each Test/Parameter value combination. Thus it needs meta factory
-// creator class.
-template <class TestSuite>
-class TestMetaFactory
- : public TestMetaFactoryBase<typename TestSuite::ParamType> {
- public:
- using ParamType = typename TestSuite::ParamType;
-
- TestMetaFactory() {}
-
- TestFactoryBase* CreateTestFactory(ParamType parameter) override {
- return new ParameterizedTestFactory<TestSuite>(parameter);
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestMetaFactory);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestSuiteInfoBase is a generic interface
-// to ParameterizedTestSuiteInfo classes. ParameterizedTestSuiteInfoBase
-// accumulates test information provided by TEST_P macro invocations
-// and generators provided by INSTANTIATE_TEST_SUITE_P macro invocations
-// and uses that information to register all resulting test instances
-// in RegisterTests method. The ParameterizeTestSuiteRegistry class holds
-// a collection of pointers to the ParameterizedTestSuiteInfo objects
-// and calls RegisterTests() on each of them when asked.
-class ParameterizedTestSuiteInfoBase {
- public:
- virtual ~ParameterizedTestSuiteInfoBase() {}
-
- // Base part of test suite name for display purposes.
- virtual const std::string& GetTestSuiteName() const = 0;
- // Test suite id to verify identity.
- virtual TypeId GetTestSuiteTypeId() const = 0;
- // UnitTest class invokes this method to register tests in this
- // test suite right before running them in RUN_ALL_TESTS macro.
- // This method should not be called more than once on any single
- // instance of a ParameterizedTestSuiteInfoBase derived class.
- virtual void RegisterTests() = 0;
-
- protected:
- ParameterizedTestSuiteInfoBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfoBase);
-};
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Report a the name of a test_suit as safe to ignore
-// as the side effect of construction of this type.
-struct GTEST_API_ MarkAsIgnored {
- explicit MarkAsIgnored(const char* test_suite);
-};
-
-GTEST_API_ void InsertSyntheticTestCase(const std::string& name,
- CodeLocation location, bool has_test_p);
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestSuiteInfo accumulates tests obtained from TEST_P
-// macro invocations for a particular test suite and generators
-// obtained from INSTANTIATE_TEST_SUITE_P macro invocations for that
-// test suite. It registers tests with all values generated by all
-// generators when asked.
-template <class TestSuite>
-class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
- public:
- // ParamType and GeneratorCreationFunc are private types but are required
- // for declarations of public methods AddTestPattern() and
- // AddTestSuiteInstantiation().
- using ParamType = typename TestSuite::ParamType;
- // A function that returns an instance of appropriate generator type.
- typedef ParamGenerator<ParamType>(GeneratorCreationFunc)();
- using ParamNameGeneratorFunc = std::string(const TestParamInfo<ParamType>&);
-
- explicit ParameterizedTestSuiteInfo(const char* name,
- CodeLocation code_location)
- : test_suite_name_(name), code_location_(code_location) {}
-
- // Test suite base name for display purposes.
- const std::string& GetTestSuiteName() const override {
- return test_suite_name_;
- }
- // Test suite id to verify identity.
- TypeId GetTestSuiteTypeId() const override { return GetTypeId<TestSuite>(); }
- // TEST_P macro uses AddTestPattern() to record information
- // about a single test in a LocalTestInfo structure.
- // test_suite_name is the base name of the test suite (without invocation
- // prefix). test_base_name is the name of an individual test without
- // parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
- // test suite base name and DoBar is test base name.
- void AddTestPattern(const char* test_suite_name, const char* test_base_name,
- TestMetaFactoryBase<ParamType>* meta_factory,
- CodeLocation code_location) {
- tests_.push_back(std::shared_ptr<TestInfo>(new TestInfo(
- test_suite_name, test_base_name, meta_factory, code_location)));
- }
- // INSTANTIATE_TEST_SUITE_P macro uses AddGenerator() to record information
- // about a generator.
- int AddTestSuiteInstantiation(const std::string& instantiation_name,
- GeneratorCreationFunc* func,
- ParamNameGeneratorFunc* name_func,
- const char* file, int line) {
- instantiations_.push_back(
- InstantiationInfo(instantiation_name, func, name_func, file, line));
- return 0; // Return value used only to run this method in namespace scope.
- }
- // UnitTest class invokes this method to register tests in this test suite
- // right before running tests in RUN_ALL_TESTS macro.
- // This method should not be called more than once on any single
- // instance of a ParameterizedTestSuiteInfoBase derived class.
- // UnitTest has a guard to prevent from calling this method more than once.
- void RegisterTests() override {
- bool generated_instantiations = false;
-
- for (typename TestInfoContainer::iterator test_it = tests_.begin();
- test_it != tests_.end(); ++test_it) {
- std::shared_ptr<TestInfo> test_info = *test_it;
- for (typename InstantiationContainer::iterator gen_it =
- instantiations_.begin(); gen_it != instantiations_.end();
- ++gen_it) {
- const std::string& instantiation_name = gen_it->name;
- ParamGenerator<ParamType> generator((*gen_it->generator)());
- ParamNameGeneratorFunc* name_func = gen_it->name_func;
- const char* file = gen_it->file;
- int line = gen_it->line;
-
- std::string test_suite_name;
- if ( !instantiation_name.empty() )
- test_suite_name = instantiation_name + "/";
- test_suite_name += test_info->test_suite_base_name;
-
- size_t i = 0;
- std::set<std::string> test_param_names;
- for (typename ParamGenerator<ParamType>::iterator param_it =
- generator.begin();
- param_it != generator.end(); ++param_it, ++i) {
- generated_instantiations = true;
-
- Message test_name_stream;
-
- std::string param_name = name_func(
- TestParamInfo<ParamType>(*param_it, i));
-
- GTEST_CHECK_(IsValidParamName(param_name))
- << "Parameterized test name '" << param_name
- << "' is invalid, in " << file
- << " line " << line << std::endl;
-
- GTEST_CHECK_(test_param_names.count(param_name) == 0)
- << "Duplicate parameterized test name '" << param_name
- << "', in " << file << " line " << line << std::endl;
-
- test_param_names.insert(param_name);
-
- if (!test_info->test_base_name.empty()) {
- test_name_stream << test_info->test_base_name << "/";
- }
- test_name_stream << param_name;
- MakeAndRegisterTestInfo(
- test_suite_name.c_str(), test_name_stream.GetString().c_str(),
- nullptr, // No type parameter.
- PrintToString(*param_it).c_str(), test_info->code_location,
- GetTestSuiteTypeId(),
- SuiteApiResolver<TestSuite>::GetSetUpCaseOrSuite(file, line),
- SuiteApiResolver<TestSuite>::GetTearDownCaseOrSuite(file, line),
- test_info->test_meta_factory->CreateTestFactory(*param_it));
- } // for param_it
- } // for gen_it
- } // for test_it
-
- if (!generated_instantiations) {
- // There are no generaotrs, or they all generate nothing ...
- InsertSyntheticTestCase(GetTestSuiteName(), code_location_,
- !tests_.empty());
- }
- } // RegisterTests
-
- private:
- // LocalTestInfo structure keeps information about a single test registered
- // with TEST_P macro.
- struct TestInfo {
- TestInfo(const char* a_test_suite_base_name, const char* a_test_base_name,
- TestMetaFactoryBase<ParamType>* a_test_meta_factory,
- CodeLocation a_code_location)
- : test_suite_base_name(a_test_suite_base_name),
- test_base_name(a_test_base_name),
- test_meta_factory(a_test_meta_factory),
- code_location(a_code_location) {}
-
- const std::string test_suite_base_name;
- const std::string test_base_name;
- const std::unique_ptr<TestMetaFactoryBase<ParamType> > test_meta_factory;
- const CodeLocation code_location;
- };
- using TestInfoContainer = ::std::vector<std::shared_ptr<TestInfo> >;
- // Records data received from INSTANTIATE_TEST_SUITE_P macros:
- // <Instantiation name, Sequence generator creation function,
- // Name generator function, Source file, Source line>
- struct InstantiationInfo {
- InstantiationInfo(const std::string &name_in,
- GeneratorCreationFunc* generator_in,
- ParamNameGeneratorFunc* name_func_in,
- const char* file_in,
- int line_in)
- : name(name_in),
- generator(generator_in),
- name_func(name_func_in),
- file(file_in),
- line(line_in) {}
-
- std::string name;
- GeneratorCreationFunc* generator;
- ParamNameGeneratorFunc* name_func;
- const char* file;
- int line;
- };
- typedef ::std::vector<InstantiationInfo> InstantiationContainer;
-
- static bool IsValidParamName(const std::string& name) {
- // Check for empty string
- if (name.empty())
- return false;
-
- // Check for invalid characters
- for (std::string::size_type index = 0; index < name.size(); ++index) {
- if (!IsAlNum(name[index]) && name[index] != '_')
- return false;
- }
-
- return true;
- }
-
- const std::string test_suite_name_;
- CodeLocation code_location_;
- TestInfoContainer tests_;
- InstantiationContainer instantiations_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteInfo);
-}; // class ParameterizedTestSuiteInfo
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-template <class TestCase>
-using ParameterizedTestCaseInfo = ParameterizedTestSuiteInfo<TestCase>;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// ParameterizedTestSuiteRegistry contains a map of
-// ParameterizedTestSuiteInfoBase classes accessed by test suite names. TEST_P
-// and INSTANTIATE_TEST_SUITE_P macros use it to locate their corresponding
-// ParameterizedTestSuiteInfo descriptors.
-class ParameterizedTestSuiteRegistry {
- public:
- ParameterizedTestSuiteRegistry() {}
- ~ParameterizedTestSuiteRegistry() {
- for (auto& test_suite_info : test_suite_infos_) {
- delete test_suite_info;
- }
- }
-
- // Looks up or creates and returns a structure containing information about
- // tests and instantiations of a particular test suite.
- template <class TestSuite>
- ParameterizedTestSuiteInfo<TestSuite>* GetTestSuitePatternHolder(
- const char* test_suite_name, CodeLocation code_location) {
- ParameterizedTestSuiteInfo<TestSuite>* typed_test_info = nullptr;
- for (auto& test_suite_info : test_suite_infos_) {
- if (test_suite_info->GetTestSuiteName() == test_suite_name) {
- if (test_suite_info->GetTestSuiteTypeId() != GetTypeId<TestSuite>()) {
- // Complain about incorrect usage of Google Test facilities
- // and terminate the program since we cannot guaranty correct
- // test suite setup and tear-down in this case.
- ReportInvalidTestSuiteType(test_suite_name, code_location);
- posix::Abort();
- } else {
- // At this point we are sure that the object we found is of the same
- // type we are looking for, so we downcast it to that type
- // without further checks.
- typed_test_info = CheckedDowncastToActualType<
- ParameterizedTestSuiteInfo<TestSuite> >(test_suite_info);
- }
- break;
- }
- }
- if (typed_test_info == nullptr) {
- typed_test_info = new ParameterizedTestSuiteInfo<TestSuite>(
- test_suite_name, code_location);
- test_suite_infos_.push_back(typed_test_info);
- }
- return typed_test_info;
- }
- void RegisterTests() {
- for (auto& test_suite_info : test_suite_infos_) {
- test_suite_info->RegisterTests();
- }
- }
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- template <class TestCase>
- ParameterizedTestCaseInfo<TestCase>* GetTestCasePatternHolder(
- const char* test_case_name, CodeLocation code_location) {
- return GetTestSuitePatternHolder<TestCase>(test_case_name, code_location);
- }
-
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- private:
- using TestSuiteInfoContainer = ::std::vector<ParameterizedTestSuiteInfoBase*>;
-
- TestSuiteInfoContainer test_suite_infos_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ParameterizedTestSuiteRegistry);
-};
-
-// Keep track of what type-parameterized test suite are defined and
-// where as well as which are intatiated. This allows susequently
-// identifying suits that are defined but never used.
-class TypeParameterizedTestSuiteRegistry {
- public:
- // Add a suite definition
- void RegisterTestSuite(const char* test_suite_name,
- CodeLocation code_location);
-
- // Add an instantiation of a suit.
- void RegisterInstantiation(const char* test_suite_name);
-
- // For each suit repored as defined but not reported as instantiation,
- // emit a test that reports that fact (configurably, as an error).
- void CheckForInstantiations();
-
- private:
- struct TypeParameterizedTestSuiteInfo {
- explicit TypeParameterizedTestSuiteInfo(CodeLocation c)
- : code_location(c), instantiated(false) {}
-
- CodeLocation code_location;
- bool instantiated;
- };
-
- std::map<std::string, TypeParameterizedTestSuiteInfo> suites_;
-};
-
-} // namespace internal
-
-// Forward declarations of ValuesIn(), which is implemented in
-// include/gtest/gtest-param-test.h.
-template <class Container>
-internal::ParamGenerator<typename Container::value_type> ValuesIn(
- const Container& container);
-
-namespace internal {
-// Used in the Values() function to provide polymorphic capabilities.
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4100)
-#endif
-
-template <typename... Ts>
-class ValueArray {
- public:
- explicit ValueArray(Ts... v) : v_(FlatTupleConstructTag{}, std::move(v)...) {}
-
- template <typename T>
- operator ParamGenerator<T>() const { // NOLINT
- return ValuesIn(MakeVector<T>(MakeIndexSequence<sizeof...(Ts)>()));
- }
-
- private:
- template <typename T, size_t... I>
- std::vector<T> MakeVector(IndexSequence<I...>) const {
- return std::vector<T>{static_cast<T>(v_.template Get<I>())...};
- }
-
- FlatTuple<Ts...> v_;
-};
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-template <typename... T>
-class CartesianProductGenerator
- : public ParamGeneratorInterface<::std::tuple<T...>> {
- public:
- typedef ::std::tuple<T...> ParamType;
-
- CartesianProductGenerator(const std::tuple<ParamGenerator<T>...>& g)
- : generators_(g) {}
- ~CartesianProductGenerator() override {}
-
- ParamIteratorInterface<ParamType>* Begin() const override {
- return new Iterator(this, generators_, false);
- }
- ParamIteratorInterface<ParamType>* End() const override {
- return new Iterator(this, generators_, true);
- }
-
- private:
- template <class I>
- class IteratorImpl;
- template <size_t... I>
- class IteratorImpl<IndexSequence<I...>>
- : public ParamIteratorInterface<ParamType> {
- public:
- IteratorImpl(const ParamGeneratorInterface<ParamType>* base,
- const std::tuple<ParamGenerator<T>...>& generators, bool is_end)
- : base_(base),
- begin_(std::get<I>(generators).begin()...),
- end_(std::get<I>(generators).end()...),
- current_(is_end ? end_ : begin_) {
- ComputeCurrentValue();
- }
- ~IteratorImpl() override {}
-
- const ParamGeneratorInterface<ParamType>* BaseGenerator() const override {
- return base_;
- }
- // Advance should not be called on beyond-of-range iterators
- // so no component iterators must be beyond end of range, either.
- void Advance() override {
- assert(!AtEnd());
- // Advance the last iterator.
- ++std::get<sizeof...(T) - 1>(current_);
- // if that reaches end, propagate that up.
- AdvanceIfEnd<sizeof...(T) - 1>();
- ComputeCurrentValue();
- }
- ParamIteratorInterface<ParamType>* Clone() const override {
- return new IteratorImpl(*this);
- }
-
- const ParamType* Current() const override { return current_value_.get(); }
-
- bool Equals(const ParamIteratorInterface<ParamType>& other) const override {
- // Having the same base generator guarantees that the other
- // iterator is of the same type and we can downcast.
- GTEST_CHECK_(BaseGenerator() == other.BaseGenerator())
- << "The program attempted to compare iterators "
- << "from different generators." << std::endl;
- const IteratorImpl* typed_other =
- CheckedDowncastToActualType<const IteratorImpl>(&other);
-
- // We must report iterators equal if they both point beyond their
- // respective ranges. That can happen in a variety of fashions,
- // so we have to consult AtEnd().
- if (AtEnd() && typed_other->AtEnd()) return true;
-
- bool same = true;
- bool dummy[] = {
- (same = same && std::get<I>(current_) ==
- std::get<I>(typed_other->current_))...};
- (void)dummy;
- return same;
- }
-
- private:
- template <size_t ThisI>
- void AdvanceIfEnd() {
- if (std::get<ThisI>(current_) != std::get<ThisI>(end_)) return;
-
- bool last = ThisI == 0;
- if (last) {
- // We are done. Nothing else to propagate.
- return;
- }
-
- constexpr size_t NextI = ThisI - (ThisI != 0);
- std::get<ThisI>(current_) = std::get<ThisI>(begin_);
- ++std::get<NextI>(current_);
- AdvanceIfEnd<NextI>();
- }
-
- void ComputeCurrentValue() {
- if (!AtEnd())
- current_value_ = std::make_shared<ParamType>(*std::get<I>(current_)...);
- }
- bool AtEnd() const {
- bool at_end = false;
- bool dummy[] = {
- (at_end = at_end || std::get<I>(current_) == std::get<I>(end_))...};
- (void)dummy;
- return at_end;
- }
-
- const ParamGeneratorInterface<ParamType>* const base_;
- std::tuple<typename ParamGenerator<T>::iterator...> begin_;
- std::tuple<typename ParamGenerator<T>::iterator...> end_;
- std::tuple<typename ParamGenerator<T>::iterator...> current_;
- std::shared_ptr<ParamType> current_value_;
- };
-
- using Iterator = IteratorImpl<typename MakeIndexSequence<sizeof...(T)>::type>;
-
- std::tuple<ParamGenerator<T>...> generators_;
-};
-
-template <class... Gen>
-class CartesianProductHolder {
- public:
- CartesianProductHolder(const Gen&... g) : generators_(g...) {}
- template <typename... T>
- operator ParamGenerator<::std::tuple<T...>>() const {
- return ParamGenerator<::std::tuple<T...>>(
- new CartesianProductGenerator<T...>(generators_));
- }
-
- private:
- std::tuple<Gen...> generators_;
-};
-
-} // namespace internal
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port-arch.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port-arch.h
deleted file mode 100644
index 22bbad97eb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port-arch.h
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file defines the GTEST_OS_* macro.
-// It is separate from gtest-port.h so that custom/gtest-port.h can include it.
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
-
-// Determines the platform on which Google Test is compiled.
-#ifdef __CYGWIN__
-# define GTEST_OS_CYGWIN 1
-# elif defined(__MINGW__) || defined(__MINGW32__) || defined(__MINGW64__)
-# define GTEST_OS_WINDOWS_MINGW 1
-# define GTEST_OS_WINDOWS 1
-#elif defined _WIN32
-# define GTEST_OS_WINDOWS 1
-# ifdef _WIN32_WCE
-# define GTEST_OS_WINDOWS_MOBILE 1
-# elif defined(WINAPI_FAMILY)
-# include <winapifamily.h>
-# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
-# define GTEST_OS_WINDOWS_DESKTOP 1
-# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP)
-# define GTEST_OS_WINDOWS_PHONE 1
-# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
-# define GTEST_OS_WINDOWS_RT 1
-# elif WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_TV_TITLE)
-# define GTEST_OS_WINDOWS_PHONE 1
-# define GTEST_OS_WINDOWS_TV_TITLE 1
-# else
- // WINAPI_FAMILY defined but no known partition matched.
- // Default to desktop.
-# define GTEST_OS_WINDOWS_DESKTOP 1
-# endif
-# else
-# define GTEST_OS_WINDOWS_DESKTOP 1
-# endif // _WIN32_WCE
-#elif defined __OS2__
-# define GTEST_OS_OS2 1
-#elif defined __APPLE__
-# define GTEST_OS_MAC 1
-# include <TargetConditionals.h>
-# if TARGET_OS_IPHONE
-# define GTEST_OS_IOS 1
-# endif
-#elif defined __DragonFly__
-# define GTEST_OS_DRAGONFLY 1
-#elif defined __FreeBSD__
-# define GTEST_OS_FREEBSD 1
-#elif defined __Fuchsia__
-# define GTEST_OS_FUCHSIA 1
-#elif defined(__GNU__)
-# define GTEST_OS_GNU_HURD 1
-#elif defined(__GLIBC__) && defined(__FreeBSD_kernel__)
-# define GTEST_OS_GNU_KFREEBSD 1
-#elif defined __linux__
-# define GTEST_OS_LINUX 1
-# if defined __ANDROID__
-# define GTEST_OS_LINUX_ANDROID 1
-# endif
-#elif defined __MVS__
-# define GTEST_OS_ZOS 1
-#elif defined(__sun) && defined(__SVR4)
-# define GTEST_OS_SOLARIS 1
-#elif defined(_AIX)
-# define GTEST_OS_AIX 1
-#elif defined(__hpux)
-# define GTEST_OS_HPUX 1
-#elif defined __native_client__
-# define GTEST_OS_NACL 1
-#elif defined __NetBSD__
-# define GTEST_OS_NETBSD 1
-#elif defined __OpenBSD__
-# define GTEST_OS_OPENBSD 1
-#elif defined __QNX__
-# define GTEST_OS_QNX 1
-#elif defined(__HAIKU__)
-#define GTEST_OS_HAIKU 1
-#elif defined ESP8266
-#define GTEST_OS_ESP8266 1
-#elif defined ESP32
-#define GTEST_OS_ESP32 1
-#elif defined(__XTENSA__)
-#define GTEST_OS_XTENSA 1
-#endif // __CYGWIN__
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_ARCH_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port.h
deleted file mode 100644
index 945b6ec0ec..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-port.h
+++ /dev/null
@@ -1,2367 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Low-level types and utilities for porting Google Test to various
-// platforms. All macros ending with _ and symbols defined in an
-// internal namespace are subject to change without notice. Code
-// outside Google Test MUST NOT USE THEM DIRECTLY. Macros that don't
-// end with _ are part of Google Test's public API and can be used by
-// code outside Google Test.
-//
-// This file is fundamental to Google Test. All other Google Test source
-// files are expected to #include this. Therefore, it cannot #include
-// any other Google Test header.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
-
-// Environment-describing macros
-// -----------------------------
-//
-// Google Test can be used in many different environments. Macros in
-// this section tell Google Test what kind of environment it is being
-// used in, such that Google Test can provide environment-specific
-// features and implementations.
-//
-// Google Test tries to automatically detect the properties of its
-// environment, so users usually don't need to worry about these
-// macros. However, the automatic detection is not perfect.
-// Sometimes it's necessary for a user to define some of the following
-// macros in the build script to override Google Test's decisions.
-//
-// If the user doesn't define a macro in the list, Google Test will
-// provide a default definition. After this header is #included, all
-// macros in this list will be defined to either 1 or 0.
-//
-// Notes to maintainers:
-// - Each macro here is a user-tweakable knob; do not grow the list
-// lightly.
-// - Use #if to key off these macros. Don't use #ifdef or "#if
-// defined(...)", which will not work as these macros are ALWAYS
-// defined.
-//
-// GTEST_HAS_CLONE - Define it to 1/0 to indicate that clone(2)
-// is/isn't available.
-// GTEST_HAS_EXCEPTIONS - Define it to 1/0 to indicate that exceptions
-// are enabled.
-// GTEST_HAS_POSIX_RE - Define it to 1/0 to indicate that POSIX regular
-// expressions are/aren't available.
-// GTEST_HAS_PTHREAD - Define it to 1/0 to indicate that <pthread.h>
-// is/isn't available.
-// GTEST_HAS_RTTI - Define it to 1/0 to indicate that RTTI is/isn't
-// enabled.
-// GTEST_HAS_STD_WSTRING - Define it to 1/0 to indicate that
-// std::wstring does/doesn't work (Google Test can
-// be used where std::wstring is unavailable).
-// GTEST_HAS_SEH - Define it to 1/0 to indicate whether the
-// compiler supports Microsoft's "Structured
-// Exception Handling".
-// GTEST_HAS_STREAM_REDIRECTION
-// - Define it to 1/0 to indicate whether the
-// platform supports I/O stream redirection using
-// dup() and dup2().
-// GTEST_LINKED_AS_SHARED_LIBRARY
-// - Define to 1 when compiling tests that use
-// Google Test as a shared library (known as
-// DLL on Windows).
-// GTEST_CREATE_SHARED_LIBRARY
-// - Define to 1 when compiling Google Test itself
-// as a shared library.
-// GTEST_DEFAULT_DEATH_TEST_STYLE
-// - The default value of --gtest_death_test_style.
-// The legacy default has been "fast" in the open
-// source version since 2008. The recommended value
-// is "threadsafe", and can be set in
-// custom/gtest-port.h.
-
-// Platform-indicating macros
-// --------------------------
-//
-// Macros indicating the platform on which Google Test is being used
-// (a macro is defined to 1 if compiled on the given platform;
-// otherwise UNDEFINED -- it's never defined to 0.). Google Test
-// defines these macros automatically. Code outside Google Test MUST
-// NOT define them.
-//
-// GTEST_OS_AIX - IBM AIX
-// GTEST_OS_CYGWIN - Cygwin
-// GTEST_OS_DRAGONFLY - DragonFlyBSD
-// GTEST_OS_FREEBSD - FreeBSD
-// GTEST_OS_FUCHSIA - Fuchsia
-// GTEST_OS_GNU_HURD - GNU/Hurd
-// GTEST_OS_GNU_KFREEBSD - GNU/kFreeBSD
-// GTEST_OS_HAIKU - Haiku
-// GTEST_OS_HPUX - HP-UX
-// GTEST_OS_LINUX - Linux
-// GTEST_OS_LINUX_ANDROID - Google Android
-// GTEST_OS_MAC - Mac OS X
-// GTEST_OS_IOS - iOS
-// GTEST_OS_NACL - Google Native Client (NaCl)
-// GTEST_OS_NETBSD - NetBSD
-// GTEST_OS_OPENBSD - OpenBSD
-// GTEST_OS_OS2 - OS/2
-// GTEST_OS_QNX - QNX
-// GTEST_OS_SOLARIS - Sun Solaris
-// GTEST_OS_WINDOWS - Windows (Desktop, MinGW, or Mobile)
-// GTEST_OS_WINDOWS_DESKTOP - Windows Desktop
-// GTEST_OS_WINDOWS_MINGW - MinGW
-// GTEST_OS_WINDOWS_MOBILE - Windows Mobile
-// GTEST_OS_WINDOWS_PHONE - Windows Phone
-// GTEST_OS_WINDOWS_RT - Windows Store App/WinRT
-// GTEST_OS_ZOS - z/OS
-//
-// Among the platforms, Cygwin, Linux, Mac OS X, and Windows have the
-// most stable support. Since core members of the Google Test project
-// don't have access to other platforms, support for them may be less
-// stable. If you notice any problems on your platform, please notify
-// googletestframework@googlegroups.com (patches for fixing them are
-// even more welcome!).
-//
-// It is possible that none of the GTEST_OS_* macros are defined.
-
-// Feature-indicating macros
-// -------------------------
-//
-// Macros indicating which Google Test features are available (a macro
-// is defined to 1 if the corresponding feature is supported;
-// otherwise UNDEFINED -- it's never defined to 0.). Google Test
-// defines these macros automatically. Code outside Google Test MUST
-// NOT define them.
-//
-// These macros are public so that portable tests can be written.
-// Such tests typically surround code using a feature with an #if
-// which controls that code. For example:
-//
-// #if GTEST_HAS_DEATH_TEST
-// EXPECT_DEATH(DoSomethingDeadly());
-// #endif
-//
-// GTEST_HAS_DEATH_TEST - death tests
-// GTEST_HAS_TYPED_TEST - typed tests
-// GTEST_HAS_TYPED_TEST_P - type-parameterized tests
-// GTEST_IS_THREADSAFE - Google Test is thread-safe.
-// GTEST_USES_POSIX_RE - enhanced POSIX regex is used. Do not confuse with
-// GTEST_HAS_POSIX_RE (see above) which users can
-// define themselves.
-// GTEST_USES_SIMPLE_RE - our own simple regex is used;
-// the above RE\b(s) are mutually exclusive.
-
-// Misc public macros
-// ------------------
-//
-// GTEST_FLAG(flag_name) - references the variable corresponding to
-// the given Google Test flag.
-
-// Internal utilities
-// ------------------
-//
-// The following macros and utilities are for Google Test's INTERNAL
-// use only. Code outside Google Test MUST NOT USE THEM DIRECTLY.
-//
-// Macros for basic C++ coding:
-// GTEST_AMBIGUOUS_ELSE_BLOCKER_ - for disabling a gcc warning.
-// GTEST_ATTRIBUTE_UNUSED_ - declares that a class' instances or a
-// variable don't have to be used.
-// GTEST_DISALLOW_COPY_AND_ASSIGN_ - disables copy ctor and operator=.
-// GTEST_DISALLOW_MOVE_AND_ASSIGN_ - disables move ctor and operator=.
-// GTEST_MUST_USE_RESULT_ - declares that a function's result must be used.
-// GTEST_INTENTIONAL_CONST_COND_PUSH_ - start code section where MSVC C4127 is
-// suppressed (constant conditional).
-// GTEST_INTENTIONAL_CONST_COND_POP_ - finish code section where MSVC C4127
-// is suppressed.
-// GTEST_INTERNAL_HAS_ANY - for enabling UniversalPrinter<std::any> or
-// UniversalPrinter<absl::any> specializations.
-// GTEST_INTERNAL_HAS_OPTIONAL - for enabling UniversalPrinter<std::optional>
-// or
-// UniversalPrinter<absl::optional>
-// specializations.
-// GTEST_INTERNAL_HAS_STRING_VIEW - for enabling Matcher<std::string_view> or
-// Matcher<absl::string_view>
-// specializations.
-// GTEST_INTERNAL_HAS_VARIANT - for enabling UniversalPrinter<std::variant> or
-// UniversalPrinter<absl::variant>
-// specializations.
-//
-// Synchronization:
-// Mutex, MutexLock, ThreadLocal, GetThreadCount()
-// - synchronization primitives.
-//
-// Regular expressions:
-// RE - a simple regular expression class using the POSIX
-// Extended Regular Expression syntax on UNIX-like platforms
-// or a reduced regular exception syntax on other
-// platforms, including Windows.
-// Logging:
-// GTEST_LOG_() - logs messages at the specified severity level.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-//
-// Stdout and stderr capturing:
-// CaptureStdout() - starts capturing stdout.
-// GetCapturedStdout() - stops capturing stdout and returns the captured
-// string.
-// CaptureStderr() - starts capturing stderr.
-// GetCapturedStderr() - stops capturing stderr and returns the captured
-// string.
-//
-// Integer types:
-// TypeWithSize - maps an integer to a int type.
-// TimeInMillis - integers of known sizes.
-// BiggestInt - the biggest signed integer type.
-//
-// Command-line utilities:
-// GTEST_DECLARE_*() - declares a flag.
-// GTEST_DEFINE_*() - defines a flag.
-// GetInjectableArgvs() - returns the command line as a vector of strings.
-//
-// Environment variable utilities:
-// GetEnv() - gets the value of an environment variable.
-// BoolFromGTestEnv() - parses a bool environment variable.
-// Int32FromGTestEnv() - parses an int32_t environment variable.
-// StringFromGTestEnv() - parses a string environment variable.
-//
-// Deprecation warnings:
-// GTEST_INTERNAL_DEPRECATED(message) - attribute marking a function as
-// deprecated; calling a marked function
-// should generate a compiler warning
-
-#include <ctype.h> // for isspace, etc
-#include <stddef.h> // for ptrdiff_t
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <cerrno>
-// #include <condition_variable> // Guarded by GTEST_IS_THREADSAFE below
-#include <cstdint>
-#include <iostream>
-#include <limits>
-#include <locale>
-#include <memory>
-#include <string>
-// #include <mutex> // Guarded by GTEST_IS_THREADSAFE below
-#include <tuple>
-#include <type_traits>
-#include <vector>
-
-#ifndef _WIN32_WCE
-# include <sys/types.h>
-# include <sys/stat.h>
-#endif // !_WIN32_WCE
-
-#if defined __APPLE__
-# include <AvailabilityMacros.h>
-# include <TargetConditionals.h>
-#endif
-
-#include "gtest/internal/custom/gtest-port.h"
-#include "gtest/internal/gtest-port-arch.h"
-
-#if !defined(GTEST_DEV_EMAIL_)
-# define GTEST_DEV_EMAIL_ "googletestframework@@googlegroups.com"
-# define GTEST_FLAG_PREFIX_ "gtest_"
-# define GTEST_FLAG_PREFIX_DASH_ "gtest-"
-# define GTEST_FLAG_PREFIX_UPPER_ "GTEST_"
-# define GTEST_NAME_ "Google Test"
-# define GTEST_PROJECT_URL_ "https://github.com/google/googletest/"
-#endif // !defined(GTEST_DEV_EMAIL_)
-
-#if !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
-# define GTEST_INIT_GOOGLE_TEST_NAME_ "testing::InitGoogleTest"
-#endif // !defined(GTEST_INIT_GOOGLE_TEST_NAME_)
-
-// Determines the version of gcc that is used to compile this.
-#ifdef __GNUC__
-// 40302 means version 4.3.2.
-# define GTEST_GCC_VER_ \
- (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__)
-#endif // __GNUC__
-
-// Macros for disabling Microsoft Visual C++ warnings.
-//
-// GTEST_DISABLE_MSC_WARNINGS_PUSH_(4800 4385)
-// /* code that triggers warnings C4800 and C4385 */
-// GTEST_DISABLE_MSC_WARNINGS_POP_()
-#if defined(_MSC_VER)
-# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings) \
- __pragma(warning(push)) \
- __pragma(warning(disable: warnings))
-# define GTEST_DISABLE_MSC_WARNINGS_POP_() \
- __pragma(warning(pop))
-#else
-// Not all compilers are MSVC
-# define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
-# define GTEST_DISABLE_MSC_WARNINGS_POP_()
-#endif
-
-// Clang on Windows does not understand MSVC's pragma warning.
-// We need clang-specific way to disable function deprecation warning.
-#ifdef __clang__
-# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
- _Pragma("clang diagnostic push") \
- _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") \
- _Pragma("clang diagnostic ignored \"-Wdeprecated-implementations\"")
-#define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
- _Pragma("clang diagnostic pop")
-#else
-# define GTEST_DISABLE_MSC_DEPRECATED_PUSH_() \
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996)
-# define GTEST_DISABLE_MSC_DEPRECATED_POP_() \
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-#endif
-
-// Brings in definitions for functions used in the testing::internal::posix
-// namespace (read, write, close, chdir, isatty, stat). We do not currently
-// use them on Windows Mobile.
-#if GTEST_OS_WINDOWS
-# if !GTEST_OS_WINDOWS_MOBILE
-# include <direct.h>
-# include <io.h>
-# endif
-// In order to avoid having to include <windows.h>, use forward declaration
-#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
-// MinGW defined _CRITICAL_SECTION and _RTL_CRITICAL_SECTION as two
-// separate (equivalent) structs, instead of using typedef
-typedef struct _CRITICAL_SECTION GTEST_CRITICAL_SECTION;
-#else
-// Assume CRITICAL_SECTION is a typedef of _RTL_CRITICAL_SECTION.
-// This assumption is verified by
-// WindowsTypesTest.CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION.
-typedef struct _RTL_CRITICAL_SECTION GTEST_CRITICAL_SECTION;
-#endif
-#elif GTEST_OS_XTENSA
-#include <unistd.h>
-// Xtensa toolchains define strcasecmp in the string.h header instead of
-// strings.h. string.h is already included.
-#else
-// This assumes that non-Windows OSes provide unistd.h. For OSes where this
-// is not the case, we need to include headers that provide the functions
-// mentioned above.
-# include <unistd.h>
-# include <strings.h>
-#endif // GTEST_OS_WINDOWS
-
-#if GTEST_OS_LINUX_ANDROID
-// Used to define __ANDROID_API__ matching the target NDK API level.
-# include <android/api-level.h> // NOLINT
-#endif
-
-// Defines this to true if and only if Google Test can use POSIX regular
-// expressions.
-#ifndef GTEST_HAS_POSIX_RE
-# if GTEST_OS_LINUX_ANDROID
-// On Android, <regex.h> is only available starting with Gingerbread.
-# define GTEST_HAS_POSIX_RE (__ANDROID_API__ >= 9)
-# else
-#define GTEST_HAS_POSIX_RE (!GTEST_OS_WINDOWS && !GTEST_OS_XTENSA)
-# endif
-#endif
-
-#if GTEST_USES_PCRE
-// The appropriate headers have already been included.
-
-#elif GTEST_HAS_POSIX_RE
-
-// On some platforms, <regex.h> needs someone to define size_t, and
-// won't compile otherwise. We can #include it here as we already
-// included <stdlib.h>, which is guaranteed to define size_t through
-// <stddef.h>.
-# include <regex.h> // NOLINT
-
-# define GTEST_USES_POSIX_RE 1
-
-#elif GTEST_OS_WINDOWS
-
-// <regex.h> is not available on Windows. Use our own simple regex
-// implementation instead.
-# define GTEST_USES_SIMPLE_RE 1
-
-#else
-
-// <regex.h> may not be available on this platform. Use our own
-// simple regex implementation instead.
-# define GTEST_USES_SIMPLE_RE 1
-
-#endif // GTEST_USES_PCRE
-
-#ifndef GTEST_HAS_EXCEPTIONS
-// The user didn't tell us whether exceptions are enabled, so we need
-// to figure it out.
-# if defined(_MSC_VER) && defined(_CPPUNWIND)
-// MSVC defines _CPPUNWIND to 1 if and only if exceptions are enabled.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__BORLANDC__)
-// C++Builder's implementation of the STL uses the _HAS_EXCEPTIONS
-// macro to enable exceptions, so we'll do the same.
-// Assumes that exceptions are enabled by default.
-# ifndef _HAS_EXCEPTIONS
-# define _HAS_EXCEPTIONS 1
-# endif // _HAS_EXCEPTIONS
-# define GTEST_HAS_EXCEPTIONS _HAS_EXCEPTIONS
-# elif defined(__clang__)
-// clang defines __EXCEPTIONS if and only if exceptions are enabled before clang
-// 220714, but if and only if cleanups are enabled after that. In Obj-C++ files,
-// there can be cleanups for ObjC exceptions which also need cleanups, even if
-// C++ exceptions are disabled. clang has __has_feature(cxx_exceptions) which
-// checks for C++ exceptions starting at clang r206352, but which checked for
-// cleanups prior to that. To reliably check for C++ exception availability with
-// clang, check for
-// __EXCEPTIONS && __has_feature(cxx_exceptions).
-# define GTEST_HAS_EXCEPTIONS (__EXCEPTIONS && __has_feature(cxx_exceptions))
-# elif defined(__GNUC__) && __EXCEPTIONS
-// gcc defines __EXCEPTIONS to 1 if and only if exceptions are enabled.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__SUNPRO_CC)
-// Sun Pro CC supports exceptions. However, there is no compile-time way of
-// detecting whether they are enabled or not. Therefore, we assume that
-// they are enabled unless the user tells us otherwise.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__IBMCPP__) && __EXCEPTIONS
-// xlC defines __EXCEPTIONS to 1 if and only if exceptions are enabled.
-# define GTEST_HAS_EXCEPTIONS 1
-# elif defined(__HP_aCC)
-// Exception handling is in effect by default in HP aCC compiler. It has to
-// be turned of by +noeh compiler option if desired.
-# define GTEST_HAS_EXCEPTIONS 1
-# else
-// For other compilers, we assume exceptions are disabled to be
-// conservative.
-# define GTEST_HAS_EXCEPTIONS 0
-# endif // defined(_MSC_VER) || defined(__BORLANDC__)
-#endif // GTEST_HAS_EXCEPTIONS
-
-#ifndef GTEST_HAS_STD_WSTRING
-// The user didn't tell us whether ::std::wstring is available, so we need
-// to figure it out.
-// Cygwin 1.7 and below doesn't support ::std::wstring.
-// Solaris' libc++ doesn't support it either. Android has
-// no support for it at least as recent as Froyo (2.2).
-#define GTEST_HAS_STD_WSTRING \
- (!(GTEST_OS_LINUX_ANDROID || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- GTEST_OS_HAIKU || GTEST_OS_ESP32 || GTEST_OS_ESP8266 || GTEST_OS_XTENSA))
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Determines whether RTTI is available.
-#ifndef GTEST_HAS_RTTI
-// The user didn't tell us whether RTTI is enabled, so we need to
-// figure it out.
-
-# ifdef _MSC_VER
-
-#ifdef _CPPRTTI // MSVC defines this macro if and only if RTTI is enabled.
-# define GTEST_HAS_RTTI 1
-# else
-# define GTEST_HAS_RTTI 0
-# endif
-
-// Starting with version 4.3.2, gcc defines __GXX_RTTI if and only if RTTI is
-// enabled.
-# elif defined(__GNUC__)
-
-# ifdef __GXX_RTTI
-// When building against STLport with the Android NDK and with
-// -frtti -fno-exceptions, the build fails at link time with undefined
-// references to __cxa_bad_typeid. Note sure if STL or toolchain bug,
-// so disable RTTI when detected.
-# if GTEST_OS_LINUX_ANDROID && defined(_STLPORT_MAJOR) && \
- !defined(__EXCEPTIONS)
-# define GTEST_HAS_RTTI 0
-# else
-# define GTEST_HAS_RTTI 1
-# endif // GTEST_OS_LINUX_ANDROID && __STLPORT_MAJOR && !__EXCEPTIONS
-# else
-# define GTEST_HAS_RTTI 0
-# endif // __GXX_RTTI
-
-// Clang defines __GXX_RTTI starting with version 3.0, but its manual recommends
-// using has_feature instead. has_feature(cxx_rtti) is supported since 2.7, the
-// first version with C++ support.
-# elif defined(__clang__)
-
-# define GTEST_HAS_RTTI __has_feature(cxx_rtti)
-
-// Starting with version 9.0 IBM Visual Age defines __RTTI_ALL__ to 1 if
-// both the typeid and dynamic_cast features are present.
-# elif defined(__IBMCPP__) && (__IBMCPP__ >= 900)
-
-# ifdef __RTTI_ALL__
-# define GTEST_HAS_RTTI 1
-# else
-# define GTEST_HAS_RTTI 0
-# endif
-
-# else
-
-// For all other compilers, we assume RTTI is enabled.
-# define GTEST_HAS_RTTI 1
-
-# endif // _MSC_VER
-
-#endif // GTEST_HAS_RTTI
-
-// It's this header's responsibility to #include <typeinfo> when RTTI
-// is enabled.
-#if GTEST_HAS_RTTI
-# include <typeinfo>
-#endif
-
-// Determines whether Google Test can use the pthreads library.
-#ifndef GTEST_HAS_PTHREAD
-// The user didn't tell us explicitly, so we make reasonable assumptions about
-// which platforms have pthreads support.
-//
-// To disable threading support in Google Test, add -DGTEST_HAS_PTHREAD=0
-// to your compiler flags.
-#define GTEST_HAS_PTHREAD \
- (GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_HPUX || GTEST_OS_QNX || \
- GTEST_OS_FREEBSD || GTEST_OS_NACL || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
- GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_OPENBSD || \
- GTEST_OS_HAIKU || GTEST_OS_GNU_HURD)
-#endif // GTEST_HAS_PTHREAD
-
-#if GTEST_HAS_PTHREAD
-// gtest-port.h guarantees to #include <pthread.h> when GTEST_HAS_PTHREAD is
-// true.
-# include <pthread.h> // NOLINT
-
-// For timespec and nanosleep, used below.
-# include <time.h> // NOLINT
-#endif
-
-// Determines whether clone(2) is supported.
-// Usually it will only be available on Linux, excluding
-// Linux on the Itanium architecture.
-// Also see http://linux.die.net/man/2/clone.
-#ifndef GTEST_HAS_CLONE
-// The user didn't tell us, so we need to figure it out.
-
-# if GTEST_OS_LINUX && !defined(__ia64__)
-# if GTEST_OS_LINUX_ANDROID
-// On Android, clone() became available at different API levels for each 32-bit
-// architecture.
-# if defined(__LP64__) || \
- (defined(__arm__) && __ANDROID_API__ >= 9) || \
- (defined(__mips__) && __ANDROID_API__ >= 12) || \
- (defined(__i386__) && __ANDROID_API__ >= 17)
-# define GTEST_HAS_CLONE 1
-# else
-# define GTEST_HAS_CLONE 0
-# endif
-# else
-# define GTEST_HAS_CLONE 1
-# endif
-# else
-# define GTEST_HAS_CLONE 0
-# endif // GTEST_OS_LINUX && !defined(__ia64__)
-
-#endif // GTEST_HAS_CLONE
-
-// Determines whether to support stream redirection. This is used to test
-// output correctness and to implement death tests.
-#ifndef GTEST_HAS_STREAM_REDIRECTION
-// By default, we assume that stream redirection is supported on all
-// platforms except known mobile ones.
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
- GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_XTENSA
-# define GTEST_HAS_STREAM_REDIRECTION 0
-# else
-# define GTEST_HAS_STREAM_REDIRECTION 1
-# endif // !GTEST_OS_WINDOWS_MOBILE
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-// Determines whether to support death tests.
-// pops up a dialog window that cannot be suppressed programmatically.
-#if (GTEST_OS_LINUX || GTEST_OS_CYGWIN || GTEST_OS_SOLARIS || \
- (GTEST_OS_MAC && !GTEST_OS_IOS) || \
- (GTEST_OS_WINDOWS_DESKTOP && _MSC_VER) || GTEST_OS_WINDOWS_MINGW || \
- GTEST_OS_AIX || GTEST_OS_HPUX || GTEST_OS_OPENBSD || GTEST_OS_QNX || \
- GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_FUCHSIA || \
- GTEST_OS_DRAGONFLY || GTEST_OS_GNU_KFREEBSD || GTEST_OS_HAIKU || \
- GTEST_OS_GNU_HURD)
-# define GTEST_HAS_DEATH_TEST 1
-#endif
-
-// Determines whether to support type-driven tests.
-
-// Typed tests need <typeinfo> and variadic macros, which GCC, VC++ 8.0,
-// Sun Pro CC, IBM Visual Age, and HP aCC support.
-#if defined(__GNUC__) || defined(_MSC_VER) || defined(__SUNPRO_CC) || \
- defined(__IBMCPP__) || defined(__HP_aCC)
-# define GTEST_HAS_TYPED_TEST 1
-# define GTEST_HAS_TYPED_TEST_P 1
-#endif
-
-// Determines whether the system compiler uses UTF-16 for encoding wide strings.
-#define GTEST_WIDE_STRING_USES_UTF16_ \
- (GTEST_OS_WINDOWS || GTEST_OS_CYGWIN || GTEST_OS_AIX || GTEST_OS_OS2)
-
-// Determines whether test results can be streamed to a socket.
-#if GTEST_OS_LINUX || GTEST_OS_GNU_KFREEBSD || GTEST_OS_DRAGONFLY || \
- GTEST_OS_FREEBSD || GTEST_OS_NETBSD || GTEST_OS_OPENBSD || \
- GTEST_OS_GNU_HURD
-# define GTEST_CAN_STREAM_RESULTS_ 1
-#endif
-
-// Defines some utility macros.
-
-// The GNU compiler emits a warning if nested "if" statements are followed by
-// an "else" statement and braces are not used to explicitly disambiguate the
-// "else" binding. This leads to problems with code like:
-//
-// if (gate)
-// ASSERT_*(condition) << "Some message";
-//
-// The "switch (0) case 0:" idiom is used to suppress this.
-#ifdef __INTEL_COMPILER
-# define GTEST_AMBIGUOUS_ELSE_BLOCKER_
-#else
-# define GTEST_AMBIGUOUS_ELSE_BLOCKER_ switch (0) case 0: default: // NOLINT
-#endif
-
-// Use this annotation at the end of a struct/class definition to
-// prevent the compiler from optimizing away instances that are never
-// used. This is useful when all interesting logic happens inside the
-// c'tor and / or d'tor. Example:
-//
-// struct Foo {
-// Foo() { ... }
-// } GTEST_ATTRIBUTE_UNUSED_;
-//
-// Also use it after a variable or parameter declaration to tell the
-// compiler the variable/parameter does not have to be used.
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
-# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-#elif defined(__clang__)
-# if __has_attribute(unused)
-# define GTEST_ATTRIBUTE_UNUSED_ __attribute__ ((unused))
-# endif
-#endif
-#ifndef GTEST_ATTRIBUTE_UNUSED_
-# define GTEST_ATTRIBUTE_UNUSED_
-#endif
-
-// Use this annotation before a function that takes a printf format string.
-#if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
-# if defined(__MINGW_PRINTF_FORMAT)
-// MinGW has two different printf implementations. Ensure the format macro
-// matches the selected implementation. See
-// https://sourceforge.net/p/mingw-w64/wiki2/gnu%20printf/.
-# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
- __attribute__((__format__(__MINGW_PRINTF_FORMAT, string_index, \
- first_to_check)))
-# else
-# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check) \
- __attribute__((__format__(__printf__, string_index, first_to_check)))
-# endif
-#else
-# define GTEST_ATTRIBUTE_PRINTF_(string_index, first_to_check)
-#endif
-
-// A macro to disallow copy constructor and operator=
-// This should be used in the private: declarations for a class.
-// NOLINT is for modernize-use-trailing-return-type in macro uses.
-#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type) \
- type(type const&) = delete; \
- type& operator=(type const&) = delete /* NOLINT */
-
-// A macro to disallow move constructor and operator=
-// This should be used in the private: declarations for a class.
-// NOLINT is for modernize-use-trailing-return-type in macro uses.
-#define GTEST_DISALLOW_MOVE_AND_ASSIGN_(type) \
- type(type&&) noexcept = delete; \
- type& operator=(type&&) noexcept = delete /* NOLINT */
-
-// Tell the compiler to warn about unused return values for functions declared
-// with this macro. The macro should be used on function declarations
-// following the argument list:
-//
-// Sprocket* AllocateSprocket() GTEST_MUST_USE_RESULT_;
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
-# define GTEST_MUST_USE_RESULT_ __attribute__ ((warn_unused_result))
-#else
-# define GTEST_MUST_USE_RESULT_
-#endif // __GNUC__ && !COMPILER_ICC
-
-// MS C++ compiler emits warning when a conditional expression is compile time
-// constant. In some contexts this warning is false positive and needs to be
-// suppressed. Use the following two macros in such cases:
-//
-// GTEST_INTENTIONAL_CONST_COND_PUSH_()
-// while (true) {
-// GTEST_INTENTIONAL_CONST_COND_POP_()
-// }
-# define GTEST_INTENTIONAL_CONST_COND_PUSH_() \
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127)
-# define GTEST_INTENTIONAL_CONST_COND_POP_() \
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-
-// Determine whether the compiler supports Microsoft's Structured Exception
-// Handling. This is supported by several Windows compilers but generally
-// does not exist on any other system.
-#ifndef GTEST_HAS_SEH
-// The user didn't tell us, so we need to figure it out.
-
-# if defined(_MSC_VER) || defined(__BORLANDC__)
-// These two compilers are known to support SEH.
-# define GTEST_HAS_SEH 1
-# else
-// Assume no SEH.
-# define GTEST_HAS_SEH 0
-# endif
-
-#endif // GTEST_HAS_SEH
-
-#ifndef GTEST_IS_THREADSAFE
-
-#define GTEST_IS_THREADSAFE \
- (GTEST_HAS_MUTEX_AND_THREAD_LOCAL_ || \
- (GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT) || \
- GTEST_HAS_PTHREAD)
-
-#endif // GTEST_IS_THREADSAFE
-
-#if GTEST_IS_THREADSAFE
-// Some platforms don't support including these threading related headers.
-#include <condition_variable> // NOLINT
-#include <mutex> // NOLINT
-#endif // GTEST_IS_THREADSAFE
-
-// GTEST_API_ qualifies all symbols that must be exported. The definitions below
-// are guarded by #ifndef to give embedders a chance to define GTEST_API_ in
-// gtest/internal/custom/gtest-port.h
-#ifndef GTEST_API_
-
-#ifdef _MSC_VER
-# if GTEST_LINKED_AS_SHARED_LIBRARY
-# define GTEST_API_ __declspec(dllimport)
-# elif GTEST_CREATE_SHARED_LIBRARY
-# define GTEST_API_ __declspec(dllexport)
-# endif
-#elif __GNUC__ >= 4 || defined(__clang__)
-# define GTEST_API_ __attribute__((visibility ("default")))
-#endif // _MSC_VER
-
-#endif // GTEST_API_
-
-#ifndef GTEST_API_
-# define GTEST_API_
-#endif // GTEST_API_
-
-#ifndef GTEST_DEFAULT_DEATH_TEST_STYLE
-# define GTEST_DEFAULT_DEATH_TEST_STYLE "fast"
-#endif // GTEST_DEFAULT_DEATH_TEST_STYLE
-
-#ifdef __GNUC__
-// Ask the compiler to never inline a given function.
-# define GTEST_NO_INLINE_ __attribute__((noinline))
-#else
-# define GTEST_NO_INLINE_
-#endif
-
-// _LIBCPP_VERSION is defined by the libc++ library from the LLVM project.
-#if !defined(GTEST_HAS_CXXABI_H_)
-# if defined(__GLIBCXX__) || (defined(_LIBCPP_VERSION) && !defined(_MSC_VER))
-# define GTEST_HAS_CXXABI_H_ 1
-# else
-# define GTEST_HAS_CXXABI_H_ 0
-# endif
-#endif
-
-// A function level attribute to disable checking for use of uninitialized
-// memory when built with MemorySanitizer.
-#if defined(__clang__)
-# if __has_feature(memory_sanitizer)
-# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_ \
- __attribute__((no_sanitize_memory))
-# else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
-# endif // __has_feature(memory_sanitizer)
-#else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
-#endif // __clang__
-
-// A function level attribute to disable AddressSanitizer instrumentation.
-#if defined(__clang__)
-# if __has_feature(address_sanitizer)
-# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_ \
- __attribute__((no_sanitize_address))
-# else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-# endif // __has_feature(address_sanitizer)
-#else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-#endif // __clang__
-
-// A function level attribute to disable HWAddressSanitizer instrumentation.
-#if defined(__clang__)
-# if __has_feature(hwaddress_sanitizer)
-# define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_ \
- __attribute__((no_sanitize("hwaddress")))
-# else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-# endif // __has_feature(hwaddress_sanitizer)
-#else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-#endif // __clang__
-
-// A function level attribute to disable ThreadSanitizer instrumentation.
-#if defined(__clang__)
-# if __has_feature(thread_sanitizer)
-# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_ \
- __attribute__((no_sanitize_thread))
-# else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
-# endif // __has_feature(thread_sanitizer)
-#else
-# define GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
-#endif // __clang__
-
-namespace testing {
-
-class Message;
-
-// Legacy imports for backwards compatibility.
-// New code should use std:: names directly.
-using std::get;
-using std::make_tuple;
-using std::tuple;
-using std::tuple_element;
-using std::tuple_size;
-
-namespace internal {
-
-// A secret type that Google Test users don't know about. It has no
-// definition on purpose. Therefore it's impossible to create a
-// Secret object, which is what we want.
-class Secret;
-
-// The GTEST_COMPILE_ASSERT_ is a legacy macro used to verify that a compile
-// time expression is true (in new code, use static_assert instead). For
-// example, you could use it to verify the size of a static array:
-//
-// GTEST_COMPILE_ASSERT_(GTEST_ARRAY_SIZE_(names) == NUM_NAMES,
-// names_incorrect_size);
-//
-// The second argument to the macro must be a valid C++ identifier. If the
-// expression is false, compiler will issue an error containing this identifier.
-#define GTEST_COMPILE_ASSERT_(expr, msg) static_assert(expr, #msg)
-
-// A helper for suppressing warnings on constant condition. It just
-// returns 'condition'.
-GTEST_API_ bool IsTrue(bool condition);
-
-// Defines RE.
-
-#if GTEST_USES_PCRE
-// if used, PCRE is injected by custom/gtest-port.h
-#elif GTEST_USES_POSIX_RE || GTEST_USES_SIMPLE_RE
-
-// A simple C++ wrapper for <regex.h>. It uses the POSIX Extended
-// Regular Expression syntax.
-class GTEST_API_ RE {
- public:
- // A copy constructor is required by the Standard to initialize object
- // references from r-values.
- RE(const RE& other) { Init(other.pattern()); }
-
- // Constructs an RE from a string.
- RE(const ::std::string& regex) { Init(regex.c_str()); } // NOLINT
-
- RE(const char* regex) { Init(regex); } // NOLINT
- ~RE();
-
- // Returns the string representation of the regex.
- const char* pattern() const { return pattern_; }
-
- // FullMatch(str, re) returns true if and only if regular expression re
- // matches the entire str.
- // PartialMatch(str, re) returns true if and only if regular expression re
- // matches a substring of str (including str itself).
- static bool FullMatch(const ::std::string& str, const RE& re) {
- return FullMatch(str.c_str(), re);
- }
- static bool PartialMatch(const ::std::string& str, const RE& re) {
- return PartialMatch(str.c_str(), re);
- }
-
- static bool FullMatch(const char* str, const RE& re);
- static bool PartialMatch(const char* str, const RE& re);
-
- private:
- void Init(const char* regex);
- const char* pattern_;
- bool is_valid_;
-
-# if GTEST_USES_POSIX_RE
-
- regex_t full_regex_; // For FullMatch().
- regex_t partial_regex_; // For PartialMatch().
-
-# else // GTEST_USES_SIMPLE_RE
-
- const char* full_pattern_; // For FullMatch();
-
-# endif
-};
-
-#endif // GTEST_USES_PCRE
-
-// Formats a source file path and a line number as they would appear
-// in an error message from the compiler used to compile this code.
-GTEST_API_ ::std::string FormatFileLocation(const char* file, int line);
-
-// Formats a file location for compiler-independent XML output.
-// Although this function is not platform dependent, we put it next to
-// FormatFileLocation in order to contrast the two functions.
-GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(const char* file,
- int line);
-
-// Defines logging utilities:
-// GTEST_LOG_(severity) - logs messages at the specified severity level. The
-// message itself is streamed into the macro.
-// LogToStderr() - directs all log messages to stderr.
-// FlushInfoLog() - flushes informational log messages.
-
-enum GTestLogSeverity {
- GTEST_INFO,
- GTEST_WARNING,
- GTEST_ERROR,
- GTEST_FATAL
-};
-
-// Formats log entry severity, provides a stream object for streaming the
-// log message, and terminates the message with a newline when going out of
-// scope.
-class GTEST_API_ GTestLog {
- public:
- GTestLog(GTestLogSeverity severity, const char* file, int line);
-
- // Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
- ~GTestLog();
-
- ::std::ostream& GetStream() { return ::std::cerr; }
-
- private:
- const GTestLogSeverity severity_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestLog);
-};
-
-#if !defined(GTEST_LOG_)
-
-# define GTEST_LOG_(severity) \
- ::testing::internal::GTestLog(::testing::internal::GTEST_##severity, \
- __FILE__, __LINE__).GetStream()
-
-inline void LogToStderr() {}
-inline void FlushInfoLog() { fflush(nullptr); }
-
-#endif // !defined(GTEST_LOG_)
-
-#if !defined(GTEST_CHECK_)
-// INTERNAL IMPLEMENTATION - DO NOT USE.
-//
-// GTEST_CHECK_ is an all-mode assert. It aborts the program if the condition
-// is not satisfied.
-// Synopsis:
-// GTEST_CHECK_(boolean_condition);
-// or
-// GTEST_CHECK_(boolean_condition) << "Additional message";
-//
-// This checks the condition and if the condition is not satisfied
-// it prints message about the condition violation, including the
-// condition itself, plus additional message streamed into it, if any,
-// and then it aborts the program. It aborts the program irrespective of
-// whether it is built in the debug mode or not.
-# define GTEST_CHECK_(condition) \
- GTEST_AMBIGUOUS_ELSE_BLOCKER_ \
- if (::testing::internal::IsTrue(condition)) \
- ; \
- else \
- GTEST_LOG_(FATAL) << "Condition " #condition " failed. "
-#endif // !defined(GTEST_CHECK_)
-
-// An all-mode assert to verify that the given POSIX-style function
-// call returns 0 (indicating success). Known limitation: this
-// doesn't expand to a balanced 'if' statement, so enclose the macro
-// in {} if you need to use it as the only statement in an 'if'
-// branch.
-#define GTEST_CHECK_POSIX_SUCCESS_(posix_call) \
- if (const int gtest_error = (posix_call)) \
- GTEST_LOG_(FATAL) << #posix_call << "failed with error " \
- << gtest_error
-
-// Transforms "T" into "const T&" according to standard reference collapsing
-// rules (this is only needed as a backport for C++98 compilers that do not
-// support reference collapsing). Specifically, it transforms:
-//
-// char ==> const char&
-// const char ==> const char&
-// char& ==> char&
-// const char& ==> const char&
-//
-// Note that the non-const reference will not have "const" added. This is
-// standard, and necessary so that "T" can always bind to "const T&".
-template <typename T>
-struct ConstRef { typedef const T& type; };
-template <typename T>
-struct ConstRef<T&> { typedef T& type; };
-
-// The argument T must depend on some template parameters.
-#define GTEST_REFERENCE_TO_CONST_(T) \
- typename ::testing::internal::ConstRef<T>::type
-
-// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE.
-//
-// Use ImplicitCast_ as a safe version of static_cast for upcasting in
-// the type hierarchy (e.g. casting a Foo* to a SuperclassOfFoo* or a
-// const Foo*). When you use ImplicitCast_, the compiler checks that
-// the cast is safe. Such explicit ImplicitCast_s are necessary in
-// surprisingly many situations where C++ demands an exact type match
-// instead of an argument type convertible to a target type.
-//
-// The syntax for using ImplicitCast_ is the same as for static_cast:
-//
-// ImplicitCast_<ToType>(expr)
-//
-// ImplicitCast_ would have been part of the C++ standard library,
-// but the proposal was submitted too late. It will probably make
-// its way into the language in the future.
-//
-// This relatively ugly name is intentional. It prevents clashes with
-// similar functions users may have (e.g., implicit_cast). The internal
-// namespace alone is not enough because the function can be found by ADL.
-template<typename To>
-inline To ImplicitCast_(To x) { return x; }
-
-// When you upcast (that is, cast a pointer from type Foo to type
-// SuperclassOfFoo), it's fine to use ImplicitCast_<>, since upcasts
-// always succeed. When you downcast (that is, cast a pointer from
-// type Foo to type SubclassOfFoo), static_cast<> isn't safe, because
-// how do you know the pointer is really of type SubclassOfFoo? It
-// could be a bare Foo, or of type DifferentSubclassOfFoo. Thus,
-// when you downcast, you should use this macro. In debug mode, we
-// use dynamic_cast<> to double-check the downcast is legal (we die
-// if it's not). In normal mode, we do the efficient static_cast<>
-// instead. Thus, it's important to test in debug mode to make sure
-// the cast is legal!
-// This is the only place in the code we should use dynamic_cast<>.
-// In particular, you SHOULDN'T be using dynamic_cast<> in order to
-// do RTTI (eg code like this:
-// if (dynamic_cast<Subclass1>(foo)) HandleASubclass1Object(foo);
-// if (dynamic_cast<Subclass2>(foo)) HandleASubclass2Object(foo);
-// You should design the code some other way not to need this.
-//
-// This relatively ugly name is intentional. It prevents clashes with
-// similar functions users may have (e.g., down_cast). The internal
-// namespace alone is not enough because the function can be found by ADL.
-template<typename To, typename From> // use like this: DownCast_<T*>(foo);
-inline To DownCast_(From* f) { // so we only accept pointers
- // Ensures that To is a sub-type of From *. This test is here only
- // for compile-time type checking, and has no overhead in an
- // optimized build at run-time, as it will be optimized away
- // completely.
- GTEST_INTENTIONAL_CONST_COND_PUSH_()
- if (false) {
- GTEST_INTENTIONAL_CONST_COND_POP_()
- const To to = nullptr;
- ::testing::internal::ImplicitCast_<From*>(to);
- }
-
-#if GTEST_HAS_RTTI
- // RTTI: debug mode only!
- GTEST_CHECK_(f == nullptr || dynamic_cast<To>(f) != nullptr);
-#endif
- return static_cast<To>(f);
-}
-
-// Downcasts the pointer of type Base to Derived.
-// Derived must be a subclass of Base. The parameter MUST
-// point to a class of type Derived, not any subclass of it.
-// When RTTI is available, the function performs a runtime
-// check to enforce this.
-template <class Derived, class Base>
-Derived* CheckedDowncastToActualType(Base* base) {
-#if GTEST_HAS_RTTI
- GTEST_CHECK_(typeid(*base) == typeid(Derived));
-#endif
-
-#if GTEST_HAS_DOWNCAST_
- return ::down_cast<Derived*>(base);
-#elif GTEST_HAS_RTTI
- return dynamic_cast<Derived*>(base); // NOLINT
-#else
- return static_cast<Derived*>(base); // Poor man's downcast.
-#endif
-}
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Defines the stderr capturer:
-// CaptureStdout - starts capturing stdout.
-// GetCapturedStdout - stops capturing stdout and returns the captured string.
-// CaptureStderr - starts capturing stderr.
-// GetCapturedStderr - stops capturing stderr and returns the captured string.
-//
-GTEST_API_ void CaptureStdout();
-GTEST_API_ std::string GetCapturedStdout();
-GTEST_API_ void CaptureStderr();
-GTEST_API_ std::string GetCapturedStderr();
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-// Returns the size (in bytes) of a file.
-GTEST_API_ size_t GetFileSize(FILE* file);
-
-// Reads the entire content of a file as a string.
-GTEST_API_ std::string ReadEntireFile(FILE* file);
-
-// All command line arguments.
-GTEST_API_ std::vector<std::string> GetArgvs();
-
-#if GTEST_HAS_DEATH_TEST
-
-std::vector<std::string> GetInjectableArgvs();
-// Deprecated: pass the args vector by value instead.
-void SetInjectableArgvs(const std::vector<std::string>* new_argvs);
-void SetInjectableArgvs(const std::vector<std::string>& new_argvs);
-void ClearInjectableArgvs();
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Defines synchronization primitives.
-#if GTEST_IS_THREADSAFE
-
-# if GTEST_OS_WINDOWS
-// Provides leak-safe Windows kernel handle ownership.
-// Used in death tests and in threading support.
-class GTEST_API_ AutoHandle {
- public:
- // Assume that Win32 HANDLE type is equivalent to void*. Doing so allows us to
- // avoid including <windows.h> in this header file. Including <windows.h> is
- // undesirable because it defines a lot of symbols and macros that tend to
- // conflict with client code. This assumption is verified by
- // WindowsTypesTest.HANDLEIsVoidStar.
- typedef void* Handle;
- AutoHandle();
- explicit AutoHandle(Handle handle);
-
- ~AutoHandle();
-
- Handle Get() const;
- void Reset();
- void Reset(Handle handle);
-
- private:
- // Returns true if and only if the handle is a valid handle object that can be
- // closed.
- bool IsCloseable() const;
-
- Handle handle_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(AutoHandle);
-};
-# endif
-
-# if GTEST_HAS_NOTIFICATION_
-// Notification has already been imported into the namespace.
-// Nothing to do here.
-
-# else
-// Allows a controller thread to pause execution of newly created
-// threads until notified. Instances of this class must be created
-// and destroyed in the controller thread.
-//
-// This class is only for testing Google Test's own constructs. Do not
-// use it in user tests, either directly or indirectly.
-// TODO(b/203539622): Replace unconditionally with absl::Notification.
-class GTEST_API_ Notification {
- public:
- Notification() : notified_(false) {}
- Notification(const Notification&) = delete;
- Notification& operator=(const Notification&) = delete;
-
- // Notifies all threads created with this notification to start. Must
- // be called from the controller thread.
- void Notify() {
- std::lock_guard<std::mutex> lock(mu_);
- notified_ = true;
- cv_.notify_all();
- }
-
- // Blocks until the controller thread notifies. Must be called from a test
- // thread.
- void WaitForNotification() {
- std::unique_lock<std::mutex> lock(mu_);
- cv_.wait(lock, [this]() { return notified_; });
- }
-
- private:
- std::mutex mu_;
- std::condition_variable cv_;
- bool notified_;
-};
-# endif // GTEST_HAS_NOTIFICATION_
-
-// On MinGW, we can have both GTEST_OS_WINDOWS and GTEST_HAS_PTHREAD
-// defined, but we don't want to use MinGW's pthreads implementation, which
-// has conformance problems with some versions of the POSIX standard.
-# if GTEST_HAS_PTHREAD && !GTEST_OS_WINDOWS_MINGW
-
-// As a C-function, ThreadFuncWithCLinkage cannot be templated itself.
-// Consequently, it cannot select a correct instantiation of ThreadWithParam
-// in order to call its Run(). Introducing ThreadWithParamBase as a
-// non-templated base class for ThreadWithParam allows us to bypass this
-// problem.
-class ThreadWithParamBase {
- public:
- virtual ~ThreadWithParamBase() {}
- virtual void Run() = 0;
-};
-
-// pthread_create() accepts a pointer to a function type with the C linkage.
-// According to the Standard (7.5/1), function types with different linkages
-// are different even if they are otherwise identical. Some compilers (for
-// example, SunStudio) treat them as different types. Since class methods
-// cannot be defined with C-linkage we need to define a free C-function to
-// pass into pthread_create().
-extern "C" inline void* ThreadFuncWithCLinkage(void* thread) {
- static_cast<ThreadWithParamBase*>(thread)->Run();
- return nullptr;
-}
-
-// Helper class for testing Google Test's multi-threading constructs.
-// To use it, write:
-//
-// void ThreadFunc(int param) { /* Do things with param */ }
-// Notification thread_can_start;
-// ...
-// // The thread_can_start parameter is optional; you can supply NULL.
-// ThreadWithParam<int> thread(&ThreadFunc, 5, &thread_can_start);
-// thread_can_start.Notify();
-//
-// These classes are only for testing Google Test's own constructs. Do
-// not use them in user tests, either directly or indirectly.
-template <typename T>
-class ThreadWithParam : public ThreadWithParamBase {
- public:
- typedef void UserThreadFunc(T);
-
- ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
- : func_(func),
- param_(param),
- thread_can_start_(thread_can_start),
- finished_(false) {
- ThreadWithParamBase* const base = this;
- // The thread can be created only after all fields except thread_
- // have been initialized.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_create(&thread_, nullptr, &ThreadFuncWithCLinkage, base));
- }
- ~ThreadWithParam() override { Join(); }
-
- void Join() {
- if (!finished_) {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_join(thread_, nullptr));
- finished_ = true;
- }
- }
-
- void Run() override {
- if (thread_can_start_ != nullptr) thread_can_start_->WaitForNotification();
- func_(param_);
- }
-
- private:
- UserThreadFunc* const func_; // User-supplied thread function.
- const T param_; // User-supplied parameter to the thread function.
- // When non-NULL, used to block execution until the controller thread
- // notifies.
- Notification* const thread_can_start_;
- bool finished_; // true if and only if we know that the thread function has
- // finished.
- pthread_t thread_; // The native thread object.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
-};
-# endif // !GTEST_OS_WINDOWS && GTEST_HAS_PTHREAD ||
- // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
-
-# if GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
-// Mutex and ThreadLocal have already been imported into the namespace.
-// Nothing to do here.
-
-# elif GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
-
-// Mutex implements mutex on Windows platforms. It is used in conjunction
-// with class MutexLock:
-//
-// Mutex mutex;
-// ...
-// MutexLock lock(&mutex); // Acquires the mutex and releases it at the
-// // end of the current scope.
-//
-// A static Mutex *must* be defined or declared using one of the following
-// macros:
-// GTEST_DEFINE_STATIC_MUTEX_(g_some_mutex);
-// GTEST_DECLARE_STATIC_MUTEX_(g_some_mutex);
-//
-// (A non-static Mutex is defined/declared in the usual way).
-class GTEST_API_ Mutex {
- public:
- enum MutexType { kStatic = 0, kDynamic = 1 };
- // We rely on kStaticMutex being 0 as it is to what the linker initializes
- // type_ in static mutexes. critical_section_ will be initialized lazily
- // in ThreadSafeLazyInit().
- enum StaticConstructorSelector { kStaticMutex = 0 };
-
- // This constructor intentionally does nothing. It relies on type_ being
- // statically initialized to 0 (effectively setting it to kStatic) and on
- // ThreadSafeLazyInit() to lazily initialize the rest of the members.
- explicit Mutex(StaticConstructorSelector /*dummy*/) {}
-
- Mutex();
- ~Mutex();
-
- void Lock();
-
- void Unlock();
-
- // Does nothing if the current thread holds the mutex. Otherwise, crashes
- // with high probability.
- void AssertHeld();
-
- private:
- // Initializes owner_thread_id_ and critical_section_ in static mutexes.
- void ThreadSafeLazyInit();
-
- // Per https://blogs.msdn.microsoft.com/oldnewthing/20040223-00/?p=40503,
- // we assume that 0 is an invalid value for thread IDs.
- unsigned int owner_thread_id_;
-
- // For static mutexes, we rely on these members being initialized to zeros
- // by the linker.
- MutexType type_;
- long critical_section_init_phase_; // NOLINT
- GTEST_CRITICAL_SECTION* critical_section_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
-};
-
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::Mutex mutex
-
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::Mutex mutex(::testing::internal::Mutex::kStaticMutex)
-
-// We cannot name this class MutexLock because the ctor declaration would
-// conflict with a macro named MutexLock, which is defined on some
-// platforms. That macro is used as a defensive measure to prevent against
-// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
-// "MutexLock l(&mu)". Hence the typedef trick below.
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(Mutex* mutex)
- : mutex_(mutex) { mutex_->Lock(); }
-
- ~GTestMutexLock() { mutex_->Unlock(); }
-
- private:
- Mutex* const mutex_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
-};
-
-typedef GTestMutexLock MutexLock;
-
-// Base class for ValueHolder<T>. Allows a caller to hold and delete a value
-// without knowing its type.
-class ThreadLocalValueHolderBase {
- public:
- virtual ~ThreadLocalValueHolderBase() {}
-};
-
-// Provides a way for a thread to send notifications to a ThreadLocal
-// regardless of its parameter type.
-class ThreadLocalBase {
- public:
- // Creates a new ValueHolder<T> object holding a default value passed to
- // this ThreadLocal<T>'s constructor and returns it. It is the caller's
- // responsibility not to call this when the ThreadLocal<T> instance already
- // has a value on the current thread.
- virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const = 0;
-
- protected:
- ThreadLocalBase() {}
- virtual ~ThreadLocalBase() {}
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocalBase);
-};
-
-// Maps a thread to a set of ThreadLocals that have values instantiated on that
-// thread and notifies them when the thread exits. A ThreadLocal instance is
-// expected to persist until all threads it has values on have terminated.
-class GTEST_API_ ThreadLocalRegistry {
- public:
- // Registers thread_local_instance as having value on the current thread.
- // Returns a value that can be used to identify the thread from other threads.
- static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
- const ThreadLocalBase* thread_local_instance);
-
- // Invoked when a ThreadLocal instance is destroyed.
- static void OnThreadLocalDestroyed(
- const ThreadLocalBase* thread_local_instance);
-};
-
-class GTEST_API_ ThreadWithParamBase {
- public:
- void Join();
-
- protected:
- class Runnable {
- public:
- virtual ~Runnable() {}
- virtual void Run() = 0;
- };
-
- ThreadWithParamBase(Runnable *runnable, Notification* thread_can_start);
- virtual ~ThreadWithParamBase();
-
- private:
- AutoHandle thread_;
-};
-
-// Helper class for testing Google Test's multi-threading constructs.
-template <typename T>
-class ThreadWithParam : public ThreadWithParamBase {
- public:
- typedef void UserThreadFunc(T);
-
- ThreadWithParam(UserThreadFunc* func, T param, Notification* thread_can_start)
- : ThreadWithParamBase(new RunnableImpl(func, param), thread_can_start) {
- }
- virtual ~ThreadWithParam() {}
-
- private:
- class RunnableImpl : public Runnable {
- public:
- RunnableImpl(UserThreadFunc* func, T param)
- : func_(func),
- param_(param) {
- }
- virtual ~RunnableImpl() {}
- virtual void Run() {
- func_(param_);
- }
-
- private:
- UserThreadFunc* const func_;
- const T param_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(RunnableImpl);
- };
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParam);
-};
-
-// Implements thread-local storage on Windows systems.
-//
-// // Thread 1
-// ThreadLocal<int> tl(100); // 100 is the default value for each thread.
-//
-// // Thread 2
-// tl.set(150); // Changes the value for thread 2 only.
-// EXPECT_EQ(150, tl.get());
-//
-// // Thread 1
-// EXPECT_EQ(100, tl.get()); // In thread 1, tl has the original value.
-// tl.set(200);
-// EXPECT_EQ(200, tl.get());
-//
-// The template type argument T must have a public copy constructor.
-// In addition, the default ThreadLocal constructor requires T to have
-// a public default constructor.
-//
-// The users of a TheadLocal instance have to make sure that all but one
-// threads (including the main one) using that instance have exited before
-// destroying it. Otherwise, the per-thread objects managed for them by the
-// ThreadLocal instance are not guaranteed to be destroyed on all platforms.
-//
-// Google Test only uses global ThreadLocal objects. That means they
-// will die after main() has returned. Therefore, no per-thread
-// object managed by Google Test will be leaked as long as all threads
-// using Google Test have exited when main() returns.
-template <typename T>
-class ThreadLocal : public ThreadLocalBase {
- public:
- ThreadLocal() : default_factory_(new DefaultValueHolderFactory()) {}
- explicit ThreadLocal(const T& value)
- : default_factory_(new InstanceValueHolderFactory(value)) {}
-
- ~ThreadLocal() { ThreadLocalRegistry::OnThreadLocalDestroyed(this); }
-
- T* pointer() { return GetOrCreateValue(); }
- const T* pointer() const { return GetOrCreateValue(); }
- const T& get() const { return *pointer(); }
- void set(const T& value) { *pointer() = value; }
-
- private:
- // Holds a value of T. Can be deleted via its base class without the caller
- // knowing the type of T.
- class ValueHolder : public ThreadLocalValueHolderBase {
- public:
- ValueHolder() : value_() {}
- explicit ValueHolder(const T& value) : value_(value) {}
-
- T* pointer() { return &value_; }
-
- private:
- T value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
- };
-
-
- T* GetOrCreateValue() const {
- return static_cast<ValueHolder*>(
- ThreadLocalRegistry::GetValueOnCurrentThread(this))->pointer();
- }
-
- virtual ThreadLocalValueHolderBase* NewValueForCurrentThread() const {
- return default_factory_->MakeNewHolder();
- }
-
- class ValueHolderFactory {
- public:
- ValueHolderFactory() {}
- virtual ~ValueHolderFactory() {}
- virtual ValueHolder* MakeNewHolder() const = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
- };
-
- class DefaultValueHolderFactory : public ValueHolderFactory {
- public:
- DefaultValueHolderFactory() {}
- ValueHolder* MakeNewHolder() const override { return new ValueHolder(); }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
- };
-
- class InstanceValueHolderFactory : public ValueHolderFactory {
- public:
- explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
- ValueHolder* MakeNewHolder() const override {
- return new ValueHolder(value_);
- }
-
- private:
- const T value_; // The value for each thread.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
- };
-
- std::unique_ptr<ValueHolderFactory> default_factory_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
-};
-
-# elif GTEST_HAS_PTHREAD
-
-// MutexBase and Mutex implement mutex on pthreads-based platforms.
-class MutexBase {
- public:
- // Acquires this mutex.
- void Lock() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&mutex_));
- owner_ = pthread_self();
- has_owner_ = true;
- }
-
- // Releases this mutex.
- void Unlock() {
- // Since the lock is being released the owner_ field should no longer be
- // considered valid. We don't protect writing to has_owner_ here, as it's
- // the caller's responsibility to ensure that the current thread holds the
- // mutex when this is called.
- has_owner_ = false;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&mutex_));
- }
-
- // Does nothing if the current thread holds the mutex. Otherwise, crashes
- // with high probability.
- void AssertHeld() const {
- GTEST_CHECK_(has_owner_ && pthread_equal(owner_, pthread_self()))
- << "The current thread is not holding the mutex @" << this;
- }
-
- // A static mutex may be used before main() is entered. It may even
- // be used before the dynamic initialization stage. Therefore we
- // must be able to initialize a static mutex object at link time.
- // This means MutexBase has to be a POD and its member variables
- // have to be public.
- public:
- pthread_mutex_t mutex_; // The underlying pthread mutex.
- // has_owner_ indicates whether the owner_ field below contains a valid thread
- // ID and is therefore safe to inspect (e.g., to use in pthread_equal()). All
- // accesses to the owner_ field should be protected by a check of this field.
- // An alternative might be to memset() owner_ to all zeros, but there's no
- // guarantee that a zero'd pthread_t is necessarily invalid or even different
- // from pthread_self().
- bool has_owner_;
- pthread_t owner_; // The thread holding the mutex.
-};
-
-// Forward-declares a static mutex.
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::MutexBase mutex
-
-// Defines and statically (i.e. at link time) initializes a static mutex.
-// The initialization list here does not explicitly initialize each field,
-// instead relying on default initialization for the unspecified fields. In
-// particular, the owner_ field (a pthread_t) is not explicitly initialized.
-// This allows initialization to work whether pthread_t is a scalar or struct.
-// The flag -Wmissing-field-initializers must not be specified for this to work.
-#define GTEST_DEFINE_STATIC_MUTEX_(mutex) \
- ::testing::internal::MutexBase mutex = {PTHREAD_MUTEX_INITIALIZER, false, 0}
-
-// The Mutex class can only be used for mutexes created at runtime. It
-// shares its API with MutexBase otherwise.
-class Mutex : public MutexBase {
- public:
- Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_init(&mutex_, nullptr));
- has_owner_ = false;
- }
- ~Mutex() {
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&mutex_));
- }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(Mutex);
-};
-
-// We cannot name this class MutexLock because the ctor declaration would
-// conflict with a macro named MutexLock, which is defined on some
-// platforms. That macro is used as a defensive measure to prevent against
-// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
-// "MutexLock l(&mu)". Hence the typedef trick below.
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(MutexBase* mutex)
- : mutex_(mutex) { mutex_->Lock(); }
-
- ~GTestMutexLock() { mutex_->Unlock(); }
-
- private:
- MutexBase* const mutex_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(GTestMutexLock);
-};
-
-typedef GTestMutexLock MutexLock;
-
-// Helpers for ThreadLocal.
-
-// pthread_key_create() requires DeleteThreadLocalValue() to have
-// C-linkage. Therefore it cannot be templatized to access
-// ThreadLocal<T>. Hence the need for class
-// ThreadLocalValueHolderBase.
-class ThreadLocalValueHolderBase {
- public:
- virtual ~ThreadLocalValueHolderBase() {}
-};
-
-// Called by pthread to delete thread-local data stored by
-// pthread_setspecific().
-extern "C" inline void DeleteThreadLocalValue(void* value_holder) {
- delete static_cast<ThreadLocalValueHolderBase*>(value_holder);
-}
-
-// Implements thread-local storage on pthreads-based systems.
-template <typename T>
-class GTEST_API_ ThreadLocal {
- public:
- ThreadLocal()
- : key_(CreateKey()), default_factory_(new DefaultValueHolderFactory()) {}
- explicit ThreadLocal(const T& value)
- : key_(CreateKey()),
- default_factory_(new InstanceValueHolderFactory(value)) {}
-
- ~ThreadLocal() {
- // Destroys the managed object for the current thread, if any.
- DeleteThreadLocalValue(pthread_getspecific(key_));
-
- // Releases resources associated with the key. This will *not*
- // delete managed objects for other threads.
- GTEST_CHECK_POSIX_SUCCESS_(pthread_key_delete(key_));
- }
-
- T* pointer() { return GetOrCreateValue(); }
- const T* pointer() const { return GetOrCreateValue(); }
- const T& get() const { return *pointer(); }
- void set(const T& value) { *pointer() = value; }
-
- private:
- // Holds a value of type T.
- class ValueHolder : public ThreadLocalValueHolderBase {
- public:
- ValueHolder() : value_() {}
- explicit ValueHolder(const T& value) : value_(value) {}
-
- T* pointer() { return &value_; }
-
- private:
- T value_;
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolder);
- };
-
- static pthread_key_t CreateKey() {
- pthread_key_t key;
- // When a thread exits, DeleteThreadLocalValue() will be called on
- // the object managed for that thread.
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_key_create(&key, &DeleteThreadLocalValue));
- return key;
- }
-
- T* GetOrCreateValue() const {
- ThreadLocalValueHolderBase* const holder =
- static_cast<ThreadLocalValueHolderBase*>(pthread_getspecific(key_));
- if (holder != nullptr) {
- return CheckedDowncastToActualType<ValueHolder>(holder)->pointer();
- }
-
- ValueHolder* const new_holder = default_factory_->MakeNewHolder();
- ThreadLocalValueHolderBase* const holder_base = new_holder;
- GTEST_CHECK_POSIX_SUCCESS_(pthread_setspecific(key_, holder_base));
- return new_holder->pointer();
- }
-
- class ValueHolderFactory {
- public:
- ValueHolderFactory() {}
- virtual ~ValueHolderFactory() {}
- virtual ValueHolder* MakeNewHolder() const = 0;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ValueHolderFactory);
- };
-
- class DefaultValueHolderFactory : public ValueHolderFactory {
- public:
- DefaultValueHolderFactory() {}
- ValueHolder* MakeNewHolder() const override { return new ValueHolder(); }
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultValueHolderFactory);
- };
-
- class InstanceValueHolderFactory : public ValueHolderFactory {
- public:
- explicit InstanceValueHolderFactory(const T& value) : value_(value) {}
- ValueHolder* MakeNewHolder() const override {
- return new ValueHolder(value_);
- }
-
- private:
- const T value_; // The value for each thread.
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(InstanceValueHolderFactory);
- };
-
- // A key pthreads uses for looking up per-thread values.
- const pthread_key_t key_;
- std::unique_ptr<ValueHolderFactory> default_factory_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadLocal);
-};
-
-# endif // GTEST_HAS_MUTEX_AND_THREAD_LOCAL_
-
-#else // GTEST_IS_THREADSAFE
-
-// A dummy implementation of synchronization primitives (mutex, lock,
-// and thread-local variable). Necessary for compiling Google Test where
-// mutex is not supported - using Google Test in multiple threads is not
-// supported on such platforms.
-
-class Mutex {
- public:
- Mutex() {}
- void Lock() {}
- void Unlock() {}
- void AssertHeld() const {}
-};
-
-# define GTEST_DECLARE_STATIC_MUTEX_(mutex) \
- extern ::testing::internal::Mutex mutex
-
-# define GTEST_DEFINE_STATIC_MUTEX_(mutex) ::testing::internal::Mutex mutex
-
-// We cannot name this class MutexLock because the ctor declaration would
-// conflict with a macro named MutexLock, which is defined on some
-// platforms. That macro is used as a defensive measure to prevent against
-// inadvertent misuses of MutexLock like "MutexLock(&mu)" rather than
-// "MutexLock l(&mu)". Hence the typedef trick below.
-class GTestMutexLock {
- public:
- explicit GTestMutexLock(Mutex*) {} // NOLINT
-};
-
-typedef GTestMutexLock MutexLock;
-
-template <typename T>
-class GTEST_API_ ThreadLocal {
- public:
- ThreadLocal() : value_() {}
- explicit ThreadLocal(const T& value) : value_(value) {}
- T* pointer() { return &value_; }
- const T* pointer() const { return &value_; }
- const T& get() const { return value_; }
- void set(const T& value) { value_ = value; }
- private:
- T value_;
-};
-
-#endif // GTEST_IS_THREADSAFE
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-GTEST_API_ size_t GetThreadCount();
-
-#if GTEST_OS_WINDOWS
-# define GTEST_PATH_SEP_ "\\"
-# define GTEST_HAS_ALT_PATH_SEP_ 1
-#else
-# define GTEST_PATH_SEP_ "/"
-# define GTEST_HAS_ALT_PATH_SEP_ 0
-#endif // GTEST_OS_WINDOWS
-
-// Utilities for char.
-
-// isspace(int ch) and friends accept an unsigned char or EOF. char
-// may be signed, depending on the compiler (or compiler flags).
-// Therefore we need to cast a char to unsigned char before calling
-// isspace(), etc.
-
-inline bool IsAlpha(char ch) {
- return isalpha(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsAlNum(char ch) {
- return isalnum(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsDigit(char ch) {
- return isdigit(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsLower(char ch) {
- return islower(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsSpace(char ch) {
- return isspace(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsUpper(char ch) {
- return isupper(static_cast<unsigned char>(ch)) != 0;
-}
-inline bool IsXDigit(char ch) {
- return isxdigit(static_cast<unsigned char>(ch)) != 0;
-}
-#ifdef __cpp_char8_t
-inline bool IsXDigit(char8_t ch) {
- return isxdigit(static_cast<unsigned char>(ch)) != 0;
-}
-#endif
-inline bool IsXDigit(char16_t ch) {
- const unsigned char low_byte = static_cast<unsigned char>(ch);
- return ch == low_byte && isxdigit(low_byte) != 0;
-}
-inline bool IsXDigit(char32_t ch) {
- const unsigned char low_byte = static_cast<unsigned char>(ch);
- return ch == low_byte && isxdigit(low_byte) != 0;
-}
-inline bool IsXDigit(wchar_t ch) {
- const unsigned char low_byte = static_cast<unsigned char>(ch);
- return ch == low_byte && isxdigit(low_byte) != 0;
-}
-
-inline char ToLower(char ch) {
- return static_cast<char>(tolower(static_cast<unsigned char>(ch)));
-}
-inline char ToUpper(char ch) {
- return static_cast<char>(toupper(static_cast<unsigned char>(ch)));
-}
-
-inline std::string StripTrailingSpaces(std::string str) {
- std::string::iterator it = str.end();
- while (it != str.begin() && IsSpace(*--it))
- it = str.erase(it);
- return str;
-}
-
-// The testing::internal::posix namespace holds wrappers for common
-// POSIX functions. These wrappers hide the differences between
-// Windows/MSVC and POSIX systems. Since some compilers define these
-// standard functions as macros, the wrapper cannot have the same name
-// as the wrapped function.
-
-namespace posix {
-
-// Functions with a different name on Windows.
-
-#if GTEST_OS_WINDOWS
-
-typedef struct _stat StatStruct;
-
-# ifdef __BORLANDC__
-inline int DoIsATTY(int fd) { return isatty(fd); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-# else // !__BORLANDC__
-# if GTEST_OS_WINDOWS_MOBILE
-inline int DoIsATTY(int /* fd */) { return 0; }
-# else
-inline int DoIsATTY(int fd) { return _isatty(fd); }
-# endif // GTEST_OS_WINDOWS_MOBILE
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return _stricmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return _strdup(src); }
-# endif // __BORLANDC__
-
-# if GTEST_OS_WINDOWS_MOBILE
-inline int FileNo(FILE* file) { return reinterpret_cast<int>(_fileno(file)); }
-// Stat(), RmDir(), and IsDir() are not needed on Windows CE at this
-// time and thus not defined there.
-# else
-inline int FileNo(FILE* file) { return _fileno(file); }
-inline int Stat(const char* path, StatStruct* buf) { return _stat(path, buf); }
-inline int RmDir(const char* dir) { return _rmdir(dir); }
-inline bool IsDir(const StatStruct& st) {
- return (_S_IFDIR & st.st_mode) != 0;
-}
-# endif // GTEST_OS_WINDOWS_MOBILE
-
-#elif GTEST_OS_ESP8266
-typedef struct stat StatStruct;
-
-inline int FileNo(FILE* file) { return fileno(file); }
-inline int DoIsATTY(int fd) { return isatty(fd); }
-inline int Stat(const char* path, StatStruct* buf) {
- // stat function not implemented on ESP8266
- return 0;
-}
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return strcasecmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-inline int RmDir(const char* dir) { return rmdir(dir); }
-inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
-
-#else
-
-typedef struct stat StatStruct;
-
-inline int FileNo(FILE* file) { return fileno(file); }
-inline int DoIsATTY(int fd) { return isatty(fd); }
-inline int Stat(const char* path, StatStruct* buf) { return stat(path, buf); }
-inline int StrCaseCmp(const char* s1, const char* s2) {
- return strcasecmp(s1, s2);
-}
-inline char* StrDup(const char* src) { return strdup(src); }
-inline int RmDir(const char* dir) { return rmdir(dir); }
-inline bool IsDir(const StatStruct& st) { return S_ISDIR(st.st_mode); }
-
-#endif // GTEST_OS_WINDOWS
-
-inline int IsATTY(int fd) {
- // DoIsATTY might change errno (for example ENOTTY in case you redirect stdout
- // to a file on Linux), which is unexpected, so save the previous value, and
- // restore it after the call.
- int savedErrno = errno;
- int isAttyValue = DoIsATTY(fd);
- errno = savedErrno;
-
- return isAttyValue;
-}
-
-// Functions deprecated by MSVC 8.0.
-
-GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
-
-// ChDir(), FReopen(), FDOpen(), Read(), Write(), Close(), and
-// StrError() aren't needed on Windows CE at this time and thus not
-// defined there.
-
-#if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && \
- !GTEST_OS_WINDOWS_RT && !GTEST_OS_ESP8266 && !GTEST_OS_XTENSA
-inline int ChDir(const char* dir) { return chdir(dir); }
-#endif
-inline FILE* FOpen(const char* path, const char* mode) {
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
- struct wchar_codecvt : public std::codecvt<wchar_t, char, std::mbstate_t> {};
- std::wstring_convert<wchar_codecvt> converter;
- std::wstring wide_path = converter.from_bytes(path);
- std::wstring wide_mode = converter.from_bytes(mode);
- return _wfopen(wide_path.c_str(), wide_mode.c_str());
-#else // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
- return fopen(path, mode);
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
-}
-#if !GTEST_OS_WINDOWS_MOBILE
-inline FILE *FReopen(const char* path, const char* mode, FILE* stream) {
- return freopen(path, mode, stream);
-}
-inline FILE* FDOpen(int fd, const char* mode) { return fdopen(fd, mode); }
-#endif
-inline int FClose(FILE* fp) { return fclose(fp); }
-#if !GTEST_OS_WINDOWS_MOBILE
-inline int Read(int fd, void* buf, unsigned int count) {
- return static_cast<int>(read(fd, buf, count));
-}
-inline int Write(int fd, const void* buf, unsigned int count) {
- return static_cast<int>(write(fd, buf, count));
-}
-inline int Close(int fd) { return close(fd); }
-inline const char* StrError(int errnum) { return strerror(errnum); }
-#endif
-inline const char* GetEnv(const char* name) {
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
- GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_XTENSA
- // We are on an embedded platform, which has no environment variables.
- static_cast<void>(name); // To prevent 'unused argument' warning.
- return nullptr;
-#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
- // Environment variables which we programmatically clear will be set to the
- // empty string rather than unset (NULL). Handle that case.
- const char* const env = getenv(name);
- return (env != nullptr && env[0] != '\0') ? env : nullptr;
-#else
- return getenv(name);
-#endif
-}
-
-GTEST_DISABLE_MSC_DEPRECATED_POP_()
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Windows CE has no C library. The abort() function is used in
-// several places in Google Test. This implementation provides a reasonable
-// imitation of standard behaviour.
-[[noreturn]] void Abort();
-#else
-[[noreturn]] inline void Abort() { abort(); }
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-} // namespace posix
-
-// MSVC "deprecates" snprintf and issues warnings wherever it is used. In
-// order to avoid these warnings, we need to use _snprintf or _snprintf_s on
-// MSVC-based platforms. We map the GTEST_SNPRINTF_ macro to the appropriate
-// function in order to achieve that. We use macro definition here because
-// snprintf is a variadic function.
-#if _MSC_VER && !GTEST_OS_WINDOWS_MOBILE
-// MSVC 2005 and above support variadic macros.
-# define GTEST_SNPRINTF_(buffer, size, format, ...) \
- _snprintf_s(buffer, size, size, format, __VA_ARGS__)
-#elif defined(_MSC_VER)
-// Windows CE does not define _snprintf_s
-# define GTEST_SNPRINTF_ _snprintf
-#else
-# define GTEST_SNPRINTF_ snprintf
-#endif
-
-// The biggest signed integer type the compiler supports.
-//
-// long long is guaranteed to be at least 64-bits in C++11.
-using BiggestInt = long long; // NOLINT
-
-// The maximum number a BiggestInt can represent.
-constexpr BiggestInt kMaxBiggestInt = (std::numeric_limits<BiggestInt>::max)();
-
-// This template class serves as a compile-time function from size to
-// type. It maps a size in bytes to a primitive type with that
-// size. e.g.
-//
-// TypeWithSize<4>::UInt
-//
-// is typedef-ed to be unsigned int (unsigned integer made up of 4
-// bytes).
-//
-// Such functionality should belong to STL, but I cannot find it
-// there.
-//
-// Google Test uses this class in the implementation of floating-point
-// comparison.
-//
-// For now it only handles UInt (unsigned int) as that's all Google Test
-// needs. Other types can be easily added in the future if need
-// arises.
-template <size_t size>
-class TypeWithSize {
- public:
- // This prevents the user from using TypeWithSize<N> with incorrect
- // values of N.
- using UInt = void;
-};
-
-// The specialization for size 4.
-template <>
-class TypeWithSize<4> {
- public:
- using Int = std::int32_t;
- using UInt = std::uint32_t;
-};
-
-// The specialization for size 8.
-template <>
-class TypeWithSize<8> {
- public:
- using Int = std::int64_t;
- using UInt = std::uint64_t;
-};
-
-// Integer types of known sizes.
-using TimeInMillis = int64_t; // Represents time in milliseconds.
-
-// Utilities for command line flags and environment variables.
-
-// Macro for referencing flags.
-#if !defined(GTEST_FLAG)
-# define GTEST_FLAG(name) FLAGS_gtest_##name
-#endif // !defined(GTEST_FLAG)
-
-#if !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
-# define GTEST_USE_OWN_FLAGFILE_FLAG_ 1
-#endif // !defined(GTEST_USE_OWN_FLAGFILE_FLAG_)
-
-#if !defined(GTEST_DECLARE_bool_)
-# define GTEST_FLAG_SAVER_ ::testing::internal::GTestFlagSaver
-
-// Macros for declaring flags.
-#define GTEST_DECLARE_bool_(name) \
- namespace testing { \
- GTEST_API_ extern bool GTEST_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GTEST_DECLARE_int32_(name) \
- namespace testing { \
- GTEST_API_ extern std::int32_t GTEST_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GTEST_DECLARE_string_(name) \
- namespace testing { \
- GTEST_API_ extern ::std::string GTEST_FLAG(name); \
- } static_assert(true, "no-op to require trailing semicolon")
-
-// Macros for defining flags.
-#define GTEST_DEFINE_bool_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ bool GTEST_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GTEST_DEFINE_int32_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ std::int32_t GTEST_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-#define GTEST_DEFINE_string_(name, default_val, doc) \
- namespace testing { \
- GTEST_API_ ::std::string GTEST_FLAG(name) = (default_val); \
- } static_assert(true, "no-op to require trailing semicolon")
-
-#endif // !defined(GTEST_DECLARE_bool_)
-
-#if !defined(GTEST_FLAG_GET)
-#define GTEST_FLAG_GET(name) ::testing::GTEST_FLAG(name)
-#define GTEST_FLAG_SET(name, value) (void)(::testing::GTEST_FLAG(name) = value)
-#endif // !defined(GTEST_FLAG_GET)
-
-// Thread annotations
-#if !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
-# define GTEST_EXCLUSIVE_LOCK_REQUIRED_(locks)
-# define GTEST_LOCK_EXCLUDED_(locks)
-#endif // !defined(GTEST_EXCLUSIVE_LOCK_REQUIRED_)
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes the result
-// to *value and returns true; otherwise leaves *value unchanged and returns
-// false.
-GTEST_API_ bool ParseInt32(const Message& src_text, const char* str,
- int32_t* value);
-
-// Parses a bool/int32_t/string from the environment variable
-// corresponding to the given Google Test flag.
-bool BoolFromGTestEnv(const char* flag, bool default_val);
-GTEST_API_ int32_t Int32FromGTestEnv(const char* flag, int32_t default_val);
-std::string OutputFlagAlsoCheckEnvVar();
-const char* StringFromGTestEnv(const char* flag, const char* default_val);
-
-} // namespace internal
-} // namespace testing
-
-#if !defined(GTEST_INTERNAL_DEPRECATED)
-
-// Internal Macro to mark an API deprecated, for googletest usage only
-// Usage: class GTEST_INTERNAL_DEPRECATED(message) MyClass or
-// GTEST_INTERNAL_DEPRECATED(message) <return_type> myFunction(); Every usage of
-// a deprecated entity will trigger a warning when compiled with
-// `-Wdeprecated-declarations` option (clang, gcc, any __GNUC__ compiler).
-// For msvc /W3 option will need to be used
-// Note that for 'other' compilers this macro evaluates to nothing to prevent
-// compilations errors.
-#if defined(_MSC_VER)
-#define GTEST_INTERNAL_DEPRECATED(message) __declspec(deprecated(message))
-#elif defined(__GNUC__)
-#define GTEST_INTERNAL_DEPRECATED(message) __attribute__((deprecated(message)))
-#else
-#define GTEST_INTERNAL_DEPRECATED(message)
-#endif
-
-#endif // !defined(GTEST_INTERNAL_DEPRECATED)
-
-#if GTEST_HAS_ABSL
-// Always use absl::any for UniversalPrinter<> specializations if googletest
-// is built with absl support.
-#define GTEST_INTERNAL_HAS_ANY 1
-#include "absl/types/any.h"
-namespace testing {
-namespace internal {
-using Any = ::absl::any;
-} // namespace internal
-} // namespace testing
-#else
-#ifdef __has_include
-#if __has_include(<any>) && __cplusplus >= 201703L
-// Otherwise for C++17 and higher use std::any for UniversalPrinter<>
-// specializations.
-#define GTEST_INTERNAL_HAS_ANY 1
-#include <any>
-namespace testing {
-namespace internal {
-using Any = ::std::any;
-} // namespace internal
-} // namespace testing
-// The case where absl is configured NOT to alias std::any is not
-// supported.
-#endif // __has_include(<any>) && __cplusplus >= 201703L
-#endif // __has_include
-#endif // GTEST_HAS_ABSL
-
-#if GTEST_HAS_ABSL
-// Always use absl::optional for UniversalPrinter<> specializations if
-// googletest is built with absl support.
-#define GTEST_INTERNAL_HAS_OPTIONAL 1
-#include "absl/types/optional.h"
-namespace testing {
-namespace internal {
-template <typename T>
-using Optional = ::absl::optional<T>;
-inline ::absl::nullopt_t Nullopt() { return ::absl::nullopt; }
-} // namespace internal
-} // namespace testing
-#else
-#ifdef __has_include
-#if __has_include(<optional>) && __cplusplus >= 201703L
-// Otherwise for C++17 and higher use std::optional for UniversalPrinter<>
-// specializations.
-#define GTEST_INTERNAL_HAS_OPTIONAL 1
-#include <optional>
-namespace testing {
-namespace internal {
-template <typename T>
-using Optional = ::std::optional<T>;
-inline ::std::nullopt_t Nullopt() { return ::std::nullopt; }
-} // namespace internal
-} // namespace testing
-// The case where absl is configured NOT to alias std::optional is not
-// supported.
-#endif // __has_include(<optional>) && __cplusplus >= 201703L
-#endif // __has_include
-#endif // GTEST_HAS_ABSL
-
-#if GTEST_HAS_ABSL
-// Always use absl::string_view for Matcher<> specializations if googletest
-// is built with absl support.
-# define GTEST_INTERNAL_HAS_STRING_VIEW 1
-#include "absl/strings/string_view.h"
-namespace testing {
-namespace internal {
-using StringView = ::absl::string_view;
-} // namespace internal
-} // namespace testing
-#else
-# ifdef __has_include
-# if __has_include(<string_view>) && __cplusplus >= 201703L
-// Otherwise for C++17 and higher use std::string_view for Matcher<>
-// specializations.
-# define GTEST_INTERNAL_HAS_STRING_VIEW 1
-#include <string_view>
-namespace testing {
-namespace internal {
-using StringView = ::std::string_view;
-} // namespace internal
-} // namespace testing
-// The case where absl is configured NOT to alias std::string_view is not
-// supported.
-# endif // __has_include(<string_view>) && __cplusplus >= 201703L
-# endif // __has_include
-#endif // GTEST_HAS_ABSL
-
-#if GTEST_HAS_ABSL
-// Always use absl::variant for UniversalPrinter<> specializations if googletest
-// is built with absl support.
-#define GTEST_INTERNAL_HAS_VARIANT 1
-#include "absl/types/variant.h"
-namespace testing {
-namespace internal {
-template <typename... T>
-using Variant = ::absl::variant<T...>;
-} // namespace internal
-} // namespace testing
-#else
-#ifdef __has_include
-#if __has_include(<variant>) && __cplusplus >= 201703L
-// Otherwise for C++17 and higher use std::variant for UniversalPrinter<>
-// specializations.
-#define GTEST_INTERNAL_HAS_VARIANT 1
-#include <variant>
-namespace testing {
-namespace internal {
-template <typename... T>
-using Variant = ::std::variant<T...>;
-} // namespace internal
-} // namespace testing
-// The case where absl is configured NOT to alias std::variant is not supported.
-#endif // __has_include(<variant>) && __cplusplus >= 201703L
-#endif // __has_include
-#endif // GTEST_HAS_ABSL
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_PORT_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-string.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-string.h
deleted file mode 100644
index 4cb8e07cf9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-string.h
+++ /dev/null
@@ -1,177 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file declares the String class and functions used internally by
-// Google Test. They are subject to change without notice. They should not used
-// by code external to Google Test.
-//
-// This header file is #included by gtest-internal.h.
-// It should not be #included by other files.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
-
-#ifdef __BORLANDC__
-// string.h is not guaranteed to provide strcpy on C++ Builder.
-# include <mem.h>
-#endif
-
-#include <string.h>
-#include <cstdint>
-#include <string>
-
-#include "gtest/internal/gtest-port.h"
-
-namespace testing {
-namespace internal {
-
-// String - an abstract class holding static string utilities.
-class GTEST_API_ String {
- public:
- // Static utility methods
-
- // Clones a 0-terminated C string, allocating memory using new. The
- // caller is responsible for deleting the return value using
- // delete[]. Returns the cloned string, or NULL if the input is
- // NULL.
- //
- // This is different from strdup() in string.h, which allocates
- // memory using malloc().
- static const char* CloneCString(const char* c_str);
-
-#if GTEST_OS_WINDOWS_MOBILE
- // Windows CE does not have the 'ANSI' versions of Win32 APIs. To be
- // able to pass strings to Win32 APIs on CE we need to convert them
- // to 'Unicode', UTF-16.
-
- // Creates a UTF-16 wide string from the given ANSI string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the wide string, or NULL if the
- // input is NULL.
- //
- // The wide string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static LPCWSTR AnsiToUtf16(const char* c_str);
-
- // Creates an ANSI string from the given wide string, allocating
- // memory using new. The caller is responsible for deleting the return
- // value using delete[]. Returns the ANSI string, or NULL if the
- // input is NULL.
- //
- // The returned string is created using the ANSI codepage (CP_ACP) to
- // match the behaviour of the ANSI versions of Win32 calls and the
- // C runtime.
- static const char* Utf16ToAnsi(LPCWSTR utf16_str);
-#endif
-
- // Compares two C strings. Returns true if and only if they have the same
- // content.
- //
- // Unlike strcmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CStringEquals(const char* lhs, const char* rhs);
-
- // Converts a wide C string to a String using the UTF-8 encoding.
- // NULL will be converted to "(null)". If an error occurred during
- // the conversion, "(failed to convert from wide string)" is
- // returned.
- static std::string ShowWideCString(const wchar_t* wide_c_str);
-
- // Compares two wide C strings. Returns true if and only if they have the
- // same content.
- //
- // Unlike wcscmp(), this function can handle NULL argument(s). A
- // NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool WideCStringEquals(const wchar_t* lhs, const wchar_t* rhs);
-
- // Compares two C strings, ignoring case. Returns true if and only if
- // they have the same content.
- //
- // Unlike strcasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL C string,
- // including the empty string.
- static bool CaseInsensitiveCStringEquals(const char* lhs,
- const char* rhs);
-
- // Compares two wide C strings, ignoring case. Returns true if and only if
- // they have the same content.
- //
- // Unlike wcscasecmp(), this function can handle NULL argument(s).
- // A NULL C string is considered different to any non-NULL wide C string,
- // including the empty string.
- // NB: The implementations on different platforms slightly differ.
- // On windows, this method uses _wcsicmp which compares according to LC_CTYPE
- // environment variable. On GNU platform this method uses wcscasecmp
- // which compares according to LC_CTYPE category of the current locale.
- // On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
- // current locale.
- static bool CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs);
-
- // Returns true if and only if the given string ends with the given suffix,
- // ignoring case. Any string is considered to end with an empty suffix.
- static bool EndsWithCaseInsensitive(
- const std::string& str, const std::string& suffix);
-
- // Formats an int value as "%02d".
- static std::string FormatIntWidth2(int value); // "%02d" for width == 2
-
- // Formats an int value to given width with leading zeros.
- static std::string FormatIntWidthN(int value, int width);
-
- // Formats an int value as "%X".
- static std::string FormatHexInt(int value);
-
- // Formats an int value as "%X".
- static std::string FormatHexUInt32(uint32_t value);
-
- // Formats a byte as "%02X".
- static std::string FormatByte(unsigned char value);
-
- private:
- String(); // Not meant to be instantiated.
-}; // class String
-
-// Gets the content of the stringstream's buffer as an std::string. Each '\0'
-// character in the buffer is replaced with "\\0".
-GTEST_API_ std::string StringStreamToString(::std::stringstream* stream);
-
-} // namespace internal
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_STRING_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-type-util.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-type-util.h
deleted file mode 100644
index 665564a97a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/include/gtest/internal/gtest-type-util.h
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Type utilities needed for implementing typed and type-parameterized
-// tests.
-
-// IWYU pragma: private, include "gtest/gtest.h"
-// IWYU pragma: friend gtest/.*
-// IWYU pragma: friend gmock/.*
-
-#ifndef GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-#define GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
-
-#include "gtest/internal/gtest-port.h"
-
-// #ifdef __GNUC__ is too general here. It is possible to use gcc without using
-// libstdc++ (which is where cxxabi.h comes from).
-# if GTEST_HAS_CXXABI_H_
-# include <cxxabi.h>
-# elif defined(__HP_aCC)
-# include <acxx_demangle.h>
-# endif // GTEST_HASH_CXXABI_H_
-
-namespace testing {
-namespace internal {
-
-// Canonicalizes a given name with respect to the Standard C++ Library.
-// This handles removing the inline namespace within `std` that is
-// used by various standard libraries (e.g., `std::__1`). Names outside
-// of namespace std are returned unmodified.
-inline std::string CanonicalizeForStdLibVersioning(std::string s) {
- static const char prefix[] = "std::__";
- if (s.compare(0, strlen(prefix), prefix) == 0) {
- std::string::size_type end = s.find("::", strlen(prefix));
- if (end != s.npos) {
- // Erase everything between the initial `std` and the second `::`.
- s.erase(strlen("std"), end - strlen("std"));
- }
- }
- return s;
-}
-
-#if GTEST_HAS_RTTI
-// GetTypeName(const std::type_info&) returns a human-readable name of type T.
-inline std::string GetTypeName(const std::type_info& type) {
- const char* const name = type.name();
-#if GTEST_HAS_CXXABI_H_ || defined(__HP_aCC)
- int status = 0;
- // gcc's implementation of typeid(T).name() mangles the type name,
- // so we have to demangle it.
-#if GTEST_HAS_CXXABI_H_
- using abi::__cxa_demangle;
-#endif // GTEST_HAS_CXXABI_H_
- char* const readable_name = __cxa_demangle(name, nullptr, nullptr, &status);
- const std::string name_str(status == 0 ? readable_name : name);
- free(readable_name);
- return CanonicalizeForStdLibVersioning(name_str);
-#else
- return name;
-#endif // GTEST_HAS_CXXABI_H_ || __HP_aCC
-}
-#endif // GTEST_HAS_RTTI
-
-// GetTypeName<T>() returns a human-readable name of type T if and only if
-// RTTI is enabled, otherwise it returns a dummy type name.
-// NB: This function is also used in Google Mock, so don't move it inside of
-// the typed-test-only section below.
-template <typename T>
-std::string GetTypeName() {
-#if GTEST_HAS_RTTI
- return GetTypeName(typeid(T));
-#else
- return "<type>";
-#endif // GTEST_HAS_RTTI
-}
-
-// A unique type indicating an empty node
-struct None {};
-
-# define GTEST_TEMPLATE_ template <typename T> class
-
-// The template "selector" struct TemplateSel<Tmpl> is used to
-// represent Tmpl, which must be a class template with one type
-// parameter, as a type. TemplateSel<Tmpl>::Bind<T>::type is defined
-// as the type Tmpl<T>. This allows us to actually instantiate the
-// template "selected" by TemplateSel<Tmpl>.
-//
-// This trick is necessary for simulating typedef for class templates,
-// which C++ doesn't support directly.
-template <GTEST_TEMPLATE_ Tmpl>
-struct TemplateSel {
- template <typename T>
- struct Bind {
- typedef Tmpl<T> type;
- };
-};
-
-# define GTEST_BIND_(TmplSel, T) \
- TmplSel::template Bind<T>::type
-
-template <GTEST_TEMPLATE_ Head_, GTEST_TEMPLATE_... Tail_>
-struct Templates {
- using Head = TemplateSel<Head_>;
- using Tail = Templates<Tail_...>;
-};
-
-template <GTEST_TEMPLATE_ Head_>
-struct Templates<Head_> {
- using Head = TemplateSel<Head_>;
- using Tail = None;
-};
-
-// Tuple-like type lists
-template <typename Head_, typename... Tail_>
-struct Types {
- using Head = Head_;
- using Tail = Types<Tail_...>;
-};
-
-template <typename Head_>
-struct Types<Head_> {
- using Head = Head_;
- using Tail = None;
-};
-
-// Helper metafunctions to tell apart a single type from types
-// generated by ::testing::Types
-template <typename... Ts>
-struct ProxyTypeList {
- using type = Types<Ts...>;
-};
-
-template <typename>
-struct is_proxy_type_list : std::false_type {};
-
-template <typename... Ts>
-struct is_proxy_type_list<ProxyTypeList<Ts...>> : std::true_type {};
-
-// Generator which conditionally creates type lists.
-// It recognizes if a requested type list should be created
-// and prevents creating a new type list nested within another one.
-template <typename T>
-struct GenerateTypeList {
- private:
- using proxy = typename std::conditional<is_proxy_type_list<T>::value, T,
- ProxyTypeList<T>>::type;
-
- public:
- using type = typename proxy::type;
-};
-
-} // namespace internal
-
-template <typename... Ts>
-using Types = internal::ProxyTypeList<Ts...>;
-
-} // namespace testing
-
-#endif // GOOGLETEST_INCLUDE_GTEST_INTERNAL_GTEST_TYPE_UTIL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/prime_tables.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/prime_tables.h
deleted file mode 100644
index 3a10352baa..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/prime_tables.h
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-
-// This provides interface PrimeTable that determines whether a number is a
-// prime and determines a next prime number. This interface is used
-// in Google Test samples demonstrating use of parameterized tests.
-
-#ifndef GOOGLETEST_SAMPLES_PRIME_TABLES_H_
-#define GOOGLETEST_SAMPLES_PRIME_TABLES_H_
-
-#include <algorithm>
-
-// The prime table interface.
-class PrimeTable {
- public:
- virtual ~PrimeTable() {}
-
- // Returns true if and only if n is a prime number.
- virtual bool IsPrime(int n) const = 0;
-
- // Returns the smallest prime number greater than p; or returns -1
- // if the next prime is beyond the capacity of the table.
- virtual int GetNextPrime(int p) const = 0;
-};
-
-// Implementation #1 calculates the primes on-the-fly.
-class OnTheFlyPrimeTable : public PrimeTable {
- public:
- bool IsPrime(int n) const override {
- if (n <= 1) return false;
-
- for (int i = 2; i*i <= n; i++) {
- // n is divisible by an integer other than 1 and itself.
- if ((n % i) == 0) return false;
- }
-
- return true;
- }
-
- int GetNextPrime(int p) const override {
- if (p < 0) return -1;
-
- for (int n = p + 1;; n++) {
- if (IsPrime(n)) return n;
- }
- }
-};
-
-// Implementation #2 pre-calculates the primes and stores the result
-// in an array.
-class PreCalculatedPrimeTable : public PrimeTable {
- public:
- // 'max' specifies the maximum number the prime table holds.
- explicit PreCalculatedPrimeTable(int max)
- : is_prime_size_(max + 1), is_prime_(new bool[max + 1]) {
- CalculatePrimesUpTo(max);
- }
- ~PreCalculatedPrimeTable() override { delete[] is_prime_; }
-
- bool IsPrime(int n) const override {
- return 0 <= n && n < is_prime_size_ && is_prime_[n];
- }
-
- int GetNextPrime(int p) const override {
- for (int n = p + 1; n < is_prime_size_; n++) {
- if (is_prime_[n]) return n;
- }
-
- return -1;
- }
-
- private:
- void CalculatePrimesUpTo(int max) {
- ::std::fill(is_prime_, is_prime_ + is_prime_size_, true);
- is_prime_[0] = is_prime_[1] = false;
-
- // Checks every candidate for prime number (we know that 2 is the only even
- // prime).
- for (int i = 2; i*i <= max; i += i%2+1) {
- if (!is_prime_[i]) continue;
-
- // Marks all multiples of i (except i itself) as non-prime.
- // We are starting here from i-th multiplier, because all smaller
- // complex numbers were already marked.
- for (int j = i*i; j <= max; j += i) {
- is_prime_[j] = false;
- }
- }
- }
-
- const int is_prime_size_;
- bool* const is_prime_;
-
- // Disables compiler warning "assignment operator could not be generated."
- void operator=(const PreCalculatedPrimeTable& rhs);
-};
-
-#endif // GOOGLETEST_SAMPLES_PRIME_TABLES_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.cc
deleted file mode 100644
index 1d4275979f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.cc
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#include "sample1.h"
-
-// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
-int Factorial(int n) {
- int result = 1;
- for (int i = 1; i <= n; i++) {
- result *= i;
- }
-
- return result;
-}
-
-// Returns true if and only if n is a prime number.
-bool IsPrime(int n) {
- // Trivial case 1: small numbers
- if (n <= 1) return false;
-
- // Trivial case 2: even numbers
- if (n % 2 == 0) return n == 2;
-
- // Now, we have that n is odd and n >= 3.
-
- // Try to divide n by every odd number i, starting from 3
- for (int i = 3; ; i += 2) {
- // We only have to try i up to the square root of n
- if (i > n/i) break;
-
- // Now, we have i <= n/i < n.
- // If n is divisible by i, n is not prime.
- if (n % i == 0) return false;
- }
-
- // n has no integer factor in the range (1, n), and thus is prime.
- return true;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.h
deleted file mode 100644
index ba392cfbd2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#ifndef GOOGLETEST_SAMPLES_SAMPLE1_H_
-#define GOOGLETEST_SAMPLES_SAMPLE1_H_
-
-// Returns n! (the factorial of n). For negative n, n! is defined to be 1.
-int Factorial(int n);
-
-// Returns true if and only if n is a prime number.
-bool IsPrime(int n);
-
-#endif // GOOGLETEST_SAMPLES_SAMPLE1_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample10_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample10_unittest.cc
deleted file mode 100644
index 36cdac2279..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample10_unittest.cc
+++ /dev/null
@@ -1,139 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample shows how to use Google Test listener API to implement
-// a primitive leak checker.
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "gtest/gtest.h"
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-
-namespace {
-// We will track memory used by this class.
-class Water {
- public:
- // Normal Water declarations go here.
-
- // operator new and operator delete help us control water allocation.
- void* operator new(size_t allocation_size) {
- allocated_++;
- return malloc(allocation_size);
- }
-
- void operator delete(void* block, size_t /* allocation_size */) {
- allocated_--;
- free(block);
- }
-
- static int allocated() { return allocated_; }
-
- private:
- static int allocated_;
-};
-
-int Water::allocated_ = 0;
-
-// This event listener monitors how many Water objects are created and
-// destroyed by each test, and reports a failure if a test leaks some Water
-// objects. It does this by comparing the number of live Water objects at
-// the beginning of a test and at the end of a test.
-class LeakChecker : public EmptyTestEventListener {
- private:
- // Called before a test starts.
- void OnTestStart(const TestInfo& /* test_info */) override {
- initially_allocated_ = Water::allocated();
- }
-
- // Called after a test ends.
- void OnTestEnd(const TestInfo& /* test_info */) override {
- int difference = Water::allocated() - initially_allocated_;
-
- // You can generate a failure in any event handler except
- // OnTestPartResult. Just use an appropriate Google Test assertion to do
- // it.
- EXPECT_LE(difference, 0) << "Leaked " << difference << " unit(s) of Water!";
- }
-
- int initially_allocated_;
-};
-
-TEST(ListenersTest, DoesNotLeak) {
- Water* water = new Water;
- delete water;
-}
-
-// This should fail when the --check_for_leaks command line flag is
-// specified.
-TEST(ListenersTest, LeaksWater) {
- Water* water = new Water;
- EXPECT_TRUE(water != nullptr);
-}
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- bool check_for_leaks = false;
- if (argc > 1 && strcmp(argv[1], "--check_for_leaks") == 0 )
- check_for_leaks = true;
- else
- printf("%s\n", "Run this program with --check_for_leaks to enable "
- "custom leak checking in the tests.");
-
- // If we are given the --check_for_leaks command line flag, installs the
- // leak checker.
- if (check_for_leaks) {
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
-
- // Adds the leak checker to the end of the test event listener list,
- // after the default text output printer and the default XML report
- // generator.
- //
- // The order is important - it ensures that failures generated in the
- // leak checker's OnTestEnd() method are processed by the text and XML
- // printers *before* their OnTestEnd() methods are called, such that
- // they are attributed to the right test. Remember that a listener
- // receives an OnXyzStart event *after* listeners preceding it in the
- // list received that event, and receives an OnXyzEnd event *before*
- // listeners preceding it.
- //
- // We don't need to worry about deleting the new listener later, as
- // Google Test will do it.
- listeners.Append(new LeakChecker);
- }
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1_unittest.cc
deleted file mode 100644
index cb08b61a59..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample1_unittest.cc
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-// This sample shows how to write a simple unit test for a function,
-// using Google C++ testing framework.
-//
-// Writing a unit test using Google C++ testing framework is easy as 1-2-3:
-
-
-// Step 1. Include necessary header files such that the stuff your
-// test logic needs is declared.
-//
-// Don't forget gtest.h, which declares the testing framework.
-
-#include <limits.h>
-#include "sample1.h"
-#include "gtest/gtest.h"
-namespace {
-
-// Step 2. Use the TEST macro to define your tests.
-//
-// TEST has two parameters: the test case name and the test name.
-// After using the macro, you should define your test logic between a
-// pair of braces. You can use a bunch of macros to indicate the
-// success or failure of a test. EXPECT_TRUE and EXPECT_EQ are
-// examples of such macros. For a complete list, see gtest.h.
-//
-// <TechnicalDetails>
-//
-// In Google Test, tests are grouped into test cases. This is how we
-// keep test code organized. You should put logically related tests
-// into the same test case.
-//
-// The test case name and the test name should both be valid C++
-// identifiers. And you should not use underscore (_) in the names.
-//
-// Google Test guarantees that each test you define is run exactly
-// once, but it makes no guarantee on the order the tests are
-// executed. Therefore, you should write your tests in such a way
-// that their results don't depend on their order.
-//
-// </TechnicalDetails>
-
-
-// Tests Factorial().
-
-// Tests factorial of negative numbers.
-TEST(FactorialTest, Negative) {
- // This test is named "Negative", and belongs to the "FactorialTest"
- // test case.
- EXPECT_EQ(1, Factorial(-5));
- EXPECT_EQ(1, Factorial(-1));
- EXPECT_GT(Factorial(-10), 0);
-
- // <TechnicalDetails>
- //
- // EXPECT_EQ(expected, actual) is the same as
- //
- // EXPECT_TRUE((expected) == (actual))
- //
- // except that it will print both the expected value and the actual
- // value when the assertion fails. This is very helpful for
- // debugging. Therefore in this case EXPECT_EQ is preferred.
- //
- // On the other hand, EXPECT_TRUE accepts any Boolean expression,
- // and is thus more general.
- //
- // </TechnicalDetails>
-}
-
-// Tests factorial of 0.
-TEST(FactorialTest, Zero) {
- EXPECT_EQ(1, Factorial(0));
-}
-
-// Tests factorial of positive numbers.
-TEST(FactorialTest, Positive) {
- EXPECT_EQ(1, Factorial(1));
- EXPECT_EQ(2, Factorial(2));
- EXPECT_EQ(6, Factorial(3));
- EXPECT_EQ(40320, Factorial(8));
-}
-
-
-// Tests IsPrime()
-
-// Tests negative input.
-TEST(IsPrimeTest, Negative) {
- // This test belongs to the IsPrimeTest test case.
-
- EXPECT_FALSE(IsPrime(-1));
- EXPECT_FALSE(IsPrime(-2));
- EXPECT_FALSE(IsPrime(INT_MIN));
-}
-
-// Tests some trivial cases.
-TEST(IsPrimeTest, Trivial) {
- EXPECT_FALSE(IsPrime(0));
- EXPECT_FALSE(IsPrime(1));
- EXPECT_TRUE(IsPrime(2));
- EXPECT_TRUE(IsPrime(3));
-}
-
-// Tests positive input.
-TEST(IsPrimeTest, Positive) {
- EXPECT_FALSE(IsPrime(4));
- EXPECT_TRUE(IsPrime(5));
- EXPECT_FALSE(IsPrime(6));
- EXPECT_TRUE(IsPrime(23));
-}
-} // namespace
-
-// Step 3. Call RUN_ALL_TESTS() in main().
-//
-// We do this by linking in src/gtest_main.cc file, which consists of
-// a main() function which calls RUN_ALL_TESTS() for us.
-//
-// This runs all the tests you've defined, prints the result, and
-// returns 0 if successful, or 1 otherwise.
-//
-// Did you notice that we didn't register the tests? The
-// RUN_ALL_TESTS() macro magically knows about all the tests we
-// defined. Isn't this convenient?
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.cc
deleted file mode 100644
index d8e8723965..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#include "sample2.h"
-
-#include <string.h>
-
-// Clones a 0-terminated C string, allocating memory using new.
-const char* MyString::CloneCString(const char* a_c_string) {
- if (a_c_string == nullptr) return nullptr;
-
- const size_t len = strlen(a_c_string);
- char* const clone = new char[ len + 1 ];
- memcpy(clone, a_c_string, len + 1);
-
- return clone;
-}
-
-// Sets the 0-terminated C string this MyString object
-// represents.
-void MyString::Set(const char* a_c_string) {
- // Makes sure this works when c_string == c_string_
- const char* const temp = MyString::CloneCString(a_c_string);
- delete[] c_string_;
- c_string_ = temp;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.h
deleted file mode 100644
index 0f9868959d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#ifndef GOOGLETEST_SAMPLES_SAMPLE2_H_
-#define GOOGLETEST_SAMPLES_SAMPLE2_H_
-
-#include <string.h>
-
-
-// A simple string class.
-class MyString {
- private:
- const char* c_string_;
- const MyString& operator=(const MyString& rhs);
-
- public:
- // Clones a 0-terminated C string, allocating memory using new.
- static const char* CloneCString(const char* a_c_string);
-
- ////////////////////////////////////////////////////////////
- //
- // C'tors
-
- // The default c'tor constructs a NULL string.
- MyString() : c_string_(nullptr) {}
-
- // Constructs a MyString by cloning a 0-terminated C string.
- explicit MyString(const char* a_c_string) : c_string_(nullptr) {
- Set(a_c_string);
- }
-
- // Copy c'tor
- MyString(const MyString& string) : c_string_(nullptr) {
- Set(string.c_string_);
- }
-
- ////////////////////////////////////////////////////////////
- //
- // D'tor. MyString is intended to be a final class, so the d'tor
- // doesn't need to be virtual.
- ~MyString() { delete[] c_string_; }
-
- // Gets the 0-terminated C string this MyString object represents.
- const char* c_string() const { return c_string_; }
-
- size_t Length() const { return c_string_ == nullptr ? 0 : strlen(c_string_); }
-
- // Sets the 0-terminated C string this MyString object represents.
- void Set(const char* c_string);
-};
-
-#endif // GOOGLETEST_SAMPLES_SAMPLE2_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2_unittest.cc
deleted file mode 100644
index 41e31c1767..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample2_unittest.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-// This sample shows how to write a more complex unit test for a class
-// that has multiple member functions.
-//
-// Usually, it's a good idea to have one test for each method in your
-// class. You don't have to do that exactly, but it helps to keep
-// your tests organized. You may also throw in additional tests as
-// needed.
-
-#include "sample2.h"
-#include "gtest/gtest.h"
-namespace {
-// In this example, we test the MyString class (a simple string).
-
-// Tests the default c'tor.
-TEST(MyString, DefaultConstructor) {
- const MyString s;
-
- // Asserts that s.c_string() returns NULL.
- //
- // <TechnicalDetails>
- //
- // If we write NULL instead of
- //
- // static_cast<const char *>(NULL)
- //
- // in this assertion, it will generate a warning on gcc 3.4. The
- // reason is that EXPECT_EQ needs to know the types of its
- // arguments in order to print them when it fails. Since NULL is
- // #defined as 0, the compiler will use the formatter function for
- // int to print it. However, gcc thinks that NULL should be used as
- // a pointer, not an int, and therefore complains.
- //
- // The root of the problem is C++'s lack of distinction between the
- // integer number 0 and the null pointer constant. Unfortunately,
- // we have to live with this fact.
- //
- // </TechnicalDetails>
- EXPECT_STREQ(nullptr, s.c_string());
-
- EXPECT_EQ(0u, s.Length());
-}
-
-const char kHelloString[] = "Hello, world!";
-
-// Tests the c'tor that accepts a C string.
-TEST(MyString, ConstructorFromCString) {
- const MyString s(kHelloString);
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
- EXPECT_EQ(sizeof(kHelloString)/sizeof(kHelloString[0]) - 1,
- s.Length());
-}
-
-// Tests the copy c'tor.
-TEST(MyString, CopyConstructor) {
- const MyString s1(kHelloString);
- const MyString s2 = s1;
- EXPECT_EQ(0, strcmp(s2.c_string(), kHelloString));
-}
-
-// Tests the Set method.
-TEST(MyString, Set) {
- MyString s;
-
- s.Set(kHelloString);
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
-
- // Set should work when the input pointer is the same as the one
- // already in the MyString object.
- s.Set(s.c_string());
- EXPECT_EQ(0, strcmp(s.c_string(), kHelloString));
-
- // Can we set the MyString to NULL?
- s.Set(nullptr);
- EXPECT_STREQ(nullptr, s.c_string());
-}
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3-inl.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3-inl.h
deleted file mode 100644
index 659e0f0bb5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3-inl.h
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#ifndef GOOGLETEST_SAMPLES_SAMPLE3_INL_H_
-#define GOOGLETEST_SAMPLES_SAMPLE3_INL_H_
-
-#include <stddef.h>
-
-
-// Queue is a simple queue implemented as a singled-linked list.
-//
-// The element type must support copy constructor.
-template <typename E> // E is the element type
-class Queue;
-
-// QueueNode is a node in a Queue, which consists of an element of
-// type E and a pointer to the next node.
-template <typename E> // E is the element type
-class QueueNode {
- friend class Queue<E>;
-
- public:
- // Gets the element in this node.
- const E& element() const { return element_; }
-
- // Gets the next node in the queue.
- QueueNode* next() { return next_; }
- const QueueNode* next() const { return next_; }
-
- private:
- // Creates a node with a given element value. The next pointer is
- // set to NULL.
- explicit QueueNode(const E& an_element)
- : element_(an_element), next_(nullptr) {}
-
- // We disable the default assignment operator and copy c'tor.
- const QueueNode& operator = (const QueueNode&);
- QueueNode(const QueueNode&);
-
- E element_;
- QueueNode* next_;
-};
-
-template <typename E> // E is the element type.
-class Queue {
- public:
- // Creates an empty queue.
- Queue() : head_(nullptr), last_(nullptr), size_(0) {}
-
- // D'tor. Clears the queue.
- ~Queue() { Clear(); }
-
- // Clears the queue.
- void Clear() {
- if (size_ > 0) {
- // 1. Deletes every node.
- QueueNode<E>* node = head_;
- QueueNode<E>* next = node->next();
- for (; ;) {
- delete node;
- node = next;
- if (node == nullptr) break;
- next = node->next();
- }
-
- // 2. Resets the member variables.
- head_ = last_ = nullptr;
- size_ = 0;
- }
- }
-
- // Gets the number of elements.
- size_t Size() const { return size_; }
-
- // Gets the first element of the queue, or NULL if the queue is empty.
- QueueNode<E>* Head() { return head_; }
- const QueueNode<E>* Head() const { return head_; }
-
- // Gets the last element of the queue, or NULL if the queue is empty.
- QueueNode<E>* Last() { return last_; }
- const QueueNode<E>* Last() const { return last_; }
-
- // Adds an element to the end of the queue. A copy of the element is
- // created using the copy constructor, and then stored in the queue.
- // Changes made to the element in the queue doesn't affect the source
- // object, and vice versa.
- void Enqueue(const E& element) {
- QueueNode<E>* new_node = new QueueNode<E>(element);
-
- if (size_ == 0) {
- head_ = last_ = new_node;
- size_ = 1;
- } else {
- last_->next_ = new_node;
- last_ = new_node;
- size_++;
- }
- }
-
- // Removes the head of the queue and returns it. Returns NULL if
- // the queue is empty.
- E* Dequeue() {
- if (size_ == 0) {
- return nullptr;
- }
-
- const QueueNode<E>* const old_head = head_;
- head_ = head_->next_;
- size_--;
- if (size_ == 0) {
- last_ = nullptr;
- }
-
- E* element = new E(old_head->element());
- delete old_head;
-
- return element;
- }
-
- // Applies a function/functor on each element of the queue, and
- // returns the result in a new queue. The original queue is not
- // affected.
- template <typename F>
- Queue* Map(F function) const {
- Queue* new_queue = new Queue();
- for (const QueueNode<E>* node = head_; node != nullptr;
- node = node->next_) {
- new_queue->Enqueue(function(node->element()));
- }
-
- return new_queue;
- }
-
- private:
- QueueNode<E>* head_; // The first node of the queue.
- QueueNode<E>* last_; // The last node of the queue.
- size_t size_; // The number of elements in the queue.
-
- // We disallow copying a queue.
- Queue(const Queue&);
- const Queue& operator = (const Queue&);
-};
-
-#endif // GOOGLETEST_SAMPLES_SAMPLE3_INL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3_unittest.cc
deleted file mode 100644
index b19416d53c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample3_unittest.cc
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-// In this example, we use a more advanced feature of Google Test called
-// test fixture.
-//
-// A test fixture is a place to hold objects and functions shared by
-// all tests in a test case. Using a test fixture avoids duplicating
-// the test code necessary to initialize and cleanup those common
-// objects for each test. It is also useful for defining sub-routines
-// that your tests need to invoke a lot.
-//
-// <TechnicalDetails>
-//
-// The tests share the test fixture in the sense of code sharing, not
-// data sharing. Each test is given its own fresh copy of the
-// fixture. You cannot expect the data modified by one test to be
-// passed on to another test, which is a bad idea.
-//
-// The reason for this design is that tests should be independent and
-// repeatable. In particular, a test should not fail as the result of
-// another test's failure. If one test depends on info produced by
-// another test, then the two tests should really be one big test.
-//
-// The macros for indicating the success/failure of a test
-// (EXPECT_TRUE, FAIL, etc) need to know what the current test is
-// (when Google Test prints the test result, it tells you which test
-// each failure belongs to). Technically, these macros invoke a
-// member function of the Test class. Therefore, you cannot use them
-// in a global function. That's why you should put test sub-routines
-// in a test fixture.
-//
-// </TechnicalDetails>
-
-#include "sample3-inl.h"
-#include "gtest/gtest.h"
-namespace {
-// To use a test fixture, derive a class from testing::Test.
-class QueueTestSmpl3 : public testing::Test {
- protected: // You should make the members protected s.t. they can be
- // accessed from sub-classes.
-
- // virtual void SetUp() will be called before each test is run. You
- // should define it if you need to initialize the variables.
- // Otherwise, this can be skipped.
- void SetUp() override {
- q1_.Enqueue(1);
- q2_.Enqueue(2);
- q2_.Enqueue(3);
- }
-
- // virtual void TearDown() will be called after each test is run.
- // You should define it if there is cleanup work to do. Otherwise,
- // you don't have to provide it.
- //
- // virtual void TearDown() {
- // }
-
- // A helper function that some test uses.
- static int Double(int n) {
- return 2*n;
- }
-
- // A helper function for testing Queue::Map().
- void MapTester(const Queue<int> * q) {
- // Creates a new queue, where each element is twice as big as the
- // corresponding one in q.
- const Queue<int> * const new_q = q->Map(Double);
-
- // Verifies that the new queue has the same size as q.
- ASSERT_EQ(q->Size(), new_q->Size());
-
- // Verifies the relationship between the elements of the two queues.
- for (const QueueNode<int>*n1 = q->Head(), *n2 = new_q->Head();
- n1 != nullptr; n1 = n1->next(), n2 = n2->next()) {
- EXPECT_EQ(2 * n1->element(), n2->element());
- }
-
- delete new_q;
- }
-
- // Declares the variables your tests want to use.
- Queue<int> q0_;
- Queue<int> q1_;
- Queue<int> q2_;
-};
-
-// When you have a test fixture, you define a test using TEST_F
-// instead of TEST.
-
-// Tests the default c'tor.
-TEST_F(QueueTestSmpl3, DefaultConstructor) {
- // You can access data in the test fixture here.
- EXPECT_EQ(0u, q0_.Size());
-}
-
-// Tests Dequeue().
-TEST_F(QueueTestSmpl3, Dequeue) {
- int * n = q0_.Dequeue();
- EXPECT_TRUE(n == nullptr);
-
- n = q1_.Dequeue();
- ASSERT_TRUE(n != nullptr);
- EXPECT_EQ(1, *n);
- EXPECT_EQ(0u, q1_.Size());
- delete n;
-
- n = q2_.Dequeue();
- ASSERT_TRUE(n != nullptr);
- EXPECT_EQ(2, *n);
- EXPECT_EQ(1u, q2_.Size());
- delete n;
-}
-
-// Tests the Queue::Map() function.
-TEST_F(QueueTestSmpl3, Map) {
- MapTester(&q0_);
- MapTester(&q1_);
- MapTester(&q2_);
-}
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.cc
deleted file mode 100644
index b0ee6093b4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-
-#include <stdio.h>
-
-#include "sample4.h"
-
-// Returns the current counter value, and increments it.
-int Counter::Increment() {
- return counter_++;
-}
-
-// Returns the current counter value, and decrements it.
-// counter can not be less than 0, return 0 in this case
-int Counter::Decrement() {
- if (counter_ == 0) {
- return counter_;
- } else {
- return counter_--;
- }
-}
-
-// Prints the current counter value to STDOUT.
-void Counter::Print() const {
- printf("%d", counter_);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.h
deleted file mode 100644
index 0c4ed92e73..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4.h
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// A sample program demonstrating using Google C++ testing framework.
-#ifndef GOOGLETEST_SAMPLES_SAMPLE4_H_
-#define GOOGLETEST_SAMPLES_SAMPLE4_H_
-
-// A simple monotonic counter.
-class Counter {
- private:
- int counter_;
-
- public:
- // Creates a counter that starts at 0.
- Counter() : counter_(0) {}
-
- // Returns the current counter value, and increments it.
- int Increment();
-
- // Returns the current counter value, and decrements it.
- int Decrement();
-
- // Prints the current counter value to STDOUT.
- void Print() const;
-};
-
-#endif // GOOGLETEST_SAMPLES_SAMPLE4_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4_unittest.cc
deleted file mode 100644
index d5144c0d00..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample4_unittest.cc
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "sample4.h"
-#include "gtest/gtest.h"
-
-namespace {
-// Tests the Increment() method.
-
-TEST(Counter, Increment) {
- Counter c;
-
- // Test that counter 0 returns 0
- EXPECT_EQ(0, c.Decrement());
-
- // EXPECT_EQ() evaluates its arguments exactly once, so they
- // can have side effects.
-
- EXPECT_EQ(0, c.Increment());
- EXPECT_EQ(1, c.Increment());
- EXPECT_EQ(2, c.Increment());
-
- EXPECT_EQ(3, c.Decrement());
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample5_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample5_unittest.cc
deleted file mode 100644
index 0a21dd2157..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample5_unittest.cc
+++ /dev/null
@@ -1,196 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample teaches how to reuse a test fixture in multiple test
-// cases by deriving sub-fixtures from it.
-//
-// When you define a test fixture, you specify the name of the test
-// case that will use this fixture. Therefore, a test fixture can
-// be used by only one test case.
-//
-// Sometimes, more than one test cases may want to use the same or
-// slightly different test fixtures. For example, you may want to
-// make sure that all tests for a GUI library don't leak important
-// system resources like fonts and brushes. In Google Test, you do
-// this by putting the shared logic in a super (as in "super class")
-// test fixture, and then have each test case use a fixture derived
-// from this super fixture.
-
-#include <limits.h>
-#include <time.h>
-#include "gtest/gtest.h"
-#include "sample1.h"
-#include "sample3-inl.h"
-namespace {
-// In this sample, we want to ensure that every test finishes within
-// ~5 seconds. If a test takes longer to run, we consider it a
-// failure.
-//
-// We put the code for timing a test in a test fixture called
-// "QuickTest". QuickTest is intended to be the super fixture that
-// other fixtures derive from, therefore there is no test case with
-// the name "QuickTest". This is OK.
-//
-// Later, we will derive multiple test fixtures from QuickTest.
-class QuickTest : public testing::Test {
- protected:
- // Remember that SetUp() is run immediately before a test starts.
- // This is a good place to record the start time.
- void SetUp() override { start_time_ = time(nullptr); }
-
- // TearDown() is invoked immediately after a test finishes. Here we
- // check if the test was too slow.
- void TearDown() override {
- // Gets the time when the test finishes
- const time_t end_time = time(nullptr);
-
- // Asserts that the test took no more than ~5 seconds. Did you
- // know that you can use assertions in SetUp() and TearDown() as
- // well?
- EXPECT_TRUE(end_time - start_time_ <= 5) << "The test took too long.";
- }
-
- // The UTC time (in seconds) when the test starts
- time_t start_time_;
-};
-
-
-// We derive a fixture named IntegerFunctionTest from the QuickTest
-// fixture. All tests using this fixture will be automatically
-// required to be quick.
-class IntegerFunctionTest : public QuickTest {
- // We don't need any more logic than already in the QuickTest fixture.
- // Therefore the body is empty.
-};
-
-
-// Now we can write tests in the IntegerFunctionTest test case.
-
-// Tests Factorial()
-TEST_F(IntegerFunctionTest, Factorial) {
- // Tests factorial of negative numbers.
- EXPECT_EQ(1, Factorial(-5));
- EXPECT_EQ(1, Factorial(-1));
- EXPECT_GT(Factorial(-10), 0);
-
- // Tests factorial of 0.
- EXPECT_EQ(1, Factorial(0));
-
- // Tests factorial of positive numbers.
- EXPECT_EQ(1, Factorial(1));
- EXPECT_EQ(2, Factorial(2));
- EXPECT_EQ(6, Factorial(3));
- EXPECT_EQ(40320, Factorial(8));
-}
-
-
-// Tests IsPrime()
-TEST_F(IntegerFunctionTest, IsPrime) {
- // Tests negative input.
- EXPECT_FALSE(IsPrime(-1));
- EXPECT_FALSE(IsPrime(-2));
- EXPECT_FALSE(IsPrime(INT_MIN));
-
- // Tests some trivial cases.
- EXPECT_FALSE(IsPrime(0));
- EXPECT_FALSE(IsPrime(1));
- EXPECT_TRUE(IsPrime(2));
- EXPECT_TRUE(IsPrime(3));
-
- // Tests positive input.
- EXPECT_FALSE(IsPrime(4));
- EXPECT_TRUE(IsPrime(5));
- EXPECT_FALSE(IsPrime(6));
- EXPECT_TRUE(IsPrime(23));
-}
-
-
-// The next test case (named "QueueTest") also needs to be quick, so
-// we derive another fixture from QuickTest.
-//
-// The QueueTest test fixture has some logic and shared objects in
-// addition to what's in QuickTest already. We define the additional
-// stuff inside the body of the test fixture, as usual.
-class QueueTest : public QuickTest {
- protected:
- void SetUp() override {
- // First, we need to set up the super fixture (QuickTest).
- QuickTest::SetUp();
-
- // Second, some additional setup for this fixture.
- q1_.Enqueue(1);
- q2_.Enqueue(2);
- q2_.Enqueue(3);
- }
-
- // By default, TearDown() inherits the behavior of
- // QuickTest::TearDown(). As we have no additional cleaning work
- // for QueueTest, we omit it here.
- //
- // virtual void TearDown() {
- // QuickTest::TearDown();
- // }
-
- Queue<int> q0_;
- Queue<int> q1_;
- Queue<int> q2_;
-};
-
-
-// Now, let's write tests using the QueueTest fixture.
-
-// Tests the default constructor.
-TEST_F(QueueTest, DefaultConstructor) {
- EXPECT_EQ(0u, q0_.Size());
-}
-
-// Tests Dequeue().
-TEST_F(QueueTest, Dequeue) {
- int* n = q0_.Dequeue();
- EXPECT_TRUE(n == nullptr);
-
- n = q1_.Dequeue();
- EXPECT_TRUE(n != nullptr);
- EXPECT_EQ(1, *n);
- EXPECT_EQ(0u, q1_.Size());
- delete n;
-
- n = q2_.Dequeue();
- EXPECT_TRUE(n != nullptr);
- EXPECT_EQ(2, *n);
- EXPECT_EQ(1u, q2_.Size());
- delete n;
-}
-} // namespace
-// If necessary, you can derive further test fixtures from a derived
-// fixture itself. For example, you can derive another fixture from
-// QueueTest. Google Test imposes no limit on how deep the hierarchy
-// can be. In practice, however, you probably don't want it to be too
-// deep as to be confusing.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample6_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample6_unittest.cc
deleted file mode 100644
index da317eed5a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample6_unittest.cc
+++ /dev/null
@@ -1,217 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample shows how to test common properties of multiple
-// implementations of the same interface (aka interface tests).
-
-// The interface and its implementations are in this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-namespace {
-// First, we define some factory functions for creating instances of
-// the implementations. You may be able to skip this step if all your
-// implementations can be constructed the same way.
-
-template <class T>
-PrimeTable* CreatePrimeTable();
-
-template <>
-PrimeTable* CreatePrimeTable<OnTheFlyPrimeTable>() {
- return new OnTheFlyPrimeTable;
-}
-
-template <>
-PrimeTable* CreatePrimeTable<PreCalculatedPrimeTable>() {
- return new PreCalculatedPrimeTable(10000);
-}
-
-// Then we define a test fixture class template.
-template <class T>
-class PrimeTableTest : public testing::Test {
- protected:
- // The ctor calls the factory function to create a prime table
- // implemented by T.
- PrimeTableTest() : table_(CreatePrimeTable<T>()) {}
-
- ~PrimeTableTest() override { delete table_; }
-
- // Note that we test an implementation via the base interface
- // instead of the actual implementation class. This is important
- // for keeping the tests close to the real world scenario, where the
- // implementation is invoked via the base interface. It avoids
- // got-yas where the implementation class has a method that shadows
- // a method with the same name (but slightly different argument
- // types) in the base interface, for example.
- PrimeTable* const table_;
-};
-
-using testing::Types;
-
-// Google Test offers two ways for reusing tests for different types.
-// The first is called "typed tests". You should use it if you
-// already know *all* the types you are gonna exercise when you write
-// the tests.
-
-// To write a typed test case, first use
-//
-// TYPED_TEST_SUITE(TestCaseName, TypeList);
-//
-// to declare it and specify the type parameters. As with TEST_F,
-// TestCaseName must match the test fixture name.
-
-// The list of types we want to test.
-typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable> Implementations;
-
-TYPED_TEST_SUITE(PrimeTableTest, Implementations);
-
-// Then use TYPED_TEST(TestCaseName, TestName) to define a typed test,
-// similar to TEST_F.
-TYPED_TEST(PrimeTableTest, ReturnsFalseForNonPrimes) {
- // Inside the test body, you can refer to the type parameter by
- // TypeParam, and refer to the fixture class by TestFixture. We
- // don't need them in this example.
-
- // Since we are in the template world, C++ requires explicitly
- // writing 'this->' when referring to members of the fixture class.
- // This is something you have to learn to live with.
- EXPECT_FALSE(this->table_->IsPrime(-5));
- EXPECT_FALSE(this->table_->IsPrime(0));
- EXPECT_FALSE(this->table_->IsPrime(1));
- EXPECT_FALSE(this->table_->IsPrime(4));
- EXPECT_FALSE(this->table_->IsPrime(6));
- EXPECT_FALSE(this->table_->IsPrime(100));
-}
-
-TYPED_TEST(PrimeTableTest, ReturnsTrueForPrimes) {
- EXPECT_TRUE(this->table_->IsPrime(2));
- EXPECT_TRUE(this->table_->IsPrime(3));
- EXPECT_TRUE(this->table_->IsPrime(5));
- EXPECT_TRUE(this->table_->IsPrime(7));
- EXPECT_TRUE(this->table_->IsPrime(11));
- EXPECT_TRUE(this->table_->IsPrime(131));
-}
-
-TYPED_TEST(PrimeTableTest, CanGetNextPrime) {
- EXPECT_EQ(2, this->table_->GetNextPrime(0));
- EXPECT_EQ(3, this->table_->GetNextPrime(2));
- EXPECT_EQ(5, this->table_->GetNextPrime(3));
- EXPECT_EQ(7, this->table_->GetNextPrime(5));
- EXPECT_EQ(11, this->table_->GetNextPrime(7));
- EXPECT_EQ(131, this->table_->GetNextPrime(128));
-}
-
-// That's it! Google Test will repeat each TYPED_TEST for each type
-// in the type list specified in TYPED_TEST_SUITE. Sit back and be
-// happy that you don't have to define them multiple times.
-
-using testing::Types;
-
-// Sometimes, however, you don't yet know all the types that you want
-// to test when you write the tests. For example, if you are the
-// author of an interface and expect other people to implement it, you
-// might want to write a set of tests to make sure each implementation
-// conforms to some basic requirements, but you don't know what
-// implementations will be written in the future.
-//
-// How can you write the tests without committing to the type
-// parameters? That's what "type-parameterized tests" can do for you.
-// It is a bit more involved than typed tests, but in return you get a
-// test pattern that can be reused in many contexts, which is a big
-// win. Here's how you do it:
-
-// First, define a test fixture class template. Here we just reuse
-// the PrimeTableTest fixture defined earlier:
-
-template <class T>
-class PrimeTableTest2 : public PrimeTableTest<T> {
-};
-
-// Then, declare the test case. The argument is the name of the test
-// fixture, and also the name of the test case (as usual). The _P
-// suffix is for "parameterized" or "pattern".
-TYPED_TEST_SUITE_P(PrimeTableTest2);
-
-// Next, use TYPED_TEST_P(TestCaseName, TestName) to define a test,
-// similar to what you do with TEST_F.
-TYPED_TEST_P(PrimeTableTest2, ReturnsFalseForNonPrimes) {
- EXPECT_FALSE(this->table_->IsPrime(-5));
- EXPECT_FALSE(this->table_->IsPrime(0));
- EXPECT_FALSE(this->table_->IsPrime(1));
- EXPECT_FALSE(this->table_->IsPrime(4));
- EXPECT_FALSE(this->table_->IsPrime(6));
- EXPECT_FALSE(this->table_->IsPrime(100));
-}
-
-TYPED_TEST_P(PrimeTableTest2, ReturnsTrueForPrimes) {
- EXPECT_TRUE(this->table_->IsPrime(2));
- EXPECT_TRUE(this->table_->IsPrime(3));
- EXPECT_TRUE(this->table_->IsPrime(5));
- EXPECT_TRUE(this->table_->IsPrime(7));
- EXPECT_TRUE(this->table_->IsPrime(11));
- EXPECT_TRUE(this->table_->IsPrime(131));
-}
-
-TYPED_TEST_P(PrimeTableTest2, CanGetNextPrime) {
- EXPECT_EQ(2, this->table_->GetNextPrime(0));
- EXPECT_EQ(3, this->table_->GetNextPrime(2));
- EXPECT_EQ(5, this->table_->GetNextPrime(3));
- EXPECT_EQ(7, this->table_->GetNextPrime(5));
- EXPECT_EQ(11, this->table_->GetNextPrime(7));
- EXPECT_EQ(131, this->table_->GetNextPrime(128));
-}
-
-// Type-parameterized tests involve one extra step: you have to
-// enumerate the tests you defined:
-REGISTER_TYPED_TEST_SUITE_P(
- PrimeTableTest2, // The first argument is the test case name.
- // The rest of the arguments are the test names.
- ReturnsFalseForNonPrimes, ReturnsTrueForPrimes, CanGetNextPrime);
-
-// At this point the test pattern is done. However, you don't have
-// any real test yet as you haven't said which types you want to run
-// the tests with.
-
-// To turn the abstract test pattern into real tests, you instantiate
-// it with a list of types. Usually the test pattern will be defined
-// in a .h file, and anyone can #include and instantiate it. You can
-// even instantiate it more than once in the same program. To tell
-// different instances apart, you give each of them a name, which will
-// become part of the test case name and can be used in test filters.
-
-// The list of types we want to test. Note that it doesn't have to be
-// defined at the time we write the TYPED_TEST_P()s.
-typedef Types<OnTheFlyPrimeTable, PreCalculatedPrimeTable>
- PrimeTableImplementations;
-INSTANTIATE_TYPED_TEST_SUITE_P(OnTheFlyAndPreCalculated, // Instance name
- PrimeTableTest2, // Test case name
- PrimeTableImplementations); // Type list
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample7_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample7_unittest.cc
deleted file mode 100644
index e0efc29e4a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample7_unittest.cc
+++ /dev/null
@@ -1,117 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample shows how to test common properties of multiple
-// implementations of an interface (aka interface tests) using
-// value-parameterized tests. Each test in the test case has
-// a parameter that is an interface pointer to an implementation
-// tested.
-
-// The interface and its implementations are in this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-namespace {
-
-using ::testing::TestWithParam;
-using ::testing::Values;
-
-// As a general rule, to prevent a test from affecting the tests that come
-// after it, you should create and destroy the tested objects for each test
-// instead of reusing them. In this sample we will define a simple factory
-// function for PrimeTable objects. We will instantiate objects in test's
-// SetUp() method and delete them in TearDown() method.
-typedef PrimeTable* CreatePrimeTableFunc();
-
-PrimeTable* CreateOnTheFlyPrimeTable() {
- return new OnTheFlyPrimeTable();
-}
-
-template <size_t max_precalculated>
-PrimeTable* CreatePreCalculatedPrimeTable() {
- return new PreCalculatedPrimeTable(max_precalculated);
-}
-
-// Inside the test body, fixture constructor, SetUp(), and TearDown() you
-// can refer to the test parameter by GetParam(). In this case, the test
-// parameter is a factory function which we call in fixture's SetUp() to
-// create and store an instance of PrimeTable.
-class PrimeTableTestSmpl7 : public TestWithParam<CreatePrimeTableFunc*> {
- public:
- ~PrimeTableTestSmpl7() override { delete table_; }
- void SetUp() override { table_ = (*GetParam())(); }
- void TearDown() override {
- delete table_;
- table_ = nullptr;
- }
-
- protected:
- PrimeTable* table_;
-};
-
-TEST_P(PrimeTableTestSmpl7, ReturnsFalseForNonPrimes) {
- EXPECT_FALSE(table_->IsPrime(-5));
- EXPECT_FALSE(table_->IsPrime(0));
- EXPECT_FALSE(table_->IsPrime(1));
- EXPECT_FALSE(table_->IsPrime(4));
- EXPECT_FALSE(table_->IsPrime(6));
- EXPECT_FALSE(table_->IsPrime(100));
-}
-
-TEST_P(PrimeTableTestSmpl7, ReturnsTrueForPrimes) {
- EXPECT_TRUE(table_->IsPrime(2));
- EXPECT_TRUE(table_->IsPrime(3));
- EXPECT_TRUE(table_->IsPrime(5));
- EXPECT_TRUE(table_->IsPrime(7));
- EXPECT_TRUE(table_->IsPrime(11));
- EXPECT_TRUE(table_->IsPrime(131));
-}
-
-TEST_P(PrimeTableTestSmpl7, CanGetNextPrime) {
- EXPECT_EQ(2, table_->GetNextPrime(0));
- EXPECT_EQ(3, table_->GetNextPrime(2));
- EXPECT_EQ(5, table_->GetNextPrime(3));
- EXPECT_EQ(7, table_->GetNextPrime(5));
- EXPECT_EQ(11, table_->GetNextPrime(7));
- EXPECT_EQ(131, table_->GetNextPrime(128));
-}
-
-// In order to run value-parameterized tests, you need to instantiate them,
-// or bind them to a list of values which will be used as test parameters.
-// You can instantiate them in a different translation module, or even
-// instantiate them several times.
-//
-// Here, we instantiate our tests with a list of two PrimeTable object
-// factory functions:
-INSTANTIATE_TEST_SUITE_P(OnTheFlyAndPreCalculated, PrimeTableTestSmpl7,
- Values(&CreateOnTheFlyPrimeTable,
- &CreatePreCalculatedPrimeTable<1000>));
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample8_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample8_unittest.cc
deleted file mode 100644
index 10488b0ea4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample8_unittest.cc
+++ /dev/null
@@ -1,154 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample shows how to test code relying on some global flag variables.
-// Combine() helps with generating all possible combinations of such flags,
-// and each test is given one combination as a parameter.
-
-// Use class definitions to test from this header.
-#include "prime_tables.h"
-
-#include "gtest/gtest.h"
-namespace {
-
-// Suppose we want to introduce a new, improved implementation of PrimeTable
-// which combines speed of PrecalcPrimeTable and versatility of
-// OnTheFlyPrimeTable (see prime_tables.h). Inside it instantiates both
-// PrecalcPrimeTable and OnTheFlyPrimeTable and uses the one that is more
-// appropriate under the circumstances. But in low memory conditions, it can be
-// told to instantiate without PrecalcPrimeTable instance at all and use only
-// OnTheFlyPrimeTable.
-class HybridPrimeTable : public PrimeTable {
- public:
- HybridPrimeTable(bool force_on_the_fly, int max_precalculated)
- : on_the_fly_impl_(new OnTheFlyPrimeTable),
- precalc_impl_(force_on_the_fly
- ? nullptr
- : new PreCalculatedPrimeTable(max_precalculated)),
- max_precalculated_(max_precalculated) {}
- ~HybridPrimeTable() override {
- delete on_the_fly_impl_;
- delete precalc_impl_;
- }
-
- bool IsPrime(int n) const override {
- if (precalc_impl_ != nullptr && n < max_precalculated_)
- return precalc_impl_->IsPrime(n);
- else
- return on_the_fly_impl_->IsPrime(n);
- }
-
- int GetNextPrime(int p) const override {
- int next_prime = -1;
- if (precalc_impl_ != nullptr && p < max_precalculated_)
- next_prime = precalc_impl_->GetNextPrime(p);
-
- return next_prime != -1 ? next_prime : on_the_fly_impl_->GetNextPrime(p);
- }
-
- private:
- OnTheFlyPrimeTable* on_the_fly_impl_;
- PreCalculatedPrimeTable* precalc_impl_;
- int max_precalculated_;
-};
-
-using ::testing::TestWithParam;
-using ::testing::Bool;
-using ::testing::Values;
-using ::testing::Combine;
-
-// To test all code paths for HybridPrimeTable we must test it with numbers
-// both within and outside PreCalculatedPrimeTable's capacity and also with
-// PreCalculatedPrimeTable disabled. We do this by defining fixture which will
-// accept different combinations of parameters for instantiating a
-// HybridPrimeTable instance.
-class PrimeTableTest : public TestWithParam< ::std::tuple<bool, int> > {
- protected:
- void SetUp() override {
- bool force_on_the_fly;
- int max_precalculated;
- std::tie(force_on_the_fly, max_precalculated) = GetParam();
- table_ = new HybridPrimeTable(force_on_the_fly, max_precalculated);
- }
- void TearDown() override {
- delete table_;
- table_ = nullptr;
- }
- HybridPrimeTable* table_;
-};
-
-TEST_P(PrimeTableTest, ReturnsFalseForNonPrimes) {
- // Inside the test body, you can refer to the test parameter by GetParam().
- // In this case, the test parameter is a PrimeTable interface pointer which
- // we can use directly.
- // Please note that you can also save it in the fixture's SetUp() method
- // or constructor and use saved copy in the tests.
-
- EXPECT_FALSE(table_->IsPrime(-5));
- EXPECT_FALSE(table_->IsPrime(0));
- EXPECT_FALSE(table_->IsPrime(1));
- EXPECT_FALSE(table_->IsPrime(4));
- EXPECT_FALSE(table_->IsPrime(6));
- EXPECT_FALSE(table_->IsPrime(100));
-}
-
-TEST_P(PrimeTableTest, ReturnsTrueForPrimes) {
- EXPECT_TRUE(table_->IsPrime(2));
- EXPECT_TRUE(table_->IsPrime(3));
- EXPECT_TRUE(table_->IsPrime(5));
- EXPECT_TRUE(table_->IsPrime(7));
- EXPECT_TRUE(table_->IsPrime(11));
- EXPECT_TRUE(table_->IsPrime(131));
-}
-
-TEST_P(PrimeTableTest, CanGetNextPrime) {
- EXPECT_EQ(2, table_->GetNextPrime(0));
- EXPECT_EQ(3, table_->GetNextPrime(2));
- EXPECT_EQ(5, table_->GetNextPrime(3));
- EXPECT_EQ(7, table_->GetNextPrime(5));
- EXPECT_EQ(11, table_->GetNextPrime(7));
- EXPECT_EQ(131, table_->GetNextPrime(128));
-}
-
-// In order to run value-parameterized tests, you need to instantiate them,
-// or bind them to a list of values which will be used as test parameters.
-// You can instantiate them in a different translation module, or even
-// instantiate them several times.
-//
-// Here, we instantiate our tests with a list of parameters. We must combine
-// all variations of the boolean flag suppressing PrecalcPrimeTable and some
-// meaningful values for tests. We choose a small value (1), and a value that
-// will put some of the tested numbers beyond the capability of the
-// PrecalcPrimeTable instance and some inside it (10). Combine will produce all
-// possible combinations.
-INSTANTIATE_TEST_SUITE_P(MeaningfulTestParameters, PrimeTableTest,
- Combine(Bool(), Values(1, 10)));
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample9_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample9_unittest.cc
deleted file mode 100644
index e502d08d73..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/samples/sample9_unittest.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2009 Google Inc. All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This sample shows how to use Google Test listener API to implement
-// an alternative console output and how to use the UnitTest reflection API
-// to enumerate test cases and tests and to inspect their results.
-
-#include <stdio.h>
-
-#include "gtest/gtest.h"
-
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestCase;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-namespace {
-// Provides alternative output mode which produces minimal amount of
-// information about tests.
-class TersePrinter : public EmptyTestEventListener {
- private:
- // Called before any test activity starts.
- void OnTestProgramStart(const UnitTest& /* unit_test */) override {}
-
- // Called after all test activities have ended.
- void OnTestProgramEnd(const UnitTest& unit_test) override {
- fprintf(stdout, "TEST %s\n", unit_test.Passed() ? "PASSED" : "FAILED");
- fflush(stdout);
- }
-
- // Called before a test starts.
- void OnTestStart(const TestInfo& test_info) override {
- fprintf(stdout,
- "*** Test %s.%s starting.\n",
- test_info.test_case_name(),
- test_info.name());
- fflush(stdout);
- }
-
- // Called after a failed assertion or a SUCCEED() invocation.
- void OnTestPartResult(const TestPartResult& test_part_result) override {
- fprintf(stdout,
- "%s in %s:%d\n%s\n",
- test_part_result.failed() ? "*** Failure" : "Success",
- test_part_result.file_name(),
- test_part_result.line_number(),
- test_part_result.summary());
- fflush(stdout);
- }
-
- // Called after a test ends.
- void OnTestEnd(const TestInfo& test_info) override {
- fprintf(stdout,
- "*** Test %s.%s ending.\n",
- test_info.test_case_name(),
- test_info.name());
- fflush(stdout);
- }
-}; // class TersePrinter
-
-TEST(CustomOutputTest, PrintsMessage) {
- printf("Printing something from the test body...\n");
-}
-
-TEST(CustomOutputTest, Succeeds) {
- SUCCEED() << "SUCCEED() has been invoked from here";
-}
-
-TEST(CustomOutputTest, Fails) {
- EXPECT_EQ(1, 2)
- << "This test fails in order to demonstrate alternative failure messages";
-}
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- bool terse_output = false;
- if (argc > 1 && strcmp(argv[1], "--terse_output") == 0 )
- terse_output = true;
- else
- printf("%s\n", "Run this program with --terse_output to change the way "
- "it prints its output.");
-
- UnitTest& unit_test = *UnitTest::GetInstance();
-
- // If we are given the --terse_output command line flag, suppresses the
- // standard output and attaches own result printer.
- if (terse_output) {
- TestEventListeners& listeners = unit_test.listeners();
-
- // Removes the default console output listener from the list so it will
- // not receive events from Google Test and won't print any output. Since
- // this operation transfers ownership of the listener to the caller we
- // have to delete it as well.
- delete listeners.Release(listeners.default_result_printer());
-
- // Adds the custom output listener to the list. It will now receive
- // events from Google Test and print the alternative output. We don't
- // have to worry about deleting it since Google Test assumes ownership
- // over it after adding it to the list.
- listeners.Append(new TersePrinter);
- }
- int ret_val = RUN_ALL_TESTS();
-
- // This is an example of using the UnitTest reflection API to inspect test
- // results. Here we discount failures from the tests we expected to fail.
- int unexpectedly_failed_tests = 0;
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- const testing::TestSuite& test_suite = *unit_test.GetTestSuite(i);
- for (int j = 0; j < test_suite.total_test_count(); ++j) {
- const TestInfo& test_info = *test_suite.GetTestInfo(j);
- // Counts failed tests that were not meant to fail (those without
- // 'Fails' in the name).
- if (test_info.result()->Failed() &&
- strcmp(test_info.name(), "Fails") != 0) {
- unexpectedly_failed_tests++;
- }
- }
- }
-
- // Test that were meant to fail should not affect the test program outcome.
- if (unexpectedly_failed_tests == 0)
- ret_val = 0;
-
- return ret_val;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-all.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-all.cc
deleted file mode 100644
index 29eba165e4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-all.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Google C++ Testing and Mocking Framework (Google Test)
-//
-// Sometimes it's desirable to build Google Test by compiling a single file.
-// This file serves this purpose.
-
-// This line ensures that gtest.h can be compiled on its own, even
-// when it's fused.
-#include "gtest/gtest.h"
-
-// The following lines pull in the real gtest *.cc files.
-#include "src/gtest.cc"
-#include "src/gtest-assertion-result.cc"
-#include "src/gtest-death-test.cc"
-#include "src/gtest-filepath.cc"
-#include "src/gtest-matchers.cc"
-#include "src/gtest-port.cc"
-#include "src/gtest-printers.cc"
-#include "src/gtest-test-part.cc"
-#include "src/gtest-typed-test.cc"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-assertion-result.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-assertion-result.cc
deleted file mode 100644
index 9f90e87298..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-assertion-result.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file defines the AssertionResult type.
-
-#include "gtest/gtest-assertion-result.h"
-
-#include <utility>
-#include <string>
-
-#include "gtest/gtest-message.h"
-
-namespace testing {
-
-// AssertionResult constructors.
-// Used in EXPECT_TRUE/FALSE(assertion_result).
-AssertionResult::AssertionResult(const AssertionResult& other)
- : success_(other.success_),
- message_(other.message_.get() != nullptr
- ? new ::std::string(*other.message_)
- : static_cast< ::std::string*>(nullptr)) {}
-
-// Swaps two AssertionResults.
-void AssertionResult::swap(AssertionResult& other) {
- using std::swap;
- swap(success_, other.success_);
- swap(message_, other.message_);
-}
-
-// Returns the assertion's negation. Used with EXPECT/ASSERT_FALSE.
-AssertionResult AssertionResult::operator!() const {
- AssertionResult negation(!success_);
- if (message_.get() != nullptr) negation << *message_;
- return negation;
-}
-
-// Makes a successful assertion result.
-AssertionResult AssertionSuccess() {
- return AssertionResult(true);
-}
-
-// Makes a failed assertion result.
-AssertionResult AssertionFailure() {
- return AssertionResult(false);
-}
-
-// Makes a failed assertion result with the given failure message.
-// Deprecated; use AssertionFailure() << message.
-AssertionResult AssertionFailure(const Message& message) {
- return AssertionFailure() << message;
-}
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-death-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-death-test.cc
deleted file mode 100644
index 87d5e9b924..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-death-test.cc
+++ /dev/null
@@ -1,1647 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// This file implements death tests.
-
-#include "gtest/gtest-death-test.h"
-
-#include <functional>
-#include <utility>
-
-#include "gtest/internal/gtest-port.h"
-#include "gtest/internal/custom/gtest.h"
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_OS_MAC
-# include <crt_externs.h>
-# endif // GTEST_OS_MAC
-
-# include <errno.h>
-# include <fcntl.h>
-# include <limits.h>
-
-# if GTEST_OS_LINUX
-# include <signal.h>
-# endif // GTEST_OS_LINUX
-
-# include <stdarg.h>
-
-# if GTEST_OS_WINDOWS
-# include <windows.h>
-# else
-# include <sys/mman.h>
-# include <sys/wait.h>
-# endif // GTEST_OS_WINDOWS
-
-# if GTEST_OS_QNX
-# include <spawn.h>
-# endif // GTEST_OS_QNX
-
-# if GTEST_OS_FUCHSIA
-# include <lib/fdio/fd.h>
-# include <lib/fdio/io.h>
-# include <lib/fdio/spawn.h>
-# include <lib/zx/channel.h>
-# include <lib/zx/port.h>
-# include <lib/zx/process.h>
-# include <lib/zx/socket.h>
-# include <zircon/processargs.h>
-# include <zircon/syscalls.h>
-# include <zircon/syscalls/policy.h>
-# include <zircon/syscalls/port.h>
-# endif // GTEST_OS_FUCHSIA
-
-#endif // GTEST_HAS_DEATH_TEST
-
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-string.h"
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-
-// Constants.
-
-// The default death test style.
-//
-// This is defined in internal/gtest-port.h as "fast", but can be overridden by
-// a definition in internal/custom/gtest-port.h. The recommended value, which is
-// used internally at Google, is "threadsafe".
-static const char kDefaultDeathTestStyle[] = GTEST_DEFAULT_DEATH_TEST_STYLE;
-
-} // namespace testing
-
-GTEST_DEFINE_string_(
- death_test_style,
- testing::internal::StringFromGTestEnv("death_test_style",
- testing::kDefaultDeathTestStyle),
- "Indicates how to run a death test in a forked child process: "
- "\"threadsafe\" (child process re-executes the test binary "
- "from the beginning, running only the specific death test) or "
- "\"fast\" (child process runs the death test immediately "
- "after forking).");
-
-GTEST_DEFINE_bool_(
- death_test_use_fork,
- testing::internal::BoolFromGTestEnv("death_test_use_fork", false),
- "Instructs to use fork()/_exit() instead of clone() in death tests. "
- "Ignored and always uses fork() on POSIX systems where clone() is not "
- "implemented. Useful when running under valgrind or similar tools if "
- "those do not support clone(). Valgrind 3.3.1 will just fail if "
- "it sees an unsupported combination of clone() flags. "
- "It is not recommended to use this flag w/o valgrind though it will "
- "work in 99% of the cases. Once valgrind is fixed, this flag will "
- "most likely be removed.");
-
-GTEST_DEFINE_string_(
- internal_run_death_test, "",
- "Indicates the file, line number, temporal index of "
- "the single death test to run, and a file descriptor to "
- "which a success code may be sent, all separated by "
- "the '|' characters. This flag is specified if and only if the "
- "current process is a sub-process launched for running a thread-safe "
- "death test. FOR INTERNAL USE ONLY.");
-
-namespace testing {
-
-#if GTEST_HAS_DEATH_TEST
-
-namespace internal {
-
-// Valid only for fast death tests. Indicates the code is running in the
-// child process of a fast style death test.
-# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-static bool g_in_fast_death_test_child = false;
-# endif
-
-// Returns a Boolean value indicating whether the caller is currently
-// executing in the context of the death test child process. Tools such as
-// Valgrind heap checkers may need this to modify their behavior in death
-// tests. IMPORTANT: This is an internal utility. Using it may break the
-// implementation of death tests. User code MUST NOT use it.
-bool InDeathTestChild() {
-# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
- // On Windows and Fuchsia, death tests are thread-safe regardless of the value
- // of the death_test_style flag.
- return !GTEST_FLAG_GET(internal_run_death_test).empty();
-
-# else
-
- if (GTEST_FLAG_GET(death_test_style) == "threadsafe")
- return !GTEST_FLAG_GET(internal_run_death_test).empty();
- else
- return g_in_fast_death_test_child;
-#endif
-}
-
-} // namespace internal
-
-// ExitedWithCode constructor.
-ExitedWithCode::ExitedWithCode(int exit_code) : exit_code_(exit_code) {
-}
-
-// ExitedWithCode function-call operator.
-bool ExitedWithCode::operator()(int exit_status) const {
-# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
- return exit_status == exit_code_;
-
-# else
-
- return WIFEXITED(exit_status) && WEXITSTATUS(exit_status) == exit_code_;
-
-# endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-}
-
-# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-// KilledBySignal constructor.
-KilledBySignal::KilledBySignal(int signum) : signum_(signum) {
-}
-
-// KilledBySignal function-call operator.
-bool KilledBySignal::operator()(int exit_status) const {
-# if defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
- {
- bool result;
- if (GTEST_KILLED_BY_SIGNAL_OVERRIDE_(signum_, exit_status, &result)) {
- return result;
- }
- }
-# endif // defined(GTEST_KILLED_BY_SIGNAL_OVERRIDE_)
- return WIFSIGNALED(exit_status) && WTERMSIG(exit_status) == signum_;
-}
-# endif // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-
-namespace internal {
-
-// Utilities needed for death tests.
-
-// Generates a textual description of a given exit code, in the format
-// specified by wait(2).
-static std::string ExitSummary(int exit_code) {
- Message m;
-
-# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
- m << "Exited with exit status " << exit_code;
-
-# else
-
- if (WIFEXITED(exit_code)) {
- m << "Exited with exit status " << WEXITSTATUS(exit_code);
- } else if (WIFSIGNALED(exit_code)) {
- m << "Terminated by signal " << WTERMSIG(exit_code);
- }
-# ifdef WCOREDUMP
- if (WCOREDUMP(exit_code)) {
- m << " (core dumped)";
- }
-# endif
-# endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
- return m.GetString();
-}
-
-// Returns true if exit_status describes a process that was terminated
-// by a signal, or exited normally with a nonzero exit code.
-bool ExitedUnsuccessfully(int exit_status) {
- return !ExitedWithCode(0)(exit_status);
-}
-
-# if !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-// Generates a textual failure message when a death test finds more than
-// one thread running, or cannot determine the number of threads, prior
-// to executing the given statement. It is the responsibility of the
-// caller not to pass a thread_count of 1.
-static std::string DeathTestThreadWarning(size_t thread_count) {
- Message msg;
- msg << "Death tests use fork(), which is unsafe particularly"
- << " in a threaded context. For this test, " << GTEST_NAME_ << " ";
- if (thread_count == 0) {
- msg << "couldn't detect the number of threads.";
- } else {
- msg << "detected " << thread_count << " threads.";
- }
- msg << " See "
- "https://github.com/google/googletest/blob/master/docs/"
- "advanced.md#death-tests-and-threads"
- << " for more explanation and suggested solutions, especially if"
- << " this is the last message you see before your test times out.";
- return msg.GetString();
-}
-# endif // !GTEST_OS_WINDOWS && !GTEST_OS_FUCHSIA
-
-// Flag characters for reporting a death test that did not die.
-static const char kDeathTestLived = 'L';
-static const char kDeathTestReturned = 'R';
-static const char kDeathTestThrew = 'T';
-static const char kDeathTestInternalError = 'I';
-
-#if GTEST_OS_FUCHSIA
-
-// File descriptor used for the pipe in the child process.
-static const int kFuchsiaReadPipeFd = 3;
-
-#endif
-
-// An enumeration describing all of the possible ways that a death test can
-// conclude. DIED means that the process died while executing the test
-// code; LIVED means that process lived beyond the end of the test code;
-// RETURNED means that the test statement attempted to execute a return
-// statement, which is not allowed; THREW means that the test statement
-// returned control by throwing an exception. IN_PROGRESS means the test
-// has not yet concluded.
-enum DeathTestOutcome { IN_PROGRESS, DIED, LIVED, RETURNED, THREW };
-
-// Routine for aborting the program which is safe to call from an
-// exec-style death test child process, in which case the error
-// message is propagated back to the parent process. Otherwise, the
-// message is simply printed to stderr. In either case, the program
-// then exits with status 1.
-static void DeathTestAbort(const std::string& message) {
- // On a POSIX system, this function may be called from a threadsafe-style
- // death test child process, which operates on a very small stack. Use
- // the heap for any additional non-minuscule memory requirements.
- const InternalRunDeathTestFlag* const flag =
- GetUnitTestImpl()->internal_run_death_test_flag();
- if (flag != nullptr) {
- FILE* parent = posix::FDOpen(flag->write_fd(), "w");
- fputc(kDeathTestInternalError, parent);
- fprintf(parent, "%s", message.c_str());
- fflush(parent);
- _exit(1);
- } else {
- fprintf(stderr, "%s", message.c_str());
- fflush(stderr);
- posix::Abort();
- }
-}
-
-// A replacement for CHECK that calls DeathTestAbort if the assertion
-// fails.
-# define GTEST_DEATH_TEST_CHECK_(expression) \
- do { \
- if (!::testing::internal::IsTrue(expression)) { \
- DeathTestAbort( \
- ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
- + ::testing::internal::StreamableToString(__LINE__) + ": " \
- + #expression); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// This macro is similar to GTEST_DEATH_TEST_CHECK_, but it is meant for
-// evaluating any system call that fulfills two conditions: it must return
-// -1 on failure, and set errno to EINTR when it is interrupted and
-// should be tried again. The macro expands to a loop that repeatedly
-// evaluates the expression as long as it evaluates to -1 and sets
-// errno to EINTR. If the expression evaluates to -1 but errno is
-// something other than EINTR, DeathTestAbort is called.
-# define GTEST_DEATH_TEST_CHECK_SYSCALL_(expression) \
- do { \
- int gtest_retval; \
- do { \
- gtest_retval = (expression); \
- } while (gtest_retval == -1 && errno == EINTR); \
- if (gtest_retval == -1) { \
- DeathTestAbort( \
- ::std::string("CHECK failed: File ") + __FILE__ + ", line " \
- + ::testing::internal::StreamableToString(__LINE__) + ": " \
- + #expression + " != -1"); \
- } \
- } while (::testing::internal::AlwaysFalse())
-
-// Returns the message describing the last system error in errno.
-std::string GetLastErrnoDescription() {
- return errno == 0 ? "" : posix::StrError(errno);
-}
-
-// This is called from a death test parent process to read a failure
-// message from the death test child process and log it with the FATAL
-// severity. On Windows, the message is read from a pipe handle. On other
-// platforms, it is read from a file descriptor.
-static void FailFromInternalError(int fd) {
- Message error;
- char buffer[256];
- int num_read;
-
- do {
- while ((num_read = posix::Read(fd, buffer, 255)) > 0) {
- buffer[num_read] = '\0';
- error << buffer;
- }
- } while (num_read == -1 && errno == EINTR);
-
- if (num_read == 0) {
- GTEST_LOG_(FATAL) << error.GetString();
- } else {
- const int last_error = errno;
- GTEST_LOG_(FATAL) << "Error while reading death test internal: "
- << GetLastErrnoDescription() << " [" << last_error << "]";
- }
-}
-
-// Death test constructor. Increments the running death test count
-// for the current test.
-DeathTest::DeathTest() {
- TestInfo* const info = GetUnitTestImpl()->current_test_info();
- if (info == nullptr) {
- DeathTestAbort("Cannot run a death test outside of a TEST or "
- "TEST_F construct");
- }
-}
-
-// Creates and returns a death test by dispatching to the current
-// death test factory.
-bool DeathTest::Create(const char* statement,
- Matcher<const std::string&> matcher, const char* file,
- int line, DeathTest** test) {
- return GetUnitTestImpl()->death_test_factory()->Create(
- statement, std::move(matcher), file, line, test);
-}
-
-const char* DeathTest::LastMessage() {
- return last_death_test_message_.c_str();
-}
-
-void DeathTest::set_last_death_test_message(const std::string& message) {
- last_death_test_message_ = message;
-}
-
-std::string DeathTest::last_death_test_message_;
-
-// Provides cross platform implementation for some death functionality.
-class DeathTestImpl : public DeathTest {
- protected:
- DeathTestImpl(const char* a_statement, Matcher<const std::string&> matcher)
- : statement_(a_statement),
- matcher_(std::move(matcher)),
- spawned_(false),
- status_(-1),
- outcome_(IN_PROGRESS),
- read_fd_(-1),
- write_fd_(-1) {}
-
- // read_fd_ is expected to be closed and cleared by a derived class.
- ~DeathTestImpl() override { GTEST_DEATH_TEST_CHECK_(read_fd_ == -1); }
-
- void Abort(AbortReason reason) override;
- bool Passed(bool status_ok) override;
-
- const char* statement() const { return statement_; }
- bool spawned() const { return spawned_; }
- void set_spawned(bool is_spawned) { spawned_ = is_spawned; }
- int status() const { return status_; }
- void set_status(int a_status) { status_ = a_status; }
- DeathTestOutcome outcome() const { return outcome_; }
- void set_outcome(DeathTestOutcome an_outcome) { outcome_ = an_outcome; }
- int read_fd() const { return read_fd_; }
- void set_read_fd(int fd) { read_fd_ = fd; }
- int write_fd() const { return write_fd_; }
- void set_write_fd(int fd) { write_fd_ = fd; }
-
- // Called in the parent process only. Reads the result code of the death
- // test child process via a pipe, interprets it to set the outcome_
- // member, and closes read_fd_. Outputs diagnostics and terminates in
- // case of unexpected codes.
- void ReadAndInterpretStatusByte();
-
- // Returns stderr output from the child process.
- virtual std::string GetErrorLogs();
-
- private:
- // The textual content of the code this object is testing. This class
- // doesn't own this string and should not attempt to delete it.
- const char* const statement_;
- // A matcher that's expected to match the stderr output by the child process.
- Matcher<const std::string&> matcher_;
- // True if the death test child process has been successfully spawned.
- bool spawned_;
- // The exit status of the child process.
- int status_;
- // How the death test concluded.
- DeathTestOutcome outcome_;
- // Descriptor to the read end of the pipe to the child process. It is
- // always -1 in the child process. The child keeps its write end of the
- // pipe in write_fd_.
- int read_fd_;
- // Descriptor to the child's write end of the pipe to the parent process.
- // It is always -1 in the parent process. The parent keeps its end of the
- // pipe in read_fd_.
- int write_fd_;
-};
-
-// Called in the parent process only. Reads the result code of the death
-// test child process via a pipe, interprets it to set the outcome_
-// member, and closes read_fd_. Outputs diagnostics and terminates in
-// case of unexpected codes.
-void DeathTestImpl::ReadAndInterpretStatusByte() {
- char flag;
- int bytes_read;
-
- // The read() here blocks until data is available (signifying the
- // failure of the death test) or until the pipe is closed (signifying
- // its success), so it's okay to call this in the parent before
- // the child process has exited.
- do {
- bytes_read = posix::Read(read_fd(), &flag, 1);
- } while (bytes_read == -1 && errno == EINTR);
-
- if (bytes_read == 0) {
- set_outcome(DIED);
- } else if (bytes_read == 1) {
- switch (flag) {
- case kDeathTestReturned:
- set_outcome(RETURNED);
- break;
- case kDeathTestThrew:
- set_outcome(THREW);
- break;
- case kDeathTestLived:
- set_outcome(LIVED);
- break;
- case kDeathTestInternalError:
- FailFromInternalError(read_fd()); // Does not return.
- break;
- default:
- GTEST_LOG_(FATAL) << "Death test child process reported "
- << "unexpected status byte ("
- << static_cast<unsigned int>(flag) << ")";
- }
- } else {
- GTEST_LOG_(FATAL) << "Read from death test child process failed: "
- << GetLastErrnoDescription();
- }
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Close(read_fd()));
- set_read_fd(-1);
-}
-
-std::string DeathTestImpl::GetErrorLogs() {
- return GetCapturedStderr();
-}
-
-// Signals that the death test code which should have exited, didn't.
-// Should be called only in a death test child process.
-// Writes a status byte to the child's status file descriptor, then
-// calls _exit(1).
-void DeathTestImpl::Abort(AbortReason reason) {
- // The parent process considers the death test to be a failure if
- // it finds any data in our pipe. So, here we write a single flag byte
- // to the pipe, then exit.
- const char status_ch =
- reason == TEST_DID_NOT_DIE ? kDeathTestLived :
- reason == TEST_THREW_EXCEPTION ? kDeathTestThrew : kDeathTestReturned;
-
- GTEST_DEATH_TEST_CHECK_SYSCALL_(posix::Write(write_fd(), &status_ch, 1));
- // We are leaking the descriptor here because on some platforms (i.e.,
- // when built as Windows DLL), destructors of global objects will still
- // run after calling _exit(). On such systems, write_fd_ will be
- // indirectly closed from the destructor of UnitTestImpl, causing double
- // close if it is also closed here. On debug configurations, double close
- // may assert. As there are no in-process buffers to flush here, we are
- // relying on the OS to close the descriptor after the process terminates
- // when the destructors are not run.
- _exit(1); // Exits w/o any normal exit hooks (we were supposed to crash)
-}
-
-// Returns an indented copy of stderr output for a death test.
-// This makes distinguishing death test output lines from regular log lines
-// much easier.
-static ::std::string FormatDeathTestOutput(const ::std::string& output) {
- ::std::string ret;
- for (size_t at = 0; ; ) {
- const size_t line_end = output.find('\n', at);
- ret += "[ DEATH ] ";
- if (line_end == ::std::string::npos) {
- ret += output.substr(at);
- break;
- }
- ret += output.substr(at, line_end + 1 - at);
- at = line_end + 1;
- }
- return ret;
-}
-
-// Assesses the success or failure of a death test, using both private
-// members which have previously been set, and one argument:
-//
-// Private data members:
-// outcome: An enumeration describing how the death test
-// concluded: DIED, LIVED, THREW, or RETURNED. The death test
-// fails in the latter three cases.
-// status: The exit status of the child process. On *nix, it is in the
-// in the format specified by wait(2). On Windows, this is the
-// value supplied to the ExitProcess() API or a numeric code
-// of the exception that terminated the program.
-// matcher_: A matcher that's expected to match the stderr output by the child
-// process.
-//
-// Argument:
-// status_ok: true if exit_status is acceptable in the context of
-// this particular death test, which fails if it is false
-//
-// Returns true if and only if all of the above conditions are met. Otherwise,
-// the first failing condition, in the order given above, is the one that is
-// reported. Also sets the last death test message string.
-bool DeathTestImpl::Passed(bool status_ok) {
- if (!spawned())
- return false;
-
- const std::string error_message = GetErrorLogs();
-
- bool success = false;
- Message buffer;
-
- buffer << "Death test: " << statement() << "\n";
- switch (outcome()) {
- case LIVED:
- buffer << " Result: failed to die.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case THREW:
- buffer << " Result: threw an exception.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case RETURNED:
- buffer << " Result: illegal return in test statement.\n"
- << " Error msg:\n" << FormatDeathTestOutput(error_message);
- break;
- case DIED:
- if (status_ok) {
- if (matcher_.Matches(error_message)) {
- success = true;
- } else {
- std::ostringstream stream;
- matcher_.DescribeTo(&stream);
- buffer << " Result: died but not with expected error.\n"
- << " Expected: " << stream.str() << "\n"
- << "Actual msg:\n"
- << FormatDeathTestOutput(error_message);
- }
- } else {
- buffer << " Result: died but not with expected exit code:\n"
- << " " << ExitSummary(status()) << "\n"
- << "Actual msg:\n" << FormatDeathTestOutput(error_message);
- }
- break;
- case IN_PROGRESS:
- default:
- GTEST_LOG_(FATAL)
- << "DeathTest::Passed somehow called before conclusion of test";
- }
-
- DeathTest::set_last_death_test_message(buffer.GetString());
- return success;
-}
-
-# if GTEST_OS_WINDOWS
-// WindowsDeathTest implements death tests on Windows. Due to the
-// specifics of starting new processes on Windows, death tests there are
-// always threadsafe, and Google Test considers the
-// --gtest_death_test_style=fast setting to be equivalent to
-// --gtest_death_test_style=threadsafe there.
-//
-// A few implementation notes: Like the Linux version, the Windows
-// implementation uses pipes for child-to-parent communication. But due to
-// the specifics of pipes on Windows, some extra steps are required:
-//
-// 1. The parent creates a communication pipe and stores handles to both
-// ends of it.
-// 2. The parent starts the child and provides it with the information
-// necessary to acquire the handle to the write end of the pipe.
-// 3. The child acquires the write end of the pipe and signals the parent
-// using a Windows event.
-// 4. Now the parent can release the write end of the pipe on its side. If
-// this is done before step 3, the object's reference count goes down to
-// 0 and it is destroyed, preventing the child from acquiring it. The
-// parent now has to release it, or read operations on the read end of
-// the pipe will not return when the child terminates.
-// 5. The parent reads child's output through the pipe (outcome code and
-// any possible error messages) from the pipe, and its stderr and then
-// determines whether to fail the test.
-//
-// Note: to distinguish Win32 API calls from the local method and function
-// calls, the former are explicitly resolved in the global namespace.
-//
-class WindowsDeathTest : public DeathTestImpl {
- public:
- WindowsDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
- const char* file, int line)
- : DeathTestImpl(a_statement, std::move(matcher)),
- file_(file),
- line_(line) {}
-
- // All of these virtual functions are inherited from DeathTest.
- virtual int Wait();
- virtual TestRole AssumeRole();
-
- private:
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
- // Handle to the write end of the pipe to the child process.
- AutoHandle write_handle_;
- // Child process handle.
- AutoHandle child_handle_;
- // Event the child process uses to signal the parent that it has
- // acquired the handle to the write end of the pipe. After seeing this
- // event the parent can release its own handles to make sure its
- // ReadFile() calls return when the child terminates.
- AutoHandle event_handle_;
-};
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int WindowsDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- // Wait until the child either signals that it has acquired the write end
- // of the pipe or it dies.
- const HANDLE wait_handles[2] = { child_handle_.Get(), event_handle_.Get() };
- switch (::WaitForMultipleObjects(2,
- wait_handles,
- FALSE, // Waits for any of the handles.
- INFINITE)) {
- case WAIT_OBJECT_0:
- case WAIT_OBJECT_0 + 1:
- break;
- default:
- GTEST_DEATH_TEST_CHECK_(false); // Should not get here.
- }
-
- // The child has acquired the write end of the pipe or exited.
- // We release the handle on our side and continue.
- write_handle_.Reset();
- event_handle_.Reset();
-
- ReadAndInterpretStatusByte();
-
- // Waits for the child process to exit if it haven't already. This
- // returns immediately if the child has already exited, regardless of
- // whether previous calls to WaitForMultipleObjects synchronized on this
- // handle or not.
- GTEST_DEATH_TEST_CHECK_(
- WAIT_OBJECT_0 == ::WaitForSingleObject(child_handle_.Get(),
- INFINITE));
- DWORD status_code;
- GTEST_DEATH_TEST_CHECK_(
- ::GetExitCodeProcess(child_handle_.Get(), &status_code) != FALSE);
- child_handle_.Reset();
- set_status(static_cast<int>(status_code));
- return status();
-}
-
-// The AssumeRole process for a Windows death test. It creates a child
-// process with the same executable as the current process to run the
-// death test. The child process is given the --gtest_filter and
-// --gtest_internal_run_death_test flags such that it knows to run the
-// current death test only.
-DeathTest::TestRole WindowsDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != nullptr) {
- // ParseInternalRunDeathTestFlag() has performed all the necessary
- // processing.
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- // WindowsDeathTest uses an anonymous pipe to communicate results of
- // a death test.
- SECURITY_ATTRIBUTES handles_are_inheritable = {sizeof(SECURITY_ATTRIBUTES),
- nullptr, TRUE};
- HANDLE read_handle, write_handle;
- GTEST_DEATH_TEST_CHECK_(
- ::CreatePipe(&read_handle, &write_handle, &handles_are_inheritable,
- 0) // Default buffer size.
- != FALSE);
- set_read_fd(::_open_osfhandle(reinterpret_cast<intptr_t>(read_handle),
- O_RDONLY));
- write_handle_.Reset(write_handle);
- event_handle_.Reset(::CreateEvent(
- &handles_are_inheritable,
- TRUE, // The event will automatically reset to non-signaled state.
- FALSE, // The initial state is non-signalled.
- nullptr)); // The even is unnamed.
- GTEST_DEATH_TEST_CHECK_(event_handle_.Get() != nullptr);
- const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
- "filter=" + info->test_suite_name() + "." +
- info->name();
- const std::string internal_flag =
- std::string("--") + GTEST_FLAG_PREFIX_ +
- "internal_run_death_test=" + file_ + "|" + StreamableToString(line_) +
- "|" + StreamableToString(death_test_index) + "|" +
- StreamableToString(static_cast<unsigned int>(::GetCurrentProcessId())) +
- // size_t has the same width as pointers on both 32-bit and 64-bit
- // Windows platforms.
- // See http://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx.
- "|" + StreamableToString(reinterpret_cast<size_t>(write_handle)) + "|" +
- StreamableToString(reinterpret_cast<size_t>(event_handle_.Get()));
-
- char executable_path[_MAX_PATH + 1]; // NOLINT
- GTEST_DEATH_TEST_CHECK_(_MAX_PATH + 1 != ::GetModuleFileNameA(nullptr,
- executable_path,
- _MAX_PATH));
-
- std::string command_line =
- std::string(::GetCommandLineA()) + " " + filter_flag + " \"" +
- internal_flag + "\"";
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // Flush the log buffers since the log streams are shared with the child.
- FlushInfoLog();
-
- // The child process will share the standard handles with the parent.
- STARTUPINFOA startup_info;
- memset(&startup_info, 0, sizeof(STARTUPINFO));
- startup_info.dwFlags = STARTF_USESTDHANDLES;
- startup_info.hStdInput = ::GetStdHandle(STD_INPUT_HANDLE);
- startup_info.hStdOutput = ::GetStdHandle(STD_OUTPUT_HANDLE);
- startup_info.hStdError = ::GetStdHandle(STD_ERROR_HANDLE);
-
- PROCESS_INFORMATION process_info;
- GTEST_DEATH_TEST_CHECK_(
- ::CreateProcessA(
- executable_path, const_cast<char*>(command_line.c_str()),
- nullptr, // Returned process handle is not inheritable.
- nullptr, // Returned thread handle is not inheritable.
- TRUE, // Child inherits all inheritable handles (for write_handle_).
- 0x0, // Default creation flags.
- nullptr, // Inherit the parent's environment.
- UnitTest::GetInstance()->original_working_dir(), &startup_info,
- &process_info) != FALSE);
- child_handle_.Reset(process_info.hProcess);
- ::CloseHandle(process_info.hThread);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-
-# elif GTEST_OS_FUCHSIA
-
-class FuchsiaDeathTest : public DeathTestImpl {
- public:
- FuchsiaDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
- const char* file, int line)
- : DeathTestImpl(a_statement, std::move(matcher)),
- file_(file),
- line_(line) {}
-
- // All of these virtual functions are inherited from DeathTest.
- int Wait() override;
- TestRole AssumeRole() override;
- std::string GetErrorLogs() override;
-
- private:
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
- // The stderr data captured by the child process.
- std::string captured_stderr_;
-
- zx::process child_process_;
- zx::channel exception_channel_;
- zx::socket stderr_socket_;
-};
-
-// Utility class for accumulating command-line arguments.
-class Arguments {
- public:
- Arguments() { args_.push_back(nullptr); }
-
- ~Arguments() {
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
- ++i) {
- free(*i);
- }
- }
- void AddArgument(const char* argument) {
- args_.insert(args_.end() - 1, posix::StrDup(argument));
- }
-
- template <typename Str>
- void AddArguments(const ::std::vector<Str>& arguments) {
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
- i != arguments.end();
- ++i) {
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
- }
- }
- char* const* Argv() {
- return &args_[0];
- }
-
- int size() {
- return static_cast<int>(args_.size()) - 1;
- }
-
- private:
- std::vector<char*> args_;
-};
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int FuchsiaDeathTest::Wait() {
- const int kProcessKey = 0;
- const int kSocketKey = 1;
- const int kExceptionKey = 2;
-
- if (!spawned())
- return 0;
-
- // Create a port to wait for socket/task/exception events.
- zx_status_t status_zx;
- zx::port port;
- status_zx = zx::port::create(0, &port);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- // Register to wait for the child process to terminate.
- status_zx = child_process_.wait_async(
- port, kProcessKey, ZX_PROCESS_TERMINATED, 0);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- // Register to wait for the socket to be readable or closed.
- status_zx = stderr_socket_.wait_async(
- port, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED, 0);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- // Register to wait for an exception.
- status_zx = exception_channel_.wait_async(
- port, kExceptionKey, ZX_CHANNEL_READABLE, 0);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- bool process_terminated = false;
- bool socket_closed = false;
- do {
- zx_port_packet_t packet = {};
- status_zx = port.wait(zx::time::infinite(), &packet);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- if (packet.key == kExceptionKey) {
- // Process encountered an exception. Kill it directly rather than
- // letting other handlers process the event. We will get a kProcessKey
- // event when the process actually terminates.
- status_zx = child_process_.kill();
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
- } else if (packet.key == kProcessKey) {
- // Process terminated.
- GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
- GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_PROCESS_TERMINATED);
- process_terminated = true;
- } else if (packet.key == kSocketKey) {
- GTEST_DEATH_TEST_CHECK_(ZX_PKT_IS_SIGNAL_ONE(packet.type));
- if (packet.signal.observed & ZX_SOCKET_READABLE) {
- // Read data from the socket.
- constexpr size_t kBufferSize = 1024;
- do {
- size_t old_length = captured_stderr_.length();
- size_t bytes_read = 0;
- captured_stderr_.resize(old_length + kBufferSize);
- status_zx = stderr_socket_.read(
- 0, &captured_stderr_.front() + old_length, kBufferSize,
- &bytes_read);
- captured_stderr_.resize(old_length + bytes_read);
- } while (status_zx == ZX_OK);
- if (status_zx == ZX_ERR_PEER_CLOSED) {
- socket_closed = true;
- } else {
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_ERR_SHOULD_WAIT);
- status_zx = stderr_socket_.wait_async(
- port, kSocketKey, ZX_SOCKET_READABLE | ZX_SOCKET_PEER_CLOSED, 0);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
- }
- } else {
- GTEST_DEATH_TEST_CHECK_(packet.signal.observed & ZX_SOCKET_PEER_CLOSED);
- socket_closed = true;
- }
- }
- } while (!process_terminated && !socket_closed);
-
- ReadAndInterpretStatusByte();
-
- zx_info_process_t buffer;
- status_zx = child_process_.get_info(ZX_INFO_PROCESS, &buffer, sizeof(buffer),
- nullptr, nullptr);
- GTEST_DEATH_TEST_CHECK_(status_zx == ZX_OK);
-
- GTEST_DEATH_TEST_CHECK_(buffer.flags & ZX_INFO_PROCESS_FLAG_EXITED);
- set_status(static_cast<int>(buffer.return_code));
- return status();
-}
-
-// The AssumeRole process for a Fuchsia death test. It creates a child
-// process with the same executable as the current process to run the
-// death test. The child process is given the --gtest_filter and
-// --gtest_internal_run_death_test flags such that it knows to run the
-// current death test only.
-DeathTest::TestRole FuchsiaDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != nullptr) {
- // ParseInternalRunDeathTestFlag() has performed all the necessary
- // processing.
- set_write_fd(kFuchsiaReadPipeFd);
- return EXECUTE_TEST;
- }
-
- // Flush the log buffers since the log streams are shared with the child.
- FlushInfoLog();
-
- // Build the child process command line.
- const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
- "filter=" + info->test_suite_name() + "." +
- info->name();
- const std::string internal_flag =
- std::string("--") + GTEST_FLAG_PREFIX_ + kInternalRunDeathTestFlag + "="
- + file_ + "|"
- + StreamableToString(line_) + "|"
- + StreamableToString(death_test_index);
- Arguments args;
- args.AddArguments(GetInjectableArgvs());
- args.AddArgument(filter_flag.c_str());
- args.AddArgument(internal_flag.c_str());
-
- // Build the pipe for communication with the child.
- zx_status_t status;
- zx_handle_t child_pipe_handle;
- int child_pipe_fd;
- status = fdio_pipe_half(&child_pipe_fd, &child_pipe_handle);
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
- set_read_fd(child_pipe_fd);
-
- // Set the pipe handle for the child.
- fdio_spawn_action_t spawn_actions[2] = {};
- fdio_spawn_action_t* add_handle_action = &spawn_actions[0];
- add_handle_action->action = FDIO_SPAWN_ACTION_ADD_HANDLE;
- add_handle_action->h.id = PA_HND(PA_FD, kFuchsiaReadPipeFd);
- add_handle_action->h.handle = child_pipe_handle;
-
- // Create a socket pair will be used to receive the child process' stderr.
- zx::socket stderr_producer_socket;
- status =
- zx::socket::create(0, &stderr_producer_socket, &stderr_socket_);
- GTEST_DEATH_TEST_CHECK_(status >= 0);
- int stderr_producer_fd = -1;
- status =
- fdio_fd_create(stderr_producer_socket.release(), &stderr_producer_fd);
- GTEST_DEATH_TEST_CHECK_(status >= 0);
-
- // Make the stderr socket nonblocking.
- GTEST_DEATH_TEST_CHECK_(fcntl(stderr_producer_fd, F_SETFL, 0) == 0);
-
- fdio_spawn_action_t* add_stderr_action = &spawn_actions[1];
- add_stderr_action->action = FDIO_SPAWN_ACTION_CLONE_FD;
- add_stderr_action->fd.local_fd = stderr_producer_fd;
- add_stderr_action->fd.target_fd = STDERR_FILENO;
-
- // Create a child job.
- zx_handle_t child_job = ZX_HANDLE_INVALID;
- status = zx_job_create(zx_job_default(), 0, & child_job);
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
- zx_policy_basic_t policy;
- policy.condition = ZX_POL_NEW_ANY;
- policy.policy = ZX_POL_ACTION_ALLOW;
- status = zx_job_set_policy(
- child_job, ZX_JOB_POL_RELATIVE, ZX_JOB_POL_BASIC, &policy, 1);
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
-
- // Create an exception channel attached to the |child_job|, to allow
- // us to suppress the system default exception handler from firing.
- status =
- zx_task_create_exception_channel(
- child_job, 0, exception_channel_.reset_and_get_address());
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
-
- // Spawn the child process.
- status = fdio_spawn_etc(
- child_job, FDIO_SPAWN_CLONE_ALL, args.Argv()[0], args.Argv(), nullptr,
- 2, spawn_actions, child_process_.reset_and_get_address(), nullptr);
- GTEST_DEATH_TEST_CHECK_(status == ZX_OK);
-
- set_spawned(true);
- return OVERSEE_TEST;
-}
-
-std::string FuchsiaDeathTest::GetErrorLogs() {
- return captured_stderr_;
-}
-
-#else // We are neither on Windows, nor on Fuchsia.
-
-// ForkingDeathTest provides implementations for most of the abstract
-// methods of the DeathTest interface. Only the AssumeRole method is
-// left undefined.
-class ForkingDeathTest : public DeathTestImpl {
- public:
- ForkingDeathTest(const char* statement, Matcher<const std::string&> matcher);
-
- // All of these virtual functions are inherited from DeathTest.
- int Wait() override;
-
- protected:
- void set_child_pid(pid_t child_pid) { child_pid_ = child_pid; }
-
- private:
- // PID of child process during death test; 0 in the child process itself.
- pid_t child_pid_;
-};
-
-// Constructs a ForkingDeathTest.
-ForkingDeathTest::ForkingDeathTest(const char* a_statement,
- Matcher<const std::string&> matcher)
- : DeathTestImpl(a_statement, std::move(matcher)), child_pid_(-1) {}
-
-// Waits for the child in a death test to exit, returning its exit
-// status, or 0 if no child process exists. As a side effect, sets the
-// outcome data member.
-int ForkingDeathTest::Wait() {
- if (!spawned())
- return 0;
-
- ReadAndInterpretStatusByte();
-
- int status_value;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(waitpid(child_pid_, &status_value, 0));
- set_status(status_value);
- return status_value;
-}
-
-// A concrete death test class that forks, then immediately runs the test
-// in the child process.
-class NoExecDeathTest : public ForkingDeathTest {
- public:
- NoExecDeathTest(const char* a_statement, Matcher<const std::string&> matcher)
- : ForkingDeathTest(a_statement, std::move(matcher)) {}
- TestRole AssumeRole() override;
-};
-
-// The AssumeRole process for a fork-and-run death test. It implements a
-// straightforward fork, with a simple pipe to transmit the status byte.
-DeathTest::TestRole NoExecDeathTest::AssumeRole() {
- const size_t thread_count = GetThreadCount();
- if (thread_count != 1) {
- GTEST_LOG_(WARNING) << DeathTestThreadWarning(thread_count);
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
-
- DeathTest::set_last_death_test_message("");
- CaptureStderr();
- // When we fork the process below, the log file buffers are copied, but the
- // file descriptors are shared. We flush all log files here so that closing
- // the file descriptors in the child process doesn't throw off the
- // synchronization between descriptors and buffers in the parent process.
- // This is as close to the fork as possible to avoid a race condition in case
- // there are multiple threads running before the death test, and another
- // thread writes to the log file.
- FlushInfoLog();
-
- const pid_t child_pid = fork();
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- set_child_pid(child_pid);
- if (child_pid == 0) {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[0]));
- set_write_fd(pipe_fd[1]);
- // Redirects all logging to stderr in the child process to prevent
- // concurrent writes to the log files. We capture stderr in the parent
- // process and append the child process' output to a log.
- LogToStderr();
- // Event forwarding to the listeners of event listener API mush be shut
- // down in death test subprocesses.
- GetUnitTestImpl()->listeners()->SuppressEventForwarding();
- g_in_fast_death_test_child = true;
- return EXECUTE_TEST;
- } else {
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
- }
-}
-
-// A concrete death test class that forks and re-executes the main
-// program from the beginning, with command-line flags set that cause
-// only this specific death test to be run.
-class ExecDeathTest : public ForkingDeathTest {
- public:
- ExecDeathTest(const char* a_statement, Matcher<const std::string&> matcher,
- const char* file, int line)
- : ForkingDeathTest(a_statement, std::move(matcher)),
- file_(file),
- line_(line) {}
- TestRole AssumeRole() override;
-
- private:
- static ::std::vector<std::string> GetArgvsForDeathTestChildProcess() {
- ::std::vector<std::string> args = GetInjectableArgvs();
-# if defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
- ::std::vector<std::string> extra_args =
- GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_();
- args.insert(args.end(), extra_args.begin(), extra_args.end());
-# endif // defined(GTEST_EXTRA_DEATH_TEST_COMMAND_LINE_ARGS_)
- return args;
- }
- // The name of the file in which the death test is located.
- const char* const file_;
- // The line number on which the death test is located.
- const int line_;
-};
-
-// Utility class for accumulating command-line arguments.
-class Arguments {
- public:
- Arguments() { args_.push_back(nullptr); }
-
- ~Arguments() {
- for (std::vector<char*>::iterator i = args_.begin(); i != args_.end();
- ++i) {
- free(*i);
- }
- }
- void AddArgument(const char* argument) {
- args_.insert(args_.end() - 1, posix::StrDup(argument));
- }
-
- template <typename Str>
- void AddArguments(const ::std::vector<Str>& arguments) {
- for (typename ::std::vector<Str>::const_iterator i = arguments.begin();
- i != arguments.end();
- ++i) {
- args_.insert(args_.end() - 1, posix::StrDup(i->c_str()));
- }
- }
- char* const* Argv() {
- return &args_[0];
- }
-
- private:
- std::vector<char*> args_;
-};
-
-// A struct that encompasses the arguments to the child process of a
-// threadsafe-style death test process.
-struct ExecDeathTestArgs {
- char* const* argv; // Command-line arguments for the child's call to exec
- int close_fd; // File descriptor to close; the read end of a pipe
-};
-
-# if GTEST_OS_QNX
-extern "C" char** environ;
-# else // GTEST_OS_QNX
-// The main function for a threadsafe-style death test child process.
-// This function is called in a clone()-ed process and thus must avoid
-// any potentially unsafe operations like malloc or libc functions.
-static int ExecDeathTestChildMain(void* child_arg) {
- ExecDeathTestArgs* const args = static_cast<ExecDeathTestArgs*>(child_arg);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(args->close_fd));
-
- // We need to execute the test program in the same environment where
- // it was originally invoked. Therefore we change to the original
- // working directory first.
- const char* const original_dir =
- UnitTest::GetInstance()->original_working_dir();
- // We can safely call chdir() as it's a direct system call.
- if (chdir(original_dir) != 0) {
- DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
- GetLastErrnoDescription());
- return EXIT_FAILURE;
- }
-
- // We can safely call execv() as it's almost a direct system call. We
- // cannot use execvp() as it's a libc function and thus potentially
- // unsafe. Since execv() doesn't search the PATH, the user must
- // invoke the test program via a valid path that contains at least
- // one path separator.
- execv(args->argv[0], args->argv);
- DeathTestAbort(std::string("execv(") + args->argv[0] + ", ...) in " +
- original_dir + " failed: " +
- GetLastErrnoDescription());
- return EXIT_FAILURE;
-}
-# endif // GTEST_OS_QNX
-
-# if GTEST_HAS_CLONE
-// Two utility routines that together determine the direction the stack
-// grows.
-// This could be accomplished more elegantly by a single recursive
-// function, but we want to guard against the unlikely possibility of
-// a smart compiler optimizing the recursion away.
-//
-// GTEST_NO_INLINE_ is required to prevent GCC 4.6 from inlining
-// StackLowerThanAddress into StackGrowsDown, which then doesn't give
-// correct answer.
-static void StackLowerThanAddress(const void* ptr,
- bool* result) GTEST_NO_INLINE_;
-// Make sure sanitizers do not tamper with the stack here.
-// Ideally, we want to use `__builtin_frame_address` instead of a local variable
-// address with sanitizer disabled, but it does not work when the
-// compiler optimizes the stack frame out, which happens on PowerPC targets.
-// HWAddressSanitizer add a random tag to the MSB of the local variable address,
-// making comparison result unpredictable.
-GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-static void StackLowerThanAddress(const void* ptr, bool* result) {
- int dummy = 0;
- *result = std::less<const void*>()(&dummy, ptr);
-}
-
-// Make sure AddressSanitizer does not tamper with the stack here.
-GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-static bool StackGrowsDown() {
- int dummy = 0;
- bool result;
- StackLowerThanAddress(&dummy, &result);
- return result;
-}
-# endif // GTEST_HAS_CLONE
-
-// Spawns a child process with the same executable as the current process in
-// a thread-safe manner and instructs it to run the death test. The
-// implementation uses fork(2) + exec. On systems where clone(2) is
-// available, it is used instead, being slightly more thread-safe. On QNX,
-// fork supports only single-threaded environments, so this function uses
-// spawn(2) there instead. The function dies with an error message if
-// anything goes wrong.
-static pid_t ExecDeathTestSpawnChild(char* const* argv, int close_fd) {
- ExecDeathTestArgs args = { argv, close_fd };
- pid_t child_pid = -1;
-
-# if GTEST_OS_QNX
- // Obtains the current directory and sets it to be closed in the child
- // process.
- const int cwd_fd = open(".", O_RDONLY);
- GTEST_DEATH_TEST_CHECK_(cwd_fd != -1);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(cwd_fd, F_SETFD, FD_CLOEXEC));
- // We need to execute the test program in the same environment where
- // it was originally invoked. Therefore we change to the original
- // working directory first.
- const char* const original_dir =
- UnitTest::GetInstance()->original_working_dir();
- // We can safely call chdir() as it's a direct system call.
- if (chdir(original_dir) != 0) {
- DeathTestAbort(std::string("chdir(\"") + original_dir + "\") failed: " +
- GetLastErrnoDescription());
- return EXIT_FAILURE;
- }
-
- int fd_flags;
- // Set close_fd to be closed after spawn.
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fd_flags = fcntl(close_fd, F_GETFD));
- GTEST_DEATH_TEST_CHECK_SYSCALL_(fcntl(close_fd, F_SETFD,
- fd_flags | FD_CLOEXEC));
- struct inheritance inherit = {0};
- // spawn is a system call.
- child_pid = spawn(args.argv[0], 0, nullptr, &inherit, args.argv, environ);
- // Restores the current working directory.
- GTEST_DEATH_TEST_CHECK_(fchdir(cwd_fd) != -1);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(cwd_fd));
-
-# else // GTEST_OS_QNX
-# if GTEST_OS_LINUX
- // When a SIGPROF signal is received while fork() or clone() are executing,
- // the process may hang. To avoid this, we ignore SIGPROF here and re-enable
- // it after the call to fork()/clone() is complete.
- struct sigaction saved_sigprof_action;
- struct sigaction ignore_sigprof_action;
- memset(&ignore_sigprof_action, 0, sizeof(ignore_sigprof_action));
- sigemptyset(&ignore_sigprof_action.sa_mask);
- ignore_sigprof_action.sa_handler = SIG_IGN;
- GTEST_DEATH_TEST_CHECK_SYSCALL_(sigaction(
- SIGPROF, &ignore_sigprof_action, &saved_sigprof_action));
-# endif // GTEST_OS_LINUX
-
-# if GTEST_HAS_CLONE
- const bool use_fork = GTEST_FLAG_GET(death_test_use_fork);
-
- if (!use_fork) {
- static const bool stack_grows_down = StackGrowsDown();
- const auto stack_size = static_cast<size_t>(getpagesize() * 2);
- // MMAP_ANONYMOUS is not defined on Mac, so we use MAP_ANON instead.
- void* const stack = mmap(nullptr, stack_size, PROT_READ | PROT_WRITE,
- MAP_ANON | MAP_PRIVATE, -1, 0);
- GTEST_DEATH_TEST_CHECK_(stack != MAP_FAILED);
-
- // Maximum stack alignment in bytes: For a downward-growing stack, this
- // amount is subtracted from size of the stack space to get an address
- // that is within the stack space and is aligned on all systems we care
- // about. As far as I know there is no ABI with stack alignment greater
- // than 64. We assume stack and stack_size already have alignment of
- // kMaxStackAlignment.
- const size_t kMaxStackAlignment = 64;
- void* const stack_top =
- static_cast<char*>(stack) +
- (stack_grows_down ? stack_size - kMaxStackAlignment : 0);
- GTEST_DEATH_TEST_CHECK_(
- static_cast<size_t>(stack_size) > kMaxStackAlignment &&
- reinterpret_cast<uintptr_t>(stack_top) % kMaxStackAlignment == 0);
-
- child_pid = clone(&ExecDeathTestChildMain, stack_top, SIGCHLD, &args);
-
- GTEST_DEATH_TEST_CHECK_(munmap(stack, stack_size) != -1);
- }
-# else
- const bool use_fork = true;
-# endif // GTEST_HAS_CLONE
-
- if (use_fork && (child_pid = fork()) == 0) {
- ExecDeathTestChildMain(&args);
- _exit(0);
- }
-# endif // GTEST_OS_QNX
-# if GTEST_OS_LINUX
- GTEST_DEATH_TEST_CHECK_SYSCALL_(
- sigaction(SIGPROF, &saved_sigprof_action, nullptr));
-# endif // GTEST_OS_LINUX
-
- GTEST_DEATH_TEST_CHECK_(child_pid != -1);
- return child_pid;
-}
-
-// The AssumeRole process for a fork-and-exec death test. It re-executes the
-// main program from the beginning, setting the --gtest_filter
-// and --gtest_internal_run_death_test flags to cause only the current
-// death test to be re-run.
-DeathTest::TestRole ExecDeathTest::AssumeRole() {
- const UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const TestInfo* const info = impl->current_test_info();
- const int death_test_index = info->result()->death_test_count();
-
- if (flag != nullptr) {
- set_write_fd(flag->write_fd());
- return EXECUTE_TEST;
- }
-
- int pipe_fd[2];
- GTEST_DEATH_TEST_CHECK_(pipe(pipe_fd) != -1);
- // Clear the close-on-exec flag on the write end of the pipe, lest
- // it be closed when the child process does an exec:
- GTEST_DEATH_TEST_CHECK_(fcntl(pipe_fd[1], F_SETFD, 0) != -1);
-
- const std::string filter_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
- "filter=" + info->test_suite_name() + "." +
- info->name();
- const std::string internal_flag = std::string("--") + GTEST_FLAG_PREFIX_ +
- "internal_run_death_test=" + file_ + "|" +
- StreamableToString(line_) + "|" +
- StreamableToString(death_test_index) + "|" +
- StreamableToString(pipe_fd[1]);
- Arguments args;
- args.AddArguments(GetArgvsForDeathTestChildProcess());
- args.AddArgument(filter_flag.c_str());
- args.AddArgument(internal_flag.c_str());
-
- DeathTest::set_last_death_test_message("");
-
- CaptureStderr();
- // See the comment in NoExecDeathTest::AssumeRole for why the next line
- // is necessary.
- FlushInfoLog();
-
- const pid_t child_pid = ExecDeathTestSpawnChild(args.Argv(), pipe_fd[0]);
- GTEST_DEATH_TEST_CHECK_SYSCALL_(close(pipe_fd[1]));
- set_child_pid(child_pid);
- set_read_fd(pipe_fd[0]);
- set_spawned(true);
- return OVERSEE_TEST;
-}
-
-# endif // !GTEST_OS_WINDOWS
-
-// Creates a concrete DeathTest-derived class that depends on the
-// --gtest_death_test_style flag, and sets the pointer pointed to
-// by the "test" argument to its address. If the test should be
-// skipped, sets that pointer to NULL. Returns true, unless the
-// flag is set to an invalid value.
-bool DefaultDeathTestFactory::Create(const char* statement,
- Matcher<const std::string&> matcher,
- const char* file, int line,
- DeathTest** test) {
- UnitTestImpl* const impl = GetUnitTestImpl();
- const InternalRunDeathTestFlag* const flag =
- impl->internal_run_death_test_flag();
- const int death_test_index = impl->current_test_info()
- ->increment_death_test_count();
-
- if (flag != nullptr) {
- if (death_test_index > flag->index()) {
- DeathTest::set_last_death_test_message(
- "Death test count (" + StreamableToString(death_test_index)
- + ") somehow exceeded expected maximum ("
- + StreamableToString(flag->index()) + ")");
- return false;
- }
-
- if (!(flag->file() == file && flag->line() == line &&
- flag->index() == death_test_index)) {
- *test = nullptr;
- return true;
- }
- }
-
-# if GTEST_OS_WINDOWS
-
- if (GTEST_FLAG_GET(death_test_style) == "threadsafe" ||
- GTEST_FLAG_GET(death_test_style) == "fast") {
- *test = new WindowsDeathTest(statement, std::move(matcher), file, line);
- }
-
-# elif GTEST_OS_FUCHSIA
-
- if (GTEST_FLAG_GET(death_test_style) == "threadsafe" ||
- GTEST_FLAG_GET(death_test_style) == "fast") {
- *test = new FuchsiaDeathTest(statement, std::move(matcher), file, line);
- }
-
-# else
-
- if (GTEST_FLAG_GET(death_test_style) == "threadsafe") {
- *test = new ExecDeathTest(statement, std::move(matcher), file, line);
- } else if (GTEST_FLAG_GET(death_test_style) == "fast") {
- *test = new NoExecDeathTest(statement, std::move(matcher));
- }
-
-# endif // GTEST_OS_WINDOWS
-
- else { // NOLINT - this is more readable than unbalanced brackets inside #if.
- DeathTest::set_last_death_test_message("Unknown death test style \"" +
- GTEST_FLAG_GET(death_test_style) +
- "\" encountered");
- return false;
- }
-
- return true;
-}
-
-# if GTEST_OS_WINDOWS
-// Recreates the pipe and event handles from the provided parameters,
-// signals the event, and returns a file descriptor wrapped around the pipe
-// handle. This function is called in the child process only.
-static int GetStatusFileDescriptor(unsigned int parent_process_id,
- size_t write_handle_as_size_t,
- size_t event_handle_as_size_t) {
- AutoHandle parent_process_handle(::OpenProcess(PROCESS_DUP_HANDLE,
- FALSE, // Non-inheritable.
- parent_process_id));
- if (parent_process_handle.Get() == INVALID_HANDLE_VALUE) {
- DeathTestAbort("Unable to open parent process " +
- StreamableToString(parent_process_id));
- }
-
- GTEST_CHECK_(sizeof(HANDLE) <= sizeof(size_t));
-
- const HANDLE write_handle =
- reinterpret_cast<HANDLE>(write_handle_as_size_t);
- HANDLE dup_write_handle;
-
- // The newly initialized handle is accessible only in the parent
- // process. To obtain one accessible within the child, we need to use
- // DuplicateHandle.
- if (!::DuplicateHandle(parent_process_handle.Get(), write_handle,
- ::GetCurrentProcess(), &dup_write_handle,
- 0x0, // Requested privileges ignored since
- // DUPLICATE_SAME_ACCESS is used.
- FALSE, // Request non-inheritable handler.
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort("Unable to duplicate the pipe handle " +
- StreamableToString(write_handle_as_size_t) +
- " from the parent process " +
- StreamableToString(parent_process_id));
- }
-
- const HANDLE event_handle = reinterpret_cast<HANDLE>(event_handle_as_size_t);
- HANDLE dup_event_handle;
-
- if (!::DuplicateHandle(parent_process_handle.Get(), event_handle,
- ::GetCurrentProcess(), &dup_event_handle,
- 0x0,
- FALSE,
- DUPLICATE_SAME_ACCESS)) {
- DeathTestAbort("Unable to duplicate the event handle " +
- StreamableToString(event_handle_as_size_t) +
- " from the parent process " +
- StreamableToString(parent_process_id));
- }
-
- const int write_fd =
- ::_open_osfhandle(reinterpret_cast<intptr_t>(dup_write_handle), O_APPEND);
- if (write_fd == -1) {
- DeathTestAbort("Unable to convert pipe handle " +
- StreamableToString(write_handle_as_size_t) +
- " to a file descriptor");
- }
-
- // Signals the parent that the write end of the pipe has been acquired
- // so the parent can release its own write end.
- ::SetEvent(dup_event_handle);
-
- return write_fd;
-}
-# endif // GTEST_OS_WINDOWS
-
-// Returns a newly created InternalRunDeathTestFlag object with fields
-// initialized from the GTEST_FLAG(internal_run_death_test) flag if
-// the flag is specified; otherwise returns NULL.
-InternalRunDeathTestFlag* ParseInternalRunDeathTestFlag() {
- if (GTEST_FLAG_GET(internal_run_death_test) == "") return nullptr;
-
- // GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we
- // can use it here.
- int line = -1;
- int index = -1;
- ::std::vector< ::std::string> fields;
- SplitString(GTEST_FLAG_GET(internal_run_death_test), '|', &fields);
- int write_fd = -1;
-
-# if GTEST_OS_WINDOWS
-
- unsigned int parent_process_id = 0;
- size_t write_handle_as_size_t = 0;
- size_t event_handle_as_size_t = 0;
-
- if (fields.size() != 6
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &parent_process_id)
- || !ParseNaturalNumber(fields[4], &write_handle_as_size_t)
- || !ParseNaturalNumber(fields[5], &event_handle_as_size_t)) {
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
- GTEST_FLAG_GET(internal_run_death_test));
- }
- write_fd = GetStatusFileDescriptor(parent_process_id,
- write_handle_as_size_t,
- event_handle_as_size_t);
-
-# elif GTEST_OS_FUCHSIA
-
- if (fields.size() != 3
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)) {
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
- GTEST_FLAG_GET(internal_run_death_test));
- }
-
-# else
-
- if (fields.size() != 4
- || !ParseNaturalNumber(fields[1], &line)
- || !ParseNaturalNumber(fields[2], &index)
- || !ParseNaturalNumber(fields[3], &write_fd)) {
- DeathTestAbort("Bad --gtest_internal_run_death_test flag: " +
- GTEST_FLAG_GET(internal_run_death_test));
- }
-
-# endif // GTEST_OS_WINDOWS
-
- return new InternalRunDeathTestFlag(fields[0], line, index, write_fd);
-}
-
-} // namespace internal
-
-#endif // GTEST_HAS_DEATH_TEST
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-filepath.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-filepath.cc
deleted file mode 100644
index 0b5629401b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-filepath.cc
+++ /dev/null
@@ -1,369 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "gtest/internal/gtest-filepath.h"
-
-#include <stdlib.h>
-#include "gtest/internal/gtest-port.h"
-#include "gtest/gtest-message.h"
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h>
-#elif GTEST_OS_WINDOWS
-# include <direct.h>
-# include <io.h>
-#else
-# include <limits.h>
-# include <climits> // Some Linux distributions define PATH_MAX here.
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#include "gtest/internal/gtest-string.h"
-
-#if GTEST_OS_WINDOWS
-# define GTEST_PATH_MAX_ _MAX_PATH
-#elif defined(PATH_MAX)
-# define GTEST_PATH_MAX_ PATH_MAX
-#elif defined(_XOPEN_PATH_MAX)
-# define GTEST_PATH_MAX_ _XOPEN_PATH_MAX
-#else
-# define GTEST_PATH_MAX_ _POSIX_PATH_MAX
-#endif // GTEST_OS_WINDOWS
-
-namespace testing {
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-// On Windows, '\\' is the standard path separator, but many tools and the
-// Windows API also accept '/' as an alternate path separator. Unless otherwise
-// noted, a file path can contain either kind of path separators, or a mixture
-// of them.
-const char kPathSeparator = '\\';
-const char kAlternatePathSeparator = '/';
-const char kAlternatePathSeparatorString[] = "/";
-# if GTEST_OS_WINDOWS_MOBILE
-// Windows CE doesn't have a current directory. You should not use
-// the current directory in tests on Windows CE, but this at least
-// provides a reasonable fallback.
-const char kCurrentDirectoryString[] = "\\";
-// Windows CE doesn't define INVALID_FILE_ATTRIBUTES
-const DWORD kInvalidFileAttributes = 0xffffffff;
-# else
-const char kCurrentDirectoryString[] = ".\\";
-# endif // GTEST_OS_WINDOWS_MOBILE
-#else
-const char kPathSeparator = '/';
-const char kCurrentDirectoryString[] = "./";
-#endif // GTEST_OS_WINDOWS
-
-// Returns whether the given character is a valid path separator.
-static bool IsPathSeparator(char c) {
-#if GTEST_HAS_ALT_PATH_SEP_
- return (c == kPathSeparator) || (c == kAlternatePathSeparator);
-#else
- return c == kPathSeparator;
-#endif
-}
-
-// Returns the current working directory, or "" if unsuccessful.
-FilePath FilePath::GetCurrentDir() {
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_PHONE || \
- GTEST_OS_WINDOWS_RT || GTEST_OS_ESP8266 || GTEST_OS_ESP32 || \
- GTEST_OS_XTENSA
- // These platforms do not have a current directory, so we just return
- // something reasonable.
- return FilePath(kCurrentDirectoryString);
-#elif GTEST_OS_WINDOWS
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- return FilePath(_getcwd(cwd, sizeof(cwd)) == nullptr ? "" : cwd);
-#else
- char cwd[GTEST_PATH_MAX_ + 1] = { '\0' };
- char* result = getcwd(cwd, sizeof(cwd));
-# if GTEST_OS_NACL
- // getcwd will likely fail in NaCl due to the sandbox, so return something
- // reasonable. The user may have provided a shim implementation for getcwd,
- // however, so fallback only when failure is detected.
- return FilePath(result == nullptr ? kCurrentDirectoryString : cwd);
-# endif // GTEST_OS_NACL
- return FilePath(result == nullptr ? "" : cwd);
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns a copy of the FilePath with the case-insensitive extension removed.
-// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns
-// FilePath("dir/file"). If a case-insensitive extension is not
-// found, returns a copy of the original FilePath.
-FilePath FilePath::RemoveExtension(const char* extension) const {
- const std::string dot_extension = std::string(".") + extension;
- if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {
- return FilePath(pathname_.substr(
- 0, pathname_.length() - dot_extension.length()));
- }
- return *this;
-}
-
-// Returns a pointer to the last occurrence of a valid path separator in
-// the FilePath. On Windows, for example, both '/' and '\' are valid path
-// separators. Returns NULL if no path separator was found.
-const char* FilePath::FindLastPathSeparator() const {
- const char* const last_sep = strrchr(c_str(), kPathSeparator);
-#if GTEST_HAS_ALT_PATH_SEP_
- const char* const last_alt_sep = strrchr(c_str(), kAlternatePathSeparator);
- // Comparing two pointers of which only one is NULL is undefined.
- if (last_alt_sep != nullptr &&
- (last_sep == nullptr || last_alt_sep > last_sep)) {
- return last_alt_sep;
- }
-#endif
- return last_sep;
-}
-
-// Returns a copy of the FilePath with the directory part removed.
-// Example: FilePath("path/to/file").RemoveDirectoryName() returns
-// FilePath("file"). If there is no directory part ("just_a_file"), it returns
-// the FilePath unmodified. If there is no file part ("just_a_dir/") it
-// returns an empty FilePath ("").
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveDirectoryName() const {
- const char* const last_sep = FindLastPathSeparator();
- return last_sep ? FilePath(last_sep + 1) : *this;
-}
-
-// RemoveFileName returns the directory path with the filename removed.
-// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".
-// If the FilePath is "a_file" or "/a_file", RemoveFileName returns
-// FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does
-// not have a file, like "just/a/dir/", it returns the FilePath unmodified.
-// On Windows platform, '\' is the path separator, otherwise it is '/'.
-FilePath FilePath::RemoveFileName() const {
- const char* const last_sep = FindLastPathSeparator();
- std::string dir;
- if (last_sep) {
- dir = std::string(c_str(), static_cast<size_t>(last_sep + 1 - c_str()));
- } else {
- dir = kCurrentDirectoryString;
- }
- return FilePath(dir);
-}
-
-// Helper functions for naming files in a directory for xml output.
-
-// Given directory = "dir", base_name = "test", number = 0,
-// extension = "xml", returns "dir/test.xml". If number is greater
-// than zero (e.g., 12), returns "dir/test_12.xml".
-// On Windows platform, uses \ as the separator rather than /.
-FilePath FilePath::MakeFileName(const FilePath& directory,
- const FilePath& base_name,
- int number,
- const char* extension) {
- std::string file;
- if (number == 0) {
- file = base_name.string() + "." + extension;
- } else {
- file = base_name.string() + "_" + StreamableToString(number)
- + "." + extension;
- }
- return ConcatPaths(directory, FilePath(file));
-}
-
-// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".
-// On Windows, uses \ as the separator rather than /.
-FilePath FilePath::ConcatPaths(const FilePath& directory,
- const FilePath& relative_path) {
- if (directory.IsEmpty())
- return relative_path;
- const FilePath dir(directory.RemoveTrailingPathSeparator());
- return FilePath(dir.string() + kPathSeparator + relative_path.string());
-}
-
-// Returns true if pathname describes something findable in the file-system,
-// either a file, directory, or whatever.
-bool FilePath::FileOrDirectoryExists() const {
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(pathname_.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- return attributes != kInvalidFileAttributes;
-#else
- posix::StatStruct file_stat{};
- return posix::Stat(pathname_.c_str(), &file_stat) == 0;
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Returns true if pathname describes a directory in the file-system
-// that exists.
-bool FilePath::DirectoryExists() const {
- bool result = false;
-#if GTEST_OS_WINDOWS
- // Don't strip off trailing separator if path is a root directory on
- // Windows (like "C:\\").
- const FilePath& path(IsRootDirectory() ? *this :
- RemoveTrailingPathSeparator());
-#else
- const FilePath& path(*this);
-#endif
-
-#if GTEST_OS_WINDOWS_MOBILE
- LPCWSTR unicode = String::AnsiToUtf16(path.c_str());
- const DWORD attributes = GetFileAttributes(unicode);
- delete [] unicode;
- if ((attributes != kInvalidFileAttributes) &&
- (attributes & FILE_ATTRIBUTE_DIRECTORY)) {
- result = true;
- }
-#else
- posix::StatStruct file_stat{};
- result = posix::Stat(path.c_str(), &file_stat) == 0 &&
- posix::IsDir(file_stat);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- return result;
-}
-
-// Returns true if pathname describes a root directory. (Windows has one
-// root directory per disk drive.)
-bool FilePath::IsRootDirectory() const {
-#if GTEST_OS_WINDOWS
- return pathname_.length() == 3 && IsAbsolutePath();
-#else
- return pathname_.length() == 1 && IsPathSeparator(pathname_.c_str()[0]);
-#endif
-}
-
-// Returns true if pathname describes an absolute path.
-bool FilePath::IsAbsolutePath() const {
- const char* const name = pathname_.c_str();
-#if GTEST_OS_WINDOWS
- return pathname_.length() >= 3 &&
- ((name[0] >= 'a' && name[0] <= 'z') ||
- (name[0] >= 'A' && name[0] <= 'Z')) &&
- name[1] == ':' &&
- IsPathSeparator(name[2]);
-#else
- return IsPathSeparator(name[0]);
-#endif
-}
-
-// Returns a pathname for a file that does not currently exist. The pathname
-// will be directory/base_name.extension or
-// directory/base_name_<number>.extension if directory/base_name.extension
-// already exists. The number will be incremented until a pathname is found
-// that does not already exist.
-// Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'.
-// There could be a race condition if two or more processes are calling this
-// function at the same time -- they could both pick the same filename.
-FilePath FilePath::GenerateUniqueFileName(const FilePath& directory,
- const FilePath& base_name,
- const char* extension) {
- FilePath full_pathname;
- int number = 0;
- do {
- full_pathname.Set(MakeFileName(directory, base_name, number++, extension));
- } while (full_pathname.FileOrDirectoryExists());
- return full_pathname;
-}
-
-// Returns true if FilePath ends with a path separator, which indicates that
-// it is intended to represent a directory. Returns false otherwise.
-// This does NOT check that a directory (or file) actually exists.
-bool FilePath::IsDirectory() const {
- return !pathname_.empty() &&
- IsPathSeparator(pathname_.c_str()[pathname_.length() - 1]);
-}
-
-// Create directories so that path exists. Returns true if successful or if
-// the directories already exist; returns false if unable to create directories
-// for any reason.
-bool FilePath::CreateDirectoriesRecursively() const {
- if (!this->IsDirectory()) {
- return false;
- }
-
- if (pathname_.length() == 0 || this->DirectoryExists()) {
- return true;
- }
-
- const FilePath parent(this->RemoveTrailingPathSeparator().RemoveFileName());
- return parent.CreateDirectoriesRecursively() && this->CreateFolder();
-}
-
-// Create the directory so that path exists. Returns true if successful or
-// if the directory already exists; returns false if unable to create the
-// directory for any reason, including if the parent directory does not
-// exist. Not named "CreateDirectory" because that's a macro on Windows.
-bool FilePath::CreateFolder() const {
-#if GTEST_OS_WINDOWS_MOBILE
- FilePath removed_sep(this->RemoveTrailingPathSeparator());
- LPCWSTR unicode = String::AnsiToUtf16(removed_sep.c_str());
- int result = CreateDirectory(unicode, nullptr) ? 0 : -1;
- delete [] unicode;
-#elif GTEST_OS_WINDOWS
- int result = _mkdir(pathname_.c_str());
-#elif GTEST_OS_ESP8266 || GTEST_OS_XTENSA
- // do nothing
- int result = 0;
-#else
- int result = mkdir(pathname_.c_str(), 0777);
-#endif // GTEST_OS_WINDOWS_MOBILE
-
- if (result == -1) {
- return this->DirectoryExists(); // An error is OK if the directory exists.
- }
- return true; // No error.
-}
-
-// If input name has a trailing separator character, remove it and return the
-// name, otherwise return the name string unmodified.
-// On Windows platform, uses \ as the separator, other platforms use /.
-FilePath FilePath::RemoveTrailingPathSeparator() const {
- return IsDirectory()
- ? FilePath(pathname_.substr(0, pathname_.length() - 1))
- : *this;
-}
-
-// Removes any redundant separators that might be in the pathname.
-// For example, "bar///foo" becomes "bar/foo". Does not eliminate other
-// redundancies that might be in a pathname involving "." or "..".
-void FilePath::Normalize() {
- auto out = pathname_.begin();
-
- for (const char character : pathname_) {
- if (!IsPathSeparator(character)) {
- *(out++) = character;
- } else if (out == pathname_.begin() || *std::prev(out) != kPathSeparator) {
- *(out++) = kPathSeparator;
- } else {
- continue;
- }
- }
-
- pathname_.erase(out, pathname_.end());
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-internal-inl.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-internal-inl.h
deleted file mode 100644
index 0b25d2f0e7..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-internal-inl.h
+++ /dev/null
@@ -1,1204 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Utility functions and classes used by the Google C++ testing framework.//
-// This file contains purely Google Test's internal implementation. Please
-// DO NOT #INCLUDE IT IN A USER PROGRAM.
-
-#ifndef GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_
-#define GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_
-
-#ifndef _WIN32_WCE
-# include <errno.h>
-#endif // !_WIN32_WCE
-#include <stddef.h>
-#include <stdlib.h> // For strtoll/_strtoul64/malloc/free.
-#include <string.h> // For memmove.
-
-#include <algorithm>
-#include <cstdint>
-#include <memory>
-#include <string>
-#include <vector>
-
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_CAN_STREAM_RESULTS_
-# include <arpa/inet.h> // NOLINT
-# include <netdb.h> // NOLINT
-#endif
-
-#if GTEST_OS_WINDOWS
-# include <windows.h> // NOLINT
-#endif // GTEST_OS_WINDOWS
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4251 \
-/* class A needs to have dll-interface to be used by clients of class B */)
-
-// Declares the flags.
-//
-// We don't want the users to modify this flag in the code, but want
-// Google Test's own unit tests to be able to access it. Therefore we
-// declare it here as opposed to in gtest.h.
-GTEST_DECLARE_bool_(death_test_use_fork);
-
-namespace testing {
-namespace internal {
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-GTEST_API_ extern const TypeId kTestTypeIdInGoogleTest;
-
-// A valid random seed must be in [1, kMaxRandomSeed].
-const int kMaxRandomSeed = 99999;
-
-// g_help_flag is true if and only if the --help flag or an equivalent form
-// is specified on the command line.
-GTEST_API_ extern bool g_help_flag;
-
-// Returns the current time in milliseconds.
-GTEST_API_ TimeInMillis GetTimeInMillis();
-
-// Returns true if and only if Google Test should use colors in the output.
-GTEST_API_ bool ShouldUseColor(bool stdout_is_tty);
-
-// Formats the given time in milliseconds as seconds.
-GTEST_API_ std::string FormatTimeInMillisAsSeconds(TimeInMillis ms);
-
-// Converts the given time in milliseconds to a date string in the ISO 8601
-// format, without the timezone information. N.B.: due to the use the
-// non-reentrant localtime() function, this function is not thread safe. Do
-// not use it in any code that can be called from multiple threads.
-GTEST_API_ std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms);
-
-// Parses a string for an Int32 flag, in the form of "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-GTEST_API_ bool ParseFlag(const char* str, const char* flag, int32_t* value);
-
-// Returns a random seed in range [1, kMaxRandomSeed] based on the
-// given --gtest_random_seed flag value.
-inline int GetRandomSeedFromFlag(int32_t random_seed_flag) {
- const unsigned int raw_seed = (random_seed_flag == 0) ?
- static_cast<unsigned int>(GetTimeInMillis()) :
- static_cast<unsigned int>(random_seed_flag);
-
- // Normalizes the actual seed to range [1, kMaxRandomSeed] such that
- // it's easy to type.
- const int normalized_seed =
- static_cast<int>((raw_seed - 1U) %
- static_cast<unsigned int>(kMaxRandomSeed)) + 1;
- return normalized_seed;
-}
-
-// Returns the first valid random seed after 'seed'. The behavior is
-// undefined if 'seed' is invalid. The seed after kMaxRandomSeed is
-// considered to be 1.
-inline int GetNextRandomSeed(int seed) {
- GTEST_CHECK_(1 <= seed && seed <= kMaxRandomSeed)
- << "Invalid random seed " << seed << " - must be in [1, "
- << kMaxRandomSeed << "].";
- const int next_seed = seed + 1;
- return (next_seed > kMaxRandomSeed) ? 1 : next_seed;
-}
-
-// This class saves the values of all Google Test flags in its c'tor, and
-// restores them in its d'tor.
-class GTestFlagSaver {
- public:
- // The c'tor.
- GTestFlagSaver() {
- also_run_disabled_tests_ = GTEST_FLAG_GET(also_run_disabled_tests);
- break_on_failure_ = GTEST_FLAG_GET(break_on_failure);
- catch_exceptions_ = GTEST_FLAG_GET(catch_exceptions);
- color_ = GTEST_FLAG_GET(color);
- death_test_style_ = GTEST_FLAG_GET(death_test_style);
- death_test_use_fork_ = GTEST_FLAG_GET(death_test_use_fork);
- fail_fast_ = GTEST_FLAG_GET(fail_fast);
- filter_ = GTEST_FLAG_GET(filter);
- internal_run_death_test_ = GTEST_FLAG_GET(internal_run_death_test);
- list_tests_ = GTEST_FLAG_GET(list_tests);
- output_ = GTEST_FLAG_GET(output);
- brief_ = GTEST_FLAG_GET(brief);
- print_time_ = GTEST_FLAG_GET(print_time);
- print_utf8_ = GTEST_FLAG_GET(print_utf8);
- random_seed_ = GTEST_FLAG_GET(random_seed);
- repeat_ = GTEST_FLAG_GET(repeat);
- recreate_environments_when_repeating_ =
- GTEST_FLAG_GET(recreate_environments_when_repeating);
- shuffle_ = GTEST_FLAG_GET(shuffle);
- stack_trace_depth_ = GTEST_FLAG_GET(stack_trace_depth);
- stream_result_to_ = GTEST_FLAG_GET(stream_result_to);
- throw_on_failure_ = GTEST_FLAG_GET(throw_on_failure);
- }
-
- // The d'tor is not virtual. DO NOT INHERIT FROM THIS CLASS.
- ~GTestFlagSaver() {
- GTEST_FLAG_SET(also_run_disabled_tests, also_run_disabled_tests_);
- GTEST_FLAG_SET(break_on_failure, break_on_failure_);
- GTEST_FLAG_SET(catch_exceptions, catch_exceptions_);
- GTEST_FLAG_SET(color, color_);
- GTEST_FLAG_SET(death_test_style, death_test_style_);
- GTEST_FLAG_SET(death_test_use_fork, death_test_use_fork_);
- GTEST_FLAG_SET(filter, filter_);
- GTEST_FLAG_SET(fail_fast, fail_fast_);
- GTEST_FLAG_SET(internal_run_death_test, internal_run_death_test_);
- GTEST_FLAG_SET(list_tests, list_tests_);
- GTEST_FLAG_SET(output, output_);
- GTEST_FLAG_SET(brief, brief_);
- GTEST_FLAG_SET(print_time, print_time_);
- GTEST_FLAG_SET(print_utf8, print_utf8_);
- GTEST_FLAG_SET(random_seed, random_seed_);
- GTEST_FLAG_SET(repeat, repeat_);
- GTEST_FLAG_SET(recreate_environments_when_repeating,
- recreate_environments_when_repeating_);
- GTEST_FLAG_SET(shuffle, shuffle_);
- GTEST_FLAG_SET(stack_trace_depth, stack_trace_depth_);
- GTEST_FLAG_SET(stream_result_to, stream_result_to_);
- GTEST_FLAG_SET(throw_on_failure, throw_on_failure_);
- }
-
- private:
- // Fields for saving the original values of flags.
- bool also_run_disabled_tests_;
- bool break_on_failure_;
- bool catch_exceptions_;
- std::string color_;
- std::string death_test_style_;
- bool death_test_use_fork_;
- bool fail_fast_;
- std::string filter_;
- std::string internal_run_death_test_;
- bool list_tests_;
- std::string output_;
- bool brief_;
- bool print_time_;
- bool print_utf8_;
- int32_t random_seed_;
- int32_t repeat_;
- bool recreate_environments_when_repeating_;
- bool shuffle_;
- int32_t stack_trace_depth_;
- std::string stream_result_to_;
- bool throw_on_failure_;
-} GTEST_ATTRIBUTE_UNUSED_;
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type UInt32 because wchar_t may not be
-// wide enough to contain a code point.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
-// to "(Invalid Unicode 0xXXXXXXXX)".
-GTEST_API_ std::string CodePointToUtf8(uint32_t code_point);
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-GTEST_API_ std::string WideStringToUtf8(const wchar_t* str, int num_chars);
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded();
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (e.g., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-GTEST_API_ bool ShouldShard(const char* total_shards_str,
- const char* shard_index_str,
- bool in_subprocess_for_death_test);
-
-// Parses the environment variable var as a 32-bit integer. If it is unset,
-// returns default_val. If it is not a 32-bit integer, prints an error and
-// and aborts.
-GTEST_API_ int32_t Int32FromEnvOrDie(const char* env_var, int32_t default_val);
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true if and only if the test should be run on this shard. The test id
-// is some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-GTEST_API_ bool ShouldRunTestOnShard(
- int total_shards, int shard_index, int test_id);
-
-// STL container utilities.
-
-// Returns the number of elements in the given container that satisfy
-// the given predicate.
-template <class Container, typename Predicate>
-inline int CountIf(const Container& c, Predicate predicate) {
- // Implemented as an explicit loop since std::count_if() in libCstd on
- // Solaris has a non-standard signature.
- int count = 0;
- for (auto it = c.begin(); it != c.end(); ++it) {
- if (predicate(*it))
- ++count;
- }
- return count;
-}
-
-// Applies a function/functor to each element in the container.
-template <class Container, typename Functor>
-void ForEach(const Container& c, Functor functor) {
- std::for_each(c.begin(), c.end(), functor);
-}
-
-// Returns the i-th element of the vector, or default_value if i is not
-// in range [0, v.size()).
-template <typename E>
-inline E GetElementOr(const std::vector<E>& v, int i, E default_value) {
- return (i < 0 || i >= static_cast<int>(v.size())) ? default_value
- : v[static_cast<size_t>(i)];
-}
-
-// Performs an in-place shuffle of a range of the vector's elements.
-// 'begin' and 'end' are element indices as an STL-style range;
-// i.e. [begin, end) are shuffled, where 'end' == size() means to
-// shuffle to the end of the vector.
-template <typename E>
-void ShuffleRange(internal::Random* random, int begin, int end,
- std::vector<E>* v) {
- const int size = static_cast<int>(v->size());
- GTEST_CHECK_(0 <= begin && begin <= size)
- << "Invalid shuffle range start " << begin << ": must be in range [0, "
- << size << "].";
- GTEST_CHECK_(begin <= end && end <= size)
- << "Invalid shuffle range finish " << end << ": must be in range ["
- << begin << ", " << size << "].";
-
- // Fisher-Yates shuffle, from
- // http://en.wikipedia.org/wiki/Fisher-Yates_shuffle
- for (int range_width = end - begin; range_width >= 2; range_width--) {
- const int last_in_range = begin + range_width - 1;
- const int selected =
- begin +
- static_cast<int>(random->Generate(static_cast<uint32_t>(range_width)));
- std::swap((*v)[static_cast<size_t>(selected)],
- (*v)[static_cast<size_t>(last_in_range)]);
- }
-}
-
-// Performs an in-place shuffle of the vector's elements.
-template <typename E>
-inline void Shuffle(internal::Random* random, std::vector<E>* v) {
- ShuffleRange(random, 0, static_cast<int>(v->size()), v);
-}
-
-// A function for deleting an object. Handy for being used as a
-// functor.
-template <typename T>
-static void Delete(T* x) {
- delete x;
-}
-
-// A predicate that checks the key of a TestProperty against a known key.
-//
-// TestPropertyKeyIs is copyable.
-class TestPropertyKeyIs {
- public:
- // Constructor.
- //
- // TestPropertyKeyIs has NO default constructor.
- explicit TestPropertyKeyIs(const std::string& key) : key_(key) {}
-
- // Returns true if and only if the test name of test property matches on key_.
- bool operator()(const TestProperty& test_property) const {
- return test_property.key() == key_;
- }
-
- private:
- std::string key_;
-};
-
-// Class UnitTestOptions.
-//
-// This class contains functions for processing options the user
-// specifies when running the tests. It has only static members.
-//
-// In most cases, the user can specify an option using either an
-// environment variable or a command line flag. E.g. you can set the
-// test filter using either GTEST_FILTER or --gtest_filter. If both
-// the variable and the flag are present, the latter overrides the
-// former.
-class GTEST_API_ UnitTestOptions {
- public:
- // Functions for processing the gtest_output flag.
-
- // Returns the output format, or "" for normal printed output.
- static std::string GetOutputFormat();
-
- // Returns the absolute path of the requested output file, or the
- // default (test_detail.xml in the original working directory) if
- // none was explicitly specified.
- static std::string GetAbsolutePathToOutputFile();
-
- // Functions for processing the gtest_filter flag.
-
- // Returns true if and only if the user-specified filter matches the test
- // suite name and the test name.
- static bool FilterMatchesTest(const std::string& test_suite_name,
- const std::string& test_name);
-
-#if GTEST_OS_WINDOWS
- // Function for supporting the gtest_catch_exception flag.
-
- // Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
- // given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
- // This function is useful as an __except condition.
- static int GTestShouldProcessSEH(DWORD exception_code);
-#endif // GTEST_OS_WINDOWS
-
- // Returns true if "name" matches the ':' separated list of glob-style
- // filters in "filter".
- static bool MatchesFilter(const std::string& name, const char* filter);
-};
-
-// Returns the current application's name, removing directory path if that
-// is present. Used by UnitTestOptions::GetOutputFile.
-GTEST_API_ FilePath GetCurrentExecutableName();
-
-// The role interface for getting the OS stack trace as a string.
-class OsStackTraceGetterInterface {
- public:
- OsStackTraceGetterInterface() {}
- virtual ~OsStackTraceGetterInterface() {}
-
- // Returns the current OS stack trace as an std::string. Parameters:
- //
- // max_depth - the maximum number of stack frames to be included
- // in the trace.
- // skip_count - the number of top frames to be skipped; doesn't count
- // against max_depth.
- virtual std::string CurrentStackTrace(int max_depth, int skip_count) = 0;
-
- // UponLeavingGTest() should be called immediately before Google Test calls
- // user code. It saves some information about the current stack that
- // CurrentStackTrace() will use to find and hide Google Test stack frames.
- virtual void UponLeavingGTest() = 0;
-
- // This string is inserted in place of stack frames that are part of
- // Google Test's implementation.
- static const char* const kElidedFramesMarker;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetterInterface);
-};
-
-// A working implementation of the OsStackTraceGetterInterface interface.
-class OsStackTraceGetter : public OsStackTraceGetterInterface {
- public:
- OsStackTraceGetter() {}
-
- std::string CurrentStackTrace(int max_depth, int skip_count) override;
- void UponLeavingGTest() override;
-
- private:
-#if GTEST_HAS_ABSL
- Mutex mutex_; // Protects all internal state.
-
- // We save the stack frame below the frame that calls user code.
- // We do this because the address of the frame immediately below
- // the user code changes between the call to UponLeavingGTest()
- // and any calls to the stack trace code from within the user code.
- void* caller_frame_ = nullptr;
-#endif // GTEST_HAS_ABSL
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(OsStackTraceGetter);
-};
-
-// Information about a Google Test trace point.
-struct TraceInfo {
- const char* file;
- int line;
- std::string message;
-};
-
-// This is the default global test part result reporter used in UnitTestImpl.
-// This class should only be used by UnitTestImpl.
-class DefaultGlobalTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultGlobalTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. Reports the test part
- // result in the current test.
- void ReportTestPartResult(const TestPartResult& result) override;
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultGlobalTestPartResultReporter);
-};
-
-// This is the default per thread test part result reporter used in
-// UnitTestImpl. This class should only be used by UnitTestImpl.
-class DefaultPerThreadTestPartResultReporter
- : public TestPartResultReporterInterface {
- public:
- explicit DefaultPerThreadTestPartResultReporter(UnitTestImpl* unit_test);
- // Implements the TestPartResultReporterInterface. The implementation just
- // delegates to the current global test part result reporter of *unit_test_.
- void ReportTestPartResult(const TestPartResult& result) override;
-
- private:
- UnitTestImpl* const unit_test_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DefaultPerThreadTestPartResultReporter);
-};
-
-// The private implementation of the UnitTest class. We don't protect
-// the methods under a mutex, as this class is not accessible by a
-// user and the UnitTest class that delegates work to this class does
-// proper locking.
-class GTEST_API_ UnitTestImpl {
- public:
- explicit UnitTestImpl(UnitTest* parent);
- virtual ~UnitTestImpl();
-
- // There are two different ways to register your own TestPartResultReporter.
- // You can register your own repoter to listen either only for test results
- // from the current thread or for results from all threads.
- // By default, each per-thread test result repoter just passes a new
- // TestPartResult to the global test result reporter, which registers the
- // test part result for the currently running test.
-
- // Returns the global test part result reporter.
- TestPartResultReporterInterface* GetGlobalTestPartResultReporter();
-
- // Sets the global test part result reporter.
- void SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter);
-
- // Returns the test part result reporter for the current thread.
- TestPartResultReporterInterface* GetTestPartResultReporterForCurrentThread();
-
- // Sets the test part result reporter for the current thread.
- void SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter);
-
- // Gets the number of successful test suites.
- int successful_test_suite_count() const;
-
- // Gets the number of failed test suites.
- int failed_test_suite_count() const;
-
- // Gets the number of all test suites.
- int total_test_suite_count() const;
-
- // Gets the number of all test suites that contain at least one test
- // that should run.
- int test_suite_to_run_count() const;
-
- // Gets the number of successful tests.
- int successful_test_count() const;
-
- // Gets the number of skipped tests.
- int skipped_test_count() const;
-
- // Gets the number of failed tests.
- int failed_test_count() const;
-
- // Gets the number of disabled tests that will be reported in the XML report.
- int reportable_disabled_test_count() const;
-
- // Gets the number of disabled tests.
- int disabled_test_count() const;
-
- // Gets the number of tests to be printed in the XML report.
- int reportable_test_count() const;
-
- // Gets the number of all tests.
- int total_test_count() const;
-
- // Gets the number of tests that should run.
- int test_to_run_count() const;
-
- // Gets the time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp() const { return start_timestamp_; }
-
- // Gets the elapsed time, in milliseconds.
- TimeInMillis elapsed_time() const { return elapsed_time_; }
-
- // Returns true if and only if the unit test passed (i.e. all test suites
- // passed).
- bool Passed() const { return !Failed(); }
-
- // Returns true if and only if the unit test failed (i.e. some test suite
- // failed or something outside of all tests failed).
- bool Failed() const {
- return failed_test_suite_count() > 0 || ad_hoc_test_result()->Failed();
- }
-
- // Gets the i-th test suite among all the test suites. i can range from 0 to
- // total_test_suite_count() - 1. If i is not in that range, returns NULL.
- const TestSuite* GetTestSuite(int i) const {
- const int index = GetElementOr(test_suite_indices_, i, -1);
- return index < 0 ? nullptr : test_suites_[static_cast<size_t>(i)];
- }
-
- // Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- const TestCase* GetTestCase(int i) const { return GetTestSuite(i); }
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Gets the i-th test suite among all the test suites. i can range from 0 to
- // total_test_suite_count() - 1. If i is not in that range, returns NULL.
- TestSuite* GetMutableSuiteCase(int i) {
- const int index = GetElementOr(test_suite_indices_, i, -1);
- return index < 0 ? nullptr : test_suites_[static_cast<size_t>(index)];
- }
-
- // Provides access to the event listener list.
- TestEventListeners* listeners() { return &listeners_; }
-
- // Returns the TestResult for the test that's currently running, or
- // the TestResult for the ad hoc test if no test is running.
- TestResult* current_test_result();
-
- // Returns the TestResult for the ad hoc test.
- const TestResult* ad_hoc_test_result() const { return &ad_hoc_test_result_; }
-
- // Sets the OS stack trace getter.
- //
- // Does nothing if the input and the current OS stack trace getter
- // are the same; otherwise, deletes the old getter and makes the
- // input the current getter.
- void set_os_stack_trace_getter(OsStackTraceGetterInterface* getter);
-
- // Returns the current OS stack trace getter if it is not NULL;
- // otherwise, creates an OsStackTraceGetter, makes it the current
- // getter, and returns it.
- OsStackTraceGetterInterface* os_stack_trace_getter();
-
- // Returns the current OS stack trace as an std::string.
- //
- // The maximum number of stack frames to be included is specified by
- // the gtest_stack_trace_depth flag. The skip_count parameter
- // specifies the number of top frames to be skipped, which doesn't
- // count against the number of frames to be included.
- //
- // For example, if Foo() calls Bar(), which in turn calls
- // CurrentOsStackTraceExceptTop(1), Foo() will be included in the
- // trace but Bar() and CurrentOsStackTraceExceptTop() won't.
- std::string CurrentOsStackTraceExceptTop(int skip_count) GTEST_NO_INLINE_;
-
- // Finds and returns a TestSuite with the given name. If one doesn't
- // exist, creates one and returns it.
- //
- // Arguments:
- //
- // test_suite_name: name of the test suite
- // type_param: the name of the test's type parameter, or NULL if
- // this is not a typed or a type-parameterized test.
- // set_up_tc: pointer to the function that sets up the test suite
- // tear_down_tc: pointer to the function that tears down the test suite
- TestSuite* GetTestSuite(const char* test_suite_name, const char* type_param,
- internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc);
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- TestCase* GetTestCase(const char* test_case_name, const char* type_param,
- internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc) {
- return GetTestSuite(test_case_name, type_param, set_up_tc, tear_down_tc);
- }
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // Adds a TestInfo to the unit test.
- //
- // Arguments:
- //
- // set_up_tc: pointer to the function that sets up the test suite
- // tear_down_tc: pointer to the function that tears down the test suite
- // test_info: the TestInfo object
- void AddTestInfo(internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc,
- TestInfo* test_info) {
-#if GTEST_HAS_DEATH_TEST
- // In order to support thread-safe death tests, we need to
- // remember the original working directory when the test program
- // was first invoked. We cannot do this in RUN_ALL_TESTS(), as
- // the user may have changed the current directory before calling
- // RUN_ALL_TESTS(). Therefore we capture the current directory in
- // AddTestInfo(), which is called to register a TEST or TEST_F
- // before main() is reached.
- if (original_working_dir_.IsEmpty()) {
- original_working_dir_.Set(FilePath::GetCurrentDir());
- GTEST_CHECK_(!original_working_dir_.IsEmpty())
- << "Failed to get the current working directory.";
- }
-#endif // GTEST_HAS_DEATH_TEST
-
- GetTestSuite(test_info->test_suite_name(), test_info->type_param(),
- set_up_tc, tear_down_tc)
- ->AddTestInfo(test_info);
- }
-
- // Returns ParameterizedTestSuiteRegistry object used to keep track of
- // value-parameterized tests and instantiate and register them.
- internal::ParameterizedTestSuiteRegistry& parameterized_test_registry() {
- return parameterized_test_registry_;
- }
-
- std::set<std::string>* ignored_parameterized_test_suites() {
- return &ignored_parameterized_test_suites_;
- }
-
- // Returns TypeParameterizedTestSuiteRegistry object used to keep track of
- // type-parameterized tests and instantiations of them.
- internal::TypeParameterizedTestSuiteRegistry&
- type_parameterized_test_registry() {
- return type_parameterized_test_registry_;
- }
-
- // Sets the TestSuite object for the test that's currently running.
- void set_current_test_suite(TestSuite* a_current_test_suite) {
- current_test_suite_ = a_current_test_suite;
- }
-
- // Sets the TestInfo object for the test that's currently running. If
- // current_test_info is NULL, the assertion results will be stored in
- // ad_hoc_test_result_.
- void set_current_test_info(TestInfo* a_current_test_info) {
- current_test_info_ = a_current_test_info;
- }
-
- // Registers all parameterized tests defined using TEST_P and
- // INSTANTIATE_TEST_SUITE_P, creating regular tests for each test/parameter
- // combination. This method can be called more then once; it has guards
- // protecting from registering the tests more then once. If
- // value-parameterized tests are disabled, RegisterParameterizedTests is
- // present but does nothing.
- void RegisterParameterizedTests();
-
- // Runs all tests in this UnitTest object, prints the result, and
- // returns true if all tests are successful. If any exception is
- // thrown during a test, this test is considered to be failed, but
- // the rest of the tests will still be run.
- bool RunAllTests();
-
- // Clears the results of all tests, except the ad hoc tests.
- void ClearNonAdHocTestResult() {
- ForEach(test_suites_, TestSuite::ClearTestSuiteResult);
- }
-
- // Clears the results of ad-hoc test assertions.
- void ClearAdHocTestResult() {
- ad_hoc_test_result_.Clear();
- }
-
- // Adds a TestProperty to the current TestResult object when invoked in a
- // context of a test or a test suite, or to the global property set. If the
- // result already contains a property with the same key, the value will be
- // updated.
- void RecordProperty(const TestProperty& test_property);
-
- enum ReactionToSharding {
- HONOR_SHARDING_PROTOCOL,
- IGNORE_SHARDING_PROTOCOL
- };
-
- // Matches the full name of each test against the user-specified
- // filter to decide whether the test should run, then records the
- // result in each TestSuite and TestInfo object.
- // If shard_tests == HONOR_SHARDING_PROTOCOL, further filters tests
- // based on sharding variables in the environment.
- // Returns the number of tests that should run.
- int FilterTests(ReactionToSharding shard_tests);
-
- // Prints the names of the tests matching the user-specified filter flag.
- void ListTestsMatchingFilter();
-
- const TestSuite* current_test_suite() const { return current_test_suite_; }
- TestInfo* current_test_info() { return current_test_info_; }
- const TestInfo* current_test_info() const { return current_test_info_; }
-
- // Returns the vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*>& environments() { return environments_; }
-
- // Getters for the per-thread Google Test trace stack.
- std::vector<TraceInfo>& gtest_trace_stack() {
- return *(gtest_trace_stack_.pointer());
- }
- const std::vector<TraceInfo>& gtest_trace_stack() const {
- return gtest_trace_stack_.get();
- }
-
-#if GTEST_HAS_DEATH_TEST
- void InitDeathTestSubprocessControlInfo() {
- internal_run_death_test_flag_.reset(ParseInternalRunDeathTestFlag());
- }
- // Returns a pointer to the parsed --gtest_internal_run_death_test
- // flag, or NULL if that flag was not specified.
- // This information is useful only in a death test child process.
- // Must not be called before a call to InitGoogleTest.
- const InternalRunDeathTestFlag* internal_run_death_test_flag() const {
- return internal_run_death_test_flag_.get();
- }
-
- // Returns a pointer to the current death test factory.
- internal::DeathTestFactory* death_test_factory() {
- return death_test_factory_.get();
- }
-
- void SuppressTestEventsIfInSubprocess();
-
- friend class ReplaceDeathTestFactory;
-#endif // GTEST_HAS_DEATH_TEST
-
- // Initializes the event listener performing XML output as specified by
- // UnitTestOptions. Must not be called before InitGoogleTest.
- void ConfigureXmlOutput();
-
-#if GTEST_CAN_STREAM_RESULTS_
- // Initializes the event listener for streaming test results to a socket.
- // Must not be called before InitGoogleTest.
- void ConfigureStreamingOutput();
-#endif
-
- // Performs initialization dependent upon flag values obtained in
- // ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
- // ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
- // this function is also called from RunAllTests. Since this function can be
- // called more than once, it has to be idempotent.
- void PostFlagParsingInit();
-
- // Gets the random seed used at the start of the current test iteration.
- int random_seed() const { return random_seed_; }
-
- // Gets the random number generator.
- internal::Random* random() { return &random_; }
-
- // Shuffles all test suites, and the tests within each test suite,
- // making sure that death tests are still run first.
- void ShuffleTests();
-
- // Restores the test suites and tests to their order before the first shuffle.
- void UnshuffleTests();
-
- // Returns the value of GTEST_FLAG(catch_exceptions) at the moment
- // UnitTest::Run() starts.
- bool catch_exceptions() const { return catch_exceptions_; }
-
- private:
- friend class ::testing::UnitTest;
-
- // Used by UnitTest::Run() to capture the state of
- // GTEST_FLAG(catch_exceptions) at the moment it starts.
- void set_catch_exceptions(bool value) { catch_exceptions_ = value; }
-
- // The UnitTest object that owns this implementation object.
- UnitTest* const parent_;
-
- // The working directory when the first TEST() or TEST_F() was
- // executed.
- internal::FilePath original_working_dir_;
-
- // The default test part result reporters.
- DefaultGlobalTestPartResultReporter default_global_test_part_result_reporter_;
- DefaultPerThreadTestPartResultReporter
- default_per_thread_test_part_result_reporter_;
-
- // Points to (but doesn't own) the global test part result reporter.
- TestPartResultReporterInterface* global_test_part_result_repoter_;
-
- // Protects read and write access to global_test_part_result_reporter_.
- internal::Mutex global_test_part_result_reporter_mutex_;
-
- // Points to (but doesn't own) the per-thread test part result reporter.
- internal::ThreadLocal<TestPartResultReporterInterface*>
- per_thread_test_part_result_reporter_;
-
- // The vector of environments that need to be set-up/torn-down
- // before/after the tests are run.
- std::vector<Environment*> environments_;
-
- // The vector of TestSuites in their original order. It owns the
- // elements in the vector.
- std::vector<TestSuite*> test_suites_;
-
- // Provides a level of indirection for the test suite list to allow
- // easy shuffling and restoring the test suite order. The i-th
- // element of this vector is the index of the i-th test suite in the
- // shuffled order.
- std::vector<int> test_suite_indices_;
-
- // ParameterizedTestRegistry object used to register value-parameterized
- // tests.
- internal::ParameterizedTestSuiteRegistry parameterized_test_registry_;
- internal::TypeParameterizedTestSuiteRegistry
- type_parameterized_test_registry_;
-
- // The set holding the name of parameterized
- // test suites that may go uninstantiated.
- std::set<std::string> ignored_parameterized_test_suites_;
-
- // Indicates whether RegisterParameterizedTests() has been called already.
- bool parameterized_tests_registered_;
-
- // Index of the last death test suite registered. Initially -1.
- int last_death_test_suite_;
-
- // This points to the TestSuite for the currently running test. It
- // changes as Google Test goes through one test suite after another.
- // When no test is running, this is set to NULL and Google Test
- // stores assertion results in ad_hoc_test_result_. Initially NULL.
- TestSuite* current_test_suite_;
-
- // This points to the TestInfo for the currently running test. It
- // changes as Google Test goes through one test after another. When
- // no test is running, this is set to NULL and Google Test stores
- // assertion results in ad_hoc_test_result_. Initially NULL.
- TestInfo* current_test_info_;
-
- // Normally, a user only writes assertions inside a TEST or TEST_F,
- // or inside a function called by a TEST or TEST_F. Since Google
- // Test keeps track of which test is current running, it can
- // associate such an assertion with the test it belongs to.
- //
- // If an assertion is encountered when no TEST or TEST_F is running,
- // Google Test attributes the assertion result to an imaginary "ad hoc"
- // test, and records the result in ad_hoc_test_result_.
- TestResult ad_hoc_test_result_;
-
- // The list of event listeners that can be used to track events inside
- // Google Test.
- TestEventListeners listeners_;
-
- // The OS stack trace getter. Will be deleted when the UnitTest
- // object is destructed. By default, an OsStackTraceGetter is used,
- // but the user can set this field to use a custom getter if that is
- // desired.
- OsStackTraceGetterInterface* os_stack_trace_getter_;
-
- // True if and only if PostFlagParsingInit() has been called.
- bool post_flag_parse_init_performed_;
-
- // The random number seed used at the beginning of the test run.
- int random_seed_;
-
- // Our random number generator.
- internal::Random random_;
-
- // The time of the test program start, in ms from the start of the
- // UNIX epoch.
- TimeInMillis start_timestamp_;
-
- // How long the test took to run, in milliseconds.
- TimeInMillis elapsed_time_;
-
-#if GTEST_HAS_DEATH_TEST
- // The decomposed components of the gtest_internal_run_death_test flag,
- // parsed when RUN_ALL_TESTS is called.
- std::unique_ptr<InternalRunDeathTestFlag> internal_run_death_test_flag_;
- std::unique_ptr<internal::DeathTestFactory> death_test_factory_;
-#endif // GTEST_HAS_DEATH_TEST
-
- // A per-thread stack of traces created by the SCOPED_TRACE() macro.
- internal::ThreadLocal<std::vector<TraceInfo> > gtest_trace_stack_;
-
- // The value of GTEST_FLAG(catch_exceptions) at the moment RunAllTests()
- // starts.
- bool catch_exceptions_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(UnitTestImpl);
-}; // class UnitTestImpl
-
-// Convenience function for accessing the global UnitTest
-// implementation object.
-inline UnitTestImpl* GetUnitTestImpl() {
- return UnitTest::GetInstance()->impl();
-}
-
-#if GTEST_USES_SIMPLE_RE
-
-// Internal helper functions for implementing the simple regular
-// expression matcher.
-GTEST_API_ bool IsInSet(char ch, const char* str);
-GTEST_API_ bool IsAsciiDigit(char ch);
-GTEST_API_ bool IsAsciiPunct(char ch);
-GTEST_API_ bool IsRepeat(char ch);
-GTEST_API_ bool IsAsciiWhiteSpace(char ch);
-GTEST_API_ bool IsAsciiWordChar(char ch);
-GTEST_API_ bool IsValidEscape(char ch);
-GTEST_API_ bool AtomMatchesChar(bool escaped, char pattern, char ch);
-GTEST_API_ bool ValidateRegex(const char* regex);
-GTEST_API_ bool MatchRegexAtHead(const char* regex, const char* str);
-GTEST_API_ bool MatchRepetitionAndRegexAtHead(
- bool escaped, char ch, char repeat, const char* regex, const char* str);
-GTEST_API_ bool MatchRegexAnywhere(const char* regex, const char* str);
-
-#endif // GTEST_USES_SIMPLE_RE
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, char** argv);
-GTEST_API_ void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv);
-
-#if GTEST_HAS_DEATH_TEST
-
-// Returns the message describing the last system error, regardless of the
-// platform.
-GTEST_API_ std::string GetLastErrnoDescription();
-
-// Attempts to parse a string into a positive integer pointed to by the
-// number parameter. Returns true if that is possible.
-// GTEST_HAS_DEATH_TEST implies that we have ::std::string, so we can use
-// it here.
-template <typename Integer>
-bool ParseNaturalNumber(const ::std::string& str, Integer* number) {
- // Fail fast if the given string does not begin with a digit;
- // this bypasses strtoXXX's "optional leading whitespace and plus
- // or minus sign" semantics, which are undesirable here.
- if (str.empty() || !IsDigit(str[0])) {
- return false;
- }
- errno = 0;
-
- char* end;
- // BiggestConvertible is the largest integer type that system-provided
- // string-to-number conversion routines can return.
- using BiggestConvertible = unsigned long long; // NOLINT
-
- const BiggestConvertible parsed = strtoull(str.c_str(), &end, 10); // NOLINT
- const bool parse_success = *end == '\0' && errno == 0;
-
- GTEST_CHECK_(sizeof(Integer) <= sizeof(parsed));
-
- const Integer result = static_cast<Integer>(parsed);
- if (parse_success && static_cast<BiggestConvertible>(result) == parsed) {
- *number = result;
- return true;
- }
- return false;
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// TestResult contains some private methods that should be hidden from
-// Google Test user but are required for testing. This class allow our tests
-// to access them.
-//
-// This class is supplied only for the purpose of testing Google Test's own
-// constructs. Do not use it in user tests, either directly or indirectly.
-class TestResultAccessor {
- public:
- static void RecordProperty(TestResult* test_result,
- const std::string& xml_element,
- const TestProperty& property) {
- test_result->RecordProperty(xml_element, property);
- }
-
- static void ClearTestPartResults(TestResult* test_result) {
- test_result->ClearTestPartResults();
- }
-
- static const std::vector<testing::TestPartResult>& test_part_results(
- const TestResult& test_result) {
- return test_result.test_part_results();
- }
-};
-
-#if GTEST_CAN_STREAM_RESULTS_
-
-// Streams test results to the given port on the given host machine.
-class StreamingListener : public EmptyTestEventListener {
- public:
- // Abstract base class for writing strings to a socket.
- class AbstractSocketWriter {
- public:
- virtual ~AbstractSocketWriter() {}
-
- // Sends a string to the socket.
- virtual void Send(const std::string& message) = 0;
-
- // Closes the socket.
- virtual void CloseConnection() {}
-
- // Sends a string and a newline to the socket.
- void SendLn(const std::string& message) { Send(message + "\n"); }
- };
-
- // Concrete class for actually writing strings to a socket.
- class SocketWriter : public AbstractSocketWriter {
- public:
- SocketWriter(const std::string& host, const std::string& port)
- : sockfd_(-1), host_name_(host), port_num_(port) {
- MakeConnection();
- }
-
- ~SocketWriter() override {
- if (sockfd_ != -1)
- CloseConnection();
- }
-
- // Sends a string to the socket.
- void Send(const std::string& message) override {
- GTEST_CHECK_(sockfd_ != -1)
- << "Send() can be called only when there is a connection.";
-
- const auto len = static_cast<size_t>(message.length());
- if (write(sockfd_, message.c_str(), len) != static_cast<ssize_t>(len)) {
- GTEST_LOG_(WARNING)
- << "stream_result_to: failed to stream to "
- << host_name_ << ":" << port_num_;
- }
- }
-
- private:
- // Creates a client socket and connects to the server.
- void MakeConnection();
-
- // Closes the socket.
- void CloseConnection() override {
- GTEST_CHECK_(sockfd_ != -1)
- << "CloseConnection() can be called only when there is a connection.";
-
- close(sockfd_);
- sockfd_ = -1;
- }
-
- int sockfd_; // socket file descriptor
- const std::string host_name_;
- const std::string port_num_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SocketWriter);
- }; // class SocketWriter
-
- // Escapes '=', '&', '%', and '\n' characters in str as "%xx".
- static std::string UrlEncode(const char* str);
-
- StreamingListener(const std::string& host, const std::string& port)
- : socket_writer_(new SocketWriter(host, port)) {
- Start();
- }
-
- explicit StreamingListener(AbstractSocketWriter* socket_writer)
- : socket_writer_(socket_writer) { Start(); }
-
- void OnTestProgramStart(const UnitTest& /* unit_test */) override {
- SendLn("event=TestProgramStart");
- }
-
- void OnTestProgramEnd(const UnitTest& unit_test) override {
- // Note that Google Test current only report elapsed time for each
- // test iteration, not for the entire test program.
- SendLn("event=TestProgramEnd&passed=" + FormatBool(unit_test.Passed()));
-
- // Notify the streaming server to stop.
- socket_writer_->CloseConnection();
- }
-
- void OnTestIterationStart(const UnitTest& /* unit_test */,
- int iteration) override {
- SendLn("event=TestIterationStart&iteration=" +
- StreamableToString(iteration));
- }
-
- void OnTestIterationEnd(const UnitTest& unit_test,
- int /* iteration */) override {
- SendLn("event=TestIterationEnd&passed=" +
- FormatBool(unit_test.Passed()) + "&elapsed_time=" +
- StreamableToString(unit_test.elapsed_time()) + "ms");
- }
-
- // Note that "event=TestCaseStart" is a wire format and has to remain
- // "case" for compatibility
- void OnTestCaseStart(const TestCase& test_case) override {
- SendLn(std::string("event=TestCaseStart&name=") + test_case.name());
- }
-
- // Note that "event=TestCaseEnd" is a wire format and has to remain
- // "case" for compatibility
- void OnTestCaseEnd(const TestCase& test_case) override {
- SendLn("event=TestCaseEnd&passed=" + FormatBool(test_case.Passed()) +
- "&elapsed_time=" + StreamableToString(test_case.elapsed_time()) +
- "ms");
- }
-
- void OnTestStart(const TestInfo& test_info) override {
- SendLn(std::string("event=TestStart&name=") + test_info.name());
- }
-
- void OnTestEnd(const TestInfo& test_info) override {
- SendLn("event=TestEnd&passed=" +
- FormatBool((test_info.result())->Passed()) +
- "&elapsed_time=" +
- StreamableToString((test_info.result())->elapsed_time()) + "ms");
- }
-
- void OnTestPartResult(const TestPartResult& test_part_result) override {
- const char* file_name = test_part_result.file_name();
- if (file_name == nullptr) file_name = "";
- SendLn("event=TestPartResult&file=" + UrlEncode(file_name) +
- "&line=" + StreamableToString(test_part_result.line_number()) +
- "&message=" + UrlEncode(test_part_result.message()));
- }
-
- private:
- // Sends the given message and a newline to the socket.
- void SendLn(const std::string& message) { socket_writer_->SendLn(message); }
-
- // Called at the start of streaming to notify the receiver what
- // protocol we are using.
- void Start() { SendLn("gtest_streaming_protocol_version=1.0"); }
-
- std::string FormatBool(bool value) { return value ? "1" : "0"; }
-
- const std::unique_ptr<AbstractSocketWriter> socket_writer_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(StreamingListener);
-}; // class StreamingListener
-
-#endif // GTEST_CAN_STREAM_RESULTS_
-
-} // namespace internal
-} // namespace testing
-
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4251
-
-#endif // GOOGLETEST_SRC_GTEST_INTERNAL_INL_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-matchers.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-matchers.cc
deleted file mode 100644
index 65104ebab1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-matchers.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file implements just enough of the matcher interface to allow
-// EXPECT_DEATH and friends to accept a matcher argument.
-
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-port.h"
-#include "gtest/gtest-matchers.h"
-
-#include <string>
-
-namespace testing {
-
-// Constructs a matcher that matches a const std::string& whose value is
-// equal to s.
-Matcher<const std::string&>::Matcher(const std::string& s) { *this = Eq(s); }
-
-// Constructs a matcher that matches a const std::string& whose value is
-// equal to s.
-Matcher<const std::string&>::Matcher(const char* s) {
- *this = Eq(std::string(s));
-}
-
-// Constructs a matcher that matches a std::string whose value is equal to
-// s.
-Matcher<std::string>::Matcher(const std::string& s) { *this = Eq(s); }
-
-// Constructs a matcher that matches a std::string whose value is equal to
-// s.
-Matcher<std::string>::Matcher(const char* s) { *this = Eq(std::string(s)); }
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-// Constructs a matcher that matches a const StringView& whose value is
-// equal to s.
-Matcher<const internal::StringView&>::Matcher(const std::string& s) {
- *this = Eq(s);
-}
-
-// Constructs a matcher that matches a const StringView& whose value is
-// equal to s.
-Matcher<const internal::StringView&>::Matcher(const char* s) {
- *this = Eq(std::string(s));
-}
-
-// Constructs a matcher that matches a const StringView& whose value is
-// equal to s.
-Matcher<const internal::StringView&>::Matcher(internal::StringView s) {
- *this = Eq(std::string(s));
-}
-
-// Constructs a matcher that matches a StringView whose value is equal to
-// s.
-Matcher<internal::StringView>::Matcher(const std::string& s) { *this = Eq(s); }
-
-// Constructs a matcher that matches a StringView whose value is equal to
-// s.
-Matcher<internal::StringView>::Matcher(const char* s) {
- *this = Eq(std::string(s));
-}
-
-// Constructs a matcher that matches a StringView whose value is equal to
-// s.
-Matcher<internal::StringView>::Matcher(internal::StringView s) {
- *this = Eq(std::string(s));
-}
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-port.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-port.cc
deleted file mode 100644
index d47550aecf..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-port.cc
+++ /dev/null
@@ -1,1413 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/internal/gtest-port.h"
-
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <cstdint>
-#include <fstream>
-#include <memory>
-
-#if GTEST_OS_WINDOWS
-# include <windows.h>
-# include <io.h>
-# include <sys/stat.h>
-# include <map> // Used in ThreadLocal.
-# ifdef _MSC_VER
-# include <crtdbg.h>
-# endif // _MSC_VER
-#else
-# include <unistd.h>
-#endif // GTEST_OS_WINDOWS
-
-#if GTEST_OS_MAC
-# include <mach/mach_init.h>
-# include <mach/task.h>
-# include <mach/vm_map.h>
-#endif // GTEST_OS_MAC
-
-#if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
- GTEST_OS_NETBSD || GTEST_OS_OPENBSD
-# include <sys/sysctl.h>
-# if GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD
-# include <sys/user.h>
-# endif
-#endif
-
-#if GTEST_OS_QNX
-# include <devctl.h>
-# include <fcntl.h>
-# include <sys/procfs.h>
-#endif // GTEST_OS_QNX
-
-#if GTEST_OS_AIX
-# include <procinfo.h>
-# include <sys/types.h>
-#endif // GTEST_OS_AIX
-
-#if GTEST_OS_FUCHSIA
-# include <zircon/process.h>
-# include <zircon/syscalls.h>
-#endif // GTEST_OS_FUCHSIA
-
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest-message.h"
-#include "gtest/internal/gtest-internal.h"
-#include "gtest/internal/gtest-string.h"
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-namespace internal {
-
-#if defined(_MSC_VER) || defined(__BORLANDC__)
-// MSVC and C++Builder do not provide a definition of STDERR_FILENO.
-const int kStdOutFileno = 1;
-const int kStdErrFileno = 2;
-#else
-const int kStdOutFileno = STDOUT_FILENO;
-const int kStdErrFileno = STDERR_FILENO;
-#endif // _MSC_VER
-
-#if GTEST_OS_LINUX || GTEST_OS_GNU_HURD
-
-namespace {
-template <typename T>
-T ReadProcFileField(const std::string& filename, int field) {
- std::string dummy;
- std::ifstream file(filename.c_str());
- while (field-- > 0) {
- file >> dummy;
- }
- T output = 0;
- file >> output;
- return output;
-}
-} // namespace
-
-// Returns the number of active threads, or 0 when there is an error.
-size_t GetThreadCount() {
- const std::string filename =
- (Message() << "/proc/" << getpid() << "/stat").GetString();
- return ReadProcFileField<size_t>(filename, 19);
-}
-
-#elif GTEST_OS_MAC
-
-size_t GetThreadCount() {
- const task_t task = mach_task_self();
- mach_msg_type_number_t thread_count;
- thread_act_array_t thread_list;
- const kern_return_t status = task_threads(task, &thread_list, &thread_count);
- if (status == KERN_SUCCESS) {
- // task_threads allocates resources in thread_list and we need to free them
- // to avoid leaks.
- vm_deallocate(task,
- reinterpret_cast<vm_address_t>(thread_list),
- sizeof(thread_t) * thread_count);
- return static_cast<size_t>(thread_count);
- } else {
- return 0;
- }
-}
-
-#elif GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
- GTEST_OS_NETBSD
-
-#if GTEST_OS_NETBSD
-#undef KERN_PROC
-#define KERN_PROC KERN_PROC2
-#define kinfo_proc kinfo_proc2
-#endif
-
-#if GTEST_OS_DRAGONFLY
-#define KP_NLWP(kp) (kp.kp_nthreads)
-#elif GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD
-#define KP_NLWP(kp) (kp.ki_numthreads)
-#elif GTEST_OS_NETBSD
-#define KP_NLWP(kp) (kp.p_nlwps)
-#endif
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- int mib[] = {
- CTL_KERN,
- KERN_PROC,
- KERN_PROC_PID,
- getpid(),
-#if GTEST_OS_NETBSD
- sizeof(struct kinfo_proc),
- 1,
-#endif
- };
- u_int miblen = sizeof(mib) / sizeof(mib[0]);
- struct kinfo_proc info;
- size_t size = sizeof(info);
- if (sysctl(mib, miblen, &info, &size, NULL, 0)) {
- return 0;
- }
- return static_cast<size_t>(KP_NLWP(info));
-}
-#elif GTEST_OS_OPENBSD
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- int mib[] = {
- CTL_KERN,
- KERN_PROC,
- KERN_PROC_PID | KERN_PROC_SHOW_THREADS,
- getpid(),
- sizeof(struct kinfo_proc),
- 0,
- };
- u_int miblen = sizeof(mib) / sizeof(mib[0]);
-
- // get number of structs
- size_t size;
- if (sysctl(mib, miblen, NULL, &size, NULL, 0)) {
- return 0;
- }
-
- mib[5] = static_cast<int>(size / static_cast<size_t>(mib[4]));
-
- // populate array of structs
- struct kinfo_proc info[mib[5]];
- if (sysctl(mib, miblen, &info, &size, NULL, 0)) {
- return 0;
- }
-
- // exclude empty members
- size_t nthreads = 0;
- for (size_t i = 0; i < size / static_cast<size_t>(mib[4]); i++) {
- if (info[i].p_tid != -1)
- nthreads++;
- }
- return nthreads;
-}
-
-#elif GTEST_OS_QNX
-
-// Returns the number of threads running in the process, or 0 to indicate that
-// we cannot detect it.
-size_t GetThreadCount() {
- const int fd = open("/proc/self/as", O_RDONLY);
- if (fd < 0) {
- return 0;
- }
- procfs_info process_info;
- const int status =
- devctl(fd, DCMD_PROC_INFO, &process_info, sizeof(process_info), nullptr);
- close(fd);
- if (status == EOK) {
- return static_cast<size_t>(process_info.num_threads);
- } else {
- return 0;
- }
-}
-
-#elif GTEST_OS_AIX
-
-size_t GetThreadCount() {
- struct procentry64 entry;
- pid_t pid = getpid();
- int status = getprocs64(&entry, sizeof(entry), nullptr, 0, &pid, 1);
- if (status == 1) {
- return entry.pi_thcount;
- } else {
- return 0;
- }
-}
-
-#elif GTEST_OS_FUCHSIA
-
-size_t GetThreadCount() {
- int dummy_buffer;
- size_t avail;
- zx_status_t status = zx_object_get_info(
- zx_process_self(),
- ZX_INFO_PROCESS_THREADS,
- &dummy_buffer,
- 0,
- nullptr,
- &avail);
- if (status == ZX_OK) {
- return avail;
- } else {
- return 0;
- }
-}
-
-#else
-
-size_t GetThreadCount() {
- // There's no portable way to detect the number of threads, so we just
- // return 0 to indicate that we cannot detect it.
- return 0;
-}
-
-#endif // GTEST_OS_LINUX
-
-#if GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
-
-AutoHandle::AutoHandle()
- : handle_(INVALID_HANDLE_VALUE) {}
-
-AutoHandle::AutoHandle(Handle handle)
- : handle_(handle) {}
-
-AutoHandle::~AutoHandle() {
- Reset();
-}
-
-AutoHandle::Handle AutoHandle::Get() const {
- return handle_;
-}
-
-void AutoHandle::Reset() {
- Reset(INVALID_HANDLE_VALUE);
-}
-
-void AutoHandle::Reset(HANDLE handle) {
- // Resetting with the same handle we already own is invalid.
- if (handle_ != handle) {
- if (IsCloseable()) {
- ::CloseHandle(handle_);
- }
- handle_ = handle;
- } else {
- GTEST_CHECK_(!IsCloseable())
- << "Resetting a valid handle to itself is likely a programmer error "
- "and thus not allowed.";
- }
-}
-
-bool AutoHandle::IsCloseable() const {
- // Different Windows APIs may use either of these values to represent an
- // invalid handle.
- return handle_ != nullptr && handle_ != INVALID_HANDLE_VALUE;
-}
-
-Mutex::Mutex()
- : owner_thread_id_(0),
- type_(kDynamic),
- critical_section_init_phase_(0),
- critical_section_(new CRITICAL_SECTION) {
- ::InitializeCriticalSection(critical_section_);
-}
-
-Mutex::~Mutex() {
- // Static mutexes are leaked intentionally. It is not thread-safe to try
- // to clean them up.
- if (type_ == kDynamic) {
- ::DeleteCriticalSection(critical_section_);
- delete critical_section_;
- critical_section_ = nullptr;
- }
-}
-
-void Mutex::Lock() {
- ThreadSafeLazyInit();
- ::EnterCriticalSection(critical_section_);
- owner_thread_id_ = ::GetCurrentThreadId();
-}
-
-void Mutex::Unlock() {
- ThreadSafeLazyInit();
- // We don't protect writing to owner_thread_id_ here, as it's the
- // caller's responsibility to ensure that the current thread holds the
- // mutex when this is called.
- owner_thread_id_ = 0;
- ::LeaveCriticalSection(critical_section_);
-}
-
-// Does nothing if the current thread holds the mutex. Otherwise, crashes
-// with high probability.
-void Mutex::AssertHeld() {
- ThreadSafeLazyInit();
- GTEST_CHECK_(owner_thread_id_ == ::GetCurrentThreadId())
- << "The current thread is not holding the mutex @" << this;
-}
-
-namespace {
-
-#ifdef _MSC_VER
-// Use the RAII idiom to flag mem allocs that are intentionally never
-// deallocated. The motivation is to silence the false positive mem leaks
-// that are reported by the debug version of MS's CRT which can only detect
-// if an alloc is missing a matching deallocation.
-// Example:
-// MemoryIsNotDeallocated memory_is_not_deallocated;
-// critical_section_ = new CRITICAL_SECTION;
-//
-class MemoryIsNotDeallocated
-{
- public:
- MemoryIsNotDeallocated() : old_crtdbg_flag_(0) {
- old_crtdbg_flag_ = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- // Set heap allocation block type to _IGNORE_BLOCK so that MS debug CRT
- // doesn't report mem leak if there's no matching deallocation.
- (void)_CrtSetDbgFlag(old_crtdbg_flag_ & ~_CRTDBG_ALLOC_MEM_DF);
- }
-
- ~MemoryIsNotDeallocated() {
- // Restore the original _CRTDBG_ALLOC_MEM_DF flag
- (void)_CrtSetDbgFlag(old_crtdbg_flag_);
- }
-
- private:
- int old_crtdbg_flag_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(MemoryIsNotDeallocated);
-};
-#endif // _MSC_VER
-
-} // namespace
-
-// Initializes owner_thread_id_ and critical_section_ in static mutexes.
-void Mutex::ThreadSafeLazyInit() {
- // Dynamic mutexes are initialized in the constructor.
- if (type_ == kStatic) {
- switch (
- ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) {
- case 0:
- // If critical_section_init_phase_ was 0 before the exchange, we
- // are the first to test it and need to perform the initialization.
- owner_thread_id_ = 0;
- {
- // Use RAII to flag that following mem alloc is never deallocated.
-#ifdef _MSC_VER
- MemoryIsNotDeallocated memory_is_not_deallocated;
-#endif // _MSC_VER
- critical_section_ = new CRITICAL_SECTION;
- }
- ::InitializeCriticalSection(critical_section_);
- // Updates the critical_section_init_phase_ to 2 to signal
- // initialization complete.
- GTEST_CHECK_(::InterlockedCompareExchange(
- &critical_section_init_phase_, 2L, 1L) ==
- 1L);
- break;
- case 1:
- // Somebody else is already initializing the mutex; spin until they
- // are done.
- while (::InterlockedCompareExchange(&critical_section_init_phase_,
- 2L,
- 2L) != 2L) {
- // Possibly yields the rest of the thread's time slice to other
- // threads.
- ::Sleep(0);
- }
- break;
-
- case 2:
- break; // The mutex is already initialized and ready for use.
-
- default:
- GTEST_CHECK_(false)
- << "Unexpected value of critical_section_init_phase_ "
- << "while initializing a static mutex.";
- }
- }
-}
-
-namespace {
-
-class ThreadWithParamSupport : public ThreadWithParamBase {
- public:
- static HANDLE CreateThread(Runnable* runnable,
- Notification* thread_can_start) {
- ThreadMainParam* param = new ThreadMainParam(runnable, thread_can_start);
- DWORD thread_id;
- HANDLE thread_handle = ::CreateThread(
- nullptr, // Default security.
- 0, // Default stack size.
- &ThreadWithParamSupport::ThreadMain,
- param, // Parameter to ThreadMainStatic
- 0x0, // Default creation flags.
- &thread_id); // Need a valid pointer for the call to work under Win98.
- GTEST_CHECK_(thread_handle != nullptr)
- << "CreateThread failed with error " << ::GetLastError() << ".";
- if (thread_handle == nullptr) {
- delete param;
- }
- return thread_handle;
- }
-
- private:
- struct ThreadMainParam {
- ThreadMainParam(Runnable* runnable, Notification* thread_can_start)
- : runnable_(runnable),
- thread_can_start_(thread_can_start) {
- }
- std::unique_ptr<Runnable> runnable_;
- // Does not own.
- Notification* thread_can_start_;
- };
-
- static DWORD WINAPI ThreadMain(void* ptr) {
- // Transfers ownership.
- std::unique_ptr<ThreadMainParam> param(static_cast<ThreadMainParam*>(ptr));
- if (param->thread_can_start_ != nullptr)
- param->thread_can_start_->WaitForNotification();
- param->runnable_->Run();
- return 0;
- }
-
- // Prohibit instantiation.
- ThreadWithParamSupport();
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ThreadWithParamSupport);
-};
-
-} // namespace
-
-ThreadWithParamBase::ThreadWithParamBase(Runnable *runnable,
- Notification* thread_can_start)
- : thread_(ThreadWithParamSupport::CreateThread(runnable,
- thread_can_start)) {
-}
-
-ThreadWithParamBase::~ThreadWithParamBase() {
- Join();
-}
-
-void ThreadWithParamBase::Join() {
- GTEST_CHECK_(::WaitForSingleObject(thread_.Get(), INFINITE) == WAIT_OBJECT_0)
- << "Failed to join the thread with error " << ::GetLastError() << ".";
-}
-
-// Maps a thread to a set of ThreadIdToThreadLocals that have values
-// instantiated on that thread and notifies them when the thread exits. A
-// ThreadLocal instance is expected to persist until all threads it has
-// values on have terminated.
-class ThreadLocalRegistryImpl {
- public:
- // Registers thread_local_instance as having value on the current thread.
- // Returns a value that can be used to identify the thread from other threads.
- static ThreadLocalValueHolderBase* GetValueOnCurrentThread(
- const ThreadLocalBase* thread_local_instance) {
-#ifdef _MSC_VER
- MemoryIsNotDeallocated memory_is_not_deallocated;
-#endif // _MSC_VER
- DWORD current_thread = ::GetCurrentThreadId();
- MutexLock lock(&mutex_);
- ThreadIdToThreadLocals* const thread_to_thread_locals =
- GetThreadLocalsMapLocked();
- ThreadIdToThreadLocals::iterator thread_local_pos =
- thread_to_thread_locals->find(current_thread);
- if (thread_local_pos == thread_to_thread_locals->end()) {
- thread_local_pos = thread_to_thread_locals->insert(
- std::make_pair(current_thread, ThreadLocalValues())).first;
- StartWatcherThreadFor(current_thread);
- }
- ThreadLocalValues& thread_local_values = thread_local_pos->second;
- ThreadLocalValues::iterator value_pos =
- thread_local_values.find(thread_local_instance);
- if (value_pos == thread_local_values.end()) {
- value_pos =
- thread_local_values
- .insert(std::make_pair(
- thread_local_instance,
- std::shared_ptr<ThreadLocalValueHolderBase>(
- thread_local_instance->NewValueForCurrentThread())))
- .first;
- }
- return value_pos->second.get();
- }
-
- static void OnThreadLocalDestroyed(
- const ThreadLocalBase* thread_local_instance) {
- std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders;
- // Clean up the ThreadLocalValues data structure while holding the lock, but
- // defer the destruction of the ThreadLocalValueHolderBases.
- {
- MutexLock lock(&mutex_);
- ThreadIdToThreadLocals* const thread_to_thread_locals =
- GetThreadLocalsMapLocked();
- for (ThreadIdToThreadLocals::iterator it =
- thread_to_thread_locals->begin();
- it != thread_to_thread_locals->end();
- ++it) {
- ThreadLocalValues& thread_local_values = it->second;
- ThreadLocalValues::iterator value_pos =
- thread_local_values.find(thread_local_instance);
- if (value_pos != thread_local_values.end()) {
- value_holders.push_back(value_pos->second);
- thread_local_values.erase(value_pos);
- // This 'if' can only be successful at most once, so theoretically we
- // could break out of the loop here, but we don't bother doing so.
- }
- }
- }
- // Outside the lock, let the destructor for 'value_holders' deallocate the
- // ThreadLocalValueHolderBases.
- }
-
- static void OnThreadExit(DWORD thread_id) {
- GTEST_CHECK_(thread_id != 0) << ::GetLastError();
- std::vector<std::shared_ptr<ThreadLocalValueHolderBase> > value_holders;
- // Clean up the ThreadIdToThreadLocals data structure while holding the
- // lock, but defer the destruction of the ThreadLocalValueHolderBases.
- {
- MutexLock lock(&mutex_);
- ThreadIdToThreadLocals* const thread_to_thread_locals =
- GetThreadLocalsMapLocked();
- ThreadIdToThreadLocals::iterator thread_local_pos =
- thread_to_thread_locals->find(thread_id);
- if (thread_local_pos != thread_to_thread_locals->end()) {
- ThreadLocalValues& thread_local_values = thread_local_pos->second;
- for (ThreadLocalValues::iterator value_pos =
- thread_local_values.begin();
- value_pos != thread_local_values.end();
- ++value_pos) {
- value_holders.push_back(value_pos->second);
- }
- thread_to_thread_locals->erase(thread_local_pos);
- }
- }
- // Outside the lock, let the destructor for 'value_holders' deallocate the
- // ThreadLocalValueHolderBases.
- }
-
- private:
- // In a particular thread, maps a ThreadLocal object to its value.
- typedef std::map<const ThreadLocalBase*,
- std::shared_ptr<ThreadLocalValueHolderBase> >
- ThreadLocalValues;
- // Stores all ThreadIdToThreadLocals having values in a thread, indexed by
- // thread's ID.
- typedef std::map<DWORD, ThreadLocalValues> ThreadIdToThreadLocals;
-
- // Holds the thread id and thread handle that we pass from
- // StartWatcherThreadFor to WatcherThreadFunc.
- typedef std::pair<DWORD, HANDLE> ThreadIdAndHandle;
-
- static void StartWatcherThreadFor(DWORD thread_id) {
- // The returned handle will be kept in thread_map and closed by
- // watcher_thread in WatcherThreadFunc.
- HANDLE thread = ::OpenThread(SYNCHRONIZE | THREAD_QUERY_INFORMATION,
- FALSE,
- thread_id);
- GTEST_CHECK_(thread != nullptr);
- // We need to pass a valid thread ID pointer into CreateThread for it
- // to work correctly under Win98.
- DWORD watcher_thread_id;
- HANDLE watcher_thread = ::CreateThread(
- nullptr, // Default security.
- 0, // Default stack size
- &ThreadLocalRegistryImpl::WatcherThreadFunc,
- reinterpret_cast<LPVOID>(new ThreadIdAndHandle(thread_id, thread)),
- CREATE_SUSPENDED, &watcher_thread_id);
- GTEST_CHECK_(watcher_thread != nullptr)
- << "CreateThread failed with error " << ::GetLastError() << ".";
- // Give the watcher thread the same priority as ours to avoid being
- // blocked by it.
- ::SetThreadPriority(watcher_thread,
- ::GetThreadPriority(::GetCurrentThread()));
- ::ResumeThread(watcher_thread);
- ::CloseHandle(watcher_thread);
- }
-
- // Monitors exit from a given thread and notifies those
- // ThreadIdToThreadLocals about thread termination.
- static DWORD WINAPI WatcherThreadFunc(LPVOID param) {
- const ThreadIdAndHandle* tah =
- reinterpret_cast<const ThreadIdAndHandle*>(param);
- GTEST_CHECK_(
- ::WaitForSingleObject(tah->second, INFINITE) == WAIT_OBJECT_0);
- OnThreadExit(tah->first);
- ::CloseHandle(tah->second);
- delete tah;
- return 0;
- }
-
- // Returns map of thread local instances.
- static ThreadIdToThreadLocals* GetThreadLocalsMapLocked() {
- mutex_.AssertHeld();
-#ifdef _MSC_VER
- MemoryIsNotDeallocated memory_is_not_deallocated;
-#endif // _MSC_VER
- static ThreadIdToThreadLocals* map = new ThreadIdToThreadLocals();
- return map;
- }
-
- // Protects access to GetThreadLocalsMapLocked() and its return value.
- static Mutex mutex_;
- // Protects access to GetThreadMapLocked() and its return value.
- static Mutex thread_map_mutex_;
-};
-
-Mutex ThreadLocalRegistryImpl::mutex_(Mutex::kStaticMutex); // NOLINT
-Mutex ThreadLocalRegistryImpl::thread_map_mutex_(Mutex::kStaticMutex); // NOLINT
-
-ThreadLocalValueHolderBase* ThreadLocalRegistry::GetValueOnCurrentThread(
- const ThreadLocalBase* thread_local_instance) {
- return ThreadLocalRegistryImpl::GetValueOnCurrentThread(
- thread_local_instance);
-}
-
-void ThreadLocalRegistry::OnThreadLocalDestroyed(
- const ThreadLocalBase* thread_local_instance) {
- ThreadLocalRegistryImpl::OnThreadLocalDestroyed(thread_local_instance);
-}
-
-#endif // GTEST_IS_THREADSAFE && GTEST_OS_WINDOWS
-
-#if GTEST_USES_POSIX_RE
-
-// Implements RE. Currently only needed for death tests.
-
-RE::~RE() {
- if (is_valid_) {
- // regfree'ing an invalid regex might crash because the content
- // of the regex is undefined. Since the regex's are essentially
- // the same, one cannot be valid (or invalid) without the other
- // being so too.
- regfree(&partial_regex_);
- regfree(&full_regex_);
- }
- free(const_cast<char*>(pattern_));
-}
-
-// Returns true if and only if regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.full_regex_, str, 1, &match, 0) == 0;
-}
-
-// Returns true if and only if regular expression re matches a substring of
-// str (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- if (!re.is_valid_) return false;
-
- regmatch_t match;
- return regexec(&re.partial_regex_, str, 1, &match, 0) == 0;
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = posix::StrDup(regex);
-
- // Reserves enough bytes to hold the regular expression used for a
- // full match.
- const size_t full_regex_len = strlen(regex) + 10;
- char* const full_pattern = new char[full_regex_len];
-
- snprintf(full_pattern, full_regex_len, "^(%s)$", regex);
- is_valid_ = regcomp(&full_regex_, full_pattern, REG_EXTENDED) == 0;
- // We want to call regcomp(&partial_regex_, ...) even if the
- // previous expression returns false. Otherwise partial_regex_ may
- // not be properly initialized can may cause trouble when it's
- // freed.
- //
- // Some implementation of POSIX regex (e.g. on at least some
- // versions of Cygwin) doesn't accept the empty string as a valid
- // regex. We change it to an equivalent form "()" to be safe.
- if (is_valid_) {
- const char* const partial_regex = (*regex == '\0') ? "()" : regex;
- is_valid_ = regcomp(&partial_regex_, partial_regex, REG_EXTENDED) == 0;
- }
- EXPECT_TRUE(is_valid_)
- << "Regular expression \"" << regex
- << "\" is not a valid POSIX Extended regular expression.";
-
- delete[] full_pattern;
-}
-
-#elif GTEST_USES_SIMPLE_RE
-
-// Returns true if and only if ch appears anywhere in str (excluding the
-// terminating '\0' character).
-bool IsInSet(char ch, const char* str) {
- return ch != '\0' && strchr(str, ch) != nullptr;
-}
-
-// Returns true if and only if ch belongs to the given classification.
-// Unlike similar functions in <ctype.h>, these aren't affected by the
-// current locale.
-bool IsAsciiDigit(char ch) { return '0' <= ch && ch <= '9'; }
-bool IsAsciiPunct(char ch) {
- return IsInSet(ch, "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~");
-}
-bool IsRepeat(char ch) { return IsInSet(ch, "?*+"); }
-bool IsAsciiWhiteSpace(char ch) { return IsInSet(ch, " \f\n\r\t\v"); }
-bool IsAsciiWordChar(char ch) {
- return ('a' <= ch && ch <= 'z') || ('A' <= ch && ch <= 'Z') ||
- ('0' <= ch && ch <= '9') || ch == '_';
-}
-
-// Returns true if and only if "\\c" is a supported escape sequence.
-bool IsValidEscape(char c) {
- return (IsAsciiPunct(c) || IsInSet(c, "dDfnrsStvwW"));
-}
-
-// Returns true if and only if the given atom (specified by escaped and
-// pattern) matches ch. The result is undefined if the atom is invalid.
-bool AtomMatchesChar(bool escaped, char pattern_char, char ch) {
- if (escaped) { // "\\p" where p is pattern_char.
- switch (pattern_char) {
- case 'd': return IsAsciiDigit(ch);
- case 'D': return !IsAsciiDigit(ch);
- case 'f': return ch == '\f';
- case 'n': return ch == '\n';
- case 'r': return ch == '\r';
- case 's': return IsAsciiWhiteSpace(ch);
- case 'S': return !IsAsciiWhiteSpace(ch);
- case 't': return ch == '\t';
- case 'v': return ch == '\v';
- case 'w': return IsAsciiWordChar(ch);
- case 'W': return !IsAsciiWordChar(ch);
- }
- return IsAsciiPunct(pattern_char) && pattern_char == ch;
- }
-
- return (pattern_char == '.' && ch != '\n') || pattern_char == ch;
-}
-
-// Helper function used by ValidateRegex() to format error messages.
-static std::string FormatRegexSyntaxError(const char* regex, int index) {
- return (Message() << "Syntax error at index " << index
- << " in simple regular expression \"" << regex << "\": ").GetString();
-}
-
-// Generates non-fatal failures and returns false if regex is invalid;
-// otherwise returns true.
-bool ValidateRegex(const char* regex) {
- if (regex == nullptr) {
- ADD_FAILURE() << "NULL is not a valid simple regular expression.";
- return false;
- }
-
- bool is_valid = true;
-
- // True if and only if ?, *, or + can follow the previous atom.
- bool prev_repeatable = false;
- for (int i = 0; regex[i]; i++) {
- if (regex[i] == '\\') { // An escape sequence
- i++;
- if (regex[i] == '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "'\\' cannot appear at the end.";
- return false;
- }
-
- if (!IsValidEscape(regex[i])) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i - 1)
- << "invalid escape sequence \"\\" << regex[i] << "\".";
- is_valid = false;
- }
- prev_repeatable = true;
- } else { // Not an escape sequence.
- const char ch = regex[i];
-
- if (ch == '^' && i > 0) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'^' can only appear at the beginning.";
- is_valid = false;
- } else if (ch == '$' && regex[i + 1] != '\0') {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'$' can only appear at the end.";
- is_valid = false;
- } else if (IsInSet(ch, "()[]{}|")) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' is unsupported.";
- is_valid = false;
- } else if (IsRepeat(ch) && !prev_repeatable) {
- ADD_FAILURE() << FormatRegexSyntaxError(regex, i)
- << "'" << ch << "' can only follow a repeatable token.";
- is_valid = false;
- }
-
- prev_repeatable = !IsInSet(ch, "^$?*+");
- }
- }
-
- return is_valid;
-}
-
-// Matches a repeated regex atom followed by a valid simple regular
-// expression. The regex atom is defined as c if escaped is false,
-// or \c otherwise. repeat is the repetition meta character (?, *,
-// or +). The behavior is undefined if str contains too many
-// characters to be indexable by size_t, in which case the test will
-// probably time out anyway. We are fine with this limitation as
-// std::string has it too.
-bool MatchRepetitionAndRegexAtHead(
- bool escaped, char c, char repeat, const char* regex,
- const char* str) {
- const size_t min_count = (repeat == '+') ? 1 : 0;
- const size_t max_count = (repeat == '?') ? 1 :
- static_cast<size_t>(-1) - 1;
- // We cannot call numeric_limits::max() as it conflicts with the
- // max() macro on Windows.
-
- for (size_t i = 0; i <= max_count; ++i) {
- // We know that the atom matches each of the first i characters in str.
- if (i >= min_count && MatchRegexAtHead(regex, str + i)) {
- // We have enough matches at the head, and the tail matches too.
- // Since we only care about *whether* the pattern matches str
- // (as opposed to *how* it matches), there is no need to find a
- // greedy match.
- return true;
- }
- if (str[i] == '\0' || !AtomMatchesChar(escaped, c, str[i]))
- return false;
- }
- return false;
-}
-
-// Returns true if and only if regex matches a prefix of str. regex must
-// be a valid simple regular expression and not start with "^", or the
-// result is undefined.
-bool MatchRegexAtHead(const char* regex, const char* str) {
- if (*regex == '\0') // An empty regex matches a prefix of anything.
- return true;
-
- // "$" only matches the end of a string. Note that regex being
- // valid guarantees that there's nothing after "$" in it.
- if (*regex == '$')
- return *str == '\0';
-
- // Is the first thing in regex an escape sequence?
- const bool escaped = *regex == '\\';
- if (escaped)
- ++regex;
- if (IsRepeat(regex[1])) {
- // MatchRepetitionAndRegexAtHead() calls MatchRegexAtHead(), so
- // here's an indirect recursion. It terminates as the regex gets
- // shorter in each recursion.
- return MatchRepetitionAndRegexAtHead(
- escaped, regex[0], regex[1], regex + 2, str);
- } else {
- // regex isn't empty, isn't "$", and doesn't start with a
- // repetition. We match the first atom of regex with the first
- // character of str and recurse.
- return (*str != '\0') && AtomMatchesChar(escaped, *regex, *str) &&
- MatchRegexAtHead(regex + 1, str + 1);
- }
-}
-
-// Returns true if and only if regex matches any substring of str. regex must
-// be a valid simple regular expression, or the result is undefined.
-//
-// The algorithm is recursive, but the recursion depth doesn't exceed
-// the regex length, so we won't need to worry about running out of
-// stack space normally. In rare cases the time complexity can be
-// exponential with respect to the regex length + the string length,
-// but usually it's must faster (often close to linear).
-bool MatchRegexAnywhere(const char* regex, const char* str) {
- if (regex == nullptr || str == nullptr) return false;
-
- if (*regex == '^')
- return MatchRegexAtHead(regex + 1, str);
-
- // A successful match can be anywhere in str.
- do {
- if (MatchRegexAtHead(regex, str))
- return true;
- } while (*str++ != '\0');
- return false;
-}
-
-// Implements the RE class.
-
-RE::~RE() {
- free(const_cast<char*>(pattern_));
- free(const_cast<char*>(full_pattern_));
-}
-
-// Returns true if and only if regular expression re matches the entire str.
-bool RE::FullMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.full_pattern_, str);
-}
-
-// Returns true if and only if regular expression re matches a substring of
-// str (including str itself).
-bool RE::PartialMatch(const char* str, const RE& re) {
- return re.is_valid_ && MatchRegexAnywhere(re.pattern_, str);
-}
-
-// Initializes an RE from its string representation.
-void RE::Init(const char* regex) {
- pattern_ = full_pattern_ = nullptr;
- if (regex != nullptr) {
- pattern_ = posix::StrDup(regex);
- }
-
- is_valid_ = ValidateRegex(regex);
- if (!is_valid_) {
- // No need to calculate the full pattern when the regex is invalid.
- return;
- }
-
- const size_t len = strlen(regex);
- // Reserves enough bytes to hold the regular expression used for a
- // full match: we need space to prepend a '^', append a '$', and
- // terminate the string with '\0'.
- char* buffer = static_cast<char*>(malloc(len + 3));
- full_pattern_ = buffer;
-
- if (*regex != '^')
- *buffer++ = '^'; // Makes sure full_pattern_ starts with '^'.
-
- // We don't use snprintf or strncpy, as they trigger a warning when
- // compiled with VC++ 8.0.
- memcpy(buffer, regex, len);
- buffer += len;
-
- if (len == 0 || regex[len - 1] != '$')
- *buffer++ = '$'; // Makes sure full_pattern_ ends with '$'.
-
- *buffer = '\0';
-}
-
-#endif // GTEST_USES_POSIX_RE
-
-const char kUnknownFile[] = "unknown file";
-
-// Formats a source file path and a line number as they would appear
-// in an error message from the compiler used to compile this code.
-GTEST_API_ ::std::string FormatFileLocation(const char* file, int line) {
- const std::string file_name(file == nullptr ? kUnknownFile : file);
-
- if (line < 0) {
- return file_name + ":";
- }
-#ifdef _MSC_VER
- return file_name + "(" + StreamableToString(line) + "):";
-#else
- return file_name + ":" + StreamableToString(line) + ":";
-#endif // _MSC_VER
-}
-
-// Formats a file location for compiler-independent XML output.
-// Although this function is not platform dependent, we put it next to
-// FormatFileLocation in order to contrast the two functions.
-// Note that FormatCompilerIndependentFileLocation() does NOT append colon
-// to the file location it produces, unlike FormatFileLocation().
-GTEST_API_ ::std::string FormatCompilerIndependentFileLocation(
- const char* file, int line) {
- const std::string file_name(file == nullptr ? kUnknownFile : file);
-
- if (line < 0)
- return file_name;
- else
- return file_name + ":" + StreamableToString(line);
-}
-
-GTestLog::GTestLog(GTestLogSeverity severity, const char* file, int line)
- : severity_(severity) {
- const char* const marker =
- severity == GTEST_INFO ? "[ INFO ]" :
- severity == GTEST_WARNING ? "[WARNING]" :
- severity == GTEST_ERROR ? "[ ERROR ]" : "[ FATAL ]";
- GetStream() << ::std::endl << marker << " "
- << FormatFileLocation(file, line).c_str() << ": ";
-}
-
-// Flushes the buffers and, if severity is GTEST_FATAL, aborts the program.
-GTestLog::~GTestLog() {
- GetStream() << ::std::endl;
- if (severity_ == GTEST_FATAL) {
- fflush(stderr);
- posix::Abort();
- }
-}
-
-// Disable Microsoft deprecation warnings for POSIX functions called from
-// this class (creat, dup, dup2, and close)
-GTEST_DISABLE_MSC_DEPRECATED_PUSH_()
-
-#if GTEST_HAS_STREAM_REDIRECTION
-
-// Object that captures an output stream (stdout/stderr).
-class CapturedStream {
- public:
- // The ctor redirects the stream to a temporary file.
- explicit CapturedStream(int fd) : fd_(fd), uncaptured_fd_(dup(fd)) {
-# if GTEST_OS_WINDOWS
- char temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT
- char temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT
-
- ::GetTempPathA(sizeof(temp_dir_path), temp_dir_path);
- const UINT success = ::GetTempFileNameA(temp_dir_path,
- "gtest_redir",
- 0, // Generate unique file name.
- temp_file_path);
- GTEST_CHECK_(success != 0)
- << "Unable to create a temporary file in " << temp_dir_path;
- const int captured_fd = creat(temp_file_path, _S_IREAD | _S_IWRITE);
- GTEST_CHECK_(captured_fd != -1) << "Unable to open temporary file "
- << temp_file_path;
- filename_ = temp_file_path;
-# else
- // There's no guarantee that a test has write access to the current
- // directory, so we create the temporary file in a temporary directory.
- std::string name_template;
-
-# if GTEST_OS_LINUX_ANDROID
- // Note: Android applications are expected to call the framework's
- // Context.getExternalStorageDirectory() method through JNI to get
- // the location of the world-writable SD Card directory. However,
- // this requires a Context handle, which cannot be retrieved
- // globally from native code. Doing so also precludes running the
- // code as part of a regular standalone executable, which doesn't
- // run in a Dalvik process (e.g. when running it through 'adb shell').
- //
- // The location /data/local/tmp is directly accessible from native code.
- // '/sdcard' and other variants cannot be relied on, as they are not
- // guaranteed to be mounted, or may have a delay in mounting.
- name_template = "/data/local/tmp/";
-# elif GTEST_OS_IOS
- char user_temp_dir[PATH_MAX + 1];
-
- // Documented alternative to NSTemporaryDirectory() (for obtaining creating
- // a temporary directory) at
- // https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/RaceConditions.html#//apple_ref/doc/uid/TP40002585-SW10
- //
- // _CS_DARWIN_USER_TEMP_DIR (as well as _CS_DARWIN_USER_CACHE_DIR) is not
- // documented in the confstr() man page at
- // https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/confstr.3.html#//apple_ref/doc/man/3/confstr
- // but are still available, according to the WebKit patches at
- // https://trac.webkit.org/changeset/262004/webkit
- // https://trac.webkit.org/changeset/263705/webkit
- //
- // The confstr() implementation falls back to getenv("TMPDIR"). See
- // https://opensource.apple.com/source/Libc/Libc-1439.100.3/gen/confstr.c.auto.html
- ::confstr(_CS_DARWIN_USER_TEMP_DIR, user_temp_dir, sizeof(user_temp_dir));
-
- name_template = user_temp_dir;
- if (name_template.back() != GTEST_PATH_SEP_[0])
- name_template.push_back(GTEST_PATH_SEP_[0]);
-# else
- name_template = "/tmp/";
-# endif
- name_template.append("gtest_captured_stream.XXXXXX");
-
- // mkstemp() modifies the string bytes in place, and does not go beyond the
- // string's length. This results in well-defined behavior in C++17.
- //
- // The const_cast is needed below C++17. The constraints on std::string
- // implementations in C++11 and above make assumption behind the const_cast
- // fairly safe.
- const int captured_fd = ::mkstemp(const_cast<char*>(name_template.data()));
- if (captured_fd == -1) {
- GTEST_LOG_(WARNING)
- << "Failed to create tmp file " << name_template
- << " for test; does the test have access to the /tmp directory?";
- }
- filename_ = std::move(name_template);
-# endif // GTEST_OS_WINDOWS
- fflush(nullptr);
- dup2(captured_fd, fd_);
- close(captured_fd);
- }
-
- ~CapturedStream() {
- remove(filename_.c_str());
- }
-
- std::string GetCapturedString() {
- if (uncaptured_fd_ != -1) {
- // Restores the original stream.
- fflush(nullptr);
- dup2(uncaptured_fd_, fd_);
- close(uncaptured_fd_);
- uncaptured_fd_ = -1;
- }
-
- FILE* const file = posix::FOpen(filename_.c_str(), "r");
- if (file == nullptr) {
- GTEST_LOG_(FATAL) << "Failed to open tmp file " << filename_
- << " for capturing stream.";
- }
- const std::string content = ReadEntireFile(file);
- posix::FClose(file);
- return content;
- }
-
- private:
- const int fd_; // A stream to capture.
- int uncaptured_fd_;
- // Name of the temporary file holding the stderr output.
- ::std::string filename_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(CapturedStream);
-};
-
-GTEST_DISABLE_MSC_DEPRECATED_POP_()
-
-static CapturedStream* g_captured_stderr = nullptr;
-static CapturedStream* g_captured_stdout = nullptr;
-
-// Starts capturing an output stream (stdout/stderr).
-static void CaptureStream(int fd, const char* stream_name,
- CapturedStream** stream) {
- if (*stream != nullptr) {
- GTEST_LOG_(FATAL) << "Only one " << stream_name
- << " capturer can exist at a time.";
- }
- *stream = new CapturedStream(fd);
-}
-
-// Stops capturing the output stream and returns the captured string.
-static std::string GetCapturedStream(CapturedStream** captured_stream) {
- const std::string content = (*captured_stream)->GetCapturedString();
-
- delete *captured_stream;
- *captured_stream = nullptr;
-
- return content;
-}
-
-// Starts capturing stdout.
-void CaptureStdout() {
- CaptureStream(kStdOutFileno, "stdout", &g_captured_stdout);
-}
-
-// Starts capturing stderr.
-void CaptureStderr() {
- CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr);
-}
-
-// Stops capturing stdout and returns the captured string.
-std::string GetCapturedStdout() {
- return GetCapturedStream(&g_captured_stdout);
-}
-
-// Stops capturing stderr and returns the captured string.
-std::string GetCapturedStderr() {
- return GetCapturedStream(&g_captured_stderr);
-}
-
-#endif // GTEST_HAS_STREAM_REDIRECTION
-
-
-
-
-
-size_t GetFileSize(FILE* file) {
- fseek(file, 0, SEEK_END);
- return static_cast<size_t>(ftell(file));
-}
-
-std::string ReadEntireFile(FILE* file) {
- const size_t file_size = GetFileSize(file);
- char* const buffer = new char[file_size];
-
- size_t bytes_last_read = 0; // # of bytes read in the last fread()
- size_t bytes_read = 0; // # of bytes read so far
-
- fseek(file, 0, SEEK_SET);
-
- // Keeps reading the file until we cannot read further or the
- // pre-determined file size is reached.
- do {
- bytes_last_read = fread(buffer+bytes_read, 1, file_size-bytes_read, file);
- bytes_read += bytes_last_read;
- } while (bytes_last_read > 0 && bytes_read < file_size);
-
- const std::string content(buffer, bytes_read);
- delete[] buffer;
-
- return content;
-}
-
-#if GTEST_HAS_DEATH_TEST
-static const std::vector<std::string>* g_injected_test_argvs =
- nullptr; // Owned.
-
-std::vector<std::string> GetInjectableArgvs() {
- if (g_injected_test_argvs != nullptr) {
- return *g_injected_test_argvs;
- }
- return GetArgvs();
-}
-
-void SetInjectableArgvs(const std::vector<std::string>* new_argvs) {
- if (g_injected_test_argvs != new_argvs) delete g_injected_test_argvs;
- g_injected_test_argvs = new_argvs;
-}
-
-void SetInjectableArgvs(const std::vector<std::string>& new_argvs) {
- SetInjectableArgvs(
- new std::vector<std::string>(new_argvs.begin(), new_argvs.end()));
-}
-
-void ClearInjectableArgvs() {
- delete g_injected_test_argvs;
- g_injected_test_argvs = nullptr;
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-#if GTEST_OS_WINDOWS_MOBILE
-namespace posix {
-void Abort() {
- DebugBreak();
- TerminateProcess(GetCurrentProcess(), 1);
-}
-} // namespace posix
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Returns the name of the environment variable corresponding to the
-// given flag. For example, FlagToEnvVar("foo") will return
-// "GTEST_FOO" in the open-source version.
-static std::string FlagToEnvVar(const char* flag) {
- const std::string full_flag =
- (Message() << GTEST_FLAG_PREFIX_ << flag).GetString();
-
- Message env_var;
- for (size_t i = 0; i != full_flag.length(); i++) {
- env_var << ToUpper(full_flag.c_str()[i]);
- }
-
- return env_var.GetString();
-}
-
-// Parses 'str' for a 32-bit signed integer. If successful, writes
-// the result to *value and returns true; otherwise leaves *value
-// unchanged and returns false.
-bool ParseInt32(const Message& src_text, const char* str, int32_t* value) {
- // Parses the environment variable as a decimal integer.
- char* end = nullptr;
- const long long_value = strtol(str, &end, 10); // NOLINT
-
- // Has strtol() consumed all characters in the string?
- if (*end != '\0') {
- // No - an invalid character was encountered.
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value \"" << str << "\".\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- // Is the parsed value in the range of an int32_t?
- const auto result = static_cast<int32_t>(long_value);
- if (long_value == LONG_MAX || long_value == LONG_MIN ||
- // The parsed value overflows as a long. (strtol() returns
- // LONG_MAX or LONG_MIN when the input overflows.)
- result != long_value
- // The parsed value overflows as an int32_t.
- ) {
- Message msg;
- msg << "WARNING: " << src_text
- << " is expected to be a 32-bit integer, but actually"
- << " has value " << str << ", which overflows.\n";
- printf("%s", msg.GetString().c_str());
- fflush(stdout);
- return false;
- }
-
- *value = result;
- return true;
-}
-
-// Reads and returns the Boolean environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-//
-// The value is considered true if and only if it's not "0".
-bool BoolFromGTestEnv(const char* flag, bool default_value) {
-#if defined(GTEST_GET_BOOL_FROM_ENV_)
- return GTEST_GET_BOOL_FROM_ENV_(flag, default_value);
-#else
- const std::string env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- return string_value == nullptr ? default_value
- : strcmp(string_value, "0") != 0;
-#endif // defined(GTEST_GET_BOOL_FROM_ENV_)
-}
-
-// Reads and returns a 32-bit integer stored in the environment
-// variable corresponding to the given flag; if it isn't set or
-// doesn't represent a valid 32-bit integer, returns default_value.
-int32_t Int32FromGTestEnv(const char* flag, int32_t default_value) {
-#if defined(GTEST_GET_INT32_FROM_ENV_)
- return GTEST_GET_INT32_FROM_ENV_(flag, default_value);
-#else
- const std::string env_var = FlagToEnvVar(flag);
- const char* const string_value = posix::GetEnv(env_var.c_str());
- if (string_value == nullptr) {
- // The environment variable is not set.
- return default_value;
- }
-
- int32_t result = default_value;
- if (!ParseInt32(Message() << "Environment variable " << env_var,
- string_value, &result)) {
- printf("The default value %s is used.\n",
- (Message() << default_value).GetString().c_str());
- fflush(stdout);
- return default_value;
- }
-
- return result;
-#endif // defined(GTEST_GET_INT32_FROM_ENV_)
-}
-
-// As a special case for the 'output' flag, if GTEST_OUTPUT is not
-// set, we look for XML_OUTPUT_FILE, which is set by the Bazel build
-// system. The value of XML_OUTPUT_FILE is a filename without the
-// "xml:" prefix of GTEST_OUTPUT.
-// Note that this is meant to be called at the call site so it does
-// not check that the flag is 'output'
-// In essence this checks an env variable called XML_OUTPUT_FILE
-// and if it is set we prepend "xml:" to its value, if it not set we return ""
-std::string OutputFlagAlsoCheckEnvVar(){
- std::string default_value_for_output_flag = "";
- const char* xml_output_file_env = posix::GetEnv("XML_OUTPUT_FILE");
- if (nullptr != xml_output_file_env) {
- default_value_for_output_flag = std::string("xml:") + xml_output_file_env;
- }
- return default_value_for_output_flag;
-}
-
-// Reads and returns the string environment variable corresponding to
-// the given flag; if it's not set, returns default_value.
-const char* StringFromGTestEnv(const char* flag, const char* default_value) {
-#if defined(GTEST_GET_STRING_FROM_ENV_)
- return GTEST_GET_STRING_FROM_ENV_(flag, default_value);
-#else
- const std::string env_var = FlagToEnvVar(flag);
- const char* const value = posix::GetEnv(env_var.c_str());
- return value == nullptr ? default_value : value;
-#endif // defined(GTEST_GET_STRING_FROM_ENV_)
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-printers.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-printers.cc
deleted file mode 100644
index 0c80ab7c1a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-printers.cc
+++ /dev/null
@@ -1,578 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Test - The Google C++ Testing and Mocking Framework
-//
-// This file implements a universal value printer that can print a
-// value of any type T:
-//
-// void ::testing::internal::UniversalPrinter<T>::Print(value, ostream_ptr);
-//
-// It uses the << operator when possible, and prints the bytes in the
-// object otherwise. A user can override its behavior for a class
-// type Foo by defining either operator<<(::std::ostream&, const Foo&)
-// or void PrintTo(const Foo&, ::std::ostream*) in the namespace that
-// defines Foo.
-
-#include "gtest/gtest-printers.h"
-
-#include <stdio.h>
-
-#include <cctype>
-#include <cstdint>
-#include <cwchar>
-#include <ostream> // NOLINT
-#include <string>
-#include <type_traits>
-
-#include "gtest/internal/gtest-port.h"
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-
-namespace {
-
-using ::std::ostream;
-
-// Prints a segment of bytes in the given object.
-GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
-GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
-void PrintByteSegmentInObjectTo(const unsigned char* obj_bytes, size_t start,
- size_t count, ostream* os) {
- char text[5] = "";
- for (size_t i = 0; i != count; i++) {
- const size_t j = start + i;
- if (i != 0) {
- // Organizes the bytes into groups of 2 for easy parsing by
- // human.
- if ((j % 2) == 0)
- *os << ' ';
- else
- *os << '-';
- }
- GTEST_SNPRINTF_(text, sizeof(text), "%02X", obj_bytes[j]);
- *os << text;
- }
-}
-
-// Prints the bytes in the given value to the given ostream.
-void PrintBytesInObjectToImpl(const unsigned char* obj_bytes, size_t count,
- ostream* os) {
- // Tells the user how big the object is.
- *os << count << "-byte object <";
-
- const size_t kThreshold = 132;
- const size_t kChunkSize = 64;
- // If the object size is bigger than kThreshold, we'll have to omit
- // some details by printing only the first and the last kChunkSize
- // bytes.
- if (count < kThreshold) {
- PrintByteSegmentInObjectTo(obj_bytes, 0, count, os);
- } else {
- PrintByteSegmentInObjectTo(obj_bytes, 0, kChunkSize, os);
- *os << " ... ";
- // Rounds up to 2-byte boundary.
- const size_t resume_pos = (count - kChunkSize + 1)/2*2;
- PrintByteSegmentInObjectTo(obj_bytes, resume_pos, count - resume_pos, os);
- }
- *os << ">";
-}
-
-// Helpers for widening a character to char32_t. Since the standard does not
-// specify if char / wchar_t is signed or unsigned, it is important to first
-// convert it to the unsigned type of the same width before widening it to
-// char32_t.
-template <typename CharType>
-char32_t ToChar32(CharType in) {
- return static_cast<char32_t>(
- static_cast<typename std::make_unsigned<CharType>::type>(in));
-}
-
-} // namespace
-
-namespace internal {
-
-// Delegates to PrintBytesInObjectToImpl() to print the bytes in the
-// given object. The delegation simplifies the implementation, which
-// uses the << operator and thus is easier done outside of the
-// ::testing::internal namespace, which contains a << operator that
-// sometimes conflicts with the one in STL.
-void PrintBytesInObjectTo(const unsigned char* obj_bytes, size_t count,
- ostream* os) {
- PrintBytesInObjectToImpl(obj_bytes, count, os);
-}
-
-// Depending on the value of a char (or wchar_t), we print it in one
-// of three formats:
-// - as is if it's a printable ASCII (e.g. 'a', '2', ' '),
-// - as a hexadecimal escape sequence (e.g. '\x7F'), or
-// - as a special escape sequence (e.g. '\r', '\n').
-enum CharFormat {
- kAsIs,
- kHexEscape,
- kSpecialEscape
-};
-
-// Returns true if c is a printable ASCII character. We test the
-// value of c directly instead of calling isprint(), which is buggy on
-// Windows Mobile.
-inline bool IsPrintableAscii(char32_t c) { return 0x20 <= c && c <= 0x7E; }
-
-// Prints c (of type char, char8_t, char16_t, char32_t, or wchar_t) as a
-// character literal without the quotes, escaping it when necessary; returns how
-// c was formatted.
-template <typename Char>
-static CharFormat PrintAsCharLiteralTo(Char c, ostream* os) {
- const char32_t u_c = ToChar32(c);
- switch (u_c) {
- case L'\0':
- *os << "\\0";
- break;
- case L'\'':
- *os << "\\'";
- break;
- case L'\\':
- *os << "\\\\";
- break;
- case L'\a':
- *os << "\\a";
- break;
- case L'\b':
- *os << "\\b";
- break;
- case L'\f':
- *os << "\\f";
- break;
- case L'\n':
- *os << "\\n";
- break;
- case L'\r':
- *os << "\\r";
- break;
- case L'\t':
- *os << "\\t";
- break;
- case L'\v':
- *os << "\\v";
- break;
- default:
- if (IsPrintableAscii(u_c)) {
- *os << static_cast<char>(c);
- return kAsIs;
- } else {
- ostream::fmtflags flags = os->flags();
- *os << "\\x" << std::hex << std::uppercase << static_cast<int>(u_c);
- os->flags(flags);
- return kHexEscape;
- }
- }
- return kSpecialEscape;
-}
-
-// Prints a char32_t c as if it's part of a string literal, escaping it when
-// necessary; returns how c was formatted.
-static CharFormat PrintAsStringLiteralTo(char32_t c, ostream* os) {
- switch (c) {
- case L'\'':
- *os << "'";
- return kAsIs;
- case L'"':
- *os << "\\\"";
- return kSpecialEscape;
- default:
- return PrintAsCharLiteralTo(c, os);
- }
-}
-
-static const char* GetCharWidthPrefix(char) {
- return "";
-}
-
-static const char* GetCharWidthPrefix(signed char) {
- return "";
-}
-
-static const char* GetCharWidthPrefix(unsigned char) {
- return "";
-}
-
-#ifdef __cpp_char8_t
-static const char* GetCharWidthPrefix(char8_t) {
- return "u8";
-}
-#endif
-
-static const char* GetCharWidthPrefix(char16_t) {
- return "u";
-}
-
-static const char* GetCharWidthPrefix(char32_t) {
- return "U";
-}
-
-static const char* GetCharWidthPrefix(wchar_t) {
- return "L";
-}
-
-// Prints a char c as if it's part of a string literal, escaping it when
-// necessary; returns how c was formatted.
-static CharFormat PrintAsStringLiteralTo(char c, ostream* os) {
- return PrintAsStringLiteralTo(ToChar32(c), os);
-}
-
-#ifdef __cpp_char8_t
-static CharFormat PrintAsStringLiteralTo(char8_t c, ostream* os) {
- return PrintAsStringLiteralTo(ToChar32(c), os);
-}
-#endif
-
-static CharFormat PrintAsStringLiteralTo(char16_t c, ostream* os) {
- return PrintAsStringLiteralTo(ToChar32(c), os);
-}
-
-static CharFormat PrintAsStringLiteralTo(wchar_t c, ostream* os) {
- return PrintAsStringLiteralTo(ToChar32(c), os);
-}
-
-// Prints a character c (of type char, char8_t, char16_t, char32_t, or wchar_t)
-// and its code. '\0' is printed as "'\\0'", other unprintable characters are
-// also properly escaped using the standard C++ escape sequence.
-template <typename Char>
-void PrintCharAndCodeTo(Char c, ostream* os) {
- // First, print c as a literal in the most readable form we can find.
- *os << GetCharWidthPrefix(c) << "'";
- const CharFormat format = PrintAsCharLiteralTo(c, os);
- *os << "'";
-
- // To aid user debugging, we also print c's code in decimal, unless
- // it's 0 (in which case c was printed as '\\0', making the code
- // obvious).
- if (c == 0)
- return;
- *os << " (" << static_cast<int>(c);
-
- // For more convenience, we print c's code again in hexadecimal,
- // unless c was already printed in the form '\x##' or the code is in
- // [1, 9].
- if (format == kHexEscape || (1 <= c && c <= 9)) {
- // Do nothing.
- } else {
- *os << ", 0x" << String::FormatHexInt(static_cast<int>(c));
- }
- *os << ")";
-}
-
-void PrintTo(unsigned char c, ::std::ostream* os) { PrintCharAndCodeTo(c, os); }
-void PrintTo(signed char c, ::std::ostream* os) { PrintCharAndCodeTo(c, os); }
-
-// Prints a wchar_t as a symbol if it is printable or as its internal
-// code otherwise and also as its code. L'\0' is printed as "L'\\0'".
-void PrintTo(wchar_t wc, ostream* os) { PrintCharAndCodeTo(wc, os); }
-
-// TODO(dcheng): Consider making this delegate to PrintCharAndCodeTo() as well.
-void PrintTo(char32_t c, ::std::ostream* os) {
- *os << std::hex << "U+" << std::uppercase << std::setfill('0') << std::setw(4)
- << static_cast<uint32_t>(c);
-}
-
-// gcc/clang __{u,}int128_t
-#if defined(__SIZEOF_INT128__)
-void PrintTo(__uint128_t v, ::std::ostream* os) {
- if (v == 0) {
- *os << "0";
- return;
- }
-
- // Buffer large enough for ceil(log10(2^128))==39 and the null terminator
- char buf[40];
- char* p = buf + sizeof(buf);
-
- // Some configurations have a __uint128_t, but no support for built in
- // division. Do manual long division instead.
-
- uint64_t high = static_cast<uint64_t>(v >> 64);
- uint64_t low = static_cast<uint64_t>(v);
-
- *--p = 0;
- while (high != 0 || low != 0) {
- uint64_t high_mod = high % 10;
- high = high / 10;
- // This is the long division algorithm specialized for a divisor of 10 and
- // only two elements.
- // Notable values:
- // 2^64 / 10 == 1844674407370955161
- // 2^64 % 10 == 6
- const uint64_t carry = 6 * high_mod + low % 10;
- low = low / 10 + high_mod * 1844674407370955161 + carry / 10;
-
- char digit = static_cast<char>(carry % 10);
- *--p = '0' + digit;
- }
- *os << p;
-}
-void PrintTo(__int128_t v, ::std::ostream* os) {
- __uint128_t uv = static_cast<__uint128_t>(v);
- if (v < 0) {
- *os << "-";
- uv = -uv;
- }
- PrintTo(uv, os);
-}
-#endif // __SIZEOF_INT128__
-
-// Prints the given array of characters to the ostream. CharType must be either
-// char, char8_t, char16_t, char32_t, or wchar_t.
-// The array starts at begin, the length is len, it may include '\0' characters
-// and may not be NUL-terminated.
-template <typename CharType>
-GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
-GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
-static CharFormat PrintCharsAsStringTo(
- const CharType* begin, size_t len, ostream* os) {
- const char* const quote_prefix = GetCharWidthPrefix(*begin);
- *os << quote_prefix << "\"";
- bool is_previous_hex = false;
- CharFormat print_format = kAsIs;
- for (size_t index = 0; index < len; ++index) {
- const CharType cur = begin[index];
- if (is_previous_hex && IsXDigit(cur)) {
- // Previous character is of '\x..' form and this character can be
- // interpreted as another hexadecimal digit in its number. Break string to
- // disambiguate.
- *os << "\" " << quote_prefix << "\"";
- }
- is_previous_hex = PrintAsStringLiteralTo(cur, os) == kHexEscape;
- // Remember if any characters required hex escaping.
- if (is_previous_hex) {
- print_format = kHexEscape;
- }
- }
- *os << "\"";
- return print_format;
-}
-
-// Prints a (const) char/wchar_t array of 'len' elements, starting at address
-// 'begin'. CharType must be either char or wchar_t.
-template <typename CharType>
-GTEST_ATTRIBUTE_NO_SANITIZE_MEMORY_
-GTEST_ATTRIBUTE_NO_SANITIZE_ADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_HWADDRESS_
-GTEST_ATTRIBUTE_NO_SANITIZE_THREAD_
-static void UniversalPrintCharArray(
- const CharType* begin, size_t len, ostream* os) {
- // The code
- // const char kFoo[] = "foo";
- // generates an array of 4, not 3, elements, with the last one being '\0'.
- //
- // Therefore when printing a char array, we don't print the last element if
- // it's '\0', such that the output matches the string literal as it's
- // written in the source code.
- if (len > 0 && begin[len - 1] == '\0') {
- PrintCharsAsStringTo(begin, len - 1, os);
- return;
- }
-
- // If, however, the last element in the array is not '\0', e.g.
- // const char kFoo[] = { 'f', 'o', 'o' };
- // we must print the entire array. We also print a message to indicate
- // that the array is not NUL-terminated.
- PrintCharsAsStringTo(begin, len, os);
- *os << " (no terminating NUL)";
-}
-
-// Prints a (const) char array of 'len' elements, starting at address 'begin'.
-void UniversalPrintArray(const char* begin, size_t len, ostream* os) {
- UniversalPrintCharArray(begin, len, os);
-}
-
-#ifdef __cpp_char8_t
-// Prints a (const) char8_t array of 'len' elements, starting at address
-// 'begin'.
-void UniversalPrintArray(const char8_t* begin, size_t len, ostream* os) {
- UniversalPrintCharArray(begin, len, os);
-}
-#endif
-
-// Prints a (const) char16_t array of 'len' elements, starting at address
-// 'begin'.
-void UniversalPrintArray(const char16_t* begin, size_t len, ostream* os) {
- UniversalPrintCharArray(begin, len, os);
-}
-
-// Prints a (const) char32_t array of 'len' elements, starting at address
-// 'begin'.
-void UniversalPrintArray(const char32_t* begin, size_t len, ostream* os) {
- UniversalPrintCharArray(begin, len, os);
-}
-
-// Prints a (const) wchar_t array of 'len' elements, starting at address
-// 'begin'.
-void UniversalPrintArray(const wchar_t* begin, size_t len, ostream* os) {
- UniversalPrintCharArray(begin, len, os);
-}
-
-namespace {
-
-// Prints a null-terminated C-style string to the ostream.
-template <typename Char>
-void PrintCStringTo(const Char* s, ostream* os) {
- if (s == nullptr) {
- *os << "NULL";
- } else {
- *os << ImplicitCast_<const void*>(s) << " pointing to ";
- PrintCharsAsStringTo(s, std::char_traits<Char>::length(s), os);
- }
-}
-
-} // anonymous namespace
-
-void PrintTo(const char* s, ostream* os) { PrintCStringTo(s, os); }
-
-#ifdef __cpp_char8_t
-void PrintTo(const char8_t* s, ostream* os) { PrintCStringTo(s, os); }
-#endif
-
-void PrintTo(const char16_t* s, ostream* os) { PrintCStringTo(s, os); }
-
-void PrintTo(const char32_t* s, ostream* os) { PrintCStringTo(s, os); }
-
-// MSVC compiler can be configured to define whar_t as a typedef
-// of unsigned short. Defining an overload for const wchar_t* in that case
-// would cause pointers to unsigned shorts be printed as wide strings,
-// possibly accessing more memory than intended and causing invalid
-// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
-// wchar_t is implemented as a native type.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-// Prints the given wide C string to the ostream.
-void PrintTo(const wchar_t* s, ostream* os) { PrintCStringTo(s, os); }
-#endif // wchar_t is native
-
-namespace {
-
-bool ContainsUnprintableControlCodes(const char* str, size_t length) {
- const unsigned char *s = reinterpret_cast<const unsigned char *>(str);
-
- for (size_t i = 0; i < length; i++) {
- unsigned char ch = *s++;
- if (std::iscntrl(ch)) {
- switch (ch) {
- case '\t':
- case '\n':
- case '\r':
- break;
- default:
- return true;
- }
- }
- }
- return false;
-}
-
-bool IsUTF8TrailByte(unsigned char t) { return 0x80 <= t && t<= 0xbf; }
-
-bool IsValidUTF8(const char* str, size_t length) {
- const unsigned char *s = reinterpret_cast<const unsigned char *>(str);
-
- for (size_t i = 0; i < length;) {
- unsigned char lead = s[i++];
-
- if (lead <= 0x7f) {
- continue; // single-byte character (ASCII) 0..7F
- }
- if (lead < 0xc2) {
- return false; // trail byte or non-shortest form
- } else if (lead <= 0xdf && (i + 1) <= length && IsUTF8TrailByte(s[i])) {
- ++i; // 2-byte character
- } else if (0xe0 <= lead && lead <= 0xef && (i + 2) <= length &&
- IsUTF8TrailByte(s[i]) &&
- IsUTF8TrailByte(s[i + 1]) &&
- // check for non-shortest form and surrogate
- (lead != 0xe0 || s[i] >= 0xa0) &&
- (lead != 0xed || s[i] < 0xa0)) {
- i += 2; // 3-byte character
- } else if (0xf0 <= lead && lead <= 0xf4 && (i + 3) <= length &&
- IsUTF8TrailByte(s[i]) &&
- IsUTF8TrailByte(s[i + 1]) &&
- IsUTF8TrailByte(s[i + 2]) &&
- // check for non-shortest form
- (lead != 0xf0 || s[i] >= 0x90) &&
- (lead != 0xf4 || s[i] < 0x90)) {
- i += 3; // 4-byte character
- } else {
- return false;
- }
- }
- return true;
-}
-
-void ConditionalPrintAsText(const char* str, size_t length, ostream* os) {
- if (!ContainsUnprintableControlCodes(str, length) &&
- IsValidUTF8(str, length)) {
- *os << "\n As Text: \"" << str << "\"";
- }
-}
-
-} // anonymous namespace
-
-void PrintStringTo(const ::std::string& s, ostream* os) {
- if (PrintCharsAsStringTo(s.data(), s.size(), os) == kHexEscape) {
- if (GTEST_FLAG_GET(print_utf8)) {
- ConditionalPrintAsText(s.data(), s.size(), os);
- }
- }
-}
-
-#ifdef __cpp_char8_t
-void PrintU8StringTo(const ::std::u8string& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-#endif
-
-void PrintU16StringTo(const ::std::u16string& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-
-void PrintU32StringTo(const ::std::u32string& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-
-#if GTEST_HAS_STD_WSTRING
-void PrintWideStringTo(const ::std::wstring& s, ostream* os) {
- PrintCharsAsStringTo(s.data(), s.size(), os);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-} // namespace internal
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-test-part.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-test-part.cc
deleted file mode 100644
index a938683ced..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-test-part.cc
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// The Google C++ Testing and Mocking Framework (Google Test)
-
-#include "gtest/gtest-test-part.h"
-
-#include "gtest/internal/gtest-port.h"
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-
-using internal::GetUnitTestImpl;
-
-// Gets the summary of the failure message by omitting the stack trace
-// in it.
-std::string TestPartResult::ExtractSummary(const char* message) {
- const char* const stack_trace = strstr(message, internal::kStackTraceMarker);
- return stack_trace == nullptr ? message : std::string(message, stack_trace);
-}
-
-// Prints a TestPartResult object.
-std::ostream& operator<<(std::ostream& os, const TestPartResult& result) {
- return os << internal::FormatFileLocation(result.file_name(),
- result.line_number())
- << " "
- << (result.type() == TestPartResult::kSuccess
- ? "Success"
- : result.type() == TestPartResult::kSkip
- ? "Skipped"
- : result.type() == TestPartResult::kFatalFailure
- ? "Fatal failure"
- : "Non-fatal failure")
- << ":\n"
- << result.message() << std::endl;
-}
-
-// Appends a TestPartResult to the array.
-void TestPartResultArray::Append(const TestPartResult& result) {
- array_.push_back(result);
-}
-
-// Returns the TestPartResult at the given index (0-based).
-const TestPartResult& TestPartResultArray::GetTestPartResult(int index) const {
- if (index < 0 || index >= size()) {
- printf("\nInvalid index (%d) into TestPartResultArray.\n", index);
- internal::posix::Abort();
- }
-
- return array_[static_cast<size_t>(index)];
-}
-
-// Returns the number of TestPartResult objects in the array.
-int TestPartResultArray::size() const {
- return static_cast<int>(array_.size());
-}
-
-namespace internal {
-
-HasNewFatalFailureHelper::HasNewFatalFailureHelper()
- : has_new_fatal_failure_(false),
- original_reporter_(GetUnitTestImpl()->
- GetTestPartResultReporterForCurrentThread()) {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(this);
-}
-
-HasNewFatalFailureHelper::~HasNewFatalFailureHelper() {
- GetUnitTestImpl()->SetTestPartResultReporterForCurrentThread(
- original_reporter_);
-}
-
-void HasNewFatalFailureHelper::ReportTestPartResult(
- const TestPartResult& result) {
- if (result.fatally_failed())
- has_new_fatal_failure_ = true;
- original_reporter_->ReportTestPartResult(result);
-}
-
-} // namespace internal
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-typed-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-typed-test.cc
deleted file mode 100644
index c02c3df659..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest-typed-test.cc
+++ /dev/null
@@ -1,107 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest-typed-test.h"
-
-#include "gtest/gtest.h"
-
-namespace testing {
-namespace internal {
-
-// Skips to the first non-space char in str. Returns an empty string if str
-// contains only whitespace characters.
-static const char* SkipSpaces(const char* str) {
- while (IsSpace(*str))
- str++;
- return str;
-}
-
-static std::vector<std::string> SplitIntoTestNames(const char* src) {
- std::vector<std::string> name_vec;
- src = SkipSpaces(src);
- for (; src != nullptr; src = SkipComma(src)) {
- name_vec.push_back(StripTrailingSpaces(GetPrefixUntilComma(src)));
- }
- return name_vec;
-}
-
-// Verifies that registered_tests match the test names in
-// registered_tests_; returns registered_tests if successful, or
-// aborts the program otherwise.
-const char* TypedTestSuitePState::VerifyRegisteredTestNames(
- const char* test_suite_name, const char* file, int line,
- const char* registered_tests) {
- RegisterTypeParameterizedTestSuite(test_suite_name, CodeLocation(file, line));
-
- typedef RegisteredTestsMap::const_iterator RegisteredTestIter;
- registered_ = true;
-
- std::vector<std::string> name_vec = SplitIntoTestNames(registered_tests);
-
- Message errors;
-
- std::set<std::string> tests;
- for (std::vector<std::string>::const_iterator name_it = name_vec.begin();
- name_it != name_vec.end(); ++name_it) {
- const std::string& name = *name_it;
- if (tests.count(name) != 0) {
- errors << "Test " << name << " is listed more than once.\n";
- continue;
- }
-
- if (registered_tests_.count(name) != 0) {
- tests.insert(name);
- } else {
- errors << "No test named " << name
- << " can be found in this test suite.\n";
- }
- }
-
- for (RegisteredTestIter it = registered_tests_.begin();
- it != registered_tests_.end();
- ++it) {
- if (tests.count(it->first) == 0) {
- errors << "You forgot to list test " << it->first << ".\n";
- }
- }
-
- const std::string& errors_str = errors.GetString();
- if (errors_str != "") {
- fprintf(stderr, "%s %s", FormatFileLocation(file, line).c_str(),
- errors_str.c_str());
- fflush(stderr);
- posix::Abort();
- }
-
- return registered_tests;
-}
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest.cc
deleted file mode 100644
index f8a291aed1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest.cc
+++ /dev/null
@@ -1,6824 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// The Google C++ Testing and Mocking Framework (Google Test)
-
-#include "gtest/gtest.h"
-
-#include <ctype.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <time.h>
-#include <wchar.h>
-#include <wctype.h>
-
-#include <algorithm>
-#include <chrono> // NOLINT
-#include <cmath>
-#include <cstdint>
-#include <iomanip>
-#include <limits>
-#include <list>
-#include <map>
-#include <ostream> // NOLINT
-#include <sstream>
-#include <vector>
-
-#include "gtest/gtest-assertion-result.h"
-#include "gtest/gtest-spi.h"
-#include "gtest/internal/custom/gtest.h"
-
-#if GTEST_OS_LINUX
-
-# include <fcntl.h> // NOLINT
-# include <limits.h> // NOLINT
-# include <sched.h> // NOLINT
-// Declares vsnprintf(). This header is not available on Windows.
-# include <strings.h> // NOLINT
-# include <sys/mman.h> // NOLINT
-# include <sys/time.h> // NOLINT
-# include <unistd.h> // NOLINT
-# include <string>
-
-#elif GTEST_OS_ZOS
-# include <sys/time.h> // NOLINT
-
-// On z/OS we additionally need strings.h for strcasecmp.
-# include <strings.h> // NOLINT
-
-#elif GTEST_OS_WINDOWS_MOBILE // We are on Windows CE.
-
-# include <windows.h> // NOLINT
-# undef min
-
-#elif GTEST_OS_WINDOWS // We are on Windows proper.
-
-# include <windows.h> // NOLINT
-# undef min
-
-#ifdef _MSC_VER
-# include <crtdbg.h> // NOLINT
-#endif
-
-# include <io.h> // NOLINT
-# include <sys/timeb.h> // NOLINT
-# include <sys/types.h> // NOLINT
-# include <sys/stat.h> // NOLINT
-
-# if GTEST_OS_WINDOWS_MINGW
-# include <sys/time.h> // NOLINT
-# endif // GTEST_OS_WINDOWS_MINGW
-
-#else
-
-// cpplint thinks that the header is already included, so we want to
-// silence it.
-# include <sys/time.h> // NOLINT
-# include <unistd.h> // NOLINT
-
-#endif // GTEST_OS_LINUX
-
-#if GTEST_HAS_EXCEPTIONS
-# include <stdexcept>
-#endif
-
-#if GTEST_CAN_STREAM_RESULTS_
-# include <arpa/inet.h> // NOLINT
-# include <netdb.h> // NOLINT
-# include <sys/socket.h> // NOLINT
-# include <sys/types.h> // NOLINT
-#endif
-
-#include "src/gtest-internal-inl.h"
-
-#if GTEST_OS_WINDOWS
-# define vsnprintf _vsnprintf
-#endif // GTEST_OS_WINDOWS
-
-#if GTEST_OS_MAC
-#ifndef GTEST_OS_IOS
-#include <crt_externs.h>
-#endif
-#endif
-
-#if GTEST_HAS_ABSL
-#include "absl/debugging/failure_signal_handler.h"
-#include "absl/debugging/stacktrace.h"
-#include "absl/debugging/symbolize.h"
-#include "absl/strings/str_cat.h"
-#endif // GTEST_HAS_ABSL
-
-namespace testing {
-
-using internal::CountIf;
-using internal::ForEach;
-using internal::GetElementOr;
-using internal::Shuffle;
-
-// Constants.
-
-// A test whose test suite name or test name matches this filter is
-// disabled and not run.
-static const char kDisableTestFilter[] = "DISABLED_*:*/DISABLED_*";
-
-// A test suite whose name matches this filter is considered a death
-// test suite and will be run before test suites whose name doesn't
-// match this filter.
-static const char kDeathTestSuiteFilter[] = "*DeathTest:*DeathTest/*";
-
-// A test filter that matches everything.
-static const char kUniversalFilter[] = "*";
-
-// The default output format.
-static const char kDefaultOutputFormat[] = "xml";
-// The default output file.
-static const char kDefaultOutputFile[] = "test_detail";
-
-// The environment variable name for the test shard index.
-static const char kTestShardIndex[] = "GTEST_SHARD_INDEX";
-// The environment variable name for the total number of test shards.
-static const char kTestTotalShards[] = "GTEST_TOTAL_SHARDS";
-// The environment variable name for the test shard status file.
-static const char kTestShardStatusFile[] = "GTEST_SHARD_STATUS_FILE";
-
-namespace internal {
-
-// The text used in failure messages to indicate the start of the
-// stack trace.
-const char kStackTraceMarker[] = "\nStack trace:\n";
-
-// g_help_flag is true if and only if the --help flag or an equivalent form
-// is specified on the command line.
-bool g_help_flag = false;
-
-// Utility function to Open File for Writing
-static FILE* OpenFileForWriting(const std::string& output_file) {
- FILE* fileout = nullptr;
- FilePath output_file_path(output_file);
- FilePath output_dir(output_file_path.RemoveFileName());
-
- if (output_dir.CreateDirectoriesRecursively()) {
- fileout = posix::FOpen(output_file.c_str(), "w");
- }
- if (fileout == nullptr) {
- GTEST_LOG_(FATAL) << "Unable to open file \"" << output_file << "\"";
- }
- return fileout;
-}
-
-} // namespace internal
-
-// Bazel passes in the argument to '--test_filter' via the TESTBRIDGE_TEST_ONLY
-// environment variable.
-static const char* GetDefaultFilter() {
- const char* const testbridge_test_only =
- internal::posix::GetEnv("TESTBRIDGE_TEST_ONLY");
- if (testbridge_test_only != nullptr) {
- return testbridge_test_only;
- }
- return kUniversalFilter;
-}
-
-// Bazel passes in the argument to '--test_runner_fail_fast' via the
-// TESTBRIDGE_TEST_RUNNER_FAIL_FAST environment variable.
-static bool GetDefaultFailFast() {
- const char* const testbridge_test_runner_fail_fast =
- internal::posix::GetEnv("TESTBRIDGE_TEST_RUNNER_FAIL_FAST");
- if (testbridge_test_runner_fail_fast != nullptr) {
- return strcmp(testbridge_test_runner_fail_fast, "1") == 0;
- }
- return false;
-}
-
-} // namespace testing
-
-GTEST_DEFINE_bool_(
- fail_fast,
- testing::internal::BoolFromGTestEnv("fail_fast",
- testing::GetDefaultFailFast()),
- "True if and only if a test failure should stop further test execution.");
-
-GTEST_DEFINE_bool_(
- also_run_disabled_tests,
- testing::internal::BoolFromGTestEnv("also_run_disabled_tests", false),
- "Run disabled tests too, in addition to the tests normally being run.");
-
-GTEST_DEFINE_bool_(
- break_on_failure,
- testing::internal::BoolFromGTestEnv("break_on_failure", false),
- "True if and only if a failed assertion should be a debugger "
- "break-point.");
-
-GTEST_DEFINE_bool_(catch_exceptions,
- testing::internal::BoolFromGTestEnv("catch_exceptions",
- true),
- "True if and only if " GTEST_NAME_
- " should catch exceptions and treat them as test failures.");
-
-GTEST_DEFINE_string_(
- color, testing::internal::StringFromGTestEnv("color", "auto"),
- "Whether to use colors in the output. Valid values: yes, no, "
- "and auto. 'auto' means to use colors if the output is "
- "being sent to a terminal and the TERM environment variable "
- "is set to a terminal type that supports colors.");
-
-GTEST_DEFINE_string_(
- filter,
- testing::internal::StringFromGTestEnv("filter",
- testing::GetDefaultFilter()),
- "A colon-separated list of glob (not regex) patterns "
- "for filtering the tests to run, optionally followed by a "
- "'-' and a : separated list of negative patterns (tests to "
- "exclude). A test is run if it matches one of the positive "
- "patterns and does not match any of the negative patterns.");
-
-GTEST_DEFINE_bool_(
- install_failure_signal_handler,
- testing::internal::BoolFromGTestEnv("install_failure_signal_handler",
- false),
- "If true and supported on the current platform, " GTEST_NAME_
- " should "
- "install a signal handler that dumps debugging information when fatal "
- "signals are raised.");
-
-GTEST_DEFINE_bool_(list_tests, false,
- "List all tests without running them.");
-
-// The net priority order after flag processing is thus:
-// --gtest_output command line flag
-// GTEST_OUTPUT environment variable
-// XML_OUTPUT_FILE environment variable
-// ''
-GTEST_DEFINE_string_(
- output,
- testing::internal::StringFromGTestEnv(
- "output", testing::internal::OutputFlagAlsoCheckEnvVar().c_str()),
- "A format (defaults to \"xml\" but can be specified to be \"json\"), "
- "optionally followed by a colon and an output file name or directory. "
- "A directory is indicated by a trailing pathname separator. "
- "Examples: \"xml:filename.xml\", \"xml::directoryname/\". "
- "If a directory is specified, output files will be created "
- "within that directory, with file-names based on the test "
- "executable's name and, if necessary, made unique by adding "
- "digits.");
-
-GTEST_DEFINE_bool_(
- brief, testing::internal::BoolFromGTestEnv("brief", false),
- "True if only test failures should be displayed in text output.");
-
-GTEST_DEFINE_bool_(print_time,
- testing::internal::BoolFromGTestEnv("print_time", true),
- "True if and only if " GTEST_NAME_
- " should display elapsed time in text output.");
-
-GTEST_DEFINE_bool_(print_utf8,
- testing::internal::BoolFromGTestEnv("print_utf8", true),
- "True if and only if " GTEST_NAME_
- " prints UTF8 characters as text.");
-
-GTEST_DEFINE_int32_(
- random_seed, testing::internal::Int32FromGTestEnv("random_seed", 0),
- "Random number seed to use when shuffling test orders. Must be in range "
- "[1, 99999], or 0 to use a seed based on the current time.");
-
-GTEST_DEFINE_int32_(
- repeat, testing::internal::Int32FromGTestEnv("repeat", 1),
- "How many times to repeat each test. Specify a negative number "
- "for repeating forever. Useful for shaking out flaky tests.");
-
-GTEST_DEFINE_bool_(
- recreate_environments_when_repeating,
- testing::internal::BoolFromGTestEnv("recreate_environments_when_repeating",
- true),
- "Controls whether global test environments are recreated for each repeat "
- "of the tests. If set to false the global test environments are only set "
- "up once, for the first iteration, and only torn down once, for the last. "
- "Useful for shaking out flaky tests with stable, expensive test "
- "environments. If --gtest_repeat is set to a negative number, meaning "
- "there is no last run, the environments will always be recreated to avoid "
- "leaks.");
-
-GTEST_DEFINE_bool_(show_internal_stack_frames, false,
- "True if and only if " GTEST_NAME_
- " should include internal stack frames when "
- "printing test failure stack traces.");
-
-GTEST_DEFINE_bool_(shuffle,
- testing::internal::BoolFromGTestEnv("shuffle", false),
- "True if and only if " GTEST_NAME_
- " should randomize tests' order on every run.");
-
-GTEST_DEFINE_int32_(
- stack_trace_depth,
- testing::internal::Int32FromGTestEnv("stack_trace_depth",
- testing::kMaxStackTraceDepth),
- "The maximum number of stack frames to print when an "
- "assertion fails. The valid range is 0 through 100, inclusive.");
-
-GTEST_DEFINE_string_(
- stream_result_to,
- testing::internal::StringFromGTestEnv("stream_result_to", ""),
- "This flag specifies the host name and the port number on which to stream "
- "test results. Example: \"localhost:555\". The flag is effective only on "
- "Linux.");
-
-GTEST_DEFINE_bool_(
- throw_on_failure,
- testing::internal::BoolFromGTestEnv("throw_on_failure", false),
- "When this flag is specified, a failed assertion will throw an exception "
- "if exceptions are enabled or exit the program with a non-zero code "
- "otherwise. For use with an external test framework.");
-
-#if GTEST_USE_OWN_FLAGFILE_FLAG_
-GTEST_DEFINE_string_(
- flagfile, testing::internal::StringFromGTestEnv("flagfile", ""),
- "This flag specifies the flagfile to read command-line flags from.");
-#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
-
-namespace testing {
-namespace internal {
-
-// Generates a random number from [0, range), using a Linear
-// Congruential Generator (LCG). Crashes if 'range' is 0 or greater
-// than kMaxRange.
-uint32_t Random::Generate(uint32_t range) {
- // These constants are the same as are used in glibc's rand(3).
- // Use wider types than necessary to prevent unsigned overflow diagnostics.
- state_ = static_cast<uint32_t>(1103515245ULL*state_ + 12345U) % kMaxRange;
-
- GTEST_CHECK_(range > 0)
- << "Cannot generate a number in the range [0, 0).";
- GTEST_CHECK_(range <= kMaxRange)
- << "Generation of a number in [0, " << range << ") was requested, "
- << "but this can only generate numbers in [0, " << kMaxRange << ").";
-
- // Converting via modulus introduces a bit of downward bias, but
- // it's simple, and a linear congruential generator isn't too good
- // to begin with.
- return state_ % range;
-}
-
-// GTestIsInitialized() returns true if and only if the user has initialized
-// Google Test. Useful for catching the user mistake of not initializing
-// Google Test before calling RUN_ALL_TESTS().
-static bool GTestIsInitialized() { return GetArgvs().size() > 0; }
-
-// Iterates over a vector of TestSuites, keeping a running sum of the
-// results of calling a given int-returning method on each.
-// Returns the sum.
-static int SumOverTestSuiteList(const std::vector<TestSuite*>& case_list,
- int (TestSuite::*method)() const) {
- int sum = 0;
- for (size_t i = 0; i < case_list.size(); i++) {
- sum += (case_list[i]->*method)();
- }
- return sum;
-}
-
-// Returns true if and only if the test suite passed.
-static bool TestSuitePassed(const TestSuite* test_suite) {
- return test_suite->should_run() && test_suite->Passed();
-}
-
-// Returns true if and only if the test suite failed.
-static bool TestSuiteFailed(const TestSuite* test_suite) {
- return test_suite->should_run() && test_suite->Failed();
-}
-
-// Returns true if and only if test_suite contains at least one test that
-// should run.
-static bool ShouldRunTestSuite(const TestSuite* test_suite) {
- return test_suite->should_run();
-}
-
-// AssertHelper constructor.
-AssertHelper::AssertHelper(TestPartResult::Type type,
- const char* file,
- int line,
- const char* message)
- : data_(new AssertHelperData(type, file, line, message)) {
-}
-
-AssertHelper::~AssertHelper() {
- delete data_;
-}
-
-// Message assignment, for assertion streaming support.
-void AssertHelper::operator=(const Message& message) const {
- UnitTest::GetInstance()->
- AddTestPartResult(data_->type, data_->file, data_->line,
- AppendUserMessage(data_->message, message),
- UnitTest::GetInstance()->impl()
- ->CurrentOsStackTraceExceptTop(1)
- // Skips the stack frame for this function itself.
- ); // NOLINT
-}
-
-namespace {
-
-// When TEST_P is found without a matching INSTANTIATE_TEST_SUITE_P
-// to creates test cases for it, a synthetic test case is
-// inserted to report ether an error or a log message.
-//
-// This configuration bit will likely be removed at some point.
-constexpr bool kErrorOnUninstantiatedParameterizedTest = true;
-constexpr bool kErrorOnUninstantiatedTypeParameterizedTest = true;
-
-// A test that fails at a given file/line location with a given message.
-class FailureTest : public Test {
- public:
- explicit FailureTest(const CodeLocation& loc, std::string error_message,
- bool as_error)
- : loc_(loc),
- error_message_(std::move(error_message)),
- as_error_(as_error) {}
-
- void TestBody() override {
- if (as_error_) {
- AssertHelper(TestPartResult::kNonFatalFailure, loc_.file.c_str(),
- loc_.line, "") = Message() << error_message_;
- } else {
- std::cout << error_message_ << std::endl;
- }
- }
-
- private:
- const CodeLocation loc_;
- const std::string error_message_;
- const bool as_error_;
-};
-
-
-} // namespace
-
-std::set<std::string>* GetIgnoredParameterizedTestSuites() {
- return UnitTest::GetInstance()->impl()->ignored_parameterized_test_suites();
-}
-
-// Add a given test_suit to the list of them allow to go un-instantiated.
-MarkAsIgnored::MarkAsIgnored(const char* test_suite) {
- GetIgnoredParameterizedTestSuites()->insert(test_suite);
-}
-
-// If this parameterized test suite has no instantiations (and that
-// has not been marked as okay), emit a test case reporting that.
-void InsertSyntheticTestCase(const std::string& name, CodeLocation location,
- bool has_test_p) {
- const auto& ignored = *GetIgnoredParameterizedTestSuites();
- if (ignored.find(name) != ignored.end()) return;
-
- const char kMissingInstantiation[] = //
- " is defined via TEST_P, but never instantiated. None of the test cases "
- "will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only "
- "ones provided expand to nothing."
- "\n\n"
- "Ideally, TEST_P definitions should only ever be included as part of "
- "binaries that intend to use them. (As opposed to, for example, being "
- "placed in a library that may be linked in to get other utilities.)";
-
- const char kMissingTestCase[] = //
- " is instantiated via INSTANTIATE_TEST_SUITE_P, but no tests are "
- "defined via TEST_P . No test cases will run."
- "\n\n"
- "Ideally, INSTANTIATE_TEST_SUITE_P should only ever be invoked from "
- "code that always depend on code that provides TEST_P. Failing to do "
- "so is often an indication of dead code, e.g. the last TEST_P was "
- "removed but the rest got left behind.";
-
- std::string message =
- "Parameterized test suite " + name +
- (has_test_p ? kMissingInstantiation : kMissingTestCase) +
- "\n\n"
- "To suppress this error for this test suite, insert the following line "
- "(in a non-header) in the namespace it is defined in:"
- "\n\n"
- "GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" + name + ");";
-
- std::string full_name = "UninstantiatedParameterizedTestSuite<" + name + ">";
- RegisterTest( //
- "GoogleTestVerification", full_name.c_str(),
- nullptr, // No type parameter.
- nullptr, // No value parameter.
- location.file.c_str(), location.line, [message, location] {
- return new FailureTest(location, message,
- kErrorOnUninstantiatedParameterizedTest);
- });
-}
-
-void RegisterTypeParameterizedTestSuite(const char* test_suite_name,
- CodeLocation code_location) {
- GetUnitTestImpl()->type_parameterized_test_registry().RegisterTestSuite(
- test_suite_name, code_location);
-}
-
-void RegisterTypeParameterizedTestSuiteInstantiation(const char* case_name) {
- GetUnitTestImpl()
- ->type_parameterized_test_registry()
- .RegisterInstantiation(case_name);
-}
-
-void TypeParameterizedTestSuiteRegistry::RegisterTestSuite(
- const char* test_suite_name, CodeLocation code_location) {
- suites_.emplace(std::string(test_suite_name),
- TypeParameterizedTestSuiteInfo(code_location));
-}
-
-void TypeParameterizedTestSuiteRegistry::RegisterInstantiation(
- const char* test_suite_name) {
- auto it = suites_.find(std::string(test_suite_name));
- if (it != suites_.end()) {
- it->second.instantiated = true;
- } else {
- GTEST_LOG_(ERROR) << "Unknown type parameterized test suit '"
- << test_suite_name << "'";
- }
-}
-
-void TypeParameterizedTestSuiteRegistry::CheckForInstantiations() {
- const auto& ignored = *GetIgnoredParameterizedTestSuites();
- for (const auto& testcase : suites_) {
- if (testcase.second.instantiated) continue;
- if (ignored.find(testcase.first) != ignored.end()) continue;
-
- std::string message =
- "Type parameterized test suite " + testcase.first +
- " is defined via REGISTER_TYPED_TEST_SUITE_P, but never instantiated "
- "via INSTANTIATE_TYPED_TEST_SUITE_P. None of the test cases will run."
- "\n\n"
- "Ideally, TYPED_TEST_P definitions should only ever be included as "
- "part of binaries that intend to use them. (As opposed to, for "
- "example, being placed in a library that may be linked in to get other "
- "utilities.)"
- "\n\n"
- "To suppress this error for this test suite, insert the following line "
- "(in a non-header) in the namespace it is defined in:"
- "\n\n"
- "GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(" +
- testcase.first + ");";
-
- std::string full_name =
- "UninstantiatedTypeParameterizedTestSuite<" + testcase.first + ">";
- RegisterTest( //
- "GoogleTestVerification", full_name.c_str(),
- nullptr, // No type parameter.
- nullptr, // No value parameter.
- testcase.second.code_location.file.c_str(),
- testcase.second.code_location.line, [message, testcase] {
- return new FailureTest(testcase.second.code_location, message,
- kErrorOnUninstantiatedTypeParameterizedTest);
- });
- }
-}
-
-// A copy of all command line arguments. Set by InitGoogleTest().
-static ::std::vector<std::string> g_argvs;
-
-::std::vector<std::string> GetArgvs() {
-#if defined(GTEST_CUSTOM_GET_ARGVS_)
- // GTEST_CUSTOM_GET_ARGVS_() may return a container of std::string or
- // ::string. This code converts it to the appropriate type.
- const auto& custom = GTEST_CUSTOM_GET_ARGVS_();
- return ::std::vector<std::string>(custom.begin(), custom.end());
-#else // defined(GTEST_CUSTOM_GET_ARGVS_)
- return g_argvs;
-#endif // defined(GTEST_CUSTOM_GET_ARGVS_)
-}
-
-// Returns the current application's name, removing directory path if that
-// is present.
-FilePath GetCurrentExecutableName() {
- FilePath result;
-
-#if GTEST_OS_WINDOWS || GTEST_OS_OS2
- result.Set(FilePath(GetArgvs()[0]).RemoveExtension("exe"));
-#else
- result.Set(FilePath(GetArgvs()[0]));
-#endif // GTEST_OS_WINDOWS
-
- return result.RemoveDirectoryName();
-}
-
-// Functions for processing the gtest_output flag.
-
-// Returns the output format, or "" for normal printed output.
-std::string UnitTestOptions::GetOutputFormat() {
- std::string s = GTEST_FLAG_GET(output);
- const char* const gtest_output_flag = s.c_str();
- const char* const colon = strchr(gtest_output_flag, ':');
- return (colon == nullptr)
- ? std::string(gtest_output_flag)
- : std::string(gtest_output_flag,
- static_cast<size_t>(colon - gtest_output_flag));
-}
-
-// Returns the name of the requested output file, or the default if none
-// was explicitly specified.
-std::string UnitTestOptions::GetAbsolutePathToOutputFile() {
- std::string s = GTEST_FLAG_GET(output);
- const char* const gtest_output_flag = s.c_str();
-
- std::string format = GetOutputFormat();
- if (format.empty())
- format = std::string(kDefaultOutputFormat);
-
- const char* const colon = strchr(gtest_output_flag, ':');
- if (colon == nullptr)
- return internal::FilePath::MakeFileName(
- internal::FilePath(
- UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(kDefaultOutputFile), 0,
- format.c_str()).string();
-
- internal::FilePath output_name(colon + 1);
- if (!output_name.IsAbsolutePath())
- output_name = internal::FilePath::ConcatPaths(
- internal::FilePath(UnitTest::GetInstance()->original_working_dir()),
- internal::FilePath(colon + 1));
-
- if (!output_name.IsDirectory())
- return output_name.string();
-
- internal::FilePath result(internal::FilePath::GenerateUniqueFileName(
- output_name, internal::GetCurrentExecutableName(),
- GetOutputFormat().c_str()));
- return result.string();
-}
-
-// Returns true if and only if the wildcard pattern matches the string. Each
-// pattern consists of regular characters, single-character wildcards (?), and
-// multi-character wildcards (*).
-//
-// This function implements a linear-time string globbing algorithm based on
-// https://research.swtch.com/glob.
-static bool PatternMatchesString(const std::string& name_str,
- const char* pattern, const char* pattern_end) {
- const char* name = name_str.c_str();
- const char* const name_begin = name;
- const char* const name_end = name + name_str.size();
-
- const char* pattern_next = pattern;
- const char* name_next = name;
-
- while (pattern < pattern_end || name < name_end) {
- if (pattern < pattern_end) {
- switch (*pattern) {
- default: // Match an ordinary character.
- if (name < name_end && *name == *pattern) {
- ++pattern;
- ++name;
- continue;
- }
- break;
- case '?': // Match any single character.
- if (name < name_end) {
- ++pattern;
- ++name;
- continue;
- }
- break;
- case '*':
- // Match zero or more characters. Start by skipping over the wildcard
- // and matching zero characters from name. If that fails, restart and
- // match one more character than the last attempt.
- pattern_next = pattern;
- name_next = name + 1;
- ++pattern;
- continue;
- }
- }
- // Failed to match a character. Restart if possible.
- if (name_begin < name_next && name_next <= name_end) {
- pattern = pattern_next;
- name = name_next;
- continue;
- }
- return false;
- }
- return true;
-}
-
-namespace {
-
-class UnitTestFilter {
- public:
- UnitTestFilter() = default;
-
- // Constructs a filter from a string of patterns separated by `:`.
- explicit UnitTestFilter(const std::string& filter) {
- // By design "" filter matches "" string.
- SplitString(filter, ':', &patterns_);
- }
-
- // Returns true if and only if name matches at least one of the patterns in
- // the filter.
- bool MatchesName(const std::string& name) const {
- return std::any_of(patterns_.begin(), patterns_.end(),
- [&name](const std::string& pattern) {
- return PatternMatchesString(
- name, pattern.c_str(),
- pattern.c_str() + pattern.size());
- });
- }
-
- private:
- std::vector<std::string> patterns_;
-};
-
-class PositiveAndNegativeUnitTestFilter {
- public:
- // Constructs a positive and a negative filter from a string. The string
- // contains a positive filter optionally followed by a '-' character and a
- // negative filter. In case only a negative filter is provided the positive
- // filter will be assumed "*".
- // A filter is a list of patterns separated by ':'.
- explicit PositiveAndNegativeUnitTestFilter(const std::string& filter) {
- std::vector<std::string> positive_and_negative_filters;
-
- // NOTE: `SplitString` always returns a non-empty container.
- SplitString(filter, '-', &positive_and_negative_filters);
- const auto& positive_filter = positive_and_negative_filters.front();
-
- if (positive_and_negative_filters.size() > 1) {
- positive_filter_ = UnitTestFilter(
- positive_filter.empty() ? kUniversalFilter : positive_filter);
-
- // TODO(b/214626361): Fail on multiple '-' characters
- // For the moment to preserve old behavior we concatenate the rest of the
- // string parts with `-` as separator to generate the negative filter.
- auto negative_filter_string = positive_and_negative_filters[1];
- for (std::size_t i = 2; i < positive_and_negative_filters.size(); i++)
- negative_filter_string =
- negative_filter_string + '-' + positive_and_negative_filters[i];
- negative_filter_ = UnitTestFilter(negative_filter_string);
- } else {
- // In case we don't have a negative filter and positive filter is ""
- // we do not use kUniversalFilter by design as opposed to when we have a
- // negative filter.
- positive_filter_ = UnitTestFilter(positive_filter);
- }
- }
-
- // Returns true if and only if test name (this is generated by appending test
- // suit name and test name via a '.' character) matches the positive filter
- // and does not match the negative filter.
- bool MatchesTest(const std::string& test_suite_name,
- const std::string& test_name) const {
- return MatchesName(test_suite_name + "." + test_name);
- }
-
- // Returns true if and only if name matches the positive filter and does not
- // match the negative filter.
- bool MatchesName(const std::string& name) const {
- return positive_filter_.MatchesName(name) &&
- !negative_filter_.MatchesName(name);
- }
-
- private:
- UnitTestFilter positive_filter_;
- UnitTestFilter negative_filter_;
-};
-} // namespace
-
-bool UnitTestOptions::MatchesFilter(const std::string& name_str,
- const char* filter) {
- return UnitTestFilter(filter).MatchesName(name_str);
-}
-
-// Returns true if and only if the user-specified filter matches the test
-// suite name and the test name.
-bool UnitTestOptions::FilterMatchesTest(const std::string& test_suite_name,
- const std::string& test_name) {
- // Split --gtest_filter at '-', if there is one, to separate into
- // positive filter and negative filter portions
- return PositiveAndNegativeUnitTestFilter(GTEST_FLAG_GET(filter))
- .MatchesTest(test_suite_name, test_name);
-}
-
-#if GTEST_HAS_SEH
-// Returns EXCEPTION_EXECUTE_HANDLER if Google Test should handle the
-// given SEH exception, or EXCEPTION_CONTINUE_SEARCH otherwise.
-// This function is useful as an __except condition.
-int UnitTestOptions::GTestShouldProcessSEH(DWORD exception_code) {
- // Google Test should handle a SEH exception if:
- // 1. the user wants it to, AND
- // 2. this is not a breakpoint exception, AND
- // 3. this is not a C++ exception (VC++ implements them via SEH,
- // apparently).
- //
- // SEH exception code for C++ exceptions.
- // (see http://support.microsoft.com/kb/185294 for more information).
- const DWORD kCxxExceptionCode = 0xe06d7363;
-
- bool should_handle = true;
-
- if (!GTEST_FLAG_GET(catch_exceptions))
- should_handle = false;
- else if (exception_code == EXCEPTION_BREAKPOINT)
- should_handle = false;
- else if (exception_code == kCxxExceptionCode)
- should_handle = false;
-
- return should_handle ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
-}
-#endif // GTEST_HAS_SEH
-
-} // namespace internal
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results. Intercepts only failures from the current thread.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- TestPartResultArray* result)
- : intercept_mode_(INTERCEPT_ONLY_CURRENT_THREAD),
- result_(result) {
- Init();
-}
-
-// The c'tor sets this object as the test part result reporter used by
-// Google Test. The 'result' parameter specifies where to report the
-// results.
-ScopedFakeTestPartResultReporter::ScopedFakeTestPartResultReporter(
- InterceptMode intercept_mode, TestPartResultArray* result)
- : intercept_mode_(intercept_mode),
- result_(result) {
- Init();
-}
-
-void ScopedFakeTestPartResultReporter::Init() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- old_reporter_ = impl->GetGlobalTestPartResultReporter();
- impl->SetGlobalTestPartResultReporter(this);
- } else {
- old_reporter_ = impl->GetTestPartResultReporterForCurrentThread();
- impl->SetTestPartResultReporterForCurrentThread(this);
- }
-}
-
-// The d'tor restores the test part result reporter used by Google Test
-// before.
-ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- if (intercept_mode_ == INTERCEPT_ALL_THREADS) {
- impl->SetGlobalTestPartResultReporter(old_reporter_);
- } else {
- impl->SetTestPartResultReporterForCurrentThread(old_reporter_);
- }
-}
-
-// Increments the test part result count and remembers the result.
-// This method is from the TestPartResultReporterInterface interface.
-void ScopedFakeTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- result_->Append(result);
-}
-
-namespace internal {
-
-// Returns the type ID of ::testing::Test. We should always call this
-// instead of GetTypeId< ::testing::Test>() to get the type ID of
-// testing::Test. This is to work around a suspected linker bug when
-// using Google Test as a framework on Mac OS X. The bug causes
-// GetTypeId< ::testing::Test>() to return different values depending
-// on whether the call is from the Google Test framework itself or
-// from user test code. GetTestTypeId() is guaranteed to always
-// return the same value, as it always calls GetTypeId<>() from the
-// gtest.cc, which is within the Google Test framework.
-TypeId GetTestTypeId() {
- return GetTypeId<Test>();
-}
-
-// The value of GetTestTypeId() as seen from within the Google Test
-// library. This is solely for testing GetTestTypeId().
-extern const TypeId kTestTypeIdInGoogleTest = GetTestTypeId();
-
-// This predicate-formatter checks that 'results' contains a test part
-// failure of the given type and that the failure message contains the
-// given substring.
-static AssertionResult HasOneFailure(const char* /* results_expr */,
- const char* /* type_expr */,
- const char* /* substr_expr */,
- const TestPartResultArray& results,
- TestPartResult::Type type,
- const std::string& substr) {
- const std::string expected(type == TestPartResult::kFatalFailure ?
- "1 fatal failure" :
- "1 non-fatal failure");
- Message msg;
- if (results.size() != 1) {
- msg << "Expected: " << expected << "\n"
- << " Actual: " << results.size() << " failures";
- for (int i = 0; i < results.size(); i++) {
- msg << "\n" << results.GetTestPartResult(i);
- }
- return AssertionFailure() << msg;
- }
-
- const TestPartResult& r = results.GetTestPartResult(0);
- if (r.type() != type) {
- return AssertionFailure() << "Expected: " << expected << "\n"
- << " Actual:\n"
- << r;
- }
-
- if (strstr(r.message(), substr.c_str()) == nullptr) {
- return AssertionFailure() << "Expected: " << expected << " containing \""
- << substr << "\"\n"
- << " Actual:\n"
- << r;
- }
-
- return AssertionSuccess();
-}
-
-// The constructor of SingleFailureChecker remembers where to look up
-// test part results, what type of failure we expect, and what
-// substring the failure message should contain.
-SingleFailureChecker::SingleFailureChecker(const TestPartResultArray* results,
- TestPartResult::Type type,
- const std::string& substr)
- : results_(results), type_(type), substr_(substr) {}
-
-// The destructor of SingleFailureChecker verifies that the given
-// TestPartResultArray contains exactly one failure that has the given
-// type and contains the given substring. If that's not the case, a
-// non-fatal failure will be generated.
-SingleFailureChecker::~SingleFailureChecker() {
- EXPECT_PRED_FORMAT3(HasOneFailure, *results_, type_, substr_);
-}
-
-DefaultGlobalTestPartResultReporter::DefaultGlobalTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultGlobalTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->current_test_result()->AddTestPartResult(result);
- unit_test_->listeners()->repeater()->OnTestPartResult(result);
-}
-
-DefaultPerThreadTestPartResultReporter::DefaultPerThreadTestPartResultReporter(
- UnitTestImpl* unit_test) : unit_test_(unit_test) {}
-
-void DefaultPerThreadTestPartResultReporter::ReportTestPartResult(
- const TestPartResult& result) {
- unit_test_->GetGlobalTestPartResultReporter()->ReportTestPartResult(result);
-}
-
-// Returns the global test part result reporter.
-TestPartResultReporterInterface*
-UnitTestImpl::GetGlobalTestPartResultReporter() {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- return global_test_part_result_repoter_;
-}
-
-// Sets the global test part result reporter.
-void UnitTestImpl::SetGlobalTestPartResultReporter(
- TestPartResultReporterInterface* reporter) {
- internal::MutexLock lock(&global_test_part_result_reporter_mutex_);
- global_test_part_result_repoter_ = reporter;
-}
-
-// Returns the test part result reporter for the current thread.
-TestPartResultReporterInterface*
-UnitTestImpl::GetTestPartResultReporterForCurrentThread() {
- return per_thread_test_part_result_reporter_.get();
-}
-
-// Sets the test part result reporter for the current thread.
-void UnitTestImpl::SetTestPartResultReporterForCurrentThread(
- TestPartResultReporterInterface* reporter) {
- per_thread_test_part_result_reporter_.set(reporter);
-}
-
-// Gets the number of successful test suites.
-int UnitTestImpl::successful_test_suite_count() const {
- return CountIf(test_suites_, TestSuitePassed);
-}
-
-// Gets the number of failed test suites.
-int UnitTestImpl::failed_test_suite_count() const {
- return CountIf(test_suites_, TestSuiteFailed);
-}
-
-// Gets the number of all test suites.
-int UnitTestImpl::total_test_suite_count() const {
- return static_cast<int>(test_suites_.size());
-}
-
-// Gets the number of all test suites that contain at least one test
-// that should run.
-int UnitTestImpl::test_suite_to_run_count() const {
- return CountIf(test_suites_, ShouldRunTestSuite);
-}
-
-// Gets the number of successful tests.
-int UnitTestImpl::successful_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::successful_test_count);
-}
-
-// Gets the number of skipped tests.
-int UnitTestImpl::skipped_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::skipped_test_count);
-}
-
-// Gets the number of failed tests.
-int UnitTestImpl::failed_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::failed_test_count);
-}
-
-// Gets the number of disabled tests that will be reported in the XML report.
-int UnitTestImpl::reportable_disabled_test_count() const {
- return SumOverTestSuiteList(test_suites_,
- &TestSuite::reportable_disabled_test_count);
-}
-
-// Gets the number of disabled tests.
-int UnitTestImpl::disabled_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::disabled_test_count);
-}
-
-// Gets the number of tests to be printed in the XML report.
-int UnitTestImpl::reportable_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::reportable_test_count);
-}
-
-// Gets the number of all tests.
-int UnitTestImpl::total_test_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::total_test_count);
-}
-
-// Gets the number of tests that should run.
-int UnitTestImpl::test_to_run_count() const {
- return SumOverTestSuiteList(test_suites_, &TestSuite::test_to_run_count);
-}
-
-// Returns the current OS stack trace as an std::string.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// CurrentOsStackTraceExceptTop(1), Foo() will be included in the
-// trace but Bar() and CurrentOsStackTraceExceptTop() won't.
-std::string UnitTestImpl::CurrentOsStackTraceExceptTop(int skip_count) {
- return os_stack_trace_getter()->CurrentStackTrace(
- static_cast<int>(GTEST_FLAG_GET(stack_trace_depth)), skip_count + 1
- // Skips the user-specified number of frames plus this function
- // itself.
- ); // NOLINT
-}
-
-// A helper class for measuring elapsed times.
-class Timer {
- public:
- Timer() : start_(std::chrono::steady_clock::now()) {}
-
- // Return time elapsed in milliseconds since the timer was created.
- TimeInMillis Elapsed() {
- return std::chrono::duration_cast<std::chrono::milliseconds>(
- std::chrono::steady_clock::now() - start_)
- .count();
- }
-
- private:
- std::chrono::steady_clock::time_point start_;
-};
-
-// Returns a timestamp as milliseconds since the epoch. Note this time may jump
-// around subject to adjustments by the system, to measure elapsed time use
-// Timer instead.
-TimeInMillis GetTimeInMillis() {
- return std::chrono::duration_cast<std::chrono::milliseconds>(
- std::chrono::system_clock::now() -
- std::chrono::system_clock::from_time_t(0))
- .count();
-}
-
-// Utilities
-
-// class String.
-
-#if GTEST_OS_WINDOWS_MOBILE
-// Creates a UTF-16 wide string from the given ANSI string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the wide string, or NULL if the
-// input is NULL.
-LPCWSTR String::AnsiToUtf16(const char* ansi) {
- if (!ansi) return nullptr;
- const int length = strlen(ansi);
- const int unicode_length =
- MultiByteToWideChar(CP_ACP, 0, ansi, length, nullptr, 0);
- WCHAR* unicode = new WCHAR[unicode_length + 1];
- MultiByteToWideChar(CP_ACP, 0, ansi, length,
- unicode, unicode_length);
- unicode[unicode_length] = 0;
- return unicode;
-}
-
-// Creates an ANSI string from the given wide string, allocating
-// memory using new. The caller is responsible for deleting the return
-// value using delete[]. Returns the ANSI string, or NULL if the
-// input is NULL.
-const char* String::Utf16ToAnsi(LPCWSTR utf16_str) {
- if (!utf16_str) return nullptr;
- const int ansi_length = WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, nullptr,
- 0, nullptr, nullptr);
- char* ansi = new char[ansi_length + 1];
- WideCharToMultiByte(CP_ACP, 0, utf16_str, -1, ansi, ansi_length, nullptr,
- nullptr);
- ansi[ansi_length] = 0;
- return ansi;
-}
-
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-// Compares two C strings. Returns true if and only if they have the same
-// content.
-//
-// Unlike strcmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CStringEquals(const char * lhs, const char * rhs) {
- if (lhs == nullptr) return rhs == nullptr;
-
- if (rhs == nullptr) return false;
-
- return strcmp(lhs, rhs) == 0;
-}
-
-#if GTEST_HAS_STD_WSTRING
-
-// Converts an array of wide chars to a narrow string using the UTF-8
-// encoding, and streams the result to the given Message object.
-static void StreamWideCharsToMessage(const wchar_t* wstr, size_t length,
- Message* msg) {
- for (size_t i = 0; i != length; ) { // NOLINT
- if (wstr[i] != L'\0') {
- *msg << WideStringToUtf8(wstr + i, static_cast<int>(length - i));
- while (i != length && wstr[i] != L'\0')
- i++;
- } else {
- *msg << '\0';
- i++;
- }
- }
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-void SplitString(const ::std::string& str, char delimiter,
- ::std::vector< ::std::string>* dest) {
- ::std::vector< ::std::string> parsed;
- ::std::string::size_type pos = 0;
- while (::testing::internal::AlwaysTrue()) {
- const ::std::string::size_type colon = str.find(delimiter, pos);
- if (colon == ::std::string::npos) {
- parsed.push_back(str.substr(pos));
- break;
- } else {
- parsed.push_back(str.substr(pos, colon - pos));
- pos = colon + 1;
- }
- }
- dest->swap(parsed);
-}
-
-} // namespace internal
-
-// Constructs an empty Message.
-// We allocate the stringstream separately because otherwise each use of
-// ASSERT/EXPECT in a procedure adds over 200 bytes to the procedure's
-// stack frame leading to huge stack frames in some cases; gcc does not reuse
-// the stack space.
-Message::Message() : ss_(new ::std::stringstream) {
- // By default, we want there to be enough precision when printing
- // a double to a Message.
- *ss_ << std::setprecision(std::numeric_limits<double>::digits10 + 2);
-}
-
-// These two overloads allow streaming a wide C string to a Message
-// using the UTF-8 encoding.
-Message& Message::operator <<(const wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
-}
-Message& Message::operator <<(wchar_t* wide_c_str) {
- return *this << internal::String::ShowWideCString(wide_c_str);
-}
-
-#if GTEST_HAS_STD_WSTRING
-// Converts the given wide string to a narrow string using the UTF-8
-// encoding, and streams the result to this Message object.
-Message& Message::operator <<(const ::std::wstring& wstr) {
- internal::StreamWideCharsToMessage(wstr.c_str(), wstr.length(), this);
- return *this;
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-// Gets the text streamed to this object so far as an std::string.
-// Each '\0' character in the buffer is replaced with "\\0".
-std::string Message::GetString() const {
- return internal::StringStreamToString(ss_.get());
-}
-
-namespace internal {
-
-namespace edit_distance {
-std::vector<EditType> CalculateOptimalEdits(const std::vector<size_t>& left,
- const std::vector<size_t>& right) {
- std::vector<std::vector<double> > costs(
- left.size() + 1, std::vector<double>(right.size() + 1));
- std::vector<std::vector<EditType> > best_move(
- left.size() + 1, std::vector<EditType>(right.size() + 1));
-
- // Populate for empty right.
- for (size_t l_i = 0; l_i < costs.size(); ++l_i) {
- costs[l_i][0] = static_cast<double>(l_i);
- best_move[l_i][0] = kRemove;
- }
- // Populate for empty left.
- for (size_t r_i = 1; r_i < costs[0].size(); ++r_i) {
- costs[0][r_i] = static_cast<double>(r_i);
- best_move[0][r_i] = kAdd;
- }
-
- for (size_t l_i = 0; l_i < left.size(); ++l_i) {
- for (size_t r_i = 0; r_i < right.size(); ++r_i) {
- if (left[l_i] == right[r_i]) {
- // Found a match. Consume it.
- costs[l_i + 1][r_i + 1] = costs[l_i][r_i];
- best_move[l_i + 1][r_i + 1] = kMatch;
- continue;
- }
-
- const double add = costs[l_i + 1][r_i];
- const double remove = costs[l_i][r_i + 1];
- const double replace = costs[l_i][r_i];
- if (add < remove && add < replace) {
- costs[l_i + 1][r_i + 1] = add + 1;
- best_move[l_i + 1][r_i + 1] = kAdd;
- } else if (remove < add && remove < replace) {
- costs[l_i + 1][r_i + 1] = remove + 1;
- best_move[l_i + 1][r_i + 1] = kRemove;
- } else {
- // We make replace a little more expensive than add/remove to lower
- // their priority.
- costs[l_i + 1][r_i + 1] = replace + 1.00001;
- best_move[l_i + 1][r_i + 1] = kReplace;
- }
- }
- }
-
- // Reconstruct the best path. We do it in reverse order.
- std::vector<EditType> best_path;
- for (size_t l_i = left.size(), r_i = right.size(); l_i > 0 || r_i > 0;) {
- EditType move = best_move[l_i][r_i];
- best_path.push_back(move);
- l_i -= move != kAdd;
- r_i -= move != kRemove;
- }
- std::reverse(best_path.begin(), best_path.end());
- return best_path;
-}
-
-namespace {
-
-// Helper class to convert string into ids with deduplication.
-class InternalStrings {
- public:
- size_t GetId(const std::string& str) {
- IdMap::iterator it = ids_.find(str);
- if (it != ids_.end()) return it->second;
- size_t id = ids_.size();
- return ids_[str] = id;
- }
-
- private:
- typedef std::map<std::string, size_t> IdMap;
- IdMap ids_;
-};
-
-} // namespace
-
-std::vector<EditType> CalculateOptimalEdits(
- const std::vector<std::string>& left,
- const std::vector<std::string>& right) {
- std::vector<size_t> left_ids, right_ids;
- {
- InternalStrings intern_table;
- for (size_t i = 0; i < left.size(); ++i) {
- left_ids.push_back(intern_table.GetId(left[i]));
- }
- for (size_t i = 0; i < right.size(); ++i) {
- right_ids.push_back(intern_table.GetId(right[i]));
- }
- }
- return CalculateOptimalEdits(left_ids, right_ids);
-}
-
-namespace {
-
-// Helper class that holds the state for one hunk and prints it out to the
-// stream.
-// It reorders adds/removes when possible to group all removes before all
-// adds. It also adds the hunk header before printint into the stream.
-class Hunk {
- public:
- Hunk(size_t left_start, size_t right_start)
- : left_start_(left_start),
- right_start_(right_start),
- adds_(),
- removes_(),
- common_() {}
-
- void PushLine(char edit, const char* line) {
- switch (edit) {
- case ' ':
- ++common_;
- FlushEdits();
- hunk_.push_back(std::make_pair(' ', line));
- break;
- case '-':
- ++removes_;
- hunk_removes_.push_back(std::make_pair('-', line));
- break;
- case '+':
- ++adds_;
- hunk_adds_.push_back(std::make_pair('+', line));
- break;
- }
- }
-
- void PrintTo(std::ostream* os) {
- PrintHeader(os);
- FlushEdits();
- for (std::list<std::pair<char, const char*> >::const_iterator it =
- hunk_.begin();
- it != hunk_.end(); ++it) {
- *os << it->first << it->second << "\n";
- }
- }
-
- bool has_edits() const { return adds_ || removes_; }
-
- private:
- void FlushEdits() {
- hunk_.splice(hunk_.end(), hunk_removes_);
- hunk_.splice(hunk_.end(), hunk_adds_);
- }
-
- // Print a unified diff header for one hunk.
- // The format is
- // "@@ -<left_start>,<left_length> +<right_start>,<right_length> @@"
- // where the left/right parts are omitted if unnecessary.
- void PrintHeader(std::ostream* ss) const {
- *ss << "@@ ";
- if (removes_) {
- *ss << "-" << left_start_ << "," << (removes_ + common_);
- }
- if (removes_ && adds_) {
- *ss << " ";
- }
- if (adds_) {
- *ss << "+" << right_start_ << "," << (adds_ + common_);
- }
- *ss << " @@\n";
- }
-
- size_t left_start_, right_start_;
- size_t adds_, removes_, common_;
- std::list<std::pair<char, const char*> > hunk_, hunk_adds_, hunk_removes_;
-};
-
-} // namespace
-
-// Create a list of diff hunks in Unified diff format.
-// Each hunk has a header generated by PrintHeader above plus a body with
-// lines prefixed with ' ' for no change, '-' for deletion and '+' for
-// addition.
-// 'context' represents the desired unchanged prefix/suffix around the diff.
-// If two hunks are close enough that their contexts overlap, then they are
-// joined into one hunk.
-std::string CreateUnifiedDiff(const std::vector<std::string>& left,
- const std::vector<std::string>& right,
- size_t context) {
- const std::vector<EditType> edits = CalculateOptimalEdits(left, right);
-
- size_t l_i = 0, r_i = 0, edit_i = 0;
- std::stringstream ss;
- while (edit_i < edits.size()) {
- // Find first edit.
- while (edit_i < edits.size() && edits[edit_i] == kMatch) {
- ++l_i;
- ++r_i;
- ++edit_i;
- }
-
- // Find the first line to include in the hunk.
- const size_t prefix_context = std::min(l_i, context);
- Hunk hunk(l_i - prefix_context + 1, r_i - prefix_context + 1);
- for (size_t i = prefix_context; i > 0; --i) {
- hunk.PushLine(' ', left[l_i - i].c_str());
- }
-
- // Iterate the edits until we found enough suffix for the hunk or the input
- // is over.
- size_t n_suffix = 0;
- for (; edit_i < edits.size(); ++edit_i) {
- if (n_suffix >= context) {
- // Continue only if the next hunk is very close.
- auto it = edits.begin() + static_cast<int>(edit_i);
- while (it != edits.end() && *it == kMatch) ++it;
- if (it == edits.end() ||
- static_cast<size_t>(it - edits.begin()) - edit_i >= context) {
- // There is no next edit or it is too far away.
- break;
- }
- }
-
- EditType edit = edits[edit_i];
- // Reset count when a non match is found.
- n_suffix = edit == kMatch ? n_suffix + 1 : 0;
-
- if (edit == kMatch || edit == kRemove || edit == kReplace) {
- hunk.PushLine(edit == kMatch ? ' ' : '-', left[l_i].c_str());
- }
- if (edit == kAdd || edit == kReplace) {
- hunk.PushLine('+', right[r_i].c_str());
- }
-
- // Advance indices, depending on edit type.
- l_i += edit != kAdd;
- r_i += edit != kRemove;
- }
-
- if (!hunk.has_edits()) {
- // We are done. We don't want this hunk.
- break;
- }
-
- hunk.PrintTo(&ss);
- }
- return ss.str();
-}
-
-} // namespace edit_distance
-
-namespace {
-
-// The string representation of the values received in EqFailure() are already
-// escaped. Split them on escaped '\n' boundaries. Leave all other escaped
-// characters the same.
-std::vector<std::string> SplitEscapedString(const std::string& str) {
- std::vector<std::string> lines;
- size_t start = 0, end = str.size();
- if (end > 2 && str[0] == '"' && str[end - 1] == '"') {
- ++start;
- --end;
- }
- bool escaped = false;
- for (size_t i = start; i + 1 < end; ++i) {
- if (escaped) {
- escaped = false;
- if (str[i] == 'n') {
- lines.push_back(str.substr(start, i - start - 1));
- start = i + 1;
- }
- } else {
- escaped = str[i] == '\\';
- }
- }
- lines.push_back(str.substr(start, end - start));
- return lines;
-}
-
-} // namespace
-
-// Constructs and returns the message for an equality assertion
-// (e.g. ASSERT_EQ, EXPECT_STREQ, etc) failure.
-//
-// The first four parameters are the expressions used in the assertion
-// and their values, as strings. For example, for ASSERT_EQ(foo, bar)
-// where foo is 5 and bar is 6, we have:
-//
-// lhs_expression: "foo"
-// rhs_expression: "bar"
-// lhs_value: "5"
-// rhs_value: "6"
-//
-// The ignoring_case parameter is true if and only if the assertion is a
-// *_STRCASEEQ*. When it's true, the string "Ignoring case" will
-// be inserted into the message.
-AssertionResult EqFailure(const char* lhs_expression,
- const char* rhs_expression,
- const std::string& lhs_value,
- const std::string& rhs_value,
- bool ignoring_case) {
- Message msg;
- msg << "Expected equality of these values:";
- msg << "\n " << lhs_expression;
- if (lhs_value != lhs_expression) {
- msg << "\n Which is: " << lhs_value;
- }
- msg << "\n " << rhs_expression;
- if (rhs_value != rhs_expression) {
- msg << "\n Which is: " << rhs_value;
- }
-
- if (ignoring_case) {
- msg << "\nIgnoring case";
- }
-
- if (!lhs_value.empty() && !rhs_value.empty()) {
- const std::vector<std::string> lhs_lines =
- SplitEscapedString(lhs_value);
- const std::vector<std::string> rhs_lines =
- SplitEscapedString(rhs_value);
- if (lhs_lines.size() > 1 || rhs_lines.size() > 1) {
- msg << "\nWith diff:\n"
- << edit_distance::CreateUnifiedDiff(lhs_lines, rhs_lines);
- }
- }
-
- return AssertionFailure() << msg;
-}
-
-// Constructs a failure message for Boolean assertions such as EXPECT_TRUE.
-std::string GetBoolAssertionFailureMessage(
- const AssertionResult& assertion_result,
- const char* expression_text,
- const char* actual_predicate_value,
- const char* expected_predicate_value) {
- const char* actual_message = assertion_result.message();
- Message msg;
- msg << "Value of: " << expression_text
- << "\n Actual: " << actual_predicate_value;
- if (actual_message[0] != '\0')
- msg << " (" << actual_message << ")";
- msg << "\nExpected: " << expected_predicate_value;
- return msg.GetString();
-}
-
-// Helper function for implementing ASSERT_NEAR.
-AssertionResult DoubleNearPredFormat(const char* expr1,
- const char* expr2,
- const char* abs_error_expr,
- double val1,
- double val2,
- double abs_error) {
- const double diff = fabs(val1 - val2);
- if (diff <= abs_error) return AssertionSuccess();
-
- // Find the value which is closest to zero.
- const double min_abs = std::min(fabs(val1), fabs(val2));
- // Find the distance to the next double from that value.
- const double epsilon =
- nextafter(min_abs, std::numeric_limits<double>::infinity()) - min_abs;
- // Detect the case where abs_error is so small that EXPECT_NEAR is
- // effectively the same as EXPECT_EQUAL, and give an informative error
- // message so that the situation can be more easily understood without
- // requiring exotic floating-point knowledge.
- // Don't do an epsilon check if abs_error is zero because that implies
- // that an equality check was actually intended.
- if (!(std::isnan)(val1) && !(std::isnan)(val2) && abs_error > 0 &&
- abs_error < epsilon) {
- return AssertionFailure()
- << "The difference between " << expr1 << " and " << expr2 << " is "
- << diff << ", where\n"
- << expr1 << " evaluates to " << val1 << ",\n"
- << expr2 << " evaluates to " << val2 << ".\nThe abs_error parameter "
- << abs_error_expr << " evaluates to " << abs_error
- << " which is smaller than the minimum distance between doubles for "
- "numbers of this magnitude which is "
- << epsilon
- << ", thus making this EXPECT_NEAR check equivalent to "
- "EXPECT_EQUAL. Consider using EXPECT_DOUBLE_EQ instead.";
- }
- return AssertionFailure()
- << "The difference between " << expr1 << " and " << expr2
- << " is " << diff << ", which exceeds " << abs_error_expr << ", where\n"
- << expr1 << " evaluates to " << val1 << ",\n"
- << expr2 << " evaluates to " << val2 << ", and\n"
- << abs_error_expr << " evaluates to " << abs_error << ".";
-}
-
-
-// Helper template for implementing FloatLE() and DoubleLE().
-template <typename RawType>
-AssertionResult FloatingPointLE(const char* expr1,
- const char* expr2,
- RawType val1,
- RawType val2) {
- // Returns success if val1 is less than val2,
- if (val1 < val2) {
- return AssertionSuccess();
- }
-
- // or if val1 is almost equal to val2.
- const FloatingPoint<RawType> lhs(val1), rhs(val2);
- if (lhs.AlmostEquals(rhs)) {
- return AssertionSuccess();
- }
-
- // Note that the above two checks will both fail if either val1 or
- // val2 is NaN, as the IEEE floating-point standard requires that
- // any predicate involving a NaN must return false.
-
- ::std::stringstream val1_ss;
- val1_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val1;
-
- ::std::stringstream val2_ss;
- val2_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
- << val2;
-
- return AssertionFailure()
- << "Expected: (" << expr1 << ") <= (" << expr2 << ")\n"
- << " Actual: " << StringStreamToString(&val1_ss) << " vs "
- << StringStreamToString(&val2_ss);
-}
-
-} // namespace internal
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult FloatLE(const char* expr1, const char* expr2,
- float val1, float val2) {
- return internal::FloatingPointLE<float>(expr1, expr2, val1, val2);
-}
-
-// Asserts that val1 is less than, or almost equal to, val2. Fails
-// otherwise. In particular, it fails if either val1 or val2 is NaN.
-AssertionResult DoubleLE(const char* expr1, const char* expr2,
- double val1, double val2) {
- return internal::FloatingPointLE<double>(expr1, expr2, val1, val2);
-}
-
-namespace internal {
-
-// The helper function for {ASSERT|EXPECT}_STREQ.
-AssertionResult CmpHelperSTREQ(const char* lhs_expression,
- const char* rhs_expression,
- const char* lhs,
- const char* rhs) {
- if (String::CStringEquals(lhs, rhs)) {
- return AssertionSuccess();
- }
-
- return EqFailure(lhs_expression,
- rhs_expression,
- PrintToString(lhs),
- PrintToString(rhs),
- false);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASEEQ.
-AssertionResult CmpHelperSTRCASEEQ(const char* lhs_expression,
- const char* rhs_expression,
- const char* lhs,
- const char* rhs) {
- if (String::CaseInsensitiveCStringEquals(lhs, rhs)) {
- return AssertionSuccess();
- }
-
- return EqFailure(lhs_expression,
- rhs_expression,
- PrintToString(lhs),
- PrintToString(rhs),
- true);
-}
-
-// The helper function for {ASSERT|EXPECT}_STRNE.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- }
-}
-
-// The helper function for {ASSERT|EXPECT}_STRCASENE.
-AssertionResult CmpHelperSTRCASENE(const char* s1_expression,
- const char* s2_expression,
- const char* s1,
- const char* s2) {
- if (!String::CaseInsensitiveCStringEquals(s1, s2)) {
- return AssertionSuccess();
- } else {
- return AssertionFailure()
- << "Expected: (" << s1_expression << ") != ("
- << s2_expression << ") (ignoring case), actual: \""
- << s1 << "\" vs \"" << s2 << "\"";
- }
-}
-
-} // namespace internal
-
-namespace {
-
-// Helper functions for implementing IsSubString() and IsNotSubstring().
-
-// This group of overloaded functions return true if and only if needle
-// is a substring of haystack. NULL is considered a substring of
-// itself only.
-
-bool IsSubstringPred(const char* needle, const char* haystack) {
- if (needle == nullptr || haystack == nullptr) return needle == haystack;
-
- return strstr(haystack, needle) != nullptr;
-}
-
-bool IsSubstringPred(const wchar_t* needle, const wchar_t* haystack) {
- if (needle == nullptr || haystack == nullptr) return needle == haystack;
-
- return wcsstr(haystack, needle) != nullptr;
-}
-
-// StringType here can be either ::std::string or ::std::wstring.
-template <typename StringType>
-bool IsSubstringPred(const StringType& needle,
- const StringType& haystack) {
- return haystack.find(needle) != StringType::npos;
-}
-
-// This function implements either IsSubstring() or IsNotSubstring(),
-// depending on the value of the expected_to_be_substring parameter.
-// StringType here can be const char*, const wchar_t*, ::std::string,
-// or ::std::wstring.
-template <typename StringType>
-AssertionResult IsSubstringImpl(
- bool expected_to_be_substring,
- const char* needle_expr, const char* haystack_expr,
- const StringType& needle, const StringType& haystack) {
- if (IsSubstringPred(needle, haystack) == expected_to_be_substring)
- return AssertionSuccess();
-
- const bool is_wide_string = sizeof(needle[0]) > 1;
- const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
- return AssertionFailure()
- << "Value of: " << needle_expr << "\n"
- << " Actual: " << begin_string_quote << needle << "\"\n"
- << "Expected: " << (expected_to_be_substring ? "" : "not ")
- << "a substring of " << haystack_expr << "\n"
- << "Which is: " << begin_string_quote << haystack << "\"";
-}
-
-} // namespace
-
-// IsSubstring() and IsNotSubstring() check whether needle is a
-// substring of haystack (NULL is considered a substring of itself
-// only), and return an appropriate error message when they fail.
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const char* needle, const char* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const wchar_t* needle, const wchar_t* haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::string& needle, const ::std::string& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-
-#if GTEST_HAS_STD_WSTRING
-AssertionResult IsSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(true, needle_expr, haystack_expr, needle, haystack);
-}
-
-AssertionResult IsNotSubstring(
- const char* needle_expr, const char* haystack_expr,
- const ::std::wstring& needle, const ::std::wstring& haystack) {
- return IsSubstringImpl(false, needle_expr, haystack_expr, needle, haystack);
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-namespace internal {
-
-#if GTEST_OS_WINDOWS
-
-namespace {
-
-// Helper function for IsHRESULT{SuccessFailure} predicates
-AssertionResult HRESULTFailureHelper(const char* expr,
- const char* expected,
- long hr) { // NOLINT
-# if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_WINDOWS_TV_TITLE
-
- // Windows CE doesn't support FormatMessage.
- const char error_text[] = "";
-
-# else
-
- // Looks up the human-readable system message for the HRESULT code
- // and since we're not passing any params to FormatMessage, we don't
- // want inserts expanded.
- const DWORD kFlags = FORMAT_MESSAGE_FROM_SYSTEM |
- FORMAT_MESSAGE_IGNORE_INSERTS;
- const DWORD kBufSize = 4096;
- // Gets the system's human readable message string for this HRESULT.
- char error_text[kBufSize] = { '\0' };
- DWORD message_length = ::FormatMessageA(kFlags,
- 0, // no source, we're asking system
- static_cast<DWORD>(hr), // the error
- 0, // no line width restrictions
- error_text, // output buffer
- kBufSize, // buf size
- nullptr); // no arguments for inserts
- // Trims tailing white space (FormatMessage leaves a trailing CR-LF)
- for (; message_length && IsSpace(error_text[message_length - 1]);
- --message_length) {
- error_text[message_length - 1] = '\0';
- }
-
-# endif // GTEST_OS_WINDOWS_MOBILE
-
- const std::string error_hex("0x" + String::FormatHexInt(hr));
- return ::testing::AssertionFailure()
- << "Expected: " << expr << " " << expected << ".\n"
- << " Actual: " << error_hex << " " << error_text << "\n";
-}
-
-} // namespace
-
-AssertionResult IsHRESULTSuccess(const char* expr, long hr) { // NOLINT
- if (SUCCEEDED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "succeeds", hr);
-}
-
-AssertionResult IsHRESULTFailure(const char* expr, long hr) { // NOLINT
- if (FAILED(hr)) {
- return AssertionSuccess();
- }
- return HRESULTFailureHelper(expr, "fails", hr);
-}
-
-#endif // GTEST_OS_WINDOWS
-
-// Utility functions for encoding Unicode text (wide strings) in
-// UTF-8.
-
-// A Unicode code-point can have up to 21 bits, and is encoded in UTF-8
-// like this:
-//
-// Code-point length Encoding
-// 0 - 7 bits 0xxxxxxx
-// 8 - 11 bits 110xxxxx 10xxxxxx
-// 12 - 16 bits 1110xxxx 10xxxxxx 10xxxxxx
-// 17 - 21 bits 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx
-
-// The maximum code-point a one-byte UTF-8 sequence can represent.
-constexpr uint32_t kMaxCodePoint1 = (static_cast<uint32_t>(1) << 7) - 1;
-
-// The maximum code-point a two-byte UTF-8 sequence can represent.
-constexpr uint32_t kMaxCodePoint2 = (static_cast<uint32_t>(1) << (5 + 6)) - 1;
-
-// The maximum code-point a three-byte UTF-8 sequence can represent.
-constexpr uint32_t kMaxCodePoint3 = (static_cast<uint32_t>(1) << (4 + 2*6)) - 1;
-
-// The maximum code-point a four-byte UTF-8 sequence can represent.
-constexpr uint32_t kMaxCodePoint4 = (static_cast<uint32_t>(1) << (3 + 3*6)) - 1;
-
-// Chops off the n lowest bits from a bit pattern. Returns the n
-// lowest bits. As a side effect, the original bit pattern will be
-// shifted to the right by n bits.
-inline uint32_t ChopLowBits(uint32_t* bits, int n) {
- const uint32_t low_bits = *bits & ((static_cast<uint32_t>(1) << n) - 1);
- *bits >>= n;
- return low_bits;
-}
-
-// Converts a Unicode code point to a narrow string in UTF-8 encoding.
-// code_point parameter is of type uint32_t because wchar_t may not be
-// wide enough to contain a code point.
-// If the code_point is not a valid Unicode code point
-// (i.e. outside of Unicode range U+0 to U+10FFFF) it will be converted
-// to "(Invalid Unicode 0xXXXXXXXX)".
-std::string CodePointToUtf8(uint32_t code_point) {
- if (code_point > kMaxCodePoint4) {
- return "(Invalid Unicode 0x" + String::FormatHexUInt32(code_point) + ")";
- }
-
- char str[5]; // Big enough for the largest valid code point.
- if (code_point <= kMaxCodePoint1) {
- str[1] = '\0';
- str[0] = static_cast<char>(code_point); // 0xxxxxxx
- } else if (code_point <= kMaxCodePoint2) {
- str[2] = '\0';
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xC0 | code_point); // 110xxxxx
- } else if (code_point <= kMaxCodePoint3) {
- str[3] = '\0';
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xE0 | code_point); // 1110xxxx
- } else { // code_point <= kMaxCodePoint4
- str[4] = '\0';
- str[3] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[2] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[1] = static_cast<char>(0x80 | ChopLowBits(&code_point, 6)); // 10xxxxxx
- str[0] = static_cast<char>(0xF0 | code_point); // 11110xxx
- }
- return str;
-}
-
-// The following two functions only make sense if the system
-// uses UTF-16 for wide string encoding. All supported systems
-// with 16 bit wchar_t (Windows, Cygwin) do use UTF-16.
-
-// Determines if the arguments constitute UTF-16 surrogate pair
-// and thus should be combined into a single Unicode code point
-// using CreateCodePointFromUtf16SurrogatePair.
-inline bool IsUtf16SurrogatePair(wchar_t first, wchar_t second) {
- return sizeof(wchar_t) == 2 &&
- (first & 0xFC00) == 0xD800 && (second & 0xFC00) == 0xDC00;
-}
-
-// Creates a Unicode code point from UTF16 surrogate pair.
-inline uint32_t CreateCodePointFromUtf16SurrogatePair(wchar_t first,
- wchar_t second) {
- const auto first_u = static_cast<uint32_t>(first);
- const auto second_u = static_cast<uint32_t>(second);
- const uint32_t mask = (1 << 10) - 1;
- return (sizeof(wchar_t) == 2)
- ? (((first_u & mask) << 10) | (second_u & mask)) + 0x10000
- :
- // This function should not be called when the condition is
- // false, but we provide a sensible default in case it is.
- first_u;
-}
-
-// Converts a wide string to a narrow string in UTF-8 encoding.
-// The wide string is assumed to have the following encoding:
-// UTF-16 if sizeof(wchar_t) == 2 (on Windows, Cygwin)
-// UTF-32 if sizeof(wchar_t) == 4 (on Linux)
-// Parameter str points to a null-terminated wide string.
-// Parameter num_chars may additionally limit the number
-// of wchar_t characters processed. -1 is used when the entire string
-// should be processed.
-// If the string contains code points that are not valid Unicode code points
-// (i.e. outside of Unicode range U+0 to U+10FFFF) they will be output
-// as '(Invalid Unicode 0xXXXXXXXX)'. If the string is in UTF16 encoding
-// and contains invalid UTF-16 surrogate pairs, values in those pairs
-// will be encoded as individual Unicode characters from Basic Normal Plane.
-std::string WideStringToUtf8(const wchar_t* str, int num_chars) {
- if (num_chars == -1)
- num_chars = static_cast<int>(wcslen(str));
-
- ::std::stringstream stream;
- for (int i = 0; i < num_chars; ++i) {
- uint32_t unicode_code_point;
-
- if (str[i] == L'\0') {
- break;
- } else if (i + 1 < num_chars && IsUtf16SurrogatePair(str[i], str[i + 1])) {
- unicode_code_point = CreateCodePointFromUtf16SurrogatePair(str[i],
- str[i + 1]);
- i++;
- } else {
- unicode_code_point = static_cast<uint32_t>(str[i]);
- }
-
- stream << CodePointToUtf8(unicode_code_point);
- }
- return StringStreamToString(&stream);
-}
-
-// Converts a wide C string to an std::string using the UTF-8 encoding.
-// NULL will be converted to "(null)".
-std::string String::ShowWideCString(const wchar_t * wide_c_str) {
- if (wide_c_str == nullptr) return "(null)";
-
- return internal::WideStringToUtf8(wide_c_str, -1);
-}
-
-// Compares two wide C strings. Returns true if and only if they have the
-// same content.
-//
-// Unlike wcscmp(), this function can handle NULL argument(s). A NULL
-// C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::WideCStringEquals(const wchar_t * lhs, const wchar_t * rhs) {
- if (lhs == nullptr) return rhs == nullptr;
-
- if (rhs == nullptr) return false;
-
- return wcscmp(lhs, rhs) == 0;
-}
-
-// Helper function for *_STREQ on wide strings.
-AssertionResult CmpHelperSTREQ(const char* lhs_expression,
- const char* rhs_expression,
- const wchar_t* lhs,
- const wchar_t* rhs) {
- if (String::WideCStringEquals(lhs, rhs)) {
- return AssertionSuccess();
- }
-
- return EqFailure(lhs_expression,
- rhs_expression,
- PrintToString(lhs),
- PrintToString(rhs),
- false);
-}
-
-// Helper function for *_STRNE on wide strings.
-AssertionResult CmpHelperSTRNE(const char* s1_expression,
- const char* s2_expression,
- const wchar_t* s1,
- const wchar_t* s2) {
- if (!String::WideCStringEquals(s1, s2)) {
- return AssertionSuccess();
- }
-
- return AssertionFailure() << "Expected: (" << s1_expression << ") != ("
- << s2_expression << "), actual: "
- << PrintToString(s1)
- << " vs " << PrintToString(s2);
-}
-
-// Compares two C strings, ignoring case. Returns true if and only if they have
-// the same content.
-//
-// Unlike strcasecmp(), this function can handle NULL argument(s). A
-// NULL C string is considered different to any non-NULL C string,
-// including the empty string.
-bool String::CaseInsensitiveCStringEquals(const char * lhs, const char * rhs) {
- if (lhs == nullptr) return rhs == nullptr;
- if (rhs == nullptr) return false;
- return posix::StrCaseCmp(lhs, rhs) == 0;
-}
-
-// Compares two wide C strings, ignoring case. Returns true if and only if they
-// have the same content.
-//
-// Unlike wcscasecmp(), this function can handle NULL argument(s).
-// A NULL C string is considered different to any non-NULL wide C string,
-// including the empty string.
-// NB: The implementations on different platforms slightly differ.
-// On windows, this method uses _wcsicmp which compares according to LC_CTYPE
-// environment variable. On GNU platform this method uses wcscasecmp
-// which compares according to LC_CTYPE category of the current locale.
-// On MacOS X, it uses towlower, which also uses LC_CTYPE category of the
-// current locale.
-bool String::CaseInsensitiveWideCStringEquals(const wchar_t* lhs,
- const wchar_t* rhs) {
- if (lhs == nullptr) return rhs == nullptr;
-
- if (rhs == nullptr) return false;
-
-#if GTEST_OS_WINDOWS
- return _wcsicmp(lhs, rhs) == 0;
-#elif GTEST_OS_LINUX && !GTEST_OS_LINUX_ANDROID
- return wcscasecmp(lhs, rhs) == 0;
-#else
- // Android, Mac OS X and Cygwin don't define wcscasecmp.
- // Other unknown OSes may not define it either.
- wint_t left, right;
- do {
- left = towlower(static_cast<wint_t>(*lhs++));
- right = towlower(static_cast<wint_t>(*rhs++));
- } while (left && left == right);
- return left == right;
-#endif // OS selector
-}
-
-// Returns true if and only if str ends with the given suffix, ignoring case.
-// Any string is considered to end with an empty suffix.
-bool String::EndsWithCaseInsensitive(
- const std::string& str, const std::string& suffix) {
- const size_t str_len = str.length();
- const size_t suffix_len = suffix.length();
- return (str_len >= suffix_len) &&
- CaseInsensitiveCStringEquals(str.c_str() + str_len - suffix_len,
- suffix.c_str());
-}
-
-// Formats an int value as "%02d".
-std::string String::FormatIntWidth2(int value) {
- return FormatIntWidthN(value, 2);
-}
-
-// Formats an int value to given width with leading zeros.
-std::string String::FormatIntWidthN(int value, int width) {
- std::stringstream ss;
- ss << std::setfill('0') << std::setw(width) << value;
- return ss.str();
-}
-
-// Formats an int value as "%X".
-std::string String::FormatHexUInt32(uint32_t value) {
- std::stringstream ss;
- ss << std::hex << std::uppercase << value;
- return ss.str();
-}
-
-// Formats an int value as "%X".
-std::string String::FormatHexInt(int value) {
- return FormatHexUInt32(static_cast<uint32_t>(value));
-}
-
-// Formats a byte as "%02X".
-std::string String::FormatByte(unsigned char value) {
- std::stringstream ss;
- ss << std::setfill('0') << std::setw(2) << std::hex << std::uppercase
- << static_cast<unsigned int>(value);
- return ss.str();
-}
-
-// Converts the buffer in a stringstream to an std::string, converting NUL
-// bytes to "\\0" along the way.
-std::string StringStreamToString(::std::stringstream* ss) {
- const ::std::string& str = ss->str();
- const char* const start = str.c_str();
- const char* const end = start + str.length();
-
- std::string result;
- result.reserve(static_cast<size_t>(2 * (end - start)));
- for (const char* ch = start; ch != end; ++ch) {
- if (*ch == '\0') {
- result += "\\0"; // Replaces NUL with "\\0";
- } else {
- result += *ch;
- }
- }
-
- return result;
-}
-
-// Appends the user-supplied message to the Google-Test-generated message.
-std::string AppendUserMessage(const std::string& gtest_msg,
- const Message& user_msg) {
- // Appends the user message if it's non-empty.
- const std::string user_msg_string = user_msg.GetString();
- if (user_msg_string.empty()) {
- return gtest_msg;
- }
- if (gtest_msg.empty()) {
- return user_msg_string;
- }
- return gtest_msg + "\n" + user_msg_string;
-}
-
-} // namespace internal
-
-// class TestResult
-
-// Creates an empty TestResult.
-TestResult::TestResult()
- : death_test_count_(0), start_timestamp_(0), elapsed_time_(0) {}
-
-// D'tor.
-TestResult::~TestResult() {
-}
-
-// Returns the i-th test part result among all the results. i can
-// range from 0 to total_part_count() - 1. If i is not in that range,
-// aborts the program.
-const TestPartResult& TestResult::GetTestPartResult(int i) const {
- if (i < 0 || i >= total_part_count())
- internal::posix::Abort();
- return test_part_results_.at(static_cast<size_t>(i));
-}
-
-// Returns the i-th test property. i can range from 0 to
-// test_property_count() - 1. If i is not in that range, aborts the
-// program.
-const TestProperty& TestResult::GetTestProperty(int i) const {
- if (i < 0 || i >= test_property_count())
- internal::posix::Abort();
- return test_properties_.at(static_cast<size_t>(i));
-}
-
-// Clears the test part results.
-void TestResult::ClearTestPartResults() {
- test_part_results_.clear();
-}
-
-// Adds a test part result to the list.
-void TestResult::AddTestPartResult(const TestPartResult& test_part_result) {
- test_part_results_.push_back(test_part_result);
-}
-
-// Adds a test property to the list. If a property with the same key as the
-// supplied property is already represented, the value of this test_property
-// replaces the old value for that key.
-void TestResult::RecordProperty(const std::string& xml_element,
- const TestProperty& test_property) {
- if (!ValidateTestProperty(xml_element, test_property)) {
- return;
- }
- internal::MutexLock lock(&test_properties_mutex_);
- const std::vector<TestProperty>::iterator property_with_matching_key =
- std::find_if(test_properties_.begin(), test_properties_.end(),
- internal::TestPropertyKeyIs(test_property.key()));
- if (property_with_matching_key == test_properties_.end()) {
- test_properties_.push_back(test_property);
- return;
- }
- property_with_matching_key->SetValue(test_property.value());
-}
-
-// The list of reserved attributes used in the <testsuites> element of XML
-// output.
-static const char* const kReservedTestSuitesAttributes[] = {
- "disabled",
- "errors",
- "failures",
- "name",
- "random_seed",
- "tests",
- "time",
- "timestamp"
-};
-
-// The list of reserved attributes used in the <testsuite> element of XML
-// output.
-static const char* const kReservedTestSuiteAttributes[] = {
- "disabled", "errors", "failures", "name",
- "tests", "time", "timestamp", "skipped"};
-
-// The list of reserved attributes used in the <testcase> element of XML output.
-static const char* const kReservedTestCaseAttributes[] = {
- "classname", "name", "status", "time", "type_param",
- "value_param", "file", "line"};
-
-// Use a slightly different set for allowed output to ensure existing tests can
-// still RecordProperty("result") or "RecordProperty(timestamp")
-static const char* const kReservedOutputTestCaseAttributes[] = {
- "classname", "name", "status", "time", "type_param",
- "value_param", "file", "line", "result", "timestamp"};
-
-template <size_t kSize>
-std::vector<std::string> ArrayAsVector(const char* const (&array)[kSize]) {
- return std::vector<std::string>(array, array + kSize);
-}
-
-static std::vector<std::string> GetReservedAttributesForElement(
- const std::string& xml_element) {
- if (xml_element == "testsuites") {
- return ArrayAsVector(kReservedTestSuitesAttributes);
- } else if (xml_element == "testsuite") {
- return ArrayAsVector(kReservedTestSuiteAttributes);
- } else if (xml_element == "testcase") {
- return ArrayAsVector(kReservedTestCaseAttributes);
- } else {
- GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
- }
- // This code is unreachable but some compilers may not realizes that.
- return std::vector<std::string>();
-}
-
-// TODO(jdesprez): Merge the two getReserved attributes once skip is improved
-static std::vector<std::string> GetReservedOutputAttributesForElement(
- const std::string& xml_element) {
- if (xml_element == "testsuites") {
- return ArrayAsVector(kReservedTestSuitesAttributes);
- } else if (xml_element == "testsuite") {
- return ArrayAsVector(kReservedTestSuiteAttributes);
- } else if (xml_element == "testcase") {
- return ArrayAsVector(kReservedOutputTestCaseAttributes);
- } else {
- GTEST_CHECK_(false) << "Unrecognized xml_element provided: " << xml_element;
- }
- // This code is unreachable but some compilers may not realizes that.
- return std::vector<std::string>();
-}
-
-static std::string FormatWordList(const std::vector<std::string>& words) {
- Message word_list;
- for (size_t i = 0; i < words.size(); ++i) {
- if (i > 0 && words.size() > 2) {
- word_list << ", ";
- }
- if (i == words.size() - 1) {
- word_list << "and ";
- }
- word_list << "'" << words[i] << "'";
- }
- return word_list.GetString();
-}
-
-static bool ValidateTestPropertyName(
- const std::string& property_name,
- const std::vector<std::string>& reserved_names) {
- if (std::find(reserved_names.begin(), reserved_names.end(), property_name) !=
- reserved_names.end()) {
- ADD_FAILURE() << "Reserved key used in RecordProperty(): " << property_name
- << " (" << FormatWordList(reserved_names)
- << " are reserved by " << GTEST_NAME_ << ")";
- return false;
- }
- return true;
-}
-
-// Adds a failure if the key is a reserved attribute of the element named
-// xml_element. Returns true if the property is valid.
-bool TestResult::ValidateTestProperty(const std::string& xml_element,
- const TestProperty& test_property) {
- return ValidateTestPropertyName(test_property.key(),
- GetReservedAttributesForElement(xml_element));
-}
-
-// Clears the object.
-void TestResult::Clear() {
- test_part_results_.clear();
- test_properties_.clear();
- death_test_count_ = 0;
- elapsed_time_ = 0;
-}
-
-// Returns true off the test part was skipped.
-static bool TestPartSkipped(const TestPartResult& result) {
- return result.skipped();
-}
-
-// Returns true if and only if the test was skipped.
-bool TestResult::Skipped() const {
- return !Failed() && CountIf(test_part_results_, TestPartSkipped) > 0;
-}
-
-// Returns true if and only if the test failed.
-bool TestResult::Failed() const {
- for (int i = 0; i < total_part_count(); ++i) {
- if (GetTestPartResult(i).failed())
- return true;
- }
- return false;
-}
-
-// Returns true if and only if the test part fatally failed.
-static bool TestPartFatallyFailed(const TestPartResult& result) {
- return result.fatally_failed();
-}
-
-// Returns true if and only if the test fatally failed.
-bool TestResult::HasFatalFailure() const {
- return CountIf(test_part_results_, TestPartFatallyFailed) > 0;
-}
-
-// Returns true if and only if the test part non-fatally failed.
-static bool TestPartNonfatallyFailed(const TestPartResult& result) {
- return result.nonfatally_failed();
-}
-
-// Returns true if and only if the test has a non-fatal failure.
-bool TestResult::HasNonfatalFailure() const {
- return CountIf(test_part_results_, TestPartNonfatallyFailed) > 0;
-}
-
-// Gets the number of all test parts. This is the sum of the number
-// of successful test parts and the number of failed test parts.
-int TestResult::total_part_count() const {
- return static_cast<int>(test_part_results_.size());
-}
-
-// Returns the number of the test properties.
-int TestResult::test_property_count() const {
- return static_cast<int>(test_properties_.size());
-}
-
-// class Test
-
-// Creates a Test object.
-
-// The c'tor saves the states of all flags.
-Test::Test()
- : gtest_flag_saver_(new GTEST_FLAG_SAVER_) {
-}
-
-// The d'tor restores the states of all flags. The actual work is
-// done by the d'tor of the gtest_flag_saver_ field, and thus not
-// visible here.
-Test::~Test() {
-}
-
-// Sets up the test fixture.
-//
-// A sub-class may override this.
-void Test::SetUp() {
-}
-
-// Tears down the test fixture.
-//
-// A sub-class may override this.
-void Test::TearDown() {
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const std::string& key, const std::string& value) {
- UnitTest::GetInstance()->RecordProperty(key, value);
-}
-
-// Allows user supplied key value pairs to be recorded for later output.
-void Test::RecordProperty(const std::string& key, int value) {
- Message value_message;
- value_message << value;
- RecordProperty(key, value_message.GetString().c_str());
-}
-
-namespace internal {
-
-void ReportFailureInUnknownLocation(TestPartResult::Type result_type,
- const std::string& message) {
- // This function is a friend of UnitTest and as such has access to
- // AddTestPartResult.
- UnitTest::GetInstance()->AddTestPartResult(
- result_type,
- nullptr, // No info about the source file where the exception occurred.
- -1, // We have no info on which line caused the exception.
- message,
- ""); // No stack trace, either.
-}
-
-} // namespace internal
-
-// Google Test requires all tests in the same test suite to use the same test
-// fixture class. This function checks if the current test has the
-// same fixture class as the first test in the current test suite. If
-// yes, it returns true; otherwise it generates a Google Test failure and
-// returns false.
-bool Test::HasSameFixtureClass() {
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- const TestSuite* const test_suite = impl->current_test_suite();
-
- // Info about the first test in the current test suite.
- const TestInfo* const first_test_info = test_suite->test_info_list()[0];
- const internal::TypeId first_fixture_id = first_test_info->fixture_class_id_;
- const char* const first_test_name = first_test_info->name();
-
- // Info about the current test.
- const TestInfo* const this_test_info = impl->current_test_info();
- const internal::TypeId this_fixture_id = this_test_info->fixture_class_id_;
- const char* const this_test_name = this_test_info->name();
-
- if (this_fixture_id != first_fixture_id) {
- // Is the first test defined using TEST?
- const bool first_is_TEST = first_fixture_id == internal::GetTestTypeId();
- // Is this test defined using TEST?
- const bool this_is_TEST = this_fixture_id == internal::GetTestTypeId();
-
- if (first_is_TEST || this_is_TEST) {
- // Both TEST and TEST_F appear in same test suite, which is incorrect.
- // Tell the user how to fix this.
-
- // Gets the name of the TEST and the name of the TEST_F. Note
- // that first_is_TEST and this_is_TEST cannot both be true, as
- // the fixture IDs are different for the two tests.
- const char* const TEST_name =
- first_is_TEST ? first_test_name : this_test_name;
- const char* const TEST_F_name =
- first_is_TEST ? this_test_name : first_test_name;
-
- ADD_FAILURE()
- << "All tests in the same test suite must use the same test fixture\n"
- << "class, so mixing TEST_F and TEST in the same test suite is\n"
- << "illegal. In test suite " << this_test_info->test_suite_name()
- << ",\n"
- << "test " << TEST_F_name << " is defined using TEST_F but\n"
- << "test " << TEST_name << " is defined using TEST. You probably\n"
- << "want to change the TEST to TEST_F or move it to another test\n"
- << "case.";
- } else {
- // Two fixture classes with the same name appear in two different
- // namespaces, which is not allowed. Tell the user how to fix this.
- ADD_FAILURE()
- << "All tests in the same test suite must use the same test fixture\n"
- << "class. However, in test suite "
- << this_test_info->test_suite_name() << ",\n"
- << "you defined test " << first_test_name << " and test "
- << this_test_name << "\n"
- << "using two different test fixture classes. This can happen if\n"
- << "the two classes are from different namespaces or translation\n"
- << "units and have the same name. You should probably rename one\n"
- << "of the classes to put the tests into different test suites.";
- }
- return false;
- }
-
- return true;
-}
-
-#if GTEST_HAS_SEH
-
-// Adds an "exception thrown" fatal failure to the current test. This
-// function returns its result via an output parameter pointer because VC++
-// prohibits creation of objects with destructors on stack in functions
-// using __try (see error C2712).
-static std::string* FormatSehExceptionMessage(DWORD exception_code,
- const char* location) {
- Message message;
- message << "SEH exception with code 0x" << std::setbase(16) <<
- exception_code << std::setbase(10) << " thrown in " << location << ".";
-
- return new std::string(message.GetString());
-}
-
-#endif // GTEST_HAS_SEH
-
-namespace internal {
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Adds an "exception thrown" fatal failure to the current test.
-static std::string FormatCxxExceptionMessage(const char* description,
- const char* location) {
- Message message;
- if (description != nullptr) {
- message << "C++ exception with description \"" << description << "\"";
- } else {
- message << "Unknown C++ exception";
- }
- message << " thrown in " << location << ".";
-
- return message.GetString();
-}
-
-static std::string PrintTestPartResultToString(
- const TestPartResult& test_part_result);
-
-GoogleTestFailureException::GoogleTestFailureException(
- const TestPartResult& failure)
- : ::std::runtime_error(PrintTestPartResultToString(failure).c_str()) {}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// We put these helper functions in the internal namespace as IBM's xlC
-// compiler rejects the code if they were declared static.
-
-// Runs the given method and handles SEH exceptions it throws, when
-// SEH is supported; returns the 0-value for type Result in case of an
-// SEH exception. (Microsoft compilers cannot handle SEH and C++
-// exceptions in the same function. Therefore, we provide a separate
-// wrapper function for handling SEH exceptions.)
-template <class T, typename Result>
-Result HandleSehExceptionsInMethodIfSupported(
- T* object, Result (T::*method)(), const char* location) {
-#if GTEST_HAS_SEH
- __try {
- return (object->*method)();
- } __except (internal::UnitTestOptions::GTestShouldProcessSEH( // NOLINT
- GetExceptionCode())) {
- // We create the exception message on the heap because VC++ prohibits
- // creation of objects with destructors on stack in functions using __try
- // (see error C2712).
- std::string* exception_message = FormatSehExceptionMessage(
- GetExceptionCode(), location);
- internal::ReportFailureInUnknownLocation(TestPartResult::kFatalFailure,
- *exception_message);
- delete exception_message;
- return static_cast<Result>(0);
- }
-#else
- (void)location;
- return (object->*method)();
-#endif // GTEST_HAS_SEH
-}
-
-// Runs the given method and catches and reports C++ and/or SEH-style
-// exceptions, if they are supported; returns the 0-value for type
-// Result in case of an SEH exception.
-template <class T, typename Result>
-Result HandleExceptionsInMethodIfSupported(
- T* object, Result (T::*method)(), const char* location) {
- // NOTE: The user code can affect the way in which Google Test handles
- // exceptions by setting GTEST_FLAG(catch_exceptions), but only before
- // RUN_ALL_TESTS() starts. It is technically possible to check the flag
- // after the exception is caught and either report or re-throw the
- // exception based on the flag's value:
- //
- // try {
- // // Perform the test method.
- // } catch (...) {
- // if (GTEST_FLAG_GET(catch_exceptions))
- // // Report the exception as failure.
- // else
- // throw; // Re-throws the original exception.
- // }
- //
- // However, the purpose of this flag is to allow the program to drop into
- // the debugger when the exception is thrown. On most platforms, once the
- // control enters the catch block, the exception origin information is
- // lost and the debugger will stop the program at the point of the
- // re-throw in this function -- instead of at the point of the original
- // throw statement in the code under test. For this reason, we perform
- // the check early, sacrificing the ability to affect Google Test's
- // exception handling in the method where the exception is thrown.
- if (internal::GetUnitTestImpl()->catch_exceptions()) {
-#if GTEST_HAS_EXCEPTIONS
- try {
- return HandleSehExceptionsInMethodIfSupported(object, method, location);
- } catch (const AssertionException&) { // NOLINT
- // This failure was reported already.
- } catch (const internal::GoogleTestFailureException&) { // NOLINT
- // This exception type can only be thrown by a failed Google
- // Test assertion with the intention of letting another testing
- // framework catch it. Therefore we just re-throw it.
- throw;
- } catch (const std::exception& e) { // NOLINT
- internal::ReportFailureInUnknownLocation(
- TestPartResult::kFatalFailure,
- FormatCxxExceptionMessage(e.what(), location));
- } catch (...) { // NOLINT
- internal::ReportFailureInUnknownLocation(
- TestPartResult::kFatalFailure,
- FormatCxxExceptionMessage(nullptr, location));
- }
- return static_cast<Result>(0);
-#else
- return HandleSehExceptionsInMethodIfSupported(object, method, location);
-#endif // GTEST_HAS_EXCEPTIONS
- } else {
- return (object->*method)();
- }
-}
-
-} // namespace internal
-
-// Runs the test and updates the test result.
-void Test::Run() {
- if (!HasSameFixtureClass()) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(this, &Test::SetUp, "SetUp()");
- // We will run the test only if SetUp() was successful and didn't call
- // GTEST_SKIP().
- if (!HasFatalFailure() && !IsSkipped()) {
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &Test::TestBody, "the test body");
- }
-
- // However, we want to clean up as much as possible. Hence we will
- // always call TearDown(), even if SetUp() or the test body has
- // failed.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &Test::TearDown, "TearDown()");
-}
-
-// Returns true if and only if the current test has a fatal failure.
-bool Test::HasFatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->HasFatalFailure();
-}
-
-// Returns true if and only if the current test has a non-fatal failure.
-bool Test::HasNonfatalFailure() {
- return internal::GetUnitTestImpl()->current_test_result()->
- HasNonfatalFailure();
-}
-
-// Returns true if and only if the current test was skipped.
-bool Test::IsSkipped() {
- return internal::GetUnitTestImpl()->current_test_result()->Skipped();
-}
-
-// class TestInfo
-
-// Constructs a TestInfo object. It assumes ownership of the test factory
-// object.
-TestInfo::TestInfo(const std::string& a_test_suite_name,
- const std::string& a_name, const char* a_type_param,
- const char* a_value_param,
- internal::CodeLocation a_code_location,
- internal::TypeId fixture_class_id,
- internal::TestFactoryBase* factory)
- : test_suite_name_(a_test_suite_name),
- name_(a_name),
- type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
- value_param_(a_value_param ? new std::string(a_value_param) : nullptr),
- location_(a_code_location),
- fixture_class_id_(fixture_class_id),
- should_run_(false),
- is_disabled_(false),
- matches_filter_(false),
- is_in_another_shard_(false),
- factory_(factory),
- result_() {}
-
-// Destructs a TestInfo object.
-TestInfo::~TestInfo() { delete factory_; }
-
-namespace internal {
-
-// Creates a new TestInfo object and registers it with Google Test;
-// returns the created object.
-//
-// Arguments:
-//
-// test_suite_name: name of the test suite
-// name: name of the test
-// type_param: the name of the test's type parameter, or NULL if
-// this is not a typed or a type-parameterized test.
-// value_param: text representation of the test's value parameter,
-// or NULL if this is not a value-parameterized test.
-// code_location: code location where the test is defined
-// fixture_class_id: ID of the test fixture class
-// set_up_tc: pointer to the function that sets up the test suite
-// tear_down_tc: pointer to the function that tears down the test suite
-// factory: pointer to the factory that creates a test object.
-// The newly created TestInfo instance will assume
-// ownership of the factory object.
-TestInfo* MakeAndRegisterTestInfo(
- const char* test_suite_name, const char* name, const char* type_param,
- const char* value_param, CodeLocation code_location,
- TypeId fixture_class_id, SetUpTestSuiteFunc set_up_tc,
- TearDownTestSuiteFunc tear_down_tc, TestFactoryBase* factory) {
- TestInfo* const test_info =
- new TestInfo(test_suite_name, name, type_param, value_param,
- code_location, fixture_class_id, factory);
- GetUnitTestImpl()->AddTestInfo(set_up_tc, tear_down_tc, test_info);
- return test_info;
-}
-
-void ReportInvalidTestSuiteType(const char* test_suite_name,
- CodeLocation code_location) {
- Message errors;
- errors
- << "Attempted redefinition of test suite " << test_suite_name << ".\n"
- << "All tests in the same test suite must use the same test fixture\n"
- << "class. However, in test suite " << test_suite_name << ", you tried\n"
- << "to define a test using a fixture class different from the one\n"
- << "used earlier. This can happen if the two fixture classes are\n"
- << "from different namespaces and have the same name. You should\n"
- << "probably rename one of the classes to put the tests into different\n"
- << "test suites.";
-
- GTEST_LOG_(ERROR) << FormatFileLocation(code_location.file.c_str(),
- code_location.line)
- << " " << errors.GetString();
-}
-} // namespace internal
-
-namespace {
-
-// A predicate that checks the test name of a TestInfo against a known
-// value.
-//
-// This is used for implementation of the TestSuite class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestNameIs is copyable.
-class TestNameIs {
- public:
- // Constructor.
- //
- // TestNameIs has NO default constructor.
- explicit TestNameIs(const char* name)
- : name_(name) {}
-
- // Returns true if and only if the test name of test_info matches name_.
- bool operator()(const TestInfo * test_info) const {
- return test_info && test_info->name() == name_;
- }
-
- private:
- std::string name_;
-};
-
-} // namespace
-
-namespace internal {
-
-// This method expands all parameterized tests registered with macros TEST_P
-// and INSTANTIATE_TEST_SUITE_P into regular tests and registers those.
-// This will be done just once during the program runtime.
-void UnitTestImpl::RegisterParameterizedTests() {
- if (!parameterized_tests_registered_) {
- parameterized_test_registry_.RegisterTests();
- type_parameterized_test_registry_.CheckForInstantiations();
- parameterized_tests_registered_ = true;
- }
-}
-
-} // namespace internal
-
-// Creates the test object, runs it, records its result, and then
-// deletes it.
-void TestInfo::Run() {
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
- if (!should_run_) {
- if (is_disabled_) repeater->OnTestDisabled(*this);
- return;
- }
-
- // Tells UnitTest where to store test result.
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_info(this);
-
- // Notifies the unit test event listeners that a test is about to start.
- repeater->OnTestStart(*this);
- result_.set_start_timestamp(internal::GetTimeInMillis());
- internal::Timer timer;
- impl->os_stack_trace_getter()->UponLeavingGTest();
-
- // Creates the test object.
- Test* const test = internal::HandleExceptionsInMethodIfSupported(
- factory_, &internal::TestFactoryBase::CreateTest,
- "the test fixture's constructor");
-
- // Runs the test if the constructor didn't generate a fatal failure or invoke
- // GTEST_SKIP().
- // Note that the object will not be null
- if (!Test::HasFatalFailure() && !Test::IsSkipped()) {
- // This doesn't throw as all user code that can throw are wrapped into
- // exception handling code.
- test->Run();
- }
-
- if (test != nullptr) {
- // Deletes the test object.
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- test, &Test::DeleteSelf_, "the test fixture's destructor");
- }
-
- result_.set_elapsed_time(timer.Elapsed());
-
- // Notifies the unit test event listener that a test has just finished.
- repeater->OnTestEnd(*this);
-
- // Tells UnitTest to stop associating assertion results to this
- // test.
- impl->set_current_test_info(nullptr);
-}
-
-// Skip and records a skipped test result for this object.
-void TestInfo::Skip() {
- if (!should_run_) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_info(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- // Notifies the unit test event listeners that a test is about to start.
- repeater->OnTestStart(*this);
-
- const TestPartResult test_part_result =
- TestPartResult(TestPartResult::kSkip, this->file(), this->line(), "");
- impl->GetTestPartResultReporterForCurrentThread()->ReportTestPartResult(
- test_part_result);
-
- // Notifies the unit test event listener that a test has just finished.
- repeater->OnTestEnd(*this);
- impl->set_current_test_info(nullptr);
-}
-
-// class TestSuite
-
-// Gets the number of successful tests in this test suite.
-int TestSuite::successful_test_count() const {
- return CountIf(test_info_list_, TestPassed);
-}
-
-// Gets the number of successful tests in this test suite.
-int TestSuite::skipped_test_count() const {
- return CountIf(test_info_list_, TestSkipped);
-}
-
-// Gets the number of failed tests in this test suite.
-int TestSuite::failed_test_count() const {
- return CountIf(test_info_list_, TestFailed);
-}
-
-// Gets the number of disabled tests that will be reported in the XML report.
-int TestSuite::reportable_disabled_test_count() const {
- return CountIf(test_info_list_, TestReportableDisabled);
-}
-
-// Gets the number of disabled tests in this test suite.
-int TestSuite::disabled_test_count() const {
- return CountIf(test_info_list_, TestDisabled);
-}
-
-// Gets the number of tests to be printed in the XML report.
-int TestSuite::reportable_test_count() const {
- return CountIf(test_info_list_, TestReportable);
-}
-
-// Get the number of tests in this test suite that should run.
-int TestSuite::test_to_run_count() const {
- return CountIf(test_info_list_, ShouldRunTest);
-}
-
-// Gets the number of all tests.
-int TestSuite::total_test_count() const {
- return static_cast<int>(test_info_list_.size());
-}
-
-// Creates a TestSuite with the given name.
-//
-// Arguments:
-//
-// a_name: name of the test suite
-// a_type_param: the name of the test suite's type parameter, or NULL if
-// this is not a typed or a type-parameterized test suite.
-// set_up_tc: pointer to the function that sets up the test suite
-// tear_down_tc: pointer to the function that tears down the test suite
-TestSuite::TestSuite(const char* a_name, const char* a_type_param,
- internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc)
- : name_(a_name),
- type_param_(a_type_param ? new std::string(a_type_param) : nullptr),
- set_up_tc_(set_up_tc),
- tear_down_tc_(tear_down_tc),
- should_run_(false),
- start_timestamp_(0),
- elapsed_time_(0) {}
-
-// Destructor of TestSuite.
-TestSuite::~TestSuite() {
- // Deletes every Test in the collection.
- ForEach(test_info_list_, internal::Delete<TestInfo>);
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-const TestInfo* TestSuite::GetTestInfo(int i) const {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
-}
-
-// Returns the i-th test among all the tests. i can range from 0 to
-// total_test_count() - 1. If i is not in that range, returns NULL.
-TestInfo* TestSuite::GetMutableTestInfo(int i) {
- const int index = GetElementOr(test_indices_, i, -1);
- return index < 0 ? nullptr : test_info_list_[static_cast<size_t>(index)];
-}
-
-// Adds a test to this test suite. Will delete the test upon
-// destruction of the TestSuite object.
-void TestSuite::AddTestInfo(TestInfo* test_info) {
- test_info_list_.push_back(test_info);
- test_indices_.push_back(static_cast<int>(test_indices_.size()));
-}
-
-// Runs every test in this TestSuite.
-void TestSuite::Run() {
- if (!should_run_) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_suite(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- // Call both legacy and the new API
- repeater->OnTestSuiteStart(*this);
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- repeater->OnTestCaseStart(*this);
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &TestSuite::RunSetUpTestSuite, "SetUpTestSuite()");
-
- const bool skip_all = ad_hoc_test_result().Failed();
-
- start_timestamp_ = internal::GetTimeInMillis();
- internal::Timer timer;
- for (int i = 0; i < total_test_count(); i++) {
- if (skip_all) {
- GetMutableTestInfo(i)->Skip();
- } else {
- GetMutableTestInfo(i)->Run();
- }
- if (GTEST_FLAG_GET(fail_fast) &&
- GetMutableTestInfo(i)->result()->Failed()) {
- for (int j = i + 1; j < total_test_count(); j++) {
- GetMutableTestInfo(j)->Skip();
- }
- break;
- }
- }
- elapsed_time_ = timer.Elapsed();
-
- impl->os_stack_trace_getter()->UponLeavingGTest();
- internal::HandleExceptionsInMethodIfSupported(
- this, &TestSuite::RunTearDownTestSuite, "TearDownTestSuite()");
-
- // Call both legacy and the new API
- repeater->OnTestSuiteEnd(*this);
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- repeater->OnTestCaseEnd(*this);
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- impl->set_current_test_suite(nullptr);
-}
-
-// Skips all tests under this TestSuite.
-void TestSuite::Skip() {
- if (!should_run_) return;
-
- internal::UnitTestImpl* const impl = internal::GetUnitTestImpl();
- impl->set_current_test_suite(this);
-
- TestEventListener* repeater = UnitTest::GetInstance()->listeners().repeater();
-
- // Call both legacy and the new API
- repeater->OnTestSuiteStart(*this);
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- repeater->OnTestCaseStart(*this);
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- for (int i = 0; i < total_test_count(); i++) {
- GetMutableTestInfo(i)->Skip();
- }
-
- // Call both legacy and the new API
- repeater->OnTestSuiteEnd(*this);
- // Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- repeater->OnTestCaseEnd(*this);
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- impl->set_current_test_suite(nullptr);
-}
-
-// Clears the results of all tests in this test suite.
-void TestSuite::ClearResult() {
- ad_hoc_test_result_.Clear();
- ForEach(test_info_list_, TestInfo::ClearTestResult);
-}
-
-// Shuffles the tests in this test suite.
-void TestSuite::ShuffleTests(internal::Random* random) {
- Shuffle(random, &test_indices_);
-}
-
-// Restores the test order to before the first shuffle.
-void TestSuite::UnshuffleTests() {
- for (size_t i = 0; i < test_indices_.size(); i++) {
- test_indices_[i] = static_cast<int>(i);
- }
-}
-
-// Formats a countable noun. Depending on its quantity, either the
-// singular form or the plural form is used. e.g.
-//
-// FormatCountableNoun(1, "formula", "formuli") returns "1 formula".
-// FormatCountableNoun(5, "book", "books") returns "5 books".
-static std::string FormatCountableNoun(int count,
- const char * singular_form,
- const char * plural_form) {
- return internal::StreamableToString(count) + " " +
- (count == 1 ? singular_form : plural_form);
-}
-
-// Formats the count of tests.
-static std::string FormatTestCount(int test_count) {
- return FormatCountableNoun(test_count, "test", "tests");
-}
-
-// Formats the count of test suites.
-static std::string FormatTestSuiteCount(int test_suite_count) {
- return FormatCountableNoun(test_suite_count, "test suite", "test suites");
-}
-
-// Converts a TestPartResult::Type enum to human-friendly string
-// representation. Both kNonFatalFailure and kFatalFailure are translated
-// to "Failure", as the user usually doesn't care about the difference
-// between the two when viewing the test result.
-static const char * TestPartResultTypeToString(TestPartResult::Type type) {
- switch (type) {
- case TestPartResult::kSkip:
- return "Skipped\n";
- case TestPartResult::kSuccess:
- return "Success";
-
- case TestPartResult::kNonFatalFailure:
- case TestPartResult::kFatalFailure:
-#ifdef _MSC_VER
- return "error: ";
-#else
- return "Failure\n";
-#endif
- default:
- return "Unknown result type";
- }
-}
-
-namespace internal {
-namespace {
-enum class GTestColor { kDefault, kRed, kGreen, kYellow };
-} // namespace
-
-// Prints a TestPartResult to an std::string.
-static std::string PrintTestPartResultToString(
- const TestPartResult& test_part_result) {
- return (Message()
- << internal::FormatFileLocation(test_part_result.file_name(),
- test_part_result.line_number())
- << " " << TestPartResultTypeToString(test_part_result.type())
- << test_part_result.message()).GetString();
-}
-
-// Prints a TestPartResult.
-static void PrintTestPartResult(const TestPartResult& test_part_result) {
- const std::string& result =
- PrintTestPartResultToString(test_part_result);
- printf("%s\n", result.c_str());
- fflush(stdout);
- // If the test program runs in Visual Studio or a debugger, the
- // following statements add the test part result message to the Output
- // window such that the user can double-click on it to jump to the
- // corresponding source code location; otherwise they do nothing.
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- // We don't call OutputDebugString*() on Windows Mobile, as printing
- // to stdout is done by OutputDebugString() there already - we don't
- // want the same message printed twice.
- ::OutputDebugStringA(result.c_str());
- ::OutputDebugStringA("\n");
-#endif
-}
-
-// class PrettyUnitTestResultPrinter
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
- !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !GTEST_OS_WINDOWS_MINGW
-
-// Returns the character attribute for the given color.
-static WORD GetColorAttribute(GTestColor color) {
- switch (color) {
- case GTestColor::kRed:
- return FOREGROUND_RED;
- case GTestColor::kGreen:
- return FOREGROUND_GREEN;
- case GTestColor::kYellow:
- return FOREGROUND_RED | FOREGROUND_GREEN;
- default: return 0;
- }
-}
-
-static int GetBitOffset(WORD color_mask) {
- if (color_mask == 0) return 0;
-
- int bitOffset = 0;
- while ((color_mask & 1) == 0) {
- color_mask >>= 1;
- ++bitOffset;
- }
- return bitOffset;
-}
-
-static WORD GetNewColor(GTestColor color, WORD old_color_attrs) {
- // Let's reuse the BG
- static const WORD background_mask = BACKGROUND_BLUE | BACKGROUND_GREEN |
- BACKGROUND_RED | BACKGROUND_INTENSITY;
- static const WORD foreground_mask = FOREGROUND_BLUE | FOREGROUND_GREEN |
- FOREGROUND_RED | FOREGROUND_INTENSITY;
- const WORD existing_bg = old_color_attrs & background_mask;
-
- WORD new_color =
- GetColorAttribute(color) | existing_bg | FOREGROUND_INTENSITY;
- static const int bg_bitOffset = GetBitOffset(background_mask);
- static const int fg_bitOffset = GetBitOffset(foreground_mask);
-
- if (((new_color & background_mask) >> bg_bitOffset) ==
- ((new_color & foreground_mask) >> fg_bitOffset)) {
- new_color ^= FOREGROUND_INTENSITY; // invert intensity
- }
- return new_color;
-}
-
-#else
-
-// Returns the ANSI color code for the given color. GTestColor::kDefault is
-// an invalid input.
-static const char* GetAnsiColorCode(GTestColor color) {
- switch (color) {
- case GTestColor::kRed:
- return "1";
- case GTestColor::kGreen:
- return "2";
- case GTestColor::kYellow:
- return "3";
- default:
- return nullptr;
- }
-}
-
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
-
-// Returns true if and only if Google Test should use colors in the output.
-bool ShouldUseColor(bool stdout_is_tty) {
- std::string c = GTEST_FLAG_GET(color);
- const char* const gtest_color = c.c_str();
-
- if (String::CaseInsensitiveCStringEquals(gtest_color, "auto")) {
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
- // On Windows the TERM variable is usually not set, but the
- // console there does support colors.
- return stdout_is_tty;
-#else
- // On non-Windows platforms, we rely on the TERM variable.
- const char* const term = posix::GetEnv("TERM");
- const bool term_supports_color =
- String::CStringEquals(term, "xterm") ||
- String::CStringEquals(term, "xterm-color") ||
- String::CStringEquals(term, "xterm-256color") ||
- String::CStringEquals(term, "screen") ||
- String::CStringEquals(term, "screen-256color") ||
- String::CStringEquals(term, "tmux") ||
- String::CStringEquals(term, "tmux-256color") ||
- String::CStringEquals(term, "rxvt-unicode") ||
- String::CStringEquals(term, "rxvt-unicode-256color") ||
- String::CStringEquals(term, "linux") ||
- String::CStringEquals(term, "cygwin");
- return stdout_is_tty && term_supports_color;
-#endif // GTEST_OS_WINDOWS
- }
-
- return String::CaseInsensitiveCStringEquals(gtest_color, "yes") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "true") ||
- String::CaseInsensitiveCStringEquals(gtest_color, "t") ||
- String::CStringEquals(gtest_color, "1");
- // We take "yes", "true", "t", and "1" as meaning "yes". If the
- // value is neither one of these nor "auto", we treat it as "no" to
- // be conservative.
-}
-
-// Helpers for printing colored strings to stdout. Note that on Windows, we
-// cannot simply emit special characters and have the terminal change colors.
-// This routine must actually emit the characters rather than return a string
-// that would be colored when printed, as can be done on Linux.
-
-GTEST_ATTRIBUTE_PRINTF_(2, 3)
-static void ColoredPrintf(GTestColor color, const char *fmt, ...) {
- va_list args;
- va_start(args, fmt);
-
-#if GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS || GTEST_OS_IOS || \
- GTEST_OS_WINDOWS_PHONE || GTEST_OS_WINDOWS_RT || defined(ESP_PLATFORM)
- const bool use_color = AlwaysFalse();
-#else
- static const bool in_color_mode =
- ShouldUseColor(posix::IsATTY(posix::FileNo(stdout)) != 0);
- const bool use_color = in_color_mode && (color != GTestColor::kDefault);
-#endif // GTEST_OS_WINDOWS_MOBILE || GTEST_OS_ZOS
-
- if (!use_color) {
- vprintf(fmt, args);
- va_end(args);
- return;
- }
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE && \
- !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT && !GTEST_OS_WINDOWS_MINGW
- const HANDLE stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
-
- // Gets the current text color.
- CONSOLE_SCREEN_BUFFER_INFO buffer_info;
- GetConsoleScreenBufferInfo(stdout_handle, &buffer_info);
- const WORD old_color_attrs = buffer_info.wAttributes;
- const WORD new_color = GetNewColor(color, old_color_attrs);
-
- // We need to flush the stream buffers into the console before each
- // SetConsoleTextAttribute call lest it affect the text that is already
- // printed but has not yet reached the console.
- fflush(stdout);
- SetConsoleTextAttribute(stdout_handle, new_color);
-
- vprintf(fmt, args);
-
- fflush(stdout);
- // Restores the text color.
- SetConsoleTextAttribute(stdout_handle, old_color_attrs);
-#else
- printf("\033[0;3%sm", GetAnsiColorCode(color));
- vprintf(fmt, args);
- printf("\033[m"); // Resets the terminal to default.
-#endif // GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MOBILE
- va_end(args);
-}
-
-// Text printed in Google Test's text output and --gtest_list_tests
-// output to label the type parameter and value parameter for a test.
-static const char kTypeParamLabel[] = "TypeParam";
-static const char kValueParamLabel[] = "GetParam()";
-
-static void PrintFullTestCommentIfPresent(const TestInfo& test_info) {
- const char* const type_param = test_info.type_param();
- const char* const value_param = test_info.value_param();
-
- if (type_param != nullptr || value_param != nullptr) {
- printf(", where ");
- if (type_param != nullptr) {
- printf("%s = %s", kTypeParamLabel, type_param);
- if (value_param != nullptr) printf(" and ");
- }
- if (value_param != nullptr) {
- printf("%s = %s", kValueParamLabel, value_param);
- }
- }
-}
-
-// This class implements the TestEventListener interface.
-//
-// Class PrettyUnitTestResultPrinter is copyable.
-class PrettyUnitTestResultPrinter : public TestEventListener {
- public:
- PrettyUnitTestResultPrinter() {}
- static void PrintTestName(const char* test_suite, const char* test) {
- printf("%s.%s", test_suite, test);
- }
-
- // The following methods override what's in the TestEventListener class.
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
- void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
- void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseStart(const TestCase& test_case) override;
-#else
- void OnTestSuiteStart(const TestSuite& test_suite) override;
-#endif // OnTestCaseStart
-
- void OnTestStart(const TestInfo& test_info) override;
- void OnTestDisabled(const TestInfo& test_info) override;
-
- void OnTestPartResult(const TestPartResult& result) override;
- void OnTestEnd(const TestInfo& test_info) override;
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseEnd(const TestCase& test_case) override;
-#else
- void OnTestSuiteEnd(const TestSuite& test_suite) override;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
- void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
-
- private:
- static void PrintFailedTests(const UnitTest& unit_test);
- static void PrintFailedTestSuites(const UnitTest& unit_test);
- static void PrintSkippedTests(const UnitTest& unit_test);
-};
-
- // Fired before each iteration of tests starts.
-void PrettyUnitTestResultPrinter::OnTestIterationStart(
- const UnitTest& unit_test, int iteration) {
- if (GTEST_FLAG_GET(repeat) != 1)
- printf("\nRepeating all tests (iteration %d) . . .\n\n", iteration + 1);
-
- std::string f = GTEST_FLAG_GET(filter);
- const char* const filter = f.c_str();
-
- // Prints the filter if it's not *. This reminds the user that some
- // tests may be skipped.
- if (!String::CStringEquals(filter, kUniversalFilter)) {
- ColoredPrintf(GTestColor::kYellow, "Note: %s filter = %s\n", GTEST_NAME_,
- filter);
- }
-
- if (internal::ShouldShard(kTestTotalShards, kTestShardIndex, false)) {
- const int32_t shard_index = Int32FromEnvOrDie(kTestShardIndex, -1);
- ColoredPrintf(GTestColor::kYellow, "Note: This is test shard %d of %s.\n",
- static_cast<int>(shard_index) + 1,
- internal::posix::GetEnv(kTestTotalShards));
- }
-
- if (GTEST_FLAG_GET(shuffle)) {
- ColoredPrintf(GTestColor::kYellow,
- "Note: Randomizing tests' orders with a seed of %d .\n",
- unit_test.random_seed());
- }
-
- ColoredPrintf(GTestColor::kGreen, "[==========] ");
- printf("Running %s from %s.\n",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsSetUpStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("Global test environment set-up.\n");
- fflush(stdout);
-}
-
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-void PrettyUnitTestResultPrinter::OnTestCaseStart(const TestCase& test_case) {
- const std::string counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("%s from %s", counts.c_str(), test_case.name());
- if (test_case.type_param() == nullptr) {
- printf("\n");
- } else {
- printf(", where %s = %s\n", kTypeParamLabel, test_case.type_param());
- }
- fflush(stdout);
-}
-#else
-void PrettyUnitTestResultPrinter::OnTestSuiteStart(
- const TestSuite& test_suite) {
- const std::string counts =
- FormatCountableNoun(test_suite.test_to_run_count(), "test", "tests");
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("%s from %s", counts.c_str(), test_suite.name());
- if (test_suite.type_param() == nullptr) {
- printf("\n");
- } else {
- printf(", where %s = %s\n", kTypeParamLabel, test_suite.type_param());
- }
- fflush(stdout);
-}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-void PrettyUnitTestResultPrinter::OnTestStart(const TestInfo& test_info) {
- ColoredPrintf(GTestColor::kGreen, "[ RUN ] ");
- PrintTestName(test_info.test_suite_name(), test_info.name());
- printf("\n");
- fflush(stdout);
-}
-
-void PrettyUnitTestResultPrinter::OnTestDisabled(const TestInfo& test_info) {
- ColoredPrintf(GTestColor::kYellow, "[ DISABLED ] ");
- PrintTestName(test_info.test_suite_name(), test_info.name());
- printf("\n");
- fflush(stdout);
-}
-
-// Called after an assertion failure.
-void PrettyUnitTestResultPrinter::OnTestPartResult(
- const TestPartResult& result) {
- switch (result.type()) {
- // If the test part succeeded, we don't need to do anything.
- case TestPartResult::kSuccess:
- return;
- default:
- // Print failure message from the assertion
- // (e.g. expected this and got that).
- PrintTestPartResult(result);
- fflush(stdout);
- }
-}
-
-void PrettyUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
- if (test_info.result()->Passed()) {
- ColoredPrintf(GTestColor::kGreen, "[ OK ] ");
- } else if (test_info.result()->Skipped()) {
- ColoredPrintf(GTestColor::kGreen, "[ SKIPPED ] ");
- } else {
- ColoredPrintf(GTestColor::kRed, "[ FAILED ] ");
- }
- PrintTestName(test_info.test_suite_name(), test_info.name());
- if (test_info.result()->Failed())
- PrintFullTestCommentIfPresent(test_info);
-
- if (GTEST_FLAG_GET(print_time)) {
- printf(" (%s ms)\n", internal::StreamableToString(
- test_info.result()->elapsed_time()).c_str());
- } else {
- printf("\n");
- }
- fflush(stdout);
-}
-
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-void PrettyUnitTestResultPrinter::OnTestCaseEnd(const TestCase& test_case) {
- if (!GTEST_FLAG_GET(print_time)) return;
-
- const std::string counts =
- FormatCountableNoun(test_case.test_to_run_count(), "test", "tests");
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("%s from %s (%s ms total)\n\n", counts.c_str(), test_case.name(),
- internal::StreamableToString(test_case.elapsed_time()).c_str());
- fflush(stdout);
-}
-#else
-void PrettyUnitTestResultPrinter::OnTestSuiteEnd(const TestSuite& test_suite) {
- if (!GTEST_FLAG_GET(print_time)) return;
-
- const std::string counts =
- FormatCountableNoun(test_suite.test_to_run_count(), "test", "tests");
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("%s from %s (%s ms total)\n\n", counts.c_str(), test_suite.name(),
- internal::StreamableToString(test_suite.elapsed_time()).c_str());
- fflush(stdout);
-}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-void PrettyUnitTestResultPrinter::OnEnvironmentsTearDownStart(
- const UnitTest& /*unit_test*/) {
- ColoredPrintf(GTestColor::kGreen, "[----------] ");
- printf("Global test environment tear-down\n");
- fflush(stdout);
-}
-
-// Internal helper for printing the list of failed tests.
-void PrettyUnitTestResultPrinter::PrintFailedTests(const UnitTest& unit_test) {
- const int failed_test_count = unit_test.failed_test_count();
- ColoredPrintf(GTestColor::kRed, "[ FAILED ] ");
- printf("%s, listed below:\n", FormatTestCount(failed_test_count).c_str());
-
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- const TestSuite& test_suite = *unit_test.GetTestSuite(i);
- if (!test_suite.should_run() || (test_suite.failed_test_count() == 0)) {
- continue;
- }
- for (int j = 0; j < test_suite.total_test_count(); ++j) {
- const TestInfo& test_info = *test_suite.GetTestInfo(j);
- if (!test_info.should_run() || !test_info.result()->Failed()) {
- continue;
- }
- ColoredPrintf(GTestColor::kRed, "[ FAILED ] ");
- printf("%s.%s", test_suite.name(), test_info.name());
- PrintFullTestCommentIfPresent(test_info);
- printf("\n");
- }
- }
- printf("\n%2d FAILED %s\n", failed_test_count,
- failed_test_count == 1 ? "TEST" : "TESTS");
-}
-
-// Internal helper for printing the list of test suite failures not covered by
-// PrintFailedTests.
-void PrettyUnitTestResultPrinter::PrintFailedTestSuites(
- const UnitTest& unit_test) {
- int suite_failure_count = 0;
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- const TestSuite& test_suite = *unit_test.GetTestSuite(i);
- if (!test_suite.should_run()) {
- continue;
- }
- if (test_suite.ad_hoc_test_result().Failed()) {
- ColoredPrintf(GTestColor::kRed, "[ FAILED ] ");
- printf("%s: SetUpTestSuite or TearDownTestSuite\n", test_suite.name());
- ++suite_failure_count;
- }
- }
- if (suite_failure_count > 0) {
- printf("\n%2d FAILED TEST %s\n", suite_failure_count,
- suite_failure_count == 1 ? "SUITE" : "SUITES");
- }
-}
-
-// Internal helper for printing the list of skipped tests.
-void PrettyUnitTestResultPrinter::PrintSkippedTests(const UnitTest& unit_test) {
- const int skipped_test_count = unit_test.skipped_test_count();
- if (skipped_test_count == 0) {
- return;
- }
-
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- const TestSuite& test_suite = *unit_test.GetTestSuite(i);
- if (!test_suite.should_run() || (test_suite.skipped_test_count() == 0)) {
- continue;
- }
- for (int j = 0; j < test_suite.total_test_count(); ++j) {
- const TestInfo& test_info = *test_suite.GetTestInfo(j);
- if (!test_info.should_run() || !test_info.result()->Skipped()) {
- continue;
- }
- ColoredPrintf(GTestColor::kGreen, "[ SKIPPED ] ");
- printf("%s.%s", test_suite.name(), test_info.name());
- printf("\n");
- }
- }
-}
-
-void PrettyUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- ColoredPrintf(GTestColor::kGreen, "[==========] ");
- printf("%s from %s ran.",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
- if (GTEST_FLAG_GET(print_time)) {
- printf(" (%s ms total)",
- internal::StreamableToString(unit_test.elapsed_time()).c_str());
- }
- printf("\n");
- ColoredPrintf(GTestColor::kGreen, "[ PASSED ] ");
- printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
-
- const int skipped_test_count = unit_test.skipped_test_count();
- if (skipped_test_count > 0) {
- ColoredPrintf(GTestColor::kGreen, "[ SKIPPED ] ");
- printf("%s, listed below:\n", FormatTestCount(skipped_test_count).c_str());
- PrintSkippedTests(unit_test);
- }
-
- if (!unit_test.Passed()) {
- PrintFailedTests(unit_test);
- PrintFailedTestSuites(unit_test);
- }
-
- int num_disabled = unit_test.reportable_disabled_test_count();
- if (num_disabled && !GTEST_FLAG_GET(also_run_disabled_tests)) {
- if (unit_test.Passed()) {
- printf("\n"); // Add a spacer if no FAILURE banner is displayed.
- }
- ColoredPrintf(GTestColor::kYellow, " YOU HAVE %d DISABLED %s\n\n",
- num_disabled, num_disabled == 1 ? "TEST" : "TESTS");
- }
- // Ensure that Google Test output is printed before, e.g., heapchecker output.
- fflush(stdout);
-}
-
-// End PrettyUnitTestResultPrinter
-
-// This class implements the TestEventListener interface.
-//
-// Class BriefUnitTestResultPrinter is copyable.
-class BriefUnitTestResultPrinter : public TestEventListener {
- public:
- BriefUnitTestResultPrinter() {}
- static void PrintTestName(const char* test_suite, const char* test) {
- printf("%s.%s", test_suite, test);
- }
-
- // The following methods override what's in the TestEventListener class.
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) override {}
- void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {}
- void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {}
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseStart(const TestCase& /*test_case*/) override {}
-#else
- void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {}
-#endif // OnTestCaseStart
-
- void OnTestStart(const TestInfo& /*test_info*/) override {}
- void OnTestDisabled(const TestInfo& /*test_info*/) override {}
-
- void OnTestPartResult(const TestPartResult& result) override;
- void OnTestEnd(const TestInfo& test_info) override;
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseEnd(const TestCase& /*test_case*/) override {}
-#else
- void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {}
- void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {}
- void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {}
-};
-
-// Called after an assertion failure.
-void BriefUnitTestResultPrinter::OnTestPartResult(
- const TestPartResult& result) {
- switch (result.type()) {
- // If the test part succeeded, we don't need to do anything.
- case TestPartResult::kSuccess:
- return;
- default:
- // Print failure message from the assertion
- // (e.g. expected this and got that).
- PrintTestPartResult(result);
- fflush(stdout);
- }
-}
-
-void BriefUnitTestResultPrinter::OnTestEnd(const TestInfo& test_info) {
- if (test_info.result()->Failed()) {
- ColoredPrintf(GTestColor::kRed, "[ FAILED ] ");
- PrintTestName(test_info.test_suite_name(), test_info.name());
- PrintFullTestCommentIfPresent(test_info);
-
- if (GTEST_FLAG_GET(print_time)) {
- printf(" (%s ms)\n",
- internal::StreamableToString(test_info.result()->elapsed_time())
- .c_str());
- } else {
- printf("\n");
- }
- fflush(stdout);
- }
-}
-
-void BriefUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- ColoredPrintf(GTestColor::kGreen, "[==========] ");
- printf("%s from %s ran.",
- FormatTestCount(unit_test.test_to_run_count()).c_str(),
- FormatTestSuiteCount(unit_test.test_suite_to_run_count()).c_str());
- if (GTEST_FLAG_GET(print_time)) {
- printf(" (%s ms total)",
- internal::StreamableToString(unit_test.elapsed_time()).c_str());
- }
- printf("\n");
- ColoredPrintf(GTestColor::kGreen, "[ PASSED ] ");
- printf("%s.\n", FormatTestCount(unit_test.successful_test_count()).c_str());
-
- const int skipped_test_count = unit_test.skipped_test_count();
- if (skipped_test_count > 0) {
- ColoredPrintf(GTestColor::kGreen, "[ SKIPPED ] ");
- printf("%s.\n", FormatTestCount(skipped_test_count).c_str());
- }
-
- int num_disabled = unit_test.reportable_disabled_test_count();
- if (num_disabled && !GTEST_FLAG_GET(also_run_disabled_tests)) {
- if (unit_test.Passed()) {
- printf("\n"); // Add a spacer if no FAILURE banner is displayed.
- }
- ColoredPrintf(GTestColor::kYellow, " YOU HAVE %d DISABLED %s\n\n",
- num_disabled, num_disabled == 1 ? "TEST" : "TESTS");
- }
- // Ensure that Google Test output is printed before, e.g., heapchecker output.
- fflush(stdout);
-}
-
-// End BriefUnitTestResultPrinter
-
-// class TestEventRepeater
-//
-// This class forwards events to other event listeners.
-class TestEventRepeater : public TestEventListener {
- public:
- TestEventRepeater() : forwarding_enabled_(true) {}
- ~TestEventRepeater() override;
- void Append(TestEventListener *listener);
- TestEventListener* Release(TestEventListener* listener);
-
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled() const { return forwarding_enabled_; }
- void set_forwarding_enabled(bool enable) { forwarding_enabled_ = enable; }
-
- void OnTestProgramStart(const UnitTest& unit_test) override;
- void OnTestIterationStart(const UnitTest& unit_test, int iteration) override;
- void OnEnvironmentsSetUpStart(const UnitTest& unit_test) override;
- void OnEnvironmentsSetUpEnd(const UnitTest& unit_test) override;
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseStart(const TestSuite& parameter) override;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestSuiteStart(const TestSuite& parameter) override;
- void OnTestStart(const TestInfo& test_info) override;
- void OnTestDisabled(const TestInfo& test_info) override;
- void OnTestPartResult(const TestPartResult& result) override;
- void OnTestEnd(const TestInfo& test_info) override;
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseEnd(const TestCase& parameter) override;
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestSuiteEnd(const TestSuite& parameter) override;
- void OnEnvironmentsTearDownStart(const UnitTest& unit_test) override;
- void OnEnvironmentsTearDownEnd(const UnitTest& unit_test) override;
- void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
- void OnTestProgramEnd(const UnitTest& unit_test) override;
-
- private:
- // Controls whether events will be forwarded to listeners_. Set to false
- // in death test child processes.
- bool forwarding_enabled_;
- // The list of listeners that receive events.
- std::vector<TestEventListener*> listeners_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestEventRepeater);
-};
-
-TestEventRepeater::~TestEventRepeater() {
- ForEach(listeners_, Delete<TestEventListener>);
-}
-
-void TestEventRepeater::Append(TestEventListener *listener) {
- listeners_.push_back(listener);
-}
-
-TestEventListener* TestEventRepeater::Release(TestEventListener *listener) {
- for (size_t i = 0; i < listeners_.size(); ++i) {
- if (listeners_[i] == listener) {
- listeners_.erase(listeners_.begin() + static_cast<int>(i));
- return listener;
- }
- }
-
- return nullptr;
-}
-
-// Since most methods are very similar, use macros to reduce boilerplate.
-// This defines a member that forwards the call to all listeners.
-#define GTEST_REPEATER_METHOD_(Name, Type) \
-void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (size_t i = 0; i < listeners_.size(); i++) { \
- listeners_[i]->Name(parameter); \
- } \
- } \
-}
-// This defines a member that forwards the call to all listeners in reverse
-// order.
-#define GTEST_REVERSE_REPEATER_METHOD_(Name, Type) \
- void TestEventRepeater::Name(const Type& parameter) { \
- if (forwarding_enabled_) { \
- for (size_t i = listeners_.size(); i != 0; i--) { \
- listeners_[i - 1]->Name(parameter); \
- } \
- } \
- }
-
-GTEST_REPEATER_METHOD_(OnTestProgramStart, UnitTest)
-GTEST_REPEATER_METHOD_(OnEnvironmentsSetUpStart, UnitTest)
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-GTEST_REPEATER_METHOD_(OnTestCaseStart, TestSuite)
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-GTEST_REPEATER_METHOD_(OnTestSuiteStart, TestSuite)
-GTEST_REPEATER_METHOD_(OnTestStart, TestInfo)
-GTEST_REPEATER_METHOD_(OnTestDisabled, TestInfo)
-GTEST_REPEATER_METHOD_(OnTestPartResult, TestPartResult)
-GTEST_REPEATER_METHOD_(OnEnvironmentsTearDownStart, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsSetUpEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnEnvironmentsTearDownEnd, UnitTest)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestEnd, TestInfo)
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-GTEST_REVERSE_REPEATER_METHOD_(OnTestCaseEnd, TestSuite)
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-GTEST_REVERSE_REPEATER_METHOD_(OnTestSuiteEnd, TestSuite)
-GTEST_REVERSE_REPEATER_METHOD_(OnTestProgramEnd, UnitTest)
-
-#undef GTEST_REPEATER_METHOD_
-#undef GTEST_REVERSE_REPEATER_METHOD_
-
-void TestEventRepeater::OnTestIterationStart(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (size_t i = 0; i < listeners_.size(); i++) {
- listeners_[i]->OnTestIterationStart(unit_test, iteration);
- }
- }
-}
-
-void TestEventRepeater::OnTestIterationEnd(const UnitTest& unit_test,
- int iteration) {
- if (forwarding_enabled_) {
- for (size_t i = listeners_.size(); i > 0; i--) {
- listeners_[i - 1]->OnTestIterationEnd(unit_test, iteration);
- }
- }
-}
-
-// End TestEventRepeater
-
-// This class generates an XML output file.
-class XmlUnitTestResultPrinter : public EmptyTestEventListener {
- public:
- explicit XmlUnitTestResultPrinter(const char* output_file);
-
- void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
- void ListTestsMatchingFilter(const std::vector<TestSuite*>& test_suites);
-
- // Prints an XML summary of all unit tests.
- static void PrintXmlTestsList(std::ostream* stream,
- const std::vector<TestSuite*>& test_suites);
-
- private:
- // Is c a whitespace character that is normalized to a space character
- // when it appears in an XML attribute value?
- static bool IsNormalizableWhitespace(unsigned char c) {
- return c == '\t' || c == '\n' || c == '\r';
- }
-
- // May c appear in a well-formed XML document?
- // https://www.w3.org/TR/REC-xml/#charsets
- static bool IsValidXmlCharacter(unsigned char c) {
- return IsNormalizableWhitespace(c) || c >= 0x20;
- }
-
- // Returns an XML-escaped copy of the input string str. If
- // is_attribute is true, the text is meant to appear as an attribute
- // value, and normalizable whitespace is preserved by replacing it
- // with character references.
- static std::string EscapeXml(const std::string& str, bool is_attribute);
-
- // Returns the given string with all characters invalid in XML removed.
- static std::string RemoveInvalidXmlCharacters(const std::string& str);
-
- // Convenience wrapper around EscapeXml when str is an attribute value.
- static std::string EscapeXmlAttribute(const std::string& str) {
- return EscapeXml(str, true);
- }
-
- // Convenience wrapper around EscapeXml when str is not an attribute value.
- static std::string EscapeXmlText(const char* str) {
- return EscapeXml(str, false);
- }
-
- // Verifies that the given attribute belongs to the given element and
- // streams the attribute as XML.
- static void OutputXmlAttribute(std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- const std::string& value);
-
- // Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
- static void OutputXmlCDataSection(::std::ostream* stream, const char* data);
-
- // Streams a test suite XML stanza containing the given test result.
- //
- // Requires: result.Failed()
- static void OutputXmlTestSuiteForTestResult(::std::ostream* stream,
- const TestResult& result);
-
- // Streams an XML representation of a TestResult object.
- static void OutputXmlTestResult(::std::ostream* stream,
- const TestResult& result);
-
- // Streams an XML representation of a TestInfo object.
- static void OutputXmlTestInfo(::std::ostream* stream,
- const char* test_suite_name,
- const TestInfo& test_info);
-
- // Prints an XML representation of a TestSuite object
- static void PrintXmlTestSuite(::std::ostream* stream,
- const TestSuite& test_suite);
-
- // Prints an XML summary of unit_test to output stream out.
- static void PrintXmlUnitTest(::std::ostream* stream,
- const UnitTest& unit_test);
-
- // Produces a string representing the test properties in a result as space
- // delimited XML attributes based on the property key="value" pairs.
- // When the std::string is not empty, it includes a space at the beginning,
- // to delimit this attribute from prior attributes.
- static std::string TestPropertiesAsXmlAttributes(const TestResult& result);
-
- // Streams an XML representation of the test properties of a TestResult
- // object.
- static void OutputXmlTestProperties(std::ostream* stream,
- const TestResult& result);
-
- // The output file.
- const std::string output_file_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(XmlUnitTestResultPrinter);
-};
-
-// Creates a new XmlUnitTestResultPrinter.
-XmlUnitTestResultPrinter::XmlUnitTestResultPrinter(const char* output_file)
- : output_file_(output_file) {
- if (output_file_.empty()) {
- GTEST_LOG_(FATAL) << "XML output file may not be null";
- }
-}
-
-// Called after the unit test ends.
-void XmlUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- FILE* xmlout = OpenFileForWriting(output_file_);
- std::stringstream stream;
- PrintXmlUnitTest(&stream, unit_test);
- fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
- fclose(xmlout);
-}
-
-void XmlUnitTestResultPrinter::ListTestsMatchingFilter(
- const std::vector<TestSuite*>& test_suites) {
- FILE* xmlout = OpenFileForWriting(output_file_);
- std::stringstream stream;
- PrintXmlTestsList(&stream, test_suites);
- fprintf(xmlout, "%s", StringStreamToString(&stream).c_str());
- fclose(xmlout);
-}
-
-// Returns an XML-escaped copy of the input string str. If is_attribute
-// is true, the text is meant to appear as an attribute value, and
-// normalizable whitespace is preserved by replacing it with character
-// references.
-//
-// Invalid XML characters in str, if any, are stripped from the output.
-// It is expected that most, if not all, of the text processed by this
-// module will consist of ordinary English text.
-// If this module is ever modified to produce version 1.1 XML output,
-// most invalid characters can be retained using character references.
-std::string XmlUnitTestResultPrinter::EscapeXml(
- const std::string& str, bool is_attribute) {
- Message m;
-
- for (size_t i = 0; i < str.size(); ++i) {
- const char ch = str[i];
- switch (ch) {
- case '<':
- m << "&lt;";
- break;
- case '>':
- m << "&gt;";
- break;
- case '&':
- m << "&amp;";
- break;
- case '\'':
- if (is_attribute)
- m << "&apos;";
- else
- m << '\'';
- break;
- case '"':
- if (is_attribute)
- m << "&quot;";
- else
- m << '"';
- break;
- default:
- if (IsValidXmlCharacter(static_cast<unsigned char>(ch))) {
- if (is_attribute &&
- IsNormalizableWhitespace(static_cast<unsigned char>(ch)))
- m << "&#x" << String::FormatByte(static_cast<unsigned char>(ch))
- << ";";
- else
- m << ch;
- }
- break;
- }
- }
-
- return m.GetString();
-}
-
-// Returns the given string with all characters invalid in XML removed.
-// Currently invalid characters are dropped from the string. An
-// alternative is to replace them with certain characters such as . or ?.
-std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters(
- const std::string& str) {
- std::string output;
- output.reserve(str.size());
- for (std::string::const_iterator it = str.begin(); it != str.end(); ++it)
- if (IsValidXmlCharacter(static_cast<unsigned char>(*it)))
- output.push_back(*it);
-
- return output;
-}
-
-// The following routines generate an XML representation of a UnitTest
-// object.
-//
-// This is how Google Test concepts map to the DTD:
-//
-// <testsuites name="AllTests"> <-- corresponds to a UnitTest object
-// <testsuite name="testcase-name"> <-- corresponds to a TestSuite object
-// <testcase name="test-name"> <-- corresponds to a TestInfo object
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <failure message="...">...</failure>
-// <-- individual assertion failures
-// </testcase>
-// </testsuite>
-// </testsuites>
-
-// Formats the given time in milliseconds as seconds.
-std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) {
- ::std::stringstream ss;
- ss << (static_cast<double>(ms) * 1e-3);
- return ss.str();
-}
-
-static bool PortableLocaltime(time_t seconds, struct tm* out) {
-#if defined(_MSC_VER)
- return localtime_s(out, &seconds) == 0;
-#elif defined(__MINGW32__) || defined(__MINGW64__)
- // MINGW <time.h> provides neither localtime_r nor localtime_s, but uses
- // Windows' localtime(), which has a thread-local tm buffer.
- struct tm* tm_ptr = localtime(&seconds); // NOLINT
- if (tm_ptr == nullptr) return false;
- *out = *tm_ptr;
- return true;
-#elif defined(__STDC_LIB_EXT1__)
- // Uses localtime_s when available as localtime_r is only available from
- // C23 standard.
- return localtime_s(&seconds, out) != nullptr;
-#else
- return localtime_r(&seconds, out) != nullptr;
-#endif
-}
-
-// Converts the given epoch time in milliseconds to a date string in the ISO
-// 8601 format, without the timezone information.
-std::string FormatEpochTimeInMillisAsIso8601(TimeInMillis ms) {
- struct tm time_struct;
- if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
- return "";
- // YYYY-MM-DDThh:mm:ss.sss
- return StreamableToString(time_struct.tm_year + 1900) + "-" +
- String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
- String::FormatIntWidth2(time_struct.tm_mday) + "T" +
- String::FormatIntWidth2(time_struct.tm_hour) + ":" +
- String::FormatIntWidth2(time_struct.tm_min) + ":" +
- String::FormatIntWidth2(time_struct.tm_sec) + "." +
- String::FormatIntWidthN(static_cast<int>(ms % 1000), 3);
-}
-
-// Streams an XML CDATA section, escaping invalid CDATA sequences as needed.
-void XmlUnitTestResultPrinter::OutputXmlCDataSection(::std::ostream* stream,
- const char* data) {
- const char* segment = data;
- *stream << "<![CDATA[";
- for (;;) {
- const char* const next_segment = strstr(segment, "]]>");
- if (next_segment != nullptr) {
- stream->write(
- segment, static_cast<std::streamsize>(next_segment - segment));
- *stream << "]]>]]&gt;<![CDATA[";
- segment = next_segment + strlen("]]>");
- } else {
- *stream << segment;
- break;
- }
- }
- *stream << "]]>";
-}
-
-void XmlUnitTestResultPrinter::OutputXmlAttribute(
- std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- const std::string& value) {
- const std::vector<std::string>& allowed_names =
- GetReservedOutputAttributesForElement(element_name);
-
- GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
- allowed_names.end())
- << "Attribute " << name << " is not allowed for element <" << element_name
- << ">.";
-
- *stream << " " << name << "=\"" << EscapeXmlAttribute(value) << "\"";
-}
-
-// Streams a test suite XML stanza containing the given test result.
-void XmlUnitTestResultPrinter::OutputXmlTestSuiteForTestResult(
- ::std::ostream* stream, const TestResult& result) {
- // Output the boilerplate for a minimal test suite with one test.
- *stream << " <testsuite";
- OutputXmlAttribute(stream, "testsuite", "name", "NonTestSuiteFailure");
- OutputXmlAttribute(stream, "testsuite", "tests", "1");
- OutputXmlAttribute(stream, "testsuite", "failures", "1");
- OutputXmlAttribute(stream, "testsuite", "disabled", "0");
- OutputXmlAttribute(stream, "testsuite", "skipped", "0");
- OutputXmlAttribute(stream, "testsuite", "errors", "0");
- OutputXmlAttribute(stream, "testsuite", "time",
- FormatTimeInMillisAsSeconds(result.elapsed_time()));
- OutputXmlAttribute(
- stream, "testsuite", "timestamp",
- FormatEpochTimeInMillisAsIso8601(result.start_timestamp()));
- *stream << ">";
-
- // Output the boilerplate for a minimal test case with a single test.
- *stream << " <testcase";
- OutputXmlAttribute(stream, "testcase", "name", "");
- OutputXmlAttribute(stream, "testcase", "status", "run");
- OutputXmlAttribute(stream, "testcase", "result", "completed");
- OutputXmlAttribute(stream, "testcase", "classname", "");
- OutputXmlAttribute(stream, "testcase", "time",
- FormatTimeInMillisAsSeconds(result.elapsed_time()));
- OutputXmlAttribute(
- stream, "testcase", "timestamp",
- FormatEpochTimeInMillisAsIso8601(result.start_timestamp()));
-
- // Output the actual test result.
- OutputXmlTestResult(stream, result);
-
- // Complete the test suite.
- *stream << " </testsuite>\n";
-}
-
-// Prints an XML representation of a TestInfo object.
-void XmlUnitTestResultPrinter::OutputXmlTestInfo(::std::ostream* stream,
- const char* test_suite_name,
- const TestInfo& test_info) {
- const TestResult& result = *test_info.result();
- const std::string kTestsuite = "testcase";
-
- if (test_info.is_in_another_shard()) {
- return;
- }
-
- *stream << " <testcase";
- OutputXmlAttribute(stream, kTestsuite, "name", test_info.name());
-
- if (test_info.value_param() != nullptr) {
- OutputXmlAttribute(stream, kTestsuite, "value_param",
- test_info.value_param());
- }
- if (test_info.type_param() != nullptr) {
- OutputXmlAttribute(stream, kTestsuite, "type_param",
- test_info.type_param());
- }
- if (GTEST_FLAG_GET(list_tests)) {
- OutputXmlAttribute(stream, kTestsuite, "file", test_info.file());
- OutputXmlAttribute(stream, kTestsuite, "line",
- StreamableToString(test_info.line()));
- *stream << " />\n";
- return;
- }
-
- OutputXmlAttribute(stream, kTestsuite, "status",
- test_info.should_run() ? "run" : "notrun");
- OutputXmlAttribute(stream, kTestsuite, "result",
- test_info.should_run()
- ? (result.Skipped() ? "skipped" : "completed")
- : "suppressed");
- OutputXmlAttribute(stream, kTestsuite, "time",
- FormatTimeInMillisAsSeconds(result.elapsed_time()));
- OutputXmlAttribute(
- stream, kTestsuite, "timestamp",
- FormatEpochTimeInMillisAsIso8601(result.start_timestamp()));
- OutputXmlAttribute(stream, kTestsuite, "classname", test_suite_name);
-
- OutputXmlTestResult(stream, result);
-}
-
-void XmlUnitTestResultPrinter::OutputXmlTestResult(::std::ostream* stream,
- const TestResult& result) {
- int failures = 0;
- int skips = 0;
- for (int i = 0; i < result.total_part_count(); ++i) {
- const TestPartResult& part = result.GetTestPartResult(i);
- if (part.failed()) {
- if (++failures == 1 && skips == 0) {
- *stream << ">\n";
- }
- const std::string location =
- internal::FormatCompilerIndependentFileLocation(part.file_name(),
- part.line_number());
- const std::string summary = location + "\n" + part.summary();
- *stream << " <failure message=\""
- << EscapeXmlAttribute(summary)
- << "\" type=\"\">";
- const std::string detail = location + "\n" + part.message();
- OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
- *stream << "</failure>\n";
- } else if (part.skipped()) {
- if (++skips == 1 && failures == 0) {
- *stream << ">\n";
- }
- const std::string location =
- internal::FormatCompilerIndependentFileLocation(part.file_name(),
- part.line_number());
- const std::string summary = location + "\n" + part.summary();
- *stream << " <skipped message=\""
- << EscapeXmlAttribute(summary.c_str()) << "\">";
- const std::string detail = location + "\n" + part.message();
- OutputXmlCDataSection(stream, RemoveInvalidXmlCharacters(detail).c_str());
- *stream << "</skipped>\n";
- }
- }
-
- if (failures == 0 && skips == 0 && result.test_property_count() == 0) {
- *stream << " />\n";
- } else {
- if (failures == 0 && skips == 0) {
- *stream << ">\n";
- }
- OutputXmlTestProperties(stream, result);
- *stream << " </testcase>\n";
- }
-}
-
-// Prints an XML representation of a TestSuite object
-void XmlUnitTestResultPrinter::PrintXmlTestSuite(std::ostream* stream,
- const TestSuite& test_suite) {
- const std::string kTestsuite = "testsuite";
- *stream << " <" << kTestsuite;
- OutputXmlAttribute(stream, kTestsuite, "name", test_suite.name());
- OutputXmlAttribute(stream, kTestsuite, "tests",
- StreamableToString(test_suite.reportable_test_count()));
- if (!GTEST_FLAG_GET(list_tests)) {
- OutputXmlAttribute(stream, kTestsuite, "failures",
- StreamableToString(test_suite.failed_test_count()));
- OutputXmlAttribute(
- stream, kTestsuite, "disabled",
- StreamableToString(test_suite.reportable_disabled_test_count()));
- OutputXmlAttribute(stream, kTestsuite, "skipped",
- StreamableToString(test_suite.skipped_test_count()));
-
- OutputXmlAttribute(stream, kTestsuite, "errors", "0");
-
- OutputXmlAttribute(stream, kTestsuite, "time",
- FormatTimeInMillisAsSeconds(test_suite.elapsed_time()));
- OutputXmlAttribute(
- stream, kTestsuite, "timestamp",
- FormatEpochTimeInMillisAsIso8601(test_suite.start_timestamp()));
- *stream << TestPropertiesAsXmlAttributes(test_suite.ad_hoc_test_result());
- }
- *stream << ">\n";
- for (int i = 0; i < test_suite.total_test_count(); ++i) {
- if (test_suite.GetTestInfo(i)->is_reportable())
- OutputXmlTestInfo(stream, test_suite.name(), *test_suite.GetTestInfo(i));
- }
- *stream << " </" << kTestsuite << ">\n";
-}
-
-// Prints an XML summary of unit_test to output stream out.
-void XmlUnitTestResultPrinter::PrintXmlUnitTest(std::ostream* stream,
- const UnitTest& unit_test) {
- const std::string kTestsuites = "testsuites";
-
- *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- *stream << "<" << kTestsuites;
-
- OutputXmlAttribute(stream, kTestsuites, "tests",
- StreamableToString(unit_test.reportable_test_count()));
- OutputXmlAttribute(stream, kTestsuites, "failures",
- StreamableToString(unit_test.failed_test_count()));
- OutputXmlAttribute(
- stream, kTestsuites, "disabled",
- StreamableToString(unit_test.reportable_disabled_test_count()));
- OutputXmlAttribute(stream, kTestsuites, "errors", "0");
- OutputXmlAttribute(stream, kTestsuites, "time",
- FormatTimeInMillisAsSeconds(unit_test.elapsed_time()));
- OutputXmlAttribute(
- stream, kTestsuites, "timestamp",
- FormatEpochTimeInMillisAsIso8601(unit_test.start_timestamp()));
-
- if (GTEST_FLAG_GET(shuffle)) {
- OutputXmlAttribute(stream, kTestsuites, "random_seed",
- StreamableToString(unit_test.random_seed()));
- }
- *stream << TestPropertiesAsXmlAttributes(unit_test.ad_hoc_test_result());
-
- OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
- *stream << ">\n";
-
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- if (unit_test.GetTestSuite(i)->reportable_test_count() > 0)
- PrintXmlTestSuite(stream, *unit_test.GetTestSuite(i));
- }
-
- // If there was a test failure outside of one of the test suites (like in a
- // test environment) include that in the output.
- if (unit_test.ad_hoc_test_result().Failed()) {
- OutputXmlTestSuiteForTestResult(stream, unit_test.ad_hoc_test_result());
- }
-
- *stream << "</" << kTestsuites << ">\n";
-}
-
-void XmlUnitTestResultPrinter::PrintXmlTestsList(
- std::ostream* stream, const std::vector<TestSuite*>& test_suites) {
- const std::string kTestsuites = "testsuites";
-
- *stream << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- *stream << "<" << kTestsuites;
-
- int total_tests = 0;
- for (auto test_suite : test_suites) {
- total_tests += test_suite->total_test_count();
- }
- OutputXmlAttribute(stream, kTestsuites, "tests",
- StreamableToString(total_tests));
- OutputXmlAttribute(stream, kTestsuites, "name", "AllTests");
- *stream << ">\n";
-
- for (auto test_suite : test_suites) {
- PrintXmlTestSuite(stream, *test_suite);
- }
- *stream << "</" << kTestsuites << ">\n";
-}
-
-// Produces a string representing the test properties in a result as space
-// delimited XML attributes based on the property key="value" pairs.
-std::string XmlUnitTestResultPrinter::TestPropertiesAsXmlAttributes(
- const TestResult& result) {
- Message attributes;
- for (int i = 0; i < result.test_property_count(); ++i) {
- const TestProperty& property = result.GetTestProperty(i);
- attributes << " " << property.key() << "="
- << "\"" << EscapeXmlAttribute(property.value()) << "\"";
- }
- return attributes.GetString();
-}
-
-void XmlUnitTestResultPrinter::OutputXmlTestProperties(
- std::ostream* stream, const TestResult& result) {
- const std::string kProperties = "properties";
- const std::string kProperty = "property";
-
- if (result.test_property_count() <= 0) {
- return;
- }
-
- *stream << " <" << kProperties << ">\n";
- for (int i = 0; i < result.test_property_count(); ++i) {
- const TestProperty& property = result.GetTestProperty(i);
- *stream << " <" << kProperty;
- *stream << " name=\"" << EscapeXmlAttribute(property.key()) << "\"";
- *stream << " value=\"" << EscapeXmlAttribute(property.value()) << "\"";
- *stream << "/>\n";
- }
- *stream << " </" << kProperties << ">\n";
-}
-
-// End XmlUnitTestResultPrinter
-
-// This class generates an JSON output file.
-class JsonUnitTestResultPrinter : public EmptyTestEventListener {
- public:
- explicit JsonUnitTestResultPrinter(const char* output_file);
-
- void OnTestIterationEnd(const UnitTest& unit_test, int iteration) override;
-
- // Prints an JSON summary of all unit tests.
- static void PrintJsonTestList(::std::ostream* stream,
- const std::vector<TestSuite*>& test_suites);
-
- private:
- // Returns an JSON-escaped copy of the input string str.
- static std::string EscapeJson(const std::string& str);
-
- //// Verifies that the given attribute belongs to the given element and
- //// streams the attribute as JSON.
- static void OutputJsonKey(std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- const std::string& value,
- const std::string& indent,
- bool comma = true);
- static void OutputJsonKey(std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- int value,
- const std::string& indent,
- bool comma = true);
-
- // Streams a test suite JSON stanza containing the given test result.
- //
- // Requires: result.Failed()
- static void OutputJsonTestSuiteForTestResult(::std::ostream* stream,
- const TestResult& result);
-
- // Streams a JSON representation of a TestResult object.
- static void OutputJsonTestResult(::std::ostream* stream,
- const TestResult& result);
-
- // Streams a JSON representation of a TestInfo object.
- static void OutputJsonTestInfo(::std::ostream* stream,
- const char* test_suite_name,
- const TestInfo& test_info);
-
- // Prints a JSON representation of a TestSuite object
- static void PrintJsonTestSuite(::std::ostream* stream,
- const TestSuite& test_suite);
-
- // Prints a JSON summary of unit_test to output stream out.
- static void PrintJsonUnitTest(::std::ostream* stream,
- const UnitTest& unit_test);
-
- // Produces a string representing the test properties in a result as
- // a JSON dictionary.
- static std::string TestPropertiesAsJson(const TestResult& result,
- const std::string& indent);
-
- // The output file.
- const std::string output_file_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(JsonUnitTestResultPrinter);
-};
-
-// Creates a new JsonUnitTestResultPrinter.
-JsonUnitTestResultPrinter::JsonUnitTestResultPrinter(const char* output_file)
- : output_file_(output_file) {
- if (output_file_.empty()) {
- GTEST_LOG_(FATAL) << "JSON output file may not be null";
- }
-}
-
-void JsonUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test,
- int /*iteration*/) {
- FILE* jsonout = OpenFileForWriting(output_file_);
- std::stringstream stream;
- PrintJsonUnitTest(&stream, unit_test);
- fprintf(jsonout, "%s", StringStreamToString(&stream).c_str());
- fclose(jsonout);
-}
-
-// Returns an JSON-escaped copy of the input string str.
-std::string JsonUnitTestResultPrinter::EscapeJson(const std::string& str) {
- Message m;
-
- for (size_t i = 0; i < str.size(); ++i) {
- const char ch = str[i];
- switch (ch) {
- case '\\':
- case '"':
- case '/':
- m << '\\' << ch;
- break;
- case '\b':
- m << "\\b";
- break;
- case '\t':
- m << "\\t";
- break;
- case '\n':
- m << "\\n";
- break;
- case '\f':
- m << "\\f";
- break;
- case '\r':
- m << "\\r";
- break;
- default:
- if (ch < ' ') {
- m << "\\u00" << String::FormatByte(static_cast<unsigned char>(ch));
- } else {
- m << ch;
- }
- break;
- }
- }
-
- return m.GetString();
-}
-
-// The following routines generate an JSON representation of a UnitTest
-// object.
-
-// Formats the given time in milliseconds as seconds.
-static std::string FormatTimeInMillisAsDuration(TimeInMillis ms) {
- ::std::stringstream ss;
- ss << (static_cast<double>(ms) * 1e-3) << "s";
- return ss.str();
-}
-
-// Converts the given epoch time in milliseconds to a date string in the
-// RFC3339 format, without the timezone information.
-static std::string FormatEpochTimeInMillisAsRFC3339(TimeInMillis ms) {
- struct tm time_struct;
- if (!PortableLocaltime(static_cast<time_t>(ms / 1000), &time_struct))
- return "";
- // YYYY-MM-DDThh:mm:ss
- return StreamableToString(time_struct.tm_year + 1900) + "-" +
- String::FormatIntWidth2(time_struct.tm_mon + 1) + "-" +
- String::FormatIntWidth2(time_struct.tm_mday) + "T" +
- String::FormatIntWidth2(time_struct.tm_hour) + ":" +
- String::FormatIntWidth2(time_struct.tm_min) + ":" +
- String::FormatIntWidth2(time_struct.tm_sec) + "Z";
-}
-
-static inline std::string Indent(size_t width) {
- return std::string(width, ' ');
-}
-
-void JsonUnitTestResultPrinter::OutputJsonKey(
- std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- const std::string& value,
- const std::string& indent,
- bool comma) {
- const std::vector<std::string>& allowed_names =
- GetReservedOutputAttributesForElement(element_name);
-
- GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
- allowed_names.end())
- << "Key \"" << name << "\" is not allowed for value \"" << element_name
- << "\".";
-
- *stream << indent << "\"" << name << "\": \"" << EscapeJson(value) << "\"";
- if (comma)
- *stream << ",\n";
-}
-
-void JsonUnitTestResultPrinter::OutputJsonKey(
- std::ostream* stream,
- const std::string& element_name,
- const std::string& name,
- int value,
- const std::string& indent,
- bool comma) {
- const std::vector<std::string>& allowed_names =
- GetReservedOutputAttributesForElement(element_name);
-
- GTEST_CHECK_(std::find(allowed_names.begin(), allowed_names.end(), name) !=
- allowed_names.end())
- << "Key \"" << name << "\" is not allowed for value \"" << element_name
- << "\".";
-
- *stream << indent << "\"" << name << "\": " << StreamableToString(value);
- if (comma)
- *stream << ",\n";
-}
-
-// Streams a test suite JSON stanza containing the given test result.
-void JsonUnitTestResultPrinter::OutputJsonTestSuiteForTestResult(
- ::std::ostream* stream, const TestResult& result) {
- // Output the boilerplate for a new test suite.
- *stream << Indent(4) << "{\n";
- OutputJsonKey(stream, "testsuite", "name", "NonTestSuiteFailure", Indent(6));
- OutputJsonKey(stream, "testsuite", "tests", 1, Indent(6));
- if (!GTEST_FLAG_GET(list_tests)) {
- OutputJsonKey(stream, "testsuite", "failures", 1, Indent(6));
- OutputJsonKey(stream, "testsuite", "disabled", 0, Indent(6));
- OutputJsonKey(stream, "testsuite", "skipped", 0, Indent(6));
- OutputJsonKey(stream, "testsuite", "errors", 0, Indent(6));
- OutputJsonKey(stream, "testsuite", "time",
- FormatTimeInMillisAsDuration(result.elapsed_time()),
- Indent(6));
- OutputJsonKey(stream, "testsuite", "timestamp",
- FormatEpochTimeInMillisAsRFC3339(result.start_timestamp()),
- Indent(6));
- }
- *stream << Indent(6) << "\"testsuite\": [\n";
-
- // Output the boilerplate for a new test case.
- *stream << Indent(8) << "{\n";
- OutputJsonKey(stream, "testcase", "name", "", Indent(10));
- OutputJsonKey(stream, "testcase", "status", "RUN", Indent(10));
- OutputJsonKey(stream, "testcase", "result", "COMPLETED", Indent(10));
- OutputJsonKey(stream, "testcase", "timestamp",
- FormatEpochTimeInMillisAsRFC3339(result.start_timestamp()),
- Indent(10));
- OutputJsonKey(stream, "testcase", "time",
- FormatTimeInMillisAsDuration(result.elapsed_time()),
- Indent(10));
- OutputJsonKey(stream, "testcase", "classname", "", Indent(10), false);
- *stream << TestPropertiesAsJson(result, Indent(10));
-
- // Output the actual test result.
- OutputJsonTestResult(stream, result);
-
- // Finish the test suite.
- *stream << "\n" << Indent(6) << "]\n" << Indent(4) << "}";
-}
-
-// Prints a JSON representation of a TestInfo object.
-void JsonUnitTestResultPrinter::OutputJsonTestInfo(::std::ostream* stream,
- const char* test_suite_name,
- const TestInfo& test_info) {
- const TestResult& result = *test_info.result();
- const std::string kTestsuite = "testcase";
- const std::string kIndent = Indent(10);
-
- *stream << Indent(8) << "{\n";
- OutputJsonKey(stream, kTestsuite, "name", test_info.name(), kIndent);
-
- if (test_info.value_param() != nullptr) {
- OutputJsonKey(stream, kTestsuite, "value_param", test_info.value_param(),
- kIndent);
- }
- if (test_info.type_param() != nullptr) {
- OutputJsonKey(stream, kTestsuite, "type_param", test_info.type_param(),
- kIndent);
- }
- if (GTEST_FLAG_GET(list_tests)) {
- OutputJsonKey(stream, kTestsuite, "file", test_info.file(), kIndent);
- OutputJsonKey(stream, kTestsuite, "line", test_info.line(), kIndent, false);
- *stream << "\n" << Indent(8) << "}";
- return;
- }
-
- OutputJsonKey(stream, kTestsuite, "status",
- test_info.should_run() ? "RUN" : "NOTRUN", kIndent);
- OutputJsonKey(stream, kTestsuite, "result",
- test_info.should_run()
- ? (result.Skipped() ? "SKIPPED" : "COMPLETED")
- : "SUPPRESSED",
- kIndent);
- OutputJsonKey(stream, kTestsuite, "timestamp",
- FormatEpochTimeInMillisAsRFC3339(result.start_timestamp()),
- kIndent);
- OutputJsonKey(stream, kTestsuite, "time",
- FormatTimeInMillisAsDuration(result.elapsed_time()), kIndent);
- OutputJsonKey(stream, kTestsuite, "classname", test_suite_name, kIndent,
- false);
- *stream << TestPropertiesAsJson(result, kIndent);
-
- OutputJsonTestResult(stream, result);
-}
-
-void JsonUnitTestResultPrinter::OutputJsonTestResult(::std::ostream* stream,
- const TestResult& result) {
- const std::string kIndent = Indent(10);
-
- int failures = 0;
- for (int i = 0; i < result.total_part_count(); ++i) {
- const TestPartResult& part = result.GetTestPartResult(i);
- if (part.failed()) {
- *stream << ",\n";
- if (++failures == 1) {
- *stream << kIndent << "\"" << "failures" << "\": [\n";
- }
- const std::string location =
- internal::FormatCompilerIndependentFileLocation(part.file_name(),
- part.line_number());
- const std::string message = EscapeJson(location + "\n" + part.message());
- *stream << kIndent << " {\n"
- << kIndent << " \"failure\": \"" << message << "\",\n"
- << kIndent << " \"type\": \"\"\n"
- << kIndent << " }";
- }
- }
-
- if (failures > 0)
- *stream << "\n" << kIndent << "]";
- *stream << "\n" << Indent(8) << "}";
-}
-
-// Prints an JSON representation of a TestSuite object
-void JsonUnitTestResultPrinter::PrintJsonTestSuite(
- std::ostream* stream, const TestSuite& test_suite) {
- const std::string kTestsuite = "testsuite";
- const std::string kIndent = Indent(6);
-
- *stream << Indent(4) << "{\n";
- OutputJsonKey(stream, kTestsuite, "name", test_suite.name(), kIndent);
- OutputJsonKey(stream, kTestsuite, "tests", test_suite.reportable_test_count(),
- kIndent);
- if (!GTEST_FLAG_GET(list_tests)) {
- OutputJsonKey(stream, kTestsuite, "failures",
- test_suite.failed_test_count(), kIndent);
- OutputJsonKey(stream, kTestsuite, "disabled",
- test_suite.reportable_disabled_test_count(), kIndent);
- OutputJsonKey(stream, kTestsuite, "errors", 0, kIndent);
- OutputJsonKey(
- stream, kTestsuite, "timestamp",
- FormatEpochTimeInMillisAsRFC3339(test_suite.start_timestamp()),
- kIndent);
- OutputJsonKey(stream, kTestsuite, "time",
- FormatTimeInMillisAsDuration(test_suite.elapsed_time()),
- kIndent, false);
- *stream << TestPropertiesAsJson(test_suite.ad_hoc_test_result(), kIndent)
- << ",\n";
- }
-
- *stream << kIndent << "\"" << kTestsuite << "\": [\n";
-
- bool comma = false;
- for (int i = 0; i < test_suite.total_test_count(); ++i) {
- if (test_suite.GetTestInfo(i)->is_reportable()) {
- if (comma) {
- *stream << ",\n";
- } else {
- comma = true;
- }
- OutputJsonTestInfo(stream, test_suite.name(), *test_suite.GetTestInfo(i));
- }
- }
- *stream << "\n" << kIndent << "]\n" << Indent(4) << "}";
-}
-
-// Prints a JSON summary of unit_test to output stream out.
-void JsonUnitTestResultPrinter::PrintJsonUnitTest(std::ostream* stream,
- const UnitTest& unit_test) {
- const std::string kTestsuites = "testsuites";
- const std::string kIndent = Indent(2);
- *stream << "{\n";
-
- OutputJsonKey(stream, kTestsuites, "tests", unit_test.reportable_test_count(),
- kIndent);
- OutputJsonKey(stream, kTestsuites, "failures", unit_test.failed_test_count(),
- kIndent);
- OutputJsonKey(stream, kTestsuites, "disabled",
- unit_test.reportable_disabled_test_count(), kIndent);
- OutputJsonKey(stream, kTestsuites, "errors", 0, kIndent);
- if (GTEST_FLAG_GET(shuffle)) {
- OutputJsonKey(stream, kTestsuites, "random_seed", unit_test.random_seed(),
- kIndent);
- }
- OutputJsonKey(stream, kTestsuites, "timestamp",
- FormatEpochTimeInMillisAsRFC3339(unit_test.start_timestamp()),
- kIndent);
- OutputJsonKey(stream, kTestsuites, "time",
- FormatTimeInMillisAsDuration(unit_test.elapsed_time()), kIndent,
- false);
-
- *stream << TestPropertiesAsJson(unit_test.ad_hoc_test_result(), kIndent)
- << ",\n";
-
- OutputJsonKey(stream, kTestsuites, "name", "AllTests", kIndent);
- *stream << kIndent << "\"" << kTestsuites << "\": [\n";
-
- bool comma = false;
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- if (unit_test.GetTestSuite(i)->reportable_test_count() > 0) {
- if (comma) {
- *stream << ",\n";
- } else {
- comma = true;
- }
- PrintJsonTestSuite(stream, *unit_test.GetTestSuite(i));
- }
- }
-
- // If there was a test failure outside of one of the test suites (like in a
- // test environment) include that in the output.
- if (unit_test.ad_hoc_test_result().Failed()) {
- OutputJsonTestSuiteForTestResult(stream, unit_test.ad_hoc_test_result());
- }
-
- *stream << "\n" << kIndent << "]\n" << "}\n";
-}
-
-void JsonUnitTestResultPrinter::PrintJsonTestList(
- std::ostream* stream, const std::vector<TestSuite*>& test_suites) {
- const std::string kTestsuites = "testsuites";
- const std::string kIndent = Indent(2);
- *stream << "{\n";
- int total_tests = 0;
- for (auto test_suite : test_suites) {
- total_tests += test_suite->total_test_count();
- }
- OutputJsonKey(stream, kTestsuites, "tests", total_tests, kIndent);
-
- OutputJsonKey(stream, kTestsuites, "name", "AllTests", kIndent);
- *stream << kIndent << "\"" << kTestsuites << "\": [\n";
-
- for (size_t i = 0; i < test_suites.size(); ++i) {
- if (i != 0) {
- *stream << ",\n";
- }
- PrintJsonTestSuite(stream, *test_suites[i]);
- }
-
- *stream << "\n"
- << kIndent << "]\n"
- << "}\n";
-}
-// Produces a string representing the test properties in a result as
-// a JSON dictionary.
-std::string JsonUnitTestResultPrinter::TestPropertiesAsJson(
- const TestResult& result, const std::string& indent) {
- Message attributes;
- for (int i = 0; i < result.test_property_count(); ++i) {
- const TestProperty& property = result.GetTestProperty(i);
- attributes << ",\n" << indent << "\"" << property.key() << "\": "
- << "\"" << EscapeJson(property.value()) << "\"";
- }
- return attributes.GetString();
-}
-
-// End JsonUnitTestResultPrinter
-
-#if GTEST_CAN_STREAM_RESULTS_
-
-// Checks if str contains '=', '&', '%' or '\n' characters. If yes,
-// replaces them by "%xx" where xx is their hexadecimal value. For
-// example, replaces "=" with "%3D". This algorithm is O(strlen(str))
-// in both time and space -- important as the input str may contain an
-// arbitrarily long test failure message and stack trace.
-std::string StreamingListener::UrlEncode(const char* str) {
- std::string result;
- result.reserve(strlen(str) + 1);
- for (char ch = *str; ch != '\0'; ch = *++str) {
- switch (ch) {
- case '%':
- case '=':
- case '&':
- case '\n':
- result.append("%" + String::FormatByte(static_cast<unsigned char>(ch)));
- break;
- default:
- result.push_back(ch);
- break;
- }
- }
- return result;
-}
-
-void StreamingListener::SocketWriter::MakeConnection() {
- GTEST_CHECK_(sockfd_ == -1)
- << "MakeConnection() can't be called when there is already a connection.";
-
- addrinfo hints;
- memset(&hints, 0, sizeof(hints));
- hints.ai_family = AF_UNSPEC; // To allow both IPv4 and IPv6 addresses.
- hints.ai_socktype = SOCK_STREAM;
- addrinfo* servinfo = nullptr;
-
- // Use the getaddrinfo() to get a linked list of IP addresses for
- // the given host name.
- const int error_num = getaddrinfo(
- host_name_.c_str(), port_num_.c_str(), &hints, &servinfo);
- if (error_num != 0) {
- GTEST_LOG_(WARNING) << "stream_result_to: getaddrinfo() failed: "
- << gai_strerror(error_num);
- }
-
- // Loop through all the results and connect to the first we can.
- for (addrinfo* cur_addr = servinfo; sockfd_ == -1 && cur_addr != nullptr;
- cur_addr = cur_addr->ai_next) {
- sockfd_ = socket(
- cur_addr->ai_family, cur_addr->ai_socktype, cur_addr->ai_protocol);
- if (sockfd_ != -1) {
- // Connect the client socket to the server socket.
- if (connect(sockfd_, cur_addr->ai_addr, cur_addr->ai_addrlen) == -1) {
- close(sockfd_);
- sockfd_ = -1;
- }
- }
- }
-
- freeaddrinfo(servinfo); // all done with this structure
-
- if (sockfd_ == -1) {
- GTEST_LOG_(WARNING) << "stream_result_to: failed to connect to "
- << host_name_ << ":" << port_num_;
- }
-}
-
-// End of class Streaming Listener
-#endif // GTEST_CAN_STREAM_RESULTS__
-
-// class OsStackTraceGetter
-
-const char* const OsStackTraceGetterInterface::kElidedFramesMarker =
- "... " GTEST_NAME_ " internal frames ...";
-
-std::string OsStackTraceGetter::CurrentStackTrace(int max_depth, int skip_count)
- GTEST_LOCK_EXCLUDED_(mutex_) {
-#if GTEST_HAS_ABSL
- std::string result;
-
- if (max_depth <= 0) {
- return result;
- }
-
- max_depth = std::min(max_depth, kMaxStackTraceDepth);
-
- std::vector<void*> raw_stack(max_depth);
- // Skips the frames requested by the caller, plus this function.
- const int raw_stack_size =
- absl::GetStackTrace(&raw_stack[0], max_depth, skip_count + 1);
-
- void* caller_frame = nullptr;
- {
- MutexLock lock(&mutex_);
- caller_frame = caller_frame_;
- }
-
- for (int i = 0; i < raw_stack_size; ++i) {
- if (raw_stack[i] == caller_frame &&
- !GTEST_FLAG_GET(show_internal_stack_frames)) {
- // Add a marker to the trace and stop adding frames.
- absl::StrAppend(&result, kElidedFramesMarker, "\n");
- break;
- }
-
- char tmp[1024];
- const char* symbol = "(unknown)";
- if (absl::Symbolize(raw_stack[i], tmp, sizeof(tmp))) {
- symbol = tmp;
- }
-
- char line[1024];
- snprintf(line, sizeof(line), " %p: %s\n", raw_stack[i], symbol);
- result += line;
- }
-
- return result;
-
-#else // !GTEST_HAS_ABSL
- static_cast<void>(max_depth);
- static_cast<void>(skip_count);
- return "";
-#endif // GTEST_HAS_ABSL
-}
-
-void OsStackTraceGetter::UponLeavingGTest() GTEST_LOCK_EXCLUDED_(mutex_) {
-#if GTEST_HAS_ABSL
- void* caller_frame = nullptr;
- if (absl::GetStackTrace(&caller_frame, 1, 3) <= 0) {
- caller_frame = nullptr;
- }
-
- MutexLock lock(&mutex_);
- caller_frame_ = caller_frame;
-#endif // GTEST_HAS_ABSL
-}
-
-// A helper class that creates the premature-exit file in its
-// constructor and deletes the file in its destructor.
-class ScopedPrematureExitFile {
- public:
- explicit ScopedPrematureExitFile(const char* premature_exit_filepath)
- : premature_exit_filepath_(premature_exit_filepath ?
- premature_exit_filepath : "") {
- // If a path to the premature-exit file is specified...
- if (!premature_exit_filepath_.empty()) {
- // create the file with a single "0" character in it. I/O
- // errors are ignored as there's nothing better we can do and we
- // don't want to fail the test because of this.
- FILE* pfile = posix::FOpen(premature_exit_filepath_.c_str(), "w");
- fwrite("0", 1, 1, pfile);
- fclose(pfile);
- }
- }
-
- ~ScopedPrematureExitFile() {
-#if !defined GTEST_OS_ESP8266
- if (!premature_exit_filepath_.empty()) {
- int retval = remove(premature_exit_filepath_.c_str());
- if (retval) {
- GTEST_LOG_(ERROR) << "Failed to remove premature exit filepath \""
- << premature_exit_filepath_ << "\" with error "
- << retval;
- }
- }
-#endif
- }
-
- private:
- const std::string premature_exit_filepath_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(ScopedPrematureExitFile);
-};
-
-} // namespace internal
-
-// class TestEventListeners
-
-TestEventListeners::TestEventListeners()
- : repeater_(new internal::TestEventRepeater()),
- default_result_printer_(nullptr),
- default_xml_generator_(nullptr) {}
-
-TestEventListeners::~TestEventListeners() { delete repeater_; }
-
-// Returns the standard listener responsible for the default console
-// output. Can be removed from the listeners list to shut down default
-// console output. Note that removing this object from the listener list
-// with Release transfers its ownership to the user.
-void TestEventListeners::Append(TestEventListener* listener) {
- repeater_->Append(listener);
-}
-
-// Removes the given event listener from the list and returns it. It then
-// becomes the caller's responsibility to delete the listener. Returns
-// NULL if the listener is not found in the list.
-TestEventListener* TestEventListeners::Release(TestEventListener* listener) {
- if (listener == default_result_printer_)
- default_result_printer_ = nullptr;
- else if (listener == default_xml_generator_)
- default_xml_generator_ = nullptr;
- return repeater_->Release(listener);
-}
-
-// Returns repeater that broadcasts the TestEventListener events to all
-// subscribers.
-TestEventListener* TestEventListeners::repeater() { return repeater_; }
-
-// Sets the default_result_printer attribute to the provided listener.
-// The listener is also added to the listener list and previous
-// default_result_printer is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) {
- if (default_result_printer_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_result_printer_);
- default_result_printer_ = listener;
- if (listener != nullptr) Append(listener);
- }
-}
-
-// Sets the default_xml_generator attribute to the provided listener. The
-// listener is also added to the listener list and previous
-// default_xml_generator is removed from it and deleted. The listener can
-// also be NULL in which case it will not be added to the list. Does
-// nothing if the previous and the current listener objects are the same.
-void TestEventListeners::SetDefaultXmlGenerator(TestEventListener* listener) {
- if (default_xml_generator_ != listener) {
- // It is an error to pass this method a listener that is already in the
- // list.
- delete Release(default_xml_generator_);
- default_xml_generator_ = listener;
- if (listener != nullptr) Append(listener);
- }
-}
-
-// Controls whether events will be forwarded by the repeater to the
-// listeners in the list.
-bool TestEventListeners::EventForwardingEnabled() const {
- return repeater_->forwarding_enabled();
-}
-
-void TestEventListeners::SuppressEventForwarding() {
- repeater_->set_forwarding_enabled(false);
-}
-
-// class UnitTest
-
-// Gets the singleton UnitTest object. The first time this method is
-// called, a UnitTest object is constructed and returned. Consecutive
-// calls will return the same object.
-//
-// We don't protect this under mutex_ as a user is not supposed to
-// call this before main() starts, from which point on the return
-// value will never change.
-UnitTest* UnitTest::GetInstance() {
- // CodeGear C++Builder insists on a public destructor for the
- // default implementation. Use this implementation to keep good OO
- // design with private destructor.
-
-#if defined(__BORLANDC__)
- static UnitTest* const instance = new UnitTest;
- return instance;
-#else
- static UnitTest instance;
- return &instance;
-#endif // defined(__BORLANDC__)
-}
-
-// Gets the number of successful test suites.
-int UnitTest::successful_test_suite_count() const {
- return impl()->successful_test_suite_count();
-}
-
-// Gets the number of failed test suites.
-int UnitTest::failed_test_suite_count() const {
- return impl()->failed_test_suite_count();
-}
-
-// Gets the number of all test suites.
-int UnitTest::total_test_suite_count() const {
- return impl()->total_test_suite_count();
-}
-
-// Gets the number of all test suites that contain at least one test
-// that should run.
-int UnitTest::test_suite_to_run_count() const {
- return impl()->test_suite_to_run_count();
-}
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-int UnitTest::successful_test_case_count() const {
- return impl()->successful_test_suite_count();
-}
-int UnitTest::failed_test_case_count() const {
- return impl()->failed_test_suite_count();
-}
-int UnitTest::total_test_case_count() const {
- return impl()->total_test_suite_count();
-}
-int UnitTest::test_case_to_run_count() const {
- return impl()->test_suite_to_run_count();
-}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-// Gets the number of successful tests.
-int UnitTest::successful_test_count() const {
- return impl()->successful_test_count();
-}
-
-// Gets the number of skipped tests.
-int UnitTest::skipped_test_count() const {
- return impl()->skipped_test_count();
-}
-
-// Gets the number of failed tests.
-int UnitTest::failed_test_count() const { return impl()->failed_test_count(); }
-
-// Gets the number of disabled tests that will be reported in the XML report.
-int UnitTest::reportable_disabled_test_count() const {
- return impl()->reportable_disabled_test_count();
-}
-
-// Gets the number of disabled tests.
-int UnitTest::disabled_test_count() const {
- return impl()->disabled_test_count();
-}
-
-// Gets the number of tests to be printed in the XML report.
-int UnitTest::reportable_test_count() const {
- return impl()->reportable_test_count();
-}
-
-// Gets the number of all tests.
-int UnitTest::total_test_count() const { return impl()->total_test_count(); }
-
-// Gets the number of tests that should run.
-int UnitTest::test_to_run_count() const { return impl()->test_to_run_count(); }
-
-// Gets the time of the test program start, in ms from the start of the
-// UNIX epoch.
-internal::TimeInMillis UnitTest::start_timestamp() const {
- return impl()->start_timestamp();
-}
-
-// Gets the elapsed time, in milliseconds.
-internal::TimeInMillis UnitTest::elapsed_time() const {
- return impl()->elapsed_time();
-}
-
-// Returns true if and only if the unit test passed (i.e. all test suites
-// passed).
-bool UnitTest::Passed() const { return impl()->Passed(); }
-
-// Returns true if and only if the unit test failed (i.e. some test suite
-// failed or something outside of all tests failed).
-bool UnitTest::Failed() const { return impl()->Failed(); }
-
-// Gets the i-th test suite among all the test suites. i can range from 0 to
-// total_test_suite_count() - 1. If i is not in that range, returns NULL.
-const TestSuite* UnitTest::GetTestSuite(int i) const {
- return impl()->GetTestSuite(i);
-}
-
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-const TestCase* UnitTest::GetTestCase(int i) const {
- return impl()->GetTestCase(i);
-}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-// Returns the TestResult containing information on test failures and
-// properties logged outside of individual test suites.
-const TestResult& UnitTest::ad_hoc_test_result() const {
- return *impl()->ad_hoc_test_result();
-}
-
-// Gets the i-th test suite among all the test suites. i can range from 0 to
-// total_test_suite_count() - 1. If i is not in that range, returns NULL.
-TestSuite* UnitTest::GetMutableTestSuite(int i) {
- return impl()->GetMutableSuiteCase(i);
-}
-
-// Returns the list of event listeners that can be used to track events
-// inside Google Test.
-TestEventListeners& UnitTest::listeners() {
- return *impl()->listeners();
-}
-
-// Registers and returns a global test environment. When a test
-// program is run, all global test environments will be set-up in the
-// order they were registered. After all tests in the program have
-// finished, all global test environments will be torn-down in the
-// *reverse* order they were registered.
-//
-// The UnitTest object takes ownership of the given environment.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-Environment* UnitTest::AddEnvironment(Environment* env) {
- if (env == nullptr) {
- return nullptr;
- }
-
- impl_->environments().push_back(env);
- return env;
-}
-
-// Adds a TestPartResult to the current TestResult object. All Google Test
-// assertion macros (e.g. ASSERT_TRUE, EXPECT_EQ, etc) eventually call
-// this to report their results. The user code should use the
-// assertion macros instead of calling this directly.
-void UnitTest::AddTestPartResult(
- TestPartResult::Type result_type,
- const char* file_name,
- int line_number,
- const std::string& message,
- const std::string& os_stack_trace) GTEST_LOCK_EXCLUDED_(mutex_) {
- Message msg;
- msg << message;
-
- internal::MutexLock lock(&mutex_);
- if (impl_->gtest_trace_stack().size() > 0) {
- msg << "\n" << GTEST_NAME_ << " trace:";
-
- for (size_t i = impl_->gtest_trace_stack().size(); i > 0; --i) {
- const internal::TraceInfo& trace = impl_->gtest_trace_stack()[i - 1];
- msg << "\n" << internal::FormatFileLocation(trace.file, trace.line)
- << " " << trace.message;
- }
- }
-
- if (os_stack_trace.c_str() != nullptr && !os_stack_trace.empty()) {
- msg << internal::kStackTraceMarker << os_stack_trace;
- }
-
- const TestPartResult result = TestPartResult(
- result_type, file_name, line_number, msg.GetString().c_str());
- impl_->GetTestPartResultReporterForCurrentThread()->
- ReportTestPartResult(result);
-
- if (result_type != TestPartResult::kSuccess &&
- result_type != TestPartResult::kSkip) {
- // gtest_break_on_failure takes precedence over
- // gtest_throw_on_failure. This allows a user to set the latter
- // in the code (perhaps in order to use Google Test assertions
- // with another testing framework) and specify the former on the
- // command line for debugging.
- if (GTEST_FLAG_GET(break_on_failure)) {
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
- // Using DebugBreak on Windows allows gtest to still break into a debugger
- // when a failure happens and both the --gtest_break_on_failure and
- // the --gtest_catch_exceptions flags are specified.
- DebugBreak();
-#elif (!defined(__native_client__)) && \
- ((defined(__clang__) || defined(__GNUC__)) && \
- (defined(__x86_64__) || defined(__i386__)))
- // with clang/gcc we can achieve the same effect on x86 by invoking int3
- asm("int3");
-#else
- // Dereference nullptr through a volatile pointer to prevent the compiler
- // from removing. We use this rather than abort() or __builtin_trap() for
- // portability: some debuggers don't correctly trap abort().
- *static_cast<volatile int*>(nullptr) = 1;
-#endif // GTEST_OS_WINDOWS
- } else if (GTEST_FLAG_GET(throw_on_failure)) {
-#if GTEST_HAS_EXCEPTIONS
- throw internal::GoogleTestFailureException(result);
-#else
- // We cannot call abort() as it generates a pop-up in debug mode
- // that cannot be suppressed in VC 7.1 or below.
- exit(1);
-#endif
- }
- }
-}
-
-// Adds a TestProperty to the current TestResult object when invoked from
-// inside a test, to current TestSuite's ad_hoc_test_result_ when invoked
-// from SetUpTestSuite or TearDownTestSuite, or to the global property set
-// when invoked elsewhere. If the result already contains a property with
-// the same key, the value will be updated.
-void UnitTest::RecordProperty(const std::string& key,
- const std::string& value) {
- impl_->RecordProperty(TestProperty(key, value));
-}
-
-// Runs all tests in this UnitTest object and prints the result.
-// Returns 0 if successful, or 1 otherwise.
-//
-// We don't protect this under mutex_, as we only support calling it
-// from the main thread.
-int UnitTest::Run() {
- const bool in_death_test_child_process =
- GTEST_FLAG_GET(internal_run_death_test).length() > 0;
-
- // Google Test implements this protocol for catching that a test
- // program exits before returning control to Google Test:
- //
- // 1. Upon start, Google Test creates a file whose absolute path
- // is specified by the environment variable
- // TEST_PREMATURE_EXIT_FILE.
- // 2. When Google Test has finished its work, it deletes the file.
- //
- // This allows a test runner to set TEST_PREMATURE_EXIT_FILE before
- // running a Google-Test-based test program and check the existence
- // of the file at the end of the test execution to see if it has
- // exited prematurely.
-
- // If we are in the child process of a death test, don't
- // create/delete the premature exit file, as doing so is unnecessary
- // and will confuse the parent process. Otherwise, create/delete
- // the file upon entering/leaving this function. If the program
- // somehow exits before this function has a chance to return, the
- // premature-exit file will be left undeleted, causing a test runner
- // that understands the premature-exit-file protocol to report the
- // test as having failed.
- const internal::ScopedPrematureExitFile premature_exit_file(
- in_death_test_child_process
- ? nullptr
- : internal::posix::GetEnv("TEST_PREMATURE_EXIT_FILE"));
-
- // Captures the value of GTEST_FLAG(catch_exceptions). This value will be
- // used for the duration of the program.
- impl()->set_catch_exceptions(GTEST_FLAG_GET(catch_exceptions));
-
-#if GTEST_OS_WINDOWS
- // Either the user wants Google Test to catch exceptions thrown by the
- // tests or this is executing in the context of death test child
- // process. In either case the user does not want to see pop-up dialogs
- // about crashes - they are expected.
- if (impl()->catch_exceptions() || in_death_test_child_process) {
-# if !GTEST_OS_WINDOWS_MOBILE && !GTEST_OS_WINDOWS_PHONE && !GTEST_OS_WINDOWS_RT
- // SetErrorMode doesn't exist on CE.
- SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOALIGNMENTFAULTEXCEPT |
- SEM_NOGPFAULTERRORBOX | SEM_NOOPENFILEERRORBOX);
-# endif // !GTEST_OS_WINDOWS_MOBILE
-
-# if (defined(_MSC_VER) || GTEST_OS_WINDOWS_MINGW) && !GTEST_OS_WINDOWS_MOBILE
- // Death test children can be terminated with _abort(). On Windows,
- // _abort() can show a dialog with a warning message. This forces the
- // abort message to go to stderr instead.
- _set_error_mode(_OUT_TO_STDERR);
-# endif
-
-# if defined(_MSC_VER) && !GTEST_OS_WINDOWS_MOBILE
- // In the debug version, Visual Studio pops up a separate dialog
- // offering a choice to debug the aborted program. We need to suppress
- // this dialog or it will pop up for every EXPECT/ASSERT_DEATH statement
- // executed. Google Test will notify the user of any unexpected
- // failure via stderr.
- if (!GTEST_FLAG_GET(break_on_failure))
- _set_abort_behavior(
- 0x0, // Clear the following flags:
- _WRITE_ABORT_MSG | _CALL_REPORTFAULT); // pop-up window, core dump.
-
- // In debug mode, the Windows CRT can crash with an assertion over invalid
- // input (e.g. passing an invalid file descriptor). The default handling
- // for these assertions is to pop up a dialog and wait for user input.
- // Instead ask the CRT to dump such assertions to stderr non-interactively.
- if (!IsDebuggerPresent()) {
- (void)_CrtSetReportMode(_CRT_ASSERT,
- _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- (void)_CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);
- }
-# endif
- }
-#endif // GTEST_OS_WINDOWS
-
- return internal::HandleExceptionsInMethodIfSupported(
- impl(),
- &internal::UnitTestImpl::RunAllTests,
- "auxiliary test code (environments or event listeners)") ? 0 : 1;
-}
-
-// Returns the working directory when the first TEST() or TEST_F() was
-// executed.
-const char* UnitTest::original_working_dir() const {
- return impl_->original_working_dir_.c_str();
-}
-
-// Returns the TestSuite object for the test that's currently running,
-// or NULL if no test is running.
-const TestSuite* UnitTest::current_test_suite() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_suite();
-}
-
-// Legacy API is still available but deprecated
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-const TestCase* UnitTest::current_test_case() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_suite();
-}
-#endif
-
-// Returns the TestInfo object for the test that's currently running,
-// or NULL if no test is running.
-const TestInfo* UnitTest::current_test_info() const
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- return impl_->current_test_info();
-}
-
-// Returns the random seed used at the start of the current test run.
-int UnitTest::random_seed() const { return impl_->random_seed(); }
-
-// Returns ParameterizedTestSuiteRegistry object used to keep track of
-// value-parameterized tests and instantiate and register them.
-internal::ParameterizedTestSuiteRegistry&
-UnitTest::parameterized_test_registry() GTEST_LOCK_EXCLUDED_(mutex_) {
- return impl_->parameterized_test_registry();
-}
-
-// Creates an empty UnitTest.
-UnitTest::UnitTest() {
- impl_ = new internal::UnitTestImpl(this);
-}
-
-// Destructor of UnitTest.
-UnitTest::~UnitTest() {
- delete impl_;
-}
-
-// Pushes a trace defined by SCOPED_TRACE() on to the per-thread
-// Google Test trace stack.
-void UnitTest::PushGTestTrace(const internal::TraceInfo& trace)
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().push_back(trace);
-}
-
-// Pops a trace from the per-thread Google Test trace stack.
-void UnitTest::PopGTestTrace()
- GTEST_LOCK_EXCLUDED_(mutex_) {
- internal::MutexLock lock(&mutex_);
- impl_->gtest_trace_stack().pop_back();
-}
-
-namespace internal {
-
-UnitTestImpl::UnitTestImpl(UnitTest* parent)
- : parent_(parent),
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4355 /* using this in initializer */)
- default_global_test_part_result_reporter_(this),
- default_per_thread_test_part_result_reporter_(this),
- GTEST_DISABLE_MSC_WARNINGS_POP_() global_test_part_result_repoter_(
- &default_global_test_part_result_reporter_),
- per_thread_test_part_result_reporter_(
- &default_per_thread_test_part_result_reporter_),
- parameterized_test_registry_(),
- parameterized_tests_registered_(false),
- last_death_test_suite_(-1),
- current_test_suite_(nullptr),
- current_test_info_(nullptr),
- ad_hoc_test_result_(),
- os_stack_trace_getter_(nullptr),
- post_flag_parse_init_performed_(false),
- random_seed_(0), // Will be overridden by the flag before first use.
- random_(0), // Will be reseeded before first use.
- start_timestamp_(0),
- elapsed_time_(0),
-#if GTEST_HAS_DEATH_TEST
- death_test_factory_(new DefaultDeathTestFactory),
-#endif
- // Will be overridden by the flag before first use.
- catch_exceptions_(false) {
- listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter);
-}
-
-UnitTestImpl::~UnitTestImpl() {
- // Deletes every TestSuite.
- ForEach(test_suites_, internal::Delete<TestSuite>);
-
- // Deletes every Environment.
- ForEach(environments_, internal::Delete<Environment>);
-
- delete os_stack_trace_getter_;
-}
-
-// Adds a TestProperty to the current TestResult object when invoked in a
-// context of a test, to current test suite's ad_hoc_test_result when invoke
-// from SetUpTestSuite/TearDownTestSuite, or to the global property set
-// otherwise. If the result already contains a property with the same key,
-// the value will be updated.
-void UnitTestImpl::RecordProperty(const TestProperty& test_property) {
- std::string xml_element;
- TestResult* test_result; // TestResult appropriate for property recording.
-
- if (current_test_info_ != nullptr) {
- xml_element = "testcase";
- test_result = &(current_test_info_->result_);
- } else if (current_test_suite_ != nullptr) {
- xml_element = "testsuite";
- test_result = &(current_test_suite_->ad_hoc_test_result_);
- } else {
- xml_element = "testsuites";
- test_result = &ad_hoc_test_result_;
- }
- test_result->RecordProperty(xml_element, test_property);
-}
-
-#if GTEST_HAS_DEATH_TEST
-// Disables event forwarding if the control is currently in a death test
-// subprocess. Must not be called before InitGoogleTest.
-void UnitTestImpl::SuppressTestEventsIfInSubprocess() {
- if (internal_run_death_test_flag_.get() != nullptr)
- listeners()->SuppressEventForwarding();
-}
-#endif // GTEST_HAS_DEATH_TEST
-
-// Initializes event listeners performing XML output as specified by
-// UnitTestOptions. Must not be called before InitGoogleTest.
-void UnitTestImpl::ConfigureXmlOutput() {
- const std::string& output_format = UnitTestOptions::GetOutputFormat();
- if (output_format == "xml") {
- listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
- } else if (output_format == "json") {
- listeners()->SetDefaultXmlGenerator(new JsonUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str()));
- } else if (output_format != "") {
- GTEST_LOG_(WARNING) << "WARNING: unrecognized output format \""
- << output_format << "\" ignored.";
- }
-}
-
-#if GTEST_CAN_STREAM_RESULTS_
-// Initializes event listeners for streaming test results in string form.
-// Must not be called before InitGoogleTest.
-void UnitTestImpl::ConfigureStreamingOutput() {
- const std::string& target = GTEST_FLAG_GET(stream_result_to);
- if (!target.empty()) {
- const size_t pos = target.find(':');
- if (pos != std::string::npos) {
- listeners()->Append(new StreamingListener(target.substr(0, pos),
- target.substr(pos+1)));
- } else {
- GTEST_LOG_(WARNING) << "unrecognized streaming target \"" << target
- << "\" ignored.";
- }
- }
-}
-#endif // GTEST_CAN_STREAM_RESULTS_
-
-// Performs initialization dependent upon flag values obtained in
-// ParseGoogleTestFlagsOnly. Is called from InitGoogleTest after the call to
-// ParseGoogleTestFlagsOnly. In case a user neglects to call InitGoogleTest
-// this function is also called from RunAllTests. Since this function can be
-// called more than once, it has to be idempotent.
-void UnitTestImpl::PostFlagParsingInit() {
- // Ensures that this function does not execute more than once.
- if (!post_flag_parse_init_performed_) {
- post_flag_parse_init_performed_ = true;
-
-#if defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
- // Register to send notifications about key process state changes.
- listeners()->Append(new GTEST_CUSTOM_TEST_EVENT_LISTENER_());
-#endif // defined(GTEST_CUSTOM_TEST_EVENT_LISTENER_)
-
-#if GTEST_HAS_DEATH_TEST
- InitDeathTestSubprocessControlInfo();
- SuppressTestEventsIfInSubprocess();
-#endif // GTEST_HAS_DEATH_TEST
-
- // Registers parameterized tests. This makes parameterized tests
- // available to the UnitTest reflection API without running
- // RUN_ALL_TESTS.
- RegisterParameterizedTests();
-
- // Configures listeners for XML output. This makes it possible for users
- // to shut down the default XML output before invoking RUN_ALL_TESTS.
- ConfigureXmlOutput();
-
- if (GTEST_FLAG_GET(brief)) {
- listeners()->SetDefaultResultPrinter(new BriefUnitTestResultPrinter);
- }
-
-#if GTEST_CAN_STREAM_RESULTS_
- // Configures listeners for streaming test results to the specified server.
- ConfigureStreamingOutput();
-#endif // GTEST_CAN_STREAM_RESULTS_
-
-#if GTEST_HAS_ABSL
- if (GTEST_FLAG_GET(install_failure_signal_handler)) {
- absl::FailureSignalHandlerOptions options;
- absl::InstallFailureSignalHandler(options);
- }
-#endif // GTEST_HAS_ABSL
- }
-}
-
-// A predicate that checks the name of a TestSuite against a known
-// value.
-//
-// This is used for implementation of the UnitTest class only. We put
-// it in the anonymous namespace to prevent polluting the outer
-// namespace.
-//
-// TestSuiteNameIs is copyable.
-class TestSuiteNameIs {
- public:
- // Constructor.
- explicit TestSuiteNameIs(const std::string& name) : name_(name) {}
-
- // Returns true if and only if the name of test_suite matches name_.
- bool operator()(const TestSuite* test_suite) const {
- return test_suite != nullptr &&
- strcmp(test_suite->name(), name_.c_str()) == 0;
- }
-
- private:
- std::string name_;
-};
-
-// Finds and returns a TestSuite with the given name. If one doesn't
-// exist, creates one and returns it. It's the CALLER'S
-// RESPONSIBILITY to ensure that this function is only called WHEN THE
-// TESTS ARE NOT SHUFFLED.
-//
-// Arguments:
-//
-// test_suite_name: name of the test suite
-// type_param: the name of the test suite's type parameter, or NULL if
-// this is not a typed or a type-parameterized test suite.
-// set_up_tc: pointer to the function that sets up the test suite
-// tear_down_tc: pointer to the function that tears down the test suite
-TestSuite* UnitTestImpl::GetTestSuite(
- const char* test_suite_name, const char* type_param,
- internal::SetUpTestSuiteFunc set_up_tc,
- internal::TearDownTestSuiteFunc tear_down_tc) {
- // Can we find a TestSuite with the given name?
- const auto test_suite =
- std::find_if(test_suites_.rbegin(), test_suites_.rend(),
- TestSuiteNameIs(test_suite_name));
-
- if (test_suite != test_suites_.rend()) return *test_suite;
-
- // No. Let's create one.
- auto* const new_test_suite =
- new TestSuite(test_suite_name, type_param, set_up_tc, tear_down_tc);
-
- const UnitTestFilter death_test_suite_filter(kDeathTestSuiteFilter);
- // Is this a death test suite?
- if (death_test_suite_filter.MatchesName(test_suite_name)) {
- // Yes. Inserts the test suite after the last death test suite
- // defined so far. This only works when the test suites haven't
- // been shuffled. Otherwise we may end up running a death test
- // after a non-death test.
- ++last_death_test_suite_;
- test_suites_.insert(test_suites_.begin() + last_death_test_suite_,
- new_test_suite);
- } else {
- // No. Appends to the end of the list.
- test_suites_.push_back(new_test_suite);
- }
-
- test_suite_indices_.push_back(static_cast<int>(test_suite_indices_.size()));
- return new_test_suite;
-}
-
-// Helpers for setting up / tearing down the given environment. They
-// are for use in the ForEach() function.
-static void SetUpEnvironment(Environment* env) { env->SetUp(); }
-static void TearDownEnvironment(Environment* env) { env->TearDown(); }
-
-// Runs all tests in this UnitTest object, prints the result, and
-// returns true if all tests are successful. If any exception is
-// thrown during a test, the test is considered to be failed, but the
-// rest of the tests will still be run.
-//
-// When parameterized tests are enabled, it expands and registers
-// parameterized tests first in RegisterParameterizedTests().
-// All other functions called from RunAllTests() may safely assume that
-// parameterized tests are ready to be counted and run.
-bool UnitTestImpl::RunAllTests() {
- // True if and only if Google Test is initialized before RUN_ALL_TESTS() is
- // called.
- const bool gtest_is_initialized_before_run_all_tests = GTestIsInitialized();
-
- // Do not run any test if the --help flag was specified.
- if (g_help_flag)
- return true;
-
- // Repeats the call to the post-flag parsing initialization in case the
- // user didn't call InitGoogleTest.
- PostFlagParsingInit();
-
- // Even if sharding is not on, test runners may want to use the
- // GTEST_SHARD_STATUS_FILE to query whether the test supports the sharding
- // protocol.
- internal::WriteToShardStatusFileIfNeeded();
-
- // True if and only if we are in a subprocess for running a thread-safe-style
- // death test.
- bool in_subprocess_for_death_test = false;
-
-#if GTEST_HAS_DEATH_TEST
- in_subprocess_for_death_test =
- (internal_run_death_test_flag_.get() != nullptr);
-# if defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
- if (in_subprocess_for_death_test) {
- GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_();
- }
-# endif // defined(GTEST_EXTRA_DEATH_TEST_CHILD_SETUP_)
-#endif // GTEST_HAS_DEATH_TEST
-
- const bool should_shard = ShouldShard(kTestTotalShards, kTestShardIndex,
- in_subprocess_for_death_test);
-
- // Compares the full test names with the filter to decide which
- // tests to run.
- const bool has_tests_to_run = FilterTests(should_shard
- ? HONOR_SHARDING_PROTOCOL
- : IGNORE_SHARDING_PROTOCOL) > 0;
-
- // Lists the tests and exits if the --gtest_list_tests flag was specified.
- if (GTEST_FLAG_GET(list_tests)) {
- // This must be called *after* FilterTests() has been called.
- ListTestsMatchingFilter();
- return true;
- }
-
- random_seed_ = GetRandomSeedFromFlag(GTEST_FLAG_GET(random_seed));
-
- // True if and only if at least one test has failed.
- bool failed = false;
-
- TestEventListener* repeater = listeners()->repeater();
-
- start_timestamp_ = GetTimeInMillis();
- repeater->OnTestProgramStart(*parent_);
-
- // How many times to repeat the tests? We don't want to repeat them
- // when we are inside the subprocess of a death test.
- const int repeat = in_subprocess_for_death_test ? 1 : GTEST_FLAG_GET(repeat);
-
- // Repeats forever if the repeat count is negative.
- const bool gtest_repeat_forever = repeat < 0;
-
- // Should test environments be set up and torn down for each repeat, or only
- // set up on the first and torn down on the last iteration? If there is no
- // "last" iteration because the tests will repeat forever, always recreate the
- // environments to avoid leaks in case one of the environments is using
- // resources that are external to this process. Without this check there would
- // be no way to clean up those external resources automatically.
- const bool recreate_environments_when_repeating =
- GTEST_FLAG_GET(recreate_environments_when_repeating) ||
- gtest_repeat_forever;
-
- for (int i = 0; gtest_repeat_forever || i != repeat; i++) {
- // We want to preserve failures generated by ad-hoc test
- // assertions executed before RUN_ALL_TESTS().
- ClearNonAdHocTestResult();
-
- Timer timer;
-
- // Shuffles test suites and tests if requested.
- if (has_tests_to_run && GTEST_FLAG_GET(shuffle)) {
- random()->Reseed(static_cast<uint32_t>(random_seed_));
- // This should be done before calling OnTestIterationStart(),
- // such that a test event listener can see the actual test order
- // in the event.
- ShuffleTests();
- }
-
- // Tells the unit test event listeners that the tests are about to start.
- repeater->OnTestIterationStart(*parent_, i);
-
- // Runs each test suite if there is at least one test to run.
- if (has_tests_to_run) {
- // Sets up all environments beforehand. If test environments aren't
- // recreated for each iteration, only do so on the first iteration.
- if (i == 0 || recreate_environments_when_repeating) {
- repeater->OnEnvironmentsSetUpStart(*parent_);
- ForEach(environments_, SetUpEnvironment);
- repeater->OnEnvironmentsSetUpEnd(*parent_);
- }
-
- // Runs the tests only if there was no fatal failure or skip triggered
- // during global set-up.
- if (Test::IsSkipped()) {
- // Emit diagnostics when global set-up calls skip, as it will not be
- // emitted by default.
- TestResult& test_result =
- *internal::GetUnitTestImpl()->current_test_result();
- for (int j = 0; j < test_result.total_part_count(); ++j) {
- const TestPartResult& test_part_result =
- test_result.GetTestPartResult(j);
- if (test_part_result.type() == TestPartResult::kSkip) {
- const std::string& result = test_part_result.message();
- printf("%s\n", result.c_str());
- }
- }
- fflush(stdout);
- } else if (!Test::HasFatalFailure()) {
- for (int test_index = 0; test_index < total_test_suite_count();
- test_index++) {
- GetMutableSuiteCase(test_index)->Run();
- if (GTEST_FLAG_GET(fail_fast) &&
- GetMutableSuiteCase(test_index)->Failed()) {
- for (int j = test_index + 1; j < total_test_suite_count(); j++) {
- GetMutableSuiteCase(j)->Skip();
- }
- break;
- }
- }
- } else if (Test::HasFatalFailure()) {
- // If there was a fatal failure during the global setup then we know we
- // aren't going to run any tests. Explicitly mark all of the tests as
- // skipped to make this obvious in the output.
- for (int test_index = 0; test_index < total_test_suite_count();
- test_index++) {
- GetMutableSuiteCase(test_index)->Skip();
- }
- }
-
- // Tears down all environments in reverse order afterwards. If test
- // environments aren't recreated for each iteration, only do so on the
- // last iteration.
- if (i == repeat - 1 || recreate_environments_when_repeating) {
- repeater->OnEnvironmentsTearDownStart(*parent_);
- std::for_each(environments_.rbegin(), environments_.rend(),
- TearDownEnvironment);
- repeater->OnEnvironmentsTearDownEnd(*parent_);
- }
- }
-
- elapsed_time_ = timer.Elapsed();
-
- // Tells the unit test event listener that the tests have just finished.
- repeater->OnTestIterationEnd(*parent_, i);
-
- // Gets the result and clears it.
- if (!Passed()) {
- failed = true;
- }
-
- // Restores the original test order after the iteration. This
- // allows the user to quickly repro a failure that happens in the
- // N-th iteration without repeating the first (N - 1) iterations.
- // This is not enclosed in "if (GTEST_FLAG(shuffle)) { ... }", in
- // case the user somehow changes the value of the flag somewhere
- // (it's always safe to unshuffle the tests).
- UnshuffleTests();
-
- if (GTEST_FLAG_GET(shuffle)) {
- // Picks a new random seed for each iteration.
- random_seed_ = GetNextRandomSeed(random_seed_);
- }
- }
-
- repeater->OnTestProgramEnd(*parent_);
-
- if (!gtest_is_initialized_before_run_all_tests) {
- ColoredPrintf(
- GTestColor::kRed,
- "\nIMPORTANT NOTICE - DO NOT IGNORE:\n"
- "This test program did NOT call " GTEST_INIT_GOOGLE_TEST_NAME_
- "() before calling RUN_ALL_TESTS(). This is INVALID. Soon " GTEST_NAME_
- " will start to enforce the valid usage. "
- "Please fix it ASAP, or IT WILL START TO FAIL.\n"); // NOLINT
-#if GTEST_FOR_GOOGLE_
- ColoredPrintf(GTestColor::kRed,
- "For more details, see http://wiki/Main/ValidGUnitMain.\n");
-#endif // GTEST_FOR_GOOGLE_
- }
-
- return !failed;
-}
-
-// Reads the GTEST_SHARD_STATUS_FILE environment variable, and creates the file
-// if the variable is present. If a file already exists at this location, this
-// function will write over it. If the variable is present, but the file cannot
-// be created, prints an error and exits.
-void WriteToShardStatusFileIfNeeded() {
- const char* const test_shard_file = posix::GetEnv(kTestShardStatusFile);
- if (test_shard_file != nullptr) {
- FILE* const file = posix::FOpen(test_shard_file, "w");
- if (file == nullptr) {
- ColoredPrintf(GTestColor::kRed,
- "Could not write to the test shard status file \"%s\" "
- "specified by the %s environment variable.\n",
- test_shard_file, kTestShardStatusFile);
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
- fclose(file);
- }
-}
-
-// Checks whether sharding is enabled by examining the relevant
-// environment variable values. If the variables are present,
-// but inconsistent (i.e., shard_index >= total_shards), prints
-// an error and exits. If in_subprocess_for_death_test, sharding is
-// disabled because it must only be applied to the original test
-// process. Otherwise, we could filter out death tests we intended to execute.
-bool ShouldShard(const char* total_shards_env,
- const char* shard_index_env,
- bool in_subprocess_for_death_test) {
- if (in_subprocess_for_death_test) {
- return false;
- }
-
- const int32_t total_shards = Int32FromEnvOrDie(total_shards_env, -1);
- const int32_t shard_index = Int32FromEnvOrDie(shard_index_env, -1);
-
- if (total_shards == -1 && shard_index == -1) {
- return false;
- } else if (total_shards == -1 && shard_index != -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestShardIndex << " = " << shard_index
- << ", but have left " << kTestTotalShards << " unset.\n";
- ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (total_shards != -1 && shard_index == -1) {
- const Message msg = Message()
- << "Invalid environment variables: you have "
- << kTestTotalShards << " = " << total_shards
- << ", but have left " << kTestShardIndex << " unset.\n";
- ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- } else if (shard_index < 0 || shard_index >= total_shards) {
- const Message msg = Message()
- << "Invalid environment variables: we require 0 <= "
- << kTestShardIndex << " < " << kTestTotalShards
- << ", but you have " << kTestShardIndex << "=" << shard_index
- << ", " << kTestTotalShards << "=" << total_shards << ".\n";
- ColoredPrintf(GTestColor::kRed, "%s", msg.GetString().c_str());
- fflush(stdout);
- exit(EXIT_FAILURE);
- }
-
- return total_shards > 1;
-}
-
-// Parses the environment variable var as an Int32. If it is unset,
-// returns default_val. If it is not an Int32, prints an error
-// and aborts.
-int32_t Int32FromEnvOrDie(const char* var, int32_t default_val) {
- const char* str_val = posix::GetEnv(var);
- if (str_val == nullptr) {
- return default_val;
- }
-
- int32_t result;
- if (!ParseInt32(Message() << "The value of environment variable " << var,
- str_val, &result)) {
- exit(EXIT_FAILURE);
- }
- return result;
-}
-
-// Given the total number of shards, the shard index, and the test id,
-// returns true if and only if the test should be run on this shard. The test id
-// is some arbitrary but unique non-negative integer assigned to each test
-// method. Assumes that 0 <= shard_index < total_shards.
-bool ShouldRunTestOnShard(int total_shards, int shard_index, int test_id) {
- return (test_id % total_shards) == shard_index;
-}
-
-// Compares the name of each test with the user-specified filter to
-// decide whether the test should be run, then records the result in
-// each TestSuite and TestInfo object.
-// If shard_tests == true, further filters tests based on sharding
-// variables in the environment - see
-// https://github.com/google/googletest/blob/master/googletest/docs/advanced.md
-// . Returns the number of tests that should run.
-int UnitTestImpl::FilterTests(ReactionToSharding shard_tests) {
- const int32_t total_shards = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestTotalShards, -1) : -1;
- const int32_t shard_index = shard_tests == HONOR_SHARDING_PROTOCOL ?
- Int32FromEnvOrDie(kTestShardIndex, -1) : -1;
-
- const PositiveAndNegativeUnitTestFilter gtest_flag_filter(
- GTEST_FLAG_GET(filter));
- const UnitTestFilter disable_test_filter(kDisableTestFilter);
- // num_runnable_tests are the number of tests that will
- // run across all shards (i.e., match filter and are not disabled).
- // num_selected_tests are the number of tests to be run on
- // this shard.
- int num_runnable_tests = 0;
- int num_selected_tests = 0;
- for (auto* test_suite : test_suites_) {
- const std::string& test_suite_name = test_suite->name();
- test_suite->set_should_run(false);
-
- for (size_t j = 0; j < test_suite->test_info_list().size(); j++) {
- TestInfo* const test_info = test_suite->test_info_list()[j];
- const std::string test_name(test_info->name());
- // A test is disabled if test suite name or test name matches
- // kDisableTestFilter.
- const bool is_disabled =
- disable_test_filter.MatchesName(test_suite_name) ||
- disable_test_filter.MatchesName(test_name);
- test_info->is_disabled_ = is_disabled;
-
- const bool matches_filter =
- gtest_flag_filter.MatchesTest(test_suite_name, test_name);
- test_info->matches_filter_ = matches_filter;
-
- const bool is_runnable =
- (GTEST_FLAG_GET(also_run_disabled_tests) || !is_disabled) &&
- matches_filter;
-
- const bool is_in_another_shard =
- shard_tests != IGNORE_SHARDING_PROTOCOL &&
- !ShouldRunTestOnShard(total_shards, shard_index, num_runnable_tests);
- test_info->is_in_another_shard_ = is_in_another_shard;
- const bool is_selected = is_runnable && !is_in_another_shard;
-
- num_runnable_tests += is_runnable;
- num_selected_tests += is_selected;
-
- test_info->should_run_ = is_selected;
- test_suite->set_should_run(test_suite->should_run() || is_selected);
- }
- }
- return num_selected_tests;
-}
-
-// Prints the given C-string on a single line by replacing all '\n'
-// characters with string "\\n". If the output takes more than
-// max_length characters, only prints the first max_length characters
-// and "...".
-static void PrintOnOneLine(const char* str, int max_length) {
- if (str != nullptr) {
- for (int i = 0; *str != '\0'; ++str) {
- if (i >= max_length) {
- printf("...");
- break;
- }
- if (*str == '\n') {
- printf("\\n");
- i += 2;
- } else {
- printf("%c", *str);
- ++i;
- }
- }
- }
-}
-
-// Prints the names of the tests matching the user-specified filter flag.
-void UnitTestImpl::ListTestsMatchingFilter() {
- // Print at most this many characters for each type/value parameter.
- const int kMaxParamLength = 250;
-
- for (auto* test_suite : test_suites_) {
- bool printed_test_suite_name = false;
-
- for (size_t j = 0; j < test_suite->test_info_list().size(); j++) {
- const TestInfo* const test_info = test_suite->test_info_list()[j];
- if (test_info->matches_filter_) {
- if (!printed_test_suite_name) {
- printed_test_suite_name = true;
- printf("%s.", test_suite->name());
- if (test_suite->type_param() != nullptr) {
- printf(" # %s = ", kTypeParamLabel);
- // We print the type parameter on a single line to make
- // the output easy to parse by a program.
- PrintOnOneLine(test_suite->type_param(), kMaxParamLength);
- }
- printf("\n");
- }
- printf(" %s", test_info->name());
- if (test_info->value_param() != nullptr) {
- printf(" # %s = ", kValueParamLabel);
- // We print the value parameter on a single line to make the
- // output easy to parse by a program.
- PrintOnOneLine(test_info->value_param(), kMaxParamLength);
- }
- printf("\n");
- }
- }
- }
- fflush(stdout);
- const std::string& output_format = UnitTestOptions::GetOutputFormat();
- if (output_format == "xml" || output_format == "json") {
- FILE* fileout = OpenFileForWriting(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str());
- std::stringstream stream;
- if (output_format == "xml") {
- XmlUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
- .PrintXmlTestsList(&stream, test_suites_);
- } else if (output_format == "json") {
- JsonUnitTestResultPrinter(
- UnitTestOptions::GetAbsolutePathToOutputFile().c_str())
- .PrintJsonTestList(&stream, test_suites_);
- }
- fprintf(fileout, "%s", StringStreamToString(&stream).c_str());
- fclose(fileout);
- }
-}
-
-// Sets the OS stack trace getter.
-//
-// Does nothing if the input and the current OS stack trace getter are
-// the same; otherwise, deletes the old getter and makes the input the
-// current getter.
-void UnitTestImpl::set_os_stack_trace_getter(
- OsStackTraceGetterInterface* getter) {
- if (os_stack_trace_getter_ != getter) {
- delete os_stack_trace_getter_;
- os_stack_trace_getter_ = getter;
- }
-}
-
-// Returns the current OS stack trace getter if it is not NULL;
-// otherwise, creates an OsStackTraceGetter, makes it the current
-// getter, and returns it.
-OsStackTraceGetterInterface* UnitTestImpl::os_stack_trace_getter() {
- if (os_stack_trace_getter_ == nullptr) {
-#ifdef GTEST_OS_STACK_TRACE_GETTER_
- os_stack_trace_getter_ = new GTEST_OS_STACK_TRACE_GETTER_;
-#else
- os_stack_trace_getter_ = new OsStackTraceGetter;
-#endif // GTEST_OS_STACK_TRACE_GETTER_
- }
-
- return os_stack_trace_getter_;
-}
-
-// Returns the most specific TestResult currently running.
-TestResult* UnitTestImpl::current_test_result() {
- if (current_test_info_ != nullptr) {
- return &current_test_info_->result_;
- }
- if (current_test_suite_ != nullptr) {
- return &current_test_suite_->ad_hoc_test_result_;
- }
- return &ad_hoc_test_result_;
-}
-
-// Shuffles all test suites, and the tests within each test suite,
-// making sure that death tests are still run first.
-void UnitTestImpl::ShuffleTests() {
- // Shuffles the death test suites.
- ShuffleRange(random(), 0, last_death_test_suite_ + 1, &test_suite_indices_);
-
- // Shuffles the non-death test suites.
- ShuffleRange(random(), last_death_test_suite_ + 1,
- static_cast<int>(test_suites_.size()), &test_suite_indices_);
-
- // Shuffles the tests inside each test suite.
- for (auto& test_suite : test_suites_) {
- test_suite->ShuffleTests(random());
- }
-}
-
-// Restores the test suites and tests to their order before the first shuffle.
-void UnitTestImpl::UnshuffleTests() {
- for (size_t i = 0; i < test_suites_.size(); i++) {
- // Unshuffles the tests in each test suite.
- test_suites_[i]->UnshuffleTests();
- // Resets the index of each test suite.
- test_suite_indices_[i] = static_cast<int>(i);
- }
-}
-
-// Returns the current OS stack trace as an std::string.
-//
-// The maximum number of stack frames to be included is specified by
-// the gtest_stack_trace_depth flag. The skip_count parameter
-// specifies the number of top frames to be skipped, which doesn't
-// count against the number of frames to be included.
-//
-// For example, if Foo() calls Bar(), which in turn calls
-// GetCurrentOsStackTraceExceptTop(..., 1), Foo() will be included in
-// the trace but Bar() and GetCurrentOsStackTraceExceptTop() won't.
-std::string GetCurrentOsStackTraceExceptTop(UnitTest* /*unit_test*/,
- int skip_count) {
- // We pass skip_count + 1 to skip this wrapper function in addition
- // to what the user really wants to skip.
- return GetUnitTestImpl()->CurrentOsStackTraceExceptTop(skip_count + 1);
-}
-
-// Used by the GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_ macro to
-// suppress unreachable code warnings.
-namespace {
-class ClassUniqueToAlwaysTrue {};
-}
-
-bool IsTrue(bool condition) { return condition; }
-
-bool AlwaysTrue() {
-#if GTEST_HAS_EXCEPTIONS
- // This condition is always false so AlwaysTrue() never actually throws,
- // but it makes the compiler think that it may throw.
- if (IsTrue(false))
- throw ClassUniqueToAlwaysTrue();
-#endif // GTEST_HAS_EXCEPTIONS
- return true;
-}
-
-// If *pstr starts with the given prefix, modifies *pstr to be right
-// past the prefix and returns true; otherwise leaves *pstr unchanged
-// and returns false. None of pstr, *pstr, and prefix can be NULL.
-bool SkipPrefix(const char* prefix, const char** pstr) {
- const size_t prefix_len = strlen(prefix);
- if (strncmp(*pstr, prefix, prefix_len) == 0) {
- *pstr += prefix_len;
- return true;
- }
- return false;
-}
-
-// Parses a string as a command line flag. The string should have
-// the format "--flag=value". When def_optional is true, the "=value"
-// part can be omitted.
-//
-// Returns the value of the flag, or NULL if the parsing failed.
-static const char* ParseFlagValue(const char* str, const char* flag_name,
- bool def_optional) {
- // str and flag must not be NULL.
- if (str == nullptr || flag_name == nullptr) return nullptr;
-
- // The flag must start with "--" followed by GTEST_FLAG_PREFIX_.
- const std::string flag_str =
- std::string("--") + GTEST_FLAG_PREFIX_ + flag_name;
- const size_t flag_len = flag_str.length();
- if (strncmp(str, flag_str.c_str(), flag_len) != 0) return nullptr;
-
- // Skips the flag name.
- const char* flag_end = str + flag_len;
-
- // When def_optional is true, it's OK to not have a "=value" part.
- if (def_optional && (flag_end[0] == '\0')) {
- return flag_end;
- }
-
- // If def_optional is true and there are more characters after the
- // flag name, or if def_optional is false, there must be a '=' after
- // the flag name.
- if (flag_end[0] != '=') return nullptr;
-
- // Returns the string after "=".
- return flag_end + 1;
-}
-
-// Parses a string for a bool flag, in the form of either
-// "--flag=value" or "--flag".
-//
-// In the former case, the value is taken as true as long as it does
-// not start with '0', 'f', or 'F'.
-//
-// In the latter case, the value is taken as true.
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-static bool ParseFlag(const char* str, const char* flag_name, bool* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag_name, true);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Converts the string value to a bool.
- *value = !(*value_str == '0' || *value_str == 'f' || *value_str == 'F');
- return true;
-}
-
-// Parses a string for an int32_t flag, in the form of "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-bool ParseFlag(const char* str, const char* flag_name, int32_t* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag_name, false);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Sets *value to the value of the flag.
- return ParseInt32(Message() << "The value of flag --" << flag_name, value_str,
- value);
-}
-
-// Parses a string for a string flag, in the form of "--flag=value".
-//
-// On success, stores the value of the flag in *value, and returns
-// true. On failure, returns false without changing *value.
-template <typename String>
-static bool ParseFlag(const char* str, const char* flag_name, String* value) {
- // Gets the value of the flag as a string.
- const char* const value_str = ParseFlagValue(str, flag_name, false);
-
- // Aborts if the parsing failed.
- if (value_str == nullptr) return false;
-
- // Sets *value to the value of the flag.
- *value = value_str;
- return true;
-}
-
-// Determines whether a string has a prefix that Google Test uses for its
-// flags, i.e., starts with GTEST_FLAG_PREFIX_ or GTEST_FLAG_PREFIX_DASH_.
-// If Google Test detects that a command line flag has its prefix but is not
-// recognized, it will print its help message. Flags starting with
-// GTEST_INTERNAL_PREFIX_ followed by "internal_" are considered Google Test
-// internal flags and do not trigger the help message.
-static bool HasGoogleTestFlagPrefix(const char* str) {
- return (SkipPrefix("--", &str) ||
- SkipPrefix("-", &str) ||
- SkipPrefix("/", &str)) &&
- !SkipPrefix(GTEST_FLAG_PREFIX_ "internal_", &str) &&
- (SkipPrefix(GTEST_FLAG_PREFIX_, &str) ||
- SkipPrefix(GTEST_FLAG_PREFIX_DASH_, &str));
-}
-
-// Prints a string containing code-encoded text. The following escape
-// sequences can be used in the string to control the text color:
-//
-// @@ prints a single '@' character.
-// @R changes the color to red.
-// @G changes the color to green.
-// @Y changes the color to yellow.
-// @D changes to the default terminal text color.
-//
-static void PrintColorEncoded(const char* str) {
- GTestColor color = GTestColor::kDefault; // The current color.
-
- // Conceptually, we split the string into segments divided by escape
- // sequences. Then we print one segment at a time. At the end of
- // each iteration, the str pointer advances to the beginning of the
- // next segment.
- for (;;) {
- const char* p = strchr(str, '@');
- if (p == nullptr) {
- ColoredPrintf(color, "%s", str);
- return;
- }
-
- ColoredPrintf(color, "%s", std::string(str, p).c_str());
-
- const char ch = p[1];
- str = p + 2;
- if (ch == '@') {
- ColoredPrintf(color, "@");
- } else if (ch == 'D') {
- color = GTestColor::kDefault;
- } else if (ch == 'R') {
- color = GTestColor::kRed;
- } else if (ch == 'G') {
- color = GTestColor::kGreen;
- } else if (ch == 'Y') {
- color = GTestColor::kYellow;
- } else {
- --str;
- }
- }
-}
-
-static const char kColorEncodedHelpMessage[] =
- "This program contains tests written using " GTEST_NAME_
- ". You can use the\n"
- "following command line flags to control its behavior:\n"
- "\n"
- "Test Selection:\n"
- " @G--" GTEST_FLAG_PREFIX_
- "list_tests@D\n"
- " List the names of all tests instead of running them. The name of\n"
- " TEST(Foo, Bar) is \"Foo.Bar\".\n"
- " @G--" GTEST_FLAG_PREFIX_
- "filter=@YPOSITIVE_PATTERNS"
- "[@G-@YNEGATIVE_PATTERNS]@D\n"
- " Run only the tests whose name matches one of the positive patterns "
- "but\n"
- " none of the negative patterns. '?' matches any single character; "
- "'*'\n"
- " matches any substring; ':' separates two patterns.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "also_run_disabled_tests@D\n"
- " Run all disabled tests too.\n"
- "\n"
- "Test Execution:\n"
- " @G--" GTEST_FLAG_PREFIX_
- "repeat=@Y[COUNT]@D\n"
- " Run the tests repeatedly; use a negative count to repeat forever.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "shuffle@D\n"
- " Randomize tests' orders on every iteration.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "random_seed=@Y[NUMBER]@D\n"
- " Random number seed to use for shuffling test orders (between 1 and\n"
- " 99999, or 0 to use a seed based on the current time).\n"
- " @G--" GTEST_FLAG_PREFIX_
- "recreate_environments_when_repeating@D\n"
- " Sets up and tears down the global test environment on each repeat\n"
- " of the test.\n"
- "\n"
- "Test Output:\n"
- " @G--" GTEST_FLAG_PREFIX_
- "color=@Y(@Gyes@Y|@Gno@Y|@Gauto@Y)@D\n"
- " Enable/disable colored output. The default is @Gauto@D.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "brief=1@D\n"
- " Only print test failures.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "print_time=0@D\n"
- " Don't print the elapsed time of each test.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "output=@Y(@Gjson@Y|@Gxml@Y)[@G:@YDIRECTORY_PATH@G" GTEST_PATH_SEP_
- "@Y|@G:@YFILE_PATH]@D\n"
- " Generate a JSON or XML report in the given directory or with the "
- "given\n"
- " file name. @YFILE_PATH@D defaults to @Gtest_detail.xml@D.\n"
-# if GTEST_CAN_STREAM_RESULTS_
- " @G--" GTEST_FLAG_PREFIX_
- "stream_result_to=@YHOST@G:@YPORT@D\n"
- " Stream test results to the given server.\n"
-# endif // GTEST_CAN_STREAM_RESULTS_
- "\n"
- "Assertion Behavior:\n"
-# if GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
- " @G--" GTEST_FLAG_PREFIX_
- "death_test_style=@Y(@Gfast@Y|@Gthreadsafe@Y)@D\n"
- " Set the default death test style.\n"
-# endif // GTEST_HAS_DEATH_TEST && !GTEST_OS_WINDOWS
- " @G--" GTEST_FLAG_PREFIX_
- "break_on_failure@D\n"
- " Turn assertion failures into debugger break-points.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "throw_on_failure@D\n"
- " Turn assertion failures into C++ exceptions for use by an external\n"
- " test framework.\n"
- " @G--" GTEST_FLAG_PREFIX_
- "catch_exceptions=0@D\n"
- " Do not report exceptions as test failures. Instead, allow them\n"
- " to crash the program or throw a pop-up (on Windows).\n"
- "\n"
- "Except for @G--" GTEST_FLAG_PREFIX_
- "list_tests@D, you can alternatively set "
- "the corresponding\n"
- "environment variable of a flag (all letters in upper-case). For example, "
- "to\n"
- "disable colored text output, you can either specify "
- "@G--" GTEST_FLAG_PREFIX_
- "color=no@D or set\n"
- "the @G" GTEST_FLAG_PREFIX_UPPER_
- "COLOR@D environment variable to @Gno@D.\n"
- "\n"
- "For more information, please read the " GTEST_NAME_
- " documentation at\n"
- "@G" GTEST_PROJECT_URL_ "@D. If you find a bug in " GTEST_NAME_
- "\n"
- "(not one in your own code or tests), please report it to\n"
- "@G<" GTEST_DEV_EMAIL_ ">@D.\n";
-
-static bool ParseGoogleTestFlag(const char* const arg) {
-#define GTEST_INTERNAL_PARSE_FLAG(flag_name) \
- do { \
- auto value = GTEST_FLAG_GET(flag_name); \
- if (ParseFlag(arg, #flag_name, &value)) { \
- GTEST_FLAG_SET(flag_name, value); \
- return true; \
- } \
- } while (false)
-
- GTEST_INTERNAL_PARSE_FLAG(also_run_disabled_tests);
- GTEST_INTERNAL_PARSE_FLAG(break_on_failure);
- GTEST_INTERNAL_PARSE_FLAG(catch_exceptions);
- GTEST_INTERNAL_PARSE_FLAG(color);
- GTEST_INTERNAL_PARSE_FLAG(death_test_style);
- GTEST_INTERNAL_PARSE_FLAG(death_test_use_fork);
- GTEST_INTERNAL_PARSE_FLAG(fail_fast);
- GTEST_INTERNAL_PARSE_FLAG(filter);
- GTEST_INTERNAL_PARSE_FLAG(internal_run_death_test);
- GTEST_INTERNAL_PARSE_FLAG(list_tests);
- GTEST_INTERNAL_PARSE_FLAG(output);
- GTEST_INTERNAL_PARSE_FLAG(brief);
- GTEST_INTERNAL_PARSE_FLAG(print_time);
- GTEST_INTERNAL_PARSE_FLAG(print_utf8);
- GTEST_INTERNAL_PARSE_FLAG(random_seed);
- GTEST_INTERNAL_PARSE_FLAG(repeat);
- GTEST_INTERNAL_PARSE_FLAG(recreate_environments_when_repeating);
- GTEST_INTERNAL_PARSE_FLAG(shuffle);
- GTEST_INTERNAL_PARSE_FLAG(stack_trace_depth);
- GTEST_INTERNAL_PARSE_FLAG(stream_result_to);
- GTEST_INTERNAL_PARSE_FLAG(throw_on_failure);
- return false;
-}
-
-#if GTEST_USE_OWN_FLAGFILE_FLAG_
-static void LoadFlagsFromFile(const std::string& path) {
- FILE* flagfile = posix::FOpen(path.c_str(), "r");
- if (!flagfile) {
- GTEST_LOG_(FATAL) << "Unable to open file \"" << GTEST_FLAG_GET(flagfile)
- << "\"";
- }
- std::string contents(ReadEntireFile(flagfile));
- posix::FClose(flagfile);
- std::vector<std::string> lines;
- SplitString(contents, '\n', &lines);
- for (size_t i = 0; i < lines.size(); ++i) {
- if (lines[i].empty())
- continue;
- if (!ParseGoogleTestFlag(lines[i].c_str()))
- g_help_flag = true;
- }
-}
-#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test. The type parameter CharType can be
-// instantiated to either char or wchar_t.
-template <typename CharType>
-void ParseGoogleTestFlagsOnlyImpl(int* argc, CharType** argv) {
- std::string flagfile_value;
- for (int i = 1; i < *argc; i++) {
- const std::string arg_string = StreamableToString(argv[i]);
- const char* const arg = arg_string.c_str();
-
- using internal::ParseFlag;
-
- bool remove_flag = false;
- if (ParseGoogleTestFlag(arg)) {
- remove_flag = true;
-#if GTEST_USE_OWN_FLAGFILE_FLAG_
- } else if (ParseFlag(arg, "flagfile", &flagfile_value)) {
- GTEST_FLAG_SET(flagfile, flagfile_value);
- LoadFlagsFromFile(flagfile_value);
- remove_flag = true;
-#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
- } else if (arg_string == "--help" || arg_string == "-h" ||
- arg_string == "-?" || arg_string == "/?" ||
- HasGoogleTestFlagPrefix(arg)) {
- // Both help flag and unrecognized Google Test flags (excluding
- // internal ones) trigger help display.
- g_help_flag = true;
- }
-
- if (remove_flag) {
- // Shift the remainder of the argv list left by one. Note
- // that argv has (*argc + 1) elements, the last one always being
- // NULL. The following loop moves the trailing NULL element as
- // well.
- for (int j = i; j != *argc; j++) {
- argv[j] = argv[j + 1];
- }
-
- // Decrements the argument count.
- (*argc)--;
-
- // We also need to decrement the iterator as we just removed
- // an element.
- i--;
- }
- }
-
- if (g_help_flag) {
- // We print the help here instead of in RUN_ALL_TESTS(), as the
- // latter may not be called at all if the user is using Google
- // Test with another testing framework.
- PrintColorEncoded(kColorEncodedHelpMessage);
- }
-}
-
-// Parses the command line for Google Test flags, without initializing
-// other parts of Google Test.
-void ParseGoogleTestFlagsOnly(int* argc, char** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-
- // Fix the value of *_NSGetArgc() on macOS, but if and only if
- // *_NSGetArgv() == argv
- // Only applicable to char** version of argv
-#if GTEST_OS_MAC
-#ifndef GTEST_OS_IOS
- if (*_NSGetArgv() == argv) {
- *_NSGetArgc() = *argc;
- }
-#endif
-#endif
-}
-void ParseGoogleTestFlagsOnly(int* argc, wchar_t** argv) {
- ParseGoogleTestFlagsOnlyImpl(argc, argv);
-}
-
-// The internal implementation of InitGoogleTest().
-//
-// The type parameter CharType can be instantiated to either char or
-// wchar_t.
-template <typename CharType>
-void InitGoogleTestImpl(int* argc, CharType** argv) {
- // We don't want to run the initialization code twice.
- if (GTestIsInitialized()) return;
-
- if (*argc <= 0) return;
-
- g_argvs.clear();
- for (int i = 0; i != *argc; i++) {
- g_argvs.push_back(StreamableToString(argv[i]));
- }
-
-#if GTEST_HAS_ABSL
- absl::InitializeSymbolizer(g_argvs[0].c_str());
-#endif // GTEST_HAS_ABSL
-
- ParseGoogleTestFlagsOnly(argc, argv);
- GetUnitTestImpl()->PostFlagParsingInit();
-}
-
-} // namespace internal
-
-// Initializes Google Test. This must be called before calling
-// RUN_ALL_TESTS(). In particular, it parses a command line for the
-// flags that Google Test recognizes. Whenever a Google Test flag is
-// seen, it is removed from argv, and *argc is decremented.
-//
-// No value is returned. Instead, the Google Test flag variables are
-// updated.
-//
-// Calling the function for the second time has no user-visible effect.
-void InitGoogleTest(int* argc, char** argv) {
-#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
-#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- internal::InitGoogleTestImpl(argc, argv);
-#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
-}
-
-// This overloaded version can be used in Windows programs compiled in
-// UNICODE mode.
-void InitGoogleTest(int* argc, wchar_t** argv) {
-#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(argc, argv);
-#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- internal::InitGoogleTestImpl(argc, argv);
-#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
-}
-
-// This overloaded version can be used on Arduino/embedded platforms where
-// there is no argc/argv.
-void InitGoogleTest() {
- // Since Arduino doesn't have a command line, fake out the argc/argv arguments
- int argc = 1;
- const auto arg0 = "dummy";
- char* argv0 = const_cast<char*>(arg0);
- char** argv = &argv0;
-
-#if defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_(&argc, argv);
-#else // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
- internal::InitGoogleTestImpl(&argc, argv);
-#endif // defined(GTEST_CUSTOM_INIT_GOOGLE_TEST_FUNCTION_)
-}
-
-std::string TempDir() {
-#if defined(GTEST_CUSTOM_TEMPDIR_FUNCTION_)
- return GTEST_CUSTOM_TEMPDIR_FUNCTION_();
-#elif GTEST_OS_WINDOWS_MOBILE
- return "\\temp\\";
-#elif GTEST_OS_WINDOWS
- const char* temp_dir = internal::posix::GetEnv("TEMP");
- if (temp_dir == nullptr || temp_dir[0] == '\0') {
- return "\\temp\\";
- } else if (temp_dir[strlen(temp_dir) - 1] == '\\') {
- return temp_dir;
- } else {
- return std::string(temp_dir) + "\\";
- }
-#elif GTEST_OS_LINUX_ANDROID
- const char* temp_dir = internal::posix::GetEnv("TEST_TMPDIR");
- if (temp_dir == nullptr || temp_dir[0] == '\0') {
- return "/data/local/tmp/";
- } else {
- return temp_dir;
- }
-#elif GTEST_OS_LINUX
- const char* temp_dir = internal::posix::GetEnv("TEST_TMPDIR");
- if (temp_dir == nullptr || temp_dir[0] == '\0') {
- return "/tmp/";
- } else {
- return temp_dir;
- }
-#else
- return "/tmp/";
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-// Class ScopedTrace
-
-// Pushes the given source file location and message onto a per-thread
-// trace stack maintained by Google Test.
-void ScopedTrace::PushTrace(const char* file, int line, std::string message) {
- internal::TraceInfo trace;
- trace.file = file;
- trace.line = line;
- trace.message.swap(message);
-
- UnitTest::GetInstance()->PushGTestTrace(trace);
-}
-
-// Pops the info pushed by the c'tor.
-ScopedTrace::~ScopedTrace()
- GTEST_LOCK_EXCLUDED_(&UnitTest::mutex_) {
- UnitTest::GetInstance()->PopGTestTrace();
-}
-
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest_main.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest_main.cc
deleted file mode 100644
index 46b27c3d7d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/src/gtest_main.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include <cstdio>
-#include "gtest/gtest.h"
-
-#if GTEST_OS_ESP8266 || GTEST_OS_ESP32
-#if GTEST_OS_ESP8266
-extern "C" {
-#endif
-void setup() {
- testing::InitGoogleTest();
-}
-
-void loop() { RUN_ALL_TESTS(); }
-
-#if GTEST_OS_ESP8266
-}
-#endif
-
-#else
-
-GTEST_API_ int main(int argc, char **argv) {
- printf("Running main() from %s\n", __FILE__);
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/BUILD.bazel b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/BUILD.bazel
deleted file mode 100644
index 8fd595c705..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/BUILD.bazel
+++ /dev/null
@@ -1,590 +0,0 @@
-# Copyright 2017 Google Inc.
-# All Rights Reserved.
-#
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-# Bazel BUILD for The Google C++ Testing Framework (Google Test)
-
-load("@rules_python//python:defs.bzl", "py_library", "py_test")
-
-licenses(["notice"])
-
-package(default_visibility = ["//:__subpackages__"])
-
-#on windows exclude gtest-tuple.h
-cc_test(
- name = "gtest_all_test",
- size = "small",
- srcs = glob(
- include = [
- "gtest-*.cc",
- "googletest-*.cc",
- "*.h",
- "googletest/include/gtest/**/*.h",
- ],
- exclude = [
- "gtest-unittest-api_test.cc",
- "googletest/src/gtest-all.cc",
- "gtest_all_test.cc",
- "gtest-death-test_ex_test.cc",
- "gtest-listener_test.cc",
- "gtest-unittest-api_test.cc",
- "googletest-param-test-test.cc",
- "googletest-param-test2-test.cc",
- "googletest-catch-exceptions-test_.cc",
- "googletest-color-test_.cc",
- "googletest-env-var-test_.cc",
- "googletest-failfast-unittest_.cc",
- "googletest-filter-unittest_.cc",
- "googletest-global-environment-unittest_.cc",
- "googletest-break-on-failure-unittest_.cc",
- "googletest-listener-test.cc",
- "googletest-output-test_.cc",
- "googletest-list-tests-unittest_.cc",
- "googletest-shuffle-test_.cc",
- "googletest-setuptestsuite-test_.cc",
- "googletest-uninitialized-test_.cc",
- "googletest-death-test_ex_test.cc",
- "googletest-param-test-test",
- "googletest-throw-on-failure-test_.cc",
- "googletest-param-test-invalid-name1-test_.cc",
- "googletest-param-test-invalid-name2-test_.cc",
- ],
- ) + select({
- "//:windows": [],
- "//conditions:default": [],
- }),
- copts = select({
- "//:windows": ["-DGTEST_USE_OWN_TR1_TUPLE=0"],
- "//conditions:default": ["-DGTEST_USE_OWN_TR1_TUPLE=1"],
- }) + select({
- # Ensure MSVC treats source files as UTF-8 encoded.
- "//:msvc_compiler": ["-utf-8"],
- "//conditions:default": [],
- }),
- includes = [
- "googletest",
- "googletest/include",
- "googletest/include/internal",
- "googletest/test",
- ],
- linkopts = select({
- "//:qnx": [],
- "//:windows": [],
- "//conditions:default": ["-pthread"],
- }),
- deps = ["//:gtest_main"],
-)
-
-# Tests death tests.
-cc_test(
- name = "googletest-death-test-test",
- size = "medium",
- srcs = ["googletest-death-test-test.cc"],
- deps = ["//:gtest_main"],
-)
-
-cc_test(
- name = "gtest_test_macro_stack_footprint_test",
- size = "small",
- srcs = ["gtest_test_macro_stack_footprint_test.cc"],
- deps = ["//:gtest"],
-)
-
-#These googletest tests have their own main()
-cc_test(
- name = "googletest-listener-test",
- size = "small",
- srcs = ["googletest-listener-test.cc"],
- deps = ["//:gtest_main"],
-)
-
-cc_test(
- name = "gtest-unittest-api_test",
- size = "small",
- srcs = [
- "gtest-unittest-api_test.cc",
- ],
- deps = [
- "//:gtest",
- ],
-)
-
-cc_test(
- name = "googletest-param-test-test",
- size = "small",
- srcs = [
- "googletest-param-test-test.cc",
- "googletest-param-test-test.h",
- "googletest-param-test2-test.cc",
- ],
- deps = ["//:gtest"],
-)
-
-cc_test(
- name = "gtest_unittest",
- size = "small",
- srcs = ["gtest_unittest.cc"],
- shard_count = 2,
- deps = ["//:gtest_main"],
-)
-
-# Py tests
-
-py_library(
- name = "gtest_test_utils",
- testonly = 1,
- srcs = ["gtest_test_utils.py"],
- imports = ["."],
-)
-
-cc_binary(
- name = "gtest_help_test_",
- testonly = 1,
- srcs = ["gtest_help_test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "gtest_help_test",
- size = "small",
- srcs = ["gtest_help_test.py"],
- data = [":gtest_help_test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-output-test_",
- testonly = 1,
- srcs = ["googletest-output-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-output-test",
- size = "small",
- srcs = ["googletest-output-test.py"],
- args = select({
- "//:has_absl": [],
- "//conditions:default": ["--no_stacktrace_support"],
- }),
- data = [
- "googletest-output-test-golden-lin.txt",
- ":googletest-output-test_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-color-test_",
- testonly = 1,
- srcs = ["googletest-color-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-color-test",
- size = "small",
- srcs = ["googletest-color-test.py"],
- data = [":googletest-color-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-env-var-test_",
- testonly = 1,
- srcs = ["googletest-env-var-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-env-var-test",
- size = "medium",
- srcs = ["googletest-env-var-test.py"],
- data = [":googletest-env-var-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-failfast-unittest_",
- testonly = 1,
- srcs = ["googletest-failfast-unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-failfast-unittest",
- size = "medium",
- srcs = ["googletest-failfast-unittest.py"],
- data = [":googletest-failfast-unittest_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-filter-unittest_",
- testonly = 1,
- srcs = ["googletest-filter-unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-filter-unittest",
- size = "medium",
- srcs = ["googletest-filter-unittest.py"],
- data = [":googletest-filter-unittest_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-global-environment-unittest_",
- testonly = 1,
- srcs = ["googletest-global-environment-unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-global-environment-unittest",
- size = "medium",
- srcs = ["googletest-global-environment-unittest.py"],
- data = [":googletest-global-environment-unittest_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-break-on-failure-unittest_",
- testonly = 1,
- srcs = ["googletest-break-on-failure-unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-break-on-failure-unittest",
- size = "small",
- srcs = ["googletest-break-on-failure-unittest.py"],
- data = [":googletest-break-on-failure-unittest_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_test(
- name = "gtest_assert_by_exception_test",
- size = "small",
- srcs = ["gtest_assert_by_exception_test.cc"],
- deps = ["//:gtest"],
-)
-
-cc_binary(
- name = "googletest-throw-on-failure-test_",
- testonly = 1,
- srcs = ["googletest-throw-on-failure-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-throw-on-failure-test",
- size = "small",
- srcs = ["googletest-throw-on-failure-test.py"],
- data = [":googletest-throw-on-failure-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-list-tests-unittest_",
- testonly = 1,
- srcs = ["googletest-list-tests-unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-cc_test(
- name = "gtest_skip_test",
- size = "small",
- srcs = ["gtest_skip_test.cc"],
- deps = ["//:gtest_main"],
-)
-
-cc_test(
- name = "gtest_skip_in_environment_setup_test",
- size = "small",
- srcs = ["gtest_skip_in_environment_setup_test.cc"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "gtest_skip_check_output_test",
- size = "small",
- srcs = ["gtest_skip_check_output_test.py"],
- data = [":gtest_skip_test"],
- deps = [":gtest_test_utils"],
-)
-
-py_test(
- name = "gtest_skip_environment_check_output_test",
- size = "small",
- srcs = ["gtest_skip_environment_check_output_test.py"],
- data = [
- ":gtest_skip_in_environment_setup_test",
- ],
- deps = [":gtest_test_utils"],
-)
-
-py_test(
- name = "googletest-list-tests-unittest",
- size = "small",
- srcs = ["googletest-list-tests-unittest.py"],
- data = [":googletest-list-tests-unittest_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-shuffle-test_",
- srcs = ["googletest-shuffle-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-shuffle-test",
- size = "small",
- srcs = ["googletest-shuffle-test.py"],
- data = [":googletest-shuffle-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-catch-exceptions-no-ex-test_",
- testonly = 1,
- srcs = ["googletest-catch-exceptions-test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-cc_binary(
- name = "googletest-catch-exceptions-ex-test_",
- testonly = 1,
- srcs = ["googletest-catch-exceptions-test_.cc"],
- copts = ["-fexceptions"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "googletest-catch-exceptions-test",
- size = "small",
- srcs = ["googletest-catch-exceptions-test.py"],
- data = [
- ":googletest-catch-exceptions-ex-test_",
- ":googletest-catch-exceptions-no-ex-test_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "gtest_xml_output_unittest_",
- testonly = 1,
- srcs = ["gtest_xml_output_unittest_.cc"],
- deps = ["//:gtest"],
-)
-
-cc_test(
- name = "gtest_no_test_unittest",
- size = "small",
- srcs = ["gtest_no_test_unittest.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "gtest_xml_output_unittest",
- size = "small",
- srcs = [
- "gtest_xml_output_unittest.py",
- "gtest_xml_test_utils.py",
- ],
- args = select({
- "//:has_absl": [],
- "//conditions:default": ["--no_stacktrace_support"],
- }),
- data = [
- # We invoke gtest_no_test_unittest to verify the XML output
- # when the test program contains no test definition.
- ":gtest_no_test_unittest",
- ":gtest_xml_output_unittest_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "gtest_xml_outfile1_test_",
- testonly = 1,
- srcs = ["gtest_xml_outfile1_test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-cc_binary(
- name = "gtest_xml_outfile2_test_",
- testonly = 1,
- srcs = ["gtest_xml_outfile2_test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "gtest_xml_outfiles_test",
- size = "small",
- srcs = [
- "gtest_xml_outfiles_test.py",
- "gtest_xml_test_utils.py",
- ],
- data = [
- ":gtest_xml_outfile1_test_",
- ":gtest_xml_outfile2_test_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-setuptestsuite-test_",
- testonly = 1,
- srcs = ["googletest-setuptestsuite-test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-py_test(
- name = "googletest-setuptestsuite-test",
- size = "medium",
- srcs = ["googletest-setuptestsuite-test.py"],
- data = [":googletest-setuptestsuite-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "googletest-uninitialized-test_",
- testonly = 1,
- srcs = ["googletest-uninitialized-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-uninitialized-test",
- size = "medium",
- srcs = ["googletest-uninitialized-test.py"],
- data = ["googletest-uninitialized-test_"],
- deps = [":gtest_test_utils"],
-)
-
-cc_binary(
- name = "gtest_testbridge_test_",
- testonly = 1,
- srcs = ["gtest_testbridge_test_.cc"],
- deps = ["//:gtest_main"],
-)
-
-# Tests that filtering via testbridge works
-py_test(
- name = "gtest_testbridge_test",
- size = "small",
- srcs = ["gtest_testbridge_test.py"],
- data = [":gtest_testbridge_test_"],
- deps = [":gtest_test_utils"],
-)
-
-py_test(
- name = "googletest-json-outfiles-test",
- size = "small",
- srcs = [
- "googletest-json-outfiles-test.py",
- "gtest_json_test_utils.py",
- ],
- data = [
- ":gtest_xml_outfile1_test_",
- ":gtest_xml_outfile2_test_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-py_test(
- name = "googletest-json-output-unittest",
- size = "medium",
- srcs = [
- "googletest-json-output-unittest.py",
- "gtest_json_test_utils.py",
- ],
- args = select({
- "//:has_absl": [],
- "//conditions:default": ["--no_stacktrace_support"],
- }),
- data = [
- # We invoke gtest_no_test_unittest to verify the JSON output
- # when the test program contains no test definition.
- ":gtest_no_test_unittest",
- ":gtest_xml_output_unittest_",
- ],
- deps = [":gtest_test_utils"],
-)
-
-# Verifies interaction of death tests and exceptions.
-cc_test(
- name = "googletest-death-test_ex_catch_test",
- size = "medium",
- srcs = ["googletest-death-test_ex_test.cc"],
- copts = ["-fexceptions"],
- defines = ["GTEST_ENABLE_CATCH_EXCEPTIONS_=1"],
- deps = ["//:gtest"],
-)
-
-cc_binary(
- name = "googletest-param-test-invalid-name1-test_",
- testonly = 1,
- srcs = ["googletest-param-test-invalid-name1-test_.cc"],
- deps = ["//:gtest"],
-)
-
-cc_binary(
- name = "googletest-param-test-invalid-name2-test_",
- testonly = 1,
- srcs = ["googletest-param-test-invalid-name2-test_.cc"],
- deps = ["//:gtest"],
-)
-
-py_test(
- name = "googletest-param-test-invalid-name1-test",
- size = "small",
- srcs = ["googletest-param-test-invalid-name1-test.py"],
- data = [":googletest-param-test-invalid-name1-test_"],
- tags = [
- "no_test_msvc2015",
- "no_test_msvc2017",
- ],
- deps = [":gtest_test_utils"],
-)
-
-py_test(
- name = "googletest-param-test-invalid-name2-test",
- size = "small",
- srcs = ["googletest-param-test-invalid-name2-test.py"],
- data = [":googletest-param-test-invalid-name2-test_"],
- tags = [
- "no_test_msvc2015",
- "no_test_msvc2017",
- ],
- deps = [":gtest_test_utils"],
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest.py
deleted file mode 100755
index 4eafba3e6b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest.py
+++ /dev/null
@@ -1,208 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test's break-on-failure mode.
-
-A user can ask Google Test to seg-fault when an assertion fails, using
-either the GTEST_BREAK_ON_FAILURE environment variable or the
---gtest_break_on_failure flag. This script tests such functionality
-by invoking googletest-break-on-failure-unittest_ (a program written with
-Google Test) with different environments and command line flags.
-"""
-
-import os
-from googletest.test import gtest_test_utils
-
-# Constants.
-
-IS_WINDOWS = os.name == 'nt'
-
-# The environment variable for enabling/disabling the break-on-failure mode.
-BREAK_ON_FAILURE_ENV_VAR = 'GTEST_BREAK_ON_FAILURE'
-
-# The command line flag for enabling/disabling the break-on-failure mode.
-BREAK_ON_FAILURE_FLAG = 'gtest_break_on_failure'
-
-# The environment variable for enabling/disabling the throw-on-failure mode.
-THROW_ON_FAILURE_ENV_VAR = 'GTEST_THROW_ON_FAILURE'
-
-# The environment variable for enabling/disabling the catch-exceptions mode.
-CATCH_EXCEPTIONS_ENV_VAR = 'GTEST_CATCH_EXCEPTIONS'
-
-# Path to the googletest-break-on-failure-unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'googletest-break-on-failure-unittest_')
-
-
-environ = gtest_test_utils.environ
-SetEnvVar = gtest_test_utils.SetEnvVar
-
-# Tests in this file run a Google-Test-based test program and expect it
-# to terminate prematurely. Therefore they are incompatible with
-# the premature-exit-file protocol by design. Unset the
-# premature-exit filepath to prevent Google Test from creating
-# the file.
-SetEnvVar(gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None)
-
-
-def Run(command):
- """Runs a command; returns 1 if it was killed by a signal, or 0 otherwise."""
-
- p = gtest_test_utils.Subprocess(command, env=environ)
- if p.terminated_by_signal:
- return 1
- else:
- return 0
-
-
-# The tests.
-
-
-class GTestBreakOnFailureUnitTest(gtest_test_utils.TestCase):
- """Tests using the GTEST_BREAK_ON_FAILURE environment variable or
- the --gtest_break_on_failure flag to turn assertion failures into
- segmentation faults.
- """
-
- def RunAndVerify(self, env_var_value, flag_value, expect_seg_fault):
- """Runs googletest-break-on-failure-unittest_ and verifies that it does
- (or does not) have a seg-fault.
-
- Args:
- env_var_value: value of the GTEST_BREAK_ON_FAILURE environment
- variable; None if the variable should be unset.
- flag_value: value of the --gtest_break_on_failure flag;
- None if the flag should not be present.
- expect_seg_fault: 1 if the program is expected to generate a seg-fault;
- 0 otherwise.
- """
-
- SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, env_var_value)
-
- if env_var_value is None:
- env_var_value_msg = ' is not set'
- else:
- env_var_value_msg = '=' + env_var_value
-
- if flag_value is None:
- flag = ''
- elif flag_value == '0':
- flag = '--%s=0' % BREAK_ON_FAILURE_FLAG
- else:
- flag = '--%s' % BREAK_ON_FAILURE_FLAG
-
- command = [EXE_PATH]
- if flag:
- command.append(flag)
-
- if expect_seg_fault:
- should_or_not = 'should'
- else:
- should_or_not = 'should not'
-
- has_seg_fault = Run(command)
-
- SetEnvVar(BREAK_ON_FAILURE_ENV_VAR, None)
-
- msg = ('when %s%s, an assertion failure in "%s" %s cause a seg-fault.' %
- (BREAK_ON_FAILURE_ENV_VAR, env_var_value_msg, ' '.join(command),
- should_or_not))
- self.assert_(has_seg_fault == expect_seg_fault, msg)
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value=None,
- expect_seg_fault=0)
-
- def testEnvVar(self):
- """Tests using the GTEST_BREAK_ON_FAILURE environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value=None,
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='1',
- flag_value=None,
- expect_seg_fault=1)
-
- def testFlag(self):
- """Tests using the --gtest_break_on_failure flag."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- expect_seg_fault=1)
-
- def testFlagOverridesEnvVar(self):
- """Tests that the flag overrides the environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='0',
- flag_value='1',
- expect_seg_fault=1)
- self.RunAndVerify(env_var_value='1',
- flag_value='0',
- expect_seg_fault=0)
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- expect_seg_fault=1)
-
- def testBreakOnFailureOverridesThrowOnFailure(self):
- """Tests that gtest_break_on_failure overrides gtest_throw_on_failure."""
-
- SetEnvVar(THROW_ON_FAILURE_ENV_VAR, '1')
- try:
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- expect_seg_fault=1)
- finally:
- SetEnvVar(THROW_ON_FAILURE_ENV_VAR, None)
-
- if IS_WINDOWS:
- def testCatchExceptionsDoesNotInterfere(self):
- """Tests that gtest_catch_exceptions doesn't interfere."""
-
- SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, '1')
- try:
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- expect_seg_fault=1)
- finally:
- SetEnvVar(CATCH_EXCEPTIONS_ENV_VAR, None)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest_.cc
deleted file mode 100644
index f84957a2d0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-break-on-failure-unittest_.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Unit test for Google Test's break-on-failure mode.
-//
-// A user can ask Google Test to seg-fault when an assertion fails, using
-// either the GTEST_BREAK_ON_FAILURE environment variable or the
-// --gtest_break_on_failure flag. This file is used for testing such
-// functionality.
-//
-// This program will be invoked from a Python unit test. It is
-// expected to fail. Don't run it directly.
-
-#include "gtest/gtest.h"
-
-#if GTEST_OS_WINDOWS
-# include <windows.h>
-# include <stdlib.h>
-#endif
-
-namespace {
-
-// A test that's expected to fail.
-TEST(Foo, Bar) {
- EXPECT_EQ(2, 3);
-}
-
-#if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
-// On Windows Mobile global exception handlers are not supported.
-LONG WINAPI ExitWithExceptionCode(
- struct _EXCEPTION_POINTERS* exception_pointers) {
- exit(exception_pointers->ExceptionRecord->ExceptionCode);
-}
-#endif
-
-} // namespace
-
-int main(int argc, char **argv) {
-#if GTEST_OS_WINDOWS
- // Suppresses display of the Windows error dialog upon encountering
- // a general protection fault (segment violation).
- SetErrorMode(SEM_NOGPFAULTERRORBOX | SEM_FAILCRITICALERRORS);
-
-# if GTEST_HAS_SEH && !GTEST_OS_WINDOWS_MOBILE
-
- // The default unhandled exception filter does not always exit
- // with the exception code as exit code - for example it exits with
- // 0 for EXCEPTION_ACCESS_VIOLATION and 1 for EXCEPTION_BREAKPOINT
- // if the application is compiled in debug mode. Thus we use our own
- // filter which always exits with the exception code for unhandled
- // exceptions.
- SetUnhandledExceptionFilter(ExitWithExceptionCode);
-
-# endif
-#endif // GTEST_OS_WINDOWS
- testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test.py
deleted file mode 100755
index d38d91a62a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test.py
+++ /dev/null
@@ -1,236 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2010 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests Google Test's exception catching behavior.
-
-This script invokes googletest-catch-exceptions-test_ and
-googletest-catch-exceptions-ex-test_ (programs written with
-Google Test) and verifies their output.
-"""
-
-from googletest.test import gtest_test_utils
-
-# Constants.
-FLAG_PREFIX = '--gtest_'
-LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
-NO_CATCH_EXCEPTIONS_FLAG = FLAG_PREFIX + 'catch_exceptions=0'
-FILTER_FLAG = FLAG_PREFIX + 'filter'
-
-# Path to the googletest-catch-exceptions-ex-test_ binary, compiled with
-# exceptions enabled.
-EX_EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'googletest-catch-exceptions-ex-test_')
-
-# Path to the googletest-catch-exceptions-test_ binary, compiled with
-# exceptions disabled.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'googletest-catch-exceptions-no-ex-test_')
-
-environ = gtest_test_utils.environ
-SetEnvVar = gtest_test_utils.SetEnvVar
-
-# Tests in this file run a Google-Test-based test program and expect it
-# to terminate prematurely. Therefore they are incompatible with
-# the premature-exit-file protocol by design. Unset the
-# premature-exit filepath to prevent Google Test from creating
-# the file.
-SetEnvVar(gtest_test_utils.PREMATURE_EXIT_FILE_ENV_VAR, None)
-
-TEST_LIST = gtest_test_utils.Subprocess(
- [EXE_PATH, LIST_TESTS_FLAG], env=environ).output
-
-SUPPORTS_SEH_EXCEPTIONS = 'ThrowsSehException' in TEST_LIST
-
-if SUPPORTS_SEH_EXCEPTIONS:
- BINARY_OUTPUT = gtest_test_utils.Subprocess([EXE_PATH], env=environ).output
-
-EX_BINARY_OUTPUT = gtest_test_utils.Subprocess(
- [EX_EXE_PATH], env=environ).output
-
-
-# The tests.
-if SUPPORTS_SEH_EXCEPTIONS:
- # pylint:disable-msg=C6302
- class CatchSehExceptionsTest(gtest_test_utils.TestCase):
- """Tests exception-catching behavior."""
-
-
- def TestSehExceptions(self, test_output):
- self.assert_('SEH exception with code 0x2a thrown '
- 'in the test fixture\'s constructor'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown '
- 'in the test fixture\'s destructor'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in SetUpTestSuite()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in TearDownTestSuite()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in SetUp()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in TearDown()'
- in test_output)
- self.assert_('SEH exception with code 0x2a thrown in the test body'
- in test_output)
-
- def testCatchesSehExceptionsWithCxxExceptionsEnabled(self):
- self.TestSehExceptions(EX_BINARY_OUTPUT)
-
- def testCatchesSehExceptionsWithCxxExceptionsDisabled(self):
- self.TestSehExceptions(BINARY_OUTPUT)
-
-
-class CatchCxxExceptionsTest(gtest_test_utils.TestCase):
- """Tests C++ exception-catching behavior.
-
- Tests in this test case verify that:
- * C++ exceptions are caught and logged as C++ (not SEH) exceptions
- * Exception thrown affect the remainder of the test work flow in the
- expected manner.
- """
-
- def testCatchesCxxExceptionsInFixtureConstructor(self):
- self.assertTrue(
- 'C++ exception with description '
- '"Standard C++ exception" thrown '
- 'in the test fixture\'s constructor' in EX_BINARY_OUTPUT,
- EX_BINARY_OUTPUT)
- self.assert_('unexpected' not in EX_BINARY_OUTPUT,
- 'This failure belongs in this test only if '
- '"CxxExceptionInConstructorTest" (no quotes) '
- 'appears on the same line as words "called unexpectedly"')
-
- if ('CxxExceptionInDestructorTest.ThrowsExceptionInDestructor' in
- EX_BINARY_OUTPUT):
-
- def testCatchesCxxExceptionsInFixtureDestructor(self):
- self.assertTrue(
- 'C++ exception with description '
- '"Standard C++ exception" thrown '
- 'in the test fixture\'s destructor' in EX_BINARY_OUTPUT,
- EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInDestructorTest::TearDownTestSuite() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInSetUpTestCase(self):
- self.assertTrue(
- 'C++ exception with description "Standard C++ exception"'
- ' thrown in SetUpTestSuite()' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInConstructorTest::TearDownTestSuite() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertFalse(
- 'CxxExceptionInSetUpTestSuiteTest constructor '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertFalse(
- 'CxxExceptionInSetUpTestSuiteTest destructor '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertFalse(
- 'CxxExceptionInSetUpTestSuiteTest::SetUp() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertFalse(
- 'CxxExceptionInSetUpTestSuiteTest::TearDown() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertFalse(
- 'CxxExceptionInSetUpTestSuiteTest test body '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInTearDownTestCase(self):
- self.assertTrue(
- 'C++ exception with description "Standard C++ exception"'
- ' thrown in TearDownTestSuite()' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInSetUp(self):
- self.assertTrue(
- 'C++ exception with description "Standard C++ exception"'
- ' thrown in SetUp()' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInSetUpTest::TearDownTestSuite() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInSetUpTest destructor '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInSetUpTest::TearDown() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assert_('unexpected' not in EX_BINARY_OUTPUT,
- 'This failure belongs in this test only if '
- '"CxxExceptionInSetUpTest" (no quotes) '
- 'appears on the same line as words "called unexpectedly"')
-
- def testCatchesCxxExceptionsInTearDown(self):
- self.assertTrue(
- 'C++ exception with description "Standard C++ exception"'
- ' thrown in TearDown()' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInTearDownTest::TearDownTestSuite() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInTearDownTest destructor '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
-
- def testCatchesCxxExceptionsInTestBody(self):
- self.assertTrue(
- 'C++ exception with description "Standard C++ exception"'
- ' thrown in the test body' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInTestBodyTest::TearDownTestSuite() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInTestBodyTest destructor '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
- self.assertTrue(
- 'CxxExceptionInTestBodyTest::TearDown() '
- 'called as expected.' in EX_BINARY_OUTPUT, EX_BINARY_OUTPUT)
-
- def testCatchesNonStdCxxExceptions(self):
- self.assertTrue(
- 'Unknown C++ exception thrown in the test body' in EX_BINARY_OUTPUT,
- EX_BINARY_OUTPUT)
-
- def testUnhandledCxxExceptionsAbortTheProgram(self):
- # Filters out SEH exception tests on Windows. Unhandled SEH exceptions
- # cause tests to show pop-up windows there.
- FITLER_OUT_SEH_TESTS_FLAG = FILTER_FLAG + '=-*Seh*'
- # By default, Google Test doesn't catch the exceptions.
- uncaught_exceptions_ex_binary_output = gtest_test_utils.Subprocess(
- [EX_EXE_PATH,
- NO_CATCH_EXCEPTIONS_FLAG,
- FITLER_OUT_SEH_TESTS_FLAG],
- env=environ).output
-
- self.assert_('Unhandled C++ exception terminating the program'
- in uncaught_exceptions_ex_binary_output)
- self.assert_('unexpected' not in uncaught_exceptions_ex_binary_output)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test_.cc
deleted file mode 100644
index 8c127d40b1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-catch-exceptions-test_.cc
+++ /dev/null
@@ -1,293 +0,0 @@
-// Copyright 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google Test itself. Tests in this file throw C++ or SEH
-// exceptions, and the output is verified by
-// googletest-catch-exceptions-test.py.
-
-#include <stdio.h> // NOLINT
-#include <stdlib.h> // For exit().
-
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_SEH
-# include <windows.h>
-#endif
-
-#if GTEST_HAS_EXCEPTIONS
-# include <exception> // For set_terminate().
-# include <stdexcept>
-#endif
-
-using testing::Test;
-
-#if GTEST_HAS_SEH
-
-class SehExceptionInConstructorTest : public Test {
- public:
- SehExceptionInConstructorTest() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInConstructorTest, ThrowsExceptionInConstructor) {}
-
-class SehExceptionInDestructorTest : public Test {
- public:
- ~SehExceptionInDestructorTest() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInDestructorTest, ThrowsExceptionInDestructor) {}
-
-class SehExceptionInSetUpTestSuiteTest : public Test {
- public:
- static void SetUpTestSuite() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInSetUpTestSuiteTest, ThrowsExceptionInSetUpTestSuite) {}
-
-class SehExceptionInTearDownTestSuiteTest : public Test {
- public:
- static void TearDownTestSuite() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInTearDownTestSuiteTest,
- ThrowsExceptionInTearDownTestSuite) {}
-
-class SehExceptionInSetUpTest : public Test {
- protected:
- virtual void SetUp() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInSetUpTest, ThrowsExceptionInSetUp) {}
-
-class SehExceptionInTearDownTest : public Test {
- protected:
- virtual void TearDown() { RaiseException(42, 0, 0, NULL); }
-};
-
-TEST_F(SehExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
-
-TEST(SehExceptionTest, ThrowsSehException) {
- RaiseException(42, 0, 0, NULL);
-}
-
-#endif // GTEST_HAS_SEH
-
-#if GTEST_HAS_EXCEPTIONS
-
-class CxxExceptionInConstructorTest : public Test {
- public:
- CxxExceptionInConstructorTest() {
- // Without this macro VC++ complains about unreachable code at the end of
- // the constructor.
- GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(
- throw std::runtime_error("Standard C++ exception"));
- }
-
- static void TearDownTestSuite() {
- printf("%s",
- "CxxExceptionInConstructorTest::TearDownTestSuite() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInConstructorTest() override {
- ADD_FAILURE() << "CxxExceptionInConstructorTest destructor "
- << "called unexpectedly.";
- }
-
- void SetUp() override {
- ADD_FAILURE() << "CxxExceptionInConstructorTest::SetUp() "
- << "called unexpectedly.";
- }
-
- void TearDown() override {
- ADD_FAILURE() << "CxxExceptionInConstructorTest::TearDown() "
- << "called unexpectedly.";
- }
-};
-
-TEST_F(CxxExceptionInConstructorTest, ThrowsExceptionInConstructor) {
- ADD_FAILURE() << "CxxExceptionInConstructorTest test body "
- << "called unexpectedly.";
-}
-
-class CxxExceptionInSetUpTestSuiteTest : public Test {
- public:
- CxxExceptionInSetUpTestSuiteTest() {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest constructor "
- "called as expected.\n");
- }
-
- static void SetUpTestSuite() {
- throw std::runtime_error("Standard C++ exception");
- }
-
- static void TearDownTestSuite() {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest::TearDownTestSuite() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInSetUpTestSuiteTest() override {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest destructor "
- "called as expected.\n");
- }
-
- void SetUp() override {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest::SetUp() "
- "called as expected.\n");
- }
-
- void TearDown() override {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInSetUpTestSuiteTest, ThrowsExceptionInSetUpTestSuite) {
- printf("%s",
- "CxxExceptionInSetUpTestSuiteTest test body "
- "called as expected.\n");
-}
-
-class CxxExceptionInTearDownTestSuiteTest : public Test {
- public:
- static void TearDownTestSuite() {
- throw std::runtime_error("Standard C++ exception");
- }
-};
-
-TEST_F(CxxExceptionInTearDownTestSuiteTest,
- ThrowsExceptionInTearDownTestSuite) {}
-
-class CxxExceptionInSetUpTest : public Test {
- public:
- static void TearDownTestSuite() {
- printf("%s",
- "CxxExceptionInSetUpTest::TearDownTestSuite() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInSetUpTest() override {
- printf("%s",
- "CxxExceptionInSetUpTest destructor "
- "called as expected.\n");
- }
-
- void SetUp() override { throw std::runtime_error("Standard C++ exception"); }
-
- void TearDown() override {
- printf("%s",
- "CxxExceptionInSetUpTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInSetUpTest, ThrowsExceptionInSetUp) {
- ADD_FAILURE() << "CxxExceptionInSetUpTest test body "
- << "called unexpectedly.";
-}
-
-class CxxExceptionInTearDownTest : public Test {
- public:
- static void TearDownTestSuite() {
- printf("%s",
- "CxxExceptionInTearDownTest::TearDownTestSuite() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInTearDownTest() override {
- printf("%s",
- "CxxExceptionInTearDownTest destructor "
- "called as expected.\n");
- }
-
- void TearDown() override {
- throw std::runtime_error("Standard C++ exception");
- }
-};
-
-TEST_F(CxxExceptionInTearDownTest, ThrowsExceptionInTearDown) {}
-
-class CxxExceptionInTestBodyTest : public Test {
- public:
- static void TearDownTestSuite() {
- printf("%s",
- "CxxExceptionInTestBodyTest::TearDownTestSuite() "
- "called as expected.\n");
- }
-
- protected:
- ~CxxExceptionInTestBodyTest() override {
- printf("%s",
- "CxxExceptionInTestBodyTest destructor "
- "called as expected.\n");
- }
-
- void TearDown() override {
- printf("%s",
- "CxxExceptionInTestBodyTest::TearDown() "
- "called as expected.\n");
- }
-};
-
-TEST_F(CxxExceptionInTestBodyTest, ThrowsStdCxxException) {
- throw std::runtime_error("Standard C++ exception");
-}
-
-TEST(CxxExceptionTest, ThrowsNonStdCxxException) {
- throw "C-string";
-}
-
-// This terminate handler aborts the program using exit() rather than abort().
-// This avoids showing pop-ups on Windows systems and core dumps on Unix-like
-// ones.
-void TerminateHandler() {
- fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program.");
- fflush(nullptr);
- exit(3);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-int main(int argc, char** argv) {
-#if GTEST_HAS_EXCEPTIONS
- std::set_terminate(&TerminateHandler);
-#endif
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test.py
deleted file mode 100755
index c22752db82..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test.py
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test correctly determines whether to use colors."""
-
-import os
-from googletest.test import gtest_test_utils
-
-IS_WINDOWS = os.name == 'nt'
-
-COLOR_ENV_VAR = 'GTEST_COLOR'
-COLOR_FLAG = 'gtest_color'
-COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-color-test_')
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- os.environ[env_var] = value
- elif env_var in os.environ:
- del os.environ[env_var]
-
-
-def UsesColor(term, color_env_var, color_flag):
- """Runs googletest-color-test_ and returns its exit code."""
-
- SetEnvVar('TERM', term)
- SetEnvVar(COLOR_ENV_VAR, color_env_var)
-
- if color_flag is None:
- args = []
- else:
- args = ['--%s=%s' % (COLOR_FLAG, color_flag)]
- p = gtest_test_utils.Subprocess([COMMAND] + args)
- return not p.exited or p.exit_code
-
-
-class GTestColorTest(gtest_test_utils.TestCase):
- def testNoEnvVarNoFlag(self):
- """Tests the case when there's neither GTEST_COLOR nor --gtest_color."""
-
- if not IS_WINDOWS:
- self.assert_(not UsesColor('dumb', None, None))
- self.assert_(not UsesColor('emacs', None, None))
- self.assert_(not UsesColor('xterm-mono', None, None))
- self.assert_(not UsesColor('unknown', None, None))
- self.assert_(not UsesColor(None, None, None))
- self.assert_(UsesColor('linux', None, None))
- self.assert_(UsesColor('cygwin', None, None))
- self.assert_(UsesColor('xterm', None, None))
- self.assert_(UsesColor('xterm-color', None, None))
- self.assert_(UsesColor('xterm-256color', None, None))
-
- def testFlagOnly(self):
- """Tests the case when there's --gtest_color but not GTEST_COLOR."""
-
- self.assert_(not UsesColor('dumb', None, 'no'))
- self.assert_(not UsesColor('xterm-color', None, 'no'))
- if not IS_WINDOWS:
- self.assert_(not UsesColor('emacs', None, 'auto'))
- self.assert_(UsesColor('xterm', None, 'auto'))
- self.assert_(UsesColor('dumb', None, 'yes'))
- self.assert_(UsesColor('xterm', None, 'yes'))
-
- def testEnvVarOnly(self):
- """Tests the case when there's GTEST_COLOR but not --gtest_color."""
-
- self.assert_(not UsesColor('dumb', 'no', None))
- self.assert_(not UsesColor('xterm-color', 'no', None))
- if not IS_WINDOWS:
- self.assert_(not UsesColor('dumb', 'auto', None))
- self.assert_(UsesColor('xterm-color', 'auto', None))
- self.assert_(UsesColor('dumb', 'yes', None))
- self.assert_(UsesColor('xterm-color', 'yes', None))
-
- def testEnvVarAndFlag(self):
- """Tests the case when there are both GTEST_COLOR and --gtest_color."""
-
- self.assert_(not UsesColor('xterm-color', 'no', 'no'))
- self.assert_(UsesColor('dumb', 'no', 'yes'))
- self.assert_(UsesColor('xterm-color', 'no', 'auto'))
-
- def testAliasesOfYesAndNo(self):
- """Tests using aliases in specifying --gtest_color."""
-
- self.assert_(UsesColor('dumb', None, 'true'))
- self.assert_(UsesColor('dumb', None, 'YES'))
- self.assert_(UsesColor('dumb', None, 'T'))
- self.assert_(UsesColor('dumb', None, '1'))
-
- self.assert_(not UsesColor('xterm', None, 'f'))
- self.assert_(not UsesColor('xterm', None, 'false'))
- self.assert_(not UsesColor('xterm', None, '0'))
- self.assert_(not UsesColor('xterm', None, 'unknown'))
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test_.cc
deleted file mode 100644
index 220a3a0054..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-color-test_.cc
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// A helper program for testing how Google Test determines whether to use
-// colors in the output. It prints "YES" and returns 1 if Google Test
-// decides to use colors, and prints "NO" and returns 0 otherwise.
-
-#include <stdio.h>
-
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-using testing::internal::ShouldUseColor;
-
-// The purpose of this is to ensure that the UnitTest singleton is
-// created before main() is entered, and thus that ShouldUseColor()
-// works the same way as in a real Google-Test-based test. We don't actual
-// run the TEST itself.
-TEST(GTestColorTest, Dummy) {
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- if (ShouldUseColor(true)) {
- // Google Test decides to use colors in the output (assuming it
- // goes to a TTY).
- printf("YES\n");
- return 1;
- } else {
- // Google Test decides not to use colors in the output.
- printf("NO\n");
- return 0;
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test-test.cc
deleted file mode 100644
index 62a84b478a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test-test.cc
+++ /dev/null
@@ -1,1528 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for death tests.
-
-#include "gtest/gtest-death-test.h"
-
-#include "gtest/gtest.h"
-#include "gtest/internal/gtest-filepath.h"
-
-using testing::internal::AlwaysFalse;
-using testing::internal::AlwaysTrue;
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_OS_WINDOWS
-# include <fcntl.h> // For O_BINARY
-# include <direct.h> // For chdir().
-# include <io.h>
-# else
-# include <unistd.h>
-# include <sys/wait.h> // For waitpid.
-# endif // GTEST_OS_WINDOWS
-
-# include <limits.h>
-# include <signal.h>
-# include <stdio.h>
-
-# if GTEST_OS_LINUX
-# include <sys/time.h>
-# endif // GTEST_OS_LINUX
-
-# include "gtest/gtest-spi.h"
-# include "src/gtest-internal-inl.h"
-
-namespace posix = ::testing::internal::posix;
-
-using testing::ContainsRegex;
-using testing::Matcher;
-using testing::Message;
-using testing::internal::DeathTest;
-using testing::internal::DeathTestFactory;
-using testing::internal::FilePath;
-using testing::internal::GetLastErrnoDescription;
-using testing::internal::GetUnitTestImpl;
-using testing::internal::InDeathTestChild;
-using testing::internal::ParseNaturalNumber;
-
-namespace testing {
-namespace internal {
-
-// A helper class whose objects replace the death test factory for a
-// single UnitTest object during their lifetimes.
-class ReplaceDeathTestFactory {
- public:
- explicit ReplaceDeathTestFactory(DeathTestFactory* new_factory)
- : unit_test_impl_(GetUnitTestImpl()) {
- old_factory_ = unit_test_impl_->death_test_factory_.release();
- unit_test_impl_->death_test_factory_.reset(new_factory);
- }
-
- ~ReplaceDeathTestFactory() {
- unit_test_impl_->death_test_factory_.release();
- unit_test_impl_->death_test_factory_.reset(old_factory_);
- }
- private:
- // Prevents copying ReplaceDeathTestFactory objects.
- ReplaceDeathTestFactory(const ReplaceDeathTestFactory&);
- void operator=(const ReplaceDeathTestFactory&);
-
- UnitTestImpl* unit_test_impl_;
- DeathTestFactory* old_factory_;
-};
-
-} // namespace internal
-} // namespace testing
-
-namespace {
-
-void DieWithMessage(const ::std::string& message) {
- fprintf(stderr, "%s", message.c_str());
- fflush(stderr); // Make sure the text is printed before the process exits.
-
- // We call _exit() instead of exit(), as the former is a direct
- // system call and thus safer in the presence of threads. exit()
- // will invoke user-defined exit-hooks, which may do dangerous
- // things that conflict with death tests.
- //
- // Some compilers can recognize that _exit() never returns and issue the
- // 'unreachable code' warning for code following this function, unless
- // fooled by a fake condition.
- if (AlwaysTrue())
- _exit(1);
-}
-
-void DieInside(const ::std::string& function) {
- DieWithMessage("death inside " + function + "().");
-}
-
-// Tests that death tests work.
-
-class TestForDeathTest : public testing::Test {
- protected:
- TestForDeathTest() : original_dir_(FilePath::GetCurrentDir()) {}
-
- ~TestForDeathTest() override { posix::ChDir(original_dir_.c_str()); }
-
- // A static member function that's expected to die.
- static void StaticMemberFunction() { DieInside("StaticMemberFunction"); }
-
- // A method of the test fixture that may die.
- void MemberFunction() {
- if (should_die_)
- DieInside("MemberFunction");
- }
-
- // True if and only if MemberFunction() should die.
- bool should_die_;
- const FilePath original_dir_;
-};
-
-// A class with a member function that may die.
-class MayDie {
- public:
- explicit MayDie(bool should_die) : should_die_(should_die) {}
-
- // A member function that may die.
- void MemberFunction() const {
- if (should_die_)
- DieInside("MayDie::MemberFunction");
- }
-
- private:
- // True if and only if MemberFunction() should die.
- bool should_die_;
-};
-
-// A global function that's expected to die.
-void GlobalFunction() { DieInside("GlobalFunction"); }
-
-// A non-void function that's expected to die.
-int NonVoidFunction() {
- DieInside("NonVoidFunction");
- return 1;
-}
-
-// A unary function that may die.
-void DieIf(bool should_die) {
- if (should_die)
- DieInside("DieIf");
-}
-
-// A binary function that may die.
-bool DieIfLessThan(int x, int y) {
- if (x < y) {
- DieInside("DieIfLessThan");
- }
- return true;
-}
-
-// Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
-void DeathTestSubroutine() {
- EXPECT_DEATH(GlobalFunction(), "death.*GlobalFunction");
- ASSERT_DEATH(GlobalFunction(), "death.*GlobalFunction");
-}
-
-// Death in dbg, not opt.
-int DieInDebugElse12(int* sideeffect) {
- if (sideeffect) *sideeffect = 12;
-
-# ifndef NDEBUG
-
- DieInside("DieInDebugElse12");
-
-# endif // NDEBUG
-
- return 12;
-}
-
-# if GTEST_OS_WINDOWS
-
-// Death in dbg due to Windows CRT assertion failure, not opt.
-int DieInCRTDebugElse12(int* sideeffect) {
- if (sideeffect) *sideeffect = 12;
-
- // Create an invalid fd by closing a valid one
- int fdpipe[2];
- EXPECT_EQ(_pipe(fdpipe, 256, O_BINARY), 0);
- EXPECT_EQ(_close(fdpipe[0]), 0);
- EXPECT_EQ(_close(fdpipe[1]), 0);
-
- // _dup() should crash in debug mode
- EXPECT_EQ(_dup(fdpipe[0]), -1);
-
- return 12;
-}
-
-#endif // GTEST_OS_WINDOWS
-
-# if GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
-// Tests the ExitedWithCode predicate.
-TEST(ExitStatusPredicateTest, ExitedWithCode) {
- // On Windows, the process's exit code is the same as its exit status,
- // so the predicate just compares the its input with its parameter.
- EXPECT_TRUE(testing::ExitedWithCode(0)(0));
- EXPECT_TRUE(testing::ExitedWithCode(1)(1));
- EXPECT_TRUE(testing::ExitedWithCode(42)(42));
- EXPECT_FALSE(testing::ExitedWithCode(0)(1));
- EXPECT_FALSE(testing::ExitedWithCode(1)(0));
-}
-
-# else
-
-// Returns the exit status of a process that calls _exit(2) with a
-// given exit code. This is a helper function for the
-// ExitStatusPredicateTest test suite.
-static int NormalExitStatus(int exit_code) {
- pid_t child_pid = fork();
- if (child_pid == 0) {
- _exit(exit_code);
- }
- int status;
- waitpid(child_pid, &status, 0);
- return status;
-}
-
-// Returns the exit status of a process that raises a given signal.
-// If the signal does not cause the process to die, then it returns
-// instead the exit status of a process that exits normally with exit
-// code 1. This is a helper function for the ExitStatusPredicateTest
-// test suite.
-static int KilledExitStatus(int signum) {
- pid_t child_pid = fork();
- if (child_pid == 0) {
- raise(signum);
- _exit(1);
- }
- int status;
- waitpid(child_pid, &status, 0);
- return status;
-}
-
-// Tests the ExitedWithCode predicate.
-TEST(ExitStatusPredicateTest, ExitedWithCode) {
- const int status0 = NormalExitStatus(0);
- const int status1 = NormalExitStatus(1);
- const int status42 = NormalExitStatus(42);
- const testing::ExitedWithCode pred0(0);
- const testing::ExitedWithCode pred1(1);
- const testing::ExitedWithCode pred42(42);
- EXPECT_PRED1(pred0, status0);
- EXPECT_PRED1(pred1, status1);
- EXPECT_PRED1(pred42, status42);
- EXPECT_FALSE(pred0(status1));
- EXPECT_FALSE(pred42(status0));
- EXPECT_FALSE(pred1(status42));
-}
-
-// Tests the KilledBySignal predicate.
-TEST(ExitStatusPredicateTest, KilledBySignal) {
- const int status_segv = KilledExitStatus(SIGSEGV);
- const int status_kill = KilledExitStatus(SIGKILL);
- const testing::KilledBySignal pred_segv(SIGSEGV);
- const testing::KilledBySignal pred_kill(SIGKILL);
- EXPECT_PRED1(pred_segv, status_segv);
- EXPECT_PRED1(pred_kill, status_kill);
- EXPECT_FALSE(pred_segv(status_kill));
- EXPECT_FALSE(pred_kill(status_segv));
-}
-
-# endif // GTEST_OS_WINDOWS || GTEST_OS_FUCHSIA
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-// Tests that the death test macros expand to code which may or may not
-// be followed by operator<<, and that in either case the complete text
-// comprises only a single C++ statement.
-TEST_F(TestForDeathTest, SingleStatement) {
- if (AlwaysFalse())
- // This would fail if executed; this is a compilation test only
- ASSERT_DEATH(return, "");
-
- if (AlwaysTrue())
- EXPECT_DEATH(_exit(1), "");
- else
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
- // doesn't expand into an "if" statement without an "else"
- ;
-
- if (AlwaysFalse())
- ASSERT_DEATH(return, "") << "did not die";
-
- if (AlwaysFalse())
- ;
- else
- EXPECT_DEATH(_exit(1), "") << 1 << 2 << 3;
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-# if GTEST_USES_PCRE
-
-void DieWithEmbeddedNul() {
- fprintf(stderr, "Hello%cmy null world.\n", '\0');
- fflush(stderr);
- _exit(1);
-}
-
-// Tests that EXPECT_DEATH and ASSERT_DEATH work when the error
-// message has a NUL character in it.
-TEST_F(TestForDeathTest, EmbeddedNulInMessage) {
- EXPECT_DEATH(DieWithEmbeddedNul(), "my null world");
- ASSERT_DEATH(DieWithEmbeddedNul(), "my null world");
-}
-
-# endif // GTEST_USES_PCRE
-
-// Tests that death test macros expand to code which interacts well with switch
-// statements.
-TEST_F(TestForDeathTest, SwitchStatement) {
- // Microsoft compiler usually complains about switch statements without
- // case labels. We suppress that warning for this test.
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4065)
-
- switch (0)
- default:
- ASSERT_DEATH(_exit(1), "") << "exit in default switch handler";
-
- switch (0)
- case 0:
- EXPECT_DEATH(_exit(1), "") << "exit in switch case";
-
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-}
-
-// Tests that a static member function can be used in a "fast" style
-// death test.
-TEST_F(TestForDeathTest, StaticMemberFunctionFastStyle) {
- GTEST_FLAG_SET(death_test_style, "fast");
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
-}
-
-// Tests that a method of the test fixture can be used in a "fast"
-// style death test.
-TEST_F(TestForDeathTest, MemberFunctionFastStyle) {
- GTEST_FLAG_SET(death_test_style, "fast");
- should_die_ = true;
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
-}
-
-void ChangeToRootDir() { posix::ChDir(GTEST_PATH_SEP_); }
-
-// Tests that death tests work even if the current directory has been
-// changed.
-TEST_F(TestForDeathTest, FastDeathTestInChangedDir) {
- GTEST_FLAG_SET(death_test_style, "fast");
-
- ChangeToRootDir();
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
-
- ChangeToRootDir();
- ASSERT_DEATH(_exit(1), "");
-}
-
-# if GTEST_OS_LINUX
-void SigprofAction(int, siginfo_t*, void*) { /* no op */ }
-
-// Sets SIGPROF action and ITIMER_PROF timer (interval: 1ms).
-void SetSigprofActionAndTimer() {
- struct sigaction signal_action;
- memset(&signal_action, 0, sizeof(signal_action));
- sigemptyset(&signal_action.sa_mask);
- signal_action.sa_sigaction = SigprofAction;
- signal_action.sa_flags = SA_RESTART | SA_SIGINFO;
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, nullptr));
- // timer comes second, to avoid SIGPROF premature delivery, as suggested at
- // https://www.gnu.org/software/libc/manual/html_node/Setting-an-Alarm.html
- struct itimerval timer;
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 1;
- timer.it_value = timer.it_interval;
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, nullptr));
-}
-
-// Disables ITIMER_PROF timer and ignores SIGPROF signal.
-void DisableSigprofActionAndTimer(struct sigaction* old_signal_action) {
- struct itimerval timer;
- timer.it_interval.tv_sec = 0;
- timer.it_interval.tv_usec = 0;
- timer.it_value = timer.it_interval;
- ASSERT_EQ(0, setitimer(ITIMER_PROF, &timer, nullptr));
- struct sigaction signal_action;
- memset(&signal_action, 0, sizeof(signal_action));
- sigemptyset(&signal_action.sa_mask);
- signal_action.sa_handler = SIG_IGN;
- ASSERT_EQ(0, sigaction(SIGPROF, &signal_action, old_signal_action));
-}
-
-// Tests that death tests work when SIGPROF handler and timer are set.
-TEST_F(TestForDeathTest, FastSigprofActionSet) {
- GTEST_FLAG_SET(death_test_style, "fast");
- SetSigprofActionAndTimer();
- EXPECT_DEATH(_exit(1), "");
- struct sigaction old_signal_action;
- DisableSigprofActionAndTimer(&old_signal_action);
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
-}
-
-TEST_F(TestForDeathTest, ThreadSafeSigprofActionSet) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- SetSigprofActionAndTimer();
- EXPECT_DEATH(_exit(1), "");
- struct sigaction old_signal_action;
- DisableSigprofActionAndTimer(&old_signal_action);
- EXPECT_TRUE(old_signal_action.sa_sigaction == SigprofAction);
-}
-# endif // GTEST_OS_LINUX
-
-// Repeats a representative sample of death tests in the "threadsafe" style:
-
-TEST_F(TestForDeathTest, StaticMemberFunctionThreadsafeStyle) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- ASSERT_DEATH(StaticMemberFunction(), "death.*StaticMember");
-}
-
-TEST_F(TestForDeathTest, MemberFunctionThreadsafeStyle) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- should_die_ = true;
- EXPECT_DEATH(MemberFunction(), "inside.*MemberFunction");
-}
-
-TEST_F(TestForDeathTest, ThreadsafeDeathTestInLoop) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
-
- for (int i = 0; i < 3; ++i)
- EXPECT_EXIT(_exit(i), testing::ExitedWithCode(i), "") << ": i = " << i;
-}
-
-TEST_F(TestForDeathTest, ThreadsafeDeathTestInChangedDir) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
-
- ChangeToRootDir();
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
-
- ChangeToRootDir();
- ASSERT_DEATH(_exit(1), "");
-}
-
-TEST_F(TestForDeathTest, MixedStyles) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- EXPECT_DEATH(_exit(1), "");
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_DEATH(_exit(1), "");
-}
-
-# if GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
-
-bool pthread_flag;
-
-void SetPthreadFlag() {
- pthread_flag = true;
-}
-
-TEST_F(TestForDeathTest, DoesNotExecuteAtforkHooks) {
- if (!GTEST_FLAG_GET(death_test_use_fork)) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- pthread_flag = false;
- ASSERT_EQ(0, pthread_atfork(&SetPthreadFlag, nullptr, nullptr));
- ASSERT_DEATH(_exit(1), "");
- ASSERT_FALSE(pthread_flag);
- }
-}
-
-# endif // GTEST_HAS_CLONE && GTEST_HAS_PTHREAD
-
-// Tests that a method of another class can be used in a death test.
-TEST_F(TestForDeathTest, MethodOfAnotherClass) {
- const MayDie x(true);
- ASSERT_DEATH(x.MemberFunction(), "MayDie\\:\\:MemberFunction");
-}
-
-// Tests that a global function can be used in a death test.
-TEST_F(TestForDeathTest, GlobalFunction) {
- EXPECT_DEATH(GlobalFunction(), "GlobalFunction");
-}
-
-// Tests that any value convertible to an RE works as a second
-// argument to EXPECT_DEATH.
-TEST_F(TestForDeathTest, AcceptsAnythingConvertibleToRE) {
- static const char regex_c_str[] = "GlobalFunction";
- EXPECT_DEATH(GlobalFunction(), regex_c_str);
-
- const testing::internal::RE regex(regex_c_str);
- EXPECT_DEATH(GlobalFunction(), regex);
-
-# if !GTEST_USES_PCRE
-
- const ::std::string regex_std_str(regex_c_str);
- EXPECT_DEATH(GlobalFunction(), regex_std_str);
-
- // This one is tricky; a temporary pointer into another temporary. Reference
- // lifetime extension of the pointer is not sufficient.
- EXPECT_DEATH(GlobalFunction(), ::std::string(regex_c_str).c_str());
-
-# endif // !GTEST_USES_PCRE
-}
-
-// Tests that a non-void function can be used in a death test.
-TEST_F(TestForDeathTest, NonVoidFunction) {
- ASSERT_DEATH(NonVoidFunction(), "NonVoidFunction");
-}
-
-// Tests that functions that take parameter(s) can be used in a death test.
-TEST_F(TestForDeathTest, FunctionWithParameter) {
- EXPECT_DEATH(DieIf(true), "DieIf\\(\\)");
- EXPECT_DEATH(DieIfLessThan(2, 3), "DieIfLessThan");
-}
-
-// Tests that ASSERT_DEATH can be used outside a TEST, TEST_F, or test fixture.
-TEST_F(TestForDeathTest, OutsideFixture) {
- DeathTestSubroutine();
-}
-
-// Tests that death tests can be done inside a loop.
-TEST_F(TestForDeathTest, InsideLoop) {
- for (int i = 0; i < 5; i++) {
- EXPECT_DEATH(DieIfLessThan(-1, i), "DieIfLessThan") << "where i == " << i;
- }
-}
-
-// Tests that a compound statement can be used in a death test.
-TEST_F(TestForDeathTest, CompoundStatement) {
- EXPECT_DEATH({ // NOLINT
- const int x = 2;
- const int y = x + 1;
- DieIfLessThan(x, y);
- },
- "DieIfLessThan");
-}
-
-// Tests that code that doesn't die causes a death test to fail.
-TEST_F(TestForDeathTest, DoesNotDie) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(DieIf(false), "DieIf"),
- "failed to die");
-}
-
-// Tests that a death test fails when the error message isn't expected.
-TEST_F(TestForDeathTest, ErrorMessageMismatch) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(DieIf(true), "DieIfLessThan") << "End of death test message.";
- }, "died but not with expected error");
-}
-
-// On exit, *aborted will be true if and only if the EXPECT_DEATH()
-// statement aborted the function.
-void ExpectDeathTestHelper(bool* aborted) {
- *aborted = true;
- EXPECT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
- *aborted = false;
-}
-
-// Tests that EXPECT_DEATH doesn't abort the test on failure.
-TEST_F(TestForDeathTest, EXPECT_DEATH) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(ExpectDeathTestHelper(&aborted),
- "failed to die");
- EXPECT_FALSE(aborted);
-}
-
-// Tests that ASSERT_DEATH does abort the test on failure.
-TEST_F(TestForDeathTest, ASSERT_DEATH) {
- static bool aborted;
- EXPECT_FATAL_FAILURE({ // NOLINT
- aborted = true;
- ASSERT_DEATH(DieIf(false), "DieIf"); // This assertion should fail.
- aborted = false;
- }, "failed to die");
- EXPECT_TRUE(aborted);
-}
-
-// Tests that EXPECT_DEATH evaluates the arguments exactly once.
-TEST_F(TestForDeathTest, SingleEvaluation) {
- int x = 3;
- EXPECT_DEATH(DieIf((++x) == 4), "DieIf");
-
- const char* regex = "DieIf";
- const char* regex_save = regex;
- EXPECT_DEATH(DieIfLessThan(3, 4), regex++);
- EXPECT_EQ(regex_save + 1, regex);
-}
-
-// Tests that run-away death tests are reported as failures.
-TEST_F(TestForDeathTest, RunawayIsFailure) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(static_cast<void>(0), "Foo"),
- "failed to die.");
-}
-
-// Tests that death tests report executing 'return' in the statement as
-// failure.
-TEST_F(TestForDeathTest, ReturnIsFailure) {
- EXPECT_FATAL_FAILURE(ASSERT_DEATH(return, "Bar"),
- "illegal return in test statement.");
-}
-
-// Tests that EXPECT_DEBUG_DEATH works as expected, that is, you can stream a
-// message to it, and in debug mode it:
-// 1. Asserts on death.
-// 2. Has no side effect.
-//
-// And in opt mode, it:
-// 1. Has side effects but does not assert.
-TEST_F(TestForDeathTest, TestExpectDebugDeath) {
- int sideeffect = 0;
-
- // Put the regex in a local variable to make sure we don't get an "unused"
- // warning in opt mode.
- const char* regex = "death.*DieInDebugElse12";
-
- EXPECT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), regex)
- << "Must accept a streamed message";
-
-# ifdef NDEBUG
-
- // Checks that the assignment occurs in opt mode (sideeffect).
- EXPECT_EQ(12, sideeffect);
-
-# else
-
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
- EXPECT_EQ(0, sideeffect);
-
-# endif
-}
-
-# if GTEST_OS_WINDOWS
-
-// https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/crtsetreportmode
-// In debug mode, the calls to _CrtSetReportMode and _CrtSetReportFile enable
-// the dumping of assertions to stderr. Tests that EXPECT_DEATH works as
-// expected when in CRT debug mode (compiled with /MTd or /MDd, which defines
-// _DEBUG) the Windows CRT crashes the process with an assertion failure.
-// 1. Asserts on death.
-// 2. Has no side effect (doesn't pop up a window or wait for user input).
-#ifdef _DEBUG
-TEST_F(TestForDeathTest, CRTDebugDeath) {
- EXPECT_DEATH(DieInCRTDebugElse12(nullptr), "dup.* : Assertion failed")
- << "Must accept a streamed message";
-}
-#endif // _DEBUG
-
-# endif // GTEST_OS_WINDOWS
-
-// Tests that ASSERT_DEBUG_DEATH works as expected, that is, you can stream a
-// message to it, and in debug mode it:
-// 1. Asserts on death.
-// 2. Has no side effect.
-//
-// And in opt mode, it:
-// 1. Has side effects but does not assert.
-TEST_F(TestForDeathTest, TestAssertDebugDeath) {
- int sideeffect = 0;
-
- ASSERT_DEBUG_DEATH(DieInDebugElse12(&sideeffect), "death.*DieInDebugElse12")
- << "Must accept a streamed message";
-
-# ifdef NDEBUG
-
- // Checks that the assignment occurs in opt mode (sideeffect).
- EXPECT_EQ(12, sideeffect);
-
-# else
-
- // Checks that the assignment does not occur in dbg mode (no sideeffect).
- EXPECT_EQ(0, sideeffect);
-
-# endif
-}
-
-# ifndef NDEBUG
-
-void ExpectDebugDeathHelper(bool* aborted) {
- *aborted = true;
- EXPECT_DEBUG_DEATH(return, "") << "This is expected to fail.";
- *aborted = false;
-}
-
-# if GTEST_OS_WINDOWS
-TEST(PopUpDeathTest, DoesNotShowPopUpOnAbort) {
- printf("This test should be considered failing if it shows "
- "any pop-up dialogs.\n");
- fflush(stdout);
-
- EXPECT_DEATH(
- {
- GTEST_FLAG_SET(catch_exceptions, false);
- abort();
- },
- "");
-}
-# endif // GTEST_OS_WINDOWS
-
-// Tests that EXPECT_DEBUG_DEATH in debug mode does not abort
-// the function.
-TEST_F(TestForDeathTest, ExpectDebugDeathDoesNotAbort) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(ExpectDebugDeathHelper(&aborted), "");
- EXPECT_FALSE(aborted);
-}
-
-void AssertDebugDeathHelper(bool* aborted) {
- *aborted = true;
- GTEST_LOG_(INFO) << "Before ASSERT_DEBUG_DEATH";
- ASSERT_DEBUG_DEATH(GTEST_LOG_(INFO) << "In ASSERT_DEBUG_DEATH"; return, "")
- << "This is expected to fail.";
- GTEST_LOG_(INFO) << "After ASSERT_DEBUG_DEATH";
- *aborted = false;
-}
-
-// Tests that ASSERT_DEBUG_DEATH in debug mode aborts the function on
-// failure.
-TEST_F(TestForDeathTest, AssertDebugDeathAborts) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts2) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts3) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts4) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts5) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts6) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts7) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts8) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts9) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-TEST_F(TestForDeathTest, AssertDebugDeathAborts10) {
- static bool aborted;
- aborted = false;
- EXPECT_FATAL_FAILURE(AssertDebugDeathHelper(&aborted), "");
- EXPECT_TRUE(aborted);
-}
-
-# endif // _NDEBUG
-
-// Tests the *_EXIT family of macros, using a variety of predicates.
-static void TestExitMacros() {
- EXPECT_EXIT(_exit(1), testing::ExitedWithCode(1), "");
- ASSERT_EXIT(_exit(42), testing::ExitedWithCode(42), "");
-
-# if GTEST_OS_WINDOWS
-
- // Of all signals effects on the process exit code, only those of SIGABRT
- // are documented on Windows.
- // See https://msdn.microsoft.com/en-us/query-bi/m/dwwzkt4c.
- EXPECT_EXIT(raise(SIGABRT), testing::ExitedWithCode(3), "") << "b_ar";
-
-# elif !GTEST_OS_FUCHSIA
-
- // Fuchsia has no unix signals.
- EXPECT_EXIT(raise(SIGKILL), testing::KilledBySignal(SIGKILL), "") << "foo";
- ASSERT_EXIT(raise(SIGUSR2), testing::KilledBySignal(SIGUSR2), "") << "bar";
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EXIT(_exit(0), testing::KilledBySignal(SIGSEGV), "")
- << "This failure is expected, too.";
- }, "This failure is expected, too.");
-
-# endif // GTEST_OS_WINDOWS
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_EXIT(raise(SIGSEGV), testing::ExitedWithCode(0), "")
- << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-TEST_F(TestForDeathTest, ExitMacros) {
- TestExitMacros();
-}
-
-TEST_F(TestForDeathTest, ExitMacrosUsingFork) {
- GTEST_FLAG_SET(death_test_use_fork, true);
- TestExitMacros();
-}
-
-TEST_F(TestForDeathTest, InvalidStyle) {
- GTEST_FLAG_SET(death_test_style, "rococo");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(_exit(0), "") << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-TEST_F(TestForDeathTest, DeathTestFailedOutput) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(DieWithMessage("death\n"),
- "expected message"),
- "Actual msg:\n"
- "[ DEATH ] death\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestUnexpectedReturnOutput) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH({
- fprintf(stderr, "returning\n");
- fflush(stderr);
- return;
- }, ""),
- " Result: illegal return in test statement.\n"
- " Error msg:\n"
- "[ DEATH ] returning\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestBadExitCodeOutput) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_EXIT(DieWithMessage("exiting with rc 1\n"),
- testing::ExitedWithCode(3),
- "expected message"),
- " Result: died but not with expected exit code:\n"
- " Exited with exit status 1\n"
- "Actual msg:\n"
- "[ DEATH ] exiting with rc 1\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestMultiLineMatchFail) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
- "line 1\nxyz\nline 3\n"),
- "Actual msg:\n"
- "[ DEATH ] line 1\n"
- "[ DEATH ] line 2\n"
- "[ DEATH ] line 3\n");
-}
-
-TEST_F(TestForDeathTest, DeathTestMultiLineMatchPass) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_DEATH(DieWithMessage("line 1\nline 2\nline 3\n"),
- "line 1\nline 2\nline 3\n");
-}
-
-// A DeathTestFactory that returns MockDeathTests.
-class MockDeathTestFactory : public DeathTestFactory {
- public:
- MockDeathTestFactory();
- bool Create(const char* statement,
- testing::Matcher<const std::string&> matcher, const char* file,
- int line, DeathTest** test) override;
-
- // Sets the parameters for subsequent calls to Create.
- void SetParameters(bool create, DeathTest::TestRole role,
- int status, bool passed);
-
- // Accessors.
- int AssumeRoleCalls() const { return assume_role_calls_; }
- int WaitCalls() const { return wait_calls_; }
- size_t PassedCalls() const { return passed_args_.size(); }
- bool PassedArgument(int n) const {
- return passed_args_[static_cast<size_t>(n)];
- }
- size_t AbortCalls() const { return abort_args_.size(); }
- DeathTest::AbortReason AbortArgument(int n) const {
- return abort_args_[static_cast<size_t>(n)];
- }
- bool TestDeleted() const { return test_deleted_; }
-
- private:
- friend class MockDeathTest;
- // If true, Create will return a MockDeathTest; otherwise it returns
- // NULL.
- bool create_;
- // The value a MockDeathTest will return from its AssumeRole method.
- DeathTest::TestRole role_;
- // The value a MockDeathTest will return from its Wait method.
- int status_;
- // The value a MockDeathTest will return from its Passed method.
- bool passed_;
-
- // Number of times AssumeRole was called.
- int assume_role_calls_;
- // Number of times Wait was called.
- int wait_calls_;
- // The arguments to the calls to Passed since the last call to
- // SetParameters.
- std::vector<bool> passed_args_;
- // The arguments to the calls to Abort since the last call to
- // SetParameters.
- std::vector<DeathTest::AbortReason> abort_args_;
- // True if the last MockDeathTest returned by Create has been
- // deleted.
- bool test_deleted_;
-};
-
-
-// A DeathTest implementation useful in testing. It returns values set
-// at its creation from its various inherited DeathTest methods, and
-// reports calls to those methods to its parent MockDeathTestFactory
-// object.
-class MockDeathTest : public DeathTest {
- public:
- MockDeathTest(MockDeathTestFactory *parent,
- TestRole role, int status, bool passed) :
- parent_(parent), role_(role), status_(status), passed_(passed) {
- }
- ~MockDeathTest() override { parent_->test_deleted_ = true; }
- TestRole AssumeRole() override {
- ++parent_->assume_role_calls_;
- return role_;
- }
- int Wait() override {
- ++parent_->wait_calls_;
- return status_;
- }
- bool Passed(bool exit_status_ok) override {
- parent_->passed_args_.push_back(exit_status_ok);
- return passed_;
- }
- void Abort(AbortReason reason) override {
- parent_->abort_args_.push_back(reason);
- }
-
- private:
- MockDeathTestFactory* const parent_;
- const TestRole role_;
- const int status_;
- const bool passed_;
-};
-
-
-// MockDeathTestFactory constructor.
-MockDeathTestFactory::MockDeathTestFactory()
- : create_(true),
- role_(DeathTest::OVERSEE_TEST),
- status_(0),
- passed_(true),
- assume_role_calls_(0),
- wait_calls_(0),
- passed_args_(),
- abort_args_() {
-}
-
-
-// Sets the parameters for subsequent calls to Create.
-void MockDeathTestFactory::SetParameters(bool create,
- DeathTest::TestRole role,
- int status, bool passed) {
- create_ = create;
- role_ = role;
- status_ = status;
- passed_ = passed;
-
- assume_role_calls_ = 0;
- wait_calls_ = 0;
- passed_args_.clear();
- abort_args_.clear();
-}
-
-
-// Sets test to NULL (if create_ is false) or to the address of a new
-// MockDeathTest object with parameters taken from the last call
-// to SetParameters (if create_ is true). Always returns true.
-bool MockDeathTestFactory::Create(
- const char* /*statement*/, testing::Matcher<const std::string&> /*matcher*/,
- const char* /*file*/, int /*line*/, DeathTest** test) {
- test_deleted_ = false;
- if (create_) {
- *test = new MockDeathTest(this, role_, status_, passed_);
- } else {
- *test = nullptr;
- }
- return true;
-}
-
-// A test fixture for testing the logic of the GTEST_DEATH_TEST_ macro.
-// It installs a MockDeathTestFactory that is used for the duration
-// of the test case.
-class MacroLogicDeathTest : public testing::Test {
- protected:
- static testing::internal::ReplaceDeathTestFactory* replacer_;
- static MockDeathTestFactory* factory_;
-
- static void SetUpTestSuite() {
- factory_ = new MockDeathTestFactory;
- replacer_ = new testing::internal::ReplaceDeathTestFactory(factory_);
- }
-
- static void TearDownTestSuite() {
- delete replacer_;
- replacer_ = nullptr;
- delete factory_;
- factory_ = nullptr;
- }
-
- // Runs a death test that breaks the rules by returning. Such a death
- // test cannot be run directly from a test routine that uses a
- // MockDeathTest, or the remainder of the routine will not be executed.
- static void RunReturningDeathTest(bool* flag) {
- ASSERT_DEATH({ // NOLINT
- *flag = true;
- return;
- }, "");
- }
-};
-
-testing::internal::ReplaceDeathTestFactory* MacroLogicDeathTest::replacer_ =
- nullptr;
-MockDeathTestFactory* MacroLogicDeathTest::factory_ = nullptr;
-
-// Test that nothing happens when the factory doesn't return a DeathTest:
-TEST_F(MacroLogicDeathTest, NothingHappens) {
- bool flag = false;
- factory_->SetParameters(false, DeathTest::OVERSEE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(0, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0U, factory_->PassedCalls());
- EXPECT_EQ(0U, factory_->AbortCalls());
- EXPECT_FALSE(factory_->TestDeleted());
-}
-
-// Test that the parent process doesn't run the death test code,
-// and that the Passed method returns false when the (simulated)
-// child process exits with status 0:
-TEST_F(MacroLogicDeathTest, ChildExitsSuccessfully) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(1, factory_->WaitCalls());
- ASSERT_EQ(1U, factory_->PassedCalls());
- EXPECT_FALSE(factory_->PassedArgument(0));
- EXPECT_EQ(0U, factory_->AbortCalls());
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the Passed method was given the argument "true" when
-// the (simulated) child process exits with status 1:
-TEST_F(MacroLogicDeathTest, ChildExitsUnsuccessfully) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::OVERSEE_TEST, 1, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_FALSE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(1, factory_->WaitCalls());
- ASSERT_EQ(1U, factory_->PassedCalls());
- EXPECT_TRUE(factory_->PassedArgument(0));
- EXPECT_EQ(0U, factory_->AbortCalls());
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the (simulated) child process executes the death test
-// code, and is aborted with the correct AbortReason if it
-// executes a return statement.
-TEST_F(MacroLogicDeathTest, ChildPerformsReturn) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
- RunReturningDeathTest(&flag);
- EXPECT_TRUE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0U, factory_->PassedCalls());
- EXPECT_EQ(1U, factory_->AbortCalls());
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
- factory_->AbortArgument(0));
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that the (simulated) child process is aborted with the
-// correct AbortReason if it does not die.
-TEST_F(MacroLogicDeathTest, ChildDoesNotDie) {
- bool flag = false;
- factory_->SetParameters(true, DeathTest::EXECUTE_TEST, 0, true);
- EXPECT_DEATH(flag = true, "");
- EXPECT_TRUE(flag);
- EXPECT_EQ(1, factory_->AssumeRoleCalls());
- EXPECT_EQ(0, factory_->WaitCalls());
- EXPECT_EQ(0U, factory_->PassedCalls());
- // This time there are two calls to Abort: one since the test didn't
- // die, and another from the ReturnSentinel when it's destroyed. The
- // sentinel normally isn't destroyed if a test doesn't die, since
- // _exit(2) is called in that case by ForkingDeathTest, but not by
- // our MockDeathTest.
- ASSERT_EQ(2U, factory_->AbortCalls());
- EXPECT_EQ(DeathTest::TEST_DID_NOT_DIE,
- factory_->AbortArgument(0));
- EXPECT_EQ(DeathTest::TEST_ENCOUNTERED_RETURN_STATEMENT,
- factory_->AbortArgument(1));
- EXPECT_TRUE(factory_->TestDeleted());
-}
-
-// Tests that a successful death test does not register a successful
-// test part.
-TEST(SuccessRegistrationDeathTest, NoSuccessPart) {
- EXPECT_DEATH(_exit(1), "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-TEST(StreamingAssertionsDeathTest, DeathTest) {
- EXPECT_DEATH(_exit(1), "") << "unexpected failure";
- ASSERT_DEATH(_exit(1), "") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_DEATH(_exit(0), "") << "expected failure";
- }, "expected failure");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_DEATH(_exit(0), "") << "expected failure";
- }, "expected failure");
-}
-
-// Tests that GetLastErrnoDescription returns an empty string when the
-// last error is 0 and non-empty string when it is non-zero.
-TEST(GetLastErrnoDescription, GetLastErrnoDescriptionWorks) {
- errno = ENOENT;
- EXPECT_STRNE("", GetLastErrnoDescription().c_str());
- errno = 0;
- EXPECT_STREQ("", GetLastErrnoDescription().c_str());
-}
-
-# if GTEST_OS_WINDOWS
-TEST(AutoHandleTest, AutoHandleWorks) {
- HANDLE handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
-
- // Tests that the AutoHandle is correctly initialized with a handle.
- testing::internal::AutoHandle auto_handle(handle);
- EXPECT_EQ(handle, auto_handle.Get());
-
- // Tests that Reset assigns INVALID_HANDLE_VALUE.
- // Note that this cannot verify whether the original handle is closed.
- auto_handle.Reset();
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle.Get());
-
- // Tests that Reset assigns the new handle.
- // Note that this cannot verify whether the original handle is closed.
- handle = ::CreateEvent(NULL, FALSE, FALSE, NULL);
- ASSERT_NE(INVALID_HANDLE_VALUE, handle);
- auto_handle.Reset(handle);
- EXPECT_EQ(handle, auto_handle.Get());
-
- // Tests that AutoHandle contains INVALID_HANDLE_VALUE by default.
- testing::internal::AutoHandle auto_handle2;
- EXPECT_EQ(INVALID_HANDLE_VALUE, auto_handle2.Get());
-}
-# endif // GTEST_OS_WINDOWS
-
-# if GTEST_OS_WINDOWS
-typedef unsigned __int64 BiggestParsable;
-typedef signed __int64 BiggestSignedParsable;
-# else
-typedef unsigned long long BiggestParsable;
-typedef signed long long BiggestSignedParsable;
-# endif // GTEST_OS_WINDOWS
-
-// We cannot use std::numeric_limits<T>::max() as it clashes with the
-// max() macro defined by <windows.h>.
-const BiggestParsable kBiggestParsableMax = ULLONG_MAX;
-const BiggestSignedParsable kBiggestSignedParsableMax = LLONG_MAX;
-
-TEST(ParseNaturalNumberTest, RejectsInvalidFormat) {
- BiggestParsable result = 0;
-
- // Rejects non-numbers.
- EXPECT_FALSE(ParseNaturalNumber("non-number string", &result));
-
- // Rejects numbers with whitespace prefix.
- EXPECT_FALSE(ParseNaturalNumber(" 123", &result));
-
- // Rejects negative numbers.
- EXPECT_FALSE(ParseNaturalNumber("-123", &result));
-
- // Rejects numbers starting with a plus sign.
- EXPECT_FALSE(ParseNaturalNumber("+123", &result));
- errno = 0;
-}
-
-TEST(ParseNaturalNumberTest, RejectsOverflownNumbers) {
- BiggestParsable result = 0;
-
- EXPECT_FALSE(ParseNaturalNumber("99999999999999999999999", &result));
-
- signed char char_result = 0;
- EXPECT_FALSE(ParseNaturalNumber("200", &char_result));
- errno = 0;
-}
-
-TEST(ParseNaturalNumberTest, AcceptsValidNumbers) {
- BiggestParsable result = 0;
-
- result = 0;
- ASSERT_TRUE(ParseNaturalNumber("123", &result));
- EXPECT_EQ(123U, result);
-
- // Check 0 as an edge case.
- result = 1;
- ASSERT_TRUE(ParseNaturalNumber("0", &result));
- EXPECT_EQ(0U, result);
-
- result = 1;
- ASSERT_TRUE(ParseNaturalNumber("00000", &result));
- EXPECT_EQ(0U, result);
-}
-
-TEST(ParseNaturalNumberTest, AcceptsTypeLimits) {
- Message msg;
- msg << kBiggestParsableMax;
-
- BiggestParsable result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg.GetString(), &result));
- EXPECT_EQ(kBiggestParsableMax, result);
-
- Message msg2;
- msg2 << kBiggestSignedParsableMax;
-
- BiggestSignedParsable signed_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg2.GetString(), &signed_result));
- EXPECT_EQ(kBiggestSignedParsableMax, signed_result);
-
- Message msg3;
- msg3 << INT_MAX;
-
- int int_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg3.GetString(), &int_result));
- EXPECT_EQ(INT_MAX, int_result);
-
- Message msg4;
- msg4 << UINT_MAX;
-
- unsigned int uint_result = 0;
- EXPECT_TRUE(ParseNaturalNumber(msg4.GetString(), &uint_result));
- EXPECT_EQ(UINT_MAX, uint_result);
-}
-
-TEST(ParseNaturalNumberTest, WorksForShorterIntegers) {
- short short_result = 0;
- ASSERT_TRUE(ParseNaturalNumber("123", &short_result));
- EXPECT_EQ(123, short_result);
-
- signed char char_result = 0;
- ASSERT_TRUE(ParseNaturalNumber("123", &char_result));
- EXPECT_EQ(123, char_result);
-}
-
-# if GTEST_OS_WINDOWS
-TEST(EnvironmentTest, HandleFitsIntoSizeT) {
- ASSERT_TRUE(sizeof(HANDLE) <= sizeof(size_t));
-}
-# endif // GTEST_OS_WINDOWS
-
-// Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED trigger
-// failures when death tests are available on the system.
-TEST(ConditionalDeathMacrosDeathTest, ExpectsDeathWhenDeathTestsAvailable) {
- EXPECT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestExpectMacro"),
- "death inside CondDeathTestExpectMacro");
- ASSERT_DEATH_IF_SUPPORTED(DieInside("CondDeathTestAssertMacro"),
- "death inside CondDeathTestAssertMacro");
-
- // Empty statement will not crash, which must trigger a failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH_IF_SUPPORTED(;, ""), "");
- EXPECT_FATAL_FAILURE(ASSERT_DEATH_IF_SUPPORTED(;, ""), "");
-}
-
-TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInFastStyle) {
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_FALSE(InDeathTestChild());
- EXPECT_DEATH({
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
- fflush(stderr);
- _exit(1);
- }, "Inside");
-}
-
-TEST(InDeathTestChildDeathTest, ReportsDeathTestCorrectlyInThreadSafeStyle) {
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- EXPECT_FALSE(InDeathTestChild());
- EXPECT_DEATH({
- fprintf(stderr, InDeathTestChild() ? "Inside" : "Outside");
- fflush(stderr);
- _exit(1);
- }, "Inside");
-}
-
-void DieWithMessage(const char* message) {
- fputs(message, stderr);
- fflush(stderr); // Make sure the text is printed before the process exits.
- _exit(1);
-}
-
-TEST(MatcherDeathTest, DoesNotBreakBareRegexMatching) {
- // googletest tests this, of course; here we ensure that including googlemock
- // has not broken it.
-#if GTEST_USES_POSIX_RE
- EXPECT_DEATH(DieWithMessage("O, I die, Horatio."), "I d[aeiou]e");
-#else
- EXPECT_DEATH(DieWithMessage("O, I die, Horatio."), "I di?e");
-#endif
-}
-
-TEST(MatcherDeathTest, MonomorphicMatcherMatches) {
- EXPECT_DEATH(DieWithMessage("Behind O, I am slain!"),
- Matcher<const std::string&>(ContainsRegex("I am slain")));
-}
-
-TEST(MatcherDeathTest, MonomorphicMatcherDoesNotMatch) {
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(
- DieWithMessage("Behind O, I am slain!"),
- Matcher<const std::string&>(ContainsRegex("Ow, I am slain"))),
- "Expected: contains regular expression \"Ow, I am slain\"");
-}
-
-TEST(MatcherDeathTest, PolymorphicMatcherMatches) {
- EXPECT_DEATH(DieWithMessage("The rest is silence."),
- ContainsRegex("rest is silence"));
-}
-
-TEST(MatcherDeathTest, PolymorphicMatcherDoesNotMatch) {
- EXPECT_NONFATAL_FAILURE(
- EXPECT_DEATH(DieWithMessage("The rest is silence."),
- ContainsRegex("rest is science")),
- "Expected: contains regular expression \"rest is science\"");
-}
-
-} // namespace
-
-#else // !GTEST_HAS_DEATH_TEST follows
-
-namespace {
-
-using testing::internal::CaptureStderr;
-using testing::internal::GetCapturedStderr;
-
-// Tests that EXPECT_DEATH_IF_SUPPORTED/ASSERT_DEATH_IF_SUPPORTED are still
-// defined but do not trigger failures when death tests are not available on
-// the system.
-TEST(ConditionalDeathMacrosTest, WarnsWhenDeathTestsNotAvailable) {
- // Empty statement will not crash, but that should not trigger a failure
- // when death tests are not supported.
- CaptureStderr();
- EXPECT_DEATH_IF_SUPPORTED(;, "");
- std::string output = GetCapturedStderr();
- ASSERT_TRUE(NULL != strstr(output.c_str(),
- "Death tests are not supported on this platform"));
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
-
- // The streamed message should not be printed as there is no test failure.
- CaptureStderr();
- EXPECT_DEATH_IF_SUPPORTED(;, "") << "streamed message";
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
-
- CaptureStderr();
- ASSERT_DEATH_IF_SUPPORTED(;, ""); // NOLINT
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL != strstr(output.c_str(),
- "Death tests are not supported on this platform"));
- ASSERT_TRUE(NULL != strstr(output.c_str(), ";"));
-
- CaptureStderr();
- ASSERT_DEATH_IF_SUPPORTED(;, "") << "streamed message"; // NOLINT
- output = GetCapturedStderr();
- ASSERT_TRUE(NULL == strstr(output.c_str(), "streamed message"));
-}
-
-void FuncWithAssert(int* n) {
- ASSERT_DEATH_IF_SUPPORTED(return;, "");
- (*n)++;
-}
-
-// Tests that ASSERT_DEATH_IF_SUPPORTED does not return from the current
-// function (as ASSERT_DEATH does) if death tests are not supported.
-TEST(ConditionalDeathMacrosTest, AssertDeatDoesNotReturnhIfUnsupported) {
- int n = 0;
- FuncWithAssert(&n);
- EXPECT_EQ(1, n);
-}
-
-} // namespace
-
-#endif // !GTEST_HAS_DEATH_TEST
-
-namespace {
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-// Tests that the death test macros expand to code which may or may not
-// be followed by operator<<, and that in either case the complete text
-// comprises only a single C++ statement.
-//
-// The syntax should work whether death tests are available or not.
-TEST(ConditionalDeathMacrosSyntaxDeathTest, SingleStatement) {
- if (AlwaysFalse())
- // This would fail if executed; this is a compilation test only
- ASSERT_DEATH_IF_SUPPORTED(return, "");
-
- if (AlwaysTrue())
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "");
- else
- // This empty "else" branch is meant to ensure that EXPECT_DEATH
- // doesn't expand into an "if" statement without an "else"
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_DEATH_IF_SUPPORTED(return, "") << "did not die";
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << 1 << 2 << 3;
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-// Tests that conditional death test macros expand to code which interacts
-// well with switch statements.
-TEST(ConditionalDeathMacrosSyntaxDeathTest, SwitchStatement) {
- // Microsoft compiler usually complains about switch statements without
- // case labels. We suppress that warning for this test.
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4065)
-
- switch (0)
- default:
- ASSERT_DEATH_IF_SUPPORTED(_exit(1), "")
- << "exit in default switch handler";
-
- switch (0)
- case 0:
- EXPECT_DEATH_IF_SUPPORTED(_exit(1), "") << "exit in switch case";
-
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-}
-
-// Tests that a test case whose name ends with "DeathTest" works fine
-// on Windows.
-TEST(NotADeathTest, Test) {
- SUCCEED();
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test_ex_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test_ex_test.cc
deleted file mode 100644
index bbacc8ae88..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-death-test_ex_test.cc
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright 2010, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests that verify interaction of exceptions and death tests.
-
-#include "gtest/gtest-death-test.h"
-#include "gtest/gtest.h"
-
-#if GTEST_HAS_DEATH_TEST
-
-# if GTEST_HAS_SEH
-# include <windows.h> // For RaiseException().
-# endif
-
-# include "gtest/gtest-spi.h"
-
-# if GTEST_HAS_EXCEPTIONS
-
-# include <exception> // For std::exception.
-
-// Tests that death tests report thrown exceptions as failures and that the
-// exceptions do not escape death test macros.
-TEST(CxxExceptionDeathTest, ExceptionIsFailure) {
- try {
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw 1, ""), "threw an exception");
- } catch (...) { // NOLINT
- FAIL() << "An exception escaped a death test macro invocation "
- << "with catch_exceptions "
- << (GTEST_FLAG_GET(catch_exceptions) ? "enabled" : "disabled");
- }
-}
-
-class TestException : public std::exception {
- public:
- const char* what() const noexcept override { return "exceptional message"; }
-};
-
-TEST(CxxExceptionDeathTest, PrintsMessageForStdExceptions) {
- // Verifies that the exception message is quoted in the failure text.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- "exceptional message");
- // Verifies that the location is mentioned in the failure text.
- EXPECT_NONFATAL_FAILURE(EXPECT_DEATH(throw TestException(), ""),
- __FILE__);
-}
-# endif // GTEST_HAS_EXCEPTIONS
-
-# if GTEST_HAS_SEH
-// Tests that enabling interception of SEH exceptions with the
-// catch_exceptions flag does not interfere with SEH exceptions being
-// treated as death by death tests.
-TEST(SehExceptionDeasTest, CatchExceptionsDoesNotInterfere) {
- EXPECT_DEATH(RaiseException(42, 0x0, 0, NULL), "")
- << "with catch_exceptions "
- << (GTEST_FLAG_GET(catch_exceptions) ? "enabled" : "disabled");
-}
-# endif
-
-#endif // GTEST_HAS_DEATH_TEST
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- GTEST_FLAG_SET(catch_exceptions, GTEST_ENABLE_CATCH_EXCEPTIONS_ != 0);
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test.py
deleted file mode 100755
index bc4d87d938..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test.py
+++ /dev/null
@@ -1,120 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test correctly parses environment variables."""
-
-import os
-from googletest.test import gtest_test_utils
-
-
-IS_WINDOWS = os.name == 'nt'
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-
-COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-env-var-test_')
-
-environ = os.environ.copy()
-
-
-def AssertEq(expected, actual):
- if expected != actual:
- print('Expected: %s' % (expected,))
- print(' Actual: %s' % (actual,))
- raise AssertionError
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def GetFlag(flag):
- """Runs googletest-env-var-test_ and returns its output."""
-
- args = [COMMAND]
- if flag is not None:
- args += [flag]
- return gtest_test_utils.Subprocess(args, env=environ).output
-
-
-def TestFlag(flag, test_val, default_val):
- """Verifies that the given flag is affected by the corresponding env var."""
-
- env_var = 'GTEST_' + flag.upper()
- SetEnvVar(env_var, test_val)
- AssertEq(test_val, GetFlag(flag))
- SetEnvVar(env_var, None)
- AssertEq(default_val, GetFlag(flag))
-
-
-class GTestEnvVarTest(gtest_test_utils.TestCase):
-
- def testEnvVarAffectsFlag(self):
- """Tests that environment variable should affect the corresponding flag."""
-
- TestFlag('break_on_failure', '1', '0')
- TestFlag('color', 'yes', 'auto')
- SetEnvVar('TESTBRIDGE_TEST_RUNNER_FAIL_FAST', None) # For 'fail_fast' test
- TestFlag('fail_fast', '1', '0')
- TestFlag('filter', 'FooTest.Bar', '*')
- SetEnvVar('XML_OUTPUT_FILE', None) # For 'output' test
- TestFlag('output', 'xml:tmp/foo.xml', '')
- TestFlag('brief', '1', '0')
- TestFlag('print_time', '0', '1')
- TestFlag('repeat', '999', '1')
- TestFlag('throw_on_failure', '1', '0')
- TestFlag('death_test_style', 'threadsafe', 'fast')
- TestFlag('catch_exceptions', '0', '1')
-
- if IS_LINUX:
- TestFlag('death_test_use_fork', '1', '0')
- TestFlag('stack_trace_depth', '0', '100')
-
-
- def testXmlOutputFile(self):
- """Tests that $XML_OUTPUT_FILE affects the output flag."""
-
- SetEnvVar('GTEST_OUTPUT', None)
- SetEnvVar('XML_OUTPUT_FILE', 'tmp/bar.xml')
- AssertEq('xml:tmp/bar.xml', GetFlag('output'))
-
- def testXmlOutputFileOverride(self):
- """Tests that $XML_OUTPUT_FILE is overridden by $GTEST_OUTPUT."""
-
- SetEnvVar('GTEST_OUTPUT', 'xml:tmp/foo.xml')
- SetEnvVar('XML_OUTPUT_FILE', 'tmp/bar.xml')
- AssertEq('xml:tmp/foo.xml', GetFlag('output'))
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test_.cc
deleted file mode 100644
index 0ff015228f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-env-var-test_.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// A helper program for testing that Google Test parses the environment
-// variables correctly.
-
-#include <iostream>
-
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-using ::std::cout;
-
-namespace testing {
-
-// The purpose of this is to make the test more realistic by ensuring
-// that the UnitTest singleton is created before main() is entered.
-// We don't actual run the TEST itself.
-TEST(GTestEnvVarTest, Dummy) {
-}
-
-void PrintFlag(const char* flag) {
- if (strcmp(flag, "break_on_failure") == 0) {
- cout << GTEST_FLAG_GET(break_on_failure);
- return;
- }
-
- if (strcmp(flag, "catch_exceptions") == 0) {
- cout << GTEST_FLAG_GET(catch_exceptions);
- return;
- }
-
- if (strcmp(flag, "color") == 0) {
- cout << GTEST_FLAG_GET(color);
- return;
- }
-
- if (strcmp(flag, "death_test_style") == 0) {
- cout << GTEST_FLAG_GET(death_test_style);
- return;
- }
-
- if (strcmp(flag, "death_test_use_fork") == 0) {
- cout << GTEST_FLAG_GET(death_test_use_fork);
- return;
- }
-
- if (strcmp(flag, "fail_fast") == 0) {
- cout << GTEST_FLAG_GET(fail_fast);
- return;
- }
-
- if (strcmp(flag, "filter") == 0) {
- cout << GTEST_FLAG_GET(filter);
- return;
- }
-
- if (strcmp(flag, "output") == 0) {
- cout << GTEST_FLAG_GET(output);
- return;
- }
-
- if (strcmp(flag, "brief") == 0) {
- cout << GTEST_FLAG_GET(brief);
- return;
- }
-
- if (strcmp(flag, "print_time") == 0) {
- cout << GTEST_FLAG_GET(print_time);
- return;
- }
-
- if (strcmp(flag, "repeat") == 0) {
- cout << GTEST_FLAG_GET(repeat);
- return;
- }
-
- if (strcmp(flag, "stack_trace_depth") == 0) {
- cout << GTEST_FLAG_GET(stack_trace_depth);
- return;
- }
-
- if (strcmp(flag, "throw_on_failure") == 0) {
- cout << GTEST_FLAG_GET(throw_on_failure);
- return;
- }
-
- cout << "Invalid flag name " << flag
- << ". Valid names are break_on_failure, color, filter, etc.\n";
- exit(1);
-}
-
-} // namespace testing
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- if (argc != 2) {
- cout << "Usage: googletest-env-var-test_ NAME_OF_FLAG\n";
- return 1;
- }
-
- testing::PrintFlag(argv[1]);
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest.py
deleted file mode 100755
index 1356d4f8b5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest.py
+++ /dev/null
@@ -1,410 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2020 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test fail_fast.
-
-A user can specify if a Google Test program should continue test execution
-after a test failure via the GTEST_FAIL_FAST environment variable or the
---gtest_fail_fast flag. The default value of the flag can also be changed
-by Bazel fail fast environment variable TESTBRIDGE_TEST_RUNNER_FAIL_FAST.
-
-This script tests such functionality by invoking googletest-failfast-unittest_
-(a program written with Google Test) with different environments and command
-line flags.
-"""
-
-import os
-from googletest.test import gtest_test_utils
-
-# Constants.
-
-# Bazel testbridge environment variable for fail fast
-BAZEL_FAIL_FAST_ENV_VAR = 'TESTBRIDGE_TEST_RUNNER_FAIL_FAST'
-
-# The environment variable for specifying fail fast.
-FAIL_FAST_ENV_VAR = 'GTEST_FAIL_FAST'
-
-# The command line flag for specifying fail fast.
-FAIL_FAST_FLAG = 'gtest_fail_fast'
-
-# The command line flag to run disabled tests.
-RUN_DISABLED_FLAG = 'gtest_also_run_disabled_tests'
-
-# The command line flag for specifying a filter.
-FILTER_FLAG = 'gtest_filter'
-
-# Command to run the googletest-failfast-unittest_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath(
- 'googletest-failfast-unittest_')
-
-# The command line flag to tell Google Test to output the list of tests it
-# will run.
-LIST_TESTS_FLAG = '--gtest_list_tests'
-
-# Indicates whether Google Test supports death tests.
-SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
- [COMMAND, LIST_TESTS_FLAG]).output
-
-# Utilities.
-
-environ = os.environ.copy()
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def RunAndReturnOutput(test_suite=None, fail_fast=None, run_disabled=False):
- """Runs the test program and returns its output."""
-
- args = []
- xml_path = os.path.join(gtest_test_utils.GetTempDir(),
- '.GTestFailFastUnitTest.xml')
- args += ['--gtest_output=xml:' + xml_path]
- if fail_fast is not None:
- if isinstance(fail_fast, str):
- args += ['--%s=%s' % (FAIL_FAST_FLAG, fail_fast)]
- elif fail_fast:
- args += ['--%s' % FAIL_FAST_FLAG]
- else:
- args += ['--no%s' % FAIL_FAST_FLAG]
- if test_suite:
- args += ['--%s=%s.*' % (FILTER_FLAG, test_suite)]
- if run_disabled:
- args += ['--%s' % RUN_DISABLED_FLAG]
- txt_out = gtest_test_utils.Subprocess([COMMAND] + args, env=environ).output
- with open(xml_path) as xml_file:
- return txt_out, xml_file.read()
-
-
-# The unit test.
-class GTestFailFastUnitTest(gtest_test_utils.TestCase):
- """Tests the env variable or the command line flag for fail_fast."""
-
- def testDefaultBehavior(self):
- """Tests the behavior of not specifying the fail_fast."""
-
- txt, _ = RunAndReturnOutput()
- self.assertIn('22 FAILED TEST', txt)
-
- def testGoogletestFlag(self):
- txt, _ = RunAndReturnOutput(test_suite='HasSimpleTest', fail_fast=True)
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
-
- txt, _ = RunAndReturnOutput(test_suite='HasSimpleTest', fail_fast=False)
- self.assertIn('4 FAILED TEST', txt)
- self.assertNotIn('[ SKIPPED ]', txt)
-
- def testGoogletestEnvVar(self):
- """Tests the behavior of specifying fail_fast via Googletest env var."""
-
- try:
- SetEnvVar(FAIL_FAST_ENV_VAR, '1')
- txt, _ = RunAndReturnOutput('HasSimpleTest')
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
-
- SetEnvVar(FAIL_FAST_ENV_VAR, '0')
- txt, _ = RunAndReturnOutput('HasSimpleTest')
- self.assertIn('4 FAILED TEST', txt)
- self.assertNotIn('[ SKIPPED ]', txt)
- finally:
- SetEnvVar(FAIL_FAST_ENV_VAR, None)
-
- def testBazelEnvVar(self):
- """Tests the behavior of specifying fail_fast via Bazel testbridge."""
-
- try:
- SetEnvVar(BAZEL_FAIL_FAST_ENV_VAR, '1')
- txt, _ = RunAndReturnOutput('HasSimpleTest')
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
-
- SetEnvVar(BAZEL_FAIL_FAST_ENV_VAR, '0')
- txt, _ = RunAndReturnOutput('HasSimpleTest')
- self.assertIn('4 FAILED TEST', txt)
- self.assertNotIn('[ SKIPPED ]', txt)
- finally:
- SetEnvVar(BAZEL_FAIL_FAST_ENV_VAR, None)
-
- def testFlagOverridesEnvVar(self):
- """Tests precedence of flag over env var."""
-
- try:
- SetEnvVar(FAIL_FAST_ENV_VAR, '0')
- txt, _ = RunAndReturnOutput('HasSimpleTest', True)
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
- finally:
- SetEnvVar(FAIL_FAST_ENV_VAR, None)
-
- def testGoogletestEnvVarOverridesBazelEnvVar(self):
- """Tests that the Googletest native env var over Bazel testbridge."""
-
- try:
- SetEnvVar(BAZEL_FAIL_FAST_ENV_VAR, '0')
- SetEnvVar(FAIL_FAST_ENV_VAR, '1')
- txt, _ = RunAndReturnOutput('HasSimpleTest')
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
- finally:
- SetEnvVar(FAIL_FAST_ENV_VAR, None)
- SetEnvVar(BAZEL_FAIL_FAST_ENV_VAR, None)
-
- def testEventListener(self):
- txt, _ = RunAndReturnOutput(test_suite='HasSkipTest', fail_fast=True)
- self.assertIn('1 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 3 tests', txt)
- for expected_count, callback in [(1, 'OnTestSuiteStart'),
- (5, 'OnTestStart'),
- (5, 'OnTestEnd'),
- (5, 'OnTestPartResult'),
- (1, 'OnTestSuiteEnd')]:
- self.assertEqual(
- expected_count, txt.count(callback),
- 'Expected %d calls to callback %s match count on output: %s ' %
- (expected_count, callback, txt))
-
- txt, _ = RunAndReturnOutput(test_suite='HasSkipTest', fail_fast=False)
- self.assertIn('3 FAILED TEST', txt)
- self.assertIn('[ SKIPPED ] 1 test', txt)
- for expected_count, callback in [(1, 'OnTestSuiteStart'),
- (5, 'OnTestStart'),
- (5, 'OnTestEnd'),
- (5, 'OnTestPartResult'),
- (1, 'OnTestSuiteEnd')]:
- self.assertEqual(
- expected_count, txt.count(callback),
- 'Expected %d calls to callback %s match count on output: %s ' %
- (expected_count, callback, txt))
-
- def assertXmlResultCount(self, result, count, xml):
- self.assertEqual(
- count, xml.count('result="%s"' % result),
- 'Expected \'result="%s"\' match count of %s: %s ' %
- (result, count, xml))
-
- def assertXmlStatusCount(self, status, count, xml):
- self.assertEqual(
- count, xml.count('status="%s"' % status),
- 'Expected \'status="%s"\' match count of %s: %s ' %
- (status, count, xml))
-
- def assertFailFastXmlAndTxtOutput(self,
- fail_fast,
- test_suite,
- passed_count,
- failure_count,
- skipped_count,
- suppressed_count,
- run_disabled=False):
- """Assert XML and text output of a test execution."""
-
- txt, xml = RunAndReturnOutput(test_suite, fail_fast, run_disabled)
- if failure_count > 0:
- self.assertIn('%s FAILED TEST' % failure_count, txt)
- if suppressed_count > 0:
- self.assertIn('%s DISABLED TEST' % suppressed_count, txt)
- if skipped_count > 0:
- self.assertIn('[ SKIPPED ] %s tests' % skipped_count, txt)
- self.assertXmlStatusCount('run',
- passed_count + failure_count + skipped_count, xml)
- self.assertXmlStatusCount('notrun', suppressed_count, xml)
- self.assertXmlResultCount('completed', passed_count + failure_count, xml)
- self.assertXmlResultCount('skipped', skipped_count, xml)
- self.assertXmlResultCount('suppressed', suppressed_count, xml)
-
- def assertFailFastBehavior(self,
- test_suite,
- passed_count,
- failure_count,
- skipped_count,
- suppressed_count,
- run_disabled=False):
- """Assert --fail_fast via flag."""
-
- for fail_fast in ('true', '1', 't', True):
- self.assertFailFastXmlAndTxtOutput(fail_fast, test_suite, passed_count,
- failure_count, skipped_count,
- suppressed_count, run_disabled)
-
- def assertNotFailFastBehavior(self,
- test_suite,
- passed_count,
- failure_count,
- skipped_count,
- suppressed_count,
- run_disabled=False):
- """Assert --nofail_fast via flag."""
-
- for fail_fast in ('false', '0', 'f', False):
- self.assertFailFastXmlAndTxtOutput(fail_fast, test_suite, passed_count,
- failure_count, skipped_count,
- suppressed_count, run_disabled)
-
- def testFlag_HasFixtureTest(self):
- """Tests the behavior of fail_fast and TEST_F."""
- self.assertFailFastBehavior(
- test_suite='HasFixtureTest',
- passed_count=1,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0)
- self.assertNotFailFastBehavior(
- test_suite='HasFixtureTest',
- passed_count=1,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0)
-
- def testFlag_HasSimpleTest(self):
- """Tests the behavior of fail_fast and TEST."""
- self.assertFailFastBehavior(
- test_suite='HasSimpleTest',
- passed_count=1,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0)
- self.assertNotFailFastBehavior(
- test_suite='HasSimpleTest',
- passed_count=1,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0)
-
- def testFlag_HasParametersTest(self):
- """Tests the behavior of fail_fast and TEST_P."""
- self.assertFailFastBehavior(
- test_suite='HasParametersSuite/HasParametersTest',
- passed_count=0,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0)
- self.assertNotFailFastBehavior(
- test_suite='HasParametersSuite/HasParametersTest',
- passed_count=0,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0)
-
- def testFlag_HasDisabledTest(self):
- """Tests the behavior of fail_fast and Disabled test cases."""
- self.assertFailFastBehavior(
- test_suite='HasDisabledTest',
- passed_count=1,
- failure_count=1,
- skipped_count=2,
- suppressed_count=1,
- run_disabled=False)
- self.assertNotFailFastBehavior(
- test_suite='HasDisabledTest',
- passed_count=1,
- failure_count=3,
- skipped_count=0,
- suppressed_count=1,
- run_disabled=False)
-
- def testFlag_HasDisabledRunDisabledTest(self):
- """Tests the behavior of fail_fast and Disabled test cases enabled."""
- self.assertFailFastBehavior(
- test_suite='HasDisabledTest',
- passed_count=1,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0,
- run_disabled=True)
- self.assertNotFailFastBehavior(
- test_suite='HasDisabledTest',
- passed_count=1,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0,
- run_disabled=True)
-
- def testFlag_HasDisabledSuiteTest(self):
- """Tests the behavior of fail_fast and Disabled test suites."""
- self.assertFailFastBehavior(
- test_suite='DISABLED_HasDisabledSuite',
- passed_count=0,
- failure_count=0,
- skipped_count=0,
- suppressed_count=5,
- run_disabled=False)
- self.assertNotFailFastBehavior(
- test_suite='DISABLED_HasDisabledSuite',
- passed_count=0,
- failure_count=0,
- skipped_count=0,
- suppressed_count=5,
- run_disabled=False)
-
- def testFlag_HasDisabledSuiteRunDisabledTest(self):
- """Tests the behavior of fail_fast and Disabled test suites enabled."""
- self.assertFailFastBehavior(
- test_suite='DISABLED_HasDisabledSuite',
- passed_count=1,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0,
- run_disabled=True)
- self.assertNotFailFastBehavior(
- test_suite='DISABLED_HasDisabledSuite',
- passed_count=1,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0,
- run_disabled=True)
-
- if SUPPORTS_DEATH_TESTS:
-
- def testFlag_HasDeathTest(self):
- """Tests the behavior of fail_fast and death tests."""
- self.assertFailFastBehavior(
- test_suite='HasDeathTest',
- passed_count=1,
- failure_count=1,
- skipped_count=3,
- suppressed_count=0)
- self.assertNotFailFastBehavior(
- test_suite='HasDeathTest',
- passed_count=1,
- failure_count=4,
- skipped_count=0,
- suppressed_count=0)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest_.cc
deleted file mode 100644
index 0b2c951bc0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-failfast-unittest_.cc
+++ /dev/null
@@ -1,167 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Unit test for Google Test test filters.
-//
-// A user can specify which test(s) in a Google Test program to run via
-// either the GTEST_FILTER environment variable or the --gtest_filter
-// flag. This is used for testing such functionality.
-//
-// The program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-// Test HasFixtureTest.
-
-class HasFixtureTest : public testing::Test {};
-
-TEST_F(HasFixtureTest, Test0) {}
-
-TEST_F(HasFixtureTest, Test1) { FAIL() << "Expected failure."; }
-
-TEST_F(HasFixtureTest, Test2) { FAIL() << "Expected failure."; }
-
-TEST_F(HasFixtureTest, Test3) { FAIL() << "Expected failure."; }
-
-TEST_F(HasFixtureTest, Test4) { FAIL() << "Expected failure."; }
-
-// Test HasSimpleTest.
-
-TEST(HasSimpleTest, Test0) {}
-
-TEST(HasSimpleTest, Test1) { FAIL() << "Expected failure."; }
-
-TEST(HasSimpleTest, Test2) { FAIL() << "Expected failure."; }
-
-TEST(HasSimpleTest, Test3) { FAIL() << "Expected failure."; }
-
-TEST(HasSimpleTest, Test4) { FAIL() << "Expected failure."; }
-
-// Test HasDisabledTest.
-
-TEST(HasDisabledTest, Test0) {}
-
-TEST(HasDisabledTest, DISABLED_Test1) { FAIL() << "Expected failure."; }
-
-TEST(HasDisabledTest, Test2) { FAIL() << "Expected failure."; }
-
-TEST(HasDisabledTest, Test3) { FAIL() << "Expected failure."; }
-
-TEST(HasDisabledTest, Test4) { FAIL() << "Expected failure."; }
-
-// Test HasDeathTest
-
-TEST(HasDeathTest, Test0) { EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*"); }
-
-TEST(HasDeathTest, Test1) {
- EXPECT_DEATH_IF_SUPPORTED(FAIL() << "Expected failure.", ".*");
-}
-
-TEST(HasDeathTest, Test2) {
- EXPECT_DEATH_IF_SUPPORTED(FAIL() << "Expected failure.", ".*");
-}
-
-TEST(HasDeathTest, Test3) {
- EXPECT_DEATH_IF_SUPPORTED(FAIL() << "Expected failure.", ".*");
-}
-
-TEST(HasDeathTest, Test4) {
- EXPECT_DEATH_IF_SUPPORTED(FAIL() << "Expected failure.", ".*");
-}
-
-// Test DISABLED_HasDisabledSuite
-
-TEST(DISABLED_HasDisabledSuite, Test0) {}
-
-TEST(DISABLED_HasDisabledSuite, Test1) { FAIL() << "Expected failure."; }
-
-TEST(DISABLED_HasDisabledSuite, Test2) { FAIL() << "Expected failure."; }
-
-TEST(DISABLED_HasDisabledSuite, Test3) { FAIL() << "Expected failure."; }
-
-TEST(DISABLED_HasDisabledSuite, Test4) { FAIL() << "Expected failure."; }
-
-// Test HasParametersTest
-
-class HasParametersTest : public testing::TestWithParam<int> {};
-
-TEST_P(HasParametersTest, Test1) { FAIL() << "Expected failure."; }
-
-TEST_P(HasParametersTest, Test2) { FAIL() << "Expected failure."; }
-
-INSTANTIATE_TEST_SUITE_P(HasParametersSuite, HasParametersTest,
- testing::Values(1, 2));
-
-class MyTestListener : public ::testing::EmptyTestEventListener {
- void OnTestSuiteStart(const ::testing::TestSuite& test_suite) override {
- printf("We are in OnTestSuiteStart of %s.\n", test_suite.name());
- }
-
- void OnTestStart(const ::testing::TestInfo& test_info) override {
- printf("We are in OnTestStart of %s.%s.\n", test_info.test_suite_name(),
- test_info.name());
- }
-
- void OnTestPartResult(
- const ::testing::TestPartResult& test_part_result) override {
- printf("We are in OnTestPartResult %s:%d.\n", test_part_result.file_name(),
- test_part_result.line_number());
- }
-
- void OnTestEnd(const ::testing::TestInfo& test_info) override {
- printf("We are in OnTestEnd of %s.%s.\n", test_info.test_suite_name(),
- test_info.name());
- }
-
- void OnTestSuiteEnd(const ::testing::TestSuite& test_suite) override {
- printf("We are in OnTestSuiteEnd of %s.\n", test_suite.name());
- }
-};
-
-TEST(HasSkipTest, Test0) { SUCCEED() << "Expected success."; }
-
-TEST(HasSkipTest, Test1) { GTEST_SKIP() << "Expected skip."; }
-
-TEST(HasSkipTest, Test2) { FAIL() << "Expected failure."; }
-
-TEST(HasSkipTest, Test3) { FAIL() << "Expected failure."; }
-
-TEST(HasSkipTest, Test4) { FAIL() << "Expected failure."; }
-
-} // namespace
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
- ::testing::UnitTest::GetInstance()->listeners().Append(new MyTestListener());
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filepath-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filepath-test.cc
deleted file mode 100644
index aafad36f3f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filepath-test.cc
+++ /dev/null
@@ -1,649 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Google Test filepath utilities
-//
-// This file tests classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included from gtest-internal.h.
-// Do not #include this file anywhere else!
-
-#include "gtest/internal/gtest-filepath.h"
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h> // NOLINT
-#elif GTEST_OS_WINDOWS
-# include <direct.h> // NOLINT
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-namespace testing {
-namespace internal {
-namespace {
-
-#if GTEST_OS_WINDOWS_MOBILE
-
-// Windows CE doesn't have the remove C function.
-int remove(const char* path) {
- LPCWSTR wpath = String::AnsiToUtf16(path);
- int ret = DeleteFile(wpath) ? 0 : -1;
- delete [] wpath;
- return ret;
-}
-// Windows CE doesn't have the _rmdir C function.
-int _rmdir(const char* path) {
- FilePath filepath(path);
- LPCWSTR wpath = String::AnsiToUtf16(
- filepath.RemoveTrailingPathSeparator().c_str());
- int ret = RemoveDirectory(wpath) ? 0 : -1;
- delete [] wpath;
- return ret;
-}
-
-#else
-
-TEST(GetCurrentDirTest, ReturnsCurrentDir) {
- const FilePath original_dir = FilePath::GetCurrentDir();
- EXPECT_FALSE(original_dir.IsEmpty());
-
- posix::ChDir(GTEST_PATH_SEP_);
- const FilePath cwd = FilePath::GetCurrentDir();
- posix::ChDir(original_dir.c_str());
-
-# if GTEST_OS_WINDOWS || GTEST_OS_OS2
-
- // Skips the ":".
- const char* const cwd_without_drive = strchr(cwd.c_str(), ':');
- ASSERT_TRUE(cwd_without_drive != NULL);
- EXPECT_STREQ(GTEST_PATH_SEP_, cwd_without_drive + 1);
-
-# else
-
- EXPECT_EQ(GTEST_PATH_SEP_, cwd.string());
-
-# endif
-}
-
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-TEST(IsEmptyTest, ReturnsTrueForEmptyPath) {
- EXPECT_TRUE(FilePath("").IsEmpty());
-}
-
-TEST(IsEmptyTest, ReturnsFalseForNonEmptyPath) {
- EXPECT_FALSE(FilePath("a").IsEmpty());
- EXPECT_FALSE(FilePath(".").IsEmpty());
- EXPECT_FALSE(FilePath("a/b").IsEmpty());
- EXPECT_FALSE(FilePath("a\\b\\").IsEmpty());
-}
-
-// RemoveDirectoryName "" -> ""
-TEST(RemoveDirectoryNameTest, WhenEmptyName) {
- EXPECT_EQ("", FilePath("").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName "afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ButNoDirectory) {
- EXPECT_EQ("afile",
- FilePath("afile").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName "/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, RootFileShouldGiveFileName) {
- EXPECT_EQ("afile",
- FilePath(GTEST_PATH_SEP_ "afile").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName "adir/" -> ""
-TEST(RemoveDirectoryNameTest, WhereThereIsNoFileName) {
- EXPECT_EQ("",
- FilePath("adir" GTEST_PATH_SEP_).RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName "adir/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldGiveFileName) {
- EXPECT_EQ("afile",
- FilePath("adir" GTEST_PATH_SEP_ "afile").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName "adir/subdir/afile" -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileName) {
- EXPECT_EQ("afile",
- FilePath("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_ "afile")
- .RemoveDirectoryName().string());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that RemoveDirectoryName() works with the alternate separator
-// on Windows.
-
-// RemoveDirectoryName("/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, RootFileShouldGiveFileNameForAlternateSeparator) {
- EXPECT_EQ("afile", FilePath("/afile").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName("adir/") -> ""
-TEST(RemoveDirectoryNameTest, WhereThereIsNoFileNameForAlternateSeparator) {
- EXPECT_EQ("", FilePath("adir/").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName("adir/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldGiveFileNameForAlternateSeparator) {
- EXPECT_EQ("afile", FilePath("adir/afile").RemoveDirectoryName().string());
-}
-
-// RemoveDirectoryName("adir/subdir/afile") -> "afile"
-TEST(RemoveDirectoryNameTest, ShouldAlsoGiveFileNameForAlternateSeparator) {
- EXPECT_EQ("afile",
- FilePath("adir/subdir/afile").RemoveDirectoryName().string());
-}
-
-#endif
-
-// RemoveFileName "" -> "./"
-TEST(RemoveFileNameTest, EmptyName) {
-#if GTEST_OS_WINDOWS_MOBILE
- // On Windows CE, we use the root as the current directory.
- EXPECT_EQ(GTEST_PATH_SEP_, FilePath("").RemoveFileName().string());
-#else
- EXPECT_EQ("." GTEST_PATH_SEP_, FilePath("").RemoveFileName().string());
-#endif
-}
-
-// RemoveFileName "adir/" -> "adir/"
-TEST(RemoveFileNameTest, ButNoFile) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_).RemoveFileName().string());
-}
-
-// RemoveFileName "adir/afile" -> "adir/"
-TEST(RemoveFileNameTest, GivesDirName) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_ "afile").RemoveFileName().string());
-}
-
-// RemoveFileName "adir/subdir/afile" -> "adir/subdir/"
-TEST(RemoveFileNameTest, GivesDirAndSubDirName) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_,
- FilePath("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_ "afile")
- .RemoveFileName().string());
-}
-
-// RemoveFileName "/afile" -> "/"
-TEST(RemoveFileNameTest, GivesRootDir) {
- EXPECT_EQ(GTEST_PATH_SEP_,
- FilePath(GTEST_PATH_SEP_ "afile").RemoveFileName().string());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that RemoveFileName() works with the alternate separator on
-// Windows.
-
-// RemoveFileName("adir/") -> "adir/"
-TEST(RemoveFileNameTest, ButNoFileForAlternateSeparator) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_,
- FilePath("adir/").RemoveFileName().string());
-}
-
-// RemoveFileName("adir/afile") -> "adir/"
-TEST(RemoveFileNameTest, GivesDirNameForAlternateSeparator) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_,
- FilePath("adir/afile").RemoveFileName().string());
-}
-
-// RemoveFileName("adir/subdir/afile") -> "adir/subdir/"
-TEST(RemoveFileNameTest, GivesDirAndSubDirNameForAlternateSeparator) {
- EXPECT_EQ("adir" GTEST_PATH_SEP_ "subdir" GTEST_PATH_SEP_,
- FilePath("adir/subdir/afile").RemoveFileName().string());
-}
-
-// RemoveFileName("/afile") -> "\"
-TEST(RemoveFileNameTest, GivesRootDirForAlternateSeparator) {
- EXPECT_EQ(GTEST_PATH_SEP_, FilePath("/afile").RemoveFileName().string());
-}
-
-#endif
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo"), FilePath("bar"),
- 0, "xml");
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.string());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameNumberGtZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo"), FilePath("bar"),
- 12, "xml");
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar_12.xml", actual.string());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameWithSlashNumberIsZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar"), 0, "xml");
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.string());
-}
-
-TEST(MakeFileNameTest, GenerateFileNameWithSlashNumberGtZero) {
- FilePath actual = FilePath::MakeFileName(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar"), 12, "xml");
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar_12.xml", actual.string());
-}
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsZeroAndDirIsEmpty) {
- FilePath actual = FilePath::MakeFileName(FilePath(""), FilePath("bar"),
- 0, "xml");
- EXPECT_EQ("bar.xml", actual.string());
-}
-
-TEST(MakeFileNameTest, GenerateWhenNumberIsNotZeroAndDirIsEmpty) {
- FilePath actual = FilePath::MakeFileName(FilePath(""), FilePath("bar"),
- 14, "xml");
- EXPECT_EQ("bar_14.xml", actual.string());
-}
-
-TEST(ConcatPathsTest, WorksWhenDirDoesNotEndWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"),
- FilePath("bar.xml"));
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.string());
-}
-
-TEST(ConcatPathsTest, WorksWhenPath1EndsWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar.xml"));
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar.xml", actual.string());
-}
-
-TEST(ConcatPathsTest, Path1BeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath(""),
- FilePath("bar.xml"));
- EXPECT_EQ("bar.xml", actual.string());
-}
-
-TEST(ConcatPathsTest, Path2BeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"), FilePath(""));
- EXPECT_EQ("foo" GTEST_PATH_SEP_, actual.string());
-}
-
-TEST(ConcatPathsTest, BothPathBeingEmpty) {
- FilePath actual = FilePath::ConcatPaths(FilePath(""),
- FilePath(""));
- EXPECT_EQ("", actual.string());
-}
-
-TEST(ConcatPathsTest, Path1ContainsPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo" GTEST_PATH_SEP_ "bar"),
- FilePath("foobar.xml"));
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_ "foobar.xml",
- actual.string());
-}
-
-TEST(ConcatPathsTest, Path2ContainsPathSep) {
- FilePath actual = FilePath::ConcatPaths(
- FilePath("foo" GTEST_PATH_SEP_),
- FilePath("bar" GTEST_PATH_SEP_ "bar.xml"));
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_ "bar.xml",
- actual.string());
-}
-
-TEST(ConcatPathsTest, Path2EndsWithPathSep) {
- FilePath actual = FilePath::ConcatPaths(FilePath("foo"),
- FilePath("bar" GTEST_PATH_SEP_));
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_, actual.string());
-}
-
-// RemoveTrailingPathSeparator "" -> ""
-TEST(RemoveTrailingPathSeparatorTest, EmptyString) {
- EXPECT_EQ("", FilePath("").RemoveTrailingPathSeparator().string());
-}
-
-// RemoveTrailingPathSeparator "foo" -> "foo"
-TEST(RemoveTrailingPathSeparatorTest, FileNoSlashString) {
- EXPECT_EQ("foo", FilePath("foo").RemoveTrailingPathSeparator().string());
-}
-
-// RemoveTrailingPathSeparator "foo/" -> "foo"
-TEST(RemoveTrailingPathSeparatorTest, ShouldRemoveTrailingSeparator) {
- EXPECT_EQ("foo",
- FilePath("foo" GTEST_PATH_SEP_).RemoveTrailingPathSeparator().string());
-#if GTEST_HAS_ALT_PATH_SEP_
- EXPECT_EQ("foo", FilePath("foo/").RemoveTrailingPathSeparator().string());
-#endif
-}
-
-// RemoveTrailingPathSeparator "foo/bar/" -> "foo/bar/"
-TEST(RemoveTrailingPathSeparatorTest, ShouldRemoveLastSeparator) {
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar" GTEST_PATH_SEP_)
- .RemoveTrailingPathSeparator().string());
-}
-
-// RemoveTrailingPathSeparator "foo/bar" -> "foo/bar"
-TEST(RemoveTrailingPathSeparatorTest, ShouldReturnUnmodified) {
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar")
- .RemoveTrailingPathSeparator().string());
-}
-
-TEST(DirectoryTest, RootDirectoryExists) {
-#if GTEST_OS_WINDOWS // We are on Windows.
- char current_drive[_MAX_PATH]; // NOLINT
- current_drive[0] = static_cast<char>(_getdrive() + 'A' - 1);
- current_drive[1] = ':';
- current_drive[2] = '\\';
- current_drive[3] = '\0';
- EXPECT_TRUE(FilePath(current_drive).DirectoryExists());
-#else
- EXPECT_TRUE(FilePath("/").DirectoryExists());
-#endif // GTEST_OS_WINDOWS
-}
-
-#if GTEST_OS_WINDOWS
-TEST(DirectoryTest, RootOfWrongDriveDoesNotExists) {
- const int saved_drive_ = _getdrive();
- // Find a drive that doesn't exist. Start with 'Z' to avoid common ones.
- for (char drive = 'Z'; drive >= 'A'; drive--)
- if (_chdrive(drive - 'A' + 1) == -1) {
- char non_drive[_MAX_PATH]; // NOLINT
- non_drive[0] = drive;
- non_drive[1] = ':';
- non_drive[2] = '\\';
- non_drive[3] = '\0';
- EXPECT_FALSE(FilePath(non_drive).DirectoryExists());
- break;
- }
- _chdrive(saved_drive_);
-}
-#endif // GTEST_OS_WINDOWS
-
-#if !GTEST_OS_WINDOWS_MOBILE
-// Windows CE _does_ consider an empty directory to exist.
-TEST(DirectoryTest, EmptyPathDirectoryDoesNotExist) {
- EXPECT_FALSE(FilePath("").DirectoryExists());
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-TEST(DirectoryTest, CurrentDirectoryExists) {
-#if GTEST_OS_WINDOWS // We are on Windows.
-# ifndef _WIN32_CE // Windows CE doesn't have a current directory.
-
- EXPECT_TRUE(FilePath(".").DirectoryExists());
- EXPECT_TRUE(FilePath(".\\").DirectoryExists());
-
-# endif // _WIN32_CE
-#else
- EXPECT_TRUE(FilePath(".").DirectoryExists());
- EXPECT_TRUE(FilePath("./").DirectoryExists());
-#endif // GTEST_OS_WINDOWS
-}
-
-// "foo/bar" == foo//bar" == "foo///bar"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsInMidstring) {
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ "bar").string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_ "bar",
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_
- GTEST_PATH_SEP_ "bar").string());
-}
-
-// "/bar" == //bar" == "///bar"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsAtStringStart) {
- EXPECT_EQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ "bar").string());
- EXPECT_EQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").string());
- EXPECT_EQ(GTEST_PATH_SEP_ "bar",
- FilePath(GTEST_PATH_SEP_ GTEST_PATH_SEP_ GTEST_PATH_SEP_ "bar").string());
-}
-
-// "foo/" == foo//" == "foo///"
-TEST(NormalizeTest, MultipleConsecutiveSepaparatorsAtStringEnd) {
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_).string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_).string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ GTEST_PATH_SEP_ GTEST_PATH_SEP_).string());
-}
-
-#if GTEST_HAS_ALT_PATH_SEP_
-
-// Tests that separators at the end of the string are normalized
-// regardless of their combination (e.g. "foo\" =="foo/\" ==
-// "foo\\/").
-TEST(NormalizeTest, MixAlternateSeparatorAtStringEnd) {
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo/").string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo" GTEST_PATH_SEP_ "/").string());
- EXPECT_EQ("foo" GTEST_PATH_SEP_,
- FilePath("foo//" GTEST_PATH_SEP_).string());
-}
-
-#endif
-
-TEST(AssignmentOperatorTest, DefaultAssignedToNonDefault) {
- FilePath default_path;
- FilePath non_default_path("path");
- non_default_path = default_path;
- EXPECT_EQ("", non_default_path.string());
- EXPECT_EQ("", default_path.string()); // RHS var is unchanged.
-}
-
-TEST(AssignmentOperatorTest, NonDefaultAssignedToDefault) {
- FilePath non_default_path("path");
- FilePath default_path;
- default_path = non_default_path;
- EXPECT_EQ("path", default_path.string());
- EXPECT_EQ("path", non_default_path.string()); // RHS var is unchanged.
-}
-
-TEST(AssignmentOperatorTest, ConstAssignedToNonConst) {
- const FilePath const_default_path("const_path");
- FilePath non_default_path("path");
- non_default_path = const_default_path;
- EXPECT_EQ("const_path", non_default_path.string());
-}
-
-class DirectoryCreationTest : public Test {
- protected:
- void SetUp() override {
- testdata_path_.Set(FilePath(
- TempDir() + GetCurrentExecutableName().string() +
- "_directory_creation" GTEST_PATH_SEP_ "test" GTEST_PATH_SEP_));
- testdata_file_.Set(testdata_path_.RemoveTrailingPathSeparator());
-
- unique_file0_.Set(FilePath::MakeFileName(testdata_path_, FilePath("unique"),
- 0, "txt"));
- unique_file1_.Set(FilePath::MakeFileName(testdata_path_, FilePath("unique"),
- 1, "txt"));
-
- remove(testdata_file_.c_str());
- remove(unique_file0_.c_str());
- remove(unique_file1_.c_str());
- posix::RmDir(testdata_path_.c_str());
- }
-
- void TearDown() override {
- remove(testdata_file_.c_str());
- remove(unique_file0_.c_str());
- remove(unique_file1_.c_str());
- posix::RmDir(testdata_path_.c_str());
- }
-
- void CreateTextFile(const char* filename) {
- FILE* f = posix::FOpen(filename, "w");
- fprintf(f, "text\n");
- fclose(f);
- }
-
- // Strings representing a directory and a file, with identical paths
- // except for the trailing separator character that distinquishes
- // a directory named 'test' from a file named 'test'. Example names:
- FilePath testdata_path_; // "/tmp/directory_creation/test/"
- FilePath testdata_file_; // "/tmp/directory_creation/test"
- FilePath unique_file0_; // "/tmp/directory_creation/test/unique.txt"
- FilePath unique_file1_; // "/tmp/directory_creation/test/unique_1.txt"
-};
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesRecursively) {
- EXPECT_FALSE(testdata_path_.DirectoryExists()) << testdata_path_.string();
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
- EXPECT_TRUE(testdata_path_.DirectoryExists());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesForAlreadyExistingPath) {
- EXPECT_FALSE(testdata_path_.DirectoryExists()) << testdata_path_.string();
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
- // Call 'create' again... should still succeed.
- EXPECT_TRUE(testdata_path_.CreateDirectoriesRecursively());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesAndUniqueFilename) {
- FilePath file_path(FilePath::GenerateUniqueFileName(testdata_path_,
- FilePath("unique"), "txt"));
- EXPECT_EQ(unique_file0_.string(), file_path.string());
- EXPECT_FALSE(file_path.FileOrDirectoryExists()); // file not there
-
- testdata_path_.CreateDirectoriesRecursively();
- EXPECT_FALSE(file_path.FileOrDirectoryExists()); // file still not there
- CreateTextFile(file_path.c_str());
- EXPECT_TRUE(file_path.FileOrDirectoryExists());
-
- FilePath file_path2(FilePath::GenerateUniqueFileName(testdata_path_,
- FilePath("unique"), "txt"));
- EXPECT_EQ(unique_file1_.string(), file_path2.string());
- EXPECT_FALSE(file_path2.FileOrDirectoryExists()); // file not there
- CreateTextFile(file_path2.c_str());
- EXPECT_TRUE(file_path2.FileOrDirectoryExists());
-}
-
-TEST_F(DirectoryCreationTest, CreateDirectoriesFail) {
- // force a failure by putting a file where we will try to create a directory.
- CreateTextFile(testdata_file_.c_str());
- EXPECT_TRUE(testdata_file_.FileOrDirectoryExists());
- EXPECT_FALSE(testdata_file_.DirectoryExists());
- EXPECT_FALSE(testdata_file_.CreateDirectoriesRecursively());
-}
-
-TEST(NoDirectoryCreationTest, CreateNoDirectoriesForDefaultXmlFile) {
- const FilePath test_detail_xml("test_detail.xml");
- EXPECT_FALSE(test_detail_xml.CreateDirectoriesRecursively());
-}
-
-TEST(FilePathTest, DefaultConstructor) {
- FilePath fp;
- EXPECT_EQ("", fp.string());
-}
-
-TEST(FilePathTest, CharAndCopyConstructors) {
- const FilePath fp("spicy");
- EXPECT_EQ("spicy", fp.string());
-
- const FilePath fp_copy(fp);
- EXPECT_EQ("spicy", fp_copy.string());
-}
-
-TEST(FilePathTest, StringConstructor) {
- const FilePath fp(std::string("cider"));
- EXPECT_EQ("cider", fp.string());
-}
-
-TEST(FilePathTest, Set) {
- const FilePath apple("apple");
- FilePath mac("mac");
- mac.Set(apple); // Implement Set() since overloading operator= is forbidden.
- EXPECT_EQ("apple", mac.string());
- EXPECT_EQ("apple", apple.string());
-}
-
-TEST(FilePathTest, ToString) {
- const FilePath file("drink");
- EXPECT_EQ("drink", file.string());
-}
-
-TEST(FilePathTest, RemoveExtension) {
- EXPECT_EQ("app", FilePath("app.cc").RemoveExtension("cc").string());
- EXPECT_EQ("app", FilePath("app.exe").RemoveExtension("exe").string());
- EXPECT_EQ("APP", FilePath("APP.EXE").RemoveExtension("exe").string());
-}
-
-TEST(FilePathTest, RemoveExtensionWhenThereIsNoExtension) {
- EXPECT_EQ("app", FilePath("app").RemoveExtension("exe").string());
-}
-
-TEST(FilePathTest, IsDirectory) {
- EXPECT_FALSE(FilePath("cola").IsDirectory());
- EXPECT_TRUE(FilePath("koala" GTEST_PATH_SEP_).IsDirectory());
-#if GTEST_HAS_ALT_PATH_SEP_
- EXPECT_TRUE(FilePath("koala/").IsDirectory());
-#endif
-}
-
-TEST(FilePathTest, IsAbsolutePath) {
- EXPECT_FALSE(FilePath("is" GTEST_PATH_SEP_ "relative").IsAbsolutePath());
- EXPECT_FALSE(FilePath("").IsAbsolutePath());
-#if GTEST_OS_WINDOWS
- EXPECT_TRUE(FilePath("c:\\" GTEST_PATH_SEP_ "is_not"
- GTEST_PATH_SEP_ "relative").IsAbsolutePath());
- EXPECT_FALSE(FilePath("c:foo" GTEST_PATH_SEP_ "bar").IsAbsolutePath());
- EXPECT_TRUE(FilePath("c:/" GTEST_PATH_SEP_ "is_not"
- GTEST_PATH_SEP_ "relative").IsAbsolutePath());
-#else
- EXPECT_TRUE(FilePath(GTEST_PATH_SEP_ "is_not" GTEST_PATH_SEP_ "relative")
- .IsAbsolutePath());
-#endif // GTEST_OS_WINDOWS
-}
-
-TEST(FilePathTest, IsRootDirectory) {
-#if GTEST_OS_WINDOWS
- EXPECT_TRUE(FilePath("a:\\").IsRootDirectory());
- EXPECT_TRUE(FilePath("Z:/").IsRootDirectory());
- EXPECT_TRUE(FilePath("e://").IsRootDirectory());
- EXPECT_FALSE(FilePath("").IsRootDirectory());
- EXPECT_FALSE(FilePath("b:").IsRootDirectory());
- EXPECT_FALSE(FilePath("b:a").IsRootDirectory());
- EXPECT_FALSE(FilePath("8:/").IsRootDirectory());
- EXPECT_FALSE(FilePath("c|/").IsRootDirectory());
-#else
- EXPECT_TRUE(FilePath("/").IsRootDirectory());
- EXPECT_TRUE(FilePath("//").IsRootDirectory());
- EXPECT_FALSE(FilePath("").IsRootDirectory());
- EXPECT_FALSE(FilePath("\\").IsRootDirectory());
- EXPECT_FALSE(FilePath("/x").IsRootDirectory());
-#endif
-}
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest.py
deleted file mode 100755
index bd1d5a5db8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest.py
+++ /dev/null
@@ -1,639 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2005 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test test filters.
-
-A user can specify which test(s) in a Google Test program to run via either
-the GTEST_FILTER environment variable or the --gtest_filter flag.
-This script tests such functionality by invoking
-googletest-filter-unittest_ (a program written with Google Test) with different
-environments and command line flags.
-
-Note that test sharding may also influence which tests are filtered. Therefore,
-we test that here also.
-"""
-
-import os
-import re
-try:
- from sets import Set as set # For Python 2.3 compatibility
-except ImportError:
- pass
-import sys
-from googletest.test import gtest_test_utils
-
-# Constants.
-
-# Checks if this platform can pass empty environment variables to child
-# processes. We set an env variable to an empty string and invoke a python
-# script in a subprocess to print whether the variable is STILL in
-# os.environ. We then use 'eval' to parse the child's output so that an
-# exception is thrown if the input is anything other than 'True' nor 'False'.
-CAN_PASS_EMPTY_ENV = False
-if sys.executable:
- os.environ['EMPTY_VAR'] = ''
- child = gtest_test_utils.Subprocess(
- [sys.executable, '-c', 'import os; print(\'EMPTY_VAR\' in os.environ)'])
- CAN_PASS_EMPTY_ENV = eval(child.output)
-
-
-# Check if this platform can unset environment variables in child processes.
-# We set an env variable to a non-empty string, unset it, and invoke
-# a python script in a subprocess to print whether the variable
-# is NO LONGER in os.environ.
-# We use 'eval' to parse the child's output so that an exception
-# is thrown if the input is neither 'True' nor 'False'.
-CAN_UNSET_ENV = False
-if sys.executable:
- os.environ['UNSET_VAR'] = 'X'
- del os.environ['UNSET_VAR']
- child = gtest_test_utils.Subprocess(
- [sys.executable, '-c', 'import os; print(\'UNSET_VAR\' not in os.environ)'
- ])
- CAN_UNSET_ENV = eval(child.output)
-
-
-# Checks if we should test with an empty filter. This doesn't
-# make sense on platforms that cannot pass empty env variables (Win32)
-# and on platforms that cannot unset variables (since we cannot tell
-# the difference between "" and NULL -- Borland and Solaris < 5.10)
-CAN_TEST_EMPTY_FILTER = (CAN_PASS_EMPTY_ENV and CAN_UNSET_ENV)
-
-
-# The environment variable for specifying the test filters.
-FILTER_ENV_VAR = 'GTEST_FILTER'
-
-# The environment variables for test sharding.
-TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
-SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
-SHARD_STATUS_FILE_ENV_VAR = 'GTEST_SHARD_STATUS_FILE'
-
-# The command line flag for specifying the test filters.
-FILTER_FLAG = 'gtest_filter'
-
-# The command line flag for including disabled tests.
-ALSO_RUN_DISABLED_TESTS_FLAG = 'gtest_also_run_disabled_tests'
-
-# Command to run the googletest-filter-unittest_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-filter-unittest_')
-
-# Regex for determining whether parameterized tests are enabled in the binary.
-PARAM_TEST_REGEX = re.compile(r'/ParamTest')
-
-# Regex for parsing test case names from Google Test's output.
-TEST_CASE_REGEX = re.compile(r'^\[\-+\] \d+ tests? from (\w+(/\w+)?)')
-
-# Regex for parsing test names from Google Test's output.
-TEST_REGEX = re.compile(r'^\[\s*RUN\s*\].*\.(\w+(/\w+)?)')
-
-# The command line flag to tell Google Test to output the list of tests it
-# will run.
-LIST_TESTS_FLAG = '--gtest_list_tests'
-
-# Indicates whether Google Test supports death tests.
-SUPPORTS_DEATH_TESTS = 'HasDeathTest' in gtest_test_utils.Subprocess(
- [COMMAND, LIST_TESTS_FLAG]).output
-
-# Full names of all tests in googletest-filter-unittests_.
-PARAM_TESTS = [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- 'SeqQ/ParamTest.TestX/0',
- 'SeqQ/ParamTest.TestX/1',
- 'SeqQ/ParamTest.TestY/0',
- 'SeqQ/ParamTest.TestY/1',
- ]
-
-DISABLED_TESTS = [
- 'BarTest.DISABLED_TestFour',
- 'BarTest.DISABLED_TestFive',
- 'BazTest.DISABLED_TestC',
- 'DISABLED_FoobarTest.Test1',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- 'DISABLED_FoobarbazTest.TestA',
- ]
-
-if SUPPORTS_DEATH_TESTS:
- DEATH_TESTS = [
- 'HasDeathTest.Test1',
- 'HasDeathTest.Test2',
- ]
-else:
- DEATH_TESTS = []
-
-# All the non-disabled tests.
-ACTIVE_TESTS = [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB',
- ] + DEATH_TESTS + PARAM_TESTS
-
-param_tests_present = None
-
-# Utilities.
-
-environ = os.environ.copy()
-
-
-def SetEnvVar(env_var, value):
- """Sets the env variable to 'value'; unsets it when 'value' is None."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-def RunAndReturnOutput(args = None):
- """Runs the test program and returns its output."""
-
- return gtest_test_utils.Subprocess([COMMAND] + (args or []),
- env=environ).output
-
-
-def RunAndExtractTestList(args = None):
- """Runs the test program and returns its exit code and a list of tests run."""
-
- p = gtest_test_utils.Subprocess([COMMAND] + (args or []), env=environ)
- tests_run = []
- test_case = ''
- test = ''
- for line in p.output.split('\n'):
- match = TEST_CASE_REGEX.match(line)
- if match is not None:
- test_case = match.group(1)
- else:
- match = TEST_REGEX.match(line)
- if match is not None:
- test = match.group(1)
- tests_run.append(test_case + '.' + test)
- return (tests_run, p.exit_code)
-
-
-def InvokeWithModifiedEnv(extra_env, function, *args, **kwargs):
- """Runs the given function and arguments in a modified environment."""
- try:
- original_env = environ.copy()
- environ.update(extra_env)
- return function(*args, **kwargs)
- finally:
- environ.clear()
- environ.update(original_env)
-
-
-def RunWithSharding(total_shards, shard_index, command):
- """Runs a test program shard and returns exit code and a list of tests run."""
-
- extra_env = {SHARD_INDEX_ENV_VAR: str(shard_index),
- TOTAL_SHARDS_ENV_VAR: str(total_shards)}
- return InvokeWithModifiedEnv(extra_env, RunAndExtractTestList, command)
-
-# The unit test.
-
-
-class GTestFilterUnitTest(gtest_test_utils.TestCase):
- """Tests the env variable or the command line flag to filter tests."""
-
- # Utilities.
-
- def AssertSetEqual(self, lhs, rhs):
- """Asserts that two sets are equal."""
-
- for elem in lhs:
- self.assert_(elem in rhs, '%s in %s' % (elem, rhs))
-
- for elem in rhs:
- self.assert_(elem in lhs, '%s in %s' % (elem, lhs))
-
- def AssertPartitionIsValid(self, set_var, list_of_sets):
- """Asserts that list_of_sets is a valid partition of set_var."""
-
- full_partition = []
- for slice_var in list_of_sets:
- full_partition.extend(slice_var)
- self.assertEqual(len(set_var), len(full_partition))
- self.assertEqual(set(set_var), set(full_partition))
-
- def AdjustForParameterizedTests(self, tests_to_run):
- """Adjust tests_to_run in case value parameterized tests are disabled."""
-
- global param_tests_present
- if not param_tests_present:
- return list(set(tests_to_run) - set(PARAM_TESTS))
- else:
- return tests_to_run
-
- def RunAndVerify(self, gtest_filter, tests_to_run):
- """Checks that the binary runs correct set of tests for a given filter."""
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # First, tests using the environment variable.
-
- # Windows removes empty variables from the environment when passing it
- # to a new process. This means it is impossible to pass an empty filter
- # into a process using the environment variable. However, we can still
- # test the case when the variable is not supplied (i.e., gtest_filter is
- # None).
- # pylint: disable-msg=C6403
- if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
- SetEnvVar(FILTER_ENV_VAR, gtest_filter)
- tests_run = RunAndExtractTestList()[0]
- SetEnvVar(FILTER_ENV_VAR, None)
- self.AssertSetEqual(tests_run, tests_to_run)
- # pylint: enable-msg=C6403
-
- # Next, tests using the command line flag.
-
- if gtest_filter is None:
- args = []
- else:
- args = ['--%s=%s' % (FILTER_FLAG, gtest_filter)]
-
- tests_run = RunAndExtractTestList(args)[0]
- self.AssertSetEqual(tests_run, tests_to_run)
-
- def RunAndVerifyWithSharding(self, gtest_filter, total_shards, tests_to_run,
- args=None, check_exit_0=False):
- """Checks that binary runs correct tests for the given filter and shard.
-
- Runs all shards of googletest-filter-unittest_ with the given filter, and
- verifies that the right set of tests were run. The union of tests run
- on each shard should be identical to tests_to_run, without duplicates.
- If check_exit_0, .
-
- Args:
- gtest_filter: A filter to apply to the tests.
- total_shards: A total number of shards to split test run into.
- tests_to_run: A set of tests expected to run.
- args : Arguments to pass to the to the test binary.
- check_exit_0: When set to a true value, make sure that all shards
- return 0.
- """
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # Windows removes empty variables from the environment when passing it
- # to a new process. This means it is impossible to pass an empty filter
- # into a process using the environment variable. However, we can still
- # test the case when the variable is not supplied (i.e., gtest_filter is
- # None).
- # pylint: disable-msg=C6403
- if CAN_TEST_EMPTY_FILTER or gtest_filter != '':
- SetEnvVar(FILTER_ENV_VAR, gtest_filter)
- partition = []
- for i in range(0, total_shards):
- (tests_run, exit_code) = RunWithSharding(total_shards, i, args)
- if check_exit_0:
- self.assertEqual(0, exit_code)
- partition.append(tests_run)
-
- self.AssertPartitionIsValid(tests_to_run, partition)
- SetEnvVar(FILTER_ENV_VAR, None)
- # pylint: enable-msg=C6403
-
- def RunAndVerifyAllowingDisabled(self, gtest_filter, tests_to_run):
- """Checks that the binary runs correct set of tests for the given filter.
-
- Runs googletest-filter-unittest_ with the given filter, and enables
- disabled tests. Verifies that the right set of tests were run.
-
- Args:
- gtest_filter: A filter to apply to the tests.
- tests_to_run: A set of tests expected to run.
- """
-
- tests_to_run = self.AdjustForParameterizedTests(tests_to_run)
-
- # Construct the command line.
- args = ['--%s' % ALSO_RUN_DISABLED_TESTS_FLAG]
- if gtest_filter is not None:
- args.append('--%s=%s' % (FILTER_FLAG, gtest_filter))
-
- tests_run = RunAndExtractTestList(args)[0]
- self.AssertSetEqual(tests_run, tests_to_run)
-
- def setUp(self):
- """Sets up test case.
-
- Determines whether value-parameterized tests are enabled in the binary and
- sets the flags accordingly.
- """
-
- global param_tests_present
- if param_tests_present is None:
- param_tests_present = PARAM_TEST_REGEX.search(
- RunAndReturnOutput()) is not None
-
- def testDefaultBehavior(self):
- """Tests the behavior of not specifying the filter."""
-
- self.RunAndVerify(None, ACTIVE_TESTS)
-
- def testDefaultBehaviorWithShards(self):
- """Tests the behavior without the filter, with sharding enabled."""
-
- self.RunAndVerifyWithSharding(None, 1, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, 2, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) - 1, ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS), ACTIVE_TESTS)
- self.RunAndVerifyWithSharding(None, len(ACTIVE_TESTS) + 1, ACTIVE_TESTS)
-
- def testEmptyFilter(self):
- """Tests an empty filter."""
-
- self.RunAndVerify('', [])
- self.RunAndVerifyWithSharding('', 1, [])
- self.RunAndVerifyWithSharding('', 2, [])
-
- def testBadFilter(self):
- """Tests a filter that matches nothing."""
-
- self.RunAndVerify('BadFilter', [])
- self.RunAndVerifyAllowingDisabled('BadFilter', [])
-
- def testFullName(self):
- """Tests filtering by full name."""
-
- self.RunAndVerify('FooTest.Xyz', ['FooTest.Xyz'])
- self.RunAndVerifyAllowingDisabled('FooTest.Xyz', ['FooTest.Xyz'])
- self.RunAndVerifyWithSharding('FooTest.Xyz', 5, ['FooTest.Xyz'])
-
- def testUniversalFilters(self):
- """Tests filters that match everything."""
-
- self.RunAndVerify('*', ACTIVE_TESTS)
- self.RunAndVerify('*.*', ACTIVE_TESTS)
- self.RunAndVerifyWithSharding('*.*', len(ACTIVE_TESTS) - 3, ACTIVE_TESTS)
- self.RunAndVerifyAllowingDisabled('*', ACTIVE_TESTS + DISABLED_TESTS)
- self.RunAndVerifyAllowingDisabled('*.*', ACTIVE_TESTS + DISABLED_TESTS)
-
- def testFilterByTestCase(self):
- """Tests filtering by test case name."""
-
- self.RunAndVerify('FooTest.*', ['FooTest.Abc', 'FooTest.Xyz'])
-
- BAZ_TESTS = ['BazTest.TestOne', 'BazTest.TestA', 'BazTest.TestB']
- self.RunAndVerify('BazTest.*', BAZ_TESTS)
- self.RunAndVerifyAllowingDisabled('BazTest.*',
- BAZ_TESTS + ['BazTest.DISABLED_TestC'])
-
- def testFilterByTest(self):
- """Tests filtering by test name."""
-
- self.RunAndVerify('*.TestOne', ['BarTest.TestOne', 'BazTest.TestOne'])
-
- def testFilterDisabledTests(self):
- """Select only the disabled tests to run."""
-
- self.RunAndVerify('DISABLED_FoobarTest.Test1', [])
- self.RunAndVerifyAllowingDisabled('DISABLED_FoobarTest.Test1',
- ['DISABLED_FoobarTest.Test1'])
-
- self.RunAndVerify('*DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('*DISABLED_*', DISABLED_TESTS)
-
- self.RunAndVerify('*.DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('*.DISABLED_*', [
- 'BarTest.DISABLED_TestFour',
- 'BarTest.DISABLED_TestFive',
- 'BazTest.DISABLED_TestC',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- ])
-
- self.RunAndVerify('DISABLED_*', [])
- self.RunAndVerifyAllowingDisabled('DISABLED_*', [
- 'DISABLED_FoobarTest.Test1',
- 'DISABLED_FoobarTest.DISABLED_Test2',
- 'DISABLED_FoobarbazTest.TestA',
- ])
-
- def testWildcardInTestCaseName(self):
- """Tests using wildcard in the test case name."""
-
- self.RunAndVerify('*a*.*', [
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB', ] + DEATH_TESTS + PARAM_TESTS)
-
- def testWildcardInTestName(self):
- """Tests using wildcard in the test name."""
-
- self.RunAndVerify('*.*A*', ['FooTest.Abc', 'BazTest.TestA'])
-
- def testFilterWithoutDot(self):
- """Tests a filter that has no '.' in it."""
-
- self.RunAndVerify('*z*', [
- 'FooTest.Xyz',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- 'BazTest.TestB',
- ])
-
- def testTwoPatterns(self):
- """Tests filters that consist of two patterns."""
-
- self.RunAndVerify('Foo*.*:*A*', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BazTest.TestA',
- ])
-
- # An empty pattern + a non-empty one
- self.RunAndVerify(':*A*', ['FooTest.Abc', 'BazTest.TestA'])
-
- def testThreePatterns(self):
- """Tests filters that consist of three patterns."""
-
- self.RunAndVerify('*oo*:*A*:*One', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
-
- 'BazTest.TestOne',
- 'BazTest.TestA',
- ])
-
- # The 2nd pattern is empty.
- self.RunAndVerify('*oo*::*One', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
-
- 'BazTest.TestOne',
- ])
-
- # The last 2 patterns are empty.
- self.RunAndVerify('*oo*::', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
- ])
-
- def testNegativeFilters(self):
- self.RunAndVerify('*-BazTest.TestOne', [
- 'FooTest.Abc',
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
-
- 'BazTest.TestA',
- 'BazTest.TestB',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- self.RunAndVerify('*-FooTest.Abc:BazTest.*', [
- 'FooTest.Xyz',
-
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- self.RunAndVerify('BarTest.*-BarTest.TestOne', [
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ])
-
- # Tests without leading '*'.
- self.RunAndVerify('-FooTest.Abc:FooTest.Xyz:BazTest.*', [
- 'BarTest.TestOne',
- 'BarTest.TestTwo',
- 'BarTest.TestThree',
- ] + DEATH_TESTS + PARAM_TESTS)
-
- # Value parameterized tests.
- self.RunAndVerify('*/*', PARAM_TESTS)
-
- # Value parameterized tests filtering by the sequence name.
- self.RunAndVerify('SeqP/*', [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- ])
-
- # Value parameterized tests filtering by the test name.
- self.RunAndVerify('*/0', [
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestY/0',
- 'SeqQ/ParamTest.TestX/0',
- 'SeqQ/ParamTest.TestY/0',
- ])
-
- def testFlagOverridesEnvVar(self):
- """Tests that the filter flag overrides the filtering env. variable."""
-
- SetEnvVar(FILTER_ENV_VAR, 'Foo*')
- args = ['--%s=%s' % (FILTER_FLAG, '*One')]
- tests_run = RunAndExtractTestList(args)[0]
- SetEnvVar(FILTER_ENV_VAR, None)
-
- self.AssertSetEqual(tests_run, ['BarTest.TestOne', 'BazTest.TestOne'])
-
- def testShardStatusFileIsCreated(self):
- """Tests that the shard file is created if specified in the environment."""
-
- shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
- 'shard_status_file')
- self.assert_(not os.path.exists(shard_status_file))
-
- extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
- try:
- InvokeWithModifiedEnv(extra_env, RunAndReturnOutput)
- finally:
- self.assert_(os.path.exists(shard_status_file))
- os.remove(shard_status_file)
-
- def testShardStatusFileIsCreatedWithListTests(self):
- """Tests that the shard file is created with the "list_tests" flag."""
-
- shard_status_file = os.path.join(gtest_test_utils.GetTempDir(),
- 'shard_status_file2')
- self.assert_(not os.path.exists(shard_status_file))
-
- extra_env = {SHARD_STATUS_FILE_ENV_VAR: shard_status_file}
- try:
- output = InvokeWithModifiedEnv(extra_env,
- RunAndReturnOutput,
- [LIST_TESTS_FLAG])
- finally:
- # This assertion ensures that Google Test enumerated the tests as
- # opposed to running them.
- self.assert_('[==========]' not in output,
- 'Unexpected output during test enumeration.\n'
- 'Please ensure that LIST_TESTS_FLAG is assigned the\n'
- 'correct flag value for listing Google Test tests.')
-
- self.assert_(os.path.exists(shard_status_file))
- os.remove(shard_status_file)
-
- if SUPPORTS_DEATH_TESTS:
- def testShardingWorksWithDeathTests(self):
- """Tests integration with death tests and sharding."""
-
- gtest_filter = 'HasDeathTest.*:SeqP/*'
- expected_tests = [
- 'HasDeathTest.Test1',
- 'HasDeathTest.Test2',
-
- 'SeqP/ParamTest.TestX/0',
- 'SeqP/ParamTest.TestX/1',
- 'SeqP/ParamTest.TestY/0',
- 'SeqP/ParamTest.TestY/1',
- ]
-
- for flag in ['--gtest_death_test_style=threadsafe',
- '--gtest_death_test_style=fast']:
- self.RunAndVerifyWithSharding(gtest_filter, 3, expected_tests,
- check_exit_0=True, args=[flag])
- self.RunAndVerifyWithSharding(gtest_filter, 5, expected_tests,
- check_exit_0=True, args=[flag])
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest_.cc
deleted file mode 100644
index d30ec9c78b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-filter-unittest_.cc
+++ /dev/null
@@ -1,137 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Unit test for Google Test test filters.
-//
-// A user can specify which test(s) in a Google Test program to run via
-// either the GTEST_FILTER environment variable or the --gtest_filter
-// flag. This is used for testing such functionality.
-//
-// The program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-// Test case FooTest.
-
-class FooTest : public testing::Test {
-};
-
-TEST_F(FooTest, Abc) {
-}
-
-TEST_F(FooTest, Xyz) {
- FAIL() << "Expected failure.";
-}
-
-// Test case BarTest.
-
-TEST(BarTest, TestOne) {
-}
-
-TEST(BarTest, TestTwo) {
-}
-
-TEST(BarTest, TestThree) {
-}
-
-TEST(BarTest, DISABLED_TestFour) {
- FAIL() << "Expected failure.";
-}
-
-TEST(BarTest, DISABLED_TestFive) {
- FAIL() << "Expected failure.";
-}
-
-// Test case BazTest.
-
-TEST(BazTest, TestOne) {
- FAIL() << "Expected failure.";
-}
-
-TEST(BazTest, TestA) {
-}
-
-TEST(BazTest, TestB) {
-}
-
-TEST(BazTest, DISABLED_TestC) {
- FAIL() << "Expected failure.";
-}
-
-// Test case HasDeathTest
-
-TEST(HasDeathTest, Test1) {
- EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
-}
-
-// We need at least two death tests to make sure that the all death tests
-// aren't on the first shard.
-TEST(HasDeathTest, Test2) {
- EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
-}
-
-// Test case FoobarTest
-
-TEST(DISABLED_FoobarTest, Test1) {
- FAIL() << "Expected failure.";
-}
-
-TEST(DISABLED_FoobarTest, DISABLED_Test2) {
- FAIL() << "Expected failure.";
-}
-
-// Test case FoobarbazTest
-
-TEST(DISABLED_FoobarbazTest, TestA) {
- FAIL() << "Expected failure.";
-}
-
-class ParamTest : public testing::TestWithParam<int> {
-};
-
-TEST_P(ParamTest, TestX) {
-}
-
-TEST_P(ParamTest, TestY) {
-}
-
-INSTANTIATE_TEST_SUITE_P(SeqP, ParamTest, testing::Values(1, 2));
-INSTANTIATE_TEST_SUITE_P(SeqQ, ParamTest, testing::Values(5, 6));
-
-} // namespace
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest.py
deleted file mode 100644
index ef2cfb85c6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest.py
+++ /dev/null
@@ -1,128 +0,0 @@
-# Copyright 2021 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Unit test for Google Test's global test environment behavior.
-
-A user can specify a global test environment via
-testing::AddGlobalTestEnvironment. Failures in the global environment should
-result in all unit tests being skipped.
-
-This script tests such functionality by invoking
-googletest-global-environment-unittest_ (a program written with Google Test).
-"""
-
-import re
-from googletest.test import gtest_test_utils
-
-
-def RunAndReturnOutput(args=None):
- """Runs the test program and returns its output."""
-
- return gtest_test_utils.Subprocess([
- gtest_test_utils.GetTestExecutablePath(
- 'googletest-global-environment-unittest_')
- ] + (args or [])).output
-
-
-class GTestGlobalEnvironmentUnitTest(gtest_test_utils.TestCase):
- """Tests global test environment failures."""
-
- def testEnvironmentSetUpFails(self):
- """Tests the behavior of not specifying the fail_fast."""
-
- # Run the test.
- txt = RunAndReturnOutput()
-
- # We should see the text of the global environment setup error.
- self.assertIn('Canned environment setup error', txt)
-
- # Our test should have been skipped due to the error, and not treated as a
- # pass.
- self.assertIn('[ SKIPPED ] 1 test', txt)
- self.assertIn('[ PASSED ] 0 tests', txt)
-
- # The test case shouldn't have been run.
- self.assertNotIn('Unexpected call', txt)
-
- def testEnvironmentSetUpAndTornDownForEachRepeat(self):
- """Tests the behavior of test environments and gtest_repeat."""
-
- txt = RunAndReturnOutput(['--gtest_repeat=2'])
-
- # By default, with gtest_repeat=2, the global test environment should be set
- # up and torn down for each iteration.
- expected_pattern = ('(.|\n)*'
- r'Repeating all tests \(iteration 1\)'
- '(.|\n)*'
- 'Global test environment set-up.'
- '(.|\n)*'
- 'SomeTest.DoesFoo'
- '(.|\n)*'
- 'Global test environment tear-down'
- '(.|\n)*'
- r'Repeating all tests \(iteration 2\)'
- '(.|\n)*'
- 'Global test environment set-up.'
- '(.|\n)*'
- 'SomeTest.DoesFoo'
- '(.|\n)*'
- 'Global test environment tear-down'
- '(.|\n)*')
- self.assertRegex(txt, expected_pattern)
-
- def testEnvironmentSetUpAndTornDownOnce(self):
- """Tests environment and --gtest_recreate_environments_when_repeating."""
-
- txt = RunAndReturnOutput([
- '--gtest_repeat=2', '--gtest_recreate_environments_when_repeating=false'
- ])
-
- # When --gtest_recreate_environments_when_repeating is false, the test
- # environment should only be set up and torn down once, at the start and
- # end of the test respectively.
- expected_pattern = ('(.|\n)*'
- r'Repeating all tests \(iteration 1\)'
- '(.|\n)*'
- 'Global test environment set-up.'
- '(.|\n)*'
- 'SomeTest.DoesFoo'
- '(.|\n)*'
- r'Repeating all tests \(iteration 2\)'
- '(.|\n)*'
- 'SomeTest.DoesFoo'
- '(.|\n)*'
- 'Global test environment tear-down'
- '(.|\n)*')
- self.assertRegex(txt, expected_pattern)
-
- self.assertEqual(len(re.findall('Global test environment set-up', txt)), 1)
- self.assertEqual(
- len(re.findall('Global test environment tear-down', txt)), 1)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest_.cc
deleted file mode 100644
index f401b2fac2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-global-environment-unittest_.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for Google Test global test environments.
-//
-// The program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-// An environment that always fails in its SetUp method.
-class FailingEnvironment final : public ::testing::Environment {
- public:
- void SetUp() override { FAIL() << "Canned environment setup error"; }
-};
-
-// Register the environment.
-auto* const g_environment_ =
- ::testing::AddGlobalTestEnvironment(new FailingEnvironment);
-
-// A test that doesn't actually run.
-TEST(SomeTest, DoesFoo) { FAIL() << "Unexpected call"; }
-
-} // namespace
-
-int main(int argc, char** argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-outfiles-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-outfiles-test.py
deleted file mode 100644
index db9716c2de..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-outfiles-test.py
+++ /dev/null
@@ -1,191 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_json_output module."""
-
-import json
-import os
-from googletest.test import gtest_json_test_utils
-from googletest.test import gtest_test_utils
-
-GTEST_OUTPUT_SUBDIR = 'json_outfiles'
-GTEST_OUTPUT_1_TEST = 'gtest_xml_outfile1_test_'
-GTEST_OUTPUT_2_TEST = 'gtest_xml_outfile2_test_'
-
-EXPECTED_1 = {
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'name':
- u'AllTests',
- u'testsuites': [{
- u'name':
- u'PropertyOne',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'TestSomeProperties',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'PropertyOne',
- u'SetUpProp': u'1',
- u'TestSomeProperty': u'1',
- u'TearDownProp': u'1',
- }],
- }],
-}
-
-EXPECTED_2 = {
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'name':
- u'AllTests',
- u'testsuites': [{
- u'name':
- u'PropertyTwo',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'TestSomeProperties',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'timestamp': u'*',
- u'time': u'*',
- u'classname': u'PropertyTwo',
- u'SetUpProp': u'2',
- u'TestSomeProperty': u'2',
- u'TearDownProp': u'2',
- }],
- }],
-}
-
-
-class GTestJsonOutFilesTest(gtest_test_utils.TestCase):
- """Unit test for Google Test's JSON output functionality."""
-
- def setUp(self):
- # We want the trailing '/' that the last "" provides in os.path.join, for
- # telling Google Test to create an output directory instead of a single file
- # for xml output.
- self.output_dir_ = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_OUTPUT_SUBDIR, '')
- self.DeleteFilesAndDir()
-
- def tearDown(self):
- self.DeleteFilesAndDir()
-
- def DeleteFilesAndDir(self):
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_1_TEST + '.json'))
- except os.error:
- pass
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_2_TEST + '.json'))
- except os.error:
- pass
- try:
- os.rmdir(self.output_dir_)
- except os.error:
- pass
-
- def testOutfile1(self):
- self._TestOutFile(GTEST_OUTPUT_1_TEST, EXPECTED_1)
-
- def testOutfile2(self):
- self._TestOutFile(GTEST_OUTPUT_2_TEST, EXPECTED_2)
-
- def _TestOutFile(self, test_name, expected):
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(test_name)
- command = [gtest_prog_path, '--gtest_output=json:%s' % self.output_dir_]
- p = gtest_test_utils.Subprocess(command,
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
-
- output_file_name1 = test_name + '.json'
- output_file1 = os.path.join(self.output_dir_, output_file_name1)
- output_file_name2 = 'lt-' + output_file_name1
- output_file2 = os.path.join(self.output_dir_, output_file_name2)
- self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
- output_file1)
-
- if os.path.isfile(output_file1):
- with open(output_file1) as f:
- actual = json.load(f)
- else:
- with open(output_file2) as f:
- actual = json.load(f)
- self.assertEqual(expected, gtest_json_test_utils.normalize(actual))
-
-
-if __name__ == '__main__':
- os.environ['GTEST_STACK_TRACE_DEPTH'] = '0'
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-output-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-output-unittest.py
deleted file mode 100644
index cb31965e43..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-json-output-unittest.py
+++ /dev/null
@@ -1,848 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2018, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_json_output module."""
-
-import datetime
-import errno
-import json
-import os
-import re
-import sys
-
-from googletest.test import gtest_json_test_utils
-from googletest.test import gtest_test_utils
-
-GTEST_FILTER_FLAG = '--gtest_filter'
-GTEST_LIST_TESTS_FLAG = '--gtest_list_tests'
-GTEST_OUTPUT_FLAG = '--gtest_output'
-GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.json'
-GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_'
-
-# The flag indicating stacktraces are not supported
-NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
-
-SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
-
-if SUPPORTS_STACK_TRACES:
- STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
-else:
- STACK_TRACE_TEMPLATE = ''
-
-EXPECTED_NON_EMPTY = {
- u'tests':
- 26,
- u'failures':
- 5,
- u'disabled':
- 2,
- u'errors':
- 0,
- u'timestamp':
- u'*',
- u'time':
- u'*',
- u'ad_hoc_property':
- u'42',
- u'name':
- u'AllTests',
- u'testsuites': [{
- u'name':
- u'SuccessfulTest',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'Succeeds',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'SuccessfulTest'
- }]
- }, {
- u'name':
- u'FailedTest',
- u'tests':
- 1,
- u'failures':
- 1,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name':
- u'Fails',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'FailedTest',
- u'failures': [{
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Expected equality of these values:\n'
- u' 1\n 2' + STACK_TRACE_TEMPLATE,
- u'type': u''
- }]
- }]
- }, {
- u'name':
- u'DisabledTest',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 1,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'DISABLED_test_not_run',
- u'status': u'NOTRUN',
- u'result': u'SUPPRESSED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'DisabledTest'
- }]
- }, {
- u'name':
- u'SkippedTest',
- u'tests':
- 3,
- u'failures':
- 1,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'Skipped',
- u'status': u'RUN',
- u'result': u'SKIPPED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'SkippedTest'
- }, {
- u'name': u'SkippedWithMessage',
- u'status': u'RUN',
- u'result': u'SKIPPED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'SkippedTest'
- }, {
- u'name':
- u'SkippedAfterFailure',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'SkippedTest',
- u'failures': [{
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Expected equality of these values:\n'
- u' 1\n 2' + STACK_TRACE_TEMPLATE,
- u'type': u''
- }]
- }]
- }, {
- u'name':
- u'MixedResultTest',
- u'tests':
- 3,
- u'failures':
- 1,
- u'disabled':
- 1,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'Succeeds',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'MixedResultTest'
- }, {
- u'name':
- u'Fails',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'MixedResultTest',
- u'failures': [{
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Expected equality of these values:\n'
- u' 1\n 2' + STACK_TRACE_TEMPLATE,
- u'type': u''
- }, {
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Expected equality of these values:\n'
- u' 2\n 3' + STACK_TRACE_TEMPLATE,
- u'type': u''
- }]
- }, {
- u'name': u'DISABLED_test',
- u'status': u'NOTRUN',
- u'result': u'SUPPRESSED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'MixedResultTest'
- }]
- }, {
- u'name':
- u'XmlQuotingTest',
- u'tests':
- 1,
- u'failures':
- 1,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name':
- u'OutputsCData',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'XmlQuotingTest',
- u'failures': [{
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Failed\nXML output: <?xml encoding="utf-8">'
- u'<top><![CDATA[cdata text]]></top>' +
- STACK_TRACE_TEMPLATE,
- u'type': u''
- }]
- }]
- }, {
- u'name':
- u'InvalidCharactersTest',
- u'tests':
- 1,
- u'failures':
- 1,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name':
- u'InvalidCharactersInMessage',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'InvalidCharactersTest',
- u'failures': [{
- u'failure': u'gtest_xml_output_unittest_.cc:*\n'
- u'Failed\nInvalid characters in brackets'
- u' [\x01\x02]' + STACK_TRACE_TEMPLATE,
- u'type': u''
- }]
- }]
- }, {
- u'name':
- u'PropertyRecordingTest',
- u'tests':
- 4,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'SetUpTestSuite':
- u'yes',
- u'TearDownTestSuite':
- u'aye',
- u'testsuite': [{
- u'name': u'OneProperty',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'PropertyRecordingTest',
- u'key_1': u'1'
- }, {
- u'name': u'IntValuedProperty',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'PropertyRecordingTest',
- u'key_int': u'1'
- }, {
- u'name': u'ThreeProperties',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'PropertyRecordingTest',
- u'key_1': u'1',
- u'key_2': u'2',
- u'key_3': u'3'
- }, {
- u'name': u'TwoValuesForOneKeyUsesLastValue',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'PropertyRecordingTest',
- u'key_1': u'2'
- }]
- }, {
- u'name':
- u'NoFixtureTest',
- u'tests':
- 3,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'RecordProperty',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'NoFixtureTest',
- u'key': u'1'
- }, {
- u'name': u'ExternalUtilityThatCallsRecordIntValuedProperty',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'NoFixtureTest',
- u'key_for_utility_int': u'1'
- }, {
- u'name': u'ExternalUtilityThatCallsRecordStringValuedProperty',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'NoFixtureTest',
- u'key_for_utility_string': u'1'
- }]
- }, {
- u'name':
- u'TypedTest/0',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'HasTypeParamAttribute',
- u'type_param': u'int',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'TypedTest/0'
- }]
- }, {
- u'name':
- u'TypedTest/1',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'HasTypeParamAttribute',
- u'type_param': u'long',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'TypedTest/1'
- }]
- }, {
- u'name':
- u'Single/TypeParameterizedTestSuite/0',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'HasTypeParamAttribute',
- u'type_param': u'int',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/TypeParameterizedTestSuite/0'
- }]
- }, {
- u'name':
- u'Single/TypeParameterizedTestSuite/1',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'HasTypeParamAttribute',
- u'type_param': u'long',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/TypeParameterizedTestSuite/1'
- }]
- }, {
- u'name':
- u'Single/ValueParamTest',
- u'tests':
- 4,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'HasValueParamAttribute/0',
- u'value_param': u'33',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/ValueParamTest'
- }, {
- u'name': u'HasValueParamAttribute/1',
- u'value_param': u'42',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/ValueParamTest'
- }, {
- u'name': u'AnotherTestThatHasValueParamAttribute/0',
- u'value_param': u'33',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/ValueParamTest'
- }, {
- u'name': u'AnotherTestThatHasValueParamAttribute/1',
- u'value_param': u'42',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'Single/ValueParamTest'
- }]
- }]
-}
-
-EXPECTED_FILTERED = {
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'name':
- u'AllTests',
- u'ad_hoc_property':
- u'42',
- u'testsuites': [{
- u'name':
- u'SuccessfulTest',
- u'tests':
- 1,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name': u'Succeeds',
- u'status': u'RUN',
- u'result': u'COMPLETED',
- u'time': u'*',
- u'timestamp': u'*',
- u'classname': u'SuccessfulTest',
- }]
- }],
-}
-
-EXPECTED_NO_TEST = {
- u'tests':
- 0,
- u'failures':
- 0,
- u'disabled':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'name':
- u'AllTests',
- u'testsuites': [{
- u'name':
- u'NonTestSuiteFailure',
- u'tests':
- 1,
- u'failures':
- 1,
- u'disabled':
- 0,
- u'skipped':
- 0,
- u'errors':
- 0,
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'testsuite': [{
- u'name':
- u'',
- u'status':
- u'RUN',
- u'result':
- u'COMPLETED',
- u'time':
- u'*',
- u'timestamp':
- u'*',
- u'classname':
- u'',
- u'failures': [{
- u'failure': u'gtest_no_test_unittest.cc:*\n'
- u'Expected equality of these values:\n'
- u' 1\n 2' + STACK_TRACE_TEMPLATE,
- u'type': u'',
- }]
- }]
- }],
-}
-
-GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME)
-
-SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess(
- [GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output
-
-
-class GTestJsonOutputUnitTest(gtest_test_utils.TestCase):
- """Unit test for Google Test's JSON output functionality.
- """
-
- # This test currently breaks on platforms that do not support typed and
- # type-parameterized tests, so we don't run it under them.
- if SUPPORTS_TYPED_TESTS:
-
- def testNonEmptyJsonOutput(self):
- """Verifies JSON output for a Google Test binary with non-empty output.
-
- Runs a test program that generates a non-empty JSON output, and
- tests that the JSON output is expected.
- """
- self._TestJsonOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY, 1)
-
- def testNoTestJsonOutput(self):
- """Verifies JSON output for a Google Test binary without actual tests.
-
- Runs a test program that generates an JSON output for a binary with no
- tests, and tests that the JSON output is expected.
- """
-
- self._TestJsonOutput('gtest_no_test_unittest', EXPECTED_NO_TEST, 0)
-
- def testTimestampValue(self):
- """Checks whether the timestamp attribute in the JSON output is valid.
-
- Runs a test program that generates an empty JSON output, and checks if
- the timestamp attribute in the testsuites tag is valid.
- """
- actual = self._GetJsonOutput('gtest_no_test_unittest', [], 0)
- date_time_str = actual['timestamp']
- # datetime.strptime() is only available in Python 2.5+ so we have to
- # parse the expected datetime manually.
- match = re.match(r'(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)', date_time_str)
- self.assertTrue(
- re.match,
- 'JSON datettime string %s has incorrect format' % date_time_str)
- date_time_from_json = datetime.datetime(
- year=int(match.group(1)), month=int(match.group(2)),
- day=int(match.group(3)), hour=int(match.group(4)),
- minute=int(match.group(5)), second=int(match.group(6)))
-
- time_delta = abs(datetime.datetime.now() - date_time_from_json)
- # timestamp value should be near the current local time
- self.assertTrue(time_delta < datetime.timedelta(seconds=600),
- 'time_delta is %s' % time_delta)
-
- def testDefaultOutputFile(self):
- """Verifies the default output file name.
-
- Confirms that Google Test produces an JSON output file with the expected
- default name if no name is explicitly specified.
- """
- output_file = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_DEFAULT_OUTPUT_FILE)
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
- 'gtest_no_test_unittest')
- try:
- os.remove(output_file)
- except OSError:
- e = sys.exc_info()[1]
- if e.errno != errno.ENOENT:
- raise
-
- p = gtest_test_utils.Subprocess(
- [gtest_prog_path, '%s=json' % GTEST_OUTPUT_FLAG],
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
- self.assert_(os.path.isfile(output_file))
-
- def testSuppressedJsonOutput(self):
- """Verifies that no JSON output is generated.
-
- Tests that no JSON file is generated if the default JSON listener is
- shut down before RUN_ALL_TESTS is invoked.
- """
-
- json_path = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_PROGRAM_NAME + 'out.json')
- if os.path.isfile(json_path):
- os.remove(json_path)
-
- command = [GTEST_PROGRAM_PATH,
- '%s=json:%s' % (GTEST_OUTPUT_FLAG, json_path),
- '--shut_down_xml']
- p = gtest_test_utils.Subprocess(command)
- if p.terminated_by_signal:
- # p.signal is available only if p.terminated_by_signal is True.
- self.assertFalse(
- p.terminated_by_signal,
- '%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(1, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, 1))
-
- self.assert_(not os.path.isfile(json_path))
-
- def testFilteredTestJsonOutput(self):
- """Verifies JSON output when a filter is applied.
-
- Runs a test program that executes only some tests and verifies that
- non-selected tests do not show up in the JSON output.
- """
-
- self._TestJsonOutput(GTEST_PROGRAM_NAME, EXPECTED_FILTERED, 0,
- extra_args=['%s=SuccessfulTest.*' % GTEST_FILTER_FLAG])
-
- def _GetJsonOutput(self, gtest_prog_name, extra_args, expected_exit_code):
- """Returns the JSON output generated by running the program gtest_prog_name.
-
- Furthermore, the program's exit code must be expected_exit_code.
-
- Args:
- gtest_prog_name: Google Test binary name.
- extra_args: extra arguments to binary invocation.
- expected_exit_code: program's exit code.
- """
- json_path = os.path.join(gtest_test_utils.GetTempDir(),
- gtest_prog_name + 'out.json')
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(gtest_prog_name)
-
- command = (
- [gtest_prog_path, '%s=json:%s' % (GTEST_OUTPUT_FLAG, json_path)] +
- extra_args
- )
- p = gtest_test_utils.Subprocess(command)
- if p.terminated_by_signal:
- self.assert_(False,
- '%s was killed by signal %d' % (gtest_prog_name, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(expected_exit_code, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, expected_exit_code))
- with open(json_path) as f:
- actual = json.load(f)
- return actual
-
- def _TestJsonOutput(self, gtest_prog_name, expected,
- expected_exit_code, extra_args=None):
- """Checks the JSON output generated by the Google Test binary.
-
- Asserts that the JSON document generated by running the program
- gtest_prog_name matches expected_json, a string containing another
- JSON document. Furthermore, the program's exit code must be
- expected_exit_code.
-
- Args:
- gtest_prog_name: Google Test binary name.
- expected: expected output.
- expected_exit_code: program's exit code.
- extra_args: extra arguments to binary invocation.
- """
-
- actual = self._GetJsonOutput(gtest_prog_name, extra_args or [],
- expected_exit_code)
- self.assertEqual(expected, gtest_json_test_utils.normalize(actual))
-
-
-if __name__ == '__main__':
- if NO_STACKTRACE_SUPPORT_FLAG in sys.argv:
- # unittest.main() can't handle unknown flags
- sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
-
- os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest.py
deleted file mode 100755
index 9d56883d74..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest.py
+++ /dev/null
@@ -1,205 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for Google Test's --gtest_list_tests flag.
-
-A user can ask Google Test to list all tests by specifying the
---gtest_list_tests flag. This script tests such functionality
-by invoking googletest-list-tests-unittest_ (a program written with
-Google Test) the command line flags.
-"""
-
-import re
-from googletest.test import gtest_test_utils
-
-# Constants.
-
-# The command line flag for enabling/disabling listing all tests.
-LIST_TESTS_FLAG = 'gtest_list_tests'
-
-# Path to the googletest-list-tests-unittest_ program.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath('googletest-list-tests-unittest_')
-
-# The expected output when running googletest-list-tests-unittest_ with
-# --gtest_list_tests
-EXPECTED_OUTPUT_NO_FILTER_RE = re.compile(r"""FooDeathTest\.
- Test1
-Foo\.
- Bar1
- Bar2
- DISABLED_Bar3
-Abc\.
- Xyz
- Def
-FooBar\.
- Baz
-FooTest\.
- Test1
- DISABLED_Test2
- Test3
-TypedTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\.
- TestA
- TestB
-TypedTest/1\. # TypeParam = int\s*\*( __ptr64)?
- TestA
- TestB
-TypedTest/2\. # TypeParam = .*MyArray<bool,\s*42>
- TestA
- TestB
-My/TypeParamTest/0\. # TypeParam = (VeryLo{245}|class VeryLo{239})\.\.\.
- TestA
- TestB
-My/TypeParamTest/1\. # TypeParam = int\s*\*( __ptr64)?
- TestA
- TestB
-My/TypeParamTest/2\. # TypeParam = .*MyArray<bool,\s*42>
- TestA
- TestB
-MyInstantiation/ValueParamTest\.
- TestA/0 # GetParam\(\) = one line
- TestA/1 # GetParam\(\) = two\\nlines
- TestA/2 # GetParam\(\) = a very\\nlo{241}\.\.\.
- TestB/0 # GetParam\(\) = one line
- TestB/1 # GetParam\(\) = two\\nlines
- TestB/2 # GetParam\(\) = a very\\nlo{241}\.\.\.
-""")
-
-# The expected output when running googletest-list-tests-unittest_ with
-# --gtest_list_tests and --gtest_filter=Foo*.
-EXPECTED_OUTPUT_FILTER_FOO_RE = re.compile(r"""FooDeathTest\.
- Test1
-Foo\.
- Bar1
- Bar2
- DISABLED_Bar3
-FooBar\.
- Baz
-FooTest\.
- Test1
- DISABLED_Test2
- Test3
-""")
-
-# Utilities.
-
-
-def Run(args):
- """Runs googletest-list-tests-unittest_ and returns the list of tests printed."""
-
- return gtest_test_utils.Subprocess([EXE_PATH] + args,
- capture_stderr=False).output
-
-
-# The unit test.
-
-
-class GTestListTestsUnitTest(gtest_test_utils.TestCase):
- """Tests using the --gtest_list_tests flag to list all tests."""
-
- def RunAndVerify(self, flag_value, expected_output_re, other_flag):
- """Runs googletest-list-tests-unittest_ and verifies that it prints
- the correct tests.
-
- Args:
- flag_value: value of the --gtest_list_tests flag;
- None if the flag should not be present.
- expected_output_re: regular expression that matches the expected
- output after running command;
- other_flag: a different flag to be passed to command
- along with gtest_list_tests;
- None if the flag should not be present.
- """
-
- if flag_value is None:
- flag = ''
- flag_expression = 'not set'
- elif flag_value == '0':
- flag = '--%s=0' % LIST_TESTS_FLAG
- flag_expression = '0'
- else:
- flag = '--%s' % LIST_TESTS_FLAG
- flag_expression = '1'
-
- args = [flag]
-
- if other_flag is not None:
- args += [other_flag]
-
- output = Run(args)
-
- if expected_output_re:
- self.assert_(
- expected_output_re.match(output),
- ('when %s is %s, the output of "%s" is "%s",\n'
- 'which does not match regex "%s"' %
- (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output,
- expected_output_re.pattern)))
- else:
- self.assert_(
- not EXPECTED_OUTPUT_NO_FILTER_RE.match(output),
- ('when %s is %s, the output of "%s" is "%s"'%
- (LIST_TESTS_FLAG, flag_expression, ' '.join(args), output)))
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(flag_value=None,
- expected_output_re=None,
- other_flag=None)
-
- def testFlag(self):
- """Tests using the --gtest_list_tests flag."""
-
- self.RunAndVerify(flag_value='0',
- expected_output_re=None,
- other_flag=None)
- self.RunAndVerify(flag_value='1',
- expected_output_re=EXPECTED_OUTPUT_NO_FILTER_RE,
- other_flag=None)
-
- def testOverrideNonFilterFlags(self):
- """Tests that --gtest_list_tests overrides the non-filter flags."""
-
- self.RunAndVerify(flag_value='1',
- expected_output_re=EXPECTED_OUTPUT_NO_FILTER_RE,
- other_flag='--gtest_break_on_failure')
-
- def testWithFilterFlags(self):
- """Tests that --gtest_list_tests takes into account the
- --gtest_filter flag."""
-
- self.RunAndVerify(flag_value='1',
- expected_output_re=EXPECTED_OUTPUT_FILTER_FOO_RE,
- other_flag='--gtest_filter=Foo*')
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest_.cc
deleted file mode 100644
index 493c6f0046..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-list-tests-unittest_.cc
+++ /dev/null
@@ -1,156 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Unit test for Google Test's --gtest_list_tests flag.
-//
-// A user can ask Google Test to list all tests that will run
-// so that when using a filter, a user will know what
-// tests to look for. The tests will not be run after listing.
-//
-// This program will be invoked from a Python unit test.
-// Don't run it directly.
-
-#include "gtest/gtest.h"
-
-// Several different test cases and tests that will be listed.
-TEST(Foo, Bar1) {
-}
-
-TEST(Foo, Bar2) {
-}
-
-TEST(Foo, DISABLED_Bar3) {
-}
-
-TEST(Abc, Xyz) {
-}
-
-TEST(Abc, Def) {
-}
-
-TEST(FooBar, Baz) {
-}
-
-class FooTest : public testing::Test {
-};
-
-TEST_F(FooTest, Test1) {
-}
-
-TEST_F(FooTest, DISABLED_Test2) {
-}
-
-TEST_F(FooTest, Test3) {
-}
-
-TEST(FooDeathTest, Test1) {
-}
-
-// A group of value-parameterized tests.
-
-class MyType {
- public:
- explicit MyType(const std::string& a_value) : value_(a_value) {}
-
- const std::string& value() const { return value_; }
-
- private:
- std::string value_;
-};
-
-// Teaches Google Test how to print a MyType.
-void PrintTo(const MyType& x, std::ostream* os) {
- *os << x.value();
-}
-
-class ValueParamTest : public testing::TestWithParam<MyType> {
-};
-
-TEST_P(ValueParamTest, TestA) {
-}
-
-TEST_P(ValueParamTest, TestB) {
-}
-
-INSTANTIATE_TEST_SUITE_P(
- MyInstantiation, ValueParamTest,
- testing::Values(MyType("one line"),
- MyType("two\nlines"),
- MyType("a very\nloooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong line"))); // NOLINT
-
-// A group of typed tests.
-
-// A deliberately long type name for testing the line-truncating
-// behavior when printing a type parameter.
-class VeryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogName { // NOLINT
-};
-
-template <typename T>
-class TypedTest : public testing::Test {
-};
-
-template <typename T, int kSize>
-class MyArray {
-};
-
-typedef testing::Types<VeryLoooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooogName, // NOLINT
- int*, MyArray<bool, 42> > MyTypes;
-
-TYPED_TEST_SUITE(TypedTest, MyTypes);
-
-TYPED_TEST(TypedTest, TestA) {
-}
-
-TYPED_TEST(TypedTest, TestB) {
-}
-
-// A group of type-parameterized tests.
-
-template <typename T>
-class TypeParamTest : public testing::Test {
-};
-
-TYPED_TEST_SUITE_P(TypeParamTest);
-
-TYPED_TEST_P(TypeParamTest, TestA) {
-}
-
-TYPED_TEST_P(TypeParamTest, TestB) {
-}
-
-REGISTER_TYPED_TEST_SUITE_P(TypeParamTest, TestA, TestB);
-
-INSTANTIATE_TYPED_TEST_SUITE_P(My, TypeParamTest, MyTypes);
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-listener-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-listener-test.cc
deleted file mode 100644
index 9d6c9caba3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-listener-test.cc
+++ /dev/null
@@ -1,518 +0,0 @@
-// Copyright 2009 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file verifies Google Test event listeners receive events at the
-// right times.
-
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "gtest/internal/custom/gtest.h"
-
-using ::testing::AddGlobalTestEnvironment;
-using ::testing::Environment;
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::TestSuite;
-using ::testing::TestEventListener;
-using ::testing::TestInfo;
-using ::testing::TestPartResult;
-using ::testing::UnitTest;
-
-// Used by tests to register their events.
-std::vector<std::string>* g_events = nullptr;
-
-namespace testing {
-namespace internal {
-
-class EventRecordingListener : public TestEventListener {
- public:
- explicit EventRecordingListener(const char* name) : name_(name) {}
-
- protected:
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnTestProgramStart"));
- }
-
- void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int iteration) override {
- Message message;
- message << GetFullMethodName("OnTestIterationStart")
- << "(" << iteration << ")";
- g_events->push_back(message.GetString());
- }
-
- void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpStart"));
- }
-
- void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpEnd"));
- }
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseStart(const TestCase& /*test_case*/) override {
- g_events->push_back(GetFullMethodName("OnTestCaseStart"));
- }
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnTestStart(const TestInfo& /*test_info*/) override {
- g_events->push_back(GetFullMethodName("OnTestStart"));
- }
-
- void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {
- g_events->push_back(GetFullMethodName("OnTestPartResult"));
- }
-
- void OnTestEnd(const TestInfo& /*test_info*/) override {
- g_events->push_back(GetFullMethodName("OnTestEnd"));
- }
-
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
- void OnTestCaseEnd(const TestCase& /*test_case*/) override {
- g_events->push_back(GetFullMethodName("OnTestCaseEnd"));
- }
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownStart"));
- }
-
- void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownEnd"));
- }
-
- void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int iteration) override {
- Message message;
- message << GetFullMethodName("OnTestIterationEnd")
- << "(" << iteration << ")";
- g_events->push_back(message.GetString());
- }
-
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnTestProgramEnd"));
- }
-
- private:
- std::string GetFullMethodName(const char* name) {
- return name_ + "." + name;
- }
-
- std::string name_;
-};
-
-// This listener is using OnTestSuiteStart, OnTestSuiteEnd API
-class EventRecordingListener2 : public TestEventListener {
- public:
- explicit EventRecordingListener2(const char* name) : name_(name) {}
-
- protected:
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnTestProgramStart"));
- }
-
- void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int iteration) override {
- Message message;
- message << GetFullMethodName("OnTestIterationStart") << "(" << iteration
- << ")";
- g_events->push_back(message.GetString());
- }
-
- void OnEnvironmentsSetUpStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpStart"));
- }
-
- void OnEnvironmentsSetUpEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsSetUpEnd"));
- }
-
- void OnTestSuiteStart(const TestSuite& /*test_suite*/) override {
- g_events->push_back(GetFullMethodName("OnTestSuiteStart"));
- }
-
- void OnTestStart(const TestInfo& /*test_info*/) override {
- g_events->push_back(GetFullMethodName("OnTestStart"));
- }
-
- void OnTestPartResult(const TestPartResult& /*test_part_result*/) override {
- g_events->push_back(GetFullMethodName("OnTestPartResult"));
- }
-
- void OnTestEnd(const TestInfo& /*test_info*/) override {
- g_events->push_back(GetFullMethodName("OnTestEnd"));
- }
-
- void OnTestSuiteEnd(const TestSuite& /*test_suite*/) override {
- g_events->push_back(GetFullMethodName("OnTestSuiteEnd"));
- }
-
- void OnEnvironmentsTearDownStart(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownStart"));
- }
-
- void OnEnvironmentsTearDownEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnEnvironmentsTearDownEnd"));
- }
-
- void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int iteration) override {
- Message message;
- message << GetFullMethodName("OnTestIterationEnd") << "(" << iteration
- << ")";
- g_events->push_back(message.GetString());
- }
-
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {
- g_events->push_back(GetFullMethodName("OnTestProgramEnd"));
- }
-
- private:
- std::string GetFullMethodName(const char* name) { return name_ + "." + name; }
-
- std::string name_;
-};
-
-class EnvironmentInvocationCatcher : public Environment {
- protected:
- void SetUp() override { g_events->push_back("Environment::SetUp"); }
-
- void TearDown() override { g_events->push_back("Environment::TearDown"); }
-};
-
-class ListenerTest : public Test {
- protected:
- static void SetUpTestSuite() {
- g_events->push_back("ListenerTest::SetUpTestSuite");
- }
-
- static void TearDownTestSuite() {
- g_events->push_back("ListenerTest::TearDownTestSuite");
- }
-
- void SetUp() override { g_events->push_back("ListenerTest::SetUp"); }
-
- void TearDown() override { g_events->push_back("ListenerTest::TearDown"); }
-};
-
-TEST_F(ListenerTest, DoesFoo) {
- // Test execution order within a test case is not guaranteed so we are not
- // recording the test name.
- g_events->push_back("ListenerTest::* Test Body");
- SUCCEED(); // Triggers OnTestPartResult.
-}
-
-TEST_F(ListenerTest, DoesBar) {
- g_events->push_back("ListenerTest::* Test Body");
- SUCCEED(); // Triggers OnTestPartResult.
-}
-
-} // namespace internal
-
-} // namespace testing
-
-using ::testing::internal::EnvironmentInvocationCatcher;
-using ::testing::internal::EventRecordingListener;
-using ::testing::internal::EventRecordingListener2;
-
-void VerifyResults(const std::vector<std::string>& data,
- const char* const* expected_data,
- size_t expected_data_size) {
- const size_t actual_size = data.size();
- // If the following assertion fails, a new entry will be appended to
- // data. Hence we save data.size() first.
- EXPECT_EQ(expected_data_size, actual_size);
-
- // Compares the common prefix.
- const size_t shorter_size = expected_data_size <= actual_size ?
- expected_data_size : actual_size;
- size_t i = 0;
- for (; i < shorter_size; ++i) {
- ASSERT_STREQ(expected_data[i], data[i].c_str())
- << "at position " << i;
- }
-
- // Prints extra elements in the actual data.
- for (; i < actual_size; ++i) {
- printf(" Actual event #%lu: %s\n",
- static_cast<unsigned long>(i), data[i].c_str());
- }
-}
-
-int main(int argc, char **argv) {
- std::vector<std::string> events;
- g_events = &events;
- InitGoogleTest(&argc, argv);
-
- UnitTest::GetInstance()->listeners().Append(
- new EventRecordingListener("1st"));
- UnitTest::GetInstance()->listeners().Append(
- new EventRecordingListener("2nd"));
- UnitTest::GetInstance()->listeners().Append(
- new EventRecordingListener2("3rd"));
-
- AddGlobalTestEnvironment(new EnvironmentInvocationCatcher);
-
- GTEST_CHECK_(events.size() == 0)
- << "AddGlobalTestEnvironment should not generate any events itself.";
-
- GTEST_FLAG_SET(repeat, 2);
- int ret_val = RUN_ALL_TESTS();
-
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- // The deprecated OnTestSuiteStart/OnTestCaseStart events are included
- const char* const expected_events[] = {"1st.OnTestProgramStart",
- "2nd.OnTestProgramStart",
- "3rd.OnTestProgramStart",
- "1st.OnTestIterationStart(0)",
- "2nd.OnTestIterationStart(0)",
- "3rd.OnTestIterationStart(0)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "3rd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "3rd.OnEnvironmentsSetUpEnd",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "3rd.OnTestSuiteStart",
- "1st.OnTestCaseStart",
- "2nd.OnTestCaseStart",
- "ListenerTest::SetUpTestSuite",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestSuite",
- "3rd.OnTestSuiteEnd",
- "2nd.OnTestCaseEnd",
- "1st.OnTestCaseEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "3rd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "3rd.OnEnvironmentsTearDownEnd",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "3rd.OnTestIterationEnd(0)",
- "2nd.OnTestIterationEnd(0)",
- "1st.OnTestIterationEnd(0)",
- "1st.OnTestIterationStart(1)",
- "2nd.OnTestIterationStart(1)",
- "3rd.OnTestIterationStart(1)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "3rd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "3rd.OnEnvironmentsSetUpEnd",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "3rd.OnTestSuiteStart",
- "1st.OnTestCaseStart",
- "2nd.OnTestCaseStart",
- "ListenerTest::SetUpTestSuite",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestSuite",
- "3rd.OnTestSuiteEnd",
- "2nd.OnTestCaseEnd",
- "1st.OnTestCaseEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "3rd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "3rd.OnEnvironmentsTearDownEnd",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "3rd.OnTestIterationEnd(1)",
- "2nd.OnTestIterationEnd(1)",
- "1st.OnTestIterationEnd(1)",
- "3rd.OnTestProgramEnd",
- "2nd.OnTestProgramEnd",
- "1st.OnTestProgramEnd"};
-#else
- const char* const expected_events[] = {"1st.OnTestProgramStart",
- "2nd.OnTestProgramStart",
- "3rd.OnTestProgramStart",
- "1st.OnTestIterationStart(0)",
- "2nd.OnTestIterationStart(0)",
- "3rd.OnTestIterationStart(0)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "3rd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "3rd.OnEnvironmentsSetUpEnd",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "3rd.OnTestSuiteStart",
- "ListenerTest::SetUpTestSuite",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestSuite",
- "3rd.OnTestSuiteEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "3rd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "3rd.OnEnvironmentsTearDownEnd",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "3rd.OnTestIterationEnd(0)",
- "2nd.OnTestIterationEnd(0)",
- "1st.OnTestIterationEnd(0)",
- "1st.OnTestIterationStart(1)",
- "2nd.OnTestIterationStart(1)",
- "3rd.OnTestIterationStart(1)",
- "1st.OnEnvironmentsSetUpStart",
- "2nd.OnEnvironmentsSetUpStart",
- "3rd.OnEnvironmentsSetUpStart",
- "Environment::SetUp",
- "3rd.OnEnvironmentsSetUpEnd",
- "2nd.OnEnvironmentsSetUpEnd",
- "1st.OnEnvironmentsSetUpEnd",
- "3rd.OnTestSuiteStart",
- "ListenerTest::SetUpTestSuite",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "1st.OnTestStart",
- "2nd.OnTestStart",
- "3rd.OnTestStart",
- "ListenerTest::SetUp",
- "ListenerTest::* Test Body",
- "1st.OnTestPartResult",
- "2nd.OnTestPartResult",
- "3rd.OnTestPartResult",
- "ListenerTest::TearDown",
- "3rd.OnTestEnd",
- "2nd.OnTestEnd",
- "1st.OnTestEnd",
- "ListenerTest::TearDownTestSuite",
- "3rd.OnTestSuiteEnd",
- "1st.OnEnvironmentsTearDownStart",
- "2nd.OnEnvironmentsTearDownStart",
- "3rd.OnEnvironmentsTearDownStart",
- "Environment::TearDown",
- "3rd.OnEnvironmentsTearDownEnd",
- "2nd.OnEnvironmentsTearDownEnd",
- "1st.OnEnvironmentsTearDownEnd",
- "3rd.OnTestIterationEnd(1)",
- "2nd.OnTestIterationEnd(1)",
- "1st.OnTestIterationEnd(1)",
- "3rd.OnTestProgramEnd",
- "2nd.OnTestProgramEnd",
- "1st.OnTestProgramEnd"};
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
- VerifyResults(events,
- expected_events,
- sizeof(expected_events)/sizeof(expected_events[0]));
-
- // We need to check manually for ad hoc test failures that happen after
- // RUN_ALL_TESTS finishes.
- if (UnitTest::GetInstance()->Failed())
- ret_val = 1;
-
- return ret_val;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-message-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-message-test.cc
deleted file mode 100644
index 962d519114..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-message-test.cc
+++ /dev/null
@@ -1,158 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for the Message class.
-
-#include "gtest/gtest-message.h"
-
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::testing::Message;
-
-// Tests the testing::Message class
-
-// Tests the default constructor.
-TEST(MessageTest, DefaultConstructor) {
- const Message msg;
- EXPECT_EQ("", msg.GetString());
-}
-
-// Tests the copy constructor.
-TEST(MessageTest, CopyConstructor) {
- const Message msg1("Hello");
- const Message msg2(msg1);
- EXPECT_EQ("Hello", msg2.GetString());
-}
-
-// Tests constructing a Message from a C-string.
-TEST(MessageTest, ConstructsFromCString) {
- Message msg("Hello");
- EXPECT_EQ("Hello", msg.GetString());
-}
-
-// Tests streaming a float.
-TEST(MessageTest, StreamsFloat) {
- const std::string s = (Message() << 1.23456F << " " << 2.34567F).GetString();
- // Both numbers should be printed with enough precision.
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "1.234560", s.c_str());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, " 2.345669", s.c_str());
-}
-
-// Tests streaming a double.
-TEST(MessageTest, StreamsDouble) {
- const std::string s = (Message() << 1260570880.4555497 << " "
- << 1260572265.1954534).GetString();
- // Both numbers should be printed with enough precision.
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "1260570880.45", s.c_str());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, " 1260572265.19", s.c_str());
-}
-
-// Tests streaming a non-char pointer.
-TEST(MessageTest, StreamsPointer) {
- int n = 0;
- int* p = &n;
- EXPECT_NE("(null)", (Message() << p).GetString());
-}
-
-// Tests streaming a NULL non-char pointer.
-TEST(MessageTest, StreamsNullPointer) {
- int* p = nullptr;
- EXPECT_EQ("(null)", (Message() << p).GetString());
-}
-
-// Tests streaming a C string.
-TEST(MessageTest, StreamsCString) {
- EXPECT_EQ("Foo", (Message() << "Foo").GetString());
-}
-
-// Tests streaming a NULL C string.
-TEST(MessageTest, StreamsNullCString) {
- char* p = nullptr;
- EXPECT_EQ("(null)", (Message() << p).GetString());
-}
-
-// Tests streaming std::string.
-TEST(MessageTest, StreamsString) {
- const ::std::string str("Hello");
- EXPECT_EQ("Hello", (Message() << str).GetString());
-}
-
-// Tests that we can output strings containing embedded NULs.
-TEST(MessageTest, StreamsStringWithEmbeddedNUL) {
- const char char_array_with_nul[] =
- "Here's a NUL\0 and some more string";
- const ::std::string string_with_nul(char_array_with_nul,
- sizeof(char_array_with_nul) - 1);
- EXPECT_EQ("Here's a NUL\\0 and some more string",
- (Message() << string_with_nul).GetString());
-}
-
-// Tests streaming a NUL char.
-TEST(MessageTest, StreamsNULChar) {
- EXPECT_EQ("\\0", (Message() << '\0').GetString());
-}
-
-// Tests streaming int.
-TEST(MessageTest, StreamsInt) {
- EXPECT_EQ("123", (Message() << 123).GetString());
-}
-
-// Tests that basic IO manipulators (endl, ends, and flush) can be
-// streamed to Message.
-TEST(MessageTest, StreamsBasicIoManip) {
- EXPECT_EQ("Line 1.\nA NUL char \\0 in line 2.",
- (Message() << "Line 1." << std::endl
- << "A NUL char " << std::ends << std::flush
- << " in line 2.").GetString());
-}
-
-// Tests Message::GetString()
-TEST(MessageTest, GetString) {
- Message msg;
- msg << 1 << " lamb";
- EXPECT_EQ("1 lamb", msg.GetString());
-}
-
-// Tests streaming a Message object to an ostream.
-TEST(MessageTest, StreamsToOStream) {
- Message msg("Hello");
- ::std::stringstream ss;
- ss << msg;
- EXPECT_EQ("Hello", testing::internal::StringStreamToString(&ss));
-}
-
-// Tests that a Message object doesn't take up too much stack space.
-TEST(MessageTest, DoesNotTakeUpMuchStackSpace) {
- EXPECT_LE(sizeof(Message), 16U);
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-options-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-options-test.cc
deleted file mode 100644
index cd386ff23d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-options-test.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Google Test UnitTestOptions tests
-//
-// This file tests classes and functions used internally by
-// Google Test. They are subject to change without notice.
-//
-// This file is #included from gtest.cc, to avoid changing build or
-// make-files on Windows and other platforms. Do not #include this file
-// anywhere else!
-
-#include "gtest/gtest.h"
-
-#if GTEST_OS_WINDOWS_MOBILE
-# include <windows.h>
-#elif GTEST_OS_WINDOWS
-# include <direct.h>
-#elif GTEST_OS_OS2
-// For strcasecmp on OS/2
-#include <strings.h>
-#endif // GTEST_OS_WINDOWS_MOBILE
-
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-namespace internal {
-namespace {
-
-// Turns the given relative path into an absolute path.
-FilePath GetAbsolutePathOf(const FilePath& relative_path) {
- return FilePath::ConcatPaths(FilePath::GetCurrentDir(), relative_path);
-}
-
-// Testing UnitTestOptions::GetOutputFormat/GetOutputFile.
-
-TEST(XmlOutputTest, GetOutputFormatDefault) {
- GTEST_FLAG_SET(output, "");
- EXPECT_STREQ("", UnitTestOptions::GetOutputFormat().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFormat) {
- GTEST_FLAG_SET(output, "xml:filename");
- EXPECT_STREQ("xml", UnitTestOptions::GetOutputFormat().c_str());
-}
-
-TEST(XmlOutputTest, GetOutputFileDefault) {
- GTEST_FLAG_SET(output, "");
- EXPECT_EQ(GetAbsolutePathOf(FilePath("test_detail.xml")).string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-}
-
-TEST(XmlOutputTest, GetOutputFileSingleFile) {
- GTEST_FLAG_SET(output, "xml:filename.abc");
- EXPECT_EQ(GetAbsolutePathOf(FilePath("filename.abc")).string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-}
-
-TEST(XmlOutputTest, GetOutputFileFromDirectoryPath) {
- GTEST_FLAG_SET(output, "xml:path" GTEST_PATH_SEP_);
- const std::string expected_output_file =
- GetAbsolutePathOf(
- FilePath(std::string("path") + GTEST_PATH_SEP_ +
- GetCurrentExecutableName().string() + ".xml")).string();
- const std::string& output_file =
- UnitTestOptions::GetAbsolutePathToOutputFile();
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-TEST(OutputFileHelpersTest, GetCurrentExecutableName) {
- const std::string exe_str = GetCurrentExecutableName().string();
-#if GTEST_OS_WINDOWS
- const bool success =
- _strcmpi("googletest-options-test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest-options-ex_test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest_all_test", exe_str.c_str()) == 0 ||
- _strcmpi("gtest_dll_test", exe_str.c_str()) == 0;
-#elif GTEST_OS_OS2
- const bool success =
- strcasecmp("googletest-options-test", exe_str.c_str()) == 0 ||
- strcasecmp("gtest-options-ex_test", exe_str.c_str()) == 0 ||
- strcasecmp("gtest_all_test", exe_str.c_str()) == 0 ||
- strcasecmp("gtest_dll_test", exe_str.c_str()) == 0;
-#elif GTEST_OS_FUCHSIA
- const bool success = exe_str == "app";
-#else
- const bool success =
- exe_str == "googletest-options-test" ||
- exe_str == "gtest_all_test" ||
- exe_str == "lt-gtest_all_test" ||
- exe_str == "gtest_dll_test";
-#endif // GTEST_OS_WINDOWS
- if (!success)
- FAIL() << "GetCurrentExecutableName() returns " << exe_str;
-}
-
-#if !GTEST_OS_FUCHSIA
-
-class XmlOutputChangeDirTest : public Test {
- protected:
- void SetUp() override {
- original_working_dir_ = FilePath::GetCurrentDir();
- posix::ChDir("..");
- // This will make the test fail if run from the root directory.
- EXPECT_NE(original_working_dir_.string(),
- FilePath::GetCurrentDir().string());
- }
-
- void TearDown() override {
- posix::ChDir(original_working_dir_.string().c_str());
- }
-
- FilePath original_working_dir_;
-};
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefault) {
- GTEST_FLAG_SET(output, "");
- EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("test_detail.xml")).string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithDefaultXML) {
- GTEST_FLAG_SET(output, "xml");
- EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("test_detail.xml")).string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativeFile) {
- GTEST_FLAG_SET(output, "xml:filename.abc");
- EXPECT_EQ(FilePath::ConcatPaths(original_working_dir_,
- FilePath("filename.abc")).string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithRelativePath) {
- GTEST_FLAG_SET(output, "xml:path" GTEST_PATH_SEP_);
- const std::string expected_output_file =
- FilePath::ConcatPaths(
- original_working_dir_,
- FilePath(std::string("path") + GTEST_PATH_SEP_ +
- GetCurrentExecutableName().string() + ".xml")).string();
- const std::string& output_file =
- UnitTestOptions::GetAbsolutePathToOutputFile();
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsoluteFile) {
-#if GTEST_OS_WINDOWS
- GTEST_FLAG_SET(output, "xml:c:\\tmp\\filename.abc");
- EXPECT_EQ(FilePath("c:\\tmp\\filename.abc").string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-#else
- GTEST_FLAG_SET(output, "xml:/tmp/filename.abc");
- EXPECT_EQ(FilePath("/tmp/filename.abc").string(),
- UnitTestOptions::GetAbsolutePathToOutputFile());
-#endif
-}
-
-TEST_F(XmlOutputChangeDirTest, PreserveOriginalWorkingDirWithAbsolutePath) {
-#if GTEST_OS_WINDOWS
- const std::string path = "c:\\tmp\\";
-#else
- const std::string path = "/tmp/";
-#endif
-
- GTEST_FLAG_SET(output, "xml:" + path);
- const std::string expected_output_file =
- path + GetCurrentExecutableName().string() + ".xml";
- const std::string& output_file =
- UnitTestOptions::GetAbsolutePathToOutputFile();
-
-#if GTEST_OS_WINDOWS
- EXPECT_STRCASEEQ(expected_output_file.c_str(), output_file.c_str());
-#else
- EXPECT_EQ(expected_output_file, output_file.c_str());
-#endif
-}
-
-#endif // !GTEST_OS_FUCHSIA
-
-} // namespace
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test-golden-lin.txt b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test-golden-lin.txt
deleted file mode 100644
index 1f24fb7915..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test-golden-lin.txt
+++ /dev/null
@@ -1,1196 +0,0 @@
-The non-test part of the code is expected to have 2 failures.
-
-googletest-output-test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 2
- 3
-Stack trace: (omitted)
-
-[==========] Running 89 tests from 42 test suites.
-[----------] Global test environment set-up.
-FooEnvironment::SetUp() called.
-BarEnvironment::SetUp() called.
-[----------] 1 test from ADeathTest
-[ RUN ] ADeathTest.ShouldRunFirst
-[ OK ] ADeathTest.ShouldRunFirst
-[----------] 1 test from ATypedDeathTest/0, where TypeParam = int
-[ RUN ] ATypedDeathTest/0.ShouldRunFirst
-[ OK ] ATypedDeathTest/0.ShouldRunFirst
-[----------] 1 test from ATypedDeathTest/1, where TypeParam = double
-[ RUN ] ATypedDeathTest/1.ShouldRunFirst
-[ OK ] ATypedDeathTest/1.ShouldRunFirst
-[----------] 1 test from My/ATypeParamDeathTest/0, where TypeParam = int
-[ RUN ] My/ATypeParamDeathTest/0.ShouldRunFirst
-[ OK ] My/ATypeParamDeathTest/0.ShouldRunFirst
-[----------] 1 test from My/ATypeParamDeathTest/1, where TypeParam = double
-[ RUN ] My/ATypeParamDeathTest/1.ShouldRunFirst
-[ OK ] My/ATypeParamDeathTest/1.ShouldRunFirst
-[----------] 2 tests from PassingTest
-[ RUN ] PassingTest.PassingTest1
-[ OK ] PassingTest.PassingTest1
-[ RUN ] PassingTest.PassingTest2
-[ OK ] PassingTest.PassingTest2
-[----------] 2 tests from NonfatalFailureTest
-[ RUN ] NonfatalFailureTest.EscapesStringOperands
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- kGoldenString
- Which is: "\"Line"
- actual
- Which is: "actual \"string\""
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- golden
- Which is: "\"Line"
- actual
- Which is: "actual \"string\""
-Stack trace: (omitted)
-
-[ FAILED ] NonfatalFailureTest.EscapesStringOperands
-[ RUN ] NonfatalFailureTest.DiffForLongStrings
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- golden_str
- Which is: "\"Line\0 1\"\nLine 2"
- "Line 2"
-With diff:
-@@ -1,2 @@
--\"Line\0 1\"
- Line 2
-
-Stack trace: (omitted)
-
-[ FAILED ] NonfatalFailureTest.DiffForLongStrings
-[----------] 3 tests from FatalFailureTest
-[ RUN ] FatalFailureTest.FatalFailureInSubroutine
-(expecting a failure that x should be 1)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- x
- Which is: 2
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
-(expecting a failure that x should be 1)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- x
- Which is: 2
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
-(expecting a failure on false)
-googletest-output-test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[----------] 1 test from LoggingTest
-[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
-(expecting 2 failures on (3) >= (a[i]))
-i == 0
-i == 1
-googletest-output-test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 9
-Stack trace: (omitted)
-
-i == 2
-i == 3
-googletest-output-test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 6
-Stack trace: (omitted)
-
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-[----------] 7 tests from SCOPED_TRACETest
-[ RUN ] SCOPED_TRACETest.AcceptedValues
-googletest-output-test_.cc:#: Failure
-Failed
-Just checking that all these values work fine.
-Google Test trace:
-googletest-output-test_.cc:#: (null)
-googletest-output-test_.cc:#: 1337
-googletest-output-test_.cc:#: std::string
-googletest-output-test_.cc:#: literal string
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.AcceptedValues
-[ RUN ] SCOPED_TRACETest.ObeysScopes
-(expected to fail)
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and shouldn't have a trace.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and should have a trace.
-Google Test trace:
-googletest-output-test_.cc:#: Expected trace
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and shouldn't have a trace.
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.ObeysScopes
-[ RUN ] SCOPED_TRACETest.WorksInLoop
-(expected to fail)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 2
- n
- Which is: 1
-Google Test trace:
-googletest-output-test_.cc:#: i = 1
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- n
- Which is: 2
-Google Test trace:
-googletest-output-test_.cc:#: i = 2
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.WorksInLoop
-[ RUN ] SCOPED_TRACETest.WorksInSubroutine
-(expected to fail)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 2
- n
- Which is: 1
-Google Test trace:
-googletest-output-test_.cc:#: n = 1
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- n
- Which is: 2
-Google Test trace:
-googletest-output-test_.cc:#: n = 2
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
-[ RUN ] SCOPED_TRACETest.CanBeNested
-(expected to fail)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- n
- Which is: 2
-Google Test trace:
-googletest-output-test_.cc:#: n = 2
-googletest-output-test_.cc:#:
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.CanBeNested
-[ RUN ] SCOPED_TRACETest.CanBeRepeated
-(expected to fail)
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A.
-Google Test trace:
-googletest-output-test_.cc:#: A
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A and B.
-Google Test trace:
-googletest-output-test_.cc:#: B
-googletest-output-test_.cc:#: A
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A, B, and C.
-Google Test trace:
-googletest-output-test_.cc:#: C
-googletest-output-test_.cc:#: B
-googletest-output-test_.cc:#: A
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-This failure is expected, and should contain trace point A, B, and D.
-Google Test trace:
-googletest-output-test_.cc:#: D
-googletest-output-test_.cc:#: B
-googletest-output-test_.cc:#: A
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.CanBeRepeated
-[ RUN ] SCOPED_TRACETest.WorksConcurrently
-(expecting 6 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #1 (in thread B, only trace B alive).
-Google Test trace:
-googletest-output-test_.cc:#: Trace B
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #2 (in thread A, trace A & B both alive).
-Google Test trace:
-googletest-output-test_.cc:#: Trace A
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #3 (in thread B, trace A & B both alive).
-Google Test trace:
-googletest-output-test_.cc:#: Trace B
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #4 (in thread B, only trace A alive).
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #5 (in thread A, only trace A alive).
-Google Test trace:
-googletest-output-test_.cc:#: Trace A
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #6 (in thread A, no trace alive).
-Stack trace: (omitted)
-
-[ FAILED ] SCOPED_TRACETest.WorksConcurrently
-[----------] 1 test from ScopedTraceTest
-[ RUN ] ScopedTraceTest.WithExplicitFileAndLine
-googletest-output-test_.cc:#: Failure
-Failed
-Check that the trace is attached to a particular location.
-Google Test trace:
-explicit_file.cc:123: expected trace message
-Stack trace: (omitted)
-
-[ FAILED ] ScopedTraceTest.WithExplicitFileAndLine
-[----------] 1 test from NonFatalFailureInFixtureConstructorTest
-[ RUN ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-(expecting 5 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #1, in the test fixture c'tor.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #2, in SetUp().
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #3, in the test body.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #4, in TearDown.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #5, in the test fixture d'tor.
-Stack trace: (omitted)
-
-[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-[----------] 1 test from FatalFailureInFixtureConstructorTest
-[ RUN ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-(expecting 2 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #1, in the test fixture c'tor.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #2, in the test fixture d'tor.
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-[----------] 1 test from NonFatalFailureInSetUpTest
-[ RUN ] NonFatalFailureInSetUpTest.FailureInSetUp
-(expecting 4 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #1, in SetUp().
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #2, in the test function.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #3, in TearDown().
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #4, in the test fixture d'tor.
-Stack trace: (omitted)
-
-[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
-[----------] 1 test from FatalFailureInSetUpTest
-[ RUN ] FatalFailureInSetUpTest.FailureInSetUp
-(expecting 3 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #1, in SetUp().
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #2, in TearDown().
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected failure #3, in the test fixture d'tor.
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
-[----------] 1 test from AddFailureAtTest
-[ RUN ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-foo.cc:42: Failure
-Failed
-Expected nonfatal failure in foo.cc
-Stack trace: (omitted)
-
-[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-[----------] 1 test from GtestFailAtTest
-[ RUN ] GtestFailAtTest.MessageContainsSpecifiedFileAndLineNumber
-foo.cc:42: Failure
-Failed
-Expected fatal failure in foo.cc
-Stack trace: (omitted)
-
-[ FAILED ] GtestFailAtTest.MessageContainsSpecifiedFileAndLineNumber
-[----------] 4 tests from MixedUpTestSuiteTest
-[ RUN ] MixedUpTestSuiteTest.FirstTestFromNamespaceFoo
-[ OK ] MixedUpTestSuiteTest.FirstTestFromNamespaceFoo
-[ RUN ] MixedUpTestSuiteTest.SecondTestFromNamespaceFoo
-[ OK ] MixedUpTestSuiteTest.SecondTestFromNamespaceFoo
-[ RUN ] MixedUpTestSuiteTest.ThisShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class. However, in test suite MixedUpTestSuiteTest,
-you defined test FirstTestFromNamespaceFoo and test ThisShouldFail
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test suites.
-Stack trace: (omitted)
-
-[ FAILED ] MixedUpTestSuiteTest.ThisShouldFail
-[ RUN ] MixedUpTestSuiteTest.ThisShouldFailToo
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class. However, in test suite MixedUpTestSuiteTest,
-you defined test FirstTestFromNamespaceFoo and test ThisShouldFailToo
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test suites.
-Stack trace: (omitted)
-
-[ FAILED ] MixedUpTestSuiteTest.ThisShouldFailToo
-[----------] 2 tests from MixedUpTestSuiteWithSameTestNameTest
-[ RUN ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ OK ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ RUN ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class. However, in test suite MixedUpTestSuiteWithSameTestNameTest,
-you defined test TheSecondTestWithThisNameShouldFail and test TheSecondTestWithThisNameShouldFail
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test suites.
-Stack trace: (omitted)
-
-[ FAILED ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[----------] 2 tests from TEST_F_before_TEST_in_same_test_case
-[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
-[ OK ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTEST_F
-[ RUN ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class, so mixing TEST_F and TEST in the same test suite is
-illegal. In test suite TEST_F_before_TEST_in_same_test_case,
-test DefinedUsingTEST_F is defined using TEST_F but
-test DefinedUsingTESTAndShouldFail is defined using TEST. You probably
-want to change the TEST to TEST_F or move it to another test
-case.
-Stack trace: (omitted)
-
-[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-[----------] 2 tests from TEST_before_TEST_F_in_same_test_case
-[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
-[ OK ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST
-[ RUN ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class, so mixing TEST_F and TEST in the same test suite is
-illegal. In test suite TEST_before_TEST_F_in_same_test_case,
-test DefinedUsingTEST_FAndShouldFail is defined using TEST_F but
-test DefinedUsingTEST is defined using TEST. You probably
-want to change the TEST to TEST_F or move it to another test
-case.
-Stack trace: (omitted)
-
-[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-[----------] 8 tests from ExpectNonfatalFailureTest
-[ RUN ] ExpectNonfatalFailureTest.CanReferenceGlobalVariables
-[ OK ] ExpectNonfatalFailureTest.CanReferenceGlobalVariables
-[ RUN ] ExpectNonfatalFailureTest.CanReferenceLocalVariables
-[ OK ] ExpectNonfatalFailureTest.CanReferenceLocalVariables
-[ RUN ] ExpectNonfatalFailureTest.SucceedsWhenThereIsOneNonfatalFailure
-[ OK ] ExpectNonfatalFailureTest.SucceedsWhenThereIsOneNonfatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 2 failures
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure 1.
-Stack trace: (omitted)
-
-
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure 2.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-[ RUN ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-[----------] 8 tests from ExpectFatalFailureTest
-[ RUN ] ExpectFatalFailureTest.CanReferenceGlobalVariables
-[ OK ] ExpectFatalFailureTest.CanReferenceGlobalVariables
-[ RUN ] ExpectFatalFailureTest.CanReferenceLocalStaticVariables
-[ OK ] ExpectFatalFailureTest.CanReferenceLocalStaticVariables
-[ RUN ] ExpectFatalFailureTest.SucceedsWhenThereIsOneFatalFailure
-[ OK ] ExpectFatalFailureTest.SucceedsWhenThereIsOneFatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 2 failures
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-[ RUN ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-[ RUN ] ExpectFatalFailureTest.FailsWhenStatementReturns
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
-[ RUN ] ExpectFatalFailureTest.FailsWhenStatementThrows
-(expecting a failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
-[----------] 2 tests from TypedTest/0, where TypeParam = int
-[ RUN ] TypedTest/0.Success
-[ OK ] TypedTest/0.Success
-[ RUN ] TypedTest/0.Failure
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- TypeParam()
- Which is: 0
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] TypedTest/0.Failure, where TypeParam = int
-[----------] 2 tests from TypedTestWithNames/char0, where TypeParam = char
-[ RUN ] TypedTestWithNames/char0.Success
-[ OK ] TypedTestWithNames/char0.Success
-[ RUN ] TypedTestWithNames/char0.Failure
-googletest-output-test_.cc:#: Failure
-Failed
-Stack trace: (omitted)
-
-[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char
-[----------] 2 tests from TypedTestWithNames/int1, where TypeParam = int
-[ RUN ] TypedTestWithNames/int1.Success
-[ OK ] TypedTestWithNames/int1.Success
-[ RUN ] TypedTestWithNames/int1.Failure
-googletest-output-test_.cc:#: Failure
-Failed
-Stack trace: (omitted)
-
-[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int
-[----------] 2 tests from Unsigned/TypedTestP/0, where TypeParam = unsigned char
-[ RUN ] Unsigned/TypedTestP/0.Success
-[ OK ] Unsigned/TypedTestP/0.Success
-[ RUN ] Unsigned/TypedTestP/0.Failure
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1U
- Which is: 1
- TypeParam()
- Which is: '\0'
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[----------] 2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned int
-[ RUN ] Unsigned/TypedTestP/1.Success
-[ OK ] Unsigned/TypedTestP/1.Success
-[ RUN ] Unsigned/TypedTestP/1.Failure
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1U
- Which is: 1
- TypeParam()
- Which is: 0
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
-[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedChar0, where TypeParam = unsigned char
-[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Success
-[ OK ] UnsignedCustomName/TypedTestP/unsignedChar0.Success
-[ RUN ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1U
- Which is: 1
- TypeParam()
- Which is: '\0'
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char
-[----------] 2 tests from UnsignedCustomName/TypedTestP/unsignedInt1, where TypeParam = unsigned int
-[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Success
-[ OK ] UnsignedCustomName/TypedTestP/unsignedInt1.Success
-[ RUN ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1U
- Which is: 1
- TypeParam()
- Which is: 0
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int
-[----------] 4 tests from ExpectFailureTest
-[ RUN ] ExpectFailureTest.ExpectFatalFailure
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-googletest-output-test_.cc:#: Success:
-Succeeded
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure containing "Some other fatal failure expected."
- Actual:
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureTest.ExpectFatalFailure
-[ RUN ] ExpectFailureTest.ExpectNonFatalFailure
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-googletest-output-test_.cc:#: Success:
-Succeeded
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure containing "Some other non-fatal failure."
- Actual:
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
-[ RUN ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-googletest-output-test_.cc:#: Success:
-Succeeded
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual:
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 fatal failure containing "Some other fatal failure expected."
- Actual:
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-[ RUN ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-googletest-output-test_.cc:#: Success:
-Succeeded
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual:
-googletest-output-test_.cc:#: Fatal failure:
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-(expecting 1 failure)
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure containing "Some other non-fatal failure."
- Actual:
-googletest-output-test_.cc:#: Non-fatal failure:
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-[----------] 2 tests from ExpectFailureWithThreadsTest
-[ RUN ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-(expecting 2 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-gtest.cc:#: Failure
-Expected: 1 fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-[ RUN ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-(expecting 2 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-gtest.cc:#: Failure
-Expected: 1 non-fatal failure
- Actual: 0 failures
-Stack trace: (omitted)
-
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-[----------] 1 test from ScopedFakeTestPartResultReporterTest
-[ RUN ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-(expecting 2 failures)
-googletest-output-test_.cc:#: Failure
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-googletest-output-test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-[----------] 2 tests from DynamicFixture
-DynamicFixture::SetUpTestSuite
-[ RUN ] DynamicFixture.DynamicTestPass
-DynamicFixture()
-DynamicFixture::SetUp
-DynamicFixture::TearDown
-~DynamicFixture()
-[ OK ] DynamicFixture.DynamicTestPass
-[ RUN ] DynamicFixture.DynamicTestFail
-DynamicFixture()
-DynamicFixture::SetUp
-googletest-output-test_.cc:#: Failure
-Value of: Pass
- Actual: false
-Expected: true
-Stack trace: (omitted)
-
-DynamicFixture::TearDown
-~DynamicFixture()
-[ FAILED ] DynamicFixture.DynamicTestFail
-DynamicFixture::TearDownTestSuite
-[----------] 1 test from DynamicFixtureAnotherName
-DynamicFixture::SetUpTestSuite
-[ RUN ] DynamicFixtureAnotherName.DynamicTestPass
-DynamicFixture()
-DynamicFixture::SetUp
-DynamicFixture::TearDown
-~DynamicFixture()
-[ OK ] DynamicFixtureAnotherName.DynamicTestPass
-DynamicFixture::TearDownTestSuite
-[----------] 2 tests from BadDynamicFixture1
-DynamicFixture::SetUpTestSuite
-[ RUN ] BadDynamicFixture1.FixtureBase
-DynamicFixture()
-DynamicFixture::SetUp
-DynamicFixture::TearDown
-~DynamicFixture()
-[ OK ] BadDynamicFixture1.FixtureBase
-[ RUN ] BadDynamicFixture1.TestBase
-DynamicFixture()
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class, so mixing TEST_F and TEST in the same test suite is
-illegal. In test suite BadDynamicFixture1,
-test FixtureBase is defined using TEST_F but
-test TestBase is defined using TEST. You probably
-want to change the TEST to TEST_F or move it to another test
-case.
-Stack trace: (omitted)
-
-~DynamicFixture()
-[ FAILED ] BadDynamicFixture1.TestBase
-DynamicFixture::TearDownTestSuite
-[----------] 2 tests from BadDynamicFixture2
-DynamicFixture::SetUpTestSuite
-[ RUN ] BadDynamicFixture2.FixtureBase
-DynamicFixture()
-DynamicFixture::SetUp
-DynamicFixture::TearDown
-~DynamicFixture()
-[ OK ] BadDynamicFixture2.FixtureBase
-[ RUN ] BadDynamicFixture2.Derived
-DynamicFixture()
-gtest.cc:#: Failure
-Failed
-All tests in the same test suite must use the same test fixture
-class. However, in test suite BadDynamicFixture2,
-you defined test FixtureBase and test Derived
-using two different test fixture classes. This can happen if
-the two classes are from different namespaces or translation
-units and have the same name. You should probably rename one
-of the classes to put the tests into different test suites.
-Stack trace: (omitted)
-
-~DynamicFixture()
-[ FAILED ] BadDynamicFixture2.Derived
-DynamicFixture::TearDownTestSuite
-[----------] 1 test from TestSuiteThatFailsToSetUp
-googletest-output-test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-Stack trace: (omitted)
-
-[ RUN ] TestSuiteThatFailsToSetUp.ShouldNotRun
-googletest-output-test_.cc:#: Skipped
-
-[ SKIPPED ] TestSuiteThatFailsToSetUp.ShouldNotRun
-[----------] 1 test from PrintingFailingParams/FailingParamTest
-[ RUN ] PrintingFailingParams/FailingParamTest.Fails/0
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- GetParam()
- Which is: 2
-Stack trace: (omitted)
-
-[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
-[----------] 1 test from EmptyBasenameParamInst
-[ RUN ] EmptyBasenameParamInst.Passes/0
-[ OK ] EmptyBasenameParamInst.Passes/0
-[----------] 2 tests from PrintingStrings/ParamTest
-[ RUN ] PrintingStrings/ParamTest.Success/a
-[ OK ] PrintingStrings/ParamTest.Success/a
-[ RUN ] PrintingStrings/ParamTest.Failure/a
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- "b"
- GetParam()
- Which is: "a"
-Expected failure
-Stack trace: (omitted)
-
-[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
-[----------] 3 tests from GoogleTestVerification
-[ RUN ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<NoTests>
-googletest-output-test_.cc:#: Failure
-Parameterized test suite NoTests is instantiated via INSTANTIATE_TEST_SUITE_P, but no tests are defined via TEST_P . No test cases will run.
-
-Ideally, INSTANTIATE_TEST_SUITE_P should only ever be invoked from code that always depend on code that provides TEST_P. Failing to do so is often an indication of dead code, e.g. the last TEST_P was removed but the rest got left behind.
-
-To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NoTests);
-Stack trace: (omitted)
-
-[ FAILED ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<NoTests>
-[ RUN ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<DetectNotInstantiatedTest>
-googletest-output-test_.cc:#: Failure
-Parameterized test suite DetectNotInstantiatedTest is defined via TEST_P, but never instantiated. None of the test cases will run. Either no INSTANTIATE_TEST_SUITE_P is provided or the only ones provided expand to nothing.
-
-Ideally, TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
-
-To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DetectNotInstantiatedTest);
-Stack trace: (omitted)
-
-[ FAILED ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<DetectNotInstantiatedTest>
-[ RUN ] GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite<DetectNotInstantiatedTypesTest>
-googletest-output-test_.cc:#: Failure
-Type parameterized test suite DetectNotInstantiatedTypesTest is defined via REGISTER_TYPED_TEST_SUITE_P, but never instantiated via INSTANTIATE_TYPED_TEST_SUITE_P. None of the test cases will run.
-
-Ideally, TYPED_TEST_P definitions should only ever be included as part of binaries that intend to use them. (As opposed to, for example, being placed in a library that may be linked in to get other utilities.)
-
-To suppress this error for this test suite, insert the following line (in a non-header) in the namespace it is defined in:
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(DetectNotInstantiatedTypesTest);
-Stack trace: (omitted)
-
-[ FAILED ] GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite<DetectNotInstantiatedTypesTest>
-[----------] Global test environment tear-down
-BarEnvironment::TearDown() called.
-googletest-output-test_.cc:#: Failure
-Failed
-Expected non-fatal failure.
-Stack trace: (omitted)
-
-FooEnvironment::TearDown() called.
-googletest-output-test_.cc:#: Failure
-Failed
-Expected fatal failure.
-Stack trace: (omitted)
-
-[==========] 89 tests from 42 test suites ran.
-[ PASSED ] 31 tests.
-[ SKIPPED ] 1 test, listed below:
-[ SKIPPED ] TestSuiteThatFailsToSetUp.ShouldNotRun
-[ FAILED ] 57 tests, listed below:
-[ FAILED ] NonfatalFailureTest.EscapesStringOperands
-[ FAILED ] NonfatalFailureTest.DiffForLongStrings
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-[ FAILED ] SCOPED_TRACETest.AcceptedValues
-[ FAILED ] SCOPED_TRACETest.ObeysScopes
-[ FAILED ] SCOPED_TRACETest.WorksInLoop
-[ FAILED ] SCOPED_TRACETest.WorksInSubroutine
-[ FAILED ] SCOPED_TRACETest.CanBeNested
-[ FAILED ] SCOPED_TRACETest.CanBeRepeated
-[ FAILED ] SCOPED_TRACETest.WorksConcurrently
-[ FAILED ] ScopedTraceTest.WithExplicitFileAndLine
-[ FAILED ] NonFatalFailureInFixtureConstructorTest.FailureInConstructor
-[ FAILED ] FatalFailureInFixtureConstructorTest.FailureInConstructor
-[ FAILED ] NonFatalFailureInSetUpTest.FailureInSetUp
-[ FAILED ] FatalFailureInSetUpTest.FailureInSetUp
-[ FAILED ] AddFailureAtTest.MessageContainsSpecifiedFileAndLineNumber
-[ FAILED ] GtestFailAtTest.MessageContainsSpecifiedFileAndLineNumber
-[ FAILED ] MixedUpTestSuiteTest.ThisShouldFail
-[ FAILED ] MixedUpTestSuiteTest.ThisShouldFailToo
-[ FAILED ] MixedUpTestSuiteWithSameTestNameTest.TheSecondTestWithThisNameShouldFail
-[ FAILED ] TEST_F_before_TEST_in_same_test_case.DefinedUsingTESTAndShouldFail
-[ FAILED ] TEST_before_TEST_F_in_same_test_case.DefinedUsingTEST_FAndShouldFail
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsNoNonfatalFailure
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereAreTwoNonfatalFailures
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenThereIsOneFatalFailure
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementReturns
-[ FAILED ] ExpectNonfatalFailureTest.FailsWhenStatementThrows
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsNoFatalFailure
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereAreTwoFatalFailures
-[ FAILED ] ExpectFatalFailureTest.FailsWhenThereIsOneNonfatalFailure
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementReturns
-[ FAILED ] ExpectFatalFailureTest.FailsWhenStatementThrows
-[ FAILED ] TypedTest/0.Failure, where TypeParam = int
-[ FAILED ] TypedTestWithNames/char0.Failure, where TypeParam = char
-[ FAILED ] TypedTestWithNames/int1.Failure, where TypeParam = int
-[ FAILED ] Unsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
-[ FAILED ] Unsigned/TypedTestP/1.Failure, where TypeParam = unsigned int
-[ FAILED ] UnsignedCustomName/TypedTestP/unsignedChar0.Failure, where TypeParam = unsigned char
-[ FAILED ] UnsignedCustomName/TypedTestP/unsignedInt1.Failure, where TypeParam = unsigned int
-[ FAILED ] ExpectFailureTest.ExpectFatalFailure
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailure
-[ FAILED ] ExpectFailureTest.ExpectFatalFailureOnAllThreads
-[ FAILED ] ExpectFailureTest.ExpectNonFatalFailureOnAllThreads
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectFatalFailure
-[ FAILED ] ExpectFailureWithThreadsTest.ExpectNonFatalFailure
-[ FAILED ] ScopedFakeTestPartResultReporterTest.InterceptOnlyCurrentThread
-[ FAILED ] DynamicFixture.DynamicTestFail
-[ FAILED ] BadDynamicFixture1.TestBase
-[ FAILED ] BadDynamicFixture2.Derived
-[ FAILED ] PrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
-[ FAILED ] PrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
-[ FAILED ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<NoTests>
-[ FAILED ] GoogleTestVerification.UninstantiatedParameterizedTestSuite<DetectNotInstantiatedTest>
-[ FAILED ] GoogleTestVerification.UninstantiatedTypeParameterizedTestSuite<DetectNotInstantiatedTypesTest>
-
-57 FAILED TESTS
-[ FAILED ] TestSuiteThatFailsToSetUp: SetUpTestSuite or TearDownTestSuite
-
- 1 FAILED TEST SUITE
- YOU HAVE 1 DISABLED TEST
-
-Note: Google Test filter = FatalFailureTest.*:LoggingTest.*
-[==========] Running 4 tests from 2 test suites.
-[----------] Global test environment set-up.
-[----------] 3 tests from FatalFailureTest
-[ RUN ] FatalFailureTest.FatalFailureInSubroutine
-(expecting a failure that x should be 1)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- x
- Which is: 2
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine (? ms)
-[ RUN ] FatalFailureTest.FatalFailureInNestedSubroutine
-(expecting a failure that x should be 1)
-googletest-output-test_.cc:#: Failure
-Expected equality of these values:
- 1
- x
- Which is: 2
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine (? ms)
-[ RUN ] FatalFailureTest.NonfatalFailureInSubroutine
-(expecting a failure on false)
-googletest-output-test_.cc:#: Failure
-Value of: false
- Actual: false
-Expected: true
-Stack trace: (omitted)
-
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine (? ms)
-[----------] 3 tests from FatalFailureTest (? ms total)
-
-[----------] 1 test from LoggingTest
-[ RUN ] LoggingTest.InterleavingLoggingAndAssertions
-(expecting 2 failures on (3) >= (a[i]))
-i == 0
-i == 1
-googletest-output-test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 9
-Stack trace: (omitted)
-
-i == 2
-i == 3
-googletest-output-test_.cc:#: Failure
-Expected: (3) >= (a[i]), actual: 3 vs 6
-Stack trace: (omitted)
-
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions (? ms)
-[----------] 1 test from LoggingTest (? ms total)
-
-[----------] Global test environment tear-down
-[==========] 4 tests from 2 test suites ran. (? ms total)
-[ PASSED ] 0 tests.
-[ FAILED ] 4 tests, listed below:
-[ FAILED ] FatalFailureTest.FatalFailureInSubroutine
-[ FAILED ] FatalFailureTest.FatalFailureInNestedSubroutine
-[ FAILED ] FatalFailureTest.NonfatalFailureInSubroutine
-[ FAILED ] LoggingTest.InterleavingLoggingAndAssertions
-
- 4 FAILED TESTS
-Note: Google Test filter = *DISABLED_*
-[==========] Running 1 test from 1 test suite.
-[----------] Global test environment set-up.
-[----------] 1 test from DisabledTestsWarningTest
-[ RUN ] DisabledTestsWarningTest.DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning
-[ OK ] DisabledTestsWarningTest.DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning
-[----------] Global test environment tear-down
-[==========] 1 test from 1 test suite ran.
-[ PASSED ] 1 test.
-Note: Google Test filter = PassingTest.*
-Note: This is test shard 2 of 2.
-[==========] Running 1 test from 1 test suite.
-[----------] Global test environment set-up.
-[----------] 1 test from PassingTest
-[ RUN ] PassingTest.PassingTest2
-[ OK ] PassingTest.PassingTest2
-[----------] Global test environment tear-down
-[==========] 1 test from 1 test suite ran.
-[ PASSED ] 1 test.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test.py
deleted file mode 100755
index ff44483331..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test.py
+++ /dev/null
@@ -1,346 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-r"""Tests the text output of Google C++ Testing and Mocking Framework.
-
-To update the golden file:
-googletest_output_test.py --build_dir=BUILD/DIR --gengolden
-where BUILD/DIR contains the built googletest-output-test_ file.
-googletest_output_test.py --gengolden
-googletest_output_test.py
-"""
-
-import difflib
-import os
-import re
-import sys
-from googletest.test import gtest_test_utils
-
-
-# The flag for generating the golden file
-GENGOLDEN_FLAG = '--gengolden'
-CATCH_EXCEPTIONS_ENV_VAR_NAME = 'GTEST_CATCH_EXCEPTIONS'
-
-# The flag indicating stacktraces are not supported
-NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
-
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-IS_WINDOWS = os.name == 'nt'
-
-GOLDEN_NAME = 'googletest-output-test-golden-lin.txt'
-
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('googletest-output-test_')
-
-# At least one command we exercise must not have the
-# 'internal_skip_environment_and_ad_hoc_tests' argument.
-COMMAND_LIST_TESTS = ({}, [PROGRAM_PATH, '--gtest_list_tests'])
-COMMAND_WITH_COLOR = ({}, [PROGRAM_PATH, '--gtest_color=yes'])
-COMMAND_WITH_TIME = ({}, [PROGRAM_PATH,
- '--gtest_print_time',
- 'internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=FatalFailureTest.*:LoggingTest.*'])
-COMMAND_WITH_DISABLED = (
- {}, [PROGRAM_PATH,
- '--gtest_also_run_disabled_tests',
- 'internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=*DISABLED_*'])
-COMMAND_WITH_SHARDING = (
- {'GTEST_SHARD_INDEX': '1', 'GTEST_TOTAL_SHARDS': '2'},
- [PROGRAM_PATH,
- 'internal_skip_environment_and_ad_hoc_tests',
- '--gtest_filter=PassingTest.*'])
-
-GOLDEN_PATH = os.path.join(gtest_test_utils.GetSourceDir(), GOLDEN_NAME)
-
-
-def ToUnixLineEnding(s):
- """Changes all Windows/Mac line endings in s to UNIX line endings."""
-
- return s.replace('\r\n', '\n').replace('\r', '\n')
-
-
-def RemoveLocations(test_output):
- """Removes all file location info from a Google Test program's output.
-
- Args:
- test_output: the output of a Google Test program.
-
- Returns:
- output with all file location info (in the form of
- 'DIRECTORY/FILE_NAME:LINE_NUMBER: 'or
- 'DIRECTORY\\FILE_NAME(LINE_NUMBER): ') replaced by
- 'FILE_NAME:#: '.
- """
-
- return re.sub(r'.*[/\\]((googletest-output-test_|gtest).cc)(\:\d+|\(\d+\))\: ',
- r'\1:#: ', test_output)
-
-
-def RemoveStackTraceDetails(output):
- """Removes all stack traces from a Google Test program's output."""
-
- # *? means "find the shortest string that matches".
- return re.sub(r'Stack trace:(.|\n)*?\n\n',
- 'Stack trace: (omitted)\n\n', output)
-
-
-def RemoveStackTraces(output):
- """Removes all traces of stack traces from a Google Test program's output."""
-
- # *? means "find the shortest string that matches".
- return re.sub(r'Stack trace:(.|\n)*?\n\n', '', output)
-
-
-def RemoveTime(output):
- """Removes all time information from a Google Test program's output."""
-
- return re.sub(r'\(\d+ ms', '(? ms', output)
-
-
-def RemoveTypeInfoDetails(test_output):
- """Removes compiler-specific type info from Google Test program's output.
-
- Args:
- test_output: the output of a Google Test program.
-
- Returns:
- output with type information normalized to canonical form.
- """
-
- # some compilers output the name of type 'unsigned int' as 'unsigned'
- return re.sub(r'unsigned int', 'unsigned', test_output)
-
-
-def NormalizeToCurrentPlatform(test_output):
- """Normalizes platform specific output details for easier comparison."""
-
- if IS_WINDOWS:
- # Removes the color information that is not present on Windows.
- test_output = re.sub('\x1b\\[(0;3\d)?m', '', test_output)
- # Changes failure message headers into the Windows format.
- test_output = re.sub(r': Failure\n', r': error: ', test_output)
- # Changes file(line_number) to file:line_number.
- test_output = re.sub(r'((\w|\.)+)\((\d+)\):', r'\1:\3:', test_output)
-
- return test_output
-
-
-def RemoveTestCounts(output):
- """Removes test counts from a Google Test program's output."""
-
- output = re.sub(r'\d+ tests?, listed below',
- '? tests, listed below', output)
- output = re.sub(r'\d+ FAILED TESTS',
- '? FAILED TESTS', output)
- output = re.sub(r'\d+ tests? from \d+ test cases?',
- '? tests from ? test cases', output)
- output = re.sub(r'\d+ tests? from ([a-zA-Z_])',
- r'? tests from \1', output)
- return re.sub(r'\d+ tests?\.', '? tests.', output)
-
-
-def RemoveMatchingTests(test_output, pattern):
- """Removes output of specified tests from a Google Test program's output.
-
- This function strips not only the beginning and the end of a test but also
- all output in between.
-
- Args:
- test_output: A string containing the test output.
- pattern: A regex string that matches names of test cases or
- tests to remove.
-
- Returns:
- Contents of test_output with tests whose names match pattern removed.
- """
-
- test_output = re.sub(
- r'.*\[ RUN \] .*%s(.|\n)*?\[( FAILED | OK )\] .*%s.*\n' % (
- pattern, pattern),
- '',
- test_output)
- return re.sub(r'.*%s.*\n' % pattern, '', test_output)
-
-
-def NormalizeOutput(output):
- """Normalizes output (the output of googletest-output-test_.exe)."""
-
- output = ToUnixLineEnding(output)
- output = RemoveLocations(output)
- output = RemoveStackTraceDetails(output)
- output = RemoveTime(output)
- return output
-
-
-def GetShellCommandOutput(env_cmd):
- """Runs a command in a sub-process, and returns its output in a string.
-
- Args:
- env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
- environment variables to set, and element 1 is a string with
- the command and any flags.
-
- Returns:
- A string with the command's combined standard and diagnostic output.
- """
-
- # Spawns cmd in a sub-process, and gets its standard I/O file objects.
- # Set and save the environment properly.
- environ = os.environ.copy()
- environ.update(env_cmd[0])
- p = gtest_test_utils.Subprocess(env_cmd[1], env=environ)
-
- return p.output
-
-
-def GetCommandOutput(env_cmd):
- """Runs a command and returns its output with all file location
- info stripped off.
-
- Args:
- env_cmd: The shell command. A 2-tuple where element 0 is a dict of extra
- environment variables to set, and element 1 is a string with
- the command and any flags.
- """
-
- # Disables exception pop-ups on Windows.
- environ, cmdline = env_cmd
- environ = dict(environ) # Ensures we are modifying a copy.
- environ[CATCH_EXCEPTIONS_ENV_VAR_NAME] = '1'
- return NormalizeOutput(GetShellCommandOutput((environ, cmdline)))
-
-
-def GetOutputOfAllCommands():
- """Returns concatenated output from several representative commands."""
-
- return (GetCommandOutput(COMMAND_WITH_COLOR) +
- GetCommandOutput(COMMAND_WITH_TIME) +
- GetCommandOutput(COMMAND_WITH_DISABLED) +
- GetCommandOutput(COMMAND_WITH_SHARDING))
-
-
-test_list = GetShellCommandOutput(COMMAND_LIST_TESTS)
-SUPPORTS_DEATH_TESTS = 'DeathTest' in test_list
-SUPPORTS_TYPED_TESTS = 'TypedTest' in test_list
-SUPPORTS_THREADS = 'ExpectFailureWithThreadsTest' in test_list
-SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
-
-CAN_GENERATE_GOLDEN_FILE = (SUPPORTS_DEATH_TESTS and
- SUPPORTS_TYPED_TESTS and
- SUPPORTS_THREADS and
- SUPPORTS_STACK_TRACES)
-
-class GTestOutputTest(gtest_test_utils.TestCase):
- def RemoveUnsupportedTests(self, test_output):
- if not SUPPORTS_DEATH_TESTS:
- test_output = RemoveMatchingTests(test_output, 'DeathTest')
- if not SUPPORTS_TYPED_TESTS:
- test_output = RemoveMatchingTests(test_output, 'TypedTest')
- test_output = RemoveMatchingTests(test_output, 'TypedDeathTest')
- test_output = RemoveMatchingTests(test_output, 'TypeParamDeathTest')
- if not SUPPORTS_THREADS:
- test_output = RemoveMatchingTests(test_output,
- 'ExpectFailureWithThreadsTest')
- test_output = RemoveMatchingTests(test_output,
- 'ScopedFakeTestPartResultReporterTest')
- test_output = RemoveMatchingTests(test_output,
- 'WorksConcurrently')
- if not SUPPORTS_STACK_TRACES:
- test_output = RemoveStackTraces(test_output)
-
- return test_output
-
- def testOutput(self):
- output = GetOutputOfAllCommands()
-
- golden_file = open(GOLDEN_PATH, 'rb')
- # A mis-configured source control system can cause \r appear in EOL
- # sequences when we read the golden file irrespective of an operating
- # system used. Therefore, we need to strip those \r's from newlines
- # unconditionally.
- golden = ToUnixLineEnding(golden_file.read().decode())
- golden_file.close()
-
- # We want the test to pass regardless of certain features being
- # supported or not.
-
- # We still have to remove type name specifics in all cases.
- normalized_actual = RemoveTypeInfoDetails(output)
- normalized_golden = RemoveTypeInfoDetails(golden)
-
- if CAN_GENERATE_GOLDEN_FILE:
- self.assertEqual(normalized_golden, normalized_actual,
- '\n'.join(difflib.unified_diff(
- normalized_golden.split('\n'),
- normalized_actual.split('\n'),
- 'golden', 'actual')))
- else:
- normalized_actual = NormalizeToCurrentPlatform(
- RemoveTestCounts(normalized_actual))
- normalized_golden = NormalizeToCurrentPlatform(
- RemoveTestCounts(self.RemoveUnsupportedTests(normalized_golden)))
-
- # This code is very handy when debugging golden file differences:
- if os.getenv('DEBUG_GTEST_OUTPUT_TEST'):
- open(os.path.join(
- gtest_test_utils.GetSourceDir(),
- '_googletest-output-test_normalized_actual.txt'), 'wb').write(
- normalized_actual)
- open(os.path.join(
- gtest_test_utils.GetSourceDir(),
- '_googletest-output-test_normalized_golden.txt'), 'wb').write(
- normalized_golden)
-
- self.assertEqual(normalized_golden, normalized_actual)
-
-
-if __name__ == '__main__':
- if NO_STACKTRACE_SUPPORT_FLAG in sys.argv:
- # unittest.main() can't handle unknown flags
- sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
-
- if GENGOLDEN_FLAG in sys.argv:
- if CAN_GENERATE_GOLDEN_FILE:
- output = GetOutputOfAllCommands()
- golden_file = open(GOLDEN_PATH, 'wb')
- golden_file.write(output.encode())
- golden_file.close()
- else:
- message = (
- """Unable to write a golden file when compiled in an environment
-that does not support all the required features (death tests,
-typed tests, stack traces, and multiple threads).
-Please build this test and generate the golden file using Blaze on Linux.""")
-
- sys.stderr.write(message)
- sys.exit(1)
- else:
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test_.cc
deleted file mode 100644
index b0ad52ca3e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-output-test_.cc
+++ /dev/null
@@ -1,1116 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The purpose of this file is to generate Google Test output under
-// various conditions. The output will then be verified by
-// googletest-output-test.py to ensure that Google Test generates the
-// desired messages. Therefore, most tests in this file are MEANT TO
-// FAIL.
-
-#include "gtest/gtest-spi.h"
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-#include <stdlib.h>
-
-#if _MSC_VER
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */)
-#endif // _MSC_VER
-
-#if GTEST_IS_THREADSAFE
-using testing::ScopedFakeTestPartResultReporter;
-using testing::TestPartResultArray;
-
-using testing::internal::Notification;
-using testing::internal::ThreadWithParam;
-#endif
-
-namespace posix = ::testing::internal::posix;
-
-// Tests catching fatal failures.
-
-// A subroutine used by the following test.
-void TestEq1(int x) {
- ASSERT_EQ(1, x);
-}
-
-// This function calls a test subroutine, catches the fatal failure it
-// generates, and then returns early.
-void TryTestSubroutine() {
- // Calls a subrountine that yields a fatal failure.
- TestEq1(2);
-
- // Catches the fatal failure and aborts the test.
- //
- // The testing::Test:: prefix is necessary when calling
- // HasFatalFailure() outside of a TEST, TEST_F, or test fixture.
- if (testing::Test::HasFatalFailure()) return;
-
- // If we get here, something is wrong.
- FAIL() << "This should never be reached.";
-}
-
-TEST(PassingTest, PassingTest1) {
-}
-
-TEST(PassingTest, PassingTest2) {
-}
-
-// Tests that parameters of failing parameterized tests are printed in the
-// failing test summary.
-class FailingParamTest : public testing::TestWithParam<int> {};
-
-TEST_P(FailingParamTest, Fails) {
- EXPECT_EQ(1, GetParam());
-}
-
-// This generates a test which will fail. Google Test is expected to print
-// its parameter when it outputs the list of all failed tests.
-INSTANTIATE_TEST_SUITE_P(PrintingFailingParams,
- FailingParamTest,
- testing::Values(2));
-
-// Tests that an empty value for the test suite basename yields just
-// the test name without any prior /
-class EmptyBasenameParamInst : public testing::TestWithParam<int> {};
-
-TEST_P(EmptyBasenameParamInst, Passes) { EXPECT_EQ(1, GetParam()); }
-
-INSTANTIATE_TEST_SUITE_P(, EmptyBasenameParamInst, testing::Values(1));
-
-static const char kGoldenString[] = "\"Line\0 1\"\nLine 2";
-
-TEST(NonfatalFailureTest, EscapesStringOperands) {
- std::string actual = "actual \"string\"";
- EXPECT_EQ(kGoldenString, actual);
-
- const char* golden = kGoldenString;
- EXPECT_EQ(golden, actual);
-}
-
-TEST(NonfatalFailureTest, DiffForLongStrings) {
- std::string golden_str(kGoldenString, sizeof(kGoldenString) - 1);
- EXPECT_EQ(golden_str, "Line 2");
-}
-
-// Tests catching a fatal failure in a subroutine.
-TEST(FatalFailureTest, FatalFailureInSubroutine) {
- printf("(expecting a failure that x should be 1)\n");
-
- TryTestSubroutine();
-}
-
-// Tests catching a fatal failure in a nested subroutine.
-TEST(FatalFailureTest, FatalFailureInNestedSubroutine) {
- printf("(expecting a failure that x should be 1)\n");
-
- // Calls a subrountine that yields a fatal failure.
- TryTestSubroutine();
-
- // Catches the fatal failure and aborts the test.
- //
- // When calling HasFatalFailure() inside a TEST, TEST_F, or test
- // fixture, the testing::Test:: prefix is not needed.
- if (HasFatalFailure()) return;
-
- // If we get here, something is wrong.
- FAIL() << "This should never be reached.";
-}
-
-// Tests HasFatalFailure() after a failed EXPECT check.
-TEST(FatalFailureTest, NonfatalFailureInSubroutine) {
- printf("(expecting a failure on false)\n");
- EXPECT_TRUE(false); // Generates a nonfatal failure
- ASSERT_FALSE(HasFatalFailure()); // This should succeed.
-}
-
-// Tests interleaving user logging and Google Test assertions.
-TEST(LoggingTest, InterleavingLoggingAndAssertions) {
- static const int a[4] = {
- 3, 9, 2, 6
- };
-
- printf("(expecting 2 failures on (3) >= (a[i]))\n");
- for (int i = 0; i < static_cast<int>(sizeof(a)/sizeof(*a)); i++) {
- printf("i == %d\n", i);
- EXPECT_GE(3, a[i]);
- }
-}
-
-// Tests the SCOPED_TRACE macro.
-
-// A helper function for testing SCOPED_TRACE.
-void SubWithoutTrace(int n) {
- EXPECT_EQ(1, n);
- ASSERT_EQ(2, n);
-}
-
-// Another helper function for testing SCOPED_TRACE.
-void SubWithTrace(int n) {
- SCOPED_TRACE(testing::Message() << "n = " << n);
-
- SubWithoutTrace(n);
-}
-
-TEST(SCOPED_TRACETest, AcceptedValues) {
- SCOPED_TRACE("literal string");
- SCOPED_TRACE(std::string("std::string"));
- SCOPED_TRACE(1337); // streamable type
- const char* null_value = nullptr;
- SCOPED_TRACE(null_value);
-
- ADD_FAILURE() << "Just checking that all these values work fine.";
-}
-
-// Tests that SCOPED_TRACE() obeys lexical scopes.
-TEST(SCOPED_TRACETest, ObeysScopes) {
- printf("(expected to fail)\n");
-
- // There should be no trace before SCOPED_TRACE() is invoked.
- ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
-
- {
- SCOPED_TRACE("Expected trace");
- // After SCOPED_TRACE(), a failure in the current scope should contain
- // the trace.
- ADD_FAILURE() << "This failure is expected, and should have a trace.";
- }
-
- // Once the control leaves the scope of the SCOPED_TRACE(), there
- // should be no trace again.
- ADD_FAILURE() << "This failure is expected, and shouldn't have a trace.";
-}
-
-// Tests that SCOPED_TRACE works inside a loop.
-TEST(SCOPED_TRACETest, WorksInLoop) {
- printf("(expected to fail)\n");
-
- for (int i = 1; i <= 2; i++) {
- SCOPED_TRACE(testing::Message() << "i = " << i);
-
- SubWithoutTrace(i);
- }
-}
-
-// Tests that SCOPED_TRACE works in a subroutine.
-TEST(SCOPED_TRACETest, WorksInSubroutine) {
- printf("(expected to fail)\n");
-
- SubWithTrace(1);
- SubWithTrace(2);
-}
-
-// Tests that SCOPED_TRACE can be nested.
-TEST(SCOPED_TRACETest, CanBeNested) {
- printf("(expected to fail)\n");
-
- SCOPED_TRACE(""); // A trace without a message.
-
- SubWithTrace(2);
-}
-
-// Tests that multiple SCOPED_TRACEs can be used in the same scope.
-TEST(SCOPED_TRACETest, CanBeRepeated) {
- printf("(expected to fail)\n");
-
- SCOPED_TRACE("A");
- ADD_FAILURE()
- << "This failure is expected, and should contain trace point A.";
-
- SCOPED_TRACE("B");
- ADD_FAILURE()
- << "This failure is expected, and should contain trace point A and B.";
-
- {
- SCOPED_TRACE("C");
- ADD_FAILURE() << "This failure is expected, and should "
- << "contain trace point A, B, and C.";
- }
-
- SCOPED_TRACE("D");
- ADD_FAILURE() << "This failure is expected, and should "
- << "contain trace point A, B, and D.";
-}
-
-#if GTEST_IS_THREADSAFE
-// Tests that SCOPED_TRACE()s can be used concurrently from multiple
-// threads. Namely, an assertion should be affected by
-// SCOPED_TRACE()s in its own thread only.
-
-// Here's the sequence of actions that happen in the test:
-//
-// Thread A (main) | Thread B (spawned)
-// ===============================|================================
-// spawns thread B |
-// -------------------------------+--------------------------------
-// waits for n1 | SCOPED_TRACE("Trace B");
-// | generates failure #1
-// | notifies n1
-// -------------------------------+--------------------------------
-// SCOPED_TRACE("Trace A"); | waits for n2
-// generates failure #2 |
-// notifies n2 |
-// -------------------------------|--------------------------------
-// waits for n3 | generates failure #3
-// | trace B dies
-// | generates failure #4
-// | notifies n3
-// -------------------------------|--------------------------------
-// generates failure #5 | finishes
-// trace A dies |
-// generates failure #6 |
-// -------------------------------|--------------------------------
-// waits for thread B to finish |
-
-struct CheckPoints {
- Notification n1;
- Notification n2;
- Notification n3;
-};
-
-static void ThreadWithScopedTrace(CheckPoints* check_points) {
- {
- SCOPED_TRACE("Trace B");
- ADD_FAILURE()
- << "Expected failure #1 (in thread B, only trace B alive).";
- check_points->n1.Notify();
- check_points->n2.WaitForNotification();
-
- ADD_FAILURE()
- << "Expected failure #3 (in thread B, trace A & B both alive).";
- } // Trace B dies here.
- ADD_FAILURE()
- << "Expected failure #4 (in thread B, only trace A alive).";
- check_points->n3.Notify();
-}
-
-TEST(SCOPED_TRACETest, WorksConcurrently) {
- printf("(expecting 6 failures)\n");
-
- CheckPoints check_points;
- ThreadWithParam<CheckPoints*> thread(&ThreadWithScopedTrace, &check_points,
- nullptr);
- check_points.n1.WaitForNotification();
-
- {
- SCOPED_TRACE("Trace A");
- ADD_FAILURE()
- << "Expected failure #2 (in thread A, trace A & B both alive).";
- check_points.n2.Notify();
- check_points.n3.WaitForNotification();
-
- ADD_FAILURE()
- << "Expected failure #5 (in thread A, only trace A alive).";
- } // Trace A dies here.
- ADD_FAILURE()
- << "Expected failure #6 (in thread A, no trace alive).";
- thread.Join();
-}
-#endif // GTEST_IS_THREADSAFE
-
-// Tests basic functionality of the ScopedTrace utility (most of its features
-// are already tested in SCOPED_TRACETest).
-TEST(ScopedTraceTest, WithExplicitFileAndLine) {
- testing::ScopedTrace trace("explicit_file.cc", 123, "expected trace message");
- ADD_FAILURE() << "Check that the trace is attached to a particular location.";
-}
-
-TEST(DisabledTestsWarningTest,
- DISABLED_AlsoRunDisabledTestsFlagSuppressesWarning) {
- // This test body is intentionally empty. Its sole purpose is for
- // verifying that the --gtest_also_run_disabled_tests flag
- // suppresses the "YOU HAVE 12 DISABLED TESTS" warning at the end of
- // the test output.
-}
-
-// Tests using assertions outside of TEST and TEST_F.
-//
-// This function creates two failures intentionally.
-void AdHocTest() {
- printf("The non-test part of the code is expected to have 2 failures.\n\n");
- EXPECT_TRUE(false);
- EXPECT_EQ(2, 3);
-}
-
-// Runs all TESTs, all TEST_Fs, and the ad hoc test.
-int RunAllTests() {
- AdHocTest();
- return RUN_ALL_TESTS();
-}
-
-// Tests non-fatal failures in the fixture constructor.
-class NonFatalFailureInFixtureConstructorTest : public testing::Test {
- protected:
- NonFatalFailureInFixtureConstructorTest() {
- printf("(expecting 5 failures)\n");
- ADD_FAILURE() << "Expected failure #1, in the test fixture c'tor.";
- }
-
- ~NonFatalFailureInFixtureConstructorTest() override {
- ADD_FAILURE() << "Expected failure #5, in the test fixture d'tor.";
- }
-
- void SetUp() override { ADD_FAILURE() << "Expected failure #2, in SetUp()."; }
-
- void TearDown() override {
- ADD_FAILURE() << "Expected failure #4, in TearDown.";
- }
-};
-
-TEST_F(NonFatalFailureInFixtureConstructorTest, FailureInConstructor) {
- ADD_FAILURE() << "Expected failure #3, in the test body.";
-}
-
-// Tests fatal failures in the fixture constructor.
-class FatalFailureInFixtureConstructorTest : public testing::Test {
- protected:
- FatalFailureInFixtureConstructorTest() {
- printf("(expecting 2 failures)\n");
- Init();
- }
-
- ~FatalFailureInFixtureConstructorTest() override {
- ADD_FAILURE() << "Expected failure #2, in the test fixture d'tor.";
- }
-
- void SetUp() override {
- ADD_FAILURE() << "UNEXPECTED failure in SetUp(). "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
- }
-
- void TearDown() override {
- ADD_FAILURE() << "UNEXPECTED failure in TearDown(). "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
- }
-
- private:
- void Init() {
- FAIL() << "Expected failure #1, in the test fixture c'tor.";
- }
-};
-
-TEST_F(FatalFailureInFixtureConstructorTest, FailureInConstructor) {
- ADD_FAILURE() << "UNEXPECTED failure in the test body. "
- << "We should never get here, as the test fixture c'tor "
- << "had a fatal failure.";
-}
-
-// Tests non-fatal failures in SetUp().
-class NonFatalFailureInSetUpTest : public testing::Test {
- protected:
- ~NonFatalFailureInSetUpTest() override { Deinit(); }
-
- void SetUp() override {
- printf("(expecting 4 failures)\n");
- ADD_FAILURE() << "Expected failure #1, in SetUp().";
- }
-
- void TearDown() override { FAIL() << "Expected failure #3, in TearDown()."; }
-
- private:
- void Deinit() {
- FAIL() << "Expected failure #4, in the test fixture d'tor.";
- }
-};
-
-TEST_F(NonFatalFailureInSetUpTest, FailureInSetUp) {
- FAIL() << "Expected failure #2, in the test function.";
-}
-
-// Tests fatal failures in SetUp().
-class FatalFailureInSetUpTest : public testing::Test {
- protected:
- ~FatalFailureInSetUpTest() override { Deinit(); }
-
- void SetUp() override {
- printf("(expecting 3 failures)\n");
- FAIL() << "Expected failure #1, in SetUp().";
- }
-
- void TearDown() override { FAIL() << "Expected failure #2, in TearDown()."; }
-
- private:
- void Deinit() {
- FAIL() << "Expected failure #3, in the test fixture d'tor.";
- }
-};
-
-TEST_F(FatalFailureInSetUpTest, FailureInSetUp) {
- FAIL() << "UNEXPECTED failure in the test function. "
- << "We should never get here, as SetUp() failed.";
-}
-
-TEST(AddFailureAtTest, MessageContainsSpecifiedFileAndLineNumber) {
- ADD_FAILURE_AT("foo.cc", 42) << "Expected nonfatal failure in foo.cc";
-}
-
-TEST(GtestFailAtTest, MessageContainsSpecifiedFileAndLineNumber) {
- GTEST_FAIL_AT("foo.cc", 42) << "Expected fatal failure in foo.cc";
-}
-
-// The MixedUpTestSuiteTest test case verifies that Google Test will fail a
-// test if it uses a different fixture class than what other tests in
-// the same test case use. It deliberately contains two fixture
-// classes with the same name but defined in different namespaces.
-
-// The MixedUpTestSuiteWithSameTestNameTest test case verifies that
-// when the user defines two tests with the same test case name AND
-// same test name (but in different namespaces), the second test will
-// fail.
-
-namespace foo {
-
-class MixedUpTestSuiteTest : public testing::Test {
-};
-
-TEST_F(MixedUpTestSuiteTest, FirstTestFromNamespaceFoo) {}
-TEST_F(MixedUpTestSuiteTest, SecondTestFromNamespaceFoo) {}
-
-class MixedUpTestSuiteWithSameTestNameTest : public testing::Test {
-};
-
-TEST_F(MixedUpTestSuiteWithSameTestNameTest,
- TheSecondTestWithThisNameShouldFail) {}
-
-} // namespace foo
-
-namespace bar {
-
-class MixedUpTestSuiteTest : public testing::Test {
-};
-
-// The following two tests are expected to fail. We rely on the
-// golden file to check that Google Test generates the right error message.
-TEST_F(MixedUpTestSuiteTest, ThisShouldFail) {}
-TEST_F(MixedUpTestSuiteTest, ThisShouldFailToo) {}
-
-class MixedUpTestSuiteWithSameTestNameTest : public testing::Test {
-};
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST_F(MixedUpTestSuiteWithSameTestNameTest,
- TheSecondTestWithThisNameShouldFail) {}
-
-} // namespace bar
-
-// The following two test cases verify that Google Test catches the user
-// error of mixing TEST and TEST_F in the same test case. The first
-// test case checks the scenario where TEST_F appears before TEST, and
-// the second one checks where TEST appears before TEST_F.
-
-class TEST_F_before_TEST_in_same_test_case : public testing::Test {
-};
-
-TEST_F(TEST_F_before_TEST_in_same_test_case, DefinedUsingTEST_F) {}
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST(TEST_F_before_TEST_in_same_test_case, DefinedUsingTESTAndShouldFail) {}
-
-class TEST_before_TEST_F_in_same_test_case : public testing::Test {
-};
-
-TEST(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST) {}
-
-// Expected to fail. We rely on the golden file to check that Google Test
-// generates the right error message.
-TEST_F(TEST_before_TEST_F_in_same_test_case, DefinedUsingTEST_FAndShouldFail) {
-}
-
-// Used for testing EXPECT_NONFATAL_FAILURE() and EXPECT_FATAL_FAILURE().
-int global_integer = 0;
-
-// Tests that EXPECT_NONFATAL_FAILURE() can reference global variables.
-TEST(ExpectNonfatalFailureTest, CanReferenceGlobalVariables) {
- global_integer = 0;
- EXPECT_NONFATAL_FAILURE({
- EXPECT_EQ(1, global_integer) << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() can reference local variables
-// (static or not).
-TEST(ExpectNonfatalFailureTest, CanReferenceLocalVariables) {
- int m = 0;
- static int n;
- n = 1;
- EXPECT_NONFATAL_FAILURE({
- EXPECT_EQ(m, n) << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() succeeds when there is exactly
-// one non-fatal failure and no fatal failure.
-TEST(ExpectNonfatalFailureTest, SucceedsWhenThereIsOneNonfatalFailure) {
- EXPECT_NONFATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure.";
- }, "Expected non-fatal failure.");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there is no
-// non-fatal failure.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereIsNoNonfatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there are two
-// non-fatal failures.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereAreTwoNonfatalFailures) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure 1.";
- ADD_FAILURE() << "Expected non-fatal failure 2.";
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when there is one fatal
-// failure.
-TEST(ExpectNonfatalFailureTest, FailsWhenThereIsOneFatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- FAIL() << "Expected fatal failure.";
- }, "");
-}
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
-// tested returns.
-TEST(ExpectNonfatalFailureTest, FailsWhenStatementReturns) {
- printf("(expecting a failure)\n");
- EXPECT_NONFATAL_FAILURE({
- return;
- }, "");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_NONFATAL_FAILURE() fails when the statement being
-// tested throws.
-TEST(ExpectNonfatalFailureTest, FailsWhenStatementThrows) {
- printf("(expecting a failure)\n");
- try {
- EXPECT_NONFATAL_FAILURE({
- throw 0;
- }, "");
- } catch(int) { // NOLINT
- }
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_FATAL_FAILURE() can reference global variables.
-TEST(ExpectFatalFailureTest, CanReferenceGlobalVariables) {
- global_integer = 0;
- EXPECT_FATAL_FAILURE({
- ASSERT_EQ(1, global_integer) << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() can reference local static
-// variables.
-TEST(ExpectFatalFailureTest, CanReferenceLocalStaticVariables) {
- static int n;
- n = 1;
- EXPECT_FATAL_FAILURE({
- ASSERT_EQ(0, n) << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() succeeds when there is exactly
-// one fatal failure and no non-fatal failure.
-TEST(ExpectFatalFailureTest, SucceedsWhenThereIsOneFatalFailure) {
- EXPECT_FATAL_FAILURE({
- FAIL() << "Expected fatal failure.";
- }, "Expected fatal failure.");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there is no fatal
-// failure.
-TEST(ExpectFatalFailureTest, FailsWhenThereIsNoFatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- }, "");
-}
-
-// A helper for generating a fatal failure.
-void FatalFailure() {
- FAIL() << "Expected fatal failure.";
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there are two
-// fatal failures.
-TEST(ExpectFatalFailureTest, FailsWhenThereAreTwoFatalFailures) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- FatalFailure();
- FatalFailure();
- }, "");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when there is one non-fatal
-// failure.
-TEST(ExpectFatalFailureTest, FailsWhenThereIsOneNonfatalFailure) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- ADD_FAILURE() << "Expected non-fatal failure.";
- }, "");
-}
-
-// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
-// tested returns.
-TEST(ExpectFatalFailureTest, FailsWhenStatementReturns) {
- printf("(expecting a failure)\n");
- EXPECT_FATAL_FAILURE({
- return;
- }, "");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests that EXPECT_FATAL_FAILURE() fails when the statement being
-// tested throws.
-TEST(ExpectFatalFailureTest, FailsWhenStatementThrows) {
- printf("(expecting a failure)\n");
- try {
- EXPECT_FATAL_FAILURE({
- throw 0;
- }, "");
- } catch(int) { // NOLINT
- }
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// This #ifdef block tests the output of value-parameterized tests.
-
-std::string ParamNameFunc(const testing::TestParamInfo<std::string>& info) {
- return info.param;
-}
-
-class ParamTest : public testing::TestWithParam<std::string> {
-};
-
-TEST_P(ParamTest, Success) {
- EXPECT_EQ("a", GetParam());
-}
-
-TEST_P(ParamTest, Failure) {
- EXPECT_EQ("b", GetParam()) << "Expected failure";
-}
-
-INSTANTIATE_TEST_SUITE_P(PrintingStrings,
- ParamTest,
- testing::Values(std::string("a")),
- ParamNameFunc);
-
-// The case where a suite has INSTANTIATE_TEST_SUITE_P but not TEST_P.
-using NoTests = ParamTest;
-INSTANTIATE_TEST_SUITE_P(ThisIsOdd, NoTests, ::testing::Values("Hello"));
-
-// fails under kErrorOnUninstantiatedParameterizedTest=true
-class DetectNotInstantiatedTest : public testing::TestWithParam<int> {};
-TEST_P(DetectNotInstantiatedTest, Used) { }
-
-// This would make the test failure from the above go away.
-// INSTANTIATE_TEST_SUITE_P(Fix, DetectNotInstantiatedTest, testing::Values(1));
-
-template <typename T>
-class TypedTest : public testing::Test {
-};
-
-TYPED_TEST_SUITE(TypedTest, testing::Types<int>);
-
-TYPED_TEST(TypedTest, Success) {
- EXPECT_EQ(0, TypeParam());
-}
-
-TYPED_TEST(TypedTest, Failure) {
- EXPECT_EQ(1, TypeParam()) << "Expected failure";
-}
-
-typedef testing::Types<char, int> TypesForTestWithNames;
-
-template <typename T>
-class TypedTestWithNames : public testing::Test {};
-
-class TypedTestNames {
- public:
- template <typename T>
- static std::string GetName(int i) {
- if (std::is_same<T, char>::value)
- return std::string("char") + ::testing::PrintToString(i);
- if (std::is_same<T, int>::value)
- return std::string("int") + ::testing::PrintToString(i);
- }
-};
-
-TYPED_TEST_SUITE(TypedTestWithNames, TypesForTestWithNames, TypedTestNames);
-
-TYPED_TEST(TypedTestWithNames, Success) {}
-
-TYPED_TEST(TypedTestWithNames, Failure) { FAIL(); }
-
-template <typename T>
-class TypedTestP : public testing::Test {
-};
-
-TYPED_TEST_SUITE_P(TypedTestP);
-
-TYPED_TEST_P(TypedTestP, Success) {
- EXPECT_EQ(0U, TypeParam());
-}
-
-TYPED_TEST_P(TypedTestP, Failure) {
- EXPECT_EQ(1U, TypeParam()) << "Expected failure";
-}
-
-REGISTER_TYPED_TEST_SUITE_P(TypedTestP, Success, Failure);
-
-typedef testing::Types<unsigned char, unsigned int> UnsignedTypes;
-INSTANTIATE_TYPED_TEST_SUITE_P(Unsigned, TypedTestP, UnsignedTypes);
-
-class TypedTestPNames {
- public:
- template <typename T>
- static std::string GetName(int i) {
- if (std::is_same<T, unsigned char>::value) {
- return std::string("unsignedChar") + ::testing::PrintToString(i);
- }
- if (std::is_same<T, unsigned int>::value) {
- return std::string("unsignedInt") + ::testing::PrintToString(i);
- }
- }
-};
-
-INSTANTIATE_TYPED_TEST_SUITE_P(UnsignedCustomName, TypedTestP, UnsignedTypes,
- TypedTestPNames);
-
-template <typename T>
-class DetectNotInstantiatedTypesTest : public testing::Test {};
-TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest);
-TYPED_TEST_P(DetectNotInstantiatedTypesTest, Used) {
- TypeParam instantiate;
- (void)instantiate;
-}
-REGISTER_TYPED_TEST_SUITE_P(DetectNotInstantiatedTypesTest, Used);
-
-// kErrorOnUninstantiatedTypeParameterizedTest=true would make the above fail.
-// Adding the following would make that test failure go away.
-//
-// typedef ::testing::Types<char, int, unsigned int> MyTypes;
-// INSTANTIATE_TYPED_TEST_SUITE_P(All, DetectNotInstantiatedTypesTest, MyTypes);
-
-#if GTEST_HAS_DEATH_TEST
-
-// We rely on the golden file to verify that tests whose test case
-// name ends with DeathTest are run first.
-
-TEST(ADeathTest, ShouldRunFirst) {
-}
-
-// We rely on the golden file to verify that typed tests whose test
-// case name ends with DeathTest are run first.
-
-template <typename T>
-class ATypedDeathTest : public testing::Test {
-};
-
-typedef testing::Types<int, double> NumericTypes;
-TYPED_TEST_SUITE(ATypedDeathTest, NumericTypes);
-
-TYPED_TEST(ATypedDeathTest, ShouldRunFirst) {
-}
-
-
-// We rely on the golden file to verify that type-parameterized tests
-// whose test case name ends with DeathTest are run first.
-
-template <typename T>
-class ATypeParamDeathTest : public testing::Test {
-};
-
-TYPED_TEST_SUITE_P(ATypeParamDeathTest);
-
-TYPED_TEST_P(ATypeParamDeathTest, ShouldRunFirst) {
-}
-
-REGISTER_TYPED_TEST_SUITE_P(ATypeParamDeathTest, ShouldRunFirst);
-
-INSTANTIATE_TYPED_TEST_SUITE_P(My, ATypeParamDeathTest, NumericTypes);
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Tests various failure conditions of
-// EXPECT_{,NON}FATAL_FAILURE{,_ON_ALL_THREADS}.
-class ExpectFailureTest : public testing::Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- enum FailureMode {
- FATAL_FAILURE,
- NONFATAL_FAILURE
- };
- static void AddFailure(FailureMode failure) {
- if (failure == FATAL_FAILURE) {
- FAIL() << "Expected fatal failure.";
- } else {
- ADD_FAILURE() << "Expected non-fatal failure.";
- }
- }
-};
-
-TEST_F(ExpectFailureTest, ExpectFatalFailure) {
- // Expected fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(SUCCEED(), "Expected fatal failure.");
- // Expected fatal failure, but got a non-fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Expected non-fatal "
- "failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE(AddFailure(FATAL_FAILURE), "Some other fatal failure "
- "expected.");
-}
-
-TEST_F(ExpectFailureTest, ExpectNonFatalFailure) {
- // Expected non-fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(SUCCEED(), "Expected non-fatal failure.");
- // Expected non-fatal failure, but got a fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(AddFailure(FATAL_FAILURE), "Expected fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE(AddFailure(NONFATAL_FAILURE), "Some other non-fatal "
- "failure.");
-}
-
-#if GTEST_IS_THREADSAFE
-
-class ExpectFailureWithThreadsTest : public ExpectFailureTest {
- protected:
- static void AddFailureInOtherThread(FailureMode failure) {
- ThreadWithParam<FailureMode> thread(&AddFailure, failure, nullptr);
- thread.Join();
- }
-};
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailure) {
- // We only intercept the current thread.
- printf("(expecting 2 failures)\n");
- EXPECT_FATAL_FAILURE(AddFailureInOtherThread(FATAL_FAILURE),
- "Expected fatal failure.");
-}
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailure) {
- // We only intercept the current thread.
- printf("(expecting 2 failures)\n");
- EXPECT_NONFATAL_FAILURE(AddFailureInOtherThread(NONFATAL_FAILURE),
- "Expected non-fatal failure.");
-}
-
-typedef ExpectFailureWithThreadsTest ScopedFakeTestPartResultReporterTest;
-
-// Tests that the ScopedFakeTestPartResultReporter only catches failures from
-// the current thread if it is instantiated with INTERCEPT_ONLY_CURRENT_THREAD.
-TEST_F(ScopedFakeTestPartResultReporterTest, InterceptOnlyCurrentThread) {
- printf("(expecting 2 failures)\n");
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
- &results);
- AddFailureInOtherThread(FATAL_FAILURE);
- AddFailureInOtherThread(NONFATAL_FAILURE);
- }
- // The two failures should not have been intercepted.
- EXPECT_EQ(0, results.size()) << "This shouldn't fail.";
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-TEST_F(ExpectFailureTest, ExpectFatalFailureOnAllThreads) {
- // Expected fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected fatal failure.");
- // Expected fatal failure, but got a non-fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
- "Expected non-fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
- "Some other fatal failure expected.");
-}
-
-TEST_F(ExpectFailureTest, ExpectNonFatalFailureOnAllThreads) {
- // Expected non-fatal failure, but succeeds.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(SUCCEED(), "Expected non-fatal "
- "failure.");
- // Expected non-fatal failure, but got a fatal failure.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(FATAL_FAILURE),
- "Expected fatal failure.");
- // Wrong message.
- printf("(expecting 1 failure)\n");
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddFailure(NONFATAL_FAILURE),
- "Some other non-fatal failure.");
-}
-
-class DynamicFixture : public testing::Test {
- protected:
- DynamicFixture() { printf("DynamicFixture()\n"); }
- ~DynamicFixture() override { printf("~DynamicFixture()\n"); }
- void SetUp() override { printf("DynamicFixture::SetUp\n"); }
- void TearDown() override { printf("DynamicFixture::TearDown\n"); }
-
- static void SetUpTestSuite() { printf("DynamicFixture::SetUpTestSuite\n"); }
- static void TearDownTestSuite() {
- printf("DynamicFixture::TearDownTestSuite\n");
- }
-};
-
-template <bool Pass>
-class DynamicTest : public DynamicFixture {
- public:
- void TestBody() override { EXPECT_TRUE(Pass); }
-};
-
-auto dynamic_test = (
- // Register two tests with the same fixture correctly.
- testing::RegisterTest(
- "DynamicFixture", "DynamicTestPass", nullptr, nullptr, __FILE__,
- __LINE__, []() -> DynamicFixture* { return new DynamicTest<true>; }),
- testing::RegisterTest(
- "DynamicFixture", "DynamicTestFail", nullptr, nullptr, __FILE__,
- __LINE__, []() -> DynamicFixture* { return new DynamicTest<false>; }),
-
- // Register the same fixture with another name. That's fine.
- testing::RegisterTest(
- "DynamicFixtureAnotherName", "DynamicTestPass", nullptr, nullptr,
- __FILE__, __LINE__,
- []() -> DynamicFixture* { return new DynamicTest<true>; }),
-
- // Register two tests with the same fixture incorrectly.
- testing::RegisterTest(
- "BadDynamicFixture1", "FixtureBase", nullptr, nullptr, __FILE__,
- __LINE__, []() -> DynamicFixture* { return new DynamicTest<true>; }),
- testing::RegisterTest(
- "BadDynamicFixture1", "TestBase", nullptr, nullptr, __FILE__, __LINE__,
- []() -> testing::Test* { return new DynamicTest<true>; }),
-
- // Register two tests with the same fixture incorrectly by omitting the
- // return type.
- testing::RegisterTest(
- "BadDynamicFixture2", "FixtureBase", nullptr, nullptr, __FILE__,
- __LINE__, []() -> DynamicFixture* { return new DynamicTest<true>; }),
- testing::RegisterTest("BadDynamicFixture2", "Derived", nullptr, nullptr,
- __FILE__, __LINE__,
- []() { return new DynamicTest<true>; }));
-
-// Two test environments for testing testing::AddGlobalTestEnvironment().
-
-class FooEnvironment : public testing::Environment {
- public:
- void SetUp() override { printf("%s", "FooEnvironment::SetUp() called.\n"); }
-
- void TearDown() override {
- printf("%s", "FooEnvironment::TearDown() called.\n");
- FAIL() << "Expected fatal failure.";
- }
-};
-
-class BarEnvironment : public testing::Environment {
- public:
- void SetUp() override { printf("%s", "BarEnvironment::SetUp() called.\n"); }
-
- void TearDown() override {
- printf("%s", "BarEnvironment::TearDown() called.\n");
- ADD_FAILURE() << "Expected non-fatal failure.";
- }
-};
-
-class TestSuiteThatFailsToSetUp : public testing::Test {
- public:
- static void SetUpTestSuite() { EXPECT_TRUE(false); }
-};
-TEST_F(TestSuiteThatFailsToSetUp, ShouldNotRun) {
- std::abort();
-}
-
-// The main function.
-//
-// The idea is to use Google Test to run all the tests we have defined (some
-// of them are intended to fail), and then compare the test results
-// with the "golden" file.
-int main(int argc, char **argv) {
- GTEST_FLAG_SET(print_time, false);
-
- // We just run the tests, knowing some of them are intended to fail.
- // We will use a separate Python script to compare the output of
- // this program with the golden file.
-
- // It's hard to test InitGoogleTest() directly, as it has many
- // global side effects. The following line serves as a sanity test
- // for it.
- testing::InitGoogleTest(&argc, argv);
- bool internal_skip_environment_and_ad_hoc_tests =
- std::count(argv, argv + argc,
- std::string("internal_skip_environment_and_ad_hoc_tests")) > 0;
-
-#if GTEST_HAS_DEATH_TEST
- if (GTEST_FLAG_GET(internal_run_death_test) != "") {
- // Skip the usual output capturing if we're running as the child
- // process of an threadsafe-style death test.
-# if GTEST_OS_WINDOWS
- posix::FReopen("nul:", "w", stdout);
-# else
- posix::FReopen("/dev/null", "w", stdout);
-# endif // GTEST_OS_WINDOWS
- return RUN_ALL_TESTS();
- }
-#endif // GTEST_HAS_DEATH_TEST
-
- if (internal_skip_environment_and_ad_hoc_tests)
- return RUN_ALL_TESTS();
-
- // Registers two global test environments.
- // The golden file verifies that they are set up in the order they
- // are registered, and torn down in the reverse order.
- testing::AddGlobalTestEnvironment(new FooEnvironment);
- testing::AddGlobalTestEnvironment(new BarEnvironment);
-#if _MSC_VER
-GTEST_DISABLE_MSC_WARNINGS_POP_() // 4127
-#endif // _MSC_VER
- return RunAllTests();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test.py
deleted file mode 100644
index b8d609a700..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test warns the user when not initialized properly."""
-
-from googletest.test import gtest_test_utils
-
-binary_name = 'googletest-param-test-invalid-name1-test_'
-COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
-
-
-def Assert(condition):
- if not condition:
- raise AssertionError
-
-
-def TestExitCodeAndOutput(command):
- """Runs the given command and verifies its exit code and output."""
-
- err = ('Parameterized test name \'"InvalidWithQuotes"\' is invalid')
-
- p = gtest_test_utils.Subprocess(command)
- Assert(p.terminated_by_signal)
-
- # Verify the output message contains appropriate output
- Assert(err in p.output)
-
-
-class GTestParamTestInvalidName1Test(gtest_test_utils.TestCase):
-
- def testExitCodeAndOutput(self):
- TestExitCodeAndOutput(COMMAND)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test_.cc
deleted file mode 100644
index 955d699900..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name1-test_.cc
+++ /dev/null
@@ -1,50 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest.h"
-
-namespace {
-class DummyTest : public ::testing::TestWithParam<const char *> {};
-
-TEST_P(DummyTest, Dummy) {
-}
-
-INSTANTIATE_TEST_SUITE_P(InvalidTestName,
- DummyTest,
- ::testing::Values("InvalidWithQuotes"),
- ::testing::PrintToStringParamName());
-
-} // namespace
-
-int main(int argc, char *argv[]) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test.py
deleted file mode 100644
index d92fa065ae..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2015 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test warns the user when not initialized properly."""
-
-from googletest.test import gtest_test_utils
-
-binary_name = 'googletest-param-test-invalid-name2-test_'
-COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
-
-
-def Assert(condition):
- if not condition:
- raise AssertionError
-
-
-def TestExitCodeAndOutput(command):
- """Runs the given command and verifies its exit code and output."""
-
- err = ('Duplicate parameterized test name \'a\'')
-
- p = gtest_test_utils.Subprocess(command)
- Assert(p.terminated_by_signal)
-
- # Check for appropriate output
- Assert(err in p.output)
-
-
-class GTestParamTestInvalidName2Test(gtest_test_utils.TestCase):
-
- def testExitCodeAndOutput(self):
- TestExitCodeAndOutput(COMMAND)
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test_.cc
deleted file mode 100644
index 76371df54f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-invalid-name2-test_.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2015, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest.h"
-
-namespace {
-class DummyTest : public ::testing::TestWithParam<const char *> {};
-
-std::string StringParamTestSuffix(
- const testing::TestParamInfo<const char*>& info) {
- return std::string(info.param);
-}
-
-TEST_P(DummyTest, Dummy) {
-}
-
-INSTANTIATE_TEST_SUITE_P(DuplicateTestNames,
- DummyTest,
- ::testing::Values("a", "b", "a", "c"),
- StringParamTestSuffix);
-} // namespace
-
-int main(int argc, char *argv[]) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.cc
deleted file mode 100644
index 023aa46d69..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.cc
+++ /dev/null
@@ -1,1119 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google Test itself. This file verifies that the parameter
-// generators objects produce correct parameter sequences and that
-// Google Test runtime instantiates correct tests from those sequences.
-
-#include "gtest/gtest.h"
-
-# include <algorithm>
-# include <iostream>
-# include <list>
-# include <set>
-# include <sstream>
-# include <string>
-# include <vector>
-
-# include "src/gtest-internal-inl.h" // for UnitTestOptions
-# include "test/googletest-param-test-test.h"
-
-using ::std::vector;
-using ::std::sort;
-
-using ::testing::AddGlobalTestEnvironment;
-using ::testing::Bool;
-using ::testing::Combine;
-using ::testing::Message;
-using ::testing::Range;
-using ::testing::TestWithParam;
-using ::testing::Values;
-using ::testing::ValuesIn;
-
-using ::testing::internal::ParamGenerator;
-using ::testing::internal::UnitTestOptions;
-
-// Prints a value to a string.
-//
-// FIXME: remove PrintValue() when we move matchers and
-// EXPECT_THAT() from Google Mock to Google Test. At that time, we
-// can write EXPECT_THAT(x, Eq(y)) to compare two tuples x and y, as
-// EXPECT_THAT() and the matchers know how to print tuples.
-template <typename T>
-::std::string PrintValue(const T& value) {
- return testing::PrintToString(value);
-}
-
-// Verifies that a sequence generated by the generator and accessed
-// via the iterator object matches the expected one using Google Test
-// assertions.
-template <typename T, size_t N>
-void VerifyGenerator(const ParamGenerator<T>& generator,
- const T (&expected_values)[N]) {
- typename ParamGenerator<T>::iterator it = generator.begin();
- for (size_t i = 0; i < N; ++i) {
- ASSERT_FALSE(it == generator.end())
- << "At element " << i << " when accessing via an iterator "
- << "created with the copy constructor.\n";
- // We cannot use EXPECT_EQ() here as the values may be tuples,
- // which don't support <<.
- EXPECT_TRUE(expected_values[i] == *it)
- << "where i is " << i
- << ", expected_values[i] is " << PrintValue(expected_values[i])
- << ", *it is " << PrintValue(*it)
- << ", and 'it' is an iterator created with the copy constructor.\n";
- ++it;
- }
- EXPECT_TRUE(it == generator.end())
- << "At the presumed end of sequence when accessing via an iterator "
- << "created with the copy constructor.\n";
-
- // Test the iterator assignment. The following lines verify that
- // the sequence accessed via an iterator initialized via the
- // assignment operator (as opposed to a copy constructor) matches
- // just the same.
- it = generator.begin();
- for (size_t i = 0; i < N; ++i) {
- ASSERT_FALSE(it == generator.end())
- << "At element " << i << " when accessing via an iterator "
- << "created with the assignment operator.\n";
- EXPECT_TRUE(expected_values[i] == *it)
- << "where i is " << i
- << ", expected_values[i] is " << PrintValue(expected_values[i])
- << ", *it is " << PrintValue(*it)
- << ", and 'it' is an iterator created with the copy constructor.\n";
- ++it;
- }
- EXPECT_TRUE(it == generator.end())
- << "At the presumed end of sequence when accessing via an iterator "
- << "created with the assignment operator.\n";
-}
-
-template <typename T>
-void VerifyGeneratorIsEmpty(const ParamGenerator<T>& generator) {
- typename ParamGenerator<T>::iterator it = generator.begin();
- EXPECT_TRUE(it == generator.end());
-
- it = generator.begin();
- EXPECT_TRUE(it == generator.end());
-}
-
-// Generator tests. They test that each of the provided generator functions
-// generates an expected sequence of values. The general test pattern
-// instantiates a generator using one of the generator functions,
-// checks the sequence produced by the generator using its iterator API,
-// and then resets the iterator back to the beginning of the sequence
-// and checks the sequence again.
-
-// Tests that iterators produced by generator functions conform to the
-// ForwardIterator concept.
-TEST(IteratorTest, ParamIteratorConformsToForwardIteratorConcept) {
- const ParamGenerator<int> gen = Range(0, 10);
- ParamGenerator<int>::iterator it = gen.begin();
-
- // Verifies that iterator initialization works as expected.
- ParamGenerator<int>::iterator it2 = it;
- EXPECT_TRUE(*it == *it2) << "Initialized iterators must point to the "
- << "element same as its source points to";
-
- // Verifies that iterator assignment works as expected.
- ++it;
- EXPECT_FALSE(*it == *it2);
- it2 = it;
- EXPECT_TRUE(*it == *it2) << "Assigned iterators must point to the "
- << "element same as its source points to";
-
- // Verifies that prefix operator++() returns *this.
- EXPECT_EQ(&it, &(++it)) << "Result of the prefix operator++ must be "
- << "refer to the original object";
-
- // Verifies that the result of the postfix operator++ points to the value
- // pointed to by the original iterator.
- int original_value = *it; // Have to compute it outside of macro call to be
- // unaffected by the parameter evaluation order.
- EXPECT_EQ(original_value, *(it++));
-
- // Verifies that prefix and postfix operator++() advance an iterator
- // all the same.
- it2 = it;
- ++it;
- ++it2;
- EXPECT_TRUE(*it == *it2);
-}
-
-// Tests that Range() generates the expected sequence.
-TEST(RangeTest, IntRangeWithDefaultStep) {
- const ParamGenerator<int> gen = Range(0, 3);
- const int expected_values[] = {0, 1, 2};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that Range() generates the single element sequence
-// as expected when provided with range limits that are equal.
-TEST(RangeTest, IntRangeSingleValue) {
- const ParamGenerator<int> gen = Range(0, 1);
- const int expected_values[] = {0};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that Range() with generates empty sequence when
-// supplied with an empty range.
-TEST(RangeTest, IntRangeEmpty) {
- const ParamGenerator<int> gen = Range(0, 0);
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that Range() with custom step (greater then one) generates
-// the expected sequence.
-TEST(RangeTest, IntRangeWithCustomStep) {
- const ParamGenerator<int> gen = Range(0, 9, 3);
- const int expected_values[] = {0, 3, 6};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Range() with custom step (greater then one) generates
-// the expected sequence when the last element does not fall on the
-// upper range limit. Sequences generated by Range() must not have
-// elements beyond the range limits.
-TEST(RangeTest, IntRangeWithCustomStepOverUpperBound) {
- const ParamGenerator<int> gen = Range(0, 4, 3);
- const int expected_values[] = {0, 3};
- VerifyGenerator(gen, expected_values);
-}
-
-// Verifies that Range works with user-defined types that define
-// copy constructor, operator=(), operator+(), and operator<().
-class DogAdder {
- public:
- explicit DogAdder(const char* a_value) : value_(a_value) {}
- DogAdder(const DogAdder& other) : value_(other.value_.c_str()) {}
-
- DogAdder operator=(const DogAdder& other) {
- if (this != &other)
- value_ = other.value_;
- return *this;
- }
- DogAdder operator+(const DogAdder& other) const {
- Message msg;
- msg << value_.c_str() << other.value_.c_str();
- return DogAdder(msg.GetString().c_str());
- }
- bool operator<(const DogAdder& other) const {
- return value_ < other.value_;
- }
- const std::string& value() const { return value_; }
-
- private:
- std::string value_;
-};
-
-TEST(RangeTest, WorksWithACustomType) {
- const ParamGenerator<DogAdder> gen =
- Range(DogAdder("cat"), DogAdder("catdogdog"), DogAdder("dog"));
- ParamGenerator<DogAdder>::iterator it = gen.begin();
-
- ASSERT_FALSE(it == gen.end());
- EXPECT_STREQ("cat", it->value().c_str());
-
- ASSERT_FALSE(++it == gen.end());
- EXPECT_STREQ("catdog", it->value().c_str());
-
- EXPECT_TRUE(++it == gen.end());
-}
-
-class IntWrapper {
- public:
- explicit IntWrapper(int a_value) : value_(a_value) {}
- IntWrapper(const IntWrapper& other) : value_(other.value_) {}
-
- IntWrapper operator=(const IntWrapper& other) {
- value_ = other.value_;
- return *this;
- }
- // operator+() adds a different type.
- IntWrapper operator+(int other) const { return IntWrapper(value_ + other); }
- bool operator<(const IntWrapper& other) const {
- return value_ < other.value_;
- }
- int value() const { return value_; }
-
- private:
- int value_;
-};
-
-TEST(RangeTest, WorksWithACustomTypeWithDifferentIncrementType) {
- const ParamGenerator<IntWrapper> gen = Range(IntWrapper(0), IntWrapper(2));
- ParamGenerator<IntWrapper>::iterator it = gen.begin();
-
- ASSERT_FALSE(it == gen.end());
- EXPECT_EQ(0, it->value());
-
- ASSERT_FALSE(++it == gen.end());
- EXPECT_EQ(1, it->value());
-
- EXPECT_TRUE(++it == gen.end());
-}
-
-// Tests that ValuesIn() with an array parameter generates
-// the expected sequence.
-TEST(ValuesInTest, ValuesInArray) {
- int array[] = {3, 5, 8};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Tests that ValuesIn() with a const array parameter generates
-// the expected sequence.
-TEST(ValuesInTest, ValuesInConstArray) {
- const int array[] = {3, 5, 8};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Edge case. Tests that ValuesIn() with an array parameter containing a
-// single element generates the single element sequence.
-TEST(ValuesInTest, ValuesInSingleElementArray) {
- int array[] = {42};
- const ParamGenerator<int> gen = ValuesIn(array);
- VerifyGenerator(gen, array);
-}
-
-// Tests that ValuesIn() generates the expected sequence for an STL
-// container (vector).
-TEST(ValuesInTest, ValuesInVector) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(3);
- values.push_back(5);
- values.push_back(8);
- const ParamGenerator<int> gen = ValuesIn(values);
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that ValuesIn() generates the expected sequence.
-TEST(ValuesInTest, ValuesInIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(3);
- values.push_back(5);
- values.push_back(8);
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that ValuesIn() provided with an iterator range specifying a
-// single value generates a single-element sequence.
-TEST(ValuesInTest, ValuesInSingleElementIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- values.push_back(42);
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- const int expected_values[] = {42};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case. Tests that ValuesIn() provided with an empty iterator range
-// generates an empty sequence.
-TEST(ValuesInTest, ValuesInEmptyIteratorRange) {
- typedef ::std::vector<int> ContainerType;
- ContainerType values;
- const ParamGenerator<int> gen = ValuesIn(values.begin(), values.end());
-
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that the Values() generates the expected sequence.
-TEST(ValuesTest, ValuesWorks) {
- const ParamGenerator<int> gen = Values(3, 5, 8);
-
- const int expected_values[] = {3, 5, 8};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Values() generates the expected sequences from elements of
-// different types convertible to ParamGenerator's parameter type.
-TEST(ValuesTest, ValuesWorksForValuesOfCompatibleTypes) {
- const ParamGenerator<double> gen = Values(3, 5.0f, 8.0);
-
- const double expected_values[] = {3.0, 5.0, 8.0};
- VerifyGenerator(gen, expected_values);
-}
-
-TEST(ValuesTest, ValuesWorksForMaxLengthList) {
- const ParamGenerator<int> gen = Values(
- 10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
- 110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
- 210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
- 310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
- 410, 420, 430, 440, 450, 460, 470, 480, 490, 500);
-
- const int expected_values[] = {
- 10, 20, 30, 40, 50, 60, 70, 80, 90, 100,
- 110, 120, 130, 140, 150, 160, 170, 180, 190, 200,
- 210, 220, 230, 240, 250, 260, 270, 280, 290, 300,
- 310, 320, 330, 340, 350, 360, 370, 380, 390, 400,
- 410, 420, 430, 440, 450, 460, 470, 480, 490, 500};
- VerifyGenerator(gen, expected_values);
-}
-
-// Edge case test. Tests that single-parameter Values() generates the sequence
-// with the single value.
-TEST(ValuesTest, ValuesWithSingleParameter) {
- const ParamGenerator<int> gen = Values(42);
-
- const int expected_values[] = {42};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Bool() generates sequence (false, true).
-TEST(BoolTest, BoolWorks) {
- const ParamGenerator<bool> gen = Bool();
-
- const bool expected_values[] = {false, true};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Combine() with two parameters generates the expected sequence.
-TEST(CombineTest, CombineWithTwoParameters) {
- const char* foo = "foo";
- const char* bar = "bar";
- const ParamGenerator<std::tuple<const char*, int> > gen =
- Combine(Values(foo, bar), Values(3, 4));
-
- std::tuple<const char*, int> expected_values[] = {
- std::make_tuple(foo, 3), std::make_tuple(foo, 4), std::make_tuple(bar, 3),
- std::make_tuple(bar, 4)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that Combine() with three parameters generates the expected sequence.
-TEST(CombineTest, CombineWithThreeParameters) {
- const ParamGenerator<std::tuple<int, int, int> > gen =
- Combine(Values(0, 1), Values(3, 4), Values(5, 6));
- std::tuple<int, int, int> expected_values[] = {
- std::make_tuple(0, 3, 5), std::make_tuple(0, 3, 6),
- std::make_tuple(0, 4, 5), std::make_tuple(0, 4, 6),
- std::make_tuple(1, 3, 5), std::make_tuple(1, 3, 6),
- std::make_tuple(1, 4, 5), std::make_tuple(1, 4, 6)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that the Combine() with the first parameter generating a single value
-// sequence generates a sequence with the number of elements equal to the
-// number of elements in the sequence generated by the second parameter.
-TEST(CombineTest, CombineWithFirstParameterSingleValue) {
- const ParamGenerator<std::tuple<int, int> > gen =
- Combine(Values(42), Values(0, 1));
-
- std::tuple<int, int> expected_values[] = {std::make_tuple(42, 0),
- std::make_tuple(42, 1)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that the Combine() with the second parameter generating a single value
-// sequence generates a sequence with the number of elements equal to the
-// number of elements in the sequence generated by the first parameter.
-TEST(CombineTest, CombineWithSecondParameterSingleValue) {
- const ParamGenerator<std::tuple<int, int> > gen =
- Combine(Values(0, 1), Values(42));
-
- std::tuple<int, int> expected_values[] = {std::make_tuple(0, 42),
- std::make_tuple(1, 42)};
- VerifyGenerator(gen, expected_values);
-}
-
-// Tests that when the first parameter produces an empty sequence,
-// Combine() produces an empty sequence, too.
-TEST(CombineTest, CombineWithFirstParameterEmptyRange) {
- const ParamGenerator<std::tuple<int, int> > gen =
- Combine(Range(0, 0), Values(0, 1));
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Tests that when the second parameter produces an empty sequence,
-// Combine() produces an empty sequence, too.
-TEST(CombineTest, CombineWithSecondParameterEmptyRange) {
- const ParamGenerator<std::tuple<int, int> > gen =
- Combine(Values(0, 1), Range(1, 1));
- VerifyGeneratorIsEmpty(gen);
-}
-
-// Edge case. Tests that combine works with the maximum number
-// of parameters supported by Google Test (currently 10).
-TEST(CombineTest, CombineWithMaxNumberOfParameters) {
- const char* foo = "foo";
- const char* bar = "bar";
- const ParamGenerator<
- std::tuple<const char*, int, int, int, int, int, int, int, int, int> >
- gen =
- Combine(Values(foo, bar), Values(1), Values(2), Values(3), Values(4),
- Values(5), Values(6), Values(7), Values(8), Values(9));
-
- std::tuple<const char*, int, int, int, int, int, int, int, int, int>
- expected_values[] = {std::make_tuple(foo, 1, 2, 3, 4, 5, 6, 7, 8, 9),
- std::make_tuple(bar, 1, 2, 3, 4, 5, 6, 7, 8, 9)};
- VerifyGenerator(gen, expected_values);
-}
-
-class NonDefaultConstructAssignString {
- public:
- NonDefaultConstructAssignString(const std::string& s) : str_(s) {}
- NonDefaultConstructAssignString() = delete;
- NonDefaultConstructAssignString(const NonDefaultConstructAssignString&) =
- default;
- NonDefaultConstructAssignString& operator=(
- const NonDefaultConstructAssignString&) = delete;
- ~NonDefaultConstructAssignString() = default;
-
- const std::string& str() const { return str_; }
-
- private:
- std::string str_;
-};
-
-TEST(CombineTest, NonDefaultConstructAssign) {
- const ParamGenerator<std::tuple<int, NonDefaultConstructAssignString> > gen =
- Combine(Values(0, 1), Values(NonDefaultConstructAssignString("A"),
- NonDefaultConstructAssignString("B")));
-
- ParamGenerator<std::tuple<int, NonDefaultConstructAssignString> >::iterator
- it = gen.begin();
-
- EXPECT_EQ(0, std::get<0>(*it));
- EXPECT_EQ("A", std::get<1>(*it).str());
- ++it;
-
- EXPECT_EQ(0, std::get<0>(*it));
- EXPECT_EQ("B", std::get<1>(*it).str());
- ++it;
-
- EXPECT_EQ(1, std::get<0>(*it));
- EXPECT_EQ("A", std::get<1>(*it).str());
- ++it;
-
- EXPECT_EQ(1, std::get<0>(*it));
- EXPECT_EQ("B", std::get<1>(*it).str());
- ++it;
-
- EXPECT_TRUE(it == gen.end());
-}
-
-
-// Tests that an generator produces correct sequence after being
-// assigned from another generator.
-TEST(ParamGeneratorTest, AssignmentWorks) {
- ParamGenerator<int> gen = Values(1, 2);
- const ParamGenerator<int> gen2 = Values(3, 4);
- gen = gen2;
-
- const int expected_values[] = {3, 4};
- VerifyGenerator(gen, expected_values);
-}
-
-// This test verifies that the tests are expanded and run as specified:
-// one test per element from the sequence produced by the generator
-// specified in INSTANTIATE_TEST_SUITE_P. It also verifies that the test's
-// fixture constructor, SetUp(), and TearDown() have run and have been
-// supplied with the correct parameters.
-
-// The use of environment object allows detection of the case where no test
-// case functionality is run at all. In this case TearDownTestSuite will not
-// be able to detect missing tests, naturally.
-template <int kExpectedCalls>
-class TestGenerationEnvironment : public ::testing::Environment {
- public:
- static TestGenerationEnvironment* Instance() {
- static TestGenerationEnvironment* instance = new TestGenerationEnvironment;
- return instance;
- }
-
- void FixtureConstructorExecuted() { fixture_constructor_count_++; }
- void SetUpExecuted() { set_up_count_++; }
- void TearDownExecuted() { tear_down_count_++; }
- void TestBodyExecuted() { test_body_count_++; }
-
- void TearDown() override {
- // If all MultipleTestGenerationTest tests have been de-selected
- // by the filter flag, the following checks make no sense.
- bool perform_check = false;
-
- for (int i = 0; i < kExpectedCalls; ++i) {
- Message msg;
- msg << "TestsExpandedAndRun/" << i;
- if (UnitTestOptions::FilterMatchesTest(
- "TestExpansionModule/MultipleTestGenerationTest",
- msg.GetString().c_str())) {
- perform_check = true;
- }
- }
- if (perform_check) {
- EXPECT_EQ(kExpectedCalls, fixture_constructor_count_)
- << "Fixture constructor of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, set_up_count_)
- << "Fixture SetUp method of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, tear_down_count_)
- << "Fixture TearDown method of ParamTestGenerationTest test case "
- << "has not been run as expected.";
- EXPECT_EQ(kExpectedCalls, test_body_count_)
- << "Test in ParamTestGenerationTest test case "
- << "has not been run as expected.";
- }
- }
-
- private:
- TestGenerationEnvironment() : fixture_constructor_count_(0), set_up_count_(0),
- tear_down_count_(0), test_body_count_(0) {}
-
- int fixture_constructor_count_;
- int set_up_count_;
- int tear_down_count_;
- int test_body_count_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationEnvironment);
-};
-
-const int test_generation_params[] = {36, 42, 72};
-
-class TestGenerationTest : public TestWithParam<int> {
- public:
- enum {
- PARAMETER_COUNT =
- sizeof(test_generation_params)/sizeof(test_generation_params[0])
- };
-
- typedef TestGenerationEnvironment<PARAMETER_COUNT> Environment;
-
- TestGenerationTest() {
- Environment::Instance()->FixtureConstructorExecuted();
- current_parameter_ = GetParam();
- }
- void SetUp() override {
- Environment::Instance()->SetUpExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- }
- void TearDown() override {
- Environment::Instance()->TearDownExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- }
-
- static void SetUpTestSuite() {
- bool all_tests_in_test_case_selected = true;
-
- for (int i = 0; i < PARAMETER_COUNT; ++i) {
- Message test_name;
- test_name << "TestsExpandedAndRun/" << i;
- if ( !UnitTestOptions::FilterMatchesTest(
- "TestExpansionModule/MultipleTestGenerationTest",
- test_name.GetString())) {
- all_tests_in_test_case_selected = false;
- }
- }
- EXPECT_TRUE(all_tests_in_test_case_selected)
- << "When running the TestGenerationTest test case all of its tests\n"
- << "must be selected by the filter flag for the test case to pass.\n"
- << "If not all of them are enabled, we can't reliably conclude\n"
- << "that the correct number of tests have been generated.";
-
- collected_parameters_.clear();
- }
-
- static void TearDownTestSuite() {
- vector<int> expected_values(test_generation_params,
- test_generation_params + PARAMETER_COUNT);
- // Test execution order is not guaranteed by Google Test,
- // so the order of values in collected_parameters_ can be
- // different and we have to sort to compare.
- sort(expected_values.begin(), expected_values.end());
- sort(collected_parameters_.begin(), collected_parameters_.end());
-
- EXPECT_TRUE(collected_parameters_ == expected_values);
- }
-
- protected:
- int current_parameter_;
- static vector<int> collected_parameters_;
-
- private:
- GTEST_DISALLOW_COPY_AND_ASSIGN_(TestGenerationTest);
-};
-vector<int> TestGenerationTest::collected_parameters_;
-
-TEST_P(TestGenerationTest, TestsExpandedAndRun) {
- Environment::Instance()->TestBodyExecuted();
- EXPECT_EQ(current_parameter_, GetParam());
- collected_parameters_.push_back(GetParam());
-}
-INSTANTIATE_TEST_SUITE_P(TestExpansionModule, TestGenerationTest,
- ValuesIn(test_generation_params));
-
-// This test verifies that the element sequence (third parameter of
-// INSTANTIATE_TEST_SUITE_P) is evaluated in InitGoogleTest() and neither at
-// the call site of INSTANTIATE_TEST_SUITE_P nor in RUN_ALL_TESTS(). For
-// that, we declare param_value_ to be a static member of
-// GeneratorEvaluationTest and initialize it to 0. We set it to 1 in
-// main(), just before invocation of InitGoogleTest(). After calling
-// InitGoogleTest(), we set the value to 2. If the sequence is evaluated
-// before or after InitGoogleTest, INSTANTIATE_TEST_SUITE_P will create a
-// test with parameter other than 1, and the test body will fail the
-// assertion.
-class GeneratorEvaluationTest : public TestWithParam<int> {
- public:
- static int param_value() { return param_value_; }
- static void set_param_value(int param_value) { param_value_ = param_value; }
-
- private:
- static int param_value_;
-};
-int GeneratorEvaluationTest::param_value_ = 0;
-
-TEST_P(GeneratorEvaluationTest, GeneratorsEvaluatedInMain) {
- EXPECT_EQ(1, GetParam());
-}
-INSTANTIATE_TEST_SUITE_P(GenEvalModule, GeneratorEvaluationTest,
- Values(GeneratorEvaluationTest::param_value()));
-
-// Tests that generators defined in a different translation unit are
-// functional. Generator extern_gen is defined in gtest-param-test_test2.cc.
-extern ParamGenerator<int> extern_gen;
-class ExternalGeneratorTest : public TestWithParam<int> {};
-TEST_P(ExternalGeneratorTest, ExternalGenerator) {
- // Sequence produced by extern_gen contains only a single value
- // which we verify here.
- EXPECT_EQ(GetParam(), 33);
-}
-INSTANTIATE_TEST_SUITE_P(ExternalGeneratorModule, ExternalGeneratorTest,
- extern_gen);
-
-// Tests that a parameterized test case can be defined in one translation
-// unit and instantiated in another. This test will be instantiated in
-// gtest-param-test_test2.cc. ExternalInstantiationTest fixture class is
-// defined in gtest-param-test_test.h.
-TEST_P(ExternalInstantiationTest, IsMultipleOf33) {
- EXPECT_EQ(0, GetParam() % 33);
-}
-
-// Tests that a parameterized test case can be instantiated with multiple
-// generators.
-class MultipleInstantiationTest : public TestWithParam<int> {};
-TEST_P(MultipleInstantiationTest, AllowsMultipleInstances) {
-}
-INSTANTIATE_TEST_SUITE_P(Sequence1, MultipleInstantiationTest, Values(1, 2));
-INSTANTIATE_TEST_SUITE_P(Sequence2, MultipleInstantiationTest, Range(3, 5));
-
-// Tests that a parameterized test case can be instantiated
-// in multiple translation units. This test will be instantiated
-// here and in gtest-param-test_test2.cc.
-// InstantiationInMultipleTranslationUnitsTest fixture class
-// is defined in gtest-param-test_test.h.
-TEST_P(InstantiationInMultipleTranslationUnitsTest, IsMultipleOf42) {
- EXPECT_EQ(0, GetParam() % 42);
-}
-INSTANTIATE_TEST_SUITE_P(Sequence1, InstantiationInMultipleTranslationUnitsTest,
- Values(42, 42 * 2));
-
-// Tests that each iteration of parameterized test runs in a separate test
-// object.
-class SeparateInstanceTest : public TestWithParam<int> {
- public:
- SeparateInstanceTest() : count_(0) {}
-
- static void TearDownTestSuite() {
- EXPECT_GE(global_count_, 2)
- << "If some (but not all) SeparateInstanceTest tests have been "
- << "filtered out this test will fail. Make sure that all "
- << "GeneratorEvaluationTest are selected or de-selected together "
- << "by the test filter.";
- }
-
- protected:
- int count_;
- static int global_count_;
-};
-int SeparateInstanceTest::global_count_ = 0;
-
-TEST_P(SeparateInstanceTest, TestsRunInSeparateInstances) {
- EXPECT_EQ(0, count_++);
- global_count_++;
-}
-INSTANTIATE_TEST_SUITE_P(FourElemSequence, SeparateInstanceTest, Range(1, 4));
-
-// Tests that all instantiations of a test have named appropriately. Test
-// defined with TEST_P(TestSuiteName, TestName) and instantiated with
-// INSTANTIATE_TEST_SUITE_P(SequenceName, TestSuiteName, generator) must be
-// named SequenceName/TestSuiteName.TestName/i, where i is the 0-based index of
-// the sequence element used to instantiate the test.
-class NamingTest : public TestWithParam<int> {};
-
-TEST_P(NamingTest, TestsReportCorrectNamesAndParameters) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_STREQ("ZeroToFiveSequence/NamingTest", test_info->test_suite_name());
-
- Message index_stream;
- index_stream << "TestsReportCorrectNamesAndParameters/" << GetParam();
- EXPECT_STREQ(index_stream.GetString().c_str(), test_info->name());
-
- EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
-}
-
-INSTANTIATE_TEST_SUITE_P(ZeroToFiveSequence, NamingTest, Range(0, 5));
-
-// Tests that macros in test names are expanded correctly.
-class MacroNamingTest : public TestWithParam<int> {};
-
-#define PREFIX_WITH_FOO(test_name) Foo##test_name
-#define PREFIX_WITH_MACRO(test_name) Macro##test_name
-
-TEST_P(PREFIX_WITH_MACRO(NamingTest), PREFIX_WITH_FOO(SomeTestName)) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_STREQ("FortyTwo/MacroNamingTest", test_info->test_suite_name());
- EXPECT_STREQ("FooSomeTestName/0", test_info->name());
-}
-
-INSTANTIATE_TEST_SUITE_P(FortyTwo, MacroNamingTest, Values(42));
-
-// Tests the same thing for non-parametrized tests.
-class MacroNamingTestNonParametrized : public ::testing::Test {};
-
-TEST_F(PREFIX_WITH_MACRO(NamingTestNonParametrized),
- PREFIX_WITH_FOO(SomeTestName)) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_STREQ("MacroNamingTestNonParametrized", test_info->test_suite_name());
- EXPECT_STREQ("FooSomeTestName", test_info->name());
-}
-
-TEST(MacroNameing, LookupNames) {
- std::set<std::string> know_suite_names, know_test_names;
-
- auto ins = testing::UnitTest::GetInstance();
- int ts = 0;
- while (const testing::TestSuite* suite = ins->GetTestSuite(ts++)) {
- know_suite_names.insert(suite->name());
-
- int ti = 0;
- while (const testing::TestInfo* info = suite->GetTestInfo(ti++)) {
- know_test_names.insert(std::string(suite->name()) + "." + info->name());
- }
- }
-
- // Check that the expected form of the test suit name actually exists.
- EXPECT_NE( //
- know_suite_names.find("FortyTwo/MacroNamingTest"),
- know_suite_names.end());
- EXPECT_NE(
- know_suite_names.find("MacroNamingTestNonParametrized"),
- know_suite_names.end());
- // Check that the expected form of the test name actually exists.
- EXPECT_NE( //
- know_test_names.find("FortyTwo/MacroNamingTest.FooSomeTestName/0"),
- know_test_names.end());
- EXPECT_NE(
- know_test_names.find("MacroNamingTestNonParametrized.FooSomeTestName"),
- know_test_names.end());
-}
-
-// Tests that user supplied custom parameter names are working correctly.
-// Runs the test with a builtin helper method which uses PrintToString,
-// as well as a custom function and custom functor to ensure all possible
-// uses work correctly.
-class CustomFunctorNamingTest : public TestWithParam<std::string> {};
-TEST_P(CustomFunctorNamingTest, CustomTestNames) {}
-
-struct CustomParamNameFunctor {
- std::string operator()(const ::testing::TestParamInfo<std::string>& inf) {
- return inf.param;
- }
-};
-
-INSTANTIATE_TEST_SUITE_P(CustomParamNameFunctor, CustomFunctorNamingTest,
- Values(std::string("FunctorName")),
- CustomParamNameFunctor());
-
-INSTANTIATE_TEST_SUITE_P(AllAllowedCharacters, CustomFunctorNamingTest,
- Values("abcdefghijklmnopqrstuvwxyz",
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "01234567890_"),
- CustomParamNameFunctor());
-
-inline std::string CustomParamNameFunction(
- const ::testing::TestParamInfo<std::string>& inf) {
- return inf.param;
-}
-
-class CustomFunctionNamingTest : public TestWithParam<std::string> {};
-TEST_P(CustomFunctionNamingTest, CustomTestNames) {}
-
-INSTANTIATE_TEST_SUITE_P(CustomParamNameFunction, CustomFunctionNamingTest,
- Values(std::string("FunctionName")),
- CustomParamNameFunction);
-
-INSTANTIATE_TEST_SUITE_P(CustomParamNameFunctionP, CustomFunctionNamingTest,
- Values(std::string("FunctionNameP")),
- &CustomParamNameFunction);
-
-// Test custom naming with a lambda
-
-class CustomLambdaNamingTest : public TestWithParam<std::string> {};
-TEST_P(CustomLambdaNamingTest, CustomTestNames) {}
-
-INSTANTIATE_TEST_SUITE_P(CustomParamNameLambda, CustomLambdaNamingTest,
- Values(std::string("LambdaName")),
- [](const ::testing::TestParamInfo<std::string>& inf) {
- return inf.param;
- });
-
-TEST(CustomNamingTest, CheckNameRegistry) {
- ::testing::UnitTest* unit_test = ::testing::UnitTest::GetInstance();
- std::set<std::string> test_names;
- for (int suite_num = 0; suite_num < unit_test->total_test_suite_count();
- ++suite_num) {
- const ::testing::TestSuite* test_suite = unit_test->GetTestSuite(suite_num);
- for (int test_num = 0; test_num < test_suite->total_test_count();
- ++test_num) {
- const ::testing::TestInfo* test_info = test_suite->GetTestInfo(test_num);
- test_names.insert(std::string(test_info->name()));
- }
- }
- EXPECT_EQ(1u, test_names.count("CustomTestNames/FunctorName"));
- EXPECT_EQ(1u, test_names.count("CustomTestNames/FunctionName"));
- EXPECT_EQ(1u, test_names.count("CustomTestNames/FunctionNameP"));
- EXPECT_EQ(1u, test_names.count("CustomTestNames/LambdaName"));
-}
-
-// Test a numeric name to ensure PrintToStringParamName works correctly.
-
-class CustomIntegerNamingTest : public TestWithParam<int> {};
-
-TEST_P(CustomIntegerNamingTest, TestsReportCorrectNames) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
- Message test_name_stream;
- test_name_stream << "TestsReportCorrectNames/" << GetParam();
- EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
-}
-
-INSTANTIATE_TEST_SUITE_P(PrintToString, CustomIntegerNamingTest, Range(0, 5),
- ::testing::PrintToStringParamName());
-
-// Test a custom struct with PrintToString.
-
-struct CustomStruct {
- explicit CustomStruct(int value) : x(value) {}
- int x;
-};
-
-std::ostream& operator<<(std::ostream& stream, const CustomStruct& val) {
- stream << val.x;
- return stream;
-}
-
-class CustomStructNamingTest : public TestWithParam<CustomStruct> {};
-
-TEST_P(CustomStructNamingTest, TestsReportCorrectNames) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
- Message test_name_stream;
- test_name_stream << "TestsReportCorrectNames/" << GetParam();
- EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
-}
-
-INSTANTIATE_TEST_SUITE_P(PrintToString, CustomStructNamingTest,
- Values(CustomStruct(0), CustomStruct(1)),
- ::testing::PrintToStringParamName());
-
-// Test that using a stateful parameter naming function works as expected.
-
-struct StatefulNamingFunctor {
- StatefulNamingFunctor() : sum(0) {}
- std::string operator()(const ::testing::TestParamInfo<int>& info) {
- int value = info.param + sum;
- sum += info.param;
- return ::testing::PrintToString(value);
- }
- int sum;
-};
-
-class StatefulNamingTest : public ::testing::TestWithParam<int> {
- protected:
- StatefulNamingTest() : sum_(0) {}
- int sum_;
-};
-
-TEST_P(StatefulNamingTest, TestsReportCorrectNames) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
- sum_ += GetParam();
- Message test_name_stream;
- test_name_stream << "TestsReportCorrectNames/" << sum_;
- EXPECT_STREQ(test_name_stream.GetString().c_str(), test_info->name());
-}
-
-INSTANTIATE_TEST_SUITE_P(StatefulNamingFunctor, StatefulNamingTest, Range(0, 5),
- StatefulNamingFunctor());
-
-// Class that cannot be streamed into an ostream. It needs to be copyable
-// (and, in case of MSVC, also assignable) in order to be a test parameter
-// type. Its default copy constructor and assignment operator do exactly
-// what we need.
-class Unstreamable {
- public:
- explicit Unstreamable(int value) : value_(value) {}
- // -Wunused-private-field: dummy accessor for `value_`.
- const int& dummy_value() const { return value_; }
-
- private:
- int value_;
-};
-
-class CommentTest : public TestWithParam<Unstreamable> {};
-
-TEST_P(CommentTest, TestsCorrectlyReportUnstreamableParams) {
- const ::testing::TestInfo* const test_info =
- ::testing::UnitTest::GetInstance()->current_test_info();
-
- EXPECT_EQ(::testing::PrintToString(GetParam()), test_info->value_param());
-}
-
-INSTANTIATE_TEST_SUITE_P(InstantiationWithComments, CommentTest,
- Values(Unstreamable(1)));
-
-// Verify that we can create a hierarchy of test fixtures, where the base
-// class fixture is not parameterized and the derived class is. In this case
-// ParameterizedDerivedTest inherits from NonParameterizedBaseTest. We
-// perform simple tests on both.
-class NonParameterizedBaseTest : public ::testing::Test {
- public:
- NonParameterizedBaseTest() : n_(17) { }
- protected:
- int n_;
-};
-
-class ParameterizedDerivedTest : public NonParameterizedBaseTest,
- public ::testing::WithParamInterface<int> {
- protected:
- ParameterizedDerivedTest() : count_(0) { }
- int count_;
- static int global_count_;
-};
-
-int ParameterizedDerivedTest::global_count_ = 0;
-
-TEST_F(NonParameterizedBaseTest, FixtureIsInitialized) {
- EXPECT_EQ(17, n_);
-}
-
-TEST_P(ParameterizedDerivedTest, SeesSequence) {
- EXPECT_EQ(17, n_);
- EXPECT_EQ(0, count_++);
- EXPECT_EQ(GetParam(), global_count_++);
-}
-
-class ParameterizedDeathTest : public ::testing::TestWithParam<int> { };
-
-TEST_F(ParameterizedDeathTest, GetParamDiesFromTestF) {
- EXPECT_DEATH_IF_SUPPORTED(GetParam(),
- ".* value-parameterized test .*");
-}
-
-INSTANTIATE_TEST_SUITE_P(RangeZeroToFive, ParameterizedDerivedTest,
- Range(0, 5));
-
-// Tests param generator working with Enums
-enum MyEnums {
- ENUM1 = 1,
- ENUM2 = 3,
- ENUM3 = 8,
-};
-
-class MyEnumTest : public testing::TestWithParam<MyEnums> {};
-
-TEST_P(MyEnumTest, ChecksParamMoreThanZero) { EXPECT_GE(10, GetParam()); }
-INSTANTIATE_TEST_SUITE_P(MyEnumTests, MyEnumTest,
- ::testing::Values(ENUM1, ENUM2, 0));
-
-namespace works_here {
-// Never used not instantiated, this should work.
-class NotUsedTest : public testing::TestWithParam<int> {};
-
-///////
-// Never used not instantiated, this should work.
-template <typename T>
-class NotUsedTypeTest : public testing::Test {};
-TYPED_TEST_SUITE_P(NotUsedTypeTest);
-
-// Used but not instantiated, this would fail. but...
-class NotInstantiatedTest : public testing::TestWithParam<int> {};
-// ... we mark is as allowed.
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTest);
-
-TEST_P(NotInstantiatedTest, Used) { }
-
-using OtherName = NotInstantiatedTest;
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(OtherName);
-TEST_P(OtherName, Used) { }
-
-// Used but not instantiated, this would fail. but...
-template <typename T>
-class NotInstantiatedTypeTest : public testing::Test {};
-TYPED_TEST_SUITE_P(NotInstantiatedTypeTest);
-// ... we mark is as allowed.
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(NotInstantiatedTypeTest);
-
-TYPED_TEST_P(NotInstantiatedTypeTest, Used) { }
-REGISTER_TYPED_TEST_SUITE_P(NotInstantiatedTypeTest, Used);
-} // namespace works_here
-
-int main(int argc, char **argv) {
- // Used in TestGenerationTest test suite.
- AddGlobalTestEnvironment(TestGenerationTest::Environment::Instance());
- // Used in GeneratorEvaluationTest test suite. Tests that the updated value
- // will be picked up for instantiating tests in GeneratorEvaluationTest.
- GeneratorEvaluationTest::set_param_value(1);
-
- ::testing::InitGoogleTest(&argc, argv);
-
- // Used in GeneratorEvaluationTest test suite. Tests that value updated
- // here will NOT be used for instantiating tests in
- // GeneratorEvaluationTest.
- GeneratorEvaluationTest::set_param_value(2);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.h
deleted file mode 100644
index 891937538d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test-test.h
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This header file provides classes and functions used internally
-// for testing Google Test itself.
-
-#ifndef GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_
-#define GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_
-
-#include "gtest/gtest.h"
-
-// Test fixture for testing definition and instantiation of a test
-// in separate translation units.
-class ExternalInstantiationTest : public ::testing::TestWithParam<int> {
-};
-
-// Test fixture for testing instantiation of a test in multiple
-// translation units.
-class InstantiationInMultipleTranslationUnitsTest
- : public ::testing::TestWithParam<int> {
-};
-
-#endif // GOOGLETEST_TEST_GOOGLETEST_PARAM_TEST_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test2-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test2-test.cc
deleted file mode 100644
index 2a29fb1d06..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-param-test2-test.cc
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google Test itself. This verifies that the basic constructs of
-// Google Test work.
-
-#include "gtest/gtest.h"
-#include "test/googletest-param-test-test.h"
-
-using ::testing::Values;
-using ::testing::internal::ParamGenerator;
-
-// Tests that generators defined in a different translation unit
-// are functional. The test using extern_gen is defined
-// in googletest-param-test-test.cc.
-ParamGenerator<int> extern_gen = Values(33);
-
-// Tests that a parameterized test case can be defined in one translation unit
-// and instantiated in another. The test is defined in
-// googletest-param-test-test.cc and ExternalInstantiationTest fixture class is
-// defined in gtest-param-test_test.h.
-INSTANTIATE_TEST_SUITE_P(MultiplesOf33,
- ExternalInstantiationTest,
- Values(33, 66));
-
-// Tests that a parameterized test case can be instantiated
-// in multiple translation units. Another instantiation is defined
-// in googletest-param-test-test.cc and
-// InstantiationInMultipleTranslationUnitsTest fixture is defined in
-// gtest-param-test_test.h
-INSTANTIATE_TEST_SUITE_P(Sequence2,
- InstantiationInMultipleTranslationUnitsTest,
- Values(42*3, 42*4, 42*5));
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-port-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-port-test.cc
deleted file mode 100644
index b14e1f76f4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-port-test.cc
+++ /dev/null
@@ -1,1305 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// This file tests the internal cross-platform support utilities.
-#include <stdio.h>
-
-#include "gtest/internal/gtest-port.h"
-
-#if GTEST_OS_MAC
-# include <time.h>
-#endif // GTEST_OS_MAC
-
-#include <chrono> // NOLINT
-#include <list>
-#include <memory>
-#include <thread> // NOLINT
-#include <utility> // For std::pair and std::make_pair.
-#include <vector>
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-#include "src/gtest-internal-inl.h"
-
-using std::make_pair;
-using std::pair;
-
-namespace testing {
-namespace internal {
-
-TEST(IsXDigitTest, WorksForNarrowAscii) {
- EXPECT_TRUE(IsXDigit('0'));
- EXPECT_TRUE(IsXDigit('9'));
- EXPECT_TRUE(IsXDigit('A'));
- EXPECT_TRUE(IsXDigit('F'));
- EXPECT_TRUE(IsXDigit('a'));
- EXPECT_TRUE(IsXDigit('f'));
-
- EXPECT_FALSE(IsXDigit('-'));
- EXPECT_FALSE(IsXDigit('g'));
- EXPECT_FALSE(IsXDigit('G'));
-}
-
-TEST(IsXDigitTest, ReturnsFalseForNarrowNonAscii) {
- EXPECT_FALSE(IsXDigit(static_cast<char>('\x80')));
- EXPECT_FALSE(IsXDigit(static_cast<char>('0' | '\x80')));
-}
-
-TEST(IsXDigitTest, WorksForWideAscii) {
- EXPECT_TRUE(IsXDigit(L'0'));
- EXPECT_TRUE(IsXDigit(L'9'));
- EXPECT_TRUE(IsXDigit(L'A'));
- EXPECT_TRUE(IsXDigit(L'F'));
- EXPECT_TRUE(IsXDigit(L'a'));
- EXPECT_TRUE(IsXDigit(L'f'));
-
- EXPECT_FALSE(IsXDigit(L'-'));
- EXPECT_FALSE(IsXDigit(L'g'));
- EXPECT_FALSE(IsXDigit(L'G'));
-}
-
-TEST(IsXDigitTest, ReturnsFalseForWideNonAscii) {
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(0x80)));
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x80)));
- EXPECT_FALSE(IsXDigit(static_cast<wchar_t>(L'0' | 0x100)));
-}
-
-class Base {
- public:
- Base() : member_(0) {}
- explicit Base(int n) : member_(n) {}
- Base(const Base&) = default;
- Base& operator=(const Base&) = default;
- virtual ~Base() {}
- int member() { return member_; }
-
- private:
- int member_;
-};
-
-class Derived : public Base {
- public:
- explicit Derived(int n) : Base(n) {}
-};
-
-TEST(ImplicitCastTest, ConvertsPointers) {
- Derived derived(0);
- EXPECT_TRUE(&derived == ::testing::internal::ImplicitCast_<Base*>(&derived));
-}
-
-TEST(ImplicitCastTest, CanUseInheritance) {
- Derived derived(1);
- Base base = ::testing::internal::ImplicitCast_<Base>(derived);
- EXPECT_EQ(derived.member(), base.member());
-}
-
-class Castable {
- public:
- explicit Castable(bool* converted) : converted_(converted) {}
- operator Base() {
- *converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
-};
-
-TEST(ImplicitCastTest, CanUseNonConstCastOperator) {
- bool converted = false;
- Castable castable(&converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
- EXPECT_TRUE(converted);
-}
-
-class ConstCastable {
- public:
- explicit ConstCastable(bool* converted) : converted_(converted) {}
- operator Base() const {
- *converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
-};
-
-TEST(ImplicitCastTest, CanUseConstCastOperatorOnConstValues) {
- bool converted = false;
- const ConstCastable const_castable(&converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(const_castable);
- EXPECT_TRUE(converted);
-}
-
-class ConstAndNonConstCastable {
- public:
- ConstAndNonConstCastable(bool* converted, bool* const_converted)
- : converted_(converted), const_converted_(const_converted) {}
- operator Base() {
- *converted_ = true;
- return Base();
- }
- operator Base() const {
- *const_converted_ = true;
- return Base();
- }
-
- private:
- bool* converted_;
- bool* const_converted_;
-};
-
-TEST(ImplicitCastTest, CanSelectBetweenConstAndNonConstCasrAppropriately) {
- bool converted = false;
- bool const_converted = false;
- ConstAndNonConstCastable castable(&converted, &const_converted);
- Base base = ::testing::internal::ImplicitCast_<Base>(castable);
- EXPECT_TRUE(converted);
- EXPECT_FALSE(const_converted);
-
- converted = false;
- const_converted = false;
- const ConstAndNonConstCastable const_castable(&converted, &const_converted);
- base = ::testing::internal::ImplicitCast_<Base>(const_castable);
- EXPECT_FALSE(converted);
- EXPECT_TRUE(const_converted);
-}
-
-class To {
- public:
- To(bool* converted) { *converted = true; } // NOLINT
-};
-
-TEST(ImplicitCastTest, CanUseImplicitConstructor) {
- bool converted = false;
- To to = ::testing::internal::ImplicitCast_<To>(&converted);
- (void)to;
- EXPECT_TRUE(converted);
-}
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-TEST(GtestCheckSyntaxTest, BehavesLikeASingleStatement) {
- if (AlwaysFalse())
- GTEST_CHECK_(false) << "This should never be executed; "
- "It's a compilation test only.";
-
- if (AlwaysTrue())
- GTEST_CHECK_(true);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- GTEST_CHECK_(true) << "";
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-TEST(GtestCheckSyntaxTest, WorksWithSwitch) {
- switch (0) {
- case 1:
- break;
- default:
- GTEST_CHECK_(true);
- }
-
- switch (0)
- case 0:
- GTEST_CHECK_(true) << "Check failed in switch case";
-}
-
-// Verifies behavior of FormatFileLocation.
-TEST(FormatFileLocationTest, FormatsFileLocation) {
- EXPECT_PRED_FORMAT2(IsSubstring, "foo.cc", FormatFileLocation("foo.cc", 42));
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation("foo.cc", 42));
-}
-
-TEST(FormatFileLocationTest, FormatsUnknownFile) {
- EXPECT_PRED_FORMAT2(IsSubstring, "unknown file",
- FormatFileLocation(nullptr, 42));
- EXPECT_PRED_FORMAT2(IsSubstring, "42", FormatFileLocation(nullptr, 42));
-}
-
-TEST(FormatFileLocationTest, FormatsUknownLine) {
- EXPECT_EQ("foo.cc:", FormatFileLocation("foo.cc", -1));
-}
-
-TEST(FormatFileLocationTest, FormatsUknownFileAndLine) {
- EXPECT_EQ("unknown file:", FormatFileLocation(nullptr, -1));
-}
-
-// Verifies behavior of FormatCompilerIndependentFileLocation.
-TEST(FormatCompilerIndependentFileLocationTest, FormatsFileLocation) {
- EXPECT_EQ("foo.cc:42", FormatCompilerIndependentFileLocation("foo.cc", 42));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFile) {
- EXPECT_EQ("unknown file:42",
- FormatCompilerIndependentFileLocation(nullptr, 42));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownLine) {
- EXPECT_EQ("foo.cc", FormatCompilerIndependentFileLocation("foo.cc", -1));
-}
-
-TEST(FormatCompilerIndependentFileLocationTest, FormatsUknownFileAndLine) {
- EXPECT_EQ("unknown file", FormatCompilerIndependentFileLocation(nullptr, -1));
-}
-
-#if GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA || \
- GTEST_OS_DRAGONFLY || GTEST_OS_FREEBSD || GTEST_OS_GNU_KFREEBSD || \
- GTEST_OS_NETBSD || GTEST_OS_OPENBSD || GTEST_OS_GNU_HURD
-void* ThreadFunc(void* data) {
- internal::Mutex* mutex = static_cast<internal::Mutex*>(data);
- mutex->Lock();
- mutex->Unlock();
- return nullptr;
-}
-
-TEST(GetThreadCountTest, ReturnsCorrectValue) {
- size_t starting_count;
- size_t thread_count_after_create;
- size_t thread_count_after_join;
-
- // We can't guarantee that no other thread was created or destroyed between
- // any two calls to GetThreadCount(). We make multiple attempts, hoping that
- // background noise is not constant and we would see the "right" values at
- // some point.
- for (int attempt = 0; attempt < 20; ++attempt) {
- starting_count = GetThreadCount();
- pthread_t thread_id;
-
- internal::Mutex mutex;
- {
- internal::MutexLock lock(&mutex);
- pthread_attr_t attr;
- ASSERT_EQ(0, pthread_attr_init(&attr));
- ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE));
-
- const int status = pthread_create(&thread_id, &attr, &ThreadFunc, &mutex);
- ASSERT_EQ(0, pthread_attr_destroy(&attr));
- ASSERT_EQ(0, status);
- }
-
- thread_count_after_create = GetThreadCount();
-
- void* dummy;
- ASSERT_EQ(0, pthread_join(thread_id, &dummy));
-
- // Join before we decide whether we need to retry the test. Retry if an
- // arbitrary other thread was created or destroyed in the meantime.
- if (thread_count_after_create != starting_count + 1) continue;
-
- // The OS may not immediately report the updated thread count after
- // joining a thread, causing flakiness in this test. To counter that, we
- // wait for up to .5 seconds for the OS to report the correct value.
- bool thread_count_matches = false;
- for (int i = 0; i < 5; ++i) {
- thread_count_after_join = GetThreadCount();
- if (thread_count_after_join == starting_count) {
- thread_count_matches = true;
- break;
- }
-
- std::this_thread::sleep_for(std::chrono::milliseconds(100));
- }
-
- // Retry if an arbitrary other thread was created or destroyed.
- if (!thread_count_matches) continue;
-
- break;
- }
-
- EXPECT_EQ(thread_count_after_create, starting_count + 1);
- EXPECT_EQ(thread_count_after_join, starting_count);
-}
-#else
-TEST(GetThreadCountTest, ReturnsZeroWhenUnableToCountThreads) {
- EXPECT_EQ(0U, GetThreadCount());
-}
-#endif // GTEST_OS_LINUX || GTEST_OS_MAC || GTEST_OS_QNX || GTEST_OS_FUCHSIA
-
-TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
- const bool a_false_condition = false;
- const char regex[] =
-#ifdef _MSC_VER
- "googletest-port-test\\.cc\\(\\d+\\):"
-#elif GTEST_USES_POSIX_RE
- "googletest-port-test\\.cc:[0-9]+"
-#else
- "googletest-port-test\\.cc:\\d+"
-#endif // _MSC_VER
- ".*a_false_condition.*Extra info.*";
-
- EXPECT_DEATH_IF_SUPPORTED(GTEST_CHECK_(a_false_condition) << "Extra info",
- regex);
-}
-
-#if GTEST_HAS_DEATH_TEST
-
-TEST(GtestCheckDeathTest, LivesSilentlyOnSuccess) {
- EXPECT_EXIT({
- GTEST_CHECK_(true) << "Extra info";
- ::std::cerr << "Success\n";
- exit(0); },
- ::testing::ExitedWithCode(0), "Success");
-}
-
-#endif // GTEST_HAS_DEATH_TEST
-
-// Verifies that Google Test choose regular expression engine appropriate to
-// the platform. The test will produce compiler errors in case of failure.
-// For simplicity, we only cover the most important platforms here.
-TEST(RegexEngineSelectionTest, SelectsCorrectRegexEngine) {
-#if !GTEST_USES_PCRE
-# if GTEST_HAS_POSIX_RE
-
- EXPECT_TRUE(GTEST_USES_POSIX_RE);
-
-# else
-
- EXPECT_TRUE(GTEST_USES_SIMPLE_RE);
-
-# endif
-#endif // !GTEST_USES_PCRE
-}
-
-#if GTEST_USES_POSIX_RE
-
-template <typename Str>
-class RETest : public ::testing::Test {};
-
-// Defines StringTypes as the list of all string types that class RE
-// supports.
-typedef testing::Types< ::std::string, const char*> StringTypes;
-
-TYPED_TEST_SUITE(RETest, StringTypes);
-
-// Tests RE's implicit constructors.
-TYPED_TEST(RETest, ImplicitConstructorWorks) {
- const RE empty(TypeParam(""));
- EXPECT_STREQ("", empty.pattern());
-
- const RE simple(TypeParam("hello"));
- EXPECT_STREQ("hello", simple.pattern());
-
- const RE normal(TypeParam(".*(\\w+)"));
- EXPECT_STREQ(".*(\\w+)", normal.pattern());
-}
-
-// Tests that RE's constructors reject invalid regular expressions.
-TYPED_TEST(RETest, RejectsInvalidRegex) {
- EXPECT_NONFATAL_FAILURE({
- const RE invalid(TypeParam("?"));
- }, "\"?\" is not a valid POSIX Extended regular expression.");
-}
-
-// Tests RE::FullMatch().
-TYPED_TEST(RETest, FullMatchWorks) {
- const RE empty(TypeParam(""));
- EXPECT_TRUE(RE::FullMatch(TypeParam(""), empty));
- EXPECT_FALSE(RE::FullMatch(TypeParam("a"), empty));
-
- const RE re(TypeParam("a.*z"));
- EXPECT_TRUE(RE::FullMatch(TypeParam("az"), re));
- EXPECT_TRUE(RE::FullMatch(TypeParam("axyz"), re));
- EXPECT_FALSE(RE::FullMatch(TypeParam("baz"), re));
- EXPECT_FALSE(RE::FullMatch(TypeParam("azy"), re));
-}
-
-// Tests RE::PartialMatch().
-TYPED_TEST(RETest, PartialMatchWorks) {
- const RE empty(TypeParam(""));
- EXPECT_TRUE(RE::PartialMatch(TypeParam(""), empty));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("a"), empty));
-
- const RE re(TypeParam("a.*z"));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("az"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("axyz"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("baz"), re));
- EXPECT_TRUE(RE::PartialMatch(TypeParam("azy"), re));
- EXPECT_FALSE(RE::PartialMatch(TypeParam("zza"), re));
-}
-
-#elif GTEST_USES_SIMPLE_RE
-
-TEST(IsInSetTest, NulCharIsNotInAnySet) {
- EXPECT_FALSE(IsInSet('\0', ""));
- EXPECT_FALSE(IsInSet('\0', "\0"));
- EXPECT_FALSE(IsInSet('\0', "a"));
-}
-
-TEST(IsInSetTest, WorksForNonNulChars) {
- EXPECT_FALSE(IsInSet('a', "Ab"));
- EXPECT_FALSE(IsInSet('c', ""));
-
- EXPECT_TRUE(IsInSet('b', "bcd"));
- EXPECT_TRUE(IsInSet('b', "ab"));
-}
-
-TEST(IsAsciiDigitTest, IsFalseForNonDigit) {
- EXPECT_FALSE(IsAsciiDigit('\0'));
- EXPECT_FALSE(IsAsciiDigit(' '));
- EXPECT_FALSE(IsAsciiDigit('+'));
- EXPECT_FALSE(IsAsciiDigit('-'));
- EXPECT_FALSE(IsAsciiDigit('.'));
- EXPECT_FALSE(IsAsciiDigit('a'));
-}
-
-TEST(IsAsciiDigitTest, IsTrueForDigit) {
- EXPECT_TRUE(IsAsciiDigit('0'));
- EXPECT_TRUE(IsAsciiDigit('1'));
- EXPECT_TRUE(IsAsciiDigit('5'));
- EXPECT_TRUE(IsAsciiDigit('9'));
-}
-
-TEST(IsAsciiPunctTest, IsFalseForNonPunct) {
- EXPECT_FALSE(IsAsciiPunct('\0'));
- EXPECT_FALSE(IsAsciiPunct(' '));
- EXPECT_FALSE(IsAsciiPunct('\n'));
- EXPECT_FALSE(IsAsciiPunct('a'));
- EXPECT_FALSE(IsAsciiPunct('0'));
-}
-
-TEST(IsAsciiPunctTest, IsTrueForPunct) {
- for (const char* p = "^-!\"#$%&'()*+,./:;<=>?@[\\]_`{|}~"; *p; p++) {
- EXPECT_PRED1(IsAsciiPunct, *p);
- }
-}
-
-TEST(IsRepeatTest, IsFalseForNonRepeatChar) {
- EXPECT_FALSE(IsRepeat('\0'));
- EXPECT_FALSE(IsRepeat(' '));
- EXPECT_FALSE(IsRepeat('a'));
- EXPECT_FALSE(IsRepeat('1'));
- EXPECT_FALSE(IsRepeat('-'));
-}
-
-TEST(IsRepeatTest, IsTrueForRepeatChar) {
- EXPECT_TRUE(IsRepeat('?'));
- EXPECT_TRUE(IsRepeat('*'));
- EXPECT_TRUE(IsRepeat('+'));
-}
-
-TEST(IsAsciiWhiteSpaceTest, IsFalseForNonWhiteSpace) {
- EXPECT_FALSE(IsAsciiWhiteSpace('\0'));
- EXPECT_FALSE(IsAsciiWhiteSpace('a'));
- EXPECT_FALSE(IsAsciiWhiteSpace('1'));
- EXPECT_FALSE(IsAsciiWhiteSpace('+'));
- EXPECT_FALSE(IsAsciiWhiteSpace('_'));
-}
-
-TEST(IsAsciiWhiteSpaceTest, IsTrueForWhiteSpace) {
- EXPECT_TRUE(IsAsciiWhiteSpace(' '));
- EXPECT_TRUE(IsAsciiWhiteSpace('\n'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\r'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\t'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\v'));
- EXPECT_TRUE(IsAsciiWhiteSpace('\f'));
-}
-
-TEST(IsAsciiWordCharTest, IsFalseForNonWordChar) {
- EXPECT_FALSE(IsAsciiWordChar('\0'));
- EXPECT_FALSE(IsAsciiWordChar('+'));
- EXPECT_FALSE(IsAsciiWordChar('.'));
- EXPECT_FALSE(IsAsciiWordChar(' '));
- EXPECT_FALSE(IsAsciiWordChar('\n'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForLetter) {
- EXPECT_TRUE(IsAsciiWordChar('a'));
- EXPECT_TRUE(IsAsciiWordChar('b'));
- EXPECT_TRUE(IsAsciiWordChar('A'));
- EXPECT_TRUE(IsAsciiWordChar('Z'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForDigit) {
- EXPECT_TRUE(IsAsciiWordChar('0'));
- EXPECT_TRUE(IsAsciiWordChar('1'));
- EXPECT_TRUE(IsAsciiWordChar('7'));
- EXPECT_TRUE(IsAsciiWordChar('9'));
-}
-
-TEST(IsAsciiWordCharTest, IsTrueForUnderscore) {
- EXPECT_TRUE(IsAsciiWordChar('_'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForNonPrintable) {
- EXPECT_FALSE(IsValidEscape('\0'));
- EXPECT_FALSE(IsValidEscape('\007'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForDigit) {
- EXPECT_FALSE(IsValidEscape('0'));
- EXPECT_FALSE(IsValidEscape('9'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForWhiteSpace) {
- EXPECT_FALSE(IsValidEscape(' '));
- EXPECT_FALSE(IsValidEscape('\n'));
-}
-
-TEST(IsValidEscapeTest, IsFalseForSomeLetter) {
- EXPECT_FALSE(IsValidEscape('a'));
- EXPECT_FALSE(IsValidEscape('Z'));
-}
-
-TEST(IsValidEscapeTest, IsTrueForPunct) {
- EXPECT_TRUE(IsValidEscape('.'));
- EXPECT_TRUE(IsValidEscape('-'));
- EXPECT_TRUE(IsValidEscape('^'));
- EXPECT_TRUE(IsValidEscape('$'));
- EXPECT_TRUE(IsValidEscape('('));
- EXPECT_TRUE(IsValidEscape(']'));
- EXPECT_TRUE(IsValidEscape('{'));
- EXPECT_TRUE(IsValidEscape('|'));
-}
-
-TEST(IsValidEscapeTest, IsTrueForSomeLetter) {
- EXPECT_TRUE(IsValidEscape('d'));
- EXPECT_TRUE(IsValidEscape('D'));
- EXPECT_TRUE(IsValidEscape('s'));
- EXPECT_TRUE(IsValidEscape('S'));
- EXPECT_TRUE(IsValidEscape('w'));
- EXPECT_TRUE(IsValidEscape('W'));
-}
-
-TEST(AtomMatchesCharTest, EscapedPunct) {
- EXPECT_FALSE(AtomMatchesChar(true, '\\', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, '\\', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, '_', '.'));
- EXPECT_FALSE(AtomMatchesChar(true, '.', 'a'));
-
- EXPECT_TRUE(AtomMatchesChar(true, '\\', '\\'));
- EXPECT_TRUE(AtomMatchesChar(true, '_', '_'));
- EXPECT_TRUE(AtomMatchesChar(true, '+', '+'));
- EXPECT_TRUE(AtomMatchesChar(true, '.', '.'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_d) {
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'd', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 'd', '.'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'd', '9'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_D) {
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'D', '9'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'D', 'a'));
- EXPECT_TRUE(AtomMatchesChar(true, 'D', '-'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_s) {
- EXPECT_FALSE(AtomMatchesChar(true, 's', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', '.'));
- EXPECT_FALSE(AtomMatchesChar(true, 's', '9'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 's', ' '));
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\n'));
- EXPECT_TRUE(AtomMatchesChar(true, 's', '\t'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_S) {
- EXPECT_FALSE(AtomMatchesChar(true, 'S', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, 'S', '\r'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'S', 'a'));
- EXPECT_TRUE(AtomMatchesChar(true, 'S', '9'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_w) {
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '+'));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', ' '));
- EXPECT_FALSE(AtomMatchesChar(true, 'w', '\n'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'b'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', 'C'));
- EXPECT_TRUE(AtomMatchesChar(true, 'w', '_'));
-}
-
-TEST(AtomMatchesCharTest, Escaped_W) {
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'A'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', 'b'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '9'));
- EXPECT_FALSE(AtomMatchesChar(true, 'W', '_'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\0'));
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '*'));
- EXPECT_TRUE(AtomMatchesChar(true, 'W', '\n'));
-}
-
-TEST(AtomMatchesCharTest, EscapedWhiteSpace) {
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'f', '\n'));
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'n', '\r'));
- EXPECT_FALSE(AtomMatchesChar(true, 'r', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'r', 'a'));
- EXPECT_FALSE(AtomMatchesChar(true, 't', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 't', 't'));
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\0'));
- EXPECT_FALSE(AtomMatchesChar(true, 'v', '\f'));
-
- EXPECT_TRUE(AtomMatchesChar(true, 'f', '\f'));
- EXPECT_TRUE(AtomMatchesChar(true, 'n', '\n'));
- EXPECT_TRUE(AtomMatchesChar(true, 'r', '\r'));
- EXPECT_TRUE(AtomMatchesChar(true, 't', '\t'));
- EXPECT_TRUE(AtomMatchesChar(true, 'v', '\v'));
-}
-
-TEST(AtomMatchesCharTest, UnescapedDot) {
- EXPECT_FALSE(AtomMatchesChar(false, '.', '\n'));
-
- EXPECT_TRUE(AtomMatchesChar(false, '.', '\0'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', '.'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', 'a'));
- EXPECT_TRUE(AtomMatchesChar(false, '.', ' '));
-}
-
-TEST(AtomMatchesCharTest, UnescapedChar) {
- EXPECT_FALSE(AtomMatchesChar(false, 'a', '\0'));
- EXPECT_FALSE(AtomMatchesChar(false, 'a', 'b'));
- EXPECT_FALSE(AtomMatchesChar(false, '$', 'a'));
-
- EXPECT_TRUE(AtomMatchesChar(false, '$', '$'));
- EXPECT_TRUE(AtomMatchesChar(false, '5', '5'));
- EXPECT_TRUE(AtomMatchesChar(false, 'Z', 'Z'));
-}
-
-TEST(ValidateRegexTest, GeneratesFailureAndReturnsFalseForInvalid) {
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(NULL)),
- "NULL is not a valid simple regular expression");
- EXPECT_NONFATAL_FAILURE(
- ASSERT_FALSE(ValidateRegex("a\\")),
- "Syntax error at index 1 in simple regular expression \"a\\\": ");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a\\")),
- "'\\' cannot appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\n\\")),
- "'\\' cannot appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("\\s\\hb")),
- "invalid escape sequence \"\\h\"");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^^")),
- "'^' can only appear at the beginning");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex(".*^b")),
- "'^' can only appear at the beginning");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("$$")),
- "'$' can only appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^$a")),
- "'$' can only appear at the end");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a(b")),
- "'(' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("ab)")),
- "')' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("[ab")),
- "'[' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("a{2")),
- "'{' is unsupported");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("?")),
- "'?' can only follow a repeatable token");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("^*")),
- "'*' can only follow a repeatable token");
- EXPECT_NONFATAL_FAILURE(ASSERT_FALSE(ValidateRegex("5*+")),
- "'+' can only follow a repeatable token");
-}
-
-TEST(ValidateRegexTest, ReturnsTrueForValid) {
- EXPECT_TRUE(ValidateRegex(""));
- EXPECT_TRUE(ValidateRegex("a"));
- EXPECT_TRUE(ValidateRegex(".*"));
- EXPECT_TRUE(ValidateRegex("^a_+"));
- EXPECT_TRUE(ValidateRegex("^a\\t\\&?"));
- EXPECT_TRUE(ValidateRegex("09*$"));
- EXPECT_TRUE(ValidateRegex("^Z$"));
- EXPECT_TRUE(ValidateRegex("a\\^Z\\$\\(\\)\\|\\[\\]\\{\\}"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrOne) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "a", "ba"));
- // Repeating more than once.
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "aab"));
-
- // Repeating zero times.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ba"));
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, 'a', '?', "b", "ab"));
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '#', '?', ".", "##"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForZeroOrMany) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '*', "a$", "baab"));
-
- // Repeating zero times.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "bc"));
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '*', "b", "abc"));
- // Repeating more than once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '*', "-", "ab_1-g"));
-}
-
-TEST(MatchRepetitionAndRegexAtHeadTest, WorksForOneOrMany) {
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "a$", "baab"));
- // Repeating zero times.
- EXPECT_FALSE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "bc"));
-
- // Repeating once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(false, '.', '+', "b", "abc"));
- // Repeating more than once.
- EXPECT_TRUE(MatchRepetitionAndRegexAtHead(true, 'w', '+', "-", "ab_1-g"));
-}
-
-TEST(MatchRegexAtHeadTest, ReturnsTrueForEmptyRegex) {
- EXPECT_TRUE(MatchRegexAtHead("", ""));
- EXPECT_TRUE(MatchRegexAtHead("", "ab"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenDollarIsInRegex) {
- EXPECT_FALSE(MatchRegexAtHead("$", "a"));
-
- EXPECT_TRUE(MatchRegexAtHead("$", ""));
- EXPECT_TRUE(MatchRegexAtHead("a$", "a"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithEscapeSequence) {
- EXPECT_FALSE(MatchRegexAtHead("\\w", "+"));
- EXPECT_FALSE(MatchRegexAtHead("\\W", "ab"));
-
- EXPECT_TRUE(MatchRegexAtHead("\\sa", "\nab"));
- EXPECT_TRUE(MatchRegexAtHead("\\d", "1a"));
-}
-
-TEST(MatchRegexAtHeadTest, WorksWhenRegexStartsWithRepetition) {
- EXPECT_FALSE(MatchRegexAtHead(".+a", "abc"));
- EXPECT_FALSE(MatchRegexAtHead("a?b", "aab"));
-
- EXPECT_TRUE(MatchRegexAtHead(".*a", "bc12-ab"));
- EXPECT_TRUE(MatchRegexAtHead("a?b", "b"));
- EXPECT_TRUE(MatchRegexAtHead("a?b", "ab"));
-}
-
-TEST(MatchRegexAtHeadTest,
- WorksWhenRegexStartsWithRepetionOfEscapeSequence) {
- EXPECT_FALSE(MatchRegexAtHead("\\.+a", "abc"));
- EXPECT_FALSE(MatchRegexAtHead("\\s?b", " b"));
-
- EXPECT_TRUE(MatchRegexAtHead("\\(*a", "((((ab"));
- EXPECT_TRUE(MatchRegexAtHead("\\^?b", "^b"));
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "b"));
- EXPECT_TRUE(MatchRegexAtHead("\\\\?b", "\\b"));
-}
-
-TEST(MatchRegexAtHeadTest, MatchesSequentially) {
- EXPECT_FALSE(MatchRegexAtHead("ab.*c", "acabc"));
-
- EXPECT_TRUE(MatchRegexAtHead("ab.*c", "ab-fsc"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsFalseWhenStringIsNull) {
- EXPECT_FALSE(MatchRegexAnywhere("", NULL));
-}
-
-TEST(MatchRegexAnywhereTest, WorksWhenRegexStartsWithCaret) {
- EXPECT_FALSE(MatchRegexAnywhere("^a", "ba"));
- EXPECT_FALSE(MatchRegexAnywhere("^$", "a"));
-
- EXPECT_TRUE(MatchRegexAnywhere("^a", "ab"));
- EXPECT_TRUE(MatchRegexAnywhere("^", "ab"));
- EXPECT_TRUE(MatchRegexAnywhere("^$", ""));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsFalseWhenNoMatch) {
- EXPECT_FALSE(MatchRegexAnywhere("a", "bcde123"));
- EXPECT_FALSE(MatchRegexAnywhere("a.+a", "--aa88888888"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingPrefix) {
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "ab1_ - 5"));
- EXPECT_TRUE(MatchRegexAnywhere(".*=", "="));
- EXPECT_TRUE(MatchRegexAnywhere("x.*ab?.*bc", "xaaabc"));
-}
-
-TEST(MatchRegexAnywhereTest, ReturnsTrueWhenMatchingNonPrefix) {
- EXPECT_TRUE(MatchRegexAnywhere("\\w+", "$$$ ab1_ - 5"));
- EXPECT_TRUE(MatchRegexAnywhere("\\.+=", "= ...="));
-}
-
-// Tests RE's implicit constructors.
-TEST(RETest, ImplicitConstructorWorks) {
- const RE empty("");
- EXPECT_STREQ("", empty.pattern());
-
- const RE simple("hello");
- EXPECT_STREQ("hello", simple.pattern());
-}
-
-// Tests that RE's constructors reject invalid regular expressions.
-TEST(RETest, RejectsInvalidRegex) {
- EXPECT_NONFATAL_FAILURE({
- const RE normal(NULL);
- }, "NULL is not a valid simple regular expression");
-
- EXPECT_NONFATAL_FAILURE({
- const RE normal(".*(\\w+");
- }, "'(' is unsupported");
-
- EXPECT_NONFATAL_FAILURE({
- const RE invalid("^?");
- }, "'?' can only follow a repeatable token");
-}
-
-// Tests RE::FullMatch().
-TEST(RETest, FullMatchWorks) {
- const RE empty("");
- EXPECT_TRUE(RE::FullMatch("", empty));
- EXPECT_FALSE(RE::FullMatch("a", empty));
-
- const RE re1("a");
- EXPECT_TRUE(RE::FullMatch("a", re1));
-
- const RE re("a.*z");
- EXPECT_TRUE(RE::FullMatch("az", re));
- EXPECT_TRUE(RE::FullMatch("axyz", re));
- EXPECT_FALSE(RE::FullMatch("baz", re));
- EXPECT_FALSE(RE::FullMatch("azy", re));
-}
-
-// Tests RE::PartialMatch().
-TEST(RETest, PartialMatchWorks) {
- const RE empty("");
- EXPECT_TRUE(RE::PartialMatch("", empty));
- EXPECT_TRUE(RE::PartialMatch("a", empty));
-
- const RE re("a.*z");
- EXPECT_TRUE(RE::PartialMatch("az", re));
- EXPECT_TRUE(RE::PartialMatch("axyz", re));
- EXPECT_TRUE(RE::PartialMatch("baz", re));
- EXPECT_TRUE(RE::PartialMatch("azy", re));
- EXPECT_FALSE(RE::PartialMatch("zza", re));
-}
-
-#endif // GTEST_USES_POSIX_RE
-
-#if !GTEST_OS_WINDOWS_MOBILE
-
-TEST(CaptureTest, CapturesStdout) {
- CaptureStdout();
- fprintf(stdout, "abc");
- EXPECT_STREQ("abc", GetCapturedStdout().c_str());
-
- CaptureStdout();
- fprintf(stdout, "def%cghi", '\0');
- EXPECT_EQ(::std::string("def\0ghi", 7), ::std::string(GetCapturedStdout()));
-}
-
-TEST(CaptureTest, CapturesStderr) {
- CaptureStderr();
- fprintf(stderr, "jkl");
- EXPECT_STREQ("jkl", GetCapturedStderr().c_str());
-
- CaptureStderr();
- fprintf(stderr, "jkl%cmno", '\0');
- EXPECT_EQ(::std::string("jkl\0mno", 7), ::std::string(GetCapturedStderr()));
-}
-
-// Tests that stdout and stderr capture don't interfere with each other.
-TEST(CaptureTest, CapturesStdoutAndStderr) {
- CaptureStdout();
- CaptureStderr();
- fprintf(stdout, "pqr");
- fprintf(stderr, "stu");
- EXPECT_STREQ("pqr", GetCapturedStdout().c_str());
- EXPECT_STREQ("stu", GetCapturedStderr().c_str());
-}
-
-TEST(CaptureDeathTest, CannotReenterStdoutCapture) {
- CaptureStdout();
- EXPECT_DEATH_IF_SUPPORTED(CaptureStdout(),
- "Only one stdout capturer can exist at a time");
- GetCapturedStdout();
-
- // We cannot test stderr capturing using death tests as they use it
- // themselves.
-}
-
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-TEST(ThreadLocalTest, DefaultConstructorInitializesToDefaultValues) {
- ThreadLocal<int> t1;
- EXPECT_EQ(0, t1.get());
-
- ThreadLocal<void*> t2;
- EXPECT_TRUE(t2.get() == nullptr);
-}
-
-TEST(ThreadLocalTest, SingleParamConstructorInitializesToParam) {
- ThreadLocal<int> t1(123);
- EXPECT_EQ(123, t1.get());
-
- int i = 0;
- ThreadLocal<int*> t2(&i);
- EXPECT_EQ(&i, t2.get());
-}
-
-class NoDefaultContructor {
- public:
- explicit NoDefaultContructor(const char*) {}
- NoDefaultContructor(const NoDefaultContructor&) {}
-};
-
-TEST(ThreadLocalTest, ValueDefaultContructorIsNotRequiredForParamVersion) {
- ThreadLocal<NoDefaultContructor> bar(NoDefaultContructor("foo"));
- bar.pointer();
-}
-
-TEST(ThreadLocalTest, GetAndPointerReturnSameValue) {
- ThreadLocal<std::string> thread_local_string;
-
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
-
- // Verifies the condition still holds after calling set.
- thread_local_string.set("foo");
- EXPECT_EQ(thread_local_string.pointer(), &(thread_local_string.get()));
-}
-
-TEST(ThreadLocalTest, PointerAndConstPointerReturnSameValue) {
- ThreadLocal<std::string> thread_local_string;
- const ThreadLocal<std::string>& const_thread_local_string =
- thread_local_string;
-
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
-
- thread_local_string.set("foo");
- EXPECT_EQ(thread_local_string.pointer(), const_thread_local_string.pointer());
-}
-
-#if GTEST_IS_THREADSAFE
-
-void AddTwo(int* param) { *param += 2; }
-
-TEST(ThreadWithParamTest, ConstructorExecutesThreadFunc) {
- int i = 40;
- ThreadWithParam<int*> thread(&AddTwo, &i, nullptr);
- thread.Join();
- EXPECT_EQ(42, i);
-}
-
-TEST(MutexDeathTest, AssertHeldShouldAssertWhenNotLocked) {
- // AssertHeld() is flaky only in the presence of multiple threads accessing
- // the lock. In this case, the test is robust.
- EXPECT_DEATH_IF_SUPPORTED({
- Mutex m;
- { MutexLock lock(&m); }
- m.AssertHeld();
- },
- "thread .*hold");
-}
-
-TEST(MutexTest, AssertHeldShouldNotAssertWhenLocked) {
- Mutex m;
- MutexLock lock(&m);
- m.AssertHeld();
-}
-
-class AtomicCounterWithMutex {
- public:
- explicit AtomicCounterWithMutex(Mutex* mutex) :
- value_(0), mutex_(mutex), random_(42) {}
-
- void Increment() {
- MutexLock lock(mutex_);
- int temp = value_;
- {
- // We need to put up a memory barrier to prevent reads and writes to
- // value_ rearranged with the call to sleep_for when observed
- // from other threads.
-#if GTEST_HAS_PTHREAD
- // On POSIX, locking a mutex puts up a memory barrier. We cannot use
- // Mutex and MutexLock here or rely on their memory barrier
- // functionality as we are testing them here.
- pthread_mutex_t memory_barrier_mutex;
- GTEST_CHECK_POSIX_SUCCESS_(
- pthread_mutex_init(&memory_barrier_mutex, nullptr));
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_lock(&memory_barrier_mutex));
-
- std::this_thread::sleep_for(
- std::chrono::milliseconds(random_.Generate(30)));
-
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_unlock(&memory_barrier_mutex));
- GTEST_CHECK_POSIX_SUCCESS_(pthread_mutex_destroy(&memory_barrier_mutex));
-#elif GTEST_OS_WINDOWS
- // On Windows, performing an interlocked access puts up a memory barrier.
- volatile LONG dummy = 0;
- ::InterlockedIncrement(&dummy);
- std::this_thread::sleep_for(
- std::chrono::milliseconds(random_.Generate(30)));
- ::InterlockedIncrement(&dummy);
-#else
-# error "Memory barrier not implemented on this platform."
-#endif // GTEST_HAS_PTHREAD
- }
- value_ = temp + 1;
- }
- int value() const { return value_; }
-
- private:
- volatile int value_;
- Mutex* const mutex_; // Protects value_.
- Random random_;
-};
-
-void CountingThreadFunc(pair<AtomicCounterWithMutex*, int> param) {
- for (int i = 0; i < param.second; ++i)
- param.first->Increment();
-}
-
-// Tests that the mutex only lets one thread at a time to lock it.
-TEST(MutexTest, OnlyOneThreadCanLockAtATime) {
- Mutex mutex;
- AtomicCounterWithMutex locked_counter(&mutex);
-
- typedef ThreadWithParam<pair<AtomicCounterWithMutex*, int> > ThreadType;
- const int kCycleCount = 20;
- const int kThreadCount = 7;
- std::unique_ptr<ThreadType> counting_threads[kThreadCount];
- Notification threads_can_start;
- // Creates and runs kThreadCount threads that increment locked_counter
- // kCycleCount times each.
- for (int i = 0; i < kThreadCount; ++i) {
- counting_threads[i].reset(new ThreadType(&CountingThreadFunc,
- make_pair(&locked_counter,
- kCycleCount),
- &threads_can_start));
- }
- threads_can_start.Notify();
- for (int i = 0; i < kThreadCount; ++i)
- counting_threads[i]->Join();
-
- // If the mutex lets more than one thread to increment the counter at a
- // time, they are likely to encounter a race condition and have some
- // increments overwritten, resulting in the lower then expected counter
- // value.
- EXPECT_EQ(kCycleCount * kThreadCount, locked_counter.value());
-}
-
-template <typename T>
-void RunFromThread(void (func)(T), T param) {
- ThreadWithParam<T> thread(func, param, nullptr);
- thread.Join();
-}
-
-void RetrieveThreadLocalValue(
- pair<ThreadLocal<std::string>*, std::string*> param) {
- *param.second = param.first->get();
-}
-
-TEST(ThreadLocalTest, ParameterizedConstructorSetsDefault) {
- ThreadLocal<std::string> thread_local_string("foo");
- EXPECT_STREQ("foo", thread_local_string.get().c_str());
-
- thread_local_string.set("bar");
- EXPECT_STREQ("bar", thread_local_string.get().c_str());
-
- std::string result;
- RunFromThread(&RetrieveThreadLocalValue,
- make_pair(&thread_local_string, &result));
- EXPECT_STREQ("foo", result.c_str());
-}
-
-// Keeps track of whether of destructors being called on instances of
-// DestructorTracker. On Windows, waits for the destructor call reports.
-class DestructorCall {
- public:
- DestructorCall() {
- invoked_ = false;
-#if GTEST_OS_WINDOWS
- wait_event_.Reset(::CreateEvent(NULL, TRUE, FALSE, NULL));
- GTEST_CHECK_(wait_event_.Get() != NULL);
-#endif
- }
-
- bool CheckDestroyed() const {
-#if GTEST_OS_WINDOWS
- if (::WaitForSingleObject(wait_event_.Get(), 1000) != WAIT_OBJECT_0)
- return false;
-#endif
- return invoked_;
- }
-
- void ReportDestroyed() {
- invoked_ = true;
-#if GTEST_OS_WINDOWS
- ::SetEvent(wait_event_.Get());
-#endif
- }
-
- static std::vector<DestructorCall*>& List() { return *list_; }
-
- static void ResetList() {
- for (size_t i = 0; i < list_->size(); ++i) {
- delete list_->at(i);
- }
- list_->clear();
- }
-
- private:
- bool invoked_;
-#if GTEST_OS_WINDOWS
- AutoHandle wait_event_;
-#endif
- static std::vector<DestructorCall*>* const list_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(DestructorCall);
-};
-
-std::vector<DestructorCall*>* const DestructorCall::list_ =
- new std::vector<DestructorCall*>;
-
-// DestructorTracker keeps track of whether its instances have been
-// destroyed.
-class DestructorTracker {
- public:
- DestructorTracker() : index_(GetNewIndex()) {}
- DestructorTracker(const DestructorTracker& /* rhs */)
- : index_(GetNewIndex()) {}
- ~DestructorTracker() {
- // We never access DestructorCall::List() concurrently, so we don't need
- // to protect this access with a mutex.
- DestructorCall::List()[index_]->ReportDestroyed();
- }
-
- private:
- static size_t GetNewIndex() {
- DestructorCall::List().push_back(new DestructorCall);
- return DestructorCall::List().size() - 1;
- }
- const size_t index_;
-};
-
-typedef ThreadLocal<DestructorTracker>* ThreadParam;
-
-void CallThreadLocalGet(ThreadParam thread_local_param) {
- thread_local_param->get();
-}
-
-// Tests that when a ThreadLocal object dies in a thread, it destroys
-// the managed object for that thread.
-TEST(ThreadLocalTest, DestroysManagedObjectForOwnThreadWhenDying) {
- DestructorCall::ResetList();
-
- {
- ThreadLocal<DestructorTracker> thread_local_tracker;
- ASSERT_EQ(0U, DestructorCall::List().size());
-
- // This creates another DestructorTracker object for the main thread.
- thread_local_tracker.get();
- ASSERT_EQ(1U, DestructorCall::List().size());
- ASSERT_FALSE(DestructorCall::List()[0]->CheckDestroyed());
- }
-
- // Now thread_local_tracker has died.
- ASSERT_EQ(1U, DestructorCall::List().size());
- EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
-
- DestructorCall::ResetList();
-}
-
-// Tests that when a thread exits, the thread-local object for that
-// thread is destroyed.
-TEST(ThreadLocalTest, DestroysManagedObjectAtThreadExit) {
- DestructorCall::ResetList();
-
- {
- ThreadLocal<DestructorTracker> thread_local_tracker;
- ASSERT_EQ(0U, DestructorCall::List().size());
-
- // This creates another DestructorTracker object in the new thread.
- ThreadWithParam<ThreadParam> thread(&CallThreadLocalGet,
- &thread_local_tracker, nullptr);
- thread.Join();
-
- // The thread has exited, and we should have a DestroyedTracker
- // instance created for it. But it may not have been destroyed yet.
- ASSERT_EQ(1U, DestructorCall::List().size());
- }
-
- // The thread has exited and thread_local_tracker has died.
- ASSERT_EQ(1U, DestructorCall::List().size());
- EXPECT_TRUE(DestructorCall::List()[0]->CheckDestroyed());
-
- DestructorCall::ResetList();
-}
-
-TEST(ThreadLocalTest, ThreadLocalMutationsAffectOnlyCurrentThread) {
- ThreadLocal<std::string> thread_local_string;
- thread_local_string.set("Foo");
- EXPECT_STREQ("Foo", thread_local_string.get().c_str());
-
- std::string result;
- RunFromThread(&RetrieveThreadLocalValue,
- make_pair(&thread_local_string, &result));
- EXPECT_TRUE(result.empty());
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-#if GTEST_OS_WINDOWS
-TEST(WindowsTypesTest, HANDLEIsVoidStar) {
- StaticAssertTypeEq<HANDLE, void*>();
-}
-
-#if GTEST_OS_WINDOWS_MINGW && !defined(__MINGW64_VERSION_MAJOR)
-TEST(WindowsTypesTest, _CRITICAL_SECTIONIs_CRITICAL_SECTION) {
- StaticAssertTypeEq<CRITICAL_SECTION, _CRITICAL_SECTION>();
-}
-#else
-TEST(WindowsTypesTest, CRITICAL_SECTIONIs_RTL_CRITICAL_SECTION) {
- StaticAssertTypeEq<CRITICAL_SECTION, _RTL_CRITICAL_SECTION>();
-}
-#endif
-
-#endif // GTEST_OS_WINDOWS
-
-} // namespace internal
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-printers-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-printers-test.cc
deleted file mode 100644
index 0058917a27..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-printers-test.cc
+++ /dev/null
@@ -1,1991 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Google Test - The Google C++ Testing and Mocking Framework
-//
-// This file tests the universal value printer.
-
-#include <algorithm>
-#include <cctype>
-#include <cstdint>
-#include <cstring>
-#include <deque>
-#include <forward_list>
-#include <limits>
-#include <list>
-#include <map>
-#include <memory>
-#include <set>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <utility>
-#include <vector>
-
-#include "gtest/gtest-printers.h"
-#include "gtest/gtest.h"
-
-// Some user-defined types for testing the universal value printer.
-
-// An anonymous enum type.
-enum AnonymousEnum {
- kAE1 = -1,
- kAE2 = 1
-};
-
-// An enum without a user-defined printer.
-enum EnumWithoutPrinter {
- kEWP1 = -2,
- kEWP2 = 42
-};
-
-// An enum with a << operator.
-enum EnumWithStreaming {
- kEWS1 = 10
-};
-
-std::ostream& operator<<(std::ostream& os, EnumWithStreaming e) {
- return os << (e == kEWS1 ? "kEWS1" : "invalid");
-}
-
-// An enum with a PrintTo() function.
-enum EnumWithPrintTo {
- kEWPT1 = 1
-};
-
-void PrintTo(EnumWithPrintTo e, std::ostream* os) {
- *os << (e == kEWPT1 ? "kEWPT1" : "invalid");
-}
-
-// A class implicitly convertible to BiggestInt.
-class BiggestIntConvertible {
- public:
- operator ::testing::internal::BiggestInt() const { return 42; }
-};
-
-// A parent class with two child classes. The parent and one of the kids have
-// stream operators.
-class ParentClass {};
-class ChildClassWithStreamOperator : public ParentClass {};
-class ChildClassWithoutStreamOperator : public ParentClass {};
-static void operator<<(std::ostream& os, const ParentClass&) {
- os << "ParentClass";
-}
-static void operator<<(std::ostream& os, const ChildClassWithStreamOperator&) {
- os << "ChildClassWithStreamOperator";
-}
-
-// A user-defined unprintable class template in the global namespace.
-template <typename T>
-class UnprintableTemplateInGlobal {
- public:
- UnprintableTemplateInGlobal() : value_() {}
- private:
- T value_;
-};
-
-// A user-defined streamable type in the global namespace.
-class StreamableInGlobal {
- public:
- virtual ~StreamableInGlobal() {}
-};
-
-inline void operator<<(::std::ostream& os, const StreamableInGlobal& /* x */) {
- os << "StreamableInGlobal";
-}
-
-void operator<<(::std::ostream& os, const StreamableInGlobal* /* x */) {
- os << "StreamableInGlobal*";
-}
-
-namespace foo {
-
-// A user-defined unprintable type in a user namespace.
-class UnprintableInFoo {
- public:
- UnprintableInFoo() : z_(0) { memcpy(xy_, "\xEF\x12\x0\x0\x34\xAB\x0\x0", 8); }
- double z() const { return z_; }
- private:
- char xy_[8];
- double z_;
-};
-
-// A user-defined printable type in a user-chosen namespace.
-struct PrintableViaPrintTo {
- PrintableViaPrintTo() : value() {}
- int value;
-};
-
-void PrintTo(const PrintableViaPrintTo& x, ::std::ostream* os) {
- *os << "PrintableViaPrintTo: " << x.value;
-}
-
-// A type with a user-defined << for printing its pointer.
-struct PointerPrintable {
-};
-
-::std::ostream& operator<<(::std::ostream& os,
- const PointerPrintable* /* x */) {
- return os << "PointerPrintable*";
-}
-
-// A user-defined printable class template in a user-chosen namespace.
-template <typename T>
-class PrintableViaPrintToTemplate {
- public:
- explicit PrintableViaPrintToTemplate(const T& a_value) : value_(a_value) {}
-
- const T& value() const { return value_; }
- private:
- T value_;
-};
-
-template <typename T>
-void PrintTo(const PrintableViaPrintToTemplate<T>& x, ::std::ostream* os) {
- *os << "PrintableViaPrintToTemplate: " << x.value();
-}
-
-// A user-defined streamable class template in a user namespace.
-template <typename T>
-class StreamableTemplateInFoo {
- public:
- StreamableTemplateInFoo() : value_() {}
-
- const T& value() const { return value_; }
- private:
- T value_;
-};
-
-template <typename T>
-inline ::std::ostream& operator<<(::std::ostream& os,
- const StreamableTemplateInFoo<T>& x) {
- return os << "StreamableTemplateInFoo: " << x.value();
-}
-
-// A user-defined streamable type in a user namespace whose operator<< is
-// templated on the type of the output stream.
-struct TemplatedStreamableInFoo {};
-
-template <typename OutputStream>
-OutputStream& operator<<(OutputStream& os,
- const TemplatedStreamableInFoo& /*ts*/) {
- os << "TemplatedStreamableInFoo";
- return os;
-}
-
-// A user-defined streamable but recursively-defined container type in
-// a user namespace, it mimics therefore std::filesystem::path or
-// boost::filesystem::path.
-class PathLike {
- public:
- struct iterator {
- typedef PathLike value_type;
-
- iterator& operator++();
- PathLike& operator*();
- };
-
- using value_type = char;
- using const_iterator = iterator;
-
- PathLike() {}
-
- iterator begin() const { return iterator(); }
- iterator end() const { return iterator(); }
-
- friend ::std::ostream& operator<<(::std::ostream& os, const PathLike&) {
- return os << "Streamable-PathLike";
- }
-};
-
-} // namespace foo
-
-namespace testing {
-namespace {
-template <typename T>
-class Wrapper {
- public:
- explicit Wrapper(T&& value) : value_(std::forward<T>(value)) {}
-
- const T& value() const { return value_; }
-
- private:
- T value_;
-};
-
-} // namespace
-
-namespace internal {
-template <typename T>
-class UniversalPrinter<Wrapper<T>> {
- public:
- static void Print(const Wrapper<T>& w, ::std::ostream* os) {
- *os << "Wrapper(";
- UniversalPrint(w.value(), os);
- *os << ')';
- }
-};
-} // namespace internal
-
-
-namespace gtest_printers_test {
-
-using ::std::deque;
-using ::std::list;
-using ::std::make_pair;
-using ::std::map;
-using ::std::multimap;
-using ::std::multiset;
-using ::std::pair;
-using ::std::set;
-using ::std::vector;
-using ::testing::PrintToString;
-using ::testing::internal::FormatForComparisonFailureMessage;
-using ::testing::internal::ImplicitCast_;
-using ::testing::internal::NativeArray;
-using ::testing::internal::RelationToSourceReference;
-using ::testing::internal::Strings;
-using ::testing::internal::UniversalPrint;
-using ::testing::internal::UniversalPrinter;
-using ::testing::internal::UniversalTersePrint;
-using ::testing::internal::UniversalTersePrintTupleFieldsToStrings;
-
-// Prints a value to a string using the universal value printer. This
-// is a helper for testing UniversalPrinter<T>::Print() for various types.
-template <typename T>
-std::string Print(const T& value) {
- ::std::stringstream ss;
- UniversalPrinter<T>::Print(value, &ss);
- return ss.str();
-}
-
-// Prints a value passed by reference to a string, using the universal
-// value printer. This is a helper for testing
-// UniversalPrinter<T&>::Print() for various types.
-template <typename T>
-std::string PrintByRef(const T& value) {
- ::std::stringstream ss;
- UniversalPrinter<T&>::Print(value, &ss);
- return ss.str();
-}
-
-// Tests printing various enum types.
-
-TEST(PrintEnumTest, AnonymousEnum) {
- EXPECT_EQ("-1", Print(kAE1));
- EXPECT_EQ("1", Print(kAE2));
-}
-
-TEST(PrintEnumTest, EnumWithoutPrinter) {
- EXPECT_EQ("-2", Print(kEWP1));
- EXPECT_EQ("42", Print(kEWP2));
-}
-
-TEST(PrintEnumTest, EnumWithStreaming) {
- EXPECT_EQ("kEWS1", Print(kEWS1));
- EXPECT_EQ("invalid", Print(static_cast<EnumWithStreaming>(0)));
-}
-
-TEST(PrintEnumTest, EnumWithPrintTo) {
- EXPECT_EQ("kEWPT1", Print(kEWPT1));
- EXPECT_EQ("invalid", Print(static_cast<EnumWithPrintTo>(0)));
-}
-
-// Tests printing a class implicitly convertible to BiggestInt.
-
-TEST(PrintClassTest, BiggestIntConvertible) {
- EXPECT_EQ("42", Print(BiggestIntConvertible()));
-}
-
-// Tests printing various char types.
-
-// char.
-TEST(PrintCharTest, PlainChar) {
- EXPECT_EQ("'\\0'", Print('\0'));
- EXPECT_EQ("'\\'' (39, 0x27)", Print('\''));
- EXPECT_EQ("'\"' (34, 0x22)", Print('"'));
- EXPECT_EQ("'?' (63, 0x3F)", Print('?'));
- EXPECT_EQ("'\\\\' (92, 0x5C)", Print('\\'));
- EXPECT_EQ("'\\a' (7)", Print('\a'));
- EXPECT_EQ("'\\b' (8)", Print('\b'));
- EXPECT_EQ("'\\f' (12, 0xC)", Print('\f'));
- EXPECT_EQ("'\\n' (10, 0xA)", Print('\n'));
- EXPECT_EQ("'\\r' (13, 0xD)", Print('\r'));
- EXPECT_EQ("'\\t' (9)", Print('\t'));
- EXPECT_EQ("'\\v' (11, 0xB)", Print('\v'));
- EXPECT_EQ("'\\x7F' (127)", Print('\x7F'));
- EXPECT_EQ("'\\xFF' (255)", Print('\xFF'));
- EXPECT_EQ("' ' (32, 0x20)", Print(' '));
- EXPECT_EQ("'a' (97, 0x61)", Print('a'));
-}
-
-// signed char.
-TEST(PrintCharTest, SignedChar) {
- EXPECT_EQ("'\\0'", Print(static_cast<signed char>('\0')));
- EXPECT_EQ("'\\xCE' (-50)",
- Print(static_cast<signed char>(-50)));
-}
-
-// unsigned char.
-TEST(PrintCharTest, UnsignedChar) {
- EXPECT_EQ("'\\0'", Print(static_cast<unsigned char>('\0')));
- EXPECT_EQ("'b' (98, 0x62)",
- Print(static_cast<unsigned char>('b')));
-}
-
-TEST(PrintCharTest, Char16) {
- EXPECT_EQ("U+0041", Print(u'A'));
-}
-
-TEST(PrintCharTest, Char32) {
- EXPECT_EQ("U+0041", Print(U'A'));
-}
-
-#ifdef __cpp_char8_t
-TEST(PrintCharTest, Char8) {
- EXPECT_EQ("U+0041", Print(u8'A'));
-}
-#endif
-
-// Tests printing other simple, built-in types.
-
-// bool.
-TEST(PrintBuiltInTypeTest, Bool) {
- EXPECT_EQ("false", Print(false));
- EXPECT_EQ("true", Print(true));
-}
-
-// wchar_t.
-TEST(PrintBuiltInTypeTest, Wchar_t) {
- EXPECT_EQ("L'\\0'", Print(L'\0'));
- EXPECT_EQ("L'\\'' (39, 0x27)", Print(L'\''));
- EXPECT_EQ("L'\"' (34, 0x22)", Print(L'"'));
- EXPECT_EQ("L'?' (63, 0x3F)", Print(L'?'));
- EXPECT_EQ("L'\\\\' (92, 0x5C)", Print(L'\\'));
- EXPECT_EQ("L'\\a' (7)", Print(L'\a'));
- EXPECT_EQ("L'\\b' (8)", Print(L'\b'));
- EXPECT_EQ("L'\\f' (12, 0xC)", Print(L'\f'));
- EXPECT_EQ("L'\\n' (10, 0xA)", Print(L'\n'));
- EXPECT_EQ("L'\\r' (13, 0xD)", Print(L'\r'));
- EXPECT_EQ("L'\\t' (9)", Print(L'\t'));
- EXPECT_EQ("L'\\v' (11, 0xB)", Print(L'\v'));
- EXPECT_EQ("L'\\x7F' (127)", Print(L'\x7F'));
- EXPECT_EQ("L'\\xFF' (255)", Print(L'\xFF'));
- EXPECT_EQ("L' ' (32, 0x20)", Print(L' '));
- EXPECT_EQ("L'a' (97, 0x61)", Print(L'a'));
- EXPECT_EQ("L'\\x576' (1398)", Print(static_cast<wchar_t>(0x576)));
- EXPECT_EQ("L'\\xC74D' (51021)", Print(static_cast<wchar_t>(0xC74D)));
-}
-
-// Test that int64_t provides more storage than wchar_t.
-TEST(PrintTypeSizeTest, Wchar_t) {
- EXPECT_LT(sizeof(wchar_t), sizeof(int64_t));
-}
-
-// Various integer types.
-TEST(PrintBuiltInTypeTest, Integer) {
- EXPECT_EQ("'\\xFF' (255)", Print(static_cast<unsigned char>(255))); // uint8
- EXPECT_EQ("'\\x80' (-128)", Print(static_cast<signed char>(-128))); // int8
- EXPECT_EQ("65535", Print(std::numeric_limits<uint16_t>::max())); // uint16
- EXPECT_EQ("-32768", Print(std::numeric_limits<int16_t>::min())); // int16
- EXPECT_EQ("4294967295",
- Print(std::numeric_limits<uint32_t>::max())); // uint32
- EXPECT_EQ("-2147483648",
- Print(std::numeric_limits<int32_t>::min())); // int32
- EXPECT_EQ("18446744073709551615",
- Print(std::numeric_limits<uint64_t>::max())); // uint64
- EXPECT_EQ("-9223372036854775808",
- Print(std::numeric_limits<int64_t>::min())); // int64
-#ifdef __cpp_char8_t
- EXPECT_EQ("U+0000",
- Print(std::numeric_limits<char8_t>::min())); // char8_t
- EXPECT_EQ("U+00FF",
- Print(std::numeric_limits<char8_t>::max())); // char8_t
-#endif
- EXPECT_EQ("U+0000",
- Print(std::numeric_limits<char16_t>::min())); // char16_t
- EXPECT_EQ("U+FFFF",
- Print(std::numeric_limits<char16_t>::max())); // char16_t
- EXPECT_EQ("U+0000",
- Print(std::numeric_limits<char32_t>::min())); // char32_t
- EXPECT_EQ("U+FFFFFFFF",
- Print(std::numeric_limits<char32_t>::max())); // char32_t
-}
-
-// Size types.
-TEST(PrintBuiltInTypeTest, Size_t) {
- EXPECT_EQ("1", Print(sizeof('a'))); // size_t.
-#if !GTEST_OS_WINDOWS
- // Windows has no ssize_t type.
- EXPECT_EQ("-2", Print(static_cast<ssize_t>(-2))); // ssize_t.
-#endif // !GTEST_OS_WINDOWS
-}
-
-// gcc/clang __{u,}int128_t values.
-#if defined(__SIZEOF_INT128__)
-TEST(PrintBuiltInTypeTest, Int128) {
- // Small ones
- EXPECT_EQ("0", Print(__int128_t{0}));
- EXPECT_EQ("0", Print(__uint128_t{0}));
- EXPECT_EQ("12345", Print(__int128_t{12345}));
- EXPECT_EQ("12345", Print(__uint128_t{12345}));
- EXPECT_EQ("-12345", Print(__int128_t{-12345}));
-
- // Large ones
- EXPECT_EQ("340282366920938463463374607431768211455", Print(~__uint128_t{}));
- __int128_t max_128 = static_cast<__int128_t>(~__uint128_t{} / 2);
- EXPECT_EQ("-170141183460469231731687303715884105728", Print(~max_128));
- EXPECT_EQ("170141183460469231731687303715884105727", Print(max_128));
-}
-#endif // __SIZEOF_INT128__
-
-// Floating-points.
-TEST(PrintBuiltInTypeTest, FloatingPoints) {
- EXPECT_EQ("1.5", Print(1.5f)); // float
- EXPECT_EQ("-2.5", Print(-2.5)); // double
-}
-
-#if GTEST_HAS_RTTI
-TEST(PrintBuiltInTypeTest, TypeInfo) {
- struct MyStruct {};
- auto res = Print(typeid(MyStruct{}));
- // We can't guarantee that we can demangle the name, but either name should
- // contain the substring "MyStruct".
- EXPECT_NE(res.find("MyStruct"), res.npos) << res;
-}
-#endif // GTEST_HAS_RTTI
-
-// Since ::std::stringstream::operator<<(const void *) formats the pointer
-// output differently with different compilers, we have to create the expected
-// output first and use it as our expectation.
-static std::string PrintPointer(const void* p) {
- ::std::stringstream expected_result_stream;
- expected_result_stream << p;
- return expected_result_stream.str();
-}
-
-// Tests printing C strings.
-
-// const char*.
-TEST(PrintCStringTest, Const) {
- const char* p = "World";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"World\"", Print(p));
-}
-
-// char*.
-TEST(PrintCStringTest, NonConst) {
- char p[] = "Hi";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"Hi\"",
- Print(static_cast<char*>(p)));
-}
-
-// NULL C string.
-TEST(PrintCStringTest, Null) {
- const char* p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that C strings are escaped properly.
-TEST(PrintCStringTest, EscapesProperly) {
- const char* p = "'\"?\\\a\b\f\n\r\t\v\x7F\xFF a";
- EXPECT_EQ(PrintPointer(p) + " pointing to \"'\\\"?\\\\\\a\\b\\f"
- "\\n\\r\\t\\v\\x7F\\xFF a\"",
- Print(p));
-}
-
-#ifdef __cpp_char8_t
-// const char8_t*.
-TEST(PrintU8StringTest, Const) {
- const char8_t* p = u8"界";
- EXPECT_EQ(PrintPointer(p) + " pointing to u8\"\\xE7\\x95\\x8C\"", Print(p));
-}
-
-// char8_t*.
-TEST(PrintU8StringTest, NonConst) {
- char8_t p[] = u8"世";
- EXPECT_EQ(PrintPointer(p) + " pointing to u8\"\\xE4\\xB8\\x96\"",
- Print(static_cast<char8_t*>(p)));
-}
-
-// NULL u8 string.
-TEST(PrintU8StringTest, Null) {
- const char8_t* p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that u8 strings are escaped properly.
-TEST(PrintU8StringTest, EscapesProperly) {
- const char8_t* p = u8"'\"?\\\a\b\f\n\r\t\v\x7F\xFF hello 世界";
- EXPECT_EQ(PrintPointer(p) +
- " pointing to u8\"'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\x7F\\xFF "
- "hello \\xE4\\xB8\\x96\\xE7\\x95\\x8C\"",
- Print(p));
-}
-#endif
-
-// const char16_t*.
-TEST(PrintU16StringTest, Const) {
- const char16_t* p = u"界";
- EXPECT_EQ(PrintPointer(p) + " pointing to u\"\\x754C\"", Print(p));
-}
-
-// char16_t*.
-TEST(PrintU16StringTest, NonConst) {
- char16_t p[] = u"世";
- EXPECT_EQ(PrintPointer(p) + " pointing to u\"\\x4E16\"",
- Print(static_cast<char16_t*>(p)));
-}
-
-// NULL u16 string.
-TEST(PrintU16StringTest, Null) {
- const char16_t* p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that u16 strings are escaped properly.
-TEST(PrintU16StringTest, EscapesProperly) {
- const char16_t* p = u"'\"?\\\a\b\f\n\r\t\v\x7F\xFF hello 世界";
- EXPECT_EQ(PrintPointer(p) +
- " pointing to u\"'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\x7F\\xFF "
- "hello \\x4E16\\x754C\"",
- Print(p));
-}
-
-// const char32_t*.
-TEST(PrintU32StringTest, Const) {
- const char32_t* p = U"🗺ï¸";
- EXPECT_EQ(PrintPointer(p) + " pointing to U\"\\x1F5FA\\xFE0F\"", Print(p));
-}
-
-// char32_t*.
-TEST(PrintU32StringTest, NonConst) {
- char32_t p[] = U"🌌";
- EXPECT_EQ(PrintPointer(p) + " pointing to U\"\\x1F30C\"",
- Print(static_cast<char32_t*>(p)));
-}
-
-// NULL u32 string.
-TEST(PrintU32StringTest, Null) {
- const char32_t* p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that u32 strings are escaped properly.
-TEST(PrintU32StringTest, EscapesProperly) {
- const char32_t* p = U"'\"?\\\a\b\f\n\r\t\v\x7F\xFF hello 🗺ï¸";
- EXPECT_EQ(PrintPointer(p) +
- " pointing to U\"'\\\"?\\\\\\a\\b\\f\\n\\r\\t\\v\\x7F\\xFF "
- "hello \\x1F5FA\\xFE0F\"",
- Print(p));
-}
-
-// MSVC compiler can be configured to define whar_t as a typedef
-// of unsigned short. Defining an overload for const wchar_t* in that case
-// would cause pointers to unsigned shorts be printed as wide strings,
-// possibly accessing more memory than intended and causing invalid
-// memory accesses. MSVC defines _NATIVE_WCHAR_T_DEFINED symbol when
-// wchar_t is implemented as a native type.
-#if !defined(_MSC_VER) || defined(_NATIVE_WCHAR_T_DEFINED)
-
-// const wchar_t*.
-TEST(PrintWideCStringTest, Const) {
- const wchar_t* p = L"World";
- EXPECT_EQ(PrintPointer(p) + " pointing to L\"World\"", Print(p));
-}
-
-// wchar_t*.
-TEST(PrintWideCStringTest, NonConst) {
- wchar_t p[] = L"Hi";
- EXPECT_EQ(PrintPointer(p) + " pointing to L\"Hi\"",
- Print(static_cast<wchar_t*>(p)));
-}
-
-// NULL wide C string.
-TEST(PrintWideCStringTest, Null) {
- const wchar_t* p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests that wide C strings are escaped properly.
-TEST(PrintWideCStringTest, EscapesProperly) {
- const wchar_t s[] = {'\'', '"', '?', '\\', '\a', '\b', '\f', '\n', '\r',
- '\t', '\v', 0xD3, 0x576, 0x8D3, 0xC74D, ' ', 'a', '\0'};
- EXPECT_EQ(PrintPointer(s) + " pointing to L\"'\\\"?\\\\\\a\\b\\f"
- "\\n\\r\\t\\v\\xD3\\x576\\x8D3\\xC74D a\"",
- Print(static_cast<const wchar_t*>(s)));
-}
-#endif // native wchar_t
-
-// Tests printing pointers to other char types.
-
-// signed char*.
-TEST(PrintCharPointerTest, SignedChar) {
- signed char* p = reinterpret_cast<signed char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const signed char*.
-TEST(PrintCharPointerTest, ConstSignedChar) {
- signed char* p = reinterpret_cast<signed char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// unsigned char*.
-TEST(PrintCharPointerTest, UnsignedChar) {
- unsigned char* p = reinterpret_cast<unsigned char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const unsigned char*.
-TEST(PrintCharPointerTest, ConstUnsignedChar) {
- const unsigned char* p = reinterpret_cast<const unsigned char*>(0x1234);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing pointers to simple, built-in types.
-
-// bool*.
-TEST(PrintPointerToBuiltInTypeTest, Bool) {
- bool* p = reinterpret_cast<bool*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// void*.
-TEST(PrintPointerToBuiltInTypeTest, Void) {
- void* p = reinterpret_cast<void*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// const void*.
-TEST(PrintPointerToBuiltInTypeTest, ConstVoid) {
- const void* p = reinterpret_cast<const void*>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing pointers to pointers.
-TEST(PrintPointerToPointerTest, IntPointerPointer) {
- int** p = reinterpret_cast<int**>(0xABCD);
- EXPECT_EQ(PrintPointer(p), Print(p));
- p = nullptr;
- EXPECT_EQ("NULL", Print(p));
-}
-
-// Tests printing (non-member) function pointers.
-
-void MyFunction(int /* n */) {}
-
-TEST(PrintPointerTest, NonMemberFunctionPointer) {
- // We cannot directly cast &MyFunction to const void* because the
- // standard disallows casting between pointers to functions and
- // pointers to objects, and some compilers (e.g. GCC 3.4) enforce
- // this limitation.
- EXPECT_EQ(
- PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(&MyFunction))),
- Print(&MyFunction));
- int (*p)(bool) = NULL; // NOLINT
- EXPECT_EQ("NULL", Print(p));
-}
-
-// An assertion predicate determining whether a one string is a prefix for
-// another.
-template <typename StringType>
-AssertionResult HasPrefix(const StringType& str, const StringType& prefix) {
- if (str.find(prefix, 0) == 0)
- return AssertionSuccess();
-
- const bool is_wide_string = sizeof(prefix[0]) > 1;
- const char* const begin_string_quote = is_wide_string ? "L\"" : "\"";
- return AssertionFailure()
- << begin_string_quote << prefix << "\" is not a prefix of "
- << begin_string_quote << str << "\"\n";
-}
-
-// Tests printing member variable pointers. Although they are called
-// pointers, they don't point to a location in the address space.
-// Their representation is implementation-defined. Thus they will be
-// printed as raw bytes.
-
-struct Foo {
- public:
- virtual ~Foo() {}
- int MyMethod(char x) { return x + 1; }
- virtual char MyVirtualMethod(int /* n */) { return 'a'; }
-
- int value;
-};
-
-TEST(PrintPointerTest, MemberVariablePointer) {
- EXPECT_TRUE(HasPrefix(Print(&Foo::value),
- Print(sizeof(&Foo::value)) + "-byte object "));
- int Foo::*p = NULL; // NOLINT
- EXPECT_TRUE(HasPrefix(Print(p),
- Print(sizeof(p)) + "-byte object "));
-}
-
-// Tests printing member function pointers. Although they are called
-// pointers, they don't point to a location in the address space.
-// Their representation is implementation-defined. Thus they will be
-// printed as raw bytes.
-TEST(PrintPointerTest, MemberFunctionPointer) {
- EXPECT_TRUE(HasPrefix(Print(&Foo::MyMethod),
- Print(sizeof(&Foo::MyMethod)) + "-byte object "));
- EXPECT_TRUE(
- HasPrefix(Print(&Foo::MyVirtualMethod),
- Print(sizeof((&Foo::MyVirtualMethod))) + "-byte object "));
- int (Foo::*p)(char) = NULL; // NOLINT
- EXPECT_TRUE(HasPrefix(Print(p),
- Print(sizeof(p)) + "-byte object "));
-}
-
-// Tests printing C arrays.
-
-// The difference between this and Print() is that it ensures that the
-// argument is a reference to an array.
-template <typename T, size_t N>
-std::string PrintArrayHelper(T (&a)[N]) {
- return Print(a);
-}
-
-// One-dimensional array.
-TEST(PrintArrayTest, OneDimensionalArray) {
- int a[5] = { 1, 2, 3, 4, 5 };
- EXPECT_EQ("{ 1, 2, 3, 4, 5 }", PrintArrayHelper(a));
-}
-
-// Two-dimensional array.
-TEST(PrintArrayTest, TwoDimensionalArray) {
- int a[2][5] = {
- { 1, 2, 3, 4, 5 },
- { 6, 7, 8, 9, 0 }
- };
- EXPECT_EQ("{ { 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 0 } }", PrintArrayHelper(a));
-}
-
-// Array of const elements.
-TEST(PrintArrayTest, ConstArray) {
- const bool a[1] = { false };
- EXPECT_EQ("{ false }", PrintArrayHelper(a));
-}
-
-// char array without terminating NUL.
-TEST(PrintArrayTest, CharArrayWithNoTerminatingNul) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- char a[] = { 'H', '\0', 'i' };
- EXPECT_EQ("\"H\\0i\" (no terminating NUL)", PrintArrayHelper(a));
-}
-
-// char array with terminating NUL.
-TEST(PrintArrayTest, CharArrayWithTerminatingNul) {
- const char a[] = "\0Hi";
- EXPECT_EQ("\"\\0Hi\"", PrintArrayHelper(a));
-}
-
-#ifdef __cpp_char8_t
-// char_t array without terminating NUL.
-TEST(PrintArrayTest, Char8ArrayWithNoTerminatingNul) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- const char8_t a[] = {u8'H', u8'\0', u8'i'};
- EXPECT_EQ("u8\"H\\0i\" (no terminating NUL)", PrintArrayHelper(a));
-}
-
-// char8_t array with terminating NUL.
-TEST(PrintArrayTest, Char8ArrayWithTerminatingNul) {
- const char8_t a[] = u8"\0世界";
- EXPECT_EQ(
- "u8\"\\0\\xE4\\xB8\\x96\\xE7\\x95\\x8C\"",
- PrintArrayHelper(a));
-}
-#endif
-
-// const char16_t array without terminating NUL.
-TEST(PrintArrayTest, Char16ArrayWithNoTerminatingNul) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- const char16_t a[] = {u'ã“', u'\0', u'ã‚“', u'ã«', u'ã¡', u'ã¯'};
- EXPECT_EQ("u\"\\x3053\\0\\x3093\\x306B\\x3061\\x306F\" (no terminating NUL)",
- PrintArrayHelper(a));
-}
-
-// char16_t array with terminating NUL.
-TEST(PrintArrayTest, Char16ArrayWithTerminatingNul) {
- const char16_t a[] = u"\0ã“ã‚“ã«ã¡ã¯";
- EXPECT_EQ("u\"\\0\\x3053\\x3093\\x306B\\x3061\\x306F\"", PrintArrayHelper(a));
-}
-
-// char32_t array without terminating NUL.
-TEST(PrintArrayTest, Char32ArrayWithNoTerminatingNul) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- const char32_t a[] = {U'👋', U'\0', U'🌌'};
- EXPECT_EQ("U\"\\x1F44B\\0\\x1F30C\" (no terminating NUL)",
- PrintArrayHelper(a));
-}
-
-// char32_t array with terminating NUL.
-TEST(PrintArrayTest, Char32ArrayWithTerminatingNul) {
- const char32_t a[] = U"\0👋🌌";
- EXPECT_EQ("U\"\\0\\x1F44B\\x1F30C\"", PrintArrayHelper(a));
-}
-
-// wchar_t array without terminating NUL.
-TEST(PrintArrayTest, WCharArrayWithNoTerminatingNul) {
- // Array a contains '\0' in the middle and doesn't end with '\0'.
- const wchar_t a[] = {L'H', L'\0', L'i'};
- EXPECT_EQ("L\"H\\0i\" (no terminating NUL)", PrintArrayHelper(a));
-}
-
-// wchar_t array with terminating NUL.
-TEST(PrintArrayTest, WCharArrayWithTerminatingNul) {
- const wchar_t a[] = L"\0Hi";
- EXPECT_EQ("L\"\\0Hi\"", PrintArrayHelper(a));
-}
-
-// Array of objects.
-TEST(PrintArrayTest, ObjectArray) {
- std::string a[3] = {"Hi", "Hello", "Ni hao"};
- EXPECT_EQ("{ \"Hi\", \"Hello\", \"Ni hao\" }", PrintArrayHelper(a));
-}
-
-// Array with many elements.
-TEST(PrintArrayTest, BigArray) {
- int a[100] = { 1, 2, 3 };
- EXPECT_EQ("{ 1, 2, 3, 0, 0, 0, 0, 0, ..., 0, 0, 0, 0, 0, 0, 0, 0 }",
- PrintArrayHelper(a));
-}
-
-// Tests printing ::string and ::std::string.
-
-// ::std::string.
-TEST(PrintStringTest, StringInStdNamespace) {
- const char s[] = "'\"?\\\a\b\f\n\0\r\t\v\x7F\xFF a";
- const ::std::string str(s, sizeof(s));
- EXPECT_EQ("\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v\\x7F\\xFF a\\0\"",
- Print(str));
-}
-
-TEST(PrintStringTest, StringAmbiguousHex) {
- // "\x6BANANA" is ambiguous, it can be interpreted as starting with either of:
- // '\x6', '\x6B', or '\x6BA'.
-
- // a hex escaping sequence following by a decimal digit
- EXPECT_EQ("\"0\\x12\" \"3\"", Print(::std::string("0\x12" "3")));
- // a hex escaping sequence following by a hex digit (lower-case)
- EXPECT_EQ("\"mm\\x6\" \"bananas\"", Print(::std::string("mm\x6" "bananas")));
- // a hex escaping sequence following by a hex digit (upper-case)
- EXPECT_EQ("\"NOM\\x6\" \"BANANA\"", Print(::std::string("NOM\x6" "BANANA")));
- // a hex escaping sequence following by a non-xdigit
- EXPECT_EQ("\"!\\x5-!\"", Print(::std::string("!\x5-!")));
-}
-
-// Tests printing ::std::wstring.
-#if GTEST_HAS_STD_WSTRING
-// ::std::wstring.
-TEST(PrintWideStringTest, StringInStdNamespace) {
- const wchar_t s[] = L"'\"?\\\a\b\f\n\0\r\t\v\xD3\x576\x8D3\xC74D a";
- const ::std::wstring str(s, sizeof(s)/sizeof(wchar_t));
- EXPECT_EQ("L\"'\\\"?\\\\\\a\\b\\f\\n\\0\\r\\t\\v"
- "\\xD3\\x576\\x8D3\\xC74D a\\0\"",
- Print(str));
-}
-
-TEST(PrintWideStringTest, StringAmbiguousHex) {
- // same for wide strings.
- EXPECT_EQ("L\"0\\x12\" L\"3\"", Print(::std::wstring(L"0\x12" L"3")));
- EXPECT_EQ("L\"mm\\x6\" L\"bananas\"",
- Print(::std::wstring(L"mm\x6" L"bananas")));
- EXPECT_EQ("L\"NOM\\x6\" L\"BANANA\"",
- Print(::std::wstring(L"NOM\x6" L"BANANA")));
- EXPECT_EQ("L\"!\\x5-!\"", Print(::std::wstring(L"!\x5-!")));
-}
-#endif // GTEST_HAS_STD_WSTRING
-
-#ifdef __cpp_char8_t
-TEST(PrintStringTest, U8String) {
- std::u8string str = u8"Hello, 世界";
- EXPECT_EQ(str, str); // Verify EXPECT_EQ compiles with this type.
- EXPECT_EQ("u8\"Hello, \\xE4\\xB8\\x96\\xE7\\x95\\x8C\"", Print(str));
-}
-#endif
-
-TEST(PrintStringTest, U16String) {
- std::u16string str = u"Hello, 世界";
- EXPECT_EQ(str, str); // Verify EXPECT_EQ compiles with this type.
- EXPECT_EQ("u\"Hello, \\x4E16\\x754C\"", Print(str));
-}
-
-TEST(PrintStringTest, U32String) {
- std::u32string str = U"Hello, 🗺ï¸";
- EXPECT_EQ(str, str); // Verify EXPECT_EQ compiles with this type
- EXPECT_EQ("U\"Hello, \\x1F5FA\\xFE0F\"", Print(str));
-}
-
-// Tests printing types that support generic streaming (i.e. streaming
-// to std::basic_ostream<Char, CharTraits> for any valid Char and
-// CharTraits types).
-
-// Tests printing a non-template type that supports generic streaming.
-
-class AllowsGenericStreaming {};
-
-template <typename Char, typename CharTraits>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreaming& /* a */) {
- return os << "AllowsGenericStreaming";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, NonTemplateType) {
- AllowsGenericStreaming a;
- EXPECT_EQ("AllowsGenericStreaming", Print(a));
-}
-
-// Tests printing a template type that supports generic streaming.
-
-template <typename T>
-class AllowsGenericStreamingTemplate {};
-
-template <typename Char, typename CharTraits, typename T>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreamingTemplate<T>& /* a */) {
- return os << "AllowsGenericStreamingTemplate";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, TemplateType) {
- AllowsGenericStreamingTemplate<int> a;
- EXPECT_EQ("AllowsGenericStreamingTemplate", Print(a));
-}
-
-// Tests printing a type that supports generic streaming and can be
-// implicitly converted to another printable type.
-
-template <typename T>
-class AllowsGenericStreamingAndImplicitConversionTemplate {
- public:
- operator bool() const { return false; }
-};
-
-template <typename Char, typename CharTraits, typename T>
-std::basic_ostream<Char, CharTraits>& operator<<(
- std::basic_ostream<Char, CharTraits>& os,
- const AllowsGenericStreamingAndImplicitConversionTemplate<T>& /* a */) {
- return os << "AllowsGenericStreamingAndImplicitConversionTemplate";
-}
-
-TEST(PrintTypeWithGenericStreamingTest, TypeImplicitlyConvertible) {
- AllowsGenericStreamingAndImplicitConversionTemplate<int> a;
- EXPECT_EQ("AllowsGenericStreamingAndImplicitConversionTemplate", Print(a));
-}
-
-#if GTEST_INTERNAL_HAS_STRING_VIEW
-
-// Tests printing internal::StringView.
-
-TEST(PrintStringViewTest, SimpleStringView) {
- const internal::StringView sp = "Hello";
- EXPECT_EQ("\"Hello\"", Print(sp));
-}
-
-TEST(PrintStringViewTest, UnprintableCharacters) {
- const char str[] = "NUL (\0) and \r\t";
- const internal::StringView sp(str, sizeof(str) - 1);
- EXPECT_EQ("\"NUL (\\0) and \\r\\t\"", Print(sp));
-}
-
-#endif // GTEST_INTERNAL_HAS_STRING_VIEW
-
-// Tests printing STL containers.
-
-TEST(PrintStlContainerTest, EmptyDeque) {
- deque<char> empty;
- EXPECT_EQ("{}", Print(empty));
-}
-
-TEST(PrintStlContainerTest, NonEmptyDeque) {
- deque<int> non_empty;
- non_empty.push_back(1);
- non_empty.push_back(3);
- EXPECT_EQ("{ 1, 3 }", Print(non_empty));
-}
-
-
-TEST(PrintStlContainerTest, OneElementHashMap) {
- ::std::unordered_map<int, char> map1;
- map1[1] = 'a';
- EXPECT_EQ("{ (1, 'a' (97, 0x61)) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, HashMultiMap) {
- ::std::unordered_multimap<int, bool> map1;
- map1.insert(make_pair(5, true));
- map1.insert(make_pair(5, false));
-
- // Elements of hash_multimap can be printed in any order.
- const std::string result = Print(map1);
- EXPECT_TRUE(result == "{ (5, true), (5, false) }" ||
- result == "{ (5, false), (5, true) }")
- << " where Print(map1) returns \"" << result << "\".";
-}
-
-
-
-TEST(PrintStlContainerTest, HashSet) {
- ::std::unordered_set<int> set1;
- set1.insert(1);
- EXPECT_EQ("{ 1 }", Print(set1));
-}
-
-TEST(PrintStlContainerTest, HashMultiSet) {
- const int kSize = 5;
- int a[kSize] = { 1, 1, 2, 5, 1 };
- ::std::unordered_multiset<int> set1(a, a + kSize);
-
- // Elements of hash_multiset can be printed in any order.
- const std::string result = Print(set1);
- const std::string expected_pattern = "{ d, d, d, d, d }"; // d means a digit.
-
- // Verifies the result matches the expected pattern; also extracts
- // the numbers in the result.
- ASSERT_EQ(expected_pattern.length(), result.length());
- std::vector<int> numbers;
- for (size_t i = 0; i != result.length(); i++) {
- if (expected_pattern[i] == 'd') {
- ASSERT_NE(isdigit(static_cast<unsigned char>(result[i])), 0);
- numbers.push_back(result[i] - '0');
- } else {
- EXPECT_EQ(expected_pattern[i], result[i]) << " where result is "
- << result;
- }
- }
-
- // Makes sure the result contains the right numbers.
- std::sort(numbers.begin(), numbers.end());
- std::sort(a, a + kSize);
- EXPECT_TRUE(std::equal(a, a + kSize, numbers.begin()));
-}
-
-
-TEST(PrintStlContainerTest, List) {
- const std::string a[] = {"hello", "world"};
- const list<std::string> strings(a, a + 2);
- EXPECT_EQ("{ \"hello\", \"world\" }", Print(strings));
-}
-
-TEST(PrintStlContainerTest, Map) {
- map<int, bool> map1;
- map1[1] = true;
- map1[5] = false;
- map1[3] = true;
- EXPECT_EQ("{ (1, true), (3, true), (5, false) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, MultiMap) {
- multimap<bool, int> map1;
- // The make_pair template function would deduce the type as
- // pair<bool, int> here, and since the key part in a multimap has to
- // be constant, without a templated ctor in the pair class (as in
- // libCstd on Solaris), make_pair call would fail to compile as no
- // implicit conversion is found. Thus explicit typename is used
- // here instead.
- map1.insert(pair<const bool, int>(true, 0));
- map1.insert(pair<const bool, int>(true, 1));
- map1.insert(pair<const bool, int>(false, 2));
- EXPECT_EQ("{ (false, 2), (true, 0), (true, 1) }", Print(map1));
-}
-
-TEST(PrintStlContainerTest, Set) {
- const unsigned int a[] = { 3, 0, 5 };
- set<unsigned int> set1(a, a + 3);
- EXPECT_EQ("{ 0, 3, 5 }", Print(set1));
-}
-
-TEST(PrintStlContainerTest, MultiSet) {
- const int a[] = { 1, 1, 2, 5, 1 };
- multiset<int> set1(a, a + 5);
- EXPECT_EQ("{ 1, 1, 1, 2, 5 }", Print(set1));
-}
-
-
-TEST(PrintStlContainerTest, SinglyLinkedList) {
- int a[] = { 9, 2, 8 };
- const std::forward_list<int> ints(a, a + 3);
- EXPECT_EQ("{ 9, 2, 8 }", Print(ints));
-}
-
-TEST(PrintStlContainerTest, Pair) {
- pair<const bool, int> p(true, 5);
- EXPECT_EQ("(true, 5)", Print(p));
-}
-
-TEST(PrintStlContainerTest, Vector) {
- vector<int> v;
- v.push_back(1);
- v.push_back(2);
- EXPECT_EQ("{ 1, 2 }", Print(v));
-}
-
-TEST(PrintStlContainerTest, LongSequence) {
- const int a[100] = { 1, 2, 3 };
- const vector<int> v(a, a + 100);
- EXPECT_EQ("{ 1, 2, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "
- "0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ... }", Print(v));
-}
-
-TEST(PrintStlContainerTest, NestedContainer) {
- const int a1[] = { 1, 2 };
- const int a2[] = { 3, 4, 5 };
- const list<int> l1(a1, a1 + 2);
- const list<int> l2(a2, a2 + 3);
-
- vector<list<int> > v;
- v.push_back(l1);
- v.push_back(l2);
- EXPECT_EQ("{ { 1, 2 }, { 3, 4, 5 } }", Print(v));
-}
-
-TEST(PrintStlContainerTest, OneDimensionalNativeArray) {
- const int a[3] = { 1, 2, 3 };
- NativeArray<int> b(a, 3, RelationToSourceReference());
- EXPECT_EQ("{ 1, 2, 3 }", Print(b));
-}
-
-TEST(PrintStlContainerTest, TwoDimensionalNativeArray) {
- const int a[2][3] = { { 1, 2, 3 }, { 4, 5, 6 } };
- NativeArray<int[3]> b(a, 2, RelationToSourceReference());
- EXPECT_EQ("{ { 1, 2, 3 }, { 4, 5, 6 } }", Print(b));
-}
-
-// Tests that a class named iterator isn't treated as a container.
-
-struct iterator {
- char x;
-};
-
-TEST(PrintStlContainerTest, Iterator) {
- iterator it = {};
- EXPECT_EQ("1-byte object <00>", Print(it));
-}
-
-// Tests that a class named const_iterator isn't treated as a container.
-
-struct const_iterator {
- char x;
-};
-
-TEST(PrintStlContainerTest, ConstIterator) {
- const_iterator it = {};
- EXPECT_EQ("1-byte object <00>", Print(it));
-}
-
-// Tests printing ::std::tuples.
-
-// Tuples of various arities.
-TEST(PrintStdTupleTest, VariousSizes) {
- ::std::tuple<> t0;
- EXPECT_EQ("()", Print(t0));
-
- ::std::tuple<int> t1(5);
- EXPECT_EQ("(5)", Print(t1));
-
- ::std::tuple<char, bool> t2('a', true);
- EXPECT_EQ("('a' (97, 0x61), true)", Print(t2));
-
- ::std::tuple<bool, int, int> t3(false, 2, 3);
- EXPECT_EQ("(false, 2, 3)", Print(t3));
-
- ::std::tuple<bool, int, int, int> t4(false, 2, 3, 4);
- EXPECT_EQ("(false, 2, 3, 4)", Print(t4));
-
- const char* const str = "8";
- ::std::tuple<bool, char, short, int32_t, int64_t, float, double, // NOLINT
- const char*, void*, std::string>
- t10(false, 'a', static_cast<short>(3), 4, 5, 1.5F, -2.5, str, // NOLINT
- nullptr, "10");
- EXPECT_EQ("(false, 'a' (97, 0x61), 3, 4, 5, 1.5, -2.5, " + PrintPointer(str) +
- " pointing to \"8\", NULL, \"10\")",
- Print(t10));
-}
-
-// Nested tuples.
-TEST(PrintStdTupleTest, NestedTuple) {
- ::std::tuple< ::std::tuple<int, bool>, char> nested(
- ::std::make_tuple(5, true), 'a');
- EXPECT_EQ("((5, true), 'a' (97, 0x61))", Print(nested));
-}
-
-TEST(PrintNullptrT, Basic) {
- EXPECT_EQ("(nullptr)", Print(nullptr));
-}
-
-TEST(PrintReferenceWrapper, Printable) {
- int x = 5;
- EXPECT_EQ("@" + PrintPointer(&x) + " 5", Print(std::ref(x)));
- EXPECT_EQ("@" + PrintPointer(&x) + " 5", Print(std::cref(x)));
-}
-
-TEST(PrintReferenceWrapper, Unprintable) {
- ::foo::UnprintableInFoo up;
- EXPECT_EQ(
- "@" + PrintPointer(&up) +
- " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- Print(std::ref(up)));
- EXPECT_EQ(
- "@" + PrintPointer(&up) +
- " 16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- Print(std::cref(up)));
-}
-
-// Tests printing user-defined unprintable types.
-
-// Unprintable types in the global namespace.
-TEST(PrintUnprintableTypeTest, InGlobalNamespace) {
- EXPECT_EQ("1-byte object <00>",
- Print(UnprintableTemplateInGlobal<char>()));
-}
-
-// Unprintable types in a user namespace.
-TEST(PrintUnprintableTypeTest, InUserNamespace) {
- EXPECT_EQ("16-byte object <EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- Print(::foo::UnprintableInFoo()));
-}
-
-// Unprintable types are that too big to be printed completely.
-
-struct Big {
- Big() { memset(array, 0, sizeof(array)); }
- char array[257];
-};
-
-TEST(PrintUnpritableTypeTest, BigObject) {
- EXPECT_EQ("257-byte object <00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 ... 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 "
- "00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00 00>",
- Print(Big()));
-}
-
-// Tests printing user-defined streamable types.
-
-// Streamable types in the global namespace.
-TEST(PrintStreamableTypeTest, InGlobalNamespace) {
- StreamableInGlobal x;
- EXPECT_EQ("StreamableInGlobal", Print(x));
- EXPECT_EQ("StreamableInGlobal*", Print(&x));
-}
-
-// Printable template types in a user namespace.
-TEST(PrintStreamableTypeTest, TemplateTypeInUserNamespace) {
- EXPECT_EQ("StreamableTemplateInFoo: 0",
- Print(::foo::StreamableTemplateInFoo<int>()));
-}
-
-TEST(PrintStreamableTypeTest, TypeInUserNamespaceWithTemplatedStreamOperator) {
- EXPECT_EQ("TemplatedStreamableInFoo",
- Print(::foo::TemplatedStreamableInFoo()));
-}
-
-TEST(PrintStreamableTypeTest, SubclassUsesSuperclassStreamOperator) {
- ParentClass parent;
- ChildClassWithStreamOperator child_stream;
- ChildClassWithoutStreamOperator child_no_stream;
- EXPECT_EQ("ParentClass", Print(parent));
- EXPECT_EQ("ChildClassWithStreamOperator", Print(child_stream));
- EXPECT_EQ("ParentClass", Print(child_no_stream));
-}
-
-// Tests printing a user-defined recursive container type that has a <<
-// operator.
-TEST(PrintStreamableTypeTest, PathLikeInUserNamespace) {
- ::foo::PathLike x;
- EXPECT_EQ("Streamable-PathLike", Print(x));
- const ::foo::PathLike cx;
- EXPECT_EQ("Streamable-PathLike", Print(cx));
-}
-
-// Tests printing user-defined types that have a PrintTo() function.
-TEST(PrintPrintableTypeTest, InUserNamespace) {
- EXPECT_EQ("PrintableViaPrintTo: 0",
- Print(::foo::PrintableViaPrintTo()));
-}
-
-// Tests printing a pointer to a user-defined type that has a <<
-// operator for its pointer.
-TEST(PrintPrintableTypeTest, PointerInUserNamespace) {
- ::foo::PointerPrintable x;
- EXPECT_EQ("PointerPrintable*", Print(&x));
-}
-
-// Tests printing user-defined class template that have a PrintTo() function.
-TEST(PrintPrintableTypeTest, TemplateInUserNamespace) {
- EXPECT_EQ("PrintableViaPrintToTemplate: 5",
- Print(::foo::PrintableViaPrintToTemplate<int>(5)));
-}
-
-// Tests that the universal printer prints both the address and the
-// value of a reference.
-TEST(PrintReferenceTest, PrintsAddressAndValue) {
- int n = 5;
- EXPECT_EQ("@" + PrintPointer(&n) + " 5", PrintByRef(n));
-
- int a[2][3] = {
- { 0, 1, 2 },
- { 3, 4, 5 }
- };
- EXPECT_EQ("@" + PrintPointer(a) + " { { 0, 1, 2 }, { 3, 4, 5 } }",
- PrintByRef(a));
-
- const ::foo::UnprintableInFoo x;
- EXPECT_EQ("@" + PrintPointer(&x) + " 16-byte object "
- "<EF-12 00-00 34-AB 00-00 00-00 00-00 00-00 00-00>",
- PrintByRef(x));
-}
-
-// Tests that the universal printer prints a function pointer passed by
-// reference.
-TEST(PrintReferenceTest, HandlesFunctionPointer) {
- void (*fp)(int n) = &MyFunction;
- const std::string fp_pointer_string =
- PrintPointer(reinterpret_cast<const void*>(&fp));
- // We cannot directly cast &MyFunction to const void* because the
- // standard disallows casting between pointers to functions and
- // pointers to objects, and some compilers (e.g. GCC 3.4) enforce
- // this limitation.
- const std::string fp_string = PrintPointer(reinterpret_cast<const void*>(
- reinterpret_cast<internal::BiggestInt>(fp)));
- EXPECT_EQ("@" + fp_pointer_string + " " + fp_string,
- PrintByRef(fp));
-}
-
-// Tests that the universal printer prints a member function pointer
-// passed by reference.
-TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
- int (Foo::*p)(char ch) = &Foo::MyMethod;
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p),
- "@" + PrintPointer(reinterpret_cast<const void*>(&p)) + " " +
- Print(sizeof(p)) + "-byte object "));
-
- char (Foo::*p2)(int n) = &Foo::MyVirtualMethod;
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p2),
- "@" + PrintPointer(reinterpret_cast<const void*>(&p2)) + " " +
- Print(sizeof(p2)) + "-byte object "));
-}
-
-// Tests that the universal printer prints a member variable pointer
-// passed by reference.
-TEST(PrintReferenceTest, HandlesMemberVariablePointer) {
- int Foo::*p = &Foo::value; // NOLINT
- EXPECT_TRUE(HasPrefix(
- PrintByRef(p),
- "@" + PrintPointer(&p) + " " + Print(sizeof(p)) + "-byte object "));
-}
-
-// Tests that FormatForComparisonFailureMessage(), which is used to print
-// an operand in a comparison assertion (e.g. ASSERT_EQ) when the assertion
-// fails, formats the operand in the desired way.
-
-// scalar
-TEST(FormatForComparisonFailureMessageTest, WorksForScalar) {
- EXPECT_STREQ("123",
- FormatForComparisonFailureMessage(123, 124).c_str());
-}
-
-// non-char pointer
-TEST(FormatForComparisonFailureMessageTest, WorksForNonCharPointer) {
- int n = 0;
- EXPECT_EQ(PrintPointer(&n),
- FormatForComparisonFailureMessage(&n, &n).c_str());
-}
-
-// non-char array
-TEST(FormatForComparisonFailureMessageTest, FormatsNonCharArrayAsPointer) {
- // In expression 'array == x', 'array' is compared by pointer.
- // Therefore we want to print an array operand as a pointer.
- int n[] = { 1, 2, 3 };
- EXPECT_EQ(PrintPointer(n),
- FormatForComparisonFailureMessage(n, n).c_str());
-}
-
-// Tests formatting a char pointer when it's compared with another pointer.
-// In this case we want to print it as a raw pointer, as the comparison is by
-// pointer.
-
-// char pointer vs pointer
-TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsPointer) {
- // In expression 'p == x', where 'p' and 'x' are (const or not) char
- // pointers, the operands are compared by pointer. Therefore we
- // want to print 'p' as a pointer instead of a C string (we don't
- // even know if it's supposed to point to a valid C string).
-
- // const char*
- const char* s = "hello";
- EXPECT_EQ(PrintPointer(s),
- FormatForComparisonFailureMessage(s, s).c_str());
-
- // char*
- char ch = 'a';
- EXPECT_EQ(PrintPointer(&ch),
- FormatForComparisonFailureMessage(&ch, &ch).c_str());
-}
-
-// wchar_t pointer vs pointer
-TEST(FormatForComparisonFailureMessageTest, WorksForWCharPointerVsPointer) {
- // In expression 'p == x', where 'p' and 'x' are (const or not) char
- // pointers, the operands are compared by pointer. Therefore we
- // want to print 'p' as a pointer instead of a wide C string (we don't
- // even know if it's supposed to point to a valid wide C string).
-
- // const wchar_t*
- const wchar_t* s = L"hello";
- EXPECT_EQ(PrintPointer(s),
- FormatForComparisonFailureMessage(s, s).c_str());
-
- // wchar_t*
- wchar_t ch = L'a';
- EXPECT_EQ(PrintPointer(&ch),
- FormatForComparisonFailureMessage(&ch, &ch).c_str());
-}
-
-// Tests formatting a char pointer when it's compared to a string object.
-// In this case we want to print the char pointer as a C string.
-
-// char pointer vs std::string
-TEST(FormatForComparisonFailureMessageTest, WorksForCharPointerVsStdString) {
- const char* s = "hello \"world";
- EXPECT_STREQ("\"hello \\\"world\"", // The string content should be escaped.
- FormatForComparisonFailureMessage(s, ::std::string()).c_str());
-
- // char*
- char str[] = "hi\1";
- char* p = str;
- EXPECT_STREQ("\"hi\\x1\"", // The string content should be escaped.
- FormatForComparisonFailureMessage(p, ::std::string()).c_str());
-}
-
-#if GTEST_HAS_STD_WSTRING
-// wchar_t pointer vs std::wstring
-TEST(FormatForComparisonFailureMessageTest, WorksForWCharPointerVsStdWString) {
- const wchar_t* s = L"hi \"world";
- EXPECT_STREQ("L\"hi \\\"world\"", // The string content should be escaped.
- FormatForComparisonFailureMessage(s, ::std::wstring()).c_str());
-
- // wchar_t*
- wchar_t str[] = L"hi\1";
- wchar_t* p = str;
- EXPECT_STREQ("L\"hi\\x1\"", // The string content should be escaped.
- FormatForComparisonFailureMessage(p, ::std::wstring()).c_str());
-}
-#endif
-
-// Tests formatting a char array when it's compared with a pointer or array.
-// In this case we want to print the array as a row pointer, as the comparison
-// is by pointer.
-
-// char array vs pointer
-TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsPointer) {
- char str[] = "hi \"world\"";
- char* p = nullptr;
- EXPECT_EQ(PrintPointer(str),
- FormatForComparisonFailureMessage(str, p).c_str());
-}
-
-// char array vs char array
-TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsCharArray) {
- const char str[] = "hi \"world\"";
- EXPECT_EQ(PrintPointer(str),
- FormatForComparisonFailureMessage(str, str).c_str());
-}
-
-// wchar_t array vs pointer
-TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsPointer) {
- wchar_t str[] = L"hi \"world\"";
- wchar_t* p = nullptr;
- EXPECT_EQ(PrintPointer(str),
- FormatForComparisonFailureMessage(str, p).c_str());
-}
-
-// wchar_t array vs wchar_t array
-TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsWCharArray) {
- const wchar_t str[] = L"hi \"world\"";
- EXPECT_EQ(PrintPointer(str),
- FormatForComparisonFailureMessage(str, str).c_str());
-}
-
-// Tests formatting a char array when it's compared with a string object.
-// In this case we want to print the array as a C string.
-
-// char array vs std::string
-TEST(FormatForComparisonFailureMessageTest, WorksForCharArrayVsStdString) {
- const char str[] = "hi \"world\"";
- EXPECT_STREQ("\"hi \\\"world\\\"\"", // The content should be escaped.
- FormatForComparisonFailureMessage(str, ::std::string()).c_str());
-}
-
-#if GTEST_HAS_STD_WSTRING
-// wchar_t array vs std::wstring
-TEST(FormatForComparisonFailureMessageTest, WorksForWCharArrayVsStdWString) {
- const wchar_t str[] = L"hi \"w\0rld\"";
- EXPECT_STREQ(
- "L\"hi \\\"w\"", // The content should be escaped.
- // Embedded NUL terminates the string.
- FormatForComparisonFailureMessage(str, ::std::wstring()).c_str());
-}
-#endif
-
-// Useful for testing PrintToString(). We cannot use EXPECT_EQ()
-// there as its implementation uses PrintToString(). The caller must
-// ensure that 'value' has no side effect.
-#define EXPECT_PRINT_TO_STRING_(value, expected_string) \
- EXPECT_TRUE(PrintToString(value) == (expected_string)) \
- << " where " #value " prints as " << (PrintToString(value))
-
-TEST(PrintToStringTest, WorksForScalar) {
- EXPECT_PRINT_TO_STRING_(123, "123");
-}
-
-TEST(PrintToStringTest, WorksForPointerToConstChar) {
- const char* p = "hello";
- EXPECT_PRINT_TO_STRING_(p, "\"hello\"");
-}
-
-TEST(PrintToStringTest, WorksForPointerToNonConstChar) {
- char s[] = "hello";
- char* p = s;
- EXPECT_PRINT_TO_STRING_(p, "\"hello\"");
-}
-
-TEST(PrintToStringTest, EscapesForPointerToConstChar) {
- const char* p = "hello\n";
- EXPECT_PRINT_TO_STRING_(p, "\"hello\\n\"");
-}
-
-TEST(PrintToStringTest, EscapesForPointerToNonConstChar) {
- char s[] = "hello\1";
- char* p = s;
- EXPECT_PRINT_TO_STRING_(p, "\"hello\\x1\"");
-}
-
-TEST(PrintToStringTest, WorksForArray) {
- int n[3] = { 1, 2, 3 };
- EXPECT_PRINT_TO_STRING_(n, "{ 1, 2, 3 }");
-}
-
-TEST(PrintToStringTest, WorksForCharArray) {
- char s[] = "hello";
- EXPECT_PRINT_TO_STRING_(s, "\"hello\"");
-}
-
-TEST(PrintToStringTest, WorksForCharArrayWithEmbeddedNul) {
- const char str_with_nul[] = "hello\0 world";
- EXPECT_PRINT_TO_STRING_(str_with_nul, "\"hello\\0 world\"");
-
- char mutable_str_with_nul[] = "hello\0 world";
- EXPECT_PRINT_TO_STRING_(mutable_str_with_nul, "\"hello\\0 world\"");
-}
-
- TEST(PrintToStringTest, ContainsNonLatin) {
- // Sanity test with valid UTF-8. Prints both in hex and as text.
- std::string non_ascii_str = ::std::string("오전 4:30");
- EXPECT_PRINT_TO_STRING_(non_ascii_str,
- "\"\\xEC\\x98\\xA4\\xEC\\xA0\\x84 4:30\"\n"
- " As Text: \"오전 4:30\"");
- non_ascii_str = ::std::string("From ä — ẑ");
- EXPECT_PRINT_TO_STRING_(non_ascii_str,
- "\"From \\xC3\\xA4 \\xE2\\x80\\x94 \\xE1\\xBA\\x91\""
- "\n As Text: \"From ä — ẑ\"");
-}
-
-TEST(IsValidUTF8Test, IllFormedUTF8) {
- // The following test strings are ill-formed UTF-8 and are printed
- // as hex only (or ASCII, in case of ASCII bytes) because IsValidUTF8() is
- // expected to fail, thus output does not contain "As Text:".
-
- static const char *const kTestdata[][2] = {
- // 2-byte lead byte followed by a single-byte character.
- {"\xC3\x74", "\"\\xC3t\""},
- // Valid 2-byte character followed by an orphan trail byte.
- {"\xC3\x84\xA4", "\"\\xC3\\x84\\xA4\""},
- // Lead byte without trail byte.
- {"abc\xC3", "\"abc\\xC3\""},
- // 3-byte lead byte, single-byte character, orphan trail byte.
- {"x\xE2\x70\x94", "\"x\\xE2p\\x94\""},
- // Truncated 3-byte character.
- {"\xE2\x80", "\"\\xE2\\x80\""},
- // Truncated 3-byte character followed by valid 2-byte char.
- {"\xE2\x80\xC3\x84", "\"\\xE2\\x80\\xC3\\x84\""},
- // Truncated 3-byte character followed by a single-byte character.
- {"\xE2\x80\x7A", "\"\\xE2\\x80z\""},
- // 3-byte lead byte followed by valid 3-byte character.
- {"\xE2\xE2\x80\x94", "\"\\xE2\\xE2\\x80\\x94\""},
- // 4-byte lead byte followed by valid 3-byte character.
- {"\xF0\xE2\x80\x94", "\"\\xF0\\xE2\\x80\\x94\""},
- // Truncated 4-byte character.
- {"\xF0\xE2\x80", "\"\\xF0\\xE2\\x80\""},
- // Invalid UTF-8 byte sequences embedded in other chars.
- {"abc\xE2\x80\x94\xC3\x74xyc", "\"abc\\xE2\\x80\\x94\\xC3txyc\""},
- {"abc\xC3\x84\xE2\x80\xC3\x84xyz",
- "\"abc\\xC3\\x84\\xE2\\x80\\xC3\\x84xyz\""},
- // Non-shortest UTF-8 byte sequences are also ill-formed.
- // The classics: xC0, xC1 lead byte.
- {"\xC0\x80", "\"\\xC0\\x80\""},
- {"\xC1\x81", "\"\\xC1\\x81\""},
- // Non-shortest sequences.
- {"\xE0\x80\x80", "\"\\xE0\\x80\\x80\""},
- {"\xf0\x80\x80\x80", "\"\\xF0\\x80\\x80\\x80\""},
- // Last valid code point before surrogate range, should be printed as text,
- // too.
- {"\xED\x9F\xBF", "\"\\xED\\x9F\\xBF\"\n As Text: \"퟿\""},
- // Start of surrogate lead. Surrogates are not printed as text.
- {"\xED\xA0\x80", "\"\\xED\\xA0\\x80\""},
- // Last non-private surrogate lead.
- {"\xED\xAD\xBF", "\"\\xED\\xAD\\xBF\""},
- // First private-use surrogate lead.
- {"\xED\xAE\x80", "\"\\xED\\xAE\\x80\""},
- // Last private-use surrogate lead.
- {"\xED\xAF\xBF", "\"\\xED\\xAF\\xBF\""},
- // Mid-point of surrogate trail.
- {"\xED\xB3\xBF", "\"\\xED\\xB3\\xBF\""},
- // First valid code point after surrogate range, should be printed as text,
- // too.
- {"\xEE\x80\x80", "\"\\xEE\\x80\\x80\"\n As Text: \"\""}
- };
-
- for (int i = 0; i < int(sizeof(kTestdata)/sizeof(kTestdata[0])); ++i) {
- EXPECT_PRINT_TO_STRING_(kTestdata[i][0], kTestdata[i][1]);
- }
-}
-
-#undef EXPECT_PRINT_TO_STRING_
-
-TEST(UniversalTersePrintTest, WorksForNonReference) {
- ::std::stringstream ss;
- UniversalTersePrint(123, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalTersePrintTest, WorksForReference) {
- const int& n = 123;
- ::std::stringstream ss;
- UniversalTersePrint(n, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalTersePrintTest, WorksForCString) {
- const char* s1 = "abc";
- ::std::stringstream ss1;
- UniversalTersePrint(s1, &ss1);
- EXPECT_EQ("\"abc\"", ss1.str());
-
- char* s2 = const_cast<char*>(s1);
- ::std::stringstream ss2;
- UniversalTersePrint(s2, &ss2);
- EXPECT_EQ("\"abc\"", ss2.str());
-
- const char* s3 = nullptr;
- ::std::stringstream ss3;
- UniversalTersePrint(s3, &ss3);
- EXPECT_EQ("NULL", ss3.str());
-}
-
-TEST(UniversalPrintTest, WorksForNonReference) {
- ::std::stringstream ss;
- UniversalPrint(123, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalPrintTest, WorksForReference) {
- const int& n = 123;
- ::std::stringstream ss;
- UniversalPrint(n, &ss);
- EXPECT_EQ("123", ss.str());
-}
-
-TEST(UniversalPrintTest, WorksForPairWithConst) {
- std::pair<const Wrapper<std::string>, int> p(Wrapper<std::string>("abc"), 1);
- ::std::stringstream ss;
- UniversalPrint(p, &ss);
- EXPECT_EQ("(Wrapper(\"abc\"), 1)", ss.str());
-}
-
-TEST(UniversalPrintTest, WorksForCString) {
- const char* s1 = "abc";
- ::std::stringstream ss1;
- UniversalPrint(s1, &ss1);
- EXPECT_EQ(PrintPointer(s1) + " pointing to \"abc\"", std::string(ss1.str()));
-
- char* s2 = const_cast<char*>(s1);
- ::std::stringstream ss2;
- UniversalPrint(s2, &ss2);
- EXPECT_EQ(PrintPointer(s2) + " pointing to \"abc\"", std::string(ss2.str()));
-
- const char* s3 = nullptr;
- ::std::stringstream ss3;
- UniversalPrint(s3, &ss3);
- EXPECT_EQ("NULL", ss3.str());
-}
-
-TEST(UniversalPrintTest, WorksForCharArray) {
- const char str[] = "\"Line\0 1\"\nLine 2";
- ::std::stringstream ss1;
- UniversalPrint(str, &ss1);
- EXPECT_EQ("\"\\\"Line\\0 1\\\"\\nLine 2\"", ss1.str());
-
- const char mutable_str[] = "\"Line\0 1\"\nLine 2";
- ::std::stringstream ss2;
- UniversalPrint(mutable_str, &ss2);
- EXPECT_EQ("\"\\\"Line\\0 1\\\"\\nLine 2\"", ss2.str());
-}
-
-TEST(UniversalPrintTest, IncompleteType) {
- struct Incomplete;
- char some_object = 0;
- EXPECT_EQ("(incomplete type)",
- PrintToString(reinterpret_cast<Incomplete&>(some_object)));
-}
-
-TEST(UniversalPrintTest, SmartPointers) {
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<int>()));
- std::unique_ptr<int> p(new int(17));
- EXPECT_EQ("(ptr = " + PrintPointer(p.get()) + ", value = 17)",
- PrintToString(p));
- std::unique_ptr<int[]> p2(new int[2]);
- EXPECT_EQ("(" + PrintPointer(p2.get()) + ")", PrintToString(p2));
-
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<int>()));
- std::shared_ptr<int> p3(new int(1979));
- EXPECT_EQ("(ptr = " + PrintPointer(p3.get()) + ", value = 1979)",
- PrintToString(p3));
-#if __cpp_lib_shared_ptr_arrays >= 201611L
- std::shared_ptr<int[]> p4(new int[2]);
- EXPECT_EQ("(" + PrintPointer(p4.get()) + ")", PrintToString(p4));
-#endif
-
- // modifiers
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<const int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<volatile int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<volatile const int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<int[]>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<const int[]>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<volatile int[]>()));
- EXPECT_EQ("(nullptr)",
- PrintToString(std::unique_ptr<volatile const int[]>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile const int>()));
-#if __cpp_lib_shared_ptr_arrays >= 201611L
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<int[]>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<const int[]>()));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<volatile int[]>()));
- EXPECT_EQ("(nullptr)",
- PrintToString(std::shared_ptr<volatile const int[]>()));
-#endif
-
- // void
- EXPECT_EQ("(nullptr)", PrintToString(std::unique_ptr<void, void (*)(void*)>(
- nullptr, nullptr)));
- EXPECT_EQ("(" + PrintPointer(p.get()) + ")",
- PrintToString(
- std::unique_ptr<void, void (*)(void*)>(p.get(), [](void*) {})));
- EXPECT_EQ("(nullptr)", PrintToString(std::shared_ptr<void>()));
- EXPECT_EQ("(" + PrintPointer(p.get()) + ")",
- PrintToString(std::shared_ptr<void>(p.get(), [](void*) {})));
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsEmptyTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(::std::make_tuple());
- EXPECT_EQ(0u, result.size());
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsOneTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(
- ::std::make_tuple(1));
- ASSERT_EQ(1u, result.size());
- EXPECT_EQ("1", result[0]);
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTwoTuple) {
- Strings result = UniversalTersePrintTupleFieldsToStrings(
- ::std::make_tuple(1, 'a'));
- ASSERT_EQ(2u, result.size());
- EXPECT_EQ("1", result[0]);
- EXPECT_EQ("'a' (97, 0x61)", result[1]);
-}
-
-TEST(UniversalTersePrintTupleFieldsToStringsTestWithStd, PrintsTersely) {
- const int n = 1;
- Strings result = UniversalTersePrintTupleFieldsToStrings(
- ::std::tuple<const int&, const char*>(n, "a"));
- ASSERT_EQ(2u, result.size());
- EXPECT_EQ("1", result[0]);
- EXPECT_EQ("\"a\"", result[1]);
-}
-
-#if GTEST_INTERNAL_HAS_ANY
-class PrintAnyTest : public ::testing::Test {
- protected:
- template <typename T>
- static std::string ExpectedTypeName() {
-#if GTEST_HAS_RTTI
- return internal::GetTypeName<T>();
-#else
- return "<unknown_type>";
-#endif // GTEST_HAS_RTTI
- }
-};
-
-TEST_F(PrintAnyTest, Empty) {
- internal::Any any;
- EXPECT_EQ("no value", PrintToString(any));
-}
-
-TEST_F(PrintAnyTest, NonEmpty) {
- internal::Any any;
- constexpr int val1 = 10;
- const std::string val2 = "content";
-
- any = val1;
- EXPECT_EQ("value of type " + ExpectedTypeName<int>(), PrintToString(any));
-
- any = val2;
- EXPECT_EQ("value of type " + ExpectedTypeName<std::string>(),
- PrintToString(any));
-}
-#endif // GTEST_INTERNAL_HAS_ANY
-
-#if GTEST_INTERNAL_HAS_OPTIONAL
-TEST(PrintOptionalTest, Basic) {
- EXPECT_EQ("(nullopt)", PrintToString(internal::Nullopt()));
- internal::Optional<int> value;
- EXPECT_EQ("(nullopt)", PrintToString(value));
- value = {7};
- EXPECT_EQ("(7)", PrintToString(value));
- EXPECT_EQ("(1.1)", PrintToString(internal::Optional<double>{1.1}));
- EXPECT_EQ("(\"A\")", PrintToString(internal::Optional<std::string>{"A"}));
-}
-#endif // GTEST_INTERNAL_HAS_OPTIONAL
-
-#if GTEST_INTERNAL_HAS_VARIANT
-struct NonPrintable {
- unsigned char contents = 17;
-};
-
-TEST(PrintOneofTest, Basic) {
- using Type = internal::Variant<int, StreamableInGlobal, NonPrintable>;
- EXPECT_EQ("('int(index = 0)' with value 7)", PrintToString(Type(7)));
- EXPECT_EQ("('StreamableInGlobal(index = 1)' with value StreamableInGlobal)",
- PrintToString(Type(StreamableInGlobal{})));
- EXPECT_EQ(
- "('testing::gtest_printers_test::NonPrintable(index = 2)' with value "
- "1-byte object <11>)",
- PrintToString(Type(NonPrintable{})));
-}
-#endif // GTEST_INTERNAL_HAS_VARIANT
-namespace {
-class string_ref;
-
-/**
- * This is a synthetic pointer to a fixed size string.
- */
-class string_ptr {
- public:
- string_ptr(const char* data, size_t size) : data_(data), size_(size) {}
-
- string_ptr& operator++() noexcept {
- data_ += size_;
- return *this;
- }
-
- string_ref operator*() const noexcept;
-
- private:
- const char* data_;
- size_t size_;
-};
-
-/**
- * This is a synthetic reference of a fixed size string.
- */
-class string_ref {
- public:
- string_ref(const char* data, size_t size) : data_(data), size_(size) {}
-
- string_ptr operator&() const noexcept { return {data_, size_}; } // NOLINT
-
- bool operator==(const char* s) const noexcept {
- if (size_ > 0 && data_[size_ - 1] != 0) {
- return std::string(data_, size_) == std::string(s);
- } else {
- return std::string(data_) == std::string(s);
- }
- }
-
- private:
- const char* data_;
- size_t size_;
-};
-
-string_ref string_ptr::operator*() const noexcept { return {data_, size_}; }
-
-TEST(string_ref, compare) {
- const char* s = "alex\0davidjohn\0";
- string_ptr ptr(s, 5);
- EXPECT_EQ(*ptr, "alex");
- EXPECT_TRUE(*ptr == "alex");
- ++ptr;
- EXPECT_EQ(*ptr, "david");
- EXPECT_TRUE(*ptr == "david");
- ++ptr;
- EXPECT_EQ(*ptr, "john");
-}
-
-} // namespace
-
-} // namespace gtest_printers_test
-} // namespace testing
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test.py
deleted file mode 100755
index 9d1fd0295c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that SetUpTestSuite and TearDownTestSuite errors are noticed."""
-
-from googletest.test import gtest_test_utils
-
-COMMAND = gtest_test_utils.GetTestExecutablePath(
- 'googletest-setuptestsuite-test_')
-
-
-class GTestSetUpTestSuiteTest(gtest_test_utils.TestCase):
-
- def testSetupErrorAndTearDownError(self):
- p = gtest_test_utils.Subprocess(COMMAND)
- self.assertNotEqual(p.exit_code, 0, msg=p.output)
-
- self.assertIn(
- '[ FAILED ] SetupFailTest: SetUpTestSuite or TearDownTestSuite\n'
- '[ FAILED ] TearDownFailTest: SetUpTestSuite or TearDownTestSuite\n'
- '\n'
- ' 2 FAILED TEST SUITES\n',
- p.output)
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test_.cc
deleted file mode 100644
index a4bc4ef441..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-setuptestsuite-test_.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest.h"
-
-class SetupFailTest : public ::testing::Test {
- protected:
- static void SetUpTestSuite() {
- ASSERT_EQ("", "SET_UP_FAIL");
- }
-};
-
-TEST_F(SetupFailTest, NoopPassingTest) {}
-
-class TearDownFailTest : public ::testing::Test {
- protected:
- static void TearDownTestSuite() {
- ASSERT_EQ("", "TEAR_DOWN_FAIL");
- }
-};
-
-TEST_F(TearDownFailTest, NoopPassingTest) {}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test.py
deleted file mode 100755
index 9d2adc1286..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test.py
+++ /dev/null
@@ -1,323 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009 Google Inc. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that test shuffling works."""
-
-import os
-from googletest.test import gtest_test_utils
-
-# Command to run the googletest-shuffle-test_ program.
-COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-shuffle-test_')
-
-# The environment variables for test sharding.
-TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
-SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
-
-TEST_FILTER = 'A*.A:A*.B:C*'
-
-ALL_TESTS = []
-ACTIVE_TESTS = []
-FILTERED_TESTS = []
-SHARDED_TESTS = []
-
-SHUFFLED_ALL_TESTS = []
-SHUFFLED_ACTIVE_TESTS = []
-SHUFFLED_FILTERED_TESTS = []
-SHUFFLED_SHARDED_TESTS = []
-
-
-def AlsoRunDisabledTestsFlag():
- return '--gtest_also_run_disabled_tests'
-
-
-def FilterFlag(test_filter):
- return '--gtest_filter=%s' % (test_filter,)
-
-
-def RepeatFlag(n):
- return '--gtest_repeat=%s' % (n,)
-
-
-def ShuffleFlag():
- return '--gtest_shuffle'
-
-
-def RandomSeedFlag(n):
- return '--gtest_random_seed=%s' % (n,)
-
-
-def RunAndReturnOutput(extra_env, args):
- """Runs the test program and returns its output."""
-
- environ_copy = os.environ.copy()
- environ_copy.update(extra_env)
-
- return gtest_test_utils.Subprocess([COMMAND] + args, env=environ_copy).output
-
-
-def GetTestsForAllIterations(extra_env, args):
- """Runs the test program and returns a list of test lists.
-
- Args:
- extra_env: a map from environment variables to their values
- args: command line flags to pass to googletest-shuffle-test_
-
- Returns:
- A list where the i-th element is the list of tests run in the i-th
- test iteration.
- """
-
- test_iterations = []
- for line in RunAndReturnOutput(extra_env, args).split('\n'):
- if line.startswith('----'):
- tests = []
- test_iterations.append(tests)
- elif line.strip():
- tests.append(line.strip()) # 'TestCaseName.TestName'
-
- return test_iterations
-
-
-def GetTestCases(tests):
- """Returns a list of test cases in the given full test names.
-
- Args:
- tests: a list of full test names
-
- Returns:
- A list of test cases from 'tests', in their original order.
- Consecutive duplicates are removed.
- """
-
- test_cases = []
- for test in tests:
- test_case = test.split('.')[0]
- if not test_case in test_cases:
- test_cases.append(test_case)
-
- return test_cases
-
-
-def CalculateTestLists():
- """Calculates the list of tests run under different flags."""
-
- if not ALL_TESTS:
- ALL_TESTS.extend(
- GetTestsForAllIterations({}, [AlsoRunDisabledTestsFlag()])[0])
-
- if not ACTIVE_TESTS:
- ACTIVE_TESTS.extend(GetTestsForAllIterations({}, [])[0])
-
- if not FILTERED_TESTS:
- FILTERED_TESTS.extend(
- GetTestsForAllIterations({}, [FilterFlag(TEST_FILTER)])[0])
-
- if not SHARDED_TESTS:
- SHARDED_TESTS.extend(
- GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [])[0])
-
- if not SHUFFLED_ALL_TESTS:
- SHUFFLED_ALL_TESTS.extend(GetTestsForAllIterations(
- {}, [AlsoRunDisabledTestsFlag(), ShuffleFlag(), RandomSeedFlag(1)])[0])
-
- if not SHUFFLED_ACTIVE_TESTS:
- SHUFFLED_ACTIVE_TESTS.extend(GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1)])[0])
-
- if not SHUFFLED_FILTERED_TESTS:
- SHUFFLED_FILTERED_TESTS.extend(GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), FilterFlag(TEST_FILTER)])[0])
-
- if not SHUFFLED_SHARDED_TESTS:
- SHUFFLED_SHARDED_TESTS.extend(
- GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [ShuffleFlag(), RandomSeedFlag(1)])[0])
-
-
-class GTestShuffleUnitTest(gtest_test_utils.TestCase):
- """Tests test shuffling."""
-
- def setUp(self):
- CalculateTestLists()
-
- def testShufflePreservesNumberOfTests(self):
- self.assertEqual(len(ALL_TESTS), len(SHUFFLED_ALL_TESTS))
- self.assertEqual(len(ACTIVE_TESTS), len(SHUFFLED_ACTIVE_TESTS))
- self.assertEqual(len(FILTERED_TESTS), len(SHUFFLED_FILTERED_TESTS))
- self.assertEqual(len(SHARDED_TESTS), len(SHUFFLED_SHARDED_TESTS))
-
- def testShuffleChangesTestOrder(self):
- self.assert_(SHUFFLED_ALL_TESTS != ALL_TESTS, SHUFFLED_ALL_TESTS)
- self.assert_(SHUFFLED_ACTIVE_TESTS != ACTIVE_TESTS, SHUFFLED_ACTIVE_TESTS)
- self.assert_(SHUFFLED_FILTERED_TESTS != FILTERED_TESTS,
- SHUFFLED_FILTERED_TESTS)
- self.assert_(SHUFFLED_SHARDED_TESTS != SHARDED_TESTS,
- SHUFFLED_SHARDED_TESTS)
-
- def testShuffleChangesTestCaseOrder(self):
- self.assert_(GetTestCases(SHUFFLED_ALL_TESTS) != GetTestCases(ALL_TESTS),
- GetTestCases(SHUFFLED_ALL_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_ACTIVE_TESTS) != GetTestCases(ACTIVE_TESTS),
- GetTestCases(SHUFFLED_ACTIVE_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_FILTERED_TESTS) != GetTestCases(FILTERED_TESTS),
- GetTestCases(SHUFFLED_FILTERED_TESTS))
- self.assert_(
- GetTestCases(SHUFFLED_SHARDED_TESTS) != GetTestCases(SHARDED_TESTS),
- GetTestCases(SHUFFLED_SHARDED_TESTS))
-
- def testShuffleDoesNotRepeatTest(self):
- for test in SHUFFLED_ALL_TESTS:
- self.assertEqual(1, SHUFFLED_ALL_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_ACTIVE_TESTS:
- self.assertEqual(1, SHUFFLED_ACTIVE_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_FILTERED_TESTS:
- self.assertEqual(1, SHUFFLED_FILTERED_TESTS.count(test),
- '%s appears more than once' % (test,))
- for test in SHUFFLED_SHARDED_TESTS:
- self.assertEqual(1, SHUFFLED_SHARDED_TESTS.count(test),
- '%s appears more than once' % (test,))
-
- def testShuffleDoesNotCreateNewTest(self):
- for test in SHUFFLED_ALL_TESTS:
- self.assert_(test in ALL_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_ACTIVE_TESTS:
- self.assert_(test in ACTIVE_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_FILTERED_TESTS:
- self.assert_(test in FILTERED_TESTS, '%s is an invalid test' % (test,))
- for test in SHUFFLED_SHARDED_TESTS:
- self.assert_(test in SHARDED_TESTS, '%s is an invalid test' % (test,))
-
- def testShuffleIncludesAllTests(self):
- for test in ALL_TESTS:
- self.assert_(test in SHUFFLED_ALL_TESTS, '%s is missing' % (test,))
- for test in ACTIVE_TESTS:
- self.assert_(test in SHUFFLED_ACTIVE_TESTS, '%s is missing' % (test,))
- for test in FILTERED_TESTS:
- self.assert_(test in SHUFFLED_FILTERED_TESTS, '%s is missing' % (test,))
- for test in SHARDED_TESTS:
- self.assert_(test in SHUFFLED_SHARDED_TESTS, '%s is missing' % (test,))
-
- def testShuffleLeavesDeathTestsAtFront(self):
- non_death_test_found = False
- for test in SHUFFLED_ACTIVE_TESTS:
- if 'DeathTest.' in test:
- self.assert_(not non_death_test_found,
- '%s appears after a non-death test' % (test,))
- else:
- non_death_test_found = True
-
- def _VerifyTestCasesDoNotInterleave(self, tests):
- test_cases = []
- for test in tests:
- [test_case, _] = test.split('.')
- if test_cases and test_cases[-1] != test_case:
- test_cases.append(test_case)
- self.assertEqual(1, test_cases.count(test_case),
- 'Test case %s is not grouped together in %s' %
- (test_case, tests))
-
- def testShuffleDoesNotInterleaveTestCases(self):
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_ALL_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_ACTIVE_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_FILTERED_TESTS)
- self._VerifyTestCasesDoNotInterleave(SHUFFLED_SHARDED_TESTS)
-
- def testShuffleRestoresOrderAfterEachIteration(self):
- # Get the test lists in all 3 iterations, using random seed 1, 2,
- # and 3 respectively. Google Test picks a different seed in each
- # iteration, and this test depends on the current implementation
- # picking successive numbers. This dependency is not ideal, but
- # makes the test much easier to write.
- [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
- GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
-
- # Make sure running the tests with random seed 1 gets the same
- # order as in iteration 1 above.
- [tests_with_seed1] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1)])
- self.assertEqual(tests_in_iteration1, tests_with_seed1)
-
- # Make sure running the tests with random seed 2 gets the same
- # order as in iteration 2 above. Success means that Google Test
- # correctly restores the test order before re-shuffling at the
- # beginning of iteration 2.
- [tests_with_seed2] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(2)])
- self.assertEqual(tests_in_iteration2, tests_with_seed2)
-
- # Make sure running the tests with random seed 3 gets the same
- # order as in iteration 3 above. Success means that Google Test
- # correctly restores the test order before re-shuffling at the
- # beginning of iteration 3.
- [tests_with_seed3] = GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(3)])
- self.assertEqual(tests_in_iteration3, tests_with_seed3)
-
- def testShuffleGeneratesNewOrderInEachIteration(self):
- [tests_in_iteration1, tests_in_iteration2, tests_in_iteration3] = (
- GetTestsForAllIterations(
- {}, [ShuffleFlag(), RandomSeedFlag(1), RepeatFlag(3)]))
-
- self.assert_(tests_in_iteration1 != tests_in_iteration2,
- tests_in_iteration1)
- self.assert_(tests_in_iteration1 != tests_in_iteration3,
- tests_in_iteration1)
- self.assert_(tests_in_iteration2 != tests_in_iteration3,
- tests_in_iteration2)
-
- def testShuffleShardedTestsPreservesPartition(self):
- # If we run M tests on N shards, the same M tests should be run in
- # total, regardless of the random seeds used by the shards.
- [tests1] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '0'},
- [ShuffleFlag(), RandomSeedFlag(1)])
- [tests2] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '1'},
- [ShuffleFlag(), RandomSeedFlag(20)])
- [tests3] = GetTestsForAllIterations({TOTAL_SHARDS_ENV_VAR: '3',
- SHARD_INDEX_ENV_VAR: '2'},
- [ShuffleFlag(), RandomSeedFlag(25)])
- sorted_sharded_tests = tests1 + tests2 + tests3
- sorted_sharded_tests.sort()
- sorted_active_tests = []
- sorted_active_tests.extend(ACTIVE_TESTS)
- sorted_active_tests.sort()
- self.assertEqual(sorted_active_tests, sorted_sharded_tests)
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test_.cc
deleted file mode 100644
index 4505663ae4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-shuffle-test_.cc
+++ /dev/null
@@ -1,101 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Verifies that test shuffling works.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-using ::testing::EmptyTestEventListener;
-using ::testing::InitGoogleTest;
-using ::testing::Message;
-using ::testing::Test;
-using ::testing::TestEventListeners;
-using ::testing::TestInfo;
-using ::testing::UnitTest;
-
-// The test methods are empty, as the sole purpose of this program is
-// to print the test names before/after shuffling.
-
-class A : public Test {};
-TEST_F(A, A) {}
-TEST_F(A, B) {}
-
-TEST(ADeathTest, A) {}
-TEST(ADeathTest, B) {}
-TEST(ADeathTest, C) {}
-
-TEST(B, A) {}
-TEST(B, B) {}
-TEST(B, C) {}
-TEST(B, DISABLED_D) {}
-TEST(B, DISABLED_E) {}
-
-TEST(BDeathTest, A) {}
-TEST(BDeathTest, B) {}
-
-TEST(C, A) {}
-TEST(C, B) {}
-TEST(C, C) {}
-TEST(C, DISABLED_D) {}
-
-TEST(CDeathTest, A) {}
-
-TEST(DISABLED_D, A) {}
-TEST(DISABLED_D, DISABLED_B) {}
-
-// This printer prints the full test names only, starting each test
-// iteration with a "----" marker.
-class TestNamePrinter : public EmptyTestEventListener {
- public:
- void OnTestIterationStart(const UnitTest& /* unit_test */,
- int /* iteration */) override {
- printf("----\n");
- }
-
- void OnTestStart(const TestInfo& test_info) override {
- printf("%s.%s\n", test_info.test_suite_name(), test_info.name());
- }
-};
-
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- // Replaces the default printer with TestNamePrinter, which prints
- // the test name only.
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
- delete listeners.Release(listeners.default_result_printer());
- listeners.Append(new TestNamePrinter);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-test-part-test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-test-part-test.cc
deleted file mode 100644
index 44cf7ca044..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-test-part-test.cc
+++ /dev/null
@@ -1,230 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#include "gtest/gtest-test-part.h"
-
-#include "gtest/gtest.h"
-
-using testing::Message;
-using testing::Test;
-using testing::TestPartResult;
-using testing::TestPartResultArray;
-
-namespace {
-
-// Tests the TestPartResult class.
-
-// The test fixture for testing TestPartResult.
-class TestPartResultTest : public Test {
- protected:
- TestPartResultTest()
- : r1_(TestPartResult::kSuccess, "foo/bar.cc", 10, "Success!"),
- r2_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure!"),
- r3_(TestPartResult::kFatalFailure, nullptr, -1, "Failure!"),
- r4_(TestPartResult::kSkip, "foo/bar.cc", 2, "Skipped!") {}
-
- TestPartResult r1_, r2_, r3_, r4_;
-};
-
-
-TEST_F(TestPartResultTest, ConstructorWorks) {
- Message message;
- message << "something is terribly wrong";
- message << static_cast<const char*>(testing::internal::kStackTraceMarker);
- message << "some unimportant stack trace";
-
- const TestPartResult result(TestPartResult::kNonFatalFailure,
- "some_file.cc",
- 42,
- message.GetString().c_str());
-
- EXPECT_EQ(TestPartResult::kNonFatalFailure, result.type());
- EXPECT_STREQ("some_file.cc", result.file_name());
- EXPECT_EQ(42, result.line_number());
- EXPECT_STREQ(message.GetString().c_str(), result.message());
- EXPECT_STREQ("something is terribly wrong", result.summary());
-}
-
-TEST_F(TestPartResultTest, ResultAccessorsWork) {
- const TestPartResult success(TestPartResult::kSuccess,
- "file.cc",
- 42,
- "message");
- EXPECT_TRUE(success.passed());
- EXPECT_FALSE(success.failed());
- EXPECT_FALSE(success.nonfatally_failed());
- EXPECT_FALSE(success.fatally_failed());
- EXPECT_FALSE(success.skipped());
-
- const TestPartResult nonfatal_failure(TestPartResult::kNonFatalFailure,
- "file.cc",
- 42,
- "message");
- EXPECT_FALSE(nonfatal_failure.passed());
- EXPECT_TRUE(nonfatal_failure.failed());
- EXPECT_TRUE(nonfatal_failure.nonfatally_failed());
- EXPECT_FALSE(nonfatal_failure.fatally_failed());
- EXPECT_FALSE(nonfatal_failure.skipped());
-
- const TestPartResult fatal_failure(TestPartResult::kFatalFailure,
- "file.cc",
- 42,
- "message");
- EXPECT_FALSE(fatal_failure.passed());
- EXPECT_TRUE(fatal_failure.failed());
- EXPECT_FALSE(fatal_failure.nonfatally_failed());
- EXPECT_TRUE(fatal_failure.fatally_failed());
- EXPECT_FALSE(fatal_failure.skipped());
-
- const TestPartResult skip(TestPartResult::kSkip, "file.cc", 42, "message");
- EXPECT_FALSE(skip.passed());
- EXPECT_FALSE(skip.failed());
- EXPECT_FALSE(skip.nonfatally_failed());
- EXPECT_FALSE(skip.fatally_failed());
- EXPECT_TRUE(skip.skipped());
-}
-
-// Tests TestPartResult::type().
-TEST_F(TestPartResultTest, type) {
- EXPECT_EQ(TestPartResult::kSuccess, r1_.type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure, r2_.type());
- EXPECT_EQ(TestPartResult::kFatalFailure, r3_.type());
- EXPECT_EQ(TestPartResult::kSkip, r4_.type());
-}
-
-// Tests TestPartResult::file_name().
-TEST_F(TestPartResultTest, file_name) {
- EXPECT_STREQ("foo/bar.cc", r1_.file_name());
- EXPECT_STREQ(nullptr, r3_.file_name());
- EXPECT_STREQ("foo/bar.cc", r4_.file_name());
-}
-
-// Tests TestPartResult::line_number().
-TEST_F(TestPartResultTest, line_number) {
- EXPECT_EQ(10, r1_.line_number());
- EXPECT_EQ(-1, r2_.line_number());
- EXPECT_EQ(2, r4_.line_number());
-}
-
-// Tests TestPartResult::message().
-TEST_F(TestPartResultTest, message) {
- EXPECT_STREQ("Success!", r1_.message());
- EXPECT_STREQ("Skipped!", r4_.message());
-}
-
-// Tests TestPartResult::passed().
-TEST_F(TestPartResultTest, Passed) {
- EXPECT_TRUE(r1_.passed());
- EXPECT_FALSE(r2_.passed());
- EXPECT_FALSE(r3_.passed());
- EXPECT_FALSE(r4_.passed());
-}
-
-// Tests TestPartResult::failed().
-TEST_F(TestPartResultTest, Failed) {
- EXPECT_FALSE(r1_.failed());
- EXPECT_TRUE(r2_.failed());
- EXPECT_TRUE(r3_.failed());
- EXPECT_FALSE(r4_.failed());
-}
-
-// Tests TestPartResult::failed().
-TEST_F(TestPartResultTest, Skipped) {
- EXPECT_FALSE(r1_.skipped());
- EXPECT_FALSE(r2_.skipped());
- EXPECT_FALSE(r3_.skipped());
- EXPECT_TRUE(r4_.skipped());
-}
-
-// Tests TestPartResult::fatally_failed().
-TEST_F(TestPartResultTest, FatallyFailed) {
- EXPECT_FALSE(r1_.fatally_failed());
- EXPECT_FALSE(r2_.fatally_failed());
- EXPECT_TRUE(r3_.fatally_failed());
- EXPECT_FALSE(r4_.fatally_failed());
-}
-
-// Tests TestPartResult::nonfatally_failed().
-TEST_F(TestPartResultTest, NonfatallyFailed) {
- EXPECT_FALSE(r1_.nonfatally_failed());
- EXPECT_TRUE(r2_.nonfatally_failed());
- EXPECT_FALSE(r3_.nonfatally_failed());
- EXPECT_FALSE(r4_.nonfatally_failed());
-}
-
-// Tests the TestPartResultArray class.
-
-class TestPartResultArrayTest : public Test {
- protected:
- TestPartResultArrayTest()
- : r1_(TestPartResult::kNonFatalFailure, "foo/bar.cc", -1, "Failure 1"),
- r2_(TestPartResult::kFatalFailure, "foo/bar.cc", -1, "Failure 2") {}
-
- const TestPartResult r1_, r2_;
-};
-
-// Tests that TestPartResultArray initially has size 0.
-TEST_F(TestPartResultArrayTest, InitialSizeIsZero) {
- TestPartResultArray results;
- EXPECT_EQ(0, results.size());
-}
-
-// Tests that TestPartResultArray contains the given TestPartResult
-// after one Append() operation.
-TEST_F(TestPartResultArrayTest, ContainsGivenResultAfterAppend) {
- TestPartResultArray results;
- results.Append(r1_);
- EXPECT_EQ(1, results.size());
- EXPECT_STREQ("Failure 1", results.GetTestPartResult(0).message());
-}
-
-// Tests that TestPartResultArray contains the given TestPartResults
-// after two Append() operations.
-TEST_F(TestPartResultArrayTest, ContainsGivenResultsAfterTwoAppends) {
- TestPartResultArray results;
- results.Append(r1_);
- results.Append(r2_);
- EXPECT_EQ(2, results.size());
- EXPECT_STREQ("Failure 1", results.GetTestPartResult(0).message());
- EXPECT_STREQ("Failure 2", results.GetTestPartResult(1).message());
-}
-
-typedef TestPartResultArrayTest TestPartResultArrayDeathTest;
-
-// Tests that the program dies when GetTestPartResult() is called with
-// an invalid index.
-TEST_F(TestPartResultArrayDeathTest, DiesWhenIndexIsOutOfBound) {
- TestPartResultArray results;
- results.Append(r1_);
-
- EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(-1), "");
- EXPECT_DEATH_IF_SUPPORTED(results.GetTestPartResult(1), "");
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test.py
deleted file mode 100755
index 772bbc5f39..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test.py
+++ /dev/null
@@ -1,168 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests Google Test's throw-on-failure mode with exceptions disabled.
-
-This script invokes googletest-throw-on-failure-test_ (a program written with
-Google Test) with different environments and command line flags.
-"""
-
-import os
-from googletest.test import gtest_test_utils
-
-
-# Constants.
-
-# The command line flag for enabling/disabling the throw-on-failure mode.
-THROW_ON_FAILURE = 'gtest_throw_on_failure'
-
-# Path to the googletest-throw-on-failure-test_ program, compiled with
-# exceptions disabled.
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'googletest-throw-on-failure-test_')
-
-
-# Utilities.
-
-
-def SetEnvVar(env_var, value):
- """Sets an environment variable to a given value; unsets it when the
- given value is None.
- """
-
- env_var = env_var.upper()
- if value is not None:
- os.environ[env_var] = value
- elif env_var in os.environ:
- del os.environ[env_var]
-
-
-def Run(command):
- """Runs a command; returns True/False if its exit code is/isn't 0."""
-
- print('Running "%s". . .' % ' '.join(command))
- p = gtest_test_utils.Subprocess(command)
- return p.exited and p.exit_code == 0
-
-
-# The tests.
-class ThrowOnFailureTest(gtest_test_utils.TestCase):
- """Tests the throw-on-failure mode."""
-
- def RunAndVerify(self, env_var_value, flag_value, should_fail):
- """Runs googletest-throw-on-failure-test_ and verifies that it does
- (or does not) exit with a non-zero code.
-
- Args:
- env_var_value: value of the GTEST_BREAK_ON_FAILURE environment
- variable; None if the variable should be unset.
- flag_value: value of the --gtest_break_on_failure flag;
- None if the flag should not be present.
- should_fail: True if and only if the program is expected to fail.
- """
-
- SetEnvVar(THROW_ON_FAILURE, env_var_value)
-
- if env_var_value is None:
- env_var_value_msg = ' is not set'
- else:
- env_var_value_msg = '=' + env_var_value
-
- if flag_value is None:
- flag = ''
- elif flag_value == '0':
- flag = '--%s=0' % THROW_ON_FAILURE
- else:
- flag = '--%s' % THROW_ON_FAILURE
-
- command = [EXE_PATH]
- if flag:
- command.append(flag)
-
- if should_fail:
- should_or_not = 'should'
- else:
- should_or_not = 'should not'
-
- failed = not Run(command)
-
- SetEnvVar(THROW_ON_FAILURE, None)
-
- msg = ('when %s%s, an assertion failure in "%s" %s cause a non-zero '
- 'exit code.' %
- (THROW_ON_FAILURE, env_var_value_msg, ' '.join(command),
- should_or_not))
- self.assert_(failed == should_fail, msg)
-
- def testDefaultBehavior(self):
- """Tests the behavior of the default mode."""
-
- self.RunAndVerify(env_var_value=None, flag_value=None, should_fail=False)
-
- def testThrowOnFailureEnvVar(self):
- """Tests using the GTEST_THROW_ON_FAILURE environment variable."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value=None,
- should_fail=False)
- self.RunAndVerify(env_var_value='1',
- flag_value=None,
- should_fail=True)
-
- def testThrowOnFailureFlag(self):
- """Tests using the --gtest_throw_on_failure flag."""
-
- self.RunAndVerify(env_var_value=None,
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value=None,
- flag_value='1',
- should_fail=True)
-
- def testThrowOnFailureFlagOverridesEnvVar(self):
- """Tests that --gtest_throw_on_failure overrides GTEST_THROW_ON_FAILURE."""
-
- self.RunAndVerify(env_var_value='0',
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value='0',
- flag_value='1',
- should_fail=True)
- self.RunAndVerify(env_var_value='1',
- flag_value='0',
- should_fail=False)
- self.RunAndVerify(env_var_value='1',
- flag_value='1',
- should_fail=True)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test_.cc
deleted file mode 100644
index 83bb914c7e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-throw-on-failure-test_.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests Google Test's throw-on-failure mode with exceptions disabled.
-//
-// This program must be compiled with exceptions disabled. It will be
-// invoked by googletest-throw-on-failure-test.py, and is expected to exit
-// with non-zero in the throw-on-failure mode or 0 otherwise.
-
-#include "gtest/gtest.h"
-
-#include <stdio.h> // for fflush, fprintf, NULL, etc.
-#include <stdlib.h> // for exit
-#include <exception> // for set_terminate
-
-// This terminate handler aborts the program using exit() rather than abort().
-// This avoids showing pop-ups on Windows systems and core dumps on Unix-like
-// ones.
-void TerminateHandler() {
- fprintf(stderr, "%s\n", "Unhandled C++ exception terminating the program.");
- fflush(nullptr);
- exit(1);
-}
-
-int main(int argc, char** argv) {
-#if GTEST_HAS_EXCEPTIONS
- std::set_terminate(&TerminateHandler);
-#endif
- testing::InitGoogleTest(&argc, argv);
-
- // We want to ensure that people can use Google Test assertions in
- // other testing frameworks, as long as they initialize Google Test
- // properly and set the throw-on-failure mode. Therefore, we don't
- // use Google Test's constructs for defining and running tests
- // (e.g. TEST and RUN_ALL_TESTS) here.
-
- // In the throw-on-failure mode with exceptions disabled, this
- // assertion will cause the program to exit with a non-zero code.
- EXPECT_EQ(2, 3);
-
- // When not in the throw-on-failure mode, the control will reach
- // here.
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test.py
deleted file mode 100755
index 73c91764a5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test.py
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Verifies that Google Test warns the user when not initialized properly."""
-
-from googletest.test import gtest_test_utils
-
-COMMAND = gtest_test_utils.GetTestExecutablePath('googletest-uninitialized-test_')
-
-
-def Assert(condition):
- if not condition:
- raise AssertionError
-
-
-def AssertEq(expected, actual):
- if expected != actual:
- print('Expected: %s' % (expected,))
- print(' Actual: %s' % (actual,))
- raise AssertionError
-
-
-def TestExitCodeAndOutput(command):
- """Runs the given command and verifies its exit code and output."""
-
- # Verifies that 'command' exits with code 1.
- p = gtest_test_utils.Subprocess(command)
- if p.exited and p.exit_code == 0:
- Assert('IMPORTANT NOTICE' in p.output);
- Assert('InitGoogleTest' in p.output)
-
-
-class GTestUninitializedTest(gtest_test_utils.TestCase):
- def testExitCodeAndOutput(self):
- TestExitCodeAndOutput(COMMAND)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test_.cc
deleted file mode 100644
index b4434d51ee..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/googletest-uninitialized-test_.cc
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest.h"
-
-TEST(DummyTest, Dummy) {
- // This test doesn't verify anything. We just need it to create a
- // realistic stage for testing the behavior of Google Test when
- // RUN_ALL_TESTS() is called without
- // testing::InitGoogleTest() being called first.
-}
-
-int main() {
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test2_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test2_test.cc
deleted file mode 100644
index e83ca2e11b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test2_test.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include <vector>
-
-#include "test/gtest-typed-test_test.h"
-#include "gtest/gtest.h"
-
-// Tests that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
-INSTANTIATE_TYPED_TEST_SUITE_P(Vector, ContainerTest,
- testing::Types<std::vector<int> >);
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.cc
deleted file mode 100644
index 5fc678cb0d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.cc
+++ /dev/null
@@ -1,437 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "test/gtest-typed-test_test.h"
-
-#include <set>
-#include <type_traits>
-#include <vector>
-
-#include "gtest/gtest.h"
-
-#if _MSC_VER
-GTEST_DISABLE_MSC_WARNINGS_PUSH_(4127 /* conditional expression is constant */)
-#endif // _MSC_VER
-
-using testing::Test;
-
-// Used for testing that SetUpTestSuite()/TearDownTestSuite(), fixture
-// ctor/dtor, and SetUp()/TearDown() work correctly in typed tests and
-// type-parameterized test.
-template <typename T>
-class CommonTest : public Test {
- // For some technical reason, SetUpTestSuite() and TearDownTestSuite()
- // must be public.
- public:
- static void SetUpTestSuite() {
- shared_ = new T(5);
- }
-
- static void TearDownTestSuite() {
- delete shared_;
- shared_ = nullptr;
- }
-
- // This 'protected:' is optional. There's no harm in making all
- // members of this fixture class template public.
- protected:
- // We used to use std::list here, but switched to std::vector since
- // MSVC's <list> doesn't compile cleanly with /W4.
- typedef std::vector<T> Vector;
- typedef std::set<int> IntSet;
-
- CommonTest() : value_(1) {}
-
- ~CommonTest() override { EXPECT_EQ(3, value_); }
-
- void SetUp() override {
- EXPECT_EQ(1, value_);
- value_++;
- }
-
- void TearDown() override {
- EXPECT_EQ(2, value_);
- value_++;
- }
-
- T value_;
- static T* shared_;
-};
-
-template <typename T>
-T* CommonTest<T>::shared_ = nullptr;
-
-using testing::Types;
-
-// Tests that SetUpTestSuite()/TearDownTestSuite(), fixture ctor/dtor,
-// and SetUp()/TearDown() work correctly in typed tests
-
-typedef Types<char, int> TwoTypes;
-TYPED_TEST_SUITE(CommonTest, TwoTypes);
-
-TYPED_TEST(CommonTest, ValuesAreCorrect) {
- // Static members of the fixture class template can be visited via
- // the TestFixture:: prefix.
- EXPECT_EQ(5, *TestFixture::shared_);
-
- // Typedefs in the fixture class template can be visited via the
- // "typename TestFixture::" prefix.
- typename TestFixture::Vector empty;
- EXPECT_EQ(0U, empty.size());
-
- typename TestFixture::IntSet empty2;
- EXPECT_EQ(0U, empty2.size());
-
- // Non-static members of the fixture class must be visited via
- // 'this', as required by C++ for class templates.
- EXPECT_EQ(2, this->value_);
-}
-
-// The second test makes sure shared_ is not deleted after the first
-// test.
-TYPED_TEST(CommonTest, ValuesAreStillCorrect) {
- // Static members of the fixture class template can also be visited
- // via 'this'.
- ASSERT_TRUE(this->shared_ != nullptr);
- EXPECT_EQ(5, *this->shared_);
-
- // TypeParam can be used to refer to the type parameter.
- EXPECT_EQ(static_cast<TypeParam>(2), this->value_);
-}
-
-// Tests that multiple TYPED_TEST_SUITE's can be defined in the same
-// translation unit.
-
-template <typename T>
-class TypedTest1 : public Test {
-};
-
-// Verifies that the second argument of TYPED_TEST_SUITE can be a
-// single type.
-TYPED_TEST_SUITE(TypedTest1, int);
-TYPED_TEST(TypedTest1, A) {}
-
-template <typename T>
-class TypedTest2 : public Test {
-};
-
-// Verifies that the second argument of TYPED_TEST_SUITE can be a
-// Types<...> type list.
-TYPED_TEST_SUITE(TypedTest2, Types<int>);
-
-// This also verifies that tests from different typed test cases can
-// share the same name.
-TYPED_TEST(TypedTest2, A) {}
-
-// Tests that a typed test case can be defined in a namespace.
-
-namespace library1 {
-
-template <typename T>
-class NumericTest : public Test {
-};
-
-typedef Types<int, long> NumericTypes;
-TYPED_TEST_SUITE(NumericTest, NumericTypes);
-
-TYPED_TEST(NumericTest, DefaultIsZero) {
- EXPECT_EQ(0, TypeParam());
-}
-
-} // namespace library1
-
-// Tests that custom names work.
-template <typename T>
-class TypedTestWithNames : public Test {};
-
-class TypedTestNames {
- public:
- template <typename T>
- static std::string GetName(int i) {
- if (std::is_same<T, char>::value) {
- return std::string("char") + ::testing::PrintToString(i);
- }
- if (std::is_same<T, int>::value) {
- return std::string("int") + ::testing::PrintToString(i);
- }
- }
-};
-
-TYPED_TEST_SUITE(TypedTestWithNames, TwoTypes, TypedTestNames);
-
-TYPED_TEST(TypedTestWithNames, TestSuiteName) {
- if (std::is_same<TypeParam, char>::value) {
- EXPECT_STREQ(::testing::UnitTest::GetInstance()
- ->current_test_info()
- ->test_suite_name(),
- "TypedTestWithNames/char0");
- }
- if (std::is_same<TypeParam, int>::value) {
- EXPECT_STREQ(::testing::UnitTest::GetInstance()
- ->current_test_info()
- ->test_suite_name(),
- "TypedTestWithNames/int1");
- }
-}
-
-using testing::Types;
-using testing::internal::TypedTestSuitePState;
-
-// Tests TypedTestSuitePState.
-
-class TypedTestSuitePStateTest : public Test {
- protected:
- void SetUp() override {
- state_.AddTestName("foo.cc", 0, "FooTest", "A");
- state_.AddTestName("foo.cc", 0, "FooTest", "B");
- state_.AddTestName("foo.cc", 0, "FooTest", "C");
- }
-
- TypedTestSuitePState state_;
-};
-
-TEST_F(TypedTestSuitePStateTest, SucceedsForMatchingList) {
- const char* tests = "A, B, C";
- EXPECT_EQ(tests,
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, tests));
-}
-
-// Makes sure that the order of the tests and spaces around the names
-// don't matter.
-TEST_F(TypedTestSuitePStateTest, IgnoresOrderAndSpaces) {
- const char* tests = "A,C, B";
- EXPECT_EQ(tests,
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, tests));
-}
-
-using TypedTestSuitePStateDeathTest = TypedTestSuitePStateTest;
-
-TEST_F(TypedTestSuitePStateDeathTest, DetectsDuplicates) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, "A, B, A, C"),
- "foo\\.cc.1.?: Test A is listed more than once\\.");
-}
-
-TEST_F(TypedTestSuitePStateDeathTest, DetectsExtraTest) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, "A, B, C, D"),
- "foo\\.cc.1.?: No test named D can be found in this test suite\\.");
-}
-
-TEST_F(TypedTestSuitePStateDeathTest, DetectsMissedTest) {
- EXPECT_DEATH_IF_SUPPORTED(
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, "A, C"),
- "foo\\.cc.1.?: You forgot to list test B\\.");
-}
-
-// Tests that defining a test for a parameterized test case generates
-// a run-time error if the test case has been registered.
-TEST_F(TypedTestSuitePStateDeathTest, DetectsTestAfterRegistration) {
- state_.VerifyRegisteredTestNames("Suite", "foo.cc", 1, "A, B, C");
- EXPECT_DEATH_IF_SUPPORTED(
- state_.AddTestName("foo.cc", 2, "FooTest", "D"),
- "foo\\.cc.2.?: Test D must be defined before REGISTER_TYPED_TEST_SUITE_P"
- "\\(FooTest, \\.\\.\\.\\)\\.");
-}
-
-// Tests that SetUpTestSuite()/TearDownTestSuite(), fixture ctor/dtor,
-// and SetUp()/TearDown() work correctly in type-parameterized tests.
-
-template <typename T>
-class DerivedTest : public CommonTest<T> {
-};
-
-TYPED_TEST_SUITE_P(DerivedTest);
-
-TYPED_TEST_P(DerivedTest, ValuesAreCorrect) {
- // Static members of the fixture class template can be visited via
- // the TestFixture:: prefix.
- EXPECT_EQ(5, *TestFixture::shared_);
-
- // Non-static members of the fixture class must be visited via
- // 'this', as required by C++ for class templates.
- EXPECT_EQ(2, this->value_);
-}
-
-// The second test makes sure shared_ is not deleted after the first
-// test.
-TYPED_TEST_P(DerivedTest, ValuesAreStillCorrect) {
- // Static members of the fixture class template can also be visited
- // via 'this'.
- ASSERT_TRUE(this->shared_ != nullptr);
- EXPECT_EQ(5, *this->shared_);
- EXPECT_EQ(2, this->value_);
-}
-
-REGISTER_TYPED_TEST_SUITE_P(DerivedTest,
- ValuesAreCorrect, ValuesAreStillCorrect);
-
-typedef Types<short, long> MyTwoTypes;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, DerivedTest, MyTwoTypes);
-
-// Tests that custom names work with type parametrized tests. We reuse the
-// TwoTypes from above here.
-template <typename T>
-class TypeParametrizedTestWithNames : public Test {};
-
-TYPED_TEST_SUITE_P(TypeParametrizedTestWithNames);
-
-TYPED_TEST_P(TypeParametrizedTestWithNames, TestSuiteName) {
- if (std::is_same<TypeParam, char>::value) {
- EXPECT_STREQ(::testing::UnitTest::GetInstance()
- ->current_test_info()
- ->test_suite_name(),
- "CustomName/TypeParametrizedTestWithNames/parChar0");
- }
- if (std::is_same<TypeParam, int>::value) {
- EXPECT_STREQ(::testing::UnitTest::GetInstance()
- ->current_test_info()
- ->test_suite_name(),
- "CustomName/TypeParametrizedTestWithNames/parInt1");
- }
-}
-
-REGISTER_TYPED_TEST_SUITE_P(TypeParametrizedTestWithNames, TestSuiteName);
-
-class TypeParametrizedTestNames {
- public:
- template <typename T>
- static std::string GetName(int i) {
- if (std::is_same<T, char>::value) {
- return std::string("parChar") + ::testing::PrintToString(i);
- }
- if (std::is_same<T, int>::value) {
- return std::string("parInt") + ::testing::PrintToString(i);
- }
- }
-};
-
-INSTANTIATE_TYPED_TEST_SUITE_P(CustomName, TypeParametrizedTestWithNames,
- TwoTypes, TypeParametrizedTestNames);
-
-// Tests that multiple TYPED_TEST_SUITE_P's can be defined in the same
-// translation unit.
-
-template <typename T>
-class TypedTestP1 : public Test {
-};
-
-TYPED_TEST_SUITE_P(TypedTestP1);
-
-// For testing that the code between TYPED_TEST_SUITE_P() and
-// TYPED_TEST_P() is not enclosed in a namespace.
-using IntAfterTypedTestSuiteP = int;
-
-TYPED_TEST_P(TypedTestP1, A) {}
-TYPED_TEST_P(TypedTestP1, B) {}
-
-// For testing that the code between TYPED_TEST_P() and
-// REGISTER_TYPED_TEST_SUITE_P() is not enclosed in a namespace.
-using IntBeforeRegisterTypedTestSuiteP = int;
-
-REGISTER_TYPED_TEST_SUITE_P(TypedTestP1, A, B);
-
-template <typename T>
-class TypedTestP2 : public Test {
-};
-
-TYPED_TEST_SUITE_P(TypedTestP2);
-
-// This also verifies that tests from different type-parameterized
-// test cases can share the same name.
-TYPED_TEST_P(TypedTestP2, A) {}
-
-REGISTER_TYPED_TEST_SUITE_P(TypedTestP2, A);
-
-// Verifies that the code between TYPED_TEST_SUITE_P() and
-// REGISTER_TYPED_TEST_SUITE_P() is not enclosed in a namespace.
-IntAfterTypedTestSuiteP after = 0;
-IntBeforeRegisterTypedTestSuiteP before = 0;
-
-// Verifies that the last argument of INSTANTIATE_TYPED_TEST_SUITE_P()
-// can be either a single type or a Types<...> type list.
-INSTANTIATE_TYPED_TEST_SUITE_P(Int, TypedTestP1, int);
-INSTANTIATE_TYPED_TEST_SUITE_P(Int, TypedTestP2, Types<int>);
-
-// Tests that the same type-parameterized test case can be
-// instantiated more than once in the same translation unit.
-INSTANTIATE_TYPED_TEST_SUITE_P(Double, TypedTestP2, Types<double>);
-
-// Tests that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// (ContainerTest is also instantiated in gtest-typed-test_test.cc.)
-typedef Types<std::vector<double>, std::set<char> > MyContainers;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, ContainerTest, MyContainers);
-
-// Tests that a type-parameterized test case can be defined and
-// instantiated in a namespace.
-
-namespace library2 {
-
-template <typename T>
-class NumericTest : public Test {
-};
-
-TYPED_TEST_SUITE_P(NumericTest);
-
-TYPED_TEST_P(NumericTest, DefaultIsZero) {
- EXPECT_EQ(0, TypeParam());
-}
-
-TYPED_TEST_P(NumericTest, ZeroIsLessThanOne) {
- EXPECT_LT(TypeParam(0), TypeParam(1));
-}
-
-REGISTER_TYPED_TEST_SUITE_P(NumericTest,
- DefaultIsZero, ZeroIsLessThanOne);
-typedef Types<int, double> NumericTypes;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, NumericTest, NumericTypes);
-
-static const char* GetTestName() {
- return testing::UnitTest::GetInstance()->current_test_info()->name();
-}
-// Test the stripping of space from test names
-template <typename T> class TrimmedTest : public Test { };
-TYPED_TEST_SUITE_P(TrimmedTest);
-TYPED_TEST_P(TrimmedTest, Test1) { EXPECT_STREQ("Test1", GetTestName()); }
-TYPED_TEST_P(TrimmedTest, Test2) { EXPECT_STREQ("Test2", GetTestName()); }
-TYPED_TEST_P(TrimmedTest, Test3) { EXPECT_STREQ("Test3", GetTestName()); }
-TYPED_TEST_P(TrimmedTest, Test4) { EXPECT_STREQ("Test4", GetTestName()); }
-TYPED_TEST_P(TrimmedTest, Test5) { EXPECT_STREQ("Test5", GetTestName()); }
-REGISTER_TYPED_TEST_SUITE_P(
- TrimmedTest,
- Test1, Test2,Test3 , Test4 ,Test5 ); // NOLINT
-template <typename T1, typename T2> struct MyPair {};
-// Be sure to try a type with a comma in its name just in case it matters.
-typedef Types<int, double, MyPair<int, int> > TrimTypes;
-INSTANTIATE_TYPED_TEST_SUITE_P(My, TrimmedTest, TrimTypes);
-
-} // namespace library2
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.h
deleted file mode 100644
index 8ce559c99f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-typed-test_test.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-#ifndef GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_
-#define GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_
-
-#include "gtest/gtest.h"
-
-using testing::Test;
-
-// For testing that the same type-parameterized test case can be
-// instantiated in different translation units linked together.
-// ContainerTest will be instantiated in both gtest-typed-test_test.cc
-// and gtest-typed-test2_test.cc.
-
-template <typename T>
-class ContainerTest : public Test {
-};
-
-TYPED_TEST_SUITE_P(ContainerTest);
-
-TYPED_TEST_P(ContainerTest, CanBeDefaultConstructed) {
- TypeParam container;
-}
-
-TYPED_TEST_P(ContainerTest, InitialSizeIsZero) {
- TypeParam container;
- EXPECT_EQ(0U, container.size());
-}
-
-REGISTER_TYPED_TEST_SUITE_P(ContainerTest,
- CanBeDefaultConstructed, InitialSizeIsZero);
-
-#endif // GOOGLETEST_TEST_GTEST_TYPED_TEST_TEST_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-unittest-api_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-unittest-api_test.cc
deleted file mode 100644
index 8ef505838c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest-unittest-api_test.cc
+++ /dev/null
@@ -1,328 +0,0 @@
-// Copyright 2009 Google Inc. All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// The Google C++ Testing and Mocking Framework (Google Test)
-//
-// This file contains tests verifying correctness of data provided via
-// UnitTest's public methods.
-
-#include "gtest/gtest.h"
-
-#include <string.h> // For strcmp.
-#include <algorithm>
-
-using ::testing::InitGoogleTest;
-
-namespace testing {
-namespace internal {
-
-template <typename T>
-struct LessByName {
- bool operator()(const T* a, const T* b) {
- return strcmp(a->name(), b->name()) < 0;
- }
-};
-
-class UnitTestHelper {
- public:
- // Returns the array of pointers to all test suites sorted by the test suite
- // name. The caller is responsible for deleting the array.
- static TestSuite const** GetSortedTestSuites() {
- UnitTest& unit_test = *UnitTest::GetInstance();
- auto const** const test_suites = new const TestSuite*[static_cast<size_t>(
- unit_test.total_test_suite_count())];
-
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i)
- test_suites[i] = unit_test.GetTestSuite(i);
-
- std::sort(test_suites,
- test_suites + unit_test.total_test_suite_count(),
- LessByName<TestSuite>());
- return test_suites;
- }
-
- // Returns the test suite by its name. The caller doesn't own the returned
- // pointer.
- static const TestSuite* FindTestSuite(const char* name) {
- UnitTest& unit_test = *UnitTest::GetInstance();
- for (int i = 0; i < unit_test.total_test_suite_count(); ++i) {
- const TestSuite* test_suite = unit_test.GetTestSuite(i);
- if (0 == strcmp(test_suite->name(), name))
- return test_suite;
- }
- return nullptr;
- }
-
- // Returns the array of pointers to all tests in a particular test suite
- // sorted by the test name. The caller is responsible for deleting the
- // array.
- static TestInfo const** GetSortedTests(const TestSuite* test_suite) {
- TestInfo const** const tests = new const TestInfo*[static_cast<size_t>(
- test_suite->total_test_count())];
-
- for (int i = 0; i < test_suite->total_test_count(); ++i)
- tests[i] = test_suite->GetTestInfo(i);
-
- std::sort(tests, tests + test_suite->total_test_count(),
- LessByName<TestInfo>());
- return tests;
- }
-};
-
-template <typename T> class TestSuiteWithCommentTest : public Test {};
-TYPED_TEST_SUITE(TestSuiteWithCommentTest, Types<int>);
-TYPED_TEST(TestSuiteWithCommentTest, Dummy) {}
-
-const int kTypedTestSuites = 1;
-const int kTypedTests = 1;
-
-// We can only test the accessors that do not change value while tests run.
-// Since tests can be run in any order, the values the accessors that track
-// test execution (such as failed_test_count) can not be predicted.
-TEST(ApiTest, UnitTestImmutableAccessorsWork) {
- UnitTest* unit_test = UnitTest::GetInstance();
-
- ASSERT_EQ(2 + kTypedTestSuites, unit_test->total_test_suite_count());
- EXPECT_EQ(1 + kTypedTestSuites, unit_test->test_suite_to_run_count());
- EXPECT_EQ(2, unit_test->disabled_test_count());
- EXPECT_EQ(5 + kTypedTests, unit_test->total_test_count());
- EXPECT_EQ(3 + kTypedTests, unit_test->test_to_run_count());
-
- const TestSuite** const test_suites = UnitTestHelper::GetSortedTestSuites();
-
- EXPECT_STREQ("ApiTest", test_suites[0]->name());
- EXPECT_STREQ("DISABLED_Test", test_suites[1]->name());
- EXPECT_STREQ("TestSuiteWithCommentTest/0", test_suites[2]->name());
-
- delete[] test_suites;
-
- // The following lines initiate actions to verify certain methods in
- // FinalSuccessChecker::TearDown.
-
- // Records a test property to verify TestResult::GetTestProperty().
- RecordProperty("key", "value");
-}
-
-AssertionResult IsNull(const char* str) {
- if (str != nullptr) {
- return testing::AssertionFailure() << "argument is " << str;
- }
- return AssertionSuccess();
-}
-
-TEST(ApiTest, TestSuiteImmutableAccessorsWork) {
- const TestSuite* test_suite = UnitTestHelper::FindTestSuite("ApiTest");
- ASSERT_TRUE(test_suite != nullptr);
-
- EXPECT_STREQ("ApiTest", test_suite->name());
- EXPECT_TRUE(IsNull(test_suite->type_param()));
- EXPECT_TRUE(test_suite->should_run());
- EXPECT_EQ(1, test_suite->disabled_test_count());
- EXPECT_EQ(3, test_suite->test_to_run_count());
- ASSERT_EQ(4, test_suite->total_test_count());
-
- const TestInfo** tests = UnitTestHelper::GetSortedTests(test_suite);
-
- EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
- EXPECT_STREQ("ApiTest", tests[0]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_TRUE(IsNull(tests[0]->type_param()));
- EXPECT_FALSE(tests[0]->should_run());
-
- EXPECT_STREQ("TestSuiteDisabledAccessorsWork", tests[1]->name());
- EXPECT_STREQ("ApiTest", tests[1]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[1]->value_param()));
- EXPECT_TRUE(IsNull(tests[1]->type_param()));
- EXPECT_TRUE(tests[1]->should_run());
-
- EXPECT_STREQ("TestSuiteImmutableAccessorsWork", tests[2]->name());
- EXPECT_STREQ("ApiTest", tests[2]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[2]->value_param()));
- EXPECT_TRUE(IsNull(tests[2]->type_param()));
- EXPECT_TRUE(tests[2]->should_run());
-
- EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
- EXPECT_STREQ("ApiTest", tests[3]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[3]->value_param()));
- EXPECT_TRUE(IsNull(tests[3]->type_param()));
- EXPECT_TRUE(tests[3]->should_run());
-
- delete[] tests;
- tests = nullptr;
-
- test_suite = UnitTestHelper::FindTestSuite("TestSuiteWithCommentTest/0");
- ASSERT_TRUE(test_suite != nullptr);
-
- EXPECT_STREQ("TestSuiteWithCommentTest/0", test_suite->name());
- EXPECT_STREQ(GetTypeName<Types<int>>().c_str(), test_suite->type_param());
- EXPECT_TRUE(test_suite->should_run());
- EXPECT_EQ(0, test_suite->disabled_test_count());
- EXPECT_EQ(1, test_suite->test_to_run_count());
- ASSERT_EQ(1, test_suite->total_test_count());
-
- tests = UnitTestHelper::GetSortedTests(test_suite);
-
- EXPECT_STREQ("Dummy", tests[0]->name());
- EXPECT_STREQ("TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_STREQ(GetTypeName<Types<int>>().c_str(), tests[0]->type_param());
- EXPECT_TRUE(tests[0]->should_run());
-
- delete[] tests;
-}
-
-TEST(ApiTest, TestSuiteDisabledAccessorsWork) {
- const TestSuite* test_suite = UnitTestHelper::FindTestSuite("DISABLED_Test");
- ASSERT_TRUE(test_suite != nullptr);
-
- EXPECT_STREQ("DISABLED_Test", test_suite->name());
- EXPECT_TRUE(IsNull(test_suite->type_param()));
- EXPECT_FALSE(test_suite->should_run());
- EXPECT_EQ(1, test_suite->disabled_test_count());
- EXPECT_EQ(0, test_suite->test_to_run_count());
- ASSERT_EQ(1, test_suite->total_test_count());
-
- const TestInfo* const test_info = test_suite->GetTestInfo(0);
- EXPECT_STREQ("Dummy2", test_info->name());
- EXPECT_STREQ("DISABLED_Test", test_info->test_suite_name());
- EXPECT_TRUE(IsNull(test_info->value_param()));
- EXPECT_TRUE(IsNull(test_info->type_param()));
- EXPECT_FALSE(test_info->should_run());
-}
-
-// These two tests are here to provide support for testing
-// test_suite_to_run_count, disabled_test_count, and test_to_run_count.
-TEST(ApiTest, DISABLED_Dummy1) {}
-TEST(DISABLED_Test, Dummy2) {}
-
-class FinalSuccessChecker : public Environment {
- protected:
- void TearDown() override {
- UnitTest* unit_test = UnitTest::GetInstance();
-
- EXPECT_EQ(1 + kTypedTestSuites, unit_test->successful_test_suite_count());
- EXPECT_EQ(3 + kTypedTests, unit_test->successful_test_count());
- EXPECT_EQ(0, unit_test->failed_test_suite_count());
- EXPECT_EQ(0, unit_test->failed_test_count());
- EXPECT_TRUE(unit_test->Passed());
- EXPECT_FALSE(unit_test->Failed());
- ASSERT_EQ(2 + kTypedTestSuites, unit_test->total_test_suite_count());
-
- const TestSuite** const test_suites = UnitTestHelper::GetSortedTestSuites();
-
- EXPECT_STREQ("ApiTest", test_suites[0]->name());
- EXPECT_TRUE(IsNull(test_suites[0]->type_param()));
- EXPECT_TRUE(test_suites[0]->should_run());
- EXPECT_EQ(1, test_suites[0]->disabled_test_count());
- ASSERT_EQ(4, test_suites[0]->total_test_count());
- EXPECT_EQ(3, test_suites[0]->successful_test_count());
- EXPECT_EQ(0, test_suites[0]->failed_test_count());
- EXPECT_TRUE(test_suites[0]->Passed());
- EXPECT_FALSE(test_suites[0]->Failed());
-
- EXPECT_STREQ("DISABLED_Test", test_suites[1]->name());
- EXPECT_TRUE(IsNull(test_suites[1]->type_param()));
- EXPECT_FALSE(test_suites[1]->should_run());
- EXPECT_EQ(1, test_suites[1]->disabled_test_count());
- ASSERT_EQ(1, test_suites[1]->total_test_count());
- EXPECT_EQ(0, test_suites[1]->successful_test_count());
- EXPECT_EQ(0, test_suites[1]->failed_test_count());
-
- EXPECT_STREQ("TestSuiteWithCommentTest/0", test_suites[2]->name());
- EXPECT_STREQ(GetTypeName<Types<int>>().c_str(),
- test_suites[2]->type_param());
- EXPECT_TRUE(test_suites[2]->should_run());
- EXPECT_EQ(0, test_suites[2]->disabled_test_count());
- ASSERT_EQ(1, test_suites[2]->total_test_count());
- EXPECT_EQ(1, test_suites[2]->successful_test_count());
- EXPECT_EQ(0, test_suites[2]->failed_test_count());
- EXPECT_TRUE(test_suites[2]->Passed());
- EXPECT_FALSE(test_suites[2]->Failed());
-
- const TestSuite* test_suite = UnitTestHelper::FindTestSuite("ApiTest");
- const TestInfo** tests = UnitTestHelper::GetSortedTests(test_suite);
- EXPECT_STREQ("DISABLED_Dummy1", tests[0]->name());
- EXPECT_STREQ("ApiTest", tests[0]->test_suite_name());
- EXPECT_FALSE(tests[0]->should_run());
-
- EXPECT_STREQ("TestSuiteDisabledAccessorsWork", tests[1]->name());
- EXPECT_STREQ("ApiTest", tests[1]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[1]->value_param()));
- EXPECT_TRUE(IsNull(tests[1]->type_param()));
- EXPECT_TRUE(tests[1]->should_run());
- EXPECT_TRUE(tests[1]->result()->Passed());
- EXPECT_EQ(0, tests[1]->result()->test_property_count());
-
- EXPECT_STREQ("TestSuiteImmutableAccessorsWork", tests[2]->name());
- EXPECT_STREQ("ApiTest", tests[2]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[2]->value_param()));
- EXPECT_TRUE(IsNull(tests[2]->type_param()));
- EXPECT_TRUE(tests[2]->should_run());
- EXPECT_TRUE(tests[2]->result()->Passed());
- EXPECT_EQ(0, tests[2]->result()->test_property_count());
-
- EXPECT_STREQ("UnitTestImmutableAccessorsWork", tests[3]->name());
- EXPECT_STREQ("ApiTest", tests[3]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[3]->value_param()));
- EXPECT_TRUE(IsNull(tests[3]->type_param()));
- EXPECT_TRUE(tests[3]->should_run());
- EXPECT_TRUE(tests[3]->result()->Passed());
- EXPECT_EQ(1, tests[3]->result()->test_property_count());
- const TestProperty& property = tests[3]->result()->GetTestProperty(0);
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value", property.value());
-
- delete[] tests;
-
- test_suite = UnitTestHelper::FindTestSuite("TestSuiteWithCommentTest/0");
- tests = UnitTestHelper::GetSortedTests(test_suite);
-
- EXPECT_STREQ("Dummy", tests[0]->name());
- EXPECT_STREQ("TestSuiteWithCommentTest/0", tests[0]->test_suite_name());
- EXPECT_TRUE(IsNull(tests[0]->value_param()));
- EXPECT_STREQ(GetTypeName<Types<int>>().c_str(), tests[0]->type_param());
- EXPECT_TRUE(tests[0]->should_run());
- EXPECT_TRUE(tests[0]->result()->Passed());
- EXPECT_EQ(0, tests[0]->result()->test_property_count());
-
- delete[] tests;
- delete[] test_suites;
- }
-};
-
-} // namespace internal
-} // namespace testing
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
-
- AddGlobalTestEnvironment(new testing::internal::FinalSuccessChecker());
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_all_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_all_test.cc
deleted file mode 100644
index 615b29b706..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_all_test.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google C++ Testing and Mocking Framework (Google Test)
-//
-// Sometimes it's desirable to build most of Google Test's own tests
-// by compiling a single file. This file serves this purpose.
-#include "test/googletest-filepath-test.cc"
-#include "test/googletest-message-test.cc"
-#include "test/googletest-options-test.cc"
-#include "test/googletest-port-test.cc"
-#include "test/googletest-test-part-test.cc"
-#include "test/gtest-typed-test2_test.cc"
-#include "test/gtest-typed-test_test.cc"
-#include "test/gtest_pred_impl_unittest.cc"
-#include "test/gtest_prod_test.cc"
-#include "test/gtest_skip_test.cc"
-#include "test/gtest_unittest.cc"
-#include "test/production.cc"
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_assert_by_exception_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_assert_by_exception_test.cc
deleted file mode 100644
index ada4cb30ef..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_assert_by_exception_test.cc
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests Google Test's assert-by-exception mode with exceptions enabled.
-
-#include "gtest/gtest.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdexcept>
-
-class ThrowListener : public testing::EmptyTestEventListener {
- void OnTestPartResult(const testing::TestPartResult& result) override {
- if (result.type() == testing::TestPartResult::kFatalFailure) {
- throw testing::AssertionException(result);
- }
- }
-};
-
-// Prints the given failure message and exits the program with
-// non-zero. We use this instead of a Google Test assertion to
-// indicate a failure, as the latter is been tested and cannot be
-// relied on.
-void Fail(const char* msg) {
- printf("FAILURE: %s\n", msg);
- fflush(stdout);
- exit(1);
-}
-
-static void AssertFalse() {
- ASSERT_EQ(2, 3) << "Expected failure";
-}
-
-// Tests that an assertion failure throws a subclass of
-// std::runtime_error.
-TEST(Test, Test) {
- // A successful assertion shouldn't throw.
- try {
- EXPECT_EQ(3, 3);
- } catch(...) {
- Fail("A successful assertion wrongfully threw.");
- }
-
- // A successful assertion shouldn't throw.
- try {
- EXPECT_EQ(3, 4);
- } catch(...) {
- Fail("A failed non-fatal assertion wrongfully threw.");
- }
-
- // A failed assertion should throw.
- try {
- AssertFalse();
- } catch(const testing::AssertionException& e) {
- if (strstr(e.what(), "Expected failure") != nullptr) throw;
-
- printf("%s",
- "A failed assertion did throw an exception of the right type, "
- "but the message is incorrect. Instead of containing \"Expected "
- "failure\", it is:\n");
- Fail(e.what());
- } catch(...) {
- Fail("A failed assertion threw the wrong type of exception.");
- }
- Fail("A failed assertion should've thrown but didn't.");
-}
-
-int kTestForContinuingTest = 0;
-
-TEST(Test, Test2) {
- kTestForContinuingTest = 1;
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
- testing::UnitTest::GetInstance()->listeners().Append(new ThrowListener);
-
- int result = RUN_ALL_TESTS();
- if (result == 0) {
- printf("RUN_ALL_TESTS returned %d\n", result);
- Fail("Expected failure instead.");
- }
-
- if (kTestForContinuingTest == 0) {
- Fail("Should have continued with other tests, but did not.");
- }
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_environment_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_environment_test.cc
deleted file mode 100644
index c7facf5a39..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_environment_test.cc
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests using global test environments.
-
-#include <stdlib.h>
-#include <stdio.h>
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-namespace {
-
-enum FailureType {
- NO_FAILURE, NON_FATAL_FAILURE, FATAL_FAILURE
-};
-
-// For testing using global test environments.
-class MyEnvironment : public testing::Environment {
- public:
- MyEnvironment() { Reset(); }
-
- // Depending on the value of failure_in_set_up_, SetUp() will
- // generate a non-fatal failure, generate a fatal failure, or
- // succeed.
- void SetUp() override {
- set_up_was_run_ = true;
-
- switch (failure_in_set_up_) {
- case NON_FATAL_FAILURE:
- ADD_FAILURE() << "Expected non-fatal failure in global set-up.";
- break;
- case FATAL_FAILURE:
- FAIL() << "Expected fatal failure in global set-up.";
- break;
- default:
- break;
- }
- }
-
- // Generates a non-fatal failure.
- void TearDown() override {
- tear_down_was_run_ = true;
- ADD_FAILURE() << "Expected non-fatal failure in global tear-down.";
- }
-
- // Resets the state of the environment s.t. it can be reused.
- void Reset() {
- failure_in_set_up_ = NO_FAILURE;
- set_up_was_run_ = false;
- tear_down_was_run_ = false;
- }
-
- // We call this function to set the type of failure SetUp() should
- // generate.
- void set_failure_in_set_up(FailureType type) {
- failure_in_set_up_ = type;
- }
-
- // Was SetUp() run?
- bool set_up_was_run() const { return set_up_was_run_; }
-
- // Was TearDown() run?
- bool tear_down_was_run() const { return tear_down_was_run_; }
-
- private:
- FailureType failure_in_set_up_;
- bool set_up_was_run_;
- bool tear_down_was_run_;
-};
-
-// Was the TEST run?
-bool test_was_run;
-
-// The sole purpose of this TEST is to enable us to check whether it
-// was run.
-TEST(FooTest, Bar) {
- test_was_run = true;
-}
-
-// Prints the message and aborts the program if condition is false.
-void Check(bool condition, const char* msg) {
- if (!condition) {
- printf("FAILED: %s\n", msg);
- testing::internal::posix::Abort();
- }
-}
-
-// Runs the tests. Return true if and only if successful.
-//
-// The 'failure' parameter specifies the type of failure that should
-// be generated by the global set-up.
-int RunAllTests(MyEnvironment* env, FailureType failure) {
- env->Reset();
- env->set_failure_in_set_up(failure);
- test_was_run = false;
- testing::internal::GetUnitTestImpl()->ClearAdHocTestResult();
- return RUN_ALL_TESTS();
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // Registers a global test environment, and verifies that the
- // registration function returns its argument.
- MyEnvironment* const env = new MyEnvironment;
- Check(testing::AddGlobalTestEnvironment(env) == env,
- "AddGlobalTestEnvironment() should return its argument.");
-
- // Verifies that RUN_ALL_TESTS() runs the tests when the global
- // set-up is successful.
- Check(RunAllTests(env, NO_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as the global tear-down "
- "should generate a failure.");
- Check(test_was_run,
- "The tests should run, as the global set-up should generate no "
- "failure");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() runs the tests when the global
- // set-up generates no fatal failure.
- Check(RunAllTests(env, NON_FATAL_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as both the global set-up "
- "and the global tear-down should generate a non-fatal failure.");
- Check(test_was_run,
- "The tests should run, as the global set-up should generate no "
- "fatal failure.");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() runs no test when the global set-up
- // generates a fatal failure.
- Check(RunAllTests(env, FATAL_FAILURE) != 0,
- "RUN_ALL_TESTS() should return non-zero, as the global set-up "
- "should generate a fatal failure.");
- Check(!test_was_run,
- "The tests should not run, as the global set-up should generate "
- "a fatal failure.");
- Check(env->tear_down_was_run(),
- "The global tear-down should run, as the global set-up was run.");
-
- // Verifies that RUN_ALL_TESTS() doesn't do global set-up or
- // tear-down when there is no test to run.
- GTEST_FLAG_SET(filter, "-*");
- Check(RunAllTests(env, NO_FAILURE) == 0,
- "RUN_ALL_TESTS() should return zero, as there is no test to run.");
- Check(!env->set_up_was_run(),
- "The global set-up should not run, as there is no test to run.");
- Check(!env->tear_down_was_run(),
- "The global tear-down should not run, "
- "as the global set-up was not run.");
-
- printf("PASS\n");
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test.py
deleted file mode 100755
index 3e628ae508..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test.py
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2009, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Tests the --help flag of Google C++ Testing and Mocking Framework.
-
-SYNOPSIS
- gtest_help_test.py --build_dir=BUILD/DIR
- # where BUILD/DIR contains the built gtest_help_test_ file.
- gtest_help_test.py
-"""
-
-import os
-import re
-from googletest.test import gtest_test_utils
-
-
-IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
-IS_GNUHURD = os.name == 'posix' and os.uname()[0] == 'GNU'
-IS_GNUKFREEBSD = os.name == 'posix' and os.uname()[0] == 'GNU/kFreeBSD'
-IS_WINDOWS = os.name == 'nt'
-
-PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath('gtest_help_test_')
-FLAG_PREFIX = '--gtest_'
-DEATH_TEST_STYLE_FLAG = FLAG_PREFIX + 'death_test_style'
-STREAM_RESULT_TO_FLAG = FLAG_PREFIX + 'stream_result_to'
-UNKNOWN_FLAG = FLAG_PREFIX + 'unknown_flag_for_testing'
-LIST_TESTS_FLAG = FLAG_PREFIX + 'list_tests'
-INCORRECT_FLAG_VARIANTS = [re.sub('^--', '-', LIST_TESTS_FLAG),
- re.sub('^--', '/', LIST_TESTS_FLAG),
- re.sub('_', '-', LIST_TESTS_FLAG)]
-INTERNAL_FLAG_FOR_TESTING = FLAG_PREFIX + 'internal_flag_for_testing'
-
-SUPPORTS_DEATH_TESTS = "DeathTest" in gtest_test_utils.Subprocess(
- [PROGRAM_PATH, LIST_TESTS_FLAG]).output
-
-# The help message must match this regex.
-HELP_REGEX = re.compile(
- FLAG_PREFIX + r'list_tests.*' +
- FLAG_PREFIX + r'filter=.*' +
- FLAG_PREFIX + r'also_run_disabled_tests.*' +
- FLAG_PREFIX + r'repeat=.*' +
- FLAG_PREFIX + r'shuffle.*' +
- FLAG_PREFIX + r'random_seed=.*' +
- FLAG_PREFIX + r'color=.*' +
- FLAG_PREFIX + r'brief.*' +
- FLAG_PREFIX + r'print_time.*' +
- FLAG_PREFIX + r'output=.*' +
- FLAG_PREFIX + r'break_on_failure.*' +
- FLAG_PREFIX + r'throw_on_failure.*' +
- FLAG_PREFIX + r'catch_exceptions=0.*',
- re.DOTALL)
-
-
-def RunWithFlag(flag):
- """Runs gtest_help_test_ with the given flag.
-
- Returns:
- the exit code and the text output as a tuple.
- Args:
- flag: the command-line flag to pass to gtest_help_test_, or None.
- """
-
- if flag is None:
- command = [PROGRAM_PATH]
- else:
- command = [PROGRAM_PATH, flag]
- child = gtest_test_utils.Subprocess(command)
- return child.exit_code, child.output
-
-
-class GTestHelpTest(gtest_test_utils.TestCase):
- """Tests the --help flag and its equivalent forms."""
-
- def TestHelpFlag(self, flag):
- """Verifies correct behavior when help flag is specified.
-
- The right message must be printed and the tests must
- skipped when the given flag is specified.
-
- Args:
- flag: A flag to pass to the binary or None.
- """
-
- exit_code, output = RunWithFlag(flag)
- self.assertEquals(0, exit_code)
- self.assert_(HELP_REGEX.search(output), output)
-
- if IS_LINUX or IS_GNUHURD or IS_GNUKFREEBSD:
- self.assert_(STREAM_RESULT_TO_FLAG in output, output)
- else:
- self.assert_(STREAM_RESULT_TO_FLAG not in output, output)
-
- if SUPPORTS_DEATH_TESTS and not IS_WINDOWS:
- self.assert_(DEATH_TEST_STYLE_FLAG in output, output)
- else:
- self.assert_(DEATH_TEST_STYLE_FLAG not in output, output)
-
- def TestNonHelpFlag(self, flag):
- """Verifies correct behavior when no help flag is specified.
-
- Verifies that when no help flag is specified, the tests are run
- and the help message is not printed.
-
- Args:
- flag: A flag to pass to the binary or None.
- """
-
- exit_code, output = RunWithFlag(flag)
- self.assert_(exit_code != 0)
- self.assert_(not HELP_REGEX.search(output), output)
-
- def testPrintsHelpWithFullFlag(self):
- self.TestHelpFlag('--help')
-
- def testPrintsHelpWithShortFlag(self):
- self.TestHelpFlag('-h')
-
- def testPrintsHelpWithQuestionFlag(self):
- self.TestHelpFlag('-?')
-
- def testPrintsHelpWithWindowsStyleQuestionFlag(self):
- self.TestHelpFlag('/?')
-
- def testPrintsHelpWithUnrecognizedGoogleTestFlag(self):
- self.TestHelpFlag(UNKNOWN_FLAG)
-
- def testPrintsHelpWithIncorrectFlagStyle(self):
- for incorrect_flag in INCORRECT_FLAG_VARIANTS:
- self.TestHelpFlag(incorrect_flag)
-
- def testRunsTestsWithoutHelpFlag(self):
- """Verifies that when no help flag is specified, the tests are run
- and the help message is not printed."""
-
- self.TestNonHelpFlag(None)
-
- def testRunsTestsWithGtestInternalFlag(self):
- """Verifies that the tests are run and no help message is printed when
- a flag starting with Google Test prefix and 'internal_' is supplied."""
-
- self.TestNonHelpFlag(INTERNAL_FLAG_FOR_TESTING)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test_.cc
deleted file mode 100644
index 750ae6ce95..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_help_test_.cc
+++ /dev/null
@@ -1,45 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This program is meant to be run by gtest_help_test.py. Do not run
-// it directly.
-
-#include "gtest/gtest.h"
-
-// When a help flag is specified, this program should skip the tests
-// and exit with 0; otherwise the following test will be executed,
-// causing this program to exit with a non-zero code.
-TEST(HelpFlagTest, ShouldNotBeRun) {
- ASSERT_TRUE(false) << "Tests shouldn't be run when --help is specified.";
-}
-
-#if GTEST_HAS_DEATH_TEST
-TEST(DeathTest, UsedByPythonScriptToDetectSupportForDeathTestsInThisBinary) {}
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_json_test_utils.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_json_test_utils.py
deleted file mode 100644
index 62bbfc288f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_json_test_utils.py
+++ /dev/null
@@ -1,60 +0,0 @@
-# Copyright 2018, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for gtest_json_output."""
-
-import re
-
-
-def normalize(obj):
- """Normalize output object.
-
- Args:
- obj: Google Test's JSON output object to normalize.
-
- Returns:
- Normalized output without any references to transient information that may
- change from run to run.
- """
- def _normalize(key, value):
- if key == 'time':
- return re.sub(r'^\d+(\.\d+)?s$', '*', value)
- elif key == 'timestamp':
- return re.sub(r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\dZ$', '*', value)
- elif key == 'failure':
- value = re.sub(r'^.*[/\\](.*:)\d+\n', '\\1*\n', value)
- return re.sub(r'Stack trace:\n(.|\n)*', 'Stack trace:\n*', value)
- else:
- return normalize(value)
- if isinstance(obj, dict):
- return {k: _normalize(k, v) for k, v in obj.items()}
- if isinstance(obj, list):
- return [normalize(x) for x in obj]
- else:
- return obj
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest.py
deleted file mode 100644
index faacf103c3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest.py
+++ /dev/null
@@ -1,286 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Unit test for Google Test's --gtest_list_tests flag.
-
-A user can ask Google Test to list all tests by specifying the
---gtest_list_tests flag. If output is requested, via --gtest_output=xml
-or --gtest_output=json, the tests are listed, with extra information in the
-output file.
-This script tests such functionality by invoking gtest_list_output_unittest_
- (a program written with Google Test) the command line flags.
-"""
-
-import os
-import re
-from googletest.test import gtest_test_utils
-
-GTEST_LIST_TESTS_FLAG = '--gtest_list_tests'
-GTEST_OUTPUT_FLAG = '--gtest_output'
-
-EXPECTED_XML = """<\?xml version="1.0" encoding="UTF-8"\?>
-<testsuites tests="16" name="AllTests">
- <testsuite name="FooTest" tests="2">
- <testcase name="Test1" file=".*gtest_list_output_unittest_.cc" line="43" />
- <testcase name="Test2" file=".*gtest_list_output_unittest_.cc" line="45" />
- </testsuite>
- <testsuite name="FooTestFixture" tests="2">
- <testcase name="Test3" file=".*gtest_list_output_unittest_.cc" line="48" />
- <testcase name="Test4" file=".*gtest_list_output_unittest_.cc" line="49" />
- </testsuite>
- <testsuite name="TypedTest/0" tests="2">
- <testcase name="Test7" type_param="int" file=".*gtest_list_output_unittest_.cc" line="60" />
- <testcase name="Test8" type_param="int" file=".*gtest_list_output_unittest_.cc" line="61" />
- </testsuite>
- <testsuite name="TypedTest/1" tests="2">
- <testcase name="Test7" type_param="bool" file=".*gtest_list_output_unittest_.cc" line="60" />
- <testcase name="Test8" type_param="bool" file=".*gtest_list_output_unittest_.cc" line="61" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestSuite/0" tests="2">
- <testcase name="Test9" type_param="int" file=".*gtest_list_output_unittest_.cc" line="66" />
- <testcase name="Test10" type_param="int" file=".*gtest_list_output_unittest_.cc" line="67" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestSuite/1" tests="2">
- <testcase name="Test9" type_param="bool" file=".*gtest_list_output_unittest_.cc" line="66" />
- <testcase name="Test10" type_param="bool" file=".*gtest_list_output_unittest_.cc" line="67" />
- </testsuite>
- <testsuite name="ValueParam/ValueParamTest" tests="4">
- <testcase name="Test5/0" value_param="33" file=".*gtest_list_output_unittest_.cc" line="52" />
- <testcase name="Test5/1" value_param="42" file=".*gtest_list_output_unittest_.cc" line="52" />
- <testcase name="Test6/0" value_param="33" file=".*gtest_list_output_unittest_.cc" line="53" />
- <testcase name="Test6/1" value_param="42" file=".*gtest_list_output_unittest_.cc" line="53" />
- </testsuite>
-</testsuites>
-"""
-
-EXPECTED_JSON = """{
- "tests": 16,
- "name": "AllTests",
- "testsuites": \[
- {
- "name": "FooTest",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test1",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 43
- },
- {
- "name": "Test2",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 45
- }
- \]
- },
- {
- "name": "FooTestFixture",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test3",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 48
- },
- {
- "name": "Test4",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 49
- }
- \]
- },
- {
- "name": "TypedTest\\\\/0",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test7",
- "type_param": "int",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 60
- },
- {
- "name": "Test8",
- "type_param": "int",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 61
- }
- \]
- },
- {
- "name": "TypedTest\\\\/1",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test7",
- "type_param": "bool",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 60
- },
- {
- "name": "Test8",
- "type_param": "bool",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 61
- }
- \]
- },
- {
- "name": "Single\\\\/TypeParameterizedTestSuite\\\\/0",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test9",
- "type_param": "int",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 66
- },
- {
- "name": "Test10",
- "type_param": "int",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 67
- }
- \]
- },
- {
- "name": "Single\\\\/TypeParameterizedTestSuite\\\\/1",
- "tests": 2,
- "testsuite": \[
- {
- "name": "Test9",
- "type_param": "bool",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 66
- },
- {
- "name": "Test10",
- "type_param": "bool",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 67
- }
- \]
- },
- {
- "name": "ValueParam\\\\/ValueParamTest",
- "tests": 4,
- "testsuite": \[
- {
- "name": "Test5\\\\/0",
- "value_param": "33",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 52
- },
- {
- "name": "Test5\\\\/1",
- "value_param": "42",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 52
- },
- {
- "name": "Test6\\\\/0",
- "value_param": "33",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 53
- },
- {
- "name": "Test6\\\\/1",
- "value_param": "42",
- "file": ".*gtest_list_output_unittest_.cc",
- "line": 53
- }
- \]
- }
- \]
-}
-"""
-
-
-class GTestListTestsOutputUnitTest(gtest_test_utils.TestCase):
- """Unit test for Google Test's list tests with output to file functionality.
- """
-
- def testXml(self):
- """Verifies XML output for listing tests in a Google Test binary.
-
- Runs a test program that generates an empty XML output, and
- tests that the XML output is expected.
- """
- self._TestOutput('xml', EXPECTED_XML)
-
- def testJSON(self):
- """Verifies XML output for listing tests in a Google Test binary.
-
- Runs a test program that generates an empty XML output, and
- tests that the XML output is expected.
- """
- self._TestOutput('json', EXPECTED_JSON)
-
- def _GetOutput(self, out_format):
- file_path = os.path.join(gtest_test_utils.GetTempDir(),
- 'test_out.' + out_format)
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
- 'gtest_list_output_unittest_')
-
- command = ([
- gtest_prog_path,
- '%s=%s:%s' % (GTEST_OUTPUT_FLAG, out_format, file_path),
- '--gtest_list_tests'
- ])
- environ_copy = os.environ.copy()
- p = gtest_test_utils.Subprocess(
- command, env=environ_copy, working_dir=gtest_test_utils.GetTempDir())
-
- self.assertTrue(p.exited)
- self.assertEqual(0, p.exit_code)
- self.assertTrue(os.path.isfile(file_path))
- with open(file_path) as f:
- result = f.read()
- return result
-
- def _TestOutput(self, test_format, expected_output):
- actual = self._GetOutput(test_format)
- actual_lines = actual.splitlines()
- expected_lines = expected_output.splitlines()
- line_count = 0
- for actual_line in actual_lines:
- expected_line = expected_lines[line_count]
- expected_line_re = re.compile(expected_line.strip())
- self.assertTrue(
- expected_line_re.match(actual_line.strip()),
- ('actual output of "%s",\n'
- 'which does not match expected regex of "%s"\n'
- 'on line %d' % (actual, expected_output, line_count)))
- line_count = line_count + 1
-
-
-if __name__ == '__main__':
- os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest_.cc
deleted file mode 100644
index 92b9d4f28e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_list_output_unittest_.cc
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2018, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: david.schuldenfrei@gmail.com (David Schuldenfrei)
-
-// Unit test for Google Test's --gtest_list_tests and --gtest_output flag.
-//
-// A user can ask Google Test to list all tests that will run,
-// and have the output saved in a Json/Xml file.
-// The tests will not be run after listing.
-//
-// This program will be invoked from a Python unit test.
-// Don't run it directly.
-
-#include "gtest/gtest.h"
-
-TEST(FooTest, Test1) {}
-
-TEST(FooTest, Test2) {}
-
-class FooTestFixture : public ::testing::Test {};
-TEST_F(FooTestFixture, Test3) {}
-TEST_F(FooTestFixture, Test4) {}
-
-class ValueParamTest : public ::testing::TestWithParam<int> {};
-TEST_P(ValueParamTest, Test5) {}
-TEST_P(ValueParamTest, Test6) {}
-INSTANTIATE_TEST_SUITE_P(ValueParam, ValueParamTest, ::testing::Values(33, 42));
-
-template <typename T>
-class TypedTest : public ::testing::Test {};
-typedef testing::Types<int, bool> TypedTestTypes;
-TYPED_TEST_SUITE(TypedTest, TypedTestTypes);
-TYPED_TEST(TypedTest, Test7) {}
-TYPED_TEST(TypedTest, Test8) {}
-
-template <typename T>
-class TypeParameterizedTestSuite : public ::testing::Test {};
-TYPED_TEST_SUITE_P(TypeParameterizedTestSuite);
-TYPED_TEST_P(TypeParameterizedTestSuite, Test9) {}
-TYPED_TEST_P(TypeParameterizedTestSuite, Test10) {}
-REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, Test9, Test10);
-typedef testing::Types<int, bool> TypeParameterizedTestSuiteTypes; // NOLINT
-INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite,
- TypeParameterizedTestSuiteTypes);
-
-int main(int argc, char **argv) {
- ::testing::InitGoogleTest(&argc, argv);
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_main_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_main_unittest.cc
deleted file mode 100644
index eddedeabe8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_main_unittest.cc
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-#include "gtest/gtest.h"
-
-// Tests that we don't have to define main() when we link to
-// gtest_main instead of gtest.
-
-namespace {
-
-TEST(GTestMainTest, ShouldSucceed) {
-}
-
-} // namespace
-
-// We are using the main() function defined in gtest_main.cc, so we
-// don't define it here.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_no_test_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_no_test_unittest.cc
deleted file mode 100644
index d4f88dbfdf..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_no_test_unittest.cc
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Tests that a Google Test program that has no test defined can run
-// successfully.
-
-#include "gtest/gtest.h"
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // An ad-hoc assertion outside of all tests.
- //
- // This serves three purposes:
- //
- // 1. It verifies that an ad-hoc assertion can be executed even if
- // no test is defined.
- // 2. It verifies that a failed ad-hoc assertion causes the test
- // program to fail.
- // 3. We had a bug where the XML output won't be generated if an
- // assertion is executed before RUN_ALL_TESTS() is called, even
- // though --gtest_output=xml is specified. This makes sure the
- // bug is fixed and doesn't regress.
- EXPECT_EQ(1, 2);
-
- // The above EXPECT_EQ() should cause RUN_ALL_TESTS() to return non-zero.
- return RUN_ALL_TESTS() ? 0 : 1;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_pred_impl_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_pred_impl_unittest.cc
deleted file mode 100644
index 5eeb147379..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_pred_impl_unittest.cc
+++ /dev/null
@@ -1,2422 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// This file is AUTOMATICALLY GENERATED on 07/21/2021 by command
-// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
-
-// Regression test for gtest_pred_impl.h
-//
-// This file is generated by a script and quite long. If you intend to
-// learn how Google Test works by reading its unit tests, read
-// gtest_unittest.cc instead.
-//
-// This is intended as a regression test for the Google Test predicate
-// assertions. We compile it as part of the gtest_unittest target
-// only to keep the implementation tidy and compact, as it is quite
-// involved to set up the stage for testing Google Test using Google
-// Test itself.
-//
-// Currently, gtest_unittest takes ~11 seconds to run in the testing
-// daemon. In the future, if it grows too large and needs much more
-// time to finish, we should consider separating this file into a
-// stand-alone regression test.
-
-#include <iostream>
-
-#include "gtest/gtest.h"
-#include "gtest/gtest-spi.h"
-
-// A user-defined data type.
-struct Bool {
- explicit Bool(int val) : value(val != 0) {}
-
- bool operator>(int n) const { return value > Bool(n).value; }
-
- Bool operator+(const Bool& rhs) const { return Bool(value + rhs.value); }
-
- bool operator==(const Bool& rhs) const { return value == rhs.value; }
-
- bool value;
-};
-
-// Enables Bool to be used in assertions.
-std::ostream& operator<<(std::ostream& os, const Bool& x) {
- return os << (x.value ? "true" : "false");
-}
-
-// Sample functions/functors for testing unary predicate assertions.
-
-// A unary predicate function.
-template <typename T1>
-bool PredFunction1(T1 v1) {
- return v1 > 0;
-}
-
-// The following two functions are needed because a compiler doesn't have
-// a context yet to know which template function must be instantiated.
-bool PredFunction1Int(int v1) {
- return v1 > 0;
-}
-bool PredFunction1Bool(Bool v1) {
- return v1 > 0;
-}
-
-// A unary predicate functor.
-struct PredFunctor1 {
- template <typename T1>
- bool operator()(const T1& v1) {
- return v1 > 0;
- }
-};
-
-// A unary predicate-formatter function.
-template <typename T1>
-testing::AssertionResult PredFormatFunction1(const char* e1,
- const T1& v1) {
- if (PredFunction1(v1))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1
- << " is expected to be positive, but evaluates to "
- << v1 << ".";
-}
-
-// A unary predicate-formatter functor.
-struct PredFormatFunctor1 {
- template <typename T1>
- testing::AssertionResult operator()(const char* e1,
- const T1& v1) const {
- return PredFormatFunction1(e1, v1);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT1.
-
-class Predicate1Test : public testing::Test {
- protected:
- void SetUp() override {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = 0;
- }
-
- void TearDown() override {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpectedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true if and only if the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true if and only if the test function did run to finish.
- static bool finished_;
-
- static int n1_;
-};
-
-bool Predicate1Test::expected_to_finish_;
-bool Predicate1Test::finished_;
-int Predicate1Test::n1_;
-
-typedef Predicate1Test EXPECT_PRED_FORMAT1Test;
-typedef Predicate1Test ASSERT_PRED_FORMAT1Test;
-typedef Predicate1Test EXPECT_PRED1Test;
-typedef Predicate1Test ASSERT_PRED1Test;
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED1(PredFunction1Int,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED1(PredFunction1Bool,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED1(PredFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED1(PredFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunction1Int,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunction1Bool,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED1Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED1Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(PredFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED1(PredFunction1Int,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED1(PredFunction1Bool,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED1(PredFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED1(PredFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunction1Int,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunction1Bool,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED1Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED1Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED1(PredFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunction1,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- ++n1_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(++n1_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunction1,
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- n1_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT1 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT1Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(PredFormatFunctor1(),
- Bool(n1_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing binary predicate assertions.
-
-// A binary predicate function.
-template <typename T1, typename T2>
-bool PredFunction2(T1 v1, T2 v2) {
- return v1 + v2 > 0;
-}
-
-// The following two functions are needed because a compiler doesn't have
-// a context yet to know which template function must be instantiated.
-bool PredFunction2Int(int v1, int v2) {
- return v1 + v2 > 0;
-}
-bool PredFunction2Bool(Bool v1, Bool v2) {
- return v1 + v2 > 0;
-}
-
-// A binary predicate functor.
-struct PredFunctor2 {
- template <typename T1, typename T2>
- bool operator()(const T1& v1,
- const T2& v2) {
- return v1 + v2 > 0;
- }
-};
-
-// A binary predicate-formatter function.
-template <typename T1, typename T2>
-testing::AssertionResult PredFormatFunction2(const char* e1,
- const char* e2,
- const T1& v1,
- const T2& v2) {
- if (PredFunction2(v1, v2))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2
- << " is expected to be positive, but evaluates to "
- << v1 + v2 << ".";
-}
-
-// A binary predicate-formatter functor.
-struct PredFormatFunctor2 {
- template <typename T1, typename T2>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const T1& v1,
- const T2& v2) const {
- return PredFormatFunction2(e1, e2, v1, v2);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT2.
-
-class Predicate2Test : public testing::Test {
- protected:
- void SetUp() override {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = 0;
- }
-
- void TearDown() override {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpectedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true if and only if the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true if and only if the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
-};
-
-bool Predicate2Test::expected_to_finish_;
-bool Predicate2Test::finished_;
-int Predicate2Test::n1_;
-int Predicate2Test::n2_;
-
-typedef Predicate2Test EXPECT_PRED_FORMAT2Test;
-typedef Predicate2Test ASSERT_PRED_FORMAT2Test;
-typedef Predicate2Test EXPECT_PRED2Test;
-typedef Predicate2Test ASSERT_PRED2Test;
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED2(PredFunction2Int,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED2(PredFunction2Bool,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED2(PredFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED2(PredFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunction2Int,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunction2Bool,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED2Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED2Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(PredFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED2(PredFunction2Int,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED2(PredFunction2Bool,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED2(PredFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED2(PredFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunction2Int,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunction2Bool,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED2Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED2Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED2(PredFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunction2,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- ++n1_,
- ++n2_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(++n1_),
- Bool(++n2_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunction2,
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- n1_++,
- n2_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT2 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT2Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(PredFormatFunctor2(),
- Bool(n1_++),
- Bool(n2_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing ternary predicate assertions.
-
-// A ternary predicate function.
-template <typename T1, typename T2, typename T3>
-bool PredFunction3(T1 v1, T2 v2, T3 v3) {
- return v1 + v2 + v3 > 0;
-}
-
-// The following two functions are needed because a compiler doesn't have
-// a context yet to know which template function must be instantiated.
-bool PredFunction3Int(int v1, int v2, int v3) {
- return v1 + v2 + v3 > 0;
-}
-bool PredFunction3Bool(Bool v1, Bool v2, Bool v3) {
- return v1 + v2 + v3 > 0;
-}
-
-// A ternary predicate functor.
-struct PredFunctor3 {
- template <typename T1, typename T2, typename T3>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3) {
- return v1 + v2 + v3 > 0;
- }
-};
-
-// A ternary predicate-formatter function.
-template <typename T1, typename T2, typename T3>
-testing::AssertionResult PredFormatFunction3(const char* e1,
- const char* e2,
- const char* e3,
- const T1& v1,
- const T2& v2,
- const T3& v3) {
- if (PredFunction3(v1, v2, v3))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 << ".";
-}
-
-// A ternary predicate-formatter functor.
-struct PredFormatFunctor3 {
- template <typename T1, typename T2, typename T3>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const T1& v1,
- const T2& v2,
- const T3& v3) const {
- return PredFormatFunction3(e1, e2, e3, v1, v2, v3);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT3.
-
-class Predicate3Test : public testing::Test {
- protected:
- void SetUp() override {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = 0;
- }
-
- void TearDown() override {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpectedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true if and only if the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true if and only if the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
-};
-
-bool Predicate3Test::expected_to_finish_;
-bool Predicate3Test::finished_;
-int Predicate3Test::n1_;
-int Predicate3Test::n2_;
-int Predicate3Test::n3_;
-
-typedef Predicate3Test EXPECT_PRED_FORMAT3Test;
-typedef Predicate3Test ASSERT_PRED_FORMAT3Test;
-typedef Predicate3Test EXPECT_PRED3Test;
-typedef Predicate3Test ASSERT_PRED3Test;
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED3(PredFunction3Int,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED3(PredFunction3Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED3(PredFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED3(PredFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunction3Int,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunction3Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED3Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED3Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(PredFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED3(PredFunction3Int,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED3(PredFunction3Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED3(PredFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED3(PredFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunction3Int,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunction3Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED3Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED3Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(PredFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunction3,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- ++n1_,
- ++n2_,
- ++n3_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunction3,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- n1_++,
- n2_++,
- n3_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT3 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT3Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT3(PredFormatFunctor3(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing 4-ary predicate assertions.
-
-// A 4-ary predicate function.
-template <typename T1, typename T2, typename T3, typename T4>
-bool PredFunction4(T1 v1, T2 v2, T3 v3, T4 v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-
-// The following two functions are needed because a compiler doesn't have
-// a context yet to know which template function must be instantiated.
-bool PredFunction4Int(int v1, int v2, int v3, int v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-bool PredFunction4Bool(Bool v1, Bool v2, Bool v3, Bool v4) {
- return v1 + v2 + v3 + v4 > 0;
-}
-
-// A 4-ary predicate functor.
-struct PredFunctor4 {
- template <typename T1, typename T2, typename T3, typename T4>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- return v1 + v2 + v3 + v4 > 0;
- }
-};
-
-// A 4-ary predicate-formatter function.
-template <typename T1, typename T2, typename T3, typename T4>
-testing::AssertionResult PredFormatFunction4(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) {
- if (PredFunction4(v1, v2, v3, v4))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3 << " + " << e4
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 + v4 << ".";
-}
-
-// A 4-ary predicate-formatter functor.
-struct PredFormatFunctor4 {
- template <typename T1, typename T2, typename T3, typename T4>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4) const {
- return PredFormatFunction4(e1, e2, e3, e4, v1, v2, v3, v4);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT4.
-
-class Predicate4Test : public testing::Test {
- protected:
- void SetUp() override {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = n4_ = 0;
- }
-
- void TearDown() override {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
- EXPECT_EQ(1, n4_) <<
- "The predicate assertion didn't evaluate argument 5 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpectedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true if and only if the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true if and only if the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
- static int n4_;
-};
-
-bool Predicate4Test::expected_to_finish_;
-bool Predicate4Test::finished_;
-int Predicate4Test::n1_;
-int Predicate4Test::n2_;
-int Predicate4Test::n3_;
-int Predicate4Test::n4_;
-
-typedef Predicate4Test EXPECT_PRED_FORMAT4Test;
-typedef Predicate4Test ASSERT_PRED_FORMAT4Test;
-typedef Predicate4Test EXPECT_PRED4Test;
-typedef Predicate4Test ASSERT_PRED4Test;
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED4(PredFunction4Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED4(PredFunction4Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED4(PredFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED4(PredFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunction4Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunction4Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED4Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED4Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED4(PredFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED4(PredFunction4Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED4(PredFunction4Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED4(PredFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED4(PredFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunction4Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunction4Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED4Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED4Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED4(PredFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunction4,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunction4,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- n1_++,
- n2_++,
- n3_++,
- n4_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT4 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT4Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT4(PredFormatFunctor4(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++));
- finished_ = true;
- }, "");
-}
-// Sample functions/functors for testing 5-ary predicate assertions.
-
-// A 5-ary predicate function.
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-bool PredFunction5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-
-// The following two functions are needed because a compiler doesn't have
-// a context yet to know which template function must be instantiated.
-bool PredFunction5Int(int v1, int v2, int v3, int v4, int v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-bool PredFunction5Bool(Bool v1, Bool v2, Bool v3, Bool v4, Bool v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
-}
-
-// A 5-ary predicate functor.
-struct PredFunctor5 {
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- bool operator()(const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- return v1 + v2 + v3 + v4 + v5 > 0;
- }
-};
-
-// A 5-ary predicate-formatter function.
-template <typename T1, typename T2, typename T3, typename T4, typename T5>
-testing::AssertionResult PredFormatFunction5(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) {
- if (PredFunction5(v1, v2, v3, v4, v5))
- return testing::AssertionSuccess();
-
- return testing::AssertionFailure()
- << e1 << " + " << e2 << " + " << e3 << " + " << e4 << " + " << e5
- << " is expected to be positive, but evaluates to "
- << v1 + v2 + v3 + v4 + v5 << ".";
-}
-
-// A 5-ary predicate-formatter functor.
-struct PredFormatFunctor5 {
- template <typename T1, typename T2, typename T3, typename T4, typename T5>
- testing::AssertionResult operator()(const char* e1,
- const char* e2,
- const char* e3,
- const char* e4,
- const char* e5,
- const T1& v1,
- const T2& v2,
- const T3& v3,
- const T4& v4,
- const T5& v5) const {
- return PredFormatFunction5(e1, e2, e3, e4, e5, v1, v2, v3, v4, v5);
- }
-};
-
-// Tests for {EXPECT|ASSERT}_PRED_FORMAT5.
-
-class Predicate5Test : public testing::Test {
- protected:
- void SetUp() override {
- expected_to_finish_ = true;
- finished_ = false;
- n1_ = n2_ = n3_ = n4_ = n5_ = 0;
- }
-
- void TearDown() override {
- // Verifies that each of the predicate's arguments was evaluated
- // exactly once.
- EXPECT_EQ(1, n1_) <<
- "The predicate assertion didn't evaluate argument 2 "
- "exactly once.";
- EXPECT_EQ(1, n2_) <<
- "The predicate assertion didn't evaluate argument 3 "
- "exactly once.";
- EXPECT_EQ(1, n3_) <<
- "The predicate assertion didn't evaluate argument 4 "
- "exactly once.";
- EXPECT_EQ(1, n4_) <<
- "The predicate assertion didn't evaluate argument 5 "
- "exactly once.";
- EXPECT_EQ(1, n5_) <<
- "The predicate assertion didn't evaluate argument 6 "
- "exactly once.";
-
- // Verifies that the control flow in the test function is expected.
- if (expected_to_finish_ && !finished_) {
- FAIL() << "The predicate assertion unexpectedly aborted the test.";
- } else if (!expected_to_finish_ && finished_) {
- FAIL() << "The failed predicate assertion didn't abort the test "
- "as expected.";
- }
- }
-
- // true if and only if the test function is expected to run to finish.
- static bool expected_to_finish_;
-
- // true if and only if the test function did run to finish.
- static bool finished_;
-
- static int n1_;
- static int n2_;
- static int n3_;
- static int n4_;
- static int n5_;
-};
-
-bool Predicate5Test::expected_to_finish_;
-bool Predicate5Test::finished_;
-int Predicate5Test::n1_;
-int Predicate5Test::n2_;
-int Predicate5Test::n3_;
-int Predicate5Test::n4_;
-int Predicate5Test::n5_;
-
-typedef Predicate5Test EXPECT_PRED_FORMAT5Test;
-typedef Predicate5Test ASSERT_PRED_FORMAT5Test;
-typedef Predicate5Test EXPECT_PRED5Test;
-typedef Predicate5Test ASSERT_PRED5Test;
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED5(PredFunction5Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED5(PredFunction5Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED5(PredFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED5(PredFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunction5Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunction5Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED5Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED5Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED5(PredFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED5(PredFunction5Int,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED5(PredFunction5Bool,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED5(PredFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED5(PredFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunction5Int,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunction5Bool,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED5Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED5Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED5(PredFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunction5,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed EXPECT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(EXPECT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- ++n1_,
- ++n2_,
- ++n3_,
- ++n4_,
- ++n5_);
- finished_ = true;
-}
-
-// Tests a successful ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeSuccess) {
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(++n1_),
- Bool(++n2_),
- Bool(++n3_),
- Bool(++n4_),
- Bool(++n5_));
- finished_ = true;
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a function on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctionOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunction5,
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a built-in type (int).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnBuiltInTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- n1_++,
- n2_++,
- n3_++,
- n4_++,
- n5_++);
- finished_ = true;
- }, "");
-}
-
-// Tests a failed ASSERT_PRED_FORMAT5 where the
-// predicate-formatter is a functor on a user-defined type (Bool).
-TEST_F(ASSERT_PRED_FORMAT5Test, FunctorOnUserTypeFailure) {
- expected_to_finish_ = false;
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(PredFormatFunctor5(),
- Bool(n1_++),
- Bool(n2_++),
- Bool(n3_++),
- Bool(n4_++),
- Bool(n5_++));
- finished_ = true;
- }, "");
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_premature_exit_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_premature_exit_test.cc
deleted file mode 100644
index 1d1187eff0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_premature_exit_test.cc
+++ /dev/null
@@ -1,126 +0,0 @@
-// Copyright 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests that Google Test manipulates the premature-exit-detection
-// file correctly.
-
-#include <stdio.h>
-
-#include "gtest/gtest.h"
-
-using ::testing::InitGoogleTest;
-using ::testing::Test;
-using ::testing::internal::posix::GetEnv;
-using ::testing::internal::posix::Stat;
-using ::testing::internal::posix::StatStruct;
-
-namespace {
-
-class PrematureExitTest : public Test {
- public:
- // Returns true if and only if the given file exists.
- static bool FileExists(const char* filepath) {
- StatStruct stat;
- return Stat(filepath, &stat) == 0;
- }
-
- protected:
- PrematureExitTest() {
- premature_exit_file_path_ = GetEnv("TEST_PREMATURE_EXIT_FILE");
-
- // Normalize NULL to "" for ease of handling.
- if (premature_exit_file_path_ == nullptr) {
- premature_exit_file_path_ = "";
- }
- }
-
- // Returns true if and only if the premature-exit file exists.
- bool PrematureExitFileExists() const {
- return FileExists(premature_exit_file_path_);
- }
-
- const char* premature_exit_file_path_;
-};
-
-typedef PrematureExitTest PrematureExitDeathTest;
-
-// Tests that:
-// - the premature-exit file exists during the execution of a
-// death test (EXPECT_DEATH*), and
-// - a death test doesn't interfere with the main test process's
-// handling of the premature-exit file.
-TEST_F(PrematureExitDeathTest, FileExistsDuringExecutionOfDeathTest) {
- if (*premature_exit_file_path_ == '\0') {
- return;
- }
-
- EXPECT_DEATH_IF_SUPPORTED({
- // If the file exists, crash the process such that the main test
- // process will catch the (expected) crash and report a success;
- // otherwise don't crash, which will cause the main test process
- // to report that the death test has failed.
- if (PrematureExitFileExists()) {
- exit(1);
- }
- }, "");
-}
-
-// Tests that the premature-exit file exists during the execution of a
-// normal (non-death) test.
-TEST_F(PrematureExitTest, PrematureExitFileExistsDuringTestExecution) {
- if (*premature_exit_file_path_ == '\0') {
- return;
- }
-
- EXPECT_TRUE(PrematureExitFileExists())
- << " file " << premature_exit_file_path_
- << " should exist during test execution, but doesn't.";
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- InitGoogleTest(&argc, argv);
- const int exit_code = RUN_ALL_TESTS();
-
- // Test that the premature-exit file is deleted upon return from
- // RUN_ALL_TESTS().
- const char* const filepath = GetEnv("TEST_PREMATURE_EXIT_FILE");
- if (filepath != nullptr && *filepath != '\0') {
- if (PrematureExitTest::FileExists(filepath)) {
- printf(
- "File %s shouldn't exist after the test program finishes, but does.",
- filepath);
- return 1;
- }
- }
-
- return exit_code;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_prod_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_prod_test.cc
deleted file mode 100644
index ede81a0d17..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_prod_test.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Unit test for gtest_prod.h.
-
-#include "production.h"
-#include "gtest/gtest.h"
-
-// Tests that private members can be accessed from a TEST declared as
-// a friend of the class.
-TEST(PrivateCodeTest, CanAccessPrivateMembers) {
- PrivateCode a;
- EXPECT_EQ(0, a.x_);
-
- a.set_x(1);
- EXPECT_EQ(1, a.x_);
-}
-
-typedef testing::Test PrivateCodeFixtureTest;
-
-// Tests that private members can be accessed from a TEST_F declared
-// as a friend of the class.
-TEST_F(PrivateCodeFixtureTest, CanAccessPrivateMembers) {
- PrivateCode a;
- EXPECT_EQ(0, a.x_);
-
- a.set_x(2);
- EXPECT_EQ(2, a.x_);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_repeat_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_repeat_test.cc
deleted file mode 100644
index c7af3efb6d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_repeat_test.cc
+++ /dev/null
@@ -1,221 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests the --gtest_repeat=number flag.
-
-#include <stdlib.h>
-#include <iostream>
-#include "gtest/gtest.h"
-#include "src/gtest-internal-inl.h"
-
-namespace {
-
-// We need this when we are testing Google Test itself and therefore
-// cannot use Google Test assertions.
-#define GTEST_CHECK_INT_EQ_(expected, actual) \
- do {\
- const int expected_val = (expected);\
- const int actual_val = (actual);\
- if (::testing::internal::IsTrue(expected_val != actual_val)) {\
- ::std::cout << "Value of: " #actual "\n"\
- << " Actual: " << actual_val << "\n"\
- << "Expected: " #expected "\n"\
- << "Which is: " << expected_val << "\n";\
- ::testing::internal::posix::Abort();\
- }\
- } while (::testing::internal::AlwaysFalse())
-
-
-// Used for verifying that global environment set-up and tear-down are
-// inside the --gtest_repeat loop.
-
-int g_environment_set_up_count = 0;
-int g_environment_tear_down_count = 0;
-
-class MyEnvironment : public testing::Environment {
- public:
- MyEnvironment() {}
- void SetUp() override { g_environment_set_up_count++; }
- void TearDown() override { g_environment_tear_down_count++; }
-};
-
-// A test that should fail.
-
-int g_should_fail_count = 0;
-
-TEST(FooTest, ShouldFail) {
- g_should_fail_count++;
- EXPECT_EQ(0, 1) << "Expected failure.";
-}
-
-// A test that should pass.
-
-int g_should_pass_count = 0;
-
-TEST(FooTest, ShouldPass) {
- g_should_pass_count++;
-}
-
-// A test that contains a thread-safe death test and a fast death
-// test. It should pass.
-
-int g_death_test_count = 0;
-
-TEST(BarDeathTest, ThreadSafeAndFast) {
- g_death_test_count++;
-
- GTEST_FLAG_SET(death_test_style, "threadsafe");
- EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
-
- GTEST_FLAG_SET(death_test_style, "fast");
- EXPECT_DEATH_IF_SUPPORTED(::testing::internal::posix::Abort(), "");
-}
-
-int g_param_test_count = 0;
-
-const int kNumberOfParamTests = 10;
-
-class MyParamTest : public testing::TestWithParam<int> {};
-
-TEST_P(MyParamTest, ShouldPass) {
- GTEST_CHECK_INT_EQ_(g_param_test_count % kNumberOfParamTests, GetParam());
- g_param_test_count++;
-}
-INSTANTIATE_TEST_SUITE_P(MyParamSequence,
- MyParamTest,
- testing::Range(0, kNumberOfParamTests));
-
-// Resets the count for each test.
-void ResetCounts() {
- g_environment_set_up_count = 0;
- g_environment_tear_down_count = 0;
- g_should_fail_count = 0;
- g_should_pass_count = 0;
- g_death_test_count = 0;
- g_param_test_count = 0;
-}
-
-// Checks that the count for each test is expected.
-void CheckCounts(int expected) {
- GTEST_CHECK_INT_EQ_(expected, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(expected, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(expected, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(expected, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(expected, g_death_test_count);
- GTEST_CHECK_INT_EQ_(expected * kNumberOfParamTests, g_param_test_count);
-}
-
-// Tests the behavior of Google Test when --gtest_repeat is not specified.
-void TestRepeatUnspecified() {
- ResetCounts();
- GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
- CheckCounts(1);
-}
-
-// Tests the behavior of Google Test when --gtest_repeat has the given value.
-void TestRepeat(int repeat) {
- GTEST_FLAG_SET(repeat, repeat);
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(repeat > 0 ? 1 : 0, RUN_ALL_TESTS());
- CheckCounts(repeat);
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies an empty
-// set of tests.
-void TestRepeatWithEmptyFilter(int repeat) {
- GTEST_FLAG_SET(repeat, repeat);
- GTEST_FLAG_SET(filter, "None");
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
- CheckCounts(0);
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies a set of
-// successful tests.
-void TestRepeatWithFilterForSuccessfulTests(int repeat) {
- GTEST_FLAG_SET(repeat, repeat);
- GTEST_FLAG_SET(filter, "*-*ShouldFail");
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(0, RUN_ALL_TESTS());
- GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(0, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(repeat, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(repeat, g_death_test_count);
- GTEST_CHECK_INT_EQ_(repeat * kNumberOfParamTests, g_param_test_count);
-}
-
-// Tests using --gtest_repeat when --gtest_filter specifies a set of
-// failed tests.
-void TestRepeatWithFilterForFailedTests(int repeat) {
- GTEST_FLAG_SET(repeat, repeat);
- GTEST_FLAG_SET(filter, "*ShouldFail");
-
- ResetCounts();
- GTEST_CHECK_INT_EQ_(1, RUN_ALL_TESTS());
- GTEST_CHECK_INT_EQ_(repeat, g_environment_set_up_count);
- GTEST_CHECK_INT_EQ_(repeat, g_environment_tear_down_count);
- GTEST_CHECK_INT_EQ_(repeat, g_should_fail_count);
- GTEST_CHECK_INT_EQ_(0, g_should_pass_count);
- GTEST_CHECK_INT_EQ_(0, g_death_test_count);
- GTEST_CHECK_INT_EQ_(0, g_param_test_count);
-}
-
-} // namespace
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- testing::AddGlobalTestEnvironment(new MyEnvironment);
-
- TestRepeatUnspecified();
- TestRepeat(0);
- TestRepeat(1);
- TestRepeat(5);
-
- TestRepeatWithEmptyFilter(2);
- TestRepeatWithEmptyFilter(3);
-
- TestRepeatWithFilterForSuccessfulTests(3);
-
- TestRepeatWithFilterForFailedTests(4);
-
- // It would be nice to verify that the tests indeed loop forever
- // when GTEST_FLAG(repeat) is negative, but this test will be quite
- // complicated to write. Since this flag is for interactive
- // debugging only and doesn't affect the normal test result, such a
- // test would be an overkill.
-
- printf("PASS\n");
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_check_output_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_check_output_test.py
deleted file mode 100755
index 1c87b44f01..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_check_output_test.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019 Google LLC. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests Google Test's gtest skip in environment setup behavior.
-
-This script invokes gtest_skip_in_environment_setup_test_ and verifies its
-output.
-"""
-
-import re
-
-from googletest.test import gtest_test_utils
-
-# Path to the gtest_skip_in_environment_setup_test binary
-EXE_PATH = gtest_test_utils.GetTestExecutablePath('gtest_skip_test')
-
-OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
-
-
-# Test.
-class SkipEntireEnvironmentTest(gtest_test_utils.TestCase):
-
- def testSkipEntireEnvironmentTest(self):
- self.assertIn('Skipped\nskipping single test\n', OUTPUT)
- skip_fixture = 'Skipped\nskipping all tests for this fixture\n'
- self.assertIsNotNone(
- re.search(skip_fixture + '.*' + skip_fixture, OUTPUT, flags=re.DOTALL),
- repr(OUTPUT))
- self.assertNotIn('FAILED', OUTPUT)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_environment_check_output_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_environment_check_output_test.py
deleted file mode 100755
index 6960b11a58..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_environment_check_output_test.py
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2019 Google LLC. All Rights Reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Tests Google Test's gtest skip in environment setup behavior.
-
-This script invokes gtest_skip_in_environment_setup_test_ and verifies its
-output.
-"""
-
-from googletest.test import gtest_test_utils
-
-# Path to the gtest_skip_in_environment_setup_test binary
-EXE_PATH = gtest_test_utils.GetTestExecutablePath(
- 'gtest_skip_in_environment_setup_test')
-
-OUTPUT = gtest_test_utils.Subprocess([EXE_PATH]).output
-
-
-# Test.
-class SkipEntireEnvironmentTest(gtest_test_utils.TestCase):
-
- def testSkipEntireEnvironmentTest(self):
- self.assertIn('Skipping the entire environment', OUTPUT)
- self.assertNotIn('FAILED', OUTPUT)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_in_environment_setup_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_in_environment_setup_test.cc
deleted file mode 100644
index 9372310638..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_in_environment_setup_test.cc
+++ /dev/null
@@ -1,49 +0,0 @@
-// Copyright 2019, Google LLC.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google LLC. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// This test verifies that skipping in the environment results in the
-// testcases being skipped.
-
-#include <iostream>
-#include "gtest/gtest.h"
-
-class SetupEnvironment : public testing::Environment {
- public:
- void SetUp() override { GTEST_SKIP() << "Skipping the entire environment"; }
-};
-
-TEST(Test, AlwaysFails) { EXPECT_EQ(true, false); }
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- testing::AddGlobalTestEnvironment(new SetupEnvironment());
-
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_test.cc
deleted file mode 100644
index 4a23004cca..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_skip_test.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-// Copyright 2008 Google Inc.
-// All Rights Reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Author: arseny.aprelev@gmail.com (Arseny Aprelev)
-//
-
-#include "gtest/gtest.h"
-
-using ::testing::Test;
-
-TEST(SkipTest, DoesSkip) {
- GTEST_SKIP() << "skipping single test";
- EXPECT_EQ(0, 1);
-}
-
-class Fixture : public Test {
- protected:
- void SetUp() override {
- GTEST_SKIP() << "skipping all tests for this fixture";
- }
-};
-
-TEST_F(Fixture, SkipsOneTest) {
- EXPECT_EQ(5, 7);
-}
-
-TEST_F(Fixture, SkipsAnotherTest) {
- EXPECT_EQ(99, 100);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_sole_header_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_sole_header_test.cc
deleted file mode 100644
index 1d94ac6b3a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_sole_header_test.cc
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// This test verifies that it's possible to use Google Test by including
-// the gtest.h header file alone.
-
-#include "gtest/gtest.h"
-
-namespace {
-
-void Subroutine() {
- EXPECT_EQ(42, 42);
-}
-
-TEST(NoFatalFailureTest, ExpectNoFatalFailure) {
- EXPECT_NO_FATAL_FAILURE(;);
- EXPECT_NO_FATAL_FAILURE(SUCCEED());
- EXPECT_NO_FATAL_FAILURE(Subroutine());
- EXPECT_NO_FATAL_FAILURE({ SUCCEED(); });
-}
-
-TEST(NoFatalFailureTest, AssertNoFatalFailure) {
- ASSERT_NO_FATAL_FAILURE(;);
- ASSERT_NO_FATAL_FAILURE(SUCCEED());
- ASSERT_NO_FATAL_FAILURE(Subroutine());
- ASSERT_NO_FATAL_FAILURE({ SUCCEED(); });
-}
-
-} // namespace
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_stress_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_stress_test.cc
deleted file mode 100644
index 843481910f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_stress_test.cc
+++ /dev/null
@@ -1,248 +0,0 @@
-// Copyright 2007, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests that SCOPED_TRACE() and various Google Test assertions can be
-// used in a large number of threads concurrently.
-
-#include "gtest/gtest.h"
-
-#include <vector>
-
-#include "src/gtest-internal-inl.h"
-
-#if GTEST_IS_THREADSAFE
-
-namespace testing {
-namespace {
-
-using internal::Notification;
-using internal::TestPropertyKeyIs;
-using internal::ThreadWithParam;
-
-// In order to run tests in this file, for platforms where Google Test is
-// thread safe, implement ThreadWithParam. See the description of its API
-// in gtest-port.h, where it is defined for already supported platforms.
-
-// How many threads to create?
-const int kThreadCount = 50;
-
-std::string IdToKey(int id, const char* suffix) {
- Message key;
- key << "key_" << id << "_" << suffix;
- return key.GetString();
-}
-
-std::string IdToString(int id) {
- Message id_message;
- id_message << id;
- return id_message.GetString();
-}
-
-void ExpectKeyAndValueWereRecordedForId(
- const std::vector<TestProperty>& properties,
- int id, const char* suffix) {
- TestPropertyKeyIs matches_key(IdToKey(id, suffix).c_str());
- const std::vector<TestProperty>::const_iterator property =
- std::find_if(properties.begin(), properties.end(), matches_key);
- ASSERT_TRUE(property != properties.end())
- << "expecting " << suffix << " value for id " << id;
- EXPECT_STREQ(IdToString(id).c_str(), property->value());
-}
-
-// Calls a large number of Google Test assertions, where exactly one of them
-// will fail.
-void ManyAsserts(int id) {
- GTEST_LOG_(INFO) << "Thread #" << id << " running...";
-
- SCOPED_TRACE(Message() << "Thread #" << id);
-
- for (int i = 0; i < kThreadCount; i++) {
- SCOPED_TRACE(Message() << "Iteration #" << i);
-
- // A bunch of assertions that should succeed.
- EXPECT_TRUE(true);
- ASSERT_FALSE(false) << "This shouldn't fail.";
- EXPECT_STREQ("a", "a");
- ASSERT_LE(5, 6);
- EXPECT_EQ(i, i) << "This shouldn't fail.";
-
- // RecordProperty() should interact safely with other threads as well.
- // The shared_key forces property updates.
- Test::RecordProperty(IdToKey(id, "string").c_str(), IdToString(id).c_str());
- Test::RecordProperty(IdToKey(id, "int").c_str(), id);
- Test::RecordProperty("shared_key", IdToString(id).c_str());
-
- // This assertion should fail kThreadCount times per thread. It
- // is for testing whether Google Test can handle failed assertions in a
- // multi-threaded context.
- EXPECT_LT(i, 0) << "This should always fail.";
- }
-}
-
-void CheckTestFailureCount(int expected_failures) {
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult* const result = info->result();
- GTEST_CHECK_(expected_failures == result->total_part_count())
- << "Logged " << result->total_part_count() << " failures "
- << " vs. " << expected_failures << " expected";
-}
-
-// Tests using SCOPED_TRACE() and Google Test assertions in many threads
-// concurrently.
-TEST(StressTest, CanUseScopedTraceAndAssertionsInManyThreads) {
- {
- std::unique_ptr<ThreadWithParam<int> > threads[kThreadCount];
- Notification threads_can_start;
- for (int i = 0; i != kThreadCount; i++)
- threads[i].reset(new ThreadWithParam<int>(&ManyAsserts,
- i,
- &threads_can_start));
-
- threads_can_start.Notify();
-
- // Blocks until all the threads are done.
- for (int i = 0; i != kThreadCount; i++)
- threads[i]->Join();
- }
-
- // Ensures that kThreadCount*kThreadCount failures have been reported.
- const TestInfo* const info = UnitTest::GetInstance()->current_test_info();
- const TestResult* const result = info->result();
-
- std::vector<TestProperty> properties;
- // We have no access to the TestResult's list of properties but we can
- // copy them one by one.
- for (int i = 0; i < result->test_property_count(); ++i)
- properties.push_back(result->GetTestProperty(i));
-
- EXPECT_EQ(kThreadCount * 2 + 1, result->test_property_count())
- << "String and int values recorded on each thread, "
- << "as well as one shared_key";
- for (int i = 0; i < kThreadCount; ++i) {
- ExpectKeyAndValueWereRecordedForId(properties, i, "string");
- ExpectKeyAndValueWereRecordedForId(properties, i, "int");
- }
- CheckTestFailureCount(kThreadCount*kThreadCount);
-}
-
-void FailingThread(bool is_fatal) {
- if (is_fatal)
- FAIL() << "Fatal failure in some other thread. "
- << "(This failure is expected.)";
- else
- ADD_FAILURE() << "Non-fatal failure in some other thread. "
- << "(This failure is expected.)";
-}
-
-void GenerateFatalFailureInAnotherThread(bool is_fatal) {
- ThreadWithParam<bool> thread(&FailingThread, is_fatal, nullptr);
- thread.Join();
-}
-
-TEST(NoFatalFailureTest, ExpectNoFatalFailureIgnoresFailuresInOtherThreads) {
- EXPECT_NO_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true));
- // We should only have one failure (the one from
- // GenerateFatalFailureInAnotherThread()), since the EXPECT_NO_FATAL_FAILURE
- // should succeed.
- CheckTestFailureCount(1);
-}
-
-void AssertNoFatalFailureIgnoresFailuresInOtherThreads() {
- ASSERT_NO_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true));
-}
-TEST(NoFatalFailureTest, AssertNoFatalFailureIgnoresFailuresInOtherThreads) {
- // Using a subroutine, to make sure, that the test continues.
- AssertNoFatalFailureIgnoresFailuresInOtherThreads();
- // We should only have one failure (the one from
- // GenerateFatalFailureInAnotherThread()), since the EXPECT_NO_FATAL_FAILURE
- // should succeed.
- CheckTestFailureCount(1);
-}
-
-TEST(FatalFailureTest, ExpectFatalFailureIgnoresFailuresInOtherThreads) {
- // This statement should fail, since the current thread doesn't generate a
- // fatal failure, only another one does.
- EXPECT_FATAL_FAILURE(GenerateFatalFailureInAnotherThread(true), "expected");
- CheckTestFailureCount(2);
-}
-
-TEST(FatalFailureOnAllThreadsTest, ExpectFatalFailureOnAllThreads) {
- // This statement should succeed, because failures in all threads are
- // considered.
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(
- GenerateFatalFailureInAnotherThread(true), "expected");
- CheckTestFailureCount(0);
- // We need to add a failure, because main() checks that there are failures.
- // But when only this test is run, we shouldn't have any failures.
- ADD_FAILURE() << "This is an expected non-fatal failure.";
-}
-
-TEST(NonFatalFailureTest, ExpectNonFatalFailureIgnoresFailuresInOtherThreads) {
- // This statement should fail, since the current thread doesn't generate a
- // fatal failure, only another one does.
- EXPECT_NONFATAL_FAILURE(GenerateFatalFailureInAnotherThread(false),
- "expected");
- CheckTestFailureCount(2);
-}
-
-TEST(NonFatalFailureOnAllThreadsTest, ExpectNonFatalFailureOnAllThreads) {
- // This statement should succeed, because failures in all threads are
- // considered.
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(
- GenerateFatalFailureInAnotherThread(false), "expected");
- CheckTestFailureCount(0);
- // We need to add a failure, because main() checks that there are failures,
- // But when only this test is run, we shouldn't have any failures.
- ADD_FAILURE() << "This is an expected non-fatal failure.";
-}
-
-} // namespace
-} // namespace testing
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- const int result = RUN_ALL_TESTS(); // Expected to fail.
- GTEST_CHECK_(result == 1) << "RUN_ALL_TESTS() did not fail as expected";
-
- printf("\nPASS\n");
- return 0;
-}
-
-#else
-TEST(StressTest,
- DISABLED_ThreadSafetyTestsAreSkippedWhenGoogleTestIsNotThreadSafe) {
-}
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
- return RUN_ALL_TESTS();
-}
-#endif // GTEST_IS_THREADSAFE
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_macro_stack_footprint_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_macro_stack_footprint_test.cc
deleted file mode 100644
index a48db05012..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_macro_stack_footprint_test.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2013, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Each TEST() expands to some static registration logic. GCC puts all
-// such static initialization logic for a translation unit in a common,
-// internal function. Since Google's build system restricts how much
-// stack space a function can use, there's a limit on how many TEST()s
-// one can put in a single C++ test file. This test ensures that a large
-// number of TEST()s can be defined in the same translation unit.
-
-#include "gtest/gtest.h"
-
-// This macro defines 10 dummy tests.
-#define TEN_TESTS_(test_case_name) \
- TEST(test_case_name, T0) {} \
- TEST(test_case_name, T1) {} \
- TEST(test_case_name, T2) {} \
- TEST(test_case_name, T3) {} \
- TEST(test_case_name, T4) {} \
- TEST(test_case_name, T5) {} \
- TEST(test_case_name, T6) {} \
- TEST(test_case_name, T7) {} \
- TEST(test_case_name, T8) {} \
- TEST(test_case_name, T9) {}
-
-// This macro defines 100 dummy tests.
-#define HUNDRED_TESTS_(test_case_name_prefix) \
- TEN_TESTS_(test_case_name_prefix ## 0) \
- TEN_TESTS_(test_case_name_prefix ## 1) \
- TEN_TESTS_(test_case_name_prefix ## 2) \
- TEN_TESTS_(test_case_name_prefix ## 3) \
- TEN_TESTS_(test_case_name_prefix ## 4) \
- TEN_TESTS_(test_case_name_prefix ## 5) \
- TEN_TESTS_(test_case_name_prefix ## 6) \
- TEN_TESTS_(test_case_name_prefix ## 7) \
- TEN_TESTS_(test_case_name_prefix ## 8) \
- TEN_TESTS_(test_case_name_prefix ## 9)
-
-// This macro defines 1000 dummy tests.
-#define THOUSAND_TESTS_(test_case_name_prefix) \
- HUNDRED_TESTS_(test_case_name_prefix ## 0) \
- HUNDRED_TESTS_(test_case_name_prefix ## 1) \
- HUNDRED_TESTS_(test_case_name_prefix ## 2) \
- HUNDRED_TESTS_(test_case_name_prefix ## 3) \
- HUNDRED_TESTS_(test_case_name_prefix ## 4) \
- HUNDRED_TESTS_(test_case_name_prefix ## 5) \
- HUNDRED_TESTS_(test_case_name_prefix ## 6) \
- HUNDRED_TESTS_(test_case_name_prefix ## 7) \
- HUNDRED_TESTS_(test_case_name_prefix ## 8) \
- HUNDRED_TESTS_(test_case_name_prefix ## 9)
-
-// Ensures that we can define 1000 TEST()s in the same translation
-// unit.
-THOUSAND_TESTS_(T)
-
-int main(int argc, char **argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // We don't actually need to run the dummy tests - the purpose is to
- // ensure that they compile.
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_utils.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_utils.py
deleted file mode 100755
index eecc53346c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_test_utils.py
+++ /dev/null
@@ -1,255 +0,0 @@
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for Google C++ Testing and Mocking Framework."""
-# Suppresses the 'Import not at the top of the file' lint complaint.
-# pylint: disable-msg=C6204
-
-import os
-import subprocess
-import sys
-
-IS_WINDOWS = os.name == 'nt'
-IS_CYGWIN = os.name == 'posix' and 'CYGWIN' in os.uname()[0]
-IS_OS2 = os.name == 'os2'
-
-import atexit
-import shutil
-import tempfile
-import unittest as _test_module
-# pylint: enable-msg=C6204
-
-GTEST_OUTPUT_VAR_NAME = 'GTEST_OUTPUT'
-
-# The environment variable for specifying the path to the premature-exit file.
-PREMATURE_EXIT_FILE_ENV_VAR = 'TEST_PREMATURE_EXIT_FILE'
-
-environ = os.environ.copy()
-
-
-def SetEnvVar(env_var, value):
- """Sets/unsets an environment variable to a given value."""
-
- if value is not None:
- environ[env_var] = value
- elif env_var in environ:
- del environ[env_var]
-
-
-# Here we expose a class from a particular module, depending on the
-# environment. The comment suppresses the 'Invalid variable name' lint
-# complaint.
-TestCase = _test_module.TestCase # pylint: disable=C6409
-
-# Initially maps a flag to its default value. After
-# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
-_flag_map = {'source_dir': os.path.dirname(sys.argv[0]),
- 'build_dir': os.path.dirname(sys.argv[0])}
-_gtest_flags_are_parsed = False
-
-
-def _ParseAndStripGTestFlags(argv):
- """Parses and strips Google Test flags from argv. This is idempotent."""
-
- # Suppresses the lint complaint about a global variable since we need it
- # here to maintain module-wide state.
- global _gtest_flags_are_parsed # pylint: disable=W0603
- if _gtest_flags_are_parsed:
- return
-
- _gtest_flags_are_parsed = True
- for flag in _flag_map:
- # The environment variable overrides the default value.
- if flag.upper() in os.environ:
- _flag_map[flag] = os.environ[flag.upper()]
-
- # The command line flag overrides the environment variable.
- i = 1 # Skips the program name.
- while i < len(argv):
- prefix = '--' + flag + '='
- if argv[i].startswith(prefix):
- _flag_map[flag] = argv[i][len(prefix):]
- del argv[i]
- break
- else:
- # We don't increment i in case we just found a --gtest_* flag
- # and removed it from argv.
- i += 1
-
-
-def GetFlag(flag):
- """Returns the value of the given flag."""
-
- # In case GetFlag() is called before Main(), we always call
- # _ParseAndStripGTestFlags() here to make sure the --gtest_* flags
- # are parsed.
- _ParseAndStripGTestFlags(sys.argv)
-
- return _flag_map[flag]
-
-
-def GetSourceDir():
- """Returns the absolute path of the directory where the .py files are."""
-
- return os.path.abspath(GetFlag('source_dir'))
-
-
-def GetBuildDir():
- """Returns the absolute path of the directory where the test binaries are."""
-
- return os.path.abspath(GetFlag('build_dir'))
-
-
-_temp_dir = None
-
-def _RemoveTempDir():
- if _temp_dir:
- shutil.rmtree(_temp_dir, ignore_errors=True)
-
-atexit.register(_RemoveTempDir)
-
-
-def GetTempDir():
- global _temp_dir
- if not _temp_dir:
- _temp_dir = tempfile.mkdtemp()
- return _temp_dir
-
-
-def GetTestExecutablePath(executable_name, build_dir=None):
- """Returns the absolute path of the test binary given its name.
-
- The function will print a message and abort the program if the resulting file
- doesn't exist.
-
- Args:
- executable_name: name of the test binary that the test script runs.
- build_dir: directory where to look for executables, by default
- the result of GetBuildDir().
-
- Returns:
- The absolute path of the test binary.
- """
-
- path = os.path.abspath(os.path.join(build_dir or GetBuildDir(),
- executable_name))
- if (IS_WINDOWS or IS_CYGWIN or IS_OS2) and not path.endswith('.exe'):
- path += '.exe'
-
- if not os.path.exists(path):
- message = (
- 'Unable to find the test binary "%s". Please make sure to provide\n'
- 'a path to the binary via the --build_dir flag or the BUILD_DIR\n'
- 'environment variable.' % path)
- print(message, file=sys.stderr)
- sys.exit(1)
-
- return path
-
-
-def GetExitStatus(exit_code):
- """Returns the argument to exit(), or -1 if exit() wasn't called.
-
- Args:
- exit_code: the result value of os.system(command).
- """
-
- if os.name == 'nt':
- # On Windows, os.WEXITSTATUS() doesn't work and os.system() returns
- # the argument to exit() directly.
- return exit_code
- else:
- # On Unix, os.WEXITSTATUS() must be used to extract the exit status
- # from the result of os.system().
- if os.WIFEXITED(exit_code):
- return os.WEXITSTATUS(exit_code)
- else:
- return -1
-
-
-class Subprocess:
- def __init__(self, command, working_dir=None, capture_stderr=True, env=None):
- """Changes into a specified directory, if provided, and executes a command.
-
- Restores the old directory afterwards.
-
- Args:
- command: The command to run, in the form of sys.argv.
- working_dir: The directory to change into.
- capture_stderr: Determines whether to capture stderr in the output member
- or to discard it.
- env: Dictionary with environment to pass to the subprocess.
-
- Returns:
- An object that represents outcome of the executed process. It has the
- following attributes:
- terminated_by_signal True if and only if the child process has been
- terminated by a signal.
- exited True if and only if the child process exited
- normally.
- exit_code The code with which the child process exited.
- output Child process's stdout and stderr output
- combined in a string.
- """
-
- if capture_stderr:
- stderr = subprocess.STDOUT
- else:
- stderr = subprocess.PIPE
-
- p = subprocess.Popen(command,
- stdout=subprocess.PIPE, stderr=stderr,
- cwd=working_dir, universal_newlines=True, env=env)
- # communicate returns a tuple with the file object for the child's
- # output.
- self.output = p.communicate()[0]
- self._return_code = p.returncode
-
- if bool(self._return_code & 0x80000000):
- self.terminated_by_signal = True
- self.exited = False
- else:
- self.terminated_by_signal = False
- self.exited = True
- self.exit_code = self._return_code
-
-
-def Main():
- """Runs the unit test."""
-
- # We must call _ParseAndStripGTestFlags() before calling
- # unittest.main(). Otherwise the latter will be confused by the
- # --gtest_* flags.
- _ParseAndStripGTestFlags(sys.argv)
- # The tested binaries should not be writing XML output files unless the
- # script explicitly instructs them to.
- if GTEST_OUTPUT_VAR_NAME in os.environ:
- del os.environ[GTEST_OUTPUT_VAR_NAME]
-
- _test_module.main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test.py
deleted file mode 100755
index 1c2a303a88..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2018 Google LLC. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-"""Verifies that Google Test uses filter provided via testbridge."""
-
-import os
-
-from googletest.test import gtest_test_utils
-
-binary_name = 'gtest_testbridge_test_'
-COMMAND = gtest_test_utils.GetTestExecutablePath(binary_name)
-TESTBRIDGE_NAME = 'TESTBRIDGE_TEST_ONLY'
-
-
-def Assert(condition):
- if not condition:
- raise AssertionError
-
-
-class GTestTestFilterTest(gtest_test_utils.TestCase):
-
- def testTestExecutionIsFiltered(self):
- """Tests that the test filter is picked up from the testbridge env var."""
- subprocess_env = os.environ.copy()
-
- subprocess_env[TESTBRIDGE_NAME] = '*.TestThatSucceeds'
- p = gtest_test_utils.Subprocess(COMMAND, env=subprocess_env)
-
- self.assertEquals(0, p.exit_code)
-
- Assert('filter = *.TestThatSucceeds' in p.output)
- Assert('[ OK ] TestFilterTest.TestThatSucceeds' in p.output)
- Assert('[ PASSED ] 1 test.' in p.output)
-
-
-if __name__ == '__main__':
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test_.cc
deleted file mode 100644
index 24617b209e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_testbridge_test_.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2018, Google LLC.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// This program is meant to be run by gtest_test_filter_test.py. Do not run
-// it directly.
-
-#include "gtest/gtest.h"
-
-// These tests are used to detect if filtering is working. Only
-// 'TestThatSucceeds' should ever run.
-
-TEST(TestFilterTest, TestThatSucceeds) {}
-
-TEST(TestFilterTest, TestThatFails) {
- ASSERT_TRUE(false) << "This test should never be run.";
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_throw_on_failure_ex_test.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_throw_on_failure_ex_test.cc
deleted file mode 100644
index aeead13feb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_throw_on_failure_ex_test.cc
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2009, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-
-// Tests Google Test's throw-on-failure mode with exceptions enabled.
-
-#include "gtest/gtest.h"
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdexcept>
-
-// Prints the given failure message and exits the program with
-// non-zero. We use this instead of a Google Test assertion to
-// indicate a failure, as the latter is been tested and cannot be
-// relied on.
-void Fail(const char* msg) {
- printf("FAILURE: %s\n", msg);
- fflush(stdout);
- exit(1);
-}
-
-// Tests that an assertion failure throws a subclass of
-// std::runtime_error.
-void TestFailureThrowsRuntimeError() {
- GTEST_FLAG_SET(throw_on_failure, true);
-
- // A successful assertion shouldn't throw.
- try {
- EXPECT_EQ(3, 3);
- } catch(...) {
- Fail("A successful assertion wrongfully threw.");
- }
-
- // A failed assertion should throw a subclass of std::runtime_error.
- try {
- EXPECT_EQ(2, 3) << "Expected failure";
- } catch(const std::runtime_error& e) {
- if (strstr(e.what(), "Expected failure") != nullptr) return;
-
- printf("%s",
- "A failed assertion did throw an exception of the right type, "
- "but the message is incorrect. Instead of containing \"Expected "
- "failure\", it is:\n");
- Fail(e.what());
- } catch(...) {
- Fail("A failed assertion threw the wrong type of exception.");
- }
- Fail("A failed assertion should've thrown but didn't.");
-}
-
-int main(int argc, char** argv) {
- testing::InitGoogleTest(&argc, argv);
-
- // We want to ensure that people can use Google Test assertions in
- // other testing frameworks, as long as they initialize Google Test
- // properly and set the thrown-on-failure mode. Therefore, we don't
- // use Google Test's constructs for defining and running tests
- // (e.g. TEST and RUN_ALL_TESTS) here.
-
- TestFailureThrowsRuntimeError();
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_unittest.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_unittest.cc
deleted file mode 100644
index f70ca695bb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_unittest.cc
+++ /dev/null
@@ -1,7833 +0,0 @@
-// Copyright 2005, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// Tests for Google Test itself. This verifies that the basic constructs of
-// Google Test work.
-
-#include "gtest/gtest.h"
-
-// Verifies that the command line flag variables can be accessed in
-// code once "gtest.h" has been #included.
-// Do not move it after other gtest #includes.
-TEST(CommandLineFlagsTest, CanBeAccessedInCodeOnceGTestHIsIncluded) {
- bool dummy =
- GTEST_FLAG_GET(also_run_disabled_tests) ||
- GTEST_FLAG_GET(break_on_failure) || GTEST_FLAG_GET(catch_exceptions) ||
- GTEST_FLAG_GET(color) != "unknown" || GTEST_FLAG_GET(fail_fast) ||
- GTEST_FLAG_GET(filter) != "unknown" || GTEST_FLAG_GET(list_tests) ||
- GTEST_FLAG_GET(output) != "unknown" || GTEST_FLAG_GET(brief) ||
- GTEST_FLAG_GET(print_time) || GTEST_FLAG_GET(random_seed) ||
- GTEST_FLAG_GET(repeat) > 0 ||
- GTEST_FLAG_GET(recreate_environments_when_repeating) ||
- GTEST_FLAG_GET(show_internal_stack_frames) || GTEST_FLAG_GET(shuffle) ||
- GTEST_FLAG_GET(stack_trace_depth) > 0 ||
- GTEST_FLAG_GET(stream_result_to) != "unknown" ||
- GTEST_FLAG_GET(throw_on_failure);
- EXPECT_TRUE(dummy || !dummy); // Suppresses warning that dummy is unused.
-}
-
-#include <limits.h> // For INT_MAX.
-#include <stdlib.h>
-#include <string.h>
-#include <time.h>
-
-#include <cstdint>
-#include <map>
-#include <ostream>
-#include <string>
-#include <type_traits>
-#include <unordered_set>
-#include <vector>
-
-#include "gtest/gtest-spi.h"
-#include "src/gtest-internal-inl.h"
-
-namespace testing {
-namespace internal {
-
-#if GTEST_CAN_STREAM_RESULTS_
-
-class StreamingListenerTest : public Test {
- public:
- class FakeSocketWriter : public StreamingListener::AbstractSocketWriter {
- public:
- // Sends a string to the socket.
- void Send(const std::string& message) override { output_ += message; }
-
- std::string output_;
- };
-
- StreamingListenerTest()
- : fake_sock_writer_(new FakeSocketWriter),
- streamer_(fake_sock_writer_),
- test_info_obj_("FooTest", "Bar", nullptr, nullptr,
- CodeLocation(__FILE__, __LINE__), nullptr, nullptr) {}
-
- protected:
- std::string* output() { return &(fake_sock_writer_->output_); }
-
- FakeSocketWriter* const fake_sock_writer_;
- StreamingListener streamer_;
- UnitTest unit_test_;
- TestInfo test_info_obj_; // The name test_info_ was taken by testing::Test.
-};
-
-TEST_F(StreamingListenerTest, OnTestProgramEnd) {
- *output() = "";
- streamer_.OnTestProgramEnd(unit_test_);
- EXPECT_EQ("event=TestProgramEnd&passed=1\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestIterationEnd) {
- *output() = "";
- streamer_.OnTestIterationEnd(unit_test_, 42);
- EXPECT_EQ("event=TestIterationEnd&passed=1&elapsed_time=0ms\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestCaseStart) {
- *output() = "";
- streamer_.OnTestCaseStart(TestCase("FooTest", "Bar", nullptr, nullptr));
- EXPECT_EQ("event=TestCaseStart&name=FooTest\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestCaseEnd) {
- *output() = "";
- streamer_.OnTestCaseEnd(TestCase("FooTest", "Bar", nullptr, nullptr));
- EXPECT_EQ("event=TestCaseEnd&passed=1&elapsed_time=0ms\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestStart) {
- *output() = "";
- streamer_.OnTestStart(test_info_obj_);
- EXPECT_EQ("event=TestStart&name=Bar\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestEnd) {
- *output() = "";
- streamer_.OnTestEnd(test_info_obj_);
- EXPECT_EQ("event=TestEnd&passed=1&elapsed_time=0ms\n", *output());
-}
-
-TEST_F(StreamingListenerTest, OnTestPartResult) {
- *output() = "";
- streamer_.OnTestPartResult(TestPartResult(
- TestPartResult::kFatalFailure, "foo.cc", 42, "failed=\n&%"));
-
- // Meta characters in the failure message should be properly escaped.
- EXPECT_EQ(
- "event=TestPartResult&file=foo.cc&line=42&message=failed%3D%0A%26%25\n",
- *output());
-}
-
-#endif // GTEST_CAN_STREAM_RESULTS_
-
-// Provides access to otherwise private parts of the TestEventListeners class
-// that are needed to test it.
-class TestEventListenersAccessor {
- public:
- static TestEventListener* GetRepeater(TestEventListeners* listeners) {
- return listeners->repeater();
- }
-
- static void SetDefaultResultPrinter(TestEventListeners* listeners,
- TestEventListener* listener) {
- listeners->SetDefaultResultPrinter(listener);
- }
- static void SetDefaultXmlGenerator(TestEventListeners* listeners,
- TestEventListener* listener) {
- listeners->SetDefaultXmlGenerator(listener);
- }
-
- static bool EventForwardingEnabled(const TestEventListeners& listeners) {
- return listeners.EventForwardingEnabled();
- }
-
- static void SuppressEventForwarding(TestEventListeners* listeners) {
- listeners->SuppressEventForwarding();
- }
-};
-
-class UnitTestRecordPropertyTestHelper : public Test {
- protected:
- UnitTestRecordPropertyTestHelper() {}
-
- // Forwards to UnitTest::RecordProperty() to bypass access controls.
- void UnitTestRecordProperty(const char* key, const std::string& value) {
- unit_test_.RecordProperty(key, value);
- }
-
- UnitTest unit_test_;
-};
-
-} // namespace internal
-} // namespace testing
-
-using testing::AssertionFailure;
-using testing::AssertionResult;
-using testing::AssertionSuccess;
-using testing::DoubleLE;
-using testing::EmptyTestEventListener;
-using testing::Environment;
-using testing::FloatLE;
-using testing::IsNotSubstring;
-using testing::IsSubstring;
-using testing::kMaxStackTraceDepth;
-using testing::Message;
-using testing::ScopedFakeTestPartResultReporter;
-using testing::StaticAssertTypeEq;
-using testing::Test;
-using testing::TestEventListeners;
-using testing::TestInfo;
-using testing::TestPartResult;
-using testing::TestPartResultArray;
-using testing::TestProperty;
-using testing::TestResult;
-using testing::TestSuite;
-using testing::TimeInMillis;
-using testing::UnitTest;
-using testing::internal::AlwaysFalse;
-using testing::internal::AlwaysTrue;
-using testing::internal::AppendUserMessage;
-using testing::internal::ArrayAwareFind;
-using testing::internal::ArrayEq;
-using testing::internal::CodePointToUtf8;
-using testing::internal::CopyArray;
-using testing::internal::CountIf;
-using testing::internal::EqFailure;
-using testing::internal::FloatingPoint;
-using testing::internal::ForEach;
-using testing::internal::FormatEpochTimeInMillisAsIso8601;
-using testing::internal::FormatTimeInMillisAsSeconds;
-using testing::internal::GetCurrentOsStackTraceExceptTop;
-using testing::internal::GetElementOr;
-using testing::internal::GetNextRandomSeed;
-using testing::internal::GetRandomSeedFromFlag;
-using testing::internal::GetTestTypeId;
-using testing::internal::GetTimeInMillis;
-using testing::internal::GetTypeId;
-using testing::internal::GetUnitTestImpl;
-using testing::internal::GTestFlagSaver;
-using testing::internal::HasDebugStringAndShortDebugString;
-using testing::internal::Int32FromEnvOrDie;
-using testing::internal::IsContainer;
-using testing::internal::IsContainerTest;
-using testing::internal::IsNotContainer;
-using testing::internal::kMaxRandomSeed;
-using testing::internal::kTestTypeIdInGoogleTest;
-using testing::internal::NativeArray;
-using testing::internal::OsStackTraceGetter;
-using testing::internal::OsStackTraceGetterInterface;
-using testing::internal::ParseFlag;
-using testing::internal::RelationToSourceCopy;
-using testing::internal::RelationToSourceReference;
-using testing::internal::ShouldRunTestOnShard;
-using testing::internal::ShouldShard;
-using testing::internal::ShouldUseColor;
-using testing::internal::Shuffle;
-using testing::internal::ShuffleRange;
-using testing::internal::SkipPrefix;
-using testing::internal::StreamableToString;
-using testing::internal::String;
-using testing::internal::TestEventListenersAccessor;
-using testing::internal::TestResultAccessor;
-using testing::internal::UnitTestImpl;
-using testing::internal::WideStringToUtf8;
-using testing::internal::edit_distance::CalculateOptimalEdits;
-using testing::internal::edit_distance::CreateUnifiedDiff;
-using testing::internal::edit_distance::EditType;
-
-#if GTEST_HAS_STREAM_REDIRECTION
-using testing::internal::CaptureStdout;
-using testing::internal::GetCapturedStdout;
-#endif
-
-#if GTEST_IS_THREADSAFE
-using testing::internal::ThreadWithParam;
-#endif
-
-class TestingVector : public std::vector<int> {
-};
-
-::std::ostream& operator<<(::std::ostream& os,
- const TestingVector& vector) {
- os << "{ ";
- for (size_t i = 0; i < vector.size(); i++) {
- os << vector[i] << " ";
- }
- os << "}";
- return os;
-}
-
-// This line tests that we can define tests in an unnamed namespace.
-namespace {
-
-TEST(GetRandomSeedFromFlagTest, HandlesZero) {
- const int seed = GetRandomSeedFromFlag(0);
- EXPECT_LE(1, seed);
- EXPECT_LE(seed, static_cast<int>(kMaxRandomSeed));
-}
-
-TEST(GetRandomSeedFromFlagTest, PreservesValidSeed) {
- EXPECT_EQ(1, GetRandomSeedFromFlag(1));
- EXPECT_EQ(2, GetRandomSeedFromFlag(2));
- EXPECT_EQ(kMaxRandomSeed - 1, GetRandomSeedFromFlag(kMaxRandomSeed - 1));
- EXPECT_EQ(static_cast<int>(kMaxRandomSeed),
- GetRandomSeedFromFlag(kMaxRandomSeed));
-}
-
-TEST(GetRandomSeedFromFlagTest, NormalizesInvalidSeed) {
- const int seed1 = GetRandomSeedFromFlag(-1);
- EXPECT_LE(1, seed1);
- EXPECT_LE(seed1, static_cast<int>(kMaxRandomSeed));
-
- const int seed2 = GetRandomSeedFromFlag(kMaxRandomSeed + 1);
- EXPECT_LE(1, seed2);
- EXPECT_LE(seed2, static_cast<int>(kMaxRandomSeed));
-}
-
-TEST(GetNextRandomSeedTest, WorksForValidInput) {
- EXPECT_EQ(2, GetNextRandomSeed(1));
- EXPECT_EQ(3, GetNextRandomSeed(2));
- EXPECT_EQ(static_cast<int>(kMaxRandomSeed),
- GetNextRandomSeed(kMaxRandomSeed - 1));
- EXPECT_EQ(1, GetNextRandomSeed(kMaxRandomSeed));
-
- // We deliberately don't test GetNextRandomSeed() with invalid
- // inputs, as that requires death tests, which are expensive. This
- // is fine as GetNextRandomSeed() is internal and has a
- // straightforward definition.
-}
-
-static void ClearCurrentTestPartResults() {
- TestResultAccessor::ClearTestPartResults(
- GetUnitTestImpl()->current_test_result());
-}
-
-// Tests GetTypeId.
-
-TEST(GetTypeIdTest, ReturnsSameValueForSameType) {
- EXPECT_EQ(GetTypeId<int>(), GetTypeId<int>());
- EXPECT_EQ(GetTypeId<Test>(), GetTypeId<Test>());
-}
-
-class SubClassOfTest : public Test {};
-class AnotherSubClassOfTest : public Test {};
-
-TEST(GetTypeIdTest, ReturnsDifferentValuesForDifferentTypes) {
- EXPECT_NE(GetTypeId<int>(), GetTypeId<const int>());
- EXPECT_NE(GetTypeId<int>(), GetTypeId<char>());
- EXPECT_NE(GetTypeId<int>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<SubClassOfTest>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<AnotherSubClassOfTest>(), GetTestTypeId());
- EXPECT_NE(GetTypeId<AnotherSubClassOfTest>(), GetTypeId<SubClassOfTest>());
-}
-
-// Verifies that GetTestTypeId() returns the same value, no matter it
-// is called from inside Google Test or outside of it.
-TEST(GetTestTypeIdTest, ReturnsTheSameValueInsideOrOutsideOfGoogleTest) {
- EXPECT_EQ(kTestTypeIdInGoogleTest, GetTestTypeId());
-}
-
-// Tests CanonicalizeForStdLibVersioning.
-
-using ::testing::internal::CanonicalizeForStdLibVersioning;
-
-TEST(CanonicalizeForStdLibVersioning, LeavesUnversionedNamesUnchanged) {
- EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::bind"));
- EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::_"));
- EXPECT_EQ("std::__foo", CanonicalizeForStdLibVersioning("std::__foo"));
- EXPECT_EQ("gtl::__1::x", CanonicalizeForStdLibVersioning("gtl::__1::x"));
- EXPECT_EQ("__1::x", CanonicalizeForStdLibVersioning("__1::x"));
- EXPECT_EQ("::__1::x", CanonicalizeForStdLibVersioning("::__1::x"));
-}
-
-TEST(CanonicalizeForStdLibVersioning, ElidesDoubleUnderNames) {
- EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__1::bind"));
- EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__1::_"));
-
- EXPECT_EQ("std::bind", CanonicalizeForStdLibVersioning("std::__g::bind"));
- EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__g::_"));
-
- EXPECT_EQ("std::bind",
- CanonicalizeForStdLibVersioning("std::__google::bind"));
- EXPECT_EQ("std::_", CanonicalizeForStdLibVersioning("std::__google::_"));
-}
-
-// Tests FormatTimeInMillisAsSeconds().
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsZero) {
- EXPECT_EQ("0", FormatTimeInMillisAsSeconds(0));
-}
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsPositiveNumber) {
- EXPECT_EQ("0.003", FormatTimeInMillisAsSeconds(3));
- EXPECT_EQ("0.01", FormatTimeInMillisAsSeconds(10));
- EXPECT_EQ("0.2", FormatTimeInMillisAsSeconds(200));
- EXPECT_EQ("1.2", FormatTimeInMillisAsSeconds(1200));
- EXPECT_EQ("3", FormatTimeInMillisAsSeconds(3000));
-}
-
-TEST(FormatTimeInMillisAsSecondsTest, FormatsNegativeNumber) {
- EXPECT_EQ("-0.003", FormatTimeInMillisAsSeconds(-3));
- EXPECT_EQ("-0.01", FormatTimeInMillisAsSeconds(-10));
- EXPECT_EQ("-0.2", FormatTimeInMillisAsSeconds(-200));
- EXPECT_EQ("-1.2", FormatTimeInMillisAsSeconds(-1200));
- EXPECT_EQ("-3", FormatTimeInMillisAsSeconds(-3000));
-}
-
-// Tests FormatEpochTimeInMillisAsIso8601(). The correctness of conversion
-// for particular dates below was verified in Python using
-// datetime.datetime.fromutctimestamp(<timestamp>/1000).
-
-// FormatEpochTimeInMillisAsIso8601 depends on the current timezone, so we
-// have to set up a particular timezone to obtain predictable results.
-class FormatEpochTimeInMillisAsIso8601Test : public Test {
- public:
- // On Cygwin, GCC doesn't allow unqualified integer literals to exceed
- // 32 bits, even when 64-bit integer types are available. We have to
- // force the constants to have a 64-bit type here.
- static const TimeInMillis kMillisPerSec = 1000;
-
- private:
- void SetUp() override {
- saved_tz_ = nullptr;
-
- GTEST_DISABLE_MSC_DEPRECATED_PUSH_(/* getenv, strdup: deprecated */)
- if (getenv("TZ"))
- saved_tz_ = strdup(getenv("TZ"));
- GTEST_DISABLE_MSC_DEPRECATED_POP_()
-
- // Set up the time zone for FormatEpochTimeInMillisAsIso8601 to use. We
- // cannot use the local time zone because the function's output depends
- // on the time zone.
- SetTimeZone("UTC+00");
- }
-
- void TearDown() override {
- SetTimeZone(saved_tz_);
- free(const_cast<char*>(saved_tz_));
- saved_tz_ = nullptr;
- }
-
- static void SetTimeZone(const char* time_zone) {
- // tzset() distinguishes between the TZ variable being present and empty
- // and not being present, so we have to consider the case of time_zone
- // being NULL.
-#if _MSC_VER || GTEST_OS_WINDOWS_MINGW
- // ...Unless it's MSVC, whose standard library's _putenv doesn't
- // distinguish between an empty and a missing variable.
- const std::string env_var =
- std::string("TZ=") + (time_zone ? time_zone : "");
- _putenv(env_var.c_str());
- GTEST_DISABLE_MSC_WARNINGS_PUSH_(4996 /* deprecated function */)
- tzset();
- GTEST_DISABLE_MSC_WARNINGS_POP_()
-#else
-#if GTEST_OS_LINUX_ANDROID && __ANDROID_API__ < 21
- // Work around KitKat bug in tzset by setting "UTC" before setting "UTC+00".
- // See https://github.com/android/ndk/issues/1604.
- setenv("TZ", "UTC", 1);
- tzset();
-#endif
- if (time_zone) {
- setenv(("TZ"), time_zone, 1);
- } else {
- unsetenv("TZ");
- }
- tzset();
-#endif
- }
-
- const char* saved_tz_;
-};
-
-const TimeInMillis FormatEpochTimeInMillisAsIso8601Test::kMillisPerSec;
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsTwoDigitSegments) {
- EXPECT_EQ("2011-10-31T18:52:42.000",
- FormatEpochTimeInMillisAsIso8601(1320087162 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, IncludesMillisecondsAfterDot) {
- EXPECT_EQ(
- "2011-10-31T18:52:42.234",
- FormatEpochTimeInMillisAsIso8601(1320087162 * kMillisPerSec + 234));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsLeadingZeroes) {
- EXPECT_EQ("2011-09-03T05:07:02.000",
- FormatEpochTimeInMillisAsIso8601(1315026422 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, Prints24HourTime) {
- EXPECT_EQ("2011-09-28T17:08:22.000",
- FormatEpochTimeInMillisAsIso8601(1317229702 * kMillisPerSec));
-}
-
-TEST_F(FormatEpochTimeInMillisAsIso8601Test, PrintsEpochStart) {
- EXPECT_EQ("1970-01-01T00:00:00.000", FormatEpochTimeInMillisAsIso8601(0));
-}
-
-# ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-# endif
-
-// Tests that the LHS of EXPECT_EQ or ASSERT_EQ can be used as a null literal
-// when the RHS is a pointer type.
-TEST(NullLiteralTest, LHSAllowsNullLiterals) {
- EXPECT_EQ(0, static_cast<void*>(nullptr)); // NOLINT
- ASSERT_EQ(0, static_cast<void*>(nullptr)); // NOLINT
- EXPECT_EQ(NULL, static_cast<void*>(nullptr)); // NOLINT
- ASSERT_EQ(NULL, static_cast<void*>(nullptr)); // NOLINT
- EXPECT_EQ(nullptr, static_cast<void*>(nullptr));
- ASSERT_EQ(nullptr, static_cast<void*>(nullptr));
-
- const int* const p = nullptr;
- EXPECT_EQ(0, p); // NOLINT
- ASSERT_EQ(0, p); // NOLINT
- EXPECT_EQ(NULL, p); // NOLINT
- ASSERT_EQ(NULL, p); // NOLINT
- EXPECT_EQ(nullptr, p);
- ASSERT_EQ(nullptr, p);
-}
-
-struct ConvertToAll {
- template <typename T>
- operator T() const { // NOLINT
- return T();
- }
-};
-
-struct ConvertToPointer {
- template <class T>
- operator T*() const { // NOLINT
- return nullptr;
- }
-};
-
-struct ConvertToAllButNoPointers {
- template <typename T,
- typename std::enable_if<!std::is_pointer<T>::value, int>::type = 0>
- operator T() const { // NOLINT
- return T();
- }
-};
-
-struct MyType {};
-inline bool operator==(MyType const&, MyType const&) { return true; }
-
-TEST(NullLiteralTest, ImplicitConversion) {
- EXPECT_EQ(ConvertToPointer{}, static_cast<void*>(nullptr));
-#if !defined(__GNUC__) || defined(__clang__)
- // Disabled due to GCC bug gcc.gnu.org/PR89580
- EXPECT_EQ(ConvertToAll{}, static_cast<void*>(nullptr));
-#endif
- EXPECT_EQ(ConvertToAll{}, MyType{});
- EXPECT_EQ(ConvertToAllButNoPointers{}, MyType{});
-}
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#if __has_warning("-Wzero-as-null-pointer-constant")
-#pragma clang diagnostic error "-Wzero-as-null-pointer-constant"
-#endif
-#endif
-
-TEST(NullLiteralTest, NoConversionNoWarning) {
- // Test that gtests detection and handling of null pointer constants
- // doesn't trigger a warning when '0' isn't actually used as null.
- EXPECT_EQ(0, 0);
- ASSERT_EQ(0, 0);
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-# ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them.
-# pragma option pop
-# endif
-
-//
-// Tests CodePointToUtf8().
-
-// Tests that the NUL character L'\0' is encoded correctly.
-TEST(CodePointToUtf8Test, CanEncodeNul) {
- EXPECT_EQ("", CodePointToUtf8(L'\0'));
-}
-
-// Tests that ASCII characters are encoded correctly.
-TEST(CodePointToUtf8Test, CanEncodeAscii) {
- EXPECT_EQ("a", CodePointToUtf8(L'a'));
- EXPECT_EQ("Z", CodePointToUtf8(L'Z'));
- EXPECT_EQ("&", CodePointToUtf8(L'&'));
- EXPECT_EQ("\x7F", CodePointToUtf8(L'\x7F'));
-}
-
-// Tests that Unicode code-points that have 8 to 11 bits are encoded
-// as 110xxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode8To11Bits) {
- // 000 1101 0011 => 110-00011 10-010011
- EXPECT_EQ("\xC3\x93", CodePointToUtf8(L'\xD3'));
-
- // 101 0111 0110 => 110-10101 10-110110
- // Some compilers (e.g., GCC on MinGW) cannot handle non-ASCII codepoints
- // in wide strings and wide chars. In order to accommodate them, we have to
- // introduce such character constants as integers.
- EXPECT_EQ("\xD5\xB6",
- CodePointToUtf8(static_cast<wchar_t>(0x576)));
-}
-
-// Tests that Unicode code-points that have 12 to 16 bits are encoded
-// as 1110xxxx 10xxxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode12To16Bits) {
- // 0000 1000 1101 0011 => 1110-0000 10-100011 10-010011
- EXPECT_EQ("\xE0\xA3\x93",
- CodePointToUtf8(static_cast<wchar_t>(0x8D3)));
-
- // 1100 0111 0100 1101 => 1110-1100 10-011101 10-001101
- EXPECT_EQ("\xEC\x9D\x8D",
- CodePointToUtf8(static_cast<wchar_t>(0xC74D)));
-}
-
-#if !GTEST_WIDE_STRING_USES_UTF16_
-// Tests in this group require a wchar_t to hold > 16 bits, and thus
-// are skipped on Windows, and Cygwin, where a wchar_t is
-// 16-bit wide. This code may not compile on those systems.
-
-// Tests that Unicode code-points that have 17 to 21 bits are encoded
-// as 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx.
-TEST(CodePointToUtf8Test, CanEncode17To21Bits) {
- // 0 0001 0000 1000 1101 0011 => 11110-000 10-010000 10-100011 10-010011
- EXPECT_EQ("\xF0\x90\xA3\x93", CodePointToUtf8(L'\x108D3'));
-
- // 0 0001 0000 0100 0000 0000 => 11110-000 10-010000 10-010000 10-000000
- EXPECT_EQ("\xF0\x90\x90\x80", CodePointToUtf8(L'\x10400'));
-
- // 1 0000 1000 0110 0011 0100 => 11110-100 10-001000 10-011000 10-110100
- EXPECT_EQ("\xF4\x88\x98\xB4", CodePointToUtf8(L'\x108634'));
-}
-
-// Tests that encoding an invalid code-point generates the expected result.
-TEST(CodePointToUtf8Test, CanEncodeInvalidCodePoint) {
- EXPECT_EQ("(Invalid Unicode 0x1234ABCD)", CodePointToUtf8(L'\x1234ABCD'));
-}
-
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests WideStringToUtf8().
-
-// Tests that the NUL character L'\0' is encoded correctly.
-TEST(WideStringToUtf8Test, CanEncodeNul) {
- EXPECT_STREQ("", WideStringToUtf8(L"", 0).c_str());
- EXPECT_STREQ("", WideStringToUtf8(L"", -1).c_str());
-}
-
-// Tests that ASCII strings are encoded correctly.
-TEST(WideStringToUtf8Test, CanEncodeAscii) {
- EXPECT_STREQ("a", WideStringToUtf8(L"a", 1).c_str());
- EXPECT_STREQ("ab", WideStringToUtf8(L"ab", 2).c_str());
- EXPECT_STREQ("a", WideStringToUtf8(L"a", -1).c_str());
- EXPECT_STREQ("ab", WideStringToUtf8(L"ab", -1).c_str());
-}
-
-// Tests that Unicode code-points that have 8 to 11 bits are encoded
-// as 110xxxxx 10xxxxxx.
-TEST(WideStringToUtf8Test, CanEncode8To11Bits) {
- // 000 1101 0011 => 110-00011 10-010011
- EXPECT_STREQ("\xC3\x93", WideStringToUtf8(L"\xD3", 1).c_str());
- EXPECT_STREQ("\xC3\x93", WideStringToUtf8(L"\xD3", -1).c_str());
-
- // 101 0111 0110 => 110-10101 10-110110
- const wchar_t s[] = { 0x576, '\0' };
- EXPECT_STREQ("\xD5\xB6", WideStringToUtf8(s, 1).c_str());
- EXPECT_STREQ("\xD5\xB6", WideStringToUtf8(s, -1).c_str());
-}
-
-// Tests that Unicode code-points that have 12 to 16 bits are encoded
-// as 1110xxxx 10xxxxxx 10xxxxxx.
-TEST(WideStringToUtf8Test, CanEncode12To16Bits) {
- // 0000 1000 1101 0011 => 1110-0000 10-100011 10-010011
- const wchar_t s1[] = { 0x8D3, '\0' };
- EXPECT_STREQ("\xE0\xA3\x93", WideStringToUtf8(s1, 1).c_str());
- EXPECT_STREQ("\xE0\xA3\x93", WideStringToUtf8(s1, -1).c_str());
-
- // 1100 0111 0100 1101 => 1110-1100 10-011101 10-001101
- const wchar_t s2[] = { 0xC74D, '\0' };
- EXPECT_STREQ("\xEC\x9D\x8D", WideStringToUtf8(s2, 1).c_str());
- EXPECT_STREQ("\xEC\x9D\x8D", WideStringToUtf8(s2, -1).c_str());
-}
-
-// Tests that the conversion stops when the function encounters \0 character.
-TEST(WideStringToUtf8Test, StopsOnNulCharacter) {
- EXPECT_STREQ("ABC", WideStringToUtf8(L"ABC\0XYZ", 100).c_str());
-}
-
-// Tests that the conversion stops when the function reaches the limit
-// specified by the 'length' parameter.
-TEST(WideStringToUtf8Test, StopsWhenLengthLimitReached) {
- EXPECT_STREQ("ABC", WideStringToUtf8(L"ABCDEF", 3).c_str());
-}
-
-#if !GTEST_WIDE_STRING_USES_UTF16_
-// Tests that Unicode code-points that have 17 to 21 bits are encoded
-// as 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx. This code may not compile
-// on the systems using UTF-16 encoding.
-TEST(WideStringToUtf8Test, CanEncode17To21Bits) {
- // 0 0001 0000 1000 1101 0011 => 11110-000 10-010000 10-100011 10-010011
- EXPECT_STREQ("\xF0\x90\xA3\x93", WideStringToUtf8(L"\x108D3", 1).c_str());
- EXPECT_STREQ("\xF0\x90\xA3\x93", WideStringToUtf8(L"\x108D3", -1).c_str());
-
- // 1 0000 1000 0110 0011 0100 => 11110-100 10-001000 10-011000 10-110100
- EXPECT_STREQ("\xF4\x88\x98\xB4", WideStringToUtf8(L"\x108634", 1).c_str());
- EXPECT_STREQ("\xF4\x88\x98\xB4", WideStringToUtf8(L"\x108634", -1).c_str());
-}
-
-// Tests that encoding an invalid code-point generates the expected result.
-TEST(WideStringToUtf8Test, CanEncodeInvalidCodePoint) {
- EXPECT_STREQ("(Invalid Unicode 0xABCDFF)",
- WideStringToUtf8(L"\xABCDFF", -1).c_str());
-}
-#else // !GTEST_WIDE_STRING_USES_UTF16_
-// Tests that surrogate pairs are encoded correctly on the systems using
-// UTF-16 encoding in the wide strings.
-TEST(WideStringToUtf8Test, CanEncodeValidUtf16SUrrogatePairs) {
- const wchar_t s[] = { 0xD801, 0xDC00, '\0' };
- EXPECT_STREQ("\xF0\x90\x90\x80", WideStringToUtf8(s, -1).c_str());
-}
-
-// Tests that encoding an invalid UTF-16 surrogate pair
-// generates the expected result.
-TEST(WideStringToUtf8Test, CanEncodeInvalidUtf16SurrogatePair) {
- // Leading surrogate is at the end of the string.
- const wchar_t s1[] = { 0xD800, '\0' };
- EXPECT_STREQ("\xED\xA0\x80", WideStringToUtf8(s1, -1).c_str());
- // Leading surrogate is not followed by the trailing surrogate.
- const wchar_t s2[] = { 0xD800, 'M', '\0' };
- EXPECT_STREQ("\xED\xA0\x80M", WideStringToUtf8(s2, -1).c_str());
- // Trailing surrogate appearas without a leading surrogate.
- const wchar_t s3[] = { 0xDC00, 'P', 'Q', 'R', '\0' };
- EXPECT_STREQ("\xED\xB0\x80PQR", WideStringToUtf8(s3, -1).c_str());
-}
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests that codepoint concatenation works correctly.
-#if !GTEST_WIDE_STRING_USES_UTF16_
-TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
- const wchar_t s[] = { 0x108634, 0xC74D, '\n', 0x576, 0x8D3, 0x108634, '\0'};
- EXPECT_STREQ(
- "\xF4\x88\x98\xB4"
- "\xEC\x9D\x8D"
- "\n"
- "\xD5\xB6"
- "\xE0\xA3\x93"
- "\xF4\x88\x98\xB4",
- WideStringToUtf8(s, -1).c_str());
-}
-#else
-TEST(WideStringToUtf8Test, ConcatenatesCodepointsCorrectly) {
- const wchar_t s[] = { 0xC74D, '\n', 0x576, 0x8D3, '\0'};
- EXPECT_STREQ(
- "\xEC\x9D\x8D" "\n" "\xD5\xB6" "\xE0\xA3\x93",
- WideStringToUtf8(s, -1).c_str());
-}
-#endif // !GTEST_WIDE_STRING_USES_UTF16_
-
-// Tests the Random class.
-
-TEST(RandomDeathTest, GeneratesCrashesOnInvalidRange) {
- testing::internal::Random random(42);
- EXPECT_DEATH_IF_SUPPORTED(
- random.Generate(0),
- "Cannot generate a number in the range \\[0, 0\\)");
- EXPECT_DEATH_IF_SUPPORTED(
- random.Generate(testing::internal::Random::kMaxRange + 1),
- "Generation of a number in \\[0, 2147483649\\) was requested, "
- "but this can only generate numbers in \\[0, 2147483648\\)");
-}
-
-TEST(RandomTest, GeneratesNumbersWithinRange) {
- constexpr uint32_t kRange = 10000;
- testing::internal::Random random(12345);
- for (int i = 0; i < 10; i++) {
- EXPECT_LT(random.Generate(kRange), kRange) << " for iteration " << i;
- }
-
- testing::internal::Random random2(testing::internal::Random::kMaxRange);
- for (int i = 0; i < 10; i++) {
- EXPECT_LT(random2.Generate(kRange), kRange) << " for iteration " << i;
- }
-}
-
-TEST(RandomTest, RepeatsWhenReseeded) {
- constexpr int kSeed = 123;
- constexpr int kArraySize = 10;
- constexpr uint32_t kRange = 10000;
- uint32_t values[kArraySize];
-
- testing::internal::Random random(kSeed);
- for (int i = 0; i < kArraySize; i++) {
- values[i] = random.Generate(kRange);
- }
-
- random.Reseed(kSeed);
- for (int i = 0; i < kArraySize; i++) {
- EXPECT_EQ(values[i], random.Generate(kRange)) << " for iteration " << i;
- }
-}
-
-// Tests STL container utilities.
-
-// Tests CountIf().
-
-static bool IsPositive(int n) { return n > 0; }
-
-TEST(ContainerUtilityTest, CountIf) {
- std::vector<int> v;
- EXPECT_EQ(0, CountIf(v, IsPositive)); // Works for an empty container.
-
- v.push_back(-1);
- v.push_back(0);
- EXPECT_EQ(0, CountIf(v, IsPositive)); // Works when no value satisfies.
-
- v.push_back(2);
- v.push_back(-10);
- v.push_back(10);
- EXPECT_EQ(2, CountIf(v, IsPositive));
-}
-
-// Tests ForEach().
-
-static int g_sum = 0;
-static void Accumulate(int n) { g_sum += n; }
-
-TEST(ContainerUtilityTest, ForEach) {
- std::vector<int> v;
- g_sum = 0;
- ForEach(v, Accumulate);
- EXPECT_EQ(0, g_sum); // Works for an empty container;
-
- g_sum = 0;
- v.push_back(1);
- ForEach(v, Accumulate);
- EXPECT_EQ(1, g_sum); // Works for a container with one element.
-
- g_sum = 0;
- v.push_back(20);
- v.push_back(300);
- ForEach(v, Accumulate);
- EXPECT_EQ(321, g_sum);
-}
-
-// Tests GetElementOr().
-TEST(ContainerUtilityTest, GetElementOr) {
- std::vector<char> a;
- EXPECT_EQ('x', GetElementOr(a, 0, 'x'));
-
- a.push_back('a');
- a.push_back('b');
- EXPECT_EQ('a', GetElementOr(a, 0, 'x'));
- EXPECT_EQ('b', GetElementOr(a, 1, 'x'));
- EXPECT_EQ('x', GetElementOr(a, -2, 'x'));
- EXPECT_EQ('x', GetElementOr(a, 2, 'x'));
-}
-
-TEST(ContainerUtilityDeathTest, ShuffleRange) {
- std::vector<int> a;
- a.push_back(0);
- a.push_back(1);
- a.push_back(2);
- testing::internal::Random random(1);
-
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, -1, 1, &a),
- "Invalid shuffle range start -1: must be in range \\[0, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 4, 4, &a),
- "Invalid shuffle range start 4: must be in range \\[0, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 3, 2, &a),
- "Invalid shuffle range finish 2: must be in range \\[3, 3\\]");
- EXPECT_DEATH_IF_SUPPORTED(
- ShuffleRange(&random, 3, 4, &a),
- "Invalid shuffle range finish 4: must be in range \\[3, 3\\]");
-}
-
-class VectorShuffleTest : public Test {
- protected:
- static const size_t kVectorSize = 20;
-
- VectorShuffleTest() : random_(1) {
- for (int i = 0; i < static_cast<int>(kVectorSize); i++) {
- vector_.push_back(i);
- }
- }
-
- static bool VectorIsCorrupt(const TestingVector& vector) {
- if (kVectorSize != vector.size()) {
- return true;
- }
-
- bool found_in_vector[kVectorSize] = { false };
- for (size_t i = 0; i < vector.size(); i++) {
- const int e = vector[i];
- if (e < 0 || e >= static_cast<int>(kVectorSize) || found_in_vector[e]) {
- return true;
- }
- found_in_vector[e] = true;
- }
-
- // Vector size is correct, elements' range is correct, no
- // duplicate elements. Therefore no corruption has occurred.
- return false;
- }
-
- static bool VectorIsNotCorrupt(const TestingVector& vector) {
- return !VectorIsCorrupt(vector);
- }
-
- static bool RangeIsShuffled(const TestingVector& vector, int begin, int end) {
- for (int i = begin; i < end; i++) {
- if (i != vector[static_cast<size_t>(i)]) {
- return true;
- }
- }
- return false;
- }
-
- static bool RangeIsUnshuffled(
- const TestingVector& vector, int begin, int end) {
- return !RangeIsShuffled(vector, begin, end);
- }
-
- static bool VectorIsShuffled(const TestingVector& vector) {
- return RangeIsShuffled(vector, 0, static_cast<int>(vector.size()));
- }
-
- static bool VectorIsUnshuffled(const TestingVector& vector) {
- return !VectorIsShuffled(vector);
- }
-
- testing::internal::Random random_;
- TestingVector vector_;
-}; // class VectorShuffleTest
-
-const size_t VectorShuffleTest::kVectorSize;
-
-TEST_F(VectorShuffleTest, HandlesEmptyRange) {
- // Tests an empty range at the beginning...
- ShuffleRange(&random_, 0, 0, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...in the middle...
- ShuffleRange(&random_, kVectorSize/2, kVectorSize/2, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...at the end...
- ShuffleRange(&random_, kVectorSize - 1, kVectorSize - 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...and past the end.
- ShuffleRange(&random_, kVectorSize, kVectorSize, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-}
-
-TEST_F(VectorShuffleTest, HandlesRangeOfSizeOne) {
- // Tests a size one range at the beginning...
- ShuffleRange(&random_, 0, 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...in the middle...
- ShuffleRange(&random_, kVectorSize/2, kVectorSize/2 + 1, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-
- // ...and at the end.
- ShuffleRange(&random_, kVectorSize - 1, kVectorSize, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsUnshuffled, vector_);
-}
-
-// Because we use our own random number generator and a fixed seed,
-// we can guarantee that the following "random" tests will succeed.
-
-TEST_F(VectorShuffleTest, ShufflesEntireVector) {
- Shuffle(&random_, &vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_FALSE(VectorIsUnshuffled(vector_)) << vector_;
-
- // Tests the first and last elements in particular to ensure that
- // there are no off-by-one problems in our shuffle algorithm.
- EXPECT_NE(0, vector_[0]);
- EXPECT_NE(static_cast<int>(kVectorSize - 1), vector_[kVectorSize - 1]);
-}
-
-TEST_F(VectorShuffleTest, ShufflesStartOfVector) {
- const int kRangeSize = kVectorSize/2;
-
- ShuffleRange(&random_, 0, kRangeSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsShuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, kRangeSize,
- static_cast<int>(kVectorSize));
-}
-
-TEST_F(VectorShuffleTest, ShufflesEndOfVector) {
- const int kRangeSize = kVectorSize / 2;
- ShuffleRange(&random_, kRangeSize, kVectorSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsShuffled, vector_, kRangeSize,
- static_cast<int>(kVectorSize));
-}
-
-TEST_F(VectorShuffleTest, ShufflesMiddleOfVector) {
- const int kRangeSize = static_cast<int>(kVectorSize) / 3;
- ShuffleRange(&random_, kRangeSize, 2*kRangeSize, &vector_);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 0, kRangeSize);
- EXPECT_PRED3(RangeIsShuffled, vector_, kRangeSize, 2*kRangeSize);
- EXPECT_PRED3(RangeIsUnshuffled, vector_, 2 * kRangeSize,
- static_cast<int>(kVectorSize));
-}
-
-TEST_F(VectorShuffleTest, ShufflesRepeatably) {
- TestingVector vector2;
- for (size_t i = 0; i < kVectorSize; i++) {
- vector2.push_back(static_cast<int>(i));
- }
-
- random_.Reseed(1234);
- Shuffle(&random_, &vector_);
- random_.Reseed(1234);
- Shuffle(&random_, &vector2);
-
- ASSERT_PRED1(VectorIsNotCorrupt, vector_);
- ASSERT_PRED1(VectorIsNotCorrupt, vector2);
-
- for (size_t i = 0; i < kVectorSize; i++) {
- EXPECT_EQ(vector_[i], vector2[i]) << " where i is " << i;
- }
-}
-
-// Tests the size of the AssertHelper class.
-
-TEST(AssertHelperTest, AssertHelperIsSmall) {
- // To avoid breaking clients that use lots of assertions in one
- // function, we cannot grow the size of AssertHelper.
- EXPECT_LE(sizeof(testing::internal::AssertHelper), sizeof(void*));
-}
-
-// Tests String::EndsWithCaseInsensitive().
-TEST(StringTest, EndsWithCaseInsensitive) {
- EXPECT_TRUE(String::EndsWithCaseInsensitive("foobar", "BAR"));
- EXPECT_TRUE(String::EndsWithCaseInsensitive("foobaR", "bar"));
- EXPECT_TRUE(String::EndsWithCaseInsensitive("foobar", ""));
- EXPECT_TRUE(String::EndsWithCaseInsensitive("", ""));
-
- EXPECT_FALSE(String::EndsWithCaseInsensitive("Foobar", "foo"));
- EXPECT_FALSE(String::EndsWithCaseInsensitive("foobar", "Foo"));
- EXPECT_FALSE(String::EndsWithCaseInsensitive("", "foo"));
-}
-
-// C++Builder's preprocessor is buggy; it fails to expand macros that
-// appear in macro parameters after wide char literals. Provide an alias
-// for NULL as a workaround.
-static const wchar_t* const kNull = nullptr;
-
-// Tests String::CaseInsensitiveWideCStringEquals
-TEST(StringTest, CaseInsensitiveWideCStringEquals) {
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(nullptr, nullptr));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(kNull, L""));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(L"", kNull));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(kNull, L"foobar"));
- EXPECT_FALSE(String::CaseInsensitiveWideCStringEquals(L"foobar", kNull));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"foobar", L"foobar"));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"foobar", L"FOOBAR"));
- EXPECT_TRUE(String::CaseInsensitiveWideCStringEquals(L"FOOBAR", L"foobar"));
-}
-
-#if GTEST_OS_WINDOWS
-
-// Tests String::ShowWideCString().
-TEST(StringTest, ShowWideCString) {
- EXPECT_STREQ("(null)",
- String::ShowWideCString(NULL).c_str());
- EXPECT_STREQ("", String::ShowWideCString(L"").c_str());
- EXPECT_STREQ("foo", String::ShowWideCString(L"foo").c_str());
-}
-
-# if GTEST_OS_WINDOWS_MOBILE
-TEST(StringTest, AnsiAndUtf16Null) {
- EXPECT_EQ(NULL, String::AnsiToUtf16(NULL));
- EXPECT_EQ(NULL, String::Utf16ToAnsi(NULL));
-}
-
-TEST(StringTest, AnsiAndUtf16ConvertBasic) {
- const char* ansi = String::Utf16ToAnsi(L"str");
- EXPECT_STREQ("str", ansi);
- delete [] ansi;
- const WCHAR* utf16 = String::AnsiToUtf16("str");
- EXPECT_EQ(0, wcsncmp(L"str", utf16, 3));
- delete [] utf16;
-}
-
-TEST(StringTest, AnsiAndUtf16ConvertPathChars) {
- const char* ansi = String::Utf16ToAnsi(L".:\\ \"*?");
- EXPECT_STREQ(".:\\ \"*?", ansi);
- delete [] ansi;
- const WCHAR* utf16 = String::AnsiToUtf16(".:\\ \"*?");
- EXPECT_EQ(0, wcsncmp(L".:\\ \"*?", utf16, 3));
- delete [] utf16;
-}
-# endif // GTEST_OS_WINDOWS_MOBILE
-
-#endif // GTEST_OS_WINDOWS
-
-// Tests TestProperty construction.
-TEST(TestPropertyTest, StringValue) {
- TestProperty property("key", "1");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("1", property.value());
-}
-
-// Tests TestProperty replacing a value.
-TEST(TestPropertyTest, ReplaceStringValue) {
- TestProperty property("key", "1");
- EXPECT_STREQ("1", property.value());
- property.SetValue("2");
- EXPECT_STREQ("2", property.value());
-}
-
-// AddFatalFailure() and AddNonfatalFailure() must be stand-alone
-// functions (i.e. their definitions cannot be inlined at the call
-// sites), or C++Builder won't compile the code.
-static void AddFatalFailure() {
- FAIL() << "Expected fatal failure.";
-}
-
-static void AddNonfatalFailure() {
- ADD_FAILURE() << "Expected non-fatal failure.";
-}
-
-class ScopedFakeTestPartResultReporterTest : public Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- enum FailureMode {
- FATAL_FAILURE,
- NONFATAL_FAILURE
- };
- static void AddFailure(FailureMode failure) {
- if (failure == FATAL_FAILURE) {
- AddFatalFailure();
- } else {
- AddNonfatalFailure();
- }
- }
-};
-
-// Tests that ScopedFakeTestPartResultReporter intercepts test
-// failures.
-TEST_F(ScopedFakeTestPartResultReporterTest, InterceptsTestFailures) {
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ONLY_CURRENT_THREAD,
- &results);
- AddFailure(NONFATAL_FAILURE);
- AddFailure(FATAL_FAILURE);
- }
-
- EXPECT_EQ(2, results.size());
- EXPECT_TRUE(results.GetTestPartResult(0).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(1).fatally_failed());
-}
-
-TEST_F(ScopedFakeTestPartResultReporterTest, DeprecatedConstructor) {
- TestPartResultArray results;
- {
- // Tests, that the deprecated constructor still works.
- ScopedFakeTestPartResultReporter reporter(&results);
- AddFailure(NONFATAL_FAILURE);
- }
- EXPECT_EQ(1, results.size());
-}
-
-#if GTEST_IS_THREADSAFE
-
-class ScopedFakeTestPartResultReporterWithThreadsTest
- : public ScopedFakeTestPartResultReporterTest {
- protected:
- static void AddFailureInOtherThread(FailureMode failure) {
- ThreadWithParam<FailureMode> thread(&AddFailure, failure, nullptr);
- thread.Join();
- }
-};
-
-TEST_F(ScopedFakeTestPartResultReporterWithThreadsTest,
- InterceptsTestFailuresInAllThreads) {
- TestPartResultArray results;
- {
- ScopedFakeTestPartResultReporter reporter(
- ScopedFakeTestPartResultReporter::INTERCEPT_ALL_THREADS, &results);
- AddFailure(NONFATAL_FAILURE);
- AddFailure(FATAL_FAILURE);
- AddFailureInOtherThread(NONFATAL_FAILURE);
- AddFailureInOtherThread(FATAL_FAILURE);
- }
-
- EXPECT_EQ(4, results.size());
- EXPECT_TRUE(results.GetTestPartResult(0).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(1).fatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(2).nonfatally_failed());
- EXPECT_TRUE(results.GetTestPartResult(3).fatally_failed());
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-// Tests EXPECT_FATAL_FAILURE{,ON_ALL_THREADS}. Makes sure that they
-// work even if the failure is generated in a called function rather than
-// the current context.
-
-typedef ScopedFakeTestPartResultReporterTest ExpectFatalFailureTest;
-
-TEST_F(ExpectFatalFailureTest, CatchesFatalFaliure) {
- EXPECT_FATAL_FAILURE(AddFatalFailure(), "Expected fatal failure.");
-}
-
-TEST_F(ExpectFatalFailureTest, AcceptsStdStringObject) {
- EXPECT_FATAL_FAILURE(AddFatalFailure(),
- ::std::string("Expected fatal failure."));
-}
-
-TEST_F(ExpectFatalFailureTest, CatchesFatalFailureOnAllThreads) {
- // We have another test below to verify that the macro catches fatal
- // failures generated on another thread.
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFatalFailure(),
- "Expected fatal failure.");
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true"
-# pragma option push -w-ccc
-#endif
-
-// Tests that EXPECT_FATAL_FAILURE() can be used in a non-void
-// function even when the statement in it contains ASSERT_*.
-
-int NonVoidFunction() {
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false), "");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(FAIL(), "");
- return 0;
-}
-
-TEST_F(ExpectFatalFailureTest, CanBeUsedInNonVoidFunction) {
- NonVoidFunction();
-}
-
-// Tests that EXPECT_FATAL_FAILURE(statement, ...) doesn't abort the
-// current function even though 'statement' generates a fatal failure.
-
-void DoesNotAbortHelper(bool* aborted) {
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false), "");
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(FAIL(), "");
-
- *aborted = false;
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them.
-# pragma option pop
-#endif
-
-TEST_F(ExpectFatalFailureTest, DoesNotAbort) {
- bool aborted = true;
- DoesNotAbortHelper(&aborted);
- EXPECT_FALSE(aborted);
-}
-
-// Tests that the EXPECT_FATAL_FAILURE{,_ON_ALL_THREADS} accepts a
-// statement that contains a macro which expands to code containing an
-// unprotected comma.
-
-static int global_var = 0;
-#define GTEST_USE_UNPROTECTED_COMMA_ global_var++, global_var++
-
-TEST_F(ExpectFatalFailureTest, AcceptsMacroThatExpandsToUnprotectedComma) {
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddFatalFailure();
- }, "");
-#endif
-
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddFatalFailure();
- }, "");
-}
-
-// Tests EXPECT_NONFATAL_FAILURE{,ON_ALL_THREADS}.
-
-typedef ScopedFakeTestPartResultReporterTest ExpectNonfatalFailureTest;
-
-TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailure) {
- EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(),
- "Expected non-fatal failure.");
-}
-
-TEST_F(ExpectNonfatalFailureTest, AcceptsStdStringObject) {
- EXPECT_NONFATAL_FAILURE(AddNonfatalFailure(),
- ::std::string("Expected non-fatal failure."));
-}
-
-TEST_F(ExpectNonfatalFailureTest, CatchesNonfatalFailureOnAllThreads) {
- // We have another test below to verify that the macro catches
- // non-fatal failures generated on another thread.
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(AddNonfatalFailure(),
- "Expected non-fatal failure.");
-}
-
-// Tests that the EXPECT_NONFATAL_FAILURE{,_ON_ALL_THREADS} accepts a
-// statement that contains a macro which expands to code containing an
-// unprotected comma.
-TEST_F(ExpectNonfatalFailureTest, AcceptsMacroThatExpandsToUnprotectedComma) {
- EXPECT_NONFATAL_FAILURE({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddNonfatalFailure();
- }, "");
-
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS({
- GTEST_USE_UNPROTECTED_COMMA_;
- AddNonfatalFailure();
- }, "");
-}
-
-#if GTEST_IS_THREADSAFE
-
-typedef ScopedFakeTestPartResultReporterWithThreadsTest
- ExpectFailureWithThreadsTest;
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectFatalFailureOnAllThreads) {
- EXPECT_FATAL_FAILURE_ON_ALL_THREADS(AddFailureInOtherThread(FATAL_FAILURE),
- "Expected fatal failure.");
-}
-
-TEST_F(ExpectFailureWithThreadsTest, ExpectNonFatalFailureOnAllThreads) {
- EXPECT_NONFATAL_FAILURE_ON_ALL_THREADS(
- AddFailureInOtherThread(NONFATAL_FAILURE), "Expected non-fatal failure.");
-}
-
-#endif // GTEST_IS_THREADSAFE
-
-// Tests the TestProperty class.
-
-TEST(TestPropertyTest, ConstructorWorks) {
- const TestProperty property("key", "value");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value", property.value());
-}
-
-TEST(TestPropertyTest, SetValue) {
- TestProperty property("key", "value_1");
- EXPECT_STREQ("key", property.key());
- property.SetValue("value_2");
- EXPECT_STREQ("key", property.key());
- EXPECT_STREQ("value_2", property.value());
-}
-
-// Tests the TestResult class
-
-// The test fixture for testing TestResult.
-class TestResultTest : public Test {
- protected:
- typedef std::vector<TestPartResult> TPRVector;
-
- // We make use of 2 TestPartResult objects,
- TestPartResult * pr1, * pr2;
-
- // ... and 3 TestResult objects.
- TestResult * r0, * r1, * r2;
-
- void SetUp() override {
- // pr1 is for success.
- pr1 = new TestPartResult(TestPartResult::kSuccess,
- "foo/bar.cc",
- 10,
- "Success!");
-
- // pr2 is for fatal failure.
- pr2 = new TestPartResult(TestPartResult::kFatalFailure,
- "foo/bar.cc",
- -1, // This line number means "unknown"
- "Failure!");
-
- // Creates the TestResult objects.
- r0 = new TestResult();
- r1 = new TestResult();
- r2 = new TestResult();
-
- // In order to test TestResult, we need to modify its internal
- // state, in particular the TestPartResult vector it holds.
- // test_part_results() returns a const reference to this vector.
- // We cast it to a non-const object s.t. it can be modified
- TPRVector* results1 = const_cast<TPRVector*>(
- &TestResultAccessor::test_part_results(*r1));
- TPRVector* results2 = const_cast<TPRVector*>(
- &TestResultAccessor::test_part_results(*r2));
-
- // r0 is an empty TestResult.
-
- // r1 contains a single SUCCESS TestPartResult.
- results1->push_back(*pr1);
-
- // r2 contains a SUCCESS, and a FAILURE.
- results2->push_back(*pr1);
- results2->push_back(*pr2);
- }
-
- void TearDown() override {
- delete pr1;
- delete pr2;
-
- delete r0;
- delete r1;
- delete r2;
- }
-
- // Helper that compares two TestPartResults.
- static void CompareTestPartResult(const TestPartResult& expected,
- const TestPartResult& actual) {
- EXPECT_EQ(expected.type(), actual.type());
- EXPECT_STREQ(expected.file_name(), actual.file_name());
- EXPECT_EQ(expected.line_number(), actual.line_number());
- EXPECT_STREQ(expected.summary(), actual.summary());
- EXPECT_STREQ(expected.message(), actual.message());
- EXPECT_EQ(expected.passed(), actual.passed());
- EXPECT_EQ(expected.failed(), actual.failed());
- EXPECT_EQ(expected.nonfatally_failed(), actual.nonfatally_failed());
- EXPECT_EQ(expected.fatally_failed(), actual.fatally_failed());
- }
-};
-
-// Tests TestResult::total_part_count().
-TEST_F(TestResultTest, total_part_count) {
- ASSERT_EQ(0, r0->total_part_count());
- ASSERT_EQ(1, r1->total_part_count());
- ASSERT_EQ(2, r2->total_part_count());
-}
-
-// Tests TestResult::Passed().
-TEST_F(TestResultTest, Passed) {
- ASSERT_TRUE(r0->Passed());
- ASSERT_TRUE(r1->Passed());
- ASSERT_FALSE(r2->Passed());
-}
-
-// Tests TestResult::Failed().
-TEST_F(TestResultTest, Failed) {
- ASSERT_FALSE(r0->Failed());
- ASSERT_FALSE(r1->Failed());
- ASSERT_TRUE(r2->Failed());
-}
-
-// Tests TestResult::GetTestPartResult().
-
-typedef TestResultTest TestResultDeathTest;
-
-TEST_F(TestResultDeathTest, GetTestPartResult) {
- CompareTestPartResult(*pr1, r2->GetTestPartResult(0));
- CompareTestPartResult(*pr2, r2->GetTestPartResult(1));
- EXPECT_DEATH_IF_SUPPORTED(r2->GetTestPartResult(2), "");
- EXPECT_DEATH_IF_SUPPORTED(r2->GetTestPartResult(-1), "");
-}
-
-// Tests TestResult has no properties when none are added.
-TEST(TestResultPropertyTest, NoPropertiesFoundWhenNoneAreAdded) {
- TestResult test_result;
- ASSERT_EQ(0, test_result.test_property_count());
-}
-
-// Tests TestResult has the expected property when added.
-TEST(TestResultPropertyTest, OnePropertyFoundWhenAdded) {
- TestResult test_result;
- TestProperty property("key_1", "1");
- TestResultAccessor::RecordProperty(&test_result, "testcase", property);
- ASSERT_EQ(1, test_result.test_property_count());
- const TestProperty& actual_property = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property.key());
- EXPECT_STREQ("1", actual_property.value());
-}
-
-// Tests TestResult has multiple properties when added.
-TEST(TestResultPropertyTest, MultiplePropertiesFoundWhenAdded) {
- TestResult test_result;
- TestProperty property_1("key_1", "1");
- TestProperty property_2("key_2", "2");
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_1);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_2);
- ASSERT_EQ(2, test_result.test_property_count());
- const TestProperty& actual_property_1 = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property_1.key());
- EXPECT_STREQ("1", actual_property_1.value());
-
- const TestProperty& actual_property_2 = test_result.GetTestProperty(1);
- EXPECT_STREQ("key_2", actual_property_2.key());
- EXPECT_STREQ("2", actual_property_2.value());
-}
-
-// Tests TestResult::RecordProperty() overrides values for duplicate keys.
-TEST(TestResultPropertyTest, OverridesValuesForDuplicateKeys) {
- TestResult test_result;
- TestProperty property_1_1("key_1", "1");
- TestProperty property_2_1("key_2", "2");
- TestProperty property_1_2("key_1", "12");
- TestProperty property_2_2("key_2", "22");
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_1_1);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_2_1);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_1_2);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_2_2);
-
- ASSERT_EQ(2, test_result.test_property_count());
- const TestProperty& actual_property_1 = test_result.GetTestProperty(0);
- EXPECT_STREQ("key_1", actual_property_1.key());
- EXPECT_STREQ("12", actual_property_1.value());
-
- const TestProperty& actual_property_2 = test_result.GetTestProperty(1);
- EXPECT_STREQ("key_2", actual_property_2.key());
- EXPECT_STREQ("22", actual_property_2.value());
-}
-
-// Tests TestResult::GetTestProperty().
-TEST(TestResultPropertyTest, GetTestProperty) {
- TestResult test_result;
- TestProperty property_1("key_1", "1");
- TestProperty property_2("key_2", "2");
- TestProperty property_3("key_3", "3");
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_1);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_2);
- TestResultAccessor::RecordProperty(&test_result, "testcase", property_3);
-
- const TestProperty& fetched_property_1 = test_result.GetTestProperty(0);
- const TestProperty& fetched_property_2 = test_result.GetTestProperty(1);
- const TestProperty& fetched_property_3 = test_result.GetTestProperty(2);
-
- EXPECT_STREQ("key_1", fetched_property_1.key());
- EXPECT_STREQ("1", fetched_property_1.value());
-
- EXPECT_STREQ("key_2", fetched_property_2.key());
- EXPECT_STREQ("2", fetched_property_2.value());
-
- EXPECT_STREQ("key_3", fetched_property_3.key());
- EXPECT_STREQ("3", fetched_property_3.value());
-
- EXPECT_DEATH_IF_SUPPORTED(test_result.GetTestProperty(3), "");
- EXPECT_DEATH_IF_SUPPORTED(test_result.GetTestProperty(-1), "");
-}
-
-// Tests the Test class.
-//
-// It's difficult to test every public method of this class (we are
-// already stretching the limit of Google Test by using it to test itself!).
-// Fortunately, we don't have to do that, as we are already testing
-// the functionalities of the Test class extensively by using Google Test
-// alone.
-//
-// Therefore, this section only contains one test.
-
-// Tests that GTestFlagSaver works on Windows and Mac.
-
-class GTestFlagSaverTest : public Test {
- protected:
- // Saves the Google Test flags such that we can restore them later, and
- // then sets them to their default values. This will be called
- // before the first test in this test case is run.
- static void SetUpTestSuite() {
- saver_ = new GTestFlagSaver;
-
- GTEST_FLAG_SET(also_run_disabled_tests, false);
- GTEST_FLAG_SET(break_on_failure, false);
- GTEST_FLAG_SET(catch_exceptions, false);
- GTEST_FLAG_SET(death_test_use_fork, false);
- GTEST_FLAG_SET(color, "auto");
- GTEST_FLAG_SET(fail_fast, false);
- GTEST_FLAG_SET(filter, "");
- GTEST_FLAG_SET(list_tests, false);
- GTEST_FLAG_SET(output, "");
- GTEST_FLAG_SET(brief, false);
- GTEST_FLAG_SET(print_time, true);
- GTEST_FLAG_SET(random_seed, 0);
- GTEST_FLAG_SET(repeat, 1);
- GTEST_FLAG_SET(recreate_environments_when_repeating, true);
- GTEST_FLAG_SET(shuffle, false);
- GTEST_FLAG_SET(stack_trace_depth, kMaxStackTraceDepth);
- GTEST_FLAG_SET(stream_result_to, "");
- GTEST_FLAG_SET(throw_on_failure, false);
- }
-
- // Restores the Google Test flags that the tests have modified. This will
- // be called after the last test in this test case is run.
- static void TearDownTestSuite() {
- delete saver_;
- saver_ = nullptr;
- }
-
- // Verifies that the Google Test flags have their default values, and then
- // modifies each of them.
- void VerifyAndModifyFlags() {
- EXPECT_FALSE(GTEST_FLAG_GET(also_run_disabled_tests));
- EXPECT_FALSE(GTEST_FLAG_GET(break_on_failure));
- EXPECT_FALSE(GTEST_FLAG_GET(catch_exceptions));
- EXPECT_STREQ("auto", GTEST_FLAG_GET(color).c_str());
- EXPECT_FALSE(GTEST_FLAG_GET(death_test_use_fork));
- EXPECT_FALSE(GTEST_FLAG_GET(fail_fast));
- EXPECT_STREQ("", GTEST_FLAG_GET(filter).c_str());
- EXPECT_FALSE(GTEST_FLAG_GET(list_tests));
- EXPECT_STREQ("", GTEST_FLAG_GET(output).c_str());
- EXPECT_FALSE(GTEST_FLAG_GET(brief));
- EXPECT_TRUE(GTEST_FLAG_GET(print_time));
- EXPECT_EQ(0, GTEST_FLAG_GET(random_seed));
- EXPECT_EQ(1, GTEST_FLAG_GET(repeat));
- EXPECT_TRUE(GTEST_FLAG_GET(recreate_environments_when_repeating));
- EXPECT_FALSE(GTEST_FLAG_GET(shuffle));
- EXPECT_EQ(kMaxStackTraceDepth, GTEST_FLAG_GET(stack_trace_depth));
- EXPECT_STREQ("", GTEST_FLAG_GET(stream_result_to).c_str());
- EXPECT_FALSE(GTEST_FLAG_GET(throw_on_failure));
-
- GTEST_FLAG_SET(also_run_disabled_tests, true);
- GTEST_FLAG_SET(break_on_failure, true);
- GTEST_FLAG_SET(catch_exceptions, true);
- GTEST_FLAG_SET(color, "no");
- GTEST_FLAG_SET(death_test_use_fork, true);
- GTEST_FLAG_SET(fail_fast, true);
- GTEST_FLAG_SET(filter, "abc");
- GTEST_FLAG_SET(list_tests, true);
- GTEST_FLAG_SET(output, "xml:foo.xml");
- GTEST_FLAG_SET(brief, true);
- GTEST_FLAG_SET(print_time, false);
- GTEST_FLAG_SET(random_seed, 1);
- GTEST_FLAG_SET(repeat, 100);
- GTEST_FLAG_SET(recreate_environments_when_repeating, false);
- GTEST_FLAG_SET(shuffle, true);
- GTEST_FLAG_SET(stack_trace_depth, 1);
- GTEST_FLAG_SET(stream_result_to, "localhost:1234");
- GTEST_FLAG_SET(throw_on_failure, true);
- }
-
- private:
- // For saving Google Test flags during this test case.
- static GTestFlagSaver* saver_;
-};
-
-GTestFlagSaver* GTestFlagSaverTest::saver_ = nullptr;
-
-// Google Test doesn't guarantee the order of tests. The following two
-// tests are designed to work regardless of their order.
-
-// Modifies the Google Test flags in the test body.
-TEST_F(GTestFlagSaverTest, ModifyGTestFlags) {
- VerifyAndModifyFlags();
-}
-
-// Verifies that the Google Test flags in the body of the previous test were
-// restored to their original values.
-TEST_F(GTestFlagSaverTest, VerifyGTestFlags) {
- VerifyAndModifyFlags();
-}
-
-// Sets an environment variable with the given name to the given
-// value. If the value argument is "", unsets the environment
-// variable. The caller must ensure that both arguments are not NULL.
-static void SetEnv(const char* name, const char* value) {
-#if GTEST_OS_WINDOWS_MOBILE
- // Environment variables are not supported on Windows CE.
- return;
-#elif defined(__BORLANDC__) || defined(__SunOS_5_8) || defined(__SunOS_5_9)
- // C++Builder's putenv only stores a pointer to its parameter; we have to
- // ensure that the string remains valid as long as it might be needed.
- // We use an std::map to do so.
- static std::map<std::string, std::string*> added_env;
-
- // Because putenv stores a pointer to the string buffer, we can't delete the
- // previous string (if present) until after it's replaced.
- std::string *prev_env = NULL;
- if (added_env.find(name) != added_env.end()) {
- prev_env = added_env[name];
- }
- added_env[name] = new std::string(
- (Message() << name << "=" << value).GetString());
-
- // The standard signature of putenv accepts a 'char*' argument. Other
- // implementations, like C++Builder's, accept a 'const char*'.
- // We cast away the 'const' since that would work for both variants.
- putenv(const_cast<char*>(added_env[name]->c_str()));
- delete prev_env;
-#elif GTEST_OS_WINDOWS // If we are on Windows proper.
- _putenv((Message() << name << "=" << value).GetString().c_str());
-#else
- if (*value == '\0') {
- unsetenv(name);
- } else {
- setenv(name, value, 1);
- }
-#endif // GTEST_OS_WINDOWS_MOBILE
-}
-
-#if !GTEST_OS_WINDOWS_MOBILE
-// Environment variables are not supported on Windows CE.
-
-using testing::internal::Int32FromGTestEnv;
-
-// Tests Int32FromGTestEnv().
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable is not set.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenVariableIsNotSet) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "");
- EXPECT_EQ(10, Int32FromGTestEnv("temp", 10));
-}
-
-# if !defined(GTEST_GET_INT32_FROM_ENV_)
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable overflows as an Int32.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueOverflows) {
- printf("(expecting 2 warnings)\n");
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "12345678987654321");
- EXPECT_EQ(20, Int32FromGTestEnv("temp", 20));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "-12345678987654321");
- EXPECT_EQ(30, Int32FromGTestEnv("temp", 30));
-}
-
-// Tests that Int32FromGTestEnv() returns the default value when the
-// environment variable does not represent a valid decimal integer.
-TEST(Int32FromGTestEnvTest, ReturnsDefaultWhenValueIsInvalid) {
- printf("(expecting 2 warnings)\n");
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "A1");
- EXPECT_EQ(40, Int32FromGTestEnv("temp", 40));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "12X");
- EXPECT_EQ(50, Int32FromGTestEnv("temp", 50));
-}
-
-# endif // !defined(GTEST_GET_INT32_FROM_ENV_)
-
-// Tests that Int32FromGTestEnv() parses and returns the value of the
-// environment variable when it represents a valid decimal integer in
-// the range of an Int32.
-TEST(Int32FromGTestEnvTest, ParsesAndReturnsValidValue) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "123");
- EXPECT_EQ(123, Int32FromGTestEnv("temp", 0));
-
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "TEMP", "-321");
- EXPECT_EQ(-321, Int32FromGTestEnv("temp", 0));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests ParseFlag().
-
-// Tests that ParseInt32Flag() returns false and doesn't change the
-// output value when the flag has wrong format
-TEST(ParseInt32FlagTest, ReturnsFalseForInvalidFlag) {
- int32_t value = 123;
- EXPECT_FALSE(ParseFlag("--a=100", "b", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseFlag("a=100", "a", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseFlag() returns false and doesn't change the
-// output value when the flag overflows as an Int32.
-TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueOverflows) {
- printf("(expecting 2 warnings)\n");
-
- int32_t value = 123;
- EXPECT_FALSE(ParseFlag("--abc=12345678987654321", "abc", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseFlag("--abc=-12345678987654321", "abc", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseInt32Flag() returns false and doesn't change the
-// output value when the flag does not represent a valid decimal
-// integer.
-TEST(ParseInt32FlagTest, ReturnsDefaultWhenValueIsInvalid) {
- printf("(expecting 2 warnings)\n");
-
- int32_t value = 123;
- EXPECT_FALSE(ParseFlag("--abc=A1", "abc", &value));
- EXPECT_EQ(123, value);
-
- EXPECT_FALSE(ParseFlag("--abc=12X", "abc", &value));
- EXPECT_EQ(123, value);
-}
-
-// Tests that ParseInt32Flag() parses the value of the flag and
-// returns true when the flag represents a valid decimal integer in
-// the range of an Int32.
-TEST(ParseInt32FlagTest, ParsesAndReturnsValidValue) {
- int32_t value = 123;
- EXPECT_TRUE(ParseFlag("--" GTEST_FLAG_PREFIX_ "abc=456", "abc", &value));
- EXPECT_EQ(456, value);
-
- EXPECT_TRUE(ParseFlag("--" GTEST_FLAG_PREFIX_ "abc=-789", "abc", &value));
- EXPECT_EQ(-789, value);
-}
-
-// Tests that Int32FromEnvOrDie() parses the value of the var or
-// returns the correct default.
-// Environment variables are not supported on Windows CE.
-#if !GTEST_OS_WINDOWS_MOBILE
-TEST(Int32FromEnvOrDieTest, ParsesAndReturnsValidValue) {
- EXPECT_EQ(333, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "123");
- EXPECT_EQ(123, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", "-123");
- EXPECT_EQ(-123, Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "UnsetVar", 333));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests that Int32FromEnvOrDie() aborts with an error message
-// if the variable is not an int32_t.
-TEST(Int32FromEnvOrDieDeathTest, AbortsOnFailure) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "VAR", "xxx");
- EXPECT_DEATH_IF_SUPPORTED(
- Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "VAR", 123),
- ".*");
-}
-
-// Tests that Int32FromEnvOrDie() aborts with an error message
-// if the variable cannot be represented by an int32_t.
-TEST(Int32FromEnvOrDieDeathTest, AbortsOnInt32Overflow) {
- SetEnv(GTEST_FLAG_PREFIX_UPPER_ "VAR", "1234567891234567891234");
- EXPECT_DEATH_IF_SUPPORTED(
- Int32FromEnvOrDie(GTEST_FLAG_PREFIX_UPPER_ "VAR", 123),
- ".*");
-}
-
-// Tests that ShouldRunTestOnShard() selects all tests
-// where there is 1 shard.
-TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereIsOneShard) {
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 0));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 1));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 2));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 3));
- EXPECT_TRUE(ShouldRunTestOnShard(1, 0, 4));
-}
-
-class ShouldShardTest : public testing::Test {
- protected:
- void SetUp() override {
- index_var_ = GTEST_FLAG_PREFIX_UPPER_ "INDEX";
- total_var_ = GTEST_FLAG_PREFIX_UPPER_ "TOTAL";
- }
-
- void TearDown() override {
- SetEnv(index_var_, "");
- SetEnv(total_var_, "");
- }
-
- const char* index_var_;
- const char* total_var_;
-};
-
-// Tests that sharding is disabled if neither of the environment variables
-// are set.
-TEST_F(ShouldShardTest, ReturnsFalseWhenNeitherEnvVarIsSet) {
- SetEnv(index_var_, "");
- SetEnv(total_var_, "");
-
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-
-// Tests that sharding is not enabled if total_shards == 1.
-TEST_F(ShouldShardTest, ReturnsFalseWhenTotalShardIsOne) {
- SetEnv(index_var_, "0");
- SetEnv(total_var_, "1");
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-
-// Tests that sharding is enabled if total_shards > 1 and
-// we are not in a death test subprocess.
-// Environment variables are not supported on Windows CE.
-#if !GTEST_OS_WINDOWS_MOBILE
-TEST_F(ShouldShardTest, WorksWhenShardEnvVarsAreValid) {
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "22");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-
- SetEnv(index_var_, "8");
- SetEnv(total_var_, "9");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-
- SetEnv(index_var_, "0");
- SetEnv(total_var_, "9");
- EXPECT_TRUE(ShouldShard(total_var_, index_var_, false));
- EXPECT_FALSE(ShouldShard(total_var_, index_var_, true));
-}
-#endif // !GTEST_OS_WINDOWS_MOBILE
-
-// Tests that we exit in error if the sharding values are not valid.
-
-typedef ShouldShardTest ShouldShardDeathTest;
-
-TEST_F(ShouldShardDeathTest, AbortsWhenShardingEnvVarsAreInvalid) {
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "4");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "4");
- SetEnv(total_var_, "-2");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "5");
- SetEnv(total_var_, "");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-
- SetEnv(index_var_, "");
- SetEnv(total_var_, "5");
- EXPECT_DEATH_IF_SUPPORTED(ShouldShard(total_var_, index_var_, false), ".*");
-}
-
-// Tests that ShouldRunTestOnShard is a partition when 5
-// shards are used.
-TEST(ShouldRunTestOnShardTest, IsPartitionWhenThereAreFiveShards) {
- // Choose an arbitrary number of tests and shards.
- const int num_tests = 17;
- const int num_shards = 5;
-
- // Check partitioning: each test should be on exactly 1 shard.
- for (int test_id = 0; test_id < num_tests; test_id++) {
- int prev_selected_shard_index = -1;
- for (int shard_index = 0; shard_index < num_shards; shard_index++) {
- if (ShouldRunTestOnShard(num_shards, shard_index, test_id)) {
- if (prev_selected_shard_index < 0) {
- prev_selected_shard_index = shard_index;
- } else {
- ADD_FAILURE() << "Shard " << prev_selected_shard_index << " and "
- << shard_index << " are both selected to run test " << test_id;
- }
- }
- }
- }
-
- // Check balance: This is not required by the sharding protocol, but is a
- // desirable property for performance.
- for (int shard_index = 0; shard_index < num_shards; shard_index++) {
- int num_tests_on_shard = 0;
- for (int test_id = 0; test_id < num_tests; test_id++) {
- num_tests_on_shard +=
- ShouldRunTestOnShard(num_shards, shard_index, test_id);
- }
- EXPECT_GE(num_tests_on_shard, num_tests / num_shards);
- }
-}
-
-// For the same reason we are not explicitly testing everything in the
-// Test class, there are no separate tests for the following classes
-// (except for some trivial cases):
-//
-// TestSuite, UnitTest, UnitTestResultPrinter.
-//
-// Similarly, there are no separate tests for the following macros:
-//
-// TEST, TEST_F, RUN_ALL_TESTS
-
-TEST(UnitTestTest, CanGetOriginalWorkingDir) {
- ASSERT_TRUE(UnitTest::GetInstance()->original_working_dir() != nullptr);
- EXPECT_STRNE(UnitTest::GetInstance()->original_working_dir(), "");
-}
-
-TEST(UnitTestTest, ReturnsPlausibleTimestamp) {
- EXPECT_LT(0, UnitTest::GetInstance()->start_timestamp());
- EXPECT_LE(UnitTest::GetInstance()->start_timestamp(), GetTimeInMillis());
-}
-
-// When a property using a reserved key is supplied to this function, it
-// tests that a non-fatal failure is added, a fatal failure is not added,
-// and that the property is not recorded.
-void ExpectNonFatalFailureRecordingPropertyWithReservedKey(
- const TestResult& test_result, const char* key) {
- EXPECT_NONFATAL_FAILURE(Test::RecordProperty(key, "1"), "Reserved key");
- ASSERT_EQ(0, test_result.test_property_count()) << "Property for key '" << key
- << "' recorded unexpectedly.";
-}
-
-void ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- const char* key) {
- const TestInfo* test_info = UnitTest::GetInstance()->current_test_info();
- ASSERT_TRUE(test_info != nullptr);
- ExpectNonFatalFailureRecordingPropertyWithReservedKey(*test_info->result(),
- key);
-}
-
-void ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- const char* key) {
- const testing::TestSuite* test_suite =
- UnitTest::GetInstance()->current_test_suite();
- ASSERT_TRUE(test_suite != nullptr);
- ExpectNonFatalFailureRecordingPropertyWithReservedKey(
- test_suite->ad_hoc_test_result(), key);
-}
-
-void ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- const char* key) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKey(
- UnitTest::GetInstance()->ad_hoc_test_result(), key);
-}
-
-// Tests that property recording functions in UnitTest outside of tests
-// functions correctly. Creating a separate instance of UnitTest ensures it
-// is in a state similar to the UnitTest's singleton's between tests.
-class UnitTestRecordPropertyTest :
- public testing::internal::UnitTestRecordPropertyTestHelper {
- public:
- static void SetUpTestSuite() {
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "disabled");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "errors");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "failures");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "name");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "tests");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTestSuite(
- "time");
-
- Test::RecordProperty("test_case_key_1", "1");
-
- const testing::TestSuite* test_suite =
- UnitTest::GetInstance()->current_test_suite();
-
- ASSERT_TRUE(test_suite != nullptr);
-
- ASSERT_EQ(1, test_suite->ad_hoc_test_result().test_property_count());
- EXPECT_STREQ("test_case_key_1",
- test_suite->ad_hoc_test_result().GetTestProperty(0).key());
- EXPECT_STREQ("1",
- test_suite->ad_hoc_test_result().GetTestProperty(0).value());
- }
-};
-
-// Tests TestResult has the expected property when added.
-TEST_F(UnitTestRecordPropertyTest, OnePropertyFoundWhenAdded) {
- UnitTestRecordProperty("key_1", "1");
-
- ASSERT_EQ(1, unit_test_.ad_hoc_test_result().test_property_count());
-
- EXPECT_STREQ("key_1",
- unit_test_.ad_hoc_test_result().GetTestProperty(0).key());
- EXPECT_STREQ("1",
- unit_test_.ad_hoc_test_result().GetTestProperty(0).value());
-}
-
-// Tests TestResult has multiple properties when added.
-TEST_F(UnitTestRecordPropertyTest, MultiplePropertiesFoundWhenAdded) {
- UnitTestRecordProperty("key_1", "1");
- UnitTestRecordProperty("key_2", "2");
-
- ASSERT_EQ(2, unit_test_.ad_hoc_test_result().test_property_count());
-
- EXPECT_STREQ("key_1",
- unit_test_.ad_hoc_test_result().GetTestProperty(0).key());
- EXPECT_STREQ("1", unit_test_.ad_hoc_test_result().GetTestProperty(0).value());
-
- EXPECT_STREQ("key_2",
- unit_test_.ad_hoc_test_result().GetTestProperty(1).key());
- EXPECT_STREQ("2", unit_test_.ad_hoc_test_result().GetTestProperty(1).value());
-}
-
-// Tests TestResult::RecordProperty() overrides values for duplicate keys.
-TEST_F(UnitTestRecordPropertyTest, OverridesValuesForDuplicateKeys) {
- UnitTestRecordProperty("key_1", "1");
- UnitTestRecordProperty("key_2", "2");
- UnitTestRecordProperty("key_1", "12");
- UnitTestRecordProperty("key_2", "22");
-
- ASSERT_EQ(2, unit_test_.ad_hoc_test_result().test_property_count());
-
- EXPECT_STREQ("key_1",
- unit_test_.ad_hoc_test_result().GetTestProperty(0).key());
- EXPECT_STREQ("12",
- unit_test_.ad_hoc_test_result().GetTestProperty(0).value());
-
- EXPECT_STREQ("key_2",
- unit_test_.ad_hoc_test_result().GetTestProperty(1).key());
- EXPECT_STREQ("22",
- unit_test_.ad_hoc_test_result().GetTestProperty(1).value());
-}
-
-TEST_F(UnitTestRecordPropertyTest,
- AddFailureInsideTestsWhenUsingTestSuiteReservedKeys) {
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "name");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "value_param");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "type_param");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "status");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "time");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyForCurrentTest(
- "classname");
-}
-
-TEST_F(UnitTestRecordPropertyTest,
- AddRecordWithReservedKeysGeneratesCorrectPropertyList) {
- EXPECT_NONFATAL_FAILURE(
- Test::RecordProperty("name", "1"),
- "'classname', 'name', 'status', 'time', 'type_param', 'value_param',"
- " 'file', and 'line' are reserved");
-}
-
-class UnitTestRecordPropertyTestEnvironment : public Environment {
- public:
- void TearDown() override {
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "tests");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "failures");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "disabled");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "errors");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "name");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "timestamp");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "time");
- ExpectNonFatalFailureRecordingPropertyWithReservedKeyOutsideOfTestSuite(
- "random_seed");
- }
-};
-
-// This will test property recording outside of any test or test case.
-static Environment* record_property_env GTEST_ATTRIBUTE_UNUSED_ =
- AddGlobalTestEnvironment(new UnitTestRecordPropertyTestEnvironment);
-
-// This group of tests is for predicate assertions (ASSERT_PRED*, etc)
-// of various arities. They do not attempt to be exhaustive. Rather,
-// view them as smoke tests that can be easily reviewed and verified.
-// A more complete set of tests for predicate assertions can be found
-// in gtest_pred_impl_unittest.cc.
-
-// First, some predicates and predicate-formatters needed by the tests.
-
-// Returns true if and only if the argument is an even number.
-bool IsEven(int n) {
- return (n % 2) == 0;
-}
-
-// A functor that returns true if and only if the argument is an even number.
-struct IsEvenFunctor {
- bool operator()(int n) { return IsEven(n); }
-};
-
-// A predicate-formatter function that asserts the argument is an even
-// number.
-AssertionResult AssertIsEven(const char* expr, int n) {
- if (IsEven(n)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << expr << " evaluates to " << n << ", which is not even.";
- return AssertionFailure(msg);
-}
-
-// A predicate function that returns AssertionResult for use in
-// EXPECT/ASSERT_TRUE/FALSE.
-AssertionResult ResultIsEven(int n) {
- if (IsEven(n))
- return AssertionSuccess() << n << " is even";
- else
- return AssertionFailure() << n << " is odd";
-}
-
-// A predicate function that returns AssertionResult but gives no
-// explanation why it succeeds. Needed for testing that
-// EXPECT/ASSERT_FALSE handles such functions correctly.
-AssertionResult ResultIsEvenNoExplanation(int n) {
- if (IsEven(n))
- return AssertionSuccess();
- else
- return AssertionFailure() << n << " is odd";
-}
-
-// A predicate-formatter functor that asserts the argument is an even
-// number.
-struct AssertIsEvenFunctor {
- AssertionResult operator()(const char* expr, int n) {
- return AssertIsEven(expr, n);
- }
-};
-
-// Returns true if and only if the sum of the arguments is an even number.
-bool SumIsEven2(int n1, int n2) {
- return IsEven(n1 + n2);
-}
-
-// A functor that returns true if and only if the sum of the arguments is an
-// even number.
-struct SumIsEven3Functor {
- bool operator()(int n1, int n2, int n3) {
- return IsEven(n1 + n2 + n3);
- }
-};
-
-// A predicate-formatter function that asserts the sum of the
-// arguments is an even number.
-AssertionResult AssertSumIsEven4(
- const char* e1, const char* e2, const char* e3, const char* e4,
- int n1, int n2, int n3, int n4) {
- const int sum = n1 + n2 + n3 + n4;
- if (IsEven(sum)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << e1 << " + " << e2 << " + " << e3 << " + " << e4
- << " (" << n1 << " + " << n2 << " + " << n3 << " + " << n4
- << ") evaluates to " << sum << ", which is not even.";
- return AssertionFailure(msg);
-}
-
-// A predicate-formatter functor that asserts the sum of the arguments
-// is an even number.
-struct AssertSumIsEven5Functor {
- AssertionResult operator()(
- const char* e1, const char* e2, const char* e3, const char* e4,
- const char* e5, int n1, int n2, int n3, int n4, int n5) {
- const int sum = n1 + n2 + n3 + n4 + n5;
- if (IsEven(sum)) {
- return AssertionSuccess();
- }
-
- Message msg;
- msg << e1 << " + " << e2 << " + " << e3 << " + " << e4 << " + " << e5
- << " ("
- << n1 << " + " << n2 << " + " << n3 << " + " << n4 << " + " << n5
- << ") evaluates to " << sum << ", which is not even.";
- return AssertionFailure(msg);
- }
-};
-
-
-// Tests unary predicate assertions.
-
-// Tests unary predicate assertions that don't use a custom formatter.
-TEST(Pred1Test, WithoutFormat) {
- // Success cases.
- EXPECT_PRED1(IsEvenFunctor(), 2) << "This failure is UNEXPECTED!";
- ASSERT_PRED1(IsEven, 4);
-
- // Failure cases.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED1(IsEven, 5) << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE(ASSERT_PRED1(IsEvenFunctor(), 5),
- "evaluates to false");
-}
-
-// Tests unary predicate assertions that use a custom formatter.
-TEST(Pred1Test, WithFormat) {
- // Success cases.
- EXPECT_PRED_FORMAT1(AssertIsEven, 2);
- ASSERT_PRED_FORMAT1(AssertIsEvenFunctor(), 4)
- << "This failure is UNEXPECTED!";
-
- // Failure cases.
- const int n = 5;
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT1(AssertIsEvenFunctor(), n),
- "n evaluates to 5, which is not even.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(AssertIsEven, 5) << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-// Tests that unary predicate assertions evaluates their arguments
-// exactly once.
-TEST(Pred1Test, SingleEvaluationOnFailure) {
- // A success case.
- static int n = 0;
- EXPECT_PRED1(IsEven, n++);
- EXPECT_EQ(1, n) << "The argument is not evaluated exactly once.";
-
- // A failure case.
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT1(AssertIsEvenFunctor(), n++)
- << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_EQ(2, n) << "The argument is not evaluated exactly once.";
-}
-
-
-// Tests predicate assertions whose arity is >= 2.
-
-// Tests predicate assertions that don't use a custom formatter.
-TEST(PredTest, WithoutFormat) {
- // Success cases.
- ASSERT_PRED2(SumIsEven2, 2, 4) << "This failure is UNEXPECTED!";
- EXPECT_PRED3(SumIsEven3Functor(), 4, 6, 8);
-
- // Failure cases.
- const int n1 = 1;
- const int n2 = 2;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED2(SumIsEven2, n1, n2) << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED3(SumIsEven3Functor(), 1, 2, 4);
- }, "evaluates to false");
-}
-
-// Tests predicate assertions that use a custom formatter.
-TEST(PredTest, WithFormat) {
- // Success cases.
- ASSERT_PRED_FORMAT4(AssertSumIsEven4, 4, 6, 8, 10) <<
- "This failure is UNEXPECTED!";
- EXPECT_PRED_FORMAT5(AssertSumIsEven5Functor(), 2, 4, 6, 8, 10);
-
- // Failure cases.
- const int n1 = 1;
- const int n2 = 2;
- const int n3 = 4;
- const int n4 = 6;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(AssertSumIsEven4, n1, n2, n3, n4);
- }, "evaluates to 13, which is not even.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT5(AssertSumIsEven5Functor(), 1, 2, 4, 6, 8)
- << "This failure is expected.";
- }, "This failure is expected.");
-}
-
-// Tests that predicate assertions evaluates their arguments
-// exactly once.
-TEST(PredTest, SingleEvaluationOnFailure) {
- // A success case.
- int n1 = 0;
- int n2 = 0;
- EXPECT_PRED2(SumIsEven2, n1++, n2++);
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
-
- // Another success case.
- n1 = n2 = 0;
- int n3 = 0;
- int n4 = 0;
- int n5 = 0;
- ASSERT_PRED_FORMAT5(AssertSumIsEven5Functor(),
- n1++, n2++, n3++, n4++, n5++)
- << "This failure is UNEXPECTED!";
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
- EXPECT_EQ(1, n4) << "Argument 4 is not evaluated exactly once.";
- EXPECT_EQ(1, n5) << "Argument 5 is not evaluated exactly once.";
-
- // A failure case.
- n1 = n2 = n3 = 0;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED3(SumIsEven3Functor(), ++n1, n2++, n3++)
- << "This failure is expected.";
- }, "This failure is expected.");
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
-
- // Another failure case.
- n1 = n2 = n3 = n4 = 0;
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT4(AssertSumIsEven4, ++n1, n2++, n3++, n4++);
- }, "evaluates to 1, which is not even.");
- EXPECT_EQ(1, n1) << "Argument 1 is not evaluated exactly once.";
- EXPECT_EQ(1, n2) << "Argument 2 is not evaluated exactly once.";
- EXPECT_EQ(1, n3) << "Argument 3 is not evaluated exactly once.";
- EXPECT_EQ(1, n4) << "Argument 4 is not evaluated exactly once.";
-}
-
-// Test predicate assertions for sets
-TEST(PredTest, ExpectPredEvalFailure) {
- std::set<int> set_a = {2, 1, 3, 4, 5};
- std::set<int> set_b = {0, 4, 8};
- const auto compare_sets = [] (std::set<int>, std::set<int>) { return false; };
- EXPECT_NONFATAL_FAILURE(
- EXPECT_PRED2(compare_sets, set_a, set_b),
- "compare_sets(set_a, set_b) evaluates to false, where\nset_a evaluates "
- "to { 1, 2, 3, 4, 5 }\nset_b evaluates to { 0, 4, 8 }");
-}
-
-// Some helper functions for testing using overloaded/template
-// functions with ASSERT_PREDn and EXPECT_PREDn.
-
-bool IsPositive(double x) {
- return x > 0;
-}
-
-template <typename T>
-bool IsNegative(T x) {
- return x < 0;
-}
-
-template <typename T1, typename T2>
-bool GreaterThan(T1 x1, T2 x2) {
- return x1 > x2;
-}
-
-// Tests that overloaded functions can be used in *_PRED* as long as
-// their types are explicitly specified.
-TEST(PredicateAssertionTest, AcceptsOverloadedFunction) {
- // C++Builder requires C-style casts rather than static_cast.
- EXPECT_PRED1((bool (*)(int))(IsPositive), 5); // NOLINT
- ASSERT_PRED1((bool (*)(double))(IsPositive), 6.0); // NOLINT
-}
-
-// Tests that template functions can be used in *_PRED* as long as
-// their types are explicitly specified.
-TEST(PredicateAssertionTest, AcceptsTemplateFunction) {
- EXPECT_PRED1(IsNegative<int>, -5);
- // Makes sure that we can handle templates with more than one
- // parameter.
- ASSERT_PRED2((GreaterThan<int, int>), 5, 0);
-}
-
-
-// Some helper functions for testing using overloaded/template
-// functions with ASSERT_PRED_FORMATn and EXPECT_PRED_FORMATn.
-
-AssertionResult IsPositiveFormat(const char* /* expr */, int n) {
- return n > 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-AssertionResult IsPositiveFormat(const char* /* expr */, double x) {
- return x > 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-template <typename T>
-AssertionResult IsNegativeFormat(const char* /* expr */, T x) {
- return x < 0 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-template <typename T1, typename T2>
-AssertionResult EqualsFormat(const char* /* expr1 */, const char* /* expr2 */,
- const T1& x1, const T2& x2) {
- return x1 == x2 ? AssertionSuccess() :
- AssertionFailure(Message() << "Failure");
-}
-
-// Tests that overloaded functions can be used in *_PRED_FORMAT*
-// without explicitly specifying their types.
-TEST(PredicateFormatAssertionTest, AcceptsOverloadedFunction) {
- EXPECT_PRED_FORMAT1(IsPositiveFormat, 5);
- ASSERT_PRED_FORMAT1(IsPositiveFormat, 6.0);
-}
-
-// Tests that template functions can be used in *_PRED_FORMAT* without
-// explicitly specifying their types.
-TEST(PredicateFormatAssertionTest, AcceptsTemplateFunction) {
- EXPECT_PRED_FORMAT1(IsNegativeFormat, -5);
- ASSERT_PRED_FORMAT2(EqualsFormat, 3, 3);
-}
-
-
-// Tests string assertions.
-
-// Tests ASSERT_STREQ with non-NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ) {
- const char * const p1 = "good";
- ASSERT_STREQ(p1, p1);
-
- // Let p2 have the same content as p1, but be at a different address.
- const char p2[] = "good";
- ASSERT_STREQ(p1, p2);
-
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("bad", "good"),
- " \"bad\"\n \"good\"");
-}
-
-// Tests ASSERT_STREQ with NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ_Null) {
- ASSERT_STREQ(static_cast<const char*>(nullptr), nullptr);
- EXPECT_FATAL_FAILURE(ASSERT_STREQ(nullptr, "non-null"), "non-null");
-}
-
-// Tests ASSERT_STREQ with NULL arguments.
-TEST(StringAssertionTest, ASSERT_STREQ_Null2) {
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("non-null", nullptr), "non-null");
-}
-
-// Tests ASSERT_STRNE.
-TEST(StringAssertionTest, ASSERT_STRNE) {
- ASSERT_STRNE("hi", "Hi");
- ASSERT_STRNE("Hi", nullptr);
- ASSERT_STRNE(nullptr, "Hi");
- ASSERT_STRNE("", nullptr);
- ASSERT_STRNE(nullptr, "");
- ASSERT_STRNE("", "Hi");
- ASSERT_STRNE("Hi", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRNE("Hi", "Hi"),
- "\"Hi\" vs \"Hi\"");
-}
-
-// Tests ASSERT_STRCASEEQ.
-TEST(StringAssertionTest, ASSERT_STRCASEEQ) {
- ASSERT_STRCASEEQ("hi", "Hi");
- ASSERT_STRCASEEQ(static_cast<const char*>(nullptr), nullptr);
-
- ASSERT_STRCASEEQ("", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("Hi", "hi2"),
- "Ignoring case");
-}
-
-// Tests ASSERT_STRCASENE.
-TEST(StringAssertionTest, ASSERT_STRCASENE) {
- ASSERT_STRCASENE("hi1", "Hi2");
- ASSERT_STRCASENE("Hi", nullptr);
- ASSERT_STRCASENE(nullptr, "Hi");
- ASSERT_STRCASENE("", nullptr);
- ASSERT_STRCASENE(nullptr, "");
- ASSERT_STRCASENE("", "Hi");
- ASSERT_STRCASENE("Hi", "");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("Hi", "hi"),
- "(ignoring case)");
-}
-
-// Tests *_STREQ on wide strings.
-TEST(StringAssertionTest, STREQ_Wide) {
- // NULL strings.
- ASSERT_STREQ(static_cast<const wchar_t*>(nullptr), nullptr);
-
- // Empty strings.
- ASSERT_STREQ(L"", L"");
-
- // Non-null vs NULL.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"non-null", nullptr), "non-null");
-
- // Equal strings.
- EXPECT_STREQ(L"Hi", L"Hi");
-
- // Unequal strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"abc", L"Abc"),
- "Abc");
-
- // Strings containing wide characters.
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ(L"abc\x8119", L"abc\x8120"),
- "abc");
-
- // The streaming variation.
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_STREQ(L"abc\x8119", L"abc\x8121") << "Expected failure";
- }, "Expected failure");
-}
-
-// Tests *_STRNE on wide strings.
-TEST(StringAssertionTest, STRNE_Wide) {
- // NULL strings.
- EXPECT_NONFATAL_FAILURE(
- { // NOLINT
- EXPECT_STRNE(static_cast<const wchar_t*>(nullptr), nullptr);
- },
- "");
-
- // Empty strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"", L""),
- "L\"\"");
-
- // Non-null vs NULL.
- ASSERT_STRNE(L"non-null", nullptr);
-
- // Equal strings.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"Hi", L"Hi"),
- "L\"Hi\"");
-
- // Unequal strings.
- EXPECT_STRNE(L"abc", L"Abc");
-
- // Strings containing wide characters.
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE(L"abc\x8119", L"abc\x8119"),
- "abc");
-
- // The streaming variation.
- ASSERT_STRNE(L"abc\x8119", L"abc\x8120") << "This shouldn't happen";
-}
-
-// Tests for ::testing::IsSubstring().
-
-// Tests that IsSubstring() returns the correct result when the input
-// argument type is const char*.
-TEST(IsSubstringTest, ReturnsCorrectResultForCString) {
- EXPECT_FALSE(IsSubstring("", "", nullptr, "a"));
- EXPECT_FALSE(IsSubstring("", "", "b", nullptr));
- EXPECT_FALSE(IsSubstring("", "", "needle", "haystack"));
-
- EXPECT_TRUE(IsSubstring("", "", static_cast<const char*>(nullptr), nullptr));
- EXPECT_TRUE(IsSubstring("", "", "needle", "two needles"));
-}
-
-// Tests that IsSubstring() returns the correct result when the input
-// argument type is const wchar_t*.
-TEST(IsSubstringTest, ReturnsCorrectResultForWideCString) {
- EXPECT_FALSE(IsSubstring("", "", kNull, L"a"));
- EXPECT_FALSE(IsSubstring("", "", L"b", kNull));
- EXPECT_FALSE(IsSubstring("", "", L"needle", L"haystack"));
-
- EXPECT_TRUE(
- IsSubstring("", "", static_cast<const wchar_t*>(nullptr), nullptr));
- EXPECT_TRUE(IsSubstring("", "", L"needle", L"two needles"));
-}
-
-// Tests that IsSubstring() generates the correct message when the input
-// argument type is const char*.
-TEST(IsSubstringTest, GeneratesCorrectMessageForCString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: \"needle\"\n"
- "Expected: a substring of haystack_expr\n"
- "Which is: \"haystack\"",
- IsSubstring("needle_expr", "haystack_expr",
- "needle", "haystack").failure_message());
-}
-
-// Tests that IsSubstring returns the correct result when the input
-// argument type is ::std::string.
-TEST(IsSubstringTest, ReturnsCorrectResultsForStdString) {
- EXPECT_TRUE(IsSubstring("", "", std::string("hello"), "ahellob"));
- EXPECT_FALSE(IsSubstring("", "", "hello", std::string("world")));
-}
-
-#if GTEST_HAS_STD_WSTRING
-// Tests that IsSubstring returns the correct result when the input
-// argument type is ::std::wstring.
-TEST(IsSubstringTest, ReturnsCorrectResultForStdWstring) {
- EXPECT_TRUE(IsSubstring("", "", ::std::wstring(L"needle"), L"two needles"));
- EXPECT_FALSE(IsSubstring("", "", L"needle", ::std::wstring(L"haystack")));
-}
-
-// Tests that IsSubstring() generates the correct message when the input
-// argument type is ::std::wstring.
-TEST(IsSubstringTest, GeneratesCorrectMessageForWstring) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: L\"needle\"\n"
- "Expected: a substring of haystack_expr\n"
- "Which is: L\"haystack\"",
- IsSubstring(
- "needle_expr", "haystack_expr",
- ::std::wstring(L"needle"), L"haystack").failure_message());
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests for ::testing::IsNotSubstring().
-
-// Tests that IsNotSubstring() returns the correct result when the input
-// argument type is const char*.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForCString) {
- EXPECT_TRUE(IsNotSubstring("", "", "needle", "haystack"));
- EXPECT_FALSE(IsNotSubstring("", "", "needle", "two needles"));
-}
-
-// Tests that IsNotSubstring() returns the correct result when the input
-// argument type is const wchar_t*.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForWideCString) {
- EXPECT_TRUE(IsNotSubstring("", "", L"needle", L"haystack"));
- EXPECT_FALSE(IsNotSubstring("", "", L"needle", L"two needles"));
-}
-
-// Tests that IsNotSubstring() generates the correct message when the input
-// argument type is const wchar_t*.
-TEST(IsNotSubstringTest, GeneratesCorrectMessageForWideCString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: L\"needle\"\n"
- "Expected: not a substring of haystack_expr\n"
- "Which is: L\"two needles\"",
- IsNotSubstring(
- "needle_expr", "haystack_expr",
- L"needle", L"two needles").failure_message());
-}
-
-// Tests that IsNotSubstring returns the correct result when the input
-// argument type is ::std::string.
-TEST(IsNotSubstringTest, ReturnsCorrectResultsForStdString) {
- EXPECT_FALSE(IsNotSubstring("", "", std::string("hello"), "ahellob"));
- EXPECT_TRUE(IsNotSubstring("", "", "hello", std::string("world")));
-}
-
-// Tests that IsNotSubstring() generates the correct message when the input
-// argument type is ::std::string.
-TEST(IsNotSubstringTest, GeneratesCorrectMessageForStdString) {
- EXPECT_STREQ("Value of: needle_expr\n"
- " Actual: \"needle\"\n"
- "Expected: not a substring of haystack_expr\n"
- "Which is: \"two needles\"",
- IsNotSubstring(
- "needle_expr", "haystack_expr",
- ::std::string("needle"), "two needles").failure_message());
-}
-
-#if GTEST_HAS_STD_WSTRING
-
-// Tests that IsNotSubstring returns the correct result when the input
-// argument type is ::std::wstring.
-TEST(IsNotSubstringTest, ReturnsCorrectResultForStdWstring) {
- EXPECT_FALSE(
- IsNotSubstring("", "", ::std::wstring(L"needle"), L"two needles"));
- EXPECT_TRUE(IsNotSubstring("", "", L"needle", ::std::wstring(L"haystack")));
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests floating-point assertions.
-
-template <typename RawType>
-class FloatingPointTest : public Test {
- protected:
- // Pre-calculated numbers to be used by the tests.
- struct TestValues {
- RawType close_to_positive_zero;
- RawType close_to_negative_zero;
- RawType further_from_negative_zero;
-
- RawType close_to_one;
- RawType further_from_one;
-
- RawType infinity;
- RawType close_to_infinity;
- RawType further_from_infinity;
-
- RawType nan1;
- RawType nan2;
- };
-
- typedef typename testing::internal::FloatingPoint<RawType> Floating;
- typedef typename Floating::Bits Bits;
-
- void SetUp() override {
- const uint32_t max_ulps = Floating::kMaxUlps;
-
- // The bits that represent 0.0.
- const Bits zero_bits = Floating(0).bits();
-
- // Makes some numbers close to 0.0.
- values_.close_to_positive_zero = Floating::ReinterpretBits(
- zero_bits + max_ulps/2);
- values_.close_to_negative_zero = -Floating::ReinterpretBits(
- zero_bits + max_ulps - max_ulps/2);
- values_.further_from_negative_zero = -Floating::ReinterpretBits(
- zero_bits + max_ulps + 1 - max_ulps/2);
-
- // The bits that represent 1.0.
- const Bits one_bits = Floating(1).bits();
-
- // Makes some numbers close to 1.0.
- values_.close_to_one = Floating::ReinterpretBits(one_bits + max_ulps);
- values_.further_from_one = Floating::ReinterpretBits(
- one_bits + max_ulps + 1);
-
- // +infinity.
- values_.infinity = Floating::Infinity();
-
- // The bits that represent +infinity.
- const Bits infinity_bits = Floating(values_.infinity).bits();
-
- // Makes some numbers close to infinity.
- values_.close_to_infinity = Floating::ReinterpretBits(
- infinity_bits - max_ulps);
- values_.further_from_infinity = Floating::ReinterpretBits(
- infinity_bits - max_ulps - 1);
-
- // Makes some NAN's. Sets the most significant bit of the fraction so that
- // our NaN's are quiet; trying to process a signaling NaN would raise an
- // exception if our environment enables floating point exceptions.
- values_.nan1 = Floating::ReinterpretBits(Floating::kExponentBitMask
- | (static_cast<Bits>(1) << (Floating::kFractionBitCount - 1)) | 1);
- values_.nan2 = Floating::ReinterpretBits(Floating::kExponentBitMask
- | (static_cast<Bits>(1) << (Floating::kFractionBitCount - 1)) | 200);
- }
-
- void TestSize() {
- EXPECT_EQ(sizeof(RawType), sizeof(Bits));
- }
-
- static TestValues values_;
-};
-
-template <typename RawType>
-typename FloatingPointTest<RawType>::TestValues
- FloatingPointTest<RawType>::values_;
-
-// Instantiates FloatingPointTest for testing *_FLOAT_EQ.
-typedef FloatingPointTest<float> FloatTest;
-
-// Tests that the size of Float::Bits matches the size of float.
-TEST_F(FloatTest, Size) {
- TestSize();
-}
-
-// Tests comparing with +0 and -0.
-TEST_F(FloatTest, Zeros) {
- EXPECT_FLOAT_EQ(0.0, -0.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(-0.0, 1.0),
- "1.0");
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.5),
- "1.5");
-}
-
-// Tests comparing numbers close to 0.
-//
-// This ensures that *_FLOAT_EQ handles the sign correctly and no
-// overflow occurs when comparing numbers whose absolute value is very
-// small.
-TEST_F(FloatTest, AlmostZeros) {
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const FloatTest::TestValues& v = this->values_;
-
- EXPECT_FLOAT_EQ(0.0, v.close_to_positive_zero);
- EXPECT_FLOAT_EQ(-0.0, v.close_to_negative_zero);
- EXPECT_FLOAT_EQ(v.close_to_positive_zero, v.close_to_negative_zero);
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_FLOAT_EQ(v.close_to_positive_zero,
- v.further_from_negative_zero);
- }, "v.further_from_negative_zero");
-}
-
-// Tests comparing numbers close to each other.
-TEST_F(FloatTest, SmallDiff) {
- EXPECT_FLOAT_EQ(1.0, values_.close_to_one);
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(1.0, values_.further_from_one),
- "values_.further_from_one");
-}
-
-// Tests comparing numbers far apart.
-TEST_F(FloatTest, LargeDiff) {
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(2.5, 3.0),
- "3.0");
-}
-
-// Tests comparing with infinity.
-//
-// This ensures that no overflow occurs when comparing numbers whose
-// absolute value is very large.
-TEST_F(FloatTest, Infinity) {
- EXPECT_FLOAT_EQ(values_.infinity, values_.close_to_infinity);
- EXPECT_FLOAT_EQ(-values_.infinity, -values_.close_to_infinity);
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, -values_.infinity),
- "-values_.infinity");
-
- // This is interesting as the representations of infinity and nan1
- // are only 1 DLP apart.
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.infinity, values_.nan1),
- "values_.nan1");
-}
-
-// Tests that comparing with NAN always returns false.
-TEST_F(FloatTest, NaN) {
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const FloatTest::TestValues& v = this->values_;
-
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(v.nan1, v.nan1),
- "v.nan1");
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(v.nan1, v.nan2),
- "v.nan2");
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(1.0, v.nan1),
- "v.nan1");
-
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(v.nan1, v.infinity),
- "v.infinity");
-}
-
-// Tests that *_FLOAT_EQ are reflexive.
-TEST_F(FloatTest, Reflexive) {
- EXPECT_FLOAT_EQ(0.0, 0.0);
- EXPECT_FLOAT_EQ(1.0, 1.0);
- ASSERT_FLOAT_EQ(values_.infinity, values_.infinity);
-}
-
-// Tests that *_FLOAT_EQ are commutative.
-TEST_F(FloatTest, Commutative) {
- // We already tested EXPECT_FLOAT_EQ(1.0, values_.close_to_one).
- EXPECT_FLOAT_EQ(values_.close_to_one, 1.0);
-
- // We already tested EXPECT_FLOAT_EQ(1.0, values_.further_from_one).
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(values_.further_from_one, 1.0),
- "1.0");
-}
-
-// Tests EXPECT_NEAR.
-TEST_F(FloatTest, EXPECT_NEAR) {
- EXPECT_NEAR(-1.0f, -1.1f, 0.2f);
- EXPECT_NEAR(2.0f, 3.0f, 1.0f);
- EXPECT_NONFATAL_FAILURE(EXPECT_NEAR(1.0f, 1.5f, 0.25f), // NOLINT
- "The difference between 1.0f and 1.5f is 0.5, "
- "which exceeds 0.25f");
-}
-
-// Tests ASSERT_NEAR.
-TEST_F(FloatTest, ASSERT_NEAR) {
- ASSERT_NEAR(-1.0f, -1.1f, 0.2f);
- ASSERT_NEAR(2.0f, 3.0f, 1.0f);
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1.0f, 1.5f, 0.25f), // NOLINT
- "The difference between 1.0f and 1.5f is 0.5, "
- "which exceeds 0.25f");
-}
-
-// Tests the cases where FloatLE() should succeed.
-TEST_F(FloatTest, FloatLESucceeds) {
- EXPECT_PRED_FORMAT2(FloatLE, 1.0f, 2.0f); // When val1 < val2,
- ASSERT_PRED_FORMAT2(FloatLE, 1.0f, 1.0f); // val1 == val2,
-
- // or when val1 is greater than, but almost equals to, val2.
- EXPECT_PRED_FORMAT2(FloatLE, values_.close_to_positive_zero, 0.0f);
-}
-
-// Tests the cases where FloatLE() should fail.
-TEST_F(FloatTest, FloatLEFails) {
- // When val1 is greater than val2 by a large margin,
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT2(FloatLE, 2.0f, 1.0f),
- "(2.0f) <= (1.0f)");
-
- // or by a small yet non-negligible margin,
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, values_.further_from_one, 1.0f);
- }, "(values_.further_from_one) <= (1.0f)");
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, values_.nan1, values_.infinity);
- }, "(values_.nan1) <= (values_.infinity)");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(FloatLE, -values_.infinity, values_.nan1);
- }, "(-values_.infinity) <= (values_.nan1)");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(FloatLE, values_.nan1, values_.nan1);
- }, "(values_.nan1) <= (values_.nan1)");
-}
-
-// Instantiates FloatingPointTest for testing *_DOUBLE_EQ.
-typedef FloatingPointTest<double> DoubleTest;
-
-// Tests that the size of Double::Bits matches the size of double.
-TEST_F(DoubleTest, Size) {
- TestSize();
-}
-
-// Tests comparing with +0 and -0.
-TEST_F(DoubleTest, Zeros) {
- EXPECT_DOUBLE_EQ(0.0, -0.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(-0.0, 1.0),
- "1.0");
- EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(0.0, 1.0),
- "1.0");
-}
-
-// Tests comparing numbers close to 0.
-//
-// This ensures that *_DOUBLE_EQ handles the sign correctly and no
-// overflow occurs when comparing numbers whose absolute value is very
-// small.
-TEST_F(DoubleTest, AlmostZeros) {
- // In C++Builder, names within local classes (such as used by
- // EXPECT_FATAL_FAILURE) cannot be resolved against static members of the
- // scoping class. Use a static local alias as a workaround.
- // We use the assignment syntax since some compilers, like Sun Studio,
- // don't allow initializing references using construction syntax
- // (parentheses).
- static const DoubleTest::TestValues& v = this->values_;
-
- EXPECT_DOUBLE_EQ(0.0, v.close_to_positive_zero);
- EXPECT_DOUBLE_EQ(-0.0, v.close_to_negative_zero);
- EXPECT_DOUBLE_EQ(v.close_to_positive_zero, v.close_to_negative_zero);
-
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_DOUBLE_EQ(v.close_to_positive_zero,
- v.further_from_negative_zero);
- }, "v.further_from_negative_zero");
-}
-
-// Tests comparing numbers close to each other.
-TEST_F(DoubleTest, SmallDiff) {
- EXPECT_DOUBLE_EQ(1.0, values_.close_to_one);
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, values_.further_from_one),
- "values_.further_from_one");
-}
-
-// Tests comparing numbers far apart.
-TEST_F(DoubleTest, LargeDiff) {
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(2.0, 3.0),
- "3.0");
-}
-
-// Tests comparing with infinity.
-//
-// This ensures that no overflow occurs when comparing numbers whose
-// absolute value is very large.
-TEST_F(DoubleTest, Infinity) {
- EXPECT_DOUBLE_EQ(values_.infinity, values_.close_to_infinity);
- EXPECT_DOUBLE_EQ(-values_.infinity, -values_.close_to_infinity);
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, -values_.infinity),
- "-values_.infinity");
-
- // This is interesting as the representations of infinity_ and nan1_
- // are only 1 DLP apart.
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.infinity, values_.nan1),
- "values_.nan1");
-}
-
-// Tests that comparing with NAN always returns false.
-TEST_F(DoubleTest, NaN) {
- static const DoubleTest::TestValues& v = this->values_;
-
- // Nokia's STLport crashes if we try to output infinity or NaN.
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(v.nan1, v.nan1),
- "v.nan1");
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(v.nan1, v.nan2), "v.nan2");
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1.0, v.nan1), "v.nan1");
- EXPECT_FATAL_FAILURE(ASSERT_DOUBLE_EQ(v.nan1, v.infinity),
- "v.infinity");
-}
-
-// Tests that *_DOUBLE_EQ are reflexive.
-TEST_F(DoubleTest, Reflexive) {
- EXPECT_DOUBLE_EQ(0.0, 0.0);
- EXPECT_DOUBLE_EQ(1.0, 1.0);
- ASSERT_DOUBLE_EQ(values_.infinity, values_.infinity);
-}
-
-// Tests that *_DOUBLE_EQ are commutative.
-TEST_F(DoubleTest, Commutative) {
- // We already tested EXPECT_DOUBLE_EQ(1.0, values_.close_to_one).
- EXPECT_DOUBLE_EQ(values_.close_to_one, 1.0);
-
- // We already tested EXPECT_DOUBLE_EQ(1.0, values_.further_from_one).
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(values_.further_from_one, 1.0),
- "1.0");
-}
-
-// Tests EXPECT_NEAR.
-TEST_F(DoubleTest, EXPECT_NEAR) {
- EXPECT_NEAR(-1.0, -1.1, 0.2);
- EXPECT_NEAR(2.0, 3.0, 1.0);
- EXPECT_NONFATAL_FAILURE(EXPECT_NEAR(1.0, 1.5, 0.25), // NOLINT
- "The difference between 1.0 and 1.5 is 0.5, "
- "which exceeds 0.25");
- // At this magnitude adjacent doubles are 512.0 apart, so this triggers a
- // slightly different failure reporting path.
- EXPECT_NONFATAL_FAILURE(
- EXPECT_NEAR(4.2934311416234112e+18, 4.2934311416234107e+18, 1.0),
- "The abs_error parameter 1.0 evaluates to 1 which is smaller than the "
- "minimum distance between doubles for numbers of this magnitude which is "
- "512");
-}
-
-// Tests ASSERT_NEAR.
-TEST_F(DoubleTest, ASSERT_NEAR) {
- ASSERT_NEAR(-1.0, -1.1, 0.2);
- ASSERT_NEAR(2.0, 3.0, 1.0);
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1.0, 1.5, 0.25), // NOLINT
- "The difference between 1.0 and 1.5 is 0.5, "
- "which exceeds 0.25");
-}
-
-// Tests the cases where DoubleLE() should succeed.
-TEST_F(DoubleTest, DoubleLESucceeds) {
- EXPECT_PRED_FORMAT2(DoubleLE, 1.0, 2.0); // When val1 < val2,
- ASSERT_PRED_FORMAT2(DoubleLE, 1.0, 1.0); // val1 == val2,
-
- // or when val1 is greater than, but almost equals to, val2.
- EXPECT_PRED_FORMAT2(DoubleLE, values_.close_to_positive_zero, 0.0);
-}
-
-// Tests the cases where DoubleLE() should fail.
-TEST_F(DoubleTest, DoubleLEFails) {
- // When val1 is greater than val2 by a large margin,
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED_FORMAT2(DoubleLE, 2.0, 1.0),
- "(2.0) <= (1.0)");
-
- // or by a small yet non-negligible margin,
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, values_.further_from_one, 1.0);
- }, "(values_.further_from_one) <= (1.0)");
-
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.infinity);
- }, "(values_.nan1) <= (values_.infinity)");
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_PRED_FORMAT2(DoubleLE, -values_.infinity, values_.nan1);
- }, " (-values_.infinity) <= (values_.nan1)");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_PRED_FORMAT2(DoubleLE, values_.nan1, values_.nan1);
- }, "(values_.nan1) <= (values_.nan1)");
-}
-
-
-// Verifies that a test or test case whose name starts with DISABLED_ is
-// not run.
-
-// A test whose name starts with DISABLED_.
-// Should not run.
-TEST(DisabledTest, DISABLED_TestShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-// A test whose name does not start with DISABLED_.
-// Should run.
-TEST(DisabledTest, NotDISABLED_TestShouldRun) {
- EXPECT_EQ(1, 1);
-}
-
-// A test case whose name starts with DISABLED_.
-// Should not run.
-TEST(DISABLED_TestSuite, TestShouldNotRun) {
- FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
-}
-
-// A test case and test whose names start with DISABLED_.
-// Should not run.
-TEST(DISABLED_TestSuite, DISABLED_TestShouldNotRun) {
- FAIL() << "Unexpected failure: Test in disabled test case should not be run.";
-}
-
-// Check that when all tests in a test case are disabled, SetUpTestSuite() and
-// TearDownTestSuite() are not called.
-class DisabledTestsTest : public Test {
- protected:
- static void SetUpTestSuite() {
- FAIL() << "Unexpected failure: All tests disabled in test case. "
- "SetUpTestSuite() should not be called.";
- }
-
- static void TearDownTestSuite() {
- FAIL() << "Unexpected failure: All tests disabled in test case. "
- "TearDownTestSuite() should not be called.";
- }
-};
-
-TEST_F(DisabledTestsTest, DISABLED_TestShouldNotRun_1) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-TEST_F(DisabledTestsTest, DISABLED_TestShouldNotRun_2) {
- FAIL() << "Unexpected failure: Disabled test should not be run.";
-}
-
-// Tests that disabled typed tests aren't run.
-
-template <typename T>
-class TypedTest : public Test {
-};
-
-typedef testing::Types<int, double> NumericTypes;
-TYPED_TEST_SUITE(TypedTest, NumericTypes);
-
-TYPED_TEST(TypedTest, DISABLED_ShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled typed test should not run.";
-}
-
-template <typename T>
-class DISABLED_TypedTest : public Test {
-};
-
-TYPED_TEST_SUITE(DISABLED_TypedTest, NumericTypes);
-
-TYPED_TEST(DISABLED_TypedTest, ShouldNotRun) {
- FAIL() << "Unexpected failure: Disabled typed test should not run.";
-}
-
-// Tests that disabled type-parameterized tests aren't run.
-
-template <typename T>
-class TypedTestP : public Test {
-};
-
-TYPED_TEST_SUITE_P(TypedTestP);
-
-TYPED_TEST_P(TypedTestP, DISABLED_ShouldNotRun) {
- FAIL() << "Unexpected failure: "
- << "Disabled type-parameterized test should not run.";
-}
-
-REGISTER_TYPED_TEST_SUITE_P(TypedTestP, DISABLED_ShouldNotRun);
-
-INSTANTIATE_TYPED_TEST_SUITE_P(My, TypedTestP, NumericTypes);
-
-template <typename T>
-class DISABLED_TypedTestP : public Test {
-};
-
-TYPED_TEST_SUITE_P(DISABLED_TypedTestP);
-
-TYPED_TEST_P(DISABLED_TypedTestP, ShouldNotRun) {
- FAIL() << "Unexpected failure: "
- << "Disabled type-parameterized test should not run.";
-}
-
-REGISTER_TYPED_TEST_SUITE_P(DISABLED_TypedTestP, ShouldNotRun);
-
-INSTANTIATE_TYPED_TEST_SUITE_P(My, DISABLED_TypedTestP, NumericTypes);
-
-// Tests that assertion macros evaluate their arguments exactly once.
-
-class SingleEvaluationTest : public Test {
- public: // Must be public and not protected due to a bug in g++ 3.4.2.
- // This helper function is needed by the FailedASSERT_STREQ test
- // below. It's public to work around C++Builder's bug with scoping local
- // classes.
- static void CompareAndIncrementCharPtrs() {
- ASSERT_STREQ(p1_++, p2_++);
- }
-
- // This helper function is needed by the FailedASSERT_NE test below. It's
- // public to work around C++Builder's bug with scoping local classes.
- static void CompareAndIncrementInts() {
- ASSERT_NE(a_++, b_++);
- }
-
- protected:
- SingleEvaluationTest() {
- p1_ = s1_;
- p2_ = s2_;
- a_ = 0;
- b_ = 0;
- }
-
- static const char* const s1_;
- static const char* const s2_;
- static const char* p1_;
- static const char* p2_;
-
- static int a_;
- static int b_;
-};
-
-const char* const SingleEvaluationTest::s1_ = "01234";
-const char* const SingleEvaluationTest::s2_ = "abcde";
-const char* SingleEvaluationTest::p1_;
-const char* SingleEvaluationTest::p2_;
-int SingleEvaluationTest::a_;
-int SingleEvaluationTest::b_;
-
-// Tests that when ASSERT_STREQ fails, it evaluates its arguments
-// exactly once.
-TEST_F(SingleEvaluationTest, FailedASSERT_STREQ) {
- EXPECT_FATAL_FAILURE(SingleEvaluationTest::CompareAndIncrementCharPtrs(),
- "p2_++");
- EXPECT_EQ(s1_ + 1, p1_);
- EXPECT_EQ(s2_ + 1, p2_);
-}
-
-// Tests that string assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, ASSERT_STR) {
- // successful EXPECT_STRNE
- EXPECT_STRNE(p1_++, p2_++);
- EXPECT_EQ(s1_ + 1, p1_);
- EXPECT_EQ(s2_ + 1, p2_);
-
- // failed EXPECT_STRCASEEQ
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ(p1_++, p2_++),
- "Ignoring case");
- EXPECT_EQ(s1_ + 2, p1_);
- EXPECT_EQ(s2_ + 2, p2_);
-}
-
-// Tests that when ASSERT_NE fails, it evaluates its arguments exactly
-// once.
-TEST_F(SingleEvaluationTest, FailedASSERT_NE) {
- EXPECT_FATAL_FAILURE(SingleEvaluationTest::CompareAndIncrementInts(),
- "(a_++) != (b_++)");
- EXPECT_EQ(1, a_);
- EXPECT_EQ(1, b_);
-}
-
-// Tests that assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, OtherCases) {
- // successful EXPECT_TRUE
- EXPECT_TRUE(0 == a_++); // NOLINT
- EXPECT_EQ(1, a_);
-
- // failed EXPECT_TRUE
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(-1 == a_++), "-1 == a_++");
- EXPECT_EQ(2, a_);
-
- // successful EXPECT_GT
- EXPECT_GT(a_++, b_++);
- EXPECT_EQ(3, a_);
- EXPECT_EQ(1, b_);
-
- // failed EXPECT_LT
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(a_++, b_++), "(a_++) < (b_++)");
- EXPECT_EQ(4, a_);
- EXPECT_EQ(2, b_);
-
- // successful ASSERT_TRUE
- ASSERT_TRUE(0 < a_++); // NOLINT
- EXPECT_EQ(5, a_);
-
- // successful ASSERT_GT
- ASSERT_GT(a_++, b_++);
- EXPECT_EQ(6, a_);
- EXPECT_EQ(3, b_);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-#if GTEST_HAS_RTTI
-
-#ifdef _MSC_VER
-#define ERROR_DESC "class std::runtime_error"
-#else
-#define ERROR_DESC "std::runtime_error"
-#endif
-
-#else // GTEST_HAS_RTTI
-
-#define ERROR_DESC "an std::exception-derived error"
-
-#endif // GTEST_HAS_RTTI
-
-void ThrowAnInteger() {
- throw 1;
-}
-void ThrowRuntimeError(const char* what) {
- throw std::runtime_error(what);
-}
-
-// Tests that assertion arguments are evaluated exactly once.
-TEST_F(SingleEvaluationTest, ExceptionTests) {
- // successful EXPECT_THROW
- EXPECT_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }, int);
- EXPECT_EQ(1, a_);
-
- // failed EXPECT_THROW, throws different
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }, bool), "throws a different type");
- EXPECT_EQ(2, a_);
-
- // failed EXPECT_THROW, throws runtime error
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW({ // NOLINT
- a_++;
- ThrowRuntimeError("A description");
- }, bool), "throws " ERROR_DESC " with description \"A description\"");
- EXPECT_EQ(3, a_);
-
- // failed EXPECT_THROW, throws nothing
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(a_++, bool), "throws nothing");
- EXPECT_EQ(4, a_);
-
- // successful EXPECT_NO_THROW
- EXPECT_NO_THROW(a_++);
- EXPECT_EQ(5, a_);
-
- // failed EXPECT_NO_THROW
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- }), "it throws");
- EXPECT_EQ(6, a_);
-
- // successful EXPECT_ANY_THROW
- EXPECT_ANY_THROW({ // NOLINT
- a_++;
- ThrowAnInteger();
- });
- EXPECT_EQ(7, a_);
-
- // failed EXPECT_ANY_THROW
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(a_++), "it doesn't");
- EXPECT_EQ(8, a_);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests {ASSERT|EXPECT}_NO_FATAL_FAILURE.
-class NoFatalFailureTest : public Test {
- protected:
- void Succeeds() {}
- void FailsNonFatal() {
- ADD_FAILURE() << "some non-fatal failure";
- }
- void Fails() {
- FAIL() << "some fatal failure";
- }
-
- void DoAssertNoFatalFailureOnFails() {
- ASSERT_NO_FATAL_FAILURE(Fails());
- ADD_FAILURE() << "should not reach here.";
- }
-
- void DoExpectNoFatalFailureOnFails() {
- EXPECT_NO_FATAL_FAILURE(Fails());
- ADD_FAILURE() << "other failure";
- }
-};
-
-TEST_F(NoFatalFailureTest, NoFailure) {
- EXPECT_NO_FATAL_FAILURE(Succeeds());
- ASSERT_NO_FATAL_FAILURE(Succeeds());
-}
-
-TEST_F(NoFatalFailureTest, NonFatalIsNoFailure) {
- EXPECT_NONFATAL_FAILURE(
- EXPECT_NO_FATAL_FAILURE(FailsNonFatal()),
- "some non-fatal failure");
- EXPECT_NONFATAL_FAILURE(
- ASSERT_NO_FATAL_FAILURE(FailsNonFatal()),
- "some non-fatal failure");
-}
-
-TEST_F(NoFatalFailureTest, AssertNoFatalFailureOnFatalFailure) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- DoAssertNoFatalFailureOnFails();
- }
- ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "it does",
- gtest_failures.GetTestPartResult(1).message());
-}
-
-TEST_F(NoFatalFailureTest, ExpectNoFatalFailureOnFatalFailure) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- DoExpectNoFatalFailureOnFails();
- }
- ASSERT_EQ(3, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(2).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "some fatal failure",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "it does",
- gtest_failures.GetTestPartResult(1).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "other failure",
- gtest_failures.GetTestPartResult(2).message());
-}
-
-TEST_F(NoFatalFailureTest, MessageIsStreamable) {
- TestPartResultArray gtest_failures;
- {
- ScopedFakeTestPartResultReporter gtest_reporter(&gtest_failures);
- EXPECT_NO_FATAL_FAILURE(FAIL() << "foo") << "my message";
- }
- ASSERT_EQ(2, gtest_failures.size());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(0).type());
- EXPECT_EQ(TestPartResult::kNonFatalFailure,
- gtest_failures.GetTestPartResult(1).type());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "foo",
- gtest_failures.GetTestPartResult(0).message());
- EXPECT_PRED_FORMAT2(testing::IsSubstring, "my message",
- gtest_failures.GetTestPartResult(1).message());
-}
-
-// Tests non-string assertions.
-
-std::string EditsToString(const std::vector<EditType>& edits) {
- std::string out;
- for (size_t i = 0; i < edits.size(); ++i) {
- static const char kEdits[] = " +-/";
- out.append(1, kEdits[edits[i]]);
- }
- return out;
-}
-
-std::vector<size_t> CharsToIndices(const std::string& str) {
- std::vector<size_t> out;
- for (size_t i = 0; i < str.size(); ++i) {
- out.push_back(static_cast<size_t>(str[i]));
- }
- return out;
-}
-
-std::vector<std::string> CharsToLines(const std::string& str) {
- std::vector<std::string> out;
- for (size_t i = 0; i < str.size(); ++i) {
- out.push_back(str.substr(i, 1));
- }
- return out;
-}
-
-TEST(EditDistance, TestSuites) {
- struct Case {
- int line;
- const char* left;
- const char* right;
- const char* expected_edits;
- const char* expected_diff;
- };
- static const Case kCases[] = {
- // No change.
- {__LINE__, "A", "A", " ", ""},
- {__LINE__, "ABCDE", "ABCDE", " ", ""},
- // Simple adds.
- {__LINE__, "X", "XA", " +", "@@ +1,2 @@\n X\n+A\n"},
- {__LINE__, "X", "XABCD", " ++++", "@@ +1,5 @@\n X\n+A\n+B\n+C\n+D\n"},
- // Simple removes.
- {__LINE__, "XA", "X", " -", "@@ -1,2 @@\n X\n-A\n"},
- {__LINE__, "XABCD", "X", " ----", "@@ -1,5 @@\n X\n-A\n-B\n-C\n-D\n"},
- // Simple replaces.
- {__LINE__, "A", "a", "/", "@@ -1,1 +1,1 @@\n-A\n+a\n"},
- {__LINE__, "ABCD", "abcd", "////",
- "@@ -1,4 +1,4 @@\n-A\n-B\n-C\n-D\n+a\n+b\n+c\n+d\n"},
- // Path finding.
- {__LINE__, "ABCDEFGH", "ABXEGH1", " -/ - +",
- "@@ -1,8 +1,7 @@\n A\n B\n-C\n-D\n+X\n E\n-F\n G\n H\n+1\n"},
- {__LINE__, "AAAABCCCC", "ABABCDCDC", "- / + / ",
- "@@ -1,9 +1,9 @@\n-A\n A\n-A\n+B\n A\n B\n C\n+D\n C\n-C\n+D\n C\n"},
- {__LINE__, "ABCDE", "BCDCD", "- +/",
- "@@ -1,5 +1,5 @@\n-A\n B\n C\n D\n-E\n+C\n+D\n"},
- {__LINE__, "ABCDEFGHIJKL", "BCDCDEFGJKLJK", "- ++ -- ++",
- "@@ -1,4 +1,5 @@\n-A\n B\n+C\n+D\n C\n D\n"
- "@@ -6,7 +7,7 @@\n F\n G\n-H\n-I\n J\n K\n L\n+J\n+K\n"},
- {}};
- for (const Case* c = kCases; c->left; ++c) {
- EXPECT_TRUE(c->expected_edits ==
- EditsToString(CalculateOptimalEdits(CharsToIndices(c->left),
- CharsToIndices(c->right))))
- << "Left <" << c->left << "> Right <" << c->right << "> Edits <"
- << EditsToString(CalculateOptimalEdits(
- CharsToIndices(c->left), CharsToIndices(c->right))) << ">";
- EXPECT_TRUE(c->expected_diff == CreateUnifiedDiff(CharsToLines(c->left),
- CharsToLines(c->right)))
- << "Left <" << c->left << "> Right <" << c->right << "> Diff <"
- << CreateUnifiedDiff(CharsToLines(c->left), CharsToLines(c->right))
- << ">";
- }
-}
-
-// Tests EqFailure(), used for implementing *EQ* assertions.
-TEST(AssertionTest, EqFailure) {
- const std::string foo_val("5"), bar_val("6");
- const std::string msg1(
- EqFailure("foo", "bar", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " foo\n"
- " Which is: 5\n"
- " bar\n"
- " Which is: 6",
- msg1.c_str());
-
- const std::string msg2(
- EqFailure("foo", "6", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " foo\n"
- " Which is: 5\n"
- " 6",
- msg2.c_str());
-
- const std::string msg3(
- EqFailure("5", "bar", foo_val, bar_val, false)
- .failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " 5\n"
- " bar\n"
- " Which is: 6",
- msg3.c_str());
-
- const std::string msg4(
- EqFailure("5", "6", foo_val, bar_val, false).failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " 5\n"
- " 6",
- msg4.c_str());
-
- const std::string msg5(
- EqFailure("foo", "bar",
- std::string("\"x\""), std::string("\"y\""),
- true).failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " foo\n"
- " Which is: \"x\"\n"
- " bar\n"
- " Which is: \"y\"\n"
- "Ignoring case",
- msg5.c_str());
-}
-
-TEST(AssertionTest, EqFailureWithDiff) {
- const std::string left(
- "1\\n2XXX\\n3\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12XXX\\n13\\n14\\n15");
- const std::string right(
- "1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n12\\n13\\n14");
- const std::string msg1(
- EqFailure("left", "right", left, right, false).failure_message());
- EXPECT_STREQ(
- "Expected equality of these values:\n"
- " left\n"
- " Which is: "
- "1\\n2XXX\\n3\\n5\\n6\\n7\\n8\\n9\\n10\\n11\\n12XXX\\n13\\n14\\n15\n"
- " right\n"
- " Which is: 1\\n2\\n3\\n4\\n5\\n6\\n7\\n8\\n9\\n11\\n12\\n13\\n14\n"
- "With diff:\n@@ -1,5 +1,6 @@\n 1\n-2XXX\n+2\n 3\n+4\n 5\n 6\n"
- "@@ -7,8 +8,6 @@\n 8\n 9\n-10\n 11\n-12XXX\n+12\n 13\n 14\n-15\n",
- msg1.c_str());
-}
-
-// Tests AppendUserMessage(), used for implementing the *EQ* macros.
-TEST(AssertionTest, AppendUserMessage) {
- const std::string foo("foo");
-
- Message msg;
- EXPECT_STREQ("foo",
- AppendUserMessage(foo, msg).c_str());
-
- msg << "bar";
- EXPECT_STREQ("foo\nbar",
- AppendUserMessage(foo, msg).c_str());
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-#endif
-
-// Tests ASSERT_TRUE.
-TEST(AssertionTest, ASSERT_TRUE) {
- ASSERT_TRUE(2 > 1); // NOLINT
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(2 < 1),
- "2 < 1");
-}
-
-// Tests ASSERT_TRUE(predicate) for predicates returning AssertionResult.
-TEST(AssertionTest, AssertTrueWithAssertionResult) {
- ASSERT_TRUE(ResultIsEven(2));
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(ResultIsEven(3)),
- "Value of: ResultIsEven(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-#endif
- ASSERT_TRUE(ResultIsEvenNoExplanation(2));
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(ResultIsEvenNoExplanation(3)),
- "Value of: ResultIsEvenNoExplanation(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-}
-
-// Tests ASSERT_FALSE.
-TEST(AssertionTest, ASSERT_FALSE) {
- ASSERT_FALSE(2 < 1); // NOLINT
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(2 > 1),
- "Value of: 2 > 1\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-// Tests ASSERT_FALSE(predicate) for predicates returning AssertionResult.
-TEST(AssertionTest, AssertFalseWithAssertionResult) {
- ASSERT_FALSE(ResultIsEven(3));
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(ResultIsEven(2)),
- "Value of: ResultIsEven(2)\n"
- " Actual: true (2 is even)\n"
- "Expected: false");
-#endif
- ASSERT_FALSE(ResultIsEvenNoExplanation(3));
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(ResultIsEvenNoExplanation(2)),
- "Value of: ResultIsEvenNoExplanation(2)\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them
-# pragma option pop
-#endif
-
-// Tests using ASSERT_EQ on double values. The purpose is to make
-// sure that the specialization we did for integer and anonymous enums
-// isn't used for double arguments.
-TEST(ExpectTest, ASSERT_EQ_Double) {
- // A success.
- ASSERT_EQ(5.6, 5.6);
-
- // A failure.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(5.1, 5.2),
- "5.1");
-}
-
-// Tests ASSERT_EQ.
-TEST(AssertionTest, ASSERT_EQ) {
- ASSERT_EQ(5, 2 + 3);
- EXPECT_FATAL_FAILURE(ASSERT_EQ(5, 2*3),
- "Expected equality of these values:\n"
- " 5\n"
- " 2*3\n"
- " Which is: 6");
-}
-
-// Tests ASSERT_EQ(NULL, pointer).
-TEST(AssertionTest, ASSERT_EQ_NULL) {
- // A success.
- const char* p = nullptr;
- ASSERT_EQ(nullptr, p);
-
- // A failure.
- static int n = 0;
- EXPECT_FATAL_FAILURE(ASSERT_EQ(nullptr, &n), " &n\n Which is:");
-}
-
-// Tests ASSERT_EQ(0, non_pointer). Since the literal 0 can be
-// treated as a null pointer by the compiler, we need to make sure
-// that ASSERT_EQ(0, non_pointer) isn't interpreted by Google Test as
-// ASSERT_EQ(static_cast<void*>(NULL), non_pointer).
-TEST(ExpectTest, ASSERT_EQ_0) {
- int n = 0;
-
- // A success.
- ASSERT_EQ(0, n);
-
- // A failure.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(0, 5.6),
- " 0\n 5.6");
-}
-
-// Tests ASSERT_NE.
-TEST(AssertionTest, ASSERT_NE) {
- ASSERT_NE(6, 7);
- EXPECT_FATAL_FAILURE(ASSERT_NE('a', 'a'),
- "Expected: ('a') != ('a'), "
- "actual: 'a' (97, 0x61) vs 'a' (97, 0x61)");
-}
-
-// Tests ASSERT_LE.
-TEST(AssertionTest, ASSERT_LE) {
- ASSERT_LE(2, 3);
- ASSERT_LE(2, 2);
- EXPECT_FATAL_FAILURE(ASSERT_LE(2, 0),
- "Expected: (2) <= (0), actual: 2 vs 0");
-}
-
-// Tests ASSERT_LT.
-TEST(AssertionTest, ASSERT_LT) {
- ASSERT_LT(2, 3);
- EXPECT_FATAL_FAILURE(ASSERT_LT(2, 2),
- "Expected: (2) < (2), actual: 2 vs 2");
-}
-
-// Tests ASSERT_GE.
-TEST(AssertionTest, ASSERT_GE) {
- ASSERT_GE(2, 1);
- ASSERT_GE(2, 2);
- EXPECT_FATAL_FAILURE(ASSERT_GE(2, 3),
- "Expected: (2) >= (3), actual: 2 vs 3");
-}
-
-// Tests ASSERT_GT.
-TEST(AssertionTest, ASSERT_GT) {
- ASSERT_GT(2, 1);
- EXPECT_FATAL_FAILURE(ASSERT_GT(2, 2),
- "Expected: (2) > (2), actual: 2 vs 2");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-void ThrowNothing() {}
-
-// Tests ASSERT_THROW.
-TEST(AssertionTest, ASSERT_THROW) {
- ASSERT_THROW(ThrowAnInteger(), int);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowAnInteger(), bool),
- "Expected: ThrowAnInteger() throws an exception of type bool.\n"
- " Actual: it throws a different type.");
- EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowRuntimeError("A description"), std::logic_error),
- "Expected: ThrowRuntimeError(\"A description\") "
- "throws an exception of type std::logic_error.\n "
- "Actual: it throws " ERROR_DESC " "
- "with description \"A description\".");
-# endif
-
- EXPECT_FATAL_FAILURE(
- ASSERT_THROW(ThrowNothing(), bool),
- "Expected: ThrowNothing() throws an exception of type bool.\n"
- " Actual: it throws nothing.");
-}
-
-// Tests ASSERT_NO_THROW.
-TEST(AssertionTest, ASSERT_NO_THROW) {
- ASSERT_NO_THROW(ThrowNothing());
- EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowAnInteger()),
- "Expected: ThrowAnInteger() doesn't throw an exception."
- "\n Actual: it throws.");
- EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowRuntimeError("A description")),
- "Expected: ThrowRuntimeError(\"A description\") "
- "doesn't throw an exception.\n "
- "Actual: it throws " ERROR_DESC " "
- "with description \"A description\".");
-}
-
-// Tests ASSERT_ANY_THROW.
-TEST(AssertionTest, ASSERT_ANY_THROW) {
- ASSERT_ANY_THROW(ThrowAnInteger());
- EXPECT_FATAL_FAILURE(
- ASSERT_ANY_THROW(ThrowNothing()),
- "Expected: ThrowNothing() throws an exception.\n"
- " Actual: it doesn't.");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Makes sure we deal with the precedence of <<. This test should
-// compile.
-TEST(AssertionTest, AssertPrecedence) {
- ASSERT_EQ(1 < 2, true);
- bool false_value = false;
- ASSERT_EQ(true && false_value, false);
-}
-
-// A subroutine used by the following test.
-void TestEq1(int x) {
- ASSERT_EQ(1, x);
-}
-
-// Tests calling a test subroutine that's not part of a fixture.
-TEST(AssertionTest, NonFixtureSubroutine) {
- EXPECT_FATAL_FAILURE(TestEq1(2),
- " x\n Which is: 2");
-}
-
-// An uncopyable class.
-class Uncopyable {
- public:
- explicit Uncopyable(int a_value) : value_(a_value) {}
-
- int value() const { return value_; }
- bool operator==(const Uncopyable& rhs) const {
- return value() == rhs.value();
- }
- private:
- // This constructor deliberately has no implementation, as we don't
- // want this class to be copyable.
- Uncopyable(const Uncopyable&); // NOLINT
-
- int value_;
-};
-
-::std::ostream& operator<<(::std::ostream& os, const Uncopyable& value) {
- return os << value.value();
-}
-
-
-bool IsPositiveUncopyable(const Uncopyable& x) {
- return x.value() > 0;
-}
-
-// A subroutine used by the following test.
-void TestAssertNonPositive() {
- Uncopyable y(-1);
- ASSERT_PRED1(IsPositiveUncopyable, y);
-}
-// A subroutine used by the following test.
-void TestAssertEqualsUncopyable() {
- Uncopyable x(5);
- Uncopyable y(-1);
- ASSERT_EQ(x, y);
-}
-
-// Tests that uncopyable objects can be used in assertions.
-TEST(AssertionTest, AssertWorksWithUncopyableObject) {
- Uncopyable x(5);
- ASSERT_PRED1(IsPositiveUncopyable, x);
- ASSERT_EQ(x, x);
- EXPECT_FATAL_FAILURE(TestAssertNonPositive(),
- "IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
- EXPECT_FATAL_FAILURE(TestAssertEqualsUncopyable(),
- "Expected equality of these values:\n"
- " x\n Which is: 5\n y\n Which is: -1");
-}
-
-// Tests that uncopyable objects can be used in expects.
-TEST(AssertionTest, ExpectWorksWithUncopyableObject) {
- Uncopyable x(5);
- EXPECT_PRED1(IsPositiveUncopyable, x);
- Uncopyable y(-1);
- EXPECT_NONFATAL_FAILURE(EXPECT_PRED1(IsPositiveUncopyable, y),
- "IsPositiveUncopyable(y) evaluates to false, where\ny evaluates to -1");
- EXPECT_EQ(x, x);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y),
- "Expected equality of these values:\n"
- " x\n Which is: 5\n y\n Which is: -1");
-}
-
-enum NamedEnum {
- kE1 = 0,
- kE2 = 1
-};
-
-TEST(AssertionTest, NamedEnum) {
- EXPECT_EQ(kE1, kE1);
- EXPECT_LT(kE1, kE2);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Which is: 0");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(kE1, kE2), "Which is: 1");
-}
-
-// Sun Studio and HP aCC2reject this code.
-#if !defined(__SUNPRO_CC) && !defined(__HP_aCC)
-
-// Tests using assertions with anonymous enums.
-enum {
- kCaseA = -1,
-
-# if GTEST_OS_LINUX
-
- // We want to test the case where the size of the anonymous enum is
- // larger than sizeof(int), to make sure our implementation of the
- // assertions doesn't truncate the enums. However, MSVC
- // (incorrectly) doesn't allow an enum value to exceed the range of
- // an int, so this has to be conditionally compiled.
- //
- // On Linux, kCaseB and kCaseA have the same value when truncated to
- // int size. We want to test whether this will confuse the
- // assertions.
- kCaseB = testing::internal::kMaxBiggestInt,
-
-# else
-
- kCaseB = INT_MAX,
-
-# endif // GTEST_OS_LINUX
-
- kCaseC = 42
-};
-
-TEST(AssertionTest, AnonymousEnum) {
-# if GTEST_OS_LINUX
-
- EXPECT_EQ(static_cast<int>(kCaseA), static_cast<int>(kCaseB));
-
-# endif // GTEST_OS_LINUX
-
- EXPECT_EQ(kCaseA, kCaseA);
- EXPECT_NE(kCaseA, kCaseB);
- EXPECT_LT(kCaseA, kCaseB);
- EXPECT_LE(kCaseA, kCaseB);
- EXPECT_GT(kCaseB, kCaseA);
- EXPECT_GE(kCaseA, kCaseA);
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(kCaseA, kCaseB),
- "(kCaseA) >= (kCaseB)");
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(kCaseA, kCaseC),
- "-1 vs 42");
-
- ASSERT_EQ(kCaseA, kCaseA);
- ASSERT_NE(kCaseA, kCaseB);
- ASSERT_LT(kCaseA, kCaseB);
- ASSERT_LE(kCaseA, kCaseB);
- ASSERT_GT(kCaseB, kCaseA);
- ASSERT_GE(kCaseA, kCaseA);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseB),
- " kCaseB\n Which is: ");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
- "\n Which is: 42");
-# endif
-
- EXPECT_FATAL_FAILURE(ASSERT_EQ(kCaseA, kCaseC),
- "\n Which is: -1");
-}
-
-#endif // !GTEST_OS_MAC && !defined(__SUNPRO_CC)
-
-#if GTEST_OS_WINDOWS
-
-static HRESULT UnexpectedHRESULTFailure() {
- return E_UNEXPECTED;
-}
-
-static HRESULT OkHRESULTSuccess() {
- return S_OK;
-}
-
-static HRESULT FalseHRESULTSuccess() {
- return S_FALSE;
-}
-
-// HRESULT assertion tests test both zero and non-zero
-// success codes as well as failure message for each.
-//
-// Windows CE doesn't support message texts.
-TEST(HRESULTAssertionTest, EXPECT_HRESULT_SUCCEEDED) {
- EXPECT_HRESULT_SUCCEEDED(S_OK);
- EXPECT_HRESULT_SUCCEEDED(S_FALSE);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
- "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
- " Actual: 0x8000FFFF");
-}
-
-TEST(HRESULTAssertionTest, ASSERT_HRESULT_SUCCEEDED) {
- ASSERT_HRESULT_SUCCEEDED(S_OK);
- ASSERT_HRESULT_SUCCEEDED(S_FALSE);
-
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_SUCCEEDED(UnexpectedHRESULTFailure()),
- "Expected: (UnexpectedHRESULTFailure()) succeeds.\n"
- " Actual: 0x8000FFFF");
-}
-
-TEST(HRESULTAssertionTest, EXPECT_HRESULT_FAILED) {
- EXPECT_HRESULT_FAILED(E_UNEXPECTED);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(OkHRESULTSuccess()),
- "Expected: (OkHRESULTSuccess()) fails.\n"
- " Actual: 0x0");
- EXPECT_NONFATAL_FAILURE(EXPECT_HRESULT_FAILED(FalseHRESULTSuccess()),
- "Expected: (FalseHRESULTSuccess()) fails.\n"
- " Actual: 0x1");
-}
-
-TEST(HRESULTAssertionTest, ASSERT_HRESULT_FAILED) {
- ASSERT_HRESULT_FAILED(E_UNEXPECTED);
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(OkHRESULTSuccess()),
- "Expected: (OkHRESULTSuccess()) fails.\n"
- " Actual: 0x0");
-# endif
-
- EXPECT_FATAL_FAILURE(ASSERT_HRESULT_FAILED(FalseHRESULTSuccess()),
- "Expected: (FalseHRESULTSuccess()) fails.\n"
- " Actual: 0x1");
-}
-
-// Tests that streaming to the HRESULT macros works.
-TEST(HRESULTAssertionTest, Streaming) {
- EXPECT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
- ASSERT_HRESULT_SUCCEEDED(S_OK) << "unexpected failure";
- EXPECT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
- ASSERT_HRESULT_FAILED(E_UNEXPECTED) << "unexpected failure";
-
- EXPECT_NONFATAL_FAILURE(
- EXPECT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
- "expected failure");
-
-# ifndef __BORLANDC__
-
- // ICE's in C++Builder 2007 and 2009.
- EXPECT_FATAL_FAILURE(
- ASSERT_HRESULT_SUCCEEDED(E_UNEXPECTED) << "expected failure",
- "expected failure");
-# endif
-
- EXPECT_NONFATAL_FAILURE(
- EXPECT_HRESULT_FAILED(S_OK) << "expected failure",
- "expected failure");
-
- EXPECT_FATAL_FAILURE(
- ASSERT_HRESULT_FAILED(S_OK) << "expected failure",
- "expected failure");
-}
-
-#endif // GTEST_OS_WINDOWS
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-// Tests that the assertion macros behave like single statements.
-TEST(AssertionSyntaxTest, BasicAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- ASSERT_TRUE(false) << "This should never be executed; "
- "It's a compilation test only.";
-
- if (AlwaysTrue())
- EXPECT_FALSE(false);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_LT(1, 3);
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- EXPECT_GT(3, 2) << "";
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-#if GTEST_HAS_EXCEPTIONS
-// Tests that the compiler will not complain about unreachable code in the
-// EXPECT_THROW/EXPECT_ANY_THROW/EXPECT_NO_THROW macros.
-TEST(ExpectThrowTest, DoesNotGenerateUnreachableCodeWarning) {
- int n = 0;
-
- EXPECT_THROW(throw 1, int);
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(n++, int), "");
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(throw 1, const char*), "");
- EXPECT_NO_THROW(n++);
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(throw 1), "");
- EXPECT_ANY_THROW(throw 1);
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(n++), "");
-}
-
-TEST(ExpectThrowTest, DoesNotGenerateDuplicateCatchClauseWarning) {
- EXPECT_THROW(throw std::exception(), std::exception);
-}
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-TEST(AssertionSyntaxTest, ExceptionAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- EXPECT_THROW(ThrowNothing(), bool);
-
- if (AlwaysTrue())
- EXPECT_THROW(ThrowAnInteger(), int);
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- EXPECT_NO_THROW(ThrowAnInteger());
-
- if (AlwaysTrue())
- EXPECT_NO_THROW(ThrowNothing());
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- EXPECT_ANY_THROW(ThrowNothing());
-
- if (AlwaysTrue())
- EXPECT_ANY_THROW(ThrowAnInteger());
- else
- ; // NOLINT
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// The following code intentionally tests a suboptimal syntax.
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wdangling-else"
-#pragma GCC diagnostic ignored "-Wempty-body"
-#pragma GCC diagnostic ignored "-Wpragmas"
-#endif
-TEST(AssertionSyntaxTest, NoFatalFailureAssertionsBehavesLikeSingleStatement) {
- if (AlwaysFalse())
- EXPECT_NO_FATAL_FAILURE(FAIL()) << "This should never be executed. "
- << "It's a compilation test only.";
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ASSERT_NO_FATAL_FAILURE(FAIL()) << "";
- else
- ; // NOLINT
-
- if (AlwaysTrue())
- EXPECT_NO_FATAL_FAILURE(SUCCEED());
- else
- ; // NOLINT
-
- if (AlwaysFalse())
- ; // NOLINT
- else
- ASSERT_NO_FATAL_FAILURE(SUCCEED());
-}
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-// Tests that the assertion macros work well with switch statements.
-TEST(AssertionSyntaxTest, WorksWithSwitch) {
- switch (0) {
- case 1:
- break;
- default:
- ASSERT_TRUE(true);
- }
-
- switch (0)
- case 0:
- EXPECT_FALSE(false) << "EXPECT_FALSE failed in switch case";
-
- // Binary assertions are implemented using a different code path
- // than the Boolean assertions. Hence we test them separately.
- switch (0) {
- case 1:
- default:
- ASSERT_EQ(1, 1) << "ASSERT_EQ failed in default switch handler";
- }
-
- switch (0)
- case 0:
- EXPECT_NE(1, 2);
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-void ThrowAString() {
- throw "std::string";
-}
-
-// Test that the exception assertion macros compile and work with const
-// type qualifier.
-TEST(AssertionSyntaxTest, WorksWithConst) {
- ASSERT_THROW(ThrowAString(), const char*);
-
- EXPECT_THROW(ThrowAString(), const char*);
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-} // namespace
-
-namespace testing {
-
-// Tests that Google Test tracks SUCCEED*.
-TEST(SuccessfulAssertionTest, SUCCEED) {
- SUCCEED();
- SUCCEED() << "OK";
- EXPECT_EQ(2, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful EXPECT_*.
-TEST(SuccessfulAssertionTest, EXPECT) {
- EXPECT_TRUE(true);
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful EXPECT_STR*.
-TEST(SuccessfulAssertionTest, EXPECT_STR) {
- EXPECT_STREQ("", "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful ASSERT_*.
-TEST(SuccessfulAssertionTest, ASSERT) {
- ASSERT_TRUE(true);
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-// Tests that Google Test doesn't track successful ASSERT_STR*.
-TEST(SuccessfulAssertionTest, ASSERT_STR) {
- ASSERT_STREQ("", "");
- EXPECT_EQ(0, GetUnitTestImpl()->current_test_result()->total_part_count());
-}
-
-} // namespace testing
-
-namespace {
-
-// Tests the message streaming variation of assertions.
-
-TEST(AssertionWithMessageTest, EXPECT) {
- EXPECT_EQ(1, 1) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(1, 1) << "Expected failure #1.",
- "Expected failure #1");
- EXPECT_LE(1, 2) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(1, 0) << "Expected failure #2.",
- "Expected failure #2.");
- EXPECT_GE(1, 0) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(1, 2) << "Expected failure #3.",
- "Expected failure #3.");
-
- EXPECT_STREQ("1", "1") << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("1", "1") << "Expected failure #4.",
- "Expected failure #4.");
- EXPECT_STRCASEEQ("a", "A") << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("a", "A") << "Expected failure #5.",
- "Expected failure #5.");
-
- EXPECT_FLOAT_EQ(1, 1) << "This should succeed.";
- EXPECT_NONFATAL_FAILURE(EXPECT_DOUBLE_EQ(1, 1.2) << "Expected failure #6.",
- "Expected failure #6.");
- EXPECT_NEAR(1, 1.1, 0.2) << "This should succeed.";
-}
-
-TEST(AssertionWithMessageTest, ASSERT) {
- ASSERT_EQ(1, 1) << "This should succeed.";
- ASSERT_NE(1, 2) << "This should succeed.";
- ASSERT_LE(1, 2) << "This should succeed.";
- ASSERT_LT(1, 2) << "This should succeed.";
- ASSERT_GE(1, 0) << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_GT(1, 2) << "Expected failure.",
- "Expected failure.");
-}
-
-TEST(AssertionWithMessageTest, ASSERT_STR) {
- ASSERT_STREQ("1", "1") << "This should succeed.";
- ASSERT_STRNE("1", "2") << "This should succeed.";
- ASSERT_STRCASEEQ("a", "A") << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("a", "A") << "Expected failure.",
- "Expected failure.");
-}
-
-TEST(AssertionWithMessageTest, ASSERT_FLOATING) {
- ASSERT_FLOAT_EQ(1, 1) << "This should succeed.";
- ASSERT_DOUBLE_EQ(1, 1) << "This should succeed.";
- EXPECT_FATAL_FAILURE(ASSERT_NEAR(1, 1.2, 0.1) << "Expect failure.", // NOLINT
- "Expect failure.");
-}
-
-// Tests using ASSERT_FALSE with a streamed message.
-TEST(AssertionWithMessageTest, ASSERT_FALSE) {
- ASSERT_FALSE(false) << "This shouldn't fail.";
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_FALSE(true) << "Expected failure: " << 2 << " > " << 1
- << " evaluates to " << true;
- }, "Expected failure");
-}
-
-// Tests using FAIL with a streamed message.
-TEST(AssertionWithMessageTest, FAIL) {
- EXPECT_FATAL_FAILURE(FAIL() << 0,
- "0");
-}
-
-// Tests using SUCCEED with a streamed message.
-TEST(AssertionWithMessageTest, SUCCEED) {
- SUCCEED() << "Success == " << 1;
-}
-
-// Tests using ASSERT_TRUE with a streamed message.
-TEST(AssertionWithMessageTest, ASSERT_TRUE) {
- ASSERT_TRUE(true) << "This should succeed.";
- ASSERT_TRUE(true) << true;
- EXPECT_FATAL_FAILURE(
- { // NOLINT
- ASSERT_TRUE(false) << static_cast<const char*>(nullptr)
- << static_cast<char*>(nullptr);
- },
- "(null)(null)");
-}
-
-#if GTEST_OS_WINDOWS
-// Tests using wide strings in assertion messages.
-TEST(AssertionWithMessageTest, WideStringMessage) {
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_TRUE(false) << L"This failure is expected.\x8119";
- }, "This failure is expected.");
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EQ(1, 2) << "This failure is "
- << L"expected too.\x8120";
- }, "This failure is expected too.");
-}
-#endif // GTEST_OS_WINDOWS
-
-// Tests EXPECT_TRUE.
-TEST(ExpectTest, EXPECT_TRUE) {
- EXPECT_TRUE(true) << "Intentional success";
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "Intentional failure #1.",
- "Intentional failure #1.");
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "Intentional failure #2.",
- "Intentional failure #2.");
- EXPECT_TRUE(2 > 1); // NOLINT
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(2 < 1),
- "Value of: 2 < 1\n"
- " Actual: false\n"
- "Expected: true");
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(2 > 3),
- "2 > 3");
-}
-
-// Tests EXPECT_TRUE(predicate) for predicates returning AssertionResult.
-TEST(ExpectTest, ExpectTrueWithAssertionResult) {
- EXPECT_TRUE(ResultIsEven(2));
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(ResultIsEven(3)),
- "Value of: ResultIsEven(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
- EXPECT_TRUE(ResultIsEvenNoExplanation(2));
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(ResultIsEvenNoExplanation(3)),
- "Value of: ResultIsEvenNoExplanation(3)\n"
- " Actual: false (3 is odd)\n"
- "Expected: true");
-}
-
-// Tests EXPECT_FALSE with a streamed message.
-TEST(ExpectTest, EXPECT_FALSE) {
- EXPECT_FALSE(2 < 1); // NOLINT
- EXPECT_FALSE(false) << "Intentional success";
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "Intentional failure #1.",
- "Intentional failure #1.");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "Intentional failure #2.",
- "Intentional failure #2.");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(2 > 1),
- "Value of: 2 > 1\n"
- " Actual: true\n"
- "Expected: false");
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(2 < 3),
- "2 < 3");
-}
-
-// Tests EXPECT_FALSE(predicate) for predicates returning AssertionResult.
-TEST(ExpectTest, ExpectFalseWithAssertionResult) {
- EXPECT_FALSE(ResultIsEven(3));
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(ResultIsEven(2)),
- "Value of: ResultIsEven(2)\n"
- " Actual: true (2 is even)\n"
- "Expected: false");
- EXPECT_FALSE(ResultIsEvenNoExplanation(3));
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(ResultIsEvenNoExplanation(2)),
- "Value of: ResultIsEvenNoExplanation(2)\n"
- " Actual: true\n"
- "Expected: false");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them
-# pragma option pop
-#endif
-
-// Tests EXPECT_EQ.
-TEST(ExpectTest, EXPECT_EQ) {
- EXPECT_EQ(5, 2 + 3);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2*3),
- "Expected equality of these values:\n"
- " 5\n"
- " 2*3\n"
- " Which is: 6");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5, 2 - 3),
- "2 - 3");
-}
-
-// Tests using EXPECT_EQ on double values. The purpose is to make
-// sure that the specialization we did for integer and anonymous enums
-// isn't used for double arguments.
-TEST(ExpectTest, EXPECT_EQ_Double) {
- // A success.
- EXPECT_EQ(5.6, 5.6);
-
- // A failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(5.1, 5.2),
- "5.1");
-}
-
-// Tests EXPECT_EQ(NULL, pointer).
-TEST(ExpectTest, EXPECT_EQ_NULL) {
- // A success.
- const char* p = nullptr;
- EXPECT_EQ(nullptr, p);
-
- // A failure.
- int n = 0;
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(nullptr, &n), " &n\n Which is:");
-}
-
-// Tests EXPECT_EQ(0, non_pointer). Since the literal 0 can be
-// treated as a null pointer by the compiler, we need to make sure
-// that EXPECT_EQ(0, non_pointer) isn't interpreted by Google Test as
-// EXPECT_EQ(static_cast<void*>(NULL), non_pointer).
-TEST(ExpectTest, EXPECT_EQ_0) {
- int n = 0;
-
- // A success.
- EXPECT_EQ(0, n);
-
- // A failure.
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(0, 5.6),
- " 0\n 5.6");
-}
-
-// Tests EXPECT_NE.
-TEST(ExpectTest, EXPECT_NE) {
- EXPECT_NE(6, 7);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_NE('a', 'a'),
- "Expected: ('a') != ('a'), "
- "actual: 'a' (97, 0x61) vs 'a' (97, 0x61)");
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(2, 2),
- "2");
- char* const p0 = nullptr;
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(p0, p0),
- "p0");
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- char* const p1 = reinterpret_cast<char*>(pv1);
- EXPECT_NONFATAL_FAILURE(EXPECT_NE(p1, p1),
- "p1");
-}
-
-// Tests EXPECT_LE.
-TEST(ExpectTest, EXPECT_LE) {
- EXPECT_LE(2, 3);
- EXPECT_LE(2, 2);
- EXPECT_NONFATAL_FAILURE(EXPECT_LE(2, 0),
- "Expected: (2) <= (0), actual: 2 vs 0");
- EXPECT_NONFATAL_FAILURE(EXPECT_LE(1.1, 0.9),
- "(1.1) <= (0.9)");
-}
-
-// Tests EXPECT_LT.
-TEST(ExpectTest, EXPECT_LT) {
- EXPECT_LT(2, 3);
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 2),
- "Expected: (2) < (2), actual: 2 vs 2");
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1),
- "(2) < (1)");
-}
-
-// Tests EXPECT_GE.
-TEST(ExpectTest, EXPECT_GE) {
- EXPECT_GE(2, 1);
- EXPECT_GE(2, 2);
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(2, 3),
- "Expected: (2) >= (3), actual: 2 vs 3");
- EXPECT_NONFATAL_FAILURE(EXPECT_GE(0.9, 1.1),
- "(0.9) >= (1.1)");
-}
-
-// Tests EXPECT_GT.
-TEST(ExpectTest, EXPECT_GT) {
- EXPECT_GT(2, 1);
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(2, 2),
- "Expected: (2) > (2), actual: 2 vs 2");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(2, 3),
- "(2) > (3)");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-// Tests EXPECT_THROW.
-TEST(ExpectTest, EXPECT_THROW) {
- EXPECT_THROW(ThrowAnInteger(), int);
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnInteger(), bool),
- "Expected: ThrowAnInteger() throws an exception of "
- "type bool.\n Actual: it throws a different type.");
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowRuntimeError("A description"),
- std::logic_error),
- "Expected: ThrowRuntimeError(\"A description\") "
- "throws an exception of type std::logic_error.\n "
- "Actual: it throws " ERROR_DESC " "
- "with description \"A description\".");
- EXPECT_NONFATAL_FAILURE(
- EXPECT_THROW(ThrowNothing(), bool),
- "Expected: ThrowNothing() throws an exception of type bool.\n"
- " Actual: it throws nothing.");
-}
-
-// Tests EXPECT_NO_THROW.
-TEST(ExpectTest, EXPECT_NO_THROW) {
- EXPECT_NO_THROW(ThrowNothing());
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnInteger()),
- "Expected: ThrowAnInteger() doesn't throw an "
- "exception.\n Actual: it throws.");
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowRuntimeError("A description")),
- "Expected: ThrowRuntimeError(\"A description\") "
- "doesn't throw an exception.\n "
- "Actual: it throws " ERROR_DESC " "
- "with description \"A description\".");
-}
-
-// Tests EXPECT_ANY_THROW.
-TEST(ExpectTest, EXPECT_ANY_THROW) {
- EXPECT_ANY_THROW(ThrowAnInteger());
- EXPECT_NONFATAL_FAILURE(
- EXPECT_ANY_THROW(ThrowNothing()),
- "Expected: ThrowNothing() throws an exception.\n"
- " Actual: it doesn't.");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Make sure we deal with the precedence of <<.
-TEST(ExpectTest, ExpectPrecedence) {
- EXPECT_EQ(1 < 2, true);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(true, true && false),
- " true && false\n Which is: false");
-}
-
-
-// Tests the StreamableToString() function.
-
-// Tests using StreamableToString() on a scalar.
-TEST(StreamableToStringTest, Scalar) {
- EXPECT_STREQ("5", StreamableToString(5).c_str());
-}
-
-// Tests using StreamableToString() on a non-char pointer.
-TEST(StreamableToStringTest, Pointer) {
- int n = 0;
- int* p = &n;
- EXPECT_STRNE("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using StreamableToString() on a NULL non-char pointer.
-TEST(StreamableToStringTest, NullPointer) {
- int* p = nullptr;
- EXPECT_STREQ("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using StreamableToString() on a C string.
-TEST(StreamableToStringTest, CString) {
- EXPECT_STREQ("Foo", StreamableToString("Foo").c_str());
-}
-
-// Tests using StreamableToString() on a NULL C string.
-TEST(StreamableToStringTest, NullCString) {
- char* p = nullptr;
- EXPECT_STREQ("(null)", StreamableToString(p).c_str());
-}
-
-// Tests using streamable values as assertion messages.
-
-// Tests using std::string as an assertion message.
-TEST(StreamableTest, string) {
- static const std::string str(
- "This failure message is a std::string, and is expected.");
- EXPECT_FATAL_FAILURE(FAIL() << str,
- str.c_str());
-}
-
-// Tests that we can output strings containing embedded NULs.
-// Limited to Linux because we can only do this with std::string's.
-TEST(StreamableTest, stringWithEmbeddedNUL) {
- static const char char_array_with_nul[] =
- "Here's a NUL\0 and some more string";
- static const std::string string_with_nul(char_array_with_nul,
- sizeof(char_array_with_nul)
- - 1); // drops the trailing NUL
- EXPECT_FATAL_FAILURE(FAIL() << string_with_nul,
- "Here's a NUL\\0 and some more string");
-}
-
-// Tests that we can output a NUL char.
-TEST(StreamableTest, NULChar) {
- EXPECT_FATAL_FAILURE({ // NOLINT
- FAIL() << "A NUL" << '\0' << " and some more string";
- }, "A NUL\\0 and some more string");
-}
-
-// Tests using int as an assertion message.
-TEST(StreamableTest, int) {
- EXPECT_FATAL_FAILURE(FAIL() << 900913,
- "900913");
-}
-
-// Tests using NULL char pointer as an assertion message.
-//
-// In MSVC, streaming a NULL char * causes access violation. Google Test
-// implemented a workaround (substituting "(null)" for NULL). This
-// tests whether the workaround works.
-TEST(StreamableTest, NullCharPtr) {
- EXPECT_FATAL_FAILURE(FAIL() << static_cast<const char*>(nullptr), "(null)");
-}
-
-// Tests that basic IO manipulators (endl, ends, and flush) can be
-// streamed to testing::Message.
-TEST(StreamableTest, BasicIoManip) {
- EXPECT_FATAL_FAILURE({ // NOLINT
- FAIL() << "Line 1." << std::endl
- << "A NUL char " << std::ends << std::flush << " in line 2.";
- }, "Line 1.\nA NUL char \\0 in line 2.");
-}
-
-// Tests the macros that haven't been covered so far.
-
-void AddFailureHelper(bool* aborted) {
- *aborted = true;
- ADD_FAILURE() << "Intentional failure.";
- *aborted = false;
-}
-
-// Tests ADD_FAILURE.
-TEST(MacroTest, ADD_FAILURE) {
- bool aborted = true;
- EXPECT_NONFATAL_FAILURE(AddFailureHelper(&aborted),
- "Intentional failure.");
- EXPECT_FALSE(aborted);
-}
-
-// Tests ADD_FAILURE_AT.
-TEST(MacroTest, ADD_FAILURE_AT) {
- // Verifies that ADD_FAILURE_AT does generate a nonfatal failure and
- // the failure message contains the user-streamed part.
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE_AT("foo.cc", 42) << "Wrong!", "Wrong!");
-
- // Verifies that the user-streamed part is optional.
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE_AT("foo.cc", 42), "Failed");
-
- // Unfortunately, we cannot verify that the failure message contains
- // the right file path and line number the same way, as
- // EXPECT_NONFATAL_FAILURE() doesn't get to see the file path and
- // line number. Instead, we do that in googletest-output-test_.cc.
-}
-
-// Tests FAIL.
-TEST(MacroTest, FAIL) {
- EXPECT_FATAL_FAILURE(FAIL(),
- "Failed");
- EXPECT_FATAL_FAILURE(FAIL() << "Intentional failure.",
- "Intentional failure.");
-}
-
-// Tests GTEST_FAIL_AT.
-TEST(MacroTest, GTEST_FAIL_AT) {
- // Verifies that GTEST_FAIL_AT does generate a fatal failure and
- // the failure message contains the user-streamed part.
- EXPECT_FATAL_FAILURE(GTEST_FAIL_AT("foo.cc", 42) << "Wrong!", "Wrong!");
-
- // Verifies that the user-streamed part is optional.
- EXPECT_FATAL_FAILURE(GTEST_FAIL_AT("foo.cc", 42), "Failed");
-
- // See the ADD_FAIL_AT test above to see how we test that the failure message
- // contains the right filename and line number -- the same applies here.
-}
-
-// Tests SUCCEED
-TEST(MacroTest, SUCCEED) {
- SUCCEED();
- SUCCEED() << "Explicit success.";
-}
-
-// Tests for EXPECT_EQ() and ASSERT_EQ().
-//
-// These tests fail *intentionally*, s.t. the failure messages can be
-// generated and tested.
-//
-// We have different tests for different argument types.
-
-// Tests using bool values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Bool) {
- EXPECT_EQ(true, true);
- EXPECT_FATAL_FAILURE({
- bool false_value = false;
- ASSERT_EQ(false_value, true);
- }, " false_value\n Which is: false\n true");
-}
-
-// Tests using int values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Int) {
- ASSERT_EQ(32, 32);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(32, 33),
- " 32\n 33");
-}
-
-// Tests using time_t values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Time_T) {
- EXPECT_EQ(static_cast<time_t>(0),
- static_cast<time_t>(0));
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<time_t>(0),
- static_cast<time_t>(1234)),
- "1234");
-}
-
-// Tests using char values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, Char) {
- ASSERT_EQ('z', 'z');
- const char ch = 'b';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ('\0', ch),
- " ch\n Which is: 'b'");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ('a', ch),
- " ch\n Which is: 'b'");
-}
-
-// Tests using wchar_t values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, WideChar) {
- EXPECT_EQ(L'b', L'b');
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'\0', L'x'),
- "Expected equality of these values:\n"
- " L'\0'\n"
- " Which is: L'\0' (0, 0x0)\n"
- " L'x'\n"
- " Which is: L'x' (120, 0x78)");
-
- static wchar_t wchar;
- wchar = L'b';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(L'a', wchar),
- "wchar");
- wchar = 0x8119;
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<wchar_t>(0x8120), wchar),
- " wchar\n Which is: L'");
-}
-
-// Tests using ::std::string values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, StdString) {
- // Compares a const char* to an std::string that has identical
- // content.
- ASSERT_EQ("Test", ::std::string("Test"));
-
- // Compares two identical std::strings.
- static const ::std::string str1("A * in the middle");
- static const ::std::string str2(str1);
- EXPECT_EQ(str1, str2);
-
- // Compares a const char* to an std::string that has different
- // content
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ("Test", ::std::string("test")),
- "\"test\"");
-
- // Compares an std::string to a char* that has different content.
- char* const p1 = const_cast<char*>("foo");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(::std::string("bar"), p1),
- "p1");
-
- // Compares two std::strings that have different contents, one of
- // which having a NUL character in the middle. This should fail.
- static ::std::string str3(str1);
- str3.at(2) = '\0';
- EXPECT_FATAL_FAILURE(ASSERT_EQ(str1, str3),
- " str3\n Which is: \"A \\0 in the middle\"");
-}
-
-#if GTEST_HAS_STD_WSTRING
-
-// Tests using ::std::wstring values in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, StdWideString) {
- // Compares two identical std::wstrings.
- const ::std::wstring wstr1(L"A * in the middle");
- const ::std::wstring wstr2(wstr1);
- ASSERT_EQ(wstr1, wstr2);
-
- // Compares an std::wstring to a const wchar_t* that has identical
- // content.
- const wchar_t kTestX8119[] = { 'T', 'e', 's', 't', 0x8119, '\0' };
- EXPECT_EQ(::std::wstring(kTestX8119), kTestX8119);
-
- // Compares an std::wstring to a const wchar_t* that has different
- // content.
- const wchar_t kTestX8120[] = { 'T', 'e', 's', 't', 0x8120, '\0' };
- EXPECT_NONFATAL_FAILURE({ // NOLINT
- EXPECT_EQ(::std::wstring(kTestX8119), kTestX8120);
- }, "kTestX8120");
-
- // Compares two std::wstrings that have different contents, one of
- // which having a NUL character in the middle.
- ::std::wstring wstr3(wstr1);
- wstr3.at(2) = L'\0';
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(wstr1, wstr3),
- "wstr3");
-
- // Compares a wchar_t* to an std::wstring that has different
- // content.
- EXPECT_FATAL_FAILURE({ // NOLINT
- ASSERT_EQ(const_cast<wchar_t*>(L"foo"), ::std::wstring(L"bar"));
- }, "");
-}
-
-#endif // GTEST_HAS_STD_WSTRING
-
-// Tests using char pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, CharPointer) {
- char* const p0 = nullptr;
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- void* pv2 = (void*)0xABC0; // NOLINT
- char* const p1 = reinterpret_cast<char*>(pv1);
- char* const p2 = reinterpret_cast<char*>(pv2);
- ASSERT_EQ(p1, p1);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
- " p2\n Which is:");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
- " p2\n Which is:");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(reinterpret_cast<char*>(0x1234),
- reinterpret_cast<char*>(0xABC0)),
- "ABC0");
-}
-
-// Tests using wchar_t pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, WideCharPointer) {
- wchar_t* const p0 = nullptr;
- // Only way to get the Nokia compiler to compile the cast
- // is to have a separate void* variable first. Putting
- // the two casts on the same line doesn't work, neither does
- // a direct C-style to char*.
- void* pv1 = (void*)0x1234; // NOLINT
- void* pv2 = (void*)0xABC0; // NOLINT
- wchar_t* const p1 = reinterpret_cast<wchar_t*>(pv1);
- wchar_t* const p2 = reinterpret_cast<wchar_t*>(pv2);
- EXPECT_EQ(p0, p0);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p0, p2),
- " p2\n Which is:");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p1, p2),
- " p2\n Which is:");
- void* pv3 = (void*)0x1234; // NOLINT
- void* pv4 = (void*)0xABC0; // NOLINT
- const wchar_t* p3 = reinterpret_cast<const wchar_t*>(pv3);
- const wchar_t* p4 = reinterpret_cast<const wchar_t*>(pv4);
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(p3, p4),
- "p4");
-}
-
-// Tests using other types of pointers in {EXPECT|ASSERT}_EQ.
-TEST(EqAssertionTest, OtherPointer) {
- ASSERT_EQ(static_cast<const int*>(nullptr), static_cast<const int*>(nullptr));
- EXPECT_FATAL_FAILURE(ASSERT_EQ(static_cast<const int*>(nullptr),
- reinterpret_cast<const int*>(0x1234)),
- "0x1234");
-}
-
-// A class that supports binary comparison operators but not streaming.
-class UnprintableChar {
- public:
- explicit UnprintableChar(char ch) : char_(ch) {}
-
- bool operator==(const UnprintableChar& rhs) const {
- return char_ == rhs.char_;
- }
- bool operator!=(const UnprintableChar& rhs) const {
- return char_ != rhs.char_;
- }
- bool operator<(const UnprintableChar& rhs) const {
- return char_ < rhs.char_;
- }
- bool operator<=(const UnprintableChar& rhs) const {
- return char_ <= rhs.char_;
- }
- bool operator>(const UnprintableChar& rhs) const {
- return char_ > rhs.char_;
- }
- bool operator>=(const UnprintableChar& rhs) const {
- return char_ >= rhs.char_;
- }
-
- private:
- char char_;
-};
-
-// Tests that ASSERT_EQ() and friends don't require the arguments to
-// be printable.
-TEST(ComparisonAssertionTest, AcceptsUnprintableArgs) {
- const UnprintableChar x('x'), y('y');
- ASSERT_EQ(x, x);
- EXPECT_NE(x, y);
- ASSERT_LT(x, y);
- EXPECT_LE(x, y);
- ASSERT_GT(y, x);
- EXPECT_GE(x, x);
-
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y), "1-byte object <78>");
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(x, y), "1-byte object <79>");
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(y, y), "1-byte object <79>");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(x, y), "1-byte object <78>");
- EXPECT_NONFATAL_FAILURE(EXPECT_GT(x, y), "1-byte object <79>");
-
- // Code tested by EXPECT_FATAL_FAILURE cannot reference local
- // variables, so we have to write UnprintableChar('x') instead of x.
-#ifndef __BORLANDC__
- // ICE's in C++Builder.
- EXPECT_FATAL_FAILURE(ASSERT_NE(UnprintableChar('x'), UnprintableChar('x')),
- "1-byte object <78>");
- EXPECT_FATAL_FAILURE(ASSERT_LE(UnprintableChar('y'), UnprintableChar('x')),
- "1-byte object <78>");
-#endif
- EXPECT_FATAL_FAILURE(ASSERT_LE(UnprintableChar('y'), UnprintableChar('x')),
- "1-byte object <79>");
- EXPECT_FATAL_FAILURE(ASSERT_GE(UnprintableChar('x'), UnprintableChar('y')),
- "1-byte object <78>");
- EXPECT_FATAL_FAILURE(ASSERT_GE(UnprintableChar('x'), UnprintableChar('y')),
- "1-byte object <79>");
-}
-
-// Tests the FRIEND_TEST macro.
-
-// This class has a private member we want to test. We will test it
-// both in a TEST and in a TEST_F.
-class Foo {
- public:
- Foo() {}
-
- private:
- int Bar() const { return 1; }
-
- // Declares the friend tests that can access the private member
- // Bar().
- FRIEND_TEST(FRIEND_TEST_Test, TEST);
- FRIEND_TEST(FRIEND_TEST_Test2, TEST_F);
-};
-
-// Tests that the FRIEND_TEST declaration allows a TEST to access a
-// class's private members. This should compile.
-TEST(FRIEND_TEST_Test, TEST) {
- ASSERT_EQ(1, Foo().Bar());
-}
-
-// The fixture needed to test using FRIEND_TEST with TEST_F.
-class FRIEND_TEST_Test2 : public Test {
- protected:
- Foo foo;
-};
-
-// Tests that the FRIEND_TEST declaration allows a TEST_F to access a
-// class's private members. This should compile.
-TEST_F(FRIEND_TEST_Test2, TEST_F) {
- ASSERT_EQ(1, foo.Bar());
-}
-
-// Tests the life cycle of Test objects.
-
-// The test fixture for testing the life cycle of Test objects.
-//
-// This class counts the number of live test objects that uses this
-// fixture.
-class TestLifeCycleTest : public Test {
- protected:
- // Constructor. Increments the number of test objects that uses
- // this fixture.
- TestLifeCycleTest() { count_++; }
-
- // Destructor. Decrements the number of test objects that uses this
- // fixture.
- ~TestLifeCycleTest() override { count_--; }
-
- // Returns the number of live test objects that uses this fixture.
- int count() const { return count_; }
-
- private:
- static int count_;
-};
-
-int TestLifeCycleTest::count_ = 0;
-
-// Tests the life cycle of test objects.
-TEST_F(TestLifeCycleTest, Test1) {
- // There should be only one test object in this test case that's
- // currently alive.
- ASSERT_EQ(1, count());
-}
-
-// Tests the life cycle of test objects.
-TEST_F(TestLifeCycleTest, Test2) {
- // After Test1 is done and Test2 is started, there should still be
- // only one live test object, as the object for Test1 should've been
- // deleted.
- ASSERT_EQ(1, count());
-}
-
-} // namespace
-
-// Tests that the copy constructor works when it is NOT optimized away by
-// the compiler.
-TEST(AssertionResultTest, CopyConstructorWorksWhenNotOptimied) {
- // Checks that the copy constructor doesn't try to dereference NULL pointers
- // in the source object.
- AssertionResult r1 = AssertionSuccess();
- AssertionResult r2 = r1;
- // The following line is added to prevent the compiler from optimizing
- // away the constructor call.
- r1 << "abc";
-
- AssertionResult r3 = r1;
- EXPECT_EQ(static_cast<bool>(r3), static_cast<bool>(r1));
- EXPECT_STREQ("abc", r1.message());
-}
-
-// Tests that AssertionSuccess and AssertionFailure construct
-// AssertionResult objects as expected.
-TEST(AssertionResultTest, ConstructionWorks) {
- AssertionResult r1 = AssertionSuccess();
- EXPECT_TRUE(r1);
- EXPECT_STREQ("", r1.message());
-
- AssertionResult r2 = AssertionSuccess() << "abc";
- EXPECT_TRUE(r2);
- EXPECT_STREQ("abc", r2.message());
-
- AssertionResult r3 = AssertionFailure();
- EXPECT_FALSE(r3);
- EXPECT_STREQ("", r3.message());
-
- AssertionResult r4 = AssertionFailure() << "def";
- EXPECT_FALSE(r4);
- EXPECT_STREQ("def", r4.message());
-
- AssertionResult r5 = AssertionFailure(Message() << "ghi");
- EXPECT_FALSE(r5);
- EXPECT_STREQ("ghi", r5.message());
-}
-
-// Tests that the negation flips the predicate result but keeps the message.
-TEST(AssertionResultTest, NegationWorks) {
- AssertionResult r1 = AssertionSuccess() << "abc";
- EXPECT_FALSE(!r1);
- EXPECT_STREQ("abc", (!r1).message());
-
- AssertionResult r2 = AssertionFailure() << "def";
- EXPECT_TRUE(!r2);
- EXPECT_STREQ("def", (!r2).message());
-}
-
-TEST(AssertionResultTest, StreamingWorks) {
- AssertionResult r = AssertionSuccess();
- r << "abc" << 'd' << 0 << true;
- EXPECT_STREQ("abcd0true", r.message());
-}
-
-TEST(AssertionResultTest, CanStreamOstreamManipulators) {
- AssertionResult r = AssertionSuccess();
- r << "Data" << std::endl << std::flush << std::ends << "Will be visible";
- EXPECT_STREQ("Data\n\\0Will be visible", r.message());
-}
-
-// The next test uses explicit conversion operators
-
-TEST(AssertionResultTest, ConstructibleFromContextuallyConvertibleToBool) {
- struct ExplicitlyConvertibleToBool {
- explicit operator bool() const { return value; }
- bool value;
- };
- ExplicitlyConvertibleToBool v1 = {false};
- ExplicitlyConvertibleToBool v2 = {true};
- EXPECT_FALSE(v1);
- EXPECT_TRUE(v2);
-}
-
-struct ConvertibleToAssertionResult {
- operator AssertionResult() const { return AssertionResult(true); }
-};
-
-TEST(AssertionResultTest, ConstructibleFromImplicitlyConvertible) {
- ConvertibleToAssertionResult obj;
- EXPECT_TRUE(obj);
-}
-
-// Tests streaming a user type whose definition and operator << are
-// both in the global namespace.
-class Base {
- public:
- explicit Base(int an_x) : x_(an_x) {}
- int x() const { return x_; }
- private:
- int x_;
-};
-std::ostream& operator<<(std::ostream& os,
- const Base& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const Base* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-
-TEST(MessageTest, CanStreamUserTypeInGlobalNameSpace) {
- Message msg;
- Base a(1);
-
- msg << a << &a; // Uses ::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition and operator<< are
-// both in an unnamed namespace.
-namespace {
-class MyTypeInUnnamedNameSpace : public Base {
- public:
- explicit MyTypeInUnnamedNameSpace(int an_x): Base(an_x) {}
-};
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInUnnamedNameSpace& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInUnnamedNameSpace* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-} // namespace
-
-TEST(MessageTest, CanStreamUserTypeInUnnamedNameSpace) {
- Message msg;
- MyTypeInUnnamedNameSpace a(1);
-
- msg << a << &a; // Uses <unnamed_namespace>::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition and operator<< are
-// both in a user namespace.
-namespace namespace1 {
-class MyTypeInNameSpace1 : public Base {
- public:
- explicit MyTypeInNameSpace1(int an_x): Base(an_x) {}
-};
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInNameSpace1& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const MyTypeInNameSpace1* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-} // namespace namespace1
-
-TEST(MessageTest, CanStreamUserTypeInUserNameSpace) {
- Message msg;
- namespace1::MyTypeInNameSpace1 a(1);
-
- msg << a << &a; // Uses namespace1::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming a user type whose definition is in a user namespace
-// but whose operator<< is in the global namespace.
-namespace namespace2 {
-class MyTypeInNameSpace2 : public ::Base {
- public:
- explicit MyTypeInNameSpace2(int an_x): Base(an_x) {}
-};
-} // namespace namespace2
-std::ostream& operator<<(std::ostream& os,
- const namespace2::MyTypeInNameSpace2& val) {
- return os << val.x();
-}
-std::ostream& operator<<(std::ostream& os,
- const namespace2::MyTypeInNameSpace2* pointer) {
- return os << "(" << pointer->x() << ")";
-}
-
-TEST(MessageTest, CanStreamUserTypeInUserNameSpaceWithStreamOperatorInGlobal) {
- Message msg;
- namespace2::MyTypeInNameSpace2 a(1);
-
- msg << a << &a; // Uses ::operator<<.
- EXPECT_STREQ("1(1)", msg.GetString().c_str());
-}
-
-// Tests streaming NULL pointers to testing::Message.
-TEST(MessageTest, NullPointers) {
- Message msg;
- char* const p1 = nullptr;
- unsigned char* const p2 = nullptr;
- int* p3 = nullptr;
- double* p4 = nullptr;
- bool* p5 = nullptr;
- Message* p6 = nullptr;
-
- msg << p1 << p2 << p3 << p4 << p5 << p6;
- ASSERT_STREQ("(null)(null)(null)(null)(null)(null)",
- msg.GetString().c_str());
-}
-
-// Tests streaming wide strings to testing::Message.
-TEST(MessageTest, WideStrings) {
- // Streams a NULL of type const wchar_t*.
- const wchar_t* const_wstr = nullptr;
- EXPECT_STREQ("(null)",
- (Message() << const_wstr).GetString().c_str());
-
- // Streams a NULL of type wchar_t*.
- wchar_t* wstr = nullptr;
- EXPECT_STREQ("(null)",
- (Message() << wstr).GetString().c_str());
-
- // Streams a non-NULL of type const wchar_t*.
- const_wstr = L"abc\x8119";
- EXPECT_STREQ("abc\xe8\x84\x99",
- (Message() << const_wstr).GetString().c_str());
-
- // Streams a non-NULL of type wchar_t*.
- wstr = const_cast<wchar_t*>(const_wstr);
- EXPECT_STREQ("abc\xe8\x84\x99",
- (Message() << wstr).GetString().c_str());
-}
-
-
-// This line tests that we can define tests in the testing namespace.
-namespace testing {
-
-// Tests the TestInfo class.
-
-class TestInfoTest : public Test {
- protected:
- static const TestInfo* GetTestInfo(const char* test_name) {
- const TestSuite* const test_suite =
- GetUnitTestImpl()->GetTestSuite("TestInfoTest", "", nullptr, nullptr);
-
- for (int i = 0; i < test_suite->total_test_count(); ++i) {
- const TestInfo* const test_info = test_suite->GetTestInfo(i);
- if (strcmp(test_name, test_info->name()) == 0)
- return test_info;
- }
- return nullptr;
- }
-
- static const TestResult* GetTestResult(
- const TestInfo* test_info) {
- return test_info->result();
- }
-};
-
-// Tests TestInfo::test_case_name() and TestInfo::name().
-TEST_F(TestInfoTest, Names) {
- const TestInfo* const test_info = GetTestInfo("Names");
-
- ASSERT_STREQ("TestInfoTest", test_info->test_suite_name());
- ASSERT_STREQ("Names", test_info->name());
-}
-
-// Tests TestInfo::result().
-TEST_F(TestInfoTest, result) {
- const TestInfo* const test_info = GetTestInfo("result");
-
- // Initially, there is no TestPartResult for this test.
- ASSERT_EQ(0, GetTestResult(test_info)->total_part_count());
-
- // After the previous assertion, there is still none.
- ASSERT_EQ(0, GetTestResult(test_info)->total_part_count());
-}
-
-#define VERIFY_CODE_LOCATION \
- const int expected_line = __LINE__ - 1; \
- const TestInfo* const test_info = GetUnitTestImpl()->current_test_info(); \
- ASSERT_TRUE(test_info); \
- EXPECT_STREQ(__FILE__, test_info->file()); \
- EXPECT_EQ(expected_line, test_info->line())
-
-TEST(CodeLocationForTEST, Verify) {
- VERIFY_CODE_LOCATION;
-}
-
-class CodeLocationForTESTF : public Test {
-};
-
-TEST_F(CodeLocationForTESTF, Verify) {
- VERIFY_CODE_LOCATION;
-}
-
-class CodeLocationForTESTP : public TestWithParam<int> {
-};
-
-TEST_P(CodeLocationForTESTP, Verify) {
- VERIFY_CODE_LOCATION;
-}
-
-INSTANTIATE_TEST_SUITE_P(, CodeLocationForTESTP, Values(0));
-
-template <typename T>
-class CodeLocationForTYPEDTEST : public Test {
-};
-
-TYPED_TEST_SUITE(CodeLocationForTYPEDTEST, int);
-
-TYPED_TEST(CodeLocationForTYPEDTEST, Verify) {
- VERIFY_CODE_LOCATION;
-}
-
-template <typename T>
-class CodeLocationForTYPEDTESTP : public Test {
-};
-
-TYPED_TEST_SUITE_P(CodeLocationForTYPEDTESTP);
-
-TYPED_TEST_P(CodeLocationForTYPEDTESTP, Verify) {
- VERIFY_CODE_LOCATION;
-}
-
-REGISTER_TYPED_TEST_SUITE_P(CodeLocationForTYPEDTESTP, Verify);
-
-INSTANTIATE_TYPED_TEST_SUITE_P(My, CodeLocationForTYPEDTESTP, int);
-
-#undef VERIFY_CODE_LOCATION
-
-// Tests setting up and tearing down a test case.
-// Legacy API is deprecated but still available
-#ifndef GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-class SetUpTestCaseTest : public Test {
- protected:
- // This will be called once before the first test in this test case
- // is run.
- static void SetUpTestCase() {
- printf("Setting up the test case . . .\n");
-
- // Initializes some shared resource. In this simple example, we
- // just create a C string. More complex stuff can be done if
- // desired.
- shared_resource_ = "123";
-
- // Increments the number of test cases that have been set up.
- counter_++;
-
- // SetUpTestCase() should be called only once.
- EXPECT_EQ(1, counter_);
- }
-
- // This will be called once after the last test in this test case is
- // run.
- static void TearDownTestCase() {
- printf("Tearing down the test case . . .\n");
-
- // Decrements the number of test cases that have been set up.
- counter_--;
-
- // TearDownTestCase() should be called only once.
- EXPECT_EQ(0, counter_);
-
- // Cleans up the shared resource.
- shared_resource_ = nullptr;
- }
-
- // This will be called before each test in this test case.
- void SetUp() override {
- // SetUpTestCase() should be called only once, so counter_ should
- // always be 1.
- EXPECT_EQ(1, counter_);
- }
-
- // Number of test cases that have been set up.
- static int counter_;
-
- // Some resource to be shared by all tests in this test case.
- static const char* shared_resource_;
-};
-
-int SetUpTestCaseTest::counter_ = 0;
-const char* SetUpTestCaseTest::shared_resource_ = nullptr;
-
-// A test that uses the shared resource.
-TEST_F(SetUpTestCaseTest, Test1) { EXPECT_STRNE(nullptr, shared_resource_); }
-
-// Another test that uses the shared resource.
-TEST_F(SetUpTestCaseTest, Test2) {
- EXPECT_STREQ("123", shared_resource_);
-}
-#endif // GTEST_REMOVE_LEGACY_TEST_CASEAPI_
-
-// Tests SetupTestSuite/TearDown TestSuite
-class SetUpTestSuiteTest : public Test {
- protected:
- // This will be called once before the first test in this test case
- // is run.
- static void SetUpTestSuite() {
- printf("Setting up the test suite . . .\n");
-
- // Initializes some shared resource. In this simple example, we
- // just create a C string. More complex stuff can be done if
- // desired.
- shared_resource_ = "123";
-
- // Increments the number of test cases that have been set up.
- counter_++;
-
- // SetUpTestSuite() should be called only once.
- EXPECT_EQ(1, counter_);
- }
-
- // This will be called once after the last test in this test case is
- // run.
- static void TearDownTestSuite() {
- printf("Tearing down the test suite . . .\n");
-
- // Decrements the number of test suites that have been set up.
- counter_--;
-
- // TearDownTestSuite() should be called only once.
- EXPECT_EQ(0, counter_);
-
- // Cleans up the shared resource.
- shared_resource_ = nullptr;
- }
-
- // This will be called before each test in this test case.
- void SetUp() override {
- // SetUpTestSuite() should be called only once, so counter_ should
- // always be 1.
- EXPECT_EQ(1, counter_);
- }
-
- // Number of test suites that have been set up.
- static int counter_;
-
- // Some resource to be shared by all tests in this test case.
- static const char* shared_resource_;
-};
-
-int SetUpTestSuiteTest::counter_ = 0;
-const char* SetUpTestSuiteTest::shared_resource_ = nullptr;
-
-// A test that uses the shared resource.
-TEST_F(SetUpTestSuiteTest, TestSetupTestSuite1) {
- EXPECT_STRNE(nullptr, shared_resource_);
-}
-
-// Another test that uses the shared resource.
-TEST_F(SetUpTestSuiteTest, TestSetupTestSuite2) {
- EXPECT_STREQ("123", shared_resource_);
-}
-
-// The ParseFlagsTest test case tests ParseGoogleTestFlagsOnly.
-
-// The Flags struct stores a copy of all Google Test flags.
-struct Flags {
- // Constructs a Flags struct where each flag has its default value.
- Flags()
- : also_run_disabled_tests(false),
- break_on_failure(false),
- catch_exceptions(false),
- death_test_use_fork(false),
- fail_fast(false),
- filter(""),
- list_tests(false),
- output(""),
- brief(false),
- print_time(true),
- random_seed(0),
- repeat(1),
- recreate_environments_when_repeating(true),
- shuffle(false),
- stack_trace_depth(kMaxStackTraceDepth),
- stream_result_to(""),
- throw_on_failure(false) {}
-
- // Factory methods.
-
- // Creates a Flags struct where the gtest_also_run_disabled_tests flag has
- // the given value.
- static Flags AlsoRunDisabledTests(bool also_run_disabled_tests) {
- Flags flags;
- flags.also_run_disabled_tests = also_run_disabled_tests;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_break_on_failure flag has
- // the given value.
- static Flags BreakOnFailure(bool break_on_failure) {
- Flags flags;
- flags.break_on_failure = break_on_failure;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_catch_exceptions flag has
- // the given value.
- static Flags CatchExceptions(bool catch_exceptions) {
- Flags flags;
- flags.catch_exceptions = catch_exceptions;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_death_test_use_fork flag has
- // the given value.
- static Flags DeathTestUseFork(bool death_test_use_fork) {
- Flags flags;
- flags.death_test_use_fork = death_test_use_fork;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_fail_fast flag has
- // the given value.
- static Flags FailFast(bool fail_fast) {
- Flags flags;
- flags.fail_fast = fail_fast;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_filter flag has the given
- // value.
- static Flags Filter(const char* filter) {
- Flags flags;
- flags.filter = filter;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_list_tests flag has the
- // given value.
- static Flags ListTests(bool list_tests) {
- Flags flags;
- flags.list_tests = list_tests;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_output flag has the given
- // value.
- static Flags Output(const char* output) {
- Flags flags;
- flags.output = output;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_brief flag has the given
- // value.
- static Flags Brief(bool brief) {
- Flags flags;
- flags.brief = brief;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_print_time flag has the given
- // value.
- static Flags PrintTime(bool print_time) {
- Flags flags;
- flags.print_time = print_time;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_random_seed flag has the given
- // value.
- static Flags RandomSeed(int32_t random_seed) {
- Flags flags;
- flags.random_seed = random_seed;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_repeat flag has the given
- // value.
- static Flags Repeat(int32_t repeat) {
- Flags flags;
- flags.repeat = repeat;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_recreate_environments_when_repeating
- // flag has the given value.
- static Flags RecreateEnvironmentsWhenRepeating(
- bool recreate_environments_when_repeating) {
- Flags flags;
- flags.recreate_environments_when_repeating =
- recreate_environments_when_repeating;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_shuffle flag has the given
- // value.
- static Flags Shuffle(bool shuffle) {
- Flags flags;
- flags.shuffle = shuffle;
- return flags;
- }
-
- // Creates a Flags struct where the GTEST_FLAG(stack_trace_depth) flag has
- // the given value.
- static Flags StackTraceDepth(int32_t stack_trace_depth) {
- Flags flags;
- flags.stack_trace_depth = stack_trace_depth;
- return flags;
- }
-
- // Creates a Flags struct where the GTEST_FLAG(stream_result_to) flag has
- // the given value.
- static Flags StreamResultTo(const char* stream_result_to) {
- Flags flags;
- flags.stream_result_to = stream_result_to;
- return flags;
- }
-
- // Creates a Flags struct where the gtest_throw_on_failure flag has
- // the given value.
- static Flags ThrowOnFailure(bool throw_on_failure) {
- Flags flags;
- flags.throw_on_failure = throw_on_failure;
- return flags;
- }
-
- // These fields store the flag values.
- bool also_run_disabled_tests;
- bool break_on_failure;
- bool catch_exceptions;
- bool death_test_use_fork;
- bool fail_fast;
- const char* filter;
- bool list_tests;
- const char* output;
- bool brief;
- bool print_time;
- int32_t random_seed;
- int32_t repeat;
- bool recreate_environments_when_repeating;
- bool shuffle;
- int32_t stack_trace_depth;
- const char* stream_result_to;
- bool throw_on_failure;
-};
-
-// Fixture for testing ParseGoogleTestFlagsOnly().
-class ParseFlagsTest : public Test {
- protected:
- // Clears the flags before each test.
- void SetUp() override {
- GTEST_FLAG_SET(also_run_disabled_tests, false);
- GTEST_FLAG_SET(break_on_failure, false);
- GTEST_FLAG_SET(catch_exceptions, false);
- GTEST_FLAG_SET(death_test_use_fork, false);
- GTEST_FLAG_SET(fail_fast, false);
- GTEST_FLAG_SET(filter, "");
- GTEST_FLAG_SET(list_tests, false);
- GTEST_FLAG_SET(output, "");
- GTEST_FLAG_SET(brief, false);
- GTEST_FLAG_SET(print_time, true);
- GTEST_FLAG_SET(random_seed, 0);
- GTEST_FLAG_SET(repeat, 1);
- GTEST_FLAG_SET(recreate_environments_when_repeating, true);
- GTEST_FLAG_SET(shuffle, false);
- GTEST_FLAG_SET(stack_trace_depth, kMaxStackTraceDepth);
- GTEST_FLAG_SET(stream_result_to, "");
- GTEST_FLAG_SET(throw_on_failure, false);
- }
-
- // Asserts that two narrow or wide string arrays are equal.
- template <typename CharType>
- static void AssertStringArrayEq(int size1, CharType** array1, int size2,
- CharType** array2) {
- ASSERT_EQ(size1, size2) << " Array sizes different.";
-
- for (int i = 0; i != size1; i++) {
- ASSERT_STREQ(array1[i], array2[i]) << " where i == " << i;
- }
- }
-
- // Verifies that the flag values match the expected values.
- static void CheckFlags(const Flags& expected) {
- EXPECT_EQ(expected.also_run_disabled_tests,
- GTEST_FLAG_GET(also_run_disabled_tests));
- EXPECT_EQ(expected.break_on_failure, GTEST_FLAG_GET(break_on_failure));
- EXPECT_EQ(expected.catch_exceptions, GTEST_FLAG_GET(catch_exceptions));
- EXPECT_EQ(expected.death_test_use_fork,
- GTEST_FLAG_GET(death_test_use_fork));
- EXPECT_EQ(expected.fail_fast, GTEST_FLAG_GET(fail_fast));
- EXPECT_STREQ(expected.filter, GTEST_FLAG_GET(filter).c_str());
- EXPECT_EQ(expected.list_tests, GTEST_FLAG_GET(list_tests));
- EXPECT_STREQ(expected.output, GTEST_FLAG_GET(output).c_str());
- EXPECT_EQ(expected.brief, GTEST_FLAG_GET(brief));
- EXPECT_EQ(expected.print_time, GTEST_FLAG_GET(print_time));
- EXPECT_EQ(expected.random_seed, GTEST_FLAG_GET(random_seed));
- EXPECT_EQ(expected.repeat, GTEST_FLAG_GET(repeat));
- EXPECT_EQ(expected.recreate_environments_when_repeating,
- GTEST_FLAG_GET(recreate_environments_when_repeating));
- EXPECT_EQ(expected.shuffle, GTEST_FLAG_GET(shuffle));
- EXPECT_EQ(expected.stack_trace_depth, GTEST_FLAG_GET(stack_trace_depth));
- EXPECT_STREQ(expected.stream_result_to,
- GTEST_FLAG_GET(stream_result_to).c_str());
- EXPECT_EQ(expected.throw_on_failure, GTEST_FLAG_GET(throw_on_failure));
- }
-
- // Parses a command line (specified by argc1 and argv1), then
- // verifies that the flag values are expected and that the
- // recognized flags are removed from the command line.
- template <typename CharType>
- static void TestParsingFlags(int argc1, const CharType** argv1,
- int argc2, const CharType** argv2,
- const Flags& expected, bool should_print_help) {
- const bool saved_help_flag = ::testing::internal::g_help_flag;
- ::testing::internal::g_help_flag = false;
-
-# if GTEST_HAS_STREAM_REDIRECTION
- CaptureStdout();
-# endif
-
- // Parses the command line.
- internal::ParseGoogleTestFlagsOnly(&argc1, const_cast<CharType**>(argv1));
-
-# if GTEST_HAS_STREAM_REDIRECTION
- const std::string captured_stdout = GetCapturedStdout();
-# endif
-
- // Verifies the flag values.
- CheckFlags(expected);
-
- // Verifies that the recognized flags are removed from the command
- // line.
- AssertStringArrayEq(argc1 + 1, argv1, argc2 + 1, argv2);
-
- // ParseGoogleTestFlagsOnly should neither set g_help_flag nor print the
- // help message for the flags it recognizes.
- EXPECT_EQ(should_print_help, ::testing::internal::g_help_flag);
-
-# if GTEST_HAS_STREAM_REDIRECTION
- const char* const expected_help_fragment =
- "This program contains tests written using";
- if (should_print_help) {
- EXPECT_PRED_FORMAT2(IsSubstring, expected_help_fragment, captured_stdout);
- } else {
- EXPECT_PRED_FORMAT2(IsNotSubstring,
- expected_help_fragment, captured_stdout);
- }
-# endif // GTEST_HAS_STREAM_REDIRECTION
-
- ::testing::internal::g_help_flag = saved_help_flag;
- }
-
- // This macro wraps TestParsingFlags s.t. the user doesn't need
- // to specify the array sizes.
-
-# define GTEST_TEST_PARSING_FLAGS_(argv1, argv2, expected, should_print_help) \
- TestParsingFlags(sizeof(argv1)/sizeof(*argv1) - 1, argv1, \
- sizeof(argv2)/sizeof(*argv2) - 1, argv2, \
- expected, should_print_help)
-};
-
-// Tests parsing an empty command line.
-TEST_F(ParseFlagsTest, Empty) {
- const char* argv[] = {nullptr};
-
- const char* argv2[] = {nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), false);
-}
-
-// Tests parsing a command line that has no flag.
-TEST_F(ParseFlagsTest, NoFlag) {
- const char* argv[] = {"foo.exe", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), false);
-}
-
-// Tests parsing --gtest_fail_fast.
-TEST_F(ParseFlagsTest, FailFast) {
- const char* argv[] = {"foo.exe", "--gtest_fail_fast", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::FailFast(true), false);
-}
-
-// Tests parsing a bad --gtest_filter flag.
-TEST_F(ParseFlagsTest, FilterBad) {
- const char* argv[] = {"foo.exe", "--gtest_filter", nullptr};
-
- const char* argv2[] = {"foo.exe", "--gtest_filter", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter(""), true);
-}
-
-// Tests parsing an empty --gtest_filter flag.
-TEST_F(ParseFlagsTest, FilterEmpty) {
- const char* argv[] = {"foo.exe", "--gtest_filter=", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter(""), false);
-}
-
-// Tests parsing a non-empty --gtest_filter flag.
-TEST_F(ParseFlagsTest, FilterNonEmpty) {
- const char* argv[] = {"foo.exe", "--gtest_filter=abc", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("abc"), false);
-}
-
-// Tests parsing --gtest_break_on_failure.
-TEST_F(ParseFlagsTest, BreakOnFailureWithoutValue) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(true), false);
-}
-
-// Tests parsing --gtest_break_on_failure=0.
-TEST_F(ParseFlagsTest, BreakOnFailureFalse_0) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing --gtest_break_on_failure=f.
-TEST_F(ParseFlagsTest, BreakOnFailureFalse_f) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure=f", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing --gtest_break_on_failure=F.
-TEST_F(ParseFlagsTest, BreakOnFailureFalse_F) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure=F", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(false), false);
-}
-
-// Tests parsing a --gtest_break_on_failure flag that has a "true"
-// definition.
-TEST_F(ParseFlagsTest, BreakOnFailureTrue) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::BreakOnFailure(true), false);
-}
-
-// Tests parsing --gtest_catch_exceptions.
-TEST_F(ParseFlagsTest, CatchExceptions) {
- const char* argv[] = {"foo.exe", "--gtest_catch_exceptions", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::CatchExceptions(true), false);
-}
-
-// Tests parsing --gtest_death_test_use_fork.
-TEST_F(ParseFlagsTest, DeathTestUseFork) {
- const char* argv[] = {"foo.exe", "--gtest_death_test_use_fork", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::DeathTestUseFork(true), false);
-}
-
-// Tests having the same flag twice with different values. The
-// expected behavior is that the one coming last takes precedence.
-TEST_F(ParseFlagsTest, DuplicatedFlags) {
- const char* argv[] = {"foo.exe", "--gtest_filter=a", "--gtest_filter=b",
- nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("b"), false);
-}
-
-// Tests having an unrecognized flag on the command line.
-TEST_F(ParseFlagsTest, UnrecognizedFlag) {
- const char* argv[] = {"foo.exe", "--gtest_break_on_failure",
- "bar", // Unrecognized by Google Test.
- "--gtest_filter=b", nullptr};
-
- const char* argv2[] = {"foo.exe", "bar", nullptr};
-
- Flags flags;
- flags.break_on_failure = true;
- flags.filter = "b";
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, flags, false);
-}
-
-// Tests having a --gtest_list_tests flag
-TEST_F(ParseFlagsTest, ListTestsFlag) {
- const char* argv[] = {"foo.exe", "--gtest_list_tests", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(true), false);
-}
-
-// Tests having a --gtest_list_tests flag with a "true" value
-TEST_F(ParseFlagsTest, ListTestsTrue) {
- const char* argv[] = {"foo.exe", "--gtest_list_tests=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(true), false);
-}
-
-// Tests having a --gtest_list_tests flag with a "false" value
-TEST_F(ParseFlagsTest, ListTestsFalse) {
- const char* argv[] = {"foo.exe", "--gtest_list_tests=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_list_tests=f.
-TEST_F(ParseFlagsTest, ListTestsFalse_f) {
- const char* argv[] = {"foo.exe", "--gtest_list_tests=f", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_list_tests=F.
-TEST_F(ParseFlagsTest, ListTestsFalse_F) {
- const char* argv[] = {"foo.exe", "--gtest_list_tests=F", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ListTests(false), false);
-}
-
-// Tests parsing --gtest_output (invalid).
-TEST_F(ParseFlagsTest, OutputEmpty) {
- const char* argv[] = {"foo.exe", "--gtest_output", nullptr};
-
- const char* argv2[] = {"foo.exe", "--gtest_output", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), true);
-}
-
-// Tests parsing --gtest_output=xml
-TEST_F(ParseFlagsTest, OutputXml) {
- const char* argv[] = {"foo.exe", "--gtest_output=xml", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Output("xml"), false);
-}
-
-// Tests parsing --gtest_output=xml:file
-TEST_F(ParseFlagsTest, OutputXmlFile) {
- const char* argv[] = {"foo.exe", "--gtest_output=xml:file", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Output("xml:file"), false);
-}
-
-// Tests parsing --gtest_output=xml:directory/path/
-TEST_F(ParseFlagsTest, OutputXmlDirectory) {
- const char* argv[] = {"foo.exe", "--gtest_output=xml:directory/path/",
- nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2,
- Flags::Output("xml:directory/path/"), false);
-}
-
-// Tests having a --gtest_brief flag
-TEST_F(ParseFlagsTest, BriefFlag) {
- const char* argv[] = {"foo.exe", "--gtest_brief", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Brief(true), false);
-}
-
-// Tests having a --gtest_brief flag with a "true" value
-TEST_F(ParseFlagsTest, BriefFlagTrue) {
- const char* argv[] = {"foo.exe", "--gtest_brief=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Brief(true), false);
-}
-
-// Tests having a --gtest_brief flag with a "false" value
-TEST_F(ParseFlagsTest, BriefFlagFalse) {
- const char* argv[] = {"foo.exe", "--gtest_brief=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Brief(false), false);
-}
-
-// Tests having a --gtest_print_time flag
-TEST_F(ParseFlagsTest, PrintTimeFlag) {
- const char* argv[] = {"foo.exe", "--gtest_print_time", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(true), false);
-}
-
-// Tests having a --gtest_print_time flag with a "true" value
-TEST_F(ParseFlagsTest, PrintTimeTrue) {
- const char* argv[] = {"foo.exe", "--gtest_print_time=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(true), false);
-}
-
-// Tests having a --gtest_print_time flag with a "false" value
-TEST_F(ParseFlagsTest, PrintTimeFalse) {
- const char* argv[] = {"foo.exe", "--gtest_print_time=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_print_time=f.
-TEST_F(ParseFlagsTest, PrintTimeFalse_f) {
- const char* argv[] = {"foo.exe", "--gtest_print_time=f", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_print_time=F.
-TEST_F(ParseFlagsTest, PrintTimeFalse_F) {
- const char* argv[] = {"foo.exe", "--gtest_print_time=F", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::PrintTime(false), false);
-}
-
-// Tests parsing --gtest_random_seed=number
-TEST_F(ParseFlagsTest, RandomSeed) {
- const char* argv[] = {"foo.exe", "--gtest_random_seed=1000", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::RandomSeed(1000), false);
-}
-
-// Tests parsing --gtest_repeat=number
-TEST_F(ParseFlagsTest, Repeat) {
- const char* argv[] = {"foo.exe", "--gtest_repeat=1000", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Repeat(1000), false);
-}
-
-// Tests parsing --gtest_recreate_environments_when_repeating
-TEST_F(ParseFlagsTest, RecreateEnvironmentsWhenRepeating) {
- const char* argv[] = {
- "foo.exe",
- "--gtest_recreate_environments_when_repeating=0",
- nullptr,
- };
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(
- argv, argv2, Flags::RecreateEnvironmentsWhenRepeating(false), false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag
-TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFlag) {
- const char* argv[] = {"foo.exe", "--gtest_also_run_disabled_tests", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::AlsoRunDisabledTests(true),
- false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag with a "true" value
-TEST_F(ParseFlagsTest, AlsoRunDisabledTestsTrue) {
- const char* argv[] = {"foo.exe", "--gtest_also_run_disabled_tests=1",
- nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::AlsoRunDisabledTests(true),
- false);
-}
-
-// Tests having a --gtest_also_run_disabled_tests flag with a "false" value
-TEST_F(ParseFlagsTest, AlsoRunDisabledTestsFalse) {
- const char* argv[] = {"foo.exe", "--gtest_also_run_disabled_tests=0",
- nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::AlsoRunDisabledTests(false),
- false);
-}
-
-// Tests parsing --gtest_shuffle.
-TEST_F(ParseFlagsTest, ShuffleWithoutValue) {
- const char* argv[] = {"foo.exe", "--gtest_shuffle", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(true), false);
-}
-
-// Tests parsing --gtest_shuffle=0.
-TEST_F(ParseFlagsTest, ShuffleFalse_0) {
- const char* argv[] = {"foo.exe", "--gtest_shuffle=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(false), false);
-}
-
-// Tests parsing a --gtest_shuffle flag that has a "true" definition.
-TEST_F(ParseFlagsTest, ShuffleTrue) {
- const char* argv[] = {"foo.exe", "--gtest_shuffle=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Shuffle(true), false);
-}
-
-// Tests parsing --gtest_stack_trace_depth=number.
-TEST_F(ParseFlagsTest, StackTraceDepth) {
- const char* argv[] = {"foo.exe", "--gtest_stack_trace_depth=5", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::StackTraceDepth(5), false);
-}
-
-TEST_F(ParseFlagsTest, StreamResultTo) {
- const char* argv[] = {"foo.exe", "--gtest_stream_result_to=localhost:1234",
- nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(
- argv, argv2, Flags::StreamResultTo("localhost:1234"), false);
-}
-
-// Tests parsing --gtest_throw_on_failure.
-TEST_F(ParseFlagsTest, ThrowOnFailureWithoutValue) {
- const char* argv[] = {"foo.exe", "--gtest_throw_on_failure", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(true), false);
-}
-
-// Tests parsing --gtest_throw_on_failure=0.
-TEST_F(ParseFlagsTest, ThrowOnFailureFalse_0) {
- const char* argv[] = {"foo.exe", "--gtest_throw_on_failure=0", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(false), false);
-}
-
-// Tests parsing a --gtest_throw_on_failure flag that has a "true"
-// definition.
-TEST_F(ParseFlagsTest, ThrowOnFailureTrue) {
- const char* argv[] = {"foo.exe", "--gtest_throw_on_failure=1", nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::ThrowOnFailure(true), false);
-}
-
-# if GTEST_OS_WINDOWS
-// Tests parsing wide strings.
-TEST_F(ParseFlagsTest, WideStrings) {
- const wchar_t* argv[] = {
- L"foo.exe",
- L"--gtest_filter=Foo*",
- L"--gtest_list_tests=1",
- L"--gtest_break_on_failure",
- L"--non_gtest_flag",
- NULL
- };
-
- const wchar_t* argv2[] = {
- L"foo.exe",
- L"--non_gtest_flag",
- NULL
- };
-
- Flags expected_flags;
- expected_flags.break_on_failure = true;
- expected_flags.filter = "Foo*";
- expected_flags.list_tests = true;
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, expected_flags, false);
-}
-# endif // GTEST_OS_WINDOWS
-
-#if GTEST_USE_OWN_FLAGFILE_FLAG_
-class FlagfileTest : public ParseFlagsTest {
- public:
- void SetUp() override {
- ParseFlagsTest::SetUp();
-
- testdata_path_.Set(internal::FilePath(
- testing::TempDir() + internal::GetCurrentExecutableName().string() +
- "_flagfile_test"));
- testing::internal::posix::RmDir(testdata_path_.c_str());
- EXPECT_TRUE(testdata_path_.CreateFolder());
- }
-
- void TearDown() override {
- testing::internal::posix::RmDir(testdata_path_.c_str());
- ParseFlagsTest::TearDown();
- }
-
- internal::FilePath CreateFlagfile(const char* contents) {
- internal::FilePath file_path(internal::FilePath::GenerateUniqueFileName(
- testdata_path_, internal::FilePath("unique"), "txt"));
- FILE* f = testing::internal::posix::FOpen(file_path.c_str(), "w");
- fprintf(f, "%s", contents);
- fclose(f);
- return file_path;
- }
-
- private:
- internal::FilePath testdata_path_;
-};
-
-// Tests an empty flagfile.
-TEST_F(FlagfileTest, Empty) {
- internal::FilePath flagfile_path(CreateFlagfile(""));
- std::string flagfile_flag =
- std::string("--" GTEST_FLAG_PREFIX_ "flagfile=") + flagfile_path.c_str();
-
- const char* argv[] = {"foo.exe", flagfile_flag.c_str(), nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags(), false);
-}
-
-// Tests passing a non-empty --gtest_filter flag via --gtest_flagfile.
-TEST_F(FlagfileTest, FilterNonEmpty) {
- internal::FilePath flagfile_path(CreateFlagfile(
- "--" GTEST_FLAG_PREFIX_ "filter=abc"));
- std::string flagfile_flag =
- std::string("--" GTEST_FLAG_PREFIX_ "flagfile=") + flagfile_path.c_str();
-
- const char* argv[] = {"foo.exe", flagfile_flag.c_str(), nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, Flags::Filter("abc"), false);
-}
-
-// Tests passing several flags via --gtest_flagfile.
-TEST_F(FlagfileTest, SeveralFlags) {
- internal::FilePath flagfile_path(CreateFlagfile(
- "--" GTEST_FLAG_PREFIX_ "filter=abc\n"
- "--" GTEST_FLAG_PREFIX_ "break_on_failure\n"
- "--" GTEST_FLAG_PREFIX_ "list_tests"));
- std::string flagfile_flag =
- std::string("--" GTEST_FLAG_PREFIX_ "flagfile=") + flagfile_path.c_str();
-
- const char* argv[] = {"foo.exe", flagfile_flag.c_str(), nullptr};
-
- const char* argv2[] = {"foo.exe", nullptr};
-
- Flags expected_flags;
- expected_flags.break_on_failure = true;
- expected_flags.filter = "abc";
- expected_flags.list_tests = true;
-
- GTEST_TEST_PARSING_FLAGS_(argv, argv2, expected_flags, false);
-}
-#endif // GTEST_USE_OWN_FLAGFILE_FLAG_
-
-// Tests current_test_info() in UnitTest.
-class CurrentTestInfoTest : public Test {
- protected:
- // Tests that current_test_info() returns NULL before the first test in
- // the test case is run.
- static void SetUpTestSuite() {
- // There should be no tests running at this point.
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- EXPECT_TRUE(test_info == nullptr)
- << "There should be no tests running at this point.";
- }
-
- // Tests that current_test_info() returns NULL after the last test in
- // the test case has run.
- static void TearDownTestSuite() {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- EXPECT_TRUE(test_info == nullptr)
- << "There should be no tests running at this point.";
- }
-};
-
-// Tests that current_test_info() returns TestInfo for currently running
-// test by checking the expected test name against the actual one.
-TEST_F(CurrentTestInfoTest, WorksForFirstTestInATestSuite) {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- ASSERT_TRUE(nullptr != test_info)
- << "There is a test running so we should have a valid TestInfo.";
- EXPECT_STREQ("CurrentTestInfoTest", test_info->test_suite_name())
- << "Expected the name of the currently running test suite.";
- EXPECT_STREQ("WorksForFirstTestInATestSuite", test_info->name())
- << "Expected the name of the currently running test.";
-}
-
-// Tests that current_test_info() returns TestInfo for currently running
-// test by checking the expected test name against the actual one. We
-// use this test to see that the TestInfo object actually changed from
-// the previous invocation.
-TEST_F(CurrentTestInfoTest, WorksForSecondTestInATestSuite) {
- const TestInfo* test_info =
- UnitTest::GetInstance()->current_test_info();
- ASSERT_TRUE(nullptr != test_info)
- << "There is a test running so we should have a valid TestInfo.";
- EXPECT_STREQ("CurrentTestInfoTest", test_info->test_suite_name())
- << "Expected the name of the currently running test suite.";
- EXPECT_STREQ("WorksForSecondTestInATestSuite", test_info->name())
- << "Expected the name of the currently running test.";
-}
-
-} // namespace testing
-
-
-// These two lines test that we can define tests in a namespace that
-// has the name "testing" and is nested in another namespace.
-namespace my_namespace {
-namespace testing {
-
-// Makes sure that TEST knows to use ::testing::Test instead of
-// ::my_namespace::testing::Test.
-class Test {};
-
-// Makes sure that an assertion knows to use ::testing::Message instead of
-// ::my_namespace::testing::Message.
-class Message {};
-
-// Makes sure that an assertion knows to use
-// ::testing::AssertionResult instead of
-// ::my_namespace::testing::AssertionResult.
-class AssertionResult {};
-
-// Tests that an assertion that should succeed works as expected.
-TEST(NestedTestingNamespaceTest, Success) {
- EXPECT_EQ(1, 1) << "This shouldn't fail.";
-}
-
-// Tests that an assertion that should fail works as expected.
-TEST(NestedTestingNamespaceTest, Failure) {
- EXPECT_FATAL_FAILURE(FAIL() << "This failure is expected.",
- "This failure is expected.");
-}
-
-} // namespace testing
-} // namespace my_namespace
-
-// Tests that one can call superclass SetUp and TearDown methods--
-// that is, that they are not private.
-// No tests are based on this fixture; the test "passes" if it compiles
-// successfully.
-class ProtectedFixtureMethodsTest : public Test {
- protected:
- void SetUp() override { Test::SetUp(); }
- void TearDown() override { Test::TearDown(); }
-};
-
-// StreamingAssertionsTest tests the streaming versions of a representative
-// sample of assertions.
-TEST(StreamingAssertionsTest, Unconditional) {
- SUCCEED() << "expected success";
- EXPECT_NONFATAL_FAILURE(ADD_FAILURE() << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(FAIL() << "expected failure",
- "expected failure");
-}
-
-#ifdef __BORLANDC__
-// Silences warnings: "Condition is always true", "Unreachable code"
-# pragma option push -w-ccc -w-rch
-#endif
-
-TEST(StreamingAssertionsTest, Truth) {
- EXPECT_TRUE(true) << "unexpected failure";
- ASSERT_TRUE(true) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_TRUE(false) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_TRUE(false) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, Truth2) {
- EXPECT_FALSE(false) << "unexpected failure";
- ASSERT_FALSE(false) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_FALSE(true) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_FALSE(true) << "expected failure",
- "expected failure");
-}
-
-#ifdef __BORLANDC__
-// Restores warnings after previous "#pragma option push" suppressed them
-# pragma option pop
-#endif
-
-TEST(StreamingAssertionsTest, IntegerEquals) {
- EXPECT_EQ(1, 1) << "unexpected failure";
- ASSERT_EQ(1, 1) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_EQ(1, 2) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_EQ(1, 2) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, IntegerLessThan) {
- EXPECT_LT(1, 2) << "unexpected failure";
- ASSERT_LT(1, 2) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_LT(2, 1) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_LT(2, 1) << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsEqual) {
- EXPECT_STREQ("foo", "foo") << "unexpected failure";
- ASSERT_STREQ("foo", "foo") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STREQ("foo", "bar") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STREQ("foo", "bar") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsNotEqual) {
- EXPECT_STRNE("foo", "bar") << "unexpected failure";
- ASSERT_STRNE("foo", "bar") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRNE("foo", "foo") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRNE("foo", "foo") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringsEqualIgnoringCase) {
- EXPECT_STRCASEEQ("foo", "FOO") << "unexpected failure";
- ASSERT_STRCASEEQ("foo", "FOO") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASEEQ("foo", "bar") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASEEQ("foo", "bar") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, StringNotEqualIgnoringCase) {
- EXPECT_STRCASENE("foo", "bar") << "unexpected failure";
- ASSERT_STRCASENE("foo", "bar") << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_STRCASENE("foo", "FOO") << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_STRCASENE("bar", "BAR") << "expected failure",
- "expected failure");
-}
-
-TEST(StreamingAssertionsTest, FloatingPointEquals) {
- EXPECT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
- ASSERT_FLOAT_EQ(1.0, 1.0) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_FLOAT_EQ(0.0, 1.0) << "expected failure",
- "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_FLOAT_EQ(0.0, 1.0) << "expected failure",
- "expected failure");
-}
-
-#if GTEST_HAS_EXCEPTIONS
-
-TEST(StreamingAssertionsTest, Throw) {
- EXPECT_THROW(ThrowAnInteger(), int) << "unexpected failure";
- ASSERT_THROW(ThrowAnInteger(), int) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_THROW(ThrowAnInteger(), bool) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_THROW(ThrowAnInteger(), bool) <<
- "expected failure", "expected failure");
-}
-
-TEST(StreamingAssertionsTest, NoThrow) {
- EXPECT_NO_THROW(ThrowNothing()) << "unexpected failure";
- ASSERT_NO_THROW(ThrowNothing()) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_NO_THROW(ThrowAnInteger()) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_NO_THROW(ThrowAnInteger()) <<
- "expected failure", "expected failure");
-}
-
-TEST(StreamingAssertionsTest, AnyThrow) {
- EXPECT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
- ASSERT_ANY_THROW(ThrowAnInteger()) << "unexpected failure";
- EXPECT_NONFATAL_FAILURE(EXPECT_ANY_THROW(ThrowNothing()) <<
- "expected failure", "expected failure");
- EXPECT_FATAL_FAILURE(ASSERT_ANY_THROW(ThrowNothing()) <<
- "expected failure", "expected failure");
-}
-
-#endif // GTEST_HAS_EXCEPTIONS
-
-// Tests that Google Test correctly decides whether to use colors in the output.
-
-TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsYes) {
- GTEST_FLAG_SET(color, "yes");
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenGTestColorFlagIsAliasOfYes) {
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
-
- GTEST_FLAG_SET(color, "True");
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- GTEST_FLAG_SET(color, "t");
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- GTEST_FLAG_SET(color, "1");
- EXPECT_TRUE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsNo) {
- GTEST_FLAG_SET(color, "no");
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
-}
-
-TEST(ColoredOutputTest, UsesNoColorWhenGTestColorFlagIsInvalid) {
- SetEnv("TERM", "xterm"); // TERM supports colors.
-
- GTEST_FLAG_SET(color, "F");
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- GTEST_FLAG_SET(color, "0");
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- GTEST_FLAG_SET(color, "unknown");
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenStdoutIsTty) {
- GTEST_FLAG_SET(color, "auto");
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_FALSE(ShouldUseColor(false)); // Stdout is not a TTY.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-}
-
-TEST(ColoredOutputTest, UsesColorsWhenTermSupportsColors) {
- GTEST_FLAG_SET(color, "auto");
-
-#if GTEST_OS_WINDOWS && !GTEST_OS_WINDOWS_MINGW
- // On Windows, we ignore the TERM variable as it's usually not set.
-
- SetEnv("TERM", "dumb");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm");
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-#else
- // On non-Windows platforms, we rely on TERM to determine if the
- // terminal supports colors.
-
- SetEnv("TERM", "dumb"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "emacs"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "vt100"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-mono"); // TERM doesn't support colors.
- EXPECT_FALSE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "xterm-256color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "screen"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "screen-256color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "tmux"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "tmux-256color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "rxvt-unicode"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "rxvt-unicode-256color"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "linux"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-
- SetEnv("TERM", "cygwin"); // TERM supports colors.
- EXPECT_TRUE(ShouldUseColor(true)); // Stdout is a TTY.
-#endif // GTEST_OS_WINDOWS
-}
-
-// Verifies that StaticAssertTypeEq works in a namespace scope.
-
-static bool dummy1 GTEST_ATTRIBUTE_UNUSED_ = StaticAssertTypeEq<bool, bool>();
-static bool dummy2 GTEST_ATTRIBUTE_UNUSED_ =
- StaticAssertTypeEq<const int, const int>();
-
-// Verifies that StaticAssertTypeEq works in a class.
-
-template <typename T>
-class StaticAssertTypeEqTestHelper {
- public:
- StaticAssertTypeEqTestHelper() { StaticAssertTypeEq<bool, T>(); }
-};
-
-TEST(StaticAssertTypeEqTest, WorksInClass) {
- StaticAssertTypeEqTestHelper<bool>();
-}
-
-// Verifies that StaticAssertTypeEq works inside a function.
-
-typedef int IntAlias;
-
-TEST(StaticAssertTypeEqTest, CompilesForEqualTypes) {
- StaticAssertTypeEq<int, IntAlias>();
- StaticAssertTypeEq<int*, IntAlias*>();
-}
-
-TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsNoFailure) {
- EXPECT_FALSE(HasNonfatalFailure());
-}
-
-static void FailFatally() { FAIL(); }
-
-TEST(HasNonfatalFailureTest, ReturnsFalseWhenThereIsOnlyFatalFailure) {
- FailFatally();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_FALSE(has_nonfatal_failure);
-}
-
-TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-TEST(HasNonfatalFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
- FailFatally();
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-// A wrapper for calling HasNonfatalFailure outside of a test body.
-static bool HasNonfatalFailureHelper() {
- return testing::Test::HasNonfatalFailure();
-}
-
-TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody) {
- EXPECT_FALSE(HasNonfatalFailureHelper());
-}
-
-TEST(HasNonfatalFailureTest, WorksOutsideOfTestBody2) {
- ADD_FAILURE();
- const bool has_nonfatal_failure = HasNonfatalFailureHelper();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_nonfatal_failure);
-}
-
-TEST(HasFailureTest, ReturnsFalseWhenThereIsNoFailure) {
- EXPECT_FALSE(HasFailure());
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereIsFatalFailure) {
- FailFatally();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereIsNonfatalFailure) {
- ADD_FAILURE();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-TEST(HasFailureTest, ReturnsTrueWhenThereAreFatalAndNonfatalFailures) {
- FailFatally();
- ADD_FAILURE();
- const bool has_failure = HasFailure();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-// A wrapper for calling HasFailure outside of a test body.
-static bool HasFailureHelper() { return testing::Test::HasFailure(); }
-
-TEST(HasFailureTest, WorksOutsideOfTestBody) {
- EXPECT_FALSE(HasFailureHelper());
-}
-
-TEST(HasFailureTest, WorksOutsideOfTestBody2) {
- ADD_FAILURE();
- const bool has_failure = HasFailureHelper();
- ClearCurrentTestPartResults();
- EXPECT_TRUE(has_failure);
-}
-
-class TestListener : public EmptyTestEventListener {
- public:
- TestListener() : on_start_counter_(nullptr), is_destroyed_(nullptr) {}
- TestListener(int* on_start_counter, bool* is_destroyed)
- : on_start_counter_(on_start_counter),
- is_destroyed_(is_destroyed) {}
-
- ~TestListener() override {
- if (is_destroyed_)
- *is_destroyed_ = true;
- }
-
- protected:
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {
- if (on_start_counter_ != nullptr) (*on_start_counter_)++;
- }
-
- private:
- int* on_start_counter_;
- bool* is_destroyed_;
-};
-
-// Tests the constructor.
-TEST(TestEventListenersTest, ConstructionWorks) {
- TestEventListeners listeners;
-
- EXPECT_TRUE(TestEventListenersAccessor::GetRepeater(&listeners) != nullptr);
- EXPECT_TRUE(listeners.default_result_printer() == nullptr);
- EXPECT_TRUE(listeners.default_xml_generator() == nullptr);
-}
-
-// Tests that the TestEventListeners destructor deletes all the listeners it
-// owns.
-TEST(TestEventListenersTest, DestructionWorks) {
- bool default_result_printer_is_destroyed = false;
- bool default_xml_printer_is_destroyed = false;
- bool extra_listener_is_destroyed = false;
- TestListener* default_result_printer =
- new TestListener(nullptr, &default_result_printer_is_destroyed);
- TestListener* default_xml_printer =
- new TestListener(nullptr, &default_xml_printer_is_destroyed);
- TestListener* extra_listener =
- new TestListener(nullptr, &extra_listener_is_destroyed);
-
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners,
- default_result_printer);
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners,
- default_xml_printer);
- listeners.Append(extra_listener);
- }
- EXPECT_TRUE(default_result_printer_is_destroyed);
- EXPECT_TRUE(default_xml_printer_is_destroyed);
- EXPECT_TRUE(extra_listener_is_destroyed);
-}
-
-// Tests that a listener Append'ed to a TestEventListeners list starts
-// receiving events.
-TEST(TestEventListenersTest, Append) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- listeners.Append(listener);
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
- }
- EXPECT_TRUE(is_destroyed);
-}
-
-// Tests that listeners receive events in the order they were appended to
-// the list, except for *End requests, which must be received in the reverse
-// order.
-class SequenceTestingListener : public EmptyTestEventListener {
- public:
- SequenceTestingListener(std::vector<std::string>* vector, const char* id)
- : vector_(vector), id_(id) {}
-
- protected:
- void OnTestProgramStart(const UnitTest& /*unit_test*/) override {
- vector_->push_back(GetEventDescription("OnTestProgramStart"));
- }
-
- void OnTestProgramEnd(const UnitTest& /*unit_test*/) override {
- vector_->push_back(GetEventDescription("OnTestProgramEnd"));
- }
-
- void OnTestIterationStart(const UnitTest& /*unit_test*/,
- int /*iteration*/) override {
- vector_->push_back(GetEventDescription("OnTestIterationStart"));
- }
-
- void OnTestIterationEnd(const UnitTest& /*unit_test*/,
- int /*iteration*/) override {
- vector_->push_back(GetEventDescription("OnTestIterationEnd"));
- }
-
- private:
- std::string GetEventDescription(const char* method) {
- Message message;
- message << id_ << "." << method;
- return message.GetString();
- }
-
- std::vector<std::string>* vector_;
- const char* const id_;
-
- GTEST_DISALLOW_COPY_AND_ASSIGN_(SequenceTestingListener);
-};
-
-TEST(EventListenerTest, AppendKeepsOrder) {
- std::vector<std::string> vec;
- TestEventListeners listeners;
- listeners.Append(new SequenceTestingListener(&vec, "1st"));
- listeners.Append(new SequenceTestingListener(&vec, "2nd"));
- listeners.Append(new SequenceTestingListener(&vec, "3rd"));
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("1st.OnTestProgramStart", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestProgramStart", vec[1].c_str());
- EXPECT_STREQ("3rd.OnTestProgramStart", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramEnd(
- *UnitTest::GetInstance());
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("3rd.OnTestProgramEnd", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestProgramEnd", vec[1].c_str());
- EXPECT_STREQ("1st.OnTestProgramEnd", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationStart(
- *UnitTest::GetInstance(), 0);
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("1st.OnTestIterationStart", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestIterationStart", vec[1].c_str());
- EXPECT_STREQ("3rd.OnTestIterationStart", vec[2].c_str());
-
- vec.clear();
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestIterationEnd(
- *UnitTest::GetInstance(), 0);
- ASSERT_EQ(3U, vec.size());
- EXPECT_STREQ("3rd.OnTestIterationEnd", vec[0].c_str());
- EXPECT_STREQ("2nd.OnTestIterationEnd", vec[1].c_str());
- EXPECT_STREQ("1st.OnTestIterationEnd", vec[2].c_str());
-}
-
-// Tests that a listener removed from a TestEventListeners list stops receiving
-// events and is not deleted when the list is destroyed.
-TEST(TestEventListenersTest, Release) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- listeners.Append(listener);
- EXPECT_EQ(listener, listeners.Release(listener));
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_TRUE(listeners.Release(listener) == nullptr);
- }
- EXPECT_EQ(0, on_start_counter);
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Tests that no events are forwarded when event forwarding is disabled.
-TEST(EventListenerTest, SuppressEventForwarding) {
- int on_start_counter = 0;
- TestListener* listener = new TestListener(&on_start_counter, nullptr);
-
- TestEventListeners listeners;
- listeners.Append(listener);
- ASSERT_TRUE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
- TestEventListenersAccessor::SuppressEventForwarding(&listeners);
- ASSERT_FALSE(TestEventListenersAccessor::EventForwardingEnabled(listeners));
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
-}
-
-// Tests that events generated by Google Test are not forwarded in
-// death test subprocesses.
-TEST(EventListenerDeathTest, EventsNotForwardedInDeathTestSubprecesses) {
- EXPECT_DEATH_IF_SUPPORTED({
- GTEST_CHECK_(TestEventListenersAccessor::EventForwardingEnabled(
- *GetUnitTestImpl()->listeners())) << "expected failure";},
- "expected failure");
-}
-
-// Tests that a listener installed via SetDefaultResultPrinter() starts
-// receiving events and is returned via default_result_printer() and that
-// the previous default_result_printer is removed from the list and deleted.
-TEST(EventListenerTest, default_result_printer) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
-
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.default_result_printer());
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
-
- EXPECT_EQ(1, on_start_counter);
-
- // Replacing default_result_printer with something else should remove it
- // from the list and destroy it.
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, nullptr);
-
- EXPECT_TRUE(listeners.default_result_printer() == nullptr);
- EXPECT_TRUE(is_destroyed);
-
- // After broadcasting an event the counter is still the same, indicating
- // the listener is not in the list anymore.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
-}
-
-// Tests that the default_result_printer listener stops receiving events
-// when removed via Release and that is not owned by the list anymore.
-TEST(EventListenerTest, RemovingDefaultResultPrinterWorks) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultResultPrinter(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.Release(listener));
- EXPECT_TRUE(listeners.default_result_printer() == nullptr);
- EXPECT_FALSE(is_destroyed);
-
- // Broadcasting events now should not affect default_result_printer.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
- }
- // Destroying the list should not affect the listener now, too.
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Tests that a listener installed via SetDefaultXmlGenerator() starts
-// receiving events and is returned via default_xml_generator() and that
-// the previous default_xml_generator is removed from the list and deleted.
-TEST(EventListenerTest, default_xml_generator) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
-
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.default_xml_generator());
-
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
-
- EXPECT_EQ(1, on_start_counter);
-
- // Replacing default_xml_generator with something else should remove it
- // from the list and destroy it.
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, nullptr);
-
- EXPECT_TRUE(listeners.default_xml_generator() == nullptr);
- EXPECT_TRUE(is_destroyed);
-
- // After broadcasting an event the counter is still the same, indicating
- // the listener is not in the list anymore.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(1, on_start_counter);
-}
-
-// Tests that the default_xml_generator listener stops receiving events
-// when removed via Release and that is not owned by the list anymore.
-TEST(EventListenerTest, RemovingDefaultXmlGeneratorWorks) {
- int on_start_counter = 0;
- bool is_destroyed = false;
- // Although Append passes the ownership of this object to the list,
- // the following calls release it, and we need to delete it before the
- // test ends.
- TestListener* listener = new TestListener(&on_start_counter, &is_destroyed);
- {
- TestEventListeners listeners;
- TestEventListenersAccessor::SetDefaultXmlGenerator(&listeners, listener);
-
- EXPECT_EQ(listener, listeners.Release(listener));
- EXPECT_TRUE(listeners.default_xml_generator() == nullptr);
- EXPECT_FALSE(is_destroyed);
-
- // Broadcasting events now should not affect default_xml_generator.
- TestEventListenersAccessor::GetRepeater(&listeners)->OnTestProgramStart(
- *UnitTest::GetInstance());
- EXPECT_EQ(0, on_start_counter);
- }
- // Destroying the list should not affect the listener now, too.
- EXPECT_FALSE(is_destroyed);
- delete listener;
-}
-
-// Sanity tests to ensure that the alternative, verbose spellings of
-// some of the macros work. We don't test them thoroughly as that
-// would be quite involved. Since their implementations are
-// straightforward, and they are rarely used, we'll just rely on the
-// users to tell us when they are broken.
-GTEST_TEST(AlternativeNameTest, Works) { // GTEST_TEST is the same as TEST.
- GTEST_SUCCEED() << "OK"; // GTEST_SUCCEED is the same as SUCCEED.
-
- // GTEST_FAIL is the same as FAIL.
- EXPECT_FATAL_FAILURE(GTEST_FAIL() << "An expected failure",
- "An expected failure");
-
- // GTEST_ASSERT_XY is the same as ASSERT_XY.
-
- GTEST_ASSERT_EQ(0, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(0, 1) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_EQ(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_NE(0, 1);
- GTEST_ASSERT_NE(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_NE(0, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_LE(0, 0);
- GTEST_ASSERT_LE(0, 1);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LE(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_LT(0, 1);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(0, 0) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_LT(1, 0) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_GE(0, 0);
- GTEST_ASSERT_GE(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GE(0, 1) << "An expected failure",
- "An expected failure");
-
- GTEST_ASSERT_GT(1, 0);
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(0, 1) << "An expected failure",
- "An expected failure");
- EXPECT_FATAL_FAILURE(GTEST_ASSERT_GT(1, 1) << "An expected failure",
- "An expected failure");
-}
-
-// Tests for internal utilities necessary for implementation of the universal
-// printing.
-
-class ConversionHelperBase {};
-class ConversionHelperDerived : public ConversionHelperBase {};
-
-struct HasDebugStringMethods {
- std::string DebugString() const { return ""; }
- std::string ShortDebugString() const { return ""; }
-};
-
-struct InheritsDebugStringMethods : public HasDebugStringMethods {};
-
-struct WrongTypeDebugStringMethod {
- std::string DebugString() const { return ""; }
- int ShortDebugString() const { return 1; }
-};
-
-struct NotConstDebugStringMethod {
- std::string DebugString() { return ""; }
- std::string ShortDebugString() const { return ""; }
-};
-
-struct MissingDebugStringMethod {
- std::string DebugString() { return ""; }
-};
-
-struct IncompleteType;
-
-// Tests that HasDebugStringAndShortDebugString<T>::value is a compile-time
-// constant.
-TEST(HasDebugStringAndShortDebugStringTest, ValueIsCompileTimeConstant) {
- GTEST_COMPILE_ASSERT_(
- HasDebugStringAndShortDebugString<HasDebugStringMethods>::value,
- const_true);
- GTEST_COMPILE_ASSERT_(
- HasDebugStringAndShortDebugString<InheritsDebugStringMethods>::value,
- const_true);
- GTEST_COMPILE_ASSERT_(HasDebugStringAndShortDebugString<
- const InheritsDebugStringMethods>::value,
- const_true);
- GTEST_COMPILE_ASSERT_(
- !HasDebugStringAndShortDebugString<WrongTypeDebugStringMethod>::value,
- const_false);
- GTEST_COMPILE_ASSERT_(
- !HasDebugStringAndShortDebugString<NotConstDebugStringMethod>::value,
- const_false);
- GTEST_COMPILE_ASSERT_(
- !HasDebugStringAndShortDebugString<MissingDebugStringMethod>::value,
- const_false);
- GTEST_COMPILE_ASSERT_(
- !HasDebugStringAndShortDebugString<IncompleteType>::value, const_false);
- GTEST_COMPILE_ASSERT_(!HasDebugStringAndShortDebugString<int>::value,
- const_false);
-}
-
-// Tests that HasDebugStringAndShortDebugString<T>::value is true when T has
-// needed methods.
-TEST(HasDebugStringAndShortDebugStringTest,
- ValueIsTrueWhenTypeHasDebugStringAndShortDebugString) {
- EXPECT_TRUE(
- HasDebugStringAndShortDebugString<InheritsDebugStringMethods>::value);
-}
-
-// Tests that HasDebugStringAndShortDebugString<T>::value is false when T
-// doesn't have needed methods.
-TEST(HasDebugStringAndShortDebugStringTest,
- ValueIsFalseWhenTypeIsNotAProtocolMessage) {
- EXPECT_FALSE(HasDebugStringAndShortDebugString<int>::value);
- EXPECT_FALSE(
- HasDebugStringAndShortDebugString<const ConversionHelperBase>::value);
-}
-
-// Tests GTEST_REMOVE_REFERENCE_AND_CONST_.
-
-template <typename T1, typename T2>
-void TestGTestRemoveReferenceAndConst() {
- static_assert(std::is_same<T1, GTEST_REMOVE_REFERENCE_AND_CONST_(T2)>::value,
- "GTEST_REMOVE_REFERENCE_AND_CONST_ failed.");
-}
-
-TEST(RemoveReferenceToConstTest, Works) {
- TestGTestRemoveReferenceAndConst<int, int>();
- TestGTestRemoveReferenceAndConst<double, double&>();
- TestGTestRemoveReferenceAndConst<char, const char>();
- TestGTestRemoveReferenceAndConst<char, const char&>();
- TestGTestRemoveReferenceAndConst<const char*, const char*>();
-}
-
-// Tests GTEST_REFERENCE_TO_CONST_.
-
-template <typename T1, typename T2>
-void TestGTestReferenceToConst() {
- static_assert(std::is_same<T1, GTEST_REFERENCE_TO_CONST_(T2)>::value,
- "GTEST_REFERENCE_TO_CONST_ failed.");
-}
-
-TEST(GTestReferenceToConstTest, Works) {
- TestGTestReferenceToConst<const char&, char>();
- TestGTestReferenceToConst<const int&, const int>();
- TestGTestReferenceToConst<const double&, double>();
- TestGTestReferenceToConst<const std::string&, const std::string&>();
-}
-
-
-// Tests IsContainerTest.
-
-class NonContainer {};
-
-TEST(IsContainerTestTest, WorksForNonContainer) {
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<int>(0)));
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<char[5]>(0)));
- EXPECT_EQ(sizeof(IsNotContainer), sizeof(IsContainerTest<NonContainer>(0)));
-}
-
-TEST(IsContainerTestTest, WorksForContainer) {
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<std::vector<bool> >(0)));
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<std::map<int, double> >(0)));
-}
-
-struct ConstOnlyContainerWithPointerIterator {
- using const_iterator = int*;
- const_iterator begin() const;
- const_iterator end() const;
-};
-
-struct ConstOnlyContainerWithClassIterator {
- struct const_iterator {
- const int& operator*() const;
- const_iterator& operator++(/* pre-increment */);
- };
- const_iterator begin() const;
- const_iterator end() const;
-};
-
-TEST(IsContainerTestTest, ConstOnlyContainer) {
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<ConstOnlyContainerWithPointerIterator>(0)));
- EXPECT_EQ(sizeof(IsContainer),
- sizeof(IsContainerTest<ConstOnlyContainerWithClassIterator>(0)));
-}
-
-// Tests IsHashTable.
-struct AHashTable {
- typedef void hasher;
-};
-struct NotReallyAHashTable {
- typedef void hasher;
- typedef void reverse_iterator;
-};
-TEST(IsHashTable, Basic) {
- EXPECT_TRUE(testing::internal::IsHashTable<AHashTable>::value);
- EXPECT_FALSE(testing::internal::IsHashTable<NotReallyAHashTable>::value);
- EXPECT_FALSE(testing::internal::IsHashTable<std::vector<int>>::value);
- EXPECT_TRUE(testing::internal::IsHashTable<std::unordered_set<int>>::value);
-}
-
-// Tests ArrayEq().
-
-TEST(ArrayEqTest, WorksForDegeneratedArrays) {
- EXPECT_TRUE(ArrayEq(5, 5L));
- EXPECT_FALSE(ArrayEq('a', 0));
-}
-
-TEST(ArrayEqTest, WorksForOneDimensionalArrays) {
- // Note that a and b are distinct but compatible types.
- const int a[] = { 0, 1 };
- long b[] = { 0, 1 };
- EXPECT_TRUE(ArrayEq(a, b));
- EXPECT_TRUE(ArrayEq(a, 2, b));
-
- b[0] = 2;
- EXPECT_FALSE(ArrayEq(a, b));
- EXPECT_FALSE(ArrayEq(a, 1, b));
-}
-
-TEST(ArrayEqTest, WorksForTwoDimensionalArrays) {
- const char a[][3] = { "hi", "lo" };
- const char b[][3] = { "hi", "lo" };
- const char c[][3] = { "hi", "li" };
-
- EXPECT_TRUE(ArrayEq(a, b));
- EXPECT_TRUE(ArrayEq(a, 2, b));
-
- EXPECT_FALSE(ArrayEq(a, c));
- EXPECT_FALSE(ArrayEq(a, 2, c));
-}
-
-// Tests ArrayAwareFind().
-
-TEST(ArrayAwareFindTest, WorksForOneDimensionalArray) {
- const char a[] = "hello";
- EXPECT_EQ(a + 4, ArrayAwareFind(a, a + 5, 'o'));
- EXPECT_EQ(a + 5, ArrayAwareFind(a, a + 5, 'x'));
-}
-
-TEST(ArrayAwareFindTest, WorksForTwoDimensionalArray) {
- int a[][2] = { { 0, 1 }, { 2, 3 }, { 4, 5 } };
- const int b[2] = { 2, 3 };
- EXPECT_EQ(a + 1, ArrayAwareFind(a, a + 3, b));
-
- const int c[2] = { 6, 7 };
- EXPECT_EQ(a + 3, ArrayAwareFind(a, a + 3, c));
-}
-
-// Tests CopyArray().
-
-TEST(CopyArrayTest, WorksForDegeneratedArrays) {
- int n = 0;
- CopyArray('a', &n);
- EXPECT_EQ('a', n);
-}
-
-TEST(CopyArrayTest, WorksForOneDimensionalArrays) {
- const char a[3] = "hi";
- int b[3];
-#ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
- CopyArray(a, &b);
- EXPECT_TRUE(ArrayEq(a, b));
-#endif
-
- int c[3];
- CopyArray(a, 3, c);
- EXPECT_TRUE(ArrayEq(a, c));
-}
-
-TEST(CopyArrayTest, WorksForTwoDimensionalArrays) {
- const int a[2][3] = { { 0, 1, 2 }, { 3, 4, 5 } };
- int b[2][3];
-#ifndef __BORLANDC__ // C++Builder cannot compile some array size deductions.
- CopyArray(a, &b);
- EXPECT_TRUE(ArrayEq(a, b));
-#endif
-
- int c[2][3];
- CopyArray(a, 2, c);
- EXPECT_TRUE(ArrayEq(a, c));
-}
-
-// Tests NativeArray.
-
-TEST(NativeArrayTest, ConstructorFromArrayWorks) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, RelationToSourceReference());
- EXPECT_EQ(3U, na.size());
- EXPECT_EQ(a, na.begin());
-}
-
-TEST(NativeArrayTest, CreatesAndDeletesCopyOfArrayWhenAskedTo) {
- typedef int Array[2];
- Array* a = new Array[1];
- (*a)[0] = 0;
- (*a)[1] = 1;
- NativeArray<int> na(*a, 2, RelationToSourceCopy());
- EXPECT_NE(*a, na.begin());
- delete[] a;
- EXPECT_EQ(0, na.begin()[0]);
- EXPECT_EQ(1, na.begin()[1]);
-
- // We rely on the heap checker to verify that na deletes the copy of
- // array.
-}
-
-TEST(NativeArrayTest, TypeMembersAreCorrect) {
- StaticAssertTypeEq<char, NativeArray<char>::value_type>();
- StaticAssertTypeEq<int[2], NativeArray<int[2]>::value_type>();
-
- StaticAssertTypeEq<const char*, NativeArray<char>::const_iterator>();
- StaticAssertTypeEq<const bool(*)[2], NativeArray<bool[2]>::const_iterator>();
-}
-
-TEST(NativeArrayTest, MethodsWork) {
- const int a[3] = { 0, 1, 2 };
- NativeArray<int> na(a, 3, RelationToSourceCopy());
- ASSERT_EQ(3U, na.size());
- EXPECT_EQ(3, na.end() - na.begin());
-
- NativeArray<int>::const_iterator it = na.begin();
- EXPECT_EQ(0, *it);
- ++it;
- EXPECT_EQ(1, *it);
- it++;
- EXPECT_EQ(2, *it);
- ++it;
- EXPECT_EQ(na.end(), it);
-
- EXPECT_TRUE(na == na);
-
- NativeArray<int> na2(a, 3, RelationToSourceReference());
- EXPECT_TRUE(na == na2);
-
- const int b1[3] = { 0, 1, 1 };
- const int b2[4] = { 0, 1, 2, 3 };
- EXPECT_FALSE(na == NativeArray<int>(b1, 3, RelationToSourceReference()));
- EXPECT_FALSE(na == NativeArray<int>(b2, 4, RelationToSourceCopy()));
-}
-
-TEST(NativeArrayTest, WorksForTwoDimensionalArray) {
- const char a[2][3] = { "hi", "lo" };
- NativeArray<char[3]> na(a, 2, RelationToSourceReference());
- ASSERT_EQ(2U, na.size());
- EXPECT_EQ(a, na.begin());
-}
-
-// IndexSequence
-TEST(IndexSequence, MakeIndexSequence) {
- using testing::internal::IndexSequence;
- using testing::internal::MakeIndexSequence;
- EXPECT_TRUE(
- (std::is_same<IndexSequence<>, MakeIndexSequence<0>::type>::value));
- EXPECT_TRUE(
- (std::is_same<IndexSequence<0>, MakeIndexSequence<1>::type>::value));
- EXPECT_TRUE(
- (std::is_same<IndexSequence<0, 1>, MakeIndexSequence<2>::type>::value));
- EXPECT_TRUE((
- std::is_same<IndexSequence<0, 1, 2>, MakeIndexSequence<3>::type>::value));
- EXPECT_TRUE(
- (std::is_base_of<IndexSequence<0, 1, 2>, MakeIndexSequence<3>>::value));
-}
-
-// ElemFromList
-TEST(ElemFromList, Basic) {
- using testing::internal::ElemFromList;
- EXPECT_TRUE(
- (std::is_same<int, ElemFromList<0, int, double, char>::type>::value));
- EXPECT_TRUE(
- (std::is_same<double, ElemFromList<1, int, double, char>::type>::value));
- EXPECT_TRUE(
- (std::is_same<char, ElemFromList<2, int, double, char>::type>::value));
- EXPECT_TRUE((
- std::is_same<char, ElemFromList<7, int, int, int, int, int, int, int,
- char, int, int, int, int>::type>::value));
-}
-
-// FlatTuple
-TEST(FlatTuple, Basic) {
- using testing::internal::FlatTuple;
-
- FlatTuple<int, double, const char*> tuple = {};
- EXPECT_EQ(0, tuple.Get<0>());
- EXPECT_EQ(0.0, tuple.Get<1>());
- EXPECT_EQ(nullptr, tuple.Get<2>());
-
- tuple = FlatTuple<int, double, const char*>(
- testing::internal::FlatTupleConstructTag{}, 7, 3.2, "Foo");
- EXPECT_EQ(7, tuple.Get<0>());
- EXPECT_EQ(3.2, tuple.Get<1>());
- EXPECT_EQ(std::string("Foo"), tuple.Get<2>());
-
- tuple.Get<1>() = 5.1;
- EXPECT_EQ(5.1, tuple.Get<1>());
-}
-
-namespace {
-std::string AddIntToString(int i, const std::string& s) {
- return s + std::to_string(i);
-}
-} // namespace
-
-TEST(FlatTuple, Apply) {
- using testing::internal::FlatTuple;
-
- FlatTuple<int, std::string> tuple{testing::internal::FlatTupleConstructTag{},
- 5, "Hello"};
-
- // Lambda.
- EXPECT_TRUE(tuple.Apply([](int i, const std::string& s) -> bool {
- return i == static_cast<int>(s.size());
- }));
-
- // Function.
- EXPECT_EQ(tuple.Apply(AddIntToString), "Hello5");
-
- // Mutating operations.
- tuple.Apply([](int& i, std::string& s) {
- ++i;
- s += s;
- });
- EXPECT_EQ(tuple.Get<0>(), 6);
- EXPECT_EQ(tuple.Get<1>(), "HelloHello");
-}
-
-struct ConstructionCounting {
- ConstructionCounting() { ++default_ctor_calls; }
- ~ConstructionCounting() { ++dtor_calls; }
- ConstructionCounting(const ConstructionCounting&) { ++copy_ctor_calls; }
- ConstructionCounting(ConstructionCounting&&) noexcept { ++move_ctor_calls; }
- ConstructionCounting& operator=(const ConstructionCounting&) {
- ++copy_assignment_calls;
- return *this;
- }
- ConstructionCounting& operator=(ConstructionCounting&&) noexcept {
- ++move_assignment_calls;
- return *this;
- }
-
- static void Reset() {
- default_ctor_calls = 0;
- dtor_calls = 0;
- copy_ctor_calls = 0;
- move_ctor_calls = 0;
- copy_assignment_calls = 0;
- move_assignment_calls = 0;
- }
-
- static int default_ctor_calls;
- static int dtor_calls;
- static int copy_ctor_calls;
- static int move_ctor_calls;
- static int copy_assignment_calls;
- static int move_assignment_calls;
-};
-
-int ConstructionCounting::default_ctor_calls = 0;
-int ConstructionCounting::dtor_calls = 0;
-int ConstructionCounting::copy_ctor_calls = 0;
-int ConstructionCounting::move_ctor_calls = 0;
-int ConstructionCounting::copy_assignment_calls = 0;
-int ConstructionCounting::move_assignment_calls = 0;
-
-TEST(FlatTuple, ConstructorCalls) {
- using testing::internal::FlatTuple;
-
- // Default construction.
- ConstructionCounting::Reset();
- { FlatTuple<ConstructionCounting> tuple; }
- EXPECT_EQ(ConstructionCounting::default_ctor_calls, 1);
- EXPECT_EQ(ConstructionCounting::dtor_calls, 1);
- EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::copy_assignment_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_assignment_calls, 0);
-
- // Copy construction.
- ConstructionCounting::Reset();
- {
- ConstructionCounting elem;
- FlatTuple<ConstructionCounting> tuple{
- testing::internal::FlatTupleConstructTag{}, elem};
- }
- EXPECT_EQ(ConstructionCounting::default_ctor_calls, 1);
- EXPECT_EQ(ConstructionCounting::dtor_calls, 2);
- EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 1);
- EXPECT_EQ(ConstructionCounting::move_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::copy_assignment_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_assignment_calls, 0);
-
- // Move construction.
- ConstructionCounting::Reset();
- {
- FlatTuple<ConstructionCounting> tuple{
- testing::internal::FlatTupleConstructTag{}, ConstructionCounting{}};
- }
- EXPECT_EQ(ConstructionCounting::default_ctor_calls, 1);
- EXPECT_EQ(ConstructionCounting::dtor_calls, 2);
- EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_ctor_calls, 1);
- EXPECT_EQ(ConstructionCounting::copy_assignment_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_assignment_calls, 0);
-
- // Copy assignment.
- // TODO(ofats): it should be testing assignment operator of FlatTuple, not its
- // elements
- ConstructionCounting::Reset();
- {
- FlatTuple<ConstructionCounting> tuple;
- ConstructionCounting elem;
- tuple.Get<0>() = elem;
- }
- EXPECT_EQ(ConstructionCounting::default_ctor_calls, 2);
- EXPECT_EQ(ConstructionCounting::dtor_calls, 2);
- EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::copy_assignment_calls, 1);
- EXPECT_EQ(ConstructionCounting::move_assignment_calls, 0);
-
- // Move assignment.
- // TODO(ofats): it should be testing assignment operator of FlatTuple, not its
- // elements
- ConstructionCounting::Reset();
- {
- FlatTuple<ConstructionCounting> tuple;
- tuple.Get<0>() = ConstructionCounting{};
- }
- EXPECT_EQ(ConstructionCounting::default_ctor_calls, 2);
- EXPECT_EQ(ConstructionCounting::dtor_calls, 2);
- EXPECT_EQ(ConstructionCounting::copy_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_ctor_calls, 0);
- EXPECT_EQ(ConstructionCounting::copy_assignment_calls, 0);
- EXPECT_EQ(ConstructionCounting::move_assignment_calls, 1);
-
- ConstructionCounting::Reset();
-}
-
-TEST(FlatTuple, ManyTypes) {
- using testing::internal::FlatTuple;
-
- // Instantiate FlatTuple with 257 ints.
- // Tests show that we can do it with thousands of elements, but very long
- // compile times makes it unusuitable for this test.
-#define GTEST_FLAT_TUPLE_INT8 int, int, int, int, int, int, int, int,
-#define GTEST_FLAT_TUPLE_INT16 GTEST_FLAT_TUPLE_INT8 GTEST_FLAT_TUPLE_INT8
-#define GTEST_FLAT_TUPLE_INT32 GTEST_FLAT_TUPLE_INT16 GTEST_FLAT_TUPLE_INT16
-#define GTEST_FLAT_TUPLE_INT64 GTEST_FLAT_TUPLE_INT32 GTEST_FLAT_TUPLE_INT32
-#define GTEST_FLAT_TUPLE_INT128 GTEST_FLAT_TUPLE_INT64 GTEST_FLAT_TUPLE_INT64
-#define GTEST_FLAT_TUPLE_INT256 GTEST_FLAT_TUPLE_INT128 GTEST_FLAT_TUPLE_INT128
-
- // Let's make sure that we can have a very long list of types without blowing
- // up the template instantiation depth.
- FlatTuple<GTEST_FLAT_TUPLE_INT256 int> tuple;
-
- tuple.Get<0>() = 7;
- tuple.Get<99>() = 17;
- tuple.Get<256>() = 1000;
- EXPECT_EQ(7, tuple.Get<0>());
- EXPECT_EQ(17, tuple.Get<99>());
- EXPECT_EQ(1000, tuple.Get<256>());
-}
-
-// Tests SkipPrefix().
-
-TEST(SkipPrefixTest, SkipsWhenPrefixMatches) {
- const char* const str = "hello";
-
- const char* p = str;
- EXPECT_TRUE(SkipPrefix("", &p));
- EXPECT_EQ(str, p);
-
- p = str;
- EXPECT_TRUE(SkipPrefix("hell", &p));
- EXPECT_EQ(str + 4, p);
-}
-
-TEST(SkipPrefixTest, DoesNotSkipWhenPrefixDoesNotMatch) {
- const char* const str = "world";
-
- const char* p = str;
- EXPECT_FALSE(SkipPrefix("W", &p));
- EXPECT_EQ(str, p);
-
- p = str;
- EXPECT_FALSE(SkipPrefix("world!", &p));
- EXPECT_EQ(str, p);
-}
-
-// Tests ad_hoc_test_result().
-TEST(AdHocTestResultTest, AdHocTestResultForUnitTestDoesNotShowFailure) {
- const testing::TestResult& test_result =
- testing::UnitTest::GetInstance()->ad_hoc_test_result();
- EXPECT_FALSE(test_result.Failed());
-}
-
-class DynamicUnitTestFixture : public testing::Test {};
-
-class DynamicTest : public DynamicUnitTestFixture {
- void TestBody() override { EXPECT_TRUE(true); }
-};
-
-auto* dynamic_test = testing::RegisterTest(
- "DynamicUnitTestFixture", "DynamicTest", "TYPE", "VALUE", __FILE__,
- __LINE__, []() -> DynamicUnitTestFixture* { return new DynamicTest; });
-
-TEST(RegisterTest, WasRegistered) {
- auto* unittest = testing::UnitTest::GetInstance();
- for (int i = 0; i < unittest->total_test_suite_count(); ++i) {
- auto* tests = unittest->GetTestSuite(i);
- if (tests->name() != std::string("DynamicUnitTestFixture")) continue;
- for (int j = 0; j < tests->total_test_count(); ++j) {
- if (tests->GetTestInfo(j)->name() != std::string("DynamicTest")) continue;
- // Found it.
- EXPECT_STREQ(tests->GetTestInfo(j)->value_param(), "VALUE");
- EXPECT_STREQ(tests->GetTestInfo(j)->type_param(), "TYPE");
- return;
- }
- }
-
- FAIL() << "Didn't find the test!";
-}
-
-// Test that the pattern globbing algorithm is linear. If not, this test should
-// time out.
-TEST(PatternGlobbingTest, MatchesFilterLinearRuntime) {
- std::string name(100, 'a'); // Construct the string (a^100)b
- name.push_back('b');
-
- std::string pattern; // Construct the string ((a*)^100)b
- for (int i = 0; i < 100; ++i) {
- pattern.append("a*");
- }
- pattern.push_back('b');
-
- EXPECT_TRUE(
- testing::internal::UnitTestOptions::MatchesFilter(name, pattern.c_str()));
-}
-
-TEST(PatternGlobbingTest, MatchesFilterWithMultiplePatterns) {
- const std::string name = "aaaa";
- EXPECT_TRUE(testing::internal::UnitTestOptions::MatchesFilter(name, "a*"));
- EXPECT_TRUE(testing::internal::UnitTestOptions::MatchesFilter(name, "a*:"));
- EXPECT_FALSE(testing::internal::UnitTestOptions::MatchesFilter(name, "ab"));
- EXPECT_FALSE(testing::internal::UnitTestOptions::MatchesFilter(name, "ab:"));
- EXPECT_TRUE(testing::internal::UnitTestOptions::MatchesFilter(name, "ab:a*"));
-}
-
-TEST(PatternGlobbingTest, MatchesFilterEdgeCases) {
- EXPECT_FALSE(testing::internal::UnitTestOptions::MatchesFilter("", "*a"));
- EXPECT_TRUE(testing::internal::UnitTestOptions::MatchesFilter("", "*"));
- EXPECT_FALSE(testing::internal::UnitTestOptions::MatchesFilter("a", ""));
- EXPECT_TRUE(testing::internal::UnitTestOptions::MatchesFilter("", ""));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile1_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile1_test_.cc
deleted file mode 100644
index 19aa252a30..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile1_test_.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// gtest_xml_outfile1_test_ writes some xml via TestProperty used by
-// gtest_xml_outfiles_test.py
-
-#include "gtest/gtest.h"
-
-class PropertyOne : public testing::Test {
- protected:
- void SetUp() override { RecordProperty("SetUpProp", 1); }
- void TearDown() override { RecordProperty("TearDownProp", 1); }
-};
-
-TEST_F(PropertyOne, TestSomeProperties) {
- RecordProperty("TestSomeProperty", 1);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile2_test_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile2_test_.cc
deleted file mode 100644
index f9a2a6e984..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfile2_test_.cc
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2008, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// gtest_xml_outfile2_test_ writes some xml via TestProperty used by
-// gtest_xml_outfiles_test.py
-
-#include "gtest/gtest.h"
-
-class PropertyTwo : public testing::Test {
- protected:
- void SetUp() override { RecordProperty("SetUpProp", 2); }
- void TearDown() override { RecordProperty("TearDownProp", 2); }
-};
-
-TEST_F(PropertyTwo, TestSomeProperties) {
- RecordProperty("TestSomeProperty", 2);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfiles_test.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfiles_test.py
deleted file mode 100755
index 916bdf4de4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_outfiles_test.py
+++ /dev/null
@@ -1,135 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2008, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_xml_output module."""
-
-import os
-from xml.dom import minidom, Node
-from googletest.test import gtest_test_utils
-from googletest.test import gtest_xml_test_utils
-
-GTEST_OUTPUT_SUBDIR = "xml_outfiles"
-GTEST_OUTPUT_1_TEST = "gtest_xml_outfile1_test_"
-GTEST_OUTPUT_2_TEST = "gtest_xml_outfile2_test_"
-
-EXPECTED_XML_1 = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests">
- <testsuite name="PropertyOne" tests="1" failures="0" skipped="0" disabled="0" errors="0" time="*" timestamp="*">
- <testcase name="TestSomeProperties" status="run" result="completed" time="*" timestamp="*" classname="PropertyOne">
- <properties>
- <property name="SetUpProp" value="1"/>
- <property name="TestSomeProperty" value="1"/>
- <property name="TearDownProp" value="1"/>
- </properties>
- </testcase>
- </testsuite>
-</testsuites>
-"""
-
-EXPECTED_XML_2 = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="1" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests">
- <testsuite name="PropertyTwo" tests="1" failures="0" skipped="0" disabled="0" errors="0" time="*" timestamp="*">
- <testcase name="TestSomeProperties" status="run" result="completed" time="*" timestamp="*" classname="PropertyTwo">
- <properties>
- <property name="SetUpProp" value="2"/>
- <property name="TestSomeProperty" value="2"/>
- <property name="TearDownProp" value="2"/>
- </properties>
- </testcase>
- </testsuite>
-</testsuites>
-"""
-
-
-class GTestXMLOutFilesTest(gtest_xml_test_utils.GTestXMLTestCase):
- """Unit test for Google Test's XML output functionality."""
-
- def setUp(self):
- # We want the trailing '/' that the last "" provides in os.path.join, for
- # telling Google Test to create an output directory instead of a single file
- # for xml output.
- self.output_dir_ = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_OUTPUT_SUBDIR, "")
- self.DeleteFilesAndDir()
-
- def tearDown(self):
- self.DeleteFilesAndDir()
-
- def DeleteFilesAndDir(self):
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_1_TEST + ".xml"))
- except os.error:
- pass
- try:
- os.remove(os.path.join(self.output_dir_, GTEST_OUTPUT_2_TEST + ".xml"))
- except os.error:
- pass
- try:
- os.rmdir(self.output_dir_)
- except os.error:
- pass
-
- def testOutfile1(self):
- self._TestOutFile(GTEST_OUTPUT_1_TEST, EXPECTED_XML_1)
-
- def testOutfile2(self):
- self._TestOutFile(GTEST_OUTPUT_2_TEST, EXPECTED_XML_2)
-
- def _TestOutFile(self, test_name, expected_xml):
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(test_name)
- command = [gtest_prog_path, "--gtest_output=xml:%s" % self.output_dir_]
- p = gtest_test_utils.Subprocess(command,
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
-
- output_file_name1 = test_name + ".xml"
- output_file1 = os.path.join(self.output_dir_, output_file_name1)
- output_file_name2 = 'lt-' + output_file_name1
- output_file2 = os.path.join(self.output_dir_, output_file_name2)
- self.assert_(os.path.isfile(output_file1) or os.path.isfile(output_file2),
- output_file1)
-
- expected = minidom.parseString(expected_xml)
- if os.path.isfile(output_file1):
- actual = minidom.parse(output_file1)
- else:
- actual = minidom.parse(output_file2)
- self.NormalizeXml(actual.documentElement)
- self.AssertEquivalentNodes(expected.documentElement,
- actual.documentElement)
- expected.unlink()
- actual.unlink()
-
-
-if __name__ == "__main__":
- os.environ["GTEST_STACK_TRACE_DEPTH"] = "0"
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest.py
deleted file mode 100755
index f0b0c3b906..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest.py
+++ /dev/null
@@ -1,415 +0,0 @@
-#!/usr/bin/env python
-#
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test for the gtest_xml_output module"""
-
-import datetime
-import errno
-import os
-import re
-import sys
-from xml.dom import minidom, Node
-
-from googletest.test import gtest_test_utils
-from googletest.test import gtest_xml_test_utils
-
-GTEST_FILTER_FLAG = '--gtest_filter'
-GTEST_LIST_TESTS_FLAG = '--gtest_list_tests'
-GTEST_OUTPUT_FLAG = '--gtest_output'
-GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
-GTEST_PROGRAM_NAME = 'gtest_xml_output_unittest_'
-
-# The flag indicating stacktraces are not supported
-NO_STACKTRACE_SUPPORT_FLAG = '--no_stacktrace_support'
-
-# The environment variables for test sharding.
-TOTAL_SHARDS_ENV_VAR = 'GTEST_TOTAL_SHARDS'
-SHARD_INDEX_ENV_VAR = 'GTEST_SHARD_INDEX'
-SHARD_STATUS_FILE_ENV_VAR = 'GTEST_SHARD_STATUS_FILE'
-
-SUPPORTS_STACK_TRACES = NO_STACKTRACE_SUPPORT_FLAG not in sys.argv
-
-if SUPPORTS_STACK_TRACES:
- STACK_TRACE_TEMPLATE = '\nStack trace:\n*'
-else:
- STACK_TRACE_TEMPLATE = ''
- # unittest.main() can't handle unknown flags
- sys.argv.remove(NO_STACKTRACE_SUPPORT_FLAG)
-
-EXPECTED_NON_EMPTY_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="26" failures="5" disabled="2" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42">
- <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/>
- </testsuite>
- <testsuite name="FailedTest" tests="1" failures="1" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="Fails" status="run" result="completed" time="*" timestamp="*" classname="FailedTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Expected equality of these values:
- 1
- 2%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="MixedResultTest" tests="3" failures="1" disabled="1" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="MixedResultTest"/>
- <testcase name="Fails" status="run" result="completed" time="*" timestamp="*" classname="MixedResultTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Expected equality of these values:
- 1
- 2%(stack)s]]></failure>
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 2&#x0A; 3" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Expected equality of these values:
- 2
- 3%(stack)s]]></failure>
- </testcase>
- <testcase name="DISABLED_test" status="notrun" result="suppressed" time="*" timestamp="*" classname="MixedResultTest"/>
- </testsuite>
- <testsuite name="XmlQuotingTest" tests="1" failures="1" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="OutputsCData" status="run" result="completed" time="*" timestamp="*" classname="XmlQuotingTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;XML output: &lt;?xml encoding=&quot;utf-8&quot;&gt;&lt;top&gt;&lt;![CDATA[cdata text]]&gt;&lt;/top&gt;" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Failed
-XML output: <?xml encoding="utf-8"><top><![CDATA[cdata text]]>]]&gt;<![CDATA[</top>%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="InvalidCharactersTest" tests="1" failures="1" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="InvalidCharactersInMessage" status="run" result="completed" time="*" timestamp="*" classname="InvalidCharactersTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Failed&#x0A;Invalid characters in brackets []" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Failed
-Invalid characters in brackets []%(stack)s]]></failure>
- </testcase>
- </testsuite>
- <testsuite name="DisabledTest" tests="1" failures="0" disabled="1" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="DISABLED_test_not_run" status="notrun" result="suppressed" time="*" timestamp="*" classname="DisabledTest"/>
- </testsuite>
- <testsuite name="SkippedTest" tests="3" failures="1" disabled="0" skipped="2" errors="0" time="*" timestamp="*">
- <testcase name="Skipped" status="run" result="skipped" time="*" timestamp="*" classname="SkippedTest">
- <skipped message="gtest_xml_output_unittest_.cc:*&#x0A;"><![CDATA[gtest_xml_output_unittest_.cc:*
-%(stack)s]]></skipped>
- </testcase>
- <testcase name="SkippedWithMessage" status="run" result="skipped" time="*" timestamp="*" classname="SkippedTest">
- <skipped message="gtest_xml_output_unittest_.cc:*&#x0A;It is good practice to tell why you skip a test."><![CDATA[gtest_xml_output_unittest_.cc:*
-It is good practice to tell why you skip a test.%(stack)s]]></skipped>
- </testcase>
- <testcase name="SkippedAfterFailure" status="run" result="completed" time="*" timestamp="*" classname="SkippedTest">
- <failure message="gtest_xml_output_unittest_.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_xml_output_unittest_.cc:*
-Expected equality of these values:
- 1
- 2%(stack)s]]></failure>
- <skipped message="gtest_xml_output_unittest_.cc:*&#x0A;It is good practice to tell why you skip a test."><![CDATA[gtest_xml_output_unittest_.cc:*
-It is good practice to tell why you skip a test.%(stack)s]]></skipped>
- </testcase>
-
- </testsuite>
- <testsuite name="PropertyRecordingTest" tests="4" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*" SetUpTestSuite="yes" TearDownTestSuite="aye">
- <testcase name="OneProperty" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
- <properties>
- <property name="key_1" value="1"/>
- </properties>
- </testcase>
- <testcase name="IntValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
- <properties>
- <property name="key_int" value="1"/>
- </properties>
- </testcase>
- <testcase name="ThreeProperties" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
- <properties>
- <property name="key_1" value="1"/>
- <property name="key_2" value="2"/>
- <property name="key_3" value="3"/>
- </properties>
- </testcase>
- <testcase name="TwoValuesForOneKeyUsesLastValue" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
- <properties>
- <property name="key_1" value="2"/>
- </properties>
- </testcase>
- </testsuite>
- <testsuite name="NoFixtureTest" tests="3" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="RecordProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest">
- <properties>
- <property name="key" value="1"/>
- </properties>
- </testcase>
- <testcase name="ExternalUtilityThatCallsRecordIntValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest">
- <properties>
- <property name="key_for_utility_int" value="1"/>
- </properties>
- </testcase>
- <testcase name="ExternalUtilityThatCallsRecordStringValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="NoFixtureTest">
- <properties>
- <property name="key_for_utility_string" value="1"/>
- </properties>
- </testcase>
- </testsuite>
- <testsuite name="Single/ValueParamTest" tests="4" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" />
- <testcase name="HasValueParamAttribute/1" value_param="42" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" />
- <testcase name="AnotherTestThatHasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" />
- <testcase name="AnotherTestThatHasValueParamAttribute/1" value_param="42" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" />
- </testsuite>
- <testsuite name="TypedTest/0" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="TypedTest/0" />
- </testsuite>
- <testsuite name="TypedTest/1" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="TypedTest/1" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestSuite/0" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="Single/TypeParameterizedTestSuite/0" />
- </testsuite>
- <testsuite name="Single/TypeParameterizedTestSuite/1" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasTypeParamAttribute" type_param="*" status="run" result="completed" time="*" timestamp="*" classname="Single/TypeParameterizedTestSuite/1" />
- </testsuite>
-</testsuites>""" % {
- 'stack': STACK_TRACE_TEMPLATE
-}
-
-EXPECTED_FILTERED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="1" failures="0" disabled="0" errors="0" time="*"
- timestamp="*" name="AllTests" ad_hoc_property="42">
- <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" skipped="0"
- errors="0" time="*" timestamp="*">
- <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/>
- </testsuite>
-</testsuites>"""
-
-EXPECTED_SHARDED_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="3" failures="0" disabled="0" errors="0" time="*" timestamp="*" name="AllTests" ad_hoc_property="42">
- <testsuite name="SuccessfulTest" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="Succeeds" status="run" result="completed" time="*" timestamp="*" classname="SuccessfulTest"/>
- </testsuite>
- <testsuite name="PropertyRecordingTest" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*" SetUpTestSuite="yes" TearDownTestSuite="aye">
- <testcase name="IntValuedProperty" status="run" result="completed" time="*" timestamp="*" classname="PropertyRecordingTest">
- <properties>
- <property name="key_int" value="1"/>
- </properties>
- </testcase>
- </testsuite>
- <testsuite name="Single/ValueParamTest" tests="1" failures="0" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="HasValueParamAttribute/0" value_param="33" status="run" result="completed" time="*" timestamp="*" classname="Single/ValueParamTest" />
- </testsuite>
-</testsuites>"""
-
-EXPECTED_NO_TEST_XML = """<?xml version="1.0" encoding="UTF-8"?>
-<testsuites tests="0" failures="0" disabled="0" errors="0" time="*"
- timestamp="*" name="AllTests">
- <testsuite name="NonTestSuiteFailure" tests="1" failures="1" disabled="0" skipped="0" errors="0" time="*" timestamp="*">
- <testcase name="" status="run" result="completed" time="*" timestamp="*" classname="">
- <failure message="gtest_no_test_unittest.cc:*&#x0A;Expected equality of these values:&#x0A; 1&#x0A; 2" type=""><![CDATA[gtest_no_test_unittest.cc:*
-Expected equality of these values:
- 1
- 2%(stack)s]]></failure>
- </testcase>
- </testsuite>
-</testsuites>""" % {
- 'stack': STACK_TRACE_TEMPLATE
-}
-
-GTEST_PROGRAM_PATH = gtest_test_utils.GetTestExecutablePath(GTEST_PROGRAM_NAME)
-
-SUPPORTS_TYPED_TESTS = 'TypedTest' in gtest_test_utils.Subprocess(
- [GTEST_PROGRAM_PATH, GTEST_LIST_TESTS_FLAG], capture_stderr=False).output
-
-
-class GTestXMLOutputUnitTest(gtest_xml_test_utils.GTestXMLTestCase):
- """
- Unit test for Google Test's XML output functionality.
- """
-
- # This test currently breaks on platforms that do not support typed and
- # type-parameterized tests, so we don't run it under them.
- if SUPPORTS_TYPED_TESTS:
- def testNonEmptyXmlOutput(self):
- """
- Runs a test program that generates a non-empty XML output, and
- tests that the XML output is expected.
- """
- self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_NON_EMPTY_XML, 1)
-
- def testNoTestXmlOutput(self):
- """Verifies XML output for a Google Test binary without actual tests.
-
- Runs a test program that generates an XML output for a binary without tests,
- and tests that the XML output is expected.
- """
-
- self._TestXmlOutput('gtest_no_test_unittest', EXPECTED_NO_TEST_XML, 0)
-
- def testTimestampValue(self):
- """Checks whether the timestamp attribute in the XML output is valid.
-
- Runs a test program that generates an empty XML output, and checks if
- the timestamp attribute in the testsuites tag is valid.
- """
- actual = self._GetXmlOutput('gtest_no_test_unittest', [], {}, 0)
- date_time_str = actual.documentElement.getAttributeNode('timestamp').value
- # datetime.strptime() is only available in Python 2.5+ so we have to
- # parse the expected datetime manually.
- match = re.match(r'(\d+)-(\d\d)-(\d\d)T(\d\d):(\d\d):(\d\d)', date_time_str)
- self.assertTrue(
- re.match,
- 'XML datettime string %s has incorrect format' % date_time_str)
- date_time_from_xml = datetime.datetime(
- year=int(match.group(1)), month=int(match.group(2)),
- day=int(match.group(3)), hour=int(match.group(4)),
- minute=int(match.group(5)), second=int(match.group(6)))
-
- time_delta = abs(datetime.datetime.now() - date_time_from_xml)
- # timestamp value should be near the current local time
- self.assertTrue(time_delta < datetime.timedelta(seconds=600),
- 'time_delta is %s' % time_delta)
- actual.unlink()
-
- def testDefaultOutputFile(self):
- """
- Confirms that Google Test produces an XML output file with the expected
- default name if no name is explicitly specified.
- """
- output_file = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_DEFAULT_OUTPUT_FILE)
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(
- 'gtest_no_test_unittest')
- try:
- os.remove(output_file)
- except OSError:
- e = sys.exc_info()[1]
- if e.errno != errno.ENOENT:
- raise
-
- p = gtest_test_utils.Subprocess(
- [gtest_prog_path, '%s=xml' % GTEST_OUTPUT_FLAG],
- working_dir=gtest_test_utils.GetTempDir())
- self.assert_(p.exited)
- self.assertEquals(0, p.exit_code)
- self.assert_(os.path.isfile(output_file))
-
- def testSuppressedXmlOutput(self):
- """
- Tests that no XML file is generated if the default XML listener is
- shut down before RUN_ALL_TESTS is invoked.
- """
-
- xml_path = os.path.join(gtest_test_utils.GetTempDir(),
- GTEST_PROGRAM_NAME + 'out.xml')
- if os.path.isfile(xml_path):
- os.remove(xml_path)
-
- command = [GTEST_PROGRAM_PATH,
- '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path),
- '--shut_down_xml']
- p = gtest_test_utils.Subprocess(command)
- if p.terminated_by_signal:
- # p.signal is available only if p.terminated_by_signal is True.
- self.assertFalse(
- p.terminated_by_signal,
- '%s was killed by signal %d' % (GTEST_PROGRAM_NAME, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(1, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, 1))
-
- self.assert_(not os.path.isfile(xml_path))
-
- def testFilteredTestXmlOutput(self):
- """Verifies XML output when a filter is applied.
-
- Runs a test program that executes only some tests and verifies that
- non-selected tests do not show up in the XML output.
- """
-
- self._TestXmlOutput(GTEST_PROGRAM_NAME, EXPECTED_FILTERED_TEST_XML, 0,
- extra_args=['%s=SuccessfulTest.*' % GTEST_FILTER_FLAG])
-
- def testShardedTestXmlOutput(self):
- """Verifies XML output when run using multiple shards.
-
- Runs a test program that executes only one shard and verifies that tests
- from other shards do not show up in the XML output.
- """
-
- self._TestXmlOutput(
- GTEST_PROGRAM_NAME,
- EXPECTED_SHARDED_TEST_XML,
- 0,
- extra_env={SHARD_INDEX_ENV_VAR: '0',
- TOTAL_SHARDS_ENV_VAR: '10'})
-
- def _GetXmlOutput(self, gtest_prog_name, extra_args, extra_env,
- expected_exit_code):
- """
- Returns the xml output generated by running the program gtest_prog_name.
- Furthermore, the program's exit code must be expected_exit_code.
- """
- xml_path = os.path.join(gtest_test_utils.GetTempDir(),
- gtest_prog_name + 'out.xml')
- gtest_prog_path = gtest_test_utils.GetTestExecutablePath(gtest_prog_name)
-
- command = ([gtest_prog_path, '%s=xml:%s' % (GTEST_OUTPUT_FLAG, xml_path)] +
- extra_args)
- environ_copy = os.environ.copy()
- if extra_env:
- environ_copy.update(extra_env)
- p = gtest_test_utils.Subprocess(command, env=environ_copy)
-
- if p.terminated_by_signal:
- self.assert_(False,
- '%s was killed by signal %d' % (gtest_prog_name, p.signal))
- else:
- self.assert_(p.exited)
- self.assertEquals(expected_exit_code, p.exit_code,
- "'%s' exited with code %s, which doesn't match "
- 'the expected exit code %s.'
- % (command, p.exit_code, expected_exit_code))
- actual = minidom.parse(xml_path)
- return actual
-
- def _TestXmlOutput(self, gtest_prog_name, expected_xml,
- expected_exit_code, extra_args=None, extra_env=None):
- """
- Asserts that the XML document generated by running the program
- gtest_prog_name matches expected_xml, a string containing another
- XML document. Furthermore, the program's exit code must be
- expected_exit_code.
- """
-
- actual = self._GetXmlOutput(gtest_prog_name, extra_args or [],
- extra_env or {}, expected_exit_code)
- expected = minidom.parseString(expected_xml)
- self.NormalizeXml(actual.documentElement)
- self.AssertEquivalentNodes(expected.documentElement,
- actual.documentElement)
- expected.unlink()
- actual.unlink()
-
-
-if __name__ == '__main__':
- os.environ['GTEST_STACK_TRACE_DEPTH'] = '1'
- gtest_test_utils.Main()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest_.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest_.cc
deleted file mode 100644
index c0036aaef9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_output_unittest_.cc
+++ /dev/null
@@ -1,193 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-// Unit test for Google Test XML output.
-//
-// A user can specify XML output in a Google Test program to run via
-// either the GTEST_OUTPUT environment variable or the --gtest_output
-// flag. This is used for testing such functionality.
-//
-// This program will be invoked from a Python unit test. Don't run it
-// directly.
-
-#include "gtest/gtest.h"
-
-using ::testing::InitGoogleTest;
-using ::testing::TestEventListeners;
-using ::testing::TestWithParam;
-using ::testing::UnitTest;
-using ::testing::Test;
-using ::testing::Values;
-
-class SuccessfulTest : public Test {
-};
-
-TEST_F(SuccessfulTest, Succeeds) {
- SUCCEED() << "This is a success.";
- ASSERT_EQ(1, 1);
-}
-
-class FailedTest : public Test {
-};
-
-TEST_F(FailedTest, Fails) {
- ASSERT_EQ(1, 2);
-}
-
-class DisabledTest : public Test {
-};
-
-TEST_F(DisabledTest, DISABLED_test_not_run) {
- FAIL() << "Unexpected failure: Disabled test should not be run";
-}
-
-class SkippedTest : public Test {
-};
-
-TEST_F(SkippedTest, Skipped) {
- GTEST_SKIP();
-}
-
-TEST_F(SkippedTest, SkippedWithMessage) {
- GTEST_SKIP() << "It is good practice to tell why you skip a test.";
-}
-
-TEST_F(SkippedTest, SkippedAfterFailure) {
- EXPECT_EQ(1, 2);
- GTEST_SKIP() << "It is good practice to tell why you skip a test.";
-}
-
-TEST(MixedResultTest, Succeeds) {
- EXPECT_EQ(1, 1);
- ASSERT_EQ(1, 1);
-}
-
-TEST(MixedResultTest, Fails) {
- EXPECT_EQ(1, 2);
- ASSERT_EQ(2, 3);
-}
-
-TEST(MixedResultTest, DISABLED_test) {
- FAIL() << "Unexpected failure: Disabled test should not be run";
-}
-
-TEST(XmlQuotingTest, OutputsCData) {
- FAIL() << "XML output: "
- "<?xml encoding=\"utf-8\"><top><![CDATA[cdata text]]></top>";
-}
-
-// Helps to test that invalid characters produced by test code do not make
-// it into the XML file.
-TEST(InvalidCharactersTest, InvalidCharactersInMessage) {
- FAIL() << "Invalid characters in brackets [\x1\x2]";
-}
-
-class PropertyRecordingTest : public Test {
- public:
- static void SetUpTestSuite() { RecordProperty("SetUpTestSuite", "yes"); }
- static void TearDownTestSuite() {
- RecordProperty("TearDownTestSuite", "aye");
- }
-};
-
-TEST_F(PropertyRecordingTest, OneProperty) {
- RecordProperty("key_1", "1");
-}
-
-TEST_F(PropertyRecordingTest, IntValuedProperty) {
- RecordProperty("key_int", 1);
-}
-
-TEST_F(PropertyRecordingTest, ThreeProperties) {
- RecordProperty("key_1", "1");
- RecordProperty("key_2", "2");
- RecordProperty("key_3", "3");
-}
-
-TEST_F(PropertyRecordingTest, TwoValuesForOneKeyUsesLastValue) {
- RecordProperty("key_1", "1");
- RecordProperty("key_1", "2");
-}
-
-TEST(NoFixtureTest, RecordProperty) {
- RecordProperty("key", "1");
-}
-
-void ExternalUtilityThatCallsRecordProperty(const std::string& key, int value) {
- testing::Test::RecordProperty(key, value);
-}
-
-void ExternalUtilityThatCallsRecordProperty(const std::string& key,
- const std::string& value) {
- testing::Test::RecordProperty(key, value);
-}
-
-TEST(NoFixtureTest, ExternalUtilityThatCallsRecordIntValuedProperty) {
- ExternalUtilityThatCallsRecordProperty("key_for_utility_int", 1);
-}
-
-TEST(NoFixtureTest, ExternalUtilityThatCallsRecordStringValuedProperty) {
- ExternalUtilityThatCallsRecordProperty("key_for_utility_string", "1");
-}
-
-// Verifies that the test parameter value is output in the 'value_param'
-// XML attribute for value-parameterized tests.
-class ValueParamTest : public TestWithParam<int> {};
-TEST_P(ValueParamTest, HasValueParamAttribute) {}
-TEST_P(ValueParamTest, AnotherTestThatHasValueParamAttribute) {}
-INSTANTIATE_TEST_SUITE_P(Single, ValueParamTest, Values(33, 42));
-
-// Verifies that the type parameter name is output in the 'type_param'
-// XML attribute for typed tests.
-template <typename T> class TypedTest : public Test {};
-typedef testing::Types<int, long> TypedTestTypes;
-TYPED_TEST_SUITE(TypedTest, TypedTestTypes);
-TYPED_TEST(TypedTest, HasTypeParamAttribute) {}
-
-// Verifies that the type parameter name is output in the 'type_param'
-// XML attribute for type-parameterized tests.
-template <typename T>
-class TypeParameterizedTestSuite : public Test {};
-TYPED_TEST_SUITE_P(TypeParameterizedTestSuite);
-TYPED_TEST_P(TypeParameterizedTestSuite, HasTypeParamAttribute) {}
-REGISTER_TYPED_TEST_SUITE_P(TypeParameterizedTestSuite, HasTypeParamAttribute);
-typedef testing::Types<int, long> TypeParameterizedTestSuiteTypes; // NOLINT
-INSTANTIATE_TYPED_TEST_SUITE_P(Single, TypeParameterizedTestSuite,
- TypeParameterizedTestSuiteTypes);
-
-int main(int argc, char** argv) {
- InitGoogleTest(&argc, argv);
-
- if (argc > 1 && strcmp(argv[1], "--shut_down_xml") == 0) {
- TestEventListeners& listeners = UnitTest::GetInstance()->listeners();
- delete listeners.Release(listeners.default_xml_generator());
- }
- testing::Test::RecordProperty("ad_hoc_property", "42");
- return RUN_ALL_TESTS();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_test_utils.py b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_test_utils.py
deleted file mode 100755
index 50c6e7dca8..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/gtest_xml_test_utils.py
+++ /dev/null
@@ -1,197 +0,0 @@
-# Copyright 2006, Google Inc.
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Unit test utilities for gtest_xml_output"""
-
-import re
-from xml.dom import minidom, Node
-from googletest.test import gtest_test_utils
-
-GTEST_DEFAULT_OUTPUT_FILE = 'test_detail.xml'
-
-class GTestXMLTestCase(gtest_test_utils.TestCase):
- """
- Base class for tests of Google Test's XML output functionality.
- """
-
-
- def AssertEquivalentNodes(self, expected_node, actual_node):
- """
- Asserts that actual_node (a DOM node object) is equivalent to
- expected_node (another DOM node object), in that either both of
- them are CDATA nodes and have the same value, or both are DOM
- elements and actual_node meets all of the following conditions:
-
- * It has the same tag name as expected_node.
- * It has the same set of attributes as expected_node, each with
- the same value as the corresponding attribute of expected_node.
- Exceptions are any attribute named "time", which needs only be
- convertible to a floating-point number and any attribute named
- "type_param" which only has to be non-empty.
- * It has an equivalent set of child nodes (including elements and
- CDATA sections) as expected_node. Note that we ignore the
- order of the children as they are not guaranteed to be in any
- particular order.
- """
-
- if expected_node.nodeType == Node.CDATA_SECTION_NODE:
- self.assertEquals(Node.CDATA_SECTION_NODE, actual_node.nodeType)
- self.assertEquals(expected_node.nodeValue, actual_node.nodeValue)
- return
-
- self.assertEquals(Node.ELEMENT_NODE, actual_node.nodeType)
- self.assertEquals(Node.ELEMENT_NODE, expected_node.nodeType)
- self.assertEquals(expected_node.tagName, actual_node.tagName)
-
- expected_attributes = expected_node.attributes
- actual_attributes = actual_node.attributes
- self.assertEquals(
- expected_attributes.length, actual_attributes.length,
- 'attribute numbers differ in element %s:\nExpected: %r\nActual: %r' % (
- actual_node.tagName, expected_attributes.keys(),
- actual_attributes.keys()))
- for i in range(expected_attributes.length):
- expected_attr = expected_attributes.item(i)
- actual_attr = actual_attributes.get(expected_attr.name)
- self.assert_(
- actual_attr is not None,
- 'expected attribute %s not found in element %s' %
- (expected_attr.name, actual_node.tagName))
- self.assertEquals(
- expected_attr.value, actual_attr.value,
- ' values of attribute %s in element %s differ: %s vs %s' %
- (expected_attr.name, actual_node.tagName,
- expected_attr.value, actual_attr.value))
-
- expected_children = self._GetChildren(expected_node)
- actual_children = self._GetChildren(actual_node)
- self.assertEquals(
- len(expected_children), len(actual_children),
- 'number of child elements differ in element ' + actual_node.tagName)
- for child_id, child in expected_children.items():
- self.assert_(child_id in actual_children,
- '<%s> is not in <%s> (in element %s)' %
- (child_id, actual_children, actual_node.tagName))
- self.AssertEquivalentNodes(child, actual_children[child_id])
-
- identifying_attribute = {
- 'testsuites': 'name',
- 'testsuite': 'name',
- 'testcase': 'name',
- 'failure': 'message',
- 'skipped': 'message',
- 'property': 'name',
- }
-
- def _GetChildren(self, element):
- """
- Fetches all of the child nodes of element, a DOM Element object.
- Returns them as the values of a dictionary keyed by the IDs of the
- children. For <testsuites>, <testsuite>, <testcase>, and <property>
- elements, the ID is the value of their "name" attribute; for <failure>
- elements, it is the value of the "message" attribute; for <properties>
- elements, it is the value of their parent's "name" attribute plus the
- literal string "properties"; CDATA sections and non-whitespace
- text nodes are concatenated into a single CDATA section with ID
- "detail". An exception is raised if any element other than the above
- four is encountered, if two child elements with the same identifying
- attributes are encountered, or if any other type of node is encountered.
- """
-
- children = {}
- for child in element.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- if child.tagName == 'properties':
- self.assert_(child.parentNode is not None,
- 'Encountered <properties> element without a parent')
- child_id = child.parentNode.getAttribute('name') + '-properties'
- else:
- self.assert_(child.tagName in self.identifying_attribute,
- 'Encountered unknown element <%s>' % child.tagName)
- child_id = child.getAttribute(
- self.identifying_attribute[child.tagName])
- self.assert_(child_id not in children)
- children[child_id] = child
- elif child.nodeType in [Node.TEXT_NODE, Node.CDATA_SECTION_NODE]:
- if 'detail' not in children:
- if (child.nodeType == Node.CDATA_SECTION_NODE or
- not child.nodeValue.isspace()):
- children['detail'] = child.ownerDocument.createCDATASection(
- child.nodeValue)
- else:
- children['detail'].nodeValue += child.nodeValue
- else:
- self.fail('Encountered unexpected node type %d' % child.nodeType)
- return children
-
- def NormalizeXml(self, element):
- """
- Normalizes Google Test's XML output to eliminate references to transient
- information that may change from run to run.
-
- * The "time" attribute of <testsuites>, <testsuite> and <testcase>
- elements is replaced with a single asterisk, if it contains
- only digit characters.
- * The "timestamp" attribute of <testsuites> elements is replaced with a
- single asterisk, if it contains a valid ISO8601 datetime value.
- * The "type_param" attribute of <testcase> elements is replaced with a
- single asterisk (if it sn non-empty) as it is the type name returned
- by the compiler and is platform dependent.
- * The line info reported in the first line of the "message"
- attribute and CDATA section of <failure> elements is replaced with the
- file's basename and a single asterisk for the line number.
- * The directory names in file paths are removed.
- * The stack traces are removed.
- """
-
- if element.tagName in ('testsuites', 'testsuite', 'testcase'):
- timestamp = element.getAttributeNode('timestamp')
- timestamp.value = re.sub(r'^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d\d\d$',
- '*', timestamp.value)
- if element.tagName in ('testsuites', 'testsuite', 'testcase'):
- time = element.getAttributeNode('time')
- time.value = re.sub(r'^\d+(\.\d+)?$', '*', time.value)
- type_param = element.getAttributeNode('type_param')
- if type_param and type_param.value:
- type_param.value = '*'
- elif element.tagName == 'failure' or element.tagName == 'skipped':
- source_line_pat = r'^.*[/\\](.*:)\d+\n'
- # Replaces the source line information with a normalized form.
- message = element.getAttributeNode('message')
- message.value = re.sub(source_line_pat, '\\1*\n', message.value)
- for child in element.childNodes:
- if child.nodeType == Node.CDATA_SECTION_NODE:
- # Replaces the source line information with a normalized form.
- cdata = re.sub(source_line_pat, '\\1*\n', child.nodeValue)
- # Removes the actual stack trace.
- child.nodeValue = re.sub(r'Stack trace:\n(.|\n)*',
- 'Stack trace:\n*', cdata)
- for child in element.childNodes:
- if child.nodeType == Node.ELEMENT_NODE:
- self.NormalizeXml(child)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.cc b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.cc
deleted file mode 100644
index 0f69f6dbd2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.cc
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// This is part of the unit test for gtest_prod.h.
-
-#include "production.h"
-
-PrivateCode::PrivateCode() : x_(0) {}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.h b/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.h
deleted file mode 100644
index 41a5472254..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/deps/googletest/test/production.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2006, Google Inc.
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-//
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-//
-// This is part of the unit test for gtest_prod.h.
-
-#ifndef GOOGLETEST_TEST_PRODUCTION_H_
-#define GOOGLETEST_TEST_PRODUCTION_H_
-
-#include "gtest/gtest_prod.h"
-
-class PrivateCode {
- public:
- // Declares a friend test that does not use a fixture.
- FRIEND_TEST(PrivateCodeTest, CanAccessPrivateMembers);
-
- // Declares a friend test that uses a fixture.
- FRIEND_TEST(PrivateCodeFixtureTest, CanAccessPrivateMembers);
-
- PrivateCode();
-
- int x() const { return x_; }
- private:
- void set_x(int an_x) { x_ = an_x; }
- int x_;
-};
-
-#endif // GOOGLETEST_TEST_PRODUCTION_H_
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/optional.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/optional.hpp
deleted file mode 100644
index 90eb15b2ea..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/optional.hpp
+++ /dev/null
@@ -1,703 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// Copyright (C) 2011 - 2012 Andrzej Krzemienski.
-// 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)
-
-/**
- * \file
- * \brief Contains an implementation of C++17 optional (n3793).
- *
- * \sa https://github.com/akrzemi1/Optional
- * \sa http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3848.html
- */
-
-#ifndef NETWORK_OPTIONAL_INC
-#define NETWORK_OPTIONAL_INC
-
-#include <stdexcept>
-#include <type_traits>
-#include <utility>
-#include <memory>
-#include <algorithm>
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-#ifdef NDEBUG
-#define NETWORK_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR)
-#else
-#define NETWORK_ASSERTED_EXPRESSION(CHECK, EXPR) \
- ((CHECK) ? (EXPR) : (fail(#CHECK, __FILE__, __LINE__), (EXPR)))
-inline void fail(const char *, const char *, unsigned) {}
-#endif // NDEBUG
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-namespace network {
-/**
- * \ingroup optional
- * \class nullopt_t optional.hpp network/uri.hpp
- * \brief Disengaged state indicator.
- * \sa optional
- */
-struct nullopt_t {
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- struct init {};
- constexpr nullopt_t(init) {}
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-};
-
-/**
- * \ingroup optional
- * \brief Used to indicate a *disengaged* state for optional objects.
- */
-constexpr nullopt_t nullopt{nullopt_t::init{}};
-
-/**
- * \ingroup optional
- * \class bad_optional_access optional.hpp network/uri.hpp
- * \brief Exception thrown when the value member function is called when the
- * optional object is disengaged.
- */
-class bad_optional_access : public std::logic_error {
- public:
- /**
- * \brief Constructor.
- * \param what_arg The error message.
- */
- explicit bad_optional_access(const std::string &what_arg)
- : std::logic_error(what_arg) {}
-
- /**
- * \brief Constructor.
- * \param what_arg The error message.
- */
- explicit bad_optional_access(const char *what_arg)
- : std::logic_error(what_arg) {}
-};
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-namespace details {
-struct dummy_t {};
-
-template <class T>
-union trivially_destructible_optional_storage {
- static_assert(std::is_trivially_destructible<T>::value, "");
-
- dummy_t dummy_;
- T value_;
-
- constexpr trivially_destructible_optional_storage() : dummy_{} {}
-
- constexpr trivially_destructible_optional_storage(const T &v) : value_{v} {}
-
- ~trivially_destructible_optional_storage() = default;
-};
-
-template <class T>
-union optional_storage {
- dummy_t dummy_;
- T value_;
-
- constexpr optional_storage() : dummy_{} {}
-
- constexpr optional_storage(const T &v) : value_{v} {}
-
- ~optional_storage() {}
-};
-
-template <class T>
-class trivially_destructible_optional_base {
- public:
- typedef T value_type;
-
- constexpr trivially_destructible_optional_base() noexcept
- : init_(false), storage_{} {}
-
- constexpr trivially_destructible_optional_base(const T &v)
- : init_(true), storage_{v} {}
-
- constexpr trivially_destructible_optional_base(T &&v)
- : init_(true), storage_{std::move(v)} {}
-
- ~trivially_destructible_optional_base() = default;
-
- protected:
- bool init_;
- optional_storage<T> storage_;
-};
-
-template <class T>
-class optional_base {
- public:
- typedef T value_type;
-
- constexpr optional_base() noexcept : init_(false), storage_{} {}
-
- constexpr optional_base(const T &v) : init_(true), storage_{v} {}
-
- constexpr optional_base(T &&v) : init_(true), storage_{std::move(v)} {}
-
- ~optional_base() {
- if (init_) {
- storage_.value_.T::~T();
- }
- }
-
- protected:
- bool init_;
- optional_storage<T> storage_;
-};
-} // namespace details
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-/**
- * \ingroup optional
- * \class optional optional.hpp network/uri.hpp
- * \brief An implementation of C++17 optional (n3793)
- */
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-template <class T>
-using optional_base =
- typename std::conditional<std::is_trivially_destructible<T>::value,
- details::trivially_destructible_optional_base<T>,
- details::optional_base<T>>::type;
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-template <class T>
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-class optional : optional_base<T> {
-#else
-class optional {
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
- typedef optional_base<T> base_type;
-
- public:
- /**
- * \brief Optional value type.
- */
- typedef T value_type;
-
- /**
- * \brief Constructor.
- * \post *disengaged*.
- */
- constexpr optional() : optional_base<T>() {}
-
- /**
- * \brief Constructor.
- * \post *disengaged*.
- */
- constexpr optional(nullopt_t) noexcept : optional_base<T>() {}
-
- /**
- * \brief Copy constructor.
- * \param other The other optional object.
- */
- optional(const optional &other) {
- if (other) {
- ::new (static_cast<void *>(ptr())) T(*other);
- base_type::init_ = true;
- }
- }
-
- /**
- * \brief Move constructor.
- * \param other The other optional object.
- */
- optional(optional &&other) noexcept {
- if (other) {
- ::new (static_cast<void *>(ptr())) T(std::move(other.storage_.value_));
- base_type::init_ = true;
- }
- }
-
- /**
- * \brief Constructor.
- * \param value The value with which to initialize the optional object.
- * \post *engaged*
- */
- constexpr optional(const T &value) : optional_base<T>(value) {}
-
- /**
- * \brief Constructor.
- * \param value The value with which to initialize the optional object.
- * \post *engaged*
- */
- constexpr optional(T &&value) : optional_base<T>(std::move(value)) {}
-
- /**
- * \brief Assignment operator.
- * \post *disengaged*.
- * \returns \c *this.
- */
- optional &operator=(nullopt_t) noexcept {
- if (base_type::init_) {
- ptr()->T::~T();
- }
- base_type::init_ = false;
- return *this;
- }
-
- /**
- * \brief Copy assignment operator.
- * \param other The other optional object.
- * \returns \c *this.
- */
- optional &operator=(const optional &other) {
- if (bool(*this) && !other) {
- ptr()->T::~T();
- base_type::init_ = false;
- } else if (!(*this) && bool(other)) {
- ::new (static_cast<void *>(ptr())) T(*other);
- base_type::init_ = true;
- } else if (bool(*this) && bool(other)) {
- base_type::storage_.value_ = *other;
- }
- return *this;
- }
-
- /**
- * \brief Move assignment operator.
- * \param other The other optional object.
- * \returns \c *this.
- */
- optional &operator=(optional &&other) noexcept {
- if (bool(*this) && !other) {
- ptr()->T::~T();
- base_type::init_ = false;
- } else if (!(*this) && bool(other)) {
- ::new (static_cast<void *>(ptr())) T(std::move(*other));
- base_type::init_ = true;
- } else if (bool(*this) && bool(other)) {
- base_type::storage_.value_ = std::move(*other);
- }
- return *this;
- }
-
- /**
- * \brief Destructor.
- */
- ~optional() = default;
-
- /**
- * \brief Swap function.
- * \param other The other optional object.
- */
- void swap(optional &other) noexcept {
- if (bool(*this) && !other) {
- ::new (static_cast<void *>(other.ptr())) T(std::move(**this));
- ptr()->T::~T();
- std::swap(base_type::init_, other.base_type::init_);
- } else if (!(*this) && bool(other)) {
- ::new (static_cast<void *>(ptr())) T(std::move(*other));
- other.ptr()->T::~T();
- std::swap(base_type::init_, other.init_);
- } else if (bool(*this) && bool(other)) {
- std::swap(**this, *other);
- }
- }
-
- /**
- * \brief Observer.
- * \pre *engaged*
- * \returns The underlying optional value.
- */
- constexpr T const *operator->() const {
- return NETWORK_ASSERTED_EXPRESSION(bool(*this), ptr());
- }
-
- /**
- * \brief Observer.
- * \pre *engaged*
- * \returns The underlying optional value.
- */
- T *operator->() { return NETWORK_ASSERTED_EXPRESSION(bool(*this), ptr()); }
-
- /**
- * \brief Observer.
- * \pre *engaged*
- * \returns The underlying optional value.
- */
- constexpr T const &operator*() const {
- return NETWORK_ASSERTED_EXPRESSION(bool(*this), base_type::storage_.value_);
- }
-
- /**
- * \brief Observer.
- * \pre *engaged*
- * \returns The underlying optional value.
- */
- T &operator*() {
- return NETWORK_ASSERTED_EXPRESSION(bool(*this), base_type::storage_.value_);
- }
-
- /**
- * \brief Operator bool overloads.
- * \returns \c true if the optional is *engaged*, \c false if it is
- * *disengaged*.
- */
- constexpr explicit operator bool() const noexcept { return base_type::init_; }
-
- /**
- * \returns The underlying optional value, if \c bool(*this).
- * \throws A bad_optional_access if \c !*this.
- */
- constexpr T const &value() const {
- return *this ? base_type::storage_.value_
- : (throw bad_optional_access("Uninitialized optional value"),
- base_type::storage_.value_);
- }
- /**
- * \returns The underlying optional value, if \c bool(*this).
- * \throws A bad_optional_access if \c !*this.
- */
- T &value() {
- return *this ? base_type::storage_.value_
- : (throw bad_optional_access("Uninitialized optional value"),
- base_type::storage_.value_);
- }
-
- /**
- * \returns <tt>bool(*this) ? **this :
- * static_cast<T>(std::forward<U>(v))</tt>. \pre \c
- * <tt>std::is_copy_constructible<T>::value</tt> is \c true and
- * <tt>std::is_convertible<U&&, T>::value</tt> is \c true.
- */
- template <class U>
- T value_or(U &&other) const & {
- static_assert(std::is_copy_constructible<value_type>::value,
- "Must be copy constructible.");
- static_assert(std::is_convertible<U, value_type>::value,
- "U must be convertible to T.");
- return bool(*this) ? **this : static_cast<T>(std::forward<U>(other));
- }
-
- /**
- * \returns <tt>bool(*this) ? std::move(**this) :
- * static_cast<T>(std::forward<U>(v))</tt>. \pre
- * <tt>std::is_move_constructible<T>::value</tt> is \c true and
- * <tt>std::is_convertible<U&&, T>::value</tt> is \c true.
- */
- template <class U>
- T value_or(U &&other) && {
- static_assert(std::is_copy_constructible<value_type>::value,
- "Must be copy constructible.");
- static_assert(std::is_convertible<U, value_type>::value,
- "U must be convertible to T.");
- return bool(*this) ? std::move(**this)
- : static_cast<T>(std::forward<U>(other));
- }
-
- private:
- T *ptr() { return std::addressof(base_type::storage_.value_); }
-};
-
-/**
- * \brief Equality operator.
- */
-template <class T>
-bool operator==(const optional<T> &lhs, const optional<T> &rhs) {
- if (bool(lhs) != bool(rhs)) {
- return false;
- } else if (!bool(lhs)) {
- return true;
- } else {
- return *lhs == *rhs;
- }
-}
-
-/**
- * \brief Inequality operator.
- */
-template <class T>
-bool operator!=(const optional<T> &lhs, const optional<T> &rhs) {
- return !(lhs == rhs);
-}
-
-/**
- * \brief Comparison operator.
- */
-template <class T>
-bool operator<(const optional<T> &lhs, const optional<T> &rhs) {
- if (!rhs) {
- return false;
- } else if (!lhs) {
- return true;
- } else {
- return *lhs < *rhs;
- }
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>rhs < lhs</tt>.
- */
-template <class T>
-bool operator>(const optional<T> &lhs, const optional<T> &rhs) {
- return rhs < lhs;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(rhs < lhs)</tt>.
- */
-template <class T>
-bool operator<=(const optional<T> &lhs, const optional<T> &rhs) {
- return !(rhs < lhs);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(rhs > lhs)</tt>.
- */
-template <class T>
-bool operator>=(const optional<T> &lhs, const optional<T> &rhs) {
- return !(lhs < rhs);
-}
-
-/**
- * \brief Equality operator.
- * \returns \c !x.
- */
-template <class T>
-bool operator==(const optional<T> &x, nullopt_t) noexcept {
- return !x;
-}
-
-/**
- * \brief Equality operator.
- * \returns \c !x.
- */
-template <class T>
-bool operator==(nullopt_t, const optional<T> &x) noexcept {
- return !x;
-}
-
-/**
- * \brief Inequality operator.
- * \returns \c bool(x).
- */
-template <class T>
-bool operator!=(const optional<T> &x, nullopt_t) noexcept {
- return bool(x);
-}
-
-/**
- * \brief Inequality operator.
- * \returns \c bool(x).
- */
-template <class T>
-bool operator!=(nullopt_t, const optional<T> &x) noexcept {
- return bool(x);
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c false.
- */
-template <class T>
-bool operator<(const optional<T> &x, nullopt_t) noexcept {
- return false;
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c bool(x).
- */
-template <class T>
-bool operator<(nullopt_t, const optional<T> &x) noexcept {
- return bool(x);
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c !x.
- */
-template <class T>
-bool operator<=(const optional<T> &x, nullopt_t) noexcept {
- return !x;
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c true.
- */
-template <class T>
-bool operator<=(nullopt_t, const optional<T> &x) noexcept {
- return true;
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c bool(x).
- */
-template <class T>
-bool operator>(const optional<T> &x, nullopt_t) noexcept {
- return bool(x);
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c false.
- */
-template <class T>
-bool operator>(nullopt_t, const optional<T> &x) noexcept {
- return false;
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c true.
- */
-template <class T>
-bool operator>=(const optional<T> &x, nullopt_t) noexcept {
- return true;
-}
-
-/**
- * \brief Comparison operator.
- * \returns \c !x.
- */
-template <class T>
-bool operator>=(nullopt_t, const optional<T> &x) noexcept {
- return !x;
-}
-
-/**
- * \brief Equality operator.
- * \returns <tt>bool(x) ? *x == v : false</tt>.
- */
-template <class T>
-bool operator==(const optional<T> &x, const T &v) {
- return bool(x) ? *x == v : false;
-}
-
-/**
- * \brief Equality operator.
- * \returns <tt>bool(x) ? v == *x : false</tt>.
- */
-template <class T>
-bool operator==(const T &v, const optional<T> &x) {
- return bool(x) ? v == *x : false;
-}
-
-/**
- * \brief Inequality operator.
- * \returns <tt>bool(x) ? !(*x == v) : true</tt>.
- */
-template <class T>
-bool operator!=(const optional<T> &x, const T &v) {
- return bool(x) ? !(*x == v) : true;
-}
-
-/**
- * \brief Inequality operator.
- * \returns <tt>bool(x) ? !(v == *x) : true</tt>.
- */
-template <class T>
-bool operator!=(const T &v, const optional<T> &x) {
- return bool(x) ? !(v == *x) : true;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>bool(x) ? *x < v : true</tt>.
- */
-template <class T>
-bool operator<(const optional<T> &x, const T &v) {
- return bool(x) ? *x < v : true;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>bool(x) ? v < *x : false</tt>.
- */
-template <class T>
-bool operator<(const T &v, const optional<T> &x) {
- return bool(x) ? v < *x : false;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>bool(x) ? *x < v : true</tt>.
- */
-template <class T>
-bool operator>(const optional<T> &x, const T &v) {
- return bool(x) ? *x < v : true;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>bool(x) ? v < *x : false</tt>.
- */
-template <class T>
-bool operator>(const T &v, const optional<T> &x) {
- return bool(x) ? v < *x : false;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(x < v)</tt>.
- */
-template <class T>
-bool operator>=(const optional<T> &x, const T &v) {
- return !(x < v);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(v < x)</tt>.
- */
-template <class T>
-bool operator>=(const T &v, const optional<T> &x) {
- return !(v < x);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(x > v)</tt>.
- */
-template <class T>
-bool operator<=(const optional<T> &x, const T &v) {
- return !(x > v);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(v > x)</tt>.
- */
-template <class T>
-bool operator<=(const T &v, const optional<T> &x) {
- return !(v > x);
-}
-
-/**
- * \ingroup optional
- * \brief Swap function.
- * \param lhs The first optional object.
- * \param rhs The second optional object.
- *
- * Calls:
- * \code{.cpp}
- * lhs.swap(rhs);
- * \endcode
- */
-template <class T>
-inline void swap(optional<T> &lhs,
- optional<T> &rhs) noexcept(noexcept(lhs.swap(rhs))) {
- return lhs.swap(rhs);
-}
-
-/**
- * \ingroup optional
- * \brief A helper function to contruct an optional object.
- * \returns <tt>optional<typename
- * std::decay<T>::type>(std::forward(value))</tt>.
- */
-template <class T>
-inline constexpr optional<typename std::decay<T>::type> make_optional(
- T &&value) {
- return optional<typename std::decay<T>::type>(std::forward(value));
-}
-} // namespace network
-
-#endif // NETWORK_OPTIONAL_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/string_view.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/string_view.hpp
deleted file mode 100644
index 8ff7a5efa5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/string_view.hpp
+++ /dev/null
@@ -1,272 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_STRING_VIEW_INC
-#define NETWORK_STRING_VIEW_INC
-
-/**
- * \file
- * \brief Contains an implementation of C++17 string_view (n3921).
- */
-
-#include <string>
-#include <iterator>
-#include <cassert>
-#include <stdexcept>
-#include <algorithm>
-
-namespace network {
-/**
- * \class basic_string_view string_view.hpp network/uri/string_view.hpp
- * \brief An implementation of C++17 string_view (n3921)
- */
-template <class charT, class traits = std::char_traits<charT>>
-class basic_string_view {
- public:
- typedef traits traits_type;
- typedef charT value_type;
- typedef charT *pointer;
- typedef const charT *const_pointer;
- typedef charT &reference;
- typedef const charT &const_reference;
- typedef const charT *const_iterator;
- typedef const_iterator iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef const_reverse_iterator reverse_iterator;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
- static constexpr size_type npos = size_type(-1);
-
- /**
- * \brief Constructor.
- */
- constexpr basic_string_view() noexcept : data_(nullptr), size_(0) {}
-
- /**
- * \brief Copy constructor.
- */
- constexpr basic_string_view(const basic_string_view &) noexcept = default;
-
- /**
- * \brief Assignment operator.
- */
- basic_string_view &operator=(const basic_string_view &) noexcept = default;
-
- /**
- * \brief Constructor.
- */
- template <class Allocator>
- basic_string_view(
- const std::basic_string<charT, traits, Allocator> &str) noexcept
- : data_(str.data()), size_(str.size()) {}
-
- /**
- * \brief Constructor.
- */
- constexpr basic_string_view(const charT *str)
- : data_(str), size_(traits::length(str)) {}
-
- /**
- * \brief Constructor.
- */
- constexpr basic_string_view(const charT *str, size_type len)
- : data_(str), size_(len) {}
-
- constexpr const_iterator begin() const noexcept { return data_; }
-
- constexpr const_iterator end() const noexcept { return data_ + size_; }
-
- constexpr const_iterator cbegin() const noexcept { return begin(); }
-
- constexpr const_iterator cend() const noexcept { return end(); }
-
- const_reverse_iterator rbegin() const noexcept {
- return const_reverse_iterator(end());
- }
- const_reverse_iterator rend() const noexcept {
- return const_reverse_iterator(begin());
- }
- const_reverse_iterator crbegin() const noexcept { return rbegin(); }
-
- const_reverse_iterator crend() const noexcept { return rend(); }
-
- constexpr size_type size() const noexcept { return size_; }
-
- constexpr size_type length() const noexcept { return size_; }
-
- constexpr size_type max_size() const noexcept { return size_; }
-
- constexpr bool empty() const noexcept { return size_ == 0; }
-
- constexpr const_reference operator[](size_type pos) const {
- return data_[pos];
- }
-
- const_reference at(size_type pos) const {
- if (pos >= size_) {
- throw std::out_of_range("Index out of range.");
- }
- return data_[pos];
- }
-
- const_reference front() const { return *begin(); }
-
- const_reference back() const {
- auto last = (end()) - 1;
- return *last;
- }
-
- constexpr const_pointer data() const noexcept { return data_; }
-
- void clear() noexcept {
- data_ = nullptr;
- size_ = 0;
- }
-
- void remove_prefix(size_type n) {
- data_ += n;
- size_ -= n;
- }
-
- void remove_suffix(size_type n) { size_ -= n; }
-
- void swap(basic_string_view &s) noexcept {
- std::swap(data_, s.data_);
- std::swap(size_, s.size_);
- }
-
- template <class Allocator>
- explicit operator std::basic_string<charT, traits, Allocator>() const {
- return to_string<charT, traits, Allocator>();
- }
-
- template <class Allocator = std::allocator<charT>>
- std::basic_string<charT, traits, Allocator> to_string(
- const Allocator &a = Allocator()) const {
- return std::basic_string<charT, traits, Allocator>(begin(), end(), a);
- }
-
- size_type copy(charT *s, size_type n, size_type pos = 0) const {
- size_type rlen = std::min(n, size() - pos);
- std::copy_n(begin() + pos, rlen, s);
- return rlen;
- }
-
- constexpr basic_string_view substr(size_type pos = 0,
- size_type n = npos) const {
- return basic_string_view(data() + pos, std::min(n, size() - pos));
- }
-
- constexpr int compare(basic_string_view s) const noexcept {
- return size() == s.size()
- ? traits::compare(data(), s.data(), size())
- : (size() < s.size()
- ? (traits::compare(data(), s.data(), size()) > 0 ? 1 : -1)
- : (traits::compare(data(), s.data(), size()) < 0 ? -1
- : 1));
- }
-
- constexpr int compare(size_type pos1, size_type n1,
- basic_string_view s) const {
- return substr(pos1, n1).compare(s);
- }
-
- constexpr int compare(size_type pos1, size_type n1, basic_string_view s,
- size_type pos2, size_type n2) const {
- return substr(pos1, n1).compare(s.substr(pos2, n2));
- }
-
- constexpr int compare(const charT *s) const {
- return compare(basic_string_view(s));
- }
-
- constexpr int compare(size_type pos1, size_type n1, const charT *s) const {
- return substr(pos1, n1).compare(basic_string_view(s));
- }
-
- constexpr int compare(size_type pos1, size_type n1, const charT *s,
- size_type n2) const {
- return substr(pos1, n1).compare(basic_string_view(s, n2));
- }
-
- private:
- const_pointer data_;
- size_type size_;
-};
-
-/**
- * \brief Equality operator.
- * \returns <tt>lhs.compare(rhs) == 0</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator==(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return lhs.compare(rhs) == 0;
-}
-
-/**
- * \brief Inequality operator.
- * \returns <tt>!(lhs == rhs)</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator!=(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return !(lhs == rhs);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>lhs.compare(rhs) < 0</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator<(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return lhs.compare(rhs) < 0;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>rhs < lhs</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator>(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return rhs < lhs;
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(lhs > rhs)</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator<=(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return !(lhs > rhs);
-}
-
-/**
- * \brief Comparison operator.
- * \returns <tt>!(lhs < rhs)</tt>.
- */
-template <class charT, class traits>
-constexpr bool operator>=(basic_string_view<charT, traits> lhs,
- basic_string_view<charT, traits> rhs) noexcept {
- return !(lhs < rhs);
-}
-
-/**
- * \brief Output stream operator.
- */
-template <class charT, class traits>
-std::basic_ostream<charT, traits> &operator<<(
- std::basic_ostream<charT, traits> &os,
- basic_string_view<charT, traits> str) {
- return os << str.to_string();
-}
-
-typedef basic_string_view<char> string_view;
-} // namespace network
-
-#endif // NETWORK_STRING_VIEW_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri.hpp
deleted file mode 100644
index 602c009e89..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-#ifndef NETWORK_URI_HPP
-#define NETWORK_URI_HPP
-
-/**
- * \defgroup uri URI
- *
- * This module contains a class encapsulating a URI, a URI builder and
- * percent encoding and decoding functions.
- *
- * \defgroup optional Optional
- *
- * This module contains a utility to represent optional values.
- *
- * \defgroup string String
- *
- * This module contains a class for a non-owning reference to a string.
- *
- * \namespace network
- *
- * The \c network namespace contains all the classes and functions for
- * the URI in this library.
- *
- * \file
- * \brief Contains the uri, uri_builder classes and functions
- * for percent encoding and decoding.
- */
-
-#include <network/uri/uri.hpp>
-#include <network/uri/uri_io.hpp>
-
-#endif // NETWORK_URI_HPP
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/config.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/config.hpp
deleted file mode 100644
index aa03cd2e00..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/config.hpp
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-/**
- * \file
- * \brief Contains macros to configure compiler or platform-specific
- * workarounds.
- */
-
-#ifndef NETWORK_URI_CONFIG_INC
-#define NETWORK_URI_CONFIG_INC
-
-#ifdef _MSC_VER
-#define NETWORK_URI_MSVC _MSC_VER
-#endif // _MSC_VER
-
-#endif // NETWORK_URI_CONFIG_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
deleted file mode 100644
index 9d0aaaa1b5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright (c) Glyn Matthews 2011-2016.
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-#ifndef NETWORK_URI_DECODE_INC
-#define NETWORK_URI_DECODE_INC
-
-#include <network/uri/uri_errors.hpp>
-#include <iterator>
-#include <cassert>
-
-namespace network {
-namespace detail {
-template <typename CharT>
-CharT letter_to_hex(CharT in) {
- if ((in >= '0') && (in <= '9')) {
- return in - '0';
- }
-
- if ((in >= 'a') && (in <= 'f')) {
- return in + 10 - 'a';
- }
-
- if ((in >= 'A') && (in <= 'F')) {
- return in + 10 - 'A';
- }
-
- throw percent_decoding_error(uri_error::non_hex_input);
-}
-
-template <class InputIterator, class charT>
-InputIterator decode_char(InputIterator it, charT *out) {
- assert(*it == '%');
- ++it;
- auto h0 = *it;
- auto v0 = detail::letter_to_hex(h0);
- ++it;
- auto h1 = *it;
- auto v1 = detail::letter_to_hex(h1);
- ++it;
- *out = static_cast<charT>((0x10 * v0) + v1);
- return it;
-}
-
-template <class InputIterator, class OutputIterator>
-OutputIterator decode(InputIterator in_begin, InputIterator in_end,
- OutputIterator out_begin) {
- auto it = in_begin;
- auto out = out_begin;
- while (it != in_end) {
- if (*it == '%') {
- if (std::distance(it, in_end) < 3) {
- throw percent_decoding_error(uri_error::not_enough_input);
- }
- char c = '\0';
- it = decode_char(it, &c);
- *out = c;
- ++out;
- } else {
- *out++ = *it++;
- }
- }
- return out;
-}
-
-template <class String>
-String decode(const String &source) {
- String unencoded;
- decode(std::begin(source), std::end(source), std::back_inserter(unencoded));
- return unencoded;
-}
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_URI_DECODE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
deleted file mode 100644
index 3484ec1336..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
+++ /dev/null
@@ -1,171 +0,0 @@
-// Copyright (c) Glyn Matthews 2011-2016.
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-#ifndef NETWORK_URI_ENCODE_INC
-#define NETWORK_URI_ENCODE_INC
-
-#include <network/uri/uri_errors.hpp>
-#include <iterator>
-#include <cstring>
-#include <cassert>
-#include <algorithm>
-
-namespace network {
-namespace detail {
-template <typename CharT>
-inline CharT hex_to_letter(CharT in) {
- if ((in >= 0) && (in < 10)) {
- return in + '0';
- }
-
- if ((in >= 10) && (in < 16)) {
- return in - 10 + 'A';
- }
-
- return in;
-}
-
-template <class charT, class OutputIterator>
-void percent_encode(charT in, OutputIterator &out) {
- out++ = '%';
- out++ = hex_to_letter((in >> 4) & 0x0f);
- out++ = hex_to_letter(in & 0x0f);
-}
-
-template <class charT>
-bool is_unreserved(charT in) {
- // clang-format off
- return ((in >= 'a') && (in <= 'z')) ||
- ((in >= 'A') && (in <= 'Z')) ||
- ((in >= '0') && (in <= '9')) ||
- (in == '-') ||
- (in == '.') ||
- (in == '_') ||
- (in == '~');
- // clang-format on
-}
-
-template <class charT, class OutputIterator>
-void encode_char(charT in, OutputIterator &out, const char *ignore = "") {
- if (is_unreserved(in)) {
- out++ = in;
- } else {
- auto first = ignore, last = ignore + std::strlen(ignore);
- if (std::find(first, last, in) != last) {
- out++ = in;
- } else {
- percent_encode(in, out);
- }
- }
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_user_info(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out, ":");
- ++it;
- }
- return out;
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_host(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out, "[:]");
- ++it;
- }
- return out;
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_port(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out);
- ++it;
- }
- return out;
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_path(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out, "/.@%;=");
- ++it;
- }
- return out;
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_query_component(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out, "/?");
- ++it;
- }
- return out;
-}
-
-template <typename InputIterator, typename OutputIterator>
-OutputIterator encode_fragment(InputIterator first, InputIterator last,
- OutputIterator out) {
- auto it = first;
- while (it != last) {
- detail::encode_char(*it, out, "/.@&l;=%");
- ++it;
- }
- return out;
-}
-
-template <class String>
-String encode_user_info(const String &user_info) {
- String encoded;
- encode_user_info(std::begin(user_info), std::end(user_info),
- std::back_inserter(encoded));
- return encoded;
-}
-
-template <class String>
-String encode_host(const String &host) {
- String encoded;
- encode_host(std::begin(host), std::end(host), std::back_inserter(encoded));
- return encoded;
-}
-
-template <class String>
-String encode_port(const String &port) {
- String encoded;
- encode_port(std::begin(port), std::end(port), std::back_inserter(encoded));
- return encoded;
-}
-
-template <class String>
-String encode_path(const String &path) {
- String encoded;
- encode_path(std::begin(path), std::end(path), std::back_inserter(encoded));
- return encoded;
-}
-
-template <class String>
-String encode_fragment(const String &fragment) {
- String encoded;
- encode_fragment(std::begin(fragment), std::end(fragment),
- std::back_inserter(encoded));
- return encoded;
-}
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_URI_ENCODE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
deleted file mode 100644
index 7566c258e1..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// 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)
-
-#ifndef NETWORK_URI_DETAIL_TRANSLATE_INC
-#define NETWORK_URI_DETAIL_TRANSLATE_INC
-
-#include <string>
-
-namespace network {
-namespace detail {
-template <typename Source>
-struct translate_impl;
-
-template <>
-struct translate_impl<std::string> {
- std::string operator()(const std::string &source) const { return source; }
-};
-
-template <int N>
-struct translate_impl<char[N]> {
- std::string operator()(const char *source) const { return source; }
-};
-
-template <>
-struct translate_impl<char *> {
- std::string operator()(const char *source) const { return source; }
-};
-
-template <>
-struct translate_impl<const char *> {
- std::string operator()(const char *source) const { return source; }
-};
-
-template <int N>
-struct translate_impl<const char[N]> {
- std::string operator()(const char *source) const { return source; }
-};
-
-template <>
-struct translate_impl<std::wstring> {
- std::string operator()(const std::wstring &source) const {
- return std::string(std::begin(source), std::end(source));
- }
-};
-
-template <int N>
-struct translate_impl<const wchar_t[N]> {
- std::string operator()(const wchar_t *source) const {
- translate_impl<std::wstring> impl;
- return impl(source);
- }
-};
-
-template <int N>
-struct translate_impl<wchar_t[N]> {
- std::string operator()(const wchar_t *source) const {
- translate_impl<std::wstring> impl;
- return impl(source);
- }
-};
-
-template <>
-struct translate_impl<wchar_t *> {
- std::string operator()(const wchar_t *source) const {
- translate_impl<std::wstring> impl;
- return impl(source);
- }
-};
-
-template <>
-struct translate_impl<const wchar_t *> {
- std::string operator()(const wchar_t *source) const {
- translate_impl<std::wstring> impl;
- return impl(source);
- }
-};
-
-template <typename Source>
-inline std::string translate(const Source &source) {
- translate_impl<Source> impl;
- return impl(source);
-}
-
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_URI_DETAIL_TRANSLATE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
deleted file mode 100644
index f158927b57..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_PARTS_INC
-#define NETWORK_DETAIL_URI_PARTS_INC
-
-#include <string>
-#include <utility>
-#include <iterator>
-#include <network/optional.hpp>
-#include <network/string_view.hpp>
-
-namespace network {
-namespace detail {
-class uri_part {
- public:
- typedef string_view::value_type value_type;
- typedef string_view::iterator iterator;
- typedef string_view::const_iterator const_iterator;
- typedef string_view::const_pointer const_pointer;
- typedef string_view::size_type size_type;
- typedef string_view::difference_type difference_type;
-
- uri_part() noexcept = default;
-
- uri_part(const_iterator first, const_iterator last) noexcept
- : first(first), last(last) {}
-
- const_iterator begin() const noexcept { return first; }
-
- const_iterator end() const noexcept { return last; }
-
- bool empty() const noexcept { return first == last; }
-
- std::string to_string() const { return std::string(first, last); }
-
- const_pointer ptr() const noexcept {
- assert(first != last);
- return first;
- }
-
- difference_type length() const noexcept { return last - first; }
-
- string_view to_string_view() const noexcept {
- return string_view(ptr(), length());
- }
-
- private:
- const_iterator first, last;
-};
-
-struct hierarchical_part {
- hierarchical_part() = default;
-
- optional<uri_part> user_info;
- optional<uri_part> host;
- optional<uri_part> port;
- optional<uri_part> path;
-
- void clear() {
- user_info = nullopt;
- host = nullopt;
- port = nullopt;
- path = nullopt;
- }
-};
-
-struct uri_parts {
- uri_parts() = default;
-
- optional<uri_part> scheme;
- hierarchical_part hier_part;
- optional<uri_part> query;
- optional<uri_part> fragment;
-
- void clear() {
- scheme = nullopt;
- hier_part.clear();
- query = nullopt;
- fragment = nullopt;
- }
-};
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_PARTS_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri.hpp
deleted file mode 100644
index 8a7de5b437..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri.hpp
+++ /dev/null
@@ -1,757 +0,0 @@
-// Copyright 2009-2010 Jeroen Habraken.
-// Copyright 2009-2017 Dean Michael Berris, Glyn Matthews.
-// Copyright 2012 Google, Inc.
-// 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)
-
-#ifndef NETWORK_URI_INC
-#define NETWORK_URI_INC
-
-/**
- * \file
- * \brief Contains the uri class.
- */
-
-#include <iterator>
-#include <algorithm>
-#include <functional>
-#include <memory>
-#include <string>
-#include <network/string_view.hpp>
-#include <network/optional.hpp>
-#include <network/uri/config.hpp>
-#include <network/uri/uri_errors.hpp>
-#include <network/uri/detail/uri_parts.hpp>
-#include <network/uri/detail/encode.hpp>
-#include <network/uri/detail/decode.hpp>
-#include <network/uri/detail/translate.hpp>
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
-#endif
-
-namespace network {
-/**
- * \enum uri_comparison_level
- * \brief Defines the steps on the URI comparison ladder.
- */
-enum class uri_comparison_level {
- string_comparison,
- syntax_based,
- scheme_based,
-};
-
-/**
- * \ingroup uri
- * \class uri_builder network/uri/uri_builder.hpp network/uri.hpp
- * \brief A class that allows complex uri objects to be constructed.
- * \sa uri
- */
-class uri_builder;
-
-/**
- * \ingroup uri
- * \class uri network/uri/uri.hpp network/uri.hpp
- * \brief A class that parses a URI (Uniform Resource Identifier)
- * into its component parts.
- *
- * This class conforms to a URI as defined by RFC 3986, RFC 3987 and
- * RFC 2732, including scoped IDs. It provides member functions for
- * normalizing, comparing and resolving URIs.
- *
- * A URI has the syntax:
- *
- * \code
- * [scheme:][user_info@][host][:port][path][?query][#fragment]
- * \endcode
- *
- * Example:
- *
- * \code
- * network::uri instance("http://cpp-netlib.org/");
- * assert(instance.is_absolute());
- * assert(!instance.is_opaque());
- * assert(instance.scheme());
- * assert("http" == *instance.scheme());
- * assert(instance.host());
- * assert("cpp-netlib.org" == *instance.host());
- * assert(instance.path());
- * assert("/" == *instance.path());
- * \endcode
- */
-class uri {
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- friend class uri_builder;
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
- public:
- /**
- * \brief The URI string_type.
- */
- typedef std::string string_type;
-
- /**
- * \brief A reference to the underlying string_type parts.
- */
- typedef network::string_view string_view;
-
- /**
- * \brief The char traits.
- */
- typedef string_view::traits_type traits_type;
-
- /**
- * \brief The URI const_iterator type.
- */
- typedef string_view::const_iterator const_iterator;
-
- /**
- * \brief The URI iterator type.
- */
- typedef const_iterator iterator;
-
- /**
- * \brief The URI value_type.
- */
- typedef std::iterator_traits<iterator>::value_type value_type;
-
- /**
- *
- */
- class query_iterator {
- public:
- using value_type = std::pair<string_view, string_view>;
- using difference_type = std::ptrdiff_t;
- using pointer = const value_type *;
- using reference = const value_type &;
- using iterator_category = std::forward_iterator_tag;
-
- query_iterator();
- explicit query_iterator(optional<detail::uri_part>);
- query_iterator(const query_iterator &);
- query_iterator &operator=(const query_iterator &);
- reference operator++() noexcept;
- value_type operator++(int) noexcept;
- reference operator*() const noexcept;
- pointer operator->() const noexcept;
- bool operator==(const query_iterator &) const noexcept;
- inline bool operator!=(const query_iterator &other) const noexcept {
- return !(*this == other);
- }
-
- private:
- void swap(query_iterator &) noexcept;
- void advance_to_next_kvp() noexcept;
- void assign_kvp() noexcept;
- void increment() noexcept;
-
- optional<detail::uri_part> query_;
- value_type kvp_;
- };
-
- /**
- * \brief Default constructor.
- */
- uri();
-
- /**
- * \brief Constructor.
- * \param first The first element in a string sequence.
- * \param last The end + 1th element in a string sequence.
- * \throws uri_syntax_error if the sequence is not a valid URI.
- * \throws std::bad_alloc If the underlying string cannot be allocated.
- */
- template <class InputIter>
- uri(InputIter first, InputIter last) {
- if (!initialize(string_type(first, last))) {
- throw uri_syntax_error();
- }
- }
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- template <class InputIter>
- explicit uri(InputIter first, InputIter last, std::error_code &ec) {
- if (!initialize(string_type(first, last))) {
- ec = make_error_code(uri_error::invalid_syntax);
- }
- }
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
- /**
- * \brief Constructor.
- * \param source A source string that is to be parsed as a URI.
- * \throws uri_syntax_error if the source is not a valid URI.
- * \throws std::bad_alloc If the underlying string cannot be allocated.
- */
- template <class Source>
- explicit uri(const Source &source) {
- if (!initialize(detail::translate(source))) {
- throw uri_syntax_error();
- }
- }
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- template <class Source>
- explicit uri(const Source &source, std::error_code &ec) {
- if (!initialize(detail::translate(source))) {
- ec = make_error_code(uri_error::invalid_syntax);
- }
- }
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- explicit uri(const uri_builder &builder);
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
- /**
- * \brief Copy constructor.
- * \throws std::bad_alloc If the underlying string cannot be allocated.
- */
- uri(const uri &other);
-
- /**
- * \brief Move constructor.
- */
- uri(uri &&other) noexcept;
-
- /**
- * \brief Destructor.
- */
- ~uri();
-
- /**
- * \brief Assignment operator.
- * \throws std::bad_alloc If the underlying string cannot be allocated.
- */
- uri &operator=(uri other);
-
- /**
- * \brief Swaps one uri object with another.
- * \param other The other uri object.
- */
- void swap(uri &other) noexcept;
-
- /**
- * \brief Returns an iterator at the first element in the
- * underlying sequence.
- * \return An iterator starting at the first element.
- */
- const_iterator begin() const noexcept;
-
- /**
- * \brief Returns an iterator at the end + 1th element in the
- * underlying sequence.
- * \return An iterator starting at the end + 1th element.
- */
- const_iterator end() const noexcept;
-
- /**
- * \brief Tests whether this URI has a scheme component.
- * \return \c true if the URI has a scheme, \c false otherwise.
- */
- bool has_scheme() const noexcept;
-
- /**
- * \brief Returns the URI scheme.
- * \return The scheme.
- * \pre has_scheme()
- */
- string_view scheme() const noexcept;
-
- /**
- * \brief Tests whether this URI has a user info component.
- * \return \c true if the URI has a user info, \c false otherwise.
- */
- bool has_user_info() const noexcept;
-
- /**
- * \brief Returns the URI user info.
- * \return The user info.
- * \pre has_user_info()
- */
- string_view user_info() const noexcept;
-
- /**
- * \brief Tests whether this URI has a host component.
- * \return \c true if the URI has a host, \c false otherwise.
- */
- bool has_host() const noexcept;
-
- /**
- * \brief Returns the URI host.
- * \return The host.
- * \pre has_host()
- */
- string_view host() const noexcept;
-
- /**
- * \brief Tests whether this URI has a port component.
- * \return \c true if the URI has a port, \c false otherwise.
- */
- bool has_port() const noexcept;
-
- /**
- * \brief Returns the URI port.
- * \return The port.
- * \pre has_port()
- */
- string_view port() const noexcept;
-
- /**
- * \brief Returns the URI port as an integer.
- * \return The port number.
- * \pre has_port()
- */
- template <typename intT>
- intT port(typename std::is_integral<intT>::type * = 0) const {
- assert(has_port());
- auto p = port();
- const char *port_first = std::addressof(*p.begin());
- char *port_last = 0;
- return static_cast<intT>(std::strtoul(port_first, &port_last, 10));
- }
-
- /**
- * \brief Tests whether this URI has a path component.
- * \return \c true if the URI has a path, \c false otherwise.
- */
- bool has_path() const noexcept;
-
- /**
- * \brief Returns the URI path.
- * \return The path.
- * \pre has_path()
- */
- string_view path() const noexcept;
-
- /**
- * \brief Tests whether this URI has a query component.
- * \return \c true if the URI has a query, \c false otherwise.
- */
- bool has_query() const noexcept;
-
- /**
- * \brief Returns the URI query.
- * \return The query.
- * \pre has_query()
- */
- string_view query() const noexcept;
-
- /**
- * \brief Returns an iterator to the first key-value pair in the query
- * component.
- *
- * \return query_iterator.
- */
- query_iterator query_begin() const noexcept;
-
- /**
- * \brief Returns an iterator to the last key-value pair in the query
- * component.
- *
- * \return query_iterator.
- */
- query_iterator query_end() const noexcept;
-
- /**
- * \brief Tests whether this URI has a fragment component.
- * \return \c true if the URI has a fragment, \c false otherwise.
- */
- bool has_fragment() const noexcept;
-
- /**
- * \brief Returns the URI fragment.
- * \return The fragment.
- * \pre has_fragment()
- */
- string_view fragment() const noexcept;
-
- /**
- * \brief Tests whether this URI has a valid authority.
- * \return \c true if the URI has an authority, \c false otherwise.
- */
- bool has_authority() const noexcept;
-
- /**
- * \brief Returns the URI authority.
- * \return The authority.
- */
- string_view authority() const noexcept;
-
- /**
- * \brief Returns the URI as a std::basic_string object.
- * \return A URI string.
- */
- template <class charT, class traits = std::char_traits<charT>,
- class Allocator = std::allocator<charT> >
- std::basic_string<charT, traits, Allocator> to_string(
- const Allocator &alloc = Allocator()) const {
- return std::basic_string<charT, traits, Allocator>(begin(), end());
- }
-
- /**
- * \brief Returns the URI as a std::string object.
- * \returns A URI string.
- */
- std::string string() const;
-
- /**
- * \brief Returns the URI as a std::wstring object.
- * \returns A URI string.
- */
- std::wstring wstring() const;
-
- /**
- * \brief Returns the URI as a std::u16string object.
- * \returns A URI string.
- */
- std::u16string u16string() const;
-
- /**
- * \brief Returns the URI as a std::u32string object.
- * \returns A URI string.
- */
- std::u32string u32string() const;
-
- /**
- * \brief Returns the URI as a string_view object.
- * \returns A URI string view.
- */
- string_view view() const noexcept;
-
- /**
- * \brief Checks if the uri object is empty, i.e. it has no parts.
- * \returns \c true if there are no parts, \c false otherwise.
- */
- bool empty() const noexcept;
-
- /**
- * \brief Checks if the uri is absolute, i.e. it has a scheme.
- * \returns \c true if it is absolute, \c false if it is relative.
- */
- bool is_absolute() const noexcept;
-
- /**
- * \brief Checks if the uri is opaque, i.e. if it doesn't have an
- * authority.
- * \returns \c true if it is opaque, \c false if it is hierarchical.
- */
- bool is_opaque() const noexcept;
-
- /**
- * \brief Normalizes a uri object at a given level in the
- * comparison ladder.
- * \param level The comparison level.
- * \returns A normalized uri.
- * \post compare(normalize(uri, level), level) == 0
- * \throws std::bad_alloc
- */
- uri normalize(uri_comparison_level level) const;
-
- /**
- * \brief Returns a relative reference against the base URI.
- * \param base The base URI.
- * \returns A relative reference of this URI against the base.
- * \throws std::bad_alloc
- */
- uri make_relative(const uri &base) const;
-
- /**
- * \brief Resolves a relative reference against the given URI.
- * \param base The base URI to resolve against.
- * \returns An absolute URI.
- * \throws std::bad_alloc
- */
- uri resolve(const uri &base) const;
-
- /**
- * \brief Compares this URI against another, corresponding to the
- * level in the comparison ladder.
- * \param other The other URI.
- * \param level The level in the comparison ladder.
- * \returns \c 0 if the URIs are considered equal, \c -1 if this is
- * less than other and and 1 if this is greater than
- * other.
- */
- int compare(const uri &other, uri_comparison_level level) const noexcept;
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * user info part.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_user_info(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_user_info(first, last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * host part.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_host(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_host(first, last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * port part.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_port(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_port(first, last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * path part.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_path(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_path(first, last, out);
- }
-
- /**
- * \deprecated Avoid using this function
- * \brief Equivalent to \c encode_query_component
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- * \sa encode_query_commponent
- * \sa encode_query_key_value_pair
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_query(InputIter first, InputIter last,
- OutputIter out) {
- return encode_query_component(first, last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * query component, including the '=' character.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_query_component(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_query_component(first, last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * query key value pair.
- * \param key_first The iterator at first element in the input
- * sequence.
- * \param key_last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_query_key_value_pair(InputIter key_first,
- InputIter key_last,
- InputIter value_first,
- InputIter value_last,
- OutputIter out) {
- out = detail::encode_query_component(key_first, key_last, out);
- out++ = '=';
- return detail::encode_query_component(value_first, value_last, out);
- }
-
- /**
- * \brief Encodes a sequence according to the rules for encoding a
- * fragment part.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter encode_fragment(InputIter first, InputIter last,
- OutputIter out) {
- return detail::encode_fragment(first, last, out);
- }
-
- /**
- * \brief Decodes a sequence according to the percent decoding
- * rules.
- * \param first The iterator at first element in the input
- * sequence.
- * \param last The iterator at end + 1th element in the input
- * sequence.
- * \param out The iterator at the first element in the output
- * sequence.
- * \returns The iterator at the end + 1th in the output sequence.
- */
- template <typename InputIter, typename OutputIter>
- static OutputIter decode(InputIter first, InputIter last, OutputIter out) {
- return detail::decode(first, last, out);
- }
-
- private:
- bool initialize(const string_type &uri);
-
- void initialize(optional<string_type> scheme, optional<string_type> user_info,
- optional<string_type> host, optional<string_type> port,
- optional<string_type> path, optional<string_type> query,
- optional<string_type> fragment);
-
- string_type uri_;
- string_view uri_view_;
- detail::uri_parts uri_parts_;
-};
-
-/**
- * \brief \c uri factory function.
- * \param first The first element in a string sequence.
- * \param last The end + 1th element in a string sequence.
- * \param ec Error code set if the sequence is not a valid URI.
- */
-template <class InputIter>
-inline uri make_uri(InputIter first, InputIter last, std::error_code &ec) {
- return uri(first, last, ec);
-}
-
-/**
- * \brief \c uri factory function.
- * \param source A source string that is to be parsed as a URI.
- * \param ec Error code set if the source is not a valid URI.
- */
-template <class Source>
-inline uri make_uri(const Source &source, std::error_code &ec) {
- return uri(source, ec);
-}
-
-/**
- * \brief Swaps one uri object with another.
- */
-void swap(uri &lhs, uri &rhs) noexcept;
-
-/**
- * \brief Equality operator for the \c uri.
- */
-bool operator==(const uri &lhs, const uri &rhs) noexcept;
-
-/**
- * \brief Equality operator for the \c uri.
- */
-bool operator==(const uri &lhs, const char *rhs) noexcept;
-
-/**
- * \brief Equality operator for the \c uri.
- */
-inline bool operator==(const char *lhs, const uri &rhs) noexcept {
- return rhs == lhs;
-}
-
-/**
- * \brief Inequality operator for the \c uri.
- */
-inline bool operator!=(const uri &lhs, const uri &rhs) noexcept {
- return !(lhs == rhs);
-}
-
-/**
- * \brief Less-than operator for the \c uri.
- */
-bool operator<(const uri &lhs, const uri &rhs) noexcept;
-
-/**
- * \brief Greater-than operator for the \c uri.
- */
-inline bool operator>(const uri &lhs, const uri &rhs) noexcept {
- return rhs < lhs;
-}
-
-/**
- * \brief Less-than-or-equal-to operator for the \c uri.
- */
-inline bool operator<=(const uri &lhs, const uri &rhs) noexcept {
- return !(rhs < lhs);
-}
-
-/**
- * \brief Greater-than-or-equal-to operator for the \c uri.
- */
-inline bool operator>=(const uri &lhs, const uri &rhs) noexcept {
- return !(lhs < rhs);
-}
-} // namespace network
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-namespace std {
-template <>
-struct is_error_code_enum<network::uri_error> : public true_type {};
-} // namespace std
-
-namespace std {
-template <>
-struct hash<network::uri> {
- std::size_t operator()(const network::uri &uri_) const {
- std::size_t seed = 0;
- std::for_each(std::begin(uri_), std::end(uri_),
- [&seed](network::uri::value_type v) {
- std::hash<network::uri::value_type> hasher;
- seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
- });
- return seed;
- }
-};
-} // namespace std
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(pop)
-#endif
-
-#include <network/uri/uri_builder.hpp>
-
-#endif // NETWORK_URI_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
deleted file mode 100644
index 87f0b79221..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
+++ /dev/null
@@ -1,277 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-/**
- * \file
- * \brief Contains the definition of the uri_builder.
- */
-
-#ifndef NETWORK_URI_BUILDER_INC
-#define NETWORK_URI_BUILDER_INC
-
-#include <cstdint>
-#include <utility>
-#include <type_traits>
-#include <network/uri/uri.hpp>
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
-#endif
-
-namespace network {
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-namespace detail {
-
-template <class T>
-struct host_converter {
- uri::string_type operator()(const T &host) const {
- return detail::translate(host);
- }
-};
-
-template <class T, class Enable = void>
-struct port_converter {
- uri::string_type operator()(const T &port) const {
- return detail::translate(port);
- }
-};
-
-template <class T>
-struct port_converter<T, typename std::enable_if<std::is_integral<
- typename std::decay<T>::type>::value>::type> {
- uri::string_type operator()(std::uint16_t port) const {
- return std::to_string(port);
- }
-};
-
-template <class T>
-struct path_converter {
- uri::string_type operator()(const T &path) const {
- return detail::translate(path);
- }
-};
-} // namespace detail
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-/**
- * \ingroup uri
- * \class uri_builder network/uri/uri_builder.hpp network/uri.hpp
- * \brief A class that allows complex uri objects to be constructed.
- * \sa uri
- */
-class uri_builder {
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
- friend class uri;
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
- uri_builder(const uri_builder &) = delete;
- uri_builder &operator=(const uri_builder &) = delete;
-
- public:
- /**
- * \brief The uri_builder string_type.
- */
- using string_type = network::uri::string_type;
-
- /**
- * \brief Constructor.
- */
- uri_builder() = default;
-
- /**
- * \brief Constructor.
- * \param base A URI that is the base on which a new URI is built.
- */
- explicit uri_builder(const uri &base);
-
- /**
- * \brief Destructor.
- */
- ~uri_builder() noexcept;
-
- /**
- * \brief Adds a new scheme to the uri_builder.
- * \param scheme The scheme.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &scheme(const Source &scheme) {
- set_scheme(detail::translate(scheme));
- return *this;
- }
-
- /**
- * \brief Adds a new user info to the uri_builder.
- * \param user_info The user info.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &user_info(const Source &user_info) {
- set_user_info(detail::translate(user_info));
- return *this;
- }
-
- /**
- * \brief Clears the URI user_info part.
- * \returns \c *this
- */
- uri_builder &clear_user_info();
-
- /**
- * \brief Adds a new host to the uri_builder.
- * \param host The host.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &host(const Source &host) {
- detail::host_converter<Source> convert;
- set_host(convert(host));
- return *this;
- }
-
- /**
- * \brief Adds a new port to the uri_builder.
- * \param port The port.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &port(const Source &port) {
- detail::port_converter<Source> convert;
- set_port(convert(port));
- return *this;
- }
-
- /**
- * \brief Clears the URI port part.
- * \returns \c *this
- */
- uri_builder &clear_port();
-
- /**
- * \brief Adds a new authority to the uri_builder.
- * \param authority The authority.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &authority(const Source &authority) {
- set_authority(detail::translate(authority));
- return *this;
- }
-
- /**
- * \brief Sets a new path to the uri_builder.
- * \param path The path.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &path(const Source &path) {
- detail::path_converter<Source> convert;
- set_path(convert(path));
- return *this;
- }
-
- /**
- * \brief Clears the URI path part.
- * \returns \c *this
- */
- uri_builder &clear_path();
-
- /**
- * \deprecated Use append_query_component
- * \warning This function's behaviour has changed and percent encoding
- * of the '=' character is not ignored.
- * \brief Adds a new query to the uri_builder.
- * \param query The query.
- * \returns \c *this
- * \sa append_query_parameter
- */
- template <typename Source>
- uri_builder &append_query(const Source &query) {
- return append_query_component(query);
- }
-
- /**
- * \brief Appends a new query component to the uri_builder. The
- * '=' symbol is percent encoded.
- * \param component The query component.
- * \returns \c *this
- * \sa append_query_key_value_pair
- */
- template <typename Source>
- uri_builder &append_query_component(const Source &component) {
- append_query_component(detail::translate(component));
- return *this;
- }
-
- /**
- * \brief Adds a new query key/value pair to the uri_builder.
- * \param key The query parameter key.
- * \param value The query parameter value.
- * \returns \c *this
- */
- template <typename Key, typename Value>
- uri_builder &append_query_key_value_pair(const Key &key, const Value &value) {
- append_query_key_value_pair(detail::translate(key),
- detail::translate(value));
- return *this;
- }
-
- /**
- * \brief Clears the URI query part.
- * \returns \c *this
- */
- uri_builder &clear_query();
-
- /**
- * \brief Adds a new fragment to the uri_builder.
- * \param fragment The fragment.
- * \returns \c *this
- */
- template <typename Source>
- uri_builder &fragment(const Source &fragment) {
- set_fragment(detail::translate(fragment));
- return *this;
- }
-
- /**
- * \brief Clears the URI fragment part.
- * \returns \c *this
- */
- uri_builder &clear_fragment();
-
- /**
- * \brief Builds a new uri object.
- * \returns A valid uri object.
- * \throws uri_builder_error if the uri_builder is unable to build
- * a valid URI.
- * \throws std::bad_alloc If the underlying string cannot be
- * allocated.
- */
- network::uri uri() const;
-
- private:
- void set_scheme(string_type &&scheme);
- void set_user_info(string_type &&user_info);
- void set_host(string_type &&host);
- void set_port(string_type &&port);
- void set_authority(string_type &&authority);
- void set_path(string_type &&path);
- void append_query_component(string_type &&name);
- void append_query_key_value_pair(string_type &&key, string_type &&value);
- void set_fragment(string_type &&fragment);
-
- optional<string_type> scheme_, user_info_, host_, port_, path_, query_,
- fragment_;
-};
-} // namespace network
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(pop)
-#endif
-
-#endif // NETWORK_URI_BUILDER_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
deleted file mode 100644
index f97bbf8230..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
+++ /dev/null
@@ -1,113 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_URI_ERRORS_INC
-#define NETWORK_URI_ERRORS_INC
-
-/**
- * \file
- * \brief Contains functions and exceptions for URI error handling.
- */
-
-#include <system_error>
-#include <network/uri/config.hpp>
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(push)
-#pragma warning(disable : 4251 4231 4660)
-// Disable C4275 too because it's "essentially noise and can be silenced"
-// according to Stephen T. Lavavej at Microsoft. See:
-// https://connect.microsoft.com/VisualStudio/feedback/details/696593/vc-10-vs-2010-basic-string-exports.
-#pragma warning(disable : 4275)
-#endif
-
-namespace network {
-
-#if !defined(DOXYGEN_SHOULD_SKIP_THIS)
-enum class uri_error {
-
- // parser errors
- invalid_syntax = 1,
-
- // builder errors
- invalid_uri,
- invalid_scheme,
- invalid_user_info,
- invalid_host,
- invalid_port,
- invalid_path,
- invalid_query,
- invalid_fragment,
-
- // encoding errors
- not_enough_input,
- non_hex_input,
- conversion_failed,
-};
-
-const std::error_category &uri_category();
-
-std::error_code make_error_code(uri_error e);
-#endif // !defined(DOXYGEN_SHOULD_SKIP_THIS)
-
-/**
- * \class uri_syntax_error uri.hpp network/uri.hpp
- * \brief An exception thrown by the \c uri constructor when a URI
- * cannot be parsed.
- */
-class uri_syntax_error : public std::system_error {
- public:
- /**
- * \brief Constructor.
- */
- uri_syntax_error();
-
- /**
- * \brief Destructor.
- */
- virtual ~uri_syntax_error() noexcept;
-};
-
-/**
- * \class uri_builder_error uri.hpp network/uri.hpp
- * \brief An exception thrown when the \c uri_builder cannot build a
- * valid URI.
- */
-class uri_builder_error : public std::system_error {
- public:
- /**
- * \brief Constructor.
- */
- uri_builder_error();
-
- /**
- * \brief Destructor.
- */
- virtual ~uri_builder_error() noexcept;
-};
-
-/**
- * \class percent_decoding_error uri.hpp network/uri.hpp
- * \brief An exception thrown when during percent decoding.
- */
-class percent_decoding_error : public std::system_error {
- public:
- /**
- * \brief Constructor.
- */
- explicit percent_decoding_error(uri_error error);
-
- /**
- * \brief Destructor.
- */
- virtual ~percent_decoding_error() noexcept;
-};
-} // namespace network
-
-#ifdef NETWORK_URI_MSVC
-#pragma warning(pop)
-#endif
-
-#endif // NETWORK_URI_ERRORS_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_io.hpp b/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_io.hpp
deleted file mode 100644
index cb9b243f43..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/include/network/uri/uri_io.hpp
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (c) Glyn Matthews 2011-2016
-// Copyright 2012 Dean Michael Berris <dberris@google.com>
-// Copyright 2012 Google, Inc.
-// 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)
-
-/**
- * \file
- * \brief Defines stream overloads for the uri class.
- */
-
-#ifndef NETWORK_URI_URI_IO_INC
-#define NETWORK_URI_URI_IO_INC
-
-#include <network/uri/config.hpp>
-#include <network/uri/uri.hpp>
-#include <iosfwd>
-
-namespace network {
-#if !defined(NETWORK_URI_MSVC)
-template <typename CharT, class CharTraits = std::char_traits<CharT> >
-std::basic_ostream<CharT, CharTraits> &operator<<(
- std::basic_ostream<CharT, CharTraits> &os, const uri &uri_) {
- return os << uri_.to_string<CharT, CharTraits>();
-}
-
-template <typename CharT, class CharTraits = std::char_traits<CharT> >
-std::basic_istream<CharT, CharTraits> &operator>>(
- std::basic_istream<CharT, CharTraits> &is, uri &uri_) {
- std::basic_string<CharT, CharTraits> uri_string;
- is >> uri_string;
- uri_ = uri(uri_string);
- return is;
-}
-#else
-inline std::ostream &operator<<(std::ostream &os, const uri &uri_) {
- return os << uri_.string();
-}
-
-inline std::wostream &operator<<(std::wostream &os, const uri &uri_) {
- return os << uri_.wstring();
-}
-
-inline std::istream &operator>>(std::istream &is, uri &uri_) {
- std::string uri_string;
- is >> uri_string;
- uri_ = uri(uri_string);
- return is;
-}
-
-inline std::wistream &operator>>(std::wistream &is, uri &uri_) {
- std::wstring uri_string;
- is >> uri_string;
- uri_ = uri(uri_string);
- return is;
-}
-#endif // !defined(NETWORK_URI_MSVC)
-
-} // namespace network
-
-#endif // NETWORK_URI_URI_IO_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake
deleted file mode 100644
index c8d9fc1d4a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/CMakeDirectoryInformation.cmake
+++ /dev/null
@@ -1,16 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Relative path conversion top directories.
-set(CMAKE_RELATIVE_PATH_TOP_SOURCE "/usr/local/src/asymptote-2.92/LspCpp")
-set(CMAKE_RELATIVE_PATH_TOP_BINARY "/usr/local/src/asymptote-2.92/LspCpp")
-
-# Force unix paths in dependencies.
-set(CMAKE_FORCE_UNIX_PATHS 1)
-
-
-# The C and CXX include file regular expressions for this directory.
-set(CMAKE_C_INCLUDE_REGEX_SCAN "^.*$")
-set(CMAKE_C_INCLUDE_REGEX_COMPLAIN "^$")
-set(CMAKE_CXX_INCLUDE_REGEX_SCAN ${CMAKE_C_INCLUDE_REGEX_SCAN})
-set(CMAKE_CXX_INCLUDE_REGEX_COMPLAIN ${CMAKE_C_INCLUDE_REGEX_COMPLAIN})
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake
deleted file mode 100644
index 61e50a43da..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake
+++ /dev/null
@@ -1,30 +0,0 @@
-
-# Consider dependencies only in project.
-set(CMAKE_DEPENDS_IN_PROJECT_ONLY OFF)
-
-# The set of languages for which implicit dependencies are needed:
-set(CMAKE_DEPENDS_LANGUAGES
- )
-
-# The set of dependency files which are needed:
-set(CMAKE_DEPENDS_DEPENDENCY_FILES
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_builder.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o.d"
- "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_errors.cpp" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o" "gcc" "third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o.d"
- )
-
-# Targets to which this target links which contain Fortran sources.
-set(CMAKE_Fortran_TARGET_LINKED_INFO_FILES
- )
-
-# Targets to which this target links which contain Fortran sources.
-set(CMAKE_Fortran_TARGET_FORWARD_LINKED_INFO_FILES
- )
-
-# Fortran module output directory.
-set(CMAKE_Fortran_TARGET_MODULE_DIR "")
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make
deleted file mode 100644
index faccd6df23..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/build.make
+++ /dev/null
@@ -1,226 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Delete rule output on recipe failure.
-.DELETE_ON_ERROR:
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Disable VCS-based implicit rules.
-% : %,v
-
-# Disable VCS-based implicit rules.
-% : RCS/%
-
-# Disable VCS-based implicit rules.
-% : RCS/%,v
-
-# Disable VCS-based implicit rules.
-% : SCCS/s.%
-
-# Disable VCS-based implicit rules.
-% : s.%
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Produce verbose output by default.
-VERBOSE = 1
-
-# Command-line flag to silence nested $(MAKE).
-$(VERBOSE)MAKESILENT = -s
-
-#Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E rm -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# Include any dependencies generated for this target.
-include third_party/uri/src/CMakeFiles/network-uri.dir/depend.make
-# Include any dependencies generated by the compiler for this target.
-include third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.make
-
-# Include the progress variables for this target.
-include third_party/uri/src/CMakeFiles/network-uri.dir/progress.make
-
-# Include the compile flags for this target's objects.
-include third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/uri.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_1) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o -MF CMakeFiles/network-uri.dir/uri.cpp.o.d -o CMakeFiles/network-uri.dir/uri.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri.cpp > CMakeFiles/network-uri.dir/uri.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri.cpp -o CMakeFiles/network-uri.dir/uri.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/uri_builder.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_2) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o -MF CMakeFiles/network-uri.dir/uri_builder.cpp.o.d -o CMakeFiles/network-uri.dir/uri_builder.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_builder.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri_builder.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_builder.cpp > CMakeFiles/network-uri.dir/uri_builder.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri_builder.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_builder.cpp -o CMakeFiles/network-uri.dir/uri_builder.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/uri_errors.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_3) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o -MF CMakeFiles/network-uri.dir/uri_errors.cpp.o.d -o CMakeFiles/network-uri.dir/uri_errors.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_errors.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/uri_errors.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_errors.cpp > CMakeFiles/network-uri.dir/uri_errors.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/uri_errors.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_errors.cpp -o CMakeFiles/network-uri.dir/uri_errors.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/detail/uri_parse.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_4) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.cpp > CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/detail/uri_parse_authority.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_5) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp > CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp -o CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/detail/uri_advance_parts.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_6) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp > CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp -o CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/detail/uri_normalize.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_7) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.cpp > CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.cpp -o CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/detail/uri_resolve.cpp
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_8) "Building CXX object third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -MD -MT third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -MF CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o -c /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.cpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Preprocessing CXX source to CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -E /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.cpp > CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s: cmake_force
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green "Compiling CXX source to assembly CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && /bin/c++ $(CXX_DEFINES) $(CXX_INCLUDES) $(CXX_FLAGS) -S /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.cpp -o CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s
-
-# Object files for target network-uri
-network__uri_OBJECTS = \
-"CMakeFiles/network-uri.dir/uri.cpp.o" \
-"CMakeFiles/network-uri.dir/uri_builder.cpp.o" \
-"CMakeFiles/network-uri.dir/uri_errors.cpp.o" \
-"CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" \
-"CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" \
-"CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" \
-"CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" \
-"CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o"
-
-# External object files for target network-uri
-network__uri_EXTERNAL_OBJECTS =
-
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/build.make
-third_party/uri/src/libnetwork-uri.a: third_party/uri/src/CMakeFiles/network-uri.dir/link.txt
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --green --bold --progress-dir=/usr/local/src/asymptote-2.92/LspCpp/CMakeFiles --progress-num=$(CMAKE_PROGRESS_9) "Linking CXX static library libnetwork-uri.a"
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean_target.cmake
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -E cmake_link_script CMakeFiles/network-uri.dir/link.txt --verbose=$(VERBOSE)
-
-# Rule to build all files generated by this target.
-third_party/uri/src/CMakeFiles/network-uri.dir/build: third_party/uri/src/libnetwork-uri.a
-.PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/build
-
-third_party/uri/src/CMakeFiles/network-uri.dir/clean:
- cd /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src && $(CMAKE_COMMAND) -P CMakeFiles/network-uri.dir/cmake_clean.cmake
-.PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/clean
-
-third_party/uri/src/CMakeFiles/network-uri.dir/depend:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /usr/local/src/asymptote-2.92/LspCpp /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.92/LspCpp /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/DependInfo.cmake "--color=$(COLOR)"
-.PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/depend
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean.cmake
deleted file mode 100644
index 1d050bed3e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean.cmake
+++ /dev/null
@@ -1,25 +0,0 @@
-file(REMOVE_RECURSE
- "CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o"
- "CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o.d"
- "CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o"
- "CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o.d"
- "CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o"
- "CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o.d"
- "CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o"
- "CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o.d"
- "CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o"
- "CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o.d"
- "CMakeFiles/network-uri.dir/uri.cpp.o"
- "CMakeFiles/network-uri.dir/uri.cpp.o.d"
- "CMakeFiles/network-uri.dir/uri_builder.cpp.o"
- "CMakeFiles/network-uri.dir/uri_builder.cpp.o.d"
- "CMakeFiles/network-uri.dir/uri_errors.cpp.o"
- "CMakeFiles/network-uri.dir/uri_errors.cpp.o.d"
- "libnetwork-uri.a"
- "libnetwork-uri.pdb"
-)
-
-# Per-language clean rules from dependency scanning.
-foreach(lang CXX)
- include(CMakeFiles/network-uri.dir/cmake_clean_${lang}.cmake OPTIONAL)
-endforeach()
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean_target.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean_target.cmake
deleted file mode 100644
index 0b9c366a69..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/cmake_clean_target.cmake
+++ /dev/null
@@ -1,3 +0,0 @@
-file(REMOVE_RECURSE
- "libnetwork-uri.a"
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal
deleted file mode 100644
index 758b20f765..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.internal
+++ /dev/null
@@ -1,1739 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/limits
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wctype-wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/codecvt.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/locale_conv.h
- /usr/include/c++/14/bits/locale_facets.h
- /usr/include/c++/14/bits/locale_facets.tcc
- /usr/include/c++/14/bits/locale_facets_nonio.h
- /usr/include/c++/14/bits/locale_facets_nonio.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/std_function.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_bvector.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stl_vector.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/vector.tcc
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdint
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/ctime
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/cwctype
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/functional
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/locale
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/vector
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/libintl.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/include/wctype.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/config.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/algorithm.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/algorithm_split.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wctype-wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/codecvt.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/locale_conv.h
- /usr/include/c++/14/bits/locale_facets.h
- /usr/include/c++/14/bits/locale_facets.tcc
- /usr/include/c++/14/bits/locale_facets_nonio.h
- /usr/include/c++/14/bits/locale_facets_nonio.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/ctime
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/cwctype
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/limits
- /usr/include/c++/14/locale
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/libintl.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/include/wctype.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/grammar.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wctype-wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/codecvt.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/locale_conv.h
- /usr/include/c++/14/bits/locale_facets.h
- /usr/include/c++/14/bits/locale_facets.tcc
- /usr/include/c++/14/bits/locale_facets_nonio.h
- /usr/include/c++/14/bits/locale_facets_nonio.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/ctime
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/cwctype
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/limits
- /usr/include/c++/14/locale
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/libintl.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/include/wctype.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/grammar.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/std_function.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstddef
- /usr/include/c++/14/cstdint
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/functional
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/config.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/algorithm_find.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wctype-wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/codecvt.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/locale_conv.h
- /usr/include/c++/14/bits/locale_facets.h
- /usr/include/c++/14/bits/locale_facets.tcc
- /usr/include/c++/14/bits/locale_facets_nonio.h
- /usr/include/c++/14/bits/locale_facets_nonio.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/std_function.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_bvector.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stl_vector.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/vector.tcc
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdint
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/ctime
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/cwctype
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/functional
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/locale
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/vector
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/libintl.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/include/wctype.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/config.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/algorithm.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_resolve.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_builder.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/assert.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/cpu-set.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthread_stack_min-dynamic.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/sched.h
- /usr/include/bits/select.h
- /usr/include/bits/setjmp.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdint-least.h
- /usr/include/bits/stdint-uintn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/timex.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct___jmp_buf_tag.h
- /usr/include/bits/types/struct_itimerspec.h
- /usr/include/bits/types/struct_sched_param.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/struct_tm.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wctype-wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/algorithm
- /usr/include/c++/14/backward/auto_ptr.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bit
- /usr/include/c++/14/bits/algorithmfwd.h
- /usr/include/c++/14/bits/align.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocated_ptr.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/atomic_base.h
- /usr/include/c++/14/bits/atomic_lockfree_defines.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/codecvt.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/ios_base.h
- /usr/include/c++/14/bits/locale_classes.h
- /usr/include/c++/14/bits/locale_classes.tcc
- /usr/include/c++/14/bits/locale_conv.h
- /usr/include/c++/14/bits/locale_facets.h
- /usr/include/c++/14/bits/locale_facets.tcc
- /usr/include/c++/14/bits/locale_facets_nonio.h
- /usr/include/c++/14/bits/locale_facets_nonio.tcc
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/shared_ptr.h
- /usr/include/c++/14/bits/shared_ptr_atomic.h
- /usr/include/c++/14/bits/shared_ptr_base.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/std_function.h
- /usr/include/c++/14/bits/stl_algo.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_heap.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stl_raw_storage_iter.h
- /usr/include/c++/14/bits/stl_relops.h
- /usr/include/c++/14/bits/stl_tempbuf.h
- /usr/include/c++/14/bits/stl_uninitialized.h
- /usr/include/c++/14/bits/stream_iterator.h
- /usr/include/c++/14/bits/streambuf.tcc
- /usr/include/c++/14/bits/streambuf_iterator.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/uniform_int_dist.h
- /usr/include/c++/14/bits/unique_ptr.h
- /usr/include/c++/14/bits/uses_allocator.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cassert
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdint
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cstring
- /usr/include/c++/14/ctime
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/cwctype
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/aligned_buffer.h
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/atomicity.h
- /usr/include/c++/14/ext/concurrence.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/functional
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/iterator
- /usr/include/c++/14/locale
- /usr/include/c++/14/memory
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/streambuf
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/tuple
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/utility
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/libintl.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/pthread.h
- /usr/include/sched.h
- /usr/include/stdc-predef.h
- /usr/include/stdint.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/string.h
- /usr/include/strings.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/single_threaded.h
- /usr/include/sys/types.h
- /usr/include/time.h
- /usr/include/wchar.h
- /usr/include/wctype.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/optional.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/string_view.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/config.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/decode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/encode.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/translate.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/detail/uri_parts.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_builder.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/algorithm.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_normalize.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/uri_errors.cpp
- /usr/include/alloca.h
- /usr/include/asm-generic/errno-base.h
- /usr/include/asm-generic/errno.h
- /usr/include/asm/errno.h
- /usr/include/bits/atomic_wide_counter.h
- /usr/include/bits/byteswap.h
- /usr/include/bits/endian.h
- /usr/include/bits/endianness.h
- /usr/include/bits/errno.h
- /usr/include/bits/floatn-common.h
- /usr/include/bits/floatn.h
- /usr/include/bits/libc-header-start.h
- /usr/include/bits/locale.h
- /usr/include/bits/long-double.h
- /usr/include/bits/pthreadtypes-arch.h
- /usr/include/bits/pthreadtypes.h
- /usr/include/bits/select.h
- /usr/include/bits/stdint-intn.h
- /usr/include/bits/stdio.h
- /usr/include/bits/stdio_lim.h
- /usr/include/bits/stdlib-bsearch.h
- /usr/include/bits/stdlib-float.h
- /usr/include/bits/struct_mutex.h
- /usr/include/bits/struct_rwlock.h
- /usr/include/bits/thread-shared-types.h
- /usr/include/bits/time64.h
- /usr/include/bits/timesize.h
- /usr/include/bits/types.h
- /usr/include/bits/types/FILE.h
- /usr/include/bits/types/__FILE.h
- /usr/include/bits/types/__fpos64_t.h
- /usr/include/bits/types/__fpos_t.h
- /usr/include/bits/types/__locale_t.h
- /usr/include/bits/types/__mbstate_t.h
- /usr/include/bits/types/__sigset_t.h
- /usr/include/bits/types/clock_t.h
- /usr/include/bits/types/clockid_t.h
- /usr/include/bits/types/cookie_io_functions_t.h
- /usr/include/bits/types/error_t.h
- /usr/include/bits/types/locale_t.h
- /usr/include/bits/types/mbstate_t.h
- /usr/include/bits/types/sigset_t.h
- /usr/include/bits/types/struct_FILE.h
- /usr/include/bits/types/struct_timespec.h
- /usr/include/bits/types/struct_timeval.h
- /usr/include/bits/types/time_t.h
- /usr/include/bits/types/timer_t.h
- /usr/include/bits/types/wint_t.h
- /usr/include/bits/typesizes.h
- /usr/include/bits/uintn-identity.h
- /usr/include/bits/waitflags.h
- /usr/include/bits/waitstatus.h
- /usr/include/bits/wchar.h
- /usr/include/bits/wordsize.h
- /usr/include/c++/14/backward/binders.h
- /usr/include/c++/14/bits/alloc_traits.h
- /usr/include/c++/14/bits/allocator.h
- /usr/include/c++/14/bits/basic_string.h
- /usr/include/c++/14/bits/basic_string.tcc
- /usr/include/c++/14/bits/char_traits.h
- /usr/include/c++/14/bits/charconv.h
- /usr/include/c++/14/bits/concept_check.h
- /usr/include/c++/14/bits/cpp_type_traits.h
- /usr/include/c++/14/bits/cxxabi_forced.h
- /usr/include/c++/14/bits/cxxabi_init_exception.h
- /usr/include/c++/14/bits/exception.h
- /usr/include/c++/14/bits/exception_defines.h
- /usr/include/c++/14/bits/exception_ptr.h
- /usr/include/c++/14/bits/functexcept.h
- /usr/include/c++/14/bits/functional_hash.h
- /usr/include/c++/14/bits/hash_bytes.h
- /usr/include/c++/14/bits/invoke.h
- /usr/include/c++/14/bits/localefwd.h
- /usr/include/c++/14/bits/memoryfwd.h
- /usr/include/c++/14/bits/move.h
- /usr/include/c++/14/bits/nested_exception.h
- /usr/include/c++/14/bits/new_allocator.h
- /usr/include/c++/14/bits/ostream_insert.h
- /usr/include/c++/14/bits/postypes.h
- /usr/include/c++/14/bits/predefined_ops.h
- /usr/include/c++/14/bits/ptr_traits.h
- /usr/include/c++/14/bits/range_access.h
- /usr/include/c++/14/bits/refwrap.h
- /usr/include/c++/14/bits/requires_hosted.h
- /usr/include/c++/14/bits/std_abs.h
- /usr/include/c++/14/bits/stl_algobase.h
- /usr/include/c++/14/bits/stl_construct.h
- /usr/include/c++/14/bits/stl_function.h
- /usr/include/c++/14/bits/stl_iterator.h
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h
- /usr/include/c++/14/bits/stl_iterator_base_types.h
- /usr/include/c++/14/bits/stl_pair.h
- /usr/include/c++/14/bits/stringfwd.h
- /usr/include/c++/14/bits/utility.h
- /usr/include/c++/14/bits/version.h
- /usr/include/c++/14/cctype
- /usr/include/c++/14/cerrno
- /usr/include/c++/14/clocale
- /usr/include/c++/14/cstdio
- /usr/include/c++/14/cstdlib
- /usr/include/c++/14/cwchar
- /usr/include/c++/14/debug/assertions.h
- /usr/include/c++/14/debug/debug.h
- /usr/include/c++/14/exception
- /usr/include/c++/14/ext/alloc_traits.h
- /usr/include/c++/14/ext/numeric_traits.h
- /usr/include/c++/14/ext/string_conversions.h
- /usr/include/c++/14/ext/type_traits.h
- /usr/include/c++/14/initializer_list
- /usr/include/c++/14/iosfwd
- /usr/include/c++/14/new
- /usr/include/c++/14/stdexcept
- /usr/include/c++/14/string
- /usr/include/c++/14/system_error
- /usr/include/c++/14/type_traits
- /usr/include/c++/14/typeinfo
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h
- /usr/include/ctype.h
- /usr/include/endian.h
- /usr/include/errno.h
- /usr/include/features-time64.h
- /usr/include/features.h
- /usr/include/gnu/stubs-64.h
- /usr/include/gnu/stubs.h
- /usr/include/linux/errno.h
- /usr/include/locale.h
- /usr/include/stdc-predef.h
- /usr/include/stdio.h
- /usr/include/stdlib.h
- /usr/include/sys/cdefs.h
- /usr/include/sys/select.h
- /usr/include/sys/types.h
- /usr/include/wchar.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/config.hpp
- /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include/network/uri/uri_errors.hpp
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.make
deleted file mode 100644
index ba32393472..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.make
+++ /dev/null
@@ -1,2237 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o: third_party/uri/src/detail/uri_advance_parts.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/limits \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/src/detail/uri_advance_parts.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o: third_party/uri/src/detail/uri_normalize.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wctype-wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/codecvt.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/locale_conv.h \
- /usr/include/c++/14/bits/locale_facets.h \
- /usr/include/c++/14/bits/locale_facets.tcc \
- /usr/include/c++/14/bits/locale_facets_nonio.h \
- /usr/include/c++/14/bits/locale_facets_nonio.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/std_function.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_bvector.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stl_vector.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/vector.tcc \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdint \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/ctime \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/cwctype \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/functional \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/locale \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/vector \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/libintl.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/include/wctype.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/config.hpp \
- third_party/uri/include/network/uri/detail/decode.hpp \
- third_party/uri/include/network/uri/detail/encode.hpp \
- third_party/uri/include/network/uri/detail/translate.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/include/network/uri/uri.hpp \
- third_party/uri/include/network/uri/uri_builder.hpp \
- third_party/uri/include/network/uri/uri_errors.hpp \
- third_party/uri/src/detail/algorithm.hpp \
- third_party/uri/src/detail/algorithm_split.hpp \
- third_party/uri/src/detail/uri_normalize.hpp \
- third_party/uri/src/detail/uri_percent_encode.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o: third_party/uri/src/detail/uri_parse.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wctype-wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/codecvt.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/locale_conv.h \
- /usr/include/c++/14/bits/locale_facets.h \
- /usr/include/c++/14/bits/locale_facets.tcc \
- /usr/include/c++/14/bits/locale_facets_nonio.h \
- /usr/include/c++/14/bits/locale_facets_nonio.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/ctime \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/cwctype \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/limits \
- /usr/include/c++/14/locale \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/libintl.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/include/wctype.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/src/detail/grammar.hpp \
- third_party/uri/src/detail/uri_parse.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o: third_party/uri/src/detail/uri_parse_authority.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wctype-wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/codecvt.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/locale_conv.h \
- /usr/include/c++/14/bits/locale_facets.h \
- /usr/include/c++/14/bits/locale_facets.tcc \
- /usr/include/c++/14/bits/locale_facets_nonio.h \
- /usr/include/c++/14/bits/locale_facets_nonio.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/ctime \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/cwctype \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/limits \
- /usr/include/c++/14/locale \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/libintl.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/include/wctype.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/src/detail/grammar.hpp \
- third_party/uri/src/detail/uri_parse_authority.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o: third_party/uri/src/detail/uri_resolve.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/std_function.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstddef \
- /usr/include/c++/14/cstdint \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/functional \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/config.hpp \
- third_party/uri/include/network/uri/detail/decode.hpp \
- third_party/uri/include/network/uri/detail/encode.hpp \
- third_party/uri/include/network/uri/detail/translate.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/include/network/uri/uri.hpp \
- third_party/uri/include/network/uri/uri_builder.hpp \
- third_party/uri/include/network/uri/uri_errors.hpp \
- third_party/uri/src/detail/algorithm_find.hpp \
- third_party/uri/src/detail/uri_resolve.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o: third_party/uri/src/uri.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wctype-wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/codecvt.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/locale_conv.h \
- /usr/include/c++/14/bits/locale_facets.h \
- /usr/include/c++/14/bits/locale_facets.tcc \
- /usr/include/c++/14/bits/locale_facets_nonio.h \
- /usr/include/c++/14/bits/locale_facets_nonio.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/std_function.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_bvector.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stl_vector.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/vector.tcc \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdint \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/ctime \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/cwctype \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/functional \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/locale \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/vector \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/libintl.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/include/wctype.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/config.hpp \
- third_party/uri/include/network/uri/detail/decode.hpp \
- third_party/uri/include/network/uri/detail/encode.hpp \
- third_party/uri/include/network/uri/detail/translate.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/include/network/uri/uri.hpp \
- third_party/uri/include/network/uri/uri_builder.hpp \
- third_party/uri/include/network/uri/uri_errors.hpp \
- third_party/uri/src/detail/algorithm.hpp \
- third_party/uri/src/detail/uri_advance_parts.hpp \
- third_party/uri/src/detail/uri_normalize.hpp \
- third_party/uri/src/detail/uri_parse.hpp \
- third_party/uri/src/detail/uri_percent_encode.hpp \
- third_party/uri/src/detail/uri_resolve.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o: third_party/uri/src/uri_builder.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/assert.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/cpu-set.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthread_stack_min-dynamic.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/sched.h \
- /usr/include/bits/select.h \
- /usr/include/bits/setjmp.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdint-least.h \
- /usr/include/bits/stdint-uintn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/timex.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct___jmp_buf_tag.h \
- /usr/include/bits/types/struct_itimerspec.h \
- /usr/include/bits/types/struct_sched_param.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/struct_tm.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wctype-wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/algorithm \
- /usr/include/c++/14/backward/auto_ptr.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bit \
- /usr/include/c++/14/bits/algorithmfwd.h \
- /usr/include/c++/14/bits/align.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocated_ptr.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/atomic_base.h \
- /usr/include/c++/14/bits/atomic_lockfree_defines.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/codecvt.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/ios_base.h \
- /usr/include/c++/14/bits/locale_classes.h \
- /usr/include/c++/14/bits/locale_classes.tcc \
- /usr/include/c++/14/bits/locale_conv.h \
- /usr/include/c++/14/bits/locale_facets.h \
- /usr/include/c++/14/bits/locale_facets.tcc \
- /usr/include/c++/14/bits/locale_facets_nonio.h \
- /usr/include/c++/14/bits/locale_facets_nonio.tcc \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/shared_ptr.h \
- /usr/include/c++/14/bits/shared_ptr_atomic.h \
- /usr/include/c++/14/bits/shared_ptr_base.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/std_function.h \
- /usr/include/c++/14/bits/stl_algo.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_heap.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stl_raw_storage_iter.h \
- /usr/include/c++/14/bits/stl_relops.h \
- /usr/include/c++/14/bits/stl_tempbuf.h \
- /usr/include/c++/14/bits/stl_uninitialized.h \
- /usr/include/c++/14/bits/stream_iterator.h \
- /usr/include/c++/14/bits/streambuf.tcc \
- /usr/include/c++/14/bits/streambuf_iterator.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/uniform_int_dist.h \
- /usr/include/c++/14/bits/unique_ptr.h \
- /usr/include/c++/14/bits/uses_allocator.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cassert \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdint \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cstring \
- /usr/include/c++/14/ctime \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/cwctype \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/aligned_buffer.h \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/atomicity.h \
- /usr/include/c++/14/ext/concurrence.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/functional \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/iterator \
- /usr/include/c++/14/locale \
- /usr/include/c++/14/memory \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/streambuf \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/tuple \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/utility \
- /usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/libintl.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/pthread.h \
- /usr/include/sched.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdint.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/string.h \
- /usr/include/strings.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/single_threaded.h \
- /usr/include/sys/types.h \
- /usr/include/time.h \
- /usr/include/wchar.h \
- /usr/include/wctype.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h \
- third_party/uri/include/network/optional.hpp \
- third_party/uri/include/network/string_view.hpp \
- third_party/uri/include/network/uri/config.hpp \
- third_party/uri/include/network/uri/detail/decode.hpp \
- third_party/uri/include/network/uri/detail/encode.hpp \
- third_party/uri/include/network/uri/detail/translate.hpp \
- third_party/uri/include/network/uri/detail/uri_parts.hpp \
- third_party/uri/include/network/uri/uri.hpp \
- third_party/uri/include/network/uri/uri_builder.hpp \
- third_party/uri/include/network/uri/uri_errors.hpp \
- third_party/uri/src/detail/algorithm.hpp \
- third_party/uri/src/detail/uri_normalize.hpp \
- third_party/uri/src/detail/uri_parse_authority.hpp
-
-third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o: third_party/uri/src/uri_errors.cpp \
- /usr/include/alloca.h \
- /usr/include/asm-generic/errno-base.h \
- /usr/include/asm-generic/errno.h \
- /usr/include/asm/errno.h \
- /usr/include/bits/atomic_wide_counter.h \
- /usr/include/bits/byteswap.h \
- /usr/include/bits/endian.h \
- /usr/include/bits/endianness.h \
- /usr/include/bits/errno.h \
- /usr/include/bits/floatn-common.h \
- /usr/include/bits/floatn.h \
- /usr/include/bits/libc-header-start.h \
- /usr/include/bits/locale.h \
- /usr/include/bits/long-double.h \
- /usr/include/bits/pthreadtypes-arch.h \
- /usr/include/bits/pthreadtypes.h \
- /usr/include/bits/select.h \
- /usr/include/bits/stdint-intn.h \
- /usr/include/bits/stdio.h \
- /usr/include/bits/stdio_lim.h \
- /usr/include/bits/stdlib-bsearch.h \
- /usr/include/bits/stdlib-float.h \
- /usr/include/bits/struct_mutex.h \
- /usr/include/bits/struct_rwlock.h \
- /usr/include/bits/thread-shared-types.h \
- /usr/include/bits/time64.h \
- /usr/include/bits/timesize.h \
- /usr/include/bits/types.h \
- /usr/include/bits/types/FILE.h \
- /usr/include/bits/types/__FILE.h \
- /usr/include/bits/types/__fpos64_t.h \
- /usr/include/bits/types/__fpos_t.h \
- /usr/include/bits/types/__locale_t.h \
- /usr/include/bits/types/__mbstate_t.h \
- /usr/include/bits/types/__sigset_t.h \
- /usr/include/bits/types/clock_t.h \
- /usr/include/bits/types/clockid_t.h \
- /usr/include/bits/types/cookie_io_functions_t.h \
- /usr/include/bits/types/error_t.h \
- /usr/include/bits/types/locale_t.h \
- /usr/include/bits/types/mbstate_t.h \
- /usr/include/bits/types/sigset_t.h \
- /usr/include/bits/types/struct_FILE.h \
- /usr/include/bits/types/struct_timespec.h \
- /usr/include/bits/types/struct_timeval.h \
- /usr/include/bits/types/time_t.h \
- /usr/include/bits/types/timer_t.h \
- /usr/include/bits/types/wint_t.h \
- /usr/include/bits/typesizes.h \
- /usr/include/bits/uintn-identity.h \
- /usr/include/bits/waitflags.h \
- /usr/include/bits/waitstatus.h \
- /usr/include/bits/wchar.h \
- /usr/include/bits/wordsize.h \
- /usr/include/c++/14/backward/binders.h \
- /usr/include/c++/14/bits/alloc_traits.h \
- /usr/include/c++/14/bits/allocator.h \
- /usr/include/c++/14/bits/basic_string.h \
- /usr/include/c++/14/bits/basic_string.tcc \
- /usr/include/c++/14/bits/char_traits.h \
- /usr/include/c++/14/bits/charconv.h \
- /usr/include/c++/14/bits/concept_check.h \
- /usr/include/c++/14/bits/cpp_type_traits.h \
- /usr/include/c++/14/bits/cxxabi_forced.h \
- /usr/include/c++/14/bits/cxxabi_init_exception.h \
- /usr/include/c++/14/bits/exception.h \
- /usr/include/c++/14/bits/exception_defines.h \
- /usr/include/c++/14/bits/exception_ptr.h \
- /usr/include/c++/14/bits/functexcept.h \
- /usr/include/c++/14/bits/functional_hash.h \
- /usr/include/c++/14/bits/hash_bytes.h \
- /usr/include/c++/14/bits/invoke.h \
- /usr/include/c++/14/bits/localefwd.h \
- /usr/include/c++/14/bits/memoryfwd.h \
- /usr/include/c++/14/bits/move.h \
- /usr/include/c++/14/bits/nested_exception.h \
- /usr/include/c++/14/bits/new_allocator.h \
- /usr/include/c++/14/bits/ostream_insert.h \
- /usr/include/c++/14/bits/postypes.h \
- /usr/include/c++/14/bits/predefined_ops.h \
- /usr/include/c++/14/bits/ptr_traits.h \
- /usr/include/c++/14/bits/range_access.h \
- /usr/include/c++/14/bits/refwrap.h \
- /usr/include/c++/14/bits/requires_hosted.h \
- /usr/include/c++/14/bits/std_abs.h \
- /usr/include/c++/14/bits/stl_algobase.h \
- /usr/include/c++/14/bits/stl_construct.h \
- /usr/include/c++/14/bits/stl_function.h \
- /usr/include/c++/14/bits/stl_iterator.h \
- /usr/include/c++/14/bits/stl_iterator_base_funcs.h \
- /usr/include/c++/14/bits/stl_iterator_base_types.h \
- /usr/include/c++/14/bits/stl_pair.h \
- /usr/include/c++/14/bits/stringfwd.h \
- /usr/include/c++/14/bits/utility.h \
- /usr/include/c++/14/bits/version.h \
- /usr/include/c++/14/cctype \
- /usr/include/c++/14/cerrno \
- /usr/include/c++/14/clocale \
- /usr/include/c++/14/cstdio \
- /usr/include/c++/14/cstdlib \
- /usr/include/c++/14/cwchar \
- /usr/include/c++/14/debug/assertions.h \
- /usr/include/c++/14/debug/debug.h \
- /usr/include/c++/14/exception \
- /usr/include/c++/14/ext/alloc_traits.h \
- /usr/include/c++/14/ext/numeric_traits.h \
- /usr/include/c++/14/ext/string_conversions.h \
- /usr/include/c++/14/ext/type_traits.h \
- /usr/include/c++/14/initializer_list \
- /usr/include/c++/14/iosfwd \
- /usr/include/c++/14/new \
- /usr/include/c++/14/stdexcept \
- /usr/include/c++/14/string \
- /usr/include/c++/14/system_error \
- /usr/include/c++/14/type_traits \
- /usr/include/c++/14/typeinfo \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h \
- /usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h \
- /usr/include/ctype.h \
- /usr/include/endian.h \
- /usr/include/errno.h \
- /usr/include/features-time64.h \
- /usr/include/features.h \
- /usr/include/gnu/stubs-64.h \
- /usr/include/gnu/stubs.h \
- /usr/include/linux/errno.h \
- /usr/include/locale.h \
- /usr/include/stdc-predef.h \
- /usr/include/stdio.h \
- /usr/include/stdlib.h \
- /usr/include/sys/cdefs.h \
- /usr/include/sys/select.h \
- /usr/include/sys/types.h \
- /usr/include/wchar.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h \
- /usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h \
- third_party/uri/include/network/uri/config.hpp \
- third_party/uri/include/network/uri/uri_errors.hpp
-
-
-third_party/uri/src/uri_builder.cpp:
-
-third_party/uri/src/uri.cpp:
-
-third_party/uri/src/detail/uri_resolve.hpp:
-
-third_party/uri/src/detail/algorithm_find.hpp:
-
-third_party/uri/src/detail/uri_parse_authority.hpp:
-
-third_party/uri/src/detail/uri_parse.hpp:
-
-third_party/uri/src/detail/grammar.hpp:
-
-third_party/uri/src/detail/uri_parse.cpp:
-
-third_party/uri/src/detail/algorithm.hpp:
-
-third_party/uri/include/network/uri/uri_errors.hpp:
-
-third_party/uri/include/network/uri/uri_builder.hpp:
-
-third_party/uri/include/network/uri/uri.hpp:
-
-third_party/uri/include/network/uri/detail/encode.hpp:
-
-third_party/uri/include/network/uri/config.hpp:
-
-/usr/include/string.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/ctype_base.h:
-
-/usr/include/c++/14/locale:
-
-/usr/include/c++/14/cwctype:
-
-/usr/include/c++/14/ctime:
-
-/usr/include/c++/14/cstdint:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/messages_members.h:
-
-/usr/include/c++/14/bits/vector.tcc:
-
-third_party/uri/src/detail/uri_percent_encode.hpp:
-
-/usr/include/c++/14/bits/stl_vector.h:
-
-/usr/include/c++/14/bits/stl_bvector.h:
-
-/usr/include/c++/14/bits/std_function.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/time_members.h:
-
-/usr/include/c++/14/bits/locale_facets_nonio.tcc:
-
-/usr/include/c++/14/bits/codecvt.h:
-
-third_party/uri/include/network/uri/detail/uri_parts.hpp:
-
-third_party/uri/include/network/optional.hpp:
-
-/usr/include/wchar.h:
-
-/usr/include/time.h:
-
-/usr/include/sys/single_threaded.h:
-
-/usr/include/sys/cdefs.h:
-
-/usr/include/c++/14/bits/locale_facets.tcc:
-
-/usr/include/stdio.h:
-
-/usr/include/stdc-predef.h:
-
-/usr/include/sched.h:
-
-/usr/include/linux/errno.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/os_defines.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/gthr.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/error_constants.h:
-
-/usr/include/locale.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/c++config.h:
-
-/usr/include/sys/select.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/c++allocator.h:
-
-/usr/include/c++/14/typeinfo:
-
-/usr/include/c++/14/type_traits:
-
-/usr/lib/gcc/x86_64-redhat-linux/14/include/stddef.h:
-
-/usr/include/c++/14/tuple:
-
-/usr/include/c++/14/string:
-
-/usr/include/bits/wctype-wchar.h:
-
-/usr/include/sys/types.h:
-
-/usr/include/c++/14/memory:
-
-/usr/include/c++/14/bits/locale_conv.h:
-
-/usr/include/c++/14/iosfwd:
-
-/usr/include/c++/14/initializer_list:
-
-/usr/include/c++/14/ext/type_traits.h:
-
-/usr/include/c++/14/ext/string_conversions.h:
-
-/usr/lib/gcc/x86_64-redhat-linux/14/include/stdarg.h:
-
-/usr/include/c++/14/ext/atomicity.h:
-
-/usr/include/c++/14/ext/alloc_traits.h:
-
-/usr/include/c++/14/new:
-
-/usr/include/c++/14/ext/aligned_buffer.h:
-
-/usr/include/errno.h:
-
-/usr/include/c++/14/debug/debug.h:
-
-/usr/include/c++/14/debug/assertions.h:
-
-/usr/include/c++/14/cstdio:
-
-/usr/include/c++/14/cerrno:
-
-/usr/include/c++/14/bits/version.h:
-
-/usr/include/c++/14/bits/utility.h:
-
-third_party/uri/src/uri_errors.cpp:
-
-/usr/include/c++/14/bits/uses_allocator.h:
-
-/usr/include/c++/14/limits:
-
-/usr/include/c++/14/bits/unique_ptr.h:
-
-/usr/include/gnu/stubs-64.h:
-
-/usr/include/c++/14/bits/stringfwd.h:
-
-/usr/include/c++/14/bits/locale_facets.h:
-
-/usr/include/c++/14/bits/streambuf.tcc:
-
-/usr/include/c++/14/streambuf:
-
-/usr/include/bits/types/struct_tm.h:
-
-/usr/include/bits/wchar.h:
-
-/usr/include/c++/14/bits/stl_construct.h:
-
-/usr/include/bits/types/struct_timespec.h:
-
-/usr/include/bits/types/struct_sched_param.h:
-
-/usr/include/ctype.h:
-
-/usr/include/bits/waitflags.h:
-
-/usr/include/bits/types/struct_FILE.h:
-
-/usr/include/bits/types/cookie_io_functions_t.h:
-
-/usr/include/bits/sched.h:
-
-/usr/include/bits/types/clockid_t.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/gthr-default.h:
-
-/usr/include/bits/atomic_wide_counter.h:
-
-/usr/include/c++/14/bits/cxxabi_init_exception.h:
-
-/usr/include/c++/14/bits/streambuf_iterator.h:
-
-/usr/include/bits/types/__FILE.h:
-
-/usr/include/c++/14/bits/align.h:
-
-/usr/include/c++/14/utility:
-
-/usr/include/bits/types/FILE.h:
-
-/usr/include/c++/14/bits/exception_ptr.h:
-
-/usr/include/bits/types.h:
-
-/usr/include/endian.h:
-
-/usr/include/c++/14/bits/localefwd.h:
-
-/usr/include/bits/types/error_t.h:
-
-/usr/include/bits/stdint-intn.h:
-
-/usr/include/c++/14/system_error:
-
-/usr/include/c++/14/cstdlib:
-
-/usr/include/bits/endian.h:
-
-third_party/uri/include/network/uri/detail/translate.hpp:
-
-/usr/include/asm/errno.h:
-
-/usr/include/stdint.h:
-
-/usr/include/c++/14/bits/cxxabi_forced.h:
-
-/usr/include/bits/types/time_t.h:
-
-/usr/include/c++/14/bits/atomic_base.h:
-
-/usr/include/libintl.h:
-
-/usr/include/c++/14/bits/stl_uninitialized.h:
-
-/usr/include/bits/floatn-common.h:
-
-/usr/include/stdlib.h:
-
-/usr/include/c++/14/algorithm:
-
-/usr/include/bits/struct_mutex.h:
-
-/usr/include/c++/14/bits/locale_classes.h:
-
-/usr/include/c++/14/bits/new_allocator.h:
-
-/usr/include/c++/14/cstddef:
-
-/usr/include/bits/cpu-set.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/ctype_inline.h:
-
-/usr/include/c++/14/bits/nested_exception.h:
-
-/usr/include/bits/uintn-identity.h:
-
-/usr/include/c++/14/cctype:
-
-/usr/include/c++/14/bits/exception.h:
-
-/usr/include/bits/long-double.h:
-
-/usr/include/c++/14/bits/shared_ptr.h:
-
-/usr/include/bits/stdio_lim.h:
-
-/usr/include/bits/types/__mbstate_t.h:
-
-/usr/include/bits/time.h:
-
-/usr/include/c++/14/exception:
-
-/usr/include/bits/struct_rwlock.h:
-
-/usr/include/bits/types/struct_itimerspec.h:
-
-/usr/include/bits/types/__sigset_t.h:
-
-/usr/include/bits/locale.h:
-
-third_party/uri/src/detail/uri_parse_authority.cpp:
-
-/usr/include/bits/setjmp.h:
-
-/usr/include/bits/types/struct___jmp_buf_tag.h:
-
-/usr/include/bits/types/clock_t.h:
-
-/usr/include/bits/types/__fpos_t.h:
-
-/usr/include/c++/14/bits/predefined_ops.h:
-
-/usr/include/asm-generic/errno.h:
-
-/usr/include/c++/14/bits/stl_function.h:
-
-/usr/include/c++/14/cassert:
-
-/usr/include/assert.h:
-
-third_party/uri/src/detail/uri_normalize.hpp:
-
-/usr/include/c++/14/ext/concurrence.h:
-
-third_party/uri/src/detail/uri_advance_parts.cpp:
-
-/usr/include/bits/floatn.h:
-
-/usr/include/bits/libc-header-start.h:
-
-/usr/include/features-time64.h:
-
-/usr/include/c++/14/bits/stl_relops.h:
-
-/usr/include/wctype.h:
-
-/usr/include/bits/errno.h:
-
-/usr/include/bits/timex.h:
-
-/usr/include/c++/14/bits/locale_facets_nonio.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/c++locale.h:
-
-/usr/include/bits/pthread_stack_min-dynamic.h:
-
-/usr/include/bits/types/struct_timeval.h:
-
-/usr/include/c++/14/bits/stl_raw_storage_iter.h:
-
-third_party/uri/include/network/uri/detail/decode.hpp:
-
-/usr/lib/gcc/x86_64-redhat-linux/14/include/stdint.h:
-
-/usr/include/gnu/stubs.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/atomic_word.h:
-
-/usr/include/bits/pthreadtypes-arch.h:
-
-/usr/include/c++/14/bits/invoke.h:
-
-/usr/include/bits/types/__fpos64_t.h:
-
-/usr/include/bits/select.h:
-
-/usr/include/c++/14/cstring:
-
-/usr/include/c++/14/stdexcept:
-
-/usr/include/c++/14/cwchar:
-
-/usr/include/c++/14/bits/charconv.h:
-
-/usr/include/alloca.h:
-
-/usr/include/bits/types/locale_t.h:
-
-/usr/include/c++/14/bits/ptr_traits.h:
-
-/usr/include/bits/stdint-least.h:
-
-/usr/include/bits/stdlib-bsearch.h:
-
-/usr/include/bits/types/mbstate_t.h:
-
-/usr/include/c++/14/bits/shared_ptr_atomic.h:
-
-/usr/include/c++/14/bits/functional_hash.h:
-
-/usr/include/bits/types/timer_t.h:
-
-/usr/include/bits/thread-shared-types.h:
-
-/usr/include/c++/14/bits/stl_pair.h:
-
-/usr/include/bits/types/wint_t.h:
-
-/usr/include/c++/14/bits/range_access.h:
-
-/usr/include/bits/timesize.h:
-
-/usr/include/bits/waitstatus.h:
-
-/usr/include/c++/14/vector:
-
-/usr/include/c++/14/bits/uniform_int_dist.h:
-
-/usr/include/c++/14/bits/shared_ptr_base.h:
-
-/usr/include/bits/wordsize.h:
-
-/usr/include/c++/14/bits/allocator.h:
-
-/usr/include/bits/stdlib-float.h:
-
-/usr/include/bits/time64.h:
-
-/usr/include/c++/14/backward/binders.h:
-
-/usr/include/c++/14/bit:
-
-/usr/include/bits/typesizes.h:
-
-/usr/include/c++/14/bits/algorithmfwd.h:
-
-/usr/include/c++/14/bits/ostream_insert.h:
-
-/usr/include/c++/14/bits/alloc_traits.h:
-
-third_party/uri/src/detail/uri_advance_parts.hpp:
-
-/usr/include/bits/byteswap.h:
-
-/usr/include/c++/14/bits/allocated_ptr.h:
-
-/usr/include/c++/14/bits/stl_iterator.h:
-
-/usr/include/asm-generic/errno-base.h:
-
-/usr/include/c++/14/bits/stl_algobase.h:
-
-/usr/include/c++/14/x86_64-redhat-linux/bits/cpu_defines.h:
-
-/usr/include/c++/14/bits/atomic_lockfree_defines.h:
-
-/usr/include/bits/pthreadtypes.h:
-
-/usr/include/c++/14/bits/basic_string.h:
-
-/usr/include/c++/14/clocale:
-
-/usr/include/c++/14/bits/basic_string.tcc:
-
-/usr/include/pthread.h:
-
-/usr/include/c++/14/bits/functexcept.h:
-
-/usr/include/c++/14/bits/concept_check.h:
-
-/usr/include/c++/14/bits/cpp_type_traits.h:
-
-/usr/include/c++/14/bits/exception_defines.h:
-
-/usr/include/c++/14/bits/char_traits.h:
-
-/usr/include/c++/14/bits/hash_bytes.h:
-
-/usr/include/bits/types/__locale_t.h:
-
-/usr/include/c++/14/bits/ios_base.h:
-
-/usr/include/c++/14/bits/locale_classes.tcc:
-
-third_party/uri/include/network/string_view.hpp:
-
-/usr/include/c++/14/backward/auto_ptr.h:
-
-/usr/include/bits/types/sigset_t.h:
-
-/usr/include/c++/14/bits/move.h:
-
-third_party/uri/src/detail/uri_resolve.cpp:
-
-/usr/include/c++/14/bits/memoryfwd.h:
-
-/usr/include/c++/14/bits/postypes.h:
-
-third_party/uri/src/detail/algorithm_split.hpp:
-
-/usr/include/c++/14/bits/refwrap.h:
-
-/usr/include/strings.h:
-
-/usr/include/c++/14/bits/requires_hosted.h:
-
-third_party/uri/src/detail/uri_normalize.cpp:
-
-/usr/include/c++/14/bits/std_abs.h:
-
-/usr/include/c++/14/bits/stl_algo.h:
-
-/usr/include/c++/14/functional:
-
-/usr/include/features.h:
-
-/usr/include/c++/14/iterator:
-
-/usr/include/bits/endianness.h:
-
-/usr/include/c++/14/bits/stl_heap.h:
-
-/usr/include/c++/14/ext/numeric_traits.h:
-
-/usr/include/bits/stdint-uintn.h:
-
-/usr/include/c++/14/bits/stl_iterator_base_funcs.h:
-
-/usr/include/bits/stdio.h:
-
-/usr/include/c++/14/bits/stl_iterator_base_types.h:
-
-/usr/include/c++/14/bits/stl_tempbuf.h:
-
-/usr/include/c++/14/bits/stream_iterator.h:
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
deleted file mode 100644
index ff025e0c9e..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/compiler_depend.ts
+++ /dev/null
@@ -1,2 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Timestamp file for compiler generated dependencies management for network-uri.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/depend.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/depend.make
deleted file mode 100644
index 2b4283de4b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/depend.make
+++ /dev/null
@@ -1,2 +0,0 @@
-# Empty dependencies file for network-uri.
-# This may be replaced when dependencies are built.
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
deleted file mode 100644
index 4a2ba07e4a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/flags.make
+++ /dev/null
@@ -1,10 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# compile CXX with /bin/c++
-CXX_DEFINES =
-
-CXX_INCLUDES = -I/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src -I/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/include
-
-CXX_FLAGS = -fPIE -D_FILE_OFFSET_BIS=64 -DUSEGC -DLSPCPP_USEGC -I../gc-8.2.4/include -std=c++11 -Wall -Werror -Wno-parentheses -O2 -g -DNDEBUG
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/link.txt b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/link.txt
deleted file mode 100644
index f804330c4f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/link.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin/ar qc libnetwork-uri.a "CMakeFiles/network-uri.dir/uri.cpp.o" "CMakeFiles/network-uri.dir/uri_builder.cpp.o" "CMakeFiles/network-uri.dir/uri_errors.cpp.o" "CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o" "CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o" "CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o" "CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o" "CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o"
-/bin/ranlib libnetwork-uri.a
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/progress.make b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/progress.make
deleted file mode 100644
index 03848ccb80..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/network-uri.dir/progress.make
+++ /dev/null
@@ -1,10 +0,0 @@
-CMAKE_PROGRESS_1 = 23
-CMAKE_PROGRESS_2 = 24
-CMAKE_PROGRESS_3 = 25
-CMAKE_PROGRESS_4 = 26
-CMAKE_PROGRESS_5 = 27
-CMAKE_PROGRESS_6 = 28
-CMAKE_PROGRESS_7 = 29
-CMAKE_PROGRESS_8 = 30
-CMAKE_PROGRESS_9 = 31
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/progress.marks b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/progress.marks
deleted file mode 100644
index ec635144f6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeFiles/progress.marks
+++ /dev/null
@@ -1 +0,0 @@
-9
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/src/CMakeLists.txt
deleted file mode 100644
index d7f387c213..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/CMakeLists.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-# Copyright (c) Glyn Matthews 2012-2016.
-# 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(Uri_SRCS
- ${CMAKE_CURRENT_SOURCE_DIR}/uri.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/uri_builder.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/uri_errors.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/detail/uri_parse.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/detail/uri_parse_authority.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/detail/uri_advance_parts.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/detail/uri_normalize.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/detail/uri_resolve.cpp
- )
-
-add_library(network-uri ${Uri_SRCS})
-target_link_libraries(network-uri)
-if(${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
- if (NOT Uri_DISABLE_LIBCXX)
- target_link_libraries(network-uri "c++")
- endif()
-endif()
-
-#propagate sources to parent scope for one-lib-build
-set(Uri_SRCS ${Uri_SRCS} PARENT_SCOPE)
-
-install(
- TARGETS network-uri
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
-)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/Makefile b/graphics/asymptote/LspCpp/third_party/uri/src/Makefile
deleted file mode 100644
index 716f14452d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/Makefile
+++ /dev/null
@@ -1,423 +0,0 @@
-# CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 3.28
-
-# Default target executed when no arguments are given to make.
-default_target: all
-.PHONY : default_target
-
-# Allow only one "make -f Makefile2" at a time, but pass parallelism.
-.NOTPARALLEL:
-
-#=============================================================================
-# Special targets provided by cmake.
-
-# Disable implicit rules so canonical targets will work.
-.SUFFIXES:
-
-# Disable VCS-based implicit rules.
-% : %,v
-
-# Disable VCS-based implicit rules.
-% : RCS/%
-
-# Disable VCS-based implicit rules.
-% : RCS/%,v
-
-# Disable VCS-based implicit rules.
-% : SCCS/s.%
-
-# Disable VCS-based implicit rules.
-% : s.%
-
-.SUFFIXES: .hpux_make_needs_suffix_list
-
-# Produce verbose output by default.
-VERBOSE = 1
-
-# Command-line flag to silence nested $(MAKE).
-$(VERBOSE)MAKESILENT = -s
-
-#Suppress display of executed commands.
-$(VERBOSE).SILENT:
-
-# A target that is always out of date.
-cmake_force:
-.PHONY : cmake_force
-
-#=============================================================================
-# Set environment variables for the build.
-
-# The shell in which to execute make rules.
-SHELL = /bin/sh
-
-# The CMake executable.
-CMAKE_COMMAND = /usr/bin/cmake
-
-# The command to remove a file.
-RM = /usr/bin/cmake -E rm -f
-
-# Escaping for special characters.
-EQUALS = =
-
-# The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-# The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /usr/local/src/asymptote-2.92/LspCpp
-
-#=============================================================================
-# Targets provided globally by CMake.
-
-# Special rule for the target edit_cache
-edit_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake cache editor..."
- /usr/bin/ccmake -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : edit_cache
-
-# Special rule for the target edit_cache
-edit_cache/fast: edit_cache
-.PHONY : edit_cache/fast
-
-# Special rule for the target rebuild_cache
-rebuild_cache:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Running CMake to regenerate build system..."
- /usr/bin/cmake --regenerate-during-build -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
-
-# Special rule for the target list_install_components
-list_install_components:
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Available install components are: \"Unspecified\""
-.PHONY : list_install_components
-
-# Special rule for the target list_install_components
-list_install_components/fast: list_install_components
-.PHONY : list_install_components/fast
-
-# Special rule for the target install
-install: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install
-
-# Special rule for the target install
-install/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Install the project..."
- /usr/bin/cmake -P cmake_install.cmake
-.PHONY : install/fast
-
-# Special rule for the target install/local
-install/local: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local
-
-# Special rule for the target install/local
-install/local/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing only the local directory..."
- /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local/fast
-
-# Special rule for the target install/strip
-install/strip: preinstall
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip
-
-# Special rule for the target install/strip
-install/strip/fast: preinstall/fast
- @$(CMAKE_COMMAND) -E cmake_echo_color "--switch=$(COLOR)" --cyan "Installing the project stripped..."
- /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip/fast
-
-# The main all target
-all: cmake_check_build_system
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.92/LspCpp/CMakeFiles /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src//CMakeFiles/progress.marks
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/all
- $(CMAKE_COMMAND) -E cmake_progress_start /usr/local/src/asymptote-2.92/LspCpp/CMakeFiles 0
-.PHONY : all
-
-# The main clean target
-clean:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/clean
-.PHONY : clean
-
-# The main clean target
-clean/fast: clean
-.PHONY : clean/fast
-
-# Prepare targets for installation.
-preinstall: all
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall
-.PHONY : preinstall
-
-# Prepare targets for installation.
-preinstall/fast:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/preinstall
-.PHONY : preinstall/fast
-
-# clear depends
-depend:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
-.PHONY : depend
-
-# Convenience name for target.
-third_party/uri/src/CMakeFiles/network-uri.dir/rule:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f CMakeFiles/Makefile2 third_party/uri/src/CMakeFiles/network-uri.dir/rule
-.PHONY : third_party/uri/src/CMakeFiles/network-uri.dir/rule
-
-# Convenience name for target.
-network-uri: third_party/uri/src/CMakeFiles/network-uri.dir/rule
-.PHONY : network-uri
-
-# fast build rule for target.
-network-uri/fast:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/build
-.PHONY : network-uri/fast
-
-detail/uri_advance_parts.o: detail/uri_advance_parts.cpp.o
-.PHONY : detail/uri_advance_parts.o
-
-# target to build an object file
-detail/uri_advance_parts.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.o
-.PHONY : detail/uri_advance_parts.cpp.o
-
-detail/uri_advance_parts.i: detail/uri_advance_parts.cpp.i
-.PHONY : detail/uri_advance_parts.i
-
-# target to preprocess a source file
-detail/uri_advance_parts.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.i
-.PHONY : detail/uri_advance_parts.cpp.i
-
-detail/uri_advance_parts.s: detail/uri_advance_parts.cpp.s
-.PHONY : detail/uri_advance_parts.s
-
-# target to generate assembly for a file
-detail/uri_advance_parts.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_advance_parts.cpp.s
-.PHONY : detail/uri_advance_parts.cpp.s
-
-detail/uri_normalize.o: detail/uri_normalize.cpp.o
-.PHONY : detail/uri_normalize.o
-
-# target to build an object file
-detail/uri_normalize.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.o
-.PHONY : detail/uri_normalize.cpp.o
-
-detail/uri_normalize.i: detail/uri_normalize.cpp.i
-.PHONY : detail/uri_normalize.i
-
-# target to preprocess a source file
-detail/uri_normalize.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.i
-.PHONY : detail/uri_normalize.cpp.i
-
-detail/uri_normalize.s: detail/uri_normalize.cpp.s
-.PHONY : detail/uri_normalize.s
-
-# target to generate assembly for a file
-detail/uri_normalize.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_normalize.cpp.s
-.PHONY : detail/uri_normalize.cpp.s
-
-detail/uri_parse.o: detail/uri_parse.cpp.o
-.PHONY : detail/uri_parse.o
-
-# target to build an object file
-detail/uri_parse.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.o
-.PHONY : detail/uri_parse.cpp.o
-
-detail/uri_parse.i: detail/uri_parse.cpp.i
-.PHONY : detail/uri_parse.i
-
-# target to preprocess a source file
-detail/uri_parse.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.i
-.PHONY : detail/uri_parse.cpp.i
-
-detail/uri_parse.s: detail/uri_parse.cpp.s
-.PHONY : detail/uri_parse.s
-
-# target to generate assembly for a file
-detail/uri_parse.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse.cpp.s
-.PHONY : detail/uri_parse.cpp.s
-
-detail/uri_parse_authority.o: detail/uri_parse_authority.cpp.o
-.PHONY : detail/uri_parse_authority.o
-
-# target to build an object file
-detail/uri_parse_authority.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.o
-.PHONY : detail/uri_parse_authority.cpp.o
-
-detail/uri_parse_authority.i: detail/uri_parse_authority.cpp.i
-.PHONY : detail/uri_parse_authority.i
-
-# target to preprocess a source file
-detail/uri_parse_authority.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.i
-.PHONY : detail/uri_parse_authority.cpp.i
-
-detail/uri_parse_authority.s: detail/uri_parse_authority.cpp.s
-.PHONY : detail/uri_parse_authority.s
-
-# target to generate assembly for a file
-detail/uri_parse_authority.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_parse_authority.cpp.s
-.PHONY : detail/uri_parse_authority.cpp.s
-
-detail/uri_resolve.o: detail/uri_resolve.cpp.o
-.PHONY : detail/uri_resolve.o
-
-# target to build an object file
-detail/uri_resolve.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.o
-.PHONY : detail/uri_resolve.cpp.o
-
-detail/uri_resolve.i: detail/uri_resolve.cpp.i
-.PHONY : detail/uri_resolve.i
-
-# target to preprocess a source file
-detail/uri_resolve.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.i
-.PHONY : detail/uri_resolve.cpp.i
-
-detail/uri_resolve.s: detail/uri_resolve.cpp.s
-.PHONY : detail/uri_resolve.s
-
-# target to generate assembly for a file
-detail/uri_resolve.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/detail/uri_resolve.cpp.s
-.PHONY : detail/uri_resolve.cpp.s
-
-uri.o: uri.cpp.o
-.PHONY : uri.o
-
-# target to build an object file
-uri.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.o
-.PHONY : uri.cpp.o
-
-uri.i: uri.cpp.i
-.PHONY : uri.i
-
-# target to preprocess a source file
-uri.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.i
-.PHONY : uri.cpp.i
-
-uri.s: uri.cpp.s
-.PHONY : uri.s
-
-# target to generate assembly for a file
-uri.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri.cpp.s
-.PHONY : uri.cpp.s
-
-uri_builder.o: uri_builder.cpp.o
-.PHONY : uri_builder.o
-
-# target to build an object file
-uri_builder.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.o
-.PHONY : uri_builder.cpp.o
-
-uri_builder.i: uri_builder.cpp.i
-.PHONY : uri_builder.i
-
-# target to preprocess a source file
-uri_builder.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.i
-.PHONY : uri_builder.cpp.i
-
-uri_builder.s: uri_builder.cpp.s
-.PHONY : uri_builder.s
-
-# target to generate assembly for a file
-uri_builder.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_builder.cpp.s
-.PHONY : uri_builder.cpp.s
-
-uri_errors.o: uri_errors.cpp.o
-.PHONY : uri_errors.o
-
-# target to build an object file
-uri_errors.cpp.o:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.o
-.PHONY : uri_errors.cpp.o
-
-uri_errors.i: uri_errors.cpp.i
-.PHONY : uri_errors.i
-
-# target to preprocess a source file
-uri_errors.cpp.i:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.i
-.PHONY : uri_errors.cpp.i
-
-uri_errors.s: uri_errors.cpp.s
-.PHONY : uri_errors.s
-
-# target to generate assembly for a file
-uri_errors.cpp.s:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(MAKE) $(MAKESILENT) -f third_party/uri/src/CMakeFiles/network-uri.dir/build.make third_party/uri/src/CMakeFiles/network-uri.dir/uri_errors.cpp.s
-.PHONY : uri_errors.cpp.s
-
-# Help Target
-help:
- @echo "The following are some of the valid targets for this Makefile:"
- @echo "... all (the default if no target is provided)"
- @echo "... clean"
- @echo "... depend"
- @echo "... edit_cache"
- @echo "... install"
- @echo "... install/local"
- @echo "... install/strip"
- @echo "... list_install_components"
- @echo "... rebuild_cache"
- @echo "... network-uri"
- @echo "... detail/uri_advance_parts.o"
- @echo "... detail/uri_advance_parts.i"
- @echo "... detail/uri_advance_parts.s"
- @echo "... detail/uri_normalize.o"
- @echo "... detail/uri_normalize.i"
- @echo "... detail/uri_normalize.s"
- @echo "... detail/uri_parse.o"
- @echo "... detail/uri_parse.i"
- @echo "... detail/uri_parse.s"
- @echo "... detail/uri_parse_authority.o"
- @echo "... detail/uri_parse_authority.i"
- @echo "... detail/uri_parse_authority.s"
- @echo "... detail/uri_resolve.o"
- @echo "... detail/uri_resolve.i"
- @echo "... detail/uri_resolve.s"
- @echo "... uri.o"
- @echo "... uri.i"
- @echo "... uri.s"
- @echo "... uri_builder.o"
- @echo "... uri_builder.i"
- @echo "... uri_builder.s"
- @echo "... uri_errors.o"
- @echo "... uri_errors.i"
- @echo "... uri_errors.s"
-.PHONY : help
-
-
-
-#=============================================================================
-# Special targets to cleanup operation of make.
-
-# Special rule to run CMake to check the build system integrity.
-# No rule that depends on this can have commands that come from listfiles
-# because they might be regenerated.
-cmake_check_build_system:
- cd /usr/local/src/asymptote-2.92/LspCpp && $(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
-.PHONY : cmake_check_build_system
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake b/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake
deleted file mode 100644
index 81be4eba9b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/cmake_install.cmake
+++ /dev/null
@@ -1,48 +0,0 @@
-# Install script for directory: /usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src
-
-# Set the install prefix
-if(NOT DEFINED CMAKE_INSTALL_PREFIX)
- set(CMAKE_INSTALL_PREFIX "/usr/local")
-endif()
-string(REGEX REPLACE "/$" "" CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
-
-# Set the install configuration name.
-if(NOT DEFINED CMAKE_INSTALL_CONFIG_NAME)
- if(BUILD_TYPE)
- string(REGEX REPLACE "^[^A-Za-z0-9_]+" ""
- CMAKE_INSTALL_CONFIG_NAME "${BUILD_TYPE}")
- else()
- set(CMAKE_INSTALL_CONFIG_NAME "RelWithDebInfo")
- endif()
- message(STATUS "Install configuration: \"${CMAKE_INSTALL_CONFIG_NAME}\"")
-endif()
-
-# Set the component getting installed.
-if(NOT CMAKE_INSTALL_COMPONENT)
- if(COMPONENT)
- message(STATUS "Install component: \"${COMPONENT}\"")
- set(CMAKE_INSTALL_COMPONENT "${COMPONENT}")
- else()
- set(CMAKE_INSTALL_COMPONENT)
- endif()
-endif()
-
-# Install shared libraries without execute permission?
-if(NOT DEFINED CMAKE_INSTALL_SO_NO_EXE)
- set(CMAKE_INSTALL_SO_NO_EXE "0")
-endif()
-
-# Is this installation the result of a crosscompile?
-if(NOT DEFINED CMAKE_CROSSCOMPILING)
- set(CMAKE_CROSSCOMPILING "FALSE")
-endif()
-
-# Set default install directory permissions.
-if(NOT DEFINED CMAKE_OBJDUMP)
- set(CMAKE_OBJDUMP "/bin/objdump")
-endif()
-
-if(CMAKE_INSTALL_COMPONENT STREQUAL "Unspecified" OR NOT CMAKE_INSTALL_COMPONENT)
- file(INSTALL DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" TYPE STATIC_LIBRARY FILES "/usr/local/src/asymptote-2.92/LspCpp/third_party/uri/src/libnetwork-uri.a")
-endif()
-
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm.hpp
deleted file mode 100644
index 6db27e4870..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_RANGE_INC
-#define NETWORK_DETAIL_RANGE_INC
-
-#include <algorithm>
-#include <iterator>
-#include <utility>
-#include <string>
-#include <cctype>
-#include <locale>
-
-namespace network {
-namespace detail {
-template <class Rng, class Pred>
-inline void for_each(Rng &rng, Pred &&pred) {
- std::for_each(std::begin(rng), std::end(rng), pred);
-}
-
-template <class Rng, class Iter, class Pred>
-inline void transform(Rng &rng, Iter out, Pred &&pred) {
- std::transform(std::begin(rng), std::end(rng), out, pred);
-}
-
-template <class Rng>
-inline typename Rng::difference_type distance(Rng &rng) {
- return std::distance(std::begin(rng), std::end(rng));
-}
-
-template <class Rng1, class Rng2>
-inline bool equal(const Rng1 &rng1, const Rng2 &rng2) {
- return std::equal(std::begin(rng1), std::end(rng1), std::begin(rng2));
-}
-
-template <class Rng, class Pred>
-inline void remove_erase_if(Rng &rng, Pred &&pred) {
- auto first = std::begin(rng), last = std::end(rng);
- auto it = std::remove_if(first, last, pred);
- rng.erase(it, last);
-}
-
-inline std::string trim_front(const std::string &str) {
- auto first = std::begin(str), last = std::end(str);
- auto it = std::find_if(
- first, last, [](char ch) { return !std::isspace(ch, std::locale()); });
- return std::string(it, last);
-}
-
-inline std::string trim_back(const std::string &str) {
- using reverse_iterator = std::reverse_iterator<std::string::const_iterator>;
-
- auto first = reverse_iterator(std::end(str)),
- last = reverse_iterator(std::begin(str));
- auto it = std::find_if(
- first, last, [](char ch) { return !std::isspace(ch, std::locale()); });
- std::string result(it, last);
- std::reverse(std::begin(result), std::end(result));
- return result;
-}
-
-inline std::string trim_copy(const std::string &str) {
- return trim_back(trim_front(str));
-}
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_RANGE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_find.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_find.hpp
deleted file mode 100644
index 4d8b99602b..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_find.hpp
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * Search algorithms
- * @author Lobaskin Vasily
- * @data 31 March 2020
- * @copyright Boost Software License, Version 1.0
- */
-
-#pragma once
-
-#include <cstddef>
-
-namespace network {
-namespace algorithm {
-
-template <typename IteratorBegT, typename IteratorEndT, typename RangeT>
-IteratorBegT find_nth(IteratorBegT iteratorBeg, IteratorEndT iteratorEnd,
- RangeT symbol, std::size_t pos) {
- static_assert(std::is_same<IteratorBegT, IteratorEndT>::value,
- "Iterator types are different");
-
- if (iteratorBeg > iteratorEnd) {
- std::swap(iteratorBeg, iteratorEnd);
- }
-
- std::size_t currentPos = -1;
- while (iteratorBeg != iteratorEnd) {
- if (*iteratorBeg == symbol) {
- ++currentPos;
- if (currentPos == pos) break;
- }
- ++iteratorBeg;
- }
-
- return iteratorBeg;
-}
-
-template <typename IteratorBegT, typename IteratorEndT, typename ConditionT>
-bool all(IteratorBegT iteratorBeg, IteratorEndT iteratorEnd,
- ConditionT &&condition) {
- static_assert(std::is_same<IteratorBegT, IteratorEndT>::value,
- "Iterator types are different");
-
- if (iteratorBeg > iteratorEnd) {
- std::swap(iteratorBeg, iteratorEnd);
- }
-
- while (iteratorBeg != iteratorEnd) {
- if (!condition(*iteratorBeg)) return false;
-
- ++iteratorBeg;
- }
-
- return true;
-}
-
-template <typename ContainerT, typename RangeT>
-typename ContainerT::iterator find_nth(ContainerT &str, RangeT symbol,
- std::size_t pos) {
- return algorithm::find_nth(str.begin(), str.end(), symbol, pos);
-}
-
-template <typename ContainerT, typename RangeT>
-typename ContainerT::iterator find_last(ContainerT &str, RangeT symbol) {
- auto iter = algorithm::find_nth(str.rbegin(), str.rend(), symbol, 0);
- if (iter == str.rend()) {
- return str.end();
- }
-
- return (++iter).base();
-}
-
-template <typename ContainerT, typename ConditionT>
-bool all(ContainerT const &container, ConditionT &&condition) {
- return all(container.cbegin(), container.cend(),
- std::forward<ConditionT>(condition));
-}
-
-} // namespace algorithm
-} // namespace network \ No newline at end of file
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_split.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_split.hpp
deleted file mode 100644
index d6de14543a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/algorithm_split.hpp
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Search algorithms
- * @author Lobaskin Vasily
- * @data 31 March 2020
- * @copyright Boost Software License, Version 1.0
- */
-
-#include <type_traits>
-
-namespace network {
-namespace algorithm {
-
-template <typename ContainerT, class SequenceT, typename SplitterT,
- typename std::enable_if<std::is_fundamental<SplitterT>::value>::type
- * = nullptr>
-bool split(ContainerT &container, SequenceT const &str, SplitterT symbol) {
- using PartT = typename ContainerT::value_type;
- static_assert(std::is_same<typename SequenceT::value_type, SplitterT>::value,
- "Splitter type doesn't match sequence inner type");
-
- std::size_t sequenceStart = 0;
- for (std::size_t i = 0, len = str.size(); i <= len; ++i) {
- if (str[i] != symbol && i != len) continue;
-
- std::size_t substrLen = i - sequenceStart;
- if (substrLen > 0) {
- PartT part{str.cbegin() + sequenceStart, str.cbegin() + i};
- container.emplace_back(std::move(part));
- } else {
- container.emplace_back(PartT{});
- }
- sequenceStart = i + 1;
- }
-
- return true;
-}
-
-template <typename ContainerT, class SequenceT, typename SplitterT,
- typename std::enable_if<!std::is_fundamental<SplitterT>::value>::type
- * = nullptr>
-bool split(ContainerT &container, SequenceT const &str, SplitterT splitter) {
- using PartT = typename ContainerT::value_type;
- static_assert(
- std::is_same<typename ContainerT::value_type, std::string>::value,
- "Invalid container type, only string is supported");
-
- bool isEqual = false;
- std::size_t sequenceLen = splitter.size();
- std::size_t sequenceStart = 0;
- for (std::size_t i = 0, len = str.size(); i <= len; ++i) {
- isEqual = true;
- for (std::size_t j = 0; j < sequenceLen; ++j) {
- if (str[i + j] != splitter[j]) {
- isEqual = false;
- break;
- }
- }
- if (!isEqual && i != len) continue;
-
- std::size_t substrLen = i - sequenceStart;
- if (substrLen > 0) {
- PartT part{str.cbegin() + sequenceStart, str.cbegin() + i};
- container.emplace_back(std::move(part));
- } else {
- container.emplace_back(PartT{});
- }
- sequenceStart = i + sequenceLen;
- i += sequenceLen - 1;
- }
-
- return true;
-}
-
-} // namespace algorithm
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/grammar.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/grammar.hpp
deleted file mode 100644
index 7630b4ca80..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/grammar.hpp
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_GRAMMAR_INC
-#define NETWORK_DETAIL_URI_GRAMMAR_INC
-
-#include <network/string_view.hpp>
-#include <cstdlib>
-#include <locale>
-#include <cstring>
-#include <string>
-
-namespace network {
-namespace detail {
-inline bool isalnum(string_view::const_iterator &it,
- string_view::const_iterator last) {
- if (it != last) {
- if (std::isalnum(*it, std::locale::classic())) {
- ++it;
- return true;
- }
- }
- return false;
-}
-
-inline bool isdigit(string_view::const_iterator &it,
- string_view::const_iterator last) {
- if (it != last) {
- if (std::isdigit(*it, std::locale::classic())) {
- ++it;
- return true;
- }
- }
- return false;
-}
-
-inline bool is_in(string_view::const_iterator &it,
- string_view::const_iterator last, const char *chars) {
- if (it != last) {
- auto length = std::strlen(chars);
- for (std::size_t i = 0; i < length; ++i) {
- if (*it == chars[i]) {
- ++it;
- return true;
- }
- }
- }
- return false;
-}
-
-inline bool is_sub_delim(string_view::const_iterator &it,
- string_view::const_iterator last) {
- return is_in(it, last, "!$&'()*+,;=");
-}
-
-inline bool is_ucschar(string_view::const_iterator &it,
- string_view::const_iterator last) {
- if (it == last) {
- return false;
- }
-
- return false;
-}
-
-inline bool is_private(string_view::const_iterator &it,
- string_view::const_iterator last) {
- return false;
-}
-
-inline bool is_unreserved(string_view::const_iterator &it,
- string_view::const_iterator last) {
- return isalnum(it, last) || is_in(it, last, "-._~");
-}
-
-inline bool is_pct_encoded(string_view::const_iterator &it,
- string_view::const_iterator last) {
- if (it == last) {
- return false;
- }
-
- string_view::const_iterator it_copy = it;
-
- if (*it_copy == '%') {
- ++it_copy;
- if (it_copy == last) {
- return false;
- }
- }
-
- if (std::isxdigit(*it_copy, std::locale::classic())) {
- ++it_copy;
- if (it_copy == last) {
- return false;
- }
- }
-
- if (std::isxdigit(*it_copy, std::locale::classic())) {
- ++it_copy;
- it = it_copy;
- return true;
- }
-
- return false;
-}
-
-inline bool is_pchar(string_view::const_iterator &it,
- string_view::const_iterator last) {
- return is_unreserved(it, last) || is_pct_encoded(it, last) ||
- is_sub_delim(it, last) || is_in(it, last, ":@") ||
- is_ucschar(it, last);
-}
-
-inline bool is_valid_port(string_view::const_iterator it) {
- const char *port_first = &(*it);
- char *port_last = 0;
- unsigned long value = std::strtoul(port_first, &port_last, 10);
- return (value < std::numeric_limits<unsigned short>::max());
-}
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_GRAMMAR_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp
deleted file mode 100644
index 7fe35a1c08..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2016-2017 Glyn Matthews.
-// 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)
-
-#include "uri_advance_parts.hpp"
-#include <iterator>
-#include <utility>
-#include <limits>
-
-namespace network_detail = network::detail;
-using network::string_view;
-using network::detail::uri_part;
-
-namespace {
-template <class Iterator>
-uri_part copy_part(Iterator first, Iterator last,
- string_view::const_iterator &it) {
- auto part_first = it;
- std::advance(it, std::distance(first, last));
- return network_detail::uri_part(part_first, it);
-}
-} // namespace
-
-uri_part network_detail::copy_part(const std::string &uri,
- string_view::const_iterator &it) {
- return ::copy_part(std::begin(uri), std::end(uri), it);
-}
-
-void network_detail::advance_parts(string_view uri_view, uri_parts &parts,
- const uri_parts &existing_parts) {
- auto first = std::begin(uri_view);
-
- auto it = first;
- if (auto scheme = existing_parts.scheme) {
- parts.scheme = ::copy_part(std::begin(*scheme), std::end(*scheme), it);
-
- // ignore : for all URIs
- if (*it == ':') {
- ++it;
- }
-
- // ignore // for hierarchical URIs
- if (existing_parts.hier_part.host) {
- std::advance(it, 2);
- }
- }
-
- if (auto user_info = existing_parts.hier_part.user_info) {
- parts.hier_part.user_info =
- ::copy_part(std::begin(*user_info), std::end(*user_info), it);
- ++it; // ignore @
- }
-
- if (auto host = existing_parts.hier_part.host) {
- parts.hier_part.host = ::copy_part(std::begin(*host), std::end(*host), it);
- }
-
- if (auto port = existing_parts.hier_part.port) {
- ++it; // ignore :
- parts.hier_part.port = ::copy_part(std::begin(*port), std::end(*port), it);
- }
-
- if (auto path = existing_parts.hier_part.path) {
- parts.hier_part.path = ::copy_part(std::begin(*path), std::end(*path), it);
- }
-
- if (auto query = existing_parts.query) {
- ++it; // ignore ?
- parts.query = ::copy_part(std::begin(*query), std::end(*query), it);
- }
-
- if (auto fragment = existing_parts.fragment) {
- ++it; // ignore #
- parts.fragment =
- ::copy_part(std::begin(*fragment), std::end(*fragment), it);
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp
deleted file mode 100644
index 6b3eb7e380..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_advance_parts.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_ADVANCE_INC
-#define NETWORK_DETAIL_URI_ADVANCE_INC
-
-#include <network/uri/detail/uri_parts.hpp>
-
-namespace network {
-namespace detail {
-uri_part copy_part(const std::string &part, string_view::const_iterator &it);
-
-void advance_parts(string_view uri_view, uri_parts &parts,
- const uri_parts &existing_parts);
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_ADVANCE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.cpp
deleted file mode 100644
index de8c4da610..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.cpp
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#include "uri_normalize.hpp"
-#include "uri_percent_encode.hpp"
-#include "algorithm.hpp"
-#include "algorithm_split.hpp"
-#include <iterator>
-#include <vector>
-
-using namespace network::algorithm;
-using network::string_view;
-using network::uri_comparison_level;
-namespace network_detail = network::detail;
-
-std::string network_detail::normalize_path_segments(string_view path) {
- std::string result;
-
- if (!path.empty()) {
- std::vector<std::string> path_segments;
- split(path_segments, path, '/');
-
- bool last_segment_is_slash = path_segments.back().empty();
- std::vector<std::string> normalized_segments;
- for (const auto &segment : path_segments) {
- if (segment.empty() || (segment == ".")) {
- continue;
- } else if (segment == "..") {
- if (normalized_segments.empty()) {
- throw uri_builder_error();
- }
- normalized_segments.pop_back();
- } else {
- normalized_segments.push_back(segment);
- }
- }
-
- for (const auto &segment : normalized_segments) {
- result += "/" + segment;
- }
-
- if (last_segment_is_slash) {
- result += "/";
- }
- }
-
- if (result.empty()) {
- result = "/";
- }
-
- return result;
-}
-
-std::string network_detail::normalize_path(string_view path,
- uri_comparison_level level) {
- auto result = path.to_string();
-
- if (uri_comparison_level::syntax_based == level) {
- // case normalization
- for_each(result, percent_encoded_to_upper<std::string>());
-
- // % encoding normalization
- result.erase(detail::decode_encoded_unreserved_chars(std::begin(result),
- std::end(result)),
- std::end(result));
-
- // % path segment normalization
- result = normalize_path_segments(result);
- }
-
- return result;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.hpp
deleted file mode 100644
index 3c2e03b11d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_normalize.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_NORMALIZE_INC
-#define NETWORK_DETAIL_NORMALIZE_INC
-
-#include <network/uri/uri.hpp>
-#include <network/string_view.hpp>
-
-namespace network {
-namespace detail {
-std::string normalize_path_segments(string_view path);
-
-std::string normalize_path(string_view path, uri_comparison_level level);
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_NORMALIZE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.cpp
deleted file mode 100644
index 7f771480db..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.cpp
+++ /dev/null
@@ -1,384 +0,0 @@
-// Copyright 2016-2017 Glyn Matthews.
-// 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)
-
-#include "uri_parse.hpp"
-#include <iterator>
-#include <limits>
-#include "grammar.hpp"
-#include <network/uri/detail/uri_parts.hpp>
-
-namespace network {
-namespace detail {
-namespace {
-enum class uri_state { scheme, hier_part, query, fragment };
-
-enum class hier_part_state {
- first_slash,
- second_slash,
- authority,
- host,
- host_ipv6,
- port,
- path
-};
-
-bool validate_scheme(string_view::const_iterator &it,
- string_view::const_iterator last) {
- if (it == last) {
- return false;
- }
-
- // The first character must be a letter
- if (!std::isalpha(*it, std::locale("C"))) {
- return false;
- }
- ++it;
-
- while (it != last) {
- if (*it == ':') {
- break;
- } else if (!isalnum(it, last) && !is_in(it, last, "+-.")) {
- return false;
- }
- }
-
- return true;
-}
-
-bool validate_user_info(string_view::const_iterator it,
- string_view::const_iterator last) {
- while (it != last) {
- if (!is_unreserved(it, last) && !is_pct_encoded(it, last) &&
- !is_sub_delim(it, last) && !is_in(it, last, ":")) {
- return false;
- }
- }
- return true;
-}
-
-bool set_host_and_port(string_view::const_iterator first,
- string_view::const_iterator last,
- string_view::const_iterator last_colon,
- uri_parts &parts) {
- if (first >= last_colon) {
- parts.hier_part.host = uri_part(first, last);
- } else {
- auto port_start = last_colon;
- ++port_start;
- parts.hier_part.host = uri_part(first, last_colon);
- if (!is_valid_port(port_start)) {
- return false;
- }
- parts.hier_part.port = uri_part(port_start, last);
- }
- return true;
-}
-
-bool validate_fragment(string_view::const_iterator &it,
- string_view::const_iterator last) {
- while (it != last) {
- if (!is_pchar(it, last) && !is_in(it, last, "?/")) {
- return false;
- }
- }
- return true;
-}
-} // namespace
-
-bool parse(string_view::const_iterator &it, string_view::const_iterator last,
- uri_parts &parts) {
- auto state = uri_state::scheme;
-
- auto first = it;
-
- if (it == last) {
- return false;
- }
-
- if (validate_scheme(it, last)) {
- parts.scheme = uri_part(first, it);
- // move past the scheme delimiter
- ++it;
- state = uri_state::hier_part;
- } else {
- return false;
- }
-
- // Hierarchical part
- auto hp_state = hier_part_state::first_slash;
- // this is used by the user_info/port
- auto last_colon = first;
- while (it != last) {
- if (hp_state == hier_part_state::first_slash) {
- if (*it == '/') {
- hp_state = hier_part_state::second_slash;
- // set the first iterator in case the second slash is not forthcoming
- first = it;
- ++it;
- continue;
- } else {
- hp_state = hier_part_state::path;
- first = it;
- }
- } else if (hp_state == hier_part_state::second_slash) {
- if (*it == '/') {
- hp_state = hier_part_state::authority;
- ++it;
- first = it;
- continue;
- } else {
- // it's a valid URI, and this is the beginning of the path
- hp_state = hier_part_state::path;
- }
- } else if (hp_state == hier_part_state::authority) {
- if (is_in(first, last, "@:")) {
- return false;
- }
-
- // reset the last colon
- if (first == it) {
- last_colon = first;
- }
-
- if (*it == '@') {
- if (!validate_user_info(first, it)) {
- return false;
- }
- parts.hier_part.user_info = uri_part(first, it);
- hp_state = hier_part_state::host;
- ++it;
- first = it;
-
- if (*first == '[') {
- // this is an IPv6 address
- hp_state = hier_part_state::host_ipv6;
- }
-
- continue;
- } else if (*it == '[') {
- // this is an IPv6 address
- hp_state = hier_part_state::host_ipv6;
- first = it;
- continue;
- } else if (*it == ':') {
- last_colon = it;
- } else if (*it == '/') {
- // we skipped right past the host and port, and are at the path.
- if (!set_host_and_port(first, it, last_colon, parts)) {
- return false;
- }
- hp_state = hier_part_state::path;
- first = it;
- continue;
- } else if (*it == '?') {
- // the path is empty, but valid, and the next part is the query
- if (!set_host_and_port(first, it, last_colon, parts)) {
- return false;
- }
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::query;
- ++it;
- first = it;
- break;
- } else if (*it == '#') {
- // the path is empty, but valid, and the next part is the fragment
- if (!set_host_and_port(first, it, last_colon, parts)) {
- return false;
- }
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::fragment;
- ++it;
- first = it;
- break;
- }
- } else if (hp_state == hier_part_state::host) {
- if (*first == ':') {
- return false;
- }
-
- if (*it == ':') {
- parts.hier_part.host = uri_part(first, it);
- hp_state = hier_part_state::port;
- ++it;
- first = it;
- continue;
- } else if (*it == '/') {
- parts.hier_part.host = uri_part(first, it);
- hp_state = hier_part_state::path;
- first = it;
- continue;
- } else if (*it == '?') {
- // the path is empty, but valid, and the next part is the query
- parts.hier_part.host = uri_part(first, it);
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::query;
- ++it;
- first = it;
- break;
- } else if (*it == '#') {
- // the path is empty, but valid, and the next part is the fragment
- parts.hier_part.host = uri_part(first, it);
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::fragment;
- ++it;
- first = it;
- break;
- }
- } else if (hp_state == hier_part_state::host_ipv6) {
- if (*first != '[') {
- return false;
- }
-
- if (*it == ']') {
- ++it;
- // Then test if the next part is a host, part, or the end of the file
- if (it == last) {
- break;
- } else if (*it == ':') {
- parts.hier_part.host = uri_part(first, it);
- hp_state = hier_part_state::port;
- ++it;
- first = it;
- } else if (*it == '/') {
- parts.hier_part.host = uri_part(first, it);
- hp_state = hier_part_state::path;
- first = it;
- } else if (*it == '?') {
- parts.hier_part.host = uri_part(first, it);
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::query;
- ++it;
- first = it;
- break;
- } else if (*it == '#') {
- parts.hier_part.host = uri_part(first, it);
- parts.hier_part.path = uri_part(it, it);
- state = uri_state::fragment;
- ++it;
- first = it;
- break;
- }
- continue;
- }
- } else if (hp_state == hier_part_state::port) {
- if (*first == '/') {
- // the port is empty, but valid
- if (!is_valid_port(first)) {
- return false;
- }
- parts.hier_part.port = uri_part(first, it);
-
- // the port isn't set, but the path is
- hp_state = hier_part_state::path;
- continue;
- }
-
- if (*it == '/') {
- if (!is_valid_port(first)) {
- return false;
- }
- parts.hier_part.port = uri_part(first, it);
- hp_state = hier_part_state::path;
- first = it;
- continue;
- } else if (!isdigit(it, last)) {
- return false;
- }
- continue;
- } else if (hp_state == hier_part_state::path) {
- if (*it == '?') {
- parts.hier_part.path = uri_part(first, it);
- // move past the query delimiter
- ++it;
- first = it;
- state = uri_state::query;
- break;
- } else if (*it == '#') {
- parts.hier_part.path = uri_part(first, it);
- // move past the fragment delimiter
- ++it;
- first = it;
- state = uri_state::fragment;
- break;
- }
-
- if (!is_pchar(it, last) && !is_in(it, last, "/")) {
- return false;
- } else {
- continue;
- }
- }
-
- ++it;
- }
-
- if (state == uri_state::query) {
- while (it != last) {
- if (!is_pchar(it, last) && !is_in(it, last, "?/")) {
- // If this is a fragment, keep going
- if (*it == '#') {
- parts.query = uri_part(first, it);
- // move past the fragment delimiter
- ++it;
- first = it;
- state = uri_state::fragment;
- break;
- } else {
- return false;
- }
- }
- }
- }
-
- if (state == uri_state::fragment) {
- if (!validate_fragment(it, last)) {
- return false;
- }
- }
-
- // we're done!
- if (state == uri_state::hier_part) {
- if (hp_state == hier_part_state::authority) {
- if (first == last) {
- return false;
- }
-
- if (!set_host_and_port(first, last, last_colon, parts)) {
- return false;
- }
- parts.hier_part.path = uri_part(last, last);
- } else if (hp_state == hier_part_state::host) {
- if (first == last) {
- return false;
- }
-
- if (!set_host_and_port(first, last, last_colon, parts)) {
- return false;
- }
- parts.hier_part.path = uri_part(last, last);
- } else if (hp_state == hier_part_state::host_ipv6) {
- if (!set_host_and_port(first, last, last_colon, parts)) {
- return false;
- }
- parts.hier_part.path = uri_part(last, last);
- } else if (hp_state == hier_part_state::port) {
- if (!is_valid_port(first)) {
- return false;
- }
- parts.hier_part.port = uri_part(first, last);
- parts.hier_part.path = uri_part(last, last);
- } else if (hp_state == hier_part_state::path) {
- parts.hier_part.path = uri_part(first, last);
- }
- } else if (state == uri_state::query) {
- parts.query = uri_part(first, last);
- } else if (state == uri_state::fragment) {
- parts.fragment = uri_part(first, last);
- }
-
- return true;
-}
-} // namespace detail
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.hpp
deleted file mode 100644
index 5eb5420bd3..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_PARSE_INC
-#define NETWORK_DETAIL_URI_PARSE_INC
-
-#include <network/string_view.hpp>
-
-namespace network {
-namespace detail {
-struct uri_parts;
-
-bool parse(string_view::const_iterator &first, string_view::const_iterator last,
- uri_parts &parts);
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_PARSE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp
deleted file mode 100644
index 29b7de7f68..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// 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)
-
-#include "uri_parse_authority.hpp"
-#include <cstdlib>
-#include <iterator>
-#include <limits>
-#include "grammar.hpp"
-
-namespace network {
-namespace detail {
-namespace {
-enum class authority_state { user_info, host, host_ipv6, port };
-} // namespace
-
-bool parse_authority(string_view::const_iterator &it,
- string_view::const_iterator last,
- optional<uri_part> &user_info, optional<uri_part> &host,
- optional<uri_part> &port) {
- auto first = it;
-
- auto state = authority_state::user_info;
- while (it != last) {
- if (state == authority_state::user_info) {
- if (is_in(first, last, "@:")) {
- return false;
- }
-
- if (*it == '@') {
- user_info = uri_part(first, it);
- state = authority_state::host;
- ++it;
- first = it;
- continue;
- } else if (*it == '[') {
- // this is an IPv6 address
- state = authority_state::host_ipv6;
- first = it;
- continue;
- } else if (*it == ':') {
- // this is actually the host, and the next part is expected to be the
- // port
- host = uri_part(first, it);
- state = authority_state::port;
- ++it;
- first = it;
- continue;
- }
- } else if (state == authority_state::host) {
- if (*first == ':') {
- return false;
- }
-
- if (*it == ':') {
- host = uri_part(first, it);
- state = authority_state::port;
- ++it;
- first = it;
- continue;
- }
- } else if (state == authority_state::host_ipv6) {
- if (*first != '[') {
- return false;
- }
-
- if (*it == ']') {
- host = uri_part(first, it);
- ++it;
- // Then test if the next part is a host, part, or the end of the file
- if (it == last) {
- break;
- } else if (*it == ':') {
- host = uri_part(first, it);
- state = authority_state::port;
- ++it;
- first = it;
- }
- }
- } else if (state == authority_state::port) {
- if (*first == '/') {
- // the port is empty, but valid
- port = uri_part(first, it);
- if (!is_valid_port(std::begin(*port))) {
- return false;
- }
-
- continue;
- }
-
- if (!isdigit(it, last)) {
- return false;
- }
- }
-
- ++it;
- }
-
- if (state == authority_state::user_info) {
- host = uri_part(first, last);
- } else if (state == authority_state::host) {
- host = uri_part(first, last);
- } else if (state == authority_state::host_ipv6) {
- host = uri_part(first, last);
- } else if (state == authority_state::port) {
- port = uri_part(first, last);
- if (!is_valid_port(std::begin(*port))) {
- return false;
- }
- }
-
- return true;
-}
-} // namespace detail
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp
deleted file mode 100644
index df1d7d5b18..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_parse_authority.hpp
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_PARSE_AUTHORITY_INC
-#define NETWORK_DETAIL_URI_PARSE_AUTHORITY_INC
-
-#include <network/uri/detail/uri_parts.hpp>
-
-namespace network {
-namespace detail {
-bool parse_authority(string_view::const_iterator &first,
- string_view::const_iterator last,
- optional<uri_part> &user_info, optional<uri_part> &host,
- optional<uri_part> &port);
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_PARSE_AUTHORITY_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp
deleted file mode 100644
index 0f39a4723d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_percent_encode.hpp
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#ifndef NETWORK_DETAIL_URI_PERCENT_ENCODE_INC
-#define NETWORK_DETAIL_URI_PERCENT_ENCODE_INC
-
-#include <string>
-#include <vector>
-#include <locale>
-#include <network/optional.hpp>
-#include <network/uri/detail/decode.hpp>
-
-namespace network {
-namespace detail {
-
-inline optional<char> percent_encode(std::string::const_iterator it) {
- try {
- char output = '\0';
- detail::decode_char(it, &output);
- return output;
- } catch (percent_decoding_error &) {
- return optional<char>();
- }
-}
-
-template <class String>
-struct percent_encoded_to_upper {
- percent_encoded_to_upper() : count(0) {}
-
- void operator()(typename String::value_type &c) {
- if (c == '%') {
- count = 2;
- } else if (count > 0) {
- c = std::toupper(c, std::locale());
- --count;
- }
- }
-
- unsigned count;
-};
-
-template <class Iter>
-Iter decode_encoded_unreserved_chars(Iter first, Iter last) {
- // unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
- // clang-format off
- const auto is_unreserved = [](char c) {
- return std::isalnum(c, std::locale())
- || '-' == c
- || '.' == c
- || '_' == c
- || '~' == c;
- };
- // clang-format on
-
- auto it = first, it2 = first;
- while (it != last) {
- if (*it == '%') {
- const auto sfirst = it;
- const auto opt_char = percent_encode(sfirst);
- if (opt_char && is_unreserved(*opt_char)) {
- *it2 = *opt_char;
- ++it;
- ++it;
- } else {
- *it2 = *it;
- }
- } else {
- *it2 = *it;
- }
- ++it;
- ++it2;
- }
- return it2;
-}
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_URI_PERCENT_ENCODE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.cpp
deleted file mode 100644
index 024ee12603..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// Copyright 2013 Hannes Kamecke.
-// 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)
-
-#include "uri_resolve.hpp"
-#include "algorithm_find.hpp"
-
-using namespace network::algorithm;
-using network::uri;
-using network::string_view;
-namespace network_detail = network::detail;
-
-namespace {
-
-// remove_dot_segments
-inline void remove_last_segment(std::string &path) {
- while (!path.empty()) {
- if (path.back() == '/') {
- path.pop_back();
- break;
- }
- path.pop_back();
- }
-}
-
-inline bool starts_with(std::string const &str, const char *range) {
- return str.find(range) == 0;
-}
-
-// implementation of http://tools.ietf.org/html/rfc3986#section-5.2.4
-static std::string remove_dot_segments(std::string input) {
- std::string result;
-
- while (!input.empty()) {
- if (starts_with(input, "../")) {
- input.erase(0, 3);
- } else if (starts_with(input, "./")) {
- input.erase(0, 2);
- } else if (starts_with(input, "/./")) {
- input.erase(0, 2);
- input.front() = '/';
- } else if (input == "/.") {
- input.erase(0, 1);
- input.front() = '/';
- } else if (starts_with(input, "/../")) {
- input.erase(0, 3);
- remove_last_segment(result);
- } else if (starts_with(input, "/..")) {
- input.erase(0, 2);
- input.front() = '/';
- remove_last_segment(result);
- } else if (all(input, [](char ch) { return ch == '.'; })) {
- input.clear();
- } else {
- int n = (input.front() == '/') ? 1 : 0;
- std::string::iterator slash = find_nth(input, '/', n);
- result.append(std::begin(input), slash);
- input.erase(std::begin(input), slash);
- }
- }
- return result;
-}
-
-} // namespace
-
-std::string network_detail::remove_dot_segments(string_view path) {
- return ::remove_dot_segments(path.to_string());
-}
-
-// implementation of http://tools.ietf.org/html/rfc3986#section-5.2.3
-std::string network_detail::merge_paths(const uri &base, const uri &reference) {
- std::string result;
-
- if (!base.has_path() || base.path().empty()) {
- result = "/";
- } else {
- const auto &base_path = base.path();
- auto last_slash = algorithm::find_last(base_path, '/');
- if (last_slash != base_path.cend()) ++last_slash;
- result.append(std::begin(base_path), last_slash);
- }
- if (reference.has_path()) {
- result.append(reference.path().to_string());
- }
- return remove_dot_segments(string_view(result));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.hpp b/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.hpp
deleted file mode 100644
index 898c6d5423..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/detail/uri_resolve.hpp
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// Copyright 2013 Hannes Kamecke.
-// 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)
-
-#ifndef NETWORK_DETAIL_RESOLVE_INC
-#define NETWORK_DETAIL_RESOLVE_INC
-
-#include <network/uri/uri.hpp>
-
-namespace network {
-namespace detail {
-// implementation of http://tools.ietf.org/html/rfc3986#section-5.2.4
-std::string remove_dot_segments(string_view input);
-
-// implementation of http://tools.ietf.org/html/rfc3986#section-5.2.3
-std::string merge_paths(const uri &base, const uri &reference);
-} // namespace detail
-} // namespace network
-
-#endif // NETWORK_DETAIL_RESOLVE_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/uri.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/uri.cpp
deleted file mode 100644
index b4b7188822..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/uri.cpp
+++ /dev/null
@@ -1,695 +0,0 @@
-// Copyright 2012-2017 Glyn Matthews.
-// Copyright 2012 Google, Inc.
-// 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)
-
-#include <cassert>
-#include <locale>
-#include <algorithm>
-#include <functional>
-#include "network/uri/uri.hpp"
-#include "detail/uri_parse.hpp"
-#include "detail/uri_advance_parts.hpp"
-#include "detail/uri_percent_encode.hpp"
-#include "detail/uri_normalize.hpp"
-#include "detail/uri_resolve.hpp"
-#include "detail/algorithm.hpp"
-
-namespace network {
-namespace {
-// With the parser, we use string_views, which are mutable. However,
-// there are times (e.g. during normalization), when we want a part
-// to be mutable. This function returns a pair of
-// std::string::iterators in the same range as the URI part.
-//
-inline std::pair<std::string::iterator, std::string::iterator> mutable_part(
- std::string &str, detail::uri_part part) {
- auto view = string_view(str);
-
- auto first_index = std::distance(std::begin(view), std::begin(part));
- auto first = std::begin(str);
- std::advance(first, first_index);
-
- auto last_index = std::distance(std::begin(view), std::end(part));
- auto last = std::begin(str);
- std::advance(last, last_index);
-
- return std::make_pair(first, last);
-}
-
-// This is a convenience function that converts a part of a
-// std::string to a string_view.
-inline string_view to_string_view(const std::string &uri,
- detail::uri_part part) {
- if (!part.empty()) {
- const char *c_str = uri.c_str();
- const char *part_begin = &(*(std::begin(part)));
- std::advance(c_str, std::distance(c_str, part_begin));
- return string_view(c_str, std::distance(std::begin(part), std::end(part)));
- }
- return string_view();
-}
-
-inline optional<std::string> make_arg(optional<string_view> view) {
- if (view) {
- return view->to_string();
- }
- return nullopt;
-}
-
-template <class T>
-inline void ignore(T) {}
-} // namespace
-
-void uri::initialize(optional<string_type> scheme,
- optional<string_type> user_info,
- optional<string_type> host, optional<string_type> port,
- optional<string_type> path, optional<string_type> query,
- optional<string_type> fragment) {
- if (scheme) {
- uri_.append(*scheme);
- }
-
- if (user_info || host || port) {
- if (scheme) {
- uri_.append("://");
- }
-
- if (user_info) {
- uri_.append(*user_info);
- uri_.append("@");
- }
-
- if (host) {
- uri_.append(*host);
- } else {
- throw uri_builder_error();
- }
-
- if (port) {
- uri_.append(":");
- uri_.append(*port);
- }
- } else {
- if (scheme) {
- if (path || query || fragment) {
- uri_.append(":");
- } else {
- throw uri_builder_error();
- }
- }
- }
-
- if (path) {
- // if the URI is not opaque and the path is not already prefixed
- // with a '/', add one.
- if (host && (!path->empty() && path->front() != '/')) {
- path = "/" + *path;
- }
- uri_.append(*path);
- }
-
- if (query) {
- uri_.append("?");
- uri_.append(*query);
- }
-
- if (fragment) {
- uri_.append("#");
- uri_.append(*fragment);
- }
-
- uri_view_ = string_view(uri_);
-
- auto it = std::begin(uri_view_);
- if (scheme) {
- uri_parts_.scheme = detail::copy_part(*scheme, it);
- // ignore : and ://
- if (*it == ':') {
- ++it;
- }
- if (*it == '/' && *(it + 1) == '/') {
- it += 2;
- }
- }
-
- if (user_info) {
- uri_parts_.hier_part.user_info = detail::copy_part(*user_info, it);
- ++it; // ignore @
- }
-
- if (host) {
- uri_parts_.hier_part.host = detail::copy_part(*host, it);
- }
-
- if (port) {
- ++it; // ignore :
- uri_parts_.hier_part.port = detail::copy_part(*port, it);
- }
-
- if (path) {
- uri_parts_.hier_part.path = detail::copy_part(*path, it);
- }
-
- if (query) {
- ++it; // ignore ?
- uri_parts_.query = detail::copy_part(*query, it);
- }
-
- if (fragment) {
- ++it; // ignore #
- uri_parts_.fragment = detail::copy_part(*fragment, it);
- }
-}
-
-uri::uri() : uri_view_(uri_) {}
-
-uri::uri(const uri &other) : uri_(other.uri_), uri_view_(uri_) {
- detail::advance_parts(uri_view_, uri_parts_, other.uri_parts_);
-}
-
-uri::uri(const uri_builder &builder) {
- initialize(builder.scheme_, builder.user_info_, builder.host_, builder.port_,
- builder.path_, builder.query_, builder.fragment_);
-}
-
-uri::uri(uri &&other) noexcept
- : uri_(std::move(other.uri_)),
- uri_view_(uri_),
- uri_parts_(std::move(other.uri_parts_)) {
- detail::advance_parts(uri_view_, uri_parts_, other.uri_parts_);
- other.uri_.clear();
- other.uri_view_ = string_view(other.uri_);
- other.uri_parts_ = detail::uri_parts();
-}
-
-uri::~uri() {}
-
-uri &uri::operator=(uri other) {
- other.swap(*this);
- return *this;
-}
-
-void uri::swap(uri &other) noexcept {
- uri_.swap(other.uri_);
- uri_view_ = uri_;
- other.uri_view_ = other.uri_;
-
- const auto this_parts = uri_parts_;
- uri_parts_.clear();
- detail::advance_parts(uri_view_, uri_parts_, other.uri_parts_);
- other.uri_parts_.clear();
- detail::advance_parts(other.uri_view_, other.uri_parts_, this_parts);
-}
-
-uri::const_iterator uri::begin() const noexcept { return uri_view_.begin(); }
-
-uri::const_iterator uri::end() const noexcept { return uri_view_.end(); }
-
-bool uri::has_scheme() const noexcept {
- return static_cast<bool>(uri_parts_.scheme);
-}
-
-uri::string_view uri::scheme() const noexcept {
- return has_scheme() ? to_string_view(uri_, *uri_parts_.scheme)
- : string_view{};
-}
-
-bool uri::has_user_info() const noexcept {
- return static_cast<bool>(uri_parts_.hier_part.user_info);
-}
-
-uri::string_view uri::user_info() const noexcept {
- return has_user_info() ? to_string_view(uri_, *uri_parts_.hier_part.user_info)
- : string_view{};
-}
-
-bool uri::has_host() const noexcept {
- return static_cast<bool>(uri_parts_.hier_part.host);
-}
-
-uri::string_view uri::host() const noexcept {
- return has_host() ? to_string_view(uri_, *uri_parts_.hier_part.host)
- : string_view{};
-}
-
-bool uri::has_port() const noexcept {
- return static_cast<bool>(uri_parts_.hier_part.port);
-}
-
-uri::string_view uri::port() const noexcept {
- return has_port() ? to_string_view(uri_, *uri_parts_.hier_part.port)
- : string_view{};
-}
-
-bool uri::has_path() const noexcept {
- return static_cast<bool>(uri_parts_.hier_part.path);
-}
-
-uri::string_view uri::path() const noexcept {
- return has_path() ? to_string_view(uri_, *uri_parts_.hier_part.path)
- : string_view{};
-}
-
-bool uri::has_query() const noexcept {
- return static_cast<bool>(uri_parts_.query);
-}
-
-uri::string_view uri::query() const noexcept {
- return has_query() ? to_string_view(uri_, *uri_parts_.query) : string_view{};
-}
-
-uri::query_iterator::query_iterator() : query_{}, kvp_{} {}
-
-uri::query_iterator::query_iterator(optional<detail::uri_part> query)
- : query_(query), kvp_{} {
- if (query_ && query_->empty()) {
- query_ = nullopt;
- } else {
- assign_kvp();
- }
-}
-
-uri::query_iterator::query_iterator(const query_iterator &other)
- : query_(other.query_), kvp_(other.kvp_) {}
-
-uri::query_iterator &uri::query_iterator::operator=(
- const query_iterator &other) {
- auto tmp(other);
- swap(tmp);
- return *this;
-}
-
-uri::query_iterator::reference uri::query_iterator::operator++() noexcept {
- increment();
- return kvp_;
-}
-
-uri::query_iterator::value_type uri::query_iterator::operator++(int) noexcept {
- auto original = kvp_;
- increment();
- return original;
-}
-
-uri::query_iterator::reference uri::query_iterator::operator*() const noexcept {
- return kvp_;
-}
-
-uri::query_iterator::pointer uri::query_iterator::operator->() const noexcept {
- return std::addressof(kvp_);
-}
-
-bool uri::query_iterator::operator==(const query_iterator &other) const
- noexcept {
- if (!query_ && !other.query_) {
- return true;
- } else if (query_ && other.query_) {
- // since we're comparing substrings, the address of the first
- // element in each iterator must be the same
- return std::addressof(kvp_.first) == std::addressof(other.kvp_.first);
- }
- return false;
-}
-
-void uri::query_iterator::swap(query_iterator &other) noexcept {
- std::swap(query_, other.query_);
- std::swap(kvp_, other.kvp_);
-}
-
-void uri::query_iterator::advance_to_next_kvp() noexcept {
- auto first = std::begin(*query_), last = std::end(*query_);
-
- auto sep_it = std::find_if(
- first, last, [](char c) -> bool { return c == '&' || c == ';'; });
-
- if (sep_it != last) {
- ++sep_it; // skip next separator
- }
-
- // reassign query to the next element
- query_ = detail::uri_part(sep_it, last);
-}
-
-void uri::query_iterator::assign_kvp() noexcept {
- auto first = std::begin(*query_), last = std::end(*query_);
-
- auto sep_it = std::find_if(
- first, last, [](char c) -> bool { return c == '&' || c == ';'; });
- auto eq_it =
- std::find_if(first, sep_it, [](char c) -> bool { return c == '='; });
-
- kvp_.first = string_view(std::addressof(*first), std::distance(first, eq_it));
- if (eq_it != sep_it) {
- ++eq_it; // skip '=' symbol
- }
- kvp_.second =
- string_view(std::addressof(*eq_it), std::distance(eq_it, sep_it));
-}
-
-void uri::query_iterator::increment() noexcept {
- assert(query_);
-
- if (!query_->empty()) {
- advance_to_next_kvp();
- assign_kvp();
- }
-
- if (query_->empty()) {
- query_ = nullopt;
- }
-}
-
-uri::query_iterator uri::query_begin() const noexcept {
- return has_query() ? uri::query_iterator{uri_parts_.query}
- : uri::query_iterator{};
-}
-
-uri::query_iterator uri::query_end() const noexcept {
- return uri::query_iterator{};
-}
-
-bool uri::has_fragment() const noexcept {
- return static_cast<bool>(uri_parts_.fragment);
-}
-
-uri::string_view uri::fragment() const noexcept {
- return has_fragment() ? to_string_view(uri_, *uri_parts_.fragment)
- : string_view{};
-}
-
-bool uri::has_authority() const noexcept { return has_host(); }
-
-uri::string_view uri::authority() const noexcept {
- if (!has_host()) {
- return string_view{};
- }
-
- auto host = this->host();
-
- auto user_info = string_view{};
- if (has_user_info()) {
- user_info = this->user_info();
- }
-
- auto port = string_view{};
- if (has_port()) {
- port = this->port();
- }
-
- auto first = std::begin(host), last = std::end(host);
- if (has_user_info() && !user_info.empty()) {
- first = std::begin(user_info);
- } else if (host.empty() && has_port() && !port.empty()) {
- first = std::begin(port);
- --first; // include ':' before port
- }
-
- if (host.empty()) {
- if (has_port() && !port.empty()) {
- last = std::end(port);
- } else if (has_user_info() && !user_info.empty()) {
- last = std::end(user_info);
- ++last; // include '@'
- }
- } else if (has_port()) {
- if (port.empty()) {
- ++last; // include ':' after host
- } else {
- last = std::end(port);
- }
- }
-
- return string_view(first, std::distance(first, last));
-}
-
-std::string uri::string() const { return uri_; }
-
-std::wstring uri::wstring() const {
- return std::wstring(std::begin(*this), std::end(*this));
-}
-
-std::u16string uri::u16string() const {
- return std::u16string(std::begin(*this), std::end(*this));
-}
-
-std::u32string uri::u32string() const {
- return std::u32string(std::begin(*this), std::end(*this));
-}
-
-uri::string_view uri::view() const noexcept { return uri_view_; }
-
-bool uri::empty() const noexcept { return uri_.empty(); }
-
-bool uri::is_absolute() const noexcept { return has_scheme(); }
-
-bool uri::is_opaque() const noexcept {
- return (is_absolute() && !has_authority());
-}
-
-uri uri::normalize(uri_comparison_level level) const {
- string_type normalized(uri_);
- string_view normalized_view(normalized);
- detail::uri_parts parts;
- detail::advance_parts(normalized_view, parts, uri_parts_);
-
- if (uri_comparison_level::syntax_based == level) {
- // All alphabetic characters in the scheme and host are
- // lower-case...
- if (parts.scheme) {
- std::string::iterator first, last;
- std::tie(first, last) = mutable_part(normalized, *parts.scheme);
- std::transform(first, last, first,
- [](char ch) { return std::tolower(ch, std::locale()); });
- }
-
- // if (parts.hier_part.host) {
- // std::string::iterator first, last;
- // std::tie(first, last) = mutable_part(normalized,
- // *parts.hier_part.host); std::transform(first, last, first,
- // [](char ch) { return std::tolower(ch, std::locale());
- // });
- // }
-
- // ...except when used in percent encoding
- detail::for_each(normalized,
- detail::percent_encoded_to_upper<std::string>());
-
- // parts are invalidated here
- // there's got to be a better way of doing this that doesn't
- // mean parsing again (twice!)
- normalized.erase(detail::decode_encoded_unreserved_chars(
- std::begin(normalized), std::end(normalized)),
- std::end(normalized));
- normalized_view = string_view(normalized);
-
- // need to parse the parts again as the underlying string has changed
- const_iterator it = std::begin(normalized_view),
- last = std::end(normalized_view);
- bool is_valid = detail::parse(it, last, parts);
- ignore(is_valid);
- assert(is_valid);
-
- if (parts.hier_part.path) {
- uri::string_type path = detail::normalize_path_segments(
- to_string_view(normalized, *parts.hier_part.path));
-
- // put the normalized path back into the uri
- optional<string_type> query, fragment;
- if (parts.query) {
- query = parts.query->to_string();
- }
-
- if (parts.fragment) {
- fragment = parts.fragment->to_string();
- }
-
- auto path_begin = std::begin(normalized);
- auto path_range = mutable_part(normalized, *parts.hier_part.path);
- std::advance(path_begin, std::distance(path_begin, path_range.first));
- normalized.erase(path_begin, std::end(normalized));
- normalized.append(path);
-
- if (query) {
- normalized.append("?");
- normalized.append(*query);
- }
-
- if (fragment) {
- normalized.append("#");
- normalized.append(*fragment);
- }
- }
- }
-
- return uri(normalized);
-}
-
-uri uri::make_relative(const uri &other) const {
- if (is_opaque() || other.is_opaque()) {
- return other;
- }
-
- if ((!has_scheme() || !other.has_scheme()) ||
- !detail::equal(scheme(), other.scheme())) {
- return other;
- }
-
- if ((!has_authority() || !other.has_authority()) ||
- !detail::equal(authority(), other.authority())) {
- return other;
- }
-
- if (!has_path() || !other.has_path()) {
- return other;
- }
-
- auto path =
- detail::normalize_path(this->path(), uri_comparison_level::syntax_based);
- auto other_path =
- detail::normalize_path(other.path(), uri_comparison_level::syntax_based);
-
- optional<string_type> query, fragment;
- if (other.has_query()) {
- query = other.query().to_string();
- }
-
- if (other.has_fragment()) {
- fragment = other.fragment().to_string();
- }
-
- network::uri result;
- result.initialize(optional<string_type>(), optional<string_type>(),
- optional<string_type>(), optional<string_type>(),
- other_path, query, fragment);
- return result;
-}
-
-uri uri::resolve(const uri &base) const {
- // This implementation uses the psuedo-code given in
- // http://tools.ietf.org/html/rfc3986#section-5.2.2
-
- if (is_absolute() && !is_opaque()) {
- // throw an exception ?
- return *this;
- }
-
- if (is_opaque()) {
- // throw an exception ?
- return *this;
- }
-
- optional<uri::string_type> user_info, host, port, path, query, fragment;
-
- if (has_authority()) {
- // g -> http://g
- if (has_user_info()) {
- user_info = make_arg(this->user_info());
- }
-
- if (has_host()) {
- host = make_arg(this->host());
- }
-
- if (has_port()) {
- port = make_arg(this->port());
- }
-
- if (has_path()) {
- path = detail::remove_dot_segments(this->path());
- }
-
- if (has_query()) {
- query = make_arg(this->query());
- }
- } else {
- if (!has_path() || this->path().empty()) {
- if (base.has_path()) {
- path = make_arg(base.path());
- }
-
- if (has_query()) {
- query = make_arg(this->query());
- } else if (base.has_query()) {
- query = make_arg(base.query());
- }
- } else {
- if (this->path().front() == '/') {
- path = detail::remove_dot_segments(this->path());
- } else {
- path = detail::merge_paths(base, *this);
- }
-
- if (has_query()) {
- query = make_arg(this->query());
- }
- }
-
- if (base.has_user_info()) {
- user_info = make_arg(base.user_info());
- }
-
- if (base.has_host()) {
- host = make_arg(base.host());
- }
-
- if (base.has_port()) {
- port = make_arg(base.port());
- }
- }
-
- if (has_fragment()) {
- fragment = make_arg(this->fragment());
- }
-
- network::uri result;
- result.initialize(make_arg(base.scheme()), std::move(user_info),
- std::move(host), std::move(port), std::move(path),
- std::move(query), std::move(fragment));
- return result;
-}
-
-int uri::compare(const uri &other, uri_comparison_level level) const noexcept {
- // if both URIs are empty, then we should define them as equal
- // even though they're still invalid.
- if (empty() && other.empty()) {
- return 0;
- }
-
- if (empty()) {
- return -1;
- }
-
- if (other.empty()) {
- return 1;
- }
-
- return normalize(level).uri_.compare(other.normalize(level).uri_);
-}
-
-bool uri::initialize(const string_type &uri) {
- uri_ = detail::trim_copy(uri);
- if (!uri_.empty()) {
- uri_view_ = string_view(uri_);
- const_iterator it = std::begin(uri_view_), last = std::end(uri_view_);
- bool is_valid = detail::parse(it, last, uri_parts_);
- return is_valid;
- }
- return true;
-}
-
-void swap(uri &lhs, uri &rhs) noexcept { lhs.swap(rhs); }
-
-bool operator==(const uri &lhs, const uri &rhs) noexcept {
- return lhs.view() == rhs.view();
-}
-
-bool operator==(const uri &lhs, const char *rhs) noexcept {
- return lhs.view() == string_view{rhs};
-}
-
-bool operator<(const uri &lhs, const uri &rhs) noexcept {
- return lhs.view() < rhs.view();
-}
-
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/uri_builder.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/uri_builder.cpp
deleted file mode 100644
index e47e8acb44..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/uri_builder.cpp
+++ /dev/null
@@ -1,151 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// 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)
-
-#include <locale>
-#include "network/uri/uri_builder.hpp"
-#include "detail/uri_normalize.hpp"
-#include "detail/uri_parse_authority.hpp"
-#include "detail/algorithm.hpp"
-
-namespace network {
-uri_builder::uri_builder(const network::uri &base_uri) {
- if (base_uri.has_scheme()) {
- scheme_ = base_uri.scheme().to_string();
- }
-
- if (base_uri.has_user_info()) {
- user_info_ = base_uri.user_info().to_string();
- }
-
- if (base_uri.has_host()) {
- host_ = base_uri.host().to_string();
- }
-
- if (base_uri.has_port()) {
- port_ = base_uri.port().to_string();
- }
-
- if (base_uri.has_path()) {
- path_ = base_uri.path().to_string();
- }
-
- if (base_uri.has_query()) {
- query_ = base_uri.query().to_string();
- }
-
- if (base_uri.has_fragment()) {
- fragment_ = base_uri.fragment().to_string();
- }
-}
-
-uri_builder::~uri_builder() noexcept {}
-
-network::uri uri_builder::uri() const { return network::uri(*this); }
-
-void uri_builder::set_scheme(string_type &&scheme) {
- // validate scheme is valid and normalize
- scheme_ = scheme;
- detail::transform(*scheme_, std::begin(*scheme_),
- [](char ch) { return std::tolower(ch, std::locale()); });
-}
-
-void uri_builder::set_user_info(string_type &&user_info) {
- user_info_ = string_type();
- network::uri::encode_user_info(std::begin(user_info), std::end(user_info),
- std::back_inserter(*user_info_));
-}
-
-uri_builder &uri_builder::clear_user_info() {
- user_info_ = network::nullopt;
- return *this;
-}
-
-void uri_builder::set_host(string_type &&host) {
- host_ = string_type();
- network::uri::encode_host(std::begin(host), std::end(host),
- std::back_inserter(*host_));
- detail::transform(*host_, std::begin(*host_),
- [](char ch) { return std::tolower(ch, std::locale()); });
-}
-
-void uri_builder::set_port(string_type &&port) {
- port_ = string_type();
- network::uri::encode_port(std::begin(port), std::end(port),
- std::back_inserter(*port_));
-}
-
-uri_builder &uri_builder::clear_port() {
- port_ = network::nullopt;
- return *this;
-}
-
-void uri_builder::set_authority(string_type &&authority) {
- optional<detail::uri_part> user_info, host, port;
- uri::string_view view(authority);
- uri::const_iterator it = std::begin(view), last = std::end(view);
- detail::parse_authority(it, last, user_info, host, port);
-
- if (user_info) {
- set_user_info(user_info->to_string());
- }
-
- if (host) {
- set_host(host->to_string());
- }
-
- if (port) {
- set_port(port->to_string());
- }
-}
-
-void uri_builder::set_path(string_type &&path) {
- path_ = string_type();
- network::uri::encode_path(std::begin(path), std::end(path),
- std::back_inserter(*path_));
-}
-
-uri_builder &uri_builder::clear_path() {
- path_ = network::nullopt;
- return *this;
-}
-
-void uri_builder::append_query_component(string_type &&name) {
- if (!query_) {
- query_ = string_type();
- } else {
- query_->append("&");
- }
- network::uri::encode_query_component(std::begin(name), std::end(name),
- std::back_inserter(*query_));
-}
-
-void uri_builder::append_query_key_value_pair(string_type &&key,
- string_type &&value) {
- if (!query_) {
- query_ = string_type();
- } else {
- query_->push_back('&');
- }
- network::uri::encode_query_key_value_pair(std::begin(key), std::end(key),
- std::begin(value), std::end(value),
- std::back_inserter(*query_));
-}
-
-uri_builder &uri_builder::clear_query() {
- query_ = network::nullopt;
- return *this;
-}
-
-void uri_builder::set_fragment(string_type &&fragment) {
- fragment_ = string_type();
- network::uri::encode_fragment(std::begin(fragment), std::end(fragment),
- std::back_inserter(*fragment_));
-}
-
-uri_builder &uri_builder::clear_fragment() {
- fragment_ = network::nullopt;
- return *this;
-}
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/src/uri_errors.cpp b/graphics/asymptote/LspCpp/third_party/uri/src/uri_errors.cpp
deleted file mode 100644
index 815ac08342..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/src/uri_errors.cpp
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// 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)
-
-#include <string>
-#include <network/uri/uri_errors.hpp>
-
-namespace network {
-
-class uri_category_impl : public std::error_category {
- public:
- uri_category_impl() = default;
-
- virtual ~uri_category_impl() noexcept;
-
- virtual const char *name() const noexcept;
-
- virtual std::string message(int ev) const;
-};
-
-uri_category_impl::~uri_category_impl() noexcept {}
-
-const char *uri_category_impl::name() const noexcept {
- static const char name[] = "uri_error";
- return name;
-}
-
-std::string uri_category_impl::message(int ev) const {
- switch (uri_error(ev)) {
- case uri_error::invalid_syntax:
- return "Unable to parse URI string.";
- case uri_error::not_enough_input:
- return "Percent decoding: Not enough input.";
- case uri_error::non_hex_input:
- return "Percent decoding: Non-hex input.";
- case uri_error::conversion_failed:
- return "Percent decoding: Conversion failed.";
- default:
- break;
- }
- return "Unknown URI error.";
-}
-
-const std::error_category &uri_category() {
- static uri_category_impl uri_category;
- return uri_category;
-}
-
-std::error_code make_error_code(uri_error e) {
- return std::error_code(static_cast<int>(e), uri_category());
-}
-
-uri_syntax_error::uri_syntax_error()
- : std::system_error(make_error_code(uri_error::invalid_syntax)) {}
-
-uri_syntax_error::~uri_syntax_error() noexcept {}
-
-uri_builder_error::uri_builder_error()
- : std::system_error(make_error_code(uri_error::invalid_uri)) {}
-
-uri_builder_error::~uri_builder_error() noexcept {}
-
-percent_decoding_error::percent_decoding_error(uri_error error)
- : std::system_error(make_error_code(error)) {}
-
-percent_decoding_error::~percent_decoding_error() noexcept {}
-
-} // namespace network
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/uri/test/CMakeLists.txt
deleted file mode 100644
index 0834f6b79c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/CMakeLists.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-# Copyright (c) Glyn Matthews 2012-2016.
-# 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)
-
-
-include_directories( ${gtest_SOURCE_DIR}/include)
-
-set(
- TESTS
- uri_parse_test
- uri_parse_scheme_test
- uri_parse_path_test
- uri_test
- uri_encoding_test
- uri_normalization_test
- uri_comparison_test
- uri_reference_test
- uri_resolve_test
- uri_builder_test
- uri_stream_test
- optional_test
- )
-
-foreach (test ${TESTS})
- add_executable(${test} ${test}.cpp)
- add_dependencies(${test} network-uri gtest_main)
- target_link_libraries(${test} ${CMAKE_THREAD_LIBS_INIT} network-uri gtest_main)
- if (OPENSSL_FOUND)
- target_link_libraries(${test} ${OPENSSL_LIBRARIES})
- endif()
- set_target_properties(${test}
- PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${Uri_BINARY_DIR}/tests)
- add_test(${test}
- ${Uri_BINARY_DIR}/tests/${test})
-endforeach (test)
-
-file(GLOB URI_LISTS *.txt)
-file(COPY ${URI_LISTS} DESTINATION ${Uri_BINARY_DIR}/test)
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/invalid_urls.txt b/graphics/asymptote/LspCpp/third_party/uri/test/invalid_urls.txt
deleted file mode 100644
index fb9ddd3792..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/invalid_urls.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-http://
-http://.
-http://..
-http://../
-http://?
-http://??
-http://??/
-http://#
-http://##
-http://##/
-http://foo.bar?q=Spaces should be encoded
-//
-//a
-///a
-///
-http:///a
-foo.com
-rdar://1234
-h://test
-http:// shouldfail.com
-:// should fail
-http://foo.bar/foo(bar)baz quux
-ftps://foo.bar/
-http://-error-.invalid/
-http://a.b--c.de/
-http://-a.b.co
-http://a.b-.co
-http://0.0.0.0
-http://10.1.1.0
-http://10.1.1.255
-http://224.1.1.1
-http://1.1.1.1.1
-http://123.123.123
-http://3628126748
-http://.www.foo.bar/
-http://www.foo.bar./
-http://.www.foo.bar./
-http://10.1.1.1
-http://10.1.1.254
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/optional_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/optional_test.cpp
deleted file mode 100644
index 0f0238f733..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/optional_test.cpp
+++ /dev/null
@@ -1,168 +0,0 @@
-// Copyright (c) Glyn Matthews 2016.
-// 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)
-
-#include <gtest/gtest.h>
-#include <string>
-#include <network/optional.hpp>
-#include <network/string_view.hpp>
-
-TEST(optional_test, empty_optional) {
- network::optional<int> opt;
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, empty_optional_constructed_with_nullopt) {
- network::optional<int> opt{network::nullopt};
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, empty_optional_string) {
- network::optional<std::string> opt{};
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, empty_optional_string_with_nullopt) {
- network::optional<std::string> opt{network::nullopt};
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, value_constructor) {
- network::optional<int> opt{42};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, value_constructor_string) {
- network::optional<std::string> opt{"banana"};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, rvalue_ref_constructor) {
- int value = 42;
- network::optional<int> opt{std::move(value)};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, rvalue_ref_constructor_string) {
- std::string value = "banana";
- network::optional<std::string> opt{std::move(value)};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, nullopt_copy_constructor) {
- network::optional<int> other{network::nullopt};
- network::optional<int> opt{other};
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, nullopt_move_constructor) {
- network::optional<int> other{network::nullopt};
- network::optional<int> opt{std::move(other)};
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, value_copy_constructor) {
- network::optional<int> other{42};
- network::optional<int> opt{other};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, value_move_constructor) {
- network::optional<int> other{42};
- network::optional<int> opt{std::move(other)};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, value_copy_constructor_string) {
- network::optional<std::string> other{"banana"};
- network::optional<std::string> opt{other};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, value_move_constructor_string) {
- network::optional<std::string> other{"banana"};
- network::optional<std::string> opt{std::move(other)};
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, nullopt_assignment) {
- network::optional<int> opt(42);
- opt = network::nullopt;
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, nullopt_assignment_string) {
- network::optional<std::string> opt("banana");
- opt = network::nullopt;
- ASSERT_FALSE(opt);
-}
-
-TEST(optional_test, value_copy_assigment) {
- network::optional<int> opt{};
- network::optional<int> other{42};
- opt = other;
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, value_move_assignment) {
- network::optional<int> opt{};
- network::optional<int> other{42};
- opt = std::move(other);
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, 42);
-}
-
-TEST(optional_test, value_copy_assignment_string) {
- network::optional<std::string> opt{};
- network::optional<std::string> other{"banana"};
- opt = other;
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, value_move_assignment_string) {
- network::optional<std::string> opt{};
- network::optional<std::string> other{"banana"};
- opt = std::move(other);
- ASSERT_TRUE(opt);
- ASSERT_EQ(*opt, "banana");
-}
-
-TEST(optional_test, value_or_reference) {
- network::optional<std::string> opt;
- auto result = opt.value_or("other");
- ASSERT_EQ("other", result);
-}
-
-TEST(optional_test, value_or_reference_with_value) {
- network::optional<std::string> opt("this");
- auto result = opt.value_or("other");
- ASSERT_EQ("this", result);
-}
-
-TEST(optional_test, value_or_rvalue_reference) {
- std::string other("other");
- auto result = network::optional<std::string>().value_or(other);
- ASSERT_EQ("other", result);
-}
-
-TEST(optional_test, value_or_rvalue_reference_with_value) {
- std::string other("other");
- auto result = network::optional<std::string>("this").value_or(other);
- ASSERT_EQ("this", result);
-}
-
-TEST(optional_test, assign_nullopt_to_nullopt) {
- network::optional<std::string> opt;
- opt = network::nullopt;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/string_utility.hpp b/graphics/asymptote/LspCpp/third_party/uri/test/string_utility.hpp
deleted file mode 100644
index 71d22746bb..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/string_utility.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef URI_TEST_STRING_UTILITY_INC
-#define URI_TEST_STRING_UTILITY_INC
-
-#include <network/string_view.hpp>
-
-namespace network {
-inline bool operator==(const char *lhs, string_view rhs) {
- return string_view(lhs) == rhs;
-}
-} // namespace network
-
-#endif // URI_TEST_STRING_UTILITY_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/test_uri.hpp b/graphics/asymptote/LspCpp/third_party/uri/test/test_uri.hpp
deleted file mode 100644
index 73726f73c9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/test_uri.hpp
+++ /dev/null
@@ -1,99 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef TEST_URI_INC
-#define TEST_URI_INC
-
-#include <iterator>
-#include <network/uri/detail/uri_parts.hpp>
-#include "../src/detail/uri_parse.hpp"
-
-using network::detail::parse;
-using network::detail::uri_part;
-using network::detail::uri_parts;
-
-namespace test {
-struct uri {
-
- explicit uri(const std::string &uri)
- : uri_(uri), view(uri_) {
- it = std::begin(view);
- last = std::end(view);
- }
-
- bool parse_uri() {
- return parse(it, last, parts);
- }
-
- std::string parsed_till() const {
- return std::string(std::begin(view), it);
- }
-
- bool has_scheme() const {
- return static_cast<bool>(parts.scheme);
- }
-
- std::string scheme() const {
- return (*parts.scheme).to_string();
- }
-
- bool has_user_info() const {
- return static_cast<bool>(parts.hier_part.user_info);
- }
-
- std::string user_info() const {
- return (*parts.hier_part.user_info).to_string();
- }
-
- bool has_host() const {
- return static_cast<bool>(parts.hier_part.host);
- }
-
- std::string host() const {
- return (*parts.hier_part.host).to_string();
- }
-
- bool has_port() const {
- return static_cast<bool>(parts.hier_part.port);
- }
-
- std::string port() const {
- return (*parts.hier_part.port).to_string();
- }
-
- bool has_path() const {
- return static_cast<bool>(parts.hier_part.path);
- }
-
- std::string path() const {
- return (*parts.hier_part.path).to_string();
- }
-
- bool has_query() const {
- return static_cast<bool>(parts.query);
- }
-
- std::string query() const {
- return (*parts.query).to_string();
- }
-
- bool has_fragment() const {
- return static_cast<bool>(parts.fragment);
- }
-
- std::string fragment() const {
- return (*parts.fragment).to_string();
- }
-
- std::string uri_;
- network::string_view view;
- network::string_view::const_iterator it, last;
-
- uri_parts parts;
-
-};
-} // namespace test
-
-#endif // TEST_URI_INC
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_builder_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_builder_test.cpp
deleted file mode 100644
index 4b2b9cd5e2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_builder_test.cpp
+++ /dev/null
@@ -1,855 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// Copyright 2012 Google, Inc.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-#include "string_utility.hpp"
-
-TEST(builder_test, empty_uri_doesnt_throw) {
- network::uri_builder builder;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, empty_uri) {
- network::uri_builder builder;
- network::uri instance(builder);
- ASSERT_TRUE(instance.empty());
-}
-
-TEST(builder_test, simple_uri_doesnt_throw) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, simple_uri) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, simple_uri_has_scheme) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_TRUE(builder.uri().has_scheme());
-}
-
-TEST(builder_test, simple_uri_scheme_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("http", builder.uri().scheme());
-}
-
-TEST(builder_test, simple_uri_has_no_user_info) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_FALSE(builder.uri().has_user_info());
-}
-
-TEST(builder_test, simple_uri_has_host) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_TRUE(builder.uri().has_host());
-}
-
-TEST(builder_test, simple_uri_host_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("www.example.com", builder.uri().host());
-}
-
-TEST(builder_test, simple_uri_has_no_port) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_FALSE(builder.uri().has_port());
-}
-
-TEST(builder_test, simple_uri_has_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_TRUE(builder.uri().has_path());
-}
-
-TEST(builder_test, simple_uri_path_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("/", builder.uri().path());
-}
-
-TEST(builder_test, simple_uri_has_no_query) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_FALSE(builder.uri().has_query());
-}
-
-TEST(builder_test, simple_uri_has_no_fragment) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_FALSE(builder.uri().has_fragment());
-}
-
-TEST(builder_test, simple_opaque_uri_doesnt_throw) {
- network::uri_builder builder;
- builder
- .scheme("mailto")
- .path("john.doe@example.com")
- ;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, simple_opaque_uri) {
- network::uri_builder builder;
- builder
- .scheme("mailto")
- .path("john.doe@example.com")
- ;
- ASSERT_EQ("mailto:john.doe@example.com", builder.uri().string());
-}
-
-TEST(builder_test, simple_opaque_uri_has_scheme) {
- network::uri_builder builder;
- builder
- .scheme("mailto")
- .path("john.doe@example.com")
- ;
- ASSERT_TRUE(builder.uri().has_scheme());
-}
-
-TEST(builder_test, simple_opaque_uri_scheme_value) {
- network::uri_builder builder;
- builder
- .scheme("mailto")
- .path("john.doe@example.com")
- ;
- ASSERT_EQ("mailto", builder.uri().scheme());
-}
-
-TEST(builder_test, relative_hierarchical_uri_doesnt_throw) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, relative_hierarchical_uri) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, relative_opaque_uri_doesnt_throw) {
- network::uri_builder builder;
- builder
- .path("john.doe@example.com")
- ;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, relative_opaque_uri) {
- network::uri_builder builder;
- builder
- .path("john.doe@example.com")
- ;
- ASSERT_EQ("john.doe@example.com", builder.uri().string());
-}
-
-TEST(builder_test, full_uri_doesnt_throw) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_NO_THROW(builder.uri());
-}
-
-TEST(builder_test, full_uri) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("http://user@www.example.com:80/path?query=value#fragment", builder.uri().string());
-}
-
-TEST(builder_test, full_uri_has_scheme) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_scheme());
-}
-
-TEST(builder_test, full_uri_scheme_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("http", builder.uri().scheme());
-}
-
-TEST(builder_test, full_uri_has_user_info) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_user_info());
-}
-
-TEST(builder_test, full_uri_user_info_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("user", builder.uri().user_info());
-}
-
-TEST(builder_test, full_uri_has_host) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_host());
-}
-
-TEST(builder_test, full_uri_host_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("www.example.com", builder.uri().host());
-}
-
-TEST(builder_test, full_uri_has_port) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_port());
-}
-
-TEST(builder_test, full_uri_has_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_path());
-}
-
-TEST(builder_test, full_uri_path_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("/path", builder.uri().path());
-}
-
-TEST(builder_test, full_uri_has_query) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_query());
-}
-
-TEST(builder_test, full_uri_query_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("query=value", builder.uri().query());
-}
-
-TEST(builder_test, full_uri_has_fragment) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_TRUE(builder.uri().has_fragment());
-}
-
-TEST(builder_test, full_uri_fragment_value) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .user_info("user")
- .host("www.example.com")
- .port("80")
- .path("/path")
- .append_query_key_value_pair("query", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("fragment", builder.uri().fragment());
-}
-
-TEST(builder_test, relative_uri) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, relative_uri_scheme) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_FALSE(builder.uri().has_scheme());
-}
-
-TEST(builder_test, authority) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .authority("www.example.com:8080")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com:8080/", builder.uri().string());
- ASSERT_EQ("www.example.com", builder.uri().host());
- ASSERT_EQ("8080", builder.uri().port());
-}
-
-TEST(builder_test, relative_uri_has_host) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_TRUE(builder.uri().has_host());
-}
-
-TEST(builder_test, relative_uri_host_value) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("www.example.com", builder.uri().host());
-}
-
-TEST(builder_test, relative_uri_has_path) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_TRUE(builder.uri().has_path());
-}
-
-TEST(builder_test, relative_uri_path_value) {
- network::uri_builder builder;
- builder
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("/", builder.uri().path());
-}
-
-TEST(builder_test, build_relative_uri_with_path_query_and_fragment) {
- network::uri_builder builder;
- builder
- .path("/path/")
- .append_query_key_value_pair("key", "value")
- .fragment("fragment")
- ;
- ASSERT_EQ("/path/", builder.uri().path());
- ASSERT_EQ("key=value", builder.uri().query());
- ASSERT_EQ("fragment", builder.uri().fragment());
-}
-
-TEST(builder_test, build_uri_with_capital_scheme) {
- network::uri_builder builder;
- builder
- .scheme("HTTP")
- .host("www.example.com")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_capital_host) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("WWW.EXAMPLE.COM")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_unencoded_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/A path with spaces")
- ;
- ASSERT_EQ("http://www.example.com/A%20path%20with%20spaces", builder.uri().string());
-}
-
-TEST(builder_test, DISABLED_builder_uri_and_remove_dot_segments_from_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/A/./path/")
- ;
- ASSERT_EQ("http://www.example.com/A/path/", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_qmark_in_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/?/")
- ;
- ASSERT_EQ("http://www.example.com/%3F/", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_hash_in_path) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .path("/#/")
- ;
- ASSERT_EQ("http://www.example.com/%23/", builder.uri().string());
-}
-
-TEST(builder_test, simple_port) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .port(8000)
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com:8000/", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_query_item) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .append_query_key_value_pair("a", "1")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/?a=1", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_multiple_query_items) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .append_query_key_value_pair("a", "1")
- .append_query_key_value_pair("b", "2")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/?a=1&b=2", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_query_item_with_encoded_chars)
-{
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .append_query_key_value_pair("a", "parameter with encoded chars!")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/?a=parameter%20with%20encoded%20chars%21", builder.uri().string());
-}
-
-TEST(builder_test, build_uri_with_multiple_query_items_with_encoded_chars) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("www.example.com")
- .append_query_key_value_pair("a", "first parameter with encoded chars!")
- .append_query_key_value_pair("b", "second parameter with encoded chars!")
- .path("/")
- ;
- ASSERT_EQ("http://www.example.com/?a=first%20parameter%20with%20encoded%20chars%21&b=second%20parameter%20with%20encoded%20chars%21", builder.uri().string());
-}
-
-TEST(builder_test, construct_from_existing_uri) {
- network::uri instance("http://www.example.com/");
- network::uri_builder builder(instance);
- ASSERT_EQ("http://www.example.com/", builder.uri().string());
-}
-
-TEST(builder_test, build_from_existing_uri) {
- network::uri instance("http://www.example.com/");
- network::uri_builder builder(instance);
- builder.append_query_key_value_pair("a", "1").append_query_key_value_pair("b", "2").fragment("fragment");
- ASSERT_EQ("http://www.example.com/?a=1&b=2#fragment", builder.uri().string());
-}
-
-TEST(builder_test, authority_without_port_test) {
- network::uri_builder builder;
- builder
- .scheme("https")
- .authority("www.example.com")
- ;
- ASSERT_EQ("www.example.com", builder.uri().authority());
-}
-
-TEST(builder_test, authority_with_port_test) {
- network::uri_builder builder;
- builder
- .scheme("https")
- .authority("www.example.com:")
- ;
- ASSERT_EQ("www.example.com:", builder.uri().authority());
-}
-
-TEST(builder_test, DISABLED_authority_without_host_test) {
- network::uri_builder builder;
- builder
- .scheme("https")
- .authority(":1234")
- ;
- ASSERT_EQ(":1234", builder.uri().authority());
-}
-
-TEST(builder_test, clear_user_info_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- network::uri_builder builder(instance);
- builder.clear_user_info();
- ASSERT_EQ("http://www.example.com:80/path?query#fragment", builder.uri().string());
-}
-
-TEST(builder_test, clear_port_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- network::uri_builder builder(instance);
- builder.clear_port();
- ASSERT_EQ("http://user@www.example.com/path?query#fragment", builder.uri().string());
-}
-
-TEST(builder_test, clear_path_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- network::uri_builder builder(instance);
- builder.clear_path();
- ASSERT_EQ("http://user@www.example.com:80?query#fragment", builder.uri().string());
-}
-
-TEST(builder_test, clear_query_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- network::uri_builder builder(instance);
- builder.clear_query();
- ASSERT_EQ("http://user@www.example.com:80/path#fragment", builder.uri().string());
-}
-
-TEST(uri_test, clear_query_params_with_no_query) {
- network::uri original("http://example.com/path");
- network::uri_builder builder(original);
- builder.clear_query();
-}
-
-TEST(builder_test, clear_fragment_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- network::uri_builder builder(instance);
- builder.clear_fragment();
- ASSERT_EQ("http://user@www.example.com:80/path?query", builder.uri().string());
-}
-
-TEST(builder_test, empty_username) {
- std::string user_info(":");
- network::uri_builder builder;
- builder.scheme("ftp").host("127.0.0.1").user_info(user_info);
- ASSERT_EQ("ftp://:@127.0.0.1", builder.uri().string());
-}
-
-TEST(builder_test, path_should_be_prefixed_with_slash) {
- std::string path("relative");
- network::uri_builder builder;
- builder.scheme("ftp").host("127.0.0.1").path(path);
- ASSERT_EQ("ftp://127.0.0.1/relative", builder.uri().string());
-}
-
-TEST(builder_test, path_should_be_prefixed_with_slash_2) {
- network::uri_builder builder;
- builder
- .scheme("ftp").host("127.0.0.1").path("noleadingslash/foo.txt");
- ASSERT_EQ("/noleadingslash/foo.txt", builder.uri().path());
-}
-
-TEST(builder_test, set_multiple_query_with_encoding) {
- network::uri_builder builder;
- builder
- .scheme("http")
- .host("example.com")
- .append_query_key_value_pair("q1", "foo bar")
- .append_query_key_value_pair("q2", "biz baz")
- ;
- ASSERT_EQ("http://example.com?q1=foo%20bar&q2=biz%20baz", builder.uri().string());
-}
-
-TEST(builder_test, non_array_string_literals_should_work) {
- const char* p = "http";
- const char* q = "foo";
-
- network::uri_builder builder;
- builder
- .scheme(p)
- .host("example.com")
- .path(q)
- ;
- ASSERT_EQ("http://example.com/foo", builder.uri());
-}
-
-TEST(builder_test, non_const_non_array_string_literals_should_work) {
- const char* p = "http";
- const char* q = "foo";
-
- network::uri_builder builder;
- builder
- .scheme(const_cast<char *>(p))
- .host("example.com")
- .path(const_cast<char *>(q))
- ;
- ASSERT_EQ("http://example.com/foo", builder.uri());
-}
-
-TEST(builder_test, scheme_and_absolute_path) {
- network::uri_builder builder;
- builder
- .scheme("foo")
- .path("/bar")
- ;
- ASSERT_EQ("foo:/bar", builder.uri());
- ASSERT_EQ("foo", builder.uri().scheme());
- ASSERT_EQ("/bar", builder.uri().path());
-}
-
-TEST(builder_test, assignment_operator_bug_116) {
- // https://github.com/cpp-netlib/uri/issues/116
- network::uri a("http://a.com:1234");
- ASSERT_TRUE(a.has_port());
-
- const network::uri b("http://b.com");
- ASSERT_FALSE(b.has_port());
-
- a = b;
- ASSERT_FALSE(a.has_port()) << a.string();
-}
-
-TEST(builder_test, construct_from_uri_bug_116) {
- // https://github.com/cpp-netlib/uri/issues/116
- network::uri a("http://a.com:1234");
- const network::uri b("http://b.com");
- a = b;
-
- network::uri_builder ub(a);
- const network::uri c(ub.uri());
- ASSERT_FALSE(c.has_port()) << c.string();
-}
-
-TEST(builder_test, append_query_value) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_component("q"));
- ASSERT_EQ(network::string_view("q"), ub.uri().query_begin()->first);
-}
-
-TEST(builder_test, append_query_value_encodes_equal_sign) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_component("="));
- ASSERT_EQ(network::string_view("%3D"), ub.uri().query_begin()->first);
-}
-
-TEST(builder_test, append_query_key_value_pair_encodes_equals_sign) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "="));
- ASSERT_EQ(network::string_view("q"), ub.uri().query_begin()->first);
- ASSERT_EQ(network::string_view("%3D"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, append_query_key_value_pair_encodes_number_sign) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "#"));
- ASSERT_EQ(network::string_view("%23"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, append_query_key_value_pair_encodes_percent_sign) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "%"));
- ASSERT_EQ(network::string_view("%25"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, append_query_key_value_pair_encodes_ampersand) {
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "&"));
- ASSERT_EQ(network::string_view("%26"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, append_query_key_value_pair_does_not_encode_slash) {
- // https://tools.ietf.org/html/rfc3986#section-3.4
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "/"));
- ASSERT_EQ(network::string_view("/"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, append_query_key_value_pair_does_not_encode_qmark) {
- // https://tools.ietf.org/html/rfc3986#section-3.4
- network::uri_builder ub(network::uri("http://example.com"));
- ASSERT_NO_THROW(ub.append_query_key_value_pair("q", "?"));
- ASSERT_EQ(network::string_view("?"), ub.uri().query_begin()->second);
-}
-
-TEST(builder_test, build_from_uri_with_encoded_user_info) {
- network::uri_builder ub(network::uri("http://%40@example.com"));
- ASSERT_EQ(network::string_view("%40"), ub.uri().user_info());
-}
-
-TEST(builder_test, build_from_uri_with_encoded_query) {
- network::uri_builder ub(network::uri("http://example.com?x=%40"));
- ASSERT_EQ(network::string_view("x=%40"), ub.uri().query());
-}
-
-TEST(builder_test, build_from_uri_with_encoded_fragment) {
- network::uri_builder ub(network::uri("http://example.com#%40"));
- ASSERT_EQ(network::string_view("%40"), ub.uri().fragment());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_comparison_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_comparison_test.cpp
deleted file mode 100644
index 67ca4363d0..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_comparison_test.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-
-
-TEST(uri_comparison_test, equality_test) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs("http://www.example.com/");
- ASSERT_EQ(lhs, rhs);
-}
-
-TEST(uri_comparison_test, equality_test_capitalized_scheme) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs("HTTP://www.example.com/");
- ASSERT_NE(lhs.compare(rhs, network::uri_comparison_level::string_comparison), 0);
-}
-
-TEST(uri_comparison_test, equality_test_capitalized_scheme_with_case_normalization) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs("HTTP://www.example.com/");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-TEST(uri_comparison_test, DISABLED_equality_test_capitalized_host) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs("http://WWW.EXAMPLE.COM/");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-TEST(uri_comparison_test, equality_test_with_single_dot_segment) {
- network::uri lhs("http://www.example.com/./path");
- network::uri rhs("http://www.example.com/path");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-TEST(uri_comparison_test, equality_test_with_double_dot_segment) {
- network::uri lhs("http://www.example.com/1/../2/");
- network::uri rhs("http://www.example.com/2/");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-TEST(uri_comparison_test, DISABLED_given_example_test) {
- network::uri lhs("example://a/b/c/%7Bfoo%7D");
- network::uri rhs("eXAMPLE://a/./b/../b/%63/%7bfoo%7d");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-TEST(uri_comparison_test, equality_empty_lhs) {
- network::uri lhs;
- network::uri rhs("http://www.example.com/");
- ASSERT_NE(lhs, rhs);
-}
-
-TEST(uri_comparison_test, equality_empty_rhs) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs;
- ASSERT_NE(lhs, rhs);
-}
-
-TEST(uri_comparison_test, inequality_test) {
- network::uri lhs("http://www.example.com/");
- network::uri rhs("http://www.example.com/");
- ASSERT_FALSE(lhs != rhs);
-}
-
-TEST(uri_comparison_test, less_than_test) {
- // lhs is lexicographically less than rhs
- network::uri lhs("http://www.example.com/");
- network::uri rhs("http://www.example.org/");
- ASSERT_LT(lhs, rhs);
-}
-
-TEST(uri_comparison_test, percent_encoded_query_reserved_chars) {
- network::uri lhs("http://www.example.com?foo=%5cbar");
- network::uri rhs("http://www.example.com?foo=%5Cbar");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
-
-
-TEST(uri_comparison_test, percent_encoded_query_unreserved_chars) {
- network::uri lhs("http://www.example.com?foo=%61%6c%70%68%61%31%32%33%2d%2e%5f%7e");
- network::uri rhs("http://www.example.com?foo=alpha123-._~");
- ASSERT_EQ(lhs.compare(rhs, network::uri_comparison_level::syntax_based), 0);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_encoding_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_encoding_test.cpp
deleted file mode 100644
index 4c97d87258..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_encoding_test.cpp
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright (c) Glyn Matthews 2011-2016.
-// Copyright 2012 Google, Inc.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-#include <iterator>
-
-
-TEST(uri_encoding_test, encode_user_info_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_user_info(std::begin(unencoded), std::end(unencoded),
- std::back_inserter(instance));
- ASSERT_EQ("%21%23%24%26%27%28%29%2A%2B%2C%2F:%3B%3D%3F%40%5B%5D", instance);
-}
-
-TEST(uri_encoding_test, encode_host_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_host(std::begin(unencoded), std::end(unencoded),
- std::back_inserter(instance));
- ASSERT_EQ("%21%23%24%26%27%28%29%2A%2B%2C%2F:%3B%3D%3F%40[]", instance);
-}
-
-TEST(uri_encoding_test, encode_ipv6_host) {
- const std::string unencoded("[::1]");
- std::string instance;
- network::uri::encode_host(std::begin(unencoded), std::end(unencoded),
- std::back_inserter(instance));
- ASSERT_EQ("[::1]", instance);
-}
-
-TEST(uri_encoding_test, encode_port_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_port(std::begin(unencoded), std::end(unencoded),
- std::back_inserter(instance));
- ASSERT_EQ("%21%23%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D", instance);
-}
-
-TEST(uri_encoding_test, encode_path_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_path(std::begin(unencoded), std::end(unencoded),
- std::back_inserter(instance));
- ASSERT_EQ("%21%23%24%26%27%28%29%2A%2B%2C/%3A;=%3F@%5B%5D", instance);
-}
-
-TEST(uri_encoding_test, encode_query_component_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_query_component(
- std::begin(unencoded), std::end(unencoded), std::back_inserter(instance));
- ASSERT_EQ("%21%23%24%26%27%28%29%2A%2B%2C/%3A%3B%3D?%40%5B%5D", instance);
-}
-
-TEST(uri_encoding_test, encode_fragment_iterator) {
- const std::string unencoded("!#$&'()*+,/:;=?@[]");
- std::string instance;
- network::uri::encode_fragment(
- std::begin(unencoded), std::end(unencoded), std::back_inserter(instance));
- ASSERT_EQ("%21%23%24&%27%28%29%2A%2B%2C/%3A;=%3F@%5B%5D", instance);
-}
-
-TEST(uri_encoding_test, decode_iterator) {
- const std::string encoded("%21%23%24%26%27%28%29%2A%2B%2C%2F%3A%3B%3D%3F%40%5B%5D");
- std::string instance;
- network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance));
- ASSERT_EQ("!#$&'()*+,/:;=?@[]", instance);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_1) {
- const std::string encoded("%");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_2) {
- const std::string encoded("%2");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_3) {
- const std::string encoded("%%%");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_4) {
- const std::string encoded("%2%");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_5) {
- const std::string encoded("%G0");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_error_6) {
- const std::string encoded("%0G");
- std::string instance;
- ASSERT_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)),
- network::percent_decoding_error);
-}
-
-TEST(uri_encoding_test, decode_iterator_not_an_error_1) {
- const std::string encoded("%20");
- std::string instance;
- ASSERT_NO_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)));
-}
-
-TEST(uri_encoding_test, decode_iterator_not_an_error_2) {
- const std::string encoded("%80");
- std::string instance;
- ASSERT_NO_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)));
-}
-
-TEST(uri_encoding_test, decode_accepts_utf8) {
- const std::string encoded("%EB%B2%95%EC%A0%95%EB%8F%99");
- std::string instance;
- ASSERT_NO_THROW(network::uri::decode(std::begin(encoded), std::end(encoded),
- std::back_inserter(instance)));
-
- // const std::string unencoded = "법정ë™";
- const std::string unencoded = "\xEB\xB2\x95\xEC\xA0\x95\xEB\x8F\x99";
- ASSERT_EQ(unencoded, instance);
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_normalization_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_normalization_test.cpp
deleted file mode 100644
index 48eb8fd94d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_normalization_test.cpp
+++ /dev/null
@@ -1,212 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-
-// Compare the underlying strings because ``normalize`` is used in the
-// ``uri`` equality operator.
-
-TEST(uri_normalization_test, string_comparison) {
- network::uri instance("http://www.example.com/");
- ASSERT_EQ(
- "http://www.example.com/",
- instance.normalize(network::uri_comparison_level::string_comparison).string());
-}
-
-TEST(uri_normalization_test, string_comparison_with_case) {
- network::uri instance("HTTP://www.example.com/");
- ASSERT_EQ(
- "HTTP://www.example.com/",
- instance.normalize(network::uri_comparison_level::string_comparison).string());
-}
-
-TEST(uri_normalization_test, normalize_case_capitalized_scheme) {
- network::uri instance("HTTP://www.example.com/");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, DISABLED_normalize_case_capitalized_host) {
- network::uri instance("http://WWW.EXAMPLE.COM/");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, normalize_percent_encoding) {
- network::uri instance(
- "http://www%2Eexample%2Ecom/%7E%66%6F%6F%62%61%72%5F%36%39/");
- ASSERT_EQ("http://www.example.com/~foobar_69/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- normalize_percent_encoding_with_lower_case_elements) {
- network::uri instance(
- "http://www%2eexample%2ecom/%7e%66%6f%6f%62%61%72%5f%36%39/");
- ASSERT_EQ("http://www.example.com/~foobar_69/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, normalize_percent_encoding_is_upper_case) {
- network::uri instance(
- "HTTP://www%2Eexample%2Ecom/%7E%66%6F%6F%62%61%72%5F%36%39/");
- ASSERT_EQ("http://www.example.com/~foobar_69/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_segmented_add_trailing_slash) {
- network::uri instance("http://www.example.com");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_dont_add_trailing_slash_if_path_is_not_empty) {
- network::uri instance("http://www.example.com/path");
- ASSERT_EQ("http://www.example.com/path",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_segmented_remove_dot_segments) {
- network::uri instance("http://www.example.com/a/./b/");
- ASSERT_EQ("http://www.example.com/a/b/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_segmented_remove_double_dot_segments) {
- network::uri instance("http://www.example.com/a/../b/");
- ASSERT_EQ("http://www.example.com/b/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_dot_segments_with_percent_encoded_dot) {
- network::uri instance("http://www.example.com/a/%2E/b/");
- ASSERT_EQ("http://www.example.com/a/b/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_percent_encoded_dots) {
- network::uri instance("http://www.example.com/a/%2E%2E/b/");
- ASSERT_EQ("http://www.example.com/b/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_query) {
- network::uri instance("http://www.example.com/a/../b/?key=value");
- ASSERT_EQ("http://www.example.com/b/?key=value",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_empty_query) {
- network::uri instance("http://www.example.com/a/../b/?");
- ASSERT_EQ("http://www.example.com/b/?",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_fragment) {
- network::uri instance("http://www.example.com/a/../b/#fragment");
- ASSERT_EQ("http://www.example.com/b/#fragment",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_empty_fragment) {
- network::uri instance("http://www.example.com/a/../b/#");
- ASSERT_EQ("http://www.example.com/b/#",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test,
- path_segmented_remove_double_dot_segments_with_query_and_fragment) {
- network::uri instance("http://www.example.com/a/../b/?key=value#fragment");
- ASSERT_EQ("http://www.example.com/b/?key=value#fragment",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_double_dash) {
- network::uri instance("http://www.example.com//");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_triple_dash) {
- network::uri instance("http://www.example.com///");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_depth_below_root) {
- network::uri instance("http://www.example.com/..");
- ASSERT_THROW(instance.normalize(network::uri_comparison_level::syntax_based),
- std::system_error);
-}
-
-TEST(uri_normalization_test, path_depth_below_root_2) {
- network::uri instance("http://www.example.com/a/../..");
- ASSERT_THROW(instance.normalize(network::uri_comparison_level::syntax_based),
- std::system_error);
-}
-
-TEST(uri_normalization_test, path_dash_dot_dash) {
- network::uri instance("http://www.example.com/./");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_dash_dot_dash_dot) {
- network::uri instance("http://www.example.com/./.");
- ASSERT_EQ("http://www.example.com/",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_percent_encoded_reserved) {
- // :/?#[]@!$&'()*+,;=
- network::uri instance(
- "http://www.example.com/%3a%2f%3f%23%5b%5d%40%21%24%26%27%28%29%2a%2b%2c%3b%3d");
- ASSERT_EQ(
- "http://www.example.com/%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, path_percent_encoded_unreserved) {
- network::uri instance("http://www.example.com/alpha123%2d%2e%5f%7e");
- ASSERT_EQ("http://www.example.com/alpha123-._~",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, query_percent_encoded_reserved) {
- // :/?#[]@!$&'()*+,;=
- network::uri instance(
- "http://www.example.com?foo=%3a%2f%3f%23%5b%5d%40%21%24%26%27%28%29%2a%2b%2c%3b%3d");
- ASSERT_EQ(
- "http://www.example.com/?foo=%3A%2F%3F%23%5B%5D%40%21%24%26%27%28%29%2A%2B%2C%3B%3D",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_normalization_test, query_percent_encoded_unreserved) {
- network::uri instance("http://www.example.com?foo=alpha123%2d%2e%5f%7e");
- ASSERT_EQ("http://www.example.com/?foo=alpha123-._~",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_test, path_adjacent_slashes_122) {
- // https://github.com/cpp-netlib/uri/issues/122
- network::uri instance("http://www.example.com/abc//elementary");
- ASSERT_EQ("http://www.example.com/abc/elementary",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
-
-TEST(uri_test, path_adjacent_slashes_122_part_2) {
- // https://github.com/cpp-netlib/uri/issues/122
- network::uri instance("http://www.example.com/abc//.//../elementary");
- ASSERT_EQ("http://www.example.com/elementary",
- instance.normalize(network::uri_comparison_level::syntax_based).string());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_path_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_path_test.cpp
deleted file mode 100644
index 168789c3b9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_path_test.cpp
+++ /dev/null
@@ -1,121 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <gtest/gtest.h>
-#include "test_uri.hpp"
-#include "string_utility.hpp"
-
-// path = path-abempty ; begins with "/" or is empty
-// / path-absolute ; begins with "/" but not "//"
-// / path-noscheme ; begins with a non-colon segment
-// / path-rootless ; begins with a segment
-// / path-empty ; zero characters
-//
-// path-abempty = *( "/" segment )
-// path-absolute = "/" [ segment-nz *( "/" segment ) ]
-// path-noscheme = segment-nz-nc *( "/" segment )
-// path-rootless = segment-nz *( "/" segment )
-// path-empty = 0<pchar>
-//
-// segment = *pchar
-// segment-nz = 1*pchar
-// segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
-// ; non-zero-length segment without any colon ":"
-//
-// pchar = unreserved / pct-encoded / sub-delims / ":" / "@"
-
-
-TEST(uri_parse_path_test, test_empty_path) {
- test::uri uri("http://123.34.23.56");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_TRUE(uri.path().empty());
-}
-
-TEST(uri_parse_path_test, test_empty_path_with_query) {
- test::uri uri("http://123.34.23.56?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_TRUE(uri.path().empty());
-}
-
-TEST(uri_parse_path_test, test_empty_path_with_fragment) {
- test::uri uri("http://123.34.23.56#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_TRUE(uri.path().empty());
-}
-
-TEST(uri_parse_path_test, test_single_slash) {
- test::uri uri("http://123.34.23.56/");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_path_test, test_single_slash_with_query) {
- test::uri uri("http://123.34.23.56/?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_path_test, test_single_slash_with_fragment) {
- test::uri uri("http://123.34.23.56/#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_path_test, test_double_slash_empty_path_empty_everything) {
- test::uri uri("file://");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_path_test, test_triple_slash_empty_everything) {
- test::uri uri("file:///");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_path_test, test_triple_slash_with_path_name) {
- test::uri uri("file:///path");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
-}
-
-TEST(uri_parse_path_test, test_rootless_1) {
- test::uri uri("mailto:john.doe@example.com");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("john.doe@example.com", uri.path());
-}
-
-TEST(uri_parse_path_test, test_invalid_characters_in_path) {
- test::uri uri("mailto:jo%hn.doe@example.com");
- EXPECT_FALSE(uri.parse_uri());
- EXPECT_EQ("mailto:jo", uri.parsed_till());
-}
-
-TEST(uri_parse_path_test, test_valid_percent_encoded_characters_in_path) {
- test::uri uri("mailto:john.doe@example%F0.com");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("john.doe@example%F0.com", uri.path());
-}
-
-TEST(uri_parse_path_test, test_invalid_percent_encoded_characters_in_path_1) {
- test::uri uri("mailto:john.doe@example%G0.com");
- EXPECT_FALSE(uri.parse_uri());
- EXPECT_EQ("mailto:john.doe@example", uri.parsed_till());
-}
-
-TEST(uri_parse_path_test, test_invalid_percent_encoded_characters_in_path_2) {
- test::uri uri("mailto:john.doe@example%0G.com");
- EXPECT_FALSE(uri.parse_uri());
- EXPECT_EQ("mailto:john.doe@example", uri.parsed_till());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_scheme_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_scheme_test.cpp
deleted file mode 100644
index 9801f5c15c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_scheme_test.cpp
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2016 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <iterator>
-#include <gtest/gtest.h>
-#include "test_uri.hpp"
-#include "string_utility.hpp"
-
-// scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
-
-TEST(uri_parse_test, test_valid_scheme) {
- test::uri uri("http://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_beginning_with_a_colon) {
- test::uri uri(":http://user@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
- ASSERT_FALSE(uri.has_scheme());
-}
-
-TEST(uri_parse_test, test_scheme_beginning_with_a_number) {
- test::uri uri("8http://user@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_minus) {
- test::uri uri("ht-tp://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("ht-tp", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_plus) {
- test::uri uri("ht+tp://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("ht+tp", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_dot) {
- test::uri uri("ht.tp://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("ht.tp", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_number) {
- test::uri uri("http1://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http1", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_with_an_invalid_character) {
- test::uri uri("http$://user@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_scheme_with_capital_letters) {
- test::uri uri("HTTP://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("HTTP", uri.scheme());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_percent) {
- test::uri uri("ht%tp://user@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_scheme_with_a_valid_percent_encoded_character) {
- test::uri uri("ht%00tp://user@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_test.cpp
deleted file mode 100644
index c2acc0a33a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_parse_test.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
-// Copyright 2016-2017 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <fstream>
-#include <gtest/gtest.h>
-#include "test_uri.hpp"
-#include "string_utility.hpp"
-
-TEST(uri_parse_test, test_empty_uri) {
- test::uri uri("");
- EXPECT_FALSE(uri.parse_uri());
- EXPECT_TRUE(uri.parsed_till().empty());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info) {
- test::uri uri("http://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_empty_user_info) {
- test::uri uri("http://@www.example.com:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_unset_user_info) {
- test::uri uri("http://www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_unset_user_info_and_host) {
- test::uri uri("http://:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_FALSE(uri.has_host());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info_and_host) {
- test::uri uri("http://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info_unset_host) {
- test::uri uri("http://user@:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
- ASSERT_FALSE(uri.has_host());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info_host_and_port) {
- test::uri uri("http://user@www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_TRUE(uri.has_port());
- EXPECT_EQ("80", uri.port());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_empty_user_info_valid_host_and_port) {
- test::uri uri("http://www.example.com:80/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_TRUE(uri.has_port());
- EXPECT_EQ("80", uri.port());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_empty_user_info_valid_host_empty_port) {
- test::uri uri("http://www.example.com/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info_and_host_empty_port) {
- test::uri uri("http://user@www.example.com/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_info_empty_host_valid_port) {
- test::uri uri("http://user@:80/path?query#fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_empty_port_empty_path) {
- test::uri uri("http://www.example.com");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- ASSERT_TRUE(uri.path().empty());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_valid_port_empty_path) {
- test::uri uri("http://www.example.com:80");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_TRUE(uri.has_port());
- EXPECT_EQ("80", uri.port());
- ASSERT_TRUE(uri.has_path());
- ASSERT_TRUE(uri.path().empty());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_user_odd_digits_port) {
- test::uri uri("http://user@www.example.com:12345/foo");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_port());
- EXPECT_EQ("12345", uri.port());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_port_path) {
- test::uri uri("http://www.example.com:80/path");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_TRUE(uri.has_port());
- EXPECT_EQ("80", uri.port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_path) {
- test::uri uri("http://www.example.com/path");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_with_opaque_uri) {
- test::uri uri("mailto:user@example.com");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("mailto", uri.scheme());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_FALSE(uri.has_host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("user@example.com", uri.path());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_path_and_query) {
- test::uri uri("http://www.example.com/path?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_path_query_and_fragment) {
- test::uri uri("http://www.example.com/path?query#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_hierarchical_part_valid_host_path_and_fragment) {
- test::uri uri("http://www.example.com/path#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path", uri.path());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_invalid_fragment) {
- test::uri uri("http://www.example.com/path#%fragment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_valid_fragment_with_pct_encoded_char) {
- test::uri uri("http://www.example.com/path#%ffragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("%ffragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_valid_fragment_with_unreserved_char) {
- test::uri uri("http://www.example.com/path#fragment-");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment-", uri.fragment());
-}
-
-TEST(uri_parse_test, test_invalid_fragment_with_gen_delim) {
- test::uri uri("http://www.example.com/path#frag#ment");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_valid_fragment_with_sub_delim) {
- test::uri uri("http://www.example.com/path#frag$ment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("frag$ment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_valid_fragment_with_forward_slash_and_question_mark) {
- test::uri uri("http://www.example.com/path#frag/ment?");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("frag/ment?", uri.fragment());
-}
-
-TEST(uri_parse_test, test_invalid_query) {
- test::uri uri("http://www.example.com/path?%query");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_valid_query_with_pct_encoded_char) {
- test::uri uri("http://www.example.com/path?%00query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("%00query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_valid_query_with_unreserved_char) {
- test::uri uri("http://www.example.com/path?query-");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query-", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_valid_query_with_sub_delim) {
- test::uri uri("http://www.example.com/path?qu$ery");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("qu$ery", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_invalid_port_with_path) {
- test::uri uri("http://123.34.23.56:6662626/");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_invalid_port) {
- test::uri uri("http://123.34.23.56:6662626");
- EXPECT_FALSE(uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_empty_port_with_path) {
- test::uri uri("http://123.34.23.56:/");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_port());
- ASSERT_EQ("", uri.port());
-}
-
-TEST(uri_parse_test, test_empty_port) {
- test::uri uri("http://123.34.23.56:");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_port());
- ASSERT_EQ("", uri.port());
-}
-
-TEST(uri_parse_test, test_ipv6_address) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A]");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
-}
-
-TEST(uri_parse_test, test_ipv6_address_with_path) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A]/");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_test, test_invalid_ipv6_address) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A");
- EXPECT_FALSE(!uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_invalid_ipv6_address_with_path) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A/");
- EXPECT_FALSE(!uri.parse_uri());
-}
-
-TEST(uri_parse_test, test_opaque_uri_with_one_slash) {
- test::uri uri("scheme:/path/");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("scheme", uri.scheme());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/path/", uri.path());
-}
-
-TEST(uri_parse_test, test_empty_query) {
- test::uri uri("http://www.example.com/?");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("", uri.query());
-}
-
-TEST(uri_parse_test, test_query_with_empty_path) {
- test::uri uri("http://www.example.com?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_query_with_user_info_and_empty_path) {
- test::uri uri("http://user@www.example.com?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_fragment_with_empty_path) {
- test::uri uri("http://www.example.com#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_fragment_with_user_info_and_empty_path) {
- test::uri uri("http://user@www.example.com#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_query_with_empty_path_and_ipv6_address) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A]?query");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_query_with_user_info_empty_path_and_ipv6_address) {
- test::uri uri("http://user@[1080:0:0:0:8:800:200C:417A]?query");
- EXPECT_TRUE(uri.parse_uri());
- EXPECT_EQ("http://user@[1080:0:0:0:8:800:200C:417A]?query", uri.parsed_till());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_TRUE(uri.has_query());
- EXPECT_EQ("query", uri.query());
- ASSERT_FALSE(uri.has_fragment());
-}
-
-TEST(uri_parse_test, test_fragment_with_empty_path_and_ipv6_address) {
- test::uri uri("http://[1080:0:0:0:8:800:200C:417A]#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_fragment_with_user_info_empty_path_and_ipv6_address) {
- test::uri uri("http://user@[1080:0:0:0:8:800:200C:417A]#fragment");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", uri.host());
- ASSERT_FALSE(uri.has_port());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("", uri.path());
- ASSERT_FALSE(uri.has_query());
- ASSERT_TRUE(uri.has_fragment());
- EXPECT_EQ("fragment", uri.fragment());
-}
-
-TEST(uri_parse_test, test_pct_encoded_user_info) {
- test::uri uri("http://user%3f@www.example.com/");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_TRUE(uri.has_scheme());
- EXPECT_EQ("http", uri.scheme());
- ASSERT_TRUE(uri.has_user_info());
- EXPECT_EQ("user%3f", uri.user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("www.example.com", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/", uri.path());
-}
-
-TEST(uri_parse_test, test_file_uri_bug_98) {
- test::uri uri("file:///bin/bash");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/bin/bash", uri.path());
-}
-
-TEST(uri_parse_test, test_file_uri_bug_98_2) {
- test::uri uri("file://localhost/bin");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("localhost", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/bin", uri.path());
-}
-
-TEST(uri_parse_test, test_file_uri_bug_98_3) {
- test::uri uri("file://localhost/bin/bash");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("localhost", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/bin/bash", uri.path());
-}
-
-TEST(uri_parse_test, test_file_uri_bug_98_4) {
- test::uri uri("file:///bin");
- EXPECT_TRUE(uri.parse_uri());
- ASSERT_FALSE(uri.has_user_info());
- ASSERT_TRUE(uri.has_host());
- EXPECT_EQ("", uri.host());
- ASSERT_TRUE(uri.has_path());
- EXPECT_EQ("/bin", uri.path());
-}
-
-TEST(uri_parse_test, test_has_host_bug_88) {
- test::uri uri("http://user@host");
- EXPECT_TRUE(uri.parse_uri());
-}
-
-// http://formvalidation.io/validators/uri/
-
-std::vector<std::string> create_urls(const std::string &filename) {
- std::vector<std::string> urls;
- std::ifstream ifs(filename);
- if (!ifs) {
- throw std::runtime_error("Unable to open file: " + filename);
- }
- for (std::string url; std::getline(ifs, url);) {
- if (url.front() != '#') {
- urls.push_back(url);
- }
- }
- return urls;
-}
-
-// All valid URLs in the list should pass
-class test_valid_urls : public ::testing::TestWithParam<std::string> {};
-
-INSTANTIATE_TEST_CASE_P(uri_parse_test, test_valid_urls,
- testing::ValuesIn(create_urls("valid_urls.txt")));
-
-TEST_P(test_valid_urls, urls_are_valid) {
- test::uri uri(GetParam());
- EXPECT_TRUE(uri.parse_uri());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_reference_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_reference_test.cpp
deleted file mode 100644
index 9eaedb8259..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_reference_test.cpp
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) Glyn Matthews 2012-2016.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-
-
-TEST(uri_make_relative_test, opaque_uri) {
- network::uri uri_1("mailto:glynos@example.com");
- network::uri uri_2("mailto:john.doe@example.com");
- ASSERT_EQ(uri_2, uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, simple_test) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/path/");
- ASSERT_EQ("/path/", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, simple_test_with_different_authority) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.org/path/");
- ASSERT_EQ("http://www.example.org/path/", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, simple_test_is_relative) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/path/");
- ASSERT_FALSE(uri_1.make_relative(uri_2).is_absolute());
-}
-
-TEST(uri_make_relative_test, simple_test_is_hierarchical) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/path/");
- ASSERT_FALSE(uri_1.make_relative(uri_2).is_opaque());
-}
-
-TEST(uri_make_relative_test, simple_test_with_query) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/path/?key=value");
- ASSERT_EQ("/path/?key=value", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, simple_test_with_fragment) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/path/#fragment");
- ASSERT_EQ("/path/#fragment", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, make_relative_with_percent_encoding_normalization) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/%7E%66%6F%6F%62%61%72%5F%36%39/");
- ASSERT_EQ("/~foobar_69/", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, make_relative_with_percent_encoding_normalization_with_query) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/%7E%66%6F%6F%62%61%72%5F%36%39/?key=value");
- ASSERT_EQ("/~foobar_69/?key=value", uri_1.make_relative(uri_2));
-}
-
-TEST(uri_make_relative_test, make_relative_with_percent_encoding_normalization_with_fragment) {
- network::uri uri_1("http://www.example.com/");
- network::uri uri_2("http://www.example.com/%7E%66%6F%6F%62%61%72%5F%36%39/#fragment");
- ASSERT_EQ("/~foobar_69/#fragment", uri_1.make_relative(uri_2));
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_resolve_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_resolve_test.cpp
deleted file mode 100644
index 8d5b49cb06..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_resolve_test.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-// Copyright 2012-2016 Glyn Matthews.
-// Copyright 2013 Hannes Kamecke.
-// 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)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-#include "string_utility.hpp"
-
-using namespace network;
-
-struct uri_resolve_test : public ::testing::Test {
- uri_resolve_test() : base_uri("http://a/b/c/d;p?q")
- {
- }
-
- uri::string_type resolved(const uri& base, const uri& reference) {
- return reference.resolve(base).string();
- }
-
- uri::string_type resolved(const uri& reference)
- {
- return resolved(base_uri, reference);
- }
-
- network::uri base_uri;
-};
-
-
-TEST_F(uri_resolve_test, is_absolute_uri__returns_other)
-{
- ASSERT_EQ("https://www.example.com/", resolved(uri("https://www.example.com/")));
-}
-
-TEST_F(uri_resolve_test, base_has_empty_path__path_is_ref_path_1)
-{
- uri reference = uri_builder().path("g").uri();
- ASSERT_EQ("http://a/g", resolved(uri("http://a/"), reference));
-}
-
-TEST_F(uri_resolve_test, base_has_empty_path__path_is_ref_path_2)
-{
- uri reference = uri_builder().path("g/x/y").append_query_key_value_pair("q", "1").fragment("s").uri();
- ASSERT_EQ("http://a/g/x/y?q=1#s", resolved(uri("http://a/"), reference));
-}
-
-// normal examples
-// http://tools.ietf.org/html/rfc3986#section-5.4.1
-
-TEST_F(uri_resolve_test, remove_dot_segments1) {
- uri reference = uri_builder().path("./g").uri();
- ASSERT_EQ("http://a/b/c/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, base_has_path__path_is_merged_1) {
- uri reference = uri_builder().path("g/").uri();
- ASSERT_EQ("http://a/b/c/g/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, base_has_path__path_is_merged_2) {
- uri reference = uri_builder().path("g").uri();
- ASSERT_EQ("http://a/b/c/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, path_starts_with_slash__path_is_ref_path) {
- uri reference = uri_builder().path("/g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, path_starts_with_slash_with_query_fragment__path_is_ref_path) {
- uri reference = uri_builder().path("/g/x").append_query_key_value_pair("y", "z").fragment("s").uri();
- ASSERT_EQ("http://a/g/x?y=z#s", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, DISABLED_has_authority__base_scheme_with_ref_authority) {
- // ASSERT_EQ("http://g", resolved("//g"));
- // uri reference = uri_builder().host("g").path("").uri();
- uri reference = uri_builder().path("//g").uri();
- ASSERT_EQ("http://g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, path_is_empty_but_has_query__returns_base_with_ref_query) {
- uri reference = uri_builder().append_query_key_value_pair("y", "z").uri();
- ASSERT_EQ("http://a/b/c/d;p?y=z", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, path_is_empty_but_has_query_base_no_query__returns_base_with_ref_query) {
- uri reference = uri_builder().append_query_key_value_pair("y", "z").uri();
- ASSERT_EQ("http://a/b/c/d?y=z", resolved(uri("http://a/b/c/d"), reference));
-}
-
-TEST_F(uri_resolve_test, merge_path_with_query) {
- uri reference = uri_builder().path("g").append_query_key_value_pair("y", "z").uri();
- ASSERT_EQ("http://a/b/c/g?y=z", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, append_fragment) {
- uri reference = uri_builder().fragment("s").uri();
- ASSERT_EQ("http://a/b/c/d;p?q#s", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, merge_paths_with_fragment) {
- uri reference = uri_builder().path("g").fragment("s").uri();
- ASSERT_EQ("http://a/b/c/g#s", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, merge_paths_with_query_and_fragment) {
- uri reference = uri_builder().path("g").append_query_key_value_pair("y", "z").fragment("s").uri();
- ASSERT_EQ("http://a/b/c/g?y=z#s", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, merge_paths_with_semicolon_1) {
- uri reference = uri_builder().path(";x").uri();
- ASSERT_EQ("http://a/b/c/;x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, merge_paths_with_semicolon_2) {
- uri reference = uri_builder().path("g;x").uri();
- ASSERT_EQ("http://a/b/c/g;x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, merge_paths_with_semicolon_3) {
- uri reference = uri_builder().path("g;x").append_query_key_value_pair("y", "z").fragment("s").uri();
- ASSERT_EQ("http://a/b/c/g;x?y=z#s", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, path_is_empty__returns_base) {
- uri reference = uri_builder().uri();
- ASSERT_EQ("http://a/b/c/d;p?q", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments2) {
- uri reference = uri_builder().path(".").uri();
- ASSERT_EQ("http://a/b/c/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments3) {
- uri reference = uri_builder().path("./").uri();
- ASSERT_EQ("http://a/b/c/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments4) {
- uri reference = uri_builder().path("..").uri();
- ASSERT_EQ("http://a/b/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments5) {
- uri reference = uri_builder().path("../").uri();
- ASSERT_EQ("http://a/b/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments6) {
- uri reference = uri_builder().path("../g").uri();
- ASSERT_EQ("http://a/b/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments7) {
- uri reference = uri_builder().path("../..").uri();
- ASSERT_EQ("http://a/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments8) {
- uri reference = uri_builder().path("../../").uri();
- ASSERT_EQ("http://a/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, remove_dot_segments9) {
- uri reference = uri_builder().path("../../g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-
-// abnormal examples
-// http://tools.ietf.org/html/rfc3986#section-5.4.2
-
-TEST_F(uri_resolve_test, abnormal_example_1) {
- uri reference = uri_builder().path("../../../g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_2) {
- uri reference = uri_builder().path("../../../../g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_3) {
- uri reference = uri_builder().path("/./g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_4) {
- uri reference = uri_builder().path("/../g").uri();
- ASSERT_EQ("http://a/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_5) {
- uri reference = uri_builder().path("g.").uri();
- ASSERT_EQ("http://a/b/c/g.", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_6) {
- uri reference = uri_builder().path(".g").uri();
- ASSERT_EQ("http://a/b/c/.g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_7) {
- uri reference = uri_builder().path("g..").uri();
- ASSERT_EQ("http://a/b/c/g..", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_8) {
- uri reference = uri_builder().path("..g").uri();
- ASSERT_EQ("http://a/b/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_9) {
- uri reference = uri_builder().path("./../g").uri();
- ASSERT_EQ("http://a/b/g", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_10) {
- uri reference = uri_builder().path("./g/.").uri();
- ASSERT_EQ("http://a/b/c/g/", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_11) {
- uri reference = uri_builder().path("g/./h").uri();
- ASSERT_EQ("http://a/b/c/g/h", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_12) {
- uri reference = uri_builder().path("g/../h").uri();
- ASSERT_EQ("http://a/b/c/h", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_13) {
- uri reference = uri_builder().path("g;x=1/./y").uri();
- ASSERT_EQ("http://a/b/c/g;x=1/y", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_14) {
- uri reference = uri_builder().path("g;x=1/../y").uri();
- ASSERT_EQ("http://a/b/c/y", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_15) {
- uri reference = uri_builder().path("g").append_query_component("y/./x").uri();
- ASSERT_EQ("http://a/b/c/g?y/./x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_16) {
- uri reference = uri_builder().path("g").append_query_component("y/../x").uri();
- ASSERT_EQ("http://a/b/c/g?y/../x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_17) {
- uri reference = uri_builder().path("g").fragment("s/./x").uri();
- ASSERT_EQ("http://a/b/c/g#s/./x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, abnormal_example_18) {
- uri reference = uri_builder().path("g").fragment("s/../x").uri();
- ASSERT_EQ("http://a/b/c/g#s/../x", resolved(reference));
-}
-
-TEST_F(uri_resolve_test, issue_resolve_from_copy) {
- // https://github.com/cpp-netlib/uri/issues/15
- network::uri base("http://a.com/");
- network::uri uri("http:/example.com/path/");
- network::uri copy = uri;
- ASSERT_TRUE(copy.is_opaque());
- auto result = copy.resolve(base);
- ASSERT_EQ("http:/example.com/path/", result);
-}
-
-TEST_F(uri_resolve_test, issue_resolve_from_move) {
- // https://github.com/cpp-netlib/uri/issues/15
- network::uri base("http://a.com/");
- network::uri uri("http:/example.com/path/");
- network::uri copy = std::move(uri);
- ASSERT_TRUE(copy.is_opaque());
- auto result = copy.resolve(base);
- ASSERT_EQ("http:/example.com/path/", result);
-}
-
-TEST_F(uri_resolve_test, issue_15_resolve_from_copy_with_query) {
- // https://github.com/cpp-netlib/uri/issues/15
- network::uri base("http://a.com/");
- network::uri uri("http:/example.com/path/?query#fragment");
- network::uri copy = uri;
- ASSERT_TRUE(copy.is_opaque());
- auto result = copy.resolve(base);
- ASSERT_EQ("query", uri.query());
- ASSERT_EQ("query", copy.query());
- ASSERT_EQ("query", result.query());
-}
-
-TEST_F(uri_resolve_test, issue_15_resolve_from_copy_with_fragment) {
- // https://github.com/cpp-netlib/uri/issues/15
- network::uri base("http://a.com/");
- network::uri uri("http:/example.com/path/?query#fragment");
- network::uri copy = uri;
- ASSERT_TRUE(copy.is_opaque());
- auto result = copy.resolve(base);
- ASSERT_EQ("fragment", result.fragment());
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_stream_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_stream_test.cpp
deleted file mode 100644
index 4223a119d4..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_stream_test.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// Copyright 2013-2016 Glyn Matthews.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-#include <sstream>
-
-TEST(uri_stream_test, ostream) {
- std::ostringstream oss;
- oss << network::uri("http://www.example.com/");
- ASSERT_EQ("http://www.example.com/", oss.str());
-}
-
-TEST(uri_stream_test, wostream) {
- std::wostringstream oss;
- oss << network::uri("http://www.example.com/");
- ASSERT_EQ(L"http://www.example.com/", oss.str());
-}
-
-TEST(uri_stream_test, istream) {
- std::istringstream iss("http://www.example.com/");
- network::uri instance;
- iss >> instance;
- ASSERT_EQ("http://www.example.com/", instance);
-}
-
-TEST(uri_stream_test, wistream) {
- std::wistringstream iss(L"http://www.example.com/");
- network::uri instance;
- iss >> instance;
- ASSERT_EQ("http://www.example.com/", instance);
-}
-
-TEST(uri_stream_test, DISABLED_istream_invalid_uri) {
- std::istringstream iss("I am not a valid URI.");
- network::uri instance;
- ASSERT_THROW((iss >> instance), network::uri_syntax_error);
-}
-
-TEST(uri_stream_test, DISABLED_wistream_invalid_uri) {
- std::wistringstream iss(L"I am not a valid URI.");
- network::uri instance;
- ASSERT_THROW((iss >> instance), network::uri_syntax_error);
-}
-
-// This is not the full story with istream and exceptions...
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/uri_test.cpp b/graphics/asymptote/LspCpp/third_party/uri/test/uri_test.cpp
deleted file mode 100644
index ad3d58f45f..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/uri_test.cpp
+++ /dev/null
@@ -1,1071 +0,0 @@
-// Copyright 2010 Jeroen Habraken.
-// Copyright 2009-2017 Dean Michael Berris, Glyn Matthews.
-// Copyright 2012 Google, Inc.
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt of copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#include <gtest/gtest.h>
-#include <network/uri.hpp>
-#include <algorithm>
-#include <memory>
-#include <map>
-#include <set>
-#include <unordered_set>
-#include "string_utility.hpp"
-
-TEST(uri_test, construct_invalid_uri) {
- EXPECT_THROW(network::uri("I am not a valid URI."), network::uri_syntax_error);
-}
-
-TEST(uri_test, make_invalid_uri) {
- std::error_code ec;
- network::uri uri = network::make_uri("I am not a valid URI.", ec);
- EXPECT_TRUE(static_cast<bool>(ec));
-}
-
-TEST(uri_test, construct_uri_from_char_array) {
- EXPECT_NO_THROW(network::uri("http://www.example.com/"));
-}
-
-TEST(uri_test, construct_uri_starting_with_ipv4_like) {
- EXPECT_NO_THROW(network::uri("http://198.51.100.0.example.com/"));
-}
-
-TEST(uri_test, construct_uri_starting_with_ipv4_like_glued) {
- ASSERT_NO_THROW(network::uri("http://198.51.100.0example.com/"));
-}
-
-TEST(uri_test, construct_uri_like_short_ipv4) {
- EXPECT_NO_THROW(network::uri("http://198.51.100/"));
-}
-
-TEST(uri_test, construct_uri_like_long_ipv4) {
- EXPECT_NO_THROW(network::uri("http://198.51.100.0.255/"));
-}
-
-TEST(uri_test, make_uri_from_char_array) {
- std::error_code ec;
- network::uri uri = network::make_uri("http://www.example.com/", ec);
- EXPECT_FALSE(ec);
-}
-
-TEST(uri_test, construct_uri_from_wchar_t_array) {
- EXPECT_NO_THROW(network::uri(L"http://www.example.com/"));
-}
-
-TEST(uri_test, make_uri_from_wchar_t_array) {
- std::error_code ec;
- network::uri uri = network::make_uri(L"http://www.example.com/", ec);
- EXPECT_FALSE(ec);
-}
-
-TEST(uri_test, construct_uri_from_string) {
- EXPECT_NO_THROW(network::uri(std::string("http://www.example.com/")));
-}
-
-TEST(uri_test, make_uri_from_string) {
- std::error_code ec;
- network::uri uri = network::make_uri(std::string("http://www.example.com/"), ec);
- EXPECT_FALSE(ec);
-}
-
-TEST(uri_test, construct_uri_from_wstring) {
- EXPECT_NO_THROW(network::uri(std::wstring(L"http://www.example.com/")));
-}
-
-TEST(uri_test, make_uri_from_wstring) {
- std::error_code ec;
- network::uri uri = network::make_uri(std::wstring(L"http://www.example.com/"), ec);
- EXPECT_FALSE(ec);
-}
-
-TEST(uri_test, basic_uri_scheme_test) {
- network::uri instance("http://www.example.com/");
- ASSERT_TRUE(instance.has_scheme());
- EXPECT_EQ("http", instance.scheme());
-}
-
-TEST(uri_test, basic_uri_user_info_test) {
- network::uri instance("http://www.example.com/");
- EXPECT_FALSE(instance.has_user_info());
-}
-
-TEST(uri_test, basic_uri_host_test) {
- network::uri instance("http://www.example.com/");
- ASSERT_TRUE(instance.has_host());
- EXPECT_EQ("www.example.com", instance.host());
-}
-
-TEST(uri_test, basic_uri_port_test) {
- network::uri instance("http://www.example.com/");
- EXPECT_FALSE(instance.has_port());
-}
-
-TEST(uri_test, basic_uri_path_test) {
- network::uri instance("http://www.example.com/");
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, basic_uri_query_test) {
- network::uri instance("http://www.example.com/");
- EXPECT_FALSE(instance.has_query());
-}
-
-TEST(uri_test, basic_uri_fragment_test) {
- network::uri instance("http://www.example.com/");
- EXPECT_FALSE(instance.has_fragment());
-}
-
-TEST(uri_test, basic_uri_value_semantics_test) {
- network::uri original;
- network::uri assigned;
- assigned = original;
- EXPECT_EQ(original, assigned);
- assigned = network::uri("http://www.example.com/");
- EXPECT_NE(original, assigned);
- network::uri copy(assigned);
- EXPECT_EQ(copy, assigned);
-}
-
-TEST(uri_test, full_uri_scheme_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("http", instance.scheme());
-}
-
-TEST(uri_test, full_uri_user_info_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("user", instance.user_info());
-}
-
-TEST(uri_test, full_uri_host_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("www.example.com", instance.host());
-}
-
-TEST(uri_test, full_uri_port_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("80", instance.port());
-}
-
-TEST(uri_test, full_uri_port_as_int_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ(80, instance.port<int>());
-}
-
-TEST(uri_test, full_uri_path_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("/path", instance.path());
-}
-
-TEST(uri_test, full_uri_query_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, full_uri_fragment_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, full_uri_range_scheme_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_scheme());
- EXPECT_EQ("http", instance.scheme());
-}
-
-TEST(uri_test, full_uri_range_user_info_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_user_info());
- EXPECT_EQ("user", instance.user_info());
-}
-
-TEST(uri_test, full_uri_range_host_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_host());
- EXPECT_EQ("www.example.com", instance.host());
-}
-
-TEST(uri_test, full_uri_range_port_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_port());
- EXPECT_EQ("80", instance.port());
-}
-
-TEST(uri_test, full_uri_range_path_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("/path", instance.path());
-}
-
-TEST(uri_test, full_uri_range_query_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_query());
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, full_uri_range_fragment_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_fragment());
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, uri_with_empty_query) {
- network::uri instance("http://example.com/?");
- ASSERT_TRUE(instance.has_query());
- EXPECT_EQ("", instance.query());
-}
-
-TEST(uri_test, mailto_test) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_EQ("mailto", instance.scheme());
- EXPECT_EQ("john.doe@example.com", instance.path());
-}
-
-TEST(uri_test, file_test) {
- network::uri instance("file:///bin/bash");
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("/bin/bash", instance.path());
-}
-
-TEST(uri_test, file_path_has_host_bug_98) {
- network::uri instance("file:///bin/bash");
- EXPECT_TRUE(instance.has_scheme());
- EXPECT_FALSE(instance.has_user_info());
- EXPECT_TRUE(instance.has_host());
- EXPECT_FALSE(instance.has_port());
- EXPECT_TRUE(instance.has_path());
- EXPECT_FALSE(instance.has_query());
- EXPECT_FALSE(instance.has_fragment());
-}
-
-TEST(uri_test, xmpp_test) {
- network::uri instance("xmpp:example-node@example.com?message;subject=Hello%20World");
- EXPECT_EQ("xmpp", instance.scheme());
- EXPECT_EQ("example-node@example.com", instance.path());
- EXPECT_EQ("message;subject=Hello%20World", instance.query());
-}
-
-TEST(uri_test, ipv4_address_test) {
- network::uri instance("http://129.79.245.252/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("129.79.245.252", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv4_loopback_test) {
- network::uri instance("http://127.0.0.1/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("127.0.0.1", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_1) {
- network::uri instance("http://[1080:0:0:0:8:800:200C:417A]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[1080:0:0:0:8:800:200C:417A]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_2) {
- network::uri instance("http://[2001:db8:85a3:8d3:1319:8a2e:370:7348]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:db8:85a3:8d3:1319:8a2e:370:7348]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_3) {
- network::uri instance("http://[2001:db8:85a3:0:0:8a2e:370:7334]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:db8:85a3:0:0:8a2e:370:7334]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_4) {
- network::uri instance("http://[2001:db8:85a3::8a2e:370:7334]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:db8:85a3::8a2e:370:7334]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_5) {
- network::uri instance("http://[2001:0db8:0000:0000:0000:0000:1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:0db8:0000:0000:0000:0000:1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_6) {
- network::uri instance("http://[2001:0db8:0000:0000:0000::1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:0db8:0000:0000:0000::1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_7) {
- network::uri instance("http://[2001:0db8:0:0:0:0:1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:0db8:0:0:0:0:1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_8) {
- network::uri instance("http://[2001:0db8:0:0::1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:0db8:0:0::1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_9) {
- network::uri instance("http://[2001:0db8::1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:0db8::1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_10) {
- network::uri instance("http://[2001:db8::1428:57ab]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[2001:db8::1428:57ab]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_11) {
- network::uri instance("http://[::ffff:0c22:384e]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[::ffff:0c22:384e]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_12) {
- network::uri instance("http://[fe80::]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[fe80::]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_address_test_13) {
- network::uri instance("http://[::ffff:c000:280]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[::ffff:c000:280]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_loopback_test) {
- network::uri instance("http://[::1]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[::1]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_loopback_test_1) {
- network::uri instance("http://[0000:0000:0000:0000:0000:0000:0000:0001]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[0000:0000:0000:0000:0000:0000:0000:0001]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_v4inv6_test_1) {
- network::uri instance("http://[::ffff:12.34.56.78]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[::ffff:12.34.56.78]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ipv6_v4inv6_test_2) {
- network::uri instance("http://[::ffff:192.0.2.128]/");
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("[::ffff:192.0.2.128]", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, ftp_test) {
- network::uri instance("ftp://john.doe@ftp.example.com/");
- EXPECT_EQ("ftp", instance.scheme());
- EXPECT_EQ("john.doe", instance.user_info());
- EXPECT_EQ("ftp.example.com", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, news_test) {
- network::uri instance("news:comp.infosystems.www.servers.unix");
- EXPECT_EQ("news", instance.scheme());
- EXPECT_EQ("comp.infosystems.www.servers.unix", instance.path());
-}
-
-TEST(uri_test, tel_test) {
- network::uri instance("tel:+1-816-555-1212");
- EXPECT_EQ("tel", instance.scheme());
- EXPECT_EQ("+1-816-555-1212", instance.path());
-}
-
-TEST(uri_test, ldap_test) {
- network::uri instance("ldap://[2001:db8::7]/c=GB?objectClass?one");
- EXPECT_EQ("ldap", instance.scheme());
- EXPECT_EQ("[2001:db8::7]", instance.host());
- EXPECT_EQ("/c=GB", instance.path());
- EXPECT_EQ("objectClass?one", instance.query());
-}
-
-TEST(uri_test, urn_test) {
- network::uri instance("urn:oasis:names:specification:docbook:dtd:xml:4.1.2");
- EXPECT_EQ("urn", instance.scheme());
- EXPECT_EQ("oasis:names:specification:docbook:dtd:xml:4.1.2", instance.path());
-}
-
-TEST(uri_test, svn_ssh_test) {
- network::uri instance("svn+ssh://example.com/");
- EXPECT_EQ("svn+ssh", instance.scheme());
- EXPECT_EQ("example.com", instance.host());
- EXPECT_EQ("/", instance.path());
-}
-
-TEST(uri_test, copy_constructor_test) {
- network::uri instance("http://www.example.com/");
- network::uri copy = instance;
- EXPECT_EQ(instance, copy);
-}
-
-TEST(uri_test, assignment_test) {
- network::uri instance("http://www.example.com/");
- network::uri copy;
- copy = instance;
- EXPECT_EQ(instance, copy);
-}
-
-TEST(uri_test, swap_test) {
- network::uri original("http://example.com/path/to/file.txt");
- network::uri instance("file:///something/different/");
- original.swap(instance);
-
- ASSERT_TRUE(original.has_scheme());
- ASSERT_TRUE(original.has_host());
- ASSERT_TRUE(original.has_path());
- EXPECT_EQ("file", original.scheme());
- EXPECT_EQ("", original.host());
- EXPECT_EQ("/something/different/", original.path());
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_host());
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("example.com", instance.host());
- EXPECT_EQ("/path/to/file.txt", instance.path());
-}
-
-TEST(uri_test, authority_test) {
- network::uri instance("http://user@www.example.com:80/path?query#fragment");
- ASSERT_TRUE(instance.has_authority());
- EXPECT_EQ("user@www.example.com:80", instance.authority());
-}
-
-TEST(uri_test, partial_authority_test) {
- network::uri instance("http://www.example.com/path?query#fragment");
- ASSERT_TRUE(instance.has_authority());
- EXPECT_EQ("www.example.com", instance.authority());
-}
-
-TEST(uri_test, range_test) {
- const std::string url("http://www.example.com/");
- network::uri instance(url);
- EXPECT_TRUE(std::equal(std::begin(instance), std::end(instance),
- std::begin(url)));
-}
-
-TEST(uri_test, issue_104_test) {
- // https://github.com/cpp-netlib/cpp-netlib/issues/104
- std::unique_ptr<network::uri> instance(new network::uri("http://www.example.com/"));
- network::uri copy = *instance;
- instance.reset();
- EXPECT_EQ("http", copy.scheme());
-}
-
-TEST(uri_test, uri_set_test) {
- std::set<network::uri> uri_set;
- uri_set.insert(network::uri("http://www.example.com/"));
- EXPECT_FALSE(uri_set.empty());
- EXPECT_EQ(network::uri("http://www.example.com/"), (*std::begin(uri_set)));
-}
-
-TEST(uri_test, uri_unordered_set_test) {
- std::unordered_set<network::uri> uri_set;
- uri_set.insert(network::uri("http://www.example.com/"));
- EXPECT_FALSE(uri_set.empty());
- EXPECT_EQ(network::uri("http://www.example.com/"), (*std::begin(uri_set)));
-}
-
-TEST(uri_test, empty_uri) {
- network::uri instance;
- EXPECT_TRUE(instance.empty());
-}
-
-TEST(uri_test, empty_uri_has_no_scheme) {
- network::uri instance;
- EXPECT_FALSE(instance.has_scheme());
-}
-
-TEST(uri_test, empty_uri_has_no_user_info) {
- network::uri instance;
- EXPECT_FALSE(instance.has_user_info());
-}
-
-TEST(uri_test, empty_uri_has_no_host) {
- network::uri instance;
- EXPECT_FALSE(instance.has_host());
-}
-
-TEST(uri_test, empty_uri_has_no_port) {
- network::uri instance;
- EXPECT_FALSE(instance.has_port());
-}
-
-TEST(uri_test, empty_uri_has_no_path) {
- network::uri instance;
- EXPECT_FALSE(instance.has_path());
-}
-
-TEST(uri_test, empty_uri_has_no_query) {
- network::uri instance;
- EXPECT_FALSE(instance.has_query());
-}
-
-TEST(uri_test, empty_uri_has_no_fragment) {
- network::uri instance;
- EXPECT_FALSE(instance.has_fragment());
-}
-
-TEST(uri_test, http_is_absolute) {
- network::uri instance("http://www.example.com/");
- EXPECT_TRUE(instance.is_absolute());
-}
-
-TEST(uri_test, mailto_has_no_user_info) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_FALSE(instance.has_user_info());
-}
-
-TEST(uri_test, mailto_has_no_host) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_FALSE(instance.has_host());
-}
-
-TEST(uri_test, mailto_has_no_port) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_FALSE(instance.has_port());
-}
-
-TEST(uri_test, mailto_has_no_authority) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_FALSE(instance.has_authority());
-}
-
-TEST(uri_test, http_is_not_opaque) {
- network::uri instance("http://www.example.com/");
- EXPECT_FALSE(instance.is_opaque());
-}
-
-TEST(uri_test, file_is_not_opaque) {
- network::uri instance("file:///bin/bash");
- EXPECT_FALSE(instance.is_opaque());
-}
-
-TEST(uri_test, mailto_is_absolute) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_TRUE(instance.is_absolute());
-}
-
-TEST(uri_test, mailto_is_opaque) {
- network::uri instance("mailto:john.doe@example.com");
- EXPECT_TRUE(instance.is_opaque());
-}
-
-TEST(uri_test, whitespace_no_throw) {
- EXPECT_NO_THROW(network::uri(" http://www.example.com/ "));
-}
-
-TEST(uri_test, whitespace_is_trimmed) {
- network::uri instance(" http://www.example.com/ ");
- EXPECT_EQ("http://www.example.com/", instance);
-}
-
-TEST(uri_test, unnormalized_invalid_path_doesnt_throw) {
- EXPECT_NO_THROW(network::uri("http://www.example.com/.."));
-}
-
-TEST(uri_test, unnormalized_invalid_path_is_valid) {
- network::uri instance("http://www.example.com/..");
- EXPECT_TRUE(instance.has_path());
-}
-
-TEST(uri_test, unnormalized_invalid_path_value) {
- network::uri instance("http://www.example.com/..");
- EXPECT_EQ("/..", instance.path());
-}
-
-TEST(uri_test, git) {
- network::uri instance("git://github.com/cpp-netlib/cpp-netlib.git");
- EXPECT_EQ("git", instance.scheme());
- EXPECT_EQ("github.com", instance.host());
- EXPECT_EQ("/cpp-netlib/cpp-netlib.git", instance.path());
-}
-
-TEST(uri_test, invalid_port_test) {
- EXPECT_THROW(network::uri("http://123.34.23.56:6662626/"), network::uri_syntax_error);
-}
-
-TEST(uri_test, valid_empty_port_test) {
- EXPECT_NO_THROW(network::uri("http://123.34.23.56:/"));
-}
-
-TEST(uri_test, empty_port_test) {
- network::uri instance("http://123.34.23.56:/");
- ASSERT_TRUE(instance.has_port());
- EXPECT_EQ("", instance.port());
-}
-
-TEST(uri_test, full_copy_uri_scheme_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("http", instance.scheme());
-}
-
-TEST(uri_test, full_copy_uri_user_info_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("user", instance.user_info());
-}
-
-TEST(uri_test, full_copy_uri_host_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("www.example.com", instance.host());
-}
-
-TEST(uri_test, full_copy_uri_port_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("80", instance.port());
-}
-
-TEST(uri_test, full_copy_uri_path_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("/path", instance.path());
-}
-
-TEST(uri_test, full_copy_uri_query_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, full_copy_uri_fragment_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, full_move_uri_scheme_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("http", instance.scheme());
-}
-
-TEST(uri_test, full_move_uri_user_info_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("user", instance.user_info());
-}
-
-TEST(uri_test, full_move_uri_host_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("www.example.com", instance.host());
-}
-
-TEST(uri_test, full_move_uri_port_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("80", instance.port());
-}
-
-TEST(uri_test, full_move_uri_path_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("/path", instance.path());
-}
-
-TEST(uri_test, full_move_uri_query_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, full_move_uri_fragment_test) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, mailto_uri_path) {
- network::uri origin("mailto:john.doe@example.com?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("john.doe@example.com", instance.path());
-}
-
-TEST(uri_test, mailto_uri_query) {
- network::uri origin("mailto:john.doe@example.com?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, mailto_uri_fragment) {
- network::uri origin("mailto:john.doe@example.com?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash) {
- network::uri instance("scheme:/path/");
- EXPECT_TRUE(instance.is_opaque());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_scheme) {
- network::uri instance("scheme:/path/");
- EXPECT_EQ("scheme", instance.scheme());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_path) {
- network::uri instance("scheme:/path/");
- EXPECT_EQ("/path/", instance.path());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_query) {
- network::uri instance("scheme:/path/?query#fragment");
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_fragment) {
- network::uri instance("scheme:/path/?query#fragment");
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_copy) {
- network::uri origin("scheme:/path/");
- network::uri instance = origin;
- EXPECT_TRUE(instance.is_opaque());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_copy_query) {
- network::uri origin("scheme:/path/?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("query", instance.query());
-}
-
-TEST(uri_test, opaque_uri_with_one_slash_copy_fragment) {
- network::uri origin("scheme:/path/?query#fragment");
- network::uri instance = origin;
- EXPECT_EQ("fragment", instance.fragment());
-}
-
-TEST(uri_test, move_empty_uri_check_scheme) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_scheme());
-}
-
-TEST(uri_test, move_empty_uri_check_user_info) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_user_info());
-}
-
-TEST(uri_test, move_empty_uri_check_host) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_host());
-}
-
-TEST(uri_test, move_empty_uri_check_port) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_port());
-}
-
-TEST(uri_test, move_empty_uri_check_path) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_path());
-}
-
-TEST(uri_test, move_empty_uri_check_query) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_query());
-}
-
-TEST(uri_test, move_empty_uri_check_fragment) {
- network::uri origin("http://user@www.example.com:80/path?query#fragment");
- network::uri instance = std::move(origin);
- EXPECT_FALSE(origin.has_fragment());
-}
-
-TEST(uri_test, DISABLED_empty_username_in_user_info) {
- network::uri instance("ftp://:@localhost");
- ASSERT_TRUE(instance.has_user_info());
- EXPECT_EQ(":", instance.user_info());
- EXPECT_EQ("localhost", instance.host());
-}
-
-TEST(uri_test, uri_begins_with_a_colon) {
- EXPECT_THROW(network::uri("://example.com"), network::uri_syntax_error);
-}
-
-TEST(uri_test, uri_begins_with_a_number) {
- EXPECT_THROW(network::uri("3http://example.com"), network::uri_syntax_error);
-}
-
-TEST(uri_test, uri_scheme_contains_an_invalid_character) {
- EXPECT_THROW(network::uri("ht%tp://example.com"), network::uri_syntax_error);
-}
-
-TEST(uri_test, default_constructed_assignment_test) {
- network::uri instance("http://www.example.com/");
- instance = network::uri(); // <-- CRASHES HERE
- EXPECT_TRUE(instance.empty());
-}
-
-TEST(uri_test, opaque_path_no_double_slash) {
- network::uri instance("file:/path/to/something/");
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("/path/to/something/", instance.path());
- EXPECT_TRUE(instance.is_opaque());
-}
-
-TEST(uri_test, non_opaque_path_has_double_slash) {
- network::uri instance("file:///path/to/something/");
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("/path/to/something/", instance.path());
- EXPECT_FALSE(instance.is_opaque());
-}
-
-TEST(uri_test, query_iterator_with_no_query) {
- network::uri instance("http://example.com/");
- ASSERT_FALSE(instance.has_query());
- ASSERT_EQ(instance.query_begin(), instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_empty_query) {
- network::uri instance("http://example.com/?");
- ASSERT_TRUE(instance.has_query());
- EXPECT_EQ("", instance.query());
- EXPECT_EQ(instance.query_begin(), instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_single_kvp) {
- network::uri instance("http://example.com/?a=b");
- ASSERT_TRUE(instance.has_query());
- auto query_it = instance.query_begin();
- ASSERT_NE(query_it, instance.query_end());
- EXPECT_EQ("a", query_it->first);
- EXPECT_EQ("b", query_it->second);
- ++query_it;
- EXPECT_EQ(query_it, instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_two_kvps) {
- network::uri instance("http://example.com/?a=b&c=d");
-
- ASSERT_TRUE(instance.has_query());
- auto query_it = instance.query_begin();
- ASSERT_NE(query_it, instance.query_end());
- EXPECT_EQ("a", query_it->first);
- EXPECT_EQ("b", query_it->second);
- ++query_it;
- ASSERT_NE(query_it, instance.query_end());
- EXPECT_EQ("c", query_it->first);
- EXPECT_EQ("d", query_it->second);
- ++query_it;
- EXPECT_EQ(query_it, instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_two_kvps_using_semicolon_separator) {
- network::uri instance("http://example.com/?a=b;c=d");
-
- ASSERT_TRUE(instance.has_query());
- auto query_it = instance.query_begin();
- ASSERT_NE(query_it, instance.query_end());
- EXPECT_EQ("a", query_it->first);
- EXPECT_EQ("b", query_it->second);
- ++query_it;
- ASSERT_NE(query_it, instance.query_end());
- EXPECT_EQ("c", query_it->first);
- EXPECT_EQ("d", query_it->second);
- ++query_it;
- EXPECT_EQ(query_it, instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_key_and_no_value) {
- network::uri instance("http://example.com/?query");
- ASSERT_TRUE(instance.has_query());
- auto query_it = instance.query_begin();
- EXPECT_EQ("query", query_it->first);
- EXPECT_EQ("", query_it->second);
- ++query_it;
- EXPECT_EQ(query_it, instance.query_end());
-}
-
-TEST(uri_test, query_iterator_with_fragment) {
- network::uri instance("http://example.com/?a=b;c=d#fragment");
- ASSERT_TRUE(instance.has_query());
- ASSERT_NE(instance.query_begin(), instance.query_end());
- auto query_it = instance.query_begin();
- EXPECT_EQ("a", query_it->first);
- EXPECT_EQ("b", query_it->second);
- ++query_it;
- EXPECT_EQ("c", query_it->first);
- EXPECT_EQ("d", query_it->second);
- ++query_it;
- EXPECT_EQ(query_it, instance.query_end());
-}
-
-TEST(uri_test, copy_assignment_bug_98) {
- network::uri original("file:///path/to/file.txt");
-
- ASSERT_TRUE(original.has_scheme());
- ASSERT_FALSE(original.is_opaque());
- ASSERT_TRUE(original.has_host());
- ASSERT_TRUE(original.has_path());
-
- network::uri instance;
- instance = original;
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_host());
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("", instance.host());
- EXPECT_EQ("/path/to/file.txt", instance.path());
-}
-
-TEST(uri_test, copy_assignment_bug_98_2) {
- network::uri original("file:///path/to/file.txt?query=value#foo");
-
- network::uri instance;
- instance = original;
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_path());
- ASSERT_TRUE(instance.has_query());
- ASSERT_TRUE(instance.has_fragment());
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("/path/to/file.txt", instance.path());
- EXPECT_EQ("query=value", instance.query());
- EXPECT_EQ("foo", instance.fragment());
-}
-
-TEST(uri_test, copy_constructor_bug_98) {
- network::uri original("file:///path/to/file.txt?query=value#foo");
-
- network::uri instance(original);
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_path());
- ASSERT_TRUE(instance.has_query());
- ASSERT_TRUE(instance.has_fragment());
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("/path/to/file.txt", instance.path());
- EXPECT_EQ("query=value", instance.query());
- EXPECT_EQ("foo", instance.fragment());
-}
-
-TEST(uri_test, move_assignment_bug_98) {
- network::uri original("file:///path/to/file.txt?query=value#foo");
-
- network::uri instance;
- instance = std::move(original);
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_path());
- ASSERT_TRUE(instance.has_query());
- ASSERT_TRUE(instance.has_fragment());
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("/path/to/file.txt", instance.path());
- EXPECT_EQ("query=value", instance.query());
- EXPECT_EQ("foo", instance.fragment());
-}
-
-TEST(uri_test, move_constructor_bug_98) {
- network::uri original("file:///path/to/file.txt?query=value#foo");
-
- network::uri instance(std::move(original));
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_path());
- ASSERT_TRUE(instance.has_query());
- ASSERT_TRUE(instance.has_fragment());
- EXPECT_EQ("file", instance.scheme());
- EXPECT_EQ("/path/to/file.txt", instance.path());
- EXPECT_EQ("query=value", instance.query());
- EXPECT_EQ("foo", instance.fragment());
-}
-
-TEST(uri_test, http_copy_assignment_bug_98) {
- network::uri original("http://example.com/path/to/file.txt");
-
- network::uri instance;
- instance = original;
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_path());
- EXPECT_EQ("http", instance.scheme());
- EXPECT_EQ("/path/to/file.txt", instance.path());
-}
-
-TEST(uri_test, uri_has_host_bug_87) {
- EXPECT_THROW(network::uri("http://"), network::uri_syntax_error);
-}
-
-TEST(uri_test, uri_has_host_bug_87_2) {
- EXPECT_THROW(network::uri("http://user@"), network::uri_syntax_error);
-}
-
-TEST(uri_test, uri_has_host_bug_88) {
- network::uri instance("http://user@host");
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_user_info());
- ASSERT_TRUE(instance.has_host());
- ASSERT_FALSE(instance.has_port());
- ASSERT_TRUE(instance.has_path());
- ASSERT_FALSE(instance.has_query());
- ASSERT_FALSE(instance.has_fragment());
-
- EXPECT_EQ("host", instance.host().to_string());
-}
-
-TEST(uri_test, uri_has_host_bug_88_2) {
- network::uri instance("http://user@example.com");
-
- ASSERT_TRUE(instance.has_scheme());
- ASSERT_TRUE(instance.has_user_info());
- ASSERT_TRUE(instance.has_host());
- ASSERT_FALSE(instance.has_port());
- ASSERT_TRUE(instance.has_path());
- ASSERT_FALSE(instance.has_query());
- ASSERT_FALSE(instance.has_fragment());
-
- EXPECT_EQ("example.com", instance.host().to_string());
-}
-
-TEST(uri_test, assignment_operator_bug_116) {
- network::uri a("http://a.com:1234");
- ASSERT_TRUE(a.has_port());
-
- const network::uri b("http://b.com");
- ASSERT_FALSE(b.has_port());
-
- a = b;
- ASSERT_FALSE(a.has_port()) << a.string() << ", " << a.port();
-}
diff --git a/graphics/asymptote/LspCpp/third_party/uri/test/valid_urls.txt b/graphics/asymptote/LspCpp/third_party/uri/test/valid_urls.txt
deleted file mode 100644
index fab57f3e23..0000000000
--- a/graphics/asymptote/LspCpp/third_party/uri/test/valid_urls.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-http://foo.com/blah_blah
-http://foo.com/blah_blah/
-http://foo.com/blah_blah_(wikipedia)
-http://foo.com/blah_blah_(wikipedia)_(again)
-http://www.example.com/wpstyle/?p=364
-https://www.example.com/foo/?bar=baz&inga=42&quux
-http://✪df.ws/123
-http://userid:password@example.com:8080
-http://userid:password@example.com:8080/
-http://userid@example.com
-http://userid@example.com/
-http://userid@example.com:8080
-http://userid@example.com:8080/
-http://userid:password@example.com
-http://userid:password@example.com/
-http://142.42.1.1/
-http://142.42.1.1:8080/
-#http://➡.ws/䨹
-http://⌘.ws
-http://⌘.ws/
-http://foo.com/blah_(wikipedia)#cite-1
-http://foo.com/blah_(wikipedia)_blah#cite-1
-#http://foo.com/unicode_(✪)_in_parens
-http://foo.com/(something)?after=parens
-http://☺.damowmow.com/
-http://code.google.com/events/#&product=browser
-http://j.mp
-ftp://foo.bar/baz
-http://foo.bar/?q=Test%20URL-encoded%20stuff
-http://مثال.إختبار
-http://例å­.测试
-http://उदाहरण.परीकà¥à¤·à¤¾
-#http://-.~_!$&'()*+,;=:%40:80%2f::::::@example.com
-http://1337.net
-http://a.b-c.de
-http://223.255.255.254
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/utfcpp/CMakeLists.txt
deleted file mode 100644
index c8d4b7a3c5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/CMakeLists.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-cmake_minimum_required (VERSION 3.0.2)
-project (utf8cpp VERSION 3.2.2 LANGUAGES CXX)
-
-if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
- set(IS_ROOT_PROJECT ON)
-else()
- set(IS_ROOT_PROJECT OFF)
-endif()
-
-option(UTF8_TESTS "Enable tests for UTF8-CPP" ${IS_ROOT_PROJECT})
-option(UTF8_INSTALL "Enable installation for UTF8-CPP" ${IS_ROOT_PROJECT})
-option(UTF8_SAMPLES "Enable building samples for UTF8-CPP" ${IS_ROOT_PROJECT})
-
-add_library(utf8cpp INTERFACE)
-target_include_directories(utf8cpp INTERFACE
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/source>"
- $<INSTALL_INTERFACE:include/utf8cpp>
-)
-add_library(utf8::cpp ALIAS utf8cpp)
-
-if(UTF8_INSTALL)
- include(CMakePackageConfigHelpers)
- if(MSVC)
- set(DEF_INSTALL_CMAKE_DIR CMake)
- else()
- include(GNUInstallDirs) # define CMAKE_INSTALL_*
- set(DEF_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/utf8cpp)
- endif()
-
- write_basic_package_version_file(
- ${CMAKE_CURRENT_BINARY_DIR}/utf8cppConfigVersion.cmake
- VERSION ${PROJECT_VERSION}
- COMPATIBILITY SameMajorVersion
- )
-
- configure_package_config_file(
- ${PROJECT_SOURCE_DIR}/utf8cppConfig.cmake.in
- ${CMAKE_CURRENT_BINARY_DIR}/utf8cppConfig.cmake
- INSTALL_DESTINATION ${DEF_INSTALL_CMAKE_DIR}
- )
-
- install(DIRECTORY source/ DESTINATION include/utf8cpp)
- install(TARGETS utf8cpp EXPORT utf8cppTargets)
- install(EXPORT utf8cppTargets DESTINATION ${DEF_INSTALL_CMAKE_DIR})
- install(
- FILES
- ${CMAKE_CURRENT_BINARY_DIR}/utf8cppConfig.cmake
- ${CMAKE_CURRENT_BINARY_DIR}/utf8cppConfigVersion.cmake
- DESTINATION
- ${DEF_INSTALL_CMAKE_DIR}
- )
-endif()
-
-if(UTF8_SAMPLES)
- add_executable(docsample ${PROJECT_SOURCE_DIR}/samples/docsample.cpp)
- target_link_libraries(docsample PRIVATE utf8::cpp)
-endif()
-
-if(UTF8_TESTS)
- enable_testing()
- add_subdirectory(tests)
-endif()
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/LICENSE b/graphics/asymptote/LspCpp/third_party/utfcpp/LICENSE
deleted file mode 100644
index 36b7cd93cd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Boost Software License - Version 1.0 - August 17th, 2003
-
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/README.md b/graphics/asymptote/LspCpp/third_party/utfcpp/README.md
deleted file mode 100644
index 02d9f75d93..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/README.md
+++ /dev/null
@@ -1,1503 +0,0 @@
-# UTF8-CPP: UTF-8 with C++ in a Portable Way
-
-
-## Introduction
-
-C++ developers miss an easy and portable way of handling Unicode encoded strings. The original C++ Standard (known as C++98 or C++03) is Unicode agnostic. C++11 provides some support for Unicode on core language and library level: u8, u, and U character and string literals, char16_t and char32_t character types, u16string and u32string library classes, and codecvt support for conversions between Unicode encoding forms. In the meantime, developers use third party libraries like ICU, OS specific capabilities, or simply roll out their own solutions.
-
-In order to easily handle UTF-8 encoded Unicode strings, I came up with a small, C++98 compatible generic library. For anybody used to work with STL algorithms and iterators, it should be easy and natural to use. The code is freely available for any purpose - check out the [license](./LICENSE). The library has been used a lot in the past ten years both in commercial and open-source projects and is considered feature-complete now. If you run into bugs or performance issues, please let me know and I'll do my best to address them.
-
-The purpose of this article is not to offer an introduction to Unicode in general, and UTF-8 in particular. If you are not familiar with Unicode, be sure to check out [Unicode Home Page](http://www.unicode.org/) or some other source of information for Unicode. Also, it is not my aim to advocate the use of UTF-8 encoded strings in C++ programs; if you want to handle UTF-8 encoded strings from C++, I am sure you have good reasons for it.
-
-## Examples of use
-
-### Introductory Sample
-
-To illustrate the use of the library, let's start with a small but complete program that opens a file containing UTF-8 encoded text, reads it line by line, checks each line for invalid UTF-8 byte sequences, and converts it to UTF-16 encoding and back to UTF-8:
-
-```cpp
-#include <fstream>
-#include <iostream>
-#include <string>
-#include <vector>
-#include "utf8.h"
-using namespace std;
-int main(int argc, char** argv)
-{
- if (argc != 2) {
- cout << "\nUsage: docsample filename\n";
- return 0;
- }
- const char* test_file_path = argv[1];
- // Open the test file (must be UTF-8 encoded)
- ifstream fs8(test_file_path);
- if (!fs8.is_open()) {
- cout << "Could not open " << test_file_path << endl;
- return 0;
- }
-
- unsigned line_count = 1;
- string line;
- // Play with all the lines in the file
- while (getline(fs8, line)) {
- // check for invalid utf-8 (for a simple yes/no check, there is also utf8::is_valid function)
-#if __cplusplus >= 201103L // C++ 11 or later
- auto end_it = utf8::find_invalid(line.begin(), line.end());
-#else
- string::iterator end_it = utf8::find_invalid(line.begin(), line.end());
-#endif // C++ 11
- if (end_it != line.end()) {
- cout << "Invalid UTF-8 encoding detected at line " << line_count << "\n";
- cout << "This part is fine: " << string(line.begin(), end_it) << "\n";
- }
- // Get the line length (at least for the valid part)
- int length = utf8::distance(line.begin(), end_it);
- cout << "Length of line " << line_count << " is " << length << "\n";
-
- // Convert it to utf-16
-#if __cplusplus >= 201103L // C++ 11 or later
- u16string utf16line = utf8::utf8to16(line);
-#else
- vector<unsigned short> utf16line;
- utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-#endif // C++ 11
- // And back to utf-8;
-#if __cplusplus >= 201103L // C++ 11 or later
- string utf8line = utf8::utf16to8(utf16line);
-#else
- string utf8line;
- utf8::utf16to8(utf16line.begin(), utf16line.end(), back_inserter(utf8line));
-#endif // C++ 11
- // Confirm that the conversion went OK:
- if (utf8line != string(line.begin(), end_it))
- cout << "Error in UTF-16 conversion at line: " << line_count << "\n";
-
- line_count++;
- }
-
- return 0;
-}
-```
-
-In the previous code sample, for each line we performed a detection of invalid UTF-8 sequences with `find_invalid`; the number of characters (more precisely - the number of Unicode code points, including the end of line and even BOM if there is one) in each line was determined with a use of `utf8::distance`; finally, we have converted each line to UTF-16 encoding with `utf8to16` and back to UTF-8 with `utf16to8`.
-
-Note a different pattern of usage for old compilers. For instance, this is how we convert
-a UTF-8 encoded string to a UTF-16 encoded one with a pre - C++11 compiler:
-```cpp
- vector<unsigned short> utf16line;
- utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-```
-
-With a more modern compiler, the same operation would look like:
-```cpp
- u16string utf16line = utf8::utf8to16(line);
-```
-If `__cplusplus` macro points to a C++ 11 or later, the library exposes API that takes into
-account C++ standard Unicode strings and move semantics. With an older compiler, it is still
-possible to use the same functionality, just in a little less convenient way
-
-In case you do not trust the `__cplusplus` macro or, for instance, do not want to include
-the C++ 11 helper functions even with a modern compiler, define `UTF_CPP_CPLUSPLUS` macro
-before including `utf8.h` and assign it a value for the standard you want to use - the values are the same as for the `__cplusplus` macro. This can be also useful with compilers that are conservative in setting the `__cplusplus` macro even if they have a good support for a recent standard edition - Microsoft's Visual C++ is one example.
-
-### Checking if a file contains valid UTF-8 text
-
-Here is a function that checks whether the content of a file is valid UTF-8 encoded text without reading the content into the memory:
-
-```cpp
-bool valid_utf8_file(const char* file_name)
-{
- ifstream ifs(file_name);
- if (!ifs)
- return false; // even better, throw here
-
- istreambuf_iterator<char> it(ifs.rdbuf());
- istreambuf_iterator<char> eos;
-
- return utf8::is_valid(it, eos);
-}
-```
-
-Because the function `utf8::is_valid()` works with input iterators, we were able to pass an `istreambuf_iterator` to `it` and read the content of the file directly without loading it to the memory first.
-
-Note that other functions that take input iterator arguments can be used in a similar way. For instance, to read the content of a UTF-8 encoded text file and convert the text to UTF-16, just do something like:
-
-```cpp
- utf8::utf8to16(it, eos, back_inserter(u16string));
-```
-
-### Ensure that a string contains valid UTF-8 text
-
-If we have some text that "probably" contains UTF-8 encoded text and we want to replace any invalid UTF-8 sequence with a replacement character, something like the following function may be used:
-
-```cpp
-void fix_utf8_string(std::string& str)
-{
- std::string temp;
- utf8::replace_invalid(str.begin(), str.end(), back_inserter(temp));
- str = temp;
-}
-```
-
-The function will replace any invalid UTF-8 sequence with a Unicode replacement character. There is an overloaded function that enables the caller to supply their own replacement character.
-
-
-## Points of interest
-
-#### Design goals and decisions
-
-The library was designed to be:
-
-1. Generic: for better or worse, there are many C++ string classes out there, and the library should work with as many of them as possible.
-2. Portable: the library should be portable both across different platforms and compilers. The only non-portable code is a small section that declares unsigned integers of different sizes: three typedefs. They can be changed by the users of the library if they don't match their platform. The default setting should work for Windows (both 32 and 64 bit), and most 32 bit and 64 bit Unix derivatives. Support for post C++03 language features is included for modern compilers at API level only, so the library should work even with pretty old compilers.
-3. Lightweight: follow the "pay only for what you use" guideline.
-4. Unintrusive: avoid forcing any particular design or even programming style on the user. This is a library, not a framework.
-
-#### Alternatives
-
-In case you want to look into other means of working with UTF-8 strings from C++, here is the list of solutions I am aware of:
-
-1. [ICU Library](http://icu.sourceforge.net/). It is very powerful, complete, feature-rich, mature, and widely used. Also big, intrusive, non-generic, and doesn't play well with the Standard Library. I definitely recommend looking at ICU even if you don't plan to use it.
-2. C++11 language and library features. Still far from complete, and not easy to use.
-3. [Glib::ustring](http://www.gtkmm.org/gtkmm2/docs/tutorial/html/ch03s04.html). A class specifically made to work with UTF-8 strings, and also feel like `std::string`. If you prefer to have yet another string class in your code, it may be worth a look. Be aware of the licensing issues, though.
-4. Platform dependent solutions: Windows and POSIX have functions to convert strings from one encoding to another. That is only a subset of what my library offers, but if that is all you need it may be good enough.
-
-
-## Reference
-
-### Functions From utf8 Namespace
-
-#### utf8::append
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence to a UTF-8 string.
-
-```cpp
-void append(char32_t cp, std::string& s);
-```
-
-`cp`: a code point to append to the string.
-`s`: a utf-8 encoded string to append the code point to.
-
-Example of use:
-
-```cpp
-std::string u;
-append(0x0448, u);
-assert (u[0] == char(0xd1) && u[1] == char(0x88) && u.length() == 2);
-```
-
-In case of an invalid code point, a `utf8::invalid_code_point` exception is thrown.
-
-
-#### utf8::append
-
-Available in version 1.0 and later.
-
-Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence to a UTF-8 string.
-
-```cpp
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-```
-
-`octet_iterator`: an output iterator.
-`cp`: a 32 bit integer representing a code point to append to the sequence.
-`result`: an output iterator to the place in the sequence where to append the code point.
-Return value: an iterator pointing to the place after the newly appended sequence.
-
-Example of use:
-
-```cpp
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-```
-
-Note that `append` does not allocate any memory - it is the burden of the caller to make sure there is enough memory allocated for the operation. To make things more interesting, `append` can add anywhere between 1 and 4 octets to the sequence. In practice, you would most often want to use `std::back_inserter` to ensure that the necessary memory is allocated.
-
-In case of an invalid code point, a `utf8::invalid_code_point` exception is thrown.
-
-#### utf8::next
-
-Available in version 1.0 and later.
-
-Given the iterator to the beginning of the UTF-8 sequence, it returns the code point and moves the iterator to the next position.
-
-```cpp
-template <typename octet_iterator>
-uint32_t next(octet_iterator& it, octet_iterator end);
-```
-
-`octet_iterator`: an input iterator.
-`it`: a reference to an iterator pointing to the beginning of an UTF-8 encoded code point. After the function returns, it is incremented to point to the beginning of the next code point.
-`end`: end of the UTF-8 sequence to be processed. If `it` gets equal to `end` during the extraction of a code point, an `utf8::not_enough_room` exception is thrown.
-Return value: the 32 bit representation of the processed UTF-8 code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-```
-
-This function is typically used to iterate through a UTF-8 encoded string.
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-#### utf8::peek_next
-
-Available in version 2.1 and later.
-
-Given the iterator to the beginning of the UTF-8 sequence, it returns the code point for the following sequence without changing the value of the iterator.
-
-```cpp
-template <typename octet_iterator>
-uint32_t peek_next(octet_iterator it, octet_iterator end);
-```
-
-
-`octet_iterator`: an input iterator.
-`it`: an iterator pointing to the beginning of an UTF-8 encoded code point.
-`end`: end of the UTF-8 sequence to be processed. If `it` gets equal to `end` during the extraction of a code point, an `utf8::not_enough_room` exception is thrown.
-Return value: the 32 bit representation of the processed UTF-8 code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = peek_next(w, twochars + 6);
-assert (cp == 0x65e5);
-assert (w == twochars);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-#### utf8::prior
-
-Available in version 1.02 and later.
-
-Given a reference to an iterator pointing to an octet in a UTF-8 sequence, it decreases the iterator until it hits the beginning of the previous UTF-8 encoded code point and returns the 32 bits representation of the code point.
-
-```cpp
-template <typename octet_iterator>
-uint32_t prior(octet_iterator& it, octet_iterator start);
-```
-
-`octet_iterator`: a bidirectional iterator.
-`it`: a reference pointing to an octet within a UTF-8 encoded string. After the function returns, it is decremented to point to the beginning of the previous code point.
-`start`: an iterator to the beginning of the sequence where the search for the beginning of a code point is performed. It is a safety measure to prevent passing the beginning of the string in the search for a UTF-8 lead octet.
- Return value: the 32 bit representation of the previous code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars + 3;
-int cp = prior (w, twochars);
-assert (cp == 0x65e5);
-assert (w == twochars);
-```
-
-This function has two purposes: one is two iterate backwards through a UTF-8 encoded string. Note that it is usually a better idea to iterate forward instead, since `utf8::next` is faster. The second purpose is to find a beginning of a UTF-8 sequence if we have a random position within a string. Note that in that case `utf8::prior` may not detect an invalid UTF-8 sequence in some scenarios: for instance if there are superfluous trail octets, it will just skip them.
-
-`it` will typically point to the beginning of a code point, and `start` will point to the beginning of the string to ensure we don't go backwards too far. `it` is decreased until it points to a lead UTF-8 octet, and then the UTF-8 sequence beginning with that octet is decoded to a 32 bit representation and returned.
-
-In case `start` is reached before a UTF-8 lead octet is hit, or if an invalid UTF-8 sequence is started by the lead octet, an `invalid_utf8` exception is thrown.
-
-In case `start` equals `it`, a `not_enough_room` exception is thrown.
-
-#### utf8::advance
-Available in version 1.0 and later.
-
-Advances an iterator by the specified number of code points within an UTF-8 sequence.
-
-```cpp
-template <typename octet_iterator, typename distance_type>
-void advance (octet_iterator& it, distance_type n, octet_iterator end);
-```
-
-`octet_iterator`: an input iterator.
-`distance_type`: an integral type convertible to `octet_iterator`'s difference type.
-`it`: a reference to an iterator pointing to the beginning of an UTF-8 encoded code point. After the function returns, it is incremented to point to the nth following code point.
-`n`: number of code points `it` should be advanced. A negative value means decrement.
-`end`: limit of the UTF-8 sequence to be processed. If `n` is positive and `it` gets equal to `end` during the extraction of a code point, an `utf8::not_enough_room` exception is thrown. If `n` is negative and `it` reaches `end` while `it` points t a trail byte of a UTF-8 sequence, a `utf8::invalid_code_point` exception is thrown.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-unsigned char* w = twochars;
-advance (w, 2, twochars + 6);
-assert (w == twochars + 5);
-advance (w, -2, twochars);
-assert (w == twochars);
-```
-
-In case of an invalid code point, a `utf8::invalid_code_point` exception is thrown.
-
-#### utf8::distance
-
-Available in version 1.0 and later.
-
-Given the iterators to two UTF-8 encoded code points in a sequence, returns the number of code points between them.
-
-```cpp
-template <typename octet_iterator>
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-```
-
-`octet_iterator`: an input iterator.
-`first`: an iterator to a beginning of a UTF-8 encoded code point.
-`last`: an iterator to a "post-end" of the last UTF-8 encoded code point in the sequence we are trying to determine the length. It can be the beginning of a new code point, or not.
- Return value the distance between the iterators, in code points.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::distance(twochars, twochars + 5);
-assert (dist == 2);
-```
-
-This function is used to find the length (in code points) of a UTF-8 encoded string. The reason it is called _distance_, rather than, say, _length_ is mainly because developers are used that _length_ is an O(1) function. Computing the length of an UTF-8 string is a linear operation, and it looked better to model it after `std::distance` algorithm.
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown. If `last` does not point to the past-of-end of a UTF-8 sequence, a `utf8::not_enough_room` exception is thrown.
-
-#### utf8::utf16to8
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Converts a UTF-16 encoded string to UTF-8.
-
-```cpp
-std::string utf16to8(const std::u16string& s);
-```
-
-`s`: a UTF-16 encoded string.
-Return value: A UTF-8 encoded string.
-
-Example of use:
-
-```cpp
- u16string utf16string = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- string u = utf16to8(utf16string);
- assert (u.size() == 10);
-```
-
-In case of invalid UTF-16 sequence, a `utf8::invalid_utf16` exception is thrown.
-
-#### utf8::utf16to8
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Converts a UTF-16 encoded string to UTF-8.
-
-```cpp
-std::string utf16to8(std::u16string_view s);
-```
-
-`s`: a UTF-16 encoded string.
-Return value: A UTF-8 encoded string.
-
-Example of use:
-
-```cpp
- u16string utf16string = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- u16string_view utf16stringview(u16string);
- string u = utf16to8(utf16string);
- assert (u.size() == 10);
-```
-
-In case of invalid UTF-16 sequence, a `utf8::invalid_utf16` exception is thrown.
-
-
-#### utf8::utf16to8
-
-Available in version 1.0 and later.
-
-Converts a UTF-16 encoded string to UTF-8.
-
-```cpp
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-```
-
-`u16bit_iterator`: an input iterator.
-`octet_iterator`: an output iterator.
-`start`: an iterator pointing to the beginning of the UTF-16 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-16 encoded string to convert.
-`result`: an output iterator to the place in the UTF-8 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-8 string.
-
-Example of use:
-
-```cpp
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);
-```
-
-In case of invalid UTF-16 sequence, a `utf8::invalid_utf16` exception is thrown.
-
-#### utf8::utf8to16
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Converts an UTF-8 encoded string to UTF-16.
-
-```cpp
-std::u16string utf8to16(const std::string& s);
-```
-
-`s`: an UTF-8 encoded string to convert.
-Return value: A UTF-16 encoded string
-
-Example of use:
-
-```cpp
-string utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-u16string utf16result = utf8to16(utf8_with_surrogates);
-assert (utf16result.length() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-#### utf8::utf8to16
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Converts an UTF-8 encoded string to UTF-16.
-
-```cpp
-std::u16string utf8to16(std::string_view s);
-```
-
-`s`: an UTF-8 encoded string to convert.
-Return value: A UTF-16 encoded string
-
-Example of use:
-
-```cpp
-string_view utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-u16string utf16result = utf8to16(utf8_with_surrogates);
-assert (utf16result.length() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-
-#### utf8::utf8to16
-
-Available in version 1.0 and later.
-
-Converts an UTF-8 encoded string to UTF-16
-
-```cpp
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-```
-
-`octet_iterator`: an input iterator.
-`u16bit_iterator`: an output iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 encoded string to convert. < br /> `end`: an iterator pointing to pass-the-end of the UTF-8 encoded string to convert.
-`result`: an output iterator to the place in the UTF-16 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-16 string.
-
-Example of use:
-
-```cpp
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown. If `end` does not point to the past-of-end of a UTF-8 sequence, a `utf8::not_enough_room` exception is thrown.
-
-#### utf8::utf32to8
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Converts a UTF-32 encoded string to UTF-8.
-
-```cpp
-std::string utf32to8(const std::u32string& s);
-```
-
-`s`: a UTF-32 encoded string.
-Return value: a UTF-8 encoded string.
-
-Example of use:
-
-```cpp
-u32string utf32string = {0x448, 0x65E5, 0x10346};
-string utf8result = utf32to8(utf32string);
-assert (utf8result.size() == 9);
-```
-
-In case of invalid UTF-32 string, a `utf8::invalid_code_point` exception is thrown.
-
-#### utf8::utf32to8
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Converts a UTF-32 encoded string to UTF-8.
-
-```cpp
-std::string utf32to8(std::u32string_view s);
-```
-
-`s`: a UTF-32 encoded string.
-Return value: a UTF-8 encoded string.
-
-Example of use:
-
-```cpp
-u32string utf32string = {0x448, 0x65E5, 0x10346};
-u32string_view utf32stringview(utf32string);
-string utf8result = utf32to8(utf32stringview);
-assert (utf8result.size() == 9);
-```
-
-In case of invalid UTF-32 string, a `utf8::invalid_code_point` exception is thrown.
-
-
-#### utf8::utf32to8
-
-Available in version 1.0 and later.
-
-Converts a UTF-32 encoded string to UTF-8.
-
-```cpp
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-```
-
-`octet_iterator`: an output iterator.
-`u32bit_iterator`: an input iterator.
-`start`: an iterator pointing to the beginning of the UTF-32 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-32 encoded string to convert.
-`result`: an output iterator to the place in the UTF-8 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-8 string.
-
-Example of use:
-
-```cpp
-int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-```
-
-In case of invalid UTF-32 string, a `utf8::invalid_code_point` exception is thrown.
-
-#### utf8::utf8to32
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Converts a UTF-8 encoded string to UTF-32.
-
-```cpp
-std::u32string utf8to32(const std::string& s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: a UTF-32 encoded string.
-
-Example of use:
-
-```cpp
-const char* twochars = "\xe6\x97\xa5\xd1\x88";
-u32string utf32result = utf8to32(twochars);
-assert (utf32result.size() == 2);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-#### utf8::utf8to32
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Converts a UTF-8 encoded string to UTF-32.
-
-```cpp
-std::u32string utf8to32(std::string_view s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: a UTF-32 encoded string.
-
-Example of use:
-
-```cpp
-string_view twochars = "\xe6\x97\xa5\xd1\x88";
-u32string utf32result = utf8to32(twochars);
-assert (utf32result.size() == 2);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown.
-
-
-#### utf8::utf8to32
-
-Available in version 1.0 and later.
-
-Converts a UTF-8 encoded string to UTF-32.
-
-```cpp
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-```
-
-`octet_iterator`: an input iterator.
-`u32bit_iterator`: an output iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-8 encoded string to convert.
-`result`: an output iterator to the place in the UTF-32 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-32 string.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-```
-
-In case of an invalid UTF-8 sequence, a `utf8::invalid_utf8` exception is thrown. If `end` does not point to the past-of-end of a UTF-8 sequence, a `utf8::not_enough_room` exception is thrown.
-
-#### utf8::find_invalid
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Detects an invalid sequence within a UTF-8 string.
-
-```cpp
-std::size_t find_invalid(const std::string& s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: the index of the first invalid octet in the UTF-8 string. In case none were found, equals `std::string::npos`.
-
-Example of use:
-
-```cpp
-string utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
-auto invalid = find_invalid(utf_invalid);
-assert (invalid == 5);
-```
-
-This function is typically used to make sure a UTF-8 string is valid before processing it with other functions. It is especially important to call it if before doing any of the _unchecked_ operations on it.
-
-#### utf8::find_invalid
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Detects an invalid sequence within a UTF-8 string.
-
-```cpp
-std::size_t find_invalid(std::string_view s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: the index of the first invalid octet in the UTF-8 string. In case none were found, equals `std::string_view::npos`.
-
-Example of use:
-
-```cpp
-string_view utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
-auto invalid = find_invalid(utf_invalid);
-assert (invalid == 5);
-```
-
-This function is typically used to make sure a UTF-8 string is valid before processing it with other functions. It is especially important to call it if before doing any of the _unchecked_ operations on it.
-
-
-#### utf8::find_invalid
-
-Available in version 1.0 and later.
-
-Detects an invalid sequence within a UTF-8 string.
-
-```cpp
-template <typename octet_iterator>
-octet_iterator find_invalid(octet_iterator start, octet_iterator end);
-```
-
-`octet_iterator`: an input iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 string to test for validity.
-`end`: an iterator pointing to pass-the-end of the UTF-8 string to test for validity.
-Return value: an iterator pointing to the first invalid octet in the UTF-8 string. In case none were found, equals `end`.
-
-Example of use:
-
-```cpp
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-char* invalid = find_invalid(utf_invalid, utf_invalid + 6);
-assert (invalid == utf_invalid + 5);
-```
-
-This function is typically used to make sure a UTF-8 string is valid before processing it with other functions. It is especially important to call it if before doing any of the _unchecked_ operations on it.
-
-#### utf8::is_valid
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Checks whether a string object contains valid UTF-8 encoded text.
-
-```cpp
-bool is_valid(const std::string& s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: `true` if the string contains valid UTF-8 encoded text; `false` if not.
-
-Example of use:
-
-```cpp
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid);
-assert (bvalid == false);
-```
-
-You may want to use `is_valid` to make sure that a string contains valid UTF-8 text without the need to know where it fails if it is not valid.
-
-#### utf8::is_valid
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Checks whether a string object contains valid UTF-8 encoded text.
-
-```cpp
-bool is_valid(std::string_view s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: `true` if the string contains valid UTF-8 encoded text; `false` if not.
-
-Example of use:
-
-```cpp
-string_view utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid);
-assert (bvalid == false);
-```
-
-You may want to use `is_valid` to make sure that a string contains valid UTF-8 text without the need to know where it fails if it is not valid.
-
-
-#### utf8::is_valid
-
-Available in version 1.0 and later.
-
-Checks whether a sequence of octets is a valid UTF-8 string.
-
-```cpp
-template <typename octet_iterator>
-bool is_valid(octet_iterator start, octet_iterator end);
-```
-
-`octet_iterator`: an input iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 string to test for validity.
-`end`: an iterator pointing to pass-the-end of the UTF-8 string to test for validity.
-Return value: `true` if the sequence is a valid UTF-8 string; `false` if not.
-
-Example of use:
-
-```cpp
-char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
-bool bvalid = is_valid(utf_invalid, utf_invalid + 6);
-assert (bvalid == false);
-```
-
-`is_valid` is a shorthand for `find_invalid(start, end) == end;`. You may want to use it to make sure that a byte sequence is a valid UTF-8 string without the need to know where it fails if it is not valid.
-
-#### utf8::replace_invalid
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Replaces all invalid UTF-8 sequences within a string with a replacement marker.
-
-```cpp
-std::string replace_invalid(const std::string& s, char32_t replacement);
-std::string replace_invalid(const std::string& s);
-```
-
-`s`: a UTF-8 encoded string.
-`replacement`: A Unicode code point for the replacement marker. The version without this parameter assumes the value `0xfffd`
-Return value: A UTF-8 encoded string with replaced invalid sequences.
-
-Example of use:
-
-```cpp
-string invalid_sequence = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-string replace_invalid_result = replace_invalid(invalid_sequence, '?');
-bvalid = is_valid(replace_invalid_result);
-assert (bvalid);
-const string fixed_invalid_sequence = "a????z";
-assert (fixed_invalid_sequence == replace_invalid_result);
-```
-
-#### utf8::replace_invalid
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Replaces all invalid UTF-8 sequences within a string with a replacement marker.
-
-```cpp
-std::string replace_invalid(std::string_view s, char32_t replacement);
-std::string replace_invalid(std::string_view s);
-```
-
-`s`: a UTF-8 encoded string.
-`replacement`: A Unicode code point for the replacement marker. The version without this parameter assumes the value `0xfffd`
-Return value: A UTF-8 encoded string with replaced invalid sequences.
-
-Example of use:
-
-```cpp
-string_view invalid_sequence = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-string replace_invalid_result = replace_invalid(invalid_sequence, '?');
-bool bvalid = is_valid(replace_invalid_result);
-assert (bvalid);
-const string fixed_invalid_sequence = "a????z";
-assert(fixed_invalid_sequence, replace_invalid_result);
-```
-
-
-#### utf8::replace_invalid
-
-Available in version 2.0 and later.
-
-Replaces all invalid UTF-8 sequences within a string with a replacement marker.
-
-```cpp
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement);
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out);
-```
-
-`octet_iterator`: an input iterator.
-`output_iterator`: an output iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 string to look for invalid UTF-8 sequences.
-`end`: an iterator pointing to pass-the-end of the UTF-8 string to look for invalid UTF-8 sequences.
-`out`: An output iterator to the range where the result of replacement is stored.
-`replacement`: A Unicode code point for the replacement marker. The version without this parameter assumes the value `0xfffd`
-Return value: An iterator pointing to the place after the UTF-8 string with replaced invalid sequences.
-
-Example of use:
-
-```cpp
-char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-vector<char> replace_invalid_result;
-replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), back_inserter(replace_invalid_result), '?');
-bvalid = is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
-assert (bvalid);
-char* fixed_invalid_sequence = "a????z";
-assert (std::equal(replace_invalid_result.begin(), replace_invalid_result.end(), fixed_invalid_sequence));
-```
-
-`replace_invalid` does not perform in-place replacement of invalid sequences. Rather, it produces a copy of the original string with the invalid sequences replaced with a replacement marker. Therefore, `out` must not be in the `[start, end]` range.
-
-#### utf8::starts_with_bom
-
-Available in version 3.0 and later. Requires a C++ 11 compliant compiler.
-
-Checks whether a string starts with a UTF-8 byte order mark (BOM)
-
-```cpp
-bool starts_with_bom(const std::string& s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: `true` if the string starts with a UTF-8 byte order mark; `false` if not.
-
-Example of use:
-
-```cpp
-string byte_order_mark = {char(0xef), char(0xbb), char(0xbf)};
-bool bbom = starts_with_bom(byte_order_mark);
-assert (bbom == true);
-string threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-bool no_bbom = starts_with_bom(threechars);
-assert (no_bbom == false);
- ```
-
-The typical use of this function is to check the first three bytes of a file. If they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 encoded text.
-
-
-#### utf8::starts_with_bom
-
-Available in version 3.2 and later. Requires a C++ 17 compliant compiler.
-
-Checks whether a string starts with a UTF-8 byte order mark (BOM)
-
-```cpp
-bool starts_with_bom(std::string_view s);
-```
-
-`s`: a UTF-8 encoded string.
-Return value: `true` if the string starts with a UTF-8 byte order mark; `false` if not.
-
-Example of use:
-
-```cpp
-string byte_order_mark = {char(0xef), char(0xbb), char(0xbf)};
-string_view byte_order_mark_view(byte_order_mark);
-bool bbom = starts_with_bom(byte_order_mark_view);
-assert (bbom);
-string_view threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-bool no_bbom = starts_with_bom(threechars);
-assert (!no_bbom);
- ```
-
-The typical use of this function is to check the first three bytes of a file. If they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 encoded text.
-
-
-#### utf8::starts_with_bom
-
-Available in version 2.3 and later.
-
-Checks whether an octet sequence starts with a UTF-8 byte order mark (BOM)
-
-```cpp
-template <typename octet_iterator>
-bool starts_with_bom (octet_iterator it, octet_iterator end);
-```
-
-`octet_iterator`: an input iterator.
-`it`: beginning of the octet sequence to check
-`end`: pass-end of the sequence to check
-Return value: `true` if the sequence starts with a UTF-8 byte order mark; `false` if not.
-
-Example of use:
-
-```cpp
-unsigned char byte_order_mark[] = {0xef, 0xbb, 0xbf};
-bool bbom = starts_with_bom(byte_order_mark, byte_order_mark + sizeof(byte_order_mark));
-assert (bbom == true);
-```
-
-The typical use of this function is to check the first three bytes of a file. If they form the UTF-8 BOM, we want to skip them before processing the actual UTF-8 encoded text.
-
-### Types From utf8 Namespace
-
-#### utf8::exception
-
-Available in version 2.3 and later.
-
-Base class for the exceptions thrown by UTF CPP library functions.
-
-```cpp
-class exception : public std::exception {};
-```
-
-Example of use:
-
-```cpp
-try {
- code_that_uses_utf_cpp_library();
-}
-catch(const utf8::exception& utfcpp_ex) {
- cerr << utfcpp_ex.what();
-}
-```
-
-#### utf8::invalid_code_point
-
-Available in version 1.0 and later.
-
-Thrown by UTF8 CPP functions such as `advance` and `next` if an UTF-8 sequence represents and invalid code point.
-
-```cpp
-class invalid_code_point : public exception {
-public:
- uint32_t code_point() const;
-};
-```
-
-Member function `code_point()` can be used to determine the invalid code point that caused the exception to be thrown.
-
-#### utf8::invalid_utf8
-
-Available in version 1.0 and later.
-
-Thrown by UTF8 CPP functions such as `next` and `prior` if an invalid UTF-8 sequence is detected during decoding.
-
-```cpp
-class invalid_utf8 : public exception {
-public:
- uint8_t utf8_octet() const;
-};
-```
-
-Member function `utf8_octet()` can be used to determine the beginning of the byte sequence that caused the exception to be thrown.
-
-#### utf8::invalid_utf16
-
-Available in version 1.0 and later.
-
-Thrown by UTF8 CPP function `utf16to8` if an invalid UTF-16 sequence is detected during decoding.
-
-```cpp
-class invalid_utf16 : public exception {
-public:
- uint16_t utf16_word() const;
-};
-```
-
-Member function `utf16_word()` can be used to determine the UTF-16 code unit that caused the exception to be thrown.
-
-#### utf8::not_enough_room
-
-Available in version 1.0 and later.
-
-Thrown by UTF8 CPP functions such as `next` if the end of the decoded UTF-8 sequence was reached before the code point was decoded.
-
-```cpp
-class not_enough_room : public exception {};
-```
-
-#### utf8::iterator
-
-Available in version 2.0 and later.
-
-Adapts the underlying octet iterator to iterate over the sequence of code points, rather than raw octets.
-
-```cpp
-template <typename octet_iterator>
-class iterator;
-```
-
-##### Member functions
-
-`iterator();` the deafult constructor; the underlying octet_iterator is constructed with its default constructor.
-
-`explicit iterator (const octet_iterator& octet_it, const octet_iterator& range_start, const octet_iterator& range_end);` a constructor that initializes the underlying octet_iterator with octet_it and sets the range in which the iterator is considered valid.
-
-`octet_iterator base () const;` returns the underlying octet_iterator.
-
-`uint32_t operator * () const;` decodes the utf-8 sequence the underlying octet_iterator is pointing to and returns the code point.
-
-`bool operator == (const iterator& rhs) const;` returns `true` if the two underlying iterators are equal.
-
-`bool operator != (const iterator& rhs) const;` returns `true` if the two underlying iterators are not equal.
-
-`iterator& operator ++ ();` the prefix increment - moves the iterator to the next UTF-8 encoded code point.
-
-`iterator operator ++ (int);` the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one.
-
-`iterator& operator -- ();` the prefix decrement - moves the iterator to the previous UTF-8 encoded code point.
-
-`iterator operator -- (int);` the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one.
-
-Example of use:
-
-```cpp
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::iterator<char*> it(threechars, threechars, threechars + 9);
-utf8::iterator<char*> it2 = it;
-assert (it2 == it);
-assert (*it == 0x10346);
-assert (*(++it) == 0x65e5);
-assert ((*it++) == 0x65e5);
-assert (*it == 0x0448);
-assert (it != it2);
-utf8::iterator<char*> endit (threechars + 9, threechars, threechars + 9);
-assert (++it == endit);
-assert (*(--it) == 0x0448);
-assert ((*it--) == 0x0448);
-assert (*it == 0x65e5);
-assert (--it == utf8::iterator<char*>(threechars, threechars, threechars + 9));
-assert (*it == 0x10346);
-```
-
-The purpose of `utf8::iterator` adapter is to enable easy iteration as well as the use of STL algorithms with UTF-8 encoded strings. Increment and decrement operators are implemented in terms of `utf8::next()` and `utf8::prior()` functions.
-
-Note that `utf8::iterator` adapter is a checked iterator. It operates on the range specified in the constructor; any attempt to go out of that range will result in an exception. Even the comparison operators require both iterator object to be constructed against the same range - otherwise an exception is thrown. Typically, the range will be determined by sequence container functions `begin` and `end`, i.e.:
-
-```cpp
-std::string s = "example";
-utf8::iterator i (s.begin(), s.begin(), s.end());
-```
-
-### Functions From utf8::unchecked Namespace
-
-#### utf8::unchecked::append
-
-Available in version 1.0 and later.
-
-Encodes a 32 bit code point as a UTF-8 sequence of octets and appends the sequence to a UTF-8 string.
-
-```cpp
-template <typename octet_iterator>
-octet_iterator append(uint32_t cp, octet_iterator result);
-```
-
-`cp`: A 32 bit integer representing a code point to append to the sequence.
-`result`: An output iterator to the place in the sequence where to append the code point.
-Return value: An iterator pointing to the place after the newly appended sequence.
-
-Example of use:
-
-```cpp
-unsigned char u[5] = {0,0,0,0,0};
-unsigned char* end = unchecked::append(0x0448, u);
-assert (u[0] == 0xd1 && u[1] == 0x88 && u[2] == 0 && u[3] == 0 && u[4] == 0);
-```
-
-This is a faster but less safe version of `utf8::append`. It does not check for validity of the supplied code point, and may produce an invalid UTF-8 sequence.
-
-#### utf8::unchecked::next
-
-Available in version 1.0 and later.
-
-Given the iterator to the beginning of a UTF-8 sequence, it returns the code point and moves the iterator to the next position.
-
-```cpp
-template <typename octet_iterator>
-uint32_t next(octet_iterator& it);
-```
-
-`it`: a reference to an iterator pointing to the beginning of an UTF-8 encoded code point. After the function returns, it is incremented to point to the beginning of the next code point.
- Return value: the 32 bit representation of the processed UTF-8 code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::next(w);
-assert (cp == 0x65e5);
-assert (w == twochars + 3);
-```
-
-This is a faster but less safe version of `utf8::next`. It does not check for validity of the supplied UTF-8 sequence.
-
-#### utf8::unchecked::peek_next
-
-Available in version 2.1 and later.
-
-Given the iterator to the beginning of a UTF-8 sequence, it returns the code point.
-
-```cpp
-template <typename octet_iterator>
-uint32_t peek_next(octet_iterator it);
-```
-
-`it`: an iterator pointing to the beginning of an UTF-8 encoded code point.
-Return value: the 32 bit representation of the processed UTF-8 code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-int cp = unchecked::peek_next(w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-```
-
-This is a faster but less safe version of `utf8::peek_next`. It does not check for validity of the supplied UTF-8 sequence.
-
-#### utf8::unchecked::prior
-
-Available in version 1.02 and later.
-
-Given a reference to an iterator pointing to an octet in a UTF-8 sequence, it decreases the iterator until it hits the beginning of the previous UTF-8 encoded code point and returns the 32 bits representation of the code point.
-
-```cpp
-template <typename octet_iterator>
-uint32_t prior(octet_iterator& it);
-```
-
-`it`: a reference pointing to an octet within a UTF-8 encoded string. After the function returns, it is decremented to point to the beginning of the previous code point.
- Return value: the 32 bit representation of the previous code point.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars + 3;
-int cp = unchecked::prior (w);
-assert (cp == 0x65e5);
-assert (w == twochars);
-```
-
-This is a faster but less safe version of `utf8::prior`. It does not check for validity of the supplied UTF-8 sequence and offers no boundary checking.
-
-#### utf8::unchecked::advance
-
-Available in version 1.0 and later.
-
-Advances an iterator by the specified number of code points within an UTF-8 sequence.
-
-```cpp
-template <typename octet_iterator, typename distance_type>
-void advance (octet_iterator& it, distance_type n);
-```
-
-`it`: a reference to an iterator pointing to the beginning of an UTF-8 encoded code point. After the function returns, it is incremented to point to the nth following code point.
-`n`: number of code points `it` should be advanced. A negative value means decrement.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-char* w = twochars;
-unchecked::advance (w, 2);
-assert (w == twochars + 5);
-```
-
-This is a faster but less safe version of `utf8::advance`. It does not check for validity of the supplied UTF-8 sequence and offers no boundary checking.
-
-#### utf8::unchecked::distance
-
-Available in version 1.0 and later.
-
-Given the iterators to two UTF-8 encoded code points in a sequence, returns the number of code points between them.
-
-```cpp
-template <typename octet_iterator>
-typename std::iterator_traits<octet_iterator>::difference_type distance (octet_iterator first, octet_iterator last);
-```
-
-`first`: an iterator to a beginning of a UTF-8 encoded code point.
-`last`: an iterator to a "post-end" of the last UTF-8 encoded code point in the sequence we are trying to determine the length. It can be the beginning of a new code point, or not.
-Return value: the distance between the iterators, in code points.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-size_t dist = utf8::unchecked::distance(twochars, twochars + 5);
-assert (dist == 2);
-```
-
-This is a faster but less safe version of `utf8::distance`. It does not check for validity of the supplied UTF-8 sequence.
-
-#### utf8::unchecked::utf16to8
-
-Available in version 1.0 and later.
-
-Converts a UTF-16 encoded string to UTF-8.
-
-```cpp
-template <typename u16bit_iterator, typename octet_iterator>
-octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result);
-```
-
-`start`: an iterator pointing to the beginning of the UTF-16 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-16 encoded string to convert.
-`result`: an output iterator to the place in the UTF-8 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-8 string.
-
-Example of use:
-
-```cpp
-unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
-vector<unsigned char> utf8result;
-unchecked::utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
-assert (utf8result.size() == 10);
-```
-
-This is a faster but less safe version of `utf8::utf16to8`. It does not check for validity of the supplied UTF-16 sequence.
-
-#### utf8::unchecked::utf8to16
-
-Available in version 1.0 and later.
-
-Converts an UTF-8 encoded string to UTF-16
-
-```cpp
-template <typename u16bit_iterator, typename octet_iterator>
-u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result);
-```
-
-`start`: an iterator pointing to the beginning of the UTF-8 encoded string to convert. < br /> `end`: an iterator pointing to pass-the-end of the UTF-8 encoded string to convert.
-`result`: an output iterator to the place in the UTF-16 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-16 string.
-
-Example of use:
-
-```cpp
-char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
-vector <unsigned short> utf16result;
-unchecked::utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
-assert (utf16result.size() == 4);
-assert (utf16result[2] == 0xd834);
-assert (utf16result[3] == 0xdd1e);
-```
-
-This is a faster but less safe version of `utf8::utf8to16`. It does not check for validity of the supplied UTF-8 sequence.
-
-#### utf8::unchecked::utf32to8
-
-Available in version 1.0 and later.
-
-Converts a UTF-32 encoded string to UTF-8.
-
-```cpp
-template <typename octet_iterator, typename u32bit_iterator>
-octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result);
-```
-
-`start`: an iterator pointing to the beginning of the UTF-32 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-32 encoded string to convert.
-`result`: an output iterator to the place in the UTF-8 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-8 string.
-
-Example of use:
-
-```cpp
-int utf32string[] = {0x448, 0x65e5, 0x10346, 0};
-vector<unsigned char> utf8result;
-utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
-assert (utf8result.size() == 9);
-```
-
-This is a faster but less safe version of `utf8::utf32to8`. It does not check for validity of the supplied UTF-32 sequence.
-
-#### utf8::unchecked::utf8to32
-
-Available in version 1.0 and later.
-
-Converts a UTF-8 encoded string to UTF-32.
-
-```cpp
-template <typename octet_iterator, typename u32bit_iterator>
-u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result);
-```
-
-`start`: an iterator pointing to the beginning of the UTF-8 encoded string to convert.
-`end`: an iterator pointing to pass-the-end of the UTF-8 encoded string to convert.
-`result`: an output iterator to the place in the UTF-32 string where to append the result of conversion.
-Return value: An iterator pointing to the place after the appended UTF-32 string.
-
-Example of use:
-
-```cpp
-char* twochars = "\xe6\x97\xa5\xd1\x88";
-vector<int> utf32result;
-unchecked::utf8to32(twochars, twochars + 5, back_inserter(utf32result));
-assert (utf32result.size() == 2);
-```
-
-This is a faster but less safe version of `utf8::utf8to32`. It does not check for validity of the supplied UTF-8 sequence.
-
-#### utf8::unchecked::replace_invalid
-
-Available in version 3.1 and later.
-
-Replaces all invalid UTF-8 sequences within a string with a replacement marker.
-
-```cpp
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement);
-template <typename octet_iterator, typename output_iterator>
-output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out);
-```
-
-`octet_iterator`: an input iterator.
-`output_iterator`: an output iterator.
-`start`: an iterator pointing to the beginning of the UTF-8 string to look for invalid UTF-8 sequences.
-`end`: an iterator pointing to pass-the-end of the UTF-8 string to look for invalid UTF-8 sequences.
-`out`: An output iterator to the range where the result of replacement is stored.
-`replacement`: A Unicode code point for the replacement marker. The version without this parameter assumes the value `0xfffd`
-Return value: An iterator pointing to the place after the UTF-8 string with replaced invalid sequences.
-
-Example of use:
-
-```cpp
-char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
-vector<char> replace_invalid_result;
-unchecked::replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), back_inserter(replace_invalid_result), '?');
-bvalid = utf8::is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
-assert (bvalid);
-char* fixed_invalid_sequence = "a????z";
-assert (std::equal(replace_invalid_result.begin(), replace_invalid_result.end(), fixed_invalid_sequence));
-```
-
-`replace_invalid` does not perform in-place replacement of invalid sequences. Rather, it produces a copy of the original string with the invalid sequences replaced with a replacement marker. Therefore, `out` must not be in the `[start, end]` range.
-
-Unlike `utf8::replace_invalid`, this function does not verify validity of the replacement marker.
-
-### Types From utf8::unchecked Namespace
-
-#### utf8::iterator
-
-Available in version 2.0 and later.
-
-Adapts the underlying octet iterator to iterate over the sequence of code points, rather than raw octets.
-
-```cpp
-template <typename octet_iterator>
-class iterator;
-```
-
-##### Member functions
-
-`iterator();` the deafult constructor; the underlying octet_iterator is constructed with its default constructor.
-
-`explicit iterator (const octet_iterator& octet_it);` a constructor that initializes the underlying octet_iterator with `octet_it`.
-
-`octet_iterator base () const;` returns the underlying octet_iterator.
-
-`uint32_t operator * () const;` decodes the utf-8 sequence the underlying octet_iterator is pointing to and returns the code point.
-
-`bool operator == (const iterator& rhs) const;` returns `true` if the two underlying iterators are equal.
-
-`bool operator != (const iterator& rhs) const;` returns `true` if the two underlying iterators are not equal.
-
-`iterator& operator ++ ();` the prefix increment - moves the iterator to the next UTF-8 encoded code point.
-
-`iterator operator ++ (int);` the postfix increment - moves the iterator to the next UTF-8 encoded code point and returns the current one.
-
-`iterator& operator -- ();` the prefix decrement - moves the iterator to the previous UTF-8 encoded code point.
-
-`iterator operator -- (int);` the postfix decrement - moves the iterator to the previous UTF-8 encoded code point and returns the current one.
-
-Example of use:
-
-```cpp
-char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
-utf8::unchecked::iterator<char*> un_it(threechars);
-utf8::unchecked::iterator<char*> un_it2 = un_it;
-assert (un_it2 == un_it);
-assert (*un_it == 0x10346);
-assert (*(++un_it) == 0x65e5);
-assert ((*un_it++) == 0x65e5);
-assert (*un_it == 0x0448);
-assert (un_it != un_it2);
-utf8::::unchecked::iterator<char*> un_endit (threechars + 9);
-assert (++un_it == un_endit);
-assert (*(--un_it) == 0x0448);
-assert ((*un_it--) == 0x0448);
-assert (*un_it == 0x65e5);
-assert (--un_it == utf8::unchecked::iterator<char*>(threechars));
-assert (*un_it == 0x10346);
-```
-
-This is an unchecked version of `utf8::iterator`. It is faster in many cases, but offers no validity or range checks.
-
-## Links
-
-1. [The Unicode Consortium](http://www.unicode.org/).
-2. [ICU Library](http://icu.sourceforge.net/).
-3. [UTF-8 at Wikipedia](http://en.wikipedia.org/wiki/UTF-8)
-4. [UTF-8 and Unicode FAQ for Unix/Linux](http://www.cl.cam.ac.uk/~mgk25/unicode.html)
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/samples/docsample.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/samples/docsample.cpp
deleted file mode 100644
index f1ec6b652c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/samples/docsample.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-#include "../source/utf8.h"
-#include <iostream>
-#include <fstream>
-#include <string>
-#include <vector>
-
-
-using namespace std;
-
-int main(int argc, char** argv)
-{
- if (argc != 2) {
- cout << "\nUsage: docsample filename\n";
- return 0;
- }
- const char* test_file_path = argv[1];
- // Open the test file (must be UTF-8 encoded)
- ifstream fs8(test_file_path);
- if (!fs8.is_open()) {
- cout << "Could not open " << test_file_path << endl;
- return 0;
- }
-
- unsigned line_count = 1;
- string line;
- // Play with all the lines in the file
- while (getline(fs8, line)) {
- // check for invalid utf-8 (for a simple yes/no check, there is also utf8::is_valid function)
-#if __cplusplus >= 201103L // C++ 11 or later
- auto end_it = utf8::find_invalid(line.begin(), line.end());
-#else
- string::iterator end_it = utf8::find_invalid(line.begin(), line.end());
-#endif // C++ 11
- if (end_it != line.end()) {
- cout << "Invalid UTF-8 encoding detected at line " << line_count << "\n";
- cout << "This part is fine: " << string(line.begin(), end_it) << "\n";
- }
- // Get the line length (at least for the valid part)
- ptrdiff_t length = utf8::distance(line.begin(), end_it);
- cout << "Length of line " << line_count << " is " << length << "\n";
-
- // Convert it to utf-16
-#if __cplusplus >= 201103L // C++ 11 or later
- u16string utf16line = utf8::utf8to16(line);
-#else
- vector<unsigned short> utf16line;
- utf8::utf8to16(line.begin(), end_it, back_inserter(utf16line));
-#endif // C++ 11
- // And back to utf-8;
-#if __cplusplus >= 201103L // C++ 11 or later
- string utf8line = utf8::utf16to8(utf16line);
-#else
- string utf8line;
- utf8::utf16to8(utf16line.begin(), utf16line.end(), back_inserter(utf8line));
-#endif // C++ 11
- // Confirm that the conversion went OK:
- if (utf8line != string(line.begin(), end_it))
- cout << "Error in UTF-16 conversion at line: " << line_count << "\n";
-
- line_count++;
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8.h
deleted file mode 100644
index 82b13f59f9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2006 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "utf8/checked.h"
-#include "utf8/unchecked.h"
-
-#endif // header guard
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/checked.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/checked.h
deleted file mode 100644
index 512dcc2fba..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/checked.h
+++ /dev/null
@@ -1,319 +0,0 @@
-// Copyright 2006-2016 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "core.h"
-#include <stdexcept>
-
-namespace utf8
-{
- // Base for the exceptions that may be thrown from the library
- class exception : public ::std::exception {
- };
-
- // Exceptions that may be thrown from the library functions.
- class invalid_code_point : public exception {
- uint32_t cp;
- public:
- invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
- virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid code point"; }
- uint32_t code_point() const {return cp;}
- };
-
- class invalid_utf8 : public exception {
- uint8_t u8;
- public:
- invalid_utf8 (uint8_t u) : u8(u) {}
- invalid_utf8 (char c) : u8(static_cast<uint8_t>(c)) {}
- virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid UTF-8"; }
- uint8_t utf8_octet() const {return u8;}
- };
-
- class invalid_utf16 : public exception {
- uint16_t u16;
- public:
- invalid_utf16 (uint16_t u) : u16(u) {}
- virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid UTF-16"; }
- uint16_t utf16_word() const {return u16;}
- };
-
- class not_enough_room : public exception {
- public:
- virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Not enough space"; }
- };
-
- /// The library API - functions intended to be called by the users
-
- template <typename octet_iterator>
- octet_iterator append(uint32_t cp, octet_iterator result)
- {
- if (!utf8::internal::is_code_point_valid(cp))
- throw invalid_code_point(cp);
-
- return internal::append(cp, result);
- }
-
- template <typename octet_iterator, typename output_iterator>
- output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
- {
- while (start != end) {
- octet_iterator sequence_start = start;
- internal::utf_error err_code = utf8::internal::validate_next(start, end);
- switch (err_code) {
- case internal::UTF8_OK :
- for (octet_iterator it = sequence_start; it != start; ++it)
- *out++ = *it;
- break;
- case internal::NOT_ENOUGH_ROOM:
- out = utf8::append (replacement, out);
- start = end;
- break;
- case internal::INVALID_LEAD:
- out = utf8::append (replacement, out);
- ++start;
- break;
- case internal::INCOMPLETE_SEQUENCE:
- case internal::OVERLONG_SEQUENCE:
- case internal::INVALID_CODE_POINT:
- out = utf8::append (replacement, out);
- ++start;
- // just one replacement mark for the sequence
- while (start != end && utf8::internal::is_trail(*start))
- ++start;
- break;
- }
- }
- return out;
- }
-
- template <typename octet_iterator, typename output_iterator>
- inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out)
- {
- static const uint32_t replacement_marker = utf8::internal::mask16(0xfffd);
- return utf8::replace_invalid(start, end, out, replacement_marker);
- }
-
- template <typename octet_iterator>
- uint32_t next(octet_iterator& it, octet_iterator end)
- {
- uint32_t cp = 0;
- internal::utf_error err_code = utf8::internal::validate_next(it, end, cp);
- switch (err_code) {
- case internal::UTF8_OK :
- break;
- case internal::NOT_ENOUGH_ROOM :
- throw not_enough_room();
- case internal::INVALID_LEAD :
- case internal::INCOMPLETE_SEQUENCE :
- case internal::OVERLONG_SEQUENCE :
- throw invalid_utf8(static_cast<uint8_t>(*it));
- case internal::INVALID_CODE_POINT :
- throw invalid_code_point(cp);
- }
- return cp;
- }
-
- template <typename octet_iterator>
- uint32_t peek_next(octet_iterator it, octet_iterator end)
- {
- return utf8::next(it, end);
- }
-
- template <typename octet_iterator>
- uint32_t prior(octet_iterator& it, octet_iterator start)
- {
- // can't do much if it == start
- if (it == start)
- throw not_enough_room();
-
- octet_iterator end = it;
- // Go back until we hit either a lead octet or start
- while (utf8::internal::is_trail(*(--it)))
- if (it == start)
- throw invalid_utf8(*it); // error - no lead byte in the sequence
- return utf8::peek_next(it, end);
- }
-
- template <typename octet_iterator, typename distance_type>
- void advance (octet_iterator& it, distance_type n, octet_iterator end)
- {
- const distance_type zero(0);
- if (n < zero) {
- // backward
- for (distance_type i = n; i < zero; ++i)
- utf8::prior(it, end);
- } else {
- // forward
- for (distance_type i = zero; i < n; ++i)
- utf8::next(it, end);
- }
- }
-
- template <typename octet_iterator>
- typename std::iterator_traits<octet_iterator>::difference_type
- distance (octet_iterator first, octet_iterator last)
- {
- typename std::iterator_traits<octet_iterator>::difference_type dist;
- for (dist = 0; first < last; ++dist)
- utf8::next(first, last);
- return dist;
- }
-
- template <typename u16bit_iterator, typename octet_iterator>
- octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
- {
- while (start != end) {
- uint32_t cp = utf8::internal::mask16(*start++);
- // Take care of surrogate pairs first
- if (utf8::internal::is_lead_surrogate(cp)) {
- if (start != end) {
- uint32_t trail_surrogate = utf8::internal::mask16(*start++);
- if (utf8::internal::is_trail_surrogate(trail_surrogate))
- cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
- else
- throw invalid_utf16(static_cast<uint16_t>(trail_surrogate));
- }
- else
- throw invalid_utf16(static_cast<uint16_t>(cp));
-
- }
- // Lone trail surrogate
- else if (utf8::internal::is_trail_surrogate(cp))
- throw invalid_utf16(static_cast<uint16_t>(cp));
-
- result = utf8::append(cp, result);
- }
- return result;
- }
-
- template <typename u16bit_iterator, typename octet_iterator>
- u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
- {
- while (start < end) {
- uint32_t cp = utf8::next(start, end);
- if (cp > 0xffff) { //make a surrogate pair
- *result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
- *result++ = static_cast<uint16_t>((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN);
- }
- else
- *result++ = static_cast<uint16_t>(cp);
- }
- return result;
- }
-
- template <typename octet_iterator, typename u32bit_iterator>
- octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)
- {
- while (start != end)
- result = utf8::append(*(start++), result);
-
- return result;
- }
-
- template <typename octet_iterator, typename u32bit_iterator>
- u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
- {
- while (start < end)
- (*result++) = utf8::next(start, end);
-
- return result;
- }
-
- // The iterator class
- template <typename octet_iterator>
- class iterator {
- octet_iterator it;
- octet_iterator range_start;
- octet_iterator range_end;
- public:
- typedef uint32_t value_type;
- typedef uint32_t* pointer;
- typedef uint32_t& reference;
- typedef std::ptrdiff_t difference_type;
- typedef std::bidirectional_iterator_tag iterator_category;
- iterator () {}
- explicit iterator (const octet_iterator& octet_it,
- const octet_iterator& rangestart,
- const octet_iterator& rangeend) :
- it(octet_it), range_start(rangestart), range_end(rangeend)
- {
- if (it < range_start || it > range_end)
- throw std::out_of_range("Invalid utf-8 iterator position");
- }
- // the default "big three" are OK
- octet_iterator base () const { return it; }
- uint32_t operator * () const
- {
- octet_iterator temp = it;
- return utf8::next(temp, range_end);
- }
- bool operator == (const iterator& rhs) const
- {
- if (range_start != rhs.range_start || range_end != rhs.range_end)
- throw std::logic_error("Comparing utf-8 iterators defined with different ranges");
- return (it == rhs.it);
- }
- bool operator != (const iterator& rhs) const
- {
- return !(operator == (rhs));
- }
- iterator& operator ++ ()
- {
- utf8::next(it, range_end);
- return *this;
- }
- iterator operator ++ (int)
- {
- iterator temp = *this;
- utf8::next(it, range_end);
- return temp;
- }
- iterator& operator -- ()
- {
- utf8::prior(it, range_start);
- return *this;
- }
- iterator operator -- (int)
- {
- iterator temp = *this;
- utf8::prior(it, range_start);
- return temp;
- }
- }; // class iterator
-
-} // namespace utf8
-
-#if UTF_CPP_CPLUSPLUS >= 201703L // C++ 17 or later
-#include "cpp17.h"
-#elif UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
-#include "cpp11.h"
-#endif // C++ 11 or later
-
-#endif //header guard
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/core.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/core.h
deleted file mode 100644
index 0eaf6a7d2a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/core.h
+++ /dev/null
@@ -1,387 +0,0 @@
-// Copyright 2006 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_CORE_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include <iterator>
-
-// Determine the C++ standard version.
-// If the user defines UTF_CPP_CPLUSPLUS, use that.
-// Otherwise, trust the unreliable predefined macro __cplusplus
-
-#if !defined UTF_CPP_CPLUSPLUS
- #define UTF_CPP_CPLUSPLUS __cplusplus
-#endif
-
-#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
- #define UTF_CPP_OVERRIDE override
- #define UTF_CPP_NOEXCEPT noexcept
-#else // C++ 98/03
- #define UTF_CPP_OVERRIDE
- #define UTF_CPP_NOEXCEPT throw()
-#endif // C++ 11 or later
-
-
-namespace utf8
-{
- // The typedefs for 8-bit, 16-bit and 32-bit unsigned integers
- // You may need to change them to match your system.
- // These typedefs have the same names as ones from cstdint, or boost/cstdint
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
- typedef unsigned int uint32_t;
-
-// Helper code - not intended to be directly called by the library users. May be changed at any time
-namespace internal
-{
- // Unicode constants
- // Leading (high) surrogates: 0xd800 - 0xdbff
- // Trailing (low) surrogates: 0xdc00 - 0xdfff
- const uint16_t LEAD_SURROGATE_MIN = 0xd800u;
- const uint16_t LEAD_SURROGATE_MAX = 0xdbffu;
- const uint16_t TRAIL_SURROGATE_MIN = 0xdc00u;
- const uint16_t TRAIL_SURROGATE_MAX = 0xdfffu;
- const uint16_t LEAD_OFFSET = 0xd7c0u; // LEAD_SURROGATE_MIN - (0x10000 >> 10)
- const uint32_t SURROGATE_OFFSET = 0xfca02400u; // 0x10000u - (LEAD_SURROGATE_MIN << 10) - TRAIL_SURROGATE_MIN
-
- // Maximum valid value for a Unicode code point
- const uint32_t CODE_POINT_MAX = 0x0010ffffu;
-
- template<typename octet_type>
- inline uint8_t mask8(octet_type oc)
- {
- return static_cast<uint8_t>(0xff & oc);
- }
- template<typename u16_type>
- inline uint16_t mask16(u16_type oc)
- {
- return static_cast<uint16_t>(0xffff & oc);
- }
- template<typename octet_type>
- inline bool is_trail(octet_type oc)
- {
- return ((utf8::internal::mask8(oc) >> 6) == 0x2);
- }
-
- template <typename u16>
- inline bool is_lead_surrogate(u16 cp)
- {
- return (cp >= LEAD_SURROGATE_MIN && cp <= LEAD_SURROGATE_MAX);
- }
-
- template <typename u16>
- inline bool is_trail_surrogate(u16 cp)
- {
- return (cp >= TRAIL_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX);
- }
-
- template <typename u16>
- inline bool is_surrogate(u16 cp)
- {
- return (cp >= LEAD_SURROGATE_MIN && cp <= TRAIL_SURROGATE_MAX);
- }
-
- template <typename u32>
- inline bool is_code_point_valid(u32 cp)
- {
- return (cp <= CODE_POINT_MAX && !utf8::internal::is_surrogate(cp));
- }
-
- template <typename octet_iterator>
- inline typename std::iterator_traits<octet_iterator>::difference_type
- sequence_length(octet_iterator lead_it)
- {
- uint8_t lead = utf8::internal::mask8(*lead_it);
- if (lead < 0x80)
- return 1;
- else if ((lead >> 5) == 0x6)
- return 2;
- else if ((lead >> 4) == 0xe)
- return 3;
- else if ((lead >> 3) == 0x1e)
- return 4;
- else
- return 0;
- }
-
- template <typename octet_difference_type>
- inline bool is_overlong_sequence(uint32_t cp, octet_difference_type length)
- {
- if (cp < 0x80) {
- if (length != 1)
- return true;
- }
- else if (cp < 0x800) {
- if (length != 2)
- return true;
- }
- else if (cp < 0x10000) {
- if (length != 3)
- return true;
- }
-
- return false;
- }
-
- enum utf_error {UTF8_OK, NOT_ENOUGH_ROOM, INVALID_LEAD, INCOMPLETE_SEQUENCE, OVERLONG_SEQUENCE, INVALID_CODE_POINT};
-
- /// Helper for get_sequence_x
- template <typename octet_iterator>
- utf_error increase_safely(octet_iterator& it, octet_iterator end)
- {
- if (++it == end)
- return NOT_ENOUGH_ROOM;
-
- if (!utf8::internal::is_trail(*it))
- return INCOMPLETE_SEQUENCE;
-
- return UTF8_OK;
- }
-
- #define UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(IT, END) {utf_error ret = increase_safely(IT, END); if (ret != UTF8_OK) return ret;}
-
- /// get_sequence_x functions decode utf-8 sequences of the length x
- template <typename octet_iterator>
- utf_error get_sequence_1(octet_iterator& it, octet_iterator end, uint32_t& code_point)
- {
- if (it == end)
- return NOT_ENOUGH_ROOM;
-
- code_point = utf8::internal::mask8(*it);
-
- return UTF8_OK;
- }
-
- template <typename octet_iterator>
- utf_error get_sequence_2(octet_iterator& it, octet_iterator end, uint32_t& code_point)
- {
- if (it == end)
- return NOT_ENOUGH_ROOM;
-
- code_point = utf8::internal::mask8(*it);
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point = ((code_point << 6) & 0x7ff) + ((*it) & 0x3f);
-
- return UTF8_OK;
- }
-
- template <typename octet_iterator>
- utf_error get_sequence_3(octet_iterator& it, octet_iterator end, uint32_t& code_point)
- {
- if (it == end)
- return NOT_ENOUGH_ROOM;
-
- code_point = utf8::internal::mask8(*it);
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point = ((code_point << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point += (*it) & 0x3f;
-
- return UTF8_OK;
- }
-
- template <typename octet_iterator>
- utf_error get_sequence_4(octet_iterator& it, octet_iterator end, uint32_t& code_point)
- {
- if (it == end)
- return NOT_ENOUGH_ROOM;
-
- code_point = utf8::internal::mask8(*it);
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point = ((code_point << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point += (utf8::internal::mask8(*it) << 6) & 0xfff;
-
- UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR(it, end)
-
- code_point += (*it) & 0x3f;
-
- return UTF8_OK;
- }
-
- #undef UTF8_CPP_INCREASE_AND_RETURN_ON_ERROR
-
- template <typename octet_iterator>
- utf_error validate_next(octet_iterator& it, octet_iterator end, uint32_t& code_point)
- {
- if (it == end)
- return NOT_ENOUGH_ROOM;
-
- // Save the original value of it so we can go back in case of failure
- // Of course, it does not make much sense with i.e. stream iterators
- octet_iterator original_it = it;
-
- uint32_t cp = 0;
- // Determine the sequence length based on the lead octet
- typedef typename std::iterator_traits<octet_iterator>::difference_type octet_difference_type;
- const octet_difference_type length = utf8::internal::sequence_length(it);
-
- // Get trail octets and calculate the code point
- utf_error err = UTF8_OK;
- switch (length) {
- case 0:
- return INVALID_LEAD;
- case 1:
- err = utf8::internal::get_sequence_1(it, end, cp);
- break;
- case 2:
- err = utf8::internal::get_sequence_2(it, end, cp);
- break;
- case 3:
- err = utf8::internal::get_sequence_3(it, end, cp);
- break;
- case 4:
- err = utf8::internal::get_sequence_4(it, end, cp);
- break;
- }
-
- if (err == UTF8_OK) {
- // Decoding succeeded. Now, security checks...
- if (utf8::internal::is_code_point_valid(cp)) {
- if (!utf8::internal::is_overlong_sequence(cp, length)){
- // Passed! Return here.
- code_point = cp;
- ++it;
- return UTF8_OK;
- }
- else
- err = OVERLONG_SEQUENCE;
- }
- else
- err = INVALID_CODE_POINT;
- }
-
- // Failure branch - restore the original value of the iterator
- it = original_it;
- return err;
- }
-
- template <typename octet_iterator>
- inline utf_error validate_next(octet_iterator& it, octet_iterator end) {
- uint32_t ignored;
- return utf8::internal::validate_next(it, end, ignored);
- }
-
- // Internal implementation of both checked and unchecked append() function
- // This function will be invoked by the overloads below, as they will know
- // the octet_type.
- template <typename octet_iterator, typename octet_type>
- octet_iterator append(uint32_t cp, octet_iterator result) {
- if (cp < 0x80) // one octet
- *(result++) = static_cast<octet_type>(cp);
- else if (cp < 0x800) { // two octets
- *(result++) = static_cast<octet_type>((cp >> 6) | 0xc0);
- *(result++) = static_cast<octet_type>((cp & 0x3f) | 0x80);
- }
- else if (cp < 0x10000) { // three octets
- *(result++) = static_cast<octet_type>((cp >> 12) | 0xe0);
- *(result++) = static_cast<octet_type>(((cp >> 6) & 0x3f) | 0x80);
- *(result++) = static_cast<octet_type>((cp & 0x3f) | 0x80);
- }
- else { // four octets
- *(result++) = static_cast<octet_type>((cp >> 18) | 0xf0);
- *(result++) = static_cast<octet_type>(((cp >> 12) & 0x3f)| 0x80);
- *(result++) = static_cast<octet_type>(((cp >> 6) & 0x3f) | 0x80);
- *(result++) = static_cast<octet_type>((cp & 0x3f) | 0x80);
- }
- return result;
- }
-
- // One of the following overloads will be invoked from the API calls
-
- // A simple (but dangerous) case: the caller appends byte(s) to a char array
- inline char* append(uint32_t cp, char* result) {
- return append<char*, char>(cp, result);
- }
-
- // Hopefully, most common case: the caller uses back_inserter
- // i.e. append(cp, std::back_inserter(str));
- template<typename container_type>
- std::back_insert_iterator<container_type> append
- (uint32_t cp, std::back_insert_iterator<container_type> result) {
- return append<std::back_insert_iterator<container_type>,
- typename container_type::value_type>(cp, result);
- }
-
- // The caller uses some other kind of output operator - not covered above
- // Note that in this case we are not able to determine octet_type
- // so we assume it's uint_8; that can cause a conversion warning if we are wrong.
- template <typename octet_iterator>
- octet_iterator append(uint32_t cp, octet_iterator result) {
- return append<octet_iterator, uint8_t>(cp, result);
- }
-
-} // namespace internal
-
- /// The library API - functions intended to be called by the users
-
- // Byte order mark
- const uint8_t bom[] = {0xef, 0xbb, 0xbf};
-
- template <typename octet_iterator>
- octet_iterator find_invalid(octet_iterator start, octet_iterator end)
- {
- octet_iterator result = start;
- while (result != end) {
- utf8::internal::utf_error err_code = utf8::internal::validate_next(result, end);
- if (err_code != internal::UTF8_OK)
- return result;
- }
- return result;
- }
-
- template <typename octet_iterator>
- inline bool is_valid(octet_iterator start, octet_iterator end)
- {
- return (utf8::find_invalid(start, end) == end);
- }
-
- template <typename octet_iterator>
- inline bool starts_with_bom (octet_iterator it, octet_iterator end)
- {
- return (
- ((it != end) && (utf8::internal::mask8(*it++)) == bom[0]) &&
- ((it != end) && (utf8::internal::mask8(*it++)) == bom[1]) &&
- ((it != end) && (utf8::internal::mask8(*it)) == bom[2])
- );
- }
-} // namespace utf8
-
-#endif // header guard
-
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp11.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp11.h
deleted file mode 100644
index 2c9c9ba0be..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp11.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2018 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_a184c22c_d012_11e8_a8d5_f2801f1b9fd1
-#define UTF8_FOR_CPP_a184c22c_d012_11e8_a8d5_f2801f1b9fd1
-
-#include "checked.h"
-#include <string>
-
-namespace utf8
-{
-
- inline void append(char32_t cp, std::string& s)
- {
- append(uint32_t(cp), std::back_inserter(s));
- }
-
- inline std::string utf16to8(const std::u16string& s)
- {
- std::string result;
- utf16to8(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::u16string utf8to16(const std::string& s)
- {
- std::u16string result;
- utf8to16(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::string utf32to8(const std::u32string& s)
- {
- std::string result;
- utf32to8(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::u32string utf8to32(const std::string& s)
- {
- std::u32string result;
- utf8to32(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::size_t find_invalid(const std::string& s)
- {
- std::string::const_iterator invalid = find_invalid(s.begin(), s.end());
- return (invalid == s.end()) ? std::string::npos : static_cast<std::size_t>(invalid - s.begin());
- }
-
- inline bool is_valid(const std::string& s)
- {
- return is_valid(s.begin(), s.end());
- }
-
- inline std::string replace_invalid(const std::string& s, char32_t replacement)
- {
- std::string result;
- replace_invalid(s.begin(), s.end(), std::back_inserter(result), replacement);
- return result;
- }
-
- inline std::string replace_invalid(const std::string& s)
- {
- std::string result;
- replace_invalid(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline bool starts_with_bom(const std::string& s)
- {
- return starts_with_bom(s.begin(), s.end());
- }
-
-} // namespace utf8
-
-#endif // header guard
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp17.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp17.h
deleted file mode 100644
index 39b12b7c93..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/cpp17.h
+++ /dev/null
@@ -1,103 +0,0 @@
-// Copyright 2018 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_7e906c01_03a3_4daf_b420_ea7ea952b3c9
-#define UTF8_FOR_CPP_7e906c01_03a3_4daf_b420_ea7ea952b3c9
-
-#include "checked.h"
-#include <string>
-
-namespace utf8
-{
-
- inline void append(char32_t cp, std::string& s)
- {
- append(uint32_t(cp), std::back_inserter(s));
- }
-
- inline std::string utf16to8(std::u16string_view s)
- {
- std::string result;
- utf16to8(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::u16string utf8to16(std::string_view s)
- {
- std::u16string result;
- utf8to16(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::string utf32to8(std::u32string_view s)
- {
- std::string result;
- utf32to8(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::u32string utf8to32(std::string_view s)
- {
- std::u32string result;
- utf8to32(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline std::size_t find_invalid(std::string_view s)
- {
- std::string_view::const_iterator invalid = find_invalid(s.begin(), s.end());
- return (invalid == s.end()) ? std::string_view::npos : static_cast<std::size_t>(invalid - s.begin());
- }
-
- inline bool is_valid(std::string_view s)
- {
- return is_valid(s.begin(), s.end());
- }
-
- inline std::string replace_invalid(std::string_view s, char32_t replacement)
- {
- std::string result;
- replace_invalid(s.begin(), s.end(), std::back_inserter(result), replacement);
- return result;
- }
-
- inline std::string replace_invalid(std::string_view s)
- {
- std::string result;
- replace_invalid(s.begin(), s.end(), std::back_inserter(result));
- return result;
- }
-
- inline bool starts_with_bom(std::string_view s)
- {
- return starts_with_bom(s.begin(), s.end());
- }
-
-} // namespace utf8
-
-#endif // header guard
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h b/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h
deleted file mode 100644
index 7151a35b67..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/source/utf8/unchecked.h
+++ /dev/null
@@ -1,257 +0,0 @@
-// Copyright 2006 Nemanja Trifunovic
-
-/*
-Permission is hereby granted, free of charge, to any person or organization
-obtaining a copy of the software and accompanying documentation covered by
-this license (the "Software") to use, reproduce, display, distribute,
-execute, and transmit the Software, and to prepare derivative works of the
-Software, and to permit third-parties to whom the Software is furnished to
-do so, all subject to the following:
-
-The copyright notices in the Software and this entire statement, including
-the above license grant, this restriction and the following disclaimer,
-must be included in all copies of the Software, in whole or in part, and
-all derivative works of the Software, unless such copies or derivative
-works are solely in the form of machine-executable object code generated by
-a source language processor.
-
-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, TITLE AND NON-INFRINGEMENT. IN NO EVENT
-SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
-FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
-ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-*/
-
-
-#ifndef UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "core.h"
-
-namespace utf8
-{
- namespace unchecked
- {
- template <typename octet_iterator>
- octet_iterator append(uint32_t cp, octet_iterator result)
- {
- return internal::append(cp, result);
- }
-
- template <typename octet_iterator, typename output_iterator>
- output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out, uint32_t replacement)
- {
- while (start != end) {
- octet_iterator sequence_start = start;
- internal::utf_error err_code = utf8::internal::validate_next(start, end);
- switch (err_code) {
- case internal::UTF8_OK :
- for (octet_iterator it = sequence_start; it != start; ++it)
- *out++ = *it;
- break;
- case internal::NOT_ENOUGH_ROOM:
- out = utf8::unchecked::append (replacement, out);
- start = end;
- break;
- case internal::INVALID_LEAD:
- out = utf8::unchecked::append (replacement, out);
- ++start;
- break;
- case internal::INCOMPLETE_SEQUENCE:
- case internal::OVERLONG_SEQUENCE:
- case internal::INVALID_CODE_POINT:
- out = utf8::unchecked::append (replacement, out);
- ++start;
- // just one replacement mark for the sequence
- while (start != end && utf8::internal::is_trail(*start))
- ++start;
- break;
- }
- }
- return out;
- }
-
- template <typename octet_iterator, typename output_iterator>
- inline output_iterator replace_invalid(octet_iterator start, octet_iterator end, output_iterator out)
- {
- static const uint32_t replacement_marker = utf8::internal::mask16(0xfffd);
- return utf8::unchecked::replace_invalid(start, end, out, replacement_marker);
- }
-
- template <typename octet_iterator>
- uint32_t next(octet_iterator& it)
- {
- uint32_t cp = utf8::internal::mask8(*it);
- typename std::iterator_traits<octet_iterator>::difference_type length = utf8::internal::sequence_length(it);
- switch (length) {
- case 1:
- break;
- case 2:
- it++;
- cp = ((cp << 6) & 0x7ff) + ((*it) & 0x3f);
- break;
- case 3:
- ++it;
- cp = ((cp << 12) & 0xffff) + ((utf8::internal::mask8(*it) << 6) & 0xfff);
- ++it;
- cp += (*it) & 0x3f;
- break;
- case 4:
- ++it;
- cp = ((cp << 18) & 0x1fffff) + ((utf8::internal::mask8(*it) << 12) & 0x3ffff);
- ++it;
- cp += (utf8::internal::mask8(*it) << 6) & 0xfff;
- ++it;
- cp += (*it) & 0x3f;
- break;
- }
- ++it;
- return cp;
- }
-
- template <typename octet_iterator>
- uint32_t peek_next(octet_iterator it)
- {
- return utf8::unchecked::next(it);
- }
-
- template <typename octet_iterator>
- uint32_t prior(octet_iterator& it)
- {
- while (utf8::internal::is_trail(*(--it))) ;
- octet_iterator temp = it;
- return utf8::unchecked::next(temp);
- }
-
- template <typename octet_iterator, typename distance_type>
- void advance (octet_iterator& it, distance_type n)
- {
- const distance_type zero(0);
- if (n < zero) {
- // backward
- for (distance_type i = n; i < zero; ++i)
- utf8::unchecked::prior(it);
- } else {
- // forward
- for (distance_type i = zero; i < n; ++i)
- utf8::unchecked::next(it);
- }
- }
-
- template <typename octet_iterator>
- typename std::iterator_traits<octet_iterator>::difference_type
- distance (octet_iterator first, octet_iterator last)
- {
- typename std::iterator_traits<octet_iterator>::difference_type dist;
- for (dist = 0; first < last; ++dist)
- utf8::unchecked::next(first);
- return dist;
- }
-
- template <typename u16bit_iterator, typename octet_iterator>
- octet_iterator utf16to8 (u16bit_iterator start, u16bit_iterator end, octet_iterator result)
- {
- while (start != end) {
- uint32_t cp = utf8::internal::mask16(*start++);
- // Take care of surrogate pairs first
- if (utf8::internal::is_lead_surrogate(cp)) {
- uint32_t trail_surrogate = utf8::internal::mask16(*start++);
- cp = (cp << 10) + trail_surrogate + internal::SURROGATE_OFFSET;
- }
- result = utf8::unchecked::append(cp, result);
- }
- return result;
- }
-
- template <typename u16bit_iterator, typename octet_iterator>
- u16bit_iterator utf8to16 (octet_iterator start, octet_iterator end, u16bit_iterator result)
- {
- while (start < end) {
- uint32_t cp = utf8::unchecked::next(start);
- if (cp > 0xffff) { //make a surrogate pair
- *result++ = static_cast<uint16_t>((cp >> 10) + internal::LEAD_OFFSET);
- *result++ = static_cast<uint16_t>((cp & 0x3ff) + internal::TRAIL_SURROGATE_MIN);
- }
- else
- *result++ = static_cast<uint16_t>(cp);
- }
- return result;
- }
-
- template <typename octet_iterator, typename u32bit_iterator>
- octet_iterator utf32to8 (u32bit_iterator start, u32bit_iterator end, octet_iterator result)
- {
- while (start != end)
- result = utf8::unchecked::append(*(start++), result);
-
- return result;
- }
-
- template <typename octet_iterator, typename u32bit_iterator>
- u32bit_iterator utf8to32 (octet_iterator start, octet_iterator end, u32bit_iterator result)
- {
- while (start < end)
- (*result++) = utf8::unchecked::next(start);
-
- return result;
- }
-
- // The iterator class
- template <typename octet_iterator>
- class iterator {
- octet_iterator it;
- public:
- typedef uint32_t value_type;
- typedef uint32_t* pointer;
- typedef uint32_t& reference;
- typedef std::ptrdiff_t difference_type;
- typedef std::bidirectional_iterator_tag iterator_category;
- iterator () {}
- explicit iterator (const octet_iterator& octet_it): it(octet_it) {}
- // the default "big three" are OK
- octet_iterator base () const { return it; }
- uint32_t operator * () const
- {
- octet_iterator temp = it;
- return utf8::unchecked::next(temp);
- }
- bool operator == (const iterator& rhs) const
- {
- return (it == rhs.it);
- }
- bool operator != (const iterator& rhs) const
- {
- return !(operator == (rhs));
- }
- iterator& operator ++ ()
- {
- ::std::advance(it, utf8::internal::sequence_length(it));
- return *this;
- }
- iterator operator ++ (int)
- {
- iterator temp = *this;
- ::std::advance(it, utf8::internal::sequence_length(it));
- return temp;
- }
- iterator& operator -- ()
- {
- utf8::unchecked::prior(it);
- return *this;
- }
- iterator operator -- (int)
- {
- iterator temp = *this;
- utf8::unchecked::prior(it);
- return temp;
- }
- }; // class iterator
-
- } // namespace utf8::unchecked
-} // namespace utf8
-
-
-#endif // header guard
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/CMakeLists.txt b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/CMakeLists.txt
deleted file mode 100644
index f3ce2584c9..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/CMakeLists.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-add_executable(negative ${PROJECT_SOURCE_DIR}/tests/negative.cpp)
-add_executable(cpp11 ${PROJECT_SOURCE_DIR}/tests/test_cpp11.cpp)
-add_executable(cpp17 ${PROJECT_SOURCE_DIR}/tests/test_cpp17.cpp)
-add_executable(apitests ${PROJECT_SOURCE_DIR}/tests/apitests.cpp)
-
-add_executable(noexceptionstests ${PROJECT_SOURCE_DIR}/tests/noexceptionstests.cpp)
-
-target_link_libraries(negative PRIVATE utf8::cpp)
-target_link_libraries(cpp11 PRIVATE utf8::cpp)
-target_link_libraries(cpp17 PRIVATE utf8::cpp)
-target_link_libraries(apitests PRIVATE utf8::cpp)
-target_link_libraries(noexceptionstests PRIVATE utf8::cpp)
-
-target_compile_options(${PROJECT_NAME} INTERFACE
- $<$<CXX_COMPILER_ID:MSVC>:/W4>
- $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra -Wpedantic -Wconversion>)
-
-target_compile_options(noexceptionstests PUBLIC -fno-exceptions)
-
-set_target_properties(negative apitests noexceptionstests
- PROPERTIES
- CXX_STANDARD 98
- CXX_STANDARD_REQUIRED YES
- CXX_EXTENSIONS NO)
-
-set_target_properties(cpp11
- PROPERTIES
- CXX_STANDARD 11
- CXX_STANDARD_REQUIRED YES
- CXX_EXTENSIONS NO)
-
-set_target_properties(cpp17
- PROPERTIES
- CXX_STANDARD 17
- CXX_STANDARD_REQUIRED YES
- CXX_EXTENSIONS NO)
-
-add_test(negative_test negative ${PROJECT_SOURCE_DIR}/tests/test_data/utf8_invalid.txt)
-add_test(cpp11_test cpp11)
-add_test(cpp17_test cpp17)
-add_test(api_test apitests)
-add_test(noexceptions_test noexceptionstests)
-
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/apitests.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/apitests.cpp
deleted file mode 100644
index 083266d7d2..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/apitests.cpp
+++ /dev/null
@@ -1,6 +0,0 @@
-#include "../extern/ftest/ftest.h"
-
-#include "test_checked_api.h"
-#include "test_checked_iterator.h"
-#include "test_unchecked_api.h"
-#include "test_unchecked_iterator.h"
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/docker/Dockerfile b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/docker/Dockerfile
deleted file mode 100644
index 9df3717a1d..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/docker/Dockerfile
+++ /dev/null
@@ -1,5 +0,0 @@
-FROM debian:buster-slim
-
-RUN apt-get update \
- && apt-get install -y make g++ cmake git \
- && rm -rf /var/lib/apt/lists/*
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/negative.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/negative.cpp
deleted file mode 100644
index 26f72d9ef5..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/negative.cpp
+++ /dev/null
@@ -1,59 +0,0 @@
-#include "utf8.h"
-using namespace utf8;
-
-#include <string>
-#include <iostream>
-#include <fstream>
-#include <algorithm>
-using namespace std;
-
-const unsigned INVALID_LINES[] = { 75, 76, 83, 84, 85, 93, 102, 103, 105, 106, 107, 108, 109, 110, 114, 115, 116, 117, 124, 125, 130, 135, 140, 145, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 169, 175, 176, 177, 207, 208, 209, 210, 211, 220, 221, 222, 223, 224, 232, 233, 234, 235, 236, 247, 248, 249, 250, 251, 252, 253, 257, 258, 259, 260, 261, 262, 263, 264};
-const unsigned* INVALID_LINES_END = INVALID_LINES + sizeof(INVALID_LINES)/sizeof(unsigned);
-
-int main(int argc, char** argv)
-{
- string test_file_path;
- if (argc == 2)
- test_file_path = argv[1];
- else {
- cout << "Wrong number of arguments" << endl;
- return 1;
- }
- // Open the test file
- ifstream fs8(test_file_path.c_str());
- if (!fs8.is_open()) {
- cout << "Could not open " << test_file_path << endl;
- return 1;
- }
-
- // Read it line by line
- unsigned int line_count = 0;
- char byte;
- while (!fs8.eof()) {
- string line;
- while ((byte = static_cast<char>(fs8.get())) != '\n' && !fs8.eof())
- line.push_back(byte);
-
- line_count++;
- bool expected_valid = (find(INVALID_LINES, INVALID_LINES_END, line_count) == INVALID_LINES_END);
- // Print out lines that contain unexpected invalid UTF-8
- if (!is_valid(line.begin(), line.end())) {
- if (expected_valid) {
- cout << "Unexpected invalid utf-8 at line " << line_count << '\n';
- return 1;
- }
-
- // try fixing it:
- string fixed_line;
- replace_invalid(line.begin(), line.end(), back_inserter(fixed_line));
- if (!is_valid(fixed_line.begin(), fixed_line.end())) {
- cout << "replace_invalid() resulted in an invalid utf-8 at line " << line_count << '\n';
- return 1;
- }
- }
- else if (!expected_valid) {
- cout << "Invalid utf-8 NOT detected at line " << line_count << '\n';
- return 1;
- }
- }
-}
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/noexceptionstests.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/noexceptionstests.cpp
deleted file mode 100644
index 108ee750cd..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/noexceptionstests.cpp
+++ /dev/null
@@ -1,4 +0,0 @@
-#include "../extern/ftest/ftest.h"
-
-#include "test_unchecked_api.h"
-#include "test_unchecked_iterator.h"
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_api.h b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_api.h
deleted file mode 100644
index 3a7067b76a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_api.h
+++ /dev/null
@@ -1,198 +0,0 @@
-#ifndef UTF8_FOR_CPP_TEST_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_TEST_CHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "utf8.h"
-
-#include <string>
-#include <vector>
-using namespace utf8;
-using namespace std;
-
-
-TEST(CheckedAPITests, test_append)
-{
- unsigned char u[5] = {0,0,0,0,0};
- append(0x0448, u);
- EXPECT_EQ (u[0], 0xd1);
- EXPECT_EQ (u[1], 0x88);
- EXPECT_EQ (u[2], 0);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- append(0x65e5, u);
- EXPECT_EQ (u[0], 0xe6);
- EXPECT_EQ (u[1], 0x97);
- EXPECT_EQ (u[2], 0xa5);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- append(0x3044, u);
- EXPECT_EQ (u[0], 0xe3);
- EXPECT_EQ (u[1], 0x81);
- EXPECT_EQ (u[2], 0x84);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- append(0x10346, u);
- EXPECT_EQ (u[0], 0xf0);
- EXPECT_EQ (u[1], 0x90);
- EXPECT_EQ (u[2], 0x8d);
- EXPECT_EQ (u[3], 0x86);
- EXPECT_EQ (u[4], 0);
-
- // Ensure no warnings with plain char
- char c[2] = {0,0};
- append('a', c);
- EXPECT_EQ (c[0], 'a');
- EXPECT_EQ (c[1], 0);
-}
-
-TEST(CheckedAPITests, test_next)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- const char* w = twochars;
- unsigned int cp = next(w, twochars + 6);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, twochars + 3);
-
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- w = threechars;
-
- cp = next(w, threechars + 9);
- EXPECT_EQ (cp, 0x10346);
- EXPECT_EQ (w, threechars + 4);
-
- cp = next(w, threechars + 9);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, threechars + 7);
-
- cp = next(w, threechars + 9);
- EXPECT_EQ (cp, 0x0448);
- EXPECT_EQ (w, threechars + 9);
-}
-
-TEST(CheckedAPITests, test_peek_next)
-{
- const char* const cw = "\xe6\x97\xa5\xd1\x88";
- unsigned int cp = peek_next(cw, cw + 6);
- EXPECT_EQ (cp, 0x65e5);
-}
-
-TEST(CheckedAPITests, test_prior)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- const char* w = twochars + 3;
- unsigned int cp = prior (w, twochars);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, twochars);
-
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- w = threechars + 9;
- cp = prior(w, threechars);
- EXPECT_EQ (cp, 0x0448);
- EXPECT_EQ (w, threechars + 7);
- cp = prior(w, threechars);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, threechars + 4);
- cp = prior(w, threechars);
- EXPECT_EQ (cp, 0x10346);
- EXPECT_EQ (w, threechars);
-}
-
-TEST(CheckedAPITests, test_advance)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- const char* w = threechars;
- advance(w, 2, threechars + 9);
- EXPECT_EQ(w, threechars + 7);
- advance(w, -2, threechars);
- EXPECT_EQ(w, threechars);
- advance(w, 3, threechars + 9);
- EXPECT_EQ(w, threechars + 9);
- advance(w, -2, threechars);
- EXPECT_EQ(w, threechars + 4);
- advance(w, -1, threechars);
- EXPECT_EQ(w, threechars);
-}
-
-TEST(CheckedAPITests, test_distance)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- size_t dist = static_cast<size_t>(utf8::distance(twochars, twochars + 5));
- EXPECT_EQ (dist, 2);
-}
-
-TEST(CheckedAPITests, test_utf32to8)
-{
- unsigned int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
- string utf8result;
- utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
- EXPECT_EQ (utf8result.size(), 9);
-}
-
-TEST(CheckedAPITests, test_utf8to32)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- vector<unsigned int> utf32result;
- utf8to32(twochars, twochars + 5, back_inserter(utf32result));
- EXPECT_EQ (utf32result.size(), 2);
-}
-
-TEST(CheckedAPITests, test_utf16to8)
-{
- unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- string utf8result;
- utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
- EXPECT_EQ (utf8result.size(), 10);
-}
-
-TEST(CheckedAPITests, test_utf8to16)
-{
- char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- vector <unsigned short> utf16result;
- utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
- EXPECT_EQ (utf16result.size(), 4);
- EXPECT_EQ (utf16result[2], 0xd834);
- EXPECT_EQ (utf16result[3], 0xdd1e);
-}
-
-TEST(CheckedAPITests, test_replace_invalid)
-{
- char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
- vector<char> replace_invalid_result;
- replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), std::back_inserter(replace_invalid_result), '?');
- bool bvalid = is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
- EXPECT_TRUE (bvalid);
- const char fixed_invalid_sequence[] = "a????z";
- EXPECT_EQ (sizeof(fixed_invalid_sequence), replace_invalid_result.size());
- EXPECT_TRUE (std::equal(replace_invalid_result.begin(), replace_invalid_result.begin() + sizeof(fixed_invalid_sequence), fixed_invalid_sequence));
-}
-
-TEST(CheckedAPITests, test_find_invalid)
-{
- char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
- char* invalid = find_invalid(utf_invalid, utf_invalid + 6);
- EXPECT_EQ (invalid, utf_invalid + 5);
-}
-
-TEST(CheckedAPITests, test_is_valid)
-{
- char utf_invalid[] = "\xe6\x97\xa5\xd1\x88\xfa";
- bool bvalid = is_valid(utf_invalid, utf_invalid + 6);
- EXPECT_FALSE (bvalid);
- char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- bvalid = is_valid(utf8_with_surrogates, utf8_with_surrogates + 9);
- EXPECT_TRUE (bvalid);
-}
-
-TEST(CheckedAPITests, test_starts_with_bom)
-{
- unsigned char byte_order_mark[] = {0xef, 0xbb, 0xbf};
- bool bbom = starts_with_bom(byte_order_mark, byte_order_mark + sizeof(byte_order_mark));
- EXPECT_TRUE (bbom);
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- bool no_bbom = starts_with_bom(threechars, threechars + sizeof(threechars));
- EXPECT_FALSE (no_bbom);
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_iterator.h b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_iterator.h
deleted file mode 100644
index 2829a734ed..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_checked_iterator.h
+++ /dev/null
@@ -1,35 +0,0 @@
-#ifndef UTF8_FOR_CPP_TEST_CHECKED_ITERATOR_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_TEST_CHECKED_ITERATOR_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "utf8.h"
-
-using namespace utf8;
-
-
-TEST(CheckedIteratrTests, test_increment)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- utf8::iterator<const char*> it(threechars, threechars, threechars + 9);
- utf8::iterator<const char*> it2 = it;
- EXPECT_EQ (it2, it);
- EXPECT_EQ (*it, 0x10346);
- EXPECT_EQ (*(++it), 0x65e5);
- EXPECT_EQ ((*it++), 0x65e5);
- EXPECT_EQ (*it, 0x0448);
- EXPECT_NE (it, it2);
- utf8::iterator<const char*> endit (threechars + 9, threechars, threechars + 9);
- EXPECT_EQ (++it, endit);
-}
-
-TEST(CheckedIteratrTests, test_decrement)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- utf8::iterator<const char*> it(threechars+9, threechars, threechars + 9);
- EXPECT_EQ (*(--it), 0x0448);
- EXPECT_EQ ((*it--), 0x0448);
- EXPECT_EQ (*it, 0x65e5);
- EXPECT_EQ (--it, utf8::iterator<const char*>(threechars, threechars, threechars + 9));
- EXPECT_EQ (*it, 0x10346);
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp11.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp11.cpp
deleted file mode 100644
index ee4ddd8fd6..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp11.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-#include "../extern/ftest/ftest.h"
-#include "utf8.h"
-#include <string>
-using namespace utf8;
-using namespace std;
-
-#if __cplusplus >= 201103L // C++ 11 or later
-
-TEST(CPP11APITests, test_append)
-{
- string u;
- append(0x0448, u);
- EXPECT_EQ (u[0], char(0xd1));
- EXPECT_EQ (u[1], char(0x88));
- EXPECT_EQ (u.length(), 2);
-
- u.clear();
- append(0x65e5, u);
- EXPECT_EQ (u[0], char(0xe6));
- EXPECT_EQ (u[1], char(0x97));
- EXPECT_EQ (u[2], char(0xa5));
- EXPECT_EQ (u.length(), 3);
-
- u.clear();
- append(0x3044, u);
- EXPECT_EQ (u[0], char(0xe3));
- EXPECT_EQ (u[1], char(0x81));
- EXPECT_EQ (u[2], char(0x84));
- EXPECT_EQ (u.length(), 3);
-
- u.clear();
- append(0x10346, u);
- EXPECT_EQ (u[0], char(0xf0));
- EXPECT_EQ (u[1], char(0x90));
- EXPECT_EQ (u[2], char(0x8d));
- EXPECT_EQ (u[3], char(0x86));
- EXPECT_EQ (u.length(), 4);
-}
-
-TEST(CPP11APITests, test_utf16to8)
-{
- u16string utf16string = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- string u = utf16to8(utf16string);
- EXPECT_EQ (u.size(), 10);
-}
-
-TEST(CPP11APITests, test_utf8to16)
-{
- string utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- u16string utf16result = utf8to16(utf8_with_surrogates);
- EXPECT_EQ (utf16result.size(), 4);
- EXPECT_EQ (utf16result[2], 0xd834);
- EXPECT_EQ (utf16result[3], 0xdd1e);
- // Just to make sure it compiles with string literals
- utf8to16(u8"simple");
- utf8to16("simple");
-}
-
-TEST(CPP11APITests, test_utf32to8)
-{
- u32string utf32string = {0x448, 0x65E5, 0x10346};
- string utf8result = utf32to8(utf32string);
- EXPECT_EQ (utf8result.size(), 9);
-}
-
-TEST(CPP11APITests, test_utf8to32)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- u32string utf32result = utf8to32(twochars);
- EXPECT_EQ (utf32result.size(), 2);
-}
-
-TEST(CPP11APITests, test_find_invalid)
-{
- string utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
- auto invalid = find_invalid(utf_invalid);
- EXPECT_EQ (invalid, 5);
-}
-
-TEST(CPP11APITests, test_is_valid)
-{
- string utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
- bool bvalid = is_valid(utf_invalid);
- EXPECT_FALSE (bvalid);
- string utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- bvalid = is_valid(utf8_with_surrogates);
- EXPECT_TRUE (bvalid);
-}
-
-TEST(CPP11APITests, test_replace_invalid)
-{
- string invalid_sequence = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
- string replace_invalid_result = replace_invalid(invalid_sequence, '?');
- bool bvalid = is_valid(replace_invalid_result);
- EXPECT_TRUE (bvalid);
- const string fixed_invalid_sequence = "a????z";
- EXPECT_EQ(fixed_invalid_sequence, replace_invalid_result);
-}
-
-TEST(CPP11APITests, test_starts_with_bom)
-{
- string byte_order_mark = {char(0xef), char(0xbb), char(0xbf)};
- bool bbom = starts_with_bom(byte_order_mark);
- EXPECT_TRUE (bbom);
- string threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- bool no_bbom = starts_with_bom(threechars);
- EXPECT_FALSE (no_bbom);
-}
-#endif // C++ 11 or later
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp17.cpp b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp17.cpp
deleted file mode 100644
index 4b87816b1c..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_cpp17.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-#include "../extern/ftest/ftest.h"
-#include "utf8.h"
-#include <string>
-using namespace utf8;
-using namespace std;
-
-#if __cplusplus >= 201703L // C++ 17 or later
-
-
-TEST(CPP17APITests, test_utf16to8)
-{
- u16string utf16string = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- u16string_view utf16stringview(u16string);
- string u = utf16to8(utf16string);
- EXPECT_EQ (u.size(), 10);
-}
-
-TEST(CPP17APITests, test_utf8to16)
-{
- string_view utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- u16string utf16result = utf8to16(utf8_with_surrogates);
- EXPECT_EQ (utf16result.size(), 4);
- EXPECT_EQ (utf16result[2], 0xd834);
- EXPECT_EQ (utf16result[3], 0xdd1e);
-}
-
-TEST(CPP17APITests, test_utf32to8)
-{
- u32string utf32string = {0x448, 0x65E5, 0x10346};
- u32string_view utf32stringview(utf32string);
- string utf8result = utf32to8(utf32stringview);
- EXPECT_EQ (utf8result.size(), 9);
-}
-
-TEST(CPP17APITests, test_utf8to32)
-{
- string_view twochars = "\xe6\x97\xa5\xd1\x88";
- u32string utf32result = utf8to32(twochars);
- EXPECT_EQ (utf32result.size(), 2);
-}
-
-TEST(CPP17APITests, test_find_invalid)
-{
- string_view utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
- auto invalid = find_invalid(utf_invalid);
- EXPECT_EQ (invalid, 5);
-}
-
-TEST(CPP17APITests, test_is_valid)
-{
- string_view utf_invalid = "\xe6\x97\xa5\xd1\x88\xfa";
- bool bvalid = is_valid(utf_invalid);
- EXPECT_FALSE (bvalid);
- string_view utf8_with_surrogates = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- bvalid = is_valid(utf8_with_surrogates);
- EXPECT_TRUE (bvalid);
-}
-
-TEST(CPP17APITests, test_replace_invalid)
-{
- string_view invalid_sequence = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
- string replace_invalid_result = replace_invalid(invalid_sequence, '?');
- bool bvalid = is_valid(replace_invalid_result);
- EXPECT_TRUE (bvalid);
- const string fixed_invalid_sequence = "a????z";
- EXPECT_EQ(fixed_invalid_sequence, replace_invalid_result);
-}
-
-TEST(CPP17APITests, test_starts_with_bom)
-{
- string byte_order_mark = {char(0xef), char(0xbb), char(0xbf)};
- string_view byte_order_mark_view(byte_order_mark);
- bool bbom = starts_with_bom(byte_order_mark_view);
- EXPECT_TRUE (bbom);
- string_view threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- bool no_bbom = starts_with_bom(threechars);
- EXPECT_FALSE (no_bbom);
-}
-
-TEST(CPP17APITests, string_class_and_literals)
-{
- const char* twochars = u8"ab";
- EXPECT_TRUE (is_valid(twochars));
- const string two_chars_string(twochars);
- EXPECT_TRUE (is_valid(two_chars_string));
-}
-
-#endif // C++ 11 or later
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_data/utf8_invalid.txt b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_data/utf8_invalid.txt
deleted file mode 100644
index ae83159328..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_data/utf8_invalid.txt
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_api.h b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_api.h
deleted file mode 100644
index 10c5991ede..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_api.h
+++ /dev/null
@@ -1,164 +0,0 @@
-#ifndef UTF8_FOR_CPP_TEST_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_TEST_UNCHECKED_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "utf8/unchecked.h"
-
-#include <string>
-#include <vector>
-
-using namespace std;
-
-TEST(UnCheckedAPITests, test_append)
-{
- unsigned char u[5] = {0,0,0,0,0};
- utf8::unchecked::append(0x0448, u);
- EXPECT_EQ (u[0], 0xd1);
- EXPECT_EQ (u[1], 0x88);
- EXPECT_EQ (u[2], 0);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- utf8::unchecked::append(0x65e5, u);
- EXPECT_EQ (u[0], 0xe6);
- EXPECT_EQ (u[1], 0x97);
- EXPECT_EQ (u[2], 0xa5);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- utf8::unchecked::append(0x3044, u);
- EXPECT_EQ (u[0], 0xe3);
- EXPECT_EQ (u[1], 0x81);
- EXPECT_EQ (u[2], 0x84);
- EXPECT_EQ (u[3], 0);
- EXPECT_EQ (u[4], 0);
-
- utf8::unchecked::append(0x10346, u);
- EXPECT_EQ (u[0], 0xf0);
- EXPECT_EQ (u[1], 0x90);
- EXPECT_EQ (u[2], 0x8d);
- EXPECT_EQ (u[3], 0x86);
- EXPECT_EQ (u[4], 0);
-}
-
-TEST(UnCheckedAPITests, test_next)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- const char* w = twochars;
- unsigned int cp = utf8::unchecked::next(w);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, twochars + 3);
-
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- w = threechars;
-
- cp = utf8::unchecked::next(w);
- EXPECT_EQ (cp, 0x10346);
- EXPECT_EQ (w, threechars + 4);
-
- cp = utf8::unchecked::next(w);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, threechars + 7);
-
- cp = utf8::unchecked::next(w);
- EXPECT_EQ (cp, 0x0448);
- EXPECT_EQ (w, threechars + 9);
-}
-
-TEST(UnCheckedAPITests, test_peek_next)
-{
- const char* const cw = "\xe6\x97\xa5\xd1\x88";
- unsigned int cp = utf8::unchecked::peek_next(cw);
- EXPECT_EQ (cp, 0x65e5);
-}
-
-TEST(UnCheckedAPITests, test_prior)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- const char* w = twochars + 3;
- unsigned int cp = utf8::unchecked::prior (w);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, twochars);
-
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- w = threechars + 9;
- cp = utf8::unchecked::prior(w);
- EXPECT_EQ (cp, 0x0448);
- EXPECT_EQ (w, threechars + 7);
- cp = utf8::unchecked::prior(w);
- EXPECT_EQ (cp, 0x65e5);
- EXPECT_EQ (w, threechars + 4);
- cp = utf8::unchecked::prior(w);
- EXPECT_EQ (cp, 0x10346);
- EXPECT_EQ (w, threechars);
-}
-
-TEST(UnCheckedAPITests, test_advance)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- const char* w = threechars;
- utf8::unchecked::advance(w, 2);
- EXPECT_EQ(w, threechars + 7);
- utf8::unchecked::advance(w, -2);
- EXPECT_EQ(w, threechars);
- utf8::unchecked::advance(w, 3);
- EXPECT_EQ(w, threechars + 9);
- utf8::unchecked::advance(w, -2);
- EXPECT_EQ(w, threechars + 4);
- utf8::unchecked::advance(w, -1);
- EXPECT_EQ(w, threechars);
-}
-
-TEST(UnCheckedAPITests, test_distance)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- size_t dist = static_cast<size_t>(utf8::unchecked::distance(twochars, twochars + 5));
- EXPECT_EQ (dist, 2);
-}
-
-TEST(UnCheckedAPITests, test_utf32to8)
-{
- unsigned int utf32string[] = {0x448, 0x65E5, 0x10346, 0};
- string utf8result;
- utf8::unchecked::utf32to8(utf32string, utf32string + 3, back_inserter(utf8result));
- EXPECT_EQ (utf8result.size(), 9);
-}
-
-TEST(UnCheckedAPITests, test_utf8to32)
-{
- const char* twochars = "\xe6\x97\xa5\xd1\x88";
- vector<unsigned int> utf32result;
- utf8::unchecked::utf8to32(twochars, twochars + 5, back_inserter(utf32result));
- EXPECT_EQ (utf32result.size(), 2);
-}
-
-TEST(UnCheckedAPITests, test_utf16to8)
-{
- unsigned short utf16string[] = {0x41, 0x0448, 0x65e5, 0xd834, 0xdd1e};
- string utf8result;
- utf8::unchecked::utf16to8(utf16string, utf16string + 5, back_inserter(utf8result));
- EXPECT_EQ (utf8result.size(), 10);
-}
-
-TEST(UnCheckedAPITests, test_utf8to16)
-{
- char utf8_with_surrogates[] = "\xe6\x97\xa5\xd1\x88\xf0\x9d\x84\x9e";
- vector <unsigned short> utf16result;
- utf8::unchecked::utf8to16(utf8_with_surrogates, utf8_with_surrogates + 9, back_inserter(utf16result));
- EXPECT_EQ (utf16result.size(), 4);
- EXPECT_EQ (utf16result[2], 0xd834);
- EXPECT_EQ (utf16result[3], 0xdd1e);
-}
-
-TEST(UnCheckedAPITests, test_replace_invalid)
-{
- char invalid_sequence[] = "a\x80\xe0\xa0\xc0\xaf\xed\xa0\x80z";
- vector<char> replace_invalid_result;
- utf8::unchecked::replace_invalid (invalid_sequence, invalid_sequence + sizeof(invalid_sequence), std::back_inserter(replace_invalid_result), '?');
- bool bvalid = utf8::is_valid(replace_invalid_result.begin(), replace_invalid_result.end());
- EXPECT_TRUE (bvalid);
- const char fixed_invalid_sequence[] = "a????z";
- EXPECT_EQ (sizeof(fixed_invalid_sequence), replace_invalid_result.size());
- EXPECT_TRUE (std::equal(replace_invalid_result.begin(), replace_invalid_result.begin() + sizeof(fixed_invalid_sequence), fixed_invalid_sequence));
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_iterator.h b/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_iterator.h
deleted file mode 100644
index 4294232d6a..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/tests/test_unchecked_iterator.h
+++ /dev/null
@@ -1,36 +0,0 @@
-#ifndef UTF8_FOR_CPP_TEST_UNCHECKED_ITERATOR_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-#define UTF8_FOR_CPP_TEST_UNCHECKED_ITERATOR_H_2675DCD0_9480_4c0c_B92A_CC14C027B731
-
-#include "utf8/unchecked.h"
-
-using namespace utf8::unchecked;
-
-
-TEST(UnCheckedIteratrTests, test_increment)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- utf8::unchecked::iterator<const char*> it(threechars);
- utf8::unchecked::iterator<const char*> it2 = it;
- EXPECT_EQ (it2, it);
- EXPECT_EQ (*it, 0x10346);
- EXPECT_EQ (*(++it), 0x65e5);
- EXPECT_EQ ((*it++), 0x65e5);
- EXPECT_EQ (*it, 0x0448);
- EXPECT_NE (it, it2);
- utf8::unchecked::iterator<const char*> endit (threechars + 9);
- EXPECT_EQ (++it, endit);
-}
-
-TEST(UnCheckedIteratrTests, test_decrement)
-{
- const char* threechars = "\xf0\x90\x8d\x86\xe6\x97\xa5\xd1\x88";
- utf8::unchecked::iterator<const char*> it(threechars+9);
- EXPECT_EQ (*(--it), 0x0448);
- EXPECT_EQ ((*it--), 0x0448);
- EXPECT_EQ (*it, 0x65e5);
- EXPECT_EQ (--it, utf8::unchecked::iterator<const char*>(threechars));
- EXPECT_EQ (*it, 0x10346);
-
-}
-
-#endif
diff --git a/graphics/asymptote/LspCpp/third_party/utfcpp/utf8cppConfig.cmake.in b/graphics/asymptote/LspCpp/third_party/utfcpp/utf8cppConfig.cmake.in
deleted file mode 100644
index 450fe8d186..0000000000
--- a/graphics/asymptote/LspCpp/third_party/utfcpp/utf8cppConfig.cmake.in
+++ /dev/null
@@ -1,6 +0,0 @@
-@PACKAGE_INIT@
-
-include("${CMAKE_CURRENT_LIST_DIR}/utf8cppTargets.cmake")
-check_required_components( "utf8cpp" )
-
-add_library(utf8::cpp ALIAS utf8cpp)
diff --git a/graphics/asymptote/Makefile.in b/graphics/asymptote/Makefile.in
index 1c7866fef1..b5b8c0fae9 100644
--- a/graphics/asymptote/Makefile.in
+++ b/graphics/asymptote/Makefile.in
@@ -11,10 +11,13 @@ GCOPTIONS = @GCOPTIONS@
GCLIB = @GCLIB@
GCPPLIB = @GCPPLIB@
GCLIBS = $(GCPPLIB) $(GCLIB)
-LFLAGS = @LDFLAGS@ -LLspCpp -LLspCpp/third_party/uri/src
+LFLAGS = @LDFLAGS@
LIBS = $(LFLAGS) @PTHREAD_LIBS@ @GLEW@ @LIBS@ $(GCLIBS) @LSPLIBS@
+CXX_STANDARD = @CXX_STANDARD@
DOSLIBS = $(LIBS) -ltermcap -lwolfssl -lgdi32 -lwinmm -s -static
+EXTLIB_BUILD_ROOT = @EXTLIB_BUILD_ROOT@
+
CMAKE ?= cmake
PERL ?= perl
PYTHON ?= python3
@@ -27,6 +30,7 @@ PYUIC ?= pyuic5
SHAREDLIBS = $(filter-out -lglut -GL -pthread $(GCLIBS), $(LIBS))
vpath %.cc prc
+vpath %.cc thirdparty_impl/tinyexr_impl/src
vpath %.ui GUI/windows
vpath %.py GUI/pyUIClass
vpath %.py GUI
@@ -40,37 +44,41 @@ RUNTIME_FILES = runtime runbacktrace runpicture runlabel runhistory runarray \
runmath
# Files to be scanned for pre-translated symbols defined by SYM(name).
-SYMBOL_FILES = types builtin gsl $(RUNTIME_FILES)
+SYMBOL_FILES = $(RUNTIME_FILES) types builtin gsl
PRC = PRCbitStream oPRCFile PRCdouble writePRC
-COREFILES = $(CAMP) $(SYMBOL_FILES) env genv stm dec errormsg \
- callable name symbol entry exp newexp stack camp.tab lex.yy \
+TINYEXR_FILES = tinyexr_impl
+
+COREFILES = $(CAMP) $(SYMBOL_FILES) $(PRC) $(TINYEXR_FILES) \
+ env genv stm dec errormsg \
+ callable name symbol entry exp newexp stack exithandlers camp.tab lex.yy \
access virtualfieldaccess absyn record interact fileio \
- fftw++asy parallel simpson coder coenv impdatum \
- @getopt@ locate parser program application varinit fundec refaccess \
- envcompleter process constructor array Delaunay predicates \
- $(PRC) glrender tr shaders jsfile v3dfile tinyexr EXRFiles GLTextures \
- lspserv symbolmaps
+ fftw++asy parallel simpson coder coenv impdatum locate asyparser program application \
+ varinit fundec refaccess envcompleter asyprocess constructor array memory \
+ Delaunay predicates glrender tr shaders jsfile v3dfile \
+ EXRFiles GLTextures lspserv symbolmaps win32helpers win32pipestream \
+ win32xdr xstream
FILES = $(COREFILES) main
SYMBOLSH = opsymbols.h allsymbols.h $(SYMBOL_FILES:=.symbols.h)
UIFILES = $(wildcard GUI/windows/*.ui)
-PYFILES = $(wildcard GUI/pyUIClass/*.py) GUI/icons_rc.py
+PYFILES = GUI/xasyqtui GUI/xasyicons GUI/xasyversion
GENERATEDENUMS=v3dtypes v3dheadertypes
ASYGENERATEDENUMS=$(addprefix base/,$(GENERATEDENUMS:=.asy))
PYGENERATEDENUMS=$(GENERATEDENUMS:=.py)
-DIST = camp.tab.h camp.tab.cc lex.yy.cc runtime.cc keywords.cc \
+DIST = camp.tab.h camp.tab.cc lex.yy.cc runtime.cc keywords.h \
asy-keywords.el $(RUNTIME_FILES:=.cc) asy.list \
- $(SYMBOLSH) $(PYFILES) $(GENERATEDENUMS:=.h) $(ASYGENERATEDENUMS)
+ $(SYMBOLSH) $(GENERATEDENUMS:=.h) $(ASYGENERATEDENUMS) $(PYFILES)
NAME = asy
XNAME = x$(NAME)
CLEAN = camp.output base/version.asy doc/version.texi \
- GUI/xasyVersion.py $(XNAME) doc/asy-latex.pdf $(SYMBOLSH)
+ GUI/xasyVersion.py $(XNAME) doc/asy-latex.pdf $(SYMBOLSH) \
+ version.txt
EXTRA = asy-mode.el asy-init.el asy.vim asy_filetype.vim asy-kate.sh \
asymptote.py reload.js nopapersize.ps
EXEXTRA = piicon.png 100d.pdb1 *.views *.dat *.bib
@@ -82,7 +90,9 @@ ASY = ./asy -dir base -config "" -render=0
DEFS = @DEFS@ @OPTIONS@ @PTHREAD_CFLAGS@ -DFFTWPP_SINGLE_THREAD -Wall
CFLAGS = @CFLAGS@
-OPTS = $(DEFS) @CPPFLAGS@ @CXXFLAGS@ $(CFLAGS) -ILspCpp/include
+OPTS = $(DEFS) @CPPFLAGS@ @CXXFLAGS@ $(CFLAGS) \
+ -Ibackports/optional/include \
+ -Iprc/include
GLEWOPTS = $(DEFS) @CPPFLAGS@ $(CFLAGS) -DGLEW_NO_GLU -DGLEW_BUILD -O1 -fPIC
@@ -126,42 +136,48 @@ endif
export prefix docdir exampledir mandir infodir INSTALL MAKE DESTDIR TEXI2DVI
-asy: version $(FILES:=.o) glew.o @LSPLIB@
- if test -n "$(MSDOS)"; then \
- $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) revision.o asy.o $(DOSLIBS); \
- else \
- ln -sf GUI/xasy.py $(XNAME); \
- $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) revision.o $(LIBS); \
- fi
+asy: base/version.asy $(FILES:=.o) $(XNAME) revision.o @LSPLIB@ @GLEW@
+ $(CXX) $(OPTS) -o $(NAME) $(FILES:=.o) revision.o $(LIBS)
+
+$(XNAME): $(PYFILES)
+ ln -sf GUI/xasy.py $(XNAME)
-version: $(GCLIB) $(notdir $(UIFILES:.ui=.py)) icons_rc.py $(ASYGENERATEDENUMS) $(PYGENERATEDENUMS)
- if test ! -s revision.cc || test "$(revision)" != "$(last)"; then \
- echo $(REVISION)\"$(revision)\"\; > revision.cc; \
- echo const char *AsyGLVersion=\"$(ASYGLVERSION)\"\; >> revision.cc; \
- if test ! -e base/webgl/asygl.js; then \
- cp base/webgl/asygl-$(ASYGLVERSION).js base/webgl/asygl.js; \
- fi \
+version.txt: FORCE
+ if test ! -s $@ || test "$(revision)" != "$(last)"; then \
+ echo "$(revision)" > $@; \
fi
- $(CXX) $(OPTS) -o revision.o -c revision.cc;
- echo string VERSION=\"$(revision)\"\; > base/version.asy
- echo @set VERSION $(revision) > doc/version.texi
- echo @set Datadir @datadir@ >> doc/version.texi
- echo @set Docdir @docdir@ >> doc/version.texi
+GUI/xasyversion: version.txt GUI/buildtool.py
+ cd GUI && $(PYTHON) buildtool.py buildversionmodule --version-override="$(shell cat $<)"
- echo "#!/usr/bin/env python3" > GUI/xasyVersion.py
- echo xasyVersion = \"$(revision)\" >> GUI/xasyVersion.py
+revision.cc: version.txt
+ echo $(REVISION)\"$(shell cat $<)\"\; > $@
+ echo const char *AsyGLVersion=\"$(ASYGLVERSION)\"\; >> $@;
- if test -n "$(MSDOS)"; then \
- cat asy.rc | sed -e "s/ASYMPTOTE_VERSION/$(revision)/" | \
- windres -o asy.o; \
- fi
+base/webgl/asygl.js: base/webgl/asygl-$(ASYGLVERSION).js
+ cp $< $@;
+
+base/version.asy: version.txt
+ echo string VERSION=\"$(shell cat $<)\"\; > $@
+
+doc/version.texi: version.txt
+ echo @set VERSION $(shell cat $<) > $@
+ echo @set Datadir @datadir@ >> $@
+ echo @set Docdir @docdir@ >> $@
asymptote.so: $(COREFILES:=.pic.o) glew.o
$(CXX) $(OPTS) -shared -o asymptote.so revision.o $(COREFILES:=.pic.o) $(SHAREDLIBS)
-liblspcpp.a:
- cd LspCpp && $(CMAKE) -DCMAKE_CXX_FLAGS="-fPIE @OPTIONS@ -I../$(GC)/include" CMakeLists.txt && $(MAKE)
+LSP_BUILD_ROOT=@LSP_BUILD_ROOT@
+LSP_ROOT=@LSP_ROOT@
+
+$(LSP_BUILD_ROOT)/Makefile:
+ $(CMAKE) -B$(LSP_BUILD_ROOT) -S$(LSP_ROOT) \
+ -DCMAKE_CXX_FLAGS="-fPIE @OPTIONS@ @LSP_CXX_BUILD_FLAGS@ -I@ROOT_DIR_RELATIVE_TO_LSP@/$(GC)" \
+ @LSP_CMAKE_OPTIONS@
+
+$(LSP_BUILD_ROOT)/liblspcpp.a: $(LSP_BUILD_ROOT)/Makefile
+ $(MAKE) -C $(LSP_BUILD_ROOT)
all: asy sty man faq asy-keywords.el
@@ -194,7 +210,7 @@ $(GCLIB): $(GC).tar.gz
$(GCPPLIB): $(GCLIB)
-sty:
+sty: doc/version.texi
cd doc && $(MAKE) asy-latex.pdf
dvi: asy sty
@@ -210,42 +226,74 @@ faq: asy sty
cd doc && $(MAKE) faq
$(RUNTIME_FILES:=.cc): %.cc: runtime.pl opsymbols.h runtimebase.in %.in
- $(PERL) ./runtime.pl $(@:.cc=)
-
-$(SYMBOL_FILES:=.symbols.h): %.symbols.h: findsym.pl %.cc
- $(CXX) -E -DNOSYM $(OPTS) $(@:.symbols.h=.cc) | \
- $(PERL) ./findsym.pl $@ -
+ $(PERL) ./runtime.pl --prefix $(@:.cc=) --opsym-file opsymbols.h \
+ --runtime-base-file runtimebase.in \
+ --src-template-dir . \
+ --header-out-dir . \
+ --src-out-dir .
+
+# symbol files
+
+GEN_PREOROCESSED_DEPFILE_BASE_ARGS = \
+ $(PYTHON) gen_preprocessed_depfile.py \
+ --cxx-compiler=$(CXX) \
+ --additional-raw-arguments="$(OPTS)" \
+ --cxx-standard=$(subst gnu,,$(subst c++,,$(CXX_STANDARD)))
+
+$(SYMBOL_FILES:=.raw.i): %.raw.i: %.cc gen_preprocessed_depfile.py
+ @echo Generating $@ from $<
+ @$(GEN_PREOROCESSED_DEPFILE_BASE_ARGS) \
+ --out-i-file=$@ \
+ --in-src-file=$<
+
+$(SYMBOL_FILES:=.d): %.d: %.cc gen_preprocessed_depfile.py
+ @echo Generating $@ from $<
+ @$(GEN_PREOROCESSED_DEPFILE_BASE_ARGS) \
+ --out-dep-file=$@ \
+ --dep-file-only \
+ --out-i-file=$*.raw.i \
+ --in-src-file=$<
+
+$(SYMBOL_FILES:=.symbols.h): %.symbols.h: %.raw.i findsym.pl
+ $(PERL) findsym.pl $@ $<
$(SYMBOL_FILES:=.o): %.o: %.symbols.h
-allsymbols.h: findsym.pl $(SYMBOL_FILES:=.cc)
- $(CXX) -E -DNOSYM $(OPTS) $(SYMBOL_FILES:=.cc) | \
- $(PERL) ./findsym.pl $@ -
+allsymbols.h: $(SYMBOL_FILES:=.raw.i) findsym.pl
+ $(PERL) ./findsym.pl $@ $(filter-out findsym.pl,$^)
symbol.o: $(SYMBOLSH)
icons_rc.py: GUI/res/icons.qrc
-$(PYRCC) GUI/res/icons.qrc -o GUI/icons_rc.py
+GUI/xasyicons: GUI/res/icons.qrc GUI/buildtool.py
+ cd GUI && $(PYTHON) buildtool.py buildicons
+
+GUI/xasyqtui: $(UIFILES) GUI/buildtool.py
+ cd GUI && $(PYTHON) buildtool.py buildui
+
camp.tab.cc: camp.y
- $(BISON) -dvt -b camp camp.y && mv camp.tab.c camp.tab.cc
+ $(BISON) -t --header=camp.tab.h -o $@ $<
camp.tab.h: camp.tab.cc
+ @test -f $@ || rm -f $<
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) $<
lex.yy.cc: camp.l
$(LEX) -d -olex.yy.cc camp.l
lex.yy.d: $(GCLIB) lex.yy.cc camp.tab.h
-keywords.cc: keywords.pl camp.l process.cc
- $(PERL) ./keywords.pl
+keywords.h: camp.l keywords.pl asyprocess.cc
+ $(PERL) ./keywords.pl --camplfile $< --output $@ --process-file asyprocess.cc
-opsymbols.h: opsymbols.pl camp.l
- $(PERL) ./opsymbols.pl
+opsymbols.h: camp.l opsymbols.pl
+ $(PERL) ./opsymbols.pl --campfile $< --output $@
-envcompleter.d: keywords.cc
+envcompleter.d: keywords.h
-asy-keywords.el: asy
+asy-keywords.el: asy base/v3dtypes.asy base/v3dheadertypes.asy
@echo Creating $@;
$(ASY) -l > asy.list
ls $(addsuffix /*.asy,$(KEYWORDS)) | grep -v plain\* | \
@@ -263,23 +311,26 @@ install-texhash: install-asy
texhash; \
fi
-install-asy: asy sty
+install-asy: asy sty $(PYFILES)
${INSTALL} -d $(bindir) $(asydir) $(exampledir) $(animationsdir)
- ${INSTALL} -d $(GUIdir) $(GUIdir)/pyUIClass $(GUIdir)/configs \
- $(GUIdir)/res $(GUIdir)/res/icons $(shaderdir) \
- $(webgldir)
+ ${INSTALL} -d $(shaderdir) $(webgldir) \
+ $(GUIdir) $(GUIdir)/configs \
+ $(GUIdir)/res $(GUIdir)/res/icons \
+ $(GUIdir)/xasyicons $(GUIdir)/xasyqtui $(GUIdir)/xasyversion
-${INSTALL} -d $(latexdir)
-${INSTALL} -d $(contextdir)
${INSTALL} -p -m 755 $(NAME) $(bindir)
${INSTALL} -p -m 644 base/*.asy $(addprefix base/,$(EXTRA)) \
asy-keywords.el $(asydir)
- ${INSTALL} -p -m 755 GUI/*.py $(GUIdir)
${INSTALL} -p -m 644 base/shaders/*.glsl $(shaderdir)
${INSTALL} -p -m 644 base/webgl/asygl.js \
$(webgldir)
- -${INSTALL} -p -m 644 GUI/pyUIClass/*.py $(GUIdir)/pyUIClass
+ ${INSTALL} -p -m 755 GUI/xasy.py $(GUIdir)
+ ${INSTALL} -p -m 644 GUI/*.py $(GUIdir)
+ -${INSTALL} -p -m 644 GUI/xasyicons/*.py $(GUIdir)/xasyicons
+ -${INSTALL} -p -m 644 GUI/xasyqtui/*.py $(GUIdir)/xasyqtui
+ -${INSTALL} -p -m 644 GUI/xasyversion/*.py $(GUIdir)/xasyversion
${INSTALL} -p -m 644 GUI/configs/*.cson $(GUIdir)/configs
- -${INSTALL} -p -m 644 GUI/icons_rc.py $(GUIdir)
${INSTALL} -p -m 644 GUI/res/icons/*.svg $(GUIdir)/res/icons
ln -sf @datadir@/asymptote/GUI/xasy.py $(bindir)/$(XNAME)
${INSTALL} -p -m 644 examples/*.asy $(addprefix examples/,$(EXEXTRA)) \
@@ -309,8 +360,12 @@ uninstall-asy:
-cd $(exampledir) && rm -f $(EXEXTRA) $(DOCEXTRA)
-rmdir $(exampledir)
-cd $(GUIdir) && rm -f *.py
- -cd $(GUIdir)/pyUIClass && rm -f *.py
- -rmdir $(GUIdir)/pyUIClass
+ -cd $(GUIdir)/xasyicons && rm -f *.py
+ -rmdir $(GUIdir)/xasyicons
+ -cd $(GUIdir)/xasyqtui && rm -f *.py
+ -rmdir $(GUIdir)/xasyqtui
+ -cd $(GUIdir)/xasyversion && rm -f *.py
+ -rmdir $(GUIdir)/xasyversion
-cd $(GUIdir)/configs && rm -f *.cson
-rmdir $(GUIdir)/configs
-cd $(GUIdir)/res/icons && rm -f *.svg
@@ -337,8 +392,9 @@ uninstall-docdir:
-rmdir $(docdir)
clean: FORCE
- -rm -f asy asymptote.so *.pic.o *.o *.d *mon.out $(CLEAN)
- -cd LspCpp && $(MAKE) clean
+ -rm -f asy asymptote.so *.pic.o *.o *.d *.raw.i *mon.out $(CLEAN)
+ -rm -rf acextbuilds
+ -cd GUI && $(PYTHON) buildtool.py clean
gc-clean: FORCE clean
-if test -d $(GC); then \
@@ -350,21 +406,19 @@ cleaner: FORCE clean
rm -rf $(GC); \
fi
-rm -f Makefile config.h config.log config.status errors.temp
+ -rm -rf acextlibs
cd doc && $(MAKE) clean
cd tests && $(MAKE) distclean
distclean: FORCE cleaner
cd doc && $(MAKE) distclean
- cd LspCpp && rm -rf CMakeCache.txt CMakeDoxyfile.in \
- CMakeDoxygenDefaults.cmake CMakeFiles Makefile cmake_install.cmake \
- third_party/uri/src/CMakeFiles/network-uri.dir/detail
-
cleanest: FORCE maintainer-clean
maintainer-clean: FORCE distclean
-rm -f configure config.h.in $(DIST)
-rm -rf autom4te.cache
-rm -rf GUI/pyUIClass
+ -rm -rf vcpkg_installed
test: asy FORCE
./wce
@@ -376,8 +430,8 @@ check-all: asy FORCE
./wce
$(MAKE) -C tests all
-glew.o: glew.c GL/glew.h GL/glew.c config.h
- $(CC) -I. $(GLEWOPTS) -o glew.o -c glew.c
+glew.o: backports/glew/src/glew.c config.h
+ $(CC) -I. $(GLEWOPTS) -o $@ -c $<
.SUFFIXES: .c .cc .o .d .ui .py
%.o: %.cc $(GENERATEDENUMS:=.h) $(RUNTIME_FILES:=.cc)
diff --git a/graphics/asymptote/README b/graphics/asymptote/README
index 686eb44150..69ff508907 100644
--- a/graphics/asymptote/README
+++ b/graphics/asymptote/README
@@ -44,15 +44,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Note that the MSWindows executable version of Asymptote can only be
released under the GNU General Public License (GPL) as it is linked against
the GNU Scientific Library, GNU Readline library, and other GPL
-libraries. This version of Asymptote also ships with the cygwin1.dll libraries
-noted below.
+libraries.
========================================================================
-Source code for the x86_64 and i386 3.5.1 cygwin1.dll libraries is
-available under the GPL license:
-https://www.cygwin.com/git.html
-
Source for various icons is available under the MIT license from
https://github.com/driftyco/ionicons/archive/v2.0.1.zip
https://github.com/iconic/open-iconic/archive/master.zip
diff --git a/graphics/asymptote/ReleaseNotes b/graphics/asymptote/ReleaseNotes
index f4be119660..2eaf2a8867 100644
--- a/graphics/asymptote/ReleaseNotes
+++ b/graphics/asymptote/ReleaseNotes
@@ -1,6 +1,11 @@
+Release Notes for Version 2.93
+A portability issue with a recent version of Ubuntu was addressed.
+The windows binary is now built natively using CMake.
+
Release Notes for Version 2.92
-A bug in unravelling static fields was fixed. ImageMagick arguments were reordered.
+A bug in unravelling static fields was fixed.
+ImageMagick arguments were reordered.
An Xasy regex bug was fixed. The bytecode interpreter was optimized.
The code to ignore duplicate implicit shipouts now accounts for the format.
The slide paperwidth and paperheight are now properly updated.
diff --git a/graphics/asymptote/__pycache__/determine_pkg_info.cpython-312.pyc b/graphics/asymptote/__pycache__/determine_pkg_info.cpython-312.pyc
new file mode 100644
index 0000000000..b18b89dbf1
--- /dev/null
+++ b/graphics/asymptote/__pycache__/determine_pkg_info.cpython-312.pyc
Binary files differ
diff --git a/graphics/asymptote/array.cc b/graphics/asymptote/array.cc
index c70f5e22f3..3643bb0e1e 100644
--- a/graphics/asymptote/array.cc
+++ b/graphics/asymptote/array.cc
@@ -78,24 +78,26 @@ void array::setNonBridgingSlice(size_t l, size_t r, mem::vector<item> *a)
{
assert(0 <= l);
assert(l <= r);
+
+ size_t const sliceLength=r-l;
size_t asize=a->size();
- if (asize == r-l) {
+ if (asize == sliceLength) {
// In place
std::copy(a->begin(), a->end(), this->begin()+l);
}
- else if (asize < r-l) {
+ else if (asize < sliceLength) {
// Shrinking
std::copy(a->begin(), a->end(), this->begin()+l);
- this->erase(this->begin()+l+a->size(), this->begin()+r);
+ this->erase(this->begin()+(l+a->size()), this->begin()+r);
}
else {
// Expanding
// NOTE: As a speed optimization, we could check capacity() to see if the
// array can fit the new entries, and build the new array from scratch
// (using swap()) if a new allocation is necessary.
- std::copy(a->begin(), a->begin()+r-l, this->begin()+l);
- this->insert(this->begin()+r, a->begin()+r-l, a->end());
+ std::copy(a->begin(), a->begin()+sliceLength, this->begin()+l);
+ this->insert(this->begin()+r, a->begin()+sliceLength, a->end());
}
}
diff --git a/graphics/asymptote/asy-keywords.el b/graphics/asymptote/asy-keywords.el
index 5de1df7762..2cdd3cd0ee 100644
--- a/graphics/asymptote/asy-keywords.el
+++ b/graphics/asymptote/asy-keywords.el
@@ -2,7 +2,7 @@
;; This file is automatically generated by asy-list.pl.
;; Changes will be overwritten.
;;
-(defvar asy-keywords-version "2.92")
+(defvar asy-keywords-version "2.93")
(defvar asy-keyword-name '(
and controls tension atleast curl if else while for do return break continue struct typedef new access import unravel from include quote static public private restricted this explicit true false null cycle newframe operator ))
diff --git a/graphics/asymptote/asy-list.pl b/graphics/asymptote/asy-list.pl
index 4206adc480..02d4fedc77 100755..100644
--- a/graphics/asymptote/asy-list.pl
+++ b/graphics/asymptote/asy-list.pl
@@ -2,14 +2,17 @@
#####
# asy-list.pl
#
-# Build asy-keywords.el from list of asy global functions and variables
+# Build asy-keywords.el from list of asy global functions and variables
#
#####
-open(keywords, "> asy-keywords.el") ||
+use strict;
+use warnings;
+
+open(my $keywords, "> asy-keywords.el") ||
die("Couldn't open asy-keywords.el for writing.");
-print keywords <<END;
+print $keywords <<END;
;;
;; This file is automatically generated by asy-list.pl.
;; Changes will be overwritten.
@@ -19,27 +22,27 @@ print keywords <<END;
END
sub add {
- print keywords $_[0]." ";
+ print $keywords $_[0]." ";
}
-
+my $asylist;
sub openlist {
- open(asylist, $ARGV[0]) || die("Couldn't open $ARGV[0]");
+ open($asylist, $ARGV[0]) || die("Couldn't open $ARGV[0]");
}
-print keywords <<END;
+print $keywords <<END;
(defvar asy-keyword-name '(
END
-open(camp, "camp.l") || die("Couldn't open camp.l");
+open(my $camp, "camp.l") || die("Couldn't open camp.l");
# Search for the %% separator, after which the definitions start.
-while (<camp>) {
+while (<$camp>) {
if (/^%%\s*$/) {
last; # Break out of the loop.
}
}
-while (<camp>) {
+while (<$camp>) {
if (/^%%\s*$/) {
last; # A second %% indicates the end of definitions.
}
@@ -50,7 +53,11 @@ while (<camp>) {
openlist();
-while (<asylist>) {
+my @types;
+my @functions;
+my @variables;
+
+while (<$asylist>) {
if (/^(\w*)[^ ]* (\w*)\(.*/) {
push @types, $1;
push @functions, $2;
@@ -60,47 +67,47 @@ while (<asylist>) {
}
}
+my %saw;
@saw{@types} = ();
-@types = sort keys %saw;
+@types = sort keys %saw;
undef %saw;
@saw{@functions} = ();
-@functions = sort keys %saw;
+@functions = sort keys %saw;
undef %saw;
@saw{@variables} = ();
-@variables = sort keys %saw;
+@variables = sort keys %saw;
undef %saw;
-print keywords <<END;
+print $keywords <<END;
))
(defvar asy-type-name '(
END
foreach(@types) {
- print keywords $_ . " ";
+ print $keywords $_ . " ";
}
-print keywords <<END;
+print $keywords <<END;
))
(defvar asy-function-name '(
END
foreach(@functions) {
- print keywords $_ . " ";
+ print $keywords $_ . " ";
}
-print keywords <<END;
+print $keywords <<END;
))
(defvar asy-variable-name '(
END
foreach(@variables) {
- print keywords $_ . " ";
+ print $keywords $_ . " ";
}
-print keywords "))\n";
-
+print $keywords "))\n";
diff --git a/graphics/asymptote/asy.list b/graphics/asymptote/asy.list
index 64397c27be..ce9282d9e4 100644
--- a/graphics/asymptote/asy.list
+++ b/graphics/asymptote/asy.list
@@ -1,322 +1,1314 @@
-string stripfile(string s);
-string stripsuffix(string f, string suffix=<default>);
-real cbrt(real x);
-real[] cbrt(real[] a);
-pen RGB(int r, int g, int b);
+void drawstrokepath(picture pic=<default>, path g, pen strokepen, pen p=<default>);
+real legendlinelength;
+coord[] maxcoords(coord[] in, bool operator <=(coord, coord));
+string outdirectory();
+bool prc(string format=<default>);
+light currentlight;
+pen royalblue;
+real arrowdir;
+filltype filltype(int type=<default>, pen fillpen=<default>, pen drawpen=<default>, void fill2(frame f, path[] g, pen fillpen));
+string file(string s);
+int Suppress;
+align NoAlign;
+filltype RadialShade(pen penc, pen penr);
+real[] arrowbasepoints(path base, path left, path right, real default=<default>);
+real bp;
+pen mean(pen[] p, real opacity(real[])=<default>);
+pen[] mean(pen[][] palette, real opacity(real[])=<default>);
+string[] split(string s, string delimiter=<default>);
+path plus;
cputime cputime();
-string stripdirectory(string s);
-real sqrtEpsilon;
-string stripextension(string s);
-version version;
-void texpreamble(string s);
-pen beveljoin;
-string cputimeformat;
-real Cos(real deg);
-string insert(string s, int pos, string t);
-marginT EndDotMargin(path, pen);
-pen heavyred;
-pen black;
-pen heavyblue;
-filltype dotfilltype;
-pen heavygreen;
-pen heavycyan;
-marginT PenMargin(path, pen)(real begin, real end=<default>);
-marginT PenMargin(path, pen);
-int realDigits;
-pen heavymagenta;
-marginT PenMargins(path, pen);
-void newl(file file);
-void seek(file f, int pos);
+real inches;
+pair SW;
+real inch;
+marginT EndMargin(path, pen);
+pen mediumgrey;
+pen darkcyan;
+real legendhskip;
+void addSaveFunction(void s()());
+pen olive;
+pen zerowinding;
+pen deepmagenta;
+path[] margin(path[] g, real xmargin, real ymargin);
+pen mediumyellow;
+slice lastcut(path p, path knife);
+pen darkgreen;
string verbatim(string s);
pen heavygray;
+pen darkred;
+pair E;
+plain_bounds plain_bounds;
+pen darkgray;
+frame orientation(frame);
+void progress(bool3 init=<default>);
+pen salmon;
+pen mediummagenta;
+pair arcdir(path p, real L);
+pen mediumcyan;
+pen Pentype(int n);
+triple gettriple(string name=<default>, triple default=<default>, string prompt=<default>, bool store=<default>);
+pen Yellow;
+real cm;
+pen mediumgreen;
+pen heavygreen;
+void copyPairOrTriple(pairOrTriple dest, pairOrTriple src);
+projection centered(projection P, picture pic=<default>);
+pen dashdotted;
+pen deepblue;
+string graphicscale(real x);
+pen mediumblue;
+transform invert;
+pair NNW;
+pair SE;
+pen thick(pen p=<default>);
+pen mediumred;
+marginT EndDotMargin(path, pen);
+bool ArcArrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
+bool ArcArrows(picture, path, pen, marginT(path, pen));
+void filloutside(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>);
+void filloutside(frame f, path[] g, pen p=<default>, bool copy=<default>);
+marginT BeginDotMargin(path, pen);
+frame enclose(string prefix=<default>, object F, string format=<default>);
+marker[] Mark;
+marker Mark(int n);
+pen darkolive;
+pen Dotted;
+pen Dotted(pen p=<default>);
+string math(string s);
+transform fixedscaling(picture pic=<default>, pair min, pair max, pen p=<default>, bool warn=<default>);
+pen Symbol(string series=<default>, string shape=<default>);
+int count;
+path circle(pair c, real r);
+path ellipse(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+path ellipse(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+path ellipse(pair c, real a, real b);
+pen beveljoin;
+pen orange;
+pen green;
+bool EndBar(picture, path, pen, marginT(path, pen));
+bool EndBar(picture, path, pen, marginT(path, pen))(real size=<default>);
+file stdin;
+void fillbox(frame dest, path g, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+int debuggerlines;
+frame bbox(picture pic=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>);
+path unitcircle;
+arrowhead DefaultHead;
+pen white;
+position EndPoint;
+transform Rotate(transform)(pair z);
+transform Rotate(transform t);
+Legend Legend(string label, pen plabel=<default>, pen p=<default>, frame mark=<default>, bool above=<default>);
+void exitfunction();
+void drawarrow(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>);
+string cputimeformat;
+pair arcpoint(path p, real L);
+bool interior(int windingnumber, pen fillrule);
+pen fuchsia;
+pen brown;
+void bar(picture pic, pair a, pair d, pen p=<default>);
+picture bar(pair a, pair d, pen p=<default>);
+pen deepcyan;
+pen dotted;
+pair reldir(path p, real l);
+pen pink;
+pen TimesRoman(string series=<default>, string shape=<default>);
+pen palemagenta;
+int mantissaBits;
+pen lightolive;
+path arrowbase(path r, pair y, real t, real size);
+frame pack(pair align=<default> ... object[] inset);
+pen[] monoPen;
+bool CW;
+pen Cyan;
+marginT EndPenMargin(path, pen);
+pair NNE;
+pen roundjoin;
+void addArrow(picture pic, arrowhead arrowhead, path g, pen p, real size, real angle, filltype filltype, real position);
+pen lightgray;
+picture arrow2(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>);
+pair relative(picture pic=<default>, pair z);
+position MidPoint;
+string Embed(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>);
+pen deepgrey;
+pen lightyellow;
+marginT Margin(path, pen)(real begin, real end=<default>);
+marginT Margin(path, pen);
+side NoSide;
+file stdout;
+void mapArray(string From, string To);
+frame Seascape(frame f);
+pair up;
+pen ZapfChancery(string series=<default>, string shape=<default>);
+pair left;
+bool prconly(string format=<default>);
+pen deepgreen;
+pen lightmagenta;
+real bracedefaultratio;
+transform Scale(transform t);
+string getstring(string name=<default>, string default=<default>, string prompt=<default>, bool store=<default>);
+marginT DotMargins(path, pen);
+path[] MarkPath;
+frame[] fit(string prefix=<default>, picture[] pictures, string format=<default>, bool view=<default>, string options=<default>, string script=<default>, projection P=<default>);
+pen Bookman(string series=<default>, string shape=<default>);
+path box(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+path box(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+path box(pair a, pair b);
+picture legenditem(Legend legenditem, real linelength);
+pen deepgray;
+string defaultformat(int n, string trailingzero=<default>, bool fixed=<default>, bool signed=<default>);
+string defaultformat;
+pen lightcyan;
+pen paleblue;
+frame align(frame f, pair align);
+object align(object F, pair align);
+path[] align(path[] g, transform t=<default>, pair position, pair align, pen p=<default>);
+transform scaleless(transform t);
+pen RGB(int r, int g, int b);
+pen thin();
+real arcarrowangle;
+void restoredefaults();
+pen longdashdotted;
+void usepackage(string s, string options=<default>);
+pen dashed;
+string TeXify(string s);
+string graphic(string name, string options=<default>);
+frame Portrait(frame f);
+real braceinnerangle;
+guide operator ---(... guide[]);
+int JOIN_IN;
+real barfactor;
+void arrow(picture pic=<default>, Label L=<default>, pair b, pair dir, real length=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
+picture arrow(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>);
+void unitsize(picture pic=<default>, real x, real y=<default>, real z=<default>);
+pen lightgreen;
+transform zeroTransform;
+void endl(file file);
+bool ArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+bool ArcArrow(picture, path, pen, marginT(path, pen));
+void usersetting();
+bool prc0(string format=<default>);
+object embed3(string, frame, string, string, string, light, projection);
+pair rectify(pair dir);
+arrowhead TeXHead;
+void beep();
+real labelmargin;
+real labelmargin(pen p=<default>);
+pen lightblue;
+real bracemidangle;
+path unitsquare;
+void savedefaults()();
+bool MidArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
+bool MidArrow(picture, path, pen, marginT(path, pen));
+pen cyan;
+pen grey;
+transform rotation(transform t);
+pair W;
+pen magenta;
+pair WSW;
+pen nobasealign;
+frame Landscape(frame f);
+real camerafactor;
+pen lightred;
+path trim(path g, real begin, real end=<default>);
+marginT DotMargin(path, pen)(real begin, real end=<default>);
+marginT DotMargin(path, pen);
+pen squarepen;
+pen deepyellow;
+real barsize(pen p=<default>);
+void begin(picture pic=<default>, string name, string id=<default>, bool visible=<default>);
+bool BeginArcArrow(picture, path, pen, marginT(path, pen));
+bool BeginArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+real legendmargin;
+bool None(picture, path, pen, marginT(path, pen));
+pen AvantGarde(string series=<default>, string shape=<default>);
+real circleprecision;
+pen Black;
+pen Pen(int n);
+pair ENE;
+pen Courier(string series=<default>, string shape=<default>);
+void makedraw(frame f, path g, pen p, int depth=<default>);
+pair down;
+path arc(pair c, real r, real angle1, real angle2);
+path arc(pair c, explicit pair z1, explicit pair z2, bool direction=<default>);
+path arc(pair c, real r, real angle1, real angle2, bool direction);
+pair right;
+string outformat(string format=<default>);
+string outprefix(string prefix=<default>);
+object object(Label L);
+object object(Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+object object(frame f);
+filltype Fill;
+filltype Fill(real xmargin=<default>, real ymargin=<default>, pen p=<default>);
+pen Palatino(string series=<default>, string shape=<default>);
+pair[] intersectionpoints(path p, path q, real fuzz=<default>);
+pair[] intersectionpoints(explicit path[] p, explicit path[] q, real fuzz=<default>);
+real arcarrowsize(pen p=<default>);
+real calculateScaling(string dir, coord[] coords, real size, bool warn=<default>);
+real calculateScaling(string dir, coord[] m, coord[] M, real size, bool warn=<default>);
+real expansionfactor;
+position BeginPoint;
+real arrowhookfactor;
+bool finite(real x);
+bool finite(pair z);
+bool finite(triple v);
+filltype UnFill(real xmargin=<default>, real ymargin=<default>);
+filltype UnFill;
+bool Bars(picture, path, pen, marginT(path, pen));
+bool Bars(picture, path, pen, marginT(path, pen))(real size=<default>);
+pair I;
+pair SSW;
+transform Slant(transform t);
+pair intersectionpoint(path p, path q, real fuzz=<default>);
+real getreal(string name=<default>, real default=<default>, string prompt=<default>, bool store=<default>);
+pen darkbrown;
+int sourceline(string file, string text);
+real RELEASE;
+void updatefunction();
+bool implicitshipout;
+void buildRestoreDefaults()();
+path[] operator ^^(path p, path q);
+path[] operator ^^(explicit path[] p, path q);
+path[] operator ^^(path p, explicit path[] q);
+path[] operator ^^(explicit path[] p, explicit path[] q);
+real arrow2sizelimit;
+filltype FillDraw;
+filltype FillDraw(real xmargin=<default>, real ymargin=<default>, pen fillpen=<default>, pen drawpen=<default>);
+bool debugging;
+void shipout(string prefix=<default>, frame f, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>, transform t=<default>);
+void shipout(string prefix=<default>, picture pic=<default>, frame orientation(frame)=<default>, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>);
+void pause(string w=<default>);
+int ocgindex;
+pen springgreen;
pen heavygrey;
void markuniform(picture pic=<default>, frame f, path g)(pair z(real t), real a, real b, int n);
void markuniform(picture pic=<default>, frame f, path g)(bool centered=<default>, int n, bool rotated=<default>);
-real[] mintimes(path p);
-real[] mintimes(path3 p);
-bool straight(path p, int t);
-bool straight(path3 p, int t);
-pen makepen(path p);
+bool BeginArrow(picture, path, pen, marginT(path, pen));
+bool BeginArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+real circlescale;
+bool ignore;
+pen darkblue;
+real reltime(path p, real l);
+void marknodes(picture pic=<default>, frame f, path g);
+int JOIN_OUT;
+projection currentprojection;
+real arrowsizelimit;
+pair endpoint(path p);
+arrowhead HookHead;
+arrowhead HookHead(real dir=<default>, real barb=<default>);
+real[] concat(... real[][]);
+pair[] concat(... pair[][]);
+pen[] concat(... pen[][]);
+picture[] concat(... picture[][]);
+path[] concat(... path[][]);
+coord[] concat(... coord[][]);
+marker[] concat(... marker[][]);
+int[] concat(... int[][]);
+void()()[] concat(... void()()[][]);
+bool3[] concat(... bool3[][]);
+string[] concat(... string[][]);
+object[] concat(... object[][]);
+Legend[] concat(... Legend[][]);
+triple[] concat(... triple[][]);
+Label[] concat(... Label[][]);
+frame[] concat(... frame[][]);
+guide[] concat(... guide[][]);
+bool[] concat(... bool[][]);
+slice firstcut(path p, path knife);
+frame UpsideDown(frame f);
+pair viewportmargin;
+pen nullpen;
+string ask(string prompt);
+frame[] fit2(picture[] pictures, picture all);
+void save()();
+real dotfactor;
+pen palecyan;
+node node(void d(frame f, transform t, transform T, pair lb, pair rt), string key=<default>);
+marginT BeginMargin(path, pen);
+path buildcycle(... path[] p);
+marker markthin(path g, pen p=<default>, real thin(real fraction)=<default>, filltype filltype=<default>);
+void activatequote(picture pic=<default>);
+int undefined;
+void drawarrow2(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>);
+pen roundcap;
+void buildRestoreThunk()();
+void overloadedMessage(file file);
+bool EndArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+bool EndArrow(picture, path, pen, marginT(path, pen));
+frame currentpatterns;
+real arrowfactor;
+pen heavyred;
+pen black;
+void Draw(picture pic=<default>, path g, pen p=<default>);
+filltype Draw;
+void Draw(picture pic=<default>, explicit path[] g, pen p=<default>);
+filltype Draw(real xmargin=<default>, real ymargin=<default>, pen p=<default>);
+void tab(file file);
+marker marker(frame f=<default>, void markroutine(picture pic=<default>, frame f, path g)=<default>, bool above=<default>);
+marker marker(path[] g, void markroutine(picture pic=<default>, frame f, path g)=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+bool CCW;
+void usetypescript(string s, string encoding=<default>);
+path randompath(int n, bool cumulate=<default>, guide join(... guide[])=<default>);
+void()()[] array(int n, void value()(), int depth=<default>);
+bool[] array(int n, bool value, int depth=<default>);
+string[] array(int n, string value, int depth=<default>);
+pair[][] array(int n, pair[] value, int depth=<default>);
+bool3[] array(int n, bool3 value, int depth=<default>);
+Label[] array(int n, Label value, int depth=<default>);
+picture[] array(int n, picture value, int depth=<default>);
+real[][] array(int n, real[] value, int depth=<default>);
+real[] array(int n, real value, int depth=<default>);
+triple[] array(int n, triple value, int depth=<default>);
+path[] array(int n, path value, int depth=<default>);
+frame[] array(int n, frame value, int depth=<default>);
+pen[][] array(int n, pen[] value, int depth=<default>);
+coord[] array(int n, coord value, int depth=<default>);
+object[] array(int n, object value, int depth=<default>);
+marker[] array(int n, marker value, int depth=<default>);
+Legend[] array(int n, Legend value, int depth=<default>);
+int[] array(int n, int value, int depth=<default>);
+string[][] array(int n, string[] value, int depth=<default>);
+pair[] array(int n, pair value, int depth=<default>);
+guide[] array(int n, guide value, int depth=<default>);
+pen[] array(int n, pen value, int depth=<default>);
+string[] array(string s);
+real[] uniform(real a, real b, int n);
+pair viewportsize;
+picture currentpicture;
+pen palegreen;
+Label Label(Label L, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label(string s, string size=<default>, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label(Label L, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label(explicit pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label;
+Label Label(string s=<default>, string size=<default>, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label(string s, string size=<default>, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+Label Label(Label L, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
+hsv hsv(real h, real s, real v);
+hsv hsv(pen p);
+projection projection(triple camera, triple up=<default>, triple target=<default>, triple normal=<default>, real zoom=<default>, real angle=<default>, pair viewportshift=<default>, bool showtarget=<default>, bool autoadjust=<default>, bool center=<default>, transformation projector(triple camera, triple up, triple target));
+pair N;
real dotsize(pen p=<default>);
-real[] curlSpecifier(guide g, int t);
-real straightness(triple z0, triple c0, triple c1, triple z1);
-real straightness(path3 p, int t);
-real log10(real x);
-real[] log10(real[] a);
-pen paleblue;
-bool prc0(string format=<default>);
-string xasyKEY();
-void xasyKEY(string s);
-int CTZ(int a);
-void _shipout(string prefix=<default>, frame f, frame preamble=<default>, string format=<default>, bool wait=<default>, bool view=<default>, transform t=<default>);
-real barfactor;
-pen Magenta;
-real cos(real x);
-real[] cos(real[] a);
-pair cos(explicit pair z);
-int intMax;
-bool cyclic(guide g);
-bool cyclic(path p);
-bool cyclic(path3 p);
-void printBytecode(<open>);
-transform Rotate(transform)(pair z);
-transform Rotate(transform t);
-path subpath(path p, int a, int b);
-path subpath(path p, real a, real b);
-path3 subpath(path3 p, int a, int b);
-path3 subpath(path3 p, real a, real b);
-bool isnan(real x);
-string jobname(string name);
-void print_random_addresses(int n=<default>);
-void attach(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+real pt;
+settings settings;
+int MoveQuiet;
+pair WNW;
+pen palegray;
+pen miterjoin;
+arrowhead SimpleHead;
+real arrowangle;
+frame dotframe(pen p=<default>, filltype filltype=<default>);
+frame dotframe;
+path diamond;
+real arcarrowfactor;
+real mm;
+pen heavyblue;
+filltype dotfilltype;
+plain plain;
+int getint(string name=<default>, int default=<default>, string prompt=<default>, bool store=<default>);
+int bitreverse(int a, int bits);
+int popcount(int a);
+int CLZ(int a);
+int NOT(int a);
+int XOR(int a, int b);
+int OR(int a, int b);
+real[][] scale3(real s);
+int AND(int a, int b);
+real[] cubicroots(real a, real b, real c, real d);
void attach(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void attach(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
real[] quadraticroots(real a, real b, real c);
pair[] quadraticroots(explicit pair a, explicit pair b, explicit pair c);
-pen darkcyan;
+path[] strokepath(path g, pen p=<default>);
+real erf(real x);
+real Yn(int n, real x);
+real Jn(int n, real x);
+light light(pen diffuse=<default>, pen specular=<default>, pen background=<default>, real x, real y, real z);
+light light(explicit light light);
+light light(pen diffuse=<default>, pen specular=<default>, pen background=<default>, real specularfactor=<default> ... triple[] position);
+light light(pen[] diffuse, pen[] specular=<default>, pen background=<default>, real specularfactor=<default>, triple[] position);
+real remainder(real x, real y);
+int choose(int n, int k);
+real hypot(real x, real y);
+int Round(real x);
+int Ceil(real x);
+marginT BeginPenMargin(path, pen);
+int round(real x);
+int floor(real x);
+pen extendcap;
+int ceil(real x);
+int rand();
+int sgn(real x);
+int quotient(int x, int y);
+path3 path3(triple[] pre, triple[] point, triple[] post, bool[] straight, bool cyclic);
+real incircle(pair a, pair b, pair c, pair d);
+real atan2(real y, real x);
+bool inside(explicit path[] g, pair z, pen fillrule=<default>);
+bool inside(path g, pair z, pen fillrule=<default>);
+int inside(path p, path q, pen fillrule=<default>);
+pair inside(path p, pen fillrule=<default>);
+real erfc(real x);
+int windingnumber(path[] p, pair z);
+real relativedistance(real theta, real phi, real t, bool atleast);
string[] file3;
real[] maxtimes(path p);
real[] maxtimes(path3 p);
-filltype FillDraw;
-filltype FillDraw(real xmargin=<default>, real ymargin=<default>, pen fillpen=<default>, pen drawpen=<default>);
-void initdefaults();
-void erase(frame f);
-string erase(string s, int pos, int n);
-void erase(picture pic=<default>);
-pair E;
-int Ceil(real x);
-pair I;
-pair SSW;
-pen magenta;
-pair WSW;
-pair N;
-bool view();
-void usersetting();
+real[] mintimes(path p);
+real[] mintimes(path3 p);
+pair maxAfterTransform(transform t, path[] p);
+pair minAfterTransform(transform t, path[] p);
+pair extension(pair p, pair q, pair p, pair q);
+string mapArrayString(string From, string To);
+real[][] intersections(path p, path q, real fuzz=<default>);
+real[] intersections(path p, explicit pair a, explicit pair b, real fuzz=<default>);
+real[][] intersections(path3 p, path3 q, real fuzz=<default>);
+real[][] intersections(path3 p, triple[][] p, real fuzz=<default>);
+real[] intersect(path p, path q, real fuzz=<default>);
+real[] intersect(path3 p, path3 q, real fuzz=<default>);
+real[] intersect(path3 p, triple[][] p, real fuzz=<default>);
+real dirtime(path p, pair z);
+real arctime(path p, real l);
+real arctime(path3 p, real dval);
+position Relative(real position);
+side Relative(explicit pair align);
+marginT Margins(path, pen);
+pair truepoint(picture pic=<default>, pair dir, bool user=<default>);
+real arclength(path p);
+real arclength(pair z0, pair c0, pair c1, pair z1);
+real arclength(path3 p);
+real arclength(triple z0, triple c0, triple c1, triple z1);
+bool piecewisestraight(path p);
+bool piecewisestraight(path3 p);
+path nurb(pair z0, pair z1, pair z2, pair z3, real w0, real w1, real w2, real w3, int m);
+path subpath(path p, int a, int b);
+path subpath(path p, real a, real b);
+path3 subpath(path3 p, int a, int b);
+path3 subpath(path3 p, real a, real b);
+real radius(path p, real t);
+real radius(path3 p, real t);
+real radius(triple z0, triple c0, triple c1, triple z1, real t);
+pair accel(path p, int t, int sign=<default>);
+pair accel(path p, real t);
+triple accel(path3 p, int t, int sign=<default>);
+triple accel(path3 p, real t);
+pair precontrol(path p, int t);
+pair precontrol(path p, real t);
+triple precontrol(path3 p, int t);
+triple precontrol(path3 p, real t);
+string defaultfilename;
+real longitude(triple v, bool warn=<default>);
+filltype NoFill;
+real colatitude(triple v, bool warn=<default>);
+marker nomarker;
+pair beginpoint(path p);
+real azimuth(triple v, bool warn=<default>);
+real polar(triple v, bool warn=<default>);
+real zpart(triple v);
+pair bezierPPP(pair a, pair b, pair c, pair d);
+triple bezierPPP(triple a, triple b, triple c, triple d);
+pair SSE;
+pair bezierP(pair a, pair b, pair c, pair d, real t);
+triple bezierP(triple a, triple b, triple c, triple d, real t);
+pair realmult(pair z, pair w);
+triple realmult(triple u, triple v);
+int Floor(real x);
+pair gamma(explicit pair z);
+real gamma(real x);
+pair expi(real angle);
+triple expi(real polar, real azimuth);
+pair dir(real degrees);
+pair dir(explicit pair z);
+triple dir(explicit triple z);
+triple dir(real colatitude, real longitude);
+pair dir(path p, int t, int sign=<default>, bool normalize=<default>);
+pair dir(path p, real t, bool normalize=<default>);
+triple dir(path3 p, int t, int sign=<default>, bool normalize=<default>);
+triple dir(path3 p, real t, bool normalize=<default>);
+pair dir(path p);
+pair dir(path p, path q);
+real aTan(real x);
+real aCos(real x);
+real aSin(real x);
+real arrowsize(pen p=<default>);
+real Tan(real deg);
+real Cos(real deg);
+frame legend(picture pic=<default>, int perline=<default>, real xmargin=<default>, real ymargin=<default>, real linelength=<default>, real hskip=<default>, real vskip=<default>, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>, pen p=<default>);
+picture legend(Legend[] Legend, int perline=<default>, real linelength, real hskip, real vskip, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>);
+real Degrees(real radians);
+frame pad(picture pic=<default>, real xsize=<default>, real ysize=<default>, filltype filltype=<default>);
+real radians(real degrees);
+real angle(pair z, bool warn=<default>);
+real angle(transform t);
+side Center;
+real ypart(pair z);
+real ypart(triple v);
+real xpart(pair z);
+real xpart(triple v);
+int seconds(string t=<default>, string format=<default>);
+pen rgba(real[] a);
+real[] rgba(pen p);
+string time(string format=<default>);
+string time(int seconds, string format=<default>);
+string string(int x);
+string string(real x, int digits=<default>);
+int ascii(string s);
+side RightSide;
+string replace(string s, string[][] translate);
+string replace(string s, string before, string after);
+pen lightgrey;
+string upcase(string s);
+pen mediumgray;
+string downcase(string s);
+string substr(string s, int pos, int n=<default>);
+string insert(string s, int pos, string t);
+int rfind(string s, string t, int pos=<default>);
+void purge(int divisor=<default>);
+int animate(string args=<default>, string file=<default>, string format=<default>);
+int convert(string args=<default>, string file=<default>, string format=<default>);
+real sqrtEpsilon;
+string stripextension(string s);
+string stripfile(string s);
+string stripdirectory(string s);
+void warning(string s, string t, bool position=<default>);
pair S;
real abs2(pair z);
real abs2(triple v);
void nowarn(string s);
-transform rotate(real angle, pair z=<default>);
-int quotient(int x, int y);
-transform rotation(transform t);
-pair W;
-int rand();
-pen ZapfChancery(string series=<default>, string shape=<default>);
-int XOR(int a, int b);
+void warn(string s);
+void breakpoints();
+string locatefile(string file, bool full=<default>);
+void breakpoint(code s=<default>);
+void atbreakpoint(string f(string, int, int, code));
+string phantom(string s);
+void atexit(void f());
+void atexit()();
void atupdate(void f());
void atupdate()();
+string outname();
+string mktemp(string s);
+int rename(string from, string to);
+real arrowbarb;
+pen yellow;
+int delete(string s);
+void seekeof(file f);
+pen heavymagenta;
+marginT PenMargins(path, pen);
+void newl(file file);
+void seek(file f, int pos);
+bool Arrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
+bool Arrows(picture, path, pen, marginT(path, pen));
+int tell(file f);
+void DOSendl(file file);
+string debugger(string file, int line, int column, code s=<default>);
+string getc(file f);
+void flush(file f);
+pen blue;
+pen evenodd;
+int precision(file f=<default>, int digits=<default>);
+void close(file f);
+void clear(file f);
+void clear(string file, int line);
+void clear();
+void clear(string file, string text);
void unfill(frame f, path[] g, bool copy=<default>);
void unfill(picture pic=<default>, path[] g, bool copy=<default>);
-bool Bar(picture, path, pen, marginT(path, pen));
bool Bar(picture, path, pen, marginT(path, pen))(real size=<default>);
+bool Bar(picture, path, pen, marginT(path, pen));
bool eol(file f);
-pen zerowinding;
-void atbreakpoint(string f(string, int, int, code));
-void savedefaults()();
-bool MidArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
-bool MidArrow(picture, path, pen, marginT(path, pen));
-bool MidArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
-bool MidArcArrow(picture, path, pen, marginT(path, pen));
-void grestore(frame f);
-pair extension(pair p, pair q, pair p, pair q);
-pen extendcap;
-int ceil(real x);
-pen thick(pen p=<default>);
-pair left;
-int Suppress;
+bool eof(file f);
+pen paleyellow;
+file output(string name=<default>, bool update=<default>, string comment=<default>, string mode=<default>);
file input(string name=<default>, bool check=<default>, string comment=<default>, string mode=<default>);
+pair bezierPP(pair a, pair b, pair c, pair d, real t);
+triple bezierPP(triple a, triple b, triple c, triple d, real t);
+real[] _projection();
+triple maxbezier(triple[][] p, triple b);
+triple minbezier(triple[][] p, triple b);
+real legendvskip;
+pen darkmagenta;
+real change2(triple[][] a);
+pair NW;
+real norm(real[] a);
+real norm(real[][] a);
+real norm(triple[][] a);
+int[][] triangulate(pair[] z);
+pair[] fft(pair[] a, int sign=<default>);
+pair[][] fft(pair[][] a, int sign=<default>);
+pair[][][] fft(pair[][][] a, int sign=<default>);
+real simpson(real f(real), real a, real b, real acc=<default>, real dxmax=<default>);
+pen[] colorPen;
+real _findroot(real f(real), real a, real b, real tolerance, real fa, real fb);
+real newton(int iterations=<default>, real f(real), real fprime(real), real x, bool verbose=<default>);
+real newton(int iterations=<default>, real f(real), real fprime(real), real x1, real x2, bool verbose=<default>);
+real[] tridiagonal(real[] a, real[] b, real[] c, real[] f);
+void filldraw(picture pic=<default>, path[] g, pen fillpen=<default>, pen drawpen=<default>);
+void filldraw(frame f, path[] g, pen fillpen=<default>, pen drawpen=<default>);
+real dot(real[] a, real[] b);
+pair dot(pair[] a, pair[] b);
+real dot(explicit pair z, explicit pair w);
+real dot(triple u, triple v);
+void dot(picture pic=<default>, Label[] L=<default>, explicit path g, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
+marker dot(pen p=<default>, filltype filltype=<default>);
+void dot(picture pic=<default>, pair z, pen p=<default>, filltype filltype=<default>);
+void dot(frame f, pair z, pen p=<default>, filltype filltype=<default>);
+void dot(picture pic=<default>, Label L, pen p=<default>, filltype filltype=<default>);
+void dot(picture pic=<default>, Label[] L=<default>, pair[] z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
+void dot(picture pic=<default>, path[] g, pen p=<default>, filltype filltype=<default>);
+marker dot;
+void dot(picture pic=<default>, Label L, pair z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
+pair ESE;
+pair project(triple v, real[][] t);
+real[][] AtA(real[][] a);
+real[] solve(real[][] a, real[] b, bool warn=<default>);
+real[][] solve(real[][] a, real[][] b, bool warn=<default>);
+scaleT scaleT(real T(real x), real Tinv(real x), bool logarithmic=<default>, bool automin=<default>, bool automax=<default>);
+string baseline(string s, string template=<default>);
+int[] findall(bool[] a);
+bool BeginBar(picture, path, pen, marginT(path, pen));
+bool BeginBar(picture, path, pen, marginT(path, pen))(real size=<default>);
+triple perp(triple v, triple u);
+int find(bool[] a, int n=<default>);
+int find(string s, string t, int pos=<default>);
+real degrees(pair z, bool warn=<default>);
+real degrees(real radians);
+bool[] operator !(bool[] a);
+bool operator !(bool b);
+int[] sequence(int n);
+pen[][] sequence(pen[] f(int), int n);
+coord[] sequence(coord f(int), int n);
+object[] sequence(object f(int), int n);
+marker[] sequence(marker f(int), int n);
+Legend[] sequence(Legend f(int), int n);
+int[] sequence(int f(int), int n);
+string[][] sequence(string[] f(int), int n);
+pair[] sequence(pair f(int), int n);
+int[] sequence(int n, int m, int skip);
+guide[] sequence(guide f(int), int n);
+pen[] sequence(pen f(int), int n);
+void()()[] sequence(void f()()(int), int n);
+bool[] sequence(bool f(int), int n);
+string[] sequence(string f(int), int n);
+pair[][] sequence(pair[] f(int), int n);
+bool3[] sequence(bool3 f(int), int n);
+Label[] sequence(Label f(int), int n);
+picture[] sequence(picture f(int), int n);
+real[][] sequence(real[] f(int), int n);
+real[] sequence(real f(int), int n);
+int[] sequence(int n, int m);
+triple[] sequence(triple f(int), int n);
+path[] sequence(path f(int), int n);
+frame[] sequence(frame f(int), int n);
+int[] complement(int[] a, int n);
+path[] complement(frame f, path[] g);
+void saveline(string name, string value, bool store=<default>);
+string readline(string prompt=<default>, string name=<default>, bool tabcompletion=<default>);
+real unitrand();
+string[] history(string name, int n=<default>);
+string[] history(int n=<default>);
+path[] _strokepath(path g, pen p=<default>);
+path[][] textpath(string[] s, pen[] p);
+marginT NoMargin(path, pen);
+marginT NoMargin(path, pen)();
+path[][] _texpath(string[] s, pen[] p);
int SuppressQuiet;
real[] texsize(string s, pen p=<default>);
+bool labels(frame f);
+slice cut(path p, path knife, int n);
+bool is3D(frame f);
+bool is3D(string format=<default>);
+transformation transformation(real[][] modelview);
+transformation transformation(real[][] modelview, real[][] projection);
+pair maxratio(frame f);
+pair maxratio(triple[][] p, pair b);
+pair maxratio(path3 g);
+pair minratio(frame f);
+pair minratio(triple[][] p, pair b);
+pair minratio(path3 g);
+triple size3(frame f);
+void size3(picture pic=<default>, real x, real y=<default>, real z=<default>, bool keepAspect=<default>);
+triple max3(frame f);
+triple max3(pen p);
+int[] MarkFillable;
+pair unit(pair z);
+triple unit(triple v);
+triple min3(frame f);
+triple min3(pen p);
+void drawpixel(frame f, triple v, pen p, real width=<default>);
+pair[] pairs(real[] x, real[] y);
+void eval(code s, bool embedded=<default>);
+void eval(string s, bool embedded=<default>);
+bool Arrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+bool Arrow(picture, path, pen, marginT(path, pen));
+void drawTube(frame f, triple[] g, real width, pen[] p, real opacity, real shininess, real metallic, real fresnel0, triple min, triple max, bool core=<default>);
+void drawDisk(frame f, real[][] t, pen[] p, real opacity, real shininess, real metallic, real fresnel0);
+void stop(string file, int line, code s=<default>);
+void stop(string file, string text, code s=<default>);
+void drawCylinder(frame f, real[][] t, pen[] p, real opacity, real shininess, real metallic, real fresnel0, bool core=<default>);
+real insphere(triple a, triple b, triple c, triple d, triple e);
+void drawSphere(frame f, real[][] t, bool half=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, int type);
+string[] spinner;
+real[] times(path p, real x, real fuzz=<default>);
+real[] times(path p, explicit pair z, real fuzz=<default>);
+void drawbeziertriangle(frame f, triple[][] p, triple center, bool straight, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors, int interaction, int digits, bool primitive=<default>);
+void draw(frame f, triple[][] p, triple center, bool straight, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors, int interaction, int digits, bool primitive=<default>);
+void draw(frame f, triple[] p, real[] knot, real[] weights=<default>, pen p);
+void draw(frame f, triple[][] p, real[] uknot, real[] vknot, real[][] weights=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors);
+void draw(frame f, triple[] v, int[][] vi, triple center=<default>, triple[] n, int[][] ni, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] c=<default>, int[][] ci=<default>, int interaction);
+void draw(picture pic=<default>, path[] g, pen fillrule=<default>, pen[] p);
+object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), pair position, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+void draw(frame f, explicit path[] g, pen p=<default>);
+void draw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(pair origin, picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+void draw(picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
+void draw(pair origin, picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
+void draw(frame f, guide[] g, pen p=<default>);
+void draw(frame f, path g, pen p=<default>);
+void draw(picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
+void draw(pair origin, picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
+void draw(frame f, path g, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen)));
+void deconstruct(frame f, frame preamble=<default>, transform t=<default>);
+void deconstruct(picture pic=<default>);
+void shipout3(string prefix, frame f, string format=<default>, real width, real height, real angle, real zoom, triple m, triple m, pair shift, pair margin, real[][] t, real[][] tup, real[] background, triple[] lights, real[][] diffuse, real[][] specular, bool view=<default>);
+void shipout3(string prefix, frame f, string format=<default>);
+int CTZ(int a);
+void _shipout(string prefix=<default>, frame f, frame preamble=<default>, string format=<default>, bool wait=<default>, bool view=<default>, transform t=<default>);
+void asy(string format, bool overwrite=<default> ... string[] s);
+bool latex();
string nativeformat();
-bool invisible(pen p);
-pen invisible();
-pen invisible;
-bool CCW;
-void usetypescript(string s, string encoding=<default>);
-path randompath(int n, bool cumulate=<default>, guide join(... guide[])=<default>);
+path unstraighten(path p);
+path3 unstraighten(path3 p);
+void _image(frame f, real[][] data, pair initial, pair final, pen[] palette=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>);
+void _image(frame f, pen[][] data, pair initial, pair final, transform t=<default>, bool copy=<default>, bool antialias=<default>);
+void _image(frame f, pen f(int, int), int width, int height, pair initial, pair final, transform t=<default>, bool antialias=<default>);
+void layer(frame f);
+void layer(picture pic=<default>);
+void texreset();
+void _labelpath(frame f, string s, string size, path g, string justify, pair offset, pen p);
+real arrowtexfactor;
+void comma(file file);
+void deletepreamble();
+version version;
+void texpreamble(string s);
+real braceouterangle;
+void tex(frame f, string s);
+void tex(frame f, string s, pair min, pair max);
+void tex(picture pic=<default>, string s);
+void tex(picture pic=<default>, string s, pair min, pair max);
+void prepend(frame dest, frame src);
+void add(frame dest, frame src);
+void add(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(frame dest, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(picture pic=<default>, void d(frame f, transform t), bool exact=<default>);
+void add(picture pic=<default>, void d(frame f, real[][] t, picture pic, projection P), bool exact=<default>);
+void add(picture pic=<default>, void d(picture, real[][]), bool exact=<default>);
+void add(picture pic=<default>, Label L);
+void add(picture dest, picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(frame f, transform t=<default>, Label L);
+void add(picture dest, picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(picture dest=<default>, object F, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(frame dest, frame src, filltype filltype, bool above=<default>);
+void add(frame dest, frame src, bool group, filltype filltype=<default>, bool above=<default>);
+void add(frame dest, frame src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void add(picture pic=<default>, void d(picture, transform), bool exact=<default>);
+void add(picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
+void endgroup3(frame f);
+void _begingroup3(frame f, string name, real compression, real granularity, bool closed, bool tessellate, bool dobreak, bool nobreak, triple center, int interaction);
+void endgroup(frame f);
+void endgroup(picture pic=<default>);
+void begingroup(frame f);
+void begingroup(picture pic=<default>);
+bool MidArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
+bool MidArcArrow(picture, path, pen, marginT(path, pen));
+void grestore(frame f);
+void beginclip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
+void beginclip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
+pen palegrey;
+void clip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
+void clip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
+int Allow;
+real determinant(real[][] a);
+void functionshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader=<default>, bool copy=<default>);
+void functionshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader, bool copy=<default>);
+bool EndArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
+bool EndArcArrow(picture, path, pen, marginT(path, pen));
+void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>);
+void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>);
+void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z=<default>);
+void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z=<default>);
+file _outpipe;
+void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>);
+void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>);
+void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>);
+void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>);
+pair getpair(string name=<default>, pair default=<default>, string prompt=<default>, bool store=<default>);
+void axialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, bool extenda=<default>, pen penb, pair b, bool extendb=<default>, bool copy=<default>);
+void axialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, bool extenda=<default>, pen penb, pair b, bool extendb=<default>, bool copy=<default>);
+pen chartreuse;
+void latticeshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, transform t=<default>, bool copy=<default>);
+void latticeshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, bool copy=<default>);
+void fill(frame f, path[] g, pen p=<default>, bool copy=<default>);
+path fill(frame dest, frame src, filltype filltype=<default>, real xmargin=<default>, real ymargin=<default>);
+void fill(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>);
+void fill(pair origin, picture pic=<default>, path[] g, pen p=<default>);
+void _draw(frame f, path g, pen p);
+void _draw(frame f, path3 g, triple center=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, int interaction=<default>);
+void _draw(picture pic, path g, pen p, marginT margin(path, pen));
+void initdefaults();
+void erase(frame f);
+string erase(string s, int pos, int n);
+void erase(picture pic=<default>);
+string jobname(string name);
+void print_random_addresses(int n=<default>);
+void generate_random_backtrace();
+marginT TrueMargin(path, pen)(real begin, real end=<default>);
+real bezier(real a, real b, real c, real d, real t);
+pair bezier(pair a, pair b, pair c, pair d, real t);
+triple bezier(triple a, triple b, triple c, triple d, real t);
+pen squarecap;
+bool isometry(transform t);
+guide operator ::(... guide[]);
+pen Helvetica(string series=<default>, string shape=<default>);
+transform reflect(pair a, pair b);
+transform rotate(real angle, pair z=<default>);
+bool IgnoreAspect;
+void postscript(frame f, string s);
+void postscript(frame f, string s, pair min, pair max);
+void postscript(picture pic=<default>, string s);
+void postscript(picture pic=<default>, string s, pair min, pair max);
+transform slant(real s);
+transform yscale(real y);
+transform inverse(transform t);
+real[][] inverse(real[][] a);
+pen darkgrey;
+transform xscale(real x);
+transform shiftless(transform t);
+real[][] shiftless(real[][] t);
+real[] _cputime();
+guide reverse(guide g);
+string reverse(string s);
+path reverse(path p);
+path3 reverse(path3 p);
+triple[] reverse(triple[] a);
+int[] reverse(int[] a);
+real[] reverse(real[] a);
+int[] reverse(int n);
+string[] reverse(string[] a);
+pair[] reverse(pair[] a);
+bool[] reverse(bool[] a);
+real[] curlSpecifier(guide g, int t);
+bool Blank(picture, path, pen, marginT(path, pen));
+tensionSpecifier tensionSpecifier(guide g, int t);
+bool3 default;
+pair[] controlSpecifier(guide g, int t);
+pen red;
+pair[] dirSpecifier(guide g, int t);
+pen longdashed;
+pair point(guide g, int t);
+pair point(path p, int t);
+pair point(path p, real t);
+triple point(path3 p, int t);
+triple point(path3 p, real t);
+pair point(picture pic=<default>, pair dir, bool user=<default>);
+pair point(object F, pair dir, transform t=<default>);
+pair point(frame f, pair dir);
+int length(guide g);
+int length(string s);
+real length(pair z);
+real length(triple v);
+int length(path p);
+int length(path3 p);
+int size(guide g);
+pair size(frame f);
+int size(path p);
+int size(path[] p);
+int size(path3 p);
+void size(picture dest, picture src);
+pair size(picture pic, bool user=<default>);
+void size(picture pic=<default>, transform t);
+void size(picture pic=<default>, real x, real y=<default>, bool keepAspect=<default>);
+void size(picture pic=<default>, real xsize, real ysize, pair min, pair max);
+string texify(string s);
+guide operator controls(pair zout, pair zin);
+guide operator controls(pair z);
+bool empty(frame f);
+tensionSpecifier operator tension(real tout, real tin, bool atleast);
+tensionSpecifier operator tension(real t, bool atLeast);
+void end(picture pic=<default>);
+curlSpecifier operator curl(real gamma, int p);
+guide operator spec(pair z, int p);
+void list(string s, bool imports=<default>);
+string cd(string s=<default>);
+int Move;
+string location();
+string xasyKEY();
+void xasyKEY(string s);
+bool pdf();
+void _eval(string s, bool embedded, bool interactivewrite=<default>);
+void _eval(code s, bool embedded);
+void usleep(int microseconds);
+void sleep(int seconds);
+real Sin(real deg);
+void assert(bool b, string s=<default>);
+pair Align;
+void exit();
+void abort(string s=<default>);
+string locale(string s=<default>);
+string defaultseparator;
+string asydir();
+bool view();
int system(string[] s);
int system(string s);
-void bar(picture pic, pair a, pair d, pen p=<default>);
-picture bar(pair a, pair d, pen p=<default>);
-side NoSide;
-file stdout;
+bool interactive();
+pen colorless(pen p);
+bool straight(path p, int t);
+bool straight(path3 p, int t);
+pen makepen(path p);
+realschur schur(real[][] a);
+schur schur(pair[][] a);
+path nib(pen p);
+transform transform(pen p);
+pair relpoint(path p, real l);
+pair[][] transpose(pair[][] a);
+pen[][] transpose(pen[][] a);
+string[][] transpose(string[][] a);
+real[][] transpose(real[][] a);
+pen overwrite(int n);
+int overwrite(pen p=<default>);
+real lineskip(pen p=<default>);
+pen fontsize(real size, real lineskip);
+real fontsize(pen p=<default>);
+pen fontsize(real size);
+string font(pen p=<default>);
+pen font(string name, string options=<default>);
+pen font(string encoding, string family, string series, string shape);
+pen font(string name, real size, string options=<default>);
+void newpage(frame f);
+void newpage(picture pic=<default>);
+pen fontcommand(string s);
+pen linewidth(real x);
+real linewidth(pen p=<default>);
+real arrowlength;
+pen miterlimit(real x);
+real miterlimit(pen p=<default>);
+pen linecap(int n);
+int linecap(pen p=<default>);
+bool adjust(pen p);
+pen adjust(pen p, real arclength, bool cyclic);
+bool scale(pen p);
+transform scale(real x);
+transform scale(real x, real y);
+real[][] scale(real x, real y, real z);
transform Shift(transform t);
real fmod(real x, real y);
real offset(pen p);
-pen rgb(pen p);
-pen rgb(real r, real g, real b);
-pen rgb(real[] a);
-pen rgb(string s);
-real inch;
-bool ArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-bool ArcArrow(picture, path, pen, marginT(path, pen));
-bool ArcArrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
-bool ArcArrows(picture, path, pen, marginT(path, pen));
-pen currentpen;
-pair precontrol(path p, int t);
-pair precontrol(path p, real t);
-triple precontrol(path3 p, int t);
-triple precontrol(path3 p, real t);
-light currentlight;
-pen royalblue;
-picture currentpicture;
-frame currentpatterns;
-int JOIN_IN;
-int JOIN_OUT;
-projection currentprojection;
real orient(pair a, pair b, pair c);
real orient(triple a, triple b, triple c, triple d);
pen linetype(real[] pattern, real offset=<default>, bool scale=<default>, bool adjust=<default>);
real[] linetype(pen p=<default>);
pen linetype(string pattern, real offset=<default>, bool scale=<default>, bool adjust=<default>);
-real xpart(pair z);
-real xpart(triple v);
-side Center;
-real ypart(pair z);
-real ypart(triple v);
-real zpart(triple v);
-frame orientation(frame);
-pen Courier(string series=<default>, string shape=<default>);
-real simpson(real f(real), real a, real b, real acc=<default>, real dxmax=<default>);
+string blend(pen p);
+void endclip(frame f);
+void endclip(picture pic=<default>);
+pen opacity(real opacity=<default>, string blend=<default>);
+real opacity(pen p);
+pen fillrule(int n);
+int fillrule(pen p);
+real[][] identity4;
+marker[] MarkFill;
+pen pattern(string s);
+string pattern(pen p);
+pen solid;
+string colorspace(pen p);
+real byteinv(int x);
+int byte(real x);
+bool Aspect;
+string hex(pen p);
+int hex(string s);
+real[] colors(pen p);
+void DOSnewl(file file);
+pen cmyk(pen p);
+pen cmyk(real c, real m, real y, real k);
+pen rgb(pen p);
+pen rgb(real r, real g, real b);
+pen rgb(real[] a);
+pen rgb(string s);
+pen gray(pen p);
+pen gray(real gray);
+pen gray;
+bool invisible(pen p);
+pen invisible();
+pen invisible;
+void defaultpen(pen p);
+pen defaultpen();
+pen defaultpen;
+void defaultpen(real w);
+void resetdefaultpen();
+bool isnan(real x);
+bool cyclic(guide g);
+bool cyclic(path p);
+bool cyclic(path3 p);
+void printBytecode(<open>);
+pen currentpen;
+string VERSION;
+bool alias(pair[][] a, pair[][] b);
+bool alias(guide[] a, guide[] b);
+bool alias(marginT a, marginT b);
+bool alias(coord[] a, coord[] b);
+bool alias(Legend a, Legend b);
+bool alias(object a, object b);
+bool alias(marker[] a, marker[] b);
+bool alias(pair[] a, pair[] b);
+bool alias(scaling a, scaling b);
+bool alias(projection a, projection b);
+bool alias(picture a, picture b);
+bool alias(align a, align b);
+bool alias(Label[] a, Label[] b);
+bool alias(arrowhead a, arrowhead b);
+bool alias(int[] a, int[] b);
+bool alias(string[][] a, string[][] b);
+bool alias(slice a, slice b);
+bool alias(autoscaleT a, autoscaleT b);
+bool alias(position a, position b);
+bool alias(realschur a, realschur b);
+bool alias(real[][] a, real[][] b);
+bool alias(bool3 a, bool3 b);
+bool alias(bool3[] a, bool3[] b);
+bool alias(bounds a, bounds b);
+bool alias(node a, node b);
+bool alias(side a, side b);
+bool alias(string[] a, string[] b);
+bool alias(frame[] a, frame[] b);
+bool alias(coords2 a, coords2 b);
+bool alias(light a, light b);
+bool alias(coords3 a, coords3 b);
+bool alias(processtime a, processtime b);
+bool alias(bool[] a, bool[] b);
+bool alias(void()()[] a, void()()[] b);
+bool alias(pen[][] a, pen[][] b);
+bool alias(filltype a, filltype b);
+bool alias(ScaleT a, ScaleT b);
+bool alias(Label a, Label b);
+bool alias(picture[] a, picture[] b);
+bool alias(schur a, schur b);
+bool alias(path[] a, path[] b);
+bool alias(triple[] a, triple[] b);
+bool alias(coord a, coord b);
+bool alias(freezableBounds a, freezableBounds b);
+bool alias(transformation a, transformation b);
+bool alias(pairOrTriple a, pairOrTriple b);
+bool alias(object[] a, object[] b);
+bool alias(marker a, marker b);
+bool alias(Legend[] a, Legend[] b);
+bool alias(real[] a, real[] b);
+bool alias(pen[] a, pen[] b);
+bool alias(hsv a, hsv b);
+bool alias(scaleT a, scaleT b);
+bool alias(cputime a, cputime b);
+real pi;
+int randMax;
+pen heavycyan;
+marginT PenMargin(path, pen)(real begin, real end=<default>);
+marginT PenMargin(path, pen);
+int realDigits;
+real realEpsilon;
+pair NE;
+real realMin;
+real realMax;
+real nan;
+real infinity;
+void xmap(string key, transform t=<default>);
+real inf;
+int intMin;
+int intMax;
+pen palered;
+real[] map(real f(pair), pair[] a);
+int[] map(int f(real), real[] a);
+bool3[] map(bool3 f(bool3), bool3[] a);
+frame[] map(frame f(frame), frame[] a);
+coord[] map(coord f(coord), coord[] a);
+marker[] map(marker f(marker), marker[] a);
+pen[][] map(pen[] f(pen[]), pen[][] a);
+triple[] map(triple f(triple), triple[] a);
+pen[] map(pen f(pen), pen[] a);
+picture[] map(picture f(picture), picture[] a);
+pair[] map(pair f(pair), pair[] a);
+string[] map(string f(string), string[] a);
+void()()[] map(void f()()(void()()), void()()[] a);
+pair[][] map(pair[] f(pair[]), pair[][] a);
+real[] map(real f(real), real[] a);
+int[] map(int f(int), int[] a);
+string[][] map(string[] f(string[]), string[][] a);
+Label[] map(Label f(Label), Label[] a);
+bool[] map(bool f(bool), bool[] a);
+path[] map(path f(path), path[] a);
+real[][] map(real[] f(real[]), real[][] a);
+object[] map(object f(object), object[] a);
+Legend[] map(Legend f(Legend), Legend[] a);
+guide[] map(guide f(guide), guide[] a);
+real identity(real x);
+real[] identity(real[] a);
+transform identity();
+real[][] identity(int n);
+transform identity;
+real pow10(real x);
+real[] pow10(real[] a);
+pen linejoin(int n);
+int linejoin(pen p=<default>);
+real ldexp(real x, int e);
+real log1p(real x);
+real[] log1p(real[] a);
+void deactivatequote(picture pic=<default>);
+path brace(pair a, pair b, real amplitude=<default>);
+string format(string format, int x, string locale=<default>);
+string format(string format, bool forcemath=<default>, string separator, real x, string locale=<default>);
+string format(string format=<default>, bool forcemath=<default>, real x, string locale=<default>);
+real[][][] _schur(real[][] a);
+pair[][][] _schur(pair[][] a);
+real expm1(real x);
+real[] expm1(real[] a);
+void label(frame f, string s, string size, transform t, pair position, pair align, pen p);
+void label(picture pic=<default>, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(pair origin, picture pic=<default>, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(frame f, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(picture pic=<default>, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(frame f, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(picture pic=<default>, Label L, explicit guide g, align align=<default>, pen p=<default>, filltype filltype=<default>);
+void label(picture pic=<default>, Label L, explicit path g, align align=<default>, pen p=<default>, filltype filltype=<default>);
+real fabs(real x);
+real[] fabs(real[] a);
+string stripsuffix(string f, string suffix=<default>);
+real cbrt(real x);
+real[] cbrt(real[] a);
+real sqrt(real x);
+real[] sqrt(real[] a);
+pair sqrt(explicit pair z);
+bool all(bool[] a);
+real atanh(real x);
+real[] atanh(real[] a);
+real acosh(real x);
+real[] acosh(real[] a);
transform shift(transform t);
transform shift(pair z);
transform shift(real x, real y);
transform shift(frame f, pair align);
real asinh(real x);
real[] asinh(real[] a);
-pen orange;
-pen darkgray;
-slice lastcut(path p, path knife);
-pen darkgreen;
-pen darkgrey;
-transform xscale(real x);
-transform shiftless(transform t);
-real[][] shiftless(real[][] t);
-transform yscale(real y);
-void usleep(int microseconds);
+pen ZapfDingbats(string series=<default>, string shape=<default>);
+real tanh(real x);
+real[] tanh(real[] a);
real cosh(real x);
real[] cosh(real[] a);
-position MidPoint;
-real Sin(real deg);
-void assert(bool b, string s=<default>);
-pen Palatino(string series=<default>, string shape=<default>);
-real incircle(pair a, pair b, pair c, pair d);
-frame Landscape(frame f);
-projection centered(projection P, picture pic=<default>);
+real sinh(real x);
+real[] sinh(real[] a);
+real straightness(triple z0, triple c0, triple c1, triple z1);
+real straightness(path3 p, int t);
+real log10(real x);
+real[] log10(real[] a);
+pair midpoint(path p);
+real exp(real x);
+real[] exp(real[] a);
+pair exp(explicit pair z);
pen purple;
string italic(string s);
real atan(real x);
real[] atan(real[] a);
real acos(real x);
real[] acos(real[] a);
-int popcount(int a);
-pair minbound(pair a, pair b);
-triple minbound(triple a, triple b);
-pair minbound(pair[] a);
-pair minbound(pair[][] a);
-pair minbound(pair[][][] a);
-triple minbound(triple[] a);
-triple minbound(triple[][] a);
-triple minbound(triple[][][] a);
-void restore();
-pen basealign(int n);
-int basealign(pen p=<default>);
-pen basealign;
-int min(int a, int b);
-int[] min(int a, int[] b);
-int[] min(int[] a, int b);
-int[] min(int[] a, int[] b);
-int min(int[] a);
-int min(int[][] a);
-int min(int[][][] a);
-real min(real a, real b);
-real[] min(real a, real[] b);
-real[] min(real[] a, real b);
-real[] min(real[] a, real[] b);
-real min(real[] a);
-real min(real[][] a);
-real min(real[][][] a);
-string min(string a, string b);
-string[] min(string a, string[] b);
-string[] min(string[] a, string b);
-string[] min(string[] a, string[] b);
-string min(string[] a);
-string min(string[][] a);
-string min(string[][][] a);
-pair min(pen p);
-pair min(frame f);
-pair min(explicit path p);
-pair min(path[] p);
-triple min(path3 p);
-pair min(picture pic, bool user=<default>);
-real min(... real[] a);
-real min(real m, scaling s, coord[] c);
-int min(... int[] a);
-filltype RadialShade(pen penc, pen penr);
+path roundbox(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+path roundbox(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+real asin(real x);
+real[] asin(real[] a);
+real tan(real x);
+real[] tan(real[] a);
+pen Magenta;
+real cos(real x);
+real[] cos(real[] a);
+pair cos(explicit pair z);
+filltype RadialShadeDraw(real xmargin=<default>, real ymargin=<default>, pen penc, pen penr, pen drawpen=<default>);
+real sin(real x);
+real[] sin(real[] a);
+pair sin(explicit pair z);
+path polygon(int n);
+guide operator --(... guide[]);
+void none(file file);
+int factorial(int n);
+real log(real x);
+real[] log(real[] a);
+pair log(explicit pair z);
+guide operator ..(... guide[]);
+guide operator ..(... guide[])(tensionSpecifier t);
+pair operator tuple(real x, real y);
+triple operator tuple(real x, real y, real z);
+transform operator tuple(real x, real y, real xx, real xy, real yx, real yy);
+int[][] diagonal(... int[]);
+real[][] diagonal(... real[]);
+pair[][] diagonal(... pair[]);
+path[] texpath(string s, pen p, bool tex=<default>, bool bbox=<default>);
+path[] texpath(Label L, bool tex=<default>, bool bbox=<default>);
+bool uptodate();
+int operator #(int a, int b);
+int[] operator #(int a, int[] b);
+int[] operator #(int[] a, int b);
+int[] operator #(int[] a, int[] b);
+int operator %(int a, int b);
+int[] operator %(int a, int[] b);
+int[] operator %(int[] a, int b);
+int[] operator %(int[] a, int[] b);
+real operator %(real a, real b);
+real[] operator %(real a, real[] b);
+real[] operator %(real[] a, real b);
+real[] operator %(real[] a, real[] b);
int search(int[] a, int key);
int search(real[] a, real key);
int search(string[] a, string key);
int search(void()()[] a, void key()(), bool less(void()(), void()()));
int search(real[] a, real key, bool less(real, real));
int search(guide[] a, guide key, bool less(guide, guide));
-int search(marker[] a, marker key, bool less(marker, marker));
int search(pair[] a, pair key, bool less(pair, pair));
int search(picture[] a, picture key, bool less(picture, picture));
int search(frame[] a, frame key, bool less(frame, frame));
int search(coord[] a, coord key, bool less(coord, coord));
-int search(object[] a, object key, bool less(object, object));
+int search(marker[] a, marker key, bool less(marker, marker));
int search(int[] a, int key, bool less(int, int));
int search(bool3[] a, bool3 key, bool less(bool3, bool3));
-int search(Label[] a, Label key, bool less(Label, Label));
+int search(object[] a, object key, bool less(object, object));
int search(Legend[] a, Legend key, bool less(Legend, Legend));
int search(string[] a, string key, bool less(string, string));
int search(path[] a, path key, bool less(path, path));
int search(pen[] a, pen key, bool less(pen, pen));
+int search(Label[] a, Label key, bool less(Label, Label));
int search(bool[] a, bool key, bool less(bool, bool));
int search(triple[] a, triple key, bool less(triple, triple));
-filltype RadialShadeDraw(real xmargin=<default>, real ymargin=<default>, pen penc, pen penr, pen drawpen=<default>);
-real sin(real x);
-real[] sin(real[] a);
-pair sin(explicit pair z);
-pen deepcyan;
-void restoredefaults();
-path plus;
-pair expi(real angle);
-triple expi(real polar, real azimuth);
-void endclip(frame f);
-void endclip(picture pic=<default>);
-pen opacity(real opacity=<default>, string blend=<default>);
-real opacity(pen p);
-real[] solve(real[][] a, real[] b, bool warn=<default>);
-real[][] solve(real[][] a, real[][] b, bool warn=<default>);
-int rename(string from, string to);
-void DOSendl(file file);
-string debugger(string file, int line, int column, code s=<default>);
-string getc(file f);
-bool debugging;
-void shipout(string prefix=<default>, picture pic=<default>, frame orientation(frame)=<default>, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>);
-void shipout(string prefix=<default>, frame f, string format=<default>, bool wait=<default>, bool view=<default>, string options=<default>, string script=<default>, light light=<default>, projection P=<default>, transform t=<default>);
-void shipout3(string prefix, frame f, string format=<default>, real width, real height, real angle, real zoom, triple m, triple m, pair shift, pair margin, real[][] t, real[][] tup, real[] background, triple[] lights, real[][] diffuse, real[][] specular, bool view=<default>);
-void shipout3(string prefix, frame f, string format=<default>);
-string getstring(string name=<default>, string default=<default>, string prompt=<default>, bool store=<default>);
-int debuggerlines;
-frame bbox(picture pic=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>);
-frame pad(picture pic=<default>, real xsize=<default>, real ysize=<default>, filltype filltype=<default>);
-real radians(real degrees);
-bool pdf();
-void _eval(string s, bool embedded, bool interactivewrite=<default>);
-void _eval(code s, bool embedded);
-path[][] textpath(string[] s, pen[] p);
-void radialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, real ra, bool extenda=<default>, pen penb, pair b, real rb, bool extendb=<default>, bool copy=<default>);
-void radialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, real ra, bool extenda=<default>, pen penb, pair b, real rb, bool extendb=<default>, bool copy=<default>);
-pair maxbound(pair a, pair b);
-triple maxbound(triple a, triple b);
-pair maxbound(pair[] a);
-pair maxbound(pair[][] a);
-pair maxbound(pair[][][] a);
-triple maxbound(triple[] a);
-triple maxbound(triple[][] a);
-triple maxbound(triple[][][] a);
-string Embed(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>);
+int[] sort(int[] a);
+int[][] sort(int[][] a);
+real[] sort(real[] a);
+real[][] sort(real[][] a);
+string[] sort(string[] a);
+string[][] sort(string[][] a);
+coord[] sort(coord[] a, bool less(coord, coord), bool stable=<default>);
+object[] sort(object[] a, bool less(object, object), bool stable=<default>);
+marker[] sort(marker[] a, bool less(marker, marker), bool stable=<default>);
+Legend[] sort(Legend[] a, bool less(Legend, Legend), bool stable=<default>);
+path[] sort(path[] a, bool less(path, path), bool stable=<default>);
+pen[][] sort(pen[][] a, bool less(pen[], pen[]), bool stable=<default>);
+pair[][] sort(pair[][] a, bool less(pair[], pair[]), bool stable=<default>);
+pen[] sort(pen[] a, bool less(pen, pen), bool stable=<default>);
+bool[] sort(bool[] a, bool less(bool, bool), bool stable=<default>);
+void()()[] sort(void()()[] a, bool less(void()(), void()()), bool stable=<default>);
+frame[] sort(frame[] a, bool less(frame, frame), bool stable=<default>);
+bool3[] sort(bool3[] a, bool less(bool3, bool3), bool stable=<default>);
+Label[] sort(Label[] a, bool less(Label, Label), bool stable=<default>);
+picture[] sort(picture[] a, bool less(picture, picture), bool stable=<default>);
+int[] sort(int[] a, bool less(int, int), bool stable=<default>);
+string[][] sort(string[][] a, bool less(string[], string[]), bool stable=<default>);
+real[] sort(real[] a, bool less(real, real), bool stable=<default>);
+string[] sort(string[] a, bool less(string, string), bool stable=<default>);
+pair[] sort(pair[] a, bool less(pair, pair), bool stable=<default>);
+real[][] sort(real[][] a, bool less(real[], real[]), bool stable=<default>);
+triple[] sort(triple[] a, bool less(triple, triple), bool stable=<default>);
+guide[] sort(guide[] a, bool less(guide, guide), bool stable=<default>);
pair postcontrol(path p, int t);
pair postcontrol(path p, real t);
triple postcontrol(path3 p, int t);
@@ -351,172 +1343,94 @@ real max(real M, scaling s, coord[] c);
int max(... int[] a);
pair max(picture pic, bool user=<default>);
real max(... real[] a);
-Label Label(string s, string size=<default>, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label(Label L, explicit position position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label(explicit pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label(string s=<default>, string size=<default>, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label;
-Label Label(string s, string size=<default>, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label(Label L, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-Label Label(Label L, pair position, align align=<default>, pen p=<default>, transform embed(transform)=<default>, filltype filltype=<default>);
-string font(pen p=<default>);
-pen font(string name, string options=<default>);
-pen font(string encoding, string family, string series, string shape);
-pen font(string name, real size, string options=<default>);
-string outdirectory();
-marker markthin(path g, pen p=<default>, real thin(real fraction)=<default>, filltype filltype=<default>);
-int intMin;
-pen white;
-side RightSide;
-string replace(string s, string[][] translate);
-string replace(string s, string before, string after);
-transform fixedscaling(picture pic=<default>, pair min, pair max, pen p=<default>, bool warn=<default>);
-pen Symbol(string series=<default>, string shape=<default>);
-slice firstcut(path p, path knife);
-pen squarecap;
-bool isometry(transform t);
-pen squarepen;
-pen deepyellow;
-real barsize(pen p=<default>);
-bool EndArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-bool EndArrow(picture, path, pen, marginT(path, pen));
-bool EndArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-bool EndArcArrow(picture, path, pen, marginT(path, pen));
-void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>);
-void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, path[] b=<default>, pair[][] z=<default>, bool copy=<default>);
-void tensorshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z=<default>);
-void tensorshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, path b=<default>, pair[] z=<default>);
-string[] split(string s, string delimiter=<default>);
-void addSaveFunction(void s()());
-object embed3(string, frame, string, string, string, light, projection);
-filltype NoFill;
-real colatitude(triple v, bool warn=<default>);
-void drawDisk(frame f, real[][] t, pen[] p, real opacity, real shininess, real metallic, real fresnel0);
-void label(frame f, string s, string size, transform t, pair position, pair align, pen p);
-void label(picture pic=<default>, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(pair origin, picture pic=<default>, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(frame f, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(picture pic=<default>, Label L, pair position, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(frame f, Label L, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(picture pic=<default>, Label L, explicit guide g, align align=<default>, pen p=<default>, filltype filltype=<default>);
-void label(picture pic=<default>, Label L, explicit path g, align align=<default>, pen p=<default>, filltype filltype=<default>);
-real fabs(real x);
-real[] fabs(real[] a);
-bool labels(frame f);
-light light(pen diffuse=<default>, pen specular=<default>, pen background=<default>, real x, real y, real z);
-light light(pen diffuse=<default>, pen specular=<default>, pen background=<default>, real specularfactor=<default> ... triple[] position);
-light light(explicit light light);
-light light(pen[] diffuse, pen[] specular=<default>, pen background=<default>, real specularfactor=<default>, triple[] position);
-real remainder(real x, real y);
-int byte(real x);
-real camerafactor;
-pen lightred;
-real labelmargin;
-real labelmargin(pen p=<default>);
-pen lightblue;
-pen lightgreen;
-pair right;
-string outformat(string format=<default>);
-pen lightcyan;
-pen lightmagenta;
-pen lightyellow;
-pen lightgray;
-pen lightolive;
-pen lightgrey;
-string upcase(string s);
-pen darkblue;
-pen darkbrown;
-path[] strokepath(path g, pen p=<default>);
-real erf(real x);
-void saveline(string name, string value, bool store=<default>);
-pen fuchsia;
-filltype filltype(int type=<default>, pen fillpen=<default>, pen drawpen=<default>, void fill2(frame f, path[] g, pen fillpen));
-path box(pair a, pair b);
-path box(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-path box(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-frame[] fit(string prefix=<default>, picture[] pictures, string format=<default>, bool view=<default>, string options=<default>, string script=<default>, projection P=<default>);
-pen Bookman(string series=<default>, string shape=<default>);
-void seekeof(file f);
-path unitcircle;
+void restore();
+pen basealign(int n);
+int basealign(pen p=<default>);
+pen basealign;
+int min(int a, int b);
+int[] min(int a, int[] b);
+int[] min(int[] a, int b);
+int[] min(int[] a, int[] b);
+int min(int[] a);
+int min(int[][] a);
+int min(int[][][] a);
+real min(real a, real b);
+real[] min(real a, real[] b);
+real[] min(real[] a, real b);
+real[] min(real[] a, real[] b);
+real min(real[] a);
+real min(real[][] a);
+real min(real[][][] a);
+string min(string a, string b);
+string[] min(string a, string[] b);
+string[] min(string[] a, string b);
+string[] min(string[] a, string[] b);
+string min(string[] a);
+string min(string[][] a);
+string min(string[][][] a);
+pair min(pen p);
+pair min(frame f);
+pair min(explicit path p);
+pair min(path[] p);
+triple min(path3 p);
+pair min(picture pic, bool user=<default>);
+real min(... real[] a);
+real min(real m, scaling s, coord[] c);
+int min(... int[] a);
+void srand(int seed);
+bool operator >(int a, int b);
+bool[] operator >(int a, int[] b);
+bool[] operator >(int[] a, int b);
+bool[] operator >(int[] a, int[] b);
+bool operator >(real a, real b);
+bool[] operator >(real a, real[] b);
+bool[] operator >(real[] a, real b);
+bool[] operator >(real[] a, real[] b);
+bool operator >(string a, string b);
+bool[] operator >(string a, string[] b);
+bool[] operator >(string[] a, string b);
+bool[] operator >(string[] a, string[] b);
+bool operator >=(int a, int b);
+bool[] operator >=(int a, int[] b);
+bool[] operator >=(int[] a, int b);
+bool[] operator >=(int[] a, int[] b);
+bool operator >=(real a, real b);
+bool[] operator >=(real a, real[] b);
+bool[] operator >=(real[] a, real b);
+bool[] operator >=(real[] a, real[] b);
+bool operator >=(string a, string b);
+bool[] operator >=(string a, string[] b);
+bool[] operator >=(string[] a, string b);
+bool[] operator >=(string[] a, string[] b);
+bool operator >=(coord a, coord b);
+bool operator <=(int a, int b);
+bool[] operator <=(int a, int[] b);
+bool[] operator <=(int[] a, int b);
+bool[] operator <=(int[] a, int[] b);
+bool operator <=(real a, real b);
+bool[] operator <=(real a, real[] b);
+bool[] operator <=(real[] a, real b);
+bool[] operator <=(real[] a, real[] b);
+bool operator <=(string a, string b);
+bool[] operator <=(string a, string[] b);
+bool[] operator <=(string[] a, string b);
+bool[] operator <=(string[] a, string[] b);
+bool operator <=(coord a, coord b);
+bool operator <(int a, int b);
+bool[] operator <(int a, int[] b);
+bool[] operator <(int[] a, int b);
+bool[] operator <(int[] a, int[] b);
+bool operator <(real a, real b);
+bool[] operator <(real a, real[] b);
+bool[] operator <(real[] a, real b);
+bool[] operator <(real[] a, real[] b);
+bool operator <(string a, string b);
+bool[] operator <(string a, string[] b);
+bool[] operator <(string[] a, string b);
+bool[] operator <(string[] a, string[] b);
pair[] conj(pair[] a);
pair[][] conj(pair[][] a);
pair conj(pair z);
-pen deepgray;
-pen deepgreen;
-pen deepgrey;
-marker[] Mark;
-marker Mark(int n);
-real aTan(real x);
-void _begingroup3(frame f, string name, real compression, real granularity, bool closed, bool tessellate, bool dobreak, bool nobreak, triple center, int interaction);
-path[] MarkPath;
-string graphic(string name, string options=<default>);
-real aCos(real x);
-void texreset();
-string graphicscale(real x);
-int[] complement(int[] a, int n);
-path[] complement(frame f, path[] g);
-pen Cyan;
-marginT NoMargin(path, pen);
-marginT NoMargin(path, pen)();
-path[][] _texpath(string[] s, pen[] p);
-real sinh(real x);
-real[] sinh(real[] a);
-real[] _cputime();
-position EndPoint;
-hsv hsv(real h, real s, real v);
-hsv hsv(pen p);
-void deconstruct(frame f, frame preamble=<default>, transform t=<default>);
-void deconstruct(picture pic=<default>);
-int sgn(real x);
-node node(void d(frame f, transform t, transform T, pair lb, pair rt), string key=<default>);
-pair minAfterTransform(transform t, path[] p);
-void fillbox(frame dest, path g, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-int seconds(string t=<default>, string format=<default>);
-pen cyan;
-pen grey;
-real cm;
-filltype Fill;
-filltype Fill(real xmargin=<default>, real ymargin=<default>, pen p=<default>);
-pen olive;
-pen darkolive;
-int ascii(string s);
-real arcarrowangle;
-real arcarrowfactor;
-real mm;
-real arcarrowsize(pen p=<default>);
-real calculateScaling(string dir, coord[] coords, real size, bool warn=<default>);
-real calculateScaling(string dir, coord[] m, coord[] M, real size, bool warn=<default>);
-triple gettriple(string name=<default>, triple default=<default>, string prompt=<default>, bool store=<default>);
-void drawpixel(frame f, triple v, pen p, real width=<default>);
-pen fontsize(real size, real lineskip);
-real fontsize(pen p=<default>);
-pen fontsize(real size);
-void close(file f);
-real lineskip(pen p=<default>);
-pen dashed;
-pair maxAfterTransform(transform t, path[] p);
-int[][] triangulate(pair[] z);
-void fill(frame f, path[] g, pen p=<default>, bool copy=<default>);
-path fill(frame dest, frame src, filltype filltype=<default>, real xmargin=<default>, real ymargin=<default>);
-void fill(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>);
-void fill(pair origin, picture pic=<default>, path[] g, pen p=<default>);
-pair midpoint(path p);
-real exp(real x);
-real[] exp(real[] a);
-pair exp(explicit pair z);
-pen linejoin(int n);
-int linejoin(pen p=<default>);
-real ldexp(real x, int e);
-pen rgba(real[] a);
-real[] rgba(pen p);
-string time(string format=<default>);
-string time(int seconds, string format=<default>);
-void prepend(frame dest, frame src);
-real pt;
-settings settings;
-int MoveQuiet;
-marginT EndMargin(path, pen);
-pen nullpen;
side LeftSide;
path nullpath;
guide[] copy(guide[] a, int depth=<default>);
@@ -548,305 +1462,135 @@ real[] abs(real[] a);
real abs(pair z);
real abs(triple v);
int abs(int x);
-pen pink;
-real inches;
-path ellipse(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-path ellipse(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-path ellipse(pair c, real a, real b);
-pair getpair(string name=<default>, pair default=<default>, string prompt=<default>, bool store=<default>);
-void axialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, bool extenda=<default>, pen penb, pair b, bool extendb=<default>, bool copy=<default>);
-void axialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, bool extenda=<default>, pen penb, pair b, bool extendb=<default>, bool copy=<default>);
-string locale(string s=<default>);
-real dirtime(path p, pair z);
-void copyPairOrTriple(pairOrTriple dest, pairOrTriple src);
-real[] colors(pen p);
-void filloutside(picture pic=<default>, path[] g, pen p=<default>, bool copy=<default>);
-void filloutside(frame f, path[] g, pen p=<default>, bool copy=<default>);
-pen[] colorPen;
-real _findroot(real f(real), real a, real b, real tolerance, real fa, real fb);
-pen colorless(pen p);
-pen solid;
-string colorspace(pen p);
-void warn(string s);
-pen deepblue;
-pen palered;
-real[] map(real f(pair), pair[] a);
-int[] map(int f(real), real[] a);
-bool3[] map(bool3 f(bool3), bool3[] a);
-Label[] map(Label f(Label), Label[] a);
-frame[] map(frame f(frame), frame[] a);
-coord[] map(coord f(coord), coord[] a);
-object[] map(object f(object), object[] a);
-pen[][] map(pen[] f(pen[]), pen[][] a);
-triple[] map(triple f(triple), triple[] a);
-pen[] map(pen f(pen), pen[] a);
-picture[] map(picture f(picture), picture[] a);
-pair[] map(pair f(pair), pair[] a);
-marker[] map(marker f(marker), marker[] a);
-string[] map(string f(string), string[] a);
-void()()[] map(void f()()(void()()), void()()[] a);
-pair[][] map(pair[] f(pair[]), pair[][] a);
-real[] map(real f(real), real[] a);
-int[] map(int f(int), int[] a);
-string[][] map(string[] f(string[]), string[][] a);
-bool[] map(bool f(bool), bool[] a);
-path[] map(path f(path), path[] a);
-real[][] map(real[] f(real[]), real[][] a);
-Legend[] map(Legend f(Legend), Legend[] a);
-guide[] map(guide f(guide), guide[] a);
-path unstraighten(path p);
-path3 unstraighten(path3 p);
-void _image(frame f, real[][] data, pair initial, pair final, pen[] palette=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>);
-void _image(frame f, pen[][] data, pair initial, pair final, transform t=<default>, bool copy=<default>, bool antialias=<default>);
-void _image(frame f, pen f(int, int), int width, int height, pair initial, pair final, transform t=<default>, bool antialias=<default>);
-pair arcpoint(path p, real L);
-pen Pen(int n);
-int rfind(string s, string t, int pos=<default>);
-pair minratio(frame f);
-pair minratio(triple[][] p, pair b);
-pair minratio(path3 g);
-int[] sequence(int n);
-pen[][] sequence(pen[] f(int), int n);
-coord[] sequence(coord f(int), int n);
-object[] sequence(object f(int), int n);
-marker[] sequence(marker f(int), int n);
-Legend[] sequence(Legend f(int), int n);
-int[] sequence(int f(int), int n);
-string[][] sequence(string[] f(int), int n);
-pair[] sequence(pair f(int), int n);
-int[] sequence(int n, int m, int skip);
-guide[] sequence(guide f(int), int n);
-pen[] sequence(pen f(int), int n);
-void()()[] sequence(void f()()(int), int n);
-bool[] sequence(bool f(int), int n);
-string[] sequence(string f(int), int n);
-pair[][] sequence(pair[] f(int), int n);
-bool3[] sequence(bool3 f(int), int n);
-Label[] sequence(Label f(int), int n);
-picture[] sequence(picture f(int), int n);
-real[][] sequence(real[] f(int), int n);
-real[] sequence(real f(int), int n);
-int[] sequence(int n, int m);
-triple[] sequence(triple f(int), int n);
-path[] sequence(path f(int), int n);
-frame[] sequence(frame f(int), int n);
-triple minbezier(triple[][] p, triple b);
-path trim(path g, real begin, real end=<default>);
-marginT DotMargin(path, pen)(real begin, real end=<default>);
-marginT DotMargin(path, pen);
-marginT DotMargins(path, pen);
-string string(int x);
-string string(real x, int digits=<default>);
-string cd(string s=<default>);
-int size(guide g);
-pair size(frame f);
-int size(path p);
-int size(path[] p);
-int size(path3 p);
-void size(picture dest, picture src);
-pair size(picture pic, bool user=<default>);
-void size(picture pic=<default>, transform t);
-void size(picture pic=<default>, real x, real y=<default>, bool keepAspect=<default>);
-void size(picture pic=<default>, real xsize, real ysize, pair min, pair max);
-void clear(file f);
-void clear(string file, int line);
-void clear();
-void clear(string file, string text);
-pen mediumred;
-pen mediumblue;
-pen mediumgreen;
-pen mediumcyan;
-pen mediummagenta;
-pair arcdir(path p, real L);
-pen mediumyellow;
-pen mediumgray;
-string downcase(string s);
-pen mediumgrey;
-transform transform(pen p);
-string readline(string prompt=<default>, string name=<default>, bool tabcompletion=<default>);
-void beep();
-pair relpoint(path p, real l);
-pair[][] transpose(pair[][] a);
-pen[][] transpose(pen[][] a);
-string[][] transpose(string[][] a);
-real[][] transpose(real[][] a);
-pen overwrite(int n);
-int overwrite(pen p=<default>);
-pen linewidth(real x);
-real linewidth(pen p=<default>);
-transformation transformation(real[][] modelview);
-transformation transformation(real[][] modelview, real[][] projection);
-pair maxratio(frame f);
-pair maxratio(triple[][] p, pair b);
-pair maxratio(path3 g);
-triple maxbezier(triple[][] p, triple b);
-void layer(frame f);
-void layer(picture pic=<default>);
-void DOSnewl(file file);
-pen cmyk(pen p);
-pen cmyk(real c, real m, real y, real k);
-pen blue;
-pen evenodd;
-int precision(file f=<default>, int digits=<default>);
-path3 path3(triple[] pre, triple[] point, triple[] post, bool[] straight, bool cyclic);
-bool piecewisestraight(path p);
-bool piecewisestraight(path3 p);
-void stop(string file, int line, code s=<default>);
-void stop(string file, string text, code s=<default>);
-void drawCylinder(frame f, real[][] t, pen[] p, real opacity, real shininess, real metallic, real fresnel0, bool core=<default>);
-pair reldir(path p, real l);
-pen TimesRoman(string series=<default>, string shape=<default>);
-slice cut(path p, path knife, int n);
-bool is3D(frame f);
-bool is3D(string format=<default>);
-void add(frame dest, frame src);
-void add(frame f, transform t=<default>, Label L);
-void add(picture pic=<default>, void d(frame f, transform t), bool exact=<default>);
-void add(frame dest, frame src, filltype filltype, bool above=<default>);
-void add(frame dest, frame src, bool group, filltype filltype=<default>, bool above=<default>);
-void add(picture pic=<default>, void d(picture, real[][]), bool exact=<default>);
-void add(frame dest, frame src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture dest=<default>, frame src, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture dest=<default>, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(frame dest, frame src, pair position, pair align, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture pic=<default>, void d(frame f, real[][] t, picture pic, projection P), bool exact=<default>);
-void add(picture pic=<default>, void d(picture, transform), bool exact=<default>);
-void add(picture dest, picture src, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture dest, picture src, pair position, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture dest=<default>, object F, pair position=<default>, bool group=<default>, filltype filltype=<default>, bool above=<default>);
-void add(picture pic=<default>, Label L);
-plain plain;
-void purge(int divisor=<default>);
-int Round(real x);
-real sqrt(real x);
-real[] sqrt(real[] a);
-pair sqrt(explicit pair z);
-string[] spinner;
-real[] times(path p, real x, real fuzz=<default>);
-real[] times(path p, explicit pair z, real fuzz=<default>);
-void drawbeziertriangle(frame f, triple[][] p, triple center, bool straight, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors, int interaction, int digits, bool primitive=<default>);
-void Draw(picture pic=<default>, path g, pen p=<default>);
-filltype Draw;
-void Draw(picture pic=<default>, explicit path[] g, pen p=<default>);
-filltype Draw(real xmargin=<default>, real ymargin=<default>, pen p=<default>);
-void tab(file file);
-plain_bounds plain_bounds;
-string file(string s);
-string outprefix(string prefix=<default>);
-object object(frame f);
-object object(Label L);
-object object(Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-file stdin;
-void()()[] array(int n, void value()(), int depth=<default>);
-bool[] array(int n, bool value, int depth=<default>);
-string[] array(int n, string value, int depth=<default>);
-pair[][] array(int n, pair[] value, int depth=<default>);
-bool3[] array(int n, bool3 value, int depth=<default>);
-Label[] array(int n, Label value, int depth=<default>);
-picture[] array(int n, picture value, int depth=<default>);
-real[][] array(int n, real[] value, int depth=<default>);
-real[] array(int n, real value, int depth=<default>);
-triple[] array(int n, triple value, int depth=<default>);
-path[] array(int n, path value, int depth=<default>);
-frame[] array(int n, frame value, int depth=<default>);
-pen[][] array(int n, pen[] value, int depth=<default>);
-coord[] array(int n, coord value, int depth=<default>);
-object[] array(int n, object value, int depth=<default>);
-marker[] array(int n, marker value, int depth=<default>);
-Legend[] array(int n, Legend value, int depth=<default>);
-int[] array(int n, int value, int depth=<default>);
-string[][] array(int n, string[] value, int depth=<default>);
-pair[] array(int n, pair value, int depth=<default>);
-guide[] array(int n, guide value, int depth=<default>);
-pen[] array(int n, pen value, int depth=<default>);
-string[] array(string s);
-bool BeginBar(picture, path, pen, marginT(path, pen));
-bool BeginBar(picture, path, pen, marginT(path, pen))(real size=<default>);
-triple perp(triple v, triple u);
-int find(bool[] a, int n=<default>);
-int find(string s, string t, int pos=<default>);
-position BeginPoint;
-marginT BeginMargin(path, pen);
-path buildcycle(... path[] p);
-bool BeginArrow(picture, path, pen, marginT(path, pen));
-bool BeginArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-marginT BeginPenMargin(path, pen);
-int round(real x);
-marginT BeginDotMargin(path, pen);
-bool BeginArcArrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-bool BeginArcArrow(picture, path, pen, marginT(path, pen));
-pen roundcap;
-void buildRestoreThunk()();
-pen roundjoin;
-int sourceline(string file, string text);
-void buildRestoreDefaults()();
-path roundbox(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-path roundbox(frame f, Label L, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-real asin(real x);
-real[] asin(real[] a);
-pair endpoint(path p);
+void radialshade(frame f, path[] g, bool stroke=<default>, pen pena, pair a, real ra, bool extenda=<default>, pen penb, pair b, real rb, bool extendb=<default>, bool copy=<default>);
+void radialshade(picture pic=<default>, path[] g, bool stroke=<default>, pen pena, pair a, real ra, bool extenda=<default>, pen penb, pair b, real rb, bool extendb=<default>, bool copy=<default>);
+pair maxbound(pair a, pair b);
+triple maxbound(triple a, triple b);
+pair maxbound(pair[] a);
+pair maxbound(pair[][] a);
+pair maxbound(pair[][][] a);
+triple maxbound(triple[] a);
+triple maxbound(triple[][] a);
+triple maxbound(triple[][][] a);
+pair minbound(pair a, pair b);
+triple minbound(triple a, triple b);
+pair minbound(pair[] a);
+pair minbound(pair[][] a);
+pair minbound(pair[][][] a);
+triple minbound(triple[] a);
+triple minbound(triple[][] a);
+triple minbound(triple[][][] a);
+real operator /(real a, real b);
+real[] operator /(real a, real[] b);
+real[] operator /(real[] a, real b);
+real[] operator /(real[] a, real[] b);
+real[][] operator /(real[][] a, real b);
+pair operator /(pair a, pair b);
+pair[] operator /(pair a, pair[] b);
+pair[] operator /(pair[] a, pair b);
+pair[] operator /(pair[] a, pair[] b);
+pair[][] operator /(pair[][] a, pair b);
+triple[] operator /(triple[] a, real b);
+real operator /(int a, int b);
+real[] operator /(int[] a, int b);
+real[] operator /(int a, int[] b);
+real[] operator /(int[] a, int[] b);
+triple operator /(triple v, real x);
+real interp(real a, real b, real t);
+pair interp(explicit pair a, explicit pair b, real t);
+triple interp(triple a, triple b, real t);
+pen interp(pen a, pen b, real t);
+bool primitive();
+int operator *(int a, int b);
+int[] operator *(int a, int[] b);
+int[] operator *(int[] a, int b);
+int[] operator *(int[] a, int[] b);
+int[][] operator *(int a, int[][] b);
+int[][] operator *(int[][] a, int b);
+real operator *(real a, real b);
+real[] operator *(real a, real[] b);
+real[] operator *(real[] a, real b);
+real[] operator *(real[] a, real[] b);
+real[][] operator *(real a, real[][] b);
+real[][] operator *(real[][] a, real b);
+pair operator *(pair a, pair b);
+pair[] operator *(pair a, pair[] b);
+pair[] operator *(pair[] a, pair b);
+pair[] operator *(pair[] a, pair[] b);
+pair[][] operator *(pair a, pair[][] b);
+pair[][] operator *(pair[][] a, pair b);
+triple[] operator *(real a, triple[] b);
+triple[][] operator *(real a, triple[][] b);
+triple[] operator *(triple[] a, real b);
+triple[][] operator *(triple[][] a, real b);
+pen operator *(real a, pen b);
+pen operator *(pen a, real b);
+transform operator *(transform a, transform b);
+pair operator *(transform t, pair z);
+path operator *(transform t, path g);
+pen operator *(transform t, pen p);
+frame operator *(transform t, frame f);
+frame operator *(real[][] t, frame f);
+real[] operator *(real[][] a, real[] b);
+real[] operator *(real[] a, real[][] b);
+int[][] operator *(int[][] a, int[][] b);
+real[][] operator *(real[][] a, real[][] b);
+pair[][] operator *(pair[][] a, pair[][] b);
+triple operator *(real[][] t, triple v);
+triple operator *(real x, triple v);
+triple operator *(triple v, real x);
+path3 operator *(real[][] t, path3 g);
+Label operator *(transform t, Label L);
+picture operator *(real[][] t, picture orig);
+side operator *(real x, side s);
+path[] operator *(transform t, explicit path[] p);
+picture operator *(transform t, picture orig);
+pair[] operator *(transform t, pair[] z);
+Label operator *(real[][] t, Label L);
+bounds operator *(transform t, bounds b);
+object operator *(transform t, explicit object F);
real latitude(triple v, bool warn=<default>);
int sum(int[] a);
real sum(real[] a);
pair sum(pair[] a);
triple sum(triple[] a);
int sum(bool[] a);
-void xmap(string key, transform t=<default>);
-real inf;
-real arctime(path p, real l);
-real arctime(path3 p, real dval);
-pen palemagenta;
-void draw(frame f, triple[][] p, triple center, bool straight, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors, int interaction, int digits, bool primitive=<default>);
-void draw(frame f, triple[] p, real[] knot, real[] weights=<default>, pen p);
-void draw(frame f, triple[][] p, real[] uknot, real[] vknot, real[][] weights=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] colors);
-void draw(frame f, triple[] v, int[][] vi, triple center=<default>, triple[] n, int[][] ni, pen[] p, real opacity, real shininess, real metallic, real fresnel0, pen[] c=<default>, int[][] ci=<default>, int interaction);
-void draw(picture pic=<default>, path[] g, pen fillrule=<default>, pen[] p);
-object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-void draw(frame f, explicit path[] g, pen p=<default>);
-void draw(frame f, path g, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen)));
-void draw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(pair origin, picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
-void draw(pair origin, picture pic=<default>, guide[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
-object draw(picture pic=<default>, Label L, path e(frame dest, frame src=<default>, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>), pair position, real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-void draw(picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
-void draw(pair origin, picture pic=<default>, explicit path[] g, pen p=<default>, Label legend=<default>, marker marker=<default>);
-void draw(frame f, guide[] g, pen p=<default>);
-void draw(frame f, path g, pen p=<default>);
-int mantissaBits;
-real identity(real x);
-real[] identity(real[] a);
-transform identity();
-real[][] identity(int n);
-transform identity;
-real[][] identity4;
-marker[] MarkFill;
-pen pattern(string s);
-string pattern(pen p);
-transform invert;
-transform inverse(transform t);
-real[][] inverse(real[][] a);
-int[] MarkFillable;
-pair unit(pair z);
-triple unit(triple v);
-triple min3(frame f);
-triple min3(pen p);
-void begin(picture pic=<default>, string name, string id=<default>, bool visible=<default>);
-int CLZ(int a);
-arrowhead DefaultHead;
-void beginclip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
-void beginclip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
-void begingroup(frame f);
-void begingroup(picture pic=<default>);
-marker nomarker;
-pair beginpoint(path p);
-real azimuth(triple v, bool warn=<default>);
-real angle(pair z, bool warn=<default>);
-real angle(transform t);
-pair ENE;
-frame pack(pair align=<default> ... object[] inset);
+bool initialized(int a);
+bool initialized(real a);
+bool initialized(pair a);
+bool initialized(triple a);
+int operator -(int a, int b);
+int[] operator -(int a, int[] b);
+int[] operator -(int[] a, int b);
+int[] operator -(int[] a, int[] b);
+int[][] operator -(int[][] a, int[][] b);
+int operator -(int a);
+int[] operator -(int[] a);
+int[][] operator -(int[][] a);
+real operator -(real a, real b);
+real[] operator -(real a, real[] b);
+real[] operator -(real[] a, real b);
+real[] operator -(real[] a, real[] b);
+real[][] operator -(real[][] a, real[][] b);
+real operator -(real a);
+real[] operator -(real[] a);
+real[][] operator -(real[][] a);
+pair operator -(pair a, pair b);
+pair[] operator -(pair a, pair[] b);
+pair[] operator -(pair[] a, pair b);
+pair[] operator -(pair[] a, pair[] b);
+pair[][] operator -(pair[][] a, pair[][] b);
+pair operator -(pair a);
+pair[] operator -(pair[] a);
+pair[][] operator -(pair[][] a);
+triple operator -(triple a, triple b);
+triple[] operator -(triple a, triple[] b);
+triple[] operator -(triple[] a, triple b);
+triple[] operator -(triple[] a, triple[] b);
+triple[][] operator -(triple[][] a, triple[][] b);
+triple operator -(triple a);
+triple[] operator -(triple[] a);
+triple[][] operator -(triple[][] a);
void gsave(frame f);
void write(file file=<default>, string s=<default>, bool x, void suffix(file)=<default> ... bool[]);
void write(file file=<default>, string s=<default>, explicit bool[] a ... bool[][]);
@@ -883,367 +1627,185 @@ void write(file file, void suffix(file)=<default>);
void write(file file=<default>, string s=<default>, pen[] p);
void write(void suffix(file)=<default>);
void write(file file, string s=<default>, explicit path[] x, void suffix(file)=<default>);
-void write(file file=<default>, align align, void suffix(file)=<default>);
void write(file file, string s=<default>, cputime c, string format=<default>, void suffix(file)=<default>);
void write(pairOrTriple a);
void write(string s=<default>, bool3 b, void suffix(file)=<default>);
void write(file file, string s=<default>, bool3 b, void suffix(file)=<default>);
void write(string s=<default>, explicit guide[] x, void suffix(file)=<default>);
+void write(file file=<default>, align align, void suffix(file)=<default>);
void write(file file=<default>, Label L, void suffix(file)=<default>);
-void save()();
-marginT EndPenMargin(path, pen);
-pair NNE;
-real[] tridiagonal(real[] a, real[] b, real[] c, real[] f);
-pen Dotted;
-pen Dotted(pen p=<default>);
-pair dir(real degrees);
-pair dir(explicit pair z);
-triple dir(explicit triple z);
-triple dir(real colatitude, real longitude);
-pair dir(path p, int t, int sign=<default>, bool normalize=<default>);
-pair dir(path p, real t, bool normalize=<default>);
-triple dir(path3 p, int t, int sign=<default>, bool normalize=<default>);
-triple dir(path3 p, real t, bool normalize=<default>);
-pair dir(path p);
-pair dir(path p, path q);
-int[][] diagonal(... int[]);
-real[][] diagonal(... real[]);
-pair[][] diagonal(... pair[]);
-real reltime(path p, real l);
-void marknodes(picture pic=<default>, frame f, path g);
-real newton(int iterations=<default>, real f(real), real fprime(real), real x, bool verbose=<default>);
-real newton(int iterations=<default>, real f(real), real fprime(real), real x1, real x2, bool verbose=<default>);
-string TeXify(string s);
-bool3 default;
-pair[] controlSpecifier(guide g, int t);
-void defaultpen(pen p);
-pen defaultpen();
-pen defaultpen;
-void defaultpen(real w);
-transform Slant(transform t);
-triple max3(frame f);
-triple max3(pen p);
-string defaultformat(int n, string trailingzero=<default>, bool fixed=<default>, bool signed=<default>);
-string defaultformat;
-pen dashdotted;
-string defaultseparator;
-string asydir();
-string defaultfilename;
-real longitude(triple v, bool warn=<default>);
-bool Blank(picture, path, pen, marginT(path, pen));
-tensionSpecifier tensionSpecifier(guide g, int t);
-marker marker(frame f=<default>, void markroutine(picture pic=<default>, frame f, path g)=<default>, bool above=<default>);
-marker marker(path[] g, void markroutine(picture pic=<default>, frame f, path g)=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-int Move;
-string location();
-string locatefile(string file, bool full=<default>);
-pen dotted;
-string blend(pen p);
-arrowhead HookHead;
-arrowhead HookHead(real dir=<default>, real barb=<default>);
-real[] concat(... real[][]);
-pair[] concat(... pair[][]);
-marker[] concat(... marker[][]);
-pen[] concat(... pen[][]);
-picture[] concat(... picture[][]);
-path[] concat(... path[][]);
-coord[] concat(... coord[][]);
-object[] concat(... object[][]);
-int[] concat(... int[][]);
-void()()[] concat(... void()()[][]);
-bool3[] concat(... bool3[][]);
-Label[] concat(... Label[][]);
-string[] concat(... string[][]);
-Legend[] concat(... Legend[][]);
-triple[] concat(... triple[][]);
-frame[] concat(... frame[][]);
-guide[] concat(... guide[][]);
-bool[] concat(... bool[][]);
-int OR(int a, int b);
-real log1p(real x);
-real[] log1p(real[] a);
-real infinity;
-bool alias(pair[][] a, pair[][] b);
-bool alias(guide[] a, guide[] b);
-bool alias(filltype a, filltype b);
-bool alias(coord[] a, coord[] b);
-bool alias(Legend a, Legend b);
-bool alias(position a, position b);
-bool alias(object[] a, object[] b);
-bool alias(schur a, schur b);
-bool alias(pair[] a, pair[] b);
-bool alias(scaling a, scaling b);
-bool alias(light a, light b);
-bool alias(picture a, picture b);
-bool alias(int[] a, int[] b);
-bool alias(string[][] a, string[][] b);
-bool alias(slice a, slice b);
-bool alias(autoscaleT a, autoscaleT b);
-bool alias(align a, align b);
-bool alias(marker[] a, marker[] b);
-bool alias(cputime a, cputime b);
-bool alias(real[][] a, real[][] b);
-bool alias(bool3 a, bool3 b);
-bool alias(bool3[] a, bool3[] b);
-bool alias(freezableBounds a, freezableBounds b);
-bool alias(transformation a, transformation b);
-bool alias(node a, node b);
-bool alias(Label a, Label b);
-bool alias(Label[] a, Label[] b);
-bool alias(processtime a, processtime b);
-bool alias(string[] a, string[] b);
-bool alias(frame[] a, frame[] b);
-bool alias(coords2 a, coords2 b);
-bool alias(coords3 a, coords3 b);
-bool alias(marker a, marker b);
-bool alias(bool[] a, bool[] b);
-bool alias(void()()[] a, void()()[] b);
-bool alias(pen[][] a, pen[][] b);
-bool alias(marginT a, marginT b);
-bool alias(ScaleT a, ScaleT b);
-bool alias(side a, side b);
-bool alias(picture[] a, picture[] b);
-bool alias(realschur a, realschur b);
-bool alias(path[] a, path[] b);
-bool alias(triple[] a, triple[] b);
-bool alias(coord a, coord b);
-bool alias(projection a, projection b);
-bool alias(pairOrTriple a, pairOrTriple b);
-bool alias(object a, object b);
-bool alias(Legend[] a, Legend[] b);
-bool alias(real[] a, real[] b);
-bool alias(pen[] a, pen[] b);
-bool alias(hsv a, hsv b);
-bool alias(bounds a, bounds b);
-bool alias(scaleT a, scaleT b);
-bool alias(arrowhead a, arrowhead b);
-real pi;
-int getint(string name=<default>, int default=<default>, string prompt=<default>, bool store=<default>);
-int bitreverse(int a, int bits);
-bool IgnoreAspect;
-void postscript(frame f, string s);
-void postscript(frame f, string s, pair min, pair max);
-void postscript(picture pic=<default>, string s);
-void postscript(picture pic=<default>, string s, pair min, pair max);
-transform slant(real s);
-void breakpoint(code s=<default>);
-void breakpoints();
-void endgroup(frame f);
-void endgroup(picture pic=<default>);
-void endgroup3(frame f);
-int Floor(real x);
-pair gamma(explicit pair z);
-real gamma(real x);
-real pow10(real x);
-real[] pow10(real[] a);
-real[][] AtA(real[][] a);
-real byteinv(int x);
-real bp;
-int[] sort(int[] a);
-int[][] sort(int[][] a);
-real[] sort(real[] a);
-real[][] sort(real[][] a);
-string[] sort(string[] a);
-string[][] sort(string[][] a);
-coord[] sort(coord[] a, bool less(coord, coord), bool stable=<default>);
-object[] sort(object[] a, bool less(object, object), bool stable=<default>);
-marker[] sort(marker[] a, bool less(marker, marker), bool stable=<default>);
-Legend[] sort(Legend[] a, bool less(Legend, Legend), bool stable=<default>);
-path[] sort(path[] a, bool less(path, path), bool stable=<default>);
-pen[][] sort(pen[][] a, bool less(pen[], pen[]), bool stable=<default>);
-pair[][] sort(pair[][] a, bool less(pair[], pair[]), bool stable=<default>);
-pen[] sort(pen[] a, bool less(pen, pen), bool stable=<default>);
-bool[] sort(bool[] a, bool less(bool, bool), bool stable=<default>);
-void()()[] sort(void()()[] a, bool less(void()(), void()()), bool stable=<default>);
-frame[] sort(frame[] a, bool less(frame, frame), bool stable=<default>);
-bool3[] sort(bool3[] a, bool less(bool3, bool3), bool stable=<default>);
-Label[] sort(Label[] a, bool less(Label, Label), bool stable=<default>);
-picture[] sort(picture[] a, bool less(picture, picture), bool stable=<default>);
-int[] sort(int[] a, bool less(int, int), bool stable=<default>);
-string[][] sort(string[][] a, bool less(string[], string[]), bool stable=<default>);
-real[] sort(real[] a, bool less(real, real), bool stable=<default>);
-string[] sort(string[] a, bool less(string, string), bool stable=<default>);
-pair[] sort(pair[] a, bool less(pair, pair), bool stable=<default>);
-real[][] sort(real[][] a, bool less(real[], real[]), bool stable=<default>);
-triple[] sort(triple[] a, bool less(triple, triple), bool stable=<default>);
-guide[] sort(guide[] a, bool less(guide, guide), bool stable=<default>);
-pen salmon;
-bool ignore;
-pen Pentype(int n);
-pen chartreuse;
-void latticeshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, transform t=<default>, bool copy=<default>);
-void latticeshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[][] p, bool copy=<default>);
-pair[] pairs(real[] x, real[] y);
-void eval(code s, bool embedded=<default>);
-void eval(string s, bool embedded=<default>);
-bool Arrow(picture, path, pen, marginT(path, pen));
-bool Arrow(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>);
-void drawTube(frame f, triple[] g, real width, pen[] p, real opacity, real shininess, real metallic, real fresnel0, triple min, triple max, bool core=<default>);
-bool Arrows(picture, path, pen, marginT(path, pen));
-bool Arrows(picture, path, pen, marginT(path, pen))(arrowhead arrowhead=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>);
-int tell(file f);
-pen Yellow;
-pair up;
-guide reverse(guide g);
-string reverse(string s);
-path reverse(path p);
-path3 reverse(path3 p);
-triple[] reverse(triple[] a);
-int[] reverse(int[] a);
-real[] reverse(real[] a);
-int[] reverse(int n);
-string[] reverse(string[] a);
-pair[] reverse(pair[] a);
-bool[] reverse(bool[] a);
-void _labelpath(frame f, string s, string size, path g, string justify, pair offset, pen p);
-int floor(real x);
-void resetdefaultpen();
-real aSin(real x);
-pen darkred;
-transform Scale(transform t);
-pen mean(pen[] p, real opacity(real[])=<default>);
-pen[] mean(pen[][] palette, real opacity(real[])=<default>);
-string mktemp(string s);
-void sleep(int seconds);
-void drawstrokepath(picture pic=<default>, path g, pen strokepen, pen p=<default>);
-void unitsize(picture pic=<default>, real x, real y=<default>, real z=<default>);
-void arrow(picture pic=<default>, Label L=<default>, pair b, pair dir, real length=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
-picture arrow(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>);
-picture arrow2(arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>);
-path unitsquare;
-real arrowdir;
-real arrowbarb;
-pen yellow;
-int delete(string s);
-pen miterjoin;
-arrowhead SimpleHead;
-real arrowangle;
-real arrowlength;
-pen miterlimit(real x);
-real miterlimit(pen p=<default>);
-real arrowfactor;
-real arrowsize(pen p=<default>);
-real Tan(real deg);
-real arrowsizelimit;
-real arrow2sizelimit;
-real arrowhookfactor;
-real arrowtexfactor;
-void comma(file file);
-void deletepreamble();
-real[] arrowbasepoints(path base, path left, path right, real default=<default>);
-path arrowbase(path r, pair y, real t, real size);
-int choose(int n, int k);
-real hypot(real x, real y);
-path[] _strokepath(path g, pen p=<default>);
-void pause(string w=<default>);
-int ocgindex;
-pen springgreen;
-pen brown;
-bool scale(pen p);
-transform scale(real x);
-transform scale(real x, real y);
-real[][] scale(real x, real y, real z);
-scaleT scaleT(real T(real x), real Tinv(real x), bool logarithmic=<default>, bool automin=<default>, bool automax=<default>);
-string baseline(string s, string template=<default>);
-int[] findall(bool[] a);
-real[][] scale3(real s);
-int AND(int a, int b);
-real polar(triple v, bool warn=<default>);
-real radius(path p, real t);
-real radius(path3 p, real t);
-real radius(triple z0, triple c0, triple c1, triple z1, real t);
-transform scaleless(transform t);
-void makedraw(frame f, path g, pen p, int depth=<default>);
-real nan;
-pair down;
-path arc(pair c, real r, real angle1, real angle2);
-path arc(pair c, explicit pair z1, explicit pair z2, bool direction=<default>);
-path arc(pair c, real r, real angle1, real angle2, bool direction);
-real[] cubicroots(real a, real b, real c, real d);
-pen green;
-real tan(real x);
-real[] tan(real[] a);
-pen longdashed;
-pair point(guide g, int t);
-pair point(path p, int t);
-pair point(path p, real t);
-triple point(path3 p, int t);
-triple point(path3 p, real t);
-pair point(picture pic=<default>, pair dir, bool user=<default>);
-pair point(object F, pair dir, transform t=<default>);
-pair point(frame f, pair dir);
-void progress(bool3 init=<default>);
-pen longdashdotted;
-void usepackage(string s, string options=<default>);
-void drawarrow(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, position position=<default>, bool forwards=<default>, marginT margin(path, pen)=<default>, bool center=<default>);
-void drawarrow2(frame f, arrowhead arrowhead=<default>, path g, pen p=<default>, real size=<default>, real angle=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>);
-pen fillrule(int n);
-int fillrule(pen p);
-pair ESE;
-pair project(triple v, real[][] t);
-bool prc(string format=<default>);
-projection projection(triple camera, triple up=<default>, triple target=<default>, triple normal=<default>, real zoom=<default>, real angle=<default>, pair viewportshift=<default>, bool showtarget=<default>, bool autoadjust=<default>, bool center=<default>, transformation projector(triple camera, triple up, triple target));
-void endl(file file);
-path diamond;
-marginT TrueMargin(path, pen)(real begin, real end=<default>);
-real bezier(real a, real b, real c, real d, real t);
-pair bezier(pair a, pair b, pair c, pair d, real t);
-triple bezier(triple a, triple b, triple c, triple d, real t);
-pair SSE;
-pair bezierP(pair a, pair b, pair c, pair d, real t);
-triple bezierP(triple a, triple b, triple c, triple d, real t);
-pair bezierPP(pair a, pair b, pair c, pair d, real t);
-triple bezierPP(triple a, triple b, triple c, triple d, real t);
-real[] _projection();
-pair bezierPPP(pair a, pair b, pair c, pair d);
-triple bezierPPP(triple a, triple b, triple c, triple d);
-real Jn(int n, real x);
-int randMax;
-path nurb(pair z0, pair z1, pair z2, pair z3, real w0, real w1, real w2, real w3, int m);
-align NoAlign;
-bool EndBar(picture, path, pen, marginT(path, pen));
-bool EndBar(picture, path, pen, marginT(path, pen))(real size=<default>);
-Legend Legend(string label, pen plabel=<default>, pen p=<default>, frame mark=<default>, bool above=<default>);
-real Yn(int n, real x);
-int NOT(int a);
-pen[] monoPen;
-bool CW;
-bool all(bool[] a);
-real atanh(real x);
-real[] atanh(real[] a);
-frame UpsideDown(frame f);
-pair realmult(pair z, pair w);
-triple realmult(triple u, triple v);
-real acosh(real x);
-real[] acosh(real[] a);
-real realEpsilon;
-pair NW;
-real norm(real[] a);
-real norm(real[][] a);
-real norm(triple[][] a);
-int length(guide g);
-int length(string s);
-real length(pair z);
-real length(triple v);
-int length(path p);
-int length(path3 p);
-pair SW;
-void flush(file f);
-pen thin();
-pen palecyan;
-void warning(string s, string t, bool position=<default>);
-frame legend(picture pic=<default>, int perline=<default>, real xmargin=<default>, real ymargin=<default>, real linelength=<default>, real hskip=<default>, real vskip=<default>, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>, pen p=<default>);
-picture legend(Legend[] Legend, int perline=<default>, real linelength, real hskip, real vskip, real maxwidth=<default>, real maxheight=<default>, bool hstretch=<default>, bool vstretch=<default>);
-real Degrees(real radians);
-picture legenditem(Legend legenditem, real linelength);
-real legendhskip;
-real legendvskip;
-pen darkmagenta;
-real change2(triple[][] a);
-real legendmargin;
-bool None(picture, path, pen, marginT(path, pen));
-real dotfactor;
-real legendlinelength;
+bool operator !=(bool a, bool b);
+bool[] operator !=(bool a, bool[] b);
+bool[] operator !=(bool[] a, bool b);
+bool[] operator !=(bool[] a, bool[] b);
+bool operator !=(bool[][] a, bool[][] b);
+bool operator !=(int a, int b);
+bool[] operator !=(int a, int[] b);
+bool[] operator !=(int[] a, int b);
+bool[] operator !=(int[] a, int[] b);
+bool operator !=(int[][] a, int[][] b);
+bool operator !=(real a, real b);
+bool[] operator !=(real a, real[] b);
+bool[] operator !=(real[] a, real b);
+bool[] operator !=(real[] a, real[] b);
+bool operator !=(real[][] a, real[][] b);
+bool operator !=(pair a, pair b);
+bool[] operator !=(pair a, pair[] b);
+bool[] operator !=(pair[] a, pair b);
+bool[] operator !=(pair[] a, pair[] b);
+bool operator !=(pair[][] a, pair[][] b);
+bool operator !=(triple a, triple b);
+bool[] operator !=(triple a, triple[] b);
+bool[] operator !=(triple[] a, triple b);
+bool[] operator !=(triple[] a, triple[] b);
+bool operator !=(triple[][] a, triple[][] b);
+bool operator !=(string a, string b);
+bool[] operator !=(string a, string[] b);
+bool[] operator !=(string[] a, string b);
+bool[] operator !=(string[] a, string[] b);
+bool operator !=(string[][] a, string[][] b);
+bool[] operator !=(pen[] a, pen[] b);
+bool operator !=(pen a, pen b);
+bool operator !=(transform a, transform b);
+bool operator !=(file a, file b);
+bool operator !=(path a, path b);
+bool operator !=(path3 a, path3 b);
+bool operator !=(bool3 a, bool3 b);
+bool operator !=(bounds a, bounds b);
+bool operator !=(node a, node b);
+bool operator !=(side a, side b);
+bool operator !=(coords2 a, coords2 b);
+bool operator !=(light a, light b);
+bool operator !=(coords3 a, coords3 b);
+bool operator !=(processtime a, processtime b);
+bool operator !=(filltype a, filltype b);
+bool operator !=(ScaleT a, ScaleT b);
+bool operator !=(Label a, Label b);
+bool operator !=(schur a, schur b);
+bool operator !=(coord a, coord b);
+bool operator !=(freezableBounds a, freezableBounds b);
+bool operator !=(transformation a, transformation b);
+bool operator !=(pairOrTriple a, pairOrTriple b);
+bool operator !=(marker a, marker b);
+bool operator !=(hsv a, hsv b);
+bool operator !=(scaleT a, scaleT b);
+bool operator !=(cputime a, cputime b);
+bool operator !=(bool3 a, bool b);
+bool operator !=(marginT a, marginT b);
+bool operator !=(Legend a, Legend b);
+bool operator !=(object a, object b);
+bool operator !=(scaling a, scaling b);
+bool operator !=(projection a, projection b);
+bool operator !=(picture a, picture b);
+bool operator !=(align a, align b);
+bool operator !=(arrowhead a, arrowhead b);
+bool operator !=(bool a, bool3 b);
+bool operator !=(slice a, slice b);
+bool operator !=(autoscaleT a, autoscaleT b);
+bool operator !=(position a, position b);
+bool operator !=(realschur a, realschur b);
+bool operator ==(bool a, bool b);
+bool[] operator ==(bool a, bool[] b);
+bool[] operator ==(bool[] a, bool b);
+bool[] operator ==(bool[] a, bool[] b);
+bool operator ==(bool[][] a, bool[][] b);
+bool operator ==(int a, int b);
+bool[] operator ==(int a, int[] b);
+bool[] operator ==(int[] a, int b);
+bool[] operator ==(int[] a, int[] b);
+bool operator ==(int[][] a, int[][] b);
+bool operator ==(real a, real b);
+bool[] operator ==(real a, real[] b);
+bool[] operator ==(real[] a, real b);
+bool[] operator ==(real[] a, real[] b);
+bool operator ==(real[][] a, real[][] b);
+bool operator ==(pair a, pair b);
+bool[] operator ==(pair a, pair[] b);
+bool[] operator ==(pair[] a, pair b);
+bool[] operator ==(pair[] a, pair[] b);
+bool operator ==(pair[][] a, pair[][] b);
+bool operator ==(triple a, triple b);
+bool[] operator ==(triple a, triple[] b);
+bool[] operator ==(triple[] a, triple b);
+bool[] operator ==(triple[] a, triple[] b);
+bool operator ==(triple[][] a, triple[][] b);
+bool operator ==(string a, string b);
+bool[] operator ==(string a, string[] b);
+bool[] operator ==(string[] a, string b);
+bool[] operator ==(string[] a, string[] b);
+bool operator ==(string[][] a, string[][] b);
+bool[] operator ==(pen[] a, pen[] b);
+bool operator ==(pen a, pen b);
+bool operator ==(transform a, transform b);
+bool operator ==(file a, file b);
+bool operator ==(path a, path b);
+bool operator ==(path3 a, path3 b);
+bool operator ==(bool3 a, bool3 b);
+bool operator ==(bounds a, bounds b);
+bool operator ==(node a, node b);
+bool operator ==(side a, side b);
+bool operator ==(coords2 a, coords2 b);
+bool operator ==(light a, light b);
+bool operator ==(coords3 a, coords3 b);
+bool operator ==(processtime a, processtime b);
+bool operator ==(filltype a, filltype b);
+bool operator ==(ScaleT a, ScaleT b);
+bool operator ==(Label a, Label b);
+bool operator ==(schur a, schur b);
+bool operator ==(coord a, coord b);
+bool operator ==(freezableBounds a, freezableBounds b);
+bool operator ==(transformation a, transformation b);
+bool operator ==(pairOrTriple a, pairOrTriple b);
+bool operator ==(marker a, marker b);
+bool operator ==(hsv a, hsv b);
+bool operator ==(scaleT a, scaleT b);
+bool operator ==(cputime a, cputime b);
+bool operator ==(bool3 a, bool b);
+bool operator ==(marginT a, marginT b);
+bool operator ==(Legend a, Legend b);
+bool operator ==(object a, object b);
+bool operator ==(scaling a, scaling b);
+bool operator ==(projection a, projection b);
+bool operator ==(picture a, picture b);
+bool operator ==(align a, align b);
+bool operator ==(arrowhead a, arrowhead b);
+bool operator ==(bool a, bool3 b);
+bool operator ==(slice a, slice b);
+bool operator ==(autoscaleT a, autoscaleT b);
+bool operator ==(position a, position b);
+bool operator ==(realschur a, realschur b);
+bool operator ^(bool a, bool b);
+bool[] operator ^(bool a, bool[] b);
+bool[] operator ^(bool[] a, bool b);
+bool[] operator ^(bool[] a, bool[] b);
+int operator ^(int a, int b);
+int[] operator ^(int a, int[] b);
+int[] operator ^(int[] a, int b);
+int[] operator ^(int[] a, int[] b);
+real operator ^(real a, real b);
+real[] operator ^(real a, real[] b);
+real[] operator ^(real[] a, real b);
+real[] operator ^(real[] a, real[] b);
+pair operator ^(pair a, pair b);
+pair[] operator ^(pair a, pair[] b);
+pair[] operator ^(pair[] a, pair b);
+pair[] operator ^(pair[] a, pair[] b);
+transform operator ^(transform t, int n);
+real operator ^(real x, int y);
+pair operator ^(pair z, int y);
+bool operator |(bool a, bool b);
+bool[] operator |(bool a, bool[] b);
+bool[] operator |(bool[] a, bool b);
+bool[] operator |(bool[] a, bool[] b);
+pen NewCenturySchoolBook(string series=<default>, string shape=<default>);
+void()()[] saveFunctions;
+bool operator &(bool a, bool b);
+bool[] operator &(bool a, bool[] b);
+bool[] operator &(bool[] a, bool b);
+bool[] operator &(bool[] a, bool[] b);
+path operator &(path p, path q);
+path3 operator &(path3 p, path3 q);
+path operator &(path p, cycleToken tok);
string minipage(string s, real width=<default>);
real legendmaxrelativewidth;
real cross(explicit pair z, explicit pair w);
@@ -1281,136 +1843,11 @@ triple[] operator +(triple[] a);
pen operator +(pen a, pen b);
transform operator +(transform a, transform b);
pen operator +(pen p, real w);
-marginT operator +(path, pen)(marginT ma(path, pen), marginT mb(path, pen));
pen[] operator +(pen a, pen[] b);
pen operator +(real w, pen p);
string operator +(... string[] a);
+marginT operator +(path, pen)(marginT ma(path, pen), marginT mb(path, pen));
pen[] operator +(pen[] a, pen b);
-int operator -(int a, int b);
-int[] operator -(int a, int[] b);
-int[] operator -(int[] a, int b);
-int[] operator -(int[] a, int[] b);
-int[][] operator -(int[][] a, int[][] b);
-int operator -(int a);
-int[] operator -(int[] a);
-int[][] operator -(int[][] a);
-real operator -(real a, real b);
-real[] operator -(real a, real[] b);
-real[] operator -(real[] a, real b);
-real[] operator -(real[] a, real[] b);
-real[][] operator -(real[][] a, real[][] b);
-real operator -(real a);
-real[] operator -(real[] a);
-real[][] operator -(real[][] a);
-pair operator -(pair a, pair b);
-pair[] operator -(pair a, pair[] b);
-pair[] operator -(pair[] a, pair b);
-pair[] operator -(pair[] a, pair[] b);
-pair[][] operator -(pair[][] a, pair[][] b);
-pair operator -(pair a);
-pair[] operator -(pair[] a);
-pair[][] operator -(pair[][] a);
-triple operator -(triple a, triple b);
-triple[] operator -(triple a, triple[] b);
-triple[] operator -(triple[] a, triple b);
-triple[] operator -(triple[] a, triple[] b);
-triple[][] operator -(triple[][] a, triple[][] b);
-triple operator -(triple a);
-triple[] operator -(triple[] a);
-triple[][] operator -(triple[][] a);
-bool primitive();
-int operator *(int a, int b);
-int[] operator *(int a, int[] b);
-int[] operator *(int[] a, int b);
-int[] operator *(int[] a, int[] b);
-int[][] operator *(int a, int[][] b);
-int[][] operator *(int[][] a, int b);
-real operator *(real a, real b);
-real[] operator *(real a, real[] b);
-real[] operator *(real[] a, real b);
-real[] operator *(real[] a, real[] b);
-real[][] operator *(real a, real[][] b);
-real[][] operator *(real[][] a, real b);
-pair operator *(pair a, pair b);
-pair[] operator *(pair a, pair[] b);
-pair[] operator *(pair[] a, pair b);
-pair[] operator *(pair[] a, pair[] b);
-pair[][] operator *(pair a, pair[][] b);
-pair[][] operator *(pair[][] a, pair b);
-triple[] operator *(real a, triple[] b);
-triple[][] operator *(real a, triple[][] b);
-triple[] operator *(triple[] a, real b);
-triple[][] operator *(triple[][] a, real b);
-pen operator *(real a, pen b);
-pen operator *(pen a, real b);
-transform operator *(transform a, transform b);
-pair operator *(transform t, pair z);
-path operator *(transform t, path g);
-pen operator *(transform t, pen p);
-frame operator *(transform t, frame f);
-frame operator *(real[][] t, frame f);
-real[] operator *(real[][] a, real[] b);
-real[] operator *(real[] a, real[][] b);
-int[][] operator *(int[][] a, int[][] b);
-real[][] operator *(real[][] a, real[][] b);
-pair[][] operator *(pair[][] a, pair[][] b);
-triple operator *(real[][] t, triple v);
-triple operator *(real x, triple v);
-triple operator *(triple v, real x);
-path3 operator *(real[][] t, path3 g);
-picture operator *(real[][] t, picture orig);
-bounds operator *(transform t, bounds b);
-side operator *(real x, side s);
-Label operator *(real[][] t, Label L);
-path[] operator *(transform t, explicit path[] p);
-picture operator *(transform t, picture orig);
-pair[] operator *(transform t, pair[] z);
-object operator *(transform t, explicit object F);
-Label operator *(transform t, Label L);
-bool operator init();
-int operator init();
-real operator init();
-string operator init();
-pair operator init();
-triple operator init();
-transform operator init();
-guide operator init();
-path operator init();
-path3 operator init();
-pen operator init();
-frame operator init();
-file operator init();
-filltype operator init();
-Legend operator init();
-position operator init();
-schur operator init();
-marginT operator init();
-ScaleT operator init();
-side operator init();
-realschur operator init();
-slice operator init();
-autoscaleT operator init();
-align operator init();
-cputime operator init();
-hsv operator init();
-bounds operator init();
-scaleT operator init();
-arrowhead operator init();
-coords2 operator init();
-coords3 operator init();
-marker operator init();
-scaling operator init();
-light operator init();
-picture operator init();
-coord operator init();
-projection operator init();
-pairOrTriple operator init();
-object operator init();
-bool3 operator init();
-transformation operator init();
-node operator init();
-Label operator init();
-processtime operator init();
real operator cast(int);
pair operator cast(int);
pair operator cast(real);
@@ -1453,31 +1890,31 @@ guide operator cast(cycleToken tok);
guide operator cast(curlSpecifier spec);
guide operator cast(tensionSpecifier t);
guide[] operator cast(path[] g);
-position operator cast(int x);
hsv operator cast(pen p);
-object operator cast(string s);
+align operator cast(pair dir);
bool3[] operator cast(bool[] b);
-position operator cast(real x);
-Label operator cast(string s);
+align operator cast(triple dir);
+object operator cast(Label L);
+Label operator cast(object F);
pair operator cast(pairOrTriple a);
triple operator cast(pairOrTriple a);
-frame operator cast(object F);
+position operator cast(int x);
+object operator cast(string s);
guide[] operator cast(pair[] z);
path[] operator cast(guide[] g);
bool operator cast(bool3 b);
-position operator cast(pair x);
+position operator cast(real x);
+Label operator cast(string s);
path[] operator cast(guide g);
-align operator cast(side side);
-pair operator cast(position P);
-object operator cast(frame f);
+frame operator cast(object F);
path[] operator cast(pair[] z);
path[] operator cast(path p);
+align operator cast(side side);
bool[] operator cast(bool3[] b);
-align operator cast(pair dir);
-object operator cast(Label L);
-Label operator cast(object F);
+position operator cast(pair x);
+pair operator cast(position P);
bool3 operator cast(bool b);
-align operator cast(triple dir);
+object operator cast(frame f);
pen operator cast(hsv hsv);
pen deepred;
bool error(file f);
@@ -1493,554 +1930,98 @@ int operator ecast(real);
int[] operator ecast(real[]);
real[] operator ecast(string[] a);
int[] operator ecast(string[] a);
-pair operator tuple(real x, real y);
-triple operator tuple(real x, real y, real z);
-transform operator tuple(real x, real y, real xx, real xy, real yx, real yy);
-real operator /(real a, real b);
-real[] operator /(real a, real[] b);
-real[] operator /(real[] a, real b);
-real[] operator /(real[] a, real[] b);
-real[][] operator /(real[][] a, real b);
-pair operator /(pair a, pair b);
-pair[] operator /(pair a, pair[] b);
-pair[] operator /(pair[] a, pair b);
-pair[] operator /(pair[] a, pair[] b);
-pair[][] operator /(pair[][] a, pair b);
-triple[] operator /(triple[] a, real b);
-real operator /(int a, int b);
-real[] operator /(int[] a, int b);
-real[] operator /(int a, int[] b);
-real[] operator /(int[] a, int[] b);
-triple operator /(triple v, real x);
-path[] texpath(string s, pen p, bool tex=<default>, bool bbox=<default>);
-path[] texpath(Label L, bool tex=<default>, bool bbox=<default>);
-bool uptodate();
-int operator #(int a, int b);
-int[] operator #(int a, int[] b);
-int[] operator #(int[] a, int b);
-int[] operator #(int[] a, int[] b);
-int operator %(int a, int b);
-int[] operator %(int a, int[] b);
-int[] operator %(int[] a, int b);
-int[] operator %(int[] a, int[] b);
-real operator %(real a, real b);
-real[] operator %(real a, real[] b);
-real[] operator %(real[] a, real b);
-real[] operator %(real[] a, real[] b);
-bool operator ^(bool a, bool b);
-bool[] operator ^(bool a, bool[] b);
-bool[] operator ^(bool[] a, bool b);
-bool[] operator ^(bool[] a, bool[] b);
-int operator ^(int a, int b);
-int[] operator ^(int a, int[] b);
-int[] operator ^(int[] a, int b);
-int[] operator ^(int[] a, int[] b);
-real operator ^(real a, real b);
-real[] operator ^(real a, real[] b);
-real[] operator ^(real[] a, real b);
-real[] operator ^(real[] a, real[] b);
-pair operator ^(pair a, pair b);
-pair[] operator ^(pair a, pair[] b);
-pair[] operator ^(pair[] a, pair b);
-pair[] operator ^(pair[] a, pair[] b);
-transform operator ^(transform t, int n);
-real operator ^(real x, int y);
-pair operator ^(pair z, int y);
-bool operator ==(bool a, bool b);
-bool[] operator ==(bool a, bool[] b);
-bool[] operator ==(bool[] a, bool b);
-bool[] operator ==(bool[] a, bool[] b);
-bool operator ==(bool[][] a, bool[][] b);
-bool operator ==(int a, int b);
-bool[] operator ==(int a, int[] b);
-bool[] operator ==(int[] a, int b);
-bool[] operator ==(int[] a, int[] b);
-bool operator ==(int[][] a, int[][] b);
-bool operator ==(real a, real b);
-bool[] operator ==(real a, real[] b);
-bool[] operator ==(real[] a, real b);
-bool[] operator ==(real[] a, real[] b);
-bool operator ==(real[][] a, real[][] b);
-bool operator ==(pair a, pair b);
-bool[] operator ==(pair a, pair[] b);
-bool[] operator ==(pair[] a, pair b);
-bool[] operator ==(pair[] a, pair[] b);
-bool operator ==(pair[][] a, pair[][] b);
-bool operator ==(triple a, triple b);
-bool[] operator ==(triple a, triple[] b);
-bool[] operator ==(triple[] a, triple b);
-bool[] operator ==(triple[] a, triple[] b);
-bool operator ==(triple[][] a, triple[][] b);
-bool operator ==(string a, string b);
-bool[] operator ==(string a, string[] b);
-bool[] operator ==(string[] a, string b);
-bool[] operator ==(string[] a, string[] b);
-bool operator ==(string[][] a, string[][] b);
-bool[] operator ==(pen[] a, pen[] b);
-bool operator ==(pen a, pen b);
-bool operator ==(transform a, transform b);
-bool operator ==(file a, file b);
-bool operator ==(path a, path b);
-bool operator ==(path3 a, path3 b);
-bool operator ==(bool3 a, bool3 b);
-bool operator ==(freezableBounds a, freezableBounds b);
-bool operator ==(transformation a, transformation b);
-bool operator ==(node a, node b);
-bool operator ==(Label a, Label b);
-bool operator ==(processtime a, processtime b);
-bool operator ==(coords2 a, coords2 b);
-bool operator ==(coords3 a, coords3 b);
-bool operator ==(marker a, marker b);
-bool operator ==(marginT a, marginT b);
-bool operator ==(ScaleT a, ScaleT b);
-bool operator ==(side a, side b);
-bool operator ==(realschur a, realschur b);
-bool operator ==(coord a, coord b);
-bool operator ==(projection a, projection b);
-bool operator ==(pairOrTriple a, pairOrTriple b);
-bool operator ==(object a, object b);
-bool operator ==(hsv a, hsv b);
-bool operator ==(bounds a, bounds b);
-bool operator ==(scaleT a, scaleT b);
-bool operator ==(arrowhead a, arrowhead b);
-bool operator ==(bool3 a, bool b);
-bool operator ==(filltype a, filltype b);
-bool operator ==(Legend a, Legend b);
-bool operator ==(position a, position b);
-bool operator ==(schur a, schur b);
-bool operator ==(scaling a, scaling b);
-bool operator ==(light a, light b);
-bool operator ==(picture a, picture b);
-bool operator ==(bool a, bool3 b);
-bool operator ==(slice a, slice b);
-bool operator ==(autoscaleT a, autoscaleT b);
-bool operator ==(align a, align b);
-bool operator ==(cputime a, cputime b);
-bool operator !=(bool a, bool b);
-bool[] operator !=(bool a, bool[] b);
-bool[] operator !=(bool[] a, bool b);
-bool[] operator !=(bool[] a, bool[] b);
-bool operator !=(bool[][] a, bool[][] b);
-bool operator !=(int a, int b);
-bool[] operator !=(int a, int[] b);
-bool[] operator !=(int[] a, int b);
-bool[] operator !=(int[] a, int[] b);
-bool operator !=(int[][] a, int[][] b);
-bool operator !=(real a, real b);
-bool[] operator !=(real a, real[] b);
-bool[] operator !=(real[] a, real b);
-bool[] operator !=(real[] a, real[] b);
-bool operator !=(real[][] a, real[][] b);
-bool operator !=(pair a, pair b);
-bool[] operator !=(pair a, pair[] b);
-bool[] operator !=(pair[] a, pair b);
-bool[] operator !=(pair[] a, pair[] b);
-bool operator !=(pair[][] a, pair[][] b);
-bool operator !=(triple a, triple b);
-bool[] operator !=(triple a, triple[] b);
-bool[] operator !=(triple[] a, triple b);
-bool[] operator !=(triple[] a, triple[] b);
-bool operator !=(triple[][] a, triple[][] b);
-bool operator !=(string a, string b);
-bool[] operator !=(string a, string[] b);
-bool[] operator !=(string[] a, string b);
-bool[] operator !=(string[] a, string[] b);
-bool operator !=(string[][] a, string[][] b);
-bool[] operator !=(pen[] a, pen[] b);
-bool operator !=(pen a, pen b);
-bool operator !=(transform a, transform b);
-bool operator !=(file a, file b);
-bool operator !=(path a, path b);
-bool operator !=(path3 a, path3 b);
-bool operator !=(bool3 a, bool3 b);
-bool operator !=(freezableBounds a, freezableBounds b);
-bool operator !=(transformation a, transformation b);
-bool operator !=(node a, node b);
-bool operator !=(Label a, Label b);
-bool operator !=(processtime a, processtime b);
-bool operator !=(coords2 a, coords2 b);
-bool operator !=(coords3 a, coords3 b);
-bool operator !=(marker a, marker b);
-bool operator !=(marginT a, marginT b);
-bool operator !=(ScaleT a, ScaleT b);
-bool operator !=(side a, side b);
-bool operator !=(realschur a, realschur b);
-bool operator !=(coord a, coord b);
-bool operator !=(projection a, projection b);
-bool operator !=(pairOrTriple a, pairOrTriple b);
-bool operator !=(object a, object b);
-bool operator !=(hsv a, hsv b);
-bool operator !=(bounds a, bounds b);
-bool operator !=(scaleT a, scaleT b);
-bool operator !=(arrowhead a, arrowhead b);
-bool operator !=(bool3 a, bool b);
-bool operator !=(filltype a, filltype b);
-bool operator !=(Legend a, Legend b);
-bool operator !=(position a, position b);
-bool operator !=(schur a, schur b);
-bool operator !=(scaling a, scaling b);
-bool operator !=(light a, light b);
-bool operator !=(picture a, picture b);
-bool operator !=(bool a, bool3 b);
-bool operator !=(slice a, slice b);
-bool operator !=(autoscaleT a, autoscaleT b);
-bool operator !=(align a, align b);
-bool operator !=(cputime a, cputime b);
-bool operator <(int a, int b);
-bool[] operator <(int a, int[] b);
-bool[] operator <(int[] a, int b);
-bool[] operator <(int[] a, int[] b);
-bool operator <(real a, real b);
-bool[] operator <(real a, real[] b);
-bool[] operator <(real[] a, real b);
-bool[] operator <(real[] a, real[] b);
-bool operator <(string a, string b);
-bool[] operator <(string a, string[] b);
-bool[] operator <(string[] a, string b);
-bool[] operator <(string[] a, string[] b);
-bool operator <=(int a, int b);
-bool[] operator <=(int a, int[] b);
-bool[] operator <=(int[] a, int b);
-bool[] operator <=(int[] a, int[] b);
-bool operator <=(real a, real b);
-bool[] operator <=(real a, real[] b);
-bool[] operator <=(real[] a, real b);
-bool[] operator <=(real[] a, real[] b);
-bool operator <=(string a, string b);
-bool[] operator <=(string a, string[] b);
-bool[] operator <=(string[] a, string b);
-bool[] operator <=(string[] a, string[] b);
-bool operator <=(coord a, coord b);
-void srand(int seed);
-bool operator >(int a, int b);
-bool[] operator >(int a, int[] b);
-bool[] operator >(int[] a, int b);
-bool[] operator >(int[] a, int[] b);
-bool operator >(real a, real b);
-bool[] operator >(real a, real[] b);
-bool[] operator >(real[] a, real b);
-bool[] operator >(real[] a, real[] b);
-bool operator >(string a, string b);
-bool[] operator >(string a, string[] b);
-bool[] operator >(string[] a, string b);
-bool[] operator >(string[] a, string[] b);
-bool operator >=(int a, int b);
-bool[] operator >=(int a, int[] b);
-bool[] operator >=(int[] a, int b);
-bool[] operator >=(int[] a, int[] b);
-bool operator >=(real a, real b);
-bool[] operator >=(real a, real[] b);
-bool[] operator >=(real[] a, real b);
-bool[] operator >=(real[] a, real[] b);
-bool operator >=(string a, string b);
-bool[] operator >=(string a, string[] b);
-bool[] operator >=(string[] a, string b);
-bool[] operator >=(string[] a, string[] b);
-bool operator >=(coord a, coord b);
-filltype UnFill(real xmargin=<default>, real ymargin=<default>);
-filltype UnFill;
-real degrees(pair z, bool warn=<default>);
-real degrees(real radians);
-bool[] operator !(bool[] a);
-bool operator !(bool b);
-path[] operator ^^(path p, path q);
-path[] operator ^^(explicit path[] p, path q);
-path[] operator ^^(path p, explicit path[] q);
-path[] operator ^^(explicit path[] p, explicit path[] q);
-guide operator ::(... guide[]);
-pen Helvetica(string series=<default>, string shape=<default>);
-transform reflect(pair a, pair b);
-bool Bars(picture, path, pen, marginT(path, pen));
-bool Bars(picture, path, pen, marginT(path, pen))(real size=<default>);
-void none(file file);
-int factorial(int n);
-real log(real x);
-real[] log(real[] a);
-pair log(explicit pair z);
-guide operator ..(... guide[]);
-guide operator ..(... guide[])(tensionSpecifier t);
-path polygon(int n);
-guide operator --(... guide[]);
-guide operator ---(... guide[]);
-pen NewCenturySchoolBook(string series=<default>, string shape=<default>);
-void()()[] saveFunctions;
-bool operator &(bool a, bool b);
-bool[] operator &(bool a, bool[] b);
-bool[] operator &(bool[] a, bool b);
-bool[] operator &(bool[] a, bool[] b);
-path operator &(path p, path q);
-path3 operator &(path3 p, path3 q);
-path operator &(path p, cycleToken tok);
-bool operator |(bool a, bool b);
-bool[] operator |(bool a, bool[] b);
-bool[] operator |(bool[] a, bool b);
-bool[] operator |(bool[] a, bool[] b);
-string texify(string s);
-guide operator controls(pair zout, pair zin);
-guide operator controls(pair z);
-bool empty(frame f);
-tensionSpecifier operator tension(real tout, real tin, bool atleast);
-tensionSpecifier operator tension(real t, bool atLeast);
-void end(picture pic=<default>);
-curlSpecifier operator curl(real gamma, int p);
-guide operator spec(pair z, int p);
-string substr(string s, int pos, int n=<default>);
-pen paleyellow;
-file output(string name=<default>, bool update=<default>, string comment=<default>, string mode=<default>);
-pen ZapfDingbats(string series=<default>, string shape=<default>);
-real tanh(real x);
-real[] tanh(real[] a);
-real interp(real a, real b, real t);
-pair interp(explicit pair a, explicit pair b, real t);
-triple interp(triple a, triple b, real t);
-pen interp(pen a, pen b, real t);
-void mapArray(string From, string To);
-frame Seascape(frame f);
-bool interior(int windingnumber, pen fillrule);
-real[] intersect(path p, path q, real fuzz=<default>);
-real[] intersect(path3 p, path3 q, real fuzz=<default>);
-real[] intersect(path3 p, triple[][] p, real fuzz=<default>);
-bool interactive();
-string mapArrayString(string From, string To);
-real[][] intersections(path p, path q, real fuzz=<default>);
-real[] intersections(path p, explicit pair a, explicit pair b, real fuzz=<default>);
-real[][] intersections(path3 p, path3 q, real fuzz=<default>);
-real[][] intersections(path3 p, triple[][] p, real fuzz=<default>);
-int animate(string args=<default>, string file=<default>, string format=<default>);
-void generate_random_backtrace();
-real RELEASE;
-pair intersectionpoint(path p, path q, real fuzz=<default>);
-pair[] intersectionpoints(path p, path q, real fuzz=<default>);
-pair[] intersectionpoints(explicit path[] p, explicit path[] q, real fuzz=<default>);
-void asy(string format, bool overwrite=<default> ... string[] s);
-bool latex();
-bool adjust(pen p);
-pen adjust(pen p, real arclength, bool cyclic);
-pair Align;
-void exit();
-real[] uniform(real a, real b, int n);
-pair viewportsize;
-pair viewportmargin;
-string VERSION;
-real insphere(triple a, triple b, triple c, triple d, triple e);
-void drawSphere(frame f, real[][] t, bool half=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, int type);
-void filldraw(picture pic=<default>, path[] g, pen fillpen=<default>, pen drawpen=<default>);
-void filldraw(frame f, path[] g, pen fillpen=<default>, pen drawpen=<default>);
-real dot(real[] a, real[] b);
-pair dot(pair[] a, pair[] b);
-real dot(explicit pair z, explicit pair w);
-real dot(triple u, triple v);
-marker dot(pen p=<default>, filltype filltype=<default>);
-void dot(picture pic=<default>, pair z, pen p=<default>, filltype filltype=<default>);
-void dot(frame f, pair z, pen p=<default>, filltype filltype=<default>);
-void dot(picture pic=<default>, Label L, pen p=<default>, filltype filltype=<default>);
-void dot(picture pic=<default>, Label[] L=<default>, pair[] z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
-void dot(picture pic=<default>, path[] g, pen p=<default>, filltype filltype=<default>);
-marker dot;
-void dot(picture pic=<default>, Label L, pair z, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
-void dot(picture pic=<default>, Label[] L=<default>, explicit path g, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
-void list(string s, bool imports=<default>);
-pair NNW;
-string phantom(string s);
-void atexit(void f());
-void atexit()();
-real getreal(string name=<default>, real default=<default>, string prompt=<default>, bool store=<default>);
-int convert(string args=<default>, string file=<default>, string format=<default>);
-pair WNW;
-pen palegray;
-pen palegreen;
-pen palegrey;
-void clip(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
-void clip(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, bool copy=<default>);
-marginT Margin(path, pen)(real begin, real end=<default>);
-marginT Margin(path, pen);
-position Relative(real position);
-side Relative(explicit pair align);
-marginT Margins(path, pen);
-pair truepoint(picture pic=<default>, pair dir, bool user=<default>);
-real arclength(path p);
-real arclength(pair z0, pair c0, pair c1, pair z1);
-real arclength(path3 p);
-real arclength(triple z0, triple c0, triple c1, triple z1);
-bool finite(real x);
-bool finite(pair z);
-bool finite(triple v);
-void updatefunction();
-bool implicitshipout;
-void _draw(frame f, path g, pen p);
-void _draw(frame f, path3 g, triple center=<default>, pen[] p, real opacity, real shininess, real metallic, real fresnel0, int interaction=<default>);
-void _draw(picture pic, path g, pen p, marginT margin(path, pen));
-frame align(frame f, pair align);
-object align(object F, pair align);
-path[] align(path[] g, transform t=<default>, pair position, pair align, pen p=<default>);
-real unitrand();
-string[] history(string name, int n=<default>);
-string[] history(int n=<default>);
-coord[] maxcoords(coord[] in, bool operator <=(coord, coord));
-pen AvantGarde(string series=<default>, string shape=<default>);
-frame enclose(string prefix=<default>, object F, string format=<default>);
-int count;
-real atan2(real y, real x);
-bool inside(explicit path[] g, pair z, pen fillrule=<default>);
-bool inside(path g, pair z, pen fillrule=<default>);
-int inside(path p, path q, pen fillrule=<default>);
-pair inside(path p, pen fillrule=<default>);
-pair rectify(pair dir);
-arrowhead TeXHead;
-bool initialized(int a);
-bool initialized(real a);
-bool initialized(pair a);
-bool initialized(triple a);
-path[] margin(path[] g, real xmargin, real ymargin);
-pair relative(picture pic=<default>, pair z);
-real erfc(real x);
-int windingnumber(path[] p, pair z);
-real expansionfactor;
-void addArrow(picture pic, arrowhead arrowhead, path g, pen p, real size, real angle, filltype filltype, real position);
-void exitfunction();
-pen gray(pen p);
-pen gray(real gray);
-pen gray;
-real relativedistance(real theta, real phi, real t, bool atleast);
-path circle(pair c, real r);
-void overloadedMessage(file file);
-pen deepmagenta;
-real circlescale;
-string math(string s);
-real circleprecision;
-int Allow;
-real determinant(real[][] a);
-void functionshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader=<default>, bool copy=<default>);
-void functionshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, string shader, bool copy=<default>);
-pen red;
-pair[] dirSpecifier(guide g, int t);
-void abort(string s=<default>);
-bool Aspect;
-string hex(pen p);
-int hex(string s);
-void deactivatequote(picture pic=<default>);
-path brace(pair a, pair b, real amplitude=<default>);
-string format(string format, int x, string locale=<default>);
-string format(string format, bool forcemath=<default>, string separator, real x, string locale=<default>);
-string format(string format=<default>, bool forcemath=<default>, real x, string locale=<default>);
-real[][][] _schur(real[][] a);
-pair[][][] _schur(pair[][] a);
-real expm1(real x);
-real[] expm1(real[] a);
-void activatequote(picture pic=<default>);
-int undefined;
-transform zeroTransform;
-string ask(string prompt);
-frame[] fit2(picture[] pictures, picture all);
-pen linecap(int n);
-int linecap(pen p=<default>);
-string outname();
-void newpage(frame f);
-void newpage(picture pic=<default>);
-pen fontcommand(string s);
-real bracemidangle;
-pair accel(path p, int t, int sign=<default>);
-pair accel(path p, real t);
-triple accel(path3 p, int t, int sign=<default>);
-triple accel(path3 p, real t);
-frame Portrait(frame f);
-real braceinnerangle;
-real braceouterangle;
-void tex(frame f, string s);
-void tex(frame f, string s, pair min, pair max);
-void tex(picture pic=<default>, string s);
-void tex(picture pic=<default>, string s, pair min, pair max);
-real bracedefaultratio;
-bool prconly(string format=<default>);
-pen Black;
-triple size3(frame f);
-void size3(picture pic=<default>, real x, real y=<default>, real z=<default>, bool keepAspect=<default>);
-bool eof(file f);
-frame dotframe;
-frame dotframe(pen p=<default>, filltype filltype=<default>);
-real realMax;
-pair NE;
-real realMin;
-realschur schur(real[][] a);
-schur schur(pair[][] a);
-path nib(pen p);
-file _outpipe;
-void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>);
-void gouraudshade(frame f, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>);
-void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, pair[] z, int[] edges, bool copy=<default>);
-void gouraudshade(picture pic=<default>, path[] g, bool stroke=<default>, pen fillrule=<default>, pen[] p, int[] edges, bool copy=<default>);
-pair[] fft(pair[] a, int sign=<default>);
-pair[][] fft(pair[][] a, int sign=<default>);
-pair[][][] fft(pair[][][] a, int sign=<default>);
-pair SE;
-pen nobasealign;
-sCAD operator init();
+bool operator init();
+int operator init();
+real operator init();
+string operator init();
+pair operator init();
+triple operator init();
+transform operator init();
+guide operator init();
+path operator init();
+path3 operator init();
+pen operator init();
+frame operator init();
+file operator init();
+marginT operator init();
+Legend operator init();
+object operator init();
+filltype operator init();
+ScaleT operator init();
+Label operator init();
+schur operator init();
+slice operator init();
+autoscaleT operator init();
+position operator init();
+realschur operator init();
+hsv operator init();
+scaleT operator init();
+cputime operator init();
+coords2 operator init();
+light operator init();
+coords3 operator init();
+processtime operator init();
+scaling operator init();
+projection operator init();
+picture operator init();
+align operator init();
+arrowhead operator init();
+coord operator init();
+transformation operator init();
+pairOrTriple operator init();
+marker operator init();
+bool3 operator init();
+bounds operator init();
+node operator init();
+side operator init();
real animationdelay;
-animation operator init();
frame NoBox(frame f);
+animation operator init();
frame BBox(frame)(real xmargin=<default>, real ymargin=<default>, pen p=<default>, filltype filltype=<default>);
void annotate(picture pic=<default>, string title, string text, pair position);
void babel(string s);
-path removeDuplicates(path p);
-path uncycle(path p, real t);
-path[] bezulate(path[] p);
+bool isDuplicate(pair a, pair b, real relSize);
+real maxrefinements;
real[][] intersections(pair a, pair b, path p);
+path[] bezulate(path[] p);
+path[][] containmentTree(path[] paths);
+path section(path p, real t1, real t2, bool loop=<default>);
+path removeDuplicates(path p);
void connect(path[] paths, path[] result, path[] patch);
-int countIntersections(path[] p, pair start, pair end);
real duplicateFuzz;
-path subdivide(path p);
-bool isDuplicate(pair a, pair b, real relSize);
+int countIntersections(path[] p, pair start, pair end);
bool checkSegment(path g, pair p, pair q);
-path section(path p, real t1, real t2, bool loop=<default>);
+path uncycle(path p, real t);
+path subdivide(path p);
real fuzz;
-real maxrefinements;
-path[][] containmentTree(path[] paths);
-binarytree searchtree(... int[] keys);
-object draw(picture pic=<default>, binarytreeNode node, pair pos, int height, real minDist, real levelDist, real nodeDiameter, pen p=<default>, bool condensed=<default>);
-void draw(picture pic=<default>, binarytree tree, real minDist=<default>, real nodeMargin=<default>, pen p=<default>, bool condensed=<default>);
-real nodeMarginDefault;
-key key(int n, bool active=<default>);
-binarytree binarytree(... key[] keys);
-binarytreeNode binarytreeNode(int key);
key nil;
real minDistDefault;
+binarytreeNode binarytreeNode(int key);
+real nodeMarginDefault;
binarytreeNode operator init();
key operator init();
binarytree operator init();
key operator cast(int n);
int operator cast(key k);
int[] operator cast(key[] k);
-line intersection(face a, face b);
+binarytree searchtree(... int[] keys);
+key key(int n, bool active=<default>);
+binarytree binarytree(... key[] keys);
+object draw(picture pic=<default>, binarytreeNode node, pair pos, int height, real minDist, real levelDist, real nodeDiameter, pen p=<default>, bool condensed=<default>);
+void draw(picture pic=<default>, binarytree tree, real minDist=<default>, real nodeMargin=<default>, pen p=<default>, bool condensed=<default>);
real epsilon;
+line intersection(face a, face b);
+picture operator cast(face f);
+face operator cast(path3 p);
splitface split(face a, face cut, projection P);
+void add(picture pic=<default>, face[] faces, projection P=<default>);
face operator init();
line operator init();
half operator init();
splitface operator init();
bsp operator init();
-picture operator cast(face f);
-face operator cast(path3 p);
-void add(picture pic=<default>, face[] faces, projection P=<default>);
-segment case1(pair p0, pair p1, int edge);
-void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen[] p);
-void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen p=<default>);
-pen[][] interior(picture pic=<default>, guide[][] g, pen[] palette);
-pen[] extend(pen[] palette, pen below, pen above);
-guide[][] connect(picture pic, pair[][][] points, real[] c, guide join(... guide[]));
-segment case2(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge);
-void collect(pair[][][] points, real[] c);
-segment case3(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge=<default>);
-segment checktriangle(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge=<default>);
-segment operator init();
-void addseg(pair[][] gds, segment seg);
-void fill(picture pic=<default>, guide[][] g, pen[][] palette);
-guide[][] contour(picture pic=<default>, pair[][] z, real[][] f, real[][] midpoint=<default>, real[] c, guide join(... guide[])=<default>);
-guide[][] contour(picture pic=<default>, real[][] f, real[][] midpoint=<default>, pair a, pair b, real[] c, guide join(... guide[])=<default>);
-guide[][] contour(picture pic=<default>, real f(real, real), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>);
-guide[][] contour(picture pic=<default>, real f(pair), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>);
-guide[][] contour(picture pic=<default>, pair[] z, real[] f, real[] c, guide join(... guide[])=<default>);
+sCAD operator init();
real eps;
-surface surface(vertex[][] g);
weighted operator init();
bucket operator init();
vertex operator init();
@@ -2048,118 +2029,360 @@ object operator init();
vertex[][] contour3(triple[][][] v, real[][][] f, real[][][] midpoint=<default>, projection P=<default>);
vertex[][] contour3(real[][][] f, real[][][] midpoint=<default>, triple a, triple b, projection P=<default>);
vertex[][] contour3(real f(real, real, real), triple a, triple b, int nx=<default>, int ny=<default>, int nz=<default>, projection P=<default>);
+surface surface(vertex[][] g);
+segment case3(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge=<default>);
+segment case1(pair p0, pair p1, int edge);
real eps;
-void draw(TreeNode root, pair pos);
-real treeNodeStep;
+segment case2(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge);
+pen[][] interior(picture pic=<default>, guide[][] g, pen[] palette);
+segment checktriangle(pair p0, pair p1, pair p2, real v0, real v1, real v2, int edge=<default>);
+segment operator init();
+guide[][] contour(picture pic=<default>, pair[][] z, real[][] f, real[][] midpoint=<default>, real[] c, guide join(... guide[])=<default>);
+guide[][] contour(picture pic=<default>, real[][] f, real[][] midpoint=<default>, pair a, pair b, real[] c, guide join(... guide[])=<default>);
+guide[][] contour(picture pic=<default>, real f(real, real), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>);
+guide[][] contour(picture pic=<default>, real f(pair), pair a, pair b, real[] c, int nx=<default>, int ny=<default>, guide join(... guide[])=<default>);
+guide[][] contour(picture pic=<default>, pair[] z, real[] f, real[] c, guide join(... guide[])=<default>);
+void addseg(pair[][] gds, segment seg);
+void collect(pair[][][] points, real[] c);
+void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen[] p);
+void draw(picture pic=<default>, Label[] L=<default>, guide[][] g, pen p=<default>);
+guide[][] connect(picture pic, pair[][][] points, real[] c, guide join(... guide[]));
+void fill(picture pic=<default>, guide[][] g, pen[][] palette);
+pen[] extend(pen[] palette, pen below, pen above);
void drawAll(TreeNode node, frame f);
real layout(int level, TreeNode node);
-TreeNode operator init();
-void add(TreeNode child, TreeNode parent);
-real treeLevelStep;
real treeMinNodeWidth;
+real treeLevelStep;
TreeNode makeNode(TreeNode parent=<default>, frame f);
TreeNode makeNode(TreeNode parent=<default>, Label label);
-string link(string label, string text=<default>);
+void add(TreeNode child, TreeNode parent);
+void draw(TreeNode root, pair pos);
+TreeNode operator init();
+real treeNodeStep;
string embed(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>);
-string embedplayer(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>);
string link(string label, string text=<default>);
-string embed(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>, string image=<default>);
+string embedplayer(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>);
string hyperlink(string url, string text);
-real gluonratio;
-real gluonamplitude;
-void drawGluon(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
-void drawGhost(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
-void drawVertex(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
-void drawVertexO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
+string embed(string name, string text=<default>, string options=<default>, real width=<default>, real height=<default>, string image=<default>);
+string link(string label, string text=<default>);
+void texshipout(string stem, picture pic=<default>, bool xalign=<default>);
+void fmdefaults();
+void drawMomArrow(picture pic=<default>, path p, align align, position pos=<default>, real offset=<default>, real length=<default>, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real margin=<default>);
+void drawVertexOX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
void drawVertexX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
-void drawVertexBox(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
+bool XYAlign;
void drawVertexBoxO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
-void drawVertexOX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
-void drawVertexTriangle(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
+void drawVertexBox(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
void drawVertexTriangleO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
+void drawVertexTriangle(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
+void drawVertexO(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
+void drawVertex(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>);
+void drawGhost(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
+void drawFermion(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
+void drawPhoton(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
+void drawGluon(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
+path momArrowPath(path p, align align, position pos, real offset=<default>, real length=<default>);
+path photon(path p, real amp=<default>, real width=<default>);
void drawVertexBoxX(picture pic=<default>, pair xy, real r=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>);
+path gluon(path p, real amp=<default>, real width=<default>);
+string includegraphicscommand;
+real momarrowoffset;
pen doublelinepen;
-real doublelinespacing;
-void do_overpaint(picture pic, path p, pen bgpen, real halfwidth, real vertexangle);
-void texshipout(string stem, picture pic=<default>, bool xalign=<default>);
-bool XYAlign;
+real momarrowsize(pen p=<default>);
void drawDoubleLine(picture pic=<default>, path p, pen fgpen=<default>, real dlspacing=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
-void drawScalar(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
-bool overpaint;
-path photon(path p, real amp=<default>, real width=<default>);
pen photonpen;
-real photonratio;
-real photonamplitude;
-string includegraphicscommand;
-pen momarrowpen;
-real momarrowsize(pen p=<default>);
-real momarrowlength;
-real momarrowoffset;
-real momarrowmargin;
-real momarrowfactor;
+bool overpaint;
+real gluonratio;
pen vertexpen;
+bool currentmomarrow(picture, path, pen, marginT(path, pen));
+real linemargin;
+real bigvertexsize;
+void do_overpaint(picture pic, path p, pen bgpen, real halfwidth, real vertexangle);
+bool currentarrow(picture, path, pen, marginT(path, pen));
real vertexsize;
-path momArrowPath(path p, align align, position pos, real offset=<default>, real length=<default>);
-void drawPhoton(picture pic=<default>, path p, real amp=<default>, real width=<default>, pen fgpen=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
bool YAlign;
+pen momarrowpen;
+pen bigvertexpen;
+real gluonamplitude;
+real photonratio;
+real photonamplitude;
pen backgroundpen;
-pen scalarpen;
+void drawScalar(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
+pen gluonpen;
pen fermionpen;
-pen bigvertexpen;
-real bigvertexsize;
-real minvertexangle;
+pen scalarpen;
pen ghostpen;
-void drawMomArrow(picture pic=<default>, path p, align align, position pos=<default>, real offset=<default>, real length=<default>, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real margin=<default>);
-void fmdefaults();
-real linemargin;
-void drawFermion(picture pic=<default>, path p, pen fgpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool erasebg=<default>, pen bgpen=<default>, real vertexangle=<default>, real margin=<default>);
-bool currentarrow(picture, path, pen, marginT(path, pen));
-bool currentmomarrow(picture, path, pen, marginT(path, pen));
+real doublelinespacing;
+real minvertexangle;
+real momarrowlength;
+real momarrowmargin;
+real momarrowfactor;
bool appendsuffix;
-path gluon(path p, real amp=<default>, real width=<default>);
-pen gluonpen;
+Dir Down;
+Dir Up;
Dir Left;
+Dir Right;
+block blockconnector(block, block)(picture pic, transform t, pen p=<default>, marginT margin(path, pen)=<default>);
+path path(pair[] point ... flowdir[] dir);
+block bevel(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dh=<default>, real dw=<default>, real minwidth=<default>, real minheight=<default>);
block roundrectangle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real ds=<default>, real dw=<default>, real minwidth=<default>, real minheight=<default>);
-block diamond(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real ds=<default>, real dw=<default>, real height=<default>, real minwidth=<default>, real minheight=<default>);
-void draw(picture pic=<default>, block block, pen p=<default>);
-real minblockwidth;
-real minblockheight;
+block parallelogram(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real slope=<default>, real minwidth=<default>, real minheight=<default>);
real defaultexcursion;
-path path(pair[] point ... flowdir[] dir);
-Dir Up;
+real minblockheight;
+real minblockwidth;
+flowdir Horizontal;
+block operator --(block b1, Label label);
+block operator --(block b1, Dir dir);
+block operator --(block b, bool arrowbar(picture, path, pen, marginT(path, pen)));
+void draw(picture pic=<default>, block block, pen p=<default>);
real mincirclediameter;
flowdir Vertical;
-block rectangle(object header, object body, pair center=<default>, pen headerpen=<default>, pen bodypen=<default>, pen drawpen=<default>, real dx=<default>, real minheaderwidth=<default>, real minheaderheight=<default>, real minbodywidth=<default>, real minbodyheight=<default>);
-block rectangle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real minwidth=<default>, real minheight=<default>);
-block parallelogram(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real slope=<default>, real minwidth=<default>, real minheight=<default>);
-block blockconnector(block, block)(picture pic, transform t, pen p=<default>, marginT margin(path, pen)=<default>);
block circle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dr=<default>, real mindiameter=<default>);
flowdir operator init();
block operator init();
Dir operator init();
-block operator --(block b1, Label label);
-block operator --(block b1, Dir dir);
-block operator --(block b, bool arrowbar(picture, path, pen, marginT(path, pen)));
-flowdir Horizontal;
-block bevel(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dh=<default>, real dw=<default>, real minwidth=<default>, real minheight=<default>);
-Dir Right;
-Dir Down;
-int[] numarray;
-point midpoint(segment s);
-point midpoint(side side);
-point isotomicconjugate(triangle t, point M);
-bool Finite(explicit point z);
-real rd(real x, real y, real z);
-point circumcenter(point A, point B, point C);
-point circumcenter(triangle t);
-circle circumcircle(point A, point B, point C);
-circle circumcircle(triangle t);
-line altitude(vertex V);
-line altitude(side side);
-point isogonalconjugate(triangle t, point M);
+block diamond(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real ds=<default>, real dw=<default>, real height=<default>, real minwidth=<default>, real minheight=<default>);
+block rectangle(object header, object body, pair center=<default>, pen headerpen=<default>, pen bodypen=<default>, pen drawpen=<default>, real dx=<default>, real minheaderwidth=<default>, real minheaderheight=<default>, real minbodywidth=<default>, real minbodyheight=<default>);
+block rectangle(object body, pair center=<default>, pen fillpen=<default>, pen drawpen=<default>, real dx=<default>, real minwidth=<default>, real minheight=<default>);
+line tangent(circle c, abscissa x);
+line tangent(circle c, point M);
+line tangent(circle c, explicit vector v);
+line tangent(ellipse el, abscissa x);
+line tangent(parabola p, abscissa x);
+line tangent(hyperbola h, abscissa x);
+line tangent(explicit arc a, abscissa x);
+line tangent(explicit arc a, point M);
+point radicalcenter(circle c1, circle c2);
+point radicalcenter(circle c1, circle c2, circle c3);
+inversion inversion(circle c1, circle c2, real sgn=<default>);
+inversion inversion(circle c1, circle c2, circle c3);
+inversion inversion(circle c);
+triangle anticomplementary(triangle t);
+triangle symmedial(triangle t);
+triangle orthic(triangle t);
+line median(vertex V);
+line median(side side);
+point intouch(side side);
+triangle intouch(triangle t);
+triangle incentral(triangle t);
+triangle antipedal(triangle t, point M);
point isogonal(side side, point M);
line isogonal(vertex V, point M);
triangle isogonal(triangle t, point M);
+point isogonalconjugate(triangle t, point M);
+point[] fermat(triangle t);
+point gergonne(triangle t);
+triangle cevian(triangle t, point P);
+point cevian(side side, point P);
+line cevian(vertex V, point P);
+point symmedian(triangle t);
+point symmedian(side side);
+line symmedian(vertex V);
+trilinear trilinear(triangle t, real a, real b, real c);
+trilinear trilinear(triangle t, point M);
+trilinear trilinear(triangle t, real f(real, real, real), real a=<default>, real b=<default>, real c=<default>);
+point foot(vertex V);
+point foot(side side);
+triangle triangleabc(real a, real b, real c, real angle=<default>, point A=<default>);
+circle excircle(point A, point B, point C);
+circle excircle(side side);
+real exradius(point A, point B, point C);
+real exradius(side side);
+point excenter(point A, point B, point C);
+point excenter(side side);
+circle incircle(point A, point B, point C);
+circle incircle(triangle t);
+real inradius(point A, point B, point C);
+real inradius(triangle t);
+point orthocenter(point A, point B, point C);
+point orthocenter(triangle t);
+mass masscenter(... mass[] M);
+int arcnodesnumber(explicit arc a);
+point curpoint(line l, real x);
+point curpoint(explicit circle c, real x);
+point curpoint(explicit ellipse el, real x);
+point curpoint(explicit parabola p, real x);
+point curpoint(conic co, real x);
+point curpoint(arc a, real x);
+abscissa nodabscissa(real x);
+abscissa nodabscissa(int x);
+abscissa nodabscissa(line l, point M);
+abscissa nodabscissa(circle c, point M);
+abscissa nodabscissa(ellipse el, point M);
+abscissa nodabscissa(parabola p, point M);
+abscissa nodabscissa(conic co, point M);
+abscissa nodabscissa(arc a, point M);
+abscissa angabscissa(real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+abscissa angabscissa(int x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+abscissa angabscissa(circle c, point M);
+abscissa angabscissa(ellipse el, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+abscissa angabscissa(hyperbola h, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+abscissa angabscissa(parabola p, point M);
+abscissa angabscissa(explicit conic co, point M);
+abscissa angabscissa(arc a, point M);
+abscissa curabscissa(real x);
+abscissa curabscissa(int x);
+abscissa curabscissa(line l, point M);
+abscissa curabscissa(circle c, point M);
+abscissa curabscissa(ellipse el, point M);
+abscissa curabscissa(parabola p, point M);
+abscissa curabscissa(conic co, point M);
+abscissa curabscissa(arc a, point M);
+abscissa relabscissa(real x);
+abscissa relabscissa(int x);
+abscissa relabscissa(line l, point M);
+abscissa relabscissa(circle c, point M);
+abscissa relabscissa(ellipse el, point M);
+abscissa relabscissa(conic co, point M);
+abscissa relabscissa(arc a, point M);
+int relativesystem;
+bqe canonical(bqe bqe);
+path fromFocus(conic co, real angle1, real angle2, int n, bool direction);
+real operator ^(point M, explicit circle c);
+point circumcenter(point A, point B, point C);
+point circumcenter(triangle t);
+parabola parabola(point F, line l);
+parabola parabola(point F, point vertex);
+parabola parabola(point F, real a, real angle);
+parabola parabola(bqe bqe);
+parabola parabola(point M1, point M2, point M3, line l);
+parabola parabola(point M1, point M2, point M3, point M4, point M5);
+real focusToCenter(ellipse el, real a);
+path arcfromcenter(ellipse el, real angle1, real angle2, bool direction=<default>, int n=<default>);
+path arcfromcenter(hyperbola h, real angle1, real angle2, int n=<default>, bool direction=<default>);
+path arcfromcenter(explicit conic co, real angle1, real angle2, int n, bool direction=<default>);
+hyperbola hyperbola(point P1, point P2, real ae, bool byfoci=<default>);
+hyperbola hyperbola(point F1, point F2, point M);
+hyperbola hyperbola(point C, real a, real b, real angle=<default>);
+hyperbola hyperbola(bqe bqe);
+hyperbola hyperbola(point M1, point M2, point M3, point M4, point M5);
+coordsys canonicalcartesiansystem(ellipse el);
+coordsys canonicalcartesiansystem(parabola p);
+coordsys canonicalcartesiansystem(hyperbola h);
+coordsys canonicalcartesiansystem(explicit conic co);
+point angpoint(conic co, real angle);
+point angpoint(explicit circle c, real x);
+point angpoint(explicit ellipse el, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+point angpoint(explicit parabola p, real x);
+point angpoint(explicit hyperbola h, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+point angpoint(arc a, real angle);
+path currentpolarconicroutine(conic co, real angle1, real angle2, int n, bool direction);
+int hyperbolanodesnumber(hyperbola h, real angle1, real angle2);
+int parabolanodesnumber(parabola p, real angle1, real angle2);
+int parabolanodesnumberfactor;
+real centerToFocus(ellipse el, real a);
+int ellipsenodesnumberfactor;
+int circlenodesnumberfactor;
+line sector(int n=<default>, int p=<default>, line l1, line l2, real angle=<default>, bool sharp=<default>);
+real[] bangles(picture pic=<default>, parabola p);
+real[][] bangles(picture pic=<default>, hyperbola h);
+real sharpangle(line l1, line l2);
+line perpendicular(point M, line l);
+line perpendicular(point M, explicit vector normal);
+line perpendicular(point M, explicit pair normal);
+bool perpendicular(line l1, line l2);
+void perpendicular(picture pic=<default>, pair z, pair align, pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+void perpendicular(picture pic=<default>, pair z, pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+transform hprojection(line l, bool safe=<default>);
+line parallel(point M, line l);
+line parallel(point M, explicit vector dir);
+line parallel(point M, explicit pair dir);
+bool parallel(line l1, line l2, bool strictly=<default>);
+transform reflect(line l);
+transform reflect(line l1, line l2, bool safe=<default>);
+line hline(coordsys R=<default>);
+line hline;
+line vline(coordsys R=<default>);
+line vline;
+line Oy(coordsys R=<default>);
+line Oy;
+line Ox(coordsys R=<default>);
+line Ox;
+line extend(line l);
+coordsys coordsys(line l);
+coordsys coordsys(conic co);
+coordsys coordsys(ellipse el);
+bool operator @(point m, line l);
+bool operator @(point M, conic co);
+bool operator @(point M, explicit circle c);
+bool operator @(point M, arc a);
+line line(point A, bool extendA=<default>, point B, bool extendB=<default>);
+line line(segment s);
+line line(real a, point A=<default>);
+line line(point A=<default>, real a);
+line line(int a, point A=<default>);
+line line(coordsys R=<default>, real slope, real origin);
+line line(coordsys R=<default>, real a, real b, real c);
+line line(circle c);
+line line(explicit side side);
+void distance(picture pic=<default>, Label L=<default>, point A, point B, bool rotated=<default>, real offset=<default>, pen p=<default>, pen joinpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
+real distance(point M, line l);
+real distance(line l, point M);
+void clipdraw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, real xmargin=<default>, real ymargin=<default>, Label legend=<default>, marker marker=<default>);
+void Drawline(picture pic=<default>, Label L=<default>, pair P, bool dirP=<default>, pair Q, bool dirQ=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
+bool between(point M, point O, point N);
+bool defined(point P);
+pen addpenarc;
+pen addpenarc(pen p);
+point origin;
+point origin(coordsys R=<default>);
+vector unit(point M);
+vector unit(vector u);
+real perpfactor;
+bool collinear(vector u, vector v);
+vector vector(coordsys R=<default>, pair v);
+vector vector(point M);
+transform scaleO(real x);
+transform yscale(real k, point M);
+transform rotateO(real a);
+bool Finite(explicit point z);
+point conj(explicit point M);
+vector conj(explicit vector u);
+hyperbola conj(hyperbola h);
+real abs(coordsys R, pair m);
+real abs(explicit point M);
+point operator -(explicit point P);
+point operator -(explicit point P1, explicit point P2);
+point operator -(explicit point P1, explicit pair p2);
+point operator -(explicit pair p1, explicit point P2);
+point operator -(point M, explicit vector v);
+vector operator -(explicit vector v);
+point operator -(explicit pair m, explicit vector v);
+vector operator -(explicit vector v1, explicit vector v2);
+line operator -(line l, vector u);
+conic operator -(conic c, explicit point M);
+conic operator -(conic c, explicit pair m);
+conic operator -(conic c, vector v);
+circle operator -(explicit circle c, explicit point M);
+circle operator -(explicit circle c, pair m);
+circle operator -(explicit circle c, vector m);
+abscissa operator -(explicit abscissa a);
+abscissa operator -(real x, explicit abscissa a);
+abscissa operator -(explicit abscissa a, real x);
+abscissa operator -(int x, explicit abscissa a);
+arc operator -(explicit arc a, point M);
+arc operator -(explicit arc a, vector v);
+mass operator -(mass M1, mass M2);
+mass operator -(explicit mass M, real x);
+mass operator -(explicit mass M, int x);
+pair locate(point P);
+point locate(pair p);
+pair locate(explicit vector v);
+point[] standardizecoordsys(coordsys R=<default>, bool warn=<default> ... point[] M);
+coordsys currentcoordsys;
+coordsys defaultcoordsys;
+real EPS;
+real binomial(real n, real k);
+real Infinity;
+void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit pair align=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>);
+void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit vector align, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>);
+pair coordinates(point M);
+line isotomic(vertex V, point M);
+point isotomic(side side, point M);
+triangle isotomic(triangle t, point M);
+int hyperbolanodesnumberfactor;
+int ellipsenodesnumber(real a, real b);
+int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir);
point point(coordsys R, pair p, real m=<default>);
point point(explicit pair p, real m);
point point(coordsys R, explicit point M, real m=<default>);
@@ -2190,93 +2413,72 @@ point point(explicit vertex V);
point point(trilinear tri);
point point(circle c, point M);
point point(circle c, explicit vector v);
-bool finite(explicit point p);
-void dot(picture pic=<default>, Label L, explicit point Z, align align=<default>, string format=<default>, pen p=<default>);
-real dot(point A, point B);
-real dot(point A, explicit pair B);
-real dot(explicit pair A, point B);
-void dot(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>);
-void dot(picture pic=<default>, triangle t, pen p=<default>);
-real[] realquarticroots(real a, real b, real c, real d, real e);
-point origin;
-point origin(coordsys R=<default>);
-void draw(picture pic=<default>, Label L=<default>, line l, bool dirA=<default>, bool dirB=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
-void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen[] p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
-void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen p, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
-void draw(picture pic=<default>, Label L=<default>, circle c, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, Label L=<default>, ellipse el, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, Label L=<default>, parabola parabola, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, Label L=<default>, hyperbola h, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, Label L=<default>, explicit conic co, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, Label L=<default>, arc a, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
-void draw(picture pic=<default>, triangle t, pen p=<default>, marker marker=<default>);
-void draw(picture pic=<default>, triangle[] ts, pen p=<default>, marker marker=<default>);
-coordsys defaultcoordsys;
-string defaultmassformat;
-line radicalline(circle c1, circle c2);
-point radicalcenter(circle c1, circle c2);
-point radicalcenter(circle c1, circle c2, circle c3);
-ellipse ellipse(point F1, point F2, real a);
-ellipse ellipse(point F1, point F2, point M);
-ellipse ellipse(point C, real a, real b, real angle=<default>);
-ellipse ellipse(bqe bqe);
-ellipse ellipse(point M1, point M2, point M3, point M4, point M5);
-path arctopath(arc a, int n);
-bool inside(ellipse el, point M);
-bool inside(parabola p, point M);
-int ellipsenodesnumber(real a, real b);
-int ellipsenodesnumber(real a, real b, real angle1, real angle2, bool dir);
-int ellipsenodesnumberfactor;
-bool byfoci;
-transform reflect(line l);
-transform reflect(line l1, line l2, bool safe=<default>);
-abscissa relabscissa(real x);
-abscissa relabscissa(int x);
-abscissa relabscissa(line l, point M);
-abscissa relabscissa(circle c, point M);
-abscissa relabscissa(ellipse el, point M);
-abscissa relabscissa(conic co, point M);
-abscissa relabscissa(arc a, point M);
-circle incircle(point A, point B, point C);
-circle incircle(triangle t);
-mass masscenter(... mass[] M);
-vector unit(point M);
-vector unit(vector u);
-line Ox(coordsys R=<default>);
-line Ox;
+int angularsystem;
+point changecoordsys(coordsys R, point M);
+vector changecoordsys(coordsys R, vector v);
+line changecoordsys(coordsys R, line l);
+bqe changecoordsys(coordsys R, bqe bqe);
+conic changecoordsys(coordsys R, conic co);
+int conicnodesfactor;
+point isotomicconjugate(triangle t, point M);
+point operator +(explicit point P1, explicit point P2);
+point operator +(explicit point P1, explicit pair p2);
+point operator +(explicit pair p1, explicit point p2);
+point operator +(point M, explicit vector v);
+point operator +(explicit pair m, explicit vector v);
+vector operator +(explicit vector v1, explicit vector v2);
+line operator +(line l, vector u);
+conic operator +(conic c, explicit point M);
+conic operator +(conic c, explicit pair m);
+conic operator +(conic c, vector v);
+circle operator +(explicit circle c, explicit point M);
+circle operator +(explicit circle c, pair m);
+circle operator +(explicit circle c, vector m);
+abscissa operator +(real x, explicit abscissa a);
+abscissa operator +(explicit abscissa a, real x);
+abscissa operator +(int x, explicit abscissa a);
+arc operator +(explicit arc a, point M);
+arc operator +(explicit arc a, vector v);
+mass operator +(mass M1, mass M2);
+mass operator +(explicit mass M, real x);
+mass operator +(explicit mass M, int x);
+triangle tangential(triangle t);
+point arcsubtendedcenter(point A, point B, real angle);
+real rd(real x, real y, real z);
+vector dir(vertex V);
+coordsys cartesiansystem(pair O=<default>, pair i, pair j);
+string conictype(bqe bqe);
+void fill(picture pic=<default>, circle c, pen p=<default>);
+void fill(picture pic=<default>, ellipse el, pen p=<default>);
+void fill(picture pic=<default>, triangle t, pen p=<default>);
+void fill(picture pic=<default>, triangle[] ts, pen p=<default>);
+segment segment(point A, point B);
+segment segment(line l);
+segment segment(explicit side side);
+line bisector(line l1, line l2, real angle=<default>, bool sharp=<default>);
+line bisector(point A, point B, point C, point D, real angle=<default>, bool sharp=<default>);
+line bisector(segment s, real angle=<default>);
+line bisector(point A, point B, real angle=<default>);
+line bisector(vertex V, real angle=<default>);
+line bisector(side side);
+void drawline(picture pic=<default>, triangle t, pen p=<default>);
+transform scale(real k, point M);
+transform scale(real k, point A, point B, point C, point D, bool safe=<default>);
+transform scale(real k, line l1, line l2, bool safe=<default>);
+string massformat(string format=<default>, string s, mass M);
conic conic(point F, line l, real e);
conic conic(point M1, point M2, point M3, point M4, point M5);
conic conic(bqe bqe);
-bool defined(point P);
-string conictype(bqe bqe);
-triangle antipedal(triangle t, point M);
-void clipdraw(picture pic=<default>, Label L=<default>, path g, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, real xmargin=<default>, real ymargin=<default>, Label legend=<default>, marker marker=<default>);
-real perpfactor;
-int conicnodesfactor;
-int conicnodesnumber(conic co, real angle1, real angle2, bool dir=<default>);
-line hline(coordsys R=<default>);
-line hline;
-int[] tricoef(side side);
-path arcfromfocus(conic co, real angle1, real angle2, int n=<default>, bool direction=<default>);
-line sector(int n=<default>, int p=<default>, line l1, line l2, real angle=<default>, bool sharp=<default>);
-path arcfromcenter(ellipse el, real angle1, real angle2, bool direction=<default>, int n=<default>);
-path arcfromcenter(hyperbola h, real angle1, real angle2, int n=<default>, bool direction=<default>);
-path arcfromcenter(explicit conic co, real angle1, real angle2, int n, bool direction=<default>);
-line vline(coordsys R=<default>);
-line vline;
-vector vector(coordsys R=<default>, pair v);
-vector vector(point M);
-real[] intersect(path g, explicit pair p, real fuzz=<default>);
-real[] intersect(path g, explicit point P, real fuzz=<default>);
-int sgnd(real x);
-int sgnd(int x);
-circle excircle(point A, point B, point C);
-circle excircle(side side);
-point orthocenter(point A, point B, point C);
-point orthocenter(triangle t);
-line extend(line l);
-point[] standardizecoordsys(coordsys R=<default>, bool warn=<default> ... point[] M);
-point intersectionpoint(line l1, line l2);
+arc arc(ellipse el, real angle1, real angle2, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>, bool direction=<default>);
+arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction=<default>);
+arc arc(ellipse el, point M, point N, bool direction=<default>);
+arc arc(explicit arc a, abscissa x1, abscissa x2);
+arc arc(explicit arc a, point M, point N);
+path arc(explicit pair B, explicit pair A, explicit pair C, real r);
+point inverse(inversion i, point P);
+circle inverse(inversion i, line l);
+circle inverse(inversion i, circle c);
+arc inverse(inversion i, segment s);
pair[] intersectionpoints(pair A, pair B, real a, real b, real c, real d, real f, real g);
pair[] intersectionpoints(pair A, pair B, real[] equation);
point[] intersectionpoints(line l, path g);
@@ -2317,104 +2519,27 @@ point[] intersectionpoints(arc a, conic co);
point[] intersectionpoints(arc a1, arc a2);
point[] intersectionpoints(line l, arc a);
point[] intersectionpoints(arc a, line l);
-point orthocentercenter(point A, point B, point C);
-point orthocentercenter(triangle t);
-point intouch(side side);
-triangle intouch(triangle t);
-real rf(real x, real y, real z);
-bool concurrent(... line[] l);
-real inradius(point A, point B, point C);
-real inradius(triangle t);
-pen addpenline;
-pen addpenline(pen p);
-pen addpenarc;
-pen addpenarc(pen p);
-void label(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
-void label(picture pic=<default>, Label L, vertex V, pair align=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>);
-void label(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, triangle t, real alignAngle=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>);
-real abs(coordsys R, pair m);
-real abs(explicit point M);
-point curpoint(line l, real x);
-point curpoint(explicit circle c, real x);
-point curpoint(explicit ellipse el, real x);
-point curpoint(explicit parabola p, real x);
-point curpoint(conic co, real x);
-point curpoint(arc a, real x);
-line bisector(line l1, line l2, real angle=<default>, bool sharp=<default>);
-line bisector(point A, point B, point C, point D, real angle=<default>, bool sharp=<default>);
-line bisector(segment s, real angle=<default>);
-line bisector(point A, point B, real angle=<default>);
-line bisector(vertex V, real angle=<default>);
-line bisector(side side);
-bqe canonical(bqe bqe);
-point bisectorpoint(side side);
-abscissa angabscissa(real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-abscissa angabscissa(int x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-abscissa angabscissa(circle c, point M);
-abscissa angabscissa(ellipse el, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-abscissa angabscissa(hyperbola h, point M, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-abscissa angabscissa(parabola p, point M);
-abscissa angabscissa(explicit conic co, point M);
-abscissa angabscissa(arc a, point M);
-pair locate(point P);
-point locate(pair p);
-pair locate(explicit vector v);
-bool samecoordsys(bool warn=<default> ... point[] M);
-bool samecoordsys(bool warn=<default> ... bqe[] bqes);
-triangle extouch(triangle t);
-triangle extouch(side side);
-coordsys canonicalcartesiansystem(ellipse el);
-coordsys canonicalcartesiansystem(parabola p);
-coordsys canonicalcartesiansystem(hyperbola h);
-coordsys canonicalcartesiansystem(explicit conic co);
-arc arc(ellipse el, real angle1, real angle2, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>, bool direction=<default>);
-arc arc(ellipse el, explicit abscissa x1, explicit abscissa x2, bool direction=<default>);
-arc arc(ellipse el, point M, point N, bool direction=<default>);
-arc arc(explicit arc a, abscissa x1, abscissa x2);
-arc arc(explicit arc a, point M, point N);
-path arc(explicit pair B, explicit pair A, explicit pair C, real r);
-void markrightangle(picture pic=<default>, point A, point O, point B, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-real epsgeo;
-real sharpangle(line l1, line l2);
-bool isparabola(bqe bqe);
-real sharpdegrees(line l1, line l2);
-real exradius(point A, point B, point C);
-real exradius(side side);
-abscissa nodabscissa(real x);
-abscissa nodabscissa(int x);
-abscissa nodabscissa(line l, point M);
-abscissa nodabscissa(circle c, point M);
-abscissa nodabscissa(ellipse el, point M);
-abscissa nodabscissa(parabola p, point M);
-abscissa nodabscissa(conic co, point M);
-abscissa nodabscissa(arc a, point M);
-coordsys coordsys(line l);
-coordsys coordsys(conic co);
-coordsys coordsys(ellipse el);
-pair coordinates(point M);
+point midpoint(segment s);
+point midpoint(side side);
+pair attract(pair m, path g, real fuzz=<default>);
+point attract(point M, path g, real fuzz=<default>);
+triangle pedal(triangle t, point M);
+line pedal(side side, point M);
real length(explicit point M);
real length(segment s);
-int arcnodesnumber(explicit arc a);
-int nodesystem;
-bool collinear(vector u, vector v);
-point centroid(point A, point B, point C);
-point centroid(triangle t);
-bool between(point M, point O, point N);
-int angularsystem;
-path square(pair z1, pair z2);
-void filldraw(picture pic=<default>, circle c, pen fillpen=<default>, pen drawpen=<default>);
-void filldraw(picture pic=<default>, ellipse el, pen fillpen=<default>, pen drawpen=<default>);
-void filldraw(picture pic=<default>, triangle t, pen fillpen=<default>, pen drawpen=<default>);
-void filldraw(picture pic=<default>, triangle[] ts, pen fillpen=<default>, pen drawpen=<default>);
-point symmedian(triangle t);
-point symmedian(side side);
-line symmedian(vertex V);
-triangle symmedial(triangle t);
-int curvilinearsystem;
-bqe bqe(coordsys R=<default>, real a, real b, real c, real d, real e, real f);
-bqe bqe(point M1, point M2, point M3, point M4, point M5);
-arc arccircle(point A, point M, point B);
-arc arccircle(point A, point B, real angle, bool direction=<default>);
+triangle medial(triangle t);
+int[] numarray;
+triangle triangleAbc(real alpha, real b, real c, real angle=<default>, point A=<default>);
+path arctopath(arc a, int n);
+bool byfoci;
+real[] realquarticroots(real a, real b, real c, real d, real e);
+line reverse(line l);
+arc reverse(arc a);
+bool simeq(point A, point B, real fuzz=<default>);
+bool simeq(point a, real b, real fuzz=<default>);
+void write(explicit line l);
+void write(explicit segment s);
+void write(trilinear tri);
point relpoint(line l, real x);
point relpoint(explicit circle c, real x);
point relpoint(explicit ellipse el, real x);
@@ -2423,202 +2548,41 @@ point relpoint(explicit hyperbola h, real x);
point relpoint(explicit conic co, explicit real x);
point relpoint(explicit conic co, explicit int x);
point relpoint(arc a, real x);
-point changecoordsys(coordsys R, point M);
-vector changecoordsys(coordsys R, vector v);
-line changecoordsys(coordsys R, line l);
-bqe changecoordsys(coordsys R, bqe bqe);
-conic changecoordsys(coordsys R, conic co);
-real angle(explicit point M, coordsys R=<default>, bool warn=<default>);
-real angle(explicit vector v, coordsys R=<default>, bool warn=<default>);
-real angle(line l, coordsys R=<default>);
-real angle(line l1, line l2);
-real angle(arc a);
-point[] fermat(triangle t);
-real arclength(circle c);
-real arclength(ellipse el);
-real arclength(ellipse el, real angle1, real angle2, bool direction=<default>, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-real arclength(parabola p, real angle);
-real arclength(parabola p, real angle1, real angle2);
-real arclength(parabola p);
-real arclength(arc a);
-line reverse(line l);
-arc reverse(arc a);
-point gergonne(triangle t);
-real focusToCenter(ellipse el, real a);
-hyperbola hyperbola(point P1, point P2, real ae, bool byfoci=<default>);
-hyperbola hyperbola(point F1, point F2, point M);
-hyperbola hyperbola(point C, real a, real b, real angle=<default>);
-hyperbola hyperbola(bqe bqe);
-hyperbola hyperbola(point M1, point M2, point M3, point M4, point M5);
-side opposite(vertex V);
-vertex opposite(side side);
-int hyperbolanodesnumber(hyperbola h, real angle1, real angle2);
-path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)(conic co);
-int hyperbolanodesnumberfactor;
-line parallel(point M, line l);
-line parallel(point M, explicit vector dir);
-line parallel(point M, explicit pair dir);
-bool parallel(line l1, line l2, bool strictly=<default>);
-transform projection(point A, point B);
-transform projection(point A, point B, point C, point D, bool safe=<default>);
-transform projection(line l);
-transform projection(line l1, line l2, bool safe=<default>);
-bool degenerate(conic c);
-bool degenerate(circle c);
-bool degenerate(ellipse el);
-line line(point A, bool extendA=<default>, point B, bool extendB=<default>);
-line line(segment s);
-line line(real a, point A=<default>);
-line line(point A=<default>, real a);
-line line(int a, point A=<default>);
-line line(coordsys R=<default>, real slope, real origin);
-line line(coordsys R=<default>, real a, real b, real c);
-line line(circle c);
-line line(explicit side side);
+arc arcsubtended(point A, point B, real angle);
+line[] operator ^^(line l1, line l2);
+line[] operator ^^(line l1, line[] l2);
+line[] operator ^^(line[] l2, line l1);
+line[] operator ^^(line[] l1, line[] l2);
+triangle[] operator ^^(triangle[] t1, triangle t2);
+triangle[] operator ^^(... triangle[] t);
line complementary(explicit line l);
line[] complementary(explicit segment s);
arc complementary(arc a);
-point ppoint(arc a, real x);
-path fromFocus(conic co, real angle1, real angle2, int n, bool direction);
+bqe equation(ellipse el);
+bqe equation(parabola p);
+bqe equation(hyperbola h);
+bqe equation(explicit conic co);
+void addMargins(picture pic=<default>, real lmargin=<default>, real bmargin=<default>, real rmargin=<default>, real tmargin=<default>, bool rigid=<default>, bool allObject=<default>);
+triangle triangle(line l1, line l2, line l3);
+void draw(picture pic=<default>, Label L=<default>, line l, bool dirA=<default>, bool dirB=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
+void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen[] p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
+void draw(picture pic=<default>, Label[] L=<default>, line[] l, align align=<default>, pen p, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label[] legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
+void draw(picture pic=<default>, Label L=<default>, circle c, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, Label L=<default>, ellipse el, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, Label L=<default>, parabola parabola, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, Label L=<default>, hyperbola h, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, Label L=<default>, explicit conic co, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, Label L=<default>, arc a, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, bool bar(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, Label legend=<default>, marker marker=<default>);
+void draw(picture pic=<default>, triangle t, pen p=<default>, marker marker=<default>);
+void draw(picture pic=<default>, triangle[] ts, pen p=<default>, marker marker=<default>);
+path square(pair z1, pair z2);
+real epsgeo;
+bool degenerate(conic c);
+bool degenerate(circle c);
+bool degenerate(ellipse el);
bool sameside(point M, point N, point O);
bool sameside(point M, point P, line l);
point[] sameside(point M, line l1, line l2);
-arc arcsubtended(point A, point B, real angle);
-void distance(picture pic=<default>, Label L=<default>, point A, point B, bool rotated=<default>, real offset=<default>, pen p=<default>, pen joinpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
-real distance(point M, line l);
-real distance(line l, point M);
-point incenter(point A, point B, point C);
-point incenter(triangle t);
-void write(explicit line l);
-void write(explicit segment s);
-void write(trilinear tri);
-triangle incentral(triangle t);
-point arcsubtendedcenter(point A, point B, real angle);
-real Infinity;
-circle circle(explicit point C, real r);
-circle circle(point A, point B);
-circle circle(segment s);
-circle circle(point A, point B, point C);
-circle circle(triangle t);
-circle circle(inversion i);
-point angpoint(conic co, real angle);
-point angpoint(explicit circle c, real x);
-point angpoint(explicit ellipse el, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-point angpoint(explicit parabola p, real x);
-point angpoint(explicit hyperbola h, real x, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
-point angpoint(arc a, real angle);
-triangle orthic(triangle t);
-int circlenodesnumber(real r);
-int circlenodesnumber(real r, real angle1, real angle2);
-path compassmark(pair O, pair A, real position, real angle=<default>);
-bool byvertices;
-int circlenodesnumberfactor;
-transform xscale(real k, point M);
-transform yscale(real k, point M);
-transform scale(real k, point M);
-transform scale(real k, point A, point B, point C, point D, bool safe=<default>);
-transform scale(real k, line l1, line l2, bool safe=<default>);
-point operator +(explicit point P1, explicit point P2);
-point operator +(explicit point P1, explicit pair p2);
-point operator +(explicit pair p1, explicit point p2);
-point operator +(point M, explicit vector v);
-point operator +(explicit pair m, explicit vector v);
-vector operator +(explicit vector v1, explicit vector v2);
-line operator +(line l, vector u);
-conic operator +(conic c, explicit point M);
-conic operator +(conic c, explicit pair m);
-conic operator +(conic c, vector v);
-circle operator +(explicit circle c, explicit point M);
-circle operator +(explicit circle c, pair m);
-circle operator +(explicit circle c, vector m);
-abscissa operator +(real x, explicit abscissa a);
-abscissa operator +(explicit abscissa a, real x);
-abscissa operator +(int x, explicit abscissa a);
-arc operator +(explicit arc a, point M);
-arc operator +(explicit arc a, vector v);
-mass operator +(mass M1, mass M2);
-mass operator +(explicit mass M, real x);
-mass operator +(explicit mass M, int x);
-point operator -(explicit point P);
-point operator -(explicit point P1, explicit point P2);
-point operator -(explicit point P1, explicit pair p2);
-point operator -(explicit pair p1, explicit point P2);
-point operator -(point M, explicit vector v);
-vector operator -(explicit vector v);
-point operator -(explicit pair m, explicit vector v);
-vector operator -(explicit vector v1, explicit vector v2);
-line operator -(line l, vector u);
-conic operator -(conic c, explicit point M);
-conic operator -(conic c, explicit pair m);
-conic operator -(conic c, vector v);
-circle operator -(explicit circle c, explicit point M);
-circle operator -(explicit circle c, pair m);
-circle operator -(explicit circle c, vector m);
-abscissa operator -(explicit abscissa a);
-abscissa operator -(real x, explicit abscissa a);
-abscissa operator -(explicit abscissa a, real x);
-abscissa operator -(int x, explicit abscissa a);
-arc operator -(explicit arc a, point M);
-arc operator -(explicit arc a, vector v);
-mass operator -(mass M1, mass M2);
-mass operator -(explicit mass M, real x);
-mass operator -(explicit mass M, int x);
-transform xscaleO(real x);
-pair operator *(coordsys R, pair p);
-path operator *(coordsys R, path g);
-coordsys operator *(transform t, coordsys R);
-point operator *(real x, explicit point P);
-point operator *(transform t, explicit point P);
-point operator *(explicit point P1, explicit point P2);
-point operator *(explicit point P1, explicit pair p2);
-point operator *(explicit pair p1, explicit point p2);
-vector operator *(real x, explicit vector v);
-vector operator *(transform t, explicit vector v);
-vector operator *(explicit point M, explicit vector v);
-line operator *(transform t, line l);
-line operator *(real x, line l);
-line operator *(int x, line l);
-line operator *(point M, line l);
-circle operator *(real x, explicit circle c);
-circle operator *(int x, explicit circle c);
-ellipse operator *(transform t, ellipse el);
-parabola operator *(transform t, parabola p);
-ellipse operator *(transform t, circle c);
-hyperbola operator *(transform t, hyperbola h);
-conic operator *(transform t, conic co);
-ellipse operator *(real x, ellipse el);
-abscissa operator *(real x, explicit abscissa a);
-abscissa operator *(explicit abscissa a, real x);
-arc operator *(transform t, explicit arc a);
-arc operator *(real x, explicit arc a);
-arc operator *(int x, explicit arc a);
-mass operator *(real x, explicit mass M);
-mass operator *(int x, explicit mass M);
-mass operator *(transform t, mass M);
-triangle operator *(transform T, triangle t);
-point operator *(inversion i, point P);
-circle operator *(inversion i, line l);
-circle operator *(inversion i, circle c);
-arc operator *(inversion i, segment s);
-path operator *(inversion i, triangle t);
-transform yscaleO(real x);
-coordsys operator init();
-point operator init();
-vector operator init();
-line operator init();
-segment operator init();
-bqe operator init();
-conic operator init();
-circle operator init();
-ellipse operator init();
-parabola operator init();
-hyperbola operator init();
-abscissa operator init();
-arc operator init();
-mass operator init();
-triangle operator init();
-trilinear operator init();
-inversion operator init();
pair operator cast(point P);
pair[] operator cast(point[] P);
point operator cast(pair p);
@@ -2660,13 +2624,84 @@ point operator cast(vertex V);
point operator cast(trilinear tri);
circle operator cast(inversion i);
inversion operator cast(circle c);
-path operator ecast(segment s);
-circle operator ecast(ellipse el);
-ellipse operator ecast(conic co);
-parabola operator ecast(conic co);
-hyperbola operator ecast(conic co);
-circle operator ecast(conic c);
-void lineinversion();
+int circlenodesnumber(real r);
+int circlenodesnumber(real r, real angle1, real angle2);
+void perpendicularmark(picture pic=<default>, point z, explicit pair align, explicit pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+void perpendicularmark(picture pic=<default>, point z, vector align, vector dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+void perpendicularmark(picture pic=<default>, point z, explicit pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+void perpendicularmark(picture pic=<default>, point z, vector align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+void perpendicularmark(picture pic=<default>, line l1, line l2, real size=<default>, pen p=<default>, int quarter=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+string defaultmassformat;
+path arcfromfocus(conic co, real angle1, real angle2, int n=<default>, bool direction=<default>);
+void label(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>, filltype filltype=<default>);
+void label(picture pic=<default>, Label L, vertex V, pair align=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>);
+void label(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, triangle t, real alignAngle=<default>, real alignFactor=<default>, pen p=<default>, filltype filltype=<default>);
+bqe bqe(coordsys R=<default>, real a, real b, real c, real d, real e, real f);
+bqe bqe(point M1, point M2, point M3, point M4, point M5);
+real arclength(circle c);
+real arclength(ellipse el);
+real arclength(ellipse el, real angle1, real angle2, bool direction=<default>, path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)=<default>);
+real arclength(parabola p, real angle);
+real arclength(parabola p, real angle1, real angle2);
+real arclength(parabola p);
+real arclength(arc a);
+void show(picture pic=<default>, Label lo=<default>, Label li=<default>, Label lj=<default>, coordsys R, pen dotpen=<default>, pen xpen=<default>, pen ypen=<default>, pen ipen=<default>, pen jpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
+void show(Label L, vector v, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
+void show(picture pic=<default>, line l, pen p=<default>);
+void show(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, Label La=<default>, Label Lb=<default>, Label Lc=<default>, triangle t, pen p=<default>, filltype filltype=<default>);
+int sgnd(real x);
+int sgnd(int x);
+pair operator *(coordsys R, pair p);
+path operator *(coordsys R, path g);
+coordsys operator *(transform t, coordsys R);
+point operator *(real x, explicit point P);
+point operator *(transform t, explicit point P);
+point operator *(explicit point P1, explicit point P2);
+point operator *(explicit point P1, explicit pair p2);
+point operator *(explicit pair p1, explicit point p2);
+vector operator *(real x, explicit vector v);
+vector operator *(transform t, explicit vector v);
+vector operator *(explicit point M, explicit vector v);
+line operator *(transform t, line l);
+line operator *(real x, line l);
+line operator *(int x, line l);
+line operator *(point M, line l);
+circle operator *(real x, explicit circle c);
+circle operator *(int x, explicit circle c);
+ellipse operator *(transform t, ellipse el);
+parabola operator *(transform t, parabola p);
+ellipse operator *(transform t, circle c);
+hyperbola operator *(transform t, hyperbola h);
+conic operator *(transform t, conic co);
+ellipse operator *(real x, ellipse el);
+abscissa operator *(real x, explicit abscissa a);
+abscissa operator *(explicit abscissa a, real x);
+arc operator *(transform t, explicit arc a);
+arc operator *(real x, explicit arc a);
+arc operator *(int x, explicit arc a);
+mass operator *(real x, explicit mass M);
+mass operator *(int x, explicit mass M);
+mass operator *(transform t, mass M);
+triangle operator *(transform T, triangle t);
+point operator *(inversion i, point P);
+circle operator *(inversion i, line l);
+circle operator *(inversion i, circle c);
+arc operator *(inversion i, segment s);
+path operator *(inversion i, triangle t);
+void dot(picture pic=<default>, Label L, explicit point Z, align align=<default>, string format=<default>, pen p=<default>);
+real dot(point A, point B);
+real dot(point A, explicit pair B);
+real dot(explicit pair A, point B);
+void dot(picture pic=<default>, Label L, explicit mass M, align align=<default>, string format=<default>, pen p=<default>);
+void dot(picture pic=<default>, triangle t, pen p=<default>);
+bool isparabola(bqe bqe);
+real sharpdegrees(line l1, line l2);
+bool samecoordsys(bool warn=<default> ... point[] M);
+bool samecoordsys(bool warn=<default> ... bqe[] bqes);
+point intersectionpoint(line l1, line l2);
+int curvilinearsystem;
+bool finite(explicit point p);
+transform vprojection(line l, bool safe=<default>);
pair operator /(pair p, coordsys R);
point operator /(explicit point P, real x);
point operator /(real x, explicit point P);
@@ -2682,272 +2717,355 @@ abscissa operator /(int x, explicit abscissa a);
arc operator /(explicit arc a, real x);
mass operator /(explicit mass M, real x);
mass operator /(explicit mass M, int x);
-transform scaleO(real x);
-real operator ^(point M, explicit circle c);
-bool operator ==(coordsys c1, coordsys c2);
-bool operator ==(explicit point M, explicit point N);
-bool operator ==(explicit vector u, explicit vector v);
-bool operator ==(line l1, line l2);
-bool operator !=(explicit point M, explicit point N);
-bool operator !=(line l1, line l2);
-line[] operator ^^(line l1, line l2);
-line[] operator ^^(line l1, line[] l2);
-line[] operator ^^(line[] l2, line l1);
-line[] operator ^^(line[] l1, line[] l2);
-triangle[] operator ^^(triangle[] t1, triangle t2);
-triangle[] operator ^^(... triangle[] t);
real elle(real phi, real k);
-point excenter(point A, point B, point C);
-point excenter(side side);
-mass mass(point M, real m);
-mass mass(explicit point P);
-mass mass(coordsys R, explicit pair p, real m);
-bool operator @(point m, line l);
-bool operator @(point M, conic co);
-bool operator @(point M, explicit circle c);
-bool operator @(point M, arc a);
-segment segment(point A, point B);
-segment segment(line l);
-segment segment(explicit side side);
-void fill(picture pic=<default>, circle c, pen p=<default>);
-void fill(picture pic=<default>, ellipse el, pen p=<default>);
-void fill(picture pic=<default>, triangle t, pen p=<default>);
-void fill(picture pic=<default>, triangle[] ts, pen p=<default>);
-triangle triangle(line l1, line l2, line l3);
-trilinear trilinear(triangle t, real a, real b, real c);
-trilinear trilinear(triangle t, point M);
-trilinear trilinear(triangle t, real f(real, real, real), real a=<default>, real b=<default>, real c=<default>);
-triangle triangleAbc(real alpha, real b, real c, real angle=<default>, point A=<default>);
-triangle triangleabc(real a, real b, real c, real angle=<default>, point A=<default>);
-triangle anticomplementary(triangle t);
-vector dir(vertex V);
-real degrees(explicit point M, coordsys R=<default>, bool warn=<default>);
-real degrees(vector v, coordsys R=<default>, bool warn=<default>);
-real degrees(line l, coordsys R=<default>);
-real degrees(line l1, line l2);
-real degrees(arc a);
-real linemargin;
-real linemargin();
-line Oy(coordsys R=<default>);
-line Oy;
-path fromCenter(conic co, real angle1, real angle2, int n, bool direction);
-void markarc(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, arc a, pen sectorpen=<default>, pen markpen=<default>, marginT margin(path, pen)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marker marker=<default>);
+bool onpath(picture pic=<default>, path g, point M, pen p=<default>);
+path operator ecast(segment s);
+circle operator ecast(ellipse el);
+ellipse operator ecast(conic co);
+parabola operator ecast(conic co);
+hyperbola operator ecast(conic co);
+circle operator ecast(conic c);
real approximate(real t);
real[] approximate(real[] T);
-void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit pair align=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>);
-void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, explicit line l1, explicit line l2, explicit vector align, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>);
-triangle cevian(triangle t, point P);
-point cevian(side side, point P);
-line cevian(vertex V, point P);
-transform hprojection(line l, bool safe=<default>);
-point conj(explicit point M);
-vector conj(explicit vector u);
-hyperbola conj(hyperbola h);
-transform vprojection(line l, bool safe=<default>);
-parabola parabola(point F, line l);
-parabola parabola(point F, point vertex);
-parabola parabola(point F, real a, real angle);
-parabola parabola(bqe bqe);
-parabola parabola(point M1, point M2, point M3, line l);
-parabola parabola(point M1, point M2, point M3, point M4, point M5);
-bool onpath(picture pic=<default>, path g, point M, pen p=<default>);
-int parabolanodesnumber(parabola p, real angle1, real angle2);
-int parabolanodesnumberfactor;
-path NoModifier(path);
-coordsys currentcoordsys;
-point foot(vertex V);
-point foot(side side);
-path currentpolarconicroutine(conic co, real angle1, real angle2, int n, bool direction);
+void markrightangle(picture pic=<default>, point A, point O, point B, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
+arc arccircle(point A, point M, point B);
+arc arccircle(point A, point B, real angle, bool direction=<default>);
+int nodesystem;
transform rotate(explicit pair dir);
transform rotate(explicit vector dir);
transform rotate(explicit point dir);
-real EPS;
-transform rotateO(real a);
-pair attract(pair m, path g, real fuzz=<default>);
-point attract(point M, path g, real fuzz=<default>);
-line perpendicular(point M, line l);
-line perpendicular(point M, explicit vector normal);
-line perpendicular(point M, explicit pair normal);
-bool perpendicular(line l1, line l2);
-void perpendicular(picture pic=<default>, pair z, pair align, pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void perpendicular(picture pic=<default>, pair z, pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-real binomial(real n, real k);
-void perpendicularmark(picture pic=<default>, point z, explicit pair align, explicit pair dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void perpendicularmark(picture pic=<default>, point z, vector align, vector dir=<default>, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void perpendicularmark(picture pic=<default>, point z, explicit pair align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void perpendicularmark(picture pic=<default>, point z, vector align, path g, real size=<default>, pen p=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void perpendicularmark(picture pic=<default>, line l1, line l2, real size=<default>, pen p=<default>, int quarter=<default>, marginT margin(path, pen)=<default>, filltype filltype=<default>);
-void Drawline(picture pic=<default>, Label L=<default>, pair P, bool dirP=<default>, pair Q, bool dirQ=<default>, align align=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, Label legend=<default>, marker marker=<default>, path pathModifier(path)=<default>);
-bool simeq(point A, point B, real fuzz=<default>);
-bool simeq(point a, real b, real fuzz=<default>);
-point inverse(inversion i, point P);
-circle inverse(inversion i, line l);
-circle inverse(inversion i, circle c);
-arc inverse(inversion i, segment s);
-inversion inversion(circle c1, circle c2, real sgn=<default>);
-inversion inversion(circle c1, circle c2, circle c3);
-inversion inversion(circle c);
-coordsys cartesiansystem(pair O=<default>, pair i, pair j);
-line tangent(circle c, abscissa x);
-line tangent(circle c, point M);
-line tangent(circle c, explicit vector v);
-line tangent(ellipse el, abscissa x);
-line tangent(parabola p, abscissa x);
-line tangent(hyperbola h, abscissa x);
-line tangent(explicit arc a, abscissa x);
-line tangent(explicit arc a, point M);
+path compassmark(pair O, pair A, real position, real angle=<default>);
+transform xscaleO(real x);
+real degrees(explicit point M, coordsys R=<default>, bool warn=<default>);
+real degrees(vector v, coordsys R=<default>, bool warn=<default>);
+real degrees(line l, coordsys R=<default>);
+real degrees(line l1, line l2);
+real degrees(arc a);
+point orthocentercenter(point A, point B, point C);
+point orthocentercenter(triangle t);
+transform projection(point A, point B);
+transform projection(point A, point B, point C, point D, bool safe=<default>);
+transform projection(line l);
+transform projection(line l1, line l2, bool safe=<default>);
+transform yscaleO(real x);
line[] tangents(circle c, point M);
line[] tangents(ellipse el, point M);
line[] tangents(parabola p, point M);
line[] tangents(hyperbola h, point M);
-real centerToFocus(ellipse el, real a);
-bqe equation(ellipse el);
-bqe equation(parabola p);
-bqe equation(hyperbola h);
-bqe equation(explicit conic co);
-triangle tangential(triangle t);
-triangle pedal(triangle t, point M);
-line pedal(side side, point M);
-string massformat(string format=<default>, string s, mass M);
-int relativesystem;
-void drawline(picture pic=<default>, triangle t, pen p=<default>);
-void addMargins(picture pic=<default>, real lmargin=<default>, real bmargin=<default>, real rmargin=<default>, real tmargin=<default>, bool rigid=<default>, bool allObject=<default>);
-real[] bangles(picture pic=<default>, parabola p);
-real[][] bangles(picture pic=<default>, hyperbola h);
-triangle medial(triangle t);
-line median(vertex V);
-line median(side side);
-void show(picture pic=<default>, Label lo=<default>, Label li=<default>, Label lj=<default>, coordsys R, pen dotpen=<default>, pen xpen=<default>, pen ypen=<default>, pen ipen=<default>, pen jpen=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
-void show(Label L, vector v, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>);
-void show(picture pic=<default>, line l, pen p=<default>);
-void show(picture pic=<default>, Label LA=<default>, Label LB=<default>, Label LC=<default>, Label La=<default>, Label Lb=<default>, Label Lc=<default>, triangle t, pen p=<default>, filltype filltype=<default>);
-line isotomic(vertex V, point M);
-point isotomic(side side, point M);
-triangle isotomic(triangle t, point M);
-abscissa curabscissa(real x);
-abscissa curabscissa(int x);
-abscissa curabscissa(line l, point M);
-abscissa curabscissa(circle c, point M);
-abscissa curabscissa(ellipse el, point M);
-abscissa curabscissa(parabola p, point M);
-abscissa curabscissa(conic co, point M);
-abscissa curabscissa(arc a, point M);
-string DefaultFormat(real);
-string DefaultLogFormat(real)(int base);
-string DefaultLogFormat(real);
-guide graph(pair f(real), real, real, int)(guide join(... guide[]));
-guide[] graph(pair f(real), real, real, int)(guide join(... guide[]), bool3 cond(real));
-guide graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
-guide[] graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
-guide graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
-guide[] graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
-guide graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
-guide[] graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
-guide graph(picture pic=<default>, pair[] z, guide join(... guide[])=<default>);
-guide[] graph(picture pic=<default>, pair[] z, bool3[] cond, guide join(... guide[])=<default>);
-guide graph(picture pic=<default>, real[] x, real[] y, guide join(... guide[])=<default>);
-guide[] graph(picture pic=<default>, real[] x, real[] y, bool3[] cond, guide join(... guide[])=<default>);
-guide graphwithderiv(pair f(real), pair fprime(real), real a, real b, int n=<default>);
-scientific scientific(real x);
-void Left(picture, axisT)(bool extend=<default>);
-void Left(picture, axisT);
-autoscaleT defaultS;
-void XEquals(picture, axisT)(real x, bool extend=<default>);
-void YEquals(picture, axisT)(real y, bool extend=<default>);
-string LogFormat(real)(int base);
-string LogFormat(real);
-axisT axis;
-void axis(picture pic=<default>, Label L=<default>, path g, path g2=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>), ticklocate locate, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>);
-void drawtick(frame f, transform T, path g, path g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend);
-void errorbar(picture pic, pair z, pair dp, pair dm, pen p=<default>, real size=<default>);
-void errorbars(picture pic=<default>, pair[] z, pair[] dp, pair[] dm=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>);
-void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpx, real[] dpy, real[] dmx=<default>, real[] dmy=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>);
-void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpy, bool[] cond=<default>, pen p=<default>, real size=<default>);
-void xlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
-string conditionlength;
-void ylimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
-tickvalues None(tickvalues v);
-scaleT Logarithmic;
-void limits(picture pic=<default>, pair min, pair max, bool crop=<default>);
-void crop(picture pic=<default>);
-picture vectorfield(path vector(real), path g, int n, bool truesize=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
-picture vectorfield(path vector(pair), pair a, pair b, int nx=<default>, int ny=<default>, bool truesize=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
-string OmitFormat(real)(string s=<default> ... real[] x);
-tickvalues OmitTickIntervals(tickvalues)(real[] a, real[] b);
-tickvalues OmitTickInterval(tickvalues)(real a, real b);
-tickvalues OmitTick(tickvalues)(... real[] x);
-guide Straight(... guide[]);
-int Min;
-string trailingzero;
-void label(picture pic, Label L, pair z, real x, align align, string format, pen p);
-void labelx(picture pic=<default>, Label L=<default>, explicit pair z, align align=<default>, string format=<default>, pen p=<default>);
-void labelx(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>);
-void labelx(picture pic=<default>, Label L, string format=<default>, explicit pen p=<default>);
+circle circumcircle(point A, point B, point C);
+circle circumcircle(triangle t);
+real linemargin;
+real linemargin();
+point centroid(point A, point B, point C);
+point centroid(triangle t);
+void markarc(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, arc a, pen sectorpen=<default>, pen markpen=<default>, marginT margin(path, pen)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marker marker=<default>);
+path NoModifier(path);
+side opposite(vertex V);
+vertex opposite(side side);
+coordsys operator init();
+point operator init();
+vector operator init();
+line operator init();
+segment operator init();
+bqe operator init();
+conic operator init();
+circle operator init();
+ellipse operator init();
+parabola operator init();
+hyperbola operator init();
+abscissa operator init();
+arc operator init();
+mass operator init();
+triangle operator init();
+trilinear operator init();
+inversion operator init();
+void filldraw(picture pic=<default>, circle c, pen fillpen=<default>, pen drawpen=<default>);
+void filldraw(picture pic=<default>, ellipse el, pen fillpen=<default>, pen drawpen=<default>);
+void filldraw(picture pic=<default>, triangle t, pen fillpen=<default>, pen drawpen=<default>);
+void filldraw(picture pic=<default>, triangle[] ts, pen fillpen=<default>, pen drawpen=<default>);
+transform xscale(real k, point M);
+real rf(real x, real y, real z);
+mass mass(point M, real m);
+mass mass(explicit point P);
+mass mass(coordsys R, explicit pair p, real m);
+void lineinversion();
+bool inside(ellipse el, point M);
+bool inside(parabola p, point M);
+pen addpenline;
+pen addpenline(pen p);
+bool concurrent(... line[] l);
+int conicnodesnumber(conic co, real angle1, real angle2, bool dir=<default>);
+path polarconicroutine(conic co, real angle1, real angle2, int n, bool direction)(conic co);
+ellipse ellipse(point F1, point F2, real a);
+ellipse ellipse(point F1, point F2, point M);
+ellipse ellipse(point C, real a, real b, real angle=<default>);
+ellipse ellipse(bqe bqe);
+ellipse ellipse(point M1, point M2, point M3, point M4, point M5);
+circle circle(explicit point C, real r);
+circle circle(point A, point B);
+circle circle(segment s);
+circle circle(point A, point B, point C);
+circle circle(triangle t);
+circle circle(inversion i);
+line radicalline(circle c1, circle c2);
+point incenter(point A, point B, point C);
+point incenter(triangle t);
+line altitude(vertex V);
+line altitude(side side);
+point ppoint(arc a, real x);
+path fromCenter(conic co, real angle1, real angle2, int n, bool direction);
+point bisectorpoint(side side);
+bool byvertices;
+int[] tricoef(side side);
+real angle(explicit point M, coordsys R=<default>, bool warn=<default>);
+real angle(explicit vector v, coordsys R=<default>, bool warn=<default>);
+real angle(line l, coordsys R=<default>);
+real angle(line l1, line l2);
+real angle(arc a);
+real[] intersect(path g, explicit pair p, real fuzz=<default>);
+real[] intersect(path g, explicit point P, real fuzz=<default>);
+bool operator !=(explicit point M, explicit point N);
+bool operator !=(line l1, line l2);
+triangle extouch(triangle t);
+triangle extouch(side side);
+bool operator ==(coordsys c1, coordsys c2);
+bool operator ==(explicit point M, explicit point N);
+bool operator ==(explicit vector u, explicit vector v);
+bool operator ==(line l1, line l2);
+surface bispline(real[][] z, real[][] p, real[][] q, real[][] r, real[] x, real[] y, bool[][] cond=<default>);
+real[][][] bispline(real[][] f, real[] x, real[] y, real[] xsplinetype(real[], real[])=<default>, real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
+bool vperiodic(real[][] a);
+bool vperiodic(triple[][] a);
+bool uperiodic(real[][] a);
+bool uperiodic(triple[][] a);
+void labelz3(picture pic=<default>, Label L=<default>, real z, align align=<default>, string format=<default>, pen p=<default>);
+void labelz(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
+void ztick3(picture pic=<default>, real z, triple dir=<default>, real size=<default>, pen p=<default>);
+void ztick3(picture pic=<default>, Label L, real z, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+real ScaleZ(picture pic=<default>, real z);
+real[][] ScaleZ(picture pic=<default>, real[][] P);
+void axes3(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, Label zlabel=<default>, bool extend=<default>, triple min=<default>, triple max=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, projection P=<default>);
+void zlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
+void yaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
+void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
+void xaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
+triple defaultdir(triple X, triple Y, triple Z, bool opposite=<default>, projection P);
+real ztrans(real[][] t, real z);
+void XYZero(picture, axisT)(triple align=<default>, bool extend=<default>);
+void XYZero(picture, axisT);
+real[][][] bispline0(real[][] z, real[][] p, real[][] q, real[][] r, real[] x, real[] y, bool[][] cond=<default>);
+void XYEquals(picture, axisT)(real x, real y, triple align=<default>, bool extend=<default>);
+void XZEquals(picture, axisT)(real x, real z, triple align=<default>, bool extend=<default>);
+void YZEquals(picture, axisT)(real y, real z, triple align=<default>, bool extend=<default>);
+void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
+void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)();
+void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
+void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks=<default>, real[] ticks=<default>, int N=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+triple Dir(real)(triple dir);
+void XZZero(picture, axisT)(triple align=<default>, bool extend=<default>);
+void XZZero(picture, axisT);
+void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
+void Bounds(picture, axisT)(int type=<default>, int type2=<default>, triple align=<default>, bool extend=<default>);
+void Bounds(picture, axisT);
+void limits(picture pic=<default>, triple min, triple max);
+real ScaleX(picture pic=<default>, real x);
+ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, triple dir(real));
+void autoscale3(picture pic=<default>, void axis(picture, axisT));
+real maxlength(triple f(pair z), pair a, pair b, int nu, int nv);
+void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
+path3 Circle(triple c, real r, triple normal=<default>, int n=<default>);
+real ytrans(real[][] t, real y);
+real xtrans(real[][] t, real x);
+void labeltick(picture pic, real[][] T, path3 g, ticklocate locate, real val, int sign, real Size, string ticklabel(real), Label F, real norm=<default>);
+void Straight(flatguide3)(... void(flatguide3)[]);
+void polargraph(flatguide3)(real r(real, real), real theta(real), real phi(real), int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void labely(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
+void Spline(flatguide3)(... void(flatguide3)[]);
+void drawtick(picture pic, real[][] T, path3 g, path3 g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend);
+void axis(picture pic=<default>, Label L=<default>, path3 g, path3 g2=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P), ticklocate locate, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>);
+void xtick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
+void xtick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+void labelx(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
+void labelaxis(picture pic, real[][] T, Label L, path3 g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>);
+void ytick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
+void ytick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+path3 Arc(triple c, triple v1, triple v2, triple normal=<default>, bool direction=<default>, int n=<default>);
+path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, bool direction, int n=<default>);
+path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, int n=<default>);
+triple polar(real r, real theta, real phi);
+void graph(flatguide3)(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[]));
+void(flatguide3)[] graph(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[]), bool3 cond(real));
+void graph(flatguide3)(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void(flatguide3)[] graph(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(picture pic=<default>, triple v(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void(flatguide3)[] graph(picture pic=<default>, triple v(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(picture pic=<default>, triple[] v, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void(flatguide3)[] graph(picture pic=<default>, triple[] v, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(picture pic=<default>, real[] x, real[] y, real[] z, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void(flatguide3)[] graph(picture pic=<default>, real[] x, real[] y, real[] z, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(triple F(path, real), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(triple F(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(picture pic=<default>, real f(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void graph(flatguide3)(real f(pair), path p, int n=<default>, real T(pair), void join(flatguide3)(... void(flatguide3)[])=<default>);
+path3[] segment(triple[] v, bool[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void labelx3(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>);
+void tick(picture pic=<default>, triple v, triple dir, real size=<default>, pen p=<default>);
+void tick(picture pic=<default>, Label L, real value, triple v, triple dir, string format=<default>, real size=<default>, pen p=<default>);
+void label(picture pic, Label L, triple v, real x, align align, string format, pen p);
+void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
+void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen[] p, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>);
+void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen p=<default>, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>);
+picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool truesize=<default>, real maxlength=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, string name=<default>, render render=<default>);
+triple Scale(picture pic=<default>, triple v);
+triple[][] Scale(picture pic=<default>, triple[][] P);
+void xtick3(picture pic=<default>, real x, triple dir=<default>, real size=<default>, pen p=<default>);
+void xtick3(picture pic=<default>, Label L, real x, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+locateT operator init();
+void ztick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
+void ztick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+void zaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
+void yaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
+real[] uniform(real T(real x), real Tinv(real x), real a, real b, int n);
+void(flatguide3)[][] lift(real f(real x, real y), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void(flatguide3)[][] lift(real f(pair z), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>);
+void YZZero(picture, axisT)(triple align=<default>, bool extend=<default>);
+void YZZero(picture, axisT);
+void labely3(picture pic=<default>, Label L=<default>, real y, align align=<default>, string format=<default>, pen p=<default>);
+real ScaleY(picture pic=<default>, real y);
+void ytick3(picture pic=<default>, real y, triple dir=<default>, real size=<default>, pen p=<default>);
+void ytick3(picture pic=<default>, Label L, real y, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+triple ticklabelshift(triple align, pen p=<default>);
+triple tickMax3(picture pic);
+triple tickMin3(picture pic);
+surface surface(picture pic=<default>, triple[][] f, bool[][] cond=<default>);
+surface surface(picture pic=<default>, real[][] f, real[] x, real[] y, real[] xsplinetype(real[], real[])=<default>, real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
+surface surface(picture pic=<default>, real[][] f, pair a, pair b, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
+surface surface(picture pic=<default>, real[][] f, pair a, pair b, bool[][] cond=<default>);
+surface surface(picture pic=<default>, triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool cond(pair z)=<default>);
+surface surface(picture pic=<default>, triple f(pair z), real[] u, real[] v, real[](real[], real[])[] usplinetype, real[](real[], real[])[] vsplinetype=<default>, bool cond(pair z)=<default>);
+surface surface(picture pic=<default>, triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, real[](real[], real[])[] usplinetype, real[](real[], real[])[] vsplinetype=<default>, bool cond(pair z)=<default>);
+surface surface(picture pic=<default>, real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, bool cond(pair z)=<default>);
+surface surface(picture pic=<default>, real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool cond(pair z)=<default>);
+path Circle(pair c, real r, int n=<default>);
path Arc(pair c, real r, real angle1, real angle2, bool direction, int n=<default>);
path Arc(pair c, real r, real angle1, real angle2, int n=<default>);
path Arc(pair c, explicit pair z1, explicit pair z2, bool direction=<default>, int n=<default>);
+guide polargraph(picture pic=<default>, real r(real), real a, real b, int n=<default>, guide join(... guide[])=<default>);
+guide polargraph(picture pic=<default>, real[] r, real[] theta, guide join(... guide[])=<default>);
+void checkconditionlength(int x, int y);
+guide Hermite(... guide[])(real[] splinetype(real[], real[]));
+guide Hermite(... guide[]);
+guide Straight(... guide[]);
+picture secondaryY(picture primary=<default>, void f(picture));
+picture secondaryX(picture primary=<default>, void f(picture));
+string noprimary;
void labely(picture pic=<default>, Label L=<default>, explicit pair z, align align=<default>, string format=<default>, pen p=<default>);
void labely(picture pic=<default>, Label L=<default>, real y, align align=<default>, string format=<default>, pen p=<default>);
void labely(picture pic=<default>, Label L, string format=<default>, explicit pen p=<default>);
-pair labeltick(frame d, transform T, path g, ticklocate locate, real val, pair side, int sign, real Size, string ticklabel(real), Label F, real norm=<default>);
-void labelaxis(frame f, transform T, Label L, path g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>);
-void xtick(picture pic=<default>, explicit pair z, pair dir=<default>, real size=<default>, pen p=<default>);
-void xtick(picture pic=<default>, real x, pair dir=<default>, real size=<default>, pen p=<default>);
-void xtick(picture pic=<default>, Label L, explicit pair z, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void xtick(picture pic=<default>, Label L, real x, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+void labelx(picture pic=<default>, Label L=<default>, explicit pair z, align align=<default>, string format=<default>, pen p=<default>);
+void labelx(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>);
+void labelx(picture pic=<default>, Label L, string format=<default>, explicit pen p=<default>);
void ytick(picture pic=<default>, explicit pair z, pair dir=<default>, real size=<default>, pen p=<default>);
void ytick(picture pic=<default>, real y, pair dir=<default>, real size=<default>, pen p=<default>);
void ytick(picture pic=<default>, Label L, explicit pair z, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
void ytick(picture pic=<default>, Label L, real y, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-picture secondaryX(picture primary=<default>, void f(picture));
-picture secondaryY(picture primary=<default>, void f(picture));
-Label Break;
-tickvalues Break(tickvalues)(real, real);
-scaleT Linear;
-scaleT Linear(bool automin=<default>, bool automax=<default>, real s=<default>, real intercept=<default>);
-void xaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>);
-void yaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>);
+void xtick(picture pic=<default>, explicit pair z, pair dir=<default>, real size=<default>, pen p=<default>);
+void xtick(picture pic=<default>, real x, pair dir=<default>, real size=<default>, pen p=<default>);
+void xtick(picture pic=<default>, Label L, explicit pair z, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+void xtick(picture pic=<default>, Label L, real x, pair dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
+real ScaleX(picture pic=<default>, real x);
+void yaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool autorotate=<default>);
void xaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
-pair tickMin(picture pic);
+void limits(picture pic=<default>, pair min, pair max, bool crop=<default>);
+void crop(picture pic=<default>);
+void ylimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
+void xaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>);
+real ytrans(transform t, real y);
+real xtrans(transform t, real x);
+void YEquals(picture, axisT)(real y, bool extend=<default>);
+void LeftRight(picture, axisT)(bool extend=<default>);
+void LeftRight(picture, axisT);
+void Right(picture, axisT)(bool extend=<default>);
+void Right(picture, axisT);
+void Left(picture, axisT)(bool extend=<default>);
+void Left(picture, axisT);
+axisT axis;
+void axis(picture pic=<default>, Label L=<default>, path g, path g2=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>), ticklocate locate, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>);
+int Max;
+int Min;
+guide graphwithderiv(pair f(real), pair fprime(real), real a, real b, int n=<default>);
pair tickMax(picture pic);
-void yaxis(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool autorotate=<default>);
-string autoformat(string format=<default>, real norm ... real[] a);
-real linear(real)(real S(real x)=<default>, real Min, real Max);
-pair polar(real r, real theta);
-string Format(real)(string s=<default>);
-guide polargraph(picture pic=<default>, real r(real), real a, real b, int n=<default>, guide join(... guide[])=<default>);
-guide polargraph(picture pic=<default>, real[] r, real[] theta, guide join(... guide[])=<default>);
-void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
+void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
tickvalues NoZero(tickvalues);
-string NoZeroFormat(real);
-guide Hermite(... guide[])(real[] splinetype(real[], real[]));
-guide Hermite(... guide[]);
-path Circle(pair c, real r, int n=<default>);
-bool axiscoverage(int N, transform T, path g, ticklocate locate, real Step, pair side, int sign, real Size, Label F, string ticklabel(real), real norm, real limit);
-scaleT Broken(real a, real b, bool automin=<default>, bool automax=<default>);
-scaleT BrokenLog(real a, real b, bool automin=<default>, bool automax=<default>);
+tickvalues OmitTickInterval(tickvalues)(real a, real b);
void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks=<default>, real[] ticks=<default>, int N=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
void Ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
-string noprimary;
-void xequals(picture pic=<default>, Label L=<default>, real x, bool extend=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
-void yequals(picture pic=<default>, Label L=<default>, real y, bool extend=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
-pair Scale(picture pic=<default>, pair z);
-real ScaleX(picture pic=<default>, real x);
-real ScaleY(picture pic=<default>, real y);
tickvalues generateticks(int sign, Label F=<default>, string ticklabel(real)=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, real Size=<default>, real size=<default>, transform T, pair side, path g, real limit, pen p, ticklocate locate, int[] divisor, bool opposite);
-void checkconditionlength(int x, int y);
-real xtrans(transform t, real x);
-void Top(picture, axisT)(bool extend=<default>);
-void Top(picture, axisT);
-real ytrans(transform t, real y);
+string autoformat(string format=<default>, real norm ... real[] a);
+void labelaxis(frame f, transform T, Label L, path g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>);
+void axes(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, bool extend=<default>, pair min=<default>, pair max=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
+pair labeltick(frame d, transform T, path g, ticklocate locate, real val, pair side, int sign, real Size, string ticklabel(real), Label F, real norm=<default>);
+void drawtick(frame f, transform T, path g, path g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend);
+ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, pair dir(real)=<default>);
+autoscaleT defaultS;
+string LogFormat(real)(int base);
+string LogFormat(real);
+string DefaultLogFormat(real)(int base);
+string DefaultLogFormat(real);
+string NoZeroFormat(real);
+string DefaultFormat(real);
+string signedtrailingzero;
+string Format(real)(string s=<default>);
+bounds autoscale(real Min, real Max, scaleT scale=<default>);
+void autoscale(picture pic=<default>, void axis(picture, axisT));
+real upscale(real b, real a);
+int[] divisors(int a, int b);
+scaleT BrokenLog(real a, real b, bool automin=<default>, bool automax=<default>);
+scaleT Broken(real a, real b, bool automin=<default>, bool automax=<default>);
+string baselinetemplate;
+scaleT Logarithmic;
+scaleT Log;
+scaleT Log(bool automin=<default>, bool automax=<default>);
+guide Spline(... guide[]);
+void errorbar(picture pic, pair z, pair dp, pair dm, pen p=<default>, real size=<default>);
+tickvalues None(tickvalues v);
+string conditionlength;
+pair polar(real r, real theta);
void scale(picture pic=<default>, scaleT x, scaleT y=<default>, scaleT z=<default>);
void scale(picture pic=<default>, bool xautoscale=<default>, bool yautoscale=<default>, bool zautoscale=<default>);
-int[] divisors(int a, int b);
+guide graph(pair f(real), real, real, int)(guide join(... guide[]));
+guide[] graph(pair f(real), real, real, int)(guide join(... guide[]), bool3 cond(real));
+guide graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
+guide[] graph(picture pic=<default>, real f(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
+guide graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
+guide[] graph(picture pic=<default>, real x(real), real y(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
+guide graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, guide join(... guide[])=<default>);
+guide[] graph(picture pic=<default>, pair z(real), real a, real b, int n=<default>, real T(real)=<default>, bool3 cond(real), guide join(... guide[])=<default>);
+guide graph(picture pic=<default>, pair[] z, guide join(... guide[])=<default>);
+guide[] graph(picture pic=<default>, pair[] z, bool3[] cond, guide join(... guide[])=<default>);
+guide graph(picture pic=<default>, real[] x, real[] y, guide join(... guide[])=<default>);
+guide[] graph(picture pic=<default>, real[] x, real[] y, bool3[] cond, guide join(... guide[])=<default>);
+void XZero(picture, axisT)(bool extend=<default>);
+void XZero(picture, axisT);
+pair zero(real);
+path[] segment(pair[] z, bool[] cond, guide join(... guide[])=<default>);
+string trailingzero;
+void xlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
+void Bottom(picture, axisT)(bool extend=<default>);
+void Bottom(picture, axisT);
+void label(picture pic, Label L, pair z, real x, align align, string format, pen p);
scientific operator init();
bounds operator init();
ticklocate operator init();
@@ -2955,408 +3073,303 @@ locateT operator init();
tickvalues operator init();
axisT operator init();
int Both;
-void axes(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, bool extend=<default>, pair min=<default>, pair max=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
-string signedtrailingzero;
-path[] segment(pair[] z, bool[] cond, guide join(... guide[])=<default>);
-ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, pair dir(real)=<default>);
-pair ticklabelshift(pair align, pen p=<default>);
-pair zero(real);
-void Bottom(picture, axisT)(bool extend=<default>);
-void Bottom(picture, axisT);
-void BottomTop(picture, axisT)(bool extend=<default>);
-void BottomTop(picture, axisT);
-real zerotickfuzz;
-real upscale(real b, real a);
-bool logaxiscoverage(int N, transform T, path g, ticklocate locate, pair side, int sign, real Size, Label F, string ticklabel(real), real limit, int first, int last);
-string baselinetemplate;
void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)();
void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
+picture vectorfield(path vector(real), path g, int n, bool truesize=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
+picture vectorfield(path vector(pair), pair a, pair b, int nx=<default>, int ny=<default>, bool truesize=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>);
+tickvalues OmitTick(tickvalues)(... real[] x);
+pair Scale(picture pic=<default>, pair z);
+scaleT Linear;
+scaleT Linear(bool automin=<default>, bool automax=<default>, real s=<default>, real intercept=<default>);
+bool logaxiscoverage(int N, transform T, path g, ticklocate locate, pair side, int sign, real Size, Label F, string ticklabel(real), real limit, int first, int last);
+void XEquals(picture, axisT)(real x, bool extend=<default>);
+string OmitFormat(real)(string s=<default> ... real[] x);
+real linear(real)(real S(real x)=<default>, real Min, real Max);
void tick(picture pic=<default>, pair z, pair dir, real size=<default>, pen p=<default>);
void tick(picture pic=<default>, Label L, real value, explicit pair z, pair dir, string format=<default>, real size=<default>, pen p=<default>);
-int Value;
-scaleT Log;
-scaleT Log(bool automin=<default>, bool automax=<default>);
-void Right(picture, axisT)(bool extend=<default>);
-void Right(picture, axisT);
-void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void RightTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
-int Max;
-void XZero(picture, axisT)(bool extend=<default>);
-void XZero(picture, axisT);
void YZero(picture, axisT)(bool extend=<default>);
void YZero(picture, axisT);
-bounds autoscale(real Min, real Max, scaleT scale=<default>);
-void autoscale(picture pic=<default>, void axis(picture, axisT));
-guide Spline(... guide[]);
-void LeftRight(picture, axisT)(bool extend=<default>);
-void LeftRight(picture, axisT);
-path3[] segment(triple[] v, bool[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
-locateT operator init();
-void Straight(flatguide3)(... void(flatguide3)[]);
-void graph(flatguide3)(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[]));
-void(flatguide3)[] graph(triple F(real), real, real, int)(void join(flatguide3)(... void(flatguide3)[]), bool3 cond(real));
-void graph(flatguide3)(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[] graph(picture pic=<default>, real x(real), real y(real), real z(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(picture pic=<default>, triple v(real), real a, real b, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[] graph(picture pic=<default>, triple v(real), real a, real b, int n=<default>, bool3 cond(real), void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(picture pic=<default>, triple[] v, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[] graph(picture pic=<default>, triple[] v, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(picture pic=<default>, real[] x, real[] y, real[] z, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[] graph(picture pic=<default>, real[] x, real[] y, real[] z, bool3[] cond, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(triple F(path, real), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(triple F(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(picture pic=<default>, real f(pair), path p, int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void graph(flatguide3)(real f(pair), path p, int n=<default>, real T(pair), void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[][] lift(real f(real x, real y), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>);
-void(flatguide3)[][] lift(real f(pair z), guide[][] g, void join(flatguide3)(... void(flatguide3)[])=<default>);
-triple polar(real r, real theta, real phi);
-void polargraph(flatguide3)(real r(real, real), real theta(real), real phi(real), int n=<default>, void join(flatguide3)(... void(flatguide3)[])=<default>);
-bool uperiodic(real[][] a);
-bool uperiodic(triple[][] a);
-bool vperiodic(real[][] a);
-bool vperiodic(triple[][] a);
-void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void OutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
-void axis(picture pic=<default>, Label L=<default>, path3 g, path3 g2=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P), ticklocate locate, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, int[] divisor=<default>, bool above=<default>, bool opposite=<default>);
-void Bounds(picture, axisT)(int type=<default>, int type2=<default>, triple align=<default>, bool extend=<default>);
-void Bounds(picture, axisT);
-void xaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
-void yaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
-void zaxis3At(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, bool opposite=<default>, bool opposite2=<default>, bool primary=<default>, projection P=<default>);
-void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
-void yaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
-void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, real zmin=<default>, real zmax=<default>, pen p=<default>, void ticks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, bool above=<default>, projection P=<default>);
-void XZZero(picture, axisT)(triple align=<default>, bool extend=<default>);
-void XZZero(picture, axisT);
-void YZZero(picture, axisT)(triple align=<default>, bool extend=<default>);
-void YZZero(picture, axisT);
-surface surface(picture pic=<default>, triple[][] f, bool[][] cond=<default>);
-surface surface(picture pic=<default>, real[][] f, real[] x, real[] y, real[] xsplinetype(real[], real[])=<default>, real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
-surface surface(picture pic=<default>, real[][] f, pair a, pair b, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
-surface surface(picture pic=<default>, real[][] f, pair a, pair b, bool[][] cond=<default>);
-surface surface(picture pic=<default>, triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool cond(pair z)=<default>);
-surface surface(picture pic=<default>, triple f(pair z), real[] u, real[] v, real[](real[], real[])[] usplinetype, real[](real[], real[])[] vsplinetype=<default>, bool cond(pair z)=<default>);
-surface surface(picture pic=<default>, triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, real[](real[], real[])[] usplinetype, real[](real[], real[])[] vsplinetype=<default>, bool cond(pair z)=<default>);
-surface surface(picture pic=<default>, real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, bool cond(pair z)=<default>);
-surface surface(picture pic=<default>, real f(pair z), pair a, pair b, int nx=<default>, int ny=<default>, real[] xsplinetype(real[], real[]), real[] ysplinetype(real[], real[])=<default>, bool cond(pair z)=<default>);
-void XYEquals(picture, axisT)(real x, real y, triple align=<default>, bool extend=<default>);
-triple Dir(real)(triple dir);
-void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen[] p, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>);
-void draw(picture pic=<default>, Label[] L=<default>, void(flatguide3)[][] g, pen p=<default>, light light=<default>, string name=<default>, render render=<default>, interaction interaction=<default>);
-void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks=<default>, real[] ticks=<default>, int N=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void Ticks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(int sign, Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-real maxlength(triple f(pair z), pair a, pair b, int nu, int nv);
-void drawtick(picture pic, real[][] T, path3 g, path3 g2, ticklocate locate, real val, real Size, int sign, pen p, bool extend);
-triple tickMin3(picture pic);
-triple tickMax3(picture pic);
-triple Scale(picture pic=<default>, triple v);
-triple[][] Scale(picture pic=<default>, triple[][] P);
-real ScaleX(picture pic=<default>, real x);
+void xequals(picture pic=<default>, Label L=<default>, real x, bool extend=<default>, real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
+tickvalues OmitTickIntervals(tickvalues)(real[] a, real[] b);
+void yaxisAt(picture pic=<default>, Label L=<default>, void axis(picture, axisT), real ymin=<default>, real ymax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>, bool opposite=<default>);
+void yequals(picture pic=<default>, Label L=<default>, real y, bool extend=<default>, real xmin=<default>, real xmax=<default>, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)=<default>, bool arrow(picture, path, pen, marginT(path, pen))=<default>, marginT margin(path, pen)=<default>, bool above=<default>);
+void Top(picture, axisT)(bool extend=<default>);
+void Top(picture, axisT);
+int Value;
+void BottomTop(picture, axisT)(bool extend=<default>);
+void BottomTop(picture, axisT);
+pair tickMin(picture pic);
+scientific scientific(real x);
+void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
+void LeftTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>);
+Label Break;
+tickvalues Break(tickvalues)(real, real);
+real zerotickfuzz;
real ScaleY(picture pic=<default>, real y);
-real ScaleZ(picture pic=<default>, real z);
-real[][] ScaleZ(picture pic=<default>, real[][] P);
-picture vectorfield(path3 vector(pair v), triple f(pair z), pair a, pair b, int nu=<default>, int nv=<default>, bool truesize=<default>, real maxlength=<default>, bool cond(pair z)=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, string name=<default>, render render=<default>);
-path3 Circle(triple c, real r, triple normal=<default>, int n=<default>);
-void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void InTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
-void Spline(flatguide3)(... void(flatguide3)[]);
-void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, tickvalues modify(tickvalues)=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, real[] Ticks, real[] ticks=<default>, real Size=<default>, real size=<default>, bool extend=<default>, pen pTick=<default>, pen ptick=<default>);
-void InOutTicks(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
-void axes3(picture pic=<default>, Label xlabel=<default>, Label ylabel=<default>, Label zlabel=<default>, bool extend=<default>, triple min=<default>, triple max=<default>, pen p=<default>, bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, marginT3 margin(path3, pen)=<default>, projection P=<default>);
-void label(picture pic, Label L, triple v, real x, align align, string format, pen p);
-void labelx(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
-void labely(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
-void labeltick(picture pic, real[][] T, path3 g, ticklocate locate, real val, int sign, real Size, string ticklabel(real), Label F, real norm=<default>);
-void labelaxis(picture pic, real[][] T, Label L, path3 g, ticklocate locate=<default>, int sign=<default>, bool ticklabels=<default>);
-void labelx3(picture pic=<default>, Label L=<default>, real x, align align=<default>, string format=<default>, pen p=<default>);
-void labely3(picture pic=<default>, Label L=<default>, real y, align align=<default>, string format=<default>, pen p=<default>);
-void labelz(picture pic=<default>, Label L=<default>, triple v, align align=<default>, string format=<default>, pen p=<default>);
-void labelz3(picture pic=<default>, Label L=<default>, real z, align align=<default>, string format=<default>, pen p=<default>);
-void autoscale3(picture pic=<default>, void axis(picture, axisT));
-void xtick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
-void xtick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void ytick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
-void ytick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void xtick3(picture pic=<default>, real x, triple dir=<default>, real size=<default>, pen p=<default>);
-void xtick3(picture pic=<default>, Label L, real x, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void ytick3(picture pic=<default>, real y, triple dir=<default>, real size=<default>, pen p=<default>);
-void ytick3(picture pic=<default>, Label L, real y, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void ztick(picture pic=<default>, triple v, triple dir=<default>, real size=<default>, pen p=<default>);
-void ztick(picture pic=<default>, Label L, triple v, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-void ztick3(picture pic=<default>, real z, triple dir=<default>, real size=<default>, pen p=<default>);
-void ztick3(picture pic=<default>, Label L, real z, triple dir=<default>, string format=<default>, real size=<default>, pen p=<default>);
-triple defaultdir(triple X, triple Y, triple Z, bool opposite=<default>, projection P);
-real xtrans(real[][] t, real x);
-real ytrans(real[][] t, real y);
-real ztrans(real[][] t, real z);
-ticklocate ticklocate(real a, real b, autoscaleT S=<default>, real tickmin=<default>, real tickmax=<default>, real time(real)=<default>, triple dir(real));
-triple ticklabelshift(triple align, pen p=<default>);
-path3 Arc(triple c, triple v1, triple v2, triple normal=<default>, bool direction=<default>, int n=<default>);
-path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, bool direction, int n=<default>);
-path3 Arc(triple c, real r, real theta1, real phi1, real theta2, real phi2, triple normal=<default>, int n=<default>);
-void limits(picture pic=<default>, triple min, triple max);
-void XZEquals(picture, axisT)(real x, real z, triple align=<default>, bool extend=<default>);
-void YZEquals(picture, axisT)(real y, real z, triple align=<default>, bool extend=<default>);
-void XYZero(picture, axisT)(triple align=<default>, bool extend=<default>);
-void XYZero(picture, axisT);
-void zlimits(picture pic=<default>, real min=<default>, real max=<default>, bool crop=<default>);
-void tick(picture pic=<default>, triple v, triple dir, real size=<default>, pen p=<default>);
-void tick(picture pic=<default>, Label L, real value, triple v, triple dir, string format=<default>, real size=<default>, pen p=<default>);
-surface bispline(real[][] z, real[][] p, real[][] q, real[][] r, real[] x, real[] y, bool[][] cond=<default>);
-real[][][] bispline(real[][] f, real[] x, real[] y, real[] xsplinetype(real[], real[])=<default>, real[] ysplinetype(real[], real[])=<default>, bool[][] cond=<default>);
-real[][][] bispline0(real[][] z, real[][] p, real[][] q, real[][] r, real[] x, real[] y, bool[][] cond=<default>);
-real[] uniform(real T(real x), real Tinv(real x), real a, real b, int n);
-void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P)();
-void NoTicks3(picture, real[][], Label, path3, path3, pen, bool(picture, path3, material, marginT3(path3, pen), light, light), marginT3(path3, pen), ticklocate, int[], bool opposite=<default>, bool primary=<default>, projection P);
-bool Crop;
-int ngraph;
-real epsilon;
+bool axiscoverage(int N, transform T, path g, ticklocate locate, real Step, pair side, int sign, real Size, Label F, string ticklabel(real), real norm, real limit);
+pair ticklabelshift(pair align, pen p=<default>);
+void errorbars(picture pic=<default>, pair[] z, pair[] dp, pair[] dm=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>);
+void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpx, real[] dpy, real[] dmx=<default>, real[] dmy=<default>, bool[] cond=<default>, pen p=<default>, real size=<default>);
+void errorbars(picture pic=<default>, real[] x, real[] y, real[] dpy, bool[] cond=<default>, pen p=<default>, real size=<default>);
real axiscoverage;
+int nmesh;
+bool Crop;
real Ticksize;
+real axislabelfactor;
bool NoCrop;
-real ticksize;
+int ngraph;
int nCircle;
-int nmesh;
real ylabelwidth;
-real axislabelfactor;
+real epsilon;
+real ticksize;
+guide hermite(real[] x, real[] y, real[] splinetype(real[], real[])=<default>);
+real[] monotonic(real[] x, real[] y);
real[] clamped(real[], real[])(real slopea, real slopeb);
real[] natural(real[] x, real[] y);
-real[] monotonic(real[] x, real[] y);
+real[] periodic(real[] x, real[] y);
real[] notaknot(real[] x, real[] y);
-real[] linear(real[] x, real[] y);
-string morepoints;
-guide hermite(real[] x, real[] y, real[] splinetype(real[], real[])=<default>);
-void checklengths(int x, int y, string text=<default>);
void checkincreasing(real[] x);
-real[] periodic(real[] x, real[] y);
+void checklengths(int x, int y, string text=<default>);
string differentlengths;
+string morepoints;
real[] Spline(real[] x, real[] y);
real[](real[], real[])[] Spline;
-grid3(picture pic)[] YXYgrid(position pos=<default>);
-grid3(picture pic)[] YXYgrid;
-grid3 operator init();
-ticksgridT operator init();
-grid3(picture pic)[] operator cast(grid3 gridroutine(picture pic));
-grid3(picture pic)[][] operator cast(grid3(picture pic)[] gridroutine);
-grid3(picture pic)[][] operator cast(grid3 gridroutine(picture pic));
-triple X(picture pic);
-triple Y(picture pic);
-triple Z(picture pic);
-grid3(picture pic)[] XYXgrid(position pos=<default>);
-grid3(picture pic)[] XYXgrid;
-position middle;
-grid3(picture pic)[] XY_XZgrid(position posa=<default>, position posb=<default>);
-grid3(picture pic)[] XY_XZgrid;
+real[] linear(real[] x, real[] y);
+void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen pGrid=<default>, pen pgrid=<default>, bool above=<default>);
+void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen[] pGrid, pen[] pgrid, bool above=<default>);
+grid3(picture pic)[][] XYZgrid(position pos=<default>);
+grid3(picture pic)[][] XYZgrid;
grid3(picture pic)[] ZX_ZYgrid(position posa=<default>, position posb=<default>);
grid3(picture pic)[] ZX_ZYgrid;
-grid3 XYgrid(picture pic)(position pos=<default>);
-grid3 XYgrid(picture pic);
+grid3(picture pic)[] XY_XZgrid(position posa=<default>, position posb=<default>);
+grid3(picture pic)[] XY_XZgrid;
+grid3(picture pic)[] YZYgrid(position pos=<default>);
+grid3(picture pic)[] YZYgrid;
+grid3(picture pic)[] ZYZgrid(position pos=<default>);
+grid3(picture pic)[] ZYZgrid;
+grid3(picture pic)[] XZXgrid(position pos=<default>);
+grid3(picture pic)[] XZXgrid;
grid3 ZYgrid(picture pic)(position pos=<default>);
grid3 ZYgrid(picture pic);
-void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen pGrid=<default>, pen pgrid=<default>, bool above=<default>);
-void grid3(picture pic=<default>, grid3(picture pic)[][] gridroutine, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, pen[] pGrid, pen[] pgrid, bool above=<default>);
-ticksgridT OutTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>);
-triple YZ(picture pic);
-void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>);
+grid3 ZXgrid(picture pic)(position pos=<default>);
+grid3 ZXgrid(picture pic);
+grid3 XZgrid(picture pic)(position pos=<default>);
+grid3 XZgrid(picture pic);
+grid3 XYgrid(picture pic)(position pos=<default>);
+grid3 XYgrid(picture pic);
+grid3(picture pic)[] XYXgrid(position pos=<default>);
+grid3(picture pic)[] XYXgrid;
+position bottom;
+grid3(picture pic)[] YXYgrid(position pos=<default>);
+grid3(picture pic)[] YXYgrid;
+triple X(picture pic);
+grid3(picture pic)[] YX_YZgrid(position posa=<default>, position posb=<default>);
+grid3(picture pic)[] YX_YZgrid;
+triple XY(picture pic);
+triple Z(picture pic);
void yaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>);
-void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>);
-triple ZX(picture pic);
-grid3(picture pic)[] ZXZgrid(position pos=<default>);
-grid3(picture pic)[] ZXZgrid;
-grid3(picture pic)[] XZXgrid(position pos=<default>);
-grid3(picture pic)[] XZXgrid;
-position top;
+void xaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>);
ticksgridT InTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>);
ticksgridT InOutTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>);
-grid3(picture pic)[] YX_YZgrid(position posa=<default>, position posb=<default>);
-grid3(picture pic)[] YX_YZgrid;
-position bottom;
+ticksgridT OutTicks()(Label F=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, bool begin=<default>, bool end=<default>, real Size=<default>, real size=<default>, pen pTick=<default>, pen ptick=<default>, grid3(picture pic)[][] gridroutine, pen pGrid=<default>, pen pgrid=<default>);
+grid3(picture pic)[] ZXZgrid(position pos=<default>);
+grid3(picture pic)[] ZXZgrid;
+triple YZ(picture pic);
+triple Y(picture pic);
grid3 YXgrid(picture pic)(position pos=<default>);
grid3 YXgrid(picture pic);
-grid3 ZXgrid(picture pic)(position pos=<default>);
-grid3 ZXgrid(picture pic);
-triple XY(picture pic);
-grid3(picture pic)[][] XYZgrid(position pos=<default>);
-grid3(picture pic)[][] XYZgrid;
-grid3(picture pic)[] ZYZgrid(position pos=<default>);
-grid3(picture pic)[] ZYZgrid;
-grid3 XZgrid(picture pic)(position pos=<default>);
-grid3 XZgrid(picture pic);
+position top;
+void zaxis3(picture pic=<default>, Label L=<default>, void axis(picture, axisT)=<default>, pen p=<default>, ticksgridT ticks(), bool arrow(picture, path3, material, marginT3(path3, pen), light, light)=<default>, bool above=<default>);
+triple ZX(picture pic);
+position middle;
+grid3(picture pic)[] operator cast(grid3 gridroutine(picture pic));
+grid3(picture pic)[][] operator cast(grid3(picture pic)[] gridroutine);
+grid3(picture pic)[][] operator cast(grid3 gridroutine(picture pic));
grid3 YZgrid(picture pic)(position pos=<default>);
grid3 YZgrid(picture pic);
-grid3(picture pic)[] YZYgrid(position pos=<default>);
-grid3(picture pic)[] YZYgrid;
+grid3 operator init();
+ticksgridT operator init();
real fspline(real)(real[] x, real[] y, real[] splinetype(real[], real[])=<default>);
real pwhermite(real)(real[] x, real[] y, real[] dy);
horner diffdiv(real[] x, real[] y);
-horner hdiffdiv(real[] x, real[] y, real[] dy);
-horner operator init();
real fhorner(real)(horner sh);
-void labelpath(frame f, Label L, path g, string justify=<default>, pen p=<default>);
-void labelpath(picture pic=<default>, Label L, path g, string justify=<default>, pen p=<default>);
-string LeftJustified;
-string Centered;
-string RightJustified;
+horner operator init();
+horner hdiffdiv(real[] x, real[] y, real[] dy);
surface labelpath(string s, path3 p, real angle=<default>, triple optional=<default>);
-triple[] firstframe(path3 p, triple optional=<default>);
-triple[] nextframe(path3 p, real reltimestart, triple[] start, real reltimeend, int subdiv=<default>);
-real eps;
triple nextnormal(triple p, triple q);
+real eps;
+triple[] nextframe(path3 p, real reltimestart, triple[] start, real reltimeend, int subdiv=<default>);
+triple[] firstframe(path3 p, triple optional=<default>);
+string LeftJustified;
+string RightJustified;
+string Centered;
+void labelpath(frame f, Label L, path g, string justify=<default>, pen p=<default>);
+void labelpath(picture pic=<default>, Label L, path g, string justify=<default>, pen p=<default>);
+void lm_minimize(int m_dat, int n_par, real[] par, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data, lm_control_type control);
+void lm_lmdif(int m, int n, real[] x, real[] fvec, real ftol, real xtol, real gtol, int maxfev, real epsfcn, real[] diag, int mode, real factor, lm_int_type info, lm_int_type nfev, real[] fjac, int[] ipvt, real[] qtf, real[] wa1, real[] wa2, real[] wa3, real[] wa4, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data);
+void lm_print_quiet(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev);
+void lm_evaluate_default(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info);
string[] lm_infmsg;
-void lm_qrfac(int m, int n, real[] a, bool pivot, int[] ipvt, real[] rdiag, real[] acnorm, real[] wa);
-void lm_qrsolv(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real[] x, real[] sdiag, real[] wa);
-FitControl defaultControl;
-real LM_MACHEP;
real LM_SQRT_DWARF;
-real LM_SQRT_GIANT;
-void lm_lmpar(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real delta, lm_real_type par, real[] x, real[] sdiag, real[] wa1, real[] wa2);
-void lm_lmdif(int m, int n, real[] x, real[] fvec, real ftol, real xtol, real gtol, int maxfev, real epsfcn, real[] diag, int mode, real factor, lm_int_type info, lm_int_type nfev, real[] fjac, int[] ipvt, real[] qtf, real[] wa1, real[] wa2, real[] wa3, real[] wa4, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data);
-void lm_minimize(int m_dat, int n_par, real[] par, void evaluate(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info), void printout(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev), lm_data_type data, lm_control_type control);
+real LM_DWARF;
FitResult fit(real[] xdata, real[] ydata, real[] errors, real function(real[], real), real[] parameters, FitControl control=<default>);
FitResult fit(real[] xdata, real[] ydata, real function(real[], real), real[] parameters, FitControl control=<default>);
+void lm_qrsolv(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real[] x, real[] sdiag, real[] wa);
+real LM_MACHEP;
+real LM_USERTOL;
+real LM_SQRT_GIANT;
+string pad(string str, int count, string pad=<default>);
+string pad(int num, int digits, string pad=<default>);
+string pad(real num, int digits, string pad=<default>);
real lm_enorm(int n, real[] x, int offset=<default>);
+string[] lm_shortmsg;
+void lm_lmpar(int n, real[] r, int ldr, int[] ipvt, real[] diag, real[] qtb, real delta, lm_real_type par, real[] x, real[] sdiag, real[] wa1, real[] wa2);
+real SQR(real x);
+void lm_print_default(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev);
+FitControl defaultControl;
lm_data_type operator init();
lm_int_type operator init();
lm_real_type operator init();
lm_control_type operator init();
FitControl operator init();
FitResult operator init();
-real SQR(real x);
-string[] lm_shortmsg;
-void lm_evaluate_default(real[] par, int m_dat, real[] fvec, lm_data_type data, lm_int_type info);
-string pad(string str, int count, string pad=<default>);
-string pad(int num, int digits, string pad=<default>);
-string pad(real num, int digits, string pad=<default>);
-real LM_USERTOL;
-real LM_DWARF;
-void lm_print_quiet(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev);
-void lm_print_default(int n_par, real[] par, int m_dat, real[] fvec, lm_data_type data, int iflag, int iter, int nfev);
-real barmarksize(pen p=<default>);
-real barmarksizefactor;
+void lm_qrfac(int m, int n, real[] a, bool pivot, int[] ipvt, real[] rdiag, real[] acnorm, real[] wa);
+marker TildeIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>);
marker CrossIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>);
-marker StickIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>);
-frame crossframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>);
-real crossmarksize(pen p=<default>);
-real crossmarksizefactor;
-frame stickframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>);
-frame stickframe;
-real stickmarksize(pen p=<default>);
-real stickmarkspace(pen p=<default>);
+real markanglespace(pen p=<default>);
+real markanglespace;
+real barmarksizefactor;
real stickmarksizefactor;
-real stickmarkspacefactor;
-frame duplicate(path g, int n=<default>, pair space=<default>, pen p=<default>);
-marker CircleBarIntervalMarker(int i=<default>, int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, filltype filltype=<default>, bool circleabove=<default>, frame uniform=<default>, bool above=<default>);
-frame circlebarframe(int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
-real circlemarkradius(pen p=<default>);
-real circlemarkradiusfactor;
-marker operator *(transform T, marker m);
-marker TildeIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>);
frame tildeframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>);
frame tildeframe;
real tildemarksize(pen p=<default>);
real tildemarksizefactor;
+real stickmarkspace(pen p=<default>);
+frame stickframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>);
+frame stickframe;
+frame circlebarframe(int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, pen p=<default>, filltype filltype=<default>, bool above=<default>);
+real barmarksize(pen p=<default>);
+real markangleradiusfactor;
+real markanglespacefactor;
+marker StickIntervalMarker(int i=<default>, int n=<default>, real size=<default>, real space=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, frame uniform=<default>, bool above=<default>);
void markangle(picture pic=<default>, Label L=<default>, int n=<default>, real radius=<default>, real space=<default>, pair A, pair O, pair B, bool arrow(picture, path, pen, marginT(path, pen))=<default>, pen p=<default>, filltype filltype=<default>, marginT margin(path, pen)=<default>, marker marker=<default>);
-real markanglespace(pen p=<default>);
-real markanglespace;
+real circlemarkradiusfactor;
+marker operator *(transform T, marker m);
+real stickmarkspacefactor;
real markangleradius(pen p=<default>);
real markangleradius;
-real markanglespacefactor;
-real markangleradiusfactor;
+frame duplicate(path g, int n=<default>, pair space=<default>, pen p=<default>);
+marker CircleBarIntervalMarker(int i=<default>, int n=<default>, real barsize=<default>, real radius=<default>, real angle=<default>, pair offset=<default>, bool rotated=<default>, pen p=<default>, filltype filltype=<default>, bool circleabove=<default>, frame uniform=<default>, bool above=<default>);
+real crossmarksize(pen p=<default>);
+real circlemarkradius(pen p=<default>);
+real stickmarksize(pen p=<default>);
+frame crossframe(int n=<default>, real size=<default>, pair space=<default>, real angle=<default>, pair offset=<default>, pen p=<default>);
+real crossmarksizefactor;
void markinterval(picture pic=<default>, frame f, path g)(int n=<default>, frame f, bool rotated=<default>);
-real[] partialsum(real[] a);
-real[] partialsum(real[] a, real[] dx);
-int[] partialsum(int[] a);
-int[] partialsum(int[] a, int[] dx);
-real cot(real x);
-int unique(real[] a, real x);
-int unique(string[] a, string x);
-int quadrant(real degrees);
-pair exp(explicit pair z);
-string nopoint;
-real intersect(pair p, pair q, pair z);
-real intersect(triple P, triple Q, triple n, triple Z);
-real interpolate(real[] x, real[] y, real x0, int i);
-real interpolate(real[] x, real[] y, real x0);
-triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);
-pair[] quarticroots(real a, real b, real c, real d, real e);
+real findroot(real f(real), real a, real b, real tolerance=<default>, real fa=<default>, real fb=<default>);
+real[] leastsquares(real[][] A, real[] b, bool warn=<default>);
+void drawline(picture pic=<default>, pair P, pair Q, pen p=<default>);
+real[] zero(int n);
+real[][] zero(int n, int m);
+int[][] segment(bool[] b);
+pair[][] fft(pair[][] a, int sign=<default>);
+real asec(real x);
+bool increasing(real[] a, bool strict=<default>);
bool lexorder(pair a, pair b);
bool lexorder(triple a, triple b);
-bool square(real[][] m);
-real sec(real x);
+triple intersectionpoint(triple n0, triple P0, triple n1, triple P1);
+real interpolate(real[] x, real[] y, real x0, int i);
+real interpolate(real[] x, real[] y, real x0);
+bool polygon(path p);
+real csc(real x);
+rootfinder_settings operator init();
+real slope(path g, real x, int n=<default>, real fuzz=<default>);
+real slope(path g, explicit pair z, int n=<default>, real fuzz=<default>);
bool rectangular(real[][] m);
bool rectangular(pair[][] m);
bool rectangular(triple[][] m);
-bool polygon(path p);
-pair unityroot(int n, int k=<default>);
+int unique(real[] a, real x);
+int unique(string[] a, string x);
+real intersect(pair p, pair q, pair z);
+real intersect(triple P, triple Q, triple n, triple Z);
real acot(real x);
-pair[][] fft(pair[][] a, int sign=<default>);
-real slope(path g, real x, int n=<default>, real fuzz=<default>);
-real slope(path g, explicit pair z, int n=<default>, real fuzz=<default>);
-picture grid(int Nx, int Ny, pen p=<default>);
-rootfinder_settings operator init();
+int quadrant(real degrees);
+pair unityroot(int n, int k=<default>);
+real sec(real x);
+real cot(real x);
+real acsc(real x);
real frac(real x);
-real asec(real x);
+pair log(explicit pair z);
+pair exp(explicit pair z);
+picture grid(int Nx, int Ny, pen p=<default>);
+real[] partialsum(real[] a);
+real[] partialsum(real[] a, real[] dx);
+int[] partialsum(int[] a);
+int[] partialsum(int[] a, int[] dx);
int[][] segmentlimits(bool[] b);
-int[][] segment(bool[] b);
+bool square(real[][] m);
+string nopoint;
real time(path g, real x, int n=<default>, real fuzz=<default>);
real time(path g, explicit pair z, int n=<default>, real fuzz=<default>);
-real[] leastsquares(real[][] A, real[] b, bool warn=<default>);
-bool increasing(real[] a, bool strict=<default>);
-real[] zero(int n);
-real[][] zero(int n, int m);
-real findroot(real f(real), real a, real b, real tolerance=<default>, real fa=<default>, real fb=<default>);
-real acsc(real x);
real value(path g, real x, int n=<default>, real fuzz=<default>);
real value(path g, explicit pair z, int n=<default>, real fuzz=<default>);
-real csc(real x);
-pair log(explicit pair z);
-void drawline(picture pic=<default>, pair P, pair Q, pen p=<default>);
+pair[] quarticroots(real a, real b, real c, real d, real e);
+path cuttings;
path cutbefore(path p, path q);
path cutafter(path p, path q);
-path cuttings;
+obj operator init();
void draw(picture pic=<default>, obj o, light light=<default>);
obj operator *(real[][] T, obj o);
-obj operator init();
-real[][] finiteDifferenceJacobian(real[] f(real[]), real[] t, real[] h=<default>);
-RKTableau E_Euler;
+real[] solveBVP(real[] f(real, real[]), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>, real[] initial(real[]), real[] discrepancy(real[]), real[] guess, int iterations=<default>);
real error(real error, real initial, real lowOrder, real norm, real diff);
-RKTableau RK5;
-real stepfactor;
-solution integrate(real y, real c=<default>, real f(real t, real y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>);
-Solution integrate(real[] y, real[] f(real t, real[] y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>);
+RKTableau RK5DP;
+RKTableau RK5F;
RKTableau RK4;
-real[] newton(int iterations=<default>, real[] f(real[]), real[][] jacobian(real[]), real[] t);
-real phi1(real x);
-RKTableau RK3;
-void expfactors(real x, coefficients a);
-real phi2(real x);
-void report(real old, real h, real t);
-real[] solveBVP(real[] f(real, real[]), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>, real[] initial(real[]), real[] discrepancy(real[]), real[] guess, int iterations=<default>);
-RKTableau Euler;
RKTableau E_PC;
+RKTableau PC;
+RKTableau E_RK2;
RKTableau RK2;
+RKTableau RK3BS;
+real stepfactor;
+RKTableau RK3;
+real phi4(real x);
+RKTableau Euler;
+real[] Coeff;
+void expfactors(real x, coefficients a);
real phi3(real x);
+solution integrate(real y, real c=<default>, real f(real t, real y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>);
+Solution integrate(real[] y, real[] f(real t, real[] y), real a, real b=<default>, real h=<default>, int n=<default>, bool dynamic=<default>, real tolmin=<default>, real tolmax=<default>, real dtmin=<default>, real dtmax=<default>, RKTableau tableau, bool verbose=<default>);
+void report(real old, real h, real t);
+RKTableau E_RK3BS;
+RKTableau E_Euler;
void write(solution S);
void write(Solution S);
+real adjust(real h, real error, real tolmin, real tolmax, RKTableau tableau);
+RKTableau RK5;
coefficients operator init();
RKTableau operator init();
solution operator init();
Solution operator init();
-RKTableau E_RK2;
-RKTableau RK3BS;
-RKTableau RK5F;
-real phi4(real x);
-real adjust(real h, real error, real tolmin, real tolmax, RKTableau tableau);
-RKTableau RK5DP;
-real[] Coeff;
-RKTableau PC;
-RKTableau E_RK3BS;
-pen[] Grayscale(int NColors=<default>);
+real phi2(real x);
+real phi1(real x);
+real[][] finiteDifferenceJacobian(real[] f(real[]), real[] t, real[] h=<default>);
+real[] newton(int iterations=<default>, real[] f(real[]), real[][] jacobian(real[]), real[] t);
+pen[] BWRainbow2(int NColors=<default>);
+pen[] quantize(pen[] Palette, int n);
+pen[] BWRainbow(int NColors, bool two);
+pen[] BWRainbow(int NColors=<default>);
pen[] Wheel(int NColors=<default>);
+void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, pen pTick=<default>, pen ptick=<default>);
+void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>);
+pen[] palette(real[] f, pen[] palette);
+pen[][] palette(real[][] f, pen[] palette);
+void palette(picture pic=<default>, Label L=<default>, bounds bounds, pair initial, pair final, void axis(picture, axisT)=<default>, pen[] palette, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)=<default>, bool copy=<default>, bool antialias=<default>);
+bounds Automatic(picture pic, real min, real max);
+bounds Range(picture pic, real min, real max)(bool automin=<default>, real min=<default>, bool automax=<default>, real max=<default>);
+bounds Full(picture pic, real min, real max);
+pen[] Rainbow(int NColors=<default>);
+pen[] Grayscale(int NColors=<default>);
void image(frame f, real[][] data, pair initial, pair final, pen[] palette, bool transpose=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>);
void image(frame f, pen[][] data, pair initial, pair final, bool transpose=<default>, transform t=<default>, bool copy=<default>, bool antialias=<default>);
bounds image(picture pic=<default>, real[][] f, bounds range(picture pic, real min, real max)=<default>, pair initial, pair final, pen[] palette, int divs=<default>, bool transpose=<default>, bool copy=<default>, bool antialias=<default>);
@@ -3365,216 +3378,209 @@ void image(picture pic=<default>, pen[][] data, pair initial, pair final, bool t
void image(picture pic=<default>, pen f(int, int), int width, int height, pair initial, pair final, bool transpose=<default>, bool antialias=<default>);
bounds image(picture pic=<default>, pair[] z, real[] f, bounds range(picture pic, real min, real max)=<default>, pen[] palette);
bounds image(picture pic=<default>, real[] x, real[] y, real[] f, bounds range(picture pic, real min, real max)=<default>, pen[] palette);
+pen[] adjust(picture pic, real min, real max, real rmin, real rmax, pen[] palette);
pen[] cmyk(pen[] Palette);
-pen[] BWRainbow(int NColors, bool two);
-pen[] BWRainbow(int NColors=<default>);
-pen[] BWRainbow2(int NColors=<default>);
+void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>);
transform swap;
-bounds Automatic(picture pic, real min, real max);
real[] sequencereal;
-pen[] Rainbow(int NColors=<default>);
-pen[] adjust(picture pic, real min, real max, real rmin, real rmax, pen[] palette);
pen[] Gradient(int NColors=<default> ... pen[] p);
-pen[] quantize(pen[] Palette, int n);
-void NoTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>);
-bounds Range(picture pic, real min, real max)(bool automin=<default>, real min=<default>, bool automax=<default>, real max=<default>);
-bounds Full(picture pic, real min, real max);
-void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)(Label format=<default>, string ticklabel(real)=<default>, bool beginlabel=<default>, bool endlabel=<default>, int N=<default>, int n=<default>, real Step=<default>, real step=<default>, pen pTick=<default>, pen ptick=<default>);
-void PaletteTicks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>);
-pen[] palette(real[] f, pen[] palette);
-pen[][] palette(real[][] f, pen[] palette);
-void palette(picture pic=<default>, Label L=<default>, bounds bounds, pair initial, pair final, void axis(picture, axisT)=<default>, pen[] palette, pen p=<default>, void ticks(frame, transform, Label, pair, path, path, pen, bool(picture, path, pen, marginT(path, pen)), marginT(path, pen), ticklocate, int[], bool opposite=<default>)(int sign=<default>)=<default>, bool copy=<default>, bool antialias=<default>);
-picture brick(real Hx=<default>, real Hy=<default>, pen p=<default>);
+picture tile(real Hx=<default>, real Hy=<default>, pen p=<default>, filltype filltype=<default>);
+frame tiling(string name, picture pic, pair lb=<default>, pair rt=<default>);
picture crosshatch(real H=<default>, pen p=<default>);
-picture hatch(real H=<default>, pair dir=<default>, pen p=<default>);
real hatchepsilon;
-picture checker(real Hx=<default>, real Hy=<default>, pen p=<default>);
+picture brick(real Hx=<default>, real Hy=<default>, pen p=<default>);
void add(string name, picture pic, pair lb=<default>, pair rt=<default>);
-frame tiling(string name, picture pic, pair lb=<default>, pair rt=<default>);
-picture tile(real Hx=<default>, real Hy=<default>, pen p=<default>, filltype filltype=<default>);
-void grestore(picture pic=<default>);
-pen textpen;
+picture hatch(real H=<default>, pair dir=<default>, pen p=<default>);
+picture checker(real Hx=<default>, real Hy=<default>, pen p=<default>);
void gsave(picture pic=<default>);
+pen textpen;
+void grestore(picture pic=<default>);
pair align;
-rational[][] rationalidentity(int n);
-int gcd(int m, int n);
-int maxDenominator;
-rational min(rational a, rational b);
-rational abs(rational r);
+rational sum(rational[] a);
string texstring(rational r);
-bool rectangular(rational[][] m);
string string(rational r);
-void write(file fout, string s=<default>, rational r, void suffix(file)=<default>);
-void write(string s=<default>, rational r, void suffix(file)=<default>);
-void write(file fout=<default>, string s=<default>, rational[] a, void suffix(file)=<default>);
-void write(file fout=<default>, string s=<default>, rational[][] a, void suffix(file)=<default>);
-rational operator +(rational r, rational s);
rational operator -(rational r);
rational operator -(rational r, rational s);
rational[] operator -(rational[] r);
-rational operator *(rational r, rational s);
+int lcm(int m, int n);
+int maxDenominator;
+bool operator <(rational r, rational s);
+bool[] operator <(rational[] r, rational s);
+bool operator >(rational r, rational s);
+bool[] operator >(rational[] r, rational s);
+rational abs(rational r);
+bool rectangular(rational[][] m);
+bool operator >=(rational r, rational s);
+bool[] operator >=(rational[] r, rational s);
+bool operator <=(rational r, rational s);
+bool[] operator <=(rational[] r, rational s);
+real operator ecast(rational r);
+rational operator ecast(real x);
rational operator init();
+rational[][] rationalidentity(int n);
rational operator cast(int p);
rational[] operator cast(int[] a);
rational[][] operator cast(int[][] a);
-real operator ecast(rational r);
-rational operator ecast(real x);
-rational operator /(rational r, rational s);
+rational max(rational a, rational b);
+rational max(rational[] a);
+rational operator *(rational r, rational s);
bool operator ==(rational r, rational s);
bool[] operator ==(rational[] r, rational s);
bool operator ==(rational[] r, rational[] s);
bool operator ==(rational[][] r, rational[][] s);
+rational operator /(rational r, rational s);
+void write(file fout, string s=<default>, rational r, void suffix(file)=<default>);
+void write(string s=<default>, rational r, void suffix(file)=<default>);
+void write(file fout=<default>, string s=<default>, rational[] a, void suffix(file)=<default>);
+void write(file fout=<default>, string s=<default>, rational[][] a, void suffix(file)=<default>);
+rational min(rational a, rational b);
+int gcd(int m, int n);
bool operator !=(rational r, rational s);
-bool operator <(rational r, rational s);
-bool[] operator <(rational[] r, rational s);
-bool operator <=(rational r, rational s);
-bool[] operator <=(rational[] r, rational s);
-bool operator >(rational r, rational s);
-bool[] operator >(rational[] r, rational s);
-bool operator >=(rational r, rational s);
-bool[] operator >=(rational[] r, rational s);
-rational sum(rational[] a);
-int lcm(int m, int n);
-rational max(rational a, rational b);
-rational max(rational[] a);
-bool optimizeTableau;
-simplex operator init();
-void simplexInit(rational[] c, rational[][] A, int[] s=<default>, rational[] b, int count);
+rational operator +(rational r, rational s);
+void simplexPhase2();
void simplexPhase1(rational[] c, rational[][] A, rational[] b, int[] Bindices);
void simplexTableau(rational[][] E, int[] Bindices, int I=<default>, int J=<default>, int n=<default>);
-void simplexPhase2();
+bool optimizeTableau;
int[] artificialColumn;
+simplex operator init();
+void simplexInit(rational[] c, rational[][] A, int[] s=<default>, rational[] b, int count);
void simplexWrite(rational[][] E, int[] Bindices, int, int);
path roundedpath(path A, real R, real S=<default>);
-simplex operator init();
problem operator init();
-void filecode(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>);
+simplex operator init();
+void currentexitfunction();
+void bibliographystyle(string name);
+void subitem(string s, pen p=<default>);
+string asywrite(string s, string preamble=<default>);
+void code(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>);
+void asyinclude(string s, real xsize=<default>, real ysize=<default>);
+void indexedfigure(string prefix, int first, int last, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>);
+void multifigure(string[] slist, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>);
void display(frame[] f, real margin=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
void display(frame f, real margin=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
void display(string[] s, real margin=<default>, string[] captions=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
void display(string s, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
-void multifigure(string[] slist, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>);
-void subitem(string s, pen p=<default>);
-pen pagenumberpen;
-pair pagenumberalign;
-pair pagenumberposition;
-void indexedfigure(string prefix, int first, int last, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool step=<default>);
+void skip(real n=<default>);
+void vbox(string s, pen p=<default>);
+void center(string s, pen p=<default>);
+void outline(string s=<default>, pair position=<default>, pair align=<default>, pen p=<default>);
+void title(string s, pair position=<default>, pair align=<default>, pen p=<default>, bool newslide=<default>);
+void incrementposition(pair z);
+bool checkposition();
+void numberpage(pen p=<default>);
+void normalvideo();
string texcolor(pen p);
-void color(string name, string color);
-pen foregroundcolor;
-void bibliography(string name);
-void bibliographystyle(string name);
+bool empty();
+bool havepagenumber;
int[] lastnode;
-real aboveequationskip;
-void asyfigure(string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, filltype filltype=<default>, bool newslide=<default>);
-void asyfilecode(bool center=<default>, string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>);
-bool itemstep;
-real itemskip;
+int[] firstnode;
+pen backgroundcolor;
+pen steppagenumberpen;
+real figureborder;
+pen pagenumberpen;
+pair startposition;
+void filecode(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>);
+void figure(string[] s, string options=<default>, real margin=<default>, string[] captions=<default>, string caption=<default>, string[] url=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
+void figure(string s, string options=<default>, string caption=<default>, string url=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
+pen foregroundcolor;
+string bulletcolor(string color);
+bool landscape;
+string cropcode(string s);
+void erasestep(int erasenode);
+bool reverse;
void remark(bool center=<default>, string s, pair align=<default>, pen p=<default>, real indent=<default>, bool minipage=<default>, real skip=<default>, filltype filltype=<default>, bool step=<default>);
+void exitfunction();
+pen itempen;
+pen institutionpen;
+transform tinv;
+void color(string name, string color);
void item(string s, pen p=<default>, bool step=<default>);
void usersetting();
-bool landscape;
+void setpens(pen red=<default>, pen blue=<default>, pen steppen=<default>);
+bool allowstepping;
+void titlepage(string title, string author, string institution=<default>, string date=<default>, string url=<default>, bool newslide=<default>);
+int preamblenodes;
+pair titlealign;
+pair dateskip;
+int page;
+void asycode(bool center=<default>, string s, string options=<default>, string caption=<default>, string preamble=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>);
+real pagemargin;
+void asyfigure(string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, filltype filltype=<default>, bool newslide=<default>);
+string[] codefile;
+string oldbulletcolor;
+bool firststep;
+void step();
+void equation(string s, pen p=<default>);
+void reversevideo();
+void nextpage(pen p=<default>);
+void bibliography(string name);
+pair titlepageposition;
pen authorpen;
-string cropcode(string s);
-real codeskip;
+void equations(string s, pen p=<default>);
+pen figuremattpen;
+pen urlpen;
+void asyfilecode(bool center=<default>, string s, string options=<default>, string caption=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>);
+real titleskip;
+pen codepen;
void newslide(bool stepping=<default>);
-bool allowstepping;
pair currentposition;
-pen itempen;
-bool reverse;
-void reversevideo();
-void vbox(string s, pen p=<default>);
-void asycode(bool center=<default>, string s, string options=<default>, string caption=<default>, string preamble=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>, bool newslide=<default>);
-void exitfunction();
-bool havepagenumber;
-real pageheight;
+pair pagenumberalign;
+pair pagenumberposition;
+real minipagemargin;
+bool stepping;
+bool itemstep;
real pagewidth;
+real pageheight;
picture background;
void background();
-pen backgroundcolor;
-void normalvideo();
-void title(string s, pair position=<default>, pair align=<default>, pen p=<default>, bool newslide=<default>);
-pen titlepen;
-real titleskip;
-pair dateskip;
-pair titlealign;
+real minipagewidth;
pen titlepagepen;
-void titlepage(string title, string author, string institution=<default>, string date=<default>, string url=<default>, bool newslide=<default>);
-pair titlepageposition;
-pen codepen;
-void erasestep(int erasenode);
-bool checkposition();
-void setpens(pen red=<default>, pen blue=<default>, pen steppen=<default>);
-void code(bool center=<default>, string s, pen p=<default>, real indent=<default>, real skip=<default>, filltype filltype=<default>);
-transform tinv;
+pen datepen;
+real itemskip;
+real codeskip;
+real aboveequationskip;
pair urlskip;
-void numberpage(pen p=<default>);
-pen urlpen;
-int[] firstnode;
-bool firststep;
-string asywrite(string s, string preamble=<default>);
-pair startposition;
-string oldbulletcolor;
+pen titlepen;
string newbulletcolor;
-pen datepen;
-void incrementposition(pair z);
-pen institutionpen;
-void skip(real n=<default>);
-bool stepping;
-int page;
-real pagemargin;
-pen steppagenumberpen;
-bool empty();
-void currentexitfunction();
-void step();
-string[] codefile;
-void outline(string s=<default>, pair position=<default>, pair align=<default>, pen p=<default>);
-void center(string s, pen p=<default>);
-void equation(string s, pen p=<default>);
-void equations(string s, pen p=<default>);
-void asyinclude(string s, real xsize=<default>, real ysize=<default>);
-void figure(string[] s, string options=<default>, real margin=<default>, string[] captions=<default>, string caption=<default>, string[] url=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
-void figure(string s, string options=<default>, string caption=<default>, string url=<default>, pair align=<default>, pen p=<default>, pen figuremattpen=<default>, bool final=<default>);
-real figureborder;
-void nextpage(pen p=<default>);
-pen figuremattpen;
string bullet;
-int preamblenodes;
-string bulletcolor(string color);
-real minipagewidth;
-real minipagemargin;
-real stepfraction;
path curve(pair c, real f(real, real), pair a, pair b);
path curve(pair c, real f(real), pair a, pair b);
+real stepfraction;
picture slopefield(real f(real, real), pair a, pair b, int nx=<default>, int ny=<default>, real tickfactor=<default>, pen p=<default>);
picture slopefield(real f(real), pair a, pair b, int nx=<default>, int ny=<default>, pen p=<default>);
+surface implicitsurface(real f(triple)=<default>, real ff(real, real, real)=<default>, triple a, triple b, int n=<default>, bool keyword overlapedges=<default>, int keyword nx=<default>, int keyword ny=<default>, int keyword nz=<default>, int keyword maxdepth=<default>, bool keyword usetriangles=<default>);
+evaluatedpoint[][][] make3dgrid(triple a, triple b, int nx, int ny, int nz, real f(triple), bool allowzero=<default>);
+bool checkptincube(triple pt, triple a, triple b);
+bool check_fpt_zero(triple testpoint, real f(triple), triple grad(triple));
patch[] maketriangle(path3 external, real f(triple), triple grad(triple), bool allowsubdivide=<default>);
-real B23(real t);
+triple normalout(int face);
path3 pathinface(positionedvector v1, positionedvector v2, triple facenorm, triple edge1normout, triple edge2normout);
path3 pathinface(positionedvector v1, positionedvector v2, int face, int edge1face, int edge2face);
-path3 bisector(path3 edgecycle, int[] savevertices);
-int XHIGH;
-int YHIGH;
-int ZHIGH;
-real(real)[] bernstein;
+triple projecttospan(triple toproject, triple v1, triple v2, real mincoeff=<default>);
+real[] projecttospan_findcoeffs(triple toproject, triple v1, triple v2, bool warn=<default>);
path3 pathbetween(positionedvector v1, positionedvector v2);
path3 pathbetween(path3 edgecycle, int vertex1, int vertex2);
+int[] makecircle(edge[] edges);
+int YLOW;
+int YHIGH;
+int XLOW;
+patch trianglewithnormals(path3 external, triple n1, triple n2, triple n3);
patch patchwithnormals(path3 external, triple[] u0normals, triple[] u1normals, triple[] v0normals, triple[] v1normals);
patch patchwithnormals(path3 external, triple normalat(triple));
-real angledegrees(triple a, triple b);
-triple projecttospan(triple toproject, triple v1, triple v2, real mincoeff=<default>);
-real[] projecttospan_findcoeffs(triple toproject, triple v1, triple v2, bool warn=<default>);
-triple nGrad(triple)(real f(triple));
-triple normalout(int face);
-patch[] quadpatches(path3 edgecycle, positionedvector[] corners, real f(triple), triple grad(triple), triple a, triple b, bool usetriangles);
-int[] makecircle(edge[] edges);
-real B13(real t);
-bool check_fpt_zero(triple testpoint, real f(triple), triple grad(triple));
-bool checkptincube(triple pt, triple a, triple b);
+patch[] triangletoquads(path3 external, real f(triple), triple grad(triple), triple a, triple b);
+real B23(real t);
+real B03(real t);
bool checkpt(triple testpt, real f(triple), triple grad(triple), triple a, triple b);
-int XLOW;
-int YLOW;
-int ZLOW;
+int NULL_VERTEX;
+evaluatedpoint[][] slice(evaluatedpoint[][] a, int start1, int end1, int start2, int end2);
+evaluatedpoint[][][] slice(evaluatedpoint[][][] a, int start1, int end1, int start2, int end2, int start3, int end3);
+positionedvector[][] slice(positionedvector[][] a, int start1, int end1, int start2, int end2);
+positionedvector[][][] slice(positionedvector[][][] a, int start1, int end1, int start2, int end2, int start3, int end3);
+triple nGrad(triple)(real f(triple));
+real angledegrees(triple a, triple b);
+path3 bisector(path3 edgecycle, int[] savevertices);
+int XHIGH;
+real(real)[] bernstein;
pathwithnormals_settings operator init();
intset operator init();
int_to_intset operator init();
@@ -3582,320 +3588,314 @@ edge operator init();
positionedvector operator init();
evaluatedpoint operator init();
gridwithzeros operator init();
+int ZHIGH;
string operator cast(edge e);
string operator cast(edge[] edges);
string operator cast(positionedvector vv);
triple operator cast(evaluatedpoint p);
-surface implicitsurface(real f(triple)=<default>, real ff(real, real, real)=<default>, triple a, triple b, int n=<default>, bool keyword overlapedges=<default>, int keyword nx=<default>, int keyword ny=<default>, int keyword nz=<default>, int keyword maxdepth=<default>, bool keyword usetriangles=<default>);
-bool operator ==(edge a, edge b);
-patch[] triangletoquads(path3 external, real f(triple), triple grad(triple), triple a, triple b);
-patch trianglewithnormals(path3 external, triple n1, triple n2, triple n3);
-int NULL_VERTEX;
-evaluatedpoint[][][] make3dgrid(triple a, triple b, int nx, int ny, int nz, real f(triple), bool allowzero=<default>);
-real B03(real t);
+int ZLOW;
+patch[] quadpatches(path3 edgecycle, positionedvector[] corners, real f(triple), triple grad(triple), triple a, triple b, bool usetriangles);
real B33(real t);
-evaluatedpoint[][] slice(evaluatedpoint[][] a, int start1, int end1, int start2, int end2);
-evaluatedpoint[][][] slice(evaluatedpoint[][][] a, int start1, int end1, int start2, int end2, int start3, int end3);
-positionedvector[][] slice(positionedvector[][] a, int start1, int end1, int start2, int end2);
-positionedvector[][][] slice(positionedvector[][][] a, int start1, int end1, int start2, int end2, int start3, int end3);
-revolution operator *(real[][] t, revolution r);
-skeleton operator init();
-revolution operator init();
+real B13(real t);
+bool operator ==(edge a, edge b);
revolution sphere(triple c=<default>, real r, int n=<default>);
+pen defaultbackpen;
path line(path p, path q, real[] t);
-surface surface(revolution r, int n=<default>, pen color(int i, real j)=<default>);
-void draw(picture pic=<default>, revolution r, int m=<default>, int n=<default>, pen frontpen=<default>, pen backpen=<default>, pen longitudinalpen=<default>, pen longitudinalbackpen=<default>, light light=<default>, string name=<default>, render render=<default>, projection P=<default>);
real[] tangent(path p, path q, bool side);
-pen defaultbackpen;
+void draw(picture pic=<default>, revolution r, int m=<default>, int n=<default>, pen frontpen=<default>, pen backpen=<default>, pen longitudinalpen=<default>, pen longitudinalbackpen=<default>, light light=<default>, string name=<default>, render render=<default>, projection P=<default>);
+revolution operator *(real[][] t, revolution r);
+skeleton operator init();
+revolution operator init();
path[] cylinder(path3 base, real h, triple axis=<default>, projection P);
revolution cylinder(triple c=<default>, real r, real h, triple axis=<default>);
revolution cone(triple c=<default>, real r, real h, triple axis=<default>, int n=<default>);
-real rms(real[] A);
+surface surface(revolution r, int n=<default>, pen color(int i, real j)=<default>);
+linefit leastsquares(real[] x, real[] y);
+linefit leastsquares(real[] x, real[] y, real[] w);
+real Gaussrand();
+int bins(real[] data, int max=<default>);
+void histogram(picture pic=<default>, real[] bins, real[] count, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>);
+void histogram(picture pic=<default>, real[] data, real a, real b, int n, bool normalize=<default>, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>);
+path topbox(pair a, pair b);
+path halfbox(pair a, pair b);
int[] frequency(real[] data, real[] bins);
int[] frequency(real[] data, real a, real b, int n);
int[][] frequency(real[] x, real[] y, real[] xbins, real[] ybins);
int[][] frequency(real[] x, real[] y, pair a, pair b, int nx, int ny=<default>);
int[][] frequency(pair[] z, pair a, pair b, int nx, int ny=<default>);
+real kurtosisexcess(real[] A);
+real kurtosis(real[] A);
+real skewness(real[] A);
+real rms(real[] A);
real stdev(real[] A);
-real mean(real[] A);
-int bins(real[] data, int max=<default>);
-path topbox(pair a, pair b);
-path halfbox(pair a, pair b);
-real Gaussian(real x, real sigma);
-real Gaussian(real x);
-pair Gaussrandpair();
-real Gaussrand();
real variance(real[] A);
real legendmarkersize;
real variancebiased(real[] A);
+pair Gaussrandpair();
+real mean(real[] A);
linefit operator init();
-real skewness(real[] A);
-linefit leastsquares(real[] x, real[] y);
-linefit leastsquares(real[] x, real[] y, real[] w);
-real kurtosis(real[] A);
-real kurtosisexcess(real[] A);
-void histogram(picture pic=<default>, real[] bins, real[] count, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>);
-void histogram(picture pic=<default>, real[] data, real a, real b, int n, bool normalize=<default>, real low=<default>, pen fillpen=<default>, pen drawpen=<default>, bool bars=<default>, Label legend=<default>, real markersize=<default>);
-pair[] endpoints(guide[] a);
-Relation r3;
-picture tableau(frame[] cards, bool number=<default>);
-pair min(pair[] z);
+real Gaussian(real x, real sigma);
+real Gaussian(real x);
Braid apply(Relation r, Braid b, int step, int place);
+Relation operator -(Relation r);
+Component wye;
+Component bm;
Component bp;
-Component phi;
+pair[] endpoints(guide[] a);
real gapfactor;
-Component bm;
-Component wye;
-Relation operator -(Relation r);
+Relation r4b;
Component operator init();
Braid operator init();
Relation operator init();
Syzygy operator init();
-real hwratio;
Relation r4a;
-Relation r4b;
+picture tableau(frame[] cards, bool number=<default>);
+pair min(pair[] z);
pair max(pair[] z);
-pen Orchid;
-pen Magenta;
-pen BrickRed;
-pen CadetBlue;
-pen CarnationPink;
+real hwratio;
+Relation r3;
+Component phi;
+pen Brown;
+pen OliveGreen;
pen SpringGreen;
+pen LimeGreen;
+pen PineGreen;
+pen Green;
+pen JungleGreen;
+pen SkyBlue;
+pen ProcessBlue;
+pen Blue;
+pen NavyBlue;
pen MidnightBlue;
-pen OliveGreen;
-pen Aquamarine;
-pen Apricot;
-pen Lavender;
-pen Cyan;
-pen Red;
-pen RawSienna;
-pen Mahogany;
-pen Gray;
+pen Periwinkle;
+pen BlueViolet;
+pen RoyalPurple;
+pen Violet;
pen Plum;
+pen Sepia;
+pen Black;
pen BlueGreen;
+pen Aquamarine;
pen Cerulean;
-pen Blue;
-pen BlueViolet;
-pen RedOrange;
-pen Goldenrod;
+pen Apricot;
+pen RawSienna;
+pen Orange;
+pen Rhodamine;
+pen Red;
pen ForestGreen;
-pen YellowOrange;
-pen Maroon;
pen BurntOrange;
+pen YellowOrange;
+pen Cyan;
+pen Bittersweet;
+pen Gray;
+pen GreenYellow;
+pen DarkOrchid;
+pen RedOrange;
+pen CadetBlue;
+pen Turquoise;
+pen Dandelion;
+pen Melon;
+pen RoyalBlue;
+pen Orchid;
+pen BrickRed;
+pen CornflowerBlue;
+pen Yellow;
pen YellowGreen;
pen Tan;
-pen Brown;
-pen RubineRed;
pen TealBlue;
+pen Magenta;
+pen Lavender;
+pen Mulberry;
+pen Goldenrod;
+pen WildStrawberry;
+pen SeaGreen;
pen White;
-pen Purple;
-pen Sepia;
-pen Bittersweet;
-pen Orange;
-pen OrangeRed;
-pen Fuchsia;
+pen CarnationPink;
pen Peach;
-pen PineGreen;
-pen Dandelion;
-pen VioletRed;
-pen Violet;
-pen Black;
-pen NavyBlue;
-pen Rhodamine;
-pen Thistle;
-pen ProcessBlue;
-pen LimeGreen;
-pen DarkOrchid;
-pen Green;
-pen GreenYellow;
+pen Mahogany;
+pen Maroon;
+pen OrangeRed;
+pen RubineRed;
pen Emerald;
-pen WildStrawberry;
-pen Mulberry;
-pen RedViolet;
-pen SkyBlue;
-pen SeaGreen;
-pen Periwinkle;
pen Salmon;
-pen Yellow;
-pen JungleGreen;
-pen CornflowerBlue;
-pen RoyalBlue;
-pen Melon;
-pen RoyalPurple;
-pen Turquoise;
+pen VioletRed;
+pen RedViolet;
+pen Fuchsia;
+pen Thistle;
+pen Purple;
int lookup(tree t, int key);
+bool contains(tree t, int key);
tree newtree();
-void write(file out=<default>, tree t);
tree operator init();
tree add(tree t, int key, int value);
-bool contains(tree t, int key);
-real trembleFuzz();
-real trembleAngle;
-real trembleRandom;
+void write(file out=<default>, tree t);
real trembleFrequency;
-tremble operator init();
+real trembleRandom;
+real trembleAngle;
real magneticRadius;
-void render(path3 s, real r, void f(path3, real));
-real[] sample(path3 g, real r, real relstep=<default>);
-path3 roundedpath(path3 A, real r);
-real tubegranularity;
+tremble operator init();
+real trembleFuzz();
int coloredNodes;
-int coloredSegments;
-surface surface(rmf[] R, real[] t, coloredpath cp, transform T(real), bool cyclic);
+path3 roundedpath(path3 A, real r);
surface tube(path3 g, coloredpath section, transform T(real)=<default>, real corner=<default>, real relstep=<default>);
-coloredpath operator init();
+real tubegranularity;
coloredpath operator cast(path p);
coloredpath operator cast(guide p);
real degrees(rmf a, rmf b);
-void importv3d(string name);
+int coloredSegments;
+real[] sample(path3 g, real r, real relstep=<default>);
+coloredpath operator init();
+void render(path3 s, real r, void f(path3, real));
+surface surface(rmf[] R, real[] t, coloredpath cp, transform T(real), bool cyclic);
triangleGroup operator init();
pixel operator init();
CameraInformation operator init();
v3dfile operator init();
+void importv3d(string name);
real[][] Align(real polar, real azimuth);
v3dheadertypes v3dheadertypes;
v3dheadertypes operator init();
v3dtypes v3dtypes;
v3dtypes operator init();
string VERSION;
-pen Orchid;
-pen Indigo;
-pen Cornsilk;
-pen Beige;
-pen SlateBlue;
-pen SlateGray;
-pen Magenta;
-pen CadetBlue;
-pen DeepPink;
-pen Seashell;
+pen WhiteSmoke;
+pen Wheat;
+pen Violet;
+pen Tomato;
+pen SteelBlue;
pen SpringGreen;
-pen MidnightBlue;
+pen Snow;
+pen SkyBlue;
+pen Silver;
+pen SandyBrown;
+pen SaddleBrown;
+pen RosyBrown;
+pen Purple;
+pen PowderBlue;
+pen Plum;
+pen Pink;
+pen PeachPuff;
+pen PapayaWhip;
+pen PaleVioletRed;
+pen PaleTurquoise;
+pen PaleGoldenrod;
+pen OrangeRed;
+pen Orange;
pen Olive;
-pen OliveDrab;
-pen Aquamarine;
+pen OldLace;
+pen Navy;
+pen NavajoWhite;
+pen Moccasin;
+pen MintCream;
+pen MidnightBlue;
+pen MediumTurquoise;
+pen MediumSpringGreen;
+pen MediumSlateBlue;
+pen MediumPurple;
+pen Linen;
+pen LimeGreen;
+pen Lime;
+pen LightYellow;
+pen LightSteelBlue;
+pen LightSkyBlue;
+pen LightGrey;
+pen LightGreen;
+pen LightCyan;
+pen LightCoral;
+pen LightBlue;
+pen LawnGreen;
+pen LavenderBlush;
+pen Khaki;
+pen IndianRed;
+pen HotPink;
+pen GreenYellow;
+pen Green;
+pen Goldenrod;
+pen Gold;
pen GhostWhite;
-pen Lavender;
-pen Chocolate;
-pen Cyan;
pen Gainsboro;
+pen Fuchsia;
+pen FloralWhite;
+pen DodgerBlue;
+pen DeepSkyBlue;
+pen DarkViolet;
+pen DarkSlateGray;
+pen DarkSlateBlue;
+pen DarkSeaGreen;
+pen DarkSalmon;
+pen DarkOrchid;
+pen FireBrick;
+pen Black;
+pen RoyalBlue;
+pen LightPink;
+pen DeepPink;
+pen LightSeaGreen;
+pen Maroon;
+pen LightSlateGray;
+pen Brown;
+pen BlueViolet;
+pen LightSalmon;
+pen Cyan;
+pen DimGray;
+pen Sienna;
+pen AntiqueWhite;
+pen ForestGreen;
+pen SlateBlue;
+pen Teal;
+pen DarkCyan;
+pen Peru;
+pen AliceBlue;
+pen Thistle;
+pen CadetBlue;
pen Ivory;
-pen PapayaWhip;
-pen Red;
-pen Pink;
-pen MintCream;
-pen LavenderBlush;
-pen DarkTurquoise;
-pen Wheat;
pen Gray;
+pen SlateGray;
+pen DarkOliveGreen;
+pen Turquoise;
+pen MediumAquamarine;
+pen Aqua;
+pen Red;
+pen Azure;
+pen DarkGray;
+pen LightGoldenrodYellow;
pen MediumBlue;
+pen White;
+pen Salmon;
+pen Coral;
pen MediumOrchid;
-pen MediumPurple;
-pen MediumSeaGreen;
-pen MediumSlateBlue;
-pen PeachPuff;
-pen MediumAquamarine;
-pen MediumSpringGreen;
-pen MediumTurquoise;
-pen MediumVioletRed;
-pen Plum;
pen Blue;
-pen Gold;
-pen BlueViolet;
-pen Goldenrod;
-pen ForestGreen;
-pen Lime;
-pen Maroon;
-pen SteelBlue;
-pen Chartreuse;
+pen MediumSeaGreen;
+pen Orchid;
+pen PaleGreen;
+pen CornflowerBlue;
+pen DarkOrange;
+pen Yellow;
+pen Chocolate;
+pen DarkRed;
+pen Crimson;
pen YellowGreen;
-pen NavajoWhite;
+pen Indigo;
pen Tan;
-pen DarkMagenta;
-pen AntiqueWhite;
-pen PaleTurquoise;
-pen IndianRed;
-pen Crimson;
-pen Azure;
-pen LawnGreen;
-pen Brown;
-pen BurlyWood;
-pen Moccasin;
+pen MediumVioletRed;
pen DarkBlue;
+pen OliveDrab;
+pen Magenta;
+pen MistyRose;
+pen Honeydew;
pen LemonChiffon;
-pen Peru;
-pen White;
-pen Purple;
-pen WhiteSmoke;
-pen Aqua;
-pen DimGray;
-pen Orange;
-pen OrangeRed;
-pen Fuchsia;
+pen Chartreuse;
+pen Seashell;
+pen Lavender;
+pen SeaGreen;
+pen DarkTurquoise;
+pen Cornsilk;
+pen rgbint(int r, int g, int b);
+pen Aquamarine;
+pen Beige;
pen Bisque;
-pen Honeydew;
-pen Violet;
-pen RosyBrown;
-pen Black;
-pen Khaki;
-pen FireBrick;
-pen Snow;
-pen Thistle;
-pen Sienna;
-pen LimeGreen;
-pen OldLace;
-pen DarkOrchid;
-pen Green;
-pen GreenYellow;
-pen DarkCyan;
-pen FloralWhite;
-pen DarkRed;
-pen DarkOliveGreen;
-pen DarkOrange;
pen BlanchedAlmond;
-pen PowderBlue;
-pen DarkGray;
-pen DarkGreen;
+pen BurlyWood;
pen DarkGoldenrod;
-pen SkyBlue;
-pen SeaGreen;
-pen DarkViolet;
-pen Teal;
-pen AliceBlue;
-pen Silver;
-pen HotPink;
-pen DodgerBlue;
-pen SaddleBrown;
-pen Tomato;
+pen DarkGreen;
pen DarkKhaki;
-pen SandyBrown;
-pen LightBlue;
-pen Salmon;
-pen LightCoral;
-pen LightCyan;
-pen Yellow;
-pen LightGreen;
-pen PaleGreen;
-pen Linen;
-pen LightGoldenrodYellow;
-pen LightGrey;
-pen LightPink;
-pen PaleGoldenrod;
-pen LightSalmon;
-pen LightSeaGreen;
-pen LightSkyBlue;
-pen LightSlateGray;
-pen Navy;
-pen PaleVioletRed;
-pen DeepSkyBlue;
-pen CornflowerBlue;
-pen LightSteelBlue;
-pen LightYellow;
-pen rgbint(int r, int g, int b);
-pen Coral;
-pen MistyRose;
-pen DarkSalmon;
-pen DarkSeaGreen;
-pen RoyalBlue;
-pen DarkSlateBlue;
-pen DarkSlateGray;
-pen Turquoise;
+pen DarkMagenta;
diff --git a/graphics/asymptote/asymptote.spec b/graphics/asymptote/asymptote.spec
index 3e44db050a..a27f75bdb3 100644
--- a/graphics/asymptote/asymptote.spec
+++ b/graphics/asymptote/asymptote.spec
@@ -3,7 +3,7 @@
%global __python %{__python3}
Name: asymptote
-Version: 2.92
+Version: 2.93
Release: 1%{?dist}
Summary: Descriptive vector graphics language
diff --git a/graphics/asymptote/parser.cc b/graphics/asymptote/asyparser.cc
index aa1984a174..35bca84d90 100644
--- a/graphics/asymptote/parser.cc
+++ b/graphics/asymptote/asyparser.cc
@@ -12,18 +12,20 @@
#include "common.h"
-#ifdef HAVE_SYS_STAT_H
-#include <sys/stat.h>
-#endif
-
#ifdef HAVE_LIBCURL
#include <curl/curl.h>
#endif
+#include "exithandlers.h"
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
#include "interact.h"
#include "locate.h"
#include "errormsg.h"
-#include "parser.h"
+#include "asyparser.h"
#include "util.h"
// The lexical analysis and parsing functions used by parseFile.
@@ -33,7 +35,6 @@ extern int yydebug;
extern int yy_flex_debug;
extern bool lexerEOF();
extern void reportEOF();
-extern bool hangup;
namespace parser {
diff --git a/graphics/asymptote/parser.h b/graphics/asymptote/asyparser.h
index 903ef2d5fa..2ffd1988d6 100644
--- a/graphics/asymptote/parser.h
+++ b/graphics/asymptote/asyparser.h
@@ -1,11 +1,10 @@
/*****
- * parser.h
+ * asyparser.h
* Tom Prince 2004/01/10
*
*****/
-#ifndef PARSER_H
-#define PARSER_H
+#pragma once
#include "common.h"
#include "absyn.h"
@@ -34,5 +33,3 @@ bool isURL(const string& filename);
bool readURL(stringstream& buf, const string& filename);
} // namespace parser
-
-#endif // PARSER_H
diff --git a/graphics/asymptote/process.cc b/graphics/asymptote/asyprocess.cc
index 9c3d2d313f..79e3bc4554 100644
--- a/graphics/asymptote/process.cc
+++ b/graphics/asymptote/asyprocess.cc
@@ -23,7 +23,7 @@
#include "runtime.h"
#include "texfile.h"
-#include "process.h"
+#include "asyprocess.h"
namespace camp {
pen& defaultpen() {
@@ -303,7 +303,7 @@ void itree::doExec(transMode tm) {
void printGreeting(bool interactive) {
if(!getSetting<bool>("quiet")) {
- cout << "Welcome to " << PROGRAM << " version " << REVISION;
+ cout << "Welcome to " << PACKAGE_NAME << " version " << REVISION;
if(interactive)
cout << " (to view the manual, type help)";
cout << endl;
@@ -730,11 +730,7 @@ class iprompt : public icore {
// Continue taking input until a termination command is received from xasy.
block *parseXasyLine(string line) {
-#ifdef __MSDOS__
- const string EOT="\x04\r\n";
-#else
const string EOT="\x04\n";
-#endif
string s;
while((s=getline(true)) != EOT)
line += s;
@@ -830,7 +826,7 @@ public:
} catch(interrupted&) {
em.Interrupt(false);
restart=true;
- } catch(eof&) {
+ } catch(EofException&) {
restart=false;
}
} while(restart);
diff --git a/graphics/asymptote/process.h b/graphics/asymptote/asyprocess.h
index 031111bd9b..2f80416ebf 100644
--- a/graphics/asymptote/process.h
+++ b/graphics/asymptote/asyprocess.h
@@ -7,9 +7,7 @@
* running it.
*****/
-#ifndef PROCESS_H
-#define PROCESS_H
-
+#pragma once
#include "common.h"
#include "stm.h"
@@ -19,7 +17,7 @@
#include "pen.h"
#include "dec.h"
#include "transform.h"
-#include "parser.h"
+#include "asyparser.h"
#ifdef HAVE_LIBTIRPC
#include "xstream.h"
@@ -208,5 +206,3 @@ public:
};
processDataStruct &processData();
-
-#endif
diff --git a/graphics/asymptote/backports/getopt/CMakeLists.txt b/graphics/asymptote/backports/getopt/CMakeLists.txt
new file mode 100644
index 0000000000..f94e82c009
--- /dev/null
+++ b/graphics/asymptote/backports/getopt/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.26)
+
+project(getopt)
+
+add_library(
+ getopt
+ ${CMAKE_CURRENT_LIST_DIR}/src/getopt.c
+ ${CMAKE_CURRENT_LIST_DIR}/src/getopt1.c
+)
+
+target_include_directories(
+ getopt
+ PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
+
+
+# we are requring string.h here
+
+include(CheckIncludeFile)
+
+check_include_file("string.h" HAVE_STRING_HEADER_FILE)
+
+if (HAVE_STRING_HEADER_FILE)
+ target_compile_definitions(
+ getopt
+ PRIVATE HAVE_STRING_H=1
+ )
+endif()
diff --git a/graphics/asymptote/getopt.h b/graphics/asymptote/backports/getopt/include/getopt.h
index 0648548081..0648548081 100644
--- a/graphics/asymptote/getopt.h
+++ b/graphics/asymptote/backports/getopt/include/getopt.h
diff --git a/graphics/asymptote/getopt.c b/graphics/asymptote/backports/getopt/src/getopt.c
index 9bafa453c6..9bafa453c6 100644
--- a/graphics/asymptote/getopt.c
+++ b/graphics/asymptote/backports/getopt/src/getopt.c
diff --git a/graphics/asymptote/getopt1.c b/graphics/asymptote/backports/getopt/src/getopt1.c
index 22a7efbdd1..de4dedbb25 100644
--- a/graphics/asymptote/getopt1.c
+++ b/graphics/asymptote/backports/getopt/src/getopt1.c
@@ -64,12 +64,7 @@
#endif
int
-getopt_long (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
+getopt_long (int argc, char* const* argv, const char* options, const struct option* long_options, int* opt_index)
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
}
@@ -80,12 +75,7 @@ getopt_long (argc, argv, options, long_options, opt_index)
instead. */
int
-getopt_long_only (argc, argv, options, long_options, opt_index)
- int argc;
- char *const *argv;
- const char *options;
- const struct option *long_options;
- int *opt_index;
+getopt_long_only (int argc, char* const* argv, const char* options, const struct option* long_options, int* opt_index)
{
return _getopt_internal (argc, argv, options, long_options, opt_index, 1);
}
diff --git a/graphics/asymptote/backports/glew/CMakeLists.txt b/graphics/asymptote/backports/glew/CMakeLists.txt
new file mode 100644
index 0000000000..7fdd8e9728
--- /dev/null
+++ b/graphics/asymptote/backports/glew/CMakeLists.txt
@@ -0,0 +1,10 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 3.26)
+
+project(GLEW)
+
+add_library(GLEW STATIC ${CMAKE_CURRENT_LIST_DIR}/src/glew.c)
+target_include_directories(GLEW PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include)
+
+if (WIN32)
+ target_compile_definitions(GLEW PUBLIC GLEW_STATIC)
+endif()
diff --git a/graphics/asymptote/GL/glew.h b/graphics/asymptote/backports/glew/include/GL/glew.h
index b5b6987fc7..b5b6987fc7 100644
--- a/graphics/asymptote/GL/glew.h
+++ b/graphics/asymptote/backports/glew/include/GL/glew.h
diff --git a/graphics/asymptote/GL/glxew.h b/graphics/asymptote/backports/glew/include/GL/glxew.h
index 7e39c2fd98..7e39c2fd98 100644
--- a/graphics/asymptote/GL/glxew.h
+++ b/graphics/asymptote/backports/glew/include/GL/glxew.h
diff --git a/graphics/asymptote/GL/wglew.h b/graphics/asymptote/backports/glew/include/GL/wglew.h
index 2097c0f033..2097c0f033 100644
--- a/graphics/asymptote/GL/wglew.h
+++ b/graphics/asymptote/backports/glew/include/GL/wglew.h
diff --git a/graphics/asymptote/GL/glew.c b/graphics/asymptote/backports/glew/src/glew.c
index 62cc2f563b..62cc2f563b 100644
--- a/graphics/asymptote/GL/glew.c
+++ b/graphics/asymptote/backports/glew/src/glew.c
diff --git a/graphics/asymptote/backports/optional/CMakeLists.txt b/graphics/asymptote/backports/optional/CMakeLists.txt
new file mode 100644
index 0000000000..bf506918c8
--- /dev/null
+++ b/graphics/asymptote/backports/optional/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 3.26)
+
+project(OptionalBackport)
+
+add_library(OptionalBackport INTERFACE)
+target_include_directories(OptionalBackport INTERFACE ${CMAKE_CURRENT_LIST_DIR}/include/) \ No newline at end of file
diff --git a/graphics/asymptote/optional.hpp b/graphics/asymptote/backports/optional/include/optional.hpp
index 86e3b407c6..86e3b407c6 100644
--- a/graphics/asymptote/optional.hpp
+++ b/graphics/asymptote/backports/optional/include/optional.hpp
diff --git a/graphics/asymptote/base/v3dheadertypes.asy b/graphics/asymptote/base/v3dheadertypes.asy
index 047ed0e265..3cc4d3ae17 100644
--- a/graphics/asymptote/base/v3dheadertypes.asy
+++ b/graphics/asymptote/base/v3dheadertypes.asy
@@ -1,7 +1,5 @@
// Enum class for v3dheadertypes
// AUTO-GENERATED from v3dheadertypes.csv
-// Generated at 2024-10-07 18:23:17+00:00
-
struct v3dheadertypes
{
int canvasWidth=1;
diff --git a/graphics/asymptote/base/v3dtypes.asy b/graphics/asymptote/base/v3dtypes.asy
index 7b0070c25a..e2251544ab 100644
--- a/graphics/asymptote/base/v3dtypes.asy
+++ b/graphics/asymptote/base/v3dtypes.asy
@@ -1,7 +1,5 @@
// Enum class for v3dtypes
// AUTO-GENERATED from v3dtypes.csv
-// Generated at 2024-10-07 18:23:17+00:00
-
struct v3dtypes
{
int material=1;
diff --git a/graphics/asymptote/bbox3.h b/graphics/asymptote/bbox3.h
index e2428f8c00..1011ec83a4 100644
--- a/graphics/asymptote/bbox3.h
+++ b/graphics/asymptote/bbox3.h
@@ -10,54 +10,50 @@
#include "triple.h"
-// For CYGWIN
-#undef near
-#undef far
-
namespace camp {
// The box that encloses a path
struct bbox3 {
bool empty;
- double left;
- double bottom;
- double near;
- double right;
- double top;
- double far;
+ double leftBound;
+ double bottomBound;
+ double nearBound;
+ double rightBound;
+ double topBound;
+ double farBound;
// Start bbox3 about the origin
bbox3()
- : empty(true), left(0.0), bottom(0.0), near(0.0),
- right(0.0), top(0.0), far(0.0)
+ : empty(true), leftBound(0.0), bottomBound(0.0), nearBound(0.0),
+ rightBound(0.0), topBound(0.0), farBound(0.0)
{
}
bbox3(double left, double bottom, double near,
double right, double top, double far)
- : empty(false), left(left), bottom(bottom), near(near),
- right(right), top(top), far(far)
+ : empty(false), leftBound(left), bottomBound(bottom), nearBound(near),
+ rightBound(right), topBound(top), farBound(far)
{
}
// Start a bbox3 with a point
bbox3(double x, double y, double z)
- : empty(false), left(x), bottom(y), near(z), right(x), top(y), far(z)
+ : empty(false), leftBound(x), bottomBound(y), nearBound(z), rightBound(x), topBound(y), farBound(z)
{
}
// Start a bbox3 with a point
bbox3(const triple& v)
- : empty(false), left(v.getx()), bottom(v.gety()), near(v.getz()),
- right(v.getx()), top(v.gety()), far(v.getz())
+ : empty(false), leftBound(v.getx()), bottomBound(v.gety()), nearBound(v.getz()),
+ rightBound(v.getx()), topBound(v.gety()), farBound(v.getz())
{
}
// Start a bbox3 with 2 points
bbox3(const triple& m, const triple& M)
: empty(false),
- left(m.getx()), bottom(m.gety()), near(m.getz()),
- right(M.getx()), top(M.gety()), far(M.getz())
+ leftBound(m.getx()), bottomBound(m.gety()), nearBound(m.getz()),
+ rightBound(M.getx()), topBound(M.gety()), farBound(M.getz())
{
}
@@ -70,57 +66,57 @@ struct bbox3 {
void add(double x, double y, double z)
{
if (empty) {
- left = right = x;
- top = bottom = y;
- near = far = z;
+ leftBound= rightBound= x;
+ topBound= bottomBound= y;
+ nearBound= farBound= z;
empty = false;
}
else {
- if(x < left)
- left = x;
- else if(x > right)
- right = x;
- if(y < bottom)
- bottom = y;
- else if(y > top)
- top = y;
- if(z < near)
- near = z;
- else if(z > far)
- far = z;
+ if(x < leftBound)
+ leftBound= x;
+ else if(x > rightBound)
+ rightBound= x;
+ if(y < bottomBound)
+ bottomBound= y;
+ else if(y > topBound)
+ topBound= y;
+ if(z < nearBound)
+ nearBound= z;
+ else if(z > farBound)
+ farBound= z;
}
}
// Add a point to a nonempty bbox3
void addnonempty(double x, double y, double z)
{
- if(x < left)
- left = x;
- else if(x > right)
- right = x;
- if(y < bottom)
- bottom = y;
- else if(y > top)
- top = y;
- if(z < near)
- near = z;
- else if(z > far)
- far = z;
+ if(x < leftBound)
+ leftBound= x;
+ else if(x > rightBound)
+ rightBound= x;
+ if(y < bottomBound)
+ bottomBound= y;
+ else if(y > topBound)
+ topBound= y;
+ if(z < nearBound)
+ nearBound= z;
+ else if(z > farBound)
+ farBound= z;
}
// Add (x,y) pair to a nonempty bbox3
void addnonempty(pair v)
{
double x=v.getx();
- if(x < left)
- left = x;
- else if(x > right)
- right = x;
+ if(x < leftBound)
+ leftBound= x;
+ else if(x > rightBound)
+ rightBound= x;
double y=v.gety();
- if(y < bottom)
- bottom = y;
- else if(y > top)
- top = y;
+ if(y < bottomBound)
+ bottomBound= y;
+ else if(y > topBound)
+ topBound= y;
}
// Add a point to a nonempty bbox3
@@ -134,29 +130,29 @@ struct bbox3 {
{
double x = v.getx(), y = v.gety(), z = v.getz();
- if(x < left) {
- left = x;
- times.left = t;
+ if(x < leftBound) {
+ leftBound= x;
+ times.leftBound= t;
}
- else if(x > right) {
- right = x;
- times.right = t;
+ else if(x > rightBound) {
+ rightBound= x;
+ times.rightBound= t;
}
- if(y < bottom) {
- bottom = y;
- times.bottom = t;
+ if(y < bottomBound) {
+ bottomBound= y;
+ times.bottomBound= t;
}
- else if(y > top) {
- top = y;
- times.top = t;
+ else if(y > topBound) {
+ topBound= y;
+ times.topBound= t;
}
- if(z < near) {
- near = z;
- times.near=t;
+ if(z < nearBound) {
+ nearBound= z;
+ times.nearBound=t;
}
- else if(z > far) {
- far = z;
- times.far=t;
+ else if(z > farBound) {
+ farBound= z;
+ times.farBound=t;
}
}
@@ -167,19 +163,19 @@ struct bbox3 {
}
triple Min() const {
- return triple(left,bottom,near);
+ return triple(leftBound, bottomBound, nearBound);
}
triple Max() const {
- return triple(right,top,far);
+ return triple(rightBound, topBound, farBound);
}
pair Min2() const {
- return pair(left,bottom);
+ return pair(leftBound, bottomBound);
}
pair Max2() const {
- return pair(right,top);
+ return pair(rightBound, topBound);
}
friend ostream& operator << (ostream& out, const bbox3& b)
diff --git a/graphics/asymptote/binaries/x86_64-windows/README b/graphics/asymptote/binaries/x86_64-windows/README
index 686eb44150..69ff508907 100644
--- a/graphics/asymptote/binaries/x86_64-windows/README
+++ b/graphics/asymptote/binaries/x86_64-windows/README
@@ -44,15 +44,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
Note that the MSWindows executable version of Asymptote can only be
released under the GNU General Public License (GPL) as it is linked against
the GNU Scientific Library, GNU Readline library, and other GPL
-libraries. This version of Asymptote also ships with the cygwin1.dll libraries
-noted below.
+libraries.
========================================================================
-Source code for the x86_64 and i386 3.5.1 cygwin1.dll libraries is
-available under the GPL license:
-https://www.cygwin.com/git.html
-
Source for various icons is available under the MIT license from
https://github.com/driftyco/ionicons/archive/v2.0.1.zip
https://github.com/iconic/open-iconic/archive/master.zip
diff --git a/graphics/asymptote/binaries/x86_64-windows/fftw3.dll b/graphics/asymptote/binaries/x86_64-windows/fftw3.dll
index cda503ee09..d6c470d630 100644
--- a/graphics/asymptote/binaries/x86_64-windows/fftw3.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/fftw3.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/freeglut.dll b/graphics/asymptote/binaries/x86_64-windows/freeglut.dll
index dad3d8714c..628cff1749 100644
--- a/graphics/asymptote/binaries/x86_64-windows/freeglut.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/freeglut.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/gc.dll b/graphics/asymptote/binaries/x86_64-windows/gc.dll
index 41c2e4ab9e..251ad0d4b0 100644
--- a/graphics/asymptote/binaries/x86_64-windows/gc.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/gc.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/gccpp.dll b/graphics/asymptote/binaries/x86_64-windows/gccpp.dll
index d7698514ec..e8bbc21313 100644
--- a/graphics/asymptote/binaries/x86_64-windows/gccpp.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/gccpp.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/getopt.dll b/graphics/asymptote/binaries/x86_64-windows/getopt.dll
index dec6945ebf..92a15d40c0 100644
--- a/graphics/asymptote/binaries/x86_64-windows/getopt.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/getopt.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/gsl.dll b/graphics/asymptote/binaries/x86_64-windows/gsl.dll
index ebbfc9d330..fad5b2835b 100644
--- a/graphics/asymptote/binaries/x86_64-windows/gsl.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/gsl.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/gslcblas.dll b/graphics/asymptote/binaries/x86_64-windows/gslcblas.dll
index b2c08a0f1a..76710e3981 100644
--- a/graphics/asymptote/binaries/x86_64-windows/gslcblas.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/gslcblas.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/libcurl.dll b/graphics/asymptote/binaries/x86_64-windows/libcurl.dll
index 8649116510..05b565817f 100644
--- a/graphics/asymptote/binaries/x86_64-windows/libcurl.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/libcurl.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/pthreadvc3.dll b/graphics/asymptote/binaries/x86_64-windows/pthreadvc3.dll
index 401cf98648..312e71c080 100644
--- a/graphics/asymptote/binaries/x86_64-windows/pthreadvc3.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/pthreadvc3.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/readline.dll b/graphics/asymptote/binaries/x86_64-windows/readline.dll
index 841ebddf4c..c7d6ff773c 100644
--- a/graphics/asymptote/binaries/x86_64-windows/readline.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/readline.dll
Binary files differ
diff --git a/graphics/asymptote/binaries/x86_64-windows/zlib1.dll b/graphics/asymptote/binaries/x86_64-windows/zlib1.dll
index 3229647ec3..6c1befafe4 100644
--- a/graphics/asymptote/binaries/x86_64-windows/zlib1.dll
+++ b/graphics/asymptote/binaries/x86_64-windows/zlib1.dll
Binary files differ
diff --git a/graphics/asymptote/build-scripts/HOWTO-MSWindows b/graphics/asymptote/build-scripts/HOWTO-MSWindows
index 684a3888bf..43559e3e0e 100644
--- a/graphics/asymptote/build-scripts/HOWTO-MSWindows
+++ b/graphics/asymptote/build-scripts/HOWTO-MSWindows
@@ -1,76 +1,27 @@
- Compiling MSWindows binary of Asymptote under CYGWIN-x86_64
+ Compiling MSWindows binary of Asymptote under MSVC
-First run build-asymptote on Linux. This will build the documentation
-and source tar ball and copy them to a directory ~/shared which needs to be
-shared via virtualbox to the cygwin build environment.
+First ensure that the asymptote documentation files and asymptote.sty are built under Linux.
+Copy these to the Z:\asy\asydoc directory.
-Install TeXLive and required Cygwin packages:
+Ensure git is available
+Ensure Powershell execution policy is at least unrestricted (the default for Powershell 7):
+Set-ExecutionPolicy -Scope CurrentUser unrestricted
-setup-x86_64.exe -q -P git,wget,make,patch,gcc-g++,autoconf2.5,bison,flex,w32api-headers,w32api-runtime,zlib-devel,glm-devel,automake1.15,libtool
+# TODO: Does unrestricted execution policy work by default?
+Install powershell community extensions by "Install-Module Pscx -Scope CurrentUser" (https://github.com/Pscx/Pscx)
+Install VSSetup extension for powershell by "Install-Module VSSetup -Scope CurrentUser"
-setup-x86_64.exe -q -I -P libtirpc-devel,libreadline-devel,libfftw3-devel,libgsl-devel,libcurl-devel
+Install Visual Studio Build Tools (Select CMake build tools as part of installation)
+Install python3 (https://www.python.org/)
+Install perl (https://strawberryperl.com/)
+Install LLVM (https://github.com/llvm/llvm-project/releases)
-Download wolfssl GPLV3 source code from www.wolfssl.com
+Install virtualenv:
+pip3 install virtualenv
-Build and install static libraries from /usr/src:
+Download NSIS 3+ ZIP from https://sourceforge.net/projects/nsis/ and extract to tools-cache/nsis
+(Make sure tools-cache/nsis/makensis.exe is available)
-gsl-devel:
-./configure --prefix=/usr
-make install
+# TODO: check if NSIS puts makensis in PATH or not for default installation
-readline-devel:
-./configure --prefix=/usr --disable-shared
-make install LOCAL_CFLAGS=-DNEED_EXTERN_PC
-
-fftw3-devel:
-./configure --prefix=/usr --disable-shared
-make install
-
-tirpc-devel:
-./configure --prefix=/usr --disable-gssapi
-make install
-rm -rf /usr/include/rpc
-ln -s /usr/include/tirpc/rpc /usr/include/rpc
-ln -sf /usr/include/tirpc/netconfig.h /usr/include/netconfig.h
-ln -sf /usr/lib/libtirpc.a /usr/lib/librpc.a
-
-termcap-1.3.1:
-./configure --prefix=/usr
-make install
-
-wolfssl-4.4.0-gplv3-fips-ready:
-./configure --prefix=/usr --enable-static
-make install
-
-curl-7.71.1:
-./configure --prefix=/usr --disable-shared --without-brotli --without-ssl --with-wolfssl
-make install
-
-git clone http://github.com/vectorgraphics/asymptote
-
-freeglut-3.0.0:
-patch -p1 < ~/asymptote/patches/cygwin_freeglut-3.0.0.patch
-cmake CMakeLists.txt
-make
-cp lib/libfreeglut_static.a /usr/lib/libfreeglut.a
-cp -a include/GL/*.h /usr/include/w32api/GL/
-
-mkdir -p ~/dll/cygwin
-cp /usr/bin/cygwin1.dll ~/dll/cygwin
-
-mkdir ~/CTAN
-cp -a ~/asymptote/build-scripts/README-binaries ~/CTAN
-
-cd ~/
-GCVERSION=7.6.2
-ATOMICVERSION=7.6.10
-wget http://hboehm.info/gc/gc_source/gc-$GCVERSION.tar.gz
-wget https://github.com/ivmai/libatomic_ops/releases/download/v$ATOMICVERSION/libatomic_ops-$ATOMICVERSION.tar.gz
-tar -zxf gc-$GCVERSION.tar.gz
-tar -zxf libatomic_ops-$ATOMICVERSION.tar.gz
-mv libatomic_ops-$ATOMICVERSION gc-$GCVERSION/libatomic_ops
-cd gc-$GCVERSION
-./configure --disable-shared
-make check
-
-~/asymptote/build-scripts/build-asymptote.dos <VERSION>
+./build-asymptote.ps1 <VERSION>
diff --git a/graphics/asymptote/build-scripts/build-asymptote b/graphics/asymptote/build-scripts/build-asymptote
index fe9608d8b5..fb2b0551e4 100755
--- a/graphics/asymptote/build-scripts/build-asymptote
+++ b/graphics/asymptote/build-scripts/build-asymptote
@@ -62,12 +62,13 @@ make DESTDIR="$BUILD/" latexdir=$LATEXDIR install
rm $BUILD/$BINDIR/local/info/dir
cp -a $BUILD/asymptote-$VERSION/ChangeLog .
cp -a $ASYMPTOTE/ReleaseNotes .
-make distclean
-rm -rf autom4te.cache
-cd /usr/local/share/doc/asymptote
rm -rf $SHARED/asydoc
mkdir -p $SHARED/asydoc/png
mkdir -p $SHARED/asydoc/FAQ
+cp -a $BUILD/asymptote-$VERSION/doc/asymptote.sty $SHARED/asydoc
+make distclean
+rm -rf autom4te.cache
+cd /usr/local/share/doc/asymptote
cp -a *.pdf ../../man/man1/asy.1 $SHARED/asydoc
cp -a *.pdf ../../man/man1/asy.1 $BUILD/asymptote-$VERSION/doc
cp -a /usr/local/share/info/asymptote/asymptote.info $SHARED/asydoc/png
diff --git a/graphics/asymptote/build-scripts/build-asymptote-CTAN b/graphics/asymptote/build-scripts/build-asymptote-CTAN
new file mode 100755
index 0000000000..614f892686
--- /dev/null
+++ b/graphics/asymptote/build-scripts/build-asymptote-CTAN
@@ -0,0 +1,32 @@
+#!/bin/sh -x
+GC=7.6.2
+
+MACHINE=`uname -m`
+BINDIR=x86_64-windows
+HOME=/home/$USER
+SHARED=$HOME/shared/asy
+ASYMPTOTE=$HOME/asymptote
+
+MAKEFLAGS=-j8
+export MAKEFLAGS
+
+cd $ASYMPTOTE
+VERSION=`grep AC_INIT configure.ac | cut -s -d[ -f3 | cut -s -d] -f1 | sed -e 's/git//'`
+
+cd /tmp
+echo Building asymptote-$VERSION-CTAN
+SRC=/usr/local/src/asymptote-$VERSION.src.tgz
+rm -rf asymptote-$VERSION
+tar -zxf $SRC
+cd asymptote-$VERSION
+mkdir -p binaries/$BINDIR/texlive
+cd binaries/$BINDIR
+cp $SHARED/CTAN/asy.exe texlive
+cp $SHARED/CTAN/dll/*.dll .
+cp -a ../../README .
+cp -a ../../build-scripts/README-binaries texlive/README
+cd ../../..
+rm -rf asymptote
+mv asymptote-$VERSION asymptote
+tar cfz asymptote-$VERSION-CTAN.tgz asymptote
+cp asymptote-$VERSION-CTAN.tgz $SHARED
diff --git a/graphics/asymptote/build-scripts/build-asymptote.dos b/graphics/asymptote/build-scripts/build-asymptote.dos
deleted file mode 100755
index 154d8a295f..0000000000
--- a/graphics/asymptote/build-scripts/build-asymptote.dos
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh -x
-GC=7.6.2
-
-MACHINE=`uname -m`
-if [ $MACHINE == i686 ]; then
-BINDIR=i386-windows
-HEAPSIZE=2048
-else
-BINDIR=x86_64-windows
-HEAPSIZE=4096
-fi
-SHARED=~/shared/asy
-MAKEFLAGS=-j8
-export MAKEFLAGS
-VERSION=$1
-if [ -z $VERSION ]; then
-VERSION=`grep AC_INIT configure.ac | cut -s -d[ -f3 | cut -s -d] -f1`
-if [ -z $VERSION ]; then
-echo Usage: $0 VERSION
-exit
-fi
-else
-echo Building asymptote-$VERSION
-cd ~/
-rm -rf asymptote-$VERSION
-mkdir -p CTAN
-rm -rf CTAN/asymptote
-cd CTAN
-tar -vzxf $SHARED/asymptote-$VERSION.src.tgz | grep "/\." | xargs rm -rf
-mv asymptote-$VERSION asymptote
-cd ..
-tar -zxf $SHARED/asymptote-$VERSION.src.tgz
-mkdir -p CTAN/asymptote/binaries/$BINDIR/texlive
-cd asymptote-$VERSION
-fi
-BUILD=build-$VERSION
-ln -sf ../gc-$GC.tar.gz .
-ln -sf ../gc-$GC .
-make -n MSDOS=1 >& /dev/null || ./configure OSTYPE=msdos --enable-gc=$GC --disable-lsp --with-latex=/usr/local/share --with-context=/usr/local/share
-rm -rf $BUILD
-mkdir -p $BUILD
-cp -a $HOME/dll/cygwin/*.dll $BUILD
-cp /etc/pki/tls/certs/ca-bundle.crt $BUILD
-chmod 0644 $BUILD/*.dll
-cp -a $BUILD/*.dll ~/CTAN/asymptote/binaries/$BINDIR/
-make MSDOS=1 DESTDIR="$BUILD/" docdir="$BUILD/"
-test -f asy.list || make MSDOS=1 keywords DESTDIR="$BUILD/" docdir="$BUILD/"
-make MSDOS=1 install-asy DESTDIR="$BUILD/" docdir="$BUILD/"
-peflags --cygwin-heap=$HEAPSIZE asy.exe
-cp asy.ico README LICENSE* $BUILD
-pushd $BUILD
-mv usr/local/bin/* .
-mv usr/local/share/asymptote/GUI .
-rm -rf usr/local/share/asymptote/GUI
-mv usr/local/share/asymptote/* .
-cp $SHARED/asydoc/*.pdf .
-rm -rf bin share doc usr
-popd
-echo \!define PRODUCT_VERSION \"$VERSION\" > AsymptoteInstallInfo.nsi
-# generate uninstallation commands
-ls -p1 $BUILD \
- | awk '{ if(index($0,"/")==length($0)) print "RMDir /r $INSTDIR\\" substr($0,0,length($0)-1); else print "Delete $INSTDIR\\" $0 }' \
- > AsymptoteUninstallList.nsi
-
-rm $BUILD/xasy
-if [ $MACHINE == i686 ]; then
-sed asymptote.nsi -e 's/$PROGRAMFILES64/$PROGRAMFILES/g' > asymptote32.nsi
-/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe asymptote32.nsi
-SUFFIX=-i386_32
-else
-/cygdrive/c/Program\ Files\ \(x86\)/NSIS/makensis.exe asymptote.nsi
-SUFFIX=
-fi
-cp -a --no-preserve=mode asymptote-$VERSION-setup.exe $SHARED/asymptote-$VERSION-setup$SUFFIX.exe
-mv asymptote-$VERSION-setup.exe ~/asymptote-$VERSION-setup$SUFFIX.exe
-
-cd ~/
-rm -rf asymptote-${VERSION}TL || exit
-cp -a asymptote-$VERSION asymptote-${VERSION}TL
-sed asymptote-$VERSION/config.h -e 's/ASYMPTOTE_SYSDIR ".*"/ASYMPTOTE_SYSDIR ""/g' > asymptote-${VERSION}TL/config.h
-#sed asymptote-$VERSION/configure.ac -e 's/\-std=c++11//g' > asymptote-${VERSION}TL/configure.ac
-touch -r asymptote-$VERSION/config.h asymptote-${VERSION}TL/config.h
-touch -r asymptote-$VERSION/configure.ac asymptote-${VERSION}TL/configure.ac
-cd asymptote-${VERSION}TL
-rm settings.o
-rm -f doc/*.aux doc/*.log doc/*.dvi
-make MSDOS=1 DESTDIR="$BUILD/"
-peflags --cygwin-heap=4096 asy.exe
-make MSDOS=1 install-asy DESTDIR="$BUILD/"
-mv $BUILD/usr/local/bin/asy.exe $BUILD
-cp $BUILD/asy.exe ~/CTAN/asymptote/binaries/$BINDIR/texlive
-cp -a configure.ac ~/CTAN/asymptote/
-cp -a $SHARED/asydoc/* ~/CTAN/asymptote/doc
-cd ~/CTAN/asymptote/binaries/$BINDIR
-cp -a ../../README .
-cd ~/CTAN
-cp -a ~/asymptote/build-scripts/README-binaries asymptote/binaries/$BINDIR/texlive/README
-SHAREDBIN=$SHARED/CTAN/asymptote
-if [ $MACHINE == i686 ]; then
-mkdir -p $SHAREDBIN
-cp -a asymptote/binaries/$BINDIR $SHAREDBIN
-else
-cp -a $SHAREDBIN/i386-windows ~/CTAN/asymptote/binaries
-fi
-tar cfz asymptote-$VERSION-CTAN.tgz asymptote
-cp -a --no-preserve=mode asymptote-$VERSION-CTAN.tgz $SHARED
diff --git a/graphics/asymptote/build-scripts/build-asymptote.ps1 b/graphics/asymptote/build-scripts/build-asymptote.ps1
new file mode 100644
index 0000000000..97a47f3693
--- /dev/null
+++ b/graphics/asymptote/build-scripts/build-asymptote.ps1
@@ -0,0 +1,268 @@
+#!/usr/bin/env pwsh
+<#
+.SYNOPSIS
+ Script to build asymptote
+.DESCRIPTION
+ Builds asymptote installer file.
+ This script uses asymptote source directory. If building fails, try removing cmake-build-msvc/release directory
+.PARAMETER Version
+ Specifies Asymptote version to build. If not given, will automatically determine version from configure.ac.
+#>
+param(
+ [AllowEmptyString()]
+ [Parameter()]
+ [string]$Version
+)
+$usageString="Usage: $PSCommandPath -Version <version>"
+
+$asymptoteRoot="$(Split-Path -Parent $PSCommandPath)/.."
+
+if (-Not (Test-Path -PathType container $asymptoteRoot))
+{
+ Write-Error "No asymptote root found. Exiting."
+ Break
+}
+
+# ----------------------------------------------------
+# checking documentation files
+
+if ($env:ASYMPTOTE_BUILD_SHARED_DIRECTORY)
+{
+ $extfilesRoot="$env:ASYMPTOTE_BUILD_SHARED_DIRECTORY/asydoc"
+}
+else
+{
+ $extfilesRoot = "asydoc"
+}
+
+$requiredDocumentationFiles=@(
+ "asymptote.sty"
+ "asymptote.pdf"
+ "asy-latex.pdf"
+ "CAD.pdf"
+ "TeXShopAndAsymptote.pdf"
+ "asyRefCard.pdf"
+)
+
+$hasDocFiles=$true
+foreach ($requiredDocFile in $requiredDocumentationFiles) {
+ if (-Not (Test-Path -PathType leaf "$extfilesRoot/$requiredDocFile")) {
+ $hasDocFiles=$false
+ Write-Error "$requiredDocFile not found.
+Please ensure $requiredDocFile is available in $extfilesRoot directory"
+ }
+}
+
+if (-Not $hasDocFiles) {
+ Write-Error "Documentation file(s) are not present in $extFilesRoot directory. Will not build asymptote."
+ Break
+}
+
+# ----------------------------------------------------
+# tools cache
+$toolscacheRoot="tools-cache"
+New-Item -ItemType Directory -Path $toolscacheRoot -Force
+
+$useToolsCacheVcpkg=$false
+
+# tools cache variables
+$vcpkgSha256="e590c2b30c08caf1dd8d612ec602a003f9784b7d"
+
+# vcpkg
+if (-Not $env:VCPKG_ROOT)
+{
+ $vcpkgToolsCacheLoc = "$toolscacheRoot/vcpkg"
+ Write-Host "VCPKG_ROOT Not found, checking for $vcpkgToolsCacheLoc"
+ if (-Not (Test-Path -PathType Container $vcpkgToolsCacheLoc))
+ {
+ git clone https://github.com/microsoft/vcpkg.git "$vcpkgToolsCacheLoc"
+ }
+ else
+ {
+ Write-Host "vcpkg directory found"
+ }
+ git -C $vcpkgToolsCacheLoc fetch
+ git -C $vcpkgToolsCacheLoc reset --hard $vcpkgSha256
+
+ if (-Not (Test-Path $vcpkgToolsCacheLoc/vcpkg.exe))
+ {
+ Push-Location $vcpkgToolsCacheLoc
+ & ./bootstrap-vcpkg.bat
+ Pop-Location
+ }
+
+ $useToolsCacheVcpkg=true
+}
+else
+{
+ Write-Host "Using VCPKG_ROOT at $($env:VCPKG_ROOT)"
+}
+
+# ------------------------------------------------------
+# checking for NSIS
+$makeNsisLoc=$null
+
+# checking for downloaded nsis
+if ($null -eq $makeNsisLoc)
+{
+ $nsisToolsCacheRoot="$toolscacheRoot/nsis"
+ $downloadedNsis = "$nsisToolsCacheRoot/makensis.exe"
+ if (Test-Path -PathType leaf $downloadedNsis)
+ {
+ Write-Host "Found downloaded NSIS at $downloadedNsis"
+ $makeNsisLoc=$downloadedNsis
+ }
+}
+
+# checking registry & install location
+if ($null -eq $makeNsisLoc)
+{
+ $nsisInstallEntry = Get-ItemProperty `
+ -Path HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\NSIS `
+ -Name InstallLocation `
+ -ErrorAction SilentlyContinue
+
+ if ($null -ne $nsisInstallEntry)
+ {
+ # entry found for registry
+ $nsisTestPath = "$( $nsisInstallEntry.InstallLocation )/makensis.exe"
+ if (Test-Path -PathType leaf $nsisTestPath)
+ {
+ Write-Host "Found installed NSIS. Using NSIS at $nsisTestPath"
+ $makeNsisLoc = $nsisTestPath
+ }
+ }
+}
+
+# check in tools-cache/nsis
+if ($null -Eq $makeNsisLoc)
+{
+ $nsisPathExec = Get-Command makensis -ErrorAction ignore
+ if ($null -Ne $nsisPathExec)
+ {
+ Write-Host "Found NSIS in PATH at $($makeNsisLoc.Path)".
+ $makeNsisLoc=$nsisPathExec.Path
+ }
+}
+
+# nsis not found
+if ($null -eq $makeNsisLoc)
+{
+ Write-Error "Cannot find NSIS. Please either
+(1, Recommended) Install NSIS from https://sourceforge.net/projects/nsis/
+(2) Download NSIS ZIP and extract the files to $toolscacheRoot so that $nsisToolsCacheRoot/makensis.exe
+ is available
+"
+ Break
+}
+
+# ------------------------------------------------
+# python
+$pyVenvLocation="$toolscacheRoot/pyxasy"
+$pyXasyActivateScript="$pyVenvLocation/Scripts/activate.ps1"
+if (-Not (Test-Path -PathType leaf $pyXasyActivateScript))
+{
+ python -m virtualenv $pyVenvLocation
+}
+
+# ----------------------------------------------------
+# cloning asymptote
+if (Test-Path asymptote)
+{
+ Remove-Item -Force -Recurse asymptote
+}
+
+# ----------------------------------------------------
+# determine version, if not given in arguments
+
+if (0 -eq $Version.Length) {
+ Write-Host "Version not given; will try to determine version"
+ Push-Location $asymptoteRoot
+ $Version=python generate_asy_ver_info.py --version-for-release
+ if (0 -ne $LASTEXITCODE) {
+ Write-Error $usageString
+ Write-Error "Cannot automatically determine release asymptote version. Please specify the version manually"
+ Pop-Location
+ Break
+ }
+ Pop-Location
+ Write-Host "Asymptote version is $Version"
+}
+
+# ----------------------------------------------------
+# build GUI
+& $pyXasyActivateScript
+Push-Location $asymptoteRoot/GUI
+& python -m pip install -r requirements.txt -r requirements.dev.txt
+& python buildtool.py build --version-override=$Version
+Pop-Location
+
+
+# ----------------------------------------------------
+
+function buildAsy($preset, $cfgDir) {
+ # build C++ side
+ Import-VisualStudioVars -Architecture x64
+ Push-EnvironmentBlock
+ $env:ASY_VERSION_OVERRIDE = $Version
+ if ($useToolsCacheVcpkg)
+ {
+ $env:VCPKG_ROOT = $vcpkgToolsCacheLoc
+ }
+ Push-Location $asymptoteRoot
+ cmake --preset $preset
+ Pop-Location
+ cmake --build $asymptoteRoot/$cfgDir --target asy-pre-nsis-targets -j
+ Pop-EnvironmentBlock # ASY_VERSION_OVERRIDE, VCPKG_ROOT
+ Pop-EnvironmentBlock # Visual studio vars
+ # install to pre-installation root
+}
+
+buildAsy msvc/release-with-external-doc-files cmake-build-msvc/release
+cmake --install $asymptoteRoot/cmake-build-msvc/release --component asy-pre-nsis
+
+# ------------------------------------------------------
+# Generate NSIS installer file
+& $asymptoteRoot/cmake-install-w32-nsis-release/build-asy-installer.ps1 "$makeNsisLoc"
+
+$asySetupFile="$asymptoteRoot/cmake-install-w32-nsis-release/asymptote-$Version-setup.exe"
+
+if (Test-Path -PathType leaf "asymptote-$Version-setup.exe")
+{
+ Write-Host "Found old setup file. Will delete the file."
+ Remove-Item -Force "asymptote-$Version-setup.exe"
+}
+
+if (Test-Path -PathType leaf $asySetupFile)
+{
+ Move-Item $asySetupFile . -Force
+}
+else
+{
+ Write-Error "Asymptote setup file not built."
+ Break
+}
+
+# ------------------------------------------------------
+# building for CTAN
+
+buildAsy msvc/release-with-external-doc-file-ctan cmake-build-msvc/release
+
+if ($env:ASYMPTOTE_BUILD_SHARED_DIRECTORY)
+{
+ Write-Output "Using shared build directory at $ASYMPTOTE_BUILD_SHARED_DIRECTORY for CTAN output"
+ $ctanOutputDir = "$env:ASYMPTOTE_BUILD_SHARED_DIRECTORY/CTAN"
+}
+else
+{
+ Write-Output "No shared directory specified. Using CTAN directory at top-level"
+ $ctanOutputDir = "CTAN"
+}
+
+New-Item -ItemType Directory -Path "$ctanOutputDir" -Force
+New-Item -ItemType Directory -Path "$ctanOutputDir/dll" -Force
+Get-ChildItem "$asymptoteRoot/cmake-install-w32-nsis-release/build-$Version/" `
+ -Filter "*.dll" | Copy-Item -Destination "$ctanOutputDir/dll"
+Copy-Item $asymptoteRoot/cmake-build-msvc/release/asy.exe -Destination "$ctanOutputDir/asy.exe"
+
+Pop-Location # asymptote
diff --git a/graphics/asymptote/camp.l b/graphics/asymptote/camp.l
index b4074058e8..1415443563 100644
--- a/graphics/asymptote/camp.l
+++ b/graphics/asymptote/camp.l
@@ -39,7 +39,7 @@ Int tokPos;
Int charPos;
//int commentDepth = 0;
-bool eof;
+bool isEof;
string eofMessage;
extern errorstream em;
@@ -62,7 +62,7 @@ void setlexer(input_f input, string filename)
yy_input = input;
tokPos = charPos = 1;
- eof=false;
+ isEof=false;
eofMessage="<no eof>";
}
@@ -151,7 +151,7 @@ void error(void)
// the error message that should be reported, and may differ if, say the input
// ends in the middle of a string or comment.
void setEOF(string message) {
- eof=true;
+ isEof=true;
eofMessage=message;
}
@@ -159,13 +159,13 @@ void setEOF(string message) {
// running out of input.
bool lexerEOF()
{
- return eof;
+ return isEof;
}
// Called by code outside of the lexer when it wants to report the unexpected
// eof as an error (instead of looking for more input).
void reportEOF() {
- assert(eof);
+ assert(isEof);
error();
em << eofMessage;
em.sync(true);
@@ -375,7 +375,7 @@ static {adjust(); makemod(trans::EXPLICIT_STATIC);
public {adjust(); makeperm(trans::PUBLIC); return PERM; }
private {adjust(); makeperm(trans::PRIVATE); return PERM; }
restricted {adjust(); makeperm(trans::RESTRICTED); return PERM; }
-this {adjust(); return THIS; }
+this {adjust(); return THIS_TOK; }
explicit {adjust(); return EXPLICIT; }
diff --git a/graphics/asymptote/camp.tab.cc b/graphics/asymptote/camp.tab.cc
index d6f4602701..250c15ad55 100644
--- a/graphics/asymptote/camp.tab.cc
+++ b/graphics/asymptote/camp.tab.cc
@@ -126,7 +126,7 @@ using namespace absyntax;
using sym::symbol;
using mem::string;
-#line 130 "camp.tab.c"
+#line 130 "camp.tab.cc"
# ifndef YY_CAST
# ifdef __cplusplus
@@ -221,7 +221,7 @@ enum yysymbol_kind_t
YYSYMBOL_BREAK = 64, /* BREAK */
YYSYMBOL_CONTINUE = 65, /* CONTINUE */
YYSYMBOL_RETURN_ = 66, /* RETURN_ */
- YYSYMBOL_THIS = 67, /* THIS */
+ YYSYMBOL_THIS_TOK = 67, /* THIS_TOK */
YYSYMBOL_EXPLICIT = 68, /* EXPLICIT */
YYSYMBOL_GARBAGE = 69, /* GARBAGE */
YYSYMBOL_LIT = 70, /* LIT */
@@ -720,9 +720,9 @@ static const char *const yytname[] =
"AND", "'{'", "'}'", "'('", "')'", "'.'", "','", "'['", "']'", "';'",
"ELLIPSIS", "ACCESS", "UNRAVEL", "IMPORT", "INCLUDE", "FROM", "QUOTE",
"STRUCT", "TYPEDEF", "NEW", "IF", "ELSE", "WHILE", "DO", "FOR", "BREAK",
- "CONTINUE", "RETURN_", "THIS", "EXPLICIT", "GARBAGE", "LIT", "STRING",
- "PERM", "MODIFIER", "UNARY", "EXP_IN_PARENS_RULE", "$accept", "file",
- "fileblock", "bareblock", "name", "runnable", "modifiers", "dec",
+ "CONTINUE", "RETURN_", "THIS_TOK", "EXPLICIT", "GARBAGE", "LIT",
+ "STRING", "PERM", "MODIFIER", "UNARY", "EXP_IN_PARENS_RULE", "$accept",
+ "file", "fileblock", "bareblock", "name", "runnable", "modifiers", "dec",
"decdec", "decdeclist", "typeparam", "typeparamlist", "idpair",
"idpairlist", "strid", "stridpair", "stridpairlist", "vardec",
"barevardec", "type", "celltype", "dims", "dimexps", "decidlist",
@@ -1845,176 +1845,176 @@ yyreduce:
case 2: /* file: fileblock */
#line 195 "camp.y"
{ absyntax::root = (yyvsp[0].b); }
-#line 1849 "camp.tab.c"
+#line 1849 "camp.tab.cc"
break;
case 3: /* fileblock: %empty */
#line 199 "camp.y"
{ (yyval.b) = new file(lexerPos(), false); }
-#line 1855 "camp.tab.c"
+#line 1855 "camp.tab.cc"
break;
case 4: /* fileblock: fileblock runnable */
#line 201 "camp.y"
{ (yyval.b) = (yyvsp[-1].b); (yyval.b)->add((yyvsp[0].run)); }
-#line 1861 "camp.tab.c"
+#line 1861 "camp.tab.cc"
break;
case 5: /* bareblock: %empty */
#line 205 "camp.y"
{ (yyval.b) = new block(lexerPos(), true); }
-#line 1867 "camp.tab.c"
+#line 1867 "camp.tab.cc"
break;
case 6: /* bareblock: bareblock runnable */
#line 207 "camp.y"
{ (yyval.b) = (yyvsp[-1].b); (yyval.b)->add((yyvsp[0].run)); }
-#line 1873 "camp.tab.c"
+#line 1873 "camp.tab.cc"
break;
case 7: /* name: ID */
#line 211 "camp.y"
{ (yyval.n) = new simpleName((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 1879 "camp.tab.c"
+#line 1879 "camp.tab.cc"
break;
case 8: /* name: name '.' ID */
#line 212 "camp.y"
{ (yyval.n) = new qualifiedName((yyvsp[-1].pos), (yyvsp[-2].n), (yyvsp[0].ps).sym); }
-#line 1885 "camp.tab.c"
+#line 1885 "camp.tab.cc"
break;
case 9: /* name: '%' */
#line 213 "camp.y"
{ (yyval.n) = new simpleName((yyvsp[0].ps).pos,
symbol::trans("operator answer")); }
-#line 1892 "camp.tab.c"
+#line 1892 "camp.tab.cc"
break;
case 10: /* runnable: dec */
#line 218 "camp.y"
{ (yyval.run) = (yyvsp[0].d); }
-#line 1898 "camp.tab.c"
+#line 1898 "camp.tab.cc"
break;
case 11: /* runnable: stm */
#line 219 "camp.y"
{ (yyval.run) = (yyvsp[0].s); }
-#line 1904 "camp.tab.c"
+#line 1904 "camp.tab.cc"
break;
case 12: /* runnable: modifiers dec */
#line 221 "camp.y"
{ (yyval.run) = new modifiedRunnable((yyvsp[-1].ml)->getPos(), (yyvsp[-1].ml), (yyvsp[0].d)); }
-#line 1910 "camp.tab.c"
+#line 1910 "camp.tab.cc"
break;
case 13: /* runnable: modifiers stm */
#line 223 "camp.y"
{ (yyval.run) = new modifiedRunnable((yyvsp[-1].ml)->getPos(), (yyvsp[-1].ml), (yyvsp[0].s)); }
-#line 1916 "camp.tab.c"
+#line 1916 "camp.tab.cc"
break;
case 14: /* modifiers: MODIFIER */
#line 227 "camp.y"
{ (yyval.ml) = new modifierList((yyvsp[0].mod).pos); (yyval.ml)->add((yyvsp[0].mod).val); }
-#line 1922 "camp.tab.c"
+#line 1922 "camp.tab.cc"
break;
case 15: /* modifiers: PERM */
#line 228 "camp.y"
{ (yyval.ml) = new modifierList((yyvsp[0].perm).pos); (yyval.ml)->add((yyvsp[0].perm).val); }
-#line 1928 "camp.tab.c"
+#line 1928 "camp.tab.cc"
break;
case 16: /* modifiers: modifiers MODIFIER */
#line 230 "camp.y"
{ (yyval.ml) = (yyvsp[-1].ml); (yyval.ml)->add((yyvsp[0].mod).val); }
-#line 1934 "camp.tab.c"
+#line 1934 "camp.tab.cc"
break;
case 17: /* modifiers: modifiers PERM */
#line 232 "camp.y"
{ (yyval.ml) = (yyvsp[-1].ml); (yyval.ml)->add((yyvsp[0].perm).val); }
-#line 1940 "camp.tab.c"
+#line 1940 "camp.tab.cc"
break;
case 18: /* dec: vardec */
#line 236 "camp.y"
{ (yyval.d) = (yyvsp[0].vd); }
-#line 1946 "camp.tab.c"
+#line 1946 "camp.tab.cc"
break;
case 19: /* dec: fundec */
#line 237 "camp.y"
{ (yyval.d) = (yyvsp[0].d); }
-#line 1952 "camp.tab.c"
+#line 1952 "camp.tab.cc"
break;
case 20: /* dec: typedec */
#line 238 "camp.y"
{ (yyval.d) = (yyvsp[0].d); }
-#line 1958 "camp.tab.c"
+#line 1958 "camp.tab.cc"
break;
case 21: /* dec: ACCESS stridpairlist ';' */
#line 240 "camp.y"
{ (yyval.d) = new accessdec((yyvsp[-2].pos), (yyvsp[-1].ipl)); }
-#line 1964 "camp.tab.c"
+#line 1964 "camp.tab.cc"
break;
case 22: /* dec: FROM name UNRAVEL idpairlist ';' */
#line 242 "camp.y"
{ (yyval.d) = new unraveldec((yyvsp[-4].pos), (yyvsp[-3].n), (yyvsp[-1].ipl)); }
-#line 1970 "camp.tab.c"
+#line 1970 "camp.tab.cc"
break;
case 23: /* dec: FROM name UNRAVEL '*' ';' */
#line 244 "camp.y"
{ (yyval.d) = new unraveldec((yyvsp[-4].pos), (yyvsp[-3].n), WILDCARD); }
-#line 1976 "camp.tab.c"
+#line 1976 "camp.tab.cc"
break;
case 24: /* dec: UNRAVEL name ';' */
#line 245 "camp.y"
{ (yyval.d) = new unraveldec((yyvsp[-2].pos), (yyvsp[-1].n), WILDCARD); }
-#line 1982 "camp.tab.c"
+#line 1982 "camp.tab.cc"
break;
case 25: /* dec: FROM strid ACCESS idpairlist ';' */
#line 247 "camp.y"
{ (yyval.d) = new fromaccessdec((yyvsp[-4].pos), (yyvsp[-3].ps).sym, (yyvsp[-1].ipl)); }
-#line 1988 "camp.tab.c"
+#line 1988 "camp.tab.cc"
break;
case 26: /* dec: FROM strid ACCESS '*' ';' */
#line 249 "camp.y"
{ (yyval.d) = new fromaccessdec((yyvsp[-4].pos), (yyvsp[-3].ps).sym, WILDCARD); }
-#line 1994 "camp.tab.c"
+#line 1994 "camp.tab.cc"
break;
case 27: /* dec: IMPORT stridpair ';' */
#line 251 "camp.y"
{ (yyval.d) = new importdec((yyvsp[-2].pos), (yyvsp[-1].ip)); }
-#line 2000 "camp.tab.c"
+#line 2000 "camp.tab.cc"
break;
case 28: /* dec: INCLUDE ID ';' */
#line 252 "camp.y"
{ (yyval.d) = new includedec((yyvsp[-2].pos), (yyvsp[-1].ps).sym); }
-#line 2006 "camp.tab.c"
+#line 2006 "camp.tab.cc"
break;
case 29: /* dec: INCLUDE STRING ';' */
#line 254 "camp.y"
{ (yyval.d) = new includedec((yyvsp[-2].pos), (yyvsp[-1].stre)->getString()); }
-#line 2012 "camp.tab.c"
+#line 2012 "camp.tab.cc"
break;
case 30: /* dec: TYPEDEF IMPORT '(' typeparamlist ')' ';' */
#line 258 "camp.y"
{ (yyval.d) = new receiveTypedefDec((yyvsp[-5].pos), (yyvsp[-2].tps)); }
-#line 2018 "camp.tab.c"
+#line 2018 "camp.tab.cc"
break;
case 31: /* dec: IMPORT TYPEDEF '(' typeparamlist ')' ';' */
@@ -2022,7 +2022,7 @@ yyreduce:
{ (yyval.d) = new badDec((yyvsp[-5].pos), (yyvsp[-5].pos),
"Expected 'typedef import(<types>);'");
}
-#line 2026 "camp.tab.c"
+#line 2026 "camp.tab.cc"
break;
case 32: /* dec: ACCESS strid '(' decdeclist ')' ID ID ';' */
@@ -2030,13 +2030,13 @@ yyreduce:
{ (yyval.d) = new templateAccessDec(
(yyvsp[-7].pos), (yyvsp[-6].ps).sym, (yyvsp[-4].fls), (yyvsp[-2].ps).sym, (yyvsp[-1].ps).sym, (yyvsp[-2].ps).pos
); }
-#line 2034 "camp.tab.c"
+#line 2034 "camp.tab.cc"
break;
case 33: /* dec: ACCESS strid '(' decdeclist ')' ';' */
#line 269 "camp.y"
{ (yyval.d) = new badDec((yyvsp[-5].pos), (yyvsp[0].pos), "expected 'as'"); }
-#line 2040 "camp.tab.c"
+#line 2040 "camp.tab.cc"
break;
case 34: /* dec: IMPORT strid '(' decdeclist ')' ';' */
@@ -2046,13 +2046,13 @@ yyreduce:
"conflicts. Try "
"'access <module>(<type parameters>) as <newname>;'."
); }
-#line 2050 "camp.tab.c"
+#line 2050 "camp.tab.cc"
break;
case 35: /* dec: FROM strid '(' decdeclist ')' ACCESS idpairlist ';' */
#line 277 "camp.y"
{ (yyval.d) = new fromaccessdec((yyvsp[-7].pos), (yyvsp[-6].ps).sym, (yyvsp[-1].ipl), (yyvsp[-4].fls)); }
-#line 2056 "camp.tab.c"
+#line 2056 "camp.tab.cc"
break;
case 36: /* decdec: ID ASSIGN type */
@@ -2060,428 +2060,428 @@ yyreduce:
{ (yyval.fl) = new formal(
(yyvsp[-2].ps).pos, (yyvsp[0].t), new decidstart((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym)
); }
-#line 2064 "camp.tab.c"
+#line 2064 "camp.tab.cc"
break;
case 37: /* decdec: type */
#line 286 "camp.y"
{ (yyval.fl) = new formal((yyvsp[0].t)->getPos(), (yyvsp[0].t), nullptr); }
-#line 2070 "camp.tab.c"
+#line 2070 "camp.tab.cc"
break;
case 38: /* decdeclist: decdec */
#line 291 "camp.y"
{ (yyval.fls) = new formals((yyvsp[0].fl)->getPos()); (yyval.fls)->add((yyvsp[0].fl)); }
-#line 2076 "camp.tab.c"
+#line 2076 "camp.tab.cc"
break;
case 39: /* decdeclist: decdeclist ',' decdec */
#line 293 "camp.y"
{ (yyval.fls) = (yyvsp[-2].fls); (yyval.fls)->add((yyvsp[0].fl)); }
-#line 2082 "camp.tab.c"
+#line 2082 "camp.tab.cc"
break;
case 40: /* typeparam: ID */
#line 297 "camp.y"
{ (yyval.tp) = new typeParam((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2088 "camp.tab.c"
+#line 2088 "camp.tab.cc"
break;
case 41: /* typeparamlist: typeparam */
#line 302 "camp.y"
{ (yyval.tps) = new typeParamList((yyvsp[0].tp)->getPos()); (yyval.tps)->add((yyvsp[0].tp)); }
-#line 2094 "camp.tab.c"
+#line 2094 "camp.tab.cc"
break;
case 42: /* typeparamlist: typeparamlist ',' typeparam */
#line 304 "camp.y"
{ (yyval.tps) = (yyvsp[-2].tps); (yyval.tps)->add((yyvsp[0].tp)); }
-#line 2100 "camp.tab.c"
+#line 2100 "camp.tab.cc"
break;
case 43: /* idpair: ID */
#line 308 "camp.y"
{ (yyval.ip) = new idpair((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2106 "camp.tab.c"
+#line 2106 "camp.tab.cc"
break;
case 44: /* idpair: ID ID ID */
#line 310 "camp.y"
{ (yyval.ip) = new idpair((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym, (yyvsp[-1].ps).sym , (yyvsp[0].ps).sym); }
-#line 2112 "camp.tab.c"
+#line 2112 "camp.tab.cc"
break;
case 45: /* idpairlist: idpair */
#line 314 "camp.y"
{ (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[0].ip)); }
-#line 2118 "camp.tab.c"
+#line 2118 "camp.tab.cc"
break;
case 46: /* idpairlist: idpairlist ',' idpair */
#line 316 "camp.y"
{ (yyval.ipl) = (yyvsp[-2].ipl); (yyval.ipl)->add((yyvsp[0].ip)); }
-#line 2124 "camp.tab.c"
+#line 2124 "camp.tab.cc"
break;
case 47: /* strid: ID */
#line 320 "camp.y"
{ (yyval.ps) = (yyvsp[0].ps); }
-#line 2130 "camp.tab.c"
+#line 2130 "camp.tab.cc"
break;
case 48: /* strid: STRING */
#line 321 "camp.y"
{ (yyval.ps).pos = (yyvsp[0].stre)->getPos();
(yyval.ps).sym = symbol::literalTrans((yyvsp[0].stre)->getString()); }
-#line 2137 "camp.tab.c"
+#line 2137 "camp.tab.cc"
break;
case 49: /* stridpair: ID */
#line 326 "camp.y"
{ (yyval.ip) = new idpair((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2143 "camp.tab.c"
+#line 2143 "camp.tab.cc"
break;
case 50: /* stridpair: strid ID ID */
#line 328 "camp.y"
{ (yyval.ip) = new idpair((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym, (yyvsp[-1].ps).sym , (yyvsp[0].ps).sym); }
-#line 2149 "camp.tab.c"
+#line 2149 "camp.tab.cc"
break;
case 51: /* stridpairlist: stridpair */
#line 332 "camp.y"
{ (yyval.ipl) = new idpairlist(); (yyval.ipl)->add((yyvsp[0].ip)); }
-#line 2155 "camp.tab.c"
+#line 2155 "camp.tab.cc"
break;
case 52: /* stridpairlist: stridpairlist ',' stridpair */
#line 334 "camp.y"
{ (yyval.ipl) = (yyvsp[-2].ipl); (yyval.ipl)->add((yyvsp[0].ip)); }
-#line 2161 "camp.tab.c"
+#line 2161 "camp.tab.cc"
break;
case 53: /* vardec: barevardec ';' */
#line 338 "camp.y"
{ (yyval.vd) = (yyvsp[-1].vd); }
-#line 2167 "camp.tab.c"
+#line 2167 "camp.tab.cc"
break;
case 54: /* barevardec: type decidlist */
#line 342 "camp.y"
{ (yyval.vd) = new vardec((yyvsp[-1].t)->getPos(), (yyvsp[-1].t), (yyvsp[0].dil)); }
-#line 2173 "camp.tab.c"
+#line 2173 "camp.tab.cc"
break;
case 55: /* type: celltype */
#line 346 "camp.y"
{ (yyval.t) = (yyvsp[0].t); }
-#line 2179 "camp.tab.c"
+#line 2179 "camp.tab.cc"
break;
case 56: /* type: name dims */
#line 347 "camp.y"
{ (yyval.t) = new arrayTy((yyvsp[-1].n), (yyvsp[0].dim)); }
-#line 2185 "camp.tab.c"
+#line 2185 "camp.tab.cc"
break;
case 57: /* celltype: name */
#line 351 "camp.y"
{ (yyval.t) = new nameTy((yyvsp[0].n)); }
-#line 2191 "camp.tab.c"
+#line 2191 "camp.tab.cc"
break;
case 58: /* dims: '[' ']' */
#line 355 "camp.y"
{ (yyval.dim) = new dimensions((yyvsp[-1].pos)); }
-#line 2197 "camp.tab.c"
+#line 2197 "camp.tab.cc"
break;
case 59: /* dims: dims '[' ']' */
#line 356 "camp.y"
{ (yyval.dim) = (yyvsp[-2].dim); (yyval.dim)->increase(); }
-#line 2203 "camp.tab.c"
+#line 2203 "camp.tab.cc"
break;
case 60: /* dimexps: '[' exp ']' */
#line 360 "camp.y"
{ (yyval.elist) = new explist((yyvsp[-2].pos)); (yyval.elist)->add((yyvsp[-1].e)); }
-#line 2209 "camp.tab.c"
+#line 2209 "camp.tab.cc"
break;
case 61: /* dimexps: dimexps '[' exp ']' */
#line 362 "camp.y"
{ (yyval.elist) = (yyvsp[-3].elist); (yyval.elist)->add((yyvsp[-1].e)); }
-#line 2215 "camp.tab.c"
+#line 2215 "camp.tab.cc"
break;
case 62: /* decidlist: decid */
#line 366 "camp.y"
{ (yyval.dil) = new decidlist((yyvsp[0].di)->getPos()); (yyval.dil)->add((yyvsp[0].di)); }
-#line 2221 "camp.tab.c"
+#line 2221 "camp.tab.cc"
break;
case 63: /* decidlist: decidlist ',' decid */
#line 368 "camp.y"
{ (yyval.dil) = (yyvsp[-2].dil); (yyval.dil)->add((yyvsp[0].di)); }
-#line 2227 "camp.tab.c"
+#line 2227 "camp.tab.cc"
break;
case 64: /* decid: decidstart */
#line 372 "camp.y"
{ (yyval.di) = new decid((yyvsp[0].dis)->getPos(), (yyvsp[0].dis)); }
-#line 2233 "camp.tab.c"
+#line 2233 "camp.tab.cc"
break;
case 65: /* decid: decidstart ASSIGN varinit */
#line 374 "camp.y"
{ (yyval.di) = new decid((yyvsp[-2].dis)->getPos(), (yyvsp[-2].dis), (yyvsp[0].vi)); }
-#line 2239 "camp.tab.c"
+#line 2239 "camp.tab.cc"
break;
case 66: /* decidstart: ID */
#line 378 "camp.y"
{ (yyval.dis) = new decidstart((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2245 "camp.tab.c"
+#line 2245 "camp.tab.cc"
break;
case 67: /* decidstart: ID dims */
#line 379 "camp.y"
{ (yyval.dis) = new decidstart((yyvsp[-1].ps).pos, (yyvsp[-1].ps).sym, (yyvsp[0].dim)); }
-#line 2251 "camp.tab.c"
+#line 2251 "camp.tab.cc"
break;
case 68: /* decidstart: ID '(' ')' */
#line 380 "camp.y"
{ (yyval.dis) = new fundecidstart((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym, 0,
new formals((yyvsp[-1].pos))); }
-#line 2258 "camp.tab.c"
+#line 2258 "camp.tab.cc"
break;
case 69: /* decidstart: ID '(' formals ')' */
#line 383 "camp.y"
{ (yyval.dis) = new fundecidstart((yyvsp[-3].ps).pos, (yyvsp[-3].ps).sym, 0, (yyvsp[-1].fls)); }
-#line 2264 "camp.tab.c"
+#line 2264 "camp.tab.cc"
break;
case 70: /* varinit: exp */
#line 387 "camp.y"
{ (yyval.vi) = (yyvsp[0].e); }
-#line 2270 "camp.tab.c"
+#line 2270 "camp.tab.cc"
break;
case 71: /* varinit: arrayinit */
#line 388 "camp.y"
{ (yyval.vi) = (yyvsp[0].ai); }
-#line 2276 "camp.tab.c"
+#line 2276 "camp.tab.cc"
break;
case 72: /* block: '{' bareblock '}' */
#line 393 "camp.y"
{ (yyval.b) = (yyvsp[-1].b); }
-#line 2282 "camp.tab.c"
+#line 2282 "camp.tab.cc"
break;
case 73: /* arrayinit: '{' '}' */
#line 397 "camp.y"
{ (yyval.ai) = new arrayinit((yyvsp[-1].pos)); }
-#line 2288 "camp.tab.c"
+#line 2288 "camp.tab.cc"
break;
case 74: /* arrayinit: '{' ELLIPSIS varinit '}' */
#line 399 "camp.y"
{ (yyval.ai) = new arrayinit((yyvsp[-3].pos)); (yyval.ai)->addRest((yyvsp[-1].vi)); }
-#line 2294 "camp.tab.c"
+#line 2294 "camp.tab.cc"
break;
case 75: /* arrayinit: '{' basearrayinit '}' */
#line 401 "camp.y"
{ (yyval.ai) = (yyvsp[-1].ai); }
-#line 2300 "camp.tab.c"
+#line 2300 "camp.tab.cc"
break;
case 76: /* arrayinit: '{' basearrayinit ELLIPSIS varinit '}' */
#line 403 "camp.y"
{ (yyval.ai) = (yyvsp[-3].ai); (yyval.ai)->addRest((yyvsp[-1].vi)); }
-#line 2306 "camp.tab.c"
+#line 2306 "camp.tab.cc"
break;
case 77: /* basearrayinit: ',' */
#line 407 "camp.y"
{ (yyval.ai) = new arrayinit((yyvsp[0].pos)); }
-#line 2312 "camp.tab.c"
+#line 2312 "camp.tab.cc"
break;
case 78: /* basearrayinit: varinits */
#line 408 "camp.y"
{ (yyval.ai) = (yyvsp[0].ai); }
-#line 2318 "camp.tab.c"
+#line 2318 "camp.tab.cc"
break;
case 79: /* basearrayinit: varinits ',' */
#line 409 "camp.y"
{ (yyval.ai) = (yyvsp[-1].ai); }
-#line 2324 "camp.tab.c"
+#line 2324 "camp.tab.cc"
break;
case 80: /* varinits: varinit */
#line 413 "camp.y"
{ (yyval.ai) = new arrayinit((yyvsp[0].vi)->getPos());
(yyval.ai)->add((yyvsp[0].vi));}
-#line 2331 "camp.tab.c"
+#line 2331 "camp.tab.cc"
break;
case 81: /* varinits: varinits ',' varinit */
#line 416 "camp.y"
{ (yyval.ai) = (yyvsp[-2].ai); (yyval.ai)->add((yyvsp[0].vi)); }
-#line 2337 "camp.tab.c"
+#line 2337 "camp.tab.cc"
break;
case 82: /* formals: formal */
#line 420 "camp.y"
{ (yyval.fls) = new formals((yyvsp[0].fl)->getPos()); (yyval.fls)->add((yyvsp[0].fl)); }
-#line 2343 "camp.tab.c"
+#line 2343 "camp.tab.cc"
break;
case 83: /* formals: ELLIPSIS formal */
#line 421 "camp.y"
{ (yyval.fls) = new formals((yyvsp[-1].pos)); (yyval.fls)->addRest((yyvsp[0].fl)); }
-#line 2349 "camp.tab.c"
+#line 2349 "camp.tab.cc"
break;
case 84: /* formals: formals ',' formal */
#line 423 "camp.y"
{ (yyval.fls) = (yyvsp[-2].fls); (yyval.fls)->add((yyvsp[0].fl)); }
-#line 2355 "camp.tab.c"
+#line 2355 "camp.tab.cc"
break;
case 85: /* formals: formals ELLIPSIS formal */
#line 425 "camp.y"
{ (yyval.fls) = (yyvsp[-2].fls); (yyval.fls)->addRest((yyvsp[0].fl)); }
-#line 2361 "camp.tab.c"
+#line 2361 "camp.tab.cc"
break;
case 86: /* explicitornot: EXPLICIT */
#line 429 "camp.y"
{ (yyval.boo) = true; }
-#line 2367 "camp.tab.c"
+#line 2367 "camp.tab.cc"
break;
case 87: /* explicitornot: %empty */
#line 430 "camp.y"
{ (yyval.boo) = false; }
-#line 2373 "camp.tab.c"
+#line 2373 "camp.tab.cc"
break;
case 88: /* formal: explicitornot type */
#line 435 "camp.y"
{ (yyval.fl) = new formal((yyvsp[0].t)->getPos(), (yyvsp[0].t), 0, 0, (yyvsp[-1].boo), 0); }
-#line 2379 "camp.tab.c"
+#line 2379 "camp.tab.cc"
break;
case 89: /* formal: explicitornot type decidstart */
#line 437 "camp.y"
{ (yyval.fl) = new formal((yyvsp[-1].t)->getPos(), (yyvsp[-1].t), (yyvsp[0].dis), 0, (yyvsp[-2].boo), 0); }
-#line 2385 "camp.tab.c"
+#line 2385 "camp.tab.cc"
break;
case 90: /* formal: explicitornot type decidstart ASSIGN varinit */
#line 439 "camp.y"
{ (yyval.fl) = new formal((yyvsp[-3].t)->getPos(), (yyvsp[-3].t), (yyvsp[-2].dis), (yyvsp[0].vi), (yyvsp[-4].boo), 0); }
-#line 2391 "camp.tab.c"
+#line 2391 "camp.tab.cc"
break;
case 91: /* formal: explicitornot type ID decidstart */
#line 442 "camp.y"
{ bool k = checkKeyword((yyvsp[-1].ps).pos, (yyvsp[-1].ps).sym);
(yyval.fl) = new formal((yyvsp[-2].t)->getPos(), (yyvsp[-2].t), (yyvsp[0].dis), 0, (yyvsp[-3].boo), k); }
-#line 2398 "camp.tab.c"
+#line 2398 "camp.tab.cc"
break;
case 92: /* formal: explicitornot type ID decidstart ASSIGN varinit */
#line 445 "camp.y"
{ bool k = checkKeyword((yyvsp[-3].ps).pos, (yyvsp[-3].ps).sym);
(yyval.fl) = new formal((yyvsp[-4].t)->getPos(), (yyvsp[-4].t), (yyvsp[-2].dis), (yyvsp[0].vi), (yyvsp[-5].boo), k); }
-#line 2405 "camp.tab.c"
+#line 2405 "camp.tab.cc"
break;
case 93: /* fundec: type ID '(' ')' blockstm */
#line 451 "camp.y"
{ (yyval.d) = new fundec((yyvsp[-2].pos), (yyvsp[-4].t), (yyvsp[-3].ps).sym, new formals((yyvsp[-2].pos)), (yyvsp[0].s)); }
-#line 2411 "camp.tab.c"
+#line 2411 "camp.tab.cc"
break;
case 94: /* fundec: type ID '(' formals ')' blockstm */
#line 453 "camp.y"
{ (yyval.d) = new fundec((yyvsp[-3].pos), (yyvsp[-5].t), (yyvsp[-4].ps).sym, (yyvsp[-2].fls), (yyvsp[0].s)); }
-#line 2417 "camp.tab.c"
+#line 2417 "camp.tab.cc"
break;
case 95: /* typedec: STRUCT ID block */
#line 457 "camp.y"
{ (yyval.d) = new recorddec((yyvsp[-2].pos), (yyvsp[-1].ps).sym, (yyvsp[0].b)); }
-#line 2423 "camp.tab.c"
+#line 2423 "camp.tab.cc"
break;
case 96: /* typedec: TYPEDEF vardec */
#line 458 "camp.y"
{ (yyval.d) = new typedec((yyvsp[-1].pos), (yyvsp[0].vd)); }
-#line 2429 "camp.tab.c"
+#line 2429 "camp.tab.cc"
break;
case 97: /* slice: ':' */
#line 462 "camp.y"
{ (yyval.slice) = new slice((yyvsp[0].pos), 0, 0); }
-#line 2435 "camp.tab.c"
+#line 2435 "camp.tab.cc"
break;
case 98: /* slice: exp ':' */
#line 463 "camp.y"
{ (yyval.slice) = new slice((yyvsp[0].pos), (yyvsp[-1].e), 0); }
-#line 2441 "camp.tab.c"
+#line 2441 "camp.tab.cc"
break;
case 99: /* slice: ':' exp */
#line 464 "camp.y"
{ (yyval.slice) = new slice((yyvsp[-1].pos), 0, (yyvsp[0].e)); }
-#line 2447 "camp.tab.c"
+#line 2447 "camp.tab.cc"
break;
case 100: /* slice: exp ':' exp */
#line 465 "camp.y"
{ (yyval.slice) = new slice((yyvsp[-1].pos), (yyvsp[-2].e), (yyvsp[0].e)); }
-#line 2453 "camp.tab.c"
+#line 2453 "camp.tab.cc"
break;
case 101: /* value: value '.' ID */
#line 469 "camp.y"
{ (yyval.e) = new fieldExp((yyvsp[-1].pos), (yyvsp[-2].e), (yyvsp[0].ps).sym); }
-#line 2459 "camp.tab.c"
+#line 2459 "camp.tab.cc"
break;
case 102: /* value: name '[' exp ']' */
#line 470 "camp.y"
{ (yyval.e) = new subscriptExp((yyvsp[-2].pos),
new nameExp((yyvsp[-3].n)->getPos(), (yyvsp[-3].n)), (yyvsp[-1].e)); }
-#line 2466 "camp.tab.c"
+#line 2466 "camp.tab.cc"
break;
case 103: /* value: value '[' exp ']' */
#line 472 "camp.y"
{ (yyval.e) = new subscriptExp((yyvsp[-2].pos), (yyvsp[-3].e), (yyvsp[-1].e)); }
-#line 2472 "camp.tab.c"
+#line 2472 "camp.tab.cc"
break;
case 104: /* value: name '[' slice ']' */
#line 473 "camp.y"
{ (yyval.e) = new sliceExp((yyvsp[-2].pos),
new nameExp((yyvsp[-3].n)->getPos(), (yyvsp[-3].n)), (yyvsp[-1].slice)); }
-#line 2479 "camp.tab.c"
+#line 2479 "camp.tab.cc"
break;
case 105: /* value: value '[' slice ']' */
#line 475 "camp.y"
{ (yyval.e) = new sliceExp((yyvsp[-2].pos), (yyvsp[-3].e), (yyvsp[-1].slice)); }
-#line 2485 "camp.tab.c"
+#line 2485 "camp.tab.cc"
break;
case 106: /* value: name '(' ')' */
@@ -2489,7 +2489,7 @@ yyreduce:
{ (yyval.e) = new callExp((yyvsp[-1].pos),
new nameExp((yyvsp[-2].n)->getPos(), (yyvsp[-2].n)),
new arglist()); }
-#line 2493 "camp.tab.c"
+#line 2493 "camp.tab.cc"
break;
case 107: /* value: name '(' arglist ')' */
@@ -2497,301 +2497,301 @@ yyreduce:
{ (yyval.e) = new callExp((yyvsp[-2].pos),
new nameExp((yyvsp[-3].n)->getPos(), (yyvsp[-3].n)),
(yyvsp[-1].alist)); }
-#line 2501 "camp.tab.c"
+#line 2501 "camp.tab.cc"
break;
case 108: /* value: value '(' ')' */
#line 483 "camp.y"
{ (yyval.e) = new callExp((yyvsp[-1].pos), (yyvsp[-2].e), new arglist()); }
-#line 2507 "camp.tab.c"
+#line 2507 "camp.tab.cc"
break;
case 109: /* value: value '(' arglist ')' */
#line 485 "camp.y"
{ (yyval.e) = new callExp((yyvsp[-2].pos), (yyvsp[-3].e), (yyvsp[-1].alist)); }
-#line 2513 "camp.tab.c"
+#line 2513 "camp.tab.cc"
break;
case 110: /* value: '(' exp ')' */
#line 487 "camp.y"
{ (yyval.e) = (yyvsp[-1].e); }
-#line 2519 "camp.tab.c"
+#line 2519 "camp.tab.cc"
break;
case 111: /* value: '(' name ')' */
#line 489 "camp.y"
{ (yyval.e) = new nameExp((yyvsp[-1].n)->getPos(), (yyvsp[-1].n)); }
-#line 2525 "camp.tab.c"
+#line 2525 "camp.tab.cc"
break;
- case 112: /* value: THIS */
+ case 112: /* value: THIS_TOK */
#line 490 "camp.y"
{ (yyval.e) = new thisExp((yyvsp[0].pos)); }
-#line 2531 "camp.tab.c"
+#line 2531 "camp.tab.cc"
break;
case 113: /* argument: exp */
#line 494 "camp.y"
{ (yyval.arg).name = symbol::nullsym; (yyval.arg).val=(yyvsp[0].e); }
-#line 2537 "camp.tab.c"
+#line 2537 "camp.tab.cc"
break;
case 114: /* argument: ID ASSIGN exp */
#line 495 "camp.y"
{ (yyval.arg).name = (yyvsp[-2].ps).sym; (yyval.arg).val=(yyvsp[0].e); }
-#line 2543 "camp.tab.c"
+#line 2543 "camp.tab.cc"
break;
case 115: /* arglist: argument */
#line 499 "camp.y"
{ (yyval.alist) = new arglist(); (yyval.alist)->add((yyvsp[0].arg)); }
-#line 2549 "camp.tab.c"
+#line 2549 "camp.tab.cc"
break;
case 116: /* arglist: ELLIPSIS argument */
#line 501 "camp.y"
{ (yyval.alist) = new arglist(); (yyval.alist)->addRest((yyvsp[0].arg)); }
-#line 2555 "camp.tab.c"
+#line 2555 "camp.tab.cc"
break;
case 117: /* arglist: arglist ',' argument */
#line 503 "camp.y"
{ (yyval.alist) = (yyvsp[-2].alist); (yyval.alist)->add((yyvsp[0].arg)); }
-#line 2561 "camp.tab.c"
+#line 2561 "camp.tab.cc"
break;
case 118: /* arglist: arglist ELLIPSIS argument */
#line 505 "camp.y"
{ (yyval.alist) = (yyvsp[-2].alist); (yyval.alist)->addRest((yyvsp[0].arg)); }
-#line 2567 "camp.tab.c"
+#line 2567 "camp.tab.cc"
break;
case 119: /* tuple: exp ',' exp */
#line 510 "camp.y"
{ (yyval.alist) = new arglist(); (yyval.alist)->add((yyvsp[-2].e)); (yyval.alist)->add((yyvsp[0].e)); }
-#line 2573 "camp.tab.c"
+#line 2573 "camp.tab.cc"
break;
case 120: /* tuple: tuple ',' exp */
#line 511 "camp.y"
{ (yyval.alist) = (yyvsp[-2].alist); (yyval.alist)->add((yyvsp[0].e)); }
-#line 2579 "camp.tab.c"
+#line 2579 "camp.tab.cc"
break;
case 121: /* exp: name */
#line 515 "camp.y"
{ (yyval.e) = new nameExp((yyvsp[0].n)->getPos(), (yyvsp[0].n)); }
-#line 2585 "camp.tab.c"
+#line 2585 "camp.tab.cc"
break;
case 122: /* exp: value */
#line 516 "camp.y"
{ (yyval.e) = (yyvsp[0].e); }
-#line 2591 "camp.tab.c"
+#line 2591 "camp.tab.cc"
break;
case 123: /* exp: LIT */
#line 517 "camp.y"
{ (yyval.e) = (yyvsp[0].e); }
-#line 2597 "camp.tab.c"
+#line 2597 "camp.tab.cc"
break;
case 124: /* exp: STRING */
#line 518 "camp.y"
{ (yyval.e) = (yyvsp[0].stre); }
-#line 2603 "camp.tab.c"
+#line 2603 "camp.tab.cc"
break;
case 125: /* exp: LIT exp */
#line 520 "camp.y"
{ (yyval.e) = new scaleExp((yyvsp[-1].e)->getPos(), (yyvsp[-1].e), (yyvsp[0].e)); }
-#line 2609 "camp.tab.c"
+#line 2609 "camp.tab.cc"
break;
case 126: /* exp: '(' name ')' exp */
#line 522 "camp.y"
{ (yyval.e) = new castExp((yyvsp[-2].n)->getPos(), new nameTy((yyvsp[-2].n)), (yyvsp[0].e)); }
-#line 2615 "camp.tab.c"
+#line 2615 "camp.tab.cc"
break;
case 127: /* exp: '(' name dims ')' exp */
#line 524 "camp.y"
{ (yyval.e) = new castExp((yyvsp[-3].n)->getPos(), new arrayTy((yyvsp[-3].n), (yyvsp[-2].dim)), (yyvsp[0].e)); }
-#line 2621 "camp.tab.c"
+#line 2621 "camp.tab.cc"
break;
case 128: /* exp: '+' exp */
#line 526 "camp.y"
{ (yyval.e) = new unaryExp((yyvsp[-1].ps).pos, (yyvsp[0].e), (yyvsp[-1].ps).sym); }
-#line 2627 "camp.tab.c"
+#line 2627 "camp.tab.cc"
break;
case 129: /* exp: '-' exp */
#line 528 "camp.y"
{ (yyval.e) = new unaryExp((yyvsp[-1].ps).pos, (yyvsp[0].e), (yyvsp[-1].ps).sym); }
-#line 2633 "camp.tab.c"
+#line 2633 "camp.tab.cc"
break;
case 130: /* exp: OPERATOR exp */
#line 529 "camp.y"
{ (yyval.e) = new unaryExp((yyvsp[-1].ps).pos, (yyvsp[0].e), (yyvsp[-1].ps).sym); }
-#line 2639 "camp.tab.c"
+#line 2639 "camp.tab.cc"
break;
case 131: /* exp: exp '+' exp */
#line 530 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2645 "camp.tab.c"
+#line 2645 "camp.tab.cc"
break;
case 132: /* exp: exp '-' exp */
#line 531 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2651 "camp.tab.c"
+#line 2651 "camp.tab.cc"
break;
case 133: /* exp: exp '*' exp */
#line 532 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2657 "camp.tab.c"
+#line 2657 "camp.tab.cc"
break;
case 134: /* exp: exp '/' exp */
#line 533 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2663 "camp.tab.c"
+#line 2663 "camp.tab.cc"
break;
case 135: /* exp: exp '%' exp */
#line 534 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2669 "camp.tab.c"
+#line 2669 "camp.tab.cc"
break;
case 136: /* exp: exp '#' exp */
#line 535 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2675 "camp.tab.c"
+#line 2675 "camp.tab.cc"
break;
case 137: /* exp: exp '^' exp */
#line 536 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2681 "camp.tab.c"
+#line 2681 "camp.tab.cc"
break;
case 138: /* exp: exp LT exp */
#line 537 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2687 "camp.tab.c"
+#line 2687 "camp.tab.cc"
break;
case 139: /* exp: exp LE exp */
#line 538 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2693 "camp.tab.c"
+#line 2693 "camp.tab.cc"
break;
case 140: /* exp: exp GT exp */
#line 539 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2699 "camp.tab.c"
+#line 2699 "camp.tab.cc"
break;
case 141: /* exp: exp GE exp */
#line 540 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2705 "camp.tab.c"
+#line 2705 "camp.tab.cc"
break;
case 142: /* exp: exp EQ exp */
#line 541 "camp.y"
{ (yyval.e) = new equalityExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2711 "camp.tab.c"
+#line 2711 "camp.tab.cc"
break;
case 143: /* exp: exp NEQ exp */
#line 542 "camp.y"
{ (yyval.e) = new equalityExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2717 "camp.tab.c"
+#line 2717 "camp.tab.cc"
break;
case 144: /* exp: exp CAND exp */
#line 543 "camp.y"
{ (yyval.e) = new andExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2723 "camp.tab.c"
+#line 2723 "camp.tab.cc"
break;
case 145: /* exp: exp COR exp */
#line 544 "camp.y"
{ (yyval.e) = new orExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2729 "camp.tab.c"
+#line 2729 "camp.tab.cc"
break;
case 146: /* exp: exp CARETS exp */
#line 545 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2735 "camp.tab.c"
+#line 2735 "camp.tab.cc"
break;
case 147: /* exp: exp AMPERSAND exp */
#line 546 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2741 "camp.tab.c"
+#line 2741 "camp.tab.cc"
break;
case 148: /* exp: exp BAR exp */
#line 547 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2747 "camp.tab.c"
+#line 2747 "camp.tab.cc"
break;
case 149: /* exp: exp OPERATOR exp */
#line 548 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2753 "camp.tab.c"
+#line 2753 "camp.tab.cc"
break;
case 150: /* exp: exp INCR exp */
#line 549 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2759 "camp.tab.c"
+#line 2759 "camp.tab.cc"
break;
case 151: /* exp: NEW celltype */
#line 551 "camp.y"
{ (yyval.e) = new newRecordExp((yyvsp[-1].pos), (yyvsp[0].t)); }
-#line 2765 "camp.tab.c"
+#line 2765 "camp.tab.cc"
break;
case 152: /* exp: NEW celltype dimexps */
#line 553 "camp.y"
{ (yyval.e) = new newArrayExp((yyvsp[-2].pos), (yyvsp[-1].t), (yyvsp[0].elist), 0, 0); }
-#line 2771 "camp.tab.c"
+#line 2771 "camp.tab.cc"
break;
case 153: /* exp: NEW celltype dimexps dims */
#line 555 "camp.y"
{ (yyval.e) = new newArrayExp((yyvsp[-3].pos), (yyvsp[-2].t), (yyvsp[-1].elist), (yyvsp[0].dim), 0); }
-#line 2777 "camp.tab.c"
+#line 2777 "camp.tab.cc"
break;
case 154: /* exp: NEW celltype dims */
#line 557 "camp.y"
{ (yyval.e) = new newArrayExp((yyvsp[-2].pos), (yyvsp[-1].t), 0, (yyvsp[0].dim), 0); }
-#line 2783 "camp.tab.c"
+#line 2783 "camp.tab.cc"
break;
case 155: /* exp: NEW celltype dims arrayinit */
#line 559 "camp.y"
{ (yyval.e) = new newArrayExp((yyvsp[-3].pos), (yyvsp[-2].t), 0, (yyvsp[-1].dim), (yyvsp[0].ai)); }
-#line 2789 "camp.tab.c"
+#line 2789 "camp.tab.cc"
break;
case 156: /* exp: NEW celltype '(' ')' blockstm */
#line 561 "camp.y"
{ (yyval.e) = new newFunctionExp((yyvsp[-4].pos), (yyvsp[-3].t), new formals((yyvsp[-2].pos)), (yyvsp[0].s)); }
-#line 2795 "camp.tab.c"
+#line 2795 "camp.tab.cc"
break;
case 157: /* exp: NEW celltype dims '(' ')' blockstm */
@@ -2800,13 +2800,13 @@ yyreduce:
new arrayTy((yyvsp[-4].t)->getPos(), (yyvsp[-4].t), (yyvsp[-3].dim)),
new formals((yyvsp[-2].pos)),
(yyvsp[0].s)); }
-#line 2804 "camp.tab.c"
+#line 2804 "camp.tab.cc"
break;
case 158: /* exp: NEW celltype '(' formals ')' blockstm */
#line 568 "camp.y"
{ (yyval.e) = new newFunctionExp((yyvsp[-5].pos), (yyvsp[-4].t), (yyvsp[-2].fls), (yyvsp[0].s)); }
-#line 2810 "camp.tab.c"
+#line 2810 "camp.tab.cc"
break;
case 159: /* exp: NEW celltype dims '(' formals ')' blockstm */
@@ -2815,31 +2815,31 @@ yyreduce:
new arrayTy((yyvsp[-5].t)->getPos(), (yyvsp[-5].t), (yyvsp[-4].dim)),
(yyvsp[-2].fls),
(yyvsp[0].s)); }
-#line 2819 "camp.tab.c"
+#line 2819 "camp.tab.cc"
break;
case 160: /* exp: exp '?' exp ':' exp */
#line 575 "camp.y"
{ (yyval.e) = new conditionalExp((yyvsp[-3].pos), (yyvsp[-4].e), (yyvsp[-2].e), (yyvsp[0].e)); }
-#line 2825 "camp.tab.c"
+#line 2825 "camp.tab.cc"
break;
case 161: /* exp: exp ASSIGN exp */
#line 576 "camp.y"
{ (yyval.e) = new assignExp((yyvsp[-1].pos), (yyvsp[-2].e), (yyvsp[0].e)); }
-#line 2831 "camp.tab.c"
+#line 2831 "camp.tab.cc"
break;
case 162: /* exp: '(' tuple ')' */
#line 577 "camp.y"
{ (yyval.e) = new callExp((yyvsp[-2].pos), new nameExp((yyvsp[-2].pos), SYM_TUPLE), (yyvsp[-1].alist)); }
-#line 2837 "camp.tab.c"
+#line 2837 "camp.tab.cc"
break;
case 163: /* exp: exp join exp */
#line 579 "camp.y"
{ (yyvsp[-1].j)->pushFront((yyvsp[-2].e)); (yyvsp[-1].j)->pushBack((yyvsp[0].e)); (yyval.e) = (yyvsp[-1].j); }
-#line 2843 "camp.tab.c"
+#line 2843 "camp.tab.cc"
break;
case 164: /* exp: exp dir */
@@ -2849,314 +2849,314 @@ yyreduce:
new joinExp((yyvsp[0].se)->getPos(), SYM_DOTS);
(yyval.e)=jexp;
jexp->pushBack((yyvsp[-1].e)); jexp->pushBack((yyvsp[0].se)); }
-#line 2853 "camp.tab.c"
+#line 2853 "camp.tab.cc"
break;
case 165: /* exp: INCR exp */
#line 587 "camp.y"
{ (yyval.e) = new prefixExp((yyvsp[-1].ps).pos, (yyvsp[0].e), SYM_PLUS); }
-#line 2859 "camp.tab.c"
+#line 2859 "camp.tab.cc"
break;
case 166: /* exp: DASHES exp */
#line 589 "camp.y"
{ (yyval.e) = new prefixExp((yyvsp[-1].ps).pos, (yyvsp[0].e), SYM_MINUS); }
-#line 2865 "camp.tab.c"
+#line 2865 "camp.tab.cc"
break;
case 167: /* exp: exp INCR */
#line 592 "camp.y"
{ (yyval.e) = new postfixExp((yyvsp[0].ps).pos, (yyvsp[-1].e), SYM_PLUS); }
-#line 2871 "camp.tab.c"
+#line 2871 "camp.tab.cc"
break;
case 168: /* exp: exp SELFOP exp */
#line 593 "camp.y"
{ (yyval.e) = new selfExp((yyvsp[-1].ps).pos, (yyvsp[-2].e), (yyvsp[-1].ps).sym, (yyvsp[0].e)); }
-#line 2877 "camp.tab.c"
+#line 2877 "camp.tab.cc"
break;
case 169: /* exp: QUOTE '{' fileblock '}' */
#line 595 "camp.y"
{ (yyval.e) = new quoteExp((yyvsp[-3].pos), (yyvsp[-1].b)); }
-#line 2883 "camp.tab.c"
+#line 2883 "camp.tab.cc"
break;
case 170: /* join: DASHES */
#line 601 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[0].ps).pos,(yyvsp[0].ps).sym); }
-#line 2889 "camp.tab.c"
+#line 2889 "camp.tab.cc"
break;
case 171: /* join: basicjoin */
#line 603 "camp.y"
{ (yyval.j) = (yyvsp[0].j); }
-#line 2895 "camp.tab.c"
+#line 2895 "camp.tab.cc"
break;
case 172: /* join: dir basicjoin */
#line 605 "camp.y"
{ (yyvsp[-1].se)->setSide(camp::OUT);
(yyval.j) = (yyvsp[0].j); (yyval.j)->pushFront((yyvsp[-1].se)); }
-#line 2902 "camp.tab.c"
+#line 2902 "camp.tab.cc"
break;
case 173: /* join: basicjoin dir */
#line 608 "camp.y"
{ (yyvsp[0].se)->setSide(camp::IN);
(yyval.j) = (yyvsp[-1].j); (yyval.j)->pushBack((yyvsp[0].se)); }
-#line 2909 "camp.tab.c"
+#line 2909 "camp.tab.cc"
break;
case 174: /* join: dir basicjoin dir */
#line 611 "camp.y"
{ (yyvsp[-2].se)->setSide(camp::OUT); (yyvsp[0].se)->setSide(camp::IN);
(yyval.j) = (yyvsp[-1].j); (yyval.j)->pushFront((yyvsp[-2].se)); (yyval.j)->pushBack((yyvsp[0].se)); }
-#line 2916 "camp.tab.c"
+#line 2916 "camp.tab.cc"
break;
case 175: /* dir: '{' CURL exp '}' */
#line 616 "camp.y"
{ (yyval.se) = new specExp((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym, (yyvsp[-1].e)); }
-#line 2922 "camp.tab.c"
+#line 2922 "camp.tab.cc"
break;
case 176: /* dir: '{' exp '}' */
#line 617 "camp.y"
{ (yyval.se) = new specExp((yyvsp[-2].pos), symbol::opTrans("spec"), (yyvsp[-1].e)); }
-#line 2928 "camp.tab.c"
+#line 2928 "camp.tab.cc"
break;
case 177: /* dir: '{' exp ',' exp '}' */
#line 619 "camp.y"
{ (yyval.se) = new specExp((yyvsp[-4].pos), symbol::opTrans("spec"),
new pairExp((yyvsp[-2].pos), (yyvsp[-3].e), (yyvsp[-1].e))); }
-#line 2935 "camp.tab.c"
+#line 2935 "camp.tab.cc"
break;
case 178: /* dir: '{' exp ',' exp ',' exp '}' */
#line 622 "camp.y"
{ (yyval.se) = new specExp((yyvsp[-6].pos), symbol::opTrans("spec"),
new tripleExp((yyvsp[-4].pos), (yyvsp[-5].e), (yyvsp[-3].e), (yyvsp[-1].e))); }
-#line 2942 "camp.tab.c"
+#line 2942 "camp.tab.cc"
break;
case 179: /* basicjoin: DOTS */
#line 627 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2948 "camp.tab.c"
+#line 2948 "camp.tab.cc"
break;
case 180: /* basicjoin: DOTS tension DOTS */
#line 629 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym); (yyval.j)->pushBack((yyvsp[-1].e)); }
-#line 2954 "camp.tab.c"
+#line 2954 "camp.tab.cc"
break;
case 181: /* basicjoin: DOTS controls DOTS */
#line 631 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[-2].ps).pos, (yyvsp[-2].ps).sym); (yyval.j)->pushBack((yyvsp[-1].e)); }
-#line 2960 "camp.tab.c"
+#line 2960 "camp.tab.cc"
break;
case 182: /* basicjoin: COLONS */
#line 632 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2966 "camp.tab.c"
+#line 2966 "camp.tab.cc"
break;
case 183: /* basicjoin: LONGDASH */
#line 633 "camp.y"
{ (yyval.j) = new joinExp((yyvsp[0].ps).pos, (yyvsp[0].ps).sym); }
-#line 2972 "camp.tab.c"
+#line 2972 "camp.tab.cc"
break;
case 184: /* tension: TENSION exp */
#line 637 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-1].ps).pos, (yyvsp[0].e), (yyvsp[-1].ps).sym,
new booleanExp((yyvsp[-1].ps).pos, false)); }
-#line 2979 "camp.tab.c"
+#line 2979 "camp.tab.cc"
break;
case 185: /* tension: TENSION exp AND exp */
#line 640 "camp.y"
{ (yyval.e) = new ternaryExp((yyvsp[-3].ps).pos, (yyvsp[-2].e), (yyvsp[-3].ps).sym, (yyvsp[0].e),
new booleanExp((yyvsp[-3].ps).pos, false)); }
-#line 2986 "camp.tab.c"
+#line 2986 "camp.tab.cc"
break;
case 186: /* tension: TENSION ATLEAST exp */
#line 643 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-2].ps).pos, (yyvsp[0].e), (yyvsp[-2].ps).sym,
new booleanExp((yyvsp[-1].ps).pos, true)); }
-#line 2993 "camp.tab.c"
+#line 2993 "camp.tab.cc"
break;
case 187: /* tension: TENSION ATLEAST exp AND exp */
#line 646 "camp.y"
{ (yyval.e) = new ternaryExp((yyvsp[-4].ps).pos, (yyvsp[-2].e), (yyvsp[-4].ps).sym, (yyvsp[0].e),
new booleanExp((yyvsp[-3].ps).pos, true)); }
-#line 3000 "camp.tab.c"
+#line 3000 "camp.tab.cc"
break;
case 188: /* controls: CONTROLS exp */
#line 651 "camp.y"
{ (yyval.e) = new unaryExp((yyvsp[-1].ps).pos, (yyvsp[0].e), (yyvsp[-1].ps).sym); }
-#line 3006 "camp.tab.c"
+#line 3006 "camp.tab.cc"
break;
case 189: /* controls: CONTROLS exp AND exp */
#line 653 "camp.y"
{ (yyval.e) = new binaryExp((yyvsp[-3].ps).pos, (yyvsp[-2].e), (yyvsp[-3].ps).sym, (yyvsp[0].e)); }
-#line 3012 "camp.tab.c"
+#line 3012 "camp.tab.cc"
break;
case 190: /* stm: ';' */
#line 657 "camp.y"
{ (yyval.s) = new emptyStm((yyvsp[0].pos)); }
-#line 3018 "camp.tab.c"
+#line 3018 "camp.tab.cc"
break;
case 191: /* stm: blockstm */
#line 658 "camp.y"
{ (yyval.s) = (yyvsp[0].s); }
-#line 3024 "camp.tab.c"
+#line 3024 "camp.tab.cc"
break;
case 192: /* stm: stmexp ';' */
#line 659 "camp.y"
{ (yyval.s) = (yyvsp[-1].s); }
-#line 3030 "camp.tab.c"
+#line 3030 "camp.tab.cc"
break;
case 193: /* stm: IF '(' exp ')' stm */
#line 661 "camp.y"
{ (yyval.s) = new ifStm((yyvsp[-4].pos), (yyvsp[-2].e), (yyvsp[0].s)); }
-#line 3036 "camp.tab.c"
+#line 3036 "camp.tab.cc"
break;
case 194: /* stm: IF '(' exp ')' stm ELSE stm */
#line 663 "camp.y"
{ (yyval.s) = new ifStm((yyvsp[-6].pos), (yyvsp[-4].e), (yyvsp[-2].s), (yyvsp[0].s)); }
-#line 3042 "camp.tab.c"
+#line 3042 "camp.tab.cc"
break;
case 195: /* stm: WHILE '(' exp ')' stm */
#line 665 "camp.y"
{ (yyval.s) = new whileStm((yyvsp[-4].pos), (yyvsp[-2].e), (yyvsp[0].s)); }
-#line 3048 "camp.tab.c"
+#line 3048 "camp.tab.cc"
break;
case 196: /* stm: DO stm WHILE '(' exp ')' ';' */
#line 667 "camp.y"
{ (yyval.s) = new doStm((yyvsp[-6].pos), (yyvsp[-5].s), (yyvsp[-2].e)); }
-#line 3054 "camp.tab.c"
+#line 3054 "camp.tab.cc"
break;
case 197: /* stm: FOR '(' forinit ';' fortest ';' forupdate ')' stm */
#line 669 "camp.y"
{ (yyval.s) = new forStm((yyvsp[-8].pos), (yyvsp[-6].run), (yyvsp[-4].e), (yyvsp[-2].sel), (yyvsp[0].s)); }
-#line 3060 "camp.tab.c"
+#line 3060 "camp.tab.cc"
break;
case 198: /* stm: FOR '(' type ID ':' exp ')' stm */
#line 671 "camp.y"
{ (yyval.s) = new extendedForStm((yyvsp[-7].pos), (yyvsp[-5].t), (yyvsp[-4].ps).sym, (yyvsp[-2].e), (yyvsp[0].s)); }
-#line 3066 "camp.tab.c"
+#line 3066 "camp.tab.cc"
break;
case 199: /* stm: BREAK ';' */
#line 672 "camp.y"
{ (yyval.s) = new breakStm((yyvsp[-1].pos)); }
-#line 3072 "camp.tab.c"
+#line 3072 "camp.tab.cc"
break;
case 200: /* stm: CONTINUE ';' */
#line 673 "camp.y"
{ (yyval.s) = new continueStm((yyvsp[-1].pos)); }
-#line 3078 "camp.tab.c"
+#line 3078 "camp.tab.cc"
break;
case 201: /* stm: RETURN_ ';' */
#line 674 "camp.y"
{ (yyval.s) = new returnStm((yyvsp[-1].pos)); }
-#line 3084 "camp.tab.c"
+#line 3084 "camp.tab.cc"
break;
case 202: /* stm: RETURN_ exp ';' */
#line 675 "camp.y"
{ (yyval.s) = new returnStm((yyvsp[-2].pos), (yyvsp[-1].e)); }
-#line 3090 "camp.tab.c"
+#line 3090 "camp.tab.cc"
break;
case 203: /* stmexp: exp */
#line 679 "camp.y"
{ (yyval.s) = new expStm((yyvsp[0].e)->getPos(), (yyvsp[0].e)); }
-#line 3096 "camp.tab.c"
+#line 3096 "camp.tab.cc"
break;
case 204: /* blockstm: block */
#line 683 "camp.y"
{ (yyval.s) = new blockStm((yyvsp[0].b)->getPos(), (yyvsp[0].b)); }
-#line 3102 "camp.tab.c"
+#line 3102 "camp.tab.cc"
break;
case 205: /* forinit: %empty */
#line 687 "camp.y"
{ (yyval.run) = 0; }
-#line 3108 "camp.tab.c"
+#line 3108 "camp.tab.cc"
break;
case 206: /* forinit: stmexplist */
#line 688 "camp.y"
{ (yyval.run) = (yyvsp[0].sel); }
-#line 3114 "camp.tab.c"
+#line 3114 "camp.tab.cc"
break;
case 207: /* forinit: barevardec */
#line 689 "camp.y"
{ (yyval.run) = (yyvsp[0].vd); }
-#line 3120 "camp.tab.c"
+#line 3120 "camp.tab.cc"
break;
case 208: /* fortest: %empty */
#line 693 "camp.y"
{ (yyval.e) = 0; }
-#line 3126 "camp.tab.c"
+#line 3126 "camp.tab.cc"
break;
case 209: /* fortest: exp */
#line 694 "camp.y"
{ (yyval.e) = (yyvsp[0].e); }
-#line 3132 "camp.tab.c"
+#line 3132 "camp.tab.cc"
break;
case 210: /* forupdate: %empty */
#line 698 "camp.y"
{ (yyval.sel) = 0; }
-#line 3138 "camp.tab.c"
+#line 3138 "camp.tab.cc"
break;
case 211: /* forupdate: stmexplist */
#line 699 "camp.y"
{ (yyval.sel) = (yyvsp[0].sel); }
-#line 3144 "camp.tab.c"
+#line 3144 "camp.tab.cc"
break;
case 212: /* stmexplist: stmexp */
#line 703 "camp.y"
{ (yyval.sel) = new stmExpList((yyvsp[0].s)->getPos()); (yyval.sel)->add((yyvsp[0].s)); }
-#line 3150 "camp.tab.c"
+#line 3150 "camp.tab.cc"
break;
case 213: /* stmexplist: stmexplist ',' stmexp */
#line 705 "camp.y"
{ (yyval.sel) = (yyvsp[-2].sel); (yyval.sel)->add((yyvsp[0].s)); }
-#line 3156 "camp.tab.c"
+#line 3156 "camp.tab.cc"
break;
-#line 3160 "camp.tab.c"
+#line 3160 "camp.tab.cc"
default: break;
}
diff --git a/graphics/asymptote/camp.tab.h b/graphics/asymptote/camp.tab.h
index d6b8090e69..6a1f78de2f 100644
--- a/graphics/asymptote/camp.tab.h
+++ b/graphics/asymptote/camp.tab.h
@@ -100,7 +100,7 @@ extern int yydebug;
BREAK = 301, /* BREAK */
CONTINUE = 302, /* CONTINUE */
RETURN_ = 303, /* RETURN_ */
- THIS = 304, /* THIS */
+ THIS_TOK = 304, /* THIS_TOK */
EXPLICIT = 305, /* EXPLICIT */
GARBAGE = 306, /* GARBAGE */
LIT = 307, /* LIT */
diff --git a/graphics/asymptote/camp.y b/graphics/asymptote/camp.y
index bfa6734651..9def3139c0 100644
--- a/graphics/asymptote/camp.y
+++ b/graphics/asymptote/camp.y
@@ -116,7 +116,7 @@ using mem::string;
'{' '}' '(' ')' '.' ',' '[' ']' ';' ELLIPSIS
ACCESS UNRAVEL IMPORT INCLUDE FROM QUOTE STRUCT TYPEDEF NEW
IF ELSE WHILE DO FOR BREAK CONTINUE RETURN_
- THIS EXPLICIT
+ THIS_TOK EXPLICIT
GARBAGE
%token <e> LIT
%token <stre> STRING
@@ -487,7 +487,7 @@ value:
{ $$ = $2; }
| '(' name ')' %prec EXP_IN_PARENS_RULE
{ $$ = new nameExp($2->getPos(), $2); }
-| THIS { $$ = new thisExp($1); }
+| THIS_TOK { $$ = new thisExp($1); }
;
argument:
diff --git a/graphics/asymptote/cmake-scripts/asy-base-files.cmake b/graphics/asymptote/cmake-scripts/asy-base-files.cmake
new file mode 100644
index 0000000000..0622c21cb4
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/asy-base-files.cmake
@@ -0,0 +1,78 @@
+set(ASY_STATIC_BASE_FILES
+ animate animation annotate babel bezulate binarytree bsp CAD colormap
+ contour3 contour drawtree embed external feynman flowchart fontsize
+ geometry graph3 graph graph_settings graph_splinetype grid3 interpolate
+ labelpath3 labelpath lmfit map mapArray markers math metapost obj ode palette patterns
+ plain_arcs plain_arrows plain plain_bounds plain_boxes plain_constants plain_debugger
+ plain_filldraw plain_Label plain_margins plain_markers plain_paths plain_pens
+ plain_picture plain_prethree plain_scaling plain_shipout plain_strings pstoedit rational rationalSimplex
+ roundedpath simplex size10 size11 slide slopefield smoothcontour3 solids stats syzygy simplex2
+ texcolors three_arrows three three_light three_margins three_surface three_tube tree
+ trembling tube v3d x11colors
+)
+
+set(ASY_STATIC_SHADER_FILES
+ blend compress count fragment screen sum1 sum2 sum2fast
+ sum3 vertex zero
+)
+
+set(OTHER_STATIC_BASE_FILES nopapersize.ps)
+
+# base dir
+set(ASY_SOURCE_BASE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/base)
+set(ASY_BUILD_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}/base)
+
+file(MAKE_DIRECTORY ${ASY_BUILD_BASE_DIR})
+
+# version.asy
+configure_file(${ASY_RESOURCE_DIR}/versionTemplate.asy.in ${ASY_BUILD_BASE_DIR}/version.asy)
+list(APPEND ASY_OUTPUT_BASE_FILES ${ASY_BUILD_BASE_DIR}/version.asy)
+
+# copy base files to build dir
+macro (copy_base_file_with_custom_output_name base_file_name output_file_name)
+ add_custom_command(
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${ASY_SOURCE_BASE_DIR}/${base_file_name}
+ ${ASY_BUILD_BASE_DIR}/${output_file_name}
+ OUTPUT ${ASY_BUILD_BASE_DIR}/${output_file_name}
+ MAIN_DEPENDENCY ${ASY_SOURCE_BASE_DIR}/${base_file_name}
+ )
+
+ list(APPEND ASY_OUTPUT_BASE_FILES ${ASY_BUILD_BASE_DIR}/${output_file_name})
+endmacro()
+
+macro (copy_base_file base_file_name)
+ copy_base_file_with_custom_output_name(${base_file_name} ${base_file_name})
+endmacro()
+
+foreach(ASY_STATIC_BASE_FILE ${ASY_STATIC_BASE_FILES})
+ copy_base_file(${ASY_STATIC_BASE_FILE}.asy)
+endforeach ()
+
+foreach(OTHER_STATIC_BASE_FILE ${OTHER_STATIC_BASE_FILES})
+ copy_base_file(${OTHER_STATIC_BASE_FILE})
+endforeach ()
+
+file(MAKE_DIRECTORY ${ASY_BUILD_BASE_DIR}/shaders)
+foreach(ASY_STATIC_SHADER_FILE ${ASY_STATIC_SHADER_FILES})
+ copy_base_file(shaders/${ASY_STATIC_SHADER_FILE}.glsl)
+endforeach ()
+
+# generated csv files
+foreach(csv_enum_file ${ASY_CSV_ENUM_FILES})
+ add_custom_command(
+ OUTPUT ${ASY_BUILD_BASE_DIR}/${csv_enum_file}.asy
+ COMMAND ${PY3_INTERPRETER} ${ASY_SCRIPTS_DIR}/generate_enums.py
+ --language asy
+ --name ${csv_enum_file}
+ --input ${ASY_RESOURCE_DIR}/${csv_enum_file}.csv
+ --output ${ASY_BUILD_BASE_DIR}/${csv_enum_file}.asy
+ MAIN_DEPENDENCY ${ASY_RESOURCE_DIR}/${csv_enum_file}.csv
+ )
+
+ list(APPEND ASY_OUTPUT_BASE_FILES ${ASY_BUILD_BASE_DIR}/${csv_enum_file}.asy)
+endforeach ()
+
+# asygl
+file(MAKE_DIRECTORY ${ASY_BUILD_BASE_DIR}/webgl)
+copy_base_file_with_custom_output_name(webgl/asygl-${ASY_GL_VERSION}.js webgl/asygl.js)
diff --git a/graphics/asymptote/cmake-scripts/asy-files.cmake b/graphics/asymptote/cmake-scripts/asy-files.cmake
new file mode 100644
index 0000000000..57e47fe38b
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/asy-files.cmake
@@ -0,0 +1,33 @@
+set(ASYMPTOTE_INCLUDES ${ASY_INCLUDE_DIR})
+set(CAMP_BUILD_FILES
+ camperror path drawpath drawlabel picture psfile texfile util settings
+ guide flatguide knot drawfill path3 drawpath3 drawsurface
+ beziercurve bezierpatch pen pipestream
+)
+
+set(RUNTIME_BUILD_FILES
+ runtime runbacktrace runpicture runlabel runhistory runarray
+ runfile runsystem runpair runtriple runpath runpath3d runstring
+ runmath
+)
+
+set(SYMBOL_STATIC_BUILD_FILES types builtin gsl)
+set(SYMBOL_BUILD_FILES ${RUNTIME_BUILD_FILES} ${SYMBOL_STATIC_BUILD_FILES})
+
+set(GENERATED_SOURCE_BUILD_FILES
+ ${SYMBOL_BUILD_FILES} camp.tab lex.yy
+)
+
+set(CORE_BUILD_FILES
+ ${CAMP_BUILD_FILES} ${SYMBOL_STATIC_BUILD_FILES}
+ env genv stm dec errormsg
+ callable name symbol entry exp newexp stack exithandlers
+ access virtualfieldaccess absyn record interact fileio
+ fftw++asy parallel simpson coder coenv impdatum locate asyparser program application
+ varinit fundec refaccess envcompleter asyprocess constructor array memory
+ Delaunay predicates glrender tr shaders jsfile v3dfile
+ EXRFiles GLTextures lspserv symbolmaps win32helpers win32pipestream
+ win32xdr xstream
+)
+
+set(ASY_CSV_ENUM_FILES v3dtypes v3dheadertypes)
diff --git a/graphics/asymptote/cmake-scripts/asy-macro.cmake b/graphics/asymptote/cmake-scripts/asy-macro.cmake
new file mode 100644
index 0000000000..e21af7d406
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/asy-macro.cmake
@@ -0,0 +1,50 @@
+if (NOT ASY_VERSION_OVERRIDE)
+if (ASY_ADDR_VERSION_SUFFIX_FILE STREQUAL "NOTFOUND")
+ if (CMAKE_BUILD_TYPE IN_LIST cmake_debug_build_types)
+ set(ASY_VERSION_SUFFIX "+debug")
+ endif()
+endif()
+
+set(ASY_VERSION "${ASY_VERSION_BASE}${ASY_VERSION_SUFFIX}")
+else()
+ message(STATUS "Override version specified")
+ set(ASY_VERSION ${ASY_VERSION_OVERRIDE})
+endif()
+
+message(STATUS "Asymptote version: ${ASY_VERSION}")
+
+
+list(APPEND ASY_MACROS
+ PACKAGE_NAME="${ASY_PACKAGE_NAME}"
+ PACKAGE_VERSION="${ASY_VERSION}"
+ PACKAGE_BUGREPORT="${ASY_BUGREPORT}"
+ PACKAGE_STRING="${ASY_PACKAGE_NAME} ${ASY_VERSION}"
+)
+
+# Since we require C++11 and up, some macros are automatically included
+list(APPEND ASY_MACROS
+ HAVE_UNORDERED_MAP
+ HAVE_STRFTIME
+ _USE_MATH_DEFINES
+)
+
+if (DEBUG_GC_ENABLE)
+ list(APPEND ASY_MACROS GC_DEBUG)
+endif()
+
+if (DEBUG_GC_BACKTRACE_ENABLE)
+ list(APPEND ASY_MACROS GC_BACKTRACE)
+endif()
+
+
+if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ list(APPEND ASY_MACROS LINUX_SYSTEM)
+endif()
+
+if (CMAKE_BUILD_TYPE IN_LIST cmake_debug_build_types)
+ list(APPEND ASY_MACROS DEBUG)
+endif()
+
+if (CTAN_BUILD)
+ list(APPEND ASY_MACROS CTAN_BUILD)
+endif()
diff --git a/graphics/asymptote/cmake-scripts/backport-libs.cmake b/graphics/asymptote/cmake-scripts/backport-libs.cmake
new file mode 100644
index 0000000000..416f9cc3a0
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/backport-libs.cmake
@@ -0,0 +1,11 @@
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backports/optional)
+
+list(APPEND ASY_STATIC_LIBARIES OptionalBackport)
+
+if (ENABLE_OPENGL)
+ add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/backports/glew)
+ # using glew within the repo
+ list(APPEND ASY_STATIC_LIBARIES GLEW)
+
+ list(APPEND ASYMPTOTE_INCLUDES $<TARGET_PROPERTY:GLEW,INCLUDE_DIRECTORIES>)
+endif()
diff --git a/graphics/asymptote/cmake-scripts/basic-parameters.cmake b/graphics/asymptote/cmake-scripts/basic-parameters.cmake
new file mode 100644
index 0000000000..d2d50842bd
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/basic-parameters.cmake
@@ -0,0 +1,6 @@
+set(ASY_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(ASY_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(ASY_RESOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(ASY_SRC_TEMPLATES_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(ASY_SCRIPTS_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+set(ASY_DOC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/doc)
diff --git a/graphics/asymptote/cmake-scripts/buildfiles-to-src.cmake b/graphics/asymptote/cmake-scripts/buildfiles-to-src.cmake
new file mode 100644
index 0000000000..de9d412292
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/buildfiles-to-src.cmake
@@ -0,0 +1,4 @@
+macro(build_files_to_src in_var out_var)
+ list(TRANSFORM ${in_var} PREPEND ${ASY_SRC_DIR}/ OUTPUT_VARIABLE ${out_var})
+ list(TRANSFORM ${out_var} APPEND .cc)
+endmacro()
diff --git a/graphics/asymptote/cmake-scripts/common.cmake b/graphics/asymptote/cmake-scripts/common.cmake
new file mode 100644
index 0000000000..8316f7182d
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/common.cmake
@@ -0,0 +1,6 @@
+macro(TODO_NOTIMPL message)
+ message(FATAL_ERROR "TODO: ${message}")
+endmacro()
+
+set(cmake_release_build_types Release RelWithDebInfo MinSizeRel)
+set(cmake_debug_build_types Debug)
diff --git a/graphics/asymptote/cmake-scripts/compiler-config.cmake b/graphics/asymptote/cmake-scripts/compiler-config.cmake
new file mode 100644
index 0000000000..852f0a50b5
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/compiler-config.cmake
@@ -0,0 +1,15 @@
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
+
+if (OPTIMIZE_LINK_TIME)
+ include(CheckIPOSupported)
+
+ check_ipo_supported(RESULT ipo_supported_result LANGUAGES C CXX)
+
+ if (ipo_supported_result)
+ set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
+ message(STATUS "Using link-time optimization")
+ else()
+ message(FATAL_ERROR "Compiler does not support link-time optimization")
+ endif()
+endif()
diff --git a/graphics/asymptote/cmake-scripts/docgen.cmake b/graphics/asymptote/cmake-scripts/docgen.cmake
new file mode 100644
index 0000000000..87c2c0199a
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/docgen.cmake
@@ -0,0 +1,305 @@
+if (NOT ENABLE_DOCGEN)
+ message(FATAL_ERROR "Documentation generation is disabled")
+endif()
+
+set(ASY_TEX_BUILD_ROOT ${CMAKE_CURRENT_BINARY_DIR}/docbuild)
+file(MAKE_DIRECTORY ${ASY_TEX_BUILD_ROOT})
+configure_file(${ASY_RESOURCE_DIR}/version.texi.in ${ASY_TEX_BUILD_ROOT}/version.texi)
+
+set(LATEX_ARTIFRACT_EXTENSIONS aux hd idx ins log out toc)
+
+set(PDFLATEX_BASE_ARGUMENTS ${PDFLATEX_COMPILER}
+ -output-directory=${ASY_TEX_BUILD_ROOT}
+)
+
+find_package(LATEX COMPONENTS PDFLATEX REQUIRED)
+list(
+ TRANSFORM LATEX_ARTIFRACT_EXTENSIONS
+ PREPEND ${ASY_TEX_BUILD_ROOT}/asy-latex.
+ OUTPUT_VARIABLE ASY_LATEX_DTX_ARTIFACTS
+)
+
+add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/asy-latex.pdf ${ASY_TEX_BUILD_ROOT}/asymptote.sty
+ DEPENDS ${ASY_DOC_DIR}/asy-latex.dtx
+ COMMAND ${PDFLATEX_BASE_ARGUMENTS} ${ASY_DOC_DIR}/asy-latex.dtx
+ WORKING_DIRECTORY ${ASY_DOC_DIR}
+ BYPRODUCTS ${ASY_LATEX_DTX_ARTIFACTS}
+)
+
+add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/latexusage.pdf
+ DEPENDS
+ ${ASY_DOC_DIR}/latexusage.tex
+ ${ASY_TEX_BUILD_ROOT}/asymptote.sty
+ asy ${ASY_OUTPUT_BASE_FILES}
+ COMMAND ${PY3_INTERPRETER} ${ASY_DOC_DIR}/build-latexusage-pdf.py
+ --build-dir=${ASY_TEX_BUILD_ROOT}
+ --latexusage-source-dir=${ASY_DOC_DIR}
+ --pdflatex-executable=${PDFLATEX_COMPILER}
+ --asy-executable=$<TARGET_FILE:asy>
+ --asy-base-dir=${ASY_BUILD_BASE_DIR}
+ WORKING_DIRECTORY ${ASY_DOC_DIR}
+ BYPRODUCTS ${ASY_TEX_BUILD_ROOT}/latexusage.log
+)
+
+set(CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS ${CMAKE_COMMAND} -E copy -t ${ASY_TEX_BUILD_ROOT})
+set(CMAKE_RM_BASE_ARGUMENTS ${CMAKE_COMMAND} -E rm)
+set(ASY_BASE_ARGUMENTS asy -dir ${ASY_BUILD_BASE_DIR} -config '' -render=0 -noprc -noV)
+
+macro(add_additional_pdf_outputs filename_base num_times_to_call_pdflatex compiler)
+ # ARGN can be used to specify additional dependencies
+ foreach (DUMMY_VAR RANGE 1 ${num_times_to_call_pdflatex})
+ list(APPEND COMMAND_ARGS COMMAND ${compiler} ${ASY_DOC_DIR}/${filename_base}.tex)
+ endforeach()
+
+ set(PDFLATEX_OUTPUT_PREFIX ${ASY_TEX_BUILD_ROOT}/${filename_base})
+
+ # there are unfortunately still some issues with out-of-source builds
+ # with pdflatex, hence we have to copy the files to the build root first
+ add_custom_command(
+ OUTPUT ${PDFLATEX_OUTPUT_PREFIX}.tex
+ DEPENDS ${ASY_DOC_DIR}/${filename_base}.tex
+ COMMAND ${CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS} ${ASY_DOC_DIR}/${filename_base}.tex
+ )
+
+ add_custom_command(
+ OUTPUT ${PDFLATEX_OUTPUT_PREFIX}.pdf
+ DEPENDS ${PDFLATEX_OUTPUT_PREFIX}.tex
+ ${ARGN}
+ ${COMMAND_ARGS}
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS} -f ${PDFLATEX_OUTPUT_PREFIX}.dvi
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ BYPRODUCTS
+ ${PDFLATEX_OUTPUT_PREFIX}.aux
+ ${PDFLATEX_OUTPUT_PREFIX}.log
+ ${PDFLATEX_OUTPUT_PREFIX}.toc
+ )
+endmacro()
+
+# asy -> pdf file generation
+
+set(ASY_DOC_PDF_FILES "")
+
+macro(add_asy_pdf_dependency_basic asyfile)
+ set(ASY_DOC_FILE_OUTPUT ${ASY_TEX_BUILD_ROOT}/${asyfile}.pdf)
+ # asymptote has some problems (currently as writing this) with asy files involving tex
+ # and output directory not matching, so a workaround is to copy to the doc build root
+ add_custom_command(
+ OUTPUT ${ASY_DOC_FILE_OUTPUT}
+ DEPENDS ${ASY_DOC_DIR}/${asyfile}.asy asy ${ASY_OUTPUT_BASE_FILES}
+ # copy <docroot>/file.asy -> <buildroot>/file.asy
+ COMMAND ${CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS} ${ASY_DOC_DIR}/${asyfile}.asy
+ COMMAND ${ASY_BASE_ARGUMENTS} -fpdf ${asyfile}.asy
+ # cleanup <buildroot>/file.asy
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS}
+ ${ASY_TEX_BUILD_ROOT}/${asyfile}.asy
+ # cleanup tex artifacts, if exist
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS} -f
+ ${ASY_TEX_BUILD_ROOT}/${asyfile}_.tex
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ )
+ list(APPEND ASY_DOC_PDF_FILES ${ASY_DOC_FILE_OUTPUT})
+endmacro()
+
+# CAD1 is here because it is needed for CAD.pdf.
+add_asy_pdf_dependency_basic(CAD1)
+
+# additional asymptote file outputs
+add_additional_pdf_outputs(asyRefCard 1 ${PDFTEX_EXEC})
+add_additional_pdf_outputs(TeXShopAndAsymptote 2 ${PDFLATEX_COMPILER})
+add_additional_pdf_outputs(
+ CAD
+ 3
+ ${PDFLATEX_COMPILER}
+ DEPENDS ${ASY_TEX_BUILD_ROOT}/CAD1.pdf
+)
+
+set(
+ BASE_ASYMPTOTE_DOC_AND_TEX_FILES
+ ${ASY_TEX_BUILD_ROOT}/asymptote.sty
+ ${ASY_TEX_BUILD_ROOT}/asy-latex.pdf
+ ${ASY_TEX_BUILD_ROOT}/CAD.pdf
+ ${ASY_TEX_BUILD_ROOT}/TeXShopAndAsymptote.pdf
+ ${ASY_TEX_BUILD_ROOT}/asyRefCard.pdf
+)
+
+add_custom_target(docgen DEPENDS ${BASE_ASYMPTOTE_DOC_AND_TEX_FILES})
+
+
+# the following files are only used with docgen, hence they are not added if
+# ENABLE_ASYMPTOTE_PDF_DOCGEN is not used
+if (ENABLE_ASYMPTOTE_PDF_DOCGEN)
+# asy files
+set(ASY_DOC_FILE_PREFIXES
+ axis3 basealign bezier bigdiagonal binarytreetest Bode brokenaxis
+ colons colors cube cylinderskeleton datagraph diagonal dots
+ eetomumu elliptic errorbars exp fillcontour flow flowchartdemo
+ GaussianSurface generalaxis generalaxis3 graphmarkers graphwithderiv grid3xyz
+ hatch helix HermiteSpline histogram Hobbycontrol Hobbydir icon image imagecontour
+ irregularcontour join join3 knots labelsquare legend lineargraph lineargraph0
+ linetype log2graph loggraph loggrid logimage logticks makepen markers1 markers2 mexicanhat
+ monthaxis multicontour onecontour parametricgraph penfunctionimage penimage planes quartercircle
+ saddle scaledgraph shadedtiling slopefield1 square subpictures superpath tile
+ triangulate unitcircle3 vectorfield
+)
+
+# independent asymptote files that can be generated with any other files
+foreach(ASY_DOC_FILE_PREFIX ${ASY_DOC_FILE_PREFIXES})
+ add_asy_pdf_dependency_basic(${ASY_DOC_FILE_PREFIX})
+endforeach()
+
+macro(add_asy_file_with_extension asy_file extra_ext)
+ set(ASY_DOC_FILE_OUTPUT ${ASY_TEX_BUILD_ROOT}/${asy_file}.pdf)
+ set(ASY_AUX_FILE_NAME ${asy_file}.${extra_ext})
+ # asymptote has some problems (currently as writing this) with asy files involving tex
+ # and output directory not matching, so a workaround is to copy to the doc build root
+ add_custom_command(
+ OUTPUT ${ASY_DOC_FILE_OUTPUT}
+ DEPENDS
+ ${ASY_DOC_DIR}/${asy_file}.asy
+ ${ASY_DOC_DIR}/${ASY_AUX_FILE_NAME}
+ asy ${ASY_OUTPUT_BASE_FILES}
+ COMMAND ${CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS}
+ ${ASY_DOC_DIR}/${asy_file}.asy
+ ${ASY_DOC_DIR}/${ASY_AUX_FILE_NAME}
+ COMMAND ${ASY_BASE_ARGUMENTS} -fpdf ${ASY_DOC_FILE_PREFIX}.asy
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS}
+ ${ASY_TEX_BUILD_ROOT}/${asy_file}.asy
+ ${ASY_TEX_BUILD_ROOT}/${ASY_AUX_FILE_NAME}
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS} -f
+ ${ASY_TEX_BUILD_ROOT}/${asy_file}_.tex
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ )
+ list(APPEND ASY_DOC_PDF_FILES ${ASY_DOC_FILE_OUTPUT})
+endmacro()
+
+# asy + csv Files
+foreach(ASY_DOC_FILE_PREFIX diatom secondaryaxis westnile)
+ add_asy_file_with_extension(${ASY_DOC_FILE_PREFIX} csv)
+endforeach()
+
+# asy + dat files
+foreach(ASY_DOC_FILE_PREFIX filegraph leastsquares)
+ add_asy_file_with_extension(${ASY_DOC_FILE_PREFIX} dat)
+endforeach()
+
+
+# handle CDlabel and logo separately
+macro(copy_doc_asy_file_to_docbuild_root asyfile)
+ add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/${asyfile}.asy
+ COMMAND ${CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS}
+ ${ASY_DOC_DIR}/${asyfile}.asy
+ DEPENDS ${ASY_DOC_DIR}/${asyfile}.asy
+ )
+endmacro()
+
+function(add_asy_file_with_asy_dependency asyfile) # <asydep1> [asydep2] ...
+ list(
+ TRANSFORM ARGN
+ PREPEND ${ASY_TEX_BUILD_ROOT}/
+ OUTPUT_VARIABLE ASY_REQUIRED_DEPS
+ )
+ list(
+ TRANSFORM ASY_REQUIRED_DEPS
+ APPEND .asy
+ )
+
+ add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/${asyfile}.pdf
+ DEPENDS ${ASY_DOC_DIR}/${asyfile}.asy asy ${ASY_OUTPUT_BASE_FILES} ${ASY_REQUIRED_DEPS}
+ # copy <docroot>/file.asy -> <buildroot>/file.asy
+ COMMAND ${CMAKE_COPY_ASY_FILE_TO_DOCBUILD_BASE_ARGS} ${ASY_DOC_DIR}/${asyfile}.asy
+ COMMAND ${ASY_BASE_ARGUMENTS} -fpdf ${asyfile}.asy
+ # cleanup <buildroot>/file.asy
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS} ${ASY_TEX_BUILD_ROOT}/${asyfile}.asy
+ # cleanup tex artifacts, if exist
+ COMMAND ${CMAKE_RM_BASE_ARGUMENTS} -f ${ASY_TEX_BUILD_ROOT}/${asyfile}_.tex
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ )
+endfunction()
+
+macro(add_asy_file_from_docbuild_root asyfile)
+ # does not copy from doc root to docbuild root; have to do manually
+ add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/${asyfile}.pdf
+ COMMAND ${ASY_BASE_ARGUMENTS} -fpdf ${asyfile}.asy
+ DEPENDS ${ASY_TEX_BUILD_ROOT}/${asyfile}.asy
+ BYPRODUCTS ${ASY_TEX_BUILD_ROOT}/${asyfile}_.tex ${ASY_TEX_BUILD_ROOT}/${asyfile}_.eps
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ )
+endmacro()
+
+# CDlabel + logo
+copy_doc_asy_file_to_docbuild_root(logo)
+add_asy_file_from_docbuild_root(logo)
+add_asy_file_with_asy_dependency(CDlabel logo)
+
+# bezier2 & beziercurve
+copy_doc_asy_file_to_docbuild_root(beziercurve)
+add_asy_file_from_docbuild_root(beziercurve)
+add_asy_file_with_asy_dependency(bezier2 beziercurve)
+
+list(APPEND ASY_DOC_PDF_FILES
+ ${ASY_TEX_BUILD_ROOT}/logo.pdf
+ ${ASY_TEX_BUILD_ROOT}/CDlabel.pdf
+ ${ASY_TEX_BUILD_ROOT}/beziercurve.pdf
+ ${ASY_TEX_BUILD_ROOT}/bezier2.pdf
+)
+
+# options file
+add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/options
+ DEPENDS asy ${ASY_DOC_DIR}/gen-asy-options-file.py
+ COMMAND ${PY3_INTERPRETER} ${ASY_DOC_DIR}/gen-asy-options-file.py
+ --asy-executable=$<TARGET_FILE:asy>
+ --output-file=${ASY_TEX_BUILD_ROOT}/options
+)
+
+# asymptote.pdf
+
+set(TEXI_ARTIFACT_EXTENSIONS log tmp cp toc cps aux)
+list(
+ TRANSFORM TEXI_ARTIFACT_EXTENSIONS
+ PREPEND ${ASY_TEX_BUILD_ROOT}/asymptote.
+ OUTPUT_VARIABLE ASYMPTOTE_PDF_EXTRA_ARTIFACTS
+ )
+
+if (WIN32)
+if (WIN32_TEXINDEX STREQUAL WSL)
+ set(TEXINDEX_WRAPPER ${CMAKE_CURRENT_SOURCE_DIR}/windows/texindex-wsl.cmd)
+else()
+ set(TEXINDEX_WRAPPER ${WIN32_TEXINDEX})
+endif()
+add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/asymptote.pdf
+ DEPENDS
+ ${ASY_TEX_BUILD_ROOT}/options
+ ${ASY_TEX_BUILD_ROOT}/latexusage.pdf
+ ${ASY_DOC_DIR}/asymptote.texi
+ ${ASY_DOC_PDF_FILES}
+ COMMAND ${PY3_INTERPRETER}
+ ${ASY_DOC_DIR}/build-asymptote-pdf-win.py
+ --texify-loc=${TEXIFY}
+ --texindex-loc=${TEXINDEX_WRAPPER}
+ --texi-file=${ASY_DOC_DIR}/asymptote.texi
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ BYPRODUCTS ${ASYMPTOTE_PDF_EXTRA_ARTIFACTS}
+)
+else()
+add_custom_command(
+ OUTPUT ${ASY_TEX_BUILD_ROOT}/asymptote.pdf
+ DEPENDS
+ ${ASY_TEX_BUILD_ROOT}/options
+ ${ASY_TEX_BUILD_ROOT}/latexusage.pdf
+ ${ASY_DOC_DIR}/asymptote.texi
+ ${ASY_DOC_PDF_FILES}
+ COMMAND ${TEXI2DVI} --pdf ${ASY_DOC_DIR}/asymptote.texi
+ WORKING_DIRECTORY ${ASY_TEX_BUILD_ROOT}
+ BYPRODUCTS ${ASYMPTOTE_PDF_EXTRA_ARTIFACTS}
+)
+endif()
+add_custom_target(asymptote_pdf_file DEPENDS ${ASY_TEX_BUILD_ROOT}/asymptote.pdf)
+add_dependencies(docgen asymptote_pdf_file)
+endif() # ENABLE_ASYMPTOTE_PDF_DOCGEN
diff --git a/graphics/asymptote/cmake-scripts/external-libs.cmake b/graphics/asymptote/cmake-scripts/external-libs.cmake
new file mode 100644
index 0000000000..2afe6ab168
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/external-libs.cmake
@@ -0,0 +1,316 @@
+include(FindPkgConfig)
+include(FetchContent)
+
+FetchContent_Declare(
+ lspcpp
+ GIT_REPOSITORY https://github.com/vectorgraphics/LspCpp
+ GIT_TAG master
+)
+
+if (ENABLE_LSP)
+
+ message(STATUS "LSP Enabled.")
+ # disable New Boost version warning
+ set(Boost_NO_WARN_NEW_VERSIONS 1)
+ set(USE_SYSTEM_RAPIDJSON 1)
+ set(LSPCPP_USE_CPP17 1)
+ set(LSPCPP_SUPPORT_BOEHM_GC 1)
+ # For transitive URI dependency
+ set(Uri_BUILD_DOCS 0)
+ set(Uri_BUILD_TESTS 0)
+ FetchContent_MakeAvailable(lspcpp)
+ list(APPEND ASY_STATIC_LIBARIES lspcpp)
+ list(APPEND ASY_MACROS HAVE_LSP=1)
+else()
+ FetchContent_Populate(lspcpp)
+ # only include lsp libraries
+ message(STATUS "LSP Disabled. Will not have language server protocol support.")
+ list(APPEND ASYMPTOTE_INCLUDES ${lspcpp_SOURCE_DIR}/include)
+endif()
+
+# zlib
+find_package(ZLIB REQUIRED)
+list(APPEND ASY_STATIC_LIBARIES ZLIB::ZLIB)
+
+# flex + bison
+if (UNIX)
+ include(FindFLEX)
+ include(FindBISON)
+
+ if (NOT FLEX_FOUND)
+ message(FATAL_ERROR "FLEX is required for building")
+ endif()
+
+ if (NOT BISON_FOUND)
+ message(FATAL_ERROR "Bison is required for building")
+ endif()
+elseif(WIN32)
+ if ((NOT WIN32_FLEX_BINARY) OR (NOT WIN32_BISON_BINARY))
+ # downlod winflexbison
+ message(STATUS "Flex or bison not given; downloading winflexbison.")
+
+
+ FetchContent_Declare(
+ winflexbison
+ URL https://github.com/lexxmark/winflexbison/releases/download/v2.5.25/win_flex_bison-2.5.25.zip
+ URL_HASH SHA256=8D324B62BE33604B2C45AD1DD34AB93D722534448F55A16CA7292DE32B6AC135
+ )
+ FetchContent_MakeAvailable(winflexbison)
+ message(STATUS "Downloaded winflexbison")
+
+ if (NOT WIN32_FLEX_BINARY)
+ set(FLEX_EXECUTABLE ${winflexbison_SOURCE_DIR}/win_flex.exe)
+ endif()
+
+ if (NOT WIN32_BISON_BINARY)
+ set(BISON_EXECUTABLE ${winflexbison_SOURCE_DIR}/win_bison.exe)
+ endif()
+ else()
+ set(FLEX_EXECUTABLE ${WIN32_FLEX_BINARY})
+ set(BISON_EXECUTABLE ${WIN32_BISON_BINARY})
+ endif()
+endif()
+
+# getopt (win32 only)
+
+if (WIN32)
+ find_package(unofficial-getopt-win32 REQUIRED)
+ list(APPEND ASY_STATIC_LIBARIES unofficial::getopt-win32::getopt)
+endif()
+
+# glm; mandatory for all builds
+find_package(glm CONFIG)
+if (glm_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES glm::glm)
+ list(APPEND ASY_MACROS HAVE_LIBGLM)
+else()
+ message(FATAL_ERROR "glm not found; will not use glm")
+endif()
+
+# -------- not required, but highly recommend if your system can build it ---------
+# these options are (mostly) on by default
+
+# boehm gc
+
+if (ENABLE_GC)
+ find_package(BDWgc CONFIG)
+ if (BDWgc_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES BDWgc::gc BDWgc::gccpp)
+ if (WIN32)
+ list(APPEND ASY_STATIC_LIBARIES BDWgc::gctba)
+ endif()
+ list(APPEND ASY_MACROS USEGC)
+ else()
+ message(FATAL_ERROR "BDWgc not found")
+ endif()
+else()
+ message(STATUS "Disabling gc support")
+endif()
+
+
+if (ENABLE_READLINE)
+# curses
+ if (UNIX)
+ # we know ncurses work on unix systems, however
+ # not always supported on windows (esp. msvc)
+ set(CURSES_NEED_NCURSES TRUE)
+
+ find_package(Curses)
+ if (Curses_FOUND)
+ list(APPEND ASYMPTOTE_INCLUDES ${CURSES_INCLUDE_DIRS})
+ list(APPEND ASY_COMPILE_OPTS ${CURSES_CFLAGS})
+ list(APPEND ASY_STATIC_LIBRARIES ${CURSES_LIBRARIES})
+
+ list(APPEND ASY_MACROS HAVE_NCURSES_CURSES_H HAVE_LIBCURSES)
+ else()
+ message(FATAL_ERROR "curses not found; will compile without curses")
+ endif()
+
+ pkg_check_modules(readline IMPORTED_TARGET readline)
+
+ if (readline_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES PkgConfig::readline)
+ list(APPEND ASY_MACROS HAVE_LIBREADLINE)
+ else ()
+ message(FATAL_ERROR "readline not found; will compile without libreadline")
+ endif()
+ elseif(WIN32)
+ find_package(unofficial-pdcurses CONFIG)
+ if (unofficial-pdcurses_FOUND)
+ list(APPEND ASY_STATIC_LIBRARIES unofficial::pdcurses::pdcurses)
+ list(APPEND ASY_MACROS HAVE_CURSES_H HAVE_LIBCURSES)
+ else()
+ message(FATAL_ERROR "curses not found; will compile without curses")
+ endif()
+
+ find_package(unofficial-readline-win32 CONFIG)
+ if (unofficial-readline-win32_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES unofficial::readline-win32::readline)
+ list(APPEND ASY_MACROS HAVE_LIBREADLINE)
+ else ()
+ message(FATAL_ERROR "readline not found; will compile without libreadline")
+ endif()
+ else()
+ message(FATAL_ERROR "Only supported on Unix or Win32 systems")
+ endif()
+else()
+ message(STATUS "libreadline disabled; will not use libreadline")
+endif()
+
+# libcurl
+if (ENABLE_CURL)
+ find_package(CURL)
+ if (CURL_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES CURL::libcurl)
+ list(APPEND ASY_MACROS HAVE_LIBCURL)
+ else()
+ message(FATAL_ERROR "curl not found")
+ endif()
+else()
+ message(STATUS "Disabling curl support")
+endif()
+
+# pthreads
+if (ENABLE_THREADING)
+ if (UNIX)
+ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
+ set(THREADS_PREFER_PTHREAD_FLAG TRUE)
+ include(FindThreads)
+
+ if(CMAKE_USE_PTHREADS_INIT)
+ list(APPEND ASY_STATIC_LIBARIES Threads::Threads)
+ list(APPEND ASY_MACROS HAVE_PTHREAD=1)
+ else()
+ message(FATAL_ERROR "No thread library specified")
+ endif()
+ elseif(WIN32)
+ find_package(PThreads4W)
+
+ if(PThreads4W_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES PThreads4W::PThreads4W)
+ list(APPEND ASY_MACROS HAVE_PTHREAD=1)
+ else()
+ message(FATAL_ERROR "No thread library specified")
+ endif()
+ else()
+ message(FATAL_ERROR "Only supported on Unix or Win32 systems")
+ endif()
+else()
+ message(STATUS "Disabling threading support")
+endif()
+
+# gsl
+if (ENABLE_GSL)
+ find_package(GSL)
+ if (GSL_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES GSL::gsl)
+ list(APPEND ASY_MACROS HAVE_LIBGSL)
+ else()
+ message(FATAL_ERROR "GSL not found")
+ endif()
+else()
+ message(STATUS "Disabling gsl support")
+endif()
+
+
+# eigen
+if (ENABLE_EIGEN3)
+find_package(Eigen3 CONFIG)
+ if (Eigen3_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES Eigen3::Eigen)
+ list(APPEND ASY_MACROS HAVE_EIGEN_DENSE)
+ else()
+ message(FATAL_ERROR "eigen3 not found")
+ endif()
+else()
+ message(STATUS "Disabling eigen3 support")
+endif()
+
+# OpenGL stuff
+if (ENABLE_OPENGL)
+ # fatal error here, since OpenGL is optional
+ find_package(OpenGL REQUIRED)
+ if (OPENGL_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES OpenGL::GL)
+ else()
+ message(WARNING "gl libraries not found")
+ endif()
+
+ if (OPENGL_GLU_FOUND)
+ list(APPEND ASY_MACROS HAVE_GL)
+ else()
+ message(FATAL_ERROR "GL components incomplete; will not use OpenGL")
+ endif()
+
+ find_package(FreeGLUT CONFIG)
+ if (FreeGLUT_FOUND)
+ list(APPEND ASY_STATIC_LIBARIES
+ $<IF:$<TARGET_EXISTS:FreeGLUT::freeglut>,FreeGLUT::freeglut,FreeGLUT::freeglut_static>)
+ list(APPEND ASY_MACROS FREEGLUT HAVE_LIBGLUT)
+ else()
+ message(FATAL_ERROR "freeglut not found; will not use freeglut")
+ endif()
+
+ if (ENABLE_GL_COMPUTE_SHADERS)
+ list(APPEND ASY_MACROS HAVE_COMPUTE_SHADER)
+ else()
+ message(WARNING "Compute shader disabled")
+ endif()
+
+ if (ENABLE_GL_SSBO)
+ list(APPEND ASY_MACROS HAVE_SSBO)
+ else()
+ message(WARNING "SSBO disabled")
+ endif()
+else()
+ message(STATUS "Disabling opengl support")
+endif()
+
+
+if (ENABLE_RPC_FEATURES)
+ if(UNIX)
+ pkg_check_modules(TIRPC REQUIRED IMPORTED_TARGET libtirpc)
+ list(APPEND ASY_STATIC_LIBARIES PkgConfig::TIRPC)
+ endif()
+
+ if (WIN32)
+ # win32 does not have native open_memstream support
+ set(OLD_BUILD_TESTING ${BUILD_TESTING})
+ set(BUILD_TESTING false)
+ FetchContent_Declare(
+ fmem
+ GIT_REPOSITORY https://github.com/Kreijstal/fmem.git
+ GIT_TAG 6274a441380a8fcfd4e1a6e47b3d1f0b28b3c48a
+ )
+ FetchContent_MakeAvailable(fmem)
+ set(BUILD_TESTING ${OLD_BUILD_TESTING})
+
+ list(APPEND ASY_STATIC_LIBARIES fmem)
+ list(APPEND ASYMPTOTE_INCLUDES $<TARGET_PROPERTY:fmem,INCLUDE_DIRECTORIES>)
+ endif()
+ list(APPEND ASY_MACROS HAVE_LIBTIRPC)
+
+
+else()
+ message(STATUS "Disabling rpc and xdr/v3d support")
+endif()
+
+# fftw3
+
+if (ENABLE_FFTW3)
+ set(FFTW3_USABLE TRUE)
+ find_package(FFTW3 CONFIG)
+ if (NOT FFTW3_FOUND)
+ message(WARNING "libfftw3 not found; will not use fftw3")
+ set(FFTW3_USABLE FALSE)
+ endif()
+
+ if (FFTW3_USABLE)
+ list(APPEND ASY_STATIC_LIBARIES FFTW3::fftw3)
+ list(APPEND ASY_MACROS HAVE_LIBFFTW3 FFTWPP_SINGLE_THREAD)
+ else()
+ message(FATAL_ERROR "environment lacks needed fftw3 features")
+ endif()
+else()
+ message(STATUS "Disabling fftw3 support")
+endif()
diff --git a/graphics/asymptote/cmake-scripts/generated-files.cmake b/graphics/asymptote/cmake-scripts/generated-files.cmake
new file mode 100644
index 0000000000..bfecb670e5
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/generated-files.cmake
@@ -0,0 +1,224 @@
+# generated include directories
+set(GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated/include")
+file(MAKE_DIRECTORY ${GENERATED_INCLUDE_DIR})
+
+# directory for auxilliary files
+set(GENERATED_AUX_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated/auxiliary")
+file(MAKE_DIRECTORY ${GENERATED_AUX_DIR})
+
+# generated sources
+set(GENERATED_SRC_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated/src")
+file(MAKE_DIRECTORY ${GENERATED_SRC_DIR})
+
+
+# opsymbols.h
+add_custom_command(
+ OUTPUT ${GENERATED_INCLUDE_DIR}/opsymbols.h
+ COMMAND ${PERL_INTERPRETER}
+ ${ASY_SCRIPTS_DIR}/opsymbols.pl
+ --campfile ${ASY_RESOURCE_DIR}/camp.l
+ --output ${GENERATED_INCLUDE_DIR}/opsymbols.h
+ MAIN_DEPENDENCY ${ASY_RESOURCE_DIR}/camp.l
+ DEPENDS ${ASY_SCRIPTS_DIR}/opsymbols.pl
+)
+
+list(APPEND ASYMPTOTE_INCLUDES ${GENERATED_INCLUDE_DIR})
+list(APPEND ASYMPTOTE_GENERATED_HEADERS ${GENERATED_INCLUDE_DIR}/opsymbols.h)
+list(APPEND ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS ${GENERATED_INCLUDE_DIR}/opsymbols.h)
+
+# run-* files
+function(_int_add_runtime_file runtime_file)
+ set(RUNTIME_FILE_IN_BASE ${ASY_SRC_TEMPLATES_DIR}/${runtime_file})
+ set(RUNTIME_FILES_OUT ${GENERATED_SRC_DIR}/${runtime_file}.cc ${GENERATED_INCLUDE_DIR}/${runtime_file}.h)
+ set(RUNTIME_SCRIPT ${ASY_SCRIPTS_DIR}/runtime.pl)
+ set(OPSYM_FILE ${GENERATED_INCLUDE_DIR}/opsymbols.h)
+ set(RUNTIME_BASE_FILE ${ASY_SRC_TEMPLATES_DIR}/runtimebase.in)
+ add_custom_command(
+ OUTPUT ${RUNTIME_FILES_OUT}
+ COMMAND ${PERL_INTERPRETER} ${RUNTIME_SCRIPT}
+ --opsym-file ${OPSYM_FILE}
+ --runtime-base-file ${RUNTIME_BASE_FILE}
+ --src-template-dir ${ASY_SRC_TEMPLATES_DIR}
+ --prefix ${runtime_file}
+ --header-out-dir ${GENERATED_INCLUDE_DIR}
+ --src-out-dir ${GENERATED_SRC_DIR}
+ MAIN_DEPENDENCY ${RUNTIME_FILE_IN_BASE}.in
+ DEPENDS ${RUNTIME_SCRIPT} ${OPSYM_FILE} ${RUNTIME_BASE_FILE} ${RUNTIME_FILE_DEP}
+ )
+endfunction()
+
+macro(add_runtime_file runtime_file)
+ _int_add_runtime_file(${runtime_file})
+ list(APPEND ASY_GENERATED_BUILD_SOURCES
+ ${GENERATED_SRC_DIR}/${runtime_file}.cc
+ )
+ set(_ASY_GENERATED_HEADER_NAME ${GENERATED_INCLUDE_DIR}/${runtime_file}.h)
+ list(APPEND ASYMPTOTE_GENERATED_HEADERS ${_ASY_GENERATED_HEADER_NAME})
+ list(APPEND ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS ${_ASY_GENERATED_HEADER_NAME})
+endmacro()
+
+foreach(RUNTIME_FILE ${RUNTIME_BUILD_FILES})
+ add_runtime_file(${RUNTIME_FILE})
+endforeach()
+
+# keywords.h
+set(KEYWORDS_HEADER_OUT ${GENERATED_INCLUDE_DIR}/keywords.h)
+add_custom_command(
+ OUTPUT ${KEYWORDS_HEADER_OUT}
+ COMMAND ${PERL_INTERPRETER} ${ASY_SCRIPTS_DIR}/keywords.pl
+ --camplfile ${ASY_RESOURCE_DIR}/camp.l
+ --output ${GENERATED_INCLUDE_DIR}/keywords.h
+ --process-file ${ASY_SRC_DIR}/asyprocess.cc
+ MAIN_DEPENDENCY ${ASY_RESOURCE_DIR}/camp.l
+ DEPENDS ${ASY_SCRIPTS_DIR}/keywords.pl ${ASY_SRC_DIR}/asyprocess.cc
+)
+
+list(APPEND ASYMPTOTE_GENERATED_HEADERS ${KEYWORDS_HEADER_OUT})
+list(APPEND ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS ${KEYWORDS_HEADER_OUT})
+
+set(camp_lex_output ${GENERATED_SRC_DIR}/lex.yy.cc)
+set(camp_l_file ${ASY_RESOURCE_DIR}/camp.l)
+
+if (WIN32)
+ list(APPEND FLEX_ARGS --wincompat)
+endif()
+
+# flex + bison
+
+# flex
+add_custom_command(
+ OUTPUT ${camp_lex_output}
+ COMMAND ${FLEX_EXECUTABLE} ${FLEX_ARGS} -o ${camp_lex_output} ${camp_l_file}
+ MAIN_DEPENDENCY ${camp_l_file}
+)
+
+list(APPEND ASY_GENERATED_BUILD_SOURCES ${camp_lex_output})
+
+# bison
+set(bison_output ${GENERATED_SRC_DIR}/camp.tab.cc)
+set(bison_header ${GENERATED_INCLUDE_DIR}/camp.tab.h)
+set(bison_input ${ASY_RESOURCE_DIR}/camp.y)
+add_custom_command(
+ OUTPUT ${bison_output} ${bison_header}
+ COMMAND ${BISON_EXECUTABLE} -t --header=${bison_header} -o ${bison_output} ${bison_input}
+ MAIN_DEPENDENCY ${bison_input}
+)
+
+list(APPEND ASY_GENERATED_BUILD_SOURCES ${bison_output})
+list(APPEND ASYMPTOTE_GENERATED_HEADERS ${bison_header})
+list(APPEND ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS ${bison_header})
+
+# generate enums from csv
+foreach(csv_enum_file ${ASY_CSV_ENUM_FILES})
+ set(generated_header_file ${GENERATED_INCLUDE_DIR}/${csv_enum_file}.h)
+
+ add_custom_command(
+ OUTPUT ${generated_header_file}
+ COMMAND ${PY3_INTERPRETER} ${ASY_SCRIPTS_DIR}/generate_enums.py
+ --language cpp
+ --name ${csv_enum_file}
+ --input ${ASY_RESOURCE_DIR}/${csv_enum_file}.csv
+ --output ${generated_header_file}
+ --xopt namespace=camp
+ MAIN_DEPENDENCY ${ASY_RESOURCE_DIR}/${csv_enum_file}.csv
+ DEPENDS ${ASY_SCRIPTS_DIR}/generate_enums.py
+ )
+
+ list(APPEND ASYMPTOTE_GENERATED_HEADERS ${generated_header_file})
+ list(APPEND ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS ${generated_header_file})
+endforeach ()
+
+# raw.i files
+# generating preprocessed files
+set(FINDSYM_FILE ${ASY_SCRIPTS_DIR}/findsym.pl)
+# combine all files into allsymbols.h
+function(symfile_preprocess src_dir symfile symfile_raw_output_varname header_output_varname)
+ set(symfile_raw_output_var ${symfile_raw_output_varname})
+ set(processed_output_file ${GENERATED_AUX_DIR}/${symfile}.raw.i)
+ set(${symfile_raw_output_var} ${processed_output_file} PARENT_SCOPE)
+
+ set(cxx_preprocessor ${CMAKE_CXX_COMPILER})
+
+ if (MSVC)
+ if (GCCCOMPAT_CXX_COMPILER_FOR_MSVC)
+ set(cxx_preprocessor ${GCCCOMPAT_CXX_COMPILER_FOR_MSVC})
+ else()
+ set(msvc_flag --msvc)
+ endif()
+ endif()
+
+ set(asy_includes_list "$<TARGET_PROPERTY:asy,INCLUDE_DIRECTORIES>")
+ set(asy_macros_list "$<TARGET_PROPERTY:asy,COMPILE_DEFINITIONS>")
+ set(asy_cxx_std "$<TARGET_PROPERTY:asy,CXX_STANDARD>")
+
+ if (UNIX)
+ # for unix systems, need verbatim flag because
+ # the arguments contains semicolon, though somehow
+ # verbatim option causes problems for windows
+ set(ADDITIONAL_ADD_CUSTOM_CMD_ARGS VERBATIM)
+ endif()
+
+ add_custom_command(
+ OUTPUT ${processed_output_file}
+ COMMAND ${PY3_INTERPRETER} ${ASY_SCRIPTS_DIR}/gen_preprocessed_depfile.py
+ --cxx-compiler=${cxx_preprocessor}
+ "$<$<BOOL:${asy_includes_list}>:--include-dirs=${asy_includes_list}>"
+ "$<$<BOOL:${asy_cxx_std}>:--cxx-standard=${asy_cxx_std}>"
+ "$<$<BOOL:${asy_macros_list}>:--macro-defs=${asy_macros_list}>"
+ --out-dep-file=${GENERATED_AUX_DIR}/${symfile}.d
+ --out-i-file=${processed_output_file}
+ --in-src-file=${src_dir}/${symfile}.cc
+ ${msvc_flag}
+ DEPFILE ${GENERATED_AUX_DIR}/${symfile}.d
+ BYPRODUCTS ${GENERATED_AUX_DIR}/${symfile}.d
+ DEPENDS ${src_dir}/${symfile}.cc
+ ${ASY_SCRIPTS_DIR}/gen_preprocessed_depfile.py
+ ${ASYMPTOTE_SYM_PROCESS_NEEDED_HEADERS}
+ ${ADDITIONAL_ADD_CUSTOM_CMD_ARGS}
+ )
+ # *.symbols.h file
+ set(symfile_raw_output_var ${header_output_varname})
+ set(sym_header_file ${GENERATED_INCLUDE_DIR}/${symfile}.symbols.h)
+ set(${symfile_raw_output_var} ${sym_header_file} PARENT_SCOPE)
+ add_custom_command(
+ OUTPUT ${sym_header_file}
+ COMMAND ${PERL_INTERPRETER} ${FINDSYM_FILE}
+ ${sym_header_file}
+ ${processed_output_file}
+ MAIN_DEPENDENCY ${processed_output_file}
+ )
+endfunction()
+
+# preprocess each individual symbol files
+foreach(SYM_FILE ${SYMBOL_STATIC_BUILD_FILES})
+ symfile_preprocess(${ASY_SRC_DIR} ${SYM_FILE} SYMFILE_OUT HEADER_OUT)
+ list(APPEND SYMFILE_OUT_LIST ${SYMFILE_OUT})
+ list(APPEND ASYMPTOTE_GENERATED_HEADERS ${HEADER_OUT})
+endforeach()
+
+foreach(SYM_FILE ${RUNTIME_BUILD_FILES})
+ symfile_preprocess(${GENERATED_SRC_DIR} ${SYM_FILE} SYMFILE_OUT HEADER_OUT)
+ list(APPEND SYMFILE_OUT_LIST ${SYMFILE_OUT})
+ list(APPEND ASYMPTOTE_GENERATED_HEADERS ${HEADER_OUT})
+endforeach ()
+
+# allsymbols.h
+add_custom_command(
+ OUTPUT ${GENERATED_INCLUDE_DIR}/allsymbols.h
+ COMMAND ${PERL_INTERPRETER} ${FINDSYM_FILE}
+ ${GENERATED_INCLUDE_DIR}/allsymbols.h
+ ${SYMFILE_OUT_LIST}
+ DEPENDS ${FINDSYM_FILE} ${SYMFILE_OUT_LIST}
+)
+
+list(APPEND ASYMPTOTE_GENERATED_HEADERS ${GENERATED_INCLUDE_DIR}/allsymbols.h)
+
+# macro files
+message(STATUS "Generating revision.cc file")
+set(revision_cc_file ${GENERATED_SRC_DIR}/revision.cc)
+configure_file(${ASY_RESOURCE_DIR}/template_rev.cc.in ${revision_cc_file})
+list(APPEND ASY_GENERATED_BUILD_SOURCES ${revision_cc_file})
+
+add_custom_target(asy_gen_headers
+ DEPENDS ${ASYMPTOTE_GENERATED_HEADERS}
+)
diff --git a/graphics/asymptote/cmake-scripts/gnu-install-macros.cmake b/graphics/asymptote/cmake-scripts/gnu-install-macros.cmake
new file mode 100644
index 0000000000..a3c6e3c721
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/gnu-install-macros.cmake
@@ -0,0 +1,16 @@
+# Only run on unix-like systems, windows does not use gnu docpath/syspath locations
+
+if (UNIX)
+ include(GNUInstallDirs)
+
+if (CTAN_BUILD)
+ set(ASYMPTOTE_SYSDIR_VALUE "")
+else()
+ set(ASYMPTOTE_SYSDIR_VALUE ${DATADIR}/asymptote)
+endif()
+
+ list(APPEND ASY_MACROS
+ ASYMPTOTE_SYSDIR="${DATADIR}/asymptote"
+ ASYMPTOTE_DOCDIR="${DATADIR}/doc/asymptote"
+ )
+endif()
diff --git a/graphics/asymptote/cmake-scripts/options.cmake b/graphics/asymptote/cmake-scripts/options.cmake
new file mode 100644
index 0000000000..51838bfa2e
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/options.cmake
@@ -0,0 +1,271 @@
+include(CMakeDependentOption)
+
+# version override
+
+set(
+ ASY_VERSION_OVERRIDE "" CACHE STRING
+ "Overriding asymptote version. If left blank, version is determined from configure.ac."
+)
+
+# Perl
+
+set(PERL_INTERPRETER "" CACHE STRING "Perl interpreter. If left empty, will try to determine interpreter automatically")
+
+if(NOT PERL_INTERPRETER)
+ message(STATUS "No Perl interpreter specified, attempting to find perl")
+ find_program(
+ PERL_INTERPRETER_FOUND
+ perl
+ REQUIRED
+ )
+ message(STATUS "Found perl at ${PERL_INTERPRETER_FOUND}")
+ set(PERL_INTERPRETER ${PERL_INTERPRETER_FOUND} CACHE STRING "" FORCE)
+endif()
+
+execute_process(COMMAND ${PERL_INTERPRETER} -e "print \"$]\"" OUTPUT_VARIABLE PERL_VERSION)
+message(STATUS "Perl version: ${PERL_VERSION}")
+
+# Python
+
+set(PY3_INTERPRETER "" CACHE STRING "Python 3 interpreter. If left empty, will try to determine Python automatically")
+
+function(verify_py3_interpreter_is_py3 validator_result_var py_interpreter)
+ execute_process(
+ COMMAND ${py_interpreter} -c "import sys; print(int(sys.version[0])>=3,end='')"
+ OUTPUT_VARIABLE PY3_INTERPRETER_VERSION_RESULT)
+ if (NOT PY3_INTERPRETER_VERSION_RESULT STREQUAL "True")
+ set(${validator_result_var} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+if(NOT PY3_INTERPRETER)
+ message(STATUS "No Python3 interpreter specified, attempting to find python")
+ find_program(
+ PY3_INTERPRETER_FOUND
+ NAMES python3 python
+ VALIDATOR verify_py3_interpreter_is_py3
+ REQUIRED
+ )
+ message(STATUS "Found python3 at ${PY3_INTERPRETER_FOUND}")
+ set(PY3_INTERPRETER ${PY3_INTERPRETER_FOUND} CACHE STRING "" FORCE)
+else()
+ set(PY_INTERPRETER_IS_PY3 TRUE)
+ set(VARIABLE_RESULT_VAR PY_INTERPRETER_IS_PY3)
+ verify_py3_interpreter_is_py3(VARIABLE_RESULT_VAR ${PY3_INTERPRETER})
+
+ if (NOT PY_INTERPRETER_IS_PY3)
+ message(FATAL_ERROR "Specified python interpreter cannot be used as python3 interpreter!")
+ endif()
+endif()
+
+execute_process(COMMAND ${PY3_INTERPRETER} --version OUTPUT_VARIABLE PY3_VERSION)
+message(STATUS "Version: ${PY3_VERSION}")
+
+# windows flex + bison
+set(
+ WIN32_FLEX_BINARY "" CACHE STRING
+ "Flex binary for windows. If not specified, downloads from winflexibson. This option is inert on UNIX systems"
+)
+set(
+ WIN32_BISON_BINARY "" CACHE STRING
+ "Bison binary for windows. If not specified, downloads from winflexbison. This option is inert on UNIX systems"
+)
+
+# feature libraries
+
+option(ENABLE_GC "enable boehm gc support" true)
+option(ENABLE_CURL "enable curl support" true)
+option(ENABLE_READLINE "libreadline" true)
+option(ENABLE_THREADING "enable threading support" true)
+option(ENABLE_GSL "Enable GSL support" true)
+option(ENABLE_EIGEN3 "Enable eigen3 support" true)
+option(ENABLE_FFTW3 "Enable fftw3 support" true)
+option(ENABLE_OPENGL "Whether to enable opengl or not." true)
+cmake_dependent_option(ENABLE_GL_COMPUTE_SHADERS
+ "Whether to enable compute shaders for OpenGL. Requires OpenGL >= 4.3 and GL_ARB_compute_shader"
+ true "ENABLE_OPENGL" false)
+cmake_dependent_option(ENABLE_GL_SSBO
+ "Whether to enable compute SSBO. Requires OpenGL >= 4.3 and GL_ARB_shader_storage_buffer_object"
+ true "ENABLE_OPENGL" false)
+
+option(
+ ENABLE_RPC_FEATURES
+ "Whether to enable XDR/RPC features. Also enables V3D. If compiling on UNIX systems, requires libtirpc to be installed."
+ true)
+
+# Additional options
+
+option(DEBUG_GC_ENABLE "Enable debug mode for gc" false)
+option(DEBUG_GC_BACKTRACE_ENABLE "Enable backtrace for gc" false)
+option(CTAN_BUILD "Build for CTAN." false)
+
+# additional optimization options
+
+if (CMAKE_BUILD_TYPE IN_LIST cmake_release_build_types)
+ set(default_lto true)
+else()
+ set(default_lto false)
+endif()
+
+option(OPTIMIZE_LINK_TIME "Enable link-time optimization. Enabled by default in release build types" ${default_lto})
+
+# testing
+option(ENABLE_ASY_CXXTEST "Enable C++-side testing. This option is inert for final asy libraries and binaries" true)
+option(
+ DOWNLOAD_GTEST_FROM_SRC "Download google test from googletest's github repo. Otherwise use system libraries."
+ true)
+
+# msvc-specific
+# The only reason this option is here is because msvc compiler (cl.exe) does not partial preprocessing
+# (e.g. ignore missing headers and treat them as generated files or depfile generation with missing headers)
+# We use MSVC compiler for all C++ compilation/linking
+set(GCCCOMPAT_CXX_COMPILER_FOR_MSVC
+ "" CACHE STRING
+ "gcc-compatible C++ compiler for preprocessing with MSVC toolchain. This option is inert if not using MSVC.
+This option is only used for preprocessing, it is not used for compilation."
+)
+
+# CUDA + asy cuda reflect
+include(CheckLanguage)
+check_language(CUDA)
+
+if (CMAKE_CUDA_COMPILER)
+ set(CAN_COMPILE_CUDA_REFLECT true)
+endif()
+
+cmake_dependent_option(
+ ENABLE_CUDA_ASY_REFLECT
+ "Enable target for reflect excutable for generating IBL lighting data.
+Requires CUDA installed and a CUDA-compatible NVIDIA Graphics card"
+ true "CAN_COMPILE_CUDA_REFLECT" false
+)
+
+# Language server protocol
+option(
+ ENABLE_LSP
+ "Enable Language Server Protocol support."
+ true
+)
+
+# documentation
+set(WIN32_TEXINDEX "WSL" CACHE STRING
+ "Location to texindex for windows, or WSL to use internal WSL wrapper.
+Inert for non-windows systems.")
+
+function(determine_asymptote_pdf_gen_possible_win32)
+ # windows doesn't have an up-to-date
+ # texi2dvi release in multiple years, so
+ # we are using MikTeX's texify
+ find_program(TEXIFY texify)
+ if (NOT TEXIFY)
+ message(STATUS "texify not found; will not enable docgen by default")
+ set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE false PARENT_SCOPE)
+ return()
+ endif()
+
+ if (NOT WIN32_TEXINDEX)
+ message(STATUS "texindex for windows not given; will not enable docgen by default")
+ set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE false PARENT_SCOPE)
+ return()
+ endif()
+
+ # another issue is that
+ if (WIN32_TEXINDEX STREQUAL WSL)
+ execute_process(
+ COMMAND wsl sh -c "which texindex >/dev/null 2>/dev/null && echo OK"
+ OUTPUT_VARIABLE TEXINDEX_RESULT
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ if (NOT TEXINDEX_RESULT STREQUAL "OK")
+ message(STATUS "Cannot execute texindex on wsl; will not enable docgen by default")
+ set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE false PARENT_SCOPE)
+ return()
+ endif()
+ endif()
+ set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE true PARENT_SCOPE)
+endfunction()
+
+set(ENABLE_BASE_DOCGEN_POSSIBLE false)
+set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE false)
+
+# finding latex and other programs needed
+# pdflatex
+find_package(LATEX COMPONENTS PDFLATEX)
+
+# pdftex
+set(PDFTEX_EXEC "" CACHE STRING "pdftex. If left empty, will try to determine interpreter automatically")
+if (NOT PDFTEX)
+ message(STATUS "No pdftex specified, attempting to find pdftex")
+ find_program(
+ PDFTEX_EXEC_FOUND
+ pdftex
+ )
+ if (PDFTEX_EXEC_FOUND)
+ message(STATUS "Found pdftex at ${PDFTEX_EXEC_FOUND}")
+ set(PDFTEX_EXEC ${PDFTEX_EXEC_FOUND} CACHE STRING "" FORCE)
+ endif()
+endif()
+
+if (LATEX_PDFLATEX_FOUND AND PDFTEX_EXEC)
+ set(ENABLE_BASE_DOCGEN_POSSIBLE true)
+
+ if (WIN32)
+ determine_asymptote_pdf_gen_possible_win32()
+ elseif(UNIX)
+ find_program(TEXI2DVI texi2dvi)
+ if (TEXI2DVI)
+ set(ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE true)
+ endif()
+ endif()
+endif()
+
+set(
+ EXTERNAL_DOCUMENTATION_DIR "" CACHE STRING
+ "If specified, installation will use files from this directory as documentation.
+In particular,
+
+- if ENABLE_DOCGEN and ENABLE_ASYMPTOTE_PDF_DOCGEN is enabled and the system has the capability to build
+all documentation files, this option is inert.
+- if ENABLE_DOCGEN is enabled but ENABLE_ASYMPTOTE_PDF_DOCGEN is disabled or if the system cannot produce asymptote.pdf,
+only asymptote.pdf will be copied from this directory.
+- if ENABLE_DOCGEN is disabled, every documentation file will be copied from this directory.
+"
+)
+
+cmake_dependent_option(
+ ENABLE_DOCGEN
+ "Enable basic document generation. Requires pdflatex"
+ true
+ "ENABLE_BASE_DOCGEN_POSSIBLE"
+ false
+)
+
+cmake_dependent_option(
+ ENABLE_ASYMPTOTE_PDF_DOCGEN
+ "Enable asymptote.pdf document generation. Requires texinfo, and additionally WSL + texindex on windows."
+ true
+ "ENABLE_ASYMPTOTE_PDF_DOCGEN_POSSIBLE;ENABLE_DOCGEN"
+ false
+)
+
+if (NOT EXTERNAL_DOCUMENTATION_DIR)
+ if (NOT ENABLE_DOCGEN)
+ message(STATUS "Build is not generating documentation.
+If you are planning on generating installation files, please make sure you have access to
+documentation files in a directory and specify this directory in EXTERNAL_DOCUMENTATION_DIR cache variable.
+")
+ elseif(NOT ENABLE_ASYMPTOTE_PDF_DOCGEN)
+ message(STATUS "Build is not generating asymptote.pdf.
+If you are planning on generating installation files, please make sure you have access to asymptote.pdf
+in a directory and specify this directory in EXTERNAL_DOCUMENTATION_DIR cache variable.
+")
+ endif()
+endif()
+
+# windows-specific installation
+option(
+ ALLOW_PARTIAL_INSTALLATION
+ "Allow installation to go through, even if not every component is buildable.
+ CMake will produce a warning instead of a fatal error."
+ false
+)
diff --git a/graphics/asymptote/cmake-scripts/tests-asy.cmake b/graphics/asymptote/cmake-scripts/tests-asy.cmake
new file mode 100644
index 0000000000..86f330e909
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/tests-asy.cmake
@@ -0,0 +1,96 @@
+# ---- asy tests ------
+
+set(ASY_ASYLANG_TEST_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/tests)
+set(ASY_ASYLANG_TEST_SCRATCH_DIR ${ASY_ASYLANG_TEST_ROOT}/out/)
+
+function(add_individual_asy_tests)
+ set(fn_opts)
+ set(fn_oneval_args DIR FILE ADDR_ASY_ARGS)
+ set(fn_multival_args)
+ cmake_parse_arguments(
+ ASY_TEST "${fn_opts}" "${fn_oneval_args}" "${fn_multival_args}" ${ARGN}
+ )
+
+ set(TEST_PATH ${ASY_ASYLANG_TEST_ROOT}/${ASY_TEST_DIR}/${ASY_TEST_FILE}.asy)
+ add_test(
+ NAME "asy.${ASY_TEST_DIR}.${ASY_TEST_FILE}"
+ COMMAND asy
+ -dir ${ASY_BUILD_BASE_DIR} ${TEST_PATH}
+ -o out
+ -globalwrite
+ ${ASY_TEST_ADDR_ASY_ARGS}
+ WORKING_DIRECTORY ${ASY_ASYLANG_TEST_ROOT}
+ )
+endfunction()
+
+macro(add_asy_tests)
+ set(macro_opts)
+ set(macro_oneval_args TEST_DIR ADDR_ASY_ARGS)
+ set(macro_multival_args TESTS TEST_ARTIFACTS)
+ cmake_parse_arguments(
+ ASY_TESTING "${macro_opts}" "${macro_oneval_args}" "${macro_multival_args}" ${ARGN}
+ )
+ foreach(testfile ${ASY_TESTING_TESTS})
+ add_individual_asy_tests(
+ DIR ${ASY_TESTING_TEST_DIR}
+ FILE ${testfile}
+ ADDR_ASY_ARGS ${ASY_TESTING_ADDR_ASY_ARGS}
+ )
+ endforeach()
+
+ foreach(artifact ${ASY_TESTING_TEST_ARTIFACTS})
+ set_property(
+ TARGET asy
+ APPEND
+ PROPERTY ADDITIONAL_CLEAN_FILES ${ASY_ASYLANG_TEST_SCRATCH_DIR}/${artifact}
+ )
+ endforeach()
+endmacro()
+
+# ------ tests ----------
+
+add_asy_tests(
+ TEST_DIR arith
+ TESTS integer pair random real roots transform triple
+)
+add_asy_tests(
+ TEST_DIR array
+ TESTS array delete determinant fields slice solve sort transpose
+)
+add_asy_tests(
+ TEST_DIR frames
+ TESTS loop stat stat2
+)
+
+if (ENABLE_GC)
+ add_asy_tests(
+ TEST_DIR gc
+ TESTS array funcall guide label path shipout string struct transform
+ TEST_ARTIFACTS .eps
+ )
+endif()
+
+if (ENABLE_GSL)
+ add_asy_tests(
+ TEST_DIR gsl
+ TESTS random
+ )
+endif()
+
+add_asy_tests(TEST_DIR imp TESTS unravel)
+add_asy_tests(TEST_DIR io TESTS csv)
+add_asy_tests(TEST_DIR output TESTS circle line TEST_ARTIFACTS circle.eps line.eps)
+add_asy_tests(TEST_DIR pic TESTS trans)
+add_asy_tests(
+ TEST_DIR string
+ TESTS erase find insert length rfind substr
+)
+add_asy_tests(
+ TEST_DIR types
+ TESTS cast constructor ecast guide init keyword order resolve shadow spec var
+)
+
+add_asy_tests(
+ TEST_DIR template
+ TESTS initTest functionTest mapArrayTest multiImport singletype sortedsetTest splaytreeTest structTest
+)
diff --git a/graphics/asymptote/cmake-scripts/thirdparty-impl.cmake b/graphics/asymptote/cmake-scripts/thirdparty-impl.cmake
new file mode 100644
index 0000000000..1dbcf5d76f
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/thirdparty-impl.cmake
@@ -0,0 +1,6 @@
+# tinyexr
+
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/thirdparty_impl/tinyexr_impl/)
+list(APPEND ASY_STATIC_LIBARIES tinyexr-impl)
+
+list(APPEND ASYMPTOTE_INCLUDES $<TARGET_PROPERTY:tinyexr-impl,INCLUDE_DIRECTORIES>)
diff --git a/graphics/asymptote/cmake-scripts/vcpkg-features.cmake b/graphics/asymptote/cmake-scripts/vcpkg-features.cmake
new file mode 100644
index 0000000000..8e63803137
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/vcpkg-features.cmake
@@ -0,0 +1,39 @@
+if (ENABLE_GC)
+ list(APPEND VCPKG_MANIFEST_FEATURES gc)
+endif()
+
+if (ENABLE_READLINE)
+ list(APPEND VCPKG_MANIFEST_FEATURES readline)
+endif()
+
+if (ENABLE_CURL)
+ list(APPEND VCPKG_MANIFEST_FEATURES curl)
+endif()
+
+if (ENABLE_GSL)
+ list(APPEND VCPKG_MANIFEST_FEATURES gsl)
+endif()
+
+if (ENABLE_EIGEN3)
+ list(APPEND VCPKG_MANIFEST_FEATURES eigen3)
+endif()
+
+if (ENABLE_FFTW3)
+ list(APPEND VCPKG_MANIFEST_FEATURES fftw3)
+endif()
+
+if (ENABLE_OPENGL)
+ list(APPEND VCPKG_MANIFEST_FEATURES opengl)
+endif()
+
+if (ENABLE_THREADING)
+ list(APPEND VCPKG_MANIFEST_FEATURES threading)
+endif()
+
+if (ENABLE_ASY_CXXTEST)
+ list(APPEND VCPKG_MANIFEST_FEATURES build-cxx-testing)
+endif()
+
+if (ENABLE_LSP)
+ list(APPEND VCPKG_MANIFEST_FEATURES lsp)
+endif()
diff --git a/graphics/asymptote/cmake-scripts/win32-pre-nsis-installer.cmake b/graphics/asymptote/cmake-scripts/win32-pre-nsis-installer.cmake
new file mode 100644
index 0000000000..df0875a93b
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/win32-pre-nsis-installer.cmake
@@ -0,0 +1,174 @@
+if (NOT WIN32)
+ message(FATAL_ERROR "Pre-NSIS installation is intended for windows only!")
+endif()
+
+if (NOT ASY_WIN_RESOURCE_DIR)
+ message(FATAL_ERROR "ASY_WIN_RESOURCE_DIR is not defined.
+Please ensure win32-specific.cmake is included before this file!")
+endif()
+
+if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+ set_property(CACHE CMAKE_INSTALL_PREFIX PROPERTY VALUE "${CMAKE_CURRENT_SOURCE_DIR}/cmake-install-win32")
+endif()
+
+# helper target for files needed
+add_custom_target(asy-pre-nsis-targets DEPENDS asy asy-basefiles)
+
+# check done, start configuration
+set(ASYMPTOTE_NSI_CONFIGURATION_DIR ${CMAKE_CURRENT_BINARY_DIR}/nsifiles)
+file(MAKE_DIRECTORY ${ASYMPTOTE_NSI_CONFIGURATION_DIR})
+
+configure_file(
+ ${ASY_WIN_RESOURCE_DIR}/AsymptoteInstallInfo.nsi.in
+ ${ASYMPTOTE_NSI_CONFIGURATION_DIR}/AsymptoteInstallInfo.nsi
+)
+
+set(ASY_INSTALL_DIRECTORY build-${ASY_VERSION})
+
+set(BUILD_ASY_INSTALLER_SCRIPT ${ASY_WIN_RESOURCE_DIR}/build-asymptote-installer.py)
+configure_file(
+ ${ASY_WIN_RESOURCE_DIR}/build-asy-installer.ps1.in
+ ${ASYMPTOTE_NSI_CONFIGURATION_DIR}/build-asy-installer.ps1
+)
+
+set(ASY_PRE_NSIS_COMPONENT_NAME asy-pre-nsis)
+set(ASY_NSIS_INSTALL_ARGUMENT
+ COMPONENT ${ASY_PRE_NSIS_COMPONENT_NAME}
+ DESTINATION ${ASY_INSTALL_DIRECTORY}
+)
+
+set(ASY_NSIS_TARGET_EXAMPLES_INSTALL_ARGUMENT
+ COMPONENT ${ASY_PRE_NSIS_COMPONENT_NAME}
+ DESTINATION ${ASY_INSTALL_DIRECTORY}/examples
+)
+
+
+set(ASY_NSIS_INSTALL_RESOURCES_ARGUMENT
+ COMPONENT ${ASY_PRE_NSIS_COMPONENT_NAME}
+ DESTINATION .
+)
+
+# <build-root>/asy.exe -> <install-root>/asy.exe
+install(TARGETS asy
+ RUNTIME_DEPENDENCIES
+ PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-"
+ POST_EXCLUDE_REGEXES ".*system32/.*\\.dll"
+ ${ASY_NSIS_INSTALL_ARGUMENT}
+)
+
+# <build-root>/base/*, <build-root>/examples -> <install-root>/
+install(
+ DIRECTORY ${ASY_BUILD_BASE_DIR}/ ${CMAKE_CURRENT_SOURCE_DIR}/examples
+ ${ASY_NSIS_INSTALL_ARGUMENT}
+)
+
+# extra doc files
+install(
+ FILES
+ ${ASY_DOC_DIR}/latexusage.tex
+ ${ASY_DOC_DIR}/externalprc.tex
+ ${ASY_NSIS_TARGET_EXAMPLES_INSTALL_ARGUMENT}
+)
+
+install(
+ DIRECTORY ${ASY_DOC_DIR}/
+ ${ASY_NSIS_TARGET_EXAMPLES_INSTALL_ARGUMENT}
+ FILES_MATCHING
+ PATTERN "*.asy"
+ PATTERN "*.csv"
+ PATTERN "*.dat"
+)
+
+# resources files for installer + nsi files
+
+install(
+ FILES ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
+ ${ASY_WIN_RESOURCE_DIR}/asy.ico
+ ${ASY_WIN_RESOURCE_DIR}/asymptote.nsi
+ ${ASYMPTOTE_NSI_CONFIGURATION_DIR}/AsymptoteInstallInfo.nsi
+ ${ASYMPTOTE_NSI_CONFIGURATION_DIR}/build-asy-installer.ps1
+ ${ASY_NSIS_INSTALL_RESOURCES_ARGUMENT}
+)
+
+install(
+ DIRECTORY ${ASY_WIN_RESOURCE_DIR}/
+ ${ASY_NSIS_INSTALL_RESOURCES_ARGUMENT}
+ FILES_MATCHING PATTERN "*.nsh"
+)
+
+# if a component is not buildable
+macro(action_if_component_not_buildable message)
+ message(WARNING "Please ensure this issue is resolved before installing. Message: ${message}")
+ if (ALLOW_PARTIAL_INSTALLATION)
+ install(CODE "message(WARNING \"${message}\")" COMPONENT ${ASY_PRE_NSIS_COMPONENT_NAME})
+ else()
+ install(CODE "message(FATAL_ERROR \"${message}\")" COMPONENT ${ASY_PRE_NSIS_COMPONENT_NAME})
+ endif()
+endmacro()
+
+# unfortuantely, we have to first call the "docgen" target manually
+# this can also be called from asy-pre-nsis-targets, which includes asy-with-basefiles alongside docgen.
+# this is a limitation of cmake currently (https://discourse.cmake.org/t/install-file-with-custom-target/2984/2)
+
+if (ASY_TEX_BUILD_ROOT)
+ add_dependencies(asy-pre-nsis-targets docgen)
+endif()
+
+macro(install_from_external_documentation_dir docfile_name)
+ set(DOCFILE_LOCATION ${EXTERNAL_DOCUMENTATION_DIR}/${docfile_name})
+ message(STATUS "Using external documentation file at ${DOCFILE_LOCATION}")
+
+ if (NOT EXISTS ${DOCFILE_LOCATION})
+ message(WARNING "${DOCFILE_LOCATION} not found.
+Please ensure this file exists before running \"cmake --install\"."
+ )
+ endif()
+
+ install(FILES ${DOCFILE_LOCATION} ${ASY_NSIS_INSTALL_ARGUMENT})
+endmacro()
+
+
+if (ASY_TEX_BUILD_ROOT) # basic docgen possible
+ install(
+ FILES ${BASE_ASYMPTOTE_DOC_AND_TEX_FILES}
+ ${ASY_NSIS_INSTALL_ARGUMENT}
+ )
+elseif(EXTERNAL_DOCUMENTATION_DIR)
+ set(
+ ASY_DOC_FILES_TO_COPY
+ asymptote.sty
+ asy-latex.pdf
+ CAD.pdf
+ TeXShopAndAsymptote.pdf
+ asyRefCard.pdf
+ )
+ foreach(ASY_DOC_FILE ${ASY_DOC_FILES_TO_COPY})
+ install_from_external_documentation_dir(${ASY_DOC_FILE})
+ endforeach()
+else()
+ action_if_component_not_buildable("base asymptote documentation cannot be found and is not buildable")
+endif()
+
+
+# asymptote.pdf
+if(ENABLE_ASYMPTOTE_PDF_DOCGEN)
+ message(STATUS "Using asymptote.pdf from ${ASY_TEX_BUILD_ROOT}/asymptote.pdf")
+ install(
+ FILES ${ASY_TEX_BUILD_ROOT}/asymptote.pdf
+ ${ASY_NSIS_INSTALL_ARGUMENT}
+ )
+elseif (EXTERNAL_DOCUMENTATION_DIR)
+ install_from_external_documentation_dir(asymptote.pdf)
+else()
+ action_if_component_not_buildable("asymptote.pdf cannot be found and is not buildable")
+endif()
+
+# README files
+install(
+ FILES
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE
+ ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.LESSER
+ ${CMAKE_CURRENT_SOURCE_DIR}/README
+ ${ASY_WIN_RESOURCE_DIR}/asy.ico
+ ${ASY_NSIS_INSTALL_ARGUMENT}
+)
diff --git a/graphics/asymptote/cmake-scripts/win32-specific.cmake b/graphics/asymptote/cmake-scripts/win32-specific.cmake
new file mode 100644
index 0000000000..01334c07b1
--- /dev/null
+++ b/graphics/asymptote/cmake-scripts/win32-specific.cmake
@@ -0,0 +1,100 @@
+if (NOT WIN32)
+ message(FATAL_ERROR "This file is only for use with windows.")
+endif()
+
+# msvc compile options
+if (MSVC)
+ list(APPEND ASY_COMPILE_OPTS
+ /Zc:__cplusplus /Zc:__STDC__
+ /Zc:externC /Zc:preprocessor
+ /Zc:hiddenFriend)
+endif()
+
+# alot of asymptote sources use __MSDOS__ macro for checking windows
+list(APPEND ASY_MACROS WIN32_LEAN_AND_MEAN NOMINMAX __MSDOS__=1)
+
+
+# set ASYMPTOTE_SYSDIR to empty string
+if (CTAN_BUILD)
+ list(APPEND ASY_MACROS ASYMPTOTE_SYSDIR="")
+else()
+ # because of how ASYMPTOTE_SYSDIR is calculated on windows,
+ # this value is replaced by the what is in the registry when we launch
+ # asymptote, given if ASYMPTOTE_SYSDIR is not empty
+ # (empty indicates a CTAN build which uses kpsewhich for determining path)
+
+ # hence, we can leave this value to anything non-empty.
+ list(APPEND ASY_MACROS ASYMPTOTE_SYSDIR="NUL")
+endif()
+
+
+set(BUILD_SHARED_LIBS OFF)
+
+# gcc/clang++ compatible validators
+
+function(validate_gcc_compat_cxx validator_result_var gcccompat_compiler)
+ execute_process(
+ COMMAND ${gcccompat_compiler} "--version"
+ OUTPUT_VARIABLE COMPILER_RESULT)
+
+ if (NOT COMPILER_RESULT MATCHES
+ "(clang version )|(g\\+\\+\\.exe \\(MinGW\\))|(g\\+\\+ \\(GCC\\))")
+ set(${validator_result_var} FALSE PARENT_SCOPE)
+ endif()
+endfunction()
+
+
+macro(find_compatible_gcc_compilers)
+ find_program(
+ GCCCOMPAT_CXX_COMPILER_FOUND
+ NAMES clang++ g++
+ VALIDATOR validate_gcc_compat_cxx
+ )
+
+ if (GCCCOMPAT_CXX_COMPILER_FOUND)
+ message(STATUS "Found clang++/g++ at ${GCCCOMPAT_CXX_COMPILER_FOUND}")
+ set(GCCCOMPAT_CXX_COMPILER_FOR_MSVC ${GCCCOMPAT_CXX_COMPILER_FOUND})
+ endif()
+endmacro()
+
+# attempting to find gcc-compatible C++ compiler
+
+if (MSVC)
+ if (NOT GCCCOMPAT_CXX_COMPILER_FOR_MSVC)
+ message(STATUS "GCCCOMPAT_CXX_COMPILER_FOR_MSVC not given, will attempt to find g++.exe or clang++.exe")
+ find_compatible_gcc_compilers()
+ endif()
+
+ if (GCCCOMPAT_CXX_COMPILER_FOR_MSVC)
+ message(STATUS "Using GCC-compatible C++ compiler at \
+${GCCCOMPAT_CXX_COMPILER_FOR_MSVC} for preprocessing.")
+ endif()
+
+ if (NOT GCCCOMPAT_CXX_COMPILER_FOR_MSVC)
+ message(WARNING "\
+GCC-compatible C++ compiler not specified, target dependency resolution for generated files may \
+not work properly. If you are looking for a GCC-compatible C++ compiler on windows for preprocessing, \
+we recommend the LLVM toolchain. You can find LLVM at \
+\
+https://releases.llvm.org/download.html \
+\
+or through msys2. After that, re-run cmake with either \
+-DGCCCOMPAT_CXX_COMPILER_FOR_MSVC=<path to clang++.exe> \
+or if running msvc/* presets, with GCCCOMPAT_CXX_COMPILER_FOR_MSVC \
+environment variable set to the path \
+to clang++.exe.")
+ endif()
+endif()
+
+
+# additional win32 api libraries
+list(APPEND ASY_STATIC_LIBARIES Shlwapi Shell32 Ws2_32)
+
+# RC file
+set(ASY_WIN_RESOURCE_DIR ${ASY_RESOURCE_DIR}/windows)
+list(APPEND ASY_WIN_RC_FILE ${ASY_WIN_RESOURCE_DIR}/asy.rc)
+
+# Minimum Windows version - for now, pinning on windows 10,
+# since that is currently the minimum supported version by Microsoft
+# See https://learn.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers
+list(APPEND ASY_MACROS _WIN32_WINNT=_WIN32_WINNT_WIN10)
diff --git a/graphics/asymptote/common.h b/graphics/asymptote/common.h
index 7f582e70ff..8fd1c9dada 100644
--- a/graphics/asymptote/common.h
+++ b/graphics/asymptote/common.h
@@ -9,36 +9,33 @@
#undef NDEBUG
+#if defined(_WIN32)
+#include <Winsock2.h>
+#endif
+
#include <iostream>
#include <memory>
#include <climits>
+#include <cstdint>
+
+#if defined(_MSC_VER)
+// for and/or/not operators. not supported natively on MSVC
+#include <BaseTsd.h>
+#include <ciso646>
+typedef SSIZE_T ssize_t;
+#define STDOUT_FILENO 1
+#define STDIN_FILENO 0
+#define STDERR_FILENO 2
+#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#if __cplusplus < 201703L
-
-#ifdef HAVE_LSP
-#include <boost/optional.hpp>
-#include <boost/none.hpp>
-using boost::optional;
-#define nullopt boost::none
-using boost::make_optional;
-#else
-#include "optional.hpp"
-#define boost nonstd
+#include <optional.hpp>
using nonstd::optional;
using nonstd::nullopt;
using nonstd::make_optional;
-#endif
-
-#else
-#include <optional>
-using std::optional;
-using std::nullopt;
-using std::make_optional;
-#endif
using std::make_pair;
@@ -58,26 +55,10 @@ using std::make_pair;
#include "memory.h"
-#if defined(HAVE_LONG_LONG) && defined(LLONG_MAX) && defined(LLONG_MIN)
-#define Int_MAX2 LLONG_MAX
-#define Int_MIN LLONG_MIN
-typedef long long Int;
-typedef unsigned long long unsignedInt;
-#else
-#undef HAVE_LONG_LONG
-#ifdef HAVE_LONG
-#define Int_MAX2 LONG_MAX
-#define Int_MIN LONG_MIN
-typedef long Int;
-typedef unsigned long unsignedInt;
-#else
-#define Int_MAX2 INT_MAX
-#define Int_MIN INT_MIN
-#define intIsInt
-typedef int Int;
-typedef unsigned int unsignedInt;
-#endif
-#endif
+#define Int_MAX2 INT64_MAX
+#define Int_MIN INT64_MIN
+typedef int64_t Int;
+typedef uint64_t unsignedInt;
#ifndef COMPACT
#if Int_MAX2 >= 0x7fffffffffffffffLL
diff --git a/graphics/asymptote/config.guess b/graphics/asymptote/config.guess
index c7f17e8fb9..f6d217a49f 100755
--- a/graphics/asymptote/config.guess
+++ b/graphics/asymptote/config.guess
@@ -1,10 +1,10 @@
-#!/usr/bin/sh
+#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2022 Free Software Foundation, Inc.
+# Copyright 1992-2024 Free Software Foundation, Inc.
# shellcheck disable=SC2006,SC2268 # see below for rationale
-timestamp='2022-05-25'
+timestamp='2024-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -47,7 +47,7 @@ me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
-Output the configuration name of the system \`$me' is run on.
+Output the configuration name of the system '$me' is run on.
Options:
-h, --help print this help, then exit
@@ -60,13 +60,13 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2022 Free Software Foundation, Inc.
+Copyright 1992-2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
-Try \`$me --help' for more information."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -102,8 +102,8 @@ GUESS=
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
+# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
+# use 'HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
@@ -155,6 +155,9 @@ Linux|GNU|GNU/*)
set_cc_for_build
cat <<-EOF > "$dummy.c"
+ #if defined(__ANDROID__)
+ LIBC=android
+ #else
#include <features.h>
#if defined(__UCLIBC__)
LIBC=uclibc
@@ -162,6 +165,8 @@ Linux|GNU|GNU/*)
LIBC=dietlibc
#elif defined(__GLIBC__)
LIBC=gnu
+ #elif defined(__LLVM_LIBC__)
+ LIBC=llvm
#else
#include <stdarg.h>
/* First heuristic to detect musl libc. */
@@ -169,6 +174,7 @@ Linux|GNU|GNU/*)
LIBC=musl
#endif
#endif
+ #endif
EOF
cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
eval "$cc_set_libc"
@@ -459,7 +465,7 @@ case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
UNAME_RELEASE=`uname -v`
;;
esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
+ # Japanese Language versions have a version number like '4.1.3-JL'.
SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
GUESS=sparc-sun-sunos$SUN_REL
;;
@@ -904,7 +910,7 @@ EOF
fi
;;
*:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
+ UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
amd64)
UNAME_PROCESSOR=x86_64 ;;
@@ -966,11 +972,37 @@ EOF
GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
;;
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
+ ;;
+ *:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
+ ;;
*:Minix:*:*)
GUESS=$UNAME_MACHINE-unknown-minix
;;
aarch64:Linux:*:*)
- GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ set_cc_for_build
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __ARM_EABI__
+ #ifdef __ARM_PCS_VFP
+ ABI=eabihf
+ #else
+ ABI=eabi
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
+ esac
+ fi
+ GUESS=$CPU-unknown-linux-$LIBCABI
;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
@@ -1036,7 +1068,16 @@ EOF
k1om:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*)
+ kvx:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ kvx:cos:*:*)
+ GUESS=$UNAME_MACHINE-unknown-cos
+ ;;
+ kvx:mbr:*:*)
+ GUESS=$UNAME_MACHINE-unknown-mbr
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
m32r*:Linux:*:*)
@@ -1191,7 +1232,7 @@ EOF
GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
;;
i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
+ # If we were able to find 'uname', then EMX Unix compatibility
# is probably installed.
GUESS=$UNAME_MACHINE-pc-os2-emx
;;
@@ -1332,7 +1373,7 @@ EOF
GUESS=ns32k-sni-sysv
fi
;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
# says <Richard.M.Bartel@ccMail.Census.GOV>
GUESS=i586-unisys-sysv4
;;
@@ -1554,6 +1595,9 @@ EOF
*:Unleashed:*:*)
GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
;;
+ *:Ironclad:*:*)
+ GUESS=$UNAME_MACHINE-unknown-ironclad
+ ;;
esac
# Do we have a guess based on uname results?
diff --git a/graphics/asymptote/config.h.in b/graphics/asymptote/config.h.in
index 33a57ce14d..6c934af995 100644
--- a/graphics/asymptote/config.h.in
+++ b/graphics/asymptote/config.h.in
@@ -1,7 +1,6 @@
/* config.h.in. Generated from configure.ac by autoheader. */
-/* Define if building universal (internal helper macro) */
-#undef AC_APPLE_UNIVERSAL_BUILD
+#pragma once
/* Directory for documentation */
#undef ASYMPTOTE_DOCDIR
@@ -9,7 +8,16 @@
/* System directory for global .asy files */
#undef ASYMPTOTE_SYSDIR
-/* Define to 1 if you have GLSL compute shaders. */
+/* Freeglut is enabled */
+#undef FREEGLUT
+
+/* GC backtrace is enabled */
+#undef GC_BACKTRACE
+
+/* GC Debug is enabled */
+#undef GC_DEBUG
+
+/* Define to 1 if you have `GLSL compute shaders`. */
#undef HAVE_COMPUTE_SHADER
/* Define to 1 if you have the <curses.h> header file. */
@@ -42,8 +50,8 @@
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
#undef HAVE_FSEEKO
-/* Define to 1 if you have GNU <getopt.h>. */
-#undef HAVE_GNU_GETOPT_H
+/* OpenGL is enabled */
+#undef HAVE_GL
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
@@ -51,43 +59,40 @@
/* Define to 1 if you have the `lgamma' function. */
#undef HAVE_LGAMMA
-/* Define to 1 if you have the `curl' library (-lcurl). */
+/* Define to 1 if you have the `curl` library (-lcurl). */
#undef HAVE_LIBCURL
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
+/* Define to 1 if you have the `ncurses` library (-lncurses). */
#undef HAVE_LIBCURSES
/* Define to 1 if you have the `edit' library (-ledit). */
#undef HAVE_LIBEDIT
-/* Define to 1 if you have the `fftw3' library (-lfftw3). */
+/* Define to 1 if you have the `fftw3` library (-lfftw3). */
#undef HAVE_LIBFFTW3
/* Define to 1 if you have the `gccpp' library (-lgccpp). */
#undef HAVE_LIBGCCPP
-/* Define to 1 if you have the `GL' library (-lGL). */
+/* Define to 1 if you have the `GL` library (-lGL). */
#undef HAVE_LIBGL
-/* Define to 1 if you have the <glm/glm.hpp> header. */
+/* Define to 1 if you have `the <glm/glm.hpp> header`. */
#undef HAVE_LIBGLM
/* Define to 1 if you have the `glut' library (-lglut). */
#undef HAVE_LIBGLUT
-/* Define to 1 if you have the `gsl' library (-lgsl). */
+/* Define to 1 if you have the `gsl` library (-lgsl). */
#undef HAVE_LIBGSL
/* Define to 1 if you have the <libintl.h> header file. */
#undef HAVE_LIBINTL_H
-/* Define to 1 if you have the `OpenImageIO' library (-lOpenImageIO). */
-#undef HAVE_LIBOPENIMAGEIO
-
/* Define to 1 if you have the `OSMesa' library (-lOSMesa). */
#undef HAVE_LIBOSMESA
-/* Define to 1 if you have the `readline' library (-lreadline). */
+/* Define to 1 if you have the `readline` library (-lreadline). */
#undef HAVE_LIBREADLINE
/* Define to 1 if you have the `rt' library (-lrt). */
@@ -96,10 +101,10 @@
/* Define to 1 if you have the `sigsegv' library (-lsigsegv). */
#undef HAVE_LIBSIGSEGV
-/* Define to 1 if you have the `tinfo' library (-ltinfo). */
+/* Define to 1 if you have the `tinfo` library (-ltinfo). */
#undef HAVE_LIBTINFO
-/* Define to 1 if you have the `tirpc' library (-ltirpc). */
+/* Define to 1 if you have the `tirpc` library (-ltirpc). */
#undef HAVE_LIBTIRPC
/* Define to 1 if you have the `z' library (-lz). */
@@ -111,7 +116,7 @@
/* Define to 1 if the system has the type `long long'. */
#undef HAVE_LONG_LONG
-/* Define to 1 if you have Language server protocol. */
+/* Define to 1 if you have `Language server protocol`. */
#undef HAVE_LSP
/* Define to 1 if you have the `memrchr' function. */
@@ -138,7 +143,7 @@
/* Define to 1 if the system has the type `ptrdiff_t'. */
#undef HAVE_PTRDIFF_T
-/* Define to 1 if you have GLSL shader storage buffer objects. */
+/* Define to 1 if you have `GLSL shader storage buffer objects`. */
#undef HAVE_SSBO
/* Define to 1 if you have the <stddef.h> header file. */
@@ -183,13 +188,10 @@
/* Define to 1 if you have the `tgamma' function. */
#undef HAVE_TGAMMA
-/* Define to 1 if you have <tr1/unordered_map>. */
-#undef HAVE_TR1_UNORDERED_MAP
-
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
-/* Define to 1 if you have <unordered_map>. */
+/* Unordered map is present */
#undef HAVE_UNORDERED_MAP
/* Define to 1 if you have the `vfork' function. */
@@ -204,6 +206,12 @@
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
+/* ZLib library present */
+#undef HAVE_ZLIB
+
+/* LSP GC enabled */
+#undef LSPCPP_USEGC
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -231,17 +239,14 @@
backward compatibility; new code need not use it. */
#undef STDC_HEADERS
-/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
- significant byte first (like Motorola and SPARC, unlike Intel). */
-#if defined AC_APPLE_UNIVERSAL_BUILD
-# if defined __BIG_ENDIAN__
-# define WORDS_BIGENDIAN 1
-# endif
-#else
-# ifndef WORDS_BIGENDIAN
-# undef WORDS_BIGENDIAN
-# endif
-#endif
+/* Endianness is determined at compile time */
+#undef UNIVERSAL_ENDIAN_BUILD
+
+/* GC Enabled */
+#undef USEGC
+
+/* Build is big endian */
+#undef WORDS_BIGENDIAN
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
diff --git a/graphics/asymptote/config.sub b/graphics/asymptote/config.sub
index f02d43ad50..2c6a07ab3c 100644
--- a/graphics/asymptote/config.sub
+++ b/graphics/asymptote/config.sub
@@ -1,12 +1,14 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2020 Free Software Foundation, Inc.
+# Copyright 1992-2024 Free Software Foundation, Inc.
-timestamp='2020-01-01'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2024-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -33,7 +35,7 @@ timestamp='2020-01-01'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -50,6 +52,13 @@ timestamp='2020-01-01'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
@@ -67,13 +76,13 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2020 Free Software Foundation, Inc.
+Copyright 1992-2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
-Try \`$me --help' for more information."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -112,40 +121,42 @@ esac
# Split fields of configuration type
# shellcheck disable=SC2162
+saved_IFS=$IFS
IFS="-" read field1 field2 field3 field4 <<EOF
$1
EOF
+IFS=$saved_IFS
# Separate into logical components for further validation
case $1 in
*-*-*-*-*)
- echo Invalid configuration \`"$1"\': more than four components >&2
+ echo "Invalid configuration '$1': more than four components" >&2
exit 1
;;
*-*-*-*)
basic_machine=$field1-$field2
- os=$field3-$field4
+ basic_os=$field3-$field4
;;
*-*-*)
# Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
# parts
maybe_os=$field2-$field3
case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \
- | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \
+ nto-qnx* | linux-* | uclinux-uclibc* \
| uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
| netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
- | storm-chaos* | os2-emx* | rtmk-nova*)
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
+ | windows-* )
basic_machine=$field1
- os=$maybe_os
+ basic_os=$maybe_os
;;
android-linux)
basic_machine=$field1-unknown
- os=linux-android
+ basic_os=linux-android
;;
*)
basic_machine=$field1-$field2
- os=$field3
+ basic_os=$field3
;;
esac
;;
@@ -154,7 +165,7 @@ case $1 in
case $field1-$field2 in
decstation-3100)
basic_machine=mips-dec
- os=
+ basic_os=
;;
*-*)
# Second component is usually, but not always the OS
@@ -162,7 +173,11 @@ case $1 in
# Prevent following clause from handling this valid os
sun*os*)
basic_machine=$field1
- os=$field2
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
;;
# Manufacturers
dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
@@ -175,11 +190,11 @@ case $1 in
| microblaze* | sim | cisco \
| oki | wec | wrs | winbond)
basic_machine=$field1-$field2
- os=
+ basic_os=
;;
*)
basic_machine=$field1
- os=$field2
+ basic_os=$field2
;;
esac
;;
@@ -191,447 +206,451 @@ case $1 in
case $field1 in
386bsd)
basic_machine=i386-pc
- os=bsd
+ basic_os=bsd
;;
a29khif)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
adobe68k)
basic_machine=m68010-adobe
- os=scout
+ basic_os=scout
;;
alliant)
basic_machine=fx80-alliant
- os=
+ basic_os=
;;
altos | altos3068)
basic_machine=m68k-altos
- os=
+ basic_os=
;;
am29k)
basic_machine=a29k-none
- os=bsd
+ basic_os=bsd
;;
amdahl)
basic_machine=580-amdahl
- os=sysv
+ basic_os=sysv
;;
amiga)
basic_machine=m68k-unknown
- os=
+ basic_os=
;;
amigaos | amigados)
basic_machine=m68k-unknown
- os=amigaos
+ basic_os=amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
- os=sysv4
+ basic_os=sysv4
;;
apollo68)
basic_machine=m68k-apollo
- os=sysv
+ basic_os=sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
- os=bsd
+ basic_os=bsd
;;
aros)
basic_machine=i386-pc
- os=aros
+ basic_os=aros
;;
aux)
basic_machine=m68k-apple
- os=aux
+ basic_os=aux
;;
balance)
basic_machine=ns32k-sequent
- os=dynix
+ basic_os=dynix
;;
blackfin)
basic_machine=bfin-unknown
- os=linux
+ basic_os=linux
;;
cegcc)
basic_machine=arm-unknown
- os=cegcc
+ basic_os=cegcc
;;
convex-c1)
basic_machine=c1-convex
- os=bsd
+ basic_os=bsd
;;
convex-c2)
basic_machine=c2-convex
- os=bsd
+ basic_os=bsd
;;
convex-c32)
basic_machine=c32-convex
- os=bsd
+ basic_os=bsd
;;
convex-c34)
basic_machine=c34-convex
- os=bsd
+ basic_os=bsd
;;
convex-c38)
basic_machine=c38-convex
- os=bsd
+ basic_os=bsd
;;
cray)
basic_machine=j90-cray
- os=unicos
+ basic_os=unicos
;;
crds | unos)
basic_machine=m68k-crds
- os=
+ basic_os=
;;
da30)
basic_machine=m68k-da30
- os=
+ basic_os=
;;
decstation | pmax | pmin | dec3100 | decstatn)
basic_machine=mips-dec
- os=
+ basic_os=
;;
delta88)
basic_machine=m88k-motorola
- os=sysv3
+ basic_os=sysv3
;;
dicos)
basic_machine=i686-pc
- os=dicos
+ basic_os=dicos
;;
djgpp)
basic_machine=i586-pc
- os=msdosdjgpp
+ basic_os=msdosdjgpp
;;
ebmon29k)
basic_machine=a29k-amd
- os=ebmon
+ basic_os=ebmon
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
- os=ose
+ basic_os=ose
;;
gmicro)
basic_machine=tron-gmicro
- os=sysv
+ basic_os=sysv
;;
go32)
basic_machine=i386-pc
- os=go32
+ basic_os=go32
;;
h8300hms)
basic_machine=h8300-hitachi
- os=hms
+ basic_os=hms
;;
h8300xray)
basic_machine=h8300-hitachi
- os=xray
+ basic_os=xray
;;
h8500hms)
basic_machine=h8500-hitachi
- os=hms
+ basic_os=hms
;;
harris)
basic_machine=m88k-harris
- os=sysv3
+ basic_os=sysv3
;;
hp300 | hp300hpux)
basic_machine=m68k-hp
- os=hpux
+ basic_os=hpux
;;
hp300bsd)
basic_machine=m68k-hp
- os=bsd
+ basic_os=bsd
;;
hppaosf)
basic_machine=hppa1.1-hp
- os=osf
+ basic_os=osf
;;
hppro)
basic_machine=hppa1.1-hp
- os=proelf
+ basic_os=proelf
;;
i386mach)
basic_machine=i386-mach
- os=mach
+ basic_os=mach
;;
isi68 | isi)
basic_machine=m68k-isi
- os=sysv
+ basic_os=sysv
;;
m68knommu)
basic_machine=m68k-unknown
- os=linux
+ basic_os=linux
;;
magnum | m3230)
basic_machine=mips-mips
- os=sysv
+ basic_os=sysv
;;
merlin)
basic_machine=ns32k-utek
- os=sysv
+ basic_os=sysv
;;
mingw64)
basic_machine=x86_64-pc
- os=mingw64
+ basic_os=mingw64
;;
mingw32)
basic_machine=i686-pc
- os=mingw32
+ basic_os=mingw32
;;
mingw32ce)
basic_machine=arm-unknown
- os=mingw32ce
+ basic_os=mingw32ce
;;
monitor)
basic_machine=m68k-rom68k
- os=coff
+ basic_os=coff
;;
morphos)
basic_machine=powerpc-unknown
- os=morphos
+ basic_os=morphos
;;
moxiebox)
basic_machine=moxie-unknown
- os=moxiebox
+ basic_os=moxiebox
;;
msdos)
basic_machine=i386-pc
- os=msdos
+ basic_os=msdos
;;
msys)
basic_machine=i686-pc
- os=msys
+ basic_os=msys
;;
mvs)
basic_machine=i370-ibm
- os=mvs
+ basic_os=mvs
;;
nacl)
basic_machine=le32-unknown
- os=nacl
+ basic_os=nacl
;;
ncr3000)
basic_machine=i486-ncr
- os=sysv4
+ basic_os=sysv4
;;
netbsd386)
basic_machine=i386-pc
- os=netbsd
+ basic_os=netbsd
;;
netwinder)
basic_machine=armv4l-rebel
- os=linux
+ basic_os=linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
- os=newsos
+ basic_os=newsos
;;
news1000)
basic_machine=m68030-sony
- os=newsos
+ basic_os=newsos
;;
necv70)
basic_machine=v70-nec
- os=sysv
+ basic_os=sysv
;;
nh3000)
basic_machine=m68k-harris
- os=cxux
+ basic_os=cxux
;;
nh[45]000)
basic_machine=m88k-harris
- os=cxux
+ basic_os=cxux
;;
nindy960)
basic_machine=i960-intel
- os=nindy
+ basic_os=nindy
;;
mon960)
basic_machine=i960-intel
- os=mon960
+ basic_os=mon960
;;
nonstopux)
basic_machine=mips-compaq
- os=nonstopux
+ basic_os=nonstopux
;;
os400)
basic_machine=powerpc-ibm
- os=os400
+ basic_os=os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
- os=ose
+ basic_os=ose
;;
os68k)
basic_machine=m68k-none
- os=os68k
+ basic_os=os68k
;;
paragon)
basic_machine=i860-intel
- os=osf
+ basic_os=osf
;;
parisc)
basic_machine=hppa-unknown
- os=linux
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
;;
pw32)
basic_machine=i586-unknown
- os=pw32
+ basic_os=pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
- os=rdos
+ basic_os=rdos
;;
rdos32)
basic_machine=i386-pc
- os=rdos
+ basic_os=rdos
;;
rom68k)
basic_machine=m68k-rom68k
- os=coff
+ basic_os=coff
;;
sa29200)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
sei)
basic_machine=mips-sei
- os=seiux
+ basic_os=seiux
;;
sequent)
basic_machine=i386-sequent
- os=
+ basic_os=
;;
sps7)
basic_machine=m68k-bull
- os=sysv2
+ basic_os=sysv2
;;
st2000)
basic_machine=m68k-tandem
- os=
+ basic_os=
;;
stratus)
basic_machine=i860-stratus
- os=sysv4
+ basic_os=sysv4
;;
sun2)
basic_machine=m68000-sun
- os=
+ basic_os=
;;
sun2os3)
basic_machine=m68000-sun
- os=sunos3
+ basic_os=sunos3
;;
sun2os4)
basic_machine=m68000-sun
- os=sunos4
+ basic_os=sunos4
;;
sun3)
basic_machine=m68k-sun
- os=
+ basic_os=
;;
sun3os3)
basic_machine=m68k-sun
- os=sunos3
+ basic_os=sunos3
;;
sun3os4)
basic_machine=m68k-sun
- os=sunos4
+ basic_os=sunos4
;;
sun4)
basic_machine=sparc-sun
- os=
+ basic_os=
;;
sun4os3)
basic_machine=sparc-sun
- os=sunos3
+ basic_os=sunos3
;;
sun4os4)
basic_machine=sparc-sun
- os=sunos4
+ basic_os=sunos4
;;
sun4sol2)
basic_machine=sparc-sun
- os=solaris2
+ basic_os=solaris2
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
- os=
+ basic_os=
;;
sv1)
basic_machine=sv1-cray
- os=unicos
+ basic_os=unicos
;;
symmetry)
basic_machine=i386-sequent
- os=dynix
+ basic_os=dynix
;;
t3e)
basic_machine=alphaev5-cray
- os=unicos
+ basic_os=unicos
;;
t90)
basic_machine=t90-cray
- os=unicos
+ basic_os=unicos
;;
toad1)
basic_machine=pdp10-xkl
- os=tops20
+ basic_os=tops20
;;
tpf)
basic_machine=s390x-ibm
- os=tpf
+ basic_os=tpf
;;
udi29k)
basic_machine=a29k-amd
- os=udi
+ basic_os=udi
;;
ultra3)
basic_machine=a29k-nyu
- os=sym1
+ basic_os=sym1
;;
v810 | necv810)
basic_machine=v810-nec
- os=none
+ basic_os=none
;;
vaxv)
basic_machine=vax-dec
- os=sysv
+ basic_os=sysv
;;
vms)
basic_machine=vax-dec
- os=vms
+ basic_os=vms
;;
vsta)
basic_machine=i386-pc
- os=vsta
+ basic_os=vsta
;;
vxworks960)
basic_machine=i960-wrs
- os=vxworks
+ basic_os=vxworks
;;
vxworks68)
basic_machine=m68k-wrs
- os=vxworks
+ basic_os=vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
- os=vxworks
+ basic_os=vxworks
;;
xbox)
basic_machine=i686-pc
- os=mingw32
+ basic_os=mingw32
;;
ymp)
basic_machine=ymp-cray
- os=unicos
+ basic_os=unicos
;;
*)
basic_machine=$1
- os=
+ basic_os=
;;
esac
;;
@@ -683,17 +702,17 @@ case $basic_machine in
bluegene*)
cpu=powerpc
vendor=ibm
- os=cnk
+ basic_os=cnk
;;
decsystem10* | dec10*)
cpu=pdp10
vendor=dec
- os=tops10
+ basic_os=tops10
;;
decsystem20* | dec20*)
cpu=pdp10
vendor=dec
- os=tops20
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
@@ -703,7 +722,7 @@ case $basic_machine in
dpx2*)
cpu=m68k
vendor=bull
- os=sysv3
+ basic_os=sysv3
;;
encore | umax | mmax)
cpu=ns32k
@@ -712,7 +731,7 @@ case $basic_machine in
elxsi)
cpu=elxsi
vendor=elxsi
- os=${os:-bsd}
+ basic_os=${basic_os:-bsd}
;;
fx2800)
cpu=i860
@@ -725,7 +744,7 @@ case $basic_machine in
h3050r* | hiux*)
cpu=hppa1.1
vendor=hitachi
- os=hiuxwe2
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
cpu=hppa1.0
@@ -768,36 +787,36 @@ case $basic_machine in
i*86v32)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv32
+ basic_os=sysv32
;;
i*86v4*)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv4
+ basic_os=sysv4
;;
i*86v)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=sysv
+ basic_os=sysv
;;
i*86sol2)
cpu=`echo "$1" | sed -e 's/86.*/86/'`
vendor=pc
- os=solaris2
+ basic_os=solaris2
;;
j90 | j90-cray)
cpu=j90
vendor=cray
- os=${os:-unicos}
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
cpu=mips
vendor=sgi
- case $os in
+ case $basic_os in
irix*)
;;
*)
- os=irix4
+ basic_os=irix4
;;
esac
;;
@@ -808,26 +827,26 @@ case $basic_machine in
*mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
cpu=m68k
vendor=atari
- os=mint
+ basic_os=mint
;;
news-3600 | risc-news)
cpu=mips
vendor=sony
- os=newsos
+ basic_os=newsos
;;
next | m*-next)
cpu=m68k
vendor=next
- case $os in
+ case $basic_os in
openstep*)
;;
nextstep*)
;;
ns2*)
- os=nextstep2
+ basic_os=nextstep2
;;
*)
- os=nextstep3
+ basic_os=nextstep3
;;
esac
;;
@@ -838,12 +857,12 @@ case $basic_machine in
op50n-* | op60c-*)
cpu=hppa1.1
vendor=oki
- os=proelf
+ basic_os=proelf
;;
pa-hitachi)
cpu=hppa1.1
vendor=hitachi
- os=hiuxwe2
+ basic_os=hiuxwe2
;;
pbd)
cpu=sparc
@@ -880,12 +899,12 @@ case $basic_machine in
sde)
cpu=mipsisa32
vendor=sde
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
simso-wrs)
cpu=sparclite
vendor=wrs
- os=vxworks
+ basic_os=vxworks
;;
tower | tower-32)
cpu=m68k
@@ -902,7 +921,7 @@ case $basic_machine in
w89k-*)
cpu=hppa1.1
vendor=winbond
- os=proelf
+ basic_os=proelf
;;
none)
cpu=none
@@ -919,11 +938,13 @@ case $basic_machine in
*-*)
# shellcheck disable=SC2162
+ saved_IFS=$IFS
IFS="-" read cpu vendor <<EOF
$basic_machine
EOF
+ IFS=$saved_IFS
;;
- # We use `pc' rather than `unknown'
+ # We use 'pc' rather than 'unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
@@ -955,11 +976,11 @@ case $cpu-$vendor in
# some cases the only manufacturer, in others, it is the most popular.
craynv-unknown)
vendor=cray
- os=${os:-unicosmp}
+ basic_os=${basic_os:-unicosmp}
;;
c90-unknown | c90-cray)
vendor=cray
- os=${os:-unicos}
+ basic_os=${Basic_os:-unicos}
;;
fx80-unknown)
vendor=alliant
@@ -1000,10 +1021,15 @@ case $cpu-$vendor in
;;
# Here we normalize CPU types with a missing or matching vendor
+ armh-unknown | armh-alt)
+ cpu=armv7l
+ vendor=alt
+ basic_os=${basic_os:-linux-gnueabihf}
+ ;;
dpx20-unknown | dpx20-bull)
cpu=rs6000
vendor=bull
- os=${os:-bosx}
+ basic_os=${basic_os:-bosx}
;;
# Here we normalize CPU types irrespective of the vendor
@@ -1012,7 +1038,7 @@ case $cpu-$vendor in
;;
blackfin-*)
cpu=bfin
- os=linux
+ basic_os=linux
;;
c54x-*)
cpu=tic54x
@@ -1025,7 +1051,7 @@ case $cpu-$vendor in
;;
e500v[12]-*)
cpu=powerpc
- os=$os"spe"
+ basic_os=${basic_os}"spe"
;;
mips3*-*)
cpu=mips64
@@ -1035,7 +1061,7 @@ case $cpu-$vendor in
;;
m68knommu-*)
cpu=m68k
- os=linux
+ basic_os=linux
;;
m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*)
cpu=s12z
@@ -1045,12 +1071,12 @@ case $cpu-$vendor in
;;
parisc-*)
cpu=hppa
- os=linux
+ basic_os=linux
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
cpu=i586
;;
- pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*)
+ pentiumpro-* | p6-* | 6x86-* | athlon-* | athlon_*-*)
cpu=i686
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
@@ -1101,11 +1127,14 @@ case $cpu-$vendor in
xscale-* | xscalee[bl]-*)
cpu=`echo "$cpu" | sed 's/^xscale/arm/'`
;;
+ arm64-* | aarch64le-*)
+ cpu=aarch64
+ ;;
# Recognize the canonical CPU Types that limit and/or modify the
# company names they are paired with.
cr16-*)
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
crisv32-* | etraxfs*-*)
cpu=crisv32
@@ -1116,7 +1145,7 @@ case $cpu-$vendor in
vendor=axis
;;
crx-*)
- os=${os:-elf}
+ basic_os=${basic_os:-elf}
;;
neo-tandem)
cpu=neo
@@ -1138,16 +1167,12 @@ case $cpu-$vendor in
cpu=nsx
vendor=tandem
;;
- s390-*)
- cpu=s390
- vendor=ibm
- ;;
- s390x-*)
- cpu=s390x
- vendor=ibm
+ mipsallegrexel-sony)
+ cpu=mipsallegrexel
+ vendor=sony
;;
tile*-*)
- os=${os:-linux-gnu}
+ basic_os=${basic_os:-linux-gnu}
;;
*)
@@ -1156,15 +1181,15 @@ case $cpu-$vendor in
case $cpu in
1750a | 580 \
| a29k \
- | aarch64 | aarch64_be \
+ | aarch64 | aarch64_be | aarch64c | arm64ec \
| abacus \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
| alphapca5[67] | alpha64pca5[67] \
| am33_2.0 \
| amdgcn \
- | arc | arceb \
- | arm | arm[lb]e | arme[lb] | armv* \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
| avr | avr32 \
| asmjs \
| ba \
@@ -1175,45 +1200,29 @@ case $cpu-$vendor in
| d10v | d30v | dlx | dsp16xx \
| e2k | elxsi | epiphany \
| f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | javascript \
| h8300 | h8500 \
| hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i*86 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \
| k1om \
+ | kvx \
| le32 | le64 \
| lm32 \
+ | loongarch32 | loongarch64 \
| m32c | m32r | m32rle \
| m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
| m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
| m88110 | m88k | maxq | mb | mcore | mep | metag \
| microblaze | microblazeel \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64eb | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa32r6 | mipsisa32r6el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64r6 | mipsisa64r6el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipsr5900 | mipsr5900el \
- | mipstx39 | mipstx39el \
+ | mips* \
| mmix \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
+ | nanomips* \
| nds32 | nds32le | nds32be \
| nfp \
| nios | nios2 | nios2eb | nios2el \
@@ -1227,8 +1236,9 @@ case $cpu-$vendor in
| powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
| pru \
| pyramid \
- | riscv | riscv32 | riscv64 \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
| rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
| score \
| sh | shl \
| sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
@@ -1238,11 +1248,13 @@ case $cpu-$vendor in
| sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
| spu \
| tahoe \
+ | thumbv7* \
| tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
| tron \
| ubicom32 \
| v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
| vax \
+ | vc4 \
| visium \
| w65 \
| wasm32 | wasm64 \
@@ -1254,7 +1266,7 @@ case $cpu-$vendor in
;;
*)
- echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2
+ echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
exit 1
;;
esac
@@ -1275,8 +1287,54 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x$os != x ]
+if test x"$basic_os" != x
then
+
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
+# set os.
+obj=
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <<EOF
+$basic_os
+EOF
+ IFS=$saved_IFS
+ ;;
+ # Default OS when just kernel was specified
+ nto*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto|qnx|'`
+ ;;
+ linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|linux|gnu|'`
+ ;;
+ managarm*)
+ kernel=managarm
+ os=`echo "$basic_os" | sed -e 's|managarm|mlibc|'`
+ ;;
+ *)
+ kernel=
+ os=$basic_os
+ ;;
+esac
+
+# Now, normalize the OS (knowing we just have one component, it's not a kernel,
+# etc.)
case $os in
# First match some system type aliases that might get confused
# with valid system types.
@@ -1288,7 +1346,7 @@ case $os in
os=cnk
;;
solaris1 | solaris1.*)
- os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ os=`echo "$os" | sed -e 's|solaris1|sunos4|'`
;;
solaris)
os=solaris2
@@ -1296,9 +1354,6 @@ case $os in
unixware*)
os=sysv4.2uw
;;
- gnu/linux*)
- os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
- ;;
# es1800 is here to avoid being matched by es* (a different OS)
es1800*)
os=ose
@@ -1320,12 +1375,9 @@ case $os in
os=sco3.2v4
;;
sco3.2.[4-9]*)
- os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
- ;;
- sco3.2v[4-9]* | sco5v6*)
- # Don't forget version if it is 3.2v4 or newer.
+ os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'`
;;
- scout)
+ sco*v* | scout)
# Don't match below
;;
sco*)
@@ -1334,78 +1386,25 @@ case $os in
psos*)
os=psos
;;
- # Now accept the basic system types.
- # The portable systems comes first.
- # Each alternative MUST end in a * to match a version number.
- # sysv* is not here because it comes later, after sysvr4.
- gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
- | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\
- | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
- | sym* | kopensolaris* | plan9* \
- | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
- | aos* | aros* | cloudabi* | sortix* | twizzler* \
- | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
- | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
- | knetbsd* | mirbsd* | netbsd* \
- | bitrig* | openbsd* | solidbsd* | libertybsd* | os108* \
- | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \
- | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \
- | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \
- | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \
- | chorusrdb* | cegcc* | glidix* \
- | cygwin* | msys* | pe* | moss* | proelf* | rtems* \
- | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \
- | linux-newlib* | linux-musl* | linux-uclibc* \
- | uxpv* | beos* | mpeix* | udk* | moxiebox* \
- | interix* | uwin* | mks* | rhapsody* | darwin* \
- | openstep* | oskit* | conix* | pw32* | nonstopux* \
- | storm-chaos* | tops10* | tenex* | tops20* | its* \
- | os2* | vos* | palmos* | uclinux* | nucleus* \
- | morphos* | superux* | rtmk* | windiss* \
- | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
- | skyos* | haiku* | rdos* | toppers* | drops* | es* \
- | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
- | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
- | nsk* | powerunix)
- # Remember, each alternative MUST END IN *, to match a version number.
- ;;
qnx*)
- case $cpu in
- x86 | i*86)
- ;;
- *)
- os=nto-$os
- ;;
- esac
+ os=qnx
;;
hiux*)
os=hiuxwe2
;;
- nto-qnx*)
- ;;
- nto*)
- os=`echo $os | sed -e 's|nto|nto-qnx|'`
- ;;
- sim | xray | os68k* | v88r* \
- | windows* | osx | abug | netware* | os9* \
- | macos* | mpw* | magic* | mmixware* | mon960* | lnews*)
- ;;
- linux-dietlibc)
- os=linux-dietlibc
- ;;
- linux*)
- os=`echo $os | sed -e 's|linux|linux-gnu|'`
- ;;
lynx*178)
os=lynxos178
;;
lynx*5)
os=lynxos5
;;
+ lynxos*)
+ # don't get caught up in next wildcard
+ ;;
lynx*)
os=lynxos
;;
- mac*)
+ mac[0-9]*)
os=`echo "$os" | sed -e 's|mac|macos|'`
;;
opened*)
@@ -1452,7 +1451,7 @@ case $os in
;;
# Preserve the version number of sinix5.
sinix5.*)
- os=`echo $os | sed -e 's|sinix|sysv|'`
+ os=`echo "$os" | sed -e 's|sinix|sysv|'`
;;
sinix*)
os=sysv4
@@ -1475,18 +1474,12 @@ case $os in
sysvr4)
os=sysv4
;;
- # This must come after sysvr4.
- sysv*)
- ;;
ose*)
os=ose
;;
*mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
os=mint
;;
- zvmoe)
- os=zvmoe
- ;;
dicos*)
os=dicos
;;
@@ -1499,23 +1492,21 @@ case $os in
os=eabi
;;
*)
- os=elf
+ os=
+ obj=elf
;;
esac
;;
- nacl*)
- ;;
- ios)
- ;;
- none)
- ;;
- *-eabi)
+ aout* | coff* | elf* | pe*)
+ # These are machine code file formats, not OSes
+ obj=$os
+ os=
;;
*)
- echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1528,42 +1519,54 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
+kernel=
+obj=
case $cpu-$vendor in
score-*)
- os=elf
+ os=
+ obj=elf
;;
spu-*)
- os=elf
+ os=
+ obj=elf
;;
*-acorn)
os=riscix1.2
;;
arm*-rebel)
- os=linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=aout
+ os=
+ obj=aout
;;
c4x-* | tic4x-*)
- os=coff
+ os=
+ obj=coff
;;
c8051-*)
- os=elf
+ os=
+ obj=elf
;;
clipper-intergraph)
os=clix
;;
hexagon-*)
- os=elf
+ os=
+ obj=elf
;;
tic54x-*)
- os=coff
+ os=
+ obj=coff
;;
tic55x-*)
- os=coff
+ os=
+ obj=coff
;;
tic6x-*)
- os=coff
+ os=
+ obj=coff
;;
# This must come before the *-dec entry.
pdp10-*)
@@ -1585,19 +1588,24 @@ case $cpu-$vendor in
os=sunos3
;;
m68*-cisco)
- os=aout
+ os=
+ obj=aout
;;
mep-*)
- os=elf
+ os=
+ obj=elf
;;
mips*-cisco)
- os=elf
+ os=
+ obj=elf
;;
- mips*-*)
- os=elf
+ mips*-*|nanomips*-*)
+ os=
+ obj=elf
;;
or32-*)
- os=coff
+ os=
+ obj=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=sysv3
@@ -1606,7 +1614,8 @@ case $cpu-$vendor in
os=sunos4.1.1
;;
pru-*)
- os=elf
+ os=
+ obj=elf
;;
*-be)
os=beos
@@ -1687,10 +1696,12 @@ case $cpu-$vendor in
os=uxpv
;;
*-rom68k)
- os=coff
+ os=
+ obj=coff
;;
*-*bug)
- os=coff
+ os=
+ obj=coff
;;
*-apple)
os=macos
@@ -1705,84 +1716,251 @@ case $cpu-$vendor in
os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
+
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ llvm* | musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # See `case $cpu-$os` validation below
+ ghcjs)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* | tvos* | watchos* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | oabi* \
+ | ptx* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* )
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ # This refers to builds using the UEFI calling convention
+ # (which depends on the architecture) and PE file format.
+ # Note that this is both a different calling convention and
+ # different file format than that of GNU-EFI
+ # (x86_64-w64-mingw32).
+ uefi)
+ ;;
+ none)
+ ;;
+ kernel* | msvc* )
+ # Restricted further below
+ ;;
+ '')
+ if test x"$obj" = x
+ then
+ echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
+ fi
+ ;;
+ *)
+ echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+case $obj in
+ aout* | coff* | elf* | pe*)
+ ;;
+ '')
+ # empty is fine
+ ;;
+ *)
+ echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we handle the constraint that a (synthetic) cpu and os are
+# valid only in combination with each other and nowhere else.
+case $cpu-$os in
+ # The "javascript-unknown-ghcjs" triple is used by GHC; we
+ # accept it here in order to tolerate that, but reject any
+ # variations.
+ javascript-ghcjs)
+ ;;
+ javascript-* | *-ghcjs)
+ echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os-$obj in
+ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
+ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
+ | linux-relibc*- | linux-uclibc*- )
+ ;;
+ uclinux-uclibc*- )
+ ;;
+ managarm-mlibc*- | managarm-kernel*- )
+ ;;
+ windows*-msvc*-)
+ ;;
+ -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
+ | -uclibc*- )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ -kernel*- )
+ echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ *-kernel*- )
+ echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
+ exit 1
+ ;;
+ *-msvc*- )
+ echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu*- | kopensolaris*-gnu*-)
+ ;;
+ vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
+ ;;
+ nto-qnx*-)
+ ;;
+ os2-emx-)
+ ;;
+ *-eabi*- | *-gnueabi*-)
+ ;;
+ none--*)
+ # None (no kernel, i.e. freestanding / bare metal),
+ # can be paired with an machine code file format
+ ;;
+ -*-)
+ # Blank kernel with real OS is always fine.
+ ;;
+ --*)
+ # Blank kernel and OS with real machine code file format is always fine.
+ ;;
+ *-*-*)
+ echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
case $vendor in
unknown)
- case $os in
- riscix*)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- sunos*)
+ *-sunos*)
vendor=sun
;;
- cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- beos*)
+ *-beos*)
vendor=be
;;
- hpux*)
+ *-hpux*)
vendor=hp
;;
- mpeix*)
+ *-mpeix*)
vendor=hp
;;
- hiux*)
+ *-hiux*)
vendor=hitachi
;;
- unos*)
+ *-unos*)
vendor=crds
;;
- dgux*)
+ *-dgux*)
vendor=dg
;;
- luna*)
+ *-luna*)
vendor=omron
;;
- genix*)
+ *-genix*)
vendor=ns
;;
- clix*)
+ *-clix*)
vendor=intergraph
;;
- mvs* | opened*)
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- ptx*)
+ *-ptx*)
vendor=sequent
;;
- tpf*)
+ *-tpf*)
vendor=ibm
;;
- vxsim* | vxworks* | windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- aux*)
+ *-aux*)
vendor=apple
;;
- hms*)
+ *-hms*)
vendor=hitachi
;;
- mpw* | macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- *mint | mint[0-9]* | *MiNT | MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- vos*)
+ *-vos*)
vendor=stratus
;;
esac
;;
esac
-echo "$cpu-$vendor-$os"
+echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit
# Local variables:
diff --git a/graphics/asymptote/configure b/graphics/asymptote/configure
index 72d0f9b26d..9af2af028f 100755
--- a/graphics/asymptote/configure
+++ b/graphics/asymptote/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for Asymptote 2.92.
+# Generated by GNU Autoconf 2.71 for Asymptote 2.93.
#
# Report bugs to <https://github.com/vectorgraphics/asymptote/issues>.
#
@@ -611,8 +611,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='Asymptote'
PACKAGE_TARNAME='asymptote'
-PACKAGE_VERSION='2.92'
-PACKAGE_STRING='Asymptote 2.92'
+PACKAGE_VERSION='2.93'
+PACKAGE_STRING='Asymptote 2.93'
PACKAGE_BUGREPORT='https://github.com/vectorgraphics/asymptote/issues'
PACKAGE_URL=''
@@ -653,12 +653,9 @@ ac_header_cxx_list=
ac_func_cxx_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
-PTHREAD_CFLAGS
-PTHREAD_LIBS
-PTHREAD_CC
-ax_pthread_config
GLEW
OPTIONS
+CXX_STANDARD
INCL
LSPLIBS
LSPLIB
@@ -669,6 +666,16 @@ ATOMICVERSION
ASYGLVERSION
GCVERSION
getopt
+TINYEXR_ROOT
+LSP_BUILD_ROOT
+LSP_CMAKE_OPTIONS
+LSP_CXX_BUILD_FLAGS
+ROOT_DIR_RELATIVE_TO_LSP
+LSP_ROOT
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CC
+ax_pthread_config
FLEX
BISON
SET_MAKE
@@ -685,7 +692,12 @@ contextdir
latexdir
TEXI2DVI
kpsewhich
+has_vcpkg
Datadir
+target_os
+target_vendor
+target_cpu
+target
host_os
host_vendor
host_cpu
@@ -745,10 +757,13 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_lsp
+with_vcpkg
with_latex
with_context
with_docdir
enable_texlive_build
+with_vcpkg_target_triplet
+with_vcpkg_host_triplet
enable_gc
enable_gc_debug
enable_gc_full_debug
@@ -759,11 +774,10 @@ enable_static
enable_curl
enable_fftw
enable_eigen
-enable_xdr
enable_gsl
enable_gl
enable_offscreen
-enable_OpenImageIO
+enable_xdr
'
ac_precious_vars='build_alias
host_alias
@@ -1326,7 +1340,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures Asymptote 2.92 to adapt to many kinds of systems.
+\`configure' configures Asymptote 2.93 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1387,12 +1401,13 @@ _ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
+ --target=TARGET configure for building compilers for TARGET [HOST]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of Asymptote 2.92:";;
+ short | recursive ) echo "Configuration of Asymptote 2.93:";;
esac
cat <<\_ACEOF
@@ -1403,30 +1418,42 @@ Optional Features:
--enable-lsp[=yes] enable Language Server Protocol
--enable-texlive-build automatically determine sysdir from kpsewhich
--enable-gc[=system] enable system Boehm garbage collector
- [=VERSION] enable local VERSION of Boehm garbage collector
- [=PREFIX] use Boehm garbage collector installed in PREFIX
+ [=VERSION] enable local VERSION of Boehm garbage collector
+ [=PREFIX] use Boehm garbage collector installed in PREFIX
--enable-gc-debug enable (slow) garbage collector debugging
--enable-gc-full-debug enable (very slow) garbage collector backtrace
--enable-threads[=yes] enable POSIX threads
+
--enable-sigsegv[=yes] enable GNU Stack Overflow Handler
--enable-readline[=yes] enable GNU Readline Library
--enable-static[=no] link against static libraries
--enable-curl[=yes] enable libcurl and compile with optional URL support
--enable-fftw[=yes] enable FFTW Library
--enable-eigen[=yes] enable Eigen Library
- --enable-xdr[=yes] enable XDR/V3D support
--enable-gsl[=yes] enable GNU Scientific Library
--enable-gl[=yes] enable OpenGL Library
--enable-offscreen[=no] use OSMesa library to implement offscreen rendering
- --enable-openimageio[=no]
- enable experimental OpenImageIO Library
+ --enable-xdr[=yes] enable XDR/V3D support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+
+ --with-vcpkg=[no] Use vcpkg. If VCPKG_ROOT environment variable is
+ set, will use that vcpkg. Otherwise searches in
+ PATH.
+
--with-latex=PATH specify path to LaTeX installation
--with-context=PATH specify path to ConTeXt installation
--with-docdir=PATH alternate documentation installation directory
+ --with-vcpkg-target-triplet=<target-triplet>
+ specify custom vcpkg triplet. This option is only
+ relevant if vcpkg is used. If left blank, will try
+ to determine the triplet
+ --with-vcpkg-host-triplet=<host-triplet>
+ specify custom vcpkg host triplet. This option is
+ only relevant if vcpkg is ued. If left blank, will
+ try to determine the triplet
Some influential environment variables:
CC C compiler command
@@ -1508,7 +1535,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-Asymptote configure 2.92
+Asymptote configure 2.93
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -1756,6 +1783,53 @@ printf "%s\n" "$ac_res" >&6; }
} # ac_fn_cxx_check_header_compile
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+ as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+ rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
+ if { { ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+printf "%s\n" "$ac_try_echo"; } >&5
+ (eval "$ac_link") 2>conftest.err
+ ac_status=$?
+ if test -s conftest.err; then
+ grep -v '^ *+' conftest.err >conftest.er1
+ cat conftest.er1 >&5
+ mv -f conftest.er1 conftest.err
+ fi
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext && {
+ test "$cross_compiling" = yes ||
+ test -x conftest$ac_exeext
+ }
+then :
+ ac_retval=0
+else $as_nop
+ printf "%s\n" "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_retval=1
+fi
+ # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+ # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+ # interfere with the next link command; also delete a directory that is
+ # left behind by Apple's compiler. We do this before executing the actions.
+ rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+ eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+ as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
# ac_fn_cxx_check_func LINENO FUNC VAR
# ------------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
@@ -1818,53 +1892,6 @@ printf "%s\n" "$ac_res" >&6; }
} # ac_fn_cxx_check_func
-# ac_fn_c_try_link LINENO
-# -----------------------
-# Try to link conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_link ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
- if { { ac_try="$ac_link"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-printf "%s\n" "$ac_try_echo"; } >&5
- (eval "$ac_link") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest$ac_exeext && {
- test "$cross_compiling" = yes ||
- test -x conftest$ac_exeext
- }
-then :
- ac_retval=0
-else $as_nop
- printf "%s\n" "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
- # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
- # interfere with the next link command; also delete a directory that is
- # left behind by Apple's compiler. We do this before executing the actions.
- rm -rf conftest.dSYM conftest_ipa8_conftest.oo
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_link
-
# ac_fn_cxx_check_type LINENO TYPE VAR INCLUDES
# ---------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
@@ -1988,7 +2015,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by Asymptote $as_me 2.92, which was
+It was created by Asymptote $as_me 2.93, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
@@ -3105,6 +3132,8 @@ VERSION=$PACKAGE_VERSION
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4340,13 +4369,15 @@ fi
printf "%s\n" "$ac_cv_c_bigendian" >&6; }
case $ac_cv_c_bigendian in #(
yes)
- printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
+
+printf "%s\n" "#define WORDS_BIGENDIAN 1" >>confdefs.h
;; #(
no)
;; #(
universal)
-printf "%s\n" "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
+printf "%s\n" "#define UNIVERSAL_ENDIAN_BUILD 1" >>confdefs.h
+
;; #(
*)
@@ -4430,6 +4461,46 @@ IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+printf %s "checking target system type... " >&6; }
+if test ${ac_cv_target+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test "x$target_alias" = x; then
+ ac_cv_target=$ac_cv_host
+else
+ ac_cv_target=`$SHELL "${ac_aux_dir}config.sub" $target_alias` ||
+ as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+printf "%s\n" "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+ test "$program_prefix$program_suffix$program_transform_name" = \
+ NONENONEs,x,x, &&
+ program_prefix=${target_alias}-
test "$prefix" = NONE && prefix=/usr/local
Datadir=$datadir
@@ -4443,19 +4514,130 @@ then :
enableval=$enable_lsp;
fi
-if test "x$enable_lsp" != "xno"; then
-cxxstd="c++14"
-else
-cxxstd="c++11"
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Language Server Protocol disabled by configure flag ***" >&5
-printf "%s\n" "$as_me: *** Language Server Protocol disabled by configure flag ***" >&6;}
-fi
+cxxstd="c++17"
test "$CXXFLAGS" || CXXFLAGS="-std=$cxxstd"
echo Compiling with $CXXFLAGS
test "$CFLAGS" || CFLAGS="-g -O3"
+# --------------- external refs ---------------------------
+
+# we need LSP regardless
+EXTERNAL_CODE_ROOT=acextlibs
+EXTERNAL_BUILD_ROOT=acextbuilds
+
+LSP_GITHUB_REPO=vectorgraphics/LspCpp
+LSP_REF=master
+
+TINYEXR_GITHUB_REPO=syoyo/tinyexr
+TINYEXR_REF=v1.0.7
+#
+# FETCH_FROM_GITHUB(REPO,REF,OUT_VAR_SRC_DIRECTORY)
+
+
+
+# --------------- begin vcpkg option/check ---------------------
+# result:
+# with_vcpkg is yes/no, depending if user wants to use vcpkg or not
+# vcpkg_exec is the executable of vcpkg. this is only given if use_vcpkg is yes.
+
+
+# Check whether --with-vcpkg was given.
+if test ${with_vcpkg+y}
+then :
+ withval=$with_vcpkg;
+ if test "x$VCPKG_ROOT" = "x"; then # vcpkg root not given
+ echo "VCPKG_ROOT is not given; searching vcpkg in path"
+ # Extract the first word of "vcpkg", so it can be a program name with args.
+set dummy vcpkg; ac_word=$2
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+printf %s "checking for $ac_word... " >&6; }
+if test ${ac_cv_prog_has_vcpkg+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ if test -n "$has_vcpkg"; then
+ ac_cv_prog_has_vcpkg="$has_vcpkg" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ case $as_dir in #(((
+ '') as_dir=./ ;;
+ */) ;;
+ *) as_dir=$as_dir/ ;;
+ esac
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
+ ac_cv_prog_has_vcpkg="true"
+ printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+has_vcpkg=$ac_cv_prog_has_vcpkg
+if test -n "$has_vcpkg"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $has_vcpkg" >&5
+printf "%s\n" "$has_vcpkg" >&6; }
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
+printf "%s\n" "no" >&6; }
+fi
+
+
+ if test "x$has_vcpkg" = "xtrue"; then
+ vcpkg_exec=vcpkg
+ fi
+ else
+ echo "VCPKG_ROOT is given; is using VCPKG_ROOT"
+ as_ac_File=`printf "%s\n" "ac_cv_file_$VCPKG_ROOT/vcpkg" | $as_tr_sh`
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $VCPKG_ROOT/vcpkg" >&5
+printf %s "checking for $VCPKG_ROOT/vcpkg... " >&6; }
+if eval test \${$as_ac_File+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "$VCPKG_ROOT/vcpkg"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+printf "%s\n" "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"
+then :
+
+ vcpkg_exec=$VCPKG_ROOT/vcpkg
+
+fi
+
+ fi
+
+ # ensure vcpkg is specified
+ if test "x$vcpkg_exec" = "x"; then
+ as_fn_error $? "Please ensure vcpkg is available through VCPKG_ROOT or in PATH" "$LINENO" 5
+ fi
+ echo "Using vcpkg executable $vcpkg_exec"
+
+else $as_nop
+
+with_vcpkg=no
+
+fi
+
+
+#----------------- end vcpkg option check --------------------
+
# Check whether --with-latex was given.
if test ${with_latex+y}
@@ -6671,57 +6853,95 @@ fi
-ac_fn_cxx_check_header_compile "$LINENO" "tr1/unordered_map" "ac_cv_header_tr1_unordered_map" "$ac_includes_default"
-if test "x$ac_cv_header_tr1_unordered_map" = xyes
-then :
+ASYGLVERSION=1.02
-fi
+DEFS=""
+OPTIONS=$OPTIONS"-D_FILE_OFFSET_BIS=64 "
+INCL="-I."
+OPTIONS=""
+LIBS=""
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include <tr1/unordered_map>
- std::tr1::unordered_map<int,int> map;
+# ------------- vcpkg initialization ---------------
+# vcpkg_triplet
-int
-main (void)
-{
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"
+# Check whether --with-vcpkg-target-triplet was given.
+if test ${with_vcpkg_target_triplet+y}
then :
-
-printf "%s\n" "#define HAVE_TR1_UNORDERED_MAP 1" >>confdefs.h
+ withval=$with_vcpkg_target_triplet; # given
+ if test "x$with_vcpkg" != "xno" -a test "x$withval" != "xno"; then
+ vcpkg_triplet=$withval
+ fi
else $as_nop
+ # not given
+ if test "x$with_vcpkg" != "xno"; then
+ case $target_cpu in
+ x86_64)
+ triplet_arch=x64
+ ;;
+ aarch64)
+ triplet_arch=arm64
+ ;;
+ i*86)
+ triplet_arch=x86
+ ;;
+ *)
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Cannot determine architecture, will leave triplet blank" >&5
+printf "%s\n" "$as_me: Cannot determine architecture, will leave triplet blank" >&6;}
+ ;;
+ esac
- ac_fn_cxx_check_header_compile "$LINENO" "unordered_map" "ac_cv_header_unordered_map" "$ac_includes_default"
-if test "x$ac_cv_header_unordered_map" = xyes
-then :
+ case "$OSTYPE" in
+ darwin*)
+ triplet_os=osx
+ ;;
+ *)
+ triplet_os=linux
+ ;;
+ esac
-printf "%s\n" "#define HAVE_UNORDERED_MAP 1" >>confdefs.h
+ if test "x$triplet_arch" != "x" -a "x$triplet_os" != "x"; then
+ vcpkg_triplet="${triplet_arch}-${triplet_os}"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Determined vcpkg triplet as $vcpkg_triplet" >&5
+printf "%s\n" "$as_me: Determined vcpkg triplet as $vcpkg_triplet" >&6;}
+ else
+ as_fn_error $? "Cannot determine vcpkg triplet for usage" "$LINENO" 5
+ fi
+ fi
-else $as_nop
- ac_fn_cxx_check_header_compile "$LINENO" "ext/hash_map" "ac_cv_header_ext_hash_map" "$ac_includes_default"
-if test "x$ac_cv_header_ext_hash_map" = xyes
-then :
-else $as_nop
- OPTIONS=$OPTIONS"-DNOHASH "
fi
+
+if test "x$with_vcpkg" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS="--triplet=$vcpkg_triplet "
+ VCPKG_PKG_CONFIG_LOC="vcpkg_installed/$vcpkg_triplet/lib/pkgconfig"
+ INCL=$INCL" -Ivcpkg_installed/$vcpkg_triplet/include "
+ LIBS=$LIBS" -Lvcpkg_installed/$vcpkg_triplet/lib "
+
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=""
+
+
fi
+
+
+# Check whether --with-vcpkg-host-triplet was given.
+if test ${with_vcpkg_host_triplet+y}
+then :
+ withval=$with_vcpkg_host_triplet; # given
+ if test "x$with_vcpkg" != "xno" -a test "x$withval" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--host-triplet=$withval "
+ fi
+
fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-ASYGLVERSION=1.02
-GCVERSION=8.2.4
-ATOMICVERSION=7.6.12
+# --------------- GC -------------------------------
+ATOMICVERSION=7.6.12
+GCVERSION=8.2.4
GCFILE=gc-$GCVERSION
ac_cv_use_gc="system"
@@ -6751,33 +6971,83 @@ fi
# Check whether --enable-gc was given.
if test ${enable_gc+y}
then :
- enableval=$enable_gc;
- if test "x$enableval" != "xyes" ; then
- ac_cv_use_gc=$enableval
- fi
+ enableval=$enable_gc; # if true
+ if test "x$enableval" != "xyes" ; then # system, no or else
+ ac_cv_use_gc=$enableval
+ fi
+
+
+fi
+
+
+# Check whether --enable-gc-debug was given.
+if test ${enable_gc_debug+y}
+then :
+ enableval=$enable_gc_debug; if test "x$ac_cv_use_gc" != "xno" ; then
+ if test "x$enableval" = "xyes" ; then
+
+printf "%s\n" "#define GC_DEBUG 1" >>confdefs.h
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Enabling GC debugging: remember to make clean ***" >&5
+printf "%s\n" "$as_me: *** Enabling GC debugging: remember to make clean ***" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Set the environment variable GC_FIND_LEAK at runtime ***" >&5
+printf "%s\n" "$as_me: *** Set the environment variable GC_FIND_LEAK at runtime ***" >&6;}
+ fi
+ fi
+
+fi
+
+
+# Check whether --enable-gc-full-debug was given.
+if test ${enable_gc_full_debug+y}
+then :
+ enableval=$enable_gc_full_debug; if test "x$ac_cv_use_gc" != "xno" ; then
+ if test "x$enableval" = "xyes" ; then
+
+printf "%s\n" "#define GC_DEBUG 1" >>confdefs.h
+
+
+printf "%s\n" "#define GC_BACKTRACE 1" >>confdefs.h
+
+ GCOPTIONS=$GCOPTIONS"--enable-gc-debug "
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Enabling GC backtrace debugging; remember to make gc-clean ***" >&5
+printf "%s\n" "$as_me: *** Enabling GC backtrace debugging; remember to make gc-clean ***" >&6;}
+ fi
+ fi
fi
-OPTIONS="-D_FILE_OFFSET_BIS=64 "
GCLIB=
GCPPLIB=
-INCL="-I."
GCNAME="Boehm Garbage Collector"
if test "x$ac_cv_use_gc" != "xno" ; then
- OPTIONS=$OPTIONS"-DUSEGC -DLSPCPP_USEGC "
- case _$ac_cv_use_gc in
- _|_system|_*[\\/]*)
- if test "x$ac_cv_use_gc" = "xsystem" ; then
- INCL="-I. -I$prefix/include/gc -I/usr/include/gc"
- LIBS=$LIBS"-L$prefix/lib "
- else
- INCL="-I$ac_cv_use_gc/include/gc"
- LIBS=$LIBS"-L$ac_cv_use_gc/lib "
- fi
- CPPFLAGS_SAVE=$CPPFLAGS
- CPPFLAGS=$CPPFLAGS" $INCL"
- ac_fn_cxx_check_header_compile "$LINENO" "gc.h" "ac_cv_header_gc_h" "$ac_includes_default"
+
+printf "%s\n" "#define USEGC 1" >>confdefs.h
+
+
+printf "%s\n" "#define LSPCPP_USEGC 1" >>confdefs.h
+
+ if test "x$with_vcpkg" != "xno"; then # managed by vcpkg
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=gc "
+ # The reason we are not using AC_CHECK_LIB is because
+ # we are not installing the dependencies until we collect all the features,
+ # hence the library files will not be available
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"bdw-gc "
+ LIBS=$LIBS"-lgccpp "
+ else # else, determine by prefix or system
+ case _$ac_cv_use_gc in
+ _|_system|_*[\\/]*)
+ if test "x$ac_cv_use_gc" = "xsystem" ; then
+ INCL=$INCL" -I$prefix/include/gc -I/usr/include/gc "
+ LIBS=$LIBS"-L$prefix/lib "
+ else
+ INCL=$INCL" -I$ac_cv_use_gc/include/gc "
+ LIBS=$LIBS"-L$ac_cv_use_gc/lib "
+ fi
+ CPPFLAGS_SAVE=$CPPFLAGS
+ CPPFLAGS=$CPPFLAGS" $INCL"
+ ac_fn_cxx_check_header_compile "$LINENO" "gc.h" "ac_cv_header_gc_h" "$ac_includes_default"
if test "x$ac_cv_header_gc_h" = xyes
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GC_malloc in -lgc" >&5
@@ -6817,107 +7087,55 @@ printf "%s\n" "$ac_cv_lib_gc_GC_malloc" >&6; }
if test "x$ac_cv_lib_gc_GC_malloc" = xyes
then :
- LIBS=$LIBS"-lgc "
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: enabling system $GCNAME" >&5
+ LIBS=$LIBS"-lgc "
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: enabling system $GCNAME" >&5
printf "%s\n" "$as_me: enabling system $GCNAME" >&6;}
else $as_nop
- GCDIR=$GCFILE
- INCL="-I. -I\$(GC)/include"
- GCLIB="\$(GC)/.libs/libgc.a"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $GCNAME library not found" >&5
+ GCDIR=$GCFILE
+ INCL=$INCL" -I\$(GC)/include "
+ GCLIB="\$(GC)/.libs/libgc.a"
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $GCNAME library not found" >&5
printf "%s\n" "$as_me: $GCNAME library not found" >&6;}
fi
else $as_nop
GCDIR=$GCFILE
- GCLIB="\$(GC)/.libs/libgc.a"
- INCL="-I. -I\$(GC)/include"
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $GCNAME header file not found" >&5
+ GCLIB="\$(GC)/.libs/libgc.a"
+ INCL=$INCL" -I\$(GC)/include "
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: $GCNAME header file not found" >&5
printf "%s\n" "$as_me: $GCNAME header file not found" >&6;}
fi
- CPPFLAGS=$CPPFLAGS_SAVE
- ;;
- *)
- GCVERSION=$ac_cv_use_gc
- GCFILE=gc-$GCVERSION
- GCDIR=$GCFILE
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: enabling local $GCNAME $GCDIR" >&5
+ CPPFLAGS=$CPPFLAGS_SAVE
+ ;;
+ *)
+ GCVERSION=$ac_cv_use_gc
+ GCFILE=gc-$GCVERSION
+ GCDIR=$GCFILE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: enabling local $GCNAME $GCDIR" >&5
printf "%s\n" "$as_me: enabling local $GCNAME $GCDIR" >&6;}
- GCLIB="\$(GC)/.libs/libgc.a"
- INCL="-I. -I\$(GC)/include"
- ;;
- esac
+ GCLIB="\$(GC)/.libs/libgc.a"
+ INCL=$INCL" -I\$(GC)/include "
+ ;;
+ esac
+ fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: disabling the $GCNAME" >&5
printf "%s\n" "$as_me: disabling the $GCNAME" >&6;}
fi
-# Check whether --enable-gc-debug was given.
-if test ${enable_gc_debug+y}
-then :
- enableval=$enable_gc_debug; if test "x$ac_cv_use_gc" != "xno" ; then
- if test "x$enableval" = "xyes" ; then
- OPTIONS=$OPTIONS"-DGC_DEBUG "
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Enabling GC debugging: remember to make clean ***" >&5
-printf "%s\n" "$as_me: *** Enabling GC debugging: remember to make clean ***" >&6;}
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Set the environment variable GC_FIND_LEAK at runtime ***" >&5
-printf "%s\n" "$as_me: *** Set the environment variable GC_FIND_LEAK at runtime ***" >&6;}
- fi
- fi
-
-fi
-
-
-# Check whether --enable-gc-full-debug was given.
-if test ${enable_gc_full_debug+y}
-then :
- enableval=$enable_gc_full_debug; if test "x$ac_cv_use_gc" != "xno" ; then
- if test "x$enableval" = "xyes" ; then
- OPTIONS=$OPTIONS"-DGC_DEBUG -DGC_BACKTRACE "
- GCOPTIONS=$GCOPTIONS"--enable-gc-debug "
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Enabling GC backtrace debugging; remember to make gc-clean ***" >&5
-printf "%s\n" "$as_me: *** Enabling GC backtrace debugging; remember to make gc-clean ***" >&6;}
- fi
- fi
-
-fi
-
-
-if test "$OSTYPE" = "msdos"; then
-CPPFLAGS=$CPPFLAGS" -D__MSDOS__ -I/usr/include/w32api -I/usr/include -DCALLBACK=__stdcall $INCL"
-else
-CPPFLAGS=$CPPFLAGS" $INCL"
-fi
-
-ac_fn_cxx_check_func "$LINENO" "getopt_long_only" "ac_cv_func_getopt_long_only"
-if test "x$ac_cv_func_getopt_long_only" = xyes
-then :
-
-printf "%s\n" "#define HAVE_GNU_GETOPT_H 1" >>confdefs.h
-
-else $as_nop
- getopt="getopt getopt1"
-fi
-
-
-
-
-
-
-
-
-
-
-
-
-
+# -------------------------- end gc ------------------
# Checks for libraries.
#AC_SEARCH_LIBS([lgamma],[m c],,
#AC_MSG_ERROR([*** Please install libm on your system ***]))
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
+
+# ----------------- zlib ----------------------------
+if test "x$with_vcpkg" != "xno"; then
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"zlib "
+else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for deflate in -lz" >&5
printf %s "checking for deflate in -lz... " >&6; }
if test ${ac_cv_lib_z_deflate+y}
then :
@@ -6959,8 +7177,16 @@ then :
else $as_nop
as_fn_error $? "*** Please install libz or zlib-devel on your system ***" "$LINENO" 5
+
+fi
+
fi
+printf "%s\n" "#define HAVE_ZLIB 1" >>confdefs.h
+
+
+# -------------- threads -------------------
+
GCOPTIONS="--disable-shared "
# Check whether --enable-threads was given.
@@ -6971,6 +7197,12 @@ fi
if test "x$enable_threads" != "xno"; then
+ if test "x$with_vcpkg" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=threading "
+ printf "%s\n" "#define HAVE_PTHREAD 1" >>confdefs.h
+
+ OPTIONS=$OPTIONS" -pthread"
+ else
ac_ext=c
@@ -7378,19 +7610,23 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+ fi
else
GCOPTIONS=$GCOPTIONS"--disable-threads "
fi
-# Check whether --enable-sigsegv was given.
+# --------------- sigsegv ------------------------------
+
+if test "x$with_vcpkg" = "no"; then # I couldn't find sigsegv on vcpkg, so this is only enabled if
+ # Check whether --enable-sigsegv was given.
if test ${enable_sigsegv+y}
then :
enableval=$enable_sigsegv;
fi
-if test "x$enable_sigsegv" != "xno"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stackoverflow_install_handler in -lsigsegv" >&5
+ if test "x$enable_sigsegv" != "xno"; then
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stackoverflow_install_handler in -lsigsegv" >&5
printf %s "checking for stackoverflow_install_handler in -lsigsegv... " >&6; }
if test ${ac_cv_lib_sigsegv_stackoverflow_install_handler+y}
then :
@@ -7432,9 +7668,9 @@ then :
fi
-fi
+ fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sched_yield in -lrt" >&5
printf %s "checking for sched_yield in -lrt... " >&6; }
if test ${ac_cv_lib_rt_sched_yield+y}
then :
@@ -7476,11 +7712,51 @@ then :
fi
+fi
+
+# ----------------- lsp -------------------------------
+
+# LSP is needed regardless of
+
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Fetching from github: $LSP_GITHUB_REPO@$LSP_REF" >&5
+printf "%s\n" "$as_me: Fetching from github: $LSP_GITHUB_REPO@$LSP_REF" >&6;}
+ LSP_ROOT=$EXTERNAL_CODE_ROOT/$LSP_GITHUB_REPO
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Creating directory $LSP_ROOT" >&5
+printf "%s\n" "$as_me: Creating directory $LSP_ROOT" >&6;}
+ mkdir -p $LSP_ROOT
+ curl -L https://github.com/$LSP_GITHUB_REPO/archive/$LSP_REF.tar.gz | tar -xz --strip-components=1 -C $LSP_ROOT -f -
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Fetch successful" >&5
+printf "%s\n" "$as_me: Fetch successful" >&6;}
+
+INCL=$INCL"-I$LSP_ROOT/include "
+
LSPLIBS=
LSPLIB=
if test "x$enable_lsp" != "xno" -a "x$enable_threads" != "xno"; then
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for opendir in -lboost_filesystem" >&5
+ LSP_BUILD_ROOT="$EXTERNAL_BUILD_ROOT/$LSP_GITHUB_REPO"
+ ROOT_DIR_RELATIVE_TO_LSP=$(realpath -s --relative-to $LSP_BUILD_ROOT .)
+ LSPLIB=$LSP_BUILD_ROOT/liblspcpp.a
+ LSPLIBS=$LSPLIBS" -L$LSP_BUILD_ROOT -L$LSP_BUILD_ROOT/third_party/uri/src -llspcpp -lnetwork-uri -lboost_filesystem -lboost_thread"
+ LSP_CMAKE_OPTIONS=
+
+
+ if test "x$with_vcpkg" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=lsp "
+ RELATIVE_LSP_VCPKG_ROOT=$(realpath -s --relative-to=$LSP_BUILD_ROOT vcpkg_installed/$vcpkg_triplet)
+ LSP_CXX_BUILD_FLAGS=$LSP_BUILD_FLAGS"-I$RELATIVE_LSP_VCPKG_ROOT/include -L$RELATIVE_LSP_VCPKG_ROOT/lib "
+ LSP_CMAKE_OPTIONS="-DUSE_SYSTEM_RAPIDJSON=True -DCMAKE_PREFIX_PATH=\"$RELATIVE_LSP_VCPKG_ROOT\""
+
+
+
+
+
+printf "%s\n" "#define HAVE_LSP 1" >>confdefs.h
+
+
+ else
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for opendir in -lboost_filesystem" >&5
printf %s "checking for opendir in -lboost_filesystem... " >&6; }
if test ${ac_cv_lib_boost_filesystem_opendir+y}
then :
@@ -7516,7 +7792,8 @@ fi
printf "%s\n" "$ac_cv_lib_boost_filesystem_opendir" >&6; }
if test "x$ac_cv_lib_boost_filesystem_opendir" = xyes
then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_getdetachstate in -lboost_thread" >&5
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_attr_getdetachstate in -lboost_thread" >&5
printf %s "checking for pthread_attr_getdetachstate in -lboost_thread... " >&6; }
if test ${ac_cv_lib_boost_thread_pthread_attr_getdetachstate+y}
then :
@@ -7553,22 +7830,32 @@ printf "%s\n" "$ac_cv_lib_boost_thread_pthread_attr_getdetachstate" >&6; }
if test "x$ac_cv_lib_boost_thread_pthread_attr_getdetachstate" = xyes
then :
+
+
+
+
+
printf "%s\n" "#define HAVE_LSP 1" >>confdefs.h
- LSPLIBS="-llspcpp -lnetwork-uri -lboost_filesystem -lboost_thread "
- LSPLIB=liblspcpp.a
+
+
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libboost_thread: will compile without optional Language Server Protocol. ***" >&5
printf "%s\n" "$as_me: *** Could not find libboost_thread: will compile without optional Language Server Protocol. ***" >&6;}
fi
+
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libboost_filesystem: will compile without optional Language Server Protocol. ***" >&5
printf "%s\n" "$as_me: *** Could not find libboost_filesystem: will compile without optional Language Server Protocol. ***" >&6;}
+
fi
+ fi
fi
+# ------------- arguments for readline & static linking ---
+
# Check whether --enable-readline was given.
if test ${enable_readline+y}
then :
@@ -7590,32 +7877,46 @@ if test "x$enable_static" = "xyes"; then
DYNAMIC="-Wl,-Bdynamic "
fi
+# ------------- readline & defines --------------------
+
+# --------------- end readline ----------------
if test "x$enable_readline" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=readline "
+ printf "%s\n" "#define HAVE_NCURSES_CURSES_H 1" >>confdefs.h
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags readline || echo`
+ printf "%s\n" "#define HAVE_LIBCURSES 1" >>confdefs.h
+ printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"readline "
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"ncurses "
+else # managed by the system
+
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags readline || echo)
+
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-#include <stdio.h>
-#include <unistd.h>
-#include <readline/readline.h>
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <readline/readline.h>
int
main (void)
{
-#ifndef RL_READLINE_VERSION
-abort
-#endif
+ #ifndef RL_READLINE_VERSION
+ abort
+ #endif
;
return 0;
@@ -7625,22 +7926,25 @@ if ac_fn_cxx_try_compile "$LINENO"
then :
-PKG_FLAGS=" "`pkg-config --silence-errors --libs readline || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs readline || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"readline"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for history_list in -lreadline" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"readline"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking readline for function history_list... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking readline for function history_list... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for history_list in -lreadline" >&5
printf %s "checking for history_list in -lreadline... " >&6; }
if test ${ac_cv_lib_readline_history_list+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline $PKG_FLAGS $LIBS"
+LIBS="-lreadline $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7675,17 +7979,19 @@ printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_readline_history_list=; unset ac_cv_lib_readline_history_list;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for history_list in -lreadline" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_readline_history_list=; unset ac_cv_lib_readline_history_list;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for history_list in -lreadline" >&5
printf %s "checking for history_list in -lreadline... " >&6; }
if test ${ac_cv_lib_readline_history_list+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lreadline $PKG_FLAGS $LIBS"
+LIBS="-lreadline $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7719,7 +8025,7 @@ printf "%s\n" "#define HAVE_LIBREADLINE 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
+ LDFLAGS=$LDFLAGS_SAVE
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find GNU readline 4.3 or later: will compile without readline support ***" >&5
printf "%s\n" "$as_me: *** Could not find GNU readline 4.3 or later: will compile without readline support ***" >&6;}
@@ -7777,9 +8083,9 @@ fi
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
+ LDFLAGS=$LDFLAGS_SAVE
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find GNU readline 4.3 or later: will compile without readline support ***" >&5
printf "%s\n" "$as_me: *** Could not find GNU readline 4.3 or later: will compile without readline support ***" >&6;}
@@ -7834,8 +8140,7 @@ fi
-fi
-
+ fi
fi
@@ -7897,26 +8202,29 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags tinfo || echo`
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags tinfo || echo)
-PKG_FLAGS=" "`pkg-config --silence-errors --libs tinfo || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs tinfo || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"tinfo"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"tinfo"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking tinfo for function tgetent... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking tinfo for function tgetent... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
printf %s "checking for tgetent in -ltinfo... " >&6; }
if test ${ac_cv_lib_tinfo_tgetent+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltinfo $PKG_FLAGS $LIBS"
+LIBS="-ltinfo $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7951,17 +8259,19 @@ printf "%s\n" "#define HAVE_LIBTINFO 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_tinfo_tgetent=; unset ac_cv_lib_tinfo_tgetent;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_tinfo_tgetent=; unset ac_cv_lib_tinfo_tgetent;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -ltinfo" >&5
printf %s "checking for tgetent in -ltinfo... " >&6; }
if test ${ac_cv_lib_tinfo_tgetent+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltinfo $PKG_FLAGS $LIBS"
+LIBS="-ltinfo $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -7995,29 +8305,28 @@ printf "%s\n" "#define HAVE_LIBTINFO 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: perhaps tgetent is in -lncurses" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: perhaps tgetent is in -lncurses" >&5
printf "%s\n" "$as_me: perhaps tgetent is in -lncurses" >&6;}
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: perhaps tgetent is in -lncurses" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: perhaps tgetent is in -lncurses" >&5
printf "%s\n" "$as_me: perhaps tgetent is in -lncurses" >&6;}
-fi
-
+ fi
fi
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags ncurses || echo`
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags ncurses || echo)
- for ac_header in ncurses/curses.h ncurses.h curses.h
+ for ac_header in ncurses/curses.h ncurses.h curses.h
do :
as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -8032,22 +8341,25 @@ fi
done
-PKG_FLAGS=" "`pkg-config --silence-errors --libs ncurses || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs ncurses || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"ncurses"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lncurses" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"ncurses"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking ncurses for function setupterm... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking ncurses for function setupterm... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lncurses" >&5
printf %s "checking for setupterm in -lncurses... " >&6; }
if test ${ac_cv_lib_ncurses_setupterm+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses $PKG_FLAGS $LIBS"
+LIBS="-lncurses $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8082,17 +8394,19 @@ printf "%s\n" "#define HAVE_LIBCURSES 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_ncurses_setupterm=; unset ac_cv_lib_ncurses_setupterm;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lncurses" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_ncurses_setupterm=; unset ac_cv_lib_ncurses_setupterm;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lncurses" >&5
printf %s "checking for setupterm in -lncurses... " >&6; }
if test ${ac_cv_lib_ncurses_setupterm+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lncurses $PKG_FLAGS $LIBS"
+LIBS="-lncurses $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8126,8 +8440,8 @@ printf "%s\n" "#define HAVE_LIBCURSES 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lcurses" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lcurses" >&5
printf %s "checking for setupterm in -lcurses... " >&6; }
if test ${ac_cv_lib_curses_setupterm+y}
then :
@@ -8173,10 +8487,10 @@ fi
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lcurses" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for setupterm in -lcurses" >&5
printf %s "checking for setupterm in -lcurses... " >&6; }
if test ${ac_cv_lib_curses_setupterm+y}
then :
@@ -8219,12 +8533,14 @@ then :
fi
-fi
-
+ fi
fi
fi
+fi
+
+# ---------------- curl ------------------------
# Check whether --enable-curl was given.
if test ${enable_curl+y}
@@ -8233,30 +8549,39 @@ then :
fi
if test "x$enable_curl" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=curl "
+ printf "%s\n" "#define HAVE_LIBCURL 1" >>confdefs.h
+
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"libcurl "
+else
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags curl || echo`
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags curl || echo)
ac_fn_cxx_check_header_compile "$LINENO" "curl/curl.h" "ac_cv_header_curl_curl_h" "$ac_includes_default"
if test "x$ac_cv_header_curl_curl_h" = xyes
then :
-PKG_FLAGS=" "`pkg-config --silence-errors --libs libcurl || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs libcurl || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"curl"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"curl"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking curl for function curl_easy_init... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking curl for function curl_easy_init... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
printf %s "checking for curl_easy_init in -lcurl... " >&6; }
if test ${ac_cv_lib_curl_curl_easy_init+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurl $PKG_FLAGS $LIBS"
+LIBS="-lcurl $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8291,17 +8616,19 @@ printf "%s\n" "#define HAVE_LIBCURL 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_curl_curl_easy_init=; unset ac_cv_lib_curl_curl_easy_init;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_curl_curl_easy_init=; unset ac_cv_lib_curl_curl_easy_init;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for curl_easy_init in -lcurl" >&5
printf %s "checking for curl_easy_init in -lcurl... " >&6; }
if test ${ac_cv_lib_curl_curl_easy_init+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lcurl $PKG_FLAGS $LIBS"
+LIBS="-lcurl $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8335,21 +8662,20 @@ printf "%s\n" "#define HAVE_LIBCURL 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libcurl: will compile without optional URL support. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libcurl: will compile without optional URL support. ***" >&5
printf "%s\n" "$as_me: *** Could not find libcurl: will compile without optional URL support. ***" >&6;}
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libcurl: will compile without optional URL support. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libcurl: will compile without optional URL support. ***" >&5
printf "%s\n" "$as_me: *** Could not find libcurl: will compile without optional URL support. ***" >&6;}
-fi
-
+ fi
fi
@@ -8358,11 +8684,14 @@ else $as_nop
printf "%s\n" "$as_me: *** Header file curl.h not found: will compile without optional URL support. ***" >&6;}
fi
+fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** libcurl support disabled by configure flag: will compile without optional URL support. ***" >&5
printf "%s\n" "$as_me: *** libcurl support disabled by configure flag: will compile without optional URL support. ***" >&6;}
fi
+# --------------------- fftw -------------------------
+
# Check whether --enable-fftw was given.
if test ${enable_fftw+y}
then :
@@ -8371,30 +8700,39 @@ fi
if test "x$enable_fftw" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=fftw3 "
+printf "%s\n" "#define HAVE_LIBFFTW3 1" >>confdefs.h
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags fftw3 || echo`
+VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"fftw3 "
+else # system managed
+
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags fftw3 || echo)
ac_fn_cxx_check_header_compile "$LINENO" "fftw3.h" "ac_cv_header_fftw3_h" "$ac_includes_default"
if test "x$ac_cv_header_fftw3_h" = xyes
then :
-PKG_FLAGS=" "`pkg-config --silence-errors --libs fftw3 || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs fftw3 || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"fftw3"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"fftw3"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking fftw3 for function fftw_execute... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking fftw3 for function fftw_execute... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
printf %s "checking for fftw_execute in -lfftw3... " >&6; }
if test ${ac_cv_lib_fftw3_fftw_execute+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3 $PKG_FLAGS $LIBS"
+LIBS="-lfftw3 $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8429,17 +8767,19 @@ printf "%s\n" "#define HAVE_LIBFFTW3 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_fftw3_fftw_execute=; unset ac_cv_lib_fftw3_fftw_execute;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_fftw3_fftw_execute=; unset ac_cv_lib_fftw3_fftw_execute;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fftw_execute in -lfftw3" >&5
printf %s "checking for fftw_execute in -lfftw3... " >&6; }
if test ${ac_cv_lib_fftw3_fftw_execute+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lfftw3 $PKG_FLAGS $LIBS"
+LIBS="-lfftw3 $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8473,21 +8813,20 @@ printf "%s\n" "#define HAVE_LIBFFTW3 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&5
printf "%s\n" "$as_me: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&6;}
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&5
printf "%s\n" "$as_me: *** Could not find libfftw3: will compile without optional fast Fourier transforms. ***" >&6;}
-fi
-
+ fi
fi
@@ -8497,6 +8836,9 @@ printf "%s\n" "$as_me: *** Header file fftw3.h not found: will compile without o
fi
fi
+fi
+
+# ------------------- eigen -------------------------
# Check whether --enable-eigen was given.
if test ${enable_eigen+y}
@@ -8506,8 +8848,14 @@ fi
if test "x$enable_eigen" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then
+VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=eigen3 "
+printf "%s\n" "#define HAVE_EIGEN_DENSE 1" >>confdefs.h
+
+VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"eigen3 "
+else
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags eigen3 || echo`
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags eigen3 || echo)
ac_fn_cxx_check_header_compile "$LINENO" "Eigen/Dense" "ac_cv_header_Eigen_Dense" "$ac_includes_default"
if test "x$ac_cv_header_Eigen_Dense" = xyes
@@ -8517,6 +8865,7 @@ then :
fi
fi
+fi
# Checks for header files.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5
@@ -8596,158 +8945,7 @@ then :
fi
-# Check whether --enable-xdr was given.
-if test ${enable_xdr+y}
-then :
- enableval=$enable_xdr;
-fi
-
-if test "x$enable_xdr" != "xno"; then
-case "$OSTYPE" in
- darwin*)
-
-printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
-
- ;;
- *)
-
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags libtirpc || echo`
-
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-#include "xstream.h"
-int
-main (void)
-{
-
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_compile "$LINENO"
-then :
-
-
-PKG_FLAGS=" "`pkg-config --silence-errors --libs libtirpc || echo`
-
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"tirpc"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xdrstdio_create in -ltirpc" >&5
-printf %s "checking for xdrstdio_create in -ltirpc... " >&6; }
-if test ${ac_cv_lib_tirpc_xdrstdio_create+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltirpc $PKG_FLAGS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-namespace conftest {
- extern "C" int xdrstdio_create ();
-}
-int
-main (void)
-{
-return conftest::xdrstdio_create ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"
-then :
- ac_cv_lib_tirpc_xdrstdio_create=yes
-else $as_nop
- ac_cv_lib_tirpc_xdrstdio_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tirpc_xdrstdio_create" >&5
-printf "%s\n" "$ac_cv_lib_tirpc_xdrstdio_create" >&6; }
-if test "x$ac_cv_lib_tirpc_xdrstdio_create" = xyes
-then :
-
-printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
-
-else $as_nop
- if test "x$enable_static" = "xyes"; then
-
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_tirpc_xdrstdio_create=; unset ac_cv_lib_tirpc_xdrstdio_create;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xdrstdio_create in -ltirpc" >&5
-printf %s "checking for xdrstdio_create in -ltirpc... " >&6; }
-if test ${ac_cv_lib_tirpc_xdrstdio_create+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-ltirpc $PKG_FLAGS $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-namespace conftest {
- extern "C" int xdrstdio_create ();
-}
-int
-main (void)
-{
-return conftest::xdrstdio_create ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"
-then :
- ac_cv_lib_tirpc_xdrstdio_create=yes
-else $as_nop
- ac_cv_lib_tirpc_xdrstdio_create=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tirpc_xdrstdio_create" >&5
-printf "%s\n" "$ac_cv_lib_tirpc_xdrstdio_create" >&6; }
-if test "x$ac_cv_lib_tirpc_xdrstdio_create" = xyes
-then :
-
-printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
-
-else $as_nop
-
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libtirpc; XDR/V3D support disabled ***" >&5
-printf "%s\n" "$as_me: *** Could not find libtirpc; XDR/V3D support disabled ***" >&6;}
-
-fi
-
-
-else
-
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libtirpc; XDR/V3D support disabled ***" >&5
-printf "%s\n" "$as_me: *** Could not find libtirpc; XDR/V3D support disabled ***" >&6;}
-
-fi
-
-fi
-
-
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Broken rpc headers; XDR/V3D support disabled ***" >&5
-printf "%s\n" "$as_me: *** Broken rpc headers; XDR/V3D support disabled ***" >&6;}
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
- ;;
-esac
-fi
+# ------------------- GSL --------------------
# Check whether --enable-gsl was given.
if test ${enable_gsl+y}
@@ -8757,33 +8955,43 @@ fi
if test "x$enable_gsl" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=gsl "
+ printf "%s\n" "#define HAVE_LIBGSL 1" >>confdefs.h
-CPPFLAGS="$CPPFLAGS "`pkg-config --silence-errors --cflags gsl || echo`
+ LIBS=$LIBS"-lgsl " # gsl's pkg-config file is incomplete
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"gsl "
+else
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags gsl || echo)
-LDFLAGS="$LDFLAGS "`pkg-config --silence-errors --libs gsl || echo`
+
+LDFLAGS="$LDFLAGS "$(pkg-config --silence-errors --libs gsl || echo)
ac_fn_cxx_check_header_compile "$LINENO" "gsl/gsl_sf.h" "ac_cv_header_gsl_gsl_sf_h" "$ac_includes_default"
if test "x$ac_cv_header_gsl_gsl_sf_h" = xyes
then :
-PKG_FLAGS=" "`pkg-config --silence-errors --libs gsl || echo`
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs gsl || echo)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"gsl"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"gsl"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking gsl for function gsl_sf_debye_6... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking gsl for function gsl_sf_debye_6... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5
printf %s "checking for gsl_sf_debye_6 in -lgsl... " >&6; }
if test ${ac_cv_lib_gsl_gsl_sf_debye_6+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgsl $PKG_FLAGS $LIBS"
+LIBS="-lgsl $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8818,17 +9026,19 @@ printf "%s\n" "#define HAVE_LIBGSL 1" >>confdefs.h
else $as_nop
if test "x$enable_static" = "xyes"; then
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-{ ac_cv_lib_gsl_gsl_sf_debye_6=; unset ac_cv_lib_gsl_gsl_sf_debye_6;}
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_gsl_gsl_sf_debye_6=; unset ac_cv_lib_gsl_gsl_sf_debye_6;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for gsl_sf_debye_6 in -lgsl" >&5
printf %s "checking for gsl_sf_debye_6 in -lgsl... " >&6; }
if test ${ac_cv_lib_gsl_gsl_sf_debye_6+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgsl $PKG_FLAGS $LIBS"
+LIBS="-lgsl $PKG_FLAGS
+ $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -8862,21 +9072,20 @@ printf "%s\n" "#define HAVE_LIBGSL 1" >>confdefs.h
else $as_nop
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libgsl: will compile without optional special functions. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libgsl: will compile without optional special functions. ***" >&5
printf "%s\n" "$as_me: *** Could not find libgsl: will compile without optional special functions. ***" >&6;}
fi
-else
+ else
-LDFLAGS=$LDFLAGS_SAVE
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libgsl: will compile without optional special functions. ***" >&5
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libgsl: will compile without optional special functions. ***" >&5
printf "%s\n" "$as_me: *** Could not find libgsl: will compile without optional special functions. ***" >&6;}
-fi
-
+ fi
fi
@@ -8886,6 +9095,9 @@ printf "%s\n" "$as_me: *** Header file gsl_sf.h not found: will compile without
fi
fi
+fi
+
+# ----------------- OpenGL -----------------
# Check whether --enable-gl was given.
if test ${enable_gl+y}
@@ -8894,12 +9106,18 @@ then :
fi
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+if test "x$with_vcpkg" != "xno"; then
+ printf "%s\n" "#define HAVE_SSBO 1" >>confdefs.h
+ # SSBO/Compute shader check should be done at runtime, not at compilation
+ printf "%s\n" "#define HAVE_COMPUTE_SHADER 1" >>confdefs.h
+
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <GL/gl.h>
- #if !defined(GL_VERSION_4_3) && !defined(GL_ARB_shader_storage_buffer_object)
- #error
- #endif
+ #if !defined(GL_VERSION_4_3) && !defined(GL_ARB_shader_storage_buffer_object)
+ #error
+ #endif
int
main (void)
@@ -8917,12 +9135,12 @@ printf "%s\n" "#define HAVE_SSBO 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <GL/gl.h>
- #if !defined(GL_VERSION_4_3) && !defined(GL_ARB_compute_shader)
- #error
- #endif
+ #if !defined(GL_VERSION_4_3) && !defined(GL_ARB_compute_shader)
+ #error
+ #endif
int
main (void)
@@ -8939,6 +9157,9 @@ printf "%s\n" "#define HAVE_COMPUTE_SHADER 1" >>confdefs.h
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+# -------------- offscreen rendering
# Check whether --enable-offscreen was given.
if test ${enable_offscreen+y}
@@ -8947,27 +9168,59 @@ then :
fi
-# Check whether --enable-OpenImageIO was given.
-if test ${enable_OpenImageIO+y}
-then :
- enableval=$enable_OpenImageIO;
-fi
+# ----------- glm
+if test "x$with_vcpkg" != "xno"; then
+ printf "%s\n" "#define HAVE_LIBGLM 1" >>confdefs.h
-
- ac_fn_cxx_check_header_compile "$LINENO" "glm/glm.hpp" "ac_cv_header_glm_glm_hpp" "$ac_includes_default"
+ LIBS=$LIBS"-lglm "
+else
+ # glm is header only and is already on the include path
+ ac_fn_cxx_check_header_compile "$LINENO" "glm/glm.hpp" "ac_cv_header_glm_glm_hpp" "$ac_includes_default"
if test "x$ac_cv_header_glm_glm_hpp" = xyes
then :
printf "%s\n" "#define HAVE_LIBGLM 1" >>confdefs.h
+
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find glm header files: will compile without WebGL or OpenGL support ***" >&5
printf "%s\n" "$as_me: *** Could not find glm header files: will compile without WebGL or OpenGL support ***" >&6;}
+
+fi
+
fi
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Fetching from github: $TINYEXR_GITHUB_REPO@$TINYEXR_REF" >&5
+printf "%s\n" "$as_me: Fetching from github: $TINYEXR_GITHUB_REPO@$TINYEXR_REF" >&6;}
+ TINYEXR_ROOT=$EXTERNAL_CODE_ROOT/$TINYEXR_GITHUB_REPO
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Creating directory $TINYEXR_ROOT" >&5
+printf "%s\n" "$as_me: Creating directory $TINYEXR_ROOT" >&6;}
+ mkdir -p $TINYEXR_ROOT
+ curl -L https://github.com/$TINYEXR_GITHUB_REPO/archive/$TINYEXR_REF.tar.gz | tar -xz --strip-components=1 -C $TINYEXR_ROOT -f -
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Fetch successful" >&5
+printf "%s\n" "$as_me: Fetch successful" >&6;}
+
+INCL=$INCL"-I$TINYEXR_ROOT "
+
+
if test "x$enable_gl" != "xno"; then
- for ac_header in ncurses/curses.h ncurses.h curses.h
+if test "x$with_vcpkg" != "xno"; then # managed by vcpkg
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=opengl "
+
+printf "%s\n" "#define HAVE_GL 1" >>confdefs.h
+
+
+printf "%s\n" "#define FREEGLUT 1" >>confdefs.h
+
+
+printf "%s\n" "#define HAVE_LIBGLUT 1" >>confdefs.h
+
+ INCL=$INCL" -Ibackports/glew/include "
+ GLEW="glew.o "
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"glut "
+else # managed by the system
+ for ac_header in ncurses/curses.h ncurses.h curses.h
do :
as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -8980,131 +9233,21 @@ _ACEOF
fi
done
-if test "x$enable_openimageio" = "xyes"; then
- ac_fn_cxx_check_header_compile "$LINENO" "OpenEXR/ImathVec.h" "ac_cv_header_OpenEXR_ImathVec_h" "$ac_includes_default"
-if test "x$ac_cv_header_OpenEXR_ImathVec_h" = xyes
-then :
- ac_fn_cxx_check_header_compile "$LINENO" "OpenImageIO/imageio.h" "ac_cv_header_OpenImageIO_imageio_h" "$ac_includes_default"
-if test "x$ac_cv_header_OpenImageIO_imageio_h" = xyes
-then :
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for open in -lOpenImageIO" >&5
-printf %s "checking for open in -lOpenImageIO... " >&6; }
-if test ${ac_cv_lib_OpenImageIO_open+y}
+ for ac_header in ncurses/curses.h ncurses.h curses.h
+do :
+ as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_cxx_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"
then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lOpenImageIO $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-namespace conftest {
- extern "C" int open ();
-}
-int
-main (void)
-{
-return conftest::open ();
- ;
- return 0;
-}
+ cat >>confdefs.h <<_ACEOF
+#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
-if ac_fn_cxx_try_link "$LINENO"
-then :
- ac_cv_lib_OpenImageIO_open=yes
-else $as_nop
- ac_cv_lib_OpenImageIO_open=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_OpenImageIO_open" >&5
-printf "%s\n" "$ac_cv_lib_OpenImageIO_open" >&6; }
-if test "x$ac_cv_lib_OpenImageIO_open" = xyes
-then :
- printf "%s\n" "#define HAVE_LIBOPENIMAGEIO 1" >>confdefs.h
-
- LIBS="-lOpenImageIO $LIBS"
-
-fi
-
-fi
-
+ break
fi
-fi
+done
case "$OSTYPE" in
- msdos)
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GC_throw_bad_alloc in -lgccpp" >&5
-printf %s "checking for GC_throw_bad_alloc in -lgccpp... " >&6; }
-if test ${ac_cv_lib_gccpp_GC_throw_bad_alloc+y}
-then :
- printf %s "(cached) " >&6
-else $as_nop
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-lgccpp $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-namespace conftest {
- extern "C" int GC_throw_bad_alloc ();
-}
-int
-main (void)
-{
-return conftest::GC_throw_bad_alloc ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_cxx_try_link "$LINENO"
-then :
- ac_cv_lib_gccpp_GC_throw_bad_alloc=yes
-else $as_nop
- ac_cv_lib_gccpp_GC_throw_bad_alloc=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gccpp_GC_throw_bad_alloc" >&5
-printf "%s\n" "$ac_cv_lib_gccpp_GC_throw_bad_alloc" >&6; }
-if test "x$ac_cv_lib_gccpp_GC_throw_bad_alloc" = xyes
-then :
- printf "%s\n" "#define HAVE_LIBGCCPP 1" >>confdefs.h
-
- LIBS="-lgccpp $LIBS"
-
-fi
-
- ac_fn_cxx_check_header_compile "$LINENO" "GL/glut.h" "ac_cv_header_GL_glut_h" "$ac_includes_default"
-if test "x$ac_cv_header_GL_glut_h" = xyes
-then :
-
-printf "%s\n" "#define HAVE_LIBGLUT 1" >>confdefs.h
-
- LIBS=$LIBS"-lfreeglut "
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libfreeglut: will compile without OpenGL support ***" >&5
-printf "%s\n" "$as_me: *** Could not find libfreeglut: will compile without OpenGL support ***" >&6;}
-fi
-
- ac_fn_cxx_check_header_compile "$LINENO" "GL/gl.h" "ac_cv_header_GL_gl_h" "$ac_includes_default"
-if test "x$ac_cv_header_GL_gl_h" = xyes
-then :
-
-printf "%s\n" "#define HAVE_LIBGL 1" >>confdefs.h
-
- LIBS=$LIBS"-lopengl32 "
- GLEW="glew.o "
-else $as_nop
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libopengl32: will compile without OpenGL support ***" >&5
-printf "%s\n" "$as_me: *** Could not find libopengl32: will compile without OpenGL support ***" >&6;}
-fi
-
- ;;
darwin*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GC_throw_bad_alloc in -lgccpp" >&5
printf %s "checking for GC_throw_bad_alloc in -lgccpp... " >&6; }
@@ -9163,6 +9306,7 @@ then :
printf "%s\n" "#define HAVE_LIBGLUT 1" >>confdefs.h
LIBS=$LIBS"-framework GLUT -framework OpenGL -framework Cocoa "
+ INCL=$INCL" -Ibackports/glew/include "
GLEW="glew.o "
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find GLUT: will compile without OpenGLLUT support ***" >&5
@@ -9213,7 +9357,7 @@ then :
fi
- { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glutMainLoop in -lglut" >&5
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glutMainLoop in -lglut" >&5
printf %s "checking for glutMainLoop in -lglut... " >&6; }
if test ${ac_cv_lib_glut_glutMainLoop+y}
then :
@@ -9299,6 +9443,7 @@ printf "%s\n" "#define HAVE_LIBGL 1" >>confdefs.h
LIBS=$LIBS"-lGL "
GLEW="glew.o "
+ INCL=$INCL" -Ibackports/glew/include "
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for glXGetProcAddressARB in -lGLX" >&5
printf %s "checking for glXGetProcAddressARB in -lGLX... " >&6; }
if test ${ac_cv_lib_GLX_glXGetProcAddressARB+y}
@@ -9392,6 +9537,205 @@ fi
fi
fi
+fi
+
+# ------------------- VCPKG INSTALL
+
+if test "x$with_vcpkg" != "xno"; then
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: Running vcpkg install" >&5
+printf "%s\n" "$as_me: Running vcpkg install" >&6;}
+$vcpkg_exec install $VCPKG_INSTALL_ARGUMENTS
+
+LIBS=$LIBS"$(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --libs $VCPKG_LIBS_TO_USE_PKG_CONFIG) "
+CFLAGS=$CFLAGS" $(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --cflags-only-other $VCPKG_LIBS_TO_USE_PKG_CONFIG)"
+INCL=$INCL"$(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --cflags-only-I $VCPKG_LIBS_TO_USE_PKG_CONFIG) "
+fi
+
+# ----------------- xdr ------------------------
+# managed by the system here, unlike other packages
+
+# Check whether --enable-xdr was given.
+if test ${enable_xdr+y}
+then :
+ enableval=$enable_xdr;
+fi
+
+if test "x$enable_xdr" != "xno"; then
+case "$OSTYPE" in
+ darwin*)
+
+printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
+
+ ;;
+ *)
+
+CPPFLAGS="$CPPFLAGS "$(pkg-config --silence-errors --cflags libtirpc || echo)
+
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include "xstream.h"
+int
+main (void)
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"
+then :
+
+
+PKG_FLAGS=" "$(pkg-config --silence-errors --libs libtirpc || echo)
+
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"tirpc"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: Checking tirpc for function xdrstdio_create... PKG_FLAGS:$PKG_FLAGS" >&5
+printf "%s\n" "$as_me: Checking tirpc for function xdrstdio_create... PKG_FLAGS:$PKG_FLAGS" >&6;}
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xdrstdio_create in -ltirpc" >&5
+printf %s "checking for xdrstdio_create in -ltirpc... " >&6; }
+if test ${ac_cv_lib_tirpc_xdrstdio_create+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltirpc $PKG_FLAGS
+ $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+namespace conftest {
+ extern "C" int xdrstdio_create ();
+}
+int
+main (void)
+{
+return conftest::xdrstdio_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"
+then :
+ ac_cv_lib_tirpc_xdrstdio_create=yes
+else $as_nop
+ ac_cv_lib_tirpc_xdrstdio_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tirpc_xdrstdio_create" >&5
+printf "%s\n" "$ac_cv_lib_tirpc_xdrstdio_create" >&6; }
+if test "x$ac_cv_lib_tirpc_xdrstdio_create" = xyes
+then :
+
+printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
+
+else $as_nop
+ if test "x$enable_static" = "xyes"; then
+
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ { ac_cv_lib_tirpc_xdrstdio_create=; unset ac_cv_lib_tirpc_xdrstdio_create;}
+
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for xdrstdio_create in -ltirpc" >&5
+printf %s "checking for xdrstdio_create in -ltirpc... " >&6; }
+if test ${ac_cv_lib_tirpc_xdrstdio_create+y}
+then :
+ printf %s "(cached) " >&6
+else $as_nop
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ltirpc $PKG_FLAGS
+ $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+namespace conftest {
+ extern "C" int xdrstdio_create ();
+}
+int
+main (void)
+{
+return conftest::xdrstdio_create ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"
+then :
+ ac_cv_lib_tirpc_xdrstdio_create=yes
+else $as_nop
+ ac_cv_lib_tirpc_xdrstdio_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_tirpc_xdrstdio_create" >&5
+printf "%s\n" "$ac_cv_lib_tirpc_xdrstdio_create" >&6; }
+if test "x$ac_cv_lib_tirpc_xdrstdio_create" = xyes
+then :
+
+printf "%s\n" "#define HAVE_LIBTIRPC 1" >>confdefs.h
+
+else $as_nop
+
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libtirpc; XDR/V3D support disabled ***" >&5
+printf "%s\n" "$as_me: *** Could not find libtirpc; XDR/V3D support disabled ***" >&6;}
+
+
+fi
+
+
+ else
+
+ LDFLAGS=$LDFLAGS_SAVE
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Could not find libtirpc; XDR/V3D support disabled ***" >&5
+printf "%s\n" "$as_me: *** Could not find libtirpc; XDR/V3D support disabled ***" >&6;}
+
+
+ fi
+fi
+
+
+else $as_nop
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: *** Broken rpc headers; XDR/V3D support disabled ***" >&5
+printf "%s\n" "$as_me: *** Broken rpc headers; XDR/V3D support disabled ***" >&6;}
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+ ;;
+esac
+fi
+
+CPPFLAGS=$CPPFLAGS" $INCL"
+CXX_STANDARD=$cxxstd
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# we are on C++ >= 11, so unordered map is a guarantee
+
+printf "%s\n" "#define HAVE_UNORDERED_MAP 1" >>confdefs.h
+
# Checks for typedefs, structures, and compiler characteristics.
@@ -10064,11 +10408,10 @@ then :
fi
-ac_config_headers="$ac_config_headers config.h"
-
-
ac_config_files="$ac_config_files Makefile doc/Makefile doc/png/Makefile"
+ac_config_headers="$ac_config_headers config.h"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
@@ -10179,7 +10522,6 @@ LTLIBOBJS=$ac_ltlibobjs
-
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
@@ -10569,7 +10911,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by Asymptote $as_me 2.92, which was
+This file was extended by Asymptote $as_me 2.93, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -10633,7 +10975,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
-Asymptote config.status 2.92
+Asymptote config.status 2.93
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
@@ -10755,10 +11097,10 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
- "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;;
"doc/png/Makefile") CONFIG_FILES="$CONFIG_FILES doc/png/Makefile" ;;
+ "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -11346,7 +11688,7 @@ printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2
fi
-if test "x$GCDIR" != "x" ; then
+if test "x$with_vcpkg" = "xno" -a "x$GCDIR" != "x" ; then
as_ac_File=`printf "%s\n" "ac_cv_file_$GCDIR.tar.gz" | $as_tr_sh`
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $GCDIR.tar.gz" >&5
printf %s "checking for $GCDIR.tar.gz... " >&6; }
diff --git a/graphics/asymptote/configure.ac b/graphics/asymptote/configure.ac
index 25c2251c94..f8cef6a7dd 100644
--- a/graphics/asymptote/configure.ac
+++ b/graphics/asymptote/configure.ac
@@ -3,14 +3,22 @@
# this file.
AC_PREREQ(2)
-AC_INIT([Asymptote],[2.92],[https://github.com/vectorgraphics/asymptote/issues])
+AC_INIT([Asymptote],[2.93],[https://github.com/vectorgraphics/asymptote/issues])
VERSION=$PACKAGE_VERSION
AC_SUBST(VERSION)
m4_include([ax_pthread.m4])
m4_include([pkg.m4])
-AC_C_BIGENDIAN
+AH_TOP([#pragma once])
+
+AC_C_BIGENDIAN(
+ [AC_DEFINE(WORDS_BIGENDIAN,1,[Build is big endian])],
+ [],
+ [],
+ [AC_DEFINE(UNIVERSAL_ENDIAN_BUILD,1,[Endianness is determined at compile time])]
+)
AC_CANONICAL_HOST
+AC_CANONICAL_TARGET
test "$prefix" = NONE && prefix=/usr/local
Datadir=$datadir
@@ -20,18 +28,71 @@ AC_SUBST(Datadir)
AC_ARG_ENABLE(lsp,
[AS_HELP_STRING(--enable-lsp[[[=yes]]],enable Language Server Protocol)])
-if test "x$enable_lsp" != "xno"; then
-cxxstd="c++14"
-else
-cxxstd="c++11"
-AC_MSG_NOTICE([*** Language Server Protocol disabled by configure flag ***])
-fi
+cxxstd="c++17"
test "$CXXFLAGS" || CXXFLAGS="-std=$cxxstd"
echo Compiling with $CXXFLAGS
test "$CFLAGS" || CFLAGS="-g -O3"
+# --------------- external refs ---------------------------
+
+# we need LSP regardless
+EXTERNAL_CODE_ROOT=acextlibs
+EXTERNAL_BUILD_ROOT=acextbuilds
+
+LSP_GITHUB_REPO=vectorgraphics/LspCpp
+LSP_REF=master
+
+TINYEXR_GITHUB_REPO=syoyo/tinyexr
+TINYEXR_REF=v1.0.7
+#
+# FETCH_FROM_GITHUB(REPO,REF,OUT_VAR_SRC_DIRECTORY)
+AC_DEFUN([FETCH_FROM_GITHUB],[
+ AC_MSG_NOTICE([Fetching from github: $1@$2])
+ $3=$EXTERNAL_CODE_ROOT/$1
+ AC_MSG_NOTICE([Creating directory $$3])
+ mkdir -p $$3
+ curl -L https://github.com/$1/archive/$2.tar.gz | tar -xz --strip-components=1 -C $$3 -f -
+ AC_MSG_NOTICE([Fetch successful])
+])
+
+
+# --------------- begin vcpkg option/check ---------------------
+# result:
+# with_vcpkg is yes/no, depending if user wants to use vcpkg or not
+# vcpkg_exec is the executable of vcpkg. this is only given if use_vcpkg is yes.
+
+AC_ARG_WITH(vcpkg,[
+ AS_HELP_STRING(
+ --with-vcpkg=[[[no]]],
+ [Use vcpkg. If VCPKG_ROOT environment variable is set, will use that vcpkg. Otherwise searches in PATH.]
+ )
+],[
+ if test "x$VCPKG_ROOT" = "x"; then # vcpkg root not given
+ echo "VCPKG_ROOT is not given; searching vcpkg in path"
+ AC_CHECK_PROG(has_vcpkg,vcpkg,true)
+ if test "x$has_vcpkg" = "xtrue"; then
+ vcpkg_exec=vcpkg
+ fi
+ else
+ echo "VCPKG_ROOT is given; is using VCPKG_ROOT"
+ AC_CHECK_FILE($VCPKG_ROOT/vcpkg,[
+ vcpkg_exec=$VCPKG_ROOT/vcpkg
+ ])
+ fi
+
+ # ensure vcpkg is specified
+ if test "x$vcpkg_exec" = "x"; then
+ AC_MSG_ERROR([Please ensure vcpkg is available through VCPKG_ROOT or in PATH])
+ fi
+ echo "Using vcpkg executable $vcpkg_exec"
+],[
+with_vcpkg=no
+])
+
+#----------------- end vcpkg option check --------------------
+
AC_ARG_WITH(latex,
[AS_HELP_STRING(--with-latex=PATH,
specify path to LaTeX installation)],
@@ -137,98 +198,124 @@ if test "$GXX" = yes ; then
fi
AC_DEFUN([DEFINE],[
-Define to 1 if you have $1.
+Define to 1 if you have `$1`.
])
AC_DEFUN([DEFINE_LIB],[
-Define to 1 if you have the `$1' library (-l$1).
+Define to 1 if you have the `$1` library (-l$1).
])
-AC_CHECK_HEADER(tr1/unordered_map)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [#include <tr1/unordered_map>]
- [std::tr1::unordered_map<int,int> map;]
- )],
- AC_DEFINE(HAVE_TR1_UNORDERED_MAP,1,
- DEFINE([<tr1/unordered_map>])),
- [
- AC_CHECK_HEADER(unordered_map,AC_DEFINE(HAVE_UNORDERED_MAP,1,
- DEFINE([<unordered_map>])),
- [AC_CHECK_HEADER(ext/hash_map,,OPTIONS=$OPTIONS"-DNOHASH ")])])
-
ASYGLVERSION=1.02
-GCVERSION=8.2.4
-ATOMICVERSION=7.6.12
+DEFS=""
+OPTIONS=$OPTIONS"-D_FILE_OFFSET_BIS=64 "
+INCL="-I."
+OPTIONS=""
+LIBS=""
+
+# ------------- vcpkg initialization ---------------
+# vcpkg_triplet
+
+AC_ARG_WITH(vcpkg-target-triplet,
+ AS_HELP_STRING(
+ --with-vcpkg-target-triplet[[[=<target-triplet>]]],
+ [
+ specify custom vcpkg triplet. This option is only relevant if vcpkg is used.
+ If left blank, will try to determine the triplet
+ ]
+ ), [ # given
+ if test "x$with_vcpkg" != "xno" -a test "x$withval" != "xno"; then
+ vcpkg_triplet=$withval
+ fi
+ ],[ # not given
+ if test "x$with_vcpkg" != "xno"; then
+ case $target_cpu in
+ x86_64)
+ triplet_arch=x64
+ ;;
+ aarch64)
+ triplet_arch=arm64
+ ;;
+ i*86)
+ triplet_arch=x86
+ ;;
+ *)
+ AC_MSG_NOTICE([Cannot determine architecture, will leave triplet blank])
+ ;;
+ esac
+
+ case "$OSTYPE" in
+ darwin*)
+ triplet_os=osx
+ ;;
+ *)
+ triplet_os=linux
+ ;;
+ esac
+
+ if test "x$triplet_arch" != "x" -a "x$triplet_os" != "x"; then
+ vcpkg_triplet="${triplet_arch}-${triplet_os}"
+ AC_MSG_NOTICE([Determined vcpkg triplet as $vcpkg_triplet])
+ else
+ AC_MSG_ERROR([Cannot determine vcpkg triplet for usage])
+ fi
+ fi
+ ]
+)
+
+if test "x$with_vcpkg" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS="--triplet=$vcpkg_triplet "
+ VCPKG_PKG_CONFIG_LOC="vcpkg_installed/$vcpkg_triplet/lib/pkgconfig"
+ INCL=$INCL" -Ivcpkg_installed/$vcpkg_triplet/include "
+ LIBS=$LIBS" -Lvcpkg_installed/$vcpkg_triplet/lib "
+
+ VCPKG_LIBS_TO_USE_PKG_CONFIG=""
+ AC_DEFUN([ADD_VCPKG_LIB_FOR_PKGCONFIG],[VCPKG_LIBS_TO_USE_PKG_CONFIG=$VCPKG_LIBS_TO_USE_PKG_CONFIG"$1 "])
+ AC_DEFUN([ADD_VCPKG_FEATURE],[VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--x-feature=$1 "])
+fi
+
+AC_ARG_WITH(vcpkg-host-triplet,
+ AS_HELP_STRING(
+ --with-vcpkg-host-triplet[[[=<host-triplet>]]],
+ [
+ specify custom vcpkg host triplet. This option is only relevant if vcpkg is ued.
+ If left blank, will try to determine the triplet
+ ]
+ ), [ # given
+ if test "x$with_vcpkg" != "xno" -a test "x$withval" != "xno"; then
+ VCPKG_INSTALL_ARGUMENTS=$VCPKG_INSTALL_ARGUMENTS"--host-triplet=$withval "
+ fi
+ ],
+)
+
+
+# --------------- GC -------------------------------
+ATOMICVERSION=7.6.12
+GCVERSION=8.2.4
GCFILE=gc-$GCVERSION
ac_cv_use_gc="system"
AC_CHECK_FILE($GCFILE.tar.gz,
ac_cv_use_gc=$GCVERSION)
AC_ARG_ENABLE(gc,
- [AS_HELP_STRING(--enable-gc[[[=system]]],
-enable system Boehm garbage collector)]
- [ [[=VERSION]] enable local VERSION of Boehm garbage collector]
- [ [[=PREFIX]] use Boehm garbage collector installed in PREFIX],
- [
- if test "x$enableval" != "xyes" ; then
- ac_cv_use_gc=$enableval
- fi
- ])
-
-OPTIONS="-D_FILE_OFFSET_BIS=64 "
-GCLIB=
-GCPPLIB=
-INCL="-I."
-GCNAME="Boehm Garbage Collector"
-if test "x$ac_cv_use_gc" != "xno" ; then
- OPTIONS=$OPTIONS"-DUSEGC -DLSPCPP_USEGC "
- case _$ac_cv_use_gc in
- _|_system|_*[[\\/]]*)
- if test "x$ac_cv_use_gc" = "xsystem" ; then
- INCL="-I. -I$prefix/include/gc -I/usr/include/gc"
- LIBS=$LIBS"-L$prefix/lib "
- else
- INCL="-I$ac_cv_use_gc/include/gc"
- LIBS=$LIBS"-L$ac_cv_use_gc/lib "
+ [AS_HELP_STRING(--enable-gc[[[=system]]], enable system Boehm garbage collector)]
+ [ [[=VERSION]] enable local VERSION of Boehm garbage collector]
+ [ [[=PREFIX]] use Boehm garbage collector installed in PREFIX],
+ [ # if true
+ if test "x$enableval" != "xyes" ; then # system, no or else
+ ac_cv_use_gc=$enableval
fi
- CPPFLAGS_SAVE=$CPPFLAGS
- CPPFLAGS=$CPPFLAGS" $INCL"
- AC_CHECK_HEADER(gc.h,
- AC_CHECK_LIB([gc],[GC_malloc],[
- LIBS=$LIBS"-lgc "
- AC_MSG_NOTICE([enabling system $GCNAME])],[
- GCDIR=$GCFILE
- INCL="-I. -I\$(GC)/include"
- GCLIB="\$(GC)/.libs/libgc.a"
- AC_MSG_NOTICE($GCNAME library not found)]),
- GCDIR=$GCFILE
- GCLIB="\$(GC)/.libs/libgc.a"
- INCL="-I. -I\$(GC)/include"
- AC_MSG_NOTICE($GCNAME header file not found))
- CPPFLAGS=$CPPFLAGS_SAVE
- ;;
- *)
- GCVERSION=$ac_cv_use_gc
- GCFILE=gc-$GCVERSION
- GCDIR=$GCFILE
- AC_MSG_NOTICE([enabling local $GCNAME $GCDIR])
- GCLIB="\$(GC)/.libs/libgc.a"
- INCL="-I. -I\$(GC)/include"
- ;;
- esac
-else
- AC_MSG_NOTICE([disabling the $GCNAME])
-fi
+ ]
+)
AC_ARG_ENABLE(gc-debug,
[AS_HELP_STRING(--enable-gc-debug,enable (slow) garbage collector debugging)],
[ if test "x$ac_cv_use_gc" != "xno" ; then
if test "x$enableval" = "xyes" ; then
- OPTIONS=$OPTIONS"-DGC_DEBUG "
- AC_MSG_NOTICE([*** Enabling GC debugging: remember to make clean ***])
- AC_MSG_NOTICE([*** Set the environment variable GC_FIND_LEAK at runtime ***])
+ AC_DEFINE(GC_DEBUG,1,[GC Debug is enabled])
+ AC_MSG_NOTICE([*** Enabling GC debugging: remember to make clean ***])
+ AC_MSG_NOTICE([*** Set the environment variable GC_FIND_LEAK at runtime ***])
fi
fi
])
@@ -237,72 +324,168 @@ AC_ARG_ENABLE(gc-full-debug,
[AS_HELP_STRING(--enable-gc-full-debug,enable (very slow) garbage collector backtrace)],
[ if test "x$ac_cv_use_gc" != "xno" ; then
if test "x$enableval" = "xyes" ; then
- OPTIONS=$OPTIONS"-DGC_DEBUG -DGC_BACKTRACE "
- GCOPTIONS=$GCOPTIONS"--enable-gc-debug "
- AC_MSG_NOTICE([*** Enabling GC backtrace debugging; remember to make gc-clean ***])
+ AC_DEFINE(GC_DEBUG,1,[GC Debug is enabled])
+ AC_DEFINE(GC_BACKTRACE,1,[GC backtrace is enabled])
+ GCOPTIONS=$GCOPTIONS"--enable-gc-debug "
+ AC_MSG_NOTICE([*** Enabling GC backtrace debugging; remember to make gc-clean ***])
fi
fi
])
-if test "$OSTYPE" = "msdos"; then
-CPPFLAGS=$CPPFLAGS" -D__MSDOS__ -I/usr/include/w32api -I/usr/include -DCALLBACK=__stdcall $INCL"
+GCLIB=
+GCPPLIB=
+GCNAME="Boehm Garbage Collector"
+if test "x$ac_cv_use_gc" != "xno" ; then
+ AC_DEFINE(USEGC,1,[GC Enabled])
+ AC_DEFINE(LSPCPP_USEGC,1,[LSP GC enabled])
+ if test "x$with_vcpkg" != "xno"; then # managed by vcpkg
+ ADD_VCPKG_FEATURE(gc)
+ # The reason we are not using AC_CHECK_LIB is because
+ # we are not installing the dependencies until we collect all the features,
+ # hence the library files will not be available
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(bdw-gc)
+ LIBS=$LIBS"-lgccpp "
+ else # else, determine by prefix or system
+ case _$ac_cv_use_gc in
+ _|_system|_*[[\\/]]*)
+ if test "x$ac_cv_use_gc" = "xsystem" ; then
+ INCL=$INCL" -I$prefix/include/gc -I/usr/include/gc "
+ LIBS=$LIBS"-L$prefix/lib "
+ else
+ INCL=$INCL" -I$ac_cv_use_gc/include/gc "
+ LIBS=$LIBS"-L$ac_cv_use_gc/lib "
+ fi
+ CPPFLAGS_SAVE=$CPPFLAGS
+ CPPFLAGS=$CPPFLAGS" $INCL"
+ AC_CHECK_HEADER(gc.h,
+ AC_CHECK_LIB([gc],[GC_malloc],[
+ LIBS=$LIBS"-lgc "
+ AC_MSG_NOTICE([enabling system $GCNAME])],[
+ GCDIR=$GCFILE
+ INCL=$INCL" -I\$(GC)/include "
+ GCLIB="\$(GC)/.libs/libgc.a"
+ AC_MSG_NOTICE($GCNAME library not found)]),
+ GCDIR=$GCFILE
+ GCLIB="\$(GC)/.libs/libgc.a"
+ INCL=$INCL" -I\$(GC)/include "
+ AC_MSG_NOTICE($GCNAME header file not found))
+ CPPFLAGS=$CPPFLAGS_SAVE
+ ;;
+ *)
+ GCVERSION=$ac_cv_use_gc
+ GCFILE=gc-$GCVERSION
+ GCDIR=$GCFILE
+ AC_MSG_NOTICE([enabling local $GCNAME $GCDIR])
+ GCLIB="\$(GC)/.libs/libgc.a"
+ INCL=$INCL" -I\$(GC)/include "
+ ;;
+ esac
+ fi
else
-CPPFLAGS=$CPPFLAGS" $INCL"
+ AC_MSG_NOTICE([disabling the $GCNAME])
fi
-AC_CHECK_FUNC(getopt_long_only, AC_DEFINE(HAVE_GNU_GETOPT_H, 1,
- DEFINE([GNU <getopt.h>])),
- getopt="getopt getopt1",)
-AC_SUBST(getopt)
-AC_SUBST(GCVERSION)
-AC_SUBST(ASYGLVERSION)
-AC_SUBST(ATOMICVERSION)
-AC_SUBST(GCOPTIONS)
-AC_SUBST(GCLIB)
-AC_SUBST(GCPPLIB)
-AC_SUBST(LSPLIB)
-AC_SUBST(LSPLIBS)
-AC_SUBST(INCL)
-AC_SUBST(OPTIONS)
-AC_SUBST(GLEW)
+# -------------------------- end gc ------------------
# Checks for libraries.
#AC_SEARCH_LIBS([lgamma],[m c],,
#AC_MSG_ERROR([*** Please install libm on your system ***]))
-AC_CHECK_LIB([z], [deflate],,
-AC_MSG_ERROR([*** Please install libz or zlib-devel on your system ***]))
+
+# ----------------- zlib ----------------------------
+if test "x$with_vcpkg" != "xno"; then
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(zlib)
+else
+ AC_CHECK_LIB(
+ [z],
+ [deflate],
+ ,
+ AC_MSG_ERROR([*** Please install libz or zlib-devel on your system ***])
+ )
+fi
+AC_DEFINE(HAVE_ZLIB,1,[ZLib library present])
+
+# -------------- threads -------------------
+
GCOPTIONS="--disable-shared "
-AC_ARG_ENABLE(threads,
-[AS_HELP_STRING(--enable-threads[[[=yes]]],enable POSIX threads)])
+AC_ARG_ENABLE(
+ threads,
+ [AS_HELP_STRING(--enable-threads[[[=yes]]],enable POSIX threads)]
+)
if test "x$enable_threads" != "xno"; then
- AX_PTHREAD
+ if test "x$with_vcpkg" != "xno"; then
+ ADD_VCPKG_FEATURE(threading)
+ AC_DEFINE(HAVE_PTHREAD,1)
+ OPTIONS=$OPTIONS" -pthread"
+ else
+ AX_PTHREAD
+ fi
else
GCOPTIONS=$GCOPTIONS"--disable-threads "
fi
-AC_ARG_ENABLE(sigsegv,
-[AS_HELP_STRING(--enable-sigsegv[[[=yes]]],enable GNU Stack Overflow Handler)])
+# --------------- sigsegv ------------------------------
+
+if test "x$with_vcpkg" = "no"; then # I couldn't find sigsegv on vcpkg, so this is only enabled if
+ AC_ARG_ENABLE(sigsegv,
+ [AS_HELP_STRING(--enable-sigsegv[[[=yes]]],enable GNU Stack Overflow Handler)])
+
+ if test "x$enable_sigsegv" != "xno"; then
+ AC_CHECK_LIB([sigsegv], [stackoverflow_install_handler])
+ fi
-if test "x$enable_sigsegv" != "xno"; then
- AC_CHECK_LIB([sigsegv], [stackoverflow_install_handler])
+ AC_CHECK_LIB([rt], [sched_yield])
fi
-AC_CHECK_LIB([rt], [sched_yield])
+# ----------------- lsp -------------------------------
+
+# LSP is needed regardless of
+
+FETCH_FROM_GITHUB($LSP_GITHUB_REPO,$LSP_REF,LSP_ROOT)
+INCL=$INCL"-I$LSP_ROOT/include "
+AC_SUBST(LSP_ROOT)
LSPLIBS=
LSPLIB=
if test "x$enable_lsp" != "xno" -a "x$enable_threads" != "xno"; then
- AC_CHECK_LIB([boost_filesystem],[opendir],
- [AC_CHECK_LIB([boost_thread],[pthread_attr_getdetachstate],
- [AC_DEFINE(HAVE_LSP,1,DEFINE([Language server protocol]))
- LSPLIBS="-llspcpp -lnetwork-uri -lboost_filesystem -lboost_thread "
- LSPLIB=liblspcpp.a],
- AC_MSG_NOTICE([*** Could not find libboost_thread: will compile without optional Language Server Protocol. ***]))],
- AC_MSG_NOTICE([*** Could not find libboost_filesystem: will compile without optional Language Server Protocol. ***]))
+ LSP_BUILD_ROOT="$EXTERNAL_BUILD_ROOT/$LSP_GITHUB_REPO"
+ ROOT_DIR_RELATIVE_TO_LSP=$(realpath -s --relative-to $LSP_BUILD_ROOT .)
+ LSPLIB=$LSP_BUILD_ROOT/liblspcpp.a
+ LSPLIBS=$LSPLIBS" -L$LSP_BUILD_ROOT -L$LSP_BUILD_ROOT/third_party/uri/src -llspcpp -lnetwork-uri -lboost_filesystem -lboost_thread"
+ LSP_CMAKE_OPTIONS=
+
+ AC_DEFUN(ENABLE_LSP_MACRO,
+ AC_SUBST(ROOT_DIR_RELATIVE_TO_LSP)
+ AC_SUBST(LSP_CXX_BUILD_FLAGS)
+ AC_SUBST(LSP_CMAKE_OPTIONS)
+ AC_SUBST(LSP_BUILD_ROOT)
+ AC_DEFINE(HAVE_LSP,1,DEFINE([Language server protocol]))
+ )
+ if test "x$with_vcpkg" != "xno"; then
+ ADD_VCPKG_FEATURE(lsp)
+ RELATIVE_LSP_VCPKG_ROOT=$(realpath -s --relative-to=$LSP_BUILD_ROOT vcpkg_installed/$vcpkg_triplet)
+ LSP_CXX_BUILD_FLAGS=$LSP_BUILD_FLAGS"-I$RELATIVE_LSP_VCPKG_ROOT/include -L$RELATIVE_LSP_VCPKG_ROOT/lib "
+ LSP_CMAKE_OPTIONS="-DUSE_SYSTEM_RAPIDJSON=True -DCMAKE_PREFIX_PATH=\"$RELATIVE_LSP_VCPKG_ROOT\""
+ ENABLE_LSP_MACRO
+ else
+ AC_CHECK_LIB(
+ [boost_filesystem],[opendir],
+ [
+ AC_CHECK_LIB(
+ [boost_thread],[pthread_attr_getdetachstate],
+ [
+ ENABLE_LSP_MACRO
+ ],
+ AC_MSG_NOTICE([*** Could not find libboost_thread: will compile without optional Language Server Protocol. ***]))
+ ],
+ AC_MSG_NOTICE([*** Could not find libboost_filesystem: will compile without optional Language Server Protocol. ***])
+ )
+ fi
fi
+# ------------- arguments for readline & static linking ---
+
AC_ARG_ENABLE(readline,
[AS_HELP_STRING(--enable-readline[[[=yes]]],enable GNU Readline Library)])
@@ -316,6 +499,8 @@ if test "x$enable_static" = "xyes"; then
DYNAMIC="-Wl,-Bdynamic "
fi
+# ------------- readline & defines --------------------
+
AC_DEFUN([READLINE],[
AC_MSG_NOTICE([*** Could not find GNU readline 4.3 or later: will compile without readline support ***])
AC_CHECK_LIB([edit],[readline])
@@ -323,93 +508,140 @@ AC_CHECK_HEADERS(editline/readline.h)
])
AC_DEFUN([PKG_CONFIG],[
-ifdef([PKG_CHECK_MODULES],$1="$2 "`pkg-config --silence-errors $3 $4 || echo`,$1="$2 ")
+ifdef(
+ [PKG_CHECK_MODULES],
+ $1="$2 "$(pkg-config --silence-errors $3 $4 || echo),
+ $1="$2 "
+)
])
AC_DEFUN([CHECK_LIB_STATIC],[
-PKG_CONFIG(PKG_FLAGS,,--libs,$1)
-if test "x$PKG_FLAGS" == "x "; then
-PKG_FLAGS=-l"$2"
-echo will try linking with $PKG_FLAGS
-fi
-LDFLAGS_SAVE=$LDFLAGS
-LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
-AC_CHECK_LIB($2,$3,AC_DEFINE($4,1,DEFINE_LIB($2)),
-if test "x$enable_static" = "xyes"; then
-[
-echo "Static library not found; will check for dynamic version"
-LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
-AS_UNSET([ac_cv_lib_$2_$3])
-AC_CHECK_LIB($2,$3,AC_DEFINE($4,1,DEFINE_LIB($2)),
-[
-LDFLAGS=$LDFLAGS_SAVE
-$5
-],$PKG_FLAGS)
-]
-else
-[
-LDFLAGS=$LDFLAGS_SAVE
-$5
-]
-fi
-,$PKG_FLAGS)]
-)
+ PKG_CONFIG(PKG_FLAGS,,--libs,$1)
+ if test "x$PKG_FLAGS" == "x "; then
+ PKG_FLAGS=-l"$2"
+ echo will try linking with $PKG_FLAGS
+ fi
+ LDFLAGS_SAVE=$LDFLAGS
+ LDFLAGS="$LDFLAGS "$STATIC"$PKG_FLAGS "$DYNAMIC
+ AC_MSG_NOTICE([Checking $2 for function $3... PKG_FLAGS:$PKG_FLAGS])
+ AC_CHECK_LIB(
+ $2,$3,
+ AC_DEFINE($4,1,DEFINE_LIB($2)),
+ if test "x$enable_static" = "xyes"; then
+ [
+ echo "Static library not found; will check for dynamic version"
+ LDFLAGS="$LDFLAGS_SAVE ""$PKG_FLAGS "
+ AS_UNSET([ac_cv_lib_$2_$3])
+
+ AC_CHECK_LIB(
+ $2,$3,
+ AC_DEFINE($4,1,DEFINE_LIB($2)),
+ [
+ LDFLAGS=$LDFLAGS_SAVE
+ $5
+ ],
+ $PKG_FLAGS
+ )
+ ]
+ else
+ [
+ LDFLAGS=$LDFLAGS_SAVE
+ $5
+ ]
+ fi,
+ $PKG_FLAGS
+ )
+])
+# --------------- end readline ----------------
if test "x$enable_readline" != "xno"; then
-PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,readline)
-
-AC_COMPILE_IFELSE([
-AC_LANG_PROGRAM([
-#include <stdio.h>
-#include <unistd.h>
-#include <readline/readline.h>
-],[
-#ifndef RL_READLINE_VERSION
-abort
-#endif
-])],
-CHECK_LIB_STATIC(readline,readline,history_list,HAVE_LIBREADLINE,READLINE),
-READLINE)
-
-PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,tinfo)
-CHECK_LIB_STATIC(tinfo,tinfo,tgetent,HAVE_LIBTINFO,AC_MSG_NOTICE([perhaps tgetent is in -lncurses]))
-
-PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,ncurses)
-AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],[break])
-CHECK_LIB_STATIC(ncurses,ncurses,setupterm,HAVE_LIBCURSES,
- AC_CHECK_LIB(curses,setupterm))
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+ ADD_VCPKG_FEATURE(readline)
+ AC_DEFINE(HAVE_NCURSES_CURSES_H)
+ AC_DEFINE(HAVE_LIBCURSES)
+ AC_DEFINE(HAVE_LIBREADLINE)
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(readline)
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(ncurses)
+else # managed by the system
+ PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,readline)
+
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([
+ #include <stdio.h>
+ #include <unistd.h>
+ #include <readline/readline.h>
+ ],[
+ #ifndef RL_READLINE_VERSION
+ abort
+ #endif
+ ])],
+ CHECK_LIB_STATIC(readline,readline,history_list,HAVE_LIBREADLINE,READLINE),
+ READLINE)
+
+ PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,tinfo)
+ CHECK_LIB_STATIC(tinfo,tinfo,tgetent,HAVE_LIBTINFO,AC_MSG_NOTICE([perhaps tgetent is in -lncurses]))
+
+ PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,ncurses)
+ AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],[break])
+ CHECK_LIB_STATIC(ncurses,ncurses,setupterm,HAVE_LIBCURSES,
+ AC_CHECK_LIB(curses,setupterm))
fi
+fi
+
+# ---------------- curl ------------------------
AC_ARG_ENABLE(curl,
[AS_HELP_STRING(--enable-curl[[[=yes]]],enable libcurl and compile with optional URL support)])
if test "x$enable_curl" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then
+ ADD_VCPKG_FEATURE(curl)
+ AC_DEFINE(HAVE_LIBCURL)
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(libcurl)
+else
PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,curl)
AC_CHECK_HEADER(curl/curl.h,
CHECK_LIB_STATIC(libcurl,curl,curl_easy_init,HAVE_LIBCURL,
AC_MSG_NOTICE([*** Could not find libcurl: will compile without optional URL support. ***])),
AC_MSG_NOTICE([*** Header file curl.h not found: will compile without optional URL support. ***]))
+fi
else
AC_MSG_NOTICE([*** libcurl support disabled by configure flag: will compile without optional URL support. ***])
fi
+# --------------------- fftw -------------------------
+
AC_ARG_ENABLE(fftw,
[AS_HELP_STRING(--enable-fftw[[[=yes]]],enable FFTW Library)])
if test "x$enable_fftw" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+ADD_VCPKG_FEATURE(fftw3)
+AC_DEFINE(HAVE_LIBFFTW3)
+ADD_VCPKG_LIB_FOR_PKGCONFIG(fftw3)
+else # system managed
PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,fftw3)
AC_CHECK_HEADER(fftw3.h,
CHECK_LIB_STATIC(fftw3,fftw3,fftw_execute,HAVE_LIBFFTW3,
AC_MSG_NOTICE([*** Could not find libfftw3: will compile without optional fast Fourier transforms. ***])),
AC_MSG_NOTICE([*** Header file fftw3.h not found: will compile without optional fast Fourier transforms. ***]))
fi
+fi
+
+# ------------------- eigen -------------------------
AC_ARG_ENABLE(eigen,
[AS_HELP_STRING(--enable-eigen[[[=yes]]],enable Eigen Library)])
if test "x$enable_eigen" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then
+ADD_VCPKG_FEATURE(eigen3)
+AC_DEFINE(HAVE_EIGEN_DENSE)
+ADD_VCPKG_LIB_FOR_PKGCONFIG(eigen3)
+else
PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,eigen3)
AC_CHECK_HEADERS(Eigen/Dense)
fi
+fi
# Checks for header files.
AC_HEADER_SYS_WAIT
@@ -417,27 +649,18 @@ AC_CHECK_HEADERS([fenv.h stddef.h libintl.h])
AC_CHECK_HEADERS(fpu_control.h)
AC_CHECK_FUNCS([feenableexcept])
-AC_ARG_ENABLE(xdr,
-[AS_HELP_STRING(--enable-xdr[[[=yes]]],enable XDR/V3D support)])
-if test "x$enable_xdr" != "xno"; then
-case "$OSTYPE" in
- darwin*)
- AC_DEFINE(HAVE_LIBTIRPC,1,DEFINE_LIB([tirpc]))
- ;;
- *)
- PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,libtirpc)
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "xstream.h"])],
- CHECK_LIB_STATIC(libtirpc,tirpc,xdrstdio_create,
- HAVE_LIBTIRPC,AC_MSG_NOTICE([*** Could not find libtirpc; XDR/V3D support disabled ***])),
-AC_MSG_NOTICE([*** Broken rpc headers; XDR/V3D support disabled ***]))
- ;;
-esac
-fi
+# ------------------- GSL --------------------
AC_ARG_ENABLE(gsl,
[AS_HELP_STRING(--enable-gsl[[[=yes]]],enable GNU Scientific Library)])
if test "x$enable_gsl" != "xno"; then
+if test "x$with_vcpkg" != "xno"; then # vcpkg
+ ADD_VCPKG_FEATURE(gsl)
+ AC_DEFINE(HAVE_LIBGSL)
+ LIBS=$LIBS"-lgsl " # gsl's pkg-config file is incomplete
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(gsl)
+else
PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,gsl)
PKG_CONFIG(LDFLAGS,$LDFLAGS,--libs,gsl)
AC_CHECK_HEADER(gsl/gsl_sf.h,
@@ -445,59 +668,73 @@ if test "x$enable_gsl" != "xno"; then
AC_MSG_NOTICE([*** Could not find libgsl: will compile without optional special functions. ***])),
AC_MSG_NOTICE([*** Header file gsl_sf.h not found: will compile without optional special functions. ***]))
fi
+fi
+
+# ----------------- OpenGL -----------------
AC_ARG_ENABLE(gl,
[AS_HELP_STRING(--enable-gl[[[=yes]]],enable OpenGL Library)])
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [#include <GL/gl.h>]
- [#if !defined(GL_VERSION_4_3) && !defined(GL_ARB_shader_storage_buffer_object)]
- [#error]
- [#endif ]
- )],
- AC_DEFINE(HAVE_SSBO,1,DEFINE([GLSL shader storage buffer objects])))
-
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
- [#include <GL/gl.h>]
- [#if !defined(GL_VERSION_4_3) && !defined(GL_ARB_compute_shader)]
- [#error]
- [#endif ]
- )],
- AC_DEFINE(HAVE_COMPUTE_SHADER,1,DEFINE([GLSL compute shaders])))
+if test "x$with_vcpkg" != "xno"; then
+ AC_DEFINE(HAVE_SSBO,1) # SSBO/Compute shader check should be done at runtime, not at compilation
+ AC_DEFINE(HAVE_COMPUTE_SHADER,1)
+else
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [#include <GL/gl.h>]
+ [#if !defined(GL_VERSION_4_3) && !defined(GL_ARB_shader_storage_buffer_object)]
+ [#error]
+ [#endif ]
+ )],
+ AC_DEFINE(HAVE_SSBO,1,DEFINE([GLSL shader storage buffer objects])))
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [#include <GL/gl.h>]
+ [#if !defined(GL_VERSION_4_3) && !defined(GL_ARB_compute_shader)]
+ [#error]
+ [#endif ]
+ )],
+ AC_DEFINE(HAVE_COMPUTE_SHADER,1,DEFINE([GLSL compute shaders])))
+fi
+
+# -------------- offscreen rendering
AC_ARG_ENABLE(offscreen,
[AS_HELP_STRING(--enable-offscreen[[[=no]]],use OSMesa library to implement offscreen rendering)])
-AC_ARG_ENABLE(OpenImageIO,
-[AS_HELP_STRING(--enable-openimageio[[[=no]]],enable experimental OpenImageIO Library)])
+# ----------- glm
+if test "x$with_vcpkg" != "xno"; then
+ AC_DEFINE(HAVE_LIBGLM,1)
+ LIBS=$LIBS"-lglm "
+else
+ # glm is header only and is already on the include path
+ AC_CHECK_HEADER(
+ glm/glm.hpp,
+ [AC_DEFINE(
+ HAVE_LIBGLM,1,
+ DEFINE([the <glm/glm.hpp> header]))
+ ],
+ AC_MSG_NOTICE([*** Could not find glm header files: will compile without WebGL or OpenGL support ***])
+ )
+fi
- AC_CHECK_HEADER(glm/glm.hpp,
- [AC_DEFINE(HAVE_LIBGLM,1,
- DEFINE([the <glm/glm.hpp> header]))],AC_MSG_NOTICE([*** Could not find glm header files: will compile without WebGL or OpenGL support ***]))
+FETCH_FROM_GITHUB($TINYEXR_GITHUB_REPO,$TINYEXR_REF,TINYEXR_ROOT)
+INCL=$INCL"-I$TINYEXR_ROOT "
+AC_SUBST(TINYEXR_ROOT)
if test "x$enable_gl" != "xno"; then
- AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],[break])
-if test "x$enable_openimageio" = "xyes"; then
- AC_CHECK_HEADER([OpenEXR/ImathVec.h],
- AC_CHECK_HEADER([OpenImageIO/imageio.h],
- AC_CHECK_LIB([OpenImageIO],[open])))
-fi
+if test "x$with_vcpkg" != "xno"; then # managed by vcpkg
+ ADD_VCPKG_FEATURE(opengl)
+ AC_DEFINE(HAVE_GL,1,[OpenGL is enabled])
+ AC_DEFINE(FREEGLUT,1,[Freeglut is enabled])
+ AC_DEFINE(HAVE_LIBGLUT,1,[Freeglut library is available])
+ INCL=$INCL" -Ibackports/glew/include "
+ GLEW="glew.o "
+ ADD_VCPKG_LIB_FOR_PKGCONFIG(glut)
+else # managed by the system
+ AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],[break])
+ AC_CHECK_HEADERS([ncurses/curses.h ncurses.h curses.h],[break])
case "$OSTYPE" in
- msdos)
- AC_CHECK_LIB([gccpp],[GC_throw_bad_alloc])
- AC_CHECK_HEADER(GL/glut.h,
- [AC_DEFINE(HAVE_LIBGLUT,1,
- DEFINE_LIB[freeglut])
- LIBS=$LIBS"-lfreeglut "],
- AC_MSG_NOTICE([*** Could not find libfreeglut: will compile without OpenGL support ***]))
- AC_CHECK_HEADER(GL/gl.h,
- [AC_DEFINE(HAVE_LIBGL,1,
- DEFINE_LIB[opengl32])
- LIBS=$LIBS"-lopengl32 "
- GLEW="glew.o "],
- AC_MSG_NOTICE([*** Could not find libopengl32: will compile without OpenGL support ***]))
- ;;
darwin*)
AC_CHECK_LIB([gccpp],[GC_throw_bad_alloc])
AC_CHECK_HEADER(OpenGL/gl.h,
@@ -506,18 +743,20 @@ case "$OSTYPE" in
AC_CHECK_HEADER(GLUT/glut.h, [AC_DEFINE(HAVE_LIBGLUT,1,
DEFINE_LIB[GLUT])
LIBS=$LIBS"-framework GLUT -framework OpenGL -framework Cocoa "
+ INCL=$INCL" -Ibackports/glew/include "
GLEW="glew.o "],
AC_MSG_NOTICE([*** Could not find GLUT: will compile without OpenGLLUT support ***]))
;;
*)
AC_CHECK_LIB([gccpp],[GC_throw_bad_alloc])
- AC_CHECK_LIB([glut], [glutMainLoop],,
+ AC_CHECK_LIB([glut], [glutMainLoop],,
AC_MSG_NOTICE([*** Could not find libglut: will compile without OpenGL support ***]))
AC_CHECK_LIB([GL], [glDepthMask],
[AC_DEFINE(HAVE_LIBGL,1,
DEFINE_LIB([GL]))
LIBS=$LIBS"-lGL "
GLEW="glew.o "
+ INCL=$INCL" -Ibackports/glew/include "
AC_CHECK_LIB([GLX],[glXGetProcAddressARB],
GLEW=$GLEW"-lGLX ")],
AC_MSG_NOTICE([*** Could not find libGL: will compile without OpenGL support ***]))
@@ -527,6 +766,63 @@ esac
AC_MSG_NOTICE([*** Could not find libOSMesa: will compile without offscreen rendering support ***]))
fi
fi
+fi
+
+# ------------------- VCPKG INSTALL
+
+if test "x$with_vcpkg" != "xno"; then
+AC_MSG_NOTICE([Running vcpkg install])
+$vcpkg_exec install $VCPKG_INSTALL_ARGUMENTS
+
+LIBS=$LIBS"$(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --libs $VCPKG_LIBS_TO_USE_PKG_CONFIG) "
+CFLAGS=$CFLAGS" $(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --cflags-only-other $VCPKG_LIBS_TO_USE_PKG_CONFIG)"
+INCL=$INCL"$(PKG_CONFIG_PATH=$VCPKG_PKG_CONFIG_LOC pkg-config --cflags-only-I $VCPKG_LIBS_TO_USE_PKG_CONFIG) "
+fi
+
+# ----------------- xdr ------------------------
+# managed by the system here, unlike other packages
+
+AC_ARG_ENABLE(xdr,
+[AS_HELP_STRING(--enable-xdr[[[=yes]]],enable XDR/V3D support)])
+if test "x$enable_xdr" != "xno"; then
+case "$OSTYPE" in
+ darwin*)
+ AC_DEFINE(HAVE_LIBTIRPC,1,DEFINE_LIB([tirpc]))
+ ;;
+ *)
+ PKG_CONFIG(CPPFLAGS,$CPPFLAGS,--cflags,libtirpc)
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([#include "xstream.h"])],
+ CHECK_LIB_STATIC(libtirpc,tirpc,xdrstdio_create,
+ HAVE_LIBTIRPC,
+ AC_MSG_NOTICE([*** Could not find libtirpc; XDR/V3D support disabled ***])
+ ),
+ AC_MSG_NOTICE([*** Broken rpc headers; XDR/V3D support disabled ***])
+ )
+ ;;
+esac
+fi
+
+CPPFLAGS=$CPPFLAGS" $INCL"
+CXX_STANDARD=$cxxstd
+
+AC_SUBST(getopt)
+AC_SUBST(GCVERSION)
+AC_SUBST(ASYGLVERSION)
+AC_SUBST(ATOMICVERSION)
+AC_SUBST(GCOPTIONS)
+AC_SUBST(GCLIB)
+AC_SUBST(GCPPLIB)
+AC_SUBST(LSPLIB)
+AC_SUBST(LSPLIBS)
+AC_SUBST(INCL)
+AC_SUBST(CXX_STANDARD)
+AC_SUBST(DEFS)
+AC_SUBST(OPTIONS)
+AC_SUBST(GLEW)
+
+# we are on C++ >= 11, so unordered map is a guarantee
+AC_DEFINE(HAVE_UNORDERED_MAP,1,[Unordered map is present])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_PID_T
@@ -547,12 +843,11 @@ AC_FUNC_FSEEKO
AC_CHECK_FUNCS(strptime)
AC_CHECK_FUNCS(strnlen)
-AC_CONFIG_HEADERS(config.h)
-
AC_CONFIG_FILES([Makefile doc/Makefile doc/png/Makefile])
+AC_CONFIG_HEADERS([config.h])
AC_OUTPUT
-if test "x$GCDIR" != "x" ; then
+if test "x$with_vcpkg" = "xno" -a "x$GCDIR" != "x" ; then
AC_CHECK_FILE($GCDIR.tar.gz,,[
echo
echo Please put the Boehm garbage collector tar.gz files in the asymptote directory.
diff --git a/graphics/asymptote/cudareflect/CMakeLists.txt b/graphics/asymptote/cudareflect/CMakeLists.txt
new file mode 100644
index 0000000000..f8ae4f5ac8
--- /dev/null
+++ b/graphics/asymptote/cudareflect/CMakeLists.txt
@@ -0,0 +1,29 @@
+cmake_minimum_required(VERSION 3.26)
+
+project(asy-cudareflect CXX CUDA)
+
+add_executable(
+ reflect
+ main.cc
+ EXRFiles.cc
+ kernel.cu ReflectanceMapper.cu
+)
+
+# C++17 standard is derived from CMakeLists.txt.
+set(CMAKE_CUDA_STANDARD 17)
+set(CMAKE_CUDA_STANDARD_REQUIRED ON)
+
+include(FindCUDAToolkit REQUIRED)
+
+target_include_directories(reflect PRIVATE ${CMAKE_CURRENT_LIST_DIR})
+
+set(ASY_REFLECT_LIBRARIES tinyexr-impl glm::glm CUDA::cudart)
+
+if (WIN32)
+ list(APPEND ASY_REFLECT_LIBRARIES unofficial::getopt-win32::getopt)
+endif()
+
+target_link_libraries(
+ reflect
+ PRIVATE ${ASY_REFLECT_LIBRARIES}
+) \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/IrradianceGenerator.sln b/graphics/asymptote/cudareflect/IrradianceGenerator.sln
deleted file mode 100644
index eee523873a..0000000000
--- a/graphics/asymptote/cudareflect/IrradianceGenerator.sln
+++ /dev/null
@@ -1,25 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.31613.86
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "IrradianceGenerator", "IrradianceGenerator.vcxproj", "{0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|x64 = Debug|x64
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}.Debug|x64.ActiveCfg = Debug|x64
- {0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}.Debug|x64.Build.0 = Debug|x64
- {0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}.Release|x64.ActiveCfg = Release|x64
- {0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {849A0D9E-0CAB-48D8-954B-D97F29D1C539}
- EndGlobalSection
-EndGlobal
diff --git a/graphics/asymptote/cudareflect/IrradianceGenerator.vcxproj b/graphics/asymptote/cudareflect/IrradianceGenerator.vcxproj
deleted file mode 100644
index 08c8855e0e..0000000000
--- a/graphics/asymptote/cudareflect/IrradianceGenerator.vcxproj
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <ItemGroup>
- <CudaCompile Include="kernel.cu" />
- <CudaCompile Include="ReflectanceMapper.cu" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="EXRFiles.cc" />
- <ClCompile Include="main.cc" />
- <ClCompile Include="tinyexr.cc" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="common.h" />
- <ClInclude Include="EXRFiles.h" />
- <ClInclude Include="helper.cuh" />
- <ClInclude Include="include\tinyexr\tinyexr.h">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</DeploymentContent>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- <DeploymentContent Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</DeploymentContent>
- </ClInclude>
- <ClInclude Include="kernel.h" />
- <ClInclude Include="ReflectanceMapper.cuh" />
- <ClInclude Include="simpson.cuh" />
- <ClInclude Include="utils.cuh" />
- </ItemGroup>
- <ItemGroup>
- <None Include=".gitignore" />
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{0043AE31-F6A1-47CB-8A80-1DA6E2C049DF}</ProjectGuid>
- <RootNamespace>IrradianceGenerator</RootNamespace>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>v142</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <WholeProgramOptimization>true</WholeProgramOptimization>
- <CharacterSet>Unicode</CharacterSet>
- <PlatformToolset>v142</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- <Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 11.4.props" />
- </ImportGroup>
- <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>Disabled</Optimization>
- <LanguageStandard>stdcpp17</LanguageStandard>
- <PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <AdditionalDependencies>cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- <CudaCompile>
- <TargetMachinePlatform>64</TargetMachinePlatform>
- <CudaRuntime>Shared</CudaRuntime>
- <GenerateRelocatableDeviceCode>false</GenerateRelocatableDeviceCode>
- </CudaCompile>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <ClCompile>
- <WarningLevel>Level3</WarningLevel>
- <Optimization>MaxSpeed</Optimization>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <LanguageStandard>stdcpp17</LanguageStandard>
- <PreprocessorDefinitions>DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
- </ClCompile>
- <Link>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <OptimizeReferences>true</OptimizeReferences>
- <SubSystem>Console</SubSystem>
- <AdditionalDependencies>cudart_static.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- </Link>
- <CudaCompile>
- <TargetMachinePlatform>64</TargetMachinePlatform>
- <GPUDebugInfo>true</GPUDebugInfo>
- <CudaRuntime>Shared</CudaRuntime>
- <GenerateRelocatableDeviceCode>false</GenerateRelocatableDeviceCode>
- </CudaCompile>
- </ItemDefinitionGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- <Import Project="$(VCTargetsPath)\BuildCustomizations\CUDA 11.4.targets" />
- </ImportGroup>
- <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
- </Target>
-</Project> \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/Makefile b/graphics/asymptote/cudareflect/Makefile
index ebb7833ffd..328b1ca308 100644
--- a/graphics/asymptote/cudareflect/Makefile
+++ b/graphics/asymptote/cudareflect/Makefile
@@ -6,15 +6,13 @@ NVCC = nvcc
INCL=-I/usr/local/cuda/include
NVCCFLAGS = -O3 -Xcudafe --diag_suppress=esa_on_defaulted_function_ignored
-FILES = main tinyexr EXRFiles
+FILES = main EXRFiles
CUDA_FILES = kernel ReflectanceMapper
CUDA_LIBS = -lcudart -lz
all: $(FILES:=.o) $(CUDA_FILES:=.o)
$(NVCC) $(NVCCFLAGS) -o reflect $(FILES:=.o) $(CUDA_FILES:=.o) $(CUDA_LIBS)
-tinyexr.o: tinyexr/tinyexr.h
-
.SUFFIXES: .c .cc .cu .o .d
.cc.o:
$(CXX) $(CFLAGS) $(INCL) -o $@ -c $<
diff --git a/graphics/asymptote/cudareflect/common.h b/graphics/asymptote/cudareflect/common.h
index 9758e7ac40..9494a719d1 100644
--- a/graphics/asymptote/cudareflect/common.h
+++ b/graphics/asymptote/cudareflect/common.h
@@ -11,4 +11,4 @@
#include <sstream>
#define TINYEXR_USE_THREAD 1
-#include "tinyexr/tinyexr.h" \ No newline at end of file
+#include <tinyexr.h> \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/tinyexr.cc b/graphics/asymptote/cudareflect/tinyexr.cc
deleted file mode 100644
index 37d45de42d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-/**
-* @file tinyexr.cc
-* @brief An implementation object file for tinyexr mandated by the repository.
-*
-* On Windows, use vcpkg to install zlib instead of nuget. On Linux, this should work naturally
-*/
-
-#include <zlib.h>
-
-#define TINYEXR_IMPLEMENTATION
-#define TINYEXR_USE_MINIZ 0
-#define TINYEXR_USE_THREAD 1
-#define TINYEXR_USE_PIZ 1
-
-#include "tinyexr/tinyexr.h" \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/tinyexr/CMakeLists.txt b/graphics/asymptote/cudareflect/tinyexr/CMakeLists.txt
deleted file mode 100644
index 6d03e7e193..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/CMakeLists.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-# this cmake file is for compile tests.
-# Not usable for your cmake app.
-cmake_minimum_required(VERSION 3.5)
-
-set(BUILD_TARGET "tinyexr")
-set(SAMPLE_TARGET "test_tinyexr")
-
-project(${BUILD_TARGET} CXX)
-
-# options
-option(TINYEXR_BUILD_SAMPLE "Build a sample" ON)
-option(TINYEXR_USE_MINIZ "Use miniz" ON)
-
-# cmake modules
-list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
-list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/sanitizers)
-find_package(Sanitizers) # Address sanitizer (-DSANITIZE_ADDRESS=ON)
-
-# Require strict C++11 mode(e.g. `-std=c++11`)
-set(CMAKE_CXX_STANDARD 11)
-set(CMAKE_CXX_STANDARD_REQUIRED ON)
-set(CMAKE_CXX_EXTENSIONS OFF)
-
-set_property(GLOBAL PROPERTY USE_FOLDERS ON)
-
-set(TINYEXR_SOURCES
- ${PROJECT_SOURCE_DIR}/tinyexr.cc
- )
-
-if(TINYEXR_USE_MINIZ)
- enable_language(C)
- add_library(miniz STATIC deps/miniz/miniz.c)
- target_include_directories(miniz PUBLIC deps/miniz)
- set_target_properties(miniz PROPERTIES FOLDER "deps")
- list(APPEND TINYEXR_EXT_LIBRARIES miniz)
-endif()
-
-add_library(${BUILD_TARGET} ${TINYEXR_SOURCES} ${TINYEXR_DEP_SOURCES})
-add_sanitizers(${BUILD_TARGET})
-
-target_include_directories(${BUILD_TARGET} PRIVATE ${PROJECT_SOURCE_DIR})
-target_link_libraries(${BUILD_TARGET} ${TINYEXR_EXT_LIBRARIES} ${CMAKE_DL_LIBS})
-
-# Increase warning level for clang.
-IF (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
- set_source_files_properties(${TINYEXR_SOURCES} PROPERTIES COMPILE_FLAGS "-Weverything -Werror -Wno-padded -Wno-c++98-compat-pedantic -Wno-documentation -Wno-unused-member-function")
-ENDIF ()
-
-if (TINYEXR_BUILD_SAMPLE)
-
- set(TINYEXR_SAMPLE_SOURCES
- ${PROJECT_SOURCE_DIR}/test_tinyexr.cc
- )
-
- add_executable(${SAMPLE_TARGET} ${TINYEXR_SAMPLE_SOURCES})
- target_link_libraries(${SAMPLE_TARGET} ${TINYEXR_EXT_LIBRARIES})
- add_sanitizers(${SAMPLE_TARGET})
- if (WIN32)
- target_compile_definitions(${SAMPLE_TARGET} PUBLIC UNICODE)
- target_compile_definitions(${SAMPLE_TARGET} PUBLIC _UNICODE)
-
- # Set ${SAMPLE_TARGET} as a startup project for VS IDE
- set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${SAMPLE_TARGET})
-
- # For easier debugging in VS IDE(cmake 3.8.0 or later required) Set working
- # directory to ${BUILD_TARGET} git repo root.
- if(CMAKE_VERSION VERSION_GREATER 3.8.0)
- set_target_properties(${SAMPLE_TARGET}
- PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY
- "${CMAKE_CURRENT_SOURCE_DIR}")
- endif()
- endif(WIN32)
-
-endif (TINYEXR_BUILD_SAMPLE)
diff --git a/graphics/asymptote/cudareflect/tinyexr/Makefile b/graphics/asymptote/cudareflect/tinyexr/Makefile
deleted file mode 100644
index 8e54d7ede2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/Makefile
+++ /dev/null
@@ -1,25 +0,0 @@
-#CXX ?= clang++
-#CXXFLAGS ?= -fsanitize=address -Werror -Wall -Wextra -g -O0 -DTINYEXR_USE_MINIZ=0 -DTINYEXR_USE_PIZ=0
-#LDFLAGS ?= -lz
-
-# ZFP
-#CXXFLAGS += -DTINYEXR_USE_ZFP=1 -I./deps/ZFP/inc
-#LDFLAGS += -L./deps/ZFP/lib -lzfp
-
-CFLAGS += -I./deps/miniz
-CXXFLAGS += -I./deps/miniz
-
-.PHONY: test clean
-
-all: miniz.o
- $(CXX) $(CXXFLAGS) -o test_tinyexr test_tinyexr.cc miniz.o $(LDFLAGS)
-
-miniz.o:
- $(CC) $(CFLAGS) -c ./deps/miniz/miniz.c
-
-test:
- ./test_tinyexr asakusa.exr
-
-clean:
- rm -rf test_tinyexr miniz.o
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw b/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw
deleted file mode 100644
index 44e86ed244..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw
+++ /dev/null
@@ -1,18 +0,0 @@
-#CXX ?= clang++
-#CXXFLAGS ?= -fsanitize=address -Werror -Wall -Wextra -g -O0 -DTINYEXR_USE_MINIZ=0 -DTINYEXR_USE_PIZ=0
-#LDFLAGS ?= -lz
-
-CXX=x86_64-w64-mingw32-g++
-
-# ZFP
-#CXXFLAGS += -DTINYEXR_USE_ZFP=1 -I./deps/ZFP/inc
-#LDFLAGS += -L./deps/ZFP/lib -lzfp
-
-all:
- $(CC) $(CFLAGS) -c ./deps/miniz/miniz.c
- $(CXX) $(CXXFLAGS) -I./deps/miniz -o test_tinyexr test_tinyexr.cc miniz.o $(LDFLAGS)
-
-test:
- ./test_tinyexr asakusa.exr
-
-.PHONY: test
diff --git a/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw-msys b/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw-msys
deleted file mode 100644
index 28af0e89ae..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/Makefile.gcc-mingw-msys
+++ /dev/null
@@ -1,16 +0,0 @@
-#CXX ?= clang++
-#CXXFLAGS ?= -fsanitize=address -Werror -Wall -Wextra -g -O0 -DTINYEXR_USE_MINIZ=0 -DTINYEXR_USE_PIZ=0
-#LDFLAGS ?= -lz
-
-CXX=g++
-# -municode is not yet implemented
-CXXFLAGS=-DUNICODE -D_UNICODE -mwindows
-
-all:
- $(CC) $(CFLAGS) -I./deps/miniz ./deps/miniz.c
- $(CXX) $(CXXFLAGS) -I./deps/miniz -o test_tinyexr test_tinyexr.cc miniz.o $(LDFLAGS)
-
-test:
- ./test_tinyexr asakusa.exr
-
-.PHONY: test
diff --git a/graphics/asymptote/cudareflect/tinyexr/Makefile.llvm-mingw b/graphics/asymptote/cudareflect/tinyexr/Makefile.llvm-mingw
deleted file mode 100644
index aff5444e1e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/Makefile.llvm-mingw
+++ /dev/null
@@ -1,25 +0,0 @@
-#CXX ?= clang++
-#CXXFLAGS ?= -fsanitize=address -Werror -Wall -Wextra -g -O0 -DTINYEXR_USE_MINIZ=0 -DTINYEXR_USE_PIZ=0
-#LDFLAGS ?= -lz
-
-CC=clang
-CXX=clang++
-
-# ZFP
-#CXXFLAGS += -DTINYEXR_USE_ZFP=1 -I./deps/ZFP/inc
-#LDFLAGS += -L./deps/ZFP/lib -lzfp
-
-CXXFLAGS += -DTINYEXR_USE_MINIZ=1 -I./deps/miniz
-CFLAGS += -DTINYEXR_USE_MINIZ=1 -I./deps/miniz
-
-# miniz
-miniz.o:
- $(CC) $(CFLAGS) -c ./deps/miniz.c
-#
-all: miniz.o
- $(CXX) $(CXXFLAGS) -o test_tinyexr test_tinyexr.cc miniz.o $(LDFLAGS)
-
-test:
- ./test_tinyexr asakusa.exr
-
-.PHONY: test
diff --git a/graphics/asymptote/cudareflect/tinyexr/README.md b/graphics/asymptote/cudareflect/tinyexr/README.md
deleted file mode 100644
index 92c766a76f..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/README.md
+++ /dev/null
@@ -1,568 +0,0 @@
-# Tiny OpenEXR image library.
-
-[![Total alerts](https://img.shields.io/lgtm/alerts/g/syoyo/tinyexr.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/syoyo/tinyexr/alerts/)
-
-![Example](https://github.com/syoyo/tinyexr/blob/master/asakusa.png?raw=true)
-
-[![AppVeyor build status](https://ci.appveyor.com/api/projects/status/k07ftfe4ph057qau/branch/master?svg=true)](https://ci.appveyor.com/project/syoyo/tinyexr/branch/master)
-
-[![Travis build Status](https://travis-ci.org/syoyo/tinyexr.svg)](https://travis-ci.org/syoyo/tinyexr)
-
-[![Coverity Scan Build Status](https://scan.coverity.com/projects/5827/badge.svg)](https://scan.coverity.com/projects/5827)
-
-`tinyexr` is a small, single header-only library to load and save OpenEXR (.exr) images.
-`tinyexr` is written in portable C++ (no library dependency except for STL), thus `tinyexr` is good to embed into your application.
-To use `tinyexr`, simply copy `tinyexr.h`, `miniz.c` and `miniz.h`(for zlib. You can use system-installed zlib instead of miniz. Controlled with `TINYEXR_USE_MINIZ` compile flag) into your project.
-
-# Features
-
-Current status of `tinyexr` is:
-
-- OpenEXR v1 image
- - [x] Scanline format
- - [x] Tiled format
- - [x] Tile format with no LoD (load).
- - [x] Tile format with LoD (load).
- - [x] Tile format with no LoD (save).
- - [x] Tile format with LoD (save).
- - [x] Custom attributes
-- OpenEXR v2 image
- - [ ] Multipart format
- - [x] Load multi-part image
- - [x] Save multi-part image
- - [ ] Load multi-part deep image
- - [ ] Save multi-part deep image
-- OpenEXR v2 deep image
- - [x] Loading scanline + ZIPS + HALF or FLOAT pixel type.
-- Compression
- - [x] NONE
- - [x] RLE
- - [x] ZIP
- - [x] ZIPS
- - [x] PIZ
- - [x] ZFP (tinyexr extension)
- - [ ] B44?
- - [ ] B44A?
- - [ ] PIX24?
-- Line order.
- - [x] Increasing, decreasing (load)
- - [ ] Random?
- - [x] Increasing (save)
- - [ ] decreasing (save)
-- Pixel format (UINT, FLOAT).
- - [x] UINT, FLOAT (load)
- - [x] UINT, FLOAT (deep load)
- - [x] UINT, FLOAT (save)
- - [ ] UINT, FLOAT (deep save)
-- Support for big endian machine.
- - [x] Loading scanline image
- - [x] Saving scanline image
- - [x] Loading multi-part channel EXR (not tested)
- - [x] Saving multi-part channel EXR (not tested)
- - [ ] Loading deep image
- - [ ] Saving deep image
-- Optimization
- - [x] C++11 thread loading
- - [ ] C++11 thread saving
- - [ ] ISPC?
- - [x] OpenMP multi-threading in EXR loading.
- - [x] OpenMP multi-threading in EXR saving.
- - [ ] OpenMP multi-threading in deep image loading.
- - [ ] OpenMP multi-threading in deep image saving.
-* C interface.
- * You can easily write language bindings (e.g. golang)
-
-# Supported platform
-
-* [x] x86-64
- * [x] Windows 7 or later
- * [x] Linux(posix) system
- * [x] macOS
-* [x] AARCH64
- * [x] aarch64 linux(e.g. Raspberry Pi)
- * [x] Android
- * [x] iOS
- * [x] macOS
-* [ ] RISC-V(Should work)
-* [x] Big endian machine(not maintained, but should work)
- * SPARC, PowerPC, ...
-* [x] WebAssembly(JavaScript)
- * Loader only(See ![js](experimental/js/))
-* [x] Python binding
- * Loader only https://pypi.org/project/pytinyexr/
-
-# Requirements
-
-* C++ compiler(C++11 recommended. C++03 may work)
-
-# Use case
-
-## New TinyEXR (v0.9.5+)
-
-* Godot. Multi-platform 2D and 3D game engine https://godotengine.org/
-* Filament. PBR engine(used in a converter tool). https://github.com/google/filament
-* PyEXR. Loading OpenEXR (.exr) images using Python. https://github.com/ialhashim/PyEXR
-* The-Forge. The Forge Cross-Platform Rendering Framework PC, Linux, Ray Tracing, macOS / iOS, Android, XBOX, PS4 https://github.com/ConfettiFX/The-Forge
-* Your project here!
-
-## Older TinyEXR (v0.9.0)
-
-* mallie https://github.com/lighttransport/mallie
-* Cinder 0.9.0 https://libcinder.org/notes/v0.9.0
-* Piccante (develop branch) http://piccantelib.net/
-* Your project here!
-
-## Examples
-
-* [examples/deepview/](examples/deepview) Deep image view
-* [examples/rgbe2exr/](examples/rgbe2exr) .hdr to EXR converter
-* [examples/exr2rgbe/](examples/exr2rgbe) EXR to .hdr converter
-* [examples/ldr2exr/](examples/exr2rgbe) LDR to EXR converter
-* [examples/exr2ldr/](examples/exr2ldr) EXR to LDR converter
-* [examples/exr2fptiff/](examples/exr2fptiff) EXR to 32bit floating point TIFF converter
- * for 32bit floating point TIFF to EXR convert, see https://github.com/syoyo/tinydngloader/tree/master/examples/fptiff2exr
-* [examples/cube2longlat/](examples/cube2longlat) Cubemap to longlat (equirectangler) converter
-
-## Experimental
-
-* [experimental/js/](experimental/js) JavaScript port using Emscripten
-
-## Usage
-
-NOTE: **API is still subject to change**. See the source code for details.
-
-Include `tinyexr.h` with `TINYEXR_IMPLEMENTATION` flag (do this only for **one** .cc file).
-
-```cpp
-//Please include your own zlib-compatible API header before
-//including `tinyexr.h` when you disable `TINYEXR_USE_MINIZ`
-//#define TINYEXR_USE_MINIZ 0
-//#include "zlib.h"
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-```
-
-### Compile flags
-
-* `TINYEXR_USE_MINIZ` Use miniz (default = 1). Please include `zlib.h` header before `tinyexr.h` if you disable miniz support(e.g. use system's zlib).
-* `TINYEXR_USE_PIZ` Enable PIZ compression support (default = 1)
-* `TINYEXR_USE_ZFP` Enable ZFP compression supoort (TinyEXR extension, default = 0)
-* `TINYEXR_USE_THREAD` Enable threaded loading using C++11 thread (Requires C++11 compiler, default = 0)
-* `TINYEXR_USE_OPENMP` Enable OpenMP threading support (default = 1 if `_OPENMP` is defined)
- * Use `TINYEXR_USE_OPENMP=0` to force disable OpenMP code path even if OpenMP is available/enabled in the compiler.
-
-### Quickly reading RGB(A) EXR file.
-
-```cpp
- const char* input = "asakusa.exr";
- float* out; // width * height * RGBA
- int width;
- int height;
- const char* err = NULL; // or nullptr in C++11
-
- int ret = LoadEXR(&out, &width, &height, input, &err);
-
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- fprintf(stderr, "ERR : %s\n", err);
- FreeEXRErrorMessage(err); // release memory of error message.
- }
- } else {
- ...
- free(out); // release memory of image data
- }
-
-```
-
-### Reading layered RGB(A) EXR file.
-
-If you want to read EXR image with layer info (channel has a name with delimiter `.`), please use `LoadEXRWithLayer` API.
-
-You need to know layer name in advance (e.g. through `EXRLayers` API).
-
-```cpp
- const char* input = ...;
- const char* layer_name = "diffuse"; // or use EXRLayers to get list of layer names in .exr
- float* out; // width * height * RGBA
- int width;
- int height;
- const char* err = NULL; // or nullptr in C++11
-
- // will read `diffuse.R`, `diffuse.G`, `diffuse.B`, (`diffuse.A`) channels
- int ret = LoadEXRWithLayer(&out, &width, &height, input, layer_name, &err);
-
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- fprintf(stderr, "ERR : %s\n", err);
- FreeEXRErrorMessage(err); // release memory of error message.
- }
- } else {
- ...
- free(out); // release memory of image data
- }
-
-```
-
-### Loading Singlepart EXR from a file.
-
-Scanline and tiled format are supported.
-
-```cpp
- // 1. Read EXR version.
- EXRVersion exr_version;
-
- int ret = ParseEXRVersionFromFile(&exr_version, argv[1]);
- if (ret != 0) {
- fprintf(stderr, "Invalid EXR file: %s\n", argv[1]);
- return -1;
- }
-
- if (exr_version.multipart) {
- // must be multipart flag is false.
- return -1;
- }
-
- // 2. Read EXR header
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
-
- const char* err = NULL; // or `nullptr` in C++11 or later.
- ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, argv[1], &err);
- if (ret != 0) {
- fprintf(stderr, "Parse EXR err: %s\n", err);
- FreeEXRErrorMessage(err); // free's buffer for an error message
- return ret;
- }
-
- // // Read HALF channel as FLOAT.
- // for (int i = 0; i < exr_header.num_channels; i++) {
- // if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) {
- // exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
- // }
- // }
-
- EXRImage exr_image;
- InitEXRImage(&exr_image);
-
- ret = LoadEXRImageFromFile(&exr_image, &exr_header, argv[1], &err);
- if (ret != 0) {
- fprintf(stderr, "Load EXR err: %s\n", err);
- FreeEXRHeader(&exr_header);
- FreeEXRErrorMessage(err); // free's buffer for an error message
- return ret;
- }
-
- // 3. Access image data
- // `exr_image.images` will be filled when EXR is scanline format.
- // `exr_image.tiled` will be filled when EXR is tiled format.
-
- // 4. Free image data
- FreeEXRImage(&exr_image);
- FreeEXRHeader(&exr_header);
-```
-
-### Loading Multipart EXR from a file.
-
-Scanline and tiled format are supported.
-
-```cpp
- // 1. Read EXR version.
- EXRVersion exr_version;
-
- int ret = ParseEXRVersionFromFile(&exr_version, argv[1]);
- if (ret != 0) {
- fprintf(stderr, "Invalid EXR file: %s\n", argv[1]);
- return -1;
- }
-
- if (!exr_version.multipart) {
- // must be multipart flag is true.
- return -1;
- }
-
- // 2. Read EXR headers in the EXR.
- EXRHeader **exr_headers; // list of EXRHeader pointers.
- int num_exr_headers;
- const char *err = NULL; // or nullptr in C++11 or later
-
- // Memory for EXRHeader is allocated inside of ParseEXRMultipartHeaderFromFile,
- ret = ParseEXRMultipartHeaderFromFile(&exr_headers, &num_exr_headers, &exr_version, argv[1], &err);
- if (ret != 0) {
- fprintf(stderr, "Parse EXR err: %s\n", err);
- FreeEXRErrorMessage(err); // free's buffer for an error message
- return ret;
- }
-
- printf("num parts = %d\n", num_exr_headers);
-
-
- // 3. Load images.
-
- // Prepare array of EXRImage.
- std::vector<EXRImage> images(num_exr_headers);
- for (int i =0; i < num_exr_headers; i++) {
- InitEXRImage(&images[i]);
- }
-
- ret = LoadEXRMultipartImageFromFile(&images.at(0), const_cast<const EXRHeader**>(exr_headers), num_exr_headers, argv[1], &err);
- if (ret != 0) {
- fprintf(stderr, "Parse EXR err: %s\n", err);
- FreeEXRErrorMessage(err); // free's buffer for an error message
- return ret;
- }
-
- printf("Loaded %d part images\n", num_exr_headers);
-
- // 4. Access image data
- // `exr_image.images` will be filled when EXR is scanline format.
- // `exr_image.tiled` will be filled when EXR is tiled format.
-
- // 5. Free images
- for (int i =0; i < num_exr_headers; i++) {
- FreeEXRImage(&images.at(i));
- }
-
- // 6. Free headers.
- for (int i =0; i < num_exr_headers; i++) {
- FreeEXRHeader(exr_headers[i]);
- free(exr_headers[i]);
- }
- free(exr_headers);
-```
-
-
-Saving Scanline EXR file.
-
-```cpp
- // See `examples/rgbe2exr/` for more details.
- bool SaveEXR(const float* rgb, int width, int height, const char* outfilename) {
-
- EXRHeader header;
- InitEXRHeader(&header);
-
- EXRImage image;
- InitEXRImage(&image);
-
- image.num_channels = 3;
-
- std::vector<float> images[3];
- images[0].resize(width * height);
- images[1].resize(width * height);
- images[2].resize(width * height);
-
- // Split RGBRGBRGB... into R, G and B layer
- for (int i = 0; i < width * height; i++) {
- images[0][i] = rgb[3*i+0];
- images[1][i] = rgb[3*i+1];
- images[2][i] = rgb[3*i+2];
- }
-
- float* image_ptr[3];
- image_ptr[0] = &(images[2].at(0)); // B
- image_ptr[1] = &(images[1].at(0)); // G
- image_ptr[2] = &(images[0].at(0)); // R
-
- image.images = (unsigned char**)image_ptr;
- image.width = width;
- image.height = height;
-
- header.num_channels = 3;
- header.channels = (EXRChannelInfo *)malloc(sizeof(EXRChannelInfo) * header.num_channels);
- // Must be (A)BGR order, since most of EXR viewers expect this channel order.
- strncpy(header.channels[0].name, "B", 255); header.channels[0].name[strlen("B")] = '\0';
- strncpy(header.channels[1].name, "G", 255); header.channels[1].name[strlen("G")] = '\0';
- strncpy(header.channels[2].name, "R", 255); header.channels[2].name[strlen("R")] = '\0';
-
- header.pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- header.requested_pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- for (int i = 0; i < header.num_channels; i++) {
- header.pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
- header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_HALF; // pixel type of output image to be stored in .EXR
- }
-
- const char* err = NULL; // or nullptr in C++11 or later.
- int ret = SaveEXRImageToFile(&image, &header, outfilename, &err);
- if (ret != TINYEXR_SUCCESS) {
- fprintf(stderr, "Save EXR err: %s\n", err);
- FreeEXRErrorMessage(err); // free's buffer for an error message
- return ret;
- }
- printf("Saved exr file. [ %s ] \n", outfilename);
-
- free(rgb);
-
- free(header.channels);
- free(header.pixel_types);
- free(header.requested_pixel_types);
-
- }
-```
-
-
-Reading deep image EXR file.
-See `example/deepview` for actual usage.
-
-```cpp
- const char* input = "deepimage.exr";
- const char* err = NULL; // or nullptr
- DeepImage deepImage;
-
- int ret = LoadDeepEXR(&deepImage, input, &err);
-
- // access to each sample in the deep pixel.
- for (int y = 0; y < deepImage.height; y++) {
- int sampleNum = deepImage.offset_table[y][deepImage.width-1];
- for (int x = 0; x < deepImage.width-1; x++) {
- int s_start = deepImage.offset_table[y][x];
- int s_end = deepImage.offset_table[y][x+1];
- if (s_start >= sampleNum) {
- continue;
- }
- s_end = (s_end < sampleNum) ? s_end : sampleNum;
- for (int s = s_start; s < s_end; s++) {
- float val = deepImage.image[depthChan][y][s];
- ...
- }
- }
- }
-
-```
-
-### deepview
-
-`examples/deepview` is simple deep image viewer in OpenGL.
-
-![DeepViewExample](https://github.com/syoyo/tinyexr/blob/master/examples/deepview/deepview_screencast.gif?raw=true)
-
-## TinyEXR extension
-
-### ZFP
-
-#### NOTE
-
-TinyEXR adds ZFP compression as an experimemtal support (Linux and MacOSX only).
-
-ZFP only supports FLOAT format pixel, and its image width and height must be the multiple of 4, since ZFP compresses pixels with 4x4 pixel block.
-
-#### Setup
-
-Checkout zfp repo as an submodule.
-
- $ git submodule update --init
-
-#### Build
-
-Then build ZFP
-
- $ cd deps/ZFP
- $ mkdir -p lib # Create `lib` directory if not exist
- $ make
-
-Set `1` to `TINYEXT_USE_ZFP` define in `tinyexr.h`
-
-Build your app with linking `deps/ZFP/lib/libzfp.a`
-
-#### ZFP attribute
-
-For ZFP EXR image, the following attribute must exist in its EXR image.
-
-* `zfpCompressionType` (uchar).
- * 0 = fixed rate compression
- * 1 = precision based variable rate compression
- * 2 = accuracy based variable rate compression
-
-And the one of following attributes must exist in EXR, depending on the `zfpCompressionType` value.
-
-* `zfpCompressionRate` (double)
- * Specifies compression rate for fixed rate compression.
-* `zfpCompressionPrecision` (int32)
- * Specifies the number of bits for precision based variable rate compression.
-* `zfpCompressionTolerance` (double)
- * Specifies the tolerance value for accuracy based variable rate compression.
-
-#### Note on ZFP compression.
-
-At least ZFP code itself works well on big endian machine.
-
-## Unit tests
-
-See `test/unit` directory.
-
-## TODO
-
-Contribution is welcome!
-
-- [ ] Compression
- - [ ] B44?
- - [ ] B44A?
- - [ ] PIX24?
-- [ ] Custom attributes
- - [x] Normal image (EXR 1.x)
- - [ ] Deep image (EXR 2.x)
-- [ ] JavaScript library (experimental, using Emscripten)
- - [x] LoadEXRFromMemory
- - [ ] SaveMultiChannelEXR
- - [ ] Deep image save/load
-- [ ] Write from/to memory buffer.
- - [ ] Deep image save/load
-- [ ] Tile format.
- - [x] Tile format with no LoD (load).
- - [ ] Tile format with LoD (load).
- - [ ] Tile format with no LoD (save).
- - [ ] Tile format with LoD (save).
-- [ ] Support for custom compression type.
- - [x] zfp compression (Not in OpenEXR spec, though)
- - [ ] zstd?
-- [x] Multi-channel.
-- [ ] Multi-part (EXR2.0)
- - [x] Load multi-part image
- - [ ] Load multi-part deep image
-- [ ] Line order.
- - [x] Increasing, decreasing (load)
- - [ ] Random?
- - [ ] Increasing, decreasing (save)
-- [ ] Pixel format (UINT, FLOAT).
- - [x] UINT, FLOAT (load)
- - [x] UINT, FLOAT (deep load)
- - [x] UINT, FLOAT (save)
- - [ ] UINT, FLOAT (deep save)
-- [ ] Support for big endian machine.
- - [ ] Loading multi-part channel EXR
- - [ ] Saving multi-part channel EXR
- - [ ] Loading deep image
- - [ ] Saving deep image
-- [ ] Optimization
- - [ ] ISPC?
- - [x] OpenMP multi-threading in EXR loading.
- - [x] OpenMP multi-threading in EXR saving.
- - [ ] OpenMP multi-threading in deep image loading.
- - [ ] OpenMP multi-threading in deep image saving.
-
-## Python bindings
-
-`pytinyexr` is available: https://pypi.org/project/pytinyexr/ (loading only as of 0.9.1)
-
-## Similar or related projects
-
-* miniexr: https://github.com/aras-p/miniexr (Write OpenEXR)
-* stb_image_resize.h: https://github.com/nothings/stb (Good for HDR image resizing)
-
-## License
-
-3-clause BSD
-
-`tinyexr` uses miniz, which is developed by Rich Geldreich <richgel99@gmail.com>, and licensed under public domain.
-
-`tinyexr` tools uses stb, which is licensed under public domain: https://github.com/nothings/stb
-`tinyexr` uses some code from OpenEXR, which is licensed under 3-clause BSD license.
-
-## Author(s)
-
-Syoyo Fujita (syoyo@lighttransport.com)
-
-## Contributor(s)
-
-* Matt Ebb (http://mattebb.com): deep image example. Thanks!
-* Matt Pharr (http://pharr.org/matt/): Testing tinyexr with OpenEXR(IlmImf). Thanks!
-* Andrew Bell (https://github.com/andrewfb) & Richard Eakin (https://github.com/richardeakin): Improving TinyEXR API. Thanks!
-* Mike Wong (https://github.com/mwkm): ZIPS compression support in loading. Thanks!
diff --git a/graphics/asymptote/cudareflect/tinyexr/appveyor.yml b/graphics/asymptote/cudareflect/tinyexr/appveyor.yml
deleted file mode 100644
index c63267fe8b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/appveyor.yml
+++ /dev/null
@@ -1,13 +0,0 @@
-version: 0.9.{build}
-
-platform: x64
-configuration: Release
-
-before_build:
- - echo running cmake...
- - cd test
- - cmake -G "Visual Studio 12 Win64" -Bbuild -H..
-
-build:
- parallel: true
- project: C:\projects\tinyexr\test\build\tinyexr.sln
diff --git a/graphics/asymptote/cudareflect/tinyexr/asakusa.exr b/graphics/asymptote/cudareflect/tinyexr/asakusa.exr
deleted file mode 100644
index ae7f38ad34..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/asakusa.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/asakusa.png b/graphics/asymptote/cudareflect/tinyexr/asakusa.png
deleted file mode 100644
index 7183d5f01c..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/asakusa.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindASan.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindASan.cmake
deleted file mode 100644
index 98ea7cb311..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindASan.cmake
+++ /dev/null
@@ -1,59 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-option(SANITIZE_ADDRESS "Enable AddressSanitizer for sanitized targets." Off)
-
-set(FLAG_CANDIDATES
- # Clang 3.2+ use this version. The no-omit-frame-pointer option is optional.
- "-g -fsanitize=address -fno-omit-frame-pointer"
- "-g -fsanitize=address"
-
- # Older deprecated flag for ASan
- "-g -faddress-sanitizer"
-)
-
-
-if (SANITIZE_ADDRESS AND (SANITIZE_THREAD OR SANITIZE_MEMORY))
- message(FATAL_ERROR "AddressSanitizer is not compatible with "
- "ThreadSanitizer or MemorySanitizer.")
-endif ()
-
-
-include(sanitize-helpers)
-
-if (SANITIZE_ADDRESS)
- sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "AddressSanitizer"
- "ASan")
-
- find_program(ASan_WRAPPER "asan-wrapper" PATHS ${CMAKE_MODULE_PATH})
- mark_as_advanced(ASan_WRAPPER)
-endif ()
-
-function (add_sanitize_address TARGET)
- if (NOT SANITIZE_ADDRESS)
- return()
- endif ()
-
- sanitizer_add_flags(${TARGET} "AddressSanitizer" "ASan")
-endfunction ()
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindMSan.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindMSan.cmake
deleted file mode 100644
index 22d0050e97..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindMSan.cmake
+++ /dev/null
@@ -1,57 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-option(SANITIZE_MEMORY "Enable MemorySanitizer for sanitized targets." Off)
-
-set(FLAG_CANDIDATES
- "-g -fsanitize=memory"
-)
-
-
-include(sanitize-helpers)
-
-if (SANITIZE_MEMORY)
- if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
- message(WARNING "MemorySanitizer disabled for target ${TARGET} because "
- "MemorySanitizer is supported for Linux systems only.")
- set(SANITIZE_MEMORY Off CACHE BOOL
- "Enable MemorySanitizer for sanitized targets." FORCE)
- elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
- message(WARNING "MemorySanitizer disabled for target ${TARGET} because "
- "MemorySanitizer is supported for 64bit systems only.")
- set(SANITIZE_MEMORY Off CACHE BOOL
- "Enable MemorySanitizer for sanitized targets." FORCE)
- else ()
- sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "MemorySanitizer"
- "MSan")
- endif ()
-endif ()
-
-function (add_sanitize_memory TARGET)
- if (NOT SANITIZE_MEMORY)
- return()
- endif ()
-
- sanitizer_add_flags(${TARGET} "MemorySanitizer" "MSan")
-endfunction ()
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindSanitizers.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindSanitizers.cmake
deleted file mode 100644
index 101bab8439..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindSanitizers.cmake
+++ /dev/null
@@ -1,94 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-# If any of the used compiler is a GNU compiler, add a second option to static
-# link against the sanitizers.
-option(SANITIZE_LINK_STATIC "Try to link static against sanitizers." Off)
-
-
-
-
-set(FIND_QUIETLY_FLAG "")
-if (DEFINED Sanitizers_FIND_QUIETLY)
- set(FIND_QUIETLY_FLAG "QUIET")
-endif ()
-
-find_package(ASan ${FIND_QUIETLY_FLAG})
-find_package(TSan ${FIND_QUIETLY_FLAG})
-find_package(MSan ${FIND_QUIETLY_FLAG})
-find_package(UBSan ${FIND_QUIETLY_FLAG})
-
-
-
-
-function(sanitizer_add_blacklist_file FILE)
- if(NOT IS_ABSOLUTE ${FILE})
- set(FILE "${CMAKE_CURRENT_SOURCE_DIR}/${FILE}")
- endif()
- get_filename_component(FILE "${FILE}" REALPATH)
-
- sanitizer_check_compiler_flags("-fsanitize-blacklist=${FILE}"
- "SanitizerBlacklist" "SanBlist")
-endfunction()
-
-function(add_sanitizers ...)
- # If no sanitizer is enabled, return immediately.
- if (NOT (SANITIZE_ADDRESS OR SANITIZE_MEMORY OR SANITIZE_THREAD OR
- SANITIZE_UNDEFINED))
- return()
- endif ()
-
- foreach (TARGET ${ARGV})
- # Check if this target will be compiled by exactly one compiler. Other-
- # wise sanitizers can't be used and a warning should be printed once.
- get_target_property(TARGET_TYPE ${TARGET} TYPE)
- if (TARGET_TYPE STREQUAL "INTERFACE_LIBRARY")
- message(WARNING "Can't use any sanitizers for target ${TARGET}, "
- "because it is an interface library and cannot be "
- "compiled directly.")
- return()
- endif ()
- sanitizer_target_compilers(${TARGET} TARGET_COMPILER)
- list(LENGTH TARGET_COMPILER NUM_COMPILERS)
- if (NUM_COMPILERS GREATER 1)
- message(WARNING "Can't use any sanitizers for target ${TARGET}, "
- "because it will be compiled by incompatible compilers. "
- "Target will be compiled without sanitizers.")
- return()
-
- # If the target is compiled by no or no known compiler, give a warning.
- elseif (NUM_COMPILERS EQUAL 0)
- message(WARNING "Sanitizers for target ${TARGET} may not be"
- " usable, because it uses no or an unknown compiler. "
- "This is a false warning for targets using only "
- "object lib(s) as input.")
- endif ()
-
- # Add sanitizers for target.
- add_sanitize_address(${TARGET})
- add_sanitize_thread(${TARGET})
- add_sanitize_memory(${TARGET})
- add_sanitize_undefined(${TARGET})
- endforeach ()
-endfunction(add_sanitizers)
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindTSan.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindTSan.cmake
deleted file mode 100644
index 3cba3c03b6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindTSan.cmake
+++ /dev/null
@@ -1,65 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-option(SANITIZE_THREAD "Enable ThreadSanitizer for sanitized targets." Off)
-
-set(FLAG_CANDIDATES
- "-g -fsanitize=thread"
-)
-
-
-# ThreadSanitizer is not compatible with MemorySanitizer.
-if (SANITIZE_THREAD AND SANITIZE_MEMORY)
- message(FATAL_ERROR "ThreadSanitizer is not compatible with "
- "MemorySanitizer.")
-endif ()
-
-
-include(sanitize-helpers)
-
-if (SANITIZE_THREAD)
- if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND
- NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
- message(WARNING "ThreadSanitizer disabled for target ${TARGET} because "
- "ThreadSanitizer is supported for Linux systems and macOS only.")
- set(SANITIZE_THREAD Off CACHE BOOL
- "Enable ThreadSanitizer for sanitized targets." FORCE)
- elseif (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8)
- message(WARNING "ThreadSanitizer disabled for target ${TARGET} because "
- "ThreadSanitizer is supported for 64bit systems only.")
- set(SANITIZE_THREAD Off CACHE BOOL
- "Enable ThreadSanitizer for sanitized targets." FORCE)
- else ()
- sanitizer_check_compiler_flags("${FLAG_CANDIDATES}" "ThreadSanitizer"
- "TSan")
- endif ()
-endif ()
-
-function (add_sanitize_thread TARGET)
- if (NOT SANITIZE_THREAD)
- return()
- endif ()
-
- sanitizer_add_flags(${TARGET} "ThreadSanitizer" "TSan")
-endfunction ()
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindUBSan.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindUBSan.cmake
deleted file mode 100644
index ae103f7172..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/FindUBSan.cmake
+++ /dev/null
@@ -1,46 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-option(SANITIZE_UNDEFINED
- "Enable UndefinedBehaviorSanitizer for sanitized targets." Off)
-
-set(FLAG_CANDIDATES
- "-g -fsanitize=undefined"
-)
-
-
-include(sanitize-helpers)
-
-if (SANITIZE_UNDEFINED)
- sanitizer_check_compiler_flags("${FLAG_CANDIDATES}"
- "UndefinedBehaviorSanitizer" "UBSan")
-endif ()
-
-function (add_sanitize_undefined TARGET)
- if (NOT SANITIZE_UNDEFINED)
- return()
- endif ()
-
- sanitizer_add_flags(${TARGET} "UndefinedBehaviorSanitizer" "UBSan")
-endfunction ()
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/asan-wrapper b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/asan-wrapper
deleted file mode 100644
index 5d54103372..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/asan-wrapper
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/sh
-
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-# This script is a wrapper for AddressSanitizer. In some special cases you need
-# to preload AddressSanitizer to avoid error messages - e.g. if you're
-# preloading another library to your application. At the moment this script will
-# only do something, if we're running on a Linux platform. OSX might not be
-# affected.
-
-
-# Exit immediately, if platform is not Linux.
-if [ "$(uname)" != "Linux" ]
-then
- exec $@
-fi
-
-
-# Get the used libasan of the application ($1). If a libasan was found, it will
-# be prepended to LD_PRELOAD.
-libasan=$(ldd $1 | grep libasan | sed "s/^[[:space:]]//" | cut -d' ' -f1)
-if [ -n "$libasan" ]
-then
- if [ -n "$LD_PRELOAD" ]
- then
- export LD_PRELOAD="$libasan:$LD_PRELOAD"
- else
- export LD_PRELOAD="$libasan"
- fi
-fi
-
-# Execute the application.
-exec $@
diff --git a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/sanitize-helpers.cmake b/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/sanitize-helpers.cmake
deleted file mode 100644
index 3649b07423..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/cmake/sanitizers/sanitize-helpers.cmake
+++ /dev/null
@@ -1,177 +0,0 @@
-# The MIT License (MIT)
-#
-# Copyright (c)
-# 2013 Matthew Arsenault
-# 2015-2016 RWTH Aachen University, Federal Republic of Germany
-#
-# 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.
-
-# Helper function to get the language of a source file.
-function (sanitizer_lang_of_source FILE RETURN_VAR)
- get_filename_component(LONGEST_EXT "${FILE}" EXT)
- # If extension is empty return. This can happen for extensionless headers
- if("${LONGEST_EXT}" STREQUAL "")
- set(${RETURN_VAR} "" PARENT_SCOPE)
- return()
- endif()
- # Get shortest extension as some files can have dot in their names
- string(REGEX REPLACE "^.*(\\.[^.]+)$" "\\1" FILE_EXT ${LONGEST_EXT})
- string(TOLOWER "${FILE_EXT}" FILE_EXT)
- string(SUBSTRING "${FILE_EXT}" 1 -1 FILE_EXT)
-
- get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
- foreach (LANG ${ENABLED_LANGUAGES})
- list(FIND CMAKE_${LANG}_SOURCE_FILE_EXTENSIONS "${FILE_EXT}" TEMP)
- if (NOT ${TEMP} EQUAL -1)
- set(${RETURN_VAR} "${LANG}" PARENT_SCOPE)
- return()
- endif ()
- endforeach()
-
- set(${RETURN_VAR} "" PARENT_SCOPE)
-endfunction ()
-
-
-# Helper function to get compilers used by a target.
-function (sanitizer_target_compilers TARGET RETURN_VAR)
- # Check if all sources for target use the same compiler. If a target uses
- # e.g. C and Fortran mixed and uses different compilers (e.g. clang and
- # gfortran) this can trigger huge problems, because different compilers may
- # use different implementations for sanitizers.
- set(BUFFER "")
- get_target_property(TSOURCES ${TARGET} SOURCES)
- foreach (FILE ${TSOURCES})
- # If expression was found, FILE is a generator-expression for an object
- # library. Object libraries will be ignored.
- string(REGEX MATCH "TARGET_OBJECTS:([^ >]+)" _file ${FILE})
- if ("${_file}" STREQUAL "")
- sanitizer_lang_of_source(${FILE} LANG)
- if (LANG)
- list(APPEND BUFFER ${CMAKE_${LANG}_COMPILER_ID})
- endif ()
- endif ()
- endforeach ()
-
- list(REMOVE_DUPLICATES BUFFER)
- set(${RETURN_VAR} "${BUFFER}" PARENT_SCOPE)
-endfunction ()
-
-
-# Helper function to check compiler flags for language compiler.
-function (sanitizer_check_compiler_flag FLAG LANG VARIABLE)
- if (${LANG} STREQUAL "C")
- include(CheckCCompilerFlag)
- check_c_compiler_flag("${FLAG}" ${VARIABLE})
-
- elseif (${LANG} STREQUAL "CXX")
- include(CheckCXXCompilerFlag)
- check_cxx_compiler_flag("${FLAG}" ${VARIABLE})
-
- elseif (${LANG} STREQUAL "Fortran")
- # CheckFortranCompilerFlag was introduced in CMake 3.x. To be compatible
- # with older Cmake versions, we will check if this module is present
- # before we use it. Otherwise we will define Fortran coverage support as
- # not available.
- include(CheckFortranCompilerFlag OPTIONAL RESULT_VARIABLE INCLUDED)
- if (INCLUDED)
- check_fortran_compiler_flag("${FLAG}" ${VARIABLE})
- elseif (NOT CMAKE_REQUIRED_QUIET)
- message(STATUS "Performing Test ${VARIABLE}")
- message(STATUS "Performing Test ${VARIABLE}"
- " - Failed (Check not supported)")
- endif ()
- endif()
-endfunction ()
-
-
-# Helper function to test compiler flags.
-function (sanitizer_check_compiler_flags FLAG_CANDIDATES NAME PREFIX)
- set(CMAKE_REQUIRED_QUIET ${${PREFIX}_FIND_QUIETLY})
-
- get_property(ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
- foreach (LANG ${ENABLED_LANGUAGES})
- # Sanitizer flags are not dependend on language, but the used compiler.
- # So instead of searching flags foreach language, search flags foreach
- # compiler used.
- set(COMPILER ${CMAKE_${LANG}_COMPILER_ID})
- if (NOT DEFINED ${PREFIX}_${COMPILER}_FLAGS)
- foreach (FLAG ${FLAG_CANDIDATES})
- if(NOT CMAKE_REQUIRED_QUIET)
- message(STATUS "Try ${COMPILER} ${NAME} flag = [${FLAG}]")
- endif()
-
- set(CMAKE_REQUIRED_FLAGS "${FLAG}")
- unset(${PREFIX}_FLAG_DETECTED CACHE)
- sanitizer_check_compiler_flag("${FLAG}" ${LANG}
- ${PREFIX}_FLAG_DETECTED)
-
- if (${PREFIX}_FLAG_DETECTED)
- # If compiler is a GNU compiler, search for static flag, if
- # SANITIZE_LINK_STATIC is enabled.
- if (SANITIZE_LINK_STATIC AND (${COMPILER} STREQUAL "GNU"))
- string(TOLOWER ${PREFIX} PREFIX_lower)
- sanitizer_check_compiler_flag(
- "-static-lib${PREFIX_lower}" ${LANG}
- ${PREFIX}_STATIC_FLAG_DETECTED)
-
- if (${PREFIX}_STATIC_FLAG_DETECTED)
- set(FLAG "-static-lib${PREFIX_lower} ${FLAG}")
- endif ()
- endif ()
-
- set(${PREFIX}_${COMPILER}_FLAGS "${FLAG}" CACHE STRING
- "${NAME} flags for ${COMPILER} compiler.")
- mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS)
- break()
- endif ()
- endforeach ()
-
- if (NOT ${PREFIX}_FLAG_DETECTED)
- set(${PREFIX}_${COMPILER}_FLAGS "" CACHE STRING
- "${NAME} flags for ${COMPILER} compiler.")
- mark_as_advanced(${PREFIX}_${COMPILER}_FLAGS)
-
- message(WARNING "${NAME} is not available for ${COMPILER} "
- "compiler. Targets using this compiler will be "
- "compiled without ${NAME}.")
- endif ()
- endif ()
- endforeach ()
-endfunction ()
-
-
-# Helper to assign sanitizer flags for TARGET.
-function (sanitizer_add_flags TARGET NAME PREFIX)
- # Get list of compilers used by target and check, if sanitizer is available
- # for this target. Other compiler checks like check for conflicting
- # compilers will be done in add_sanitizers function.
- sanitizer_target_compilers(${TARGET} TARGET_COMPILER)
- list(LENGTH TARGET_COMPILER NUM_COMPILERS)
- if ("${${PREFIX}_${TARGET_COMPILER}_FLAGS}" STREQUAL "")
- return()
- endif()
-
- # Set compile- and link-flags for target.
- set_property(TARGET ${TARGET} APPEND_STRING
- PROPERTY COMPILE_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}")
- set_property(TARGET ${TARGET} APPEND_STRING
- PROPERTY COMPILE_FLAGS " ${SanBlist_${TARGET_COMPILER}_FLAGS}")
- set_property(TARGET ${TARGET} APPEND_STRING
- PROPERTY LINK_FLAGS " ${${PREFIX}_${TARGET_COMPILER}_FLAGS}")
-endfunction ()
diff --git a/graphics/asymptote/cudareflect/tinyexr/config-msvc.py b/graphics/asymptote/cudareflect/tinyexr/config-msvc.py
deleted file mode 100644
index 1b3a48c876..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/config-msvc.py
+++ /dev/null
@@ -1,78 +0,0 @@
-exe = "test_tinyexr.exe"
-
-# "gnu" or "msvc" are provided as predefined toolchain
-toolchain = "msvc"
-
-# optional
-link_pool_depth = 1
-
-# optional
-builddir = {
- "gnu" : "build"
- , "msvc" : "build"
- , "clang" : "build"
- }
-
-# required
-includes = {
- "gnu" : [ "-I." ]
- , "msvc" : [ "/I." ]
- , "clang" : [ "-I." ]
- }
-
-# required
-defines = {
- "gnu" : [ "-DEXAMPLE=1" ]
- , "msvc" : [ "/DEXAMPLE=1" ]
- , "clang" : [ "-DEXAMPLE=1" ]
- }
-
-# required
-cflags = {
- "gnu" : [ "-O2", "-g" ]
- , "msvc" : [ "/O2" ]
- , "clang" : [ "-O2", "-g" ]
- }
-
-# required
-cxxflags = {
- "gnu" : [ "-O2", "-g" ]
- , "msvc" : [ "/O2", "/W4" ]
- , "clang" : [ "-O2", "-g", "-fsanitize=address" ]
- }
-
-# required
-ldflags = {
- "gnu" : [ ]
- , "msvc" : [ ]
- , "clang" : [ "-fsanitize=address" ]
- }
-
-# optionsl
-cxx_files = [ "test_tinyexr.cc" ]
-c_files = [ ]
-
-# You can register your own toolchain through register_toolchain function
-def register_toolchain(ninja):
- pass
-
- #ninja.rule('clangcxx', description='CXX $out',
- # command='$clangcxx -MMD -MF $out.d $clangdefines $clangincludes $clangcxxflags -c $in -o $out',
- # depfile='$out.d', deps='gcc')
- #ninja.rule('clangcc', description='CC $out',
- # command='$clangcc -MMD -MF $out.d $clangdefines $clangincludes $clangcflags -c $in -o $out',
- # depfile='$out.d', deps='gcc')
- #ninja.rule('clanglink', description='LINK $out', pool='link_pool',
- # command='$clangld $clangldflags -o $out $in $libs')
- #ninja.rule('clangar', description='AR $out', pool='link_pool',
- # command='$clangar rsc $out $in')
- #ninja.rule('clangstamp', description='STAMP $out', command='touch $out')
- #ninja.newline()
-
- #ninja.variable('clangcxx', 'clang++')
- #ninja.variable('clangcc', 'clang')
- #ninja.variable('clangld', 'clang++')
- #ninja.variable('clangar', 'ar')
- #ninja.newline()
-
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/ChangeLog.md b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/ChangeLog.md
deleted file mode 100644
index 4ae15a8cdf..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/ChangeLog.md
+++ /dev/null
@@ -1,196 +0,0 @@
-## Changelog
-
-### 2.2.0
-
- - Fix examples with amalgamation
- - Modified cmake script to support shared library mode and find_package
- - Fix for misleading doc comment on `mz_zip_reader_init_cfile` function
- - Add include location tolerance and stop forcing `_GNU_SOURCE`
- - Fix: mz_zip_reader_locate_file_v2 returns an mz_bool
- - Fix large file system checks
- - Add #elif to enable an external mz_crc32() to be linked in
- - Write with dynamic size (size of file/data to be added not known before adding)
- - Added uncompress2 for zlib compatibility
- - Add support for building as a Meson subproject
- - Added OSSFuzz support; Integrate with CIFuzz
- - Add pkg-config file
- - Fixed use-of-uninitialized value msan error when copying dist bytes with no output bytes written.
- - mz_zip_validate_file(): fix memory leak on errors
- - Fixed MSAN use-of-uninitialized in tinfl_decompress when invalid dist is decoded. In this instance dist was 31 which s_dist_base translates as 0
- - Add flag to set (compressed) size in local file header
- - avoid use of uninitialized value in tdefl_record_literal
-
-### 2.1.0
-
- - More instances of memcpy instead of cast and use memcpy per default
- - Remove inline for c90 support
- - New function to read files via callback functions when adding them
- - Fix out of bounds read while reading Zip64 extended information
- - guard memcpy when n == 0 because buffer may be NULL
- - Implement inflateReset() function
- - Move comp/decomp alloc/free prototypes under guarding #ifndef MZ_NO_MALLOC
- - Fix large file support under Windows
- - Don't warn if _LARGEFILE64_SOURCE is not defined to 1
- - Fixes for MSVC warnings
- - Remove check that path of file added to archive contains ':' or '\'
- - Add !defined check on MINIZ_USE_ALIGNED_LOADS_AND_STORES
-
-### 2.0.8
-
- - Remove unimplemented functions (mz_zip_locate_file and mz_zip_locate_file_v2)
- - Add license, changelog, readme and example files to release zip
- - Fix heap overflow to user buffer in tinfl_status tinfl_decompress
- - Fix corrupt archive if uncompressed file smaller than 4 byte and the file is added by mz_zip_writer_add_mem*
-
-### 2.0.7
-
- - Removed need in C++ compiler in cmake build
- - Fixed a lot of uninitialized value errors found with Valgrind by memsetting m_dict to 0 in tdefl_init
- - Fix resource leak in mz_zip_reader_init_file_v2
- - Fix assert with mz_zip_writer_add_mem* w/MZ_DEFAULT_COMPRESSION
- - cmake build: install library and headers
- - Remove _LARGEFILE64_SOURCE requirement from apple defines for large files
-
-### 2.0.6
-
- - Improve MZ_ZIP_FLAG_WRITE_ZIP64 documentation
- - Remove check for cur_archive_file_ofs > UINT_MAX because cur_archive_file_ofs is not used after this point
- - Add cmake debug configuration
- - Fix PNG height when creating png files
- - Add "iterative" file extraction method based on mz_zip_reader_extract_to_callback.
- - Option to use memcpy for unaligned data access
- - Define processor/arch macros as zero if not set to one
-
-### 2.0.4/2.0.5
-
- - Fix compilation with the various omission compile definitions
-
-### 2.0.3
-
-- Fix GCC/clang compile warnings
-- Added callback for periodic flushes (for ZIP file streaming)
-- Use UTF-8 for file names in ZIP files per default
-
-### 2.0.2
-
-- Fix source backwards compatibility with 1.x
-- Fix a ZIP bit not being set correctly
-
-### 2.0.1
-
-- Added some tests
-- Added CI
-- Make source code ANSI C compatible
-
-### 2.0.0 beta
-
-- Matthew Sitton merged miniz 1.x to Rich Geldreich's vogl ZIP64 changes. Miniz is now licensed as MIT since the vogl code base is MIT licensed
-- Miniz is now split into several files
-- Miniz does now not seek backwards when creating ZIP files. That is the ZIP files can be streamed
-- Miniz automatically switches to the ZIP64 format when the created ZIP files goes over ZIP file limits
-- Similar to [SQLite](https://www.sqlite.org/amalgamation.html) the Miniz source code is amalgamated into one miniz.c/miniz.h pair in a build step (amalgamate.sh). Please use miniz.c/miniz.h in your projects
-- Miniz 2 is only source back-compatible with miniz 1.x. It breaks binary compatibility because structures changed
-
-### v1.16 BETA Oct 19, 2013
-
-Still testing, this release is downloadable from [here](http://www.tenacioussoftware.com/miniz_v116_beta_r1.7z). Two key inflator-only robustness and streaming related changes. Also merged in tdefl_compressor_alloc(), tdefl_compressor_free() helpers to make script bindings easier for rustyzip. I would greatly appreciate any help with testing or any feedback.
-
-The inflator in raw (non-zlib) mode is now usable on gzip or similar streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520). This version should never read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer.
-
-The inflator now has a new failure status TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the caller did not set the TINFL_FLAG_HAS_MORE_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on. This is scary behavior if the caller didn't know when to stop accepting output (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum). v1.16 will instead return TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft" failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios.
-
-- The inflator coroutine func. is subtle and complex so I'm being cautious about this release. I would greatly appreciate any help with testing or any feedback.
- I feel good about these changes, and they've been through several hours of automated testing, but they will probably not fix anything for the majority of prev. users so I'm
- going to mark this release as beta for a few weeks and continue testing it at work/home on various things.
-- The inflator in raw (non-zlib) mode is now usable on gzip or similar data streams that have a bunch of bytes following the raw deflate data (problem discovered by rustyzip author williamw520).
- This version should *never* read beyond the last byte of the raw deflate data independent of how many bytes you pass into the input buffer. This issue was caused by the various Huffman bitbuffer lookahead optimizations, and
- would not be an issue if the caller knew and enforced the precise size of the raw compressed data *or* if the compressed data was in zlib format (i.e. always followed by the byte aligned zlib adler32).
- So in other words, you can now call the inflator on deflate streams that are followed by arbitrary amounts of data and it's guaranteed that decompression will stop exactly on the last byte.
-- The inflator now has a new failure status: TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS (-4). Previously, if the inflator was starved of bytes and could not make progress (because the input buffer was empty and the
- caller did not set the TINFL_FLAG_HAS_MORE_INPUT flag - say on truncated or corrupted compressed data stream) it would append all 0's to the input and try to soldier on.
- This is scary, because in the worst case, I believe it was possible for the prev. inflator to start outputting large amounts of literal data. If the caller didn't know when to stop accepting output
- (because it didn't know how much uncompressed data was expected, or didn't enforce a sane maximum) it could continue forever. v1.16 cannot fall into this failure mode, instead it'll return
- TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS immediately if it needs 1 or more bytes to make progress, the input buf is empty, and the caller has indicated that no more input is available. This is a "soft"
- failure, so you can call the inflator again with more input and it will try to continue, or you can give up and fail. This could be very useful in network streaming scenarios.
-- Added documentation to all the tinfl return status codes, fixed miniz_tester so it accepts double minus params for Linux, tweaked example1.c, added a simple "follower bytes" test to miniz_tester.cpp.
-### v1.15 r4 STABLE - Oct 13, 2013
-
-Merged over a few very minor bug fixes that I fixed in the zip64 branch. This is downloadable from [here](http://code.google.com/p/miniz/downloads/list) and also in SVN head (as of 10/19/13).
-
-
-### v1.15 - Oct. 13, 2013
-
-Interim bugfix release while I work on the next major release with zip64 and streaming compression/decompression support. Fixed the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com), which could cause the locate files func to not find files when this flag was specified. Also fixed a bug in mz_zip_reader_extract_to_mem_no_alloc() with user provided read buffers (thanks kymoon). I also merged lots of compiler fixes from various github repo branches and Google Code issue reports. I finally added cmake support (only tested under for Linux so far), compiled and tested with clang v3.3 and gcc 4.6 (under Linux), added defl_write_image_to_png_file_in_memory_ex() (supports Y flipping for OpenGL use, real-time compression), added a new PNG example (example6.c - Mandelbrot), and I added 64-bit file I/O support (stat64(), etc.) for glibc.
-
-- Critical fix for the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY bug (thanks kahmyong.moon@hp.com) which could cause locate files to not find files. This bug
- would only have occured in earlier versions if you explicitly used this flag, OR if you used mz_zip_extract_archive_file_to_heap() or mz_zip_add_mem_to_archive_file_in_place()
- (which used this flag). If you can't switch to v1.15 but want to fix this bug, just remove the uses of this flag from both helper funcs (and of course don't use the flag).
-- Bugfix in mz_zip_reader_extract_to_mem_no_alloc() from kymoon when pUser_read_buf is not NULL and compressed size is > uncompressed size
-- Fixing mz_zip_reader_extract_*() funcs so they don't try to extract compressed data from directory entries, to account for weird zipfiles which contain zero-size compressed data on dir entries.
- Hopefully this fix won't cause any issues on weird zip archives, because it assumes the low 16-bits of zip external attributes are DOS attributes (which I believe they always are in practice).
-- Fixing mz_zip_reader_is_file_a_directory() so it doesn't check the internal attributes, just the filename and external attributes
-- mz_zip_reader_init_file() - missing MZ_FCLOSE() call if the seek failed
-- Added cmake support for Linux builds which builds all the examples, tested with clang v3.3 and gcc v4.6.
-- Clang fix for tdefl_write_image_to_png_file_in_memory() from toffaletti
-- Merged MZ_FORCEINLINE fix from hdeanclark
-- Fix <time.h> include before config #ifdef, thanks emil.brink
-- Added tdefl_write_image_to_png_file_in_memory_ex(): supports Y flipping (super useful for OpenGL apps), and explicit control over the compression level (so you can
- set it to 1 for real-time compression).
-- Merged in some compiler fixes from paulharris's github repro.
-- Retested this build under Windows (VS 2010, including static analysis), tcc 0.9.26, gcc v4.6 and clang v3.3.
-- Added example6.c, which dumps an image of the mandelbrot set to a PNG file.
-- Modified example2 to help test the MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY flag more.
-- In r3: Bugfix to mz_zip_writer_add_file() found during merge: Fix possible src file fclose() leak if alignment bytes+local header file write faiiled
-- In r4: Minor bugfix to mz_zip_writer_add_from_zip_reader(): Was pushing the wrong central dir header offset, appears harmless in this release, but it became a problem in the zip64 branch
-
-### v1.14 - May 20, 2012
-
-(SVN Only) Minor tweaks to get miniz.c compiling with the Tiny C Compiler, added #ifndef MINIZ_NO_TIME guards around utime.h includes. Adding mz_free() function, so the caller can free heap blocks returned by miniz using whatever heap functions it has been configured to use, MSVC specific fixes to use "safe" variants of several functions (localtime_s, fopen_s, freopen_s).
-
-MinGW32/64 GCC 4.6.1 compiler fixes: added MZ_FORCEINLINE, #include <time.h> (thanks fermtect).
-
-Compiler specific fixes, some from fermtect. I upgraded to TDM GCC 4.6.1 and now static __forceinline is giving it fits, so I'm changing all usage of __forceinline to MZ_FORCEINLINE and forcing gcc to use __attribute__((__always_inline__)) (and MSVC to use __forceinline). Also various fixes from fermtect for MinGW32: added #include , 64-bit ftell/fseek fixes.
-
-### v1.13 - May 19, 2012
-
-From jason@cornsyrup.org and kelwert@mtu.edu - Most importantly, fixed mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bits. Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files. Other stuff:
-
-Eliminated a bunch of warnings when compiling with GCC 32-bit/64. Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly "Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning).
-
-Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64. Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test. Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives. Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.)
-
-Fix ftell() usage in a few of the examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself). Fix fail logic handling in mz_zip_add_mem_to_archive_file_in_place() so it always calls mz_zip_writer_finalize_archive() and mz_zip_writer_end(), even if the file add fails.
-
-- From jason@cornsyrup.org and kelwert@mtu.edu - Fix mz_crc32() so it doesn't compute the wrong CRC-32's when mz_ulong is 64-bit.
-- Temporarily/locally slammed in "typedef unsigned long mz_ulong" and re-ran a randomized regression test on ~500k files.
-- Eliminated a bunch of warnings when compiling with GCC 32-bit/64.
-- Ran all examples, miniz.c, and tinfl.c through MSVC 2008's /analyze (static analysis) option and fixed all warnings (except for the silly
-"Use of the comma-operator in a tested expression.." analysis warning, which I purposely use to work around a MSVC compiler warning).
-- Created 32-bit and 64-bit Codeblocks projects/workspace. Built and tested Linux executables. The codeblocks workspace is compatible with Linux+Win32/x64.
-- Added miniz_tester solution/project, which is a useful little app derived from LZHAM's tester app that I use as part of the regression test.
-- Ran miniz.c and tinfl.c through another series of regression testing on ~500,000 files and archives.
-- Modified example5.c so it purposely disables a bunch of high-level functionality (MINIZ_NO_STDIO, etc.). (Thanks to corysama for the MINIZ_NO_STDIO bug report.)
-- Fix ftell() usage in examples so they exit with an error on files which are too large (a limitation of the examples, not miniz itself).
-
-### v1.12 - 4/12/12
-
-More comments, added low-level example5.c, fixed a couple minor level_and_flags issues in the archive API's.
-level_and_flags can now be set to MZ_DEFAULT_COMPRESSION. Thanks to Bruce Dawson <bruced@valvesoftware.com> for the feedback/bug report.
-
-### v1.11 - 5/28/11
-
-Added statement from unlicense.org
-
-### v1.10 - 5/27/11
-
-- Substantial compressor optimizations:
-- Level 1 is now ~4x faster than before. The L1 compressor's throughput now varies between 70-110MB/sec. on a Core i7 (actual throughput varies depending on the type of data, and x64 vs. x86).
-- Improved baseline L2-L9 compression perf. Also, greatly improved compression perf. issues on some file types.
-- Refactored the compression code for better readability and maintainability.
-- Added level 10 compression level (L10 has slightly better ratio than level 9, but could have a potentially large drop in throughput on some files).
-
-### v1.09 - 5/15/11
-
-Initial stable release.
-
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/LICENSE b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/LICENSE
deleted file mode 100644
index b6ff45a30f..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/LICENSE
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright 2013-2014 RAD Game Tools and Valve Software
-Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
-
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example1.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example1.c
deleted file mode 100644
index d6e33faaa6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example1.c
+++ /dev/null
@@ -1,105 +0,0 @@
-// example1.c - Demonstrates miniz.c's compress() and uncompress() functions (same as zlib's).
-// Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-#include <stdio.h>
-#include "miniz.h"
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-// The string to compress.
-static const char *s_pStr = "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson." \
- "Good morning Dr. Chandra. This is Hal. I am ready for my first lesson.";
-
-int main(int argc, char *argv[])
-{
- uint step = 0;
- int cmp_status;
- uLong src_len = (uLong)strlen(s_pStr);
- uLong cmp_len = compressBound(src_len);
- uLong uncomp_len = src_len;
- uint8 *pCmp, *pUncomp;
- uint total_succeeded = 0;
- (void)argc, (void)argv;
-
- printf("miniz.c version: %s\n", MZ_VERSION);
-
- do
- {
- // Allocate buffers to hold compressed and uncompressed data.
- pCmp = (mz_uint8 *)malloc((size_t)cmp_len);
- pUncomp = (mz_uint8 *)malloc((size_t)src_len);
- if ((!pCmp) || (!pUncomp))
- {
- printf("Out of memory!\n");
- return EXIT_FAILURE;
- }
-
- // Compress the string.
- cmp_status = compress(pCmp, &cmp_len, (const unsigned char *)s_pStr, src_len);
- if (cmp_status != Z_OK)
- {
- printf("compress() failed!\n");
- free(pCmp);
- free(pUncomp);
- return EXIT_FAILURE;
- }
-
- printf("Compressed from %u to %u bytes\n", (mz_uint32)src_len, (mz_uint32)cmp_len);
-
- if (step)
- {
- // Purposely corrupt the compressed data if fuzzy testing (this is a very crude fuzzy test).
- uint n = 1 + (rand() % 3);
- while (n--)
- {
- uint i = rand() % cmp_len;
- pCmp[i] ^= (rand() & 0xFF);
- }
- }
-
- // Decompress.
- cmp_status = uncompress(pUncomp, &uncomp_len, pCmp, cmp_len);
- total_succeeded += (cmp_status == Z_OK);
-
- if (step)
- {
- printf("Simple fuzzy test: step %u total_succeeded: %u\n", step, total_succeeded);
- }
- else
- {
- if (cmp_status != Z_OK)
- {
- printf("uncompress failed!\n");
- free(pCmp);
- free(pUncomp);
- return EXIT_FAILURE;
- }
-
- printf("Decompressed from %u to %u bytes\n", (mz_uint32)cmp_len, (mz_uint32)uncomp_len);
-
- // Ensure uncompress() returned the expected data.
- if ((uncomp_len != src_len) || (memcmp(pUncomp, s_pStr, (size_t)src_len)))
- {
- printf("Decompression failed!\n");
- free(pCmp);
- free(pUncomp);
- return EXIT_FAILURE;
- }
- }
-
- free(pCmp);
- free(pUncomp);
-
- step++;
-
- // Keep on fuzzy testing if there's a non-empty command line.
- } while (argc >= 2);
-
- printf("Success.\n");
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example2.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example2.c
deleted file mode 100644
index 03d2409583..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example2.c
+++ /dev/null
@@ -1,164 +0,0 @@
-// example2.c - Simple demonstration of miniz.c's ZIP archive API's.
-// Note this test deletes the test archive file "__mz_example2_test__.zip" in the current directory, then creates a new one with test data.
-// Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-
-#if defined(__GNUC__)
- // Ensure we get the 64-bit variants of the CRT's file I/O calls
- #ifndef _FILE_OFFSET_BITS
- #define _FILE_OFFSET_BITS 64
- #endif
- #ifndef _LARGEFILE64_SOURCE
- #define _LARGEFILE64_SOURCE 1
- #endif
-#endif
-
-#include <stdio.h>
-#include "miniz.h"
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-// The string to compress.
-static const char *s_pTest_str =
- "MISSION CONTROL I wouldn't worry too much about the computer. First of all, there is still a chance that he is right, despite your tests, and" \
- "if it should happen again, we suggest eliminating this possibility by allowing the unit to remain in place and seeing whether or not it" \
- "actually fails. If the computer should turn out to be wrong, the situation is still not alarming. The type of obsessional error he may be" \
- "guilty of is not unknown among the latest generation of HAL 9000 computers. It has almost always revolved around a single detail, such as" \
- "the one you have described, and it has never interfered with the integrity or reliability of the computer's performance in other areas." \
- "No one is certain of the cause of this kind of malfunctioning. It may be over-programming, but it could also be any number of reasons. In any" \
- "event, it is somewhat analogous to human neurotic behavior. Does this answer your query? Zero-five-three-Zero, MC, transmission concluded.";
-
-static const char *s_pComment = "This is a comment";
-
-int main(int argc, char *argv[])
-{
- int i, sort_iter;
- mz_bool status;
- size_t uncomp_size;
- mz_zip_archive zip_archive;
- void *p;
- const int N = 50;
- char data[2048];
- char archive_filename[64];
- static const char *s_Test_archive_filename = "__mz_example2_test__.zip";
-
- assert((strlen(s_pTest_str) + 64) < sizeof(data));
-
- printf("miniz.c version: %s\n", MZ_VERSION);
-
- (void)argc, (void)argv;
-
- // Delete the test archive, so it doesn't keep growing as we run this test
- remove(s_Test_archive_filename);
-
- // Append a bunch of text files to the test archive
- for (i = (N - 1); i >= 0; --i)
- {
- sprintf(archive_filename, "%u.txt", i);
- sprintf(data, "%u %s %u", (N - 1) - i, s_pTest_str, i);
-
- // Add a new file to the archive. Note this is an IN-PLACE operation, so if it fails your archive is probably hosed (its central directory may not be complete) but it should be recoverable using zip -F or -FF. So use caution with this guy.
- // A more robust way to add a file to an archive would be to read it into memory, perform the operation, then write a new archive out to a temp file and then delete/rename the files.
- // Or, write a new archive to disk to a temp file, then delete/rename the files. For this test this API is fine.
- status = mz_zip_add_mem_to_archive_file_in_place(s_Test_archive_filename, archive_filename, data, strlen(data) + 1, s_pComment, (uint16)strlen(s_pComment), MZ_BEST_COMPRESSION);
- if (!status)
- {
- printf("mz_zip_add_mem_to_archive_file_in_place failed!\n");
- return EXIT_FAILURE;
- }
- }
-
- // Add a directory entry for testing
- status = mz_zip_add_mem_to_archive_file_in_place(s_Test_archive_filename, "directory/", NULL, 0, "no comment", (uint16)strlen("no comment"), MZ_BEST_COMPRESSION);
- if (!status)
- {
- printf("mz_zip_add_mem_to_archive_file_in_place failed!\n");
- return EXIT_FAILURE;
- }
-
- // Now try to open the archive.
- memset(&zip_archive, 0, sizeof(zip_archive));
-
- status = mz_zip_reader_init_file(&zip_archive, s_Test_archive_filename, 0);
- if (!status)
- {
- printf("mz_zip_reader_init_file() failed!\n");
- return EXIT_FAILURE;
- }
-
- // Get and print information about each file in the archive.
- for (i = 0; i < (int)mz_zip_reader_get_num_files(&zip_archive); i++)
- {
- mz_zip_archive_file_stat file_stat;
- if (!mz_zip_reader_file_stat(&zip_archive, i, &file_stat))
- {
- printf("mz_zip_reader_file_stat() failed!\n");
- mz_zip_reader_end(&zip_archive);
- return EXIT_FAILURE;
- }
-
- printf("Filename: \"%s\", Comment: \"%s\", Uncompressed size: %u, Compressed size: %u, Is Dir: %u\n", file_stat.m_filename, file_stat.m_comment, (uint)file_stat.m_uncomp_size, (uint)file_stat.m_comp_size, mz_zip_reader_is_file_a_directory(&zip_archive, i));
-
- if (!strcmp(file_stat.m_filename, "directory/"))
- {
- if (!mz_zip_reader_is_file_a_directory(&zip_archive, i))
- {
- printf("mz_zip_reader_is_file_a_directory() didn't return the expected results!\n");
- mz_zip_reader_end(&zip_archive);
- return EXIT_FAILURE;
- }
- }
- }
-
- // Close the archive, freeing any resources it was using
- mz_zip_reader_end(&zip_archive);
-
- // Now verify the compressed data
- for (sort_iter = 0; sort_iter < 2; sort_iter++)
- {
- memset(&zip_archive, 0, sizeof(zip_archive));
- status = mz_zip_reader_init_file(&zip_archive, s_Test_archive_filename, sort_iter ? MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY : 0);
- if (!status)
- {
- printf("mz_zip_reader_init_file() failed!\n");
- return EXIT_FAILURE;
- }
-
- for (i = 0; i < N; i++)
- {
- sprintf(archive_filename, "%u.txt", i);
- sprintf(data, "%u %s %u", (N - 1) - i, s_pTest_str, i);
-
- // Try to extract all the files to the heap.
- p = mz_zip_reader_extract_file_to_heap(&zip_archive, archive_filename, &uncomp_size, 0);
- if (!p)
- {
- printf("mz_zip_reader_extract_file_to_heap() failed!\n");
- mz_zip_reader_end(&zip_archive);
- return EXIT_FAILURE;
- }
-
- // Make sure the extraction really succeeded.
- if ((uncomp_size != (strlen(data) + 1)) || (memcmp(p, data, strlen(data))))
- {
- printf("mz_zip_reader_extract_file_to_heap() failed to extract the proper data\n");
- mz_free(p);
- mz_zip_reader_end(&zip_archive);
- return EXIT_FAILURE;
- }
-
- printf("Successfully extracted file \"%s\", size %u\n", archive_filename, (uint)uncomp_size);
- printf("File data: \"%s\"\n", (const char *)p);
-
- // We're done.
- mz_free(p);
- }
-
- // Close the archive, freeing any resources it was using
- mz_zip_reader_end(&zip_archive);
- }
-
- printf("Success.\n");
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example3.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example3.c
deleted file mode 100644
index a97ba8420f..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example3.c
+++ /dev/null
@@ -1,269 +0,0 @@
-// example3.c - Demonstrates how to use miniz.c's deflate() and inflate() functions for simple file compression.
-// Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-// For simplicity, this example is limited to files smaller than 4GB, but this is not a limitation of miniz.c.
-#include <stdio.h>
-#include <limits.h>
-#include "miniz.h"
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-#define my_max(a,b) (((a) > (b)) ? (a) : (b))
-#define my_min(a,b) (((a) < (b)) ? (a) : (b))
-
-#define BUF_SIZE (1024 * 1024)
-static uint8 s_inbuf[BUF_SIZE];
-static uint8 s_outbuf[BUF_SIZE];
-
-int main(int argc, char *argv[])
-{
- const char *pMode;
- FILE *pInfile, *pOutfile;
- uint infile_size;
- int level = Z_BEST_COMPRESSION;
- z_stream stream;
- int p = 1;
- const char *pSrc_filename;
- const char *pDst_filename;
- long file_loc;
-
- printf("miniz.c version: %s\n", MZ_VERSION);
-
- if (argc < 4)
- {
- printf("Usage: example3 [options] [mode:c or d] infile outfile\n");
- printf("\nModes:\n");
- printf("c - Compresses file infile to a zlib stream in file outfile\n");
- printf("d - Decompress zlib stream in file infile to file outfile\n");
- printf("\nOptions:\n");
- printf("-l[0-10] - Compression level, higher values are slower.\n");
- return EXIT_FAILURE;
- }
-
- while ((p < argc) && (argv[p][0] == '-'))
- {
- switch (argv[p][1])
- {
- case 'l':
- {
- level = atoi(&argv[1][2]);
- if ((level < 0) || (level > 10))
- {
- printf("Invalid level!\n");
- return EXIT_FAILURE;
- }
- break;
- }
- default:
- {
- printf("Invalid option: %s\n", argv[p]);
- return EXIT_FAILURE;
- }
- }
- p++;
- }
-
- if ((argc - p) < 3)
- {
- printf("Must specify mode, input filename, and output filename after options!\n");
- return EXIT_FAILURE;
- }
- else if ((argc - p) > 3)
- {
- printf("Too many filenames!\n");
- return EXIT_FAILURE;
- }
-
- pMode = argv[p++];
- if (!strchr("cCdD", pMode[0]))
- {
- printf("Invalid mode!\n");
- return EXIT_FAILURE;
- }
-
- pSrc_filename = argv[p++];
- pDst_filename = argv[p++];
-
- printf("Mode: %c, Level: %u\nInput File: \"%s\"\nOutput File: \"%s\"\n", pMode[0], level, pSrc_filename, pDst_filename);
-
- // Open input file.
- pInfile = fopen(pSrc_filename, "rb");
- if (!pInfile)
- {
- printf("Failed opening input file!\n");
- return EXIT_FAILURE;
- }
-
- // Determine input file's size.
- fseek(pInfile, 0, SEEK_END);
- file_loc = ftell(pInfile);
- fseek(pInfile, 0, SEEK_SET);
-
- if ((file_loc < 0) || (file_loc > INT_MAX))
- {
- // This is not a limitation of miniz or tinfl, but this example.
- printf("File is too large to be processed by this example.\n");
- return EXIT_FAILURE;
- }
-
- infile_size = (uint)file_loc;
-
- // Open output file.
- pOutfile = fopen(pDst_filename, "wb");
- if (!pOutfile)
- {
- printf("Failed opening output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Input file size: %u\n", infile_size);
-
- // Init the z_stream
- memset(&stream, 0, sizeof(stream));
- stream.next_in = s_inbuf;
- stream.avail_in = 0;
- stream.next_out = s_outbuf;
- stream.avail_out = BUF_SIZE;
-
- if ((pMode[0] == 'c') || (pMode[0] == 'C'))
- {
- // Compression.
- uint infile_remaining = infile_size;
-
- if (deflateInit(&stream, level) != Z_OK)
- {
- printf("deflateInit() failed!\n");
- return EXIT_FAILURE;
- }
-
- for ( ; ; )
- {
- int status;
- if (!stream.avail_in)
- {
- // Input buffer is empty, so read more bytes from input file.
- uint n = my_min(BUF_SIZE, infile_remaining);
-
- if (fread(s_inbuf, 1, n, pInfile) != n)
- {
- printf("Failed reading from input file!\n");
- return EXIT_FAILURE;
- }
-
- stream.next_in = s_inbuf;
- stream.avail_in = n;
-
- infile_remaining -= n;
- //printf("Input bytes remaining: %u\n", infile_remaining);
- }
-
- status = deflate(&stream, infile_remaining ? Z_NO_FLUSH : Z_FINISH);
-
- if ((status == Z_STREAM_END) || (!stream.avail_out))
- {
- // Output buffer is full, or compression is done, so write buffer to output file.
- uint n = BUF_SIZE - stream.avail_out;
- if (fwrite(s_outbuf, 1, n, pOutfile) != n)
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
- stream.next_out = s_outbuf;
- stream.avail_out = BUF_SIZE;
- }
-
- if (status == Z_STREAM_END)
- break;
- else if (status != Z_OK)
- {
- printf("deflate() failed with status %i!\n", status);
- return EXIT_FAILURE;
- }
- }
-
- if (deflateEnd(&stream) != Z_OK)
- {
- printf("deflateEnd() failed!\n");
- return EXIT_FAILURE;
- }
- }
- else if ((pMode[0] == 'd') || (pMode[0] == 'D'))
- {
- // Decompression.
- uint infile_remaining = infile_size;
-
- if (inflateInit(&stream))
- {
- printf("inflateInit() failed!\n");
- return EXIT_FAILURE;
- }
-
- for ( ; ; )
- {
- int status;
- if (!stream.avail_in)
- {
- // Input buffer is empty, so read more bytes from input file.
- uint n = my_min(BUF_SIZE, infile_remaining);
-
- if (fread(s_inbuf, 1, n, pInfile) != n)
- {
- printf("Failed reading from input file!\n");
- return EXIT_FAILURE;
- }
-
- stream.next_in = s_inbuf;
- stream.avail_in = n;
-
- infile_remaining -= n;
- }
-
- status = inflate(&stream, Z_SYNC_FLUSH);
-
- if ((status == Z_STREAM_END) || (!stream.avail_out))
- {
- // Output buffer is full, or decompression is done, so write buffer to output file.
- uint n = BUF_SIZE - stream.avail_out;
- if (fwrite(s_outbuf, 1, n, pOutfile) != n)
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
- stream.next_out = s_outbuf;
- stream.avail_out = BUF_SIZE;
- }
-
- if (status == Z_STREAM_END)
- break;
- else if (status != Z_OK)
- {
- printf("inflate() failed with status %i!\n", status);
- return EXIT_FAILURE;
- }
- }
-
- if (inflateEnd(&stream) != Z_OK)
- {
- printf("inflateEnd() failed!\n");
- return EXIT_FAILURE;
- }
- }
- else
- {
- printf("Invalid mode!\n");
- return EXIT_FAILURE;
- }
-
- fclose(pInfile);
- if (EOF == fclose(pOutfile))
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Total input bytes: %u\n", (mz_uint32)stream.total_in);
- printf("Total output bytes: %u\n", (mz_uint32)stream.total_out);
- printf("Success.\n");
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example4.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example4.c
deleted file mode 100644
index 3f2d7cf1ed..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example4.c
+++ /dev/null
@@ -1,102 +0,0 @@
-// example4.c - Uses tinfl.c to decompress a zlib stream in memory to an output file
-// Public domain, May 15 2011, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-#include "miniz.h"
-#include <stdio.h>
-#include <limits.h>
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-#define my_max(a,b) (((a) > (b)) ? (a) : (b))
-#define my_min(a,b) (((a) < (b)) ? (a) : (b))
-
-static int tinfl_put_buf_func(const void* pBuf, int len, void *pUser)
-{
- return len == (int)fwrite(pBuf, 1, len, (FILE*)pUser);
-}
-
-int main(int argc, char *argv[])
-{
- int status;
- FILE *pInfile, *pOutfile;
- uint infile_size, outfile_size;
- size_t in_buf_size;
- uint8 *pCmp_data;
- long file_loc;
-
- if (argc != 3)
- {
- printf("Usage: example4 infile outfile\n");
- printf("Decompresses zlib stream in file infile to file outfile.\n");
- printf("Input file must be able to fit entirely in memory.\n");
- printf("example3 can be used to create compressed zlib streams.\n");
- return EXIT_FAILURE;
- }
-
- // Open input file.
- pInfile = fopen(argv[1], "rb");
- if (!pInfile)
- {
- printf("Failed opening input file!\n");
- return EXIT_FAILURE;
- }
-
- // Determine input file's size.
- fseek(pInfile, 0, SEEK_END);
- file_loc = ftell(pInfile);
- fseek(pInfile, 0, SEEK_SET);
-
- if ((file_loc < 0) || (file_loc > INT_MAX))
- {
- // This is not a limitation of miniz or tinfl, but this example.
- printf("File is too large to be processed by this example.\n");
- return EXIT_FAILURE;
- }
-
- infile_size = (uint)file_loc;
-
- pCmp_data = (uint8 *)malloc(infile_size);
- if (!pCmp_data)
- {
- printf("Out of memory!\n");
- return EXIT_FAILURE;
- }
- if (fread(pCmp_data, 1, infile_size, pInfile) != infile_size)
- {
- printf("Failed reading input file!\n");
- return EXIT_FAILURE;
- }
-
- // Open output file.
- pOutfile = fopen(argv[2], "wb");
- if (!pOutfile)
- {
- printf("Failed opening output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Input file size: %u\n", infile_size);
-
- in_buf_size = infile_size;
- status = tinfl_decompress_mem_to_callback(pCmp_data, &in_buf_size, tinfl_put_buf_func, pOutfile, TINFL_FLAG_PARSE_ZLIB_HEADER);
- if (!status)
- {
- printf("tinfl_decompress_mem_to_callback() failed with status %i!\n", status);
- return EXIT_FAILURE;
- }
-
- outfile_size = ftell(pOutfile);
-
- fclose(pInfile);
- if (EOF == fclose(pOutfile))
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Total input bytes: %u\n", (uint)in_buf_size);
- printf("Total output bytes: %u\n", outfile_size);
- printf("Success.\n");
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example5.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example5.c
deleted file mode 100644
index a190357b3d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example5.c
+++ /dev/null
@@ -1,327 +0,0 @@
-// example5.c - Demonstrates how to use miniz.c's low-level tdefl_compress() and tinfl_inflate() API's for simple file to file compression/decompression.
-// The low-level API's are the fastest, make no use of dynamic memory allocation, and are the most flexible functions exposed by miniz.c.
-// Public domain, April 11 2012, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-// For simplicity, this example is limited to files smaller than 4GB, but this is not a limitation of miniz.c.
-
-// Purposely disable a whole bunch of stuff this low-level example doesn't use.
-#define MINIZ_NO_STDIO
-#define MINIZ_NO_ARCHIVE_APIS
-#define MINIZ_NO_TIME
-#define MINIZ_NO_ZLIB_APIS
-#define MINIZ_NO_MALLOC
-#include "miniz.h"
-
-// Now include stdio.h because this test uses fopen(), etc. (but we still don't want miniz.c's stdio stuff, for testing).
-#include <stdio.h>
-#include <limits.h>
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-#define my_max(a,b) (((a) > (b)) ? (a) : (b))
-#define my_min(a,b) (((a) < (b)) ? (a) : (b))
-
-// IN_BUF_SIZE is the size of the file read buffer.
-// IN_BUF_SIZE must be >= 1
-#define IN_BUF_SIZE (1024*512)
-static uint8 s_inbuf[IN_BUF_SIZE];
-
-// COMP_OUT_BUF_SIZE is the size of the output buffer used during compression.
-// COMP_OUT_BUF_SIZE must be >= 1 and <= OUT_BUF_SIZE
-#define COMP_OUT_BUF_SIZE (1024*512)
-
-// OUT_BUF_SIZE is the size of the output buffer used during decompression.
-// OUT_BUF_SIZE must be a power of 2 >= TINFL_LZ_DICT_SIZE (because the low-level decompressor not only writes, but reads from the output buffer as it decompresses)
-//#define OUT_BUF_SIZE (TINFL_LZ_DICT_SIZE)
-#define OUT_BUF_SIZE (1024*512)
-static uint8 s_outbuf[OUT_BUF_SIZE];
-
-// tdefl_compressor contains all the state needed by the low-level compressor so it's a pretty big struct (~300k).
-// This example makes it a global vs. putting it on the stack, of course in real-world usage you'll probably malloc() or new it.
-tdefl_compressor g_deflator;
-
-int main(int argc, char *argv[])
-{
- const char *pMode;
- FILE *pInfile, *pOutfile;
- uint infile_size;
- int level = 9;
- int p = 1;
- const char *pSrc_filename;
- const char *pDst_filename;
- const void *next_in = s_inbuf;
- size_t avail_in = 0;
- void *next_out = s_outbuf;
- size_t avail_out = OUT_BUF_SIZE;
- size_t total_in = 0, total_out = 0;
- long file_loc;
-
- assert(COMP_OUT_BUF_SIZE <= OUT_BUF_SIZE);
-
- printf("miniz.c example5 (demonstrates tinfl/tdefl)\n");
-
- if (argc < 4)
- {
- printf("File to file compression/decompression using the low-level tinfl/tdefl API's.\n");
- printf("Usage: example5 [options] [mode:c or d] infile outfile\n");
- printf("\nModes:\n");
- printf("c - Compresses file infile to a zlib stream in file outfile\n");
- printf("d - Decompress zlib stream in file infile to file outfile\n");
- printf("\nOptions:\n");
- printf("-l[0-10] - Compression level, higher values are slower, 0 is none.\n");
- return EXIT_FAILURE;
- }
-
- while ((p < argc) && (argv[p][0] == '-'))
- {
- switch (argv[p][1])
- {
- case 'l':
- {
- level = atoi(&argv[1][2]);
- if ((level < 0) || (level > 10))
- {
- printf("Invalid level!\n");
- return EXIT_FAILURE;
- }
- break;
- }
- default:
- {
- printf("Invalid option: %s\n", argv[p]);
- return EXIT_FAILURE;
- }
- }
- p++;
- }
-
- if ((argc - p) < 3)
- {
- printf("Must specify mode, input filename, and output filename after options!\n");
- return EXIT_FAILURE;
- }
- else if ((argc - p) > 3)
- {
- printf("Too many filenames!\n");
- return EXIT_FAILURE;
- }
-
- pMode = argv[p++];
- if (!strchr("cCdD", pMode[0]))
- {
- printf("Invalid mode!\n");
- return EXIT_FAILURE;
- }
-
- pSrc_filename = argv[p++];
- pDst_filename = argv[p++];
-
- printf("Mode: %c, Level: %u\nInput File: \"%s\"\nOutput File: \"%s\"\n", pMode[0], level, pSrc_filename, pDst_filename);
-
- // Open input file.
- pInfile = fopen(pSrc_filename, "rb");
- if (!pInfile)
- {
- printf("Failed opening input file!\n");
- return EXIT_FAILURE;
- }
-
- // Determine input file's size.
- fseek(pInfile, 0, SEEK_END);
- file_loc = ftell(pInfile);
- fseek(pInfile, 0, SEEK_SET);
-
- if ((file_loc < 0) || (file_loc > INT_MAX))
- {
- // This is not a limitation of miniz or tinfl, but this example.
- printf("File is too large to be processed by this example.\n");
- return EXIT_FAILURE;
- }
-
- infile_size = (uint)file_loc;
-
- // Open output file.
- pOutfile = fopen(pDst_filename, "wb");
- if (!pOutfile)
- {
- printf("Failed opening output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Input file size: %u\n", infile_size);
-
- if ((pMode[0] == 'c') || (pMode[0] == 'C'))
- {
- // The number of dictionary probes to use at each compression level (0-10). 0=implies fastest/minimal possible probing.
- static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
-
- tdefl_status status;
- uint infile_remaining = infile_size;
-
- // create tdefl() compatible flags (we have to compose the low-level flags ourselves, or use tdefl_create_comp_flags_from_zip_params() but that means MINIZ_NO_ZLIB_APIS can't be defined).
- mz_uint comp_flags = TDEFL_WRITE_ZLIB_HEADER | s_tdefl_num_probes[MZ_MIN(10, level)] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0);
- if (!level)
- comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS;
-
- // Initialize the low-level compressor.
- status = tdefl_init(&g_deflator, NULL, NULL, comp_flags);
- if (status != TDEFL_STATUS_OKAY)
- {
- printf("tdefl_init() failed!\n");
- return EXIT_FAILURE;
- }
-
- avail_out = COMP_OUT_BUF_SIZE;
-
- // Compression.
- for ( ; ; )
- {
- size_t in_bytes, out_bytes;
-
- if (!avail_in)
- {
- // Input buffer is empty, so read more bytes from input file.
- uint n = my_min(IN_BUF_SIZE, infile_remaining);
-
- if (fread(s_inbuf, 1, n, pInfile) != n)
- {
- printf("Failed reading from input file!\n");
- return EXIT_FAILURE;
- }
-
- next_in = s_inbuf;
- avail_in = n;
-
- infile_remaining -= n;
- //printf("Input bytes remaining: %u\n", infile_remaining);
- }
-
- in_bytes = avail_in;
- out_bytes = avail_out;
- // Compress as much of the input as possible (or all of it) to the output buffer.
- status = tdefl_compress(&g_deflator, next_in, &in_bytes, next_out, &out_bytes, infile_remaining ? TDEFL_NO_FLUSH : TDEFL_FINISH);
-
- next_in = (const char *)next_in + in_bytes;
- avail_in -= in_bytes;
- total_in += in_bytes;
-
- next_out = (char *)next_out + out_bytes;
- avail_out -= out_bytes;
- total_out += out_bytes;
-
- if ((status != TDEFL_STATUS_OKAY) || (!avail_out))
- {
- // Output buffer is full, or compression is done or failed, so write buffer to output file.
- uint n = COMP_OUT_BUF_SIZE - (uint)avail_out;
- if (fwrite(s_outbuf, 1, n, pOutfile) != n)
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
- next_out = s_outbuf;
- avail_out = COMP_OUT_BUF_SIZE;
- }
-
- if (status == TDEFL_STATUS_DONE)
- {
- // Compression completed successfully.
- break;
- }
- else if (status != TDEFL_STATUS_OKAY)
- {
- // Compression somehow failed.
- printf("tdefl_compress() failed with status %i!\n", status);
- return EXIT_FAILURE;
- }
- }
- }
- else if ((pMode[0] == 'd') || (pMode[0] == 'D'))
- {
- // Decompression.
- uint infile_remaining = infile_size;
-
- tinfl_decompressor inflator;
- tinfl_init(&inflator);
-
- for ( ; ; )
- {
- size_t in_bytes, out_bytes;
- tinfl_status status;
- if (!avail_in)
- {
- // Input buffer is empty, so read more bytes from input file.
- uint n = my_min(IN_BUF_SIZE, infile_remaining);
-
- if (fread(s_inbuf, 1, n, pInfile) != n)
- {
- printf("Failed reading from input file!\n");
- return EXIT_FAILURE;
- }
-
- next_in = s_inbuf;
- avail_in = n;
-
- infile_remaining -= n;
- }
-
- in_bytes = avail_in;
- out_bytes = avail_out;
- status = tinfl_decompress(&inflator, (const mz_uint8 *)next_in, &in_bytes, s_outbuf, (mz_uint8 *)next_out, &out_bytes, (infile_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0) | TINFL_FLAG_PARSE_ZLIB_HEADER);
-
- avail_in -= in_bytes;
- next_in = (const mz_uint8 *)next_in + in_bytes;
- total_in += in_bytes;
-
- avail_out -= out_bytes;
- next_out = (mz_uint8 *)next_out + out_bytes;
- total_out += out_bytes;
-
- if ((status <= TINFL_STATUS_DONE) || (!avail_out))
- {
- // Output buffer is full, or decompression is done, so write buffer to output file.
- uint n = OUT_BUF_SIZE - (uint)avail_out;
- if (fwrite(s_outbuf, 1, n, pOutfile) != n)
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
- next_out = s_outbuf;
- avail_out = OUT_BUF_SIZE;
- }
-
- // If status is <= TINFL_STATUS_DONE then either decompression is done or something went wrong.
- if (status <= TINFL_STATUS_DONE)
- {
- if (status == TINFL_STATUS_DONE)
- {
- // Decompression completed successfully.
- break;
- }
- else
- {
- // Decompression failed.
- printf("tinfl_decompress() failed with status %i!\n", status);
- return EXIT_FAILURE;
- }
- }
- }
- }
- else
- {
- printf("Invalid mode!\n");
- return EXIT_FAILURE;
- }
-
- fclose(pInfile);
- if (EOF == fclose(pOutfile))
- {
- printf("Failed writing to output file!\n");
- return EXIT_FAILURE;
- }
-
- printf("Total input bytes: %u\n", (mz_uint32)total_in);
- printf("Total output bytes: %u\n", (mz_uint32)total_out);
- printf("Success.\n");
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example6.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example6.c
deleted file mode 100644
index abbb64fe3c..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/examples/example6.c
+++ /dev/null
@@ -1,162 +0,0 @@
-// example6.c - Demonstrates how to miniz's PNG writer func
-// Public domain, April 11 2012, Rich Geldreich, richgel99@gmail.com. See "unlicense" statement at the end of tinfl.c.
-// Mandlebrot set code from http://rosettacode.org/wiki/Mandelbrot_set#C
-// Must link this example against libm on Linux.
-
-// Purposely disable a whole bunch of stuff this low-level example doesn't use.
-#define MINIZ_NO_STDIO
-#define MINIZ_NO_TIME
-#define MINIZ_NO_ZLIB_APIS
-#include "miniz.h"
-
-// Now include stdio.h because this test uses fopen(), etc. (but we still don't want miniz.c's stdio stuff, for testing).
-#include <stdio.h>
-#include <limits.h>
-#include <math.h>
-
-typedef unsigned char uint8;
-typedef unsigned short uint16;
-typedef unsigned int uint;
-
-typedef struct
-{
- uint8 r, g, b;
-} rgb_t;
-
-static void hsv_to_rgb(int hue, int min, int max, rgb_t *p)
-{
- const int invert = 0;
- const int saturation = 1;
- const int color_rotate = 0;
-
- if (min == max) max = min + 1;
- if (invert) hue = max - (hue - min);
- if (!saturation) {
- p->r = p->g = p->b = 255 * (max - hue) / (max - min);
- return;
- }
- double h = fmod(color_rotate + 1e-4 + 4.0 * (hue - min) / (max - min), 6);
- double c = 255.0f * saturation;
- double X = c * (1 - fabs(fmod(h, 2) - 1));
-
- p->r = p->g = p->b = 0;
-
- switch((int)h) {
- case 0: p->r = c; p->g = X; return;
- case 1: p->r = X; p->g = c; return;
- case 2: p->g = c; p->b = X; return;
- case 3: p->g = X; p->b = c; return;
- case 4: p->r = X; p->b = c; return;
- default:p->r = c; p->b = X;
- }
-}
-
-int main(int argc, char *argv[])
-{
- (void)argc, (void)argv;
-
- // Image resolution
- const int iXmax = 4096;
- const int iYmax = 4096;
-
- // Output filename
- static const char *pFilename = "mandelbrot.png";
-
- int iX, iY;
- const double CxMin = -2.5;
- const double CxMax = 1.5;
- const double CyMin = -2.0;
- const double CyMax = 2.0;
-
- double PixelWidth = (CxMax - CxMin) / iXmax;
- double PixelHeight = (CyMax - CyMin) / iYmax;
-
- // Z=Zx+Zy*i ; Z0 = 0
- double Zx, Zy;
- double Zx2, Zy2; // Zx2=Zx*Zx; Zy2=Zy*Zy
-
- int Iteration;
- const int IterationMax = 200;
-
- // bail-out value , radius of circle
- const double EscapeRadius = 2;
- double ER2=EscapeRadius * EscapeRadius;
-
- uint8 *pImage = (uint8 *)malloc(iXmax * 3 * iYmax);
-
- // world ( double) coordinate = parameter plane
- double Cx,Cy;
-
- int MinIter = 9999, MaxIter = 0;
-
- for(iY = 0; iY < iYmax; iY++)
- {
- Cy = CyMin + iY * PixelHeight;
- if (fabs(Cy) < PixelHeight/2)
- Cy = 0.0; // Main antenna
-
- for(iX = 0; iX < iXmax; iX++)
- {
- uint8 *color = pImage + (iX * 3) + (iY * iXmax * 3);
-
- Cx = CxMin + iX * PixelWidth;
-
- // initial value of orbit = critical point Z= 0
- Zx = 0.0;
- Zy = 0.0;
- Zx2 = Zx * Zx;
- Zy2 = Zy * Zy;
-
- for (Iteration=0;Iteration<IterationMax && ((Zx2+Zy2)<ER2);Iteration++)
- {
- Zy = 2 * Zx * Zy + Cy;
- Zx =Zx2 - Zy2 + Cx;
- Zx2 = Zx * Zx;
- Zy2 = Zy * Zy;
- };
-
- color[0] = (uint8)Iteration;
- color[1] = (uint8)Iteration >> 8;
- color[2] = 0;
-
- if (Iteration < MinIter)
- MinIter = Iteration;
- if (Iteration > MaxIter)
- MaxIter = Iteration;
- }
- }
-
- for(iY = 0; iY < iYmax; iY++)
- {
- for(iX = 0; iX < iXmax; iX++)
- {
- uint8 *color = (uint8 *)(pImage + (iX * 3) + (iY * iXmax * 3));
-
- uint Iterations = color[0] | (color[1] << 8U);
-
- hsv_to_rgb(Iterations, MinIter, MaxIter, (rgb_t *)color);
- }
- }
-
- // Now write the PNG image.
- {
- size_t png_data_size = 0;
- void *pPNG_data = tdefl_write_image_to_png_file_in_memory_ex(pImage, iXmax, iYmax, 3, &png_data_size, 6, MZ_FALSE);
- if (!pPNG_data)
- fprintf(stderr, "tdefl_write_image_to_png_file_in_memory_ex() failed!\n");
- else
- {
- FILE *pFile = fopen(pFilename, "wb");
- fwrite(pPNG_data, 1, png_data_size, pFile);
- fclose(pFile);
- printf("Wrote %s\n", pFilename);
- }
-
- // mz_free() is by default just an alias to free() internally, but if you've overridden miniz's allocation funcs you'll probably need to call mz_free().
- mz_free(pPNG_data);
- }
-
- free(pImage);
-
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.c b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.c
deleted file mode 100644
index 87bdedb188..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.c
+++ /dev/null
@@ -1,7733 +0,0 @@
-#include "miniz.h"
-/**************************************************************************
- *
- * Copyright 2013-2014 RAD Game Tools and Valve Software
- * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- **************************************************************************/
-
-
-
-typedef unsigned char mz_validate_uint16[sizeof(mz_uint16) == 2 ? 1 : -1];
-typedef unsigned char mz_validate_uint32[sizeof(mz_uint32) == 4 ? 1 : -1];
-typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1];
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------------- zlib-style API's */
-
-mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
-{
- mz_uint32 i, s1 = (mz_uint32)(adler & 0xffff), s2 = (mz_uint32)(adler >> 16);
- size_t block_len = buf_len % 5552;
- if (!ptr)
- return MZ_ADLER32_INIT;
- while (buf_len)
- {
- for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
- {
- s1 += ptr[0], s2 += s1;
- s1 += ptr[1], s2 += s1;
- s1 += ptr[2], s2 += s1;
- s1 += ptr[3], s2 += s1;
- s1 += ptr[4], s2 += s1;
- s1 += ptr[5], s2 += s1;
- s1 += ptr[6], s2 += s1;
- s1 += ptr[7], s2 += s1;
- }
- for (; i < block_len; ++i)
- s1 += *ptr++, s2 += s1;
- s1 %= 65521U, s2 %= 65521U;
- buf_len -= block_len;
- block_len = 5552;
- }
- return (s2 << 16) + s1;
-}
-
-/* Karl Malbrain's compact CRC-32. See "A compact CCITT crc16 and crc32 C implementation that balances processor cache usage against speed": http://www.geocities.com/malbrain/ */
-#if 0
- mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len)
- {
- static const mz_uint32 s_crc32[16] = { 0, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c,
- 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c };
- mz_uint32 crcu32 = (mz_uint32)crc;
- if (!ptr)
- return MZ_CRC32_INIT;
- crcu32 = ~crcu32;
- while (buf_len--)
- {
- mz_uint8 b = *ptr++;
- crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b & 0xF)];
- crcu32 = (crcu32 >> 4) ^ s_crc32[(crcu32 & 0xF) ^ (b >> 4)];
- }
- return ~crcu32;
- }
-#elif defined(USE_EXTERNAL_MZCRC)
-/* If USE_EXTERNAL_CRC is defined, an external module will export the
- * mz_crc32() symbol for us to use, e.g. an SSE-accelerated version.
- * Depending on the impl, it may be necessary to ~ the input/output crc values.
- */
-mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len);
-#else
-/* Faster, but larger CPU cache footprint.
- */
-mz_ulong mz_crc32(mz_ulong crc, const mz_uint8 *ptr, size_t buf_len)
-{
- static const mz_uint32 s_crc_table[256] =
- {
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535,
- 0x9E6495A3, 0x0EDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD,
- 0xE7B82D07, 0x90BF1D91, 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D,
- 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7, 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC,
- 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5, 0x3B6E20C8, 0x4C69105E, 0xD56041E4,
- 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B, 0x35B5A8FA, 0x42B2986C,
- 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59, 0x26D930AC,
- 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
- 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB,
- 0xB6662D3D, 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F,
- 0x9FBFE4A5, 0xE8B8D433, 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB,
- 0x086D3D2D, 0x91646C97, 0xE6635C01, 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E,
- 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457, 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA,
- 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65, 0x4DB26158, 0x3AB551CE,
- 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB, 0x4369E96A,
- 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
- 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409,
- 0xCE61E49F, 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81,
- 0xB7BD5C3B, 0xC0BA6CAD, 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739,
- 0x9DD277AF, 0x04DB2615, 0x73DC1683, 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8,
- 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1, 0xF00F9344, 0x8708A3D2, 0x1E01F268,
- 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7, 0xFED41B76, 0x89D32BE0,
- 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5, 0xD6D6A3E8,
- 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF,
- 0x4669BE79, 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703,
- 0x220216B9, 0x5505262F, 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7,
- 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D, 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A,
- 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713, 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE,
- 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21, 0x86D3D2D4, 0xF1D4E242,
- 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777, 0x88085AE6,
- 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
- 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D,
- 0x3E6E77DB, 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5,
- 0x47B2CF7F, 0x30B5FFE9, 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605,
- 0xCDD70693, 0x54DE5729, 0x23D967BF, 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94,
- 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
- };
-
- mz_uint32 crc32 = (mz_uint32)crc ^ 0xFFFFFFFF;
- const mz_uint8 *pByte_buf = (const mz_uint8 *)ptr;
-
- while (buf_len >= 4)
- {
- crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[0]) & 0xFF];
- crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[1]) & 0xFF];
- crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[2]) & 0xFF];
- crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[3]) & 0xFF];
- pByte_buf += 4;
- buf_len -= 4;
- }
-
- while (buf_len)
- {
- crc32 = (crc32 >> 8) ^ s_crc_table[(crc32 ^ pByte_buf[0]) & 0xFF];
- ++pByte_buf;
- --buf_len;
- }
-
- return ~crc32;
-}
-#endif
-
-void mz_free(void *p)
-{
- MZ_FREE(p);
-}
-
-MINIZ_EXPORT void *miniz_def_alloc_func(void *opaque, size_t items, size_t size)
-{
- (void)opaque, (void)items, (void)size;
- return MZ_MALLOC(items * size);
-}
-MINIZ_EXPORT void miniz_def_free_func(void *opaque, void *address)
-{
- (void)opaque, (void)address;
- MZ_FREE(address);
-}
-MINIZ_EXPORT void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size)
-{
- (void)opaque, (void)address, (void)items, (void)size;
- return MZ_REALLOC(address, items * size);
-}
-
-const char *mz_version(void)
-{
- return MZ_VERSION;
-}
-
-#ifndef MINIZ_NO_ZLIB_APIS
-
-int mz_deflateInit(mz_streamp pStream, int level)
-{
- return mz_deflateInit2(pStream, level, MZ_DEFLATED, MZ_DEFAULT_WINDOW_BITS, 9, MZ_DEFAULT_STRATEGY);
-}
-
-int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy)
-{
- tdefl_compressor *pComp;
- mz_uint comp_flags = TDEFL_COMPUTE_ADLER32 | tdefl_create_comp_flags_from_zip_params(level, window_bits, strategy);
-
- if (!pStream)
- return MZ_STREAM_ERROR;
- if ((method != MZ_DEFLATED) || ((mem_level < 1) || (mem_level > 9)) || ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS)))
- return MZ_PARAM_ERROR;
-
- pStream->data_type = 0;
- pStream->adler = MZ_ADLER32_INIT;
- pStream->msg = NULL;
- pStream->reserved = 0;
- pStream->total_in = 0;
- pStream->total_out = 0;
- if (!pStream->zalloc)
- pStream->zalloc = miniz_def_alloc_func;
- if (!pStream->zfree)
- pStream->zfree = miniz_def_free_func;
-
- pComp = (tdefl_compressor *)pStream->zalloc(pStream->opaque, 1, sizeof(tdefl_compressor));
- if (!pComp)
- return MZ_MEM_ERROR;
-
- pStream->state = (struct mz_internal_state *)pComp;
-
- if (tdefl_init(pComp, NULL, NULL, comp_flags) != TDEFL_STATUS_OKAY)
- {
- mz_deflateEnd(pStream);
- return MZ_PARAM_ERROR;
- }
-
- return MZ_OK;
-}
-
-int mz_deflateReset(mz_streamp pStream)
-{
- if ((!pStream) || (!pStream->state) || (!pStream->zalloc) || (!pStream->zfree))
- return MZ_STREAM_ERROR;
- pStream->total_in = pStream->total_out = 0;
- tdefl_init((tdefl_compressor *)pStream->state, NULL, NULL, ((tdefl_compressor *)pStream->state)->m_flags);
- return MZ_OK;
-}
-
-int mz_deflate(mz_streamp pStream, int flush)
-{
- size_t in_bytes, out_bytes;
- mz_ulong orig_total_in, orig_total_out;
- int mz_status = MZ_OK;
-
- if ((!pStream) || (!pStream->state) || (flush < 0) || (flush > MZ_FINISH) || (!pStream->next_out))
- return MZ_STREAM_ERROR;
- if (!pStream->avail_out)
- return MZ_BUF_ERROR;
-
- if (flush == MZ_PARTIAL_FLUSH)
- flush = MZ_SYNC_FLUSH;
-
- if (((tdefl_compressor *)pStream->state)->m_prev_return_status == TDEFL_STATUS_DONE)
- return (flush == MZ_FINISH) ? MZ_STREAM_END : MZ_BUF_ERROR;
-
- orig_total_in = pStream->total_in;
- orig_total_out = pStream->total_out;
- for (;;)
- {
- tdefl_status defl_status;
- in_bytes = pStream->avail_in;
- out_bytes = pStream->avail_out;
-
- defl_status = tdefl_compress((tdefl_compressor *)pStream->state, pStream->next_in, &in_bytes, pStream->next_out, &out_bytes, (tdefl_flush)flush);
- pStream->next_in += (mz_uint)in_bytes;
- pStream->avail_in -= (mz_uint)in_bytes;
- pStream->total_in += (mz_uint)in_bytes;
- pStream->adler = tdefl_get_adler32((tdefl_compressor *)pStream->state);
-
- pStream->next_out += (mz_uint)out_bytes;
- pStream->avail_out -= (mz_uint)out_bytes;
- pStream->total_out += (mz_uint)out_bytes;
-
- if (defl_status < 0)
- {
- mz_status = MZ_STREAM_ERROR;
- break;
- }
- else if (defl_status == TDEFL_STATUS_DONE)
- {
- mz_status = MZ_STREAM_END;
- break;
- }
- else if (!pStream->avail_out)
- break;
- else if ((!pStream->avail_in) && (flush != MZ_FINISH))
- {
- if ((flush) || (pStream->total_in != orig_total_in) || (pStream->total_out != orig_total_out))
- break;
- return MZ_BUF_ERROR; /* Can't make forward progress without some input.
- */
- }
- }
- return mz_status;
-}
-
-int mz_deflateEnd(mz_streamp pStream)
-{
- if (!pStream)
- return MZ_STREAM_ERROR;
- if (pStream->state)
- {
- pStream->zfree(pStream->opaque, pStream->state);
- pStream->state = NULL;
- }
- return MZ_OK;
-}
-
-mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len)
-{
- (void)pStream;
- /* This is really over conservative. (And lame, but it's actually pretty tricky to compute a true upper bound given the way tdefl's blocking works.) */
- return MZ_MAX(128 + (source_len * 110) / 100, 128 + source_len + ((source_len / (31 * 1024)) + 1) * 5);
-}
-
-int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level)
-{
- int status;
- mz_stream stream;
- memset(&stream, 0, sizeof(stream));
-
- /* In case mz_ulong is 64-bits (argh I hate longs). */
- if ((source_len | *pDest_len) > 0xFFFFFFFFU)
- return MZ_PARAM_ERROR;
-
- stream.next_in = pSource;
- stream.avail_in = (mz_uint32)source_len;
- stream.next_out = pDest;
- stream.avail_out = (mz_uint32)*pDest_len;
-
- status = mz_deflateInit(&stream, level);
- if (status != MZ_OK)
- return status;
-
- status = mz_deflate(&stream, MZ_FINISH);
- if (status != MZ_STREAM_END)
- {
- mz_deflateEnd(&stream);
- return (status == MZ_OK) ? MZ_BUF_ERROR : status;
- }
-
- *pDest_len = stream.total_out;
- return mz_deflateEnd(&stream);
-}
-
-int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
-{
- return mz_compress2(pDest, pDest_len, pSource, source_len, MZ_DEFAULT_COMPRESSION);
-}
-
-mz_ulong mz_compressBound(mz_ulong source_len)
-{
- return mz_deflateBound(NULL, source_len);
-}
-
-typedef struct
-{
- tinfl_decompressor m_decomp;
- mz_uint m_dict_ofs, m_dict_avail, m_first_call, m_has_flushed;
- int m_window_bits;
- mz_uint8 m_dict[TINFL_LZ_DICT_SIZE];
- tinfl_status m_last_status;
-} inflate_state;
-
-int mz_inflateInit2(mz_streamp pStream, int window_bits)
-{
- inflate_state *pDecomp;
- if (!pStream)
- return MZ_STREAM_ERROR;
- if ((window_bits != MZ_DEFAULT_WINDOW_BITS) && (-window_bits != MZ_DEFAULT_WINDOW_BITS))
- return MZ_PARAM_ERROR;
-
- pStream->data_type = 0;
- pStream->adler = 0;
- pStream->msg = NULL;
- pStream->total_in = 0;
- pStream->total_out = 0;
- pStream->reserved = 0;
- if (!pStream->zalloc)
- pStream->zalloc = miniz_def_alloc_func;
- if (!pStream->zfree)
- pStream->zfree = miniz_def_free_func;
-
- pDecomp = (inflate_state *)pStream->zalloc(pStream->opaque, 1, sizeof(inflate_state));
- if (!pDecomp)
- return MZ_MEM_ERROR;
-
- pStream->state = (struct mz_internal_state *)pDecomp;
-
- tinfl_init(&pDecomp->m_decomp);
- pDecomp->m_dict_ofs = 0;
- pDecomp->m_dict_avail = 0;
- pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT;
- pDecomp->m_first_call = 1;
- pDecomp->m_has_flushed = 0;
- pDecomp->m_window_bits = window_bits;
-
- return MZ_OK;
-}
-
-int mz_inflateInit(mz_streamp pStream)
-{
- return mz_inflateInit2(pStream, MZ_DEFAULT_WINDOW_BITS);
-}
-
-int mz_inflateReset(mz_streamp pStream)
-{
- inflate_state *pDecomp;
- if (!pStream)
- return MZ_STREAM_ERROR;
-
- pStream->data_type = 0;
- pStream->adler = 0;
- pStream->msg = NULL;
- pStream->total_in = 0;
- pStream->total_out = 0;
- pStream->reserved = 0;
-
- pDecomp = (inflate_state *)pStream->state;
-
- tinfl_init(&pDecomp->m_decomp);
- pDecomp->m_dict_ofs = 0;
- pDecomp->m_dict_avail = 0;
- pDecomp->m_last_status = TINFL_STATUS_NEEDS_MORE_INPUT;
- pDecomp->m_first_call = 1;
- pDecomp->m_has_flushed = 0;
- /* pDecomp->m_window_bits = window_bits */;
-
- return MZ_OK;
-}
-
-int mz_inflate(mz_streamp pStream, int flush)
-{
- inflate_state *pState;
- mz_uint n, first_call, decomp_flags = TINFL_FLAG_COMPUTE_ADLER32;
- size_t in_bytes, out_bytes, orig_avail_in;
- tinfl_status status;
-
- if ((!pStream) || (!pStream->state))
- return MZ_STREAM_ERROR;
- if (flush == MZ_PARTIAL_FLUSH)
- flush = MZ_SYNC_FLUSH;
- if ((flush) && (flush != MZ_SYNC_FLUSH) && (flush != MZ_FINISH))
- return MZ_STREAM_ERROR;
-
- pState = (inflate_state *)pStream->state;
- if (pState->m_window_bits > 0)
- decomp_flags |= TINFL_FLAG_PARSE_ZLIB_HEADER;
- orig_avail_in = pStream->avail_in;
-
- first_call = pState->m_first_call;
- pState->m_first_call = 0;
- if (pState->m_last_status < 0)
- return MZ_DATA_ERROR;
-
- if (pState->m_has_flushed && (flush != MZ_FINISH))
- return MZ_STREAM_ERROR;
- pState->m_has_flushed |= (flush == MZ_FINISH);
-
- if ((flush == MZ_FINISH) && (first_call))
- {
- /* MZ_FINISH on the first call implies that the input and output buffers are large enough to hold the entire compressed/decompressed file. */
- decomp_flags |= TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF;
- in_bytes = pStream->avail_in;
- out_bytes = pStream->avail_out;
- status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pStream->next_out, pStream->next_out, &out_bytes, decomp_flags);
- pState->m_last_status = status;
- pStream->next_in += (mz_uint)in_bytes;
- pStream->avail_in -= (mz_uint)in_bytes;
- pStream->total_in += (mz_uint)in_bytes;
- pStream->adler = tinfl_get_adler32(&pState->m_decomp);
- pStream->next_out += (mz_uint)out_bytes;
- pStream->avail_out -= (mz_uint)out_bytes;
- pStream->total_out += (mz_uint)out_bytes;
-
- if (status < 0)
- return MZ_DATA_ERROR;
- else if (status != TINFL_STATUS_DONE)
- {
- pState->m_last_status = TINFL_STATUS_FAILED;
- return MZ_BUF_ERROR;
- }
- return MZ_STREAM_END;
- }
- /* flush != MZ_FINISH then we must assume there's more input. */
- if (flush != MZ_FINISH)
- decomp_flags |= TINFL_FLAG_HAS_MORE_INPUT;
-
- if (pState->m_dict_avail)
- {
- n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
- memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
- pStream->next_out += n;
- pStream->avail_out -= n;
- pStream->total_out += n;
- pState->m_dict_avail -= n;
- pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
- return ((pState->m_last_status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
- }
-
- for (;;)
- {
- in_bytes = pStream->avail_in;
- out_bytes = TINFL_LZ_DICT_SIZE - pState->m_dict_ofs;
-
- status = tinfl_decompress(&pState->m_decomp, pStream->next_in, &in_bytes, pState->m_dict, pState->m_dict + pState->m_dict_ofs, &out_bytes, decomp_flags);
- pState->m_last_status = status;
-
- pStream->next_in += (mz_uint)in_bytes;
- pStream->avail_in -= (mz_uint)in_bytes;
- pStream->total_in += (mz_uint)in_bytes;
- pStream->adler = tinfl_get_adler32(&pState->m_decomp);
-
- pState->m_dict_avail = (mz_uint)out_bytes;
-
- n = MZ_MIN(pState->m_dict_avail, pStream->avail_out);
- memcpy(pStream->next_out, pState->m_dict + pState->m_dict_ofs, n);
- pStream->next_out += n;
- pStream->avail_out -= n;
- pStream->total_out += n;
- pState->m_dict_avail -= n;
- pState->m_dict_ofs = (pState->m_dict_ofs + n) & (TINFL_LZ_DICT_SIZE - 1);
-
- if (status < 0)
- return MZ_DATA_ERROR; /* Stream is corrupted (there could be some uncompressed data left in the output dictionary - oh well). */
- else if ((status == TINFL_STATUS_NEEDS_MORE_INPUT) && (!orig_avail_in))
- return MZ_BUF_ERROR; /* Signal caller that we can't make forward progress without supplying more input or by setting flush to MZ_FINISH. */
- else if (flush == MZ_FINISH)
- {
- /* The output buffer MUST be large to hold the remaining uncompressed data when flush==MZ_FINISH. */
- if (status == TINFL_STATUS_DONE)
- return pState->m_dict_avail ? MZ_BUF_ERROR : MZ_STREAM_END;
- /* status here must be TINFL_STATUS_HAS_MORE_OUTPUT, which means there's at least 1 more byte on the way. If there's no more room left in the output buffer then something is wrong. */
- else if (!pStream->avail_out)
- return MZ_BUF_ERROR;
- }
- else if ((status == TINFL_STATUS_DONE) || (!pStream->avail_in) || (!pStream->avail_out) || (pState->m_dict_avail))
- break;
- }
-
- return ((status == TINFL_STATUS_DONE) && (!pState->m_dict_avail)) ? MZ_STREAM_END : MZ_OK;
-}
-
-int mz_inflateEnd(mz_streamp pStream)
-{
- if (!pStream)
- return MZ_STREAM_ERROR;
- if (pStream->state)
- {
- pStream->zfree(pStream->opaque, pStream->state);
- pStream->state = NULL;
- }
- return MZ_OK;
-}
-int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong *pSource_len)
-{
- mz_stream stream;
- int status;
- memset(&stream, 0, sizeof(stream));
-
- /* In case mz_ulong is 64-bits (argh I hate longs). */
- if ((*pSource_len | *pDest_len) > 0xFFFFFFFFU)
- return MZ_PARAM_ERROR;
-
- stream.next_in = pSource;
- stream.avail_in = (mz_uint32)*pSource_len;
- stream.next_out = pDest;
- stream.avail_out = (mz_uint32)*pDest_len;
-
- status = mz_inflateInit(&stream);
- if (status != MZ_OK)
- return status;
-
- status = mz_inflate(&stream, MZ_FINISH);
- *pSource_len = *pSource_len - stream.avail_in;
- if (status != MZ_STREAM_END)
- {
- mz_inflateEnd(&stream);
- return ((status == MZ_BUF_ERROR) && (!stream.avail_in)) ? MZ_DATA_ERROR : status;
- }
- *pDest_len = stream.total_out;
-
- return mz_inflateEnd(&stream);
-}
-
-int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len)
-{
- return mz_uncompress2(pDest, pDest_len, pSource, &source_len);
-}
-
-const char *mz_error(int err)
-{
- static struct
- {
- int m_err;
- const char *m_pDesc;
- } s_error_descs[] =
- {
- { MZ_OK, "" }, { MZ_STREAM_END, "stream end" }, { MZ_NEED_DICT, "need dictionary" }, { MZ_ERRNO, "file error" }, { MZ_STREAM_ERROR, "stream error" }, { MZ_DATA_ERROR, "data error" }, { MZ_MEM_ERROR, "out of memory" }, { MZ_BUF_ERROR, "buf error" }, { MZ_VERSION_ERROR, "version error" }, { MZ_PARAM_ERROR, "parameter error" }
- };
- mz_uint i;
- for (i = 0; i < sizeof(s_error_descs) / sizeof(s_error_descs[0]); ++i)
- if (s_error_descs[i].m_err == err)
- return s_error_descs[i].m_pDesc;
- return NULL;
-}
-
-#endif /*MINIZ_NO_ZLIB_APIS */
-
-#ifdef __cplusplus
-}
-#endif
-
-/*
- This is free and unencumbered software released into the public domain.
-
- Anyone is free to copy, modify, publish, use, compile, sell, or
- distribute this software, either in source code form or as a compiled
- binary, for any purpose, commercial or non-commercial, and by any
- means.
-
- In jurisdictions that recognize copyright laws, the author or authors
- of this software dedicate any and all copyright interest in the
- software to the public domain. We make this dedication for the benefit
- of the public at large and to the detriment of our heirs and
- successors. We intend this dedication to be an overt act of
- relinquishment in perpetuity of all present and future rights to this
- software under copyright law.
-
- 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 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.
-
- For more information, please refer to <http://unlicense.org/>
-*/
-/**************************************************************************
- *
- * Copyright 2013-2014 RAD Game Tools and Valve Software
- * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- **************************************************************************/
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------------- Low-level Compression (independent from all decompression API's) */
-
-/* Purposely making these tables static for faster init and thread safety. */
-static const mz_uint16 s_tdefl_len_sym[256] =
- {
- 257, 258, 259, 260, 261, 262, 263, 264, 265, 265, 266, 266, 267, 267, 268, 268, 269, 269, 269, 269, 270, 270, 270, 270, 271, 271, 271, 271, 272, 272, 272, 272,
- 273, 273, 273, 273, 273, 273, 273, 273, 274, 274, 274, 274, 274, 274, 274, 274, 275, 275, 275, 275, 275, 275, 275, 275, 276, 276, 276, 276, 276, 276, 276, 276,
- 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 277, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278,
- 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 279, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280, 280,
- 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, 281,
- 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282, 282,
- 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283, 283,
- 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 284, 285
- };
-
-static const mz_uint8 s_tdefl_len_extra[256] =
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0
- };
-
-static const mz_uint8 s_tdefl_small_dist_sym[512] =
- {
- 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17
- };
-
-static const mz_uint8 s_tdefl_small_dist_extra[512] =
- {
- 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7
- };
-
-static const mz_uint8 s_tdefl_large_dist_sym[128] =
- {
- 0, 0, 18, 19, 20, 20, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
- 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29
- };
-
-static const mz_uint8 s_tdefl_large_dist_extra[128] =
- {
- 0, 0, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13
- };
-
-/* Radix sorts tdefl_sym_freq[] array by 16-bit key m_key. Returns ptr to sorted values. */
-typedef struct
-{
- mz_uint16 m_key, m_sym_index;
-} tdefl_sym_freq;
-static tdefl_sym_freq *tdefl_radix_sort_syms(mz_uint num_syms, tdefl_sym_freq *pSyms0, tdefl_sym_freq *pSyms1)
-{
- mz_uint32 total_passes = 2, pass_shift, pass, i, hist[256 * 2];
- tdefl_sym_freq *pCur_syms = pSyms0, *pNew_syms = pSyms1;
- MZ_CLEAR_OBJ(hist);
- for (i = 0; i < num_syms; i++)
- {
- mz_uint freq = pSyms0[i].m_key;
- hist[freq & 0xFF]++;
- hist[256 + ((freq >> 8) & 0xFF)]++;
- }
- while ((total_passes > 1) && (num_syms == hist[(total_passes - 1) * 256]))
- total_passes--;
- for (pass_shift = 0, pass = 0; pass < total_passes; pass++, pass_shift += 8)
- {
- const mz_uint32 *pHist = &hist[pass << 8];
- mz_uint offsets[256], cur_ofs = 0;
- for (i = 0; i < 256; i++)
- {
- offsets[i] = cur_ofs;
- cur_ofs += pHist[i];
- }
- for (i = 0; i < num_syms; i++)
- pNew_syms[offsets[(pCur_syms[i].m_key >> pass_shift) & 0xFF]++] = pCur_syms[i];
- {
- tdefl_sym_freq *t = pCur_syms;
- pCur_syms = pNew_syms;
- pNew_syms = t;
- }
- }
- return pCur_syms;
-}
-
-/* tdefl_calculate_minimum_redundancy() originally written by: Alistair Moffat, alistair@cs.mu.oz.au, Jyrki Katajainen, jyrki@diku.dk, November 1996. */
-static void tdefl_calculate_minimum_redundancy(tdefl_sym_freq *A, int n)
-{
- int root, leaf, next, avbl, used, dpth;
- if (n == 0)
- return;
- else if (n == 1)
- {
- A[0].m_key = 1;
- return;
- }
- A[0].m_key += A[1].m_key;
- root = 0;
- leaf = 2;
- for (next = 1; next < n - 1; next++)
- {
- if (leaf >= n || A[root].m_key < A[leaf].m_key)
- {
- A[next].m_key = A[root].m_key;
- A[root++].m_key = (mz_uint16)next;
- }
- else
- A[next].m_key = A[leaf++].m_key;
- if (leaf >= n || (root < next && A[root].m_key < A[leaf].m_key))
- {
- A[next].m_key = (mz_uint16)(A[next].m_key + A[root].m_key);
- A[root++].m_key = (mz_uint16)next;
- }
- else
- A[next].m_key = (mz_uint16)(A[next].m_key + A[leaf++].m_key);
- }
- A[n - 2].m_key = 0;
- for (next = n - 3; next >= 0; next--)
- A[next].m_key = A[A[next].m_key].m_key + 1;
- avbl = 1;
- used = dpth = 0;
- root = n - 2;
- next = n - 1;
- while (avbl > 0)
- {
- while (root >= 0 && (int)A[root].m_key == dpth)
- {
- used++;
- root--;
- }
- while (avbl > used)
- {
- A[next--].m_key = (mz_uint16)(dpth);
- avbl--;
- }
- avbl = 2 * used;
- dpth++;
- used = 0;
- }
-}
-
-/* Limits canonical Huffman code table's max code size. */
-enum
-{
- TDEFL_MAX_SUPPORTED_HUFF_CODESIZE = 32
-};
-static void tdefl_huffman_enforce_max_code_size(int *pNum_codes, int code_list_len, int max_code_size)
-{
- int i;
- mz_uint32 total = 0;
- if (code_list_len <= 1)
- return;
- for (i = max_code_size + 1; i <= TDEFL_MAX_SUPPORTED_HUFF_CODESIZE; i++)
- pNum_codes[max_code_size] += pNum_codes[i];
- for (i = max_code_size; i > 0; i--)
- total += (((mz_uint32)pNum_codes[i]) << (max_code_size - i));
- while (total != (1UL << max_code_size))
- {
- pNum_codes[max_code_size]--;
- for (i = max_code_size - 1; i > 0; i--)
- if (pNum_codes[i])
- {
- pNum_codes[i]--;
- pNum_codes[i + 1] += 2;
- break;
- }
- total--;
- }
-}
-
-static void tdefl_optimize_huffman_table(tdefl_compressor *d, int table_num, int table_len, int code_size_limit, int static_table)
-{
- int i, j, l, num_codes[1 + TDEFL_MAX_SUPPORTED_HUFF_CODESIZE];
- mz_uint next_code[TDEFL_MAX_SUPPORTED_HUFF_CODESIZE + 1];
- MZ_CLEAR_OBJ(num_codes);
- if (static_table)
- {
- for (i = 0; i < table_len; i++)
- num_codes[d->m_huff_code_sizes[table_num][i]]++;
- }
- else
- {
- tdefl_sym_freq syms0[TDEFL_MAX_HUFF_SYMBOLS], syms1[TDEFL_MAX_HUFF_SYMBOLS], *pSyms;
- int num_used_syms = 0;
- const mz_uint16 *pSym_count = &d->m_huff_count[table_num][0];
- for (i = 0; i < table_len; i++)
- if (pSym_count[i])
- {
- syms0[num_used_syms].m_key = (mz_uint16)pSym_count[i];
- syms0[num_used_syms++].m_sym_index = (mz_uint16)i;
- }
-
- pSyms = tdefl_radix_sort_syms(num_used_syms, syms0, syms1);
- tdefl_calculate_minimum_redundancy(pSyms, num_used_syms);
-
- for (i = 0; i < num_used_syms; i++)
- num_codes[pSyms[i].m_key]++;
-
- tdefl_huffman_enforce_max_code_size(num_codes, num_used_syms, code_size_limit);
-
- MZ_CLEAR_OBJ(d->m_huff_code_sizes[table_num]);
- MZ_CLEAR_OBJ(d->m_huff_codes[table_num]);
- for (i = 1, j = num_used_syms; i <= code_size_limit; i++)
- for (l = num_codes[i]; l > 0; l--)
- d->m_huff_code_sizes[table_num][pSyms[--j].m_sym_index] = (mz_uint8)(i);
- }
-
- next_code[1] = 0;
- for (j = 0, i = 2; i <= code_size_limit; i++)
- next_code[i] = j = ((j + num_codes[i - 1]) << 1);
-
- for (i = 0; i < table_len; i++)
- {
- mz_uint rev_code = 0, code, code_size;
- if ((code_size = d->m_huff_code_sizes[table_num][i]) == 0)
- continue;
- code = next_code[code_size]++;
- for (l = code_size; l > 0; l--, code >>= 1)
- rev_code = (rev_code << 1) | (code & 1);
- d->m_huff_codes[table_num][i] = (mz_uint16)rev_code;
- }
-}
-
-#define TDEFL_PUT_BITS(b, l) \
- do \
- { \
- mz_uint bits = b; \
- mz_uint len = l; \
- MZ_ASSERT(bits <= ((1U << len) - 1U)); \
- d->m_bit_buffer |= (bits << d->m_bits_in); \
- d->m_bits_in += len; \
- while (d->m_bits_in >= 8) \
- { \
- if (d->m_pOutput_buf < d->m_pOutput_buf_end) \
- *d->m_pOutput_buf++ = (mz_uint8)(d->m_bit_buffer); \
- d->m_bit_buffer >>= 8; \
- d->m_bits_in -= 8; \
- } \
- } \
- MZ_MACRO_END
-
-#define TDEFL_RLE_PREV_CODE_SIZE() \
- { \
- if (rle_repeat_count) \
- { \
- if (rle_repeat_count < 3) \
- { \
- d->m_huff_count[2][prev_code_size] = (mz_uint16)(d->m_huff_count[2][prev_code_size] + rle_repeat_count); \
- while (rle_repeat_count--) \
- packed_code_sizes[num_packed_code_sizes++] = prev_code_size; \
- } \
- else \
- { \
- d->m_huff_count[2][16] = (mz_uint16)(d->m_huff_count[2][16] + 1); \
- packed_code_sizes[num_packed_code_sizes++] = 16; \
- packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_repeat_count - 3); \
- } \
- rle_repeat_count = 0; \
- } \
- }
-
-#define TDEFL_RLE_ZERO_CODE_SIZE() \
- { \
- if (rle_z_count) \
- { \
- if (rle_z_count < 3) \
- { \
- d->m_huff_count[2][0] = (mz_uint16)(d->m_huff_count[2][0] + rle_z_count); \
- while (rle_z_count--) \
- packed_code_sizes[num_packed_code_sizes++] = 0; \
- } \
- else if (rle_z_count <= 10) \
- { \
- d->m_huff_count[2][17] = (mz_uint16)(d->m_huff_count[2][17] + 1); \
- packed_code_sizes[num_packed_code_sizes++] = 17; \
- packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 3); \
- } \
- else \
- { \
- d->m_huff_count[2][18] = (mz_uint16)(d->m_huff_count[2][18] + 1); \
- packed_code_sizes[num_packed_code_sizes++] = 18; \
- packed_code_sizes[num_packed_code_sizes++] = (mz_uint8)(rle_z_count - 11); \
- } \
- rle_z_count = 0; \
- } \
- }
-
-static mz_uint8 s_tdefl_packed_code_size_syms_swizzle[] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
-
-static void tdefl_start_dynamic_block(tdefl_compressor *d)
-{
- int num_lit_codes, num_dist_codes, num_bit_lengths;
- mz_uint i, total_code_sizes_to_pack, num_packed_code_sizes, rle_z_count, rle_repeat_count, packed_code_sizes_index;
- mz_uint8 code_sizes_to_pack[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], packed_code_sizes[TDEFL_MAX_HUFF_SYMBOLS_0 + TDEFL_MAX_HUFF_SYMBOLS_1], prev_code_size = 0xFF;
-
- d->m_huff_count[0][256] = 1;
-
- tdefl_optimize_huffman_table(d, 0, TDEFL_MAX_HUFF_SYMBOLS_0, 15, MZ_FALSE);
- tdefl_optimize_huffman_table(d, 1, TDEFL_MAX_HUFF_SYMBOLS_1, 15, MZ_FALSE);
-
- for (num_lit_codes = 286; num_lit_codes > 257; num_lit_codes--)
- if (d->m_huff_code_sizes[0][num_lit_codes - 1])
- break;
- for (num_dist_codes = 30; num_dist_codes > 1; num_dist_codes--)
- if (d->m_huff_code_sizes[1][num_dist_codes - 1])
- break;
-
- memcpy(code_sizes_to_pack, &d->m_huff_code_sizes[0][0], num_lit_codes);
- memcpy(code_sizes_to_pack + num_lit_codes, &d->m_huff_code_sizes[1][0], num_dist_codes);
- total_code_sizes_to_pack = num_lit_codes + num_dist_codes;
- num_packed_code_sizes = 0;
- rle_z_count = 0;
- rle_repeat_count = 0;
-
- memset(&d->m_huff_count[2][0], 0, sizeof(d->m_huff_count[2][0]) * TDEFL_MAX_HUFF_SYMBOLS_2);
- for (i = 0; i < total_code_sizes_to_pack; i++)
- {
- mz_uint8 code_size = code_sizes_to_pack[i];
- if (!code_size)
- {
- TDEFL_RLE_PREV_CODE_SIZE();
- if (++rle_z_count == 138)
- {
- TDEFL_RLE_ZERO_CODE_SIZE();
- }
- }
- else
- {
- TDEFL_RLE_ZERO_CODE_SIZE();
- if (code_size != prev_code_size)
- {
- TDEFL_RLE_PREV_CODE_SIZE();
- d->m_huff_count[2][code_size] = (mz_uint16)(d->m_huff_count[2][code_size] + 1);
- packed_code_sizes[num_packed_code_sizes++] = code_size;
- }
- else if (++rle_repeat_count == 6)
- {
- TDEFL_RLE_PREV_CODE_SIZE();
- }
- }
- prev_code_size = code_size;
- }
- if (rle_repeat_count)
- {
- TDEFL_RLE_PREV_CODE_SIZE();
- }
- else
- {
- TDEFL_RLE_ZERO_CODE_SIZE();
- }
-
- tdefl_optimize_huffman_table(d, 2, TDEFL_MAX_HUFF_SYMBOLS_2, 7, MZ_FALSE);
-
- TDEFL_PUT_BITS(2, 2);
-
- TDEFL_PUT_BITS(num_lit_codes - 257, 5);
- TDEFL_PUT_BITS(num_dist_codes - 1, 5);
-
- for (num_bit_lengths = 18; num_bit_lengths >= 0; num_bit_lengths--)
- if (d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[num_bit_lengths]])
- break;
- num_bit_lengths = MZ_MAX(4, (num_bit_lengths + 1));
- TDEFL_PUT_BITS(num_bit_lengths - 4, 4);
- for (i = 0; (int)i < num_bit_lengths; i++)
- TDEFL_PUT_BITS(d->m_huff_code_sizes[2][s_tdefl_packed_code_size_syms_swizzle[i]], 3);
-
- for (packed_code_sizes_index = 0; packed_code_sizes_index < num_packed_code_sizes;)
- {
- mz_uint code = packed_code_sizes[packed_code_sizes_index++];
- MZ_ASSERT(code < TDEFL_MAX_HUFF_SYMBOLS_2);
- TDEFL_PUT_BITS(d->m_huff_codes[2][code], d->m_huff_code_sizes[2][code]);
- if (code >= 16)
- TDEFL_PUT_BITS(packed_code_sizes[packed_code_sizes_index++], "\02\03\07"[code - 16]);
- }
-}
-
-static void tdefl_start_static_block(tdefl_compressor *d)
-{
- mz_uint i;
- mz_uint8 *p = &d->m_huff_code_sizes[0][0];
-
- for (i = 0; i <= 143; ++i)
- *p++ = 8;
- for (; i <= 255; ++i)
- *p++ = 9;
- for (; i <= 279; ++i)
- *p++ = 7;
- for (; i <= 287; ++i)
- *p++ = 8;
-
- memset(d->m_huff_code_sizes[1], 5, 32);
-
- tdefl_optimize_huffman_table(d, 0, 288, 15, MZ_TRUE);
- tdefl_optimize_huffman_table(d, 1, 32, 15, MZ_TRUE);
-
- TDEFL_PUT_BITS(1, 2);
-}
-
-static const mz_uint mz_bitmasks[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF };
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS
-static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d)
-{
- mz_uint flags;
- mz_uint8 *pLZ_codes;
- mz_uint8 *pOutput_buf = d->m_pOutput_buf;
- mz_uint8 *pLZ_code_buf_end = d->m_pLZ_code_buf;
- mz_uint64 bit_buffer = d->m_bit_buffer;
- mz_uint bits_in = d->m_bits_in;
-
-#define TDEFL_PUT_BITS_FAST(b, l) \
- { \
- bit_buffer |= (((mz_uint64)(b)) << bits_in); \
- bits_in += (l); \
- }
-
- flags = 1;
- for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < pLZ_code_buf_end; flags >>= 1)
- {
- if (flags == 1)
- flags = *pLZ_codes++ | 0x100;
-
- if (flags & 1)
- {
- mz_uint s0, s1, n0, n1, sym, num_extra_bits;
- mz_uint match_len = pLZ_codes[0], match_dist = *(const mz_uint16 *)(pLZ_codes + 1);
- pLZ_codes += 3;
-
- MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
- TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
- TDEFL_PUT_BITS_FAST(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
-
- /* This sequence coaxes MSVC into using cmov's vs. jmp's. */
- s0 = s_tdefl_small_dist_sym[match_dist & 511];
- n0 = s_tdefl_small_dist_extra[match_dist & 511];
- s1 = s_tdefl_large_dist_sym[match_dist >> 8];
- n1 = s_tdefl_large_dist_extra[match_dist >> 8];
- sym = (match_dist < 512) ? s0 : s1;
- num_extra_bits = (match_dist < 512) ? n0 : n1;
-
- MZ_ASSERT(d->m_huff_code_sizes[1][sym]);
- TDEFL_PUT_BITS_FAST(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
- TDEFL_PUT_BITS_FAST(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
- }
- else
- {
- mz_uint lit = *pLZ_codes++;
- MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
- TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
-
- if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
- {
- flags >>= 1;
- lit = *pLZ_codes++;
- MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
- TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
-
- if (((flags & 2) == 0) && (pLZ_codes < pLZ_code_buf_end))
- {
- flags >>= 1;
- lit = *pLZ_codes++;
- MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
- TDEFL_PUT_BITS_FAST(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
- }
- }
- }
-
- if (pOutput_buf >= d->m_pOutput_buf_end)
- return MZ_FALSE;
-
- *(mz_uint64 *)pOutput_buf = bit_buffer;
- pOutput_buf += (bits_in >> 3);
- bit_buffer >>= (bits_in & ~7);
- bits_in &= 7;
- }
-
-#undef TDEFL_PUT_BITS_FAST
-
- d->m_pOutput_buf = pOutput_buf;
- d->m_bits_in = 0;
- d->m_bit_buffer = 0;
-
- while (bits_in)
- {
- mz_uint32 n = MZ_MIN(bits_in, 16);
- TDEFL_PUT_BITS((mz_uint)bit_buffer & mz_bitmasks[n], n);
- bit_buffer >>= n;
- bits_in -= n;
- }
-
- TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
-
- return (d->m_pOutput_buf < d->m_pOutput_buf_end);
-}
-#else
-static mz_bool tdefl_compress_lz_codes(tdefl_compressor *d)
-{
- mz_uint flags;
- mz_uint8 *pLZ_codes;
-
- flags = 1;
- for (pLZ_codes = d->m_lz_code_buf; pLZ_codes < d->m_pLZ_code_buf; flags >>= 1)
- {
- if (flags == 1)
- flags = *pLZ_codes++ | 0x100;
- if (flags & 1)
- {
- mz_uint sym, num_extra_bits;
- mz_uint match_len = pLZ_codes[0], match_dist = (pLZ_codes[1] | (pLZ_codes[2] << 8));
- pLZ_codes += 3;
-
- MZ_ASSERT(d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
- TDEFL_PUT_BITS(d->m_huff_codes[0][s_tdefl_len_sym[match_len]], d->m_huff_code_sizes[0][s_tdefl_len_sym[match_len]]);
- TDEFL_PUT_BITS(match_len & mz_bitmasks[s_tdefl_len_extra[match_len]], s_tdefl_len_extra[match_len]);
-
- if (match_dist < 512)
- {
- sym = s_tdefl_small_dist_sym[match_dist];
- num_extra_bits = s_tdefl_small_dist_extra[match_dist];
- }
- else
- {
- sym = s_tdefl_large_dist_sym[match_dist >> 8];
- num_extra_bits = s_tdefl_large_dist_extra[match_dist >> 8];
- }
- MZ_ASSERT(d->m_huff_code_sizes[1][sym]);
- TDEFL_PUT_BITS(d->m_huff_codes[1][sym], d->m_huff_code_sizes[1][sym]);
- TDEFL_PUT_BITS(match_dist & mz_bitmasks[num_extra_bits], num_extra_bits);
- }
- else
- {
- mz_uint lit = *pLZ_codes++;
- MZ_ASSERT(d->m_huff_code_sizes[0][lit]);
- TDEFL_PUT_BITS(d->m_huff_codes[0][lit], d->m_huff_code_sizes[0][lit]);
- }
- }
-
- TDEFL_PUT_BITS(d->m_huff_codes[0][256], d->m_huff_code_sizes[0][256]);
-
- return (d->m_pOutput_buf < d->m_pOutput_buf_end);
-}
-#endif /* MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN && MINIZ_HAS_64BIT_REGISTERS */
-
-static mz_bool tdefl_compress_block(tdefl_compressor *d, mz_bool static_block)
-{
- if (static_block)
- tdefl_start_static_block(d);
- else
- tdefl_start_dynamic_block(d);
- return tdefl_compress_lz_codes(d);
-}
-
-static int tdefl_flush_block(tdefl_compressor *d, int flush)
-{
- mz_uint saved_bit_buf, saved_bits_in;
- mz_uint8 *pSaved_output_buf;
- mz_bool comp_block_succeeded = MZ_FALSE;
- int n, use_raw_block = ((d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS) != 0) && (d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size;
- mz_uint8 *pOutput_buf_start = ((d->m_pPut_buf_func == NULL) && ((*d->m_pOut_buf_size - d->m_out_buf_ofs) >= TDEFL_OUT_BUF_SIZE)) ? ((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs) : d->m_output_buf;
-
- d->m_pOutput_buf = pOutput_buf_start;
- d->m_pOutput_buf_end = d->m_pOutput_buf + TDEFL_OUT_BUF_SIZE - 16;
-
- MZ_ASSERT(!d->m_output_flush_remaining);
- d->m_output_flush_ofs = 0;
- d->m_output_flush_remaining = 0;
-
- *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> d->m_num_flags_left);
- d->m_pLZ_code_buf -= (d->m_num_flags_left == 8);
-
- if ((d->m_flags & TDEFL_WRITE_ZLIB_HEADER) && (!d->m_block_index))
- {
- TDEFL_PUT_BITS(0x78, 8);
- TDEFL_PUT_BITS(0x01, 8);
- }
-
- TDEFL_PUT_BITS(flush == TDEFL_FINISH, 1);
-
- pSaved_output_buf = d->m_pOutput_buf;
- saved_bit_buf = d->m_bit_buffer;
- saved_bits_in = d->m_bits_in;
-
- if (!use_raw_block)
- comp_block_succeeded = tdefl_compress_block(d, (d->m_flags & TDEFL_FORCE_ALL_STATIC_BLOCKS) || (d->m_total_lz_bytes < 48));
-
- /* If the block gets expanded, forget the current contents of the output buffer and send a raw block instead. */
- if (((use_raw_block) || ((d->m_total_lz_bytes) && ((d->m_pOutput_buf - pSaved_output_buf + 1U) >= d->m_total_lz_bytes))) &&
- ((d->m_lookahead_pos - d->m_lz_code_buf_dict_pos) <= d->m_dict_size))
- {
- mz_uint i;
- d->m_pOutput_buf = pSaved_output_buf;
- d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
- TDEFL_PUT_BITS(0, 2);
- if (d->m_bits_in)
- {
- TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
- }
- for (i = 2; i; --i, d->m_total_lz_bytes ^= 0xFFFF)
- {
- TDEFL_PUT_BITS(d->m_total_lz_bytes & 0xFFFF, 16);
- }
- for (i = 0; i < d->m_total_lz_bytes; ++i)
- {
- TDEFL_PUT_BITS(d->m_dict[(d->m_lz_code_buf_dict_pos + i) & TDEFL_LZ_DICT_SIZE_MASK], 8);
- }
- }
- /* Check for the extremely unlikely (if not impossible) case of the compressed block not fitting into the output buffer when using dynamic codes. */
- else if (!comp_block_succeeded)
- {
- d->m_pOutput_buf = pSaved_output_buf;
- d->m_bit_buffer = saved_bit_buf, d->m_bits_in = saved_bits_in;
- tdefl_compress_block(d, MZ_TRUE);
- }
-
- if (flush)
- {
- if (flush == TDEFL_FINISH)
- {
- if (d->m_bits_in)
- {
- TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
- }
- if (d->m_flags & TDEFL_WRITE_ZLIB_HEADER)
- {
- mz_uint i, a = d->m_adler32;
- for (i = 0; i < 4; i++)
- {
- TDEFL_PUT_BITS((a >> 24) & 0xFF, 8);
- a <<= 8;
- }
- }
- }
- else
- {
- mz_uint i, z = 0;
- TDEFL_PUT_BITS(0, 3);
- if (d->m_bits_in)
- {
- TDEFL_PUT_BITS(0, 8 - d->m_bits_in);
- }
- for (i = 2; i; --i, z ^= 0xFFFF)
- {
- TDEFL_PUT_BITS(z & 0xFFFF, 16);
- }
- }
- }
-
- MZ_ASSERT(d->m_pOutput_buf < d->m_pOutput_buf_end);
-
- memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
- memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
-
- d->m_pLZ_code_buf = d->m_lz_code_buf + 1;
- d->m_pLZ_flags = d->m_lz_code_buf;
- d->m_num_flags_left = 8;
- d->m_lz_code_buf_dict_pos += d->m_total_lz_bytes;
- d->m_total_lz_bytes = 0;
- d->m_block_index++;
-
- if ((n = (int)(d->m_pOutput_buf - pOutput_buf_start)) != 0)
- {
- if (d->m_pPut_buf_func)
- {
- *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
- if (!(*d->m_pPut_buf_func)(d->m_output_buf, n, d->m_pPut_buf_user))
- return (d->m_prev_return_status = TDEFL_STATUS_PUT_BUF_FAILED);
- }
- else if (pOutput_buf_start == d->m_output_buf)
- {
- int bytes_to_copy = (int)MZ_MIN((size_t)n, (size_t)(*d->m_pOut_buf_size - d->m_out_buf_ofs));
- memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf, bytes_to_copy);
- d->m_out_buf_ofs += bytes_to_copy;
- if ((n -= bytes_to_copy) != 0)
- {
- d->m_output_flush_ofs = bytes_to_copy;
- d->m_output_flush_remaining = n;
- }
- }
- else
- {
- d->m_out_buf_ofs += n;
- }
- }
-
- return d->m_output_flush_remaining;
-}
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
-#ifdef MINIZ_UNALIGNED_USE_MEMCPY
-static mz_uint16 TDEFL_READ_UNALIGNED_WORD(const mz_uint8* p)
-{
- mz_uint16 ret;
- memcpy(&ret, p, sizeof(mz_uint16));
- return ret;
-}
-static mz_uint16 TDEFL_READ_UNALIGNED_WORD2(const mz_uint16* p)
-{
- mz_uint16 ret;
- memcpy(&ret, p, sizeof(mz_uint16));
- return ret;
-}
-#else
-#define TDEFL_READ_UNALIGNED_WORD(p) *(const mz_uint16 *)(p)
-#define TDEFL_READ_UNALIGNED_WORD2(p) *(const mz_uint16 *)(p)
-#endif
-static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len)
-{
- mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len;
- mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
- const mz_uint16 *s = (const mz_uint16 *)(d->m_dict + pos), *p, *q;
- mz_uint16 c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]), s01 = TDEFL_READ_UNALIGNED_WORD2(s);
- MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN);
- if (max_match_len <= match_len)
- return;
- for (;;)
- {
- for (;;)
- {
- if (--num_probes_left == 0)
- return;
-#define TDEFL_PROBE \
- next_probe_pos = d->m_next[probe_pos]; \
- if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \
- return; \
- probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
- if (TDEFL_READ_UNALIGNED_WORD(&d->m_dict[probe_pos + match_len - 1]) == c01) \
- break;
- TDEFL_PROBE;
- TDEFL_PROBE;
- TDEFL_PROBE;
- }
- if (!dist)
- break;
- q = (const mz_uint16 *)(d->m_dict + probe_pos);
- if (TDEFL_READ_UNALIGNED_WORD2(q) != s01)
- continue;
- p = s;
- probe_len = 32;
- do
- {
- } while ((TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) &&
- (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
- if (!probe_len)
- {
- *pMatch_dist = dist;
- *pMatch_len = MZ_MIN(max_match_len, (mz_uint)TDEFL_MAX_MATCH_LEN);
- break;
- }
- else if ((probe_len = ((mz_uint)(p - s) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q)) > match_len)
- {
- *pMatch_dist = dist;
- if ((*pMatch_len = match_len = MZ_MIN(max_match_len, probe_len)) == max_match_len)
- break;
- c01 = TDEFL_READ_UNALIGNED_WORD(&d->m_dict[pos + match_len - 1]);
- }
- }
-}
-#else
-static MZ_FORCEINLINE void tdefl_find_match(tdefl_compressor *d, mz_uint lookahead_pos, mz_uint max_dist, mz_uint max_match_len, mz_uint *pMatch_dist, mz_uint *pMatch_len)
-{
- mz_uint dist, pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK, match_len = *pMatch_len, probe_pos = pos, next_probe_pos, probe_len;
- mz_uint num_probes_left = d->m_max_probes[match_len >= 32];
- const mz_uint8 *s = d->m_dict + pos, *p, *q;
- mz_uint8 c0 = d->m_dict[pos + match_len], c1 = d->m_dict[pos + match_len - 1];
- MZ_ASSERT(max_match_len <= TDEFL_MAX_MATCH_LEN);
- if (max_match_len <= match_len)
- return;
- for (;;)
- {
- for (;;)
- {
- if (--num_probes_left == 0)
- return;
-#define TDEFL_PROBE \
- next_probe_pos = d->m_next[probe_pos]; \
- if ((!next_probe_pos) || ((dist = (mz_uint16)(lookahead_pos - next_probe_pos)) > max_dist)) \
- return; \
- probe_pos = next_probe_pos & TDEFL_LZ_DICT_SIZE_MASK; \
- if ((d->m_dict[probe_pos + match_len] == c0) && (d->m_dict[probe_pos + match_len - 1] == c1)) \
- break;
- TDEFL_PROBE;
- TDEFL_PROBE;
- TDEFL_PROBE;
- }
- if (!dist)
- break;
- p = s;
- q = d->m_dict + probe_pos;
- for (probe_len = 0; probe_len < max_match_len; probe_len++)
- if (*p++ != *q++)
- break;
- if (probe_len > match_len)
- {
- *pMatch_dist = dist;
- if ((*pMatch_len = match_len = probe_len) == max_match_len)
- return;
- c0 = d->m_dict[pos + match_len];
- c1 = d->m_dict[pos + match_len - 1];
- }
- }
-}
-#endif /* #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES */
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
-#ifdef MINIZ_UNALIGNED_USE_MEMCPY
-static mz_uint32 TDEFL_READ_UNALIGNED_WORD32(const mz_uint8* p)
-{
- mz_uint32 ret;
- memcpy(&ret, p, sizeof(mz_uint32));
- return ret;
-}
-#else
-#define TDEFL_READ_UNALIGNED_WORD32(p) *(const mz_uint32 *)(p)
-#endif
-static mz_bool tdefl_compress_fast(tdefl_compressor *d)
-{
- /* Faster, minimally featured LZRW1-style match+parse loop with better register utilization. Intended for applications where raw throughput is valued more highly than ratio. */
- mz_uint lookahead_pos = d->m_lookahead_pos, lookahead_size = d->m_lookahead_size, dict_size = d->m_dict_size, total_lz_bytes = d->m_total_lz_bytes, num_flags_left = d->m_num_flags_left;
- mz_uint8 *pLZ_code_buf = d->m_pLZ_code_buf, *pLZ_flags = d->m_pLZ_flags;
- mz_uint cur_pos = lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK;
-
- while ((d->m_src_buf_left) || ((d->m_flush) && (lookahead_size)))
- {
- const mz_uint TDEFL_COMP_FAST_LOOKAHEAD_SIZE = 4096;
- mz_uint dst_pos = (lookahead_pos + lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK;
- mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(d->m_src_buf_left, TDEFL_COMP_FAST_LOOKAHEAD_SIZE - lookahead_size);
- d->m_src_buf_left -= num_bytes_to_process;
- lookahead_size += num_bytes_to_process;
-
- while (num_bytes_to_process)
- {
- mz_uint32 n = MZ_MIN(TDEFL_LZ_DICT_SIZE - dst_pos, num_bytes_to_process);
- memcpy(d->m_dict + dst_pos, d->m_pSrc, n);
- if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
- memcpy(d->m_dict + TDEFL_LZ_DICT_SIZE + dst_pos, d->m_pSrc, MZ_MIN(n, (TDEFL_MAX_MATCH_LEN - 1) - dst_pos));
- d->m_pSrc += n;
- dst_pos = (dst_pos + n) & TDEFL_LZ_DICT_SIZE_MASK;
- num_bytes_to_process -= n;
- }
-
- dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - lookahead_size, dict_size);
- if ((!d->m_flush) && (lookahead_size < TDEFL_COMP_FAST_LOOKAHEAD_SIZE))
- break;
-
- while (lookahead_size >= 4)
- {
- mz_uint cur_match_dist, cur_match_len = 1;
- mz_uint8 *pCur_dict = d->m_dict + cur_pos;
- mz_uint first_trigram = TDEFL_READ_UNALIGNED_WORD32(pCur_dict) & 0xFFFFFF;
- mz_uint hash = (first_trigram ^ (first_trigram >> (24 - (TDEFL_LZ_HASH_BITS - 8)))) & TDEFL_LEVEL1_HASH_SIZE_MASK;
- mz_uint probe_pos = d->m_hash[hash];
- d->m_hash[hash] = (mz_uint16)lookahead_pos;
-
- if (((cur_match_dist = (mz_uint16)(lookahead_pos - probe_pos)) <= dict_size) && ((TDEFL_READ_UNALIGNED_WORD32(d->m_dict + (probe_pos &= TDEFL_LZ_DICT_SIZE_MASK)) & 0xFFFFFF) == first_trigram))
- {
- const mz_uint16 *p = (const mz_uint16 *)pCur_dict;
- const mz_uint16 *q = (const mz_uint16 *)(d->m_dict + probe_pos);
- mz_uint32 probe_len = 32;
- do
- {
- } while ((TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) &&
- (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (TDEFL_READ_UNALIGNED_WORD2(++p) == TDEFL_READ_UNALIGNED_WORD2(++q)) && (--probe_len > 0));
- cur_match_len = ((mz_uint)(p - (const mz_uint16 *)pCur_dict) * 2) + (mz_uint)(*(const mz_uint8 *)p == *(const mz_uint8 *)q);
- if (!probe_len)
- cur_match_len = cur_match_dist ? TDEFL_MAX_MATCH_LEN : 0;
-
- if ((cur_match_len < TDEFL_MIN_MATCH_LEN) || ((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)))
- {
- cur_match_len = 1;
- *pLZ_code_buf++ = (mz_uint8)first_trigram;
- *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
- d->m_huff_count[0][(mz_uint8)first_trigram]++;
- }
- else
- {
- mz_uint32 s0, s1;
- cur_match_len = MZ_MIN(cur_match_len, lookahead_size);
-
- MZ_ASSERT((cur_match_len >= TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 1) && (cur_match_dist <= TDEFL_LZ_DICT_SIZE));
-
- cur_match_dist--;
-
- pLZ_code_buf[0] = (mz_uint8)(cur_match_len - TDEFL_MIN_MATCH_LEN);
-#ifdef MINIZ_UNALIGNED_USE_MEMCPY
- memcpy(&pLZ_code_buf[1], &cur_match_dist, sizeof(cur_match_dist));
-#else
- *(mz_uint16 *)(&pLZ_code_buf[1]) = (mz_uint16)cur_match_dist;
-#endif
- pLZ_code_buf += 3;
- *pLZ_flags = (mz_uint8)((*pLZ_flags >> 1) | 0x80);
-
- s0 = s_tdefl_small_dist_sym[cur_match_dist & 511];
- s1 = s_tdefl_large_dist_sym[cur_match_dist >> 8];
- d->m_huff_count[1][(cur_match_dist < 512) ? s0 : s1]++;
-
- d->m_huff_count[0][s_tdefl_len_sym[cur_match_len - TDEFL_MIN_MATCH_LEN]]++;
- }
- }
- else
- {
- *pLZ_code_buf++ = (mz_uint8)first_trigram;
- *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
- d->m_huff_count[0][(mz_uint8)first_trigram]++;
- }
-
- if (--num_flags_left == 0)
- {
- num_flags_left = 8;
- pLZ_flags = pLZ_code_buf++;
- }
-
- total_lz_bytes += cur_match_len;
- lookahead_pos += cur_match_len;
- dict_size = MZ_MIN(dict_size + cur_match_len, (mz_uint)TDEFL_LZ_DICT_SIZE);
- cur_pos = (cur_pos + cur_match_len) & TDEFL_LZ_DICT_SIZE_MASK;
- MZ_ASSERT(lookahead_size >= cur_match_len);
- lookahead_size -= cur_match_len;
-
- if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
- {
- int n;
- d->m_lookahead_pos = lookahead_pos;
- d->m_lookahead_size = lookahead_size;
- d->m_dict_size = dict_size;
- d->m_total_lz_bytes = total_lz_bytes;
- d->m_pLZ_code_buf = pLZ_code_buf;
- d->m_pLZ_flags = pLZ_flags;
- d->m_num_flags_left = num_flags_left;
- if ((n = tdefl_flush_block(d, 0)) != 0)
- return (n < 0) ? MZ_FALSE : MZ_TRUE;
- total_lz_bytes = d->m_total_lz_bytes;
- pLZ_code_buf = d->m_pLZ_code_buf;
- pLZ_flags = d->m_pLZ_flags;
- num_flags_left = d->m_num_flags_left;
- }
- }
-
- while (lookahead_size)
- {
- mz_uint8 lit = d->m_dict[cur_pos];
-
- total_lz_bytes++;
- *pLZ_code_buf++ = lit;
- *pLZ_flags = (mz_uint8)(*pLZ_flags >> 1);
- if (--num_flags_left == 0)
- {
- num_flags_left = 8;
- pLZ_flags = pLZ_code_buf++;
- }
-
- d->m_huff_count[0][lit]++;
-
- lookahead_pos++;
- dict_size = MZ_MIN(dict_size + 1, (mz_uint)TDEFL_LZ_DICT_SIZE);
- cur_pos = (cur_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK;
- lookahead_size--;
-
- if (pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8])
- {
- int n;
- d->m_lookahead_pos = lookahead_pos;
- d->m_lookahead_size = lookahead_size;
- d->m_dict_size = dict_size;
- d->m_total_lz_bytes = total_lz_bytes;
- d->m_pLZ_code_buf = pLZ_code_buf;
- d->m_pLZ_flags = pLZ_flags;
- d->m_num_flags_left = num_flags_left;
- if ((n = tdefl_flush_block(d, 0)) != 0)
- return (n < 0) ? MZ_FALSE : MZ_TRUE;
- total_lz_bytes = d->m_total_lz_bytes;
- pLZ_code_buf = d->m_pLZ_code_buf;
- pLZ_flags = d->m_pLZ_flags;
- num_flags_left = d->m_num_flags_left;
- }
- }
- }
-
- d->m_lookahead_pos = lookahead_pos;
- d->m_lookahead_size = lookahead_size;
- d->m_dict_size = dict_size;
- d->m_total_lz_bytes = total_lz_bytes;
- d->m_pLZ_code_buf = pLZ_code_buf;
- d->m_pLZ_flags = pLZ_flags;
- d->m_num_flags_left = num_flags_left;
- return MZ_TRUE;
-}
-#endif /* MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN */
-
-static MZ_FORCEINLINE void tdefl_record_literal(tdefl_compressor *d, mz_uint8 lit)
-{
- d->m_total_lz_bytes++;
- *d->m_pLZ_code_buf++ = lit;
- *d->m_pLZ_flags = (mz_uint8)(*d->m_pLZ_flags >> 1);
- if (--d->m_num_flags_left == 0)
- {
- d->m_num_flags_left = 8;
- d->m_pLZ_flags = d->m_pLZ_code_buf++;
- }
- d->m_huff_count[0][lit]++;
-}
-
-static MZ_FORCEINLINE void tdefl_record_match(tdefl_compressor *d, mz_uint match_len, mz_uint match_dist)
-{
- mz_uint32 s0, s1;
-
- MZ_ASSERT((match_len >= TDEFL_MIN_MATCH_LEN) && (match_dist >= 1) && (match_dist <= TDEFL_LZ_DICT_SIZE));
-
- d->m_total_lz_bytes += match_len;
-
- d->m_pLZ_code_buf[0] = (mz_uint8)(match_len - TDEFL_MIN_MATCH_LEN);
-
- match_dist -= 1;
- d->m_pLZ_code_buf[1] = (mz_uint8)(match_dist & 0xFF);
- d->m_pLZ_code_buf[2] = (mz_uint8)(match_dist >> 8);
- d->m_pLZ_code_buf += 3;
-
- *d->m_pLZ_flags = (mz_uint8)((*d->m_pLZ_flags >> 1) | 0x80);
- if (--d->m_num_flags_left == 0)
- {
- d->m_num_flags_left = 8;
- d->m_pLZ_flags = d->m_pLZ_code_buf++;
- }
-
- s0 = s_tdefl_small_dist_sym[match_dist & 511];
- s1 = s_tdefl_large_dist_sym[(match_dist >> 8) & 127];
- d->m_huff_count[1][(match_dist < 512) ? s0 : s1]++;
- d->m_huff_count[0][s_tdefl_len_sym[match_len - TDEFL_MIN_MATCH_LEN]]++;
-}
-
-static mz_bool tdefl_compress_normal(tdefl_compressor *d)
-{
- const mz_uint8 *pSrc = d->m_pSrc;
- size_t src_buf_left = d->m_src_buf_left;
- tdefl_flush flush = d->m_flush;
-
- while ((src_buf_left) || ((flush) && (d->m_lookahead_size)))
- {
- mz_uint len_to_move, cur_match_dist, cur_match_len, cur_pos;
- /* Update dictionary and hash chains. Keeps the lookahead size equal to TDEFL_MAX_MATCH_LEN. */
- if ((d->m_lookahead_size + d->m_dict_size) >= (TDEFL_MIN_MATCH_LEN - 1))
- {
- mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK, ins_pos = d->m_lookahead_pos + d->m_lookahead_size - 2;
- mz_uint hash = (d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK];
- mz_uint num_bytes_to_process = (mz_uint)MZ_MIN(src_buf_left, TDEFL_MAX_MATCH_LEN - d->m_lookahead_size);
- const mz_uint8 *pSrc_end = pSrc + num_bytes_to_process;
- src_buf_left -= num_bytes_to_process;
- d->m_lookahead_size += num_bytes_to_process;
- while (pSrc != pSrc_end)
- {
- mz_uint8 c = *pSrc++;
- d->m_dict[dst_pos] = c;
- if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
- d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c;
- hash = ((hash << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1);
- d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash];
- d->m_hash[hash] = (mz_uint16)(ins_pos);
- dst_pos = (dst_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK;
- ins_pos++;
- }
- }
- else
- {
- while ((src_buf_left) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
- {
- mz_uint8 c = *pSrc++;
- mz_uint dst_pos = (d->m_lookahead_pos + d->m_lookahead_size) & TDEFL_LZ_DICT_SIZE_MASK;
- src_buf_left--;
- d->m_dict[dst_pos] = c;
- if (dst_pos < (TDEFL_MAX_MATCH_LEN - 1))
- d->m_dict[TDEFL_LZ_DICT_SIZE + dst_pos] = c;
- if ((++d->m_lookahead_size + d->m_dict_size) >= TDEFL_MIN_MATCH_LEN)
- {
- mz_uint ins_pos = d->m_lookahead_pos + (d->m_lookahead_size - 1) - 2;
- mz_uint hash = ((d->m_dict[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] << (TDEFL_LZ_HASH_SHIFT * 2)) ^ (d->m_dict[(ins_pos + 1) & TDEFL_LZ_DICT_SIZE_MASK] << TDEFL_LZ_HASH_SHIFT) ^ c) & (TDEFL_LZ_HASH_SIZE - 1);
- d->m_next[ins_pos & TDEFL_LZ_DICT_SIZE_MASK] = d->m_hash[hash];
- d->m_hash[hash] = (mz_uint16)(ins_pos);
- }
- }
- }
- d->m_dict_size = MZ_MIN(TDEFL_LZ_DICT_SIZE - d->m_lookahead_size, d->m_dict_size);
- if ((!flush) && (d->m_lookahead_size < TDEFL_MAX_MATCH_LEN))
- break;
-
- /* Simple lazy/greedy parsing state machine. */
- len_to_move = 1;
- cur_match_dist = 0;
- cur_match_len = d->m_saved_match_len ? d->m_saved_match_len : (TDEFL_MIN_MATCH_LEN - 1);
- cur_pos = d->m_lookahead_pos & TDEFL_LZ_DICT_SIZE_MASK;
- if (d->m_flags & (TDEFL_RLE_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS))
- {
- if ((d->m_dict_size) && (!(d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS)))
- {
- mz_uint8 c = d->m_dict[(cur_pos - 1) & TDEFL_LZ_DICT_SIZE_MASK];
- cur_match_len = 0;
- while (cur_match_len < d->m_lookahead_size)
- {
- if (d->m_dict[cur_pos + cur_match_len] != c)
- break;
- cur_match_len++;
- }
- if (cur_match_len < TDEFL_MIN_MATCH_LEN)
- cur_match_len = 0;
- else
- cur_match_dist = 1;
- }
- }
- else
- {
- tdefl_find_match(d, d->m_lookahead_pos, d->m_dict_size, d->m_lookahead_size, &cur_match_dist, &cur_match_len);
- }
- if (((cur_match_len == TDEFL_MIN_MATCH_LEN) && (cur_match_dist >= 8U * 1024U)) || (cur_pos == cur_match_dist) || ((d->m_flags & TDEFL_FILTER_MATCHES) && (cur_match_len <= 5)))
- {
- cur_match_dist = cur_match_len = 0;
- }
- if (d->m_saved_match_len)
- {
- if (cur_match_len > d->m_saved_match_len)
- {
- tdefl_record_literal(d, (mz_uint8)d->m_saved_lit);
- if (cur_match_len >= 128)
- {
- tdefl_record_match(d, cur_match_len, cur_match_dist);
- d->m_saved_match_len = 0;
- len_to_move = cur_match_len;
- }
- else
- {
- d->m_saved_lit = d->m_dict[cur_pos];
- d->m_saved_match_dist = cur_match_dist;
- d->m_saved_match_len = cur_match_len;
- }
- }
- else
- {
- tdefl_record_match(d, d->m_saved_match_len, d->m_saved_match_dist);
- len_to_move = d->m_saved_match_len - 1;
- d->m_saved_match_len = 0;
- }
- }
- else if (!cur_match_dist)
- tdefl_record_literal(d, d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)]);
- else if ((d->m_greedy_parsing) || (d->m_flags & TDEFL_RLE_MATCHES) || (cur_match_len >= 128))
- {
- tdefl_record_match(d, cur_match_len, cur_match_dist);
- len_to_move = cur_match_len;
- }
- else
- {
- d->m_saved_lit = d->m_dict[MZ_MIN(cur_pos, sizeof(d->m_dict) - 1)];
- d->m_saved_match_dist = cur_match_dist;
- d->m_saved_match_len = cur_match_len;
- }
- /* Move the lookahead forward by len_to_move bytes. */
- d->m_lookahead_pos += len_to_move;
- MZ_ASSERT(d->m_lookahead_size >= len_to_move);
- d->m_lookahead_size -= len_to_move;
- d->m_dict_size = MZ_MIN(d->m_dict_size + len_to_move, (mz_uint)TDEFL_LZ_DICT_SIZE);
- /* Check if it's time to flush the current LZ codes to the internal output buffer. */
- if ((d->m_pLZ_code_buf > &d->m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE - 8]) ||
- ((d->m_total_lz_bytes > 31 * 1024) && (((((mz_uint)(d->m_pLZ_code_buf - d->m_lz_code_buf) * 115) >> 7) >= d->m_total_lz_bytes) || (d->m_flags & TDEFL_FORCE_ALL_RAW_BLOCKS))))
- {
- int n;
- d->m_pSrc = pSrc;
- d->m_src_buf_left = src_buf_left;
- if ((n = tdefl_flush_block(d, 0)) != 0)
- return (n < 0) ? MZ_FALSE : MZ_TRUE;
- }
- }
-
- d->m_pSrc = pSrc;
- d->m_src_buf_left = src_buf_left;
- return MZ_TRUE;
-}
-
-static tdefl_status tdefl_flush_output_buffer(tdefl_compressor *d)
-{
- if (d->m_pIn_buf_size)
- {
- *d->m_pIn_buf_size = d->m_pSrc - (const mz_uint8 *)d->m_pIn_buf;
- }
-
- if (d->m_pOut_buf_size)
- {
- size_t n = MZ_MIN(*d->m_pOut_buf_size - d->m_out_buf_ofs, d->m_output_flush_remaining);
- memcpy((mz_uint8 *)d->m_pOut_buf + d->m_out_buf_ofs, d->m_output_buf + d->m_output_flush_ofs, n);
- d->m_output_flush_ofs += (mz_uint)n;
- d->m_output_flush_remaining -= (mz_uint)n;
- d->m_out_buf_ofs += n;
-
- *d->m_pOut_buf_size = d->m_out_buf_ofs;
- }
-
- return (d->m_finished && !d->m_output_flush_remaining) ? TDEFL_STATUS_DONE : TDEFL_STATUS_OKAY;
-}
-
-tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush)
-{
- if (!d)
- {
- if (pIn_buf_size)
- *pIn_buf_size = 0;
- if (pOut_buf_size)
- *pOut_buf_size = 0;
- return TDEFL_STATUS_BAD_PARAM;
- }
-
- d->m_pIn_buf = pIn_buf;
- d->m_pIn_buf_size = pIn_buf_size;
- d->m_pOut_buf = pOut_buf;
- d->m_pOut_buf_size = pOut_buf_size;
- d->m_pSrc = (const mz_uint8 *)(pIn_buf);
- d->m_src_buf_left = pIn_buf_size ? *pIn_buf_size : 0;
- d->m_out_buf_ofs = 0;
- d->m_flush = flush;
-
- if (((d->m_pPut_buf_func != NULL) == ((pOut_buf != NULL) || (pOut_buf_size != NULL))) || (d->m_prev_return_status != TDEFL_STATUS_OKAY) ||
- (d->m_wants_to_finish && (flush != TDEFL_FINISH)) || (pIn_buf_size && *pIn_buf_size && !pIn_buf) || (pOut_buf_size && *pOut_buf_size && !pOut_buf))
- {
- if (pIn_buf_size)
- *pIn_buf_size = 0;
- if (pOut_buf_size)
- *pOut_buf_size = 0;
- return (d->m_prev_return_status = TDEFL_STATUS_BAD_PARAM);
- }
- d->m_wants_to_finish |= (flush == TDEFL_FINISH);
-
- if ((d->m_output_flush_remaining) || (d->m_finished))
- return (d->m_prev_return_status = tdefl_flush_output_buffer(d));
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
- if (((d->m_flags & TDEFL_MAX_PROBES_MASK) == 1) &&
- ((d->m_flags & TDEFL_GREEDY_PARSING_FLAG) != 0) &&
- ((d->m_flags & (TDEFL_FILTER_MATCHES | TDEFL_FORCE_ALL_RAW_BLOCKS | TDEFL_RLE_MATCHES)) == 0))
- {
- if (!tdefl_compress_fast(d))
- return d->m_prev_return_status;
- }
- else
-#endif /* #if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN */
- {
- if (!tdefl_compress_normal(d))
- return d->m_prev_return_status;
- }
-
- if ((d->m_flags & (TDEFL_WRITE_ZLIB_HEADER | TDEFL_COMPUTE_ADLER32)) && (pIn_buf))
- d->m_adler32 = (mz_uint32)mz_adler32(d->m_adler32, (const mz_uint8 *)pIn_buf, d->m_pSrc - (const mz_uint8 *)pIn_buf);
-
- if ((flush) && (!d->m_lookahead_size) && (!d->m_src_buf_left) && (!d->m_output_flush_remaining))
- {
- if (tdefl_flush_block(d, flush) < 0)
- return d->m_prev_return_status;
- d->m_finished = (flush == TDEFL_FINISH);
- if (flush == TDEFL_FULL_FLUSH)
- {
- MZ_CLEAR_OBJ(d->m_hash);
- MZ_CLEAR_OBJ(d->m_next);
- d->m_dict_size = 0;
- }
- }
-
- return (d->m_prev_return_status = tdefl_flush_output_buffer(d));
-}
-
-tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush)
-{
- MZ_ASSERT(d->m_pPut_buf_func);
- return tdefl_compress(d, pIn_buf, &in_buf_size, NULL, NULL, flush);
-}
-
-tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
-{
- d->m_pPut_buf_func = pPut_buf_func;
- d->m_pPut_buf_user = pPut_buf_user;
- d->m_flags = (mz_uint)(flags);
- d->m_max_probes[0] = 1 + ((flags & 0xFFF) + 2) / 3;
- d->m_greedy_parsing = (flags & TDEFL_GREEDY_PARSING_FLAG) != 0;
- d->m_max_probes[1] = 1 + (((flags & 0xFFF) >> 2) + 2) / 3;
- if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
- MZ_CLEAR_OBJ(d->m_hash);
- d->m_lookahead_pos = d->m_lookahead_size = d->m_dict_size = d->m_total_lz_bytes = d->m_lz_code_buf_dict_pos = d->m_bits_in = 0;
- d->m_output_flush_ofs = d->m_output_flush_remaining = d->m_finished = d->m_block_index = d->m_bit_buffer = d->m_wants_to_finish = 0;
- d->m_pLZ_code_buf = d->m_lz_code_buf + 1;
- d->m_pLZ_flags = d->m_lz_code_buf;
- *d->m_pLZ_flags = 0;
- d->m_num_flags_left = 8;
- d->m_pOutput_buf = d->m_output_buf;
- d->m_pOutput_buf_end = d->m_output_buf;
- d->m_prev_return_status = TDEFL_STATUS_OKAY;
- d->m_saved_match_dist = d->m_saved_match_len = d->m_saved_lit = 0;
- d->m_adler32 = 1;
- d->m_pIn_buf = NULL;
- d->m_pOut_buf = NULL;
- d->m_pIn_buf_size = NULL;
- d->m_pOut_buf_size = NULL;
- d->m_flush = TDEFL_NO_FLUSH;
- d->m_pSrc = NULL;
- d->m_src_buf_left = 0;
- d->m_out_buf_ofs = 0;
- if (!(flags & TDEFL_NONDETERMINISTIC_PARSING_FLAG))
- MZ_CLEAR_OBJ(d->m_dict);
- memset(&d->m_huff_count[0][0], 0, sizeof(d->m_huff_count[0][0]) * TDEFL_MAX_HUFF_SYMBOLS_0);
- memset(&d->m_huff_count[1][0], 0, sizeof(d->m_huff_count[1][0]) * TDEFL_MAX_HUFF_SYMBOLS_1);
- return TDEFL_STATUS_OKAY;
-}
-
-tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d)
-{
- return d->m_prev_return_status;
-}
-
-mz_uint32 tdefl_get_adler32(tdefl_compressor *d)
-{
- return d->m_adler32;
-}
-
-mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
-{
- tdefl_compressor *pComp;
- mz_bool succeeded;
- if (((buf_len) && (!pBuf)) || (!pPut_buf_func))
- return MZ_FALSE;
- pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
- if (!pComp)
- return MZ_FALSE;
- succeeded = (tdefl_init(pComp, pPut_buf_func, pPut_buf_user, flags) == TDEFL_STATUS_OKAY);
- succeeded = succeeded && (tdefl_compress_buffer(pComp, pBuf, buf_len, TDEFL_FINISH) == TDEFL_STATUS_DONE);
- MZ_FREE(pComp);
- return succeeded;
-}
-
-typedef struct
-{
- size_t m_size, m_capacity;
- mz_uint8 *m_pBuf;
- mz_bool m_expandable;
-} tdefl_output_buffer;
-
-static mz_bool tdefl_output_buffer_putter(const void *pBuf, int len, void *pUser)
-{
- tdefl_output_buffer *p = (tdefl_output_buffer *)pUser;
- size_t new_size = p->m_size + len;
- if (new_size > p->m_capacity)
- {
- size_t new_capacity = p->m_capacity;
- mz_uint8 *pNew_buf;
- if (!p->m_expandable)
- return MZ_FALSE;
- do
- {
- new_capacity = MZ_MAX(128U, new_capacity << 1U);
- } while (new_size > new_capacity);
- pNew_buf = (mz_uint8 *)MZ_REALLOC(p->m_pBuf, new_capacity);
- if (!pNew_buf)
- return MZ_FALSE;
- p->m_pBuf = pNew_buf;
- p->m_capacity = new_capacity;
- }
- memcpy((mz_uint8 *)p->m_pBuf + p->m_size, pBuf, len);
- p->m_size = new_size;
- return MZ_TRUE;
-}
-
-void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
-{
- tdefl_output_buffer out_buf;
- MZ_CLEAR_OBJ(out_buf);
- if (!pOut_len)
- return MZ_FALSE;
- else
- *pOut_len = 0;
- out_buf.m_expandable = MZ_TRUE;
- if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
- return NULL;
- *pOut_len = out_buf.m_size;
- return out_buf.m_pBuf;
-}
-
-size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags)
-{
- tdefl_output_buffer out_buf;
- MZ_CLEAR_OBJ(out_buf);
- if (!pOut_buf)
- return 0;
- out_buf.m_pBuf = (mz_uint8 *)pOut_buf;
- out_buf.m_capacity = out_buf_len;
- if (!tdefl_compress_mem_to_output(pSrc_buf, src_buf_len, tdefl_output_buffer_putter, &out_buf, flags))
- return 0;
- return out_buf.m_size;
-}
-
-static const mz_uint s_tdefl_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
-
-/* level may actually range from [0,10] (10 is a "hidden" max level, where we want a bit more compression and it's fine if throughput to fall off a cliff on some files). */
-mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy)
-{
- mz_uint comp_flags = s_tdefl_num_probes[(level >= 0) ? MZ_MIN(10, level) : MZ_DEFAULT_LEVEL] | ((level <= 3) ? TDEFL_GREEDY_PARSING_FLAG : 0);
- if (window_bits > 0)
- comp_flags |= TDEFL_WRITE_ZLIB_HEADER;
-
- if (!level)
- comp_flags |= TDEFL_FORCE_ALL_RAW_BLOCKS;
- else if (strategy == MZ_FILTERED)
- comp_flags |= TDEFL_FILTER_MATCHES;
- else if (strategy == MZ_HUFFMAN_ONLY)
- comp_flags &= ~TDEFL_MAX_PROBES_MASK;
- else if (strategy == MZ_FIXED)
- comp_flags |= TDEFL_FORCE_ALL_STATIC_BLOCKS;
- else if (strategy == MZ_RLE)
- comp_flags |= TDEFL_RLE_MATCHES;
-
- return comp_flags;
-}
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4204) /* nonstandard extension used : non-constant aggregate initializer (also supported by GNU C and C99, so no big deal) */
-#endif
-
-/* Simple PNG writer function by Alex Evans, 2011. Released into the public domain: https://gist.github.com/908299, more context at
- http://altdevblogaday.org/2011/04/06/a-smaller-jpg-encoder/.
- This is actually a modification of Alex's original code so PNG files generated by this function pass pngcheck. */
-void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip)
-{
- /* Using a local copy of this array here in case MINIZ_NO_ZLIB_APIS was defined. */
- static const mz_uint s_tdefl_png_num_probes[11] = { 0, 1, 6, 32, 16, 32, 128, 256, 512, 768, 1500 };
- tdefl_compressor *pComp = (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
- tdefl_output_buffer out_buf;
- int i, bpl = w * num_chans, y, z;
- mz_uint32 c;
- *pLen_out = 0;
- if (!pComp)
- return NULL;
- MZ_CLEAR_OBJ(out_buf);
- out_buf.m_expandable = MZ_TRUE;
- out_buf.m_capacity = 57 + MZ_MAX(64, (1 + bpl) * h);
- if (NULL == (out_buf.m_pBuf = (mz_uint8 *)MZ_MALLOC(out_buf.m_capacity)))
- {
- MZ_FREE(pComp);
- return NULL;
- }
- /* write dummy header */
- for (z = 41; z; --z)
- tdefl_output_buffer_putter(&z, 1, &out_buf);
- /* compress image data */
- tdefl_init(pComp, tdefl_output_buffer_putter, &out_buf, s_tdefl_png_num_probes[MZ_MIN(10, level)] | TDEFL_WRITE_ZLIB_HEADER);
- for (y = 0; y < h; ++y)
- {
- tdefl_compress_buffer(pComp, &z, 1, TDEFL_NO_FLUSH);
- tdefl_compress_buffer(pComp, (mz_uint8 *)pImage + (flip ? (h - 1 - y) : y) * bpl, bpl, TDEFL_NO_FLUSH);
- }
- if (tdefl_compress_buffer(pComp, NULL, 0, TDEFL_FINISH) != TDEFL_STATUS_DONE)
- {
- MZ_FREE(pComp);
- MZ_FREE(out_buf.m_pBuf);
- return NULL;
- }
- /* write real header */
- *pLen_out = out_buf.m_size - 41;
- {
- static const mz_uint8 chans[] = { 0x00, 0x00, 0x04, 0x02, 0x06 };
- mz_uint8 pnghdr[41] = { 0x89, 0x50, 0x4e, 0x47, 0x0d,
- 0x0a, 0x1a, 0x0a, 0x00, 0x00,
- 0x00, 0x0d, 0x49, 0x48, 0x44,
- 0x52, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x49, 0x44, 0x41,
- 0x54 };
- pnghdr[18] = (mz_uint8)(w >> 8);
- pnghdr[19] = (mz_uint8)w;
- pnghdr[22] = (mz_uint8)(h >> 8);
- pnghdr[23] = (mz_uint8)h;
- pnghdr[25] = chans[num_chans];
- pnghdr[33] = (mz_uint8)(*pLen_out >> 24);
- pnghdr[34] = (mz_uint8)(*pLen_out >> 16);
- pnghdr[35] = (mz_uint8)(*pLen_out >> 8);
- pnghdr[36] = (mz_uint8)*pLen_out;
- c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, pnghdr + 12, 17);
- for (i = 0; i < 4; ++i, c <<= 8)
- ((mz_uint8 *)(pnghdr + 29))[i] = (mz_uint8)(c >> 24);
- memcpy(out_buf.m_pBuf, pnghdr, 41);
- }
- /* write footer (IDAT CRC-32, followed by IEND chunk) */
- if (!tdefl_output_buffer_putter("\0\0\0\0\0\0\0\0\x49\x45\x4e\x44\xae\x42\x60\x82", 16, &out_buf))
- {
- *pLen_out = 0;
- MZ_FREE(pComp);
- MZ_FREE(out_buf.m_pBuf);
- return NULL;
- }
- c = (mz_uint32)mz_crc32(MZ_CRC32_INIT, out_buf.m_pBuf + 41 - 4, *pLen_out + 4);
- for (i = 0; i < 4; ++i, c <<= 8)
- (out_buf.m_pBuf + out_buf.m_size - 16)[i] = (mz_uint8)(c >> 24);
- /* compute final size of file, grab compressed data buffer and return */
- *pLen_out += 57;
- MZ_FREE(pComp);
- return out_buf.m_pBuf;
-}
-void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out)
-{
- /* Level 6 corresponds to TDEFL_DEFAULT_MAX_PROBES or MZ_DEFAULT_LEVEL (but we can't depend on MZ_DEFAULT_LEVEL being available in case the zlib API's where #defined out) */
- return tdefl_write_image_to_png_file_in_memory_ex(pImage, w, h, num_chans, pLen_out, 6, MZ_FALSE);
-}
-
-#ifndef MINIZ_NO_MALLOC
-/* Allocate the tdefl_compressor and tinfl_decompressor structures in C so that */
-/* non-C language bindings to tdefL_ and tinfl_ API don't need to worry about */
-/* structure size and allocation mechanism. */
-tdefl_compressor *tdefl_compressor_alloc()
-{
- return (tdefl_compressor *)MZ_MALLOC(sizeof(tdefl_compressor));
-}
-
-void tdefl_compressor_free(tdefl_compressor *pComp)
-{
- MZ_FREE(pComp);
-}
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
- /**************************************************************************
- *
- * Copyright 2013-2014 RAD Game Tools and Valve Software
- * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- **************************************************************************/
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------------- Low-level Decompression (completely independent from all compression API's) */
-
-#define TINFL_MEMCPY(d, s, l) memcpy(d, s, l)
-#define TINFL_MEMSET(p, c, l) memset(p, c, l)
-
-#define TINFL_CR_BEGIN \
- switch (r->m_state) \
- { \
- case 0:
-#define TINFL_CR_RETURN(state_index, result) \
- do \
- { \
- status = result; \
- r->m_state = state_index; \
- goto common_exit; \
- case state_index:; \
- } \
- MZ_MACRO_END
-#define TINFL_CR_RETURN_FOREVER(state_index, result) \
- do \
- { \
- for (;;) \
- { \
- TINFL_CR_RETURN(state_index, result); \
- } \
- } \
- MZ_MACRO_END
-#define TINFL_CR_FINISH }
-
-#define TINFL_GET_BYTE(state_index, c) \
- do \
- { \
- while (pIn_buf_cur >= pIn_buf_end) \
- { \
- TINFL_CR_RETURN(state_index, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS); \
- } \
- c = *pIn_buf_cur++; \
- } \
- MZ_MACRO_END
-
-#define TINFL_NEED_BITS(state_index, n) \
- do \
- { \
- mz_uint c; \
- TINFL_GET_BYTE(state_index, c); \
- bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \
- num_bits += 8; \
- } while (num_bits < (mz_uint)(n))
-#define TINFL_SKIP_BITS(state_index, n) \
- do \
- { \
- if (num_bits < (mz_uint)(n)) \
- { \
- TINFL_NEED_BITS(state_index, n); \
- } \
- bit_buf >>= (n); \
- num_bits -= (n); \
- } \
- MZ_MACRO_END
-#define TINFL_GET_BITS(state_index, b, n) \
- do \
- { \
- if (num_bits < (mz_uint)(n)) \
- { \
- TINFL_NEED_BITS(state_index, n); \
- } \
- b = bit_buf & ((1 << (n)) - 1); \
- bit_buf >>= (n); \
- num_bits -= (n); \
- } \
- MZ_MACRO_END
-
-/* TINFL_HUFF_BITBUF_FILL() is only used rarely, when the number of bytes remaining in the input buffer falls below 2. */
-/* It reads just enough bytes from the input stream that are needed to decode the next Huffman code (and absolutely no more). It works by trying to fully decode a */
-/* Huffman code by using whatever bits are currently present in the bit buffer. If this fails, it reads another byte, and tries again until it succeeds or until the */
-/* bit buffer contains >=15 bits (deflate's max. Huffman code size). */
-#define TINFL_HUFF_BITBUF_FILL(state_index, pHuff) \
- do \
- { \
- temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]; \
- if (temp >= 0) \
- { \
- code_len = temp >> 9; \
- if ((code_len) && (num_bits >= code_len)) \
- break; \
- } \
- else if (num_bits > TINFL_FAST_LOOKUP_BITS) \
- { \
- code_len = TINFL_FAST_LOOKUP_BITS; \
- do \
- { \
- temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \
- } while ((temp < 0) && (num_bits >= (code_len + 1))); \
- if (temp >= 0) \
- break; \
- } \
- TINFL_GET_BYTE(state_index, c); \
- bit_buf |= (((tinfl_bit_buf_t)c) << num_bits); \
- num_bits += 8; \
- } while (num_bits < 15);
-
-/* TINFL_HUFF_DECODE() decodes the next Huffman coded symbol. It's more complex than you would initially expect because the zlib API expects the decompressor to never read */
-/* beyond the final byte of the deflate stream. (In other words, when this macro wants to read another byte from the input, it REALLY needs another byte in order to fully */
-/* decode the next Huffman code.) Handling this properly is particularly important on raw deflate (non-zlib) streams, which aren't followed by a byte aligned adler-32. */
-/* The slow path is only executed at the very end of the input buffer. */
-/* v1.16: The original macro handled the case at the very end of the passed-in input buffer, but we also need to handle the case where the user passes in 1+zillion bytes */
-/* following the deflate data and our non-conservative read-ahead path won't kick in here on this code. This is much trickier. */
-#define TINFL_HUFF_DECODE(state_index, sym, pHuff) \
- do \
- { \
- int temp; \
- mz_uint code_len, c; \
- if (num_bits < 15) \
- { \
- if ((pIn_buf_end - pIn_buf_cur) < 2) \
- { \
- TINFL_HUFF_BITBUF_FILL(state_index, pHuff); \
- } \
- else \
- { \
- bit_buf |= (((tinfl_bit_buf_t)pIn_buf_cur[0]) << num_bits) | (((tinfl_bit_buf_t)pIn_buf_cur[1]) << (num_bits + 8)); \
- pIn_buf_cur += 2; \
- num_bits += 16; \
- } \
- } \
- if ((temp = (pHuff)->m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0) \
- code_len = temp >> 9, temp &= 511; \
- else \
- { \
- code_len = TINFL_FAST_LOOKUP_BITS; \
- do \
- { \
- temp = (pHuff)->m_tree[~temp + ((bit_buf >> code_len++) & 1)]; \
- } while (temp < 0); \
- } \
- sym = temp; \
- bit_buf >>= code_len; \
- num_bits -= code_len; \
- } \
- MZ_MACRO_END
-
-tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags)
-{
- static const int s_length_base[31] = { 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 };
- static const int s_length_extra[31] = { 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0 };
- static const int s_dist_base[32] = { 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 0, 0 };
- static const int s_dist_extra[32] = { 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13 };
- static const mz_uint8 s_length_dezigzag[19] = { 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 };
- static const int s_min_table_sizes[3] = { 257, 1, 4 };
-
- tinfl_status status = TINFL_STATUS_FAILED;
- mz_uint32 num_bits, dist, counter, num_extra;
- tinfl_bit_buf_t bit_buf;
- const mz_uint8 *pIn_buf_cur = pIn_buf_next, *const pIn_buf_end = pIn_buf_next + *pIn_buf_size;
- mz_uint8 *pOut_buf_cur = pOut_buf_next, *const pOut_buf_end = pOut_buf_next + *pOut_buf_size;
- size_t out_buf_size_mask = (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF) ? (size_t)-1 : ((pOut_buf_next - pOut_buf_start) + *pOut_buf_size) - 1, dist_from_out_buf_start;
-
- /* Ensure the output buffer's size is a power of 2, unless the output buffer is large enough to hold the entire output file (in which case it doesn't matter). */
- if (((out_buf_size_mask + 1) & out_buf_size_mask) || (pOut_buf_next < pOut_buf_start))
- {
- *pIn_buf_size = *pOut_buf_size = 0;
- return TINFL_STATUS_BAD_PARAM;
- }
-
- num_bits = r->m_num_bits;
- bit_buf = r->m_bit_buf;
- dist = r->m_dist;
- counter = r->m_counter;
- num_extra = r->m_num_extra;
- dist_from_out_buf_start = r->m_dist_from_out_buf_start;
- TINFL_CR_BEGIN
-
- bit_buf = num_bits = dist = counter = num_extra = r->m_zhdr0 = r->m_zhdr1 = 0;
- r->m_z_adler32 = r->m_check_adler32 = 1;
- if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
- {
- TINFL_GET_BYTE(1, r->m_zhdr0);
- TINFL_GET_BYTE(2, r->m_zhdr1);
- counter = (((r->m_zhdr0 * 256 + r->m_zhdr1) % 31 != 0) || (r->m_zhdr1 & 32) || ((r->m_zhdr0 & 15) != 8));
- if (!(decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
- counter |= (((1U << (8U + (r->m_zhdr0 >> 4))) > 32768U) || ((out_buf_size_mask + 1) < (size_t)(1U << (8U + (r->m_zhdr0 >> 4)))));
- if (counter)
- {
- TINFL_CR_RETURN_FOREVER(36, TINFL_STATUS_FAILED);
- }
- }
-
- do
- {
- TINFL_GET_BITS(3, r->m_final, 3);
- r->m_type = r->m_final >> 1;
- if (r->m_type == 0)
- {
- TINFL_SKIP_BITS(5, num_bits & 7);
- for (counter = 0; counter < 4; ++counter)
- {
- if (num_bits)
- TINFL_GET_BITS(6, r->m_raw_header[counter], 8);
- else
- TINFL_GET_BYTE(7, r->m_raw_header[counter]);
- }
- if ((counter = (r->m_raw_header[0] | (r->m_raw_header[1] << 8))) != (mz_uint)(0xFFFF ^ (r->m_raw_header[2] | (r->m_raw_header[3] << 8))))
- {
- TINFL_CR_RETURN_FOREVER(39, TINFL_STATUS_FAILED);
- }
- while ((counter) && (num_bits))
- {
- TINFL_GET_BITS(51, dist, 8);
- while (pOut_buf_cur >= pOut_buf_end)
- {
- TINFL_CR_RETURN(52, TINFL_STATUS_HAS_MORE_OUTPUT);
- }
- *pOut_buf_cur++ = (mz_uint8)dist;
- counter--;
- }
- while (counter)
- {
- size_t n;
- while (pOut_buf_cur >= pOut_buf_end)
- {
- TINFL_CR_RETURN(9, TINFL_STATUS_HAS_MORE_OUTPUT);
- }
- while (pIn_buf_cur >= pIn_buf_end)
- {
- TINFL_CR_RETURN(38, (decomp_flags & TINFL_FLAG_HAS_MORE_INPUT) ? TINFL_STATUS_NEEDS_MORE_INPUT : TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS);
- }
- n = MZ_MIN(MZ_MIN((size_t)(pOut_buf_end - pOut_buf_cur), (size_t)(pIn_buf_end - pIn_buf_cur)), counter);
- TINFL_MEMCPY(pOut_buf_cur, pIn_buf_cur, n);
- pIn_buf_cur += n;
- pOut_buf_cur += n;
- counter -= (mz_uint)n;
- }
- }
- else if (r->m_type == 3)
- {
- TINFL_CR_RETURN_FOREVER(10, TINFL_STATUS_FAILED);
- }
- else
- {
- if (r->m_type == 1)
- {
- mz_uint8 *p = r->m_tables[0].m_code_size;
- mz_uint i;
- r->m_table_sizes[0] = 288;
- r->m_table_sizes[1] = 32;
- TINFL_MEMSET(r->m_tables[1].m_code_size, 5, 32);
- for (i = 0; i <= 143; ++i)
- *p++ = 8;
- for (; i <= 255; ++i)
- *p++ = 9;
- for (; i <= 279; ++i)
- *p++ = 7;
- for (; i <= 287; ++i)
- *p++ = 8;
- }
- else
- {
- for (counter = 0; counter < 3; counter++)
- {
- TINFL_GET_BITS(11, r->m_table_sizes[counter], "\05\05\04"[counter]);
- r->m_table_sizes[counter] += s_min_table_sizes[counter];
- }
- MZ_CLEAR_OBJ(r->m_tables[2].m_code_size);
- for (counter = 0; counter < r->m_table_sizes[2]; counter++)
- {
- mz_uint s;
- TINFL_GET_BITS(14, s, 3);
- r->m_tables[2].m_code_size[s_length_dezigzag[counter]] = (mz_uint8)s;
- }
- r->m_table_sizes[2] = 19;
- }
- for (; (int)r->m_type >= 0; r->m_type--)
- {
- int tree_next, tree_cur;
- tinfl_huff_table *pTable;
- mz_uint i, j, used_syms, total, sym_index, next_code[17], total_syms[16];
- pTable = &r->m_tables[r->m_type];
- MZ_CLEAR_OBJ(total_syms);
- MZ_CLEAR_OBJ(pTable->m_look_up);
- MZ_CLEAR_OBJ(pTable->m_tree);
- for (i = 0; i < r->m_table_sizes[r->m_type]; ++i)
- total_syms[pTable->m_code_size[i]]++;
- used_syms = 0, total = 0;
- next_code[0] = next_code[1] = 0;
- for (i = 1; i <= 15; ++i)
- {
- used_syms += total_syms[i];
- next_code[i + 1] = (total = ((total + total_syms[i]) << 1));
- }
- if ((65536 != total) && (used_syms > 1))
- {
- TINFL_CR_RETURN_FOREVER(35, TINFL_STATUS_FAILED);
- }
- for (tree_next = -1, sym_index = 0; sym_index < r->m_table_sizes[r->m_type]; ++sym_index)
- {
- mz_uint rev_code = 0, l, cur_code, code_size = pTable->m_code_size[sym_index];
- if (!code_size)
- continue;
- cur_code = next_code[code_size]++;
- for (l = code_size; l > 0; l--, cur_code >>= 1)
- rev_code = (rev_code << 1) | (cur_code & 1);
- if (code_size <= TINFL_FAST_LOOKUP_BITS)
- {
- mz_int16 k = (mz_int16)((code_size << 9) | sym_index);
- while (rev_code < TINFL_FAST_LOOKUP_SIZE)
- {
- pTable->m_look_up[rev_code] = k;
- rev_code += (1 << code_size);
- }
- continue;
- }
- if (0 == (tree_cur = pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)]))
- {
- pTable->m_look_up[rev_code & (TINFL_FAST_LOOKUP_SIZE - 1)] = (mz_int16)tree_next;
- tree_cur = tree_next;
- tree_next -= 2;
- }
- rev_code >>= (TINFL_FAST_LOOKUP_BITS - 1);
- for (j = code_size; j > (TINFL_FAST_LOOKUP_BITS + 1); j--)
- {
- tree_cur -= ((rev_code >>= 1) & 1);
- if (!pTable->m_tree[-tree_cur - 1])
- {
- pTable->m_tree[-tree_cur - 1] = (mz_int16)tree_next;
- tree_cur = tree_next;
- tree_next -= 2;
- }
- else
- tree_cur = pTable->m_tree[-tree_cur - 1];
- }
- tree_cur -= ((rev_code >>= 1) & 1);
- pTable->m_tree[-tree_cur - 1] = (mz_int16)sym_index;
- }
- if (r->m_type == 2)
- {
- for (counter = 0; counter < (r->m_table_sizes[0] + r->m_table_sizes[1]);)
- {
- mz_uint s;
- TINFL_HUFF_DECODE(16, dist, &r->m_tables[2]);
- if (dist < 16)
- {
- r->m_len_codes[counter++] = (mz_uint8)dist;
- continue;
- }
- if ((dist == 16) && (!counter))
- {
- TINFL_CR_RETURN_FOREVER(17, TINFL_STATUS_FAILED);
- }
- num_extra = "\02\03\07"[dist - 16];
- TINFL_GET_BITS(18, s, num_extra);
- s += "\03\03\013"[dist - 16];
- TINFL_MEMSET(r->m_len_codes + counter, (dist == 16) ? r->m_len_codes[counter - 1] : 0, s);
- counter += s;
- }
- if ((r->m_table_sizes[0] + r->m_table_sizes[1]) != counter)
- {
- TINFL_CR_RETURN_FOREVER(21, TINFL_STATUS_FAILED);
- }
- TINFL_MEMCPY(r->m_tables[0].m_code_size, r->m_len_codes, r->m_table_sizes[0]);
- TINFL_MEMCPY(r->m_tables[1].m_code_size, r->m_len_codes + r->m_table_sizes[0], r->m_table_sizes[1]);
- }
- }
- for (;;)
- {
- mz_uint8 *pSrc;
- for (;;)
- {
- if (((pIn_buf_end - pIn_buf_cur) < 4) || ((pOut_buf_end - pOut_buf_cur) < 2))
- {
- TINFL_HUFF_DECODE(23, counter, &r->m_tables[0]);
- if (counter >= 256)
- break;
- while (pOut_buf_cur >= pOut_buf_end)
- {
- TINFL_CR_RETURN(24, TINFL_STATUS_HAS_MORE_OUTPUT);
- }
- *pOut_buf_cur++ = (mz_uint8)counter;
- }
- else
- {
- int sym2;
- mz_uint code_len;
-#if TINFL_USE_64BIT_BITBUF
- if (num_bits < 30)
- {
- bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE32(pIn_buf_cur)) << num_bits);
- pIn_buf_cur += 4;
- num_bits += 32;
- }
-#else
- if (num_bits < 15)
- {
- bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits);
- pIn_buf_cur += 2;
- num_bits += 16;
- }
-#endif
- if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
- code_len = sym2 >> 9;
- else
- {
- code_len = TINFL_FAST_LOOKUP_BITS;
- do
- {
- sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)];
- } while (sym2 < 0);
- }
- counter = sym2;
- bit_buf >>= code_len;
- num_bits -= code_len;
- if (counter & 256)
- break;
-
-#if !TINFL_USE_64BIT_BITBUF
- if (num_bits < 15)
- {
- bit_buf |= (((tinfl_bit_buf_t)MZ_READ_LE16(pIn_buf_cur)) << num_bits);
- pIn_buf_cur += 2;
- num_bits += 16;
- }
-#endif
- if ((sym2 = r->m_tables[0].m_look_up[bit_buf & (TINFL_FAST_LOOKUP_SIZE - 1)]) >= 0)
- code_len = sym2 >> 9;
- else
- {
- code_len = TINFL_FAST_LOOKUP_BITS;
- do
- {
- sym2 = r->m_tables[0].m_tree[~sym2 + ((bit_buf >> code_len++) & 1)];
- } while (sym2 < 0);
- }
- bit_buf >>= code_len;
- num_bits -= code_len;
-
- pOut_buf_cur[0] = (mz_uint8)counter;
- if (sym2 & 256)
- {
- pOut_buf_cur++;
- counter = sym2;
- break;
- }
- pOut_buf_cur[1] = (mz_uint8)sym2;
- pOut_buf_cur += 2;
- }
- }
- if ((counter &= 511) == 256)
- break;
-
- num_extra = s_length_extra[counter - 257];
- counter = s_length_base[counter - 257];
- if (num_extra)
- {
- mz_uint extra_bits;
- TINFL_GET_BITS(25, extra_bits, num_extra);
- counter += extra_bits;
- }
-
- TINFL_HUFF_DECODE(26, dist, &r->m_tables[1]);
- num_extra = s_dist_extra[dist];
- dist = s_dist_base[dist];
- if (num_extra)
- {
- mz_uint extra_bits;
- TINFL_GET_BITS(27, extra_bits, num_extra);
- dist += extra_bits;
- }
-
- dist_from_out_buf_start = pOut_buf_cur - pOut_buf_start;
- if ((dist == 0 || dist > dist_from_out_buf_start || dist_from_out_buf_start == 0) && (decomp_flags & TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF))
- {
- TINFL_CR_RETURN_FOREVER(37, TINFL_STATUS_FAILED);
- }
-
- pSrc = pOut_buf_start + ((dist_from_out_buf_start - dist) & out_buf_size_mask);
-
- if ((MZ_MAX(pOut_buf_cur, pSrc) + counter) > pOut_buf_end)
- {
- while (counter--)
- {
- while (pOut_buf_cur >= pOut_buf_end)
- {
- TINFL_CR_RETURN(53, TINFL_STATUS_HAS_MORE_OUTPUT);
- }
- *pOut_buf_cur++ = pOut_buf_start[(dist_from_out_buf_start++ - dist) & out_buf_size_mask];
- }
- continue;
- }
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES
- else if ((counter >= 9) && (counter <= dist))
- {
- const mz_uint8 *pSrc_end = pSrc + (counter & ~7);
- do
- {
-#ifdef MINIZ_UNALIGNED_USE_MEMCPY
- memcpy(pOut_buf_cur, pSrc, sizeof(mz_uint32)*2);
-#else
- ((mz_uint32 *)pOut_buf_cur)[0] = ((const mz_uint32 *)pSrc)[0];
- ((mz_uint32 *)pOut_buf_cur)[1] = ((const mz_uint32 *)pSrc)[1];
-#endif
- pOut_buf_cur += 8;
- } while ((pSrc += 8) < pSrc_end);
- if ((counter &= 7) < 3)
- {
- if (counter)
- {
- pOut_buf_cur[0] = pSrc[0];
- if (counter > 1)
- pOut_buf_cur[1] = pSrc[1];
- pOut_buf_cur += counter;
- }
- continue;
- }
- }
-#endif
- while(counter>2)
- {
- pOut_buf_cur[0] = pSrc[0];
- pOut_buf_cur[1] = pSrc[1];
- pOut_buf_cur[2] = pSrc[2];
- pOut_buf_cur += 3;
- pSrc += 3;
- counter -= 3;
- }
- if (counter > 0)
- {
- pOut_buf_cur[0] = pSrc[0];
- if (counter > 1)
- pOut_buf_cur[1] = pSrc[1];
- pOut_buf_cur += counter;
- }
- }
- }
- } while (!(r->m_final & 1));
-
- /* Ensure byte alignment and put back any bytes from the bitbuf if we've looked ahead too far on gzip, or other Deflate streams followed by arbitrary data. */
- /* I'm being super conservative here. A number of simplifications can be made to the byte alignment part, and the Adler32 check shouldn't ever need to worry about reading from the bitbuf now. */
- TINFL_SKIP_BITS(32, num_bits & 7);
- while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
- {
- --pIn_buf_cur;
- num_bits -= 8;
- }
- bit_buf &= (tinfl_bit_buf_t)((((mz_uint64)1) << num_bits) - (mz_uint64)1);
- MZ_ASSERT(!num_bits); /* if this assert fires then we've read beyond the end of non-deflate/zlib streams with following data (such as gzip streams). */
-
- if (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER)
- {
- for (counter = 0; counter < 4; ++counter)
- {
- mz_uint s;
- if (num_bits)
- TINFL_GET_BITS(41, s, 8);
- else
- TINFL_GET_BYTE(42, s);
- r->m_z_adler32 = (r->m_z_adler32 << 8) | s;
- }
- }
- TINFL_CR_RETURN_FOREVER(34, TINFL_STATUS_DONE);
-
- TINFL_CR_FINISH
-
-common_exit:
- /* As long as we aren't telling the caller that we NEED more input to make forward progress: */
- /* Put back any bytes from the bitbuf in case we've looked ahead too far on gzip, or other Deflate streams followed by arbitrary data. */
- /* We need to be very careful here to NOT push back any bytes we definitely know we need to make forward progress, though, or we'll lock the caller up into an inf loop. */
- if ((status != TINFL_STATUS_NEEDS_MORE_INPUT) && (status != TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS))
- {
- while ((pIn_buf_cur > pIn_buf_next) && (num_bits >= 8))
- {
- --pIn_buf_cur;
- num_bits -= 8;
- }
- }
- r->m_num_bits = num_bits;
- r->m_bit_buf = bit_buf & (tinfl_bit_buf_t)((((mz_uint64)1) << num_bits) - (mz_uint64)1);
- r->m_dist = dist;
- r->m_counter = counter;
- r->m_num_extra = num_extra;
- r->m_dist_from_out_buf_start = dist_from_out_buf_start;
- *pIn_buf_size = pIn_buf_cur - pIn_buf_next;
- *pOut_buf_size = pOut_buf_cur - pOut_buf_next;
- if ((decomp_flags & (TINFL_FLAG_PARSE_ZLIB_HEADER | TINFL_FLAG_COMPUTE_ADLER32)) && (status >= 0))
- {
- const mz_uint8 *ptr = pOut_buf_next;
- size_t buf_len = *pOut_buf_size;
- mz_uint32 i, s1 = r->m_check_adler32 & 0xffff, s2 = r->m_check_adler32 >> 16;
- size_t block_len = buf_len % 5552;
- while (buf_len)
- {
- for (i = 0; i + 7 < block_len; i += 8, ptr += 8)
- {
- s1 += ptr[0], s2 += s1;
- s1 += ptr[1], s2 += s1;
- s1 += ptr[2], s2 += s1;
- s1 += ptr[3], s2 += s1;
- s1 += ptr[4], s2 += s1;
- s1 += ptr[5], s2 += s1;
- s1 += ptr[6], s2 += s1;
- s1 += ptr[7], s2 += s1;
- }
- for (; i < block_len; ++i)
- s1 += *ptr++, s2 += s1;
- s1 %= 65521U, s2 %= 65521U;
- buf_len -= block_len;
- block_len = 5552;
- }
- r->m_check_adler32 = (s2 << 16) + s1;
- if ((status == TINFL_STATUS_DONE) && (decomp_flags & TINFL_FLAG_PARSE_ZLIB_HEADER) && (r->m_check_adler32 != r->m_z_adler32))
- status = TINFL_STATUS_ADLER32_MISMATCH;
- }
- return status;
-}
-
-/* Higher level helper functions. */
-void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags)
-{
- tinfl_decompressor decomp;
- void *pBuf = NULL, *pNew_buf;
- size_t src_buf_ofs = 0, out_buf_capacity = 0;
- *pOut_len = 0;
- tinfl_init(&decomp);
- for (;;)
- {
- size_t src_buf_size = src_buf_len - src_buf_ofs, dst_buf_size = out_buf_capacity - *pOut_len, new_out_buf_capacity;
- tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf + src_buf_ofs, &src_buf_size, (mz_uint8 *)pBuf, pBuf ? (mz_uint8 *)pBuf + *pOut_len : NULL, &dst_buf_size,
- (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
- if ((status < 0) || (status == TINFL_STATUS_NEEDS_MORE_INPUT))
- {
- MZ_FREE(pBuf);
- *pOut_len = 0;
- return NULL;
- }
- src_buf_ofs += src_buf_size;
- *pOut_len += dst_buf_size;
- if (status == TINFL_STATUS_DONE)
- break;
- new_out_buf_capacity = out_buf_capacity * 2;
- if (new_out_buf_capacity < 128)
- new_out_buf_capacity = 128;
- pNew_buf = MZ_REALLOC(pBuf, new_out_buf_capacity);
- if (!pNew_buf)
- {
- MZ_FREE(pBuf);
- *pOut_len = 0;
- return NULL;
- }
- pBuf = pNew_buf;
- out_buf_capacity = new_out_buf_capacity;
- }
- return pBuf;
-}
-
-size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags)
-{
- tinfl_decompressor decomp;
- tinfl_status status;
- tinfl_init(&decomp);
- status = tinfl_decompress(&decomp, (const mz_uint8 *)pSrc_buf, &src_buf_len, (mz_uint8 *)pOut_buf, (mz_uint8 *)pOut_buf, &out_buf_len, (flags & ~TINFL_FLAG_HAS_MORE_INPUT) | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF);
- return (status != TINFL_STATUS_DONE) ? TINFL_DECOMPRESS_MEM_TO_MEM_FAILED : out_buf_len;
-}
-
-int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags)
-{
- int result = 0;
- tinfl_decompressor decomp;
- mz_uint8 *pDict = (mz_uint8 *)MZ_MALLOC(TINFL_LZ_DICT_SIZE);
- size_t in_buf_ofs = 0, dict_ofs = 0;
- if (!pDict)
- return TINFL_STATUS_FAILED;
- tinfl_init(&decomp);
- for (;;)
- {
- size_t in_buf_size = *pIn_buf_size - in_buf_ofs, dst_buf_size = TINFL_LZ_DICT_SIZE - dict_ofs;
- tinfl_status status = tinfl_decompress(&decomp, (const mz_uint8 *)pIn_buf + in_buf_ofs, &in_buf_size, pDict, pDict + dict_ofs, &dst_buf_size,
- (flags & ~(TINFL_FLAG_HAS_MORE_INPUT | TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF)));
- in_buf_ofs += in_buf_size;
- if ((dst_buf_size) && (!(*pPut_buf_func)(pDict + dict_ofs, (int)dst_buf_size, pPut_buf_user)))
- break;
- if (status != TINFL_STATUS_HAS_MORE_OUTPUT)
- {
- result = (status == TINFL_STATUS_DONE);
- break;
- }
- dict_ofs = (dict_ofs + dst_buf_size) & (TINFL_LZ_DICT_SIZE - 1);
- }
- MZ_FREE(pDict);
- *pIn_buf_size = in_buf_ofs;
- return result;
-}
-
-#ifndef MINIZ_NO_MALLOC
-tinfl_decompressor *tinfl_decompressor_alloc()
-{
- tinfl_decompressor *pDecomp = (tinfl_decompressor *)MZ_MALLOC(sizeof(tinfl_decompressor));
- if (pDecomp)
- tinfl_init(pDecomp);
- return pDecomp;
-}
-
-void tinfl_decompressor_free(tinfl_decompressor *pDecomp)
-{
- MZ_FREE(pDecomp);
-}
-#endif
-
-#ifdef __cplusplus
-}
-#endif
- /**************************************************************************
- *
- * Copyright 2013-2014 RAD Game Tools and Valve Software
- * Copyright 2010-2014 Rich Geldreich and Tenacious Software LLC
- * Copyright 2016 Martin Raiber
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- *
- **************************************************************************/
-
-
-#ifndef MINIZ_NO_ARCHIVE_APIS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------------- .ZIP archive reading */
-
-#ifdef MINIZ_NO_STDIO
-#define MZ_FILE void *
-#else
-#include <sys/stat.h>
-
-#if defined(_MSC_VER) || defined(__MINGW64__)
-static FILE *mz_fopen(const char *pFilename, const char *pMode)
-{
- FILE *pFile = NULL;
- fopen_s(&pFile, pFilename, pMode);
- return pFile;
-}
-static FILE *mz_freopen(const char *pPath, const char *pMode, FILE *pStream)
-{
- FILE *pFile = NULL;
- if (freopen_s(&pFile, pPath, pMode, pStream))
- return NULL;
- return pFile;
-}
-#ifndef MINIZ_NO_TIME
-#include <sys/utime.h>
-#endif
-#define MZ_FOPEN mz_fopen
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#define MZ_FTELL64 _ftelli64
-#define MZ_FSEEK64 _fseeki64
-#define MZ_FILE_STAT_STRUCT _stat64
-#define MZ_FILE_STAT _stat64
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN mz_freopen
-#define MZ_DELETE_FILE remove
-#elif defined(__MINGW32__)
-#ifndef MINIZ_NO_TIME
-#include <sys/utime.h>
-#endif
-#define MZ_FOPEN(f, m) fopen(f, m)
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#define MZ_FTELL64 ftello64
-#define MZ_FSEEK64 fseeko64
-#define MZ_FILE_STAT_STRUCT _stat
-#define MZ_FILE_STAT _stat
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
-#define MZ_DELETE_FILE remove
-#elif defined(__TINYC__)
-#ifndef MINIZ_NO_TIME
-#include <sys/utime.h>
-#endif
-#define MZ_FOPEN(f, m) fopen(f, m)
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#define MZ_FTELL64 ftell
-#define MZ_FSEEK64 fseek
-#define MZ_FILE_STAT_STRUCT stat
-#define MZ_FILE_STAT stat
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
-#define MZ_DELETE_FILE remove
-#elif defined(__USE_LARGEFILE64) /* gcc, clang */
-#ifndef MINIZ_NO_TIME
-#include <utime.h>
-#endif
-#define MZ_FOPEN(f, m) fopen64(f, m)
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#define MZ_FTELL64 ftello64
-#define MZ_FSEEK64 fseeko64
-#define MZ_FILE_STAT_STRUCT stat64
-#define MZ_FILE_STAT stat64
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN(p, m, s) freopen64(p, m, s)
-#define MZ_DELETE_FILE remove
-#elif defined(__APPLE__)
-#ifndef MINIZ_NO_TIME
-#include <utime.h>
-#endif
-#define MZ_FOPEN(f, m) fopen(f, m)
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#define MZ_FTELL64 ftello
-#define MZ_FSEEK64 fseeko
-#define MZ_FILE_STAT_STRUCT stat
-#define MZ_FILE_STAT stat
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN(p, m, s) freopen(p, m, s)
-#define MZ_DELETE_FILE remove
-
-#else
-#pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
-#ifndef MINIZ_NO_TIME
-#include <utime.h>
-#endif
-#define MZ_FOPEN(f, m) fopen(f, m)
-#define MZ_FCLOSE fclose
-#define MZ_FREAD fread
-#define MZ_FWRITE fwrite
-#ifdef __STRICT_ANSI__
-#define MZ_FTELL64 ftell
-#define MZ_FSEEK64 fseek
-#else
-#define MZ_FTELL64 ftello
-#define MZ_FSEEK64 fseeko
-#endif
-#define MZ_FILE_STAT_STRUCT stat
-#define MZ_FILE_STAT stat
-#define MZ_FFLUSH fflush
-#define MZ_FREOPEN(f, m, s) freopen(f, m, s)
-#define MZ_DELETE_FILE remove
-#endif /* #ifdef _MSC_VER */
-#endif /* #ifdef MINIZ_NO_STDIO */
-
-#define MZ_TOLOWER(c) ((((c) >= 'A') && ((c) <= 'Z')) ? ((c) - 'A' + 'a') : (c))
-
-/* Various ZIP archive enums. To completely avoid cross platform compiler alignment and platform endian issues, miniz.c doesn't use structs for any of this stuff. */
-enum
-{
- /* ZIP archive identifiers and record sizes */
- MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06054b50,
- MZ_ZIP_CENTRAL_DIR_HEADER_SIG = 0x02014b50,
- MZ_ZIP_LOCAL_DIR_HEADER_SIG = 0x04034b50,
- MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30,
- MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46,
- MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22,
-
- /* ZIP64 archive identifier and record sizes */
- MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06064b50,
- MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG = 0x07064b50,
- MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE = 56,
- MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE = 20,
- MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID = 0x0001,
- MZ_ZIP_DATA_DESCRIPTOR_ID = 0x08074b50,
- MZ_ZIP_DATA_DESCRIPTER_SIZE64 = 24,
- MZ_ZIP_DATA_DESCRIPTER_SIZE32 = 16,
-
- /* Central directory header record offsets */
- MZ_ZIP_CDH_SIG_OFS = 0,
- MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4,
- MZ_ZIP_CDH_VERSION_NEEDED_OFS = 6,
- MZ_ZIP_CDH_BIT_FLAG_OFS = 8,
- MZ_ZIP_CDH_METHOD_OFS = 10,
- MZ_ZIP_CDH_FILE_TIME_OFS = 12,
- MZ_ZIP_CDH_FILE_DATE_OFS = 14,
- MZ_ZIP_CDH_CRC32_OFS = 16,
- MZ_ZIP_CDH_COMPRESSED_SIZE_OFS = 20,
- MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS = 24,
- MZ_ZIP_CDH_FILENAME_LEN_OFS = 28,
- MZ_ZIP_CDH_EXTRA_LEN_OFS = 30,
- MZ_ZIP_CDH_COMMENT_LEN_OFS = 32,
- MZ_ZIP_CDH_DISK_START_OFS = 34,
- MZ_ZIP_CDH_INTERNAL_ATTR_OFS = 36,
- MZ_ZIP_CDH_EXTERNAL_ATTR_OFS = 38,
- MZ_ZIP_CDH_LOCAL_HEADER_OFS = 42,
-
- /* Local directory header offsets */
- MZ_ZIP_LDH_SIG_OFS = 0,
- MZ_ZIP_LDH_VERSION_NEEDED_OFS = 4,
- MZ_ZIP_LDH_BIT_FLAG_OFS = 6,
- MZ_ZIP_LDH_METHOD_OFS = 8,
- MZ_ZIP_LDH_FILE_TIME_OFS = 10,
- MZ_ZIP_LDH_FILE_DATE_OFS = 12,
- MZ_ZIP_LDH_CRC32_OFS = 14,
- MZ_ZIP_LDH_COMPRESSED_SIZE_OFS = 18,
- MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS = 22,
- MZ_ZIP_LDH_FILENAME_LEN_OFS = 26,
- MZ_ZIP_LDH_EXTRA_LEN_OFS = 28,
- MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR = 1 << 3,
-
- /* End of central directory offsets */
- MZ_ZIP_ECDH_SIG_OFS = 0,
- MZ_ZIP_ECDH_NUM_THIS_DISK_OFS = 4,
- MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS = 6,
- MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 8,
- MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS = 10,
- MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12,
- MZ_ZIP_ECDH_CDIR_OFS_OFS = 16,
- MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20,
-
- /* ZIP64 End of central directory locator offsets */
- MZ_ZIP64_ECDL_SIG_OFS = 0, /* 4 bytes */
- MZ_ZIP64_ECDL_NUM_DISK_CDIR_OFS = 4, /* 4 bytes */
- MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS = 8, /* 8 bytes */
- MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS = 16, /* 4 bytes */
-
- /* ZIP64 End of central directory header offsets */
- MZ_ZIP64_ECDH_SIG_OFS = 0, /* 4 bytes */
- MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS = 4, /* 8 bytes */
- MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS = 12, /* 2 bytes */
- MZ_ZIP64_ECDH_VERSION_NEEDED_OFS = 14, /* 2 bytes */
- MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS = 16, /* 4 bytes */
- MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS = 20, /* 4 bytes */
- MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 24, /* 8 bytes */
- MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS = 32, /* 8 bytes */
- MZ_ZIP64_ECDH_CDIR_SIZE_OFS = 40, /* 8 bytes */
- MZ_ZIP64_ECDH_CDIR_OFS_OFS = 48, /* 8 bytes */
- MZ_ZIP_VERSION_MADE_BY_DOS_FILESYSTEM_ID = 0,
- MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG = 0x10,
- MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED = 1,
- MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32,
- MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64,
- MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192,
- MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1 << 11
-};
-
-typedef struct
-{
- void *m_p;
- size_t m_size, m_capacity;
- mz_uint m_element_size;
-} mz_zip_array;
-
-struct mz_zip_internal_state_tag
-{
- mz_zip_array m_central_dir;
- mz_zip_array m_central_dir_offsets;
- mz_zip_array m_sorted_central_dir_offsets;
-
- /* The flags passed in when the archive is initially opened. */
- uint32_t m_init_flags;
-
- /* MZ_TRUE if the archive has a zip64 end of central directory headers, etc. */
- mz_bool m_zip64;
-
- /* MZ_TRUE if we found zip64 extended info in the central directory (m_zip64 will also be slammed to true too, even if we didn't find a zip64 end of central dir header, etc.) */
- mz_bool m_zip64_has_extended_info_fields;
-
- /* These fields are used by the file, FILE, memory, and memory/heap read/write helpers. */
- MZ_FILE *m_pFile;
- mz_uint64 m_file_archive_start_ofs;
-
- void *m_pMem;
- size_t m_mem_size;
- size_t m_mem_capacity;
-};
-
-#define MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(array_ptr, element_size) (array_ptr)->m_element_size = element_size
-
-#if defined(DEBUG) || defined(_DEBUG)
-static MZ_FORCEINLINE mz_uint mz_zip_array_range_check(const mz_zip_array *pArray, mz_uint index)
-{
- MZ_ASSERT(index < pArray->m_size);
- return index;
-}
-#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[mz_zip_array_range_check(array_ptr, index)]
-#else
-#define MZ_ZIP_ARRAY_ELEMENT(array_ptr, element_type, index) ((element_type *)((array_ptr)->m_p))[index]
-#endif
-
-static MZ_FORCEINLINE void mz_zip_array_init(mz_zip_array *pArray, mz_uint32 element_size)
-{
- memset(pArray, 0, sizeof(mz_zip_array));
- pArray->m_element_size = element_size;
-}
-
-static MZ_FORCEINLINE void mz_zip_array_clear(mz_zip_archive *pZip, mz_zip_array *pArray)
-{
- pZip->m_pFree(pZip->m_pAlloc_opaque, pArray->m_p);
- memset(pArray, 0, sizeof(mz_zip_array));
-}
-
-static mz_bool mz_zip_array_ensure_capacity(mz_zip_archive *pZip, mz_zip_array *pArray, size_t min_new_capacity, mz_uint growing)
-{
- void *pNew_p;
- size_t new_capacity = min_new_capacity;
- MZ_ASSERT(pArray->m_element_size);
- if (pArray->m_capacity >= min_new_capacity)
- return MZ_TRUE;
- if (growing)
- {
- new_capacity = MZ_MAX(1, pArray->m_capacity);
- while (new_capacity < min_new_capacity)
- new_capacity *= 2;
- }
- if (NULL == (pNew_p = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pArray->m_p, pArray->m_element_size, new_capacity)))
- return MZ_FALSE;
- pArray->m_p = pNew_p;
- pArray->m_capacity = new_capacity;
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_array_reserve(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_capacity, mz_uint growing)
-{
- if (new_capacity > pArray->m_capacity)
- {
- if (!mz_zip_array_ensure_capacity(pZip, pArray, new_capacity, growing))
- return MZ_FALSE;
- }
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_array_resize(mz_zip_archive *pZip, mz_zip_array *pArray, size_t new_size, mz_uint growing)
-{
- if (new_size > pArray->m_capacity)
- {
- if (!mz_zip_array_ensure_capacity(pZip, pArray, new_size, growing))
- return MZ_FALSE;
- }
- pArray->m_size = new_size;
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_array_ensure_room(mz_zip_archive *pZip, mz_zip_array *pArray, size_t n)
-{
- return mz_zip_array_reserve(pZip, pArray, pArray->m_size + n, MZ_TRUE);
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_array_push_back(mz_zip_archive *pZip, mz_zip_array *pArray, const void *pElements, size_t n)
-{
- size_t orig_size = pArray->m_size;
- if (!mz_zip_array_resize(pZip, pArray, orig_size + n, MZ_TRUE))
- return MZ_FALSE;
- if (n > 0)
- memcpy((mz_uint8 *)pArray->m_p + orig_size * pArray->m_element_size, pElements, n * pArray->m_element_size);
- return MZ_TRUE;
-}
-
-#ifndef MINIZ_NO_TIME
-static MZ_TIME_T mz_zip_dos_to_time_t(int dos_time, int dos_date)
-{
- struct tm tm;
- memset(&tm, 0, sizeof(tm));
- tm.tm_isdst = -1;
- tm.tm_year = ((dos_date >> 9) & 127) + 1980 - 1900;
- tm.tm_mon = ((dos_date >> 5) & 15) - 1;
- tm.tm_mday = dos_date & 31;
- tm.tm_hour = (dos_time >> 11) & 31;
- tm.tm_min = (dos_time >> 5) & 63;
- tm.tm_sec = (dos_time << 1) & 62;
- return mktime(&tm);
-}
-
-#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
-static void mz_zip_time_t_to_dos_time(MZ_TIME_T time, mz_uint16 *pDOS_time, mz_uint16 *pDOS_date)
-{
-#ifdef _MSC_VER
- struct tm tm_struct;
- struct tm *tm = &tm_struct;
- errno_t err = localtime_s(tm, &time);
- if (err)
- {
- *pDOS_date = 0;
- *pDOS_time = 0;
- return;
- }
-#else
- struct tm *tm = localtime(&time);
-#endif /* #ifdef _MSC_VER */
-
- *pDOS_time = (mz_uint16)(((tm->tm_hour) << 11) + ((tm->tm_min) << 5) + ((tm->tm_sec) >> 1));
- *pDOS_date = (mz_uint16)(((tm->tm_year + 1900 - 1980) << 9) + ((tm->tm_mon + 1) << 5) + tm->tm_mday);
-}
-#endif /* MINIZ_NO_ARCHIVE_WRITING_APIS */
-
-#ifndef MINIZ_NO_STDIO
-#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
-static mz_bool mz_zip_get_file_modified_time(const char *pFilename, MZ_TIME_T *pTime)
-{
- struct MZ_FILE_STAT_STRUCT file_stat;
-
- /* On Linux with x86 glibc, this call will fail on large files (I think >= 0x80000000 bytes) unless you compiled with _LARGEFILE64_SOURCE. Argh. */
- if (MZ_FILE_STAT(pFilename, &file_stat) != 0)
- return MZ_FALSE;
-
- *pTime = file_stat.st_mtime;
-
- return MZ_TRUE;
-}
-#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS*/
-
-static mz_bool mz_zip_set_file_times(const char *pFilename, MZ_TIME_T access_time, MZ_TIME_T modified_time)
-{
- struct utimbuf t;
-
- memset(&t, 0, sizeof(t));
- t.actime = access_time;
- t.modtime = modified_time;
-
- return !utime(pFilename, &t);
-}
-#endif /* #ifndef MINIZ_NO_STDIO */
-#endif /* #ifndef MINIZ_NO_TIME */
-
-static MZ_FORCEINLINE mz_bool mz_zip_set_error(mz_zip_archive *pZip, mz_zip_error err_num)
-{
- if (pZip)
- pZip->m_last_error = err_num;
- return MZ_FALSE;
-}
-
-static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, mz_uint flags)
-{
- (void)flags;
- if ((!pZip) || (pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!pZip->m_pAlloc)
- pZip->m_pAlloc = miniz_def_alloc_func;
- if (!pZip->m_pFree)
- pZip->m_pFree = miniz_def_free_func;
- if (!pZip->m_pRealloc)
- pZip->m_pRealloc = miniz_def_realloc_func;
-
- pZip->m_archive_size = 0;
- pZip->m_central_directory_file_ofs = 0;
- pZip->m_total_files = 0;
- pZip->m_last_error = MZ_ZIP_NO_ERROR;
-
- if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state));
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8));
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32));
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32));
- pZip->m_pState->m_init_flags = flags;
- pZip->m_pState->m_zip64 = MZ_FALSE;
- pZip->m_pState->m_zip64_has_extended_info_fields = MZ_FALSE;
-
- pZip->m_zip_mode = MZ_ZIP_MODE_READING;
-
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_reader_filename_less(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, mz_uint r_index)
-{
- const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE;
- const mz_uint8 *pR = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, r_index));
- mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS), r_len = MZ_READ_LE16(pR + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- mz_uint8 l = 0, r = 0;
- pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
- pR += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
- pE = pL + MZ_MIN(l_len, r_len);
- while (pL < pE)
- {
- if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
- break;
- pL++;
- pR++;
- }
- return (pL == pE) ? (l_len < r_len) : (l < r);
-}
-
-#define MZ_SWAP_UINT32(a, b) \
- do \
- { \
- mz_uint32 t = a; \
- a = b; \
- b = t; \
- } \
- MZ_MACRO_END
-
-/* Heap sort of lowercased filenames, used to help accelerate plain central directory searches by mz_zip_reader_locate_file(). (Could also use qsort(), but it could allocate memory.) */
-static void mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip)
-{
- mz_zip_internal_state *pState = pZip->m_pState;
- const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
- const mz_zip_array *pCentral_dir = &pState->m_central_dir;
- mz_uint32 *pIndices;
- mz_uint32 start, end;
- const mz_uint32 size = pZip->m_total_files;
-
- if (size <= 1U)
- return;
-
- pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0);
-
- start = (size - 2U) >> 1U;
- for (;;)
- {
- mz_uint64 child, root = start;
- for (;;)
- {
- if ((child = (root << 1U) + 1U) >= size)
- break;
- child += (((child + 1U) < size) && (mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U])));
- if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
- break;
- MZ_SWAP_UINT32(pIndices[root], pIndices[child]);
- root = child;
- }
- if (!start)
- break;
- start--;
- }
-
- end = size - 1;
- while (end > 0)
- {
- mz_uint64 child, root = 0;
- MZ_SWAP_UINT32(pIndices[end], pIndices[0]);
- for (;;)
- {
- if ((child = (root << 1U) + 1U) >= end)
- break;
- child += (((child + 1U) < end) && mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[child], pIndices[child + 1U]));
- if (!mz_zip_reader_filename_less(pCentral_dir, pCentral_dir_offsets, pIndices[root], pIndices[child]))
- break;
- MZ_SWAP_UINT32(pIndices[root], pIndices[child]);
- root = child;
- }
- end--;
- }
-}
-
-static mz_bool mz_zip_reader_locate_header_sig(mz_zip_archive *pZip, mz_uint32 record_sig, mz_uint32 record_size, mz_int64 *pOfs)
-{
- mz_int64 cur_file_ofs;
- mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
- mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
-
- /* Basic sanity checks - reject files which are too small */
- if (pZip->m_archive_size < record_size)
- return MZ_FALSE;
-
- /* Find the record by scanning the file from the end towards the beginning. */
- cur_file_ofs = MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0);
- for (;;)
- {
- int i, n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs);
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n)
- return MZ_FALSE;
-
- for (i = n - 4; i >= 0; --i)
- {
- mz_uint s = MZ_READ_LE32(pBuf + i);
- if (s == record_sig)
- {
- if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size)
- break;
- }
- }
-
- if (i >= 0)
- {
- cur_file_ofs += i;
- break;
- }
-
- /* Give up if we've searched the entire file, or we've gone back "too far" (~64kb) */
- if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= (MZ_UINT16_MAX + record_size)))
- return MZ_FALSE;
-
- cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0);
- }
-
- *pOfs = cur_file_ofs;
- return MZ_TRUE;
-}
-
-static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, mz_uint flags)
-{
- mz_uint cdir_size = 0, cdir_entries_on_this_disk = 0, num_this_disk = 0, cdir_disk_index = 0;
- mz_uint64 cdir_ofs = 0;
- mz_int64 cur_file_ofs = 0;
- const mz_uint8 *p;
-
- mz_uint32 buf_u32[4096 / sizeof(mz_uint32)];
- mz_uint8 *pBuf = (mz_uint8 *)buf_u32;
- mz_bool sort_central_dir = ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0);
- mz_uint32 zip64_end_of_central_dir_locator_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pZip64_locator = (mz_uint8 *)zip64_end_of_central_dir_locator_u32;
-
- mz_uint32 zip64_end_of_central_dir_header_u32[(MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pZip64_end_of_central_dir = (mz_uint8 *)zip64_end_of_central_dir_header_u32;
-
- mz_uint64 zip64_end_of_central_dir_ofs = 0;
-
- /* Basic sanity checks - reject files which are too small, and check the first 4 bytes of the file to make sure a local header is there. */
- if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
-
- if (!mz_zip_reader_locate_header_sig(pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs))
- return mz_zip_set_error(pZip, MZ_ZIP_FAILED_FINDING_CENTRAL_DIR);
-
- /* Read and verify the end of central directory record. */
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
-
- if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
- {
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE, pZip64_locator, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE)
- {
- if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG)
- {
- zip64_end_of_central_dir_ofs = MZ_READ_LE64(pZip64_locator + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS);
- if (zip64_end_of_central_dir_ofs > (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE))
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs, pZip64_end_of_central_dir, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
- {
- if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG)
- {
- pZip->m_pState->m_zip64 = MZ_TRUE;
- }
- }
- }
- }
- }
-
- pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS);
- cdir_entries_on_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
- num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS);
- cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS);
- cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS);
- cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS);
-
- if (pZip->m_pState->m_zip64)
- {
- mz_uint32 zip64_total_num_of_disks = MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS);
- mz_uint64 zip64_cdir_total_entries = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS);
- mz_uint64 zip64_cdir_total_entries_on_this_disk = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS);
- mz_uint64 zip64_size_of_end_of_central_dir_record = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS);
- mz_uint64 zip64_size_of_central_directory = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_SIZE_OFS);
-
- if (zip64_size_of_end_of_central_dir_record < (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if (zip64_total_num_of_disks != 1U)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
-
- /* Check for miniz's practical limits */
- if (zip64_cdir_total_entries > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
-
- pZip->m_total_files = (mz_uint32)zip64_cdir_total_entries;
-
- if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
-
- cdir_entries_on_this_disk = (mz_uint32)zip64_cdir_total_entries_on_this_disk;
-
- /* Check for miniz's current practical limits (sorry, this should be enough for millions of files) */
- if (zip64_size_of_central_directory > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
-
- cdir_size = (mz_uint32)zip64_size_of_central_directory;
-
- num_this_disk = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS);
-
- cdir_disk_index = MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS);
-
- cdir_ofs = MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_OFS_OFS);
- }
-
- if (pZip->m_total_files != cdir_entries_on_this_disk)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
-
- if (((num_this_disk | cdir_disk_index) != 0) && ((num_this_disk != 1) || (cdir_disk_index != 1)))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
-
- if (cdir_size < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- pZip->m_central_directory_file_ofs = cdir_ofs;
-
- if (pZip->m_total_files)
- {
- mz_uint i, n;
- /* Read the entire central directory into a heap block, and allocate another heap block to hold the unsorted central dir file record offsets, and possibly another to hold the sorted indices. */
- if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, MZ_FALSE)) ||
- (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, pZip->m_total_files, MZ_FALSE)))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- if (sort_central_dir)
- {
- if (!mz_zip_array_resize(pZip, &pZip->m_pState->m_sorted_central_dir_offsets, pZip->m_total_files, MZ_FALSE))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, pZip->m_pState->m_central_dir.m_p, cdir_size) != cdir_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- /* Now create an index into the central directory file records, do some basic sanity checking on each record */
- p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p;
- for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i)
- {
- mz_uint total_header_size, disk_index, bit_flags, filename_size, ext_data_size;
- mz_uint64 comp_size, decomp_size, local_header_ofs;
-
- if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, i) = (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p);
-
- if (sort_central_dir)
- MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, mz_uint32, i) = i;
-
- comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
- decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
- local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
- filename_size = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- ext_data_size = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);
-
- if ((!pZip->m_pState->m_zip64_has_extended_info_fields) &&
- (ext_data_size) &&
- (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) == MZ_UINT32_MAX))
- {
- /* Attempt to find zip64 extended information field in the entry's extra data */
- mz_uint32 extra_size_remaining = ext_data_size;
-
- if (extra_size_remaining)
- {
- const mz_uint8 *pExtra_data;
- void* buf = NULL;
-
- if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > n)
- {
- buf = MZ_MALLOC(ext_data_size);
- if(buf==NULL)
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size, buf, ext_data_size) != ext_data_size)
- {
- MZ_FREE(buf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
-
- pExtra_data = (mz_uint8*)buf;
- }
- else
- {
- pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size;
- }
-
- do
- {
- mz_uint32 field_id;
- mz_uint32 field_data_size;
-
- if (extra_size_remaining < (sizeof(mz_uint16) * 2))
- {
- MZ_FREE(buf);
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- field_id = MZ_READ_LE16(pExtra_data);
- field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
-
- if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
- {
- MZ_FREE(buf);
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
- {
- /* Ok, the archive didn't have any zip64 headers but it uses a zip64 extended information field so mark it as zip64 anyway (this can occur with infozip's zip util when it reads compresses files from stdin). */
- pZip->m_pState->m_zip64 = MZ_TRUE;
- pZip->m_pState->m_zip64_has_extended_info_fields = MZ_TRUE;
- break;
- }
-
- pExtra_data += sizeof(mz_uint16) * 2 + field_data_size;
- extra_size_remaining = extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size;
- } while (extra_size_remaining);
-
- MZ_FREE(buf);
- }
- }
-
- /* I've seen archives that aren't marked as zip64 that uses zip64 ext data, argh */
- if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX))
- {
- if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && (decomp_size != comp_size)) || (decomp_size && !comp_size))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS);
- if ((disk_index == MZ_UINT16_MAX) || ((disk_index != num_this_disk) && (disk_index != 1)))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK);
-
- if (comp_size != MZ_UINT32_MAX)
- {
- if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- bit_flags = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
- if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
-
- if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > n)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- n -= total_header_size;
- p += total_header_size;
- }
- }
-
- if (sort_central_dir)
- mz_zip_reader_sort_central_dir_offsets_by_filename(pZip);
-
- return MZ_TRUE;
-}
-
-void mz_zip_zero_struct(mz_zip_archive *pZip)
-{
- if (pZip)
- MZ_CLEAR_OBJ(*pZip);
-}
-
-static mz_bool mz_zip_reader_end_internal(mz_zip_archive *pZip, mz_bool set_last_error)
-{
- mz_bool status = MZ_TRUE;
-
- if (!pZip)
- return MZ_FALSE;
-
- if ((!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
- {
- if (set_last_error)
- pZip->m_last_error = MZ_ZIP_INVALID_PARAMETER;
-
- return MZ_FALSE;
- }
-
- if (pZip->m_pState)
- {
- mz_zip_internal_state *pState = pZip->m_pState;
- pZip->m_pState = NULL;
-
- mz_zip_array_clear(pZip, &pState->m_central_dir);
- mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
- mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
-
-#ifndef MINIZ_NO_STDIO
- if (pState->m_pFile)
- {
- if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
- {
- if (MZ_FCLOSE(pState->m_pFile) == EOF)
- {
- if (set_last_error)
- pZip->m_last_error = MZ_ZIP_FILE_CLOSE_FAILED;
- status = MZ_FALSE;
- }
- }
- pState->m_pFile = NULL;
- }
-#endif /* #ifndef MINIZ_NO_STDIO */
-
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- }
- pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;
-
- return status;
-}
-
-mz_bool mz_zip_reader_end(mz_zip_archive *pZip)
-{
- return mz_zip_reader_end_internal(pZip, MZ_TRUE);
-}
-mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags)
-{
- if ((!pZip) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_reader_init_internal(pZip, flags))
- return MZ_FALSE;
-
- pZip->m_zip_type = MZ_ZIP_TYPE_USER;
- pZip->m_archive_size = size;
-
- if (!mz_zip_reader_read_central_dir(pZip, flags))
- {
- mz_zip_reader_end_internal(pZip, MZ_FALSE);
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-static size_t mz_zip_mem_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
-{
- mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
- size_t s = (file_ofs >= pZip->m_archive_size) ? 0 : (size_t)MZ_MIN(pZip->m_archive_size - file_ofs, n);
- memcpy(pBuf, (const mz_uint8 *)pZip->m_pState->m_pMem + file_ofs, s);
- return s;
-}
-
-mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags)
-{
- if (!pMem)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
-
- if (!mz_zip_reader_init_internal(pZip, flags))
- return MZ_FALSE;
-
- pZip->m_zip_type = MZ_ZIP_TYPE_MEMORY;
- pZip->m_archive_size = size;
- pZip->m_pRead = mz_zip_mem_read_func;
- pZip->m_pIO_opaque = pZip;
- pZip->m_pNeeds_keepalive = NULL;
-
-#ifdef __cplusplus
- pZip->m_pState->m_pMem = const_cast<void *>(pMem);
-#else
- pZip->m_pState->m_pMem = (void *)pMem;
-#endif
-
- pZip->m_pState->m_mem_size = size;
-
- if (!mz_zip_reader_read_central_dir(pZip, flags))
- {
- mz_zip_reader_end_internal(pZip, MZ_FALSE);
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-#ifndef MINIZ_NO_STDIO
-static size_t mz_zip_file_read_func(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
-{
- mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
- mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);
-
- file_ofs += pZip->m_pState->m_file_archive_start_ofs;
-
- if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
- return 0;
-
- return MZ_FREAD(pBuf, 1, n, pZip->m_pState->m_pFile);
-}
-
-mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags)
-{
- return mz_zip_reader_init_file_v2(pZip, pFilename, flags, 0, 0);
-}
-
-mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size)
-{
- mz_uint64 file_size;
- MZ_FILE *pFile;
-
- if ((!pZip) || (!pFilename) || ((archive_size) && (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pFile = MZ_FOPEN(pFilename, "rb");
- if (!pFile)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
-
- file_size = archive_size;
- if (!file_size)
- {
- if (MZ_FSEEK64(pFile, 0, SEEK_END))
- {
- MZ_FCLOSE(pFile);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED);
- }
-
- file_size = MZ_FTELL64(pFile);
- }
-
- /* TODO: Better sanity check archive_size and the # of actual remaining bytes */
-
- if (file_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- {
- MZ_FCLOSE(pFile);
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
- }
-
- if (!mz_zip_reader_init_internal(pZip, flags))
- {
- MZ_FCLOSE(pFile);
- return MZ_FALSE;
- }
-
- pZip->m_zip_type = MZ_ZIP_TYPE_FILE;
- pZip->m_pRead = mz_zip_file_read_func;
- pZip->m_pIO_opaque = pZip;
- pZip->m_pState->m_pFile = pFile;
- pZip->m_archive_size = file_size;
- pZip->m_pState->m_file_archive_start_ofs = file_start_ofs;
-
- if (!mz_zip_reader_read_central_dir(pZip, flags))
- {
- mz_zip_reader_end_internal(pZip, MZ_FALSE);
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags)
-{
- mz_uint64 cur_file_ofs;
-
- if ((!pZip) || (!pFile))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
-
- cur_file_ofs = MZ_FTELL64(pFile);
-
- if (!archive_size)
- {
- if (MZ_FSEEK64(pFile, 0, SEEK_END))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED);
-
- archive_size = MZ_FTELL64(pFile) - cur_file_ofs;
-
- if (archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE);
- }
-
- if (!mz_zip_reader_init_internal(pZip, flags))
- return MZ_FALSE;
-
- pZip->m_zip_type = MZ_ZIP_TYPE_CFILE;
- pZip->m_pRead = mz_zip_file_read_func;
-
- pZip->m_pIO_opaque = pZip;
- pZip->m_pState->m_pFile = pFile;
- pZip->m_archive_size = archive_size;
- pZip->m_pState->m_file_archive_start_ofs = cur_file_ofs;
-
- if (!mz_zip_reader_read_central_dir(pZip, flags))
- {
- mz_zip_reader_end_internal(pZip, MZ_FALSE);
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-static MZ_FORCEINLINE const mz_uint8 *mz_zip_get_cdh(mz_zip_archive *pZip, mz_uint file_index)
-{
- if ((!pZip) || (!pZip->m_pState) || (file_index >= pZip->m_total_files))
- return NULL;
- return &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index));
-}
-
-mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index)
-{
- mz_uint m_bit_flag;
- const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
- if (!p)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return MZ_FALSE;
- }
-
- m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
- return (m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION)) != 0;
-}
-
-mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index)
-{
- mz_uint bit_flag;
- mz_uint method;
-
- const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
- if (!p)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return MZ_FALSE;
- }
-
- method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS);
- bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
-
- if ((method != 0) && (method != MZ_DEFLATED))
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);
- return MZ_FALSE;
- }
-
- if (bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION))
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
- return MZ_FALSE;
- }
-
- if (bit_flag & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG)
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE);
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index)
-{
- mz_uint filename_len, attribute_mapping_id, external_attr;
- const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
- if (!p)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return MZ_FALSE;
- }
-
- filename_len = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- if (filename_len)
- {
- if (*(p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_len - 1) == '/')
- return MZ_TRUE;
- }
-
- /* Bugfix: This code was also checking if the internal attribute was non-zero, which wasn't correct. */
- /* Most/all zip writers (hopefully) set DOS file/directory attributes in the low 16-bits, so check for the DOS directory flag and ignore the source OS ID in the created by field. */
- /* FIXME: Remove this check? Is it necessary - we already check the filename. */
- attribute_mapping_id = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS) >> 8;
- (void)attribute_mapping_id;
-
- external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS);
- if ((external_attr & MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG) != 0)
- {
- return MZ_TRUE;
- }
-
- return MZ_FALSE;
-}
-
-static mz_bool mz_zip_file_stat_internal(mz_zip_archive *pZip, mz_uint file_index, const mz_uint8 *pCentral_dir_header, mz_zip_archive_file_stat *pStat, mz_bool *pFound_zip64_extra_data)
-{
- mz_uint n;
- const mz_uint8 *p = pCentral_dir_header;
-
- if (pFound_zip64_extra_data)
- *pFound_zip64_extra_data = MZ_FALSE;
-
- if ((!p) || (!pStat))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- /* Extract fields from the central directory record. */
- pStat->m_file_index = file_index;
- pStat->m_central_dir_ofs = MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index);
- pStat->m_version_made_by = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_MADE_BY_OFS);
- pStat->m_version_needed = MZ_READ_LE16(p + MZ_ZIP_CDH_VERSION_NEEDED_OFS);
- pStat->m_bit_flag = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS);
- pStat->m_method = MZ_READ_LE16(p + MZ_ZIP_CDH_METHOD_OFS);
-#ifndef MINIZ_NO_TIME
- pStat->m_time = mz_zip_dos_to_time_t(MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_TIME_OFS), MZ_READ_LE16(p + MZ_ZIP_CDH_FILE_DATE_OFS));
-#endif
- pStat->m_crc32 = MZ_READ_LE32(p + MZ_ZIP_CDH_CRC32_OFS);
- pStat->m_comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
- pStat->m_uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
- pStat->m_internal_attr = MZ_READ_LE16(p + MZ_ZIP_CDH_INTERNAL_ATTR_OFS);
- pStat->m_external_attr = MZ_READ_LE32(p + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS);
- pStat->m_local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS);
-
- /* Copy as much of the filename and comment as possible. */
- n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE - 1);
- memcpy(pStat->m_filename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n);
- pStat->m_filename[n] = '\0';
-
- n = MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS);
- n = MZ_MIN(n, MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE - 1);
- pStat->m_comment_size = n;
- memcpy(pStat->m_comment, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS), n);
- pStat->m_comment[n] = '\0';
-
- /* Set some flags for convienance */
- pStat->m_is_directory = mz_zip_reader_is_file_a_directory(pZip, file_index);
- pStat->m_is_encrypted = mz_zip_reader_is_file_encrypted(pZip, file_index);
- pStat->m_is_supported = mz_zip_reader_is_file_supported(pZip, file_index);
-
- /* See if we need to read any zip64 extended information fields. */
- /* Confusingly, these zip64 fields can be present even on non-zip64 archives (Debian zip on a huge files from stdin piped to stdout creates them). */
- if (MZ_MAX(MZ_MAX(pStat->m_comp_size, pStat->m_uncomp_size), pStat->m_local_header_ofs) == MZ_UINT32_MAX)
- {
- /* Attempt to find zip64 extended information field in the entry's extra data */
- mz_uint32 extra_size_remaining = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS);
-
- if (extra_size_remaining)
- {
- const mz_uint8 *pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
-
- do
- {
- mz_uint32 field_id;
- mz_uint32 field_data_size;
-
- if (extra_size_remaining < (sizeof(mz_uint16) * 2))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- field_id = MZ_READ_LE16(pExtra_data);
- field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
-
- if ((field_data_size + sizeof(mz_uint16) * 2) > extra_size_remaining)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
- {
- const mz_uint8 *pField_data = pExtra_data + sizeof(mz_uint16) * 2;
- mz_uint32 field_data_remaining = field_data_size;
-
- if (pFound_zip64_extra_data)
- *pFound_zip64_extra_data = MZ_TRUE;
-
- if (pStat->m_uncomp_size == MZ_UINT32_MAX)
- {
- if (field_data_remaining < sizeof(mz_uint64))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- pStat->m_uncomp_size = MZ_READ_LE64(pField_data);
- pField_data += sizeof(mz_uint64);
- field_data_remaining -= sizeof(mz_uint64);
- }
-
- if (pStat->m_comp_size == MZ_UINT32_MAX)
- {
- if (field_data_remaining < sizeof(mz_uint64))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- pStat->m_comp_size = MZ_READ_LE64(pField_data);
- pField_data += sizeof(mz_uint64);
- field_data_remaining -= sizeof(mz_uint64);
- }
-
- if (pStat->m_local_header_ofs == MZ_UINT32_MAX)
- {
- if (field_data_remaining < sizeof(mz_uint64))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- pStat->m_local_header_ofs = MZ_READ_LE64(pField_data);
- pField_data += sizeof(mz_uint64);
- field_data_remaining -= sizeof(mz_uint64);
- }
-
- break;
- }
-
- pExtra_data += sizeof(mz_uint16) * 2 + field_data_size;
- extra_size_remaining = extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size;
- } while (extra_size_remaining);
- }
- }
-
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE mz_bool mz_zip_string_equal(const char *pA, const char *pB, mz_uint len, mz_uint flags)
-{
- mz_uint i;
- if (flags & MZ_ZIP_FLAG_CASE_SENSITIVE)
- return 0 == memcmp(pA, pB, len);
- for (i = 0; i < len; ++i)
- if (MZ_TOLOWER(pA[i]) != MZ_TOLOWER(pB[i]))
- return MZ_FALSE;
- return MZ_TRUE;
-}
-
-static MZ_FORCEINLINE int mz_zip_filename_compare(const mz_zip_array *pCentral_dir_array, const mz_zip_array *pCentral_dir_offsets, mz_uint l_index, const char *pR, mz_uint r_len)
-{
- const mz_uint8 *pL = &MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_array, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(pCentral_dir_offsets, mz_uint32, l_index)), *pE;
- mz_uint l_len = MZ_READ_LE16(pL + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- mz_uint8 l = 0, r = 0;
- pL += MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
- pE = pL + MZ_MIN(l_len, r_len);
- while (pL < pE)
- {
- if ((l = MZ_TOLOWER(*pL)) != (r = MZ_TOLOWER(*pR)))
- break;
- pL++;
- pR++;
- }
- return (pL == pE) ? (int)(l_len - r_len) : (l - r);
-}
-
-static mz_bool mz_zip_locate_file_binary_search(mz_zip_archive *pZip, const char *pFilename, mz_uint32 *pIndex)
-{
- mz_zip_internal_state *pState = pZip->m_pState;
- const mz_zip_array *pCentral_dir_offsets = &pState->m_central_dir_offsets;
- const mz_zip_array *pCentral_dir = &pState->m_central_dir;
- mz_uint32 *pIndices = &MZ_ZIP_ARRAY_ELEMENT(&pState->m_sorted_central_dir_offsets, mz_uint32, 0);
- const uint32_t size = pZip->m_total_files;
- const mz_uint filename_len = (mz_uint)strlen(pFilename);
-
- if (pIndex)
- *pIndex = 0;
-
- if (size)
- {
- /* yes I could use uint32_t's, but then we would have to add some special case checks in the loop, argh, and */
- /* honestly the major expense here on 32-bit CPU's will still be the filename compare */
- mz_int64 l = 0, h = (mz_int64)size - 1;
-
- while (l <= h)
- {
- mz_int64 m = l + ((h - l) >> 1);
- uint32_t file_index = pIndices[(uint32_t)m];
-
- int comp = mz_zip_filename_compare(pCentral_dir, pCentral_dir_offsets, file_index, pFilename, filename_len);
- if (!comp)
- {
- if (pIndex)
- *pIndex = file_index;
- return MZ_TRUE;
- }
- else if (comp < 0)
- l = m + 1;
- else
- h = m - 1;
- }
- }
-
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_NOT_FOUND);
-}
-
-int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags)
-{
- mz_uint32 index;
- if (!mz_zip_reader_locate_file_v2(pZip, pName, pComment, flags, &index))
- return -1;
- else
- return (int)index;
-}
-
-mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *pIndex)
-{
- mz_uint file_index;
- size_t name_len, comment_len;
-
- if (pIndex)
- *pIndex = 0;
-
- if ((!pZip) || (!pZip->m_pState) || (!pName))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- /* See if we can use a binary search */
- if (((pZip->m_pState->m_init_flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0) &&
- (pZip->m_zip_mode == MZ_ZIP_MODE_READING) &&
- ((flags & (MZ_ZIP_FLAG_IGNORE_PATH | MZ_ZIP_FLAG_CASE_SENSITIVE)) == 0) && (!pComment) && (pZip->m_pState->m_sorted_central_dir_offsets.m_size))
- {
- return mz_zip_locate_file_binary_search(pZip, pName, pIndex);
- }
-
- /* Locate the entry by scanning the entire central directory */
- name_len = strlen(pName);
- if (name_len > MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- comment_len = pComment ? strlen(pComment) : 0;
- if (comment_len > MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- for (file_index = 0; file_index < pZip->m_total_files; file_index++)
- {
- const mz_uint8 *pHeader = &MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir, mz_uint8, MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, file_index));
- mz_uint filename_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- const char *pFilename = (const char *)pHeader + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE;
- if (filename_len < name_len)
- continue;
- if (comment_len)
- {
- mz_uint file_extra_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_EXTRA_LEN_OFS), file_comment_len = MZ_READ_LE16(pHeader + MZ_ZIP_CDH_COMMENT_LEN_OFS);
- const char *pFile_comment = pFilename + filename_len + file_extra_len;
- if ((file_comment_len != comment_len) || (!mz_zip_string_equal(pComment, pFile_comment, file_comment_len, flags)))
- continue;
- }
- if ((flags & MZ_ZIP_FLAG_IGNORE_PATH) && (filename_len))
- {
- int ofs = filename_len - 1;
- do
- {
- if ((pFilename[ofs] == '/') || (pFilename[ofs] == '\\') || (pFilename[ofs] == ':'))
- break;
- } while (--ofs >= 0);
- ofs++;
- pFilename += ofs;
- filename_len -= ofs;
- }
- if ((filename_len == name_len) && (mz_zip_string_equal(pName, pFilename, filename_len, flags)))
- {
- if (pIndex)
- *pIndex = file_index;
- return MZ_TRUE;
- }
- }
-
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_NOT_FOUND);
-}
-
-mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size)
-{
- int status = TINFL_STATUS_DONE;
- mz_uint64 needed_size, cur_file_ofs, comp_remaining, out_buf_ofs = 0, read_buf_size, read_buf_ofs = 0, read_buf_avail;
- mz_zip_archive_file_stat file_stat;
- void *pRead_buf;
- mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
- tinfl_decompressor inflator;
-
- if ((!pZip) || (!pZip->m_pState) || ((buf_size) && (!pBuf)) || ((user_read_buf_size) && (!pUser_read_buf)) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
- return MZ_FALSE;
-
- /* A directory or zero length file */
- if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
- return MZ_TRUE;
-
- /* Encryption and patch files are not supported. */
- if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
-
- /* This function only supports decompressing stored and deflate. */
- if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);
-
- /* Ensure supplied output buffer is large enough. */
- needed_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? file_stat.m_comp_size : file_stat.m_uncomp_size;
- if (buf_size < needed_size)
- return mz_zip_set_error(pZip, MZ_ZIP_BUF_TOO_SMALL);
-
- /* Read and parse the local directory entry. */
- cur_file_ofs = file_stat.m_local_header_ofs;
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
- if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
- {
- /* The file is stored or the caller has requested the compressed data. */
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, (size_t)needed_size) != needed_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) == 0)
- {
- if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
- return mz_zip_set_error(pZip, MZ_ZIP_CRC_CHECK_FAILED);
- }
-#endif
-
- return MZ_TRUE;
- }
-
- /* Decompress the file either directly from memory or from a file input buffer. */
- tinfl_init(&inflator);
-
- if (pZip->m_pState->m_pMem)
- {
- /* Read directly from the archive in memory. */
- pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs;
- read_buf_size = read_buf_avail = file_stat.m_comp_size;
- comp_remaining = 0;
- }
- else if (pUser_read_buf)
- {
- /* Use a user provided read buffer. */
- if (!user_read_buf_size)
- return MZ_FALSE;
- pRead_buf = (mz_uint8 *)pUser_read_buf;
- read_buf_size = user_read_buf_size;
- read_buf_avail = 0;
- comp_remaining = file_stat.m_comp_size;
- }
- else
- {
- /* Temporarily allocate a read buffer. */
- read_buf_size = MZ_MIN(file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
- if (((sizeof(size_t) == sizeof(mz_uint32))) && (read_buf_size > 0x7FFFFFFF))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- read_buf_avail = 0;
- comp_remaining = file_stat.m_comp_size;
- }
-
- do
- {
- /* The size_t cast here should be OK because we've verified that the output buffer is >= file_stat.m_uncomp_size above */
- size_t in_buf_size, out_buf_size = (size_t)(file_stat.m_uncomp_size - out_buf_ofs);
- if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
- {
- read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
- {
- status = TINFL_STATUS_FAILED;
- mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED);
- break;
- }
- cur_file_ofs += read_buf_avail;
- comp_remaining -= read_buf_avail;
- read_buf_ofs = 0;
- }
- in_buf_size = (size_t)read_buf_avail;
- status = tinfl_decompress(&inflator, (mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pBuf, (mz_uint8 *)pBuf + out_buf_ofs, &out_buf_size, TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF | (comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0));
- read_buf_avail -= in_buf_size;
- read_buf_ofs += in_buf_size;
- out_buf_ofs += out_buf_size;
- } while (status == TINFL_STATUS_NEEDS_MORE_INPUT);
-
- if (status == TINFL_STATUS_DONE)
- {
- /* Make sure the entire file was decompressed, and check its CRC. */
- if (out_buf_ofs != file_stat.m_uncomp_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE);
- status = TINFL_STATUS_FAILED;
- }
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- else if (mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, (size_t)file_stat.m_uncomp_size) != file_stat.m_crc32)
- {
- mz_zip_set_error(pZip, MZ_ZIP_CRC_CHECK_FAILED);
- status = TINFL_STATUS_FAILED;
- }
-#endif
- }
-
- if ((!pZip->m_pState->m_pMem) && (!pUser_read_buf))
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
-
- return status == TINFL_STATUS_DONE;
-}
-
-mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size)
-{
- mz_uint32 file_index;
- if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
- return MZ_FALSE;
- return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, pUser_read_buf, user_read_buf_size);
-}
-
-mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags)
-{
- return mz_zip_reader_extract_to_mem_no_alloc(pZip, file_index, pBuf, buf_size, flags, NULL, 0);
-}
-
-mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags)
-{
- return mz_zip_reader_extract_file_to_mem_no_alloc(pZip, pFilename, pBuf, buf_size, flags, NULL, 0);
-}
-
-void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags)
-{
- mz_uint64 comp_size, uncomp_size, alloc_size;
- const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
- void *pBuf;
-
- if (pSize)
- *pSize = 0;
-
- if (!p)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return NULL;
- }
-
- comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS);
- uncomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS);
-
- alloc_size = (flags & MZ_ZIP_FLAG_COMPRESSED_DATA) ? comp_size : uncomp_size;
- if (((sizeof(size_t) == sizeof(mz_uint32))) && (alloc_size > 0x7FFFFFFF))
- {
- mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
- return NULL;
- }
-
- if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)alloc_size)))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- return NULL;
- }
-
- if (!mz_zip_reader_extract_to_mem(pZip, file_index, pBuf, (size_t)alloc_size, flags))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return NULL;
- }
-
- if (pSize)
- *pSize = (size_t)alloc_size;
- return pBuf;
-}
-
-void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags)
-{
- mz_uint32 file_index;
- if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
- {
- if (pSize)
- *pSize = 0;
- return MZ_FALSE;
- }
- return mz_zip_reader_extract_to_heap(pZip, file_index, pSize, flags);
-}
-
-mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags)
-{
- int status = TINFL_STATUS_DONE;
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- mz_uint file_crc32 = MZ_CRC32_INIT;
-#endif
- mz_uint64 read_buf_size, read_buf_ofs = 0, read_buf_avail, comp_remaining, out_buf_ofs = 0, cur_file_ofs;
- mz_zip_archive_file_stat file_stat;
- void *pRead_buf = NULL;
- void *pWrite_buf = NULL;
- mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
-
- if ((!pZip) || (!pZip->m_pState) || (!pCallback) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
- return MZ_FALSE;
-
- /* A directory or zero length file */
- if ((file_stat.m_is_directory) || (!file_stat.m_comp_size))
- return MZ_TRUE;
-
- /* Encryption and patch files are not supported. */
- if (file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
-
- /* This function only supports decompressing stored and deflate. */
- if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);
-
- /* Read and do some minimal validation of the local directory entry (this doesn't crack the zip64 stuff, which we already have from the central dir) */
- cur_file_ofs = file_stat.m_local_header_ofs;
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
- if ((cur_file_ofs + file_stat.m_comp_size) > pZip->m_archive_size)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- /* Decompress the file either directly from memory or from a file input buffer. */
- if (pZip->m_pState->m_pMem)
- {
- pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + cur_file_ofs;
- read_buf_size = read_buf_avail = file_stat.m_comp_size;
- comp_remaining = 0;
- }
- else
- {
- read_buf_size = MZ_MIN(file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
- if (NULL == (pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)read_buf_size)))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- read_buf_avail = 0;
- comp_remaining = file_stat.m_comp_size;
- }
-
- if ((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!file_stat.m_method))
- {
- /* The file is stored or the caller has requested the compressed data. */
- if (pZip->m_pState->m_pMem)
- {
- if (((sizeof(size_t) == sizeof(mz_uint32))) && (file_stat.m_comp_size > MZ_UINT32_MAX))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)file_stat.m_comp_size) != file_stat.m_comp_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
- status = TINFL_STATUS_FAILED;
- }
- else if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
- {
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)file_stat.m_comp_size);
-#endif
- }
-
- cur_file_ofs += file_stat.m_comp_size;
- out_buf_ofs += file_stat.m_comp_size;
- comp_remaining = 0;
- }
- else
- {
- while (comp_remaining)
- {
- read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- status = TINFL_STATUS_FAILED;
- break;
- }
-
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- if (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
- {
- file_crc32 = (mz_uint32)mz_crc32(file_crc32, (const mz_uint8 *)pRead_buf, (size_t)read_buf_avail);
- }
-#endif
-
- if (pCallback(pOpaque, out_buf_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
- {
- mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
- status = TINFL_STATUS_FAILED;
- break;
- }
-
- cur_file_ofs += read_buf_avail;
- out_buf_ofs += read_buf_avail;
- comp_remaining -= read_buf_avail;
- }
- }
- }
- else
- {
- tinfl_decompressor inflator;
- tinfl_init(&inflator);
-
- if (NULL == (pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- status = TINFL_STATUS_FAILED;
- }
- else
- {
- do
- {
- mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pWrite_buf + (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
- size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
- if ((!read_buf_avail) && (!pZip->m_pState->m_pMem))
- {
- read_buf_avail = MZ_MIN(read_buf_size, comp_remaining);
- if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pRead_buf, (size_t)read_buf_avail) != read_buf_avail)
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- status = TINFL_STATUS_FAILED;
- break;
- }
- cur_file_ofs += read_buf_avail;
- comp_remaining -= read_buf_avail;
- read_buf_ofs = 0;
- }
-
- in_buf_size = (size_t)read_buf_avail;
- status = tinfl_decompress(&inflator, (const mz_uint8 *)pRead_buf + read_buf_ofs, &in_buf_size, (mz_uint8 *)pWrite_buf, pWrite_buf_cur, &out_buf_size, comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
- read_buf_avail -= in_buf_size;
- read_buf_ofs += in_buf_size;
-
- if (out_buf_size)
- {
- if (pCallback(pOpaque, out_buf_ofs, pWrite_buf_cur, out_buf_size) != out_buf_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_WRITE_CALLBACK_FAILED);
- status = TINFL_STATUS_FAILED;
- break;
- }
-
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- file_crc32 = (mz_uint32)mz_crc32(file_crc32, pWrite_buf_cur, out_buf_size);
-#endif
- if ((out_buf_ofs += out_buf_size) > file_stat.m_uncomp_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED);
- status = TINFL_STATUS_FAILED;
- break;
- }
- }
- } while ((status == TINFL_STATUS_NEEDS_MORE_INPUT) || (status == TINFL_STATUS_HAS_MORE_OUTPUT));
- }
- }
-
- if ((status == TINFL_STATUS_DONE) && (!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
- {
- /* Make sure the entire file was decompressed, and check its CRC. */
- if (out_buf_ofs != file_stat.m_uncomp_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE);
- status = TINFL_STATUS_FAILED;
- }
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- else if (file_crc32 != file_stat.m_crc32)
- {
- mz_zip_set_error(pZip, MZ_ZIP_DECOMPRESSION_FAILED);
- status = TINFL_STATUS_FAILED;
- }
-#endif
- }
-
- if (!pZip->m_pState->m_pMem)
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
-
- if (pWrite_buf)
- pZip->m_pFree(pZip->m_pAlloc_opaque, pWrite_buf);
-
- return status == TINFL_STATUS_DONE;
-}
-
-mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags)
-{
- mz_uint32 file_index;
- if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
- return MZ_FALSE;
-
- return mz_zip_reader_extract_to_callback(pZip, file_index, pCallback, pOpaque, flags);
-}
-
-mz_zip_reader_extract_iter_state* mz_zip_reader_extract_iter_new(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags)
-{
- mz_zip_reader_extract_iter_state *pState;
- mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
-
- /* Argument sanity check */
- if ((!pZip) || (!pZip->m_pState))
- return NULL;
-
- /* Allocate an iterator status structure */
- pState = (mz_zip_reader_extract_iter_state*)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_reader_extract_iter_state));
- if (!pState)
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- return NULL;
- }
-
- /* Fetch file details */
- if (!mz_zip_reader_file_stat(pZip, file_index, &pState->file_stat))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- /* Encryption and patch files are not supported. */
- if (pState->file_stat.m_bit_flag & (MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION | MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG))
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- /* This function only supports decompressing stored and deflate. */
- if ((!(flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (pState->file_stat.m_method != 0) && (pState->file_stat.m_method != MZ_DEFLATED))
- {
- mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- /* Init state - save args */
- pState->pZip = pZip;
- pState->flags = flags;
-
- /* Init state - reset variables to defaults */
- pState->status = TINFL_STATUS_DONE;
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- pState->file_crc32 = MZ_CRC32_INIT;
-#endif
- pState->read_buf_ofs = 0;
- pState->out_buf_ofs = 0;
- pState->pRead_buf = NULL;
- pState->pWrite_buf = NULL;
- pState->out_blk_remain = 0;
-
- /* Read and parse the local directory entry. */
- pState->cur_file_ofs = pState->file_stat.m_local_header_ofs;
- if (pZip->m_pRead(pZip->m_pIO_opaque, pState->cur_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- pState->cur_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS) + MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
- if ((pState->cur_file_ofs + pState->file_stat.m_comp_size) > pZip->m_archive_size)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
-
- /* Decompress the file either directly from memory or from a file input buffer. */
- if (pZip->m_pState->m_pMem)
- {
- pState->pRead_buf = (mz_uint8 *)pZip->m_pState->m_pMem + pState->cur_file_ofs;
- pState->read_buf_size = pState->read_buf_avail = pState->file_stat.m_comp_size;
- pState->comp_remaining = pState->file_stat.m_comp_size;
- }
- else
- {
- if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
- {
- /* Decompression required, therefore intermediate read buffer required */
- pState->read_buf_size = MZ_MIN(pState->file_stat.m_comp_size, (mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE);
- if (NULL == (pState->pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)pState->read_buf_size)))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
- }
- else
- {
- /* Decompression not required - we will be reading directly into user buffer, no temp buf required */
- pState->read_buf_size = 0;
- }
- pState->read_buf_avail = 0;
- pState->comp_remaining = pState->file_stat.m_comp_size;
- }
-
- if (!((flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method)))
- {
- /* Decompression required, init decompressor */
- tinfl_init( &pState->inflator );
-
- /* Allocate write buffer */
- if (NULL == (pState->pWrite_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, TINFL_LZ_DICT_SIZE)))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- if (pState->pRead_buf)
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState->pRead_buf);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- return NULL;
- }
- }
-
- return pState;
-}
-
-mz_zip_reader_extract_iter_state* mz_zip_reader_extract_file_iter_new(mz_zip_archive *pZip, const char *pFilename, mz_uint flags)
-{
- mz_uint32 file_index;
-
- /* Locate file index by name */
- if (!mz_zip_reader_locate_file_v2(pZip, pFilename, NULL, flags, &file_index))
- return NULL;
-
- /* Construct iterator */
- return mz_zip_reader_extract_iter_new(pZip, file_index, flags);
-}
-
-size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state* pState, void* pvBuf, size_t buf_size)
-{
- size_t copied_to_caller = 0;
-
- /* Argument sanity check */
- if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState) || (!pvBuf))
- return 0;
-
- if ((pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA) || (!pState->file_stat.m_method))
- {
- /* The file is stored or the caller has requested the compressed data, calc amount to return. */
- copied_to_caller = (size_t)MZ_MIN( buf_size, pState->comp_remaining );
-
- /* Zip is in memory....or requires reading from a file? */
- if (pState->pZip->m_pState->m_pMem)
- {
- /* Copy data to caller's buffer */
- memcpy( pvBuf, pState->pRead_buf, copied_to_caller );
- pState->pRead_buf = ((mz_uint8*)pState->pRead_buf) + copied_to_caller;
- }
- else
- {
- /* Read directly into caller's buffer */
- if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pvBuf, copied_to_caller) != copied_to_caller)
- {
- /* Failed to read all that was asked for, flag failure and alert user */
- mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED);
- pState->status = TINFL_STATUS_FAILED;
- copied_to_caller = 0;
- }
- }
-
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- /* Compute CRC if not returning compressed data only */
- if (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
- pState->file_crc32 = (mz_uint32)mz_crc32(pState->file_crc32, (const mz_uint8 *)pvBuf, copied_to_caller);
-#endif
-
- /* Advance offsets, dec counters */
- pState->cur_file_ofs += copied_to_caller;
- pState->out_buf_ofs += copied_to_caller;
- pState->comp_remaining -= copied_to_caller;
- }
- else
- {
- do
- {
- /* Calc ptr to write buffer - given current output pos and block size */
- mz_uint8 *pWrite_buf_cur = (mz_uint8 *)pState->pWrite_buf + (pState->out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
-
- /* Calc max output size - given current output pos and block size */
- size_t in_buf_size, out_buf_size = TINFL_LZ_DICT_SIZE - (pState->out_buf_ofs & (TINFL_LZ_DICT_SIZE - 1));
-
- if (!pState->out_blk_remain)
- {
- /* Read more data from file if none available (and reading from file) */
- if ((!pState->read_buf_avail) && (!pState->pZip->m_pState->m_pMem))
- {
- /* Calc read size */
- pState->read_buf_avail = MZ_MIN(pState->read_buf_size, pState->comp_remaining);
- if (pState->pZip->m_pRead(pState->pZip->m_pIO_opaque, pState->cur_file_ofs, pState->pRead_buf, (size_t)pState->read_buf_avail) != pState->read_buf_avail)
- {
- mz_zip_set_error(pState->pZip, MZ_ZIP_FILE_READ_FAILED);
- pState->status = TINFL_STATUS_FAILED;
- break;
- }
-
- /* Advance offsets, dec counters */
- pState->cur_file_ofs += pState->read_buf_avail;
- pState->comp_remaining -= pState->read_buf_avail;
- pState->read_buf_ofs = 0;
- }
-
- /* Perform decompression */
- in_buf_size = (size_t)pState->read_buf_avail;
- pState->status = tinfl_decompress(&pState->inflator, (const mz_uint8 *)pState->pRead_buf + pState->read_buf_ofs, &in_buf_size, (mz_uint8 *)pState->pWrite_buf, pWrite_buf_cur, &out_buf_size, pState->comp_remaining ? TINFL_FLAG_HAS_MORE_INPUT : 0);
- pState->read_buf_avail -= in_buf_size;
- pState->read_buf_ofs += in_buf_size;
-
- /* Update current output block size remaining */
- pState->out_blk_remain = out_buf_size;
- }
-
- if (pState->out_blk_remain)
- {
- /* Calc amount to return. */
- size_t to_copy = MZ_MIN( (buf_size - copied_to_caller), pState->out_blk_remain );
-
- /* Copy data to caller's buffer */
- memcpy( (uint8_t*)pvBuf + copied_to_caller, pWrite_buf_cur, to_copy );
-
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- /* Perform CRC */
- pState->file_crc32 = (mz_uint32)mz_crc32(pState->file_crc32, pWrite_buf_cur, to_copy);
-#endif
-
- /* Decrement data consumed from block */
- pState->out_blk_remain -= to_copy;
-
- /* Inc output offset, while performing sanity check */
- if ((pState->out_buf_ofs += to_copy) > pState->file_stat.m_uncomp_size)
- {
- mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED);
- pState->status = TINFL_STATUS_FAILED;
- break;
- }
-
- /* Increment counter of data copied to caller */
- copied_to_caller += to_copy;
- }
- } while ( (copied_to_caller < buf_size) && ((pState->status == TINFL_STATUS_NEEDS_MORE_INPUT) || (pState->status == TINFL_STATUS_HAS_MORE_OUTPUT)) );
- }
-
- /* Return how many bytes were copied into user buffer */
- return copied_to_caller;
-}
-
-mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState)
-{
- int status;
-
- /* Argument sanity check */
- if ((!pState) || (!pState->pZip) || (!pState->pZip->m_pState))
- return MZ_FALSE;
-
- /* Was decompression completed and requested? */
- if ((pState->status == TINFL_STATUS_DONE) && (!(pState->flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
- {
- /* Make sure the entire file was decompressed, and check its CRC. */
- if (pState->out_buf_ofs != pState->file_stat.m_uncomp_size)
- {
- mz_zip_set_error(pState->pZip, MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE);
- pState->status = TINFL_STATUS_FAILED;
- }
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- else if (pState->file_crc32 != pState->file_stat.m_crc32)
- {
- mz_zip_set_error(pState->pZip, MZ_ZIP_DECOMPRESSION_FAILED);
- pState->status = TINFL_STATUS_FAILED;
- }
-#endif
- }
-
- /* Free buffers */
- if (!pState->pZip->m_pState->m_pMem)
- pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pRead_buf);
- if (pState->pWrite_buf)
- pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState->pWrite_buf);
-
- /* Save status */
- status = pState->status;
-
- /* Free context */
- pState->pZip->m_pFree(pState->pZip->m_pAlloc_opaque, pState);
-
- return status == TINFL_STATUS_DONE;
-}
-
-#ifndef MINIZ_NO_STDIO
-static size_t mz_zip_file_write_callback(void *pOpaque, mz_uint64 ofs, const void *pBuf, size_t n)
-{
- (void)ofs;
-
- return MZ_FWRITE(pBuf, 1, n, (MZ_FILE *)pOpaque);
-}
-
-mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags)
-{
- mz_bool status;
- mz_zip_archive_file_stat file_stat;
- MZ_FILE *pFile;
-
- if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
- return MZ_FALSE;
-
- if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE);
-
- pFile = MZ_FOPEN(pDst_filename, "wb");
- if (!pFile)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
-
- status = mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags);
-
- if (MZ_FCLOSE(pFile) == EOF)
- {
- if (status)
- mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED);
-
- status = MZ_FALSE;
- }
-
-#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_STDIO)
- if (status)
- mz_zip_set_file_times(pDst_filename, file_stat.m_time, file_stat.m_time);
-#endif
-
- return status;
-}
-
-mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags)
-{
- mz_uint32 file_index;
- if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index))
- return MZ_FALSE;
-
- return mz_zip_reader_extract_to_file(pZip, file_index, pDst_filename, flags);
-}
-
-mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *pFile, mz_uint flags)
-{
- mz_zip_archive_file_stat file_stat;
-
- if (!mz_zip_reader_file_stat(pZip, file_index, &file_stat))
- return MZ_FALSE;
-
- if ((file_stat.m_is_directory) || (!file_stat.m_is_supported))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE);
-
- return mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_file_write_callback, pFile, flags);
-}
-
-mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags)
-{
- mz_uint32 file_index;
- if (!mz_zip_reader_locate_file_v2(pZip, pArchive_filename, NULL, flags, &file_index))
- return MZ_FALSE;
-
- return mz_zip_reader_extract_to_cfile(pZip, file_index, pFile, flags);
-}
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-static size_t mz_zip_compute_crc32_callback(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
-{
- mz_uint32 *p = (mz_uint32 *)pOpaque;
- (void)file_ofs;
- *p = (mz_uint32)mz_crc32(*p, (const mz_uint8 *)pBuf, n);
- return n;
-}
-
-mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags)
-{
- mz_zip_archive_file_stat file_stat;
- mz_zip_internal_state *pState;
- const mz_uint8 *pCentral_dir_header;
- mz_bool found_zip64_ext_data_in_cdir = MZ_FALSE;
- mz_bool found_zip64_ext_data_in_ldir = MZ_FALSE;
- mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
- mz_uint64 local_header_ofs = 0;
- mz_uint32 local_header_filename_len, local_header_extra_len, local_header_crc32;
- mz_uint64 local_header_comp_size, local_header_uncomp_size;
- mz_uint32 uncomp_crc32 = MZ_CRC32_INIT;
- mz_bool has_data_descriptor;
- mz_uint32 local_header_bit_flags;
-
- mz_zip_array file_data_array;
- mz_zip_array_init(&file_data_array, 1);
-
- if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (file_index > pZip->m_total_files)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- pCentral_dir_header = mz_zip_get_cdh(pZip, file_index);
-
- if (!mz_zip_file_stat_internal(pZip, file_index, pCentral_dir_header, &file_stat, &found_zip64_ext_data_in_cdir))
- return MZ_FALSE;
-
- /* A directory or zero length file */
- if ((file_stat.m_is_directory) || (!file_stat.m_uncomp_size))
- return MZ_TRUE;
-
- /* Encryption and patch files are not supported. */
- if (file_stat.m_is_encrypted)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION);
-
- /* This function only supports stored and deflate. */
- if ((file_stat.m_method != 0) && (file_stat.m_method != MZ_DEFLATED))
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_METHOD);
-
- if (!file_stat.m_is_supported)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_FEATURE);
-
- /* Read and parse the local directory entry. */
- local_header_ofs = file_stat.m_local_header_ofs;
- if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- local_header_filename_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS);
- local_header_extra_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
- local_header_comp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS);
- local_header_uncomp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS);
- local_header_crc32 = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_CRC32_OFS);
- local_header_bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS);
- has_data_descriptor = (local_header_bit_flags & 8) != 0;
-
- if (local_header_filename_len != strlen(file_stat.m_filename))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if ((local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size) > pZip->m_archive_size)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if (!mz_zip_array_resize(pZip, &file_data_array, MZ_MAX(local_header_filename_len, local_header_extra_len), MZ_FALSE))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- goto handle_failure;
- }
-
- if (local_header_filename_len)
- {
- if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE, file_data_array.m_p, local_header_filename_len) != local_header_filename_len)
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- goto handle_failure;
- }
-
- /* I've seen 1 archive that had the same pathname, but used backslashes in the local dir and forward slashes in the central dir. Do we care about this? For now, this case will fail validation. */
- if (memcmp(file_stat.m_filename, file_data_array.m_p, local_header_filename_len) != 0)
- {
- mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
- goto handle_failure;
- }
- }
-
- if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
- {
- mz_uint32 extra_size_remaining = local_header_extra_len;
- const mz_uint8 *pExtra_data = (const mz_uint8 *)file_data_array.m_p;
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len, file_data_array.m_p, local_header_extra_len) != local_header_extra_len)
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- goto handle_failure;
- }
-
- do
- {
- mz_uint32 field_id, field_data_size, field_total_size;
-
- if (extra_size_remaining < (sizeof(mz_uint16) * 2))
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- goto handle_failure;
- }
-
- field_id = MZ_READ_LE16(pExtra_data);
- field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
- field_total_size = field_data_size + sizeof(mz_uint16) * 2;
-
- if (field_total_size > extra_size_remaining)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- goto handle_failure;
- }
-
- if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
- {
- const mz_uint8 *pSrc_field_data = pExtra_data + sizeof(mz_uint32);
-
- if (field_data_size < sizeof(mz_uint64) * 2)
- {
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- goto handle_failure;
- }
-
- local_header_uncomp_size = MZ_READ_LE64(pSrc_field_data);
- local_header_comp_size = MZ_READ_LE64(pSrc_field_data + sizeof(mz_uint64));
-
- found_zip64_ext_data_in_ldir = MZ_TRUE;
- break;
- }
-
- pExtra_data += field_total_size;
- extra_size_remaining -= field_total_size;
- } while (extra_size_remaining);
- }
-
- /* TODO: parse local header extra data when local_header_comp_size is 0xFFFFFFFF! (big_descriptor.zip) */
- /* I've seen zips in the wild with the data descriptor bit set, but proper local header values and bogus data descriptors */
- if ((has_data_descriptor) && (!local_header_comp_size) && (!local_header_crc32))
- {
- mz_uint8 descriptor_buf[32];
- mz_bool has_id;
- const mz_uint8 *pSrc;
- mz_uint32 file_crc32;
- mz_uint64 comp_size = 0, uncomp_size = 0;
-
- mz_uint32 num_descriptor_uint32s = ((pState->m_zip64) || (found_zip64_ext_data_in_ldir)) ? 6 : 4;
-
- if (pZip->m_pRead(pZip->m_pIO_opaque, local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_len + local_header_extra_len + file_stat.m_comp_size, descriptor_buf, sizeof(mz_uint32) * num_descriptor_uint32s) != (sizeof(mz_uint32) * num_descriptor_uint32s))
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- goto handle_failure;
- }
-
- has_id = (MZ_READ_LE32(descriptor_buf) == MZ_ZIP_DATA_DESCRIPTOR_ID);
- pSrc = has_id ? (descriptor_buf + sizeof(mz_uint32)) : descriptor_buf;
-
- file_crc32 = MZ_READ_LE32(pSrc);
-
- if ((pState->m_zip64) || (found_zip64_ext_data_in_ldir))
- {
- comp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32));
- uncomp_size = MZ_READ_LE64(pSrc + sizeof(mz_uint32) + sizeof(mz_uint64));
- }
- else
- {
- comp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32));
- uncomp_size = MZ_READ_LE32(pSrc + sizeof(mz_uint32) + sizeof(mz_uint32));
- }
-
- if ((file_crc32 != file_stat.m_crc32) || (comp_size != file_stat.m_comp_size) || (uncomp_size != file_stat.m_uncomp_size))
- {
- mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
- goto handle_failure;
- }
- }
- else
- {
- if ((local_header_crc32 != file_stat.m_crc32) || (local_header_comp_size != file_stat.m_comp_size) || (local_header_uncomp_size != file_stat.m_uncomp_size))
- {
- mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
- goto handle_failure;
- }
- }
-
- mz_zip_array_clear(pZip, &file_data_array);
-
- if ((flags & MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY) == 0)
- {
- if (!mz_zip_reader_extract_to_callback(pZip, file_index, mz_zip_compute_crc32_callback, &uncomp_crc32, 0))
- return MZ_FALSE;
-
- /* 1 more check to be sure, although the extract checks too. */
- if (uncomp_crc32 != file_stat.m_crc32)
- {
- mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
- return MZ_FALSE;
- }
- }
-
- return MZ_TRUE;
-
-handle_failure:
- mz_zip_array_clear(pZip, &file_data_array);
- return MZ_FALSE;
-}
-
-mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags)
-{
- mz_zip_internal_state *pState;
- uint32_t i;
-
- if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- /* Basic sanity checks */
- if (!pState->m_zip64)
- {
- if (pZip->m_total_files > MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- if (pZip->m_archive_size > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
- }
- else
- {
- if (pZip->m_total_files >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
- }
-
- for (i = 0; i < pZip->m_total_files; i++)
- {
- if (MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG & flags)
- {
- mz_uint32 found_index;
- mz_zip_archive_file_stat stat;
-
- if (!mz_zip_reader_file_stat(pZip, i, &stat))
- return MZ_FALSE;
-
- if (!mz_zip_reader_locate_file_v2(pZip, stat.m_filename, NULL, 0, &found_index))
- return MZ_FALSE;
-
- /* This check can fail if there are duplicate filenames in the archive (which we don't check for when writing - that's up to the user) */
- if (found_index != i)
- return mz_zip_set_error(pZip, MZ_ZIP_VALIDATION_FAILED);
- }
-
- if (!mz_zip_validate_file(pZip, i, flags))
- return MZ_FALSE;
- }
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr)
-{
- mz_bool success = MZ_TRUE;
- mz_zip_archive zip;
- mz_zip_error actual_err = MZ_ZIP_NO_ERROR;
-
- if ((!pMem) || (!size))
- {
- if (pErr)
- *pErr = MZ_ZIP_INVALID_PARAMETER;
- return MZ_FALSE;
- }
-
- mz_zip_zero_struct(&zip);
-
- if (!mz_zip_reader_init_mem(&zip, pMem, size, flags))
- {
- if (pErr)
- *pErr = zip.m_last_error;
- return MZ_FALSE;
- }
-
- if (!mz_zip_validate_archive(&zip, flags))
- {
- actual_err = zip.m_last_error;
- success = MZ_FALSE;
- }
-
- if (!mz_zip_reader_end_internal(&zip, success))
- {
- if (!actual_err)
- actual_err = zip.m_last_error;
- success = MZ_FALSE;
- }
-
- if (pErr)
- *pErr = actual_err;
-
- return success;
-}
-
-#ifndef MINIZ_NO_STDIO
-mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr)
-{
- mz_bool success = MZ_TRUE;
- mz_zip_archive zip;
- mz_zip_error actual_err = MZ_ZIP_NO_ERROR;
-
- if (!pFilename)
- {
- if (pErr)
- *pErr = MZ_ZIP_INVALID_PARAMETER;
- return MZ_FALSE;
- }
-
- mz_zip_zero_struct(&zip);
-
- if (!mz_zip_reader_init_file_v2(&zip, pFilename, flags, 0, 0))
- {
- if (pErr)
- *pErr = zip.m_last_error;
- return MZ_FALSE;
- }
-
- if (!mz_zip_validate_archive(&zip, flags))
- {
- actual_err = zip.m_last_error;
- success = MZ_FALSE;
- }
-
- if (!mz_zip_reader_end_internal(&zip, success))
- {
- if (!actual_err)
- actual_err = zip.m_last_error;
- success = MZ_FALSE;
- }
-
- if (pErr)
- *pErr = actual_err;
-
- return success;
-}
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-/* ------------------- .ZIP archive writing */
-
-#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
-
-static MZ_FORCEINLINE void mz_write_le16(mz_uint8 *p, mz_uint16 v)
-{
- p[0] = (mz_uint8)v;
- p[1] = (mz_uint8)(v >> 8);
-}
-static MZ_FORCEINLINE void mz_write_le32(mz_uint8 *p, mz_uint32 v)
-{
- p[0] = (mz_uint8)v;
- p[1] = (mz_uint8)(v >> 8);
- p[2] = (mz_uint8)(v >> 16);
- p[3] = (mz_uint8)(v >> 24);
-}
-static MZ_FORCEINLINE void mz_write_le64(mz_uint8 *p, mz_uint64 v)
-{
- mz_write_le32(p, (mz_uint32)v);
- mz_write_le32(p + sizeof(mz_uint32), (mz_uint32)(v >> 32));
-}
-
-#define MZ_WRITE_LE16(p, v) mz_write_le16((mz_uint8 *)(p), (mz_uint16)(v))
-#define MZ_WRITE_LE32(p, v) mz_write_le32((mz_uint8 *)(p), (mz_uint32)(v))
-#define MZ_WRITE_LE64(p, v) mz_write_le64((mz_uint8 *)(p), (mz_uint64)(v))
-
-static size_t mz_zip_heap_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
-{
- mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
- mz_zip_internal_state *pState = pZip->m_pState;
- mz_uint64 new_size = MZ_MAX(file_ofs + n, pState->m_mem_size);
-
- if (!n)
- return 0;
-
- /* An allocation this big is likely to just fail on 32-bit systems, so don't even go there. */
- if ((sizeof(size_t) == sizeof(mz_uint32)) && (new_size > 0x7FFFFFFF))
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE);
- return 0;
- }
-
- if (new_size > pState->m_mem_capacity)
- {
- void *pNew_block;
- size_t new_capacity = MZ_MAX(64, pState->m_mem_capacity);
-
- while (new_capacity < new_size)
- new_capacity *= 2;
-
- if (NULL == (pNew_block = pZip->m_pRealloc(pZip->m_pAlloc_opaque, pState->m_pMem, 1, new_capacity)))
- {
- mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- return 0;
- }
-
- pState->m_pMem = pNew_block;
- pState->m_mem_capacity = new_capacity;
- }
- memcpy((mz_uint8 *)pState->m_pMem + file_ofs, pBuf, n);
- pState->m_mem_size = (size_t)new_size;
- return n;
-}
-
-static mz_bool mz_zip_writer_end_internal(mz_zip_archive *pZip, mz_bool set_last_error)
-{
- mz_zip_internal_state *pState;
- mz_bool status = MZ_TRUE;
-
- if ((!pZip) || (!pZip->m_pState) || (!pZip->m_pAlloc) || (!pZip->m_pFree) || ((pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) && (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED)))
- {
- if (set_last_error)
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return MZ_FALSE;
- }
-
- pState = pZip->m_pState;
- pZip->m_pState = NULL;
- mz_zip_array_clear(pZip, &pState->m_central_dir);
- mz_zip_array_clear(pZip, &pState->m_central_dir_offsets);
- mz_zip_array_clear(pZip, &pState->m_sorted_central_dir_offsets);
-
-#ifndef MINIZ_NO_STDIO
- if (pState->m_pFile)
- {
- if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
- {
- if (MZ_FCLOSE(pState->m_pFile) == EOF)
- {
- if (set_last_error)
- mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED);
- status = MZ_FALSE;
- }
- }
-
- pState->m_pFile = NULL;
- }
-#endif /* #ifndef MINIZ_NO_STDIO */
-
- if ((pZip->m_pWrite == mz_zip_heap_write_func) && (pState->m_pMem))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState->m_pMem);
- pState->m_pMem = NULL;
- }
-
- pZip->m_pFree(pZip->m_pAlloc_opaque, pState);
- pZip->m_zip_mode = MZ_ZIP_MODE_INVALID;
- return status;
-}
-
-mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags)
-{
- mz_bool zip64 = (flags & MZ_ZIP_FLAG_WRITE_ZIP64) != 0;
-
- if ((!pZip) || (pZip->m_pState) || (!pZip->m_pWrite) || (pZip->m_zip_mode != MZ_ZIP_MODE_INVALID))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
- {
- if (!pZip->m_pRead)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- }
-
- if (pZip->m_file_offset_alignment)
- {
- /* Ensure user specified file offset alignment is a power of 2. */
- if (pZip->m_file_offset_alignment & (pZip->m_file_offset_alignment - 1))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- }
-
- if (!pZip->m_pAlloc)
- pZip->m_pAlloc = miniz_def_alloc_func;
- if (!pZip->m_pFree)
- pZip->m_pFree = miniz_def_free_func;
- if (!pZip->m_pRealloc)
- pZip->m_pRealloc = miniz_def_realloc_func;
-
- pZip->m_archive_size = existing_size;
- pZip->m_central_directory_file_ofs = 0;
- pZip->m_total_files = 0;
-
- if (NULL == (pZip->m_pState = (mz_zip_internal_state *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(mz_zip_internal_state))))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- memset(pZip->m_pState, 0, sizeof(mz_zip_internal_state));
-
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir, sizeof(mz_uint8));
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_central_dir_offsets, sizeof(mz_uint32));
- MZ_ZIP_ARRAY_SET_ELEMENT_SIZE(&pZip->m_pState->m_sorted_central_dir_offsets, sizeof(mz_uint32));
-
- pZip->m_pState->m_zip64 = zip64;
- pZip->m_pState->m_zip64_has_extended_info_fields = zip64;
-
- pZip->m_zip_type = MZ_ZIP_TYPE_USER;
- pZip->m_zip_mode = MZ_ZIP_MODE_WRITING;
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size)
-{
- return mz_zip_writer_init_v2(pZip, existing_size, 0);
-}
-
-mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags)
-{
- pZip->m_pWrite = mz_zip_heap_write_func;
- pZip->m_pNeeds_keepalive = NULL;
-
- if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
- pZip->m_pRead = mz_zip_mem_read_func;
-
- pZip->m_pIO_opaque = pZip;
-
- if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
- return MZ_FALSE;
-
- pZip->m_zip_type = MZ_ZIP_TYPE_HEAP;
-
- if (0 != (initial_allocation_size = MZ_MAX(initial_allocation_size, size_to_reserve_at_beginning)))
- {
- if (NULL == (pZip->m_pState->m_pMem = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, initial_allocation_size)))
- {
- mz_zip_writer_end_internal(pZip, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
- pZip->m_pState->m_mem_capacity = initial_allocation_size;
- }
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size)
-{
- return mz_zip_writer_init_heap_v2(pZip, size_to_reserve_at_beginning, initial_allocation_size, 0);
-}
-
-#ifndef MINIZ_NO_STDIO
-static size_t mz_zip_file_write_func(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n)
-{
- mz_zip_archive *pZip = (mz_zip_archive *)pOpaque;
- mz_int64 cur_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);
-
- file_ofs += pZip->m_pState->m_file_archive_start_ofs;
-
- if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pZip->m_pState->m_pFile, (mz_int64)file_ofs, SEEK_SET))))
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_SEEK_FAILED);
- return 0;
- }
-
- return MZ_FWRITE(pBuf, 1, n, pZip->m_pState->m_pFile);
-}
-
-mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning)
-{
- return mz_zip_writer_init_file_v2(pZip, pFilename, size_to_reserve_at_beginning, 0);
-}
-
-mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags)
-{
- MZ_FILE *pFile;
-
- pZip->m_pWrite = mz_zip_file_write_func;
- pZip->m_pNeeds_keepalive = NULL;
-
- if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
- pZip->m_pRead = mz_zip_file_read_func;
-
- pZip->m_pIO_opaque = pZip;
-
- if (!mz_zip_writer_init_v2(pZip, size_to_reserve_at_beginning, flags))
- return MZ_FALSE;
-
- if (NULL == (pFile = MZ_FOPEN(pFilename, (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING) ? "w+b" : "wb")))
- {
- mz_zip_writer_end(pZip);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
- }
-
- pZip->m_pState->m_pFile = pFile;
- pZip->m_zip_type = MZ_ZIP_TYPE_FILE;
-
- if (size_to_reserve_at_beginning)
- {
- mz_uint64 cur_ofs = 0;
- char buf[4096];
-
- MZ_CLEAR_OBJ(buf);
-
- do
- {
- size_t n = (size_t)MZ_MIN(sizeof(buf), size_to_reserve_at_beginning);
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_ofs, buf, n) != n)
- {
- mz_zip_writer_end(pZip);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
- cur_ofs += n;
- size_to_reserve_at_beginning -= n;
- } while (size_to_reserve_at_beginning);
- }
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags)
-{
- pZip->m_pWrite = mz_zip_file_write_func;
- pZip->m_pNeeds_keepalive = NULL;
-
- if (flags & MZ_ZIP_FLAG_WRITE_ALLOW_READING)
- pZip->m_pRead = mz_zip_file_read_func;
-
- pZip->m_pIO_opaque = pZip;
-
- if (!mz_zip_writer_init_v2(pZip, 0, flags))
- return MZ_FALSE;
-
- pZip->m_pState->m_pFile = pFile;
- pZip->m_pState->m_file_archive_start_ofs = MZ_FTELL64(pZip->m_pState->m_pFile);
- pZip->m_zip_type = MZ_ZIP_TYPE_CFILE;
-
- return MZ_TRUE;
-}
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags)
-{
- mz_zip_internal_state *pState;
-
- if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_READING))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (flags & MZ_ZIP_FLAG_WRITE_ZIP64)
- {
- /* We don't support converting a non-zip64 file to zip64 - this seems like more trouble than it's worth. (What about the existing 32-bit data descriptors that could follow the compressed data?) */
- if (!pZip->m_pState->m_zip64)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- }
-
- /* No sense in trying to write to an archive that's already at the support max size */
- if (pZip->m_pState->m_zip64)
- {
- if (pZip->m_total_files == MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
- else
- {
- if (pZip->m_total_files == MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
-
- if ((pZip->m_archive_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + MZ_ZIP_LOCAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE);
- }
-
- pState = pZip->m_pState;
-
- if (pState->m_pFile)
- {
-#ifdef MINIZ_NO_STDIO
- (void)pFilename;
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-#else
- if (pZip->m_pIO_opaque != pZip)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (pZip->m_zip_type == MZ_ZIP_TYPE_FILE)
- {
- if (!pFilename)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- /* Archive is being read from stdio and was originally opened only for reading. Try to reopen as writable. */
- if (NULL == (pState->m_pFile = MZ_FREOPEN(pFilename, "r+b", pState->m_pFile)))
- {
- /* The mz_zip_archive is now in a bogus state because pState->m_pFile is NULL, so just close it. */
- mz_zip_reader_end_internal(pZip, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
- }
- }
-
- pZip->m_pWrite = mz_zip_file_write_func;
- pZip->m_pNeeds_keepalive = NULL;
-#endif /* #ifdef MINIZ_NO_STDIO */
- }
- else if (pState->m_pMem)
- {
- /* Archive lives in a memory block. Assume it's from the heap that we can resize using the realloc callback. */
- if (pZip->m_pIO_opaque != pZip)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState->m_mem_capacity = pState->m_mem_size;
- pZip->m_pWrite = mz_zip_heap_write_func;
- pZip->m_pNeeds_keepalive = NULL;
- }
- /* Archive is being read via a user provided read function - make sure the user has specified a write function too. */
- else if (!pZip->m_pWrite)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- /* Start writing new files at the archive's current central directory location. */
- /* TODO: We could add a flag that lets the user start writing immediately AFTER the existing central dir - this would be safer. */
- pZip->m_archive_size = pZip->m_central_directory_file_ofs;
- pZip->m_central_directory_file_ofs = 0;
-
- /* Clear the sorted central dir offsets, they aren't useful or maintained now. */
- /* Even though we're now in write mode, files can still be extracted and verified, but file locates will be slow. */
- /* TODO: We could easily maintain the sorted central directory offsets. */
- mz_zip_array_clear(pZip, &pZip->m_pState->m_sorted_central_dir_offsets);
-
- pZip->m_zip_mode = MZ_ZIP_MODE_WRITING;
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename)
-{
- return mz_zip_writer_init_from_reader_v2(pZip, pFilename, 0);
-}
-
-/* TODO: pArchive_name is a terrible name here! */
-mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags)
-{
- return mz_zip_writer_add_mem_ex(pZip, pArchive_name, pBuf, buf_size, NULL, 0, level_and_flags, 0, 0);
-}
-
-typedef struct
-{
- mz_zip_archive *m_pZip;
- mz_uint64 m_cur_archive_file_ofs;
- mz_uint64 m_comp_size;
-} mz_zip_writer_add_state;
-
-static mz_bool mz_zip_writer_add_put_buf_callback(const void *pBuf, int len, void *pUser)
-{
- mz_zip_writer_add_state *pState = (mz_zip_writer_add_state *)pUser;
- if ((int)pState->m_pZip->m_pWrite(pState->m_pZip->m_pIO_opaque, pState->m_cur_archive_file_ofs, pBuf, len) != len)
- return MZ_FALSE;
-
- pState->m_cur_archive_file_ofs += len;
- pState->m_comp_size += len;
- return MZ_TRUE;
-}
-
-#define MZ_ZIP64_MAX_LOCAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 2)
-#define MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE (sizeof(mz_uint16) * 2 + sizeof(mz_uint64) * 3)
-static mz_uint32 mz_zip_writer_create_zip64_extra_data(mz_uint8 *pBuf, mz_uint64 *pUncomp_size, mz_uint64 *pComp_size, mz_uint64 *pLocal_header_ofs)
-{
- mz_uint8 *pDst = pBuf;
- mz_uint32 field_size = 0;
-
- MZ_WRITE_LE16(pDst + 0, MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID);
- MZ_WRITE_LE16(pDst + 2, 0);
- pDst += sizeof(mz_uint16) * 2;
-
- if (pUncomp_size)
- {
- MZ_WRITE_LE64(pDst, *pUncomp_size);
- pDst += sizeof(mz_uint64);
- field_size += sizeof(mz_uint64);
- }
-
- if (pComp_size)
- {
- MZ_WRITE_LE64(pDst, *pComp_size);
- pDst += sizeof(mz_uint64);
- field_size += sizeof(mz_uint64);
- }
-
- if (pLocal_header_ofs)
- {
- MZ_WRITE_LE64(pDst, *pLocal_header_ofs);
- pDst += sizeof(mz_uint64);
- field_size += sizeof(mz_uint64);
- }
-
- MZ_WRITE_LE16(pBuf + 2, field_size);
-
- return (mz_uint32)(pDst - pBuf);
-}
-
-static mz_bool mz_zip_writer_create_local_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst, mz_uint16 filename_size, mz_uint16 extra_size, mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32, mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date)
-{
- (void)pZip;
- memset(pDst, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE);
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_SIG_OFS, MZ_ZIP_LOCAL_DIR_HEADER_SIG);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_VERSION_NEEDED_OFS, method ? 20 : 0);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_BIT_FLAG_OFS, bit_flags);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_METHOD_OFS, method);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_TIME_OFS, dos_time);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILE_DATE_OFS, dos_date);
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_CRC32_OFS, uncomp_crc32);
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
- MZ_WRITE_LE32(pDst + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_FILENAME_LEN_OFS, filename_size);
- MZ_WRITE_LE16(pDst + MZ_ZIP_LDH_EXTRA_LEN_OFS, extra_size);
- return MZ_TRUE;
-}
-
-static mz_bool mz_zip_writer_create_central_dir_header(mz_zip_archive *pZip, mz_uint8 *pDst,
- mz_uint16 filename_size, mz_uint16 extra_size, mz_uint16 comment_size,
- mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32,
- mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date,
- mz_uint64 local_header_ofs, mz_uint32 ext_attributes)
-{
- (void)pZip;
- memset(pDst, 0, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_SIG_OFS, MZ_ZIP_CENTRAL_DIR_HEADER_SIG);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_VERSION_NEEDED_OFS, method ? 20 : 0);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_BIT_FLAG_OFS, bit_flags);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_METHOD_OFS, method);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_TIME_OFS, dos_time);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILE_DATE_OFS, dos_date);
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_CRC32_OFS, uncomp_crc32);
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_MIN(comp_size, MZ_UINT32_MAX));
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_MIN(uncomp_size, MZ_UINT32_MAX));
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_FILENAME_LEN_OFS, filename_size);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_EXTRA_LEN_OFS, extra_size);
- MZ_WRITE_LE16(pDst + MZ_ZIP_CDH_COMMENT_LEN_OFS, comment_size);
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_EXTERNAL_ATTR_OFS, ext_attributes);
- MZ_WRITE_LE32(pDst + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_MIN(local_header_ofs, MZ_UINT32_MAX));
- return MZ_TRUE;
-}
-
-static mz_bool mz_zip_writer_add_to_central_dir(mz_zip_archive *pZip, const char *pFilename, mz_uint16 filename_size,
- const void *pExtra, mz_uint16 extra_size, const void *pComment, mz_uint16 comment_size,
- mz_uint64 uncomp_size, mz_uint64 comp_size, mz_uint32 uncomp_crc32,
- mz_uint16 method, mz_uint16 bit_flags, mz_uint16 dos_time, mz_uint16 dos_date,
- mz_uint64 local_header_ofs, mz_uint32 ext_attributes,
- const char *user_extra_data, mz_uint user_extra_data_len)
-{
- mz_zip_internal_state *pState = pZip->m_pState;
- mz_uint32 central_dir_ofs = (mz_uint32)pState->m_central_dir.m_size;
- size_t orig_central_dir_size = pState->m_central_dir.m_size;
- mz_uint8 central_dir_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE];
-
- if (!pZip->m_pState->m_zip64)
- {
- if (local_header_ofs > 0xFFFFFFFF)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_TOO_LARGE);
- }
-
- /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */
- if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + extra_size + user_extra_data_len + comment_size) >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
-
- if (!mz_zip_writer_create_central_dir_header(pZip, central_dir_header, filename_size, (mz_uint16)(extra_size + user_extra_data_len), comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_header_ofs, ext_attributes))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if ((!mz_zip_array_push_back(pZip, &pState->m_central_dir, central_dir_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE)) ||
- (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pFilename, filename_size)) ||
- (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pExtra, extra_size)) ||
- (!mz_zip_array_push_back(pZip, &pState->m_central_dir, user_extra_data, user_extra_data_len)) ||
- (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pComment, comment_size)) ||
- (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &central_dir_ofs, 1)))
- {
- /* Try to resize the central directory array back into its original state. */
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- return MZ_TRUE;
-}
-
-static mz_bool mz_zip_writer_validate_archive_name(const char *pArchive_name)
-{
- /* Basic ZIP archive filename validity checks: Valid filenames cannot start with a forward slash, cannot contain a drive letter, and cannot use DOS-style backward slashes. */
- if (*pArchive_name == '/')
- return MZ_FALSE;
-
- /* Making sure the name does not contain drive letters or DOS style backward slashes is the responsibility of the program using miniz*/
-
- return MZ_TRUE;
-}
-
-static mz_uint mz_zip_writer_compute_padding_needed_for_file_alignment(mz_zip_archive *pZip)
-{
- mz_uint32 n;
- if (!pZip->m_file_offset_alignment)
- return 0;
- n = (mz_uint32)(pZip->m_archive_size & (pZip->m_file_offset_alignment - 1));
- return (mz_uint)((pZip->m_file_offset_alignment - n) & (pZip->m_file_offset_alignment - 1));
-}
-
-static mz_bool mz_zip_writer_write_zeros(mz_zip_archive *pZip, mz_uint64 cur_file_ofs, mz_uint32 n)
-{
- char buf[4096];
- memset(buf, 0, MZ_MIN(sizeof(buf), n));
- while (n)
- {
- mz_uint32 s = MZ_MIN(sizeof(buf), n);
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_file_ofs, buf, s) != s)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_file_ofs += s;
- n -= s;
- }
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
- mz_uint64 uncomp_size, mz_uint32 uncomp_crc32)
-{
- return mz_zip_writer_add_mem_ex_v2(pZip, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, uncomp_size, uncomp_crc32, NULL, NULL, 0, NULL, 0);
-}
-
-mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size,
- mz_uint level_and_flags, mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified,
- const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
-{
- mz_uint16 method = 0, dos_time = 0, dos_date = 0;
- mz_uint level, ext_attributes = 0, num_alignment_padding_bytes;
- mz_uint64 local_dir_header_ofs = pZip->m_archive_size, cur_archive_file_ofs = pZip->m_archive_size, comp_size = 0;
- size_t archive_name_size;
- mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
- tdefl_compressor *pComp = NULL;
- mz_bool store_data_uncompressed;
- mz_zip_internal_state *pState;
- mz_uint8 *pExtra_data = NULL;
- mz_uint32 extra_size = 0;
- mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
- mz_uint16 bit_flags = 0;
-
- if ((int)level_and_flags < 0)
- level_and_flags = MZ_DEFAULT_LEVEL;
-
- if (uncomp_size || (buf_size && !(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)))
- bit_flags |= MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
-
- if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
- bit_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
-
- level = level_and_flags & 0xF;
- store_data_uncompressed = ((!level) || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA));
-
- if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || ((buf_size) && (!pBuf)) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- if (pState->m_zip64)
- {
- if (pZip->m_total_files == MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
- else
- {
- if (pZip->m_total_files == MZ_UINT16_MAX)
- {
- pState->m_zip64 = MZ_TRUE;
- /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */
- }
- if ((buf_size > 0xFFFFFFFF) || (uncomp_size > 0xFFFFFFFF))
- {
- pState->m_zip64 = MZ_TRUE;
- /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
- }
- }
-
- if ((!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)) && (uncomp_size))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_writer_validate_archive_name(pArchive_name))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
-
-#ifndef MINIZ_NO_TIME
- if (last_modified != NULL)
- {
- mz_zip_time_t_to_dos_time(*last_modified, &dos_time, &dos_date);
- }
- else
- {
- MZ_TIME_T cur_time;
- time(&cur_time);
- mz_zip_time_t_to_dos_time(cur_time, &dos_time, &dos_date);
- }
-#endif /* #ifndef MINIZ_NO_TIME */
-
- if (!(level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
- {
- uncomp_crc32 = (mz_uint32)mz_crc32(MZ_CRC32_INIT, (const mz_uint8 *)pBuf, buf_size);
- uncomp_size = buf_size;
- if (uncomp_size <= 3)
- {
- level = 0;
- store_data_uncompressed = MZ_TRUE;
- }
- }
-
- archive_name_size = strlen(pArchive_name);
- if (archive_name_size > MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
-
- num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
-
- /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */
- if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
-
- if (!pState->m_zip64)
- {
- /* Bail early if the archive would obviously become too large */
- if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size
- + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + user_extra_data_len +
- pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + user_extra_data_central_len
- + MZ_ZIP_DATA_DESCRIPTER_SIZE32) > 0xFFFFFFFF)
- {
- pState->m_zip64 = MZ_TRUE;
- /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
- }
- }
-
- if ((archive_name_size) && (pArchive_name[archive_name_size - 1] == '/'))
- {
- /* Set DOS Subdirectory attribute bit. */
- ext_attributes |= MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG;
-
- /* Subdirectories cannot contain data. */
- if ((buf_size) || (uncomp_size))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- }
-
- /* Try to do any allocations before writing to the archive, so if an allocation fails the file remains unmodified. (A good idea if we're doing an in-place modification.) */
- if ((!mz_zip_array_ensure_room(pZip, &pState->m_central_dir, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + comment_size + (pState->m_zip64 ? MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE : 0))) || (!mz_zip_array_ensure_room(pZip, &pState->m_central_dir_offsets, 1)))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- if ((!store_data_uncompressed) && (buf_size))
- {
- if (NULL == (pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor))))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- return MZ_FALSE;
- }
-
- local_dir_header_ofs += num_alignment_padding_bytes;
- if (pZip->m_file_offset_alignment)
- {
- MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0);
- }
- cur_archive_file_ofs += num_alignment_padding_bytes;
-
- MZ_CLEAR_OBJ(local_dir_header);
-
- if (!store_data_uncompressed || (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA))
- {
- method = MZ_DEFLATED;
- }
-
- if (pState->m_zip64)
- {
- if (uncomp_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
- {
- pExtra_data = extra_data;
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
- (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- }
-
- if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, bit_flags, dos_time, dos_date))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += sizeof(local_dir_header);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
- cur_archive_file_ofs += archive_name_size;
-
- if (pExtra_data != NULL)
- {
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += extra_size;
- }
- }
- else
- {
- if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
- if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, bit_flags, dos_time, dos_date))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, local_dir_header_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += sizeof(local_dir_header);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
- cur_archive_file_ofs += archive_name_size;
- }
-
- if (user_extra_data_len > 0)
- {
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += user_extra_data_len;
- }
-
- if (store_data_uncompressed)
- {
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pBuf, buf_size) != buf_size)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_archive_file_ofs += buf_size;
- comp_size = buf_size;
- }
- else if (buf_size)
- {
- mz_zip_writer_add_state state;
-
- state.m_pZip = pZip;
- state.m_cur_archive_file_ofs = cur_archive_file_ofs;
- state.m_comp_size = 0;
-
- if ((tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY) ||
- (tdefl_compress_buffer(pComp, pBuf, buf_size, TDEFL_FINISH) != TDEFL_STATUS_DONE))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- return mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED);
- }
-
- comp_size = state.m_comp_size;
- cur_archive_file_ofs = state.m_cur_archive_file_ofs;
- }
-
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- pComp = NULL;
-
- if (uncomp_size)
- {
- mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
- mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;
-
- MZ_ASSERT(bit_flags & MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR);
-
- MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID);
- MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32);
- if (pExtra_data == NULL)
- {
- if (comp_size > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- MZ_WRITE_LE32(local_dir_footer + 8, comp_size);
- MZ_WRITE_LE32(local_dir_footer + 12, uncomp_size);
- }
- else
- {
- MZ_WRITE_LE64(local_dir_footer + 8, comp_size);
- MZ_WRITE_LE64(local_dir_footer + 16, uncomp_size);
- local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64;
- }
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
- return MZ_FALSE;
-
- cur_archive_file_ofs += local_dir_footer_size;
- }
-
- if (pExtra_data != NULL)
- {
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
- (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- }
-
- if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment,
- comment_size, uncomp_size, comp_size, uncomp_crc32, method, bit_flags, dos_time, dos_date, local_dir_header_ofs, ext_attributes,
- user_extra_data_central, user_extra_data_central_len))
- return MZ_FALSE;
-
- pZip->m_total_files++;
- pZip->m_archive_size = cur_archive_file_ofs;
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void* callback_opaque, mz_uint64 max_size, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
- const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
-{
- mz_uint16 gen_flags = (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE) ? 0 : MZ_ZIP_LDH_BIT_FLAG_HAS_LOCATOR;
- mz_uint uncomp_crc32 = MZ_CRC32_INIT, level, num_alignment_padding_bytes;
- mz_uint16 method = 0, dos_time = 0, dos_date = 0, ext_attributes = 0;
- mz_uint64 local_dir_header_ofs, cur_archive_file_ofs = pZip->m_archive_size, uncomp_size = 0, comp_size = 0;
- size_t archive_name_size;
- mz_uint8 local_dir_header[MZ_ZIP_LOCAL_DIR_HEADER_SIZE];
- mz_uint8 *pExtra_data = NULL;
- mz_uint32 extra_size = 0;
- mz_uint8 extra_data[MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE];
- mz_zip_internal_state *pState;
- mz_uint64 file_ofs = 0, cur_archive_header_file_ofs;
-
- if (!(level_and_flags & MZ_ZIP_FLAG_ASCII_FILENAME))
- gen_flags |= MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8;
-
- if ((int)level_and_flags < 0)
- level_and_flags = MZ_DEFAULT_LEVEL;
- level = level_and_flags & 0xF;
-
- /* Sanity checks */
- if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pArchive_name) || ((comment_size) && (!pComment)) || (level > MZ_UBER_COMPRESSION))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- if ((!pState->m_zip64) && (max_size > MZ_UINT32_MAX))
- {
- /* Source file is too large for non-zip64 */
- /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
- pState->m_zip64 = MZ_TRUE;
- }
-
- /* We could support this, but why? */
- if (level_and_flags & MZ_ZIP_FLAG_COMPRESSED_DATA)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_writer_validate_archive_name(pArchive_name))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
-
- if (pState->m_zip64)
- {
- if (pZip->m_total_files == MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
- else
- {
- if (pZip->m_total_files == MZ_UINT16_MAX)
- {
- pState->m_zip64 = MZ_TRUE;
- /*return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); */
- }
- }
-
- archive_name_size = strlen(pArchive_name);
- if (archive_name_size > MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_FILENAME);
-
- num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
-
- /* miniz doesn't support central dirs >= MZ_UINT32_MAX bytes yet */
- if (((mz_uint64)pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP64_MAX_CENTRAL_EXTRA_FIELD_SIZE + comment_size) >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
-
- if (!pState->m_zip64)
- {
- /* Bail early if the archive would obviously become too large */
- if ((pZip->m_archive_size + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + archive_name_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE
- + archive_name_size + comment_size + user_extra_data_len + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 1024
- + MZ_ZIP_DATA_DESCRIPTER_SIZE32 + user_extra_data_central_len) > 0xFFFFFFFF)
- {
- pState->m_zip64 = MZ_TRUE;
- /*return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE); */
- }
- }
-
-#ifndef MINIZ_NO_TIME
- if (pFile_time)
- {
- mz_zip_time_t_to_dos_time(*pFile_time, &dos_time, &dos_date);
- }
-#endif
-
- if (max_size <= 3)
- level = 0;
-
- if (!mz_zip_writer_write_zeros(pZip, cur_archive_file_ofs, num_alignment_padding_bytes))
- {
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_archive_file_ofs += num_alignment_padding_bytes;
- local_dir_header_ofs = cur_archive_file_ofs;
-
- if (pZip->m_file_offset_alignment)
- {
- MZ_ASSERT((cur_archive_file_ofs & (pZip->m_file_offset_alignment - 1)) == 0);
- }
-
- if (max_size && level)
- {
- method = MZ_DEFLATED;
- }
-
- MZ_CLEAR_OBJ(local_dir_header);
- if (pState->m_zip64)
- {
- if (max_size >= MZ_UINT32_MAX || local_dir_header_ofs >= MZ_UINT32_MAX)
- {
- pExtra_data = extra_data;
- if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
- (max_size >= MZ_UINT32_MAX) ? &comp_size : NULL,
- (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- else
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, NULL,
- NULL,
- (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- }
-
- if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len), 0, 0, 0, method, gen_flags, dos_time, dos_date))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += sizeof(local_dir_header);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
- {
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_archive_file_ofs += archive_name_size;
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, extra_data, extra_size) != extra_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += extra_size;
- }
- else
- {
- if ((comp_size > MZ_UINT32_MAX) || (cur_archive_file_ofs > MZ_UINT32_MAX))
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
- if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header, (mz_uint16)archive_name_size, (mz_uint16)user_extra_data_len, 0, 0, 0, method, gen_flags, dos_time, dos_date))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += sizeof(local_dir_header);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
- {
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_archive_file_ofs += archive_name_size;
- }
-
- if (user_extra_data_len > 0)
- {
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, user_extra_data, user_extra_data_len) != user_extra_data_len)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_file_ofs += user_extra_data_len;
- }
-
- if (max_size)
- {
- void *pRead_buf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, MZ_ZIP_MAX_IO_BUF_SIZE);
- if (!pRead_buf)
- {
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (!level)
- {
- while (1)
- {
- size_t n = read_callback(callback_opaque, file_ofs, pRead_buf, MZ_ZIP_MAX_IO_BUF_SIZE);
- if (n == 0)
- break;
-
- if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, pRead_buf, n) != n)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
- file_ofs += n;
- uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n);
- cur_archive_file_ofs += n;
- }
- uncomp_size = file_ofs;
- comp_size = uncomp_size;
- }
- else
- {
- mz_bool result = MZ_FALSE;
- mz_zip_writer_add_state state;
- tdefl_compressor *pComp = (tdefl_compressor *)pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, sizeof(tdefl_compressor));
- if (!pComp)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- state.m_pZip = pZip;
- state.m_cur_archive_file_ofs = cur_archive_file_ofs;
- state.m_comp_size = 0;
-
- if (tdefl_init(pComp, mz_zip_writer_add_put_buf_callback, &state, tdefl_create_comp_flags_from_zip_params(level, -15, MZ_DEFAULT_STRATEGY)) != TDEFL_STATUS_OKAY)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
- }
-
- for (;;)
- {
- tdefl_status status;
- tdefl_flush flush = TDEFL_NO_FLUSH;
-
- size_t n = read_callback(callback_opaque, file_ofs, pRead_buf, MZ_ZIP_MAX_IO_BUF_SIZE);
- if ((n > MZ_ZIP_MAX_IO_BUF_SIZE) || (file_ofs + n > max_size))
- {
- mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- break;
- }
-
- file_ofs += n;
- uncomp_crc32 = (mz_uint32)mz_crc32(uncomp_crc32, (const mz_uint8 *)pRead_buf, n);
-
- if (pZip->m_pNeeds_keepalive != NULL && pZip->m_pNeeds_keepalive(pZip->m_pIO_opaque))
- flush = TDEFL_FULL_FLUSH;
-
- if (n == 0)
- flush = TDEFL_FINISH;
-
- status = tdefl_compress_buffer(pComp, pRead_buf, n, flush);
- if (status == TDEFL_STATUS_DONE)
- {
- result = MZ_TRUE;
- break;
- }
- else if (status != TDEFL_STATUS_OKAY)
- {
- mz_zip_set_error(pZip, MZ_ZIP_COMPRESSION_FAILED);
- break;
- }
- }
-
- pZip->m_pFree(pZip->m_pAlloc_opaque, pComp);
-
- if (!result)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- return MZ_FALSE;
- }
-
- uncomp_size = file_ofs;
- comp_size = state.m_comp_size;
- cur_archive_file_ofs = state.m_cur_archive_file_ofs;
- }
-
- pZip->m_pFree(pZip->m_pAlloc_opaque, pRead_buf);
- }
-
- if (!(level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE))
- {
- mz_uint8 local_dir_footer[MZ_ZIP_DATA_DESCRIPTER_SIZE64];
- mz_uint32 local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE32;
-
- MZ_WRITE_LE32(local_dir_footer + 0, MZ_ZIP_DATA_DESCRIPTOR_ID);
- MZ_WRITE_LE32(local_dir_footer + 4, uncomp_crc32);
- if (pExtra_data == NULL)
- {
- if (comp_size > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- MZ_WRITE_LE32(local_dir_footer + 8, comp_size);
- MZ_WRITE_LE32(local_dir_footer + 12, uncomp_size);
- }
- else
- {
- MZ_WRITE_LE64(local_dir_footer + 8, comp_size);
- MZ_WRITE_LE64(local_dir_footer + 16, uncomp_size);
- local_dir_footer_size = MZ_ZIP_DATA_DESCRIPTER_SIZE64;
- }
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_file_ofs, local_dir_footer, local_dir_footer_size) != local_dir_footer_size)
- return MZ_FALSE;
-
- cur_archive_file_ofs += local_dir_footer_size;
- }
-
- if (level_and_flags & MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE)
- {
- if (pExtra_data != NULL)
- {
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (max_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
- (max_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- }
-
- if (!mz_zip_writer_create_local_dir_header(pZip, local_dir_header,
- (mz_uint16)archive_name_size, (mz_uint16)(extra_size + user_extra_data_len),
- (max_size >= MZ_UINT32_MAX) ? MZ_UINT32_MAX : uncomp_size,
- (max_size >= MZ_UINT32_MAX) ? MZ_UINT32_MAX : comp_size,
- uncomp_crc32, method, gen_flags, dos_time, dos_date))
- return mz_zip_set_error(pZip, MZ_ZIP_INTERNAL_ERROR);
-
- cur_archive_header_file_ofs = local_dir_header_ofs;
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, local_dir_header, sizeof(local_dir_header)) != sizeof(local_dir_header))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- if (pExtra_data != NULL)
- {
- cur_archive_header_file_ofs += sizeof(local_dir_header);
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, pArchive_name, archive_name_size) != archive_name_size)
- {
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_archive_header_file_ofs += archive_name_size;
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_archive_header_file_ofs, extra_data, extra_size) != extra_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_archive_header_file_ofs += extra_size;
- }
- }
-
- if (pExtra_data != NULL)
- {
- extra_size = mz_zip_writer_create_zip64_extra_data(extra_data, (uncomp_size >= MZ_UINT32_MAX) ? &uncomp_size : NULL,
- (uncomp_size >= MZ_UINT32_MAX) ? &comp_size : NULL, (local_dir_header_ofs >= MZ_UINT32_MAX) ? &local_dir_header_ofs : NULL);
- }
-
- if (!mz_zip_writer_add_to_central_dir(pZip, pArchive_name, (mz_uint16)archive_name_size, pExtra_data, (mz_uint16)extra_size, pComment, comment_size,
- uncomp_size, comp_size, uncomp_crc32, method, gen_flags, dos_time, dos_date, local_dir_header_ofs, ext_attributes,
- user_extra_data_central, user_extra_data_central_len))
- return MZ_FALSE;
-
- pZip->m_total_files++;
- pZip->m_archive_size = cur_archive_file_ofs;
-
- return MZ_TRUE;
-}
-
-#ifndef MINIZ_NO_STDIO
-
-static size_t mz_file_read_func_stdio(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n)
-{
- MZ_FILE *pSrc_file = (MZ_FILE *)pOpaque;
- mz_int64 cur_ofs = MZ_FTELL64(pSrc_file);
-
- if (((mz_int64)file_ofs < 0) || (((cur_ofs != (mz_int64)file_ofs)) && (MZ_FSEEK64(pSrc_file, (mz_int64)file_ofs, SEEK_SET))))
- return 0;
-
- return MZ_FREAD(pBuf, 1, n, pSrc_file);
-}
-
-mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 max_size, const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
- const char *user_extra_data, mz_uint user_extra_data_len, const char *user_extra_data_central, mz_uint user_extra_data_central_len)
-{
- return mz_zip_writer_add_read_buf_callback(pZip, pArchive_name, mz_file_read_func_stdio, pSrc_file, max_size, pFile_time, pComment, comment_size, level_and_flags,
- user_extra_data, user_extra_data_len, user_extra_data_central, user_extra_data_central_len);
-}
-
-mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)
-{
- MZ_FILE *pSrc_file = NULL;
- mz_uint64 uncomp_size = 0;
- MZ_TIME_T file_modified_time;
- MZ_TIME_T *pFile_time = NULL;
- mz_bool status;
-
- memset(&file_modified_time, 0, sizeof(file_modified_time));
-
-#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_STDIO)
- pFile_time = &file_modified_time;
- if (!mz_zip_get_file_modified_time(pSrc_filename, &file_modified_time))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_STAT_FAILED);
-#endif
-
- pSrc_file = MZ_FOPEN(pSrc_filename, "rb");
- if (!pSrc_file)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_OPEN_FAILED);
-
- MZ_FSEEK64(pSrc_file, 0, SEEK_END);
- uncomp_size = MZ_FTELL64(pSrc_file);
- MZ_FSEEK64(pSrc_file, 0, SEEK_SET);
-
- status = mz_zip_writer_add_cfile(pZip, pArchive_name, pSrc_file, uncomp_size, pFile_time, pComment, comment_size, level_and_flags, NULL, 0, NULL, 0);
-
- MZ_FCLOSE(pSrc_file);
-
- return status;
-}
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-static mz_bool mz_zip_writer_update_zip64_extension_block(mz_zip_array *pNew_ext, mz_zip_archive *pZip, const mz_uint8 *pExt, uint32_t ext_len, mz_uint64 *pComp_size, mz_uint64 *pUncomp_size, mz_uint64 *pLocal_header_ofs, mz_uint32 *pDisk_start)
-{
- /* + 64 should be enough for any new zip64 data */
- if (!mz_zip_array_reserve(pZip, pNew_ext, ext_len + 64, MZ_FALSE))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- mz_zip_array_resize(pZip, pNew_ext, 0, MZ_FALSE);
-
- if ((pUncomp_size) || (pComp_size) || (pLocal_header_ofs) || (pDisk_start))
- {
- mz_uint8 new_ext_block[64];
- mz_uint8 *pDst = new_ext_block;
- mz_write_le16(pDst, MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID);
- mz_write_le16(pDst + sizeof(mz_uint16), 0);
- pDst += sizeof(mz_uint16) * 2;
-
- if (pUncomp_size)
- {
- mz_write_le64(pDst, *pUncomp_size);
- pDst += sizeof(mz_uint64);
- }
-
- if (pComp_size)
- {
- mz_write_le64(pDst, *pComp_size);
- pDst += sizeof(mz_uint64);
- }
-
- if (pLocal_header_ofs)
- {
- mz_write_le64(pDst, *pLocal_header_ofs);
- pDst += sizeof(mz_uint64);
- }
-
- if (pDisk_start)
- {
- mz_write_le32(pDst, *pDisk_start);
- pDst += sizeof(mz_uint32);
- }
-
- mz_write_le16(new_ext_block + sizeof(mz_uint16), (mz_uint16)((pDst - new_ext_block) - sizeof(mz_uint16) * 2));
-
- if (!mz_zip_array_push_back(pZip, pNew_ext, new_ext_block, pDst - new_ext_block))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if ((pExt) && (ext_len))
- {
- mz_uint32 extra_size_remaining = ext_len;
- const mz_uint8 *pExtra_data = pExt;
-
- do
- {
- mz_uint32 field_id, field_data_size, field_total_size;
-
- if (extra_size_remaining < (sizeof(mz_uint16) * 2))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- field_id = MZ_READ_LE16(pExtra_data);
- field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
- field_total_size = field_data_size + sizeof(mz_uint16) * 2;
-
- if (field_total_size > extra_size_remaining)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- if (field_id != MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
- {
- if (!mz_zip_array_push_back(pZip, pNew_ext, pExtra_data, field_total_size))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- pExtra_data += field_total_size;
- extra_size_remaining -= field_total_size;
- } while (extra_size_remaining);
- }
-
- return MZ_TRUE;
-}
-
-/* TODO: This func is now pretty freakin complex due to zip64, split it up? */
-mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index)
-{
- mz_uint n, bit_flags, num_alignment_padding_bytes, src_central_dir_following_data_size;
- mz_uint64 src_archive_bytes_remaining, local_dir_header_ofs;
- mz_uint64 cur_src_file_ofs, cur_dst_file_ofs;
- mz_uint32 local_header_u32[(MZ_ZIP_LOCAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / sizeof(mz_uint32)];
- mz_uint8 *pLocal_header = (mz_uint8 *)local_header_u32;
- mz_uint8 new_central_header[MZ_ZIP_CENTRAL_DIR_HEADER_SIZE];
- size_t orig_central_dir_size;
- mz_zip_internal_state *pState;
- void *pBuf;
- const mz_uint8 *pSrc_central_header;
- mz_zip_archive_file_stat src_file_stat;
- mz_uint32 src_filename_len, src_comment_len, src_ext_len;
- mz_uint32 local_header_filename_size, local_header_extra_len;
- mz_uint64 local_header_comp_size, local_header_uncomp_size;
- mz_bool found_zip64_ext_data_in_ldir = MZ_FALSE;
-
- /* Sanity checks */
- if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING) || (!pSource_zip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- /* Don't support copying files from zip64 archives to non-zip64, even though in some cases this is possible */
- if ((pSource_zip->m_pState->m_zip64) && (!pZip->m_pState->m_zip64))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- /* Get pointer to the source central dir header and crack it */
- if (NULL == (pSrc_central_header = mz_zip_get_cdh(pSource_zip, src_file_index)))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (MZ_READ_LE32(pSrc_central_header + MZ_ZIP_CDH_SIG_OFS) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- src_filename_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- src_comment_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_COMMENT_LEN_OFS);
- src_ext_len = MZ_READ_LE16(pSrc_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS);
- src_central_dir_following_data_size = src_filename_len + src_ext_len + src_comment_len;
-
- /* TODO: We don't support central dir's >= MZ_UINT32_MAX bytes right now (+32 fudge factor in case we need to add more extra data) */
- if ((pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_central_dir_following_data_size + 32) >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
-
- num_alignment_padding_bytes = mz_zip_writer_compute_padding_needed_for_file_alignment(pZip);
-
- if (!pState->m_zip64)
- {
- if (pZip->m_total_files == MZ_UINT16_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
- else
- {
- /* TODO: Our zip64 support still has some 32-bit limits that may not be worth fixing. */
- if (pZip->m_total_files == MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
-
- if (!mz_zip_file_stat_internal(pSource_zip, src_file_index, pSrc_central_header, &src_file_stat, NULL))
- return MZ_FALSE;
-
- cur_src_file_ofs = src_file_stat.m_local_header_ofs;
- cur_dst_file_ofs = pZip->m_archive_size;
-
- /* Read the source archive's local dir header */
- if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
-
- if (MZ_READ_LE32(pLocal_header) != MZ_ZIP_LOCAL_DIR_HEADER_SIG)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
-
- cur_src_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE;
-
- /* Compute the total size we need to copy (filename+extra data+compressed data) */
- local_header_filename_size = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_FILENAME_LEN_OFS);
- local_header_extra_len = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_EXTRA_LEN_OFS);
- local_header_comp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_COMPRESSED_SIZE_OFS);
- local_header_uncomp_size = MZ_READ_LE32(pLocal_header + MZ_ZIP_LDH_DECOMPRESSED_SIZE_OFS);
- src_archive_bytes_remaining = local_header_filename_size + local_header_extra_len + src_file_stat.m_comp_size;
-
- /* Try to find a zip64 extended information field */
- if ((local_header_extra_len) && ((local_header_comp_size == MZ_UINT32_MAX) || (local_header_uncomp_size == MZ_UINT32_MAX)))
- {
- mz_zip_array file_data_array;
- const mz_uint8 *pExtra_data;
- mz_uint32 extra_size_remaining = local_header_extra_len;
-
- mz_zip_array_init(&file_data_array, 1);
- if (!mz_zip_array_resize(pZip, &file_data_array, local_header_extra_len, MZ_FALSE))
- {
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, src_file_stat.m_local_header_ofs + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + local_header_filename_size, file_data_array.m_p, local_header_extra_len) != local_header_extra_len)
- {
- mz_zip_array_clear(pZip, &file_data_array);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
-
- pExtra_data = (const mz_uint8 *)file_data_array.m_p;
-
- do
- {
- mz_uint32 field_id, field_data_size, field_total_size;
-
- if (extra_size_remaining < (sizeof(mz_uint16) * 2))
- {
- mz_zip_array_clear(pZip, &file_data_array);
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- field_id = MZ_READ_LE16(pExtra_data);
- field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16));
- field_total_size = field_data_size + sizeof(mz_uint16) * 2;
-
- if (field_total_size > extra_size_remaining)
- {
- mz_zip_array_clear(pZip, &file_data_array);
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID)
- {
- const mz_uint8 *pSrc_field_data = pExtra_data + sizeof(mz_uint32);
-
- if (field_data_size < sizeof(mz_uint64) * 2)
- {
- mz_zip_array_clear(pZip, &file_data_array);
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED);
- }
-
- local_header_uncomp_size = MZ_READ_LE64(pSrc_field_data);
- local_header_comp_size = MZ_READ_LE64(pSrc_field_data + sizeof(mz_uint64)); /* may be 0 if there's a descriptor */
-
- found_zip64_ext_data_in_ldir = MZ_TRUE;
- break;
- }
-
- pExtra_data += field_total_size;
- extra_size_remaining -= field_total_size;
- } while (extra_size_remaining);
-
- mz_zip_array_clear(pZip, &file_data_array);
- }
-
- if (!pState->m_zip64)
- {
- /* Try to detect if the new archive will most likely wind up too big and bail early (+(sizeof(mz_uint32) * 4) is for the optional descriptor which could be present, +64 is a fudge factor). */
- /* We also check when the archive is finalized so this doesn't need to be perfect. */
- mz_uint64 approx_new_archive_size = cur_dst_file_ofs + num_alignment_padding_bytes + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + src_archive_bytes_remaining + (sizeof(mz_uint32) * 4) +
- pState->m_central_dir.m_size + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_central_dir_following_data_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE + 64;
-
- if (approx_new_archive_size >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
- }
-
- /* Write dest archive padding */
- if (!mz_zip_writer_write_zeros(pZip, cur_dst_file_ofs, num_alignment_padding_bytes))
- return MZ_FALSE;
-
- cur_dst_file_ofs += num_alignment_padding_bytes;
-
- local_dir_header_ofs = cur_dst_file_ofs;
- if (pZip->m_file_offset_alignment)
- {
- MZ_ASSERT((local_dir_header_ofs & (pZip->m_file_offset_alignment - 1)) == 0);
- }
-
- /* The original zip's local header+ext block doesn't change, even with zip64, so we can just copy it over to the dest zip */
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pLocal_header, MZ_ZIP_LOCAL_DIR_HEADER_SIZE) != MZ_ZIP_LOCAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- cur_dst_file_ofs += MZ_ZIP_LOCAL_DIR_HEADER_SIZE;
-
- /* Copy over the source archive bytes to the dest archive, also ensure we have enough buf space to handle optional data descriptor */
- if (NULL == (pBuf = pZip->m_pAlloc(pZip->m_pAlloc_opaque, 1, (size_t)MZ_MAX(32U, MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining)))))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- while (src_archive_bytes_remaining)
- {
- n = (mz_uint)MZ_MIN((mz_uint64)MZ_ZIP_MAX_IO_BUF_SIZE, src_archive_bytes_remaining);
- if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, n) != n)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
- cur_src_file_ofs += n;
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
- cur_dst_file_ofs += n;
-
- src_archive_bytes_remaining -= n;
- }
-
- /* Now deal with the optional data descriptor */
- bit_flags = MZ_READ_LE16(pLocal_header + MZ_ZIP_LDH_BIT_FLAG_OFS);
- if (bit_flags & 8)
- {
- /* Copy data descriptor */
- if ((pSource_zip->m_pState->m_zip64) || (found_zip64_ext_data_in_ldir))
- {
- /* src is zip64, dest must be zip64 */
-
- /* name uint32_t's */
- /* id 1 (optional in zip64?) */
- /* crc 1 */
- /* comp_size 2 */
- /* uncomp_size 2 */
- if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, (sizeof(mz_uint32) * 6)) != (sizeof(mz_uint32) * 6))
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
-
- n = sizeof(mz_uint32) * ((MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID) ? 6 : 5);
- }
- else
- {
- /* src is NOT zip64 */
- mz_bool has_id;
-
- if (pSource_zip->m_pRead(pSource_zip->m_pIO_opaque, cur_src_file_ofs, pBuf, sizeof(mz_uint32) * 4) != sizeof(mz_uint32) * 4)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED);
- }
-
- has_id = (MZ_READ_LE32(pBuf) == MZ_ZIP_DATA_DESCRIPTOR_ID);
-
- if (pZip->m_pState->m_zip64)
- {
- /* dest is zip64, so upgrade the data descriptor */
- const mz_uint32 *pSrc_descriptor = (const mz_uint32 *)((const mz_uint8 *)pBuf + (has_id ? sizeof(mz_uint32) : 0));
- const mz_uint32 src_crc32 = pSrc_descriptor[0];
- const mz_uint64 src_comp_size = pSrc_descriptor[1];
- const mz_uint64 src_uncomp_size = pSrc_descriptor[2];
-
- mz_write_le32((mz_uint8 *)pBuf, MZ_ZIP_DATA_DESCRIPTOR_ID);
- mz_write_le32((mz_uint8 *)pBuf + sizeof(mz_uint32) * 1, src_crc32);
- mz_write_le64((mz_uint8 *)pBuf + sizeof(mz_uint32) * 2, src_comp_size);
- mz_write_le64((mz_uint8 *)pBuf + sizeof(mz_uint32) * 4, src_uncomp_size);
-
- n = sizeof(mz_uint32) * 6;
- }
- else
- {
- /* dest is NOT zip64, just copy it as-is */
- n = sizeof(mz_uint32) * (has_id ? 4 : 3);
- }
- }
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, cur_dst_file_ofs, pBuf, n) != n)
- {
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
- }
-
- cur_src_file_ofs += n;
- cur_dst_file_ofs += n;
- }
- pZip->m_pFree(pZip->m_pAlloc_opaque, pBuf);
-
- /* Finally, add the new central dir header */
- orig_central_dir_size = pState->m_central_dir.m_size;
-
- memcpy(new_central_header, pSrc_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE);
-
- if (pState->m_zip64)
- {
- /* This is the painful part: We need to write a new central dir header + ext block with updated zip64 fields, and ensure the old fields (if any) are not included. */
- const mz_uint8 *pSrc_ext = pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_filename_len;
- mz_zip_array new_ext_block;
-
- mz_zip_array_init(&new_ext_block, sizeof(mz_uint8));
-
- MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS, MZ_UINT32_MAX);
- MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS, MZ_UINT32_MAX);
- MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, MZ_UINT32_MAX);
-
- if (!mz_zip_writer_update_zip64_extension_block(&new_ext_block, pZip, pSrc_ext, src_ext_len, &src_file_stat.m_comp_size, &src_file_stat.m_uncomp_size, &local_dir_header_ofs, NULL))
- {
- mz_zip_array_clear(pZip, &new_ext_block);
- return MZ_FALSE;
- }
-
- MZ_WRITE_LE16(new_central_header + MZ_ZIP_CDH_EXTRA_LEN_OFS, new_ext_block.m_size);
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
- {
- mz_zip_array_clear(pZip, &new_ext_block);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_filename_len))
- {
- mz_zip_array_clear(pZip, &new_ext_block);
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_ext_block.m_p, new_ext_block.m_size))
- {
- mz_zip_array_clear(pZip, &new_ext_block);
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + src_filename_len + src_ext_len, src_comment_len))
- {
- mz_zip_array_clear(pZip, &new_ext_block);
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- mz_zip_array_clear(pZip, &new_ext_block);
- }
- else
- {
- /* sanity checks */
- if (cur_dst_file_ofs > MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- if (local_dir_header_ofs >= MZ_UINT32_MAX)
- return mz_zip_set_error(pZip, MZ_ZIP_ARCHIVE_TOO_LARGE);
-
- MZ_WRITE_LE32(new_central_header + MZ_ZIP_CDH_LOCAL_HEADER_OFS, local_dir_header_ofs);
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, new_central_header, MZ_ZIP_CENTRAL_DIR_HEADER_SIZE))
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
-
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir, pSrc_central_header + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, src_central_dir_following_data_size))
- {
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
- }
-
- /* This shouldn't trigger unless we screwed up during the initial sanity checks */
- if (pState->m_central_dir.m_size >= MZ_UINT32_MAX)
- {
- /* TODO: Support central dirs >= 32-bits in size */
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE);
- }
-
- n = (mz_uint32)orig_central_dir_size;
- if (!mz_zip_array_push_back(pZip, &pState->m_central_dir_offsets, &n, 1))
- {
- mz_zip_array_resize(pZip, &pState->m_central_dir, orig_central_dir_size, MZ_FALSE);
- return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED);
- }
-
- pZip->m_total_files++;
- pZip->m_archive_size = cur_dst_file_ofs;
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip)
-{
- mz_zip_internal_state *pState;
- mz_uint64 central_dir_ofs, central_dir_size;
- mz_uint8 hdr[256];
-
- if ((!pZip) || (!pZip->m_pState) || (pZip->m_zip_mode != MZ_ZIP_MODE_WRITING))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- pState = pZip->m_pState;
-
- if (pState->m_zip64)
- {
- if ((pZip->m_total_files > MZ_UINT32_MAX) || (pState->m_central_dir.m_size >= MZ_UINT32_MAX))
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
- else
- {
- if ((pZip->m_total_files > MZ_UINT16_MAX) || ((pZip->m_archive_size + pState->m_central_dir.m_size + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) > MZ_UINT32_MAX))
- return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES);
- }
-
- central_dir_ofs = 0;
- central_dir_size = 0;
- if (pZip->m_total_files)
- {
- /* Write central directory */
- central_dir_ofs = pZip->m_archive_size;
- central_dir_size = pState->m_central_dir.m_size;
- pZip->m_central_directory_file_ofs = central_dir_ofs;
- if (pZip->m_pWrite(pZip->m_pIO_opaque, central_dir_ofs, pState->m_central_dir.m_p, (size_t)central_dir_size) != central_dir_size)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- pZip->m_archive_size += central_dir_size;
- }
-
- if (pState->m_zip64)
- {
- /* Write zip64 end of central directory header */
- mz_uint64 rel_ofs_to_zip64_ecdr = pZip->m_archive_size;
-
- MZ_CLEAR_OBJ(hdr);
- MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDH_SIG_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - sizeof(mz_uint32) - sizeof(mz_uint64));
- MZ_WRITE_LE16(hdr + MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS, 0x031E); /* TODO: always Unix */
- MZ_WRITE_LE16(hdr + MZ_ZIP64_ECDH_VERSION_NEEDED_OFS, 0x002D);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, pZip->m_total_files);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS, pZip->m_total_files);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_SIZE_OFS, central_dir_size);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDH_CDIR_OFS_OFS, central_dir_ofs);
- if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- pZip->m_archive_size += MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE;
-
- /* Write zip64 end of central directory locator */
- MZ_CLEAR_OBJ(hdr);
- MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDL_SIG_OFS, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG);
- MZ_WRITE_LE64(hdr + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS, rel_ofs_to_zip64_ecdr);
- MZ_WRITE_LE32(hdr + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS, 1);
- if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) != MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
- pZip->m_archive_size += MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE;
- }
-
- /* Write end of central directory record */
- MZ_CLEAR_OBJ(hdr);
- MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_SIG_OFS, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG);
- MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
- MZ_WRITE_LE16(hdr + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS, MZ_MIN(MZ_UINT16_MAX, pZip->m_total_files));
- MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_SIZE_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_size));
- MZ_WRITE_LE32(hdr + MZ_ZIP_ECDH_CDIR_OFS_OFS, MZ_MIN(MZ_UINT32_MAX, central_dir_ofs));
-
- if (pZip->m_pWrite(pZip->m_pIO_opaque, pZip->m_archive_size, hdr, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE)
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_WRITE_FAILED);
-
-#ifndef MINIZ_NO_STDIO
- if ((pState->m_pFile) && (MZ_FFLUSH(pState->m_pFile) == EOF))
- return mz_zip_set_error(pZip, MZ_ZIP_FILE_CLOSE_FAILED);
-#endif /* #ifndef MINIZ_NO_STDIO */
-
- pZip->m_archive_size += MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE;
-
- pZip->m_zip_mode = MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED;
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize)
-{
- if ((!ppBuf) || (!pSize))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- *ppBuf = NULL;
- *pSize = 0;
-
- if ((!pZip) || (!pZip->m_pState))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (pZip->m_pWrite != mz_zip_heap_write_func)
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- if (!mz_zip_writer_finalize_archive(pZip))
- return MZ_FALSE;
-
- *ppBuf = pZip->m_pState->m_pMem;
- *pSize = pZip->m_pState->m_mem_size;
- pZip->m_pState->m_pMem = NULL;
- pZip->m_pState->m_mem_size = pZip->m_pState->m_mem_capacity = 0;
-
- return MZ_TRUE;
-}
-
-mz_bool mz_zip_writer_end(mz_zip_archive *pZip)
-{
- return mz_zip_writer_end_internal(pZip, MZ_TRUE);
-}
-
-#ifndef MINIZ_NO_STDIO
-mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags)
-{
- return mz_zip_add_mem_to_archive_file_in_place_v2(pZip_filename, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, NULL);
-}
-
-mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr)
-{
- mz_bool status, created_new_archive = MZ_FALSE;
- mz_zip_archive zip_archive;
- struct MZ_FILE_STAT_STRUCT file_stat;
- mz_zip_error actual_err = MZ_ZIP_NO_ERROR;
-
- mz_zip_zero_struct(&zip_archive);
- if ((int)level_and_flags < 0)
- level_and_flags = MZ_DEFAULT_LEVEL;
-
- if ((!pZip_filename) || (!pArchive_name) || ((buf_size) && (!pBuf)) || ((comment_size) && (!pComment)) || ((level_and_flags & 0xF) > MZ_UBER_COMPRESSION))
- {
- if (pErr)
- *pErr = MZ_ZIP_INVALID_PARAMETER;
- return MZ_FALSE;
- }
-
- if (!mz_zip_writer_validate_archive_name(pArchive_name))
- {
- if (pErr)
- *pErr = MZ_ZIP_INVALID_FILENAME;
- return MZ_FALSE;
- }
-
- /* Important: The regular non-64 bit version of stat() can fail here if the file is very large, which could cause the archive to be overwritten. */
- /* So be sure to compile with _LARGEFILE64_SOURCE 1 */
- if (MZ_FILE_STAT(pZip_filename, &file_stat) != 0)
- {
- /* Create a new archive. */
- if (!mz_zip_writer_init_file_v2(&zip_archive, pZip_filename, 0, level_and_flags))
- {
- if (pErr)
- *pErr = zip_archive.m_last_error;
- return MZ_FALSE;
- }
-
- created_new_archive = MZ_TRUE;
- }
- else
- {
- /* Append to an existing archive. */
- if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, level_and_flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0))
- {
- if (pErr)
- *pErr = zip_archive.m_last_error;
- return MZ_FALSE;
- }
-
- if (!mz_zip_writer_init_from_reader_v2(&zip_archive, pZip_filename, level_and_flags))
- {
- if (pErr)
- *pErr = zip_archive.m_last_error;
-
- mz_zip_reader_end_internal(&zip_archive, MZ_FALSE);
-
- return MZ_FALSE;
- }
- }
-
- status = mz_zip_writer_add_mem_ex(&zip_archive, pArchive_name, pBuf, buf_size, pComment, comment_size, level_and_flags, 0, 0);
- actual_err = zip_archive.m_last_error;
-
- /* Always finalize, even if adding failed for some reason, so we have a valid central directory. (This may not always succeed, but we can try.) */
- if (!mz_zip_writer_finalize_archive(&zip_archive))
- {
- if (!actual_err)
- actual_err = zip_archive.m_last_error;
-
- status = MZ_FALSE;
- }
-
- if (!mz_zip_writer_end_internal(&zip_archive, status))
- {
- if (!actual_err)
- actual_err = zip_archive.m_last_error;
-
- status = MZ_FALSE;
- }
-
- if ((!status) && (created_new_archive))
- {
- /* It's a new archive and something went wrong, so just delete it. */
- int ignoredStatus = MZ_DELETE_FILE(pZip_filename);
- (void)ignoredStatus;
- }
-
- if (pErr)
- *pErr = actual_err;
-
- return status;
-}
-
-void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr)
-{
- mz_uint32 file_index;
- mz_zip_archive zip_archive;
- void *p = NULL;
-
- if (pSize)
- *pSize = 0;
-
- if ((!pZip_filename) || (!pArchive_name))
- {
- if (pErr)
- *pErr = MZ_ZIP_INVALID_PARAMETER;
-
- return NULL;
- }
-
- mz_zip_zero_struct(&zip_archive);
- if (!mz_zip_reader_init_file_v2(&zip_archive, pZip_filename, flags | MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY, 0, 0))
- {
- if (pErr)
- *pErr = zip_archive.m_last_error;
-
- return NULL;
- }
-
- if (mz_zip_reader_locate_file_v2(&zip_archive, pArchive_name, pComment, flags, &file_index))
- {
- p = mz_zip_reader_extract_to_heap(&zip_archive, file_index, pSize, flags);
- }
-
- mz_zip_reader_end_internal(&zip_archive, p != NULL);
-
- if (pErr)
- *pErr = zip_archive.m_last_error;
-
- return p;
-}
-
-void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags)
-{
- return mz_zip_extract_archive_file_to_heap_v2(pZip_filename, pArchive_name, NULL, pSize, flags, NULL);
-}
-
-#endif /* #ifndef MINIZ_NO_STDIO */
-
-#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */
-
-/* ------------------- Misc utils */
-
-mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip)
-{
- return pZip ? pZip->m_zip_mode : MZ_ZIP_MODE_INVALID;
-}
-
-mz_zip_type mz_zip_get_type(mz_zip_archive *pZip)
-{
- return pZip ? pZip->m_zip_type : MZ_ZIP_TYPE_INVALID;
-}
-
-mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num)
-{
- mz_zip_error prev_err;
-
- if (!pZip)
- return MZ_ZIP_INVALID_PARAMETER;
-
- prev_err = pZip->m_last_error;
-
- pZip->m_last_error = err_num;
- return prev_err;
-}
-
-mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip)
-{
- if (!pZip)
- return MZ_ZIP_INVALID_PARAMETER;
-
- return pZip->m_last_error;
-}
-
-mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip)
-{
- return mz_zip_set_last_error(pZip, MZ_ZIP_NO_ERROR);
-}
-
-mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip)
-{
- mz_zip_error prev_err;
-
- if (!pZip)
- return MZ_ZIP_INVALID_PARAMETER;
-
- prev_err = pZip->m_last_error;
-
- pZip->m_last_error = MZ_ZIP_NO_ERROR;
- return prev_err;
-}
-
-const char *mz_zip_get_error_string(mz_zip_error mz_err)
-{
- switch (mz_err)
- {
- case MZ_ZIP_NO_ERROR:
- return "no error";
- case MZ_ZIP_UNDEFINED_ERROR:
- return "undefined error";
- case MZ_ZIP_TOO_MANY_FILES:
- return "too many files";
- case MZ_ZIP_FILE_TOO_LARGE:
- return "file too large";
- case MZ_ZIP_UNSUPPORTED_METHOD:
- return "unsupported method";
- case MZ_ZIP_UNSUPPORTED_ENCRYPTION:
- return "unsupported encryption";
- case MZ_ZIP_UNSUPPORTED_FEATURE:
- return "unsupported feature";
- case MZ_ZIP_FAILED_FINDING_CENTRAL_DIR:
- return "failed finding central directory";
- case MZ_ZIP_NOT_AN_ARCHIVE:
- return "not a ZIP archive";
- case MZ_ZIP_INVALID_HEADER_OR_CORRUPTED:
- return "invalid header or archive is corrupted";
- case MZ_ZIP_UNSUPPORTED_MULTIDISK:
- return "unsupported multidisk archive";
- case MZ_ZIP_DECOMPRESSION_FAILED:
- return "decompression failed or archive is corrupted";
- case MZ_ZIP_COMPRESSION_FAILED:
- return "compression failed";
- case MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE:
- return "unexpected decompressed size";
- case MZ_ZIP_CRC_CHECK_FAILED:
- return "CRC-32 check failed";
- case MZ_ZIP_UNSUPPORTED_CDIR_SIZE:
- return "unsupported central directory size";
- case MZ_ZIP_ALLOC_FAILED:
- return "allocation failed";
- case MZ_ZIP_FILE_OPEN_FAILED:
- return "file open failed";
- case MZ_ZIP_FILE_CREATE_FAILED:
- return "file create failed";
- case MZ_ZIP_FILE_WRITE_FAILED:
- return "file write failed";
- case MZ_ZIP_FILE_READ_FAILED:
- return "file read failed";
- case MZ_ZIP_FILE_CLOSE_FAILED:
- return "file close failed";
- case MZ_ZIP_FILE_SEEK_FAILED:
- return "file seek failed";
- case MZ_ZIP_FILE_STAT_FAILED:
- return "file stat failed";
- case MZ_ZIP_INVALID_PARAMETER:
- return "invalid parameter";
- case MZ_ZIP_INVALID_FILENAME:
- return "invalid filename";
- case MZ_ZIP_BUF_TOO_SMALL:
- return "buffer too small";
- case MZ_ZIP_INTERNAL_ERROR:
- return "internal error";
- case MZ_ZIP_FILE_NOT_FOUND:
- return "file not found";
- case MZ_ZIP_ARCHIVE_TOO_LARGE:
- return "archive is too large";
- case MZ_ZIP_VALIDATION_FAILED:
- return "validation failed";
- case MZ_ZIP_WRITE_CALLBACK_FAILED:
- return "write calledback failed";
- default:
- break;
- }
-
- return "unknown error";
-}
-
-/* Note: Just because the archive is not zip64 doesn't necessarily mean it doesn't have Zip64 extended information extra field, argh. */
-mz_bool mz_zip_is_zip64(mz_zip_archive *pZip)
-{
- if ((!pZip) || (!pZip->m_pState))
- return MZ_FALSE;
-
- return pZip->m_pState->m_zip64;
-}
-
-size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip)
-{
- if ((!pZip) || (!pZip->m_pState))
- return 0;
-
- return pZip->m_pState->m_central_dir.m_size;
-}
-
-mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip)
-{
- return pZip ? pZip->m_total_files : 0;
-}
-
-mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip)
-{
- if (!pZip)
- return 0;
- return pZip->m_archive_size;
-}
-
-mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip)
-{
- if ((!pZip) || (!pZip->m_pState))
- return 0;
- return pZip->m_pState->m_file_archive_start_ofs;
-}
-
-MZ_FILE *mz_zip_get_cfile(mz_zip_archive *pZip)
-{
- if ((!pZip) || (!pZip->m_pState))
- return 0;
- return pZip->m_pState->m_pFile;
-}
-
-size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n)
-{
- if ((!pZip) || (!pZip->m_pState) || (!pBuf) || (!pZip->m_pRead))
- return mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
-
- return pZip->m_pRead(pZip->m_pIO_opaque, file_ofs, pBuf, n);
-}
-
-mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size)
-{
- mz_uint n;
- const mz_uint8 *p = mz_zip_get_cdh(pZip, file_index);
- if (!p)
- {
- if (filename_buf_size)
- pFilename[0] = '\0';
- mz_zip_set_error(pZip, MZ_ZIP_INVALID_PARAMETER);
- return 0;
- }
- n = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS);
- if (filename_buf_size)
- {
- n = MZ_MIN(n, filename_buf_size - 1);
- memcpy(pFilename, p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE, n);
- pFilename[n] = '\0';
- }
- return n + 1;
-}
-
-mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat)
-{
- return mz_zip_file_stat_internal(pZip, file_index, mz_zip_get_cdh(pZip, file_index), pStat, NULL);
-}
-
-mz_bool mz_zip_end(mz_zip_archive *pZip)
-{
- if (!pZip)
- return MZ_FALSE;
-
- if (pZip->m_zip_mode == MZ_ZIP_MODE_READING)
- return mz_zip_reader_end(pZip);
-#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
- else if ((pZip->m_zip_mode == MZ_ZIP_MODE_WRITING) || (pZip->m_zip_mode == MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED))
- return mz_zip_writer_end(pZip);
-#endif
-
- return MZ_FALSE;
-}
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /*#ifndef MINIZ_NO_ARCHIVE_APIS*/
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.h b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.h
deleted file mode 100644
index 6cc398c920..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/miniz.h
+++ /dev/null
@@ -1,1350 +0,0 @@
-#define MINIZ_EXPORT
-/* miniz.c 2.2.0 - public domain deflate/inflate, zlib-subset, ZIP reading/writing/appending, PNG writing
- See "unlicense" statement at the end of this file.
- Rich Geldreich <richgel99@gmail.com>, last updated Oct. 13, 2013
- Implements RFC 1950: http://www.ietf.org/rfc/rfc1950.txt and RFC 1951: http://www.ietf.org/rfc/rfc1951.txt
-
- Most API's defined in miniz.c are optional. For example, to disable the archive related functions just define
- MINIZ_NO_ARCHIVE_APIS, or to get rid of all stdio usage define MINIZ_NO_STDIO (see the list below for more macros).
-
- * Low-level Deflate/Inflate implementation notes:
-
- Compression: Use the "tdefl" API's. The compressor supports raw, static, and dynamic blocks, lazy or
- greedy parsing, match length filtering, RLE-only, and Huffman-only streams. It performs and compresses
- approximately as well as zlib.
-
- Decompression: Use the "tinfl" API's. The entire decompressor is implemented as a single function
- coroutine: see tinfl_decompress(). It supports decompression into a 32KB (or larger power of 2) wrapping buffer, or into a memory
- block large enough to hold the entire file.
-
- The low-level tdefl/tinfl API's do not make any use of dynamic memory allocation.
-
- * zlib-style API notes:
-
- miniz.c implements a fairly large subset of zlib. There's enough functionality present for it to be a drop-in
- zlib replacement in many apps:
- The z_stream struct, optional memory allocation callbacks
- deflateInit/deflateInit2/deflate/deflateReset/deflateEnd/deflateBound
- inflateInit/inflateInit2/inflate/inflateReset/inflateEnd
- compress, compress2, compressBound, uncompress
- CRC-32, Adler-32 - Using modern, minimal code size, CPU cache friendly routines.
- Supports raw deflate streams or standard zlib streams with adler-32 checking.
-
- Limitations:
- The callback API's are not implemented yet. No support for gzip headers or zlib static dictionaries.
- I've tried to closely emulate zlib's various flavors of stream flushing and return status codes, but
- there are no guarantees that miniz.c pulls this off perfectly.
-
- * PNG writing: See the tdefl_write_image_to_png_file_in_memory() function, originally written by
- Alex Evans. Supports 1-4 bytes/pixel images.
-
- * ZIP archive API notes:
-
- The ZIP archive API's where designed with simplicity and efficiency in mind, with just enough abstraction to
- get the job done with minimal fuss. There are simple API's to retrieve file information, read files from
- existing archives, create new archives, append new files to existing archives, or clone archive data from
- one archive to another. It supports archives located in memory or the heap, on disk (using stdio.h),
- or you can specify custom file read/write callbacks.
-
- - Archive reading: Just call this function to read a single file from a disk archive:
-
- void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name,
- size_t *pSize, mz_uint zip_flags);
-
- For more complex cases, use the "mz_zip_reader" functions. Upon opening an archive, the entire central
- directory is located and read as-is into memory, and subsequent file access only occurs when reading individual files.
-
- - Archives file scanning: The simple way is to use this function to scan a loaded archive for a specific file:
-
- int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
-
- The locate operation can optionally check file comments too, which (as one example) can be used to identify
- multiple versions of the same file in an archive. This function uses a simple linear search through the central
- directory, so it's not very fast.
-
- Alternately, you can iterate through all the files in an archive (using mz_zip_reader_get_num_files()) and
- retrieve detailed info on each file by calling mz_zip_reader_file_stat().
-
- - Archive creation: Use the "mz_zip_writer" functions. The ZIP writer immediately writes compressed file data
- to disk and builds an exact image of the central directory in memory. The central directory image is written
- all at once at the end of the archive file when the archive is finalized.
-
- The archive writer can optionally align each file's local header and file data to any power of 2 alignment,
- which can be useful when the archive will be read from optical media. Also, the writer supports placing
- arbitrary data blobs at the very beginning of ZIP archives. Archives written using either feature are still
- readable by any ZIP tool.
-
- - Archive appending: The simple way to add a single file to an archive is to call this function:
-
- mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name,
- const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
-
- The archive will be created if it doesn't already exist, otherwise it'll be appended to.
- Note the appending is done in-place and is not an atomic operation, so if something goes wrong
- during the operation it's possible the archive could be left without a central directory (although the local
- file headers and file data will be fine, so the archive will be recoverable).
-
- For more complex archive modification scenarios:
- 1. The safest way is to use a mz_zip_reader to read the existing archive, cloning only those bits you want to
- preserve into a new archive using using the mz_zip_writer_add_from_zip_reader() function (which compiles the
- compressed file data as-is). When you're done, delete the old archive and rename the newly written archive, and
- you're done. This is safe but requires a bunch of temporary disk space or heap memory.
-
- 2. Or, you can convert an mz_zip_reader in-place to an mz_zip_writer using mz_zip_writer_init_from_reader(),
- append new files as needed, then finalize the archive which will write an updated central directory to the
- original archive. (This is basically what mz_zip_add_mem_to_archive_file_in_place() does.) There's a
- possibility that the archive's central directory could be lost with this method if anything goes wrong, though.
-
- - ZIP archive support limitations:
- No spanning support. Extraction functions can only handle unencrypted, stored or deflated files.
- Requires streams capable of seeking.
-
- * This is a header file library, like stb_image.c. To get only a header file, either cut and paste the
- below header, or create miniz.h, #define MINIZ_HEADER_FILE_ONLY, and then include miniz.c from it.
-
- * Important: For best perf. be sure to customize the below macros for your target platform:
- #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
- #define MINIZ_LITTLE_ENDIAN 1
- #define MINIZ_HAS_64BIT_REGISTERS 1
-
- * On platforms using glibc, Be sure to "#define _LARGEFILE64_SOURCE 1" before including miniz.c to ensure miniz
- uses the 64-bit variants: fopen64(), stat64(), etc. Otherwise you won't be able to process large files
- (i.e. 32-bit stat() fails for me on files > 0x7FFFFFFF bytes).
-*/
-#pragma once
-
-
-
-/* Defines to completely disable specific portions of miniz.c:
- If all macros here are defined the only functionality remaining will be CRC-32, adler-32, tinfl, and tdefl. */
-
-/* Define MINIZ_NO_STDIO to disable all usage and any functions which rely on stdio for file I/O. */
-/*#define MINIZ_NO_STDIO */
-
-/* If MINIZ_NO_TIME is specified then the ZIP archive functions will not be able to get the current time, or */
-/* get/set file times, and the C run-time funcs that get/set times won't be called. */
-/* The current downside is the times written to your archives will be from 1979. */
-/*#define MINIZ_NO_TIME */
-
-/* Define MINIZ_NO_ARCHIVE_APIS to disable all ZIP archive API's. */
-/*#define MINIZ_NO_ARCHIVE_APIS */
-
-/* Define MINIZ_NO_ARCHIVE_WRITING_APIS to disable all writing related ZIP archive API's. */
-/*#define MINIZ_NO_ARCHIVE_WRITING_APIS */
-
-/* Define MINIZ_NO_ZLIB_APIS to remove all ZLIB-style compression/decompression API's. */
-/*#define MINIZ_NO_ZLIB_APIS */
-
-/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAME to disable zlib names, to prevent conflicts against stock zlib. */
-/*#define MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
-
-/* Define MINIZ_NO_MALLOC to disable all calls to malloc, free, and realloc.
- Note if MINIZ_NO_MALLOC is defined then the user must always provide custom user alloc/free/realloc
- callbacks to the zlib and archive API's, and a few stand-alone helper API's which don't provide custom user
- functions (such as tdefl_compress_mem_to_heap() and tinfl_decompress_mem_to_heap()) won't work. */
-/*#define MINIZ_NO_MALLOC */
-
-#if defined(__TINYC__) && (defined(__linux) || defined(__linux__))
-/* TODO: Work around "error: include file 'sys\utime.h' when compiling with tcc on Linux */
-#define MINIZ_NO_TIME
-#endif
-
-#include <stddef.h>
-
-#if !defined(MINIZ_NO_TIME) && !defined(MINIZ_NO_ARCHIVE_APIS)
-#include <time.h>
-#endif
-
-#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || defined(__i386) || defined(__i486__) || defined(__i486) || defined(i386) || defined(__ia64__) || defined(__x86_64__)
-/* MINIZ_X86_OR_X64_CPU is only used to help set the below macros. */
-#define MINIZ_X86_OR_X64_CPU 1
-#else
-#define MINIZ_X86_OR_X64_CPU 0
-#endif
-
-#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || MINIZ_X86_OR_X64_CPU
-/* Set MINIZ_LITTLE_ENDIAN to 1 if the processor is little endian. */
-#define MINIZ_LITTLE_ENDIAN 1
-#else
-#define MINIZ_LITTLE_ENDIAN 0
-#endif
-
-/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */
-#if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES)
-#if MINIZ_X86_OR_X64_CPU
-/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */
-#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1
-#define MINIZ_UNALIGNED_USE_MEMCPY
-#else
-#define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0
-#endif
-#endif
-
-#if defined(_M_X64) || defined(_WIN64) || defined(__MINGW64__) || defined(_LP64) || defined(__LP64__) || defined(__ia64__) || defined(__x86_64__)
-/* Set MINIZ_HAS_64BIT_REGISTERS to 1 if operations on 64-bit integers are reasonably fast (and don't involve compiler generated calls to helper functions). */
-#define MINIZ_HAS_64BIT_REGISTERS 1
-#else
-#define MINIZ_HAS_64BIT_REGISTERS 0
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ------------------- zlib-style API Definitions. */
-
-/* For more compatibility with zlib, miniz.c uses unsigned long for some parameters/struct members. Beware: mz_ulong can be either 32 or 64-bits! */
-typedef unsigned long mz_ulong;
-
-/* mz_free() internally uses the MZ_FREE() macro (which by default calls free() unless you've modified the MZ_MALLOC macro) to release a block allocated from the heap. */
-MINIZ_EXPORT void mz_free(void *p);
-
-#define MZ_ADLER32_INIT (1)
-/* mz_adler32() returns the initial adler-32 value to use when called with ptr==NULL. */
-MINIZ_EXPORT mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len);
-
-#define MZ_CRC32_INIT (0)
-/* mz_crc32() returns the initial CRC-32 value to use when called with ptr==NULL. */
-MINIZ_EXPORT mz_ulong mz_crc32(mz_ulong crc, const unsigned char *ptr, size_t buf_len);
-
-/* Compression strategies. */
-enum
-{
- MZ_DEFAULT_STRATEGY = 0,
- MZ_FILTERED = 1,
- MZ_HUFFMAN_ONLY = 2,
- MZ_RLE = 3,
- MZ_FIXED = 4
-};
-
-/* Method */
-#define MZ_DEFLATED 8
-
-/* Heap allocation callbacks.
-Note that mz_alloc_func parameter types purposely differ from zlib's: items/size is size_t, not unsigned long. */
-typedef void *(*mz_alloc_func)(void *opaque, size_t items, size_t size);
-typedef void (*mz_free_func)(void *opaque, void *address);
-typedef void *(*mz_realloc_func)(void *opaque, void *address, size_t items, size_t size);
-
-/* Compression levels: 0-9 are the standard zlib-style levels, 10 is best possible compression (not zlib compatible, and may be very slow), MZ_DEFAULT_COMPRESSION=MZ_DEFAULT_LEVEL. */
-enum
-{
- MZ_NO_COMPRESSION = 0,
- MZ_BEST_SPEED = 1,
- MZ_BEST_COMPRESSION = 9,
- MZ_UBER_COMPRESSION = 10,
- MZ_DEFAULT_LEVEL = 6,
- MZ_DEFAULT_COMPRESSION = -1
-};
-
-#define MZ_VERSION "10.2.0"
-#define MZ_VERNUM 0xA100
-#define MZ_VER_MAJOR 10
-#define MZ_VER_MINOR 2
-#define MZ_VER_REVISION 0
-#define MZ_VER_SUBREVISION 0
-
-#ifndef MINIZ_NO_ZLIB_APIS
-
-/* Flush values. For typical usage you only need MZ_NO_FLUSH and MZ_FINISH. The other values are for advanced use (refer to the zlib docs). */
-enum
-{
- MZ_NO_FLUSH = 0,
- MZ_PARTIAL_FLUSH = 1,
- MZ_SYNC_FLUSH = 2,
- MZ_FULL_FLUSH = 3,
- MZ_FINISH = 4,
- MZ_BLOCK = 5
-};
-
-/* Return status codes. MZ_PARAM_ERROR is non-standard. */
-enum
-{
- MZ_OK = 0,
- MZ_STREAM_END = 1,
- MZ_NEED_DICT = 2,
- MZ_ERRNO = -1,
- MZ_STREAM_ERROR = -2,
- MZ_DATA_ERROR = -3,
- MZ_MEM_ERROR = -4,
- MZ_BUF_ERROR = -5,
- MZ_VERSION_ERROR = -6,
- MZ_PARAM_ERROR = -10000
-};
-
-/* Window bits */
-#define MZ_DEFAULT_WINDOW_BITS 15
-
-struct mz_internal_state;
-
-/* Compression/decompression stream struct. */
-typedef struct mz_stream_s
-{
- const unsigned char *next_in; /* pointer to next byte to read */
- unsigned int avail_in; /* number of bytes available at next_in */
- mz_ulong total_in; /* total number of bytes consumed so far */
-
- unsigned char *next_out; /* pointer to next byte to write */
- unsigned int avail_out; /* number of bytes that can be written to next_out */
- mz_ulong total_out; /* total number of bytes produced so far */
-
- char *msg; /* error msg (unused) */
- struct mz_internal_state *state; /* internal state, allocated by zalloc/zfree */
-
- mz_alloc_func zalloc; /* optional heap allocation function (defaults to malloc) */
- mz_free_func zfree; /* optional heap free function (defaults to free) */
- void *opaque; /* heap alloc function user pointer */
-
- int data_type; /* data_type (unused) */
- mz_ulong adler; /* adler32 of the source or uncompressed data */
- mz_ulong reserved; /* not used */
-} mz_stream;
-
-typedef mz_stream *mz_streamp;
-
-/* Returns the version string of miniz.c. */
-MINIZ_EXPORT const char *mz_version(void);
-
-/* mz_deflateInit() initializes a compressor with default options: */
-/* Parameters: */
-/* pStream must point to an initialized mz_stream struct. */
-/* level must be between [MZ_NO_COMPRESSION, MZ_BEST_COMPRESSION]. */
-/* level 1 enables a specially optimized compression function that's been optimized purely for performance, not ratio. */
-/* (This special func. is currently only enabled when MINIZ_USE_UNALIGNED_LOADS_AND_STORES and MINIZ_LITTLE_ENDIAN are defined.) */
-/* Return values: */
-/* MZ_OK on success. */
-/* MZ_STREAM_ERROR if the stream is bogus. */
-/* MZ_PARAM_ERROR if the input parameters are bogus. */
-/* MZ_MEM_ERROR on out of memory. */
-MINIZ_EXPORT int mz_deflateInit(mz_streamp pStream, int level);
-
-/* mz_deflateInit2() is like mz_deflate(), except with more control: */
-/* Additional parameters: */
-/* method must be MZ_DEFLATED */
-/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to wrap the deflate stream with zlib header/adler-32 footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate/no header or footer) */
-/* mem_level must be between [1, 9] (it's checked but ignored by miniz.c) */
-MINIZ_EXPORT int mz_deflateInit2(mz_streamp pStream, int level, int method, int window_bits, int mem_level, int strategy);
-
-/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_deflateEnd() followed by mz_deflateInit()/mz_deflateInit2(). */
-MINIZ_EXPORT int mz_deflateReset(mz_streamp pStream);
-
-/* mz_deflate() compresses the input to output, consuming as much of the input and producing as much output as possible. */
-/* Parameters: */
-/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */
-/* flush may be MZ_NO_FLUSH, MZ_PARTIAL_FLUSH/MZ_SYNC_FLUSH, MZ_FULL_FLUSH, or MZ_FINISH. */
-/* Return values: */
-/* MZ_OK on success (when flushing, or if more input is needed but not available, and/or there's more output to be written but the output buffer is full). */
-/* MZ_STREAM_END if all input has been consumed and all output bytes have been written. Don't call mz_deflate() on the stream anymore. */
-/* MZ_STREAM_ERROR if the stream is bogus. */
-/* MZ_PARAM_ERROR if one of the parameters is invalid. */
-/* MZ_BUF_ERROR if no forward progress is possible because the input and/or output buffers are empty. (Fill up the input buffer or free up some output space and try again.) */
-MINIZ_EXPORT int mz_deflate(mz_streamp pStream, int flush);
-
-/* mz_deflateEnd() deinitializes a compressor: */
-/* Return values: */
-/* MZ_OK on success. */
-/* MZ_STREAM_ERROR if the stream is bogus. */
-MINIZ_EXPORT int mz_deflateEnd(mz_streamp pStream);
-
-/* mz_deflateBound() returns a (very) conservative upper bound on the amount of data that could be generated by deflate(), assuming flush is set to only MZ_NO_FLUSH or MZ_FINISH. */
-MINIZ_EXPORT mz_ulong mz_deflateBound(mz_streamp pStream, mz_ulong source_len);
-
-/* Single-call compression functions mz_compress() and mz_compress2(): */
-/* Returns MZ_OK on success, or one of the error codes from mz_deflate() on failure. */
-MINIZ_EXPORT int mz_compress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len);
-MINIZ_EXPORT int mz_compress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len, int level);
-
-/* mz_compressBound() returns a (very) conservative upper bound on the amount of data that could be generated by calling mz_compress(). */
-MINIZ_EXPORT mz_ulong mz_compressBound(mz_ulong source_len);
-
-/* Initializes a decompressor. */
-MINIZ_EXPORT int mz_inflateInit(mz_streamp pStream);
-
-/* mz_inflateInit2() is like mz_inflateInit() with an additional option that controls the window size and whether or not the stream has been wrapped with a zlib header/footer: */
-/* window_bits must be MZ_DEFAULT_WINDOW_BITS (to parse zlib header/footer) or -MZ_DEFAULT_WINDOW_BITS (raw deflate). */
-MINIZ_EXPORT int mz_inflateInit2(mz_streamp pStream, int window_bits);
-
-/* Quickly resets a compressor without having to reallocate anything. Same as calling mz_inflateEnd() followed by mz_inflateInit()/mz_inflateInit2(). */
-MINIZ_EXPORT int mz_inflateReset(mz_streamp pStream);
-
-/* Decompresses the input stream to the output, consuming only as much of the input as needed, and writing as much to the output as possible. */
-/* Parameters: */
-/* pStream is the stream to read from and write to. You must initialize/update the next_in, avail_in, next_out, and avail_out members. */
-/* flush may be MZ_NO_FLUSH, MZ_SYNC_FLUSH, or MZ_FINISH. */
-/* On the first call, if flush is MZ_FINISH it's assumed the input and output buffers are both sized large enough to decompress the entire stream in a single call (this is slightly faster). */
-/* MZ_FINISH implies that there are no more source bytes available beside what's already in the input buffer, and that the output buffer is large enough to hold the rest of the decompressed data. */
-/* Return values: */
-/* MZ_OK on success. Either more input is needed but not available, and/or there's more output to be written but the output buffer is full. */
-/* MZ_STREAM_END if all needed input has been consumed and all output bytes have been written. For zlib streams, the adler-32 of the decompressed data has also been verified. */
-/* MZ_STREAM_ERROR if the stream is bogus. */
-/* MZ_DATA_ERROR if the deflate stream is invalid. */
-/* MZ_PARAM_ERROR if one of the parameters is invalid. */
-/* MZ_BUF_ERROR if no forward progress is possible because the input buffer is empty but the inflater needs more input to continue, or if the output buffer is not large enough. Call mz_inflate() again */
-/* with more input data, or with more room in the output buffer (except when using single call decompression, described above). */
-MINIZ_EXPORT int mz_inflate(mz_streamp pStream, int flush);
-
-/* Deinitializes a decompressor. */
-MINIZ_EXPORT int mz_inflateEnd(mz_streamp pStream);
-
-/* Single-call decompression. */
-/* Returns MZ_OK on success, or one of the error codes from mz_inflate() on failure. */
-MINIZ_EXPORT int mz_uncompress(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong source_len);
-MINIZ_EXPORT int mz_uncompress2(unsigned char *pDest, mz_ulong *pDest_len, const unsigned char *pSource, mz_ulong *pSource_len);
-
-/* Returns a string description of the specified error code, or NULL if the error code is invalid. */
-MINIZ_EXPORT const char *mz_error(int err);
-
-/* Redefine zlib-compatible names to miniz equivalents, so miniz.c can be used as a drop-in replacement for the subset of zlib that miniz.c supports. */
-/* Define MINIZ_NO_ZLIB_COMPATIBLE_NAMES to disable zlib-compatibility if you use zlib in the same project. */
-#ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES
-typedef unsigned char Byte;
-typedef unsigned int uInt;
-typedef mz_ulong uLong;
-typedef Byte Bytef;
-typedef uInt uIntf;
-typedef char charf;
-typedef int intf;
-typedef void *voidpf;
-typedef uLong uLongf;
-typedef void *voidp;
-typedef void *const voidpc;
-#define Z_NULL 0
-#define Z_NO_FLUSH MZ_NO_FLUSH
-#define Z_PARTIAL_FLUSH MZ_PARTIAL_FLUSH
-#define Z_SYNC_FLUSH MZ_SYNC_FLUSH
-#define Z_FULL_FLUSH MZ_FULL_FLUSH
-#define Z_FINISH MZ_FINISH
-#define Z_BLOCK MZ_BLOCK
-#define Z_OK MZ_OK
-#define Z_STREAM_END MZ_STREAM_END
-#define Z_NEED_DICT MZ_NEED_DICT
-#define Z_ERRNO MZ_ERRNO
-#define Z_STREAM_ERROR MZ_STREAM_ERROR
-#define Z_DATA_ERROR MZ_DATA_ERROR
-#define Z_MEM_ERROR MZ_MEM_ERROR
-#define Z_BUF_ERROR MZ_BUF_ERROR
-#define Z_VERSION_ERROR MZ_VERSION_ERROR
-#define Z_PARAM_ERROR MZ_PARAM_ERROR
-#define Z_NO_COMPRESSION MZ_NO_COMPRESSION
-#define Z_BEST_SPEED MZ_BEST_SPEED
-#define Z_BEST_COMPRESSION MZ_BEST_COMPRESSION
-#define Z_DEFAULT_COMPRESSION MZ_DEFAULT_COMPRESSION
-#define Z_DEFAULT_STRATEGY MZ_DEFAULT_STRATEGY
-#define Z_FILTERED MZ_FILTERED
-#define Z_HUFFMAN_ONLY MZ_HUFFMAN_ONLY
-#define Z_RLE MZ_RLE
-#define Z_FIXED MZ_FIXED
-#define Z_DEFLATED MZ_DEFLATED
-#define Z_DEFAULT_WINDOW_BITS MZ_DEFAULT_WINDOW_BITS
-#define alloc_func mz_alloc_func
-#define free_func mz_free_func
-#define internal_state mz_internal_state
-#define z_stream mz_stream
-#define deflateInit mz_deflateInit
-#define deflateInit2 mz_deflateInit2
-#define deflateReset mz_deflateReset
-#define deflate mz_deflate
-#define deflateEnd mz_deflateEnd
-#define deflateBound mz_deflateBound
-#define compress mz_compress
-#define compress2 mz_compress2
-#define compressBound mz_compressBound
-#define inflateInit mz_inflateInit
-#define inflateInit2 mz_inflateInit2
-#define inflateReset mz_inflateReset
-#define inflate mz_inflate
-#define inflateEnd mz_inflateEnd
-#define uncompress mz_uncompress
-#define uncompress2 mz_uncompress2
-#define crc32 mz_crc32
-#define adler32 mz_adler32
-#define MAX_WBITS 15
-#define MAX_MEM_LEVEL 9
-#define zError mz_error
-#define ZLIB_VERSION MZ_VERSION
-#define ZLIB_VERNUM MZ_VERNUM
-#define ZLIB_VER_MAJOR MZ_VER_MAJOR
-#define ZLIB_VER_MINOR MZ_VER_MINOR
-#define ZLIB_VER_REVISION MZ_VER_REVISION
-#define ZLIB_VER_SUBREVISION MZ_VER_SUBREVISION
-#define zlibVersion mz_version
-#define zlib_version mz_version()
-#endif /* #ifndef MINIZ_NO_ZLIB_COMPATIBLE_NAMES */
-
-#endif /* MINIZ_NO_ZLIB_APIS */
-
-#ifdef __cplusplus
-}
-#endif
-
-
-
-
-
-#pragma once
-#include <assert.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
-
-
-
-/* ------------------- Types and macros */
-typedef unsigned char mz_uint8;
-typedef signed short mz_int16;
-typedef unsigned short mz_uint16;
-typedef unsigned int mz_uint32;
-typedef unsigned int mz_uint;
-typedef int64_t mz_int64;
-typedef uint64_t mz_uint64;
-typedef int mz_bool;
-
-#define MZ_FALSE (0)
-#define MZ_TRUE (1)
-
-/* Works around MSVC's spammy "warning C4127: conditional expression is constant" message. */
-#ifdef _MSC_VER
-#define MZ_MACRO_END while (0, 0)
-#else
-#define MZ_MACRO_END while (0)
-#endif
-
-#ifdef MINIZ_NO_STDIO
-#define MZ_FILE void *
-#else
-#include <stdio.h>
-#define MZ_FILE FILE
-#endif /* #ifdef MINIZ_NO_STDIO */
-
-#ifdef MINIZ_NO_TIME
-typedef struct mz_dummy_time_t_tag
-{
- int m_dummy;
-} mz_dummy_time_t;
-#define MZ_TIME_T mz_dummy_time_t
-#else
-#define MZ_TIME_T time_t
-#endif
-
-#define MZ_ASSERT(x) assert(x)
-
-#ifdef MINIZ_NO_MALLOC
-#define MZ_MALLOC(x) NULL
-#define MZ_FREE(x) (void)x, ((void)0)
-#define MZ_REALLOC(p, x) NULL
-#else
-#define MZ_MALLOC(x) malloc(x)
-#define MZ_FREE(x) free(x)
-#define MZ_REALLOC(p, x) realloc(p, x)
-#endif
-
-#define MZ_MAX(a, b) (((a) > (b)) ? (a) : (b))
-#define MZ_MIN(a, b) (((a) < (b)) ? (a) : (b))
-#define MZ_CLEAR_OBJ(obj) memset(&(obj), 0, sizeof(obj))
-
-#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN
-#define MZ_READ_LE16(p) *((const mz_uint16 *)(p))
-#define MZ_READ_LE32(p) *((const mz_uint32 *)(p))
-#else
-#define MZ_READ_LE16(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U))
-#define MZ_READ_LE32(p) ((mz_uint32)(((const mz_uint8 *)(p))[0]) | ((mz_uint32)(((const mz_uint8 *)(p))[1]) << 8U) | ((mz_uint32)(((const mz_uint8 *)(p))[2]) << 16U) | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U))
-#endif
-
-#define MZ_READ_LE64(p) (((mz_uint64)MZ_READ_LE32(p)) | (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) << 32U))
-
-#ifdef _MSC_VER
-#define MZ_FORCEINLINE __forceinline
-#elif defined(__GNUC__)
-#define MZ_FORCEINLINE __inline__ __attribute__((__always_inline__))
-#else
-#define MZ_FORCEINLINE inline
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern MINIZ_EXPORT void *miniz_def_alloc_func(void *opaque, size_t items, size_t size);
-extern MINIZ_EXPORT void miniz_def_free_func(void *opaque, void *address);
-extern MINIZ_EXPORT void *miniz_def_realloc_func(void *opaque, void *address, size_t items, size_t size);
-
-#define MZ_UINT16_MAX (0xFFFFU)
-#define MZ_UINT32_MAX (0xFFFFFFFFU)
-
-#ifdef __cplusplus
-}
-#endif
- #pragma once
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* ------------------- Low-level Compression API Definitions */
-
-/* Set TDEFL_LESS_MEMORY to 1 to use less memory (compression will be slightly slower, and raw/dynamic blocks will be output more frequently). */
-#define TDEFL_LESS_MEMORY 0
-
-/* tdefl_init() compression flags logically OR'd together (low 12 bits contain the max. number of probes per dictionary search): */
-/* TDEFL_DEFAULT_MAX_PROBES: The compressor defaults to 128 dictionary probes per dictionary search. 0=Huffman only, 1=Huffman+LZ (fastest/crap compression), 4095=Huffman+LZ (slowest/best compression). */
-enum
-{
- TDEFL_HUFFMAN_ONLY = 0,
- TDEFL_DEFAULT_MAX_PROBES = 128,
- TDEFL_MAX_PROBES_MASK = 0xFFF
-};
-
-/* TDEFL_WRITE_ZLIB_HEADER: If set, the compressor outputs a zlib header before the deflate data, and the Adler-32 of the source data at the end. Otherwise, you'll get raw deflate data. */
-/* TDEFL_COMPUTE_ADLER32: Always compute the adler-32 of the input data (even when not writing zlib headers). */
-/* TDEFL_GREEDY_PARSING_FLAG: Set to use faster greedy parsing, instead of more efficient lazy parsing. */
-/* TDEFL_NONDETERMINISTIC_PARSING_FLAG: Enable to decrease the compressor's initialization time to the minimum, but the output may vary from run to run given the same input (depending on the contents of memory). */
-/* TDEFL_RLE_MATCHES: Only look for RLE matches (matches with a distance of 1) */
-/* TDEFL_FILTER_MATCHES: Discards matches <= 5 chars if enabled. */
-/* TDEFL_FORCE_ALL_STATIC_BLOCKS: Disable usage of optimized Huffman tables. */
-/* TDEFL_FORCE_ALL_RAW_BLOCKS: Only use raw (uncompressed) deflate blocks. */
-/* The low 12 bits are reserved to control the max # of hash probes per dictionary lookup (see TDEFL_MAX_PROBES_MASK). */
-enum
-{
- TDEFL_WRITE_ZLIB_HEADER = 0x01000,
- TDEFL_COMPUTE_ADLER32 = 0x02000,
- TDEFL_GREEDY_PARSING_FLAG = 0x04000,
- TDEFL_NONDETERMINISTIC_PARSING_FLAG = 0x08000,
- TDEFL_RLE_MATCHES = 0x10000,
- TDEFL_FILTER_MATCHES = 0x20000,
- TDEFL_FORCE_ALL_STATIC_BLOCKS = 0x40000,
- TDEFL_FORCE_ALL_RAW_BLOCKS = 0x80000
-};
-
-/* High level compression functions: */
-/* tdefl_compress_mem_to_heap() compresses a block in memory to a heap block allocated via malloc(). */
-/* On entry: */
-/* pSrc_buf, src_buf_len: Pointer and size of source block to compress. */
-/* flags: The max match finder probes (default is 128) logically OR'd against the above flags. Higher probes are slower but improve compression. */
-/* On return: */
-/* Function returns a pointer to the compressed data, or NULL on failure. */
-/* *pOut_len will be set to the compressed data's size, which could be larger than src_buf_len on uncompressible data. */
-/* The caller must free() the returned block when it's no longer needed. */
-MINIZ_EXPORT void *tdefl_compress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags);
-
-/* tdefl_compress_mem_to_mem() compresses a block in memory to another block in memory. */
-/* Returns 0 on failure. */
-MINIZ_EXPORT size_t tdefl_compress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags);
-
-/* Compresses an image to a compressed PNG file in memory. */
-/* On entry: */
-/* pImage, w, h, and num_chans describe the image to compress. num_chans may be 1, 2, 3, or 4. */
-/* The image pitch in bytes per scanline will be w*num_chans. The leftmost pixel on the top scanline is stored first in memory. */
-/* level may range from [0,10], use MZ_NO_COMPRESSION, MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc. or a decent default is MZ_DEFAULT_LEVEL */
-/* If flip is true, the image will be flipped on the Y axis (useful for OpenGL apps). */
-/* On return: */
-/* Function returns a pointer to the compressed data, or NULL on failure. */
-/* *pLen_out will be set to the size of the PNG image file. */
-/* The caller must mz_free() the returned heap block (which will typically be larger than *pLen_out) when it's no longer needed. */
-MINIZ_EXPORT void *tdefl_write_image_to_png_file_in_memory_ex(const void *pImage, int w, int h, int num_chans, size_t *pLen_out, mz_uint level, mz_bool flip);
-MINIZ_EXPORT void *tdefl_write_image_to_png_file_in_memory(const void *pImage, int w, int h, int num_chans, size_t *pLen_out);
-
-/* Output stream interface. The compressor uses this interface to write compressed data. It'll typically be called TDEFL_OUT_BUF_SIZE at a time. */
-typedef mz_bool (*tdefl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
-
-/* tdefl_compress_mem_to_output() compresses a block to an output stream. The above helpers use this function internally. */
-MINIZ_EXPORT mz_bool tdefl_compress_mem_to_output(const void *pBuf, size_t buf_len, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
-
-enum
-{
- TDEFL_MAX_HUFF_TABLES = 3,
- TDEFL_MAX_HUFF_SYMBOLS_0 = 288,
- TDEFL_MAX_HUFF_SYMBOLS_1 = 32,
- TDEFL_MAX_HUFF_SYMBOLS_2 = 19,
- TDEFL_LZ_DICT_SIZE = 32768,
- TDEFL_LZ_DICT_SIZE_MASK = TDEFL_LZ_DICT_SIZE - 1,
- TDEFL_MIN_MATCH_LEN = 3,
- TDEFL_MAX_MATCH_LEN = 258
-};
-
-/* TDEFL_OUT_BUF_SIZE MUST be large enough to hold a single entire compressed output block (using static/fixed Huffman codes). */
-#if TDEFL_LESS_MEMORY
-enum
-{
- TDEFL_LZ_CODE_BUF_SIZE = 24 * 1024,
- TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
- TDEFL_MAX_HUFF_SYMBOLS = 288,
- TDEFL_LZ_HASH_BITS = 12,
- TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
- TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
- TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
-};
-#else
-enum
-{
- TDEFL_LZ_CODE_BUF_SIZE = 64 * 1024,
- TDEFL_OUT_BUF_SIZE = (TDEFL_LZ_CODE_BUF_SIZE * 13) / 10,
- TDEFL_MAX_HUFF_SYMBOLS = 288,
- TDEFL_LZ_HASH_BITS = 15,
- TDEFL_LEVEL1_HASH_SIZE_MASK = 4095,
- TDEFL_LZ_HASH_SHIFT = (TDEFL_LZ_HASH_BITS + 2) / 3,
- TDEFL_LZ_HASH_SIZE = 1 << TDEFL_LZ_HASH_BITS
-};
-#endif
-
-/* The low-level tdefl functions below may be used directly if the above helper functions aren't flexible enough. The low-level functions don't make any heap allocations, unlike the above helper functions. */
-typedef enum {
- TDEFL_STATUS_BAD_PARAM = -2,
- TDEFL_STATUS_PUT_BUF_FAILED = -1,
- TDEFL_STATUS_OKAY = 0,
- TDEFL_STATUS_DONE = 1
-} tdefl_status;
-
-/* Must map to MZ_NO_FLUSH, MZ_SYNC_FLUSH, etc. enums */
-typedef enum {
- TDEFL_NO_FLUSH = 0,
- TDEFL_SYNC_FLUSH = 2,
- TDEFL_FULL_FLUSH = 3,
- TDEFL_FINISH = 4
-} tdefl_flush;
-
-/* tdefl's compression state structure. */
-typedef struct
-{
- tdefl_put_buf_func_ptr m_pPut_buf_func;
- void *m_pPut_buf_user;
- mz_uint m_flags, m_max_probes[2];
- int m_greedy_parsing;
- mz_uint m_adler32, m_lookahead_pos, m_lookahead_size, m_dict_size;
- mz_uint8 *m_pLZ_code_buf, *m_pLZ_flags, *m_pOutput_buf, *m_pOutput_buf_end;
- mz_uint m_num_flags_left, m_total_lz_bytes, m_lz_code_buf_dict_pos, m_bits_in, m_bit_buffer;
- mz_uint m_saved_match_dist, m_saved_match_len, m_saved_lit, m_output_flush_ofs, m_output_flush_remaining, m_finished, m_block_index, m_wants_to_finish;
- tdefl_status m_prev_return_status;
- const void *m_pIn_buf;
- void *m_pOut_buf;
- size_t *m_pIn_buf_size, *m_pOut_buf_size;
- tdefl_flush m_flush;
- const mz_uint8 *m_pSrc;
- size_t m_src_buf_left, m_out_buf_ofs;
- mz_uint8 m_dict[TDEFL_LZ_DICT_SIZE + TDEFL_MAX_MATCH_LEN - 1];
- mz_uint16 m_huff_count[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
- mz_uint16 m_huff_codes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
- mz_uint8 m_huff_code_sizes[TDEFL_MAX_HUFF_TABLES][TDEFL_MAX_HUFF_SYMBOLS];
- mz_uint8 m_lz_code_buf[TDEFL_LZ_CODE_BUF_SIZE];
- mz_uint16 m_next[TDEFL_LZ_DICT_SIZE];
- mz_uint16 m_hash[TDEFL_LZ_HASH_SIZE];
- mz_uint8 m_output_buf[TDEFL_OUT_BUF_SIZE];
-} tdefl_compressor;
-
-/* Initializes the compressor. */
-/* There is no corresponding deinit() function because the tdefl API's do not dynamically allocate memory. */
-/* pBut_buf_func: If NULL, output data will be supplied to the specified callback. In this case, the user should call the tdefl_compress_buffer() API for compression. */
-/* If pBut_buf_func is NULL the user should always call the tdefl_compress() API. */
-/* flags: See the above enums (TDEFL_HUFFMAN_ONLY, TDEFL_WRITE_ZLIB_HEADER, etc.) */
-MINIZ_EXPORT tdefl_status tdefl_init(tdefl_compressor *d, tdefl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
-
-/* Compresses a block of data, consuming as much of the specified input buffer as possible, and writing as much compressed data to the specified output buffer as possible. */
-MINIZ_EXPORT tdefl_status tdefl_compress(tdefl_compressor *d, const void *pIn_buf, size_t *pIn_buf_size, void *pOut_buf, size_t *pOut_buf_size, tdefl_flush flush);
-
-/* tdefl_compress_buffer() is only usable when the tdefl_init() is called with a non-NULL tdefl_put_buf_func_ptr. */
-/* tdefl_compress_buffer() always consumes the entire input buffer. */
-MINIZ_EXPORT tdefl_status tdefl_compress_buffer(tdefl_compressor *d, const void *pIn_buf, size_t in_buf_size, tdefl_flush flush);
-
-MINIZ_EXPORT tdefl_status tdefl_get_prev_return_status(tdefl_compressor *d);
-MINIZ_EXPORT mz_uint32 tdefl_get_adler32(tdefl_compressor *d);
-
-/* Create tdefl_compress() flags given zlib-style compression parameters. */
-/* level may range from [0,10] (where 10 is absolute max compression, but may be much slower on some files) */
-/* window_bits may be -15 (raw deflate) or 15 (zlib) */
-/* strategy may be either MZ_DEFAULT_STRATEGY, MZ_FILTERED, MZ_HUFFMAN_ONLY, MZ_RLE, or MZ_FIXED */
-MINIZ_EXPORT mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy);
-
-#ifndef MINIZ_NO_MALLOC
-/* Allocate the tdefl_compressor structure in C so that */
-/* non-C language bindings to tdefl_ API don't need to worry about */
-/* structure size and allocation mechanism. */
-MINIZ_EXPORT tdefl_compressor *tdefl_compressor_alloc(void);
-MINIZ_EXPORT void tdefl_compressor_free(tdefl_compressor *pComp);
-#endif
-
-#ifdef __cplusplus
-}
-#endif
- #pragma once
-
-/* ------------------- Low-level Decompression API Definitions */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/* Decompression flags used by tinfl_decompress(). */
-/* TINFL_FLAG_PARSE_ZLIB_HEADER: If set, the input has a valid zlib header and ends with an adler32 checksum (it's a valid zlib stream). Otherwise, the input is a raw deflate stream. */
-/* TINFL_FLAG_HAS_MORE_INPUT: If set, there are more input bytes available beyond the end of the supplied input buffer. If clear, the input buffer contains all remaining input. */
-/* TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF: If set, the output buffer is large enough to hold the entire decompressed stream. If clear, the output buffer is at least the size of the dictionary (typically 32KB). */
-/* TINFL_FLAG_COMPUTE_ADLER32: Force adler-32 checksum computation of the decompressed bytes. */
-enum
-{
- TINFL_FLAG_PARSE_ZLIB_HEADER = 1,
- TINFL_FLAG_HAS_MORE_INPUT = 2,
- TINFL_FLAG_USING_NON_WRAPPING_OUTPUT_BUF = 4,
- TINFL_FLAG_COMPUTE_ADLER32 = 8
-};
-
-/* High level decompression functions: */
-/* tinfl_decompress_mem_to_heap() decompresses a block in memory to a heap block allocated via malloc(). */
-/* On entry: */
-/* pSrc_buf, src_buf_len: Pointer and size of the Deflate or zlib source data to decompress. */
-/* On return: */
-/* Function returns a pointer to the decompressed data, or NULL on failure. */
-/* *pOut_len will be set to the decompressed data's size, which could be larger than src_buf_len on uncompressible data. */
-/* The caller must call mz_free() on the returned block when it's no longer needed. */
-MINIZ_EXPORT void *tinfl_decompress_mem_to_heap(const void *pSrc_buf, size_t src_buf_len, size_t *pOut_len, int flags);
-
-/* tinfl_decompress_mem_to_mem() decompresses a block in memory to another block in memory. */
-/* Returns TINFL_DECOMPRESS_MEM_TO_MEM_FAILED on failure, or the number of bytes written on success. */
-#define TINFL_DECOMPRESS_MEM_TO_MEM_FAILED ((size_t)(-1))
-MINIZ_EXPORT size_t tinfl_decompress_mem_to_mem(void *pOut_buf, size_t out_buf_len, const void *pSrc_buf, size_t src_buf_len, int flags);
-
-/* tinfl_decompress_mem_to_callback() decompresses a block in memory to an internal 32KB buffer, and a user provided callback function will be called to flush the buffer. */
-/* Returns 1 on success or 0 on failure. */
-typedef int (*tinfl_put_buf_func_ptr)(const void *pBuf, int len, void *pUser);
-MINIZ_EXPORT int tinfl_decompress_mem_to_callback(const void *pIn_buf, size_t *pIn_buf_size, tinfl_put_buf_func_ptr pPut_buf_func, void *pPut_buf_user, int flags);
-
-struct tinfl_decompressor_tag;
-typedef struct tinfl_decompressor_tag tinfl_decompressor;
-
-#ifndef MINIZ_NO_MALLOC
-/* Allocate the tinfl_decompressor structure in C so that */
-/* non-C language bindings to tinfl_ API don't need to worry about */
-/* structure size and allocation mechanism. */
-MINIZ_EXPORT tinfl_decompressor *tinfl_decompressor_alloc(void);
-MINIZ_EXPORT void tinfl_decompressor_free(tinfl_decompressor *pDecomp);
-#endif
-
-/* Max size of LZ dictionary. */
-#define TINFL_LZ_DICT_SIZE 32768
-
-/* Return status. */
-typedef enum {
- /* This flags indicates the inflator needs 1 or more input bytes to make forward progress, but the caller is indicating that no more are available. The compressed data */
- /* is probably corrupted. If you call the inflator again with more bytes it'll try to continue processing the input but this is a BAD sign (either the data is corrupted or you called it incorrectly). */
- /* If you call it again with no input you'll just get TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS again. */
- TINFL_STATUS_FAILED_CANNOT_MAKE_PROGRESS = -4,
-
- /* This flag indicates that one or more of the input parameters was obviously bogus. (You can try calling it again, but if you get this error the calling code is wrong.) */
- TINFL_STATUS_BAD_PARAM = -3,
-
- /* This flags indicate the inflator is finished but the adler32 check of the uncompressed data didn't match. If you call it again it'll return TINFL_STATUS_DONE. */
- TINFL_STATUS_ADLER32_MISMATCH = -2,
-
- /* This flags indicate the inflator has somehow failed (bad code, corrupted input, etc.). If you call it again without resetting via tinfl_init() it it'll just keep on returning the same status failure code. */
- TINFL_STATUS_FAILED = -1,
-
- /* Any status code less than TINFL_STATUS_DONE must indicate a failure. */
-
- /* This flag indicates the inflator has returned every byte of uncompressed data that it can, has consumed every byte that it needed, has successfully reached the end of the deflate stream, and */
- /* if zlib headers and adler32 checking enabled that it has successfully checked the uncompressed data's adler32. If you call it again you'll just get TINFL_STATUS_DONE over and over again. */
- TINFL_STATUS_DONE = 0,
-
- /* This flag indicates the inflator MUST have more input data (even 1 byte) before it can make any more forward progress, or you need to clear the TINFL_FLAG_HAS_MORE_INPUT */
- /* flag on the next call if you don't have any more source data. If the source data was somehow corrupted it's also possible (but unlikely) for the inflator to keep on demanding input to */
- /* proceed, so be sure to properly set the TINFL_FLAG_HAS_MORE_INPUT flag. */
- TINFL_STATUS_NEEDS_MORE_INPUT = 1,
-
- /* This flag indicates the inflator definitely has 1 or more bytes of uncompressed data available, but it cannot write this data into the output buffer. */
- /* Note if the source compressed data was corrupted it's possible for the inflator to return a lot of uncompressed data to the caller. I've been assuming you know how much uncompressed data to expect */
- /* (either exact or worst case) and will stop calling the inflator and fail after receiving too much. In pure streaming scenarios where you have no idea how many bytes to expect this may not be possible */
- /* so I may need to add some code to address this. */
- TINFL_STATUS_HAS_MORE_OUTPUT = 2
-} tinfl_status;
-
-/* Initializes the decompressor to its initial state. */
-#define tinfl_init(r) \
- do \
- { \
- (r)->m_state = 0; \
- } \
- MZ_MACRO_END
-#define tinfl_get_adler32(r) (r)->m_check_adler32
-
-/* Main low-level decompressor coroutine function. This is the only function actually needed for decompression. All the other functions are just high-level helpers for improved usability. */
-/* This is a universal API, i.e. it can be used as a building block to build any desired higher level decompression API. In the limit case, it can be called once per every byte input or output. */
-MINIZ_EXPORT tinfl_status tinfl_decompress(tinfl_decompressor *r, const mz_uint8 *pIn_buf_next, size_t *pIn_buf_size, mz_uint8 *pOut_buf_start, mz_uint8 *pOut_buf_next, size_t *pOut_buf_size, const mz_uint32 decomp_flags);
-
-/* Internal/private bits follow. */
-enum
-{
- TINFL_MAX_HUFF_TABLES = 3,
- TINFL_MAX_HUFF_SYMBOLS_0 = 288,
- TINFL_MAX_HUFF_SYMBOLS_1 = 32,
- TINFL_MAX_HUFF_SYMBOLS_2 = 19,
- TINFL_FAST_LOOKUP_BITS = 10,
- TINFL_FAST_LOOKUP_SIZE = 1 << TINFL_FAST_LOOKUP_BITS
-};
-
-typedef struct
-{
- mz_uint8 m_code_size[TINFL_MAX_HUFF_SYMBOLS_0];
- mz_int16 m_look_up[TINFL_FAST_LOOKUP_SIZE], m_tree[TINFL_MAX_HUFF_SYMBOLS_0 * 2];
-} tinfl_huff_table;
-
-#if MINIZ_HAS_64BIT_REGISTERS
-#define TINFL_USE_64BIT_BITBUF 1
-#else
-#define TINFL_USE_64BIT_BITBUF 0
-#endif
-
-#if TINFL_USE_64BIT_BITBUF
-typedef mz_uint64 tinfl_bit_buf_t;
-#define TINFL_BITBUF_SIZE (64)
-#else
-typedef mz_uint32 tinfl_bit_buf_t;
-#define TINFL_BITBUF_SIZE (32)
-#endif
-
-struct tinfl_decompressor_tag
-{
- mz_uint32 m_state, m_num_bits, m_zhdr0, m_zhdr1, m_z_adler32, m_final, m_type, m_check_adler32, m_dist, m_counter, m_num_extra, m_table_sizes[TINFL_MAX_HUFF_TABLES];
- tinfl_bit_buf_t m_bit_buf;
- size_t m_dist_from_out_buf_start;
- tinfl_huff_table m_tables[TINFL_MAX_HUFF_TABLES];
- mz_uint8 m_raw_header[4], m_len_codes[TINFL_MAX_HUFF_SYMBOLS_0 + TINFL_MAX_HUFF_SYMBOLS_1 + 137];
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#pragma once
-
-
-/* ------------------- ZIP archive reading/writing */
-
-#ifndef MINIZ_NO_ARCHIVE_APIS
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-enum
-{
- /* Note: These enums can be reduced as needed to save memory or stack space - they are pretty conservative. */
- MZ_ZIP_MAX_IO_BUF_SIZE = 64 * 1024,
- MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE = 512,
- MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE = 512
-};
-
-typedef struct
-{
- /* Central directory file index. */
- mz_uint32 m_file_index;
-
- /* Byte offset of this entry in the archive's central directory. Note we currently only support up to UINT_MAX or less bytes in the central dir. */
- mz_uint64 m_central_dir_ofs;
-
- /* These fields are copied directly from the zip's central dir. */
- mz_uint16 m_version_made_by;
- mz_uint16 m_version_needed;
- mz_uint16 m_bit_flag;
- mz_uint16 m_method;
-
-#ifndef MINIZ_NO_TIME
- MZ_TIME_T m_time;
-#endif
-
- /* CRC-32 of uncompressed data. */
- mz_uint32 m_crc32;
-
- /* File's compressed size. */
- mz_uint64 m_comp_size;
-
- /* File's uncompressed size. Note, I've seen some old archives where directory entries had 512 bytes for their uncompressed sizes, but when you try to unpack them you actually get 0 bytes. */
- mz_uint64 m_uncomp_size;
-
- /* Zip internal and external file attributes. */
- mz_uint16 m_internal_attr;
- mz_uint32 m_external_attr;
-
- /* Entry's local header file offset in bytes. */
- mz_uint64 m_local_header_ofs;
-
- /* Size of comment in bytes. */
- mz_uint32 m_comment_size;
-
- /* MZ_TRUE if the entry appears to be a directory. */
- mz_bool m_is_directory;
-
- /* MZ_TRUE if the entry uses encryption/strong encryption (which miniz_zip doesn't support) */
- mz_bool m_is_encrypted;
-
- /* MZ_TRUE if the file is not encrypted, a patch file, and if it uses a compression method we support. */
- mz_bool m_is_supported;
-
- /* Filename. If string ends in '/' it's a subdirectory entry. */
- /* Guaranteed to be zero terminated, may be truncated to fit. */
- char m_filename[MZ_ZIP_MAX_ARCHIVE_FILENAME_SIZE];
-
- /* Comment field. */
- /* Guaranteed to be zero terminated, may be truncated to fit. */
- char m_comment[MZ_ZIP_MAX_ARCHIVE_FILE_COMMENT_SIZE];
-
-} mz_zip_archive_file_stat;
-
-typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, void *pBuf, size_t n);
-typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, const void *pBuf, size_t n);
-typedef mz_bool (*mz_file_needs_keepalive)(void *pOpaque);
-
-struct mz_zip_internal_state_tag;
-typedef struct mz_zip_internal_state_tag mz_zip_internal_state;
-
-typedef enum {
- MZ_ZIP_MODE_INVALID = 0,
- MZ_ZIP_MODE_READING = 1,
- MZ_ZIP_MODE_WRITING = 2,
- MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3
-} mz_zip_mode;
-
-typedef enum {
- MZ_ZIP_FLAG_CASE_SENSITIVE = 0x0100,
- MZ_ZIP_FLAG_IGNORE_PATH = 0x0200,
- MZ_ZIP_FLAG_COMPRESSED_DATA = 0x0400,
- MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY = 0x0800,
- MZ_ZIP_FLAG_VALIDATE_LOCATE_FILE_FLAG = 0x1000, /* if enabled, mz_zip_reader_locate_file() will be called on each file as its validated to ensure the func finds the file in the central dir (intended for testing) */
- MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY = 0x2000, /* validate the local headers, but don't decompress the entire file and check the crc32 */
- MZ_ZIP_FLAG_WRITE_ZIP64 = 0x4000, /* always use the zip64 file format, instead of the original zip file format with automatic switch to zip64. Use as flags parameter with mz_zip_writer_init*_v2 */
- MZ_ZIP_FLAG_WRITE_ALLOW_READING = 0x8000,
- MZ_ZIP_FLAG_ASCII_FILENAME = 0x10000,
- /*After adding a compressed file, seek back
- to local file header and set the correct sizes*/
- MZ_ZIP_FLAG_WRITE_HEADER_SET_SIZE = 0x20000
-} mz_zip_flags;
-
-typedef enum {
- MZ_ZIP_TYPE_INVALID = 0,
- MZ_ZIP_TYPE_USER,
- MZ_ZIP_TYPE_MEMORY,
- MZ_ZIP_TYPE_HEAP,
- MZ_ZIP_TYPE_FILE,
- MZ_ZIP_TYPE_CFILE,
- MZ_ZIP_TOTAL_TYPES
-} mz_zip_type;
-
-/* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or modify this enum. */
-typedef enum {
- MZ_ZIP_NO_ERROR = 0,
- MZ_ZIP_UNDEFINED_ERROR,
- MZ_ZIP_TOO_MANY_FILES,
- MZ_ZIP_FILE_TOO_LARGE,
- MZ_ZIP_UNSUPPORTED_METHOD,
- MZ_ZIP_UNSUPPORTED_ENCRYPTION,
- MZ_ZIP_UNSUPPORTED_FEATURE,
- MZ_ZIP_FAILED_FINDING_CENTRAL_DIR,
- MZ_ZIP_NOT_AN_ARCHIVE,
- MZ_ZIP_INVALID_HEADER_OR_CORRUPTED,
- MZ_ZIP_UNSUPPORTED_MULTIDISK,
- MZ_ZIP_DECOMPRESSION_FAILED,
- MZ_ZIP_COMPRESSION_FAILED,
- MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE,
- MZ_ZIP_CRC_CHECK_FAILED,
- MZ_ZIP_UNSUPPORTED_CDIR_SIZE,
- MZ_ZIP_ALLOC_FAILED,
- MZ_ZIP_FILE_OPEN_FAILED,
- MZ_ZIP_FILE_CREATE_FAILED,
- MZ_ZIP_FILE_WRITE_FAILED,
- MZ_ZIP_FILE_READ_FAILED,
- MZ_ZIP_FILE_CLOSE_FAILED,
- MZ_ZIP_FILE_SEEK_FAILED,
- MZ_ZIP_FILE_STAT_FAILED,
- MZ_ZIP_INVALID_PARAMETER,
- MZ_ZIP_INVALID_FILENAME,
- MZ_ZIP_BUF_TOO_SMALL,
- MZ_ZIP_INTERNAL_ERROR,
- MZ_ZIP_FILE_NOT_FOUND,
- MZ_ZIP_ARCHIVE_TOO_LARGE,
- MZ_ZIP_VALIDATION_FAILED,
- MZ_ZIP_WRITE_CALLBACK_FAILED,
- MZ_ZIP_TOTAL_ERRORS
-} mz_zip_error;
-
-typedef struct
-{
- mz_uint64 m_archive_size;
- mz_uint64 m_central_directory_file_ofs;
-
- /* We only support up to UINT32_MAX files in zip64 mode. */
- mz_uint32 m_total_files;
- mz_zip_mode m_zip_mode;
- mz_zip_type m_zip_type;
- mz_zip_error m_last_error;
-
- mz_uint64 m_file_offset_alignment;
-
- mz_alloc_func m_pAlloc;
- mz_free_func m_pFree;
- mz_realloc_func m_pRealloc;
- void *m_pAlloc_opaque;
-
- mz_file_read_func m_pRead;
- mz_file_write_func m_pWrite;
- mz_file_needs_keepalive m_pNeeds_keepalive;
- void *m_pIO_opaque;
-
- mz_zip_internal_state *m_pState;
-
-} mz_zip_archive;
-
-typedef struct
-{
- mz_zip_archive *pZip;
- mz_uint flags;
-
- int status;
-#ifndef MINIZ_DISABLE_ZIP_READER_CRC32_CHECKS
- mz_uint file_crc32;
-#endif
- mz_uint64 read_buf_size, read_buf_ofs, read_buf_avail, comp_remaining, out_buf_ofs, cur_file_ofs;
- mz_zip_archive_file_stat file_stat;
- void *pRead_buf;
- void *pWrite_buf;
-
- size_t out_blk_remain;
-
- tinfl_decompressor inflator;
-
-} mz_zip_reader_extract_iter_state;
-
-/* -------- ZIP reading */
-
-/* Inits a ZIP archive reader. */
-/* These functions read and validate the archive's central directory. */
-MINIZ_EXPORT mz_bool mz_zip_reader_init(mz_zip_archive *pZip, mz_uint64 size, mz_uint flags);
-
-MINIZ_EXPORT mz_bool mz_zip_reader_init_mem(mz_zip_archive *pZip, const void *pMem, size_t size, mz_uint flags);
-
-#ifndef MINIZ_NO_STDIO
-/* Read a archive from a disk file. */
-/* file_start_ofs is the file offset where the archive actually begins, or 0. */
-/* actual_archive_size is the true total size of the archive, which may be smaller than the file's actual size on disk. If zero the entire file is treated as the archive. */
-MINIZ_EXPORT mz_bool mz_zip_reader_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint32 flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags, mz_uint64 file_start_ofs, mz_uint64 archive_size);
-
-/* Read an archive from an already opened FILE, beginning at the current file position. */
-/* The archive is assumed to be archive_size bytes long. If archive_size is 0, then the entire rest of the file is assumed to contain the archive. */
-/* The FILE will NOT be closed when mz_zip_reader_end() is called. */
-MINIZ_EXPORT mz_bool mz_zip_reader_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint64 archive_size, mz_uint flags);
-#endif
-
-/* Ends archive reading, freeing all allocations, and closing the input archive file if mz_zip_reader_init_file() was used. */
-MINIZ_EXPORT mz_bool mz_zip_reader_end(mz_zip_archive *pZip);
-
-/* -------- ZIP reading or writing */
-
-/* Clears a mz_zip_archive struct to all zeros. */
-/* Important: This must be done before passing the struct to any mz_zip functions. */
-MINIZ_EXPORT void mz_zip_zero_struct(mz_zip_archive *pZip);
-
-MINIZ_EXPORT mz_zip_mode mz_zip_get_mode(mz_zip_archive *pZip);
-MINIZ_EXPORT mz_zip_type mz_zip_get_type(mz_zip_archive *pZip);
-
-/* Returns the total number of files in the archive. */
-MINIZ_EXPORT mz_uint mz_zip_reader_get_num_files(mz_zip_archive *pZip);
-
-MINIZ_EXPORT mz_uint64 mz_zip_get_archive_size(mz_zip_archive *pZip);
-MINIZ_EXPORT mz_uint64 mz_zip_get_archive_file_start_offset(mz_zip_archive *pZip);
-MINIZ_EXPORT MZ_FILE *mz_zip_get_cfile(mz_zip_archive *pZip);
-
-/* Reads n bytes of raw archive data, starting at file offset file_ofs, to pBuf. */
-MINIZ_EXPORT size_t mz_zip_read_archive_data(mz_zip_archive *pZip, mz_uint64 file_ofs, void *pBuf, size_t n);
-
-/* All mz_zip funcs set the m_last_error field in the mz_zip_archive struct. These functions retrieve/manipulate this field. */
-/* Note that the m_last_error functionality is not thread safe. */
-MINIZ_EXPORT mz_zip_error mz_zip_set_last_error(mz_zip_archive *pZip, mz_zip_error err_num);
-MINIZ_EXPORT mz_zip_error mz_zip_peek_last_error(mz_zip_archive *pZip);
-MINIZ_EXPORT mz_zip_error mz_zip_clear_last_error(mz_zip_archive *pZip);
-MINIZ_EXPORT mz_zip_error mz_zip_get_last_error(mz_zip_archive *pZip);
-MINIZ_EXPORT const char *mz_zip_get_error_string(mz_zip_error mz_err);
-
-/* MZ_TRUE if the archive file entry is a directory entry. */
-MINIZ_EXPORT mz_bool mz_zip_reader_is_file_a_directory(mz_zip_archive *pZip, mz_uint file_index);
-
-/* MZ_TRUE if the file is encrypted/strong encrypted. */
-MINIZ_EXPORT mz_bool mz_zip_reader_is_file_encrypted(mz_zip_archive *pZip, mz_uint file_index);
-
-/* MZ_TRUE if the compression method is supported, and the file is not encrypted, and the file is not a compressed patch file. */
-MINIZ_EXPORT mz_bool mz_zip_reader_is_file_supported(mz_zip_archive *pZip, mz_uint file_index);
-
-/* Retrieves the filename of an archive file entry. */
-/* Returns the number of bytes written to pFilename, or if filename_buf_size is 0 this function returns the number of bytes needed to fully store the filename. */
-MINIZ_EXPORT mz_uint mz_zip_reader_get_filename(mz_zip_archive *pZip, mz_uint file_index, char *pFilename, mz_uint filename_buf_size);
-
-/* Attempts to locates a file in the archive's central directory. */
-/* Valid flags: MZ_ZIP_FLAG_CASE_SENSITIVE, MZ_ZIP_FLAG_IGNORE_PATH */
-/* Returns -1 if the file cannot be found. */
-MINIZ_EXPORT int mz_zip_reader_locate_file(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_locate_file_v2(mz_zip_archive *pZip, const char *pName, const char *pComment, mz_uint flags, mz_uint32 *file_index);
-
-/* Returns detailed information about an archive file entry. */
-MINIZ_EXPORT mz_bool mz_zip_reader_file_stat(mz_zip_archive *pZip, mz_uint file_index, mz_zip_archive_file_stat *pStat);
-
-/* MZ_TRUE if the file is in zip64 format. */
-/* A file is considered zip64 if it contained a zip64 end of central directory marker, or if it contained any zip64 extended file information fields in the central directory. */
-MINIZ_EXPORT mz_bool mz_zip_is_zip64(mz_zip_archive *pZip);
-
-/* Returns the total central directory size in bytes. */
-/* The current max supported size is <= MZ_UINT32_MAX. */
-MINIZ_EXPORT size_t mz_zip_get_central_dir_size(mz_zip_archive *pZip);
-
-/* Extracts a archive file to a memory buffer using no memory allocation. */
-/* There must be at least enough room on the stack to store the inflator's state (~34KB or so). */
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_mem_no_alloc(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_mem_no_alloc(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags, void *pUser_read_buf, size_t user_read_buf_size);
-
-/* Extracts a archive file to a memory buffer. */
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_mem(mz_zip_archive *pZip, mz_uint file_index, void *pBuf, size_t buf_size, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_mem(mz_zip_archive *pZip, const char *pFilename, void *pBuf, size_t buf_size, mz_uint flags);
-
-/* Extracts a archive file to a dynamically allocated heap buffer. */
-/* The memory will be allocated via the mz_zip_archive's alloc/realloc functions. */
-/* Returns NULL and sets the last error on failure. */
-MINIZ_EXPORT void *mz_zip_reader_extract_to_heap(mz_zip_archive *pZip, mz_uint file_index, size_t *pSize, mz_uint flags);
-MINIZ_EXPORT void *mz_zip_reader_extract_file_to_heap(mz_zip_archive *pZip, const char *pFilename, size_t *pSize, mz_uint flags);
-
-/* Extracts a archive file using a callback function to output the file's data. */
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_callback(mz_zip_archive *pZip, mz_uint file_index, mz_file_write_func pCallback, void *pOpaque, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_callback(mz_zip_archive *pZip, const char *pFilename, mz_file_write_func pCallback, void *pOpaque, mz_uint flags);
-
-/* Extract a file iteratively */
-MINIZ_EXPORT mz_zip_reader_extract_iter_state* mz_zip_reader_extract_iter_new(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags);
-MINIZ_EXPORT mz_zip_reader_extract_iter_state* mz_zip_reader_extract_file_iter_new(mz_zip_archive *pZip, const char *pFilename, mz_uint flags);
-MINIZ_EXPORT size_t mz_zip_reader_extract_iter_read(mz_zip_reader_extract_iter_state* pState, void* pvBuf, size_t buf_size);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_iter_free(mz_zip_reader_extract_iter_state* pState);
-
-#ifndef MINIZ_NO_STDIO
-/* Extracts a archive file to a disk file and sets its last accessed and modified times. */
-/* This function only extracts files, not archive directory records. */
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_file(mz_zip_archive *pZip, mz_uint file_index, const char *pDst_filename, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_file(mz_zip_archive *pZip, const char *pArchive_filename, const char *pDst_filename, mz_uint flags);
-
-/* Extracts a archive file starting at the current position in the destination FILE stream. */
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_to_cfile(mz_zip_archive *pZip, mz_uint file_index, MZ_FILE *File, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_reader_extract_file_to_cfile(mz_zip_archive *pZip, const char *pArchive_filename, MZ_FILE *pFile, mz_uint flags);
-#endif
-
-#if 0
-/* TODO */
- typedef void *mz_zip_streaming_extract_state_ptr;
- mz_zip_streaming_extract_state_ptr mz_zip_streaming_extract_begin(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags);
- uint64_t mz_zip_streaming_extract_get_size(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
- uint64_t mz_zip_streaming_extract_get_cur_ofs(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
- mz_bool mz_zip_streaming_extract_seek(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, uint64_t new_ofs);
- size_t mz_zip_streaming_extract_read(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState, void *pBuf, size_t buf_size);
- mz_bool mz_zip_streaming_extract_end(mz_zip_archive *pZip, mz_zip_streaming_extract_state_ptr pState);
-#endif
-
-/* This function compares the archive's local headers, the optional local zip64 extended information block, and the optional descriptor following the compressed data vs. the data in the central directory. */
-/* It also validates that each file can be successfully uncompressed unless the MZ_ZIP_FLAG_VALIDATE_HEADERS_ONLY is specified. */
-MINIZ_EXPORT mz_bool mz_zip_validate_file(mz_zip_archive *pZip, mz_uint file_index, mz_uint flags);
-
-/* Validates an entire archive by calling mz_zip_validate_file() on each file. */
-MINIZ_EXPORT mz_bool mz_zip_validate_archive(mz_zip_archive *pZip, mz_uint flags);
-
-/* Misc utils/helpers, valid for ZIP reading or writing */
-MINIZ_EXPORT mz_bool mz_zip_validate_mem_archive(const void *pMem, size_t size, mz_uint flags, mz_zip_error *pErr);
-MINIZ_EXPORT mz_bool mz_zip_validate_file_archive(const char *pFilename, mz_uint flags, mz_zip_error *pErr);
-
-/* Universal end function - calls either mz_zip_reader_end() or mz_zip_writer_end(). */
-MINIZ_EXPORT mz_bool mz_zip_end(mz_zip_archive *pZip);
-
-/* -------- ZIP writing */
-
-#ifndef MINIZ_NO_ARCHIVE_WRITING_APIS
-
-/* Inits a ZIP archive writer. */
-/*Set pZip->m_pWrite (and pZip->m_pIO_opaque) before calling mz_zip_writer_init or mz_zip_writer_init_v2*/
-/*The output is streamable, i.e. file_ofs in mz_file_write_func always increases only by n*/
-MINIZ_EXPORT mz_bool mz_zip_writer_init(mz_zip_archive *pZip, mz_uint64 existing_size);
-MINIZ_EXPORT mz_bool mz_zip_writer_init_v2(mz_zip_archive *pZip, mz_uint64 existing_size, mz_uint flags);
-
-MINIZ_EXPORT mz_bool mz_zip_writer_init_heap(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size);
-MINIZ_EXPORT mz_bool mz_zip_writer_init_heap_v2(mz_zip_archive *pZip, size_t size_to_reserve_at_beginning, size_t initial_allocation_size, mz_uint flags);
-
-#ifndef MINIZ_NO_STDIO
-MINIZ_EXPORT mz_bool mz_zip_writer_init_file(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning);
-MINIZ_EXPORT mz_bool mz_zip_writer_init_file_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint64 size_to_reserve_at_beginning, mz_uint flags);
-MINIZ_EXPORT mz_bool mz_zip_writer_init_cfile(mz_zip_archive *pZip, MZ_FILE *pFile, mz_uint flags);
-#endif
-
-/* Converts a ZIP archive reader object into a writer object, to allow efficient in-place file appends to occur on an existing archive. */
-/* For archives opened using mz_zip_reader_init_file, pFilename must be the archive's filename so it can be reopened for writing. If the file can't be reopened, mz_zip_reader_end() will be called. */
-/* For archives opened using mz_zip_reader_init_mem, the memory block must be growable using the realloc callback (which defaults to realloc unless you've overridden it). */
-/* Finally, for archives opened using mz_zip_reader_init, the mz_zip_archive's user provided m_pWrite function cannot be NULL. */
-/* Note: In-place archive modification is not recommended unless you know what you're doing, because if execution stops or something goes wrong before */
-/* the archive is finalized the file's central directory will be hosed. */
-MINIZ_EXPORT mz_bool mz_zip_writer_init_from_reader(mz_zip_archive *pZip, const char *pFilename);
-MINIZ_EXPORT mz_bool mz_zip_writer_init_from_reader_v2(mz_zip_archive *pZip, const char *pFilename, mz_uint flags);
-
-/* Adds the contents of a memory buffer to an archive. These functions record the current local time into the archive. */
-/* To add a directory entry, call this method with an archive name ending in a forwardslash with an empty buffer. */
-/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
-MINIZ_EXPORT mz_bool mz_zip_writer_add_mem(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, mz_uint level_and_flags);
-
-/* Like mz_zip_writer_add_mem(), except you can specify a file comment field, and optionally supply the function with already compressed data. */
-/* uncomp_size/uncomp_crc32 are only used if the MZ_ZIP_FLAG_COMPRESSED_DATA flag is specified. */
-MINIZ_EXPORT mz_bool mz_zip_writer_add_mem_ex(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
- mz_uint64 uncomp_size, mz_uint32 uncomp_crc32);
-
-MINIZ_EXPORT mz_bool mz_zip_writer_add_mem_ex_v2(mz_zip_archive *pZip, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags,
- mz_uint64 uncomp_size, mz_uint32 uncomp_crc32, MZ_TIME_T *last_modified, const char *user_extra_data_local, mz_uint user_extra_data_local_len,
- const char *user_extra_data_central, mz_uint user_extra_data_central_len);
-
-/* Adds the contents of a file to an archive. This function also records the disk file's modified time into the archive. */
-/* File data is supplied via a read callback function. User mz_zip_writer_add_(c)file to add a file directly.*/
-MINIZ_EXPORT mz_bool mz_zip_writer_add_read_buf_callback(mz_zip_archive *pZip, const char *pArchive_name, mz_file_read_func read_callback, void* callback_opaque, mz_uint64 max_size,
- const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len,
- const char *user_extra_data_central, mz_uint user_extra_data_central_len);
-
-
-#ifndef MINIZ_NO_STDIO
-/* Adds the contents of a disk file to an archive. This function also records the disk file's modified time into the archive. */
-/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
-MINIZ_EXPORT mz_bool mz_zip_writer_add_file(mz_zip_archive *pZip, const char *pArchive_name, const char *pSrc_filename, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
-
-/* Like mz_zip_writer_add_file(), except the file data is read from the specified FILE stream. */
-MINIZ_EXPORT mz_bool mz_zip_writer_add_cfile(mz_zip_archive *pZip, const char *pArchive_name, MZ_FILE *pSrc_file, mz_uint64 max_size,
- const MZ_TIME_T *pFile_time, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, const char *user_extra_data_local, mz_uint user_extra_data_local_len,
- const char *user_extra_data_central, mz_uint user_extra_data_central_len);
-#endif
-
-/* Adds a file to an archive by fully cloning the data from another archive. */
-/* This function fully clones the source file's compressed data (no recompression), along with its full filename, extra data (it may add or modify the zip64 local header extra data field), and the optional descriptor following the compressed data. */
-MINIZ_EXPORT mz_bool mz_zip_writer_add_from_zip_reader(mz_zip_archive *pZip, mz_zip_archive *pSource_zip, mz_uint src_file_index);
-
-/* Finalizes the archive by writing the central directory records followed by the end of central directory record. */
-/* After an archive is finalized, the only valid call on the mz_zip_archive struct is mz_zip_writer_end(). */
-/* An archive must be manually finalized by calling this function for it to be valid. */
-MINIZ_EXPORT mz_bool mz_zip_writer_finalize_archive(mz_zip_archive *pZip);
-
-/* Finalizes a heap archive, returning a poiner to the heap block and its size. */
-/* The heap block will be allocated using the mz_zip_archive's alloc/realloc callbacks. */
-MINIZ_EXPORT mz_bool mz_zip_writer_finalize_heap_archive(mz_zip_archive *pZip, void **ppBuf, size_t *pSize);
-
-/* Ends archive writing, freeing all allocations, and closing the output file if mz_zip_writer_init_file() was used. */
-/* Note for the archive to be valid, it *must* have been finalized before ending (this function will not do it for you). */
-MINIZ_EXPORT mz_bool mz_zip_writer_end(mz_zip_archive *pZip);
-
-/* -------- Misc. high-level helper functions: */
-
-/* mz_zip_add_mem_to_archive_file_in_place() efficiently (but not atomically) appends a memory blob to a ZIP archive. */
-/* Note this is NOT a fully safe operation. If it crashes or dies in some way your archive can be left in a screwed up state (without a central directory). */
-/* level_and_flags - compression level (0-10, see MZ_BEST_SPEED, MZ_BEST_COMPRESSION, etc.) logically OR'd with zero or more mz_zip_flags, or just set to MZ_DEFAULT_COMPRESSION. */
-/* TODO: Perhaps add an option to leave the existing central dir in place in case the add dies? We could then truncate the file (so the old central dir would be at the end) if something goes wrong. */
-MINIZ_EXPORT mz_bool mz_zip_add_mem_to_archive_file_in_place(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags);
-MINIZ_EXPORT mz_bool mz_zip_add_mem_to_archive_file_in_place_v2(const char *pZip_filename, const char *pArchive_name, const void *pBuf, size_t buf_size, const void *pComment, mz_uint16 comment_size, mz_uint level_and_flags, mz_zip_error *pErr);
-
-/* Reads a single file from an archive into a heap block. */
-/* If pComment is not NULL, only the file with the specified comment will be extracted. */
-/* Returns NULL on failure. */
-MINIZ_EXPORT void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char *pArchive_name, size_t *pSize, mz_uint flags);
-MINIZ_EXPORT void *mz_zip_extract_archive_file_to_heap_v2(const char *pZip_filename, const char *pArchive_name, const char *pComment, size_t *pSize, mz_uint flags, mz_zip_error *pErr);
-
-#endif /* #ifndef MINIZ_NO_ARCHIVE_WRITING_APIS */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* MINIZ_NO_ARCHIVE_APIS */
diff --git a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/readme.md b/graphics/asymptote/cudareflect/tinyexr/deps/miniz/readme.md
deleted file mode 100644
index 3f8fd73247..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/deps/miniz/readme.md
+++ /dev/null
@@ -1,34 +0,0 @@
-## Miniz
-
-Miniz is a lossless, high performance data compression library in a single source file that implements the zlib (RFC 1950) and Deflate (RFC 1951) compressed data format specification standards. It supports the most commonly used functions exported by the zlib library, but is a completely independent implementation so zlib's licensing requirements do not apply. Miniz also contains simple to use functions for writing .PNG format image files and reading/writing/appending .ZIP format archives. Miniz's compression speed has been tuned to be comparable to zlib's, and it also has a specialized real-time compressor function designed to compare well against fastlz/minilzo.
-
-## Usage
-
-Please use the files from the [releases page](https://github.com/richgel999/miniz/releases) in your projects. Do not use the git checkout directly! The different source and header files are [amalgamated](https://www.sqlite.org/amalgamation.html) into one `miniz.c`/`miniz.h` pair in a build step (`amalgamate.sh`). Include `miniz.c` and `miniz.h` in your project to use Miniz.
-
-## Features
-
-* MIT licensed
-* A portable, single source and header file library written in plain C. Tested with GCC, clang and Visual Studio.
-* Easily tuned and trimmed down by defines
-* A drop-in replacement for zlib's most used API's (tested in several open source projects that use zlib, such as libpng and libzip).
-* Fills a single threaded performance vs. compression ratio gap between several popular real-time compressors and zlib. For example, at level 1, miniz.c compresses around 5-9% better than minilzo, but is approx. 35% slower. At levels 2-9, miniz.c is designed to compare favorably against zlib's ratio and speed. See the miniz performance comparison page for example timings.
-* Not a block based compressor: miniz.c fully supports stream based processing using a coroutine-style implementation. The zlib-style API functions can be called a single byte at a time if that's all you've got.
-* Easy to use. The low-level compressor (tdefl) and decompressor (tinfl) have simple state structs which can be saved/restored as needed with simple memcpy's. The low-level codec API's don't use the heap in any way.
-* Entire inflater (including optional zlib header parsing and Adler-32 checking) is implemented in a single function as a coroutine, which is separately available in a small (~550 line) source file: miniz_tinfl.c
-* A fairly complete (but totally optional) set of .ZIP archive manipulation and extraction API's. The archive functionality is intended to solve common problems encountered in embedded, mobile, or game development situations. (The archive API's are purposely just powerful enough to write an entire archiver given a bit of additional higher-level logic.)
-
-## Known Problems
-
-* No support for encrypted archives. Not sure how useful this stuff is in practice.
-* Minimal documentation. The assumption is that the user is already familiar with the basic zlib API. I need to write an API wiki - for now I've tried to place key comments before each enum/API, and I've included 6 examples that demonstrate how to use the module's major features.
-
-## Special Thanks
-
-Thanks to Alex Evans for the PNG writer function. Also, thanks to Paul Holden and Thorsten Scheuermann for feedback and testing, Matt Pritchard for all his encouragement, and Sean Barrett's various public domain libraries for inspiration (and encouraging me to write miniz.c in C, which was much more enjoyable and less painful than I thought it would be considering I've been programming in C++ for so long).
-
-Thanks to Bruce Dawson for reporting a problem with the level_and_flags archive API parameter (which is fixed in v1.12) and general feedback, and Janez Zemva for indirectly encouraging me into writing more examples.
-
-## Patents
-
-I was recently asked if miniz avoids patent issues. miniz purposely uses the same core algorithms as the ones used by zlib. The compressor uses vanilla hash chaining as described [here](https://datatracker.ietf.org/doc/html/rfc1951#section-4). Also see the [gzip FAQ](https://web.archive.org/web/20160308045258/http://www.gzip.org/#faq11). In my opinion, if miniz falls prey to a patent attack then zlib/gzip are likely to be at serious risk too.
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/common/cxxopts.hpp b/graphics/asymptote/cudareflect/tinyexr/examples/common/cxxopts.hpp
deleted file mode 100644
index 6a6a85f035..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/common/cxxopts.hpp
+++ /dev/null
@@ -1,1988 +0,0 @@
-/*
-
-Copyright (c) 2014, 2015, 2016, 2017 Jarryd Beck
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-
-*/
-
-#ifndef CXXOPTS_HPP_INCLUDED
-#define CXXOPTS_HPP_INCLUDED
-
-#include <cstring>
-#include <cctype>
-#include <exception>
-#include <iostream>
-#include <map>
-#include <memory>
-#include <regex>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-
-namespace cxxopts
-{
- static constexpr struct {
- uint8_t major, minor, patch;
- } version = {2, 1, 0};
-}
-
-//when we ask cxxopts to use Unicode, help strings are processed using ICU,
-//which results in the correct lengths being computed for strings when they
-//are formatted for the help output
-//it is necessary to make sure that <unicode/unistr.h> can be found by the
-//compiler, and that icu-uc is linked in to the binary.
-
-#ifdef CXXOPTS_USE_UNICODE
-#include <unicode/unistr.h>
-
-namespace cxxopts
-{
- typedef icu::UnicodeString String;
-
- inline
- String
- toLocalString(std::string s)
- {
- return icu::UnicodeString::fromUTF8(std::move(s));
- }
-
- class UnicodeStringIterator : public
- std::iterator<std::forward_iterator_tag, int32_t>
- {
- public:
-
- UnicodeStringIterator(const icu::UnicodeString* string, int32_t pos)
- : s(string)
- , i(pos)
- {
- }
-
- value_type
- operator*() const
- {
- return s->char32At(i);
- }
-
- bool
- operator==(const UnicodeStringIterator& rhs) const
- {
- return s == rhs.s && i == rhs.i;
- }
-
- bool
- operator!=(const UnicodeStringIterator& rhs) const
- {
- return !(*this == rhs);
- }
-
- UnicodeStringIterator&
- operator++()
- {
- ++i;
- return *this;
- }
-
- UnicodeStringIterator
- operator+(int32_t v)
- {
- return UnicodeStringIterator(s, i + v);
- }
-
- private:
- const icu::UnicodeString* s;
- int32_t i;
- };
-
- inline
- String&
- stringAppend(String&s, String a)
- {
- return s.append(std::move(a));
- }
-
- inline
- String&
- stringAppend(String& s, int n, UChar32 c)
- {
- for (int i = 0; i != n; ++i)
- {
- s.append(c);
- }
-
- return s;
- }
-
- template <typename Iterator>
- String&
- stringAppend(String& s, Iterator begin, Iterator end)
- {
- while (begin != end)
- {
- s.append(*begin);
- ++begin;
- }
-
- return s;
- }
-
- inline
- size_t
- stringLength(const String& s)
- {
- return s.length();
- }
-
- inline
- std::string
- toUTF8String(const String& s)
- {
- std::string result;
- s.toUTF8String(result);
-
- return result;
- }
-
- inline
- bool
- empty(const String& s)
- {
- return s.isEmpty();
- }
-}
-
-namespace std
-{
- inline
- cxxopts::UnicodeStringIterator
- begin(const icu::UnicodeString& s)
- {
- return cxxopts::UnicodeStringIterator(&s, 0);
- }
-
- inline
- cxxopts::UnicodeStringIterator
- end(const icu::UnicodeString& s)
- {
- return cxxopts::UnicodeStringIterator(&s, s.length());
- }
-}
-
-//ifdef CXXOPTS_USE_UNICODE
-#else
-
-namespace cxxopts
-{
- typedef std::string String;
-
- template <typename T>
- T
- toLocalString(T&& t)
- {
- return t;
- }
-
- inline
- size_t
- stringLength(const String& s)
- {
- return s.length();
- }
-
- inline
- String&
- stringAppend(String&s, String a)
- {
- return s.append(std::move(a));
- }
-
- inline
- String&
- stringAppend(String& s, size_t n, char c)
- {
- return s.append(n, c);
- }
-
- template <typename Iterator>
- String&
- stringAppend(String& s, Iterator begin, Iterator end)
- {
- return s.append(begin, end);
- }
-
- template <typename T>
- std::string
- toUTF8String(T&& t)
- {
- return std::forward<T>(t);
- }
-
- inline
- bool
- empty(const std::string& s)
- {
- return s.empty();
- }
-}
-
-//ifdef CXXOPTS_USE_UNICODE
-#endif
-
-namespace cxxopts
-{
- namespace
- {
-#ifdef _WIN32
- const std::string LQUOTE("\'");
- const std::string RQUOTE("\'");
-#else
- const std::string LQUOTE("‘");
- const std::string RQUOTE("’");
-#endif
- }
-
- class Value : public std::enable_shared_from_this<Value>
- {
- public:
-
- virtual ~Value() = default;
-
- virtual
- std::shared_ptr<Value>
- clone() const = 0;
-
- virtual void
- parse(const std::string& text) const = 0;
-
- virtual void
- parse() const = 0;
-
- virtual bool
- has_default() const = 0;
-
- virtual bool
- is_container() const = 0;
-
- virtual bool
- has_implicit() const = 0;
-
- virtual std::string
- get_default_value() const = 0;
-
- virtual std::string
- get_implicit_value() const = 0;
-
- virtual std::shared_ptr<Value>
- default_value(const std::string& value) = 0;
-
- virtual std::shared_ptr<Value>
- implicit_value(const std::string& value) = 0;
-
- virtual bool
- is_boolean() const = 0;
- };
-
- class OptionException : public std::exception
- {
- public:
- OptionException(const std::string& message)
- : m_message(message)
- {
- }
-
- virtual const char*
- what() const noexcept
- {
- return m_message.c_str();
- }
-
- private:
- std::string m_message;
- };
-
- class OptionSpecException : public OptionException
- {
- public:
-
- OptionSpecException(const std::string& message)
- : OptionException(message)
- {
- }
- };
-
- class OptionParseException : public OptionException
- {
- public:
- OptionParseException(const std::string& message)
- : OptionException(message)
- {
- }
- };
-
- class option_exists_error : public OptionSpecException
- {
- public:
- option_exists_error(const std::string& option)
- : OptionSpecException(u8"Option " + LQUOTE + option + RQUOTE + u8" already exists")
- {
- }
- };
-
- class invalid_option_format_error : public OptionSpecException
- {
- public:
- invalid_option_format_error(const std::string& format)
- : OptionSpecException(u8"Invalid option format " + LQUOTE + format + RQUOTE)
- {
- }
- };
-
- class option_not_exists_exception : public OptionParseException
- {
- public:
- option_not_exists_exception(const std::string& option)
- : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" does not exist")
- {
- }
- };
-
- class missing_argument_exception : public OptionParseException
- {
- public:
- missing_argument_exception(const std::string& option)
- : OptionParseException(
- u8"Option " + LQUOTE + option + RQUOTE + u8" is missing an argument"
- )
- {
- }
- };
-
- class option_requires_argument_exception : public OptionParseException
- {
- public:
- option_requires_argument_exception(const std::string& option)
- : OptionParseException(
- u8"Option " + LQUOTE + option + RQUOTE + u8" requires an argument"
- )
- {
- }
- };
-
- class option_not_has_argument_exception : public OptionParseException
- {
- public:
- option_not_has_argument_exception
- (
- const std::string& option,
- const std::string& arg
- )
- : OptionParseException(
- u8"Option " + LQUOTE + option + RQUOTE +
- u8" does not take an argument, but argument " +
- LQUOTE + arg + RQUOTE + " given"
- )
- {
- }
- };
-
- class option_not_present_exception : public OptionParseException
- {
- public:
- option_not_present_exception(const std::string& option)
- : OptionParseException(u8"Option " + LQUOTE + option + RQUOTE + u8" not present")
- {
- }
- };
-
- class argument_incorrect_type : public OptionParseException
- {
- public:
- argument_incorrect_type
- (
- const std::string& arg
- )
- : OptionParseException(
- u8"Argument " + LQUOTE + arg + RQUOTE + u8" failed to parse"
- )
- {
- }
- };
-
- class option_required_exception : public OptionParseException
- {
- public:
- option_required_exception(const std::string& option)
- : OptionParseException(
- u8"Option " + LQUOTE + option + RQUOTE + u8" is required but not present"
- )
- {
- }
- };
-
- namespace values
- {
- namespace
- {
- std::basic_regex<char> integer_pattern
- ("(-)?(0x)?([1-9a-zA-Z][0-9a-zA-Z]*)|((0x)?0)");
- std::basic_regex<char> truthy_pattern
- ("(t|T)(rue)?");
- std::basic_regex<char> falsy_pattern
- ("((f|F)(alse)?)?");
- }
-
- namespace detail
- {
- template <typename T, bool B>
- struct SignedCheck;
-
- template <typename T>
- struct SignedCheck<T, true>
- {
- template <typename U>
- void
- operator()(bool negative, U u, const std::string& text)
- {
- if (negative)
- {
- if (u > static_cast<U>(-std::numeric_limits<T>::min()))
- {
- throw argument_incorrect_type(text);
- }
- }
- else
- {
- if (u > static_cast<U>(std::numeric_limits<T>::max()))
- {
- throw argument_incorrect_type(text);
- }
- }
- }
- };
-
- template <typename T>
- struct SignedCheck<T, false>
- {
- template <typename U>
- void
- operator()(bool, U, const std::string&) {}
- };
-
- template <typename T, typename U>
- void
- check_signed_range(bool negative, U value, const std::string& text)
- {
- SignedCheck<T, std::numeric_limits<T>::is_signed>()(negative, value, text);
- }
- }
-
- template <typename R, typename T>
- R
- checked_negate(T&& t, const std::string&, std::true_type)
- {
- // if we got to here, then `t` is a positive number that fits into
- // `R`. So to avoid MSVC C4146, we first cast it to `R`.
- // See https://github.com/jarro2783/cxxopts/issues/62 for more details.
- return -static_cast<R>(t);
- }
-
- template <typename R, typename T>
- T
- checked_negate(T&&, const std::string& text, std::false_type)
- {
- throw argument_incorrect_type(text);
- }
-
- template <typename T>
- void
- integer_parser(const std::string& text, T& value)
- {
- std::smatch match;
- std::regex_match(text, match, integer_pattern);
-
- if (match.length() == 0)
- {
- throw argument_incorrect_type(text);
- }
-
- if (match.length(4) > 0)
- {
- value = 0;
- return;
- }
-
- using US = typename std::make_unsigned<T>::type;
-
- constexpr auto umax = std::numeric_limits<US>::max();
- constexpr bool is_signed = std::numeric_limits<T>::is_signed;
- const bool negative = match.length(1) > 0;
- const uint8_t base = match.length(2) > 0 ? 16 : 10;
-
- auto value_match = match[3];
-
- US result = 0;
-
- for (auto iter = value_match.first; iter != value_match.second; ++iter)
- {
- size_t digit = 0;
-
- if (*iter >= '0' && *iter <= '9')
- {
- digit = *iter - '0';
- }
- else if (base == 16 && *iter >= 'a' && *iter <= 'f')
- {
- digit = *iter - 'a' + 10;
- }
- else if (base == 16 && *iter >= 'A' && *iter <= 'F')
- {
- digit = *iter - 'A' + 10;
- }
- else
- {
- throw argument_incorrect_type(text);
- }
-
- if (umax - digit < result * base)
- {
- throw argument_incorrect_type(text);
- }
-
- result = result * base + digit;
- }
-
- detail::check_signed_range<T>(negative, result, text);
-
- if (negative)
- {
- value = checked_negate<T>(result,
- text,
- std::integral_constant<bool, is_signed>());
- }
- else
- {
- value = result;
- }
- }
-
- template <typename T>
- void stringstream_parser(const std::string& text, T& value)
- {
- std::stringstream in(text);
- in >> value;
- if (!in) {
- throw argument_incorrect_type(text);
- }
- }
-
- inline
- void
- parse_value(const std::string& text, uint8_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, int8_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, uint16_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, int16_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, uint32_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, int32_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, uint64_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, int64_t& value)
- {
- integer_parser(text, value);
- }
-
- inline
- void
- parse_value(const std::string& text, bool& value)
- {
- std::smatch result;
- std::regex_match(text, result, truthy_pattern);
-
- if (!result.empty())
- {
- value = true;
- return;
- }
-
- std::regex_match(text, result, falsy_pattern);
- if (!result.empty())
- {
- value = false;
- return;
- }
-
- throw argument_incorrect_type(text);
- }
-
- inline
- void
- parse_value(const std::string& text, std::string& value)
- {
- value = text;
- }
-
- // The fallback parser. It uses the stringstream parser to parse all types
- // that have not been overloaded explicitly. It has to be placed in the
- // source code before all other more specialized templates.
- template <typename T>
- void
- parse_value(const std::string& text, T& value) {
- stringstream_parser(text, value);
- }
-
- template <typename T>
- void
- parse_value(const std::string& text, std::vector<T>& value)
- {
- T v;
- parse_value(text, v);
- value.push_back(v);
- }
-
- template <typename T>
- struct type_is_container
- {
- static constexpr bool value = false;
- };
-
- template <typename T>
- struct type_is_container<std::vector<T>>
- {
- static constexpr bool value = true;
- };
-
- template <typename T>
- class abstract_value : public Value
- {
- using Self = abstract_value<T>;
-
- public:
- abstract_value()
- : m_result(std::make_shared<T>())
- , m_store(m_result.get())
- {
- }
-
- abstract_value(T* t)
- : m_store(t)
- {
- }
-
- virtual ~abstract_value() = default;
-
- abstract_value(const abstract_value& rhs)
- {
- if (rhs.m_result)
- {
- m_result = std::make_shared<T>();
- m_store = m_result.get();
- }
- else
- {
- m_store = rhs.m_store;
- }
-
- m_default = rhs.m_default;
- m_implicit = rhs.m_implicit;
- m_default_value = rhs.m_default_value;
- m_implicit_value = rhs.m_implicit_value;
- }
-
- void
- parse(const std::string& text) const
- {
- parse_value(text, *m_store);
- }
-
- bool
- is_container() const
- {
- return type_is_container<T>::value;
- }
-
- void
- parse() const
- {
- parse_value(m_default_value, *m_store);
- }
-
- bool
- has_default() const
- {
- return m_default;
- }
-
- bool
- has_implicit() const
- {
- return m_implicit;
- }
-
- std::shared_ptr<Value>
- default_value(const std::string& value)
- {
- m_default = true;
- m_default_value = value;
- return shared_from_this();
- }
-
- std::shared_ptr<Value>
- implicit_value(const std::string& value)
- {
- m_implicit = true;
- m_implicit_value = value;
- return shared_from_this();
- }
-
- std::string
- get_default_value() const
- {
- return m_default_value;
- }
-
- std::string
- get_implicit_value() const
- {
- return m_implicit_value;
- }
-
- bool
- is_boolean() const
- {
- return std::is_same<T, bool>::value;
- }
-
- const T&
- get() const
- {
- if (m_store == nullptr)
- {
- return *m_result;
- }
- else
- {
- return *m_store;
- }
- }
-
- protected:
- std::shared_ptr<T> m_result;
- T* m_store;
-
- bool m_default = false;
- bool m_implicit = false;
-
- std::string m_default_value;
- std::string m_implicit_value;
- };
-
- template <typename T>
- class standard_value : public abstract_value<T>
- {
- public:
- using abstract_value<T>::abstract_value;
-
- std::shared_ptr<Value>
- clone() const
- {
- return std::make_shared<standard_value<T>>(*this);
- }
- };
-
- template <>
- class standard_value<bool> : public abstract_value<bool>
- {
- public:
- ~standard_value() = default;
-
- standard_value()
- {
- set_implicit();
- }
-
- standard_value(bool* b)
- : abstract_value(b)
- {
- set_implicit();
- }
-
- std::shared_ptr<Value>
- clone() const
- {
- return std::make_shared<standard_value<bool>>(*this);
- }
-
- private:
-
- void
- set_implicit()
- {
- m_implicit = true;
- m_implicit_value = "true";
- }
- };
- }
-
- template <typename T>
- std::shared_ptr<Value>
- value()
- {
- return std::make_shared<values::standard_value<T>>();
- }
-
- template <typename T>
- std::shared_ptr<Value>
- value(T& t)
- {
- return std::make_shared<values::standard_value<T>>(&t);
- }
-
- class OptionAdder;
-
- class OptionDetails
- {
- public:
- OptionDetails
- (
- const std::string& short_,
- const std::string& long_,
- const String& desc,
- std::shared_ptr<const Value> val
- )
- : m_short(short_)
- , m_long(long_)
- , m_desc(desc)
- , m_value(val)
- , m_count(0)
- {
- }
-
- OptionDetails(const OptionDetails& rhs)
- : m_desc(rhs.m_desc)
- , m_count(rhs.m_count)
- {
- m_value = rhs.m_value->clone();
- }
-
- OptionDetails(OptionDetails&& rhs) = default;
-
- const String&
- description() const
- {
- return m_desc;
- }
-
- const Value& value() const {
- return *m_value;
- }
-
- std::shared_ptr<Value>
- make_storage() const
- {
- return m_value->clone();
- }
-
- const std::string&
- short_name() const
- {
- return m_short;
- }
-
- const std::string&
- long_name() const
- {
- return m_long;
- }
-
- private:
- std::string m_short;
- std::string m_long;
- String m_desc;
- std::shared_ptr<const Value> m_value;
- int m_count;
- };
-
- struct HelpOptionDetails
- {
- std::string s;
- std::string l;
- String desc;
- bool has_default;
- std::string default_value;
- bool has_implicit;
- std::string implicit_value;
- std::string arg_help;
- bool is_container;
- bool is_boolean;
- };
-
- struct HelpGroupDetails
- {
- std::string name;
- std::string description;
- std::vector<HelpOptionDetails> options;
- };
-
- class OptionValue
- {
- public:
- void
- parse
- (
- std::shared_ptr<const OptionDetails> details,
- const std::string& text
- )
- {
- ensure_value(details);
- ++m_count;
- m_value->parse(text);
- }
-
- void
- parse_default(std::shared_ptr<const OptionDetails> details)
- {
- ensure_value(details);
- m_value->parse();
- m_count++;
- }
-
- size_t
- count() const
- {
- return m_count;
- }
-
- template <typename T>
- const T&
- as() const
- {
-#ifdef CXXOPTS_NO_RTTI
- return static_cast<const values::standard_value<T>&>(*m_value).get();
-#else
- return dynamic_cast<const values::standard_value<T>&>(*m_value).get();
-#endif
- }
-
- private:
- void
- ensure_value(std::shared_ptr<const OptionDetails> details)
- {
- if (m_value == nullptr)
- {
- m_value = details->make_storage();
- }
- }
-
- std::shared_ptr<Value> m_value;
- size_t m_count = 0;
- };
-
- class KeyValue
- {
- public:
- KeyValue(std::string key_, std::string value_)
- : m_key(std::move(key_))
- , m_value(std::move(value_))
- {
- }
-
- const
- std::string&
- key() const
- {
- return m_key;
- }
-
- const std::string
- value() const
- {
- return m_value;
- }
-
- template <typename T>
- T
- as() const
- {
- T result;
- values::parse_value(m_value, result);
- return result;
- }
-
- private:
- std::string m_key;
- std::string m_value;
- };
-
- class ParseResult
- {
- public:
-
- ParseResult(
- const std::unordered_map<std::string, std::shared_ptr<OptionDetails>>&,
- std::vector<std::string>,
- int&, char**&);
-
- size_t
- count(const std::string& o) const
- {
- auto iter = m_options.find(o);
- if (iter == m_options.end())
- {
- return 0;
- }
-
- auto riter = m_results.find(iter->second);
-
- return riter->second.count();
- }
-
- const OptionValue&
- operator[](const std::string& option) const
- {
- auto iter = m_options.find(option);
-
- if (iter == m_options.end())
- {
- throw option_not_present_exception(option);
- }
-
- auto riter = m_results.find(iter->second);
-
- return riter->second;
- }
-
- const std::vector<KeyValue>&
- arguments() const
- {
- return m_sequential;
- }
-
- private:
-
- OptionValue&
- get_option(std::shared_ptr<OptionDetails>);
-
- void
- parse(int& argc, char**& argv);
-
- void
- add_to_option(const std::string& option, const std::string& arg);
-
- bool
- consume_positional(std::string a);
-
- void
- parse_option
- (
- std::shared_ptr<OptionDetails> value,
- const std::string& name,
- const std::string& arg = ""
- );
-
- void
- parse_default(std::shared_ptr<OptionDetails> details);
-
- void
- checked_parse_arg
- (
- int argc,
- char* argv[],
- int& current,
- std::shared_ptr<OptionDetails> value,
- const std::string& name
- );
-
- const std::unordered_map<std::string, std::shared_ptr<OptionDetails>>
- &m_options;
- std::vector<std::string> m_positional;
- std::vector<std::string>::iterator m_next_positional;
- std::unordered_set<std::string> m_positional_set;
- std::unordered_map<std::shared_ptr<OptionDetails>, OptionValue> m_results;
-
- std::vector<KeyValue> m_sequential;
- };
-
- class Options
- {
- public:
-
- Options(std::string program, std::string help_string = "")
- : m_program(std::move(program))
- , m_help_string(toLocalString(std::move(help_string)))
- , m_custom_help("[OPTION...]")
- , m_positional_help("positional parameters")
- , m_show_positional(false)
- , m_next_positional(m_positional.end())
- {
- }
-
- Options&
- positional_help(std::string help_text)
- {
- m_positional_help = std::move(help_text);
- return *this;
- }
-
- Options&
- custom_help(std::string help_text)
- {
- m_custom_help = std::move(help_text);
- return *this;
- }
-
- Options&
- show_positional_help()
- {
- m_show_positional = true;
- return *this;
- }
-
- ParseResult
- parse(int& argc, char**& argv);
-
- OptionAdder
- add_options(std::string group = "");
-
- void
- add_option
- (
- const std::string& group,
- const std::string& s,
- const std::string& l,
- std::string desc,
- std::shared_ptr<const Value> value,
- std::string arg_help
- );
-
- //parse positional arguments into the given option
- void
- parse_positional(std::string option);
-
- void
- parse_positional(std::vector<std::string> options);
-
- void
- parse_positional(std::initializer_list<std::string> options);
-
- std::string
- help(const std::vector<std::string>& groups = {""}) const;
-
- const std::vector<std::string>
- groups() const;
-
- const HelpGroupDetails&
- group_help(const std::string& group) const;
-
- private:
-
- void
- add_one_option
- (
- const std::string& option,
- std::shared_ptr<OptionDetails> details
- );
-
- String
- help_one_group(const std::string& group) const;
-
- void
- generate_group_help
- (
- String& result,
- const std::vector<std::string>& groups
- ) const;
-
- void
- generate_all_groups_help(String& result) const;
-
- std::string m_program;
- String m_help_string;
- std::string m_custom_help;
- std::string m_positional_help;
- bool m_show_positional;
-
- std::unordered_map<std::string, std::shared_ptr<OptionDetails>> m_options;
- std::vector<std::string> m_positional;
- std::vector<std::string>::iterator m_next_positional;
- std::unordered_set<std::string> m_positional_set;
-
- //mapping from groups to help options
- std::map<std::string, HelpGroupDetails> m_help;
- };
-
- class OptionAdder
- {
- public:
-
- OptionAdder(Options& options, std::string group)
- : m_options(options), m_group(std::move(group))
- {
- }
-
- OptionAdder&
- operator()
- (
- const std::string& opts,
- const std::string& desc,
- std::shared_ptr<const Value> value
- = ::cxxopts::value<bool>(),
- std::string arg_help = ""
- );
-
- private:
- Options& m_options;
- std::string m_group;
- };
-
- namespace
- {
- constexpr int OPTION_LONGEST = 30;
- constexpr int OPTION_DESC_GAP = 2;
-
- std::basic_regex<char> option_matcher
- ("--([[:alnum:]][-_[:alnum:]]+)(=(.*))?|-([[:alnum:]]+)");
-
- std::basic_regex<char> option_specifier
- ("(([[:alnum:]]),)?[ ]*([[:alnum:]][-_[:alnum:]]*)?");
-
- String
- format_option
- (
- const HelpOptionDetails& o
- )
- {
- auto& s = o.s;
- auto& l = o.l;
-
- String result = " ";
-
- if (s.size() > 0)
- {
- result += "-" + toLocalString(s) + ",";
- }
- else
- {
- result += " ";
- }
-
- if (l.size() > 0)
- {
- result += " --" + toLocalString(l);
- }
-
- auto arg = o.arg_help.size() > 0 ? toLocalString(o.arg_help) : "arg";
-
- if (!o.is_boolean)
- {
- if (o.has_implicit)
- {
- result += " [=" + arg + "(=" + toLocalString(o.implicit_value) + ")]";
- }
- else
- {
- result += " " + arg;
- }
- }
-
- return result;
- }
-
- String
- format_description
- (
- const HelpOptionDetails& o,
- size_t start,
- size_t width
- )
- {
- auto desc = o.desc;
-
- if (o.has_default)
- {
- desc += toLocalString(" (default: " + o.default_value + ")");
- }
-
- String result;
-
- auto current = std::begin(desc);
- auto startLine = current;
- auto lastSpace = current;
-
- auto size = size_t{};
-
- while (current != std::end(desc))
- {
- if (*current == ' ')
- {
- lastSpace = current;
- }
-
- if (size > width)
- {
- if (lastSpace == startLine)
- {
- stringAppend(result, startLine, current + 1);
- stringAppend(result, "\n");
- stringAppend(result, start, ' ');
- startLine = current + 1;
- lastSpace = startLine;
- }
- else
- {
- stringAppend(result, startLine, lastSpace);
- stringAppend(result, "\n");
- stringAppend(result, start, ' ');
- startLine = lastSpace + 1;
- }
- size = 0;
- }
- else
- {
- ++size;
- }
-
- ++current;
- }
-
- //append whatever is left
- stringAppend(result, startLine, current);
-
- return result;
- }
- }
-
-inline
-ParseResult::ParseResult
-(
- const std::unordered_map<std::string, std::shared_ptr<OptionDetails>>& options,
- std::vector<std::string> positional,
- int& argc, char**& argv
-)
-: m_options(options)
-, m_positional(std::move(positional))
-, m_next_positional(m_positional.begin())
-{
- parse(argc, argv);
-}
-
-inline
-OptionAdder
-Options::add_options(std::string group)
-{
- return OptionAdder(*this, std::move(group));
-}
-
-inline
-OptionAdder&
-OptionAdder::operator()
-(
- const std::string& opts,
- const std::string& desc,
- std::shared_ptr<const Value> value,
- std::string arg_help
-)
-{
- std::match_results<const char*> result;
- std::regex_match(opts.c_str(), result, option_specifier);
-
- if (result.empty())
- {
- throw invalid_option_format_error(opts);
- }
-
- const auto& short_match = result[2];
- const auto& long_match = result[3];
-
- if (!short_match.length() && !long_match.length())
- {
- throw invalid_option_format_error(opts);
- } else if (long_match.length() == 1 && short_match.length())
- {
- throw invalid_option_format_error(opts);
- }
-
- auto option_names = []
- (
- const std::sub_match<const char*>& short_,
- const std::sub_match<const char*>& long_
- )
- {
- if (long_.length() == 1)
- {
- return std::make_tuple(long_.str(), short_.str());
- }
- else
- {
- return std::make_tuple(short_.str(), long_.str());
- }
- }(short_match, long_match);
-
- m_options.add_option
- (
- m_group,
- std::get<0>(option_names),
- std::get<1>(option_names),
- desc,
- value,
- std::move(arg_help)
- );
-
- return *this;
-}
-
-inline
-void
-ParseResult::parse_default(std::shared_ptr<OptionDetails> details)
-{
- m_results[details].parse_default(details);
-}
-
-inline
-void
-ParseResult::parse_option
-(
- std::shared_ptr<OptionDetails> value,
- const std::string& /*name*/,
- const std::string& arg
-)
-{
- auto& result = m_results[value];
- result.parse(value, arg);
-
- m_sequential.emplace_back(value->long_name(), arg);
-}
-
-inline
-void
-ParseResult::checked_parse_arg
-(
- int argc,
- char* argv[],
- int& current,
- std::shared_ptr<OptionDetails> value,
- const std::string& name
-)
-{
- if (current + 1 >= argc)
- {
- if (value->value().has_implicit())
- {
- parse_option(value, name, value->value().get_implicit_value());
- }
- else
- {
- throw missing_argument_exception(name);
- }
- }
- else
- {
- if (value->value().has_implicit())
- {
- parse_option(value, name, value->value().get_implicit_value());
- }
- else
- {
- parse_option(value, name, argv[current + 1]);
- ++current;
- }
- }
-}
-
-inline
-void
-ParseResult::add_to_option(const std::string& option, const std::string& arg)
-{
- auto iter = m_options.find(option);
-
- if (iter == m_options.end())
- {
- throw option_not_exists_exception(option);
- }
-
- parse_option(iter->second, option, arg);
-}
-
-inline
-bool
-ParseResult::consume_positional(std::string a)
-{
- while (m_next_positional != m_positional.end())
- {
- auto iter = m_options.find(*m_next_positional);
- if (iter != m_options.end())
- {
- auto& result = m_results[iter->second];
- if (!iter->second->value().is_container())
- {
- if (result.count() == 0)
- {
- add_to_option(*m_next_positional, a);
- ++m_next_positional;
- return true;
- }
- else
- {
- ++m_next_positional;
- continue;
- }
- }
- else
- {
- add_to_option(*m_next_positional, a);
- return true;
- }
- }
- ++m_next_positional;
- }
-
- return false;
-}
-
-inline
-void
-Options::parse_positional(std::string option)
-{
- parse_positional(std::vector<std::string>{std::move(option)});
-}
-
-inline
-void
-Options::parse_positional(std::vector<std::string> options)
-{
- m_positional = std::move(options);
- m_next_positional = m_positional.begin();
-
- m_positional_set.insert(m_positional.begin(), m_positional.end());
-}
-
-inline
-void
-Options::parse_positional(std::initializer_list<std::string> options)
-{
- parse_positional(std::vector<std::string>(std::move(options)));
-}
-
-inline
-ParseResult
-Options::parse(int& argc, char**& argv)
-{
- ParseResult result(m_options, m_positional, argc, argv);
- return result;
-}
-
-inline
-void
-ParseResult::parse(int& argc, char**& argv)
-{
- int current = 1;
-
- int nextKeep = 1;
-
- bool consume_remaining = false;
-
- while (current != argc)
- {
- if (strcmp(argv[current], "--") == 0)
- {
- consume_remaining = true;
- ++current;
- break;
- }
-
- std::match_results<const char*> result;
- std::regex_match(argv[current], result, option_matcher);
-
- if (result.empty())
- {
- //not a flag
-
- //if true is returned here then it was consumed, otherwise it is
- //ignored
- if (consume_positional(argv[current]))
- {
- }
- else
- {
- argv[nextKeep] = argv[current];
- ++nextKeep;
- }
- //if we return from here then it was parsed successfully, so continue
- }
- else
- {
- //short or long option?
- if (result[4].length() != 0)
- {
- const std::string& s = result[4];
-
- for (std::size_t i = 0; i != s.size(); ++i)
- {
- std::string name(1, s[i]);
- auto iter = m_options.find(name);
-
- if (iter == m_options.end())
- {
- throw option_not_exists_exception(name);
- }
-
- auto value = iter->second;
-
- if (i + 1 == s.size())
- {
- //it must be the last argument
- checked_parse_arg(argc, argv, current, value, name);
- }
- else if (value->value().has_implicit())
- {
- parse_option(value, name, value->value().get_implicit_value());
- }
- else
- {
- //error
- throw option_requires_argument_exception(name);
- }
- }
- }
- else if (result[1].length() != 0)
- {
- const std::string& name = result[1];
-
- auto iter = m_options.find(name);
-
- if (iter == m_options.end())
- {
- throw option_not_exists_exception(name);
- }
-
- auto opt = iter->second;
-
- //equals provided for long option?
- if (result[2].length() != 0)
- {
- //parse the option given
-
- parse_option(opt, name, result[3]);
- }
- else
- {
- //parse the next argument
- checked_parse_arg(argc, argv, current, opt, name);
- }
- }
-
- }
-
- ++current;
- }
-
- for (auto& opt : m_options)
- {
- auto& detail = opt.second;
- auto& value = detail->value();
-
- auto& store = m_results[detail];
-
- if(!store.count() && value.has_default()){
- parse_default(detail);
- }
- }
-
- if (consume_remaining)
- {
- while (current < argc)
- {
- if (!consume_positional(argv[current])) {
- break;
- }
- ++current;
- }
-
- //adjust argv for any that couldn't be swallowed
- while (current != argc) {
- argv[nextKeep] = argv[current];
- ++nextKeep;
- ++current;
- }
- }
-
- argc = nextKeep;
-
-}
-
-inline
-void
-Options::add_option
-(
- const std::string& group,
- const std::string& s,
- const std::string& l,
- std::string desc,
- std::shared_ptr<const Value> value,
- std::string arg_help
-)
-{
- auto stringDesc = toLocalString(std::move(desc));
- auto option = std::make_shared<OptionDetails>(s, l, stringDesc, value);
-
- if (s.size() > 0)
- {
- add_one_option(s, option);
- }
-
- if (l.size() > 0)
- {
- add_one_option(l, option);
- }
-
- //add the help details
- auto& options = m_help[group];
-
- options.options.emplace_back(HelpOptionDetails{s, l, stringDesc,
- value->has_default(), value->get_default_value(),
- value->has_implicit(), value->get_implicit_value(),
- std::move(arg_help),
- value->is_container(),
- value->is_boolean()});
-}
-
-inline
-void
-Options::add_one_option
-(
- const std::string& option,
- std::shared_ptr<OptionDetails> details
-)
-{
- auto in = m_options.emplace(option, details);
-
- if (!in.second)
- {
- throw option_exists_error(option);
- }
-}
-
-inline
-String
-Options::help_one_group(const std::string& g) const
-{
- typedef std::vector<std::pair<String, String>> OptionHelp;
-
- auto group = m_help.find(g);
- if (group == m_help.end())
- {
- return "";
- }
-
- OptionHelp format;
-
- size_t longest = 0;
-
- String result;
-
- if (!g.empty())
- {
- result += toLocalString(" " + g + " options:\n");
- }
-
- for (const auto& o : group->second.options)
- {
- if (o.is_container &&
- m_positional_set.find(o.l) != m_positional_set.end() &&
- !m_show_positional)
- {
- continue;
- }
-
- auto s = format_option(o);
- longest = std::max(longest, stringLength(s));
- format.push_back(std::make_pair(s, String()));
- }
-
- longest = std::min(longest, static_cast<size_t>(OPTION_LONGEST));
-
- //widest allowed description
- auto allowed = size_t{76} - longest - OPTION_DESC_GAP;
-
- auto fiter = format.begin();
- for (const auto& o : group->second.options)
- {
- if (o.is_container &&
- m_positional_set.find(o.l) != m_positional_set.end() &&
- !m_show_positional)
- {
- continue;
- }
-
- auto d = format_description(o, longest + OPTION_DESC_GAP, allowed);
-
- result += fiter->first;
- if (stringLength(fiter->first) > longest)
- {
- result += '\n';
- result += toLocalString(std::string(longest + OPTION_DESC_GAP, ' '));
- }
- else
- {
- result += toLocalString(std::string(longest + OPTION_DESC_GAP -
- stringLength(fiter->first),
- ' '));
- }
- result += d;
- result += '\n';
-
- ++fiter;
- }
-
- return result;
-}
-
-inline
-void
-Options::generate_group_help
-(
- String& result,
- const std::vector<std::string>& print_groups
-) const
-{
- for (size_t i = 0; i != print_groups.size(); ++i)
- {
- const String& group_help_text = help_one_group(print_groups[i]);
- if (empty(group_help_text))
- {
- continue;
- }
- result += group_help_text;
- if (i < print_groups.size() - 1)
- {
- result += '\n';
- }
- }
-}
-
-inline
-void
-Options::generate_all_groups_help(String& result) const
-{
- std::vector<std::string> all_groups;
- all_groups.reserve(m_help.size());
-
- for (auto& group : m_help)
- {
- all_groups.push_back(group.first);
- }
-
- generate_group_help(result, all_groups);
-}
-
-inline
-std::string
-Options::help(const std::vector<std::string>& help_groups) const
-{
- String result = m_help_string + "\nUsage:\n " +
- toLocalString(m_program) + " " + toLocalString(m_custom_help);
-
- if (m_positional.size() > 0 && m_positional_help.size() > 0) {
- result += " " + toLocalString(m_positional_help);
- }
-
- result += "\n\n";
-
- if (help_groups.size() == 0)
- {
- generate_all_groups_help(result);
- }
- else
- {
- generate_group_help(result, help_groups);
- }
-
- return toUTF8String(result);
-}
-
-inline
-const std::vector<std::string>
-Options::groups() const
-{
- std::vector<std::string> g;
-
- std::transform(
- m_help.begin(),
- m_help.end(),
- std::back_inserter(g),
- [] (const std::map<std::string, HelpGroupDetails>::value_type& pair)
- {
- return pair.first;
- }
- );
-
- return g;
-}
-
-inline
-const HelpGroupDetails&
-Options::group_help(const std::string& group) const
-{
- return m_help.at(group);
-}
-
-}
-
-#endif //CXXOPTS_HPP_INCLUDED
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image.h b/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image.h
deleted file mode 100644
index d9c21bc813..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image.h
+++ /dev/null
@@ -1,7462 +0,0 @@
-/* stb_image - v2.19 - public domain image loader - http://nothings.org/stb
- no warranty implied; use at your own risk
-
- Do this:
- #define STB_IMAGE_IMPLEMENTATION
- before you include this file in *one* C or C++ file to create the implementation.
-
- // i.e. it should look like this:
- #include ...
- #include ...
- #include ...
- #define STB_IMAGE_IMPLEMENTATION
- #include "stb_image.h"
-
- You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
- And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
-
-
- QUICK NOTES:
- Primarily of interest to game developers and other people who can
- avoid problematic images and only need the trivial interface
-
- JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
- PNG 1/2/4/8/16-bit-per-channel
-
- TGA (not sure what subset, if a subset)
- BMP non-1bpp, non-RLE
- PSD (composited view only, no extra channels, 8/16 bit-per-channel)
-
- GIF (*comp always reports as 4-channel)
- HDR (radiance rgbE format)
- PIC (Softimage PIC)
- PNM (PPM and PGM binary only)
-
- Animated GIF still needs a proper API, but here's one way to do it:
- http://gist.github.com/urraka/685d9a6340b26b830d49
-
- - decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- - decode from arbitrary I/O callbacks
- - SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
-
- Full documentation under "DOCUMENTATION" below.
-
-
-LICENSE
-
- See end of file for license information.
-
-RECENT REVISION HISTORY:
-
- 2.19 (2018-02-11) fix warning
- 2.18 (2018-01-30) fix warnings
- 2.17 (2018-01-29) bugfix, 1-bit BMP, 16-bitness query, fix warnings
- 2.16 (2017-07-23) all functions have 16-bit variants; optimizations; bugfixes
- 2.15 (2017-03-18) fix png-1,2,4; all Imagenet JPGs; no runtime SSE detection on GCC
- 2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
- 2.13 (2016-12-04) experimental 16-bit API, only for PNG so far; fixes
- 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
- 2.11 (2016-04-02) 16-bit PNGS; enable SSE2 in non-gcc x64
- RGB-format JPEG; remove white matting in PSD;
- allocate large structures on the stack;
- correct channel count for PNG & BMP
- 2.10 (2016-01-22) avoid warning introduced in 2.09
- 2.09 (2016-01-16) 16-bit TGA; comments in PNM files; STBI_REALLOC_SIZED
-
- See end of file for full revision history.
-
-
- ============================ Contributors =========================
-
- Image formats Extensions, features
- Sean Barrett (jpeg, png, bmp) Jetro Lauha (stbi_info)
- Nicolas Schulz (hdr, psd) Martin "SpartanJ" Golini (stbi_info)
- Jonathan Dummer (tga) James "moose2000" Brown (iPhone PNG)
- Jean-Marc Lienher (gif) Ben "Disch" Wenger (io callbacks)
- Tom Seddon (pic) Omar Cornut (1/2/4-bit PNG)
- Thatcher Ulrich (psd) Nicolas Guillemot (vertical flip)
- Ken Miller (pgm, ppm) Richard Mitton (16-bit PSD)
- github:urraka (animated gif) Junggon Kim (PNM comments)
- Christopher Forseth (animated gif) Daniel Gibson (16-bit TGA)
- socks-the-fox (16-bit PNG)
- Jeremy Sawicki (handle all ImageNet JPGs)
- Optimizations & bugfixes Mikhail Morozov (1-bit BMP)
- Fabian "ryg" Giesen Anael Seghezzi (is-16-bit query)
- Arseny Kapoulkine
- John-Mark Allen
-
- Bug & warning fixes
- Marc LeBlanc David Woo Guillaume George Martins Mozeiko
- Christpher Lloyd Jerry Jansson Joseph Thomson Phil Jordan
- Dave Moore Roy Eltham Hayaki Saito Nathan Reed
- Won Chun Luke Graham Johan Duparc Nick Verigakis
- the Horde3D community Thomas Ruf Ronny Chevalier github:rlyeh
- Janez Zemva John Bartholomew Michal Cichon github:romigrou
- Jonathan Blow Ken Hamada Tero Hanninen github:svdijk
- Laurent Gomila Cort Stratton Sergio Gonzalez github:snagar
- Aruelien Pocheville Thibault Reuille Cass Everitt github:Zelex
- Ryamond Barbiero Paul Du Bois Engin Manap github:grim210
- Aldo Culquicondor Philipp Wiesemann Dale Weiler github:sammyhw
- Oriol Ferrer Mesia Josh Tobin Matthew Gregan github:phprus
- Julian Raschke Gregory Mullen Baldur Karlsson github:poppolopoppo
- Christian Floisand Kevin Schmidt github:darealshinji
- Blazej Dariusz Roszkowski github:Michaelangel007
-*/
-
-#ifndef STBI_INCLUDE_STB_IMAGE_H
-#define STBI_INCLUDE_STB_IMAGE_H
-
-// DOCUMENTATION
-//
-// Limitations:
-// - no 12-bit-per-channel JPEG
-// - no JPEGs with arithmetic coding
-// - GIF always returns *comp=4
-//
-// Basic usage (see HDR discussion below for HDR usage):
-// int x,y,n;
-// unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
-// // ... process data if not NULL ...
-// // ... x = width, y = height, n = # 8-bit components per pixel ...
-// // ... replace '0' with '1'..'4' to force that many components per pixel
-// // ... but 'n' will always be the number that it would have been if you said 0
-// stbi_image_free(data)
-//
-// Standard parameters:
-// int *x -- outputs image width in pixels
-// int *y -- outputs image height in pixels
-// int *channels_in_file -- outputs # of image components in image file
-// int desired_channels -- if non-zero, # of image components requested in result
-//
-// The return value from an image loader is an 'unsigned char *' which points
-// to the pixel data, or NULL on an allocation failure or if the image is
-// corrupt or invalid. The pixel data consists of *y scanlines of *x pixels,
-// with each pixel consisting of N interleaved 8-bit components; the first
-// pixel pointed to is top-left-most in the image. There is no padding between
-// image scanlines or between pixels, regardless of format. The number of
-// components N is 'desired_channels' if desired_channels is non-zero, or
-// *channels_in_file otherwise. If desired_channels is non-zero,
-// *channels_in_file has the number of components that _would_ have been
-// output otherwise. E.g. if you set desired_channels to 4, you will always
-// get RGBA output, but you can check *channels_in_file to see if it's trivially
-// opaque because e.g. there were only 3 channels in the source image.
-//
-// An output image with N components has the following components interleaved
-// in this order in each pixel:
-//
-// N=#comp components
-// 1 grey
-// 2 grey, alpha
-// 3 red, green, blue
-// 4 red, green, blue, alpha
-//
-// If image loading fails for any reason, the return value will be NULL,
-// and *x, *y, *channels_in_file will be unchanged. The function
-// stbi_failure_reason() can be queried for an extremely brief, end-user
-// unfriendly explanation of why the load failed. Define STBI_NO_FAILURE_STRINGS
-// to avoid compiling these strings at all, and STBI_FAILURE_USERMSG to get slightly
-// more user-friendly ones.
-//
-// Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.
-//
-// ===========================================================================
-//
-// Philosophy
-//
-// stb libraries are designed with the following priorities:
-//
-// 1. easy to use
-// 2. easy to maintain
-// 3. good performance
-//
-// Sometimes I let "good performance" creep up in priority over "easy to maintain",
-// and for best performance I may provide less-easy-to-use APIs that give higher
-// performance, in addition to the easy to use ones. Nevertheless, it's important
-// to keep in mind that from the standpoint of you, a client of this library,
-// all you care about is #1 and #3, and stb libraries DO NOT emphasize #3 above all.
-//
-// Some secondary priorities arise directly from the first two, some of which
-// make more explicit reasons why performance can't be emphasized.
-//
-// - Portable ("ease of use")
-// - Small source code footprint ("easy to maintain")
-// - No dependencies ("ease of use")
-//
-// ===========================================================================
-//
-// I/O callbacks
-//
-// I/O callbacks allow you to read from arbitrary sources, like packaged
-// files or some other source. Data read from callbacks are processed
-// through a small internal buffer (currently 128 bytes) to try to reduce
-// overhead.
-//
-// The three functions you must define are "read" (reads some bytes of data),
-// "skip" (skips some bytes of data), "eof" (reports if the stream is at the end).
-//
-// ===========================================================================
-//
-// SIMD support
-//
-// The JPEG decoder will try to automatically use SIMD kernels on x86 when
-// supported by the compiler. For ARM Neon support, you must explicitly
-// request it.
-//
-// (The old do-it-yourself SIMD API is no longer supported in the current
-// code.)
-//
-// On x86, SSE2 will automatically be used when available based on a run-time
-// test; if not, the generic C versions are used as a fall-back. On ARM targets,
-// the typical path is to have separate builds for NEON and non-NEON devices
-// (at least this is true for iOS and Android). Therefore, the NEON support is
-// toggled by a build flag: define STBI_NEON to get NEON loops.
-//
-// If for some reason you do not want to use any of SIMD code, or if
-// you have issues compiling it, you can disable it entirely by
-// defining STBI_NO_SIMD.
-//
-// ===========================================================================
-//
-// HDR image support (disable by defining STBI_NO_HDR)
-//
-// stb_image now supports loading HDR images in general, and currently
-// the Radiance .HDR file format, although the support is provided
-// generically. You can still load any file through the existing interface;
-// if you attempt to load an HDR file, it will be automatically remapped to
-// LDR, assuming gamma 2.2 and an arbitrary scale factor defaulting to 1;
-// both of these constants can be reconfigured through this interface:
-//
-// stbi_hdr_to_ldr_gamma(2.2f);
-// stbi_hdr_to_ldr_scale(1.0f);
-//
-// (note, do not use _inverse_ constants; stbi_image will invert them
-// appropriately).
-//
-// Additionally, there is a new, parallel interface for loading files as
-// (linear) floats to preserve the full dynamic range:
-//
-// float *data = stbi_loadf(filename, &x, &y, &n, 0);
-//
-// If you load LDR images through this interface, those images will
-// be promoted to floating point values, run through the inverse of
-// constants corresponding to the above:
-//
-// stbi_ldr_to_hdr_scale(1.0f);
-// stbi_ldr_to_hdr_gamma(2.2f);
-//
-// Finally, given a filename (or an open file or memory block--see header
-// file for details) containing image data, you can query for the "most
-// appropriate" interface to use (that is, whether the image is HDR or
-// not), using:
-//
-// stbi_is_hdr(char *filename);
-//
-// ===========================================================================
-//
-// iPhone PNG support:
-//
-// By default we convert iphone-formatted PNGs back to RGB, even though
-// they are internally encoded differently. You can disable this conversion
-// by by calling stbi_convert_iphone_png_to_rgb(0), in which case
-// you will always just get the native iphone "format" through (which
-// is BGR stored in RGB).
-//
-// Call stbi_set_unpremultiply_on_load(1) as well to force a divide per
-// pixel to remove any premultiplied alpha *only* if the image file explicitly
-// says there's premultiplied data (currently only happens in iPhone images,
-// and only if iPhone convert-to-rgb processing is on).
-//
-// ===========================================================================
-//
-// ADDITIONAL CONFIGURATION
-//
-// - You can suppress implementation of any of the decoders to reduce
-// your code footprint by #defining one or more of the following
-// symbols before creating the implementation.
-//
-// STBI_NO_JPEG
-// STBI_NO_PNG
-// STBI_NO_BMP
-// STBI_NO_PSD
-// STBI_NO_TGA
-// STBI_NO_GIF
-// STBI_NO_HDR
-// STBI_NO_PIC
-// STBI_NO_PNM (.ppm and .pgm)
-//
-// - You can request *only* certain decoders and suppress all other ones
-// (this will be more forward-compatible, as addition of new decoders
-// doesn't require you to disable them explicitly):
-//
-// STBI_ONLY_JPEG
-// STBI_ONLY_PNG
-// STBI_ONLY_BMP
-// STBI_ONLY_PSD
-// STBI_ONLY_TGA
-// STBI_ONLY_GIF
-// STBI_ONLY_HDR
-// STBI_ONLY_PIC
-// STBI_ONLY_PNM (.ppm and .pgm)
-//
-// - If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
-// want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
-//
-
-
-#ifndef STBI_NO_STDIO
-#include <stdio.h>
-#endif // STBI_NO_STDIO
-
-#define STBI_VERSION 1
-
-enum
-{
- STBI_default = 0, // only used for desired_channels
-
- STBI_grey = 1,
- STBI_grey_alpha = 2,
- STBI_rgb = 3,
- STBI_rgb_alpha = 4
-};
-
-typedef unsigned char stbi_uc;
-typedef unsigned short stbi_us;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef STB_IMAGE_STATIC
-#define STBIDEF static
-#else
-#define STBIDEF extern
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// PRIMARY API - works on images of any type
-//
-
-//
-// load image by filename, open file, or memory buffer
-//
-
-typedef struct
-{
- int (*read) (void *user,char *data,int size); // fill 'data' with 'size' bytes. return number of bytes actually read
- void (*skip) (void *user,int n); // skip the next 'n' bytes, or 'unget' the last -n bytes if negative
- int (*eof) (void *user); // returns nonzero if we are at end of file/data
-} stbi_io_callbacks;
-
-////////////////////////////////////
-//
-// 8-bits-per-channel interface
-//
-
-STBIDEF stbi_uc *stbi_load_from_memory (stbi_uc const *buffer, int len , int *x, int *y, int *channels_in_file, int desired_channels);
-STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk , void *user, int *x, int *y, int *channels_in_file, int desired_channels);
-#ifndef STBI_NO_GIF
-STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp);
-#endif
-
-
-#ifndef STBI_NO_STDIO
-STBIDEF stbi_uc *stbi_load (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
-STBIDEF stbi_uc *stbi_load_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
-// for stbi_load_from_file, file pointer is left pointing immediately after image
-#endif
-
-////////////////////////////////////
-//
-// 16-bits-per-channel interface
-//
-
-STBIDEF stbi_us *stbi_load_16_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);
-STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);
-
-#ifndef STBI_NO_STDIO
-STBIDEF stbi_us *stbi_load_16 (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
-STBIDEF stbi_us *stbi_load_from_file_16(FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
-#endif
-
-////////////////////////////////////
-//
-// float-per-channel interface
-//
-#ifndef STBI_NO_LINEAR
- STBIDEF float *stbi_loadf_from_memory (stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels);
- STBIDEF float *stbi_loadf_from_callbacks (stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels);
-
- #ifndef STBI_NO_STDIO
- STBIDEF float *stbi_loadf (char const *filename, int *x, int *y, int *channels_in_file, int desired_channels);
- STBIDEF float *stbi_loadf_from_file (FILE *f, int *x, int *y, int *channels_in_file, int desired_channels);
- #endif
-#endif
-
-#ifndef STBI_NO_HDR
- STBIDEF void stbi_hdr_to_ldr_gamma(float gamma);
- STBIDEF void stbi_hdr_to_ldr_scale(float scale);
-#endif // STBI_NO_HDR
-
-#ifndef STBI_NO_LINEAR
- STBIDEF void stbi_ldr_to_hdr_gamma(float gamma);
- STBIDEF void stbi_ldr_to_hdr_scale(float scale);
-#endif // STBI_NO_LINEAR
-
-// stbi_is_hdr is always defined, but always returns false if STBI_NO_HDR
-STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user);
-STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len);
-#ifndef STBI_NO_STDIO
-STBIDEF int stbi_is_hdr (char const *filename);
-STBIDEF int stbi_is_hdr_from_file(FILE *f);
-#endif // STBI_NO_STDIO
-
-
-// get a VERY brief reason for failure
-// NOT THREADSAFE
-STBIDEF const char *stbi_failure_reason (void);
-
-// free the loaded image -- this is just free()
-STBIDEF void stbi_image_free (void *retval_from_stbi_load);
-
-// get image dimensions & components without fully decoding
-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp);
-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp);
-STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len);
-STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *clbk, void *user);
-
-#ifndef STBI_NO_STDIO
-STBIDEF int stbi_info (char const *filename, int *x, int *y, int *comp);
-STBIDEF int stbi_info_from_file (FILE *f, int *x, int *y, int *comp);
-STBIDEF int stbi_is_16_bit (char const *filename);
-STBIDEF int stbi_is_16_bit_from_file(FILE *f);
-#endif
-
-
-
-// for image formats that explicitly notate that they have premultiplied alpha,
-// we just return the colors as stored in the file. set this flag to force
-// unpremultiplication. results are undefined if the unpremultiply overflow.
-STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply);
-
-// indicate whether we should process iphone images back to canonical format,
-// or just pass them through "as-is"
-STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert);
-
-// flip the image vertically, so the first pixel in the output array is the bottom left
-STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip);
-
-// ZLIB client - used by PNG, available for other purposes
-
-STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen);
-STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header);
-STBIDEF char *stbi_zlib_decode_malloc(const char *buffer, int len, int *outlen);
-STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
-
-STBIDEF char *stbi_zlib_decode_noheader_malloc(const char *buffer, int len, int *outlen);
-STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-//
-//
-//// end header file /////////////////////////////////////////////////////
-#endif // STBI_INCLUDE_STB_IMAGE_H
-
-#ifdef STB_IMAGE_IMPLEMENTATION
-
-#if defined(STBI_ONLY_JPEG) || defined(STBI_ONLY_PNG) || defined(STBI_ONLY_BMP) \
- || defined(STBI_ONLY_TGA) || defined(STBI_ONLY_GIF) || defined(STBI_ONLY_PSD) \
- || defined(STBI_ONLY_HDR) || defined(STBI_ONLY_PIC) || defined(STBI_ONLY_PNM) \
- || defined(STBI_ONLY_ZLIB)
- #ifndef STBI_ONLY_JPEG
- #define STBI_NO_JPEG
- #endif
- #ifndef STBI_ONLY_PNG
- #define STBI_NO_PNG
- #endif
- #ifndef STBI_ONLY_BMP
- #define STBI_NO_BMP
- #endif
- #ifndef STBI_ONLY_PSD
- #define STBI_NO_PSD
- #endif
- #ifndef STBI_ONLY_TGA
- #define STBI_NO_TGA
- #endif
- #ifndef STBI_ONLY_GIF
- #define STBI_NO_GIF
- #endif
- #ifndef STBI_ONLY_HDR
- #define STBI_NO_HDR
- #endif
- #ifndef STBI_ONLY_PIC
- #define STBI_NO_PIC
- #endif
- #ifndef STBI_ONLY_PNM
- #define STBI_NO_PNM
- #endif
-#endif
-
-#if defined(STBI_NO_PNG) && !defined(STBI_SUPPORT_ZLIB) && !defined(STBI_NO_ZLIB)
-#define STBI_NO_ZLIB
-#endif
-
-
-#include <stdarg.h>
-#include <stddef.h> // ptrdiff_t on osx
-#include <stdlib.h>
-#include <string.h>
-#include <limits.h>
-
-#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
-#include <math.h> // ldexp, pow
-#endif
-
-#ifndef STBI_NO_STDIO
-#include <stdio.h>
-#endif
-
-#ifndef STBI_ASSERT
-#include <assert.h>
-#define STBI_ASSERT(x) assert(x)
-#endif
-
-
-#ifndef _MSC_VER
- #ifdef __cplusplus
- #define stbi_inline inline
- #else
- #define stbi_inline
- #endif
-#else
- #define stbi_inline __forceinline
-#endif
-
-
-#ifdef _MSC_VER
-typedef unsigned short stbi__uint16;
-typedef signed short stbi__int16;
-typedef unsigned int stbi__uint32;
-typedef signed int stbi__int32;
-#else
-#include <stdint.h>
-typedef uint16_t stbi__uint16;
-typedef int16_t stbi__int16;
-typedef uint32_t stbi__uint32;
-typedef int32_t stbi__int32;
-#endif
-
-// should produce compiler error if size is wrong
-typedef unsigned char validate_uint32[sizeof(stbi__uint32)==4 ? 1 : -1];
-
-#ifdef _MSC_VER
-#define STBI_NOTUSED(v) (void)(v)
-#else
-#define STBI_NOTUSED(v) (void)sizeof(v)
-#endif
-
-#ifdef _MSC_VER
-#define STBI_HAS_LROTL
-#endif
-
-#ifdef STBI_HAS_LROTL
- #define stbi_lrot(x,y) _lrotl(x,y)
-#else
- #define stbi_lrot(x,y) (((x) << (y)) | ((x) >> (32 - (y))))
-#endif
-
-#if defined(STBI_MALLOC) && defined(STBI_FREE) && (defined(STBI_REALLOC) || defined(STBI_REALLOC_SIZED))
-// ok
-#elif !defined(STBI_MALLOC) && !defined(STBI_FREE) && !defined(STBI_REALLOC) && !defined(STBI_REALLOC_SIZED)
-// ok
-#else
-#error "Must define all or none of STBI_MALLOC, STBI_FREE, and STBI_REALLOC (or STBI_REALLOC_SIZED)."
-#endif
-
-#ifndef STBI_MALLOC
-#define STBI_MALLOC(sz) malloc(sz)
-#define STBI_REALLOC(p,newsz) realloc(p,newsz)
-#define STBI_FREE(p) free(p)
-#endif
-
-#ifndef STBI_REALLOC_SIZED
-#define STBI_REALLOC_SIZED(p,oldsz,newsz) STBI_REALLOC(p,newsz)
-#endif
-
-// x86/x64 detection
-#if defined(__x86_64__) || defined(_M_X64)
-#define STBI__X64_TARGET
-#elif defined(__i386) || defined(_M_IX86)
-#define STBI__X86_TARGET
-#endif
-
-#if defined(__GNUC__) && defined(STBI__X86_TARGET) && !defined(__SSE2__) && !defined(STBI_NO_SIMD)
-// gcc doesn't support sse2 intrinsics unless you compile with -msse2,
-// which in turn means it gets to use SSE2 everywhere. This is unfortunate,
-// but previous attempts to provide the SSE2 functions with runtime
-// detection caused numerous issues. The way architecture extensions are
-// exposed in GCC/Clang is, sadly, not really suited for one-file libs.
-// New behavior: if compiled with -msse2, we use SSE2 without any
-// detection; if not, we don't use it at all.
-#define STBI_NO_SIMD
-#endif
-
-#if defined(__MINGW32__) && defined(STBI__X86_TARGET) && !defined(STBI_MINGW_ENABLE_SSE2) && !defined(STBI_NO_SIMD)
-// Note that __MINGW32__ doesn't actually mean 32-bit, so we have to avoid STBI__X64_TARGET
-//
-// 32-bit MinGW wants ESP to be 16-byte aligned, but this is not in the
-// Windows ABI and VC++ as well as Windows DLLs don't maintain that invariant.
-// As a result, enabling SSE2 on 32-bit MinGW is dangerous when not
-// simultaneously enabling "-mstackrealign".
-//
-// See https://github.com/nothings/stb/issues/81 for more information.
-//
-// So default to no SSE2 on 32-bit MinGW. If you've read this far and added
-// -mstackrealign to your build settings, feel free to #define STBI_MINGW_ENABLE_SSE2.
-#define STBI_NO_SIMD
-#endif
-
-#if !defined(STBI_NO_SIMD) && (defined(STBI__X86_TARGET) || defined(STBI__X64_TARGET))
-#define STBI_SSE2
-#include <emmintrin.h>
-
-#ifdef _MSC_VER
-
-#if _MSC_VER >= 1400 // not VC6
-#include <intrin.h> // __cpuid
-static int stbi__cpuid3(void)
-{
- int info[4];
- __cpuid(info,1);
- return info[3];
-}
-#else
-static int stbi__cpuid3(void)
-{
- int res;
- __asm {
- mov eax,1
- cpuid
- mov res,edx
- }
- return res;
-}
-#endif
-
-#define STBI_SIMD_ALIGN(type, name) __declspec(align(16)) type name
-
-static int stbi__sse2_available(void)
-{
- int info3 = stbi__cpuid3();
- return ((info3 >> 26) & 1) != 0;
-}
-#else // assume GCC-style if not VC++
-#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
-
-static int stbi__sse2_available(void)
-{
- // If we're even attempting to compile this on GCC/Clang, that means
- // -msse2 is on, which means the compiler is allowed to use SSE2
- // instructions at will, and so are we.
- return 1;
-}
-#endif
-#endif
-
-// ARM NEON
-#if defined(STBI_NO_SIMD) && defined(STBI_NEON)
-#undef STBI_NEON
-#endif
-
-#ifdef STBI_NEON
-#include <arm_neon.h>
-// assume GCC or Clang on ARM targets
-#define STBI_SIMD_ALIGN(type, name) type name __attribute__((aligned(16)))
-#endif
-
-#ifndef STBI_SIMD_ALIGN
-#define STBI_SIMD_ALIGN(type, name) type name
-#endif
-
-///////////////////////////////////////////////
-//
-// stbi__context struct and start_xxx functions
-
-// stbi__context structure is our basic context used by all images, so it
-// contains all the IO context, plus some basic image information
-typedef struct
-{
- stbi__uint32 img_x, img_y;
- int img_n, img_out_n;
-
- stbi_io_callbacks io;
- void *io_user_data;
-
- int read_from_callbacks;
- int buflen;
- stbi_uc buffer_start[128];
-
- stbi_uc *img_buffer, *img_buffer_end;
- stbi_uc *img_buffer_original, *img_buffer_original_end;
-} stbi__context;
-
-
-static void stbi__refill_buffer(stbi__context *s);
-
-// initialize a memory-decode context
-static void stbi__start_mem(stbi__context *s, stbi_uc const *buffer, int len)
-{
- s->io.read = NULL;
- s->read_from_callbacks = 0;
- s->img_buffer = s->img_buffer_original = (stbi_uc *) buffer;
- s->img_buffer_end = s->img_buffer_original_end = (stbi_uc *) buffer+len;
-}
-
-// initialize a callback-based context
-static void stbi__start_callbacks(stbi__context *s, stbi_io_callbacks *c, void *user)
-{
- s->io = *c;
- s->io_user_data = user;
- s->buflen = sizeof(s->buffer_start);
- s->read_from_callbacks = 1;
- s->img_buffer_original = s->buffer_start;
- stbi__refill_buffer(s);
- s->img_buffer_original_end = s->img_buffer_end;
-}
-
-#ifndef STBI_NO_STDIO
-
-static int stbi__stdio_read(void *user, char *data, int size)
-{
- return (int) fread(data,1,size,(FILE*) user);
-}
-
-static void stbi__stdio_skip(void *user, int n)
-{
- fseek((FILE*) user, n, SEEK_CUR);
-}
-
-static int stbi__stdio_eof(void *user)
-{
- return feof((FILE*) user);
-}
-
-static stbi_io_callbacks stbi__stdio_callbacks =
-{
- stbi__stdio_read,
- stbi__stdio_skip,
- stbi__stdio_eof,
-};
-
-static void stbi__start_file(stbi__context *s, FILE *f)
-{
- stbi__start_callbacks(s, &stbi__stdio_callbacks, (void *) f);
-}
-
-//static void stop_file(stbi__context *s) { }
-
-#endif // !STBI_NO_STDIO
-
-static void stbi__rewind(stbi__context *s)
-{
- // conceptually rewind SHOULD rewind to the beginning of the stream,
- // but we just rewind to the beginning of the initial buffer, because
- // we only use it after doing 'test', which only ever looks at at most 92 bytes
- s->img_buffer = s->img_buffer_original;
- s->img_buffer_end = s->img_buffer_original_end;
-}
-
-enum
-{
- STBI_ORDER_RGB,
- STBI_ORDER_BGR
-};
-
-typedef struct
-{
- int bits_per_channel;
- int num_channels;
- int channel_order;
-} stbi__result_info;
-
-#ifndef STBI_NO_JPEG
-static int stbi__jpeg_test(stbi__context *s);
-static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_PNG
-static int stbi__png_test(stbi__context *s);
-static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp);
-static int stbi__png_is16(stbi__context *s);
-#endif
-
-#ifndef STBI_NO_BMP
-static int stbi__bmp_test(stbi__context *s);
-static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_TGA
-static int stbi__tga_test(stbi__context *s);
-static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_PSD
-static int stbi__psd_test(stbi__context *s);
-static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc);
-static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp);
-static int stbi__psd_is16(stbi__context *s);
-#endif
-
-#ifndef STBI_NO_HDR
-static int stbi__hdr_test(stbi__context *s);
-static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_PIC
-static int stbi__pic_test(stbi__context *s);
-static void *stbi__pic_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_GIF
-static int stbi__gif_test(stbi__context *s);
-static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, int *z, int *comp, int req_comp);
-static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-#ifndef STBI_NO_PNM
-static int stbi__pnm_test(stbi__context *s);
-static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri);
-static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp);
-#endif
-
-// this is not threadsafe
-static const char *stbi__g_failure_reason;
-
-STBIDEF const char *stbi_failure_reason(void)
-{
- return stbi__g_failure_reason;
-}
-
-static int stbi__err(const char *str)
-{
- stbi__g_failure_reason = str;
- return 0;
-}
-
-static void *stbi__malloc(size_t size)
-{
- return STBI_MALLOC(size);
-}
-
-// stb_image uses ints pervasively, including for offset calculations.
-// therefore the largest decoded image size we can support with the
-// current code, even on 64-bit targets, is INT_MAX. this is not a
-// significant limitation for the intended use case.
-//
-// we do, however, need to make sure our size calculations don't
-// overflow. hence a few helper functions for size calculations that
-// multiply integers together, making sure that they're non-negative
-// and no overflow occurs.
-
-// return 1 if the sum is valid, 0 on overflow.
-// negative terms are considered invalid.
-static int stbi__addsizes_valid(int a, int b)
-{
- if (b < 0) return 0;
- // now 0 <= b <= INT_MAX, hence also
- // 0 <= INT_MAX - b <= INTMAX.
- // And "a + b <= INT_MAX" (which might overflow) is the
- // same as a <= INT_MAX - b (no overflow)
- return a <= INT_MAX - b;
-}
-
-// returns 1 if the product is valid, 0 on overflow.
-// negative factors are considered invalid.
-static int stbi__mul2sizes_valid(int a, int b)
-{
- if (a < 0 || b < 0) return 0;
- if (b == 0) return 1; // mul-by-0 is always safe
- // portable way to check for no overflows in a*b
- return a <= INT_MAX/b;
-}
-
-// returns 1 if "a*b + add" has no negative terms/factors and doesn't overflow
-static int stbi__mad2sizes_valid(int a, int b, int add)
-{
- return stbi__mul2sizes_valid(a, b) && stbi__addsizes_valid(a*b, add);
-}
-
-// returns 1 if "a*b*c + add" has no negative terms/factors and doesn't overflow
-static int stbi__mad3sizes_valid(int a, int b, int c, int add)
-{
- return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
- stbi__addsizes_valid(a*b*c, add);
-}
-
-// returns 1 if "a*b*c*d + add" has no negative terms/factors and doesn't overflow
-#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
-static int stbi__mad4sizes_valid(int a, int b, int c, int d, int add)
-{
- return stbi__mul2sizes_valid(a, b) && stbi__mul2sizes_valid(a*b, c) &&
- stbi__mul2sizes_valid(a*b*c, d) && stbi__addsizes_valid(a*b*c*d, add);
-}
-#endif
-
-// mallocs with size overflow checking
-static void *stbi__malloc_mad2(int a, int b, int add)
-{
- if (!stbi__mad2sizes_valid(a, b, add)) return NULL;
- return stbi__malloc(a*b + add);
-}
-
-static void *stbi__malloc_mad3(int a, int b, int c, int add)
-{
- if (!stbi__mad3sizes_valid(a, b, c, add)) return NULL;
- return stbi__malloc(a*b*c + add);
-}
-
-#if !defined(STBI_NO_LINEAR) || !defined(STBI_NO_HDR)
-static void *stbi__malloc_mad4(int a, int b, int c, int d, int add)
-{
- if (!stbi__mad4sizes_valid(a, b, c, d, add)) return NULL;
- return stbi__malloc(a*b*c*d + add);
-}
-#endif
-
-// stbi__err - error
-// stbi__errpf - error returning pointer to float
-// stbi__errpuc - error returning pointer to unsigned char
-
-#ifdef STBI_NO_FAILURE_STRINGS
- #define stbi__err(x,y) 0
-#elif defined(STBI_FAILURE_USERMSG)
- #define stbi__err(x,y) stbi__err(y)
-#else
- #define stbi__err(x,y) stbi__err(x)
-#endif
-
-#define stbi__errpf(x,y) ((float *)(size_t) (stbi__err(x,y)?NULL:NULL))
-#define stbi__errpuc(x,y) ((unsigned char *)(size_t) (stbi__err(x,y)?NULL:NULL))
-
-STBIDEF void stbi_image_free(void *retval_from_stbi_load)
-{
- STBI_FREE(retval_from_stbi_load);
-}
-
-#ifndef STBI_NO_LINEAR
-static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp);
-#endif
-
-#ifndef STBI_NO_HDR
-static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp);
-#endif
-
-static int stbi__vertically_flip_on_load = 0;
-
-STBIDEF void stbi_set_flip_vertically_on_load(int flag_true_if_should_flip)
-{
- stbi__vertically_flip_on_load = flag_true_if_should_flip;
-}
-
-static void *stbi__load_main(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
-{
- memset(ri, 0, sizeof(*ri)); // make sure it's initialized if we add new fields
- ri->bits_per_channel = 8; // default is 8 so most paths don't have to be changed
- ri->channel_order = STBI_ORDER_RGB; // all current input & output are this, but this is here so we can add BGR order
- ri->num_channels = 0;
-
- #ifndef STBI_NO_JPEG
- if (stbi__jpeg_test(s)) return stbi__jpeg_load(s,x,y,comp,req_comp, ri);
- #endif
- #ifndef STBI_NO_PNG
- if (stbi__png_test(s)) return stbi__png_load(s,x,y,comp,req_comp, ri);
- #endif
- #ifndef STBI_NO_BMP
- if (stbi__bmp_test(s)) return stbi__bmp_load(s,x,y,comp,req_comp, ri);
- #endif
- #ifndef STBI_NO_GIF
- if (stbi__gif_test(s)) return stbi__gif_load(s,x,y,comp,req_comp, ri);
- #endif
- #ifndef STBI_NO_PSD
- if (stbi__psd_test(s)) return stbi__psd_load(s,x,y,comp,req_comp, ri, bpc);
- #endif
- #ifndef STBI_NO_PIC
- if (stbi__pic_test(s)) return stbi__pic_load(s,x,y,comp,req_comp, ri);
- #endif
- #ifndef STBI_NO_PNM
- if (stbi__pnm_test(s)) return stbi__pnm_load(s,x,y,comp,req_comp, ri);
- #endif
-
- #ifndef STBI_NO_HDR
- if (stbi__hdr_test(s)) {
- float *hdr = stbi__hdr_load(s, x,y,comp,req_comp, ri);
- return stbi__hdr_to_ldr(hdr, *x, *y, req_comp ? req_comp : *comp);
- }
- #endif
-
- #ifndef STBI_NO_TGA
- // test tga last because it's a crappy test!
- if (stbi__tga_test(s))
- return stbi__tga_load(s,x,y,comp,req_comp, ri);
- #endif
-
- return stbi__errpuc("unknown image type", "Image not of any known type, or corrupt");
-}
-
-static stbi_uc *stbi__convert_16_to_8(stbi__uint16 *orig, int w, int h, int channels)
-{
- int i;
- int img_len = w * h * channels;
- stbi_uc *reduced;
-
- reduced = (stbi_uc *) stbi__malloc(img_len);
- if (reduced == NULL) return stbi__errpuc("outofmem", "Out of memory");
-
- for (i = 0; i < img_len; ++i)
- reduced[i] = (stbi_uc)((orig[i] >> 8) & 0xFF); // top half of each byte is sufficient approx of 16->8 bit scaling
-
- STBI_FREE(orig);
- return reduced;
-}
-
-static stbi__uint16 *stbi__convert_8_to_16(stbi_uc *orig, int w, int h, int channels)
-{
- int i;
- int img_len = w * h * channels;
- stbi__uint16 *enlarged;
-
- enlarged = (stbi__uint16 *) stbi__malloc(img_len*2);
- if (enlarged == NULL) return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory");
-
- for (i = 0; i < img_len; ++i)
- enlarged[i] = (stbi__uint16)((orig[i] << 8) + orig[i]); // replicate to high and low byte, maps 0->0, 255->0xffff
-
- STBI_FREE(orig);
- return enlarged;
-}
-
-static void stbi__vertical_flip(void *image, int w, int h, int bytes_per_pixel)
-{
- int row;
- size_t bytes_per_row = (size_t)w * bytes_per_pixel;
- stbi_uc temp[2048];
- stbi_uc *bytes = (stbi_uc *)image;
-
- for (row = 0; row < (h>>1); row++) {
- stbi_uc *row0 = bytes + row*bytes_per_row;
- stbi_uc *row1 = bytes + (h - row - 1)*bytes_per_row;
- // swap row0 with row1
- size_t bytes_left = bytes_per_row;
- while (bytes_left) {
- size_t bytes_copy = (bytes_left < sizeof(temp)) ? bytes_left : sizeof(temp);
- memcpy(temp, row0, bytes_copy);
- memcpy(row0, row1, bytes_copy);
- memcpy(row1, temp, bytes_copy);
- row0 += bytes_copy;
- row1 += bytes_copy;
- bytes_left -= bytes_copy;
- }
- }
-}
-
-static void stbi__vertical_flip_slices(void *image, int w, int h, int z, int bytes_per_pixel)
-{
- int slice;
- int slice_size = w * h * bytes_per_pixel;
-
- stbi_uc *bytes = (stbi_uc *)image;
- for (slice = 0; slice < z; ++slice) {
- stbi__vertical_flip(bytes, w, h, bytes_per_pixel);
- bytes += slice_size;
- }
-}
-
-static unsigned char *stbi__load_and_postprocess_8bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
-{
- stbi__result_info ri;
- void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 8);
-
- if (result == NULL)
- return NULL;
-
- if (ri.bits_per_channel != 8) {
- STBI_ASSERT(ri.bits_per_channel == 16);
- result = stbi__convert_16_to_8((stbi__uint16 *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
- ri.bits_per_channel = 8;
- }
-
- // @TODO: move stbi__convert_format to here
-
- if (stbi__vertically_flip_on_load) {
- int channels = req_comp ? req_comp : *comp;
- stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi_uc));
- }
-
- return (unsigned char *) result;
-}
-
-static stbi__uint16 *stbi__load_and_postprocess_16bit(stbi__context *s, int *x, int *y, int *comp, int req_comp)
-{
- stbi__result_info ri;
- void *result = stbi__load_main(s, x, y, comp, req_comp, &ri, 16);
-
- if (result == NULL)
- return NULL;
-
- if (ri.bits_per_channel != 16) {
- STBI_ASSERT(ri.bits_per_channel == 8);
- result = stbi__convert_8_to_16((stbi_uc *) result, *x, *y, req_comp == 0 ? *comp : req_comp);
- ri.bits_per_channel = 16;
- }
-
- // @TODO: move stbi__convert_format16 to here
- // @TODO: special case RGB-to-Y (and RGBA-to-YA) for 8-bit-to-16-bit case to keep more precision
-
- if (stbi__vertically_flip_on_load) {
- int channels = req_comp ? req_comp : *comp;
- stbi__vertical_flip(result, *x, *y, channels * sizeof(stbi__uint16));
- }
-
- return (stbi__uint16 *) result;
-}
-
-#if !defined(STBI_NO_HDR) || !defined(STBI_NO_LINEAR)
-static void stbi__float_postprocess(float *result, int *x, int *y, int *comp, int req_comp)
-{
- if (stbi__vertically_flip_on_load && result != NULL) {
- int channels = req_comp ? req_comp : *comp;
- stbi__vertical_flip(result, *x, *y, channels * sizeof(float));
- }
-}
-#endif
-
-#ifndef STBI_NO_STDIO
-
-static FILE *stbi__fopen(char const *filename, char const *mode)
-{
- FILE *f;
-#if defined(_MSC_VER) && _MSC_VER >= 1400
- if (0 != fopen_s(&f, filename, mode))
- f=0;
-#else
- f = fopen(filename, mode);
-#endif
- return f;
-}
-
-
-STBIDEF stbi_uc *stbi_load(char const *filename, int *x, int *y, int *comp, int req_comp)
-{
- FILE *f = stbi__fopen(filename, "rb");
- unsigned char *result;
- if (!f) return stbi__errpuc("can't fopen", "Unable to open file");
- result = stbi_load_from_file(f,x,y,comp,req_comp);
- fclose(f);
- return result;
-}
-
-STBIDEF stbi_uc *stbi_load_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
-{
- unsigned char *result;
- stbi__context s;
- stbi__start_file(&s,f);
- result = stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
- if (result) {
- // need to 'unget' all the characters in the IO buffer
- fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
- }
- return result;
-}
-
-STBIDEF stbi__uint16 *stbi_load_from_file_16(FILE *f, int *x, int *y, int *comp, int req_comp)
-{
- stbi__uint16 *result;
- stbi__context s;
- stbi__start_file(&s,f);
- result = stbi__load_and_postprocess_16bit(&s,x,y,comp,req_comp);
- if (result) {
- // need to 'unget' all the characters in the IO buffer
- fseek(f, - (int) (s.img_buffer_end - s.img_buffer), SEEK_CUR);
- }
- return result;
-}
-
-STBIDEF stbi_us *stbi_load_16(char const *filename, int *x, int *y, int *comp, int req_comp)
-{
- FILE *f = stbi__fopen(filename, "rb");
- stbi__uint16 *result;
- if (!f) return (stbi_us *) stbi__errpuc("can't fopen", "Unable to open file");
- result = stbi_load_from_file_16(f,x,y,comp,req_comp);
- fclose(f);
- return result;
-}
-
-
-#endif //!STBI_NO_STDIO
-
-STBIDEF stbi_us *stbi_load_16_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *channels_in_file, int desired_channels)
-{
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
-}
-
-STBIDEF stbi_us *stbi_load_16_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *channels_in_file, int desired_channels)
-{
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *)clbk, user);
- return stbi__load_and_postprocess_16bit(&s,x,y,channels_in_file,desired_channels);
-}
-
-STBIDEF stbi_uc *stbi_load_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
-{
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
-}
-
-STBIDEF stbi_uc *stbi_load_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
-{
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi__load_and_postprocess_8bit(&s,x,y,comp,req_comp);
-}
-
-#ifndef STBI_NO_GIF
-STBIDEF stbi_uc *stbi_load_gif_from_memory(stbi_uc const *buffer, int len, int **delays, int *x, int *y, int *z, int *comp, int req_comp)
-{
- unsigned char *result;
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
-
- result = (unsigned char*) stbi__load_gif_main(&s, delays, x, y, z, comp, req_comp);
- if (stbi__vertically_flip_on_load) {
- stbi__vertical_flip_slices( result, *x, *y, *z, *comp );
- }
-
- return result;
-}
-#endif
-
-#ifndef STBI_NO_LINEAR
-static float *stbi__loadf_main(stbi__context *s, int *x, int *y, int *comp, int req_comp)
-{
- unsigned char *data;
- #ifndef STBI_NO_HDR
- if (stbi__hdr_test(s)) {
- stbi__result_info ri;
- float *hdr_data = stbi__hdr_load(s,x,y,comp,req_comp, &ri);
- if (hdr_data)
- stbi__float_postprocess(hdr_data,x,y,comp,req_comp);
- return hdr_data;
- }
- #endif
- data = stbi__load_and_postprocess_8bit(s, x, y, comp, req_comp);
- if (data)
- return stbi__ldr_to_hdr(data, *x, *y, req_comp ? req_comp : *comp);
- return stbi__errpf("unknown image type", "Image not of any known type, or corrupt");
-}
-
-STBIDEF float *stbi_loadf_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp, int req_comp)
-{
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__loadf_main(&s,x,y,comp,req_comp);
-}
-
-STBIDEF float *stbi_loadf_from_callbacks(stbi_io_callbacks const *clbk, void *user, int *x, int *y, int *comp, int req_comp)
-{
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi__loadf_main(&s,x,y,comp,req_comp);
-}
-
-#ifndef STBI_NO_STDIO
-STBIDEF float *stbi_loadf(char const *filename, int *x, int *y, int *comp, int req_comp)
-{
- float *result;
- FILE *f = stbi__fopen(filename, "rb");
- if (!f) return stbi__errpf("can't fopen", "Unable to open file");
- result = stbi_loadf_from_file(f,x,y,comp,req_comp);
- fclose(f);
- return result;
-}
-
-STBIDEF float *stbi_loadf_from_file(FILE *f, int *x, int *y, int *comp, int req_comp)
-{
- stbi__context s;
- stbi__start_file(&s,f);
- return stbi__loadf_main(&s,x,y,comp,req_comp);
-}
-#endif // !STBI_NO_STDIO
-
-#endif // !STBI_NO_LINEAR
-
-// these is-hdr-or-not is defined independent of whether STBI_NO_LINEAR is
-// defined, for API simplicity; if STBI_NO_LINEAR is defined, it always
-// reports false!
-
-STBIDEF int stbi_is_hdr_from_memory(stbi_uc const *buffer, int len)
-{
- #ifndef STBI_NO_HDR
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__hdr_test(&s);
- #else
- STBI_NOTUSED(buffer);
- STBI_NOTUSED(len);
- return 0;
- #endif
-}
-
-#ifndef STBI_NO_STDIO
-STBIDEF int stbi_is_hdr (char const *filename)
-{
- FILE *f = stbi__fopen(filename, "rb");
- int result=0;
- if (f) {
- result = stbi_is_hdr_from_file(f);
- fclose(f);
- }
- return result;
-}
-
-STBIDEF int stbi_is_hdr_from_file(FILE *f)
-{
- #ifndef STBI_NO_HDR
- long pos = ftell(f);
- int res;
- stbi__context s;
- stbi__start_file(&s,f);
- res = stbi__hdr_test(&s);
- fseek(f, pos, SEEK_SET);
- return res;
- #else
- STBI_NOTUSED(f);
- return 0;
- #endif
-}
-#endif // !STBI_NO_STDIO
-
-STBIDEF int stbi_is_hdr_from_callbacks(stbi_io_callbacks const *clbk, void *user)
-{
- #ifndef STBI_NO_HDR
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *) clbk, user);
- return stbi__hdr_test(&s);
- #else
- STBI_NOTUSED(clbk);
- STBI_NOTUSED(user);
- return 0;
- #endif
-}
-
-#ifndef STBI_NO_LINEAR
-static float stbi__l2h_gamma=2.2f, stbi__l2h_scale=1.0f;
-
-STBIDEF void stbi_ldr_to_hdr_gamma(float gamma) { stbi__l2h_gamma = gamma; }
-STBIDEF void stbi_ldr_to_hdr_scale(float scale) { stbi__l2h_scale = scale; }
-#endif
-
-static float stbi__h2l_gamma_i=1.0f/2.2f, stbi__h2l_scale_i=1.0f;
-
-STBIDEF void stbi_hdr_to_ldr_gamma(float gamma) { stbi__h2l_gamma_i = 1/gamma; }
-STBIDEF void stbi_hdr_to_ldr_scale(float scale) { stbi__h2l_scale_i = 1/scale; }
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Common code used by all image loaders
-//
-
-enum
-{
- STBI__SCAN_load=0,
- STBI__SCAN_type,
- STBI__SCAN_header
-};
-
-static void stbi__refill_buffer(stbi__context *s)
-{
- int n = (s->io.read)(s->io_user_data,(char*)s->buffer_start,s->buflen);
- if (n == 0) {
- // at end of file, treat same as if from memory, but need to handle case
- // where s->img_buffer isn't pointing to safe memory, e.g. 0-byte file
- s->read_from_callbacks = 0;
- s->img_buffer = s->buffer_start;
- s->img_buffer_end = s->buffer_start+1;
- *s->img_buffer = 0;
- } else {
- s->img_buffer = s->buffer_start;
- s->img_buffer_end = s->buffer_start + n;
- }
-}
-
-stbi_inline static stbi_uc stbi__get8(stbi__context *s)
-{
- if (s->img_buffer < s->img_buffer_end)
- return *s->img_buffer++;
- if (s->read_from_callbacks) {
- stbi__refill_buffer(s);
- return *s->img_buffer++;
- }
- return 0;
-}
-
-stbi_inline static int stbi__at_eof(stbi__context *s)
-{
- if (s->io.read) {
- if (!(s->io.eof)(s->io_user_data)) return 0;
- // if feof() is true, check if buffer = end
- // special case: we've only got the special 0 character at the end
- if (s->read_from_callbacks == 0) return 1;
- }
-
- return s->img_buffer >= s->img_buffer_end;
-}
-
-static void stbi__skip(stbi__context *s, int n)
-{
- if (n < 0) {
- s->img_buffer = s->img_buffer_end;
- return;
- }
- if (s->io.read) {
- int blen = (int) (s->img_buffer_end - s->img_buffer);
- if (blen < n) {
- s->img_buffer = s->img_buffer_end;
- (s->io.skip)(s->io_user_data, n - blen);
- return;
- }
- }
- s->img_buffer += n;
-}
-
-static int stbi__getn(stbi__context *s, stbi_uc *buffer, int n)
-{
- if (s->io.read) {
- int blen = (int) (s->img_buffer_end - s->img_buffer);
- if (blen < n) {
- int res, count;
-
- memcpy(buffer, s->img_buffer, blen);
-
- count = (s->io.read)(s->io_user_data, (char*) buffer + blen, n - blen);
- res = (count == (n-blen));
- s->img_buffer = s->img_buffer_end;
- return res;
- }
- }
-
- if (s->img_buffer+n <= s->img_buffer_end) {
- memcpy(buffer, s->img_buffer, n);
- s->img_buffer += n;
- return 1;
- } else
- return 0;
-}
-
-static int stbi__get16be(stbi__context *s)
-{
- int z = stbi__get8(s);
- return (z << 8) + stbi__get8(s);
-}
-
-static stbi__uint32 stbi__get32be(stbi__context *s)
-{
- stbi__uint32 z = stbi__get16be(s);
- return (z << 16) + stbi__get16be(s);
-}
-
-#if defined(STBI_NO_BMP) && defined(STBI_NO_TGA) && defined(STBI_NO_GIF)
-// nothing
-#else
-static int stbi__get16le(stbi__context *s)
-{
- int z = stbi__get8(s);
- return z + (stbi__get8(s) << 8);
-}
-#endif
-
-#ifndef STBI_NO_BMP
-static stbi__uint32 stbi__get32le(stbi__context *s)
-{
- stbi__uint32 z = stbi__get16le(s);
- return z + (stbi__get16le(s) << 16);
-}
-#endif
-
-#define STBI__BYTECAST(x) ((stbi_uc) ((x) & 255)) // truncate int to byte without warnings
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// generic converter from built-in img_n to req_comp
-// individual types do this automatically as much as possible (e.g. jpeg
-// does all cases internally since it needs to colorspace convert anyway,
-// and it never has alpha, so very few cases ). png can automatically
-// interleave an alpha=255 channel, but falls back to this for other cases
-//
-// assume data buffer is malloced, so malloc a new one and free that one
-// only failure mode is malloc failing
-
-static stbi_uc stbi__compute_y(int r, int g, int b)
-{
- return (stbi_uc) (((r*77) + (g*150) + (29*b)) >> 8);
-}
-
-static unsigned char *stbi__convert_format(unsigned char *data, int img_n, int req_comp, unsigned int x, unsigned int y)
-{
- int i,j;
- unsigned char *good;
-
- if (req_comp == img_n) return data;
- STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
-
- good = (unsigned char *) stbi__malloc_mad3(req_comp, x, y, 0);
- if (good == NULL) {
- STBI_FREE(data);
- return stbi__errpuc("outofmem", "Out of memory");
- }
-
- for (j=0; j < (int) y; ++j) {
- unsigned char *src = data + j * x * img_n ;
- unsigned char *dest = good + j * x * req_comp;
-
- #define STBI__COMBO(a,b) ((a)*8+(b))
- #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
- // convert source image with img_n components to one with req_comp components;
- // avoid switch per pixel, so use switch per scanline and massive macros
- switch (STBI__COMBO(img_n, req_comp)) {
- STBI__CASE(1,2) { dest[0]=src[0], dest[1]=255; } break;
- STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
- STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=255; } break;
- STBI__CASE(2,1) { dest[0]=src[0]; } break;
- STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
- STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;
- STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=255; } break;
- STBI__CASE(3,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;
- STBI__CASE(3,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = 255; } break;
- STBI__CASE(4,1) { dest[0]=stbi__compute_y(src[0],src[1],src[2]); } break;
- STBI__CASE(4,2) { dest[0]=stbi__compute_y(src[0],src[1],src[2]), dest[1] = src[3]; } break;
- STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;
- default: STBI_ASSERT(0);
- }
- #undef STBI__CASE
- }
-
- STBI_FREE(data);
- return good;
-}
-
-static stbi__uint16 stbi__compute_y_16(int r, int g, int b)
-{
- return (stbi__uint16) (((r*77) + (g*150) + (29*b)) >> 8);
-}
-
-static stbi__uint16 *stbi__convert_format16(stbi__uint16 *data, int img_n, int req_comp, unsigned int x, unsigned int y)
-{
- int i,j;
- stbi__uint16 *good;
-
- if (req_comp == img_n) return data;
- STBI_ASSERT(req_comp >= 1 && req_comp <= 4);
-
- good = (stbi__uint16 *) stbi__malloc(req_comp * x * y * 2);
- if (good == NULL) {
- STBI_FREE(data);
- return (stbi__uint16 *) stbi__errpuc("outofmem", "Out of memory");
- }
-
- for (j=0; j < (int) y; ++j) {
- stbi__uint16 *src = data + j * x * img_n ;
- stbi__uint16 *dest = good + j * x * req_comp;
-
- #define STBI__COMBO(a,b) ((a)*8+(b))
- #define STBI__CASE(a,b) case STBI__COMBO(a,b): for(i=x-1; i >= 0; --i, src += a, dest += b)
- // convert source image with img_n components to one with req_comp components;
- // avoid switch per pixel, so use switch per scanline and massive macros
- switch (STBI__COMBO(img_n, req_comp)) {
- STBI__CASE(1,2) { dest[0]=src[0], dest[1]=0xffff; } break;
- STBI__CASE(1,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
- STBI__CASE(1,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=0xffff; } break;
- STBI__CASE(2,1) { dest[0]=src[0]; } break;
- STBI__CASE(2,3) { dest[0]=dest[1]=dest[2]=src[0]; } break;
- STBI__CASE(2,4) { dest[0]=dest[1]=dest[2]=src[0], dest[3]=src[1]; } break;
- STBI__CASE(3,4) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2],dest[3]=0xffff; } break;
- STBI__CASE(3,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;
- STBI__CASE(3,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = 0xffff; } break;
- STBI__CASE(4,1) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]); } break;
- STBI__CASE(4,2) { dest[0]=stbi__compute_y_16(src[0],src[1],src[2]), dest[1] = src[3]; } break;
- STBI__CASE(4,3) { dest[0]=src[0],dest[1]=src[1],dest[2]=src[2]; } break;
- default: STBI_ASSERT(0);
- }
- #undef STBI__CASE
- }
-
- STBI_FREE(data);
- return good;
-}
-
-#ifndef STBI_NO_LINEAR
-static float *stbi__ldr_to_hdr(stbi_uc *data, int x, int y, int comp)
-{
- int i,k,n;
- float *output;
- if (!data) return NULL;
- output = (float *) stbi__malloc_mad4(x, y, comp, sizeof(float), 0);
- if (output == NULL) { STBI_FREE(data); return stbi__errpf("outofmem", "Out of memory"); }
- // compute number of non-alpha components
- if (comp & 1) n = comp; else n = comp-1;
- for (i=0; i < x*y; ++i) {
- for (k=0; k < n; ++k) {
- output[i*comp + k] = (float) (pow(data[i*comp+k]/255.0f, stbi__l2h_gamma) * stbi__l2h_scale);
- }
- if (k < comp) output[i*comp + k] = data[i*comp+k]/255.0f;
- }
- STBI_FREE(data);
- return output;
-}
-#endif
-
-#ifndef STBI_NO_HDR
-#define stbi__float2int(x) ((int) (x))
-static stbi_uc *stbi__hdr_to_ldr(float *data, int x, int y, int comp)
-{
- int i,k,n;
- stbi_uc *output;
- if (!data) return NULL;
- output = (stbi_uc *) stbi__malloc_mad3(x, y, comp, 0);
- if (output == NULL) { STBI_FREE(data); return stbi__errpuc("outofmem", "Out of memory"); }
- // compute number of non-alpha components
- if (comp & 1) n = comp; else n = comp-1;
- for (i=0; i < x*y; ++i) {
- for (k=0; k < n; ++k) {
- float z = (float) pow(data[i*comp+k]*stbi__h2l_scale_i, stbi__h2l_gamma_i) * 255 + 0.5f;
- if (z < 0) z = 0;
- if (z > 255) z = 255;
- output[i*comp + k] = (stbi_uc) stbi__float2int(z);
- }
- if (k < comp) {
- float z = data[i*comp+k] * 255 + 0.5f;
- if (z < 0) z = 0;
- if (z > 255) z = 255;
- output[i*comp + k] = (stbi_uc) stbi__float2int(z);
- }
- }
- STBI_FREE(data);
- return output;
-}
-#endif
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// "baseline" JPEG/JFIF decoder
-//
-// simple implementation
-// - doesn't support delayed output of y-dimension
-// - simple interface (only one output format: 8-bit interleaved RGB)
-// - doesn't try to recover corrupt jpegs
-// - doesn't allow partial loading, loading multiple at once
-// - still fast on x86 (copying globals into locals doesn't help x86)
-// - allocates lots of intermediate memory (full size of all components)
-// - non-interleaved case requires this anyway
-// - allows good upsampling (see next)
-// high-quality
-// - upsampled channels are bilinearly interpolated, even across blocks
-// - quality integer IDCT derived from IJG's 'slow'
-// performance
-// - fast huffman; reasonable integer IDCT
-// - some SIMD kernels for common paths on targets with SSE2/NEON
-// - uses a lot of intermediate memory, could cache poorly
-
-#ifndef STBI_NO_JPEG
-
-// huffman decoding acceleration
-#define FAST_BITS 9 // larger handles more cases; smaller stomps less cache
-
-typedef struct
-{
- stbi_uc fast[1 << FAST_BITS];
- // weirdly, repacking this into AoS is a 10% speed loss, instead of a win
- stbi__uint16 code[256];
- stbi_uc values[256];
- stbi_uc size[257];
- unsigned int maxcode[18];
- int delta[17]; // old 'firstsymbol' - old 'firstcode'
-} stbi__huffman;
-
-typedef struct
-{
- stbi__context *s;
- stbi__huffman huff_dc[4];
- stbi__huffman huff_ac[4];
- stbi__uint16 dequant[4][64];
- stbi__int16 fast_ac[4][1 << FAST_BITS];
-
-// sizes for components, interleaved MCUs
- int img_h_max, img_v_max;
- int img_mcu_x, img_mcu_y;
- int img_mcu_w, img_mcu_h;
-
-// definition of jpeg image component
- struct
- {
- int id;
- int h,v;
- int tq;
- int hd,ha;
- int dc_pred;
-
- int x,y,w2,h2;
- stbi_uc *data;
- void *raw_data, *raw_coeff;
- stbi_uc *linebuf;
- short *coeff; // progressive only
- int coeff_w, coeff_h; // number of 8x8 coefficient blocks
- } img_comp[4];
-
- stbi__uint32 code_buffer; // jpeg entropy-coded buffer
- int code_bits; // number of valid bits
- unsigned char marker; // marker seen while filling entropy buffer
- int nomore; // flag if we saw a marker so must stop
-
- int progressive;
- int spec_start;
- int spec_end;
- int succ_high;
- int succ_low;
- int eob_run;
- int jfif;
- int app14_color_transform; // Adobe APP14 tag
- int rgb;
-
- int scan_n, order[4];
- int restart_interval, todo;
-
-// kernels
- void (*idct_block_kernel)(stbi_uc *out, int out_stride, short data[64]);
- void (*YCbCr_to_RGB_kernel)(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step);
- stbi_uc *(*resample_row_hv_2_kernel)(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs);
-} stbi__jpeg;
-
-static int stbi__build_huffman(stbi__huffman *h, int *count)
-{
- int i,j,k=0;
- unsigned int code;
- // build size list for each symbol (from JPEG spec)
- for (i=0; i < 16; ++i)
- for (j=0; j < count[i]; ++j)
- h->size[k++] = (stbi_uc) (i+1);
- h->size[k] = 0;
-
- // compute actual symbols (from jpeg spec)
- code = 0;
- k = 0;
- for(j=1; j <= 16; ++j) {
- // compute delta to add to code to compute symbol id
- h->delta[j] = k - code;
- if (h->size[k] == j) {
- while (h->size[k] == j)
- h->code[k++] = (stbi__uint16) (code++);
- if (code-1 >= (1u << j)) return stbi__err("bad code lengths","Corrupt JPEG");
- }
- // compute largest code + 1 for this size, preshifted as needed later
- h->maxcode[j] = code << (16-j);
- code <<= 1;
- }
- h->maxcode[j] = 0xffffffff;
-
- // build non-spec acceleration table; 255 is flag for not-accelerated
- memset(h->fast, 255, 1 << FAST_BITS);
- for (i=0; i < k; ++i) {
- int s = h->size[i];
- if (s <= FAST_BITS) {
- int c = h->code[i] << (FAST_BITS-s);
- int m = 1 << (FAST_BITS-s);
- for (j=0; j < m; ++j) {
- h->fast[c+j] = (stbi_uc) i;
- }
- }
- }
- return 1;
-}
-
-// build a table that decodes both magnitude and value of small ACs in
-// one go.
-static void stbi__build_fast_ac(stbi__int16 *fast_ac, stbi__huffman *h)
-{
- int i;
- for (i=0; i < (1 << FAST_BITS); ++i) {
- stbi_uc fast = h->fast[i];
- fast_ac[i] = 0;
- if (fast < 255) {
- int rs = h->values[fast];
- int run = (rs >> 4) & 15;
- int magbits = rs & 15;
- int len = h->size[fast];
-
- if (magbits && len + magbits <= FAST_BITS) {
- // magnitude code followed by receive_extend code
- int k = ((i << len) & ((1 << FAST_BITS) - 1)) >> (FAST_BITS - magbits);
- int m = 1 << (magbits - 1);
- if (k < m) k += (~0U << magbits) + 1;
- // if the result is small enough, we can fit it in fast_ac table
- if (k >= -128 && k <= 127)
- fast_ac[i] = (stbi__int16) ((k * 256) + (run * 16) + (len + magbits));
- }
- }
- }
-}
-
-static void stbi__grow_buffer_unsafe(stbi__jpeg *j)
-{
- do {
- unsigned int b = j->nomore ? 0 : stbi__get8(j->s);
- if (b == 0xff) {
- int c = stbi__get8(j->s);
- while (c == 0xff) c = stbi__get8(j->s); // consume fill bytes
- if (c != 0) {
- j->marker = (unsigned char) c;
- j->nomore = 1;
- return;
- }
- }
- j->code_buffer |= b << (24 - j->code_bits);
- j->code_bits += 8;
- } while (j->code_bits <= 24);
-}
-
-// (1 << n) - 1
-static const stbi__uint32 stbi__bmask[17]={0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535};
-
-// decode a jpeg huffman value from the bitstream
-stbi_inline static int stbi__jpeg_huff_decode(stbi__jpeg *j, stbi__huffman *h)
-{
- unsigned int temp;
- int c,k;
-
- if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
-
- // look at the top FAST_BITS and determine what symbol ID it is,
- // if the code is <= FAST_BITS
- c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
- k = h->fast[c];
- if (k < 255) {
- int s = h->size[k];
- if (s > j->code_bits)
- return -1;
- j->code_buffer <<= s;
- j->code_bits -= s;
- return h->values[k];
- }
-
- // naive test is to shift the code_buffer down so k bits are
- // valid, then test against maxcode. To speed this up, we've
- // preshifted maxcode left so that it has (16-k) 0s at the
- // end; in other words, regardless of the number of bits, it
- // wants to be compared against something shifted to have 16;
- // that way we don't need to shift inside the loop.
- temp = j->code_buffer >> 16;
- for (k=FAST_BITS+1 ; ; ++k)
- if (temp < h->maxcode[k])
- break;
- if (k == 17) {
- // error! code not found
- j->code_bits -= 16;
- return -1;
- }
-
- if (k > j->code_bits)
- return -1;
-
- // convert the huffman code to the symbol id
- c = ((j->code_buffer >> (32 - k)) & stbi__bmask[k]) + h->delta[k];
- STBI_ASSERT((((j->code_buffer) >> (32 - h->size[c])) & stbi__bmask[h->size[c]]) == h->code[c]);
-
- // convert the id to a symbol
- j->code_bits -= k;
- j->code_buffer <<= k;
- return h->values[c];
-}
-
-// bias[n] = (-1<<n) + 1
-static const int stbi__jbias[16] = {0,-1,-3,-7,-15,-31,-63,-127,-255,-511,-1023,-2047,-4095,-8191,-16383,-32767};
-
-// combined JPEG 'receive' and JPEG 'extend', since baseline
-// always extends everything it receives.
-stbi_inline static int stbi__extend_receive(stbi__jpeg *j, int n)
-{
- unsigned int k;
- int sgn;
- if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
-
- sgn = (stbi__int32)j->code_buffer >> 31; // sign bit is always in MSB
- k = stbi_lrot(j->code_buffer, n);
- STBI_ASSERT(n >= 0 && n < (int) (sizeof(stbi__bmask)/sizeof(*stbi__bmask)));
- j->code_buffer = k & ~stbi__bmask[n];
- k &= stbi__bmask[n];
- j->code_bits -= n;
- return k + (stbi__jbias[n] & ~sgn);
-}
-
-// get some unsigned bits
-stbi_inline static int stbi__jpeg_get_bits(stbi__jpeg *j, int n)
-{
- unsigned int k;
- if (j->code_bits < n) stbi__grow_buffer_unsafe(j);
- k = stbi_lrot(j->code_buffer, n);
- j->code_buffer = k & ~stbi__bmask[n];
- k &= stbi__bmask[n];
- j->code_bits -= n;
- return k;
-}
-
-stbi_inline static int stbi__jpeg_get_bit(stbi__jpeg *j)
-{
- unsigned int k;
- if (j->code_bits < 1) stbi__grow_buffer_unsafe(j);
- k = j->code_buffer;
- j->code_buffer <<= 1;
- --j->code_bits;
- return k & 0x80000000;
-}
-
-// given a value that's at position X in the zigzag stream,
-// where does it appear in the 8x8 matrix coded as row-major?
-static const stbi_uc stbi__jpeg_dezigzag[64+15] =
-{
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63,
- // let corrupt input sample past end
- 63, 63, 63, 63, 63, 63, 63, 63,
- 63, 63, 63, 63, 63, 63, 63
-};
-
-// decode one 64-entry block--
-static int stbi__jpeg_decode_block(stbi__jpeg *j, short data[64], stbi__huffman *hdc, stbi__huffman *hac, stbi__int16 *fac, int b, stbi__uint16 *dequant)
-{
- int diff,dc,k;
- int t;
-
- if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
- t = stbi__jpeg_huff_decode(j, hdc);
- if (t < 0) return stbi__err("bad huffman code","Corrupt JPEG");
-
- // 0 all the ac values now so we can do it 32-bits at a time
- memset(data,0,64*sizeof(data[0]));
-
- diff = t ? stbi__extend_receive(j, t) : 0;
- dc = j->img_comp[b].dc_pred + diff;
- j->img_comp[b].dc_pred = dc;
- data[0] = (short) (dc * dequant[0]);
-
- // decode AC components, see JPEG spec
- k = 1;
- do {
- unsigned int zig;
- int c,r,s;
- if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
- c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
- r = fac[c];
- if (r) { // fast-AC path
- k += (r >> 4) & 15; // run
- s = r & 15; // combined length
- j->code_buffer <<= s;
- j->code_bits -= s;
- // decode into unzigzag'd location
- zig = stbi__jpeg_dezigzag[k++];
- data[zig] = (short) ((r >> 8) * dequant[zig]);
- } else {
- int rs = stbi__jpeg_huff_decode(j, hac);
- if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
- s = rs & 15;
- r = rs >> 4;
- if (s == 0) {
- if (rs != 0xf0) break; // end block
- k += 16;
- } else {
- k += r;
- // decode into unzigzag'd location
- zig = stbi__jpeg_dezigzag[k++];
- data[zig] = (short) (stbi__extend_receive(j,s) * dequant[zig]);
- }
- }
- } while (k < 64);
- return 1;
-}
-
-static int stbi__jpeg_decode_block_prog_dc(stbi__jpeg *j, short data[64], stbi__huffman *hdc, int b)
-{
- int diff,dc;
- int t;
- if (j->spec_end != 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
-
- if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
-
- if (j->succ_high == 0) {
- // first scan for DC coefficient, must be first
- memset(data,0,64*sizeof(data[0])); // 0 all the ac values now
- t = stbi__jpeg_huff_decode(j, hdc);
- diff = t ? stbi__extend_receive(j, t) : 0;
-
- dc = j->img_comp[b].dc_pred + diff;
- j->img_comp[b].dc_pred = dc;
- data[0] = (short) (dc << j->succ_low);
- } else {
- // refinement scan for DC coefficient
- if (stbi__jpeg_get_bit(j))
- data[0] += (short) (1 << j->succ_low);
- }
- return 1;
-}
-
-// @OPTIMIZE: store non-zigzagged during the decode passes,
-// and only de-zigzag when dequantizing
-static int stbi__jpeg_decode_block_prog_ac(stbi__jpeg *j, short data[64], stbi__huffman *hac, stbi__int16 *fac)
-{
- int k;
- if (j->spec_start == 0) return stbi__err("can't merge dc and ac", "Corrupt JPEG");
-
- if (j->succ_high == 0) {
- int shift = j->succ_low;
-
- if (j->eob_run) {
- --j->eob_run;
- return 1;
- }
-
- k = j->spec_start;
- do {
- unsigned int zig;
- int c,r,s;
- if (j->code_bits < 16) stbi__grow_buffer_unsafe(j);
- c = (j->code_buffer >> (32 - FAST_BITS)) & ((1 << FAST_BITS)-1);
- r = fac[c];
- if (r) { // fast-AC path
- k += (r >> 4) & 15; // run
- s = r & 15; // combined length
- j->code_buffer <<= s;
- j->code_bits -= s;
- zig = stbi__jpeg_dezigzag[k++];
- data[zig] = (short) ((r >> 8) << shift);
- } else {
- int rs = stbi__jpeg_huff_decode(j, hac);
- if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
- s = rs & 15;
- r = rs >> 4;
- if (s == 0) {
- if (r < 15) {
- j->eob_run = (1 << r);
- if (r)
- j->eob_run += stbi__jpeg_get_bits(j, r);
- --j->eob_run;
- break;
- }
- k += 16;
- } else {
- k += r;
- zig = stbi__jpeg_dezigzag[k++];
- data[zig] = (short) (stbi__extend_receive(j,s) << shift);
- }
- }
- } while (k <= j->spec_end);
- } else {
- // refinement scan for these AC coefficients
-
- short bit = (short) (1 << j->succ_low);
-
- if (j->eob_run) {
- --j->eob_run;
- for (k = j->spec_start; k <= j->spec_end; ++k) {
- short *p = &data[stbi__jpeg_dezigzag[k]];
- if (*p != 0)
- if (stbi__jpeg_get_bit(j))
- if ((*p & bit)==0) {
- if (*p > 0)
- *p += bit;
- else
- *p -= bit;
- }
- }
- } else {
- k = j->spec_start;
- do {
- int r,s;
- int rs = stbi__jpeg_huff_decode(j, hac); // @OPTIMIZE see if we can use the fast path here, advance-by-r is so slow, eh
- if (rs < 0) return stbi__err("bad huffman code","Corrupt JPEG");
- s = rs & 15;
- r = rs >> 4;
- if (s == 0) {
- if (r < 15) {
- j->eob_run = (1 << r) - 1;
- if (r)
- j->eob_run += stbi__jpeg_get_bits(j, r);
- r = 64; // force end of block
- } else {
- // r=15 s=0 should write 16 0s, so we just do
- // a run of 15 0s and then write s (which is 0),
- // so we don't have to do anything special here
- }
- } else {
- if (s != 1) return stbi__err("bad huffman code", "Corrupt JPEG");
- // sign bit
- if (stbi__jpeg_get_bit(j))
- s = bit;
- else
- s = -bit;
- }
-
- // advance by r
- while (k <= j->spec_end) {
- short *p = &data[stbi__jpeg_dezigzag[k++]];
- if (*p != 0) {
- if (stbi__jpeg_get_bit(j))
- if ((*p & bit)==0) {
- if (*p > 0)
- *p += bit;
- else
- *p -= bit;
- }
- } else {
- if (r == 0) {
- *p = (short) s;
- break;
- }
- --r;
- }
- }
- } while (k <= j->spec_end);
- }
- }
- return 1;
-}
-
-// take a -128..127 value and stbi__clamp it and convert to 0..255
-stbi_inline static stbi_uc stbi__clamp(int x)
-{
- // trick to use a single test to catch both cases
- if ((unsigned int) x > 255) {
- if (x < 0) return 0;
- if (x > 255) return 255;
- }
- return (stbi_uc) x;
-}
-
-#define stbi__f2f(x) ((int) (((x) * 4096 + 0.5)))
-#define stbi__fsh(x) ((x) * 4096)
-
-// derived from jidctint -- DCT_ISLOW
-#define STBI__IDCT_1D(s0,s1,s2,s3,s4,s5,s6,s7) \
- int t0,t1,t2,t3,p1,p2,p3,p4,p5,x0,x1,x2,x3; \
- p2 = s2; \
- p3 = s6; \
- p1 = (p2+p3) * stbi__f2f(0.5411961f); \
- t2 = p1 + p3*stbi__f2f(-1.847759065f); \
- t3 = p1 + p2*stbi__f2f( 0.765366865f); \
- p2 = s0; \
- p3 = s4; \
- t0 = stbi__fsh(p2+p3); \
- t1 = stbi__fsh(p2-p3); \
- x0 = t0+t3; \
- x3 = t0-t3; \
- x1 = t1+t2; \
- x2 = t1-t2; \
- t0 = s7; \
- t1 = s5; \
- t2 = s3; \
- t3 = s1; \
- p3 = t0+t2; \
- p4 = t1+t3; \
- p1 = t0+t3; \
- p2 = t1+t2; \
- p5 = (p3+p4)*stbi__f2f( 1.175875602f); \
- t0 = t0*stbi__f2f( 0.298631336f); \
- t1 = t1*stbi__f2f( 2.053119869f); \
- t2 = t2*stbi__f2f( 3.072711026f); \
- t3 = t3*stbi__f2f( 1.501321110f); \
- p1 = p5 + p1*stbi__f2f(-0.899976223f); \
- p2 = p5 + p2*stbi__f2f(-2.562915447f); \
- p3 = p3*stbi__f2f(-1.961570560f); \
- p4 = p4*stbi__f2f(-0.390180644f); \
- t3 += p1+p4; \
- t2 += p2+p3; \
- t1 += p2+p4; \
- t0 += p1+p3;
-
-static void stbi__idct_block(stbi_uc *out, int out_stride, short data[64])
-{
- int i,val[64],*v=val;
- stbi_uc *o;
- short *d = data;
-
- // columns
- for (i=0; i < 8; ++i,++d, ++v) {
- // if all zeroes, shortcut -- this avoids dequantizing 0s and IDCTing
- if (d[ 8]==0 && d[16]==0 && d[24]==0 && d[32]==0
- && d[40]==0 && d[48]==0 && d[56]==0) {
- // no shortcut 0 seconds
- // (1|2|3|4|5|6|7)==0 0 seconds
- // all separate -0.047 seconds
- // 1 && 2|3 && 4|5 && 6|7: -0.047 seconds
- int dcterm = d[0]*4;
- v[0] = v[8] = v[16] = v[24] = v[32] = v[40] = v[48] = v[56] = dcterm;
- } else {
- STBI__IDCT_1D(d[ 0],d[ 8],d[16],d[24],d[32],d[40],d[48],d[56])
- // constants scaled things up by 1<<12; let's bring them back
- // down, but keep 2 extra bits of precision
- x0 += 512; x1 += 512; x2 += 512; x3 += 512;
- v[ 0] = (x0+t3) >> 10;
- v[56] = (x0-t3) >> 10;
- v[ 8] = (x1+t2) >> 10;
- v[48] = (x1-t2) >> 10;
- v[16] = (x2+t1) >> 10;
- v[40] = (x2-t1) >> 10;
- v[24] = (x3+t0) >> 10;
- v[32] = (x3-t0) >> 10;
- }
- }
-
- for (i=0, v=val, o=out; i < 8; ++i,v+=8,o+=out_stride) {
- // no fast case since the first 1D IDCT spread components out
- STBI__IDCT_1D(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7])
- // constants scaled things up by 1<<12, plus we had 1<<2 from first
- // loop, plus horizontal and vertical each scale by sqrt(8) so together
- // we've got an extra 1<<3, so 1<<17 total we need to remove.
- // so we want to round that, which means adding 0.5 * 1<<17,
- // aka 65536. Also, we'll end up with -128 to 127 that we want
- // to encode as 0..255 by adding 128, so we'll add that before the shift
- x0 += 65536 + (128<<17);
- x1 += 65536 + (128<<17);
- x2 += 65536 + (128<<17);
- x3 += 65536 + (128<<17);
- // tried computing the shifts into temps, or'ing the temps to see
- // if any were out of range, but that was slower
- o[0] = stbi__clamp((x0+t3) >> 17);
- o[7] = stbi__clamp((x0-t3) >> 17);
- o[1] = stbi__clamp((x1+t2) >> 17);
- o[6] = stbi__clamp((x1-t2) >> 17);
- o[2] = stbi__clamp((x2+t1) >> 17);
- o[5] = stbi__clamp((x2-t1) >> 17);
- o[3] = stbi__clamp((x3+t0) >> 17);
- o[4] = stbi__clamp((x3-t0) >> 17);
- }
-}
-
-#ifdef STBI_SSE2
-// sse2 integer IDCT. not the fastest possible implementation but it
-// produces bit-identical results to the generic C version so it's
-// fully "transparent".
-static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
-{
- // This is constructed to match our regular (generic) integer IDCT exactly.
- __m128i row0, row1, row2, row3, row4, row5, row6, row7;
- __m128i tmp;
-
- // dot product constant: even elems=x, odd elems=y
- #define dct_const(x,y) _mm_setr_epi16((x),(y),(x),(y),(x),(y),(x),(y))
-
- // out(0) = c0[even]*x + c0[odd]*y (c0, x, y 16-bit, out 32-bit)
- // out(1) = c1[even]*x + c1[odd]*y
- #define dct_rot(out0,out1, x,y,c0,c1) \
- __m128i c0##lo = _mm_unpacklo_epi16((x),(y)); \
- __m128i c0##hi = _mm_unpackhi_epi16((x),(y)); \
- __m128i out0##_l = _mm_madd_epi16(c0##lo, c0); \
- __m128i out0##_h = _mm_madd_epi16(c0##hi, c0); \
- __m128i out1##_l = _mm_madd_epi16(c0##lo, c1); \
- __m128i out1##_h = _mm_madd_epi16(c0##hi, c1)
-
- // out = in << 12 (in 16-bit, out 32-bit)
- #define dct_widen(out, in) \
- __m128i out##_l = _mm_srai_epi32(_mm_unpacklo_epi16(_mm_setzero_si128(), (in)), 4); \
- __m128i out##_h = _mm_srai_epi32(_mm_unpackhi_epi16(_mm_setzero_si128(), (in)), 4)
-
- // wide add
- #define dct_wadd(out, a, b) \
- __m128i out##_l = _mm_add_epi32(a##_l, b##_l); \
- __m128i out##_h = _mm_add_epi32(a##_h, b##_h)
-
- // wide sub
- #define dct_wsub(out, a, b) \
- __m128i out##_l = _mm_sub_epi32(a##_l, b##_l); \
- __m128i out##_h = _mm_sub_epi32(a##_h, b##_h)
-
- // butterfly a/b, add bias, then shift by "s" and pack
- #define dct_bfly32o(out0, out1, a,b,bias,s) \
- { \
- __m128i abiased_l = _mm_add_epi32(a##_l, bias); \
- __m128i abiased_h = _mm_add_epi32(a##_h, bias); \
- dct_wadd(sum, abiased, b); \
- dct_wsub(dif, abiased, b); \
- out0 = _mm_packs_epi32(_mm_srai_epi32(sum_l, s), _mm_srai_epi32(sum_h, s)); \
- out1 = _mm_packs_epi32(_mm_srai_epi32(dif_l, s), _mm_srai_epi32(dif_h, s)); \
- }
-
- // 8-bit interleave step (for transposes)
- #define dct_interleave8(a, b) \
- tmp = a; \
- a = _mm_unpacklo_epi8(a, b); \
- b = _mm_unpackhi_epi8(tmp, b)
-
- // 16-bit interleave step (for transposes)
- #define dct_interleave16(a, b) \
- tmp = a; \
- a = _mm_unpacklo_epi16(a, b); \
- b = _mm_unpackhi_epi16(tmp, b)
-
- #define dct_pass(bias,shift) \
- { \
- /* even part */ \
- dct_rot(t2e,t3e, row2,row6, rot0_0,rot0_1); \
- __m128i sum04 = _mm_add_epi16(row0, row4); \
- __m128i dif04 = _mm_sub_epi16(row0, row4); \
- dct_widen(t0e, sum04); \
- dct_widen(t1e, dif04); \
- dct_wadd(x0, t0e, t3e); \
- dct_wsub(x3, t0e, t3e); \
- dct_wadd(x1, t1e, t2e); \
- dct_wsub(x2, t1e, t2e); \
- /* odd part */ \
- dct_rot(y0o,y2o, row7,row3, rot2_0,rot2_1); \
- dct_rot(y1o,y3o, row5,row1, rot3_0,rot3_1); \
- __m128i sum17 = _mm_add_epi16(row1, row7); \
- __m128i sum35 = _mm_add_epi16(row3, row5); \
- dct_rot(y4o,y5o, sum17,sum35, rot1_0,rot1_1); \
- dct_wadd(x4, y0o, y4o); \
- dct_wadd(x5, y1o, y5o); \
- dct_wadd(x6, y2o, y5o); \
- dct_wadd(x7, y3o, y4o); \
- dct_bfly32o(row0,row7, x0,x7,bias,shift); \
- dct_bfly32o(row1,row6, x1,x6,bias,shift); \
- dct_bfly32o(row2,row5, x2,x5,bias,shift); \
- dct_bfly32o(row3,row4, x3,x4,bias,shift); \
- }
-
- __m128i rot0_0 = dct_const(stbi__f2f(0.5411961f), stbi__f2f(0.5411961f) + stbi__f2f(-1.847759065f));
- __m128i rot0_1 = dct_const(stbi__f2f(0.5411961f) + stbi__f2f( 0.765366865f), stbi__f2f(0.5411961f));
- __m128i rot1_0 = dct_const(stbi__f2f(1.175875602f) + stbi__f2f(-0.899976223f), stbi__f2f(1.175875602f));
- __m128i rot1_1 = dct_const(stbi__f2f(1.175875602f), stbi__f2f(1.175875602f) + stbi__f2f(-2.562915447f));
- __m128i rot2_0 = dct_const(stbi__f2f(-1.961570560f) + stbi__f2f( 0.298631336f), stbi__f2f(-1.961570560f));
- __m128i rot2_1 = dct_const(stbi__f2f(-1.961570560f), stbi__f2f(-1.961570560f) + stbi__f2f( 3.072711026f));
- __m128i rot3_0 = dct_const(stbi__f2f(-0.390180644f) + stbi__f2f( 2.053119869f), stbi__f2f(-0.390180644f));
- __m128i rot3_1 = dct_const(stbi__f2f(-0.390180644f), stbi__f2f(-0.390180644f) + stbi__f2f( 1.501321110f));
-
- // rounding biases in column/row passes, see stbi__idct_block for explanation.
- __m128i bias_0 = _mm_set1_epi32(512);
- __m128i bias_1 = _mm_set1_epi32(65536 + (128<<17));
-
- // load
- row0 = _mm_load_si128((const __m128i *) (data + 0*8));
- row1 = _mm_load_si128((const __m128i *) (data + 1*8));
- row2 = _mm_load_si128((const __m128i *) (data + 2*8));
- row3 = _mm_load_si128((const __m128i *) (data + 3*8));
- row4 = _mm_load_si128((const __m128i *) (data + 4*8));
- row5 = _mm_load_si128((const __m128i *) (data + 5*8));
- row6 = _mm_load_si128((const __m128i *) (data + 6*8));
- row7 = _mm_load_si128((const __m128i *) (data + 7*8));
-
- // column pass
- dct_pass(bias_0, 10);
-
- {
- // 16bit 8x8 transpose pass 1
- dct_interleave16(row0, row4);
- dct_interleave16(row1, row5);
- dct_interleave16(row2, row6);
- dct_interleave16(row3, row7);
-
- // transpose pass 2
- dct_interleave16(row0, row2);
- dct_interleave16(row1, row3);
- dct_interleave16(row4, row6);
- dct_interleave16(row5, row7);
-
- // transpose pass 3
- dct_interleave16(row0, row1);
- dct_interleave16(row2, row3);
- dct_interleave16(row4, row5);
- dct_interleave16(row6, row7);
- }
-
- // row pass
- dct_pass(bias_1, 17);
-
- {
- // pack
- __m128i p0 = _mm_packus_epi16(row0, row1); // a0a1a2a3...a7b0b1b2b3...b7
- __m128i p1 = _mm_packus_epi16(row2, row3);
- __m128i p2 = _mm_packus_epi16(row4, row5);
- __m128i p3 = _mm_packus_epi16(row6, row7);
-
- // 8bit 8x8 transpose pass 1
- dct_interleave8(p0, p2); // a0e0a1e1...
- dct_interleave8(p1, p3); // c0g0c1g1...
-
- // transpose pass 2
- dct_interleave8(p0, p1); // a0c0e0g0...
- dct_interleave8(p2, p3); // b0d0f0h0...
-
- // transpose pass 3
- dct_interleave8(p0, p2); // a0b0c0d0...
- dct_interleave8(p1, p3); // a4b4c4d4...
-
- // store
- _mm_storel_epi64((__m128i *) out, p0); out += out_stride;
- _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p0, 0x4e)); out += out_stride;
- _mm_storel_epi64((__m128i *) out, p2); out += out_stride;
- _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p2, 0x4e)); out += out_stride;
- _mm_storel_epi64((__m128i *) out, p1); out += out_stride;
- _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p1, 0x4e)); out += out_stride;
- _mm_storel_epi64((__m128i *) out, p3); out += out_stride;
- _mm_storel_epi64((__m128i *) out, _mm_shuffle_epi32(p3, 0x4e));
- }
-
-#undef dct_const
-#undef dct_rot
-#undef dct_widen
-#undef dct_wadd
-#undef dct_wsub
-#undef dct_bfly32o
-#undef dct_interleave8
-#undef dct_interleave16
-#undef dct_pass
-}
-
-#endif // STBI_SSE2
-
-#ifdef STBI_NEON
-
-// NEON integer IDCT. should produce bit-identical
-// results to the generic C version.
-static void stbi__idct_simd(stbi_uc *out, int out_stride, short data[64])
-{
- int16x8_t row0, row1, row2, row3, row4, row5, row6, row7;
-
- int16x4_t rot0_0 = vdup_n_s16(stbi__f2f(0.5411961f));
- int16x4_t rot0_1 = vdup_n_s16(stbi__f2f(-1.847759065f));
- int16x4_t rot0_2 = vdup_n_s16(stbi__f2f( 0.765366865f));
- int16x4_t rot1_0 = vdup_n_s16(stbi__f2f( 1.175875602f));
- int16x4_t rot1_1 = vdup_n_s16(stbi__f2f(-0.899976223f));
- int16x4_t rot1_2 = vdup_n_s16(stbi__f2f(-2.562915447f));
- int16x4_t rot2_0 = vdup_n_s16(stbi__f2f(-1.961570560f));
- int16x4_t rot2_1 = vdup_n_s16(stbi__f2f(-0.390180644f));
- int16x4_t rot3_0 = vdup_n_s16(stbi__f2f( 0.298631336f));
- int16x4_t rot3_1 = vdup_n_s16(stbi__f2f( 2.053119869f));
- int16x4_t rot3_2 = vdup_n_s16(stbi__f2f( 3.072711026f));
- int16x4_t rot3_3 = vdup_n_s16(stbi__f2f( 1.501321110f));
-
-#define dct_long_mul(out, inq, coeff) \
- int32x4_t out##_l = vmull_s16(vget_low_s16(inq), coeff); \
- int32x4_t out##_h = vmull_s16(vget_high_s16(inq), coeff)
-
-#define dct_long_mac(out, acc, inq, coeff) \
- int32x4_t out##_l = vmlal_s16(acc##_l, vget_low_s16(inq), coeff); \
- int32x4_t out##_h = vmlal_s16(acc##_h, vget_high_s16(inq), coeff)
-
-#define dct_widen(out, inq) \
- int32x4_t out##_l = vshll_n_s16(vget_low_s16(inq), 12); \
- int32x4_t out##_h = vshll_n_s16(vget_high_s16(inq), 12)
-
-// wide add
-#define dct_wadd(out, a, b) \
- int32x4_t out##_l = vaddq_s32(a##_l, b##_l); \
- int32x4_t out##_h = vaddq_s32(a##_h, b##_h)
-
-// wide sub
-#define dct_wsub(out, a, b) \
- int32x4_t out##_l = vsubq_s32(a##_l, b##_l); \
- int32x4_t out##_h = vsubq_s32(a##_h, b##_h)
-
-// butterfly a/b, then shift using "shiftop" by "s" and pack
-#define dct_bfly32o(out0,out1, a,b,shiftop,s) \
- { \
- dct_wadd(sum, a, b); \
- dct_wsub(dif, a, b); \
- out0 = vcombine_s16(shiftop(sum_l, s), shiftop(sum_h, s)); \
- out1 = vcombine_s16(shiftop(dif_l, s), shiftop(dif_h, s)); \
- }
-
-#define dct_pass(shiftop, shift) \
- { \
- /* even part */ \
- int16x8_t sum26 = vaddq_s16(row2, row6); \
- dct_long_mul(p1e, sum26, rot0_0); \
- dct_long_mac(t2e, p1e, row6, rot0_1); \
- dct_long_mac(t3e, p1e, row2, rot0_2); \
- int16x8_t sum04 = vaddq_s16(row0, row4); \
- int16x8_t dif04 = vsubq_s16(row0, row4); \
- dct_widen(t0e, sum04); \
- dct_widen(t1e, dif04); \
- dct_wadd(x0, t0e, t3e); \
- dct_wsub(x3, t0e, t3e); \
- dct_wadd(x1, t1e, t2e); \
- dct_wsub(x2, t1e, t2e); \
- /* odd part */ \
- int16x8_t sum15 = vaddq_s16(row1, row5); \
- int16x8_t sum17 = vaddq_s16(row1, row7); \
- int16x8_t sum35 = vaddq_s16(row3, row5); \
- int16x8_t sum37 = vaddq_s16(row3, row7); \
- int16x8_t sumodd = vaddq_s16(sum17, sum35); \
- dct_long_mul(p5o, sumodd, rot1_0); \
- dct_long_mac(p1o, p5o, sum17, rot1_1); \
- dct_long_mac(p2o, p5o, sum35, rot1_2); \
- dct_long_mul(p3o, sum37, rot2_0); \
- dct_long_mul(p4o, sum15, rot2_1); \
- dct_wadd(sump13o, p1o, p3o); \
- dct_wadd(sump24o, p2o, p4o); \
- dct_wadd(sump23o, p2o, p3o); \
- dct_wadd(sump14o, p1o, p4o); \
- dct_long_mac(x4, sump13o, row7, rot3_0); \
- dct_long_mac(x5, sump24o, row5, rot3_1); \
- dct_long_mac(x6, sump23o, row3, rot3_2); \
- dct_long_mac(x7, sump14o, row1, rot3_3); \
- dct_bfly32o(row0,row7, x0,x7,shiftop,shift); \
- dct_bfly32o(row1,row6, x1,x6,shiftop,shift); \
- dct_bfly32o(row2,row5, x2,x5,shiftop,shift); \
- dct_bfly32o(row3,row4, x3,x4,shiftop,shift); \
- }
-
- // load
- row0 = vld1q_s16(data + 0*8);
- row1 = vld1q_s16(data + 1*8);
- row2 = vld1q_s16(data + 2*8);
- row3 = vld1q_s16(data + 3*8);
- row4 = vld1q_s16(data + 4*8);
- row5 = vld1q_s16(data + 5*8);
- row6 = vld1q_s16(data + 6*8);
- row7 = vld1q_s16(data + 7*8);
-
- // add DC bias
- row0 = vaddq_s16(row0, vsetq_lane_s16(1024, vdupq_n_s16(0), 0));
-
- // column pass
- dct_pass(vrshrn_n_s32, 10);
-
- // 16bit 8x8 transpose
- {
-// these three map to a single VTRN.16, VTRN.32, and VSWP, respectively.
-// whether compilers actually get this is another story, sadly.
-#define dct_trn16(x, y) { int16x8x2_t t = vtrnq_s16(x, y); x = t.val[0]; y = t.val[1]; }
-#define dct_trn32(x, y) { int32x4x2_t t = vtrnq_s32(vreinterpretq_s32_s16(x), vreinterpretq_s32_s16(y)); x = vreinterpretq_s16_s32(t.val[0]); y = vreinterpretq_s16_s32(t.val[1]); }
-#define dct_trn64(x, y) { int16x8_t x0 = x; int16x8_t y0 = y; x = vcombine_s16(vget_low_s16(x0), vget_low_s16(y0)); y = vcombine_s16(vget_high_s16(x0), vget_high_s16(y0)); }
-
- // pass 1
- dct_trn16(row0, row1); // a0b0a2b2a4b4a6b6
- dct_trn16(row2, row3);
- dct_trn16(row4, row5);
- dct_trn16(row6, row7);
-
- // pass 2
- dct_trn32(row0, row2); // a0b0c0d0a4b4c4d4
- dct_trn32(row1, row3);
- dct_trn32(row4, row6);
- dct_trn32(row5, row7);
-
- // pass 3
- dct_trn64(row0, row4); // a0b0c0d0e0f0g0h0
- dct_trn64(row1, row5);
- dct_trn64(row2, row6);
- dct_trn64(row3, row7);
-
-#undef dct_trn16
-#undef dct_trn32
-#undef dct_trn64
- }
-
- // row pass
- // vrshrn_n_s32 only supports shifts up to 16, we need
- // 17. so do a non-rounding shift of 16 first then follow
- // up with a rounding shift by 1.
- dct_pass(vshrn_n_s32, 16);
-
- {
- // pack and round
- uint8x8_t p0 = vqrshrun_n_s16(row0, 1);
- uint8x8_t p1 = vqrshrun_n_s16(row1, 1);
- uint8x8_t p2 = vqrshrun_n_s16(row2, 1);
- uint8x8_t p3 = vqrshrun_n_s16(row3, 1);
- uint8x8_t p4 = vqrshrun_n_s16(row4, 1);
- uint8x8_t p5 = vqrshrun_n_s16(row5, 1);
- uint8x8_t p6 = vqrshrun_n_s16(row6, 1);
- uint8x8_t p7 = vqrshrun_n_s16(row7, 1);
-
- // again, these can translate into one instruction, but often don't.
-#define dct_trn8_8(x, y) { uint8x8x2_t t = vtrn_u8(x, y); x = t.val[0]; y = t.val[1]; }
-#define dct_trn8_16(x, y) { uint16x4x2_t t = vtrn_u16(vreinterpret_u16_u8(x), vreinterpret_u16_u8(y)); x = vreinterpret_u8_u16(t.val[0]); y = vreinterpret_u8_u16(t.val[1]); }
-#define dct_trn8_32(x, y) { uint32x2x2_t t = vtrn_u32(vreinterpret_u32_u8(x), vreinterpret_u32_u8(y)); x = vreinterpret_u8_u32(t.val[0]); y = vreinterpret_u8_u32(t.val[1]); }
-
- // sadly can't use interleaved stores here since we only write
- // 8 bytes to each scan line!
-
- // 8x8 8-bit transpose pass 1
- dct_trn8_8(p0, p1);
- dct_trn8_8(p2, p3);
- dct_trn8_8(p4, p5);
- dct_trn8_8(p6, p7);
-
- // pass 2
- dct_trn8_16(p0, p2);
- dct_trn8_16(p1, p3);
- dct_trn8_16(p4, p6);
- dct_trn8_16(p5, p7);
-
- // pass 3
- dct_trn8_32(p0, p4);
- dct_trn8_32(p1, p5);
- dct_trn8_32(p2, p6);
- dct_trn8_32(p3, p7);
-
- // store
- vst1_u8(out, p0); out += out_stride;
- vst1_u8(out, p1); out += out_stride;
- vst1_u8(out, p2); out += out_stride;
- vst1_u8(out, p3); out += out_stride;
- vst1_u8(out, p4); out += out_stride;
- vst1_u8(out, p5); out += out_stride;
- vst1_u8(out, p6); out += out_stride;
- vst1_u8(out, p7);
-
-#undef dct_trn8_8
-#undef dct_trn8_16
-#undef dct_trn8_32
- }
-
-#undef dct_long_mul
-#undef dct_long_mac
-#undef dct_widen
-#undef dct_wadd
-#undef dct_wsub
-#undef dct_bfly32o
-#undef dct_pass
-}
-
-#endif // STBI_NEON
-
-#define STBI__MARKER_none 0xff
-// if there's a pending marker from the entropy stream, return that
-// otherwise, fetch from the stream and get a marker. if there's no
-// marker, return 0xff, which is never a valid marker value
-static stbi_uc stbi__get_marker(stbi__jpeg *j)
-{
- stbi_uc x;
- if (j->marker != STBI__MARKER_none) { x = j->marker; j->marker = STBI__MARKER_none; return x; }
- x = stbi__get8(j->s);
- if (x != 0xff) return STBI__MARKER_none;
- while (x == 0xff)
- x = stbi__get8(j->s); // consume repeated 0xff fill bytes
- return x;
-}
-
-// in each scan, we'll have scan_n components, and the order
-// of the components is specified by order[]
-#define STBI__RESTART(x) ((x) >= 0xd0 && (x) <= 0xd7)
-
-// after a restart interval, stbi__jpeg_reset the entropy decoder and
-// the dc prediction
-static void stbi__jpeg_reset(stbi__jpeg *j)
-{
- j->code_bits = 0;
- j->code_buffer = 0;
- j->nomore = 0;
- j->img_comp[0].dc_pred = j->img_comp[1].dc_pred = j->img_comp[2].dc_pred = j->img_comp[3].dc_pred = 0;
- j->marker = STBI__MARKER_none;
- j->todo = j->restart_interval ? j->restart_interval : 0x7fffffff;
- j->eob_run = 0;
- // no more than 1<<31 MCUs if no restart_interal? that's plenty safe,
- // since we don't even allow 1<<30 pixels
-}
-
-static int stbi__parse_entropy_coded_data(stbi__jpeg *z)
-{
- stbi__jpeg_reset(z);
- if (!z->progressive) {
- if (z->scan_n == 1) {
- int i,j;
- STBI_SIMD_ALIGN(short, data[64]);
- int n = z->order[0];
- // non-interleaved data, we just need to process one block at a time,
- // in trivial scanline order
- // number of blocks to do just depends on how many actual "pixels" this
- // component has, independent of interleaved MCU blocking and such
- int w = (z->img_comp[n].x+7) >> 3;
- int h = (z->img_comp[n].y+7) >> 3;
- for (j=0; j < h; ++j) {
- for (i=0; i < w; ++i) {
- int ha = z->img_comp[n].ha;
- if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
- z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
- // every data block is an MCU, so countdown the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- // if it's NOT a restart, then just bail, so we get corrupt data
- // rather than no data
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
- }
- }
- }
- return 1;
- } else { // interleaved
- int i,j,k,x,y;
- STBI_SIMD_ALIGN(short, data[64]);
- for (j=0; j < z->img_mcu_y; ++j) {
- for (i=0; i < z->img_mcu_x; ++i) {
- // scan an interleaved mcu... process scan_n components in order
- for (k=0; k < z->scan_n; ++k) {
- int n = z->order[k];
- // scan out an mcu's worth of this component; that's just determined
- // by the basic H and V specified for the component
- for (y=0; y < z->img_comp[n].v; ++y) {
- for (x=0; x < z->img_comp[n].h; ++x) {
- int x2 = (i*z->img_comp[n].h + x)*8;
- int y2 = (j*z->img_comp[n].v + y)*8;
- int ha = z->img_comp[n].ha;
- if (!stbi__jpeg_decode_block(z, data, z->huff_dc+z->img_comp[n].hd, z->huff_ac+ha, z->fast_ac[ha], n, z->dequant[z->img_comp[n].tq])) return 0;
- z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*y2+x2, z->img_comp[n].w2, data);
- }
- }
- }
- // after all interleaved components, that's an interleaved MCU,
- // so now count down the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
- }
- }
- }
- return 1;
- }
- } else {
- if (z->scan_n == 1) {
- int i,j;
- int n = z->order[0];
- // non-interleaved data, we just need to process one block at a time,
- // in trivial scanline order
- // number of blocks to do just depends on how many actual "pixels" this
- // component has, independent of interleaved MCU blocking and such
- int w = (z->img_comp[n].x+7) >> 3;
- int h = (z->img_comp[n].y+7) >> 3;
- for (j=0; j < h; ++j) {
- for (i=0; i < w; ++i) {
- short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
- if (z->spec_start == 0) {
- if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
- return 0;
- } else {
- int ha = z->img_comp[n].ha;
- if (!stbi__jpeg_decode_block_prog_ac(z, data, &z->huff_ac[ha], z->fast_ac[ha]))
- return 0;
- }
- // every data block is an MCU, so countdown the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
- }
- }
- }
- return 1;
- } else { // interleaved
- int i,j,k,x,y;
- for (j=0; j < z->img_mcu_y; ++j) {
- for (i=0; i < z->img_mcu_x; ++i) {
- // scan an interleaved mcu... process scan_n components in order
- for (k=0; k < z->scan_n; ++k) {
- int n = z->order[k];
- // scan out an mcu's worth of this component; that's just determined
- // by the basic H and V specified for the component
- for (y=0; y < z->img_comp[n].v; ++y) {
- for (x=0; x < z->img_comp[n].h; ++x) {
- int x2 = (i*z->img_comp[n].h + x);
- int y2 = (j*z->img_comp[n].v + y);
- short *data = z->img_comp[n].coeff + 64 * (x2 + y2 * z->img_comp[n].coeff_w);
- if (!stbi__jpeg_decode_block_prog_dc(z, data, &z->huff_dc[z->img_comp[n].hd], n))
- return 0;
- }
- }
- }
- // after all interleaved components, that's an interleaved MCU,
- // so now count down the restart interval
- if (--z->todo <= 0) {
- if (z->code_bits < 24) stbi__grow_buffer_unsafe(z);
- if (!STBI__RESTART(z->marker)) return 1;
- stbi__jpeg_reset(z);
- }
- }
- }
- return 1;
- }
- }
-}
-
-static void stbi__jpeg_dequantize(short *data, stbi__uint16 *dequant)
-{
- int i;
- for (i=0; i < 64; ++i)
- data[i] *= dequant[i];
-}
-
-static void stbi__jpeg_finish(stbi__jpeg *z)
-{
- if (z->progressive) {
- // dequantize and idct the data
- int i,j,n;
- for (n=0; n < z->s->img_n; ++n) {
- int w = (z->img_comp[n].x+7) >> 3;
- int h = (z->img_comp[n].y+7) >> 3;
- for (j=0; j < h; ++j) {
- for (i=0; i < w; ++i) {
- short *data = z->img_comp[n].coeff + 64 * (i + j * z->img_comp[n].coeff_w);
- stbi__jpeg_dequantize(data, z->dequant[z->img_comp[n].tq]);
- z->idct_block_kernel(z->img_comp[n].data+z->img_comp[n].w2*j*8+i*8, z->img_comp[n].w2, data);
- }
- }
- }
- }
-}
-
-static int stbi__process_marker(stbi__jpeg *z, int m)
-{
- int L;
- switch (m) {
- case STBI__MARKER_none: // no marker found
- return stbi__err("expected marker","Corrupt JPEG");
-
- case 0xDD: // DRI - specify restart interval
- if (stbi__get16be(z->s) != 4) return stbi__err("bad DRI len","Corrupt JPEG");
- z->restart_interval = stbi__get16be(z->s);
- return 1;
-
- case 0xDB: // DQT - define quantization table
- L = stbi__get16be(z->s)-2;
- while (L > 0) {
- int q = stbi__get8(z->s);
- int p = q >> 4, sixteen = (p != 0);
- int t = q & 15,i;
- if (p != 0 && p != 1) return stbi__err("bad DQT type","Corrupt JPEG");
- if (t > 3) return stbi__err("bad DQT table","Corrupt JPEG");
-
- for (i=0; i < 64; ++i)
- z->dequant[t][stbi__jpeg_dezigzag[i]] = (stbi__uint16)(sixteen ? stbi__get16be(z->s) : stbi__get8(z->s));
- L -= (sixteen ? 129 : 65);
- }
- return L==0;
-
- case 0xC4: // DHT - define huffman table
- L = stbi__get16be(z->s)-2;
- while (L > 0) {
- stbi_uc *v;
- int sizes[16],i,n=0;
- int q = stbi__get8(z->s);
- int tc = q >> 4;
- int th = q & 15;
- if (tc > 1 || th > 3) return stbi__err("bad DHT header","Corrupt JPEG");
- for (i=0; i < 16; ++i) {
- sizes[i] = stbi__get8(z->s);
- n += sizes[i];
- }
- L -= 17;
- if (tc == 0) {
- if (!stbi__build_huffman(z->huff_dc+th, sizes)) return 0;
- v = z->huff_dc[th].values;
- } else {
- if (!stbi__build_huffman(z->huff_ac+th, sizes)) return 0;
- v = z->huff_ac[th].values;
- }
- for (i=0; i < n; ++i)
- v[i] = stbi__get8(z->s);
- if (tc != 0)
- stbi__build_fast_ac(z->fast_ac[th], z->huff_ac + th);
- L -= n;
- }
- return L==0;
- }
-
- // check for comment block or APP blocks
- if ((m >= 0xE0 && m <= 0xEF) || m == 0xFE) {
- L = stbi__get16be(z->s);
- if (L < 2) {
- if (m == 0xFE)
- return stbi__err("bad COM len","Corrupt JPEG");
- else
- return stbi__err("bad APP len","Corrupt JPEG");
- }
- L -= 2;
-
- if (m == 0xE0 && L >= 5) { // JFIF APP0 segment
- static const unsigned char tag[5] = {'J','F','I','F','\0'};
- int ok = 1;
- int i;
- for (i=0; i < 5; ++i)
- if (stbi__get8(z->s) != tag[i])
- ok = 0;
- L -= 5;
- if (ok)
- z->jfif = 1;
- } else if (m == 0xEE && L >= 12) { // Adobe APP14 segment
- static const unsigned char tag[6] = {'A','d','o','b','e','\0'};
- int ok = 1;
- int i;
- for (i=0; i < 6; ++i)
- if (stbi__get8(z->s) != tag[i])
- ok = 0;
- L -= 6;
- if (ok) {
- stbi__get8(z->s); // version
- stbi__get16be(z->s); // flags0
- stbi__get16be(z->s); // flags1
- z->app14_color_transform = stbi__get8(z->s); // color transform
- L -= 6;
- }
- }
-
- stbi__skip(z->s, L);
- return 1;
- }
-
- return stbi__err("unknown marker","Corrupt JPEG");
-}
-
-// after we see SOS
-static int stbi__process_scan_header(stbi__jpeg *z)
-{
- int i;
- int Ls = stbi__get16be(z->s);
- z->scan_n = stbi__get8(z->s);
- if (z->scan_n < 1 || z->scan_n > 4 || z->scan_n > (int) z->s->img_n) return stbi__err("bad SOS component count","Corrupt JPEG");
- if (Ls != 6+2*z->scan_n) return stbi__err("bad SOS len","Corrupt JPEG");
- for (i=0; i < z->scan_n; ++i) {
- int id = stbi__get8(z->s), which;
- int q = stbi__get8(z->s);
- for (which = 0; which < z->s->img_n; ++which)
- if (z->img_comp[which].id == id)
- break;
- if (which == z->s->img_n) return 0; // no match
- z->img_comp[which].hd = q >> 4; if (z->img_comp[which].hd > 3) return stbi__err("bad DC huff","Corrupt JPEG");
- z->img_comp[which].ha = q & 15; if (z->img_comp[which].ha > 3) return stbi__err("bad AC huff","Corrupt JPEG");
- z->order[i] = which;
- }
-
- {
- int aa;
- z->spec_start = stbi__get8(z->s);
- z->spec_end = stbi__get8(z->s); // should be 63, but might be 0
- aa = stbi__get8(z->s);
- z->succ_high = (aa >> 4);
- z->succ_low = (aa & 15);
- if (z->progressive) {
- if (z->spec_start > 63 || z->spec_end > 63 || z->spec_start > z->spec_end || z->succ_high > 13 || z->succ_low > 13)
- return stbi__err("bad SOS", "Corrupt JPEG");
- } else {
- if (z->spec_start != 0) return stbi__err("bad SOS","Corrupt JPEG");
- if (z->succ_high != 0 || z->succ_low != 0) return stbi__err("bad SOS","Corrupt JPEG");
- z->spec_end = 63;
- }
- }
-
- return 1;
-}
-
-static int stbi__free_jpeg_components(stbi__jpeg *z, int ncomp, int why)
-{
- int i;
- for (i=0; i < ncomp; ++i) {
- if (z->img_comp[i].raw_data) {
- STBI_FREE(z->img_comp[i].raw_data);
- z->img_comp[i].raw_data = NULL;
- z->img_comp[i].data = NULL;
- }
- if (z->img_comp[i].raw_coeff) {
- STBI_FREE(z->img_comp[i].raw_coeff);
- z->img_comp[i].raw_coeff = 0;
- z->img_comp[i].coeff = 0;
- }
- if (z->img_comp[i].linebuf) {
- STBI_FREE(z->img_comp[i].linebuf);
- z->img_comp[i].linebuf = NULL;
- }
- }
- return why;
-}
-
-static int stbi__process_frame_header(stbi__jpeg *z, int scan)
-{
- stbi__context *s = z->s;
- int Lf,p,i,q, h_max=1,v_max=1,c;
- Lf = stbi__get16be(s); if (Lf < 11) return stbi__err("bad SOF len","Corrupt JPEG"); // JPEG
- p = stbi__get8(s); if (p != 8) return stbi__err("only 8-bit","JPEG format not supported: 8-bit only"); // JPEG baseline
- s->img_y = stbi__get16be(s); if (s->img_y == 0) return stbi__err("no header height", "JPEG format not supported: delayed height"); // Legal, but we don't handle it--but neither does IJG
- s->img_x = stbi__get16be(s); if (s->img_x == 0) return stbi__err("0 width","Corrupt JPEG"); // JPEG requires
- c = stbi__get8(s);
- if (c != 3 && c != 1 && c != 4) return stbi__err("bad component count","Corrupt JPEG");
- s->img_n = c;
- for (i=0; i < c; ++i) {
- z->img_comp[i].data = NULL;
- z->img_comp[i].linebuf = NULL;
- }
-
- if (Lf != 8+3*s->img_n) return stbi__err("bad SOF len","Corrupt JPEG");
-
- z->rgb = 0;
- for (i=0; i < s->img_n; ++i) {
- static const unsigned char rgb[3] = { 'R', 'G', 'B' };
- z->img_comp[i].id = stbi__get8(s);
- if (s->img_n == 3 && z->img_comp[i].id == rgb[i])
- ++z->rgb;
- q = stbi__get8(s);
- z->img_comp[i].h = (q >> 4); if (!z->img_comp[i].h || z->img_comp[i].h > 4) return stbi__err("bad H","Corrupt JPEG");
- z->img_comp[i].v = q & 15; if (!z->img_comp[i].v || z->img_comp[i].v > 4) return stbi__err("bad V","Corrupt JPEG");
- z->img_comp[i].tq = stbi__get8(s); if (z->img_comp[i].tq > 3) return stbi__err("bad TQ","Corrupt JPEG");
- }
-
- if (scan != STBI__SCAN_load) return 1;
-
- if (!stbi__mad3sizes_valid(s->img_x, s->img_y, s->img_n, 0)) return stbi__err("too large", "Image too large to decode");
-
- for (i=0; i < s->img_n; ++i) {
- if (z->img_comp[i].h > h_max) h_max = z->img_comp[i].h;
- if (z->img_comp[i].v > v_max) v_max = z->img_comp[i].v;
- }
-
- // compute interleaved mcu info
- z->img_h_max = h_max;
- z->img_v_max = v_max;
- z->img_mcu_w = h_max * 8;
- z->img_mcu_h = v_max * 8;
- // these sizes can't be more than 17 bits
- z->img_mcu_x = (s->img_x + z->img_mcu_w-1) / z->img_mcu_w;
- z->img_mcu_y = (s->img_y + z->img_mcu_h-1) / z->img_mcu_h;
-
- for (i=0; i < s->img_n; ++i) {
- // number of effective pixels (e.g. for non-interleaved MCU)
- z->img_comp[i].x = (s->img_x * z->img_comp[i].h + h_max-1) / h_max;
- z->img_comp[i].y = (s->img_y * z->img_comp[i].v + v_max-1) / v_max;
- // to simplify generation, we'll allocate enough memory to decode
- // the bogus oversized data from using interleaved MCUs and their
- // big blocks (e.g. a 16x16 iMCU on an image of width 33); we won't
- // discard the extra data until colorspace conversion
- //
- // img_mcu_x, img_mcu_y: <=17 bits; comp[i].h and .v are <=4 (checked earlier)
- // so these muls can't overflow with 32-bit ints (which we require)
- z->img_comp[i].w2 = z->img_mcu_x * z->img_comp[i].h * 8;
- z->img_comp[i].h2 = z->img_mcu_y * z->img_comp[i].v * 8;
- z->img_comp[i].coeff = 0;
- z->img_comp[i].raw_coeff = 0;
- z->img_comp[i].linebuf = NULL;
- z->img_comp[i].raw_data = stbi__malloc_mad2(z->img_comp[i].w2, z->img_comp[i].h2, 15);
- if (z->img_comp[i].raw_data == NULL)
- return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
- // align blocks for idct using mmx/sse
- z->img_comp[i].data = (stbi_uc*) (((size_t) z->img_comp[i].raw_data + 15) & ~15);
- if (z->progressive) {
- // w2, h2 are multiples of 8 (see above)
- z->img_comp[i].coeff_w = z->img_comp[i].w2 / 8;
- z->img_comp[i].coeff_h = z->img_comp[i].h2 / 8;
- z->img_comp[i].raw_coeff = stbi__malloc_mad3(z->img_comp[i].w2, z->img_comp[i].h2, sizeof(short), 15);
- if (z->img_comp[i].raw_coeff == NULL)
- return stbi__free_jpeg_components(z, i+1, stbi__err("outofmem", "Out of memory"));
- z->img_comp[i].coeff = (short*) (((size_t) z->img_comp[i].raw_coeff + 15) & ~15);
- }
- }
-
- return 1;
-}
-
-// use comparisons since in some cases we handle more than one case (e.g. SOF)
-#define stbi__DNL(x) ((x) == 0xdc)
-#define stbi__SOI(x) ((x) == 0xd8)
-#define stbi__EOI(x) ((x) == 0xd9)
-#define stbi__SOF(x) ((x) == 0xc0 || (x) == 0xc1 || (x) == 0xc2)
-#define stbi__SOS(x) ((x) == 0xda)
-
-#define stbi__SOF_progressive(x) ((x) == 0xc2)
-
-static int stbi__decode_jpeg_header(stbi__jpeg *z, int scan)
-{
- int m;
- z->jfif = 0;
- z->app14_color_transform = -1; // valid values are 0,1,2
- z->marker = STBI__MARKER_none; // initialize cached marker to empty
- m = stbi__get_marker(z);
- if (!stbi__SOI(m)) return stbi__err("no SOI","Corrupt JPEG");
- if (scan == STBI__SCAN_type) return 1;
- m = stbi__get_marker(z);
- while (!stbi__SOF(m)) {
- if (!stbi__process_marker(z,m)) return 0;
- m = stbi__get_marker(z);
- while (m == STBI__MARKER_none) {
- // some files have extra padding after their blocks, so ok, we'll scan
- if (stbi__at_eof(z->s)) return stbi__err("no SOF", "Corrupt JPEG");
- m = stbi__get_marker(z);
- }
- }
- z->progressive = stbi__SOF_progressive(m);
- if (!stbi__process_frame_header(z, scan)) return 0;
- return 1;
-}
-
-// decode image to YCbCr format
-static int stbi__decode_jpeg_image(stbi__jpeg *j)
-{
- int m;
- for (m = 0; m < 4; m++) {
- j->img_comp[m].raw_data = NULL;
- j->img_comp[m].raw_coeff = NULL;
- }
- j->restart_interval = 0;
- if (!stbi__decode_jpeg_header(j, STBI__SCAN_load)) return 0;
- m = stbi__get_marker(j);
- while (!stbi__EOI(m)) {
- if (stbi__SOS(m)) {
- if (!stbi__process_scan_header(j)) return 0;
- if (!stbi__parse_entropy_coded_data(j)) return 0;
- if (j->marker == STBI__MARKER_none ) {
- // handle 0s at the end of image data from IP Kamera 9060
- while (!stbi__at_eof(j->s)) {
- int x = stbi__get8(j->s);
- if (x == 255) {
- j->marker = stbi__get8(j->s);
- break;
- }
- }
- // if we reach eof without hitting a marker, stbi__get_marker() below will fail and we'll eventually return 0
- }
- } else if (stbi__DNL(m)) {
- int Ld = stbi__get16be(j->s);
- stbi__uint32 NL = stbi__get16be(j->s);
- if (Ld != 4) return stbi__err("bad DNL len", "Corrupt JPEG");
- if (NL != j->s->img_y) return stbi__err("bad DNL height", "Corrupt JPEG");
- } else {
- if (!stbi__process_marker(j, m)) return 0;
- }
- m = stbi__get_marker(j);
- }
- if (j->progressive)
- stbi__jpeg_finish(j);
- return 1;
-}
-
-// static jfif-centered resampling (across block boundaries)
-
-typedef stbi_uc *(*resample_row_func)(stbi_uc *out, stbi_uc *in0, stbi_uc *in1,
- int w, int hs);
-
-#define stbi__div4(x) ((stbi_uc) ((x) >> 2))
-
-static stbi_uc *resample_row_1(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- STBI_NOTUSED(out);
- STBI_NOTUSED(in_far);
- STBI_NOTUSED(w);
- STBI_NOTUSED(hs);
- return in_near;
-}
-
-static stbi_uc* stbi__resample_row_v_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- // need to generate two samples vertically for every one in input
- int i;
- STBI_NOTUSED(hs);
- for (i=0; i < w; ++i)
- out[i] = stbi__div4(3*in_near[i] + in_far[i] + 2);
- return out;
-}
-
-static stbi_uc* stbi__resample_row_h_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- // need to generate two samples horizontally for every one in input
- int i;
- stbi_uc *input = in_near;
-
- if (w == 1) {
- // if only one sample, can't do any interpolation
- out[0] = out[1] = input[0];
- return out;
- }
-
- out[0] = input[0];
- out[1] = stbi__div4(input[0]*3 + input[1] + 2);
- for (i=1; i < w-1; ++i) {
- int n = 3*input[i]+2;
- out[i*2+0] = stbi__div4(n+input[i-1]);
- out[i*2+1] = stbi__div4(n+input[i+1]);
- }
- out[i*2+0] = stbi__div4(input[w-2]*3 + input[w-1] + 2);
- out[i*2+1] = input[w-1];
-
- STBI_NOTUSED(in_far);
- STBI_NOTUSED(hs);
-
- return out;
-}
-
-#define stbi__div16(x) ((stbi_uc) ((x) >> 4))
-
-static stbi_uc *stbi__resample_row_hv_2(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- // need to generate 2x2 samples for every one in input
- int i,t0,t1;
- if (w == 1) {
- out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
- return out;
- }
-
- t1 = 3*in_near[0] + in_far[0];
- out[0] = stbi__div4(t1+2);
- for (i=1; i < w; ++i) {
- t0 = t1;
- t1 = 3*in_near[i]+in_far[i];
- out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
- out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
- }
- out[w*2-1] = stbi__div4(t1+2);
-
- STBI_NOTUSED(hs);
-
- return out;
-}
-
-#if defined(STBI_SSE2) || defined(STBI_NEON)
-static stbi_uc *stbi__resample_row_hv_2_simd(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- // need to generate 2x2 samples for every one in input
- int i=0,t0,t1;
-
- if (w == 1) {
- out[0] = out[1] = stbi__div4(3*in_near[0] + in_far[0] + 2);
- return out;
- }
-
- t1 = 3*in_near[0] + in_far[0];
- // process groups of 8 pixels for as long as we can.
- // note we can't handle the last pixel in a row in this loop
- // because we need to handle the filter boundary conditions.
- for (; i < ((w-1) & ~7); i += 8) {
-#if defined(STBI_SSE2)
- // load and perform the vertical filtering pass
- // this uses 3*x + y = 4*x + (y - x)
- __m128i zero = _mm_setzero_si128();
- __m128i farb = _mm_loadl_epi64((__m128i *) (in_far + i));
- __m128i nearb = _mm_loadl_epi64((__m128i *) (in_near + i));
- __m128i farw = _mm_unpacklo_epi8(farb, zero);
- __m128i nearw = _mm_unpacklo_epi8(nearb, zero);
- __m128i diff = _mm_sub_epi16(farw, nearw);
- __m128i nears = _mm_slli_epi16(nearw, 2);
- __m128i curr = _mm_add_epi16(nears, diff); // current row
-
- // horizontal filter works the same based on shifted vers of current
- // row. "prev" is current row shifted right by 1 pixel; we need to
- // insert the previous pixel value (from t1).
- // "next" is current row shifted left by 1 pixel, with first pixel
- // of next block of 8 pixels added in.
- __m128i prv0 = _mm_slli_si128(curr, 2);
- __m128i nxt0 = _mm_srli_si128(curr, 2);
- __m128i prev = _mm_insert_epi16(prv0, t1, 0);
- __m128i next = _mm_insert_epi16(nxt0, 3*in_near[i+8] + in_far[i+8], 7);
-
- // horizontal filter, polyphase implementation since it's convenient:
- // even pixels = 3*cur + prev = cur*4 + (prev - cur)
- // odd pixels = 3*cur + next = cur*4 + (next - cur)
- // note the shared term.
- __m128i bias = _mm_set1_epi16(8);
- __m128i curs = _mm_slli_epi16(curr, 2);
- __m128i prvd = _mm_sub_epi16(prev, curr);
- __m128i nxtd = _mm_sub_epi16(next, curr);
- __m128i curb = _mm_add_epi16(curs, bias);
- __m128i even = _mm_add_epi16(prvd, curb);
- __m128i odd = _mm_add_epi16(nxtd, curb);
-
- // interleave even and odd pixels, then undo scaling.
- __m128i int0 = _mm_unpacklo_epi16(even, odd);
- __m128i int1 = _mm_unpackhi_epi16(even, odd);
- __m128i de0 = _mm_srli_epi16(int0, 4);
- __m128i de1 = _mm_srli_epi16(int1, 4);
-
- // pack and write output
- __m128i outv = _mm_packus_epi16(de0, de1);
- _mm_storeu_si128((__m128i *) (out + i*2), outv);
-#elif defined(STBI_NEON)
- // load and perform the vertical filtering pass
- // this uses 3*x + y = 4*x + (y - x)
- uint8x8_t farb = vld1_u8(in_far + i);
- uint8x8_t nearb = vld1_u8(in_near + i);
- int16x8_t diff = vreinterpretq_s16_u16(vsubl_u8(farb, nearb));
- int16x8_t nears = vreinterpretq_s16_u16(vshll_n_u8(nearb, 2));
- int16x8_t curr = vaddq_s16(nears, diff); // current row
-
- // horizontal filter works the same based on shifted vers of current
- // row. "prev" is current row shifted right by 1 pixel; we need to
- // insert the previous pixel value (from t1).
- // "next" is current row shifted left by 1 pixel, with first pixel
- // of next block of 8 pixels added in.
- int16x8_t prv0 = vextq_s16(curr, curr, 7);
- int16x8_t nxt0 = vextq_s16(curr, curr, 1);
- int16x8_t prev = vsetq_lane_s16(t1, prv0, 0);
- int16x8_t next = vsetq_lane_s16(3*in_near[i+8] + in_far[i+8], nxt0, 7);
-
- // horizontal filter, polyphase implementation since it's convenient:
- // even pixels = 3*cur + prev = cur*4 + (prev - cur)
- // odd pixels = 3*cur + next = cur*4 + (next - cur)
- // note the shared term.
- int16x8_t curs = vshlq_n_s16(curr, 2);
- int16x8_t prvd = vsubq_s16(prev, curr);
- int16x8_t nxtd = vsubq_s16(next, curr);
- int16x8_t even = vaddq_s16(curs, prvd);
- int16x8_t odd = vaddq_s16(curs, nxtd);
-
- // undo scaling and round, then store with even/odd phases interleaved
- uint8x8x2_t o;
- o.val[0] = vqrshrun_n_s16(even, 4);
- o.val[1] = vqrshrun_n_s16(odd, 4);
- vst2_u8(out + i*2, o);
-#endif
-
- // "previous" value for next iter
- t1 = 3*in_near[i+7] + in_far[i+7];
- }
-
- t0 = t1;
- t1 = 3*in_near[i] + in_far[i];
- out[i*2] = stbi__div16(3*t1 + t0 + 8);
-
- for (++i; i < w; ++i) {
- t0 = t1;
- t1 = 3*in_near[i]+in_far[i];
- out[i*2-1] = stbi__div16(3*t0 + t1 + 8);
- out[i*2 ] = stbi__div16(3*t1 + t0 + 8);
- }
- out[w*2-1] = stbi__div4(t1+2);
-
- STBI_NOTUSED(hs);
-
- return out;
-}
-#endif
-
-static stbi_uc *stbi__resample_row_generic(stbi_uc *out, stbi_uc *in_near, stbi_uc *in_far, int w, int hs)
-{
- // resample with nearest-neighbor
- int i,j;
- STBI_NOTUSED(in_far);
- for (i=0; i < w; ++i)
- for (j=0; j < hs; ++j)
- out[i*hs+j] = in_near[i];
- return out;
-}
-
-// this is a reduced-precision calculation of YCbCr-to-RGB introduced
-// to make sure the code produces the same results in both SIMD and scalar
-#define stbi__float2fixed(x) (((int) ((x) * 4096.0f + 0.5f)) << 8)
-static void stbi__YCbCr_to_RGB_row(stbi_uc *out, const stbi_uc *y, const stbi_uc *pcb, const stbi_uc *pcr, int count, int step)
-{
- int i;
- for (i=0; i < count; ++i) {
- int y_fixed = (y[i] << 20) + (1<<19); // rounding
- int r,g,b;
- int cr = pcr[i] - 128;
- int cb = pcb[i] - 128;
- r = y_fixed + cr* stbi__float2fixed(1.40200f);
- g = y_fixed + (cr*-stbi__float2fixed(0.71414f)) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
- b = y_fixed + cb* stbi__float2fixed(1.77200f);
- r >>= 20;
- g >>= 20;
- b >>= 20;
- if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
- if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
- if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
- out[0] = (stbi_uc)r;
- out[1] = (stbi_uc)g;
- out[2] = (stbi_uc)b;
- out[3] = 255;
- out += step;
- }
-}
-
-#if defined(STBI_SSE2) || defined(STBI_NEON)
-static void stbi__YCbCr_to_RGB_simd(stbi_uc *out, stbi_uc const *y, stbi_uc const *pcb, stbi_uc const *pcr, int count, int step)
-{
- int i = 0;
-
-#ifdef STBI_SSE2
- // step == 3 is pretty ugly on the final interleave, and i'm not convinced
- // it's useful in practice (you wouldn't use it for textures, for example).
- // so just accelerate step == 4 case.
- if (step == 4) {
- // this is a fairly straightforward implementation and not super-optimized.
- __m128i signflip = _mm_set1_epi8(-0x80);
- __m128i cr_const0 = _mm_set1_epi16( (short) ( 1.40200f*4096.0f+0.5f));
- __m128i cr_const1 = _mm_set1_epi16( - (short) ( 0.71414f*4096.0f+0.5f));
- __m128i cb_const0 = _mm_set1_epi16( - (short) ( 0.34414f*4096.0f+0.5f));
- __m128i cb_const1 = _mm_set1_epi16( (short) ( 1.77200f*4096.0f+0.5f));
- __m128i y_bias = _mm_set1_epi8((char) (unsigned char) 128);
- __m128i xw = _mm_set1_epi16(255); // alpha channel
-
- for (; i+7 < count; i += 8) {
- // load
- __m128i y_bytes = _mm_loadl_epi64((__m128i *) (y+i));
- __m128i cr_bytes = _mm_loadl_epi64((__m128i *) (pcr+i));
- __m128i cb_bytes = _mm_loadl_epi64((__m128i *) (pcb+i));
- __m128i cr_biased = _mm_xor_si128(cr_bytes, signflip); // -128
- __m128i cb_biased = _mm_xor_si128(cb_bytes, signflip); // -128
-
- // unpack to short (and left-shift cr, cb by 8)
- __m128i yw = _mm_unpacklo_epi8(y_bias, y_bytes);
- __m128i crw = _mm_unpacklo_epi8(_mm_setzero_si128(), cr_biased);
- __m128i cbw = _mm_unpacklo_epi8(_mm_setzero_si128(), cb_biased);
-
- // color transform
- __m128i yws = _mm_srli_epi16(yw, 4);
- __m128i cr0 = _mm_mulhi_epi16(cr_const0, crw);
- __m128i cb0 = _mm_mulhi_epi16(cb_const0, cbw);
- __m128i cb1 = _mm_mulhi_epi16(cbw, cb_const1);
- __m128i cr1 = _mm_mulhi_epi16(crw, cr_const1);
- __m128i rws = _mm_add_epi16(cr0, yws);
- __m128i gwt = _mm_add_epi16(cb0, yws);
- __m128i bws = _mm_add_epi16(yws, cb1);
- __m128i gws = _mm_add_epi16(gwt, cr1);
-
- // descale
- __m128i rw = _mm_srai_epi16(rws, 4);
- __m128i bw = _mm_srai_epi16(bws, 4);
- __m128i gw = _mm_srai_epi16(gws, 4);
-
- // back to byte, set up for transpose
- __m128i brb = _mm_packus_epi16(rw, bw);
- __m128i gxb = _mm_packus_epi16(gw, xw);
-
- // transpose to interleave channels
- __m128i t0 = _mm_unpacklo_epi8(brb, gxb);
- __m128i t1 = _mm_unpackhi_epi8(brb, gxb);
- __m128i o0 = _mm_unpacklo_epi16(t0, t1);
- __m128i o1 = _mm_unpackhi_epi16(t0, t1);
-
- // store
- _mm_storeu_si128((__m128i *) (out + 0), o0);
- _mm_storeu_si128((__m128i *) (out + 16), o1);
- out += 32;
- }
- }
-#endif
-
-#ifdef STBI_NEON
- // in this version, step=3 support would be easy to add. but is there demand?
- if (step == 4) {
- // this is a fairly straightforward implementation and not super-optimized.
- uint8x8_t signflip = vdup_n_u8(0x80);
- int16x8_t cr_const0 = vdupq_n_s16( (short) ( 1.40200f*4096.0f+0.5f));
- int16x8_t cr_const1 = vdupq_n_s16( - (short) ( 0.71414f*4096.0f+0.5f));
- int16x8_t cb_const0 = vdupq_n_s16( - (short) ( 0.34414f*4096.0f+0.5f));
- int16x8_t cb_const1 = vdupq_n_s16( (short) ( 1.77200f*4096.0f+0.5f));
-
- for (; i+7 < count; i += 8) {
- // load
- uint8x8_t y_bytes = vld1_u8(y + i);
- uint8x8_t cr_bytes = vld1_u8(pcr + i);
- uint8x8_t cb_bytes = vld1_u8(pcb + i);
- int8x8_t cr_biased = vreinterpret_s8_u8(vsub_u8(cr_bytes, signflip));
- int8x8_t cb_biased = vreinterpret_s8_u8(vsub_u8(cb_bytes, signflip));
-
- // expand to s16
- int16x8_t yws = vreinterpretq_s16_u16(vshll_n_u8(y_bytes, 4));
- int16x8_t crw = vshll_n_s8(cr_biased, 7);
- int16x8_t cbw = vshll_n_s8(cb_biased, 7);
-
- // color transform
- int16x8_t cr0 = vqdmulhq_s16(crw, cr_const0);
- int16x8_t cb0 = vqdmulhq_s16(cbw, cb_const0);
- int16x8_t cr1 = vqdmulhq_s16(crw, cr_const1);
- int16x8_t cb1 = vqdmulhq_s16(cbw, cb_const1);
- int16x8_t rws = vaddq_s16(yws, cr0);
- int16x8_t gws = vaddq_s16(vaddq_s16(yws, cb0), cr1);
- int16x8_t bws = vaddq_s16(yws, cb1);
-
- // undo scaling, round, convert to byte
- uint8x8x4_t o;
- o.val[0] = vqrshrun_n_s16(rws, 4);
- o.val[1] = vqrshrun_n_s16(gws, 4);
- o.val[2] = vqrshrun_n_s16(bws, 4);
- o.val[3] = vdup_n_u8(255);
-
- // store, interleaving r/g/b/a
- vst4_u8(out, o);
- out += 8*4;
- }
- }
-#endif
-
- for (; i < count; ++i) {
- int y_fixed = (y[i] << 20) + (1<<19); // rounding
- int r,g,b;
- int cr = pcr[i] - 128;
- int cb = pcb[i] - 128;
- r = y_fixed + cr* stbi__float2fixed(1.40200f);
- g = y_fixed + cr*-stbi__float2fixed(0.71414f) + ((cb*-stbi__float2fixed(0.34414f)) & 0xffff0000);
- b = y_fixed + cb* stbi__float2fixed(1.77200f);
- r >>= 20;
- g >>= 20;
- b >>= 20;
- if ((unsigned) r > 255) { if (r < 0) r = 0; else r = 255; }
- if ((unsigned) g > 255) { if (g < 0) g = 0; else g = 255; }
- if ((unsigned) b > 255) { if (b < 0) b = 0; else b = 255; }
- out[0] = (stbi_uc)r;
- out[1] = (stbi_uc)g;
- out[2] = (stbi_uc)b;
- out[3] = 255;
- out += step;
- }
-}
-#endif
-
-// set up the kernels
-static void stbi__setup_jpeg(stbi__jpeg *j)
-{
- j->idct_block_kernel = stbi__idct_block;
- j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_row;
- j->resample_row_hv_2_kernel = stbi__resample_row_hv_2;
-
-#ifdef STBI_SSE2
- if (stbi__sse2_available()) {
- j->idct_block_kernel = stbi__idct_simd;
- j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
- j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
- }
-#endif
-
-#ifdef STBI_NEON
- j->idct_block_kernel = stbi__idct_simd;
- j->YCbCr_to_RGB_kernel = stbi__YCbCr_to_RGB_simd;
- j->resample_row_hv_2_kernel = stbi__resample_row_hv_2_simd;
-#endif
-}
-
-// clean up the temporary component buffers
-static void stbi__cleanup_jpeg(stbi__jpeg *j)
-{
- stbi__free_jpeg_components(j, j->s->img_n, 0);
-}
-
-typedef struct
-{
- resample_row_func resample;
- stbi_uc *line0,*line1;
- int hs,vs; // expansion factor in each axis
- int w_lores; // horizontal pixels pre-expansion
- int ystep; // how far through vertical expansion we are
- int ypos; // which pre-expansion row we're on
-} stbi__resample;
-
-// fast 0..255 * 0..255 => 0..255 rounded multiplication
-static stbi_uc stbi__blinn_8x8(stbi_uc x, stbi_uc y)
-{
- unsigned int t = x*y + 128;
- return (stbi_uc) ((t + (t >>8)) >> 8);
-}
-
-static stbi_uc *load_jpeg_image(stbi__jpeg *z, int *out_x, int *out_y, int *comp, int req_comp)
-{
- int n, decode_n, is_rgb;
- z->s->img_n = 0; // make stbi__cleanup_jpeg safe
-
- // validate req_comp
- if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
-
- // load a jpeg image from whichever source, but leave in YCbCr format
- if (!stbi__decode_jpeg_image(z)) { stbi__cleanup_jpeg(z); return NULL; }
-
- // determine actual number of components to generate
- n = req_comp ? req_comp : z->s->img_n >= 3 ? 3 : 1;
-
- is_rgb = z->s->img_n == 3 && (z->rgb == 3 || (z->app14_color_transform == 0 && !z->jfif));
-
- if (z->s->img_n == 3 && n < 3 && !is_rgb)
- decode_n = 1;
- else
- decode_n = z->s->img_n;
-
- // resample and color-convert
- {
- int k;
- unsigned int i,j;
- stbi_uc *output;
- stbi_uc *coutput[4];
-
- stbi__resample res_comp[4];
-
- for (k=0; k < decode_n; ++k) {
- stbi__resample *r = &res_comp[k];
-
- // allocate line buffer big enough for upsampling off the edges
- // with upsample factor of 4
- z->img_comp[k].linebuf = (stbi_uc *) stbi__malloc(z->s->img_x + 3);
- if (!z->img_comp[k].linebuf) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
-
- r->hs = z->img_h_max / z->img_comp[k].h;
- r->vs = z->img_v_max / z->img_comp[k].v;
- r->ystep = r->vs >> 1;
- r->w_lores = (z->s->img_x + r->hs-1) / r->hs;
- r->ypos = 0;
- r->line0 = r->line1 = z->img_comp[k].data;
-
- if (r->hs == 1 && r->vs == 1) r->resample = resample_row_1;
- else if (r->hs == 1 && r->vs == 2) r->resample = stbi__resample_row_v_2;
- else if (r->hs == 2 && r->vs == 1) r->resample = stbi__resample_row_h_2;
- else if (r->hs == 2 && r->vs == 2) r->resample = z->resample_row_hv_2_kernel;
- else r->resample = stbi__resample_row_generic;
- }
-
- // can't error after this so, this is safe
- output = (stbi_uc *) stbi__malloc_mad3(n, z->s->img_x, z->s->img_y, 1);
- if (!output) { stbi__cleanup_jpeg(z); return stbi__errpuc("outofmem", "Out of memory"); }
-
- // now go ahead and resample
- for (j=0; j < z->s->img_y; ++j) {
- stbi_uc *out = output + n * z->s->img_x * j;
- for (k=0; k < decode_n; ++k) {
- stbi__resample *r = &res_comp[k];
- int y_bot = r->ystep >= (r->vs >> 1);
- coutput[k] = r->resample(z->img_comp[k].linebuf,
- y_bot ? r->line1 : r->line0,
- y_bot ? r->line0 : r->line1,
- r->w_lores, r->hs);
- if (++r->ystep >= r->vs) {
- r->ystep = 0;
- r->line0 = r->line1;
- if (++r->ypos < z->img_comp[k].y)
- r->line1 += z->img_comp[k].w2;
- }
- }
- if (n >= 3) {
- stbi_uc *y = coutput[0];
- if (z->s->img_n == 3) {
- if (is_rgb) {
- for (i=0; i < z->s->img_x; ++i) {
- out[0] = y[i];
- out[1] = coutput[1][i];
- out[2] = coutput[2][i];
- out[3] = 255;
- out += n;
- }
- } else {
- z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
- }
- } else if (z->s->img_n == 4) {
- if (z->app14_color_transform == 0) { // CMYK
- for (i=0; i < z->s->img_x; ++i) {
- stbi_uc m = coutput[3][i];
- out[0] = stbi__blinn_8x8(coutput[0][i], m);
- out[1] = stbi__blinn_8x8(coutput[1][i], m);
- out[2] = stbi__blinn_8x8(coutput[2][i], m);
- out[3] = 255;
- out += n;
- }
- } else if (z->app14_color_transform == 2) { // YCCK
- z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
- for (i=0; i < z->s->img_x; ++i) {
- stbi_uc m = coutput[3][i];
- out[0] = stbi__blinn_8x8(255 - out[0], m);
- out[1] = stbi__blinn_8x8(255 - out[1], m);
- out[2] = stbi__blinn_8x8(255 - out[2], m);
- out += n;
- }
- } else { // YCbCr + alpha? Ignore the fourth channel for now
- z->YCbCr_to_RGB_kernel(out, y, coutput[1], coutput[2], z->s->img_x, n);
- }
- } else
- for (i=0; i < z->s->img_x; ++i) {
- out[0] = out[1] = out[2] = y[i];
- out[3] = 255; // not used if n==3
- out += n;
- }
- } else {
- if (is_rgb) {
- if (n == 1)
- for (i=0; i < z->s->img_x; ++i)
- *out++ = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
- else {
- for (i=0; i < z->s->img_x; ++i, out += 2) {
- out[0] = stbi__compute_y(coutput[0][i], coutput[1][i], coutput[2][i]);
- out[1] = 255;
- }
- }
- } else if (z->s->img_n == 4 && z->app14_color_transform == 0) {
- for (i=0; i < z->s->img_x; ++i) {
- stbi_uc m = coutput[3][i];
- stbi_uc r = stbi__blinn_8x8(coutput[0][i], m);
- stbi_uc g = stbi__blinn_8x8(coutput[1][i], m);
- stbi_uc b = stbi__blinn_8x8(coutput[2][i], m);
- out[0] = stbi__compute_y(r, g, b);
- out[1] = 255;
- out += n;
- }
- } else if (z->s->img_n == 4 && z->app14_color_transform == 2) {
- for (i=0; i < z->s->img_x; ++i) {
- out[0] = stbi__blinn_8x8(255 - coutput[0][i], coutput[3][i]);
- out[1] = 255;
- out += n;
- }
- } else {
- stbi_uc *y = coutput[0];
- if (n == 1)
- for (i=0; i < z->s->img_x; ++i) out[i] = y[i];
- else
- for (i=0; i < z->s->img_x; ++i) *out++ = y[i], *out++ = 255;
- }
- }
- }
- stbi__cleanup_jpeg(z);
- *out_x = z->s->img_x;
- *out_y = z->s->img_y;
- if (comp) *comp = z->s->img_n >= 3 ? 3 : 1; // report original components, not output
- return output;
- }
-}
-
-static void *stbi__jpeg_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- unsigned char* result;
- stbi__jpeg* j = (stbi__jpeg*) stbi__malloc(sizeof(stbi__jpeg));
- STBI_NOTUSED(ri);
- j->s = s;
- stbi__setup_jpeg(j);
- result = load_jpeg_image(j, x,y,comp,req_comp);
- STBI_FREE(j);
- return result;
-}
-
-static int stbi__jpeg_test(stbi__context *s)
-{
- int r;
- stbi__jpeg* j = (stbi__jpeg*)stbi__malloc(sizeof(stbi__jpeg));
- j->s = s;
- stbi__setup_jpeg(j);
- r = stbi__decode_jpeg_header(j, STBI__SCAN_type);
- stbi__rewind(s);
- STBI_FREE(j);
- return r;
-}
-
-static int stbi__jpeg_info_raw(stbi__jpeg *j, int *x, int *y, int *comp)
-{
- if (!stbi__decode_jpeg_header(j, STBI__SCAN_header)) {
- stbi__rewind( j->s );
- return 0;
- }
- if (x) *x = j->s->img_x;
- if (y) *y = j->s->img_y;
- if (comp) *comp = j->s->img_n >= 3 ? 3 : 1;
- return 1;
-}
-
-static int stbi__jpeg_info(stbi__context *s, int *x, int *y, int *comp)
-{
- int result;
- stbi__jpeg* j = (stbi__jpeg*) (stbi__malloc(sizeof(stbi__jpeg)));
- j->s = s;
- result = stbi__jpeg_info_raw(j, x, y, comp);
- STBI_FREE(j);
- return result;
-}
-#endif
-
-// public domain zlib decode v0.2 Sean Barrett 2006-11-18
-// simple implementation
-// - all input must be provided in an upfront buffer
-// - all output is written to a single output buffer (can malloc/realloc)
-// performance
-// - fast huffman
-
-#ifndef STBI_NO_ZLIB
-
-// fast-way is faster to check than jpeg huffman, but slow way is slower
-#define STBI__ZFAST_BITS 9 // accelerate all cases in default tables
-#define STBI__ZFAST_MASK ((1 << STBI__ZFAST_BITS) - 1)
-
-// zlib-style huffman encoding
-// (jpegs packs from left, zlib from right, so can't share code)
-typedef struct
-{
- stbi__uint16 fast[1 << STBI__ZFAST_BITS];
- stbi__uint16 firstcode[16];
- int maxcode[17];
- stbi__uint16 firstsymbol[16];
- stbi_uc size[288];
- stbi__uint16 value[288];
-} stbi__zhuffman;
-
-stbi_inline static int stbi__bitreverse16(int n)
-{
- n = ((n & 0xAAAA) >> 1) | ((n & 0x5555) << 1);
- n = ((n & 0xCCCC) >> 2) | ((n & 0x3333) << 2);
- n = ((n & 0xF0F0) >> 4) | ((n & 0x0F0F) << 4);
- n = ((n & 0xFF00) >> 8) | ((n & 0x00FF) << 8);
- return n;
-}
-
-stbi_inline static int stbi__bit_reverse(int v, int bits)
-{
- STBI_ASSERT(bits <= 16);
- // to bit reverse n bits, reverse 16 and shift
- // e.g. 11 bits, bit reverse and shift away 5
- return stbi__bitreverse16(v) >> (16-bits);
-}
-
-static int stbi__zbuild_huffman(stbi__zhuffman *z, const stbi_uc *sizelist, int num)
-{
- int i,k=0;
- int code, next_code[16], sizes[17];
-
- // DEFLATE spec for generating codes
- memset(sizes, 0, sizeof(sizes));
- memset(z->fast, 0, sizeof(z->fast));
- for (i=0; i < num; ++i)
- ++sizes[sizelist[i]];
- sizes[0] = 0;
- for (i=1; i < 16; ++i)
- if (sizes[i] > (1 << i))
- return stbi__err("bad sizes", "Corrupt PNG");
- code = 0;
- for (i=1; i < 16; ++i) {
- next_code[i] = code;
- z->firstcode[i] = (stbi__uint16) code;
- z->firstsymbol[i] = (stbi__uint16) k;
- code = (code + sizes[i]);
- if (sizes[i])
- if (code-1 >= (1 << i)) return stbi__err("bad codelengths","Corrupt PNG");
- z->maxcode[i] = code << (16-i); // preshift for inner loop
- code <<= 1;
- k += sizes[i];
- }
- z->maxcode[16] = 0x10000; // sentinel
- for (i=0; i < num; ++i) {
- int s = sizelist[i];
- if (s) {
- int c = next_code[s] - z->firstcode[s] + z->firstsymbol[s];
- stbi__uint16 fastv = (stbi__uint16) ((s << 9) | i);
- z->size [c] = (stbi_uc ) s;
- z->value[c] = (stbi__uint16) i;
- if (s <= STBI__ZFAST_BITS) {
- int j = stbi__bit_reverse(next_code[s],s);
- while (j < (1 << STBI__ZFAST_BITS)) {
- z->fast[j] = fastv;
- j += (1 << s);
- }
- }
- ++next_code[s];
- }
- }
- return 1;
-}
-
-// zlib-from-memory implementation for PNG reading
-// because PNG allows splitting the zlib stream arbitrarily,
-// and it's annoying structurally to have PNG call ZLIB call PNG,
-// we require PNG read all the IDATs and combine them into a single
-// memory buffer
-
-typedef struct
-{
- stbi_uc *zbuffer, *zbuffer_end;
- int num_bits;
- stbi__uint32 code_buffer;
-
- char *zout;
- char *zout_start;
- char *zout_end;
- int z_expandable;
-
- stbi__zhuffman z_length, z_distance;
-} stbi__zbuf;
-
-stbi_inline static stbi_uc stbi__zget8(stbi__zbuf *z)
-{
- if (z->zbuffer >= z->zbuffer_end) return 0;
- return *z->zbuffer++;
-}
-
-static void stbi__fill_bits(stbi__zbuf *z)
-{
- do {
- STBI_ASSERT(z->code_buffer < (1U << z->num_bits));
- z->code_buffer |= (unsigned int) stbi__zget8(z) << z->num_bits;
- z->num_bits += 8;
- } while (z->num_bits <= 24);
-}
-
-stbi_inline static unsigned int stbi__zreceive(stbi__zbuf *z, int n)
-{
- unsigned int k;
- if (z->num_bits < n) stbi__fill_bits(z);
- k = z->code_buffer & ((1 << n) - 1);
- z->code_buffer >>= n;
- z->num_bits -= n;
- return k;
-}
-
-static int stbi__zhuffman_decode_slowpath(stbi__zbuf *a, stbi__zhuffman *z)
-{
- int b,s,k;
- // not resolved by fast table, so compute it the slow way
- // use jpeg approach, which requires MSbits at top
- k = stbi__bit_reverse(a->code_buffer, 16);
- for (s=STBI__ZFAST_BITS+1; ; ++s)
- if (k < z->maxcode[s])
- break;
- if (s == 16) return -1; // invalid code!
- // code size is s, so:
- b = (k >> (16-s)) - z->firstcode[s] + z->firstsymbol[s];
- STBI_ASSERT(z->size[b] == s);
- a->code_buffer >>= s;
- a->num_bits -= s;
- return z->value[b];
-}
-
-stbi_inline static int stbi__zhuffman_decode(stbi__zbuf *a, stbi__zhuffman *z)
-{
- int b,s;
- if (a->num_bits < 16) stbi__fill_bits(a);
- b = z->fast[a->code_buffer & STBI__ZFAST_MASK];
- if (b) {
- s = b >> 9;
- a->code_buffer >>= s;
- a->num_bits -= s;
- return b & 511;
- }
- return stbi__zhuffman_decode_slowpath(a, z);
-}
-
-static int stbi__zexpand(stbi__zbuf *z, char *zout, int n) // need to make room for n bytes
-{
- char *q;
- int cur, limit, old_limit;
- z->zout = zout;
- if (!z->z_expandable) return stbi__err("output buffer limit","Corrupt PNG");
- cur = (int) (z->zout - z->zout_start);
- limit = old_limit = (int) (z->zout_end - z->zout_start);
- while (cur + n > limit)
- limit *= 2;
- q = (char *) STBI_REALLOC_SIZED(z->zout_start, old_limit, limit);
- STBI_NOTUSED(old_limit);
- if (q == NULL) return stbi__err("outofmem", "Out of memory");
- z->zout_start = q;
- z->zout = q + cur;
- z->zout_end = q + limit;
- return 1;
-}
-
-static const int stbi__zlength_base[31] = {
- 3,4,5,6,7,8,9,10,11,13,
- 15,17,19,23,27,31,35,43,51,59,
- 67,83,99,115,131,163,195,227,258,0,0 };
-
-static const int stbi__zlength_extra[31]=
-{ 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0 };
-
-static const int stbi__zdist_base[32] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,
-257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0};
-
-static const int stbi__zdist_extra[32] =
-{ 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13};
-
-static int stbi__parse_huffman_block(stbi__zbuf *a)
-{
- char *zout = a->zout;
- for(;;) {
- int z = stbi__zhuffman_decode(a, &a->z_length);
- if (z < 256) {
- if (z < 0) return stbi__err("bad huffman code","Corrupt PNG"); // error in huffman codes
- if (zout >= a->zout_end) {
- if (!stbi__zexpand(a, zout, 1)) return 0;
- zout = a->zout;
- }
- *zout++ = (char) z;
- } else {
- stbi_uc *p;
- int len,dist;
- if (z == 256) {
- a->zout = zout;
- return 1;
- }
- z -= 257;
- len = stbi__zlength_base[z];
- if (stbi__zlength_extra[z]) len += stbi__zreceive(a, stbi__zlength_extra[z]);
- z = stbi__zhuffman_decode(a, &a->z_distance);
- if (z < 0) return stbi__err("bad huffman code","Corrupt PNG");
- dist = stbi__zdist_base[z];
- if (stbi__zdist_extra[z]) dist += stbi__zreceive(a, stbi__zdist_extra[z]);
- if (zout - a->zout_start < dist) return stbi__err("bad dist","Corrupt PNG");
- if (zout + len > a->zout_end) {
- if (!stbi__zexpand(a, zout, len)) return 0;
- zout = a->zout;
- }
- p = (stbi_uc *) (zout - dist);
- if (dist == 1) { // run of one byte; common in images.
- stbi_uc v = *p;
- if (len) { do *zout++ = v; while (--len); }
- } else {
- if (len) { do *zout++ = *p++; while (--len); }
- }
- }
- }
-}
-
-static int stbi__compute_huffman_codes(stbi__zbuf *a)
-{
- static const stbi_uc length_dezigzag[19] = { 16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15 };
- stbi__zhuffman z_codelength;
- stbi_uc lencodes[286+32+137];//padding for maximum single op
- stbi_uc codelength_sizes[19];
- int i,n;
-
- int hlit = stbi__zreceive(a,5) + 257;
- int hdist = stbi__zreceive(a,5) + 1;
- int hclen = stbi__zreceive(a,4) + 4;
- int ntot = hlit + hdist;
-
- memset(codelength_sizes, 0, sizeof(codelength_sizes));
- for (i=0; i < hclen; ++i) {
- int s = stbi__zreceive(a,3);
- codelength_sizes[length_dezigzag[i]] = (stbi_uc) s;
- }
- if (!stbi__zbuild_huffman(&z_codelength, codelength_sizes, 19)) return 0;
-
- n = 0;
- while (n < ntot) {
- int c = stbi__zhuffman_decode(a, &z_codelength);
- if (c < 0 || c >= 19) return stbi__err("bad codelengths", "Corrupt PNG");
- if (c < 16)
- lencodes[n++] = (stbi_uc) c;
- else {
- stbi_uc fill = 0;
- if (c == 16) {
- c = stbi__zreceive(a,2)+3;
- if (n == 0) return stbi__err("bad codelengths", "Corrupt PNG");
- fill = lencodes[n-1];
- } else if (c == 17)
- c = stbi__zreceive(a,3)+3;
- else {
- STBI_ASSERT(c == 18);
- c = stbi__zreceive(a,7)+11;
- }
- if (ntot - n < c) return stbi__err("bad codelengths", "Corrupt PNG");
- memset(lencodes+n, fill, c);
- n += c;
- }
- }
- if (n != ntot) return stbi__err("bad codelengths","Corrupt PNG");
- if (!stbi__zbuild_huffman(&a->z_length, lencodes, hlit)) return 0;
- if (!stbi__zbuild_huffman(&a->z_distance, lencodes+hlit, hdist)) return 0;
- return 1;
-}
-
-static int stbi__parse_uncompressed_block(stbi__zbuf *a)
-{
- stbi_uc header[4];
- int len,nlen,k;
- if (a->num_bits & 7)
- stbi__zreceive(a, a->num_bits & 7); // discard
- // drain the bit-packed data into header
- k = 0;
- while (a->num_bits > 0) {
- header[k++] = (stbi_uc) (a->code_buffer & 255); // suppress MSVC run-time check
- a->code_buffer >>= 8;
- a->num_bits -= 8;
- }
- STBI_ASSERT(a->num_bits == 0);
- // now fill header the normal way
- while (k < 4)
- header[k++] = stbi__zget8(a);
- len = header[1] * 256 + header[0];
- nlen = header[3] * 256 + header[2];
- if (nlen != (len ^ 0xffff)) return stbi__err("zlib corrupt","Corrupt PNG");
- if (a->zbuffer + len > a->zbuffer_end) return stbi__err("read past buffer","Corrupt PNG");
- if (a->zout + len > a->zout_end)
- if (!stbi__zexpand(a, a->zout, len)) return 0;
- memcpy(a->zout, a->zbuffer, len);
- a->zbuffer += len;
- a->zout += len;
- return 1;
-}
-
-static int stbi__parse_zlib_header(stbi__zbuf *a)
-{
- int cmf = stbi__zget8(a);
- int cm = cmf & 15;
- /* int cinfo = cmf >> 4; */
- int flg = stbi__zget8(a);
- if ((cmf*256+flg) % 31 != 0) return stbi__err("bad zlib header","Corrupt PNG"); // zlib spec
- if (flg & 32) return stbi__err("no preset dict","Corrupt PNG"); // preset dictionary not allowed in png
- if (cm != 8) return stbi__err("bad compression","Corrupt PNG"); // DEFLATE required for png
- // window = 1 << (8 + cinfo)... but who cares, we fully buffer output
- return 1;
-}
-
-static const stbi_uc stbi__zdefault_length[288] =
-{
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
- 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,
- 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,8,8,8,8,8,8,8,8
-};
-static const stbi_uc stbi__zdefault_distance[32] =
-{
- 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
-};
-/*
-Init algorithm:
-{
- int i; // use <= to match clearly with spec
- for (i=0; i <= 143; ++i) stbi__zdefault_length[i] = 8;
- for ( ; i <= 255; ++i) stbi__zdefault_length[i] = 9;
- for ( ; i <= 279; ++i) stbi__zdefault_length[i] = 7;
- for ( ; i <= 287; ++i) stbi__zdefault_length[i] = 8;
-
- for (i=0; i <= 31; ++i) stbi__zdefault_distance[i] = 5;
-}
-*/
-
-static int stbi__parse_zlib(stbi__zbuf *a, int parse_header)
-{
- int final, type;
- if (parse_header)
- if (!stbi__parse_zlib_header(a)) return 0;
- a->num_bits = 0;
- a->code_buffer = 0;
- do {
- final = stbi__zreceive(a,1);
- type = stbi__zreceive(a,2);
- if (type == 0) {
- if (!stbi__parse_uncompressed_block(a)) return 0;
- } else if (type == 3) {
- return 0;
- } else {
- if (type == 1) {
- // use fixed code lengths
- if (!stbi__zbuild_huffman(&a->z_length , stbi__zdefault_length , 288)) return 0;
- if (!stbi__zbuild_huffman(&a->z_distance, stbi__zdefault_distance, 32)) return 0;
- } else {
- if (!stbi__compute_huffman_codes(a)) return 0;
- }
- if (!stbi__parse_huffman_block(a)) return 0;
- }
- } while (!final);
- return 1;
-}
-
-static int stbi__do_zlib(stbi__zbuf *a, char *obuf, int olen, int exp, int parse_header)
-{
- a->zout_start = obuf;
- a->zout = obuf;
- a->zout_end = obuf + olen;
- a->z_expandable = exp;
-
- return stbi__parse_zlib(a, parse_header);
-}
-
-STBIDEF char *stbi_zlib_decode_malloc_guesssize(const char *buffer, int len, int initial_size, int *outlen)
-{
- stbi__zbuf a;
- char *p = (char *) stbi__malloc(initial_size);
- if (p == NULL) return NULL;
- a.zbuffer = (stbi_uc *) buffer;
- a.zbuffer_end = (stbi_uc *) buffer + len;
- if (stbi__do_zlib(&a, p, initial_size, 1, 1)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- STBI_FREE(a.zout_start);
- return NULL;
- }
-}
-
-STBIDEF char *stbi_zlib_decode_malloc(char const *buffer, int len, int *outlen)
-{
- return stbi_zlib_decode_malloc_guesssize(buffer, len, 16384, outlen);
-}
-
-STBIDEF char *stbi_zlib_decode_malloc_guesssize_headerflag(const char *buffer, int len, int initial_size, int *outlen, int parse_header)
-{
- stbi__zbuf a;
- char *p = (char *) stbi__malloc(initial_size);
- if (p == NULL) return NULL;
- a.zbuffer = (stbi_uc *) buffer;
- a.zbuffer_end = (stbi_uc *) buffer + len;
- if (stbi__do_zlib(&a, p, initial_size, 1, parse_header)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- STBI_FREE(a.zout_start);
- return NULL;
- }
-}
-
-STBIDEF int stbi_zlib_decode_buffer(char *obuffer, int olen, char const *ibuffer, int ilen)
-{
- stbi__zbuf a;
- a.zbuffer = (stbi_uc *) ibuffer;
- a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
- if (stbi__do_zlib(&a, obuffer, olen, 0, 1))
- return (int) (a.zout - a.zout_start);
- else
- return -1;
-}
-
-STBIDEF char *stbi_zlib_decode_noheader_malloc(char const *buffer, int len, int *outlen)
-{
- stbi__zbuf a;
- char *p = (char *) stbi__malloc(16384);
- if (p == NULL) return NULL;
- a.zbuffer = (stbi_uc *) buffer;
- a.zbuffer_end = (stbi_uc *) buffer+len;
- if (stbi__do_zlib(&a, p, 16384, 1, 0)) {
- if (outlen) *outlen = (int) (a.zout - a.zout_start);
- return a.zout_start;
- } else {
- STBI_FREE(a.zout_start);
- return NULL;
- }
-}
-
-STBIDEF int stbi_zlib_decode_noheader_buffer(char *obuffer, int olen, const char *ibuffer, int ilen)
-{
- stbi__zbuf a;
- a.zbuffer = (stbi_uc *) ibuffer;
- a.zbuffer_end = (stbi_uc *) ibuffer + ilen;
- if (stbi__do_zlib(&a, obuffer, olen, 0, 0))
- return (int) (a.zout - a.zout_start);
- else
- return -1;
-}
-#endif
-
-// public domain "baseline" PNG decoder v0.10 Sean Barrett 2006-11-18
-// simple implementation
-// - only 8-bit samples
-// - no CRC checking
-// - allocates lots of intermediate memory
-// - avoids problem of streaming data between subsystems
-// - avoids explicit window management
-// performance
-// - uses stb_zlib, a PD zlib implementation with fast huffman decoding
-
-#ifndef STBI_NO_PNG
-typedef struct
-{
- stbi__uint32 length;
- stbi__uint32 type;
-} stbi__pngchunk;
-
-static stbi__pngchunk stbi__get_chunk_header(stbi__context *s)
-{
- stbi__pngchunk c;
- c.length = stbi__get32be(s);
- c.type = stbi__get32be(s);
- return c;
-}
-
-static int stbi__check_png_header(stbi__context *s)
-{
- static const stbi_uc png_sig[8] = { 137,80,78,71,13,10,26,10 };
- int i;
- for (i=0; i < 8; ++i)
- if (stbi__get8(s) != png_sig[i]) return stbi__err("bad png sig","Not a PNG");
- return 1;
-}
-
-typedef struct
-{
- stbi__context *s;
- stbi_uc *idata, *expanded, *out;
- int depth;
-} stbi__png;
-
-
-enum {
- STBI__F_none=0,
- STBI__F_sub=1,
- STBI__F_up=2,
- STBI__F_avg=3,
- STBI__F_paeth=4,
- // synthetic filters used for first scanline to avoid needing a dummy row of 0s
- STBI__F_avg_first,
- STBI__F_paeth_first
-};
-
-static stbi_uc first_row_filter[5] =
-{
- STBI__F_none,
- STBI__F_sub,
- STBI__F_none,
- STBI__F_avg_first,
- STBI__F_paeth_first
-};
-
-static int stbi__paeth(int a, int b, int c)
-{
- int p = a + b - c;
- int pa = abs(p-a);
- int pb = abs(p-b);
- int pc = abs(p-c);
- if (pa <= pb && pa <= pc) return a;
- if (pb <= pc) return b;
- return c;
-}
-
-static const stbi_uc stbi__depth_scale_table[9] = { 0, 0xff, 0x55, 0, 0x11, 0,0,0, 0x01 };
-
-// create the png data from post-deflated data
-static int stbi__create_png_image_raw(stbi__png *a, stbi_uc *raw, stbi__uint32 raw_len, int out_n, stbi__uint32 x, stbi__uint32 y, int depth, int color)
-{
- int bytes = (depth == 16? 2 : 1);
- stbi__context *s = a->s;
- stbi__uint32 i,j,stride = x*out_n*bytes;
- stbi__uint32 img_len, img_width_bytes;
- int k;
- int img_n = s->img_n; // copy it into a local for later
-
- int output_bytes = out_n*bytes;
- int filter_bytes = img_n*bytes;
- int width = x;
-
- STBI_ASSERT(out_n == s->img_n || out_n == s->img_n+1);
- a->out = (stbi_uc *) stbi__malloc_mad3(x, y, output_bytes, 0); // extra bytes to write off the end into
- if (!a->out) return stbi__err("outofmem", "Out of memory");
-
- if (!stbi__mad3sizes_valid(img_n, x, depth, 7)) return stbi__err("too large", "Corrupt PNG");
- img_width_bytes = (((img_n * x * depth) + 7) >> 3);
- img_len = (img_width_bytes + 1) * y;
-
- // we used to check for exact match between raw_len and img_len on non-interlaced PNGs,
- // but issue #276 reported a PNG in the wild that had extra data at the end (all zeros),
- // so just check for raw_len < img_len always.
- if (raw_len < img_len) return stbi__err("not enough pixels","Corrupt PNG");
-
- for (j=0; j < y; ++j) {
- stbi_uc *cur = a->out + stride*j;
- stbi_uc *prior;
- int filter = *raw++;
-
- if (filter > 4)
- return stbi__err("invalid filter","Corrupt PNG");
-
- if (depth < 8) {
- STBI_ASSERT(img_width_bytes <= x);
- cur += x*out_n - img_width_bytes; // store output to the rightmost img_len bytes, so we can decode in place
- filter_bytes = 1;
- width = img_width_bytes;
- }
- prior = cur - stride; // bugfix: need to compute this after 'cur +=' computation above
-
- // if first row, use special filter that doesn't sample previous row
- if (j == 0) filter = first_row_filter[filter];
-
- // handle first byte explicitly
- for (k=0; k < filter_bytes; ++k) {
- switch (filter) {
- case STBI__F_none : cur[k] = raw[k]; break;
- case STBI__F_sub : cur[k] = raw[k]; break;
- case STBI__F_up : cur[k] = STBI__BYTECAST(raw[k] + prior[k]); break;
- case STBI__F_avg : cur[k] = STBI__BYTECAST(raw[k] + (prior[k]>>1)); break;
- case STBI__F_paeth : cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(0,prior[k],0)); break;
- case STBI__F_avg_first : cur[k] = raw[k]; break;
- case STBI__F_paeth_first: cur[k] = raw[k]; break;
- }
- }
-
- if (depth == 8) {
- if (img_n != out_n)
- cur[img_n] = 255; // first pixel
- raw += img_n;
- cur += out_n;
- prior += out_n;
- } else if (depth == 16) {
- if (img_n != out_n) {
- cur[filter_bytes] = 255; // first pixel top byte
- cur[filter_bytes+1] = 255; // first pixel bottom byte
- }
- raw += filter_bytes;
- cur += output_bytes;
- prior += output_bytes;
- } else {
- raw += 1;
- cur += 1;
- prior += 1;
- }
-
- // this is a little gross, so that we don't switch per-pixel or per-component
- if (depth < 8 || img_n == out_n) {
- int nk = (width - 1)*filter_bytes;
- #define STBI__CASE(f) \
- case f: \
- for (k=0; k < nk; ++k)
- switch (filter) {
- // "none" filter turns into a memcpy here; make that explicit.
- case STBI__F_none: memcpy(cur, raw, nk); break;
- STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k-filter_bytes]); } break;
- STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;
- STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k-filter_bytes])>>1)); } break;
- STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],prior[k],prior[k-filter_bytes])); } break;
- STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k-filter_bytes] >> 1)); } break;
- STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k-filter_bytes],0,0)); } break;
- }
- #undef STBI__CASE
- raw += nk;
- } else {
- STBI_ASSERT(img_n+1 == out_n);
- #define STBI__CASE(f) \
- case f: \
- for (i=x-1; i >= 1; --i, cur[filter_bytes]=255,raw+=filter_bytes,cur+=output_bytes,prior+=output_bytes) \
- for (k=0; k < filter_bytes; ++k)
- switch (filter) {
- STBI__CASE(STBI__F_none) { cur[k] = raw[k]; } break;
- STBI__CASE(STBI__F_sub) { cur[k] = STBI__BYTECAST(raw[k] + cur[k- output_bytes]); } break;
- STBI__CASE(STBI__F_up) { cur[k] = STBI__BYTECAST(raw[k] + prior[k]); } break;
- STBI__CASE(STBI__F_avg) { cur[k] = STBI__BYTECAST(raw[k] + ((prior[k] + cur[k- output_bytes])>>1)); } break;
- STBI__CASE(STBI__F_paeth) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],prior[k],prior[k- output_bytes])); } break;
- STBI__CASE(STBI__F_avg_first) { cur[k] = STBI__BYTECAST(raw[k] + (cur[k- output_bytes] >> 1)); } break;
- STBI__CASE(STBI__F_paeth_first) { cur[k] = STBI__BYTECAST(raw[k] + stbi__paeth(cur[k- output_bytes],0,0)); } break;
- }
- #undef STBI__CASE
-
- // the loop above sets the high byte of the pixels' alpha, but for
- // 16 bit png files we also need the low byte set. we'll do that here.
- if (depth == 16) {
- cur = a->out + stride*j; // start at the beginning of the row again
- for (i=0; i < x; ++i,cur+=output_bytes) {
- cur[filter_bytes+1] = 255;
- }
- }
- }
- }
-
- // we make a separate pass to expand bits to pixels; for performance,
- // this could run two scanlines behind the above code, so it won't
- // intefere with filtering but will still be in the cache.
- if (depth < 8) {
- for (j=0; j < y; ++j) {
- stbi_uc *cur = a->out + stride*j;
- stbi_uc *in = a->out + stride*j + x*out_n - img_width_bytes;
- // unpack 1/2/4-bit into a 8-bit buffer. allows us to keep the common 8-bit path optimal at minimal cost for 1/2/4-bit
- // png guarante byte alignment, if width is not multiple of 8/4/2 we'll decode dummy trailing data that will be skipped in the later loop
- stbi_uc scale = (color == 0) ? stbi__depth_scale_table[depth] : 1; // scale grayscale values to 0..255 range
-
- // note that the final byte might overshoot and write more data than desired.
- // we can allocate enough data that this never writes out of memory, but it
- // could also overwrite the next scanline. can it overwrite non-empty data
- // on the next scanline? yes, consider 1-pixel-wide scanlines with 1-bit-per-pixel.
- // so we need to explicitly clamp the final ones
-
- if (depth == 4) {
- for (k=x*img_n; k >= 2; k-=2, ++in) {
- *cur++ = scale * ((*in >> 4) );
- *cur++ = scale * ((*in ) & 0x0f);
- }
- if (k > 0) *cur++ = scale * ((*in >> 4) );
- } else if (depth == 2) {
- for (k=x*img_n; k >= 4; k-=4, ++in) {
- *cur++ = scale * ((*in >> 6) );
- *cur++ = scale * ((*in >> 4) & 0x03);
- *cur++ = scale * ((*in >> 2) & 0x03);
- *cur++ = scale * ((*in ) & 0x03);
- }
- if (k > 0) *cur++ = scale * ((*in >> 6) );
- if (k > 1) *cur++ = scale * ((*in >> 4) & 0x03);
- if (k > 2) *cur++ = scale * ((*in >> 2) & 0x03);
- } else if (depth == 1) {
- for (k=x*img_n; k >= 8; k-=8, ++in) {
- *cur++ = scale * ((*in >> 7) );
- *cur++ = scale * ((*in >> 6) & 0x01);
- *cur++ = scale * ((*in >> 5) & 0x01);
- *cur++ = scale * ((*in >> 4) & 0x01);
- *cur++ = scale * ((*in >> 3) & 0x01);
- *cur++ = scale * ((*in >> 2) & 0x01);
- *cur++ = scale * ((*in >> 1) & 0x01);
- *cur++ = scale * ((*in ) & 0x01);
- }
- if (k > 0) *cur++ = scale * ((*in >> 7) );
- if (k > 1) *cur++ = scale * ((*in >> 6) & 0x01);
- if (k > 2) *cur++ = scale * ((*in >> 5) & 0x01);
- if (k > 3) *cur++ = scale * ((*in >> 4) & 0x01);
- if (k > 4) *cur++ = scale * ((*in >> 3) & 0x01);
- if (k > 5) *cur++ = scale * ((*in >> 2) & 0x01);
- if (k > 6) *cur++ = scale * ((*in >> 1) & 0x01);
- }
- if (img_n != out_n) {
- int q;
- // insert alpha = 255
- cur = a->out + stride*j;
- if (img_n == 1) {
- for (q=x-1; q >= 0; --q) {
- cur[q*2+1] = 255;
- cur[q*2+0] = cur[q];
- }
- } else {
- STBI_ASSERT(img_n == 3);
- for (q=x-1; q >= 0; --q) {
- cur[q*4+3] = 255;
- cur[q*4+2] = cur[q*3+2];
- cur[q*4+1] = cur[q*3+1];
- cur[q*4+0] = cur[q*3+0];
- }
- }
- }
- }
- } else if (depth == 16) {
- // force the image data from big-endian to platform-native.
- // this is done in a separate pass due to the decoding relying
- // on the data being untouched, but could probably be done
- // per-line during decode if care is taken.
- stbi_uc *cur = a->out;
- stbi__uint16 *cur16 = (stbi__uint16*)cur;
-
- for(i=0; i < x*y*out_n; ++i,cur16++,cur+=2) {
- *cur16 = (cur[0] << 8) | cur[1];
- }
- }
-
- return 1;
-}
-
-static int stbi__create_png_image(stbi__png *a, stbi_uc *image_data, stbi__uint32 image_data_len, int out_n, int depth, int color, int interlaced)
-{
- int bytes = (depth == 16 ? 2 : 1);
- int out_bytes = out_n * bytes;
- stbi_uc *final;
- int p;
- if (!interlaced)
- return stbi__create_png_image_raw(a, image_data, image_data_len, out_n, a->s->img_x, a->s->img_y, depth, color);
-
- // de-interlacing
- final = (stbi_uc *) stbi__malloc_mad3(a->s->img_x, a->s->img_y, out_bytes, 0);
- for (p=0; p < 7; ++p) {
- int xorig[] = { 0,4,0,2,0,1,0 };
- int yorig[] = { 0,0,4,0,2,0,1 };
- int xspc[] = { 8,8,4,4,2,2,1 };
- int yspc[] = { 8,8,8,4,4,2,2 };
- int i,j,x,y;
- // pass1_x[4] = 0, pass1_x[5] = 1, pass1_x[12] = 1
- x = (a->s->img_x - xorig[p] + xspc[p]-1) / xspc[p];
- y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
- if (x && y) {
- stbi__uint32 img_len = ((((a->s->img_n * x * depth) + 7) >> 3) + 1) * y;
- if (!stbi__create_png_image_raw(a, image_data, image_data_len, out_n, x, y, depth, color)) {
- STBI_FREE(final);
- return 0;
- }
- for (j=0; j < y; ++j) {
- for (i=0; i < x; ++i) {
- int out_y = j*yspc[p]+yorig[p];
- int out_x = i*xspc[p]+xorig[p];
- memcpy(final + out_y*a->s->img_x*out_bytes + out_x*out_bytes,
- a->out + (j*x+i)*out_bytes, out_bytes);
- }
- }
- STBI_FREE(a->out);
- image_data += img_len;
- image_data_len -= img_len;
- }
- }
- a->out = final;
-
- return 1;
-}
-
-static int stbi__compute_transparency(stbi__png *z, stbi_uc tc[3], int out_n)
-{
- stbi__context *s = z->s;
- stbi__uint32 i, pixel_count = s->img_x * s->img_y;
- stbi_uc *p = z->out;
-
- // compute color-based transparency, assuming we've
- // already got 255 as the alpha value in the output
- STBI_ASSERT(out_n == 2 || out_n == 4);
-
- if (out_n == 2) {
- for (i=0; i < pixel_count; ++i) {
- p[1] = (p[0] == tc[0] ? 0 : 255);
- p += 2;
- }
- } else {
- for (i=0; i < pixel_count; ++i) {
- if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
- p[3] = 0;
- p += 4;
- }
- }
- return 1;
-}
-
-static int stbi__compute_transparency16(stbi__png *z, stbi__uint16 tc[3], int out_n)
-{
- stbi__context *s = z->s;
- stbi__uint32 i, pixel_count = s->img_x * s->img_y;
- stbi__uint16 *p = (stbi__uint16*) z->out;
-
- // compute color-based transparency, assuming we've
- // already got 65535 as the alpha value in the output
- STBI_ASSERT(out_n == 2 || out_n == 4);
-
- if (out_n == 2) {
- for (i = 0; i < pixel_count; ++i) {
- p[1] = (p[0] == tc[0] ? 0 : 65535);
- p += 2;
- }
- } else {
- for (i = 0; i < pixel_count; ++i) {
- if (p[0] == tc[0] && p[1] == tc[1] && p[2] == tc[2])
- p[3] = 0;
- p += 4;
- }
- }
- return 1;
-}
-
-static int stbi__expand_png_palette(stbi__png *a, stbi_uc *palette, int len, int pal_img_n)
-{
- stbi__uint32 i, pixel_count = a->s->img_x * a->s->img_y;
- stbi_uc *p, *temp_out, *orig = a->out;
-
- p = (stbi_uc *) stbi__malloc_mad2(pixel_count, pal_img_n, 0);
- if (p == NULL) return stbi__err("outofmem", "Out of memory");
-
- // between here and free(out) below, exitting would leak
- temp_out = p;
-
- if (pal_img_n == 3) {
- for (i=0; i < pixel_count; ++i) {
- int n = orig[i]*4;
- p[0] = palette[n ];
- p[1] = palette[n+1];
- p[2] = palette[n+2];
- p += 3;
- }
- } else {
- for (i=0; i < pixel_count; ++i) {
- int n = orig[i]*4;
- p[0] = palette[n ];
- p[1] = palette[n+1];
- p[2] = palette[n+2];
- p[3] = palette[n+3];
- p += 4;
- }
- }
- STBI_FREE(a->out);
- a->out = temp_out;
-
- STBI_NOTUSED(len);
-
- return 1;
-}
-
-static int stbi__unpremultiply_on_load = 0;
-static int stbi__de_iphone_flag = 0;
-
-STBIDEF void stbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply)
-{
- stbi__unpremultiply_on_load = flag_true_if_should_unpremultiply;
-}
-
-STBIDEF void stbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert)
-{
- stbi__de_iphone_flag = flag_true_if_should_convert;
-}
-
-static void stbi__de_iphone(stbi__png *z)
-{
- stbi__context *s = z->s;
- stbi__uint32 i, pixel_count = s->img_x * s->img_y;
- stbi_uc *p = z->out;
-
- if (s->img_out_n == 3) { // convert bgr to rgb
- for (i=0; i < pixel_count; ++i) {
- stbi_uc t = p[0];
- p[0] = p[2];
- p[2] = t;
- p += 3;
- }
- } else {
- STBI_ASSERT(s->img_out_n == 4);
- if (stbi__unpremultiply_on_load) {
- // convert bgr to rgb and unpremultiply
- for (i=0; i < pixel_count; ++i) {
- stbi_uc a = p[3];
- stbi_uc t = p[0];
- if (a) {
- stbi_uc half = a / 2;
- p[0] = (p[2] * 255 + half) / a;
- p[1] = (p[1] * 255 + half) / a;
- p[2] = ( t * 255 + half) / a;
- } else {
- p[0] = p[2];
- p[2] = t;
- }
- p += 4;
- }
- } else {
- // convert bgr to rgb
- for (i=0; i < pixel_count; ++i) {
- stbi_uc t = p[0];
- p[0] = p[2];
- p[2] = t;
- p += 4;
- }
- }
- }
-}
-
-#define STBI__PNG_TYPE(a,b,c,d) (((unsigned) (a) << 24) + ((unsigned) (b) << 16) + ((unsigned) (c) << 8) + (unsigned) (d))
-
-static int stbi__parse_png_file(stbi__png *z, int scan, int req_comp)
-{
- stbi_uc palette[1024], pal_img_n=0;
- stbi_uc has_trans=0, tc[3];
- stbi__uint16 tc16[3];
- stbi__uint32 ioff=0, idata_limit=0, i, pal_len=0;
- int first=1,k,interlace=0, color=0, is_iphone=0;
- stbi__context *s = z->s;
-
- z->expanded = NULL;
- z->idata = NULL;
- z->out = NULL;
-
- if (!stbi__check_png_header(s)) return 0;
-
- if (scan == STBI__SCAN_type) return 1;
-
- for (;;) {
- stbi__pngchunk c = stbi__get_chunk_header(s);
- switch (c.type) {
- case STBI__PNG_TYPE('C','g','B','I'):
- is_iphone = 1;
- stbi__skip(s, c.length);
- break;
- case STBI__PNG_TYPE('I','H','D','R'): {
- int comp,filter;
- if (!first) return stbi__err("multiple IHDR","Corrupt PNG");
- first = 0;
- if (c.length != 13) return stbi__err("bad IHDR len","Corrupt PNG");
- s->img_x = stbi__get32be(s); if (s->img_x > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
- s->img_y = stbi__get32be(s); if (s->img_y > (1 << 24)) return stbi__err("too large","Very large image (corrupt?)");
- z->depth = stbi__get8(s); if (z->depth != 1 && z->depth != 2 && z->depth != 4 && z->depth != 8 && z->depth != 16) return stbi__err("1/2/4/8/16-bit only","PNG not supported: 1/2/4/8/16-bit only");
- color = stbi__get8(s); if (color > 6) return stbi__err("bad ctype","Corrupt PNG");
- if (color == 3 && z->depth == 16) return stbi__err("bad ctype","Corrupt PNG");
- if (color == 3) pal_img_n = 3; else if (color & 1) return stbi__err("bad ctype","Corrupt PNG");
- comp = stbi__get8(s); if (comp) return stbi__err("bad comp method","Corrupt PNG");
- filter= stbi__get8(s); if (filter) return stbi__err("bad filter method","Corrupt PNG");
- interlace = stbi__get8(s); if (interlace>1) return stbi__err("bad interlace method","Corrupt PNG");
- if (!s->img_x || !s->img_y) return stbi__err("0-pixel image","Corrupt PNG");
- if (!pal_img_n) {
- s->img_n = (color & 2 ? 3 : 1) + (color & 4 ? 1 : 0);
- if ((1 << 30) / s->img_x / s->img_n < s->img_y) return stbi__err("too large", "Image too large to decode");
- if (scan == STBI__SCAN_header) return 1;
- } else {
- // if paletted, then pal_n is our final components, and
- // img_n is # components to decompress/filter.
- s->img_n = 1;
- if ((1 << 30) / s->img_x / 4 < s->img_y) return stbi__err("too large","Corrupt PNG");
- // if SCAN_header, have to scan to see if we have a tRNS
- }
- break;
- }
-
- case STBI__PNG_TYPE('P','L','T','E'): {
- if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if (c.length > 256*3) return stbi__err("invalid PLTE","Corrupt PNG");
- pal_len = c.length / 3;
- if (pal_len * 3 != c.length) return stbi__err("invalid PLTE","Corrupt PNG");
- for (i=0; i < pal_len; ++i) {
- palette[i*4+0] = stbi__get8(s);
- palette[i*4+1] = stbi__get8(s);
- palette[i*4+2] = stbi__get8(s);
- palette[i*4+3] = 255;
- }
- break;
- }
-
- case STBI__PNG_TYPE('t','R','N','S'): {
- if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if (z->idata) return stbi__err("tRNS after IDAT","Corrupt PNG");
- if (pal_img_n) {
- if (scan == STBI__SCAN_header) { s->img_n = 4; return 1; }
- if (pal_len == 0) return stbi__err("tRNS before PLTE","Corrupt PNG");
- if (c.length > pal_len) return stbi__err("bad tRNS len","Corrupt PNG");
- pal_img_n = 4;
- for (i=0; i < c.length; ++i)
- palette[i*4+3] = stbi__get8(s);
- } else {
- if (!(s->img_n & 1)) return stbi__err("tRNS with alpha","Corrupt PNG");
- if (c.length != (stbi__uint32) s->img_n*2) return stbi__err("bad tRNS len","Corrupt PNG");
- has_trans = 1;
- if (z->depth == 16) {
- for (k = 0; k < s->img_n; ++k) tc16[k] = (stbi__uint16)stbi__get16be(s); // copy the values as-is
- } else {
- for (k = 0; k < s->img_n; ++k) tc[k] = (stbi_uc)(stbi__get16be(s) & 255) * stbi__depth_scale_table[z->depth]; // non 8-bit images will be larger
- }
- }
- break;
- }
-
- case STBI__PNG_TYPE('I','D','A','T'): {
- if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if (pal_img_n && !pal_len) return stbi__err("no PLTE","Corrupt PNG");
- if (scan == STBI__SCAN_header) { s->img_n = pal_img_n; return 1; }
- if ((int)(ioff + c.length) < (int)ioff) return 0;
- if (ioff + c.length > idata_limit) {
- stbi__uint32 idata_limit_old = idata_limit;
- stbi_uc *p;
- if (idata_limit == 0) idata_limit = c.length > 4096 ? c.length : 4096;
- while (ioff + c.length > idata_limit)
- idata_limit *= 2;
- STBI_NOTUSED(idata_limit_old);
- p = (stbi_uc *) STBI_REALLOC_SIZED(z->idata, idata_limit_old, idata_limit); if (p == NULL) return stbi__err("outofmem", "Out of memory");
- z->idata = p;
- }
- if (!stbi__getn(s, z->idata+ioff,c.length)) return stbi__err("outofdata","Corrupt PNG");
- ioff += c.length;
- break;
- }
-
- case STBI__PNG_TYPE('I','E','N','D'): {
- stbi__uint32 raw_len, bpl;
- if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if (scan != STBI__SCAN_load) return 1;
- if (z->idata == NULL) return stbi__err("no IDAT","Corrupt PNG");
- // initial guess for decoded data size to avoid unnecessary reallocs
- bpl = (s->img_x * z->depth + 7) / 8; // bytes per line, per component
- raw_len = bpl * s->img_y * s->img_n /* pixels */ + s->img_y /* filter mode per row */;
- z->expanded = (stbi_uc *) stbi_zlib_decode_malloc_guesssize_headerflag((char *) z->idata, ioff, raw_len, (int *) &raw_len, !is_iphone);
- if (z->expanded == NULL) return 0; // zlib should set error
- STBI_FREE(z->idata); z->idata = NULL;
- if ((req_comp == s->img_n+1 && req_comp != 3 && !pal_img_n) || has_trans)
- s->img_out_n = s->img_n+1;
- else
- s->img_out_n = s->img_n;
- if (!stbi__create_png_image(z, z->expanded, raw_len, s->img_out_n, z->depth, color, interlace)) return 0;
- if (has_trans) {
- if (z->depth == 16) {
- if (!stbi__compute_transparency16(z, tc16, s->img_out_n)) return 0;
- } else {
- if (!stbi__compute_transparency(z, tc, s->img_out_n)) return 0;
- }
- }
- if (is_iphone && stbi__de_iphone_flag && s->img_out_n > 2)
- stbi__de_iphone(z);
- if (pal_img_n) {
- // pal_img_n == 3 or 4
- s->img_n = pal_img_n; // record the actual colors we had
- s->img_out_n = pal_img_n;
- if (req_comp >= 3) s->img_out_n = req_comp;
- if (!stbi__expand_png_palette(z, palette, pal_len, s->img_out_n))
- return 0;
- } else if (has_trans) {
- // non-paletted image with tRNS -> source image has (constant) alpha
- ++s->img_n;
- }
- STBI_FREE(z->expanded); z->expanded = NULL;
- return 1;
- }
-
- default:
- // if critical, fail
- if (first) return stbi__err("first not IHDR", "Corrupt PNG");
- if ((c.type & (1 << 29)) == 0) {
- #ifndef STBI_NO_FAILURE_STRINGS
- // not threadsafe
- static char invalid_chunk[] = "XXXX PNG chunk not known";
- invalid_chunk[0] = STBI__BYTECAST(c.type >> 24);
- invalid_chunk[1] = STBI__BYTECAST(c.type >> 16);
- invalid_chunk[2] = STBI__BYTECAST(c.type >> 8);
- invalid_chunk[3] = STBI__BYTECAST(c.type >> 0);
- #endif
- return stbi__err(invalid_chunk, "PNG not supported: unknown PNG chunk type");
- }
- stbi__skip(s, c.length);
- break;
- }
- // end of PNG chunk, read and skip CRC
- stbi__get32be(s);
- }
-}
-
-static void *stbi__do_png(stbi__png *p, int *x, int *y, int *n, int req_comp, stbi__result_info *ri)
-{
- void *result=NULL;
- if (req_comp < 0 || req_comp > 4) return stbi__errpuc("bad req_comp", "Internal error");
- if (stbi__parse_png_file(p, STBI__SCAN_load, req_comp)) {
- if (p->depth < 8)
- ri->bits_per_channel = 8;
- else
- ri->bits_per_channel = p->depth;
- result = p->out;
- p->out = NULL;
- if (req_comp && req_comp != p->s->img_out_n) {
- if (ri->bits_per_channel == 8)
- result = stbi__convert_format((unsigned char *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
- else
- result = stbi__convert_format16((stbi__uint16 *) result, p->s->img_out_n, req_comp, p->s->img_x, p->s->img_y);
- p->s->img_out_n = req_comp;
- if (result == NULL) return result;
- }
- *x = p->s->img_x;
- *y = p->s->img_y;
- if (n) *n = p->s->img_n;
- }
- STBI_FREE(p->out); p->out = NULL;
- STBI_FREE(p->expanded); p->expanded = NULL;
- STBI_FREE(p->idata); p->idata = NULL;
-
- return result;
-}
-
-static void *stbi__png_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- stbi__png p;
- p.s = s;
- return stbi__do_png(&p, x,y,comp,req_comp, ri);
-}
-
-static int stbi__png_test(stbi__context *s)
-{
- int r;
- r = stbi__check_png_header(s);
- stbi__rewind(s);
- return r;
-}
-
-static int stbi__png_info_raw(stbi__png *p, int *x, int *y, int *comp)
-{
- if (!stbi__parse_png_file(p, STBI__SCAN_header, 0)) {
- stbi__rewind( p->s );
- return 0;
- }
- if (x) *x = p->s->img_x;
- if (y) *y = p->s->img_y;
- if (comp) *comp = p->s->img_n;
- return 1;
-}
-
-static int stbi__png_info(stbi__context *s, int *x, int *y, int *comp)
-{
- stbi__png p;
- p.s = s;
- return stbi__png_info_raw(&p, x, y, comp);
-}
-
-static int stbi__png_is16(stbi__context *s)
-{
- stbi__png p;
- p.s = s;
- if (!stbi__png_info_raw(&p, NULL, NULL, NULL))
- return 0;
- if (p.depth != 16) {
- stbi__rewind(p.s);
- return 0;
- }
- return 1;
-}
-#endif
-
-// Microsoft/Windows BMP image
-
-#ifndef STBI_NO_BMP
-static int stbi__bmp_test_raw(stbi__context *s)
-{
- int r;
- int sz;
- if (stbi__get8(s) != 'B') return 0;
- if (stbi__get8(s) != 'M') return 0;
- stbi__get32le(s); // discard filesize
- stbi__get16le(s); // discard reserved
- stbi__get16le(s); // discard reserved
- stbi__get32le(s); // discard data offset
- sz = stbi__get32le(s);
- r = (sz == 12 || sz == 40 || sz == 56 || sz == 108 || sz == 124);
- return r;
-}
-
-static int stbi__bmp_test(stbi__context *s)
-{
- int r = stbi__bmp_test_raw(s);
- stbi__rewind(s);
- return r;
-}
-
-
-// returns 0..31 for the highest set bit
-static int stbi__high_bit(unsigned int z)
-{
- int n=0;
- if (z == 0) return -1;
- if (z >= 0x10000) n += 16, z >>= 16;
- if (z >= 0x00100) n += 8, z >>= 8;
- if (z >= 0x00010) n += 4, z >>= 4;
- if (z >= 0x00004) n += 2, z >>= 2;
- if (z >= 0x00002) n += 1, z >>= 1;
- return n;
-}
-
-static int stbi__bitcount(unsigned int a)
-{
- a = (a & 0x55555555) + ((a >> 1) & 0x55555555); // max 2
- a = (a & 0x33333333) + ((a >> 2) & 0x33333333); // max 4
- a = (a + (a >> 4)) & 0x0f0f0f0f; // max 8 per 4, now 8 bits
- a = (a + (a >> 8)); // max 16 per 8 bits
- a = (a + (a >> 16)); // max 32 per 8 bits
- return a & 0xff;
-}
-
-// extract an arbitrarily-aligned N-bit value (N=bits)
-// from v, and then make it 8-bits long and fractionally
-// extend it to full full range.
-static int stbi__shiftsigned(int v, int shift, int bits)
-{
- static unsigned int mul_table[9] = {
- 0,
- 0xff/*0b11111111*/, 0x55/*0b01010101*/, 0x49/*0b01001001*/, 0x11/*0b00010001*/,
- 0x21/*0b00100001*/, 0x41/*0b01000001*/, 0x81/*0b10000001*/, 0x01/*0b00000001*/,
- };
- static unsigned int shift_table[9] = {
- 0, 0,0,1,0,2,4,6,0,
- };
- if (shift < 0)
- v <<= -shift;
- else
- v >>= shift;
- STBI_ASSERT(v >= 0 && v < 256);
- v >>= (8-bits);
- STBI_ASSERT(bits >= 0 && bits <= 8);
- return (int) ((unsigned) v * mul_table[bits]) >> shift_table[bits];
-}
-
-typedef struct
-{
- int bpp, offset, hsz;
- unsigned int mr,mg,mb,ma, all_a;
-} stbi__bmp_data;
-
-static void *stbi__bmp_parse_header(stbi__context *s, stbi__bmp_data *info)
-{
- int hsz;
- if (stbi__get8(s) != 'B' || stbi__get8(s) != 'M') return stbi__errpuc("not BMP", "Corrupt BMP");
- stbi__get32le(s); // discard filesize
- stbi__get16le(s); // discard reserved
- stbi__get16le(s); // discard reserved
- info->offset = stbi__get32le(s);
- info->hsz = hsz = stbi__get32le(s);
- info->mr = info->mg = info->mb = info->ma = 0;
-
- if (hsz != 12 && hsz != 40 && hsz != 56 && hsz != 108 && hsz != 124) return stbi__errpuc("unknown BMP", "BMP type not supported: unknown");
- if (hsz == 12) {
- s->img_x = stbi__get16le(s);
- s->img_y = stbi__get16le(s);
- } else {
- s->img_x = stbi__get32le(s);
- s->img_y = stbi__get32le(s);
- }
- if (stbi__get16le(s) != 1) return stbi__errpuc("bad BMP", "bad BMP");
- info->bpp = stbi__get16le(s);
- if (hsz != 12) {
- int compress = stbi__get32le(s);
- if (compress == 1 || compress == 2) return stbi__errpuc("BMP RLE", "BMP type not supported: RLE");
- stbi__get32le(s); // discard sizeof
- stbi__get32le(s); // discard hres
- stbi__get32le(s); // discard vres
- stbi__get32le(s); // discard colorsused
- stbi__get32le(s); // discard max important
- if (hsz == 40 || hsz == 56) {
- if (hsz == 56) {
- stbi__get32le(s);
- stbi__get32le(s);
- stbi__get32le(s);
- stbi__get32le(s);
- }
- if (info->bpp == 16 || info->bpp == 32) {
- if (compress == 0) {
- if (info->bpp == 32) {
- info->mr = 0xffu << 16;
- info->mg = 0xffu << 8;
- info->mb = 0xffu << 0;
- info->ma = 0xffu << 24;
- info->all_a = 0; // if all_a is 0 at end, then we loaded alpha channel but it was all 0
- } else {
- info->mr = 31u << 10;
- info->mg = 31u << 5;
- info->mb = 31u << 0;
- }
- } else if (compress == 3) {
- info->mr = stbi__get32le(s);
- info->mg = stbi__get32le(s);
- info->mb = stbi__get32le(s);
- // not documented, but generated by photoshop and handled by mspaint
- if (info->mr == info->mg && info->mg == info->mb) {
- // ?!?!?
- return stbi__errpuc("bad BMP", "bad BMP");
- }
- } else
- return stbi__errpuc("bad BMP", "bad BMP");
- }
- } else {
- int i;
- if (hsz != 108 && hsz != 124)
- return stbi__errpuc("bad BMP", "bad BMP");
- info->mr = stbi__get32le(s);
- info->mg = stbi__get32le(s);
- info->mb = stbi__get32le(s);
- info->ma = stbi__get32le(s);
- stbi__get32le(s); // discard color space
- for (i=0; i < 12; ++i)
- stbi__get32le(s); // discard color space parameters
- if (hsz == 124) {
- stbi__get32le(s); // discard rendering intent
- stbi__get32le(s); // discard offset of profile data
- stbi__get32le(s); // discard size of profile data
- stbi__get32le(s); // discard reserved
- }
- }
- }
- return (void *) 1;
-}
-
-
-static void *stbi__bmp_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- stbi_uc *out;
- unsigned int mr=0,mg=0,mb=0,ma=0, all_a;
- stbi_uc pal[256][4];
- int psize=0,i,j,width;
- int flip_vertically, pad, target;
- stbi__bmp_data info;
- STBI_NOTUSED(ri);
-
- info.all_a = 255;
- if (stbi__bmp_parse_header(s, &info) == NULL)
- return NULL; // error code already set
-
- flip_vertically = ((int) s->img_y) > 0;
- s->img_y = abs((int) s->img_y);
-
- mr = info.mr;
- mg = info.mg;
- mb = info.mb;
- ma = info.ma;
- all_a = info.all_a;
-
- if (info.hsz == 12) {
- if (info.bpp < 24)
- psize = (info.offset - 14 - 24) / 3;
- } else {
- if (info.bpp < 16)
- psize = (info.offset - 14 - info.hsz) >> 2;
- }
-
- s->img_n = ma ? 4 : 3;
- if (req_comp && req_comp >= 3) // we can directly decode 3 or 4
- target = req_comp;
- else
- target = s->img_n; // if they want monochrome, we'll post-convert
-
- // sanity-check size
- if (!stbi__mad3sizes_valid(target, s->img_x, s->img_y, 0))
- return stbi__errpuc("too large", "Corrupt BMP");
-
- out = (stbi_uc *) stbi__malloc_mad3(target, s->img_x, s->img_y, 0);
- if (!out) return stbi__errpuc("outofmem", "Out of memory");
- if (info.bpp < 16) {
- int z=0;
- if (psize == 0 || psize > 256) { STBI_FREE(out); return stbi__errpuc("invalid", "Corrupt BMP"); }
- for (i=0; i < psize; ++i) {
- pal[i][2] = stbi__get8(s);
- pal[i][1] = stbi__get8(s);
- pal[i][0] = stbi__get8(s);
- if (info.hsz != 12) stbi__get8(s);
- pal[i][3] = 255;
- }
- stbi__skip(s, info.offset - 14 - info.hsz - psize * (info.hsz == 12 ? 3 : 4));
- if (info.bpp == 1) width = (s->img_x + 7) >> 3;
- else if (info.bpp == 4) width = (s->img_x + 1) >> 1;
- else if (info.bpp == 8) width = s->img_x;
- else { STBI_FREE(out); return stbi__errpuc("bad bpp", "Corrupt BMP"); }
- pad = (-width)&3;
- if (info.bpp == 1) {
- for (j=0; j < (int) s->img_y; ++j) {
- int bit_offset = 7, v = stbi__get8(s);
- for (i=0; i < (int) s->img_x; ++i) {
- int color = (v>>bit_offset)&0x1;
- out[z++] = pal[color][0];
- out[z++] = pal[color][1];
- out[z++] = pal[color][2];
- if((--bit_offset) < 0) {
- bit_offset = 7;
- v = stbi__get8(s);
- }
- }
- stbi__skip(s, pad);
- }
- } else {
- for (j=0; j < (int) s->img_y; ++j) {
- for (i=0; i < (int) s->img_x; i += 2) {
- int v=stbi__get8(s),v2=0;
- if (info.bpp == 4) {
- v2 = v & 15;
- v >>= 4;
- }
- out[z++] = pal[v][0];
- out[z++] = pal[v][1];
- out[z++] = pal[v][2];
- if (target == 4) out[z++] = 255;
- if (i+1 == (int) s->img_x) break;
- v = (info.bpp == 8) ? stbi__get8(s) : v2;
- out[z++] = pal[v][0];
- out[z++] = pal[v][1];
- out[z++] = pal[v][2];
- if (target == 4) out[z++] = 255;
- }
- stbi__skip(s, pad);
- }
- }
- } else {
- int rshift=0,gshift=0,bshift=0,ashift=0,rcount=0,gcount=0,bcount=0,acount=0;
- int z = 0;
- int easy=0;
- stbi__skip(s, info.offset - 14 - info.hsz);
- if (info.bpp == 24) width = 3 * s->img_x;
- else if (info.bpp == 16) width = 2*s->img_x;
- else /* bpp = 32 and pad = 0 */ width=0;
- pad = (-width) & 3;
- if (info.bpp == 24) {
- easy = 1;
- } else if (info.bpp == 32) {
- if (mb == 0xff && mg == 0xff00 && mr == 0x00ff0000 && ma == 0xff000000)
- easy = 2;
- }
- if (!easy) {
- if (!mr || !mg || !mb) { STBI_FREE(out); return stbi__errpuc("bad masks", "Corrupt BMP"); }
- // right shift amt to put high bit in position #7
- rshift = stbi__high_bit(mr)-7; rcount = stbi__bitcount(mr);
- gshift = stbi__high_bit(mg)-7; gcount = stbi__bitcount(mg);
- bshift = stbi__high_bit(mb)-7; bcount = stbi__bitcount(mb);
- ashift = stbi__high_bit(ma)-7; acount = stbi__bitcount(ma);
- }
- for (j=0; j < (int) s->img_y; ++j) {
- if (easy) {
- for (i=0; i < (int) s->img_x; ++i) {
- unsigned char a;
- out[z+2] = stbi__get8(s);
- out[z+1] = stbi__get8(s);
- out[z+0] = stbi__get8(s);
- z += 3;
- a = (easy == 2 ? stbi__get8(s) : 255);
- all_a |= a;
- if (target == 4) out[z++] = a;
- }
- } else {
- int bpp = info.bpp;
- for (i=0; i < (int) s->img_x; ++i) {
- stbi__uint32 v = (bpp == 16 ? (stbi__uint32) stbi__get16le(s) : stbi__get32le(s));
- unsigned int a;
- out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mr, rshift, rcount));
- out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mg, gshift, gcount));
- out[z++] = STBI__BYTECAST(stbi__shiftsigned(v & mb, bshift, bcount));
- a = (ma ? stbi__shiftsigned(v & ma, ashift, acount) : 255);
- all_a |= a;
- if (target == 4) out[z++] = STBI__BYTECAST(a);
- }
- }
- stbi__skip(s, pad);
- }
- }
-
- // if alpha channel is all 0s, replace with all 255s
- if (target == 4 && all_a == 0)
- for (i=4*s->img_x*s->img_y-1; i >= 0; i -= 4)
- out[i] = 255;
-
- if (flip_vertically) {
- stbi_uc t;
- for (j=0; j < (int) s->img_y>>1; ++j) {
- stbi_uc *p1 = out + j *s->img_x*target;
- stbi_uc *p2 = out + (s->img_y-1-j)*s->img_x*target;
- for (i=0; i < (int) s->img_x*target; ++i) {
- t = p1[i], p1[i] = p2[i], p2[i] = t;
- }
- }
- }
-
- if (req_comp && req_comp != target) {
- out = stbi__convert_format(out, target, req_comp, s->img_x, s->img_y);
- if (out == NULL) return out; // stbi__convert_format frees input on failure
- }
-
- *x = s->img_x;
- *y = s->img_y;
- if (comp) *comp = s->img_n;
- return out;
-}
-#endif
-
-// Targa Truevision - TGA
-// by Jonathan Dummer
-#ifndef STBI_NO_TGA
-// returns STBI_rgb or whatever, 0 on error
-static int stbi__tga_get_comp(int bits_per_pixel, int is_grey, int* is_rgb16)
-{
- // only RGB or RGBA (incl. 16bit) or grey allowed
- if (is_rgb16) *is_rgb16 = 0;
- switch(bits_per_pixel) {
- case 8: return STBI_grey;
- case 16: if(is_grey) return STBI_grey_alpha;
- // fallthrough
- case 15: if(is_rgb16) *is_rgb16 = 1;
- return STBI_rgb;
- case 24: // fallthrough
- case 32: return bits_per_pixel/8;
- default: return 0;
- }
-}
-
-static int stbi__tga_info(stbi__context *s, int *x, int *y, int *comp)
-{
- int tga_w, tga_h, tga_comp, tga_image_type, tga_bits_per_pixel, tga_colormap_bpp;
- int sz, tga_colormap_type;
- stbi__get8(s); // discard Offset
- tga_colormap_type = stbi__get8(s); // colormap type
- if( tga_colormap_type > 1 ) {
- stbi__rewind(s);
- return 0; // only RGB or indexed allowed
- }
- tga_image_type = stbi__get8(s); // image type
- if ( tga_colormap_type == 1 ) { // colormapped (paletted) image
- if (tga_image_type != 1 && tga_image_type != 9) {
- stbi__rewind(s);
- return 0;
- }
- stbi__skip(s,4); // skip index of first colormap entry and number of entries
- sz = stbi__get8(s); // check bits per palette color entry
- if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) {
- stbi__rewind(s);
- return 0;
- }
- stbi__skip(s,4); // skip image x and y origin
- tga_colormap_bpp = sz;
- } else { // "normal" image w/o colormap - only RGB or grey allowed, +/- RLE
- if ( (tga_image_type != 2) && (tga_image_type != 3) && (tga_image_type != 10) && (tga_image_type != 11) ) {
- stbi__rewind(s);
- return 0; // only RGB or grey allowed, +/- RLE
- }
- stbi__skip(s,9); // skip colormap specification and image x/y origin
- tga_colormap_bpp = 0;
- }
- tga_w = stbi__get16le(s);
- if( tga_w < 1 ) {
- stbi__rewind(s);
- return 0; // test width
- }
- tga_h = stbi__get16le(s);
- if( tga_h < 1 ) {
- stbi__rewind(s);
- return 0; // test height
- }
- tga_bits_per_pixel = stbi__get8(s); // bits per pixel
- stbi__get8(s); // ignore alpha bits
- if (tga_colormap_bpp != 0) {
- if((tga_bits_per_pixel != 8) && (tga_bits_per_pixel != 16)) {
- // when using a colormap, tga_bits_per_pixel is the size of the indexes
- // I don't think anything but 8 or 16bit indexes makes sense
- stbi__rewind(s);
- return 0;
- }
- tga_comp = stbi__tga_get_comp(tga_colormap_bpp, 0, NULL);
- } else {
- tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3) || (tga_image_type == 11), NULL);
- }
- if(!tga_comp) {
- stbi__rewind(s);
- return 0;
- }
- if (x) *x = tga_w;
- if (y) *y = tga_h;
- if (comp) *comp = tga_comp;
- return 1; // seems to have passed everything
-}
-
-static int stbi__tga_test(stbi__context *s)
-{
- int res = 0;
- int sz, tga_color_type;
- stbi__get8(s); // discard Offset
- tga_color_type = stbi__get8(s); // color type
- if ( tga_color_type > 1 ) goto errorEnd; // only RGB or indexed allowed
- sz = stbi__get8(s); // image type
- if ( tga_color_type == 1 ) { // colormapped (paletted) image
- if (sz != 1 && sz != 9) goto errorEnd; // colortype 1 demands image type 1 or 9
- stbi__skip(s,4); // skip index of first colormap entry and number of entries
- sz = stbi__get8(s); // check bits per palette color entry
- if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
- stbi__skip(s,4); // skip image x and y origin
- } else { // "normal" image w/o colormap
- if ( (sz != 2) && (sz != 3) && (sz != 10) && (sz != 11) ) goto errorEnd; // only RGB or grey allowed, +/- RLE
- stbi__skip(s,9); // skip colormap specification and image x/y origin
- }
- if ( stbi__get16le(s) < 1 ) goto errorEnd; // test width
- if ( stbi__get16le(s) < 1 ) goto errorEnd; // test height
- sz = stbi__get8(s); // bits per pixel
- if ( (tga_color_type == 1) && (sz != 8) && (sz != 16) ) goto errorEnd; // for colormapped images, bpp is size of an index
- if ( (sz != 8) && (sz != 15) && (sz != 16) && (sz != 24) && (sz != 32) ) goto errorEnd;
-
- res = 1; // if we got this far, everything's good and we can return 1 instead of 0
-
-errorEnd:
- stbi__rewind(s);
- return res;
-}
-
-// read 16bit value and convert to 24bit RGB
-static void stbi__tga_read_rgb16(stbi__context *s, stbi_uc* out)
-{
- stbi__uint16 px = (stbi__uint16)stbi__get16le(s);
- stbi__uint16 fiveBitMask = 31;
- // we have 3 channels with 5bits each
- int r = (px >> 10) & fiveBitMask;
- int g = (px >> 5) & fiveBitMask;
- int b = px & fiveBitMask;
- // Note that this saves the data in RGB(A) order, so it doesn't need to be swapped later
- out[0] = (stbi_uc)((r * 255)/31);
- out[1] = (stbi_uc)((g * 255)/31);
- out[2] = (stbi_uc)((b * 255)/31);
-
- // some people claim that the most significant bit might be used for alpha
- // (possibly if an alpha-bit is set in the "image descriptor byte")
- // but that only made 16bit test images completely translucent..
- // so let's treat all 15 and 16bit TGAs as RGB with no alpha.
-}
-
-static void *stbi__tga_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- // read in the TGA header stuff
- int tga_offset = stbi__get8(s);
- int tga_indexed = stbi__get8(s);
- int tga_image_type = stbi__get8(s);
- int tga_is_RLE = 0;
- int tga_palette_start = stbi__get16le(s);
- int tga_palette_len = stbi__get16le(s);
- int tga_palette_bits = stbi__get8(s);
- int tga_x_origin = stbi__get16le(s);
- int tga_y_origin = stbi__get16le(s);
- int tga_width = stbi__get16le(s);
- int tga_height = stbi__get16le(s);
- int tga_bits_per_pixel = stbi__get8(s);
- int tga_comp, tga_rgb16=0;
- int tga_inverted = stbi__get8(s);
- // int tga_alpha_bits = tga_inverted & 15; // the 4 lowest bits - unused (useless?)
- // image data
- unsigned char *tga_data;
- unsigned char *tga_palette = NULL;
- int i, j;
- unsigned char raw_data[4] = {0};
- int RLE_count = 0;
- int RLE_repeating = 0;
- int read_next_pixel = 1;
- STBI_NOTUSED(ri);
-
- // do a tiny bit of precessing
- if ( tga_image_type >= 8 )
- {
- tga_image_type -= 8;
- tga_is_RLE = 1;
- }
- tga_inverted = 1 - ((tga_inverted >> 5) & 1);
-
- // If I'm paletted, then I'll use the number of bits from the palette
- if ( tga_indexed ) tga_comp = stbi__tga_get_comp(tga_palette_bits, 0, &tga_rgb16);
- else tga_comp = stbi__tga_get_comp(tga_bits_per_pixel, (tga_image_type == 3), &tga_rgb16);
-
- if(!tga_comp) // shouldn't really happen, stbi__tga_test() should have ensured basic consistency
- return stbi__errpuc("bad format", "Can't find out TGA pixelformat");
-
- // tga info
- *x = tga_width;
- *y = tga_height;
- if (comp) *comp = tga_comp;
-
- if (!stbi__mad3sizes_valid(tga_width, tga_height, tga_comp, 0))
- return stbi__errpuc("too large", "Corrupt TGA");
-
- tga_data = (unsigned char*)stbi__malloc_mad3(tga_width, tga_height, tga_comp, 0);
- if (!tga_data) return stbi__errpuc("outofmem", "Out of memory");
-
- // skip to the data's starting position (offset usually = 0)
- stbi__skip(s, tga_offset );
-
- if ( !tga_indexed && !tga_is_RLE && !tga_rgb16 ) {
- for (i=0; i < tga_height; ++i) {
- int row = tga_inverted ? tga_height -i - 1 : i;
- stbi_uc *tga_row = tga_data + row*tga_width*tga_comp;
- stbi__getn(s, tga_row, tga_width * tga_comp);
- }
- } else {
- // do I need to load a palette?
- if ( tga_indexed)
- {
- // any data to skip? (offset usually = 0)
- stbi__skip(s, tga_palette_start );
- // load the palette
- tga_palette = (unsigned char*)stbi__malloc_mad2(tga_palette_len, tga_comp, 0);
- if (!tga_palette) {
- STBI_FREE(tga_data);
- return stbi__errpuc("outofmem", "Out of memory");
- }
- if (tga_rgb16) {
- stbi_uc *pal_entry = tga_palette;
- STBI_ASSERT(tga_comp == STBI_rgb);
- for (i=0; i < tga_palette_len; ++i) {
- stbi__tga_read_rgb16(s, pal_entry);
- pal_entry += tga_comp;
- }
- } else if (!stbi__getn(s, tga_palette, tga_palette_len * tga_comp)) {
- STBI_FREE(tga_data);
- STBI_FREE(tga_palette);
- return stbi__errpuc("bad palette", "Corrupt TGA");
- }
- }
- // load the data
- for (i=0; i < tga_width * tga_height; ++i)
- {
- // if I'm in RLE mode, do I need to get a RLE stbi__pngchunk?
- if ( tga_is_RLE )
- {
- if ( RLE_count == 0 )
- {
- // yep, get the next byte as a RLE command
- int RLE_cmd = stbi__get8(s);
- RLE_count = 1 + (RLE_cmd & 127);
- RLE_repeating = RLE_cmd >> 7;
- read_next_pixel = 1;
- } else if ( !RLE_repeating )
- {
- read_next_pixel = 1;
- }
- } else
- {
- read_next_pixel = 1;
- }
- // OK, if I need to read a pixel, do it now
- if ( read_next_pixel )
- {
- // load however much data we did have
- if ( tga_indexed )
- {
- // read in index, then perform the lookup
- int pal_idx = (tga_bits_per_pixel == 8) ? stbi__get8(s) : stbi__get16le(s);
- if ( pal_idx >= tga_palette_len ) {
- // invalid index
- pal_idx = 0;
- }
- pal_idx *= tga_comp;
- for (j = 0; j < tga_comp; ++j) {
- raw_data[j] = tga_palette[pal_idx+j];
- }
- } else if(tga_rgb16) {
- STBI_ASSERT(tga_comp == STBI_rgb);
- stbi__tga_read_rgb16(s, raw_data);
- } else {
- // read in the data raw
- for (j = 0; j < tga_comp; ++j) {
- raw_data[j] = stbi__get8(s);
- }
- }
- // clear the reading flag for the next pixel
- read_next_pixel = 0;
- } // end of reading a pixel
-
- // copy data
- for (j = 0; j < tga_comp; ++j)
- tga_data[i*tga_comp+j] = raw_data[j];
-
- // in case we're in RLE mode, keep counting down
- --RLE_count;
- }
- // do I need to invert the image?
- if ( tga_inverted )
- {
- for (j = 0; j*2 < tga_height; ++j)
- {
- int index1 = j * tga_width * tga_comp;
- int index2 = (tga_height - 1 - j) * tga_width * tga_comp;
- for (i = tga_width * tga_comp; i > 0; --i)
- {
- unsigned char temp = tga_data[index1];
- tga_data[index1] = tga_data[index2];
- tga_data[index2] = temp;
- ++index1;
- ++index2;
- }
- }
- }
- // clear my palette, if I had one
- if ( tga_palette != NULL )
- {
- STBI_FREE( tga_palette );
- }
- }
-
- // swap RGB - if the source data was RGB16, it already is in the right order
- if (tga_comp >= 3 && !tga_rgb16)
- {
- unsigned char* tga_pixel = tga_data;
- for (i=0; i < tga_width * tga_height; ++i)
- {
- unsigned char temp = tga_pixel[0];
- tga_pixel[0] = tga_pixel[2];
- tga_pixel[2] = temp;
- tga_pixel += tga_comp;
- }
- }
-
- // convert to target component count
- if (req_comp && req_comp != tga_comp)
- tga_data = stbi__convert_format(tga_data, tga_comp, req_comp, tga_width, tga_height);
-
- // the things I do to get rid of an error message, and yet keep
- // Microsoft's C compilers happy... [8^(
- tga_palette_start = tga_palette_len = tga_palette_bits =
- tga_x_origin = tga_y_origin = 0;
- // OK, done
- return tga_data;
-}
-#endif
-
-// *************************************************************************************************
-// Photoshop PSD loader -- PD by Thatcher Ulrich, integration by Nicolas Schulz, tweaked by STB
-
-#ifndef STBI_NO_PSD
-static int stbi__psd_test(stbi__context *s)
-{
- int r = (stbi__get32be(s) == 0x38425053);
- stbi__rewind(s);
- return r;
-}
-
-static int stbi__psd_decode_rle(stbi__context *s, stbi_uc *p, int pixelCount)
-{
- int count, nleft, len;
-
- count = 0;
- while ((nleft = pixelCount - count) > 0) {
- len = stbi__get8(s);
- if (len == 128) {
- // No-op.
- } else if (len < 128) {
- // Copy next len+1 bytes literally.
- len++;
- if (len > nleft) return 0; // corrupt data
- count += len;
- while (len) {
- *p = stbi__get8(s);
- p += 4;
- len--;
- }
- } else if (len > 128) {
- stbi_uc val;
- // Next -len+1 bytes in the dest are replicated from next source byte.
- // (Interpret len as a negative 8-bit int.)
- len = 257 - len;
- if (len > nleft) return 0; // corrupt data
- val = stbi__get8(s);
- count += len;
- while (len) {
- *p = val;
- p += 4;
- len--;
- }
- }
- }
-
- return 1;
-}
-
-static void *stbi__psd_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri, int bpc)
-{
- int pixelCount;
- int channelCount, compression;
- int channel, i;
- int bitdepth;
- int w,h;
- stbi_uc *out;
- STBI_NOTUSED(ri);
-
- // Check identifier
- if (stbi__get32be(s) != 0x38425053) // "8BPS"
- return stbi__errpuc("not PSD", "Corrupt PSD image");
-
- // Check file type version.
- if (stbi__get16be(s) != 1)
- return stbi__errpuc("wrong version", "Unsupported version of PSD image");
-
- // Skip 6 reserved bytes.
- stbi__skip(s, 6 );
-
- // Read the number of channels (R, G, B, A, etc).
- channelCount = stbi__get16be(s);
- if (channelCount < 0 || channelCount > 16)
- return stbi__errpuc("wrong channel count", "Unsupported number of channels in PSD image");
-
- // Read the rows and columns of the image.
- h = stbi__get32be(s);
- w = stbi__get32be(s);
-
- // Make sure the depth is 8 bits.
- bitdepth = stbi__get16be(s);
- if (bitdepth != 8 && bitdepth != 16)
- return stbi__errpuc("unsupported bit depth", "PSD bit depth is not 8 or 16 bit");
-
- // Make sure the color mode is RGB.
- // Valid options are:
- // 0: Bitmap
- // 1: Grayscale
- // 2: Indexed color
- // 3: RGB color
- // 4: CMYK color
- // 7: Multichannel
- // 8: Duotone
- // 9: Lab color
- if (stbi__get16be(s) != 3)
- return stbi__errpuc("wrong color format", "PSD is not in RGB color format");
-
- // Skip the Mode Data. (It's the palette for indexed color; other info for other modes.)
- stbi__skip(s,stbi__get32be(s) );
-
- // Skip the image resources. (resolution, pen tool paths, etc)
- stbi__skip(s, stbi__get32be(s) );
-
- // Skip the reserved data.
- stbi__skip(s, stbi__get32be(s) );
-
- // Find out if the data is compressed.
- // Known values:
- // 0: no compression
- // 1: RLE compressed
- compression = stbi__get16be(s);
- if (compression > 1)
- return stbi__errpuc("bad compression", "PSD has an unknown compression format");
-
- // Check size
- if (!stbi__mad3sizes_valid(4, w, h, 0))
- return stbi__errpuc("too large", "Corrupt PSD");
-
- // Create the destination image.
-
- if (!compression && bitdepth == 16 && bpc == 16) {
- out = (stbi_uc *) stbi__malloc_mad3(8, w, h, 0);
- ri->bits_per_channel = 16;
- } else
- out = (stbi_uc *) stbi__malloc(4 * w*h);
-
- if (!out) return stbi__errpuc("outofmem", "Out of memory");
- pixelCount = w*h;
-
- // Initialize the data to zero.
- //memset( out, 0, pixelCount * 4 );
-
- // Finally, the image data.
- if (compression) {
- // RLE as used by .PSD and .TIFF
- // Loop until you get the number of unpacked bytes you are expecting:
- // Read the next source byte into n.
- // If n is between 0 and 127 inclusive, copy the next n+1 bytes literally.
- // Else if n is between -127 and -1 inclusive, copy the next byte -n+1 times.
- // Else if n is 128, noop.
- // Endloop
-
- // The RLE-compressed data is preceeded by a 2-byte data count for each row in the data,
- // which we're going to just skip.
- stbi__skip(s, h * channelCount * 2 );
-
- // Read the RLE data by channel.
- for (channel = 0; channel < 4; channel++) {
- stbi_uc *p;
-
- p = out+channel;
- if (channel >= channelCount) {
- // Fill this channel with default data.
- for (i = 0; i < pixelCount; i++, p += 4)
- *p = (channel == 3 ? 255 : 0);
- } else {
- // Read the RLE data.
- if (!stbi__psd_decode_rle(s, p, pixelCount)) {
- STBI_FREE(out);
- return stbi__errpuc("corrupt", "bad RLE data");
- }
- }
- }
-
- } else {
- // We're at the raw image data. It's each channel in order (Red, Green, Blue, Alpha, ...)
- // where each channel consists of an 8-bit (or 16-bit) value for each pixel in the image.
-
- // Read the data by channel.
- for (channel = 0; channel < 4; channel++) {
- if (channel >= channelCount) {
- // Fill this channel with default data.
- if (bitdepth == 16 && bpc == 16) {
- stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
- stbi__uint16 val = channel == 3 ? 65535 : 0;
- for (i = 0; i < pixelCount; i++, q += 4)
- *q = val;
- } else {
- stbi_uc *p = out+channel;
- stbi_uc val = channel == 3 ? 255 : 0;
- for (i = 0; i < pixelCount; i++, p += 4)
- *p = val;
- }
- } else {
- if (ri->bits_per_channel == 16) { // output bpc
- stbi__uint16 *q = ((stbi__uint16 *) out) + channel;
- for (i = 0; i < pixelCount; i++, q += 4)
- *q = (stbi__uint16) stbi__get16be(s);
- } else {
- stbi_uc *p = out+channel;
- if (bitdepth == 16) { // input bpc
- for (i = 0; i < pixelCount; i++, p += 4)
- *p = (stbi_uc) (stbi__get16be(s) >> 8);
- } else {
- for (i = 0; i < pixelCount; i++, p += 4)
- *p = stbi__get8(s);
- }
- }
- }
- }
- }
-
- // remove weird white matte from PSD
- if (channelCount >= 4) {
- if (ri->bits_per_channel == 16) {
- for (i=0; i < w*h; ++i) {
- stbi__uint16 *pixel = (stbi__uint16 *) out + 4*i;
- if (pixel[3] != 0 && pixel[3] != 65535) {
- float a = pixel[3] / 65535.0f;
- float ra = 1.0f / a;
- float inv_a = 65535.0f * (1 - ra);
- pixel[0] = (stbi__uint16) (pixel[0]*ra + inv_a);
- pixel[1] = (stbi__uint16) (pixel[1]*ra + inv_a);
- pixel[2] = (stbi__uint16) (pixel[2]*ra + inv_a);
- }
- }
- } else {
- for (i=0; i < w*h; ++i) {
- unsigned char *pixel = out + 4*i;
- if (pixel[3] != 0 && pixel[3] != 255) {
- float a = pixel[3] / 255.0f;
- float ra = 1.0f / a;
- float inv_a = 255.0f * (1 - ra);
- pixel[0] = (unsigned char) (pixel[0]*ra + inv_a);
- pixel[1] = (unsigned char) (pixel[1]*ra + inv_a);
- pixel[2] = (unsigned char) (pixel[2]*ra + inv_a);
- }
- }
- }
- }
-
- // convert to desired output format
- if (req_comp && req_comp != 4) {
- if (ri->bits_per_channel == 16)
- out = (stbi_uc *) stbi__convert_format16((stbi__uint16 *) out, 4, req_comp, w, h);
- else
- out = stbi__convert_format(out, 4, req_comp, w, h);
- if (out == NULL) return out; // stbi__convert_format frees input on failure
- }
-
- if (comp) *comp = 4;
- *y = h;
- *x = w;
-
- return out;
-}
-#endif
-
-// *************************************************************************************************
-// Softimage PIC loader
-// by Tom Seddon
-//
-// See http://softimage.wiki.softimage.com/index.php/INFO:_PIC_file_format
-// See http://ozviz.wasp.uwa.edu.au/~pbourke/dataformats/softimagepic/
-
-#ifndef STBI_NO_PIC
-static int stbi__pic_is4(stbi__context *s,const char *str)
-{
- int i;
- for (i=0; i<4; ++i)
- if (stbi__get8(s) != (stbi_uc)str[i])
- return 0;
-
- return 1;
-}
-
-static int stbi__pic_test_core(stbi__context *s)
-{
- int i;
-
- if (!stbi__pic_is4(s,"\x53\x80\xF6\x34"))
- return 0;
-
- for(i=0;i<84;++i)
- stbi__get8(s);
-
- if (!stbi__pic_is4(s,"PICT"))
- return 0;
-
- return 1;
-}
-
-typedef struct
-{
- stbi_uc size,type,channel;
-} stbi__pic_packet;
-
-static stbi_uc *stbi__readval(stbi__context *s, int channel, stbi_uc *dest)
-{
- int mask=0x80, i;
-
- for (i=0; i<4; ++i, mask>>=1) {
- if (channel & mask) {
- if (stbi__at_eof(s)) return stbi__errpuc("bad file","PIC file too short");
- dest[i]=stbi__get8(s);
- }
- }
-
- return dest;
-}
-
-static void stbi__copyval(int channel,stbi_uc *dest,const stbi_uc *src)
-{
- int mask=0x80,i;
-
- for (i=0;i<4; ++i, mask>>=1)
- if (channel&mask)
- dest[i]=src[i];
-}
-
-static stbi_uc *stbi__pic_load_core(stbi__context *s,int width,int height,int *comp, stbi_uc *result)
-{
- int act_comp=0,num_packets=0,y,chained;
- stbi__pic_packet packets[10];
-
- // this will (should...) cater for even some bizarre stuff like having data
- // for the same channel in multiple packets.
- do {
- stbi__pic_packet *packet;
-
- if (num_packets==sizeof(packets)/sizeof(packets[0]))
- return stbi__errpuc("bad format","too many packets");
-
- packet = &packets[num_packets++];
-
- chained = stbi__get8(s);
- packet->size = stbi__get8(s);
- packet->type = stbi__get8(s);
- packet->channel = stbi__get8(s);
-
- act_comp |= packet->channel;
-
- if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (reading packets)");
- if (packet->size != 8) return stbi__errpuc("bad format","packet isn't 8bpp");
- } while (chained);
-
- *comp = (act_comp & 0x10 ? 4 : 3); // has alpha channel?
-
- for(y=0; y<height; ++y) {
- int packet_idx;
-
- for(packet_idx=0; packet_idx < num_packets; ++packet_idx) {
- stbi__pic_packet *packet = &packets[packet_idx];
- stbi_uc *dest = result+y*width*4;
-
- switch (packet->type) {
- default:
- return stbi__errpuc("bad format","packet has bad compression type");
-
- case 0: {//uncompressed
- int x;
-
- for(x=0;x<width;++x, dest+=4)
- if (!stbi__readval(s,packet->channel,dest))
- return 0;
- break;
- }
-
- case 1://Pure RLE
- {
- int left=width, i;
-
- while (left>0) {
- stbi_uc count,value[4];
-
- count=stbi__get8(s);
- if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pure read count)");
-
- if (count > left)
- count = (stbi_uc) left;
-
- if (!stbi__readval(s,packet->channel,value)) return 0;
-
- for(i=0; i<count; ++i,dest+=4)
- stbi__copyval(packet->channel,dest,value);
- left -= count;
- }
- }
- break;
-
- case 2: {//Mixed RLE
- int left=width;
- while (left>0) {
- int count = stbi__get8(s), i;
- if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (mixed read count)");
-
- if (count >= 128) { // Repeated
- stbi_uc value[4];
-
- if (count==128)
- count = stbi__get16be(s);
- else
- count -= 127;
- if (count > left)
- return stbi__errpuc("bad file","scanline overrun");
-
- if (!stbi__readval(s,packet->channel,value))
- return 0;
-
- for(i=0;i<count;++i, dest += 4)
- stbi__copyval(packet->channel,dest,value);
- } else { // Raw
- ++count;
- if (count>left) return stbi__errpuc("bad file","scanline overrun");
-
- for(i=0;i<count;++i, dest+=4)
- if (!stbi__readval(s,packet->channel,dest))
- return 0;
- }
- left-=count;
- }
- break;
- }
- }
- }
- }
-
- return result;
-}
-
-static void *stbi__pic_load(stbi__context *s,int *px,int *py,int *comp,int req_comp, stbi__result_info *ri)
-{
- stbi_uc *result;
- int i, x,y, internal_comp;
- STBI_NOTUSED(ri);
-
- if (!comp) comp = &internal_comp;
-
- for (i=0; i<92; ++i)
- stbi__get8(s);
-
- x = stbi__get16be(s);
- y = stbi__get16be(s);
- if (stbi__at_eof(s)) return stbi__errpuc("bad file","file too short (pic header)");
- if (!stbi__mad3sizes_valid(x, y, 4, 0)) return stbi__errpuc("too large", "PIC image too large to decode");
-
- stbi__get32be(s); //skip `ratio'
- stbi__get16be(s); //skip `fields'
- stbi__get16be(s); //skip `pad'
-
- // intermediate buffer is RGBA
- result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);
- memset(result, 0xff, x*y*4);
-
- if (!stbi__pic_load_core(s,x,y,comp, result)) {
- STBI_FREE(result);
- result=0;
- }
- *px = x;
- *py = y;
- if (req_comp == 0) req_comp = *comp;
- result=stbi__convert_format(result,4,req_comp,x,y);
-
- return result;
-}
-
-static int stbi__pic_test(stbi__context *s)
-{
- int r = stbi__pic_test_core(s);
- stbi__rewind(s);
- return r;
-}
-#endif
-
-// *************************************************************************************************
-// GIF loader -- public domain by Jean-Marc Lienher -- simplified/shrunk by stb
-
-#ifndef STBI_NO_GIF
-typedef struct
-{
- stbi__int16 prefix;
- stbi_uc first;
- stbi_uc suffix;
-} stbi__gif_lzw;
-
-typedef struct
-{
- int w,h;
- stbi_uc *out; // output buffer (always 4 components)
- stbi_uc *background; // The current "background" as far as a gif is concerned
- stbi_uc *history;
- int flags, bgindex, ratio, transparent, eflags;
- stbi_uc pal[256][4];
- stbi_uc lpal[256][4];
- stbi__gif_lzw codes[8192];
- stbi_uc *color_table;
- int parse, step;
- int lflags;
- int start_x, start_y;
- int max_x, max_y;
- int cur_x, cur_y;
- int line_size;
- int delay;
-} stbi__gif;
-
-static int stbi__gif_test_raw(stbi__context *s)
-{
- int sz;
- if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8') return 0;
- sz = stbi__get8(s);
- if (sz != '9' && sz != '7') return 0;
- if (stbi__get8(s) != 'a') return 0;
- return 1;
-}
-
-static int stbi__gif_test(stbi__context *s)
-{
- int r = stbi__gif_test_raw(s);
- stbi__rewind(s);
- return r;
-}
-
-static void stbi__gif_parse_colortable(stbi__context *s, stbi_uc pal[256][4], int num_entries, int transp)
-{
- int i;
- for (i=0; i < num_entries; ++i) {
- pal[i][2] = stbi__get8(s);
- pal[i][1] = stbi__get8(s);
- pal[i][0] = stbi__get8(s);
- pal[i][3] = transp == i ? 0 : 255;
- }
-}
-
-static int stbi__gif_header(stbi__context *s, stbi__gif *g, int *comp, int is_info)
-{
- stbi_uc version;
- if (stbi__get8(s) != 'G' || stbi__get8(s) != 'I' || stbi__get8(s) != 'F' || stbi__get8(s) != '8')
- return stbi__err("not GIF", "Corrupt GIF");
-
- version = stbi__get8(s);
- if (version != '7' && version != '9') return stbi__err("not GIF", "Corrupt GIF");
- if (stbi__get8(s) != 'a') return stbi__err("not GIF", "Corrupt GIF");
-
- stbi__g_failure_reason = "";
- g->w = stbi__get16le(s);
- g->h = stbi__get16le(s);
- g->flags = stbi__get8(s);
- g->bgindex = stbi__get8(s);
- g->ratio = stbi__get8(s);
- g->transparent = -1;
-
- if (comp != 0) *comp = 4; // can't actually tell whether it's 3 or 4 until we parse the comments
-
- if (is_info) return 1;
-
- if (g->flags & 0x80)
- stbi__gif_parse_colortable(s,g->pal, 2 << (g->flags & 7), -1);
-
- return 1;
-}
-
-static int stbi__gif_info_raw(stbi__context *s, int *x, int *y, int *comp)
-{
- stbi__gif* g = (stbi__gif*) stbi__malloc(sizeof(stbi__gif));
- if (!stbi__gif_header(s, g, comp, 1)) {
- STBI_FREE(g);
- stbi__rewind( s );
- return 0;
- }
- if (x) *x = g->w;
- if (y) *y = g->h;
- STBI_FREE(g);
- return 1;
-}
-
-static void stbi__out_gif_code(stbi__gif *g, stbi__uint16 code)
-{
- stbi_uc *p, *c;
- int idx;
-
- // recurse to decode the prefixes, since the linked-list is backwards,
- // and working backwards through an interleaved image would be nasty
- if (g->codes[code].prefix >= 0)
- stbi__out_gif_code(g, g->codes[code].prefix);
-
- if (g->cur_y >= g->max_y) return;
-
- idx = g->cur_x + g->cur_y;
- p = &g->out[idx];
- g->history[idx / 4] = 1;
-
- c = &g->color_table[g->codes[code].suffix * 4];
- if (c[3] > 128) { // don't render transparent pixels;
- p[0] = c[2];
- p[1] = c[1];
- p[2] = c[0];
- p[3] = c[3];
- }
- g->cur_x += 4;
-
- if (g->cur_x >= g->max_x) {
- g->cur_x = g->start_x;
- g->cur_y += g->step;
-
- while (g->cur_y >= g->max_y && g->parse > 0) {
- g->step = (1 << g->parse) * g->line_size;
- g->cur_y = g->start_y + (g->step >> 1);
- --g->parse;
- }
- }
-}
-
-static stbi_uc *stbi__process_gif_raster(stbi__context *s, stbi__gif *g)
-{
- stbi_uc lzw_cs;
- stbi__int32 len, init_code;
- stbi__uint32 first;
- stbi__int32 codesize, codemask, avail, oldcode, bits, valid_bits, clear;
- stbi__gif_lzw *p;
-
- lzw_cs = stbi__get8(s);
- if (lzw_cs > 12) return NULL;
- clear = 1 << lzw_cs;
- first = 1;
- codesize = lzw_cs + 1;
- codemask = (1 << codesize) - 1;
- bits = 0;
- valid_bits = 0;
- for (init_code = 0; init_code < clear; init_code++) {
- g->codes[init_code].prefix = -1;
- g->codes[init_code].first = (stbi_uc) init_code;
- g->codes[init_code].suffix = (stbi_uc) init_code;
- }
-
- // support no starting clear code
- avail = clear+2;
- oldcode = -1;
-
- len = 0;
- for(;;) {
- if (valid_bits < codesize) {
- if (len == 0) {
- len = stbi__get8(s); // start new block
- if (len == 0)
- return g->out;
- }
- --len;
- bits |= (stbi__int32) stbi__get8(s) << valid_bits;
- valid_bits += 8;
- } else {
- stbi__int32 code = bits & codemask;
- bits >>= codesize;
- valid_bits -= codesize;
- // @OPTIMIZE: is there some way we can accelerate the non-clear path?
- if (code == clear) { // clear code
- codesize = lzw_cs + 1;
- codemask = (1 << codesize) - 1;
- avail = clear + 2;
- oldcode = -1;
- first = 0;
- } else if (code == clear + 1) { // end of stream code
- stbi__skip(s, len);
- while ((len = stbi__get8(s)) > 0)
- stbi__skip(s,len);
- return g->out;
- } else if (code <= avail) {
- if (first) {
- return stbi__errpuc("no clear code", "Corrupt GIF");
- }
-
- if (oldcode >= 0) {
- p = &g->codes[avail++];
- if (avail > 8192) {
- return stbi__errpuc("too many codes", "Corrupt GIF");
- }
-
- p->prefix = (stbi__int16) oldcode;
- p->first = g->codes[oldcode].first;
- p->suffix = (code == avail) ? p->first : g->codes[code].first;
- } else if (code == avail)
- return stbi__errpuc("illegal code in raster", "Corrupt GIF");
-
- stbi__out_gif_code(g, (stbi__uint16) code);
-
- if ((avail & codemask) == 0 && avail <= 0x0FFF) {
- codesize++;
- codemask = (1 << codesize) - 1;
- }
-
- oldcode = code;
- } else {
- return stbi__errpuc("illegal code in raster", "Corrupt GIF");
- }
- }
- }
-}
-
-// this function is designed to support animated gifs, although stb_image doesn't support it
-// two back is the image from two frames ago, used for a very specific disposal format
-static stbi_uc *stbi__gif_load_next(stbi__context *s, stbi__gif *g, int *comp, int req_comp, stbi_uc *two_back)
-{
- int dispose;
- int first_frame;
- int pi;
- int pcount;
-
- // on first frame, any non-written pixels get the background colour (non-transparent)
- first_frame = 0;
- if (g->out == 0) {
- if (!stbi__gif_header(s, g, comp,0)) return 0; // stbi__g_failure_reason set by stbi__gif_header
- g->out = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
- g->background = (stbi_uc *) stbi__malloc(4 * g->w * g->h);
- g->history = (stbi_uc *) stbi__malloc(g->w * g->h);
- if (g->out == 0) return stbi__errpuc("outofmem", "Out of memory");
-
- // image is treated as "tranparent" at the start - ie, nothing overwrites the current background;
- // background colour is only used for pixels that are not rendered first frame, after that "background"
- // color refers to teh color that was there the previous frame.
- memset( g->out, 0x00, 4 * g->w * g->h );
- memset( g->background, 0x00, 4 * g->w * g->h ); // state of the background (starts transparent)
- memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame
- first_frame = 1;
- } else {
- // second frame - how do we dispoase of the previous one?
- dispose = (g->eflags & 0x1C) >> 2;
- pcount = g->w * g->h;
-
- if ((dispose == 3) && (two_back == 0)) {
- dispose = 2; // if I don't have an image to revert back to, default to the old background
- }
-
- if (dispose == 3) { // use previous graphic
- for (pi = 0; pi < pcount; ++pi) {
- if (g->history[pi]) {
- memcpy( &g->out[pi * 4], &two_back[pi * 4], 4 );
- }
- }
- } else if (dispose == 2) {
- // restore what was changed last frame to background before that frame;
- for (pi = 0; pi < pcount; ++pi) {
- if (g->history[pi]) {
- memcpy( &g->out[pi * 4], &g->background[pi * 4], 4 );
- }
- }
- } else {
- // This is a non-disposal case eithe way, so just
- // leave the pixels as is, and they will become the new background
- // 1: do not dispose
- // 0: not specified.
- }
-
- // background is what out is after the undoing of the previou frame;
- memcpy( g->background, g->out, 4 * g->w * g->h );
- }
-
- // clear my history;
- memset( g->history, 0x00, g->w * g->h ); // pixels that were affected previous frame
-
- for (;;) {
- int tag = stbi__get8(s);
- switch (tag) {
- case 0x2C: /* Image Descriptor */
- {
- stbi__int32 x, y, w, h;
- stbi_uc *o;
-
- x = stbi__get16le(s);
- y = stbi__get16le(s);
- w = stbi__get16le(s);
- h = stbi__get16le(s);
- if (((x + w) > (g->w)) || ((y + h) > (g->h)))
- return stbi__errpuc("bad Image Descriptor", "Corrupt GIF");
-
- g->line_size = g->w * 4;
- g->start_x = x * 4;
- g->start_y = y * g->line_size;
- g->max_x = g->start_x + w * 4;
- g->max_y = g->start_y + h * g->line_size;
- g->cur_x = g->start_x;
- g->cur_y = g->start_y;
-
- g->lflags = stbi__get8(s);
-
- if (g->lflags & 0x40) {
- g->step = 8 * g->line_size; // first interlaced spacing
- g->parse = 3;
- } else {
- g->step = g->line_size;
- g->parse = 0;
- }
-
- if (g->lflags & 0x80) {
- stbi__gif_parse_colortable(s,g->lpal, 2 << (g->lflags & 7), g->eflags & 0x01 ? g->transparent : -1);
- g->color_table = (stbi_uc *) g->lpal;
- } else if (g->flags & 0x80) {
- g->color_table = (stbi_uc *) g->pal;
- } else
- return stbi__errpuc("missing color table", "Corrupt GIF");
-
- o = stbi__process_gif_raster(s, g);
- if (o == NULL) return NULL;
-
- // if this was the first frame,
- pcount = g->w * g->h;
- if (first_frame && (g->bgindex > 0)) {
- // if first frame, any pixel not drawn to gets the background color
- for (pi = 0; pi < pcount; ++pi) {
- if (g->history[pi] == 0) {
- g->pal[g->bgindex][3] = 255; // just in case it was made transparent, undo that; It will be reset next frame if need be;
- memcpy( &g->out[pi * 4], &g->pal[g->bgindex], 4 );
- }
- }
- }
-
- return o;
- }
-
- case 0x21: // Comment Extension.
- {
- int len;
- int ext = stbi__get8(s);
- if (ext == 0xF9) { // Graphic Control Extension.
- len = stbi__get8(s);
- if (len == 4) {
- g->eflags = stbi__get8(s);
- g->delay = 10 * stbi__get16le(s); // delay - 1/100th of a second, saving as 1/1000ths.
-
- // unset old transparent
- if (g->transparent >= 0) {
- g->pal[g->transparent][3] = 255;
- }
- if (g->eflags & 0x01) {
- g->transparent = stbi__get8(s);
- if (g->transparent >= 0) {
- g->pal[g->transparent][3] = 0;
- }
- } else {
- // don't need transparent
- stbi__skip(s, 1);
- g->transparent = -1;
- }
- } else {
- stbi__skip(s, len);
- break;
- }
- }
- while ((len = stbi__get8(s)) != 0) {
- stbi__skip(s, len);
- }
- break;
- }
-
- case 0x3B: // gif stream termination code
- return (stbi_uc *) s; // using '1' causes warning on some compilers
-
- default:
- return stbi__errpuc("unknown code", "Corrupt GIF");
- }
- }
-}
-
-static void *stbi__load_gif_main(stbi__context *s, int **delays, int *x, int *y, int *z, int *comp, int req_comp)
-{
- if (stbi__gif_test(s)) {
- int layers = 0;
- stbi_uc *u = 0;
- stbi_uc *out = 0;
- stbi_uc *two_back = 0;
- stbi__gif g;
- int stride;
- memset(&g, 0, sizeof(g));
- if (delays) {
- *delays = 0;
- }
-
- do {
- u = stbi__gif_load_next(s, &g, comp, req_comp, two_back);
- if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
-
- if (u) {
- *x = g.w;
- *y = g.h;
- ++layers;
- stride = g.w * g.h * 4;
-
- if (out) {
- out = (stbi_uc*) STBI_REALLOC( out, layers * stride );
- if (delays) {
- *delays = (int*) STBI_REALLOC( *delays, sizeof(int) * layers );
- }
- } else {
- out = (stbi_uc*)stbi__malloc( layers * stride );
- if (delays) {
- *delays = (int*) stbi__malloc( layers * sizeof(int) );
- }
- }
- memcpy( out + ((layers - 1) * stride), u, stride );
- if (layers >= 2) {
- two_back = out - 2 * stride;
- }
-
- if (delays) {
- (*delays)[layers - 1U] = g.delay;
- }
- }
- } while (u != 0);
-
- // free temp buffer;
- STBI_FREE(g.out);
- STBI_FREE(g.history);
- STBI_FREE(g.background);
-
- // do the final conversion after loading everything;
- if (req_comp && req_comp != 4)
- out = stbi__convert_format(out, 4, req_comp, layers * g.w, g.h);
-
- *z = layers;
- return out;
- } else {
- return stbi__errpuc("not GIF", "Image was not as a gif type.");
- }
-}
-
-static void *stbi__gif_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- stbi_uc *u = 0;
- stbi__gif g;
- memset(&g, 0, sizeof(g));
-
- u = stbi__gif_load_next(s, &g, comp, req_comp, 0);
- if (u == (stbi_uc *) s) u = 0; // end of animated gif marker
- if (u) {
- *x = g.w;
- *y = g.h;
-
- // moved conversion to after successful load so that the same
- // can be done for multiple frames.
- if (req_comp && req_comp != 4)
- u = stbi__convert_format(u, 4, req_comp, g.w, g.h);
- }
-
- // free buffers needed for multiple frame loading;
- STBI_FREE(g.history);
- STBI_FREE(g.background);
-
- return u;
-}
-
-static int stbi__gif_info(stbi__context *s, int *x, int *y, int *comp)
-{
- return stbi__gif_info_raw(s,x,y,comp);
-}
-#endif
-
-// *************************************************************************************************
-// Radiance RGBE HDR loader
-// originally by Nicolas Schulz
-#ifndef STBI_NO_HDR
-static int stbi__hdr_test_core(stbi__context *s, const char *signature)
-{
- int i;
- for (i=0; signature[i]; ++i)
- if (stbi__get8(s) != signature[i])
- return 0;
- stbi__rewind(s);
- return 1;
-}
-
-static int stbi__hdr_test(stbi__context* s)
-{
- int r = stbi__hdr_test_core(s, "#?RADIANCE\n");
- stbi__rewind(s);
- if(!r) {
- r = stbi__hdr_test_core(s, "#?RGBE\n");
- stbi__rewind(s);
- }
- return r;
-}
-
-#define STBI__HDR_BUFLEN 1024
-static char *stbi__hdr_gettoken(stbi__context *z, char *buffer)
-{
- int len=0;
- char c = '\0';
-
- c = (char) stbi__get8(z);
-
- while (!stbi__at_eof(z) && c != '\n') {
- buffer[len++] = c;
- if (len == STBI__HDR_BUFLEN-1) {
- // flush to end of line
- while (!stbi__at_eof(z) && stbi__get8(z) != '\n')
- ;
- break;
- }
- c = (char) stbi__get8(z);
- }
-
- buffer[len] = 0;
- return buffer;
-}
-
-static void stbi__hdr_convert(float *output, stbi_uc *input, int req_comp)
-{
- if ( input[3] != 0 ) {
- float f1;
- // Exponent
- f1 = (float) ldexp(1.0f, input[3] - (int)(128 + 8));
- if (req_comp <= 2)
- output[0] = (input[0] + input[1] + input[2]) * f1 / 3;
- else {
- output[0] = input[0] * f1;
- output[1] = input[1] * f1;
- output[2] = input[2] * f1;
- }
- if (req_comp == 2) output[1] = 1;
- if (req_comp == 4) output[3] = 1;
- } else {
- switch (req_comp) {
- case 4: output[3] = 1; /* fallthrough */
- case 3: output[0] = output[1] = output[2] = 0;
- break;
- case 2: output[1] = 1; /* fallthrough */
- case 1: output[0] = 0;
- break;
- }
- }
-}
-
-static float *stbi__hdr_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- char buffer[STBI__HDR_BUFLEN];
- char *token;
- int valid = 0;
- int width, height;
- stbi_uc *scanline;
- float *hdr_data;
- int len;
- unsigned char count, value;
- int i, j, k, c1,c2, z;
- const char *headerToken;
- STBI_NOTUSED(ri);
-
- // Check identifier
- headerToken = stbi__hdr_gettoken(s,buffer);
- if (strcmp(headerToken, "#?RADIANCE") != 0 && strcmp(headerToken, "#?RGBE") != 0)
- return stbi__errpf("not HDR", "Corrupt HDR image");
-
- // Parse header
- for(;;) {
- token = stbi__hdr_gettoken(s,buffer);
- if (token[0] == 0) break;
- if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
- }
-
- if (!valid) return stbi__errpf("unsupported format", "Unsupported HDR format");
-
- // Parse width and height
- // can't use sscanf() if we're not using stdio!
- token = stbi__hdr_gettoken(s,buffer);
- if (strncmp(token, "-Y ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
- token += 3;
- height = (int) strtol(token, &token, 10);
- while (*token == ' ') ++token;
- if (strncmp(token, "+X ", 3)) return stbi__errpf("unsupported data layout", "Unsupported HDR format");
- token += 3;
- width = (int) strtol(token, NULL, 10);
-
- *x = width;
- *y = height;
-
- if (comp) *comp = 3;
- if (req_comp == 0) req_comp = 3;
-
- if (!stbi__mad4sizes_valid(width, height, req_comp, sizeof(float), 0))
- return stbi__errpf("too large", "HDR image is too large");
-
- // Read data
- hdr_data = (float *) stbi__malloc_mad4(width, height, req_comp, sizeof(float), 0);
- if (!hdr_data)
- return stbi__errpf("outofmem", "Out of memory");
-
- // Load image data
- // image data is stored as some number of sca
- if ( width < 8 || width >= 32768) {
- // Read flat data
- for (j=0; j < height; ++j) {
- for (i=0; i < width; ++i) {
- stbi_uc rgbe[4];
- main_decode_loop:
- stbi__getn(s, rgbe, 4);
- stbi__hdr_convert(hdr_data + j * width * req_comp + i * req_comp, rgbe, req_comp);
- }
- }
- } else {
- // Read RLE-encoded data
- scanline = NULL;
-
- for (j = 0; j < height; ++j) {
- c1 = stbi__get8(s);
- c2 = stbi__get8(s);
- len = stbi__get8(s);
- if (c1 != 2 || c2 != 2 || (len & 0x80)) {
- // not run-length encoded, so we have to actually use THIS data as a decoded
- // pixel (note this can't be a valid pixel--one of RGB must be >= 128)
- stbi_uc rgbe[4];
- rgbe[0] = (stbi_uc) c1;
- rgbe[1] = (stbi_uc) c2;
- rgbe[2] = (stbi_uc) len;
- rgbe[3] = (stbi_uc) stbi__get8(s);
- stbi__hdr_convert(hdr_data, rgbe, req_comp);
- i = 1;
- j = 0;
- STBI_FREE(scanline);
- goto main_decode_loop; // yes, this makes no sense
- }
- len <<= 8;
- len |= stbi__get8(s);
- if (len != width) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("invalid decoded scanline length", "corrupt HDR"); }
- if (scanline == NULL) {
- scanline = (stbi_uc *) stbi__malloc_mad2(width, 4, 0);
- if (!scanline) {
- STBI_FREE(hdr_data);
- return stbi__errpf("outofmem", "Out of memory");
- }
- }
-
- for (k = 0; k < 4; ++k) {
- int nleft;
- i = 0;
- while ((nleft = width - i) > 0) {
- count = stbi__get8(s);
- if (count > 128) {
- // Run
- value = stbi__get8(s);
- count -= 128;
- if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
- for (z = 0; z < count; ++z)
- scanline[i++ * 4 + k] = value;
- } else {
- // Dump
- if (count > nleft) { STBI_FREE(hdr_data); STBI_FREE(scanline); return stbi__errpf("corrupt", "bad RLE data in HDR"); }
- for (z = 0; z < count; ++z)
- scanline[i++ * 4 + k] = stbi__get8(s);
- }
- }
- }
- for (i=0; i < width; ++i)
- stbi__hdr_convert(hdr_data+(j*width + i)*req_comp, scanline + i*4, req_comp);
- }
- if (scanline)
- STBI_FREE(scanline);
- }
-
- return hdr_data;
-}
-
-static int stbi__hdr_info(stbi__context *s, int *x, int *y, int *comp)
-{
- char buffer[STBI__HDR_BUFLEN];
- char *token;
- int valid = 0;
- int dummy;
-
- if (!x) x = &dummy;
- if (!y) y = &dummy;
- if (!comp) comp = &dummy;
-
- if (stbi__hdr_test(s) == 0) {
- stbi__rewind( s );
- return 0;
- }
-
- for(;;) {
- token = stbi__hdr_gettoken(s,buffer);
- if (token[0] == 0) break;
- if (strcmp(token, "FORMAT=32-bit_rle_rgbe") == 0) valid = 1;
- }
-
- if (!valid) {
- stbi__rewind( s );
- return 0;
- }
- token = stbi__hdr_gettoken(s,buffer);
- if (strncmp(token, "-Y ", 3)) {
- stbi__rewind( s );
- return 0;
- }
- token += 3;
- *y = (int) strtol(token, &token, 10);
- while (*token == ' ') ++token;
- if (strncmp(token, "+X ", 3)) {
- stbi__rewind( s );
- return 0;
- }
- token += 3;
- *x = (int) strtol(token, NULL, 10);
- *comp = 3;
- return 1;
-}
-#endif // STBI_NO_HDR
-
-#ifndef STBI_NO_BMP
-static int stbi__bmp_info(stbi__context *s, int *x, int *y, int *comp)
-{
- void *p;
- stbi__bmp_data info;
-
- info.all_a = 255;
- p = stbi__bmp_parse_header(s, &info);
- stbi__rewind( s );
- if (p == NULL)
- return 0;
- if (x) *x = s->img_x;
- if (y) *y = s->img_y;
- if (comp) *comp = info.ma ? 4 : 3;
- return 1;
-}
-#endif
-
-#ifndef STBI_NO_PSD
-static int stbi__psd_info(stbi__context *s, int *x, int *y, int *comp)
-{
- int channelCount, dummy, depth;
- if (!x) x = &dummy;
- if (!y) y = &dummy;
- if (!comp) comp = &dummy;
- if (stbi__get32be(s) != 0x38425053) {
- stbi__rewind( s );
- return 0;
- }
- if (stbi__get16be(s) != 1) {
- stbi__rewind( s );
- return 0;
- }
- stbi__skip(s, 6);
- channelCount = stbi__get16be(s);
- if (channelCount < 0 || channelCount > 16) {
- stbi__rewind( s );
- return 0;
- }
- *y = stbi__get32be(s);
- *x = stbi__get32be(s);
- depth = stbi__get16be(s);
- if (depth != 8 && depth != 16) {
- stbi__rewind( s );
- return 0;
- }
- if (stbi__get16be(s) != 3) {
- stbi__rewind( s );
- return 0;
- }
- *comp = 4;
- return 1;
-}
-
-static int stbi__psd_is16(stbi__context *s)
-{
- int channelCount, depth;
- if (stbi__get32be(s) != 0x38425053) {
- stbi__rewind( s );
- return 0;
- }
- if (stbi__get16be(s) != 1) {
- stbi__rewind( s );
- return 0;
- }
- stbi__skip(s, 6);
- channelCount = stbi__get16be(s);
- if (channelCount < 0 || channelCount > 16) {
- stbi__rewind( s );
- return 0;
- }
- (void) stbi__get32be(s);
- (void) stbi__get32be(s);
- depth = stbi__get16be(s);
- if (depth != 16) {
- stbi__rewind( s );
- return 0;
- }
- return 1;
-}
-#endif
-
-#ifndef STBI_NO_PIC
-static int stbi__pic_info(stbi__context *s, int *x, int *y, int *comp)
-{
- int act_comp=0,num_packets=0,chained,dummy;
- stbi__pic_packet packets[10];
-
- if (!x) x = &dummy;
- if (!y) y = &dummy;
- if (!comp) comp = &dummy;
-
- if (!stbi__pic_is4(s,"\x53\x80\xF6\x34")) {
- stbi__rewind(s);
- return 0;
- }
-
- stbi__skip(s, 88);
-
- *x = stbi__get16be(s);
- *y = stbi__get16be(s);
- if (stbi__at_eof(s)) {
- stbi__rewind( s);
- return 0;
- }
- if ( (*x) != 0 && (1 << 28) / (*x) < (*y)) {
- stbi__rewind( s );
- return 0;
- }
-
- stbi__skip(s, 8);
-
- do {
- stbi__pic_packet *packet;
-
- if (num_packets==sizeof(packets)/sizeof(packets[0]))
- return 0;
-
- packet = &packets[num_packets++];
- chained = stbi__get8(s);
- packet->size = stbi__get8(s);
- packet->type = stbi__get8(s);
- packet->channel = stbi__get8(s);
- act_comp |= packet->channel;
-
- if (stbi__at_eof(s)) {
- stbi__rewind( s );
- return 0;
- }
- if (packet->size != 8) {
- stbi__rewind( s );
- return 0;
- }
- } while (chained);
-
- *comp = (act_comp & 0x10 ? 4 : 3);
-
- return 1;
-}
-#endif
-
-// *************************************************************************************************
-// Portable Gray Map and Portable Pixel Map loader
-// by Ken Miller
-//
-// PGM: http://netpbm.sourceforge.net/doc/pgm.html
-// PPM: http://netpbm.sourceforge.net/doc/ppm.html
-//
-// Known limitations:
-// Does not support comments in the header section
-// Does not support ASCII image data (formats P2 and P3)
-// Does not support 16-bit-per-channel
-
-#ifndef STBI_NO_PNM
-
-static int stbi__pnm_test(stbi__context *s)
-{
- char p, t;
- p = (char) stbi__get8(s);
- t = (char) stbi__get8(s);
- if (p != 'P' || (t != '5' && t != '6')) {
- stbi__rewind( s );
- return 0;
- }
- return 1;
-}
-
-static void *stbi__pnm_load(stbi__context *s, int *x, int *y, int *comp, int req_comp, stbi__result_info *ri)
-{
- stbi_uc *out;
- STBI_NOTUSED(ri);
-
- if (!stbi__pnm_info(s, (int *)&s->img_x, (int *)&s->img_y, (int *)&s->img_n))
- return 0;
-
- *x = s->img_x;
- *y = s->img_y;
- if (comp) *comp = s->img_n;
-
- if (!stbi__mad3sizes_valid(s->img_n, s->img_x, s->img_y, 0))
- return stbi__errpuc("too large", "PNM too large");
-
- out = (stbi_uc *) stbi__malloc_mad3(s->img_n, s->img_x, s->img_y, 0);
- if (!out) return stbi__errpuc("outofmem", "Out of memory");
- stbi__getn(s, out, s->img_n * s->img_x * s->img_y);
-
- if (req_comp && req_comp != s->img_n) {
- out = stbi__convert_format(out, s->img_n, req_comp, s->img_x, s->img_y);
- if (out == NULL) return out; // stbi__convert_format frees input on failure
- }
- return out;
-}
-
-static int stbi__pnm_isspace(char c)
-{
- return c == ' ' || c == '\t' || c == '\n' || c == '\v' || c == '\f' || c == '\r';
-}
-
-static void stbi__pnm_skip_whitespace(stbi__context *s, char *c)
-{
- for (;;) {
- while (!stbi__at_eof(s) && stbi__pnm_isspace(*c))
- *c = (char) stbi__get8(s);
-
- if (stbi__at_eof(s) || *c != '#')
- break;
-
- while (!stbi__at_eof(s) && *c != '\n' && *c != '\r' )
- *c = (char) stbi__get8(s);
- }
-}
-
-static int stbi__pnm_isdigit(char c)
-{
- return c >= '0' && c <= '9';
-}
-
-static int stbi__pnm_getinteger(stbi__context *s, char *c)
-{
- int value = 0;
-
- while (!stbi__at_eof(s) && stbi__pnm_isdigit(*c)) {
- value = value*10 + (*c - '0');
- *c = (char) stbi__get8(s);
- }
-
- return value;
-}
-
-static int stbi__pnm_info(stbi__context *s, int *x, int *y, int *comp)
-{
- int maxv, dummy;
- char c, p, t;
-
- if (!x) x = &dummy;
- if (!y) y = &dummy;
- if (!comp) comp = &dummy;
-
- stbi__rewind(s);
-
- // Get identifier
- p = (char) stbi__get8(s);
- t = (char) stbi__get8(s);
- if (p != 'P' || (t != '5' && t != '6')) {
- stbi__rewind(s);
- return 0;
- }
-
- *comp = (t == '6') ? 3 : 1; // '5' is 1-component .pgm; '6' is 3-component .ppm
-
- c = (char) stbi__get8(s);
- stbi__pnm_skip_whitespace(s, &c);
-
- *x = stbi__pnm_getinteger(s, &c); // read width
- stbi__pnm_skip_whitespace(s, &c);
-
- *y = stbi__pnm_getinteger(s, &c); // read height
- stbi__pnm_skip_whitespace(s, &c);
-
- maxv = stbi__pnm_getinteger(s, &c); // read max value
-
- if (maxv > 255)
- return stbi__err("max value > 255", "PPM image not 8-bit");
- else
- return 1;
-}
-#endif
-
-static int stbi__info_main(stbi__context *s, int *x, int *y, int *comp)
-{
- #ifndef STBI_NO_JPEG
- if (stbi__jpeg_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_PNG
- if (stbi__png_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_GIF
- if (stbi__gif_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_BMP
- if (stbi__bmp_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_PSD
- if (stbi__psd_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_PIC
- if (stbi__pic_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_PNM
- if (stbi__pnm_info(s, x, y, comp)) return 1;
- #endif
-
- #ifndef STBI_NO_HDR
- if (stbi__hdr_info(s, x, y, comp)) return 1;
- #endif
-
- // test tga last because it's a crappy test!
- #ifndef STBI_NO_TGA
- if (stbi__tga_info(s, x, y, comp))
- return 1;
- #endif
- return stbi__err("unknown image type", "Image not of any known type, or corrupt");
-}
-
-static int stbi__is_16_main(stbi__context *s)
-{
- #ifndef STBI_NO_PNG
- if (stbi__png_is16(s)) return 1;
- #endif
-
- #ifndef STBI_NO_PSD
- if (stbi__psd_is16(s)) return 1;
- #endif
-
- return 0;
-}
-
-#ifndef STBI_NO_STDIO
-STBIDEF int stbi_info(char const *filename, int *x, int *y, int *comp)
-{
- FILE *f = stbi__fopen(filename, "rb");
- int result;
- if (!f) return stbi__err("can't fopen", "Unable to open file");
- result = stbi_info_from_file(f, x, y, comp);
- fclose(f);
- return result;
-}
-
-STBIDEF int stbi_info_from_file(FILE *f, int *x, int *y, int *comp)
-{
- int r;
- stbi__context s;
- long pos = ftell(f);
- stbi__start_file(&s, f);
- r = stbi__info_main(&s,x,y,comp);
- fseek(f,pos,SEEK_SET);
- return r;
-}
-
-STBIDEF int stbi_is_16_bit(char const *filename)
-{
- FILE *f = stbi__fopen(filename, "rb");
- int result;
- if (!f) return stbi__err("can't fopen", "Unable to open file");
- result = stbi_is_16_bit_from_file(f);
- fclose(f);
- return result;
-}
-
-STBIDEF int stbi_is_16_bit_from_file(FILE *f)
-{
- int r;
- stbi__context s;
- long pos = ftell(f);
- stbi__start_file(&s, f);
- r = stbi__is_16_main(&s);
- fseek(f,pos,SEEK_SET);
- return r;
-}
-#endif // !STBI_NO_STDIO
-
-STBIDEF int stbi_info_from_memory(stbi_uc const *buffer, int len, int *x, int *y, int *comp)
-{
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__info_main(&s,x,y,comp);
-}
-
-STBIDEF int stbi_info_from_callbacks(stbi_io_callbacks const *c, void *user, int *x, int *y, int *comp)
-{
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);
- return stbi__info_main(&s,x,y,comp);
-}
-
-STBIDEF int stbi_is_16_bit_from_memory(stbi_uc const *buffer, int len)
-{
- stbi__context s;
- stbi__start_mem(&s,buffer,len);
- return stbi__is_16_main(&s);
-}
-
-STBIDEF int stbi_is_16_bit_from_callbacks(stbi_io_callbacks const *c, void *user)
-{
- stbi__context s;
- stbi__start_callbacks(&s, (stbi_io_callbacks *) c, user);
- return stbi__is_16_main(&s);
-}
-
-#endif // STB_IMAGE_IMPLEMENTATION
-
-/*
- revision history:
- 2.19 (2018-02-11) fix warning
- 2.18 (2018-01-30) fix warnings
- 2.17 (2018-01-29) change sbti__shiftsigned to avoid clang -O2 bug
- 1-bit BMP
- *_is_16_bit api
- avoid warnings
- 2.16 (2017-07-23) all functions have 16-bit variants;
- STBI_NO_STDIO works again;
- compilation fixes;
- fix rounding in unpremultiply;
- optimize vertical flip;
- disable raw_len validation;
- documentation fixes
- 2.15 (2017-03-18) fix png-1,2,4 bug; now all Imagenet JPGs decode;
- warning fixes; disable run-time SSE detection on gcc;
- uniform handling of optional "return" values;
- thread-safe initialization of zlib tables
- 2.14 (2017-03-03) remove deprecated STBI_JPEG_OLD; fixes for Imagenet JPGs
- 2.13 (2016-11-29) add 16-bit API, only supported for PNG right now
- 2.12 (2016-04-02) fix typo in 2.11 PSD fix that caused crashes
- 2.11 (2016-04-02) allocate large structures on the stack
- remove white matting for transparent PSD
- fix reported channel count for PNG & BMP
- re-enable SSE2 in non-gcc 64-bit
- support RGB-formatted JPEG
- read 16-bit PNGs (only as 8-bit)
- 2.10 (2016-01-22) avoid warning introduced in 2.09 by STBI_REALLOC_SIZED
- 2.09 (2016-01-16) allow comments in PNM files
- 16-bit-per-pixel TGA (not bit-per-component)
- info() for TGA could break due to .hdr handling
- info() for BMP to shares code instead of sloppy parse
- can use STBI_REALLOC_SIZED if allocator doesn't support realloc
- code cleanup
- 2.08 (2015-09-13) fix to 2.07 cleanup, reading RGB PSD as RGBA
- 2.07 (2015-09-13) fix compiler warnings
- partial animated GIF support
- limited 16-bpc PSD support
- #ifdef unused functions
- bug with < 92 byte PIC,PNM,HDR,TGA
- 2.06 (2015-04-19) fix bug where PSD returns wrong '*comp' value
- 2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
- 2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
- 2.03 (2015-04-12) extra corruption checking (mmozeiko)
- stbi_set_flip_vertically_on_load (nguillemot)
- fix NEON support; fix mingw support
- 2.02 (2015-01-19) fix incorrect assert, fix warning
- 2.01 (2015-01-17) fix various warnings; suppress SIMD on gcc 32-bit without -msse2
- 2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
- 2.00 (2014-12-25) optimize JPG, including x86 SSE2 & NEON SIMD (ryg)
- progressive JPEG (stb)
- PGM/PPM support (Ken Miller)
- STBI_MALLOC,STBI_REALLOC,STBI_FREE
- GIF bugfix -- seemingly never worked
- STBI_NO_*, STBI_ONLY_*
- 1.48 (2014-12-14) fix incorrectly-named assert()
- 1.47 (2014-12-14) 1/2/4-bit PNG support, both direct and paletted (Omar Cornut & stb)
- optimize PNG (ryg)
- fix bug in interlaced PNG with user-specified channel count (stb)
- 1.46 (2014-08-26)
- fix broken tRNS chunk (colorkey-style transparency) in non-paletted PNG
- 1.45 (2014-08-16)
- fix MSVC-ARM internal compiler error by wrapping malloc
- 1.44 (2014-08-07)
- various warning fixes from Ronny Chevalier
- 1.43 (2014-07-15)
- fix MSVC-only compiler problem in code changed in 1.42
- 1.42 (2014-07-09)
- don't define _CRT_SECURE_NO_WARNINGS (affects user code)
- fixes to stbi__cleanup_jpeg path
- added STBI_ASSERT to avoid requiring assert.h
- 1.41 (2014-06-25)
- fix search&replace from 1.36 that messed up comments/error messages
- 1.40 (2014-06-22)
- fix gcc struct-initialization warning
- 1.39 (2014-06-15)
- fix to TGA optimization when req_comp != number of components in TGA;
- fix to GIF loading because BMP wasn't rewinding (whoops, no GIFs in my test suite)
- add support for BMP version 5 (more ignored fields)
- 1.38 (2014-06-06)
- suppress MSVC warnings on integer casts truncating values
- fix accidental rename of 'skip' field of I/O
- 1.37 (2014-06-04)
- remove duplicate typedef
- 1.36 (2014-06-03)
- convert to header file single-file library
- if de-iphone isn't set, load iphone images color-swapped instead of returning NULL
- 1.35 (2014-05-27)
- various warnings
- fix broken STBI_SIMD path
- fix bug where stbi_load_from_file no longer left file pointer in correct place
- fix broken non-easy path for 32-bit BMP (possibly never used)
- TGA optimization by Arseny Kapoulkine
- 1.34 (unknown)
- use STBI_NOTUSED in stbi__resample_row_generic(), fix one more leak in tga failure case
- 1.33 (2011-07-14)
- make stbi_is_hdr work in STBI_NO_HDR (as specified), minor compiler-friendly improvements
- 1.32 (2011-07-13)
- support for "info" function for all supported filetypes (SpartanJ)
- 1.31 (2011-06-20)
- a few more leak fixes, bug in PNG handling (SpartanJ)
- 1.30 (2011-06-11)
- added ability to load files via callbacks to accomidate custom input streams (Ben Wenger)
- removed deprecated format-specific test/load functions
- removed support for installable file formats (stbi_loader) -- would have been broken for IO callbacks anyway
- error cases in bmp and tga give messages and don't leak (Raymond Barbiero, grisha)
- fix inefficiency in decoding 32-bit BMP (David Woo)
- 1.29 (2010-08-16)
- various warning fixes from Aurelien Pocheville
- 1.28 (2010-08-01)
- fix bug in GIF palette transparency (SpartanJ)
- 1.27 (2010-08-01)
- cast-to-stbi_uc to fix warnings
- 1.26 (2010-07-24)
- fix bug in file buffering for PNG reported by SpartanJ
- 1.25 (2010-07-17)
- refix trans_data warning (Won Chun)
- 1.24 (2010-07-12)
- perf improvements reading from files on platforms with lock-heavy fgetc()
- minor perf improvements for jpeg
- deprecated type-specific functions so we'll get feedback if they're needed
- attempt to fix trans_data warning (Won Chun)
- 1.23 fixed bug in iPhone support
- 1.22 (2010-07-10)
- removed image *writing* support
- stbi_info support from Jetro Lauha
- GIF support from Jean-Marc Lienher
- iPhone PNG-extensions from James Brown
- warning-fixes from Nicolas Schulz and Janez Zemva (i.stbi__err. Janez (U+017D)emva)
- 1.21 fix use of 'stbi_uc' in header (reported by jon blow)
- 1.20 added support for Softimage PIC, by Tom Seddon
- 1.19 bug in interlaced PNG corruption check (found by ryg)
- 1.18 (2008-08-02)
- fix a threading bug (local mutable static)
- 1.17 support interlaced PNG
- 1.16 major bugfix - stbi__convert_format converted one too many pixels
- 1.15 initialize some fields for thread safety
- 1.14 fix threadsafe conversion bug
- header-file-only version (#define STBI_HEADER_FILE_ONLY before including)
- 1.13 threadsafe
- 1.12 const qualifiers in the API
- 1.11 Support installable IDCT, colorspace conversion routines
- 1.10 Fixes for 64-bit (don't use "unsigned long")
- optimized upsampling by Fabian "ryg" Giesen
- 1.09 Fix format-conversion for PSD code (bad global variables!)
- 1.08 Thatcher Ulrich's PSD code integrated by Nicolas Schulz
- 1.07 attempt to fix C++ warning/errors again
- 1.06 attempt to fix C++ warning/errors again
- 1.05 fix TGA loading to return correct *comp and use good luminance calc
- 1.04 default float alpha is 1, not 255; use 'void *' for stbi_image_free
- 1.03 bugfixes to STBI_NO_STDIO, STBI_NO_HDR
- 1.02 support for (subset of) HDR files, float interface for preferred access to them
- 1.01 fix bug: possible bug in handling right-side up bmps... not sure
- fix bug: the stbi__bmp_load() and stbi__tga_load() functions didn't work at all
- 1.00 interface to zlib that skips zlib header
- 0.99 correct handling of alpha in palette
- 0.98 TGA loader by lonesock; dynamically add loaders (untested)
- 0.97 jpeg errors on too large a file; also catch another malloc failure
- 0.96 fix detection of invalid v value - particleman@mollyrocket forum
- 0.95 during header scan, seek to markers in case of padding
- 0.94 STBI_NO_STDIO to disable stdio usage; rename all #defines the same
- 0.93 handle jpegtran output; verbose errors
- 0.92 read 4,8,16,24,32-bit BMP files of several formats
- 0.91 output 24-bit Windows 3.0 BMP files
- 0.90 fix a few more warnings; bump version number to approach 1.0
- 0.61 bugfixes due to Marc LeBlanc, Christopher Lloyd
- 0.60 fix compiling as c++
- 0.59 fix warnings: merge Dave Moore's -Wall fixes
- 0.58 fix bug: zlib uncompressed mode len/nlen was wrong endian
- 0.57 fix bug: jpg last huffman symbol before marker was >9 bits but less than 16 available
- 0.56 fix bug: zlib uncompressed mode len vs. nlen
- 0.55 fix bug: restart_interval not initialized to 0
- 0.54 allow NULL for 'int *comp'
- 0.53 fix bug in png 3->4; speedup png decoding
- 0.52 png handles req_comp=3,4 directly; minor cleanup; jpeg comments
- 0.51 obey req_comp requests, 1-component jpegs return as 1-component,
- on 'test' only check type, not whether we support this variant
- 0.50 (2006-11-19)
- first released version
-*/
-
-
-/*
-------------------------------------------------------------------------------
-This software is available under 2 licenses -- choose whichever you prefer.
-------------------------------------------------------------------------------
-ALTERNATIVE A - MIT License
-Copyright (c) 2017 Sean Barrett
-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.
-------------------------------------------------------------------------------
-ALTERNATIVE B - Public Domain (www.unlicense.org)
-This is free and unencumbered software released into the public domain.
-Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
-software, either in source code form or as a compiled binary, for any purpose,
-commercial or non-commercial, and by any means.
-In jurisdictions that recognize copyright laws, the author or authors of this
-software dedicate any and all copyright interest in the software to the public
-domain. We make this dedication for the benefit of the public at large and to
-the detriment of our heirs and successors. We intend this dedication to be an
-overt act of relinquishment in perpetuity of all present and future rights to
-this software under copyright law.
-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 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.
-------------------------------------------------------------------------------
-*/
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_resize.h b/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_resize.h
deleted file mode 100644
index bcca92c2dc..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_resize.h
+++ /dev/null
@@ -1,2585 +0,0 @@
-/* stb_image_resize - v0.90 - public domain image resizing
- by Jorge L Rodriguez (@VinoBS) - 2014
- http://github.com/nothings/stb
-
- Written with emphasis on usability, portability, and efficiency. (No
- SIMD or threads, so it be easily outperformed by libs that use those.)
- Only scaling and translation is supported, no rotations or shears.
- Easy API downsamples w/Mitchell filter, upsamples w/cubic interpolation.
-
- COMPILING & LINKING
- In one C/C++ file that #includes this file, do this:
- #define STB_IMAGE_RESIZE_IMPLEMENTATION
- before the #include. That will create the implementation in that file.
-
- QUICKSTART
- stbir_resize_uint8( input_pixels , in_w , in_h , 0,
- output_pixels, out_w, out_h, 0, num_channels)
- stbir_resize_float(...)
- stbir_resize_uint8_srgb( input_pixels , in_w , in_h , 0,
- output_pixels, out_w, out_h, 0,
- num_channels , alpha_chan , 0)
- stbir_resize_uint8_srgb_edgemode(
- input_pixels , in_w , in_h , 0,
- output_pixels, out_w, out_h, 0,
- num_channels , alpha_chan , 0, STBIR_EDGE_CLAMP)
- // WRAP/REFLECT/ZERO
-
- FULL API
- See the "header file" section of the source for API documentation.
-
- ADDITIONAL DOCUMENTATION
-
- SRGB & FLOATING POINT REPRESENTATION
- The sRGB functions presume IEEE floating point. If you do not have
- IEEE floating point, define STBIR_NON_IEEE_FLOAT. This will use
- a slower implementation.
-
- MEMORY ALLOCATION
- The resize functions here perform a single memory allocation using
- malloc. To control the memory allocation, before the #include that
- triggers the implementation, do:
-
- #define STBIR_MALLOC(size,context) ...
- #define STBIR_FREE(ptr,context) ...
-
- Each resize function makes exactly one call to malloc/free, so to use
- temp memory, store the temp memory in the context and return that.
-
- ASSERT
- Define STBIR_ASSERT(boolval) to override assert() and not use assert.h
-
- OPTIMIZATION
- Define STBIR_SATURATE_INT to compute clamp values in-range using
- integer operations instead of float operations. This may be faster
- on some platforms.
-
- DEFAULT FILTERS
- For functions which don't provide explicit control over what filters
- to use, you can change the compile-time defaults with
-
- #define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_something
- #define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_something
-
- See stbir_filter in the header-file section for the list of filters.
-
- NEW FILTERS
- A number of 1D filter kernels are used. For a list of
- supported filters see the stbir_filter enum. To add a new filter,
- write a filter function and add it to stbir__filter_info_table.
-
- PROGRESS
- For interactive use with slow resize operations, you can install
- a progress-report callback:
-
- #define STBIR_PROGRESS_REPORT(val) some_func(val)
-
- The parameter val is a float which goes from 0 to 1 as progress is made.
-
- For example:
-
- static void my_progress_report(float progress);
- #define STBIR_PROGRESS_REPORT(val) my_progress_report(val)
-
- #define STB_IMAGE_RESIZE_IMPLEMENTATION
- #include "stb_image_resize.h"
-
- static void my_progress_report(float progress)
- {
- printf("Progress: %f%%\n", progress*100);
- }
-
- MAX CHANNELS
- If your image has more than 64 channels, define STBIR_MAX_CHANNELS
- to the max you'll have.
-
- ALPHA CHANNEL
- Most of the resizing functions provide the ability to control how
- the alpha channel of an image is processed. The important things
- to know about this:
-
- 1. The best mathematically-behaved version of alpha to use is
- called "premultiplied alpha", in which the other color channels
- have had the alpha value multiplied in. If you use premultiplied
- alpha, linear filtering (such as image resampling done by this
- library, or performed in texture units on GPUs) does the "right
- thing". While premultiplied alpha is standard in the movie CGI
- industry, it is still uncommon in the videogame/real-time world.
-
- If you linearly filter non-premultiplied alpha, strange effects
- occur. (For example, the average of 1% opaque bright green
- and 99% opaque black produces 50% transparent dark green when
- non-premultiplied, whereas premultiplied it produces 50%
- transparent near-black. The former introduces green energy
- that doesn't exist in the source image.)
-
- 2. Artists should not edit premultiplied-alpha images; artists
- want non-premultiplied alpha images. Thus, art tools generally output
- non-premultiplied alpha images.
-
- 3. You will get best results in most cases by converting images
- to premultiplied alpha before processing them mathematically.
-
- 4. If you pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED, the
- resizer does not do anything special for the alpha channel;
- it is resampled identically to other channels. This produces
- the correct results for premultiplied-alpha images, but produces
- less-than-ideal results for non-premultiplied-alpha images.
-
- 5. If you do not pass the flag STBIR_FLAG_ALPHA_PREMULTIPLIED,
- then the resizer weights the contribution of input pixels
- based on their alpha values, or, equivalently, it multiplies
- the alpha value into the color channels, resamples, then divides
- by the resultant alpha value. Input pixels which have alpha=0 do
- not contribute at all to output pixels unless _all_ of the input
- pixels affecting that output pixel have alpha=0, in which case
- the result for that pixel is the same as it would be without
- STBIR_FLAG_ALPHA_PREMULTIPLIED. However, this is only true for
- input images in integer formats. For input images in float format,
- input pixels with alpha=0 have no effect, and output pixels
- which have alpha=0 will be 0 in all channels. (For float images,
- you can manually achieve the same result by adding a tiny epsilon
- value to the alpha channel of every image, and then subtracting
- or clamping it at the end.)
-
- 6. You can suppress the behavior described in #5 and make
- all-0-alpha pixels have 0 in all channels by #defining
- STBIR_NO_ALPHA_EPSILON.
-
- 7. You can separately control whether the alpha channel is
- interpreted as linear or affected by the colorspace. By default
- it is linear; you almost never want to apply the colorspace.
- (For example, graphics hardware does not apply sRGB conversion
- to the alpha channel.)
-
- ADDITIONAL CONTRIBUTORS
- Sean Barrett: API design, optimizations
-
- REVISIONS
- 0.90 (2014-09-17) first released version
-
- LICENSE
- This software is in the public domain. Where that dedication is not
- recognized, you are granted a perpetual, irrevocable license to copy
- and modify this file as you see fit.
-
- TODO
- Don't decode all of the image data when only processing a partial tile
- Don't use full-width decode buffers when only processing a partial tile
- When processing wide images, break processing into tiles so data fits in L1 cache
- Installable filters?
- Resize that respects alpha test coverage
- (Reference code: FloatImage::alphaTestCoverage and FloatImage::scaleAlphaToCoverage:
- https://code.google.com/p/nvidia-texture-tools/source/browse/trunk/src/nvimage/FloatImage.cpp )
-*/
-
-#ifndef STBIR_INCLUDE_STB_IMAGE_RESIZE_H
-#define STBIR_INCLUDE_STB_IMAGE_RESIZE_H
-
-#ifdef _MSC_VER
-typedef unsigned char stbir_uint8;
-typedef unsigned short stbir_uint16;
-typedef unsigned int stbir_uint32;
-#else
-#include <stdint.h>
-typedef uint8_t stbir_uint8;
-typedef uint16_t stbir_uint16;
-typedef uint32_t stbir_uint32;
-#endif
-
-#ifdef STB_IMAGE_RESIZE_STATIC
-#define STBIRDEF static
-#else
-#ifdef __cplusplus
-#define STBIRDEF extern "C"
-#else
-#define STBIRDEF extern
-#endif
-#endif
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Easy-to-use API:
-//
-// * "input pixels" points to an array of image data with 'num_channels' channels (e.g. RGB=3, RGBA=4)
-// * input_w is input image width (x-axis), input_h is input image height (y-axis)
-// * stride is the offset between successive rows of image data in memory, in bytes. you can
-// specify 0 to mean packed continuously in memory
-// * alpha channel is treated identically to other channels.
-// * colorspace is linear or sRGB as specified by function name
-// * returned result is 1 for success or 0 in case of an error.
-// #define STBIR_ASSERT() to trigger an assert on parameter validation errors.
-// * Memory required grows approximately linearly with input and output size, but with
-// discontinuities at input_w == output_w and input_h == output_h.
-// * These functions use a "default" resampling filter defined at compile time. To change the filter,
-// you can change the compile-time defaults by #defining STBIR_DEFAULT_FILTER_UPSAMPLE
-// and STBIR_DEFAULT_FILTER_DOWNSAMPLE, or you can use the medium-complexity API.
-
-STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels);
-
-STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- float *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels);
-
-
-// The following functions interpret image data as gamma-corrected sRGB.
-// Specify STBIR_ALPHA_CHANNEL_NONE if you have no alpha channel,
-// or otherwise provide the index of the alpha channel. Flags value
-// of 0 will probably do the right thing if you're not sure what
-// the flags mean.
-
-#define STBIR_ALPHA_CHANNEL_NONE -1
-
-// Set this flag if your texture has premultiplied alpha. Otherwise, stbir will
-// use alpha-weighted resampling (effectively premultiplying, resampling,
-// then unpremultiplying).
-#define STBIR_FLAG_ALPHA_PREMULTIPLIED (1 << 0)
-// The specified alpha channel should be handled as gamma-corrected value even
-// when doing sRGB operations.
-#define STBIR_FLAG_ALPHA_USES_COLORSPACE (1 << 1)
-
-STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags);
-
-
-typedef enum
-{
- STBIR_EDGE_CLAMP = 1,
- STBIR_EDGE_REFLECT = 2,
- STBIR_EDGE_WRAP = 3,
- STBIR_EDGE_ZERO = 4,
-} stbir_edge;
-
-// This function adds the ability to specify how requests to sample off the edge of the image are handled.
-STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode);
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Medium-complexity API
-//
-// This extends the easy-to-use API as follows:
-//
-// * Alpha-channel can be processed separately
-// * If alpha_channel is not STBIR_ALPHA_CHANNEL_NONE
-// * Alpha channel will not be gamma corrected (unless flags&STBIR_FLAG_GAMMA_CORRECT)
-// * Filters will be weighted by alpha channel (unless flags&STBIR_FLAG_ALPHA_PREMULTIPLIED)
-// * Filter can be selected explicitly
-// * uint16 image type
-// * sRGB colorspace available for all types
-// * context parameter for passing to STBIR_MALLOC
-
-typedef enum
-{
- STBIR_FILTER_DEFAULT = 0, // use same filter type that easy-to-use API chooses
- STBIR_FILTER_BOX = 1, // A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios
- STBIR_FILTER_TRIANGLE = 2, // On upsampling, produces same results as bilinear texture filtering
- STBIR_FILTER_CUBICBSPLINE = 3, // The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque
- STBIR_FILTER_CATMULLROM = 4, // An interpolating cubic spline
- STBIR_FILTER_MITCHELL = 5, // Mitchell-Netrevalli filter with B=1/3, C=1/3
-} stbir_filter;
-
-typedef enum
-{
- STBIR_COLORSPACE_LINEAR,
- STBIR_COLORSPACE_SRGB,
-
- STBIR_MAX_COLORSPACES,
-} stbir_colorspace;
-
-// The following functions are all identical except for the type of the image data
-
-STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context);
-
-STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context);
-
-STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- float *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context);
-
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Full-complexity API
-//
-// This extends the medium API as follows:
-//
-// * uint32 image type
-// * not typesafe
-// * separate filter types for each axis
-// * separate edge modes for each axis
-// * can specify scale explicitly for subpixel correctness
-// * can specify image source tile using texture coordinates
-
-typedef enum
-{
- STBIR_TYPE_UINT8 ,
- STBIR_TYPE_UINT16,
- STBIR_TYPE_UINT32,
- STBIR_TYPE_FLOAT ,
-
- STBIR_MAX_TYPES
-} stbir_datatype;
-
-STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context);
-
-STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context,
- float x_scale, float y_scale,
- float x_offset, float y_offset);
-
-STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context,
- float s0, float t0, float s1, float t1);
-// (s0, t0) & (s1, t1) are the top-left and bottom right corner (uv addressing style: [0, 1]x[0, 1]) of a region of the input image to use.
-
-//
-//
-//// end header file /////////////////////////////////////////////////////
-#endif // STBIR_INCLUDE_STB_IMAGE_RESIZE_H
-
-
-
-
-
-#ifdef STB_IMAGE_RESIZE_IMPLEMENTATION
-
-#ifndef STBIR_ASSERT
-#include <assert.h>
-#define STBIR_ASSERT(x) assert(x)
-#endif
-
-#ifdef STBIR_DEBUG
-#define STBIR__DEBUG_ASSERT STBIR_ASSERT
-#else
-#define STBIR__DEBUG_ASSERT
-#endif
-
-// If you hit this it means I haven't done it yet.
-#define STBIR__UNIMPLEMENTED(x) STBIR_ASSERT(!(x))
-
-// For memset
-#include <string.h>
-
-#include <math.h>
-
-#ifndef STBIR_MALLOC
-#include <stdlib.h>
-#define STBIR_MALLOC(size,c) malloc(size)
-#define STBIR_FREE(ptr,c) free(ptr)
-#endif
-
-#ifndef _MSC_VER
-#ifdef __cplusplus
-#define stbir__inline inline
-#else
-#define stbir__inline
-#endif
-#else
-#define stbir__inline __forceinline
-#endif
-
-
-// should produce compiler error if size is wrong
-typedef unsigned char stbir__validate_uint32[sizeof(stbir_uint32) == 4 ? 1 : -1];
-
-#ifdef _MSC_VER
-#define STBIR__NOTUSED(v) (void)(v)
-#else
-#define STBIR__NOTUSED(v) (void)sizeof(v)
-#endif
-
-#define STBIR__ARRAY_SIZE(a) (sizeof((a))/sizeof((a)[0]))
-
-#ifndef STBIR_DEFAULT_FILTER_UPSAMPLE
-#define STBIR_DEFAULT_FILTER_UPSAMPLE STBIR_FILTER_CATMULLROM
-#endif
-
-#ifndef STBIR_DEFAULT_FILTER_DOWNSAMPLE
-#define STBIR_DEFAULT_FILTER_DOWNSAMPLE STBIR_FILTER_MITCHELL
-#endif
-
-#ifndef STBIR_PROGRESS_REPORT
-#define STBIR_PROGRESS_REPORT(float_0_to_1)
-#endif
-
-#ifndef STBIR_MAX_CHANNELS
-#define STBIR_MAX_CHANNELS 64
-#endif
-
-#if STBIR_MAX_CHANNELS > 65536
-#error "Too many channels; STBIR_MAX_CHANNELS must be no more than 65536."
-// because we store the indices in 16-bit variables
-#endif
-
-// This value is added to alpha just before premultiplication to avoid
-// zeroing out color values. It is equivalent to 2^-80. If you don't want
-// that behavior (it may interfere if you have floating point images with
-// very small alpha values) then you can define STBIR_NO_ALPHA_EPSILON to
-// disable it.
-#ifndef STBIR_ALPHA_EPSILON
-#define STBIR_ALPHA_EPSILON ((float)1 / (1 << 20) / (1 << 20) / (1 << 20) / (1 << 20))
-#endif
-
-
-
-#ifdef _MSC_VER
-#define STBIR__UNUSED_PARAM(v) (void)(v)
-#else
-#define STBIR__UNUSED_PARAM(v) (void)sizeof(v)
-#endif
-
-// must match stbir_datatype
-static unsigned char stbir__type_size[] = {
- 1, // STBIR_TYPE_UINT8
- 2, // STBIR_TYPE_UINT16
- 4, // STBIR_TYPE_UINT32
- 4, // STBIR_TYPE_FLOAT
-};
-
-// Kernel function centered at 0
-typedef float (stbir__kernel_fn)(float x, float scale);
-typedef float (stbir__support_fn)(float scale);
-
-typedef struct
-{
- stbir__kernel_fn* kernel;
- stbir__support_fn* support;
-} stbir__filter_info;
-
-// When upsampling, the contributors are which source pixels contribute.
-// When downsampling, the contributors are which destination pixels are contributed to.
-typedef struct
-{
- int n0; // First contributing pixel
- int n1; // Last contributing pixel
-} stbir__contributors;
-
-typedef struct
-{
- const void* input_data;
- int input_w;
- int input_h;
- int input_stride_bytes;
-
- void* output_data;
- int output_w;
- int output_h;
- int output_stride_bytes;
-
- float s0, t0, s1, t1;
-
- float horizontal_shift; // Units: output pixels
- float vertical_shift; // Units: output pixels
- float horizontal_scale;
- float vertical_scale;
-
- int channels;
- int alpha_channel;
- stbir_uint32 flags;
- stbir_datatype type;
- stbir_filter horizontal_filter;
- stbir_filter vertical_filter;
- stbir_edge edge_horizontal;
- stbir_edge edge_vertical;
- stbir_colorspace colorspace;
-
- stbir__contributors* horizontal_contributors;
- float* horizontal_coefficients;
-
- stbir__contributors* vertical_contributors;
- float* vertical_coefficients;
-
- int decode_buffer_pixels;
- float* decode_buffer;
-
- float* horizontal_buffer;
-
- // cache these because ceil/floor are inexplicably showing up in profile
- int horizontal_coefficient_width;
- int vertical_coefficient_width;
- int horizontal_filter_pixel_width;
- int vertical_filter_pixel_width;
- int horizontal_filter_pixel_margin;
- int vertical_filter_pixel_margin;
- int horizontal_num_contributors;
- int vertical_num_contributors;
-
- int ring_buffer_length_bytes; // The length of an individual entry in the ring buffer. The total number of ring buffers is stbir__get_filter_pixel_width(filter)
- int ring_buffer_first_scanline;
- int ring_buffer_last_scanline;
- int ring_buffer_begin_index;
- float* ring_buffer;
-
- float* encode_buffer; // A temporary buffer to store floats so we don't lose precision while we do multiply-adds.
-
- int horizontal_contributors_size;
- int horizontal_coefficients_size;
- int vertical_contributors_size;
- int vertical_coefficients_size;
- int decode_buffer_size;
- int horizontal_buffer_size;
- int ring_buffer_size;
- int encode_buffer_size;
-} stbir__info;
-
-static stbir__inline int stbir__min(int a, int b)
-{
- return a < b ? a : b;
-}
-
-static stbir__inline int stbir__max(int a, int b)
-{
- return a > b ? a : b;
-}
-
-static stbir__inline float stbir__saturate(float x)
-{
- if (x < 0)
- return 0;
-
- if (x > 1)
- return 1;
-
- return x;
-}
-
-#ifdef STBIR_SATURATE_INT
-static stbir__inline stbir_uint8 stbir__saturate8(int x)
-{
- if ((unsigned int) x <= 255)
- return x;
-
- if (x < 0)
- return 0;
-
- return 255;
-}
-
-static stbir__inline stbir_uint16 stbir__saturate16(int x)
-{
- if ((unsigned int) x <= 65535)
- return x;
-
- if (x < 0)
- return 0;
-
- return 65535;
-}
-#endif
-
-static float stbir__srgb_uchar_to_linear_float[256] = {
- 0.000000f, 0.000304f, 0.000607f, 0.000911f, 0.001214f, 0.001518f, 0.001821f, 0.002125f, 0.002428f, 0.002732f, 0.003035f,
- 0.003347f, 0.003677f, 0.004025f, 0.004391f, 0.004777f, 0.005182f, 0.005605f, 0.006049f, 0.006512f, 0.006995f, 0.007499f,
- 0.008023f, 0.008568f, 0.009134f, 0.009721f, 0.010330f, 0.010960f, 0.011612f, 0.012286f, 0.012983f, 0.013702f, 0.014444f,
- 0.015209f, 0.015996f, 0.016807f, 0.017642f, 0.018500f, 0.019382f, 0.020289f, 0.021219f, 0.022174f, 0.023153f, 0.024158f,
- 0.025187f, 0.026241f, 0.027321f, 0.028426f, 0.029557f, 0.030713f, 0.031896f, 0.033105f, 0.034340f, 0.035601f, 0.036889f,
- 0.038204f, 0.039546f, 0.040915f, 0.042311f, 0.043735f, 0.045186f, 0.046665f, 0.048172f, 0.049707f, 0.051269f, 0.052861f,
- 0.054480f, 0.056128f, 0.057805f, 0.059511f, 0.061246f, 0.063010f, 0.064803f, 0.066626f, 0.068478f, 0.070360f, 0.072272f,
- 0.074214f, 0.076185f, 0.078187f, 0.080220f, 0.082283f, 0.084376f, 0.086500f, 0.088656f, 0.090842f, 0.093059f, 0.095307f,
- 0.097587f, 0.099899f, 0.102242f, 0.104616f, 0.107023f, 0.109462f, 0.111932f, 0.114435f, 0.116971f, 0.119538f, 0.122139f,
- 0.124772f, 0.127438f, 0.130136f, 0.132868f, 0.135633f, 0.138432f, 0.141263f, 0.144128f, 0.147027f, 0.149960f, 0.152926f,
- 0.155926f, 0.158961f, 0.162029f, 0.165132f, 0.168269f, 0.171441f, 0.174647f, 0.177888f, 0.181164f, 0.184475f, 0.187821f,
- 0.191202f, 0.194618f, 0.198069f, 0.201556f, 0.205079f, 0.208637f, 0.212231f, 0.215861f, 0.219526f, 0.223228f, 0.226966f,
- 0.230740f, 0.234551f, 0.238398f, 0.242281f, 0.246201f, 0.250158f, 0.254152f, 0.258183f, 0.262251f, 0.266356f, 0.270498f,
- 0.274677f, 0.278894f, 0.283149f, 0.287441f, 0.291771f, 0.296138f, 0.300544f, 0.304987f, 0.309469f, 0.313989f, 0.318547f,
- 0.323143f, 0.327778f, 0.332452f, 0.337164f, 0.341914f, 0.346704f, 0.351533f, 0.356400f, 0.361307f, 0.366253f, 0.371238f,
- 0.376262f, 0.381326f, 0.386430f, 0.391573f, 0.396755f, 0.401978f, 0.407240f, 0.412543f, 0.417885f, 0.423268f, 0.428691f,
- 0.434154f, 0.439657f, 0.445201f, 0.450786f, 0.456411f, 0.462077f, 0.467784f, 0.473532f, 0.479320f, 0.485150f, 0.491021f,
- 0.496933f, 0.502887f, 0.508881f, 0.514918f, 0.520996f, 0.527115f, 0.533276f, 0.539480f, 0.545725f, 0.552011f, 0.558340f,
- 0.564712f, 0.571125f, 0.577581f, 0.584078f, 0.590619f, 0.597202f, 0.603827f, 0.610496f, 0.617207f, 0.623960f, 0.630757f,
- 0.637597f, 0.644480f, 0.651406f, 0.658375f, 0.665387f, 0.672443f, 0.679543f, 0.686685f, 0.693872f, 0.701102f, 0.708376f,
- 0.715694f, 0.723055f, 0.730461f, 0.737911f, 0.745404f, 0.752942f, 0.760525f, 0.768151f, 0.775822f, 0.783538f, 0.791298f,
- 0.799103f, 0.806952f, 0.814847f, 0.822786f, 0.830770f, 0.838799f, 0.846873f, 0.854993f, 0.863157f, 0.871367f, 0.879622f,
- 0.887923f, 0.896269f, 0.904661f, 0.913099f, 0.921582f, 0.930111f, 0.938686f, 0.947307f, 0.955974f, 0.964686f, 0.973445f,
- 0.982251f, 0.991102f, 1.0f
-};
-
-static float stbir__srgb_to_linear(float f)
-{
- if (f <= 0.04045f)
- return f / 12.92f;
- else
- return (float)pow((f + 0.055f) / 1.055f, 2.4f);
-}
-
-static float stbir__linear_to_srgb(float f)
-{
- if (f <= 0.0031308f)
- return f * 12.92f;
- else
- return 1.055f * (float)pow(f, 1 / 2.4f) - 0.055f;
-}
-
-#ifndef STBIR_NON_IEEE_FLOAT
-// From https://gist.github.com/rygorous/2203834
-
-typedef union
-{
- stbir_uint32 u;
- float f;
-} stbir__FP32;
-
-static const stbir_uint32 fp32_to_srgb8_tab4[104] = {
- 0x0073000d, 0x007a000d, 0x0080000d, 0x0087000d, 0x008d000d, 0x0094000d, 0x009a000d, 0x00a1000d,
- 0x00a7001a, 0x00b4001a, 0x00c1001a, 0x00ce001a, 0x00da001a, 0x00e7001a, 0x00f4001a, 0x0101001a,
- 0x010e0033, 0x01280033, 0x01410033, 0x015b0033, 0x01750033, 0x018f0033, 0x01a80033, 0x01c20033,
- 0x01dc0067, 0x020f0067, 0x02430067, 0x02760067, 0x02aa0067, 0x02dd0067, 0x03110067, 0x03440067,
- 0x037800ce, 0x03df00ce, 0x044600ce, 0x04ad00ce, 0x051400ce, 0x057b00c5, 0x05dd00bc, 0x063b00b5,
- 0x06970158, 0x07420142, 0x07e30130, 0x087b0120, 0x090b0112, 0x09940106, 0x0a1700fc, 0x0a9500f2,
- 0x0b0f01cb, 0x0bf401ae, 0x0ccb0195, 0x0d950180, 0x0e56016e, 0x0f0d015e, 0x0fbc0150, 0x10630143,
- 0x11070264, 0x1238023e, 0x1357021d, 0x14660201, 0x156601e9, 0x165a01d3, 0x174401c0, 0x182401af,
- 0x18fe0331, 0x1a9602fe, 0x1c1502d2, 0x1d7e02ad, 0x1ed4028d, 0x201a0270, 0x21520256, 0x227d0240,
- 0x239f0443, 0x25c003fe, 0x27bf03c4, 0x29a10392, 0x2b6a0367, 0x2d1d0341, 0x2ebe031f, 0x304d0300,
- 0x31d105b0, 0x34a80555, 0x37520507, 0x39d504c5, 0x3c37048b, 0x3e7c0458, 0x40a8042a, 0x42bd0401,
- 0x44c20798, 0x488e071e, 0x4c1c06b6, 0x4f76065d, 0x52a50610, 0x55ac05cc, 0x5892058f, 0x5b590559,
- 0x5e0c0a23, 0x631c0980, 0x67db08f6, 0x6c55087f, 0x70940818, 0x74a007bd, 0x787d076c, 0x7c330723,
-};
-
-static stbir_uint8 stbir__linear_to_srgb_uchar(float in)
-{
- static const stbir__FP32 almostone = { 0x3f7fffff }; // 1-eps
- static const stbir__FP32 minval = { (127-13) << 23 };
- stbir_uint32 tab,bias,scale,t;
- stbir__FP32 f;
-
- // Clamp to [2^(-13), 1-eps]; these two values map to 0 and 1, respectively.
- // The tests are carefully written so that NaNs map to 0, same as in the reference
- // implementation.
- if (!(in > minval.f)) // written this way to catch NaNs
- in = minval.f;
- if (in > almostone.f)
- in = almostone.f;
-
- // Do the table lookup and unpack bias, scale
- f.f = in;
- tab = fp32_to_srgb8_tab4[(f.u - minval.u) >> 20];
- bias = (tab >> 16) << 9;
- scale = tab & 0xffff;
-
- // Grab next-highest mantissa bits and perform linear interpolation
- t = (f.u >> 12) & 0xff;
- return (unsigned char) ((bias + scale*t) >> 16);
-}
-
-#else
-// sRGB transition values, scaled by 1<<28
-static int stbir__srgb_offset_to_linear_scaled[256] =
-{
- 0, 40738, 122216, 203693, 285170, 366648, 448125, 529603,
- 611080, 692557, 774035, 855852, 942009, 1033024, 1128971, 1229926,
- 1335959, 1447142, 1563542, 1685229, 1812268, 1944725, 2082664, 2226148,
- 2375238, 2529996, 2690481, 2856753, 3028870, 3206888, 3390865, 3580856,
- 3776916, 3979100, 4187460, 4402049, 4622919, 4850123, 5083710, 5323731,
- 5570236, 5823273, 6082892, 6349140, 6622065, 6901714, 7188133, 7481369,
- 7781466, 8088471, 8402427, 8723380, 9051372, 9386448, 9728650, 10078021,
- 10434603, 10798439, 11169569, 11548036, 11933879, 12327139, 12727857, 13136073,
- 13551826, 13975156, 14406100, 14844697, 15290987, 15745007, 16206795, 16676389,
- 17153826, 17639142, 18132374, 18633560, 19142734, 19659934, 20185196, 20718552,
- 21260042, 21809696, 22367554, 22933648, 23508010, 24090680, 24681686, 25281066,
- 25888850, 26505076, 27129772, 27762974, 28404716, 29055026, 29713942, 30381490,
- 31057708, 31742624, 32436272, 33138682, 33849884, 34569912, 35298800, 36036568,
- 36783260, 37538896, 38303512, 39077136, 39859796, 40651528, 41452360, 42262316,
- 43081432, 43909732, 44747252, 45594016, 46450052, 47315392, 48190064, 49074096,
- 49967516, 50870356, 51782636, 52704392, 53635648, 54576432, 55526772, 56486700,
- 57456236, 58435408, 59424248, 60422780, 61431036, 62449032, 63476804, 64514376,
- 65561776, 66619028, 67686160, 68763192, 69850160, 70947088, 72053992, 73170912,
- 74297864, 75434880, 76581976, 77739184, 78906536, 80084040, 81271736, 82469648,
- 83677792, 84896192, 86124888, 87363888, 88613232, 89872928, 91143016, 92423512,
- 93714432, 95015816, 96327688, 97650056, 98982952, 100326408, 101680440, 103045072,
- 104420320, 105806224, 107202800, 108610064, 110028048, 111456776, 112896264, 114346544,
- 115807632, 117279552, 118762328, 120255976, 121760536, 123276016, 124802440, 126339832,
- 127888216, 129447616, 131018048, 132599544, 134192112, 135795792, 137410592, 139036528,
- 140673648, 142321952, 143981456, 145652208, 147334208, 149027488, 150732064, 152447968,
- 154175200, 155913792, 157663776, 159425168, 161197984, 162982240, 164777968, 166585184,
- 168403904, 170234160, 172075968, 173929344, 175794320, 177670896, 179559120, 181458992,
- 183370528, 185293776, 187228736, 189175424, 191133888, 193104112, 195086128, 197079968,
- 199085648, 201103184, 203132592, 205173888, 207227120, 209292272, 211369392, 213458480,
- 215559568, 217672656, 219797792, 221934976, 224084240, 226245600, 228419056, 230604656,
- 232802400, 235012320, 237234432, 239468736, 241715280, 243974080, 246245120, 248528464,
- 250824112, 253132064, 255452368, 257785040, 260130080, 262487520, 264857376, 267239664,
-};
-
-static stbir_uint8 stbir__linear_to_srgb_uchar(float f)
-{
- int x = (int) (f * (1 << 28)); // has headroom so you don't need to clamp
- int v = 0;
- int i;
-
- // Refine the guess with a short binary search.
- i = v + 128; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 64; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 32; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 16; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 8; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 4; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 2; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
- i = v + 1; if (x >= stbir__srgb_offset_to_linear_scaled[i]) v = i;
-
- return (stbir_uint8) v;
-}
-#endif
-
-static float stbir__filter_trapezoid(float x, float scale)
-{
- float halfscale = scale / 2;
- float t = 0.5f + halfscale;
- STBIR__DEBUG_ASSERT(scale <= 1);
-
- x = (float)fabs(x);
-
- if (x >= t)
- return 0;
- else
- {
- float r = 0.5f - halfscale;
- if (x <= r)
- return 1;
- else
- return (t - x) / scale;
- }
-}
-
-static float stbir__support_trapezoid(float scale)
-{
- STBIR__DEBUG_ASSERT(scale <= 1);
- return 0.5f + scale / 2;
-}
-
-static float stbir__filter_triangle(float x, float s)
-{
- STBIR__UNUSED_PARAM(s);
-
- x = (float)fabs(x);
-
- if (x <= 1.0f)
- return 1 - x;
- else
- return 0;
-}
-
-static float stbir__filter_cubic(float x, float s)
-{
- STBIR__UNUSED_PARAM(s);
-
- x = (float)fabs(x);
-
- if (x < 1.0f)
- return (4 + x*x*(3*x - 6))/6;
- else if (x < 2.0f)
- return (8 + x*(-12 + x*(6 - x)))/6;
-
- return (0.0f);
-}
-
-static float stbir__filter_catmullrom(float x, float s)
-{
- STBIR__UNUSED_PARAM(s);
-
- x = (float)fabs(x);
-
- if (x < 1.0f)
- return 1 - x*x*(2.5f - 1.5f*x);
- else if (x < 2.0f)
- return 2 - x*(4 + x*(0.5f*x - 2.5f));
-
- return (0.0f);
-}
-
-static float stbir__filter_mitchell(float x, float s)
-{
- STBIR__UNUSED_PARAM(s);
-
- x = (float)fabs(x);
-
- if (x < 1.0f)
- return (16 + x*x*(21 * x - 36))/18;
- else if (x < 2.0f)
- return (32 + x*(-60 + x*(36 - 7*x)))/18;
-
- return (0.0f);
-}
-
-static float stbir__support_zero(float s)
-{
- STBIR__UNUSED_PARAM(s);
- return 0;
-}
-
-static float stbir__support_one(float s)
-{
- STBIR__UNUSED_PARAM(s);
- return 1;
-}
-
-static float stbir__support_two(float s)
-{
- STBIR__UNUSED_PARAM(s);
- return 2;
-}
-
-static stbir__filter_info stbir__filter_info_table[] = {
- { NULL, stbir__support_zero },
- { stbir__filter_trapezoid, stbir__support_trapezoid },
- { stbir__filter_triangle, stbir__support_one },
- { stbir__filter_cubic, stbir__support_two },
- { stbir__filter_catmullrom, stbir__support_two },
- { stbir__filter_mitchell, stbir__support_two },
-};
-
-stbir__inline static int stbir__use_upsampling(float ratio)
-{
- return ratio > 1;
-}
-
-stbir__inline static int stbir__use_width_upsampling(stbir__info* stbir_info)
-{
- return stbir__use_upsampling(stbir_info->horizontal_scale);
-}
-
-stbir__inline static int stbir__use_height_upsampling(stbir__info* stbir_info)
-{
- return stbir__use_upsampling(stbir_info->vertical_scale);
-}
-
-// This is the maximum number of input samples that can affect an output sample
-// with the given filter
-static int stbir__get_filter_pixel_width(stbir_filter filter, float scale)
-{
- STBIR_ASSERT(filter != 0);
- STBIR_ASSERT(filter < STBIR__ARRAY_SIZE(stbir__filter_info_table));
-
- if (stbir__use_upsampling(scale))
- return (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2);
- else
- return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2 / scale);
-}
-
-// This is how much to expand buffers to account for filters seeking outside
-// the image boundaries.
-static int stbir__get_filter_pixel_margin(stbir_filter filter, float scale)
-{
- return stbir__get_filter_pixel_width(filter, scale) / 2;
-}
-
-static int stbir__get_coefficient_width(stbir_filter filter, float scale)
-{
- if (stbir__use_upsampling(scale))
- return (int)ceil(stbir__filter_info_table[filter].support(1 / scale) * 2);
- else
- return (int)ceil(stbir__filter_info_table[filter].support(scale) * 2);
-}
-
-static int stbir__get_contributors(float scale, stbir_filter filter, int input_size, int output_size)
-{
- if (stbir__use_upsampling(scale))
- return output_size;
- else
- return (input_size + stbir__get_filter_pixel_margin(filter, scale) * 2);
-}
-
-static int stbir__get_total_horizontal_coefficients(stbir__info* info)
-{
- return info->horizontal_num_contributors
- * stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale);
-}
-
-static int stbir__get_total_vertical_coefficients(stbir__info* info)
-{
- return info->vertical_num_contributors
- * stbir__get_coefficient_width (info->vertical_filter, info->vertical_scale);
-}
-
-static stbir__contributors* stbir__get_contributor(stbir__contributors* contributors, int n)
-{
- return &contributors[n];
-}
-
-// For perf reasons this code is duplicated in stbir__resample_horizontal_upsample/downsample,
-// if you change it here change it there too.
-static float* stbir__get_coefficient(float* coefficients, stbir_filter filter, float scale, int n, int c)
-{
- int width = stbir__get_coefficient_width(filter, scale);
- return &coefficients[width*n + c];
-}
-
-static int stbir__edge_wrap_slow(stbir_edge edge, int n, int max)
-{
- switch (edge)
- {
- case STBIR_EDGE_ZERO:
- return 0; // we'll decode the wrong pixel here, and then overwrite with 0s later
-
- case STBIR_EDGE_CLAMP:
- if (n < 0)
- return 0;
-
- if (n >= max)
- return max - 1;
-
- return n; // NOTREACHED
-
- case STBIR_EDGE_REFLECT:
- {
- if (n < 0)
- {
- if (n < max)
- return -n;
- else
- return max - 1;
- }
-
- if (n >= max)
- {
- int max2 = max * 2;
- if (n >= max2)
- return 0;
- else
- return max2 - n - 1;
- }
-
- return n; // NOTREACHED
- }
-
- case STBIR_EDGE_WRAP:
- if (n >= 0)
- return (n % max);
- else
- {
- int m = (-n) % max;
-
- if (m != 0)
- m = max - m;
-
- return (m);
- }
- return n; // NOTREACHED
-
- default:
- STBIR__UNIMPLEMENTED("Unimplemented edge type");
- return 0;
- }
-}
-
-stbir__inline static int stbir__edge_wrap(stbir_edge edge, int n, int max)
-{
- // avoid per-pixel switch
- if (n >= 0 && n < max)
- return n;
- return stbir__edge_wrap_slow(edge, n, max);
-}
-
-// What input pixels contribute to this output pixel?
-static void stbir__calculate_sample_range_upsample(int n, float out_filter_radius, float scale_ratio, float out_shift, int* in_first_pixel, int* in_last_pixel, float* in_center_of_out)
-{
- float out_pixel_center = (float)n + 0.5f;
- float out_pixel_influence_lowerbound = out_pixel_center - out_filter_radius;
- float out_pixel_influence_upperbound = out_pixel_center + out_filter_radius;
-
- float in_pixel_influence_lowerbound = (out_pixel_influence_lowerbound + out_shift) / scale_ratio;
- float in_pixel_influence_upperbound = (out_pixel_influence_upperbound + out_shift) / scale_ratio;
-
- *in_center_of_out = (out_pixel_center + out_shift) / scale_ratio;
- *in_first_pixel = (int)(floor(in_pixel_influence_lowerbound + 0.5));
- *in_last_pixel = (int)(floor(in_pixel_influence_upperbound - 0.5));
-}
-
-// What output pixels does this input pixel contribute to?
-static void stbir__calculate_sample_range_downsample(int n, float in_pixels_radius, float scale_ratio, float out_shift, int* out_first_pixel, int* out_last_pixel, float* out_center_of_in)
-{
- float in_pixel_center = (float)n + 0.5f;
- float in_pixel_influence_lowerbound = in_pixel_center - in_pixels_radius;
- float in_pixel_influence_upperbound = in_pixel_center + in_pixels_radius;
-
- float out_pixel_influence_lowerbound = in_pixel_influence_lowerbound * scale_ratio - out_shift;
- float out_pixel_influence_upperbound = in_pixel_influence_upperbound * scale_ratio - out_shift;
-
- *out_center_of_in = in_pixel_center * scale_ratio - out_shift;
- *out_first_pixel = (int)(floor(out_pixel_influence_lowerbound + 0.5));
- *out_last_pixel = (int)(floor(out_pixel_influence_upperbound - 0.5));
-}
-
-static void stbir__calculate_coefficients_upsample(stbir__info* stbir_info, stbir_filter filter, float scale, int in_first_pixel, int in_last_pixel, float in_center_of_out, stbir__contributors* contributor, float* coefficient_group)
-{
- int i;
- float total_filter = 0;
- float filter_scale;
-
- STBIR__DEBUG_ASSERT(in_last_pixel - in_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(1/scale) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical.
-
- contributor->n0 = in_first_pixel;
- contributor->n1 = in_last_pixel;
-
- STBIR__DEBUG_ASSERT(contributor->n1 >= contributor->n0);
-
- for (i = 0; i <= in_last_pixel - in_first_pixel; i++)
- {
- float in_pixel_center = (float)(i + in_first_pixel) + 0.5f;
- coefficient_group[i] = stbir__filter_info_table[filter].kernel(in_center_of_out - in_pixel_center, 1 / scale);
-
- // If the coefficient is zero, skip it. (Don't do the <0 check here, we want the influence of those outside pixels.)
- if (i == 0 && !coefficient_group[i])
- {
- contributor->n0 = ++in_first_pixel;
- i--;
- continue;
- }
-
- total_filter += coefficient_group[i];
- }
-
- STBIR__DEBUG_ASSERT(stbir__filter_info_table[filter].kernel((float)(in_last_pixel + 1) + 0.5f - in_center_of_out, 1/scale) == 0);
-
- STBIR__DEBUG_ASSERT(total_filter > 0.9);
- STBIR__DEBUG_ASSERT(total_filter < 1.1f); // Make sure it's not way off.
-
- // Make sure the sum of all coefficients is 1.
- filter_scale = 1 / total_filter;
-
- for (i = 0; i <= in_last_pixel - in_first_pixel; i++)
- coefficient_group[i] *= filter_scale;
-
- for (i = in_last_pixel - in_first_pixel; i >= 0; i--)
- {
- if (coefficient_group[i])
- break;
-
- // This line has no weight. We can skip it.
- contributor->n1 = contributor->n0 + i - 1;
- }
-}
-
-static void stbir__calculate_coefficients_downsample(stbir__info* stbir_info, stbir_filter filter, float scale_ratio, int out_first_pixel, int out_last_pixel, float out_center_of_in, stbir__contributors* contributor, float* coefficient_group)
-{
- int i;
-
- STBIR__DEBUG_ASSERT(out_last_pixel - out_first_pixel <= (int)ceil(stbir__filter_info_table[filter].support(scale_ratio) * 2)); // Taken directly from stbir__get_coefficient_width() which we can't call because we don't know if we're horizontal or vertical.
-
- contributor->n0 = out_first_pixel;
- contributor->n1 = out_last_pixel;
-
- STBIR__DEBUG_ASSERT(contributor->n1 >= contributor->n0);
-
- for (i = 0; i <= out_last_pixel - out_first_pixel; i++)
- {
- float out_pixel_center = (float)(i + out_first_pixel) + 0.5f;
- float x = out_pixel_center - out_center_of_in;
- coefficient_group[i] = stbir__filter_info_table[filter].kernel(x, scale_ratio) * scale_ratio;
- }
-
- STBIR__DEBUG_ASSERT(stbir__filter_info_table[filter].kernel((float)(out_last_pixel + 1) + 0.5f - out_center_of_in, scale_ratio) == 0);
-
- for (i = out_last_pixel - out_first_pixel; i >= 0; i--)
- {
- if (coefficient_group[i])
- break;
-
- // This line has no weight. We can skip it.
- contributor->n1 = contributor->n0 + i - 1;
- }
-}
-
-static void stbir__normalize_downsample_coefficients(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size)
-{
- int num_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size);
- int num_coefficients = stbir__get_coefficient_width(filter, scale_ratio);
- int i, j;
- int skip;
-
- for (i = 0; i < output_size; i++)
- {
- float scale;
- float total = 0;
-
- for (j = 0; j < num_contributors; j++)
- {
- if (i >= contributors[j].n0 && i <= contributors[j].n1)
- {
- float coefficient = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0);
- total += coefficient;
- }
- else if (i < contributors[j].n0)
- break;
- }
-
- STBIR__DEBUG_ASSERT(total > 0.9f);
- STBIR__DEBUG_ASSERT(total < 1.1f);
-
- scale = 1 / total;
-
- for (j = 0; j < num_contributors; j++)
- {
- if (i >= contributors[j].n0 && i <= contributors[j].n1)
- *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i - contributors[j].n0) *= scale;
- else if (i < contributors[j].n0)
- break;
- }
- }
-
- // Optimize: Skip zero coefficients and contributions outside of image bounds.
- // Do this after normalizing because normalization depends on the n0/n1 values.
- for (j = 0; j < num_contributors; j++)
- {
- int range, max, width;
-
- skip = 0;
- while (*stbir__get_coefficient(coefficients, filter, scale_ratio, j, skip) == 0)
- skip++;
-
- contributors[j].n0 += skip;
-
- while (contributors[j].n0 < 0)
- {
- contributors[j].n0++;
- skip++;
- }
-
- range = contributors[j].n1 - contributors[j].n0 + 1;
- max = stbir__min(num_coefficients, range);
-
- width = stbir__get_coefficient_width(filter, scale_ratio);
- for (i = 0; i < max; i++)
- {
- if (i + skip >= width)
- break;
-
- *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i) = *stbir__get_coefficient(coefficients, filter, scale_ratio, j, i + skip);
- }
-
- continue;
- }
-
- // Using min to avoid writing into invalid pixels.
- for (i = 0; i < num_contributors; i++)
- contributors[i].n1 = stbir__min(contributors[i].n1, output_size - 1);
-}
-
-// Each scan line uses the same kernel values so we should calculate the kernel
-// values once and then we can use them for every scan line.
-static void stbir__calculate_filters(stbir__info* stbir_info, stbir__contributors* contributors, float* coefficients, stbir_filter filter, float scale_ratio, float shift, int input_size, int output_size)
-{
- int n;
- int total_contributors = stbir__get_contributors(scale_ratio, filter, input_size, output_size);
-
- if (stbir__use_upsampling(scale_ratio))
- {
- float out_pixels_radius = stbir__filter_info_table[filter].support(1 / scale_ratio) * scale_ratio;
-
- // Looping through out pixels
- for (n = 0; n < total_contributors; n++)
- {
- float in_center_of_out; // Center of the current out pixel in the in pixel space
- int in_first_pixel, in_last_pixel;
-
- stbir__calculate_sample_range_upsample(n, out_pixels_radius, scale_ratio, shift, &in_first_pixel, &in_last_pixel, &in_center_of_out);
-
- stbir__calculate_coefficients_upsample(stbir_info, filter, scale_ratio, in_first_pixel, in_last_pixel, in_center_of_out, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0));
- }
- }
- else
- {
- float in_pixels_radius = stbir__filter_info_table[filter].support(scale_ratio) / scale_ratio;
-
- // Looping through in pixels
- for (n = 0; n < total_contributors; n++)
- {
- float out_center_of_in; // Center of the current out pixel in the in pixel space
- int out_first_pixel, out_last_pixel;
- int n_adjusted = n - stbir__get_filter_pixel_margin(filter, scale_ratio);
-
- stbir__calculate_sample_range_downsample(n_adjusted, in_pixels_radius, scale_ratio, shift, &out_first_pixel, &out_last_pixel, &out_center_of_in);
-
- stbir__calculate_coefficients_downsample(stbir_info, filter, scale_ratio, out_first_pixel, out_last_pixel, out_center_of_in, stbir__get_contributor(contributors, n), stbir__get_coefficient(coefficients, filter, scale_ratio, n, 0));
- }
-
- stbir__normalize_downsample_coefficients(stbir_info, contributors, coefficients, filter, scale_ratio, shift, input_size, output_size);
- }
-}
-
-static float* stbir__get_decode_buffer(stbir__info* stbir_info)
-{
- // The 0 index of the decode buffer starts after the margin. This makes
- // it okay to use negative indexes on the decode buffer.
- return &stbir_info->decode_buffer[stbir_info->horizontal_filter_pixel_margin * stbir_info->channels];
-}
-
-#define STBIR__DECODE(type, colorspace) ((type) * (STBIR_MAX_COLORSPACES) + (colorspace))
-
-static void stbir__decode_scanline(stbir__info* stbir_info, int n)
-{
- int c;
- int channels = stbir_info->channels;
- int alpha_channel = stbir_info->alpha_channel;
- int type = stbir_info->type;
- int colorspace = stbir_info->colorspace;
- int input_w = stbir_info->input_w;
- int input_stride_bytes = stbir_info->input_stride_bytes;
- float* decode_buffer = stbir__get_decode_buffer(stbir_info);
- stbir_edge edge_horizontal = stbir_info->edge_horizontal;
- stbir_edge edge_vertical = stbir_info->edge_vertical;
- int in_buffer_row_offset = stbir__edge_wrap(edge_vertical, n, stbir_info->input_h) * input_stride_bytes;
- const void* input_data = (char *) stbir_info->input_data + in_buffer_row_offset;
- int max_x = input_w + stbir_info->horizontal_filter_pixel_margin;
- int decode = STBIR__DECODE(type, colorspace);
-
- int x = -stbir_info->horizontal_filter_pixel_margin;
-
- // special handling for STBIR_EDGE_ZERO because it needs to return an item that doesn't appear in the input,
- // and we want to avoid paying overhead on every pixel if not STBIR_EDGE_ZERO
- if (edge_vertical == STBIR_EDGE_ZERO && (n < 0 || n >= stbir_info->input_h))
- {
- for (; x < max_x; x++)
- for (c = 0; c < channels; c++)
- decode_buffer[x*channels + c] = 0;
- return;
- }
-
- switch (decode)
- {
- case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = ((float)((const unsigned char*)input_data)[input_pixel_index + c]) / 255;
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = stbir__srgb_uchar_to_linear_float[((const unsigned char*)input_data)[input_pixel_index + c]];
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned char*)input_data)[input_pixel_index + alpha_channel]) / 255;
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = ((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535;
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((float)((const unsigned short*)input_data)[input_pixel_index + c]) / 65535);
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- decode_buffer[decode_pixel_index + alpha_channel] = ((float)((const unsigned short*)input_data)[input_pixel_index + alpha_channel]) / 65535;
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295);
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear((float)(((double)((const unsigned int*)input_data)[input_pixel_index + c]) / 4294967295));
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- decode_buffer[decode_pixel_index + alpha_channel] = (float)(((double)((const unsigned int*)input_data)[input_pixel_index + alpha_channel]) / 4294967295);
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = ((const float*)input_data)[input_pixel_index + c];
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB):
- for (; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
- int input_pixel_index = stbir__edge_wrap(edge_horizontal, x, input_w) * channels;
- for (c = 0; c < channels; c++)
- decode_buffer[decode_pixel_index + c] = stbir__srgb_to_linear(((const float*)input_data)[input_pixel_index + c]);
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- decode_buffer[decode_pixel_index + alpha_channel] = ((const float*)input_data)[input_pixel_index + alpha_channel];
- }
-
- break;
-
- default:
- STBIR__UNIMPLEMENTED("Unknown type/colorspace/channels combination.");
- break;
- }
-
- if (!(stbir_info->flags & STBIR_FLAG_ALPHA_PREMULTIPLIED))
- {
- for (x = -stbir_info->horizontal_filter_pixel_margin; x < max_x; x++)
- {
- int decode_pixel_index = x * channels;
-
- // If the alpha value is 0 it will clobber the color values. Make sure it's not.
- float alpha = decode_buffer[decode_pixel_index + alpha_channel];
-#ifndef STBIR_NO_ALPHA_EPSILON
- if (stbir_info->type != STBIR_TYPE_FLOAT) {
- alpha += STBIR_ALPHA_EPSILON;
- decode_buffer[decode_pixel_index + alpha_channel] = alpha;
- }
-#endif
- for (c = 0; c < channels; c++)
- {
- if (c == alpha_channel)
- continue;
-
- decode_buffer[decode_pixel_index + c] *= alpha;
- }
- }
- }
-
- if (edge_horizontal == STBIR_EDGE_ZERO)
- {
- for (x = -stbir_info->horizontal_filter_pixel_margin; x < 0; x++)
- {
- for (c = 0; c < channels; c++)
- decode_buffer[x*channels + c] = 0;
- }
- for (x = input_w; x < max_x; x++)
- {
- for (c = 0; c < channels; c++)
- decode_buffer[x*channels + c] = 0;
- }
- }
-}
-
-static float* stbir__get_ring_buffer_entry(float* ring_buffer, int index, int ring_buffer_length)
-{
- return &ring_buffer[index * ring_buffer_length];
-}
-
-static float* stbir__add_empty_ring_buffer_entry(stbir__info* stbir_info, int n)
-{
- int ring_buffer_index;
- float* ring_buffer;
-
- if (stbir_info->ring_buffer_begin_index < 0)
- {
- ring_buffer_index = stbir_info->ring_buffer_begin_index = 0;
- stbir_info->ring_buffer_first_scanline = n;
- }
- else
- {
- ring_buffer_index = (stbir_info->ring_buffer_begin_index + (stbir_info->ring_buffer_last_scanline - stbir_info->ring_buffer_first_scanline) + 1) % stbir_info->vertical_filter_pixel_width;
- STBIR__DEBUG_ASSERT(ring_buffer_index != stbir_info->ring_buffer_begin_index);
- }
-
- ring_buffer = stbir__get_ring_buffer_entry(stbir_info->ring_buffer, ring_buffer_index, stbir_info->ring_buffer_length_bytes / sizeof(float));
- memset(ring_buffer, 0, stbir_info->ring_buffer_length_bytes);
-
- stbir_info->ring_buffer_last_scanline = n;
-
- return ring_buffer;
-}
-
-
-static void stbir__resample_horizontal_upsample(stbir__info* stbir_info, int n, float* output_buffer)
-{
- int x, k;
- int output_w = stbir_info->output_w;
- int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width;
- int channels = stbir_info->channels;
- float* decode_buffer = stbir__get_decode_buffer(stbir_info);
- stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors;
- float* horizontal_coefficients = stbir_info->horizontal_coefficients;
- int coefficient_width = stbir_info->horizontal_coefficient_width;
-
- for (x = 0; x < output_w; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int out_pixel_index = x * channels;
- int coefficient_group = coefficient_width * x;
- int coefficient_counter = 0;
-
- STBIR__DEBUG_ASSERT(n1 >= n0);
- STBIR__DEBUG_ASSERT(n0 >= -stbir_info->horizontal_filter_pixel_margin);
- STBIR__DEBUG_ASSERT(n1 >= -stbir_info->horizontal_filter_pixel_margin);
- STBIR__DEBUG_ASSERT(n0 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin);
- STBIR__DEBUG_ASSERT(n1 < stbir_info->input_w + stbir_info->horizontal_filter_pixel_margin);
-
- switch (channels) {
- case 1:
- for (k = n0; k <= n1; k++)
- {
- int in_pixel_index = k * 1;
- float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- }
- break;
- case 2:
- for (k = n0; k <= n1; k++)
- {
- int in_pixel_index = k * 2;
- float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- }
- break;
- case 3:
- for (k = n0; k <= n1; k++)
- {
- int in_pixel_index = k * 3;
- float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
- }
- break;
- case 4:
- for (k = n0; k <= n1; k++)
- {
- int in_pixel_index = k * 4;
- float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
- output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient;
- }
- break;
- default:
- for (k = n0; k <= n1; k++)
- {
- int in_pixel_index = k * channels;
- float coefficient = horizontal_coefficients[coefficient_group + coefficient_counter++];
- int c;
- STBIR__DEBUG_ASSERT(coefficient != 0);
- for (c = 0; c < channels; c++)
- output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient;
- }
- break;
- }
- }
-}
-
-static void stbir__resample_horizontal_downsample(stbir__info* stbir_info, int n, float* output_buffer)
-{
- int x, k;
- int input_w = stbir_info->input_w;
- int output_w = stbir_info->output_w;
- int kernel_pixel_width = stbir_info->horizontal_filter_pixel_width;
- int channels = stbir_info->channels;
- float* decode_buffer = stbir__get_decode_buffer(stbir_info);
- stbir__contributors* horizontal_contributors = stbir_info->horizontal_contributors;
- float* horizontal_coefficients = stbir_info->horizontal_coefficients;
- int coefficient_width = stbir_info->horizontal_coefficient_width;
- int filter_pixel_margin = stbir_info->horizontal_filter_pixel_margin;
- int max_x = input_w + filter_pixel_margin * 2;
-
- STBIR__DEBUG_ASSERT(!stbir__use_width_upsampling(stbir_info));
-
- switch (channels) {
- case 1:
- for (x = 0; x < max_x; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int in_x = x - filter_pixel_margin;
- int in_pixel_index = in_x * 1;
- int max_n = n1;
- int coefficient_group = coefficient_width * x;
-
- for (k = n0; k <= max_n; k++)
- {
- int out_pixel_index = k * 1;
- float coefficient = horizontal_coefficients[coefficient_group + k - n0];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- }
- }
- break;
-
- case 2:
- for (x = 0; x < max_x; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int in_x = x - filter_pixel_margin;
- int in_pixel_index = in_x * 2;
- int max_n = n1;
- int coefficient_group = coefficient_width * x;
-
- for (k = n0; k <= max_n; k++)
- {
- int out_pixel_index = k * 2;
- float coefficient = horizontal_coefficients[coefficient_group + k - n0];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- }
- }
- break;
-
- case 3:
- for (x = 0; x < max_x; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int in_x = x - filter_pixel_margin;
- int in_pixel_index = in_x * 3;
- int max_n = n1;
- int coefficient_group = coefficient_width * x;
-
- for (k = n0; k <= max_n; k++)
- {
- int out_pixel_index = k * 3;
- float coefficient = horizontal_coefficients[coefficient_group + k - n0];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
- }
- }
- break;
-
- case 4:
- for (x = 0; x < max_x; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int in_x = x - filter_pixel_margin;
- int in_pixel_index = in_x * 4;
- int max_n = n1;
- int coefficient_group = coefficient_width * x;
-
- for (k = n0; k <= max_n; k++)
- {
- int out_pixel_index = k * 4;
- float coefficient = horizontal_coefficients[coefficient_group + k - n0];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- output_buffer[out_pixel_index + 0] += decode_buffer[in_pixel_index + 0] * coefficient;
- output_buffer[out_pixel_index + 1] += decode_buffer[in_pixel_index + 1] * coefficient;
- output_buffer[out_pixel_index + 2] += decode_buffer[in_pixel_index + 2] * coefficient;
- output_buffer[out_pixel_index + 3] += decode_buffer[in_pixel_index + 3] * coefficient;
- }
- }
- break;
-
- default:
- for (x = 0; x < max_x; x++)
- {
- int n0 = horizontal_contributors[x].n0;
- int n1 = horizontal_contributors[x].n1;
-
- int in_x = x - filter_pixel_margin;
- int in_pixel_index = in_x * channels;
- int max_n = n1;
- int coefficient_group = coefficient_width * x;
-
- for (k = n0; k <= max_n; k++)
- {
- int c;
- int out_pixel_index = k * channels;
- float coefficient = horizontal_coefficients[coefficient_group + k - n0];
- STBIR__DEBUG_ASSERT(coefficient != 0);
- for (c = 0; c < channels; c++)
- output_buffer[out_pixel_index + c] += decode_buffer[in_pixel_index + c] * coefficient;
- }
- }
- break;
- }
-}
-
-static void stbir__decode_and_resample_upsample(stbir__info* stbir_info, int n)
-{
- // Decode the nth scanline from the source image into the decode buffer.
- stbir__decode_scanline(stbir_info, n);
-
- // Now resample it into the ring buffer.
- if (stbir__use_width_upsampling(stbir_info))
- stbir__resample_horizontal_upsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n));
- else
- stbir__resample_horizontal_downsample(stbir_info, n, stbir__add_empty_ring_buffer_entry(stbir_info, n));
-
- // Now it's sitting in the ring buffer ready to be used as source for the vertical sampling.
-}
-
-static void stbir__decode_and_resample_downsample(stbir__info* stbir_info, int n)
-{
- // Decode the nth scanline from the source image into the decode buffer.
- stbir__decode_scanline(stbir_info, n);
-
- memset(stbir_info->horizontal_buffer, 0, stbir_info->output_w * stbir_info->channels * sizeof(float));
-
- // Now resample it into the horizontal buffer.
- if (stbir__use_width_upsampling(stbir_info))
- stbir__resample_horizontal_upsample(stbir_info, n, stbir_info->horizontal_buffer);
- else
- stbir__resample_horizontal_downsample(stbir_info, n, stbir_info->horizontal_buffer);
-
- // Now it's sitting in the horizontal buffer ready to be distributed into the ring buffers.
-}
-
-// Get the specified scan line from the ring buffer.
-static float* stbir__get_ring_buffer_scanline(int get_scanline, float* ring_buffer, int begin_index, int first_scanline, int ring_buffer_size, int ring_buffer_length)
-{
- int ring_buffer_index = (begin_index + (get_scanline - first_scanline)) % ring_buffer_size;
- return stbir__get_ring_buffer_entry(ring_buffer, ring_buffer_index, ring_buffer_length);
-}
-
-
-static void stbir__encode_scanline(stbir__info* stbir_info, int num_pixels, void *output_buffer, float *encode_buffer, int channels, int alpha_channel, int decode)
-{
- int x;
- int n;
- int num_nonalpha;
- stbir_uint16 nonalpha[STBIR_MAX_CHANNELS];
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_PREMULTIPLIED))
- {
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- float alpha = encode_buffer[pixel_index + alpha_channel];
- float reciprocal_alpha = alpha ? 1.0f / alpha : 0;
-
- // unrolling this produced a 1% slowdown upscaling a large RGBA linear-space image on my machine - stb
- for (n = 0; n < channels; n++)
- if (n != alpha_channel)
- encode_buffer[pixel_index + n] *= reciprocal_alpha;
-
- // We added in a small epsilon to prevent the color channel from being deleted with zero alpha.
- // Because we only add it for integer types, it will automatically be discarded on integer
- // conversion, so we don't need to subtract it back out (which would be problematic for
- // numeric precision reasons).
- }
- }
-
- // build a table of all channels that need colorspace correction, so
- // we don't perform colorspace correction on channels that don't need it.
- for (x=0, num_nonalpha=0; x < channels; ++x)
- if (x != alpha_channel || (stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE))
- nonalpha[num_nonalpha++] = x;
-
- #define STBIR__ROUND_INT(f) ((int) ((f)+0.5))
- #define STBIR__ROUND_UINT(f) ((stbir_uint32) ((f)+0.5))
-
- #ifdef STBIR__SATURATE_INT
- #define STBIR__ENCODE_LINEAR8(f) stbir__saturate8 (STBIR__ROUND_INT((f) * 255 ))
- #define STBIR__ENCODE_LINEAR16(f) stbir__saturate16(STBIR__ROUND_INT((f) * 65535))
- #else
- #define STBIR__ENCODE_LINEAR8(f) (unsigned char ) STBIR__ROUND_INT(stbir__saturate(f) * 255 )
- #define STBIR__ENCODE_LINEAR16(f) (unsigned short) STBIR__ROUND_INT(stbir__saturate(f) * 65535)
- #endif
-
- switch (decode)
- {
- case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_LINEAR):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < channels; n++)
- {
- int index = pixel_index + n;
- ((unsigned char*)output_buffer)[index] = STBIR__ENCODE_LINEAR8(encode_buffer[index]);
- }
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT8, STBIR_COLORSPACE_SRGB):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < num_nonalpha; n++)
- {
- int index = pixel_index + nonalpha[n];
- ((unsigned char*)output_buffer)[index] = stbir__linear_to_srgb_uchar(encode_buffer[index]);
- }
-
- if (!(stbir_info->flags & STBIR_FLAG_ALPHA_USES_COLORSPACE))
- ((unsigned char *)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR8(encode_buffer[pixel_index+alpha_channel]);
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_LINEAR):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < channels; n++)
- {
- int index = pixel_index + n;
- ((unsigned short*)output_buffer)[index] = STBIR__ENCODE_LINEAR16(encode_buffer[index]);
- }
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT16, STBIR_COLORSPACE_SRGB):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < num_nonalpha; n++)
- {
- int index = pixel_index + nonalpha[n];
- ((unsigned short*)output_buffer)[index] = (unsigned short)STBIR__ROUND_INT(stbir__linear_to_srgb(stbir__saturate(encode_buffer[index])) * 65535);
- }
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- ((unsigned short*)output_buffer)[pixel_index + alpha_channel] = STBIR__ENCODE_LINEAR16(encode_buffer[pixel_index + alpha_channel]);
- }
-
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_LINEAR):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < channels; n++)
- {
- int index = pixel_index + n;
- ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__saturate(encode_buffer[index])) * 4294967295);
- }
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_UINT32, STBIR_COLORSPACE_SRGB):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < num_nonalpha; n++)
- {
- int index = pixel_index + nonalpha[n];
- ((unsigned int*)output_buffer)[index] = (unsigned int)STBIR__ROUND_UINT(((double)stbir__linear_to_srgb(stbir__saturate(encode_buffer[index]))) * 4294967295);
- }
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- ((unsigned int*)output_buffer)[pixel_index + alpha_channel] = (unsigned int)STBIR__ROUND_INT(((double)stbir__saturate(encode_buffer[pixel_index + alpha_channel])) * 4294967295);
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_LINEAR):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < channels; n++)
- {
- int index = pixel_index + n;
- ((float*)output_buffer)[index] = encode_buffer[index];
- }
- }
- break;
-
- case STBIR__DECODE(STBIR_TYPE_FLOAT, STBIR_COLORSPACE_SRGB):
- for (x=0; x < num_pixels; ++x)
- {
- int pixel_index = x*channels;
-
- for (n = 0; n < num_nonalpha; n++)
- {
- int index = pixel_index + nonalpha[n];
- ((float*)output_buffer)[index] = stbir__linear_to_srgb(encode_buffer[index]);
- }
-
- if (!(stbir_info->flags&STBIR_FLAG_ALPHA_USES_COLORSPACE))
- ((float*)output_buffer)[pixel_index + alpha_channel] = encode_buffer[pixel_index + alpha_channel];
- }
- break;
-
- default:
- STBIR__UNIMPLEMENTED("Unknown type/colorspace/channels combination.");
- break;
- }
-}
-
-static void stbir__resample_vertical_upsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out)
-{
- int x, k;
- int output_w = stbir_info->output_w;
- stbir__contributors* vertical_contributors = stbir_info->vertical_contributors;
- float* vertical_coefficients = stbir_info->vertical_coefficients;
- int channels = stbir_info->channels;
- int alpha_channel = stbir_info->alpha_channel;
- int type = stbir_info->type;
- int colorspace = stbir_info->colorspace;
- int kernel_pixel_width = stbir_info->vertical_filter_pixel_width;
- void* output_data = stbir_info->output_data;
- float* encode_buffer = stbir_info->encode_buffer;
- int decode = STBIR__DECODE(type, colorspace);
- int coefficient_width = stbir_info->vertical_coefficient_width;
- int coefficient_counter;
- int contributor = n;
-
- float* ring_buffer = stbir_info->ring_buffer;
- int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index;
- int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline;
- int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline;
- int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float);
-
- int n0,n1, output_row_start;
- int coefficient_group = coefficient_width * contributor;
-
- n0 = vertical_contributors[contributor].n0;
- n1 = vertical_contributors[contributor].n1;
-
- output_row_start = n * stbir_info->output_stride_bytes;
-
- STBIR__DEBUG_ASSERT(stbir__use_height_upsampling(stbir_info));
-
- memset(encode_buffer, 0, output_w * sizeof(float) * channels);
-
- // I tried reblocking this for better cache usage of encode_buffer
- // (using x_outer, k, x_inner), but it lost speed. -- stb
-
- coefficient_counter = 0;
- switch (channels) {
- case 1:
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = coefficient_counter++;
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
- for (x = 0; x < output_w; ++x)
- {
- int in_pixel_index = x * 1;
- encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient;
- }
- }
- break;
- case 2:
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = coefficient_counter++;
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
- for (x = 0; x < output_w; ++x)
- {
- int in_pixel_index = x * 2;
- encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient;
- encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient;
- }
- }
- break;
- case 3:
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = coefficient_counter++;
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
- for (x = 0; x < output_w; ++x)
- {
- int in_pixel_index = x * 3;
- encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient;
- encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient;
- encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient;
- }
- }
- break;
- case 4:
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = coefficient_counter++;
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
- for (x = 0; x < output_w; ++x)
- {
- int in_pixel_index = x * 4;
- encode_buffer[in_pixel_index + 0] += ring_buffer_entry[in_pixel_index + 0] * coefficient;
- encode_buffer[in_pixel_index + 1] += ring_buffer_entry[in_pixel_index + 1] * coefficient;
- encode_buffer[in_pixel_index + 2] += ring_buffer_entry[in_pixel_index + 2] * coefficient;
- encode_buffer[in_pixel_index + 3] += ring_buffer_entry[in_pixel_index + 3] * coefficient;
- }
- }
- break;
- default:
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = coefficient_counter++;
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
- for (x = 0; x < output_w; ++x)
- {
- int in_pixel_index = x * channels;
- int c;
- for (c = 0; c < channels; c++)
- encode_buffer[in_pixel_index + c] += ring_buffer_entry[in_pixel_index + c] * coefficient;
- }
- }
- break;
- }
- stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, encode_buffer, channels, alpha_channel, decode);
-}
-
-static void stbir__resample_vertical_downsample(stbir__info* stbir_info, int n, int in_first_scanline, int in_last_scanline, float in_center_of_out)
-{
- int x, k;
- int output_w = stbir_info->output_w;
- int output_h = stbir_info->output_h;
- stbir__contributors* vertical_contributors = stbir_info->vertical_contributors;
- float* vertical_coefficients = stbir_info->vertical_coefficients;
- int channels = stbir_info->channels;
- int kernel_pixel_width = stbir_info->vertical_filter_pixel_width;
- void* output_data = stbir_info->output_data;
- float* horizontal_buffer = stbir_info->horizontal_buffer;
- int coefficient_width = stbir_info->vertical_coefficient_width;
- int contributor = n + stbir_info->vertical_filter_pixel_margin;
-
- float* ring_buffer = stbir_info->ring_buffer;
- int ring_buffer_begin_index = stbir_info->ring_buffer_begin_index;
- int ring_buffer_first_scanline = stbir_info->ring_buffer_first_scanline;
- int ring_buffer_last_scanline = stbir_info->ring_buffer_last_scanline;
- int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float);
- int n0,n1;
-
- n0 = vertical_contributors[contributor].n0;
- n1 = vertical_contributors[contributor].n1;
-
- STBIR__DEBUG_ASSERT(!stbir__use_height_upsampling(stbir_info));
-
- for (k = n0; k <= n1; k++)
- {
- int coefficient_index = k - n0;
- int coefficient_group = coefficient_width * contributor;
- float coefficient = vertical_coefficients[coefficient_group + coefficient_index];
-
- float* ring_buffer_entry = stbir__get_ring_buffer_scanline(k, ring_buffer, ring_buffer_begin_index, ring_buffer_first_scanline, kernel_pixel_width, ring_buffer_length);
-
- switch (channels) {
- case 1:
- for (x = 0; x < output_w; x++)
- {
- int in_pixel_index = x * 1;
- ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
- }
- break;
- case 2:
- for (x = 0; x < output_w; x++)
- {
- int in_pixel_index = x * 2;
- ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
- ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
- }
- break;
- case 3:
- for (x = 0; x < output_w; x++)
- {
- int in_pixel_index = x * 3;
- ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
- ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
- ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient;
- }
- break;
- case 4:
- for (x = 0; x < output_w; x++)
- {
- int in_pixel_index = x * 4;
- ring_buffer_entry[in_pixel_index + 0] += horizontal_buffer[in_pixel_index + 0] * coefficient;
- ring_buffer_entry[in_pixel_index + 1] += horizontal_buffer[in_pixel_index + 1] * coefficient;
- ring_buffer_entry[in_pixel_index + 2] += horizontal_buffer[in_pixel_index + 2] * coefficient;
- ring_buffer_entry[in_pixel_index + 3] += horizontal_buffer[in_pixel_index + 3] * coefficient;
- }
- break;
- default:
- for (x = 0; x < output_w; x++)
- {
- int in_pixel_index = x * channels;
-
- int c;
- for (c = 0; c < channels; c++)
- ring_buffer_entry[in_pixel_index + c] += horizontal_buffer[in_pixel_index + c] * coefficient;
- }
- break;
- }
- }
-}
-
-static void stbir__buffer_loop_upsample(stbir__info* stbir_info)
-{
- int y;
- float scale_ratio = stbir_info->vertical_scale;
- float out_scanlines_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(1/scale_ratio) * scale_ratio;
-
- STBIR__DEBUG_ASSERT(stbir__use_height_upsampling(stbir_info));
-
- for (y = 0; y < stbir_info->output_h; y++)
- {
- float in_center_of_out = 0; // Center of the current out scanline in the in scanline space
- int in_first_scanline = 0, in_last_scanline = 0;
-
- stbir__calculate_sample_range_upsample(y, out_scanlines_radius, scale_ratio, stbir_info->vertical_shift, &in_first_scanline, &in_last_scanline, &in_center_of_out);
-
- STBIR__DEBUG_ASSERT(in_last_scanline - in_first_scanline <= stbir_info->vertical_filter_pixel_width);
-
- if (stbir_info->ring_buffer_begin_index >= 0)
- {
- // Get rid of whatever we don't need anymore.
- while (in_first_scanline > stbir_info->ring_buffer_first_scanline)
- {
- if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline)
- {
- // We just popped the last scanline off the ring buffer.
- // Reset it to the empty state.
- stbir_info->ring_buffer_begin_index = -1;
- stbir_info->ring_buffer_first_scanline = 0;
- stbir_info->ring_buffer_last_scanline = 0;
- break;
- }
- else
- {
- stbir_info->ring_buffer_first_scanline++;
- stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width;
- }
- }
- }
-
- // Load in new ones.
- if (stbir_info->ring_buffer_begin_index < 0)
- stbir__decode_and_resample_upsample(stbir_info, in_first_scanline);
-
- while (in_last_scanline > stbir_info->ring_buffer_last_scanline)
- stbir__decode_and_resample_upsample(stbir_info, stbir_info->ring_buffer_last_scanline + 1);
-
- // Now all buffers should be ready to write a row of vertical sampling.
- stbir__resample_vertical_upsample(stbir_info, y, in_first_scanline, in_last_scanline, in_center_of_out);
-
- STBIR_PROGRESS_REPORT((float)y / stbir_info->output_h);
- }
-}
-
-static void stbir__empty_ring_buffer(stbir__info* stbir_info, int first_necessary_scanline)
-{
- int output_stride_bytes = stbir_info->output_stride_bytes;
- int channels = stbir_info->channels;
- int alpha_channel = stbir_info->alpha_channel;
- int type = stbir_info->type;
- int colorspace = stbir_info->colorspace;
- int output_w = stbir_info->output_w;
- void* output_data = stbir_info->output_data;
- int decode = STBIR__DECODE(type, colorspace);
-
- float* ring_buffer = stbir_info->ring_buffer;
- int ring_buffer_length = stbir_info->ring_buffer_length_bytes/sizeof(float);
-
- if (stbir_info->ring_buffer_begin_index >= 0)
- {
- // Get rid of whatever we don't need anymore.
- while (first_necessary_scanline > stbir_info->ring_buffer_first_scanline)
- {
- if (stbir_info->ring_buffer_first_scanline >= 0 && stbir_info->ring_buffer_first_scanline < stbir_info->output_h)
- {
- int output_row_start = stbir_info->ring_buffer_first_scanline * output_stride_bytes;
- float* ring_buffer_entry = stbir__get_ring_buffer_entry(ring_buffer, stbir_info->ring_buffer_begin_index, ring_buffer_length);
- stbir__encode_scanline(stbir_info, output_w, (char *) output_data + output_row_start, ring_buffer_entry, channels, alpha_channel, decode);
- STBIR_PROGRESS_REPORT((float)stbir_info->ring_buffer_first_scanline / stbir_info->output_h);
- }
-
- if (stbir_info->ring_buffer_first_scanline == stbir_info->ring_buffer_last_scanline)
- {
- // We just popped the last scanline off the ring buffer.
- // Reset it to the empty state.
- stbir_info->ring_buffer_begin_index = -1;
- stbir_info->ring_buffer_first_scanline = 0;
- stbir_info->ring_buffer_last_scanline = 0;
- break;
- }
- else
- {
- stbir_info->ring_buffer_first_scanline++;
- stbir_info->ring_buffer_begin_index = (stbir_info->ring_buffer_begin_index + 1) % stbir_info->vertical_filter_pixel_width;
- }
- }
- }
-}
-
-static void stbir__buffer_loop_downsample(stbir__info* stbir_info)
-{
- int y;
- float scale_ratio = stbir_info->vertical_scale;
- int output_h = stbir_info->output_h;
- float in_pixels_radius = stbir__filter_info_table[stbir_info->vertical_filter].support(scale_ratio) / scale_ratio;
- int pixel_margin = stbir_info->vertical_filter_pixel_margin;
- int max_y = stbir_info->input_h + pixel_margin;
-
- STBIR__DEBUG_ASSERT(!stbir__use_height_upsampling(stbir_info));
-
- for (y = -pixel_margin; y < max_y; y++)
- {
- float out_center_of_in; // Center of the current out scanline in the in scanline space
- int out_first_scanline, out_last_scanline;
-
- stbir__calculate_sample_range_downsample(y, in_pixels_radius, scale_ratio, stbir_info->vertical_shift, &out_first_scanline, &out_last_scanline, &out_center_of_in);
-
- STBIR__DEBUG_ASSERT(out_last_scanline - out_first_scanline <= stbir_info->vertical_filter_pixel_width);
-
- if (out_last_scanline < 0 || out_first_scanline >= output_h)
- continue;
-
- stbir__empty_ring_buffer(stbir_info, out_first_scanline);
-
- stbir__decode_and_resample_downsample(stbir_info, y);
-
- // Load in new ones.
- if (stbir_info->ring_buffer_begin_index < 0)
- stbir__add_empty_ring_buffer_entry(stbir_info, out_first_scanline);
-
- while (out_last_scanline > stbir_info->ring_buffer_last_scanline)
- stbir__add_empty_ring_buffer_entry(stbir_info, stbir_info->ring_buffer_last_scanline + 1);
-
- // Now the horizontal buffer is ready to write to all ring buffer rows.
- stbir__resample_vertical_downsample(stbir_info, y, out_first_scanline, out_last_scanline, out_center_of_in);
- }
-
- stbir__empty_ring_buffer(stbir_info, stbir_info->output_h);
-}
-
-static void stbir__setup(stbir__info *info, int input_w, int input_h, int output_w, int output_h, int channels)
-{
- info->input_w = input_w;
- info->input_h = input_h;
- info->output_w = output_w;
- info->output_h = output_h;
- info->channels = channels;
-}
-
-static void stbir__calculate_transform(stbir__info *info, float s0, float t0, float s1, float t1, float *transform)
-{
- info->s0 = s0;
- info->t0 = t0;
- info->s1 = s1;
- info->t1 = t1;
-
- if (transform)
- {
- info->horizontal_scale = transform[0];
- info->vertical_scale = transform[1];
- info->horizontal_shift = transform[2];
- info->vertical_shift = transform[3];
- }
- else
- {
- info->horizontal_scale = ((float)info->output_w / info->input_w) / (s1 - s0);
- info->vertical_scale = ((float)info->output_h / info->input_h) / (t1 - t0);
-
- info->horizontal_shift = s0 * info->input_w / (s1 - s0);
- info->vertical_shift = t0 * info->input_h / (t1 - t0);
- }
-}
-
-static void stbir__choose_filter(stbir__info *info, stbir_filter h_filter, stbir_filter v_filter)
-{
- if (h_filter == 0)
- h_filter = stbir__use_upsampling(info->horizontal_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE;
- if (v_filter == 0)
- v_filter = stbir__use_upsampling(info->vertical_scale) ? STBIR_DEFAULT_FILTER_UPSAMPLE : STBIR_DEFAULT_FILTER_DOWNSAMPLE;
- info->horizontal_filter = h_filter;
- info->vertical_filter = v_filter;
-}
-
-static stbir_uint32 stbir__calculate_memory(stbir__info *info)
-{
- int pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale);
- int filter_height = stbir__get_filter_pixel_width(info->vertical_filter, info->vertical_scale);
-
- info->horizontal_num_contributors = stbir__get_contributors(info->horizontal_scale, info->horizontal_filter, info->input_w, info->output_w);
- info->vertical_num_contributors = stbir__get_contributors(info->vertical_scale , info->vertical_filter , info->input_h, info->output_h);
-
- info->horizontal_contributors_size = info->horizontal_num_contributors * sizeof(stbir__contributors);
- info->horizontal_coefficients_size = stbir__get_total_horizontal_coefficients(info) * sizeof(float);
- info->vertical_contributors_size = info->vertical_num_contributors * sizeof(stbir__contributors);
- info->vertical_coefficients_size = stbir__get_total_vertical_coefficients(info) * sizeof(float);
- info->decode_buffer_size = (info->input_w + pixel_margin * 2) * info->channels * sizeof(float);
- info->horizontal_buffer_size = info->output_w * info->channels * sizeof(float);
- info->ring_buffer_size = info->output_w * info->channels * filter_height * sizeof(float);
- info->encode_buffer_size = info->output_w * info->channels * sizeof(float);
-
- STBIR_ASSERT(info->horizontal_filter != 0);
- STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late
- STBIR_ASSERT(info->vertical_filter != 0);
- STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table)); // this now happens too late
-
- if (stbir__use_height_upsampling(info))
- // The horizontal buffer is for when we're downsampling the height and we
- // can't output the result of sampling the decode buffer directly into the
- // ring buffers.
- info->horizontal_buffer_size = 0;
- else
- // The encode buffer is to retain precision in the height upsampling method
- // and isn't used when height downsampling.
- info->encode_buffer_size = 0;
-
- return info->horizontal_contributors_size + info->horizontal_coefficients_size
- + info->vertical_contributors_size + info->vertical_coefficients_size
- + info->decode_buffer_size + info->horizontal_buffer_size
- + info->ring_buffer_size + info->encode_buffer_size;
-}
-
-static int stbir__resize_allocated(stbir__info *info,
- const void* input_data, int input_stride_in_bytes,
- void* output_data, int output_stride_in_bytes,
- int alpha_channel, stbir_uint32 flags, stbir_datatype type,
- stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace,
- void* tempmem, size_t tempmem_size_in_bytes)
-{
- size_t memory_required = stbir__calculate_memory(info);
-
- int width_stride_input = input_stride_in_bytes ? input_stride_in_bytes : info->channels * info->input_w * stbir__type_size[type];
- int width_stride_output = output_stride_in_bytes ? output_stride_in_bytes : info->channels * info->output_w * stbir__type_size[type];
-
-#ifdef STBIR_DEBUG_OVERWRITE_TEST
-#define OVERWRITE_ARRAY_SIZE 8
- unsigned char overwrite_output_before_pre[OVERWRITE_ARRAY_SIZE];
- unsigned char overwrite_tempmem_before_pre[OVERWRITE_ARRAY_SIZE];
- unsigned char overwrite_output_after_pre[OVERWRITE_ARRAY_SIZE];
- unsigned char overwrite_tempmem_after_pre[OVERWRITE_ARRAY_SIZE];
-
- size_t begin_forbidden = width_stride_output * (info->output_h - 1) + info->output_w * info->channels * stbir__type_size[type];
- memcpy(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE);
- memcpy(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE);
- memcpy(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE);
- memcpy(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE);
-#endif
-
- STBIR_ASSERT(info->channels >= 0);
- STBIR_ASSERT(info->channels <= STBIR_MAX_CHANNELS);
-
- if (info->channels < 0 || info->channels > STBIR_MAX_CHANNELS)
- return 0;
-
- STBIR_ASSERT(info->horizontal_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table));
- STBIR_ASSERT(info->vertical_filter < STBIR__ARRAY_SIZE(stbir__filter_info_table));
-
- if (info->horizontal_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table))
- return 0;
- if (info->vertical_filter >= STBIR__ARRAY_SIZE(stbir__filter_info_table))
- return 0;
-
- if (alpha_channel < 0)
- flags |= STBIR_FLAG_ALPHA_USES_COLORSPACE | STBIR_FLAG_ALPHA_PREMULTIPLIED;
-
- if (!(flags&STBIR_FLAG_ALPHA_USES_COLORSPACE) || !(flags&STBIR_FLAG_ALPHA_PREMULTIPLIED))
- STBIR_ASSERT(alpha_channel >= 0 && alpha_channel < info->channels);
-
- if (alpha_channel >= info->channels)
- return 0;
-
- STBIR_ASSERT(tempmem);
-
- if (!tempmem)
- return 0;
-
- STBIR_ASSERT(tempmem_size_in_bytes >= memory_required);
-
- if (tempmem_size_in_bytes < memory_required)
- return 0;
-
- memset(tempmem, 0, tempmem_size_in_bytes);
-
- info->input_data = input_data;
- info->input_stride_bytes = width_stride_input;
-
- info->output_data = output_data;
- info->output_stride_bytes = width_stride_output;
-
- info->alpha_channel = alpha_channel;
- info->flags = flags;
- info->type = type;
- info->edge_horizontal = edge_horizontal;
- info->edge_vertical = edge_vertical;
- info->colorspace = colorspace;
-
- info->horizontal_coefficient_width = stbir__get_coefficient_width (info->horizontal_filter, info->horizontal_scale);
- info->vertical_coefficient_width = stbir__get_coefficient_width (info->vertical_filter , info->vertical_scale );
- info->horizontal_filter_pixel_width = stbir__get_filter_pixel_width (info->horizontal_filter, info->horizontal_scale);
- info->vertical_filter_pixel_width = stbir__get_filter_pixel_width (info->vertical_filter , info->vertical_scale );
- info->horizontal_filter_pixel_margin = stbir__get_filter_pixel_margin(info->horizontal_filter, info->horizontal_scale);
- info->vertical_filter_pixel_margin = stbir__get_filter_pixel_margin(info->vertical_filter , info->vertical_scale );
-
- info->ring_buffer_length_bytes = info->output_w * info->channels * sizeof(float);
- info->decode_buffer_pixels = info->input_w + info->horizontal_filter_pixel_margin * 2;
-
-#define STBIR__NEXT_MEMPTR(current, newtype) (newtype*)(((unsigned char*)current) + current##_size)
-
- info->horizontal_contributors = (stbir__contributors *) tempmem;
- info->horizontal_coefficients = STBIR__NEXT_MEMPTR(info->horizontal_contributors, float);
- info->vertical_contributors = STBIR__NEXT_MEMPTR(info->horizontal_coefficients, stbir__contributors);
- info->vertical_coefficients = STBIR__NEXT_MEMPTR(info->vertical_contributors, float);
- info->decode_buffer = STBIR__NEXT_MEMPTR(info->vertical_coefficients, float);
-
- if (stbir__use_height_upsampling(info))
- {
- info->horizontal_buffer = NULL;
- info->ring_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float);
- info->encode_buffer = STBIR__NEXT_MEMPTR(info->ring_buffer, float);
-
- STBIR__DEBUG_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->encode_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes);
- }
- else
- {
- info->horizontal_buffer = STBIR__NEXT_MEMPTR(info->decode_buffer, float);
- info->ring_buffer = STBIR__NEXT_MEMPTR(info->horizontal_buffer, float);
- info->encode_buffer = NULL;
-
- STBIR__DEBUG_ASSERT((size_t)STBIR__NEXT_MEMPTR(info->ring_buffer, unsigned char) == (size_t)tempmem + tempmem_size_in_bytes);
- }
-
-#undef STBIR__NEXT_MEMPTR
-
- // This signals that the ring buffer is empty
- info->ring_buffer_begin_index = -1;
-
- stbir__calculate_filters(info, info->horizontal_contributors, info->horizontal_coefficients, info->horizontal_filter, info->horizontal_scale, info->horizontal_shift, info->input_w, info->output_w);
- stbir__calculate_filters(info, info->vertical_contributors, info->vertical_coefficients, info->vertical_filter, info->vertical_scale, info->vertical_shift, info->input_h, info->output_h);
-
- STBIR_PROGRESS_REPORT(0);
-
- if (stbir__use_height_upsampling(info))
- stbir__buffer_loop_upsample(info);
- else
- stbir__buffer_loop_downsample(info);
-
- STBIR_PROGRESS_REPORT(1);
-
-#ifdef STBIR_DEBUG_OVERWRITE_TEST
- STBIR__DEBUG_ASSERT(memcmp(overwrite_output_before_pre, &((unsigned char*)output_data)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0);
- STBIR__DEBUG_ASSERT(memcmp(overwrite_output_after_pre, &((unsigned char*)output_data)[begin_forbidden], OVERWRITE_ARRAY_SIZE) == 0);
- STBIR__DEBUG_ASSERT(memcmp(overwrite_tempmem_before_pre, &((unsigned char*)tempmem)[-OVERWRITE_ARRAY_SIZE], OVERWRITE_ARRAY_SIZE) == 0);
- STBIR__DEBUG_ASSERT(memcmp(overwrite_tempmem_after_pre, &((unsigned char*)tempmem)[tempmem_size_in_bytes], OVERWRITE_ARRAY_SIZE) == 0);
-#endif
-
- return 1;
-}
-
-
-static int stbir__resize_arbitrary(
- void *alloc_context,
- const void* input_data, int input_w, int input_h, int input_stride_in_bytes,
- void* output_data, int output_w, int output_h, int output_stride_in_bytes,
- float s0, float t0, float s1, float t1, float *transform,
- int channels, int alpha_channel, stbir_uint32 flags, stbir_datatype type,
- stbir_filter h_filter, stbir_filter v_filter,
- stbir_edge edge_horizontal, stbir_edge edge_vertical, stbir_colorspace colorspace)
-{
- stbir__info info;
- int result;
- size_t memory_required;
- void* extra_memory;
-
- stbir__setup(&info, input_w, input_h, output_w, output_h, channels);
- stbir__calculate_transform(&info, s0,t0,s1,t1,transform);
- stbir__choose_filter(&info, h_filter, v_filter);
- memory_required = stbir__calculate_memory(&info);
- extra_memory = STBIR_MALLOC(memory_required, alloc_context);
-
- if (!extra_memory)
- return 0;
-
- result = stbir__resize_allocated(&info, input_data, input_stride_in_bytes,
- output_data, output_stride_in_bytes,
- alpha_channel, flags, type,
- edge_horizontal, edge_vertical,
- colorspace, extra_memory, memory_required);
-
- STBIR_FREE(extra_memory, alloc_context);
-
- return result;
-}
-
-STBIRDEF int stbir_resize_uint8( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels)
-{
- return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT,
- STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR);
-}
-
-STBIRDEF int stbir_resize_float( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- float *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels)
-{
- return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,-1,0, STBIR_TYPE_FLOAT, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT,
- STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_LINEAR);
-}
-
-STBIRDEF int stbir_resize_uint8_srgb(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags)
-{
- return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT,
- STBIR_EDGE_CLAMP, STBIR_EDGE_CLAMP, STBIR_COLORSPACE_SRGB);
-}
-
-STBIRDEF int stbir_resize_uint8_srgb_edgemode(const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode)
-{
- return stbir__resize_arbitrary(NULL, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, STBIR_FILTER_DEFAULT, STBIR_FILTER_DEFAULT,
- edge_wrap_mode, edge_wrap_mode, STBIR_COLORSPACE_SRGB);
-}
-
-STBIRDEF int stbir_resize_uint8_generic( const unsigned char *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- unsigned char *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context)
-{
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT8, filter, filter,
- edge_wrap_mode, edge_wrap_mode, space);
-}
-
-STBIRDEF int stbir_resize_uint16_generic(const stbir_uint16 *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- stbir_uint16 *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context)
-{
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_UINT16, filter, filter,
- edge_wrap_mode, edge_wrap_mode, space);
-}
-
-
-STBIRDEF int stbir_resize_float_generic( const float *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- float *output_pixels , int output_w, int output_h, int output_stride_in_bytes,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_wrap_mode, stbir_filter filter, stbir_colorspace space,
- void *alloc_context)
-{
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, STBIR_TYPE_FLOAT, filter, filter,
- edge_wrap_mode, edge_wrap_mode, space);
-}
-
-
-STBIRDEF int stbir_resize( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context)
-{
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical,
- edge_mode_horizontal, edge_mode_vertical, space);
-}
-
-
-STBIRDEF int stbir_resize_subpixel(const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context,
- float x_scale, float y_scale,
- float x_offset, float y_offset)
-{
- float transform[4];
- transform[0] = x_scale;
- transform[1] = y_scale;
- transform[2] = x_offset;
- transform[3] = y_offset;
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- 0,0,1,1,transform,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical,
- edge_mode_horizontal, edge_mode_vertical, space);
-}
-
-STBIRDEF int stbir_resize_region( const void *input_pixels , int input_w , int input_h , int input_stride_in_bytes,
- void *output_pixels, int output_w, int output_h, int output_stride_in_bytes,
- stbir_datatype datatype,
- int num_channels, int alpha_channel, int flags,
- stbir_edge edge_mode_horizontal, stbir_edge edge_mode_vertical,
- stbir_filter filter_horizontal, stbir_filter filter_vertical,
- stbir_colorspace space, void *alloc_context,
- float s0, float t0, float s1, float t1)
-{
- return stbir__resize_arbitrary(alloc_context, input_pixels, input_w, input_h, input_stride_in_bytes,
- output_pixels, output_w, output_h, output_stride_in_bytes,
- s0,t0,s1,t1,NULL,num_channels,alpha_channel,flags, datatype, filter_horizontal, filter_vertical,
- edge_mode_horizontal, edge_mode_vertical, space);
-}
-
-#endif // STB_IMAGE_RESIZE_IMPLEMENTATION
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_write.h b/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_write.h
deleted file mode 100644
index 4319c0de1d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/common/stb_image_write.h
+++ /dev/null
@@ -1,1048 +0,0 @@
-/* stb_image_write - v1.02 - public domain - http://nothings.org/stb/stb_image_write.h
- writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010-2015
- no warranty implied; use at your own risk
-
- Before #including,
-
- #define STB_IMAGE_WRITE_IMPLEMENTATION
-
- in the file that you want to have the implementation.
-
- Will probably not work correctly with strict-aliasing optimizations.
-
-ABOUT:
-
- This header file is a library for writing images to C stdio. It could be
- adapted to write to memory or a general streaming interface; let me know.
-
- The PNG output is not optimal; it is 20-50% larger than the file
- written by a decent optimizing implementation. This library is designed
- for source code compactness and simplicity, not optimal image file size
- or run-time performance.
-
-BUILDING:
-
- You can #define STBIW_ASSERT(x) before the #include to avoid using assert.h.
- You can #define STBIW_MALLOC(), STBIW_REALLOC(), and STBIW_FREE() to replace
- malloc,realloc,free.
- You can define STBIW_MEMMOVE() to replace memmove()
-
-USAGE:
-
- There are four functions, one for each image file format:
-
- int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
- int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
- int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
- int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data);
-
- There are also four equivalent functions that use an arbitrary write function. You are
- expected to open/close your file-equivalent before and after calling these:
-
- int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes);
- int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
- int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
- int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
-
- where the callback is:
- void stbi_write_func(void *context, void *data, int size);
-
- You can define STBI_WRITE_NO_STDIO to disable the file variant of these
- functions, so the library will not use stdio.h at all. However, this will
- also disable HDR writing, because it requires stdio for formatted output.
-
- Each function returns 0 on failure and non-0 on success.
-
- The functions create an image file defined by the parameters. The image
- is a rectangle of pixels stored from left-to-right, top-to-bottom.
- Each pixel contains 'comp' channels of data stored interleaved with 8-bits
- per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is
- monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall.
- The *data pointer points to the first byte of the top-left-most pixel.
- For PNG, "stride_in_bytes" is the distance in bytes from the first byte of
- a row of pixels to the first byte of the next row of pixels.
-
- PNG creates output files with the same number of components as the input.
- The BMP format expands Y to RGB in the file format and does not
- output alpha.
-
- PNG supports writing rectangles of data even when the bytes storing rows of
- data are not consecutive in memory (e.g. sub-rectangles of a larger image),
- by supplying the stride between the beginning of adjacent rows. The other
- formats do not. (Thus you cannot write a native-format BMP through the BMP
- writer, both because it is in BGR order and because it may have padding
- at the end of the line.)
-
- HDR expects linear float data. Since the format is always 32-bit rgb(e)
- data, alpha (if provided) is discarded, and for monochrome data it is
- replicated across all three channels.
-
- TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed
- data, set the global variable 'stbi_write_tga_with_rle' to 0.
-
-CREDITS:
-
- PNG/BMP/TGA
- Sean Barrett
- HDR
- Baldur Karlsson
- TGA monochrome:
- Jean-Sebastien Guay
- misc enhancements:
- Tim Kelsey
- TGA RLE
- Alan Hickman
- initial file IO callback implementation
- Emmanuel Julien
- bugfixes:
- github:Chribba
- Guillaume Chereau
- github:jry2
- github:romigrou
- Sergio Gonzalez
- Jonas Karlsson
- Filip Wasil
- Thatcher Ulrich
-
-LICENSE
-
-This software is dual-licensed to the public domain and under the following
-license: you are granted a perpetual, irrevocable license to copy, modify,
-publish, and distribute this file as you see fit.
-
-*/
-
-#ifndef INCLUDE_STB_IMAGE_WRITE_H
-#define INCLUDE_STB_IMAGE_WRITE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef STB_IMAGE_WRITE_STATIC
-#define STBIWDEF static
-#else
-#define STBIWDEF extern
-extern int stbi_write_tga_with_rle;
-#endif
-
-#ifndef STBI_WRITE_NO_STDIO
-STBIWDEF int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
-STBIWDEF int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
-STBIWDEF int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
-STBIWDEF int stbi_write_hdr(char const *filename, int w, int h, int comp, const float *data);
-#endif
-
-typedef void stbi_write_func(void *context, void *data, int size);
-
-STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data, int stride_in_bytes);
-STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
-STBIWDEF int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void *data);
-STBIWDEF int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif//INCLUDE_STB_IMAGE_WRITE_H
-
-#ifdef STB_IMAGE_WRITE_IMPLEMENTATION
-
-#ifdef _WIN32
- #ifndef _CRT_SECURE_NO_WARNINGS
- #define _CRT_SECURE_NO_WARNINGS
- #endif
- #ifndef _CRT_NONSTDC_NO_DEPRECATE
- #define _CRT_NONSTDC_NO_DEPRECATE
- #endif
-#endif
-
-#ifndef STBI_WRITE_NO_STDIO
-#include <stdio.h>
-#endif // STBI_WRITE_NO_STDIO
-
-#include <stdarg.h>
-#include <stdlib.h>
-#include <string.h>
-#include <math.h>
-
-#if defined(STBIW_MALLOC) && defined(STBIW_FREE) && (defined(STBIW_REALLOC) || defined(STBIW_REALLOC_SIZED))
-// ok
-#elif !defined(STBIW_MALLOC) && !defined(STBIW_FREE) && !defined(STBIW_REALLOC) && !defined(STBIW_REALLOC_SIZED)
-// ok
-#else
-#error "Must define all or none of STBIW_MALLOC, STBIW_FREE, and STBIW_REALLOC (or STBIW_REALLOC_SIZED)."
-#endif
-
-#ifndef STBIW_MALLOC
-#define STBIW_MALLOC(sz) malloc(sz)
-#define STBIW_REALLOC(p,newsz) realloc(p,newsz)
-#define STBIW_FREE(p) free(p)
-#endif
-
-#ifndef STBIW_REALLOC_SIZED
-#define STBIW_REALLOC_SIZED(p,oldsz,newsz) STBIW_REALLOC(p,newsz)
-#endif
-
-
-#ifndef STBIW_MEMMOVE
-#define STBIW_MEMMOVE(a,b,sz) memmove(a,b,sz)
-#endif
-
-
-#ifndef STBIW_ASSERT
-#include <assert.h>
-#define STBIW_ASSERT(x) assert(x)
-#endif
-
-#define STBIW_UCHAR(x) (unsigned char) ((x) & 0xff)
-
-typedef struct
-{
- stbi_write_func *func;
- void *context;
-} stbi__write_context;
-
-// initialize a callback-based context
-static void stbi__start_write_callbacks(stbi__write_context *s, stbi_write_func *c, void *context)
-{
- s->func = c;
- s->context = context;
-}
-
-#ifndef STBI_WRITE_NO_STDIO
-
-static void stbi__stdio_write(void *context, void *data, int size)
-{
- fwrite(data,1,size,(FILE*) context);
-}
-
-static int stbi__start_write_file(stbi__write_context *s, const char *filename)
-{
- FILE *f = fopen(filename, "wb");
- stbi__start_write_callbacks(s, stbi__stdio_write, (void *) f);
- return f != NULL;
-}
-
-static void stbi__end_write_file(stbi__write_context *s)
-{
- fclose((FILE *)s->context);
-}
-
-#endif // !STBI_WRITE_NO_STDIO
-
-typedef unsigned int stbiw_uint32;
-typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1];
-
-#ifdef STB_IMAGE_WRITE_STATIC
-static int stbi_write_tga_with_rle = 1;
-#else
-int stbi_write_tga_with_rle = 1;
-#endif
-
-static void stbiw__writefv(stbi__write_context *s, const char *fmt, va_list v)
-{
- while (*fmt) {
- switch (*fmt++) {
- case ' ': break;
- case '1': { unsigned char x = STBIW_UCHAR(va_arg(v, int));
- s->func(s->context,&x,1);
- break; }
- case '2': { int x = va_arg(v,int);
- unsigned char b[2];
- b[0] = STBIW_UCHAR(x);
- b[1] = STBIW_UCHAR(x>>8);
- s->func(s->context,b,2);
- break; }
- case '4': { stbiw_uint32 x = va_arg(v,int);
- unsigned char b[4];
- b[0]=STBIW_UCHAR(x);
- b[1]=STBIW_UCHAR(x>>8);
- b[2]=STBIW_UCHAR(x>>16);
- b[3]=STBIW_UCHAR(x>>24);
- s->func(s->context,b,4);
- break; }
- default:
- STBIW_ASSERT(0);
- return;
- }
- }
-}
-
-static void stbiw__writef(stbi__write_context *s, const char *fmt, ...)
-{
- va_list v;
- va_start(v, fmt);
- stbiw__writefv(s, fmt, v);
- va_end(v);
-}
-
-static void stbiw__write3(stbi__write_context *s, unsigned char a, unsigned char b, unsigned char c)
-{
- unsigned char arr[3];
- arr[0] = a, arr[1] = b, arr[2] = c;
- s->func(s->context, arr, 3);
-}
-
-static void stbiw__write_pixel(stbi__write_context *s, int rgb_dir, int comp, int write_alpha, int expand_mono, unsigned char *d)
-{
- unsigned char bg[3] = { 255, 0, 255}, px[3];
- int k;
-
- if (write_alpha < 0)
- s->func(s->context, &d[comp - 1], 1);
-
- switch (comp) {
- case 1:
- s->func(s->context,d,1);
- break;
- case 2:
- if (expand_mono)
- stbiw__write3(s, d[0], d[0], d[0]); // monochrome bmp
- else
- s->func(s->context, d, 1); // monochrome TGA
- break;
- case 4:
- if (!write_alpha) {
- // composite against pink background
- for (k = 0; k < 3; ++k)
- px[k] = bg[k] + ((d[k] - bg[k]) * d[3]) / 255;
- stbiw__write3(s, px[1 - rgb_dir], px[1], px[1 + rgb_dir]);
- break;
- }
- /* FALLTHROUGH */
- case 3:
- stbiw__write3(s, d[1 - rgb_dir], d[1], d[1 + rgb_dir]);
- break;
- }
- if (write_alpha > 0)
- s->func(s->context, &d[comp - 1], 1);
-}
-
-static void stbiw__write_pixels(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad, int expand_mono)
-{
- stbiw_uint32 zero = 0;
- int i,j, j_end;
-
- if (y <= 0)
- return;
-
- if (vdir < 0)
- j_end = -1, j = y-1;
- else
- j_end = y, j = 0;
-
- for (; j != j_end; j += vdir) {
- for (i=0; i < x; ++i) {
- unsigned char *d = (unsigned char *) data + (j*x+i)*comp;
- stbiw__write_pixel(s, rgb_dir, comp, write_alpha, expand_mono, d);
- }
- s->func(s->context, &zero, scanline_pad);
- }
-}
-
-static int stbiw__outfile(stbi__write_context *s, int rgb_dir, int vdir, int x, int y, int comp, int expand_mono, void *data, int alpha, int pad, const char *fmt, ...)
-{
- if (y < 0 || x < 0) {
- return 0;
- } else {
- va_list v;
- va_start(v, fmt);
- stbiw__writefv(s, fmt, v);
- va_end(v);
- stbiw__write_pixels(s,rgb_dir,vdir,x,y,comp,data,alpha,pad, expand_mono);
- return 1;
- }
-}
-
-static int stbi_write_bmp_core(stbi__write_context *s, int x, int y, int comp, const void *data)
-{
- int pad = (-x*3) & 3;
- return stbiw__outfile(s,-1,-1,x,y,comp,1,(void *) data,0,pad,
- "11 4 22 4" "4 44 22 444444",
- 'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
- 40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
-}
-
-STBIWDEF int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
-{
- stbi__write_context s;
- stbi__start_write_callbacks(&s, func, context);
- return stbi_write_bmp_core(&s, x, y, comp, data);
-}
-
-#ifndef STBI_WRITE_NO_STDIO
-STBIWDEF int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
-{
- stbi__write_context s;
- if (stbi__start_write_file(&s,filename)) {
- int r = stbi_write_bmp_core(&s, x, y, comp, data);
- stbi__end_write_file(&s);
- return r;
- } else
- return 0;
-}
-#endif //!STBI_WRITE_NO_STDIO
-
-static int stbi_write_tga_core(stbi__write_context *s, int x, int y, int comp, void *data)
-{
- int has_alpha = (comp == 2 || comp == 4);
- int colorbytes = has_alpha ? comp-1 : comp;
- int format = colorbytes < 2 ? 3 : 2; // 3 color channels (RGB/RGBA) = 2, 1 color channel (Y/YA) = 3
-
- if (y < 0 || x < 0)
- return 0;
-
- if (!stbi_write_tga_with_rle) {
- return stbiw__outfile(s, -1, -1, x, y, comp, 0, (void *) data, has_alpha, 0,
- "111 221 2222 11", 0, 0, format, 0, 0, 0, 0, 0, x, y, (colorbytes + has_alpha) * 8, has_alpha * 8);
- } else {
- int i,j,k;
-
- stbiw__writef(s, "111 221 2222 11", 0,0,format+8, 0,0,0, 0,0,x,y, (colorbytes + has_alpha) * 8, has_alpha * 8);
-
- for (j = y - 1; j >= 0; --j) {
- unsigned char *row = (unsigned char *) data + j * x * comp;
- int len;
-
- for (i = 0; i < x; i += len) {
- unsigned char *begin = row + i * comp;
- int diff = 1;
- len = 1;
-
- if (i < x - 1) {
- ++len;
- diff = memcmp(begin, row + (i + 1) * comp, comp);
- if (diff) {
- const unsigned char *prev = begin;
- for (k = i + 2; k < x && len < 128; ++k) {
- if (memcmp(prev, row + k * comp, comp)) {
- prev += comp;
- ++len;
- } else {
- --len;
- break;
- }
- }
- } else {
- for (k = i + 2; k < x && len < 128; ++k) {
- if (!memcmp(begin, row + k * comp, comp)) {
- ++len;
- } else {
- break;
- }
- }
- }
- }
-
- if (diff) {
- unsigned char header = STBIW_UCHAR(len - 1);
- s->func(s->context, &header, 1);
- for (k = 0; k < len; ++k) {
- stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin + k * comp);
- }
- } else {
- unsigned char header = STBIW_UCHAR(len - 129);
- s->func(s->context, &header, 1);
- stbiw__write_pixel(s, -1, comp, has_alpha, 0, begin);
- }
- }
- }
- }
- return 1;
-}
-
-int stbi_write_tga_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data)
-{
- stbi__write_context s;
- stbi__start_write_callbacks(&s, func, context);
- return stbi_write_tga_core(&s, x, y, comp, (void *) data);
-}
-
-#ifndef STBI_WRITE_NO_STDIO
-int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
-{
- stbi__write_context s;
- if (stbi__start_write_file(&s,filename)) {
- int r = stbi_write_tga_core(&s, x, y, comp, (void *) data);
- stbi__end_write_file(&s);
- return r;
- } else
- return 0;
-}
-#endif
-
-// *************************************************************************************************
-// Radiance RGBE HDR writer
-// by Baldur Karlsson
-#ifndef STBI_WRITE_NO_STDIO
-
-#define stbiw__max(a, b) ((a) > (b) ? (a) : (b))
-
-void stbiw__linear_to_rgbe(unsigned char *rgbe, float *linear)
-{
- int exponent;
- float maxcomp = stbiw__max(linear[0], stbiw__max(linear[1], linear[2]));
-
- if (maxcomp < 1e-32f) {
- rgbe[0] = rgbe[1] = rgbe[2] = rgbe[3] = 0;
- } else {
- float normalize = (float) frexp(maxcomp, &exponent) * 256.0f/maxcomp;
-
- rgbe[0] = (unsigned char)(linear[0] * normalize);
- rgbe[1] = (unsigned char)(linear[1] * normalize);
- rgbe[2] = (unsigned char)(linear[2] * normalize);
- rgbe[3] = (unsigned char)(exponent + 128);
- }
-}
-
-void stbiw__write_run_data(stbi__write_context *s, int length, unsigned char databyte)
-{
- unsigned char lengthbyte = STBIW_UCHAR(length+128);
- STBIW_ASSERT(length+128 <= 255);
- s->func(s->context, &lengthbyte, 1);
- s->func(s->context, &databyte, 1);
-}
-
-void stbiw__write_dump_data(stbi__write_context *s, int length, unsigned char *data)
-{
- unsigned char lengthbyte = STBIW_UCHAR(length);
- STBIW_ASSERT(length <= 128); // inconsistent with spec but consistent with official code
- s->func(s->context, &lengthbyte, 1);
- s->func(s->context, data, length);
-}
-
-void stbiw__write_hdr_scanline(stbi__write_context *s, int width, int ncomp, unsigned char *scratch, float *scanline)
-{
- unsigned char scanlineheader[4] = { 2, 2, 0, 0 };
- unsigned char rgbe[4];
- float linear[3];
- int x;
-
- scanlineheader[2] = (width&0xff00)>>8;
- scanlineheader[3] = (width&0x00ff);
-
- /* skip RLE for images too small or large */
- if (width < 8 || width >= 32768) {
- for (x=0; x < width; x++) {
- switch (ncomp) {
- case 4: /* fallthrough */
- case 3: linear[2] = scanline[x*ncomp + 2];
- linear[1] = scanline[x*ncomp + 1];
- linear[0] = scanline[x*ncomp + 0];
- break;
- default:
- linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0];
- break;
- }
- stbiw__linear_to_rgbe(rgbe, linear);
- s->func(s->context, rgbe, 4);
- }
- } else {
- int c,r;
- /* encode into scratch buffer */
- for (x=0; x < width; x++) {
- switch(ncomp) {
- case 4: /* fallthrough */
- case 3: linear[2] = scanline[x*ncomp + 2];
- linear[1] = scanline[x*ncomp + 1];
- linear[0] = scanline[x*ncomp + 0];
- break;
- default:
- linear[0] = linear[1] = linear[2] = scanline[x*ncomp + 0];
- break;
- }
- stbiw__linear_to_rgbe(rgbe, linear);
- scratch[x + width*0] = rgbe[0];
- scratch[x + width*1] = rgbe[1];
- scratch[x + width*2] = rgbe[2];
- scratch[x + width*3] = rgbe[3];
- }
-
- s->func(s->context, scanlineheader, 4);
-
- /* RLE each component separately */
- for (c=0; c < 4; c++) {
- unsigned char *comp = &scratch[width*c];
-
- x = 0;
- while (x < width) {
- // find first run
- r = x;
- while (r+2 < width) {
- if (comp[r] == comp[r+1] && comp[r] == comp[r+2])
- break;
- ++r;
- }
- if (r+2 >= width)
- r = width;
- // dump up to first run
- while (x < r) {
- int len = r-x;
- if (len > 128) len = 128;
- stbiw__write_dump_data(s, len, &comp[x]);
- x += len;
- }
- // if there's a run, output it
- if (r+2 < width) { // same test as what we break out of in search loop, so only true if we break'd
- // find next byte after run
- while (r < width && comp[r] == comp[x])
- ++r;
- // output run up to r
- while (x < r) {
- int len = r-x;
- if (len > 127) len = 127;
- stbiw__write_run_data(s, len, comp[x]);
- x += len;
- }
- }
- }
- }
- }
-}
-
-static int stbi_write_hdr_core(stbi__write_context *s, int x, int y, int comp, float *data)
-{
- if (y <= 0 || x <= 0 || data == NULL)
- return 0;
- else {
- // Each component is stored separately. Allocate scratch space for full output scanline.
- unsigned char *scratch = (unsigned char *) STBIW_MALLOC(x*4);
- int i, len;
- char buffer[128];
- char header[] = "#?RADIANCE\n# Written by stb_image_write.h\nFORMAT=32-bit_rle_rgbe\n";
- s->func(s->context, header, sizeof(header)-1);
-
- len = sprintf(buffer, "EXPOSURE= 1.0000000000000\n\n-Y %d +X %d\n", y, x);
- s->func(s->context, buffer, len);
-
- for(i=0; i < y; i++)
- stbiw__write_hdr_scanline(s, x, comp, scratch, data + comp*i*x);
- STBIW_FREE(scratch);
- return 1;
- }
-}
-
-int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const float *data)
-{
- stbi__write_context s;
- stbi__start_write_callbacks(&s, func, context);
- return stbi_write_hdr_core(&s, x, y, comp, (float *) data);
-}
-
-int stbi_write_hdr(char const *filename, int x, int y, int comp, const float *data)
-{
- stbi__write_context s;
- if (stbi__start_write_file(&s,filename)) {
- int r = stbi_write_hdr_core(&s, x, y, comp, (float *) data);
- stbi__end_write_file(&s);
- return r;
- } else
- return 0;
-}
-#endif // STBI_WRITE_NO_STDIO
-
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// PNG writer
-//
-
-// stretchy buffer; stbiw__sbpush() == vector<>::push_back() -- stbiw__sbcount() == vector<>::size()
-#define stbiw__sbraw(a) ((int *) (a) - 2)
-#define stbiw__sbm(a) stbiw__sbraw(a)[0]
-#define stbiw__sbn(a) stbiw__sbraw(a)[1]
-
-#define stbiw__sbneedgrow(a,n) ((a)==0 || stbiw__sbn(a)+n >= stbiw__sbm(a))
-#define stbiw__sbmaybegrow(a,n) (stbiw__sbneedgrow(a,(n)) ? stbiw__sbgrow(a,n) : 0)
-#define stbiw__sbgrow(a,n) stbiw__sbgrowf((void **) &(a), (n), sizeof(*(a)))
-
-#define stbiw__sbpush(a, v) (stbiw__sbmaybegrow(a,1), (a)[stbiw__sbn(a)++] = (v))
-#define stbiw__sbcount(a) ((a) ? stbiw__sbn(a) : 0)
-#define stbiw__sbfree(a) ((a) ? STBIW_FREE(stbiw__sbraw(a)),0 : 0)
-
-static void *stbiw__sbgrowf(void **arr, int increment, int itemsize)
-{
- int m = *arr ? 2*stbiw__sbm(*arr)+increment : increment+1;
- void *p = STBIW_REALLOC_SIZED(*arr ? stbiw__sbraw(*arr) : 0, *arr ? (stbiw__sbm(*arr)*itemsize + sizeof(int)*2) : 0, itemsize * m + sizeof(int)*2);
- STBIW_ASSERT(p);
- if (p) {
- if (!*arr) ((int *) p)[1] = 0;
- *arr = (void *) ((int *) p + 2);
- stbiw__sbm(*arr) = m;
- }
- return *arr;
-}
-
-static unsigned char *stbiw__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
-{
- while (*bitcount >= 8) {
- stbiw__sbpush(data, STBIW_UCHAR(*bitbuffer));
- *bitbuffer >>= 8;
- *bitcount -= 8;
- }
- return data;
-}
-
-static int stbiw__zlib_bitrev(int code, int codebits)
-{
- int res=0;
- while (codebits--) {
- res = (res << 1) | (code & 1);
- code >>= 1;
- }
- return res;
-}
-
-static unsigned int stbiw__zlib_countm(unsigned char *a, unsigned char *b, int limit)
-{
- int i;
- for (i=0; i < limit && i < 258; ++i)
- if (a[i] != b[i]) break;
- return i;
-}
-
-static unsigned int stbiw__zhash(unsigned char *data)
-{
- stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16);
- hash ^= hash << 3;
- hash += hash >> 5;
- hash ^= hash << 4;
- hash += hash >> 17;
- hash ^= hash << 25;
- hash += hash >> 6;
- return hash;
-}
-
-#define stbiw__zlib_flush() (out = stbiw__zlib_flushf(out, &bitbuf, &bitcount))
-#define stbiw__zlib_add(code,codebits) \
- (bitbuf |= (code) << bitcount, bitcount += (codebits), stbiw__zlib_flush())
-#define stbiw__zlib_huffa(b,c) stbiw__zlib_add(stbiw__zlib_bitrev(b,c),c)
-// default huffman tables
-#define stbiw__zlib_huff1(n) stbiw__zlib_huffa(0x30 + (n), 8)
-#define stbiw__zlib_huff2(n) stbiw__zlib_huffa(0x190 + (n)-144, 9)
-#define stbiw__zlib_huff3(n) stbiw__zlib_huffa(0 + (n)-256,7)
-#define stbiw__zlib_huff4(n) stbiw__zlib_huffa(0xc0 + (n)-280,8)
-#define stbiw__zlib_huff(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : (n) <= 255 ? stbiw__zlib_huff2(n) : (n) <= 279 ? stbiw__zlib_huff3(n) : stbiw__zlib_huff4(n))
-#define stbiw__zlib_huffb(n) ((n) <= 143 ? stbiw__zlib_huff1(n) : stbiw__zlib_huff2(n))
-
-#define stbiw__ZHASH 16384
-
-unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
-{
- static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
- static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 };
- static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
- static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 };
- unsigned int bitbuf=0;
- int i,j, bitcount=0;
- unsigned char *out = NULL;
- unsigned char ***hash_table = (unsigned char***) STBIW_MALLOC(stbiw__ZHASH * sizeof(char**));
- if (quality < 5) quality = 5;
-
- stbiw__sbpush(out, 0x78); // DEFLATE 32K window
- stbiw__sbpush(out, 0x5e); // FLEVEL = 1
- stbiw__zlib_add(1,1); // BFINAL = 1
- stbiw__zlib_add(1,2); // BTYPE = 1 -- fixed huffman
-
- for (i=0; i < stbiw__ZHASH; ++i)
- hash_table[i] = NULL;
-
- i=0;
- while (i < data_len-3) {
- // hash next 3 bytes of data to be compressed
- int h = stbiw__zhash(data+i)&(stbiw__ZHASH-1), best=3;
- unsigned char *bestloc = 0;
- unsigned char **hlist = hash_table[h];
- int n = stbiw__sbcount(hlist);
- for (j=0; j < n; ++j) {
- if (hlist[j]-data > i-32768) { // if entry lies within window
- int d = stbiw__zlib_countm(hlist[j], data+i, data_len-i);
- if (d >= best) best=d,bestloc=hlist[j];
- }
- }
- // when hash table entry is too long, delete half the entries
- if (hash_table[h] && stbiw__sbn(hash_table[h]) == 2*quality) {
- STBIW_MEMMOVE(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
- stbiw__sbn(hash_table[h]) = quality;
- }
- stbiw__sbpush(hash_table[h],data+i);
-
- if (bestloc) {
- // "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
- h = stbiw__zhash(data+i+1)&(stbiw__ZHASH-1);
- hlist = hash_table[h];
- n = stbiw__sbcount(hlist);
- for (j=0; j < n; ++j) {
- if (hlist[j]-data > i-32767) {
- int e = stbiw__zlib_countm(hlist[j], data+i+1, data_len-i-1);
- if (e > best) { // if next match is better, bail on current match
- bestloc = NULL;
- break;
- }
- }
- }
- }
-
- if (bestloc) {
- int d = (int) (data+i - bestloc); // distance back
- STBIW_ASSERT(d <= 32767 && best <= 258);
- for (j=0; best > lengthc[j+1]-1; ++j);
- stbiw__zlib_huff(j+257);
- if (lengtheb[j]) stbiw__zlib_add(best - lengthc[j], lengtheb[j]);
- for (j=0; d > distc[j+1]-1; ++j);
- stbiw__zlib_add(stbiw__zlib_bitrev(j,5),5);
- if (disteb[j]) stbiw__zlib_add(d - distc[j], disteb[j]);
- i += best;
- } else {
- stbiw__zlib_huffb(data[i]);
- ++i;
- }
- }
- // write out final bytes
- for (;i < data_len; ++i)
- stbiw__zlib_huffb(data[i]);
- stbiw__zlib_huff(256); // end of block
- // pad with 0 bits to byte boundary
- while (bitcount)
- stbiw__zlib_add(0,1);
-
- for (i=0; i < stbiw__ZHASH; ++i)
- (void) stbiw__sbfree(hash_table[i]);
- STBIW_FREE(hash_table);
-
- {
- // compute adler32 on input
- unsigned int s1=1, s2=0;
- int blocklen = (int) (data_len % 5552);
- j=0;
- while (j < data_len) {
- for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1;
- s1 %= 65521, s2 %= 65521;
- j += blocklen;
- blocklen = 5552;
- }
- stbiw__sbpush(out, STBIW_UCHAR(s2 >> 8));
- stbiw__sbpush(out, STBIW_UCHAR(s2));
- stbiw__sbpush(out, STBIW_UCHAR(s1 >> 8));
- stbiw__sbpush(out, STBIW_UCHAR(s1));
- }
- *out_len = stbiw__sbn(out);
- // make returned pointer freeable
- STBIW_MEMMOVE(stbiw__sbraw(out), out, *out_len);
- return (unsigned char *) stbiw__sbraw(out);
-}
-
-static unsigned int stbiw__crc32(unsigned char *buffer, int len)
-{
- static unsigned int crc_table[256] =
- {
- 0x00000000, 0x77073096, 0xEE0E612C, 0x990951BA, 0x076DC419, 0x706AF48F, 0xE963A535, 0x9E6495A3,
- 0x0eDB8832, 0x79DCB8A4, 0xE0D5E91E, 0x97D2D988, 0x09B64C2B, 0x7EB17CBD, 0xE7B82D07, 0x90BF1D91,
- 0x1DB71064, 0x6AB020F2, 0xF3B97148, 0x84BE41DE, 0x1ADAD47D, 0x6DDDE4EB, 0xF4D4B551, 0x83D385C7,
- 0x136C9856, 0x646BA8C0, 0xFD62F97A, 0x8A65C9EC, 0x14015C4F, 0x63066CD9, 0xFA0F3D63, 0x8D080DF5,
- 0x3B6E20C8, 0x4C69105E, 0xD56041E4, 0xA2677172, 0x3C03E4D1, 0x4B04D447, 0xD20D85FD, 0xA50AB56B,
- 0x35B5A8FA, 0x42B2986C, 0xDBBBC9D6, 0xACBCF940, 0x32D86CE3, 0x45DF5C75, 0xDCD60DCF, 0xABD13D59,
- 0x26D930AC, 0x51DE003A, 0xC8D75180, 0xBFD06116, 0x21B4F4B5, 0x56B3C423, 0xCFBA9599, 0xB8BDA50F,
- 0x2802B89E, 0x5F058808, 0xC60CD9B2, 0xB10BE924, 0x2F6F7C87, 0x58684C11, 0xC1611DAB, 0xB6662D3D,
- 0x76DC4190, 0x01DB7106, 0x98D220BC, 0xEFD5102A, 0x71B18589, 0x06B6B51F, 0x9FBFE4A5, 0xE8B8D433,
- 0x7807C9A2, 0x0F00F934, 0x9609A88E, 0xE10E9818, 0x7F6A0DBB, 0x086D3D2D, 0x91646C97, 0xE6635C01,
- 0x6B6B51F4, 0x1C6C6162, 0x856530D8, 0xF262004E, 0x6C0695ED, 0x1B01A57B, 0x8208F4C1, 0xF50FC457,
- 0x65B0D9C6, 0x12B7E950, 0x8BBEB8EA, 0xFCB9887C, 0x62DD1DDF, 0x15DA2D49, 0x8CD37CF3, 0xFBD44C65,
- 0x4DB26158, 0x3AB551CE, 0xA3BC0074, 0xD4BB30E2, 0x4ADFA541, 0x3DD895D7, 0xA4D1C46D, 0xD3D6F4FB,
- 0x4369E96A, 0x346ED9FC, 0xAD678846, 0xDA60B8D0, 0x44042D73, 0x33031DE5, 0xAA0A4C5F, 0xDD0D7CC9,
- 0x5005713C, 0x270241AA, 0xBE0B1010, 0xC90C2086, 0x5768B525, 0x206F85B3, 0xB966D409, 0xCE61E49F,
- 0x5EDEF90E, 0x29D9C998, 0xB0D09822, 0xC7D7A8B4, 0x59B33D17, 0x2EB40D81, 0xB7BD5C3B, 0xC0BA6CAD,
- 0xEDB88320, 0x9ABFB3B6, 0x03B6E20C, 0x74B1D29A, 0xEAD54739, 0x9DD277AF, 0x04DB2615, 0x73DC1683,
- 0xE3630B12, 0x94643B84, 0x0D6D6A3E, 0x7A6A5AA8, 0xE40ECF0B, 0x9309FF9D, 0x0A00AE27, 0x7D079EB1,
- 0xF00F9344, 0x8708A3D2, 0x1E01F268, 0x6906C2FE, 0xF762575D, 0x806567CB, 0x196C3671, 0x6E6B06E7,
- 0xFED41B76, 0x89D32BE0, 0x10DA7A5A, 0x67DD4ACC, 0xF9B9DF6F, 0x8EBEEFF9, 0x17B7BE43, 0x60B08ED5,
- 0xD6D6A3E8, 0xA1D1937E, 0x38D8C2C4, 0x4FDFF252, 0xD1BB67F1, 0xA6BC5767, 0x3FB506DD, 0x48B2364B,
- 0xD80D2BDA, 0xAF0A1B4C, 0x36034AF6, 0x41047A60, 0xDF60EFC3, 0xA867DF55, 0x316E8EEF, 0x4669BE79,
- 0xCB61B38C, 0xBC66831A, 0x256FD2A0, 0x5268E236, 0xCC0C7795, 0xBB0B4703, 0x220216B9, 0x5505262F,
- 0xC5BA3BBE, 0xB2BD0B28, 0x2BB45A92, 0x5CB36A04, 0xC2D7FFA7, 0xB5D0CF31, 0x2CD99E8B, 0x5BDEAE1D,
- 0x9B64C2B0, 0xEC63F226, 0x756AA39C, 0x026D930A, 0x9C0906A9, 0xEB0E363F, 0x72076785, 0x05005713,
- 0x95BF4A82, 0xE2B87A14, 0x7BB12BAE, 0x0CB61B38, 0x92D28E9B, 0xE5D5BE0D, 0x7CDCEFB7, 0x0BDBDF21,
- 0x86D3D2D4, 0xF1D4E242, 0x68DDB3F8, 0x1FDA836E, 0x81BE16CD, 0xF6B9265B, 0x6FB077E1, 0x18B74777,
- 0x88085AE6, 0xFF0F6A70, 0x66063BCA, 0x11010B5C, 0x8F659EFF, 0xF862AE69, 0x616BFFD3, 0x166CCF45,
- 0xA00AE278, 0xD70DD2EE, 0x4E048354, 0x3903B3C2, 0xA7672661, 0xD06016F7, 0x4969474D, 0x3E6E77DB,
- 0xAED16A4A, 0xD9D65ADC, 0x40DF0B66, 0x37D83BF0, 0xA9BCAE53, 0xDEBB9EC5, 0x47B2CF7F, 0x30B5FFE9,
- 0xBDBDF21C, 0xCABAC28A, 0x53B39330, 0x24B4A3A6, 0xBAD03605, 0xCDD70693, 0x54DE5729, 0x23D967BF,
- 0xB3667A2E, 0xC4614AB8, 0x5D681B02, 0x2A6F2B94, 0xB40BBE37, 0xC30C8EA1, 0x5A05DF1B, 0x2D02EF8D
- };
-
- unsigned int crc = ~0u;
- int i;
- for (i=0; i < len; ++i)
- crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];
- return ~crc;
-}
-
-#define stbiw__wpng4(o,a,b,c,d) ((o)[0]=STBIW_UCHAR(a),(o)[1]=STBIW_UCHAR(b),(o)[2]=STBIW_UCHAR(c),(o)[3]=STBIW_UCHAR(d),(o)+=4)
-#define stbiw__wp32(data,v) stbiw__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
-#define stbiw__wptag(data,s) stbiw__wpng4(data, s[0],s[1],s[2],s[3])
-
-static void stbiw__wpcrc(unsigned char **data, int len)
-{
- unsigned int crc = stbiw__crc32(*data - len - 4, len+4);
- stbiw__wp32(*data, crc);
-}
-
-static unsigned char stbiw__paeth(int a, int b, int c)
-{
- int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c);
- if (pa <= pb && pa <= pc) return STBIW_UCHAR(a);
- if (pb <= pc) return STBIW_UCHAR(b);
- return STBIW_UCHAR(c);
-}
-
-unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)
-{
- int ctype[5] = { -1, 0, 4, 2, 6 };
- unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
- unsigned char *out,*o, *filt, *zlib;
- signed char *line_buffer;
- int i,j,k,p,zlen;
-
- if (stride_bytes == 0)
- stride_bytes = x * n;
-
- filt = (unsigned char *) STBIW_MALLOC((x*n+1) * y); if (!filt) return 0;
- line_buffer = (signed char *) STBIW_MALLOC(x * n); if (!line_buffer) { STBIW_FREE(filt); return 0; }
- for (j=0; j < y; ++j) {
- static int mapping[] = { 0,1,2,3,4 };
- static int firstmap[] = { 0,1,0,5,6 };
- int *mymap = j ? mapping : firstmap;
- int best = 0, bestval = 0x7fffffff;
- for (p=0; p < 2; ++p) {
- for (k= p?best:0; k < 5; ++k) {
- int type = mymap[k],est=0;
- unsigned char *z = pixels + stride_bytes*j;
- for (i=0; i < n; ++i)
- switch (type) {
- case 0: line_buffer[i] = z[i]; break;
- case 1: line_buffer[i] = z[i]; break;
- case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
- case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break;
- case 4: line_buffer[i] = (signed char) (z[i] - stbiw__paeth(0,z[i-stride_bytes],0)); break;
- case 5: line_buffer[i] = z[i]; break;
- case 6: line_buffer[i] = z[i]; break;
- }
- for (i=n; i < x*n; ++i) {
- switch (type) {
- case 0: line_buffer[i] = z[i]; break;
- case 1: line_buffer[i] = z[i] - z[i-n]; break;
- case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
- case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break;
- case 4: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
- case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
- case 6: line_buffer[i] = z[i] - stbiw__paeth(z[i-n], 0,0); break;
- }
- }
- if (p) break;
- for (i=0; i < x*n; ++i)
- est += abs((signed char) line_buffer[i]);
- if (est < bestval) { bestval = est; best = k; }
- }
- }
- // when we get here, best contains the filter type, and line_buffer contains the data
- filt[j*(x*n+1)] = (unsigned char) best;
- STBIW_MEMMOVE(filt+j*(x*n+1)+1, line_buffer, x*n);
- }
- STBIW_FREE(line_buffer);
- zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory
- STBIW_FREE(filt);
- if (!zlib) return 0;
-
- // each tag requires 12 bytes of overhead
- out = (unsigned char *) STBIW_MALLOC(8 + 12+13 + 12+zlen + 12);
- if (!out) return 0;
- *out_len = 8 + 12+13 + 12+zlen + 12;
-
- o=out;
- STBIW_MEMMOVE(o,sig,8); o+= 8;
- stbiw__wp32(o, 13); // header length
- stbiw__wptag(o, "IHDR");
- stbiw__wp32(o, x);
- stbiw__wp32(o, y);
- *o++ = 8;
- *o++ = STBIW_UCHAR(ctype[n]);
- *o++ = 0;
- *o++ = 0;
- *o++ = 0;
- stbiw__wpcrc(&o,13);
-
- stbiw__wp32(o, zlen);
- stbiw__wptag(o, "IDAT");
- STBIW_MEMMOVE(o, zlib, zlen);
- o += zlen;
- STBIW_FREE(zlib);
- stbiw__wpcrc(&o, zlen);
-
- stbiw__wp32(o,0);
- stbiw__wptag(o, "IEND");
- stbiw__wpcrc(&o,0);
-
- STBIW_ASSERT(o == out + *out_len);
-
- return out;
-}
-
-#ifndef STBI_WRITE_NO_STDIO
-STBIWDEF int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
-{
- FILE *f;
- int len;
- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
- if (png == NULL) return 0;
- f = fopen(filename, "wb");
- if (!f) { STBIW_FREE(png); return 0; }
- fwrite(png, 1, len, f);
- fclose(f);
- STBIW_FREE(png);
- return 1;
-}
-#endif
-
-STBIWDEF int stbi_write_png_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int stride_bytes)
-{
- int len;
- unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
- if (png == NULL) return 0;
- func(context, png, len);
- STBIW_FREE(png);
- return 1;
-}
-
-#endif // STB_IMAGE_WRITE_IMPLEMENTATION
-
-/* Revision history
- 1.02 (2016-04-02)
- avoid allocating large structures on the stack
- 1.01 (2016-01-16)
- STBIW_REALLOC_SIZED: support allocators with no realloc support
- avoid race-condition in crc initialization
- minor compile issues
- 1.00 (2015-09-14)
- installable file IO function
- 0.99 (2015-09-13)
- warning fixes; TGA rle support
- 0.98 (2015-04-08)
- added STBIW_MALLOC, STBIW_ASSERT etc
- 0.97 (2015-01-18)
- fixed HDR asserts, rewrote HDR rle logic
- 0.96 (2015-01-17)
- add HDR output
- fix monochrome BMP
- 0.95 (2014-08-17)
- add monochrome TGA output
- 0.94 (2014-05-31)
- rename private functions to avoid conflicts with stb_image.h
- 0.93 (2014-05-27)
- warning fixes
- 0.92 (2010-08-01)
- casts to unsigned char to fix warnings
- 0.91 (2010-07-17)
- first public release
- 0.90 first internal release
-*/
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/Makefile
deleted file mode 100644
index 6868dd9ac6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/Makefile
+++ /dev/null
@@ -1,28 +0,0 @@
-INC_DIR = -I../../ -I../common -I ../../deps/miniz
-
-INCLUDES := ../../tinyexr.h
-OBJS := miniz.o tinyexr.o cube2longlat.o
-
-CFLAGS := -fsanitize=address -O2
-CXXFLAGS := $(CFLAGS) -std=c++11
-LDFLAGS := -fsanitize=address
-
-TARGET=cube2longlat
-
-all: $(TARGET)
-
-$(TARGET): $(OBJS)
- $(CXX) -o $(TARGET) $(LDFLAGS) $(OBJS)
-
-miniz.o: ../../deps/miniz/miniz.c
- $(CC) $(CFLAGS) -c $(INC_DIR) $<
-
-tinyexr.o: ../../tinyexr.cc
- $(CXX) $(CXXFLAGS) -c $(INC_DIR) $<
-
-cube2longlat.o: cube2longlat.cc
- $(CXX) $(CXXFLAGS) -c $(INC_DIR) $<
-
-.PHONY: clean
-clean:
- rm -rf $(TARGET) $(OBJS)
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/README.md
deleted file mode 100644
index 06a9e3c0ac..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/README.md
+++ /dev/null
@@ -1,46 +0,0 @@
-# Simple HDR cubemap to longlat(longitude latitude. or known as equirectangular) converter.
-
-## Requirements
-
-* C++11 compiler
-
-## Coordinate definition.
-
-* Y-up
-* Right-handed
-* Center is -z
-
-## Usage
-
-Assume cubemap image is given by 6 images(6 faces).
-
-```
-$ ./cube2longlat px.exr nx.exr py.exr ny.exr pz.exr nz.exr 512 longlat.exr (phi_offset)
-```
-
-Optional `phi_offset` is used to add offset(by angle) to phi to rotate X and Z faces.
-
-
-## Supported input image format
-
-* [ ] RGBM(Filament's RGBM encoding. Multiplier is 16, and gamma corrected) Implemented but not tested.
-* [x] EXR
-
-## Supported output image format
-
-* [ ] RGBM(Filament's RGBM encoding. Multiplier is 16, and gamma corrected) Implemented but not tested.
-* [x] EXR
-* [x] RGBE
-
-## Note
-
-When you create cubemap using Filament's cmgen https://github.com/google/filament/tree/master/tools/cmgen , its generated cubemap images are mirrored by X direction.
-Use `--mirror` when invoking `cmgen` if required.
-
-## TODO
-
-* Single cubemap image(cross layout)
-* Better antialiasing
-* theta offset
-* Mirroring.
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/cube2longlat.cc b/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/cube2longlat.cc
deleted file mode 100644
index 5a389c18cf..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/cube2longlat/cube2longlat.cc
+++ /dev/null
@@ -1,470 +0,0 @@
-#include "tinyexr.h"
-
-#define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h"
-
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include "stb_image_write.h"
-
-#include <array>
-#include <cmath>
-#include <iostream>
-#include <string>
-#include <vector>
-
-// From Filament.
-static inline void RGBMtoLinear(const float rgbm[4], float linear[3]) {
- linear[0] = rgbm[0] * rgbm[3] * 16.0f;
- linear[1] = rgbm[1] * rgbm[3] * 16.0f;
- linear[2] = rgbm[2] * rgbm[3] * 16.0f;
-
- // Gamma to linear space
- linear[0] = linear[0] * linear[0];
- linear[1] = linear[1] * linear[1];
- linear[2] = linear[2] * linear[2];
-}
-
-static inline void LinearToRGBM(const float linear[3], float rgbm[4]) {
- rgbm[0] = linear[0];
- rgbm[1] = linear[1];
- rgbm[2] = linear[2];
- rgbm[3] = 1.0f;
-
- // Linear to gamma space
- rgbm[0] = rgbm[0] * rgbm[0];
- rgbm[1] = rgbm[1] * rgbm[1];
- rgbm[2] = rgbm[2] * rgbm[2];
-
- // Set the range
- rgbm[0] /= 16.0f;
- rgbm[1] /= 16.0f;
- rgbm[2] /= 16.0f;
-
- float maxComponent =
- std::max(std::max(rgbm[0], rgbm[1]), std::max(rgbm[2], 1e-6f));
- // Don't let M go below 1 in the [0..16] range
- rgbm[3] = std::max(1.0f / 16.0f, std::min(maxComponent, 1.0f));
- rgbm[3] = std::ceil(rgbm[3] * 255.0f) / 255.0f;
-
- // saturate([0.0, 1.0])
- rgbm[0] = std::max(0.0f, std::min(1.0f, rgbm[0] / rgbm[3]));
- rgbm[1] = std::max(0.0f, std::min(1.0f, rgbm[1] / rgbm[3]));
- rgbm[2] = std::max(0.0f, std::min(1.0f, rgbm[2] / rgbm[3]));
-}
-
-static std::string GetFileExtension(const std::string& filename) {
- if (filename.find_last_of(".") != std::string::npos)
- return filename.substr(filename.find_last_of(".") + 1);
- return "";
-}
-
-struct Image {
- int width;
- int height;
- std::vector<float> data;
-};
-
-static bool LoadCubemaps(const std::array<std::string, 6> face_filenames,
- std::array<Image, 6>* output) {
- for (size_t i = 0; i < 6; i++) {
- std::string ext = GetFileExtension(face_filenames[i]);
-
- Image image;
-
- if ((ext.compare("exr") == 0) || (ext.compare("EXR") == 0)) {
- int width, height;
- float* rgba;
- const char* err;
-
- int ret =
- LoadEXR(&rgba, &width, &height, face_filenames[i].c_str(), &err);
- if (ret != 0) {
- if (err) {
- std::cerr << "EXR load error: " << err << std::endl;
- } else {
- std::cerr << "EXR load error: code " << ret << std::endl;
- }
- return false;
- }
-
- image.width = width;
- image.height = height;
- image.data.resize(width * height * 3);
-
- // RGBA -> RGB
- for (size_t j = 0; j < size_t(width * height); j++) {
- image.data[3 * j + 0] = rgba[4 * j + 0];
- image.data[3 * j + 1] = rgba[4 * j + 1];
- image.data[3 * j + 2] = rgba[4 * j + 2];
- }
-
- free(rgba);
-
- (*output)[i] = std::move(image);
-
- } else if ((ext.compare("rgbm") == 0) || (ext.compare("RGBM") == 0)) {
- int width, height;
- int n;
-
- unsigned char* data = stbi_load(face_filenames[i].c_str(), &width,
- &height, &n, STBI_default);
-
- if (!data) {
- std::cerr << "Failed to load file: " << face_filenames[i] << std::endl;
- return false;
- }
-
- if ((n != 4)) {
- std::cerr << "Not a RGBM encoded image: " << face_filenames[i]
- << std::endl;
- return false;
- }
-
- image.width = width;
- image.height = height;
- image.data.resize(size_t(width * height));
-
- for (size_t i = 0; i < size_t(width * height); i++) {
- float rgbm[4];
- // [0, 1.0]
- rgbm[0] = data[4 * i + 0] / 255.0f;
- rgbm[1] = data[4 * i + 1] / 255.0f;
- rgbm[2] = data[4 * i + 2] / 255.0f;
- rgbm[3] = data[4 * i + 3] / 255.0f;
-
- float linear[3];
- RGBMtoLinear(rgbm, linear);
-
- image.data[3 * i + 0] = linear[0];
- image.data[3 * i + 1] = linear[1];
- image.data[3 * i + 2] = linear[2];
- }
-
- (*output)[i] = std::move(image);
-
- } else {
- std::cerr << "Unknown file extension : " << ext << std::endl;
- return false;
- }
- std::cout << "Loaded " << face_filenames[i] << std::endl;
- }
-
- return true;
-}
-
-void convert_xyz_to_cube_uv(float x, float y, float z, int* index, float* u,
- float* v) {
- float absX = fabs(x);
- float absY = fabs(y);
- float absZ = fabs(z);
-
- int isXPositive = x > 0.0f ? 1 : 0;
- int isYPositive = y > 0.0f ? 1 : 0;
- int isZPositive = z > 0.0f ? 1 : 0;
-
- float maxAxis, uc, vc;
-
- // POSITIVE X
- if (isXPositive && absX >= absY && absX >= absZ) {
- // u (0 to 1) goes from +z to -z
- // v (0 to 1) goes from -y to +y
- maxAxis = absX;
- uc = -z;
- vc = y;
- *index = 0;
- }
- // NEGATIVE X
- if (!isXPositive && absX >= absY && absX >= absZ) {
- // u (0 to 1) goes from -z to +z
- // v (0 to 1) goes from -y to +y
- maxAxis = absX;
- uc = z;
- vc = y;
- *index = 1;
- }
- // POSITIVE Y
- if (isYPositive && absY >= absX && absY >= absZ) {
- // u (0 to 1) goes from -x to +x
- // v (0 to 1) goes from +z to -z
- maxAxis = absY;
- uc = x;
- vc = -z;
- *index = 2;
- }
- // NEGATIVE Y
- if (!isYPositive && absY >= absX && absY >= absZ) {
- // u (0 to 1) goes from -x to +x
- // v (0 to 1) goes from -z to +z
- maxAxis = absY;
- uc = x;
- vc = z;
- *index = 3;
- }
- // POSITIVE Z
- if (isZPositive && (absZ >= absX) && (absZ >= absY)) {
- // u (0 to 1) goes from -x to +x
- // v (0 to 1) goes from -y to +y
- maxAxis = absZ;
- uc = x;
- vc = y;
- *index = 4;
- }
- // NEGATIVE Z
- if (!isZPositive && (absZ >= absX) && (absZ >= absY)) {
- // u (0 to 1) goes from +x to -x
- // v (0 to 1) goes from -y to +y
- maxAxis = absZ;
- uc = -x;
- vc = y;
- *index = 5;
- }
-
- // Convert range from -1 to 1 to 0 to 1
- *u = 0.5f * (uc / maxAxis + 1.0f);
- *v = 0.5f * (vc / maxAxis + 1.0f);
-}
-
-//
-// Simple bilinear texture filtering.
-//
-static void SampleTexture(float* rgba, float u, float v, int width, int height,
- int channels, const float* texels) {
- float sx = std::floor(u);
- float sy = std::floor(v);
-
- // Wrap mode = repeat
- float uu = u - sx;
- float vv = v - sy;
-
- // clamp
- uu = std::max(uu, 0.0f);
- uu = std::min(uu, 1.0f);
- vv = std::max(vv, 0.0f);
- vv = std::min(vv, 1.0f);
-
- float px = (width - 1) * uu;
- float py = (height - 1) * vv;
-
- int x0 = std::max(0, std::min((int)px, (width - 1)));
- int y0 = std::max(0, std::min((int)py, (height - 1)));
- int x1 = std::max(0, std::min((x0 + 1), (width - 1)));
- int y1 = std::max(0, std::min((y0 + 1), (height - 1)));
-
- float dx = px - (float)x0;
- float dy = py - (float)y0;
-
- float w[4];
-
- w[0] = (1.0f - dx) * (1.0 - dy);
- w[1] = (1.0f - dx) * (dy);
- w[2] = (dx) * (1.0 - dy);
- w[3] = (dx) * (dy);
-
- int i00 = channels * (y0 * width + x0);
- int i01 = channels * (y0 * width + x1);
- int i10 = channels * (y1 * width + x0);
- int i11 = channels * (y1 * width + x1);
-
- for (int i = 0; i < channels; i++) {
- rgba[i] = w[0] * texels[i00 + i] + w[1] * texels[i10 + i] +
- w[2] * texels[i01 + i] + w[3] * texels[i11 + i];
- }
-}
-
-static void SampleCubemap(const std::array<Image, 6>& cubemap_faces,
- const float n[3], float col[3]) {
- int face;
- float u, v;
- convert_xyz_to_cube_uv(n[0], n[1], n[2], &face, &u, &v);
-
- v = 1.0f - v;
-
- // std::cout << "face = " << face << std::endl;
-
- // TODO(syoyo): Do we better consider seams on the cubemap face border?
- const Image& tex = cubemap_faces[face];
-
- // std::cout << "n = " << n[0] << ", " << n[1] << ", " << n[2] << ", uv = " <<
- // u << ", " << v << std::endl;
-
- SampleTexture(col, u, v, tex.width, tex.height, /* RGB */ 3, tex.data.data());
-
-// col[0] = u;
-// col[1] = v;
-// col[2] = 0.0f;
-#if 0
- if (face == 0) {
- col[0] = 1.0f;
- col[1] = 0.0f;
- col[2] = 0.0f;
- } else if (face == 1) {
- col[0] = 0.0f;
- col[1] = 1.0f;
- col[2] = 0.0f;
- } else if (face == 2) {
- col[0] = 0.0f;
- col[1] = 0.0f;
- col[2] = 1.0f;
- } else if (face == 3) {
- col[0] = 1.0f;
- col[1] = 0.0f;
- col[2] = 1.0f;
- } else if (face == 4) {
- col[0] = 0.0f;
- col[1] = 1.0f;
- col[2] = 1.0f;
- } else if (face == 5) {
- col[0] = 1.0f;
- col[1] = 1.0f;
- col[2] = 1.0f;
- }
-#endif
-}
-
-static void CubemapToLonglat(const std::array<Image, 6>& cubemap_faces,
- const float phi_offset, /* in angle */
- const int width, Image* longlat) {
- int height = width / 2;
-
- longlat->width = width;
- longlat->height = height;
- longlat->data.resize(size_t(width * height * 3)); // RGB
-
- const float kPI = 3.141592f;
-
- for (size_t y = 0; y < size_t(height); y++) {
- float theta = ((y + 0.5f) / float(height)) * kPI; // [0, pi]
- for (size_t x = 0; x < size_t(width); x++) {
- float phi = ((x + 0.5f) / float(width)) * 2.0f * kPI; // [0, 2 pi]
-
- phi += (phi_offset) * kPI / 180.0f;
-
- float n[3];
-
- // Y-up
- n[0] = std::sin(theta) * std::cos(phi);
- n[1] = std::cos(theta);
- n[2] = -std::sin(theta) * std::sin(phi);
-
- float col[3];
- SampleCubemap(cubemap_faces, n, col);
-
- longlat->data[3 * size_t(y * width + x) + 0] = col[0];
- longlat->data[3 * size_t(y * width + x) + 1] = col[1];
- longlat->data[3 * size_t(y * width + x) + 2] = col[2];
- }
- }
-}
-
-static unsigned char ftouc(const float f) {
- int i(f * 255.0f);
- i = std::max(0, std::min(255, i));
- return static_cast<unsigned char>(i);
-}
-
-int main(int argc, char** argv) {
- float phi_offset = 0.0f;
-
- if (argc < 9) {
- printf(
- "Usage: cube2longlat px.exr nx.exr py.exr ny.exr pz.exr nz.exr "
- "output_width output.exr\n");
- exit(-1);
- }
-
- std::array<std::string, 6> face_filenames;
-
- face_filenames[0] = argv[1];
- face_filenames[1] = argv[2];
- face_filenames[2] = argv[3];
- face_filenames[3] = argv[4];
- face_filenames[4] = argv[5];
- face_filenames[5] = argv[6];
-
- int output_width = atoi(argv[7]);
-
- std::string output_filename = argv[8];
-
- if (argc > 9) {
- phi_offset = atof(argv[9]);
- }
-
- std::array<Image, 6> cubemaps;
-
- if (!LoadCubemaps(face_filenames, &cubemaps)) {
- std::cerr << "Failed to load cubemap faces." << std::endl;
- return EXIT_FAILURE;
- }
-
- Image longlat;
-
- CubemapToLonglat(cubemaps, phi_offset, output_width, &longlat);
-
- {
- std::string ext = GetFileExtension(output_filename);
- if ((ext.compare("exr") == 0) || (ext.compare("EXR") == 0)) {
- const char *err;
- int ret = SaveEXR(longlat.data.data(), longlat.width, longlat.height,
- /* RGB */ 3, /* fp16 */ 0, output_filename.c_str(), &err);
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- std::cout << "Failed to save image as EXR. msg = " << err << ", code = " << ret << std::endl;
- FreeEXRErrorMessage(err);
- } else {
- std::cout << "Failed to save image as EXR. code = " << ret << std::endl;
- }
- return EXIT_FAILURE;
- }
- } else if ((ext.compare("rgbm") == 0) || (ext.compare("RGBM") == 0)) {
- std::vector<unsigned char> rgbm_image;
-
- for (size_t j = 0; j < size_t(longlat.width * longlat.height); j++) {
- float linear[3];
- linear[0] = longlat.data[3 * j + 0];
- linear[1] = longlat.data[3 * j + 1];
- linear[2] = longlat.data[3 * j + 2];
-
- float rgbm[4];
-
- LinearToRGBM(linear, rgbm);
-
- rgbm_image[4 * j + 0] = ftouc(rgbm[0]);
- rgbm_image[4 * j + 1] = ftouc(rgbm[1]);
- rgbm_image[4 * j + 2] = ftouc(rgbm[2]);
- rgbm_image[4 * j + 3] = ftouc(rgbm[2]);
- }
-
- // Save as PNG.
- int ret =
- stbi_write_png(output_filename.c_str(), longlat.width, longlat.height,
- 4, rgbm_image.data(), longlat.width * 4);
-
- if (ret == 0) {
- std::cerr << "Failed to save image as RGBM file : " << output_filename
- << std::endl;
- return EXIT_FAILURE;
- }
-
- } else {
- if ((ext.compare("hdr") == 0) || (ext.compare("HDR") == 0)) {
- // ok
- } else {
- std::cout << "Unknown file extension. Interpret it as RGBE format : "
- << ext << std::endl;
- }
-
- int ret = stbi_write_hdr(output_filename.c_str(), longlat.width,
- longlat.height, 3, longlat.data.data());
-
- if (ret == 0) {
- std::cerr << "Failed to save image as HDR file : " << output_filename
- << std::endl;
- return EXIT_FAILURE;
- }
- }
- }
-
- std::cout << "Write " << output_filename << std::endl;
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/deepview/Makefile
deleted file mode 100644
index b3dafd7877..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- g++ -I ../../deps/miniz -o deepview -g -O2 main.cc trackball.cc ../../tinyexr.cc ../../deps/miniz/miniz.c -framework OpenGL -framework GLUT
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/deepview_screencast.gif b/graphics/asymptote/cudareflect/tinyexr/examples/deepview/deepview_screencast.gif
deleted file mode 100644
index 6a9560efbf..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/deepview_screencast.gif
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/main.cc b/graphics/asymptote/cudareflect/tinyexr/examples/deepview/main.cc
deleted file mode 100644
index 4c996d5b81..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/main.cc
+++ /dev/null
@@ -1,277 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <assert.h>
-#include <float.h>
-#include <string.h>
-#include <string.h>
-
-#ifdef __APPLE__
-#include <GLUT/glut.h>
-#else
-#include <GL/glut.h>
-#endif
-
-#include "../../tinyexr.h"
-#include "trackball.h"
-
-static int mouse_x, mouse_y;
-static int mouse_m_pressed;
-static int mouse_r_pressed;
-static int mouse_moving;
-static int width = 512, height = 512;
-static float view_org[3], view_tgt[3];
-static float curr_quat[4], prev_quat[4];
-static float color_scale = 1.0f;
-
-DeepImage gDeepImage;
-
-//
-// --
-//
-
-static void reshape(int w, int h) {
- glViewport(0, 0, w, h);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- gluPerspective(5.0, (float)w / (float)h, 0.1f, 1000.0f);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- width = w;
- height = h;
-}
-
-static void draw_samples() {
- glPointSize(1.0f);
- glColor3f(1.0f, 1.0f, 1.0f);
-
- glBegin(GL_POINTS);
-
- // find depth channel.
- // @todo { Do this only once. }
- int depthChan = 0;
- int rChan = -1;
- int raChan = -1;
- int gChan = -1;
- int gaChan = -1;
- int bChan = -1;
- int baChan = -1;
-
- for (int c = 0; c < gDeepImage.num_channels; c++) {
- if (strcmp("Z", gDeepImage.channel_names[c]) == 0) {
- depthChan = c;
- } else if (strcmp("R", gDeepImage.channel_names[c]) == 0) {
- rChan = c;
- } else if (strcmp("RA", gDeepImage.channel_names[c]) == 0) {
- raChan = c;
- } else if (strcmp("G", gDeepImage.channel_names[c]) == 0) {
- gChan = c;
- } else if (strcmp("GA", gDeepImage.channel_names[c]) == 0) {
- gaChan = c;
- } else if (strcmp("B", gDeepImage.channel_names[c]) == 0) {
- bChan = c;
- } else if (strcmp("BA", gDeepImage.channel_names[c]) == 0) {
- baChan = c;
- }
- }
-
- for (int y = 0; y < gDeepImage.height; y++) {
- float py = 2.0f * ((gDeepImage.height - y - 1) / (float)gDeepImage.height) -
- 1.0f; // upside down?
- int sampleNum = gDeepImage.offset_table[y][gDeepImage.width - 1];
-
- int s_start = 0; // First pixel data starts at 0
- for (int x = 0; x < gDeepImage.width; x++) {
- float px = 2.0f * (x / (float)gDeepImage.width) - 1.0f;
- int s_end = gDeepImage.offset_table[y][x];
- if (s_start >= sampleNum || s_end >= sampleNum) {
- continue;
- }
- for (int s = s_start; s < s_end; s++) {
- float pz = -gDeepImage.image[depthChan][y][s];
-
- float red = 1.0f;
- float green = 1.0f;
- float blue = 1.0f;
- float red_alpha = 1.0f;
- float green_alpha = 1.0f;
- float blue_alpha = 1.0f;
- if (rChan >= 0) {
- red = gDeepImage.image[rChan][y][s];
- }
- if (raChan >= 0) {
- red_alpha = gDeepImage.image[raChan][y][s];
- }
- if (gChan >= 0) {
- green = gDeepImage.image[gChan][y][s];
- }
- if (gaChan >= 0) {
- green_alpha = gDeepImage.image[gaChan][y][s];
- }
- if (bChan >= 0) {
- blue = gDeepImage.image[bChan][y][s];
- }
- if (baChan >= 0) {
- blue_alpha = gDeepImage.image[baChan][y][s];
- }
- // unmultiply and apply scaling
- red *= color_scale / red_alpha;
- green *= color_scale / green_alpha;
- blue *= color_scale / blue_alpha;
- glColor3f(red, green, blue);
- glVertex3f(px, py, pz);
- }
-
- s_start = s_end;
- }
- }
-
- glEnd();
-}
-
-static void display() {
- GLfloat mat[4][4];
-
- glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
- glEnable(GL_DEPTH_TEST);
-
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
-
- // camera & rotate
- gluLookAt(view_org[0], view_org[1], view_org[2], view_tgt[0], view_tgt[1],
- view_tgt[2], 0.0, 1.0, 0.0);
-
- build_rotmatrix(mat, curr_quat);
- glMultMatrixf(&mat[0][0]);
-
- draw_samples();
-
- // glBegin(GL_POLYGON);
- // glTexCoord2f(0 , 0); glVertex2f(-0.9 , -0.9);
- // glTexCoord2f(0 , 1); glVertex2f(-0.9 , 0.9);
- // glTexCoord2f(1 , 1); glVertex2f(0.9 , 0.9);
- // glTexCoord2f(1 , 0); glVertex2f(0.9 , -0.9);
- // glEnd();
-
- glutSwapBuffers();
-}
-
-static void keyboard(unsigned char key, int x, int y) {
- switch (key) {
- case 'q':
- case 27:
- exit(0);
- break;
- case 'c':
- color_scale += 1.0f;
- break;
- case 'x':
- color_scale -= 1.0f;
- if (color_scale < 1.0f)
- color_scale = 1.0f;
- break;
- default:
- break;
- }
-
- glutPostRedisplay();
-}
-
-static void mouse(int button, int state, int x, int y) {
- int mod = glutGetModifiers();
-
- if (button == GLUT_LEFT_BUTTON && state == GLUT_DOWN) {
- if (mod == GLUT_ACTIVE_SHIFT) {
- mouse_m_pressed = 1;
- } else if (mod == GLUT_ACTIVE_CTRL) {
- mouse_r_pressed = 1;
- } else {
- trackball(prev_quat, 0, 0, 0, 0);
- }
- mouse_moving = 1;
- mouse_x = x;
- mouse_y = y;
- } else if (button == GLUT_LEFT_BUTTON && state == GLUT_UP) {
- mouse_m_pressed = 0;
- mouse_r_pressed = 0;
- mouse_moving = 0;
- }
-}
-
-static void motion(int x, int y) {
- float w = 1.0;
- float mw = 0.1;
-
- if (mouse_moving) {
- if (mouse_r_pressed) {
- view_org[2] += mw * (mouse_y - y);
- view_tgt[2] += mw * (mouse_y - y);
- } else if (mouse_m_pressed) {
- view_org[0] += mw * (mouse_x - x);
- view_org[1] -= mw * (mouse_y - y);
- view_tgt[0] += mw * (mouse_x - x);
- view_tgt[1] -= mw * (mouse_y - y);
- } else {
- trackball(prev_quat, w * (2.0 * mouse_x - width) / width,
- w * (height - 2.0 * mouse_y) / height,
- w * (2.0 * x - width) / width, w * (height - 2.0 * y) / height);
- add_quats(prev_quat, curr_quat, curr_quat);
- }
-
- mouse_x = x;
- mouse_y = y;
- }
-
- glutPostRedisplay();
-}
-
-static void init() {
- trackball(curr_quat, 0, 0, 0, 0);
-
- view_org[0] = 0.0f;
- view_org[1] = 0.0f;
- view_org[2] = 3.0f;
-
- view_tgt[0] = 0.0f;
- view_tgt[1] = 0.0f;
- view_tgt[2] = 0.0f;
-}
-
-int main(int argc, char **argv) {
- const char *input = "input.exr";
-
- if (argc < 2) {
- printf("Usage: deepview <input.exr>\n");
- exit(1);
- }
-
- input = argv[1];
- const char *err;
- int ret = LoadDeepEXR(&gDeepImage, input, &err);
- if (ret != 0) {
- if (err) {
- fprintf(stderr, "ERR: %s\n", err);
- }
- exit(-1);
- }
-
- glutInit(&argc, argv);
- glutInitWindowSize(512, 512);
- glutInitDisplayMode(GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGBA);
-
- init();
-
- glutCreateWindow("deepimage viewer");
-
- glutReshapeFunc(reshape);
- glutDisplayFunc(display);
- glutKeyboardFunc(keyboard);
- glutMouseFunc(mouse);
- glutMotionFunc(motion);
- glutMainLoop();
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.cc b/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.cc
deleted file mode 100644
index f23d3db30b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.cc
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/*
- * Trackball code:
- *
- * Implementation of a virtual trackball.
- * Implemented by Gavin Bell, lots of ideas from Thant Tessman and
- * the August '88 issue of Siggraph's "Computer Graphics," pp. 121-129.
- *
- * Vector manip code:
- *
- * Original code from:
- * David M. Ciemiewicz, Mark Grossman, Henry Moreton, and Paul Haeberli
- *
- * Much mucking with by:
- * Gavin Bell
- */
-#include <math.h>
-#include "trackball.h"
-
-/*
- * This size should really be based on the distance from the center of
- * rotation to the point on the object underneath the mouse. That
- * point would then track the mouse as closely as possible. This is a
- * simple example, though, so that is left as an Exercise for the
- * Programmer.
- */
-#define TRACKBALLSIZE (0.8)
-
-/*
- * Local function prototypes (not defined in trackball.h)
- */
-static float tb_project_to_sphere(float, float, float);
-static void normalize_quat(float [4]);
-
-void
-vzero(float *v)
-{
- v[0] = 0.0;
- v[1] = 0.0;
- v[2] = 0.0;
-}
-
-void
-vset(float *v, float x, float y, float z)
-{
- v[0] = x;
- v[1] = y;
- v[2] = z;
-}
-
-void
-vsub(const float *src1, const float *src2, float *dst)
-{
- dst[0] = src1[0] - src2[0];
- dst[1] = src1[1] - src2[1];
- dst[2] = src1[2] - src2[2];
-}
-
-void
-vcopy(const float *v1, float *v2)
-{
- register int i;
- for (i = 0 ; i < 3 ; i++)
- v2[i] = v1[i];
-}
-
-void
-vcross(const float *v1, const float *v2, float *cross)
-{
- float temp[3];
-
- temp[0] = (v1[1] * v2[2]) - (v1[2] * v2[1]);
- temp[1] = (v1[2] * v2[0]) - (v1[0] * v2[2]);
- temp[2] = (v1[0] * v2[1]) - (v1[1] * v2[0]);
- vcopy(temp, cross);
-}
-
-float
-vlength(const float *v)
-{
- return sqrt(v[0] * v[0] + v[1] * v[1] + v[2] * v[2]);
-}
-
-void
-vscale(float *v, float div)
-{
- v[0] *= div;
- v[1] *= div;
- v[2] *= div;
-}
-
-void
-vnormal(float *v)
-{
- vscale(v,1.0/vlength(v));
-}
-
-float
-vdot(const float *v1, const float *v2)
-{
- return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
-}
-
-void
-vadd(const float *src1, const float *src2, float *dst)
-{
- dst[0] = src1[0] + src2[0];
- dst[1] = src1[1] + src2[1];
- dst[2] = src1[2] + src2[2];
-}
-
-/*
- * Ok, simulate a track-ball. Project the points onto the virtual
- * trackball, then figure out the axis of rotation, which is the cross
- * product of P1 P2 and O P1 (O is the center of the ball, 0,0,0)
- * Note: This is a deformed trackball-- is a trackball in the center,
- * but is deformed into a hyperbolic sheet of rotation away from the
- * center. This particular function was chosen after trying out
- * several variations.
- *
- * It is assumed that the arguments to this routine are in the range
- * (-1.0 ... 1.0)
- */
-void
-trackball(float q[4], float p1x, float p1y, float p2x, float p2y)
-{
- float a[3]; /* Axis of rotation */
- float phi; /* how much to rotate about axis */
- float p1[3], p2[3], d[3];
- float t;
-
- if (p1x == p2x && p1y == p2y) {
- /* Zero rotation */
- vzero(q);
- q[3] = 1.0;
- return;
- }
-
- /*
- * First, figure out z-coordinates for projection of P1 and P2 to
- * deformed sphere
- */
- vset(p1,p1x,p1y,tb_project_to_sphere(TRACKBALLSIZE,p1x,p1y));
- vset(p2,p2x,p2y,tb_project_to_sphere(TRACKBALLSIZE,p2x,p2y));
-
- /*
- * Now, we want the cross product of P1 and P2
- */
- vcross(p2,p1,a);
-
- /*
- * Figure out how much to rotate around that axis.
- */
- vsub(p1,p2,d);
- t = vlength(d) / (2.0*TRACKBALLSIZE);
-
- /*
- * Avoid problems with out-of-control values...
- */
- if (t > 1.0) t = 1.0;
- if (t < -1.0) t = -1.0;
- phi = 2.0 * asin(t);
-
- axis_to_quat(a,phi,q);
-}
-
-/*
- * Given an axis and angle, compute quaternion.
- */
-void
-axis_to_quat(float a[3], float phi, float q[4])
-{
- vnormal(a);
- vcopy(a,q);
- vscale(q,sin(phi/2.0));
- q[3] = cos(phi/2.0);
-}
-
-/*
- * Project an x,y pair onto a sphere of radius r OR a hyperbolic sheet
- * if we are away from the center of the sphere.
- */
-static float
-tb_project_to_sphere(float r, float x, float y)
-{
- float d, t, z;
-
- d = sqrt(x*x + y*y);
- if (d < r * 0.70710678118654752440) { /* Inside sphere */
- z = sqrt(r*r - d*d);
- } else { /* On hyperbola */
- t = r / 1.41421356237309504880;
- z = t*t / d;
- }
- return z;
-}
-
-/*
- * Given two rotations, e1 and e2, expressed as quaternion rotations,
- * figure out the equivalent single rotation and stuff it into dest.
- *
- * This routine also normalizes the result every RENORMCOUNT times it is
- * called, to keep error from creeping in.
- *
- * NOTE: This routine is written so that q1 or q2 may be the same
- * as dest (or each other).
- */
-
-#define RENORMCOUNT 97
-
-void
-add_quats(float q1[4], float q2[4], float dest[4])
-{
- static int count=0;
- float t1[4], t2[4], t3[4];
- float tf[4];
-
- vcopy(q1,t1);
- vscale(t1,q2[3]);
-
- vcopy(q2,t2);
- vscale(t2,q1[3]);
-
- vcross(q2,q1,t3);
- vadd(t1,t2,tf);
- vadd(t3,tf,tf);
- tf[3] = q1[3] * q2[3] - vdot(q1,q2);
-
- dest[0] = tf[0];
- dest[1] = tf[1];
- dest[2] = tf[2];
- dest[3] = tf[3];
-
- if (++count > RENORMCOUNT) {
- count = 0;
- normalize_quat(dest);
- }
-}
-
-/*
- * Quaternions always obey: a^2 + b^2 + c^2 + d^2 = 1.0
- * If they don't add up to 1.0, dividing by their magnitued will
- * renormalize them.
- *
- * Note: See the following for more information on quaternions:
- *
- * - Shoemake, K., Animating rotation with quaternion curves, Computer
- * Graphics 19, No 3 (Proc. SIGGRAPH'85), 245-254, 1985.
- * - Pletinckx, D., Quaternion calculus as a basic tool in computer
- * graphics, The Visual Computer 5, 2-13, 1989.
- */
-static void
-normalize_quat(float q[4])
-{
- int i;
- float mag;
-
- mag = (q[0]*q[0] + q[1]*q[1] + q[2]*q[2] + q[3]*q[3]);
- for (i = 0; i < 4; i++) q[i] /= mag;
-}
-
-/*
- * Build a rotation matrix, given a quaternion rotation.
- *
- */
-void
-build_rotmatrix(float m[4][4], float q[4])
-{
- m[0][0] = 1.0 - 2.0 * (q[1] * q[1] + q[2] * q[2]);
- m[0][1] = 2.0 * (q[0] * q[1] - q[2] * q[3]);
- m[0][2] = 2.0 * (q[2] * q[0] + q[1] * q[3]);
- m[0][3] = 0.0;
-
- m[1][0] = 2.0 * (q[0] * q[1] + q[2] * q[3]);
- m[1][1]= 1.0 - 2.0 * (q[2] * q[2] + q[0] * q[0]);
- m[1][2] = 2.0 * (q[1] * q[2] - q[0] * q[3]);
- m[1][3] = 0.0;
-
- m[2][0] = 2.0 * (q[2] * q[0] - q[1] * q[3]);
- m[2][1] = 2.0 * (q[1] * q[2] + q[0] * q[3]);
- m[2][2] = 1.0 - 2.0 * (q[1] * q[1] + q[0] * q[0]);
- m[2][3] = 0.0;
-
- m[3][0] = 0.0;
- m[3][1] = 0.0;
- m[3][2] = 0.0;
- m[3][3] = 1.0;
-}
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.h b/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.h
deleted file mode 100644
index 68a83d1609..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/deepview/trackball.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * (c) Copyright 1993, 1994, Silicon Graphics, Inc.
- * ALL RIGHTS RESERVED
- * Permission to use, copy, modify, and distribute this software for
- * any purpose and without fee is hereby granted, provided that the above
- * copyright notice appear in all copies and that both the copyright notice
- * and this permission notice appear in supporting documentation, and that
- * the name of Silicon Graphics, Inc. not be used in advertising
- * or publicity pertaining to distribution of the software without specific,
- * written prior permission.
- *
- * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
- * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
- * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
- * FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
- * GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
- * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
- * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
- * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
- * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
- * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
- * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
- *
- * US Government Users Restricted Rights
- * Use, duplication, or disclosure by the Government is subject to
- * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
- * (c)(1)(ii) of the Rights in Technical Data and Computer Software
- * clause at DFARS 252.227-7013 and/or in similar or successor
- * clauses in the FAR or the DOD or NASA FAR Supplement.
- * Unpublished-- rights reserved under the copyright laws of the
- * United States. Contractor/manufacturer is Silicon Graphics,
- * Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
- *
- * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
- */
-/*
- * trackball.h
- * A virtual trackball implementation
- * Written by Gavin Bell for Silicon Graphics, November 1988.
- */
-
-/*
- * Pass the x and y coordinates of the last and current positions of
- * the mouse, scaled so they are from (-1.0 ... 1.0).
- *
- * The resulting rotation is returned as a quaternion rotation in the
- * first paramater.
- */
-void
-trackball(float q[4], float p1x, float p1y, float p2x, float p2y);
-
-void
-negate_quat(float *q, float *qn);
-
-/*
- * Given two quaternions, add them together to get a third quaternion.
- * Adding quaternions to get a compound rotation is analagous to adding
- * translations to get a compound translation. When incrementally
- * adding rotations, the first argument here should be the new
- * rotation, the second and third the total rotation (which will be
- * over-written with the resulting new total rotation).
- */
-void
-add_quats(float *q1, float *q2, float *dest);
-
-/*
- * A useful function, builds a rotation matrix in Matrix based on
- * given quaternion.
- */
-void
-build_rotmatrix(float m[4][4], float q[4]);
-
-/*
- * This function computes a quaternion based on an axis (defined by
- * the given vector) and an angle about which to rotate. The angle is
- * expressed in radians. The result is put into the third argument.
- */
-void
-axis_to_quat(float a[3], float phi, float q[4]);
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/Makefile
deleted file mode 100644
index 68789d2009..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/Makefile
+++ /dev/null
@@ -1,32 +0,0 @@
-
-CXX=clang++
-CC=clang
-
-CFLAGS = -fsanitize=address -Weverything -Wno-padded -g -O2 -I../../ -I../../deps/miniz
-CXXFLAGS = -std=c++11 -Wno-c++98-compat -Wno-variadic-macros $(CFLAGS)
-LDFLAGS = -fsanitize=address
-
-# ZFP
-#CXXFLAGS += -DTINYEXR_USE_ZFP=1 -I/home/syoyo/work/zfp/include
-#LDFLAGS += -L/home/syoyo/work/zfp/build/lib -lzfp
-
-
-all: exr2fptiff
-
-exr2fptiff: exr2fptiff.o tinyexr.o miniz.o
- $(CXX) -o $@ $^ $(LDFLAGS)
-
-exr2fptiff.o: exr2fptiff.cc tiny_dng_writer.h
- $(CXX) $(CXXFLAGS) -c -o $@ $<
-
-tinyexr.o: ../../tinyexr.cc
- $(CXX) $(CXXFLAGS) -c -o $@ $<
-
-miniz.o: ../../deps/miniz/miniz.c
- $(CC) $(CFLAGS) -c $(INC_DIR) $<
-
-.PHONY: clean
-
-
-clean:
- rm -rf tinyexr.o exr2fptiff.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/README.md
deleted file mode 100644
index 3c3a2390dd..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# exr2fptiff
-
-OpenEXR to 32bit float TIFF converter.
-
-## Limitation
-
-Input EXR image must be grayscale, RGB or RGBA.
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/exr2fptiff.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/exr2fptiff.cc
deleted file mode 100644
index fd101bb6a0..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/exr2fptiff.cc
+++ /dev/null
@@ -1,199 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#include "tinyexr.h"
-
-#define TINY_DNG_WRITER_IMPLEMENTATION
-#include "tiny_dng_writer.h"
-
-static bool Create32bitFpTiff(
- const float *data, // [width x height x in_channels]
- const size_t width,
- const size_t height,
- const size_t in_channels,
- const size_t channels,
- tinydngwriter::DNGImage *dng_image) {
-
- if (in_channels < 1) return false;
-
- unsigned int image_width = uint32_t(width);
- unsigned int image_height = uint32_t(height);
-
- //dng_image->SetSubfileType(false, false, false);
- dng_image->SetImageWidth(image_width);
- dng_image->SetImageLength(image_height);
- dng_image->SetRowsPerStrip(image_height);
- dng_image->SetSamplesPerPixel(uint16_t(channels));
- std::vector<uint16_t> bps(channels);
- for (size_t i = 0; i < bps.size(); i++) {
- bps[i] = 32;
- }
- dng_image->SetBitsPerSample(static_cast<unsigned int>(channels), bps.data());
- dng_image->SetPlanarConfig(tinydngwriter::PLANARCONFIG_CONTIG);
- dng_image->SetCompression(tinydngwriter::COMPRESSION_NONE);
- if (channels == 1) {
- dng_image->SetPhotometric(
- tinydngwriter::PHOTOMETRIC_BLACK_IS_ZERO); // grayscale
- } else {
- dng_image->SetPhotometric(
- tinydngwriter::PHOTOMETRIC_RGB);
- }
- dng_image->SetXResolution(1.0);
- dng_image->SetYResolution(1.0);
- dng_image->SetResolutionUnit(tinydngwriter::RESUNIT_NONE);
-
- std::vector<uint16_t> formats(channels);
- for (size_t i = 0; i < formats.size(); i++) {
- formats[i] = tinydngwriter::SAMPLEFORMAT_IEEEFP;
- }
- dng_image->SetSampleFormat(static_cast<unsigned int>(channels), formats.data());
-
- std::vector<float> buf;
- buf.resize(size_t(channels) * image_width * image_height);
-
- for (size_t i = 0; i < image_width * image_height; i++) {
- size_t in_c = 0;
- for (size_t c = 0; c < channels; c++) {
- buf[channels * i + c] = data[in_channels * i + in_c];
- in_c++;
- in_c = std::min(in_c, in_channels - 1);
- }
- }
-
- //size_t max_dump_pixels = 4096;
- //for (size_t i = 0; i < std::min(max_dump_pixels, buf.size()); i++) {
- // std::cout << "val[" << i << "] = " << buf[i] << "\n";
- //}
- //std::cout << "last = " << buf.at(image_width * image_height * channels - 1) << "\n";
-
- // We must retain pointer address of `buf` until calling DNGWriter::WriteToFile
- dng_image->SetImageData(reinterpret_cast<unsigned char *>(buf.data()),
- buf.size() * sizeof(float));
-
-
- if (!dng_image->Error().empty()) {
- std::cout << "Err: " << dng_image->Error() << "\n";
-
- return false;
- }
-
- return true;
-}
-
-int main(int argc, char** argv)
-{
- if (argc < 3) {
- printf("Usage: exr2fptiff input.exr output.tiff\n");
- exit(-1);
- }
-
- std::string input_filename = argv[1];
- std::string output_filename = argv[2];
-
-
- // Get # of layers
- size_t num_layers{0};
- {
-
- EXRVersion exr_version;
- {
- int ret = ParseEXRVersionFromFile(&exr_version, input_filename.c_str());
- if (ret != 0) {
- std::cerr << "Invalid EXR file: " << input_filename << "\n";
- return EXIT_FAILURE;
- }
-
- if (exr_version.multipart) {
- std::cerr << "Multipart EXR file is not supported in this example.\n";
- return EXIT_FAILURE;
- }
- }
-
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
-
- const char* err = nullptr;
- int ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, argv[1], &err);
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- std::cerr << "Parse EXR error: " << err << "\n";
- FreeEXRErrorMessage(err); // free's buffer for an error message
- } else {
- std::cerr << "Parse EXR error.\n";
- }
- return EXIT_FAILURE;
- }
-
- num_layers = size_t(exr_header.num_channels);
- if (num_layers == 0) {
- std::cerr << "no layers found\n";
- return EXIT_FAILURE;
- }
-
- if (num_layers > 4) {
- std::cerr << "This program supports up to 4(e.g. RGBA) layers.\n";
- return EXIT_FAILURE;
- }
-
- FreeEXRHeader(&exr_header);
- }
-
- std::cout << "# of channels = " << num_layers << "\n";
-
- // Use legacy but easy-to-use API to read image.
- float *rgba{nullptr};
- int width;
- int height;
- {
- const char *err;
- int ret = LoadEXR(&rgba, &width, &height, input_filename.c_str(), &err);
-
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- std::cerr << "Load EXR error: " << err << "\n";
- FreeEXRErrorMessage(err); // free's buffer for an error message
- } else {
- std::cerr << "Load EXR error.\n";
- }
- return EXIT_FAILURE;
- }
-
- }
-
- bool big_endian = false;
-
- tinydngwriter::DNGImage tiff;
- tiff.SetBigEndian(big_endian);
-
- bool ret = Create32bitFpTiff(rgba, size_t(width), size_t(height), /* in_channels */4, size_t(num_layers), &tiff);
- if (!ret) {
- std::cerr << "Failed to create floating point tiff data\n";
- return EXIT_FAILURE;
- }
-
- // 4. Free image data
- free(rgba);
-
- tinydngwriter::DNGWriter dng_writer(big_endian);
- ret = dng_writer.AddImage(&tiff);
- if (!ret) {
- std::cerr << "Failed to add TIFF image to TIFF writer.\n";
- return EXIT_FAILURE;
- }
-
- // 5. write tiff
- std::string err;
- ret = dng_writer.WriteToFile(output_filename.c_str(), &err);
-
- if (!err.empty()) {
- std::cerr << err;
- }
-
- if (!ret) {
- return EXIT_FAILURE;
- }
-
-
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/tiny_dng_writer.h b/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/tiny_dng_writer.h
deleted file mode 100644
index 6156821f3c..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2fptiff/tiny_dng_writer.h
+++ /dev/null
@@ -1,1356 +0,0 @@
-//
-// TinyDNGWriter, single header only DNG writer in C++11.
-//
-
-/*
-The MIT License (MIT)
-
-Copyright (c) 2016 - 2020 Syoyo Fujita.
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#ifndef TINY_DNG_WRITER_H_
-#define TINY_DNG_WRITER_H_
-
-#include <sstream>
-#include <vector>
-
-namespace tinydngwriter {
-
-typedef enum {
- TIFFTAG_SUB_FILETYPE = 254,
- TIFFTAG_IMAGE_WIDTH = 256,
- TIFFTAG_IMAGE_LENGTH = 257,
- TIFFTAG_BITS_PER_SAMPLE = 258,
- TIFFTAG_COMPRESSION = 259,
- TIFFTAG_PHOTOMETRIC = 262,
- TIFFTAG_IMAGEDESCRIPTION = 270,
- TIFFTAG_STRIP_OFFSET = 273,
- TIFFTAG_SAMPLES_PER_PIXEL = 277,
- TIFFTAG_ROWS_PER_STRIP = 278,
- TIFFTAG_STRIP_BYTE_COUNTS = 279,
- TIFFTAG_PLANAR_CONFIG = 284,
- TIFFTAG_ORIENTATION = 274,
-
- TIFFTAG_XRESOLUTION = 282, // rational
- TIFFTAG_YRESOLUTION = 283, // rational
- TIFFTAG_RESOLUTION_UNIT = 296,
-
- TIFFTAG_SAMPLEFORMAT = 339,
-
- // DNG extension
- TIFFTAG_CFA_REPEAT_PATTERN_DIM = 33421,
- TIFFTAG_CFA_PATTERN = 33422,
-
- TIFFTAG_DNG_VERSION = 50706,
- TIFFTAG_DNG_BACKWARD_VERSION = 50707,
- TIFFTAG_CHRROMA_BLUR_RADIUS = 50703,
- TIFFTAG_BLACK_LEVEL = 50714,
- TIFFTAG_WHITE_LEVEL = 50717,
- TIFFTAG_COLOR_MATRIX1 = 50721,
- TIFFTAG_COLOR_MATRIX2 = 50722,
- TIFFTAG_EXTRA_CAMERA_PROFILES = 50933,
- TIFFTAG_PROFILE_NAME = 50936,
- TIFFTAG_AS_SHOT_PROFILE_NAME = 50934,
- TIFFTAG_DEFAULT_BLACK_RENDER = 51110,
- TIFFTAG_ACTIVE_AREA = 50829,
- TIFFTAG_FORWARD_MATRIX1 = 50964,
- TIFFTAG_FORWARD_MATRIX2 = 50965
-} Tag;
-
-// SUBFILETYPE(bit field)
-static const int FILETYPE_REDUCEDIMAGE = 1;
-static const int FILETYPE_PAGE = 2;
-static const int FILETYPE_MASK = 4;
-
-// PLANARCONFIG
-static const int PLANARCONFIG_CONTIG = 1;
-static const int PLANARCONFIG_SEPARATE = 2;
-
-// COMPRESSION
-// TODO(syoyo) more compressin types.
-static const int COMPRESSION_NONE = 1;
-
-// ORIENTATION
-static const int ORIENTATION_TOPLEFT = 1;
-static const int ORIENTATION_TOPRIGHT = 2;
-static const int ORIENTATION_BOTRIGHT = 3;
-static const int ORIENTATION_BOTLEFT = 4;
-static const int ORIENTATION_LEFTTOP = 5;
-static const int ORIENTATION_RIGHTTOP = 6;
-static const int ORIENTATION_RIGHTBOT = 7;
-static const int ORIENTATION_LEFTBOT = 8;
-
-// RESOLUTIONUNIT
-static const int RESUNIT_NONE = 1;
-static const int RESUNIT_INCH = 2;
-static const int RESUNIT_CENTIMETER = 2;
-
-// PHOTOMETRIC
-// TODO(syoyo): more photometric types.
-static const int PHOTOMETRIC_WHITE_IS_ZERO = 0; // For bilevel and grayscale
-static const int PHOTOMETRIC_BLACK_IS_ZERO = 1; // For bilevel and grayscale
-static const int PHOTOMETRIC_RGB = 2; // Default
-static const int PHOTOMETRIC_CFA = 32893; // DNG ext
-static const int PHOTOMETRIC_LINEARRAW = 34892; // DNG ext
-
-// Sample format
-static const int SAMPLEFORMAT_UINT = 1; // Default
-static const int SAMPLEFORMAT_INT = 2;
-static const int SAMPLEFORMAT_IEEEFP = 3; // floating point
-
-struct IFDTag {
- unsigned short tag;
- unsigned short type;
- unsigned int count;
- unsigned int offset_or_value;
-};
-// 12 bytes.
-
-class DNGImage {
- public:
- DNGImage();
- ~DNGImage() {}
-
- ///
- /// Optional: Explicitly specify endian.
- /// Must be called before calling other Set methods.
- ///
- void SetBigEndian(bool big_endian);
-
- ///
- /// Default = 0
- ///
- bool SetSubfileType(bool reduced_image = false, bool page = false,
- bool mask = false);
-
- bool SetImageWidth(unsigned int value);
- bool SetImageLength(unsigned int value);
- bool SetRowsPerStrip(unsigned int value);
- bool SetSamplesPerPixel(unsigned short value);
- // Set bits for each samples
- bool SetBitsPerSample(const unsigned int num_samples,
- const unsigned short *values);
- bool SetPhotometric(unsigned short value);
- bool SetPlanarConfig(unsigned short value);
- bool SetOrientation(unsigned short value);
- bool SetCompression(unsigned short value);
- bool SetSampleFormat(const unsigned int num_samples,
- const unsigned short *values);
- bool SetXResolution(double value);
- bool SetYResolution(double value);
- bool SetResolutionUnit(const unsigned short value);
-
- bool SetImageDescription(const std::string &ascii);
-
- bool SetActiveArea(const unsigned int values[4]);
-
- bool SetChromaBlurRadius(double value);
-
- /// Specify black level per sample.
- bool SetBlackLevelRational(unsigned int num_samples, const double *values);
-
- /// Specify white level per sample.
- bool SetWhiteLevelRational(unsigned int num_samples, const double *values);
-
- /// Set image data
- bool SetImageData(const unsigned char *data, const size_t data_len);
-
- /// Set custom field
- bool SetCustomFieldLong(const unsigned short tag, const int value);
- bool SetCustomFieldULong(const unsigned short tag, const unsigned int value);
-
- size_t GetDataSize() const { return data_os_.str().length(); }
-
- size_t GetStripOffset() const { return data_strip_offset_; }
- size_t GetStripBytes() const { return data_strip_bytes_; }
-
- /// Write aux IFD data and strip image data to stream
- bool WriteDataToStream(std::ostream *ofs, std::string *err) const;
-
- ///
- /// Write IFD to stream.
- ///
- /// @param[in] data_base_offset : Byte offset to data
- /// @param[in] strip_offset : Byte offset to image strip data
- ///
- /// TODO(syoyo): Support multiple strips
- ///
- bool WriteIFDToStream(const unsigned int data_base_offset,
- const unsigned int strip_offset, std::ostream *ofs,
- std::string *err) const;
-
- std::string Error() const { return err_; }
-
- private:
- std::ostringstream data_os_;
- bool swap_endian_;
- bool dng_big_endian_;
- unsigned short num_fields_;
- unsigned int samples_per_pixels_;
- unsigned short bits_per_sample_;
-
- // TODO(syoyo): Support multiple strips
- size_t data_strip_offset_{0};
- size_t data_strip_bytes_{0};
-
- std::string err_; // Error message
-
- std::vector<IFDTag> ifd_tags_;
-};
-
-class DNGWriter {
- public:
- // TODO(syoyo): Use same endian setting with DNGImage.
- DNGWriter(bool big_endian);
- ~DNGWriter() {}
-
- ///
- /// Add DNGImage.
- /// It just retains the pointer of the image, thus
- /// application must not free resources until `WriteToFile` has been called.
- ///
- bool AddImage(const DNGImage *image) {
- images_.push_back(image);
-
- return true;
- }
-
- /// Write DNG to a file.
- /// Return error string to `err` when Write() returns false.
- /// Returns true upon success.
- bool WriteToFile(const char *filename, std::string *err) const;
-
- private:
- bool swap_endian_;
- bool dng_big_endian_; // Endianness of DNG file.
-
- std::vector<const DNGImage *> images_;
-};
-
-} // namespace tinydngwriter
-
-#endif // TINY_DNG_WRITER_H_
-
-#ifdef TINY_DNG_WRITER_IMPLEMENTATION
-
-//
-// TIFF format resources.
-//
-// http://c0de517e.blogspot.jp/2013/07/tiny-hdr-writer.html
-// http://paulbourke.net/dataformats/tiff/ and
-// http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf
-//
-
-#include <algorithm>
-#include <cassert>
-#include <cfloat>
-#include <cmath>
-#include <cstdint>
-#include <cstdlib>
-#include <cstring>
-#include <fstream>
-#include <iostream>
-#include <sstream>
-
-namespace tinydngwriter {
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#if __has_warning("-Wzero-as-null-pointer-constant")
-#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
-#endif
-#endif
-
-//
-// TinyDNGWriter stores IFD table in the end of file so that offset to
-// image data can be easily computed.
-//
-// +----------------------+
-// | header |
-// +----------------------+
-// | |
-// | image & meta 0 |
-// | |
-// +----------------------+
-// | |
-// | image & meta 1 |
-// | |
-// +----------------------+
-// ...
-// +----------------------+
-// | |
-// | image & meta N |
-// | |
-// +----------------------+
-// | |
-// | IFD 0 |
-// | |
-// +----------------------+
-// | |
-// | IFD 1 |
-// | |
-// +----------------------+
-// ...
-// +----------------------+
-// | |
-// | IFD 2 |
-// | |
-// +----------------------+
-//
-
-// From tiff.h
-typedef enum {
- TIFF_NOTYPE = 0, /* placeholder */
- TIFF_BYTE = 1, /* 8-bit unsigned integer */
- TIFF_ASCII = 2, /* 8-bit bytes w/ last byte null */
- TIFF_SHORT = 3, /* 16-bit unsigned integer */
- TIFF_LONG = 4, /* 32-bit unsigned integer */
- TIFF_RATIONAL = 5, /* 64-bit unsigned fraction */
- TIFF_SBYTE = 6, /* !8-bit signed integer */
- TIFF_UNDEFINED = 7, /* !8-bit untyped data */
- TIFF_SSHORT = 8, /* !16-bit signed integer */
- TIFF_SLONG = 9, /* !32-bit signed integer */
- TIFF_SRATIONAL = 10, /* !64-bit signed fraction */
- TIFF_FLOAT = 11, /* !32-bit IEEE floating point */
- TIFF_DOUBLE = 12, /* !64-bit IEEE floating point */
- TIFF_IFD = 13, /* %32-bit unsigned integer (offset) */
- TIFF_LONG8 = 16, /* BigTIFF 64-bit unsigned integer */
- TIFF_SLONG8 = 17, /* BigTIFF 64-bit signed integer */
- TIFF_IFD8 = 18 /* BigTIFF 64-bit unsigned integer (offset) */
-} DataType;
-
-const static int kHeaderSize = 8; // TIFF header size.
-
-// floating point to integer rational value conversion
-// https://stackoverflow.com/questions/51142275/exact-value-of-a-floating-point-number-as-a-rational
-//
-// Return error flag
-static int DoubleToRational(double x, double *numerator, double *denominator) {
- if (!std::isfinite(x)) {
- *numerator = *denominator = 0.0;
- if (x > 0.0) *numerator = 1.0;
- if (x < 0.0) *numerator = -1.0;
- return 1;
- }
-
- // TIFF Rational use two uint32's, so reduce the bits
- int bdigits = FLT_MANT_DIG;
- int expo;
- *denominator = 1.0;
- *numerator = std::frexp(x, &expo) * std::pow(2.0, bdigits);
- expo -= bdigits;
- if (expo > 0) {
- *numerator *= std::pow(2.0, expo);
- } else if (expo < 0) {
- expo = -expo;
- if (expo >= FLT_MAX_EXP - 1) {
- *numerator /= std::pow(2.0, expo - (FLT_MAX_EXP - 1));
- *denominator *= std::pow(2.0, FLT_MAX_EXP - 1);
- return fabs(*numerator) < 1.0;
- } else {
- *denominator *= std::pow(2.0, expo);
- }
- }
-
- while ((std::fabs(*numerator) > 0.0) &&
- (std::fabs(std::fmod(*numerator, 2)) <
- std::numeric_limits<double>::epsilon()) &&
- (std::fabs(std::fmod(*denominator, 2)) <
- std::numeric_limits<double>::epsilon())) {
- *numerator /= 2.0;
- *denominator /= 2.0;
- }
- return 0;
-}
-
-static inline bool IsBigEndian() {
- unsigned int i = 0x01020304;
- char c[4];
- memcpy(c, &i, 4);
- return (c[0] == 1);
-}
-
-static void swap2(unsigned short *val) {
- unsigned short tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[1];
- dst[1] = src[0];
-}
-
-static void swap4(unsigned int *val) {
- unsigned int tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- dst[3] = src[0];
-}
-
-static void swap8(uint64_t *val) {
- uint64_t tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[7];
- dst[1] = src[6];
- dst[2] = src[5];
- dst[3] = src[4];
- dst[4] = src[3];
- dst[5] = src[2];
- dst[6] = src[1];
- dst[7] = src[0];
-}
-
-static void Write1(const unsigned char c, std::ostringstream *out) {
- unsigned char value = c;
- out->write(reinterpret_cast<const char *>(&value), 1);
-}
-
-static void Write2(const unsigned short c, std::ostringstream *out,
- const bool swap_endian) {
- unsigned short value = c;
- if (swap_endian) {
- swap2(&value);
- }
-
- out->write(reinterpret_cast<const char *>(&value), 2);
-}
-
-static void Write4(const unsigned int c, std::ostringstream *out,
- const bool swap_endian) {
- unsigned int value = c;
- if (swap_endian) {
- swap4(&value);
- }
-
- out->write(reinterpret_cast<const char *>(&value), 4);
-}
-
-static bool WriteTIFFTag(const unsigned short tag, const unsigned short type,
- const unsigned int count, const unsigned char *data,
- std::vector<IFDTag> *tags_out,
- std::ostringstream *data_out) {
- assert(sizeof(IFDTag) ==
- 12); // FIXME(syoyo): Use static_assert for C++11 compiler
-
- IFDTag ifd;
- ifd.tag = tag;
- ifd.type = type;
- ifd.count = count;
-
- size_t typesize_table[] = {1, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4};
-
- size_t len = count * (typesize_table[(type) < 14 ? (type) : 0]);
- if (len > 4) {
- assert(data_out);
- if (!data_out) {
- return false;
- }
-
- // Store offset value.
-
- unsigned int offset =
- static_cast<unsigned int>(data_out->tellp()) + kHeaderSize;
- ifd.offset_or_value = offset;
-
- data_out->write(reinterpret_cast<const char *>(data),
- static_cast<std::streamsize>(len));
-
- } else {
- ifd.offset_or_value = 0;
-
- // less than 4 bytes = store data itself.
- if (len == 1) {
- unsigned char value = *(data);
- memcpy(&(ifd.offset_or_value), &value, sizeof(unsigned char));
- } else if (len == 2) {
- unsigned short value = *(reinterpret_cast<const unsigned short *>(data));
- memcpy(&(ifd.offset_or_value), &value, sizeof(unsigned short));
- } else if (len == 4) {
- unsigned int value = *(reinterpret_cast<const unsigned int *>(data));
- ifd.offset_or_value = value;
- } else {
- assert(0);
- }
- }
-
- tags_out->push_back(ifd);
-
- return true;
-}
-
-static bool WriteTIFFVersionHeader(std::ostringstream *out, bool big_endian) {
- // TODO(syoyo): Support BigTIFF?
-
- // 4d 4d = Big endian. 49 49 = Little endian.
- if (big_endian) {
- Write1(0x4d, out);
- Write1(0x4d, out);
- Write1(0x0, out);
- Write1(0x2a, out); // Tiff version ID
- } else {
- Write1(0x49, out);
- Write1(0x49, out);
- Write1(0x2a, out); // Tiff version ID
- Write1(0x0, out);
- }
-
- return true;
-}
-
-DNGImage::DNGImage()
- : dng_big_endian_(true),
- num_fields_(0),
- samples_per_pixels_(0),
- bits_per_sample_(0),
- data_strip_offset_{0},
- data_strip_bytes_{0} {
- swap_endian_ = (IsBigEndian() != dng_big_endian_);
-}
-
-void DNGImage::SetBigEndian(bool big_endian) {
- dng_big_endian_ = big_endian;
- swap_endian_ = (IsBigEndian() != dng_big_endian_);
-}
-
-bool DNGImage::SetSubfileType(bool reduced_image, bool page, bool mask) {
- unsigned int count = 1;
-
- unsigned int bits = 0;
- if (reduced_image) {
- bits |= FILETYPE_REDUCEDIMAGE;
- }
- if (page) {
- bits |= FILETYPE_PAGE;
- }
- if (mask) {
- bits |= FILETYPE_MASK;
- }
-
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_SUB_FILETYPE), TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(&bits), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetImageWidth(const unsigned int width) {
- unsigned int count = 1;
-
- unsigned int data = width;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_IMAGE_WIDTH), TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetImageLength(const unsigned int length) {
- unsigned int count = 1;
-
- const unsigned int data = length;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_IMAGE_LENGTH), TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetRowsPerStrip(const unsigned int rows) {
- if (rows == 0) {
- return false;
- }
-
- unsigned int count = 1;
-
- const unsigned int data = rows;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_ROWS_PER_STRIP), TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetSamplesPerPixel(const unsigned short value) {
- if (value > 4) {
- return false;
- }
-
- unsigned int count = 1;
-
- const unsigned short data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_SAMPLES_PER_PIXEL), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- samples_per_pixels_ = value; // Store SPP for later use.
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetBitsPerSample(const unsigned int num_samples,
- const unsigned short *values) {
- // `SetSamplesPerPixel()` must be called in advance and SPP shoud be equal to
- // `num_samples`.
- if ((num_samples > 0) && (num_samples == samples_per_pixels_)) {
- // OK
- } else {
- err_ += "SetSamplesPerPixel() must be called before SetBitsPerSample().\n";
- return false;
- }
-
- unsigned short bps = values[0];
-
- std::vector<unsigned short> vs(num_samples);
- for (size_t i = 0; i < vs.size(); i++) {
- // FIXME(syoyo): Currently bps must be same for all samples
- if (bps != values[i]) {
- err_ += "BitsPerSample must be same among samples at the moment.\n";
- return false;
- }
-
- vs[i] = values[i];
-
- // TODO(syoyo): Swap values when writing IFD tag, not here.
- if (swap_endian_) {
- swap2(&vs[i]);
- }
- }
-
- unsigned int count = num_samples;
-
- bool ret = WriteTIFFTag(static_cast<unsigned short>(TIFFTAG_BITS_PER_SAMPLE),
- TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(vs.data()),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- // Store BPS for later use.
- bits_per_sample_ = bps;
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetPhotometric(const unsigned short value) {
- if ((value == PHOTOMETRIC_LINEARRAW) || (value == PHOTOMETRIC_RGB) ||
- (value == PHOTOMETRIC_WHITE_IS_ZERO) ||
- (value == PHOTOMETRIC_BLACK_IS_ZERO)) {
- // OK
- } else {
- return false;
- }
-
- unsigned int count = 1;
-
- const unsigned short data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_PHOTOMETRIC), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetPlanarConfig(const unsigned short value) {
- unsigned int count = 1;
-
- if ((value == PLANARCONFIG_CONTIG) || (value == PLANARCONFIG_SEPARATE)) {
- // OK
- } else {
- return false;
- }
-
- const unsigned short data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_PLANAR_CONFIG), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetCompression(const unsigned short value) {
- unsigned int count = 1;
-
- if ((value == COMPRESSION_NONE)) {
- // OK
- } else {
- return false;
- }
-
- const unsigned short data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_COMPRESSION), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetSampleFormat(const unsigned int num_samples,
- const unsigned short *values) {
- // `SetSamplesPerPixel()` must be called in advance
- if ((num_samples > 0) && (num_samples == samples_per_pixels_)) {
- // OK
- } else {
- err_ += "SetSamplesPerPixel() must be called before SetSampleFormat().\n";
- return false;
- }
-
- unsigned short format = values[0];
-
- std::vector<unsigned short> vs(num_samples);
- for (size_t i = 0; i < vs.size(); i++) {
- // FIXME(syoyo): Currently format must be same for all samples
- if (format != values[i]) {
- err_ += "SampleFormat must be same among samples at the moment.\n";
- return false;
- }
-
- if ((format == SAMPLEFORMAT_UINT) || (format == SAMPLEFORMAT_INT) ||
- (format == SAMPLEFORMAT_IEEEFP)) {
- // OK
- } else {
- err_ += "Invalid format value specified for SetSampleFormat().\n";
- return false;
- }
-
- vs[i] = values[i];
-
- // TODO(syoyo): Swap values when writing IFD tag, not here.
- if (swap_endian_) {
- swap2(&vs[i]);
- }
- }
-
- unsigned int count = num_samples;
-
- bool ret = WriteTIFFTag(static_cast<unsigned short>(TIFFTAG_SAMPLEFORMAT),
- TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(vs.data()),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetOrientation(const unsigned short value) {
- unsigned int count = 1;
-
- if ((value == ORIENTATION_TOPLEFT) || (value == ORIENTATION_TOPRIGHT) ||
- (value == ORIENTATION_BOTRIGHT) || (value == ORIENTATION_BOTLEFT) ||
- (value == ORIENTATION_LEFTTOP) || (value == ORIENTATION_RIGHTTOP) ||
- (value == ORIENTATION_RIGHTBOT) || (value == ORIENTATION_LEFTBOT)) {
- // OK
- } else {
- return false;
- }
-
- const unsigned int data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_ORIENTATION), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetBlackLevelRational(unsigned int num_samples,
- const double *values) {
- // `SetSamplesPerPixel()` must be called in advance and SPP shoud be equal to
- // `num_samples`.
- if ((num_samples > 0) && (num_samples == samples_per_pixels_)) {
- // OK
- } else {
- return false;
- }
-
- std::vector<unsigned int> vs(num_samples * 2);
- for (size_t i = 0; i < vs.size(); i++) {
- double numerator, denominator;
- if (DoubleToRational(values[i], &numerator, &denominator) != 0) {
- // Couldn't represent fp value as integer rational value.
- return false;
- }
-
- vs[2 * i + 0] = static_cast<unsigned int>(numerator);
- vs[2 * i + 1] = static_cast<unsigned int>(denominator);
-
- // TODO(syoyo): Swap rational value(8 bytes) when writing IFD tag, not here.
- if (swap_endian_) {
- swap4(&vs[2 * i + 0]);
- swap4(&vs[2 * i + 1]);
- }
- }
-
- unsigned int count = num_samples;
-
- bool ret = WriteTIFFTag(static_cast<unsigned short>(TIFFTAG_BLACK_LEVEL),
- TIFF_RATIONAL, count,
- reinterpret_cast<const unsigned char *>(vs.data()),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetWhiteLevelRational(unsigned int num_samples,
- const double *values) {
- // `SetSamplesPerPixel()` must be called in advance and SPP shoud be equal to
- // `num_samples`.
- if ((num_samples > 0) && (num_samples == samples_per_pixels_)) {
- // OK
- } else {
- return false;
- }
-
- std::vector<unsigned int> vs(num_samples * 2);
- for (size_t i = 0; i < vs.size(); i++) {
- double numerator, denominator;
- if (DoubleToRational(values[i], &numerator, &denominator) != 0) {
- // Couldn't represent fp value as integer rational value.
- return false;
- }
-
- vs[2 * i + 0] = static_cast<unsigned int>(numerator);
- vs[2 * i + 1] = static_cast<unsigned int>(denominator);
-
- // TODO(syoyo): Swap rational value(8 bytes) when writing IFD tag, not here.
- if (swap_endian_) {
- swap4(&vs[2 * i + 0]);
- swap4(&vs[2 * i + 1]);
- }
- }
-
- unsigned int count = num_samples;
-
- bool ret = WriteTIFFTag(static_cast<unsigned short>(TIFFTAG_WHITE_LEVEL),
- TIFF_RATIONAL, count,
- reinterpret_cast<const unsigned char *>(vs.data()),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetXResolution(const double value) {
- double numerator, denominator;
- if (DoubleToRational(value, &numerator, &denominator) != 0) {
- // Couldn't represent fp value as integer rational value.
- return false;
- }
-
- unsigned int data[2];
- data[0] = static_cast<unsigned int>(numerator);
- data[1] = static_cast<unsigned int>(denominator);
-
- // TODO(syoyo): Swap rational value(8 bytes) when writing IFD tag, not here.
- if (swap_endian_) {
- swap4(&data[0]);
- swap4(&data[1]);
- }
-
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_XRESOLUTION), TIFF_RATIONAL, 1,
- reinterpret_cast<const unsigned char *>(data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetYResolution(const double value) {
- double numerator, denominator;
- if (DoubleToRational(value, &numerator, &denominator) != 0) {
- // Couldn't represent fp value as integer rational value.
- return false;
- }
-
- unsigned int data[2];
- data[0] = static_cast<unsigned int>(numerator);
- data[1] = static_cast<unsigned int>(denominator);
-
- // TODO(syoyo): Swap rational value(8 bytes) when writing IFD tag, not here.
- if (swap_endian_) {
- swap4(&data[0]);
- swap4(&data[1]);
- }
-
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_YRESOLUTION), TIFF_RATIONAL, 1,
- reinterpret_cast<const unsigned char *>(data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetResolutionUnit(const unsigned short value) {
- unsigned int count = 1;
-
- if ((value == RESUNIT_NONE) || (value == RESUNIT_INCH) ||
- (value == RESUNIT_CENTIMETER)) {
- // OK
- } else {
- return false;
- }
-
- const unsigned short data = value;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_RESOLUTION_UNIT), TIFF_SHORT, count,
- reinterpret_cast<const unsigned char *>(&data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetImageDescription(const std::string &ascii) {
- unsigned int count =
- static_cast<unsigned int>(ascii.length() + 1); // +1 for '\0'
-
- if (count < 2) {
- // empty string
- return false;
- }
-
- if (count > (1024 * 1024)) {
- // too large
- return false;
- }
-
- bool ret = WriteTIFFTag(static_cast<unsigned short>(TIFFTAG_IMAGEDESCRIPTION),
- TIFF_ASCII, count,
- reinterpret_cast<const unsigned char *>(ascii.data()),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetActiveArea(const unsigned int values[4]) {
- unsigned int count = 4;
-
- const unsigned int *data = values;
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_ACTIVE_AREA), TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(data), &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetImageData(const unsigned char *data, const size_t data_len) {
- if ((data == NULL) || (data_len < 1)) {
- return false;
- }
-
- data_strip_offset_ = size_t(data_os_.tellp());
- data_strip_bytes_ = data_len;
-
- data_os_.write(reinterpret_cast<const char *>(data),
- static_cast<std::streamsize>(data_len));
-
- // NOTE: STRIP_OFFSET tag will be written at `WriteIFDToStream()`.
-
- {
- unsigned int count = 1;
- unsigned int bytes = static_cast<unsigned int>(data_len);
-
- bool ret = WriteTIFFTag(
- static_cast<unsigned short>(TIFFTAG_STRIP_BYTE_COUNTS), TIFF_LONG,
- count, reinterpret_cast<const unsigned char *>(&bytes), &ifd_tags_,
- NULL);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- }
-
- return true;
-}
-
-bool DNGImage::SetCustomFieldLong(const unsigned short tag, const int value) {
- unsigned int count = 1;
-
- // TODO(syoyo): Check if `tag` value does not conflict with existing TIFF tag
- // value.
-
- bool ret = WriteTIFFTag(tag, TIFF_SLONG, count,
- reinterpret_cast<const unsigned char *>(&value),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-bool DNGImage::SetCustomFieldULong(const unsigned short tag,
- const unsigned int value) {
- unsigned int count = 1;
-
- // TODO(syoyo): Check if `tag` value does not conflict with existing TIFF tag
- // value.
-
- bool ret = WriteTIFFTag(tag, TIFF_LONG, count,
- reinterpret_cast<const unsigned char *>(&value),
- &ifd_tags_, &data_os_);
-
- if (!ret) {
- return false;
- }
-
- num_fields_++;
- return true;
-}
-
-static bool IFDComparator(const IFDTag &a, const IFDTag &b) {
- return (a.tag < b.tag);
-}
-
-bool DNGImage::WriteDataToStream(std::ostream *ofs, std::string *err) const {
- if ((data_os_.str().length() == 0)) {
- if (err) {
- (*err) += "Empty IFD data and image data.\n";
- }
- return false;
- }
-
- if ((bits_per_sample_ == 0) || (samples_per_pixels_ == 0)) {
- if (err) {
- (*err) += "Both BitsPerSample and SamplesPerPixels must be set.\n";
- }
- return false;
- }
-
- std::vector<uint8_t> data(data_os_.str().length());
- memcpy(data.data(), data_os_.str().data(), data.size());
-
- if (data_strip_bytes_ == 0) {
- // May ok?.
- } else {
- // FIXME(syoyo): Assume all channels use sample bps
-
- // We may need to swap endian for pixel data.
- if (swap_endian_) {
- if (bits_per_sample_ == 16) {
- size_t n = data_strip_bytes_ / sizeof(uint16_t);
- uint16_t *ptr =
- reinterpret_cast<uint16_t *>(data.data() + data_strip_offset_);
-
- for (size_t i = 0; i < n; i++) {
- swap2(&ptr[i]);
- }
-
- } else if (bits_per_sample_ == 32) {
- size_t n = data_strip_bytes_ / sizeof(uint32_t);
- uint32_t *ptr =
- reinterpret_cast<uint32_t *>(data.data() + data_strip_offset_);
-
- for (size_t i = 0; i < n; i++) {
- swap4(&ptr[i]);
- }
-
- } else if (bits_per_sample_ == 64) {
- size_t n = data_strip_bytes_ / sizeof(uint64_t);
- uint64_t *ptr =
- reinterpret_cast<uint64_t *>(data.data() + data_strip_offset_);
-
- for (size_t i = 0; i < n; i++) {
- swap8(&ptr[i]);
- }
- }
- }
- }
-
- ofs->write(reinterpret_cast<const char *>(data.data()),
- static_cast<std::streamsize>(data.size()));
-
- return true;
-}
-
-bool DNGImage::WriteIFDToStream(const unsigned int data_base_offset,
- const unsigned int strip_offset,
- std::ostream *ofs, std::string *err) const {
- if ((num_fields_ == 0) || (ifd_tags_.size() < 1)) {
- if (err) {
- (*err) += "No TIFF Tags.\n";
- }
- return false;
- }
-
- // add STRIP_OFFSET tag and sort IFD tags.
- std::vector<IFDTag> tags = ifd_tags_;
- {
- // For STRIP_OFFSET we need the actual offset value to data(image),
- // thus write STRIP_OFFSET here.
- unsigned int offset = strip_offset + kHeaderSize;
- IFDTag ifd;
- ifd.tag = TIFFTAG_STRIP_OFFSET;
- ifd.type = TIFF_LONG;
- ifd.count = 1;
- ifd.offset_or_value = offset;
- tags.push_back(ifd);
- }
-
- // TIFF expects IFD tags are sorted.
- std::sort(tags.begin(), tags.end(), IFDComparator);
-
- std::ostringstream ifd_os;
-
- unsigned short num_fields = static_cast<unsigned short>(tags.size());
-
- Write2(num_fields, &ifd_os, swap_endian_);
-
- {
- size_t typesize_table[] = {1, 1, 1, 2, 4, 8, 1, 1, 2, 4, 8, 4, 8, 4};
-
- for (size_t i = 0; i < tags.size(); i++) {
- const IFDTag &ifd = tags[i];
- Write2(ifd.tag, &ifd_os, swap_endian_);
- Write2(ifd.type, &ifd_os, swap_endian_);
- Write4(ifd.count, &ifd_os, swap_endian_);
-
- size_t len =
- ifd.count * (typesize_table[(ifd.type) < 14 ? (ifd.type) : 0]);
- if (len > 4) {
- // Store offset value.
- unsigned int ifd_offt = ifd.offset_or_value + data_base_offset;
- Write4(ifd_offt, &ifd_os, swap_endian_);
- } else {
- // less than 4 bytes = store data itself.
-
- if (len == 1) {
- const unsigned char value =
- *(reinterpret_cast<const unsigned char *>(&ifd.offset_or_value));
- Write1(value, &ifd_os);
- unsigned char pad = 0;
- Write1(pad, &ifd_os);
- Write1(pad, &ifd_os);
- Write1(pad, &ifd_os);
- } else if (len == 2) {
- const unsigned short value =
- *(reinterpret_cast<const unsigned short *>(&ifd.offset_or_value));
- Write2(value, &ifd_os, swap_endian_);
- const unsigned short pad = 0;
- Write2(pad, &ifd_os, swap_endian_);
- } else if (len == 4) {
- const unsigned int value =
- *(reinterpret_cast<const unsigned int *>(&ifd.offset_or_value));
- Write4(value, &ifd_os, swap_endian_);
- } else {
- assert(0);
- }
- }
- }
-
- ofs->write(ifd_os.str().c_str(),
- static_cast<std::streamsize>(ifd_os.str().length()));
- }
-
- return true;
-}
-
-// -------------------------------------------
-
-DNGWriter::DNGWriter(bool big_endian) : dng_big_endian_(big_endian) {
- swap_endian_ = (IsBigEndian() != dng_big_endian_);
-}
-
-bool DNGWriter::WriteToFile(const char *filename, std::string *err) const {
- std::ofstream ofs(filename, std::ostream::binary);
-
- if (!ofs) {
- if (err) {
- (*err) = "Failed to open file.\n";
- }
-
- return false;
- }
-
- std::ostringstream header;
- bool ret = WriteTIFFVersionHeader(&header, dng_big_endian_);
- if (!ret) {
- return false;
- }
-
- if (images_.size() == 0) {
- if (err) {
- (*err) = "No image added for writing.\n";
- }
-
- return false;
- }
-
- // 1. Compute offset and data size(exclude TIFF header bytes)
- size_t data_len = 0;
- size_t strip_offset = 0;
- std::vector<size_t> data_offset_table;
- std::vector<size_t> strip_offset_table;
- for (size_t i = 0; i < images_.size(); i++) {
- strip_offset = data_len + images_[i]->GetStripOffset();
- data_offset_table.push_back(data_len);
- strip_offset_table.push_back(strip_offset);
- data_len += images_[i]->GetDataSize();
- }
-
- // 2. Write offset to ifd table.
- const unsigned int ifd_offset =
- kHeaderSize + static_cast<unsigned int>(data_len);
- Write4(ifd_offset, &header, swap_endian_);
-
- assert(header.str().length() == 8);
-
- // std::cout << "ifd_offset " << ifd_offset << std::endl;
- // std::cout << "data_len " << data_os_.str().length() << std::endl;
- // std::cout << "ifd_len " << ifd_os_.str().length() << std::endl;
- // std::cout << "swap endian " << swap_endian_ << std::endl;
-
- // 3. Write header
- ofs.write(header.str().c_str(),
- static_cast<std::streamsize>(header.str().length()));
-
- // 4. Write image and meta data
- // TODO(syoyo): Write IFD first, then image/meta data
- for (size_t i = 0; i < images_.size(); i++) {
- bool ok = images_[i]->WriteDataToStream(&ofs, err);
- if (!ok) {
- return false;
- }
- }
-
- // 5. Write IFD entries;
- for (size_t i = 0; i < images_.size(); i++) {
- bool ok = images_[i]->WriteIFDToStream(
- static_cast<unsigned int>(data_offset_table[i]),
- static_cast<unsigned int>(strip_offset_table[i]), &ofs, err);
- if (!ok) {
- return false;
- }
-
- unsigned int next_ifd_offset =
- static_cast<unsigned int>(ofs.tellp()) + sizeof(unsigned int);
-
- if (i == (images_.size() - 1)) {
- // Write zero as IFD offset(= end of data)
- next_ifd_offset = 0;
- }
-
- if (swap_endian_) {
- swap4(&next_ifd_offset);
- }
-
- ofs.write(reinterpret_cast<const char *>(&next_ifd_offset), 4);
- }
-
- return true;
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-} // namespace tinydngwriter
-
-#endif // TINY_DNG_WRITER_IMPLEMENTATION
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/Makefile
deleted file mode 100644
index 532212ee4a..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- clang -g -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- clang++ -g -fsanitize=address -O2 -o exr2ldr -I../common -I../../ -I../../deps/miniz exr2ldr.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/exr2ldr.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/exr2ldr.cc
deleted file mode 100644
index a401211cb5..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2ldr/exr2ldr.cc
+++ /dev/null
@@ -1,111 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-#endif
-
-#define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include "stb_image_resize.h"
-
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include "stb_image_write.h"
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#include "tinyexr.h"
-
-inline unsigned char ftouc(float f, float gamma)
-{
- int i = static_cast<int>(255.0f * powf(f, 1.0f / gamma));
- if (i > 255) i = 255;
- if (i < 0) i = 0;
-
- return static_cast<unsigned char>(i);
-}
-
-bool SaveImage(const char* filename, const float* rgba, float scale, float gamma, int width, int height, bool ignore_alpha) {
-
- std::vector<unsigned char> dst(width * height * 4);
-
- // alpha channel is also affected by `scale` parameter.
- if(ignore_alpha) {
- for (size_t i = 0; i < width * height; i++) {
- dst[i * 4 + 0] = ftouc(rgba[i * 4 + 0] * scale, gamma);
- dst[i * 4 + 1] = ftouc(rgba[i * 4 + 1] * scale, gamma);
- dst[i * 4 + 2] = ftouc(rgba[i * 4 + 2] * scale, gamma);
- dst[i * 4 + 3] = 255;
- }
- } else {
- for (size_t i = 0; i < width * height * 4; i++) {
- dst[i] = ftouc(rgba[i] * scale, gamma);
- }
- }
-
- int ret = stbi_write_png(filename, width, height, 4, static_cast<const void*>(dst.data()), width * 4);
-
- return (ret > 0);
-}
-
-int main(int argc, char** argv)
-{
- if (argc < 3) {
- printf("Usage: exr2ldr input.exr output.png (scale) (resize_factor) (gammavalue) (-i or --ignore-alpha).\n");
- printf(" Pixel value [0.0, 1.0] in EXR is mapped to [0, 255] for LDR image.\n");
- printf(" You can adjust pixel value by `scale`(default = 1.0).\n");
- printf(" Resize image using `resize_factor`(default = 1.0). 2 = create half size image, 4 = 1/4 image, and so on\n");
- printf(" gammmavalue will be used for gamma correction when saving png image(default = 2.2).\n");
- printf(" Ignore alpha value of input using -i or --ignore-alpha flag, and alpha of output is set to 255.\n");
- exit(-1);
- }
-
- float scale = 1.0f;
- if (argc > 3) {
- scale = atof(argv[3]);
- }
-
- float resize_factor = 1.0f;
- if (argc > 4) {
- resize_factor = atof(argv[4]);
- }
-
- float gamma = 2.2f;
- if (argc > 5) {
- gamma = atof(argv[5]);
- }
-
- bool ignore_alpha = false;
- if (argc > 6 && (strcmp(argv[6], "-i") == 0 || strcmp(argv[6], "--ignore-alpha") == 0)) {
- ignore_alpha = true;
- }
-
- int width, height;
- float* rgba;
- const char* err;
-
- {
- int ret = LoadEXR(&rgba, &width, &height, argv[1], &err);
- if (ret != 0) {
- printf("err: %s\n", err);
- return -1;
- }
- }
-
- int dst_width = width / resize_factor;
- int dst_height = height / resize_factor;
- printf("dst = %d, %d\n", dst_width, dst_height);
-
- std::vector<float> buf(dst_width * dst_height * 4);
- int ret = stbir_resize_float(rgba, width, height, width*4*sizeof(float), &buf.at(0), dst_width, dst_height,dst_width*4*sizeof(float), 4);
- assert(ret != 0);
-
- bool ok = SaveImage(argv[2], &buf.at(0), scale, gamma, dst_width, dst_height, ignore_alpha);
-
- free(rgba);
-
- return (ok ? 0 : -1);
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/Makefile
deleted file mode 100644
index f0356eb491..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- gcc -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- g++ -O2 -o exr2rgbe -I../common -I../../ -I../../deps/miniz exr2rgbe.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/exr2rgbe.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/exr2rgbe.cc
deleted file mode 100644
index 2631590488..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exr2rgbe/exr2rgbe.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include "stb_image_write.h"
-
-#include "tinyexr.h"
-
-int main(int argc, char** argv)
-{
- if (argc < 3) {
- printf("Usage: exr2rgbe input.exr output.hdr\n");
- exit(-1);
- }
-
- int width, height;
- float* rgba;
- const char* err;
-
- {
- int ret = LoadEXR(&rgba, &width, &height, argv[1], &err);
- if (ret != 0) {
- printf("err: %s\n", err);
- return -1;
- }
- }
-
- {
- int ret = stbi_write_hdr(argv[2], width, height, 4, rgba);
-
- if (ret == 0) {
- return -1; // fail
- }
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/Makefile
deleted file mode 100644
index c2e740ce0d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- gcc -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- g++ -std=c++11 -O2 -o exrfilter -I../common -I../../ -I ../../deps/miniz exrfilter.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/README.md
deleted file mode 100644
index 8317ac1bad..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-Simple EXR filtering program.
-
-Currently implemented are
-
-- Clip min/max intensity(RGB)
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/exrfilter.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/exrfilter.cc
deleted file mode 100644
index b766c1d622..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrfilter/exrfilter.cc
+++ /dev/null
@@ -1,150 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#include "tinyexr.h"
-
-#include "cxxopts.hpp"
-
-int main(int argc, char** argv)
-{
-
- float min_value = -std::numeric_limits<float>::max();
- float max_value = std::numeric_limits<float>::max();
-
- float rgb_min[3] = {min_value, min_value, min_value};
- float rgb_max[3] = {max_value, max_value, max_value};
-
- cxxopts::Options options("normalmap", "help");
- options.show_positional_help();
-
- options.add_options()
- ("max", "Max intensity(apply all RGB channels)", cxxopts::value<float>())
- ("rmax", "Max Red intensity", cxxopts::value<float>())
- ("gmax", "Max Green intensity", cxxopts::value<float>())
- ("bmax", "Max Blue intensity", cxxopts::value<float>())
- ("min", "Min intensity(apply all RGB channels)", cxxopts::value<float>())
- ("rmin", "Min Red intensity", cxxopts::value<float>())
- ("gmin", "Min Green intensity", cxxopts::value<float>())
- ("bmin", "Min Blue intensity", cxxopts::value<float>())
- ("i,input", "Input filename", cxxopts::value<std::string>())
- ("o,output", "Output filename", cxxopts::value<std::string>())
- ("help", "Print help")
- ;
-
- auto result = options.parse(argc, argv);
-
- if (result.count("help")) {
- std::cout << options.help() << std::endl;
- }
-
- if (result.count("input") == 0) {
- std::cerr << "input filename missing" << std::endl;
- std::cout << options.help() << std::endl;
- return EXIT_FAILURE;
- }
-
- if (result.count("output") == 0) {
- std::cerr << "output filename missing" << std::endl;
- std::cout << options.help() << std::endl;
- return EXIT_FAILURE;
- }
-
- std::string input_filename = result["input"].as<std::string>();
- std::string output_filename = result["output"].as<std::string>();
-
-
- if (result.count("max")) {
- rgb_max[0] = result["max"].as<float>();
- rgb_max[1] = result["max"].as<float>();
- rgb_max[2] = result["max"].as<float>();
- }
- if (result.count("rmax")) {
- rgb_max[0] = result["rmax"].as<float>();
- }
- if (result.count("gmax")) {
- rgb_max[1] = result["gmax"].as<float>();
- }
- if (result.count("bmax")) {
- rgb_max[2] = result["bmax"].as<float>();
- }
-
- if (result.count("min")) {
- rgb_min[0] = result["min"].as<float>();
- rgb_min[1] = result["min"].as<float>();
- rgb_min[2] = result["min"].as<float>();
- }
- if (result.count("rmin")) {
- rgb_min[0] = result["rmin"].as<float>();
- }
- if (result.count("gmin")) {
- rgb_min[1] = result["gmin"].as<float>();
- }
- if (result.count("bmin")) {
- rgb_min[2] = result["bmin"].as<float>();
- }
-
- float *rgba = nullptr;
- int width, height;
- const char *err = nullptr;
- {
- int ret = LoadEXR(&rgba, &width, &height, input_filename.c_str(), &err);
- if (TINYEXR_SUCCESS != ret) {
- std::cerr << "Failed to load EXR file [" << input_filename << "] code = " << ret << std::endl;
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
-
- return EXIT_FAILURE;
- }
- }
-
- // clip pixel values.
- // ignore alpha channel for now.
- std::vector<float> rgb;
- rgb.resize(width * height * 3);
-
- float v_max[3] = {
- -std::numeric_limits<float>::max(),
- -std::numeric_limits<float>::max(),
- -std::numeric_limits<float>::max()};
- float v_min[3] = {
- std::numeric_limits<float>::max(),
- std::numeric_limits<float>::max(),
- std::numeric_limits<float>::max()};
-
- {
- for (size_t i = 0; i < width * height; i++) {
- rgb[3 * i + 0] = std::max(rgb_min[0], std::min(rgb_max[0], rgba[4 * i + 0]));
- rgb[3 * i + 1] = std::max(rgb_min[1], std::min(rgb_max[1], rgba[4 * i + 1]));
- rgb[3 * i + 2] = std::max(rgb_min[2], std::min(rgb_max[2], rgba[4 * i + 2]));
-
- v_max[0] = std::max(rgb[3 * i + 0], v_max[0]);
- v_max[1] = std::max(rgb[3 * i + 1], v_max[1]);
- v_max[2] = std::max(rgb[3 * i + 2], v_max[2]);
-
- v_min[0] = std::min(rgb[3 * i + 0], v_min[0]);
- v_min[1] = std::min(rgb[3 * i + 1], v_min[1]);
- v_min[2] = std::min(rgb[3 * i + 2], v_min[2]);
-
- }
- }
-
- std::cout << "v min = " << v_min[0] << ", " << v_min[1] << ", " << v_min[2] << std::endl;
- std::cout << "v max = " << v_max[0] << ", " << v_max[1] << ", " << v_max[2] << std::endl;
-
- {
- int ret = SaveEXR(rgb.data(), width, height, /* component */3, /* fp16 */0, output_filename.c_str(), &err);
- if (TINYEXR_SUCCESS != ret) {
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
- std::cerr << "Failed to save EXR file [" << input_filename << "] code = " << ret << std::endl;
- return EXIT_FAILURE;
- }
- }
-
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/DroidSans.ttf b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/DroidSans.ttf
deleted file mode 100644
index 767c63ad00..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/DroidSans.ttf
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/CommonWindowInterface.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/CommonWindowInterface.h
deleted file mode 100644
index 346fdac72a..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/CommonWindowInterface.h
+++ /dev/null
@@ -1,130 +0,0 @@
-#ifndef B3G_WINDOW_INTERFACE_H
-#define B3G_WINDOW_INTERFACE_H
-
-
-typedef void (*b3WheelCallback)(float deltax, float deltay);
-typedef void (*b3ResizeCallback)( float width, float height);
-typedef void (*b3MouseMoveCallback)( float x, float y);
-typedef void (*b3MouseButtonCallback)(int button, int state, float x, float y);
-typedef void (*b3KeyboardCallback)(int keycode, int state);
-typedef void (*b3RenderCallback) ();
-
-enum {
- B3G_ESCAPE = 27,
- B3G_F1 = 0xff00,
- B3G_F2,
- B3G_F3,
- B3G_F4,
- B3G_F5,
- B3G_F6,
- B3G_F7,
- B3G_F8,
- B3G_F9,
- B3G_F10,
- B3G_F11,
- B3G_F12,
- B3G_F13,
- B3G_F14,
- B3G_F15,
- B3G_LEFT_ARROW,
- B3G_RIGHT_ARROW,
- B3G_UP_ARROW,
- B3G_DOWN_ARROW,
- B3G_PAGE_UP,
- B3G_PAGE_DOWN,
- B3G_END,
- B3G_HOME,
- B3G_INSERT,
- B3G_DELETE,
- B3G_BACKSPACE,
- B3G_SHIFT,
- B3G_CONTROL,
- B3G_ALT,
- B3G_RETURN
-};
-
-struct b3gWindowConstructionInfo
-{
- int m_width;
- int m_height;
- bool m_fullscreen;
- int m_colorBitsPerPixel;
- void* m_windowHandle;
- const char* m_title;
- int m_openglVersion;
-
-
- b3gWindowConstructionInfo(int width=1024, int height=768)
- :m_width(width),
- m_height(height),
- m_fullscreen(false),
- m_colorBitsPerPixel(32),
- m_windowHandle(0),
- m_title("title"),
- m_openglVersion(3)
- {
- }
-};
-
-
-class CommonWindowInterface
-{
- public:
-
- virtual ~CommonWindowInterface()
- {
- }
-
- virtual void createDefaultWindow(int width, int height, const char* title)
- {
- b3gWindowConstructionInfo ci(width,height);
- ci.m_title = title;
- createWindow(ci);
- }
-
- virtual void createWindow(const b3gWindowConstructionInfo& ci)=0;
-
- virtual void closeWindow()=0;
-
- virtual void runMainLoop()=0;
- virtual float getTimeInSeconds()=0;
-
- virtual bool requestedExit() const = 0;
- virtual void setRequestExit() = 0;
-
- virtual void startRendering()=0;
-
- virtual void endRendering()=0;
-
- virtual bool isModifierKeyPressed(int key) = 0;
-
- virtual void setMouseMoveCallback(b3MouseMoveCallback mouseCallback)=0;
- virtual b3MouseMoveCallback getMouseMoveCallback()=0;
-
- virtual void setMouseButtonCallback(b3MouseButtonCallback mouseCallback)=0;
- virtual b3MouseButtonCallback getMouseButtonCallback()=0;
-
- virtual void setResizeCallback(b3ResizeCallback resizeCallback)=0;
- virtual b3ResizeCallback getResizeCallback()=0;
-
- virtual void setWheelCallback(b3WheelCallback wheelCallback)=0;
- virtual b3WheelCallback getWheelCallback()=0;
-
- virtual void setKeyboardCallback( b3KeyboardCallback keyboardCallback)=0;
- virtual b3KeyboardCallback getKeyboardCallback()=0;
-
- virtual void setRenderCallback( b3RenderCallback renderCallback) = 0;
-
- virtual void setWindowTitle(const char* title)=0;
-
- virtual float getRetinaScale() const =0;
- virtual void setAllowRetina(bool allow) =0;
-
- virtual int getWidth() const = 0;
- virtual int getHeight() const = 0;
-
- virtual int fileOpenDialog(char* fileName, int maxFileNameLength) = 0;
-
-};
-
-#endif //B3G_WINDOW_INTERFACE_H \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.h
deleted file mode 100644
index 0d61f67567..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.h
+++ /dev/null
@@ -1,118 +0,0 @@
-#ifndef MAC_OPENGL_WINDOW_H
-#define MAC_OPENGL_WINDOW_H
-
-#include "CommonWindowInterface.h"
-
-#define b3gDefaultOpenGLWindow MacOpenGLWindow
-
-class MacOpenGLWindow : public CommonWindowInterface
-{
- struct MacOpenGLWindowInternalData* m_internalData;
- float m_mouseX;
- float m_mouseY;
- int m_modifierFlags;
-
- b3MouseButtonCallback m_mouseButtonCallback;
- b3MouseMoveCallback m_mouseMoveCallback;
- b3WheelCallback m_wheelCallback;
- b3KeyboardCallback m_keyboardCallback;
- b3RenderCallback m_renderCallback;
-
- float m_retinaScaleFactor;
- bool m_allowRetina;
-
-public:
-
- MacOpenGLWindow();
- virtual ~MacOpenGLWindow();
-
- void init(int width, int height, const char* windowTitle);
-
- void closeWindow();
-
- void startRendering();
-
- void endRendering();//swap buffers
-
- virtual bool requestedExit() const;
-
- virtual void setRequestExit();
-
- void getMouseCoordinates(int& x, int& y);
-
- void runMainLoop();
-
- virtual bool isModifierKeyPressed(int key);
-
- void setMouseButtonCallback(b3MouseButtonCallback mouseCallback)
- {
- m_mouseButtonCallback = mouseCallback;
- }
-
- void setMouseMoveCallback(b3MouseMoveCallback mouseCallback)
- {
- m_mouseMoveCallback = mouseCallback;
- }
-
- void setResizeCallback(b3ResizeCallback resizeCallback);
-
-
- void setKeyboardCallback( b3KeyboardCallback keyboardCallback)
- {
- m_keyboardCallback = keyboardCallback;
- }
-
- virtual b3MouseMoveCallback getMouseMoveCallback()
- {
- return m_mouseMoveCallback;
- }
- virtual b3MouseButtonCallback getMouseButtonCallback()
- {
- return m_mouseButtonCallback;
- }
- virtual b3ResizeCallback getResizeCallback();
-
- virtual b3WheelCallback getWheelCallback()
- {
- return m_wheelCallback;
- }
-
- b3KeyboardCallback getKeyboardCallback()
- {
- return m_keyboardCallback;
- }
-
- void setWheelCallback (b3WheelCallback wheelCallback)
- {
- m_wheelCallback = wheelCallback;
- }
-
- float getRetinaScale() const
- {
- return m_retinaScaleFactor;
- }
- virtual void setAllowRetina(bool allow)
- {
- m_allowRetina = allow;
- }
-
- virtual void createWindow(const b3gWindowConstructionInfo& ci);
-
- virtual float getTimeInSeconds();
-
-
- virtual int getWidth() const;
- virtual int getHeight() const;
-
-
- virtual void setRenderCallback( b3RenderCallback renderCallback);
-
- virtual void setWindowTitle(const char* title);
-
- int fileOpenDialog(char* filename, int maxNameLength);
-
-};
-
-
-#endif
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.mm b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.mm
deleted file mode 100644
index 8cab041af3..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/MacOpenGLWindow.mm
+++ /dev/null
@@ -1,1169 +0,0 @@
-#include "MacOpenGLWindow.h"
-
-#define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
-#import <Cocoa/Cocoa.h>
-#include "OpenGLInclude.h"
-
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stddef.h>
-#include <string.h>
-
-
-enum
-{
- MY_MAC_ALTKEY=1,
- MY_MAC_SHIFTKEY=2,
- MY_MAC_CONTROL_KEY=4
-};
-
-/* report GL errors, if any, to stderr */
-static void checkError(const char *functionName)
-{
- GLenum error;
- while (( error = glGetError() ) != GL_NO_ERROR)
- {
- fprintf (stderr, "GL error 0x%X detected in %s\n", error, functionName);
- }
-}
-
-void dumpInfo(void)
-{
- printf ("Vendor: %s\n", glGetString (GL_VENDOR));
- printf ("Renderer: %s\n", glGetString (GL_RENDERER));
- printf ("Version: %s\n", glGetString (GL_VERSION));
- printf ("GLSL: %s\n", glGetString (GL_SHADING_LANGUAGE_VERSION));
- checkError ("dumpInfo");
-}
-
-
-
-
-// -------------------- View ------------------------
-
-@interface TestView : NSView
-{
- NSOpenGLContext* m_context;
- int m_lastWidth;
- int m_lastHeight;
- bool m_requestClose;
- b3ResizeCallback m_resizeCallback;
-
-}
--(void)drawRect:(NSRect)rect;
--(void) MakeContext:(int) openglVersion;
--(void) MakeCurrent;
--(float) GetWindowWidth;
--(float) GetWindowHeight;
--(BOOL) GetRequestClose;
-- (BOOL)windowShouldClose:(id)sender;
--(void) setResizeCallback:(b3ResizeCallback) callback;
--(b3ResizeCallback) getResizeCallback;
--(NSOpenGLContext*) getContext;
-@end
-
-float loop;
-
-#define Pi 3.1415
-
-@implementation TestView
-
-- (BOOL)windowShouldClose:(id)sender
-{
- m_requestClose = true;
- return false;
-}
--(BOOL) GetRequestClose
-{
- return m_requestClose;
-}
--(float) GetWindowWidth
-{
- return m_lastWidth;
-}
--(float) GetWindowHeight
-{
- return m_lastHeight;
-}
-
--(b3ResizeCallback) getResizeCallback
-{
- return m_resizeCallback;
-}
-
--(NSOpenGLContext*) getContext
-{
- return m_context;
-}
--(void)setResizeCallback:(b3ResizeCallback)callback
-{
- m_resizeCallback = callback;
-}
--(void)drawRect:(NSRect)rect
-{
- if (([self frame].size.width != m_lastWidth) || ([self frame].size.height != m_lastHeight))
- {
- m_lastWidth = [self frame].size.width;
- m_lastHeight = [self frame].size.height;
-
- // Only needed on resize:
- [m_context clearDrawable];
-
-// reshape([self frame].size.width, [self frame].size.height);
- float width = [self frame].size.width;
- float height = [self frame].size.height;
-
-
- // Get view dimensions in pixels
- // glViewport(0,0,10,10);
-
- if (m_resizeCallback)
- {
- (*m_resizeCallback)(width,height);
- }
- #ifndef NO_OPENGL3
- NSRect backingBounds = [self convertRectToBacking:[self bounds]];
- GLsizei backingPixelWidth = (GLsizei)(backingBounds.size.width),
- backingPixelHeight = (GLsizei)(backingBounds.size.height);
-
- // Set viewport
- glViewport(0, 0, backingPixelWidth, backingPixelHeight);
- #else
- glViewport(0,0,(GLsizei)width,(GLsizei)height);
-#endif
- }
-
- [m_context setView: self];
- [m_context makeCurrentContext];
-
- // Draw
- //display();
-
- [m_context flushBuffer];
- [NSOpenGLContext clearCurrentContext];
-
- loop = loop + 0.1;
-}
-
--(void) MakeContext :(int) openglVersion
-{
- // NSWindow *w;
- NSOpenGLPixelFormat *fmt;
-
- m_requestClose = false;
-
-
-
-#ifndef NO_OPENGL3
- if (openglVersion==3)
- {
- NSOpenGLPixelFormatAttribute attrs[] =
- {
- NSOpenGLPFAOpenGLProfile,
- NSOpenGLProfileVersion3_2Core,
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFADepthSize, 32,
- NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)8,
- (NSOpenGLPixelFormatAttribute)0
- };
-
- // Init GL context
- fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)attrs];
- } else
-#endif
- {
- NSOpenGLPixelFormatAttribute attrs[] =
- {
- NSOpenGLPFADoubleBuffer,
- NSOpenGLPFADepthSize, 32,
- NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute)8,
- (NSOpenGLPixelFormatAttribute)0
- };
- // Init GL context
- fmt = [[NSOpenGLPixelFormat alloc] initWithAttributes: (NSOpenGLPixelFormatAttribute*)attrs];
-
- }
- m_context = [[NSOpenGLContext alloc] initWithFormat: fmt shareContext: nil];
- [fmt release];
- [m_context makeCurrentContext];
-
- checkError("makeCurrentContext");
-}
-
--(void) MakeCurrent
-{
- [m_context makeCurrentContext];
-}
--(void)windowWillClose:(NSNotification *)note
-{
- [[NSApplication sharedApplication] terminate:self];
-}
-@end
-
-struct MacOpenGLWindowInternalData
-{
- MacOpenGLWindowInternalData()
- {
- m_myApp = 0;
- m_myview = 0;
- m_pool = 0;
- m_window = 0;
- m_width = -1;
- m_height = -1;
- m_exitRequested = false;
- }
- NSApplication* m_myApp;
- TestView* m_myview;
- NSAutoreleasePool* m_pool;
- NSWindow* m_window;
- int m_width;
- int m_height;
- bool m_exitRequested;
-
-};
-
-MacOpenGLWindow::MacOpenGLWindow()
-:m_internalData(0),
-m_mouseX(0),
-m_mouseY(0),
-m_modifierFlags(0),
-m_mouseMoveCallback(0),
-m_mouseButtonCallback(0),
-m_wheelCallback(0),
-m_keyboardCallback(0),
-m_retinaScaleFactor(1),
-m_allowRetina(true)
-{
-}
-
-MacOpenGLWindow::~MacOpenGLWindow()
-{
- if (m_internalData)
- closeWindow();
-}
-
-
-bool MacOpenGLWindow::isModifierKeyPressed(int key)
-{
- bool isPressed = false;
-
- switch (key)
- {
- case B3G_ALT:
- {
- isPressed = ((m_modifierFlags & MY_MAC_ALTKEY)!=0);
- break;
- };
- case B3G_SHIFT:
- {
- isPressed = ((m_modifierFlags & MY_MAC_SHIFTKEY)!=0);
- break;
- };
- case B3G_CONTROL:
- {
- isPressed = ((m_modifierFlags & MY_MAC_CONTROL_KEY )!=0);
- break;
- };
-
- default:
- {
- }
- };
- return isPressed;
-}
-
-float MacOpenGLWindow::getTimeInSeconds()
-{
- return 0.f;
-}
-
-
-void MacOpenGLWindow::setRenderCallback( b3RenderCallback renderCallback)
-{
- m_renderCallback = renderCallback;
-}
-
-void MacOpenGLWindow::setWindowTitle(const char* windowTitle)
-{
- [m_internalData->m_window setTitle:[NSString stringWithCString:windowTitle encoding:NSISOLatin1StringEncoding]] ;
-}
-
-void MacOpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
-{
- if (m_internalData)
- closeWindow();
-
- int width = ci.m_width;
- int height = ci.m_height;
- const char* windowTitle = ci.m_title;
-
-
-
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- m_internalData = new MacOpenGLWindowInternalData;
- m_internalData->m_width = width;
- m_internalData->m_height = height;
-
- m_internalData->m_pool = [NSAutoreleasePool new];
- m_internalData->m_myApp = [NSApplication sharedApplication];
- //myApp = [MyApp sharedApplication];
- //home();
-
- [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular];
-
- id menubar = [[NSMenu new] autorelease];
- id appMenuItem = [[NSMenuItem new] autorelease];
- [menubar addItem:appMenuItem];
- [NSApp setMainMenu:menubar];
-
- id appMenu = [[NSMenu new] autorelease];
- id appName = [[NSProcessInfo processInfo] processName];
- id quitTitle = [@"Quit " stringByAppendingString:appName];
- id quitMenuItem = [[[NSMenuItem alloc] initWithTitle:quitTitle
- action:@selector(terminate:) keyEquivalent:@"q"] autorelease];
-
- [appMenu addItem:quitMenuItem];
- [appMenuItem setSubmenu:appMenu];
-
- NSMenuItem *fileMenuItem = [[NSMenuItem new] autorelease];
- NSMenu *fileMenu = [[NSMenu alloc] initWithTitle:@"File"];
- [fileMenuItem setSubmenu: fileMenu]; // was setMenu:
-
- NSMenuItem *newMenu = [[NSMenuItem alloc] initWithTitle:@"New" action:NULL keyEquivalent:@""];
- NSMenuItem *openMenu = [[NSMenuItem alloc] initWithTitle:@"Open" action:NULL keyEquivalent:@""];
- NSMenuItem *saveMenu = [[NSMenuItem alloc] initWithTitle:@"Save" action:NULL keyEquivalent:@""];
-
- [fileMenu addItem: newMenu];
- [fileMenu addItem: openMenu];
- [fileMenu addItem: saveMenu];
- [menubar addItem: fileMenuItem];
-
-
- // add Edit menu
- NSMenuItem *editMenuItem = [[NSMenuItem new] autorelease];
- NSMenu *menu = [[NSMenu allocWithZone:[NSMenu menuZone]]initWithTitle:@"Edit"];
- [editMenuItem setSubmenu: menu];
-
- NSMenuItem *copyItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]initWithTitle:@"Copy" action:@selector(copy:) keyEquivalent:@"c"];
-
- [menu addItem:copyItem];
- [menubar addItem:editMenuItem];
-
- // [mainMenu setSubmenu:menu forItem:menuItem];
-
-
- //NSMenuItem *fileMenuItem = [[NSMenuItem alloc] initWithTitle: @"File"];
- /*[fileMenuItem setSubmenu: fileMenu]; // was setMenu:
- [fileMenuItem release];
- */
-
- /*NSMenu *newMenu;
- NSMenuItem *newItem;
-
- // Add the submenu
- newItem = [[NSMenuItem allocWithZone:[NSMenu menuZone]]
- initWithTitle:@"Flashy" action:NULL keyEquivalent:@""];
- newMenu = [[NSMenu allocWithZone:[NSMenu menuZone]]
- initWithTitle:@"Flashy"];
- [newItem setSubmenu:newMenu];
- [newMenu release];
- [[NSApp mainMenu] addItem:newItem];
- [newItem release];
- */
-
- NSRect frame = NSMakeRect(0., 0., width, height);
-
- m_internalData->m_window = [NSWindow alloc];
- [m_internalData->m_window initWithContentRect:frame
- styleMask:NSTitledWindowMask |NSResizableWindowMask| NSClosableWindowMask | NSMiniaturizableWindowMask
- backing:NSBackingStoreBuffered
- defer:false];
-
-
- [m_internalData->m_window setTitle:[NSString stringWithCString:windowTitle encoding:NSISOLatin1StringEncoding]] ;
-
- m_internalData->m_myview = [TestView alloc];
-
- [m_internalData->m_myview setResizeCallback:0];
- ///ci.m_resizeCallback];
-
- [m_internalData->m_myview initWithFrame: frame];
-
- // OpenGL init!
- [m_internalData->m_myview MakeContext : ci.m_openglVersion];
-
- // https://developer.apple.com/library/mac/#documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/CapturingScreenContents/CapturingScreenContents.html#//apple_ref/doc/uid/TP40012302-CH10-SW1
- //support HighResolutionOSX for Retina Macbook
- if (ci.m_openglVersion>=3)
- {
- if (m_allowRetina)
- {
- [m_internalData->m_myview setWantsBestResolutionOpenGLSurface:YES];
- }
- }
- NSSize sz;
- sz.width = 1;
- sz.height = 1;
-
- // float newBackingScaleFactor = [m_internalData->m_window backingScaleFactor];
-
- dumpInfo();
-
-
-
-
- [m_internalData->m_window setContentView: m_internalData->m_myview];
-
-
-
- [m_internalData->m_window setDelegate:(id) m_internalData->m_myview];
-
- [m_internalData->m_window makeKeyAndOrderFront: nil];
-
- [m_internalData->m_myview MakeCurrent];
- m_internalData->m_width = m_internalData->m_myview.GetWindowWidth;
- m_internalData->m_height = m_internalData->m_myview.GetWindowHeight;
-
-
- [NSApp activateIgnoringOtherApps:YES];
-
-
-//[m_internalData->m_window setLevel:NSMainMenuWindowLevel];
-
-// [NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask];
-
-// [NSEvent addGlobalMonitorForEventsMatchingMask:NSMouseMovedMask handler:^(NSEvent *event)
- // {
- //[window setFrameOrigin:[NSEvent mouseLocation]];
- // NSPoint eventLocation = [m_internalData->m_window mouseLocationOutsideOfEventStream];
-
- // NSPoint eventLocation = [event locationInWindow];
- //NSPoint center = [m_internalData->m_myview convertPoint:eventLocation fromView:nil];
- // m_mouseX = center.x;
- // m_mouseY = [m_internalData->m_myview GetWindowHeight] - center.y;
-
-
- // printf("mouse coord = %f, %f\n",m_mouseX,m_mouseY);
- // if (m_mouseMoveCallback)
- // (*m_mouseMoveCallback)(m_mouseX,m_mouseY);
-
- // }];
-
- //see http://stackoverflow.com/questions/8238473/cant-get-nsmousemoved-events-from-nexteventmatchingmask-with-an-nsopenglview
-/* ProcessSerialNumber psn;
- GetCurrentProcess(&psn);
- TransformProcessType(&psn, kProcessTransformToForegroundApplication);
- SetFrontProcess(&psn);
- */
-#ifndef NO_OPENGL3
- m_retinaScaleFactor = [m_internalData->m_myview convertSizeToBacking:sz].width;
-#else
- m_retinaScaleFactor=1.f;
-#endif
-
- [m_internalData->m_myApp finishLaunching];
- [pool release];
-
-}
-
-void MacOpenGLWindow::runMainLoop()
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
- // FILE* dump = fopen ("/Users/erwincoumans/yes.txt","wb");
- // fclose(dump);
-
-
-
-
- [pool release];
-
-}
-
-void MacOpenGLWindow::closeWindow()
-{
-
- delete m_internalData;
- m_internalData = 0;
-
-}
-extern float m_azi;
-extern float m_ele;
-extern float m_cameraDistance;
-
-
- /*
- * Summary:
- * Virtual keycodes
- *
- * Discussion:
- * These constants are the virtual keycodes defined originally in
- * Inside Mac Volume V, pg. V-191. They identify physical keys on a
- * keyboard. Those constants with "ANSI" in the name are labeled
- * according to the key position on an ANSI-standard US keyboard.
- * For example, kVK_ANSI_A indicates the virtual keycode for the key
- * with the letter 'A' in the US keyboard layout. Other keyboard
- * layouts may have the 'A' key label on a different physical key;
- * in this case, pressing 'A' will generate a different virtual
- * keycode.
- */
-enum {
- kVK_ANSI_A = 0x00,
- kVK_ANSI_S = 0x01,
- kVK_ANSI_D = 0x02,
- kVK_ANSI_F = 0x03,
- kVK_ANSI_H = 0x04,
- kVK_ANSI_G = 0x05,
- kVK_ANSI_Z = 0x06,
- kVK_ANSI_X = 0x07,
- kVK_ANSI_C = 0x08,
- kVK_ANSI_V = 0x09,
- kVK_ANSI_B = 0x0B,
- kVK_ANSI_Q = 0x0C,
- kVK_ANSI_W = 0x0D,
- kVK_ANSI_E = 0x0E,
- kVK_ANSI_R = 0x0F,
- kVK_ANSI_Y = 0x10,
- kVK_ANSI_T = 0x11,
- kVK_ANSI_1 = 0x12,
- kVK_ANSI_2 = 0x13,
- kVK_ANSI_3 = 0x14,
- kVK_ANSI_4 = 0x15,
- kVK_ANSI_6 = 0x16,
- kVK_ANSI_5 = 0x17,
- kVK_ANSI_Equal = 0x18,
- kVK_ANSI_9 = 0x19,
- kVK_ANSI_7 = 0x1A,
- kVK_ANSI_Minus = 0x1B,
- kVK_ANSI_8 = 0x1C,
- kVK_ANSI_0 = 0x1D,
- kVK_ANSI_RightBracket = 0x1E,
- kVK_ANSI_O = 0x1F,
- kVK_ANSI_U = 0x20,
- kVK_ANSI_LeftBracket = 0x21,
- kVK_ANSI_I = 0x22,
- kVK_ANSI_P = 0x23,
- kVK_ANSI_L = 0x25,
- kVK_ANSI_J = 0x26,
- kVK_ANSI_Quote = 0x27,
- kVK_ANSI_K = 0x28,
- kVK_ANSI_Semicolon = 0x29,
- kVK_ANSI_Backslash = 0x2A,
- kVK_ANSI_Comma = 0x2B,
- kVK_ANSI_Slash = 0x2C,
- kVK_ANSI_N = 0x2D,
- kVK_ANSI_M = 0x2E,
- kVK_ANSI_Period = 0x2F,
- kVK_ANSI_Grave = 0x32,
- kVK_ANSI_KeypadDecimal = 0x41,
- kVK_ANSI_KeypadMultiply = 0x43,
- kVK_ANSI_KeypadPlus = 0x45,
- kVK_ANSI_KeypadClear = 0x47,
- kVK_ANSI_KeypadDivide = 0x4B,
- kVK_ANSI_KeypadEnter = 0x4C,
- kVK_ANSI_KeypadMinus = 0x4E,
- kVK_ANSI_KeypadEquals = 0x51,
- kVK_ANSI_Keypad0 = 0x52,
- kVK_ANSI_Keypad1 = 0x53,
- kVK_ANSI_Keypad2 = 0x54,
- kVK_ANSI_Keypad3 = 0x55,
- kVK_ANSI_Keypad4 = 0x56,
- kVK_ANSI_Keypad5 = 0x57,
- kVK_ANSI_Keypad6 = 0x58,
- kVK_ANSI_Keypad7 = 0x59,
- kVK_ANSI_Keypad8 = 0x5B,
- kVK_ANSI_Keypad9 = 0x5C
-};
-
-/* keycodes for keys that are independent of keyboard layout*/
-enum {
- kVK_Return = 0x24,
- kVK_Tab = 0x30,
- kVK_Space = 0x31,
- kVK_Delete = 0x33,
- kVK_Escape = 0x35,
- kVK_Command = 0x37,
- kVK_Shift = 0x38,
- kVK_CapsLock = 0x39,
- kVK_Option = 0x3A,
- kVK_Control = 0x3B,
- kVK_RightShift = 0x3C,
- kVK_RightOption = 0x3D,
- kVK_RightControl = 0x3E,
- kVK_Function = 0x3F,
- kVK_F17 = 0x40,
- kVK_VolumeUp = 0x48,
- kVK_VolumeDown = 0x49,
- kVK_Mute = 0x4A,
- kVK_F18 = 0x4F,
- kVK_F19 = 0x50,
- kVK_F20 = 0x5A,
- kVK_F5 = 0x60,
- kVK_F6 = 0x61,
- kVK_F7 = 0x62,
- kVK_F3 = 0x63,
- kVK_F8 = 0x64,
- kVK_F9 = 0x65,
- kVK_F11 = 0x67,
- kVK_F13 = 0x69,
- kVK_F16 = 0x6A,
- kVK_F14 = 0x6B,
- kVK_F10 = 0x6D,
- kVK_F12 = 0x6F,
- kVK_F15 = 0x71,
- kVK_Help = 0x72,
- kVK_Home = 0x73,
- kVK_PageUp = 0x74,
- kVK_ForwardDelete = 0x75,
- kVK_F4 = 0x76,
- kVK_End = 0x77,
- kVK_F2 = 0x78,
- kVK_PageDown = 0x79,
- kVK_F1 = 0x7A,
- kVK_LeftArrow = 0x7B,
- kVK_RightArrow = 0x7C,
- kVK_DownArrow = 0x7D,
- kVK_UpArrow = 0x7E
-};
-
-/* ISO keyboards only*/
-enum {
- kVK_ISO_Section = 0x0A
-};
-
-/* JIS keyboards only*/
-enum {
- kVK_JIS_Yen = 0x5D,
- kVK_JIS_Underscore = 0x5E,
- kVK_JIS_KeypadComma = 0x5F,
- kVK_JIS_Eisu = 0x66,
- kVK_JIS_Kana = 0x68
-};
-
-int getAsciiCodeFromVirtualKeycode(int virtualKeyCode)
-{
- int keycode = 0xffffffff;
-
- switch (virtualKeyCode)
- {
-
- case kVK_ANSI_A : {keycode = 'a'; break;}
- case kVK_ANSI_B : {keycode = 'b'; break;}
- case kVK_ANSI_C : {keycode = 'c'; break;}
- case kVK_ANSI_D : {keycode = 'd';break;}
- case kVK_ANSI_E : {keycode = 'e'; break;}
- case kVK_ANSI_F : {keycode = 'f'; break;}
- case kVK_ANSI_G : {keycode = 'g'; break;}
- case kVK_ANSI_H : {keycode = 'h'; break;}
- case kVK_ANSI_I : {keycode = 'i'; break;}
- case kVK_ANSI_J : {keycode = 'j'; break;}
- case kVK_ANSI_K : {keycode = 'k'; break;}
- case kVK_ANSI_L : {keycode = 'l'; break;}
- case kVK_ANSI_M : {keycode = 'm'; break;}
- case kVK_ANSI_N : {keycode = 'n'; break;}
- case kVK_ANSI_O : {keycode = 'o'; break;}
- case kVK_ANSI_P : {keycode = 'p'; break;}
- case kVK_ANSI_Q : {keycode = 'q'; break;}
- case kVK_ANSI_R : {keycode = 'r'; break;}
- case kVK_ANSI_S : {keycode = 's';break;}
- case kVK_ANSI_T : {keycode = 't'; break;}
- case kVK_ANSI_U : {keycode = 'u'; break;}
- case kVK_ANSI_V : {keycode = 'v'; break;}
- case kVK_ANSI_W : {keycode = 'w'; break;}
- case kVK_ANSI_X : {keycode = 'x'; break;}
- case kVK_ANSI_Y : {keycode = 'y'; break;}
- case kVK_ANSI_Z : {keycode = 'z'; break;}
-
- case kVK_ANSI_1 : {keycode = '1'; break;}
- case kVK_ANSI_2 : {keycode = '2'; break;}
- case kVK_ANSI_3 : {keycode = '3'; break;}
- case kVK_ANSI_4 : {keycode = '4'; break;}
- case kVK_ANSI_5 : {keycode = '5'; break;}
- case kVK_ANSI_6 : {keycode = '6'; break;}
- case kVK_ANSI_7 : {keycode = '7'; break;}
- case kVK_ANSI_8 : {keycode = '8'; break;}
- case kVK_ANSI_9 : {keycode = '9'; break;}
- case kVK_ANSI_0 : {keycode = '0'; break;}
- case kVK_ANSI_Equal : {keycode = '='; break;}
- case kVK_ANSI_Minus : {keycode = '-'; break;}
-
- case kVK_Tab: {keycode = 9; break;}
- case kVK_Space: {keycode=' '; break;}
- case kVK_Escape: {keycode=27; break;}
- case kVK_Delete: {keycode=8; break;}
- case kVK_ForwardDelete: {keycode=B3G_INSERT; break;}
-
-
- case kVK_F1: {keycode = B3G_F1; break;}
- case kVK_F2: {keycode = B3G_F2; break;}
- case kVK_F3: {keycode = B3G_F3; break;}
- case kVK_F4: {keycode = B3G_F4; break;}
- case kVK_F5: {keycode = B3G_F5; break;}
- case kVK_F6: {keycode = B3G_F6; break;}
- case kVK_F7: {keycode = B3G_F7; break;}
- case kVK_F8: {keycode = B3G_F8; break;}
- case kVK_F9: {keycode = B3G_F9; break;}
- case kVK_F10: {keycode = B3G_F10; break;}
- case kVK_F11: {keycode = B3G_F11; break;}
- case kVK_F12: {keycode = B3G_F12; break;}
- case kVK_F13: {keycode = B3G_F13; break;}
- case kVK_F14: {keycode = B3G_F14; break;}
- case kVK_F15: {keycode = B3G_F15; break;}
-
- case kVK_LeftArrow: {keycode = B3G_LEFT_ARROW;break;}
- case kVK_RightArrow: {keycode = B3G_RIGHT_ARROW;break;}
- case kVK_UpArrow: {keycode = B3G_UP_ARROW;break;}
- case kVK_DownArrow: {keycode = B3G_DOWN_ARROW;break;}
-
- case kVK_PageUp :{keycode = B3G_PAGE_UP;break;}
- case kVK_PageDown :{keycode = B3G_PAGE_DOWN;break;}
- case kVK_End :{keycode = B3G_END;break;}
- case kVK_Home :{keycode = B3G_HOME;break;}
- case kVK_Control: {keycode = B3G_CONTROL;break;}
- case kVK_Option: {keycode = B3G_ALT;break;}
-
- case kVK_ANSI_RightBracket : {keycode = ']'; break;}
- case kVK_ANSI_LeftBracket : {keycode = '['; break;}
- case kVK_ANSI_Quote : {keycode = '\''; break;}
- case kVK_ANSI_Semicolon : {keycode = ';'; break;}
- case kVK_ANSI_Backslash : {keycode = '\\'; break;}
- case kVK_ANSI_Comma : {keycode = ','; break;}
- case kVK_ANSI_Slash : {keycode = '/'; break;}
- case kVK_ANSI_Period : {keycode = '.'; break;}
- case kVK_ANSI_Grave : {keycode = '`'; break;}
- case kVK_ANSI_KeypadDecimal : {keycode = '.'; break;}
- case kVK_ANSI_KeypadMultiply : {keycode = '*'; break;}
- case kVK_ANSI_KeypadPlus : {keycode = '+'; break;}
- case kVK_ANSI_KeypadClear : {keycode = '?'; break;}
- case kVK_ANSI_KeypadDivide : {keycode = '/'; break;}
- case kVK_ANSI_KeypadEnter : {keycode = B3G_RETURN; break;}
- case kVK_ANSI_KeypadMinus : {keycode = '-'; break;}
- case kVK_ANSI_KeypadEquals : {keycode = '='; break;}
- case kVK_ANSI_Keypad0 : {keycode = '0'; break;}
- case kVK_ANSI_Keypad1 : {keycode = '1'; break;}
- case kVK_ANSI_Keypad2 : {keycode = '2'; break;}
- case kVK_ANSI_Keypad3 : {keycode = '3'; break;}
- case kVK_ANSI_Keypad4 : {keycode = '4'; break;}
- case kVK_ANSI_Keypad5 : {keycode = '5'; break;}
- case kVK_ANSI_Keypad6 : {keycode = '6'; break;}
- case kVK_ANSI_Keypad7 : {keycode = '7'; break;}
- case kVK_ANSI_Keypad8 : {keycode = '8'; break;}
- case kVK_ANSI_Keypad9 : {keycode = '9'; break;}
- case kVK_Return:
- {
- keycode = B3G_RETURN; break;
- }
-
- default:
- {
-
- printf("unknown keycode\n");
- }
- }
- return keycode;
-}
-
-
-void MacOpenGLWindow::startRendering()
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
-
- GLint err = glGetError();
- assert(err==GL_NO_ERROR);
-
-
- NSEvent *event = nil;
- bool handledEvent = false;
-
- do
- {
- [pool release];
- pool = [[NSAutoreleasePool alloc] init];
- event = [m_internalData->m_myApp
- nextEventMatchingMask:NSAnyEventMask
- untilDate:[NSDate distantPast]
- inMode:NSDefaultRunLoopMode
- // inMode:NSEventTrackingRunLoopMode
- dequeue:YES];
-
- //NSShiftKeyMask = 1 << 17,
- //NSControlKeyMask
-
- if ([event type] == NSFlagsChanged)
- {
- int modifiers = [event modifierFlags];
- if (m_keyboardCallback)
- {
- if ((modifiers & NSShiftKeyMask))
- {
- m_keyboardCallback(B3G_SHIFT,1);
- m_modifierFlags |= MY_MAC_SHIFTKEY;
- }else
- {
- if (m_modifierFlags& MY_MAC_SHIFTKEY)
- {
- m_keyboardCallback(B3G_SHIFT,0);
- m_modifierFlags &= ~MY_MAC_SHIFTKEY;
- }
- }
- if (modifiers & NSControlKeyMask)
- {
- m_keyboardCallback(B3G_CONTROL,1);
- m_modifierFlags |= MY_MAC_CONTROL_KEY;
- } else
- {
- if (m_modifierFlags&MY_MAC_CONTROL_KEY)
- {
- m_keyboardCallback(B3G_CONTROL,0);
- m_modifierFlags &= ~MY_MAC_CONTROL_KEY;
- }
- }
- if (modifiers & NSAlternateKeyMask)
- {
- m_keyboardCallback(B3G_ALT,1);
- m_modifierFlags |= MY_MAC_ALTKEY;
- } else
- {
- if (m_modifierFlags&MY_MAC_ALTKEY)
- {
- m_keyboardCallback(B3G_ALT,0);
- m_modifierFlags &= ~MY_MAC_ALTKEY;
-
- }
- }
- //handle NSCommandKeyMask
-
- }
- }
- if ([event type] == NSKeyUp)
- {
- handledEvent = true;
-
- uint32 virtualKeycode = [event keyCode];
-
- int keycode = getAsciiCodeFromVirtualKeycode(virtualKeycode);
- // printf("keycode = %d\n", keycode);
-
- if (m_keyboardCallback)
- {
- int state = 0;
- m_keyboardCallback(keycode,state);
- }
- }
- if ([event type] == NSKeyDown)
- {
- handledEvent = true;
-
- if (![event isARepeat])
- {
- uint32 virtualKeycode = [event keyCode];
-
- int keycode = getAsciiCodeFromVirtualKeycode(virtualKeycode);
- //printf("keycode = %d\n", keycode);
-
- if (m_keyboardCallback)
- {
- int state = 1;
- m_keyboardCallback(keycode,state);
- }
- }
- }
-
-
- if (([event type]== NSRightMouseDown) || ([ event type]==NSLeftMouseDown)||([event type]==NSOtherMouseDown))
- {
- // printf("right mouse!");
- // float mouseX,mouseY;
-
- NSPoint eventLocation = [event locationInWindow];
- NSPoint center = [m_internalData->m_myview convertPoint:eventLocation fromView:nil];
- m_mouseX = center.x;
- m_mouseY = [m_internalData->m_myview GetWindowHeight] - center.y;
- int button=0;
- switch ([event type])
- {
- case NSLeftMouseDown:
- {
- button=0;
- break;
- }
- case NSOtherMouseDown:
- {
- button=1;
- break;
- }
- case NSRightMouseDown:
- {
- button=2;
- break;
- }
- default:
- {
-
- }
- };
- // printf("mouse coord = %f, %f\n",mouseX,mouseY);
- if (m_mouseButtonCallback)
- {
- //handledEvent = true;
- (*m_mouseButtonCallback)(button,1,m_mouseX,m_mouseY);
- }
- }
-
-
- if (([event type]== NSRightMouseUp) || ([ event type]==NSLeftMouseUp)||([event type]==NSOtherMouseUp))
- {
- // printf("right mouse!");
- // float mouseX,mouseY;
-
- NSPoint eventLocation = [event locationInWindow];
- NSPoint center = [m_internalData->m_myview convertPoint:eventLocation fromView:nil];
- m_mouseX = center.x;
- m_mouseY = [m_internalData->m_myview GetWindowHeight] - center.y;
-
- int button=0;
- switch ([event type])
- {
- case NSLeftMouseUp:
- {
- button=0;
- break;
- }
- case NSOtherMouseUp:
- {
- button=1;
- break;
- }
- case NSRightMouseUp:
- {
- button=2;
- break;
- }
- default:
- {
-
- }
- };
-
- // printf("mouse coord = %f, %f\n",mouseX,mouseY);
- if (m_mouseButtonCallback)
- (*m_mouseButtonCallback)(button,0,m_mouseX,m_mouseY);
-
- }
-
-
- if ([event type] == NSMouseMoved)
- {
-
-
- // http://stackoverflow.com/questions/4630509/how-to-find-if-the-mouse-is-over-a-view
- NSPoint globalLocation = [ NSEvent mouseLocation ];
- NSPoint windowLocation = [ [m_internalData->m_myview window] convertScreenToBase:globalLocation ];
- NSPoint viewLocation = [ m_internalData->m_myview convertPoint:windowLocation fromView: nil ];
-
- //NSPoint eventLocation = [NSEvent mouseLocation]; //[event locationInWindow];
- //NSPoint center = [m_internalData->m_myview convertPoint:eventLocation fromView:nil];
- NSPoint center = viewLocation;
- m_mouseX = center.x;
- m_mouseY = [m_internalData->m_myview GetWindowHeight] - center.y;
-
- //printf("mouse coord = %f, %f\n",m_mouseX,m_mouseY);
- if (m_mouseMoveCallback)
- {
- //handledEvent = true;
- (*m_mouseMoveCallback)(m_mouseX,m_mouseY);
- }
- }
-
- if (([event type] == NSLeftMouseDragged) || ([event type] == NSRightMouseDragged) || ([event type] == NSOtherMouseDragged))
- {
- int dx1, dy1;
- CGGetLastMouseDelta (&dx1, &dy1);
-
- NSPoint eventLocation = [event locationInWindow];
- NSPoint center = [m_internalData->m_myview convertPoint:eventLocation fromView:nil];
- m_mouseX = center.x;
- m_mouseY = [m_internalData->m_myview GetWindowHeight] - center.y;
-
- if (m_mouseMoveCallback)
- {
- //handledEvent = true;
- (*m_mouseMoveCallback)(m_mouseX,m_mouseY);
- }
-
- // printf("mouse coord = %f, %f\n",m_mouseX,m_mouseY);
- }
-
- if ([event type] == NSScrollWheel)
- {
- float dy, dx;
- dy = [ event deltaY ];
- dx = [ event deltaX ];
-
- if (m_wheelCallback)
- {
- handledEvent = true;
- (*m_wheelCallback)(dx,dy);
- }
- // m_cameraDistance -= dy*0.1;
- // m_azi -= dx*0.1;
-
- }
-
- if (!handledEvent)
- [m_internalData->m_myApp sendEvent:event];
-
- [m_internalData->m_myApp updateWindows];
- } while (event);
-
- err = glGetError();
- assert(err==GL_NO_ERROR);
-
- [m_internalData->m_myview MakeCurrent];
- err = glGetError();
- assert(err==GL_NO_ERROR);
-
-
- // glClearColor(1,1,1,1);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //clear buffers
-
- err = glGetError();
- assert(err==GL_NO_ERROR);
-
- //glCullFace(GL_BACK);
- //glFrontFace(GL_CCW);
- glEnable(GL_DEPTH_TEST);
- err = glGetError();
- assert(err==GL_NO_ERROR);
-
- float aspect;
- //b3Vector3 extents;
-
- if (m_internalData->m_width > m_internalData->m_height)
- {
- aspect = (float)m_internalData->m_width / (float)m_internalData->m_height;
- //extents.setValue(aspect * 1.0f, 1.0f,0);
- } else
- {
- aspect = (float)m_internalData->m_height / (float)m_internalData->m_width;
- //extents.setValue(1.0f, aspect*1.f,0);
- }
-
- err = glGetError();
- assert(err==GL_NO_ERROR);
- [pool release];
-
-}
-
-void MacOpenGLWindow::endRendering()
-{
- [m_internalData->m_myview MakeCurrent];
-//#ifndef NO_OPENGL3
-// glSwapAPPLE();
-//#else
- [[m_internalData->m_myview getContext] flushBuffer];
-// #endif
-
-}
-
-bool MacOpenGLWindow::requestedExit() const
-{
- bool closeme = m_internalData->m_myview.GetRequestClose;
- return m_internalData->m_exitRequested || closeme;
-}
-
-void MacOpenGLWindow::setRequestExit()
-{
- m_internalData->m_exitRequested = true;
-}
-
-#include <string.h>
-int MacOpenGLWindow::fileOpenDialog(char* filename, int maxNameLength)
-{
- //save/restore the OpenGL context, NSOpenPanel can mess it up
- //http://stackoverflow.com/questions/13987148/nsopenpanel-breaks-my-sdl-opengl-app
-
- NSOpenGLContext *foo = [NSOpenGLContext currentContext];
- // get the url of a .txt file
- NSOpenPanel * zOpenPanel = [NSOpenPanel openPanel];
- NSArray * zAryOfExtensions = [NSArray arrayWithObjects:@"urdf",@"bullet",@"obj",@"sdf",nil];
- [zOpenPanel setAllowedFileTypes:zAryOfExtensions];
- NSInteger zIntResult = [zOpenPanel runModal];
-
- [foo makeCurrentContext];
-
- if (zIntResult == NSFileHandlingPanelCancelButton) {
- NSLog(@"readUsingOpenPanel cancelled");
- return 0;
- }
- NSURL *zUrl = [zOpenPanel URL];
- if (zUrl)
- {
- //without the file://
- NSString *myString = [zUrl absoluteString];
- int slen = [myString length];
- if (slen < maxNameLength)
- {
- const char *cfilename=[myString UTF8String];
- //expect file:// at start of URL
- const char* p = strstr(cfilename, "file://");
- if (p==cfilename)
- {
- int actualLen = strlen(cfilename)-7;
- memcpy(filename, cfilename+7,actualLen);
- filename[actualLen]=0;
- return actualLen;
- }
- }
- }
-
- return 0;
-}
-
-
-
-void MacOpenGLWindow::getMouseCoordinates(int& x, int& y)
-{
-
- NSPoint pt = [m_internalData->m_window mouseLocationOutsideOfEventStream];
- m_mouseX = pt.x;
- m_mouseY = pt.y;
-
- x = m_mouseX;
- //our convention is x,y is upper left hand side
- y = [m_internalData->m_myview GetWindowHeight]-m_mouseY;
-
-
-}
-
-int MacOpenGLWindow::getWidth() const
-{
- if (m_internalData && m_internalData->m_myview && m_internalData->m_myview.GetWindowWidth)
- return m_internalData->m_myview.GetWindowWidth;
- return 0;
-}
-
-int MacOpenGLWindow::getHeight() const
-{
- if (m_internalData && m_internalData->m_myview && m_internalData->m_myview.GetWindowHeight)
- return m_internalData->m_myview.GetWindowHeight;
- return 0;
-}
-
-
-void MacOpenGLWindow::setResizeCallback(b3ResizeCallback resizeCallback)
-{
- [m_internalData->m_myview setResizeCallback:resizeCallback];
- if (resizeCallback)
- {
- (resizeCallback)(m_internalData->m_width,m_internalData->m_height);
- }
-}
-
-b3ResizeCallback MacOpenGLWindow::getResizeCallback()
-{
- return [m_internalData->m_myview getResizeCallback];
-}
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGL2Include.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGL2Include.h
deleted file mode 100644
index 34caaaf07e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGL2Include.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#ifndef __OPENGL_INCLUDE_H
-#define __OPENGL_INCLUDE_H
-
-
-//think different
-#if defined(__APPLE__) && !defined (VMDMESA)
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/gl.h>
-#else
-
-#ifdef GLEW_STATIC
-#include "CustomGL/glew.h"
-#else
-#include <GL/glew.h>
-#endif//GLEW_STATIC
-
-#ifdef _WINDOWS
-#include <windows.h>
-//#include <GL/gl.h>
-//#include <GL/glu.h>
-#else
-//#include <GL/gl.h>
-//#include <GL/glu.h>
-#endif //_WINDOWS
-#endif //APPLE
-
-//disable glGetError
-//#undef glGetError
-//#define glGetError MyGetError
-//
-//GLenum inline MyGetError()
-//{
-// return 0;
-//}
-
-///on Linux only glDrawElementsInstancedARB is defined?!?
-//#ifdef __linux
-//#define glDrawElementsInstanced glDrawElementsInstancedARB
-//
-//#endif //__linux
-
-#endif //__OPENGL_INCLUDE_H
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGLInclude.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGLInclude.h
deleted file mode 100644
index 19219a188f..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/OpenGLInclude.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#ifndef __OPENGL_INCLUDE_H
-#define __OPENGL_INCLUDE_H
-
-
-//think different
-#if defined(__APPLE__) && !defined (VMDMESA)
-#include <OpenGL/OpenGL.h>
-//#include <OpenGL/gl.h>
-//#include <OpenGL/glu.h>
-//#import <Cocoa/Cocoa.h>
-#if defined (USE_OPENGL2) || defined (NO_OPENGL3)
-#include <OpenGL/gl.h>
-#else
-#include <OpenGL/gl3.h>
-#endif
-#else
-
-#ifdef GLEW_STATIC
-#include "CustomGL/glew.h"
-#else
-#include <GL/glew.h>
-#endif //GLEW_STATIC
-
-#ifdef _WINDOWS
-#include <windows.h>
-//#include <GL/gl.h>
-//#include <GL/glu.h>
-#else
-//#include <GL/gl.h>
-//#include <GL/glu.h>
-#endif //_WINDOWS
-#endif //APPLE
-
-//disable glGetError
-//#undef glGetError
-//#define glGetError MyGetError
-//
-//GLenum inline MyGetError()
-//{
-// return 0;
-//}
-
-///on Linux only glDrawElementsInstancedARB is defined?!?
-//#ifdef __linux
-//#define glDrawElementsInstanced glDrawElementsInstancedARB
-//
-//#endif //__linux
-
-#endif //__OPENGL_INCLUDE_H
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32InternalWindowData.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32InternalWindowData.h
deleted file mode 100644
index a512bc7630..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32InternalWindowData.h
+++ /dev/null
@@ -1,68 +0,0 @@
-
-#ifndef WIN32_INTERNAL_WINDOW_DATA_H
-#define WIN32_INTERNAL_WINDOW_DATA_H
-
-#include <windows.h>
-
-
-struct InternalData2
-{
- HWND m_hWnd;;
- int m_fullWindowWidth;//includes borders etc
- int m_fullWindowHeight;
-
- int m_openglViewportWidth;//just the 3d viewport/client area
- int m_openglViewportHeight;
-
- HDC m_hDC;
- HGLRC m_hRC;
- bool m_OpenGLInitialized;
- int m_oldScreenWidth;
- int m_oldHeight;
- int m_oldBitsPerPel;
- bool m_quit;
- int m_mouseLButton;
- int m_mouseRButton;
- int m_mouseMButton;
- int m_mouseXpos;
- int m_mouseYpos;
-
- int m_internalKeyModifierFlags;
-
- b3WheelCallback m_wheelCallback;
- b3MouseMoveCallback m_mouseMoveCallback;
- b3MouseButtonCallback m_mouseButtonCallback;
- b3ResizeCallback m_resizeCallback;
- b3KeyboardCallback m_keyboardCallback;
-
-
-
- InternalData2()
- {
- m_hWnd = 0;
- m_mouseLButton=0;
- m_mouseRButton=0;
- m_mouseMButton=0;
- m_internalKeyModifierFlags = 0;
- m_fullWindowWidth = 0;
- m_fullWindowHeight= 0;
- m_openglViewportHeight=0;
- m_openglViewportWidth=0;
- m_hDC = 0;
- m_hRC = 0;
- m_OpenGLInitialized = false;
- m_oldScreenWidth = 0;
- m_oldHeight = 0;
- m_oldBitsPerPel = 0;
- m_quit = false;
-
- m_keyboardCallback = 0;
- m_mouseMoveCallback = 0;
- m_mouseButtonCallback = 0;
- m_resizeCallback = 0;
- m_wheelCallback = 0;
-
- }
-};
-
-#endif //WIN32_INTERNAL_WINDOW_DATA_H \ No newline at end of file
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.cpp b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.cpp
deleted file mode 100644
index 0e076b92c2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-#ifdef _WIN32
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#include "Win32OpenGLWindow.h"
-
-#include "OpenGLInclude.h"
-
-//#include "Bullet3Common/b3Vector3.h"
-
-#include "Win32InternalWindowData.h"
-#include <stdio.h>
-
-static void printGLString(const char *name, GLenum s) {
- const char *v = (const char *) glGetString(s);
- printf("%s = %s\n",name, v);
-}
-
-bool sOpenGLVerbose = true;
-
-void Win32OpenGLWindow::enableOpenGL()
-{
-
- PIXELFORMATDESCRIPTOR pfd;
- int format;
-
- // get the device context (DC)
- m_data->m_hDC = GetDC( m_data->m_hWnd );
-
- // set the pixel format for the DC
- ZeroMemory( &pfd, sizeof( pfd ) );
- pfd.nSize = sizeof( pfd );
- pfd.nVersion = 1;
- pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
- pfd.iPixelType = PFD_TYPE_RGBA;
- pfd.cColorBits = 32;
- pfd.cRedBits = 8;
- pfd.cGreenBits = 8;
- pfd.cBlueBits = 8;
- pfd.cAlphaBits = 8;
-
- pfd.cDepthBits = 24;
- pfd.cStencilBits = 8;//1;
- pfd.iLayerType = PFD_MAIN_PLANE;
- format = ChoosePixelFormat( m_data->m_hDC, &pfd );
- SetPixelFormat( m_data->m_hDC, format, &pfd );
-
- // create and enable the render context (RC)
- m_data->m_hRC = wglCreateContext( m_data->m_hDC );
- wglMakeCurrent( m_data->m_hDC, m_data->m_hRC );
-
- if (sOpenGLVerbose)
- {
- printGLString("Version", GL_VERSION);
- printGLString("Vendor", GL_VENDOR);
- printGLString("Renderer", GL_RENDERER);
- }
- //printGLString("Extensions", GL_EXTENSIONS);
-
-}
-
-
-
-void Win32OpenGLWindow::disableOpenGL()
-{
- wglMakeCurrent( NULL, NULL );
- wglDeleteContext( m_data->m_hRC );
-// ReleaseDC( m_data->m_hWnd, m_data->m_hDC );
-
-}
-
-
-
-
-
-void Win32OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
-{
- Win32Window::createWindow(ci);
-
- //VideoDriver = video::createOpenGLDriver(CreationParams, FileSystem, this);
- enableOpenGL();
-
-}
-
-
-
-
-Win32OpenGLWindow::Win32OpenGLWindow()
-{
-
-
-}
-
-Win32OpenGLWindow::~Win32OpenGLWindow()
-{
-
-}
-
-
-void Win32OpenGLWindow::closeWindow()
-{
- disableOpenGL();
-
- Win32Window::closeWindow();
-}
-
-
-
-void Win32OpenGLWindow::startRendering()
-{
- pumpMessage();
- //don't clear all 3 buffers because some AMD drivers are buggy
- //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
-
-
- //glCullFace(GL_BACK);
- //glFrontFace(GL_CCW);
- glEnable(GL_DEPTH_TEST);
-
-}
-
-
-void Win32OpenGLWindow::renderAllObjects()
-{
-}
-
-void Win32OpenGLWindow::endRendering()
- {
- SwapBuffers( m_data->m_hDC );
-
-}
-
-int Win32OpenGLWindow::fileOpenDialog(char* fileName, int maxFileNameLength)
-{
- //wchar_t wideChars[1024];
-
- OPENFILENAME ofn ;
- ZeroMemory( &ofn , sizeof( ofn));
- ofn.lStructSize = sizeof ( ofn );
- ofn.hwndOwner = NULL ;
-
-#ifdef UNICODE
- WCHAR bla[1024];
- ofn.lpstrFile = bla;
- ofn.lpstrFile[0] = '\0';
- ofn.nMaxFile = 1023;
- ofn.lpstrFilter = L"All Files\0*.*\0URDF\0*.urdf\0.bullet\0*.bullet\0";
-#else
- ofn.lpstrFile = fileName;
- ofn.lpstrFile[0] = '\0';
- ofn.nMaxFile = 1023;
- //ofn.lpstrFilter = "All\0*.*\0Text\0*.TXT\0";
- ofn.lpstrFilter = "All Files\0*.*\0URDF\0*.urdf\0.bullet\0*.bullet\0";
-
-#endif
-
- ofn.nFilterIndex =1;
- ofn.lpstrFileTitle = NULL ;
- ofn.nMaxFileTitle = 0 ;
- ofn.lpstrInitialDir=NULL ;
- ofn.Flags = OFN_PATHMUSTEXIST|OFN_FILEMUSTEXIST ;
- GetOpenFileName( &ofn );
- return strlen(fileName);
-
-
- //return 0;
-}
-
-int Win32OpenGLWindow::getWidth() const
-{
- if (m_data)
- return m_data->m_openglViewportWidth;
- return 0;
-}
-
-int Win32OpenGLWindow::getHeight() const
-{
- if (m_data)
- return m_data->m_openglViewportHeight;
- return 0;
-}
-
-
-#endif
-
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.h
deleted file mode 100644
index 901ce6518b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32OpenGLWindow.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#ifndef _WIN32_OPENGL_RENDER_MANAGER_H
-#define _WIN32_OPENGL_RENDER_MANAGER_H
-
-
-
-#include "Win32Window.h"
-
-#define b3gDefaultOpenGLWindow Win32OpenGLWindow
-
-class Win32OpenGLWindow : public Win32Window
-{
- bool m_OpenGLInitialized;
-
- protected:
-
-
- void enableOpenGL();
-
- void disableOpenGL();
-
-public:
-
- Win32OpenGLWindow();
-
- virtual ~Win32OpenGLWindow();
-
- virtual void createWindow(const b3gWindowConstructionInfo& ci);
-
- virtual void closeWindow();
-
- virtual void startRendering();
-
- virtual void renderAllObjects();
-
- virtual void endRendering();
-
- virtual float getRetinaScale() const {return 1.f;}
- virtual void setAllowRetina(bool /*allowRetina*/) {};
-
- virtual int getWidth() const;
- virtual int getHeight() const;
-
- virtual int fileOpenDialog(char* fileName, int maxFileNameLength);
-};
-
-
-
-#endif //_WIN32_OPENGL_RENDER_MANAGER_H
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.cpp b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.cpp
deleted file mode 100644
index 029a098f2c..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.cpp
+++ /dev/null
@@ -1,810 +0,0 @@
-#ifdef _WIN32
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#include "Win32Window.h"
-
-#include "OpenGLInclude.h"
-
-#include <wchar.h>
-static InternalData2* sData = 0;
-
-#include "Win32InternalWindowData.h"
-
-
-enum
-{
- INTERNAL_SHIFT_MODIFIER=1,
- INTERNAL_ALT_MODIFIER=2,
- INTERNAL_CONTROL_MODIFIER=4,
-};
-
-void Win32Window::pumpMessage()
-{
- MSG msg;
- // check for messages
- //'if' instead of 'while' can make mainloop smoother.
- //@todo: use separate threads for input and rendering
- while( PeekMessage( &msg, NULL, 0, 0, PM_REMOVE ) )
- {
-
- // handle or dispatch messages
- if ( msg.message == WM_QUIT )
- {
- m_data->m_quit = TRUE;
- }
- else
- {
- TranslateMessage( &msg );
- DispatchMessage( &msg );
- }
-
-// gDemoApplication->displayCallback();
-
-
- };
-}
-
-int getSpecialKeyFromVirtualKeycode(int virtualKeyCode)
-{
- int keycode = -1;
- if (virtualKeyCode >= 'A' && virtualKeyCode <= 'Z')
- {
- return virtualKeyCode+32;//todo: fix the ascii A vs a input
- }
-
- switch (virtualKeyCode)
- {
- case VK_RETURN: {keycode = B3G_RETURN; break; };
- case VK_F1: {keycode = B3G_F1; break;}
- case VK_F2: {keycode = B3G_F2; break;}
- case VK_F3: {keycode = B3G_F3; break;}
- case VK_F4: {keycode = B3G_F4; break;}
- case VK_F5: {keycode = B3G_F5; break;}
- case VK_F6: {keycode = B3G_F6; break;}
- case VK_F7: {keycode = B3G_F7; break;}
- case VK_F8: {keycode = B3G_F8; break;}
- case VK_F9: {keycode = B3G_F9; break;}
- case VK_F10: {keycode= B3G_F10; break;}
-
- //case VK_SPACE: {keycode= ' '; break;}
-
- case VK_NEXT: {keycode= B3G_PAGE_DOWN; break;}
- case VK_PRIOR: {keycode= B3G_PAGE_UP; break;}
-
- case VK_INSERT: {keycode= B3G_INSERT; break;}
- case VK_BACK: {keycode= B3G_BACKSPACE; break;}
- case VK_DELETE: {keycode= B3G_DELETE; break;}
-
- case VK_END:{keycode= B3G_END; break;}
- case VK_HOME:{keycode= B3G_HOME; break;}
- case VK_LEFT:{keycode= B3G_LEFT_ARROW; break;}
- case VK_UP:{keycode= B3G_UP_ARROW; break;}
- case VK_RIGHT:{keycode= B3G_RIGHT_ARROW; break;}
- case VK_DOWN:{keycode= B3G_DOWN_ARROW; break;}
- case VK_SHIFT:{keycode=B3G_SHIFT;break;}
- case VK_MENU:{keycode=B3G_ALT;break;}
- case VK_CONTROL:{keycode=B3G_CONTROL;break;}
- default:
- {
- //keycode = MapVirtualKey( virtualKeyCode, MAPVK_VK_TO_CHAR ) & 0x0000FFFF;
- }
- };
-
- return keycode;
-}
-
-
-int getAsciiCodeFromVirtualKeycode(int virtualKeyCode)
-{
- int keycode = 0xffffffff;
-
- if (virtualKeyCode >= 'a' && virtualKeyCode <= 'z')
- {
- return virtualKeyCode;
- }
-
- if (virtualKeyCode >= 'A' && virtualKeyCode <= 'Z')
- {
- return virtualKeyCode+32;//todo: fix the ascii A vs a input
- }
-
- return keycode;
-}
-
-bool Win32Window::isModifierKeyPressed(int key)
-{
- bool isPressed = false;
-
- switch (key)
- {
- case B3G_ALT:
- {
- isPressed = ((sData->m_internalKeyModifierFlags&INTERNAL_ALT_MODIFIER)!=0);
- break;
- };
- case B3G_SHIFT:
- {
- isPressed = ((sData->m_internalKeyModifierFlags&INTERNAL_SHIFT_MODIFIER)!=0);
- break;
- };
- case B3G_CONTROL:
- {
- isPressed = ((sData->m_internalKeyModifierFlags&INTERNAL_CONTROL_MODIFIER)!=0);
- break;
- };
-
- default:
- {
- }
- };
- return isPressed;//m_internalKeyModifierFlags
-}
-
-
-LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- //printf("msg = %d\n", message);
- switch (message)
- {
-
- case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BeginPaint(hWnd, &ps);
- EndPaint(hWnd, &ps);
- }
- return 1;
-
- case WM_ERASEBKGND:
- return 1;
-
- case WM_CLOSE:
- if (sData)
- sData->m_quit = true;
- //PostQuitMessage(0);
- return 1;
-
- case WM_DESTROY:
- if (sData)
- sData->m_quit = true;
- //PostQuitMessage(0);
- return 1;
-
- case WM_SYSKEYUP:
- case WM_KEYUP:
- {
-
- int keycode = getSpecialKeyFromVirtualKeycode(wParam);
- switch (keycode)
- {
- case B3G_ALT:
- {
- sData->m_internalKeyModifierFlags&=~INTERNAL_ALT_MODIFIER;
- break;
- };
- case B3G_SHIFT:
- {
- sData->m_internalKeyModifierFlags &= ~INTERNAL_SHIFT_MODIFIER;
- break;
- };
- case B3G_CONTROL:
- {
- sData->m_internalKeyModifierFlags &=~INTERNAL_CONTROL_MODIFIER;
- break;
- };
- }
-
- if (keycode>=0 && sData && sData->m_keyboardCallback )
- {
- int state=0;
- (*sData->m_keyboardCallback)(keycode,state);
- }
- return 0;
- }
- case WM_CHAR:
- {
- //skip 'enter' key, it is processed in WM_KEYUP/WM_KEYDOWN
- int keycode = getAsciiCodeFromVirtualKeycode(wParam);
- if (keycode < 0)
- {
- if (sData && sData->m_keyboardCallback && ((HIWORD(lParam) & KF_REPEAT) == 0))
- {
- int state = 1;
- (*sData->m_keyboardCallback)(wParam, state);
- }
- }
- return 0;
- }
- case WM_SYSKEYDOWN:
- case WM_KEYDOWN:
- {
- int keycode = getSpecialKeyFromVirtualKeycode(wParam);
- switch (keycode)
- {
- case B3G_ALT:
- {
- sData->m_internalKeyModifierFlags|=INTERNAL_ALT_MODIFIER;
- break;
- };
- case B3G_SHIFT:
- {
- sData->m_internalKeyModifierFlags |= INTERNAL_SHIFT_MODIFIER;
- break;
- };
- case B3G_CONTROL:
- {
- sData->m_internalKeyModifierFlags |=INTERNAL_CONTROL_MODIFIER;
- break;
- };
- }
- if (keycode>=0 && sData && sData->m_keyboardCallback)// && ((HIWORD(lParam) & KF_REPEAT) == 0))
- {
- int state = 1;
- (*sData->m_keyboardCallback)(keycode,state);
- return 1;
- }
- return 0;
- }
-
- case WM_MBUTTONUP:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- if (sData)
- {
- sData->m_mouseMButton=0;
- sData->m_mouseXpos = xPos;
- sData->m_mouseYpos = yPos;
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(1,0,xPos,yPos);
- }
- break;
- }
- case WM_MBUTTONDOWN:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- if (sData)
- {
- sData->m_mouseMButton=1;
- sData->m_mouseXpos = xPos;
- sData->m_mouseYpos = yPos;
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(1,1,xPos,yPos);
- }
- break;
- }
-
- case WM_LBUTTONUP:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- if (sData)
- {
- sData->m_mouseLButton=0;
- sData->m_mouseXpos = xPos;
- sData->m_mouseYpos = yPos;
-
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(0,0,xPos,yPos);
-
- }
- // gDemoApplication->mouseFunc(0,1,xPos,yPos);
- break;
- }
- case WM_LBUTTONDOWN:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- if (sData)
- {
- sData->m_mouseLButton=1;
- sData->m_mouseXpos = xPos;
- sData->m_mouseYpos = yPos;
-
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(0,1,xPos,yPos);
- }
- break;
- }
-
- case 0x020e://WM_MOUSEWHEEL_LEFT_RIGHT
- {
-
- int zDelta = (short)HIWORD(wParam);
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- //m_cameraDistance -= zDelta*0.01;
- if (sData && sData->m_wheelCallback)
- (*sData->m_wheelCallback)(-float(zDelta)*0.05f,0);
- return 1;
- break;
- }
- case 0x020A://WM_MOUSEWHEEL:
- {
-
- int zDelta = (short)HIWORD(wParam);
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- //m_cameraDistance -= zDelta*0.01;
- if (sData && sData->m_wheelCallback)
- (*sData->m_wheelCallback)(0,float(zDelta)*0.05f);
- return 1;
- break;
- }
-
- case WM_MOUSEMOVE:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- sData->m_mouseXpos = xPos;
- sData->m_mouseYpos = yPos;
-
- if (sData && sData->m_mouseMoveCallback)
- (*sData->m_mouseMoveCallback)(xPos,yPos);
-
- break;
- }
- case WM_RBUTTONUP:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- sData->m_mouseRButton = 1;
-
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(2,0,sData->m_mouseXpos,sData->m_mouseYpos);
-
- //gDemoApplication->mouseFunc(2,1,xPos,yPos);
- break;
- }
- case WM_RBUTTONDOWN:
- {
- int xPos = LOWORD(lParam);
- int yPos = HIWORD(lParam);
- sData->m_mouseRButton = 0;
- if (sData && sData->m_mouseButtonCallback)
- (*sData->m_mouseButtonCallback)(2,1,sData->m_mouseXpos,sData->m_mouseYpos);
-
- break;
- }
- case WM_QUIT:
- {
- return 0;
- break;
- }
- case WM_SIZE: // Size Action Has Taken Place
-
- RECT clientRect;
- GetClientRect(hWnd,&clientRect);
-
- switch (wParam) // Evaluate Size Action
- {
-
- case SIZE_MINIMIZED: // Was Window Minimized?
- return 0; // Return
-
- case SIZE_MAXIMIZED: // Was Window Maximized?
- case SIZE_RESTORED: // Was Window Restored?
- RECT wr;
- GetWindowRect(hWnd,&wr);
-
- sData->m_fullWindowWidth = wr.right-wr.left;
- sData->m_fullWindowHeight = wr.bottom-wr.top;//LOWORD (lParam) HIWORD (lParam);
- sData->m_openglViewportWidth = clientRect.right;
- sData->m_openglViewportHeight = clientRect.bottom;
- glViewport(0, 0, sData->m_openglViewportWidth, sData->m_openglViewportHeight);
-
- if (sData->m_resizeCallback)
- (*sData->m_resizeCallback)(sData->m_openglViewportWidth,sData->m_openglViewportHeight);
- //if (sOpenGLInitialized)
- //{
- // //gDemoApplication->reshape(sWidth,sHeight);
- //}
- return 0; // Return
- }
- break;
-
- default:{
-
-
- }
- };
-
- return DefWindowProc(hWnd, message, wParam, lParam);
-}
-
-
-
-void Win32Window::setWindowTitle(const char* titleChar)
-{
-
- wchar_t windowTitle[1024];
- swprintf(windowTitle, 1024, L"%hs", titleChar);
-
- DWORD dwResult;
-
-#ifdef _WIN64
- SetWindowTextW(m_data->m_hWnd, windowTitle);
-#else
- SendMessageTimeoutW(m_data->m_hWnd, WM_SETTEXT, 0,
- reinterpret_cast<LPARAM>(windowTitle),
- SMTO_ABORTIFHUNG, 2000, &dwResult);
-#endif
-}
-
-void Win32Window::createWindow(const b3gWindowConstructionInfo& ci)
-{
- int oglViewportWidth = ci.m_width;
- int oglViewportHeight = ci.m_height;
- bool fullscreen = ci.m_fullscreen;
- int colorBitsPerPixel = ci.m_colorBitsPerPixel;
- void* windowHandle = ci.m_windowHandle;
-
- // get handle to exe file
- HINSTANCE hInstance = GetModuleHandle(0);
-
-
- // create the window if we need to and we do not use the null device
- if (!windowHandle)
- {
-#ifdef UNICODE
- const wchar_t * ClassName = L"DeviceWin32";
- const wchar_t* emptyString= L"";
-#else
- const char* ClassName = "DeviceWin32";
- const char* emptyString = "";
-#endif
- // Register Class
- WNDCLASSEX wcex;
- wcex.cbSize = sizeof(WNDCLASSEX);
- wcex.style = CS_HREDRAW | CS_VREDRAW;
- wcex.lpfnWndProc = WndProc;
- wcex.cbClsExtra = 0;
- wcex.cbWndExtra = 0;
- wcex.hInstance = hInstance;
- wcex.hIcon = LoadIcon( NULL, IDI_APPLICATION ); //(HICON)LoadImage(hInstance, "bullet_ico.ico", IMAGE_ICON, 0,0, LR_LOADTRANSPARENT);//LR_LOADFROMFILE);
- wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
- wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
- wcex.lpszMenuName = 0;
- wcex.lpszClassName = ClassName;
- wcex.hIconSm = 0;
-
- // if there is an icon, load it
-// wcex.hIcon = (HICON)LoadImage(hInstance, "bullet.ico", IMAGE_ICON, 0,0, LR_LOADFROMFILE);
-
- RegisterClassEx(&wcex);
-
- // calculate client size
-
- RECT clientSize;
- clientSize.top = 0;
- clientSize.left = 0;
- clientSize.right = oglViewportWidth;
- clientSize.bottom = oglViewportHeight;
-
- DWORD style = WS_POPUP;
-
- if (!fullscreen)
- style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX;
-
- AdjustWindowRect(&clientSize, style, false);
-
- m_data->m_fullWindowWidth = clientSize.right - clientSize.left;
- m_data->m_fullWindowHeight = clientSize.bottom - clientSize.top;
-
- int windowLeft = (GetSystemMetrics(SM_CXSCREEN) - m_data->m_fullWindowWidth) / 2;
- int windowTop = (GetSystemMetrics(SM_CYSCREEN) - m_data->m_fullWindowHeight) / 2;
-
- if (fullscreen)
- {
- windowLeft = 0;
- windowTop = 0;
- }
-
- // create window
-
- m_data->m_hWnd = CreateWindow( ClassName, emptyString, style, windowLeft, windowTop,
- m_data->m_fullWindowWidth, m_data->m_fullWindowHeight,NULL, NULL, hInstance, NULL);
-
-
- RECT clientRect;
- GetClientRect(m_data->m_hWnd,&clientRect);
-
-
-
- ShowWindow(m_data->m_hWnd, SW_SHOW);
- UpdateWindow(m_data->m_hWnd);
-
- MoveWindow(m_data->m_hWnd, windowLeft, windowTop, m_data->m_fullWindowWidth, m_data->m_fullWindowHeight, TRUE);
-
- GetClientRect(m_data->m_hWnd,&clientRect);
- int w = clientRect.right-clientRect.left;
- int h = clientRect.bottom-clientRect.top;
-// printf("actual client OpenGL viewport width / height = %d, %d\n",w,h);
- m_data->m_openglViewportHeight = h;
- m_data->m_openglViewportWidth = w;
-
- }
- else if (windowHandle)
- {
- // attach external window
- m_data->m_hWnd = static_cast<HWND>(windowHandle);
- RECT r;
- GetWindowRect(m_data->m_hWnd, &r);
- m_data->m_fullWindowWidth = r.right - r.left;
- m_data->m_fullWindowHeight= r.bottom - r.top;
-
-
- //sFullScreen = false;
- //sExternalWindow = true;
- }
-
-
- if (fullscreen)
- {
- DEVMODE dm;
- memset(&dm, 0, sizeof(dm));
- dm.dmSize = sizeof(dm);
- // use default values from current setting
- EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
- m_data->m_oldScreenWidth = dm.dmPelsWidth;
- m_data->m_oldHeight = dm.dmPelsHeight;
- m_data->m_oldBitsPerPel = dm.dmBitsPerPel;
-
- dm.dmPelsWidth = oglViewportWidth;
- dm.dmPelsHeight = oglViewportHeight;
- if (colorBitsPerPixel)
- {
- dm.dmBitsPerPel = colorBitsPerPixel;
- }
- dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
-
- LONG res = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
- if (res != DISP_CHANGE_SUCCESSFUL)
- { // try again without forcing display frequency
- dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- res = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
- }
-
- }
-
-
-}
-
-
-void Win32Window::switchFullScreen(bool fullscreen,int width,int height,int colorBitsPerPixel)
-{
-
- LONG res;
- DEVMODE dm;
- memset(&dm, 0, sizeof(dm));
- dm.dmSize = sizeof(dm);
- // use default values from current setting
- EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm);
-
- dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
-
- if (fullscreen && !m_data->m_oldScreenWidth)
- {
- m_data->m_oldScreenWidth = dm.dmPelsWidth;
- m_data->m_oldHeight = dm.dmPelsHeight;
- m_data->m_oldBitsPerPel = dm.dmBitsPerPel;
-
- if (width && height)
- {
- dm.dmPelsWidth = width;
- dm.dmPelsHeight = height;
- } else
- {
- dm.dmPelsWidth = m_data->m_fullWindowWidth;
- dm.dmPelsHeight = m_data->m_fullWindowHeight;
- }
- if (colorBitsPerPixel)
- {
- dm.dmBitsPerPel = colorBitsPerPixel;
- }
- } else
- {
- if (m_data->m_oldScreenWidth)
- {
- dm.dmPelsWidth = m_data->m_oldScreenWidth;
- dm.dmPelsHeight= m_data->m_oldHeight;
- dm.dmBitsPerPel = m_data->m_oldBitsPerPel;
- }
- }
-
- if (fullscreen)
- {
-
- res = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
- if (!res)
- {
- dm.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
- res = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
- }
-
- DWORD style = WS_POPUP;
- SetWindowLong(m_data->m_hWnd, GWL_STYLE, style);
-
- MoveWindow(m_data->m_hWnd, 0, 0, m_data->m_fullWindowWidth, m_data->m_fullWindowHeight, TRUE);
-
- SetWindowPos(m_data->m_hWnd, NULL,0,0, (int)width, (int)height,
- SWP_FRAMECHANGED |SWP_SHOWWINDOW);//|SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREPOSITION | SWP_NOZORDER);
-
-
- } else
- {
- res = ChangeDisplaySettings(&dm, 0);
-
- DWORD style = WS_SYSMENU | WS_BORDER | WS_CAPTION | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_SIZEBOX;
- SetWindowLong(m_data->m_hWnd, GWL_STYLE, style);
-
- SetWindowPos(m_data->m_hWnd, NULL,0,0, (int)width, (int)height,
- SWP_FRAMECHANGED |SWP_SHOWWINDOW);
- //|SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOOWNERZORDER | SWP_NOREPOSITION | SWP_NOZORDER);
-
- }
-
-
-}
-
-
-
-Win32Window::Win32Window()
-{
- m_data = new InternalData2();
- sData = m_data;
-
-}
-
-Win32Window::~Win32Window()
-{
- setKeyboardCallback(0);
- setMouseMoveCallback(0);
- setMouseButtonCallback(0);
- setWheelCallback(0);
- setResizeCallback(0);
-
- sData = 0;
- delete m_data;
-
-}
-
-void Win32Window::setRenderCallback( b3RenderCallback renderCallback)
-{
-
-}
-
-void Win32Window::closeWindow()
-{
- setKeyboardCallback(0);
- setMouseMoveCallback(0);
- setMouseButtonCallback(0);
- setWheelCallback(0);
- setResizeCallback(0);
- setRenderCallback(0);
-
-
- DestroyWindow(this->m_data->m_hWnd);
-}
-
-void Win32Window::getMouseCoordinates(int& x, int& y)
-{
- x = m_data->m_mouseXpos;
- y = m_data->m_mouseYpos;
-
-}
-
-void Win32Window::runMainLoop()
-{
-
-}
-
-
-void Win32Window::startRendering()
-{
- pumpMessage();
-
-// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //clear buffers
-
- //glCullFace(GL_BACK);
- //glFrontFace(GL_CCW);
- // glEnable(GL_DEPTH_TEST);
-
-
-
-}
-
-
-void Win32Window::renderAllObjects()
-{
-}
-
-void Win32Window::endRendering()
-{
- SwapBuffers( m_data->m_hDC );
-}
-
-float Win32Window::getTimeInSeconds()
-{
- return 0.f;
-}
-
-void Win32Window::setDebugMessage(int x,int y,const char* message)
-{
-}
-
-void Win32Window::setRequestExit()
-{
- m_data->m_quit = true;
-}
-bool Win32Window::requestedExit() const
-{
- return m_data->m_quit;
-}
-
-void Win32Window::setWheelCallback(b3WheelCallback wheelCallback)
-{
- m_data->m_wheelCallback = wheelCallback;
-}
-
-void Win32Window::setMouseMoveCallback(b3MouseMoveCallback mouseCallback)
-{
- m_data->m_mouseMoveCallback = mouseCallback;
-}
-
-void Win32Window::setMouseButtonCallback(b3MouseButtonCallback mouseCallback)
-{
- m_data->m_mouseButtonCallback = mouseCallback;
-}
-
-void Win32Window::setResizeCallback(b3ResizeCallback resizeCallback)
-{
- m_data->m_resizeCallback = resizeCallback;
- if (m_data->m_resizeCallback)
- (*m_data->m_resizeCallback)(m_data->m_openglViewportWidth,m_data->m_openglViewportHeight);
-}
-
-void Win32Window::setKeyboardCallback( b3KeyboardCallback keyboardCallback)
-{
- m_data->m_keyboardCallback = keyboardCallback;
-
-}
-
-b3KeyboardCallback Win32Window::getKeyboardCallback()
-{
- return m_data->m_keyboardCallback;
-}
-
-b3MouseMoveCallback Win32Window::getMouseMoveCallback()
-{
- return m_data->m_mouseMoveCallback;
-}
-b3MouseButtonCallback Win32Window::getMouseButtonCallback()
-{
- return m_data->m_mouseButtonCallback;
-}
-b3ResizeCallback Win32Window::getResizeCallback()
-{
- return m_data->m_resizeCallback;
-}
-b3WheelCallback Win32Window::getWheelCallback()
-{
- return m_data->m_wheelCallback;
-}
-#endif
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.h
deleted file mode 100644
index d10e65d6ec..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/Win32Window.h
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
-Copyright (c) 2012 Advanced Micro Devices, Inc.
-
-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.
-*/
-//Originally written by Erwin Coumans
-
-
-#ifndef _WIN32_WINDOW_H
-#define _WIN32_WINDOW_H
-
-
-
-struct InternalData2;
-
-#include "CommonWindowInterface.h"
-
-class Win32Window : public CommonWindowInterface
-{
- protected:
-
- struct InternalData2* m_data;
-
-
- void pumpMessage();
-
-
-
-public:
-
- Win32Window();
-
- virtual ~Win32Window();
-
- virtual void createWindow(const b3gWindowConstructionInfo& ci);
-
- virtual void switchFullScreen(bool fullscreen,int width=0,int height=0,int colorBitsPerPixel=0);
-
- virtual void closeWindow();
-
- virtual void runMainLoop();
-
- virtual void startRendering();
-
- virtual void renderAllObjects();
-
- virtual void endRendering();
-
- virtual float getTimeInSeconds();
-
- virtual void setDebugMessage(int x,int y,const char* message);
-
- virtual bool requestedExit() const;
-
- virtual void setRequestExit();
-
- virtual void getMouseCoordinates(int& x, int& y);
-
- virtual void setMouseMoveCallback(b3MouseMoveCallback mouseCallback);
- virtual void setMouseButtonCallback(b3MouseButtonCallback mouseCallback);
- virtual void setResizeCallback(b3ResizeCallback resizeCallback);
- virtual void setWheelCallback(b3WheelCallback wheelCallback);
- virtual void setKeyboardCallback( b3KeyboardCallback keyboardCallback);
-
- virtual b3MouseMoveCallback getMouseMoveCallback();
- virtual b3MouseButtonCallback getMouseButtonCallback();
- virtual b3ResizeCallback getResizeCallback();
- virtual b3WheelCallback getWheelCallback();
- virtual b3KeyboardCallback getKeyboardCallback();
-
- virtual void setRenderCallback( b3RenderCallback renderCallback);
-
- virtual void setWindowTitle(const char* title);
-
- virtual bool isModifierKeyPressed(int key);
-};
-
-#endif //_WIN32_WINDOW_H
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.cpp b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.cpp
deleted file mode 100644
index 68aa22720b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.cpp
+++ /dev/null
@@ -1,1118 +0,0 @@
-#include "X11OpenGLWindow.h"
-#include "OpenGLInclude.h"
-
-#include<stdio.h>
-#include<stdlib.h>
-#ifdef GLEW_STATIC
-#include "CustomGL/glew.h"
-#else
-#include <GL/glew.h>
-#endif//GLEW_STATIC
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-#include "CustomGL/glxew.h"
-#else
-#include<GL/glx.h>
-#endif // GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-#include <assert.h>
-
-//#define DYNAMIC_LOAD_X11_FUNCTIONS
-#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
-#include <dlfcn.h>
-#endif //DYNAMIC_LOAD_X11_FUNCTIONS
-
-//#include<X11/X.h>
-//#include<X11/Xlib.h>
-//#include<GL/gl.h>
-
-//defined in GL/glxew.h
-//#include<GL/glu.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-#include <pthread.h>
-
-GLint att[] = { GLX_RGBA,
-GLX_DEPTH_SIZE, 24,
-GLX_RED_SIZE , 8,
-GLX_GREEN_SIZE , 8,
-GLX_BLUE_SIZE , 8,
-GLX_ALPHA_SIZE , 8,
-GLX_STENCIL_SIZE , 8,
-GLX_DOUBLEBUFFER,
-None };
-/*
- static int att[] =
- {
- GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None
-
- GLX_X_RENDERABLE , True,
- GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
- GLX_RENDER_TYPE , GLX_RGBA_BIT,
- GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
- GLX_RED_SIZE , 8,
- GLX_GREEN_SIZE , 8,
- GLX_BLUE_SIZE , 8,
- GLX_ALPHA_SIZE , 8,
- GLX_DEPTH_SIZE , 24,
- GLX_STENCIL_SIZE , 8,
- GLX_DOUBLEBUFFER , True,
- None
- };
-*/
-static bool forceOpenGL3 = true;
-
-
-
-#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
-
-///our X11 function typedefs
-
-typedef int (*PFNXFREE)(void*);
-typedef XErrorHandler (* PFNXSETERRORHANDLER) (XErrorHandler);
-typedef int (* PFNXSYNC) (Display* a,Bool b);
-typedef Display* (* PFNXOPENDISPLAY) (_Xconst char* a);
-typedef Colormap (*PFNXCREATECOLORMAP) (Display* a,Window b,Visual* c,int d);
-typedef Window (*PFNXCREATEWINDOW) (Display* a,Window b,int c,int d,unsigned int e,unsigned int f,unsigned int g,int h,unsigned int i,Visual* j,unsigned long k,XSetWindowAttributes* l);
-typedef int (*PFNXMAPWINDOW) (Display*, Window);
-typedef int (*PFNXSTORENAME) (Display* a,Window b,_Xconst char* c);
-typedef int (*PFNXCLOSEDISPLAY) (Display* a);
-typedef int (*PFNXDESTROYWINDOW) (Display* a,Window b);
-typedef int (*PFNXRAISEWINDOW) (Display* a, Window b);
-
-#if NeedWidePrototypes
- typedef KeySym* (*PFNXGETKEYBOARDMAPPING) (Display*,unsigned int,int,int*);
- typedef KeySym (*PFNXKEYCODETOKEYSYM) (Display* a,unsigned int b,int c);
-#else
- typedef KeySym* (*PFNXGETKEYBOARDMAPPING) (Display*,KeyCode,int,int*);
- typedef KeySym (*PFNXKEYCODETOKEYSYM) (Display* a,KeyCode b,int c);
-#endif
-typedef void (*PFNXCONVERTCASE) (KeySym /* sym */,KeySym * /* lower */,KeySym * /* upper */);
-typedef int (*PFNXPENDING) (Display* a);
-typedef int (*PFNXNEXTEVENT) (Display* a,XEvent* b);
-typedef int (*PFNXEVENTSQUEUED) (Display* a,int b);
-typedef int (*PFNXPEEKEVENT) (Display* a,XEvent* b);
-typedef KeySym (*PFNXLOOKUPKEYSYM) (XKeyEvent* a,int b);
-typedef Status (*PFNXGETWINDOWATTRIBUTES) (Display* a,Window b,XWindowAttributes* c);
-
-#define X11_LIBRARY "libX11.so.6"
-
-#define MyXSync m_data->m_x11_XSync
-#define MyXGetKeyboardMapping m_data->m_x11_XGetKeyboardMapping
-#define MyXSetErrorHandler m_data->m_x11_XSetErrorHandler
-#define MyXOpenDisplay m_data->m_x11_XOpenDisplay
-#define MyXCreateColormap m_data->m_x11_XCreateColormap
-#define MyXCreateWindow m_data->m_x11_XCreateWindow
-#define MyXMapWindow m_data->m_x11_XMapWindow
-#define MyXStoreName m_data->m_x11_XStoreName
-#define MyXDestroyWindow m_data->m_x11_XDestroyWindow
-#define MyXRaiseWindow m_data->m_x11_XRaiseWindow
-#define MyXCloseDisplay m_data->m_x11_XCloseDisplay
-#define MyXKeycodeToKeysym m_data->m_x11_XKeycodeToKeysym
-#define MyXConvertCase m_data->m_x11_XConvertCase
-#define MyXPending m_data->m_x11_XPending
-#define MyXNextEvent m_data->m_x11_XNextEvent
-#define MyXEventsQueued m_data->m_x11_XEventsQueued
-#define MyXPeekEvent m_data->m_x11_XPeekEvent
-#define MyXNextEvent m_data->m_x11_XNextEvent
-#define MyXGetWindowAttributes m_data->m_x11_XGetWindowAttributes
-#define MyXStoreName m_data->m_x11_XStoreName
-#define MyXFree m_data->m_x11_XFree
-#define MyXMapWindow m_data->m_x11_XMapWindow
-#define MyXStoreName m_data->m_x11_XStoreName
-#define MyXLookupKeysym m_data->m_x11_XLookupKeysym
-
-#else
-#define MyXSync XSync
-#define MyXGetKeyboardMapping XGetKeyboardMapping
-#define MyXSetErrorHandler XSetErrorHandler
-#define MyXOpenDisplay XOpenDisplay
-#define MyXCreateColormap XCreateColormap
-#define MyXCreateWindow XCreateWindow
-#define MyXMapWindow XMapWindow
-#define MyXStoreName XStoreName
-#define MyXDestroyWindow XDestroyWindow
-#define MyXRaiseWindow XRaiseWindow
-#define MyXCloseDisplay XCloseDisplay
-#define MyXKeycodeToKeysym XKeycodeToKeysym
-#define MyXConvertCase XConvertCase
-#define MyXPending XPending
-#define MyXNextEvent XNextEvent
-#define MyXEventsQueued XEventsQueued
-#define MyXPeekEvent XPeekEvent
-#define MyXNextEvent XNextEvent
-#define MyXGetWindowAttributes XGetWindowAttributes
-#define MyXStoreName XStoreName
-#define MyXFree XFree
-#define MyXMapWindow XMapWindow
-#define MyXStoreName XStoreName
-#define MyXLookupKeysym XLookupKeysym
-
-#endif//DYNAMIC_LOAD_X11_FUNCTIONS
-
-enum
-{
- MY_X11_ALT_KEY = 1,
- MY_X11_SHIFT_KEY = 2,
- MY_X11_CONTROL_KEY = 4
-};
-
-struct InternalData2
-{
- Display* m_dpy;
- Window m_root;
- XVisualInfo* m_vi;
- Colormap m_cmap;
- XSetWindowAttributes m_swa;
- Window m_win;
- GLXContext m_glc;
- XWindowAttributes m_gwa;
- XEvent m_xev;
- GLXFBConfig m_bestFbc;
- int m_modifierFlags;
- int m_glWidth;
- int m_glHeight;
-
-#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
- //dynamically load stuff
- void* m_x11_library;
- PFNXFREE m_x11_XFree;
- PFNXSETERRORHANDLER m_x11_XSetErrorHandler;
- PFNXSYNC m_x11_XSync;
- PFNXOPENDISPLAY m_x11_XOpenDisplay;
- PFNXCREATECOLORMAP m_x11_XCreateColormap;
- PFNXCREATEWINDOW m_x11_XCreateWindow;
- PFNXMAPWINDOW m_x11_XMapWindow;
- PFNXSTORENAME m_x11_XStoreName;
- PFNXCLOSEDISPLAY m_x11_XCloseDisplay;
- PFNXDESTROYWINDOW m_x11_XDestroyWindow;
- PFNXRAISEWINDOW m_x11_XRaiseWindow;
- PFNXKEYCODETOKEYSYM m_x11_XKeycodeToKeysym;
- PFNXGETKEYBOARDMAPPING m_x11_XGetKeyboardMapping;
- PFNXCONVERTCASE m_x11_XConvertCase;
- PFNXPENDING m_x11_XPending;
- PFNXNEXTEVENT m_x11_XNextEvent;
- PFNXEVENTSQUEUED m_x11_XEventsQueued;
- PFNXPEEKEVENT m_x11_XPeekEvent;
- PFNXLOOKUPKEYSYM m_x11_XLookupKeysym;
- PFNXGETWINDOWATTRIBUTES m_x11_XGetWindowAttributes;
-#endif //DYNAMIC_LOAD_X11_FUNCTIONS
-
- b3WheelCallback m_wheelCallback;
- b3MouseMoveCallback m_mouseMoveCallback;
- b3MouseButtonCallback m_mouseButtonCallback;
- b3ResizeCallback m_resizeCallback;
- b3KeyboardCallback m_keyboardCallback;
-
- InternalData2()
- :m_dpy(0),
- m_vi(0),
- m_modifierFlags(0),
- m_glWidth(-1),
- m_glHeight(-1),
- m_wheelCallback(0),
- m_mouseMoveCallback(0),
- m_mouseButtonCallback(0),
- m_resizeCallback(0),
- m_keyboardCallback(0)
- {
-#ifdef DYNAMIC_LOAD_X11_FUNCTIONS
- m_x11_library = dlopen(X11_LIBRARY, RTLD_LOCAL | RTLD_NOW);
- if (!m_x11_library)
- {
- printf("Error opening X11 library %s\n", X11_LIBRARY);
- exit(0);
- }
-
- bool missingFunc = false;
-
- missingFunc = ((m_x11_XFree = (PFNXFREE) dlsym(m_x11_library, "XFree"))==NULL) | missingFunc;
- assert(!missingFunc);
- if (missingFunc) { printf("Error: missing func XFree in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XSetErrorHandler = (PFNXSETERRORHANDLER) dlsym(m_x11_library,"XSetErrorHandler"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XSetErrorHandler in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XSetErrorHandler = (PFNXSETERRORHANDLER) dlsym(m_x11_library,"XSetErrorHandler"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XSetErrorHandler in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XSync = (PFNXSYNC) dlsym(m_x11_library,"XSync"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XSync in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XOpenDisplay = (PFNXOPENDISPLAY) dlsym(m_x11_library,"XOpenDisplay"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XOpenDisplay in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XCreateColormap = (PFNXCREATECOLORMAP) dlsym(m_x11_library,"XCreateColormap"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XCreateColormap in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XCreateWindow = (PFNXCREATEWINDOW) dlsym(m_x11_library,"XCreateWindow"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XCreateWindow in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XMapWindow = (PFNXMAPWINDOW) dlsym(m_x11_library,"XMapWindow"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XMapWindow in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XStoreName = (PFNXSTORENAME) dlsym(m_x11_library,"XStoreName"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XStoreName in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XCloseDisplay = (PFNXCLOSEDISPLAY) dlsym(m_x11_library,"XCloseDisplay"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XCloseDisplay in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XDestroyWindow = (PFNXDESTROYWINDOW) dlsym(m_x11_library,"XDestroyWindow"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XDestroyWindow in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XRaiseWindow = (PFNXRAISEWINDOW) dlsym(m_x11_library,"XRaiseWindow"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XRaiseWindow in %s, exiting!\n", X11_LIBRARY); exit(0);}
-
- missingFunc = ((m_x11_XGetKeyboardMapping = (PFNXGETKEYBOARDMAPPING) dlsym(m_x11_library,"XGetKeyboardMapping"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XGetKeyboardMapping in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XKeycodeToKeysym = (PFNXKEYCODETOKEYSYM) dlsym(m_x11_library,"XKeycodeToKeysym"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XKeycodeToKeysym in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XConvertCase = (PFNXCONVERTCASE) dlsym(m_x11_library,"XConvertCase"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XConvertCase in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XPending = (PFNXPENDING) dlsym(m_x11_library,"XPending"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XPending in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XNextEvent = (PFNXNEXTEVENT) dlsym(m_x11_library,"XNextEvent"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XNextEvent in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XEventsQueued = (PFNXEVENTSQUEUED) dlsym(m_x11_library,"XEventsQueued"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XEventsQueued in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XPeekEvent = (PFNXPEEKEVENT) dlsym(m_x11_library,"XPeekEvent"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XPeekEvent in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XLookupKeysym = (PFNXLOOKUPKEYSYM) dlsym(m_x11_library,"XLookupKeysym"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XLookupKeysym in %s, exiting!\n", X11_LIBRARY); exit(0);}
- missingFunc = ((m_x11_XGetWindowAttributes = (PFNXGETWINDOWATTRIBUTES) dlsym(m_x11_library,"XGetWindowAttributes"))==NULL) | missingFunc;
- if (missingFunc) { printf("Error: missing func XGetWindowAttributes in %s, exiting!\n", X11_LIBRARY); exit(0);}
-
- if (missingFunc)
- {
- printf("Error: a missing func in %s, exiting!\n", X11_LIBRARY);
- exit(0);
- } else
- {
- printf("X11 functions dynamically loaded using dlopen/dlsym OK!\n");
- }
-#endif //DYNAMIC_LOAD_X11_FUNCTIONS
- }
-};
-
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-typedef GLXContext (*glXCreateContextAttribsARBProc)(Display*, GLXFBConfig, GLXContext, Bool, const int*);
-
-// Helper to check for extension string presence. Adapted from:
-// http://www.opengl.org/resources/features/OGLextensions/
-static bool isExtensionSupported(const char *extList, const char *extension)
-{
- const char *start;
- const char *where, *terminator;
-
- /* Extension names should not have spaces. */
- where = strchr(extension, ' ');
- if (where || *extension == '\0')
- return false;
-
- /* It takes a bit of care to be fool-proof about parsing the
- OpenGL extensions string. Don't be fooled by sub-strings,
- etc. */
- for (start=extList;;) {
- where = strstr(start, extension);
-
- if (!where)
- break;
-
- terminator = where + strlen(extension);
-
- if ( where == start || *(where - 1) == ' ' )
- if ( *terminator == ' ' || *terminator == '\0' )
- return true;
-
- start = terminator;
- }
-
- return false;
-}
-
-static bool ctxErrorOccurred = false;
-static int ctxErrorHandler( Display *dpy, XErrorEvent *ev )
-{
- ctxErrorOccurred = true;
- return 0;
-}
-
-
-
-
-X11OpenGLWindow::X11OpenGLWindow()
-:m_OpenGLInitialized(false),
-m_requestedExit(false)
-{
- m_data = new InternalData2;
-}
-
-X11OpenGLWindow::~X11OpenGLWindow()
-{
- if (m_OpenGLInitialized)
- {
- disableOpenGL();
- }
-
- delete m_data;
-}
-
-
-
-void X11OpenGLWindow::enableOpenGL()
-{
-
-
- if (forceOpenGL3)
- {
- // Get the default screen's GLX extension list
- const char *glxExts = glXQueryExtensionsString( m_data->m_dpy,
- DefaultScreen( m_data->m_dpy ) );
-
- // NOTE: It is not necessary to create or make current to a context before
- // calling glXGetProcAddressARB, unless we dynamically load OpenGL/GLX/X11
-
- glXCreateContextAttribsARBProc glXCreateContextAttribsARB = 0;
- glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc)
- glXGetProcAddressARB( (const GLubyte *) "glXCreateContextAttribsARB" );
-
- GLXContext ctx = 0;
-
- // Install an X error handler so the application won't exit if GL 3.0
- // context allocation fails.
- //
- // Note this error handler is global. All display connections in all threads
- // of a process use the same error handler, so be sure to guard against other
- // threads issuing X commands while this code is running.
- ctxErrorOccurred = false;
- int (*oldHandler)(Display*, XErrorEvent*) =
- MyXSetErrorHandler(&ctxErrorHandler);
-
- // Check for the GLX_ARB_create_context extension string and the function.
- // If either is not present, use GLX 1.3 context creation method.
- if ( !isExtensionSupported( glxExts, "GLX_ARB_create_context" ) ||
- !glXCreateContextAttribsARB )
- {
- printf( "glXCreateContextAttribsARB() not found"
- " ... using old-style GLX context\n" );
- ctx = glXCreateNewContext( m_data->m_dpy, m_data->m_bestFbc, GLX_RGBA_TYPE, 0, True );
- }
-
- // If it does, try to get a GL 3.0 context!
- else
- {
- int context_attribs[] = {
- GLX_CONTEXT_MAJOR_VERSION_ARB ,3,
- GLX_CONTEXT_MINOR_VERSION_ARB, 2,
- GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB,
- GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB,None
- };
-/*
- int context_attribs[] =
- {
- GLX_CONTEXT_MAJOR_VERSION_ARB, 3,
- GLX_CONTEXT_MINOR_VERSION_ARB, 2,
-
- //GLX_CONTEXT_FLAGS_ARB , GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB,
- None
- };
-*/
- printf( "Creating context\n" );
- ctx = glXCreateContextAttribsARB( m_data->m_dpy, m_data->m_bestFbc, 0,
- True, context_attribs );
-
- // Sync to ensure any errors generated are processed.
- MyXSync( m_data->m_dpy, False );
- if ( !ctxErrorOccurred && ctx )
- printf( "Created GL 3.0 context\n" );
- else
- {
- // Couldn't create GL 3.0 context. Fall back to old-style 2.x context.
- // When a context version below 3.0 is requested, implementations will
- // return the newest context version compatible with OpenGL versions less
- // than version 3.0.
- // GLX_CONTEXT_MAJOR_VERSION_ARB = 1
- context_attribs[1] = 1;
- // GLX_CONTEXT_MINOR_VERSION_ARB = 0
- context_attribs[3] = 0;
-
- ctxErrorOccurred = false;
-
- printf( "Failed to create GL 3.0 context"
- " ... using old-style GLX context\n" );
- ctx = glXCreateContextAttribsARB( m_data->m_dpy, m_data->m_bestFbc, 0,
- True, context_attribs );
- }
- }
-
- // Sync to ensure any errors generated are processed.
- MyXSync( m_data->m_dpy, False );
-
- // Restore the original error handler
- MyXSetErrorHandler( oldHandler );
-
- if ( ctxErrorOccurred || !ctx )
- {
- printf( "Failed to create an OpenGL context\n" );
- exit(1);
- }
-
- // Verifying that context is a direct context
- if ( ! glXIsDirect ( m_data->m_dpy, ctx ) )
- {
- printf( "Indirect GLX rendering context obtained\n" );
- }
- else
- {
- printf( "Direct GLX rendering context obtained\n" );
- }
-
- printf( "Making context current\n" );
- glXMakeCurrent( m_data->m_dpy, m_data->m_win, ctx );
- m_data->m_glc = ctx;
-
- } else
- {
- m_data->m_glc = glXCreateContext(m_data->m_dpy, m_data->m_vi, NULL, GL_TRUE);
- glXMakeCurrent(m_data->m_dpy, m_data->m_win, m_data->m_glc);
- }
-
-#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-{
- GLboolean res = glewOpenGL11Init();
- if (res==0)
- {
- printf("glewOpenGL11Init OK!\n");
- } else
- {
- printf("ERROR: glewOpenGL11Init failed, exiting!\n");
- exit(0);
- }
-}
-
-#endif //GLEW_INIT_OPENGL11_FUNCTIONS
-
- const GLubyte* ven = glGetString(GL_VENDOR);
- printf("GL_VENDOR=%s\n", ven);
-
- const GLubyte* ren = glGetString(GL_RENDERER);
- printf("GL_RENDERER=%s\n",ren);
- const GLubyte* ver = glGetString(GL_VERSION);
- printf("GL_VERSION=%s\n", ver);
- const GLubyte* sl = glGetString(GL_SHADING_LANGUAGE_VERSION);
- printf("GL_SHADING_LANGUAGE_VERSION=%s\n", sl);
-
-//Access pthreads as a workaround for a bug in Linux/Ubuntu
-//See https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers-319/+bug/1248642
-
- int i=pthread_getconcurrency();
- printf("pthread_getconcurrency()=%d\n",i);
-
-// const GLubyte* ext = glGetString(GL_EXTENSIONS);
-// printf("GL_EXTENSIONS=%s\n", ext);
-}
-
-void X11OpenGLWindow::disableOpenGL()
-{
- glXMakeCurrent(m_data->m_dpy, None, NULL);
- glXDestroyContext(m_data->m_dpy, m_data->m_glc);
-}
-
-
-void X11OpenGLWindow::createWindow(const b3gWindowConstructionInfo& ci)
-{
-
- m_data->m_dpy = MyXOpenDisplay(NULL);
-
- if(m_data->m_dpy == NULL) {
- printf("\n\tcannot connect to X server\n\n");
- exit(0);
- }
-
- m_data->m_root = DefaultRootWindow(m_data->m_dpy);
-
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-GLboolean res = glewXInit();
-if (res==0)
-{
- printf("glewXInit OK\n");
-} else
-{
- printf("glewXInit failed, exit\n");
- exit(0);
-}
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-
- if (ci.m_openglVersion < 3)
- {
- forceOpenGL3 = false;
- }
-
- if (forceOpenGL3)
- {
- int glxMinor, glxMajor;
- if (!glXQueryVersion(m_data->m_dpy,&glxMajor,&glxMinor) || (((glxMajor==1)&&(glxMinor<3)) || (glxMajor<1)))
- {
- printf("Invalid GLX version: major %d, minor %d\n",glxMajor,glxMinor);
- exit(0);
- }
-
- static int visual_attribs[] =
- {
- GLX_X_RENDERABLE , True,
- GLX_DRAWABLE_TYPE , GLX_WINDOW_BIT,
- GLX_RENDER_TYPE , GLX_RGBA_BIT,
- GLX_X_VISUAL_TYPE , GLX_TRUE_COLOR,
- GLX_RED_SIZE , 8,
- GLX_GREEN_SIZE , 8,
- GLX_BLUE_SIZE , 8,
- GLX_ALPHA_SIZE , 8,
- GLX_DEPTH_SIZE , 24,
- GLX_STENCIL_SIZE , 8,
- GLX_DOUBLEBUFFER , True,
- None
- };
- int fbcount;
- GLXFBConfig* fbc = glXChooseFBConfig(m_data->m_dpy, DefaultScreen(m_data->m_dpy), visual_attribs, &fbcount);
- if (!fbc)
- {
- printf( "Failed to retrieve a framebuffer config\n" );
- exit(1);
- }
-///don't use highest samples, it is really slow on some NVIDIA Quadro cards
-#ifdef USE_HIGHEST_SAMPLES
- int best_fbc = -1, worst_fbc = -1, best_num_samp = -1, worst_num_samp = 999;
-
- int i;
- for (i=0; i<fbcount; ++i)
- {
- XVisualInfo *vi = glXGetVisualFromFBConfig( m_data->m_dpy, fbc[i] );
- if ( vi )
- {
- int samp_buf, samples;
- glXGetFBConfigAttrib( m_data->m_dpy, fbc[i], GLX_SAMPLE_BUFFERS, &samp_buf );
- glXGetFBConfigAttrib( m_data->m_dpy, fbc[i], GLX_SAMPLES , &samples );
-
- //printf( " Matching fbconfig %d, visual ID 0x%2x: SAMPLE_BUFFERS = %d,"
- // " SAMPLES = %d\n",
- // i, vi -> visualid, samp_buf, samples );
-
- if ( best_fbc < 0 || (samp_buf && (samples > best_num_samp)) )
- best_fbc = i, best_num_samp = samples;
- if ( worst_fbc < 0 || (!samp_buf || (samples < worst_num_samp)) )
- worst_fbc = i, worst_num_samp = samples;
- }
- MyXFree( vi );
- }
-
- m_data->m_bestFbc = fbc[ best_fbc ];
-#else
- m_data->m_bestFbc = *fbc;
-#endif
- // Be sure to free the FBConfig list allocated by glXChooseFBConfig()
- MyXFree( fbc );
-
- m_data->m_vi = glXGetVisualFromFBConfig( m_data->m_dpy, m_data->m_bestFbc );
-
-
- m_data->m_swa.colormap = m_data->m_cmap = MyXCreateColormap( m_data->m_dpy,
- RootWindow( m_data->m_dpy, m_data->m_vi->screen ),
- m_data->m_vi->visual, AllocNone );
- m_data->m_swa.background_pixmap = None ;
- m_data->m_swa.border_pixel = 0;
- m_data->m_swa.event_mask = ExposureMask | KeyReleaseMask | KeyPressMask |ButtonPressMask | ButtonReleaseMask |PointerMotionMask|StructureNotifyMask;
-;
- m_data->m_root = RootWindow( m_data->m_dpy, m_data->m_vi->screen );
-
- m_data->m_win = MyXCreateWindow( m_data->m_dpy, m_data->m_root,
- 0, 0, ci.m_width, ci.m_height, 0, m_data->m_vi->depth, InputOutput,
- m_data->m_vi->visual,
- CWBorderPixel|CWColormap|CWEventMask, &m_data->m_swa );
-
- //m_data->m_win = m_data->m_x11_XCreateWindow(m_data->m_dpy, m_data->m_root, 0, 0, ci.m_width, ci.m_height, 0, m_data->m_vi->depth, InputOutput, m_data->m_vi->visual, CWColormap | CWEventMask, &m_data->m_swa);
-
-
- if (!m_data->m_win)
- {
- printf("Cannot create window\n");
- exit(0);
- }
-
- MyXMapWindow(m_data->m_dpy, m_data->m_win);
- MyXStoreName(m_data->m_dpy, m_data->m_win, "OpenGL3 Window");
-
-
- } else
- {
- m_data->m_vi = glXChooseVisual(m_data->m_dpy, 0, att);
-
- printf("4\n");
-
- if(m_data->m_vi == NULL) {
- printf("\n\tno appropriate visual found\n\n");
- exit(0);
- }
- else {
- printf("\n\tvisual %p selected\n", (void *)m_data->m_vi->visualid); /* %p creates hexadecimal output like in glxinfo */
- }
-
-
- m_data->m_cmap = MyXCreateColormap(m_data->m_dpy, m_data->m_root, m_data->m_vi->visual, AllocNone);
- m_data->m_swa.colormap = m_data->m_cmap;
- m_data->m_swa.event_mask = ExposureMask | KeyReleaseMask | KeyPressMask |ButtonPressMask | ButtonReleaseMask |PointerMotionMask|StructureNotifyMask;
- m_data->m_win = MyXCreateWindow(m_data->m_dpy, m_data->m_root, 0, 0, ci.m_width, ci.m_height, 0, m_data->m_vi->depth, InputOutput, m_data->m_vi->visual, CWColormap | CWEventMask, &m_data->m_swa);
-
- MyXMapWindow(m_data->m_dpy, m_data->m_win);
-
- MyXStoreName(m_data->m_dpy, m_data->m_win, "OpenGL2 Window");
-
-
- }
-
- enableOpenGL();
-}
-
-void X11OpenGLWindow::closeWindow()
-{
- disableOpenGL();
-
- MyXDestroyWindow(m_data->m_dpy, m_data->m_win);
- MyXCloseDisplay(m_data->m_dpy);
-}
-
-int X11OpenGLWindow::getAsciiCodeFromVirtualKeycode(int keycode)
-{
- int result = 0;
-
- KeySym key, key_lc, key_uc;
-
- int keysyms_per_keycode_return;
- KeySym *keysym = MyXGetKeyboardMapping(m_data->m_dpy,
- keycode,
- 1,
- &keysyms_per_keycode_return);
-
- key = keysym[0];
-
-
- //key = MyXKeycodeToKeysym( m_data->m_dpy, keycode, 0 );
-
- switch( key )
- {
- case XK_Escape: return B3G_ESCAPE;
- case XK_Return: return B3G_RETURN;
-
- case XK_Control_L:
- case XK_Control_R: {
- return B3G_CONTROL;
- }
- case XK_Left: return B3G_LEFT_ARROW;
- case XK_Right: return B3G_RIGHT_ARROW;
- case XK_Up: return B3G_UP_ARROW;
- case XK_Down: return B3G_DOWN_ARROW;
-
- case XK_Alt_L:
- case XK_Alt_R:
- {
- return B3G_ALT;
- }
- case XK_Shift_L:
- case XK_Shift_R: return B3G_SHIFT;
- case XK_F1: return B3G_F1;
- case XK_F2: return B3G_F2;
- case XK_F3: return B3G_F3;
- case XK_F4: return B3G_F4;
- case XK_F5: return B3G_F5;
- case XK_F6: return B3G_F6;
- case XK_F7: return B3G_F7;
- case XK_F8: return B3G_F8;
- case XK_F9: return B3G_F9;
- case XK_F10: return B3G_F10;
- case XK_F11: return B3G_F11;
- case XK_F12: return B3G_F12;
- case XK_F13: return B3G_F13;
- case XK_F14: return B3G_F14;
- case XK_F15: return B3G_F15;
- default:
- // Make lowercase
- MyXConvertCase( key, &key_lc, &key_uc );
- key = key_lc;
- // Valid ISO 8859-1 character?
- if( (key >= 32 && key <= 126) ||(key >= 160 && key <= 255) )
- {
- return (int) key;
- }
- result = -1;
- }
-
- MyXFree(keysym);
-
- return result;
-}
-
-bool X11OpenGLWindow::isModifierKeyPressed(int key)
-{
- bool isPressed = false;
-
- switch (key)
- {
- case B3G_ALT:
- {
- isPressed = ((m_data->m_modifierFlags & MY_X11_ALT_KEY)!=0);
- break;
- };
- case B3G_SHIFT:
- {
- isPressed = ((m_data->m_modifierFlags & MY_X11_SHIFT_KEY)!=0);
- break;
- };
- case B3G_CONTROL:
- {
- isPressed = ((m_data->m_modifierFlags & MY_X11_CONTROL_KEY )!=0);
- break;
- };
-
- default:
- {
- }
- };
- return isPressed;
-}
-
-void X11OpenGLWindow::pumpMessage()
-{
-
- int buttonState = 1;
-
- // Process all pending events
- while( MyXPending( m_data->m_dpy ) )
- {
- MyXNextEvent(m_data->m_dpy, &m_data->m_xev);
- // printf("#");
- // fflush(stdout);
- switch( m_data->m_xev.type )
- {
- case KeyPress:
- {
- int keycode = getAsciiCodeFromVirtualKeycode(m_data->m_xev.xkey.keycode);
- switch (keycode)
- {
- case B3G_ALT:
- m_data->m_modifierFlags |= MY_X11_ALT_KEY;
- break;
- case B3G_SHIFT:
- m_data->m_modifierFlags |= MY_X11_SHIFT_KEY;
- break;
- case B3G_CONTROL:
- m_data->m_modifierFlags |= MY_X11_CONTROL_KEY;
- break;
- default:
- {}
- };
- if (m_data->m_keyboardCallback)
- {
-
- int state = 1;
- (*m_data->m_keyboardCallback)(keycode,state);
- // printf("keycode %d",keycode);
- // fflush(stdout);
-
- }
- break;
- }
-
- case KeyRelease:
- {
- // fflush(stdout);
- int keycode = getAsciiCodeFromVirtualKeycode( m_data->m_xev.xkey.keycode);
- switch (keycode)
- {
- case B3G_ALT:
- m_data->m_modifierFlags &= ~MY_X11_ALT_KEY;
- break;
- case B3G_SHIFT:
- m_data->m_modifierFlags &= ~MY_X11_SHIFT_KEY;
- break;
- case B3G_CONTROL:
- m_data->m_modifierFlags &= ~MY_X11_CONTROL_KEY;
- break;
- default:
- {}
- };
-
- if (m_data->m_keyboardCallback)
- {
-#if 0
- unsigned short is_retriggered = 0;
-///filter out keyboard repeat
-//see http://stackoverflow.com/questions/2100654/ignore-auto-repeat-in-x11-applications
- if (MyXEventsQueued(m_data->m_dpy, QueuedAfterReading))
- {
- XEvent nev;
- MyXPeekEvent(m_data->m_dpy, &nev);
-
- if (nev.type == KeyPress && nev.xkey.time == m_data->m_xev.xkey.time &&
- nev.xkey.keycode == m_data->m_xev.xkey.keycode)
- {
- fprintf (stdout, "key #%ld was retriggered.\n",
- (long) MyXLookupKeysym(&nev.xkey, 0));
-
- // delete retriggered KeyPress event
- MyXNextEvent(m_data->m_dpy, & m_data->m_xev);
- is_retriggered = 1;
- }
- }
-#endif
- int state = 0;
- (*m_data->m_keyboardCallback)(keycode,state);
- }
-
- break;
- }
-
- case ButtonRelease:
- buttonState = 0;
- //continue with ButtonPress code
- case ButtonPress:
- {
-// printf("!");
-// fflush(stdout);
-
- int button=-1;
-
- switch (m_data->m_xev.xbutton.button)
- {
- case Button1:
- {
- button=0;
- break;
- }
- case Button2:
- {
- button=1;
- break;
- }
- case Button3:
- {
- button=2;
- break;
- }
- case Button4:
- {
- if (m_data->m_wheelCallback)
- {
- (*m_data->m_wheelCallback)(0,10);
- }
- break;
- }
- case Button5:
- {
- if (m_data->m_wheelCallback)
- {
- (*m_data->m_wheelCallback)(0,-10);
- }
- break;
- }
- }
- int xpos = m_data->m_xev.xmotion.x;
- int ypos = m_data->m_xev.xmotion.y;
-
- if (button>=0 && m_data->m_mouseButtonCallback)
- {
-// printf("xpos = %d, ypos = %d\n",xpos,ypos);
-
- (*m_data->m_mouseButtonCallback)(button,buttonState,xpos,ypos);
- }
- break;
- }
- case MotionNotify:
- {
-// printf("!");
-// fflush(0);
- if (m_data->m_mouseMoveCallback)
- {
- int xpos = m_data->m_xev.xmotion.x;
- int ypos = m_data->m_xev.xmotion.y;
- (*m_data->m_mouseMoveCallback)(xpos,ypos);
- }
- break;
- }
- case ConfigureNotify:
- {
- // printf("@");
- // fflush(0);
- m_data->m_glWidth = m_data->m_xev.xconfigure.width;
- m_data->m_glHeight = m_data->m_xev.xconfigure.height;
-
- if (m_data->m_resizeCallback)
- {
- (*m_data->m_resizeCallback)(m_data->m_xev.xconfigure.width,m_data->m_xev.xconfigure.height);
- }
- break;
- }
- case ClientMessage:
- {
- // printf("?");
- // fflush(stdout);
- break;
- }
- case Expose:
- {
- break;
- }
- case DestroyNotify:
- {
- break;
- }
- default:
- {
- //XRRUpdateConfiguration( &event );
- }
- };
- }
-}
-
-
-
-void X11OpenGLWindow::startRendering()
-{
- pumpMessage();
-
- MyXGetWindowAttributes(m_data->m_dpy, m_data->m_win, &m_data->m_gwa);
- glViewport(0, 0, m_data->m_gwa.width, m_data->m_gwa.height);
-
- glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); //clear buffers
-
- //glCullFace(GL_BACK);
- //glFrontFace(GL_CCW);
- glEnable(GL_DEPTH_TEST);
-}
-
-void X11OpenGLWindow::renderAllObjects()
-{
-
-}
-
-void X11OpenGLWindow::endRendering()
-{
- glXSwapBuffers(m_data->m_dpy, m_data->m_win);
-}
-
-void X11OpenGLWindow::runMainLoop()
-{
-
-}
-
-float X11OpenGLWindow::getTimeInSeconds()
-{
- return 0.f;
-}
-
-bool X11OpenGLWindow::requestedExit() const
-{
- return m_requestedExit;
-}
-
-void X11OpenGLWindow::setRequestExit()
-{
- m_requestedExit=true;
-}
-
-void X11OpenGLWindow::setRenderCallback( b3RenderCallback renderCallback)
-{
-
-}
-
-void X11OpenGLWindow::setWindowTitle(const char* title)
-{
- MyXStoreName(m_data->m_dpy, m_data->m_win, title);
-}
-
-
-void X11OpenGLWindow::setWheelCallback(b3WheelCallback wheelCallback)
-{
- m_data->m_wheelCallback = wheelCallback;
-}
-
-void X11OpenGLWindow::setMouseMoveCallback(b3MouseMoveCallback mouseCallback)
-{
- m_data->m_mouseMoveCallback = mouseCallback;
-}
-
-void X11OpenGLWindow::setMouseButtonCallback(b3MouseButtonCallback mouseCallback)
-{
- m_data->m_mouseButtonCallback = mouseCallback;
-}
-
-void X11OpenGLWindow::setResizeCallback(b3ResizeCallback resizeCallback)
-{
- if (resizeCallback && m_data->m_glWidth>0 && m_data->m_glHeight > 0)
- {
- resizeCallback(m_data->m_glWidth, m_data->m_glHeight);
- }
- m_data->m_resizeCallback = resizeCallback;
-}
-
-void X11OpenGLWindow::setKeyboardCallback( b3KeyboardCallback keyboardCallback)
-{
- m_data->m_keyboardCallback = keyboardCallback;
-
-}
-
-b3MouseMoveCallback X11OpenGLWindow::getMouseMoveCallback()
-{
- return m_data->m_mouseMoveCallback;
-}
-b3MouseButtonCallback X11OpenGLWindow::getMouseButtonCallback()
-{
- return m_data->m_mouseButtonCallback;
-}
-b3ResizeCallback X11OpenGLWindow::getResizeCallback()
-{
- return m_data->m_resizeCallback;
-}
-b3WheelCallback X11OpenGLWindow::getWheelCallback()
-{
- return m_data->m_wheelCallback;
-}
-
-
-b3KeyboardCallback X11OpenGLWindow::getKeyboardCallback()
-{
- return m_data->m_keyboardCallback;
-}
-
-int X11OpenGLWindow::getWidth() const
-{
- if (m_data)
- return m_data->m_glWidth;
- return 0;
-}
-int X11OpenGLWindow::getHeight() const
-{
- if (m_data)
- return m_data->m_glHeight;
- return 0;
-}
-
-
-#include <stdio.h>
-
-int X11OpenGLWindow::fileOpenDialog(char* filename, int maxNameLength)
-{
- int len = 0;
- FILE * output = popen("zenity --file-selection --file-filter=\"*.urdf\" --file-filter=\"*.sdf\" --file-filter=\"*.obj\" --file-filter=\"*.*\"","r");
- if (output)
- {
- while( fgets(filename, maxNameLength-1, output) != NULL )
- {
- len=strlen(filename);
- if (len>0)
- {
- filename[len-1]=0;
- printf("file open (length=%d) = %s\n", len,filename);
- }
- }
- pclose(output);
- } else
- {
- printf("Error: fileOpenDialog no popen output, perhaps install zenity?\n");
- }
- MyXRaiseWindow(m_data->m_dpy, m_data->m_win);
- return len;
-
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.h
deleted file mode 100644
index 3d8eac1fcc..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/OpenGLWindow/X11OpenGLWindow.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef X11_OPENGL_WINDOW_H
-#define X11_OPENGL_WINDOW_H
-
-#define b3gDefaultOpenGLWindow X11OpenGLWindow
-
-#include "CommonWindowInterface.h"
-
-class X11OpenGLWindow : public CommonWindowInterface
-{
-
- struct InternalData2* m_data;
- bool m_OpenGLInitialized;
- bool m_requestedExit;
-
-protected:
-
- void enableOpenGL();
-
- void disableOpenGL();
-
- void pumpMessage();
-
- int getAsciiCodeFromVirtualKeycode(int orgCode);
-
-public:
-
- X11OpenGLWindow();
-
- virtual ~X11OpenGLWindow();
-
- virtual void createWindow(const b3gWindowConstructionInfo& ci);
-
- virtual void closeWindow();
-
- virtual void startRendering();
-
- virtual void renderAllObjects();
-
- virtual void endRendering();
-
- virtual float getRetinaScale() const {return 1.f;}
- virtual void setAllowRetina(bool /*allowRetina*/) {};
-
- virtual void runMainLoop();
- virtual float getTimeInSeconds();
-
- virtual bool requestedExit() const;
- virtual void setRequestExit() ;
-
- virtual bool isModifierKeyPressed(int key);
-
- virtual void setMouseMoveCallback(b3MouseMoveCallback mouseCallback);
- virtual void setMouseButtonCallback(b3MouseButtonCallback mouseCallback);
- virtual void setResizeCallback(b3ResizeCallback resizeCallback);
- virtual void setWheelCallback(b3WheelCallback wheelCallback);
- virtual void setKeyboardCallback( b3KeyboardCallback keyboardCallback);
-
- virtual b3MouseMoveCallback getMouseMoveCallback();
- virtual b3MouseButtonCallback getMouseButtonCallback();
- virtual b3ResizeCallback getResizeCallback();
- virtual b3WheelCallback getWheelCallback();
- virtual b3KeyboardCallback getKeyboardCallback();
-
- virtual void setRenderCallback( b3RenderCallback renderCallback);
-
- virtual void setWindowTitle(const char* title);
-
- virtual int getWidth() const;
-
- virtual int getHeight() const;
-
- int fileOpenDialog(char* filename, int maxNameLength);
-};
-
-
-
-#endif
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/README.md
deleted file mode 100644
index 4e5947a212..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/README.md
+++ /dev/null
@@ -1,56 +0,0 @@
-# exrview
-
-![ScreenShot](screenshots/exrview.png)
-
-Simple cross-platform OpenEXR viewer using TinyEXR, bullet3's windows library and nukler UI library.
-Currently only EXR image with RGB channels can be displayed.
-
-## Requirements
-
-* premake5
-* Visual Studio 2015(2013 will work)
-* OpenGL 2.x
-* GTK+3(optional and Linux only. Used for file dialog support on Linux)
-
-## Build on Windows
-
- $ premake5 vs2015
-
-## Build on Linux
-
- $ premake5 gmake
-
-If you want nativefiledialog support(File dialog UI), Install GTK+3 then,
-
- $ premake5 --with-gtk3nfd gmake
-
-## Build on Mac
-
- $ premake5 gmake
-
-## Usage
-
- $ ./bin/native/Release/exrview input.exr
-
-## TODO
-
-* [ ] Retina resolution
-* [ ] Display arbitrary channel EXR
-* [ ] Zoom and pan image
-* [ ] Tone mapping
-
-## Third party licenses
-
-`OpenGLWindow` and `CommonInterfaces` is grabbed from bullet3, which is licensed under zlib lince.
-
-https://github.com/bulletphysics/bullet://github.com/bulletphysics/bullet3
-
-`ThirdPartyLibs/Glew/` is licensed under licensed under the Modified BSD License, the Mesa 3-D License (MIT) and the Khronos License (MIT).
-
-http://glew.sourceforge.net/
-
-nuklear is licensed under MIT.
-
-https://github.com/vurtun/nuklear
-
-See `ThirdPartyLibs/nativefiledialog/LICENSE` for nativefiledialog license.
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glew.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glew.h
deleted file mode 100644
index f33e7d458e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glew.h
+++ /dev/null
@@ -1,19093 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author 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.
-*/
-
-#define GLEW_NO_GLU
-//#define GLEW_INIT_OPENGL11_FUNCTIONS 1
-//#define GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS 1
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.0
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are 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 Materials.
-**
-** THE MATERIALS ARE 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
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __glew_h__
-#define __glew_h__
-#define __GLEW_H__
-
-#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H)
-#error gl.h included before glew.h
-#endif
-#if defined(__gl2_h_)
-#error gl2.h included before glew.h
-#endif
-#if defined(__gltypes_h_)
-#error gltypes.h included before glew.h
-#endif
-#if defined(__REGAL_H__)
-#error Regal.h included before glew.h
-#endif
-#if defined(__glext_h_) || defined(__GLEXT_H_)
-#error glext.h included before glew.h
-#endif
-#if defined(__gl_ATI_h_)
-#error glATI.h included before glew.h
-#endif
-
-#define __gl_h_
-#define __gl2_h_
-#define __GL_H__
-#define __gltypes_h_
-#define __REGAL_H__
-#define __X_GL_H
-#define __glext_h_
-#define __GLEXT_H_
-#define __gl_ATI_h_
-
-#if defined(_WIN32)
-
-/*
- * GLEW does not include <windows.h> to avoid name space pollution.
- * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t
- * defined properly.
- */
-/* <windef.h> */
-#ifndef APIENTRY
-#define GLEW_APIENTRY_DEFINED
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define APIENTRY __stdcall
-# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
-# define APIENTRY __stdcall
-# else
-# define APIENTRY
-# endif
-#endif
-#ifndef GLAPI
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define GLAPI extern
-# endif
-#endif
-/* <winnt.h> */
-#ifndef CALLBACK
-#define GLEW_CALLBACK_DEFINED
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define CALLBACK __attribute__ ((__stdcall__))
-# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
-# define CALLBACK __stdcall
-# else
-# define CALLBACK
-# endif
-#endif
-/* <wingdi.h> and <winnt.h> */
-#ifndef WINGDIAPI
-#define GLEW_WINGDIAPI_DEFINED
-#define WINGDIAPI __declspec(dllimport)
-#endif
-/* <ctype.h> */
-#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED)
-typedef unsigned short wchar_t;
-# define _WCHAR_T_DEFINED
-#endif
-/* <stddef.h> */
-#if !defined(_W64)
-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300
-# define _W64 __w64
-# else
-# define _W64
-# endif
-#endif
-#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__)
-# ifdef _WIN64
-typedef __int64 ptrdiff_t;
-# else
-typedef _W64 int ptrdiff_t;
-# endif
-# define _PTRDIFF_T_DEFINED
-# define _PTRDIFF_T_
-#endif
-
-#ifndef GLAPI
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-# define GLAPI extern
-# else
-# define GLAPI WINGDIAPI
-# endif
-#endif
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY APIENTRY
-#endif
-
-#ifndef GLEWAPIENTRY
-#define GLEWAPIENTRY APIENTRY
-#endif
-
-/*
- * GLEW_STATIC is defined for static library.
- * GLEW_BUILD is defined for building the DLL library.
- */
-
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# ifdef GLEW_BUILD
-# define GLEWAPI extern __declspec(dllexport)
-# else
-# define GLEWAPI extern __declspec(dllimport)
-# endif
-#endif
-
-#else /* _UNIX */
-
-/*
- * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO
- * C. On my system, this amounts to _3 lines_ of included code, all of
- * them pretty much harmless. If you know of a way of detecting 32 vs
- * 64 _targets_ at compile time you are free to replace this with
- * something that's portable. For now, _this_ is the portable solution.
- * (mem, 2004-01-04)
- */
-
-#include <stddef.h>
-
-/* SGI MIPSPro doesn't like stdint.h in C++ mode */
-/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */
-
-#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
-
-#define GLEW_APIENTRY_DEFINED
-#define APIENTRY
-
-/*
- * GLEW_STATIC is defined for static library.
- */
-
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# if defined(__GNUC__) && __GNUC__>=4
-# define GLEWAPI extern __attribute__ ((visibility("default")))
-# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
-# define GLEWAPI extern __global
-# else
-# define GLEWAPI extern
-# endif
-#endif
-
-/* <glu.h> */
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifndef GLEWAPIENTRY
-#define GLEWAPIENTRY
-#endif
-
-#endif /* _WIN32 */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ----------------------------- GL_VERSION_1_1 ---------------------------- */
-
-#ifndef GL_VERSION_1_1
-#define GL_VERSION_1_1 1
-
-typedef unsigned int GLenum;
-typedef unsigned int GLbitfield;
-typedef unsigned int GLuint;
-typedef int GLint;
-typedef int GLsizei;
-typedef unsigned char GLboolean;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned long GLulong;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef double GLdouble;
-typedef double GLclampd;
-typedef void GLvoid;
-#if defined(_MSC_VER) && _MSC_VER < 1400
-typedef __int64 GLint64EXT;
-typedef unsigned __int64 GLuint64EXT;
-#elif defined(_MSC_VER) || defined(__BORLANDC__)
-typedef signed long long GLint64EXT;
-typedef unsigned long long GLuint64EXT;
-#else
-# if defined(__MINGW32__) || defined(__CYGWIN__)
-#include <inttypes.h>
-# endif
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-#endif
-typedef GLint64EXT GLint64;
-typedef GLuint64EXT GLuint64;
-typedef struct __GLsync *GLsync;
-
-typedef char GLchar;
-
-#define GL_ZERO 0
-#define GL_FALSE 0
-#define GL_LOGIC_OP 0x0BF1
-#define GL_NONE 0
-#define GL_TEXTURE_COMPONENTS 0x1003
-#define GL_NO_ERROR 0
-#define GL_POINTS 0x0000
-#define GL_CURRENT_BIT 0x00000001
-#define GL_TRUE 1
-#define GL_ONE 1
-#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001
-#define GL_LINES 0x0001
-#define GL_LINE_LOOP 0x0002
-#define GL_POINT_BIT 0x00000002
-#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002
-#define GL_LINE_STRIP 0x0003
-#define GL_LINE_BIT 0x00000004
-#define GL_TRIANGLES 0x0004
-#define GL_TRIANGLE_STRIP 0x0005
-#define GL_TRIANGLE_FAN 0x0006
-#define GL_QUADS 0x0007
-#define GL_QUAD_STRIP 0x0008
-#define GL_POLYGON_BIT 0x00000008
-#define GL_POLYGON 0x0009
-#define GL_POLYGON_STIPPLE_BIT 0x00000010
-#define GL_PIXEL_MODE_BIT 0x00000020
-#define GL_LIGHTING_BIT 0x00000040
-#define GL_FOG_BIT 0x00000080
-#define GL_DEPTH_BUFFER_BIT 0x00000100
-#define GL_ACCUM 0x0100
-#define GL_LOAD 0x0101
-#define GL_RETURN 0x0102
-#define GL_MULT 0x0103
-#define GL_ADD 0x0104
-#define GL_NEVER 0x0200
-#define GL_ACCUM_BUFFER_BIT 0x00000200
-#define GL_LESS 0x0201
-#define GL_EQUAL 0x0202
-#define GL_LEQUAL 0x0203
-#define GL_GREATER 0x0204
-#define GL_NOTEQUAL 0x0205
-#define GL_GEQUAL 0x0206
-#define GL_ALWAYS 0x0207
-#define GL_SRC_COLOR 0x0300
-#define GL_ONE_MINUS_SRC_COLOR 0x0301
-#define GL_SRC_ALPHA 0x0302
-#define GL_ONE_MINUS_SRC_ALPHA 0x0303
-#define GL_DST_ALPHA 0x0304
-#define GL_ONE_MINUS_DST_ALPHA 0x0305
-#define GL_DST_COLOR 0x0306
-#define GL_ONE_MINUS_DST_COLOR 0x0307
-#define GL_SRC_ALPHA_SATURATE 0x0308
-#define GL_STENCIL_BUFFER_BIT 0x00000400
-#define GL_FRONT_LEFT 0x0400
-#define GL_FRONT_RIGHT 0x0401
-#define GL_BACK_LEFT 0x0402
-#define GL_BACK_RIGHT 0x0403
-#define GL_FRONT 0x0404
-#define GL_BACK 0x0405
-#define GL_LEFT 0x0406
-#define GL_RIGHT 0x0407
-#define GL_FRONT_AND_BACK 0x0408
-#define GL_AUX0 0x0409
-#define GL_AUX1 0x040A
-#define GL_AUX2 0x040B
-#define GL_AUX3 0x040C
-#define GL_INVALID_ENUM 0x0500
-#define GL_INVALID_VALUE 0x0501
-#define GL_INVALID_OPERATION 0x0502
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_OUT_OF_MEMORY 0x0505
-#define GL_2D 0x0600
-#define GL_3D 0x0601
-#define GL_3D_COLOR 0x0602
-#define GL_3D_COLOR_TEXTURE 0x0603
-#define GL_4D_COLOR_TEXTURE 0x0604
-#define GL_PASS_THROUGH_TOKEN 0x0700
-#define GL_POINT_TOKEN 0x0701
-#define GL_LINE_TOKEN 0x0702
-#define GL_POLYGON_TOKEN 0x0703
-#define GL_BITMAP_TOKEN 0x0704
-#define GL_DRAW_PIXEL_TOKEN 0x0705
-#define GL_COPY_PIXEL_TOKEN 0x0706
-#define GL_LINE_RESET_TOKEN 0x0707
-#define GL_EXP 0x0800
-#define GL_VIEWPORT_BIT 0x00000800
-#define GL_EXP2 0x0801
-#define GL_CW 0x0900
-#define GL_CCW 0x0901
-#define GL_COEFF 0x0A00
-#define GL_ORDER 0x0A01
-#define GL_DOMAIN 0x0A02
-#define GL_CURRENT_COLOR 0x0B00
-#define GL_CURRENT_INDEX 0x0B01
-#define GL_CURRENT_NORMAL 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS 0x0B03
-#define GL_CURRENT_RASTER_COLOR 0x0B04
-#define GL_CURRENT_RASTER_INDEX 0x0B05
-#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06
-#define GL_CURRENT_RASTER_POSITION 0x0B07
-#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08
-#define GL_CURRENT_RASTER_DISTANCE 0x0B09
-#define GL_POINT_SMOOTH 0x0B10
-#define GL_POINT_SIZE 0x0B11
-#define GL_POINT_SIZE_RANGE 0x0B12
-#define GL_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_LINE_SMOOTH 0x0B20
-#define GL_LINE_WIDTH 0x0B21
-#define GL_LINE_WIDTH_RANGE 0x0B22
-#define GL_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_LINE_STIPPLE 0x0B24
-#define GL_LINE_STIPPLE_PATTERN 0x0B25
-#define GL_LINE_STIPPLE_REPEAT 0x0B26
-#define GL_LIST_MODE 0x0B30
-#define GL_MAX_LIST_NESTING 0x0B31
-#define GL_LIST_BASE 0x0B32
-#define GL_LIST_INDEX 0x0B33
-#define GL_POLYGON_MODE 0x0B40
-#define GL_POLYGON_SMOOTH 0x0B41
-#define GL_POLYGON_STIPPLE 0x0B42
-#define GL_EDGE_FLAG 0x0B43
-#define GL_CULL_FACE 0x0B44
-#define GL_CULL_FACE_MODE 0x0B45
-#define GL_FRONT_FACE 0x0B46
-#define GL_LIGHTING 0x0B50
-#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51
-#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
-#define GL_LIGHT_MODEL_AMBIENT 0x0B53
-#define GL_SHADE_MODEL 0x0B54
-#define GL_COLOR_MATERIAL_FACE 0x0B55
-#define GL_COLOR_MATERIAL_PARAMETER 0x0B56
-#define GL_COLOR_MATERIAL 0x0B57
-#define GL_FOG 0x0B60
-#define GL_FOG_INDEX 0x0B61
-#define GL_FOG_DENSITY 0x0B62
-#define GL_FOG_START 0x0B63
-#define GL_FOG_END 0x0B64
-#define GL_FOG_MODE 0x0B65
-#define GL_FOG_COLOR 0x0B66
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_DEPTH_TEST 0x0B71
-#define GL_DEPTH_WRITEMASK 0x0B72
-#define GL_DEPTH_CLEAR_VALUE 0x0B73
-#define GL_DEPTH_FUNC 0x0B74
-#define GL_ACCUM_CLEAR_VALUE 0x0B80
-#define GL_STENCIL_TEST 0x0B90
-#define GL_STENCIL_CLEAR_VALUE 0x0B91
-#define GL_STENCIL_FUNC 0x0B92
-#define GL_STENCIL_VALUE_MASK 0x0B93
-#define GL_STENCIL_FAIL 0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
-#define GL_STENCIL_REF 0x0B97
-#define GL_STENCIL_WRITEMASK 0x0B98
-#define GL_MATRIX_MODE 0x0BA0
-#define GL_NORMALIZE 0x0BA1
-#define GL_VIEWPORT 0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
-#define GL_PROJECTION_STACK_DEPTH 0x0BA4
-#define GL_TEXTURE_STACK_DEPTH 0x0BA5
-#define GL_MODELVIEW_MATRIX 0x0BA6
-#define GL_PROJECTION_MATRIX 0x0BA7
-#define GL_TEXTURE_MATRIX 0x0BA8
-#define GL_ATTRIB_STACK_DEPTH 0x0BB0
-#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1
-#define GL_ALPHA_TEST 0x0BC0
-#define GL_ALPHA_TEST_FUNC 0x0BC1
-#define GL_ALPHA_TEST_REF 0x0BC2
-#define GL_DITHER 0x0BD0
-#define GL_BLEND_DST 0x0BE0
-#define GL_BLEND_SRC 0x0BE1
-#define GL_BLEND 0x0BE2
-#define GL_LOGIC_OP_MODE 0x0BF0
-#define GL_INDEX_LOGIC_OP 0x0BF1
-#define GL_COLOR_LOGIC_OP 0x0BF2
-#define GL_AUX_BUFFERS 0x0C00
-#define GL_DRAW_BUFFER 0x0C01
-#define GL_READ_BUFFER 0x0C02
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_INDEX_CLEAR_VALUE 0x0C20
-#define GL_INDEX_WRITEMASK 0x0C21
-#define GL_COLOR_CLEAR_VALUE 0x0C22
-#define GL_COLOR_WRITEMASK 0x0C23
-#define GL_INDEX_MODE 0x0C30
-#define GL_RGBA_MODE 0x0C31
-#define GL_DOUBLEBUFFER 0x0C32
-#define GL_STEREO 0x0C33
-#define GL_RENDER_MODE 0x0C40
-#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
-#define GL_POINT_SMOOTH_HINT 0x0C51
-#define GL_LINE_SMOOTH_HINT 0x0C52
-#define GL_POLYGON_SMOOTH_HINT 0x0C53
-#define GL_FOG_HINT 0x0C54
-#define GL_TEXTURE_GEN_S 0x0C60
-#define GL_TEXTURE_GEN_T 0x0C61
-#define GL_TEXTURE_GEN_R 0x0C62
-#define GL_TEXTURE_GEN_Q 0x0C63
-#define GL_PIXEL_MAP_I_TO_I 0x0C70
-#define GL_PIXEL_MAP_S_TO_S 0x0C71
-#define GL_PIXEL_MAP_I_TO_R 0x0C72
-#define GL_PIXEL_MAP_I_TO_G 0x0C73
-#define GL_PIXEL_MAP_I_TO_B 0x0C74
-#define GL_PIXEL_MAP_I_TO_A 0x0C75
-#define GL_PIXEL_MAP_R_TO_R 0x0C76
-#define GL_PIXEL_MAP_G_TO_G 0x0C77
-#define GL_PIXEL_MAP_B_TO_B 0x0C78
-#define GL_PIXEL_MAP_A_TO_A 0x0C79
-#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0
-#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1
-#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2
-#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3
-#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4
-#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5
-#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6
-#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7
-#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8
-#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9
-#define GL_UNPACK_SWAP_BYTES 0x0CF0
-#define GL_UNPACK_LSB_FIRST 0x0CF1
-#define GL_UNPACK_ROW_LENGTH 0x0CF2
-#define GL_UNPACK_SKIP_ROWS 0x0CF3
-#define GL_UNPACK_SKIP_PIXELS 0x0CF4
-#define GL_UNPACK_ALIGNMENT 0x0CF5
-#define GL_PACK_SWAP_BYTES 0x0D00
-#define GL_PACK_LSB_FIRST 0x0D01
-#define GL_PACK_ROW_LENGTH 0x0D02
-#define GL_PACK_SKIP_ROWS 0x0D03
-#define GL_PACK_SKIP_PIXELS 0x0D04
-#define GL_PACK_ALIGNMENT 0x0D05
-#define GL_MAP_COLOR 0x0D10
-#define GL_MAP_STENCIL 0x0D11
-#define GL_INDEX_SHIFT 0x0D12
-#define GL_INDEX_OFFSET 0x0D13
-#define GL_RED_SCALE 0x0D14
-#define GL_RED_BIAS 0x0D15
-#define GL_ZOOM_X 0x0D16
-#define GL_ZOOM_Y 0x0D17
-#define GL_GREEN_SCALE 0x0D18
-#define GL_GREEN_BIAS 0x0D19
-#define GL_BLUE_SCALE 0x0D1A
-#define GL_BLUE_BIAS 0x0D1B
-#define GL_ALPHA_SCALE 0x0D1C
-#define GL_ALPHA_BIAS 0x0D1D
-#define GL_DEPTH_SCALE 0x0D1E
-#define GL_DEPTH_BIAS 0x0D1F
-#define GL_MAX_EVAL_ORDER 0x0D30
-#define GL_MAX_LIGHTS 0x0D31
-#define GL_MAX_CLIP_PLANES 0x0D32
-#define GL_MAX_TEXTURE_SIZE 0x0D33
-#define GL_MAX_PIXEL_MAP_TABLE 0x0D34
-#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35
-#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
-#define GL_MAX_NAME_STACK_DEPTH 0x0D37
-#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
-#define GL_MAX_VIEWPORT_DIMS 0x0D3A
-#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B
-#define GL_SUBPIXEL_BITS 0x0D50
-#define GL_INDEX_BITS 0x0D51
-#define GL_RED_BITS 0x0D52
-#define GL_GREEN_BITS 0x0D53
-#define GL_BLUE_BITS 0x0D54
-#define GL_ALPHA_BITS 0x0D55
-#define GL_DEPTH_BITS 0x0D56
-#define GL_STENCIL_BITS 0x0D57
-#define GL_ACCUM_RED_BITS 0x0D58
-#define GL_ACCUM_GREEN_BITS 0x0D59
-#define GL_ACCUM_BLUE_BITS 0x0D5A
-#define GL_ACCUM_ALPHA_BITS 0x0D5B
-#define GL_NAME_STACK_DEPTH 0x0D70
-#define GL_AUTO_NORMAL 0x0D80
-#define GL_MAP1_COLOR_4 0x0D90
-#define GL_MAP1_INDEX 0x0D91
-#define GL_MAP1_NORMAL 0x0D92
-#define GL_MAP1_TEXTURE_COORD_1 0x0D93
-#define GL_MAP1_TEXTURE_COORD_2 0x0D94
-#define GL_MAP1_TEXTURE_COORD_3 0x0D95
-#define GL_MAP1_TEXTURE_COORD_4 0x0D96
-#define GL_MAP1_VERTEX_3 0x0D97
-#define GL_MAP1_VERTEX_4 0x0D98
-#define GL_MAP2_COLOR_4 0x0DB0
-#define GL_MAP2_INDEX 0x0DB1
-#define GL_MAP2_NORMAL 0x0DB2
-#define GL_MAP2_TEXTURE_COORD_1 0x0DB3
-#define GL_MAP2_TEXTURE_COORD_2 0x0DB4
-#define GL_MAP2_TEXTURE_COORD_3 0x0DB5
-#define GL_MAP2_TEXTURE_COORD_4 0x0DB6
-#define GL_MAP2_VERTEX_3 0x0DB7
-#define GL_MAP2_VERTEX_4 0x0DB8
-#define GL_MAP1_GRID_DOMAIN 0x0DD0
-#define GL_MAP1_GRID_SEGMENTS 0x0DD1
-#define GL_MAP2_GRID_DOMAIN 0x0DD2
-#define GL_MAP2_GRID_SEGMENTS 0x0DD3
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0
-#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1
-#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2
-#define GL_SELECTION_BUFFER_POINTER 0x0DF3
-#define GL_SELECTION_BUFFER_SIZE 0x0DF4
-#define GL_TEXTURE_WIDTH 0x1000
-#define GL_TRANSFORM_BIT 0x00001000
-#define GL_TEXTURE_HEIGHT 0x1001
-#define GL_TEXTURE_INTERNAL_FORMAT 0x1003
-#define GL_TEXTURE_BORDER_COLOR 0x1004
-#define GL_TEXTURE_BORDER 0x1005
-#define GL_DONT_CARE 0x1100
-#define GL_FASTEST 0x1101
-#define GL_NICEST 0x1102
-#define GL_AMBIENT 0x1200
-#define GL_DIFFUSE 0x1201
-#define GL_SPECULAR 0x1202
-#define GL_POSITION 0x1203
-#define GL_SPOT_DIRECTION 0x1204
-#define GL_SPOT_EXPONENT 0x1205
-#define GL_SPOT_CUTOFF 0x1206
-#define GL_CONSTANT_ATTENUATION 0x1207
-#define GL_LINEAR_ATTENUATION 0x1208
-#define GL_QUADRATIC_ATTENUATION 0x1209
-#define GL_COMPILE 0x1300
-#define GL_COMPILE_AND_EXECUTE 0x1301
-#define GL_BYTE 0x1400
-#define GL_UNSIGNED_BYTE 0x1401
-#define GL_SHORT 0x1402
-#define GL_UNSIGNED_SHORT 0x1403
-#define GL_INT 0x1404
-#define GL_UNSIGNED_INT 0x1405
-#define GL_FLOAT 0x1406
-#define GL_2_BYTES 0x1407
-#define GL_3_BYTES 0x1408
-#define GL_4_BYTES 0x1409
-#define GL_DOUBLE 0x140A
-#define GL_CLEAR 0x1500
-#define GL_AND 0x1501
-#define GL_AND_REVERSE 0x1502
-#define GL_COPY 0x1503
-#define GL_AND_INVERTED 0x1504
-#define GL_NOOP 0x1505
-#define GL_XOR 0x1506
-#define GL_OR 0x1507
-#define GL_NOR 0x1508
-#define GL_EQUIV 0x1509
-#define GL_INVERT 0x150A
-#define GL_OR_REVERSE 0x150B
-#define GL_COPY_INVERTED 0x150C
-#define GL_OR_INVERTED 0x150D
-#define GL_NAND 0x150E
-#define GL_SET 0x150F
-#define GL_EMISSION 0x1600
-#define GL_SHININESS 0x1601
-#define GL_AMBIENT_AND_DIFFUSE 0x1602
-#define GL_COLOR_INDEXES 0x1603
-#define GL_MODELVIEW 0x1700
-#define GL_PROJECTION 0x1701
-#define GL_TEXTURE 0x1702
-#define GL_COLOR 0x1800
-#define GL_DEPTH 0x1801
-#define GL_STENCIL 0x1802
-#define GL_COLOR_INDEX 0x1900
-#define GL_STENCIL_INDEX 0x1901
-#define GL_DEPTH_COMPONENT 0x1902
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_RGB 0x1907
-#define GL_RGBA 0x1908
-#define GL_LUMINANCE 0x1909
-#define GL_LUMINANCE_ALPHA 0x190A
-#define GL_BITMAP 0x1A00
-#define GL_POINT 0x1B00
-#define GL_LINE 0x1B01
-#define GL_FILL 0x1B02
-#define GL_RENDER 0x1C00
-#define GL_FEEDBACK 0x1C01
-#define GL_SELECT 0x1C02
-#define GL_FLAT 0x1D00
-#define GL_SMOOTH 0x1D01
-#define GL_KEEP 0x1E00
-#define GL_REPLACE 0x1E01
-#define GL_INCR 0x1E02
-#define GL_DECR 0x1E03
-#define GL_VENDOR 0x1F00
-#define GL_RENDERER 0x1F01
-#define GL_VERSION 0x1F02
-#define GL_EXTENSIONS 0x1F03
-#define GL_S 0x2000
-#define GL_ENABLE_BIT 0x00002000
-#define GL_T 0x2001
-#define GL_R 0x2002
-#define GL_Q 0x2003
-#define GL_MODULATE 0x2100
-#define GL_DECAL 0x2101
-#define GL_TEXTURE_ENV_MODE 0x2200
-#define GL_TEXTURE_ENV_COLOR 0x2201
-#define GL_TEXTURE_ENV 0x2300
-#define GL_EYE_LINEAR 0x2400
-#define GL_OBJECT_LINEAR 0x2401
-#define GL_SPHERE_MAP 0x2402
-#define GL_TEXTURE_GEN_MODE 0x2500
-#define GL_OBJECT_PLANE 0x2501
-#define GL_EYE_PLANE 0x2502
-#define GL_NEAREST 0x2600
-#define GL_LINEAR 0x2601
-#define GL_NEAREST_MIPMAP_NEAREST 0x2700
-#define GL_LINEAR_MIPMAP_NEAREST 0x2701
-#define GL_NEAREST_MIPMAP_LINEAR 0x2702
-#define GL_LINEAR_MIPMAP_LINEAR 0x2703
-#define GL_TEXTURE_MAG_FILTER 0x2800
-#define GL_TEXTURE_MIN_FILTER 0x2801
-#define GL_TEXTURE_WRAP_S 0x2802
-#define GL_TEXTURE_WRAP_T 0x2803
-#define GL_CLAMP 0x2900
-#define GL_REPEAT 0x2901
-#define GL_POLYGON_OFFSET_UNITS 0x2A00
-#define GL_POLYGON_OFFSET_POINT 0x2A01
-#define GL_POLYGON_OFFSET_LINE 0x2A02
-#define GL_R3_G3_B2 0x2A10
-#define GL_V2F 0x2A20
-#define GL_V3F 0x2A21
-#define GL_C4UB_V2F 0x2A22
-#define GL_C4UB_V3F 0x2A23
-#define GL_C3F_V3F 0x2A24
-#define GL_N3F_V3F 0x2A25
-#define GL_C4F_N3F_V3F 0x2A26
-#define GL_T2F_V3F 0x2A27
-#define GL_T4F_V4F 0x2A28
-#define GL_T2F_C4UB_V3F 0x2A29
-#define GL_T2F_C3F_V3F 0x2A2A
-#define GL_T2F_N3F_V3F 0x2A2B
-#define GL_T2F_C4F_N3F_V3F 0x2A2C
-#define GL_T4F_C4F_N3F_V4F 0x2A2D
-#define GL_CLIP_PLANE0 0x3000
-#define GL_CLIP_PLANE1 0x3001
-#define GL_CLIP_PLANE2 0x3002
-#define GL_CLIP_PLANE3 0x3003
-#define GL_CLIP_PLANE4 0x3004
-#define GL_CLIP_PLANE5 0x3005
-#define GL_LIGHT0 0x4000
-#define GL_COLOR_BUFFER_BIT 0x00004000
-#define GL_LIGHT1 0x4001
-#define GL_LIGHT2 0x4002
-#define GL_LIGHT3 0x4003
-#define GL_LIGHT4 0x4004
-#define GL_LIGHT5 0x4005
-#define GL_LIGHT6 0x4006
-#define GL_LIGHT7 0x4007
-#define GL_HINT_BIT 0x00008000
-#define GL_POLYGON_OFFSET_FILL 0x8037
-#define GL_POLYGON_OFFSET_FACTOR 0x8038
-#define GL_ALPHA4 0x803B
-#define GL_ALPHA8 0x803C
-#define GL_ALPHA12 0x803D
-#define GL_ALPHA16 0x803E
-#define GL_LUMINANCE4 0x803F
-#define GL_LUMINANCE8 0x8040
-#define GL_LUMINANCE12 0x8041
-#define GL_LUMINANCE16 0x8042
-#define GL_LUMINANCE4_ALPHA4 0x8043
-#define GL_LUMINANCE6_ALPHA2 0x8044
-#define GL_LUMINANCE8_ALPHA8 0x8045
-#define GL_LUMINANCE12_ALPHA4 0x8046
-#define GL_LUMINANCE12_ALPHA12 0x8047
-#define GL_LUMINANCE16_ALPHA16 0x8048
-#define GL_INTENSITY 0x8049
-#define GL_INTENSITY4 0x804A
-#define GL_INTENSITY8 0x804B
-#define GL_INTENSITY12 0x804C
-#define GL_INTENSITY16 0x804D
-#define GL_RGB4 0x804F
-#define GL_RGB5 0x8050
-#define GL_RGB8 0x8051
-#define GL_RGB10 0x8052
-#define GL_RGB12 0x8053
-#define GL_RGB16 0x8054
-#define GL_RGBA2 0x8055
-#define GL_RGBA4 0x8056
-#define GL_RGB5_A1 0x8057
-#define GL_RGBA8 0x8058
-#define GL_RGB10_A2 0x8059
-#define GL_RGBA12 0x805A
-#define GL_RGBA16 0x805B
-#define GL_TEXTURE_RED_SIZE 0x805C
-#define GL_TEXTURE_GREEN_SIZE 0x805D
-#define GL_TEXTURE_BLUE_SIZE 0x805E
-#define GL_TEXTURE_ALPHA_SIZE 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE 0x8061
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_TEXTURE_PRIORITY 0x8066
-#define GL_TEXTURE_RESIDENT 0x8067
-#define GL_TEXTURE_BINDING_1D 0x8068
-#define GL_TEXTURE_BINDING_2D 0x8069
-#define GL_VERTEX_ARRAY 0x8074
-#define GL_NORMAL_ARRAY 0x8075
-#define GL_COLOR_ARRAY 0x8076
-#define GL_INDEX_ARRAY 0x8077
-#define GL_TEXTURE_COORD_ARRAY 0x8078
-#define GL_EDGE_FLAG_ARRAY 0x8079
-#define GL_VERTEX_ARRAY_SIZE 0x807A
-#define GL_VERTEX_ARRAY_TYPE 0x807B
-#define GL_VERTEX_ARRAY_STRIDE 0x807C
-#define GL_NORMAL_ARRAY_TYPE 0x807E
-#define GL_NORMAL_ARRAY_STRIDE 0x807F
-#define GL_COLOR_ARRAY_SIZE 0x8081
-#define GL_COLOR_ARRAY_TYPE 0x8082
-#define GL_COLOR_ARRAY_STRIDE 0x8083
-#define GL_INDEX_ARRAY_TYPE 0x8085
-#define GL_INDEX_ARRAY_STRIDE 0x8086
-#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
-#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C
-#define GL_VERTEX_ARRAY_POINTER 0x808E
-#define GL_NORMAL_ARRAY_POINTER 0x808F
-#define GL_COLOR_ARRAY_POINTER 0x8090
-#define GL_INDEX_ARRAY_POINTER 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_EVAL_BIT 0x00010000
-#define GL_LIST_BIT 0x00020000
-#define GL_TEXTURE_BIT 0x00040000
-#define GL_SCISSOR_BIT 0x00080000
-#define GL_ALL_ATTRIB_BITS 0x000fffff
-#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff
-
-#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-
-typedef void (GLAPIENTRY * PFNGLACCUMPROC) (GLenum op, GLfloat value);
-typedef void (GLAPIENTRY * PFNGLALPHAFUNCPROC) (GLenum func, GLclampf ref);
-typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences);
-typedef void (GLAPIENTRY * PFNGLARRAYELEMENTPROC) (GLint i);
-typedef void (GLAPIENTRY * PFNGLBEGINPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
-typedef void (GLAPIENTRY * PFNGLBITMAPPROC) (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
-typedef void (GLAPIENTRY * PFNGLCALLLISTPROC) (GLuint list);
-typedef void (GLAPIENTRY * PFNGLCALLLISTSPROC) (GLsizei n, GLenum type, const GLvoid *lists);
-typedef void (GLAPIENTRY * PFNGLCLEARPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLCLEARACCUMPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHPROC) (GLclampd depth);
-typedef void (GLAPIENTRY * PFNGLCLEARINDEXPROC) (GLfloat c);
-typedef void (GLAPIENTRY * PFNGLCLEARSTENCILPROC) (GLint s);
-typedef void (GLAPIENTRY * PFNGLCLIPPLANEPROC) (GLenum plane, const GLdouble *equation);
-typedef void (GLAPIENTRY * PFNGLCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3BVPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3UIVPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3USVPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4BPROC) (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4BVPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4DPROC) (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4IPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4SPROC) (GLshort red, GLshort green, GLshort blue, GLshort alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBPROC) (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UIPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UIVPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4USPROC) (GLushort red, GLushort green, GLushort blue, GLushort alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4USVPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-typedef void (GLAPIENTRY * PFNGLCOLORMATERIALPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLCOPYPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCULLFACEPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLDELETELISTSPROC) (GLuint list, GLsizei range);
-typedef void (GLAPIENTRY * PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
-typedef void (GLAPIENTRY * PFNGLDEPTHFUNCPROC) (GLenum func);
-typedef void (GLAPIENTRY * PFNGLDEPTHMASKPROC) (GLboolean flag);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEPROC) (GLclampd zNear, GLclampd zFar);
-typedef void (GLAPIENTRY * PFNGLDISABLEPROC) (GLenum cap);
-typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEPROC) (GLenum array);
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (GLAPIENTRY * PFNGLDRAWPIXELSPROC) (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPROC) (GLboolean flag);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERPROC) (GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGVPROC) (const GLboolean *flag);
-typedef void (GLAPIENTRY * PFNGLENABLEPROC) (GLenum cap);
-typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEPROC) (GLenum array);
-typedef void (GLAPIENTRY * PFNGLENDPROC) (void);
-typedef void (GLAPIENTRY * PFNGLENDLISTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD1DPROC) (GLdouble u);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD1DVPROC) (const GLdouble *u);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD1FPROC) (GLfloat u);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD1FVPROC) (const GLfloat *u);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD2DPROC) (GLdouble u, GLdouble v);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD2DVPROC) (const GLdouble *u);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD2FPROC) (GLfloat u, GLfloat v);
-typedef void (GLAPIENTRY * PFNGLEVALCOORD2FVPROC) (const GLfloat *u);
-typedef void (GLAPIENTRY * PFNGLEVALMESH1PROC) (GLenum mode, GLint i1, GLint i2);
-typedef void (GLAPIENTRY * PFNGLEVALMESH2PROC) (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-typedef void (GLAPIENTRY * PFNGLEVALPOINT1PROC) (GLint i);
-typedef void (GLAPIENTRY * PFNGLEVALPOINT2PROC) (GLint i, GLint j);
-typedef void (GLAPIENTRY * PFNGLFEEDBACKBUFFERPROC) (GLsizei size, GLenum type, GLfloat *buffer);
-typedef void (GLAPIENTRY * PFNGLFINISHPROC) (void);
-typedef void (GLAPIENTRY * PFNGLFLUSHPROC) (void);
-typedef void (GLAPIENTRY * PFNGLFOGFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFOGFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLFOGIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFOGIVPROC) (GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLFRONTFACEPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRUSTUMPROC) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef GLuint (GLAPIENTRY * PFNGLGENLISTSPROC) (GLsizei range);
-typedef void (GLAPIENTRY * PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
-typedef void (GLAPIENTRY * PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *params);
-typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEPROC) (GLenum plane, GLdouble *equation);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEVPROC) (GLenum pname, GLdouble *params);
-typedef GLenum (GLAPIENTRY * PFNGLGETERRORPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERVPROC) (GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETLIGHTFVPROC) (GLenum light, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETLIGHTIVPROC) (GLenum light, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETMAPDVPROC) (GLenum target, GLenum query, GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLGETMAPFVPROC) (GLenum target, GLenum query, GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLGETMAPIVPROC) (GLenum target, GLenum query, GLint *v);
-typedef void (GLAPIENTRY * PFNGLGETMATERIALFVPROC) (GLenum face, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETMATERIALIVPROC) (GLenum face, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETPIXELMAPFVPROC) (GLenum map, GLfloat *values);
-typedef void (GLAPIENTRY * PFNGLGETPIXELMAPUIVPROC) (GLenum map, GLuint *values);
-typedef void (GLAPIENTRY * PFNGLGETPIXELMAPUSVPROC) (GLenum map, GLushort *values);
-typedef void (GLAPIENTRY * PFNGLGETPOINTERVPROC) (GLenum pname, GLvoid* *params);
-typedef void (GLAPIENTRY * PFNGLGETPOLYGONSTIPPLEPROC) (GLubyte *mask);
-typedef GLubyte* (GLAPIENTRY * PFNGLGETSTRINGPROC) (GLenum s);
-typedef void (GLAPIENTRY * PFNGLGETTEXENVFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXENVIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXGENDVPROC) (GLenum coord, GLenum pname, GLdouble *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXGENFVPROC) (GLenum coord, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXGENIVPROC) (GLenum coord, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXIMAGEPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLGETTEXLEVELPARAMETERFVPROC) (GLenum target, GLint level, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXLEVELPARAMETERIVPROC) (GLenum target, GLint level, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLHINTPROC) (GLenum target, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLINDEXMASKPROC) (GLuint mask);
-typedef void (GLAPIENTRY * PFNGLINDEXPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLINDEXDPROC) (GLdouble c);
-typedef void (GLAPIENTRY * PFNGLINDEXDVPROC) (const GLdouble *c);
-typedef void (GLAPIENTRY * PFNGLINDEXFPROC) (GLfloat c);
-typedef void (GLAPIENTRY * PFNGLINDEXFVPROC) (const GLfloat *c);
-typedef void (GLAPIENTRY * PFNGLINDEXIPROC) (GLint c);
-typedef void (GLAPIENTRY * PFNGLINDEXIVPROC) (const GLint *c);
-typedef void (GLAPIENTRY * PFNGLINDEXSPROC) (GLshort c);
-typedef void (GLAPIENTRY * PFNGLINDEXSVPROC) (const GLshort *c);
-typedef void (GLAPIENTRY * PFNGLINDEXUBPROC) (GLubyte c);
-typedef void (GLAPIENTRY * PFNGLINDEXUBVPROC) (const GLubyte *c);
-typedef void (GLAPIENTRY * PFNGLINITNAMESPROC) (void);
-typedef void (GLAPIENTRY * PFNGLINTERLEAVEDARRAYSPROC) (GLenum format, GLsizei stride, const GLvoid *pointer);
-typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDPROC) (GLenum cap);
-typedef GLboolean (GLAPIENTRY * PFNGLISLISTPROC) (GLuint list);
-typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREPROC) (GLuint texture);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELIVPROC) (GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLLIGHTFPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLLIGHTFVPROC) (GLenum light, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLLIGHTIPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLLIGHTIVPROC) (GLenum light, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLLINESTIPPLEPROC) (GLint factor, GLushort pattern);
-typedef void (GLAPIENTRY * PFNGLLINEWIDTHPROC) (GLfloat width);
-typedef void (GLAPIENTRY * PFNGLLISTBASEPROC) (GLuint base);
-typedef void (GLAPIENTRY * PFNGLLOADIDENTITYPROC) (void);
-typedef void (GLAPIENTRY * PFNGLLOADMATRIXDPROC) (const GLdouble *m);
-typedef void (GLAPIENTRY * PFNGLLOADMATRIXFPROC) (const GLfloat *m);
-typedef void (GLAPIENTRY * PFNGLLOADNAMEPROC) (GLuint name);
-typedef void (GLAPIENTRY * PFNGLLOGICOPPROC) (GLenum opcode);
-typedef void (GLAPIENTRY * PFNGLMAP1DPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-typedef void (GLAPIENTRY * PFNGLMAP1FPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-typedef void (GLAPIENTRY * PFNGLMAP2DPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-typedef void (GLAPIENTRY * PFNGLMAP2FPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-typedef void (GLAPIENTRY * PFNGLMAPGRID1DPROC) (GLint un, GLdouble u1, GLdouble u2);
-typedef void (GLAPIENTRY * PFNGLMAPGRID1FPROC) (GLint un, GLfloat u1, GLfloat u2);
-typedef void (GLAPIENTRY * PFNGLMAPGRID2DPROC) (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-typedef void (GLAPIENTRY * PFNGLMAPGRID2FPROC) (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLMATERIALFPROC) (GLenum face, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMATERIALFVPROC) (GLenum face, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLMATERIALIPROC) (GLenum face, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMATERIALIVPROC) (GLenum face, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLMATRIXMODEPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLMULTMATRIXDPROC) (const GLdouble *m);
-typedef void (GLAPIENTRY * PFNGLMULTMATRIXFPROC) (const GLfloat *m);
-typedef void (GLAPIENTRY * PFNGLNEWLISTPROC) (GLuint list, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLNORMAL3BPROC) (GLbyte nx, GLbyte ny, GLbyte nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3BVPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3DPROC) (GLdouble nx, GLdouble ny, GLdouble nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FPROC) (GLfloat nx, GLfloat ny, GLfloat nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3IPROC) (GLint nx, GLint ny, GLint nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3SPROC) (GLshort nx, GLshort ny, GLshort nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLORTHOPROC) (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-typedef void (GLAPIENTRY * PFNGLPASSTHROUGHPROC) (GLfloat token);
-typedef void (GLAPIENTRY * PFNGLPIXELMAPFVPROC) (GLenum map, GLsizei mapsize, const GLfloat *values);
-typedef void (GLAPIENTRY * PFNGLPIXELMAPUIVPROC) (GLenum map, GLsizei mapsize, const GLuint *values);
-typedef void (GLAPIENTRY * PFNGLPIXELMAPUSVPROC) (GLenum map, GLsizei mapsize, const GLushort *values);
-typedef void (GLAPIENTRY * PFNGLPIXELSTOREFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFERFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFERIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPIXELZOOMPROC) (GLfloat xfactor, GLfloat yfactor);
-typedef void (GLAPIENTRY * PFNGLPOINTSIZEPROC) (GLfloat size);
-typedef void (GLAPIENTRY * PFNGLPOLYGONMODEPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
-typedef void (GLAPIENTRY * PFNGLPOLYGONSTIPPLEPROC) (const GLubyte *mask);
-typedef void (GLAPIENTRY * PFNGLPOPATTRIBPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPOPCLIENTATTRIBPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPOPMATRIXPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPOPNAMEPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-typedef void (GLAPIENTRY * PFNGLPUSHATTRIBPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLPUSHMATRIXPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPUSHNAMEPROC) (GLuint name);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2IPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2SPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS2SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4DPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4FPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4IPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4SPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLRASTERPOS4SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLREADBUFFERPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLRECTDPROC) (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-typedef void (GLAPIENTRY * PFNGLRECTDVPROC) (const GLdouble *v1, const GLdouble *v2);
-typedef void (GLAPIENTRY * PFNGLRECTFPROC) (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-typedef void (GLAPIENTRY * PFNGLRECTFVPROC) (const GLfloat *v1, const GLfloat *v2);
-typedef void (GLAPIENTRY * PFNGLRECTIPROC) (GLint x1, GLint y1, GLint x2, GLint y2);
-typedef void (GLAPIENTRY * PFNGLRECTIVPROC) (const GLint *v1, const GLint *v2);
-typedef void (GLAPIENTRY * PFNGLRECTSPROC) (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-typedef void (GLAPIENTRY * PFNGLRECTSVPROC) (const GLshort *v1, const GLshort *v2);
-typedef GLint (GLAPIENTRY * PFNGLRENDERMODEPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLROTATEDPROC) (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLROTATEFPROC) (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLSCALEDPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLSCALEFPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLSELECTBUFFERPROC) (GLsizei size, GLuint *buffer);
-typedef void (GLAPIENTRY * PFNGLSHADEMODELPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILMASKPROC) (GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1DPROC) (GLdouble s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1FPROC) (GLfloat s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1IPROC) (GLint s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1SPROC) (GLshort s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2DPROC) (GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FPROC) (GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2IPROC) (GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2SPROC) (GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3DPROC) (GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3FPROC) (GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3IPROC) (GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3SPROC) (GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4DPROC) (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4IPROC) (GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4SPROC) (GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLTEXENVFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLTEXENVFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLTEXENVIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLTEXENVIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLTEXGENDPROC) (GLenum coord, GLenum pname, GLdouble param);
-typedef void (GLAPIENTRY * PFNGLTEXGENDVPROC) (GLenum coord, GLenum pname, const GLdouble *params);
-typedef void (GLAPIENTRY * PFNGLTEXGENFPROC) (GLenum coord, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLTEXGENFVPROC) (GLenum coord, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLTEXGENIPROC) (GLenum coord, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLTEXGENIVPROC) (GLenum coord, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE1DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTRANSLATEDPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLTRANSLATEFPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEX2DPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX2FPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX2IPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX2SPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3IPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4DPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4FPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4IPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4SPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glAccum GLEW_GET_FUN(__glewAccum)
-#define glAlphaFunc GLEW_GET_FUN(__glewAlphaFunc)
-#define glAreTexturesResident GLEW_GET_FUN(__glewAreTexturesResident)
-#define glArrayElement GLEW_GET_FUN(__glewArrayElement)
-#define glBegin GLEW_GET_FUN(__glewBegin)
-#define glBindTexture GLEW_GET_FUN(__glewBindTexture)
-#define glBitmap GLEW_GET_FUN(__glewBitmap)
-#define glBlendFunc GLEW_GET_FUN(__glewBlendFunc)
-#define glCallList GLEW_GET_FUN(__glewCallList)
-#define glCallLists GLEW_GET_FUN(__glewCallLists)
-#define glClear GLEW_GET_FUN(__glewClear)
-#define glClearAccum GLEW_GET_FUN(__glewClearAccum)
-#define glClearColor GLEW_GET_FUN(__glewClearColor)
-#define glClearDepth GLEW_GET_FUN(__glewClearDepth)
-#define glClearIndex GLEW_GET_FUN(__glewClearIndex)
-#define glClearStencil GLEW_GET_FUN(__glewClearStencil)
-#define glClipPlane GLEW_GET_FUN(__glewClipPlane)
-#define glColor3b GLEW_GET_FUN(__glewColor3b)
-#define glColor3bv GLEW_GET_FUN(__glewColor3bv)
-#define glColor3d GLEW_GET_FUN(__glewColor3d)
-#define glColor3dv GLEW_GET_FUN(__glewColor3dv)
-#define glColor3f GLEW_GET_FUN(__glewColor3f)
-#define glColor3fv GLEW_GET_FUN(__glewColor3fv)
-#define glColor3i GLEW_GET_FUN(__glewColor3i)
-#define glColor3iv GLEW_GET_FUN(__glewColor3iv)
-#define glColor3s GLEW_GET_FUN(__glewColor3s)
-#define glColor3sv GLEW_GET_FUN(__glewColor3sv)
-#define glColor3ub GLEW_GET_FUN(__glewColor3ub)
-#define glColor3ubv GLEW_GET_FUN(__glewColor3ubv)
-#define glColor3ui GLEW_GET_FUN(__glewColor3ui)
-#define glColor3uiv GLEW_GET_FUN(__glewColor3uiv)
-#define glColor3us GLEW_GET_FUN(__glewColor3us)
-#define glColor3usv GLEW_GET_FUN(__glewColor3usv)
-#define glColor4b GLEW_GET_FUN(__glewColor4b)
-#define glColor4bv GLEW_GET_FUN(__glewColor4bv)
-#define glColor4d GLEW_GET_FUN(__glewColor4d)
-#define glColor4dv GLEW_GET_FUN(__glewColor4dv)
-#define glColor4f GLEW_GET_FUN(__glewColor4f)
-#define glColor4fv GLEW_GET_FUN(__glewColor4fv)
-#define glColor4i GLEW_GET_FUN(__glewColor4i)
-#define glColor4iv GLEW_GET_FUN(__glewColor4iv)
-#define glColor4s GLEW_GET_FUN(__glewColor4s)
-#define glColor4sv GLEW_GET_FUN(__glewColor4sv)
-#define glColor4ub GLEW_GET_FUN(__glewColor4ub)
-#define glColor4ubv GLEW_GET_FUN(__glewColor4ubv)
-#define glColor4ui GLEW_GET_FUN(__glewColor4ui)
-#define glColor4uiv GLEW_GET_FUN(__glewColor4uiv)
-#define glColor4us GLEW_GET_FUN(__glewColor4us)
-#define glColor4usv GLEW_GET_FUN(__glewColor4usv)
-#define glColorMask GLEW_GET_FUN(__glewColorMask)
-#define glColorMaterial GLEW_GET_FUN(__glewColorMaterial)
-#define glColorPointer GLEW_GET_FUN(__glewColorPointer)
-#define glCopyPixels GLEW_GET_FUN(__glewCopyPixels)
-#define glCopyTexImage1D GLEW_GET_FUN(__glewCopyTexImage1D)
-#define glCopyTexImage2D GLEW_GET_FUN(__glewCopyTexImage2D)
-#define glCopyTexSubImage1D GLEW_GET_FUN(__glewCopyTexSubImage1D)
-#define glCopyTexSubImage2D GLEW_GET_FUN(__glewCopyTexSubImage2D)
-#define glCullFace GLEW_GET_FUN(__glewCullFace)
-#define glDeleteLists GLEW_GET_FUN(__glewDeleteLists)
-#define glDeleteTextures GLEW_GET_FUN(__glewDeleteTextures)
-#define glDepthFunc GLEW_GET_FUN(__glewDepthFunc)
-#define glDepthMask GLEW_GET_FUN(__glewDepthMask)
-#define glDepthRange GLEW_GET_FUN(__glewDepthRange)
-#define glDisable GLEW_GET_FUN(__glewDisable)
-#define glDisableClientState GLEW_GET_FUN(__glewDisableClientState)
-#define glDrawArrays GLEW_GET_FUN(__glewDrawArrays)
-#define glDrawBuffer GLEW_GET_FUN(__glewDrawBuffer)
-#define glDrawElements GLEW_GET_FUN(__glewDrawElements)
-#define glDrawPixels GLEW_GET_FUN(__glewDrawPixels)
-#define glEdgeFlag GLEW_GET_FUN(__glewEdgeFlag)
-#define glEdgeFlagPointer GLEW_GET_FUN(__glewEdgeFlagPointer)
-#define glEdgeFlagv GLEW_GET_FUN(__glewEdgeFlagv)
-#define glEnable GLEW_GET_FUN(__glewEnable)
-#define glEnableClientState GLEW_GET_FUN(__glewEnableClientState)
-#define glEnd GLEW_GET_FUN(__glewEnd)
-#define glEndList GLEW_GET_FUN(__glewEndList)
-#define glEvalCoord1d GLEW_GET_FUN(__glewEvalCoord1d)
-#define glEvalCoord1dv GLEW_GET_FUN(__glewEvalCoord1dv)
-#define glEvalCoord1f GLEW_GET_FUN(__glewEvalCoord1f)
-#define glEvalCoord1fv GLEW_GET_FUN(__glewEvalCoord1fv)
-#define glEvalCoord2d GLEW_GET_FUN(__glewEvalCoord2d)
-#define glEvalCoord2dv GLEW_GET_FUN(__glewEvalCoord2dv)
-#define glEvalCoord2f GLEW_GET_FUN(__glewEvalCoord2f)
-#define glEvalCoord2fv GLEW_GET_FUN(__glewEvalCoord2fv)
-#define glEvalMesh1 GLEW_GET_FUN(__glewEvalMesh1)
-#define glEvalMesh2 GLEW_GET_FUN(__glewEvalMesh2)
-#define glEvalPoint1 GLEW_GET_FUN(__glewEvalPoint1)
-#define glEvalPoint2 GLEW_GET_FUN(__glewEvalPoint2)
-#define glFeedbackBuffer GLEW_GET_FUN(__glewFeedbackBuffer)
-#define glFinish GLEW_GET_FUN(__glewFinish)
-#define glFlush GLEW_GET_FUN(__glewFlush)
-#define glFogf GLEW_GET_FUN(__glewFogf)
-#define glFogfv GLEW_GET_FUN(__glewFogfv)
-#define glFogi GLEW_GET_FUN(__glewFogi)
-#define glFogiv GLEW_GET_FUN(__glewFogiv)
-#define glFrontFace GLEW_GET_FUN(__glewFrontFace)
-#define glFrustum GLEW_GET_FUN(__glewFrustum)
-#define glGenLists GLEW_GET_FUN(__glewGenLists)
-#define glGenTextures GLEW_GET_FUN(__glewGenTextures)
-#define glGetBooleanv GLEW_GET_FUN(__glewGetBooleanv)
-#define glGetClipPlane GLEW_GET_FUN(__glewGetClipPlane)
-#define glGetDoublev GLEW_GET_FUN(__glewGetDoublev)
-#define glGetError GLEW_GET_FUN(__glewGetError)
-#define glGetFloatv GLEW_GET_FUN(__glewGetFloatv)
-#define glGetIntegerv GLEW_GET_FUN(__glewGetIntegerv)
-#define glGetLightfv GLEW_GET_FUN(__glewGetLightfv)
-#define glGetLightiv GLEW_GET_FUN(__glewGetLightiv)
-#define glGetMapdv GLEW_GET_FUN(__glewGetMapdv)
-#define glGetMapfv GLEW_GET_FUN(__glewGetMapfv)
-#define glGetMapiv GLEW_GET_FUN(__glewGetMapiv)
-#define glGetMaterialfv GLEW_GET_FUN(__glewGetMaterialfv)
-#define glGetMaterialiv GLEW_GET_FUN(__glewGetMaterialiv)
-#define glGetPixelMapfv GLEW_GET_FUN(__glewGetPixelMapfv)
-#define glGetPixelMapuiv GLEW_GET_FUN(__glewGetPixelMapuiv)
-#define glGetPixelMapusv GLEW_GET_FUN(__glewGetPixelMapusv)
-#define glGetPointerv GLEW_GET_FUN(__glewGetPointerv)
-#define glGetPolygonStipple GLEW_GET_FUN(__glewGetPolygonStipple)
-#define glGetString GLEW_GET_FUN(__glewGetString)
-#define glGetTexEnvfv GLEW_GET_FUN(__glewGetTexEnvfv)
-#define glGetTexEnviv GLEW_GET_FUN(__glewGetTexEnviv)
-#define glGetTexGendv GLEW_GET_FUN(__glewGetTexGendv)
-#define glGetTexGenfv GLEW_GET_FUN(__glewGetTexGenfv)
-#define glGetTexGeniv GLEW_GET_FUN(__glewGetTexGeniv)
-#define glGetTexImage GLEW_GET_FUN(__glewGetTexImage)
-#define glGetTexLevelParameterfv GLEW_GET_FUN(__glewGetTexLevelParameterfv)
-#define glGetTexLevelParameteriv GLEW_GET_FUN(__glewGetTexLevelParameteriv)
-#define glGetTexParameterfv GLEW_GET_FUN(__glewGetTexParameterfv)
-#define glGetTexParameteriv GLEW_GET_FUN(__glewGetTexParameteriv)
-#define glHint GLEW_GET_FUN(__glewHint)
-#define glIndexMask GLEW_GET_FUN(__glewIndexMask)
-#define glIndexPointer GLEW_GET_FUN(__glewIndexPointer)
-#define glIndexd GLEW_GET_FUN(__glewIndexd)
-#define glIndexdv GLEW_GET_FUN(__glewIndexdv)
-#define glIndexf GLEW_GET_FUN(__glewIndexf)
-#define glIndexfv GLEW_GET_FUN(__glewIndexfv)
-#define glIndexi GLEW_GET_FUN(__glewIndexi)
-#define glIndexiv GLEW_GET_FUN(__glewIndexiv)
-#define glIndexs GLEW_GET_FUN(__glewIndexs)
-#define glIndexsv GLEW_GET_FUN(__glewIndexsv)
-#define glIndexub GLEW_GET_FUN(__glewIndexub)
-#define glIndexubv GLEW_GET_FUN(__glewIndexubv)
-#define glInitNames GLEW_GET_FUN(__glewInitNames)
-#define glInterleavedArrays GLEW_GET_FUN(__glewInterleavedArrays)
-#define glIsEnabled GLEW_GET_FUN(__glewIsEnabled)
-#define glIsList GLEW_GET_FUN(__glewIsList)
-#define glIsTexture GLEW_GET_FUN(__glewIsTexture)
-#define glLightModelf GLEW_GET_FUN(__glewLightModelf)
-#define glLightModelfv GLEW_GET_FUN(__glewLightModelfv)
-#define glLightModeli GLEW_GET_FUN(__glewLightModeli)
-#define glLightModeliv GLEW_GET_FUN(__glewLightModeliv)
-#define glLightf GLEW_GET_FUN(__glewLightf)
-#define glLightfv GLEW_GET_FUN(__glewLightfv)
-#define glLighti GLEW_GET_FUN(__glewLighti)
-#define glLightiv GLEW_GET_FUN(__glewLightiv)
-#define glLineStipple GLEW_GET_FUN(__glewLineStipple)
-#define glLineWidth GLEW_GET_FUN(__glewLineWidth)
-#define glListBase GLEW_GET_FUN(__glewListBase)
-#define glLoadIdentity GLEW_GET_FUN(__glewLoadIdentity)
-#define glLoadMatrixd GLEW_GET_FUN(__glewLoadMatrixd)
-#define glLoadMatrixf GLEW_GET_FUN(__glewLoadMatrixf)
-#define glLoadName GLEW_GET_FUN(__glewLoadName)
-#define glLogicOp GLEW_GET_FUN(__glewLogicOp)
-#define glMap1d GLEW_GET_FUN(__glewMap1d)
-#define glMap1f GLEW_GET_FUN(__glewMap1f)
-#define glMap2d GLEW_GET_FUN(__glewMap2d)
-#define glMap2f GLEW_GET_FUN(__glewMap2f)
-#define glMapGrid1d GLEW_GET_FUN(__glewMapGrid1d)
-#define glMapGrid1f GLEW_GET_FUN(__glewMapGrid1f)
-#define glMapGrid2d GLEW_GET_FUN(__glewMapGrid2d)
-#define glMapGrid2f GLEW_GET_FUN(__glewMapGrid2f)
-#define glMaterialf GLEW_GET_FUN(__glewMaterialf)
-#define glMaterialfv GLEW_GET_FUN(__glewMaterialfv)
-#define glMateriali GLEW_GET_FUN(__glewMateriali)
-#define glMaterialiv GLEW_GET_FUN(__glewMaterialiv)
-#define glMatrixMode GLEW_GET_FUN(__glewMatrixMode)
-#define glMultMatrixd GLEW_GET_FUN(__glewMultMatrixd)
-#define glMultMatrixf GLEW_GET_FUN(__glewMultMatrixf)
-#define glNewList GLEW_GET_FUN(__glewNewList)
-#define glNormal3b GLEW_GET_FUN(__glewNormal3b)
-#define glNormal3bv GLEW_GET_FUN(__glewNormal3bv)
-#define glNormal3d GLEW_GET_FUN(__glewNormal3d)
-#define glNormal3dv GLEW_GET_FUN(__glewNormal3dv)
-#define glNormal3f GLEW_GET_FUN(__glewNormal3f)
-#define glNormal3fv GLEW_GET_FUN(__glewNormal3fv)
-#define glNormal3i GLEW_GET_FUN(__glewNormal3i)
-#define glNormal3iv GLEW_GET_FUN(__glewNormal3iv)
-#define glNormal3s GLEW_GET_FUN(__glewNormal3s)
-#define glNormal3sv GLEW_GET_FUN(__glewNormal3sv)
-#define glNormalPointer GLEW_GET_FUN(__glewNormalPointer)
-#define glOrtho GLEW_GET_FUN(__glewOrtho)
-#define glPassThrough GLEW_GET_FUN(__glewPassThrough)
-#define glPixelMapfv GLEW_GET_FUN(__glewPixelMapfv)
-#define glPixelMapuiv GLEW_GET_FUN(__glewPixelMapuiv)
-#define glPixelMapusv GLEW_GET_FUN(__glewPixelMapusv)
-#define glPixelStoref GLEW_GET_FUN(__glewPixelStoref)
-#define glPixelStorei GLEW_GET_FUN(__glewPixelStorei)
-#define glPixelTransferf GLEW_GET_FUN(__glewPixelTransferf)
-#define glPixelTransferi GLEW_GET_FUN(__glewPixelTransferi)
-#define glPixelZoom GLEW_GET_FUN(__glewPixelZoom)
-#define glPointSize GLEW_GET_FUN(__glewPointSize)
-#define glPolygonMode GLEW_GET_FUN(__glewPolygonMode)
-#define glPolygonOffset GLEW_GET_FUN(__glewPolygonOffset)
-#define glPolygonStipple GLEW_GET_FUN(__glewPolygonStipple)
-#define glPopAttrib GLEW_GET_FUN(__glewPopAttrib)
-#define glPopClientAttrib GLEW_GET_FUN(__glewPopClientAttrib)
-#define glPopMatrix GLEW_GET_FUN(__glewPopMatrix)
-#define glPopName GLEW_GET_FUN(__glewPopName)
-#define glPrioritizeTextures GLEW_GET_FUN(__glewPrioritizeTextures)
-#define glPushAttrib GLEW_GET_FUN(__glewPushAttrib)
-#define glPushClientAttrib GLEW_GET_FUN(__glewPushClientAttrib)
-#define glPushMatrix GLEW_GET_FUN(__glewPushMatrix)
-#define glPushName GLEW_GET_FUN(__glewPushName)
-#define glRasterPos2d GLEW_GET_FUN(__glewRasterPos2d)
-#define glRasterPos2dv GLEW_GET_FUN(__glewRasterPos2dv)
-#define glRasterPos2f GLEW_GET_FUN(__glewRasterPos2f)
-#define glRasterPos2fv GLEW_GET_FUN(__glewRasterPos2fv)
-#define glRasterPos2i GLEW_GET_FUN(__glewRasterPos2i)
-#define glRasterPos2iv GLEW_GET_FUN(__glewRasterPos2iv)
-#define glRasterPos2s GLEW_GET_FUN(__glewRasterPos2s)
-#define glRasterPos2sv GLEW_GET_FUN(__glewRasterPos2sv)
-#define glRasterPos3d GLEW_GET_FUN(__glewRasterPos3d)
-#define glRasterPos3dv GLEW_GET_FUN(__glewRasterPos3dv)
-#define glRasterPos3f GLEW_GET_FUN(__glewRasterPos3f)
-#define glRasterPos3fv GLEW_GET_FUN(__glewRasterPos3fv)
-#define glRasterPos3i GLEW_GET_FUN(__glewRasterPos3i)
-#define glRasterPos3iv GLEW_GET_FUN(__glewRasterPos3iv)
-#define glRasterPos3s GLEW_GET_FUN(__glewRasterPos3s)
-#define glRasterPos3sv GLEW_GET_FUN(__glewRasterPos3sv)
-#define glRasterPos4d GLEW_GET_FUN(__glewRasterPos4d)
-#define glRasterPos4dv GLEW_GET_FUN(__glewRasterPos4dv)
-#define glRasterPos4f GLEW_GET_FUN(__glewRasterPos4f)
-#define glRasterPos4fv GLEW_GET_FUN(__glewRasterPos4fv)
-#define glRasterPos4i GLEW_GET_FUN(__glewRasterPos4i)
-#define glRasterPos4iv GLEW_GET_FUN(__glewRasterPos4iv)
-#define glRasterPos4s GLEW_GET_FUN(__glewRasterPos4s)
-#define glRasterPos4sv GLEW_GET_FUN(__glewRasterPos4sv)
-#define glReadBuffer GLEW_GET_FUN(__glewReadBuffer)
-#define glReadPixels GLEW_GET_FUN(__glewReadPixels)
-#define glRectd GLEW_GET_FUN(__glewRectd)
-#define glRectdv GLEW_GET_FUN(__glewRectdv)
-#define glRectf GLEW_GET_FUN(__glewRectf)
-#define glRectfv GLEW_GET_FUN(__glewRectfv)
-#define glRecti GLEW_GET_FUN(__glewRecti)
-#define glRectiv GLEW_GET_FUN(__glewRectiv)
-#define glRects GLEW_GET_FUN(__glewRects)
-#define glRectsv GLEW_GET_FUN(__glewRectsv)
-#define glRenderMode GLEW_GET_FUN(__glewRenderMode)
-#define glRotated GLEW_GET_FUN(__glewRotated)
-#define glRotatef GLEW_GET_FUN(__glewRotatef)
-#define glScaled GLEW_GET_FUN(__glewScaled)
-#define glScalef GLEW_GET_FUN(__glewScalef)
-#define glScissor GLEW_GET_FUN(__glewScissor)
-#define glSelectBuffer GLEW_GET_FUN(__glewSelectBuffer)
-#define glShadeModel GLEW_GET_FUN(__glewShadeModel)
-#define glStencilFunc GLEW_GET_FUN(__glewStencilFunc)
-#define glStencilMask GLEW_GET_FUN(__glewStencilMask)
-#define glStencilOp GLEW_GET_FUN(__glewStencilOp)
-#define glTexCoord1d GLEW_GET_FUN(__glewTexCoord1d)
-#define glTexCoord1dv GLEW_GET_FUN(__glewTexCoord1dv)
-#define glTexCoord1f GLEW_GET_FUN(__glewTexCoord1f)
-#define glTexCoord1fv GLEW_GET_FUN(__glewTexCoord1fv)
-#define glTexCoord1i GLEW_GET_FUN(__glewTexCoord1i)
-#define glTexCoord1iv GLEW_GET_FUN(__glewTexCoord1iv)
-#define glTexCoord1s GLEW_GET_FUN(__glewTexCoord1s)
-#define glTexCoord1sv GLEW_GET_FUN(__glewTexCoord1sv)
-#define glTexCoord2d GLEW_GET_FUN(__glewTexCoord2d)
-#define glTexCoord2dv GLEW_GET_FUN(__glewTexCoord2dv)
-#define glTexCoord2f GLEW_GET_FUN(__glewTexCoord2f)
-#define glTexCoord2fv GLEW_GET_FUN(__glewTexCoord2fv)
-#define glTexCoord2i GLEW_GET_FUN(__glewTexCoord2i)
-#define glTexCoord2iv GLEW_GET_FUN(__glewTexCoord2iv)
-#define glTexCoord2s GLEW_GET_FUN(__glewTexCoord2s)
-#define glTexCoord2sv GLEW_GET_FUN(__glewTexCoord2sv)
-#define glTexCoord3d GLEW_GET_FUN(__glewTexCoord3d)
-#define glTexCoord3dv GLEW_GET_FUN(__glewTexCoord3dv)
-#define glTexCoord3f GLEW_GET_FUN(__glewTexCoord3f)
-#define glTexCoord3fv GLEW_GET_FUN(__glewTexCoord3fv)
-#define glTexCoord3i GLEW_GET_FUN(__glewTexCoord3i)
-#define glTexCoord3iv GLEW_GET_FUN(__glewTexCoord3iv)
-#define glTexCoord3s GLEW_GET_FUN(__glewTexCoord3s)
-#define glTexCoord3sv GLEW_GET_FUN(__glewTexCoord3sv)
-#define glTexCoord4d GLEW_GET_FUN(__glewTexCoord4d)
-#define glTexCoord4dv GLEW_GET_FUN(__glewTexCoord4dv)
-#define glTexCoord4f GLEW_GET_FUN(__glewTexCoord4f)
-#define glTexCoord4fv GLEW_GET_FUN(__glewTexCoord4fv)
-#define glTexCoord4i GLEW_GET_FUN(__glewTexCoord4i)
-#define glTexCoord4iv GLEW_GET_FUN(__glewTexCoord4iv)
-#define glTexCoord4s GLEW_GET_FUN(__glewTexCoord4s)
-#define glTexCoord4sv GLEW_GET_FUN(__glewTexCoord4sv)
-#define glTexCoordPointer GLEW_GET_FUN(__glewTexCoordPointer)
-#define glTexEnvf GLEW_GET_FUN(__glewTexEnvf)
-#define glTexEnvfv GLEW_GET_FUN(__glewTexEnvfv)
-#define glTexEnvi GLEW_GET_FUN(__glewTexEnvi)
-#define glTexEnviv GLEW_GET_FUN(__glewTexEnviv)
-#define glTexGend GLEW_GET_FUN(__glewTexGend)
-#define glTexGendv GLEW_GET_FUN(__glewTexGendv)
-#define glTexGenf GLEW_GET_FUN(__glewTexGenf)
-#define glTexGenfv GLEW_GET_FUN(__glewTexGenfv)
-#define glTexGeni GLEW_GET_FUN(__glewTexGeni)
-#define glTexGeniv GLEW_GET_FUN(__glewTexGeniv)
-#define glTexImage1D GLEW_GET_FUN(__glewTexImage1D)
-#define glTexImage2D GLEW_GET_FUN(__glewTexImage2D)
-#define glTexParameterf GLEW_GET_FUN(__glewTexParameterf)
-#define glTexParameterfv GLEW_GET_FUN(__glewTexParameterfv)
-#define glTexParameteri GLEW_GET_FUN(__glewTexParameteri)
-#define glTexParameteriv GLEW_GET_FUN(__glewTexParameteriv)
-#define glTexSubImage1D GLEW_GET_FUN(__glewTexSubImage1D)
-#define glTexSubImage2D GLEW_GET_FUN(__glewTexSubImage2D)
-#define glTranslated GLEW_GET_FUN(__glewTranslated)
-#define glTranslatef GLEW_GET_FUN(__glewTranslatef)
-#define glVertex2d GLEW_GET_FUN(__glewVertex2d)
-#define glVertex2dv GLEW_GET_FUN(__glewVertex2dv)
-#define glVertex2f GLEW_GET_FUN(__glewVertex2f)
-#define glVertex2fv GLEW_GET_FUN(__glewVertex2fv)
-#define glVertex2i GLEW_GET_FUN(__glewVertex2i)
-#define glVertex2iv GLEW_GET_FUN(__glewVertex2iv)
-#define glVertex2s GLEW_GET_FUN(__glewVertex2s)
-#define glVertex2sv GLEW_GET_FUN(__glewVertex2sv)
-#define glVertex3d GLEW_GET_FUN(__glewVertex3d)
-#define glVertex3dv GLEW_GET_FUN(__glewVertex3dv)
-#define glVertex3f GLEW_GET_FUN(__glewVertex3f)
-#define glVertex3fv GLEW_GET_FUN(__glewVertex3fv)
-#define glVertex3i GLEW_GET_FUN(__glewVertex3i)
-#define glVertex3iv GLEW_GET_FUN(__glewVertex3iv)
-#define glVertex3s GLEW_GET_FUN(__glewVertex3s)
-#define glVertex3sv GLEW_GET_FUN(__glewVertex3sv)
-#define glVertex4d GLEW_GET_FUN(__glewVertex4d)
-#define glVertex4dv GLEW_GET_FUN(__glewVertex4dv)
-#define glVertex4f GLEW_GET_FUN(__glewVertex4f)
-#define glVertex4fv GLEW_GET_FUN(__glewVertex4fv)
-#define glVertex4i GLEW_GET_FUN(__glewVertex4i)
-#define glVertex4iv GLEW_GET_FUN(__glewVertex4iv)
-#define glVertex4s GLEW_GET_FUN(__glewVertex4s)
-#define glVertex4sv GLEW_GET_FUN(__glewVertex4sv)
-#define glVertexPointer GLEW_GET_FUN(__glewVertexPointer)
-#define glViewport GLEW_GET_FUN(__glewViewport)
-
-
-#else //GLEW_INIT_OPENGL11_FUNCTIONS
-
-GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value);
-GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref);
-GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences);
-GLAPI void GLAPIENTRY glArrayElement (GLint i);
-GLAPI void GLAPIENTRY glBegin (GLenum mode);
-GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture);
-GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
-GLAPI void GLAPIENTRY glCallList (GLuint list);
-GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists);
-GLAPI void GLAPIENTRY glClear (GLbitfield mask);
-GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-GLAPI void GLAPIENTRY glClearDepth (GLclampd depth);
-GLAPI void GLAPIENTRY glClearIndex (GLfloat c);
-GLAPI void GLAPIENTRY glClearStencil (GLint s);
-GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation);
-GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue);
-GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue);
-GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue);
-GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue);
-GLAPI void GLAPIENTRY glColor3iv (const GLint *v);
-GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue);
-GLAPI void GLAPIENTRY glColor3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue);
-GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v);
-GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue);
-GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v);
-GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue);
-GLAPI void GLAPIENTRY glColor3usv (const GLushort *v);
-GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha);
-GLAPI void GLAPIENTRY glColor4iv (const GLint *v);
-GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha);
-GLAPI void GLAPIENTRY glColor4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v);
-GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v);
-GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha);
-GLAPI void GLAPIENTRY glColor4usv (const GLushort *v);
-GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode);
-GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void GLAPIENTRY glCullFace (GLenum mode);
-GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range);
-GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
-GLAPI void GLAPIENTRY glDepthFunc (GLenum func);
-GLAPI void GLAPIENTRY glDepthMask (GLboolean flag);
-GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar);
-GLAPI void GLAPIENTRY glDisable (GLenum cap);
-GLAPI void GLAPIENTRY glDisableClientState (GLenum array);
-GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
-GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode);
-GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag);
-GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag);
-GLAPI void GLAPIENTRY glEnable (GLenum cap);
-GLAPI void GLAPIENTRY glEnableClientState (GLenum array);
-GLAPI void GLAPIENTRY glEnd (void);
-GLAPI void GLAPIENTRY glEndList (void);
-GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u);
-GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u);
-GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u);
-GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u);
-GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v);
-GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u);
-GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v);
-GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u);
-GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2);
-GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-GLAPI void GLAPIENTRY glEvalPoint1 (GLint i);
-GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j);
-GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer);
-GLAPI void GLAPIENTRY glFinish (void);
-GLAPI void GLAPIENTRY glFlush (void);
-GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glFrontFace (GLenum mode);
-GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range);
-GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures);
-GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
-GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation);
-GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params);
-GLAPI GLenum GLAPIENTRY glGetError (void);
-GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v);
-GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v);
-GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v);
-GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values);
-GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values);
-GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values);
-GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params);
-GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask);
-GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name);
-GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params);
-GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
-GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
-GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode);
-GLAPI void GLAPIENTRY glIndexMask (GLuint mask);
-GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glIndexd (GLdouble c);
-GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c);
-GLAPI void GLAPIENTRY glIndexf (GLfloat c);
-GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c);
-GLAPI void GLAPIENTRY glIndexi (GLint c);
-GLAPI void GLAPIENTRY glIndexiv (const GLint *c);
-GLAPI void GLAPIENTRY glIndexs (GLshort c);
-GLAPI void GLAPIENTRY glIndexsv (const GLshort *c);
-GLAPI void GLAPIENTRY glIndexub (GLubyte c);
-GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c);
-GLAPI void GLAPIENTRY glInitNames (void);
-GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer);
-GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap);
-GLAPI GLboolean GLAPIENTRY glIsList (GLuint list);
-GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture);
-GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern);
-GLAPI void GLAPIENTRY glLineWidth (GLfloat width);
-GLAPI void GLAPIENTRY glListBase (GLuint base);
-GLAPI void GLAPIENTRY glLoadIdentity (void);
-GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m);
-GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m);
-GLAPI void GLAPIENTRY glLoadName (GLuint name);
-GLAPI void GLAPIENTRY glLogicOp (GLenum opcode);
-GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2);
-GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2);
-GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glMatrixMode (GLenum mode);
-GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m);
-GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m);
-GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode);
-GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz);
-GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v);
-GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz);
-GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
-GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz);
-GLAPI void GLAPIENTRY glNormal3iv (const GLint *v);
-GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz);
-GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-GLAPI void GLAPIENTRY glPassThrough (GLfloat token);
-GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values);
-GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values);
-GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values);
-GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor);
-GLAPI void GLAPIENTRY glPointSize (GLfloat size);
-GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode);
-GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
-GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask);
-GLAPI void GLAPIENTRY glPopAttrib (void);
-GLAPI void GLAPIENTRY glPopClientAttrib (void);
-GLAPI void GLAPIENTRY glPopMatrix (void);
-GLAPI void GLAPIENTRY glPopName (void);
-GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities);
-GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask);
-GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask);
-GLAPI void GLAPIENTRY glPushMatrix (void);
-GLAPI void GLAPIENTRY glPushName (GLuint name);
-GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y);
-GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y);
-GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y);
-GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y);
-GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z);
-GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z);
-GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w);
-GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v);
-GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glReadBuffer (GLenum mode);
-GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2);
-GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2);
-GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2);
-GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2);
-GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2);
-GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode);
-GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
-GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer);
-GLAPI void GLAPIENTRY glShadeModel (GLenum mode);
-GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
-GLAPI void GLAPIENTRY glStencilMask (GLuint mask);
-GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
-GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s);
-GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s);
-GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord1i (GLint s);
-GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord1s (GLshort s);
-GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t);
-GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t);
-GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t);
-GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t);
-GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r);
-GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r);
-GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r);
-GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r);
-GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q);
-GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v);
-GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q);
-GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param);
-GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params);
-GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
-GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
-GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
-GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
-GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y);
-GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y);
-GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y);
-GLAPI void GLAPIENTRY glVertex2iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y);
-GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z);
-GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z);
-GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z);
-GLAPI void GLAPIENTRY glVertex3iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z);
-GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v);
-GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v);
-GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w);
-GLAPI void GLAPIENTRY glVertex4iv (const GLint *v);
-GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w);
-GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v);
-GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
-#endif //GLEW_INIT_OPENGL11_FUNCTIONS
-#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1)
-
-#endif /* GL_VERSION_1_1 */
-
-/* ---------------------------------- GLU ---------------------------------- */
-
-#ifndef GLEW_NO_GLU
-/* this is where we can safely include GLU */
-# if defined(__APPLE__) && defined(__MACH__)
-# include <OpenGL/glu.h>
-# else
-# include <GL/glu.h>
-# endif
-#endif
-
-/* ----------------------------- GL_VERSION_1_2 ---------------------------- */
-
-#ifndef GL_VERSION_1_2
-#define GL_VERSION_1_2 1
-
-#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
-#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13
-#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
-#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23
-#define GL_UNSIGNED_BYTE_3_3_2 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2 0x8036
-#define GL_RESCALE_NORMAL 0x803A
-#define GL_TEXTURE_BINDING_3D 0x806A
-#define GL_PACK_SKIP_IMAGES 0x806B
-#define GL_PACK_IMAGE_HEIGHT 0x806C
-#define GL_UNPACK_SKIP_IMAGES 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT 0x806E
-#define GL_TEXTURE_3D 0x806F
-#define GL_PROXY_TEXTURE_3D 0x8070
-#define GL_TEXTURE_DEPTH 0x8071
-#define GL_TEXTURE_WRAP_R 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE 0x8073
-#define GL_BGR 0x80E0
-#define GL_BGRA 0x80E1
-#define GL_MAX_ELEMENTS_VERTICES 0x80E8
-#define GL_MAX_ELEMENTS_INDICES 0x80E9
-#define GL_CLAMP_TO_EDGE 0x812F
-#define GL_TEXTURE_MIN_LOD 0x813A
-#define GL_TEXTURE_MAX_LOD 0x813B
-#define GL_TEXTURE_BASE_LEVEL 0x813C
-#define GL_TEXTURE_MAX_LEVEL 0x813D
-#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
-#define GL_SINGLE_COLOR 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR 0x81FA
-#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362
-#define GL_UNSIGNED_SHORT_5_6_5 0x8363
-#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364
-#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365
-#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366
-#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367
-#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
-
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-
-#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D)
-#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements)
-#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D)
-#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D)
-
-#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2)
-
-#endif /* GL_VERSION_1_2 */
-
-/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */
-
-#ifndef GL_VERSION_1_2_1
-#define GL_VERSION_1_2_1 1
-
-#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1)
-
-#endif /* GL_VERSION_1_2_1 */
-
-/* ----------------------------- GL_VERSION_1_3 ---------------------------- */
-
-#ifndef GL_VERSION_1_3
-#define GL_VERSION_1_3 1
-
-#define GL_MULTISAMPLE 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
-#define GL_SAMPLE_COVERAGE 0x80A0
-#define GL_SAMPLE_BUFFERS 0x80A8
-#define GL_SAMPLES 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
-#define GL_CLAMP_TO_BORDER 0x812D
-#define GL_TEXTURE0 0x84C0
-#define GL_TEXTURE1 0x84C1
-#define GL_TEXTURE2 0x84C2
-#define GL_TEXTURE3 0x84C3
-#define GL_TEXTURE4 0x84C4
-#define GL_TEXTURE5 0x84C5
-#define GL_TEXTURE6 0x84C6
-#define GL_TEXTURE7 0x84C7
-#define GL_TEXTURE8 0x84C8
-#define GL_TEXTURE9 0x84C9
-#define GL_TEXTURE10 0x84CA
-#define GL_TEXTURE11 0x84CB
-#define GL_TEXTURE12 0x84CC
-#define GL_TEXTURE13 0x84CD
-#define GL_TEXTURE14 0x84CE
-#define GL_TEXTURE15 0x84CF
-#define GL_TEXTURE16 0x84D0
-#define GL_TEXTURE17 0x84D1
-#define GL_TEXTURE18 0x84D2
-#define GL_TEXTURE19 0x84D3
-#define GL_TEXTURE20 0x84D4
-#define GL_TEXTURE21 0x84D5
-#define GL_TEXTURE22 0x84D6
-#define GL_TEXTURE23 0x84D7
-#define GL_TEXTURE24 0x84D8
-#define GL_TEXTURE25 0x84D9
-#define GL_TEXTURE26 0x84DA
-#define GL_TEXTURE27 0x84DB
-#define GL_TEXTURE28 0x84DC
-#define GL_TEXTURE29 0x84DD
-#define GL_TEXTURE30 0x84DE
-#define GL_TEXTURE31 0x84DF
-#define GL_ACTIVE_TEXTURE 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
-#define GL_MAX_TEXTURE_UNITS 0x84E2
-#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6
-#define GL_SUBTRACT 0x84E7
-#define GL_COMPRESSED_ALPHA 0x84E9
-#define GL_COMPRESSED_LUMINANCE 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB
-#define GL_COMPRESSED_INTENSITY 0x84EC
-#define GL_COMPRESSED_RGB 0x84ED
-#define GL_COMPRESSED_RGBA 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT 0x84EF
-#define GL_NORMAL_MAP 0x8511
-#define GL_REFLECTION_MAP 0x8512
-#define GL_TEXTURE_CUBE_MAP 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
-#define GL_COMBINE 0x8570
-#define GL_COMBINE_RGB 0x8571
-#define GL_COMBINE_ALPHA 0x8572
-#define GL_RGB_SCALE 0x8573
-#define GL_ADD_SIGNED 0x8574
-#define GL_INTERPOLATE 0x8575
-#define GL_CONSTANT 0x8576
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PREVIOUS 0x8578
-#define GL_SOURCE0_RGB 0x8580
-#define GL_SOURCE1_RGB 0x8581
-#define GL_SOURCE2_RGB 0x8582
-#define GL_SOURCE0_ALPHA 0x8588
-#define GL_SOURCE1_ALPHA 0x8589
-#define GL_SOURCE2_ALPHA 0x858A
-#define GL_OPERAND0_RGB 0x8590
-#define GL_OPERAND1_RGB 0x8591
-#define GL_OPERAND2_RGB 0x8592
-#define GL_OPERAND0_ALPHA 0x8598
-#define GL_OPERAND1_ALPHA 0x8599
-#define GL_OPERAND2_ALPHA 0x859A
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0
-#define GL_TEXTURE_COMPRESSED 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
-#define GL_DOT3_RGB 0x86AE
-#define GL_DOT3_RGBA 0x86AF
-#define GL_MULTISAMPLE_BIT 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert);
-
-#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture)
-#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture)
-#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D)
-#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D)
-#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D)
-#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D)
-#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D)
-#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D)
-#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage)
-#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd)
-#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf)
-#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd)
-#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf)
-#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d)
-#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv)
-#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f)
-#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv)
-#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i)
-#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv)
-#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s)
-#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv)
-#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d)
-#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv)
-#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f)
-#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv)
-#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i)
-#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv)
-#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s)
-#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv)
-#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d)
-#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv)
-#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f)
-#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv)
-#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i)
-#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv)
-#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s)
-#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv)
-#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d)
-#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv)
-#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f)
-#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv)
-#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i)
-#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv)
-#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s)
-#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv)
-#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage)
-
-#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3)
-
-#endif /* GL_VERSION_1_3 */
-
-/* ----------------------------- GL_VERSION_1_4 ---------------------------- */
-
-#ifndef GL_VERSION_1_4
-#define GL_VERSION_1_4 1
-
-#define GL_BLEND_DST_RGB 0x80C8
-#define GL_BLEND_SRC_RGB 0x80C9
-#define GL_BLEND_DST_ALPHA 0x80CA
-#define GL_BLEND_SRC_ALPHA 0x80CB
-#define GL_POINT_SIZE_MIN 0x8126
-#define GL_POINT_SIZE_MAX 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION 0x8129
-#define GL_GENERATE_MIPMAP 0x8191
-#define GL_GENERATE_MIPMAP_HINT 0x8192
-#define GL_DEPTH_COMPONENT16 0x81A5
-#define GL_DEPTH_COMPONENT24 0x81A6
-#define GL_DEPTH_COMPONENT32 0x81A7
-#define GL_MIRRORED_REPEAT 0x8370
-#define GL_FOG_COORDINATE_SOURCE 0x8450
-#define GL_FOG_COORDINATE 0x8451
-#define GL_FRAGMENT_DEPTH 0x8452
-#define GL_CURRENT_FOG_COORDINATE 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456
-#define GL_FOG_COORDINATE_ARRAY 0x8457
-#define GL_COLOR_SUM 0x8458
-#define GL_CURRENT_SECONDARY_COLOR 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D
-#define GL_SECONDARY_COLOR_ARRAY 0x845E
-#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL 0x8500
-#define GL_TEXTURE_LOD_BIAS 0x8501
-#define GL_INCR_WRAP 0x8507
-#define GL_DECR_WRAP 0x8508
-#define GL_TEXTURE_DEPTH_SIZE 0x884A
-#define GL_DEPTH_TEXTURE_MODE 0x884B
-#define GL_TEXTURE_COMPARE_MODE 0x884C
-#define GL_TEXTURE_COMPARE_FUNC 0x884D
-#define GL_COMPARE_R_TO_TEXTURE 0x884E
-
-typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei drawcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei drawcount);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p);
-
-#define glBlendColor GLEW_GET_FUN(__glewBlendColor)
-#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation)
-#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate)
-#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer)
-#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd)
-#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv)
-#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf)
-#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv)
-#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays)
-#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements)
-#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf)
-#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv)
-#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri)
-#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv)
-#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b)
-#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv)
-#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d)
-#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv)
-#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f)
-#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv)
-#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i)
-#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv)
-#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s)
-#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv)
-#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub)
-#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv)
-#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui)
-#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv)
-#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us)
-#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv)
-#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer)
-#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d)
-#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv)
-#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f)
-#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv)
-#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i)
-#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv)
-#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s)
-#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv)
-#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d)
-#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv)
-#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f)
-#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv)
-#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i)
-#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv)
-#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s)
-#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv)
-
-#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4)
-
-#endif /* GL_VERSION_1_4 */
-
-/* ----------------------------- GL_VERSION_1_5 ---------------------------- */
-
-#ifndef GL_VERSION_1_5
-#define GL_VERSION_1_5 1
-
-#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE
-#define GL_FOG_COORD GL_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY
-#define GL_SRC0_RGB GL_SOURCE0_RGB
-#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER
-#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE
-#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA
-#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE
-#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE
-#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA
-#define GL_SRC1_RGB GL_SOURCE1_RGB
-#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING
-#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA
-#define GL_SRC2_RGB GL_SOURCE2_RGB
-#define GL_BUFFER_SIZE 0x8764
-#define GL_BUFFER_USAGE 0x8765
-#define GL_QUERY_COUNTER_BITS 0x8864
-#define GL_CURRENT_QUERY 0x8865
-#define GL_QUERY_RESULT 0x8866
-#define GL_QUERY_RESULT_AVAILABLE 0x8867
-#define GL_ARRAY_BUFFER 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER 0x8893
-#define GL_ARRAY_BUFFER_BINDING 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
-#define GL_READ_ONLY 0x88B8
-#define GL_WRITE_ONLY 0x88B9
-#define GL_READ_WRITE 0x88BA
-#define GL_BUFFER_ACCESS 0x88BB
-#define GL_BUFFER_MAPPED 0x88BC
-#define GL_BUFFER_MAP_POINTER 0x88BD
-#define GL_STREAM_DRAW 0x88E0
-#define GL_STREAM_READ 0x88E1
-#define GL_STREAM_COPY 0x88E2
-#define GL_STATIC_DRAW 0x88E4
-#define GL_STATIC_READ 0x88E5
-#define GL_STATIC_COPY 0x88E6
-#define GL_DYNAMIC_DRAW 0x88E8
-#define GL_DYNAMIC_READ 0x88E9
-#define GL_DYNAMIC_COPY 0x88EA
-#define GL_SAMPLES_PASSED 0x8914
-
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id);
-typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target);
-
-#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery)
-#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer)
-#define glBufferData GLEW_GET_FUN(__glewBufferData)
-#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData)
-#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers)
-#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries)
-#define glEndQuery GLEW_GET_FUN(__glewEndQuery)
-#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers)
-#define glGenQueries GLEW_GET_FUN(__glewGenQueries)
-#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv)
-#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv)
-#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData)
-#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv)
-#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv)
-#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv)
-#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer)
-#define glIsQuery GLEW_GET_FUN(__glewIsQuery)
-#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer)
-#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer)
-
-#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5)
-
-#endif /* GL_VERSION_1_5 */
-
-/* ----------------------------- GL_VERSION_2_0 ---------------------------- */
-
-#ifndef GL_VERSION_2_0
-#define GL_VERSION_2_0 1
-
-#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB 0x8626
-#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
-#define GL_STENCIL_BACK_FUNC 0x8800
-#define GL_STENCIL_BACK_FAIL 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
-#define GL_MAX_DRAW_BUFFERS 0x8824
-#define GL_DRAW_BUFFER0 0x8825
-#define GL_DRAW_BUFFER1 0x8826
-#define GL_DRAW_BUFFER2 0x8827
-#define GL_DRAW_BUFFER3 0x8828
-#define GL_DRAW_BUFFER4 0x8829
-#define GL_DRAW_BUFFER5 0x882A
-#define GL_DRAW_BUFFER6 0x882B
-#define GL_DRAW_BUFFER7 0x882C
-#define GL_DRAW_BUFFER8 0x882D
-#define GL_DRAW_BUFFER9 0x882E
-#define GL_DRAW_BUFFER10 0x882F
-#define GL_DRAW_BUFFER11 0x8830
-#define GL_DRAW_BUFFER12 0x8831
-#define GL_DRAW_BUFFER13 0x8832
-#define GL_DRAW_BUFFER14 0x8833
-#define GL_DRAW_BUFFER15 0x8834
-#define GL_BLEND_EQUATION_ALPHA 0x883D
-#define GL_POINT_SPRITE 0x8861
-#define GL_COORD_REPLACE 0x8862
-#define GL_MAX_VERTEX_ATTRIBS 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
-#define GL_MAX_TEXTURE_COORDS 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A
-#define GL_MAX_VARYING_FLOATS 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
-#define GL_SHADER_TYPE 0x8B4F
-#define GL_FLOAT_VEC2 0x8B50
-#define GL_FLOAT_VEC3 0x8B51
-#define GL_FLOAT_VEC4 0x8B52
-#define GL_INT_VEC2 0x8B53
-#define GL_INT_VEC3 0x8B54
-#define GL_INT_VEC4 0x8B55
-#define GL_BOOL 0x8B56
-#define GL_BOOL_VEC2 0x8B57
-#define GL_BOOL_VEC3 0x8B58
-#define GL_BOOL_VEC4 0x8B59
-#define GL_FLOAT_MAT2 0x8B5A
-#define GL_FLOAT_MAT3 0x8B5B
-#define GL_FLOAT_MAT4 0x8B5C
-#define GL_SAMPLER_1D 0x8B5D
-#define GL_SAMPLER_2D 0x8B5E
-#define GL_SAMPLER_3D 0x8B5F
-#define GL_SAMPLER_CUBE 0x8B60
-#define GL_SAMPLER_1D_SHADOW 0x8B61
-#define GL_SAMPLER_2D_SHADOW 0x8B62
-#define GL_DELETE_STATUS 0x8B80
-#define GL_COMPILE_STATUS 0x8B81
-#define GL_LINK_STATUS 0x8B82
-#define GL_VALIDATE_STATUS 0x8B83
-#define GL_INFO_LOG_LENGTH 0x8B84
-#define GL_ATTACHED_SHADERS 0x8B85
-#define GL_ACTIVE_UNIFORMS 0x8B86
-#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
-#define GL_SHADER_SOURCE_LENGTH 0x8B88
-#define GL_ACTIVE_ATTRIBUTES 0x8B89
-#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B
-#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
-#define GL_CURRENT_PROGRAM 0x8B8D
-#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0
-#define GL_LOWER_LEFT 0x8CA1
-#define GL_UPPER_LEFT 0x8CA2
-#define GL_STENCIL_BACK_REF 0x8CA3
-#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
-#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
-
-typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum);
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader);
-typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders);
-typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
-typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source);
-typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param);
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program);
-typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader);
-typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths);
-typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer);
-
-#define glAttachShader GLEW_GET_FUN(__glewAttachShader)
-#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation)
-#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate)
-#define glCompileShader GLEW_GET_FUN(__glewCompileShader)
-#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram)
-#define glCreateShader GLEW_GET_FUN(__glewCreateShader)
-#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram)
-#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader)
-#define glDetachShader GLEW_GET_FUN(__glewDetachShader)
-#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray)
-#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers)
-#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray)
-#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib)
-#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform)
-#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders)
-#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation)
-#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog)
-#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv)
-#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog)
-#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource)
-#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv)
-#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation)
-#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv)
-#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv)
-#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv)
-#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv)
-#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv)
-#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv)
-#define glIsProgram GLEW_GET_FUN(__glewIsProgram)
-#define glIsShader GLEW_GET_FUN(__glewIsShader)
-#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram)
-#define glShaderSource GLEW_GET_FUN(__glewShaderSource)
-#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate)
-#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate)
-#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate)
-#define glUniform1f GLEW_GET_FUN(__glewUniform1f)
-#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv)
-#define glUniform1i GLEW_GET_FUN(__glewUniform1i)
-#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv)
-#define glUniform2f GLEW_GET_FUN(__glewUniform2f)
-#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv)
-#define glUniform2i GLEW_GET_FUN(__glewUniform2i)
-#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv)
-#define glUniform3f GLEW_GET_FUN(__glewUniform3f)
-#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv)
-#define glUniform3i GLEW_GET_FUN(__glewUniform3i)
-#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv)
-#define glUniform4f GLEW_GET_FUN(__glewUniform4f)
-#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv)
-#define glUniform4i GLEW_GET_FUN(__glewUniform4i)
-#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv)
-#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv)
-#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv)
-#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv)
-#define glUseProgram GLEW_GET_FUN(__glewUseProgram)
-#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram)
-#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d)
-#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv)
-#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f)
-#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv)
-#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s)
-#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv)
-#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d)
-#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv)
-#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f)
-#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv)
-#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s)
-#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv)
-#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d)
-#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv)
-#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f)
-#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv)
-#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s)
-#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv)
-#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv)
-#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv)
-#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv)
-#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub)
-#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv)
-#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv)
-#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv)
-#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv)
-#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d)
-#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv)
-#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f)
-#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv)
-#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv)
-#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s)
-#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv)
-#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv)
-#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv)
-#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv)
-#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer)
-
-#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0)
-
-#endif /* GL_VERSION_2_0 */
-
-/* ----------------------------- GL_VERSION_2_1 ---------------------------- */
-
-#ifndef GL_VERSION_2_1
-#define GL_VERSION_2_1 1
-
-#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F
-#define GL_PIXEL_PACK_BUFFER 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF
-#define GL_FLOAT_MAT2x3 0x8B65
-#define GL_FLOAT_MAT2x4 0x8B66
-#define GL_FLOAT_MAT3x2 0x8B67
-#define GL_FLOAT_MAT3x4 0x8B68
-#define GL_FLOAT_MAT4x2 0x8B69
-#define GL_FLOAT_MAT4x3 0x8B6A
-#define GL_SRGB 0x8C40
-#define GL_SRGB8 0x8C41
-#define GL_SRGB_ALPHA 0x8C42
-#define GL_SRGB8_ALPHA8 0x8C43
-#define GL_SLUMINANCE_ALPHA 0x8C44
-#define GL_SLUMINANCE8_ALPHA8 0x8C45
-#define GL_SLUMINANCE 0x8C46
-#define GL_SLUMINANCE8 0x8C47
-#define GL_COMPRESSED_SRGB 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA 0x8C49
-#define GL_COMPRESSED_SLUMINANCE 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B
-
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
-
-#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv)
-#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv)
-#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv)
-#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv)
-#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv)
-#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv)
-
-#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1)
-
-#endif /* GL_VERSION_2_1 */
-
-/* ----------------------------- GL_VERSION_3_0 ---------------------------- */
-
-#ifndef GL_VERSION_3_0
-#define GL_VERSION_3_0 1
-
-#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES
-#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5
-#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1
-#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3
-#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB
-#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0
-#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4
-#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2
-#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS
-#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001
-#define GL_MAJOR_VERSION 0x821B
-#define GL_MINOR_VERSION 0x821C
-#define GL_NUM_EXTENSIONS 0x821D
-#define GL_CONTEXT_FLAGS 0x821E
-#define GL_DEPTH_BUFFER 0x8223
-#define GL_STENCIL_BUFFER 0x8224
-#define GL_RGBA32F 0x8814
-#define GL_RGB32F 0x8815
-#define GL_RGBA16F 0x881A
-#define GL_RGB16F 0x881B
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD
-#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF
-#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905
-#define GL_CLAMP_VERTEX_COLOR 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR 0x891B
-#define GL_CLAMP_READ_COLOR 0x891C
-#define GL_FIXED_ONLY 0x891D
-#define GL_TEXTURE_RED_TYPE 0x8C10
-#define GL_TEXTURE_GREEN_TYPE 0x8C11
-#define GL_TEXTURE_BLUE_TYPE 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE 0x8C16
-#define GL_TEXTURE_1D_ARRAY 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19
-#define GL_TEXTURE_2D_ARRAY 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D
-#define GL_R11F_G11F_B10F 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-#define GL_RGB9_E5 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE 0x8C3F
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85
-#define GL_PRIMITIVES_GENERATED 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88
-#define GL_RASTERIZER_DISCARD 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS 0x8C8C
-#define GL_SEPARATE_ATTRIBS 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F
-#define GL_RGBA32UI 0x8D70
-#define GL_RGB32UI 0x8D71
-#define GL_RGBA16UI 0x8D76
-#define GL_RGB16UI 0x8D77
-#define GL_RGBA8UI 0x8D7C
-#define GL_RGB8UI 0x8D7D
-#define GL_RGBA32I 0x8D82
-#define GL_RGB32I 0x8D83
-#define GL_RGBA16I 0x8D88
-#define GL_RGB16I 0x8D89
-#define GL_RGBA8I 0x8D8E
-#define GL_RGB8I 0x8D8F
-#define GL_RED_INTEGER 0x8D94
-#define GL_GREEN_INTEGER 0x8D95
-#define GL_BLUE_INTEGER 0x8D96
-#define GL_ALPHA_INTEGER 0x8D97
-#define GL_RGB_INTEGER 0x8D98
-#define GL_RGBA_INTEGER 0x8D99
-#define GL_BGR_INTEGER 0x8D9A
-#define GL_BGRA_INTEGER 0x8D9B
-#define GL_SAMPLER_1D_ARRAY 0x8DC0
-#define GL_SAMPLER_2D_ARRAY 0x8DC1
-#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW 0x8DC5
-#define GL_UNSIGNED_INT_VEC2 0x8DC6
-#define GL_UNSIGNED_INT_VEC3 0x8DC7
-#define GL_UNSIGNED_INT_VEC4 0x8DC8
-#define GL_INT_SAMPLER_1D 0x8DC9
-#define GL_INT_SAMPLER_2D 0x8DCA
-#define GL_INT_SAMPLER_3D 0x8DCB
-#define GL_INT_SAMPLER_CUBE 0x8DCC
-#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF
-#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7
-#define GL_QUERY_WAIT 0x8E13
-#define GL_QUERY_NO_WAIT 0x8E14
-#define GL_QUERY_BY_REGION_WAIT 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16
-
-typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum);
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum);
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*);
-typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean);
-typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*);
-typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*);
-typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*);
-
-#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender)
-#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback)
-#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation)
-#define glClampColor GLEW_GET_FUN(__glewClampColor)
-#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi)
-#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv)
-#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv)
-#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv)
-#define glColorMaski GLEW_GET_FUN(__glewColorMaski)
-#define glDisablei GLEW_GET_FUN(__glewDisablei)
-#define glEnablei GLEW_GET_FUN(__glewEnablei)
-#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender)
-#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback)
-#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v)
-#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation)
-#define glGetStringi GLEW_GET_FUN(__glewGetStringi)
-#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv)
-#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv)
-#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying)
-#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv)
-#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv)
-#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv)
-#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi)
-#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv)
-#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv)
-#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings)
-#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui)
-#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv)
-#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui)
-#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv)
-#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui)
-#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv)
-#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui)
-#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv)
-#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i)
-#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv)
-#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui)
-#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv)
-#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i)
-#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv)
-#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui)
-#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv)
-#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i)
-#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv)
-#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui)
-#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv)
-#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv)
-#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i)
-#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv)
-#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv)
-#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv)
-#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui)
-#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv)
-#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv)
-#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer)
-
-#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0)
-
-#endif /* GL_VERSION_3_0 */
-
-/* ----------------------------- GL_VERSION_3_1 ---------------------------- */
-
-#ifndef GL_VERSION_3_1
-#define GL_VERSION_3_1 1
-
-#define GL_TEXTURE_RECTANGLE 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8
-#define GL_SAMPLER_2D_RECT 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64
-#define GL_TEXTURE_BUFFER 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E
-#define GL_SAMPLER_BUFFER 0x8DC2
-#define GL_INT_SAMPLER_2D_RECT 0x8DCD
-#define GL_INT_SAMPLER_BUFFER 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_PRIMITIVE_RESTART 0x8F9D
-#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E
-#define GL_BUFFER_ACCESS_FLAGS 0x911F
-#define GL_BUFFER_MAP_LENGTH 0x9120
-#define GL_BUFFER_MAP_OFFSET 0x9121
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei);
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint);
-typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint);
-
-#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced)
-#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced)
-#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex)
-#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer)
-
-#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1)
-
-#endif /* GL_VERSION_3_1 */
-
-/* ----------------------------- GL_VERSION_3_2 ---------------------------- */
-
-#ifndef GL_VERSION_3_2
-#define GL_VERSION_3_2 1
-
-#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001
-#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002
-#define GL_LINES_ADJACENCY 0x000A
-#define GL_LINE_STRIP_ADJACENCY 0x000B
-#define GL_TRIANGLES_ADJACENCY 0x000C
-#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D
-#define GL_PROGRAM_POINT_SIZE 0x8642
-#define GL_GEOMETRY_VERTICES_OUT 0x8916
-#define GL_GEOMETRY_INPUT_TYPE 0x8917
-#define GL_GEOMETRY_OUTPUT_TYPE 0x8918
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8
-#define GL_GEOMETRY_SHADER 0x8DD9
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1
-#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122
-#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123
-#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124
-#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125
-#define GL_CONTEXT_PROFILE_MASK 0x9126
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *);
-typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *);
-
-#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture)
-#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v)
-#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v)
-
-#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2)
-
-#endif /* GL_VERSION_3_2 */
-
-/* ----------------------------- GL_VERSION_3_3 ---------------------------- */
-
-#ifndef GL_VERSION_3_3
-#define GL_VERSION_3_3 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE
-#define GL_RGB10_A2UI 0x906F
-
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor);
-
-#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor)
-
-#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3)
-
-#endif /* GL_VERSION_3_3 */
-
-/* ----------------------------- GL_VERSION_4_0 ---------------------------- */
-
-#ifndef GL_VERSION_4_0
-#define GL_VERSION_4_0 1
-
-#define GL_SAMPLE_SHADING 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F
-#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value);
-
-#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei)
-#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi)
-#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei)
-#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci)
-#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading)
-
-#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0)
-
-#endif /* GL_VERSION_4_0 */
-
-/* ----------------------------- GL_VERSION_4_1 ---------------------------- */
-
-#ifndef GL_VERSION_4_1
-#define GL_VERSION_4_1 1
-
-#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1)
-
-#endif /* GL_VERSION_4_1 */
-
-/* ----------------------------- GL_VERSION_4_2 ---------------------------- */
-
-#ifndef GL_VERSION_4_2
-#define GL_VERSION_4_2 1
-
-#define GL_COMPRESSED_RGBA_BPTC_UNORM 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT 0x8E8F
-
-#define GLEW_VERSION_4_2 GLEW_GET_VAR(__GLEW_VERSION_4_2)
-
-#endif /* GL_VERSION_4_2 */
-
-/* ----------------------------- GL_VERSION_4_3 ---------------------------- */
-
-#ifndef GL_VERSION_4_3
-#define GL_VERSION_4_3 1
-
-#define GL_NUM_SHADING_LANGUAGE_VERSIONS 0x82E9
-#define GL_VERTEX_ATTRIB_ARRAY_LONG 0x874E
-
-#define GLEW_VERSION_4_3 GLEW_GET_VAR(__GLEW_VERSION_4_3)
-
-#endif /* GL_VERSION_4_3 */
-
-/* ----------------------------- GL_VERSION_4_4 ---------------------------- */
-
-#ifndef GL_VERSION_4_4
-#define GL_VERSION_4_4 1
-
-#define GL_MAX_VERTEX_ATTRIB_STRIDE 0x82E5
-
-#define GLEW_VERSION_4_4 GLEW_GET_VAR(__GLEW_VERSION_4_4)
-
-#endif /* GL_VERSION_4_4 */
-
-/* -------------------------- GL_3DFX_multisample -------------------------- */
-
-#ifndef GL_3DFX_multisample
-#define GL_3DFX_multisample 1
-
-#define GL_MULTISAMPLE_3DFX 0x86B2
-#define GL_SAMPLE_BUFFERS_3DFX 0x86B3
-#define GL_SAMPLES_3DFX 0x86B4
-#define GL_MULTISAMPLE_BIT_3DFX 0x20000000
-
-#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample)
-
-#endif /* GL_3DFX_multisample */
-
-/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */
-
-#ifndef GL_3DFX_tbuffer
-#define GL_3DFX_tbuffer 1
-
-typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask);
-
-#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX)
-
-#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer)
-
-#endif /* GL_3DFX_tbuffer */
-
-/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */
-
-#ifndef GL_3DFX_texture_compression_FXT1
-#define GL_3DFX_texture_compression_FXT1 1
-
-#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0
-#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1
-
-#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1)
-
-#endif /* GL_3DFX_texture_compression_FXT1 */
-
-/* ----------------------- GL_AMD_blend_minmax_factor ---------------------- */
-
-#ifndef GL_AMD_blend_minmax_factor
-#define GL_AMD_blend_minmax_factor 1
-
-#define GL_FACTOR_MIN_AMD 0x901C
-#define GL_FACTOR_MAX_AMD 0x901D
-
-#define GLEW_AMD_blend_minmax_factor GLEW_GET_VAR(__GLEW_AMD_blend_minmax_factor)
-
-#endif /* GL_AMD_blend_minmax_factor */
-
-/* ----------------------- GL_AMD_conservative_depth ----------------------- */
-
-#ifndef GL_AMD_conservative_depth
-#define GL_AMD_conservative_depth 1
-
-#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth)
-
-#endif /* GL_AMD_conservative_depth */
-
-/* -------------------------- GL_AMD_debug_output -------------------------- */
-
-#ifndef GL_AMD_debug_output
-#define GL_AMD_debug_output 1
-
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147
-#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148
-#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149
-#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A
-#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B
-#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C
-#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D
-#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E
-#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F
-#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150
-
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
-
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, GLvoid *userParam);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const GLchar* buf);
-typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, GLchar* message);
-
-#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD)
-#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD)
-#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD)
-#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD)
-
-#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output)
-
-#endif /* GL_AMD_debug_output */
-
-/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */
-
-#ifndef GL_AMD_depth_clamp_separate
-#define GL_AMD_depth_clamp_separate 1
-
-#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E
-#define GL_DEPTH_CLAMP_FAR_AMD 0x901F
-
-#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate)
-
-#endif /* GL_AMD_depth_clamp_separate */
-
-/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */
-
-#ifndef GL_AMD_draw_buffers_blend
-#define GL_AMD_draw_buffers_blend 1
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-
-#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD)
-#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD)
-#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD)
-#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD)
-
-#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend)
-
-#endif /* GL_AMD_draw_buffers_blend */
-
-/* ---------------------- GL_AMD_interleaved_elements ---------------------- */
-
-#ifndef GL_AMD_interleaved_elements
-#define GL_AMD_interleaved_elements 1
-
-#define GL_RED 0x1903
-#define GL_GREEN 0x1904
-#define GL_BLUE 0x1905
-#define GL_ALPHA 0x1906
-#define GL_RG8UI 0x8238
-#define GL_RG16UI 0x823A
-#define GL_RGBA8UI 0x8D7C
-#define GL_VERTEX_ELEMENT_SWIZZLE_AMD 0x91A4
-#define GL_VERTEX_ID_SWIZZLE_AMD 0x91A5
-
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPARAMETERIAMDPROC) (GLuint index, GLenum pname, GLint param);
-
-#define glVertexAttribParameteriAMD GLEW_GET_FUN(__glewVertexAttribParameteriAMD)
-
-#define GLEW_AMD_interleaved_elements GLEW_GET_VAR(__GLEW_AMD_interleaved_elements)
-
-#endif /* GL_AMD_interleaved_elements */
-
-/* ----------------------- GL_AMD_multi_draw_indirect ---------------------- */
-
-#ifndef GL_AMD_multi_draw_indirect
-#define GL_AMD_multi_draw_indirect 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
-
-#define glMultiDrawArraysIndirectAMD GLEW_GET_FUN(__glewMultiDrawArraysIndirectAMD)
-#define glMultiDrawElementsIndirectAMD GLEW_GET_FUN(__glewMultiDrawElementsIndirectAMD)
-
-#define GLEW_AMD_multi_draw_indirect GLEW_GET_VAR(__GLEW_AMD_multi_draw_indirect)
-
-#endif /* GL_AMD_multi_draw_indirect */
-
-/* ------------------------- GL_AMD_name_gen_delete ------------------------ */
-
-#ifndef GL_AMD_name_gen_delete
-#define GL_AMD_name_gen_delete 1
-
-#define GL_DATA_BUFFER_AMD 0x9151
-#define GL_PERFORMANCE_MONITOR_AMD 0x9152
-#define GL_QUERY_OBJECT_AMD 0x9153
-#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154
-#define GL_SAMPLER_OBJECT_AMD 0x9155
-
-typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names);
-typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name);
-
-#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD)
-#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD)
-#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD)
-
-#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete)
-
-#endif /* GL_AMD_name_gen_delete */
-
-/* ----------------------- GL_AMD_performance_monitor ---------------------- */
-
-#ifndef GL_AMD_performance_monitor
-#define GL_AMD_performance_monitor 1
-
-#define GL_COUNTER_TYPE_AMD 0x8BC0
-#define GL_COUNTER_RANGE_AMD 0x8BC1
-#define GL_UNSIGNED_INT64_AMD 0x8BC2
-#define GL_PERCENTAGE_AMD 0x8BC3
-#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
-#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
-#define GL_PERFMON_RESULT_AMD 0x8BC6
-
-typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);
-typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor);
-typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, GLchar *counterString);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, GLchar *groupString);
-typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups);
-typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList);
-
-#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD)
-#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD)
-#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD)
-#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD)
-#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD)
-#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD)
-#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD)
-#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD)
-#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD)
-#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD)
-#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD)
-
-#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor)
-
-#endif /* GL_AMD_performance_monitor */
-
-/* -------------------------- GL_AMD_pinned_memory ------------------------- */
-
-#ifndef GL_AMD_pinned_memory
-#define GL_AMD_pinned_memory 1
-
-#define GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD 0x9160
-
-#define GLEW_AMD_pinned_memory GLEW_GET_VAR(__GLEW_AMD_pinned_memory)
-
-#endif /* GL_AMD_pinned_memory */
-
-/* ----------------------- GL_AMD_query_buffer_object ---------------------- */
-
-#ifndef GL_AMD_query_buffer_object
-#define GL_AMD_query_buffer_object 1
-
-#define GL_QUERY_BUFFER_AMD 0x9192
-#define GL_QUERY_BUFFER_BINDING_AMD 0x9193
-#define GL_QUERY_RESULT_NO_WAIT_AMD 0x9194
-
-#define GLEW_AMD_query_buffer_object GLEW_GET_VAR(__GLEW_AMD_query_buffer_object)
-
-#endif /* GL_AMD_query_buffer_object */
-
-/* ------------------------ GL_AMD_sample_positions ------------------------ */
-
-#ifndef GL_AMD_sample_positions
-#define GL_AMD_sample_positions 1
-
-#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
-
-typedef void (GLAPIENTRY * PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat* val);
-
-#define glSetMultisamplefvAMD GLEW_GET_FUN(__glewSetMultisamplefvAMD)
-
-#define GLEW_AMD_sample_positions GLEW_GET_VAR(__GLEW_AMD_sample_positions)
-
-#endif /* GL_AMD_sample_positions */
-
-/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */
-
-#ifndef GL_AMD_seamless_cubemap_per_texture
-#define GL_AMD_seamless_cubemap_per_texture 1
-
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F
-
-#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture)
-
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-
-/* ---------------------- GL_AMD_shader_stencil_export --------------------- */
-
-#ifndef GL_AMD_shader_stencil_export
-#define GL_AMD_shader_stencil_export 1
-
-#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export)
-
-#endif /* GL_AMD_shader_stencil_export */
-
-/* ---------------------- GL_AMD_shader_trinary_minmax --------------------- */
-
-#ifndef GL_AMD_shader_trinary_minmax
-#define GL_AMD_shader_trinary_minmax 1
-
-#define GLEW_AMD_shader_trinary_minmax GLEW_GET_VAR(__GLEW_AMD_shader_trinary_minmax)
-
-#endif /* GL_AMD_shader_trinary_minmax */
-
-/* ------------------------- GL_AMD_sparse_texture ------------------------- */
-
-#ifndef GL_AMD_sparse_texture
-#define GL_AMD_sparse_texture 1
-
-#define GL_TEXTURE_STORAGE_SPARSE_BIT_AMD 0x00000001
-#define GL_VIRTUAL_PAGE_SIZE_X_AMD 0x9195
-#define GL_VIRTUAL_PAGE_SIZE_Y_AMD 0x9196
-#define GL_VIRTUAL_PAGE_SIZE_Z_AMD 0x9197
-#define GL_MAX_SPARSE_TEXTURE_SIZE_AMD 0x9198
-#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD 0x9199
-#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS 0x919A
-#define GL_MIN_SPARSE_LEVEL_AMD 0x919B
-#define GL_MIN_LOD_WARNING_AMD 0x919C
-
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGESPARSEAMDPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGESPARSEAMDPROC) (GLuint texture, GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLsizei layers, GLbitfield flags);
-
-#define glTexStorageSparseAMD GLEW_GET_FUN(__glewTexStorageSparseAMD)
-#define glTextureStorageSparseAMD GLEW_GET_FUN(__glewTextureStorageSparseAMD)
-
-#define GLEW_AMD_sparse_texture GLEW_GET_VAR(__GLEW_AMD_sparse_texture)
-
-#endif /* GL_AMD_sparse_texture */
-
-/* ------------------- GL_AMD_stencil_operation_extended ------------------- */
-
-#ifndef GL_AMD_stencil_operation_extended
-#define GL_AMD_stencil_operation_extended 1
-
-#define GL_SET_AMD 0x874A
-#define GL_REPLACE_VALUE_AMD 0x874B
-#define GL_STENCIL_OP_VALUE_AMD 0x874C
-#define GL_STENCIL_BACK_OP_VALUE_AMD 0x874D
-
-typedef void (GLAPIENTRY * PFNGLSTENCILOPVALUEAMDPROC) (GLenum face, GLuint value);
-
-#define glStencilOpValueAMD GLEW_GET_FUN(__glewStencilOpValueAMD)
-
-#define GLEW_AMD_stencil_operation_extended GLEW_GET_VAR(__GLEW_AMD_stencil_operation_extended)
-
-#endif /* GL_AMD_stencil_operation_extended */
-
-/* ------------------------ GL_AMD_texture_texture4 ------------------------ */
-
-#ifndef GL_AMD_texture_texture4
-#define GL_AMD_texture_texture4 1
-
-#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4)
-
-#endif /* GL_AMD_texture_texture4 */
-
-/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */
-
-#ifndef GL_AMD_transform_feedback3_lines_triangles
-#define GL_AMD_transform_feedback3_lines_triangles 1
-
-#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles)
-
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-
-/* ----------------------- GL_AMD_vertex_shader_layer ---------------------- */
-
-#ifndef GL_AMD_vertex_shader_layer
-#define GL_AMD_vertex_shader_layer 1
-
-#define GLEW_AMD_vertex_shader_layer GLEW_GET_VAR(__GLEW_AMD_vertex_shader_layer)
-
-#endif /* GL_AMD_vertex_shader_layer */
-
-/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */
-
-#ifndef GL_AMD_vertex_shader_tessellator
-#define GL_AMD_vertex_shader_tessellator 1
-
-#define GL_SAMPLER_BUFFER_AMD 0x9001
-#define GL_INT_SAMPLER_BUFFER_AMD 0x9002
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003
-#define GL_TESSELLATION_MODE_AMD 0x9004
-#define GL_TESSELLATION_FACTOR_AMD 0x9005
-#define GL_DISCRETE_AMD 0x9006
-#define GL_CONTINUOUS_AMD 0x9007
-
-typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor);
-typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode);
-
-#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD)
-#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD)
-
-#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator)
-
-#endif /* GL_AMD_vertex_shader_tessellator */
-
-/* ------------------ GL_AMD_vertex_shader_viewport_index ------------------ */
-
-#ifndef GL_AMD_vertex_shader_viewport_index
-#define GL_AMD_vertex_shader_viewport_index 1
-
-#define GLEW_AMD_vertex_shader_viewport_index GLEW_GET_VAR(__GLEW_AMD_vertex_shader_viewport_index)
-
-#endif /* GL_AMD_vertex_shader_viewport_index */
-
-/* ------------------------- GL_ANGLE_depth_texture ------------------------ */
-
-#ifndef GL_ANGLE_depth_texture
-#define GL_ANGLE_depth_texture 1
-
-#define GLEW_ANGLE_depth_texture GLEW_GET_VAR(__GLEW_ANGLE_depth_texture)
-
-#endif /* GL_ANGLE_depth_texture */
-
-/* ----------------------- GL_ANGLE_framebuffer_blit ----------------------- */
-
-#ifndef GL_ANGLE_framebuffer_blit
-#define GL_ANGLE_framebuffer_blit 1
-
-#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6
-#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA
-
-typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-
-#define glBlitFramebufferANGLE GLEW_GET_FUN(__glewBlitFramebufferANGLE)
-
-#define GLEW_ANGLE_framebuffer_blit GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_blit)
-
-#endif /* GL_ANGLE_framebuffer_blit */
-
-/* -------------------- GL_ANGLE_framebuffer_multisample ------------------- */
-
-#ifndef GL_ANGLE_framebuffer_multisample
-#define GL_ANGLE_framebuffer_multisample 1
-
-#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56
-#define GL_MAX_SAMPLES_ANGLE 0x8D57
-
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glRenderbufferStorageMultisampleANGLE GLEW_GET_FUN(__glewRenderbufferStorageMultisampleANGLE)
-
-#define GLEW_ANGLE_framebuffer_multisample GLEW_GET_VAR(__GLEW_ANGLE_framebuffer_multisample)
-
-#endif /* GL_ANGLE_framebuffer_multisample */
-
-/* ----------------------- GL_ANGLE_instanced_arrays ----------------------- */
-
-#ifndef GL_ANGLE_instanced_arrays
-#define GL_ANGLE_instanced_arrays 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE 0x88FE
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDANGLEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDANGLEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORANGLEPROC) (GLuint index, GLuint divisor);
-
-#define glDrawArraysInstancedANGLE GLEW_GET_FUN(__glewDrawArraysInstancedANGLE)
-#define glDrawElementsInstancedANGLE GLEW_GET_FUN(__glewDrawElementsInstancedANGLE)
-#define glVertexAttribDivisorANGLE GLEW_GET_FUN(__glewVertexAttribDivisorANGLE)
-
-#define GLEW_ANGLE_instanced_arrays GLEW_GET_VAR(__GLEW_ANGLE_instanced_arrays)
-
-#endif /* GL_ANGLE_instanced_arrays */
-
-/* -------------------- GL_ANGLE_pack_reverse_row_order -------------------- */
-
-#ifndef GL_ANGLE_pack_reverse_row_order
-#define GL_ANGLE_pack_reverse_row_order 1
-
-#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
-
-#define GLEW_ANGLE_pack_reverse_row_order GLEW_GET_VAR(__GLEW_ANGLE_pack_reverse_row_order)
-
-#endif /* GL_ANGLE_pack_reverse_row_order */
-
-/* ------------------------ GL_ANGLE_program_binary ------------------------ */
-
-#ifndef GL_ANGLE_program_binary
-#define GL_ANGLE_program_binary 1
-
-#define GL_PROGRAM_BINARY_ANGLE 0x93A6
-
-#define GLEW_ANGLE_program_binary GLEW_GET_VAR(__GLEW_ANGLE_program_binary)
-
-#endif /* GL_ANGLE_program_binary */
-
-/* ------------------- GL_ANGLE_texture_compression_dxt1 ------------------- */
-
-#ifndef GL_ANGLE_texture_compression_dxt1
-#define GL_ANGLE_texture_compression_dxt1 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
-
-#define GLEW_ANGLE_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt1)
-
-#endif /* GL_ANGLE_texture_compression_dxt1 */
-
-/* ------------------- GL_ANGLE_texture_compression_dxt3 ------------------- */
-
-#ifndef GL_ANGLE_texture_compression_dxt3
-#define GL_ANGLE_texture_compression_dxt3 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
-
-#define GLEW_ANGLE_texture_compression_dxt3 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt3)
-
-#endif /* GL_ANGLE_texture_compression_dxt3 */
-
-/* ------------------- GL_ANGLE_texture_compression_dxt5 ------------------- */
-
-#ifndef GL_ANGLE_texture_compression_dxt5
-#define GL_ANGLE_texture_compression_dxt5 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_ANGLE 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_ANGLE 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE 0x83F3
-
-#define GLEW_ANGLE_texture_compression_dxt5 GLEW_GET_VAR(__GLEW_ANGLE_texture_compression_dxt5)
-
-#endif /* GL_ANGLE_texture_compression_dxt5 */
-
-/* ------------------------- GL_ANGLE_texture_usage ------------------------ */
-
-#ifndef GL_ANGLE_texture_usage
-#define GL_ANGLE_texture_usage 1
-
-#define GL_TEXTURE_USAGE_ANGLE 0x93A2
-#define GL_FRAMEBUFFER_ATTACHMENT_ANGLE 0x93A3
-
-#define GLEW_ANGLE_texture_usage GLEW_GET_VAR(__GLEW_ANGLE_texture_usage)
-
-#endif /* GL_ANGLE_texture_usage */
-
-/* -------------------------- GL_ANGLE_timer_query ------------------------- */
-
-#ifndef GL_ANGLE_timer_query
-#define GL_ANGLE_timer_query 1
-
-#define GL_QUERY_COUNTER_BITS_ANGLE 0x8864
-#define GL_CURRENT_QUERY_ANGLE 0x8865
-#define GL_QUERY_RESULT_ANGLE 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ANGLE 0x8867
-#define GL_TIME_ELAPSED_ANGLE 0x88BF
-#define GL_TIMESTAMP_ANGLE 0x8E28
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYANGLEPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEQUERIESANGLEPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDQUERYANGLEPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENQUERIESANGLEPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VANGLEPROC) (GLuint id, GLenum pname, GLint64* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVANGLEPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VANGLEPROC) (GLuint id, GLenum pname, GLuint64* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVANGLEPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYIVANGLEPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISQUERYANGLEPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERANGLEPROC) (GLuint id, GLenum target);
-
-#define glBeginQueryANGLE GLEW_GET_FUN(__glewBeginQueryANGLE)
-#define glDeleteQueriesANGLE GLEW_GET_FUN(__glewDeleteQueriesANGLE)
-#define glEndQueryANGLE GLEW_GET_FUN(__glewEndQueryANGLE)
-#define glGenQueriesANGLE GLEW_GET_FUN(__glewGenQueriesANGLE)
-#define glGetQueryObjecti64vANGLE GLEW_GET_FUN(__glewGetQueryObjecti64vANGLE)
-#define glGetQueryObjectivANGLE GLEW_GET_FUN(__glewGetQueryObjectivANGLE)
-#define glGetQueryObjectui64vANGLE GLEW_GET_FUN(__glewGetQueryObjectui64vANGLE)
-#define glGetQueryObjectuivANGLE GLEW_GET_FUN(__glewGetQueryObjectuivANGLE)
-#define glGetQueryivANGLE GLEW_GET_FUN(__glewGetQueryivANGLE)
-#define glIsQueryANGLE GLEW_GET_FUN(__glewIsQueryANGLE)
-#define glQueryCounterANGLE GLEW_GET_FUN(__glewQueryCounterANGLE)
-
-#define GLEW_ANGLE_timer_query GLEW_GET_VAR(__GLEW_ANGLE_timer_query)
-
-#endif /* GL_ANGLE_timer_query */
-
-/* ------------------- GL_ANGLE_translated_shader_source ------------------- */
-
-#ifndef GL_ANGLE_translated_shader_source
-#define GL_ANGLE_translated_shader_source 1
-
-#define GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE 0x93A0
-
-typedef void (GLAPIENTRY * PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC) (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
-
-#define glGetTranslatedShaderSourceANGLE GLEW_GET_FUN(__glewGetTranslatedShaderSourceANGLE)
-
-#define GLEW_ANGLE_translated_shader_source GLEW_GET_VAR(__GLEW_ANGLE_translated_shader_source)
-
-#endif /* GL_ANGLE_translated_shader_source */
-
-/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */
-
-#ifndef GL_APPLE_aux_depth_stencil
-#define GL_APPLE_aux_depth_stencil 1
-
-#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14
-
-#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil)
-
-#endif /* GL_APPLE_aux_depth_stencil */
-
-/* ------------------------ GL_APPLE_client_storage ------------------------ */
-
-#ifndef GL_APPLE_client_storage
-#define GL_APPLE_client_storage 1
-
-#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2
-
-#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage)
-
-#endif /* GL_APPLE_client_storage */
-
-/* ------------------------- GL_APPLE_element_array ------------------------ */
-
-#ifndef GL_APPLE_element_array
-#define GL_APPLE_element_array 1
-
-#define GL_ELEMENT_ARRAY_APPLE 0x8A0C
-#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D
-#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount);
-
-#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE)
-#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE)
-#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE)
-#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE)
-#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE)
-
-#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array)
-
-#endif /* GL_APPLE_element_array */
-
-/* ----------------------------- GL_APPLE_fence ---------------------------- */
-
-#ifndef GL_APPLE_fence
-#define GL_APPLE_fence 1
-
-#define GL_DRAW_PIXELS_APPLE 0x8A0A
-#define GL_FENCE_APPLE 0x8A0B
-
-typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name);
-typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences);
-typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name);
-
-#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE)
-#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE)
-#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE)
-#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE)
-#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE)
-#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE)
-#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE)
-#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE)
-
-#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence)
-
-#endif /* GL_APPLE_fence */
-
-/* ------------------------- GL_APPLE_float_pixels ------------------------- */
-
-#ifndef GL_APPLE_float_pixels
-#define GL_APPLE_float_pixels 1
-
-#define GL_HALF_APPLE 0x140B
-#define GL_RGBA_FLOAT32_APPLE 0x8814
-#define GL_RGB_FLOAT32_APPLE 0x8815
-#define GL_ALPHA_FLOAT32_APPLE 0x8816
-#define GL_INTENSITY_FLOAT32_APPLE 0x8817
-#define GL_LUMINANCE_FLOAT32_APPLE 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819
-#define GL_RGBA_FLOAT16_APPLE 0x881A
-#define GL_RGB_FLOAT16_APPLE 0x881B
-#define GL_ALPHA_FLOAT16_APPLE 0x881C
-#define GL_INTENSITY_FLOAT16_APPLE 0x881D
-#define GL_LUMINANCE_FLOAT16_APPLE 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F
-#define GL_COLOR_FLOAT_APPLE 0x8A0F
-
-#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels)
-
-#endif /* GL_APPLE_float_pixels */
-
-/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */
-
-#ifndef GL_APPLE_flush_buffer_range
-#define GL_APPLE_flush_buffer_range 1
-
-#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12
-#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13
-
-typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size);
-
-#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE)
-#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE)
-
-#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range)
-
-#endif /* GL_APPLE_flush_buffer_range */
-
-/* ----------------------- GL_APPLE_object_purgeable ----------------------- */
-
-#ifndef GL_APPLE_object_purgeable
-#define GL_APPLE_object_purgeable 1
-
-#define GL_BUFFER_OBJECT_APPLE 0x85B3
-#define GL_RELEASED_APPLE 0x8A19
-#define GL_VOLATILE_APPLE 0x8A1A
-#define GL_RETAINED_APPLE 0x8A1B
-#define GL_UNDEFINED_APPLE 0x8A1C
-#define GL_PURGEABLE_APPLE 0x8A1D
-
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params);
-typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option);
-
-#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE)
-#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE)
-#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE)
-
-#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable)
-
-#endif /* GL_APPLE_object_purgeable */
-
-/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */
-
-#ifndef GL_APPLE_pixel_buffer
-#define GL_APPLE_pixel_buffer 1
-
-#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10
-
-#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer)
-
-#endif /* GL_APPLE_pixel_buffer */
-
-/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */
-
-#ifndef GL_APPLE_rgb_422
-#define GL_APPLE_rgb_422 1
-
-#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB
-#define GL_RGB_422_APPLE 0x8A1F
-
-#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422)
-
-#endif /* GL_APPLE_rgb_422 */
-
-/* --------------------------- GL_APPLE_row_bytes -------------------------- */
-
-#ifndef GL_APPLE_row_bytes
-#define GL_APPLE_row_bytes 1
-
-#define GL_PACK_ROW_BYTES_APPLE 0x8A15
-#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16
-
-#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes)
-
-#endif /* GL_APPLE_row_bytes */
-
-/* ------------------------ GL_APPLE_specular_vector ----------------------- */
-
-#ifndef GL_APPLE_specular_vector
-#define GL_APPLE_specular_vector 1
-
-#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0
-
-#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector)
-
-#endif /* GL_APPLE_specular_vector */
-
-/* ------------------------- GL_APPLE_texture_range ------------------------ */
-
-#ifndef GL_APPLE_texture_range
-#define GL_APPLE_texture_range 1
-
-#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7
-#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8
-#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC
-#define GL_STORAGE_PRIVATE_APPLE 0x85BD
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params);
-typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-
-#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE)
-#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE)
-
-#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range)
-
-#endif /* GL_APPLE_texture_range */
-
-/* ------------------------ GL_APPLE_transform_hint ------------------------ */
-
-#ifndef GL_APPLE_transform_hint
-#define GL_APPLE_transform_hint 1
-
-#define GL_TRANSFORM_HINT_APPLE 0x85B1
-
-#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint)
-
-#endif /* GL_APPLE_transform_hint */
-
-/* ---------------------- GL_APPLE_vertex_array_object --------------------- */
-
-#ifndef GL_APPLE_vertex_array_object
-#define GL_APPLE_vertex_array_object 1
-
-#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5
-
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);
-typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array);
-
-#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE)
-#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE)
-#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE)
-#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE)
-
-#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object)
-
-#endif /* GL_APPLE_vertex_array_object */
-
-/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */
-
-#ifndef GL_APPLE_vertex_array_range
-#define GL_APPLE_vertex_array_range 1
-
-#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E
-#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521
-#define GL_STORAGE_CLIENT_APPLE 0x85B4
-#define GL_STORAGE_CACHED_APPLE 0x85BE
-#define GL_STORAGE_SHARED_APPLE 0x85BF
-
-typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer);
-
-#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE)
-#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE)
-#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE)
-
-#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range)
-
-#endif /* GL_APPLE_vertex_array_range */
-
-/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */
-
-#ifndef GL_APPLE_vertex_program_evaluators
-#define GL_APPLE_vertex_program_evaluators 1
-
-#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00
-#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01
-#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02
-#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03
-#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04
-#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05
-#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06
-#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07
-#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08
-#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09
-
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points);
-typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points);
-
-#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE)
-#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE)
-#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE)
-#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE)
-#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE)
-#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE)
-#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE)
-
-#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators)
-
-#endif /* GL_APPLE_vertex_program_evaluators */
-
-/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */
-
-#ifndef GL_APPLE_ycbcr_422
-#define GL_APPLE_ycbcr_422 1
-
-#define GL_YCBCR_422_APPLE 0x85B9
-
-#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422)
-
-#endif /* GL_APPLE_ycbcr_422 */
-
-/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */
-
-#ifndef GL_ARB_ES2_compatibility
-#define GL_ARB_ES2_compatibility 1
-
-#define GL_FIXED 0x140C
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
-#define GL_RGB565 0x8D62
-#define GL_LOW_FLOAT 0x8DF0
-#define GL_MEDIUM_FLOAT 0x8DF1
-#define GL_HIGH_FLOAT 0x8DF2
-#define GL_LOW_INT 0x8DF3
-#define GL_MEDIUM_INT 0x8DF4
-#define GL_HIGH_INT 0x8DF5
-#define GL_SHADER_BINARY_FORMATS 0x8DF8
-#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
-#define GL_SHADER_COMPILER 0x8DFA
-#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
-#define GL_MAX_VARYING_VECTORS 0x8DFC
-#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
-
-typedef int GLfixed;
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f);
-typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision);
-typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void);
-typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length);
-
-#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf)
-#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef)
-#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat)
-#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler)
-#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary)
-
-#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility)
-
-#endif /* GL_ARB_ES2_compatibility */
-
-/* ------------------------ GL_ARB_ES3_compatibility ----------------------- */
-
-#ifndef GL_ARB_ES3_compatibility
-#define GL_ARB_ES3_compatibility 1
-
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-#define GL_PRIMITIVE_RESTART_FIXED_INDEX 0x8D69
-#define GL_ANY_SAMPLES_PASSED_CONSERVATIVE 0x8D6A
-#define GL_MAX_ELEMENT_INDEX 0x8D6B
-#define GL_COMPRESSED_R11_EAC 0x9270
-#define GL_COMPRESSED_SIGNED_R11_EAC 0x9271
-#define GL_COMPRESSED_RG11_EAC 0x9272
-#define GL_COMPRESSED_SIGNED_RG11_EAC 0x9273
-#define GL_COMPRESSED_RGB8_ETC2 0x9274
-#define GL_COMPRESSED_SRGB8_ETC2 0x9275
-#define GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9276
-#define GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 0x9277
-#define GL_COMPRESSED_RGBA8_ETC2_EAC 0x9278
-#define GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC 0x9279
-
-#define GLEW_ARB_ES3_compatibility GLEW_GET_VAR(__GLEW_ARB_ES3_compatibility)
-
-#endif /* GL_ARB_ES3_compatibility */
-
-/* ------------------------ GL_ARB_arrays_of_arrays ------------------------ */
-
-#ifndef GL_ARB_arrays_of_arrays
-#define GL_ARB_arrays_of_arrays 1
-
-#define GLEW_ARB_arrays_of_arrays GLEW_GET_VAR(__GLEW_ARB_arrays_of_arrays)
-
-#endif /* GL_ARB_arrays_of_arrays */
-
-/* -------------------------- GL_ARB_base_instance ------------------------- */
-
-#ifndef GL_ARB_base_instance
-#define GL_ARB_base_instance 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLuint baseinstance);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
-
-#define glDrawArraysInstancedBaseInstance GLEW_GET_FUN(__glewDrawArraysInstancedBaseInstance)
-#define glDrawElementsInstancedBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseInstance)
-#define glDrawElementsInstancedBaseVertexBaseInstance GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertexBaseInstance)
-
-#define GLEW_ARB_base_instance GLEW_GET_VAR(__GLEW_ARB_base_instance)
-
-#endif /* GL_ARB_base_instance */
-
-/* ------------------------ GL_ARB_bindless_texture ------------------------ */
-
-#ifndef GL_ARB_bindless_texture
-#define GL_ARB_bindless_texture 1
-
-#define GL_UNSIGNED_INT64_ARB 0x140F
-
-typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLEARBPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLEARBPROC) (GLuint texture);
-typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLEARBPROC) (GLuint texture, GLuint sampler);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VARBPROC) (GLuint index, GLenum pname, GLuint64EXT* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTARBPROC) (GLuint64 handle, GLenum access);
-typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTARBPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC) (GLuint program, GLint location, GLuint64 value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values);
-typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64ARBPROC) (GLint location, GLuint64 value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VARBPROC) (GLint location, GLsizei count, const GLuint64* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64ARBPROC) (GLuint index, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VARBPROC) (GLuint index, const GLuint64EXT* v);
-
-#define glGetImageHandleARB GLEW_GET_FUN(__glewGetImageHandleARB)
-#define glGetTextureHandleARB GLEW_GET_FUN(__glewGetTextureHandleARB)
-#define glGetTextureSamplerHandleARB GLEW_GET_FUN(__glewGetTextureSamplerHandleARB)
-#define glGetVertexAttribLui64vARB GLEW_GET_FUN(__glewGetVertexAttribLui64vARB)
-#define glIsImageHandleResidentARB GLEW_GET_FUN(__glewIsImageHandleResidentARB)
-#define glIsTextureHandleResidentARB GLEW_GET_FUN(__glewIsTextureHandleResidentARB)
-#define glMakeImageHandleNonResidentARB GLEW_GET_FUN(__glewMakeImageHandleNonResidentARB)
-#define glMakeImageHandleResidentARB GLEW_GET_FUN(__glewMakeImageHandleResidentARB)
-#define glMakeTextureHandleNonResidentARB GLEW_GET_FUN(__glewMakeTextureHandleNonResidentARB)
-#define glMakeTextureHandleResidentARB GLEW_GET_FUN(__glewMakeTextureHandleResidentARB)
-#define glProgramUniformHandleui64ARB GLEW_GET_FUN(__glewProgramUniformHandleui64ARB)
-#define glProgramUniformHandleui64vARB GLEW_GET_FUN(__glewProgramUniformHandleui64vARB)
-#define glUniformHandleui64ARB GLEW_GET_FUN(__glewUniformHandleui64ARB)
-#define glUniformHandleui64vARB GLEW_GET_FUN(__glewUniformHandleui64vARB)
-#define glVertexAttribL1ui64ARB GLEW_GET_FUN(__glewVertexAttribL1ui64ARB)
-#define glVertexAttribL1ui64vARB GLEW_GET_FUN(__glewVertexAttribL1ui64vARB)
-
-#define GLEW_ARB_bindless_texture GLEW_GET_VAR(__GLEW_ARB_bindless_texture)
-
-#endif /* GL_ARB_bindless_texture */
-
-/* ----------------------- GL_ARB_blend_func_extended ---------------------- */
-
-#ifndef GL_ARB_blend_func_extended
-#define GL_ARB_blend_func_extended 1
-
-#define GL_SRC1_COLOR 0x88F9
-#define GL_ONE_MINUS_SRC1_COLOR 0x88FA
-#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB
-#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const GLchar * name);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const GLchar * name);
-
-#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed)
-#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex)
-
-#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended)
-
-#endif /* GL_ARB_blend_func_extended */
-
-/* ------------------------- GL_ARB_buffer_storage ------------------------- */
-
-#ifndef GL_ARB_buffer_storage
-#define GL_ARB_buffer_storage 1
-
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_PERSISTENT_BIT 0x00000040
-#define GL_MAP_COHERENT_BIT 0x00000080
-#define GL_DYNAMIC_STORAGE_BIT 0x0100
-#define GL_CLIENT_STORAGE_BIT 0x0200
-#define GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT 0x00004000
-#define GL_BUFFER_IMMUTABLE_STORAGE 0x821F
-#define GL_BUFFER_STORAGE_FLAGS 0x8220
-
-typedef void (GLAPIENTRY * PFNGLBUFFERSTORAGEPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLbitfield flags);
-typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSTORAGEEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid* data, GLbitfield flags);
-
-#define glBufferStorage GLEW_GET_FUN(__glewBufferStorage)
-#define glNamedBufferStorageEXT GLEW_GET_FUN(__glewNamedBufferStorageEXT)
-
-#define GLEW_ARB_buffer_storage GLEW_GET_VAR(__GLEW_ARB_buffer_storage)
-
-#endif /* GL_ARB_buffer_storage */
-
-/* ---------------------------- GL_ARB_cl_event ---------------------------- */
-
-#ifndef GL_ARB_cl_event
-#define GL_ARB_cl_event 1
-
-#define GL_SYNC_CL_EVENT_ARB 0x8240
-#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241
-
-typedef struct _cl_context *cl_context;
-typedef struct _cl_event *cl_event;
-
-typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags);
-
-#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB)
-
-#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event)
-
-#endif /* GL_ARB_cl_event */
-
-/* ----------------------- GL_ARB_clear_buffer_object ---------------------- */
-
-#ifndef GL_ARB_clear_buffer_object
-#define GL_ARB_clear_buffer_object 1
-
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERDATAPROC) (GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLCLEARBUFFERSUBDATAPROC) (GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid* data);
-
-#define glClearBufferData GLEW_GET_FUN(__glewClearBufferData)
-#define glClearBufferSubData GLEW_GET_FUN(__glewClearBufferSubData)
-#define glClearNamedBufferDataEXT GLEW_GET_FUN(__glewClearNamedBufferDataEXT)
-#define glClearNamedBufferSubDataEXT GLEW_GET_FUN(__glewClearNamedBufferSubDataEXT)
-
-#define GLEW_ARB_clear_buffer_object GLEW_GET_VAR(__GLEW_ARB_clear_buffer_object)
-
-#endif /* GL_ARB_clear_buffer_object */
-
-/* -------------------------- GL_ARB_clear_texture ------------------------- */
-
-#ifndef GL_ARB_clear_texture
-#define GL_ARB_clear_texture 1
-
-#define GL_CLEAR_TEXTURE 0x9365
-
-typedef void (GLAPIENTRY * PFNGLCLEARTEXIMAGEPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid* data);
-typedef void (GLAPIENTRY * PFNGLCLEARTEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data);
-
-#define glClearTexImage GLEW_GET_FUN(__glewClearTexImage)
-#define glClearTexSubImage GLEW_GET_FUN(__glewClearTexSubImage)
-
-#define GLEW_ARB_clear_texture GLEW_GET_VAR(__GLEW_ARB_clear_texture)
-
-#endif /* GL_ARB_clear_texture */
-
-/* ----------------------- GL_ARB_color_buffer_float ----------------------- */
-
-#ifndef GL_ARB_color_buffer_float
-#define GL_ARB_color_buffer_float 1
-
-#define GL_RGBA_FLOAT_MODE_ARB 0x8820
-#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A
-#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B
-#define GL_CLAMP_READ_COLOR_ARB 0x891C
-#define GL_FIXED_ONLY_ARB 0x891D
-
-typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp);
-
-#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB)
-
-#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float)
-
-#endif /* GL_ARB_color_buffer_float */
-
-/* -------------------------- GL_ARB_compatibility ------------------------- */
-
-#ifndef GL_ARB_compatibility
-#define GL_ARB_compatibility 1
-
-#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility)
-
-#endif /* GL_ARB_compatibility */
-
-/* ---------------- GL_ARB_compressed_texture_pixel_storage ---------------- */
-
-#ifndef GL_ARB_compressed_texture_pixel_storage
-#define GL_ARB_compressed_texture_pixel_storage 1
-
-#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
-#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
-#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
-#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
-#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
-#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
-#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
-#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
-
-#define GLEW_ARB_compressed_texture_pixel_storage GLEW_GET_VAR(__GLEW_ARB_compressed_texture_pixel_storage)
-
-#endif /* GL_ARB_compressed_texture_pixel_storage */
-
-/* ------------------------- GL_ARB_compute_shader ------------------------- */
-
-#ifndef GL_ARB_compute_shader
-#define GL_ARB_compute_shader 1
-
-#define GL_COMPUTE_SHADER_BIT 0x00000020
-#define GL_MAX_COMPUTE_SHARED_MEMORY_SIZE 0x8262
-#define GL_MAX_COMPUTE_UNIFORM_COMPONENTS 0x8263
-#define GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS 0x8264
-#define GL_MAX_COMPUTE_ATOMIC_COUNTERS 0x8265
-#define GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS 0x8266
-#define GL_COMPUTE_WORK_GROUP_SIZE 0x8267
-#define GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS 0x90EB
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER 0x90EC
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER 0x90ED
-#define GL_DISPATCH_INDIRECT_BUFFER 0x90EE
-#define GL_DISPATCH_INDIRECT_BUFFER_BINDING 0x90EF
-#define GL_COMPUTE_SHADER 0x91B9
-#define GL_MAX_COMPUTE_UNIFORM_BLOCKS 0x91BB
-#define GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS 0x91BC
-#define GL_MAX_COMPUTE_IMAGE_UNIFORMS 0x91BD
-#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE
-#define GL_MAX_COMPUTE_WORK_GROUP_SIZE 0x91BF
-
-typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
-typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEINDIRECTPROC) (GLintptr indirect);
-
-#define glDispatchCompute GLEW_GET_FUN(__glewDispatchCompute)
-#define glDispatchComputeIndirect GLEW_GET_FUN(__glewDispatchComputeIndirect)
-
-#define GLEW_ARB_compute_shader GLEW_GET_VAR(__GLEW_ARB_compute_shader)
-
-#endif /* GL_ARB_compute_shader */
-
-/* ------------------- GL_ARB_compute_variable_group_size ------------------ */
-
-#ifndef GL_ARB_compute_variable_group_size
-#define GL_ARB_compute_variable_group_size 1
-
-#define GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB 0x90EB
-#define GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB 0x91BF
-#define GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB 0x9344
-#define GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB 0x9345
-
-typedef void (GLAPIENTRY * PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC) (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z);
-
-#define glDispatchComputeGroupSizeARB GLEW_GET_FUN(__glewDispatchComputeGroupSizeARB)
-
-#define GLEW_ARB_compute_variable_group_size GLEW_GET_VAR(__GLEW_ARB_compute_variable_group_size)
-
-#endif /* GL_ARB_compute_variable_group_size */
-
-/* ----------------------- GL_ARB_conservative_depth ----------------------- */
-
-#ifndef GL_ARB_conservative_depth
-#define GL_ARB_conservative_depth 1
-
-#define GLEW_ARB_conservative_depth GLEW_GET_VAR(__GLEW_ARB_conservative_depth)
-
-#endif /* GL_ARB_conservative_depth */
-
-/* --------------------------- GL_ARB_copy_buffer -------------------------- */
-
-#ifndef GL_ARB_copy_buffer
-#define GL_ARB_copy_buffer 1
-
-#define GL_COPY_READ_BUFFER 0x8F36
-#define GL_COPY_WRITE_BUFFER 0x8F37
-
-typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
-
-#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData)
-
-#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer)
-
-#endif /* GL_ARB_copy_buffer */
-
-/* --------------------------- GL_ARB_copy_image --------------------------- */
-
-#ifndef GL_ARB_copy_image
-#define GL_ARB_copy_image 1
-
-typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATAPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth);
-
-#define glCopyImageSubData GLEW_GET_FUN(__glewCopyImageSubData)
-
-#define GLEW_ARB_copy_image GLEW_GET_VAR(__GLEW_ARB_copy_image)
-
-#endif /* GL_ARB_copy_image */
-
-/* -------------------------- GL_ARB_debug_output -------------------------- */
-
-#ifndef GL_ARB_debug_output
-#define GL_ARB_debug_output 1
-
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245
-#define GL_DEBUG_SOURCE_API_ARB 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A
-#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B
-#define GL_DEBUG_TYPE_ERROR_ARB 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250
-#define GL_DEBUG_TYPE_OTHER_ARB 0x8251
-#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145
-#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147
-#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148
-
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
-
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, const GLvoid *userParam);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf);
-typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog);
-
-#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB)
-#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB)
-#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB)
-#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB)
-
-#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output)
-
-#endif /* GL_ARB_debug_output */
-
-/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */
-
-#ifndef GL_ARB_depth_buffer_float
-#define GL_ARB_depth_buffer_float 1
-
-#define GL_DEPTH_COMPONENT32F 0x8CAC
-#define GL_DEPTH32F_STENCIL8 0x8CAD
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD
-
-#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float)
-
-#endif /* GL_ARB_depth_buffer_float */
-
-/* --------------------------- GL_ARB_depth_clamp -------------------------- */
-
-#ifndef GL_ARB_depth_clamp
-#define GL_ARB_depth_clamp 1
-
-#define GL_DEPTH_CLAMP 0x864F
-
-#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp)
-
-#endif /* GL_ARB_depth_clamp */
-
-/* -------------------------- GL_ARB_depth_texture ------------------------- */
-
-#ifndef GL_ARB_depth_texture
-#define GL_ARB_depth_texture 1
-
-#define GL_DEPTH_COMPONENT16_ARB 0x81A5
-#define GL_DEPTH_COMPONENT24_ARB 0x81A6
-#define GL_DEPTH_COMPONENT32_ARB 0x81A7
-#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A
-#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B
-
-#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture)
-
-#endif /* GL_ARB_depth_texture */
-
-/* -------------------------- GL_ARB_draw_buffers -------------------------- */
-
-#ifndef GL_ARB_draw_buffers
-#define GL_ARB_draw_buffers 1
-
-#define GL_MAX_DRAW_BUFFERS_ARB 0x8824
-#define GL_DRAW_BUFFER0_ARB 0x8825
-#define GL_DRAW_BUFFER1_ARB 0x8826
-#define GL_DRAW_BUFFER2_ARB 0x8827
-#define GL_DRAW_BUFFER3_ARB 0x8828
-#define GL_DRAW_BUFFER4_ARB 0x8829
-#define GL_DRAW_BUFFER5_ARB 0x882A
-#define GL_DRAW_BUFFER6_ARB 0x882B
-#define GL_DRAW_BUFFER7_ARB 0x882C
-#define GL_DRAW_BUFFER8_ARB 0x882D
-#define GL_DRAW_BUFFER9_ARB 0x882E
-#define GL_DRAW_BUFFER10_ARB 0x882F
-#define GL_DRAW_BUFFER11_ARB 0x8830
-#define GL_DRAW_BUFFER12_ARB 0x8831
-#define GL_DRAW_BUFFER13_ARB 0x8832
-#define GL_DRAW_BUFFER14_ARB 0x8833
-#define GL_DRAW_BUFFER15_ARB 0x8834
-
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs);
-
-#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB)
-
-#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers)
-
-#endif /* GL_ARB_draw_buffers */
-
-/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */
-
-#ifndef GL_ARB_draw_buffers_blend
-#define GL_ARB_draw_buffers_blend 1
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst);
-
-#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB)
-#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB)
-#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB)
-#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB)
-
-#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend)
-
-#endif /* GL_ARB_draw_buffers_blend */
-
-/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */
-
-#ifndef GL_ARB_draw_elements_base_vertex
-#define GL_ARB_draw_elements_base_vertex 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid* const *indices, GLsizei primcount, const GLint *basevertex);
-
-#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex)
-#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex)
-#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex)
-#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex)
-
-#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex)
-
-#endif /* GL_ARB_draw_elements_base_vertex */
-
-/* -------------------------- GL_ARB_draw_indirect ------------------------- */
-
-#ifndef GL_ARB_draw_indirect
-#define GL_ARB_draw_indirect 1
-
-#define GL_DRAW_INDIRECT_BUFFER 0x8F3F
-#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect);
-
-#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect)
-#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect)
-
-#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect)
-
-#endif /* GL_ARB_draw_indirect */
-
-/* ------------------------- GL_ARB_draw_instanced ------------------------- */
-
-#ifndef GL_ARB_draw_instanced
-#define GL_ARB_draw_instanced 1
-
-#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced)
-
-#endif /* GL_ARB_draw_instanced */
-
-/* ------------------------ GL_ARB_enhanced_layouts ------------------------ */
-
-#ifndef GL_ARB_enhanced_layouts
-#define GL_ARB_enhanced_layouts 1
-
-#define GL_LOCATION_COMPONENT 0x934A
-#define GL_TRANSFORM_FEEDBACK_BUFFER_INDEX 0x934B
-#define GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE 0x934C
-
-#define GLEW_ARB_enhanced_layouts GLEW_GET_VAR(__GLEW_ARB_enhanced_layouts)
-
-#endif /* GL_ARB_enhanced_layouts */
-
-/* -------------------- GL_ARB_explicit_attrib_location -------------------- */
-
-#ifndef GL_ARB_explicit_attrib_location
-#define GL_ARB_explicit_attrib_location 1
-
-#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location)
-
-#endif /* GL_ARB_explicit_attrib_location */
-
-/* -------------------- GL_ARB_explicit_uniform_location ------------------- */
-
-#ifndef GL_ARB_explicit_uniform_location
-#define GL_ARB_explicit_uniform_location 1
-
-#define GL_MAX_UNIFORM_LOCATIONS 0x826E
-
-#define GLEW_ARB_explicit_uniform_location GLEW_GET_VAR(__GLEW_ARB_explicit_uniform_location)
-
-#endif /* GL_ARB_explicit_uniform_location */
-
-/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */
-
-#ifndef GL_ARB_fragment_coord_conventions
-#define GL_ARB_fragment_coord_conventions 1
-
-#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions)
-
-#endif /* GL_ARB_fragment_coord_conventions */
-
-/* --------------------- GL_ARB_fragment_layer_viewport -------------------- */
-
-#ifndef GL_ARB_fragment_layer_viewport
-#define GL_ARB_fragment_layer_viewport 1
-
-#define GLEW_ARB_fragment_layer_viewport GLEW_GET_VAR(__GLEW_ARB_fragment_layer_viewport)
-
-#endif /* GL_ARB_fragment_layer_viewport */
-
-/* ------------------------ GL_ARB_fragment_program ------------------------ */
-
-#ifndef GL_ARB_fragment_program
-#define GL_ARB_fragment_program 1
-
-#define GL_FRAGMENT_PROGRAM_ARB 0x8804
-#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805
-#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806
-#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807
-#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808
-#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809
-#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A
-#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B
-#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C
-#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D
-#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E
-#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F
-#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810
-#define GL_MAX_TEXTURE_COORDS_ARB 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872
-
-#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program)
-
-#endif /* GL_ARB_fragment_program */
-
-/* --------------------- GL_ARB_fragment_program_shadow -------------------- */
-
-#ifndef GL_ARB_fragment_program_shadow
-#define GL_ARB_fragment_program_shadow 1
-
-#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow)
-
-#endif /* GL_ARB_fragment_program_shadow */
-
-/* ------------------------- GL_ARB_fragment_shader ------------------------ */
-
-#ifndef GL_ARB_fragment_shader
-#define GL_ARB_fragment_shader 1
-
-#define GL_FRAGMENT_SHADER_ARB 0x8B30
-#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49
-#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B
-
-#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader)
-
-#endif /* GL_ARB_fragment_shader */
-
-/* ------------------- GL_ARB_framebuffer_no_attachments ------------------- */
-
-#ifndef GL_ARB_framebuffer_no_attachments
-#define GL_ARB_framebuffer_no_attachments 1
-
-#define GL_FRAMEBUFFER_DEFAULT_WIDTH 0x9310
-#define GL_FRAMEBUFFER_DEFAULT_HEIGHT 0x9311
-#define GL_FRAMEBUFFER_DEFAULT_LAYERS 0x9312
-#define GL_FRAMEBUFFER_DEFAULT_SAMPLES 0x9313
-#define GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS 0x9314
-#define GL_MAX_FRAMEBUFFER_WIDTH 0x9315
-#define GL_MAX_FRAMEBUFFER_HEIGHT 0x9316
-#define GL_MAX_FRAMEBUFFER_LAYERS 0x9317
-#define GL_MAX_FRAMEBUFFER_SAMPLES 0x9318
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC) (GLuint framebuffer, GLenum pname, GLint param);
-
-#define glFramebufferParameteri GLEW_GET_FUN(__glewFramebufferParameteri)
-#define glGetFramebufferParameteriv GLEW_GET_FUN(__glewGetFramebufferParameteriv)
-#define glGetNamedFramebufferParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferParameterivEXT)
-#define glNamedFramebufferParameteriEXT GLEW_GET_FUN(__glewNamedFramebufferParameteriEXT)
-
-#define GLEW_ARB_framebuffer_no_attachments GLEW_GET_VAR(__GLEW_ARB_framebuffer_no_attachments)
-
-#endif /* GL_ARB_framebuffer_no_attachments */
-
-/* ----------------------- GL_ARB_framebuffer_object ----------------------- */
-
-#ifndef GL_ARB_framebuffer_object
-#define GL_ARB_framebuffer_object 1
-
-#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
-#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210
-#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211
-#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212
-#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213
-#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214
-#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215
-#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216
-#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217
-#define GL_FRAMEBUFFER_DEFAULT 0x8218
-#define GL_FRAMEBUFFER_UNDEFINED 0x8219
-#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A
-#define GL_INDEX 0x8222
-#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
-#define GL_DEPTH_STENCIL 0x84F9
-#define GL_UNSIGNED_INT_24_8 0x84FA
-#define GL_DEPTH24_STENCIL8 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE 0x88F1
-#define GL_UNSIGNED_NORMALIZED 0x8C17
-#define GL_SRGB 0x8C40
-#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_FRAMEBUFFER_BINDING 0x8CA6
-#define GL_RENDERBUFFER_BINDING 0x8CA7
-#define GL_READ_FRAMEBUFFER 0x8CA8
-#define GL_DRAW_FRAMEBUFFER 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA
-#define GL_RENDERBUFFER_SAMPLES 0x8CAB
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF
-#define GL_COLOR_ATTACHMENT0 0x8CE0
-#define GL_COLOR_ATTACHMENT1 0x8CE1
-#define GL_COLOR_ATTACHMENT2 0x8CE2
-#define GL_COLOR_ATTACHMENT3 0x8CE3
-#define GL_COLOR_ATTACHMENT4 0x8CE4
-#define GL_COLOR_ATTACHMENT5 0x8CE5
-#define GL_COLOR_ATTACHMENT6 0x8CE6
-#define GL_COLOR_ATTACHMENT7 0x8CE7
-#define GL_COLOR_ATTACHMENT8 0x8CE8
-#define GL_COLOR_ATTACHMENT9 0x8CE9
-#define GL_COLOR_ATTACHMENT10 0x8CEA
-#define GL_COLOR_ATTACHMENT11 0x8CEB
-#define GL_COLOR_ATTACHMENT12 0x8CEC
-#define GL_COLOR_ATTACHMENT13 0x8CED
-#define GL_COLOR_ATTACHMENT14 0x8CEE
-#define GL_COLOR_ATTACHMENT15 0x8CEF
-#define GL_DEPTH_ATTACHMENT 0x8D00
-#define GL_STENCIL_ATTACHMENT 0x8D20
-#define GL_FRAMEBUFFER 0x8D40
-#define GL_RENDERBUFFER 0x8D41
-#define GL_RENDERBUFFER_WIDTH 0x8D42
-#define GL_RENDERBUFFER_HEIGHT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
-#define GL_STENCIL_INDEX1 0x8D46
-#define GL_STENCIL_INDEX4 0x8D47
-#define GL_STENCIL_INDEX8 0x8D48
-#define GL_STENCIL_INDEX16 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56
-#define GL_MAX_SAMPLES 0x8D57
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
-typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer);
-typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer)
-#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer)
-#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer)
-#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus)
-#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers)
-#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers)
-#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer)
-#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D)
-#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D)
-#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D)
-#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer)
-#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers)
-#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers)
-#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap)
-#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv)
-#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv)
-#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer)
-#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer)
-#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage)
-#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample)
-
-#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object)
-
-#endif /* GL_ARB_framebuffer_object */
-
-/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */
-
-#ifndef GL_ARB_framebuffer_sRGB
-#define GL_ARB_framebuffer_sRGB 1
-
-#define GL_FRAMEBUFFER_SRGB 0x8DB9
-
-#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB)
-
-#endif /* GL_ARB_framebuffer_sRGB */
-
-/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */
-
-#ifndef GL_ARB_geometry_shader4
-#define GL_ARB_geometry_shader4 1
-
-#define GL_LINES_ADJACENCY_ARB 0xA
-#define GL_LINE_STRIP_ADJACENCY_ARB 0xB
-#define GL_TRIANGLES_ADJACENCY_ARB 0xC
-#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD
-#define GL_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9
-#define GL_GEOMETRY_SHADER_ARB 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB)
-#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB)
-#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB)
-#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB)
-
-#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4)
-
-#endif /* GL_ARB_geometry_shader4 */
-
-/* ----------------------- GL_ARB_get_program_binary ----------------------- */
-
-#ifndef GL_ARB_get_program_binary
-#define GL_ARB_get_program_binary 1
-
-#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257
-#define GL_PROGRAM_BINARY_LENGTH 0x8741
-#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE
-#define GL_PROGRAM_BINARY_FORMATS 0x87FF
-
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary)
-#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary)
-#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri)
-
-#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary)
-
-#endif /* GL_ARB_get_program_binary */
-
-/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */
-
-#ifndef GL_ARB_gpu_shader5
-#define GL_ARB_gpu_shader5 1
-
-#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F
-#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C
-#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-
-#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5)
-
-#endif /* GL_ARB_gpu_shader5 */
-
-/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */
-
-#ifndef GL_ARB_gpu_shader_fp64
-#define GL_ARB_gpu_shader_fp64 1
-
-#define GL_DOUBLE_MAT2 0x8F46
-#define GL_DOUBLE_MAT3 0x8F47
-#define GL_DOUBLE_MAT4 0x8F48
-#define GL_DOUBLE_MAT2x3 0x8F49
-#define GL_DOUBLE_MAT2x4 0x8F4A
-#define GL_DOUBLE_MAT3x2 0x8F4B
-#define GL_DOUBLE_MAT3x4 0x8F4C
-#define GL_DOUBLE_MAT4x2 0x8F4D
-#define GL_DOUBLE_MAT4x3 0x8F4E
-#define GL_DOUBLE_VEC2 0x8FFC
-#define GL_DOUBLE_VEC3 0x8FFD
-#define GL_DOUBLE_VEC4 0x8FFE
-
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-
-#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv)
-#define glUniform1d GLEW_GET_FUN(__glewUniform1d)
-#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv)
-#define glUniform2d GLEW_GET_FUN(__glewUniform2d)
-#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv)
-#define glUniform3d GLEW_GET_FUN(__glewUniform3d)
-#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv)
-#define glUniform4d GLEW_GET_FUN(__glewUniform4d)
-#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv)
-#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv)
-#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv)
-#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv)
-#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv)
-#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv)
-#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv)
-#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv)
-#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv)
-#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv)
-
-#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64)
-
-#endif /* GL_ARB_gpu_shader_fp64 */
-
-/* ------------------------ GL_ARB_half_float_pixel ------------------------ */
-
-#ifndef GL_ARB_half_float_pixel
-#define GL_ARB_half_float_pixel 1
-
-#define GL_HALF_FLOAT_ARB 0x140B
-
-#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel)
-
-#endif /* GL_ARB_half_float_pixel */
-
-/* ------------------------ GL_ARB_half_float_vertex ----------------------- */
-
-#ifndef GL_ARB_half_float_vertex
-#define GL_ARB_half_float_vertex 1
-
-#define GL_HALF_FLOAT 0x140B
-
-#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex)
-
-#endif /* GL_ARB_half_float_vertex */
-
-/* ----------------------------- GL_ARB_imaging ---------------------------- */
-
-#ifndef GL_ARB_imaging
-#define GL_ARB_imaging 1
-
-#define GL_CONSTANT_COLOR 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
-#define GL_CONSTANT_ALPHA 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
-#define GL_BLEND_COLOR 0x8005
-#define GL_FUNC_ADD 0x8006
-#define GL_MIN 0x8007
-#define GL_MAX 0x8008
-#define GL_BLEND_EQUATION 0x8009
-#define GL_FUNC_SUBTRACT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT 0x800B
-#define GL_CONVOLUTION_1D 0x8010
-#define GL_CONVOLUTION_2D 0x8011
-#define GL_SEPARABLE_2D 0x8012
-#define GL_CONVOLUTION_BORDER_MODE 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS 0x8015
-#define GL_REDUCE 0x8016
-#define GL_CONVOLUTION_FORMAT 0x8017
-#define GL_CONVOLUTION_WIDTH 0x8018
-#define GL_CONVOLUTION_HEIGHT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023
-#define GL_HISTOGRAM 0x8024
-#define GL_PROXY_HISTOGRAM 0x8025
-#define GL_HISTOGRAM_WIDTH 0x8026
-#define GL_HISTOGRAM_FORMAT 0x8027
-#define GL_HISTOGRAM_RED_SIZE 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C
-#define GL_HISTOGRAM_SINK 0x802D
-#define GL_MINMAX 0x802E
-#define GL_MINMAX_FORMAT 0x802F
-#define GL_MINMAX_SINK 0x8030
-#define GL_TABLE_TOO_LARGE 0x8031
-#define GL_COLOR_MATRIX 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB
-#define GL_COLOR_TABLE 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2
-#define GL_PROXY_COLOR_TABLE 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5
-#define GL_COLOR_TABLE_SCALE 0x80D6
-#define GL_COLOR_TABLE_BIAS 0x80D7
-#define GL_COLOR_TABLE_FORMAT 0x80D8
-#define GL_COLOR_TABLE_WIDTH 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF
-#define GL_IGNORE_BORDER 0x8150
-#define GL_CONSTANT_BORDER 0x8151
-#define GL_WRAP_BORDER 0x8152
-#define GL_REPLICATE_BORDER 0x8153
-#define GL_CONVOLUTION_BORDER_COLOR 0x8154
-
-typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-
-#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable)
-#define glColorTable GLEW_GET_FUN(__glewColorTable)
-#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv)
-#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv)
-#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D)
-#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D)
-#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf)
-#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv)
-#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri)
-#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv)
-#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable)
-#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable)
-#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D)
-#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D)
-#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable)
-#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv)
-#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv)
-#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter)
-#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv)
-#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv)
-#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram)
-#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv)
-#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv)
-#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax)
-#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv)
-#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv)
-#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter)
-#define glHistogram GLEW_GET_FUN(__glewHistogram)
-#define glMinmax GLEW_GET_FUN(__glewMinmax)
-#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram)
-#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax)
-#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D)
-
-#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging)
-
-#endif /* GL_ARB_imaging */
-
-/* ----------------------- GL_ARB_indirect_parameters ---------------------- */
-
-#ifndef GL_ARB_indirect_parameters
-#define GL_ARB_indirect_parameters 1
-
-#define GL_PARAMETER_BUFFER_ARB 0x80EE
-#define GL_PARAMETER_BUFFER_BINDING_ARB 0x80EF
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC) (GLenum mode, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
-
-#define glMultiDrawArraysIndirectCountARB GLEW_GET_FUN(__glewMultiDrawArraysIndirectCountARB)
-#define glMultiDrawElementsIndirectCountARB GLEW_GET_FUN(__glewMultiDrawElementsIndirectCountARB)
-
-#define GLEW_ARB_indirect_parameters GLEW_GET_VAR(__GLEW_ARB_indirect_parameters)
-
-#endif /* GL_ARB_indirect_parameters */
-
-/* ------------------------ GL_ARB_instanced_arrays ------------------------ */
-
-#ifndef GL_ARB_instanced_arrays
-#define GL_ARB_instanced_arrays 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor);
-
-#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB)
-#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB)
-#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB)
-
-#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays)
-
-#endif /* GL_ARB_instanced_arrays */
-
-/* ---------------------- GL_ARB_internalformat_query ---------------------- */
-
-#ifndef GL_ARB_internalformat_query
-#define GL_ARB_internalformat_query 1
-
-#define GL_NUM_SAMPLE_COUNTS 0x9380
-
-typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);
-
-#define glGetInternalformativ GLEW_GET_FUN(__glewGetInternalformativ)
-
-#define GLEW_ARB_internalformat_query GLEW_GET_VAR(__GLEW_ARB_internalformat_query)
-
-#endif /* GL_ARB_internalformat_query */
-
-/* ---------------------- GL_ARB_internalformat_query2 --------------------- */
-
-#ifndef GL_ARB_internalformat_query2
-#define GL_ARB_internalformat_query2 1
-
-#define GL_INTERNALFORMAT_SUPPORTED 0x826F
-#define GL_INTERNALFORMAT_PREFERRED 0x8270
-#define GL_INTERNALFORMAT_RED_SIZE 0x8271
-#define GL_INTERNALFORMAT_GREEN_SIZE 0x8272
-#define GL_INTERNALFORMAT_BLUE_SIZE 0x8273
-#define GL_INTERNALFORMAT_ALPHA_SIZE 0x8274
-#define GL_INTERNALFORMAT_DEPTH_SIZE 0x8275
-#define GL_INTERNALFORMAT_STENCIL_SIZE 0x8276
-#define GL_INTERNALFORMAT_SHARED_SIZE 0x8277
-#define GL_INTERNALFORMAT_RED_TYPE 0x8278
-#define GL_INTERNALFORMAT_GREEN_TYPE 0x8279
-#define GL_INTERNALFORMAT_BLUE_TYPE 0x827A
-#define GL_INTERNALFORMAT_ALPHA_TYPE 0x827B
-#define GL_INTERNALFORMAT_DEPTH_TYPE 0x827C
-#define GL_INTERNALFORMAT_STENCIL_TYPE 0x827D
-#define GL_MAX_WIDTH 0x827E
-#define GL_MAX_HEIGHT 0x827F
-#define GL_MAX_DEPTH 0x8280
-#define GL_MAX_LAYERS 0x8281
-#define GL_MAX_COMBINED_DIMENSIONS 0x8282
-#define GL_COLOR_COMPONENTS 0x8283
-#define GL_DEPTH_COMPONENTS 0x8284
-#define GL_STENCIL_COMPONENTS 0x8285
-#define GL_COLOR_RENDERABLE 0x8286
-#define GL_DEPTH_RENDERABLE 0x8287
-#define GL_STENCIL_RENDERABLE 0x8288
-#define GL_FRAMEBUFFER_RENDERABLE 0x8289
-#define GL_FRAMEBUFFER_RENDERABLE_LAYERED 0x828A
-#define GL_FRAMEBUFFER_BLEND 0x828B
-#define GL_READ_PIXELS 0x828C
-#define GL_READ_PIXELS_FORMAT 0x828D
-#define GL_READ_PIXELS_TYPE 0x828E
-#define GL_TEXTURE_IMAGE_FORMAT 0x828F
-#define GL_TEXTURE_IMAGE_TYPE 0x8290
-#define GL_GET_TEXTURE_IMAGE_FORMAT 0x8291
-#define GL_GET_TEXTURE_IMAGE_TYPE 0x8292
-#define GL_MIPMAP 0x8293
-#define GL_MANUAL_GENERATE_MIPMAP 0x8294
-#define GL_AUTO_GENERATE_MIPMAP 0x8295
-#define GL_COLOR_ENCODING 0x8296
-#define GL_SRGB_READ 0x8297
-#define GL_SRGB_WRITE 0x8298
-#define GL_SRGB_DECODE_ARB 0x8299
-#define GL_FILTER 0x829A
-#define GL_VERTEX_TEXTURE 0x829B
-#define GL_TESS_CONTROL_TEXTURE 0x829C
-#define GL_TESS_EVALUATION_TEXTURE 0x829D
-#define GL_GEOMETRY_TEXTURE 0x829E
-#define GL_FRAGMENT_TEXTURE 0x829F
-#define GL_COMPUTE_TEXTURE 0x82A0
-#define GL_TEXTURE_SHADOW 0x82A1
-#define GL_TEXTURE_GATHER 0x82A2
-#define GL_TEXTURE_GATHER_SHADOW 0x82A3
-#define GL_SHADER_IMAGE_LOAD 0x82A4
-#define GL_SHADER_IMAGE_STORE 0x82A5
-#define GL_SHADER_IMAGE_ATOMIC 0x82A6
-#define GL_IMAGE_TEXEL_SIZE 0x82A7
-#define GL_IMAGE_COMPATIBILITY_CLASS 0x82A8
-#define GL_IMAGE_PIXEL_FORMAT 0x82A9
-#define GL_IMAGE_PIXEL_TYPE 0x82AA
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST 0x82AC
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST 0x82AD
-#define GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE 0x82AE
-#define GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE 0x82AF
-#define GL_TEXTURE_COMPRESSED_BLOCK_WIDTH 0x82B1
-#define GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT 0x82B2
-#define GL_TEXTURE_COMPRESSED_BLOCK_SIZE 0x82B3
-#define GL_CLEAR_BUFFER 0x82B4
-#define GL_TEXTURE_VIEW 0x82B5
-#define GL_VIEW_COMPATIBILITY_CLASS 0x82B6
-#define GL_FULL_SUPPORT 0x82B7
-#define GL_CAVEAT_SUPPORT 0x82B8
-#define GL_IMAGE_CLASS_4_X_32 0x82B9
-#define GL_IMAGE_CLASS_2_X_32 0x82BA
-#define GL_IMAGE_CLASS_1_X_32 0x82BB
-#define GL_IMAGE_CLASS_4_X_16 0x82BC
-#define GL_IMAGE_CLASS_2_X_16 0x82BD
-#define GL_IMAGE_CLASS_1_X_16 0x82BE
-#define GL_IMAGE_CLASS_4_X_8 0x82BF
-#define GL_IMAGE_CLASS_2_X_8 0x82C0
-#define GL_IMAGE_CLASS_1_X_8 0x82C1
-#define GL_IMAGE_CLASS_11_11_10 0x82C2
-#define GL_IMAGE_CLASS_10_10_10_2 0x82C3
-#define GL_VIEW_CLASS_128_BITS 0x82C4
-#define GL_VIEW_CLASS_96_BITS 0x82C5
-#define GL_VIEW_CLASS_64_BITS 0x82C6
-#define GL_VIEW_CLASS_48_BITS 0x82C7
-#define GL_VIEW_CLASS_32_BITS 0x82C8
-#define GL_VIEW_CLASS_24_BITS 0x82C9
-#define GL_VIEW_CLASS_16_BITS 0x82CA
-#define GL_VIEW_CLASS_8_BITS 0x82CB
-#define GL_VIEW_CLASS_S3TC_DXT1_RGB 0x82CC
-#define GL_VIEW_CLASS_S3TC_DXT1_RGBA 0x82CD
-#define GL_VIEW_CLASS_S3TC_DXT3_RGBA 0x82CE
-#define GL_VIEW_CLASS_S3TC_DXT5_RGBA 0x82CF
-#define GL_VIEW_CLASS_RGTC1_RED 0x82D0
-#define GL_VIEW_CLASS_RGTC2_RG 0x82D1
-#define GL_VIEW_CLASS_BPTC_UNORM 0x82D2
-#define GL_VIEW_CLASS_BPTC_FLOAT 0x82D3
-
-typedef void (GLAPIENTRY * PFNGLGETINTERNALFORMATI64VPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64* params);
-
-#define glGetInternalformati64v GLEW_GET_FUN(__glewGetInternalformati64v)
-
-#define GLEW_ARB_internalformat_query2 GLEW_GET_VAR(__GLEW_ARB_internalformat_query2)
-
-#endif /* GL_ARB_internalformat_query2 */
-
-/* ----------------------- GL_ARB_invalidate_subdata ----------------------- */
-
-#ifndef GL_ARB_invalidate_subdata
-#define GL_ARB_invalidate_subdata 1
-
-typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERDATAPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLINVALIDATEBUFFERSUBDATAPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (GLAPIENTRY * PFNGLINVALIDATEFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments);
-typedef void (GLAPIENTRY * PFNGLINVALIDATESUBFRAMEBUFFERPROC) (GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLINVALIDATETEXIMAGEPROC) (GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLINVALIDATETEXSUBIMAGEPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glInvalidateBufferData GLEW_GET_FUN(__glewInvalidateBufferData)
-#define glInvalidateBufferSubData GLEW_GET_FUN(__glewInvalidateBufferSubData)
-#define glInvalidateFramebuffer GLEW_GET_FUN(__glewInvalidateFramebuffer)
-#define glInvalidateSubFramebuffer GLEW_GET_FUN(__glewInvalidateSubFramebuffer)
-#define glInvalidateTexImage GLEW_GET_FUN(__glewInvalidateTexImage)
-#define glInvalidateTexSubImage GLEW_GET_FUN(__glewInvalidateTexSubImage)
-
-#define GLEW_ARB_invalidate_subdata GLEW_GET_VAR(__GLEW_ARB_invalidate_subdata)
-
-#endif /* GL_ARB_invalidate_subdata */
-
-/* ---------------------- GL_ARB_map_buffer_alignment ---------------------- */
-
-#ifndef GL_ARB_map_buffer_alignment
-#define GL_ARB_map_buffer_alignment 1
-
-#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
-
-#define GLEW_ARB_map_buffer_alignment GLEW_GET_VAR(__GLEW_ARB_map_buffer_alignment)
-
-#endif /* GL_ARB_map_buffer_alignment */
-
-/* ------------------------ GL_ARB_map_buffer_range ------------------------ */
-
-#ifndef GL_ARB_map_buffer_range
-#define GL_ARB_map_buffer_range 1
-
-#define GL_MAP_READ_BIT 0x0001
-#define GL_MAP_WRITE_BIT 0x0002
-#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004
-#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008
-#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010
-#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020
-
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
-
-#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange)
-#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange)
-
-#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range)
-
-#endif /* GL_ARB_map_buffer_range */
-
-/* ------------------------- GL_ARB_matrix_palette ------------------------- */
-
-#ifndef GL_ARB_matrix_palette
-#define GL_ARB_matrix_palette 1
-
-#define GL_MATRIX_PALETTE_ARB 0x8840
-#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841
-#define GL_MAX_PALETTE_MATRICES_ARB 0x8842
-#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843
-#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844
-#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845
-#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846
-#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847
-#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848
-#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849
-
-typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices);
-typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices);
-
-#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB)
-#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB)
-#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB)
-#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB)
-#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB)
-
-#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette)
-
-#endif /* GL_ARB_matrix_palette */
-
-/* --------------------------- GL_ARB_multi_bind --------------------------- */
-
-#ifndef GL_ARB_multi_bind
-#define GL_ARB_multi_bind 1
-
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERSBASEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERSRANGEPROC) (GLenum target, GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizeiptr *sizes);
-typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures);
-typedef void (GLAPIENTRY * PFNGLBINDSAMPLERSPROC) (GLuint first, GLsizei count, const GLuint* samplers);
-typedef void (GLAPIENTRY * PFNGLBINDTEXTURESPROC) (GLuint first, GLsizei count, const GLuint* textures);
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERSPROC) (GLuint first, GLsizei count, const GLuint* buffers, const GLintptr *offsets, const GLsizei *strides);
-
-#define glBindBuffersBase GLEW_GET_FUN(__glewBindBuffersBase)
-#define glBindBuffersRange GLEW_GET_FUN(__glewBindBuffersRange)
-#define glBindImageTextures GLEW_GET_FUN(__glewBindImageTextures)
-#define glBindSamplers GLEW_GET_FUN(__glewBindSamplers)
-#define glBindTextures GLEW_GET_FUN(__glewBindTextures)
-#define glBindVertexBuffers GLEW_GET_FUN(__glewBindVertexBuffers)
-
-#define GLEW_ARB_multi_bind GLEW_GET_VAR(__GLEW_ARB_multi_bind)
-
-#endif /* GL_ARB_multi_bind */
-
-/* ----------------------- GL_ARB_multi_draw_indirect ---------------------- */
-
-#ifndef GL_ARB_multi_draw_indirect
-#define GL_ARB_multi_draw_indirect 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
-
-#define glMultiDrawArraysIndirect GLEW_GET_FUN(__glewMultiDrawArraysIndirect)
-#define glMultiDrawElementsIndirect GLEW_GET_FUN(__glewMultiDrawElementsIndirect)
-
-#define GLEW_ARB_multi_draw_indirect GLEW_GET_VAR(__GLEW_ARB_multi_draw_indirect)
-
-#endif /* GL_ARB_multi_draw_indirect */
-
-/* --------------------------- GL_ARB_multisample -------------------------- */
-
-#ifndef GL_ARB_multisample
-#define GL_ARB_multisample 1
-
-#define GL_MULTISAMPLE_ARB 0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F
-#define GL_SAMPLE_COVERAGE_ARB 0x80A0
-#define GL_SAMPLE_BUFFERS_ARB 0x80A8
-#define GL_SAMPLES_ARB 0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB
-#define GL_MULTISAMPLE_BIT_ARB 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert);
-
-#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB)
-
-#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample)
-
-#endif /* GL_ARB_multisample */
-
-/* -------------------------- GL_ARB_multitexture -------------------------- */
-
-#ifndef GL_ARB_multitexture
-#define GL_ARB_multitexture 1
-
-#define GL_TEXTURE0_ARB 0x84C0
-#define GL_TEXTURE1_ARB 0x84C1
-#define GL_TEXTURE2_ARB 0x84C2
-#define GL_TEXTURE3_ARB 0x84C3
-#define GL_TEXTURE4_ARB 0x84C4
-#define GL_TEXTURE5_ARB 0x84C5
-#define GL_TEXTURE6_ARB 0x84C6
-#define GL_TEXTURE7_ARB 0x84C7
-#define GL_TEXTURE8_ARB 0x84C8
-#define GL_TEXTURE9_ARB 0x84C9
-#define GL_TEXTURE10_ARB 0x84CA
-#define GL_TEXTURE11_ARB 0x84CB
-#define GL_TEXTURE12_ARB 0x84CC
-#define GL_TEXTURE13_ARB 0x84CD
-#define GL_TEXTURE14_ARB 0x84CE
-#define GL_TEXTURE15_ARB 0x84CF
-#define GL_TEXTURE16_ARB 0x84D0
-#define GL_TEXTURE17_ARB 0x84D1
-#define GL_TEXTURE18_ARB 0x84D2
-#define GL_TEXTURE19_ARB 0x84D3
-#define GL_TEXTURE20_ARB 0x84D4
-#define GL_TEXTURE21_ARB 0x84D5
-#define GL_TEXTURE22_ARB 0x84D6
-#define GL_TEXTURE23_ARB 0x84D7
-#define GL_TEXTURE24_ARB 0x84D8
-#define GL_TEXTURE25_ARB 0x84D9
-#define GL_TEXTURE26_ARB 0x84DA
-#define GL_TEXTURE27_ARB 0x84DB
-#define GL_TEXTURE28_ARB 0x84DC
-#define GL_TEXTURE29_ARB 0x84DD
-#define GL_TEXTURE30_ARB 0x84DE
-#define GL_TEXTURE31_ARB 0x84DF
-#define GL_ACTIVE_TEXTURE_ARB 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1
-#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2
-
-typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v);
-
-#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB)
-#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB)
-#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB)
-#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB)
-#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB)
-#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB)
-#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB)
-#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB)
-#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB)
-#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB)
-#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB)
-#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB)
-#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB)
-#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB)
-#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB)
-#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB)
-#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB)
-#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB)
-#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB)
-#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB)
-#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB)
-#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB)
-#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB)
-#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB)
-#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB)
-#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB)
-#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB)
-#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB)
-#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB)
-#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB)
-#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB)
-#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB)
-#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB)
-#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB)
-
-#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture)
-
-#endif /* GL_ARB_multitexture */
-
-/* ------------------------- GL_ARB_occlusion_query ------------------------ */
-
-#ifndef GL_ARB_occlusion_query
-#define GL_ARB_occlusion_query 1
-
-#define GL_QUERY_COUNTER_BITS_ARB 0x8864
-#define GL_CURRENT_QUERY_ARB 0x8865
-#define GL_QUERY_RESULT_ARB 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867
-#define GL_SAMPLES_PASSED_ARB 0x8914
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id);
-
-#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB)
-#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB)
-#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB)
-#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB)
-#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB)
-#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB)
-#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB)
-#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB)
-
-#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query)
-
-#endif /* GL_ARB_occlusion_query */
-
-/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */
-
-#ifndef GL_ARB_occlusion_query2
-#define GL_ARB_occlusion_query2 1
-
-#define GL_ANY_SAMPLES_PASSED 0x8C2F
-
-#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2)
-
-#endif /* GL_ARB_occlusion_query2 */
-
-/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */
-
-#ifndef GL_ARB_pixel_buffer_object
-#define GL_ARB_pixel_buffer_object 1
-
-#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF
-
-#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object)
-
-#endif /* GL_ARB_pixel_buffer_object */
-
-/* ------------------------ GL_ARB_point_parameters ------------------------ */
-
-#ifndef GL_ARB_point_parameters
-#define GL_ARB_point_parameters 1
-
-#define GL_POINT_SIZE_MIN_ARB 0x8126
-#define GL_POINT_SIZE_MAX_ARB 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128
-#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params);
-
-#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB)
-#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB)
-
-#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters)
-
-#endif /* GL_ARB_point_parameters */
-
-/* -------------------------- GL_ARB_point_sprite -------------------------- */
-
-#ifndef GL_ARB_point_sprite
-#define GL_ARB_point_sprite 1
-
-#define GL_POINT_SPRITE_ARB 0x8861
-#define GL_COORD_REPLACE_ARB 0x8862
-
-#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite)
-
-#endif /* GL_ARB_point_sprite */
-
-/* --------------------- GL_ARB_program_interface_query -------------------- */
-
-#ifndef GL_ARB_program_interface_query
-#define GL_ARB_program_interface_query 1
-
-#define GL_UNIFORM 0x92E1
-#define GL_UNIFORM_BLOCK 0x92E2
-#define GL_PROGRAM_INPUT 0x92E3
-#define GL_PROGRAM_OUTPUT 0x92E4
-#define GL_BUFFER_VARIABLE 0x92E5
-#define GL_SHADER_STORAGE_BLOCK 0x92E6
-#define GL_IS_PER_PATCH 0x92E7
-#define GL_VERTEX_SUBROUTINE 0x92E8
-#define GL_TESS_CONTROL_SUBROUTINE 0x92E9
-#define GL_TESS_EVALUATION_SUBROUTINE 0x92EA
-#define GL_GEOMETRY_SUBROUTINE 0x92EB
-#define GL_FRAGMENT_SUBROUTINE 0x92EC
-#define GL_COMPUTE_SUBROUTINE 0x92ED
-#define GL_VERTEX_SUBROUTINE_UNIFORM 0x92EE
-#define GL_TESS_CONTROL_SUBROUTINE_UNIFORM 0x92EF
-#define GL_TESS_EVALUATION_SUBROUTINE_UNIFORM 0x92F0
-#define GL_GEOMETRY_SUBROUTINE_UNIFORM 0x92F1
-#define GL_FRAGMENT_SUBROUTINE_UNIFORM 0x92F2
-#define GL_COMPUTE_SUBROUTINE_UNIFORM 0x92F3
-#define GL_TRANSFORM_FEEDBACK_VARYING 0x92F4
-#define GL_ACTIVE_RESOURCES 0x92F5
-#define GL_MAX_NAME_LENGTH 0x92F6
-#define GL_MAX_NUM_ACTIVE_VARIABLES 0x92F7
-#define GL_MAX_NUM_COMPATIBLE_SUBROUTINES 0x92F8
-#define GL_NAME_LENGTH 0x92F9
-#define GL_TYPE 0x92FA
-#define GL_ARRAY_SIZE 0x92FB
-#define GL_OFFSET 0x92FC
-#define GL_BLOCK_INDEX 0x92FD
-#define GL_ARRAY_STRIDE 0x92FE
-#define GL_MATRIX_STRIDE 0x92FF
-#define GL_IS_ROW_MAJOR 0x9300
-#define GL_ATOMIC_COUNTER_BUFFER_INDEX 0x9301
-#define GL_BUFFER_BINDING 0x9302
-#define GL_BUFFER_DATA_SIZE 0x9303
-#define GL_NUM_ACTIVE_VARIABLES 0x9304
-#define GL_ACTIVE_VARIABLES 0x9305
-#define GL_REFERENCED_BY_VERTEX_SHADER 0x9306
-#define GL_REFERENCED_BY_TESS_CONTROL_SHADER 0x9307
-#define GL_REFERENCED_BY_TESS_EVALUATION_SHADER 0x9308
-#define GL_REFERENCED_BY_GEOMETRY_SHADER 0x9309
-#define GL_REFERENCED_BY_FRAGMENT_SHADER 0x930A
-#define GL_REFERENCED_BY_COMPUTE_SHADER 0x930B
-#define GL_TOP_LEVEL_ARRAY_SIZE 0x930C
-#define GL_TOP_LEVEL_ARRAY_STRIDE 0x930D
-#define GL_LOCATION 0x930E
-#define GL_LOCATION_INDEX 0x930F
-
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMINTERFACEIVPROC) (GLuint program, GLenum programInterface, GLenum pname, GLint* params);
-typedef GLuint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name);
-typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONPROC) (GLuint program, GLenum programInterface, const GLchar* name);
-typedef GLint (GLAPIENTRY * PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC) (GLuint program, GLenum programInterface, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCENAMEPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMRESOURCEIVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei *length, GLint *params);
-
-#define glGetProgramInterfaceiv GLEW_GET_FUN(__glewGetProgramInterfaceiv)
-#define glGetProgramResourceIndex GLEW_GET_FUN(__glewGetProgramResourceIndex)
-#define glGetProgramResourceLocation GLEW_GET_FUN(__glewGetProgramResourceLocation)
-#define glGetProgramResourceLocationIndex GLEW_GET_FUN(__glewGetProgramResourceLocationIndex)
-#define glGetProgramResourceName GLEW_GET_FUN(__glewGetProgramResourceName)
-#define glGetProgramResourceiv GLEW_GET_FUN(__glewGetProgramResourceiv)
-
-#define GLEW_ARB_program_interface_query GLEW_GET_VAR(__GLEW_ARB_program_interface_query)
-
-#endif /* GL_ARB_program_interface_query */
-
-/* ------------------------ GL_ARB_provoking_vertex ------------------------ */
-
-#ifndef GL_ARB_provoking_vertex
-#define GL_ARB_provoking_vertex 1
-
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode);
-
-#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex)
-
-#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex)
-
-#endif /* GL_ARB_provoking_vertex */
-
-/* ----------------------- GL_ARB_query_buffer_object ---------------------- */
-
-#ifndef GL_ARB_query_buffer_object
-#define GL_ARB_query_buffer_object 1
-
-#define GL_QUERY_BUFFER_BARRIER_BIT 0x00008000
-#define GL_QUERY_BUFFER 0x9192
-#define GL_QUERY_BUFFER_BINDING 0x9193
-#define GL_QUERY_RESULT_NO_WAIT 0x9194
-
-#define GLEW_ARB_query_buffer_object GLEW_GET_VAR(__GLEW_ARB_query_buffer_object)
-
-#endif /* GL_ARB_query_buffer_object */
-
-/* ------------------ GL_ARB_robust_buffer_access_behavior ----------------- */
-
-#ifndef GL_ARB_robust_buffer_access_behavior
-#define GL_ARB_robust_buffer_access_behavior 1
-
-#define GLEW_ARB_robust_buffer_access_behavior GLEW_GET_VAR(__GLEW_ARB_robust_buffer_access_behavior)
-
-#endif /* GL_ARB_robust_buffer_access_behavior */
-
-/* --------------------------- GL_ARB_robustness --------------------------- */
-
-#ifndef GL_ARB_robustness
-#define GL_ARB_robustness 1
-
-#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253
-#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254
-#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255
-#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GL_NO_RESET_NOTIFICATION_ARB 0x8261
-
-typedef GLenum (GLAPIENTRY * PFNGLGETGRAPHICSRESETSTATUSARBPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table);
-typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img);
-typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image);
-typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);
-typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v);
-typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values);
-typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values);
-typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern);
-typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span);
-typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data);
-
-#define glGetGraphicsResetStatusARB GLEW_GET_FUN(__glewGetGraphicsResetStatusARB)
-#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB)
-#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB)
-#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB)
-#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB)
-#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB)
-#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB)
-#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB)
-#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB)
-#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB)
-#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB)
-#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB)
-#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB)
-#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB)
-#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB)
-#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB)
-#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB)
-#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB)
-#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB)
-#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB)
-
-#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness)
-
-#endif /* GL_ARB_robustness */
-
-/* ---------------- GL_ARB_robustness_application_isolation ---------------- */
-
-#ifndef GL_ARB_robustness_application_isolation
-#define GL_ARB_robustness_application_isolation 1
-
-#define GLEW_ARB_robustness_application_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_application_isolation)
-
-#endif /* GL_ARB_robustness_application_isolation */
-
-/* ---------------- GL_ARB_robustness_share_group_isolation ---------------- */
-
-#ifndef GL_ARB_robustness_share_group_isolation
-#define GL_ARB_robustness_share_group_isolation 1
-
-#define GLEW_ARB_robustness_share_group_isolation GLEW_GET_VAR(__GLEW_ARB_robustness_share_group_isolation)
-
-#endif /* GL_ARB_robustness_share_group_isolation */
-
-/* ------------------------- GL_ARB_sample_shading ------------------------- */
-
-#ifndef GL_ARB_sample_shading
-#define GL_ARB_sample_shading 1
-
-#define GL_SAMPLE_SHADING_ARB 0x8C36
-#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37
-
-typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value);
-
-#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB)
-
-#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading)
-
-#endif /* GL_ARB_sample_shading */
-
-/* ------------------------- GL_ARB_sampler_objects ------------------------ */
-
-#ifndef GL_ARB_sampler_objects
-#define GL_ARB_sampler_objects 1
-
-#define GL_SAMPLER_BINDING 0x8919
-
-typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler);
-typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers);
-typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params);
-
-#define glBindSampler GLEW_GET_FUN(__glewBindSampler)
-#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers)
-#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers)
-#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv)
-#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv)
-#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv)
-#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv)
-#define glIsSampler GLEW_GET_FUN(__glewIsSampler)
-#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv)
-#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv)
-#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf)
-#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv)
-#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri)
-#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv)
-
-#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects)
-
-#endif /* GL_ARB_sampler_objects */
-
-/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */
-
-#ifndef GL_ARB_seamless_cube_map
-#define GL_ARB_seamless_cube_map 1
-
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-
-#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map)
-
-#endif /* GL_ARB_seamless_cube_map */
-
-/* ------------------ GL_ARB_seamless_cubemap_per_texture ------------------ */
-
-#ifndef GL_ARB_seamless_cubemap_per_texture
-#define GL_ARB_seamless_cubemap_per_texture 1
-
-#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F
-
-#define GLEW_ARB_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_ARB_seamless_cubemap_per_texture)
-
-#endif /* GL_ARB_seamless_cubemap_per_texture */
-
-/* --------------------- GL_ARB_separate_shader_objects -------------------- */
-
-#ifndef GL_ARB_separate_shader_objects
-#define GL_ARB_separate_shader_objects 1
-
-#define GL_VERTEX_SHADER_BIT 0x00000001
-#define GL_FRAGMENT_SHADER_BIT 0x00000002
-#define GL_GEOMETRY_SHADER_BIT 0x00000004
-#define GL_TESS_CONTROL_SHADER_BIT 0x00000008
-#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010
-#define GL_PROGRAM_SEPARABLE 0x8258
-#define GL_ACTIVE_PROGRAM 0x8259
-#define GL_PROGRAM_PIPELINE_BINDING 0x825A
-#define GL_ALL_SHADER_BITS 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program);
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const GLchar ** strings);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar *infoLog);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline);
-
-#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram)
-#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline)
-#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv)
-#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines)
-#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines)
-#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog)
-#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv)
-#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline)
-#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d)
-#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv)
-#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f)
-#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv)
-#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i)
-#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv)
-#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui)
-#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv)
-#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d)
-#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv)
-#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f)
-#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv)
-#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i)
-#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv)
-#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui)
-#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv)
-#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d)
-#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv)
-#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f)
-#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv)
-#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i)
-#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv)
-#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui)
-#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv)
-#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d)
-#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv)
-#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f)
-#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv)
-#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i)
-#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv)
-#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui)
-#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv)
-#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv)
-#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv)
-#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv)
-#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv)
-#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv)
-#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv)
-#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv)
-#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv)
-#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv)
-#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv)
-#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv)
-#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv)
-#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv)
-#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv)
-#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv)
-#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv)
-#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv)
-#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv)
-#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages)
-#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline)
-
-#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects)
-
-#endif /* GL_ARB_separate_shader_objects */
-
-/* --------------------- GL_ARB_shader_atomic_counters --------------------- */
-
-#ifndef GL_ARB_shader_atomic_counters
-#define GL_ARB_shader_atomic_counters 1
-
-#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
-#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
-#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
-#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
-#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
-#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
-#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
-#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
-#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
-#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
-#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
-#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
-#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
-#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
-#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
-#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
-#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
-#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
-#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
-
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint* params);
-
-#define glGetActiveAtomicCounterBufferiv GLEW_GET_FUN(__glewGetActiveAtomicCounterBufferiv)
-
-#define GLEW_ARB_shader_atomic_counters GLEW_GET_VAR(__GLEW_ARB_shader_atomic_counters)
-
-#endif /* GL_ARB_shader_atomic_counters */
-
-/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */
-
-#ifndef GL_ARB_shader_bit_encoding
-#define GL_ARB_shader_bit_encoding 1
-
-#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding)
-
-#endif /* GL_ARB_shader_bit_encoding */
-
-/* --------------------- GL_ARB_shader_draw_parameters --------------------- */
-
-#ifndef GL_ARB_shader_draw_parameters
-#define GL_ARB_shader_draw_parameters 1
-
-#define GLEW_ARB_shader_draw_parameters GLEW_GET_VAR(__GLEW_ARB_shader_draw_parameters)
-
-#endif /* GL_ARB_shader_draw_parameters */
-
-/* ------------------------ GL_ARB_shader_group_vote ----------------------- */
-
-#ifndef GL_ARB_shader_group_vote
-#define GL_ARB_shader_group_vote 1
-
-#define GLEW_ARB_shader_group_vote GLEW_GET_VAR(__GLEW_ARB_shader_group_vote)
-
-#endif /* GL_ARB_shader_group_vote */
-
-/* --------------------- GL_ARB_shader_image_load_store -------------------- */
-
-#ifndef GL_ARB_shader_image_load_store
-#define GL_ARB_shader_image_load_store 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
-#define GL_COMMAND_BARRIER_BIT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
-#define GL_MAX_IMAGE_UNITS 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
-#define GL_IMAGE_BINDING_NAME 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED 0x8F3C
-#define GL_IMAGE_BINDING_LAYER 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS 0x8F3E
-#define GL_IMAGE_1D 0x904C
-#define GL_IMAGE_2D 0x904D
-#define GL_IMAGE_3D 0x904E
-#define GL_IMAGE_2D_RECT 0x904F
-#define GL_IMAGE_CUBE 0x9050
-#define GL_IMAGE_BUFFER 0x9051
-#define GL_IMAGE_1D_ARRAY 0x9052
-#define GL_IMAGE_2D_ARRAY 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
-#define GL_INT_IMAGE_1D 0x9057
-#define GL_INT_IMAGE_2D 0x9058
-#define GL_INT_IMAGE_3D 0x9059
-#define GL_INT_IMAGE_2D_RECT 0x905A
-#define GL_INT_IMAGE_CUBE 0x905B
-#define GL_INT_IMAGE_BUFFER 0x905C
-#define GL_INT_IMAGE_1D_ARRAY 0x905D
-#define GL_INT_IMAGE_2D_ARRAY 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
-#define GL_MAX_IMAGE_SAMPLES 0x906D
-#define GL_IMAGE_BINDING_FORMAT 0x906E
-#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
-#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
-#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
-#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
-#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
-#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
-#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
-#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
-#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
-typedef void (GLAPIENTRY * PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
-
-#define glBindImageTexture GLEW_GET_FUN(__glewBindImageTexture)
-#define glMemoryBarrier GLEW_GET_FUN(__glewMemoryBarrier)
-
-#define GLEW_ARB_shader_image_load_store GLEW_GET_VAR(__GLEW_ARB_shader_image_load_store)
-
-#endif /* GL_ARB_shader_image_load_store */
-
-/* ------------------------ GL_ARB_shader_image_size ----------------------- */
-
-#ifndef GL_ARB_shader_image_size
-#define GL_ARB_shader_image_size 1
-
-#define GLEW_ARB_shader_image_size GLEW_GET_VAR(__GLEW_ARB_shader_image_size)
-
-#endif /* GL_ARB_shader_image_size */
-
-/* ------------------------- GL_ARB_shader_objects ------------------------- */
-
-#ifndef GL_ARB_shader_objects
-#define GL_ARB_shader_objects 1
-
-#define GL_PROGRAM_OBJECT_ARB 0x8B40
-#define GL_SHADER_OBJECT_ARB 0x8B48
-#define GL_OBJECT_TYPE_ARB 0x8B4E
-#define GL_OBJECT_SUBTYPE_ARB 0x8B4F
-#define GL_FLOAT_VEC2_ARB 0x8B50
-#define GL_FLOAT_VEC3_ARB 0x8B51
-#define GL_FLOAT_VEC4_ARB 0x8B52
-#define GL_INT_VEC2_ARB 0x8B53
-#define GL_INT_VEC3_ARB 0x8B54
-#define GL_INT_VEC4_ARB 0x8B55
-#define GL_BOOL_ARB 0x8B56
-#define GL_BOOL_VEC2_ARB 0x8B57
-#define GL_BOOL_VEC3_ARB 0x8B58
-#define GL_BOOL_VEC4_ARB 0x8B59
-#define GL_FLOAT_MAT2_ARB 0x8B5A
-#define GL_FLOAT_MAT3_ARB 0x8B5B
-#define GL_FLOAT_MAT4_ARB 0x8B5C
-#define GL_SAMPLER_1D_ARB 0x8B5D
-#define GL_SAMPLER_2D_ARB 0x8B5E
-#define GL_SAMPLER_3D_ARB 0x8B5F
-#define GL_SAMPLER_CUBE_ARB 0x8B60
-#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61
-#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80
-#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81
-#define GL_OBJECT_LINK_STATUS_ARB 0x8B82
-#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83
-#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84
-#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85
-#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86
-#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87
-#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88
-
-typedef char GLcharARB;
-typedef unsigned int GLhandleARB;
-
-typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj);
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj);
-typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void);
-typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType);
-typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj);
-typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
-typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj);
-typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname);
-typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source);
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params);
-typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj);
-typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj);
-typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj);
-
-#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB)
-#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB)
-#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB)
-#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB)
-#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB)
-#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB)
-#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB)
-#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB)
-#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB)
-#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB)
-#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB)
-#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB)
-#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB)
-#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB)
-#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB)
-#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB)
-#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB)
-#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB)
-#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB)
-#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB)
-#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB)
-#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB)
-#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB)
-#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB)
-#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB)
-#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB)
-#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB)
-#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB)
-#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB)
-#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB)
-#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB)
-#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB)
-#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB)
-#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB)
-#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB)
-#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB)
-#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB)
-#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB)
-#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB)
-
-#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects)
-
-#endif /* GL_ARB_shader_objects */
-
-/* ------------------------ GL_ARB_shader_precision ------------------------ */
-
-#ifndef GL_ARB_shader_precision
-#define GL_ARB_shader_precision 1
-
-#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision)
-
-#endif /* GL_ARB_shader_precision */
-
-/* ---------------------- GL_ARB_shader_stencil_export --------------------- */
-
-#ifndef GL_ARB_shader_stencil_export
-#define GL_ARB_shader_stencil_export 1
-
-#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export)
-
-#endif /* GL_ARB_shader_stencil_export */
-
-/* ------------------ GL_ARB_shader_storage_buffer_object ------------------ */
-
-#ifndef GL_ARB_shader_storage_buffer_object
-#define GL_ARB_shader_storage_buffer_object 1
-
-#define GL_SHADER_STORAGE_BARRIER_BIT 0x2000
-#define GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES 0x8F39
-#define GL_SHADER_STORAGE_BUFFER 0x90D2
-#define GL_SHADER_STORAGE_BUFFER_BINDING 0x90D3
-#define GL_SHADER_STORAGE_BUFFER_START 0x90D4
-#define GL_SHADER_STORAGE_BUFFER_SIZE 0x90D5
-#define GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS 0x90D6
-#define GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS 0x90D7
-#define GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS 0x90D8
-#define GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS 0x90D9
-#define GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS 0x90DA
-#define GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS 0x90DB
-#define GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS 0x90DC
-#define GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS 0x90DD
-#define GL_MAX_SHADER_STORAGE_BLOCK_SIZE 0x90DE
-#define GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT 0x90DF
-
-typedef void (GLAPIENTRY * PFNGLSHADERSTORAGEBLOCKBINDINGPROC) (GLuint program, GLuint storageBlockIndex, GLuint storageBlockBinding);
-
-#define glShaderStorageBlockBinding GLEW_GET_FUN(__glewShaderStorageBlockBinding)
-
-#define GLEW_ARB_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_ARB_shader_storage_buffer_object)
-
-#endif /* GL_ARB_shader_storage_buffer_object */
-
-/* ------------------------ GL_ARB_shader_subroutine ----------------------- */
-
-#ifndef GL_ARB_shader_subroutine
-#define GL_ARB_shader_subroutine 1
-
-#define GL_ACTIVE_SUBROUTINES 0x8DE5
-#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6
-#define GL_MAX_SUBROUTINES 0x8DE7
-#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47
-#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48
-#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49
-#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A
-#define GL_COMPATIBLE_SUBROUTINES 0x8E4B
-
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values);
-typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const GLchar* name);
-typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices);
-
-#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName)
-#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName)
-#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv)
-#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv)
-#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex)
-#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation)
-#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv)
-#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv)
-
-#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine)
-
-#endif /* GL_ARB_shader_subroutine */
-
-/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */
-
-#ifndef GL_ARB_shader_texture_lod
-#define GL_ARB_shader_texture_lod 1
-
-#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod)
-
-#endif /* GL_ARB_shader_texture_lod */
-
-/* ---------------------- GL_ARB_shading_language_100 ---------------------- */
-
-#ifndef GL_ARB_shading_language_100
-#define GL_ARB_shading_language_100 1
-
-#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C
-
-#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100)
-
-#endif /* GL_ARB_shading_language_100 */
-
-/* -------------------- GL_ARB_shading_language_420pack -------------------- */
-
-#ifndef GL_ARB_shading_language_420pack
-#define GL_ARB_shading_language_420pack 1
-
-#define GLEW_ARB_shading_language_420pack GLEW_GET_VAR(__GLEW_ARB_shading_language_420pack)
-
-#endif /* GL_ARB_shading_language_420pack */
-
-/* -------------------- GL_ARB_shading_language_include -------------------- */
-
-#ifndef GL_ARB_shading_language_include
-#define GL_ARB_shading_language_include 1
-
-#define GL_SHADER_INCLUDE_ARB 0x8DAE
-#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9
-#define GL_NAMED_STRING_TYPE_ARB 0x8DEA
-
-typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const GLchar* const *path, const GLint *length);
-typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name, GLsizei bufSize, GLint *stringlen, GLchar *string);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const GLchar* name, GLenum pname, GLint *params);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const GLchar* name);
-typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const GLchar* name, GLint stringlen, const GLchar *string);
-
-#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB)
-#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB)
-#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB)
-#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB)
-#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB)
-#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB)
-
-#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include)
-
-#endif /* GL_ARB_shading_language_include */
-
-/* -------------------- GL_ARB_shading_language_packing -------------------- */
-
-#ifndef GL_ARB_shading_language_packing
-#define GL_ARB_shading_language_packing 1
-
-#define GLEW_ARB_shading_language_packing GLEW_GET_VAR(__GLEW_ARB_shading_language_packing)
-
-#endif /* GL_ARB_shading_language_packing */
-
-/* ----------------------------- GL_ARB_shadow ----------------------------- */
-
-#ifndef GL_ARB_shadow
-#define GL_ARB_shadow 1
-
-#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C
-#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D
-#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E
-
-#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow)
-
-#endif /* GL_ARB_shadow */
-
-/* ------------------------- GL_ARB_shadow_ambient ------------------------- */
-
-#ifndef GL_ARB_shadow_ambient
-#define GL_ARB_shadow_ambient 1
-
-#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF
-
-#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient)
-
-#endif /* GL_ARB_shadow_ambient */
-
-/* ------------------------- GL_ARB_sparse_texture ------------------------- */
-
-#ifndef GL_ARB_sparse_texture
-#define GL_ARB_sparse_texture 1
-
-#define GL_VIRTUAL_PAGE_SIZE_X_ARB 0x9195
-#define GL_VIRTUAL_PAGE_SIZE_Y_ARB 0x9196
-#define GL_VIRTUAL_PAGE_SIZE_Z_ARB 0x9197
-#define GL_MAX_SPARSE_TEXTURE_SIZE_ARB 0x9198
-#define GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB 0x9199
-#define GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB 0x919A
-#define GL_TEXTURE_SPARSE_ARB 0x91A6
-#define GL_VIRTUAL_PAGE_SIZE_INDEX_ARB 0x91A7
-#define GL_NUM_VIRTUAL_PAGE_SIZES_ARB 0x91A8
-#define GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB 0x91A9
-#define GL_NUM_SPARSE_LEVELS_ARB 0x91AA
-
-typedef void (GLAPIENTRY * PFNGLTEXPAGECOMMITMENTARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPAGECOMMITMENTEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLboolean commit);
-
-#define glTexPageCommitmentARB GLEW_GET_FUN(__glewTexPageCommitmentARB)
-#define glTexturePageCommitmentEXT GLEW_GET_FUN(__glewTexturePageCommitmentEXT)
-
-#define GLEW_ARB_sparse_texture GLEW_GET_VAR(__GLEW_ARB_sparse_texture)
-
-#endif /* GL_ARB_sparse_texture */
-
-/* ------------------------ GL_ARB_stencil_texturing ----------------------- */
-
-#ifndef GL_ARB_stencil_texturing
-#define GL_ARB_stencil_texturing 1
-
-#define GL_DEPTH_STENCIL_TEXTURE_MODE 0x90EA
-
-#define GLEW_ARB_stencil_texturing GLEW_GET_VAR(__GLEW_ARB_stencil_texturing)
-
-#endif /* GL_ARB_stencil_texturing */
-
-/* ------------------------------ GL_ARB_sync ------------------------------ */
-
-#ifndef GL_ARB_sync
-#define GL_ARB_sync 1
-
-#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001
-#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111
-#define GL_OBJECT_TYPE 0x9112
-#define GL_SYNC_CONDITION 0x9113
-#define GL_SYNC_STATUS 0x9114
-#define GL_SYNC_FLAGS 0x9115
-#define GL_SYNC_FENCE 0x9116
-#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117
-#define GL_UNSIGNALED 0x9118
-#define GL_SIGNALED 0x9119
-#define GL_ALREADY_SIGNALED 0x911A
-#define GL_TIMEOUT_EXPIRED 0x911B
-#define GL_CONDITION_SATISFIED 0x911C
-#define GL_WAIT_FAILED 0x911D
-#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF
-
-typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);
-typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync);
-typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags);
-typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params);
-typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values);
-typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync);
-typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout);
-
-#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync)
-#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync)
-#define glFenceSync GLEW_GET_FUN(__glewFenceSync)
-#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v)
-#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv)
-#define glIsSync GLEW_GET_FUN(__glewIsSync)
-#define glWaitSync GLEW_GET_FUN(__glewWaitSync)
-
-#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync)
-
-#endif /* GL_ARB_sync */
-
-/* ----------------------- GL_ARB_tessellation_shader ---------------------- */
-
-#ifndef GL_ARB_tessellation_shader
-#define GL_ARB_tessellation_shader 1
-
-#define GL_PATCHES 0xE
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1
-#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C
-#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D
-#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E
-#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F
-#define GL_PATCH_VERTICES 0x8E72
-#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73
-#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74
-#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75
-#define GL_TESS_GEN_MODE 0x8E76
-#define GL_TESS_GEN_SPACING 0x8E77
-#define GL_TESS_GEN_VERTEX_ORDER 0x8E78
-#define GL_TESS_GEN_POINT_MODE 0x8E79
-#define GL_ISOLINES 0x8E7A
-#define GL_FRACTIONAL_ODD 0x8E7B
-#define GL_FRACTIONAL_EVEN 0x8E7C
-#define GL_MAX_PATCH_VERTICES 0x8E7D
-#define GL_MAX_TESS_GEN_LEVEL 0x8E7E
-#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F
-#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80
-#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81
-#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82
-#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83
-#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84
-#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85
-#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86
-#define GL_TESS_EVALUATION_SHADER 0x8E87
-#define GL_TESS_CONTROL_SHADER 0x8E88
-#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89
-#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A
-
-typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values);
-typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value);
-
-#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv)
-#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri)
-
-#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader)
-
-#endif /* GL_ARB_tessellation_shader */
-
-/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */
-
-#ifndef GL_ARB_texture_border_clamp
-#define GL_ARB_texture_border_clamp 1
-
-#define GL_CLAMP_TO_BORDER_ARB 0x812D
-
-#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp)
-
-#endif /* GL_ARB_texture_border_clamp */
-
-/* ---------------------- GL_ARB_texture_buffer_object --------------------- */
-
-#ifndef GL_ARB_texture_buffer_object
-#define GL_ARB_texture_buffer_object 1
-
-#define GL_TEXTURE_BUFFER_ARB 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E
-
-typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-
-#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB)
-
-#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object)
-
-#endif /* GL_ARB_texture_buffer_object */
-
-/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */
-
-#ifndef GL_ARB_texture_buffer_object_rgb32
-#define GL_ARB_texture_buffer_object_rgb32 1
-
-#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32)
-
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-
-/* ---------------------- GL_ARB_texture_buffer_range ---------------------- */
-
-#ifndef GL_ARB_texture_buffer_range
-#define GL_ARB_texture_buffer_range 1
-
-#define GL_TEXTURE_BUFFER_OFFSET 0x919D
-#define GL_TEXTURE_BUFFER_SIZE 0x919E
-#define GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT 0x919F
-
-typedef void (GLAPIENTRY * PFNGLTEXBUFFERRANGEPROC) (GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFERRANGEEXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size);
-
-#define glTexBufferRange GLEW_GET_FUN(__glewTexBufferRange)
-#define glTextureBufferRangeEXT GLEW_GET_FUN(__glewTextureBufferRangeEXT)
-
-#define GLEW_ARB_texture_buffer_range GLEW_GET_VAR(__GLEW_ARB_texture_buffer_range)
-
-#endif /* GL_ARB_texture_buffer_range */
-
-/* ----------------------- GL_ARB_texture_compression ---------------------- */
-
-#ifndef GL_ARB_texture_compression
-#define GL_ARB_texture_compression 1
-
-#define GL_COMPRESSED_ALPHA_ARB 0x84E9
-#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA
-#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB
-#define GL_COMPRESSED_INTENSITY_ARB 0x84EC
-#define GL_COMPRESSED_RGB_ARB 0x84ED
-#define GL_COMPRESSED_RGBA_ARB 0x84EE
-#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF
-#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0
-#define GL_TEXTURE_COMPRESSED_ARB 0x86A1
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3
-
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLvoid *img);
-
-#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB)
-#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB)
-#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB)
-#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB)
-#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB)
-#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB)
-#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB)
-
-#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression)
-
-#endif /* GL_ARB_texture_compression */
-
-/* -------------------- GL_ARB_texture_compression_bptc -------------------- */
-
-#ifndef GL_ARB_texture_compression_bptc
-#define GL_ARB_texture_compression_bptc 1
-
-#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
-#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D
-#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E
-#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F
-
-#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc)
-
-#endif /* GL_ARB_texture_compression_bptc */
-
-/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */
-
-#ifndef GL_ARB_texture_compression_rgtc
-#define GL_ARB_texture_compression_rgtc 1
-
-#define GL_COMPRESSED_RED_RGTC1 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC
-#define GL_COMPRESSED_RG_RGTC2 0x8DBD
-#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE
-
-#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc)
-
-#endif /* GL_ARB_texture_compression_rgtc */
-
-/* ------------------------ GL_ARB_texture_cube_map ------------------------ */
-
-#ifndef GL_ARB_texture_cube_map
-#define GL_ARB_texture_cube_map 1
-
-#define GL_NORMAL_MAP_ARB 0x8511
-#define GL_REFLECTION_MAP_ARB 0x8512
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C
-
-#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map)
-
-#endif /* GL_ARB_texture_cube_map */
-
-/* --------------------- GL_ARB_texture_cube_map_array --------------------- */
-
-#ifndef GL_ARB_texture_cube_map_array
-#define GL_ARB_texture_cube_map_array 1
-
-#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009
-#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B
-#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C
-#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D
-#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F
-
-#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array)
-
-#endif /* GL_ARB_texture_cube_map_array */
-
-/* ------------------------- GL_ARB_texture_env_add ------------------------ */
-
-#ifndef GL_ARB_texture_env_add
-#define GL_ARB_texture_env_add 1
-
-#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add)
-
-#endif /* GL_ARB_texture_env_add */
-
-/* ----------------------- GL_ARB_texture_env_combine ---------------------- */
-
-#ifndef GL_ARB_texture_env_combine
-#define GL_ARB_texture_env_combine 1
-
-#define GL_SUBTRACT_ARB 0x84E7
-#define GL_COMBINE_ARB 0x8570
-#define GL_COMBINE_RGB_ARB 0x8571
-#define GL_COMBINE_ALPHA_ARB 0x8572
-#define GL_RGB_SCALE_ARB 0x8573
-#define GL_ADD_SIGNED_ARB 0x8574
-#define GL_INTERPOLATE_ARB 0x8575
-#define GL_CONSTANT_ARB 0x8576
-#define GL_PRIMARY_COLOR_ARB 0x8577
-#define GL_PREVIOUS_ARB 0x8578
-#define GL_SOURCE0_RGB_ARB 0x8580
-#define GL_SOURCE1_RGB_ARB 0x8581
-#define GL_SOURCE2_RGB_ARB 0x8582
-#define GL_SOURCE0_ALPHA_ARB 0x8588
-#define GL_SOURCE1_ALPHA_ARB 0x8589
-#define GL_SOURCE2_ALPHA_ARB 0x858A
-#define GL_OPERAND0_RGB_ARB 0x8590
-#define GL_OPERAND1_RGB_ARB 0x8591
-#define GL_OPERAND2_RGB_ARB 0x8592
-#define GL_OPERAND0_ALPHA_ARB 0x8598
-#define GL_OPERAND1_ALPHA_ARB 0x8599
-#define GL_OPERAND2_ALPHA_ARB 0x859A
-
-#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine)
-
-#endif /* GL_ARB_texture_env_combine */
-
-/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */
-
-#ifndef GL_ARB_texture_env_crossbar
-#define GL_ARB_texture_env_crossbar 1
-
-#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar)
-
-#endif /* GL_ARB_texture_env_crossbar */
-
-/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */
-
-#ifndef GL_ARB_texture_env_dot3
-#define GL_ARB_texture_env_dot3 1
-
-#define GL_DOT3_RGB_ARB 0x86AE
-#define GL_DOT3_RGBA_ARB 0x86AF
-
-#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3)
-
-#endif /* GL_ARB_texture_env_dot3 */
-
-/* -------------------------- GL_ARB_texture_float ------------------------- */
-
-#ifndef GL_ARB_texture_float
-#define GL_ARB_texture_float 1
-
-#define GL_RGBA32F_ARB 0x8814
-#define GL_RGB32F_ARB 0x8815
-#define GL_ALPHA32F_ARB 0x8816
-#define GL_INTENSITY32F_ARB 0x8817
-#define GL_LUMINANCE32F_ARB 0x8818
-#define GL_LUMINANCE_ALPHA32F_ARB 0x8819
-#define GL_RGBA16F_ARB 0x881A
-#define GL_RGB16F_ARB 0x881B
-#define GL_ALPHA16F_ARB 0x881C
-#define GL_INTENSITY16F_ARB 0x881D
-#define GL_LUMINANCE16F_ARB 0x881E
-#define GL_LUMINANCE_ALPHA16F_ARB 0x881F
-#define GL_TEXTURE_RED_TYPE_ARB 0x8C10
-#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11
-#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12
-#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13
-#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14
-#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15
-#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16
-#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17
-
-#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float)
-
-#endif /* GL_ARB_texture_float */
-
-/* ------------------------- GL_ARB_texture_gather ------------------------- */
-
-#ifndef GL_ARB_texture_gather
-#define GL_ARB_texture_gather 1
-
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F
-
-#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather)
-
-#endif /* GL_ARB_texture_gather */
-
-/* ------------------ GL_ARB_texture_mirror_clamp_to_edge ------------------ */
-
-#ifndef GL_ARB_texture_mirror_clamp_to_edge
-#define GL_ARB_texture_mirror_clamp_to_edge 1
-
-#define GL_MIRROR_CLAMP_TO_EDGE 0x8743
-
-#define GLEW_ARB_texture_mirror_clamp_to_edge GLEW_GET_VAR(__GLEW_ARB_texture_mirror_clamp_to_edge)
-
-#endif /* GL_ARB_texture_mirror_clamp_to_edge */
-
-/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */
-
-#ifndef GL_ARB_texture_mirrored_repeat
-#define GL_ARB_texture_mirrored_repeat 1
-
-#define GL_MIRRORED_REPEAT_ARB 0x8370
-
-#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat)
-
-#endif /* GL_ARB_texture_mirrored_repeat */
-
-/* ----------------------- GL_ARB_texture_multisample ---------------------- */
-
-#ifndef GL_ARB_texture_multisample
-#define GL_ARB_texture_multisample 1
-
-#define GL_SAMPLE_POSITION 0x8E50
-#define GL_SAMPLE_MASK 0x8E51
-#define GL_SAMPLE_MASK_VALUE 0x8E52
-#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59
-#define GL_TEXTURE_2D_MULTISAMPLE 0x9100
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101
-#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102
-#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104
-#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105
-#define GL_TEXTURE_SAMPLES 0x9106
-#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107
-#define GL_SAMPLER_2D_MULTISAMPLE 0x9108
-#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A
-#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B
-#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C
-#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D
-#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E
-#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F
-#define GL_MAX_INTEGER_SAMPLES 0x9110
-
-typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-
-#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv)
-#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski)
-#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample)
-#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample)
-
-#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample)
-
-#endif /* GL_ARB_texture_multisample */
-
-/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */
-
-#ifndef GL_ARB_texture_non_power_of_two
-#define GL_ARB_texture_non_power_of_two 1
-
-#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two)
-
-#endif /* GL_ARB_texture_non_power_of_two */
-
-/* ---------------------- GL_ARB_texture_query_levels ---------------------- */
-
-#ifndef GL_ARB_texture_query_levels
-#define GL_ARB_texture_query_levels 1
-
-#define GLEW_ARB_texture_query_levels GLEW_GET_VAR(__GLEW_ARB_texture_query_levels)
-
-#endif /* GL_ARB_texture_query_levels */
-
-/* ------------------------ GL_ARB_texture_query_lod ----------------------- */
-
-#ifndef GL_ARB_texture_query_lod
-#define GL_ARB_texture_query_lod 1
-
-#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod)
-
-#endif /* GL_ARB_texture_query_lod */
-
-/* ------------------------ GL_ARB_texture_rectangle ----------------------- */
-
-#ifndef GL_ARB_texture_rectangle
-#define GL_ARB_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_ARB 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64
-
-#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle)
-
-#endif /* GL_ARB_texture_rectangle */
-
-/* --------------------------- GL_ARB_texture_rg --------------------------- */
-
-#ifndef GL_ARB_texture_rg
-#define GL_ARB_texture_rg 1
-
-#define GL_COMPRESSED_RED 0x8225
-#define GL_COMPRESSED_RG 0x8226
-#define GL_RG 0x8227
-#define GL_RG_INTEGER 0x8228
-#define GL_R8 0x8229
-#define GL_R16 0x822A
-#define GL_RG8 0x822B
-#define GL_RG16 0x822C
-#define GL_R16F 0x822D
-#define GL_R32F 0x822E
-#define GL_RG16F 0x822F
-#define GL_RG32F 0x8230
-#define GL_R8I 0x8231
-#define GL_R8UI 0x8232
-#define GL_R16I 0x8233
-#define GL_R16UI 0x8234
-#define GL_R32I 0x8235
-#define GL_R32UI 0x8236
-#define GL_RG8I 0x8237
-#define GL_RG8UI 0x8238
-#define GL_RG16I 0x8239
-#define GL_RG16UI 0x823A
-#define GL_RG32I 0x823B
-#define GL_RG32UI 0x823C
-
-#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg)
-
-#endif /* GL_ARB_texture_rg */
-
-/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */
-
-#ifndef GL_ARB_texture_rgb10_a2ui
-#define GL_ARB_texture_rgb10_a2ui 1
-
-#define GL_RGB10_A2UI 0x906F
-
-#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui)
-
-#endif /* GL_ARB_texture_rgb10_a2ui */
-
-/* ------------------------ GL_ARB_texture_stencil8 ------------------------ */
-
-#ifndef GL_ARB_texture_stencil8
-#define GL_ARB_texture_stencil8 1
-
-#define GL_STENCIL_INDEX 0x1901
-#define GL_STENCIL_INDEX8 0x8D48
-
-#define GLEW_ARB_texture_stencil8 GLEW_GET_VAR(__GLEW_ARB_texture_stencil8)
-
-#endif /* GL_ARB_texture_stencil8 */
-
-/* ------------------------- GL_ARB_texture_storage ------------------------ */
-
-#ifndef GL_ARB_texture_storage
-#define GL_ARB_texture_storage 1
-
-#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
-
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glTexStorage1D GLEW_GET_FUN(__glewTexStorage1D)
-#define glTexStorage2D GLEW_GET_FUN(__glewTexStorage2D)
-#define glTexStorage3D GLEW_GET_FUN(__glewTexStorage3D)
-#define glTextureStorage1DEXT GLEW_GET_FUN(__glewTextureStorage1DEXT)
-#define glTextureStorage2DEXT GLEW_GET_FUN(__glewTextureStorage2DEXT)
-#define glTextureStorage3DEXT GLEW_GET_FUN(__glewTextureStorage3DEXT)
-
-#define GLEW_ARB_texture_storage GLEW_GET_VAR(__GLEW_ARB_texture_storage)
-
-#endif /* GL_ARB_texture_storage */
-
-/* ------------------- GL_ARB_texture_storage_multisample ------------------ */
-
-#ifndef GL_ARB_texture_storage_multisample
-#define GL_ARB_texture_storage_multisample 1
-
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GLAPIENTRY * PFNGLTEXSTORAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
-typedef void (GLAPIENTRY * PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC) (GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
-
-#define glTexStorage2DMultisample GLEW_GET_FUN(__glewTexStorage2DMultisample)
-#define glTexStorage3DMultisample GLEW_GET_FUN(__glewTexStorage3DMultisample)
-#define glTextureStorage2DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage2DMultisampleEXT)
-#define glTextureStorage3DMultisampleEXT GLEW_GET_FUN(__glewTextureStorage3DMultisampleEXT)
-
-#define GLEW_ARB_texture_storage_multisample GLEW_GET_VAR(__GLEW_ARB_texture_storage_multisample)
-
-#endif /* GL_ARB_texture_storage_multisample */
-
-/* ------------------------- GL_ARB_texture_swizzle ------------------------ */
-
-#ifndef GL_ARB_texture_swizzle
-#define GL_ARB_texture_swizzle 1
-
-#define GL_TEXTURE_SWIZZLE_R 0x8E42
-#define GL_TEXTURE_SWIZZLE_G 0x8E43
-#define GL_TEXTURE_SWIZZLE_B 0x8E44
-#define GL_TEXTURE_SWIZZLE_A 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46
-
-#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle)
-
-#endif /* GL_ARB_texture_swizzle */
-
-/* -------------------------- GL_ARB_texture_view -------------------------- */
-
-#ifndef GL_ARB_texture_view
-#define GL_ARB_texture_view 1
-
-#define GL_TEXTURE_VIEW_MIN_LEVEL 0x82DB
-#define GL_TEXTURE_VIEW_NUM_LEVELS 0x82DC
-#define GL_TEXTURE_VIEW_MIN_LAYER 0x82DD
-#define GL_TEXTURE_VIEW_NUM_LAYERS 0x82DE
-#define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF
-
-typedef void (GLAPIENTRY * PFNGLTEXTUREVIEWPROC) (GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers);
-
-#define glTextureView GLEW_GET_FUN(__glewTextureView)
-
-#define GLEW_ARB_texture_view GLEW_GET_VAR(__GLEW_ARB_texture_view)
-
-#endif /* GL_ARB_texture_view */
-
-/* --------------------------- GL_ARB_timer_query -------------------------- */
-
-#ifndef GL_ARB_timer_query
-#define GL_ARB_timer_query 1
-
-#define GL_TIME_ELAPSED 0x88BF
-#define GL_TIMESTAMP 0x8E28
-
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params);
-typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target);
-
-#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v)
-#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v)
-#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter)
-
-#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query)
-
-#endif /* GL_ARB_timer_query */
-
-/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */
-
-#ifndef GL_ARB_transform_feedback2
-#define GL_ARB_transform_feedback2 1
-
-#define GL_TRANSFORM_FEEDBACK 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25
-
-typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id);
-typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids);
-typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void);
-typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void);
-
-#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback)
-#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks)
-#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback)
-#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks)
-#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback)
-#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback)
-#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback)
-
-#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2)
-
-#endif /* GL_ARB_transform_feedback2 */
-
-/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */
-
-#ifndef GL_ARB_transform_feedback3
-#define GL_ARB_transform_feedback3 1
-
-#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70
-#define GL_MAX_VERTEX_STREAMS 0x8E71
-
-typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream);
-typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);
-
-#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed)
-#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream)
-#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed)
-#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv)
-
-#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3)
-
-#endif /* GL_ARB_transform_feedback3 */
-
-/* ------------------ GL_ARB_transform_feedback_instanced ------------------ */
-
-#ifndef GL_ARB_transform_feedback_instanced
-#define GL_ARB_transform_feedback_instanced 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
-
-#define glDrawTransformFeedbackInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackInstanced)
-#define glDrawTransformFeedbackStreamInstanced GLEW_GET_FUN(__glewDrawTransformFeedbackStreamInstanced)
-
-#define GLEW_ARB_transform_feedback_instanced GLEW_GET_VAR(__GLEW_ARB_transform_feedback_instanced)
-
-#endif /* GL_ARB_transform_feedback_instanced */
-
-/* ------------------------ GL_ARB_transpose_matrix ------------------------ */
-
-#ifndef GL_ARB_transpose_matrix
-#define GL_ARB_transpose_matrix 1
-
-#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3
-#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4
-#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5
-#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6
-
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]);
-typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]);
-
-#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB)
-#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB)
-#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB)
-#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB)
-
-#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix)
-
-#endif /* GL_ARB_transpose_matrix */
-
-/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */
-
-#ifndef GL_ARB_uniform_buffer_object
-#define GL_ARB_uniform_buffer_object 1
-
-#define GL_UNIFORM_BUFFER 0x8A11
-#define GL_UNIFORM_BUFFER_BINDING 0x8A28
-#define GL_UNIFORM_BUFFER_START 0x8A29
-#define GL_UNIFORM_BUFFER_SIZE 0x8A2A
-#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B
-#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C
-#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D
-#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E
-#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F
-#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30
-#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31
-#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32
-#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33
-#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34
-#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35
-#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36
-#define GL_UNIFORM_TYPE 0x8A37
-#define GL_UNIFORM_SIZE 0x8A38
-#define GL_UNIFORM_NAME_LENGTH 0x8A39
-#define GL_UNIFORM_BLOCK_INDEX 0x8A3A
-#define GL_UNIFORM_OFFSET 0x8A3B
-#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C
-#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D
-#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E
-#define GL_UNIFORM_BLOCK_BINDING 0x8A3F
-#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40
-#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42
-#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45
-#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46
-#define GL_INVALID_INDEX 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformName);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data);
-typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const GLchar* uniformBlockName);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices);
-typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
-
-#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase)
-#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange)
-#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName)
-#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv)
-#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName)
-#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv)
-#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v)
-#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex)
-#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices)
-#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding)
-
-#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object)
-
-#endif /* GL_ARB_uniform_buffer_object */
-
-/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */
-
-#ifndef GL_ARB_vertex_array_bgra
-#define GL_ARB_vertex_array_bgra 1
-
-#define GL_BGRA 0x80E1
-
-#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra)
-
-#endif /* GL_ARB_vertex_array_bgra */
-
-/* ----------------------- GL_ARB_vertex_array_object ---------------------- */
-
-#ifndef GL_ARB_vertex_array_object
-#define GL_ARB_vertex_array_object 1
-
-#define GL_VERTEX_ARRAY_BINDING 0x85B5
-
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays);
-typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays);
-typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array);
-
-#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray)
-#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays)
-#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays)
-#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray)
-
-#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object)
-
-#endif /* GL_ARB_vertex_array_object */
-
-/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */
-
-#ifndef GL_ARB_vertex_attrib_64bit
-#define GL_ARB_vertex_attrib_64bit 1
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer);
-
-#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv)
-#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d)
-#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv)
-#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d)
-#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv)
-#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d)
-#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv)
-#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d)
-#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv)
-#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer)
-
-#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit)
-
-#endif /* GL_ARB_vertex_attrib_64bit */
-
-/* ---------------------- GL_ARB_vertex_attrib_binding --------------------- */
-
-#ifndef GL_ARB_vertex_attrib_binding
-#define GL_ARB_vertex_attrib_binding 1
-
-#define GL_VERTEX_ATTRIB_BINDING 0x82D4
-#define GL_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D5
-#define GL_VERTEX_BINDING_DIVISOR 0x82D6
-#define GL_VERTEX_BINDING_OFFSET 0x82D7
-#define GL_VERTEX_BINDING_STRIDE 0x82D8
-#define GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET 0x82D9
-#define GL_MAX_VERTEX_ATTRIB_BINDINGS 0x82DA
-
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXBUFFERPROC) (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBBINDINGPROC) (GLuint attribindex, GLuint bindingindex);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATPROC) (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
-typedef void (GLAPIENTRY * PFNGLVERTEXBINDINGDIVISORPROC) (GLuint bindingindex, GLuint divisor);
-
-#define glBindVertexBuffer GLEW_GET_FUN(__glewBindVertexBuffer)
-#define glVertexAttribBinding GLEW_GET_FUN(__glewVertexAttribBinding)
-#define glVertexAttribFormat GLEW_GET_FUN(__glewVertexAttribFormat)
-#define glVertexAttribIFormat GLEW_GET_FUN(__glewVertexAttribIFormat)
-#define glVertexAttribLFormat GLEW_GET_FUN(__glewVertexAttribLFormat)
-#define glVertexBindingDivisor GLEW_GET_FUN(__glewVertexBindingDivisor)
-
-#define GLEW_ARB_vertex_attrib_binding GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_binding)
-
-#endif /* GL_ARB_vertex_attrib_binding */
-
-/* -------------------------- GL_ARB_vertex_blend -------------------------- */
-
-#ifndef GL_ARB_vertex_blend
-#define GL_ARB_vertex_blend 1
-
-#define GL_MODELVIEW0_ARB 0x1700
-#define GL_MODELVIEW1_ARB 0x850A
-#define GL_MAX_VERTEX_UNITS_ARB 0x86A4
-#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5
-#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6
-#define GL_VERTEX_BLEND_ARB 0x86A7
-#define GL_CURRENT_WEIGHT_ARB 0x86A8
-#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9
-#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA
-#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB
-#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC
-#define GL_WEIGHT_ARRAY_ARB 0x86AD
-#define GL_MODELVIEW2_ARB 0x8722
-#define GL_MODELVIEW3_ARB 0x8723
-#define GL_MODELVIEW4_ARB 0x8724
-#define GL_MODELVIEW5_ARB 0x8725
-#define GL_MODELVIEW6_ARB 0x8726
-#define GL_MODELVIEW7_ARB 0x8727
-#define GL_MODELVIEW8_ARB 0x8728
-#define GL_MODELVIEW9_ARB 0x8729
-#define GL_MODELVIEW10_ARB 0x872A
-#define GL_MODELVIEW11_ARB 0x872B
-#define GL_MODELVIEW12_ARB 0x872C
-#define GL_MODELVIEW13_ARB 0x872D
-#define GL_MODELVIEW14_ARB 0x872E
-#define GL_MODELVIEW15_ARB 0x872F
-#define GL_MODELVIEW16_ARB 0x8730
-#define GL_MODELVIEW17_ARB 0x8731
-#define GL_MODELVIEW18_ARB 0x8732
-#define GL_MODELVIEW19_ARB 0x8733
-#define GL_MODELVIEW20_ARB 0x8734
-#define GL_MODELVIEW21_ARB 0x8735
-#define GL_MODELVIEW22_ARB 0x8736
-#define GL_MODELVIEW23_ARB 0x8737
-#define GL_MODELVIEW24_ARB 0x8738
-#define GL_MODELVIEW25_ARB 0x8739
-#define GL_MODELVIEW26_ARB 0x873A
-#define GL_MODELVIEW27_ARB 0x873B
-#define GL_MODELVIEW28_ARB 0x873C
-#define GL_MODELVIEW29_ARB 0x873D
-#define GL_MODELVIEW30_ARB 0x873E
-#define GL_MODELVIEW31_ARB 0x873F
-
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count);
-typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights);
-typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights);
-
-#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB)
-#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB)
-#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB)
-#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB)
-#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB)
-#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB)
-#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB)
-#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB)
-#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB)
-#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB)
-
-#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend)
-
-#endif /* GL_ARB_vertex_blend */
-
-/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */
-
-#ifndef GL_ARB_vertex_buffer_object
-#define GL_ARB_vertex_buffer_object 1
-
-#define GL_BUFFER_SIZE_ARB 0x8764
-#define GL_BUFFER_USAGE_ARB 0x8765
-#define GL_ARRAY_BUFFER_ARB 0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893
-#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898
-#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A
-#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B
-#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C
-#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D
-#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E
-#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F
-#define GL_READ_ONLY_ARB 0x88B8
-#define GL_WRITE_ONLY_ARB 0x88B9
-#define GL_READ_WRITE_ARB 0x88BA
-#define GL_BUFFER_ACCESS_ARB 0x88BB
-#define GL_BUFFER_MAPPED_ARB 0x88BC
-#define GL_BUFFER_MAP_POINTER_ARB 0x88BD
-#define GL_STREAM_DRAW_ARB 0x88E0
-#define GL_STREAM_READ_ARB 0x88E1
-#define GL_STREAM_COPY_ARB 0x88E2
-#define GL_STATIC_DRAW_ARB 0x88E4
-#define GL_STATIC_READ_ARB 0x88E5
-#define GL_STATIC_COPY_ARB 0x88E6
-#define GL_DYNAMIC_DRAW_ARB 0x88E8
-#define GL_DYNAMIC_READ_ARB 0x88E9
-#define GL_DYNAMIC_COPY_ARB 0x88EA
-
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target);
-
-#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB)
-#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB)
-#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB)
-#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB)
-#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB)
-#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB)
-#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB)
-#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB)
-#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB)
-#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB)
-#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB)
-
-#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object)
-
-#endif /* GL_ARB_vertex_buffer_object */
-
-/* ------------------------- GL_ARB_vertex_program ------------------------- */
-
-#ifndef GL_ARB_vertex_program
-#define GL_ARB_vertex_program 1
-
-#define GL_COLOR_SUM_ARB 0x8458
-#define GL_VERTEX_PROGRAM_ARB 0x8620
-#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622
-#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623
-#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624
-#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625
-#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626
-#define GL_PROGRAM_LENGTH_ARB 0x8627
-#define GL_PROGRAM_STRING_ARB 0x8628
-#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E
-#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F
-#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640
-#define GL_CURRENT_MATRIX_ARB 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643
-#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645
-#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B
-#define GL_PROGRAM_BINDING_ARB 0x8677
-#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869
-#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A
-#define GL_PROGRAM_ERROR_STRING_ARB 0x8874
-#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875
-#define GL_PROGRAM_FORMAT_ARB 0x8876
-#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0
-#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1
-#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2
-#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3
-#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4
-#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5
-#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6
-#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7
-#define GL_PROGRAM_PARAMETERS_ARB 0x88A8
-#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9
-#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA
-#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB
-#define GL_PROGRAM_ATTRIBS_ARB 0x88AC
-#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD
-#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE
-#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF
-#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0
-#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1
-#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2
-#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3
-#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4
-#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5
-#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6
-#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7
-#define GL_MATRIX0_ARB 0x88C0
-#define GL_MATRIX1_ARB 0x88C1
-#define GL_MATRIX2_ARB 0x88C2
-#define GL_MATRIX3_ARB 0x88C3
-#define GL_MATRIX4_ARB 0x88C4
-#define GL_MATRIX5_ARB 0x88C5
-#define GL_MATRIX6_ARB 0x88C6
-#define GL_MATRIX7_ARB 0x88C7
-#define GL_MATRIX8_ARB 0x88C8
-#define GL_MATRIX9_ARB 0x88C9
-#define GL_MATRIX10_ARB 0x88CA
-#define GL_MATRIX11_ARB 0x88CB
-#define GL_MATRIX12_ARB 0x88CC
-#define GL_MATRIX13_ARB 0x88CD
-#define GL_MATRIX14_ARB 0x88CE
-#define GL_MATRIX15_ARB 0x88CF
-#define GL_MATRIX16_ARB 0x88D0
-#define GL_MATRIX17_ARB 0x88D1
-#define GL_MATRIX18_ARB 0x88D2
-#define GL_MATRIX19_ARB 0x88D3
-#define GL_MATRIX20_ARB 0x88D4
-#define GL_MATRIX21_ARB 0x88D5
-#define GL_MATRIX22_ARB 0x88D6
-#define GL_MATRIX23_ARB 0x88D7
-#define GL_MATRIX24_ARB 0x88D8
-#define GL_MATRIX25_ARB 0x88D9
-#define GL_MATRIX26_ARB 0x88DA
-#define GL_MATRIX27_ARB 0x88DB
-#define GL_MATRIX28_ARB 0x88DC
-#define GL_MATRIX29_ARB 0x88DD
-#define GL_MATRIX30_ARB 0x88DE
-#define GL_MATRIX31_ARB 0x88DF
-
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer);
-
-#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB)
-#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB)
-#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB)
-#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB)
-#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB)
-#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB)
-#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB)
-#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB)
-#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB)
-#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB)
-#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB)
-#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB)
-#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB)
-#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB)
-#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB)
-#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB)
-#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB)
-#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB)
-#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB)
-#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB)
-#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB)
-#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB)
-#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB)
-#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB)
-#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB)
-#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB)
-#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB)
-#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB)
-#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB)
-#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB)
-#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB)
-#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB)
-#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB)
-#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB)
-#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB)
-#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB)
-#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB)
-#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB)
-#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB)
-#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB)
-#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB)
-#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB)
-#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB)
-#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB)
-#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB)
-#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB)
-#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB)
-#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB)
-#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB)
-#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB)
-#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB)
-#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB)
-#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB)
-#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB)
-#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB)
-#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB)
-#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB)
-#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB)
-#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB)
-#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB)
-#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB)
-#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB)
-
-#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program)
-
-#endif /* GL_ARB_vertex_program */
-
-/* -------------------------- GL_ARB_vertex_shader ------------------------- */
-
-#ifndef GL_ARB_vertex_shader
-#define GL_ARB_vertex_shader 1
-
-#define GL_VERTEX_SHADER_ARB 0x8B31
-#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A
-#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B
-#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D
-#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89
-#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A
-
-typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name);
-typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name);
-
-#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB)
-#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB)
-#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB)
-
-#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader)
-
-#endif /* GL_ARB_vertex_shader */
-
-/* ------------------- GL_ARB_vertex_type_10f_11f_11f_rev ------------------ */
-
-#ifndef GL_ARB_vertex_type_10f_11f_11f_rev
-#define GL_ARB_vertex_type_10f_11f_11f_rev 1
-
-#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B
-
-#define GLEW_ARB_vertex_type_10f_11f_11f_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_10f_11f_11f_rev)
-
-#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */
-
-/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */
-
-#ifndef GL_ARB_vertex_type_2_10_10_10_rev
-#define GL_ARB_vertex_type_2_10_10_10_rev 1
-
-#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368
-#define GL_INT_2_10_10_10_REV 0x8D9F
-
-typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value);
-typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value);
-
-#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui)
-#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv)
-#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui)
-#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv)
-#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui)
-#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv)
-#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui)
-#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv)
-#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui)
-#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv)
-#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui)
-#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv)
-#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui)
-#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv)
-#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui)
-#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv)
-#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui)
-#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv)
-#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui)
-#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv)
-#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui)
-#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv)
-#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui)
-#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv)
-#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui)
-#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv)
-#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui)
-#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv)
-#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui)
-#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv)
-#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui)
-#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv)
-#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui)
-#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv)
-#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui)
-#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv)
-#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui)
-#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv)
-
-#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev)
-
-#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-
-/* ------------------------- GL_ARB_viewport_array ------------------------- */
-
-#ifndef GL_ARB_viewport_array
-#define GL_ARB_viewport_array 1
-
-#define GL_DEPTH_RANGE 0x0B70
-#define GL_VIEWPORT 0x0BA2
-#define GL_SCISSOR_BOX 0x0C10
-#define GL_SCISSOR_TEST 0x0C11
-#define GL_MAX_VIEWPORTS 0x825B
-#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C
-#define GL_VIEWPORT_BOUNDS_RANGE 0x825D
-#define GL_LAYER_PROVOKING_VERTEX 0x825E
-#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F
-#define GL_UNDEFINED_VERTEX 0x8260
-#define GL_FIRST_VERTEX_CONVENTION 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION 0x8E4E
-#define GL_PROVOKING_VERTEX 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data);
-typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v);
-typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h);
-typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v);
-
-#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv)
-#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed)
-#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v)
-#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v)
-#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv)
-#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed)
-#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv)
-#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv)
-#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf)
-#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv)
-
-#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array)
-
-#endif /* GL_ARB_viewport_array */
-
-/* --------------------------- GL_ARB_window_pos --------------------------- */
-
-#ifndef GL_ARB_window_pos
-#define GL_ARB_window_pos 1
-
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p);
-
-#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB)
-#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB)
-#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB)
-#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB)
-#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB)
-#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB)
-#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB)
-#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB)
-#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB)
-#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB)
-#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB)
-#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB)
-#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB)
-#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB)
-#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB)
-#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB)
-
-#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos)
-
-#endif /* GL_ARB_window_pos */
-
-/* ------------------------- GL_ATIX_point_sprites ------------------------- */
-
-#ifndef GL_ATIX_point_sprites
-#define GL_ATIX_point_sprites 1
-
-#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0
-#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1
-#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2
-#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3
-#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4
-#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5
-
-#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites)
-
-#endif /* GL_ATIX_point_sprites */
-
-/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */
-
-#ifndef GL_ATIX_texture_env_combine3
-#define GL_ATIX_texture_env_combine3 1
-
-#define GL_MODULATE_ADD_ATIX 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745
-#define GL_MODULATE_SUBTRACT_ATIX 0x8746
-
-#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3)
-
-#endif /* GL_ATIX_texture_env_combine3 */
-
-/* ----------------------- GL_ATIX_texture_env_route ----------------------- */
-
-#ifndef GL_ATIX_texture_env_route
-#define GL_ATIX_texture_env_route 1
-
-#define GL_SECONDARY_COLOR_ATIX 0x8747
-#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748
-#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749
-
-#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route)
-
-#endif /* GL_ATIX_texture_env_route */
-
-/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */
-
-#ifndef GL_ATIX_vertex_shader_output_point_size
-#define GL_ATIX_vertex_shader_output_point_size 1
-
-#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E
-
-#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size)
-
-#endif /* GL_ATIX_vertex_shader_output_point_size */
-
-/* -------------------------- GL_ATI_draw_buffers -------------------------- */
-
-#ifndef GL_ATI_draw_buffers
-#define GL_ATI_draw_buffers 1
-
-#define GL_MAX_DRAW_BUFFERS_ATI 0x8824
-#define GL_DRAW_BUFFER0_ATI 0x8825
-#define GL_DRAW_BUFFER1_ATI 0x8826
-#define GL_DRAW_BUFFER2_ATI 0x8827
-#define GL_DRAW_BUFFER3_ATI 0x8828
-#define GL_DRAW_BUFFER4_ATI 0x8829
-#define GL_DRAW_BUFFER5_ATI 0x882A
-#define GL_DRAW_BUFFER6_ATI 0x882B
-#define GL_DRAW_BUFFER7_ATI 0x882C
-#define GL_DRAW_BUFFER8_ATI 0x882D
-#define GL_DRAW_BUFFER9_ATI 0x882E
-#define GL_DRAW_BUFFER10_ATI 0x882F
-#define GL_DRAW_BUFFER11_ATI 0x8830
-#define GL_DRAW_BUFFER12_ATI 0x8831
-#define GL_DRAW_BUFFER13_ATI 0x8832
-#define GL_DRAW_BUFFER14_ATI 0x8833
-#define GL_DRAW_BUFFER15_ATI 0x8834
-
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs);
-
-#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI)
-
-#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers)
-
-#endif /* GL_ATI_draw_buffers */
-
-/* -------------------------- GL_ATI_element_array ------------------------- */
-
-#ifndef GL_ATI_element_array
-#define GL_ATI_element_array 1
-
-#define GL_ELEMENT_ARRAY_ATI 0x8768
-#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769
-#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A
-
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer);
-
-#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI)
-#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI)
-#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI)
-
-#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array)
-
-#endif /* GL_ATI_element_array */
-
-/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */
-
-#ifndef GL_ATI_envmap_bumpmap
-#define GL_ATI_envmap_bumpmap 1
-
-#define GL_BUMP_ROT_MATRIX_ATI 0x8775
-#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776
-#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777
-#define GL_BUMP_TEX_UNITS_ATI 0x8778
-#define GL_DUDV_ATI 0x8779
-#define GL_DU8DV8_ATI 0x877A
-#define GL_BUMP_ENVMAP_ATI 0x877B
-#define GL_BUMP_TARGET_ATI 0x877C
-
-typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param);
-typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param);
-
-#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI)
-#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI)
-#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI)
-#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI)
-
-#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap)
-
-#endif /* GL_ATI_envmap_bumpmap */
-
-/* ------------------------- GL_ATI_fragment_shader ------------------------ */
-
-#ifndef GL_ATI_fragment_shader
-#define GL_ATI_fragment_shader 1
-
-#define GL_RED_BIT_ATI 0x00000001
-#define GL_2X_BIT_ATI 0x00000001
-#define GL_4X_BIT_ATI 0x00000002
-#define GL_GREEN_BIT_ATI 0x00000002
-#define GL_COMP_BIT_ATI 0x00000002
-#define GL_BLUE_BIT_ATI 0x00000004
-#define GL_8X_BIT_ATI 0x00000004
-#define GL_NEGATE_BIT_ATI 0x00000004
-#define GL_BIAS_BIT_ATI 0x00000008
-#define GL_HALF_BIT_ATI 0x00000008
-#define GL_QUARTER_BIT_ATI 0x00000010
-#define GL_EIGHTH_BIT_ATI 0x00000020
-#define GL_SATURATE_BIT_ATI 0x00000040
-#define GL_FRAGMENT_SHADER_ATI 0x8920
-#define GL_REG_0_ATI 0x8921
-#define GL_REG_1_ATI 0x8922
-#define GL_REG_2_ATI 0x8923
-#define GL_REG_3_ATI 0x8924
-#define GL_REG_4_ATI 0x8925
-#define GL_REG_5_ATI 0x8926
-#define GL_CON_0_ATI 0x8941
-#define GL_CON_1_ATI 0x8942
-#define GL_CON_2_ATI 0x8943
-#define GL_CON_3_ATI 0x8944
-#define GL_CON_4_ATI 0x8945
-#define GL_CON_5_ATI 0x8946
-#define GL_CON_6_ATI 0x8947
-#define GL_CON_7_ATI 0x8948
-#define GL_MOV_ATI 0x8961
-#define GL_ADD_ATI 0x8963
-#define GL_MUL_ATI 0x8964
-#define GL_SUB_ATI 0x8965
-#define GL_DOT3_ATI 0x8966
-#define GL_DOT4_ATI 0x8967
-#define GL_MAD_ATI 0x8968
-#define GL_LERP_ATI 0x8969
-#define GL_CND_ATI 0x896A
-#define GL_CND0_ATI 0x896B
-#define GL_DOT2_ADD_ATI 0x896C
-#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D
-#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E
-#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F
-#define GL_NUM_PASSES_ATI 0x8970
-#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971
-#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972
-#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973
-#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974
-#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975
-#define GL_SWIZZLE_STR_ATI 0x8976
-#define GL_SWIZZLE_STQ_ATI 0x8977
-#define GL_SWIZZLE_STR_DR_ATI 0x8978
-#define GL_SWIZZLE_STQ_DQ_ATI 0x8979
-#define GL_SWIZZLE_STRQ_ATI 0x897A
-#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B
-
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void);
-typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod);
-typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range);
-typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle);
-typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value);
-
-#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI)
-#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI)
-#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI)
-#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI)
-#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI)
-#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI)
-#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI)
-#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI)
-#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI)
-#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI)
-#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI)
-#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI)
-#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI)
-#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI)
-
-#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader)
-
-#endif /* GL_ATI_fragment_shader */
-
-/* ------------------------ GL_ATI_map_object_buffer ----------------------- */
-
-#ifndef GL_ATI_map_object_buffer
-#define GL_ATI_map_object_buffer 1
-
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer);
-
-#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI)
-#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI)
-
-#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer)
-
-#endif /* GL_ATI_map_object_buffer */
-
-/* ----------------------------- GL_ATI_meminfo ---------------------------- */
-
-#ifndef GL_ATI_meminfo
-#define GL_ATI_meminfo 1
-
-#define GL_VBO_FREE_MEMORY_ATI 0x87FB
-#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC
-#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD
-
-#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo)
-
-#endif /* GL_ATI_meminfo */
-
-/* -------------------------- GL_ATI_pn_triangles -------------------------- */
-
-#ifndef GL_ATI_pn_triangles
-#define GL_ATI_pn_triangles 1
-
-#define GL_PN_TRIANGLES_ATI 0x87F0
-#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1
-#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2
-#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3
-#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4
-#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5
-#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6
-#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7
-#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8
-
-typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param);
-
-#define glPNTrianglesfATI GLEW_GET_FUN(__glewPNTrianglesfATI)
-#define glPNTrianglesiATI GLEW_GET_FUN(__glewPNTrianglesiATI)
-
-#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles)
-
-#endif /* GL_ATI_pn_triangles */
-
-/* ------------------------ GL_ATI_separate_stencil ------------------------ */
-
-#ifndef GL_ATI_separate_stencil
-#define GL_ATI_separate_stencil 1
-
-#define GL_STENCIL_BACK_FUNC_ATI 0x8800
-#define GL_STENCIL_BACK_FAIL_ATI 0x8801
-#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802
-#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803
-
-typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
-
-#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI)
-#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI)
-
-#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil)
-
-#endif /* GL_ATI_separate_stencil */
-
-/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */
-
-#ifndef GL_ATI_shader_texture_lod
-#define GL_ATI_shader_texture_lod 1
-
-#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod)
-
-#endif /* GL_ATI_shader_texture_lod */
-
-/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */
-
-#ifndef GL_ATI_text_fragment_shader
-#define GL_ATI_text_fragment_shader 1
-
-#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200
-
-#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader)
-
-#endif /* GL_ATI_text_fragment_shader */
-
-/* --------------------- GL_ATI_texture_compression_3dc -------------------- */
-
-#ifndef GL_ATI_texture_compression_3dc
-#define GL_ATI_texture_compression_3dc 1
-
-#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
-
-#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc)
-
-#endif /* GL_ATI_texture_compression_3dc */
-
-/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */
-
-#ifndef GL_ATI_texture_env_combine3
-#define GL_ATI_texture_env_combine3 1
-
-#define GL_MODULATE_ADD_ATI 0x8744
-#define GL_MODULATE_SIGNED_ADD_ATI 0x8745
-#define GL_MODULATE_SUBTRACT_ATI 0x8746
-
-#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3)
-
-#endif /* GL_ATI_texture_env_combine3 */
-
-/* -------------------------- GL_ATI_texture_float ------------------------- */
-
-#ifndef GL_ATI_texture_float
-#define GL_ATI_texture_float 1
-
-#define GL_RGBA_FLOAT32_ATI 0x8814
-#define GL_RGB_FLOAT32_ATI 0x8815
-#define GL_ALPHA_FLOAT32_ATI 0x8816
-#define GL_INTENSITY_FLOAT32_ATI 0x8817
-#define GL_LUMINANCE_FLOAT32_ATI 0x8818
-#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819
-#define GL_RGBA_FLOAT16_ATI 0x881A
-#define GL_RGB_FLOAT16_ATI 0x881B
-#define GL_ALPHA_FLOAT16_ATI 0x881C
-#define GL_INTENSITY_FLOAT16_ATI 0x881D
-#define GL_LUMINANCE_FLOAT16_ATI 0x881E
-#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F
-
-#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float)
-
-#endif /* GL_ATI_texture_float */
-
-/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */
-
-#ifndef GL_ATI_texture_mirror_once
-#define GL_ATI_texture_mirror_once 1
-
-#define GL_MIRROR_CLAMP_ATI 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743
-
-#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once)
-
-#endif /* GL_ATI_texture_mirror_once */
-
-/* ----------------------- GL_ATI_vertex_array_object ---------------------- */
-
-#ifndef GL_ATI_vertex_array_object
-#define GL_ATI_vertex_array_object 1
-
-#define GL_STATIC_ATI 0x8760
-#define GL_DYNAMIC_ATI 0x8761
-#define GL_PRESERVE_ATI 0x8762
-#define GL_DISCARD_ATI 0x8763
-#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764
-#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765
-#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766
-#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767
-
-typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer);
-typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve);
-typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset);
-
-#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI)
-#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI)
-#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI)
-#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI)
-#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI)
-#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI)
-#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI)
-#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI)
-#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI)
-#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI)
-#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI)
-#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI)
-
-#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object)
-
-#endif /* GL_ATI_vertex_array_object */
-
-/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */
-
-#ifndef GL_ATI_vertex_attrib_array_object
-#define GL_ATI_vertex_attrib_array_object 1
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset);
-
-#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI)
-#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI)
-#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI)
-
-#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object)
-
-#endif /* GL_ATI_vertex_attrib_array_object */
-
-/* ------------------------- GL_ATI_vertex_streams ------------------------- */
-
-#ifndef GL_ATI_vertex_streams
-#define GL_ATI_vertex_streams 1
-
-#define GL_MAX_VERTEX_STREAMS_ATI 0x876B
-#define GL_VERTEX_SOURCE_ATI 0x876C
-#define GL_VERTEX_STREAM0_ATI 0x876D
-#define GL_VERTEX_STREAM1_ATI 0x876E
-#define GL_VERTEX_STREAM2_ATI 0x876F
-#define GL_VERTEX_STREAM3_ATI 0x8770
-#define GL_VERTEX_STREAM4_ATI 0x8771
-#define GL_VERTEX_STREAM5_ATI 0x8772
-#define GL_VERTEX_STREAM6_ATI 0x8773
-#define GL_VERTEX_STREAM7_ATI 0x8774
-
-typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords);
-
-#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI)
-#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI)
-#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI)
-#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI)
-#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI)
-#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI)
-#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI)
-#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI)
-#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI)
-#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI)
-#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI)
-#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI)
-#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI)
-#define glVertexStream1dATI GLEW_GET_FUN(__glewVertexStream1dATI)
-#define glVertexStream1dvATI GLEW_GET_FUN(__glewVertexStream1dvATI)
-#define glVertexStream1fATI GLEW_GET_FUN(__glewVertexStream1fATI)
-#define glVertexStream1fvATI GLEW_GET_FUN(__glewVertexStream1fvATI)
-#define glVertexStream1iATI GLEW_GET_FUN(__glewVertexStream1iATI)
-#define glVertexStream1ivATI GLEW_GET_FUN(__glewVertexStream1ivATI)
-#define glVertexStream1sATI GLEW_GET_FUN(__glewVertexStream1sATI)
-#define glVertexStream1svATI GLEW_GET_FUN(__glewVertexStream1svATI)
-#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI)
-#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI)
-#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI)
-#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI)
-#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI)
-#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI)
-#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI)
-#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI)
-#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI)
-#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI)
-#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI)
-#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI)
-#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI)
-#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI)
-#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI)
-#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI)
-#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI)
-#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI)
-#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI)
-#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI)
-#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI)
-#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI)
-#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI)
-#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI)
-
-#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams)
-
-#endif /* GL_ATI_vertex_streams */
-
-/* --------------------------- GL_EXT_422_pixels --------------------------- */
-
-#ifndef GL_EXT_422_pixels
-#define GL_EXT_422_pixels 1
-
-#define GL_422_EXT 0x80CC
-#define GL_422_REV_EXT 0x80CD
-#define GL_422_AVERAGE_EXT 0x80CE
-#define GL_422_REV_AVERAGE_EXT 0x80CF
-
-#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels)
-
-#endif /* GL_EXT_422_pixels */
-
-/* ---------------------------- GL_EXT_Cg_shader --------------------------- */
-
-#ifndef GL_EXT_Cg_shader
-#define GL_EXT_Cg_shader 1
-
-#define GL_CG_VERTEX_SHADER_EXT 0x890E
-#define GL_CG_FRAGMENT_SHADER_EXT 0x890F
-
-#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader)
-
-#endif /* GL_EXT_Cg_shader */
-
-/* ------------------------------ GL_EXT_abgr ------------------------------ */
-
-#ifndef GL_EXT_abgr
-#define GL_EXT_abgr 1
-
-#define GL_ABGR_EXT 0x8000
-
-#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr)
-
-#endif /* GL_EXT_abgr */
-
-/* ------------------------------ GL_EXT_bgra ------------------------------ */
-
-#ifndef GL_EXT_bgra
-#define GL_EXT_bgra 1
-
-#define GL_BGR_EXT 0x80E0
-#define GL_BGRA_EXT 0x80E1
-
-#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra)
-
-#endif /* GL_EXT_bgra */
-
-/* ------------------------ GL_EXT_bindable_uniform ------------------------ */
-
-#ifndef GL_EXT_bindable_uniform
-#define GL_EXT_bindable_uniform 1
-
-#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2
-#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3
-#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4
-#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED
-#define GL_UNIFORM_BUFFER_EXT 0x8DEE
-#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF
-
-typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location);
-typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location);
-typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer);
-
-#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT)
-#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT)
-#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT)
-
-#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform)
-
-#endif /* GL_EXT_bindable_uniform */
-
-/* --------------------------- GL_EXT_blend_color -------------------------- */
-
-#ifndef GL_EXT_blend_color
-#define GL_EXT_blend_color 1
-
-#define GL_CONSTANT_COLOR_EXT 0x8001
-#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002
-#define GL_CONSTANT_ALPHA_EXT 0x8003
-#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004
-#define GL_BLEND_COLOR_EXT 0x8005
-
-typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-
-#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT)
-
-#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color)
-
-#endif /* GL_EXT_blend_color */
-
-/* --------------------- GL_EXT_blend_equation_separate -------------------- */
-
-#ifndef GL_EXT_blend_equation_separate
-#define GL_EXT_blend_equation_separate 1
-
-#define GL_BLEND_EQUATION_RGB_EXT 0x8009
-#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha);
-
-#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT)
-
-#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate)
-
-#endif /* GL_EXT_blend_equation_separate */
-
-/* ----------------------- GL_EXT_blend_func_separate ---------------------- */
-
-#ifndef GL_EXT_blend_func_separate
-#define GL_EXT_blend_func_separate 1
-
-#define GL_BLEND_DST_RGB_EXT 0x80C8
-#define GL_BLEND_SRC_RGB_EXT 0x80C9
-#define GL_BLEND_DST_ALPHA_EXT 0x80CA
-#define GL_BLEND_SRC_ALPHA_EXT 0x80CB
-
-typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
-
-#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT)
-
-#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate)
-
-#endif /* GL_EXT_blend_func_separate */
-
-/* ------------------------- GL_EXT_blend_logic_op ------------------------- */
-
-#ifndef GL_EXT_blend_logic_op
-#define GL_EXT_blend_logic_op 1
-
-#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op)
-
-#endif /* GL_EXT_blend_logic_op */
-
-/* -------------------------- GL_EXT_blend_minmax -------------------------- */
-
-#ifndef GL_EXT_blend_minmax
-#define GL_EXT_blend_minmax 1
-
-#define GL_FUNC_ADD_EXT 0x8006
-#define GL_MIN_EXT 0x8007
-#define GL_MAX_EXT 0x8008
-#define GL_BLEND_EQUATION_EXT 0x8009
-
-typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode);
-
-#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT)
-
-#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax)
-
-#endif /* GL_EXT_blend_minmax */
-
-/* ------------------------- GL_EXT_blend_subtract ------------------------- */
-
-#ifndef GL_EXT_blend_subtract
-#define GL_EXT_blend_subtract 1
-
-#define GL_FUNC_SUBTRACT_EXT 0x800A
-#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B
-
-#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract)
-
-#endif /* GL_EXT_blend_subtract */
-
-/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */
-
-#ifndef GL_EXT_clip_volume_hint
-#define GL_EXT_clip_volume_hint 1
-
-#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0
-
-#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint)
-
-#endif /* GL_EXT_clip_volume_hint */
-
-/* ------------------------------ GL_EXT_cmyka ----------------------------- */
-
-#ifndef GL_EXT_cmyka
-#define GL_EXT_cmyka 1
-
-#define GL_CMYK_EXT 0x800C
-#define GL_CMYKA_EXT 0x800D
-#define GL_PACK_CMYK_HINT_EXT 0x800E
-#define GL_UNPACK_CMYK_HINT_EXT 0x800F
-
-#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka)
-
-#endif /* GL_EXT_cmyka */
-
-/* ------------------------- GL_EXT_color_subtable ------------------------- */
-
-#ifndef GL_EXT_color_subtable
-#define GL_EXT_color_subtable 1
-
-typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width);
-
-#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT)
-#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT)
-
-#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable)
-
-#endif /* GL_EXT_color_subtable */
-
-/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */
-
-#ifndef GL_EXT_compiled_vertex_array
-#define GL_EXT_compiled_vertex_array 1
-
-#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8
-#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9
-
-typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void);
-
-#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT)
-#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT)
-
-#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array)
-
-#endif /* GL_EXT_compiled_vertex_array */
-
-/* --------------------------- GL_EXT_convolution -------------------------- */
-
-#ifndef GL_EXT_convolution
-#define GL_EXT_convolution 1
-
-#define GL_CONVOLUTION_1D_EXT 0x8010
-#define GL_CONVOLUTION_2D_EXT 0x8011
-#define GL_SEPARABLE_2D_EXT 0x8012
-#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013
-#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014
-#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015
-#define GL_REDUCE_EXT 0x8016
-#define GL_CONVOLUTION_FORMAT_EXT 0x8017
-#define GL_CONVOLUTION_WIDTH_EXT 0x8018
-#define GL_CONVOLUTION_HEIGHT_EXT 0x8019
-#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A
-#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B
-#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C
-#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D
-#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E
-#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F
-#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020
-#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021
-#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022
-#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023
-
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span);
-typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column);
-
-#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT)
-#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT)
-#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT)
-#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT)
-#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT)
-#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT)
-#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT)
-#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT)
-#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT)
-#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT)
-#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT)
-#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT)
-#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT)
-
-#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution)
-
-#endif /* GL_EXT_convolution */
-
-/* ------------------------ GL_EXT_coordinate_frame ------------------------ */
-
-#ifndef GL_EXT_coordinate_frame
-#define GL_EXT_coordinate_frame 1
-
-#define GL_TANGENT_ARRAY_EXT 0x8439
-#define GL_BINORMAL_ARRAY_EXT 0x843A
-#define GL_CURRENT_TANGENT_EXT 0x843B
-#define GL_CURRENT_BINORMAL_EXT 0x843C
-#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E
-#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F
-#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440
-#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441
-#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442
-#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443
-#define GL_MAP1_TANGENT_EXT 0x8444
-#define GL_MAP2_TANGENT_EXT 0x8445
-#define GL_MAP1_BINORMAL_EXT 0x8446
-#define GL_MAP2_BINORMAL_EXT 0x8447
-
-typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, GLvoid *pointer);
-
-#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT)
-#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT)
-
-#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame)
-
-#endif /* GL_EXT_coordinate_frame */
-
-/* -------------------------- GL_EXT_copy_texture -------------------------- */
-
-#ifndef GL_EXT_copy_texture
-#define GL_EXT_copy_texture 1
-
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT)
-#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT)
-#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT)
-#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT)
-#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT)
-
-#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture)
-
-#endif /* GL_EXT_copy_texture */
-
-/* --------------------------- GL_EXT_cull_vertex -------------------------- */
-
-#ifndef GL_EXT_cull_vertex
-#define GL_EXT_cull_vertex 1
-
-#define GL_CULL_VERTEX_EXT 0x81AA
-#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB
-#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC
-
-typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params);
-
-#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT)
-#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT)
-
-#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex)
-
-#endif /* GL_EXT_cull_vertex */
-
-/* -------------------------- GL_EXT_debug_marker -------------------------- */
-
-#ifndef GL_EXT_debug_marker
-#define GL_EXT_debug_marker 1
-
-typedef void (GLAPIENTRY * PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar* marker);
-typedef void (GLAPIENTRY * PFNGLPOPGROUPMARKEREXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar* marker);
-
-#define glInsertEventMarkerEXT GLEW_GET_FUN(__glewInsertEventMarkerEXT)
-#define glPopGroupMarkerEXT GLEW_GET_FUN(__glewPopGroupMarkerEXT)
-#define glPushGroupMarkerEXT GLEW_GET_FUN(__glewPushGroupMarkerEXT)
-
-#define GLEW_EXT_debug_marker GLEW_GET_VAR(__GLEW_EXT_debug_marker)
-
-#endif /* GL_EXT_debug_marker */
-
-/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */
-
-#ifndef GL_EXT_depth_bounds_test
-#define GL_EXT_depth_bounds_test 1
-
-#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890
-#define GL_DEPTH_BOUNDS_EXT 0x8891
-
-typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax);
-
-#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT)
-
-#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test)
-
-#endif /* GL_EXT_depth_bounds_test */
-
-/* ----------------------- GL_EXT_direct_state_access ---------------------- */
-
-#ifndef GL_EXT_direct_state_access
-#define GL_EXT_direct_state_access 1
-
-#define GL_PROGRAM_MATRIX_EXT 0x8E2D
-#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E
-#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F
-
-typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target);
-typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
-typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
-typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array);
-typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target);
-typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLvoid *img);
-typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLvoid *img);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, GLvoid *string);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access);
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access);
-typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m);
-typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f);
-typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode);
-typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param);
-typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const GLvoid *data, GLenum usage);
-typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const GLvoid *string);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param);
-typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-
-#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT)
-#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT)
-#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT)
-#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT)
-#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT)
-#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT)
-#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT)
-#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT)
-#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT)
-#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT)
-#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT)
-#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT)
-#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT)
-#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT)
-#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT)
-#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT)
-#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT)
-#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT)
-#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT)
-#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT)
-#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT)
-#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT)
-#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT)
-#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT)
-#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT)
-#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT)
-#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT)
-#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT)
-#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT)
-#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT)
-#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT)
-#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT)
-#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT)
-#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT)
-#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT)
-#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT)
-#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT)
-#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT)
-#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT)
-#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT)
-#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT)
-#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT)
-#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT)
-#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT)
-#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT)
-#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT)
-#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT)
-#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT)
-#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT)
-#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT)
-#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT)
-#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT)
-#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT)
-#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT)
-#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT)
-#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT)
-#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT)
-#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT)
-#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT)
-#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT)
-#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT)
-#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT)
-#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT)
-#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT)
-#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT)
-#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT)
-#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT)
-#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT)
-#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT)
-#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT)
-#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT)
-#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT)
-#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT)
-#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT)
-#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT)
-#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT)
-#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT)
-#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT)
-#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT)
-#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT)
-#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT)
-#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT)
-#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT)
-#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT)
-#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT)
-#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT)
-#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT)
-#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT)
-#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT)
-#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT)
-#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT)
-#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT)
-#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT)
-#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT)
-#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT)
-#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT)
-#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT)
-#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT)
-#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT)
-#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT)
-#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT)
-#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT)
-#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT)
-#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT)
-#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT)
-#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT)
-#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT)
-#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT)
-#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT)
-#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT)
-#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT)
-#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT)
-#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT)
-#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT)
-#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT)
-#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT)
-#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT)
-#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT)
-#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT)
-#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT)
-#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT)
-#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT)
-#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT)
-#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT)
-#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT)
-#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT)
-#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT)
-#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT)
-#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT)
-#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT)
-#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT)
-#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT)
-#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT)
-#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT)
-#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT)
-#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT)
-#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT)
-#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT)
-#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT)
-#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT)
-#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT)
-#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT)
-#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT)
-#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT)
-#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT)
-#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT)
-#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT)
-#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT)
-#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT)
-#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT)
-#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT)
-#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT)
-#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT)
-#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT)
-#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT)
-#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT)
-#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT)
-#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT)
-#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT)
-#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT)
-#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT)
-#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT)
-#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT)
-#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT)
-#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT)
-#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT)
-#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT)
-#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT)
-#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT)
-#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT)
-#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT)
-#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT)
-#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT)
-#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT)
-#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT)
-#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT)
-#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT)
-#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT)
-#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT)
-#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT)
-#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT)
-#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT)
-#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT)
-#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT)
-#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT)
-#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT)
-#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT)
-#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT)
-#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT)
-#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT)
-#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT)
-#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT)
-#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT)
-#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT)
-#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT)
-#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT)
-#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT)
-#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT)
-#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT)
-#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT)
-#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT)
-#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT)
-#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT)
-#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT)
-#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT)
-#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT)
-#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT)
-#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT)
-#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT)
-#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT)
-#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT)
-#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT)
-#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT)
-
-#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access)
-
-#endif /* GL_EXT_direct_state_access */
-
-/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */
-
-#ifndef GL_EXT_draw_buffers2
-#define GL_EXT_draw_buffers2 1
-
-typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a);
-typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index);
-typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data);
-typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index);
-
-#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT)
-#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT)
-#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT)
-#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT)
-#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT)
-#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT)
-
-#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2)
-
-#endif /* GL_EXT_draw_buffers2 */
-
-/* ------------------------- GL_EXT_draw_instanced ------------------------- */
-
-#ifndef GL_EXT_draw_instanced
-#define GL_EXT_draw_instanced 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount);
-
-#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT)
-#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT)
-
-#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced)
-
-#endif /* GL_EXT_draw_instanced */
-
-/* ----------------------- GL_EXT_draw_range_elements ---------------------- */
-
-#ifndef GL_EXT_draw_range_elements
-#define GL_EXT_draw_range_elements 1
-
-#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8
-#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9
-
-typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices);
-
-#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT)
-
-#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements)
-
-#endif /* GL_EXT_draw_range_elements */
-
-/* ---------------------------- GL_EXT_fog_coord --------------------------- */
-
-#ifndef GL_EXT_fog_coord
-#define GL_EXT_fog_coord 1
-
-#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450
-#define GL_FOG_COORDINATE_EXT 0x8451
-#define GL_FRAGMENT_DEPTH_EXT 0x8452
-#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453
-#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454
-#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455
-#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456
-#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457
-
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord);
-
-#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT)
-#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT)
-#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT)
-#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT)
-#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT)
-
-#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord)
-
-#endif /* GL_EXT_fog_coord */
-
-/* ------------------------ GL_EXT_fragment_lighting ----------------------- */
-
-#ifndef GL_EXT_fragment_lighting
-#define GL_EXT_fragment_lighting 1
-
-#define GL_FRAGMENT_LIGHTING_EXT 0x8400
-#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401
-#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402
-#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403
-#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404
-#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405
-#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406
-#define GL_LIGHT_ENV_MODE_EXT 0x8407
-#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408
-#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409
-#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A
-#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B
-#define GL_FRAGMENT_LIGHT0_EXT 0x840C
-#define GL_FRAGMENT_LIGHT7_EXT 0x8413
-
-typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param);
-
-#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT)
-#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT)
-#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT)
-#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT)
-#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT)
-#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT)
-#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT)
-#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT)
-#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT)
-#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT)
-#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT)
-#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT)
-#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT)
-#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT)
-#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT)
-#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT)
-#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT)
-#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT)
-
-#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting)
-
-#endif /* GL_EXT_fragment_lighting */
-
-/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */
-
-#ifndef GL_EXT_framebuffer_blit
-#define GL_EXT_framebuffer_blit 1
-
-#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_READ_FRAMEBUFFER_EXT 0x8CA8
-#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9
-#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA
-
-typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-
-#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT)
-
-#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit)
-
-#endif /* GL_EXT_framebuffer_blit */
-
-/* --------------------- GL_EXT_framebuffer_multisample -------------------- */
-
-#ifndef GL_EXT_framebuffer_multisample
-#define GL_EXT_framebuffer_multisample 1
-
-#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
-#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
-#define GL_MAX_SAMPLES_EXT 0x8D57
-
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT)
-
-#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample)
-
-#endif /* GL_EXT_framebuffer_multisample */
-
-/* --------------- GL_EXT_framebuffer_multisample_blit_scaled -------------- */
-
-#ifndef GL_EXT_framebuffer_multisample_blit_scaled
-#define GL_EXT_framebuffer_multisample_blit_scaled 1
-
-#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
-#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
-
-#define GLEW_EXT_framebuffer_multisample_blit_scaled GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample_blit_scaled)
-
-#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
-
-/* ----------------------- GL_EXT_framebuffer_object ----------------------- */
-
-#ifndef GL_EXT_framebuffer_object
-#define GL_EXT_framebuffer_object 1
-
-#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506
-#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8
-#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6
-#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0
-#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4
-#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5
-#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6
-#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7
-#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9
-#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA
-#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB
-#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC
-#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD
-#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF
-#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0
-#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1
-#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2
-#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3
-#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4
-#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5
-#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6
-#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7
-#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8
-#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9
-#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA
-#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB
-#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC
-#define GL_COLOR_ATTACHMENT13_EXT 0x8CED
-#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE
-#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF
-#define GL_DEPTH_ATTACHMENT_EXT 0x8D00
-#define GL_STENCIL_ATTACHMENT_EXT 0x8D20
-#define GL_FRAMEBUFFER_EXT 0x8D40
-#define GL_RENDERBUFFER_EXT 0x8D41
-#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42
-#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43
-#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44
-#define GL_STENCIL_INDEX1_EXT 0x8D46
-#define GL_STENCIL_INDEX4_EXT 0x8D47
-#define GL_STENCIL_INDEX8_EXT 0x8D48
-#define GL_STENCIL_INDEX16_EXT 0x8D49
-#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50
-#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51
-#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52
-#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53
-#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54
-#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer);
-typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer);
-typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
-typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers);
-typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers);
-typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer);
-typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer);
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT)
-#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT)
-#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT)
-#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT)
-#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT)
-#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT)
-#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT)
-#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT)
-#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT)
-#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT)
-#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT)
-#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT)
-#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT)
-#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT)
-#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT)
-#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT)
-#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT)
-
-#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object)
-
-#endif /* GL_EXT_framebuffer_object */
-
-/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */
-
-#ifndef GL_EXT_framebuffer_sRGB
-#define GL_EXT_framebuffer_sRGB 1
-
-#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9
-#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA
-
-#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB)
-
-#endif /* GL_EXT_framebuffer_sRGB */
-
-/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */
-
-#ifndef GL_EXT_geometry_shader4
-#define GL_EXT_geometry_shader4 1
-
-#define GL_LINES_ADJACENCY_EXT 0xA
-#define GL_LINE_STRIP_ADJACENCY_EXT 0xB
-#define GL_TRIANGLES_ADJACENCY_EXT 0xC
-#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD
-#define GL_PROGRAM_POINT_SIZE_EXT 0x8642
-#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B
-#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29
-#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4
-#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8
-#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9
-#define GL_GEOMETRY_SHADER_EXT 0x8DD9
-#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA
-#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB
-#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC
-#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD
-#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE
-#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF
-#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0
-#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level);
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value);
-
-#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT)
-#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT)
-#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT)
-
-#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4)
-
-#endif /* GL_EXT_geometry_shader4 */
-
-/* --------------------- GL_EXT_gpu_program_parameters --------------------- */
-
-#ifndef GL_EXT_gpu_program_parameters
-#define GL_EXT_gpu_program_parameters 1
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params);
-
-#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT)
-#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT)
-
-#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters)
-
-#endif /* GL_EXT_gpu_program_parameters */
-
-/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */
-
-#ifndef GL_EXT_gpu_shader4
-#define GL_EXT_gpu_shader4 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD
-#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0
-#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1
-#define GL_SAMPLER_BUFFER_EXT 0x8DC2
-#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3
-#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4
-#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5
-#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6
-#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7
-#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8
-#define GL_INT_SAMPLER_1D_EXT 0x8DC9
-#define GL_INT_SAMPLER_2D_EXT 0x8DCA
-#define GL_INT_SAMPLER_3D_EXT 0x8DCB
-#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC
-#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD
-#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE
-#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF
-#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0
-#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1
-#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2
-#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3
-#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4
-#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5
-#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6
-#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7
-#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8
-
-typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name);
-typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-
-#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT)
-#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT)
-#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT)
-#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT)
-#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT)
-#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT)
-#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT)
-#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT)
-#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT)
-#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT)
-#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT)
-#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT)
-#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT)
-#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT)
-#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT)
-#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT)
-#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT)
-#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT)
-#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT)
-#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT)
-#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT)
-#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT)
-#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT)
-#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT)
-#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT)
-#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT)
-#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT)
-#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT)
-#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT)
-#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT)
-#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT)
-#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT)
-#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT)
-#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT)
-
-#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4)
-
-#endif /* GL_EXT_gpu_shader4 */
-
-/* ---------------------------- GL_EXT_histogram --------------------------- */
-
-#ifndef GL_EXT_histogram
-#define GL_EXT_histogram 1
-
-#define GL_HISTOGRAM_EXT 0x8024
-#define GL_PROXY_HISTOGRAM_EXT 0x8025
-#define GL_HISTOGRAM_WIDTH_EXT 0x8026
-#define GL_HISTOGRAM_FORMAT_EXT 0x8027
-#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028
-#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029
-#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A
-#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B
-#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C
-#define GL_HISTOGRAM_SINK_EXT 0x802D
-#define GL_MINMAX_EXT 0x802E
-#define GL_MINMAX_FORMAT_EXT 0x802F
-#define GL_MINMAX_SINK_EXT 0x8030
-
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink);
-typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target);
-
-#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT)
-#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT)
-#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT)
-#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT)
-#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT)
-#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT)
-#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT)
-#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT)
-#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT)
-#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT)
-
-#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram)
-
-#endif /* GL_EXT_histogram */
-
-/* ----------------------- GL_EXT_index_array_formats ---------------------- */
-
-#ifndef GL_EXT_index_array_formats
-#define GL_EXT_index_array_formats 1
-
-#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats)
-
-#endif /* GL_EXT_index_array_formats */
-
-/* --------------------------- GL_EXT_index_func --------------------------- */
-
-#ifndef GL_EXT_index_func
-#define GL_EXT_index_func 1
-
-typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref);
-
-#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT)
-
-#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func)
-
-#endif /* GL_EXT_index_func */
-
-/* ------------------------- GL_EXT_index_material ------------------------- */
-
-#ifndef GL_EXT_index_material
-#define GL_EXT_index_material 1
-
-typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode);
-
-#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT)
-
-#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material)
-
-#endif /* GL_EXT_index_material */
-
-/* -------------------------- GL_EXT_index_texture ------------------------- */
-
-#ifndef GL_EXT_index_texture
-#define GL_EXT_index_texture 1
-
-#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture)
-
-#endif /* GL_EXT_index_texture */
-
-/* -------------------------- GL_EXT_light_texture ------------------------- */
-
-#ifndef GL_EXT_light_texture
-#define GL_EXT_light_texture 1
-
-#define GL_FRAGMENT_MATERIAL_EXT 0x8349
-#define GL_FRAGMENT_NORMAL_EXT 0x834A
-#define GL_FRAGMENT_COLOR_EXT 0x834C
-#define GL_ATTENUATION_EXT 0x834D
-#define GL_SHADOW_ATTENUATION_EXT 0x834E
-#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F
-#define GL_TEXTURE_LIGHT_EXT 0x8350
-#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351
-#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352
-
-typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode);
-typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname);
-typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode);
-
-#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT)
-#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT)
-#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT)
-
-#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture)
-
-#endif /* GL_EXT_light_texture */
-
-/* ------------------------- GL_EXT_misc_attribute ------------------------- */
-
-#ifndef GL_EXT_misc_attribute
-#define GL_EXT_misc_attribute 1
-
-#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute)
-
-#endif /* GL_EXT_misc_attribute */
-
-/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */
-
-#ifndef GL_EXT_multi_draw_arrays
-#define GL_EXT_multi_draw_arrays 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid * const *indices, GLsizei primcount);
-
-#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT)
-#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT)
-
-#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays)
-
-#endif /* GL_EXT_multi_draw_arrays */
-
-/* --------------------------- GL_EXT_multisample -------------------------- */
-
-#ifndef GL_EXT_multisample
-#define GL_EXT_multisample 1
-
-#define GL_MULTISAMPLE_EXT 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F
-#define GL_SAMPLE_MASK_EXT 0x80A0
-#define GL_1PASS_EXT 0x80A1
-#define GL_2PASS_0_EXT 0x80A2
-#define GL_2PASS_1_EXT 0x80A3
-#define GL_4PASS_0_EXT 0x80A4
-#define GL_4PASS_1_EXT 0x80A5
-#define GL_4PASS_2_EXT 0x80A6
-#define GL_4PASS_3_EXT 0x80A7
-#define GL_SAMPLE_BUFFERS_EXT 0x80A8
-#define GL_SAMPLES_EXT 0x80A9
-#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA
-#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB
-#define GL_SAMPLE_PATTERN_EXT 0x80AC
-#define GL_MULTISAMPLE_BIT_EXT 0x20000000
-
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert);
-typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern);
-
-#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT)
-#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT)
-
-#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample)
-
-#endif /* GL_EXT_multisample */
-
-/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */
-
-#ifndef GL_EXT_packed_depth_stencil
-#define GL_EXT_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_EXT 0x84F9
-#define GL_UNSIGNED_INT_24_8_EXT 0x84FA
-#define GL_DEPTH24_STENCIL8_EXT 0x88F0
-#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1
-
-#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil)
-
-#endif /* GL_EXT_packed_depth_stencil */
-
-/* -------------------------- GL_EXT_packed_float -------------------------- */
-
-#ifndef GL_EXT_packed_float
-#define GL_EXT_packed_float 1
-
-#define GL_R11F_G11F_B10F_EXT 0x8C3A
-#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B
-#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C
-
-#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float)
-
-#endif /* GL_EXT_packed_float */
-
-/* -------------------------- GL_EXT_packed_pixels ------------------------- */
-
-#ifndef GL_EXT_packed_pixels
-#define GL_EXT_packed_pixels 1
-
-#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032
-#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034
-#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035
-#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036
-
-#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels)
-
-#endif /* GL_EXT_packed_pixels */
-
-/* ------------------------ GL_EXT_paletted_texture ------------------------ */
-
-#ifndef GL_EXT_paletted_texture
-#define GL_EXT_paletted_texture 1
-
-#define GL_TEXTURE_1D 0x0DE0
-#define GL_TEXTURE_2D 0x0DE1
-#define GL_PROXY_TEXTURE_1D 0x8063
-#define GL_PROXY_TEXTURE_2D 0x8064
-#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8
-#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF
-#define GL_COLOR_INDEX1_EXT 0x80E2
-#define GL_COLOR_INDEX2_EXT 0x80E3
-#define GL_COLOR_INDEX4_EXT 0x80E4
-#define GL_COLOR_INDEX8_EXT 0x80E5
-#define GL_COLOR_INDEX12_EXT 0x80E6
-#define GL_COLOR_INDEX16_EXT 0x80E7
-#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED
-#define GL_TEXTURE_CUBE_MAP_ARB 0x8513
-#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B
-
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params);
-
-#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT)
-#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT)
-#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT)
-#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT)
-
-#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture)
-
-#endif /* GL_EXT_paletted_texture */
-
-/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */
-
-#ifndef GL_EXT_pixel_buffer_object
-#define GL_EXT_pixel_buffer_object 1
-
-#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB
-#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC
-#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED
-#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF
-
-#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object)
-
-#endif /* GL_EXT_pixel_buffer_object */
-
-/* ------------------------- GL_EXT_pixel_transform ------------------------ */
-
-#ifndef GL_EXT_pixel_transform
-#define GL_EXT_pixel_transform 1
-
-#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330
-#define GL_PIXEL_MAG_FILTER_EXT 0x8331
-#define GL_PIXEL_MIN_FILTER_EXT 0x8332
-#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333
-#define GL_CUBIC_EXT 0x8334
-#define GL_AVERAGE_EXT 0x8335
-#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336
-#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337
-#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338
-
-typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT)
-#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT)
-#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT)
-#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT)
-#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT)
-#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT)
-
-#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform)
-
-#endif /* GL_EXT_pixel_transform */
-
-/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */
-
-#ifndef GL_EXT_pixel_transform_color_table
-#define GL_EXT_pixel_transform_color_table 1
-
-#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table)
-
-#endif /* GL_EXT_pixel_transform_color_table */
-
-/* ------------------------ GL_EXT_point_parameters ------------------------ */
-
-#ifndef GL_EXT_point_parameters
-#define GL_EXT_point_parameters 1
-
-#define GL_POINT_SIZE_MIN_EXT 0x8126
-#define GL_POINT_SIZE_MAX_EXT 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128
-#define GL_DISTANCE_ATTENUATION_EXT 0x8129
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params);
-
-#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT)
-#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT)
-
-#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters)
-
-#endif /* GL_EXT_point_parameters */
-
-/* ------------------------- GL_EXT_polygon_offset ------------------------- */
-
-#ifndef GL_EXT_polygon_offset
-#define GL_EXT_polygon_offset 1
-
-#define GL_POLYGON_OFFSET_EXT 0x8037
-#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038
-#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039
-
-typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias);
-
-#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT)
-
-#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset)
-
-#endif /* GL_EXT_polygon_offset */
-
-/* ------------------------ GL_EXT_provoking_vertex ------------------------ */
-
-#ifndef GL_EXT_provoking_vertex
-#define GL_EXT_provoking_vertex 1
-
-#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C
-#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D
-#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E
-#define GL_PROVOKING_VERTEX_EXT 0x8E4F
-
-typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode);
-
-#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT)
-
-#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex)
-
-#endif /* GL_EXT_provoking_vertex */
-
-/* ------------------------- GL_EXT_rescale_normal ------------------------- */
-
-#ifndef GL_EXT_rescale_normal
-#define GL_EXT_rescale_normal 1
-
-#define GL_RESCALE_NORMAL_EXT 0x803A
-
-#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal)
-
-#endif /* GL_EXT_rescale_normal */
-
-/* -------------------------- GL_EXT_scene_marker -------------------------- */
-
-#ifndef GL_EXT_scene_marker
-#define GL_EXT_scene_marker 1
-
-typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void);
-
-#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT)
-#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT)
-
-#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker)
-
-#endif /* GL_EXT_scene_marker */
-
-/* ------------------------- GL_EXT_secondary_color ------------------------ */
-
-#ifndef GL_EXT_secondary_color
-#define GL_EXT_secondary_color 1
-
-#define GL_COLOR_SUM_EXT 0x8458
-#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459
-#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A
-#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B
-#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C
-#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D
-#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E
-
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-
-#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT)
-#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT)
-#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT)
-#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT)
-#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT)
-#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT)
-#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT)
-#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT)
-#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT)
-#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT)
-#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT)
-#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT)
-#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT)
-#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT)
-#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT)
-#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT)
-#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT)
-
-#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color)
-
-#endif /* GL_EXT_secondary_color */
-
-/* --------------------- GL_EXT_separate_shader_objects -------------------- */
-
-#ifndef GL_EXT_separate_shader_objects
-#define GL_EXT_separate_shader_objects 1
-
-#define GL_ACTIVE_PROGRAM_EXT 0x8B8D
-
-typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program);
-typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const GLchar* string);
-typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program);
-
-#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT)
-#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT)
-#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT)
-
-#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects)
-
-#endif /* GL_EXT_separate_shader_objects */
-
-/* --------------------- GL_EXT_separate_specular_color -------------------- */
-
-#ifndef GL_EXT_separate_specular_color
-#define GL_EXT_separate_specular_color 1
-
-#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8
-#define GL_SINGLE_COLOR_EXT 0x81F9
-#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA
-
-#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color)
-
-#endif /* GL_EXT_separate_specular_color */
-
-/* --------------------- GL_EXT_shader_image_load_store -------------------- */
-
-#ifndef GL_EXT_shader_image_load_store
-#define GL_EXT_shader_image_load_store 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001
-#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002
-#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004
-#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008
-#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020
-#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040
-#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080
-#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100
-#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200
-#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400
-#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800
-#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000
-#define GL_MAX_IMAGE_UNITS_EXT 0x8F38
-#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39
-#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A
-#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B
-#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C
-#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D
-#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E
-#define GL_IMAGE_1D_EXT 0x904C
-#define GL_IMAGE_2D_EXT 0x904D
-#define GL_IMAGE_3D_EXT 0x904E
-#define GL_IMAGE_2D_RECT_EXT 0x904F
-#define GL_IMAGE_CUBE_EXT 0x9050
-#define GL_IMAGE_BUFFER_EXT 0x9051
-#define GL_IMAGE_1D_ARRAY_EXT 0x9052
-#define GL_IMAGE_2D_ARRAY_EXT 0x9053
-#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054
-#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055
-#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056
-#define GL_INT_IMAGE_1D_EXT 0x9057
-#define GL_INT_IMAGE_2D_EXT 0x9058
-#define GL_INT_IMAGE_3D_EXT 0x9059
-#define GL_INT_IMAGE_2D_RECT_EXT 0x905A
-#define GL_INT_IMAGE_CUBE_EXT 0x905B
-#define GL_INT_IMAGE_BUFFER_EXT 0x905C
-#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D
-#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E
-#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F
-#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060
-#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061
-#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062
-#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063
-#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064
-#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065
-#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066
-#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067
-#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068
-#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069
-#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B
-#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C
-#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D
-#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E
-#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF
-
-typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format);
-typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers);
-
-#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT)
-#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT)
-
-#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store)
-
-#endif /* GL_EXT_shader_image_load_store */
-
-/* -------------------------- GL_EXT_shadow_funcs -------------------------- */
-
-#ifndef GL_EXT_shadow_funcs
-#define GL_EXT_shadow_funcs 1
-
-#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs)
-
-#endif /* GL_EXT_shadow_funcs */
-
-/* --------------------- GL_EXT_shared_texture_palette --------------------- */
-
-#ifndef GL_EXT_shared_texture_palette
-#define GL_EXT_shared_texture_palette 1
-
-#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB
-
-#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette)
-
-#endif /* GL_EXT_shared_texture_palette */
-
-/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */
-
-#ifndef GL_EXT_stencil_clear_tag
-#define GL_EXT_stencil_clear_tag 1
-
-#define GL_STENCIL_TAG_BITS_EXT 0x88F2
-#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3
-
-#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag)
-
-#endif /* GL_EXT_stencil_clear_tag */
-
-/* ------------------------ GL_EXT_stencil_two_side ------------------------ */
-
-#ifndef GL_EXT_stencil_two_side
-#define GL_EXT_stencil_two_side 1
-
-#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910
-#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911
-
-typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face);
-
-#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT)
-
-#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side)
-
-#endif /* GL_EXT_stencil_two_side */
-
-/* -------------------------- GL_EXT_stencil_wrap -------------------------- */
-
-#ifndef GL_EXT_stencil_wrap
-#define GL_EXT_stencil_wrap 1
-
-#define GL_INCR_WRAP_EXT 0x8507
-#define GL_DECR_WRAP_EXT 0x8508
-
-#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap)
-
-#endif /* GL_EXT_stencil_wrap */
-
-/* --------------------------- GL_EXT_subtexture --------------------------- */
-
-#ifndef GL_EXT_subtexture
-#define GL_EXT_subtexture 1
-
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels);
-
-#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT)
-#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT)
-#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT)
-
-#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture)
-
-#endif /* GL_EXT_subtexture */
-
-/* ----------------------------- GL_EXT_texture ---------------------------- */
-
-#ifndef GL_EXT_texture
-#define GL_EXT_texture 1
-
-#define GL_ALPHA4_EXT 0x803B
-#define GL_ALPHA8_EXT 0x803C
-#define GL_ALPHA12_EXT 0x803D
-#define GL_ALPHA16_EXT 0x803E
-#define GL_LUMINANCE4_EXT 0x803F
-#define GL_LUMINANCE8_EXT 0x8040
-#define GL_LUMINANCE12_EXT 0x8041
-#define GL_LUMINANCE16_EXT 0x8042
-#define GL_LUMINANCE4_ALPHA4_EXT 0x8043
-#define GL_LUMINANCE6_ALPHA2_EXT 0x8044
-#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
-#define GL_LUMINANCE12_ALPHA4_EXT 0x8046
-#define GL_LUMINANCE12_ALPHA12_EXT 0x8047
-#define GL_LUMINANCE16_ALPHA16_EXT 0x8048
-#define GL_INTENSITY_EXT 0x8049
-#define GL_INTENSITY4_EXT 0x804A
-#define GL_INTENSITY8_EXT 0x804B
-#define GL_INTENSITY12_EXT 0x804C
-#define GL_INTENSITY16_EXT 0x804D
-#define GL_RGB2_EXT 0x804E
-#define GL_RGB4_EXT 0x804F
-#define GL_RGB5_EXT 0x8050
-#define GL_RGB8_EXT 0x8051
-#define GL_RGB10_EXT 0x8052
-#define GL_RGB12_EXT 0x8053
-#define GL_RGB16_EXT 0x8054
-#define GL_RGBA2_EXT 0x8055
-#define GL_RGBA4_EXT 0x8056
-#define GL_RGB5_A1_EXT 0x8057
-#define GL_RGBA8_EXT 0x8058
-#define GL_RGB10_A2_EXT 0x8059
-#define GL_RGBA12_EXT 0x805A
-#define GL_RGBA16_EXT 0x805B
-#define GL_TEXTURE_RED_SIZE_EXT 0x805C
-#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D
-#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E
-#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F
-#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060
-#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061
-#define GL_REPLACE_EXT 0x8062
-#define GL_PROXY_TEXTURE_1D_EXT 0x8063
-#define GL_PROXY_TEXTURE_2D_EXT 0x8064
-
-#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture)
-
-#endif /* GL_EXT_texture */
-
-/* ---------------------------- GL_EXT_texture3D --------------------------- */
-
-#ifndef GL_EXT_texture3D
-#define GL_EXT_texture3D 1
-
-#define GL_PACK_SKIP_IMAGES_EXT 0x806B
-#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C
-#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D
-#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E
-#define GL_TEXTURE_3D_EXT 0x806F
-#define GL_PROXY_TEXTURE_3D_EXT 0x8070
-#define GL_TEXTURE_DEPTH_EXT 0x8071
-#define GL_TEXTURE_WRAP_R_EXT 0x8072
-#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-
-#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT)
-
-#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D)
-
-#endif /* GL_EXT_texture3D */
-
-/* -------------------------- GL_EXT_texture_array ------------------------- */
-
-#ifndef GL_EXT_texture_array
-#define GL_EXT_texture_array 1
-
-#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E
-#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF
-#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18
-#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19
-#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A
-#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B
-#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C
-#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D
-
-typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
-
-#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT)
-
-#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array)
-
-#endif /* GL_EXT_texture_array */
-
-/* ---------------------- GL_EXT_texture_buffer_object --------------------- */
-
-#ifndef GL_EXT_texture_buffer_object
-#define GL_EXT_texture_buffer_object 1
-
-#define GL_TEXTURE_BUFFER_EXT 0x8C2A
-#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B
-#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C
-#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D
-#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E
-
-typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer);
-
-#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT)
-
-#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object)
-
-#endif /* GL_EXT_texture_buffer_object */
-
-/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */
-
-#ifndef GL_EXT_texture_compression_dxt1
-#define GL_EXT_texture_compression_dxt1 1
-
-#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1)
-
-#endif /* GL_EXT_texture_compression_dxt1 */
-
-/* -------------------- GL_EXT_texture_compression_latc -------------------- */
-
-#ifndef GL_EXT_texture_compression_latc
-#define GL_EXT_texture_compression_latc 1
-
-#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70
-#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71
-#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72
-#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73
-
-#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc)
-
-#endif /* GL_EXT_texture_compression_latc */
-
-/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */
-
-#ifndef GL_EXT_texture_compression_rgtc
-#define GL_EXT_texture_compression_rgtc 1
-
-#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB
-#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
-#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
-#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
-
-#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc)
-
-#endif /* GL_EXT_texture_compression_rgtc */
-
-/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */
-
-#ifndef GL_EXT_texture_compression_s3tc
-#define GL_EXT_texture_compression_s3tc 1
-
-#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
-#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
-#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2
-#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3
-
-#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc)
-
-#endif /* GL_EXT_texture_compression_s3tc */
-
-/* ------------------------ GL_EXT_texture_cube_map ------------------------ */
-
-#ifndef GL_EXT_texture_cube_map
-#define GL_EXT_texture_cube_map 1
-
-#define GL_NORMAL_MAP_EXT 0x8511
-#define GL_REFLECTION_MAP_EXT 0x8512
-#define GL_TEXTURE_CUBE_MAP_EXT 0x8513
-#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518
-#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519
-#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A
-#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B
-#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C
-
-#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map)
-
-#endif /* GL_EXT_texture_cube_map */
-
-/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */
-
-#ifndef GL_EXT_texture_edge_clamp
-#define GL_EXT_texture_edge_clamp 1
-
-#define GL_CLAMP_TO_EDGE_EXT 0x812F
-
-#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp)
-
-#endif /* GL_EXT_texture_edge_clamp */
-
-/* --------------------------- GL_EXT_texture_env -------------------------- */
-
-#ifndef GL_EXT_texture_env
-#define GL_EXT_texture_env 1
-
-#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env)
-
-#endif /* GL_EXT_texture_env */
-
-/* ------------------------- GL_EXT_texture_env_add ------------------------ */
-
-#ifndef GL_EXT_texture_env_add
-#define GL_EXT_texture_env_add 1
-
-#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add)
-
-#endif /* GL_EXT_texture_env_add */
-
-/* ----------------------- GL_EXT_texture_env_combine ---------------------- */
-
-#ifndef GL_EXT_texture_env_combine
-#define GL_EXT_texture_env_combine 1
-
-#define GL_COMBINE_EXT 0x8570
-#define GL_COMBINE_RGB_EXT 0x8571
-#define GL_COMBINE_ALPHA_EXT 0x8572
-#define GL_RGB_SCALE_EXT 0x8573
-#define GL_ADD_SIGNED_EXT 0x8574
-#define GL_INTERPOLATE_EXT 0x8575
-#define GL_CONSTANT_EXT 0x8576
-#define GL_PRIMARY_COLOR_EXT 0x8577
-#define GL_PREVIOUS_EXT 0x8578
-#define GL_SOURCE0_RGB_EXT 0x8580
-#define GL_SOURCE1_RGB_EXT 0x8581
-#define GL_SOURCE2_RGB_EXT 0x8582
-#define GL_SOURCE0_ALPHA_EXT 0x8588
-#define GL_SOURCE1_ALPHA_EXT 0x8589
-#define GL_SOURCE2_ALPHA_EXT 0x858A
-#define GL_OPERAND0_RGB_EXT 0x8590
-#define GL_OPERAND1_RGB_EXT 0x8591
-#define GL_OPERAND2_RGB_EXT 0x8592
-#define GL_OPERAND0_ALPHA_EXT 0x8598
-#define GL_OPERAND1_ALPHA_EXT 0x8599
-#define GL_OPERAND2_ALPHA_EXT 0x859A
-
-#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine)
-
-#endif /* GL_EXT_texture_env_combine */
-
-/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */
-
-#ifndef GL_EXT_texture_env_dot3
-#define GL_EXT_texture_env_dot3 1
-
-#define GL_DOT3_RGB_EXT 0x8740
-#define GL_DOT3_RGBA_EXT 0x8741
-
-#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3)
-
-#endif /* GL_EXT_texture_env_dot3 */
-
-/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */
-
-#ifndef GL_EXT_texture_filter_anisotropic
-#define GL_EXT_texture_filter_anisotropic 1
-
-#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
-#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
-
-#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic)
-
-#endif /* GL_EXT_texture_filter_anisotropic */
-
-/* ------------------------- GL_EXT_texture_integer ------------------------ */
-
-#ifndef GL_EXT_texture_integer
-#define GL_EXT_texture_integer 1
-
-#define GL_RGBA32UI_EXT 0x8D70
-#define GL_RGB32UI_EXT 0x8D71
-#define GL_ALPHA32UI_EXT 0x8D72
-#define GL_INTENSITY32UI_EXT 0x8D73
-#define GL_LUMINANCE32UI_EXT 0x8D74
-#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75
-#define GL_RGBA16UI_EXT 0x8D76
-#define GL_RGB16UI_EXT 0x8D77
-#define GL_ALPHA16UI_EXT 0x8D78
-#define GL_INTENSITY16UI_EXT 0x8D79
-#define GL_LUMINANCE16UI_EXT 0x8D7A
-#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B
-#define GL_RGBA8UI_EXT 0x8D7C
-#define GL_RGB8UI_EXT 0x8D7D
-#define GL_ALPHA8UI_EXT 0x8D7E
-#define GL_INTENSITY8UI_EXT 0x8D7F
-#define GL_LUMINANCE8UI_EXT 0x8D80
-#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81
-#define GL_RGBA32I_EXT 0x8D82
-#define GL_RGB32I_EXT 0x8D83
-#define GL_ALPHA32I_EXT 0x8D84
-#define GL_INTENSITY32I_EXT 0x8D85
-#define GL_LUMINANCE32I_EXT 0x8D86
-#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87
-#define GL_RGBA16I_EXT 0x8D88
-#define GL_RGB16I_EXT 0x8D89
-#define GL_ALPHA16I_EXT 0x8D8A
-#define GL_INTENSITY16I_EXT 0x8D8B
-#define GL_LUMINANCE16I_EXT 0x8D8C
-#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D
-#define GL_RGBA8I_EXT 0x8D8E
-#define GL_RGB8I_EXT 0x8D8F
-#define GL_ALPHA8I_EXT 0x8D90
-#define GL_INTENSITY8I_EXT 0x8D91
-#define GL_LUMINANCE8I_EXT 0x8D92
-#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93
-#define GL_RED_INTEGER_EXT 0x8D94
-#define GL_GREEN_INTEGER_EXT 0x8D95
-#define GL_BLUE_INTEGER_EXT 0x8D96
-#define GL_ALPHA_INTEGER_EXT 0x8D97
-#define GL_RGB_INTEGER_EXT 0x8D98
-#define GL_RGBA_INTEGER_EXT 0x8D99
-#define GL_BGR_INTEGER_EXT 0x8D9A
-#define GL_BGRA_INTEGER_EXT 0x8D9B
-#define GL_LUMINANCE_INTEGER_EXT 0x8D9C
-#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D
-#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E
-
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha);
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params);
-
-#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT)
-#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT)
-#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT)
-#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT)
-#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT)
-#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT)
-
-#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer)
-
-#endif /* GL_EXT_texture_integer */
-
-/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */
-
-#ifndef GL_EXT_texture_lod_bias
-#define GL_EXT_texture_lod_bias 1
-
-#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
-#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
-#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
-
-#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias)
-
-#endif /* GL_EXT_texture_lod_bias */
-
-/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */
-
-#ifndef GL_EXT_texture_mirror_clamp
-#define GL_EXT_texture_mirror_clamp 1
-
-#define GL_MIRROR_CLAMP_EXT 0x8742
-#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743
-#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912
-
-#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp)
-
-#endif /* GL_EXT_texture_mirror_clamp */
-
-/* ------------------------- GL_EXT_texture_object ------------------------- */
-
-#ifndef GL_EXT_texture_object
-#define GL_EXT_texture_object 1
-
-#define GL_TEXTURE_PRIORITY_EXT 0x8066
-#define GL_TEXTURE_RESIDENT_EXT 0x8067
-#define GL_TEXTURE_1D_BINDING_EXT 0x8068
-#define GL_TEXTURE_2D_BINDING_EXT 0x8069
-#define GL_TEXTURE_3D_BINDING_EXT 0x806A
-
-typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences);
-typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture);
-typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures);
-typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures);
-typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture);
-typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities);
-
-#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT)
-#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT)
-#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT)
-#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT)
-#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT)
-#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT)
-
-#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object)
-
-#endif /* GL_EXT_texture_object */
-
-/* --------------------- GL_EXT_texture_perturb_normal --------------------- */
-
-#ifndef GL_EXT_texture_perturb_normal
-#define GL_EXT_texture_perturb_normal 1
-
-#define GL_PERTURB_EXT 0x85AE
-#define GL_TEXTURE_NORMAL_EXT 0x85AF
-
-typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode);
-
-#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT)
-
-#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal)
-
-#endif /* GL_EXT_texture_perturb_normal */
-
-/* ------------------------ GL_EXT_texture_rectangle ----------------------- */
-
-#ifndef GL_EXT_texture_rectangle
-#define GL_EXT_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_EXT 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8
-
-#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle)
-
-#endif /* GL_EXT_texture_rectangle */
-
-/* -------------------------- GL_EXT_texture_sRGB -------------------------- */
-
-#ifndef GL_EXT_texture_sRGB
-#define GL_EXT_texture_sRGB 1
-
-#define GL_SRGB_EXT 0x8C40
-#define GL_SRGB8_EXT 0x8C41
-#define GL_SRGB_ALPHA_EXT 0x8C42
-#define GL_SRGB8_ALPHA8_EXT 0x8C43
-#define GL_SLUMINANCE_ALPHA_EXT 0x8C44
-#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45
-#define GL_SLUMINANCE_EXT 0x8C46
-#define GL_SLUMINANCE8_EXT 0x8C47
-#define GL_COMPRESSED_SRGB_EXT 0x8C48
-#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49
-#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A
-#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B
-#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
-#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
-
-#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB)
-
-#endif /* GL_EXT_texture_sRGB */
-
-/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */
-
-#ifndef GL_EXT_texture_sRGB_decode
-#define GL_EXT_texture_sRGB_decode 1
-
-#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48
-#define GL_DECODE_EXT 0x8A49
-#define GL_SKIP_DECODE_EXT 0x8A4A
-
-#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode)
-
-#endif /* GL_EXT_texture_sRGB_decode */
-
-/* --------------------- GL_EXT_texture_shared_exponent -------------------- */
-
-#ifndef GL_EXT_texture_shared_exponent
-#define GL_EXT_texture_shared_exponent 1
-
-#define GL_RGB9_E5_EXT 0x8C3D
-#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E
-#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F
-
-#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent)
-
-#endif /* GL_EXT_texture_shared_exponent */
-
-/* -------------------------- GL_EXT_texture_snorm ------------------------- */
-
-#ifndef GL_EXT_texture_snorm
-#define GL_EXT_texture_snorm 1
-
-#define GL_RED_SNORM 0x8F90
-#define GL_RG_SNORM 0x8F91
-#define GL_RGB_SNORM 0x8F92
-#define GL_RGBA_SNORM 0x8F93
-#define GL_R8_SNORM 0x8F94
-#define GL_RG8_SNORM 0x8F95
-#define GL_RGB8_SNORM 0x8F96
-#define GL_RGBA8_SNORM 0x8F97
-#define GL_R16_SNORM 0x8F98
-#define GL_RG16_SNORM 0x8F99
-#define GL_RGB16_SNORM 0x8F9A
-#define GL_RGBA16_SNORM 0x8F9B
-#define GL_SIGNED_NORMALIZED 0x8F9C
-#define GL_ALPHA_SNORM 0x9010
-#define GL_LUMINANCE_SNORM 0x9011
-#define GL_LUMINANCE_ALPHA_SNORM 0x9012
-#define GL_INTENSITY_SNORM 0x9013
-#define GL_ALPHA8_SNORM 0x9014
-#define GL_LUMINANCE8_SNORM 0x9015
-#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016
-#define GL_INTENSITY8_SNORM 0x9017
-#define GL_ALPHA16_SNORM 0x9018
-#define GL_LUMINANCE16_SNORM 0x9019
-#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A
-#define GL_INTENSITY16_SNORM 0x901B
-
-#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm)
-
-#endif /* GL_EXT_texture_snorm */
-
-/* ------------------------- GL_EXT_texture_swizzle ------------------------ */
-
-#ifndef GL_EXT_texture_swizzle
-#define GL_EXT_texture_swizzle 1
-
-#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42
-#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43
-#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44
-#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45
-#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46
-
-#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle)
-
-#endif /* GL_EXT_texture_swizzle */
-
-/* --------------------------- GL_EXT_timer_query -------------------------- */
-
-#ifndef GL_EXT_timer_query
-#define GL_EXT_timer_query 1
-
-#define GL_TIME_ELAPSED_EXT 0x88BF
-
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params);
-typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params);
-
-#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT)
-#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT)
-
-#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query)
-
-#endif /* GL_EXT_timer_query */
-
-/* ----------------------- GL_EXT_transform_feedback ----------------------- */
-
-#ifndef GL_EXT_transform_feedback
-#define GL_EXT_transform_feedback 1
-
-#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85
-#define GL_PRIMITIVES_GENERATED_EXT 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88
-#define GL_RASTERIZER_DISCARD_EXT 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C
-#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F
-
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const GLchar * const* varyings, GLenum bufferMode);
-
-#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT)
-#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT)
-#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT)
-#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT)
-#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT)
-#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT)
-#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT)
-
-#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback)
-
-#endif /* GL_EXT_transform_feedback */
-
-/* -------------------------- GL_EXT_vertex_array -------------------------- */
-
-#ifndef GL_EXT_vertex_array
-#define GL_EXT_vertex_array 1
-
-#define GL_DOUBLE_EXT 0x140A
-#define GL_VERTEX_ARRAY_EXT 0x8074
-#define GL_NORMAL_ARRAY_EXT 0x8075
-#define GL_COLOR_ARRAY_EXT 0x8076
-#define GL_INDEX_ARRAY_EXT 0x8077
-#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078
-#define GL_EDGE_FLAG_ARRAY_EXT 0x8079
-#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A
-#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B
-#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C
-#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D
-#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E
-#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F
-#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080
-#define GL_COLOR_ARRAY_SIZE_EXT 0x8081
-#define GL_COLOR_ARRAY_TYPE_EXT 0x8082
-#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083
-#define GL_COLOR_ARRAY_COUNT_EXT 0x8084
-#define GL_INDEX_ARRAY_TYPE_EXT 0x8085
-#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086
-#define GL_INDEX_ARRAY_COUNT_EXT 0x8087
-#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A
-#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B
-#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C
-#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D
-#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E
-#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F
-#define GL_COLOR_ARRAY_POINTER_EXT 0x8090
-#define GL_INDEX_ARRAY_POINTER_EXT 0x8091
-#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092
-#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093
-
-typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i);
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer);
-typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer);
-
-#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT)
-#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT)
-#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT)
-#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT)
-#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT)
-#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT)
-#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT)
-#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT)
-
-#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array)
-
-#endif /* GL_EXT_vertex_array */
-
-/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */
-
-#ifndef GL_EXT_vertex_array_bgra
-#define GL_EXT_vertex_array_bgra 1
-
-#define GL_BGRA 0x80E1
-
-#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra)
-
-#endif /* GL_EXT_vertex_array_bgra */
-
-/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */
-
-#ifndef GL_EXT_vertex_attrib_64bit
-#define GL_EXT_vertex_attrib_64bit 1
-
-#define GL_DOUBLE_MAT2_EXT 0x8F46
-#define GL_DOUBLE_MAT3_EXT 0x8F47
-#define GL_DOUBLE_MAT4_EXT 0x8F48
-#define GL_DOUBLE_MAT2x3_EXT 0x8F49
-#define GL_DOUBLE_MAT2x4_EXT 0x8F4A
-#define GL_DOUBLE_MAT3x2_EXT 0x8F4B
-#define GL_DOUBLE_MAT3x4_EXT 0x8F4C
-#define GL_DOUBLE_MAT4x2_EXT 0x8F4D
-#define GL_DOUBLE_MAT4x3_EXT 0x8F4E
-#define GL_DOUBLE_VEC2_EXT 0x8FFC
-#define GL_DOUBLE_VEC3_EXT 0x8FFD
-#define GL_DOUBLE_VEC4_EXT 0x8FFE
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-
-#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT)
-#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT)
-#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT)
-#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT)
-#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT)
-#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT)
-#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT)
-#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT)
-#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT)
-#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT)
-#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT)
-
-#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit)
-
-#endif /* GL_EXT_vertex_attrib_64bit */
-
-/* -------------------------- GL_EXT_vertex_shader ------------------------- */
-
-#ifndef GL_EXT_vertex_shader
-#define GL_EXT_vertex_shader 1
-
-#define GL_VERTEX_SHADER_EXT 0x8780
-#define GL_VERTEX_SHADER_BINDING_EXT 0x8781
-#define GL_OP_INDEX_EXT 0x8782
-#define GL_OP_NEGATE_EXT 0x8783
-#define GL_OP_DOT3_EXT 0x8784
-#define GL_OP_DOT4_EXT 0x8785
-#define GL_OP_MUL_EXT 0x8786
-#define GL_OP_ADD_EXT 0x8787
-#define GL_OP_MADD_EXT 0x8788
-#define GL_OP_FRAC_EXT 0x8789
-#define GL_OP_MAX_EXT 0x878A
-#define GL_OP_MIN_EXT 0x878B
-#define GL_OP_SET_GE_EXT 0x878C
-#define GL_OP_SET_LT_EXT 0x878D
-#define GL_OP_CLAMP_EXT 0x878E
-#define GL_OP_FLOOR_EXT 0x878F
-#define GL_OP_ROUND_EXT 0x8790
-#define GL_OP_EXP_BASE_2_EXT 0x8791
-#define GL_OP_LOG_BASE_2_EXT 0x8792
-#define GL_OP_POWER_EXT 0x8793
-#define GL_OP_RECIP_EXT 0x8794
-#define GL_OP_RECIP_SQRT_EXT 0x8795
-#define GL_OP_SUB_EXT 0x8796
-#define GL_OP_CROSS_PRODUCT_EXT 0x8797
-#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798
-#define GL_OP_MOV_EXT 0x8799
-#define GL_OUTPUT_VERTEX_EXT 0x879A
-#define GL_OUTPUT_COLOR0_EXT 0x879B
-#define GL_OUTPUT_COLOR1_EXT 0x879C
-#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D
-#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E
-#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F
-#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0
-#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1
-#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2
-#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3
-#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4
-#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5
-#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6
-#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7
-#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8
-#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9
-#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA
-#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB
-#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC
-#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD
-#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE
-#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF
-#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0
-#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1
-#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2
-#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3
-#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4
-#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5
-#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6
-#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7
-#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8
-#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9
-#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA
-#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB
-#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC
-#define GL_OUTPUT_FOG_EXT 0x87BD
-#define GL_SCALAR_EXT 0x87BE
-#define GL_VECTOR_EXT 0x87BF
-#define GL_MATRIX_EXT 0x87C0
-#define GL_VARIANT_EXT 0x87C1
-#define GL_INVARIANT_EXT 0x87C2
-#define GL_LOCAL_CONSTANT_EXT 0x87C3
-#define GL_LOCAL_EXT 0x87C4
-#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5
-#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6
-#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7
-#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8
-#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD
-#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE
-#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF
-#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0
-#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1
-#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2
-#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3
-#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4
-#define GL_X_EXT 0x87D5
-#define GL_Y_EXT 0x87D6
-#define GL_Z_EXT 0x87D7
-#define GL_W_EXT 0x87D8
-#define GL_NEGATIVE_X_EXT 0x87D9
-#define GL_NEGATIVE_Y_EXT 0x87DA
-#define GL_NEGATIVE_Z_EXT 0x87DB
-#define GL_NEGATIVE_W_EXT 0x87DC
-#define GL_ZERO_EXT 0x87DD
-#define GL_ONE_EXT 0x87DE
-#define GL_NEGATIVE_ONE_EXT 0x87DF
-#define GL_NORMALIZED_RANGE_EXT 0x87E0
-#define GL_FULL_RANGE_EXT 0x87E1
-#define GL_CURRENT_VERTEX_EXT 0x87E2
-#define GL_MVP_MATRIX_EXT 0x87E3
-#define GL_VARIANT_VALUE_EXT 0x87E4
-#define GL_VARIANT_DATATYPE_EXT 0x87E5
-#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6
-#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7
-#define GL_VARIANT_ARRAY_EXT 0x87E8
-#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9
-#define GL_INVARIANT_VALUE_EXT 0x87EA
-#define GL_INVARIANT_DATATYPE_EXT 0x87EB
-#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC
-#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED
-
-typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void);
-typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value);
-typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value);
-typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void);
-typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components);
-typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data);
-typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data);
-typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num);
-typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap);
-typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1);
-typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2);
-typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3);
-typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr);
-typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr);
-typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW);
-
-#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT)
-#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT)
-#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT)
-#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT)
-#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT)
-#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT)
-#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT)
-#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT)
-#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT)
-#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT)
-#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT)
-#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT)
-#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT)
-#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT)
-#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT)
-#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT)
-#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT)
-#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT)
-#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT)
-#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT)
-#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT)
-#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT)
-#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT)
-#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT)
-#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT)
-#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT)
-#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT)
-#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT)
-#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT)
-#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT)
-#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT)
-#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT)
-#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT)
-#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT)
-#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT)
-#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT)
-#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT)
-#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT)
-#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT)
-#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT)
-#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT)
-#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT)
-
-#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader)
-
-#endif /* GL_EXT_vertex_shader */
-
-/* ------------------------ GL_EXT_vertex_weighting ------------------------ */
-
-#ifndef GL_EXT_vertex_weighting
-#define GL_EXT_vertex_weighting 1
-
-#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3
-#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6
-#define GL_MODELVIEW0_EXT 0x1700
-#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502
-#define GL_MODELVIEW1_MATRIX_EXT 0x8506
-#define GL_VERTEX_WEIGHTING_EXT 0x8509
-#define GL_MODELVIEW1_EXT 0x850A
-#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B
-#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C
-#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D
-#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E
-#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F
-#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510
-
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight);
-
-#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT)
-#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT)
-#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT)
-
-#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting)
-
-#endif /* GL_EXT_vertex_weighting */
-
-/* ------------------------- GL_EXT_x11_sync_object ------------------------ */
-
-#ifndef GL_EXT_x11_sync_object
-#define GL_EXT_x11_sync_object 1
-
-#define GL_SYNC_X11_FENCE_EXT 0x90E1
-
-typedef GLsync (GLAPIENTRY * PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
-
-#define glImportSyncEXT GLEW_GET_FUN(__glewImportSyncEXT)
-
-#define GLEW_EXT_x11_sync_object GLEW_GET_VAR(__GLEW_EXT_x11_sync_object)
-
-#endif /* GL_EXT_x11_sync_object */
-
-/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */
-
-#ifndef GL_GREMEDY_frame_terminator
-#define GL_GREMEDY_frame_terminator 1
-
-typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void);
-
-#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY)
-
-#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator)
-
-#endif /* GL_GREMEDY_frame_terminator */
-
-/* ------------------------ GL_GREMEDY_string_marker ----------------------- */
-
-#ifndef GL_GREMEDY_string_marker
-#define GL_GREMEDY_string_marker 1
-
-typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string);
-
-#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY)
-
-#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker)
-
-#endif /* GL_GREMEDY_string_marker */
-
-/* --------------------- GL_HP_convolution_border_modes -------------------- */
-
-#ifndef GL_HP_convolution_border_modes
-#define GL_HP_convolution_border_modes 1
-
-#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes)
-
-#endif /* GL_HP_convolution_border_modes */
-
-/* ------------------------- GL_HP_image_transform ------------------------- */
-
-#ifndef GL_HP_image_transform
-#define GL_HP_image_transform 1
-
-typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP)
-#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP)
-#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP)
-#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP)
-#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP)
-#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP)
-
-#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform)
-
-#endif /* GL_HP_image_transform */
-
-/* -------------------------- GL_HP_occlusion_test ------------------------- */
-
-#ifndef GL_HP_occlusion_test
-#define GL_HP_occlusion_test 1
-
-#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test)
-
-#endif /* GL_HP_occlusion_test */
-
-/* ------------------------- GL_HP_texture_lighting ------------------------ */
-
-#ifndef GL_HP_texture_lighting
-#define GL_HP_texture_lighting 1
-
-#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting)
-
-#endif /* GL_HP_texture_lighting */
-
-/* --------------------------- GL_IBM_cull_vertex -------------------------- */
-
-#ifndef GL_IBM_cull_vertex
-#define GL_IBM_cull_vertex 1
-
-#define GL_CULL_VERTEX_IBM 103050
-
-#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex)
-
-#endif /* GL_IBM_cull_vertex */
-
-/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */
-
-#ifndef GL_IBM_multimode_draw_arrays
-#define GL_IBM_multimode_draw_arrays 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride);
-typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride);
-
-#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM)
-#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM)
-
-#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays)
-
-#endif /* GL_IBM_multimode_draw_arrays */
-
-/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */
-
-#ifndef GL_IBM_rasterpos_clip
-#define GL_IBM_rasterpos_clip 1
-
-#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010
-
-#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip)
-
-#endif /* GL_IBM_rasterpos_clip */
-
-/* --------------------------- GL_IBM_static_data -------------------------- */
-
-#ifndef GL_IBM_static_data
-#define GL_IBM_static_data 1
-
-#define GL_ALL_STATIC_DATA_IBM 103060
-#define GL_STATIC_VERTEX_ARRAY_IBM 103061
-
-#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data)
-
-#endif /* GL_IBM_static_data */
-
-/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */
-
-#ifndef GL_IBM_texture_mirrored_repeat
-#define GL_IBM_texture_mirrored_repeat 1
-
-#define GL_MIRRORED_REPEAT_IBM 0x8370
-
-#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat)
-
-#endif /* GL_IBM_texture_mirrored_repeat */
-
-/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */
-
-#ifndef GL_IBM_vertex_array_lists
-#define GL_IBM_vertex_array_lists 1
-
-#define GL_VERTEX_ARRAY_LIST_IBM 103070
-#define GL_NORMAL_ARRAY_LIST_IBM 103071
-#define GL_COLOR_ARRAY_LIST_IBM 103072
-#define GL_INDEX_ARRAY_LIST_IBM 103073
-#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074
-#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075
-#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076
-#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077
-#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080
-#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081
-#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082
-#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083
-#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084
-#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085
-#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086
-#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087
-
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride);
-
-#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM)
-#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM)
-#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM)
-#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM)
-#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM)
-#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM)
-#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM)
-#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM)
-
-#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists)
-
-#endif /* GL_IBM_vertex_array_lists */
-
-/* -------------------------- GL_INGR_color_clamp -------------------------- */
-
-#ifndef GL_INGR_color_clamp
-#define GL_INGR_color_clamp 1
-
-#define GL_RED_MIN_CLAMP_INGR 0x8560
-#define GL_GREEN_MIN_CLAMP_INGR 0x8561
-#define GL_BLUE_MIN_CLAMP_INGR 0x8562
-#define GL_ALPHA_MIN_CLAMP_INGR 0x8563
-#define GL_RED_MAX_CLAMP_INGR 0x8564
-#define GL_GREEN_MAX_CLAMP_INGR 0x8565
-#define GL_BLUE_MAX_CLAMP_INGR 0x8566
-#define GL_ALPHA_MAX_CLAMP_INGR 0x8567
-
-#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp)
-
-#endif /* GL_INGR_color_clamp */
-
-/* ------------------------- GL_INGR_interlace_read ------------------------ */
-
-#ifndef GL_INGR_interlace_read
-#define GL_INGR_interlace_read 1
-
-#define GL_INTERLACE_READ_INGR 0x8568
-
-#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read)
-
-#endif /* GL_INGR_interlace_read */
-
-/* -------------------------- GL_INTEL_map_texture ------------------------- */
-
-#ifndef GL_INTEL_map_texture
-#define GL_INTEL_map_texture 1
-
-#define GL_LAYOUT_DEFAULT_INTEL 0
-#define GL_LAYOUT_LINEAR_INTEL 1
-#define GL_LAYOUT_LINEAR_CPU_CACHED_INTEL 2
-#define GL_TEXTURE_MEMORY_LAYOUT_INTEL 0x83FF
-
-typedef GLvoid * (GLAPIENTRY * PFNGLMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level, GLbitfield access, GLint* stride, GLenum *layout);
-typedef void (GLAPIENTRY * PFNGLSYNCTEXTUREINTELPROC) (GLuint texture);
-typedef void (GLAPIENTRY * PFNGLUNMAPTEXTURE2DINTELPROC) (GLuint texture, GLint level);
-
-#define glMapTexture2DINTEL GLEW_GET_FUN(__glewMapTexture2DINTEL)
-#define glSyncTextureINTEL GLEW_GET_FUN(__glewSyncTextureINTEL)
-#define glUnmapTexture2DINTEL GLEW_GET_FUN(__glewUnmapTexture2DINTEL)
-
-#define GLEW_INTEL_map_texture GLEW_GET_VAR(__GLEW_INTEL_map_texture)
-
-#endif /* GL_INTEL_map_texture */
-
-/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */
-
-#ifndef GL_INTEL_parallel_arrays
-#define GL_INTEL_parallel_arrays 1
-
-#define GL_PARALLEL_ARRAYS_INTEL 0x83F4
-#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5
-#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6
-#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7
-#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8
-
-typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer);
-
-#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL)
-#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL)
-#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL)
-#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL)
-
-#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays)
-
-#endif /* GL_INTEL_parallel_arrays */
-
-/* ------------------------ GL_INTEL_texture_scissor ----------------------- */
-
-#ifndef GL_INTEL_texture_scissor
-#define GL_INTEL_texture_scissor 1
-
-typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc);
-typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh);
-
-#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL)
-#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL)
-
-#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor)
-
-#endif /* GL_INTEL_texture_scissor */
-
-/* ------------------------------ GL_KHR_debug ----------------------------- */
-
-#ifndef GL_KHR_debug
-#define GL_KHR_debug 1
-
-#define GL_CONTEXT_FLAG_DEBUG_BIT 0x00000002
-#define GL_STACK_OVERFLOW 0x0503
-#define GL_STACK_UNDERFLOW 0x0504
-#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
-#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
-#define GL_DEBUG_CALLBACK_FUNCTION 0x8244
-#define GL_DEBUG_CALLBACK_USER_PARAM 0x8245
-#define GL_DEBUG_SOURCE_API 0x8246
-#define GL_DEBUG_SOURCE_WINDOW_SYSTEM 0x8247
-#define GL_DEBUG_SOURCE_SHADER_COMPILER 0x8248
-#define GL_DEBUG_SOURCE_THIRD_PARTY 0x8249
-#define GL_DEBUG_SOURCE_APPLICATION 0x824A
-#define GL_DEBUG_SOURCE_OTHER 0x824B
-#define GL_DEBUG_TYPE_ERROR 0x824C
-#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR 0x824D
-#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR 0x824E
-#define GL_DEBUG_TYPE_PORTABILITY 0x824F
-#define GL_DEBUG_TYPE_PERFORMANCE 0x8250
-#define GL_DEBUG_TYPE_OTHER 0x8251
-#define GL_DEBUG_TYPE_MARKER 0x8268
-#define GL_DEBUG_TYPE_PUSH_GROUP 0x8269
-#define GL_DEBUG_TYPE_POP_GROUP 0x826A
-#define GL_DEBUG_SEVERITY_NOTIFICATION 0x826B
-#define GL_MAX_DEBUG_GROUP_STACK_DEPTH 0x826C
-#define GL_DEBUG_GROUP_STACK_DEPTH 0x826D
-#define GL_BUFFER 0x82E0
-#define GL_SHADER 0x82E1
-#define GL_PROGRAM 0x82E2
-#define GL_QUERY 0x82E3
-#define GL_PROGRAM_PIPELINE 0x82E4
-#define GL_SAMPLER 0x82E6
-#define GL_DISPLAY_LIST 0x82E7
-#define GL_MAX_LABEL_LENGTH 0x82E8
-#define GL_MAX_DEBUG_MESSAGE_LENGTH 0x9143
-#define GL_MAX_DEBUG_LOGGED_MESSAGES 0x9144
-#define GL_DEBUG_LOGGED_MESSAGES 0x9145
-#define GL_DEBUG_SEVERITY_HIGH 0x9146
-#define GL_DEBUG_SEVERITY_MEDIUM 0x9147
-#define GL_DEBUG_SEVERITY_LOW 0x9148
-#define GL_DEBUG_OUTPUT 0x92E0
-
-typedef void (APIENTRY *GLDEBUGPROC)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam);
-
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKPROC) (GLDEBUGPROC callback, const GLvoid *userParam);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled);
-typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* buf);
-typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, GLchar* messageLog);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei* length, GLchar *label);
-typedef void (GLAPIENTRY * PFNGLGETOBJECTPTRLABELPROC) (void* ptr, GLsizei bufSize, GLsizei* length, GLchar *label);
-typedef void (GLAPIENTRY * PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar* label);
-typedef void (GLAPIENTRY * PFNGLOBJECTPTRLABELPROC) (void* ptr, GLsizei length, const GLchar* label);
-typedef void (GLAPIENTRY * PFNGLPOPDEBUGGROUPPROC) (void);
-typedef void (GLAPIENTRY * PFNGLPUSHDEBUGGROUPPROC) (GLenum source, GLuint id, GLsizei length, const GLchar * message);
-
-#define glDebugMessageCallback GLEW_GET_FUN(__glewDebugMessageCallback)
-#define glDebugMessageControl GLEW_GET_FUN(__glewDebugMessageControl)
-#define glDebugMessageInsert GLEW_GET_FUN(__glewDebugMessageInsert)
-#define glGetDebugMessageLog GLEW_GET_FUN(__glewGetDebugMessageLog)
-#define glGetObjectLabel GLEW_GET_FUN(__glewGetObjectLabel)
-#define glGetObjectPtrLabel GLEW_GET_FUN(__glewGetObjectPtrLabel)
-#define glObjectLabel GLEW_GET_FUN(__glewObjectLabel)
-#define glObjectPtrLabel GLEW_GET_FUN(__glewObjectPtrLabel)
-#define glPopDebugGroup GLEW_GET_FUN(__glewPopDebugGroup)
-#define glPushDebugGroup GLEW_GET_FUN(__glewPushDebugGroup)
-
-#define GLEW_KHR_debug GLEW_GET_VAR(__GLEW_KHR_debug)
-
-#endif /* GL_KHR_debug */
-
-/* ------------------ GL_KHR_texture_compression_astc_ldr ------------------ */
-
-#ifndef GL_KHR_texture_compression_astc_ldr
-#define GL_KHR_texture_compression_astc_ldr 1
-
-#define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
-#define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
-#define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
-#define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
-#define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
-#define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
-#define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
-#define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
-#define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
-#define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
-#define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
-#define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
-#define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
-#define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
-#define GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
-
-#define GLEW_KHR_texture_compression_astc_ldr GLEW_GET_VAR(__GLEW_KHR_texture_compression_astc_ldr)
-
-#endif /* GL_KHR_texture_compression_astc_ldr */
-
-/* -------------------------- GL_KTX_buffer_region ------------------------- */
-
-#ifndef GL_KTX_buffer_region
-#define GL_KTX_buffer_region 1
-
-#define GL_KTX_FRONT_REGION 0x0
-#define GL_KTX_BACK_REGION 0x1
-#define GL_KTX_Z_REGION 0x2
-#define GL_KTX_STENCIL_REGION 0x3
-
-typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDPROC) (void);
-typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONPROC) (GLenum region);
-typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest);
-typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONPROC) (GLenum region);
-typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glBufferRegionEnabled GLEW_GET_FUN(__glewBufferRegionEnabled)
-#define glDeleteBufferRegion GLEW_GET_FUN(__glewDeleteBufferRegion)
-#define glDrawBufferRegion GLEW_GET_FUN(__glewDrawBufferRegion)
-#define glNewBufferRegion GLEW_GET_FUN(__glewNewBufferRegion)
-#define glReadBufferRegion GLEW_GET_FUN(__glewReadBufferRegion)
-
-#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region)
-
-#endif /* GL_KTX_buffer_region */
-
-/* ------------------------- GL_MESAX_texture_stack ------------------------ */
-
-#ifndef GL_MESAX_texture_stack
-#define GL_MESAX_texture_stack 1
-
-#define GL_TEXTURE_1D_STACK_MESAX 0x8759
-#define GL_TEXTURE_2D_STACK_MESAX 0x875A
-#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B
-#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C
-#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D
-#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E
-
-#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack)
-
-#endif /* GL_MESAX_texture_stack */
-
-/* -------------------------- GL_MESA_pack_invert -------------------------- */
-
-#ifndef GL_MESA_pack_invert
-#define GL_MESA_pack_invert 1
-
-#define GL_PACK_INVERT_MESA 0x8758
-
-#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert)
-
-#endif /* GL_MESA_pack_invert */
-
-/* ------------------------- GL_MESA_resize_buffers ------------------------ */
-
-#ifndef GL_MESA_resize_buffers
-#define GL_MESA_resize_buffers 1
-
-typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void);
-
-#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA)
-
-#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers)
-
-#endif /* GL_MESA_resize_buffers */
-
-/* --------------------------- GL_MESA_window_pos -------------------------- */
-
-#ifndef GL_MESA_window_pos
-#define GL_MESA_window_pos 1
-
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p);
-
-#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA)
-#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA)
-#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA)
-#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA)
-#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA)
-#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA)
-#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA)
-#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA)
-#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA)
-#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA)
-#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA)
-#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA)
-#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA)
-#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA)
-#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA)
-#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA)
-#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA)
-#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA)
-#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA)
-#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA)
-#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA)
-#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA)
-#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA)
-#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA)
-
-#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos)
-
-#endif /* GL_MESA_window_pos */
-
-/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */
-
-#ifndef GL_MESA_ycbcr_texture
-#define GL_MESA_ycbcr_texture 1
-
-#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA
-#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB
-#define GL_YCBCR_MESA 0x8757
-
-#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture)
-
-#endif /* GL_MESA_ycbcr_texture */
-
-/* ----------------------- GL_NVX_conditional_render ----------------------- */
-
-#ifndef GL_NVX_conditional_render
-#define GL_NVX_conditional_render 1
-
-typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVXPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVXPROC) (void);
-
-#define glBeginConditionalRenderNVX GLEW_GET_FUN(__glewBeginConditionalRenderNVX)
-#define glEndConditionalRenderNVX GLEW_GET_FUN(__glewEndConditionalRenderNVX)
-
-#define GLEW_NVX_conditional_render GLEW_GET_VAR(__GLEW_NVX_conditional_render)
-
-#endif /* GL_NVX_conditional_render */
-
-/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */
-
-#ifndef GL_NVX_gpu_memory_info
-#define GL_NVX_gpu_memory_info 1
-
-#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047
-#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048
-#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049
-#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A
-#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B
-
-#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info)
-
-#endif /* GL_NVX_gpu_memory_info */
-
-/* ------------------- GL_NV_bindless_multi_draw_indirect ------------------ */
-
-#ifndef GL_NV_bindless_multi_draw_indirect
-#define GL_NV_bindless_multi_draw_indirect 1
-
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC) (GLenum mode, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei drawCount, GLsizei stride, GLint vertexBufferCount);
-
-#define glMultiDrawArraysIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawArraysIndirectBindlessNV)
-#define glMultiDrawElementsIndirectBindlessNV GLEW_GET_FUN(__glewMultiDrawElementsIndirectBindlessNV)
-
-#define GLEW_NV_bindless_multi_draw_indirect GLEW_GET_VAR(__GLEW_NV_bindless_multi_draw_indirect)
-
-#endif /* GL_NV_bindless_multi_draw_indirect */
-
-/* ------------------------- GL_NV_bindless_texture ------------------------ */
-
-#ifndef GL_NV_bindless_texture
-#define GL_NV_bindless_texture 1
-
-typedef GLuint64 (GLAPIENTRY * PFNGLGETIMAGEHANDLENVPROC) (GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format);
-typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTUREHANDLENVPROC) (GLuint texture);
-typedef GLuint64 (GLAPIENTRY * PFNGLGETTEXTURESAMPLERHANDLENVPROC) (GLuint texture, GLuint sampler);
-typedef GLboolean (GLAPIENTRY * PFNGLISIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKEIMAGEHANDLERESIDENTNVPROC) (GLuint64 handle, GLenum access);
-typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLMAKETEXTUREHANDLERESIDENTNVPROC) (GLuint64 handle);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC) (GLuint program, GLint location, GLuint64 value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64* values);
-typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64NVPROC) (GLint location, GLuint64 value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMHANDLEUI64VNVPROC) (GLint location, GLsizei count, const GLuint64* value);
-
-#define glGetImageHandleNV GLEW_GET_FUN(__glewGetImageHandleNV)
-#define glGetTextureHandleNV GLEW_GET_FUN(__glewGetTextureHandleNV)
-#define glGetTextureSamplerHandleNV GLEW_GET_FUN(__glewGetTextureSamplerHandleNV)
-#define glIsImageHandleResidentNV GLEW_GET_FUN(__glewIsImageHandleResidentNV)
-#define glIsTextureHandleResidentNV GLEW_GET_FUN(__glewIsTextureHandleResidentNV)
-#define glMakeImageHandleNonResidentNV GLEW_GET_FUN(__glewMakeImageHandleNonResidentNV)
-#define glMakeImageHandleResidentNV GLEW_GET_FUN(__glewMakeImageHandleResidentNV)
-#define glMakeTextureHandleNonResidentNV GLEW_GET_FUN(__glewMakeTextureHandleNonResidentNV)
-#define glMakeTextureHandleResidentNV GLEW_GET_FUN(__glewMakeTextureHandleResidentNV)
-#define glProgramUniformHandleui64NV GLEW_GET_FUN(__glewProgramUniformHandleui64NV)
-#define glProgramUniformHandleui64vNV GLEW_GET_FUN(__glewProgramUniformHandleui64vNV)
-#define glUniformHandleui64NV GLEW_GET_FUN(__glewUniformHandleui64NV)
-#define glUniformHandleui64vNV GLEW_GET_FUN(__glewUniformHandleui64vNV)
-
-#define GLEW_NV_bindless_texture GLEW_GET_VAR(__GLEW_NV_bindless_texture)
-
-#endif /* GL_NV_bindless_texture */
-
-/* --------------------- GL_NV_blend_equation_advanced --------------------- */
-
-#ifndef GL_NV_blend_equation_advanced
-#define GL_NV_blend_equation_advanced 1
-
-#define GL_BLEND_PREMULTIPLIED_SRC_NV 0x9280
-#define GL_BLEND_OVERLAP_NV 0x9281
-#define GL_UNCORRELATED_NV 0x9282
-#define GL_DISJOINT_NV 0x9283
-#define GL_CONJOINT_NV 0x9284
-#define GL_BLEND_ADVANCED_COHERENT_NV 0x9285
-#define GL_SRC_NV 0x9286
-#define GL_DST_NV 0x9287
-#define GL_SRC_OVER_NV 0x9288
-#define GL_DST_OVER_NV 0x9289
-#define GL_SRC_IN_NV 0x928A
-#define GL_DST_IN_NV 0x928B
-#define GL_SRC_OUT_NV 0x928C
-#define GL_DST_OUT_NV 0x928D
-#define GL_SRC_ATOP_NV 0x928E
-#define GL_DST_ATOP_NV 0x928F
-#define GL_PLUS_NV 0x9291
-#define GL_PLUS_DARKER_NV 0x9292
-#define GL_MULTIPLY_NV 0x9294
-#define GL_SCREEN_NV 0x9295
-#define GL_OVERLAY_NV 0x9296
-#define GL_DARKEN_NV 0x9297
-#define GL_LIGHTEN_NV 0x9298
-#define GL_COLORDODGE_NV 0x9299
-#define GL_COLORBURN_NV 0x929A
-#define GL_HARDLIGHT_NV 0x929B
-#define GL_SOFTLIGHT_NV 0x929C
-#define GL_DIFFERENCE_NV 0x929E
-#define GL_MINUS_NV 0x929F
-#define GL_EXCLUSION_NV 0x92A0
-#define GL_CONTRAST_NV 0x92A1
-#define GL_INVERT_RGB_NV 0x92A3
-#define GL_LINEARDODGE_NV 0x92A4
-#define GL_LINEARBURN_NV 0x92A5
-#define GL_VIVIDLIGHT_NV 0x92A6
-#define GL_LINEARLIGHT_NV 0x92A7
-#define GL_PINLIGHT_NV 0x92A8
-#define GL_HARDMIX_NV 0x92A9
-#define GL_HSL_HUE_NV 0x92AD
-#define GL_HSL_SATURATION_NV 0x92AE
-#define GL_HSL_COLOR_NV 0x92AF
-#define GL_HSL_LUMINOSITY_NV 0x92B0
-#define GL_PLUS_CLAMPED_NV 0x92B1
-#define GL_PLUS_CLAMPED_ALPHA_NV 0x92B2
-#define GL_MINUS_CLAMPED_NV 0x92B3
-#define GL_INVERT_OVG_NV 0x92B4
-
-typedef void (GLAPIENTRY * PFNGLBLENDBARRIERNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLBLENDPARAMETERINVPROC) (GLenum pname, GLint value);
-
-#define glBlendBarrierNV GLEW_GET_FUN(__glewBlendBarrierNV)
-#define glBlendParameteriNV GLEW_GET_FUN(__glewBlendParameteriNV)
-
-#define GLEW_NV_blend_equation_advanced GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced)
-
-#endif /* GL_NV_blend_equation_advanced */
-
-/* ----------------- GL_NV_blend_equation_advanced_coherent ---------------- */
-
-#ifndef GL_NV_blend_equation_advanced_coherent
-#define GL_NV_blend_equation_advanced_coherent 1
-
-#define GLEW_NV_blend_equation_advanced_coherent GLEW_GET_VAR(__GLEW_NV_blend_equation_advanced_coherent)
-
-#endif /* GL_NV_blend_equation_advanced_coherent */
-
-/* --------------------------- GL_NV_blend_square -------------------------- */
-
-#ifndef GL_NV_blend_square
-#define GL_NV_blend_square 1
-
-#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square)
-
-#endif /* GL_NV_blend_square */
-
-/* ------------------------- GL_NV_compute_program5 ------------------------ */
-
-#ifndef GL_NV_compute_program5
-#define GL_NV_compute_program5 1
-
-#define GL_COMPUTE_PROGRAM_NV 0x90FB
-#define GL_COMPUTE_PROGRAM_PARAMETER_BUFFER_NV 0x90FC
-
-#define GLEW_NV_compute_program5 GLEW_GET_VAR(__GLEW_NV_compute_program5)
-
-#endif /* GL_NV_compute_program5 */
-
-/* ------------------------ GL_NV_conditional_render ----------------------- */
-
-#ifndef GL_NV_conditional_render
-#define GL_NV_conditional_render 1
-
-#define GL_QUERY_WAIT_NV 0x8E13
-#define GL_QUERY_NO_WAIT_NV 0x8E14
-#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15
-#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16
-
-typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void);
-
-#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV)
-#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV)
-
-#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render)
-
-#endif /* GL_NV_conditional_render */
-
-/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */
-
-#ifndef GL_NV_copy_depth_to_color
-#define GL_NV_copy_depth_to_color 1
-
-#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E
-#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F
-
-#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color)
-
-#endif /* GL_NV_copy_depth_to_color */
-
-/* ---------------------------- GL_NV_copy_image --------------------------- */
-
-#ifndef GL_NV_copy_image
-#define GL_NV_copy_image 1
-
-typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV)
-
-#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image)
-
-#endif /* GL_NV_copy_image */
-
-/* -------------------------- GL_NV_deep_texture3D ------------------------- */
-
-#ifndef GL_NV_deep_texture3D
-#define GL_NV_deep_texture3D 1
-
-#define GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV 0x90D0
-#define GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV 0x90D1
-
-#define GLEW_NV_deep_texture3D GLEW_GET_VAR(__GLEW_NV_deep_texture3D)
-
-#endif /* GL_NV_deep_texture3D */
-
-/* ------------------------ GL_NV_depth_buffer_float ----------------------- */
-
-#ifndef GL_NV_depth_buffer_float
-#define GL_NV_depth_buffer_float 1
-
-#define GL_DEPTH_COMPONENT32F_NV 0x8DAB
-#define GL_DEPTH32F_STENCIL8_NV 0x8DAC
-#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD
-#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth);
-typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar);
-
-#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV)
-#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV)
-#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV)
-
-#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float)
-
-#endif /* GL_NV_depth_buffer_float */
-
-/* --------------------------- GL_NV_depth_clamp --------------------------- */
-
-#ifndef GL_NV_depth_clamp
-#define GL_NV_depth_clamp 1
-
-#define GL_DEPTH_CLAMP_NV 0x864F
-
-#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp)
-
-#endif /* GL_NV_depth_clamp */
-
-/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */
-
-#ifndef GL_NV_depth_range_unclamped
-#define GL_NV_depth_range_unclamped 1
-
-#define GL_SAMPLE_COUNT_BITS_NV 0x8864
-#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865
-#define GL_QUERY_RESULT_NV 0x8866
-#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867
-#define GL_SAMPLE_COUNT_NV 0x8914
-
-#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped)
-
-#endif /* GL_NV_depth_range_unclamped */
-
-/* --------------------------- GL_NV_draw_texture -------------------------- */
-
-#ifndef GL_NV_draw_texture
-#define GL_NV_draw_texture 1
-
-typedef void (GLAPIENTRY * PFNGLDRAWTEXTURENVPROC) (GLuint texture, GLuint sampler, GLfloat x0, GLfloat y0, GLfloat x1, GLfloat y1, GLfloat z, GLfloat s0, GLfloat t0, GLfloat s1, GLfloat t1);
-
-#define glDrawTextureNV GLEW_GET_FUN(__glewDrawTextureNV)
-
-#define GLEW_NV_draw_texture GLEW_GET_VAR(__GLEW_NV_draw_texture)
-
-#endif /* GL_NV_draw_texture */
-
-/* ---------------------------- GL_NV_evaluators --------------------------- */
-
-#ifndef GL_NV_evaluators
-#define GL_NV_evaluators 1
-
-#define GL_EVAL_2D_NV 0x86C0
-#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1
-#define GL_MAP_TESSELLATION_NV 0x86C2
-#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3
-#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4
-#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5
-#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6
-#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7
-#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8
-#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9
-#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA
-#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB
-#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC
-#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD
-#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE
-#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF
-#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0
-#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1
-#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2
-#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3
-#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4
-#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5
-#define GL_MAX_MAP_TESSELLATION_NV 0x86D6
-#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7
-
-typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points);
-typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points);
-typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params);
-
-#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV)
-#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV)
-#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV)
-#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV)
-#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV)
-#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV)
-#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV)
-#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV)
-#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV)
-
-#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators)
-
-#endif /* GL_NV_evaluators */
-
-/* ----------------------- GL_NV_explicit_multisample ---------------------- */
-
-#ifndef GL_NV_explicit_multisample
-#define GL_NV_explicit_multisample 1
-
-#define GL_SAMPLE_POSITION_NV 0x8E50
-#define GL_SAMPLE_MASK_NV 0x8E51
-#define GL_SAMPLE_MASK_VALUE_NV 0x8E52
-#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53
-#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54
-#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55
-#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56
-#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57
-#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58
-#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59
-
-typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val);
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask);
-typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer);
-
-#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV)
-#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV)
-#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV)
-
-#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample)
-
-#endif /* GL_NV_explicit_multisample */
-
-/* ------------------------------ GL_NV_fence ------------------------------ */
-
-#ifndef GL_NV_fence
-#define GL_NV_fence 1
-
-#define GL_ALL_COMPLETED_NV 0x84F2
-#define GL_FENCE_STATUS_NV 0x84F3
-#define GL_FENCE_CONDITION_NV 0x84F4
-
-typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences);
-typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence);
-typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
-typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence);
-
-#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV)
-#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV)
-#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV)
-#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV)
-#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV)
-#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV)
-#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV)
-
-#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence)
-
-#endif /* GL_NV_fence */
-
-/* --------------------------- GL_NV_float_buffer -------------------------- */
-
-#ifndef GL_NV_float_buffer
-#define GL_NV_float_buffer 1
-
-#define GL_FLOAT_R_NV 0x8880
-#define GL_FLOAT_RG_NV 0x8881
-#define GL_FLOAT_RGB_NV 0x8882
-#define GL_FLOAT_RGBA_NV 0x8883
-#define GL_FLOAT_R16_NV 0x8884
-#define GL_FLOAT_R32_NV 0x8885
-#define GL_FLOAT_RG16_NV 0x8886
-#define GL_FLOAT_RG32_NV 0x8887
-#define GL_FLOAT_RGB16_NV 0x8888
-#define GL_FLOAT_RGB32_NV 0x8889
-#define GL_FLOAT_RGBA16_NV 0x888A
-#define GL_FLOAT_RGBA32_NV 0x888B
-#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C
-#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D
-#define GL_FLOAT_RGBA_MODE_NV 0x888E
-
-#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer)
-
-#endif /* GL_NV_float_buffer */
-
-/* --------------------------- GL_NV_fog_distance -------------------------- */
-
-#ifndef GL_NV_fog_distance
-#define GL_NV_fog_distance 1
-
-#define GL_FOG_DISTANCE_MODE_NV 0x855A
-#define GL_EYE_RADIAL_NV 0x855B
-#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C
-
-#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance)
-
-#endif /* GL_NV_fog_distance */
-
-/* ------------------------- GL_NV_fragment_program ------------------------ */
-
-#ifndef GL_NV_fragment_program
-#define GL_NV_fragment_program 1
-
-#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868
-#define GL_FRAGMENT_PROGRAM_NV 0x8870
-#define GL_MAX_TEXTURE_COORDS_NV 0x8871
-#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872
-#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873
-#define GL_PROGRAM_ERROR_STRING_NV 0x8874
-
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]);
-
-#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV)
-#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV)
-#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV)
-#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV)
-#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV)
-#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV)
-
-#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program)
-
-#endif /* GL_NV_fragment_program */
-
-/* ------------------------ GL_NV_fragment_program2 ------------------------ */
-
-#ifndef GL_NV_fragment_program2
-#define GL_NV_fragment_program2 1
-
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6
-#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7
-#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8
-
-#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2)
-
-#endif /* GL_NV_fragment_program2 */
-
-/* ------------------------ GL_NV_fragment_program4 ------------------------ */
-
-#ifndef GL_NV_fragment_program4
-#define GL_NV_fragment_program4 1
-
-#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4)
-
-#endif /* GL_NV_fragment_program4 */
-
-/* --------------------- GL_NV_fragment_program_option --------------------- */
-
-#ifndef GL_NV_fragment_program_option
-#define GL_NV_fragment_program_option 1
-
-#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option)
-
-#endif /* GL_NV_fragment_program_option */
-
-/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */
-
-#ifndef GL_NV_framebuffer_multisample_coverage
-#define GL_NV_framebuffer_multisample_coverage 1
-
-#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB
-#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10
-#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11
-#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12
-
-typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height);
-
-#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV)
-
-#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage)
-
-#endif /* GL_NV_framebuffer_multisample_coverage */
-
-/* ------------------------ GL_NV_geometry_program4 ------------------------ */
-
-#ifndef GL_NV_geometry_program4
-#define GL_NV_geometry_program4 1
-
-#define GL_GEOMETRY_PROGRAM_NV 0x8C26
-#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27
-#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit);
-
-#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV)
-
-#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4)
-
-#endif /* GL_NV_geometry_program4 */
-
-/* ------------------------- GL_NV_geometry_shader4 ------------------------ */
-
-#ifndef GL_NV_geometry_shader4
-#define GL_NV_geometry_shader4 1
-
-#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4)
-
-#endif /* GL_NV_geometry_shader4 */
-
-/* --------------------------- GL_NV_gpu_program4 -------------------------- */
-
-#ifndef GL_NV_gpu_program4
-#define GL_NV_gpu_program4 1
-
-#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904
-#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905
-#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906
-#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907
-#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908
-#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909
-#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5
-#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params);
-
-#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV)
-#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV)
-#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV)
-#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV)
-#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV)
-#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV)
-#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV)
-#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV)
-#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV)
-#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV)
-#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV)
-#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV)
-
-#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4)
-
-#endif /* GL_NV_gpu_program4 */
-
-/* --------------------------- GL_NV_gpu_program5 -------------------------- */
-
-#ifndef GL_NV_gpu_program5
-#define GL_NV_gpu_program5 1
-
-#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A
-#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B
-#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C
-#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D
-#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E
-#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F
-
-#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5)
-
-#endif /* GL_NV_gpu_program5 */
-
-/* -------------------- GL_NV_gpu_program5_mem_extended -------------------- */
-
-#ifndef GL_NV_gpu_program5_mem_extended
-#define GL_NV_gpu_program5_mem_extended 1
-
-#define GLEW_NV_gpu_program5_mem_extended GLEW_GET_VAR(__GLEW_NV_gpu_program5_mem_extended)
-
-#endif /* GL_NV_gpu_program5_mem_extended */
-
-/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */
-
-#ifndef GL_NV_gpu_program_fp64
-#define GL_NV_gpu_program_fp64 1
-
-#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64)
-
-#endif /* GL_NV_gpu_program_fp64 */
-
-/* --------------------------- GL_NV_gpu_shader5 --------------------------- */
-
-#ifndef GL_NV_gpu_shader5
-#define GL_NV_gpu_shader5 1
-
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-#define GL_INT8_NV 0x8FE0
-#define GL_INT8_VEC2_NV 0x8FE1
-#define GL_INT8_VEC3_NV 0x8FE2
-#define GL_INT8_VEC4_NV 0x8FE3
-#define GL_INT16_NV 0x8FE4
-#define GL_INT16_VEC2_NV 0x8FE5
-#define GL_INT16_VEC3_NV 0x8FE6
-#define GL_INT16_VEC4_NV 0x8FE7
-#define GL_INT64_VEC2_NV 0x8FE9
-#define GL_INT64_VEC3_NV 0x8FEA
-#define GL_INT64_VEC4_NV 0x8FEB
-#define GL_UNSIGNED_INT8_NV 0x8FEC
-#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED
-#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE
-#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF
-#define GL_UNSIGNED_INT16_NV 0x8FF0
-#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1
-#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2
-#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3
-#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5
-#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6
-#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7
-#define GL_FLOAT16_NV 0x8FF8
-#define GL_FLOAT16_VEC2_NV 0x8FF9
-#define GL_FLOAT16_VEC3_NV 0x8FFA
-#define GL_FLOAT16_VEC4_NV 0x8FFB
-
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-
-#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV)
-#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV)
-#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV)
-#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV)
-#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV)
-#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV)
-#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV)
-#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV)
-#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV)
-#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV)
-#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV)
-#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV)
-#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV)
-#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV)
-#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV)
-#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV)
-#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV)
-#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV)
-#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV)
-#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV)
-#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV)
-#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV)
-#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV)
-#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV)
-#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV)
-#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV)
-#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV)
-#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV)
-#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV)
-#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV)
-#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV)
-#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV)
-#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV)
-#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV)
-
-#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5)
-
-#endif /* GL_NV_gpu_shader5 */
-
-/* ---------------------------- GL_NV_half_float --------------------------- */
-
-#ifndef GL_NV_half_float
-#define GL_NV_half_float 1
-
-#define GL_HALF_FLOAT_NV 0x140B
-
-typedef unsigned short GLhalf;
-
-typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);
-typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha);
-typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz);
-typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y);
-typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z);
-typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w);
-typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight);
-typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight);
-
-#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV)
-#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV)
-#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV)
-#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV)
-#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV)
-#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV)
-#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV)
-#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV)
-#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV)
-#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV)
-#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV)
-#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV)
-#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV)
-#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV)
-#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV)
-#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV)
-#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV)
-#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV)
-#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV)
-#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV)
-#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV)
-#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV)
-#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV)
-#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV)
-#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV)
-#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV)
-#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV)
-#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV)
-#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV)
-#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV)
-#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV)
-#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV)
-#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV)
-#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV)
-#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV)
-#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV)
-#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV)
-#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV)
-#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV)
-#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV)
-#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV)
-#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV)
-#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV)
-#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV)
-#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV)
-#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV)
-
-#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float)
-
-#endif /* GL_NV_half_float */
-
-/* ------------------------ GL_NV_light_max_exponent ----------------------- */
-
-#ifndef GL_NV_light_max_exponent
-#define GL_NV_light_max_exponent 1
-
-#define GL_MAX_SHININESS_NV 0x8504
-#define GL_MAX_SPOT_EXPONENT_NV 0x8505
-
-#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent)
-
-#endif /* GL_NV_light_max_exponent */
-
-/* ----------------------- GL_NV_multisample_coverage ---------------------- */
-
-#ifndef GL_NV_multisample_coverage
-#define GL_NV_multisample_coverage 1
-
-#define GL_COLOR_SAMPLES_NV 0x8E20
-
-#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage)
-
-#endif /* GL_NV_multisample_coverage */
-
-/* --------------------- GL_NV_multisample_filter_hint --------------------- */
-
-#ifndef GL_NV_multisample_filter_hint
-#define GL_NV_multisample_filter_hint 1
-
-#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534
-
-#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint)
-
-#endif /* GL_NV_multisample_filter_hint */
-
-/* ------------------------- GL_NV_occlusion_query ------------------------- */
-
-#ifndef GL_NV_occlusion_query
-#define GL_NV_occlusion_query 1
-
-#define GL_PIXEL_COUNTER_BITS_NV 0x8864
-#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865
-#define GL_PIXEL_COUNT_NV 0x8866
-#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867
-
-typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id);
-
-#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV)
-#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV)
-#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV)
-#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV)
-#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV)
-#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV)
-#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV)
-
-#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query)
-
-#endif /* GL_NV_occlusion_query */
-
-/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */
-
-#ifndef GL_NV_packed_depth_stencil
-#define GL_NV_packed_depth_stencil 1
-
-#define GL_DEPTH_STENCIL_NV 0x84F9
-#define GL_UNSIGNED_INT_24_8_NV 0x84FA
-
-#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil)
-
-#endif /* GL_NV_packed_depth_stencil */
-
-/* --------------------- GL_NV_parameter_buffer_object --------------------- */
-
-#ifndef GL_NV_parameter_buffer_object
-#define GL_NV_parameter_buffer_object 1
-
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0
-#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1
-#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2
-#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3
-#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4
-
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params);
-
-#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV)
-#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV)
-#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV)
-
-#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object)
-
-#endif /* GL_NV_parameter_buffer_object */
-
-/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */
-
-#ifndef GL_NV_parameter_buffer_object2
-#define GL_NV_parameter_buffer_object2 1
-
-#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2)
-
-#endif /* GL_NV_parameter_buffer_object2 */
-
-/* -------------------------- GL_NV_path_rendering ------------------------- */
-
-#ifndef GL_NV_path_rendering
-#define GL_NV_path_rendering 1
-
-#define GL_CLOSE_PATH_NV 0x00
-#define GL_BOLD_BIT_NV 0x01
-#define GL_GLYPH_WIDTH_BIT_NV 0x01
-#define GL_GLYPH_HEIGHT_BIT_NV 0x02
-#define GL_ITALIC_BIT_NV 0x02
-#define GL_MOVE_TO_NV 0x02
-#define GL_RELATIVE_MOVE_TO_NV 0x03
-#define GL_LINE_TO_NV 0x04
-#define GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV 0x04
-#define GL_RELATIVE_LINE_TO_NV 0x05
-#define GL_HORIZONTAL_LINE_TO_NV 0x06
-#define GL_RELATIVE_HORIZONTAL_LINE_TO_NV 0x07
-#define GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV 0x08
-#define GL_VERTICAL_LINE_TO_NV 0x08
-#define GL_RELATIVE_VERTICAL_LINE_TO_NV 0x09
-#define GL_QUADRATIC_CURVE_TO_NV 0x0A
-#define GL_RELATIVE_QUADRATIC_CURVE_TO_NV 0x0B
-#define GL_CUBIC_CURVE_TO_NV 0x0C
-#define GL_RELATIVE_CUBIC_CURVE_TO_NV 0x0D
-#define GL_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0E
-#define GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV 0x0F
-#define GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV 0x10
-#define GL_SMOOTH_CUBIC_CURVE_TO_NV 0x10
-#define GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV 0x11
-#define GL_SMALL_CCW_ARC_TO_NV 0x12
-#define GL_RELATIVE_SMALL_CCW_ARC_TO_NV 0x13
-#define GL_SMALL_CW_ARC_TO_NV 0x14
-#define GL_RELATIVE_SMALL_CW_ARC_TO_NV 0x15
-#define GL_LARGE_CCW_ARC_TO_NV 0x16
-#define GL_RELATIVE_LARGE_CCW_ARC_TO_NV 0x17
-#define GL_LARGE_CW_ARC_TO_NV 0x18
-#define GL_RELATIVE_LARGE_CW_ARC_TO_NV 0x19
-#define GL_GLYPH_VERTICAL_BEARING_X_BIT_NV 0x20
-#define GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV 0x40
-#define GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV 0x80
-#define GL_RESTART_PATH_NV 0xF0
-#define GL_DUP_FIRST_CUBIC_CURVE_TO_NV 0xF2
-#define GL_DUP_LAST_CUBIC_CURVE_TO_NV 0xF4
-#define GL_RECT_NV 0xF6
-#define GL_CIRCULAR_CCW_ARC_TO_NV 0xF8
-#define GL_CIRCULAR_CW_ARC_TO_NV 0xFA
-#define GL_CIRCULAR_TANGENT_ARC_TO_NV 0xFC
-#define GL_ARC_TO_NV 0xFE
-#define GL_RELATIVE_ARC_TO_NV 0xFF
-#define GL_GLYPH_HAS_KERNING_BIT_NV 0x100
-#define GL_PRIMARY_COLOR 0x8577
-#define GL_PATH_FORMAT_SVG_NV 0x9070
-#define GL_PATH_FORMAT_PS_NV 0x9071
-#define GL_STANDARD_FONT_NAME_NV 0x9072
-#define GL_SYSTEM_FONT_NAME_NV 0x9073
-#define GL_FILE_NAME_NV 0x9074
-#define GL_PATH_STROKE_WIDTH_NV 0x9075
-#define GL_PATH_END_CAPS_NV 0x9076
-#define GL_PATH_INITIAL_END_CAP_NV 0x9077
-#define GL_PATH_TERMINAL_END_CAP_NV 0x9078
-#define GL_PATH_JOIN_STYLE_NV 0x9079
-#define GL_PATH_MITER_LIMIT_NV 0x907A
-#define GL_PATH_DASH_CAPS_NV 0x907B
-#define GL_PATH_INITIAL_DASH_CAP_NV 0x907C
-#define GL_PATH_TERMINAL_DASH_CAP_NV 0x907D
-#define GL_PATH_DASH_OFFSET_NV 0x907E
-#define GL_PATH_CLIENT_LENGTH_NV 0x907F
-#define GL_PATH_FILL_MODE_NV 0x9080
-#define GL_PATH_FILL_MASK_NV 0x9081
-#define GL_PATH_FILL_COVER_MODE_NV 0x9082
-#define GL_PATH_STROKE_COVER_MODE_NV 0x9083
-#define GL_PATH_STROKE_MASK_NV 0x9084
-#define GL_COUNT_UP_NV 0x9088
-#define GL_COUNT_DOWN_NV 0x9089
-#define GL_PATH_OBJECT_BOUNDING_BOX_NV 0x908A
-#define GL_CONVEX_HULL_NV 0x908B
-#define GL_BOUNDING_BOX_NV 0x908D
-#define GL_TRANSLATE_X_NV 0x908E
-#define GL_TRANSLATE_Y_NV 0x908F
-#define GL_TRANSLATE_2D_NV 0x9090
-#define GL_TRANSLATE_3D_NV 0x9091
-#define GL_AFFINE_2D_NV 0x9092
-#define GL_AFFINE_3D_NV 0x9094
-#define GL_TRANSPOSE_AFFINE_2D_NV 0x9096
-#define GL_TRANSPOSE_AFFINE_3D_NV 0x9098
-#define GL_UTF8_NV 0x909A
-#define GL_UTF16_NV 0x909B
-#define GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV 0x909C
-#define GL_PATH_COMMAND_COUNT_NV 0x909D
-#define GL_PATH_COORD_COUNT_NV 0x909E
-#define GL_PATH_DASH_ARRAY_COUNT_NV 0x909F
-#define GL_PATH_COMPUTED_LENGTH_NV 0x90A0
-#define GL_PATH_FILL_BOUNDING_BOX_NV 0x90A1
-#define GL_PATH_STROKE_BOUNDING_BOX_NV 0x90A2
-#define GL_SQUARE_NV 0x90A3
-#define GL_ROUND_NV 0x90A4
-#define GL_TRIANGULAR_NV 0x90A5
-#define GL_BEVEL_NV 0x90A6
-#define GL_MITER_REVERT_NV 0x90A7
-#define GL_MITER_TRUNCATE_NV 0x90A8
-#define GL_SKIP_MISSING_GLYPH_NV 0x90A9
-#define GL_USE_MISSING_GLYPH_NV 0x90AA
-#define GL_PATH_ERROR_POSITION_NV 0x90AB
-#define GL_PATH_FOG_GEN_MODE_NV 0x90AC
-#define GL_ACCUM_ADJACENT_PAIRS_NV 0x90AD
-#define GL_ADJACENT_PAIRS_NV 0x90AE
-#define GL_FIRST_TO_REST_NV 0x90AF
-#define GL_PATH_GEN_MODE_NV 0x90B0
-#define GL_PATH_GEN_COEFF_NV 0x90B1
-#define GL_PATH_GEN_COLOR_FORMAT_NV 0x90B2
-#define GL_PATH_GEN_COMPONENTS_NV 0x90B3
-#define GL_PATH_DASH_OFFSET_RESET_NV 0x90B4
-#define GL_MOVE_TO_RESETS_NV 0x90B5
-#define GL_MOVE_TO_CONTINUES_NV 0x90B6
-#define GL_PATH_STENCIL_FUNC_NV 0x90B7
-#define GL_PATH_STENCIL_REF_NV 0x90B8
-#define GL_PATH_STENCIL_VALUE_MASK_NV 0x90B9
-#define GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV 0x90BD
-#define GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV 0x90BE
-#define GL_PATH_COVER_DEPTH_FUNC_NV 0x90BF
-#define GL_FONT_X_MIN_BOUNDS_BIT_NV 0x00010000
-#define GL_FONT_Y_MIN_BOUNDS_BIT_NV 0x00020000
-#define GL_FONT_X_MAX_BOUNDS_BIT_NV 0x00040000
-#define GL_FONT_Y_MAX_BOUNDS_BIT_NV 0x00080000
-#define GL_FONT_UNITS_PER_EM_BIT_NV 0x00100000
-#define GL_FONT_ASCENDER_BIT_NV 0x00200000
-#define GL_FONT_DESCENDER_BIT_NV 0x00400000
-#define GL_FONT_HEIGHT_BIT_NV 0x00800000
-#define GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV 0x01000000
-#define GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV 0x02000000
-#define GL_FONT_UNDERLINE_POSITION_BIT_NV 0x04000000
-#define GL_FONT_UNDERLINE_THICKNESS_BIT_NV 0x08000000
-#define GL_FONT_HAS_KERNING_BIT_NV 0x10000000
-
-typedef void (GLAPIENTRY * PFNGLCOPYPATHNVPROC) (GLuint resultPath, GLuint srcPath);
-typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLCOVERFILLPATHNVPROC) (GLuint path, GLenum coverMode);
-typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLCOVERSTROKEPATHNVPROC) (GLuint name, GLenum coverMode);
-typedef void (GLAPIENTRY * PFNGLDELETEPATHSNVPROC) (GLuint path, GLsizei range);
-typedef GLuint (GLAPIENTRY * PFNGLGENPATHSNVPROC) (GLsizei range);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENFVNVPROC) (GLenum color, GLenum pname, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOLORGENIVNVPROC) (GLenum color, GLenum pname, GLint* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOMMANDSNVPROC) (GLuint name, GLubyte* commands);
-typedef void (GLAPIENTRY * PFNGLGETPATHCOORDSNVPROC) (GLuint name, GLfloat* coords);
-typedef void (GLAPIENTRY * PFNGLGETPATHDASHARRAYNVPROC) (GLuint name, GLfloat* dashArray);
-typedef GLfloat (GLAPIENTRY * PFNGLGETPATHLENGTHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments);
-typedef void (GLAPIENTRY * PFNGLGETPATHMETRICRANGENVPROC) (GLbitfield metricQueryMask, GLuint fistPathName, GLsizei numPaths, GLsizei stride, GLfloat* metrics);
-typedef void (GLAPIENTRY * PFNGLGETPATHMETRICSNVPROC) (GLbitfield metricQueryMask, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLsizei stride, GLfloat *metrics);
-typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERFVNVPROC) (GLuint name, GLenum param, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHPARAMETERIVNVPROC) (GLuint name, GLenum param, GLint* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHSPACINGNVPROC) (GLenum pathListMode, GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLfloat advanceScale, GLfloat kerningScale, GLenum transformType, GLfloat *returnedSpacing);
-typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENFVNVPROC) (GLenum texCoordSet, GLenum pname, GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLGETPATHTEXGENIVNVPROC) (GLenum texCoordSet, GLenum pname, GLint* value);
-typedef void (GLAPIENTRY * PFNGLINTERPOLATEPATHSNVPROC) (GLuint resultPath, GLuint pathA, GLuint pathB, GLfloat weight);
-typedef GLboolean (GLAPIENTRY * PFNGLISPATHNVPROC) (GLuint path);
-typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINFILLPATHNVPROC) (GLuint path, GLuint mask, GLfloat x, GLfloat y);
-typedef GLboolean (GLAPIENTRY * PFNGLISPOINTINSTROKEPATHNVPROC) (GLuint path, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLPATHCOLORGENNVPROC) (GLenum color, GLenum genMode, GLenum colorFormat, const GLfloat* coeffs);
-typedef void (GLAPIENTRY * PFNGLPATHCOMMANDSNVPROC) (GLuint path, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);
-typedef void (GLAPIENTRY * PFNGLPATHCOORDSNVPROC) (GLuint path, GLsizei numCoords, GLenum coordType, const void* coords);
-typedef void (GLAPIENTRY * PFNGLPATHCOVERDEPTHFUNCNVPROC) (GLenum zfunc);
-typedef void (GLAPIENTRY * PFNGLPATHDASHARRAYNVPROC) (GLuint path, GLsizei dashCount, const GLfloat* dashArray);
-typedef void (GLAPIENTRY * PFNGLPATHFOGGENNVPROC) (GLenum genMode);
-typedef void (GLAPIENTRY * PFNGLPATHGLYPHRANGENVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLuint firstGlyph, GLsizei numGlyphs, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GLAPIENTRY * PFNGLPATHGLYPHSNVPROC) (GLuint firstPathName, GLenum fontTarget, const void* fontName, GLbitfield fontStyle, GLsizei numGlyphs, GLenum type, const GLvoid*charcodes, GLenum handleMissingGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFNVPROC) (GLuint path, GLenum pname, GLfloat value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERFVNVPROC) (GLuint path, GLenum pname, const GLfloat* value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERINVPROC) (GLuint path, GLenum pname, GLint value);
-typedef void (GLAPIENTRY * PFNGLPATHPARAMETERIVNVPROC) (GLuint path, GLenum pname, const GLint* value);
-typedef void (GLAPIENTRY * PFNGLPATHSTENCILDEPTHOFFSETNVPROC) (GLfloat factor, GLfloat units);
-typedef void (GLAPIENTRY * PFNGLPATHSTENCILFUNCNVPROC) (GLenum func, GLint ref, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLPATHSTRINGNVPROC) (GLuint path, GLenum format, GLsizei length, const void* pathString);
-typedef void (GLAPIENTRY * PFNGLPATHSUBCOMMANDSNVPROC) (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte* commands, GLsizei numCoords, GLenum coordType, const GLvoid*coords);
-typedef void (GLAPIENTRY * PFNGLPATHSUBCOORDSNVPROC) (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void* coords);
-typedef void (GLAPIENTRY * PFNGLPATHTEXGENNVPROC) (GLenum texCoordSet, GLenum genMode, GLint components, const GLfloat* coeffs);
-typedef GLboolean (GLAPIENTRY * PFNGLPOINTALONGPATHNVPROC) (GLuint path, GLsizei startSegment, GLsizei numSegments, GLfloat distance, GLfloat* x, GLfloat *y, GLfloat *tangentX, GLfloat *tangentY);
-typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLSTENCILFILLPATHNVPROC) (GLuint path, GLenum fillMode, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void* paths, GLuint pathBase, GLint reference, GLuint mask, GLenum transformType, const GLfloat *transformValues);
-typedef void (GLAPIENTRY * PFNGLSTENCILSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMPATHNVPROC) (GLuint resultPath, GLuint srcPath, GLenum transformType, const GLfloat* transformValues);
-typedef void (GLAPIENTRY * PFNGLWEIGHTPATHSNVPROC) (GLuint resultPath, GLsizei numPaths, const GLuint paths[], const GLfloat weights[]);
-
-#define glCopyPathNV GLEW_GET_FUN(__glewCopyPathNV)
-#define glCoverFillPathInstancedNV GLEW_GET_FUN(__glewCoverFillPathInstancedNV)
-#define glCoverFillPathNV GLEW_GET_FUN(__glewCoverFillPathNV)
-#define glCoverStrokePathInstancedNV GLEW_GET_FUN(__glewCoverStrokePathInstancedNV)
-#define glCoverStrokePathNV GLEW_GET_FUN(__glewCoverStrokePathNV)
-#define glDeletePathsNV GLEW_GET_FUN(__glewDeletePathsNV)
-#define glGenPathsNV GLEW_GET_FUN(__glewGenPathsNV)
-#define glGetPathColorGenfvNV GLEW_GET_FUN(__glewGetPathColorGenfvNV)
-#define glGetPathColorGenivNV GLEW_GET_FUN(__glewGetPathColorGenivNV)
-#define glGetPathCommandsNV GLEW_GET_FUN(__glewGetPathCommandsNV)
-#define glGetPathCoordsNV GLEW_GET_FUN(__glewGetPathCoordsNV)
-#define glGetPathDashArrayNV GLEW_GET_FUN(__glewGetPathDashArrayNV)
-#define glGetPathLengthNV GLEW_GET_FUN(__glewGetPathLengthNV)
-#define glGetPathMetricRangeNV GLEW_GET_FUN(__glewGetPathMetricRangeNV)
-#define glGetPathMetricsNV GLEW_GET_FUN(__glewGetPathMetricsNV)
-#define glGetPathParameterfvNV GLEW_GET_FUN(__glewGetPathParameterfvNV)
-#define glGetPathParameterivNV GLEW_GET_FUN(__glewGetPathParameterivNV)
-#define glGetPathSpacingNV GLEW_GET_FUN(__glewGetPathSpacingNV)
-#define glGetPathTexGenfvNV GLEW_GET_FUN(__glewGetPathTexGenfvNV)
-#define glGetPathTexGenivNV GLEW_GET_FUN(__glewGetPathTexGenivNV)
-#define glInterpolatePathsNV GLEW_GET_FUN(__glewInterpolatePathsNV)
-#define glIsPathNV GLEW_GET_FUN(__glewIsPathNV)
-#define glIsPointInFillPathNV GLEW_GET_FUN(__glewIsPointInFillPathNV)
-#define glIsPointInStrokePathNV GLEW_GET_FUN(__glewIsPointInStrokePathNV)
-#define glPathColorGenNV GLEW_GET_FUN(__glewPathColorGenNV)
-#define glPathCommandsNV GLEW_GET_FUN(__glewPathCommandsNV)
-#define glPathCoordsNV GLEW_GET_FUN(__glewPathCoordsNV)
-#define glPathCoverDepthFuncNV GLEW_GET_FUN(__glewPathCoverDepthFuncNV)
-#define glPathDashArrayNV GLEW_GET_FUN(__glewPathDashArrayNV)
-#define glPathFogGenNV GLEW_GET_FUN(__glewPathFogGenNV)
-#define glPathGlyphRangeNV GLEW_GET_FUN(__glewPathGlyphRangeNV)
-#define glPathGlyphsNV GLEW_GET_FUN(__glewPathGlyphsNV)
-#define glPathParameterfNV GLEW_GET_FUN(__glewPathParameterfNV)
-#define glPathParameterfvNV GLEW_GET_FUN(__glewPathParameterfvNV)
-#define glPathParameteriNV GLEW_GET_FUN(__glewPathParameteriNV)
-#define glPathParameterivNV GLEW_GET_FUN(__glewPathParameterivNV)
-#define glPathStencilDepthOffsetNV GLEW_GET_FUN(__glewPathStencilDepthOffsetNV)
-#define glPathStencilFuncNV GLEW_GET_FUN(__glewPathStencilFuncNV)
-#define glPathStringNV GLEW_GET_FUN(__glewPathStringNV)
-#define glPathSubCommandsNV GLEW_GET_FUN(__glewPathSubCommandsNV)
-#define glPathSubCoordsNV GLEW_GET_FUN(__glewPathSubCoordsNV)
-#define glPathTexGenNV GLEW_GET_FUN(__glewPathTexGenNV)
-#define glPointAlongPathNV GLEW_GET_FUN(__glewPointAlongPathNV)
-#define glStencilFillPathInstancedNV GLEW_GET_FUN(__glewStencilFillPathInstancedNV)
-#define glStencilFillPathNV GLEW_GET_FUN(__glewStencilFillPathNV)
-#define glStencilStrokePathInstancedNV GLEW_GET_FUN(__glewStencilStrokePathInstancedNV)
-#define glStencilStrokePathNV GLEW_GET_FUN(__glewStencilStrokePathNV)
-#define glTransformPathNV GLEW_GET_FUN(__glewTransformPathNV)
-#define glWeightPathsNV GLEW_GET_FUN(__glewWeightPathsNV)
-
-#define GLEW_NV_path_rendering GLEW_GET_VAR(__GLEW_NV_path_rendering)
-
-#endif /* GL_NV_path_rendering */
-
-/* ------------------------- GL_NV_pixel_data_range ------------------------ */
-
-#ifndef GL_NV_pixel_data_range
-#define GL_NV_pixel_data_range 1
-
-#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878
-#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879
-#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A
-#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B
-#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C
-#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D
-
-typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer);
-
-#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV)
-#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV)
-
-#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range)
-
-#endif /* GL_NV_pixel_data_range */
-
-/* --------------------------- GL_NV_point_sprite -------------------------- */
-
-#ifndef GL_NV_point_sprite
-#define GL_NV_point_sprite 1
-
-#define GL_POINT_SPRITE_NV 0x8861
-#define GL_COORD_REPLACE_NV 0x8862
-#define GL_POINT_SPRITE_R_MODE_NV 0x8863
-
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params);
-
-#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV)
-#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV)
-
-#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite)
-
-#endif /* GL_NV_point_sprite */
-
-/* -------------------------- GL_NV_present_video -------------------------- */
-
-#ifndef GL_NV_present_video
-#define GL_NV_present_video 1
-
-#define GL_FRAME_NV 0x8E26
-#define GL_FIELDS_NV 0x8E27
-#define GL_CURRENT_TIME_NV 0x8E28
-#define GL_NUM_FILL_STREAMS_NV 0x8E29
-#define GL_PRESENT_TIME_NV 0x8E2A
-#define GL_PRESENT_DURATION_NV 0x8E2B
-
-typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params);
-typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3);
-typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1);
-
-#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV)
-#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV)
-#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV)
-#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV)
-#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV)
-#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV)
-
-#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video)
-
-#endif /* GL_NV_present_video */
-
-/* ------------------------ GL_NV_primitive_restart ------------------------ */
-
-#ifndef GL_NV_primitive_restart
-#define GL_NV_primitive_restart 1
-
-#define GL_PRIMITIVE_RESTART_NV 0x8558
-#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559
-
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index);
-typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void);
-
-#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV)
-#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV)
-
-#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart)
-
-#endif /* GL_NV_primitive_restart */
-
-/* ------------------------ GL_NV_register_combiners ----------------------- */
-
-#ifndef GL_NV_register_combiners
-#define GL_NV_register_combiners 1
-
-#define GL_REGISTER_COMBINERS_NV 0x8522
-#define GL_VARIABLE_A_NV 0x8523
-#define GL_VARIABLE_B_NV 0x8524
-#define GL_VARIABLE_C_NV 0x8525
-#define GL_VARIABLE_D_NV 0x8526
-#define GL_VARIABLE_E_NV 0x8527
-#define GL_VARIABLE_F_NV 0x8528
-#define GL_VARIABLE_G_NV 0x8529
-#define GL_CONSTANT_COLOR0_NV 0x852A
-#define GL_CONSTANT_COLOR1_NV 0x852B
-#define GL_PRIMARY_COLOR_NV 0x852C
-#define GL_SECONDARY_COLOR_NV 0x852D
-#define GL_SPARE0_NV 0x852E
-#define GL_SPARE1_NV 0x852F
-#define GL_DISCARD_NV 0x8530
-#define GL_E_TIMES_F_NV 0x8531
-#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532
-#define GL_UNSIGNED_IDENTITY_NV 0x8536
-#define GL_UNSIGNED_INVERT_NV 0x8537
-#define GL_EXPAND_NORMAL_NV 0x8538
-#define GL_EXPAND_NEGATE_NV 0x8539
-#define GL_HALF_BIAS_NORMAL_NV 0x853A
-#define GL_HALF_BIAS_NEGATE_NV 0x853B
-#define GL_SIGNED_IDENTITY_NV 0x853C
-#define GL_SIGNED_NEGATE_NV 0x853D
-#define GL_SCALE_BY_TWO_NV 0x853E
-#define GL_SCALE_BY_FOUR_NV 0x853F
-#define GL_SCALE_BY_ONE_HALF_NV 0x8540
-#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541
-#define GL_COMBINER_INPUT_NV 0x8542
-#define GL_COMBINER_MAPPING_NV 0x8543
-#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544
-#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545
-#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546
-#define GL_COMBINER_MUX_SUM_NV 0x8547
-#define GL_COMBINER_SCALE_NV 0x8548
-#define GL_COMBINER_BIAS_NV 0x8549
-#define GL_COMBINER_AB_OUTPUT_NV 0x854A
-#define GL_COMBINER_CD_OUTPUT_NV 0x854B
-#define GL_COMBINER_SUM_OUTPUT_NV 0x854C
-#define GL_MAX_GENERAL_COMBINERS_NV 0x854D
-#define GL_NUM_GENERAL_COMBINERS_NV 0x854E
-#define GL_COLOR_SUM_CLAMP_NV 0x854F
-#define GL_COMBINER0_NV 0x8550
-#define GL_COMBINER1_NV 0x8551
-#define GL_COMBINER2_NV 0x8552
-#define GL_COMBINER3_NV 0x8553
-#define GL_COMBINER4_NV 0x8554
-#define GL_COMBINER5_NV 0x8555
-#define GL_COMBINER6_NV 0x8556
-#define GL_COMBINER7_NV 0x8557
-
-typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params);
-
-#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV)
-#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV)
-#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV)
-#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV)
-#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV)
-#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV)
-#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV)
-#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV)
-#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV)
-#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV)
-#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV)
-#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV)
-#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV)
-
-#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners)
-
-#endif /* GL_NV_register_combiners */
-
-/* ----------------------- GL_NV_register_combiners2 ----------------------- */
-
-#ifndef GL_NV_register_combiners2
-#define GL_NV_register_combiners2 1
-
-#define GL_PER_STAGE_CONSTANTS_NV 0x8535
-
-typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params);
-
-#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV)
-#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV)
-
-#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2)
-
-#endif /* GL_NV_register_combiners2 */
-
-/* ---------------------- GL_NV_shader_atomic_counters --------------------- */
-
-#ifndef GL_NV_shader_atomic_counters
-#define GL_NV_shader_atomic_counters 1
-
-#define GLEW_NV_shader_atomic_counters GLEW_GET_VAR(__GLEW_NV_shader_atomic_counters)
-
-#endif /* GL_NV_shader_atomic_counters */
-
-/* ----------------------- GL_NV_shader_atomic_float ----------------------- */
-
-#ifndef GL_NV_shader_atomic_float
-#define GL_NV_shader_atomic_float 1
-
-#define GLEW_NV_shader_atomic_float GLEW_GET_VAR(__GLEW_NV_shader_atomic_float)
-
-#endif /* GL_NV_shader_atomic_float */
-
-/* ------------------------ GL_NV_shader_buffer_load ----------------------- */
-
-#ifndef GL_NV_shader_buffer_load
-#define GL_NV_shader_buffer_load 1
-
-#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D
-#define GL_GPU_ADDRESS_NV 0x8F34
-#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35
-
-typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result);
-typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target);
-typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target);
-typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access);
-typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value);
-typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value);
-typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value);
-
-#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV)
-#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV)
-#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV)
-#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV)
-#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV)
-#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV)
-#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV)
-#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV)
-#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV)
-#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV)
-#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV)
-#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV)
-#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV)
-
-#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load)
-
-#endif /* GL_NV_shader_buffer_load */
-
-/* ------------------- GL_NV_shader_storage_buffer_object ------------------ */
-
-#ifndef GL_NV_shader_storage_buffer_object
-#define GL_NV_shader_storage_buffer_object 1
-
-#define GLEW_NV_shader_storage_buffer_object GLEW_GET_VAR(__GLEW_NV_shader_storage_buffer_object)
-
-#endif /* GL_NV_shader_storage_buffer_object */
-
-/* ---------------------- GL_NV_tessellation_program5 ---------------------- */
-
-#ifndef GL_NV_tessellation_program5
-#define GL_NV_tessellation_program5 1
-
-#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8
-#define GL_TESS_CONTROL_PROGRAM_NV 0x891E
-#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F
-#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74
-#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75
-
-#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5)
-
-#endif /* GL_NV_tessellation_program5 */
-
-/* -------------------------- GL_NV_texgen_emboss -------------------------- */
-
-#ifndef GL_NV_texgen_emboss
-#define GL_NV_texgen_emboss 1
-
-#define GL_EMBOSS_LIGHT_NV 0x855D
-#define GL_EMBOSS_CONSTANT_NV 0x855E
-#define GL_EMBOSS_MAP_NV 0x855F
-
-#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss)
-
-#endif /* GL_NV_texgen_emboss */
-
-/* ------------------------ GL_NV_texgen_reflection ------------------------ */
-
-#ifndef GL_NV_texgen_reflection
-#define GL_NV_texgen_reflection 1
-
-#define GL_NORMAL_MAP_NV 0x8511
-#define GL_REFLECTION_MAP_NV 0x8512
-
-#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection)
-
-#endif /* GL_NV_texgen_reflection */
-
-/* ------------------------- GL_NV_texture_barrier ------------------------- */
-
-#ifndef GL_NV_texture_barrier
-#define GL_NV_texture_barrier 1
-
-typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void);
-
-#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV)
-
-#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier)
-
-#endif /* GL_NV_texture_barrier */
-
-/* --------------------- GL_NV_texture_compression_vtc --------------------- */
-
-#ifndef GL_NV_texture_compression_vtc
-#define GL_NV_texture_compression_vtc 1
-
-#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc)
-
-#endif /* GL_NV_texture_compression_vtc */
-
-/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */
-
-#ifndef GL_NV_texture_env_combine4
-#define GL_NV_texture_env_combine4 1
-
-#define GL_COMBINE4_NV 0x8503
-#define GL_SOURCE3_RGB_NV 0x8583
-#define GL_SOURCE3_ALPHA_NV 0x858B
-#define GL_OPERAND3_RGB_NV 0x8593
-#define GL_OPERAND3_ALPHA_NV 0x859B
-
-#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4)
-
-#endif /* GL_NV_texture_env_combine4 */
-
-/* ---------------------- GL_NV_texture_expand_normal ---------------------- */
-
-#ifndef GL_NV_texture_expand_normal
-#define GL_NV_texture_expand_normal 1
-
-#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F
-
-#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal)
-
-#endif /* GL_NV_texture_expand_normal */
-
-/* ----------------------- GL_NV_texture_multisample ----------------------- */
-
-#ifndef GL_NV_texture_multisample
-#define GL_NV_texture_multisample 1
-
-#define GL_TEXTURE_COVERAGE_SAMPLES_NV 0x9045
-#define GL_TEXTURE_COLOR_SAMPLES_NV 0x9046
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint texture, GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC) (GLuint texture, GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
-
-#define glTexImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage2DMultisampleCoverageNV)
-#define glTexImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTexImage3DMultisampleCoverageNV)
-#define glTextureImage2DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage2DMultisampleCoverageNV)
-#define glTextureImage2DMultisampleNV GLEW_GET_FUN(__glewTextureImage2DMultisampleNV)
-#define glTextureImage3DMultisampleCoverageNV GLEW_GET_FUN(__glewTextureImage3DMultisampleCoverageNV)
-#define glTextureImage3DMultisampleNV GLEW_GET_FUN(__glewTextureImage3DMultisampleNV)
-
-#define GLEW_NV_texture_multisample GLEW_GET_VAR(__GLEW_NV_texture_multisample)
-
-#endif /* GL_NV_texture_multisample */
-
-/* ------------------------ GL_NV_texture_rectangle ------------------------ */
-
-#ifndef GL_NV_texture_rectangle
-#define GL_NV_texture_rectangle 1
-
-#define GL_TEXTURE_RECTANGLE_NV 0x84F5
-#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6
-#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7
-#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8
-
-#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle)
-
-#endif /* GL_NV_texture_rectangle */
-
-/* -------------------------- GL_NV_texture_shader ------------------------- */
-
-#ifndef GL_NV_texture_shader
-#define GL_NV_texture_shader 1
-
-#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C
-#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D
-#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E
-#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_SHADER_CONSISTENT_NV 0x86DD
-#define GL_TEXTURE_SHADER_NV 0x86DE
-#define GL_SHADER_OPERATION_NV 0x86DF
-#define GL_CULL_MODES_NV 0x86E0
-#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1
-#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2
-#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3
-#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3
-#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4
-#define GL_CONST_EYE_NV 0x86E5
-#define GL_PASS_THROUGH_NV 0x86E6
-#define GL_CULL_FRAGMENT_NV 0x86E7
-#define GL_OFFSET_TEXTURE_2D_NV 0x86E8
-#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9
-#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA
-#define GL_DOT_PRODUCT_NV 0x86EC
-#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED
-#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE
-#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0
-#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1
-#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2
-#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-#define GL_HI_SCALE_NV 0x870E
-#define GL_LO_SCALE_NV 0x870F
-#define GL_DS_SCALE_NV 0x8710
-#define GL_DT_SCALE_NV 0x8711
-#define GL_MAGNITUDE_SCALE_NV 0x8712
-#define GL_VIBRANCE_SCALE_NV 0x8713
-#define GL_HI_BIAS_NV 0x8714
-#define GL_LO_BIAS_NV 0x8715
-#define GL_DS_BIAS_NV 0x8716
-#define GL_DT_BIAS_NV 0x8717
-#define GL_MAGNITUDE_BIAS_NV 0x8718
-#define GL_VIBRANCE_BIAS_NV 0x8719
-#define GL_TEXTURE_BORDER_VALUES_NV 0x871A
-#define GL_TEXTURE_HI_SIZE_NV 0x871B
-#define GL_TEXTURE_LO_SIZE_NV 0x871C
-#define GL_TEXTURE_DS_SIZE_NV 0x871D
-#define GL_TEXTURE_DT_SIZE_NV 0x871E
-#define GL_TEXTURE_MAG_SIZE_NV 0x871F
-
-#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader)
-
-#endif /* GL_NV_texture_shader */
-
-/* ------------------------- GL_NV_texture_shader2 ------------------------- */
-
-#ifndef GL_NV_texture_shader2
-#define GL_NV_texture_shader2 1
-
-#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA
-#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB
-#define GL_DSDT_MAG_INTENSITY_NV 0x86DC
-#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF
-#define GL_HILO_NV 0x86F4
-#define GL_DSDT_NV 0x86F5
-#define GL_DSDT_MAG_NV 0x86F6
-#define GL_DSDT_MAG_VIB_NV 0x86F7
-#define GL_HILO16_NV 0x86F8
-#define GL_SIGNED_HILO_NV 0x86F9
-#define GL_SIGNED_HILO16_NV 0x86FA
-#define GL_SIGNED_RGBA_NV 0x86FB
-#define GL_SIGNED_RGBA8_NV 0x86FC
-#define GL_SIGNED_RGB_NV 0x86FE
-#define GL_SIGNED_RGB8_NV 0x86FF
-#define GL_SIGNED_LUMINANCE_NV 0x8701
-#define GL_SIGNED_LUMINANCE8_NV 0x8702
-#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703
-#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704
-#define GL_SIGNED_ALPHA_NV 0x8705
-#define GL_SIGNED_ALPHA8_NV 0x8706
-#define GL_SIGNED_INTENSITY_NV 0x8707
-#define GL_SIGNED_INTENSITY8_NV 0x8708
-#define GL_DSDT8_NV 0x8709
-#define GL_DSDT8_MAG8_NV 0x870A
-#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B
-#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C
-#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D
-
-#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2)
-
-#endif /* GL_NV_texture_shader2 */
-
-/* ------------------------- GL_NV_texture_shader3 ------------------------- */
-
-#ifndef GL_NV_texture_shader3
-#define GL_NV_texture_shader3 1
-
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850
-#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852
-#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853
-#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854
-#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856
-#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857
-#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858
-#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859
-#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A
-#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B
-#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C
-#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D
-#define GL_HILO8_NV 0x885E
-#define GL_SIGNED_HILO8_NV 0x885F
-#define GL_FORCE_BLUE_TO_ONE_NV 0x8860
-
-#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3)
-
-#endif /* GL_NV_texture_shader3 */
-
-/* ------------------------ GL_NV_transform_feedback ----------------------- */
-
-#ifndef GL_NV_transform_feedback
-#define GL_NV_transform_feedback 1
-
-#define GL_BACK_PRIMARY_COLOR_NV 0x8C77
-#define GL_BACK_SECONDARY_COLOR_NV 0x8C78
-#define GL_TEXTURE_COORD_NV 0x8C79
-#define GL_CLIP_DISTANCE_NV 0x8C7A
-#define GL_VERTEX_ID_NV 0x8C7B
-#define GL_PRIMITIVE_ID_NV 0x8C7C
-#define GL_GENERIC_ATTRIB_NV 0x8C7D
-#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80
-#define GL_ACTIVE_VARYINGS_NV 0x8C81
-#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82
-#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83
-#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84
-#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85
-#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86
-#define GL_PRIMITIVES_GENERATED_NV 0x8C87
-#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88
-#define GL_RASTERIZER_DISCARD_NV 0x8C89
-#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A
-#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B
-#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C
-#define GL_SEPARATE_ATTRIBS_NV 0x8C8D
-#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E
-#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F
-
-typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset);
-typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
-typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name);
-typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location);
-typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode);
-typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode);
-
-#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV)
-#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV)
-#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV)
-#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV)
-#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV)
-#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV)
-#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV)
-#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV)
-#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV)
-#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV)
-#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV)
-
-#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback)
-
-#endif /* GL_NV_transform_feedback */
-
-/* ----------------------- GL_NV_transform_feedback2 ----------------------- */
-
-#ifndef GL_NV_transform_feedback2
-#define GL_NV_transform_feedback2 1
-
-#define GL_TRANSFORM_FEEDBACK_NV 0x8E22
-#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23
-#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24
-#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25
-
-typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id);
-typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids);
-typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void);
-
-#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV)
-#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV)
-#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV)
-#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV)
-#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV)
-#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV)
-#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV)
-
-#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2)
-
-#endif /* GL_NV_transform_feedback2 */
-
-/* -------------------------- GL_NV_vdpau_interop -------------------------- */
-
-#ifndef GL_NV_vdpau_interop
-#define GL_NV_vdpau_interop 1
-
-#define GL_SURFACE_STATE_NV 0x86EB
-#define GL_SURFACE_REGISTERED_NV 0x86FD
-#define GL_SURFACE_MAPPED_NV 0x8700
-#define GL_WRITE_DISCARD_NV 0x88BE
-
-typedef GLintptr GLvdpauSurfaceNV;
-
-typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values);
-typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress);
-typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface);
-typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces);
-typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames);
-typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access);
-typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces);
-typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface);
-
-#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV)
-#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV)
-#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV)
-#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV)
-#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV)
-#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV)
-#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV)
-#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV)
-#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV)
-#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV)
-
-#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop)
-
-#endif /* GL_NV_vdpau_interop */
-
-/* ------------------------ GL_NV_vertex_array_range ----------------------- */
-
-#ifndef GL_NV_vertex_array_range
-#define GL_NV_vertex_array_range 1
-
-#define GL_VERTEX_ARRAY_RANGE_NV 0x851D
-#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E
-#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F
-#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520
-#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521
-
-typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void);
-typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, GLvoid *pointer);
-
-#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV)
-#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV)
-
-#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range)
-
-#endif /* GL_NV_vertex_array_range */
-
-/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */
-
-#ifndef GL_NV_vertex_array_range2
-#define GL_NV_vertex_array_range2 1
-
-#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533
-
-#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2)
-
-#endif /* GL_NV_vertex_array_range2 */
-
-/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */
-
-#ifndef GL_NV_vertex_attrib_integer_64bit
-#define GL_NV_vertex_attrib_integer_64bit 1
-
-#define GL_INT64_NV 0x140E
-#define GL_UNSIGNED_INT64_NV 0x140F
-
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-
-#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV)
-#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV)
-#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV)
-#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV)
-#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV)
-#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV)
-#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV)
-#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV)
-#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV)
-#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV)
-#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV)
-#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV)
-#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV)
-#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV)
-#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV)
-#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV)
-#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV)
-#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV)
-#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV)
-
-#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit)
-
-#endif /* GL_NV_vertex_attrib_integer_64bit */
-
-/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */
-
-#ifndef GL_NV_vertex_buffer_unified_memory
-#define GL_NV_vertex_buffer_unified_memory 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E
-#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F
-#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20
-#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21
-#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22
-#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23
-#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24
-#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25
-#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26
-#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27
-#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28
-#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29
-#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A
-#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B
-#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C
-#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D
-#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E
-#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F
-#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30
-#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31
-#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32
-#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33
-#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40
-#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41
-#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42
-
-typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length);
-typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]);
-typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride);
-typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride);
-
-#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV)
-#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV)
-#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV)
-#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV)
-#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV)
-#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV)
-#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV)
-#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV)
-#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV)
-#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV)
-#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV)
-#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV)
-
-#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory)
-
-#endif /* GL_NV_vertex_buffer_unified_memory */
-
-/* -------------------------- GL_NV_vertex_program ------------------------- */
-
-#ifndef GL_NV_vertex_program
-#define GL_NV_vertex_program 1
-
-#define GL_VERTEX_PROGRAM_NV 0x8620
-#define GL_VERTEX_STATE_PROGRAM_NV 0x8621
-#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623
-#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624
-#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625
-#define GL_CURRENT_ATTRIB_NV 0x8626
-#define GL_PROGRAM_LENGTH_NV 0x8627
-#define GL_PROGRAM_STRING_NV 0x8628
-#define GL_MODELVIEW_PROJECTION_NV 0x8629
-#define GL_IDENTITY_NV 0x862A
-#define GL_INVERSE_NV 0x862B
-#define GL_TRANSPOSE_NV 0x862C
-#define GL_INVERSE_TRANSPOSE_NV 0x862D
-#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E
-#define GL_MAX_TRACK_MATRICES_NV 0x862F
-#define GL_MATRIX0_NV 0x8630
-#define GL_MATRIX1_NV 0x8631
-#define GL_MATRIX2_NV 0x8632
-#define GL_MATRIX3_NV 0x8633
-#define GL_MATRIX4_NV 0x8634
-#define GL_MATRIX5_NV 0x8635
-#define GL_MATRIX6_NV 0x8636
-#define GL_MATRIX7_NV 0x8637
-#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640
-#define GL_CURRENT_MATRIX_NV 0x8641
-#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642
-#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643
-#define GL_PROGRAM_PARAMETER_NV 0x8644
-#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645
-#define GL_PROGRAM_TARGET_NV 0x8646
-#define GL_PROGRAM_RESIDENT_NV 0x8647
-#define GL_TRACK_MATRIX_NV 0x8648
-#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649
-#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A
-#define GL_PROGRAM_ERROR_POSITION_NV 0x864B
-#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650
-#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651
-#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652
-#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653
-#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654
-#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655
-#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656
-#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657
-#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658
-#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659
-#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A
-#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B
-#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C
-#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D
-#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E
-#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F
-#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660
-#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661
-#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662
-#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663
-#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664
-#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665
-#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666
-#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667
-#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668
-#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669
-#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A
-#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B
-#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C
-#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D
-#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E
-#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F
-#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670
-#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671
-#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672
-#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673
-#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674
-#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675
-#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676
-#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677
-#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678
-#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679
-#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A
-#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B
-#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C
-#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D
-#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E
-#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F
-
-typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences);
-typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id);
-typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program);
-typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params);
-typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id);
-typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids);
-typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v);
-typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v);
-
-#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV)
-#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV)
-#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV)
-#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV)
-#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV)
-#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV)
-#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV)
-#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV)
-#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV)
-#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV)
-#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV)
-#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV)
-#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV)
-#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV)
-#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV)
-#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV)
-#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV)
-#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV)
-#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV)
-#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV)
-#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV)
-#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV)
-#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV)
-#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV)
-#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV)
-#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV)
-#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV)
-#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV)
-#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV)
-#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV)
-#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV)
-#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV)
-#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV)
-#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV)
-#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV)
-#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV)
-#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV)
-#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV)
-#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV)
-#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV)
-#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV)
-#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV)
-#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV)
-#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV)
-#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV)
-#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV)
-#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV)
-#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV)
-#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV)
-#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV)
-#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV)
-#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV)
-#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV)
-#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV)
-#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV)
-#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV)
-#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV)
-#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV)
-#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV)
-#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV)
-#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV)
-#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV)
-#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV)
-#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV)
-
-#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program)
-
-#endif /* GL_NV_vertex_program */
-
-/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */
-
-#ifndef GL_NV_vertex_program1_1
-#define GL_NV_vertex_program1_1 1
-
-#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1)
-
-#endif /* GL_NV_vertex_program1_1 */
-
-/* ------------------------- GL_NV_vertex_program2 ------------------------- */
-
-#ifndef GL_NV_vertex_program2
-#define GL_NV_vertex_program2 1
-
-#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2)
-
-#endif /* GL_NV_vertex_program2 */
-
-/* ---------------------- GL_NV_vertex_program2_option --------------------- */
-
-#ifndef GL_NV_vertex_program2_option
-#define GL_NV_vertex_program2_option 1
-
-#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4
-#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5
-
-#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option)
-
-#endif /* GL_NV_vertex_program2_option */
-
-/* ------------------------- GL_NV_vertex_program3 ------------------------- */
-
-#ifndef GL_NV_vertex_program3
-#define GL_NV_vertex_program3 1
-
-#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C
-
-#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3)
-
-#endif /* GL_NV_vertex_program3 */
-
-/* ------------------------- GL_NV_vertex_program4 ------------------------- */
-
-#ifndef GL_NV_vertex_program4
-#define GL_NV_vertex_program4 1
-
-#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD
-
-#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4)
-
-#endif /* GL_NV_vertex_program4 */
-
-/* -------------------------- GL_NV_video_capture -------------------------- */
-
-#ifndef GL_NV_video_capture
-#define GL_NV_video_capture 1
-
-#define GL_VIDEO_BUFFER_NV 0x9020
-#define GL_VIDEO_BUFFER_BINDING_NV 0x9021
-#define GL_FIELD_UPPER_NV 0x9022
-#define GL_FIELD_LOWER_NV 0x9023
-#define GL_NUM_VIDEO_CAPTURE_STREAMS_NV 0x9024
-#define GL_NEXT_VIDEO_CAPTURE_BUFFER_STATUS_NV 0x9025
-#define GL_VIDEO_CAPTURE_TO_422_SUPPORTED_NV 0x9026
-#define GL_LAST_VIDEO_CAPTURE_STATUS_NV 0x9027
-#define GL_VIDEO_BUFFER_PITCH_NV 0x9028
-#define GL_VIDEO_COLOR_CONVERSION_MATRIX_NV 0x9029
-#define GL_VIDEO_COLOR_CONVERSION_MAX_NV 0x902A
-#define GL_VIDEO_COLOR_CONVERSION_MIN_NV 0x902B
-#define GL_VIDEO_COLOR_CONVERSION_OFFSET_NV 0x902C
-#define GL_VIDEO_BUFFER_INTERNAL_FORMAT_NV 0x902D
-#define GL_PARTIAL_SUCCESS_NV 0x902E
-#define GL_SUCCESS_NV 0x902F
-#define GL_FAILURE_NV 0x9030
-#define GL_YCBYCR8_422_NV 0x9031
-#define GL_YCBAYCR8A_4224_NV 0x9032
-#define GL_Z6Y10Z6CB10Z6Y10Z6CR10_422_NV 0x9033
-#define GL_Z6Y10Z6CB10Z6A10Z6Y10Z6CR10Z6A10_4224_NV 0x9034
-#define GL_Z4Y12Z4CB12Z4Y12Z4CR12_422_NV 0x9035
-#define GL_Z4Y12Z4CB12Z4A12Z4Y12Z4CR12Z4A12_4224_NV 0x9036
-#define GL_Z4Y12Z4CB12Z4CR12_444_NV 0x9037
-#define GL_VIDEO_CAPTURE_FRAME_WIDTH_NV 0x9038
-#define GL_VIDEO_CAPTURE_FRAME_HEIGHT_NV 0x9039
-#define GL_VIDEO_CAPTURE_FIELD_UPPER_HEIGHT_NV 0x903A
-#define GL_VIDEO_CAPTURE_FIELD_LOWER_HEIGHT_NV 0x903B
-#define GL_VIDEO_CAPTURE_SURFACE_ORIGIN_NV 0x903C
-
-typedef void (GLAPIENTRY * PFNGLBEGINVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLintptrARB offset);
-typedef void (GLAPIENTRY * PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC) (GLuint video_capture_slot, GLuint stream, GLenum frame_region, GLenum target, GLuint texture);
-typedef void (GLAPIENTRY * PFNGLENDVIDEOCAPTURENVPROC) (GLuint video_capture_slot);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTURESTREAMIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETVIDEOCAPTUREIVNVPROC) (GLuint video_capture_slot, GLenum pname, GLint* params);
-typedef GLenum (GLAPIENTRY * PFNGLVIDEOCAPTURENVPROC) (GLuint video_capture_slot, GLuint* sequence_num, GLuint64EXT *capture_time);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLdouble* params);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC) (GLuint video_capture_slot, GLuint stream, GLenum pname, const GLint* params);
-
-#define glBeginVideoCaptureNV GLEW_GET_FUN(__glewBeginVideoCaptureNV)
-#define glBindVideoCaptureStreamBufferNV GLEW_GET_FUN(__glewBindVideoCaptureStreamBufferNV)
-#define glBindVideoCaptureStreamTextureNV GLEW_GET_FUN(__glewBindVideoCaptureStreamTextureNV)
-#define glEndVideoCaptureNV GLEW_GET_FUN(__glewEndVideoCaptureNV)
-#define glGetVideoCaptureStreamdvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamdvNV)
-#define glGetVideoCaptureStreamfvNV GLEW_GET_FUN(__glewGetVideoCaptureStreamfvNV)
-#define glGetVideoCaptureStreamivNV GLEW_GET_FUN(__glewGetVideoCaptureStreamivNV)
-#define glGetVideoCaptureivNV GLEW_GET_FUN(__glewGetVideoCaptureivNV)
-#define glVideoCaptureNV GLEW_GET_FUN(__glewVideoCaptureNV)
-#define glVideoCaptureStreamParameterdvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterdvNV)
-#define glVideoCaptureStreamParameterfvNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterfvNV)
-#define glVideoCaptureStreamParameterivNV GLEW_GET_FUN(__glewVideoCaptureStreamParameterivNV)
-
-#define GLEW_NV_video_capture GLEW_GET_VAR(__GLEW_NV_video_capture)
-
-#endif /* GL_NV_video_capture */
-
-/* ------------------------ GL_OES_byte_coordinates ------------------------ */
-
-#ifndef GL_OES_byte_coordinates
-#define GL_OES_byte_coordinates 1
-
-#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates)
-
-#endif /* GL_OES_byte_coordinates */
-
-/* ------------------- GL_OES_compressed_paletted_texture ------------------ */
-
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-
-#define GL_PALETTE4_RGB8_OES 0x8B90
-#define GL_PALETTE4_RGBA8_OES 0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
-#define GL_PALETTE4_RGBA4_OES 0x8B93
-#define GL_PALETTE4_RGB5_A1_OES 0x8B94
-#define GL_PALETTE8_RGB8_OES 0x8B95
-#define GL_PALETTE8_RGBA8_OES 0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
-#define GL_PALETTE8_RGBA4_OES 0x8B98
-#define GL_PALETTE8_RGB5_A1_OES 0x8B99
-
-#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture)
-
-#endif /* GL_OES_compressed_paletted_texture */
-
-/* --------------------------- GL_OES_read_format -------------------------- */
-
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
-
-#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format)
-
-#endif /* GL_OES_read_format */
-
-/* ------------------------ GL_OES_single_precision ------------------------ */
-
-#ifndef GL_OES_single_precision
-#define GL_OES_single_precision 1
-
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth);
-typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
-typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation);
-typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
-
-#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES)
-#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES)
-#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES)
-#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES)
-#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES)
-#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES)
-
-#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision)
-
-#endif /* GL_OES_single_precision */
-
-/* ---------------------------- GL_OML_interlace --------------------------- */
-
-#ifndef GL_OML_interlace
-#define GL_OML_interlace 1
-
-#define GL_INTERLACE_OML 0x8980
-#define GL_INTERLACE_READ_OML 0x8981
-
-#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace)
-
-#endif /* GL_OML_interlace */
-
-/* ---------------------------- GL_OML_resample ---------------------------- */
-
-#ifndef GL_OML_resample
-#define GL_OML_resample 1
-
-#define GL_PACK_RESAMPLE_OML 0x8984
-#define GL_UNPACK_RESAMPLE_OML 0x8985
-#define GL_RESAMPLE_REPLICATE_OML 0x8986
-#define GL_RESAMPLE_ZERO_FILL_OML 0x8987
-#define GL_RESAMPLE_AVERAGE_OML 0x8988
-#define GL_RESAMPLE_DECIMATE_OML 0x8989
-
-#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample)
-
-#endif /* GL_OML_resample */
-
-/* ---------------------------- GL_OML_subsample --------------------------- */
-
-#ifndef GL_OML_subsample
-#define GL_OML_subsample 1
-
-#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982
-#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983
-
-#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample)
-
-#endif /* GL_OML_subsample */
-
-/* --------------------------- GL_PGI_misc_hints --------------------------- */
-
-#ifndef GL_PGI_misc_hints
-#define GL_PGI_misc_hints 1
-
-#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000
-#define GL_CONSERVE_MEMORY_HINT_PGI 107005
-#define GL_RECLAIM_MEMORY_HINT_PGI 107006
-#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010
-#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011
-#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012
-#define GL_ALWAYS_FAST_HINT_PGI 107020
-#define GL_ALWAYS_SOFT_HINT_PGI 107021
-#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022
-#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023
-#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024
-#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025
-#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030
-#define GL_STRICT_LIGHTING_HINT_PGI 107031
-#define GL_STRICT_SCISSOR_HINT_PGI 107032
-#define GL_FULL_STIPPLE_HINT_PGI 107033
-#define GL_CLIP_NEAR_HINT_PGI 107040
-#define GL_CLIP_FAR_HINT_PGI 107041
-#define GL_WIDE_LINE_HINT_PGI 107042
-#define GL_BACK_NORMALS_HINT_PGI 107043
-
-#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints)
-
-#endif /* GL_PGI_misc_hints */
-
-/* -------------------------- GL_PGI_vertex_hints -------------------------- */
-
-#ifndef GL_PGI_vertex_hints
-#define GL_PGI_vertex_hints 1
-
-#define GL_VERTEX23_BIT_PGI 0x00000004
-#define GL_VERTEX4_BIT_PGI 0x00000008
-#define GL_COLOR3_BIT_PGI 0x00010000
-#define GL_COLOR4_BIT_PGI 0x00020000
-#define GL_EDGEFLAG_BIT_PGI 0x00040000
-#define GL_INDEX_BIT_PGI 0x00080000
-#define GL_MAT_AMBIENT_BIT_PGI 0x00100000
-#define GL_VERTEX_DATA_HINT_PGI 107050
-#define GL_VERTEX_CONSISTENT_HINT_PGI 107051
-#define GL_MATERIAL_SIDE_HINT_PGI 107052
-#define GL_MAX_VERTEX_HINT_PGI 107053
-#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000
-#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000
-#define GL_MAT_EMISSION_BIT_PGI 0x00800000
-#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000
-#define GL_MAT_SHININESS_BIT_PGI 0x02000000
-#define GL_MAT_SPECULAR_BIT_PGI 0x04000000
-#define GL_NORMAL_BIT_PGI 0x08000000
-#define GL_TEXCOORD1_BIT_PGI 0x10000000
-#define GL_TEXCOORD2_BIT_PGI 0x20000000
-#define GL_TEXCOORD3_BIT_PGI 0x40000000
-#define GL_TEXCOORD4_BIT_PGI 0x80000000
-
-#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints)
-
-#endif /* GL_PGI_vertex_hints */
-
-/* ---------------------- GL_REGAL_ES1_0_compatibility --------------------- */
-
-#ifndef GL_REGAL_ES1_0_compatibility
-#define GL_REGAL_ES1_0_compatibility 1
-
-typedef int GLclampx;
-
-typedef void (GLAPIENTRY * PFNGLALPHAFUNCXPROC) (GLenum func, GLclampx ref);
-typedef void (GLAPIENTRY * PFNGLCLEARCOLORXPROC) (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
-typedef void (GLAPIENTRY * PFNGLCLEARDEPTHXPROC) (GLclampx depth);
-typedef void (GLAPIENTRY * PFNGLCOLOR4XPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
-typedef void (GLAPIENTRY * PFNGLDEPTHRANGEXPROC) (GLclampx zNear, GLclampx zFar);
-typedef void (GLAPIENTRY * PFNGLFOGXPROC) (GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLFOGXVPROC) (GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLFRUSTUMFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-typedef void (GLAPIENTRY * PFNGLFRUSTUMXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELXPROC) (GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLLIGHTMODELXVPROC) (GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLLIGHTXPROC) (GLenum light, GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLLIGHTXVPROC) (GLenum light, GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLLINEWIDTHXPROC) (GLfixed width);
-typedef void (GLAPIENTRY * PFNGLLOADMATRIXXPROC) (const GLfixed* m);
-typedef void (GLAPIENTRY * PFNGLMATERIALXPROC) (GLenum face, GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLMATERIALXVPROC) (GLenum face, GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLMULTMATRIXXPROC) (const GLfixed* m);
-typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4XPROC) (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
-typedef void (GLAPIENTRY * PFNGLNORMAL3XPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
-typedef void (GLAPIENTRY * PFNGLORTHOFPROC) (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
-typedef void (GLAPIENTRY * PFNGLORTHOXPROC) (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
-typedef void (GLAPIENTRY * PFNGLPOINTSIZEXPROC) (GLfixed size);
-typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETXPROC) (GLfixed factor, GLfixed units);
-typedef void (GLAPIENTRY * PFNGLROTATEXPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
-typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEXPROC) (GLclampx value, GLboolean invert);
-typedef void (GLAPIENTRY * PFNGLSCALEXPROC) (GLfixed x, GLfixed y, GLfixed z);
-typedef void (GLAPIENTRY * PFNGLTEXENVXPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLTEXENVXVPROC) (GLenum target, GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXPROC) (GLenum target, GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLTRANSLATEXPROC) (GLfixed x, GLfixed y, GLfixed z);
-
-#define glAlphaFuncx GLEW_GET_FUN(__glewAlphaFuncx)
-#define glClearColorx GLEW_GET_FUN(__glewClearColorx)
-#define glClearDepthx GLEW_GET_FUN(__glewClearDepthx)
-#define glColor4x GLEW_GET_FUN(__glewColor4x)
-#define glDepthRangex GLEW_GET_FUN(__glewDepthRangex)
-#define glFogx GLEW_GET_FUN(__glewFogx)
-#define glFogxv GLEW_GET_FUN(__glewFogxv)
-#define glFrustumf GLEW_GET_FUN(__glewFrustumf)
-#define glFrustumx GLEW_GET_FUN(__glewFrustumx)
-#define glLightModelx GLEW_GET_FUN(__glewLightModelx)
-#define glLightModelxv GLEW_GET_FUN(__glewLightModelxv)
-#define glLightx GLEW_GET_FUN(__glewLightx)
-#define glLightxv GLEW_GET_FUN(__glewLightxv)
-#define glLineWidthx GLEW_GET_FUN(__glewLineWidthx)
-#define glLoadMatrixx GLEW_GET_FUN(__glewLoadMatrixx)
-#define glMaterialx GLEW_GET_FUN(__glewMaterialx)
-#define glMaterialxv GLEW_GET_FUN(__glewMaterialxv)
-#define glMultMatrixx GLEW_GET_FUN(__glewMultMatrixx)
-#define glMultiTexCoord4x GLEW_GET_FUN(__glewMultiTexCoord4x)
-#define glNormal3x GLEW_GET_FUN(__glewNormal3x)
-#define glOrthof GLEW_GET_FUN(__glewOrthof)
-#define glOrthox GLEW_GET_FUN(__glewOrthox)
-#define glPointSizex GLEW_GET_FUN(__glewPointSizex)
-#define glPolygonOffsetx GLEW_GET_FUN(__glewPolygonOffsetx)
-#define glRotatex GLEW_GET_FUN(__glewRotatex)
-#define glSampleCoveragex GLEW_GET_FUN(__glewSampleCoveragex)
-#define glScalex GLEW_GET_FUN(__glewScalex)
-#define glTexEnvx GLEW_GET_FUN(__glewTexEnvx)
-#define glTexEnvxv GLEW_GET_FUN(__glewTexEnvxv)
-#define glTexParameterx GLEW_GET_FUN(__glewTexParameterx)
-#define glTranslatex GLEW_GET_FUN(__glewTranslatex)
-
-#define GLEW_REGAL_ES1_0_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_0_compatibility)
-
-#endif /* GL_REGAL_ES1_0_compatibility */
-
-/* ---------------------- GL_REGAL_ES1_1_compatibility --------------------- */
-
-#ifndef GL_REGAL_ES1_1_compatibility
-#define GL_REGAL_ES1_1_compatibility 1
-
-typedef void (GLAPIENTRY * PFNGLCLIPPLANEFPROC) (GLenum plane, const GLfloat* equation);
-typedef void (GLAPIENTRY * PFNGLCLIPPLANEXPROC) (GLenum plane, const GLfixed* equation);
-typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFPROC) (GLenum pname, GLfloat eqn[4]);
-typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEXPROC) (GLenum pname, GLfixed eqn[4]);
-typedef void (GLAPIENTRY * PFNGLGETFIXEDVPROC) (GLenum pname, GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLGETLIGHTXVPROC) (GLenum light, GLenum pname, GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLGETMATERIALXVPROC) (GLenum face, GLenum pname, GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXENVXVPROC) (GLenum env, GLenum pname, GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERXVPROC) (GLenum target, GLenum pname, GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXPROC) (GLenum pname, GLfixed param);
-typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERXVPROC) (GLenum pname, const GLfixed* params);
-typedef void (GLAPIENTRY * PFNGLPOINTSIZEPOINTEROESPROC) (GLenum type, GLsizei stride, const GLvoid* pointer);
-typedef void (GLAPIENTRY * PFNGLTEXPARAMETERXVPROC) (GLenum target, GLenum pname, const GLfixed* params);
-
-#define glClipPlanef GLEW_GET_FUN(__glewClipPlanef)
-#define glClipPlanex GLEW_GET_FUN(__glewClipPlanex)
-#define glGetClipPlanef GLEW_GET_FUN(__glewGetClipPlanef)
-#define glGetClipPlanex GLEW_GET_FUN(__glewGetClipPlanex)
-#define glGetFixedv GLEW_GET_FUN(__glewGetFixedv)
-#define glGetLightxv GLEW_GET_FUN(__glewGetLightxv)
-#define glGetMaterialxv GLEW_GET_FUN(__glewGetMaterialxv)
-#define glGetTexEnvxv GLEW_GET_FUN(__glewGetTexEnvxv)
-#define glGetTexParameterxv GLEW_GET_FUN(__glewGetTexParameterxv)
-#define glPointParameterx GLEW_GET_FUN(__glewPointParameterx)
-#define glPointParameterxv GLEW_GET_FUN(__glewPointParameterxv)
-#define glPointSizePointerOES GLEW_GET_FUN(__glewPointSizePointerOES)
-#define glTexParameterxv GLEW_GET_FUN(__glewTexParameterxv)
-
-#define GLEW_REGAL_ES1_1_compatibility GLEW_GET_VAR(__GLEW_REGAL_ES1_1_compatibility)
-
-#endif /* GL_REGAL_ES1_1_compatibility */
-
-/* ---------------------------- GL_REGAL_enable ---------------------------- */
-
-#ifndef GL_REGAL_enable
-#define GL_REGAL_enable 1
-
-#define GL_ERROR_REGAL 0x9322
-#define GL_DEBUG_REGAL 0x9323
-#define GL_LOG_REGAL 0x9324
-#define GL_EMULATION_REGAL 0x9325
-#define GL_DRIVER_REGAL 0x9326
-#define GL_MISSING_REGAL 0x9360
-#define GL_TRACE_REGAL 0x9361
-#define GL_CACHE_REGAL 0x9362
-#define GL_CODE_REGAL 0x9363
-#define GL_STATISTICS_REGAL 0x9364
-
-#define GLEW_REGAL_enable GLEW_GET_VAR(__GLEW_REGAL_enable)
-
-#endif /* GL_REGAL_enable */
-
-/* ------------------------- GL_REGAL_error_string ------------------------- */
-
-#ifndef GL_REGAL_error_string
-#define GL_REGAL_error_string 1
-
-typedef const GLchar* (GLAPIENTRY * PFNGLERRORSTRINGREGALPROC) (GLenum error);
-
-#define glErrorStringREGAL GLEW_GET_FUN(__glewErrorStringREGAL)
-
-#define GLEW_REGAL_error_string GLEW_GET_VAR(__GLEW_REGAL_error_string)
-
-#endif /* GL_REGAL_error_string */
-
-/* ------------------------ GL_REGAL_extension_query ----------------------- */
-
-#ifndef GL_REGAL_extension_query
-#define GL_REGAL_extension_query 1
-
-typedef GLboolean (GLAPIENTRY * PFNGLGETEXTENSIONREGALPROC) (const GLchar* ext);
-typedef GLboolean (GLAPIENTRY * PFNGLISSUPPORTEDREGALPROC) (const GLchar* ext);
-
-#define glGetExtensionREGAL GLEW_GET_FUN(__glewGetExtensionREGAL)
-#define glIsSupportedREGAL GLEW_GET_FUN(__glewIsSupportedREGAL)
-
-#define GLEW_REGAL_extension_query GLEW_GET_VAR(__GLEW_REGAL_extension_query)
-
-#endif /* GL_REGAL_extension_query */
-
-/* ------------------------------ GL_REGAL_log ----------------------------- */
-
-#ifndef GL_REGAL_log
-#define GL_REGAL_log 1
-
-#define GL_LOG_ERROR_REGAL 0x9319
-#define GL_LOG_WARNING_REGAL 0x931A
-#define GL_LOG_INFO_REGAL 0x931B
-#define GL_LOG_APP_REGAL 0x931C
-#define GL_LOG_DRIVER_REGAL 0x931D
-#define GL_LOG_INTERNAL_REGAL 0x931E
-#define GL_LOG_DEBUG_REGAL 0x931F
-#define GL_LOG_STATUS_REGAL 0x9320
-#define GL_LOG_HTTP_REGAL 0x9321
-
-typedef void (APIENTRY *GLLOGPROCREGAL)(GLenum stream, GLsizei length, const GLchar *message, GLvoid *context);
-
-typedef void (GLAPIENTRY * PFNGLLOGMESSAGECALLBACKREGALPROC) (GLLOGPROCREGAL callback);
-
-#define glLogMessageCallbackREGAL GLEW_GET_FUN(__glewLogMessageCallbackREGAL)
-
-#define GLEW_REGAL_log GLEW_GET_VAR(__GLEW_REGAL_log)
-
-#endif /* GL_REGAL_log */
-
-/* ----------------------- GL_REND_screen_coordinates ---------------------- */
-
-#ifndef GL_REND_screen_coordinates
-#define GL_REND_screen_coordinates 1
-
-#define GL_SCREEN_COORDINATES_REND 0x8490
-#define GL_INVERTED_SCREEN_W_REND 0x8491
-
-#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates)
-
-#endif /* GL_REND_screen_coordinates */
-
-/* ------------------------------- GL_S3_s3tc ------------------------------ */
-
-#ifndef GL_S3_s3tc
-#define GL_S3_s3tc 1
-
-#define GL_RGB_S3TC 0x83A0
-#define GL_RGB4_S3TC 0x83A1
-#define GL_RGBA_S3TC 0x83A2
-#define GL_RGBA4_S3TC 0x83A3
-#define GL_RGBA_DXT5_S3TC 0x83A4
-#define GL_RGBA4_DXT5_S3TC 0x83A5
-
-#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc)
-
-#endif /* GL_S3_s3tc */
-
-/* -------------------------- GL_SGIS_color_range -------------------------- */
-
-#ifndef GL_SGIS_color_range
-#define GL_SGIS_color_range 1
-
-#define GL_EXTENDED_RANGE_SGIS 0x85A5
-#define GL_MIN_RED_SGIS 0x85A6
-#define GL_MAX_RED_SGIS 0x85A7
-#define GL_MIN_GREEN_SGIS 0x85A8
-#define GL_MAX_GREEN_SGIS 0x85A9
-#define GL_MIN_BLUE_SGIS 0x85AA
-#define GL_MAX_BLUE_SGIS 0x85AB
-#define GL_MIN_ALPHA_SGIS 0x85AC
-#define GL_MAX_ALPHA_SGIS 0x85AD
-
-#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range)
-
-#endif /* GL_SGIS_color_range */
-
-/* ------------------------- GL_SGIS_detail_texture ------------------------ */
-
-#ifndef GL_SGIS_detail_texture
-#define GL_SGIS_detail_texture 1
-
-typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points);
-
-#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS)
-#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS)
-
-#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture)
-
-#endif /* GL_SGIS_detail_texture */
-
-/* -------------------------- GL_SGIS_fog_function ------------------------- */
-
-#ifndef GL_SGIS_fog_function
-#define GL_SGIS_fog_function 1
-
-typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points);
-
-#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS)
-#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS)
-
-#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function)
-
-#endif /* GL_SGIS_fog_function */
-
-/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */
-
-#ifndef GL_SGIS_generate_mipmap
-#define GL_SGIS_generate_mipmap 1
-
-#define GL_GENERATE_MIPMAP_SGIS 0x8191
-#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192
-
-#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap)
-
-#endif /* GL_SGIS_generate_mipmap */
-
-/* -------------------------- GL_SGIS_multisample -------------------------- */
-
-#ifndef GL_SGIS_multisample
-#define GL_SGIS_multisample 1
-
-#define GL_MULTISAMPLE_SGIS 0x809D
-#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F
-#define GL_SAMPLE_MASK_SGIS 0x80A0
-#define GL_1PASS_SGIS 0x80A1
-#define GL_2PASS_0_SGIS 0x80A2
-#define GL_2PASS_1_SGIS 0x80A3
-#define GL_4PASS_0_SGIS 0x80A4
-#define GL_4PASS_1_SGIS 0x80A5
-#define GL_4PASS_2_SGIS 0x80A6
-#define GL_4PASS_3_SGIS 0x80A7
-#define GL_SAMPLE_BUFFERS_SGIS 0x80A8
-#define GL_SAMPLES_SGIS 0x80A9
-#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA
-#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB
-#define GL_SAMPLE_PATTERN_SGIS 0x80AC
-
-typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert);
-typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern);
-
-#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS)
-#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS)
-
-#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample)
-
-#endif /* GL_SGIS_multisample */
-
-/* ------------------------- GL_SGIS_pixel_texture ------------------------- */
-
-#ifndef GL_SGIS_pixel_texture
-#define GL_SGIS_pixel_texture 1
-
-#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture)
-
-#endif /* GL_SGIS_pixel_texture */
-
-/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */
-
-#ifndef GL_SGIS_point_line_texgen
-#define GL_SGIS_point_line_texgen 1
-
-#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0
-#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1
-#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2
-#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3
-#define GL_EYE_POINT_SGIS 0x81F4
-#define GL_OBJECT_POINT_SGIS 0x81F5
-#define GL_EYE_LINE_SGIS 0x81F6
-#define GL_OBJECT_LINE_SGIS 0x81F7
-
-#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen)
-
-#endif /* GL_SGIS_point_line_texgen */
-
-/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */
-
-#ifndef GL_SGIS_sharpen_texture
-#define GL_SGIS_sharpen_texture 1
-
-typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points);
-typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points);
-
-#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS)
-#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS)
-
-#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture)
-
-#endif /* GL_SGIS_sharpen_texture */
-
-/* --------------------------- GL_SGIS_texture4D --------------------------- */
-
-#ifndef GL_SGIS_texture4D
-#define GL_SGIS_texture4D 1
-
-typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const GLvoid *pixels);
-
-#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS)
-#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS)
-
-#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D)
-
-#endif /* GL_SGIS_texture4D */
-
-/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */
-
-#ifndef GL_SGIS_texture_border_clamp
-#define GL_SGIS_texture_border_clamp 1
-
-#define GL_CLAMP_TO_BORDER_SGIS 0x812D
-
-#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp)
-
-#endif /* GL_SGIS_texture_border_clamp */
-
-/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */
-
-#ifndef GL_SGIS_texture_edge_clamp
-#define GL_SGIS_texture_edge_clamp 1
-
-#define GL_CLAMP_TO_EDGE_SGIS 0x812F
-
-#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp)
-
-#endif /* GL_SGIS_texture_edge_clamp */
-
-/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */
-
-#ifndef GL_SGIS_texture_filter4
-#define GL_SGIS_texture_filter4 1
-
-typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights);
-typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights);
-
-#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS)
-#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS)
-
-#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4)
-
-#endif /* GL_SGIS_texture_filter4 */
-
-/* -------------------------- GL_SGIS_texture_lod -------------------------- */
-
-#ifndef GL_SGIS_texture_lod
-#define GL_SGIS_texture_lod 1
-
-#define GL_TEXTURE_MIN_LOD_SGIS 0x813A
-#define GL_TEXTURE_MAX_LOD_SGIS 0x813B
-#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C
-#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D
-
-#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod)
-
-#endif /* GL_SGIS_texture_lod */
-
-/* ------------------------- GL_SGIS_texture_select ------------------------ */
-
-#ifndef GL_SGIS_texture_select
-#define GL_SGIS_texture_select 1
-
-#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select)
-
-#endif /* GL_SGIS_texture_select */
-
-/* ----------------------------- GL_SGIX_async ----------------------------- */
-
-#ifndef GL_SGIX_async
-#define GL_SGIX_async 1
-
-#define GL_ASYNC_MARKER_SGIX 0x8329
-
-typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker);
-typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range);
-typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp);
-typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range);
-typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker);
-typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp);
-
-#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX)
-#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX)
-#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX)
-#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX)
-#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX)
-#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX)
-
-#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async)
-
-#endif /* GL_SGIX_async */
-
-/* ------------------------ GL_SGIX_async_histogram ------------------------ */
-
-#ifndef GL_SGIX_async_histogram
-#define GL_SGIX_async_histogram 1
-
-#define GL_ASYNC_HISTOGRAM_SGIX 0x832C
-#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D
-
-#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram)
-
-#endif /* GL_SGIX_async_histogram */
-
-/* -------------------------- GL_SGIX_async_pixel -------------------------- */
-
-#ifndef GL_SGIX_async_pixel
-#define GL_SGIX_async_pixel 1
-
-#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C
-#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D
-#define GL_ASYNC_READ_PIXELS_SGIX 0x835E
-#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F
-#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360
-#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361
-
-#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel)
-
-#endif /* GL_SGIX_async_pixel */
-
-/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */
-
-#ifndef GL_SGIX_blend_alpha_minmax
-#define GL_SGIX_blend_alpha_minmax 1
-
-#define GL_ALPHA_MIN_SGIX 0x8320
-#define GL_ALPHA_MAX_SGIX 0x8321
-
-#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax)
-
-#endif /* GL_SGIX_blend_alpha_minmax */
-
-/* ---------------------------- GL_SGIX_clipmap ---------------------------- */
-
-#ifndef GL_SGIX_clipmap
-#define GL_SGIX_clipmap 1
-
-#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap)
-
-#endif /* GL_SGIX_clipmap */
-
-/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */
-
-#ifndef GL_SGIX_convolution_accuracy
-#define GL_SGIX_convolution_accuracy 1
-
-#define GL_CONVOLUTION_HINT_SGIX 0x8316
-
-#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy)
-
-#endif /* GL_SGIX_convolution_accuracy */
-
-/* ------------------------- GL_SGIX_depth_texture ------------------------- */
-
-#ifndef GL_SGIX_depth_texture
-#define GL_SGIX_depth_texture 1
-
-#define GL_DEPTH_COMPONENT16_SGIX 0x81A5
-#define GL_DEPTH_COMPONENT24_SGIX 0x81A6
-#define GL_DEPTH_COMPONENT32_SGIX 0x81A7
-
-#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture)
-
-#endif /* GL_SGIX_depth_texture */
-
-/* -------------------------- GL_SGIX_flush_raster ------------------------- */
-
-#ifndef GL_SGIX_flush_raster
-#define GL_SGIX_flush_raster 1
-
-typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void);
-
-#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX)
-
-#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster)
-
-#endif /* GL_SGIX_flush_raster */
-
-/* --------------------------- GL_SGIX_fog_offset -------------------------- */
-
-#ifndef GL_SGIX_fog_offset
-#define GL_SGIX_fog_offset 1
-
-#define GL_FOG_OFFSET_SGIX 0x8198
-#define GL_FOG_OFFSET_VALUE_SGIX 0x8199
-
-#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset)
-
-#endif /* GL_SGIX_fog_offset */
-
-/* -------------------------- GL_SGIX_fog_texture -------------------------- */
-
-#ifndef GL_SGIX_fog_texture
-#define GL_SGIX_fog_texture 1
-
-#define GL_TEXTURE_FOG_SGIX 0
-#define GL_FOG_PATCHY_FACTOR_SGIX 0
-#define GL_FRAGMENT_FOG_SGIX 0
-
-typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname);
-
-#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX)
-
-#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture)
-
-#endif /* GL_SGIX_fog_texture */
-
-/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */
-
-#ifndef GL_SGIX_fragment_specular_lighting
-#define GL_SGIX_fragment_specular_lighting 1
-
-typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param);
-typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data);
-typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data);
-
-#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX)
-#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX)
-#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX)
-#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX)
-#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX)
-#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX)
-#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX)
-#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX)
-#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX)
-#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX)
-#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX)
-#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX)
-#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX)
-#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX)
-#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX)
-#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX)
-#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX)
-
-#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting)
-
-#endif /* GL_SGIX_fragment_specular_lighting */
-
-/* --------------------------- GL_SGIX_framezoom --------------------------- */
-
-#ifndef GL_SGIX_framezoom
-#define GL_SGIX_framezoom 1
-
-typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor);
-
-#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX)
-
-#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom)
-
-#endif /* GL_SGIX_framezoom */
-
-/* --------------------------- GL_SGIX_interlace --------------------------- */
-
-#ifndef GL_SGIX_interlace
-#define GL_SGIX_interlace 1
-
-#define GL_INTERLACE_SGIX 0x8094
-
-#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace)
-
-#endif /* GL_SGIX_interlace */
-
-/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */
-
-#ifndef GL_SGIX_ir_instrument1
-#define GL_SGIX_ir_instrument1 1
-
-#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1)
-
-#endif /* GL_SGIX_ir_instrument1 */
-
-/* ------------------------- GL_SGIX_list_priority ------------------------- */
-
-#ifndef GL_SGIX_list_priority
-#define GL_SGIX_list_priority 1
-
-#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority)
-
-#endif /* GL_SGIX_list_priority */
-
-/* ------------------------- GL_SGIX_pixel_texture ------------------------- */
-
-#ifndef GL_SGIX_pixel_texture
-#define GL_SGIX_pixel_texture 1
-
-typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode);
-
-#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX)
-
-#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture)
-
-#endif /* GL_SGIX_pixel_texture */
-
-/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */
-
-#ifndef GL_SGIX_pixel_texture_bits
-#define GL_SGIX_pixel_texture_bits 1
-
-#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits)
-
-#endif /* GL_SGIX_pixel_texture_bits */
-
-/* ------------------------ GL_SGIX_reference_plane ------------------------ */
-
-#ifndef GL_SGIX_reference_plane
-#define GL_SGIX_reference_plane 1
-
-typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation);
-
-#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX)
-
-#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane)
-
-#endif /* GL_SGIX_reference_plane */
-
-/* ---------------------------- GL_SGIX_resample --------------------------- */
-
-#ifndef GL_SGIX_resample
-#define GL_SGIX_resample 1
-
-#define GL_PACK_RESAMPLE_SGIX 0x842E
-#define GL_UNPACK_RESAMPLE_SGIX 0x842F
-#define GL_RESAMPLE_DECIMATE_SGIX 0x8430
-#define GL_RESAMPLE_REPLICATE_SGIX 0x8433
-#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434
-
-#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample)
-
-#endif /* GL_SGIX_resample */
-
-/* ----------------------------- GL_SGIX_shadow ---------------------------- */
-
-#ifndef GL_SGIX_shadow
-#define GL_SGIX_shadow 1
-
-#define GL_TEXTURE_COMPARE_SGIX 0x819A
-#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B
-#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C
-#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D
-
-#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow)
-
-#endif /* GL_SGIX_shadow */
-
-/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */
-
-#ifndef GL_SGIX_shadow_ambient
-#define GL_SGIX_shadow_ambient 1
-
-#define GL_SHADOW_AMBIENT_SGIX 0x80BF
-
-#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient)
-
-#endif /* GL_SGIX_shadow_ambient */
-
-/* ----------------------------- GL_SGIX_sprite ---------------------------- */
-
-#ifndef GL_SGIX_sprite
-#define GL_SGIX_sprite 1
-
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param);
-typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params);
-
-#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX)
-#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX)
-#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX)
-#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX)
-
-#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite)
-
-#endif /* GL_SGIX_sprite */
-
-/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */
-
-#ifndef GL_SGIX_tag_sample_buffer
-#define GL_SGIX_tag_sample_buffer 1
-
-typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void);
-
-#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX)
-
-#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer)
-
-#endif /* GL_SGIX_tag_sample_buffer */
-
-/* ------------------------ GL_SGIX_texture_add_env ------------------------ */
-
-#ifndef GL_SGIX_texture_add_env
-#define GL_SGIX_texture_add_env 1
-
-#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env)
-
-#endif /* GL_SGIX_texture_add_env */
-
-/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */
-
-#ifndef GL_SGIX_texture_coordinate_clamp
-#define GL_SGIX_texture_coordinate_clamp 1
-
-#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369
-#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A
-#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B
-
-#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp)
-
-#endif /* GL_SGIX_texture_coordinate_clamp */
-
-/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */
-
-#ifndef GL_SGIX_texture_lod_bias
-#define GL_SGIX_texture_lod_bias 1
-
-#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias)
-
-#endif /* GL_SGIX_texture_lod_bias */
-
-/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */
-
-#ifndef GL_SGIX_texture_multi_buffer
-#define GL_SGIX_texture_multi_buffer 1
-
-#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E
-
-#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer)
-
-#endif /* GL_SGIX_texture_multi_buffer */
-
-/* ------------------------- GL_SGIX_texture_range ------------------------- */
-
-#ifndef GL_SGIX_texture_range
-#define GL_SGIX_texture_range 1
-
-#define GL_RGB_SIGNED_SGIX 0x85E0
-#define GL_RGBA_SIGNED_SGIX 0x85E1
-#define GL_ALPHA_SIGNED_SGIX 0x85E2
-#define GL_LUMINANCE_SIGNED_SGIX 0x85E3
-#define GL_INTENSITY_SIGNED_SGIX 0x85E4
-#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5
-#define GL_RGB16_SIGNED_SGIX 0x85E6
-#define GL_RGBA16_SIGNED_SGIX 0x85E7
-#define GL_ALPHA16_SIGNED_SGIX 0x85E8
-#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9
-#define GL_INTENSITY16_SIGNED_SGIX 0x85EA
-#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB
-#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC
-#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED
-#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE
-#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF
-#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0
-#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1
-#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2
-#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3
-#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4
-#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5
-#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6
-#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7
-#define GL_MIN_LUMINANCE_SGIS 0x85F8
-#define GL_MAX_LUMINANCE_SGIS 0x85F9
-#define GL_MIN_INTENSITY_SGIS 0x85FA
-#define GL_MAX_INTENSITY_SGIS 0x85FB
-
-#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range)
-
-#endif /* GL_SGIX_texture_range */
-
-/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */
-
-#ifndef GL_SGIX_texture_scale_bias
-#define GL_SGIX_texture_scale_bias 1
-
-#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179
-#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A
-#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B
-#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C
-
-#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias)
-
-#endif /* GL_SGIX_texture_scale_bias */
-
-/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */
-
-#ifndef GL_SGIX_vertex_preclip
-#define GL_SGIX_vertex_preclip 1
-
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-
-#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip)
-
-#endif /* GL_SGIX_vertex_preclip */
-
-/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */
-
-#ifndef GL_SGIX_vertex_preclip_hint
-#define GL_SGIX_vertex_preclip_hint 1
-
-#define GL_VERTEX_PRECLIP_SGIX 0x83EE
-#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF
-
-#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint)
-
-#endif /* GL_SGIX_vertex_preclip_hint */
-
-/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */
-
-#ifndef GL_SGIX_ycrcb
-#define GL_SGIX_ycrcb 1
-
-#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb)
-
-#endif /* GL_SGIX_ycrcb */
-
-/* -------------------------- GL_SGI_color_matrix -------------------------- */
-
-#ifndef GL_SGI_color_matrix
-#define GL_SGI_color_matrix 1
-
-#define GL_COLOR_MATRIX_SGI 0x80B1
-#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2
-#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3
-#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4
-#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5
-#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6
-#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7
-#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8
-#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9
-#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA
-#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB
-
-#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix)
-
-#endif /* GL_SGI_color_matrix */
-
-/* --------------------------- GL_SGI_color_table -------------------------- */
-
-#ifndef GL_SGI_color_table
-#define GL_SGI_color_table 1
-
-#define GL_COLOR_TABLE_SGI 0x80D0
-#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1
-#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2
-#define GL_PROXY_COLOR_TABLE_SGI 0x80D3
-#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4
-#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5
-#define GL_COLOR_TABLE_SCALE_SGI 0x80D6
-#define GL_COLOR_TABLE_BIAS_SGI 0x80D7
-#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8
-#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9
-#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA
-#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB
-#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC
-#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD
-#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE
-#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF
-
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params);
-typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table);
-typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params);
-typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table);
-
-#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI)
-#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI)
-#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI)
-#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI)
-#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI)
-#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI)
-#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI)
-
-#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table)
-
-#endif /* GL_SGI_color_table */
-
-/* ----------------------- GL_SGI_texture_color_table ---------------------- */
-
-#ifndef GL_SGI_texture_color_table
-#define GL_SGI_texture_color_table 1
-
-#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC
-#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD
-
-#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table)
-
-#endif /* GL_SGI_texture_color_table */
-
-/* ------------------------- GL_SUNX_constant_data ------------------------- */
-
-#ifndef GL_SUNX_constant_data
-#define GL_SUNX_constant_data 1
-
-#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5
-#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6
-
-typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void);
-
-#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX)
-
-#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data)
-
-#endif /* GL_SUNX_constant_data */
-
-/* -------------------- GL_SUN_convolution_border_modes -------------------- */
-
-#ifndef GL_SUN_convolution_border_modes
-#define GL_SUN_convolution_border_modes 1
-
-#define GL_WRAP_BORDER_SUN 0x81D4
-
-#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes)
-
-#endif /* GL_SUN_convolution_border_modes */
-
-/* -------------------------- GL_SUN_global_alpha -------------------------- */
-
-#ifndef GL_SUN_global_alpha
-#define GL_SUN_global_alpha 1
-
-#define GL_GLOBAL_ALPHA_SUN 0x81D9
-#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA
-
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor);
-typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor);
-
-#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN)
-#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN)
-#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN)
-#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN)
-#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN)
-#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN)
-#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN)
-#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN)
-
-#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha)
-
-#endif /* GL_SUN_global_alpha */
-
-/* --------------------------- GL_SUN_mesh_array --------------------------- */
-
-#ifndef GL_SUN_mesh_array
-#define GL_SUN_mesh_array 1
-
-#define GL_QUAD_MESH_SUN 0x8614
-#define GL_TRIANGLE_MESH_SUN 0x8615
-
-#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array)
-
-#endif /* GL_SUN_mesh_array */
-
-/* ------------------------ GL_SUN_read_video_pixels ----------------------- */
-
-#ifndef GL_SUN_read_video_pixels
-#define GL_SUN_read_video_pixels 1
-
-typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
-
-#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN)
-
-#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels)
-
-#endif /* GL_SUN_read_video_pixels */
-
-/* --------------------------- GL_SUN_slice_accum -------------------------- */
-
-#ifndef GL_SUN_slice_accum
-#define GL_SUN_slice_accum 1
-
-#define GL_SLICE_ACCUM_SUN 0x85CC
-
-#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum)
-
-#endif /* GL_SUN_slice_accum */
-
-/* -------------------------- GL_SUN_triangle_list ------------------------- */
-
-#ifndef GL_SUN_triangle_list
-#define GL_SUN_triangle_list 1
-
-#define GL_RESTART_SUN 0x01
-#define GL_REPLACE_MIDDLE_SUN 0x02
-#define GL_REPLACE_OLDEST_SUN 0x03
-#define GL_TRIANGLE_LIST_SUN 0x81D7
-#define GL_REPLACEMENT_CODE_SUN 0x81D8
-#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0
-#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1
-#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2
-#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3
-#define GL_R1UI_V3F_SUN 0x85C4
-#define GL_R1UI_C4UB_V3F_SUN 0x85C5
-#define GL_R1UI_C3F_V3F_SUN 0x85C6
-#define GL_R1UI_N3F_V3F_SUN 0x85C7
-#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8
-#define GL_R1UI_T2F_V3F_SUN 0x85C9
-#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA
-#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB
-
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid *pointer);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code);
-
-#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN)
-#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN)
-#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN)
-#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN)
-#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN)
-#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN)
-#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN)
-
-#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list)
-
-#endif /* GL_SUN_triangle_list */
-
-/* ----------------------------- GL_SUN_vertex ----------------------------- */
-
-#ifndef GL_SUN_vertex
-#define GL_SUN_vertex 1
-
-typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v);
-
-#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN)
-#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN)
-#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN)
-#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN)
-#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN)
-#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN)
-#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN)
-#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN)
-#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN)
-#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN)
-#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN)
-#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN)
-#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN)
-#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN)
-#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN)
-#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN)
-#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN)
-#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN)
-#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN)
-#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN)
-#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN)
-#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN)
-#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN)
-#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN)
-#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN)
-#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN)
-#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN)
-#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN)
-#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN)
-#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN)
-#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN)
-
-#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex)
-
-#endif /* GL_SUN_vertex */
-
-/* -------------------------- GL_WIN_phong_shading ------------------------- */
-
-#ifndef GL_WIN_phong_shading
-#define GL_WIN_phong_shading 1
-
-#define GL_PHONG_WIN 0x80EA
-#define GL_PHONG_HINT_WIN 0x80EB
-
-#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading)
-
-#endif /* GL_WIN_phong_shading */
-
-/* -------------------------- GL_WIN_specular_fog -------------------------- */
-
-#ifndef GL_WIN_specular_fog
-#define GL_WIN_specular_fog 1
-
-#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC
-
-#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog)
-
-#endif /* GL_WIN_specular_fog */
-
-/* ---------------------------- GL_WIN_swap_hint --------------------------- */
-
-#ifndef GL_WIN_swap_hint
-#define GL_WIN_swap_hint 1
-
-typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
-
-#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN)
-
-#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint)
-
-#endif /* GL_WIN_swap_hint */
-
-/* ------------------------------------------------------------------------- */
-
-#if defined(GLEW_MX) && defined(_WIN32)
-#define GLEW_FUN_EXPORT
-#else
-#define GLEW_FUN_EXPORT GLEWAPI
-#endif /* GLEW_MX */
-
-#if defined(GLEW_MX)
-#define GLEW_VAR_EXPORT
-#else
-#define GLEW_VAR_EXPORT GLEWAPI
-#endif /* GLEW_MX */
-
-#if defined(GLEW_MX) && defined(_WIN32)
-struct GLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-
-GLEW_FUN_EXPORT PFNGLACCUMPROC __glewAccum;
-GLEW_FUN_EXPORT PFNGLALPHAFUNCPROC __glewAlphaFunc;
-GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTPROC __glewAreTexturesResident;
-GLEW_FUN_EXPORT PFNGLARRAYELEMENTPROC __glewArrayElement;
-GLEW_FUN_EXPORT PFNGLBEGINPROC __glewBegin;
-GLEW_FUN_EXPORT PFNGLBINDTEXTUREPROC __glewBindTexture;
-GLEW_FUN_EXPORT PFNGLBITMAPPROC __glewBitmap;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCPROC __glewBlendFunc;
-GLEW_FUN_EXPORT PFNGLCALLLISTPROC __glewCallList;
-GLEW_FUN_EXPORT PFNGLCALLLISTSPROC __glewCallLists;
-GLEW_FUN_EXPORT PFNGLCLEARPROC __glewClear;
-GLEW_FUN_EXPORT PFNGLCLEARACCUMPROC __glewClearAccum;
-GLEW_FUN_EXPORT PFNGLCLEARCOLORPROC __glewClearColor;
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHPROC __glewClearDepth;
-GLEW_FUN_EXPORT PFNGLCLEARINDEXPROC __glewClearIndex;
-GLEW_FUN_EXPORT PFNGLCLEARSTENCILPROC __glewClearStencil;
-GLEW_FUN_EXPORT PFNGLCLIPPLANEPROC __glewClipPlane;
-GLEW_FUN_EXPORT PFNGLCOLOR3BPROC __glewColor3b;
-GLEW_FUN_EXPORT PFNGLCOLOR3BVPROC __glewColor3bv;
-GLEW_FUN_EXPORT PFNGLCOLOR3DPROC __glewColor3d;
-GLEW_FUN_EXPORT PFNGLCOLOR3DVPROC __glewColor3dv;
-GLEW_FUN_EXPORT PFNGLCOLOR3FPROC __glewColor3f;
-GLEW_FUN_EXPORT PFNGLCOLOR3FVPROC __glewColor3fv;
-GLEW_FUN_EXPORT PFNGLCOLOR3IPROC __glewColor3i;
-GLEW_FUN_EXPORT PFNGLCOLOR3IVPROC __glewColor3iv;
-GLEW_FUN_EXPORT PFNGLCOLOR3SPROC __glewColor3s;
-GLEW_FUN_EXPORT PFNGLCOLOR3SVPROC __glewColor3sv;
-GLEW_FUN_EXPORT PFNGLCOLOR3UBPROC __glewColor3ub;
-GLEW_FUN_EXPORT PFNGLCOLOR3UBVPROC __glewColor3ubv;
-GLEW_FUN_EXPORT PFNGLCOLOR3UIPROC __glewColor3ui;
-GLEW_FUN_EXPORT PFNGLCOLOR3UIVPROC __glewColor3uiv;
-GLEW_FUN_EXPORT PFNGLCOLOR3USPROC __glewColor3us;
-GLEW_FUN_EXPORT PFNGLCOLOR3USVPROC __glewColor3usv;
-GLEW_FUN_EXPORT PFNGLCOLOR4BPROC __glewColor4b;
-GLEW_FUN_EXPORT PFNGLCOLOR4BVPROC __glewColor4bv;
-GLEW_FUN_EXPORT PFNGLCOLOR4DPROC __glewColor4d;
-GLEW_FUN_EXPORT PFNGLCOLOR4DVPROC __glewColor4dv;
-GLEW_FUN_EXPORT PFNGLCOLOR4FPROC __glewColor4f;
-GLEW_FUN_EXPORT PFNGLCOLOR4FVPROC __glewColor4fv;
-GLEW_FUN_EXPORT PFNGLCOLOR4IPROC __glewColor4i;
-GLEW_FUN_EXPORT PFNGLCOLOR4IVPROC __glewColor4iv;
-GLEW_FUN_EXPORT PFNGLCOLOR4SPROC __glewColor4s;
-GLEW_FUN_EXPORT PFNGLCOLOR4SVPROC __glewColor4sv;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBPROC __glewColor4ub;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVPROC __glewColor4ubv;
-GLEW_FUN_EXPORT PFNGLCOLOR4UIPROC __glewColor4ui;
-GLEW_FUN_EXPORT PFNGLCOLOR4UIVPROC __glewColor4uiv;
-GLEW_FUN_EXPORT PFNGLCOLOR4USPROC __glewColor4us;
-GLEW_FUN_EXPORT PFNGLCOLOR4USVPROC __glewColor4usv;
-GLEW_FUN_EXPORT PFNGLCOLORMASKPROC __glewColorMask;
-GLEW_FUN_EXPORT PFNGLCOLORMATERIALPROC __glewColorMaterial;
-GLEW_FUN_EXPORT PFNGLCOLORPOINTERPROC __glewColorPointer;
-GLEW_FUN_EXPORT PFNGLCOPYPIXELSPROC __glewCopyPixels;
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DPROC __glewCopyTexImage1D;
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DPROC __glewCopyTexImage2D;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DPROC __glewCopyTexSubImage1D;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DPROC __glewCopyTexSubImage2D;
-GLEW_FUN_EXPORT PFNGLCULLFACEPROC __glewCullFace;
-GLEW_FUN_EXPORT PFNGLDELETELISTSPROC __glewDeleteLists;
-GLEW_FUN_EXPORT PFNGLDELETETEXTURESPROC __glewDeleteTextures;
-GLEW_FUN_EXPORT PFNGLDEPTHFUNCPROC __glewDepthFunc;
-GLEW_FUN_EXPORT PFNGLDEPTHMASKPROC __glewDepthMask;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEPROC __glewDepthRange;
-GLEW_FUN_EXPORT PFNGLDISABLEPROC __glewDisable;
-GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEPROC __glewDisableClientState;
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSPROC __glewDrawArrays;
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERPROC __glewDrawBuffer;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSPROC __glewDrawElements;
-GLEW_FUN_EXPORT PFNGLDRAWPIXELSPROC __glewDrawPixels;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPROC __glewEdgeFlag;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERPROC __glewEdgeFlagPointer;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGVPROC __glewEdgeFlagv;
-GLEW_FUN_EXPORT PFNGLENABLEPROC __glewEnable;
-GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEPROC __glewEnableClientState;
-GLEW_FUN_EXPORT PFNGLENDPROC __glewEnd;
-GLEW_FUN_EXPORT PFNGLENDLISTPROC __glewEndList;
-GLEW_FUN_EXPORT PFNGLEVALCOORD1DPROC __glewEvalCoord1d;
-GLEW_FUN_EXPORT PFNGLEVALCOORD1DVPROC __glewEvalCoord1dv;
-GLEW_FUN_EXPORT PFNGLEVALCOORD1FPROC __glewEvalCoord1f;
-GLEW_FUN_EXPORT PFNGLEVALCOORD1FVPROC __glewEvalCoord1fv;
-GLEW_FUN_EXPORT PFNGLEVALCOORD2DPROC __glewEvalCoord2d;
-GLEW_FUN_EXPORT PFNGLEVALCOORD2DVPROC __glewEvalCoord2dv;
-GLEW_FUN_EXPORT PFNGLEVALCOORD2FPROC __glewEvalCoord2f;
-GLEW_FUN_EXPORT PFNGLEVALCOORD2FVPROC __glewEvalCoord2fv;
-GLEW_FUN_EXPORT PFNGLEVALMESH1PROC __glewEvalMesh1;
-GLEW_FUN_EXPORT PFNGLEVALMESH2PROC __glewEvalMesh2;
-GLEW_FUN_EXPORT PFNGLEVALPOINT1PROC __glewEvalPoint1;
-GLEW_FUN_EXPORT PFNGLEVALPOINT2PROC __glewEvalPoint2;
-GLEW_FUN_EXPORT PFNGLFEEDBACKBUFFERPROC __glewFeedbackBuffer;
-GLEW_FUN_EXPORT PFNGLFINISHPROC __glewFinish;
-GLEW_FUN_EXPORT PFNGLFLUSHPROC __glewFlush;
-GLEW_FUN_EXPORT PFNGLFOGFPROC __glewFogf;
-GLEW_FUN_EXPORT PFNGLFOGFVPROC __glewFogfv;
-GLEW_FUN_EXPORT PFNGLFOGIPROC __glewFogi;
-GLEW_FUN_EXPORT PFNGLFOGIVPROC __glewFogiv;
-GLEW_FUN_EXPORT PFNGLFRONTFACEPROC __glewFrontFace;
-GLEW_FUN_EXPORT PFNGLFRUSTUMPROC __glewFrustum;
-GLEW_FUN_EXPORT PFNGLGENLISTSPROC __glewGenLists;
-GLEW_FUN_EXPORT PFNGLGENTEXTURESPROC __glewGenTextures;
-GLEW_FUN_EXPORT PFNGLGETBOOLEANVPROC __glewGetBooleanv;
-GLEW_FUN_EXPORT PFNGLGETCLIPPLANEPROC __glewGetClipPlane;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEVPROC __glewGetDoublev;
-GLEW_FUN_EXPORT PFNGLGETERRORPROC __glewGetError;
-GLEW_FUN_EXPORT PFNGLGETFLOATVPROC __glewGetFloatv;
-GLEW_FUN_EXPORT PFNGLGETINTEGERVPROC __glewGetIntegerv;
-GLEW_FUN_EXPORT PFNGLGETLIGHTFVPROC __glewGetLightfv;
-GLEW_FUN_EXPORT PFNGLGETLIGHTIVPROC __glewGetLightiv;
-GLEW_FUN_EXPORT PFNGLGETMAPDVPROC __glewGetMapdv;
-GLEW_FUN_EXPORT PFNGLGETMAPFVPROC __glewGetMapfv;
-GLEW_FUN_EXPORT PFNGLGETMAPIVPROC __glewGetMapiv;
-GLEW_FUN_EXPORT PFNGLGETMATERIALFVPROC __glewGetMaterialfv;
-GLEW_FUN_EXPORT PFNGLGETMATERIALIVPROC __glewGetMaterialiv;
-GLEW_FUN_EXPORT PFNGLGETPIXELMAPFVPROC __glewGetPixelMapfv;
-GLEW_FUN_EXPORT PFNGLGETPIXELMAPUIVPROC __glewGetPixelMapuiv;
-GLEW_FUN_EXPORT PFNGLGETPIXELMAPUSVPROC __glewGetPixelMapusv;
-GLEW_FUN_EXPORT PFNGLGETPOINTERVPROC __glewGetPointerv;
-GLEW_FUN_EXPORT PFNGLGETPOLYGONSTIPPLEPROC __glewGetPolygonStipple;
-GLEW_FUN_EXPORT PFNGLGETSTRINGPROC __glewGetString;
-GLEW_FUN_EXPORT PFNGLGETTEXENVFVPROC __glewGetTexEnvfv;
-GLEW_FUN_EXPORT PFNGLGETTEXENVIVPROC __glewGetTexEnviv;
-GLEW_FUN_EXPORT PFNGLGETTEXGENDVPROC __glewGetTexGendv;
-GLEW_FUN_EXPORT PFNGLGETTEXGENFVPROC __glewGetTexGenfv;
-GLEW_FUN_EXPORT PFNGLGETTEXGENIVPROC __glewGetTexGeniv;
-GLEW_FUN_EXPORT PFNGLGETTEXIMAGEPROC __glewGetTexImage;
-GLEW_FUN_EXPORT PFNGLGETTEXLEVELPARAMETERFVPROC __glewGetTexLevelParameterfv;
-GLEW_FUN_EXPORT PFNGLGETTEXLEVELPARAMETERIVPROC __glewGetTexLevelParameteriv;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERFVPROC __glewGetTexParameterfv;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIVPROC __glewGetTexParameteriv;
-GLEW_FUN_EXPORT PFNGLHINTPROC __glewHint;
-GLEW_FUN_EXPORT PFNGLINDEXMASKPROC __glewIndexMask;
-GLEW_FUN_EXPORT PFNGLINDEXPOINTERPROC __glewIndexPointer;
-GLEW_FUN_EXPORT PFNGLINDEXDPROC __glewIndexd;
-GLEW_FUN_EXPORT PFNGLINDEXDVPROC __glewIndexdv;
-GLEW_FUN_EXPORT PFNGLINDEXFPROC __glewIndexf;
-GLEW_FUN_EXPORT PFNGLINDEXFVPROC __glewIndexfv;
-GLEW_FUN_EXPORT PFNGLINDEXIPROC __glewIndexi;
-GLEW_FUN_EXPORT PFNGLINDEXIVPROC __glewIndexiv;
-GLEW_FUN_EXPORT PFNGLINDEXSPROC __glewIndexs;
-GLEW_FUN_EXPORT PFNGLINDEXSVPROC __glewIndexsv;
-GLEW_FUN_EXPORT PFNGLINDEXUBPROC __glewIndexub;
-GLEW_FUN_EXPORT PFNGLINDEXUBVPROC __glewIndexubv;
-GLEW_FUN_EXPORT PFNGLINITNAMESPROC __glewInitNames;
-GLEW_FUN_EXPORT PFNGLINTERLEAVEDARRAYSPROC __glewInterleavedArrays;
-GLEW_FUN_EXPORT PFNGLISENABLEDPROC __glewIsEnabled;
-GLEW_FUN_EXPORT PFNGLISLISTPROC __glewIsList;
-GLEW_FUN_EXPORT PFNGLISTEXTUREPROC __glewIsTexture;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELFPROC __glewLightModelf;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELFVPROC __glewLightModelfv;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELIPROC __glewLightModeli;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELIVPROC __glewLightModeliv;
-GLEW_FUN_EXPORT PFNGLLIGHTFPROC __glewLightf;
-GLEW_FUN_EXPORT PFNGLLIGHTFVPROC __glewLightfv;
-GLEW_FUN_EXPORT PFNGLLIGHTIPROC __glewLighti;
-GLEW_FUN_EXPORT PFNGLLIGHTIVPROC __glewLightiv;
-GLEW_FUN_EXPORT PFNGLLINESTIPPLEPROC __glewLineStipple;
-GLEW_FUN_EXPORT PFNGLLINEWIDTHPROC __glewLineWidth;
-GLEW_FUN_EXPORT PFNGLLISTBASEPROC __glewListBase;
-GLEW_FUN_EXPORT PFNGLLOADIDENTITYPROC __glewLoadIdentity;
-GLEW_FUN_EXPORT PFNGLLOADMATRIXDPROC __glewLoadMatrixd;
-GLEW_FUN_EXPORT PFNGLLOADMATRIXFPROC __glewLoadMatrixf;
-GLEW_FUN_EXPORT PFNGLLOADNAMEPROC __glewLoadName;
-GLEW_FUN_EXPORT PFNGLLOGICOPPROC __glewLogicOp;
-GLEW_FUN_EXPORT PFNGLMAP1DPROC __glewMap1d;
-GLEW_FUN_EXPORT PFNGLMAP1FPROC __glewMap1f;
-GLEW_FUN_EXPORT PFNGLMAP2DPROC __glewMap2d;
-GLEW_FUN_EXPORT PFNGLMAP2FPROC __glewMap2f;
-GLEW_FUN_EXPORT PFNGLMAPGRID1DPROC __glewMapGrid1d;
-GLEW_FUN_EXPORT PFNGLMAPGRID1FPROC __glewMapGrid1f;
-GLEW_FUN_EXPORT PFNGLMAPGRID2DPROC __glewMapGrid2d;
-GLEW_FUN_EXPORT PFNGLMAPGRID2FPROC __glewMapGrid2f;
-GLEW_FUN_EXPORT PFNGLMATERIALFPROC __glewMaterialf;
-GLEW_FUN_EXPORT PFNGLMATERIALFVPROC __glewMaterialfv;
-GLEW_FUN_EXPORT PFNGLMATERIALIPROC __glewMateriali;
-GLEW_FUN_EXPORT PFNGLMATERIALIVPROC __glewMaterialiv;
-GLEW_FUN_EXPORT PFNGLMATRIXMODEPROC __glewMatrixMode;
-GLEW_FUN_EXPORT PFNGLMULTMATRIXDPROC __glewMultMatrixd;
-GLEW_FUN_EXPORT PFNGLMULTMATRIXFPROC __glewMultMatrixf;
-GLEW_FUN_EXPORT PFNGLNEWLISTPROC __glewNewList;
-GLEW_FUN_EXPORT PFNGLNORMAL3BPROC __glewNormal3b;
-GLEW_FUN_EXPORT PFNGLNORMAL3BVPROC __glewNormal3bv;
-GLEW_FUN_EXPORT PFNGLNORMAL3DPROC __glewNormal3d;
-GLEW_FUN_EXPORT PFNGLNORMAL3DVPROC __glewNormal3dv;
-GLEW_FUN_EXPORT PFNGLNORMAL3FPROC __glewNormal3f;
-GLEW_FUN_EXPORT PFNGLNORMAL3FVPROC __glewNormal3fv;
-GLEW_FUN_EXPORT PFNGLNORMAL3IPROC __glewNormal3i;
-GLEW_FUN_EXPORT PFNGLNORMAL3IVPROC __glewNormal3iv;
-GLEW_FUN_EXPORT PFNGLNORMAL3SPROC __glewNormal3s;
-GLEW_FUN_EXPORT PFNGLNORMAL3SVPROC __glewNormal3sv;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTERPROC __glewNormalPointer;
-GLEW_FUN_EXPORT PFNGLORTHOPROC __glewOrtho;
-GLEW_FUN_EXPORT PFNGLPASSTHROUGHPROC __glewPassThrough;
-GLEW_FUN_EXPORT PFNGLPIXELMAPFVPROC __glewPixelMapfv;
-GLEW_FUN_EXPORT PFNGLPIXELMAPUIVPROC __glewPixelMapuiv;
-GLEW_FUN_EXPORT PFNGLPIXELMAPUSVPROC __glewPixelMapusv;
-GLEW_FUN_EXPORT PFNGLPIXELSTOREFPROC __glewPixelStoref;
-GLEW_FUN_EXPORT PFNGLPIXELSTOREIPROC __glewPixelStorei;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFERFPROC __glewPixelTransferf;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFERIPROC __glewPixelTransferi;
-GLEW_FUN_EXPORT PFNGLPIXELZOOMPROC __glewPixelZoom;
-GLEW_FUN_EXPORT PFNGLPOINTSIZEPROC __glewPointSize;
-GLEW_FUN_EXPORT PFNGLPOLYGONMODEPROC __glewPolygonMode;
-GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETPROC __glewPolygonOffset;
-GLEW_FUN_EXPORT PFNGLPOLYGONSTIPPLEPROC __glewPolygonStipple;
-GLEW_FUN_EXPORT PFNGLPOPATTRIBPROC __glewPopAttrib;
-GLEW_FUN_EXPORT PFNGLPOPCLIENTATTRIBPROC __glewPopClientAttrib;
-GLEW_FUN_EXPORT PFNGLPOPMATRIXPROC __glewPopMatrix;
-GLEW_FUN_EXPORT PFNGLPOPNAMEPROC __glewPopName;
-GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESPROC __glewPrioritizeTextures;
-GLEW_FUN_EXPORT PFNGLPUSHATTRIBPROC __glewPushAttrib;
-GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBPROC __glewPushClientAttrib;
-GLEW_FUN_EXPORT PFNGLPUSHMATRIXPROC __glewPushMatrix;
-GLEW_FUN_EXPORT PFNGLPUSHNAMEPROC __glewPushName;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2DPROC __glewRasterPos2d;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2DVPROC __glewRasterPos2dv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2FPROC __glewRasterPos2f;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2FVPROC __glewRasterPos2fv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2IPROC __glewRasterPos2i;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2IVPROC __glewRasterPos2iv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2SPROC __glewRasterPos2s;
-GLEW_FUN_EXPORT PFNGLRASTERPOS2SVPROC __glewRasterPos2sv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3DPROC __glewRasterPos3d;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3DVPROC __glewRasterPos3dv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3FPROC __glewRasterPos3f;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3FVPROC __glewRasterPos3fv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3IPROC __glewRasterPos3i;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3IVPROC __glewRasterPos3iv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3SPROC __glewRasterPos3s;
-GLEW_FUN_EXPORT PFNGLRASTERPOS3SVPROC __glewRasterPos3sv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4DPROC __glewRasterPos4d;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4DVPROC __glewRasterPos4dv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4FPROC __glewRasterPos4f;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4FVPROC __glewRasterPos4fv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4IPROC __glewRasterPos4i;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4IVPROC __glewRasterPos4iv;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4SPROC __glewRasterPos4s;
-GLEW_FUN_EXPORT PFNGLRASTERPOS4SVPROC __glewRasterPos4sv;
-GLEW_FUN_EXPORT PFNGLREADBUFFERPROC __glewReadBuffer;
-GLEW_FUN_EXPORT PFNGLREADPIXELSPROC __glewReadPixels;
-GLEW_FUN_EXPORT PFNGLRECTDPROC __glewRectd;
-GLEW_FUN_EXPORT PFNGLRECTDVPROC __glewRectdv;
-GLEW_FUN_EXPORT PFNGLRECTFPROC __glewRectf;
-GLEW_FUN_EXPORT PFNGLRECTFVPROC __glewRectfv;
-GLEW_FUN_EXPORT PFNGLRECTIPROC __glewRecti;
-GLEW_FUN_EXPORT PFNGLRECTIVPROC __glewRectiv;
-GLEW_FUN_EXPORT PFNGLRECTSPROC __glewRects;
-GLEW_FUN_EXPORT PFNGLRECTSVPROC __glewRectsv;
-GLEW_FUN_EXPORT PFNGLRENDERMODEPROC __glewRenderMode;
-GLEW_FUN_EXPORT PFNGLROTATEDPROC __glewRotated;
-GLEW_FUN_EXPORT PFNGLROTATEFPROC __glewRotatef;
-GLEW_FUN_EXPORT PFNGLSCALEDPROC __glewScaled;
-GLEW_FUN_EXPORT PFNGLSCALEFPROC __glewScalef;
-GLEW_FUN_EXPORT PFNGLSCISSORPROC __glewScissor;
-GLEW_FUN_EXPORT PFNGLSELECTBUFFERPROC __glewSelectBuffer;
-GLEW_FUN_EXPORT PFNGLSHADEMODELPROC __glewShadeModel;
-GLEW_FUN_EXPORT PFNGLSTENCILFUNCPROC __glewStencilFunc;
-GLEW_FUN_EXPORT PFNGLSTENCILMASKPROC __glewStencilMask;
-GLEW_FUN_EXPORT PFNGLSTENCILOPPROC __glewStencilOp;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1DPROC __glewTexCoord1d;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1DVPROC __glewTexCoord1dv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1FPROC __glewTexCoord1f;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1FVPROC __glewTexCoord1fv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1IPROC __glewTexCoord1i;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1IVPROC __glewTexCoord1iv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1SPROC __glewTexCoord1s;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1SVPROC __glewTexCoord1sv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2DPROC __glewTexCoord2d;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2DVPROC __glewTexCoord2dv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FPROC __glewTexCoord2f;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FVPROC __glewTexCoord2fv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2IPROC __glewTexCoord2i;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2IVPROC __glewTexCoord2iv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2SPROC __glewTexCoord2s;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2SVPROC __glewTexCoord2sv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3DPROC __glewTexCoord3d;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3DVPROC __glewTexCoord3dv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3FPROC __glewTexCoord3f;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3FVPROC __glewTexCoord3fv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3IPROC __glewTexCoord3i;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3IVPROC __glewTexCoord3iv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3SPROC __glewTexCoord3s;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3SVPROC __glewTexCoord3sv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4DPROC __glewTexCoord4d;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4DVPROC __glewTexCoord4dv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FPROC __glewTexCoord4f;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FVPROC __glewTexCoord4fv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4IPROC __glewTexCoord4i;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4IVPROC __glewTexCoord4iv;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4SPROC __glewTexCoord4s;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4SVPROC __glewTexCoord4sv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERPROC __glewTexCoordPointer;
-GLEW_FUN_EXPORT PFNGLTEXENVFPROC __glewTexEnvf;
-GLEW_FUN_EXPORT PFNGLTEXENVFVPROC __glewTexEnvfv;
-GLEW_FUN_EXPORT PFNGLTEXENVIPROC __glewTexEnvi;
-GLEW_FUN_EXPORT PFNGLTEXENVIVPROC __glewTexEnviv;
-GLEW_FUN_EXPORT PFNGLTEXGENDPROC __glewTexGend;
-GLEW_FUN_EXPORT PFNGLTEXGENDVPROC __glewTexGendv;
-GLEW_FUN_EXPORT PFNGLTEXGENFPROC __glewTexGenf;
-GLEW_FUN_EXPORT PFNGLTEXGENFVPROC __glewTexGenfv;
-GLEW_FUN_EXPORT PFNGLTEXGENIPROC __glewTexGeni;
-GLEW_FUN_EXPORT PFNGLTEXGENIVPROC __glewTexGeniv;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE1DPROC __glewTexImage1D;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE2DPROC __glewTexImage2D;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERFPROC __glewTexParameterf;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERFVPROC __glewTexParameterfv;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIPROC __glewTexParameteri;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIVPROC __glewTexParameteriv;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DPROC __glewTexSubImage1D;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DPROC __glewTexSubImage2D;
-GLEW_FUN_EXPORT PFNGLTRANSLATEDPROC __glewTranslated;
-GLEW_FUN_EXPORT PFNGLTRANSLATEFPROC __glewTranslatef;
-GLEW_FUN_EXPORT PFNGLVERTEX2DPROC __glewVertex2d;
-GLEW_FUN_EXPORT PFNGLVERTEX2DVPROC __glewVertex2dv;
-GLEW_FUN_EXPORT PFNGLVERTEX2FPROC __glewVertex2f;
-GLEW_FUN_EXPORT PFNGLVERTEX2FVPROC __glewVertex2fv;
-GLEW_FUN_EXPORT PFNGLVERTEX2IPROC __glewVertex2i;
-GLEW_FUN_EXPORT PFNGLVERTEX2IVPROC __glewVertex2iv;
-GLEW_FUN_EXPORT PFNGLVERTEX2SPROC __glewVertex2s;
-GLEW_FUN_EXPORT PFNGLVERTEX2SVPROC __glewVertex2sv;
-GLEW_FUN_EXPORT PFNGLVERTEX3DPROC __glewVertex3d;
-GLEW_FUN_EXPORT PFNGLVERTEX3DVPROC __glewVertex3dv;
-GLEW_FUN_EXPORT PFNGLVERTEX3FPROC __glewVertex3f;
-GLEW_FUN_EXPORT PFNGLVERTEX3FVPROC __glewVertex3fv;
-GLEW_FUN_EXPORT PFNGLVERTEX3IPROC __glewVertex3i;
-GLEW_FUN_EXPORT PFNGLVERTEX3IVPROC __glewVertex3iv;
-GLEW_FUN_EXPORT PFNGLVERTEX3SPROC __glewVertex3s;
-GLEW_FUN_EXPORT PFNGLVERTEX3SVPROC __glewVertex3sv;
-GLEW_FUN_EXPORT PFNGLVERTEX4DPROC __glewVertex4d;
-GLEW_FUN_EXPORT PFNGLVERTEX4DVPROC __glewVertex4dv;
-GLEW_FUN_EXPORT PFNGLVERTEX4FPROC __glewVertex4f;
-GLEW_FUN_EXPORT PFNGLVERTEX4FVPROC __glewVertex4fv;
-GLEW_FUN_EXPORT PFNGLVERTEX4IPROC __glewVertex4i;
-GLEW_FUN_EXPORT PFNGLVERTEX4IVPROC __glewVertex4iv;
-GLEW_FUN_EXPORT PFNGLVERTEX4SPROC __glewVertex4s;
-GLEW_FUN_EXPORT PFNGLVERTEX4SVPROC __glewVertex4sv;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTERPROC __glewVertexPointer;
-GLEW_FUN_EXPORT PFNGLVIEWPORTPROC __glewViewport;
-#endif //#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D;
-
-GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture;
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv;
-GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage;
-
-GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate;
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer;
-GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData;
-GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers;
-GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries;
-GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery;
-GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers;
-GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv;
-GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv;
-GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv;
-GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer;
-GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer;
-GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer;
-
-GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader;
-GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate;
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader;
-GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram;
-GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader;
-GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray;
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray;
-GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform;
-GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders;
-GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv;
-GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog;
-GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource;
-GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv;
-GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram;
-GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader;
-GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram;
-GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource;
-GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate;
-GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate;
-GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer;
-
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv;
-
-GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender;
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback;
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation;
-GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv;
-GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski;
-GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei;
-GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei;
-GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback;
-GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation;
-GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv;
-GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced;
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex;
-GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v;
-GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v;
-
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci;
-GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading;
-
-GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX;
-
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD;
-GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD;
-
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD;
-
-GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD;
-GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD;
-GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD;
-
-GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD;
-GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD;
-GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD;
-GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD;
-GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD;
-GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD;
-
-GLEW_FUN_EXPORT PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD;
-
-GLEW_FUN_EXPORT PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD;
-
-GLEW_FUN_EXPORT PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD;
-
-GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD;
-GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD;
-
-GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE;
-
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE;
-GLEW_FUN_EXPORT PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE;
-GLEW_FUN_EXPORT PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE;
-GLEW_FUN_EXPORT PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE;
-GLEW_FUN_EXPORT PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE;
-GLEW_FUN_EXPORT PFNGLISQUERYANGLEPROC __glewIsQueryANGLE;
-GLEW_FUN_EXPORT PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE;
-
-GLEW_FUN_EXPORT PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE;
-
-GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE;
-GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE;
-GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE;
-GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE;
-GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE;
-
-GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE;
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE;
-GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE;
-GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE;
-
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE;
-GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE;
-GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE;
-GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE;
-
-GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE;
-
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE;
-GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE;
-GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef;
-GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat;
-GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler;
-GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance;
-
-GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB;
-GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB;
-GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB;
-GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB;
-GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB;
-GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB;
-GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB;
-GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex;
-
-GLEW_FUN_EXPORT PFNGLBUFFERSTORAGEPROC __glewBufferStorage;
-GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT;
-
-GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB;
-
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERDATAPROC __glewClearBufferData;
-GLEW_FUN_EXPORT PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData;
-GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT;
-GLEW_FUN_EXPORT PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT;
-
-GLEW_FUN_EXPORT PFNGLCLEARTEXIMAGEPROC __glewClearTexImage;
-GLEW_FUN_EXPORT PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage;
-
-GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB;
-
-GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute;
-GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect;
-
-GLEW_FUN_EXPORT PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB;
-
-GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData;
-
-GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData;
-
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB;
-GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB;
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB;
-GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv;
-GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer;
-GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer;
-GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer;
-GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus;
-GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers;
-GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer;
-GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers;
-GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers;
-GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv;
-GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv;
-GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer;
-GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB;
-
-GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary;
-GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv;
-GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d;
-GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d;
-GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d;
-GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d;
-GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv;
-
-GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv;
-GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter;
-GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram;
-GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax;
-GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram;
-GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax;
-GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB;
-
-GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ;
-
-GLEW_FUN_EXPORT PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v;
-
-GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData;
-GLEW_FUN_EXPORT PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData;
-GLEW_FUN_EXPORT PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer;
-GLEW_FUN_EXPORT PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer;
-GLEW_FUN_EXPORT PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage;
-GLEW_FUN_EXPORT PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage;
-
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange;
-
-GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB;
-GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB;
-
-GLEW_FUN_EXPORT PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange;
-GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures;
-GLEW_FUN_EXPORT PFNGLBINDSAMPLERSPROC __glewBindSamplers;
-GLEW_FUN_EXPORT PFNGLBINDTEXTURESPROC __glewBindTextures;
-GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect;
-
-GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB;
-
-GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB;
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB;
-GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB;
-GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB;
-GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB;
-GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB;
-GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB;
-
-GLEW_FUN_EXPORT PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv;
-
-GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex;
-
-GLEW_FUN_EXPORT PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB;
-GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB;
-GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB;
-GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB;
-GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB;
-GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB;
-GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB;
-GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB;
-GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB;
-GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB;
-GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB;
-GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB;
-GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB;
-
-GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB;
-
-GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler;
-GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers;
-GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv;
-GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv;
-GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri;
-GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv;
-
-GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram;
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv;
-GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline;
-
-GLEW_FUN_EXPORT PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv;
-
-GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture;
-GLEW_FUN_EXPORT PFNGLMEMORYBARRIERPROC __glewMemoryBarrier;
-
-GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB;
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB;
-GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB;
-GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB;
-GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB;
-GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB;
-GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB;
-GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB;
-GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB;
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB;
-GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB;
-GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB;
-GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB;
-GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB;
-GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB;
-GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB;
-GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB;
-
-GLEW_FUN_EXPORT PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding;
-
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName;
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName;
-GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv;
-GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex;
-GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv;
-GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv;
-
-GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB;
-GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB;
-GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB;
-GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB;
-GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB;
-GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB;
-
-GLEW_FUN_EXPORT PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB;
-GLEW_FUN_EXPORT PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT;
-
-GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync;
-GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync;
-GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync;
-GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v;
-GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv;
-GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync;
-GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync;
-
-GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv;
-GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri;
-
-GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB;
-
-GLEW_FUN_EXPORT PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange;
-GLEW_FUN_EXPORT PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT;
-
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB;
-
-GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv;
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample;
-
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE1DPROC __glewTexStorage1D;
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DPROC __glewTexStorage2D;
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DPROC __glewTexStorage3D;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample;
-GLEW_FUN_EXPORT PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXTUREVIEWPROC __glewTextureView;
-
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v;
-GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter;
-
-GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback;
-GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback;
-GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks;
-GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback;
-GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback;
-GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback;
-
-GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream;
-GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed;
-GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv;
-
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced;
-
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB;
-GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB;
-GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB;
-
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName;
-GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv;
-GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices;
-GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding;
-
-GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays;
-GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays;
-GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer;
-
-GLEW_FUN_EXPORT PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat;
-GLEW_FUN_EXPORT PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor;
-
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB;
-GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB;
-
-GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB;
-GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB;
-GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB;
-GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB;
-GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB;
-GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB;
-GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB;
-GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB;
-
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB;
-GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB;
-GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB;
-
-GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB;
-GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB;
-GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB;
-
-GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui;
-GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv;
-GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui;
-GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv;
-GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui;
-GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui;
-GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv;
-GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui;
-GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv;
-
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v;
-GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v;
-GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv;
-GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed;
-GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv;
-GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv;
-GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf;
-GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv;
-
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB;
-
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI;
-
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI;
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI;
-GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI;
-
-GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI;
-GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI;
-GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI;
-GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI;
-
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI;
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI;
-GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI;
-GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI;
-GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI;
-GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI;
-GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI;
-GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI;
-GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI;
-GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI;
-
-GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI;
-
-GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI;
-GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI;
-
-GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI;
-GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI;
-
-GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI;
-GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI;
-GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI;
-GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI;
-GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI;
-
-GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI;
-GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI;
-GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI;
-GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT;
-
-GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT;
-
-GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT;
-GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT;
-
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT;
-GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT;
-GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT;
-
-GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT;
-GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT;
-GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT;
-
-GLEW_FUN_EXPORT PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT;
-GLEW_FUN_EXPORT PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT;
-GLEW_FUN_EXPORT PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT;
-
-GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT;
-GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT;
-GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT;
-GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT;
-GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT;
-GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT;
-GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT;
-GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT;
-GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT;
-GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT;
-GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT;
-GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT;
-GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT;
-GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT;
-GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT;
-GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT;
-GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT;
-GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT;
-GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT;
-GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT;
-
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT;
-GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT;
-
-GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT;
-
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT;
-GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT;
-
-GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT;
-
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT;
-GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT;
-GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT;
-GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT;
-GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT;
-GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT;
-GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT;
-GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT;
-GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT;
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT;
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT;
-GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT;
-GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT;
-GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT;
-GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT;
-GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT;
-
-GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT;
-
-GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT;
-
-GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT;
-GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT;
-GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT;
-
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT;
-GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT;
-
-GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT;
-
-GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT;
-GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT;
-
-GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT;
-
-GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT;
-GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT;
-
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT;
-GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT;
-GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT;
-
-GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT;
-GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT;
-
-GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT;
-
-GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT;
-GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT;
-
-GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT;
-GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT;
-GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT;
-GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT;
-GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT;
-
-GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT;
-
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT;
-GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT;
-
-GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT;
-GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT;
-GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT;
-GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT;
-
-GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT;
-GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT;
-GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT;
-GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT;
-GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT;
-GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT;
-GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT;
-GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT;
-GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT;
-GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT;
-GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT;
-GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT;
-GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT;
-GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT;
-GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT;
-GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT;
-
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT;
-
-GLEW_FUN_EXPORT PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT;
-
-GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY;
-
-GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY;
-
-GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP;
-GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP;
-GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP;
-
-GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM;
-GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM;
-
-GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM;
-GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM;
-GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM;
-
-GLEW_FUN_EXPORT PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL;
-GLEW_FUN_EXPORT PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL;
-GLEW_FUN_EXPORT PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL;
-
-GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL;
-GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL;
-GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL;
-GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL;
-
-GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL;
-GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL;
-
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl;
-GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert;
-GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog;
-GLEW_FUN_EXPORT PFNGLGETOBJECTLABELPROC __glewGetObjectLabel;
-GLEW_FUN_EXPORT PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel;
-GLEW_FUN_EXPORT PFNGLOBJECTLABELPROC __glewObjectLabel;
-GLEW_FUN_EXPORT PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel;
-GLEW_FUN_EXPORT PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup;
-GLEW_FUN_EXPORT PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup;
-
-GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled;
-GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion;
-GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion;
-GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion;
-GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion;
-
-GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA;
-
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA;
-GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA;
-
-GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX;
-GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX;
-
-GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV;
-GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV;
-
-GLEW_FUN_EXPORT PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV;
-GLEW_FUN_EXPORT PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV;
-GLEW_FUN_EXPORT PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV;
-GLEW_FUN_EXPORT PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV;
-GLEW_FUN_EXPORT PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV;
-
-GLEW_FUN_EXPORT PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV;
-GLEW_FUN_EXPORT PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV;
-
-GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV;
-GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV;
-
-GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV;
-GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV;
-
-GLEW_FUN_EXPORT PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV;
-
-GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV;
-GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV;
-GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV;
-GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV;
-GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV;
-GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV;
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV;
-GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV;
-
-GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV;
-GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV;
-GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV;
-GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV;
-GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV;
-GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV;
-GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV;
-
-GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV;
-
-GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV;
-
-GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV;
-GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV;
-
-GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV;
-GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV;
-GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV;
-GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV;
-GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV;
-GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV;
-GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV;
-GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV;
-
-GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV;
-GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV;
-GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV;
-GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV;
-GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV;
-GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV;
-GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV;
-
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV;
-
-GLEW_FUN_EXPORT PFNGLCOPYPATHNVPROC __glewCopyPathNV;
-GLEW_FUN_EXPORT PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV;
-GLEW_FUN_EXPORT PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV;
-GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV;
-GLEW_FUN_EXPORT PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV;
-GLEW_FUN_EXPORT PFNGLDELETEPATHSNVPROC __glewDeletePathsNV;
-GLEW_FUN_EXPORT PFNGLGENPATHSNVPROC __glewGenPathsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV;
-GLEW_FUN_EXPORT PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV;
-GLEW_FUN_EXPORT PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV;
-GLEW_FUN_EXPORT PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV;
-GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV;
-GLEW_FUN_EXPORT PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV;
-GLEW_FUN_EXPORT PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV;
-GLEW_FUN_EXPORT PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV;
-GLEW_FUN_EXPORT PFNGLISPATHNVPROC __glewIsPathNV;
-GLEW_FUN_EXPORT PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV;
-GLEW_FUN_EXPORT PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV;
-GLEW_FUN_EXPORT PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV;
-GLEW_FUN_EXPORT PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV;
-GLEW_FUN_EXPORT PFNGLPATHCOORDSNVPROC __glewPathCoordsNV;
-GLEW_FUN_EXPORT PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV;
-GLEW_FUN_EXPORT PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV;
-GLEW_FUN_EXPORT PFNGLPATHFOGGENNVPROC __glewPathFogGenNV;
-GLEW_FUN_EXPORT PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV;
-GLEW_FUN_EXPORT PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV;
-GLEW_FUN_EXPORT PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV;
-GLEW_FUN_EXPORT PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV;
-GLEW_FUN_EXPORT PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV;
-GLEW_FUN_EXPORT PFNGLPATHSTRINGNVPROC __glewPathStringNV;
-GLEW_FUN_EXPORT PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV;
-GLEW_FUN_EXPORT PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV;
-GLEW_FUN_EXPORT PFNGLPATHTEXGENNVPROC __glewPathTexGenNV;
-GLEW_FUN_EXPORT PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV;
-GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV;
-GLEW_FUN_EXPORT PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV;
-GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV;
-GLEW_FUN_EXPORT PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV;
-GLEW_FUN_EXPORT PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV;
-
-GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV;
-GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV;
-
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV;
-GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV;
-GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV;
-
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV;
-GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV;
-
-GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV;
-GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV;
-GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV;
-GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV;
-GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV;
-
-GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV;
-GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV;
-GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV;
-GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV;
-GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV;
-GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV;
-GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV;
-GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV;
-
-GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV;
-GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV;
-
-GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV;
-GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV;
-GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV;
-GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV;
-GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV;
-GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV;
-GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV;
-
-GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV;
-GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV;
-GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV;
-GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV;
-
-GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV;
-GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV;
-GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV;
-GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV;
-GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV;
-GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV;
-GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV;
-GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV;
-
-GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV;
-GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV;
-
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV;
-
-GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV;
-GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV;
-GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV;
-GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV;
-GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV;
-GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV;
-GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV;
-GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV;
-GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV;
-GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV;
-
-GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV;
-GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV;
-GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV;
-GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV;
-GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV;
-GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV;
-GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV;
-GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV;
-GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV;
-GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV;
-GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV;
-GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV;
-GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV;
-GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV;
-
-GLEW_FUN_EXPORT PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV;
-GLEW_FUN_EXPORT PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV;
-GLEW_FUN_EXPORT PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV;
-GLEW_FUN_EXPORT PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV;
-GLEW_FUN_EXPORT PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV;
-
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES;
-GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES;
-GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES;
-GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES;
-GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES;
-
-GLEW_FUN_EXPORT PFNGLALPHAFUNCXPROC __glewAlphaFuncx;
-GLEW_FUN_EXPORT PFNGLCLEARCOLORXPROC __glewClearColorx;
-GLEW_FUN_EXPORT PFNGLCLEARDEPTHXPROC __glewClearDepthx;
-GLEW_FUN_EXPORT PFNGLCOLOR4XPROC __glewColor4x;
-GLEW_FUN_EXPORT PFNGLDEPTHRANGEXPROC __glewDepthRangex;
-GLEW_FUN_EXPORT PFNGLFOGXPROC __glewFogx;
-GLEW_FUN_EXPORT PFNGLFOGXVPROC __glewFogxv;
-GLEW_FUN_EXPORT PFNGLFRUSTUMFPROC __glewFrustumf;
-GLEW_FUN_EXPORT PFNGLFRUSTUMXPROC __glewFrustumx;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELXPROC __glewLightModelx;
-GLEW_FUN_EXPORT PFNGLLIGHTMODELXVPROC __glewLightModelxv;
-GLEW_FUN_EXPORT PFNGLLIGHTXPROC __glewLightx;
-GLEW_FUN_EXPORT PFNGLLIGHTXVPROC __glewLightxv;
-GLEW_FUN_EXPORT PFNGLLINEWIDTHXPROC __glewLineWidthx;
-GLEW_FUN_EXPORT PFNGLLOADMATRIXXPROC __glewLoadMatrixx;
-GLEW_FUN_EXPORT PFNGLMATERIALXPROC __glewMaterialx;
-GLEW_FUN_EXPORT PFNGLMATERIALXVPROC __glewMaterialxv;
-GLEW_FUN_EXPORT PFNGLMULTMATRIXXPROC __glewMultMatrixx;
-GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x;
-GLEW_FUN_EXPORT PFNGLNORMAL3XPROC __glewNormal3x;
-GLEW_FUN_EXPORT PFNGLORTHOFPROC __glewOrthof;
-GLEW_FUN_EXPORT PFNGLORTHOXPROC __glewOrthox;
-GLEW_FUN_EXPORT PFNGLPOINTSIZEXPROC __glewPointSizex;
-GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx;
-GLEW_FUN_EXPORT PFNGLROTATEXPROC __glewRotatex;
-GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex;
-GLEW_FUN_EXPORT PFNGLSCALEXPROC __glewScalex;
-GLEW_FUN_EXPORT PFNGLTEXENVXPROC __glewTexEnvx;
-GLEW_FUN_EXPORT PFNGLTEXENVXVPROC __glewTexEnvxv;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERXPROC __glewTexParameterx;
-GLEW_FUN_EXPORT PFNGLTRANSLATEXPROC __glewTranslatex;
-
-GLEW_FUN_EXPORT PFNGLCLIPPLANEFPROC __glewClipPlanef;
-GLEW_FUN_EXPORT PFNGLCLIPPLANEXPROC __glewClipPlanex;
-GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef;
-GLEW_FUN_EXPORT PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex;
-GLEW_FUN_EXPORT PFNGLGETFIXEDVPROC __glewGetFixedv;
-GLEW_FUN_EXPORT PFNGLGETLIGHTXVPROC __glewGetLightxv;
-GLEW_FUN_EXPORT PFNGLGETMATERIALXVPROC __glewGetMaterialxv;
-GLEW_FUN_EXPORT PFNGLGETTEXENVXVPROC __glewGetTexEnvxv;
-GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXPROC __glewPointParameterx;
-GLEW_FUN_EXPORT PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv;
-GLEW_FUN_EXPORT PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES;
-GLEW_FUN_EXPORT PFNGLTEXPARAMETERXVPROC __glewTexParameterxv;
-
-GLEW_FUN_EXPORT PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL;
-
-GLEW_FUN_EXPORT PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL;
-GLEW_FUN_EXPORT PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL;
-
-GLEW_FUN_EXPORT PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL;
-
-GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS;
-GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS;
-GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS;
-GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS;
-
-GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS;
-GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS;
-GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS;
-
-GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS;
-GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS;
-
-GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX;
-GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX;
-GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX;
-GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX;
-GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX;
-GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX;
-
-GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX;
-
-GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX;
-
-GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX;
-GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX;
-GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX;
-
-GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX;
-
-GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX;
-
-GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX;
-
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX;
-GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX;
-
-GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX;
-
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI;
-GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI;
-GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI;
-GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI;
-GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI;
-
-GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX;
-
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN;
-GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN;
-
-GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN;
-
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN;
-
-GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN;
-GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN;
-
-GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN;
-
-#if defined(GLEW_MX) && !defined(_WIN32)
-struct GLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_2;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_3;
-GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_4;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_blend_minmax_factor;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_interleaved_elements;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_multi_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_pinned_memory;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_query_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sample_positions;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_trinary_minmax;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_sparse_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_stencil_operation_extended;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_layer;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator;
-GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_viewport_index;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_depth_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_blit;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_framebuffer_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_instanced_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_pack_reverse_row_order;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_program_binary;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt1;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_compression_dxt5;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_texture_usage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_timer_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ANGLE_translated_shader_source;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators;
-GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES3_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_arrays_of_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_base_instance;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_bindless_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_buffer_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_clear_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compressed_texture_pixel_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compute_variable_group_size;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_conservative_depth;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_image;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_enhanced_layouts;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_uniform_location;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_layer_viewport;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_no_attachments;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_indirect_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_internalformat_query2;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_invalidate_subdata;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_alignment;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_bind;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multi_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_program_interface_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_query_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robust_buffer_access_behavior;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_application_isolation;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness_share_group_isolation;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cubemap_per_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_atomic_counters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_draw_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_group_vote;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_load_store;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_image_size;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_storage_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_420pack;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_packing;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sparse_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_stencil_texturing;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_levels;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_stencil8;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_storage_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_view;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_binding;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_debug_marker;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_EXT_x11_sync_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator;
-GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test;
-GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat;
-GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists;
-GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read;
-GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_map_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays;
-GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor;
-GLEW_VAR_EXPORT GLboolean __GLEW_KHR_debug;
-GLEW_VAR_EXPORT GLboolean __GLEW_KHR_texture_compression_astc_ldr;
-GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos;
-GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_NVX_conditional_render;
-GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_multi_draw_indirect;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_bindless_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_equation_advanced_coherent;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_compute_program5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_deep_texture3D;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_draw_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5_mem_extended;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_path_rendering;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_counters;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_atomic_float;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_storage_buffer_object;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4;
-GLEW_VAR_EXPORT GLboolean __GLEW_NV_video_capture;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format;
-GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample;
-GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample;
-GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints;
-GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_0_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_ES1_1_compatibility;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_enable;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_error_string;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_extension_query;
-GLEW_VAR_EXPORT GLboolean __GLEW_REGAL_log;
-GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates;
-GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list;
-GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog;
-GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint;
-
-#ifdef GLEW_MX
-}; /* GLEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------- */
-
-/* error codes */
-#define GLEW_OK 0
-#define GLEW_NO_ERROR 0
-#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */
-#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */
-#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */
-
-/* string codes */
-#define GLEW_VERSION 1
-#define GLEW_VERSION_MAJOR 2
-#define GLEW_VERSION_MINOR 3
-#define GLEW_VERSION_MICRO 4
-
-/* API */
-#ifdef GLEW_MX
-
-typedef struct GLEWContextStruct GLEWContext;
-GLEWAPI GLenum GLEWAPIENTRY glewContextInit (GLEWContext *ctx);
-GLEWAPI GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext *ctx, const char *name);
-
-#define glewInit() glewContextInit(glewGetContext())
-#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x)
-#define glewIsExtensionSupported(x) glewIsSupported(x)
-
-#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x))
-#ifdef _WIN32
-# define GLEW_GET_FUN(x) glewGetContext()->x
-#else
-# define GLEW_GET_FUN(x) x
-#endif
-
-#else /* GLEW_MX */
-
-GLEWAPI GLenum GLEWAPIENTRY glewInit (void);
-GLEWAPI GLboolean GLEWAPIENTRY glewIsSupported (const char *name);
-#define glewIsExtensionSupported(x) glewIsSupported(x)
-
-#define GLEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define GLEW_GET_FUN(x) x
-
-#endif /* GLEW_MX */
-
-GLEWAPI GLboolean glewExperimental;
-GLEWAPI GLboolean GLEWAPIENTRY glewGetExtension (const char *name);
-GLEWAPI const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error);
-GLEWAPI const GLubyte * GLEWAPIENTRY glewGetString (GLenum name);
-
-#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-GLEWAPI GLboolean GLEWAPIENTRY glewOpenGL11Init(void);
-#endif //GLEW_INIT_OPENGL11_FUNCTIONS
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-GLEWAPI GLboolean GLEWAPIENTRY glewXInit(void);
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef GLEW_APIENTRY_DEFINED
-#undef GLEW_APIENTRY_DEFINED
-#undef APIENTRY
-#undef GLAPIENTRY
-#define GLAPIENTRY
-#endif
-
-#ifdef GLEW_CALLBACK_DEFINED
-#undef GLEW_CALLBACK_DEFINED
-#undef CALLBACK
-#endif
-
-#ifdef GLEW_WINGDIAPI_DEFINED
-#undef GLEW_WINGDIAPI_DEFINED
-#undef WINGDIAPI
-#endif
-
-#undef GLAPI
-/* #undef GLEWAPI */
-
-#endif /* __glew_h__ */
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glxew.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glxew.h
deleted file mode 100644
index 6115d611e1..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/glxew.h
+++ /dev/null
@@ -1,1750 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author 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.
-*/
-
-/*
- * Mesa 3-D graphics library
- * Version: 7.0
- *
- * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * BRIAN PAUL 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.
- */
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are 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 Materials.
-**
-** THE MATERIALS ARE 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
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __glxew_h__
-#define __glxew_h__
-#define __GLXEW_H__
-
-#ifdef __glxext_h_
-#error glxext.h included before glxew.h
-#endif
-
-#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__)
-#error glx.h included before glxew.h
-#endif
-
-#define __glxext_h_
-
-#define GLX_H
-#define __GLX_glx_h__
-#define __glx_h__
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xmd.h>
-#include "glew.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ---------------------------- GLX_VERSION_1_0 --------------------------- */
-
-#ifndef GLX_VERSION_1_0
-#define GLX_VERSION_1_0 1
-
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-#define GLX_BAD_SCREEN 1
-#define GLX_BAD_ATTRIBUTE 2
-#define GLX_NO_EXTENSION 3
-#define GLX_BAD_VISUAL 4
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-typedef XID GLXDrawable;
-typedef XID GLXPixmap;
-#ifdef __sun
-typedef struct __glXContextRec *GLXContext;
-#else
-typedef struct __GLXcontextRec *GLXContext;
-#endif
-
-typedef unsigned int GLXVideoDeviceNV;
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-typedef Bool (* PFNGLXQUERYEXTENSION) (Display *dpy, int *errorBase, int *eventBase);
-#define glXQueryExtension GLXEW_GET_FUN(__glewXQueryExtension)
-
-typedef Bool (* PFNGLXQUERYVERSION) (Display *dpy, int *major, int *minor);
-#define glXQueryVersion GLXEW_GET_FUN(__glewXQueryVersion)
-
-typedef int (* PFNGLXGETCONFIG) (Display *dpy, XVisualInfo *vis, int attrib, int *value);
-#define glXGetConfig GLXEW_GET_FUN(__glewXGetConfig)
-
-typedef XVisualInfo* (* PFNGLXCHOOSEVISUAL) (Display *dpy, int screen, int *attribList);
-#define glXChooseVisual GLXEW_GET_FUN(__glewXChooseVisual)
-
-//extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
-//extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
-typedef GLXContext (* PFNGLXCREATECONTEXT) (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
-#define glXCreateContext GLXEW_GET_FUN(__glewXCreateContext)
-
-
-typedef void (*PFNGLXDESTROYCONTEXT) (Display *dpy, GLXContext ctx);
-#define glXDestroyContext GLXEW_GET_FUN(__glewXDestroyContext)
-
-typedef Bool (* PFNGLXISDIRECT) (Display *dpy, GLXContext ctx);
-#define glXIsDirect GLXEW_GET_FUN(__glewXIsDirect)
-
-
-//extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
-typedef Bool (*PFNGLXMAKECURRENT) (Display *dpy, GLXDrawable drawable, GLXContext ctx);
-#define glXMakeCurrent GLXEW_GET_FUN(__glewXMakeCurrent)
-
-//extern GLXContext glXGetCurrentContext (void);
-//extern GLXDrawable glXGetCurrentDrawable (void);
-//extern void glXWaitGL (void);
-//extern void glXWaitX (void);
-typedef void (*PFNGLXSWAPBUFFERS) (Display *dpy, GLXDrawable drawable);
-#define glXSwapBuffers GLXEW_GET_FUN(__glewXSwapBuffers)
-
-//extern void glXUseXFont (Font font, int first, int count, int listBase);
-
-
-#else//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);
-extern Bool glXQueryVersion (Display *dpy, int *major, int *minor);
-extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value);
-extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList);
-extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
-extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
-extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
-extern void glXDestroyContext (Display *dpy, GLXContext ctx);
-extern Bool glXIsDirect (Display *dpy, GLXContext ctx);
-extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
-extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);
-extern GLXContext glXGetCurrentContext (void);
-extern GLXDrawable glXGetCurrentDrawable (void);
-extern void glXWaitGL (void);
-extern void glXWaitX (void);
-extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable);
-extern void glXUseXFont (Font font, int first, int count, int listBase);
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0)
-
-#endif /* GLX_VERSION_1_0 */
-
-/* ---------------------------- GLX_VERSION_1_1 --------------------------- */
-
-#ifndef GLX_VERSION_1_1
-#define GLX_VERSION_1_1
-
-#define GLX_VENDOR 0x1
-#define GLX_VERSION 0x2
-#define GLX_EXTENSIONS 0x3
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-typedef const char* (*PFNGLXQUERYEXTENSIONSSTRING) (Display *dpy, int screen);
-#define glXQueryExtensionsString GLXEW_GET_FUN(__glewXQueryExtensionsString)
-
-typedef const char* (*PFNGLXGETCLIENTSTRING) (Display *dpy, int name);
-#define glXGetClientString GLXEW_GET_FUN(__glewXGetClientString)
-
-typedef const char* (*PFNGLXQUERYSERVERSTRING) (Display *dpy, int screen, int name);
-#define glXQueryServerString GLXEW_GET_FUN(__glewXQueryServerString)
-
-#else//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-extern const char* glXQueryExtensionsString (Display *dpy, int screen);
-extern const char* glXGetClientString (Display *dpy, int name);
-extern const char* glXQueryServerString (Display *dpy, int screen, int name);
-#endif//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1)
-
-#endif /* GLX_VERSION_1_1 */
-
-/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */
-
-#ifndef GLX_VERSION_1_2
-#define GLX_VERSION_1_2 1
-
-typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
-
-#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay)
-
-#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2)
-
-#endif /* GLX_VERSION_1_2 */
-
-/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */
-
-#ifndef GLX_VERSION_1_3
-#define GLX_VERSION_1_3 1
-
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_VISUAL_ID 0x800B
-#define GLX_SCREEN 0x800C
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_DONT_CARE 0xFFFFFFFF
-
-typedef XID GLXFBConfigID;
-typedef XID GLXPbuffer;
-typedef XID GLXWindow;
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-
-typedef struct {
- int event_type;
- int draw_type;
- unsigned long serial;
- Bool send_event;
- Display *display;
- GLXDrawable drawable;
- unsigned int buffer_mask;
- unsigned int aux_buffer;
- int x, y;
- int width, height;
- int count;
-} GLXPbufferClobberEvent;
-typedef union __GLXEvent {
- GLXPbufferClobberEvent glxpbufferclobber;
- long pad[24];
-} GLXEvent;
-
-typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
-typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
-typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
-typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
-typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
-typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
-typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
-
-#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig)
-#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext)
-#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer)
-#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap)
-#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow)
-#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer)
-#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap)
-#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow)
-#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable)
-#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib)
-#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs)
-#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent)
-#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig)
-#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent)
-#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext)
-#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable)
-#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent)
-
-#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3)
-
-#endif /* GLX_VERSION_1_3 */
-
-/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */
-
-#ifndef GLX_VERSION_1_4
-#define GLX_VERSION_1_4 1
-
-#define GLX_SAMPLE_BUFFERS 100000
-#define GLX_SAMPLES 100001
-
-extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
-
-#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4)
-
-#endif /* GLX_VERSION_1_4 */
-
-/* -------------------------- GLX_3DFX_multisample ------------------------- */
-
-#ifndef GLX_3DFX_multisample
-#define GLX_3DFX_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
-#define GLX_SAMPLES_3DFX 0x8051
-
-#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample)
-
-#endif /* GLX_3DFX_multisample */
-
-/* ------------------------ GLX_AMD_gpu_association ------------------------ */
-
-#ifndef GLX_AMD_gpu_association
-#define GLX_AMD_gpu_association 1
-
-#define GLX_GPU_VENDOR_AMD 0x1F00
-#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
-#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define GLX_GPU_RAM_AMD 0x21A3
-#define GLX_GPU_CLOCK_AMD 0x21A4
-#define GLX_GPU_NUM_PIPES_AMD 0x21A5
-#define GLX_GPU_NUM_SIMD_AMD 0x21A6
-#define GLX_GPU_NUM_RB_AMD 0x21A7
-#define GLX_GPU_NUM_SPI_AMD 0x21A8
-
-typedef void ( * PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list);
-typedef GLXContext ( * PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int* attribList);
-typedef Bool ( * PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx);
-typedef unsigned int ( * PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx);
-typedef GLXContext ( * PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
-typedef unsigned int ( * PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int* ids);
-typedef int ( * PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void* data);
-typedef Bool ( * PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx);
-
-#define glXBlitContextFramebufferAMD GLXEW_GET_FUN(__glewXBlitContextFramebufferAMD)
-#define glXCreateAssociatedContextAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAMD)
-#define glXCreateAssociatedContextAttribsAMD GLXEW_GET_FUN(__glewXCreateAssociatedContextAttribsAMD)
-#define glXDeleteAssociatedContextAMD GLXEW_GET_FUN(__glewXDeleteAssociatedContextAMD)
-#define glXGetContextGPUIDAMD GLXEW_GET_FUN(__glewXGetContextGPUIDAMD)
-#define glXGetCurrentAssociatedContextAMD GLXEW_GET_FUN(__glewXGetCurrentAssociatedContextAMD)
-#define glXGetGPUIDsAMD GLXEW_GET_FUN(__glewXGetGPUIDsAMD)
-#define glXGetGPUInfoAMD GLXEW_GET_FUN(__glewXGetGPUInfoAMD)
-#define glXMakeAssociatedContextCurrentAMD GLXEW_GET_FUN(__glewXMakeAssociatedContextCurrentAMD)
-
-#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association)
-
-#endif /* GLX_AMD_gpu_association */
-
-/* ------------------------- GLX_ARB_create_context ------------------------ */
-
-#ifndef GLX_ARB_create_context
-#define GLX_ARB_create_context 1
-
-#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define GLX_CONTEXT_FLAGS_ARB 0x2094
-
-typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
-
-#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB)
-
-#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context)
-
-#endif /* GLX_ARB_create_context */
-
-/* --------------------- GLX_ARB_create_context_profile -------------------- */
-
-#ifndef GLX_ARB_create_context_profile
-#define GLX_ARB_create_context_profile 1
-
-#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
-
-#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile)
-
-#endif /* GLX_ARB_create_context_profile */
-
-/* ------------------- GLX_ARB_create_context_robustness ------------------- */
-
-#ifndef GLX_ARB_create_context_robustness
-#define GLX_ARB_create_context_robustness 1
-
-#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
-
-#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness)
-
-#endif /* GLX_ARB_create_context_robustness */
-
-/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */
-
-#ifndef GLX_ARB_fbconfig_float
-#define GLX_ARB_fbconfig_float 1
-
-#define GLX_RGBA_FLOAT_BIT 0x00000004
-#define GLX_RGBA_FLOAT_TYPE 0x20B9
-
-#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float)
-
-#endif /* GLX_ARB_fbconfig_float */
-
-/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_ARB_framebuffer_sRGB
-#define GLX_ARB_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
-
-#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB)
-
-#endif /* GLX_ARB_framebuffer_sRGB */
-
-/* ------------------------ GLX_ARB_get_proc_address ----------------------- */
-
-#ifndef GLX_ARB_get_proc_address
-#define GLX_ARB_get_proc_address 1
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-typedef void* ( * PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
-#define glXGetProcAddressARB GLXEW_GET_FUN(__glewXGetProcAddressARB)
-
-#else//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address)
-
-#endif /* GLX_ARB_get_proc_address */
-
-/* -------------------------- GLX_ARB_multisample -------------------------- */
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_ARB 100000
-#define GLX_SAMPLES_ARB 100001
-
-#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample)
-
-#endif /* GLX_ARB_multisample */
-
-/* ---------------- GLX_ARB_robustness_application_isolation --------------- */
-
-#ifndef GLX_ARB_robustness_application_isolation
-#define GLX_ARB_robustness_application_isolation 1
-
-#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
-
-#define GLXEW_ARB_robustness_application_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_application_isolation)
-
-#endif /* GLX_ARB_robustness_application_isolation */
-
-/* ---------------- GLX_ARB_robustness_share_group_isolation --------------- */
-
-#ifndef GLX_ARB_robustness_share_group_isolation
-#define GLX_ARB_robustness_share_group_isolation 1
-
-#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
-
-#define GLXEW_ARB_robustness_share_group_isolation GLXEW_GET_VAR(__GLXEW_ARB_robustness_share_group_isolation)
-
-#endif /* GLX_ARB_robustness_share_group_isolation */
-
-/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */
-
-#ifndef GLX_ARB_vertex_buffer_object
-#define GLX_ARB_vertex_buffer_object 1
-
-#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
-
-#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object)
-
-#endif /* GLX_ARB_vertex_buffer_object */
-
-/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */
-
-#ifndef GLX_ATI_pixel_format_float
-#define GLX_ATI_pixel_format_float 1
-
-#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100
-
-#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float)
-
-#endif /* GLX_ATI_pixel_format_float */
-
-/* ------------------------- GLX_ATI_render_texture ------------------------ */
-
-#ifndef GLX_ATI_render_texture
-#define GLX_ATI_render_texture 1
-
-#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
-#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
-#define GLX_TEXTURE_FORMAT_ATI 0x9802
-#define GLX_TEXTURE_TARGET_ATI 0x9803
-#define GLX_MIPMAP_TEXTURE_ATI 0x9804
-#define GLX_TEXTURE_RGB_ATI 0x9805
-#define GLX_TEXTURE_RGBA_ATI 0x9806
-#define GLX_NO_TEXTURE_ATI 0x9807
-#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808
-#define GLX_TEXTURE_1D_ATI 0x9809
-#define GLX_TEXTURE_2D_ATI 0x980A
-#define GLX_MIPMAP_LEVEL_ATI 0x980B
-#define GLX_CUBE_MAP_FACE_ATI 0x980C
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812
-#define GLX_FRONT_LEFT_ATI 0x9813
-#define GLX_FRONT_RIGHT_ATI 0x9814
-#define GLX_BACK_LEFT_ATI 0x9815
-#define GLX_BACK_RIGHT_ATI 0x9816
-#define GLX_AUX0_ATI 0x9817
-#define GLX_AUX1_ATI 0x9818
-#define GLX_AUX2_ATI 0x9819
-#define GLX_AUX3_ATI 0x981A
-#define GLX_AUX4_ATI 0x981B
-#define GLX_AUX5_ATI 0x981C
-#define GLX_AUX6_ATI 0x981D
-#define GLX_AUX7_ATI 0x981E
-#define GLX_AUX8_ATI 0x981F
-#define GLX_AUX9_ATI 0x9820
-#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821
-#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822
-
-typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-
-#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI)
-#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI)
-#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI)
-
-#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture)
-
-#endif /* GLX_ATI_render_texture */
-
-/* --------------------------- GLX_EXT_buffer_age -------------------------- */
-
-#ifndef GLX_EXT_buffer_age
-#define GLX_EXT_buffer_age 1
-
-#define GLX_BACK_BUFFER_AGE_EXT 0x20F4
-
-#define GLXEW_EXT_buffer_age GLXEW_GET_VAR(__GLXEW_EXT_buffer_age)
-
-#endif /* GLX_EXT_buffer_age */
-
-/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */
-
-#ifndef GLX_EXT_create_context_es2_profile
-#define GLX_EXT_create_context_es2_profile 1
-
-#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-
-#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile)
-
-#endif /* GLX_EXT_create_context_es2_profile */
-
-/* ------------------- GLX_EXT_create_context_es_profile ------------------- */
-
-#ifndef GLX_EXT_create_context_es_profile
-#define GLX_EXT_create_context_es_profile 1
-
-#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
-
-#define GLXEW_EXT_create_context_es_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es_profile)
-
-#endif /* GLX_EXT_create_context_es_profile */
-
-/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
-
-#ifndef GLX_EXT_fbconfig_packed_float
-#define GLX_EXT_fbconfig_packed_float 1
-
-#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
-#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
-
-#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float)
-
-#endif /* GLX_EXT_fbconfig_packed_float */
-
-/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_EXT_framebuffer_sRGB
-#define GLX_EXT_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
-
-#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB)
-
-#endif /* GLX_EXT_framebuffer_sRGB */
-
-/* ------------------------- GLX_EXT_import_context ------------------------ */
-
-#ifndef GLX_EXT_import_context
-#define GLX_EXT_import_context 1
-
-#define GLX_SHARE_CONTEXT_EXT 0x800A
-#define GLX_VISUAL_ID_EXT 0x800B
-#define GLX_SCREEN_EXT 0x800C
-
-typedef XID GLXContextID;
-
-typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context);
-typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
-typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID);
-typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value);
-
-#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT)
-#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT)
-#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT)
-#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT)
-
-#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context)
-
-#endif /* GLX_EXT_import_context */
-
-/* -------------------------- GLX_EXT_scene_marker ------------------------- */
-
-#ifndef GLX_EXT_scene_marker
-#define GLX_EXT_scene_marker 1
-
-#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker)
-
-#endif /* GLX_EXT_scene_marker */
-
-/* -------------------------- GLX_EXT_swap_control ------------------------- */
-
-#ifndef GLX_EXT_swap_control
-#define GLX_EXT_swap_control 1
-
-#define GLX_SWAP_INTERVAL_EXT 0x20F1
-#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
-
-typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval);
-
-#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT)
-
-#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control)
-
-#endif /* GLX_EXT_swap_control */
-
-/* ----------------------- GLX_EXT_swap_control_tear ----------------------- */
-
-#ifndef GLX_EXT_swap_control_tear
-#define GLX_EXT_swap_control_tear 1
-
-#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
-
-#define GLXEW_EXT_swap_control_tear GLXEW_GET_VAR(__GLXEW_EXT_swap_control_tear)
-
-#endif /* GLX_EXT_swap_control_tear */
-
-/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
-
-#ifndef GLX_EXT_texture_from_pixmap
-#define GLX_EXT_texture_from_pixmap 1
-
-#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
-#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
-#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
-#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
-#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
-#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
-#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
-#define GLX_Y_INVERTED_EXT 0x20D4
-#define GLX_TEXTURE_FORMAT_EXT 0x20D5
-#define GLX_TEXTURE_TARGET_EXT 0x20D6
-#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
-#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
-#define GLX_TEXTURE_1D_EXT 0x20DB
-#define GLX_TEXTURE_2D_EXT 0x20DC
-#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
-#define GLX_FRONT_LEFT_EXT 0x20DE
-#define GLX_FRONT_RIGHT_EXT 0x20DF
-#define GLX_BACK_LEFT_EXT 0x20E0
-#define GLX_BACK_RIGHT_EXT 0x20E1
-#define GLX_AUX0_EXT 0x20E2
-#define GLX_AUX1_EXT 0x20E3
-#define GLX_AUX2_EXT 0x20E4
-#define GLX_AUX3_EXT 0x20E5
-#define GLX_AUX4_EXT 0x20E6
-#define GLX_AUX5_EXT 0x20E7
-#define GLX_AUX6_EXT 0x20E8
-#define GLX_AUX7_EXT 0x20E9
-#define GLX_AUX8_EXT 0x20EA
-#define GLX_AUX9_EXT 0x20EB
-
-typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer);
-
-#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT)
-#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT)
-
-#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap)
-
-#endif /* GLX_EXT_texture_from_pixmap */
-
-/* -------------------------- GLX_EXT_visual_info -------------------------- */
-
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info 1
-
-#define GLX_X_VISUAL_TYPE_EXT 0x22
-#define GLX_TRANSPARENT_TYPE_EXT 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRUE_COLOR_EXT 0x8002
-#define GLX_DIRECT_COLOR_EXT 0x8003
-#define GLX_PSEUDO_COLOR_EXT 0x8004
-#define GLX_STATIC_COLOR_EXT 0x8005
-#define GLX_GRAY_SCALE_EXT 0x8006
-#define GLX_STATIC_GRAY_EXT 0x8007
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-
-#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info)
-
-#endif /* GLX_EXT_visual_info */
-
-/* ------------------------- GLX_EXT_visual_rating ------------------------- */
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating 1
-
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-
-#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating)
-
-#endif /* GLX_EXT_visual_rating */
-
-/* -------------------------- GLX_INTEL_swap_event ------------------------- */
-
-#ifndef GLX_INTEL_swap_event
-#define GLX_INTEL_swap_event 1
-
-#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
-#define GLX_COPY_COMPLETE_INTEL 0x8181
-#define GLX_FLIP_COMPLETE_INTEL 0x8182
-#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
-
-#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event)
-
-#endif /* GLX_INTEL_swap_event */
-
-/* -------------------------- GLX_MESA_agp_offset -------------------------- */
-
-#ifndef GLX_MESA_agp_offset
-#define GLX_MESA_agp_offset 1
-
-typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer);
-
-#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA)
-
-#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset)
-
-#endif /* GLX_MESA_agp_offset */
-
-/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */
-
-#ifndef GLX_MESA_copy_sub_buffer
-#define GLX_MESA_copy_sub_buffer 1
-
-typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);
-
-#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA)
-
-#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer)
-
-#endif /* GLX_MESA_copy_sub_buffer */
-
-/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */
-
-#ifndef GLX_MESA_pixmap_colormap
-#define GLX_MESA_pixmap_colormap 1
-
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
-
-#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA)
-
-#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap)
-
-#endif /* GLX_MESA_pixmap_colormap */
-
-/* ------------------------ GLX_MESA_release_buffers ----------------------- */
-
-#ifndef GLX_MESA_release_buffers
-#define GLX_MESA_release_buffers 1
-
-typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d);
-
-#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA)
-
-#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers)
-
-#endif /* GLX_MESA_release_buffers */
-
-/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */
-
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_MESA_set_3dfx_mode 1
-
-#define GLX_3DFX_WINDOW_MODE_MESA 0x1
-#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-
-typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
-
-#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA)
-
-#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode)
-
-#endif /* GLX_MESA_set_3dfx_mode */
-
-/* ------------------------- GLX_MESA_swap_control ------------------------- */
-
-#ifndef GLX_MESA_swap_control
-#define GLX_MESA_swap_control 1
-
-typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);
-typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
-
-#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)
-#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)
-
-#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)
-
-#endif /* GLX_MESA_swap_control */
-
-/* --------------------------- GLX_NV_copy_image --------------------------- */
-
-#ifndef GLX_NV_copy_image
-#define GLX_NV_copy_image 1
-
-typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV)
-
-#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image)
-
-#endif /* GLX_NV_copy_image */
-
-/* -------------------------- GLX_NV_float_buffer -------------------------- */
-
-#ifndef GLX_NV_float_buffer
-#define GLX_NV_float_buffer 1
-
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-
-#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer)
-
-#endif /* GLX_NV_float_buffer */
-
-/* ---------------------- GLX_NV_multisample_coverage ---------------------- */
-
-#ifndef GLX_NV_multisample_coverage
-#define GLX_NV_multisample_coverage 1
-
-#define GLX_COLOR_SAMPLES_NV 0x20B3
-#define GLX_COVERAGE_SAMPLES_NV 100001
-
-#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage)
-
-#endif /* GLX_NV_multisample_coverage */
-
-/* -------------------------- GLX_NV_present_video ------------------------- */
-
-#ifndef GLX_NV_present_video
-#define GLX_NV_present_video 1
-
-#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
-
-typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
-typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
-
-#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV)
-#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV)
-
-#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video)
-
-#endif /* GLX_NV_present_video */
-
-/* --------------------------- GLX_NV_swap_group --------------------------- */
-
-#ifndef GLX_NV_swap_group
-#define GLX_NV_swap_group 1
-
-typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier);
-typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group);
-typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count);
-typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
-typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
-typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen);
-
-#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV)
-#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV)
-#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV)
-#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV)
-#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV)
-#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV)
-
-#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group)
-
-#endif /* GLX_NV_swap_group */
-
-/* ----------------------- GLX_NV_vertex_array_range ----------------------- */
-
-#ifndef GLX_NV_vertex_array_range
-#define GLX_NV_vertex_array_range 1
-
-typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
-
-#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV)
-#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV)
-
-#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range)
-
-#endif /* GLX_NV_vertex_array_range */
-
-/* -------------------------- GLX_NV_video_capture ------------------------- */
-
-#ifndef GLX_NV_video_capture
-#define GLX_NV_video_capture 1
-
-#define GLX_DEVICE_ID_NV 0x20CD
-#define GLX_UNIQUE_ID_NV 0x20CE
-#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-
-typedef XID GLXVideoCaptureDeviceNV;
-
-typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
-typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
-typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
-typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-
-#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
-#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
-#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
-#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
-#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
-
-#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
-
-#endif /* GLX_NV_video_capture */
-
-/* -------------------------- GLX_NV_video_output -------------------------- */
-
-#ifndef GLX_NV_video_output
-#define GLX_NV_video_output 1
-
-#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
-#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
-#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
-#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
-#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
-#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
-#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
-#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
-
-typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
-typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
-typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
-typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
-
-#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV)
-#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV)
-#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV)
-#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV)
-#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
-#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
-
-#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
-
-#endif /* GLX_NV_video_output */
-
-/* -------------------------- GLX_OML_swap_method -------------------------- */
-
-#ifndef GLX_OML_swap_method
-#define GLX_OML_swap_method 1
-
-#define GLX_SWAP_METHOD_OML 0x8060
-#define GLX_SWAP_EXCHANGE_OML 0x8061
-#define GLX_SWAP_COPY_OML 0x8062
-#define GLX_SWAP_UNDEFINED_OML 0x8063
-
-#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method)
-
-#endif /* GLX_OML_swap_method */
-
-/* -------------------------- GLX_OML_sync_control ------------------------- */
-
-#ifndef GLX_OML_sync_control
-#define GLX_OML_sync_control 1
-
-typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
-typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);
-
-#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML)
-#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML)
-#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML)
-#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML)
-#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML)
-
-#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control)
-
-#endif /* GLX_OML_sync_control */
-
-/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */
-
-#ifndef GLX_SGIS_blended_overlay
-#define GLX_SGIS_blended_overlay 1
-
-#define GLX_BLENDED_RGBA_SGIS 0x8025
-
-#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay)
-
-#endif /* GLX_SGIS_blended_overlay */
-
-/* -------------------------- GLX_SGIS_color_range ------------------------- */
-
-#ifndef GLX_SGIS_color_range
-#define GLX_SGIS_color_range 1
-
-#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range)
-
-#endif /* GLX_SGIS_color_range */
-
-/* -------------------------- GLX_SGIS_multisample ------------------------- */
-
-#ifndef GLX_SGIS_multisample
-#define GLX_SGIS_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_SGIS 100000
-#define GLX_SAMPLES_SGIS 100001
-
-#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample)
-
-#endif /* GLX_SGIS_multisample */
-
-/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */
-
-#ifndef GLX_SGIS_shared_multisample
-#define GLX_SGIS_shared_multisample 1
-
-#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
-#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
-
-#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample)
-
-#endif /* GLX_SGIS_shared_multisample */
-
-/* --------------------------- GLX_SGIX_fbconfig --------------------------- */
-
-#ifndef GLX_SGIX_fbconfig
-#define GLX_SGIX_fbconfig 1
-
-#define GLX_WINDOW_BIT_SGIX 0x00000001
-#define GLX_RGBA_BIT_SGIX 0x00000001
-#define GLX_PIXMAP_BIT_SGIX 0x00000002
-#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
-#define GLX_SCREEN_EXT 0x800C
-#define GLX_DRAWABLE_TYPE_SGIX 0x8010
-#define GLX_RENDER_TYPE_SGIX 0x8011
-#define GLX_X_RENDERABLE_SGIX 0x8012
-#define GLX_FBCONFIG_ID_SGIX 0x8013
-#define GLX_RGBA_TYPE_SGIX 0x8014
-#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
-
-typedef XID GLXFBConfigIDSGIX;
-typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
-
-typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value);
-typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config);
-
-#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX)
-#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX)
-#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX)
-#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX)
-#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX)
-#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX)
-
-#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig)
-
-#endif /* GLX_SGIX_fbconfig */
-
-/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */
-
-#ifndef GLX_SGIX_hyperpipe
-#define GLX_SGIX_hyperpipe 1
-
-#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
-#define GLX_PIPE_RECT_SGIX 0x00000001
-#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
-#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
-#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
-#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
-#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
-#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
-#define GLX_BAD_HYPERPIPE_SGIX 92
-#define GLX_HYPERPIPE_ID_SGIX 0x8030
-
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int networkId;
-} GLXHyperpipeNetworkSGIX;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int XOrigin;
- int YOrigin;
- int maxHeight;
- int maxWidth;
-} GLXPipeRectLimits;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int channel;
- unsigned int participationType;
- int timeSlice;
-} GLXHyperpipeConfigSGIX;
-typedef struct {
- char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX];
- int srcXOrigin;
- int srcYOrigin;
- int srcWidth;
- int srcHeight;
- int destXOrigin;
- int destYOrigin;
- int destWidth;
- int destHeight;
-} GLXPipeRect;
-
-typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
-typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
-typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
-typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
-typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
-typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
-
-#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX)
-#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX)
-#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX)
-#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX)
-#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX)
-#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX)
-#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX)
-#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX)
-
-#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe)
-
-#endif /* GLX_SGIX_hyperpipe */
-
-/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */
-
-#ifndef GLX_SGIX_pbuffer
-#define GLX_SGIX_pbuffer 1
-
-#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
-#define GLX_PBUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
-#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
-#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
-#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
-#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
-#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
-#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
-#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
-#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
-#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
-#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
-#define GLX_LARGEST_PBUFFER_SGIX 0x801C
-#define GLX_WIDTH_SGIX 0x801D
-#define GLX_HEIGHT_SGIX 0x801E
-#define GLX_EVENT_MASK_SGIX 0x801F
-#define GLX_DAMAGED_SGIX 0x8020
-#define GLX_SAVED_SGIX 0x8021
-#define GLX_WINDOW_SGIX 0x8022
-#define GLX_PBUFFER_SGIX 0x8023
-#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
-
-typedef XID GLXPbufferSGIX;
-typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX;
-
-typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list);
-typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask);
-typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask);
-
-#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX)
-#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX)
-#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX)
-#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX)
-#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX)
-
-#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer)
-
-#endif /* GLX_SGIX_pbuffer */
-
-/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */
-
-#ifndef GLX_SGIX_swap_barrier
-#define GLX_SGIX_swap_barrier 1
-
-typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
-typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
-
-#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX)
-#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX)
-
-#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier)
-
-#endif /* GLX_SGIX_swap_barrier */
-
-/* -------------------------- GLX_SGIX_swap_group -------------------------- */
-
-#ifndef GLX_SGIX_swap_group
-#define GLX_SGIX_swap_group 1
-
-typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
-
-#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX)
-
-#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group)
-
-#endif /* GLX_SGIX_swap_group */
-
-/* ------------------------- GLX_SGIX_video_resize ------------------------- */
-
-#ifndef GLX_SGIX_video_resize
-#define GLX_SGIX_video_resize 1
-
-#define GLX_SYNC_FRAME_SGIX 0x00000000
-#define GLX_SYNC_SWAP_SGIX 0x00000001
-
-typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window);
-typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h);
-typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype);
-typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h);
-typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
-
-#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX)
-#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX)
-#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX)
-#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX)
-#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX)
-
-#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize)
-
-#endif /* GLX_SGIX_video_resize */
-
-/* ---------------------- GLX_SGIX_visual_select_group --------------------- */
-
-#ifndef GLX_SGIX_visual_select_group
-#define GLX_SGIX_visual_select_group 1
-
-#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
-
-#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group)
-
-#endif /* GLX_SGIX_visual_select_group */
-
-/* ---------------------------- GLX_SGI_cushion ---------------------------- */
-
-#ifndef GLX_SGI_cushion
-#define GLX_SGI_cushion 1
-
-typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion);
-
-#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI)
-
-#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion)
-
-#endif /* GLX_SGI_cushion */
-
-/* ----------------------- GLX_SGI_make_current_read ----------------------- */
-
-#ifndef GLX_SGI_make_current_read
-#define GLX_SGI_make_current_read 1
-
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
-typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-
-#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI)
-#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI)
-
-#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read)
-
-#endif /* GLX_SGI_make_current_read */
-
-/* -------------------------- GLX_SGI_swap_control ------------------------- */
-
-#ifndef GLX_SGI_swap_control
-#define GLX_SGI_swap_control 1
-
-typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
-
-#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI)
-
-#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control)
-
-#endif /* GLX_SGI_swap_control */
-
-/* --------------------------- GLX_SGI_video_sync -------------------------- */
-
-#ifndef GLX_SGI_video_sync
-#define GLX_SGI_video_sync 1
-
-typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count);
-typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count);
-
-#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI)
-#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI)
-
-#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync)
-
-#endif /* GLX_SGI_video_sync */
-
-/* --------------------- GLX_SUN_get_transparent_index --------------------- */
-
-#ifndef GLX_SUN_get_transparent_index
-#define GLX_SUN_get_transparent_index 1
-
-typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);
-
-#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN)
-
-#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index)
-
-#endif /* GLX_SUN_get_transparent_index */
-
-/* -------------------------- GLX_SUN_video_resize ------------------------- */
-
-#ifndef GLX_SUN_video_resize
-#define GLX_SUN_video_resize 1
-
-#define GLX_VIDEO_RESIZE_SUN 0x8171
-#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
-
-typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor);
-typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor);
-
-#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN)
-#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN)
-
-#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize)
-
-#endif /* GLX_SUN_video_resize */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT
-#define GLXEW_VAR_EXPORT
-#else
-#define GLXEW_FUN_EXPORT GLEW_FUN_EXPORT
-#define GLXEW_VAR_EXPORT GLEW_VAR_EXPORT
-#endif /* GLEW_MX */
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-GLXEW_FUN_EXPORT PFNGLXGETPROCADDRESSARBPROC __glewXGetProcAddressARB;
-GLXEW_FUN_EXPORT PFNGLXQUERYEXTENSION __glewXQueryExtension;
-GLXEW_FUN_EXPORT PFNGLXQUERYVERSION __glewXQueryVersion;
-GLXEW_FUN_EXPORT PFNGLXGETCONFIG __glewXGetConfig;
-GLXEW_FUN_EXPORT PFNGLXCHOOSEVISUAL __glewXChooseVisual;
-GLXEW_FUN_EXPORT PFNGLXCREATECONTEXT __glewXCreateContext;
-GLXEW_FUN_EXPORT PFNGLXDESTROYCONTEXT __glewXDestroyContext;
-GLXEW_FUN_EXPORT PFNGLXISDIRECT __glewXIsDirect;
-GLXEW_FUN_EXPORT PFNGLXMAKECURRENT __glewXMakeCurrent;
-GLXEW_FUN_EXPORT PFNGLXQUERYEXTENSIONSSTRING __glewXQueryExtensionsString;
-GLXEW_FUN_EXPORT PFNGLXGETCLIENTSTRING __glewXGetClientString;
-GLXEW_FUN_EXPORT PFNGLXQUERYSERVERSTRING __glewXQueryServerString;
-GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERS __glewXSwapBuffers;
-
-
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-GLXEW_FUN_EXPORT PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
-
-GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
-GLXEW_FUN_EXPORT PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
-GLXEW_FUN_EXPORT PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
-GLXEW_FUN_EXPORT PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
-GLXEW_FUN_EXPORT PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
-GLXEW_FUN_EXPORT PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
-GLXEW_FUN_EXPORT PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
-GLXEW_FUN_EXPORT PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
-GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
-GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
-GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
-GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
-GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
-GLXEW_FUN_EXPORT PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
-GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
-GLXEW_FUN_EXPORT PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
-GLXEW_FUN_EXPORT PFNGLXSELECTEVENTPROC __glewXSelectEvent;
-
-GLXEW_FUN_EXPORT PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD;
-GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD;
-GLXEW_FUN_EXPORT PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD;
-GLXEW_FUN_EXPORT PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD;
-GLXEW_FUN_EXPORT PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD;
-GLXEW_FUN_EXPORT PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD;
-GLXEW_FUN_EXPORT PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD;
-GLXEW_FUN_EXPORT PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD;
-GLXEW_FUN_EXPORT PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD;
-
-GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
-
-
-GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
-GLXEW_FUN_EXPORT PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
-GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
-
-GLXEW_FUN_EXPORT PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
-GLXEW_FUN_EXPORT PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
-GLXEW_FUN_EXPORT PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
-GLXEW_FUN_EXPORT PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
-
-GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
-
-GLXEW_FUN_EXPORT PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
-GLXEW_FUN_EXPORT PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
-
-GLXEW_FUN_EXPORT PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
-
-GLXEW_FUN_EXPORT PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
-
-GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
-
-GLXEW_FUN_EXPORT PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
-
-GLXEW_FUN_EXPORT PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
-
-GLXEW_FUN_EXPORT PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
-GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
-
-GLXEW_FUN_EXPORT PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
-
-GLXEW_FUN_EXPORT PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
-
-GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
-GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
-GLXEW_FUN_EXPORT PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
-GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
-GLXEW_FUN_EXPORT PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
-GLXEW_FUN_EXPORT PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
-
-GLXEW_FUN_EXPORT PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
-GLXEW_FUN_EXPORT PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
-
-GLXEW_FUN_EXPORT PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
-GLXEW_FUN_EXPORT PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
-
-GLXEW_FUN_EXPORT PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
-GLXEW_FUN_EXPORT PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
-GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
-GLXEW_FUN_EXPORT PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
-GLXEW_FUN_EXPORT PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
-
-GLXEW_FUN_EXPORT PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
-GLXEW_FUN_EXPORT PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
-GLXEW_FUN_EXPORT PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
-GLXEW_FUN_EXPORT PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
-GLXEW_FUN_EXPORT PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
-
-GLXEW_FUN_EXPORT PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
-GLXEW_FUN_EXPORT PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
-GLXEW_FUN_EXPORT PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
-GLXEW_FUN_EXPORT PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
-GLXEW_FUN_EXPORT PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
-GLXEW_FUN_EXPORT PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
-GLXEW_FUN_EXPORT PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
-GLXEW_FUN_EXPORT PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
-GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
-GLXEW_FUN_EXPORT PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
-GLXEW_FUN_EXPORT PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
-
-GLXEW_FUN_EXPORT PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
-
-GLXEW_FUN_EXPORT PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
-GLXEW_FUN_EXPORT PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
-
-GLXEW_FUN_EXPORT PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
-
-GLXEW_FUN_EXPORT PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
-GLXEW_FUN_EXPORT PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
-
-GLXEW_FUN_EXPORT PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
-
-GLXEW_FUN_EXPORT PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
-GLXEW_FUN_EXPORT PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
-
-#if defined(GLEW_MX)
-struct GLXEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_0;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_1;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_2;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_3;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_VERSION_1_4;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_3DFX_multisample;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_AMD_gpu_association;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_multisample;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_application_isolation;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_robustness_share_group_isolation;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_ATI_render_texture;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_buffer_age;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_create_context_es_profile;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_import_context;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_scene_marker;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_swap_control_tear;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_info;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_EXT_visual_rating;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_INTEL_swap_event;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_agp_offset;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_release_buffers;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_MESA_swap_control;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_copy_image;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_float_buffer;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_present_video;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_swap_group;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_capture;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_NV_video_output;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_swap_method;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_OML_sync_control;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_color_range;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_multisample;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_swap_group;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_video_resize;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_cushion;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_make_current_read;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_swap_control;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SGI_video_sync;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
-GLXEW_VAR_EXPORT GLboolean __GLXEW_SUN_video_resize;
-
-#ifdef GLEW_MX
-}; /* GLXEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------ */
-
-#ifdef GLEW_MX
-
-typedef struct GLXEWContextStruct GLXEWContext;
-GLEWAPI GLenum GLEWAPIENTRY glxewContextInit (GLXEWContext *ctx);
-GLEWAPI GLboolean GLEWAPIENTRY glxewContextIsSupported (const GLXEWContext *ctx, const char *name);
-
-#define glxewInit() glxewContextInit(glxewGetContext())
-#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x))
-#define GLXEW_GET_FUN(x) x
-
-#else /* GLEW_MX */
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define GLXEW_GET_FUN(x) x
-
-GLEWAPI GLboolean GLEWAPIENTRY glxewIsSupported (const char *name);
-
-#endif /* GLEW_MX */
-
-GLEWAPI GLboolean GLEWAPIENTRY glxewGetExtension (const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glxew_h__ */
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/wglew.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/wglew.h
deleted file mode 100644
index 8659841d35..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/CustomGL/wglew.h
+++ /dev/null
@@ -1,1421 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author 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.
-*/
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-**
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are 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 Materials.
-**
-** THE MATERIALS ARE 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
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __wglew_h__
-#define __wglew_h__
-#define __WGLEW_H__
-
-#ifdef __wglext_h_
-#error wglext.h included before wglew.h
-#endif
-
-#define __wglext_h_
-
-#if !defined(WINAPI)
-# ifndef WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN 1
-# endif
-#include <windows.h>
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
-/*
- * GLEW_STATIC needs to be set when using the static version.
- * GLEW_BUILD is set when building the DLL version.
- */
-#ifdef GLEW_STATIC
-# define GLEWAPI extern
-#else
-# ifdef GLEW_BUILD
-# define GLEWAPI extern __declspec(dllexport)
-# else
-# define GLEWAPI extern __declspec(dllimport)
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* -------------------------- WGL_3DFX_multisample ------------------------- */
-
-#ifndef WGL_3DFX_multisample
-#define WGL_3DFX_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
-#define WGL_SAMPLES_3DFX 0x2061
-
-#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample)
-
-#endif /* WGL_3DFX_multisample */
-
-/* ------------------------- WGL_3DL_stereo_control ------------------------ */
-
-#ifndef WGL_3DL_stereo_control
-#define WGL_3DL_stereo_control 1
-
-#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
-#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
-#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
-#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
-
-typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
-
-#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL)
-
-#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control)
-
-#endif /* WGL_3DL_stereo_control */
-
-/* ------------------------ WGL_AMD_gpu_association ------------------------ */
-
-#ifndef WGL_AMD_gpu_association
-#define WGL_AMD_gpu_association 1
-
-#define WGL_GPU_VENDOR_AMD 0x1F00
-#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
-#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define WGL_GPU_RAM_AMD 0x21A3
-#define WGL_GPU_CLOCK_AMD 0x21A4
-#define WGL_GPU_NUM_PIPES_AMD 0x21A5
-#define WGL_GPU_NUM_SIMD_AMD 0x21A6
-#define WGL_GPU_NUM_RB_AMD 0x21A7
-#define WGL_GPU_NUM_SPI_AMD 0x21A8
-
-typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
-typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList);
-typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
-typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
-typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
-typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids);
-typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data);
-typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
-
-#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD)
-#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD)
-#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD)
-#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD)
-#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD)
-#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD)
-#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD)
-#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD)
-#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD)
-
-#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association)
-
-#endif /* WGL_AMD_gpu_association */
-
-/* ------------------------- WGL_ARB_buffer_region ------------------------- */
-
-#ifndef WGL_ARB_buffer_region
-#define WGL_ARB_buffer_region 1
-
-#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
-#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
-#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
-#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
-
-typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
-typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
-typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
-typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
-
-#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB)
-#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB)
-#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB)
-#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB)
-
-#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region)
-
-#endif /* WGL_ARB_buffer_region */
-
-/* ------------------------- WGL_ARB_create_context ------------------------ */
-
-#ifndef WGL_ARB_create_context
-#define WGL_ARB_create_context 1
-
-#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
-#define WGL_CONTEXT_FLAGS_ARB 0x2094
-#define ERROR_INVALID_VERSION_ARB 0x2095
-#define ERROR_INVALID_PROFILE_ARB 0x2096
-
-typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList);
-
-#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB)
-
-#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context)
-
-#endif /* WGL_ARB_create_context */
-
-/* --------------------- WGL_ARB_create_context_profile -------------------- */
-
-#ifndef WGL_ARB_create_context_profile
-#define WGL_ARB_create_context_profile 1
-
-#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
-
-#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile)
-
-#endif /* WGL_ARB_create_context_profile */
-
-/* ------------------- WGL_ARB_create_context_robustness ------------------- */
-
-#ifndef WGL_ARB_create_context_robustness
-#define WGL_ARB_create_context_robustness 1
-
-#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
-
-#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness)
-
-#endif /* WGL_ARB_create_context_robustness */
-
-/* ----------------------- WGL_ARB_extensions_string ----------------------- */
-
-#ifndef WGL_ARB_extensions_string
-#define WGL_ARB_extensions_string 1
-
-typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
-
-#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB)
-
-#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string)
-
-#endif /* WGL_ARB_extensions_string */
-
-/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */
-
-#ifndef WGL_ARB_framebuffer_sRGB
-#define WGL_ARB_framebuffer_sRGB 1
-
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
-
-#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB)
-
-#endif /* WGL_ARB_framebuffer_sRGB */
-
-/* ----------------------- WGL_ARB_make_current_read ----------------------- */
-
-#ifndef WGL_ARB_make_current_read
-#define WGL_ARB_make_current_read 1
-
-#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
-#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
-
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-
-#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB)
-#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB)
-
-#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read)
-
-#endif /* WGL_ARB_make_current_read */
-
-/* -------------------------- WGL_ARB_multisample -------------------------- */
-
-#ifndef WGL_ARB_multisample
-#define WGL_ARB_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_ARB 0x2041
-#define WGL_SAMPLES_ARB 0x2042
-
-#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample)
-
-#endif /* WGL_ARB_multisample */
-
-/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */
-
-#ifndef WGL_ARB_pbuffer
-#define WGL_ARB_pbuffer 1
-
-#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
-#define WGL_PBUFFER_LARGEST_ARB 0x2033
-#define WGL_PBUFFER_WIDTH_ARB 0x2034
-#define WGL_PBUFFER_HEIGHT_ARB 0x2035
-#define WGL_PBUFFER_LOST_ARB 0x2036
-
-DECLARE_HANDLE(HPBUFFERARB);
-
-typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
-
-#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB)
-#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB)
-#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB)
-#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB)
-#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB)
-
-#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer)
-
-#endif /* WGL_ARB_pbuffer */
-
-/* -------------------------- WGL_ARB_pixel_format ------------------------- */
-
-#ifndef WGL_ARB_pixel_format
-#define WGL_ARB_pixel_format 1
-
-#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
-#define WGL_DRAW_TO_WINDOW_ARB 0x2001
-#define WGL_DRAW_TO_BITMAP_ARB 0x2002
-#define WGL_ACCELERATION_ARB 0x2003
-#define WGL_NEED_PALETTE_ARB 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
-#define WGL_SWAP_METHOD_ARB 0x2007
-#define WGL_NUMBER_OVERLAYS_ARB 0x2008
-#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
-#define WGL_TRANSPARENT_ARB 0x200A
-#define WGL_SHARE_DEPTH_ARB 0x200C
-#define WGL_SHARE_STENCIL_ARB 0x200D
-#define WGL_SHARE_ACCUM_ARB 0x200E
-#define WGL_SUPPORT_GDI_ARB 0x200F
-#define WGL_SUPPORT_OPENGL_ARB 0x2010
-#define WGL_DOUBLE_BUFFER_ARB 0x2011
-#define WGL_STEREO_ARB 0x2012
-#define WGL_PIXEL_TYPE_ARB 0x2013
-#define WGL_COLOR_BITS_ARB 0x2014
-#define WGL_RED_BITS_ARB 0x2015
-#define WGL_RED_SHIFT_ARB 0x2016
-#define WGL_GREEN_BITS_ARB 0x2017
-#define WGL_GREEN_SHIFT_ARB 0x2018
-#define WGL_BLUE_BITS_ARB 0x2019
-#define WGL_BLUE_SHIFT_ARB 0x201A
-#define WGL_ALPHA_BITS_ARB 0x201B
-#define WGL_ALPHA_SHIFT_ARB 0x201C
-#define WGL_ACCUM_BITS_ARB 0x201D
-#define WGL_ACCUM_RED_BITS_ARB 0x201E
-#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
-#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
-#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
-#define WGL_DEPTH_BITS_ARB 0x2022
-#define WGL_STENCIL_BITS_ARB 0x2023
-#define WGL_AUX_BUFFERS_ARB 0x2024
-#define WGL_NO_ACCELERATION_ARB 0x2025
-#define WGL_GENERIC_ACCELERATION_ARB 0x2026
-#define WGL_FULL_ACCELERATION_ARB 0x2027
-#define WGL_SWAP_EXCHANGE_ARB 0x2028
-#define WGL_SWAP_COPY_ARB 0x2029
-#define WGL_SWAP_UNDEFINED_ARB 0x202A
-#define WGL_TYPE_RGBA_ARB 0x202B
-#define WGL_TYPE_COLORINDEX_ARB 0x202C
-#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
-#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
-#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
-#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
-#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
-
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues);
-
-#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB)
-#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB)
-#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB)
-
-#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format)
-
-#endif /* WGL_ARB_pixel_format */
-
-/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */
-
-#ifndef WGL_ARB_pixel_format_float
-#define WGL_ARB_pixel_format_float 1
-
-#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
-
-#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float)
-
-#endif /* WGL_ARB_pixel_format_float */
-
-/* ------------------------- WGL_ARB_render_texture ------------------------ */
-
-#ifndef WGL_ARB_render_texture
-#define WGL_ARB_render_texture 1
-
-#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
-#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
-#define WGL_TEXTURE_FORMAT_ARB 0x2072
-#define WGL_TEXTURE_TARGET_ARB 0x2073
-#define WGL_MIPMAP_TEXTURE_ARB 0x2074
-#define WGL_TEXTURE_RGB_ARB 0x2075
-#define WGL_TEXTURE_RGBA_ARB 0x2076
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
-#define WGL_TEXTURE_1D_ARB 0x2079
-#define WGL_TEXTURE_2D_ARB 0x207A
-#define WGL_MIPMAP_LEVEL_ARB 0x207B
-#define WGL_CUBE_MAP_FACE_ARB 0x207C
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
-#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
-#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
-#define WGL_FRONT_LEFT_ARB 0x2083
-#define WGL_FRONT_RIGHT_ARB 0x2084
-#define WGL_BACK_LEFT_ARB 0x2085
-#define WGL_BACK_RIGHT_ARB 0x2086
-#define WGL_AUX0_ARB 0x2087
-#define WGL_AUX1_ARB 0x2088
-#define WGL_AUX2_ARB 0x2089
-#define WGL_AUX3_ARB 0x208A
-#define WGL_AUX4_ARB 0x208B
-#define WGL_AUX5_ARB 0x208C
-#define WGL_AUX6_ARB 0x208D
-#define WGL_AUX7_ARB 0x208E
-#define WGL_AUX8_ARB 0x208F
-#define WGL_AUX9_ARB 0x2090
-
-typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
-typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList);
-
-#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB)
-#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB)
-#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB)
-
-#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture)
-
-#endif /* WGL_ARB_render_texture */
-
-/* ---------------- WGL_ARB_robustness_application_isolation --------------- */
-
-#ifndef WGL_ARB_robustness_application_isolation
-#define WGL_ARB_robustness_application_isolation 1
-
-#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
-
-#define WGLEW_ARB_robustness_application_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_application_isolation)
-
-#endif /* WGL_ARB_robustness_application_isolation */
-
-/* ---------------- WGL_ARB_robustness_share_group_isolation --------------- */
-
-#ifndef WGL_ARB_robustness_share_group_isolation
-#define WGL_ARB_robustness_share_group_isolation 1
-
-#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
-
-#define WGLEW_ARB_robustness_share_group_isolation WGLEW_GET_VAR(__WGLEW_ARB_robustness_share_group_isolation)
-
-#endif /* WGL_ARB_robustness_share_group_isolation */
-
-/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */
-
-#ifndef WGL_ATI_pixel_format_float
-#define WGL_ATI_pixel_format_float 1
-
-#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
-#define GL_RGBA_FLOAT_MODE_ATI 0x8820
-#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835
-
-#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float)
-
-#endif /* WGL_ATI_pixel_format_float */
-
-/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */
-
-#ifndef WGL_ATI_render_texture_rectangle
-#define WGL_ATI_render_texture_rectangle 1
-
-#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
-
-#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle)
-
-#endif /* WGL_ATI_render_texture_rectangle */
-
-/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */
-
-#ifndef WGL_EXT_create_context_es2_profile
-#define WGL_EXT_create_context_es2_profile 1
-
-#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-
-#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile)
-
-#endif /* WGL_EXT_create_context_es2_profile */
-
-/* ------------------- WGL_EXT_create_context_es_profile ------------------- */
-
-#ifndef WGL_EXT_create_context_es_profile
-#define WGL_EXT_create_context_es_profile 1
-
-#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
-
-#define WGLEW_EXT_create_context_es_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es_profile)
-
-#endif /* WGL_EXT_create_context_es_profile */
-
-/* -------------------------- WGL_EXT_depth_float -------------------------- */
-
-#ifndef WGL_EXT_depth_float
-#define WGL_EXT_depth_float 1
-
-#define WGL_DEPTH_FLOAT_EXT 0x2040
-
-#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float)
-
-#endif /* WGL_EXT_depth_float */
-
-/* ---------------------- WGL_EXT_display_color_table ---------------------- */
-
-#ifndef WGL_EXT_display_color_table
-#define WGL_EXT_display_color_table 1
-
-typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
-typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length);
-
-#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT)
-#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT)
-#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT)
-#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT)
-
-#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table)
-
-#endif /* WGL_EXT_display_color_table */
-
-/* ----------------------- WGL_EXT_extensions_string ----------------------- */
-
-#ifndef WGL_EXT_extensions_string
-#define WGL_EXT_extensions_string 1
-
-typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
-
-#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT)
-
-#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string)
-
-#endif /* WGL_EXT_extensions_string */
-
-/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */
-
-#ifndef WGL_EXT_framebuffer_sRGB
-#define WGL_EXT_framebuffer_sRGB 1
-
-#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
-
-#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB)
-
-#endif /* WGL_EXT_framebuffer_sRGB */
-
-/* ----------------------- WGL_EXT_make_current_read ----------------------- */
-
-#ifndef WGL_EXT_make_current_read
-#define WGL_EXT_make_current_read 1
-
-#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
-
-typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
-
-#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT)
-#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT)
-
-#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read)
-
-#endif /* WGL_EXT_make_current_read */
-
-/* -------------------------- WGL_EXT_multisample -------------------------- */
-
-#ifndef WGL_EXT_multisample
-#define WGL_EXT_multisample 1
-
-#define WGL_SAMPLE_BUFFERS_EXT 0x2041
-#define WGL_SAMPLES_EXT 0x2042
-
-#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample)
-
-#endif /* WGL_EXT_multisample */
-
-/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */
-
-#ifndef WGL_EXT_pbuffer
-#define WGL_EXT_pbuffer 1
-
-#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
-#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
-#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
-#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
-#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
-#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
-#define WGL_PBUFFER_LARGEST_EXT 0x2033
-#define WGL_PBUFFER_WIDTH_EXT 0x2034
-#define WGL_PBUFFER_HEIGHT_EXT 0x2035
-
-DECLARE_HANDLE(HPBUFFEREXT);
-
-typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList);
-typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
-typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
-typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue);
-typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
-
-#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT)
-#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT)
-#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT)
-#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT)
-#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT)
-
-#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer)
-
-#endif /* WGL_EXT_pbuffer */
-
-/* -------------------------- WGL_EXT_pixel_format ------------------------- */
-
-#ifndef WGL_EXT_pixel_format
-#define WGL_EXT_pixel_format 1
-
-#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
-#define WGL_DRAW_TO_WINDOW_EXT 0x2001
-#define WGL_DRAW_TO_BITMAP_EXT 0x2002
-#define WGL_ACCELERATION_EXT 0x2003
-#define WGL_NEED_PALETTE_EXT 0x2004
-#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
-#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
-#define WGL_SWAP_METHOD_EXT 0x2007
-#define WGL_NUMBER_OVERLAYS_EXT 0x2008
-#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
-#define WGL_TRANSPARENT_EXT 0x200A
-#define WGL_TRANSPARENT_VALUE_EXT 0x200B
-#define WGL_SHARE_DEPTH_EXT 0x200C
-#define WGL_SHARE_STENCIL_EXT 0x200D
-#define WGL_SHARE_ACCUM_EXT 0x200E
-#define WGL_SUPPORT_GDI_EXT 0x200F
-#define WGL_SUPPORT_OPENGL_EXT 0x2010
-#define WGL_DOUBLE_BUFFER_EXT 0x2011
-#define WGL_STEREO_EXT 0x2012
-#define WGL_PIXEL_TYPE_EXT 0x2013
-#define WGL_COLOR_BITS_EXT 0x2014
-#define WGL_RED_BITS_EXT 0x2015
-#define WGL_RED_SHIFT_EXT 0x2016
-#define WGL_GREEN_BITS_EXT 0x2017
-#define WGL_GREEN_SHIFT_EXT 0x2018
-#define WGL_BLUE_BITS_EXT 0x2019
-#define WGL_BLUE_SHIFT_EXT 0x201A
-#define WGL_ALPHA_BITS_EXT 0x201B
-#define WGL_ALPHA_SHIFT_EXT 0x201C
-#define WGL_ACCUM_BITS_EXT 0x201D
-#define WGL_ACCUM_RED_BITS_EXT 0x201E
-#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
-#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
-#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
-#define WGL_DEPTH_BITS_EXT 0x2022
-#define WGL_STENCIL_BITS_EXT 0x2023
-#define WGL_AUX_BUFFERS_EXT 0x2024
-#define WGL_NO_ACCELERATION_EXT 0x2025
-#define WGL_GENERIC_ACCELERATION_EXT 0x2026
-#define WGL_FULL_ACCELERATION_EXT 0x2027
-#define WGL_SWAP_EXCHANGE_EXT 0x2028
-#define WGL_SWAP_COPY_EXT 0x2029
-#define WGL_SWAP_UNDEFINED_EXT 0x202A
-#define WGL_TYPE_RGBA_EXT 0x202B
-#define WGL_TYPE_COLORINDEX_EXT 0x202C
-
-typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues);
-typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues);
-
-#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT)
-#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT)
-#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT)
-
-#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format)
-
-#endif /* WGL_EXT_pixel_format */
-
-/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */
-
-#ifndef WGL_EXT_pixel_format_packed_float
-#define WGL_EXT_pixel_format_packed_float 1
-
-#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
-
-#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float)
-
-#endif /* WGL_EXT_pixel_format_packed_float */
-
-/* -------------------------- WGL_EXT_swap_control ------------------------- */
-
-#ifndef WGL_EXT_swap_control
-#define WGL_EXT_swap_control 1
-
-typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
-typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
-
-#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT)
-#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT)
-
-#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control)
-
-#endif /* WGL_EXT_swap_control */
-
-/* ----------------------- WGL_EXT_swap_control_tear ----------------------- */
-
-#ifndef WGL_EXT_swap_control_tear
-#define WGL_EXT_swap_control_tear 1
-
-#define WGLEW_EXT_swap_control_tear WGLEW_GET_VAR(__WGLEW_EXT_swap_control_tear)
-
-#endif /* WGL_EXT_swap_control_tear */
-
-/* --------------------- WGL_I3D_digital_video_control --------------------- */
-
-#ifndef WGL_I3D_digital_video_control
-#define WGL_I3D_digital_video_control 1
-
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
-#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
-#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
-#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
-
-typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
-
-#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D)
-#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D)
-
-#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control)
-
-#endif /* WGL_I3D_digital_video_control */
-
-/* ----------------------------- WGL_I3D_gamma ----------------------------- */
-
-#ifndef WGL_I3D_gamma
-#define WGL_I3D_gamma 1
-
-#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
-#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
-
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue);
-typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue);
-typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue);
-
-#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D)
-#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D)
-#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D)
-#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D)
-
-#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma)
-
-#endif /* WGL_I3D_gamma */
-
-/* ---------------------------- WGL_I3D_genlock ---------------------------- */
-
-#ifndef WGL_I3D_genlock
-#define WGL_I3D_genlock 1
-
-#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
-#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
-#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
-#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
-#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
-#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
-#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
-#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
-#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
-
-typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
-typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge);
-typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource);
-typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag);
-typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay);
-
-#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D)
-#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D)
-#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D)
-#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D)
-#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D)
-#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D)
-#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D)
-#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D)
-#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D)
-#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D)
-#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D)
-#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D)
-
-#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock)
-
-#endif /* WGL_I3D_genlock */
-
-/* -------------------------- WGL_I3D_image_buffer ------------------------- */
-
-#ifndef WGL_I3D_image_buffer
-#define WGL_I3D_image_buffer 1
-
-#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
-#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
-
-typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count);
-typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
-typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
-typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count);
-
-#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D)
-#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D)
-#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D)
-#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D)
-
-#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer)
-
-#endif /* WGL_I3D_image_buffer */
-
-/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */
-
-#ifndef WGL_I3D_swap_frame_lock
-#define WGL_I3D_swap_frame_lock 1
-
-typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID);
-typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag);
-
-#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D)
-#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D)
-#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D)
-#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D)
-
-#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock)
-
-#endif /* WGL_I3D_swap_frame_lock */
-
-/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */
-
-#ifndef WGL_I3D_swap_frame_usage
-#define WGL_I3D_swap_frame_usage 1
-
-typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
-typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
-
-#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D)
-#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D)
-#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D)
-#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D)
-
-#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage)
-
-#endif /* WGL_I3D_swap_frame_usage */
-
-/* --------------------------- WGL_NV_DX_interop --------------------------- */
-
-#ifndef WGL_NV_DX_interop
-#define WGL_NV_DX_interop 1
-
-#define WGL_ACCESS_READ_ONLY_NV 0x0000
-#define WGL_ACCESS_READ_WRITE_NV 0x0001
-#define WGL_ACCESS_WRITE_DISCARD_NV 0x0002
-
-typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
-typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
-typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
-typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void* dxDevice);
-typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void* dxObject, GLuint name, GLenum type, GLenum access);
-typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void* dxObject, HANDLE shareHandle);
-typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE* hObjects);
-typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
-
-#define wglDXCloseDeviceNV WGLEW_GET_FUN(__wglewDXCloseDeviceNV)
-#define wglDXLockObjectsNV WGLEW_GET_FUN(__wglewDXLockObjectsNV)
-#define wglDXObjectAccessNV WGLEW_GET_FUN(__wglewDXObjectAccessNV)
-#define wglDXOpenDeviceNV WGLEW_GET_FUN(__wglewDXOpenDeviceNV)
-#define wglDXRegisterObjectNV WGLEW_GET_FUN(__wglewDXRegisterObjectNV)
-#define wglDXSetResourceShareHandleNV WGLEW_GET_FUN(__wglewDXSetResourceShareHandleNV)
-#define wglDXUnlockObjectsNV WGLEW_GET_FUN(__wglewDXUnlockObjectsNV)
-#define wglDXUnregisterObjectNV WGLEW_GET_FUN(__wglewDXUnregisterObjectNV)
-
-#define WGLEW_NV_DX_interop WGLEW_GET_VAR(__WGLEW_NV_DX_interop)
-
-#endif /* WGL_NV_DX_interop */
-
-/* --------------------------- WGL_NV_DX_interop2 -------------------------- */
-
-#ifndef WGL_NV_DX_interop2
-#define WGL_NV_DX_interop2 1
-
-#define WGLEW_NV_DX_interop2 WGLEW_GET_VAR(__WGLEW_NV_DX_interop2)
-
-#endif /* WGL_NV_DX_interop2 */
-
-/* --------------------------- WGL_NV_copy_image --------------------------- */
-
-#ifndef WGL_NV_copy_image
-#define WGL_NV_copy_image 1
-
-typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV)
-
-#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image)
-
-#endif /* WGL_NV_copy_image */
-
-/* -------------------------- WGL_NV_float_buffer -------------------------- */
-
-#ifndef WGL_NV_float_buffer
-#define WGL_NV_float_buffer 1
-
-#define WGL_FLOAT_COMPONENTS_NV 0x20B0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
-#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
-#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
-#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
-#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
-
-#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer)
-
-#endif /* WGL_NV_float_buffer */
-
-/* -------------------------- WGL_NV_gpu_affinity -------------------------- */
-
-#ifndef WGL_NV_gpu_affinity
-#define WGL_NV_gpu_affinity 1
-
-#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
-#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
-
-DECLARE_HANDLE(HGPUNV);
-typedef struct _GPU_DEVICE {
- DWORD cb;
- CHAR DeviceName[32];
- CHAR DeviceString[128];
- DWORD Flags;
- RECT rcVirtualScreen;
-} GPU_DEVICE, *PGPU_DEVICE;
-
-typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
-typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
-typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
-typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
-
-#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV)
-#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV)
-#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV)
-#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV)
-#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV)
-
-#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity)
-
-#endif /* WGL_NV_gpu_affinity */
-
-/* ---------------------- WGL_NV_multisample_coverage ---------------------- */
-
-#ifndef WGL_NV_multisample_coverage
-#define WGL_NV_multisample_coverage 1
-
-#define WGL_COVERAGE_SAMPLES_NV 0x2042
-#define WGL_COLOR_SAMPLES_NV 0x20B9
-
-#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage)
-
-#endif /* WGL_NV_multisample_coverage */
-
-/* -------------------------- WGL_NV_present_video ------------------------- */
-
-#ifndef WGL_NV_present_video
-#define WGL_NV_present_video 1
-
-#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
-
-DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList);
-typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList);
-typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue);
-
-#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV)
-#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV)
-#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV)
-
-#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video)
-
-#endif /* WGL_NV_present_video */
-
-/* ---------------------- WGL_NV_render_depth_texture ---------------------- */
-
-#ifndef WGL_NV_render_depth_texture
-#define WGL_NV_render_depth_texture 1
-
-#define WGL_NO_TEXTURE_ARB 0x2077
-#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
-#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
-#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
-#define WGL_DEPTH_COMPONENT_NV 0x20A7
-
-#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture)
-
-#endif /* WGL_NV_render_depth_texture */
-
-/* -------------------- WGL_NV_render_texture_rectangle -------------------- */
-
-#ifndef WGL_NV_render_texture_rectangle
-#define WGL_NV_render_texture_rectangle 1
-
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
-#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
-#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
-
-#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle)
-
-#endif /* WGL_NV_render_texture_rectangle */
-
-/* --------------------------- WGL_NV_swap_group --------------------------- */
-
-#ifndef WGL_NV_swap_group
-#define WGL_NV_swap_group 1
-
-typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
-typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
-typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count);
-typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers);
-typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier);
-typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
-
-#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV)
-#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV)
-#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV)
-#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV)
-#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV)
-#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV)
-
-#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group)
-
-#endif /* WGL_NV_swap_group */
-
-/* ----------------------- WGL_NV_vertex_array_range ----------------------- */
-
-#ifndef WGL_NV_vertex_array_range
-#define WGL_NV_vertex_array_range 1
-
-typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
-
-#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV)
-#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV)
-
-#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range)
-
-#endif /* WGL_NV_vertex_array_range */
-
-/* -------------------------- WGL_NV_video_capture ------------------------- */
-
-#ifndef WGL_NV_video_capture
-#define WGL_NV_video_capture 1
-
-#define WGL_UNIQUE_ID_NV 0x20CE
-#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-
-DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
-typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV* phDeviceList);
-typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int* piValue);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
-
-#define wglBindVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewBindVideoCaptureDeviceNV)
-#define wglEnumerateVideoCaptureDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoCaptureDevicesNV)
-#define wglLockVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewLockVideoCaptureDeviceNV)
-#define wglQueryVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewQueryVideoCaptureDeviceNV)
-#define wglReleaseVideoCaptureDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoCaptureDeviceNV)
-
-#define WGLEW_NV_video_capture WGLEW_GET_VAR(__WGLEW_NV_video_capture)
-
-#endif /* WGL_NV_video_capture */
-
-/* -------------------------- WGL_NV_video_output -------------------------- */
-
-#ifndef WGL_NV_video_output
-#define WGL_NV_video_output 1
-
-#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
-#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
-#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
-#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
-#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
-#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
-#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define WGL_VIDEO_OUT_FRAME 0x20C8
-#define WGL_VIDEO_OUT_FIELD_1 0x20C9
-#define WGL_VIDEO_OUT_FIELD_2 0x20CA
-#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
-#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
-
-DECLARE_HANDLE(HPVIDEODEV);
-
-typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
-typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
-typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock);
-
-#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV)
-#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV)
-#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV)
-#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV)
-#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV)
-#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV)
-
-#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output)
-
-#endif /* WGL_NV_video_output */
-
-/* -------------------------- WGL_OML_sync_control ------------------------- */
-
-#ifndef WGL_OML_sync_control
-#define WGL_OML_sync_control 1
-
-typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator);
-typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc);
-typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
-typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc);
-typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc);
-
-#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML)
-#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML)
-#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML)
-#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML)
-#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML)
-#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML)
-
-#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control)
-
-#endif /* WGL_OML_sync_control */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-#define WGLEW_FUN_EXPORT
-#define WGLEW_VAR_EXPORT
-#else
-#define WGLEW_FUN_EXPORT GLEW_FUN_EXPORT
-#define WGLEW_VAR_EXPORT GLEW_VAR_EXPORT
-#endif /* GLEW_MX */
-
-#ifdef GLEW_MX
-struct WGLEWContextStruct
-{
-#endif /* GLEW_MX */
-
-WGLEW_FUN_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL;
-
-WGLEW_FUN_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD;
-WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD;
-WGLEW_FUN_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD;
-WGLEW_FUN_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD;
-WGLEW_FUN_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD;
-WGLEW_FUN_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD;
-WGLEW_FUN_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD;
-WGLEW_FUN_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD;
-WGLEW_FUN_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD;
-
-WGLEW_FUN_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB;
-WGLEW_FUN_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB;
-WGLEW_FUN_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB;
-WGLEW_FUN_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB;
-
-WGLEW_FUN_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB;
-
-WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB;
-
-WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB;
-WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB;
-
-WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB;
-WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB;
-WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB;
-WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB;
-WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB;
-
-WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB;
-WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB;
-WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB;
-
-WGLEW_FUN_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB;
-WGLEW_FUN_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB;
-WGLEW_FUN_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB;
-
-WGLEW_FUN_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT;
-WGLEW_FUN_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT;
-WGLEW_FUN_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT;
-WGLEW_FUN_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT;
-
-WGLEW_FUN_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT;
-
-WGLEW_FUN_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT;
-WGLEW_FUN_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT;
-
-WGLEW_FUN_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT;
-WGLEW_FUN_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT;
-WGLEW_FUN_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT;
-WGLEW_FUN_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT;
-WGLEW_FUN_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT;
-
-WGLEW_FUN_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT;
-WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT;
-WGLEW_FUN_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT;
-
-WGLEW_FUN_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT;
-WGLEW_FUN_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT;
-
-WGLEW_FUN_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D;
-WGLEW_FUN_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D;
-
-WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D;
-WGLEW_FUN_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D;
-WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D;
-WGLEW_FUN_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D;
-
-WGLEW_FUN_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D;
-WGLEW_FUN_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D;
-WGLEW_FUN_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D;
-WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D;
-WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D;
-WGLEW_FUN_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D;
-WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D;
-WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D;
-WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D;
-WGLEW_FUN_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D;
-WGLEW_FUN_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D;
-WGLEW_FUN_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D;
-
-WGLEW_FUN_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D;
-WGLEW_FUN_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D;
-WGLEW_FUN_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D;
-WGLEW_FUN_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D;
-
-WGLEW_FUN_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D;
-WGLEW_FUN_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D;
-WGLEW_FUN_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D;
-WGLEW_FUN_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D;
-
-WGLEW_FUN_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D;
-WGLEW_FUN_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D;
-WGLEW_FUN_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D;
-WGLEW_FUN_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D;
-
-WGLEW_FUN_EXPORT PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV;
-WGLEW_FUN_EXPORT PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV;
-WGLEW_FUN_EXPORT PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV;
-WGLEW_FUN_EXPORT PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV;
-WGLEW_FUN_EXPORT PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV;
-WGLEW_FUN_EXPORT PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV;
-
-WGLEW_FUN_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV;
-
-WGLEW_FUN_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV;
-WGLEW_FUN_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV;
-WGLEW_FUN_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV;
-WGLEW_FUN_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV;
-WGLEW_FUN_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV;
-
-WGLEW_FUN_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV;
-WGLEW_FUN_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV;
-
-WGLEW_FUN_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV;
-WGLEW_FUN_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV;
-WGLEW_FUN_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV;
-WGLEW_FUN_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV;
-WGLEW_FUN_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV;
-WGLEW_FUN_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV;
-
-WGLEW_FUN_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV;
-WGLEW_FUN_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV;
-
-WGLEW_FUN_EXPORT PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV;
-WGLEW_FUN_EXPORT PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV;
-
-WGLEW_FUN_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV;
-WGLEW_FUN_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV;
-WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV;
-WGLEW_FUN_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV;
-WGLEW_FUN_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV;
-
-WGLEW_FUN_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML;
-WGLEW_FUN_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML;
-WGLEW_FUN_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML;
-WGLEW_FUN_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML;
-WGLEW_FUN_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML;
-WGLEW_FUN_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_3DFX_multisample;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_3DL_stereo_control;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_AMD_gpu_association;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_buffer_region;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_profile;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_create_context_robustness;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_extensions_string;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_make_current_read;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_multisample;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pbuffer;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_pixel_format_float;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_render_texture;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_application_isolation;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ARB_robustness_share_group_isolation;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_pixel_format_float;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_create_context_es_profile;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_depth_float;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_display_color_table;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_extensions_string;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_make_current_read;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_multisample;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pbuffer;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_EXT_swap_control_tear;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_digital_video_control;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_gamma;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_genlock;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_image_buffer;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_DX_interop2;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_copy_image;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_float_buffer;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_gpu_affinity;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_multisample_coverage;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_present_video;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_depth_texture;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_swap_group;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_vertex_array_range;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_capture;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_NV_video_output;
-WGLEW_VAR_EXPORT GLboolean __WGLEW_OML_sync_control;
-
-#ifdef GLEW_MX
-}; /* WGLEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-
-typedef struct WGLEWContextStruct WGLEWContext;
-GLEWAPI GLenum GLEWAPIENTRY wglewContextInit (WGLEWContext *ctx);
-GLEWAPI GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext *ctx, const char *name);
-
-#define wglewInit() wglewContextInit(wglewGetContext())
-#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x)
-
-#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x))
-#define WGLEW_GET_FUN(x) wglewGetContext()->x
-
-#else /* GLEW_MX */
-
-#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define WGLEW_GET_FUN(x) x
-
-GLEWAPI GLboolean GLEWAPIENTRY wglewIsSupported (const char *name);
-
-#endif /* GLEW_MX */
-
-GLEWAPI GLboolean GLEWAPIENTRY wglewGetExtension (const char *name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#undef GLEWAPI
-
-#endif /* __wglew_h__ */
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/glew.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/glew.c
deleted file mode 100644
index 1be61489e0..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/Glew/glew.c
+++ /dev/null
@@ -1,18897 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-**
-** Redistribution and use in source and binary forms, with or without
-** modification, are permitted provided that the following conditions are met:
-**
-** * Redistributions of source code must retain the above copyright notice,
-** this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice,
-** this list of conditions and the following disclaimer in the documentation
-** and/or other materials provided with the distribution.
-** * The name of the author 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.
-*/
-
-#include "CustomGL/glew.h"
-
-#if defined(_WIN32)
-# include <CustomGL/wglew.h>
-#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
-# include "CustomGL/glxew.h"
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void* dlglXGetProcAddressARB(const GLubyte* name)
-{
- static void* h = NULL;
- static void* gpa;
-
- if (h == NULL)
- {
- if ((h = dlopen("libGL.so.1", RTLD_LAZY | RTLD_LOCAL)) == NULL)
- {
- return NULL;
- }
- gpa = dlsym(h, "glXGetProcAddressARB");
- }
-
- if (gpa != NULL)
- return ((void*(*)(const GLubyte*))gpa)(name);
- else
- return dlsym(h, (const char*)name);
-}
-
-
-
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#endif
-
-/*
- * Define glewGetContext and related helper macros.
- */
-#ifdef GLEW_MX
-# define glewGetContext() ctx
-# ifdef _WIN32
-# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx
-# define GLEW_CONTEXT_ARG_VAR_INIT ctx
-# define wglewGetContext() ctx
-# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx
-# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx
-# else /* _WIN32 */
-# define GLEW_CONTEXT_ARG_DEF_INIT void
-# define GLEW_CONTEXT_ARG_VAR_INIT
-# define glxewGetContext() ctx
-# define GLXEW_CONTEXT_ARG_DEF_INIT void
-# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx
-# endif /* _WIN32 */
-# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx
-#else /* GLEW_MX */
-# define GLEW_CONTEXT_ARG_DEF_INIT void
-# define GLEW_CONTEXT_ARG_VAR_INIT
-# define GLEW_CONTEXT_ARG_DEF_LIST void
-# define WGLEW_CONTEXT_ARG_DEF_INIT void
-# define WGLEW_CONTEXT_ARG_DEF_LIST void
-# define GLXEW_CONTEXT_ARG_DEF_INIT void
-# define GLXEW_CONTEXT_ARG_DEF_LIST void
-#endif /* GLEW_MX */
-
-#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX)
-#include <dlfcn.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-void* dlGetProcAddress (const GLubyte* name)
-{
- static void* h = NULL;
- static void* gpa;
-
- if (h == NULL)
- {
- if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL;
- gpa = dlsym(h, "glXGetProcAddress");
- }
-
- if (gpa != NULL)
- return ((void*(*)(const GLubyte*))gpa)(name);
- else
- return dlsym(h, (const char*)name);
-}
-#endif /* __sgi || __sun || GLEW_APPLE_GLX */
-
-#if defined(__APPLE__)
-#include <stdlib.h>
-#include <string.h>
-#include <AvailabilityMacros.h>
-
-#ifdef MAC_OS_X_VERSION_10_3
-
-#include <dlfcn.h>
-
-void* NSGLGetProcAddress (const GLubyte *name)
-{
- static void* image = NULL;
- void* addr;
- if (NULL == image)
- {
-#ifdef GLEW_REGAL
- image = dlopen("libRegal.dylib", RTLD_LAZY);
-#else
- image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY);
-#endif
- }
- if( !image ) return NULL;
- addr = dlsym(image, (const char*)name);
- if( addr ) return addr;
-#ifdef GLEW_APPLE_GLX
- return dlGetProcAddress( name ); // try next for glx symbols
-#else
- return NULL;
-#endif
-}
-#else
-
-#include <mach-o/dyld.h>
-
-void* NSGLGetProcAddress (const GLubyte *name)
-{
- static const struct mach_header* image = NULL;
- NSSymbol symbol;
- char* symbolName;
- if (NULL == image)
- {
-#ifdef GLEW_REGAL
- image = NSAddImage("libRegal.dylib", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
-#else
- image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR);
-#endif
- }
- /* prepend a '_' for the Unix C symbol mangling convention */
- symbolName = malloc(strlen((const char*)name) + 2);
- strcpy(symbolName+1, (const char*)name);
- symbolName[0] = '_';
- symbol = NULL;
- /* if (NSIsSymbolNameDefined(symbolName))
- symbol = NSLookupAndBindSymbol(symbolName); */
- symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL;
- free(symbolName);
- if( symbol ) return NSAddressOfSymbol(symbol);
-#ifdef GLEW_APPLE_GLX
- return dlGetProcAddress( name ); // try next for glx symbols
-#else
- return NULL;
-#endif
-}
-#endif /* MAC_OS_X_VERSION_10_3 */
-#endif /* __APPLE__ */
-
-/*
- * Define glewGetProcAddress.
- */
-#if defined(_WIN32)
-# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name)
-#elif defined(__APPLE__) && !defined(GLEW_APPLE_GLX)
-# define glewGetProcAddress(name) NSGLGetProcAddress(name)
-#elif defined(__sgi) || defined(__sun)
-# define glewGetProcAddress(name) dlGetProcAddress(name)
-#elif defined(__ANDROID__)
-# define glewGetProcAddress(name) NULL /* TODO */
-#elif defined(__native_client__)
-# define glewGetProcAddress(name) NULL /* TODO */
-#else /* __linux */
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-# define glewGetProcAddress(name) dlglXGetProcAddressARB(name)
-#else//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name)
-#endif//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-#endif
-
-/*
- * Define GLboolean const cast.
- */
-#define CONST_CAST(x) (*(GLboolean*)&x)
-
-/*
- * GLEW, just like OpenGL or GLU, does not rely on the standard C library.
- * These functions implement the functionality required in this file.
- */
-static GLuint _glewStrLen (const GLubyte* s)
-{
- GLuint i=0;
- if (s == NULL) return 0;
- while (s[i] != '\0') i++;
- return i;
-}
-
-static GLuint _glewStrCLen (const GLubyte* s, GLubyte c)
-{
- GLuint i=0;
- if (s == NULL) return 0;
- while (s[i] != '\0' && s[i] != c) i++;
- return (s[i] == '\0' || s[i] == c) ? i : 0;
-}
-
-static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n)
-{
- GLuint i=0;
- if(a == NULL || b == NULL)
- return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE;
- while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++;
- return i == n ? GL_TRUE : GL_FALSE;
-}
-
-static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
-{
- while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t'))
- {
- (*a)++;
- (*na)--;
- }
- if(*na >= nb)
- {
- GLuint i=0;
- while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
- if(i == nb)
- {
- *a = *a + nb;
- *na = *na - nb;
- return GL_TRUE;
- }
- }
- return GL_FALSE;
-}
-
-static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
-{
- if(*na >= nb)
- {
- GLuint i=0;
- while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
- if(i == nb)
- {
- *a = *a + nb;
- *na = *na - nb;
- return GL_TRUE;
- }
- }
- return GL_FALSE;
-}
-
-static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb)
-{
- if(*na >= nb)
- {
- GLuint i=0;
- while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++;
- if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t'))
- {
- *a = *a + nb;
- *na = *na - nb;
- return GL_TRUE;
- }
- }
- return GL_FALSE;
-}
-
-/*
- * Search for name in the extensions string. Use of strstr()
- * is not sufficient because extension names can be prefixes of
- * other extension names. Could use strtok() but the constant
- * string returned by glGetString might be in read-only memory.
- */
-static GLboolean _glewSearchExtension (const char* name, const GLubyte *start, const GLubyte *end)
-{
- const GLubyte* p;
- GLuint len = _glewStrLen((const GLubyte*)name);
- p = start;
- while (p < end)
- {
- GLuint n = _glewStrCLen(p, ' ');
- if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE;
- p += n+1;
- }
- return GL_FALSE;
-}
-
-#if !defined(_WIN32) || !defined(GLEW_MX)
-
-PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL;
-PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL;
-PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL;
-PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL;
-
-PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL;
-PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL;
-PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL;
-PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL;
-PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL;
-PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL;
-PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL;
-PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL;
-PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL;
-PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL;
-PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL;
-PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL;
-PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL;
-PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL;
-PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL;
-PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL;
-PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL;
-PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL;
-PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL;
-PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL;
-PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL;
-PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL;
-PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL;
-PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL;
-PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL;
-PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL;
-PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL;
-PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL;
-PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL;
-PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL;
-PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL;
-PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL;
-PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL;
-PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL;
-PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL;
-PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL;
-PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL;
-PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL;
-PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL;
-PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL;
-PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL;
-PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL;
-PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL;
-
-PFNGLBLENDCOLORPROC __glewBlendColor = NULL;
-PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL;
-PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL;
-PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL;
-PFNGLFOGCOORDDPROC __glewFogCoordd = NULL;
-PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL;
-PFNGLFOGCOORDFPROC __glewFogCoordf = NULL;
-PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL;
-PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL;
-PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL;
-PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL;
-PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL;
-PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL;
-PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL;
-PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL;
-PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL;
-PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL;
-PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL;
-PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL;
-PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL;
-PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL;
-PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL;
-PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL;
-PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL;
-PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL;
-PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL;
-PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL;
-PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL;
-PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL;
-PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL;
-PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL;
-PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL;
-PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL;
-PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL;
-PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL;
-PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL;
-PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL;
-PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL;
-PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL;
-PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL;
-PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL;
-PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL;
-PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL;
-PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL;
-PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL;
-PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL;
-PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL;
-
-PFNGLBEGINQUERYPROC __glewBeginQuery = NULL;
-PFNGLBINDBUFFERPROC __glewBindBuffer = NULL;
-PFNGLBUFFERDATAPROC __glewBufferData = NULL;
-PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL;
-PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL;
-PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL;
-PFNGLENDQUERYPROC __glewEndQuery = NULL;
-PFNGLGENBUFFERSPROC __glewGenBuffers = NULL;
-PFNGLGENQUERIESPROC __glewGenQueries = NULL;
-PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL;
-PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL;
-PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL;
-PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL;
-PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL;
-PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL;
-PFNGLISBUFFERPROC __glewIsBuffer = NULL;
-PFNGLISQUERYPROC __glewIsQuery = NULL;
-PFNGLMAPBUFFERPROC __glewMapBuffer = NULL;
-PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL;
-
-PFNGLATTACHSHADERPROC __glewAttachShader = NULL;
-PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL;
-PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL;
-PFNGLCOMPILESHADERPROC __glewCompileShader = NULL;
-PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL;
-PFNGLCREATESHADERPROC __glewCreateShader = NULL;
-PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL;
-PFNGLDELETESHADERPROC __glewDeleteShader = NULL;
-PFNGLDETACHSHADERPROC __glewDetachShader = NULL;
-PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL;
-PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL;
-PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL;
-PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL;
-PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL;
-PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL;
-PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL;
-PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL;
-PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL;
-PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL;
-PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL;
-PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL;
-PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL;
-PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL;
-PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL;
-PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL;
-PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL;
-PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL;
-PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL;
-PFNGLISPROGRAMPROC __glewIsProgram = NULL;
-PFNGLISSHADERPROC __glewIsShader = NULL;
-PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL;
-PFNGLSHADERSOURCEPROC __glewShaderSource = NULL;
-PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL;
-PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL;
-PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL;
-PFNGLUNIFORM1FPROC __glewUniform1f = NULL;
-PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL;
-PFNGLUNIFORM1IPROC __glewUniform1i = NULL;
-PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL;
-PFNGLUNIFORM2FPROC __glewUniform2f = NULL;
-PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL;
-PFNGLUNIFORM2IPROC __glewUniform2i = NULL;
-PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL;
-PFNGLUNIFORM3FPROC __glewUniform3f = NULL;
-PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL;
-PFNGLUNIFORM3IPROC __glewUniform3i = NULL;
-PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL;
-PFNGLUNIFORM4FPROC __glewUniform4f = NULL;
-PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL;
-PFNGLUNIFORM4IPROC __glewUniform4i = NULL;
-PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL;
-PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL;
-PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL;
-PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL;
-PFNGLUSEPROGRAMPROC __glewUseProgram = NULL;
-PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL;
-PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL;
-PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL;
-PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL;
-PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL;
-PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL;
-PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL;
-PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL;
-PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL;
-PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL;
-PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL;
-PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL;
-PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL;
-PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL;
-PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL;
-PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL;
-PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL;
-PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL;
-PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL;
-PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL;
-PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL;
-PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL;
-PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL;
-PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL;
-PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL;
-PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL;
-PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL;
-PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL;
-PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL;
-PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL;
-PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL;
-PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL;
-PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL;
-PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL;
-PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL;
-PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL;
-PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL;
-PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL;
-
-PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL;
-PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL;
-PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL;
-PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL;
-PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL;
-PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL;
-
-PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL;
-PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL;
-PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL;
-PFNGLCLAMPCOLORPROC __glewClampColor = NULL;
-PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL;
-PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL;
-PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL;
-PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL;
-PFNGLCOLORMASKIPROC __glewColorMaski = NULL;
-PFNGLDISABLEIPROC __glewDisablei = NULL;
-PFNGLENABLEIPROC __glewEnablei = NULL;
-PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL;
-PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL;
-PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL;
-PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL;
-PFNGLGETSTRINGIPROC __glewGetStringi = NULL;
-PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL;
-PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL;
-PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL;
-PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL;
-PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL;
-PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL;
-PFNGLISENABLEDIPROC __glewIsEnabledi = NULL;
-PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL;
-PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL;
-PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL;
-PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL;
-PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL;
-PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL;
-PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL;
-PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL;
-PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL;
-PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL;
-PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL;
-PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL;
-PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL;
-PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL;
-PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL;
-PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL;
-PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL;
-PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL;
-PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL;
-PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL;
-PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL;
-PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL;
-PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL;
-PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL;
-PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL;
-PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL;
-PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL;
-PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL;
-PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL;
-PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL;
-PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL;
-PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL;
-
-PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL;
-PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL;
-PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL;
-PFNGLTEXBUFFERPROC __glewTexBuffer = NULL;
-
-PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL;
-PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL;
-PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL;
-
-PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL;
-
-PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL;
-PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL;
-PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL;
-PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL;
-PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL;
-
-PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL;
-
-PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL;
-PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL;
-PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL;
-PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL;
-
-PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL;
-PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL;
-PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL;
-PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL;
-
-PFNGLVERTEXATTRIBPARAMETERIAMDPROC __glewVertexAttribParameteriAMD = NULL;
-
-PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC __glewMultiDrawArraysIndirectAMD = NULL;
-PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC __glewMultiDrawElementsIndirectAMD = NULL;
-
-PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL;
-PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL;
-PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL;
-
-PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL;
-PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL;
-PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL;
-PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL;
-PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL;
-PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL;
-PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL;
-PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL;
-PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL;
-PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL;
-PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL;
-
-PFNGLSETMULTISAMPLEFVAMDPROC __glewSetMultisamplefvAMD = NULL;
-
-PFNGLTEXSTORAGESPARSEAMDPROC __glewTexStorageSparseAMD = NULL;
-PFNGLTEXTURESTORAGESPARSEAMDPROC __glewTextureStorageSparseAMD = NULL;
-
-PFNGLSTENCILOPVALUEAMDPROC __glewStencilOpValueAMD = NULL;
-
-PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL;
-PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL;
-
-PFNGLBLITFRAMEBUFFERANGLEPROC __glewBlitFramebufferANGLE = NULL;
-
-PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC __glewRenderbufferStorageMultisampleANGLE = NULL;
-
-PFNGLDRAWARRAYSINSTANCEDANGLEPROC __glewDrawArraysInstancedANGLE = NULL;
-PFNGLDRAWELEMENTSINSTANCEDANGLEPROC __glewDrawElementsInstancedANGLE = NULL;
-PFNGLVERTEXATTRIBDIVISORANGLEPROC __glewVertexAttribDivisorANGLE = NULL;
-
-PFNGLBEGINQUERYANGLEPROC __glewBeginQueryANGLE = NULL;
-PFNGLDELETEQUERIESANGLEPROC __glewDeleteQueriesANGLE = NULL;
-PFNGLENDQUERYANGLEPROC __glewEndQueryANGLE = NULL;
-PFNGLGENQUERIESANGLEPROC __glewGenQueriesANGLE = NULL;
-PFNGLGETQUERYOBJECTI64VANGLEPROC __glewGetQueryObjecti64vANGLE = NULL;
-PFNGLGETQUERYOBJECTIVANGLEPROC __glewGetQueryObjectivANGLE = NULL;
-PFNGLGETQUERYOBJECTUI64VANGLEPROC __glewGetQueryObjectui64vANGLE = NULL;
-PFNGLGETQUERYOBJECTUIVANGLEPROC __glewGetQueryObjectuivANGLE = NULL;
-PFNGLGETQUERYIVANGLEPROC __glewGetQueryivANGLE = NULL;
-PFNGLISQUERYANGLEPROC __glewIsQueryANGLE = NULL;
-PFNGLQUERYCOUNTERANGLEPROC __glewQueryCounterANGLE = NULL;
-
-PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC __glewGetTranslatedShaderSourceANGLE = NULL;
-
-PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL;
-PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL;
-PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL;
-PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL;
-PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL;
-
-PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL;
-PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL;
-PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL;
-PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL;
-PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL;
-PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL;
-PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL;
-PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL;
-
-PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL;
-PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL;
-
-PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL;
-PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL;
-PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL;
-
-PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL;
-PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL;
-
-PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL;
-PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL;
-PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL;
-PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL;
-
-PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL;
-PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL;
-PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL;
-
-PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL;
-PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL;
-PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL;
-PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL;
-PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL;
-PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL;
-PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL;
-
-PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL;
-PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL;
-PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL;
-PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL;
-PFNGLSHADERBINARYPROC __glewShaderBinary = NULL;
-
-PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC __glewDrawArraysInstancedBaseInstance = NULL;
-PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC __glewDrawElementsInstancedBaseInstance = NULL;
-PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC __glewDrawElementsInstancedBaseVertexBaseInstance = NULL;
-
-PFNGLGETIMAGEHANDLEARBPROC __glewGetImageHandleARB = NULL;
-PFNGLGETTEXTUREHANDLEARBPROC __glewGetTextureHandleARB = NULL;
-PFNGLGETTEXTURESAMPLERHANDLEARBPROC __glewGetTextureSamplerHandleARB = NULL;
-PFNGLGETVERTEXATTRIBLUI64VARBPROC __glewGetVertexAttribLui64vARB = NULL;
-PFNGLISIMAGEHANDLERESIDENTARBPROC __glewIsImageHandleResidentARB = NULL;
-PFNGLISTEXTUREHANDLERESIDENTARBPROC __glewIsTextureHandleResidentARB = NULL;
-PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC __glewMakeImageHandleNonResidentARB = NULL;
-PFNGLMAKEIMAGEHANDLERESIDENTARBPROC __glewMakeImageHandleResidentARB = NULL;
-PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC __glewMakeTextureHandleNonResidentARB = NULL;
-PFNGLMAKETEXTUREHANDLERESIDENTARBPROC __glewMakeTextureHandleResidentARB = NULL;
-PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC __glewProgramUniformHandleui64ARB = NULL;
-PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC __glewProgramUniformHandleui64vARB = NULL;
-PFNGLUNIFORMHANDLEUI64ARBPROC __glewUniformHandleui64ARB = NULL;
-PFNGLUNIFORMHANDLEUI64VARBPROC __glewUniformHandleui64vARB = NULL;
-PFNGLVERTEXATTRIBL1UI64ARBPROC __glewVertexAttribL1ui64ARB = NULL;
-PFNGLVERTEXATTRIBL1UI64VARBPROC __glewVertexAttribL1ui64vARB = NULL;
-
-PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL;
-PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL;
-
-PFNGLBUFFERSTORAGEPROC __glewBufferStorage = NULL;
-PFNGLNAMEDBUFFERSTORAGEEXTPROC __glewNamedBufferStorageEXT = NULL;
-
-PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL;
-
-PFNGLCLEARBUFFERDATAPROC __glewClearBufferData = NULL;
-PFNGLCLEARBUFFERSUBDATAPROC __glewClearBufferSubData = NULL;
-PFNGLCLEARNAMEDBUFFERDATAEXTPROC __glewClearNamedBufferDataEXT = NULL;
-PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC __glewClearNamedBufferSubDataEXT = NULL;
-
-PFNGLCLEARTEXIMAGEPROC __glewClearTexImage = NULL;
-PFNGLCLEARTEXSUBIMAGEPROC __glewClearTexSubImage = NULL;
-
-PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL;
-
-PFNGLDISPATCHCOMPUTEPROC __glewDispatchCompute = NULL;
-PFNGLDISPATCHCOMPUTEINDIRECTPROC __glewDispatchComputeIndirect = NULL;
-
-PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC __glewDispatchComputeGroupSizeARB = NULL;
-
-PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL;
-
-PFNGLCOPYIMAGESUBDATAPROC __glewCopyImageSubData = NULL;
-
-PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL;
-PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL;
-PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL;
-PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL;
-
-PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL;
-
-PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL;
-PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL;
-PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL;
-PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL;
-
-PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL;
-PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL;
-PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL;
-PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL;
-
-PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL;
-PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL;
-
-PFNGLFRAMEBUFFERPARAMETERIPROC __glewFramebufferParameteri = NULL;
-PFNGLGETFRAMEBUFFERPARAMETERIVPROC __glewGetFramebufferParameteriv = NULL;
-PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC __glewGetNamedFramebufferParameterivEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC __glewNamedFramebufferParameteriEXT = NULL;
-
-PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL;
-PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL;
-PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL;
-PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL;
-PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL;
-PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL;
-PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL;
-PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL;
-PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL;
-PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL;
-PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL;
-PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL;
-PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL;
-PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL;
-PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL;
-PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL;
-PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL;
-PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL;
-PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL;
-PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL;
-
-PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL;
-PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL;
-PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL;
-PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL;
-
-PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL;
-PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL;
-PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL;
-
-PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL;
-PFNGLUNIFORM1DPROC __glewUniform1d = NULL;
-PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL;
-PFNGLUNIFORM2DPROC __glewUniform2d = NULL;
-PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL;
-PFNGLUNIFORM3DPROC __glewUniform3d = NULL;
-PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL;
-PFNGLUNIFORM4DPROC __glewUniform4d = NULL;
-PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL;
-PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL;
-PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL;
-PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL;
-PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL;
-PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL;
-PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL;
-PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL;
-PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL;
-PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL;
-
-PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL;
-PFNGLCOLORTABLEPROC __glewColorTable = NULL;
-PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL;
-PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL;
-PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL;
-PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL;
-PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL;
-PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL;
-PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL;
-PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL;
-PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL;
-PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL;
-PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL;
-PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL;
-PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL;
-PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL;
-PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL;
-PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL;
-PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL;
-PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL;
-PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL;
-PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL;
-PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL;
-PFNGLGETMINMAXPROC __glewGetMinmax = NULL;
-PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL;
-PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL;
-PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL;
-PFNGLHISTOGRAMPROC __glewHistogram = NULL;
-PFNGLMINMAXPROC __glewMinmax = NULL;
-PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL;
-PFNGLRESETMINMAXPROC __glewResetMinmax = NULL;
-PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL;
-
-PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC __glewMultiDrawArraysIndirectCountARB = NULL;
-PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC __glewMultiDrawElementsIndirectCountARB = NULL;
-
-PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL;
-PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL;
-PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL;
-
-PFNGLGETINTERNALFORMATIVPROC __glewGetInternalformativ = NULL;
-
-PFNGLGETINTERNALFORMATI64VPROC __glewGetInternalformati64v = NULL;
-
-PFNGLINVALIDATEBUFFERDATAPROC __glewInvalidateBufferData = NULL;
-PFNGLINVALIDATEBUFFERSUBDATAPROC __glewInvalidateBufferSubData = NULL;
-PFNGLINVALIDATEFRAMEBUFFERPROC __glewInvalidateFramebuffer = NULL;
-PFNGLINVALIDATESUBFRAMEBUFFERPROC __glewInvalidateSubFramebuffer = NULL;
-PFNGLINVALIDATETEXIMAGEPROC __glewInvalidateTexImage = NULL;
-PFNGLINVALIDATETEXSUBIMAGEPROC __glewInvalidateTexSubImage = NULL;
-
-PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL;
-PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL;
-
-PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL;
-PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL;
-PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL;
-PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL;
-PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL;
-
-PFNGLBINDBUFFERSBASEPROC __glewBindBuffersBase = NULL;
-PFNGLBINDBUFFERSRANGEPROC __glewBindBuffersRange = NULL;
-PFNGLBINDIMAGETEXTURESPROC __glewBindImageTextures = NULL;
-PFNGLBINDSAMPLERSPROC __glewBindSamplers = NULL;
-PFNGLBINDTEXTURESPROC __glewBindTextures = NULL;
-PFNGLBINDVERTEXBUFFERSPROC __glewBindVertexBuffers = NULL;
-
-PFNGLMULTIDRAWARRAYSINDIRECTPROC __glewMultiDrawArraysIndirect = NULL;
-PFNGLMULTIDRAWELEMENTSINDIRECTPROC __glewMultiDrawElementsIndirect = NULL;
-
-PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL;
-
-PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL;
-PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL;
-PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL;
-PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL;
-PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL;
-PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL;
-PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL;
-PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL;
-PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL;
-PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL;
-PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL;
-PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL;
-PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL;
-PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL;
-PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL;
-PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL;
-PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL;
-PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL;
-PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL;
-PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL;
-PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL;
-PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL;
-PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL;
-PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL;
-PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL;
-PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL;
-PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL;
-PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL;
-PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL;
-PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL;
-PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL;
-PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL;
-PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL;
-PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL;
-
-PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL;
-PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL;
-PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL;
-PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL;
-PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL;
-PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL;
-PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL;
-PFNGLISQUERYARBPROC __glewIsQueryARB = NULL;
-
-PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL;
-PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL;
-
-PFNGLGETPROGRAMINTERFACEIVPROC __glewGetProgramInterfaceiv = NULL;
-PFNGLGETPROGRAMRESOURCEINDEXPROC __glewGetProgramResourceIndex = NULL;
-PFNGLGETPROGRAMRESOURCELOCATIONPROC __glewGetProgramResourceLocation = NULL;
-PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC __glewGetProgramResourceLocationIndex = NULL;
-PFNGLGETPROGRAMRESOURCENAMEPROC __glewGetProgramResourceName = NULL;
-PFNGLGETPROGRAMRESOURCEIVPROC __glewGetProgramResourceiv = NULL;
-
-PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL;
-
-PFNGLGETGRAPHICSRESETSTATUSARBPROC __glewGetGraphicsResetStatusARB = NULL;
-PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL;
-PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL;
-PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL;
-PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL;
-PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL;
-PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL;
-PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL;
-PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL;
-PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL;
-PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL;
-PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL;
-PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL;
-PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL;
-PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL;
-PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL;
-PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL;
-PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL;
-PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL;
-PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL;
-
-PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL;
-
-PFNGLBINDSAMPLERPROC __glewBindSampler = NULL;
-PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL;
-PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL;
-PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL;
-PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL;
-PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL;
-PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL;
-PFNGLISSAMPLERPROC __glewIsSampler = NULL;
-PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL;
-PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL;
-PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL;
-PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL;
-PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL;
-PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL;
-
-PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL;
-PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL;
-PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL;
-PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL;
-PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL;
-PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL;
-PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL;
-PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL;
-PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL;
-PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL;
-PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL;
-PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL;
-PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL;
-PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL;
-PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL;
-PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL;
-PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL;
-PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL;
-PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL;
-PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL;
-PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL;
-PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL;
-PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL;
-PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL;
-PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL;
-PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL;
-PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL;
-PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL;
-PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL;
-PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL;
-PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL;
-PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL;
-PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL;
-PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL;
-PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL;
-PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL;
-PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL;
-PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL;
-PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL;
-PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL;
-PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL;
-PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL;
-
-PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC __glewGetActiveAtomicCounterBufferiv = NULL;
-
-PFNGLBINDIMAGETEXTUREPROC __glewBindImageTexture = NULL;
-PFNGLMEMORYBARRIERPROC __glewMemoryBarrier = NULL;
-
-PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL;
-PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL;
-PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL;
-PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL;
-PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL;
-PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL;
-PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL;
-PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL;
-PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL;
-PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL;
-PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL;
-PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL;
-PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL;
-PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL;
-PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL;
-PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL;
-PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL;
-PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL;
-PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL;
-PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL;
-PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL;
-PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL;
-PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL;
-PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL;
-PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL;
-PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL;
-PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL;
-PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL;
-PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL;
-PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL;
-PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL;
-PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL;
-PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL;
-PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL;
-PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL;
-PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL;
-PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL;
-PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL;
-PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL;
-
-PFNGLSHADERSTORAGEBLOCKBINDINGPROC __glewShaderStorageBlockBinding = NULL;
-
-PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL;
-PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL;
-PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL;
-PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL;
-PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL;
-PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL;
-PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL;
-PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL;
-
-PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL;
-PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL;
-PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL;
-PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL;
-PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL;
-PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL;
-
-PFNGLTEXPAGECOMMITMENTARBPROC __glewTexPageCommitmentARB = NULL;
-PFNGLTEXTUREPAGECOMMITMENTEXTPROC __glewTexturePageCommitmentEXT = NULL;
-
-PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL;
-PFNGLDELETESYNCPROC __glewDeleteSync = NULL;
-PFNGLFENCESYNCPROC __glewFenceSync = NULL;
-PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL;
-PFNGLGETSYNCIVPROC __glewGetSynciv = NULL;
-PFNGLISSYNCPROC __glewIsSync = NULL;
-PFNGLWAITSYNCPROC __glewWaitSync = NULL;
-
-PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL;
-PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL;
-
-PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL;
-
-PFNGLTEXBUFFERRANGEPROC __glewTexBufferRange = NULL;
-PFNGLTEXTUREBUFFERRANGEEXTPROC __glewTextureBufferRangeEXT = NULL;
-
-PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL;
-PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL;
-PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL;
-PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL;
-PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL;
-
-PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL;
-PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL;
-PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL;
-PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL;
-
-PFNGLTEXSTORAGE1DPROC __glewTexStorage1D = NULL;
-PFNGLTEXSTORAGE2DPROC __glewTexStorage2D = NULL;
-PFNGLTEXSTORAGE3DPROC __glewTexStorage3D = NULL;
-PFNGLTEXTURESTORAGE1DEXTPROC __glewTextureStorage1DEXT = NULL;
-PFNGLTEXTURESTORAGE2DEXTPROC __glewTextureStorage2DEXT = NULL;
-PFNGLTEXTURESTORAGE3DEXTPROC __glewTextureStorage3DEXT = NULL;
-
-PFNGLTEXSTORAGE2DMULTISAMPLEPROC __glewTexStorage2DMultisample = NULL;
-PFNGLTEXSTORAGE3DMULTISAMPLEPROC __glewTexStorage3DMultisample = NULL;
-PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC __glewTextureStorage2DMultisampleEXT = NULL;
-PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC __glewTextureStorage3DMultisampleEXT = NULL;
-
-PFNGLTEXTUREVIEWPROC __glewTextureView = NULL;
-
-PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL;
-PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL;
-PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL;
-
-PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL;
-PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL;
-PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL;
-PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL;
-PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL;
-PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL;
-PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL;
-
-PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL;
-PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL;
-PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL;
-PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL;
-
-PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC __glewDrawTransformFeedbackInstanced = NULL;
-PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC __glewDrawTransformFeedbackStreamInstanced = NULL;
-
-PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL;
-PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL;
-PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL;
-PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL;
-
-PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL;
-PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL;
-PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL;
-PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL;
-PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL;
-PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL;
-PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL;
-PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL;
-PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL;
-PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL;
-
-PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL;
-PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL;
-PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL;
-PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL;
-
-PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL;
-PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL;
-PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL;
-PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL;
-PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL;
-PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL;
-PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL;
-PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL;
-PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL;
-PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL;
-
-PFNGLBINDVERTEXBUFFERPROC __glewBindVertexBuffer = NULL;
-PFNGLVERTEXATTRIBBINDINGPROC __glewVertexAttribBinding = NULL;
-PFNGLVERTEXATTRIBFORMATPROC __glewVertexAttribFormat = NULL;
-PFNGLVERTEXATTRIBIFORMATPROC __glewVertexAttribIFormat = NULL;
-PFNGLVERTEXATTRIBLFORMATPROC __glewVertexAttribLFormat = NULL;
-PFNGLVERTEXBINDINGDIVISORPROC __glewVertexBindingDivisor = NULL;
-
-PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL;
-PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL;
-PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL;
-PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL;
-PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL;
-PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL;
-PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL;
-PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL;
-PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL;
-PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL;
-
-PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL;
-PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL;
-PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL;
-PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL;
-PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL;
-PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL;
-PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL;
-PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL;
-PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL;
-PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL;
-PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL;
-
-PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL;
-PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL;
-PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL;
-PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL;
-PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL;
-PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL;
-PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL;
-PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL;
-PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL;
-PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL;
-PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL;
-PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL;
-PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL;
-PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL;
-PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL;
-PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL;
-PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL;
-PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL;
-PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL;
-PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL;
-PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL;
-PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL;
-PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL;
-PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL;
-PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL;
-PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL;
-PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL;
-PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL;
-PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL;
-PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL;
-PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL;
-PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL;
-PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL;
-PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL;
-PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL;
-PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL;
-PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL;
-PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL;
-PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL;
-PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL;
-PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL;
-PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL;
-PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL;
-PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL;
-PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL;
-PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL;
-PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL;
-PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL;
-PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL;
-PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL;
-PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL;
-PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL;
-PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL;
-PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL;
-PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL;
-PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL;
-PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL;
-PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL;
-PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL;
-PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL;
-PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL;
-PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL;
-
-PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL;
-PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL;
-PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL;
-
-PFNGLCOLORP3UIPROC __glewColorP3ui = NULL;
-PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL;
-PFNGLCOLORP4UIPROC __glewColorP4ui = NULL;
-PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL;
-PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL;
-PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL;
-PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL;
-PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL;
-PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL;
-PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL;
-PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL;
-PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL;
-PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL;
-PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL;
-PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL;
-PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL;
-PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL;
-PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL;
-PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL;
-PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL;
-PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL;
-PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL;
-PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL;
-PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL;
-PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL;
-PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL;
-PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL;
-PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL;
-PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL;
-PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL;
-PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL;
-PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL;
-PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL;
-PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL;
-PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL;
-PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL;
-PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL;
-PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL;
-
-PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL;
-PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL;
-PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL;
-PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL;
-PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL;
-PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL;
-PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL;
-PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL;
-PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL;
-PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL;
-
-PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL;
-PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL;
-PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL;
-PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL;
-PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL;
-PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL;
-PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL;
-PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL;
-PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL;
-PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL;
-PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL;
-PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL;
-PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL;
-PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL;
-PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL;
-PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL;
-
-PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL;
-
-PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL;
-PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL;
-PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL;
-
-PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL;
-PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL;
-PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL;
-PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL;
-
-PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL;
-PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL;
-PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL;
-PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL;
-PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL;
-PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL;
-PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL;
-PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL;
-PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL;
-PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL;
-PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL;
-PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL;
-PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL;
-PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL;
-
-PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL;
-PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL;
-
-PFNGLPNTRIANGLESFATIPROC __glewPNTrianglesfATI = NULL;
-PFNGLPNTRIANGLESIATIPROC __glewPNTrianglesiATI = NULL;
-
-PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL;
-PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL;
-
-PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL;
-PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL;
-PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL;
-PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL;
-PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL;
-PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL;
-PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL;
-PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL;
-PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL;
-PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL;
-PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL;
-PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL;
-
-PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL;
-PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL;
-PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL;
-
-PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL;
-PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL;
-PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL;
-PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL;
-PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL;
-PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL;
-PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL;
-PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL;
-PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL;
-PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL;
-PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL;
-PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL;
-PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL;
-PFNGLVERTEXSTREAM1DATIPROC __glewVertexStream1dATI = NULL;
-PFNGLVERTEXSTREAM1DVATIPROC __glewVertexStream1dvATI = NULL;
-PFNGLVERTEXSTREAM1FATIPROC __glewVertexStream1fATI = NULL;
-PFNGLVERTEXSTREAM1FVATIPROC __glewVertexStream1fvATI = NULL;
-PFNGLVERTEXSTREAM1IATIPROC __glewVertexStream1iATI = NULL;
-PFNGLVERTEXSTREAM1IVATIPROC __glewVertexStream1ivATI = NULL;
-PFNGLVERTEXSTREAM1SATIPROC __glewVertexStream1sATI = NULL;
-PFNGLVERTEXSTREAM1SVATIPROC __glewVertexStream1svATI = NULL;
-PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL;
-PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL;
-PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL;
-PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL;
-PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL;
-PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL;
-PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL;
-PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL;
-PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL;
-PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL;
-PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL;
-PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL;
-PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL;
-PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL;
-PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL;
-PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL;
-PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL;
-PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL;
-PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL;
-PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL;
-PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL;
-PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL;
-PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL;
-PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL;
-
-PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL;
-PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL;
-PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL;
-
-PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL;
-
-PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL;
-
-PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL;
-
-PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL;
-
-PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL;
-PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL;
-
-PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL;
-PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL;
-
-PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL;
-PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL;
-PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL;
-PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL;
-PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL;
-PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL;
-PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL;
-PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL;
-PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL;
-PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL;
-PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL;
-PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL;
-PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL;
-
-PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL;
-PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL;
-
-PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL;
-PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL;
-PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL;
-PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL;
-PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL;
-
-PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL;
-PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL;
-
-PFNGLINSERTEVENTMARKEREXTPROC __glewInsertEventMarkerEXT = NULL;
-PFNGLPOPGROUPMARKEREXTPROC __glewPopGroupMarkerEXT = NULL;
-PFNGLPUSHGROUPMARKEREXTPROC __glewPushGroupMarkerEXT = NULL;
-
-PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL;
-
-PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL;
-PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL;
-PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL;
-PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL;
-PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL;
-PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL;
-PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL;
-PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL;
-PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL;
-PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL;
-PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL;
-PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL;
-PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL;
-PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL;
-PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL;
-PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL;
-PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL;
-PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL;
-PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL;
-PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL;
-PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL;
-PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL;
-PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL;
-PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL;
-PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL;
-PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL;
-PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL;
-PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL;
-PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL;
-PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL;
-PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL;
-PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL;
-PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL;
-PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL;
-PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL;
-PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL;
-PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL;
-PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL;
-PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL;
-PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL;
-PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL;
-PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL;
-PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL;
-PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL;
-PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL;
-PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL;
-PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL;
-PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL;
-PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL;
-PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL;
-PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL;
-PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL;
-PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL;
-PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL;
-PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL;
-PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL;
-PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL;
-PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL;
-PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL;
-PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL;
-PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL;
-PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL;
-PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL;
-PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL;
-PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL;
-PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL;
-PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL;
-PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL;
-PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL;
-PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL;
-PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL;
-PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL;
-PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL;
-PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL;
-PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL;
-PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL;
-PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL;
-PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL;
-PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL;
-PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL;
-PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL;
-PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL;
-PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL;
-PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL;
-PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL;
-PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL;
-PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL;
-PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL;
-PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL;
-PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL;
-PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL;
-PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL;
-PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL;
-PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL;
-PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL;
-PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL;
-PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL;
-PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL;
-PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL;
-PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL;
-PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL;
-PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL;
-PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL;
-PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL;
-PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL;
-PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL;
-PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL;
-PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL;
-PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL;
-PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL;
-PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL;
-PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL;
-PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL;
-PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL;
-PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL;
-PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL;
-PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL;
-PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL;
-PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL;
-PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL;
-PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL;
-PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL;
-PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL;
-PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL;
-PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL;
-PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL;
-PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL;
-PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL;
-PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL;
-PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL;
-PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL;
-PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL;
-PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL;
-PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL;
-PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL;
-PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL;
-PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL;
-PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL;
-PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL;
-PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL;
-PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL;
-PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL;
-PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL;
-PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL;
-PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL;
-PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL;
-PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL;
-PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL;
-PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL;
-PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL;
-PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL;
-PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL;
-PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL;
-PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL;
-PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL;
-PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL;
-PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL;
-PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL;
-PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL;
-PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL;
-PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL;
-PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL;
-PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL;
-PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL;
-PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL;
-PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL;
-PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL;
-PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL;
-PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL;
-PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL;
-PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL;
-PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL;
-PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL;
-PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL;
-PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL;
-PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL;
-PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL;
-PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL;
-PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL;
-PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL;
-PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL;
-PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL;
-PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL;
-PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL;
-
-PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL;
-PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL;
-PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL;
-PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL;
-PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL;
-PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL;
-
-PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL;
-PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL;
-
-PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL;
-
-PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL;
-PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL;
-PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL;
-PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL;
-PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL;
-
-PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL;
-PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL;
-PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL;
-PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL;
-PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL;
-PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL;
-PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL;
-PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL;
-PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL;
-PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL;
-PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL;
-PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL;
-PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL;
-PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL;
-PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL;
-PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL;
-PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL;
-PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL;
-
-PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL;
-
-PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL;
-
-PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL;
-PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL;
-PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL;
-PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL;
-PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL;
-PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL;
-PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL;
-PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL;
-PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL;
-PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL;
-PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL;
-PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL;
-PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL;
-PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL;
-PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL;
-PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL;
-PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL;
-
-PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL;
-PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL;
-PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL;
-
-PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL;
-PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL;
-
-PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL;
-PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL;
-PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL;
-PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL;
-PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL;
-PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL;
-PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL;
-PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL;
-PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL;
-PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL;
-PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL;
-PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL;
-PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL;
-PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL;
-PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL;
-PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL;
-PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL;
-PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL;
-PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL;
-PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL;
-PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL;
-PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL;
-PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL;
-PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL;
-PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL;
-PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL;
-PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL;
-PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL;
-PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL;
-PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL;
-PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL;
-PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL;
-PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL;
-PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL;
-
-PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL;
-PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL;
-PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL;
-PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL;
-PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL;
-PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL;
-PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL;
-PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL;
-PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL;
-PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL;
-
-PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL;
-
-PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL;
-
-PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL;
-PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL;
-PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL;
-
-PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL;
-PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL;
-
-PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL;
-PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL;
-
-PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL;
-PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL;
-PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL;
-PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL;
-
-PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL;
-PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL;
-PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL;
-PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL;
-PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL;
-PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL;
-
-PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL;
-PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL;
-
-PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL;
-
-PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL;
-
-PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL;
-PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL;
-
-PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL;
-PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL;
-PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL;
-PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL;
-PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL;
-PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL;
-PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL;
-PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL;
-PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL;
-PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL;
-PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL;
-PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL;
-PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL;
-PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL;
-PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL;
-PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL;
-PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL;
-
-PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL;
-PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL;
-PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL;
-
-PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL;
-PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL;
-
-PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL;
-
-PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL;
-PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL;
-PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL;
-
-PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL;
-
-PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL;
-
-PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL;
-
-PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL;
-PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL;
-PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL;
-PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL;
-PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL;
-PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL;
-
-PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL;
-PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL;
-PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL;
-PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL;
-PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL;
-PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL;
-
-PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL;
-
-PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL;
-PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL;
-
-PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL;
-PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL;
-PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL;
-PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL;
-PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL;
-PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL;
-PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL;
-
-PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL;
-PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL;
-PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL;
-PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL;
-PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL;
-PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL;
-PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL;
-PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL;
-
-PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL;
-PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL;
-PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL;
-PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL;
-PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL;
-PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL;
-PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL;
-PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL;
-PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL;
-PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL;
-PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL;
-
-PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL;
-PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL;
-PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL;
-PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL;
-PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL;
-PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL;
-PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL;
-PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL;
-PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL;
-PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL;
-PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL;
-PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL;
-PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL;
-PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL;
-PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL;
-PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL;
-PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL;
-PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL;
-PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL;
-PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL;
-PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL;
-PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL;
-PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL;
-PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL;
-PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL;
-PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL;
-PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL;
-PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL;
-PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL;
-PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL;
-PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL;
-PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL;
-PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL;
-PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL;
-PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL;
-PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL;
-PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL;
-PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL;
-PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL;
-PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL;
-PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL;
-PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL;
-
-PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL;
-PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL;
-PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL;
-
-PFNGLIMPORTSYNCEXTPROC __glewImportSyncEXT = NULL;
-
-PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL;
-
-PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL;
-
-PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL;
-PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL;
-PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL;
-PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL;
-PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL;
-PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL;
-
-PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL;
-PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL;
-
-PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL;
-PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL;
-PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL;
-PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL;
-PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL;
-PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL;
-PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL;
-PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL;
-
-PFNGLMAPTEXTURE2DINTELPROC __glewMapTexture2DINTEL = NULL;
-PFNGLSYNCTEXTUREINTELPROC __glewSyncTextureINTEL = NULL;
-PFNGLUNMAPTEXTURE2DINTELPROC __glewUnmapTexture2DINTEL = NULL;
-
-PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL;
-PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL;
-PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL;
-PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL;
-
-PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL;
-PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL;
-
-PFNGLDEBUGMESSAGECALLBACKPROC __glewDebugMessageCallback = NULL;
-PFNGLDEBUGMESSAGECONTROLPROC __glewDebugMessageControl = NULL;
-PFNGLDEBUGMESSAGEINSERTPROC __glewDebugMessageInsert = NULL;
-PFNGLGETDEBUGMESSAGELOGPROC __glewGetDebugMessageLog = NULL;
-PFNGLGETOBJECTLABELPROC __glewGetObjectLabel = NULL;
-PFNGLGETOBJECTPTRLABELPROC __glewGetObjectPtrLabel = NULL;
-PFNGLOBJECTLABELPROC __glewObjectLabel = NULL;
-PFNGLOBJECTPTRLABELPROC __glewObjectPtrLabel = NULL;
-PFNGLPOPDEBUGGROUPPROC __glewPopDebugGroup = NULL;
-PFNGLPUSHDEBUGGROUPPROC __glewPushDebugGroup = NULL;
-
-PFNGLBUFFERREGIONENABLEDPROC __glewBufferRegionEnabled = NULL;
-PFNGLDELETEBUFFERREGIONPROC __glewDeleteBufferRegion = NULL;
-PFNGLDRAWBUFFERREGIONPROC __glewDrawBufferRegion = NULL;
-PFNGLNEWBUFFERREGIONPROC __glewNewBufferRegion = NULL;
-PFNGLREADBUFFERREGIONPROC __glewReadBufferRegion = NULL;
-
-PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL;
-
-PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL;
-PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL;
-PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL;
-PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL;
-PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL;
-PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL;
-PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL;
-PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL;
-PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL;
-PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL;
-PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL;
-PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL;
-PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL;
-PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL;
-PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL;
-PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL;
-PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL;
-PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL;
-PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL;
-PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL;
-PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL;
-PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL;
-PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL;
-PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL;
-
-PFNGLBEGINCONDITIONALRENDERNVXPROC __glewBeginConditionalRenderNVX = NULL;
-PFNGLENDCONDITIONALRENDERNVXPROC __glewEndConditionalRenderNVX = NULL;
-
-PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC __glewMultiDrawArraysIndirectBindlessNV = NULL;
-PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC __glewMultiDrawElementsIndirectBindlessNV = NULL;
-
-PFNGLGETIMAGEHANDLENVPROC __glewGetImageHandleNV = NULL;
-PFNGLGETTEXTUREHANDLENVPROC __glewGetTextureHandleNV = NULL;
-PFNGLGETTEXTURESAMPLERHANDLENVPROC __glewGetTextureSamplerHandleNV = NULL;
-PFNGLISIMAGEHANDLERESIDENTNVPROC __glewIsImageHandleResidentNV = NULL;
-PFNGLISTEXTUREHANDLERESIDENTNVPROC __glewIsTextureHandleResidentNV = NULL;
-PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC __glewMakeImageHandleNonResidentNV = NULL;
-PFNGLMAKEIMAGEHANDLERESIDENTNVPROC __glewMakeImageHandleResidentNV = NULL;
-PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC __glewMakeTextureHandleNonResidentNV = NULL;
-PFNGLMAKETEXTUREHANDLERESIDENTNVPROC __glewMakeTextureHandleResidentNV = NULL;
-PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC __glewProgramUniformHandleui64NV = NULL;
-PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC __glewProgramUniformHandleui64vNV = NULL;
-PFNGLUNIFORMHANDLEUI64NVPROC __glewUniformHandleui64NV = NULL;
-PFNGLUNIFORMHANDLEUI64VNVPROC __glewUniformHandleui64vNV = NULL;
-
-PFNGLBLENDBARRIERNVPROC __glewBlendBarrierNV = NULL;
-PFNGLBLENDPARAMETERINVPROC __glewBlendParameteriNV = NULL;
-
-PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL;
-PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL;
-
-PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL;
-
-PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL;
-PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL;
-PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL;
-
-PFNGLDRAWTEXTURENVPROC __glewDrawTextureNV = NULL;
-
-PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL;
-PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL;
-PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL;
-PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL;
-PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL;
-PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL;
-PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL;
-PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL;
-PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL;
-
-PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL;
-PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL;
-PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL;
-
-PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL;
-PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL;
-PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL;
-PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL;
-PFNGLISFENCENVPROC __glewIsFenceNV = NULL;
-PFNGLSETFENCENVPROC __glewSetFenceNV = NULL;
-PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL;
-
-PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL;
-PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL;
-PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL;
-PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL;
-PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL;
-PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL;
-
-PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL;
-
-PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL;
-
-PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL;
-PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL;
-PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL;
-PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL;
-PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL;
-PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL;
-PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL;
-
-PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL;
-PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL;
-PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL;
-PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL;
-PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL;
-PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL;
-PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL;
-PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL;
-PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL;
-PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL;
-PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL;
-PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL;
-PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL;
-PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL;
-PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL;
-PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL;
-PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL;
-PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL;
-PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL;
-PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL;
-PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL;
-PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL;
-PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL;
-PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL;
-PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL;
-PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL;
-PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL;
-PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL;
-PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL;
-PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL;
-PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL;
-PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL;
-PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL;
-PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL;
-
-PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL;
-PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL;
-PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL;
-PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL;
-PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL;
-PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL;
-PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL;
-PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL;
-PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL;
-PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL;
-PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL;
-PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL;
-PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL;
-PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL;
-PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL;
-PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL;
-PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL;
-PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL;
-PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL;
-PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL;
-PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL;
-PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL;
-PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL;
-PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL;
-PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL;
-PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL;
-PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL;
-PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL;
-PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL;
-PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL;
-PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL;
-PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL;
-PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL;
-PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL;
-PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL;
-PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL;
-PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL;
-PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL;
-PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL;
-PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL;
-PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL;
-PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL;
-PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL;
-PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL;
-PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL;
-PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL;
-
-PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL;
-PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL;
-PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL;
-PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL;
-PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL;
-PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL;
-PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL;
-
-PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL;
-PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL;
-PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL;
-
-PFNGLCOPYPATHNVPROC __glewCopyPathNV = NULL;
-PFNGLCOVERFILLPATHINSTANCEDNVPROC __glewCoverFillPathInstancedNV = NULL;
-PFNGLCOVERFILLPATHNVPROC __glewCoverFillPathNV = NULL;
-PFNGLCOVERSTROKEPATHINSTANCEDNVPROC __glewCoverStrokePathInstancedNV = NULL;
-PFNGLCOVERSTROKEPATHNVPROC __glewCoverStrokePathNV = NULL;
-PFNGLDELETEPATHSNVPROC __glewDeletePathsNV = NULL;
-PFNGLGENPATHSNVPROC __glewGenPathsNV = NULL;
-PFNGLGETPATHCOLORGENFVNVPROC __glewGetPathColorGenfvNV = NULL;
-PFNGLGETPATHCOLORGENIVNVPROC __glewGetPathColorGenivNV = NULL;
-PFNGLGETPATHCOMMANDSNVPROC __glewGetPathCommandsNV = NULL;
-PFNGLGETPATHCOORDSNVPROC __glewGetPathCoordsNV = NULL;
-PFNGLGETPATHDASHARRAYNVPROC __glewGetPathDashArrayNV = NULL;
-PFNGLGETPATHLENGTHNVPROC __glewGetPathLengthNV = NULL;
-PFNGLGETPATHMETRICRANGENVPROC __glewGetPathMetricRangeNV = NULL;
-PFNGLGETPATHMETRICSNVPROC __glewGetPathMetricsNV = NULL;
-PFNGLGETPATHPARAMETERFVNVPROC __glewGetPathParameterfvNV = NULL;
-PFNGLGETPATHPARAMETERIVNVPROC __glewGetPathParameterivNV = NULL;
-PFNGLGETPATHSPACINGNVPROC __glewGetPathSpacingNV = NULL;
-PFNGLGETPATHTEXGENFVNVPROC __glewGetPathTexGenfvNV = NULL;
-PFNGLGETPATHTEXGENIVNVPROC __glewGetPathTexGenivNV = NULL;
-PFNGLINTERPOLATEPATHSNVPROC __glewInterpolatePathsNV = NULL;
-PFNGLISPATHNVPROC __glewIsPathNV = NULL;
-PFNGLISPOINTINFILLPATHNVPROC __glewIsPointInFillPathNV = NULL;
-PFNGLISPOINTINSTROKEPATHNVPROC __glewIsPointInStrokePathNV = NULL;
-PFNGLPATHCOLORGENNVPROC __glewPathColorGenNV = NULL;
-PFNGLPATHCOMMANDSNVPROC __glewPathCommandsNV = NULL;
-PFNGLPATHCOORDSNVPROC __glewPathCoordsNV = NULL;
-PFNGLPATHCOVERDEPTHFUNCNVPROC __glewPathCoverDepthFuncNV = NULL;
-PFNGLPATHDASHARRAYNVPROC __glewPathDashArrayNV = NULL;
-PFNGLPATHFOGGENNVPROC __glewPathFogGenNV = NULL;
-PFNGLPATHGLYPHRANGENVPROC __glewPathGlyphRangeNV = NULL;
-PFNGLPATHGLYPHSNVPROC __glewPathGlyphsNV = NULL;
-PFNGLPATHPARAMETERFNVPROC __glewPathParameterfNV = NULL;
-PFNGLPATHPARAMETERFVNVPROC __glewPathParameterfvNV = NULL;
-PFNGLPATHPARAMETERINVPROC __glewPathParameteriNV = NULL;
-PFNGLPATHPARAMETERIVNVPROC __glewPathParameterivNV = NULL;
-PFNGLPATHSTENCILDEPTHOFFSETNVPROC __glewPathStencilDepthOffsetNV = NULL;
-PFNGLPATHSTENCILFUNCNVPROC __glewPathStencilFuncNV = NULL;
-PFNGLPATHSTRINGNVPROC __glewPathStringNV = NULL;
-PFNGLPATHSUBCOMMANDSNVPROC __glewPathSubCommandsNV = NULL;
-PFNGLPATHSUBCOORDSNVPROC __glewPathSubCoordsNV = NULL;
-PFNGLPATHTEXGENNVPROC __glewPathTexGenNV = NULL;
-PFNGLPOINTALONGPATHNVPROC __glewPointAlongPathNV = NULL;
-PFNGLSTENCILFILLPATHINSTANCEDNVPROC __glewStencilFillPathInstancedNV = NULL;
-PFNGLSTENCILFILLPATHNVPROC __glewStencilFillPathNV = NULL;
-PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC __glewStencilStrokePathInstancedNV = NULL;
-PFNGLSTENCILSTROKEPATHNVPROC __glewStencilStrokePathNV = NULL;
-PFNGLTRANSFORMPATHNVPROC __glewTransformPathNV = NULL;
-PFNGLWEIGHTPATHSNVPROC __glewWeightPathsNV = NULL;
-
-PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL;
-PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL;
-
-PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL;
-PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL;
-
-PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL;
-PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL;
-PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL;
-PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL;
-PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL;
-PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL;
-
-PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL;
-PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL;
-
-PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL;
-PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL;
-PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL;
-PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL;
-PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL;
-PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL;
-PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL;
-PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL;
-PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL;
-PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL;
-PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL;
-PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL;
-PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL;
-
-PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL;
-PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL;
-
-PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL;
-PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL;
-PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL;
-PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL;
-PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL;
-PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL;
-PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL;
-PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL;
-PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL;
-PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL;
-PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL;
-PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL;
-PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL;
-
-PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL;
-
-PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTexImage2DMultisampleCoverageNV = NULL;
-PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTexImage3DMultisampleCoverageNV = NULL;
-PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC __glewTextureImage2DMultisampleCoverageNV = NULL;
-PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC __glewTextureImage2DMultisampleNV = NULL;
-PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC __glewTextureImage3DMultisampleCoverageNV = NULL;
-PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC __glewTextureImage3DMultisampleNV = NULL;
-
-PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL;
-PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL;
-PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL;
-PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL;
-PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL;
-PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL;
-PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL;
-PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL;
-PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL;
-PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL;
-PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL;
-
-PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL;
-PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL;
-PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL;
-PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL;
-PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL;
-PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL;
-PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL;
-
-PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL;
-PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL;
-PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL;
-PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL;
-PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL;
-PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL;
-PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL;
-PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL;
-PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL;
-PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL;
-
-PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL;
-PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL;
-
-PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL;
-PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL;
-PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL;
-PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL;
-PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL;
-PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL;
-PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL;
-PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL;
-PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL;
-PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL;
-PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL;
-PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL;
-PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL;
-PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL;
-PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL;
-PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL;
-PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL;
-PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL;
-PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL;
-
-PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL;
-PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL;
-PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL;
-PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL;
-PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL;
-PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL;
-PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL;
-PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL;
-PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL;
-PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL;
-PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL;
-PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL;
-
-PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL;
-PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL;
-PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL;
-PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL;
-PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL;
-PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL;
-PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL;
-PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL;
-PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL;
-PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL;
-PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL;
-PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL;
-PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL;
-PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL;
-PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL;
-PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL;
-PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL;
-PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL;
-PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL;
-PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL;
-PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL;
-PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL;
-PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL;
-PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL;
-PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL;
-PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL;
-PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL;
-PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL;
-PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL;
-PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL;
-PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL;
-PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL;
-PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL;
-PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL;
-PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL;
-PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL;
-PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL;
-PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL;
-PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL;
-PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL;
-PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL;
-PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL;
-PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL;
-PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL;
-PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL;
-PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL;
-PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL;
-PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL;
-PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL;
-PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL;
-PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL;
-PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL;
-PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL;
-PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL;
-PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL;
-PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL;
-PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL;
-PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL;
-PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL;
-PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL;
-PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL;
-PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL;
-PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL;
-PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL;
-
-PFNGLBEGINVIDEOCAPTURENVPROC __glewBeginVideoCaptureNV = NULL;
-PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC __glewBindVideoCaptureStreamBufferNV = NULL;
-PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC __glewBindVideoCaptureStreamTextureNV = NULL;
-PFNGLENDVIDEOCAPTURENVPROC __glewEndVideoCaptureNV = NULL;
-PFNGLGETVIDEOCAPTURESTREAMDVNVPROC __glewGetVideoCaptureStreamdvNV = NULL;
-PFNGLGETVIDEOCAPTURESTREAMFVNVPROC __glewGetVideoCaptureStreamfvNV = NULL;
-PFNGLGETVIDEOCAPTURESTREAMIVNVPROC __glewGetVideoCaptureStreamivNV = NULL;
-PFNGLGETVIDEOCAPTUREIVNVPROC __glewGetVideoCaptureivNV = NULL;
-PFNGLVIDEOCAPTURENVPROC __glewVideoCaptureNV = NULL;
-PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC __glewVideoCaptureStreamParameterdvNV = NULL;
-PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC __glewVideoCaptureStreamParameterfvNV = NULL;
-PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC __glewVideoCaptureStreamParameterivNV = NULL;
-
-PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL;
-PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL;
-PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL;
-PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL;
-PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL;
-PFNGLORTHOFOESPROC __glewOrthofOES = NULL;
-
-PFNGLALPHAFUNCXPROC __glewAlphaFuncx = NULL;
-PFNGLCLEARCOLORXPROC __glewClearColorx = NULL;
-PFNGLCLEARDEPTHXPROC __glewClearDepthx = NULL;
-PFNGLCOLOR4XPROC __glewColor4x = NULL;
-PFNGLDEPTHRANGEXPROC __glewDepthRangex = NULL;
-PFNGLFOGXPROC __glewFogx = NULL;
-PFNGLFOGXVPROC __glewFogxv = NULL;
-PFNGLFRUSTUMFPROC __glewFrustumf = NULL;
-PFNGLFRUSTUMXPROC __glewFrustumx = NULL;
-PFNGLLIGHTMODELXPROC __glewLightModelx = NULL;
-PFNGLLIGHTMODELXVPROC __glewLightModelxv = NULL;
-PFNGLLIGHTXPROC __glewLightx = NULL;
-PFNGLLIGHTXVPROC __glewLightxv = NULL;
-PFNGLLINEWIDTHXPROC __glewLineWidthx = NULL;
-PFNGLLOADMATRIXXPROC __glewLoadMatrixx = NULL;
-PFNGLMATERIALXPROC __glewMaterialx = NULL;
-PFNGLMATERIALXVPROC __glewMaterialxv = NULL;
-PFNGLMULTMATRIXXPROC __glewMultMatrixx = NULL;
-PFNGLMULTITEXCOORD4XPROC __glewMultiTexCoord4x = NULL;
-PFNGLNORMAL3XPROC __glewNormal3x = NULL;
-PFNGLORTHOFPROC __glewOrthof = NULL;
-PFNGLORTHOXPROC __glewOrthox = NULL;
-PFNGLPOINTSIZEXPROC __glewPointSizex = NULL;
-PFNGLPOLYGONOFFSETXPROC __glewPolygonOffsetx = NULL;
-PFNGLROTATEXPROC __glewRotatex = NULL;
-PFNGLSAMPLECOVERAGEXPROC __glewSampleCoveragex = NULL;
-PFNGLSCALEXPROC __glewScalex = NULL;
-PFNGLTEXENVXPROC __glewTexEnvx = NULL;
-PFNGLTEXENVXVPROC __glewTexEnvxv = NULL;
-PFNGLTEXPARAMETERXPROC __glewTexParameterx = NULL;
-PFNGLTRANSLATEXPROC __glewTranslatex = NULL;
-
-PFNGLCLIPPLANEFPROC __glewClipPlanef = NULL;
-PFNGLCLIPPLANEXPROC __glewClipPlanex = NULL;
-PFNGLGETCLIPPLANEFPROC __glewGetClipPlanef = NULL;
-PFNGLGETCLIPPLANEXPROC __glewGetClipPlanex = NULL;
-PFNGLGETFIXEDVPROC __glewGetFixedv = NULL;
-PFNGLGETLIGHTXVPROC __glewGetLightxv = NULL;
-PFNGLGETMATERIALXVPROC __glewGetMaterialxv = NULL;
-PFNGLGETTEXENVXVPROC __glewGetTexEnvxv = NULL;
-PFNGLGETTEXPARAMETERXVPROC __glewGetTexParameterxv = NULL;
-PFNGLPOINTPARAMETERXPROC __glewPointParameterx = NULL;
-PFNGLPOINTPARAMETERXVPROC __glewPointParameterxv = NULL;
-PFNGLPOINTSIZEPOINTEROESPROC __glewPointSizePointerOES = NULL;
-PFNGLTEXPARAMETERXVPROC __glewTexParameterxv = NULL;
-
-PFNGLERRORSTRINGREGALPROC __glewErrorStringREGAL = NULL;
-
-PFNGLGETEXTENSIONREGALPROC __glewGetExtensionREGAL = NULL;
-PFNGLISSUPPORTEDREGALPROC __glewIsSupportedREGAL = NULL;
-
-PFNGLLOGMESSAGECALLBACKREGALPROC __glewLogMessageCallbackREGAL = NULL;
-
-PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL;
-PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL;
-
-PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL;
-PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL;
-
-PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL;
-PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL;
-
-PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL;
-PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL;
-
-PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL;
-PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL;
-
-PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL;
-PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL;
-
-PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL;
-PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL;
-PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL;
-PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL;
-PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL;
-PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL;
-
-PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL;
-
-PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL;
-
-PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL;
-PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL;
-PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL;
-PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL;
-PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL;
-PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL;
-PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL;
-PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL;
-PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL;
-PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL;
-PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL;
-PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL;
-PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL;
-PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL;
-PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL;
-PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL;
-PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL;
-
-PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL;
-
-PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL;
-
-PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL;
-
-PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL;
-PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL;
-PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL;
-PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL;
-
-PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL;
-
-PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL;
-PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL;
-PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL;
-PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL;
-PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL;
-PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL;
-PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL;
-
-PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL;
-
-PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL;
-PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL;
-PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL;
-PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL;
-PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL;
-PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL;
-PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL;
-PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL;
-
-PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL;
-
-PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL;
-PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL;
-PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL;
-PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL;
-PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL;
-PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL;
-PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL;
-
-PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL;
-PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL;
-PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL;
-PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL;
-PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL;
-PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL;
-PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL;
-PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL;
-PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL;
-PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL;
-PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL;
-PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL;
-PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL;
-PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL;
-PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL;
-PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL;
-PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL;
-PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL;
-PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL;
-PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL;
-PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL;
-PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL;
-PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL;
-PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL;
-PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL;
-PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL;
-
-PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL;
-
-#endif /* !WIN32 || !GLEW_MX */
-
-#if !defined(GLEW_MX)
-
-GLboolean __GLEW_VERSION_1_1 = GL_FALSE;
-GLboolean __GLEW_VERSION_1_2 = GL_FALSE;
-GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE;
-GLboolean __GLEW_VERSION_1_3 = GL_FALSE;
-GLboolean __GLEW_VERSION_1_4 = GL_FALSE;
-GLboolean __GLEW_VERSION_1_5 = GL_FALSE;
-GLboolean __GLEW_VERSION_2_0 = GL_FALSE;
-GLboolean __GLEW_VERSION_2_1 = GL_FALSE;
-GLboolean __GLEW_VERSION_3_0 = GL_FALSE;
-GLboolean __GLEW_VERSION_3_1 = GL_FALSE;
-GLboolean __GLEW_VERSION_3_2 = GL_FALSE;
-GLboolean __GLEW_VERSION_3_3 = GL_FALSE;
-GLboolean __GLEW_VERSION_4_0 = GL_FALSE;
-GLboolean __GLEW_VERSION_4_1 = GL_FALSE;
-GLboolean __GLEW_VERSION_4_2 = GL_FALSE;
-GLboolean __GLEW_VERSION_4_3 = GL_FALSE;
-GLboolean __GLEW_VERSION_4_4 = GL_FALSE;
-GLboolean __GLEW_3DFX_multisample = GL_FALSE;
-GLboolean __GLEW_3DFX_tbuffer = GL_FALSE;
-GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE;
-GLboolean __GLEW_AMD_blend_minmax_factor = GL_FALSE;
-GLboolean __GLEW_AMD_conservative_depth = GL_FALSE;
-GLboolean __GLEW_AMD_debug_output = GL_FALSE;
-GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE;
-GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE;
-GLboolean __GLEW_AMD_interleaved_elements = GL_FALSE;
-GLboolean __GLEW_AMD_multi_draw_indirect = GL_FALSE;
-GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE;
-GLboolean __GLEW_AMD_performance_monitor = GL_FALSE;
-GLboolean __GLEW_AMD_pinned_memory = GL_FALSE;
-GLboolean __GLEW_AMD_query_buffer_object = GL_FALSE;
-GLboolean __GLEW_AMD_sample_positions = GL_FALSE;
-GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE;
-GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE;
-GLboolean __GLEW_AMD_shader_trinary_minmax = GL_FALSE;
-GLboolean __GLEW_AMD_sparse_texture = GL_FALSE;
-GLboolean __GLEW_AMD_stencil_operation_extended = GL_FALSE;
-GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE;
-GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE;
-GLboolean __GLEW_AMD_vertex_shader_layer = GL_FALSE;
-GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE;
-GLboolean __GLEW_AMD_vertex_shader_viewport_index = GL_FALSE;
-GLboolean __GLEW_ANGLE_depth_texture = GL_FALSE;
-GLboolean __GLEW_ANGLE_framebuffer_blit = GL_FALSE;
-GLboolean __GLEW_ANGLE_framebuffer_multisample = GL_FALSE;
-GLboolean __GLEW_ANGLE_instanced_arrays = GL_FALSE;
-GLboolean __GLEW_ANGLE_pack_reverse_row_order = GL_FALSE;
-GLboolean __GLEW_ANGLE_program_binary = GL_FALSE;
-GLboolean __GLEW_ANGLE_texture_compression_dxt1 = GL_FALSE;
-GLboolean __GLEW_ANGLE_texture_compression_dxt3 = GL_FALSE;
-GLboolean __GLEW_ANGLE_texture_compression_dxt5 = GL_FALSE;
-GLboolean __GLEW_ANGLE_texture_usage = GL_FALSE;
-GLboolean __GLEW_ANGLE_timer_query = GL_FALSE;
-GLboolean __GLEW_ANGLE_translated_shader_source = GL_FALSE;
-GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE;
-GLboolean __GLEW_APPLE_client_storage = GL_FALSE;
-GLboolean __GLEW_APPLE_element_array = GL_FALSE;
-GLboolean __GLEW_APPLE_fence = GL_FALSE;
-GLboolean __GLEW_APPLE_float_pixels = GL_FALSE;
-GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE;
-GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE;
-GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE;
-GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE;
-GLboolean __GLEW_APPLE_row_bytes = GL_FALSE;
-GLboolean __GLEW_APPLE_specular_vector = GL_FALSE;
-GLboolean __GLEW_APPLE_texture_range = GL_FALSE;
-GLboolean __GLEW_APPLE_transform_hint = GL_FALSE;
-GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE;
-GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE;
-GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE;
-GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE;
-GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE;
-GLboolean __GLEW_ARB_ES3_compatibility = GL_FALSE;
-GLboolean __GLEW_ARB_arrays_of_arrays = GL_FALSE;
-GLboolean __GLEW_ARB_base_instance = GL_FALSE;
-GLboolean __GLEW_ARB_bindless_texture = GL_FALSE;
-GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE;
-GLboolean __GLEW_ARB_buffer_storage = GL_FALSE;
-GLboolean __GLEW_ARB_cl_event = GL_FALSE;
-GLboolean __GLEW_ARB_clear_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_clear_texture = GL_FALSE;
-GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE;
-GLboolean __GLEW_ARB_compatibility = GL_FALSE;
-GLboolean __GLEW_ARB_compressed_texture_pixel_storage = GL_FALSE;
-GLboolean __GLEW_ARB_compute_shader = GL_FALSE;
-GLboolean __GLEW_ARB_compute_variable_group_size = GL_FALSE;
-GLboolean __GLEW_ARB_conservative_depth = GL_FALSE;
-GLboolean __GLEW_ARB_copy_buffer = GL_FALSE;
-GLboolean __GLEW_ARB_copy_image = GL_FALSE;
-GLboolean __GLEW_ARB_debug_output = GL_FALSE;
-GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE;
-GLboolean __GLEW_ARB_depth_clamp = GL_FALSE;
-GLboolean __GLEW_ARB_depth_texture = GL_FALSE;
-GLboolean __GLEW_ARB_draw_buffers = GL_FALSE;
-GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE;
-GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE;
-GLboolean __GLEW_ARB_draw_indirect = GL_FALSE;
-GLboolean __GLEW_ARB_draw_instanced = GL_FALSE;
-GLboolean __GLEW_ARB_enhanced_layouts = GL_FALSE;
-GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE;
-GLboolean __GLEW_ARB_explicit_uniform_location = GL_FALSE;
-GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE;
-GLboolean __GLEW_ARB_fragment_layer_viewport = GL_FALSE;
-GLboolean __GLEW_ARB_fragment_program = GL_FALSE;
-GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE;
-GLboolean __GLEW_ARB_fragment_shader = GL_FALSE;
-GLboolean __GLEW_ARB_framebuffer_no_attachments = GL_FALSE;
-GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE;
-GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE;
-GLboolean __GLEW_ARB_get_program_binary = GL_FALSE;
-GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE;
-GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE;
-GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE;
-GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE;
-GLboolean __GLEW_ARB_imaging = GL_FALSE;
-GLboolean __GLEW_ARB_indirect_parameters = GL_FALSE;
-GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE;
-GLboolean __GLEW_ARB_internalformat_query = GL_FALSE;
-GLboolean __GLEW_ARB_internalformat_query2 = GL_FALSE;
-GLboolean __GLEW_ARB_invalidate_subdata = GL_FALSE;
-GLboolean __GLEW_ARB_map_buffer_alignment = GL_FALSE;
-GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE;
-GLboolean __GLEW_ARB_matrix_palette = GL_FALSE;
-GLboolean __GLEW_ARB_multi_bind = GL_FALSE;
-GLboolean __GLEW_ARB_multi_draw_indirect = GL_FALSE;
-GLboolean __GLEW_ARB_multisample = GL_FALSE;
-GLboolean __GLEW_ARB_multitexture = GL_FALSE;
-GLboolean __GLEW_ARB_occlusion_query = GL_FALSE;
-GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE;
-GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_point_parameters = GL_FALSE;
-GLboolean __GLEW_ARB_point_sprite = GL_FALSE;
-GLboolean __GLEW_ARB_program_interface_query = GL_FALSE;
-GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE;
-GLboolean __GLEW_ARB_query_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_robust_buffer_access_behavior = GL_FALSE;
-GLboolean __GLEW_ARB_robustness = GL_FALSE;
-GLboolean __GLEW_ARB_robustness_application_isolation = GL_FALSE;
-GLboolean __GLEW_ARB_robustness_share_group_isolation = GL_FALSE;
-GLboolean __GLEW_ARB_sample_shading = GL_FALSE;
-GLboolean __GLEW_ARB_sampler_objects = GL_FALSE;
-GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE;
-GLboolean __GLEW_ARB_seamless_cubemap_per_texture = GL_FALSE;
-GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE;
-GLboolean __GLEW_ARB_shader_atomic_counters = GL_FALSE;
-GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE;
-GLboolean __GLEW_ARB_shader_draw_parameters = GL_FALSE;
-GLboolean __GLEW_ARB_shader_group_vote = GL_FALSE;
-GLboolean __GLEW_ARB_shader_image_load_store = GL_FALSE;
-GLboolean __GLEW_ARB_shader_image_size = GL_FALSE;
-GLboolean __GLEW_ARB_shader_objects = GL_FALSE;
-GLboolean __GLEW_ARB_shader_precision = GL_FALSE;
-GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE;
-GLboolean __GLEW_ARB_shader_storage_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE;
-GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE;
-GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE;
-GLboolean __GLEW_ARB_shading_language_420pack = GL_FALSE;
-GLboolean __GLEW_ARB_shading_language_include = GL_FALSE;
-GLboolean __GLEW_ARB_shading_language_packing = GL_FALSE;
-GLboolean __GLEW_ARB_shadow = GL_FALSE;
-GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE;
-GLboolean __GLEW_ARB_sparse_texture = GL_FALSE;
-GLboolean __GLEW_ARB_stencil_texturing = GL_FALSE;
-GLboolean __GLEW_ARB_sync = GL_FALSE;
-GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE;
-GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE;
-GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE;
-GLboolean __GLEW_ARB_texture_buffer_range = GL_FALSE;
-GLboolean __GLEW_ARB_texture_compression = GL_FALSE;
-GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE;
-GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE;
-GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE;
-GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE;
-GLboolean __GLEW_ARB_texture_env_add = GL_FALSE;
-GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE;
-GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE;
-GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE;
-GLboolean __GLEW_ARB_texture_float = GL_FALSE;
-GLboolean __GLEW_ARB_texture_gather = GL_FALSE;
-GLboolean __GLEW_ARB_texture_mirror_clamp_to_edge = GL_FALSE;
-GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE;
-GLboolean __GLEW_ARB_texture_multisample = GL_FALSE;
-GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE;
-GLboolean __GLEW_ARB_texture_query_levels = GL_FALSE;
-GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE;
-GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE;
-GLboolean __GLEW_ARB_texture_rg = GL_FALSE;
-GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE;
-GLboolean __GLEW_ARB_texture_stencil8 = GL_FALSE;
-GLboolean __GLEW_ARB_texture_storage = GL_FALSE;
-GLboolean __GLEW_ARB_texture_storage_multisample = GL_FALSE;
-GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE;
-GLboolean __GLEW_ARB_texture_view = GL_FALSE;
-GLboolean __GLEW_ARB_timer_query = GL_FALSE;
-GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE;
-GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE;
-GLboolean __GLEW_ARB_transform_feedback_instanced = GL_FALSE;
-GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE;
-GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_attrib_binding = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_blend = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_program = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_shader = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_type_10f_11f_11f_rev = GL_FALSE;
-GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE;
-GLboolean __GLEW_ARB_viewport_array = GL_FALSE;
-GLboolean __GLEW_ARB_window_pos = GL_FALSE;
-GLboolean __GLEW_ATIX_point_sprites = GL_FALSE;
-GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE;
-GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE;
-GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE;
-GLboolean __GLEW_ATI_draw_buffers = GL_FALSE;
-GLboolean __GLEW_ATI_element_array = GL_FALSE;
-GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE;
-GLboolean __GLEW_ATI_fragment_shader = GL_FALSE;
-GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE;
-GLboolean __GLEW_ATI_meminfo = GL_FALSE;
-GLboolean __GLEW_ATI_pn_triangles = GL_FALSE;
-GLboolean __GLEW_ATI_separate_stencil = GL_FALSE;
-GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE;
-GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE;
-GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE;
-GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE;
-GLboolean __GLEW_ATI_texture_float = GL_FALSE;
-GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE;
-GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE;
-GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE;
-GLboolean __GLEW_ATI_vertex_streams = GL_FALSE;
-GLboolean __GLEW_EXT_422_pixels = GL_FALSE;
-GLboolean __GLEW_EXT_Cg_shader = GL_FALSE;
-GLboolean __GLEW_EXT_abgr = GL_FALSE;
-GLboolean __GLEW_EXT_bgra = GL_FALSE;
-GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE;
-GLboolean __GLEW_EXT_blend_color = GL_FALSE;
-GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE;
-GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE;
-GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE;
-GLboolean __GLEW_EXT_blend_minmax = GL_FALSE;
-GLboolean __GLEW_EXT_blend_subtract = GL_FALSE;
-GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE;
-GLboolean __GLEW_EXT_cmyka = GL_FALSE;
-GLboolean __GLEW_EXT_color_subtable = GL_FALSE;
-GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE;
-GLboolean __GLEW_EXT_convolution = GL_FALSE;
-GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE;
-GLboolean __GLEW_EXT_copy_texture = GL_FALSE;
-GLboolean __GLEW_EXT_cull_vertex = GL_FALSE;
-GLboolean __GLEW_EXT_debug_marker = GL_FALSE;
-GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE;
-GLboolean __GLEW_EXT_direct_state_access = GL_FALSE;
-GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE;
-GLboolean __GLEW_EXT_draw_instanced = GL_FALSE;
-GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE;
-GLboolean __GLEW_EXT_fog_coord = GL_FALSE;
-GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE;
-GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE;
-GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE;
-GLboolean __GLEW_EXT_framebuffer_multisample_blit_scaled = GL_FALSE;
-GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE;
-GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE;
-GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE;
-GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE;
-GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE;
-GLboolean __GLEW_EXT_histogram = GL_FALSE;
-GLboolean __GLEW_EXT_index_array_formats = GL_FALSE;
-GLboolean __GLEW_EXT_index_func = GL_FALSE;
-GLboolean __GLEW_EXT_index_material = GL_FALSE;
-GLboolean __GLEW_EXT_index_texture = GL_FALSE;
-GLboolean __GLEW_EXT_light_texture = GL_FALSE;
-GLboolean __GLEW_EXT_misc_attribute = GL_FALSE;
-GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE;
-GLboolean __GLEW_EXT_multisample = GL_FALSE;
-GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE;
-GLboolean __GLEW_EXT_packed_float = GL_FALSE;
-GLboolean __GLEW_EXT_packed_pixels = GL_FALSE;
-GLboolean __GLEW_EXT_paletted_texture = GL_FALSE;
-GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE;
-GLboolean __GLEW_EXT_pixel_transform = GL_FALSE;
-GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE;
-GLboolean __GLEW_EXT_point_parameters = GL_FALSE;
-GLboolean __GLEW_EXT_polygon_offset = GL_FALSE;
-GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE;
-GLboolean __GLEW_EXT_rescale_normal = GL_FALSE;
-GLboolean __GLEW_EXT_scene_marker = GL_FALSE;
-GLboolean __GLEW_EXT_secondary_color = GL_FALSE;
-GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE;
-GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE;
-GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE;
-GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE;
-GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE;
-GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE;
-GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE;
-GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE;
-GLboolean __GLEW_EXT_subtexture = GL_FALSE;
-GLboolean __GLEW_EXT_texture = GL_FALSE;
-GLboolean __GLEW_EXT_texture3D = GL_FALSE;
-GLboolean __GLEW_EXT_texture_array = GL_FALSE;
-GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE;
-GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE;
-GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE;
-GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE;
-GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE;
-GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE;
-GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE;
-GLboolean __GLEW_EXT_texture_env = GL_FALSE;
-GLboolean __GLEW_EXT_texture_env_add = GL_FALSE;
-GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE;
-GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE;
-GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE;
-GLboolean __GLEW_EXT_texture_integer = GL_FALSE;
-GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE;
-GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE;
-GLboolean __GLEW_EXT_texture_object = GL_FALSE;
-GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE;
-GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE;
-GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE;
-GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE;
-GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE;
-GLboolean __GLEW_EXT_texture_snorm = GL_FALSE;
-GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE;
-GLboolean __GLEW_EXT_timer_query = GL_FALSE;
-GLboolean __GLEW_EXT_transform_feedback = GL_FALSE;
-GLboolean __GLEW_EXT_vertex_array = GL_FALSE;
-GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE;
-GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE;
-GLboolean __GLEW_EXT_vertex_shader = GL_FALSE;
-GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE;
-GLboolean __GLEW_EXT_x11_sync_object = GL_FALSE;
-GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE;
-GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE;
-GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE;
-GLboolean __GLEW_HP_image_transform = GL_FALSE;
-GLboolean __GLEW_HP_occlusion_test = GL_FALSE;
-GLboolean __GLEW_HP_texture_lighting = GL_FALSE;
-GLboolean __GLEW_IBM_cull_vertex = GL_FALSE;
-GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE;
-GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE;
-GLboolean __GLEW_IBM_static_data = GL_FALSE;
-GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE;
-GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE;
-GLboolean __GLEW_INGR_color_clamp = GL_FALSE;
-GLboolean __GLEW_INGR_interlace_read = GL_FALSE;
-GLboolean __GLEW_INTEL_map_texture = GL_FALSE;
-GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE;
-GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE;
-GLboolean __GLEW_KHR_debug = GL_FALSE;
-GLboolean __GLEW_KHR_texture_compression_astc_ldr = GL_FALSE;
-GLboolean __GLEW_KTX_buffer_region = GL_FALSE;
-GLboolean __GLEW_MESAX_texture_stack = GL_FALSE;
-GLboolean __GLEW_MESA_pack_invert = GL_FALSE;
-GLboolean __GLEW_MESA_resize_buffers = GL_FALSE;
-GLboolean __GLEW_MESA_window_pos = GL_FALSE;
-GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE;
-GLboolean __GLEW_NVX_conditional_render = GL_FALSE;
-GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE;
-GLboolean __GLEW_NV_bindless_multi_draw_indirect = GL_FALSE;
-GLboolean __GLEW_NV_bindless_texture = GL_FALSE;
-GLboolean __GLEW_NV_blend_equation_advanced = GL_FALSE;
-GLboolean __GLEW_NV_blend_equation_advanced_coherent = GL_FALSE;
-GLboolean __GLEW_NV_blend_square = GL_FALSE;
-GLboolean __GLEW_NV_compute_program5 = GL_FALSE;
-GLboolean __GLEW_NV_conditional_render = GL_FALSE;
-GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE;
-GLboolean __GLEW_NV_copy_image = GL_FALSE;
-GLboolean __GLEW_NV_deep_texture3D = GL_FALSE;
-GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE;
-GLboolean __GLEW_NV_depth_clamp = GL_FALSE;
-GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE;
-GLboolean __GLEW_NV_draw_texture = GL_FALSE;
-GLboolean __GLEW_NV_evaluators = GL_FALSE;
-GLboolean __GLEW_NV_explicit_multisample = GL_FALSE;
-GLboolean __GLEW_NV_fence = GL_FALSE;
-GLboolean __GLEW_NV_float_buffer = GL_FALSE;
-GLboolean __GLEW_NV_fog_distance = GL_FALSE;
-GLboolean __GLEW_NV_fragment_program = GL_FALSE;
-GLboolean __GLEW_NV_fragment_program2 = GL_FALSE;
-GLboolean __GLEW_NV_fragment_program4 = GL_FALSE;
-GLboolean __GLEW_NV_fragment_program_option = GL_FALSE;
-GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE;
-GLboolean __GLEW_NV_geometry_program4 = GL_FALSE;
-GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE;
-GLboolean __GLEW_NV_gpu_program4 = GL_FALSE;
-GLboolean __GLEW_NV_gpu_program5 = GL_FALSE;
-GLboolean __GLEW_NV_gpu_program5_mem_extended = GL_FALSE;
-GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE;
-GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE;
-GLboolean __GLEW_NV_half_float = GL_FALSE;
-GLboolean __GLEW_NV_light_max_exponent = GL_FALSE;
-GLboolean __GLEW_NV_multisample_coverage = GL_FALSE;
-GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE;
-GLboolean __GLEW_NV_occlusion_query = GL_FALSE;
-GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE;
-GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE;
-GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE;
-GLboolean __GLEW_NV_path_rendering = GL_FALSE;
-GLboolean __GLEW_NV_pixel_data_range = GL_FALSE;
-GLboolean __GLEW_NV_point_sprite = GL_FALSE;
-GLboolean __GLEW_NV_present_video = GL_FALSE;
-GLboolean __GLEW_NV_primitive_restart = GL_FALSE;
-GLboolean __GLEW_NV_register_combiners = GL_FALSE;
-GLboolean __GLEW_NV_register_combiners2 = GL_FALSE;
-GLboolean __GLEW_NV_shader_atomic_counters = GL_FALSE;
-GLboolean __GLEW_NV_shader_atomic_float = GL_FALSE;
-GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE;
-GLboolean __GLEW_NV_shader_storage_buffer_object = GL_FALSE;
-GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE;
-GLboolean __GLEW_NV_texgen_emboss = GL_FALSE;
-GLboolean __GLEW_NV_texgen_reflection = GL_FALSE;
-GLboolean __GLEW_NV_texture_barrier = GL_FALSE;
-GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE;
-GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE;
-GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE;
-GLboolean __GLEW_NV_texture_multisample = GL_FALSE;
-GLboolean __GLEW_NV_texture_rectangle = GL_FALSE;
-GLboolean __GLEW_NV_texture_shader = GL_FALSE;
-GLboolean __GLEW_NV_texture_shader2 = GL_FALSE;
-GLboolean __GLEW_NV_texture_shader3 = GL_FALSE;
-GLboolean __GLEW_NV_transform_feedback = GL_FALSE;
-GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE;
-GLboolean __GLEW_NV_vdpau_interop = GL_FALSE;
-GLboolean __GLEW_NV_vertex_array_range = GL_FALSE;
-GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE;
-GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE;
-GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program2 = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program3 = GL_FALSE;
-GLboolean __GLEW_NV_vertex_program4 = GL_FALSE;
-GLboolean __GLEW_NV_video_capture = GL_FALSE;
-GLboolean __GLEW_OES_byte_coordinates = GL_FALSE;
-GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE;
-GLboolean __GLEW_OES_read_format = GL_FALSE;
-GLboolean __GLEW_OES_single_precision = GL_FALSE;
-GLboolean __GLEW_OML_interlace = GL_FALSE;
-GLboolean __GLEW_OML_resample = GL_FALSE;
-GLboolean __GLEW_OML_subsample = GL_FALSE;
-GLboolean __GLEW_PGI_misc_hints = GL_FALSE;
-GLboolean __GLEW_PGI_vertex_hints = GL_FALSE;
-GLboolean __GLEW_REGAL_ES1_0_compatibility = GL_FALSE;
-GLboolean __GLEW_REGAL_ES1_1_compatibility = GL_FALSE;
-GLboolean __GLEW_REGAL_enable = GL_FALSE;
-GLboolean __GLEW_REGAL_error_string = GL_FALSE;
-GLboolean __GLEW_REGAL_extension_query = GL_FALSE;
-GLboolean __GLEW_REGAL_log = GL_FALSE;
-GLboolean __GLEW_REND_screen_coordinates = GL_FALSE;
-GLboolean __GLEW_S3_s3tc = GL_FALSE;
-GLboolean __GLEW_SGIS_color_range = GL_FALSE;
-GLboolean __GLEW_SGIS_detail_texture = GL_FALSE;
-GLboolean __GLEW_SGIS_fog_function = GL_FALSE;
-GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE;
-GLboolean __GLEW_SGIS_multisample = GL_FALSE;
-GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE;
-GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE;
-GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE;
-GLboolean __GLEW_SGIS_texture4D = GL_FALSE;
-GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE;
-GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE;
-GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE;
-GLboolean __GLEW_SGIS_texture_lod = GL_FALSE;
-GLboolean __GLEW_SGIS_texture_select = GL_FALSE;
-GLboolean __GLEW_SGIX_async = GL_FALSE;
-GLboolean __GLEW_SGIX_async_histogram = GL_FALSE;
-GLboolean __GLEW_SGIX_async_pixel = GL_FALSE;
-GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE;
-GLboolean __GLEW_SGIX_clipmap = GL_FALSE;
-GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE;
-GLboolean __GLEW_SGIX_depth_texture = GL_FALSE;
-GLboolean __GLEW_SGIX_flush_raster = GL_FALSE;
-GLboolean __GLEW_SGIX_fog_offset = GL_FALSE;
-GLboolean __GLEW_SGIX_fog_texture = GL_FALSE;
-GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE;
-GLboolean __GLEW_SGIX_framezoom = GL_FALSE;
-GLboolean __GLEW_SGIX_interlace = GL_FALSE;
-GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE;
-GLboolean __GLEW_SGIX_list_priority = GL_FALSE;
-GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE;
-GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE;
-GLboolean __GLEW_SGIX_reference_plane = GL_FALSE;
-GLboolean __GLEW_SGIX_resample = GL_FALSE;
-GLboolean __GLEW_SGIX_shadow = GL_FALSE;
-GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE;
-GLboolean __GLEW_SGIX_sprite = GL_FALSE;
-GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_range = GL_FALSE;
-GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE;
-GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE;
-GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE;
-GLboolean __GLEW_SGIX_ycrcb = GL_FALSE;
-GLboolean __GLEW_SGI_color_matrix = GL_FALSE;
-GLboolean __GLEW_SGI_color_table = GL_FALSE;
-GLboolean __GLEW_SGI_texture_color_table = GL_FALSE;
-GLboolean __GLEW_SUNX_constant_data = GL_FALSE;
-GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE;
-GLboolean __GLEW_SUN_global_alpha = GL_FALSE;
-GLboolean __GLEW_SUN_mesh_array = GL_FALSE;
-GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE;
-GLboolean __GLEW_SUN_slice_accum = GL_FALSE;
-GLboolean __GLEW_SUN_triangle_list = GL_FALSE;
-GLboolean __GLEW_SUN_vertex = GL_FALSE;
-GLboolean __GLEW_WIN_phong_shading = GL_FALSE;
-GLboolean __GLEW_WIN_specular_fog = GL_FALSE;
-GLboolean __GLEW_WIN_swap_hint = GL_FALSE;
-
-#endif /* !GLEW_MX */
-
-#ifdef GL_VERSION_1_2
-
-static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r;
- r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r;
- r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r;
- r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_1_2 */
-
-#ifdef GL_VERSION_1_2_1
-
-#endif /* GL_VERSION_1_2_1 */
-
-#ifdef GL_VERSION_1_3
-
-static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r;
- r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r;
- r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r;
- r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r;
- r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r;
- r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r;
- r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r;
- r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r;
- r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r;
- r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r;
- r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r;
- r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r;
- r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r;
- r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r;
- r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r;
- r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r;
- r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r;
- r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r;
- r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r;
- r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r;
- r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r;
- r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r;
- r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r;
- r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r;
- r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r;
- r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r;
- r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r;
- r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r;
- r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r;
- r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r;
- r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r;
- r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r;
- r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r;
- r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r;
- r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r;
- r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r;
- r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r;
- r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r;
- r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r;
- r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r;
- r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r;
- r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r;
- r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r;
- r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r;
- r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r;
- r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_1_3 */
-
-#ifdef GL_VERSION_1_4
-
-static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r;
- r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r;
- r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r;
- r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r;
- r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r;
- r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r;
- r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r;
- r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r;
- r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r;
- r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r;
- r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r;
- r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r;
- r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r;
- r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r;
- r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r;
- r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r;
- r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r;
- r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r;
- r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r;
- r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r;
- r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r;
- r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r;
- r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r;
- r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r;
- r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r;
- r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r;
- r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r;
- r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r;
- r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r;
- r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r;
- r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r;
- r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r;
- r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r;
- r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r;
- r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r;
- r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r;
- r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r;
- r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r;
- r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r;
- r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r;
- r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r;
- r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r;
- r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r;
- r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r;
- r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r;
- r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r;
- r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_1_4 */
-
-#ifdef GL_VERSION_1_5
-
-static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r;
- r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r;
- r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r;
- r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r;
- r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r;
- r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r;
- r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r;
- r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r;
- r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r;
- r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r;
- r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r;
- r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r;
- r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r;
- r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r;
- r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r;
- r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r;
- r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r;
- r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r;
- r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_1_5 */
-
-#ifdef GL_VERSION_2_0
-
-static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r;
- r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r;
- r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r;
- r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r;
- r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r;
- r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r;
- r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r;
- r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r;
- r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r;
- r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r;
- r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r;
- r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r;
- r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r;
- r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r;
- r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r;
- r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r;
- r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r;
- r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r;
- r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r;
- r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r;
- r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r;
- r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r;
- r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r;
- r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r;
- r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r;
- r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r;
- r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r;
- r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r;
- r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r;
- r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r;
- r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r;
- r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r;
- r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r;
- r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r;
- r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r;
- r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r;
- r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r;
- r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r;
- r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r;
- r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r;
- r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r;
- r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r;
- r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r;
- r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r;
- r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r;
- r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r;
- r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r;
- r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r;
- r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r;
- r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r;
- r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r;
- r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r;
- r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r;
- r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r;
- r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r;
- r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r;
- r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r;
- r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r;
- r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r;
- r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r;
- r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r;
- r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r;
- r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r;
- r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r;
- r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r;
- r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r;
- r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r;
- r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r;
- r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r;
- r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r;
- r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r;
- r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r;
- r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r;
- r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r;
- r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r;
- r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r;
- r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r;
- r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r;
- r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r;
- r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r;
- r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r;
- r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r;
- r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r;
- r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r;
- r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r;
- r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r;
- r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r;
- r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r;
- r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r;
- r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r;
- r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r;
- r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r;
- r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_2_0 */
-
-#ifdef GL_VERSION_2_1
-
-static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r;
- r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r;
- r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r;
- r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r;
- r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r;
- r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_2_1 */
-
-#ifdef GL_VERSION_3_0
-
-static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r;
- r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r;
- r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r;
- r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r;
- r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r;
- r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r;
- r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r;
- r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r;
- r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r;
- r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r;
- r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r;
- r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r;
- r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r;
- r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r;
- r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r;
- r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r;
- r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r;
- r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r;
- r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r;
- r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r;
- r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r;
- r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r;
- r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r;
- r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r;
- r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r;
- r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r;
- r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r;
- r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r;
- r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r;
- r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r;
- r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r;
- r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r;
- r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r;
- r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r;
- r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r;
- r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r;
- r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r;
- r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r;
- r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r;
- r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r;
- r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r;
- r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r;
- r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r;
- r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r;
- r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r;
- r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r;
- r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r;
- r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r;
- r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r;
- r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r;
- r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r;
- r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r;
- r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r;
- r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r;
- r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_3_0 */
-
-#ifdef GL_VERSION_3_1
-
-static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r;
- r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r;
- r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r;
- r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_3_1 */
-
-#ifdef GL_VERSION_3_2
-
-static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r;
- r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r;
- r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_3_2 */
-
-#ifdef GL_VERSION_3_3
-
-static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_3_3 */
-
-#ifdef GL_VERSION_4_0
-
-static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r;
- r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r;
- r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r;
- r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r;
- r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_VERSION_4_0 */
-
-#ifdef GL_VERSION_4_1
-
-#endif /* GL_VERSION_4_1 */
-
-#ifdef GL_VERSION_4_2
-
-#endif /* GL_VERSION_4_2 */
-
-#ifdef GL_VERSION_4_3
-
-#endif /* GL_VERSION_4_3 */
-
-#ifdef GL_VERSION_4_4
-
-#endif /* GL_VERSION_4_4 */
-
-#ifdef GL_3DFX_multisample
-
-#endif /* GL_3DFX_multisample */
-
-#ifdef GL_3DFX_tbuffer
-
-static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_3DFX_tbuffer */
-
-#ifdef GL_3DFX_texture_compression_FXT1
-
-#endif /* GL_3DFX_texture_compression_FXT1 */
-
-#ifdef GL_AMD_blend_minmax_factor
-
-#endif /* GL_AMD_blend_minmax_factor */
-
-#ifdef GL_AMD_conservative_depth
-
-#endif /* GL_AMD_conservative_depth */
-
-#ifdef GL_AMD_debug_output
-
-static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r;
- r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r;
- r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r;
- r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_debug_output */
-
-#ifdef GL_AMD_depth_clamp_separate
-
-#endif /* GL_AMD_depth_clamp_separate */
-
-#ifdef GL_AMD_draw_buffers_blend
-
-static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r;
- r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r;
- r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r;
- r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_draw_buffers_blend */
-
-#ifdef GL_AMD_interleaved_elements
-
-static GLboolean _glewInit_GL_AMD_interleaved_elements (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glVertexAttribParameteriAMD = (PFNGLVERTEXATTRIBPARAMETERIAMDPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribParameteriAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_interleaved_elements */
-
-#ifdef GL_AMD_multi_draw_indirect
-
-static GLboolean _glewInit_GL_AMD_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiDrawArraysIndirectAMD = (PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectAMD")) == NULL) || r;
- r = ((glMultiDrawElementsIndirectAMD = (PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_multi_draw_indirect */
-
-#ifdef GL_AMD_name_gen_delete
-
-static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r;
- r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r;
- r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_name_gen_delete */
-
-#ifdef GL_AMD_performance_monitor
-
-static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r;
- r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r;
- r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r;
- r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r;
- r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r;
- r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r;
- r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r;
- r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r;
- r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r;
- r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r;
- r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_performance_monitor */
-
-#ifdef GL_AMD_pinned_memory
-
-#endif /* GL_AMD_pinned_memory */
-
-#ifdef GL_AMD_query_buffer_object
-
-#endif /* GL_AMD_query_buffer_object */
-
-#ifdef GL_AMD_sample_positions
-
-static GLboolean _glewInit_GL_AMD_sample_positions (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSetMultisamplefvAMD = (PFNGLSETMULTISAMPLEFVAMDPROC)glewGetProcAddress((const GLubyte*)"glSetMultisamplefvAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_sample_positions */
-
-#ifdef GL_AMD_seamless_cubemap_per_texture
-
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-
-#ifdef GL_AMD_shader_stencil_export
-
-#endif /* GL_AMD_shader_stencil_export */
-
-#ifdef GL_AMD_shader_trinary_minmax
-
-#endif /* GL_AMD_shader_trinary_minmax */
-
-#ifdef GL_AMD_sparse_texture
-
-static GLboolean _glewInit_GL_AMD_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexStorageSparseAMD = (PFNGLTEXSTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTexStorageSparseAMD")) == NULL) || r;
- r = ((glTextureStorageSparseAMD = (PFNGLTEXTURESTORAGESPARSEAMDPROC)glewGetProcAddress((const GLubyte*)"glTextureStorageSparseAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_sparse_texture */
-
-#ifdef GL_AMD_stencil_operation_extended
-
-static GLboolean _glewInit_GL_AMD_stencil_operation_extended (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glStencilOpValueAMD = (PFNGLSTENCILOPVALUEAMDPROC)glewGetProcAddress((const GLubyte*)"glStencilOpValueAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_stencil_operation_extended */
-
-#ifdef GL_AMD_texture_texture4
-
-#endif /* GL_AMD_texture_texture4 */
-
-#ifdef GL_AMD_transform_feedback3_lines_triangles
-
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-
-#ifdef GL_AMD_vertex_shader_layer
-
-#endif /* GL_AMD_vertex_shader_layer */
-
-#ifdef GL_AMD_vertex_shader_tessellator
-
-static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r;
- r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_AMD_vertex_shader_tessellator */
-
-#ifdef GL_AMD_vertex_shader_viewport_index
-
-#endif /* GL_AMD_vertex_shader_viewport_index */
-
-#ifdef GL_ANGLE_depth_texture
-
-#endif /* GL_ANGLE_depth_texture */
-
-#ifdef GL_ANGLE_framebuffer_blit
-
-static GLboolean _glewInit_GL_ANGLE_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlitFramebufferANGLE = (PFNGLBLITFRAMEBUFFERANGLEPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferANGLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ANGLE_framebuffer_blit */
-
-#ifdef GL_ANGLE_framebuffer_multisample
-
-static GLboolean _glewInit_GL_ANGLE_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glRenderbufferStorageMultisampleANGLE = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleANGLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ANGLE_framebuffer_multisample */
-
-#ifdef GL_ANGLE_instanced_arrays
-
-static GLboolean _glewInit_GL_ANGLE_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysInstancedANGLE = (PFNGLDRAWARRAYSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedANGLE")) == NULL) || r;
- r = ((glDrawElementsInstancedANGLE = (PFNGLDRAWELEMENTSINSTANCEDANGLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedANGLE")) == NULL) || r;
- r = ((glVertexAttribDivisorANGLE = (PFNGLVERTEXATTRIBDIVISORANGLEPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorANGLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ANGLE_instanced_arrays */
-
-#ifdef GL_ANGLE_pack_reverse_row_order
-
-#endif /* GL_ANGLE_pack_reverse_row_order */
-
-#ifdef GL_ANGLE_program_binary
-
-#endif /* GL_ANGLE_program_binary */
-
-#ifdef GL_ANGLE_texture_compression_dxt1
-
-#endif /* GL_ANGLE_texture_compression_dxt1 */
-
-#ifdef GL_ANGLE_texture_compression_dxt3
-
-#endif /* GL_ANGLE_texture_compression_dxt3 */
-
-#ifdef GL_ANGLE_texture_compression_dxt5
-
-#endif /* GL_ANGLE_texture_compression_dxt5 */
-
-#ifdef GL_ANGLE_texture_usage
-
-#endif /* GL_ANGLE_texture_usage */
-
-#ifdef GL_ANGLE_timer_query
-
-static GLboolean _glewInit_GL_ANGLE_timer_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginQueryANGLE = (PFNGLBEGINQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryANGLE")) == NULL) || r;
- r = ((glDeleteQueriesANGLE = (PFNGLDELETEQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesANGLE")) == NULL) || r;
- r = ((glEndQueryANGLE = (PFNGLENDQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glEndQueryANGLE")) == NULL) || r;
- r = ((glGenQueriesANGLE = (PFNGLGENQUERIESANGLEPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesANGLE")) == NULL) || r;
- r = ((glGetQueryObjecti64vANGLE = (PFNGLGETQUERYOBJECTI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vANGLE")) == NULL) || r;
- r = ((glGetQueryObjectivANGLE = (PFNGLGETQUERYOBJECTIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivANGLE")) == NULL) || r;
- r = ((glGetQueryObjectui64vANGLE = (PFNGLGETQUERYOBJECTUI64VANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vANGLE")) == NULL) || r;
- r = ((glGetQueryObjectuivANGLE = (PFNGLGETQUERYOBJECTUIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivANGLE")) == NULL) || r;
- r = ((glGetQueryivANGLE = (PFNGLGETQUERYIVANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivANGLE")) == NULL) || r;
- r = ((glIsQueryANGLE = (PFNGLISQUERYANGLEPROC)glewGetProcAddress((const GLubyte*)"glIsQueryANGLE")) == NULL) || r;
- r = ((glQueryCounterANGLE = (PFNGLQUERYCOUNTERANGLEPROC)glewGetProcAddress((const GLubyte*)"glQueryCounterANGLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ANGLE_timer_query */
-
-#ifdef GL_ANGLE_translated_shader_source
-
-static GLboolean _glewInit_GL_ANGLE_translated_shader_source (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetTranslatedShaderSourceANGLE = (PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)glewGetProcAddress((const GLubyte*)"glGetTranslatedShaderSourceANGLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ANGLE_translated_shader_source */
-
-#ifdef GL_APPLE_aux_depth_stencil
-
-#endif /* GL_APPLE_aux_depth_stencil */
-
-#ifdef GL_APPLE_client_storage
-
-#endif /* GL_APPLE_client_storage */
-
-#ifdef GL_APPLE_element_array
-
-static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r;
- r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r;
- r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r;
- r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r;
- r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_element_array */
-
-#ifdef GL_APPLE_fence
-
-static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r;
- r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r;
- r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r;
- r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r;
- r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r;
- r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r;
- r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r;
- r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_fence */
-
-#ifdef GL_APPLE_float_pixels
-
-#endif /* GL_APPLE_float_pixels */
-
-#ifdef GL_APPLE_flush_buffer_range
-
-static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r;
- r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_flush_buffer_range */
-
-#ifdef GL_APPLE_object_purgeable
-
-static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r;
- r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r;
- r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_object_purgeable */
-
-#ifdef GL_APPLE_pixel_buffer
-
-#endif /* GL_APPLE_pixel_buffer */
-
-#ifdef GL_APPLE_rgb_422
-
-#endif /* GL_APPLE_rgb_422 */
-
-#ifdef GL_APPLE_row_bytes
-
-#endif /* GL_APPLE_row_bytes */
-
-#ifdef GL_APPLE_specular_vector
-
-#endif /* GL_APPLE_specular_vector */
-
-#ifdef GL_APPLE_texture_range
-
-static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r;
- r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_texture_range */
-
-#ifdef GL_APPLE_transform_hint
-
-#endif /* GL_APPLE_transform_hint */
-
-#ifdef GL_APPLE_vertex_array_object
-
-static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r;
- r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r;
- r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r;
- r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_vertex_array_object */
-
-#ifdef GL_APPLE_vertex_array_range
-
-static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r;
- r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r;
- r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_vertex_array_range */
-
-#ifdef GL_APPLE_vertex_program_evaluators
-
-static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r;
- r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r;
- r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r;
- r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r;
- r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r;
- r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r;
- r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_APPLE_vertex_program_evaluators */
-
-#ifdef GL_APPLE_ycbcr_422
-
-#endif /* GL_APPLE_ycbcr_422 */
-
-#ifdef GL_ARB_ES2_compatibility
-
-static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r;
- r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r;
- r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r;
- r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r;
- r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_ES2_compatibility */
-
-#ifdef GL_ARB_ES3_compatibility
-
-#endif /* GL_ARB_ES3_compatibility */
-
-#ifdef GL_ARB_arrays_of_arrays
-
-#endif /* GL_ARB_arrays_of_arrays */
-
-#ifdef GL_ARB_base_instance
-
-static GLboolean _glewInit_GL_ARB_base_instance (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysInstancedBaseInstance = (PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedBaseInstance")) == NULL) || r;
- r = ((glDrawElementsInstancedBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseInstance")) == NULL) || r;
- r = ((glDrawElementsInstancedBaseVertexBaseInstance = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertexBaseInstance")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_base_instance */
-
-#ifdef GL_ARB_bindless_texture
-
-static GLboolean _glewInit_GL_ARB_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetImageHandleARB = (PFNGLGETIMAGEHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleARB")) == NULL) || r;
- r = ((glGetTextureHandleARB = (PFNGLGETTEXTUREHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleARB")) == NULL) || r;
- r = ((glGetTextureSamplerHandleARB = (PFNGLGETTEXTURESAMPLERHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleARB")) == NULL) || r;
- r = ((glGetVertexAttribLui64vARB = (PFNGLGETVERTEXATTRIBLUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vARB")) == NULL) || r;
- r = ((glIsImageHandleResidentARB = (PFNGLISIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentARB")) == NULL) || r;
- r = ((glIsTextureHandleResidentARB = (PFNGLISTEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentARB")) == NULL) || r;
- r = ((glMakeImageHandleNonResidentARB = (PFNGLMAKEIMAGEHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentARB")) == NULL) || r;
- r = ((glMakeImageHandleResidentARB = (PFNGLMAKEIMAGEHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentARB")) == NULL) || r;
- r = ((glMakeTextureHandleNonResidentARB = (PFNGLMAKETEXTUREHANDLENONRESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentARB")) == NULL) || r;
- r = ((glMakeTextureHandleResidentARB = (PFNGLMAKETEXTUREHANDLERESIDENTARBPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentARB")) == NULL) || r;
- r = ((glProgramUniformHandleui64ARB = (PFNGLPROGRAMUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64ARB")) == NULL) || r;
- r = ((glProgramUniformHandleui64vARB = (PFNGLPROGRAMUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vARB")) == NULL) || r;
- r = ((glUniformHandleui64ARB = (PFNGLUNIFORMHANDLEUI64ARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64ARB")) == NULL) || r;
- r = ((glUniformHandleui64vARB = (PFNGLUNIFORMHANDLEUI64VARBPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vARB")) == NULL) || r;
- r = ((glVertexAttribL1ui64ARB = (PFNGLVERTEXATTRIBL1UI64ARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64ARB")) == NULL) || r;
- r = ((glVertexAttribL1ui64vARB = (PFNGLVERTEXATTRIBL1UI64VARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_bindless_texture */
-
-#ifdef GL_ARB_blend_func_extended
-
-static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r;
- r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_blend_func_extended */
-
-#ifdef GL_ARB_buffer_storage
-
-static GLboolean _glewInit_GL_ARB_buffer_storage (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBufferStorage = (PFNGLBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glBufferStorage")) == NULL) || r;
- r = ((glNamedBufferStorageEXT = (PFNGLNAMEDBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferStorageEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_buffer_storage */
-
-#ifdef GL_ARB_cl_event
-
-static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_cl_event */
-
-#ifdef GL_ARB_clear_buffer_object
-
-static GLboolean _glewInit_GL_ARB_clear_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearBufferData = (PFNGLCLEARBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferData")) == NULL) || r;
- r = ((glClearBufferSubData = (PFNGLCLEARBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glClearBufferSubData")) == NULL) || r;
- r = ((glClearNamedBufferDataEXT = (PFNGLCLEARNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferDataEXT")) == NULL) || r;
- r = ((glClearNamedBufferSubDataEXT = (PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glClearNamedBufferSubDataEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_clear_buffer_object */
-
-#ifdef GL_ARB_clear_texture
-
-static GLboolean _glewInit_GL_ARB_clear_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearTexImage = (PFNGLCLEARTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexImage")) == NULL) || r;
- r = ((glClearTexSubImage = (PFNGLCLEARTEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glClearTexSubImage")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_clear_texture */
-
-#ifdef GL_ARB_color_buffer_float
-
-static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_color_buffer_float */
-
-#ifdef GL_ARB_compatibility
-
-#endif /* GL_ARB_compatibility */
-
-#ifdef GL_ARB_compressed_texture_pixel_storage
-
-#endif /* GL_ARB_compressed_texture_pixel_storage */
-
-#ifdef GL_ARB_compute_shader
-
-static GLboolean _glewInit_GL_ARB_compute_shader (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDispatchCompute = (PFNGLDISPATCHCOMPUTEPROC)glewGetProcAddress((const GLubyte*)"glDispatchCompute")) == NULL) || r;
- r = ((glDispatchComputeIndirect = (PFNGLDISPATCHCOMPUTEINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeIndirect")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_compute_shader */
-
-#ifdef GL_ARB_compute_variable_group_size
-
-static GLboolean _glewInit_GL_ARB_compute_variable_group_size (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDispatchComputeGroupSizeARB = (PFNGLDISPATCHCOMPUTEGROUPSIZEARBPROC)glewGetProcAddress((const GLubyte*)"glDispatchComputeGroupSizeARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_compute_variable_group_size */
-
-#ifdef GL_ARB_conservative_depth
-
-#endif /* GL_ARB_conservative_depth */
-
-#ifdef GL_ARB_copy_buffer
-
-static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_copy_buffer */
-
-#ifdef GL_ARB_copy_image
-
-static GLboolean _glewInit_GL_ARB_copy_image (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyImageSubData = (PFNGLCOPYIMAGESUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubData")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_copy_image */
-
-#ifdef GL_ARB_debug_output
-
-static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r;
- r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r;
- r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r;
- r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_debug_output */
-
-#ifdef GL_ARB_depth_buffer_float
-
-#endif /* GL_ARB_depth_buffer_float */
-
-#ifdef GL_ARB_depth_clamp
-
-#endif /* GL_ARB_depth_clamp */
-
-#ifdef GL_ARB_depth_texture
-
-#endif /* GL_ARB_depth_texture */
-
-#ifdef GL_ARB_draw_buffers
-
-static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_draw_buffers */
-
-#ifdef GL_ARB_draw_buffers_blend
-
-static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r;
- r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r;
- r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r;
- r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_draw_buffers_blend */
-
-#ifdef GL_ARB_draw_elements_base_vertex
-
-static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r;
- r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r;
- r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r;
- r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_draw_elements_base_vertex */
-
-#ifdef GL_ARB_draw_indirect
-
-static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r;
- r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_draw_indirect */
-
-#ifdef GL_ARB_draw_instanced
-
-#endif /* GL_ARB_draw_instanced */
-
-#ifdef GL_ARB_enhanced_layouts
-
-#endif /* GL_ARB_enhanced_layouts */
-
-#ifdef GL_ARB_explicit_attrib_location
-
-#endif /* GL_ARB_explicit_attrib_location */
-
-#ifdef GL_ARB_explicit_uniform_location
-
-#endif /* GL_ARB_explicit_uniform_location */
-
-#ifdef GL_ARB_fragment_coord_conventions
-
-#endif /* GL_ARB_fragment_coord_conventions */
-
-#ifdef GL_ARB_fragment_layer_viewport
-
-#endif /* GL_ARB_fragment_layer_viewport */
-
-#ifdef GL_ARB_fragment_program
-
-#endif /* GL_ARB_fragment_program */
-
-#ifdef GL_ARB_fragment_program_shadow
-
-#endif /* GL_ARB_fragment_program_shadow */
-
-#ifdef GL_ARB_fragment_shader
-
-#endif /* GL_ARB_fragment_shader */
-
-#ifdef GL_ARB_framebuffer_no_attachments
-
-static GLboolean _glewInit_GL_ARB_framebuffer_no_attachments (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFramebufferParameteri = (PFNGLFRAMEBUFFERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glFramebufferParameteri")) == NULL) || r;
- r = ((glGetFramebufferParameteriv = (PFNGLGETFRAMEBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameteriv")) == NULL) || r;
- r = ((glGetNamedFramebufferParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferParameterivEXT")) == NULL) || r;
- r = ((glNamedFramebufferParameteriEXT = (PFNGLNAMEDFRAMEBUFFERPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferParameteriEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_framebuffer_no_attachments */
-
-#ifdef GL_ARB_framebuffer_object
-
-static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r;
- r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r;
- r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r;
- r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r;
- r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r;
- r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r;
- r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r;
- r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r;
- r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r;
- r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r;
- r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r;
- r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r;
- r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r;
- r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r;
- r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r;
- r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r;
- r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r;
- r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r;
- r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r;
- r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_framebuffer_object */
-
-#ifdef GL_ARB_framebuffer_sRGB
-
-#endif /* GL_ARB_framebuffer_sRGB */
-
-#ifdef GL_ARB_geometry_shader4
-
-static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r;
- r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r;
- r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r;
- r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_geometry_shader4 */
-
-#ifdef GL_ARB_get_program_binary
-
-static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r;
- r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r;
- r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_get_program_binary */
-
-#ifdef GL_ARB_gpu_shader5
-
-#endif /* GL_ARB_gpu_shader5 */
-
-#ifdef GL_ARB_gpu_shader_fp64
-
-static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r;
- r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r;
- r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r;
- r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r;
- r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r;
- r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r;
- r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r;
- r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r;
- r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r;
- r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r;
- r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r;
- r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r;
- r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r;
- r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r;
- r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r;
- r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r;
- r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r;
- r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_gpu_shader_fp64 */
-
-#ifdef GL_ARB_half_float_pixel
-
-#endif /* GL_ARB_half_float_pixel */
-
-#ifdef GL_ARB_half_float_vertex
-
-#endif /* GL_ARB_half_float_vertex */
-
-#ifdef GL_ARB_imaging
-
-static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r;
- r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r;
- r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r;
- r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r;
- r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r;
- r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r;
- r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r;
- r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r;
- r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r;
- r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r;
- r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r;
- r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r;
- r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r;
- r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r;
- r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r;
- r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r;
- r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r;
- r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r;
- r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r;
- r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r;
- r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r;
- r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r;
- r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r;
- r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r;
- r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r;
- r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r;
- r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r;
- r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r;
- r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r;
- r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r;
- r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r;
- r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r;
- r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_imaging */
-
-#ifdef GL_ARB_indirect_parameters
-
-static GLboolean _glewInit_GL_ARB_indirect_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiDrawArraysIndirectCountARB = (PFNGLMULTIDRAWARRAYSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectCountARB")) == NULL) || r;
- r = ((glMultiDrawElementsIndirectCountARB = (PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTARBPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectCountARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_indirect_parameters */
-
-#ifdef GL_ARB_instanced_arrays
-
-static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r;
- r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r;
- r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_instanced_arrays */
-
-#ifdef GL_ARB_internalformat_query
-
-static GLboolean _glewInit_GL_ARB_internalformat_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetInternalformativ = (PFNGLGETINTERNALFORMATIVPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformativ")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_internalformat_query */
-
-#ifdef GL_ARB_internalformat_query2
-
-static GLboolean _glewInit_GL_ARB_internalformat_query2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetInternalformati64v = (PFNGLGETINTERNALFORMATI64VPROC)glewGetProcAddress((const GLubyte*)"glGetInternalformati64v")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_internalformat_query2 */
-
-#ifdef GL_ARB_invalidate_subdata
-
-static GLboolean _glewInit_GL_ARB_invalidate_subdata (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glInvalidateBufferData = (PFNGLINVALIDATEBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferData")) == NULL) || r;
- r = ((glInvalidateBufferSubData = (PFNGLINVALIDATEBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glInvalidateBufferSubData")) == NULL) || r;
- r = ((glInvalidateFramebuffer = (PFNGLINVALIDATEFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateFramebuffer")) == NULL) || r;
- r = ((glInvalidateSubFramebuffer = (PFNGLINVALIDATESUBFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glInvalidateSubFramebuffer")) == NULL) || r;
- r = ((glInvalidateTexImage = (PFNGLINVALIDATETEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexImage")) == NULL) || r;
- r = ((glInvalidateTexSubImage = (PFNGLINVALIDATETEXSUBIMAGEPROC)glewGetProcAddress((const GLubyte*)"glInvalidateTexSubImage")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_invalidate_subdata */
-
-#ifdef GL_ARB_map_buffer_alignment
-
-#endif /* GL_ARB_map_buffer_alignment */
-
-#ifdef GL_ARB_map_buffer_range
-
-static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r;
- r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_map_buffer_range */
-
-#ifdef GL_ARB_matrix_palette
-
-static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r;
- r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r;
- r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r;
- r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r;
- r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_matrix_palette */
-
-#ifdef GL_ARB_multi_bind
-
-static GLboolean _glewInit_GL_ARB_multi_bind (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindBuffersBase = (PFNGLBINDBUFFERSBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersBase")) == NULL) || r;
- r = ((glBindBuffersRange = (PFNGLBINDBUFFERSRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBuffersRange")) == NULL) || r;
- r = ((glBindImageTextures = (PFNGLBINDIMAGETEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextures")) == NULL) || r;
- r = ((glBindSamplers = (PFNGLBINDSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glBindSamplers")) == NULL) || r;
- r = ((glBindTextures = (PFNGLBINDTEXTURESPROC)glewGetProcAddress((const GLubyte*)"glBindTextures")) == NULL) || r;
- r = ((glBindVertexBuffers = (PFNGLBINDVERTEXBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffers")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_multi_bind */
-
-#ifdef GL_ARB_multi_draw_indirect
-
-static GLboolean _glewInit_GL_ARB_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiDrawArraysIndirect = (PFNGLMULTIDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirect")) == NULL) || r;
- r = ((glMultiDrawElementsIndirect = (PFNGLMULTIDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirect")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_multi_draw_indirect */
-
-#ifdef GL_ARB_multisample
-
-static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_multisample */
-
-#ifdef GL_ARB_multitexture
-
-static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r;
- r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r;
- r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r;
- r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r;
- r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r;
- r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r;
- r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r;
- r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r;
- r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r;
- r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r;
- r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r;
- r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r;
- r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r;
- r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r;
- r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r;
- r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r;
- r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r;
- r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r;
- r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r;
- r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r;
- r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r;
- r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r;
- r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r;
- r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r;
- r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r;
- r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r;
- r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r;
- r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r;
- r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r;
- r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r;
- r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r;
- r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r;
- r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r;
- r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_multitexture */
-
-#ifdef GL_ARB_occlusion_query
-
-static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r;
- r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r;
- r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r;
- r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r;
- r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r;
- r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r;
- r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r;
- r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_occlusion_query */
-
-#ifdef GL_ARB_occlusion_query2
-
-#endif /* GL_ARB_occlusion_query2 */
-
-#ifdef GL_ARB_pixel_buffer_object
-
-#endif /* GL_ARB_pixel_buffer_object */
-
-#ifdef GL_ARB_point_parameters
-
-static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r;
- r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_point_parameters */
-
-#ifdef GL_ARB_point_sprite
-
-#endif /* GL_ARB_point_sprite */
-
-#ifdef GL_ARB_program_interface_query
-
-static GLboolean _glewInit_GL_ARB_program_interface_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetProgramInterfaceiv = (PFNGLGETPROGRAMINTERFACEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInterfaceiv")) == NULL) || r;
- r = ((glGetProgramResourceIndex = (PFNGLGETPROGRAMRESOURCEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceIndex")) == NULL) || r;
- r = ((glGetProgramResourceLocation = (PFNGLGETPROGRAMRESOURCELOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocation")) == NULL) || r;
- r = ((glGetProgramResourceLocationIndex = (PFNGLGETPROGRAMRESOURCELOCATIONINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceLocationIndex")) == NULL) || r;
- r = ((glGetProgramResourceName = (PFNGLGETPROGRAMRESOURCENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceName")) == NULL) || r;
- r = ((glGetProgramResourceiv = (PFNGLGETPROGRAMRESOURCEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramResourceiv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_program_interface_query */
-
-#ifdef GL_ARB_provoking_vertex
-
-static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_provoking_vertex */
-
-#ifdef GL_ARB_query_buffer_object
-
-#endif /* GL_ARB_query_buffer_object */
-
-#ifdef GL_ARB_robust_buffer_access_behavior
-
-#endif /* GL_ARB_robust_buffer_access_behavior */
-
-#ifdef GL_ARB_robustness
-
-static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetGraphicsResetStatusARB = (PFNGLGETGRAPHICSRESETSTATUSARBPROC)glewGetProcAddress((const GLubyte*)"glGetGraphicsResetStatusARB")) == NULL) || r;
- r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r;
- r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r;
- r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r;
- r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r;
- r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r;
- r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r;
- r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r;
- r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r;
- r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r;
- r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r;
- r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r;
- r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r;
- r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r;
- r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r;
- r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r;
- r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r;
- r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r;
- r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r;
- r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_robustness */
-
-#ifdef GL_ARB_robustness_application_isolation
-
-#endif /* GL_ARB_robustness_application_isolation */
-
-#ifdef GL_ARB_robustness_share_group_isolation
-
-#endif /* GL_ARB_robustness_share_group_isolation */
-
-#ifdef GL_ARB_sample_shading
-
-static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_sample_shading */
-
-#ifdef GL_ARB_sampler_objects
-
-static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r;
- r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r;
- r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r;
- r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r;
- r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r;
- r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r;
- r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r;
- r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r;
- r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r;
- r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r;
- r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r;
- r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r;
- r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r;
- r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_sampler_objects */
-
-#ifdef GL_ARB_seamless_cube_map
-
-#endif /* GL_ARB_seamless_cube_map */
-
-#ifdef GL_ARB_seamless_cubemap_per_texture
-
-#endif /* GL_ARB_seamless_cubemap_per_texture */
-
-#ifdef GL_ARB_separate_shader_objects
-
-static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r;
- r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r;
- r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r;
- r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r;
- r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r;
- r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r;
- r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r;
- r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r;
- r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r;
- r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r;
- r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r;
- r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r;
- r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r;
- r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r;
- r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r;
- r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r;
- r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r;
- r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r;
- r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r;
- r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r;
- r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r;
- r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r;
- r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r;
- r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r;
- r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r;
- r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r;
- r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r;
- r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r;
- r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r;
- r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r;
- r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r;
- r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r;
- r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r;
- r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r;
- r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r;
- r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r;
- r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r;
- r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r;
- r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r;
- r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r;
- r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r;
- r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r;
- r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r;
- r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r;
- r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r;
- r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r;
- r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r;
- r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r;
- r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r;
- r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r;
- r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r;
- r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r;
- r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r;
- r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r;
- r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r;
- r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r;
- r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r;
- r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r;
- r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r;
- r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_separate_shader_objects */
-
-#ifdef GL_ARB_shader_atomic_counters
-
-static GLboolean _glewInit_GL_ARB_shader_atomic_counters (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetActiveAtomicCounterBufferiv = (PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAtomicCounterBufferiv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shader_atomic_counters */
-
-#ifdef GL_ARB_shader_bit_encoding
-
-#endif /* GL_ARB_shader_bit_encoding */
-
-#ifdef GL_ARB_shader_draw_parameters
-
-#endif /* GL_ARB_shader_draw_parameters */
-
-#ifdef GL_ARB_shader_group_vote
-
-#endif /* GL_ARB_shader_group_vote */
-
-#ifdef GL_ARB_shader_image_load_store
-
-static GLboolean _glewInit_GL_ARB_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindImageTexture = (PFNGLBINDIMAGETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glBindImageTexture")) == NULL) || r;
- r = ((glMemoryBarrier = (PFNGLMEMORYBARRIERPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrier")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shader_image_load_store */
-
-#ifdef GL_ARB_shader_image_size
-
-#endif /* GL_ARB_shader_image_size */
-
-#ifdef GL_ARB_shader_objects
-
-static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r;
- r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r;
- r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r;
- r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r;
- r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r;
- r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r;
- r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r;
- r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r;
- r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r;
- r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r;
- r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r;
- r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r;
- r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r;
- r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r;
- r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r;
- r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r;
- r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r;
- r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r;
- r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r;
- r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r;
- r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r;
- r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r;
- r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r;
- r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r;
- r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r;
- r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r;
- r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r;
- r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r;
- r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r;
- r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r;
- r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r;
- r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r;
- r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r;
- r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r;
- r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r;
- r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r;
- r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r;
- r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r;
- r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shader_objects */
-
-#ifdef GL_ARB_shader_precision
-
-#endif /* GL_ARB_shader_precision */
-
-#ifdef GL_ARB_shader_stencil_export
-
-#endif /* GL_ARB_shader_stencil_export */
-
-#ifdef GL_ARB_shader_storage_buffer_object
-
-static GLboolean _glewInit_GL_ARB_shader_storage_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glShaderStorageBlockBinding = (PFNGLSHADERSTORAGEBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glShaderStorageBlockBinding")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shader_storage_buffer_object */
-
-#ifdef GL_ARB_shader_subroutine
-
-static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r;
- r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r;
- r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r;
- r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r;
- r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r;
- r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r;
- r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r;
- r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shader_subroutine */
-
-#ifdef GL_ARB_shader_texture_lod
-
-#endif /* GL_ARB_shader_texture_lod */
-
-#ifdef GL_ARB_shading_language_100
-
-#endif /* GL_ARB_shading_language_100 */
-
-#ifdef GL_ARB_shading_language_420pack
-
-#endif /* GL_ARB_shading_language_420pack */
-
-#ifdef GL_ARB_shading_language_include
-
-static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r;
- r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r;
- r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r;
- r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r;
- r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r;
- r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_shading_language_include */
-
-#ifdef GL_ARB_shading_language_packing
-
-#endif /* GL_ARB_shading_language_packing */
-
-#ifdef GL_ARB_shadow
-
-#endif /* GL_ARB_shadow */
-
-#ifdef GL_ARB_shadow_ambient
-
-#endif /* GL_ARB_shadow_ambient */
-
-#ifdef GL_ARB_sparse_texture
-
-static GLboolean _glewInit_GL_ARB_sparse_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexPageCommitmentARB = (PFNGLTEXPAGECOMMITMENTARBPROC)glewGetProcAddress((const GLubyte*)"glTexPageCommitmentARB")) == NULL) || r;
- r = ((glTexturePageCommitmentEXT = (PFNGLTEXTUREPAGECOMMITMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glTexturePageCommitmentEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_sparse_texture */
-
-#ifdef GL_ARB_stencil_texturing
-
-#endif /* GL_ARB_stencil_texturing */
-
-#ifdef GL_ARB_sync
-
-static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r;
- r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r;
- r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r;
- r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r;
- r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r;
- r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r;
- r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_sync */
-
-#ifdef GL_ARB_tessellation_shader
-
-static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r;
- r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_tessellation_shader */
-
-#ifdef GL_ARB_texture_border_clamp
-
-#endif /* GL_ARB_texture_border_clamp */
-
-#ifdef GL_ARB_texture_buffer_object
-
-static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_buffer_object */
-
-#ifdef GL_ARB_texture_buffer_object_rgb32
-
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-
-#ifdef GL_ARB_texture_buffer_range
-
-static GLboolean _glewInit_GL_ARB_texture_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexBufferRange = (PFNGLTEXBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glTexBufferRange")) == NULL) || r;
- r = ((glTextureBufferRangeEXT = (PFNGLTEXTUREBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferRangeEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_buffer_range */
-
-#ifdef GL_ARB_texture_compression
-
-static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r;
- r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r;
- r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r;
- r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r;
- r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r;
- r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r;
- r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_compression */
-
-#ifdef GL_ARB_texture_compression_bptc
-
-#endif /* GL_ARB_texture_compression_bptc */
-
-#ifdef GL_ARB_texture_compression_rgtc
-
-#endif /* GL_ARB_texture_compression_rgtc */
-
-#ifdef GL_ARB_texture_cube_map
-
-#endif /* GL_ARB_texture_cube_map */
-
-#ifdef GL_ARB_texture_cube_map_array
-
-#endif /* GL_ARB_texture_cube_map_array */
-
-#ifdef GL_ARB_texture_env_add
-
-#endif /* GL_ARB_texture_env_add */
-
-#ifdef GL_ARB_texture_env_combine
-
-#endif /* GL_ARB_texture_env_combine */
-
-#ifdef GL_ARB_texture_env_crossbar
-
-#endif /* GL_ARB_texture_env_crossbar */
-
-#ifdef GL_ARB_texture_env_dot3
-
-#endif /* GL_ARB_texture_env_dot3 */
-
-#ifdef GL_ARB_texture_float
-
-#endif /* GL_ARB_texture_float */
-
-#ifdef GL_ARB_texture_gather
-
-#endif /* GL_ARB_texture_gather */
-
-#ifdef GL_ARB_texture_mirror_clamp_to_edge
-
-#endif /* GL_ARB_texture_mirror_clamp_to_edge */
-
-#ifdef GL_ARB_texture_mirrored_repeat
-
-#endif /* GL_ARB_texture_mirrored_repeat */
-
-#ifdef GL_ARB_texture_multisample
-
-static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r;
- r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r;
- r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r;
- r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_multisample */
-
-#ifdef GL_ARB_texture_non_power_of_two
-
-#endif /* GL_ARB_texture_non_power_of_two */
-
-#ifdef GL_ARB_texture_query_levels
-
-#endif /* GL_ARB_texture_query_levels */
-
-#ifdef GL_ARB_texture_query_lod
-
-#endif /* GL_ARB_texture_query_lod */
-
-#ifdef GL_ARB_texture_rectangle
-
-#endif /* GL_ARB_texture_rectangle */
-
-#ifdef GL_ARB_texture_rg
-
-#endif /* GL_ARB_texture_rg */
-
-#ifdef GL_ARB_texture_rgb10_a2ui
-
-#endif /* GL_ARB_texture_rgb10_a2ui */
-
-#ifdef GL_ARB_texture_stencil8
-
-#endif /* GL_ARB_texture_stencil8 */
-
-#ifdef GL_ARB_texture_storage
-
-static GLboolean _glewInit_GL_ARB_texture_storage (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexStorage1D = (PFNGLTEXSTORAGE1DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage1D")) == NULL) || r;
- r = ((glTexStorage2D = (PFNGLTEXSTORAGE2DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2D")) == NULL) || r;
- r = ((glTexStorage3D = (PFNGLTEXSTORAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3D")) == NULL) || r;
- r = ((glTextureStorage1DEXT = (PFNGLTEXTURESTORAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage1DEXT")) == NULL) || r;
- r = ((glTextureStorage2DEXT = (PFNGLTEXTURESTORAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DEXT")) == NULL) || r;
- r = ((glTextureStorage3DEXT = (PFNGLTEXTURESTORAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_storage */
-
-#ifdef GL_ARB_texture_storage_multisample
-
-static GLboolean _glewInit_GL_ARB_texture_storage_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexStorage2DMultisample = (PFNGLTEXSTORAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage2DMultisample")) == NULL) || r;
- r = ((glTexStorage3DMultisample = (PFNGLTEXSTORAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexStorage3DMultisample")) == NULL) || r;
- r = ((glTextureStorage2DMultisampleEXT = (PFNGLTEXTURESTORAGE2DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage2DMultisampleEXT")) == NULL) || r;
- r = ((glTextureStorage3DMultisampleEXT = (PFNGLTEXTURESTORAGE3DMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureStorage3DMultisampleEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_storage_multisample */
-
-#ifdef GL_ARB_texture_swizzle
-
-#endif /* GL_ARB_texture_swizzle */
-
-#ifdef GL_ARB_texture_view
-
-static GLboolean _glewInit_GL_ARB_texture_view (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTextureView = (PFNGLTEXTUREVIEWPROC)glewGetProcAddress((const GLubyte*)"glTextureView")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_texture_view */
-
-#ifdef GL_ARB_timer_query
-
-static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r;
- r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r;
- r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_timer_query */
-
-#ifdef GL_ARB_transform_feedback2
-
-static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r;
- r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r;
- r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r;
- r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r;
- r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r;
- r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r;
- r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_transform_feedback2 */
-
-#ifdef GL_ARB_transform_feedback3
-
-static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r;
- r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r;
- r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r;
- r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_transform_feedback3 */
-
-#ifdef GL_ARB_transform_feedback_instanced
-
-static GLboolean _glewInit_GL_ARB_transform_feedback_instanced (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawTransformFeedbackInstanced = (PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackInstanced")) == NULL) || r;
- r = ((glDrawTransformFeedbackStreamInstanced = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStreamInstanced")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_transform_feedback_instanced */
-
-#ifdef GL_ARB_transpose_matrix
-
-static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r;
- r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r;
- r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r;
- r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_transpose_matrix */
-
-#ifdef GL_ARB_uniform_buffer_object
-
-static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r;
- r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r;
- r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r;
- r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r;
- r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r;
- r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r;
- r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r;
- r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r;
- r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r;
- r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_uniform_buffer_object */
-
-#ifdef GL_ARB_vertex_array_bgra
-
-#endif /* GL_ARB_vertex_array_bgra */
-
-#ifdef GL_ARB_vertex_array_object
-
-static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r;
- r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r;
- r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r;
- r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_array_object */
-
-#ifdef GL_ARB_vertex_attrib_64bit
-
-static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r;
- r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r;
- r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r;
- r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r;
- r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r;
- r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r;
- r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r;
- r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r;
- r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r;
- r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_attrib_64bit */
-
-#ifdef GL_ARB_vertex_attrib_binding
-
-static GLboolean _glewInit_GL_ARB_vertex_attrib_binding (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindVertexBuffer = (PFNGLBINDVERTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindVertexBuffer")) == NULL) || r;
- r = ((glVertexAttribBinding = (PFNGLVERTEXATTRIBBINDINGPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribBinding")) == NULL) || r;
- r = ((glVertexAttribFormat = (PFNGLVERTEXATTRIBFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormat")) == NULL) || r;
- r = ((glVertexAttribIFormat = (PFNGLVERTEXATTRIBIFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormat")) == NULL) || r;
- r = ((glVertexAttribLFormat = (PFNGLVERTEXATTRIBLFORMATPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormat")) == NULL) || r;
- r = ((glVertexBindingDivisor = (PFNGLVERTEXBINDINGDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexBindingDivisor")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_attrib_binding */
-
-#ifdef GL_ARB_vertex_blend
-
-static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r;
- r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r;
- r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r;
- r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r;
- r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r;
- r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r;
- r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r;
- r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r;
- r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r;
- r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_blend */
-
-#ifdef GL_ARB_vertex_buffer_object
-
-static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r;
- r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r;
- r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r;
- r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r;
- r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r;
- r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r;
- r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r;
- r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r;
- r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r;
- r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r;
- r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_buffer_object */
-
-#ifdef GL_ARB_vertex_program
-
-static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r;
- r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r;
- r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r;
- r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r;
- r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r;
- r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r;
- r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r;
- r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r;
- r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r;
- r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r;
- r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r;
- r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r;
- r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r;
- r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r;
- r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r;
- r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r;
- r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r;
- r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r;
- r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r;
- r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r;
- r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r;
- r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r;
- r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r;
- r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r;
- r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r;
- r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r;
- r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r;
- r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r;
- r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r;
- r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r;
- r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r;
- r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r;
- r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r;
- r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r;
- r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r;
- r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r;
- r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r;
- r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r;
- r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r;
- r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r;
- r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r;
- r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r;
- r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r;
- r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r;
- r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r;
- r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r;
- r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r;
- r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r;
- r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r;
- r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r;
- r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r;
- r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r;
- r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r;
- r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r;
- r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r;
- r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r;
- r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r;
- r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r;
- r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r;
- r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r;
- r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r;
- r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_program */
-
-#ifdef GL_ARB_vertex_shader
-
-static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r;
- r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r;
- r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_shader */
-
-#ifdef GL_ARB_vertex_type_10f_11f_11f_rev
-
-#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */
-
-#ifdef GL_ARB_vertex_type_2_10_10_10_rev
-
-static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r;
- r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r;
- r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r;
- r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r;
- r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r;
- r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r;
- r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r;
- r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r;
- r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r;
- r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r;
- r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r;
- r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r;
- r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r;
- r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r;
- r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r;
- r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r;
- r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r;
- r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r;
- r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r;
- r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r;
- r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r;
- r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r;
- r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r;
- r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r;
- r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r;
- r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r;
- r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r;
- r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r;
- r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r;
- r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r;
- r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r;
- r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r;
- r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r;
- r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r;
- r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r;
- r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r;
- r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r;
- r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-
-#ifdef GL_ARB_viewport_array
-
-static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r;
- r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r;
- r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r;
- r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r;
- r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r;
- r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r;
- r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r;
- r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r;
- r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r;
- r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_viewport_array */
-
-#ifdef GL_ARB_window_pos
-
-static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r;
- r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r;
- r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r;
- r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r;
- r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r;
- r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r;
- r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r;
- r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r;
- r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r;
- r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r;
- r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r;
- r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r;
- r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r;
- r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r;
- r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r;
- r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ARB_window_pos */
-
-#ifdef GL_ATIX_point_sprites
-
-#endif /* GL_ATIX_point_sprites */
-
-#ifdef GL_ATIX_texture_env_combine3
-
-#endif /* GL_ATIX_texture_env_combine3 */
-
-#ifdef GL_ATIX_texture_env_route
-
-#endif /* GL_ATIX_texture_env_route */
-
-#ifdef GL_ATIX_vertex_shader_output_point_size
-
-#endif /* GL_ATIX_vertex_shader_output_point_size */
-
-#ifdef GL_ATI_draw_buffers
-
-static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_draw_buffers */
-
-#ifdef GL_ATI_element_array
-
-static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r;
- r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r;
- r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_element_array */
-
-#ifdef GL_ATI_envmap_bumpmap
-
-static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r;
- r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r;
- r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r;
- r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_envmap_bumpmap */
-
-#ifdef GL_ATI_fragment_shader
-
-static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r;
- r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r;
- r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r;
- r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r;
- r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r;
- r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r;
- r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r;
- r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r;
- r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r;
- r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r;
- r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r;
- r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r;
- r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r;
- r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_fragment_shader */
-
-#ifdef GL_ATI_map_object_buffer
-
-static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r;
- r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_map_object_buffer */
-
-#ifdef GL_ATI_meminfo
-
-#endif /* GL_ATI_meminfo */
-
-#ifdef GL_ATI_pn_triangles
-
-static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r;
- r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_pn_triangles */
-
-#ifdef GL_ATI_separate_stencil
-
-static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r;
- r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_separate_stencil */
-
-#ifdef GL_ATI_shader_texture_lod
-
-#endif /* GL_ATI_shader_texture_lod */
-
-#ifdef GL_ATI_text_fragment_shader
-
-#endif /* GL_ATI_text_fragment_shader */
-
-#ifdef GL_ATI_texture_compression_3dc
-
-#endif /* GL_ATI_texture_compression_3dc */
-
-#ifdef GL_ATI_texture_env_combine3
-
-#endif /* GL_ATI_texture_env_combine3 */
-
-#ifdef GL_ATI_texture_float
-
-#endif /* GL_ATI_texture_float */
-
-#ifdef GL_ATI_texture_mirror_once
-
-#endif /* GL_ATI_texture_mirror_once */
-
-#ifdef GL_ATI_vertex_array_object
-
-static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r;
- r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r;
- r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r;
- r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r;
- r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r;
- r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r;
- r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r;
- r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r;
- r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r;
- r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r;
- r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r;
- r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_vertex_array_object */
-
-#ifdef GL_ATI_vertex_attrib_array_object
-
-static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r;
- r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r;
- r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_vertex_attrib_array_object */
-
-#ifdef GL_ATI_vertex_streams
-
-static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r;
- r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r;
- r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r;
- r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r;
- r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r;
- r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r;
- r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r;
- r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r;
- r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r;
- r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r;
- r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r;
- r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r;
- r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r;
- r = ((glVertexStream1dATI = (PFNGLVERTEXSTREAM1DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dATI")) == NULL) || r;
- r = ((glVertexStream1dvATI = (PFNGLVERTEXSTREAM1DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1dvATI")) == NULL) || r;
- r = ((glVertexStream1fATI = (PFNGLVERTEXSTREAM1FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fATI")) == NULL) || r;
- r = ((glVertexStream1fvATI = (PFNGLVERTEXSTREAM1FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1fvATI")) == NULL) || r;
- r = ((glVertexStream1iATI = (PFNGLVERTEXSTREAM1IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1iATI")) == NULL) || r;
- r = ((glVertexStream1ivATI = (PFNGLVERTEXSTREAM1IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1ivATI")) == NULL) || r;
- r = ((glVertexStream1sATI = (PFNGLVERTEXSTREAM1SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1sATI")) == NULL) || r;
- r = ((glVertexStream1svATI = (PFNGLVERTEXSTREAM1SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream1svATI")) == NULL) || r;
- r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r;
- r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r;
- r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r;
- r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r;
- r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r;
- r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r;
- r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r;
- r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r;
- r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r;
- r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r;
- r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r;
- r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r;
- r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r;
- r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r;
- r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r;
- r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r;
- r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r;
- r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r;
- r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r;
- r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r;
- r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r;
- r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r;
- r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r;
- r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_ATI_vertex_streams */
-
-#ifdef GL_EXT_422_pixels
-
-#endif /* GL_EXT_422_pixels */
-
-#ifdef GL_EXT_Cg_shader
-
-#endif /* GL_EXT_Cg_shader */
-
-#ifdef GL_EXT_abgr
-
-#endif /* GL_EXT_abgr */
-
-#ifdef GL_EXT_bgra
-
-#endif /* GL_EXT_bgra */
-
-#ifdef GL_EXT_bindable_uniform
-
-static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r;
- r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r;
- r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_bindable_uniform */
-
-#ifdef GL_EXT_blend_color
-
-static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_blend_color */
-
-#ifdef GL_EXT_blend_equation_separate
-
-static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_blend_equation_separate */
-
-#ifdef GL_EXT_blend_func_separate
-
-static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_blend_func_separate */
-
-#ifdef GL_EXT_blend_logic_op
-
-#endif /* GL_EXT_blend_logic_op */
-
-#ifdef GL_EXT_blend_minmax
-
-static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_blend_minmax */
-
-#ifdef GL_EXT_blend_subtract
-
-#endif /* GL_EXT_blend_subtract */
-
-#ifdef GL_EXT_clip_volume_hint
-
-#endif /* GL_EXT_clip_volume_hint */
-
-#ifdef GL_EXT_cmyka
-
-#endif /* GL_EXT_cmyka */
-
-#ifdef GL_EXT_color_subtable
-
-static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r;
- r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_color_subtable */
-
-#ifdef GL_EXT_compiled_vertex_array
-
-static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r;
- r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_compiled_vertex_array */
-
-#ifdef GL_EXT_convolution
-
-static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r;
- r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r;
- r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r;
- r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r;
- r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r;
- r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r;
- r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r;
- r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r;
- r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r;
- r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r;
- r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r;
- r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r;
- r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_convolution */
-
-#ifdef GL_EXT_coordinate_frame
-
-static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r;
- r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_coordinate_frame */
-
-#ifdef GL_EXT_copy_texture
-
-static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r;
- r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r;
- r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r;
- r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r;
- r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_copy_texture */
-
-#ifdef GL_EXT_cull_vertex
-
-static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r;
- r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_cull_vertex */
-
-#ifdef GL_EXT_debug_marker
-
-static GLboolean _glewInit_GL_EXT_debug_marker (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glInsertEventMarkerEXT = (PFNGLINSERTEVENTMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glInsertEventMarkerEXT")) == NULL) || r;
- r = ((glPopGroupMarkerEXT = (PFNGLPOPGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPopGroupMarkerEXT")) == NULL) || r;
- r = ((glPushGroupMarkerEXT = (PFNGLPUSHGROUPMARKEREXTPROC)glewGetProcAddress((const GLubyte*)"glPushGroupMarkerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_debug_marker */
-
-#ifdef GL_EXT_depth_bounds_test
-
-static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_depth_bounds_test */
-
-#ifdef GL_EXT_direct_state_access
-
-static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r;
- r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r;
- r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r;
- r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r;
- r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r;
- r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r;
- r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r;
- r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r;
- r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r;
- r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r;
- r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r;
- r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r;
- r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r;
- r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r;
- r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r;
- r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r;
- r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r;
- r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r;
- r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r;
- r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r;
- r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r;
- r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r;
- r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r;
- r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r;
- r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r;
- r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r;
- r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r;
- r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r;
- r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r;
- r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r;
- r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r;
- r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r;
- r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r;
- r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r;
- r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r;
- r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r;
- r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r;
- r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r;
- r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r;
- r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r;
- r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r;
- r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r;
- r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r;
- r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r;
- r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r;
- r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r;
- r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r;
- r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r;
- r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r;
- r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r;
- r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r;
- r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r;
- r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r;
- r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r;
- r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r;
- r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r;
- r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r;
- r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r;
- r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r;
- r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r;
- r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r;
- r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r;
- r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r;
- r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r;
- r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r;
- r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r;
- r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r;
- r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r;
- r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r;
- r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r;
- r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r;
- r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r;
- r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r;
- r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r;
- r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r;
- r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r;
- r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r;
- r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r;
- r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r;
- r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r;
- r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r;
- r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r;
- r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r;
- r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r;
- r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r;
- r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r;
- r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r;
- r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r;
- r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r;
- r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r;
- r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r;
- r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r;
- r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r;
- r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r;
- r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r;
- r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r;
- r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r;
- r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r;
- r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r;
- r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r;
- r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r;
- r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r;
- r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r;
- r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r;
- r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r;
- r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r;
- r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r;
- r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r;
- r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r;
- r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r;
- r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r;
- r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r;
- r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r;
- r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r;
- r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r;
- r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r;
- r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r;
- r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r;
- r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r;
- r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r;
- r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r;
- r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r;
- r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r;
- r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r;
- r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r;
- r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r;
- r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r;
- r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r;
- r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r;
- r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r;
- r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r;
- r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r;
- r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r;
- r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r;
- r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r;
- r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r;
- r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r;
- r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r;
- r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r;
- r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r;
- r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r;
- r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r;
- r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r;
- r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r;
- r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r;
- r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r;
- r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r;
- r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r;
- r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r;
- r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r;
- r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r;
- r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r;
- r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r;
- r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r;
- r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r;
- r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r;
- r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r;
- r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r;
- r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r;
- r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r;
- r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r;
- r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r;
- r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r;
- r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r;
- r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r;
- r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r;
- r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r;
- r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r;
- r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r;
- r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r;
- r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r;
- r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r;
- r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r;
- r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r;
- r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r;
- r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r;
- r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r;
- r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r;
- r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r;
- r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r;
- r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r;
- r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r;
- r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r;
- r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r;
- r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r;
- r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r;
- r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_direct_state_access */
-
-#ifdef GL_EXT_draw_buffers2
-
-static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r;
- r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r;
- r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r;
- r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r;
- r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r;
- r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_draw_buffers2 */
-
-#ifdef GL_EXT_draw_instanced
-
-static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r;
- r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_draw_instanced */
-
-#ifdef GL_EXT_draw_range_elements
-
-static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_draw_range_elements */
-
-#ifdef GL_EXT_fog_coord
-
-static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r;
- r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r;
- r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r;
- r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r;
- r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_fog_coord */
-
-#ifdef GL_EXT_fragment_lighting
-
-static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r;
- r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r;
- r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r;
- r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r;
- r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r;
- r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r;
- r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r;
- r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r;
- r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r;
- r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r;
- r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r;
- r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r;
- r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r;
- r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r;
- r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r;
- r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r;
- r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r;
- r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_fragment_lighting */
-
-#ifdef GL_EXT_framebuffer_blit
-
-static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_framebuffer_blit */
-
-#ifdef GL_EXT_framebuffer_multisample
-
-static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_framebuffer_multisample */
-
-#ifdef GL_EXT_framebuffer_multisample_blit_scaled
-
-#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
-
-#ifdef GL_EXT_framebuffer_object
-
-static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r;
- r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r;
- r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r;
- r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r;
- r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r;
- r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r;
- r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r;
- r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r;
- r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r;
- r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r;
- r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r;
- r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r;
- r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r;
- r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r;
- r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r;
- r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r;
- r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_framebuffer_object */
-
-#ifdef GL_EXT_framebuffer_sRGB
-
-#endif /* GL_EXT_framebuffer_sRGB */
-
-#ifdef GL_EXT_geometry_shader4
-
-static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r;
- r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r;
- r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_geometry_shader4 */
-
-#ifdef GL_EXT_gpu_program_parameters
-
-static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r;
- r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_gpu_program_parameters */
-
-#ifdef GL_EXT_gpu_shader4
-
-static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r;
- r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r;
- r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r;
- r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r;
- r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r;
- r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r;
- r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r;
- r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r;
- r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r;
- r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r;
- r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r;
- r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r;
- r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r;
- r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r;
- r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r;
- r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r;
- r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r;
- r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r;
- r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r;
- r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r;
- r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r;
- r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r;
- r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r;
- r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r;
- r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r;
- r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r;
- r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r;
- r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r;
- r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r;
- r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r;
- r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r;
- r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r;
- r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r;
- r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_gpu_shader4 */
-
-#ifdef GL_EXT_histogram
-
-static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r;
- r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r;
- r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r;
- r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r;
- r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r;
- r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r;
- r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r;
- r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r;
- r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r;
- r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_histogram */
-
-#ifdef GL_EXT_index_array_formats
-
-#endif /* GL_EXT_index_array_formats */
-
-#ifdef GL_EXT_index_func
-
-static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_index_func */
-
-#ifdef GL_EXT_index_material
-
-static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_index_material */
-
-#ifdef GL_EXT_index_texture
-
-#endif /* GL_EXT_index_texture */
-
-#ifdef GL_EXT_light_texture
-
-static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r;
- r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r;
- r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_light_texture */
-
-#ifdef GL_EXT_misc_attribute
-
-#endif /* GL_EXT_misc_attribute */
-
-#ifdef GL_EXT_multi_draw_arrays
-
-static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r;
- r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_multi_draw_arrays */
-
-#ifdef GL_EXT_multisample
-
-static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r;
- r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_multisample */
-
-#ifdef GL_EXT_packed_depth_stencil
-
-#endif /* GL_EXT_packed_depth_stencil */
-
-#ifdef GL_EXT_packed_float
-
-#endif /* GL_EXT_packed_float */
-
-#ifdef GL_EXT_packed_pixels
-
-#endif /* GL_EXT_packed_pixels */
-
-#ifdef GL_EXT_paletted_texture
-
-static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r;
- r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r;
- r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r;
- r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_paletted_texture */
-
-#ifdef GL_EXT_pixel_buffer_object
-
-#endif /* GL_EXT_pixel_buffer_object */
-
-#ifdef GL_EXT_pixel_transform
-
-static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r;
- r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r;
- r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r;
- r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r;
- r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r;
- r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_pixel_transform */
-
-#ifdef GL_EXT_pixel_transform_color_table
-
-#endif /* GL_EXT_pixel_transform_color_table */
-
-#ifdef GL_EXT_point_parameters
-
-static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r;
- r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_point_parameters */
-
-#ifdef GL_EXT_polygon_offset
-
-static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_polygon_offset */
-
-#ifdef GL_EXT_provoking_vertex
-
-static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_provoking_vertex */
-
-#ifdef GL_EXT_rescale_normal
-
-#endif /* GL_EXT_rescale_normal */
-
-#ifdef GL_EXT_scene_marker
-
-static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r;
- r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_scene_marker */
-
-#ifdef GL_EXT_secondary_color
-
-static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r;
- r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r;
- r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r;
- r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r;
- r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r;
- r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r;
- r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r;
- r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r;
- r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r;
- r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r;
- r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r;
- r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r;
- r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r;
- r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r;
- r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r;
- r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r;
- r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_secondary_color */
-
-#ifdef GL_EXT_separate_shader_objects
-
-static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r;
- r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r;
- r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_separate_shader_objects */
-
-#ifdef GL_EXT_separate_specular_color
-
-#endif /* GL_EXT_separate_specular_color */
-
-#ifdef GL_EXT_shader_image_load_store
-
-static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r;
- r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_shader_image_load_store */
-
-#ifdef GL_EXT_shadow_funcs
-
-#endif /* GL_EXT_shadow_funcs */
-
-#ifdef GL_EXT_shared_texture_palette
-
-#endif /* GL_EXT_shared_texture_palette */
-
-#ifdef GL_EXT_stencil_clear_tag
-
-#endif /* GL_EXT_stencil_clear_tag */
-
-#ifdef GL_EXT_stencil_two_side
-
-static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_stencil_two_side */
-
-#ifdef GL_EXT_stencil_wrap
-
-#endif /* GL_EXT_stencil_wrap */
-
-#ifdef GL_EXT_subtexture
-
-static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r;
- r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r;
- r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_subtexture */
-
-#ifdef GL_EXT_texture
-
-#endif /* GL_EXT_texture */
-
-#ifdef GL_EXT_texture3D
-
-static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture3D */
-
-#ifdef GL_EXT_texture_array
-
-static GLboolean _glewInit_GL_EXT_texture_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture_array */
-
-#ifdef GL_EXT_texture_buffer_object
-
-static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture_buffer_object */
-
-#ifdef GL_EXT_texture_compression_dxt1
-
-#endif /* GL_EXT_texture_compression_dxt1 */
-
-#ifdef GL_EXT_texture_compression_latc
-
-#endif /* GL_EXT_texture_compression_latc */
-
-#ifdef GL_EXT_texture_compression_rgtc
-
-#endif /* GL_EXT_texture_compression_rgtc */
-
-#ifdef GL_EXT_texture_compression_s3tc
-
-#endif /* GL_EXT_texture_compression_s3tc */
-
-#ifdef GL_EXT_texture_cube_map
-
-#endif /* GL_EXT_texture_cube_map */
-
-#ifdef GL_EXT_texture_edge_clamp
-
-#endif /* GL_EXT_texture_edge_clamp */
-
-#ifdef GL_EXT_texture_env
-
-#endif /* GL_EXT_texture_env */
-
-#ifdef GL_EXT_texture_env_add
-
-#endif /* GL_EXT_texture_env_add */
-
-#ifdef GL_EXT_texture_env_combine
-
-#endif /* GL_EXT_texture_env_combine */
-
-#ifdef GL_EXT_texture_env_dot3
-
-#endif /* GL_EXT_texture_env_dot3 */
-
-#ifdef GL_EXT_texture_filter_anisotropic
-
-#endif /* GL_EXT_texture_filter_anisotropic */
-
-#ifdef GL_EXT_texture_integer
-
-static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r;
- r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r;
- r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r;
- r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r;
- r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r;
- r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture_integer */
-
-#ifdef GL_EXT_texture_lod_bias
-
-#endif /* GL_EXT_texture_lod_bias */
-
-#ifdef GL_EXT_texture_mirror_clamp
-
-#endif /* GL_EXT_texture_mirror_clamp */
-
-#ifdef GL_EXT_texture_object
-
-static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r;
- r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r;
- r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r;
- r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r;
- r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r;
- r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture_object */
-
-#ifdef GL_EXT_texture_perturb_normal
-
-static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_texture_perturb_normal */
-
-#ifdef GL_EXT_texture_rectangle
-
-#endif /* GL_EXT_texture_rectangle */
-
-#ifdef GL_EXT_texture_sRGB
-
-#endif /* GL_EXT_texture_sRGB */
-
-#ifdef GL_EXT_texture_sRGB_decode
-
-#endif /* GL_EXT_texture_sRGB_decode */
-
-#ifdef GL_EXT_texture_shared_exponent
-
-#endif /* GL_EXT_texture_shared_exponent */
-
-#ifdef GL_EXT_texture_snorm
-
-#endif /* GL_EXT_texture_snorm */
-
-#ifdef GL_EXT_texture_swizzle
-
-#endif /* GL_EXT_texture_swizzle */
-
-#ifdef GL_EXT_timer_query
-
-static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r;
- r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_timer_query */
-
-#ifdef GL_EXT_transform_feedback
-
-static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r;
- r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r;
- r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r;
- r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r;
- r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r;
- r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r;
- r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_transform_feedback */
-
-#ifdef GL_EXT_vertex_array
-
-static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r;
- r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r;
- r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r;
- r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r;
- r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r;
- r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r;
- r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r;
- r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_vertex_array */
-
-#ifdef GL_EXT_vertex_array_bgra
-
-#endif /* GL_EXT_vertex_array_bgra */
-
-#ifdef GL_EXT_vertex_attrib_64bit
-
-static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r;
- r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r;
- r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r;
- r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r;
- r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r;
- r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r;
- r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r;
- r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r;
- r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r;
- r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r;
- r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_vertex_attrib_64bit */
-
-#ifdef GL_EXT_vertex_shader
-
-static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r;
- r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r;
- r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r;
- r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r;
- r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r;
- r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r;
- r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r;
- r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r;
- r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r;
- r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r;
- r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r;
- r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r;
- r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r;
- r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r;
- r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r;
- r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r;
- r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r;
- r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r;
- r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r;
- r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r;
- r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r;
- r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r;
- r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r;
- r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r;
- r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r;
- r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r;
- r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r;
- r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r;
- r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r;
- r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r;
- r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r;
- r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r;
- r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r;
- r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r;
- r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r;
- r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r;
- r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r;
- r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r;
- r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r;
- r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r;
- r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r;
- r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_vertex_shader */
-
-#ifdef GL_EXT_vertex_weighting
-
-static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r;
- r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r;
- r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_vertex_weighting */
-
-#ifdef GL_EXT_x11_sync_object
-
-static GLboolean _glewInit_GL_EXT_x11_sync_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glImportSyncEXT = (PFNGLIMPORTSYNCEXTPROC)glewGetProcAddress((const GLubyte*)"glImportSyncEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_EXT_x11_sync_object */
-
-#ifdef GL_GREMEDY_frame_terminator
-
-static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_GREMEDY_frame_terminator */
-
-#ifdef GL_GREMEDY_string_marker
-
-static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_GREMEDY_string_marker */
-
-#ifdef GL_HP_convolution_border_modes
-
-#endif /* GL_HP_convolution_border_modes */
-
-#ifdef GL_HP_image_transform
-
-static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r;
- r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r;
- r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r;
- r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r;
- r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r;
- r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_HP_image_transform */
-
-#ifdef GL_HP_occlusion_test
-
-#endif /* GL_HP_occlusion_test */
-
-#ifdef GL_HP_texture_lighting
-
-#endif /* GL_HP_texture_lighting */
-
-#ifdef GL_IBM_cull_vertex
-
-#endif /* GL_IBM_cull_vertex */
-
-#ifdef GL_IBM_multimode_draw_arrays
-
-static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r;
- r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_IBM_multimode_draw_arrays */
-
-#ifdef GL_IBM_rasterpos_clip
-
-#endif /* GL_IBM_rasterpos_clip */
-
-#ifdef GL_IBM_static_data
-
-#endif /* GL_IBM_static_data */
-
-#ifdef GL_IBM_texture_mirrored_repeat
-
-#endif /* GL_IBM_texture_mirrored_repeat */
-
-#ifdef GL_IBM_vertex_array_lists
-
-static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r;
- r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r;
- r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r;
- r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r;
- r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r;
- r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r;
- r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r;
- r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_IBM_vertex_array_lists */
-
-#ifdef GL_INGR_color_clamp
-
-#endif /* GL_INGR_color_clamp */
-
-#ifdef GL_INGR_interlace_read
-
-#endif /* GL_INGR_interlace_read */
-
-#ifdef GL_INTEL_map_texture
-
-static GLboolean _glewInit_GL_INTEL_map_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMapTexture2DINTEL = (PFNGLMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glMapTexture2DINTEL")) == NULL) || r;
- r = ((glSyncTextureINTEL = (PFNGLSYNCTEXTUREINTELPROC)glewGetProcAddress((const GLubyte*)"glSyncTextureINTEL")) == NULL) || r;
- r = ((glUnmapTexture2DINTEL = (PFNGLUNMAPTEXTURE2DINTELPROC)glewGetProcAddress((const GLubyte*)"glUnmapTexture2DINTEL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_INTEL_map_texture */
-
-#ifdef GL_INTEL_parallel_arrays
-
-static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r;
- r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r;
- r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r;
- r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_INTEL_parallel_arrays */
-
-#ifdef GL_INTEL_texture_scissor
-
-static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r;
- r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_INTEL_texture_scissor */
-
-#ifdef GL_KHR_debug
-
-static GLboolean _glewInit_GL_KHR_debug (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDebugMessageCallback = (PFNGLDEBUGMESSAGECALLBACKPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallback")) == NULL) || r;
- r = ((glDebugMessageControl = (PFNGLDEBUGMESSAGECONTROLPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControl")) == NULL) || r;
- r = ((glDebugMessageInsert = (PFNGLDEBUGMESSAGEINSERTPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsert")) == NULL) || r;
- r = ((glGetDebugMessageLog = (PFNGLGETDEBUGMESSAGELOGPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLog")) == NULL) || r;
- r = ((glGetObjectLabel = (PFNGLGETOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectLabel")) == NULL) || r;
- r = ((glGetObjectPtrLabel = (PFNGLGETOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glGetObjectPtrLabel")) == NULL) || r;
- r = ((glObjectLabel = (PFNGLOBJECTLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectLabel")) == NULL) || r;
- r = ((glObjectPtrLabel = (PFNGLOBJECTPTRLABELPROC)glewGetProcAddress((const GLubyte*)"glObjectPtrLabel")) == NULL) || r;
- r = ((glPopDebugGroup = (PFNGLPOPDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPopDebugGroup")) == NULL) || r;
- r = ((glPushDebugGroup = (PFNGLPUSHDEBUGGROUPPROC)glewGetProcAddress((const GLubyte*)"glPushDebugGroup")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_KHR_debug */
-
-#ifdef GL_KHR_texture_compression_astc_ldr
-
-#endif /* GL_KHR_texture_compression_astc_ldr */
-
-#ifdef GL_KTX_buffer_region
-
-static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBufferRegionEnabled = (PFNGLBUFFERREGIONENABLEDPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabled")) == NULL) || r;
- r = ((glDeleteBufferRegion = (PFNGLDELETEBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegion")) == NULL) || r;
- r = ((glDrawBufferRegion = (PFNGLDRAWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegion")) == NULL) || r;
- r = ((glNewBufferRegion = (PFNGLNEWBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegion")) == NULL) || r;
- r = ((glReadBufferRegion = (PFNGLREADBUFFERREGIONPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegion")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_KTX_buffer_region */
-
-#ifdef GL_MESAX_texture_stack
-
-#endif /* GL_MESAX_texture_stack */
-
-#ifdef GL_MESA_pack_invert
-
-#endif /* GL_MESA_pack_invert */
-
-#ifdef GL_MESA_resize_buffers
-
-static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_MESA_resize_buffers */
-
-#ifdef GL_MESA_window_pos
-
-static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r;
- r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r;
- r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r;
- r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r;
- r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r;
- r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r;
- r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r;
- r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r;
- r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r;
- r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r;
- r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r;
- r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r;
- r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r;
- r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r;
- r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r;
- r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r;
- r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r;
- r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r;
- r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r;
- r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r;
- r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r;
- r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r;
- r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r;
- r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_MESA_window_pos */
-
-#ifdef GL_MESA_ycbcr_texture
-
-#endif /* GL_MESA_ycbcr_texture */
-
-#ifdef GL_NVX_conditional_render
-
-static GLboolean _glewInit_GL_NVX_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginConditionalRenderNVX = (PFNGLBEGINCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNVX")) == NULL) || r;
- r = ((glEndConditionalRenderNVX = (PFNGLENDCONDITIONALRENDERNVXPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNVX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NVX_conditional_render */
-
-#ifdef GL_NVX_gpu_memory_info
-
-#endif /* GL_NVX_gpu_memory_info */
-
-#ifdef GL_NV_bindless_multi_draw_indirect
-
-static GLboolean _glewInit_GL_NV_bindless_multi_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glMultiDrawArraysIndirectBindlessNV = (PFNGLMULTIDRAWARRAYSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysIndirectBindlessNV")) == NULL) || r;
- r = ((glMultiDrawElementsIndirectBindlessNV = (PFNGLMULTIDRAWELEMENTSINDIRECTBINDLESSNVPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsIndirectBindlessNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_bindless_multi_draw_indirect */
-
-#ifdef GL_NV_bindless_texture
-
-static GLboolean _glewInit_GL_NV_bindless_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetImageHandleNV = (PFNGLGETIMAGEHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetImageHandleNV")) == NULL) || r;
- r = ((glGetTextureHandleNV = (PFNGLGETTEXTUREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureHandleNV")) == NULL) || r;
- r = ((glGetTextureSamplerHandleNV = (PFNGLGETTEXTURESAMPLERHANDLENVPROC)glewGetProcAddress((const GLubyte*)"glGetTextureSamplerHandleNV")) == NULL) || r;
- r = ((glIsImageHandleResidentNV = (PFNGLISIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsImageHandleResidentNV")) == NULL) || r;
- r = ((glIsTextureHandleResidentNV = (PFNGLISTEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsTextureHandleResidentNV")) == NULL) || r;
- r = ((glMakeImageHandleNonResidentNV = (PFNGLMAKEIMAGEHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleNonResidentNV")) == NULL) || r;
- r = ((glMakeImageHandleResidentNV = (PFNGLMAKEIMAGEHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeImageHandleResidentNV")) == NULL) || r;
- r = ((glMakeTextureHandleNonResidentNV = (PFNGLMAKETEXTUREHANDLENONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleNonResidentNV")) == NULL) || r;
- r = ((glMakeTextureHandleResidentNV = (PFNGLMAKETEXTUREHANDLERESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeTextureHandleResidentNV")) == NULL) || r;
- r = ((glProgramUniformHandleui64NV = (PFNGLPROGRAMUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64NV")) == NULL) || r;
- r = ((glProgramUniformHandleui64vNV = (PFNGLPROGRAMUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformHandleui64vNV")) == NULL) || r;
- r = ((glUniformHandleui64NV = (PFNGLUNIFORMHANDLEUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64NV")) == NULL) || r;
- r = ((glUniformHandleui64vNV = (PFNGLUNIFORMHANDLEUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformHandleui64vNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_bindless_texture */
-
-#ifdef GL_NV_blend_equation_advanced
-
-static GLboolean _glewInit_GL_NV_blend_equation_advanced (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBlendBarrierNV = (PFNGLBLENDBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glBlendBarrierNV")) == NULL) || r;
- r = ((glBlendParameteriNV = (PFNGLBLENDPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glBlendParameteriNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_blend_equation_advanced */
-
-#ifdef GL_NV_blend_equation_advanced_coherent
-
-#endif /* GL_NV_blend_equation_advanced_coherent */
-
-#ifdef GL_NV_blend_square
-
-#endif /* GL_NV_blend_square */
-
-#ifdef GL_NV_compute_program5
-
-#endif /* GL_NV_compute_program5 */
-
-#ifdef GL_NV_conditional_render
-
-static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r;
- r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_conditional_render */
-
-#ifdef GL_NV_copy_depth_to_color
-
-#endif /* GL_NV_copy_depth_to_color */
-
-#ifdef GL_NV_copy_image
-
-static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_copy_image */
-
-#ifdef GL_NV_deep_texture3D
-
-#endif /* GL_NV_deep_texture3D */
-
-#ifdef GL_NV_depth_buffer_float
-
-static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r;
- r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r;
- r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_depth_buffer_float */
-
-#ifdef GL_NV_depth_clamp
-
-#endif /* GL_NV_depth_clamp */
-
-#ifdef GL_NV_depth_range_unclamped
-
-#endif /* GL_NV_depth_range_unclamped */
-
-#ifdef GL_NV_draw_texture
-
-static GLboolean _glewInit_GL_NV_draw_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDrawTextureNV = (PFNGLDRAWTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glDrawTextureNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_draw_texture */
-
-#ifdef GL_NV_evaluators
-
-static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r;
- r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r;
- r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r;
- r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r;
- r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r;
- r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r;
- r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r;
- r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r;
- r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_evaluators */
-
-#ifdef GL_NV_explicit_multisample
-
-static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r;
- r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r;
- r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_explicit_multisample */
-
-#ifdef GL_NV_fence
-
-static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r;
- r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r;
- r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r;
- r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r;
- r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r;
- r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r;
- r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_fence */
-
-#ifdef GL_NV_float_buffer
-
-#endif /* GL_NV_float_buffer */
-
-#ifdef GL_NV_fog_distance
-
-#endif /* GL_NV_fog_distance */
-
-#ifdef GL_NV_fragment_program
-
-static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r;
- r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r;
- r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r;
- r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r;
- r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r;
- r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_fragment_program */
-
-#ifdef GL_NV_fragment_program2
-
-#endif /* GL_NV_fragment_program2 */
-
-#ifdef GL_NV_fragment_program4
-
-#endif /* GL_NV_fragment_program4 */
-
-#ifdef GL_NV_fragment_program_option
-
-#endif /* GL_NV_fragment_program_option */
-
-#ifdef GL_NV_framebuffer_multisample_coverage
-
-static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_framebuffer_multisample_coverage */
-
-#ifdef GL_NV_geometry_program4
-
-static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_geometry_program4 */
-
-#ifdef GL_NV_geometry_shader4
-
-#endif /* GL_NV_geometry_shader4 */
-
-#ifdef GL_NV_gpu_program4
-
-static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r;
- r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r;
- r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r;
- r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r;
- r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r;
- r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r;
- r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r;
- r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r;
- r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r;
- r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r;
- r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r;
- r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_gpu_program4 */
-
-#ifdef GL_NV_gpu_program5
-
-#endif /* GL_NV_gpu_program5 */
-
-#ifdef GL_NV_gpu_program5_mem_extended
-
-#endif /* GL_NV_gpu_program5_mem_extended */
-
-#ifdef GL_NV_gpu_program_fp64
-
-#endif /* GL_NV_gpu_program_fp64 */
-
-#ifdef GL_NV_gpu_shader5
-
-static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r;
- r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r;
- r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r;
- r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r;
- r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r;
- r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r;
- r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r;
- r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r;
- r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r;
- r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r;
- r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r;
- r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r;
- r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r;
- r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r;
- r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r;
- r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r;
- r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r;
- r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r;
- r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r;
- r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r;
- r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r;
- r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r;
- r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r;
- r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r;
- r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r;
- r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r;
- r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r;
- r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r;
- r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r;
- r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r;
- r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r;
- r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r;
- r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r;
- r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_gpu_shader5 */
-
-#ifdef GL_NV_half_float
-
-static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r;
- r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r;
- r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r;
- r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r;
- r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r;
- r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r;
- r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r;
- r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r;
- r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r;
- r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r;
- r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r;
- r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r;
- r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r;
- r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r;
- r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r;
- r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r;
- r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r;
- r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r;
- r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r;
- r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r;
- r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r;
- r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r;
- r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r;
- r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r;
- r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r;
- r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r;
- r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r;
- r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r;
- r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r;
- r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r;
- r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r;
- r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r;
- r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r;
- r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r;
- r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r;
- r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r;
- r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r;
- r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r;
- r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r;
- r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r;
- r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r;
- r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r;
- r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r;
- r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r;
- r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r;
- r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_half_float */
-
-#ifdef GL_NV_light_max_exponent
-
-#endif /* GL_NV_light_max_exponent */
-
-#ifdef GL_NV_multisample_coverage
-
-#endif /* GL_NV_multisample_coverage */
-
-#ifdef GL_NV_multisample_filter_hint
-
-#endif /* GL_NV_multisample_filter_hint */
-
-#ifdef GL_NV_occlusion_query
-
-static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r;
- r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r;
- r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r;
- r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r;
- r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r;
- r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r;
- r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_occlusion_query */
-
-#ifdef GL_NV_packed_depth_stencil
-
-#endif /* GL_NV_packed_depth_stencil */
-
-#ifdef GL_NV_parameter_buffer_object
-
-static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r;
- r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r;
- r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_parameter_buffer_object */
-
-#ifdef GL_NV_parameter_buffer_object2
-
-#endif /* GL_NV_parameter_buffer_object2 */
-
-#ifdef GL_NV_path_rendering
-
-static GLboolean _glewInit_GL_NV_path_rendering (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCopyPathNV = (PFNGLCOPYPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCopyPathNV")) == NULL) || r;
- r = ((glCoverFillPathInstancedNV = (PFNGLCOVERFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathInstancedNV")) == NULL) || r;
- r = ((glCoverFillPathNV = (PFNGLCOVERFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverFillPathNV")) == NULL) || r;
- r = ((glCoverStrokePathInstancedNV = (PFNGLCOVERSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathInstancedNV")) == NULL) || r;
- r = ((glCoverStrokePathNV = (PFNGLCOVERSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glCoverStrokePathNV")) == NULL) || r;
- r = ((glDeletePathsNV = (PFNGLDELETEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glDeletePathsNV")) == NULL) || r;
- r = ((glGenPathsNV = (PFNGLGENPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glGenPathsNV")) == NULL) || r;
- r = ((glGetPathColorGenfvNV = (PFNGLGETPATHCOLORGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenfvNV")) == NULL) || r;
- r = ((glGetPathColorGenivNV = (PFNGLGETPATHCOLORGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathColorGenivNV")) == NULL) || r;
- r = ((glGetPathCommandsNV = (PFNGLGETPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCommandsNV")) == NULL) || r;
- r = ((glGetPathCoordsNV = (PFNGLGETPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathCoordsNV")) == NULL) || r;
- r = ((glGetPathDashArrayNV = (PFNGLGETPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathDashArrayNV")) == NULL) || r;
- r = ((glGetPathLengthNV = (PFNGLGETPATHLENGTHNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathLengthNV")) == NULL) || r;
- r = ((glGetPathMetricRangeNV = (PFNGLGETPATHMETRICRANGENVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricRangeNV")) == NULL) || r;
- r = ((glGetPathMetricsNV = (PFNGLGETPATHMETRICSNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathMetricsNV")) == NULL) || r;
- r = ((glGetPathParameterfvNV = (PFNGLGETPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterfvNV")) == NULL) || r;
- r = ((glGetPathParameterivNV = (PFNGLGETPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathParameterivNV")) == NULL) || r;
- r = ((glGetPathSpacingNV = (PFNGLGETPATHSPACINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathSpacingNV")) == NULL) || r;
- r = ((glGetPathTexGenfvNV = (PFNGLGETPATHTEXGENFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenfvNV")) == NULL) || r;
- r = ((glGetPathTexGenivNV = (PFNGLGETPATHTEXGENIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetPathTexGenivNV")) == NULL) || r;
- r = ((glInterpolatePathsNV = (PFNGLINTERPOLATEPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glInterpolatePathsNV")) == NULL) || r;
- r = ((glIsPathNV = (PFNGLISPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPathNV")) == NULL) || r;
- r = ((glIsPointInFillPathNV = (PFNGLISPOINTINFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInFillPathNV")) == NULL) || r;
- r = ((glIsPointInStrokePathNV = (PFNGLISPOINTINSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glIsPointInStrokePathNV")) == NULL) || r;
- r = ((glPathColorGenNV = (PFNGLPATHCOLORGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathColorGenNV")) == NULL) || r;
- r = ((glPathCommandsNV = (PFNGLPATHCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCommandsNV")) == NULL) || r;
- r = ((glPathCoordsNV = (PFNGLPATHCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoordsNV")) == NULL) || r;
- r = ((glPathCoverDepthFuncNV = (PFNGLPATHCOVERDEPTHFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathCoverDepthFuncNV")) == NULL) || r;
- r = ((glPathDashArrayNV = (PFNGLPATHDASHARRAYNVPROC)glewGetProcAddress((const GLubyte*)"glPathDashArrayNV")) == NULL) || r;
- r = ((glPathFogGenNV = (PFNGLPATHFOGGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathFogGenNV")) == NULL) || r;
- r = ((glPathGlyphRangeNV = (PFNGLPATHGLYPHRANGENVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphRangeNV")) == NULL) || r;
- r = ((glPathGlyphsNV = (PFNGLPATHGLYPHSNVPROC)glewGetProcAddress((const GLubyte*)"glPathGlyphsNV")) == NULL) || r;
- r = ((glPathParameterfNV = (PFNGLPATHPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfNV")) == NULL) || r;
- r = ((glPathParameterfvNV = (PFNGLPATHPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterfvNV")) == NULL) || r;
- r = ((glPathParameteriNV = (PFNGLPATHPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPathParameteriNV")) == NULL) || r;
- r = ((glPathParameterivNV = (PFNGLPATHPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPathParameterivNV")) == NULL) || r;
- r = ((glPathStencilDepthOffsetNV = (PFNGLPATHSTENCILDEPTHOFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilDepthOffsetNV")) == NULL) || r;
- r = ((glPathStencilFuncNV = (PFNGLPATHSTENCILFUNCNVPROC)glewGetProcAddress((const GLubyte*)"glPathStencilFuncNV")) == NULL) || r;
- r = ((glPathStringNV = (PFNGLPATHSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glPathStringNV")) == NULL) || r;
- r = ((glPathSubCommandsNV = (PFNGLPATHSUBCOMMANDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCommandsNV")) == NULL) || r;
- r = ((glPathSubCoordsNV = (PFNGLPATHSUBCOORDSNVPROC)glewGetProcAddress((const GLubyte*)"glPathSubCoordsNV")) == NULL) || r;
- r = ((glPathTexGenNV = (PFNGLPATHTEXGENNVPROC)glewGetProcAddress((const GLubyte*)"glPathTexGenNV")) == NULL) || r;
- r = ((glPointAlongPathNV = (PFNGLPOINTALONGPATHNVPROC)glewGetProcAddress((const GLubyte*)"glPointAlongPathNV")) == NULL) || r;
- r = ((glStencilFillPathInstancedNV = (PFNGLSTENCILFILLPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathInstancedNV")) == NULL) || r;
- r = ((glStencilFillPathNV = (PFNGLSTENCILFILLPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilFillPathNV")) == NULL) || r;
- r = ((glStencilStrokePathInstancedNV = (PFNGLSTENCILSTROKEPATHINSTANCEDNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathInstancedNV")) == NULL) || r;
- r = ((glStencilStrokePathNV = (PFNGLSTENCILSTROKEPATHNVPROC)glewGetProcAddress((const GLubyte*)"glStencilStrokePathNV")) == NULL) || r;
- r = ((glTransformPathNV = (PFNGLTRANSFORMPATHNVPROC)glewGetProcAddress((const GLubyte*)"glTransformPathNV")) == NULL) || r;
- r = ((glWeightPathsNV = (PFNGLWEIGHTPATHSNVPROC)glewGetProcAddress((const GLubyte*)"glWeightPathsNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_path_rendering */
-
-#ifdef GL_NV_pixel_data_range
-
-static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r;
- r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_pixel_data_range */
-
-#ifdef GL_NV_point_sprite
-
-static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r;
- r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_point_sprite */
-
-#ifdef GL_NV_present_video
-
-static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r;
- r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r;
- r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r;
- r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r;
- r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r;
- r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_present_video */
-
-#ifdef GL_NV_primitive_restart
-
-static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r;
- r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_primitive_restart */
-
-#ifdef GL_NV_register_combiners
-
-static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r;
- r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r;
- r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r;
- r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r;
- r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r;
- r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r;
- r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r;
- r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r;
- r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r;
- r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r;
- r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r;
- r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r;
- r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_register_combiners */
-
-#ifdef GL_NV_register_combiners2
-
-static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r;
- r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_register_combiners2 */
-
-#ifdef GL_NV_shader_atomic_counters
-
-#endif /* GL_NV_shader_atomic_counters */
-
-#ifdef GL_NV_shader_atomic_float
-
-#endif /* GL_NV_shader_atomic_float */
-
-#ifdef GL_NV_shader_buffer_load
-
-static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r;
- r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r;
- r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r;
- r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r;
- r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r;
- r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r;
- r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r;
- r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r;
- r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r;
- r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r;
- r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r;
- r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r;
- r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_shader_buffer_load */
-
-#ifdef GL_NV_shader_storage_buffer_object
-
-#endif /* GL_NV_shader_storage_buffer_object */
-
-#ifdef GL_NV_tessellation_program5
-
-#endif /* GL_NV_tessellation_program5 */
-
-#ifdef GL_NV_texgen_emboss
-
-#endif /* GL_NV_texgen_emboss */
-
-#ifdef GL_NV_texgen_reflection
-
-#endif /* GL_NV_texgen_reflection */
-
-#ifdef GL_NV_texture_barrier
-
-static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_texture_barrier */
-
-#ifdef GL_NV_texture_compression_vtc
-
-#endif /* GL_NV_texture_compression_vtc */
-
-#ifdef GL_NV_texture_env_combine4
-
-#endif /* GL_NV_texture_env_combine4 */
-
-#ifdef GL_NV_texture_expand_normal
-
-#endif /* GL_NV_texture_expand_normal */
-
-#ifdef GL_NV_texture_multisample
-
-static GLboolean _glewInit_GL_NV_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexImage2DMultisampleCoverageNV = (PFNGLTEXIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisampleCoverageNV")) == NULL) || r;
- r = ((glTexImage3DMultisampleCoverageNV = (PFNGLTEXIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisampleCoverageNV")) == NULL) || r;
- r = ((glTextureImage2DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleCoverageNV")) == NULL) || r;
- r = ((glTextureImage2DMultisampleNV = (PFNGLTEXTUREIMAGE2DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DMultisampleNV")) == NULL) || r;
- r = ((glTextureImage3DMultisampleCoverageNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleCoverageNV")) == NULL) || r;
- r = ((glTextureImage3DMultisampleNV = (PFNGLTEXTUREIMAGE3DMULTISAMPLENVPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DMultisampleNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_texture_multisample */
-
-#ifdef GL_NV_texture_rectangle
-
-#endif /* GL_NV_texture_rectangle */
-
-#ifdef GL_NV_texture_shader
-
-#endif /* GL_NV_texture_shader */
-
-#ifdef GL_NV_texture_shader2
-
-#endif /* GL_NV_texture_shader2 */
-
-#ifdef GL_NV_texture_shader3
-
-#endif /* GL_NV_texture_shader3 */
-
-#ifdef GL_NV_transform_feedback
-
-static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r;
- r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r;
- r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r;
- r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r;
- r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r;
- r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r;
- r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r;
- r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r;
- r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r;
- r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r;
- r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_transform_feedback */
-
-#ifdef GL_NV_transform_feedback2
-
-static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r;
- r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r;
- r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r;
- r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r;
- r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r;
- r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r;
- r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_transform_feedback2 */
-
-#ifdef GL_NV_vdpau_interop
-
-static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r;
- r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r;
- r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r;
- r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r;
- r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r;
- r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r;
- r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r;
- r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r;
- r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r;
- r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_vdpau_interop */
-
-#ifdef GL_NV_vertex_array_range
-
-static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r;
- r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_vertex_array_range */
-
-#ifdef GL_NV_vertex_array_range2
-
-#endif /* GL_NV_vertex_array_range2 */
-
-#ifdef GL_NV_vertex_attrib_integer_64bit
-
-static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r;
- r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r;
- r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r;
- r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r;
- r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r;
- r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r;
- r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r;
- r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r;
- r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r;
- r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r;
- r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r;
- r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r;
- r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r;
- r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r;
- r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r;
- r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r;
- r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r;
- r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r;
- r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_vertex_attrib_integer_64bit */
-
-#ifdef GL_NV_vertex_buffer_unified_memory
-
-static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r;
- r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r;
- r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r;
- r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r;
- r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r;
- r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r;
- r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r;
- r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r;
- r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r;
- r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r;
- r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r;
- r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_vertex_buffer_unified_memory */
-
-#ifdef GL_NV_vertex_program
-
-static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r;
- r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r;
- r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r;
- r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r;
- r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r;
- r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r;
- r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r;
- r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r;
- r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r;
- r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r;
- r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r;
- r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r;
- r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r;
- r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r;
- r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r;
- r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r;
- r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r;
- r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r;
- r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r;
- r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r;
- r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r;
- r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r;
- r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r;
- r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r;
- r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r;
- r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r;
- r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r;
- r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r;
- r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r;
- r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r;
- r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r;
- r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r;
- r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r;
- r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r;
- r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r;
- r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r;
- r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r;
- r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r;
- r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r;
- r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r;
- r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r;
- r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r;
- r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r;
- r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r;
- r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r;
- r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r;
- r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r;
- r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r;
- r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r;
- r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r;
- r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r;
- r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r;
- r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r;
- r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r;
- r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r;
- r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r;
- r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r;
- r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r;
- r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r;
- r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r;
- r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r;
- r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r;
- r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r;
- r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_vertex_program */
-
-#ifdef GL_NV_vertex_program1_1
-
-#endif /* GL_NV_vertex_program1_1 */
-
-#ifdef GL_NV_vertex_program2
-
-#endif /* GL_NV_vertex_program2 */
-
-#ifdef GL_NV_vertex_program2_option
-
-#endif /* GL_NV_vertex_program2_option */
-
-#ifdef GL_NV_vertex_program3
-
-#endif /* GL_NV_vertex_program3 */
-
-#ifdef GL_NV_vertex_program4
-
-#endif /* GL_NV_vertex_program4 */
-
-#ifdef GL_NV_video_capture
-
-static GLboolean _glewInit_GL_NV_video_capture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glBeginVideoCaptureNV = (PFNGLBEGINVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glBeginVideoCaptureNV")) == NULL) || r;
- r = ((glBindVideoCaptureStreamBufferNV = (PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamBufferNV")) == NULL) || r;
- r = ((glBindVideoCaptureStreamTextureNV = (PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC)glewGetProcAddress((const GLubyte*)"glBindVideoCaptureStreamTextureNV")) == NULL) || r;
- r = ((glEndVideoCaptureNV = (PFNGLENDVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glEndVideoCaptureNV")) == NULL) || r;
- r = ((glGetVideoCaptureStreamdvNV = (PFNGLGETVIDEOCAPTURESTREAMDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamdvNV")) == NULL) || r;
- r = ((glGetVideoCaptureStreamfvNV = (PFNGLGETVIDEOCAPTURESTREAMFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamfvNV")) == NULL) || r;
- r = ((glGetVideoCaptureStreamivNV = (PFNGLGETVIDEOCAPTURESTREAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureStreamivNV")) == NULL) || r;
- r = ((glGetVideoCaptureivNV = (PFNGLGETVIDEOCAPTUREIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoCaptureivNV")) == NULL) || r;
- r = ((glVideoCaptureNV = (PFNGLVIDEOCAPTURENVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureNV")) == NULL) || r;
- r = ((glVideoCaptureStreamParameterdvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterdvNV")) == NULL) || r;
- r = ((glVideoCaptureStreamParameterfvNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterfvNV")) == NULL) || r;
- r = ((glVideoCaptureStreamParameterivNV = (PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glVideoCaptureStreamParameterivNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_NV_video_capture */
-
-#ifdef GL_OES_byte_coordinates
-
-#endif /* GL_OES_byte_coordinates */
-
-#ifdef GL_OES_compressed_paletted_texture
-
-#endif /* GL_OES_compressed_paletted_texture */
-
-#ifdef GL_OES_read_format
-
-#endif /* GL_OES_read_format */
-
-#ifdef GL_OES_single_precision
-
-static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r;
- r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r;
- r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r;
- r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r;
- r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r;
- r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_OES_single_precision */
-
-#ifdef GL_OML_interlace
-
-#endif /* GL_OML_interlace */
-
-#ifdef GL_OML_resample
-
-#endif /* GL_OML_resample */
-
-#ifdef GL_OML_subsample
-
-#endif /* GL_OML_subsample */
-
-#ifdef GL_PGI_misc_hints
-
-#endif /* GL_PGI_misc_hints */
-
-#ifdef GL_PGI_vertex_hints
-
-#endif /* GL_PGI_vertex_hints */
-
-#ifdef GL_REGAL_ES1_0_compatibility
-
-static GLboolean _glewInit_GL_REGAL_ES1_0_compatibility (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAlphaFuncx = (PFNGLALPHAFUNCXPROC)glewGetProcAddress((const GLubyte*)"glAlphaFuncx")) == NULL) || r;
- r = ((glClearColorx = (PFNGLCLEARCOLORXPROC)glewGetProcAddress((const GLubyte*)"glClearColorx")) == NULL) || r;
- r = ((glClearDepthx = (PFNGLCLEARDEPTHXPROC)glewGetProcAddress((const GLubyte*)"glClearDepthx")) == NULL) || r;
- r = ((glColor4x = (PFNGLCOLOR4XPROC)glewGetProcAddress((const GLubyte*)"glColor4x")) == NULL) || r;
- r = ((glDepthRangex = (PFNGLDEPTHRANGEXPROC)glewGetProcAddress((const GLubyte*)"glDepthRangex")) == NULL) || r;
- r = ((glFogx = (PFNGLFOGXPROC)glewGetProcAddress((const GLubyte*)"glFogx")) == NULL) || r;
- r = ((glFogxv = (PFNGLFOGXVPROC)glewGetProcAddress((const GLubyte*)"glFogxv")) == NULL) || r;
- r = ((glFrustumf = (PFNGLFRUSTUMFPROC)glewGetProcAddress((const GLubyte*)"glFrustumf")) == NULL) || r;
- r = ((glFrustumx = (PFNGLFRUSTUMXPROC)glewGetProcAddress((const GLubyte*)"glFrustumx")) == NULL) || r;
- r = ((glLightModelx = (PFNGLLIGHTMODELXPROC)glewGetProcAddress((const GLubyte*)"glLightModelx")) == NULL) || r;
- r = ((glLightModelxv = (PFNGLLIGHTMODELXVPROC)glewGetProcAddress((const GLubyte*)"glLightModelxv")) == NULL) || r;
- r = ((glLightx = (PFNGLLIGHTXPROC)glewGetProcAddress((const GLubyte*)"glLightx")) == NULL) || r;
- r = ((glLightxv = (PFNGLLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glLightxv")) == NULL) || r;
- r = ((glLineWidthx = (PFNGLLINEWIDTHXPROC)glewGetProcAddress((const GLubyte*)"glLineWidthx")) == NULL) || r;
- r = ((glLoadMatrixx = (PFNGLLOADMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glLoadMatrixx")) == NULL) || r;
- r = ((glMaterialx = (PFNGLMATERIALXPROC)glewGetProcAddress((const GLubyte*)"glMaterialx")) == NULL) || r;
- r = ((glMaterialxv = (PFNGLMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glMaterialxv")) == NULL) || r;
- r = ((glMultMatrixx = (PFNGLMULTMATRIXXPROC)glewGetProcAddress((const GLubyte*)"glMultMatrixx")) == NULL) || r;
- r = ((glMultiTexCoord4x = (PFNGLMULTITEXCOORD4XPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4x")) == NULL) || r;
- r = ((glNormal3x = (PFNGLNORMAL3XPROC)glewGetProcAddress((const GLubyte*)"glNormal3x")) == NULL) || r;
- r = ((glOrthof = (PFNGLORTHOFPROC)glewGetProcAddress((const GLubyte*)"glOrthof")) == NULL) || r;
- r = ((glOrthox = (PFNGLORTHOXPROC)glewGetProcAddress((const GLubyte*)"glOrthox")) == NULL) || r;
- r = ((glPointSizex = (PFNGLPOINTSIZEXPROC)glewGetProcAddress((const GLubyte*)"glPointSizex")) == NULL) || r;
- r = ((glPolygonOffsetx = (PFNGLPOLYGONOFFSETXPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetx")) == NULL) || r;
- r = ((glRotatex = (PFNGLROTATEXPROC)glewGetProcAddress((const GLubyte*)"glRotatex")) == NULL) || r;
- r = ((glSampleCoveragex = (PFNGLSAMPLECOVERAGEXPROC)glewGetProcAddress((const GLubyte*)"glSampleCoveragex")) == NULL) || r;
- r = ((glScalex = (PFNGLSCALEXPROC)glewGetProcAddress((const GLubyte*)"glScalex")) == NULL) || r;
- r = ((glTexEnvx = (PFNGLTEXENVXPROC)glewGetProcAddress((const GLubyte*)"glTexEnvx")) == NULL) || r;
- r = ((glTexEnvxv = (PFNGLTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glTexEnvxv")) == NULL) || r;
- r = ((glTexParameterx = (PFNGLTEXPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glTexParameterx")) == NULL) || r;
- r = ((glTranslatex = (PFNGLTRANSLATEXPROC)glewGetProcAddress((const GLubyte*)"glTranslatex")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_REGAL_ES1_0_compatibility */
-
-#ifdef GL_REGAL_ES1_1_compatibility
-
-static GLboolean _glewInit_GL_REGAL_ES1_1_compatibility (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glClipPlanef = (PFNGLCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glClipPlanef")) == NULL) || r;
- r = ((glClipPlanex = (PFNGLCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glClipPlanex")) == NULL) || r;
- r = ((glGetClipPlanef = (PFNGLGETCLIPPLANEFPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanef")) == NULL) || r;
- r = ((glGetClipPlanex = (PFNGLGETCLIPPLANEXPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanex")) == NULL) || r;
- r = ((glGetFixedv = (PFNGLGETFIXEDVPROC)glewGetProcAddress((const GLubyte*)"glGetFixedv")) == NULL) || r;
- r = ((glGetLightxv = (PFNGLGETLIGHTXVPROC)glewGetProcAddress((const GLubyte*)"glGetLightxv")) == NULL) || r;
- r = ((glGetMaterialxv = (PFNGLGETMATERIALXVPROC)glewGetProcAddress((const GLubyte*)"glGetMaterialxv")) == NULL) || r;
- r = ((glGetTexEnvxv = (PFNGLGETTEXENVXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexEnvxv")) == NULL) || r;
- r = ((glGetTexParameterxv = (PFNGLGETTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterxv")) == NULL) || r;
- r = ((glPointParameterx = (PFNGLPOINTPARAMETERXPROC)glewGetProcAddress((const GLubyte*)"glPointParameterx")) == NULL) || r;
- r = ((glPointParameterxv = (PFNGLPOINTPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterxv")) == NULL) || r;
- r = ((glPointSizePointerOES = (PFNGLPOINTSIZEPOINTEROESPROC)glewGetProcAddress((const GLubyte*)"glPointSizePointerOES")) == NULL) || r;
- r = ((glTexParameterxv = (PFNGLTEXPARAMETERXVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterxv")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_REGAL_ES1_1_compatibility */
-
-#ifdef GL_REGAL_enable
-
-#endif /* GL_REGAL_enable */
-
-#ifdef GL_REGAL_error_string
-
-static GLboolean _glewInit_GL_REGAL_error_string (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glErrorStringREGAL = (PFNGLERRORSTRINGREGALPROC)glewGetProcAddress((const GLubyte*)"glErrorStringREGAL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_REGAL_error_string */
-
-#ifdef GL_REGAL_extension_query
-
-static GLboolean _glewInit_GL_REGAL_extension_query (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetExtensionREGAL = (PFNGLGETEXTENSIONREGALPROC)glewGetProcAddress((const GLubyte*)"glGetExtensionREGAL")) == NULL) || r;
- r = ((glIsSupportedREGAL = (PFNGLISSUPPORTEDREGALPROC)glewGetProcAddress((const GLubyte*)"glIsSupportedREGAL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_REGAL_extension_query */
-
-#ifdef GL_REGAL_log
-
-static GLboolean _glewInit_GL_REGAL_log (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glLogMessageCallbackREGAL = (PFNGLLOGMESSAGECALLBACKREGALPROC)glewGetProcAddress((const GLubyte*)"glLogMessageCallbackREGAL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_REGAL_log */
-
-#ifdef GL_REND_screen_coordinates
-
-#endif /* GL_REND_screen_coordinates */
-
-#ifdef GL_S3_s3tc
-
-#endif /* GL_S3_s3tc */
-
-#ifdef GL_SGIS_color_range
-
-#endif /* GL_SGIS_color_range */
-
-#ifdef GL_SGIS_detail_texture
-
-static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r;
- r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_detail_texture */
-
-#ifdef GL_SGIS_fog_function
-
-static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r;
- r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_fog_function */
-
-#ifdef GL_SGIS_generate_mipmap
-
-#endif /* GL_SGIS_generate_mipmap */
-
-#ifdef GL_SGIS_multisample
-
-static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r;
- r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_multisample */
-
-#ifdef GL_SGIS_pixel_texture
-
-#endif /* GL_SGIS_pixel_texture */
-
-#ifdef GL_SGIS_point_line_texgen
-
-#endif /* GL_SGIS_point_line_texgen */
-
-#ifdef GL_SGIS_sharpen_texture
-
-static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r;
- r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_sharpen_texture */
-
-#ifdef GL_SGIS_texture4D
-
-static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r;
- r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_texture4D */
-
-#ifdef GL_SGIS_texture_border_clamp
-
-#endif /* GL_SGIS_texture_border_clamp */
-
-#ifdef GL_SGIS_texture_edge_clamp
-
-#endif /* GL_SGIS_texture_edge_clamp */
-
-#ifdef GL_SGIS_texture_filter4
-
-static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r;
- r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIS_texture_filter4 */
-
-#ifdef GL_SGIS_texture_lod
-
-#endif /* GL_SGIS_texture_lod */
-
-#ifdef GL_SGIS_texture_select
-
-#endif /* GL_SGIS_texture_select */
-
-#ifdef GL_SGIX_async
-
-static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r;
- r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r;
- r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r;
- r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r;
- r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r;
- r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_async */
-
-#ifdef GL_SGIX_async_histogram
-
-#endif /* GL_SGIX_async_histogram */
-
-#ifdef GL_SGIX_async_pixel
-
-#endif /* GL_SGIX_async_pixel */
-
-#ifdef GL_SGIX_blend_alpha_minmax
-
-#endif /* GL_SGIX_blend_alpha_minmax */
-
-#ifdef GL_SGIX_clipmap
-
-#endif /* GL_SGIX_clipmap */
-
-#ifdef GL_SGIX_convolution_accuracy
-
-#endif /* GL_SGIX_convolution_accuracy */
-
-#ifdef GL_SGIX_depth_texture
-
-#endif /* GL_SGIX_depth_texture */
-
-#ifdef GL_SGIX_flush_raster
-
-static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_flush_raster */
-
-#ifdef GL_SGIX_fog_offset
-
-#endif /* GL_SGIX_fog_offset */
-
-#ifdef GL_SGIX_fog_texture
-
-static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_fog_texture */
-
-#ifdef GL_SGIX_fragment_specular_lighting
-
-static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r;
- r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r;
- r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r;
- r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r;
- r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r;
- r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r;
- r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r;
- r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r;
- r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r;
- r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r;
- r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r;
- r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r;
- r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r;
- r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r;
- r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r;
- r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r;
- r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_fragment_specular_lighting */
-
-#ifdef GL_SGIX_framezoom
-
-static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_framezoom */
-
-#ifdef GL_SGIX_interlace
-
-#endif /* GL_SGIX_interlace */
-
-#ifdef GL_SGIX_ir_instrument1
-
-#endif /* GL_SGIX_ir_instrument1 */
-
-#ifdef GL_SGIX_list_priority
-
-#endif /* GL_SGIX_list_priority */
-
-#ifdef GL_SGIX_pixel_texture
-
-static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_pixel_texture */
-
-#ifdef GL_SGIX_pixel_texture_bits
-
-#endif /* GL_SGIX_pixel_texture_bits */
-
-#ifdef GL_SGIX_reference_plane
-
-static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_reference_plane */
-
-#ifdef GL_SGIX_resample
-
-#endif /* GL_SGIX_resample */
-
-#ifdef GL_SGIX_shadow
-
-#endif /* GL_SGIX_shadow */
-
-#ifdef GL_SGIX_shadow_ambient
-
-#endif /* GL_SGIX_shadow_ambient */
-
-#ifdef GL_SGIX_sprite
-
-static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r;
- r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r;
- r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r;
- r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_sprite */
-
-#ifdef GL_SGIX_tag_sample_buffer
-
-static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGIX_tag_sample_buffer */
-
-#ifdef GL_SGIX_texture_add_env
-
-#endif /* GL_SGIX_texture_add_env */
-
-#ifdef GL_SGIX_texture_coordinate_clamp
-
-#endif /* GL_SGIX_texture_coordinate_clamp */
-
-#ifdef GL_SGIX_texture_lod_bias
-
-#endif /* GL_SGIX_texture_lod_bias */
-
-#ifdef GL_SGIX_texture_multi_buffer
-
-#endif /* GL_SGIX_texture_multi_buffer */
-
-#ifdef GL_SGIX_texture_range
-
-#endif /* GL_SGIX_texture_range */
-
-#ifdef GL_SGIX_texture_scale_bias
-
-#endif /* GL_SGIX_texture_scale_bias */
-
-#ifdef GL_SGIX_vertex_preclip
-
-#endif /* GL_SGIX_vertex_preclip */
-
-#ifdef GL_SGIX_vertex_preclip_hint
-
-#endif /* GL_SGIX_vertex_preclip_hint */
-
-#ifdef GL_SGIX_ycrcb
-
-#endif /* GL_SGIX_ycrcb */
-
-#ifdef GL_SGI_color_matrix
-
-#endif /* GL_SGI_color_matrix */
-
-#ifdef GL_SGI_color_table
-
-static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r;
- r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r;
- r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r;
- r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r;
- r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r;
- r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r;
- r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SGI_color_table */
-
-#ifdef GL_SGI_texture_color_table
-
-#endif /* GL_SGI_texture_color_table */
-
-#ifdef GL_SUNX_constant_data
-
-static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SUNX_constant_data */
-
-#ifdef GL_SUN_convolution_border_modes
-
-#endif /* GL_SUN_convolution_border_modes */
-
-#ifdef GL_SUN_global_alpha
-
-static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r;
- r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SUN_global_alpha */
-
-#ifdef GL_SUN_mesh_array
-
-#endif /* GL_SUN_mesh_array */
-
-#ifdef GL_SUN_read_video_pixels
-
-static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SUN_read_video_pixels */
-
-#ifdef GL_SUN_slice_accum
-
-#endif /* GL_SUN_slice_accum */
-
-#ifdef GL_SUN_triangle_list
-
-static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r;
- r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r;
- r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r;
- r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r;
- r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r;
- r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SUN_triangle_list */
-
-#ifdef GL_SUN_vertex
-
-static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r;
- r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r;
- r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r;
- r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r;
- r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r;
- r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r;
- r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r;
- r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r;
- r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r;
- r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r;
- r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r;
- r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r;
- r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r;
- r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r;
- r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r;
- r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r;
- r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_SUN_vertex */
-
-#ifdef GL_WIN_phong_shading
-
-#endif /* GL_WIN_phong_shading */
-
-#ifdef GL_WIN_specular_fog
-
-#endif /* GL_WIN_specular_fog */
-
-#ifdef GL_WIN_swap_hint
-
-static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GL_WIN_swap_hint */
-
-/* ------------------------------------------------------------------------- */
-
-GLboolean GLEWAPIENTRY glewGetExtension (const char* name)
-{
- const GLubyte* start;
- const GLubyte* end;
- start = (const GLubyte*)glGetString(GL_EXTENSIONS);
- if (start == 0)
- return GL_FALSE;
- end = start + _glewStrLen(start);
- return _glewSearchExtension(name, start, end);
-}
-
-/* ------------------------------------------------------------------------- */
-
-#ifndef GLEW_MX
-static
-#endif
-GLenum GLEWAPIENTRY glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST)
-{
- const GLubyte* s;
- GLuint dot;
- GLint major, minor;
- const GLubyte* extStart;
- const GLubyte* extEnd;
- /* query opengl version */
- s = glGetString(GL_VERSION);
- dot = _glewStrCLen(s, '.');
- if (dot == 0)
- return GLEW_ERROR_NO_GL_VERSION;
-
- major = s[dot-1]-'0';
- minor = s[dot+1]-'0';
-
- if (minor < 0 || minor > 9)
- minor = 0;
- if (major<0 || major>9)
- return GLEW_ERROR_NO_GL_VERSION;
-
-
- if (major == 1 && minor == 0)
- {
- return GLEW_ERROR_GL_VERSION_10_ONLY;
- }
- else
- {
- CONST_CAST(GLEW_VERSION_4_4) = ( major > 4 ) || ( major == 4 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_4_3) = GLEW_VERSION_4_4 == GL_TRUE || ( major == 4 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_4_2) = GLEW_VERSION_4_3 == GL_TRUE || ( major == 4 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_4_1) = GLEW_VERSION_4_2 == GL_TRUE || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE;
- CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE;
- }
-
- /* query opengl extensions string */
- extStart = glGetString(GL_EXTENSIONS);
- if (extStart == 0)
- extStart = (const GLubyte*)"";
- extEnd = extStart + _glewStrLen(extStart);
-
- /* initialize extensions */
-#ifdef GL_VERSION_1_2
- if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_1_2 */
-#ifdef GL_VERSION_1_2_1
-#endif /* GL_VERSION_1_2_1 */
-#ifdef GL_VERSION_1_3
- if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_1_3 */
-#ifdef GL_VERSION_1_4
- if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_1_4 */
-#ifdef GL_VERSION_1_5
- if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_1_5 */
-#ifdef GL_VERSION_2_0
- if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_2_0 */
-#ifdef GL_VERSION_2_1
- if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_2_1 */
-#ifdef GL_VERSION_3_0
- if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_3_0 */
-#ifdef GL_VERSION_3_1
- if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_3_1 */
-#ifdef GL_VERSION_3_2
- if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_3_2 */
-#ifdef GL_VERSION_3_3
- if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_3_3 */
-#ifdef GL_VERSION_4_0
- if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_VERSION_4_0 */
-#ifdef GL_VERSION_4_1
-#endif /* GL_VERSION_4_1 */
-#ifdef GL_VERSION_4_2
-#endif /* GL_VERSION_4_2 */
-#ifdef GL_VERSION_4_3
-#endif /* GL_VERSION_4_3 */
-#ifdef GL_VERSION_4_4
-#endif /* GL_VERSION_4_4 */
-#ifdef GL_3DFX_multisample
- CONST_CAST(GLEW_3DFX_multisample) = _glewSearchExtension("GL_3DFX_multisample", extStart, extEnd);
-#endif /* GL_3DFX_multisample */
-#ifdef GL_3DFX_tbuffer
- CONST_CAST(GLEW_3DFX_tbuffer) = _glewSearchExtension("GL_3DFX_tbuffer", extStart, extEnd);
- if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_3DFX_tbuffer */
-#ifdef GL_3DFX_texture_compression_FXT1
- CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = _glewSearchExtension("GL_3DFX_texture_compression_FXT1", extStart, extEnd);
-#endif /* GL_3DFX_texture_compression_FXT1 */
-#ifdef GL_AMD_blend_minmax_factor
- CONST_CAST(GLEW_AMD_blend_minmax_factor) = _glewSearchExtension("GL_AMD_blend_minmax_factor", extStart, extEnd);
-#endif /* GL_AMD_blend_minmax_factor */
-#ifdef GL_AMD_conservative_depth
- CONST_CAST(GLEW_AMD_conservative_depth) = _glewSearchExtension("GL_AMD_conservative_depth", extStart, extEnd);
-#endif /* GL_AMD_conservative_depth */
-#ifdef GL_AMD_debug_output
- CONST_CAST(GLEW_AMD_debug_output) = _glewSearchExtension("GL_AMD_debug_output", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_debug_output */
-#ifdef GL_AMD_depth_clamp_separate
- CONST_CAST(GLEW_AMD_depth_clamp_separate) = _glewSearchExtension("GL_AMD_depth_clamp_separate", extStart, extEnd);
-#endif /* GL_AMD_depth_clamp_separate */
-#ifdef GL_AMD_draw_buffers_blend
- CONST_CAST(GLEW_AMD_draw_buffers_blend) = _glewSearchExtension("GL_AMD_draw_buffers_blend", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_draw_buffers_blend */
-#ifdef GL_AMD_interleaved_elements
- CONST_CAST(GLEW_AMD_interleaved_elements) = _glewSearchExtension("GL_AMD_interleaved_elements", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_interleaved_elements) CONST_CAST(GLEW_AMD_interleaved_elements) = !_glewInit_GL_AMD_interleaved_elements(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_interleaved_elements */
-#ifdef GL_AMD_multi_draw_indirect
- CONST_CAST(GLEW_AMD_multi_draw_indirect) = _glewSearchExtension("GL_AMD_multi_draw_indirect", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_multi_draw_indirect) CONST_CAST(GLEW_AMD_multi_draw_indirect) = !_glewInit_GL_AMD_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_multi_draw_indirect */
-#ifdef GL_AMD_name_gen_delete
- CONST_CAST(GLEW_AMD_name_gen_delete) = _glewSearchExtension("GL_AMD_name_gen_delete", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_name_gen_delete */
-#ifdef GL_AMD_performance_monitor
- CONST_CAST(GLEW_AMD_performance_monitor) = _glewSearchExtension("GL_AMD_performance_monitor", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_performance_monitor */
-#ifdef GL_AMD_pinned_memory
- CONST_CAST(GLEW_AMD_pinned_memory) = _glewSearchExtension("GL_AMD_pinned_memory", extStart, extEnd);
-#endif /* GL_AMD_pinned_memory */
-#ifdef GL_AMD_query_buffer_object
- CONST_CAST(GLEW_AMD_query_buffer_object) = _glewSearchExtension("GL_AMD_query_buffer_object", extStart, extEnd);
-#endif /* GL_AMD_query_buffer_object */
-#ifdef GL_AMD_sample_positions
- CONST_CAST(GLEW_AMD_sample_positions) = _glewSearchExtension("GL_AMD_sample_positions", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_sample_positions) CONST_CAST(GLEW_AMD_sample_positions) = !_glewInit_GL_AMD_sample_positions(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_sample_positions */
-#ifdef GL_AMD_seamless_cubemap_per_texture
- CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = _glewSearchExtension("GL_AMD_seamless_cubemap_per_texture", extStart, extEnd);
-#endif /* GL_AMD_seamless_cubemap_per_texture */
-#ifdef GL_AMD_shader_stencil_export
- CONST_CAST(GLEW_AMD_shader_stencil_export) = _glewSearchExtension("GL_AMD_shader_stencil_export", extStart, extEnd);
-#endif /* GL_AMD_shader_stencil_export */
-#ifdef GL_AMD_shader_trinary_minmax
- CONST_CAST(GLEW_AMD_shader_trinary_minmax) = _glewSearchExtension("GL_AMD_shader_trinary_minmax", extStart, extEnd);
-#endif /* GL_AMD_shader_trinary_minmax */
-#ifdef GL_AMD_sparse_texture
- CONST_CAST(GLEW_AMD_sparse_texture) = _glewSearchExtension("GL_AMD_sparse_texture", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_sparse_texture) CONST_CAST(GLEW_AMD_sparse_texture) = !_glewInit_GL_AMD_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_sparse_texture */
-#ifdef GL_AMD_stencil_operation_extended
- CONST_CAST(GLEW_AMD_stencil_operation_extended) = _glewSearchExtension("GL_AMD_stencil_operation_extended", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_stencil_operation_extended) CONST_CAST(GLEW_AMD_stencil_operation_extended) = !_glewInit_GL_AMD_stencil_operation_extended(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_stencil_operation_extended */
-#ifdef GL_AMD_texture_texture4
- CONST_CAST(GLEW_AMD_texture_texture4) = _glewSearchExtension("GL_AMD_texture_texture4", extStart, extEnd);
-#endif /* GL_AMD_texture_texture4 */
-#ifdef GL_AMD_transform_feedback3_lines_triangles
- CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = _glewSearchExtension("GL_AMD_transform_feedback3_lines_triangles", extStart, extEnd);
-#endif /* GL_AMD_transform_feedback3_lines_triangles */
-#ifdef GL_AMD_vertex_shader_layer
- CONST_CAST(GLEW_AMD_vertex_shader_layer) = _glewSearchExtension("GL_AMD_vertex_shader_layer", extStart, extEnd);
-#endif /* GL_AMD_vertex_shader_layer */
-#ifdef GL_AMD_vertex_shader_tessellator
- CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = _glewSearchExtension("GL_AMD_vertex_shader_tessellator", extStart, extEnd);
- if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_AMD_vertex_shader_tessellator */
-#ifdef GL_AMD_vertex_shader_viewport_index
- CONST_CAST(GLEW_AMD_vertex_shader_viewport_index) = _glewSearchExtension("GL_AMD_vertex_shader_viewport_index", extStart, extEnd);
-#endif /* GL_AMD_vertex_shader_viewport_index */
-#ifdef GL_ANGLE_depth_texture
- CONST_CAST(GLEW_ANGLE_depth_texture) = _glewSearchExtension("GL_ANGLE_depth_texture", extStart, extEnd);
-#endif /* GL_ANGLE_depth_texture */
-#ifdef GL_ANGLE_framebuffer_blit
- CONST_CAST(GLEW_ANGLE_framebuffer_blit) = _glewSearchExtension("GL_ANGLE_framebuffer_blit", extStart, extEnd);
- if (glewExperimental || GLEW_ANGLE_framebuffer_blit) CONST_CAST(GLEW_ANGLE_framebuffer_blit) = !_glewInit_GL_ANGLE_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ANGLE_framebuffer_blit */
-#ifdef GL_ANGLE_framebuffer_multisample
- CONST_CAST(GLEW_ANGLE_framebuffer_multisample) = _glewSearchExtension("GL_ANGLE_framebuffer_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_ANGLE_framebuffer_multisample) CONST_CAST(GLEW_ANGLE_framebuffer_multisample) = !_glewInit_GL_ANGLE_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ANGLE_framebuffer_multisample */
-#ifdef GL_ANGLE_instanced_arrays
- CONST_CAST(GLEW_ANGLE_instanced_arrays) = _glewSearchExtension("GL_ANGLE_instanced_arrays", extStart, extEnd);
- if (glewExperimental || GLEW_ANGLE_instanced_arrays) CONST_CAST(GLEW_ANGLE_instanced_arrays) = !_glewInit_GL_ANGLE_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ANGLE_instanced_arrays */
-#ifdef GL_ANGLE_pack_reverse_row_order
- CONST_CAST(GLEW_ANGLE_pack_reverse_row_order) = _glewSearchExtension("GL_ANGLE_pack_reverse_row_order", extStart, extEnd);
-#endif /* GL_ANGLE_pack_reverse_row_order */
-#ifdef GL_ANGLE_program_binary
- CONST_CAST(GLEW_ANGLE_program_binary) = _glewSearchExtension("GL_ANGLE_program_binary", extStart, extEnd);
-#endif /* GL_ANGLE_program_binary */
-#ifdef GL_ANGLE_texture_compression_dxt1
- CONST_CAST(GLEW_ANGLE_texture_compression_dxt1) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt1", extStart, extEnd);
-#endif /* GL_ANGLE_texture_compression_dxt1 */
-#ifdef GL_ANGLE_texture_compression_dxt3
- CONST_CAST(GLEW_ANGLE_texture_compression_dxt3) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt3", extStart, extEnd);
-#endif /* GL_ANGLE_texture_compression_dxt3 */
-#ifdef GL_ANGLE_texture_compression_dxt5
- CONST_CAST(GLEW_ANGLE_texture_compression_dxt5) = _glewSearchExtension("GL_ANGLE_texture_compression_dxt5", extStart, extEnd);
-#endif /* GL_ANGLE_texture_compression_dxt5 */
-#ifdef GL_ANGLE_texture_usage
- CONST_CAST(GLEW_ANGLE_texture_usage) = _glewSearchExtension("GL_ANGLE_texture_usage", extStart, extEnd);
-#endif /* GL_ANGLE_texture_usage */
-#ifdef GL_ANGLE_timer_query
- CONST_CAST(GLEW_ANGLE_timer_query) = _glewSearchExtension("GL_ANGLE_timer_query", extStart, extEnd);
- if (glewExperimental || GLEW_ANGLE_timer_query) CONST_CAST(GLEW_ANGLE_timer_query) = !_glewInit_GL_ANGLE_timer_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ANGLE_timer_query */
-#ifdef GL_ANGLE_translated_shader_source
- CONST_CAST(GLEW_ANGLE_translated_shader_source) = _glewSearchExtension("GL_ANGLE_translated_shader_source", extStart, extEnd);
- if (glewExperimental || GLEW_ANGLE_translated_shader_source) CONST_CAST(GLEW_ANGLE_translated_shader_source) = !_glewInit_GL_ANGLE_translated_shader_source(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ANGLE_translated_shader_source */
-#ifdef GL_APPLE_aux_depth_stencil
- CONST_CAST(GLEW_APPLE_aux_depth_stencil) = _glewSearchExtension("GL_APPLE_aux_depth_stencil", extStart, extEnd);
-#endif /* GL_APPLE_aux_depth_stencil */
-#ifdef GL_APPLE_client_storage
- CONST_CAST(GLEW_APPLE_client_storage) = _glewSearchExtension("GL_APPLE_client_storage", extStart, extEnd);
-#endif /* GL_APPLE_client_storage */
-#ifdef GL_APPLE_element_array
- CONST_CAST(GLEW_APPLE_element_array) = _glewSearchExtension("GL_APPLE_element_array", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_element_array */
-#ifdef GL_APPLE_fence
- CONST_CAST(GLEW_APPLE_fence) = _glewSearchExtension("GL_APPLE_fence", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_fence */
-#ifdef GL_APPLE_float_pixels
- CONST_CAST(GLEW_APPLE_float_pixels) = _glewSearchExtension("GL_APPLE_float_pixels", extStart, extEnd);
-#endif /* GL_APPLE_float_pixels */
-#ifdef GL_APPLE_flush_buffer_range
- CONST_CAST(GLEW_APPLE_flush_buffer_range) = _glewSearchExtension("GL_APPLE_flush_buffer_range", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_flush_buffer_range */
-#ifdef GL_APPLE_object_purgeable
- CONST_CAST(GLEW_APPLE_object_purgeable) = _glewSearchExtension("GL_APPLE_object_purgeable", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_object_purgeable */
-#ifdef GL_APPLE_pixel_buffer
- CONST_CAST(GLEW_APPLE_pixel_buffer) = _glewSearchExtension("GL_APPLE_pixel_buffer", extStart, extEnd);
-#endif /* GL_APPLE_pixel_buffer */
-#ifdef GL_APPLE_rgb_422
- CONST_CAST(GLEW_APPLE_rgb_422) = _glewSearchExtension("GL_APPLE_rgb_422", extStart, extEnd);
-#endif /* GL_APPLE_rgb_422 */
-#ifdef GL_APPLE_row_bytes
- CONST_CAST(GLEW_APPLE_row_bytes) = _glewSearchExtension("GL_APPLE_row_bytes", extStart, extEnd);
-#endif /* GL_APPLE_row_bytes */
-#ifdef GL_APPLE_specular_vector
- CONST_CAST(GLEW_APPLE_specular_vector) = _glewSearchExtension("GL_APPLE_specular_vector", extStart, extEnd);
-#endif /* GL_APPLE_specular_vector */
-#ifdef GL_APPLE_texture_range
- CONST_CAST(GLEW_APPLE_texture_range) = _glewSearchExtension("GL_APPLE_texture_range", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_texture_range */
-#ifdef GL_APPLE_transform_hint
- CONST_CAST(GLEW_APPLE_transform_hint) = _glewSearchExtension("GL_APPLE_transform_hint", extStart, extEnd);
-#endif /* GL_APPLE_transform_hint */
-#ifdef GL_APPLE_vertex_array_object
- CONST_CAST(GLEW_APPLE_vertex_array_object) = _glewSearchExtension("GL_APPLE_vertex_array_object", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_vertex_array_object */
-#ifdef GL_APPLE_vertex_array_range
- CONST_CAST(GLEW_APPLE_vertex_array_range) = _glewSearchExtension("GL_APPLE_vertex_array_range", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_vertex_array_range */
-#ifdef GL_APPLE_vertex_program_evaluators
- CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = _glewSearchExtension("GL_APPLE_vertex_program_evaluators", extStart, extEnd);
- if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_APPLE_vertex_program_evaluators */
-#ifdef GL_APPLE_ycbcr_422
- CONST_CAST(GLEW_APPLE_ycbcr_422) = _glewSearchExtension("GL_APPLE_ycbcr_422", extStart, extEnd);
-#endif /* GL_APPLE_ycbcr_422 */
-#ifdef GL_ARB_ES2_compatibility
- CONST_CAST(GLEW_ARB_ES2_compatibility) = _glewSearchExtension("GL_ARB_ES2_compatibility", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_ES2_compatibility */
-#ifdef GL_ARB_ES3_compatibility
- CONST_CAST(GLEW_ARB_ES3_compatibility) = _glewSearchExtension("GL_ARB_ES3_compatibility", extStart, extEnd);
-#endif /* GL_ARB_ES3_compatibility */
-#ifdef GL_ARB_arrays_of_arrays
- CONST_CAST(GLEW_ARB_arrays_of_arrays) = _glewSearchExtension("GL_ARB_arrays_of_arrays", extStart, extEnd);
-#endif /* GL_ARB_arrays_of_arrays */
-#ifdef GL_ARB_base_instance
- CONST_CAST(GLEW_ARB_base_instance) = _glewSearchExtension("GL_ARB_base_instance", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_base_instance) CONST_CAST(GLEW_ARB_base_instance) = !_glewInit_GL_ARB_base_instance(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_base_instance */
-#ifdef GL_ARB_bindless_texture
- CONST_CAST(GLEW_ARB_bindless_texture) = _glewSearchExtension("GL_ARB_bindless_texture", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_bindless_texture) CONST_CAST(GLEW_ARB_bindless_texture) = !_glewInit_GL_ARB_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_bindless_texture */
-#ifdef GL_ARB_blend_func_extended
- CONST_CAST(GLEW_ARB_blend_func_extended) = _glewSearchExtension("GL_ARB_blend_func_extended", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_blend_func_extended */
-#ifdef GL_ARB_buffer_storage
- CONST_CAST(GLEW_ARB_buffer_storage) = _glewSearchExtension("GL_ARB_buffer_storage", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_buffer_storage) CONST_CAST(GLEW_ARB_buffer_storage) = !_glewInit_GL_ARB_buffer_storage(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_buffer_storage */
-#ifdef GL_ARB_cl_event
- CONST_CAST(GLEW_ARB_cl_event) = _glewSearchExtension("GL_ARB_cl_event", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_cl_event */
-#ifdef GL_ARB_clear_buffer_object
- CONST_CAST(GLEW_ARB_clear_buffer_object) = _glewSearchExtension("GL_ARB_clear_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_clear_buffer_object) CONST_CAST(GLEW_ARB_clear_buffer_object) = !_glewInit_GL_ARB_clear_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_clear_buffer_object */
-#ifdef GL_ARB_clear_texture
- CONST_CAST(GLEW_ARB_clear_texture) = _glewSearchExtension("GL_ARB_clear_texture", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_clear_texture) CONST_CAST(GLEW_ARB_clear_texture) = !_glewInit_GL_ARB_clear_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_clear_texture */
-#ifdef GL_ARB_color_buffer_float
- CONST_CAST(GLEW_ARB_color_buffer_float) = _glewSearchExtension("GL_ARB_color_buffer_float", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_color_buffer_float */
-#ifdef GL_ARB_compatibility
- CONST_CAST(GLEW_ARB_compatibility) = _glewSearchExtension("GL_ARB_compatibility", extStart, extEnd);
-#endif /* GL_ARB_compatibility */
-#ifdef GL_ARB_compressed_texture_pixel_storage
- CONST_CAST(GLEW_ARB_compressed_texture_pixel_storage) = _glewSearchExtension("GL_ARB_compressed_texture_pixel_storage", extStart, extEnd);
-#endif /* GL_ARB_compressed_texture_pixel_storage */
-#ifdef GL_ARB_compute_shader
- CONST_CAST(GLEW_ARB_compute_shader) = _glewSearchExtension("GL_ARB_compute_shader", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_compute_shader) CONST_CAST(GLEW_ARB_compute_shader) = !_glewInit_GL_ARB_compute_shader(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_compute_shader */
-#ifdef GL_ARB_compute_variable_group_size
- CONST_CAST(GLEW_ARB_compute_variable_group_size) = _glewSearchExtension("GL_ARB_compute_variable_group_size", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_compute_variable_group_size) CONST_CAST(GLEW_ARB_compute_variable_group_size) = !_glewInit_GL_ARB_compute_variable_group_size(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_compute_variable_group_size */
-#ifdef GL_ARB_conservative_depth
- CONST_CAST(GLEW_ARB_conservative_depth) = _glewSearchExtension("GL_ARB_conservative_depth", extStart, extEnd);
-#endif /* GL_ARB_conservative_depth */
-#ifdef GL_ARB_copy_buffer
- CONST_CAST(GLEW_ARB_copy_buffer) = _glewSearchExtension("GL_ARB_copy_buffer", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_copy_buffer */
-#ifdef GL_ARB_copy_image
- CONST_CAST(GLEW_ARB_copy_image) = _glewSearchExtension("GL_ARB_copy_image", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_copy_image) CONST_CAST(GLEW_ARB_copy_image) = !_glewInit_GL_ARB_copy_image(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_copy_image */
-#ifdef GL_ARB_debug_output
- CONST_CAST(GLEW_ARB_debug_output) = _glewSearchExtension("GL_ARB_debug_output", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_debug_output */
-#ifdef GL_ARB_depth_buffer_float
- CONST_CAST(GLEW_ARB_depth_buffer_float) = _glewSearchExtension("GL_ARB_depth_buffer_float", extStart, extEnd);
-#endif /* GL_ARB_depth_buffer_float */
-#ifdef GL_ARB_depth_clamp
- CONST_CAST(GLEW_ARB_depth_clamp) = _glewSearchExtension("GL_ARB_depth_clamp", extStart, extEnd);
-#endif /* GL_ARB_depth_clamp */
-#ifdef GL_ARB_depth_texture
- CONST_CAST(GLEW_ARB_depth_texture) = _glewSearchExtension("GL_ARB_depth_texture", extStart, extEnd);
-#endif /* GL_ARB_depth_texture */
-#ifdef GL_ARB_draw_buffers
- CONST_CAST(GLEW_ARB_draw_buffers) = _glewSearchExtension("GL_ARB_draw_buffers", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_draw_buffers */
-#ifdef GL_ARB_draw_buffers_blend
- CONST_CAST(GLEW_ARB_draw_buffers_blend) = _glewSearchExtension("GL_ARB_draw_buffers_blend", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_draw_buffers_blend */
-#ifdef GL_ARB_draw_elements_base_vertex
- CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = _glewSearchExtension("GL_ARB_draw_elements_base_vertex", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_draw_elements_base_vertex */
-#ifdef GL_ARB_draw_indirect
- CONST_CAST(GLEW_ARB_draw_indirect) = _glewSearchExtension("GL_ARB_draw_indirect", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_draw_indirect */
-#ifdef GL_ARB_draw_instanced
- CONST_CAST(GLEW_ARB_draw_instanced) = _glewSearchExtension("GL_ARB_draw_instanced", extStart, extEnd);
-#endif /* GL_ARB_draw_instanced */
-#ifdef GL_ARB_enhanced_layouts
- CONST_CAST(GLEW_ARB_enhanced_layouts) = _glewSearchExtension("GL_ARB_enhanced_layouts", extStart, extEnd);
-#endif /* GL_ARB_enhanced_layouts */
-#ifdef GL_ARB_explicit_attrib_location
- CONST_CAST(GLEW_ARB_explicit_attrib_location) = _glewSearchExtension("GL_ARB_explicit_attrib_location", extStart, extEnd);
-#endif /* GL_ARB_explicit_attrib_location */
-#ifdef GL_ARB_explicit_uniform_location
- CONST_CAST(GLEW_ARB_explicit_uniform_location) = _glewSearchExtension("GL_ARB_explicit_uniform_location", extStart, extEnd);
-#endif /* GL_ARB_explicit_uniform_location */
-#ifdef GL_ARB_fragment_coord_conventions
- CONST_CAST(GLEW_ARB_fragment_coord_conventions) = _glewSearchExtension("GL_ARB_fragment_coord_conventions", extStart, extEnd);
-#endif /* GL_ARB_fragment_coord_conventions */
-#ifdef GL_ARB_fragment_layer_viewport
- CONST_CAST(GLEW_ARB_fragment_layer_viewport) = _glewSearchExtension("GL_ARB_fragment_layer_viewport", extStart, extEnd);
-#endif /* GL_ARB_fragment_layer_viewport */
-#ifdef GL_ARB_fragment_program
- CONST_CAST(GLEW_ARB_fragment_program) = _glewSearchExtension("GL_ARB_fragment_program", extStart, extEnd);
-#endif /* GL_ARB_fragment_program */
-#ifdef GL_ARB_fragment_program_shadow
- CONST_CAST(GLEW_ARB_fragment_program_shadow) = _glewSearchExtension("GL_ARB_fragment_program_shadow", extStart, extEnd);
-#endif /* GL_ARB_fragment_program_shadow */
-#ifdef GL_ARB_fragment_shader
- CONST_CAST(GLEW_ARB_fragment_shader) = _glewSearchExtension("GL_ARB_fragment_shader", extStart, extEnd);
-#endif /* GL_ARB_fragment_shader */
-#ifdef GL_ARB_framebuffer_no_attachments
- CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = _glewSearchExtension("GL_ARB_framebuffer_no_attachments", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_framebuffer_no_attachments) CONST_CAST(GLEW_ARB_framebuffer_no_attachments) = !_glewInit_GL_ARB_framebuffer_no_attachments(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_framebuffer_no_attachments */
-#ifdef GL_ARB_framebuffer_object
- CONST_CAST(GLEW_ARB_framebuffer_object) = _glewSearchExtension("GL_ARB_framebuffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_framebuffer_object */
-#ifdef GL_ARB_framebuffer_sRGB
- CONST_CAST(GLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GL_ARB_framebuffer_sRGB", extStart, extEnd);
-#endif /* GL_ARB_framebuffer_sRGB */
-#ifdef GL_ARB_geometry_shader4
- CONST_CAST(GLEW_ARB_geometry_shader4) = _glewSearchExtension("GL_ARB_geometry_shader4", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_geometry_shader4 */
-#ifdef GL_ARB_get_program_binary
- CONST_CAST(GLEW_ARB_get_program_binary) = _glewSearchExtension("GL_ARB_get_program_binary", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_get_program_binary */
-#ifdef GL_ARB_gpu_shader5
- CONST_CAST(GLEW_ARB_gpu_shader5) = _glewSearchExtension("GL_ARB_gpu_shader5", extStart, extEnd);
-#endif /* GL_ARB_gpu_shader5 */
-#ifdef GL_ARB_gpu_shader_fp64
- CONST_CAST(GLEW_ARB_gpu_shader_fp64) = _glewSearchExtension("GL_ARB_gpu_shader_fp64", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_gpu_shader_fp64 */
-#ifdef GL_ARB_half_float_pixel
- CONST_CAST(GLEW_ARB_half_float_pixel) = _glewSearchExtension("GL_ARB_half_float_pixel", extStart, extEnd);
-#endif /* GL_ARB_half_float_pixel */
-#ifdef GL_ARB_half_float_vertex
- CONST_CAST(GLEW_ARB_half_float_vertex) = _glewSearchExtension("GL_ARB_half_float_vertex", extStart, extEnd);
-#endif /* GL_ARB_half_float_vertex */
-#ifdef GL_ARB_imaging
- CONST_CAST(GLEW_ARB_imaging) = _glewSearchExtension("GL_ARB_imaging", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_imaging */
-#ifdef GL_ARB_indirect_parameters
- CONST_CAST(GLEW_ARB_indirect_parameters) = _glewSearchExtension("GL_ARB_indirect_parameters", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_indirect_parameters) CONST_CAST(GLEW_ARB_indirect_parameters) = !_glewInit_GL_ARB_indirect_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_indirect_parameters */
-#ifdef GL_ARB_instanced_arrays
- CONST_CAST(GLEW_ARB_instanced_arrays) = _glewSearchExtension("GL_ARB_instanced_arrays", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_instanced_arrays */
-#ifdef GL_ARB_internalformat_query
- CONST_CAST(GLEW_ARB_internalformat_query) = _glewSearchExtension("GL_ARB_internalformat_query", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_internalformat_query) CONST_CAST(GLEW_ARB_internalformat_query) = !_glewInit_GL_ARB_internalformat_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_internalformat_query */
-#ifdef GL_ARB_internalformat_query2
- CONST_CAST(GLEW_ARB_internalformat_query2) = _glewSearchExtension("GL_ARB_internalformat_query2", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_internalformat_query2) CONST_CAST(GLEW_ARB_internalformat_query2) = !_glewInit_GL_ARB_internalformat_query2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_internalformat_query2 */
-#ifdef GL_ARB_invalidate_subdata
- CONST_CAST(GLEW_ARB_invalidate_subdata) = _glewSearchExtension("GL_ARB_invalidate_subdata", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_invalidate_subdata) CONST_CAST(GLEW_ARB_invalidate_subdata) = !_glewInit_GL_ARB_invalidate_subdata(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_invalidate_subdata */
-#ifdef GL_ARB_map_buffer_alignment
- CONST_CAST(GLEW_ARB_map_buffer_alignment) = _glewSearchExtension("GL_ARB_map_buffer_alignment", extStart, extEnd);
-#endif /* GL_ARB_map_buffer_alignment */
-#ifdef GL_ARB_map_buffer_range
- CONST_CAST(GLEW_ARB_map_buffer_range) = _glewSearchExtension("GL_ARB_map_buffer_range", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_map_buffer_range */
-#ifdef GL_ARB_matrix_palette
- CONST_CAST(GLEW_ARB_matrix_palette) = _glewSearchExtension("GL_ARB_matrix_palette", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_matrix_palette */
-#ifdef GL_ARB_multi_bind
- CONST_CAST(GLEW_ARB_multi_bind) = _glewSearchExtension("GL_ARB_multi_bind", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_multi_bind) CONST_CAST(GLEW_ARB_multi_bind) = !_glewInit_GL_ARB_multi_bind(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_multi_bind */
-#ifdef GL_ARB_multi_draw_indirect
- CONST_CAST(GLEW_ARB_multi_draw_indirect) = _glewSearchExtension("GL_ARB_multi_draw_indirect", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_multi_draw_indirect) CONST_CAST(GLEW_ARB_multi_draw_indirect) = !_glewInit_GL_ARB_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_multi_draw_indirect */
-#ifdef GL_ARB_multisample
- CONST_CAST(GLEW_ARB_multisample) = _glewSearchExtension("GL_ARB_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_multisample */
-#ifdef GL_ARB_multitexture
- CONST_CAST(GLEW_ARB_multitexture) = _glewSearchExtension("GL_ARB_multitexture", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_multitexture */
-#ifdef GL_ARB_occlusion_query
- CONST_CAST(GLEW_ARB_occlusion_query) = _glewSearchExtension("GL_ARB_occlusion_query", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_occlusion_query */
-#ifdef GL_ARB_occlusion_query2
- CONST_CAST(GLEW_ARB_occlusion_query2) = _glewSearchExtension("GL_ARB_occlusion_query2", extStart, extEnd);
-#endif /* GL_ARB_occlusion_query2 */
-#ifdef GL_ARB_pixel_buffer_object
- CONST_CAST(GLEW_ARB_pixel_buffer_object) = _glewSearchExtension("GL_ARB_pixel_buffer_object", extStart, extEnd);
-#endif /* GL_ARB_pixel_buffer_object */
-#ifdef GL_ARB_point_parameters
- CONST_CAST(GLEW_ARB_point_parameters) = _glewSearchExtension("GL_ARB_point_parameters", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_point_parameters */
-#ifdef GL_ARB_point_sprite
- CONST_CAST(GLEW_ARB_point_sprite) = _glewSearchExtension("GL_ARB_point_sprite", extStart, extEnd);
-#endif /* GL_ARB_point_sprite */
-#ifdef GL_ARB_program_interface_query
- CONST_CAST(GLEW_ARB_program_interface_query) = _glewSearchExtension("GL_ARB_program_interface_query", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_program_interface_query) CONST_CAST(GLEW_ARB_program_interface_query) = !_glewInit_GL_ARB_program_interface_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_program_interface_query */
-#ifdef GL_ARB_provoking_vertex
- CONST_CAST(GLEW_ARB_provoking_vertex) = _glewSearchExtension("GL_ARB_provoking_vertex", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_provoking_vertex */
-#ifdef GL_ARB_query_buffer_object
- CONST_CAST(GLEW_ARB_query_buffer_object) = _glewSearchExtension("GL_ARB_query_buffer_object", extStart, extEnd);
-#endif /* GL_ARB_query_buffer_object */
-#ifdef GL_ARB_robust_buffer_access_behavior
- CONST_CAST(GLEW_ARB_robust_buffer_access_behavior) = _glewSearchExtension("GL_ARB_robust_buffer_access_behavior", extStart, extEnd);
-#endif /* GL_ARB_robust_buffer_access_behavior */
-#ifdef GL_ARB_robustness
- CONST_CAST(GLEW_ARB_robustness) = _glewSearchExtension("GL_ARB_robustness", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_robustness */
-#ifdef GL_ARB_robustness_application_isolation
- CONST_CAST(GLEW_ARB_robustness_application_isolation) = _glewSearchExtension("GL_ARB_robustness_application_isolation", extStart, extEnd);
-#endif /* GL_ARB_robustness_application_isolation */
-#ifdef GL_ARB_robustness_share_group_isolation
- CONST_CAST(GLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GL_ARB_robustness_share_group_isolation", extStart, extEnd);
-#endif /* GL_ARB_robustness_share_group_isolation */
-#ifdef GL_ARB_sample_shading
- CONST_CAST(GLEW_ARB_sample_shading) = _glewSearchExtension("GL_ARB_sample_shading", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_sample_shading */
-#ifdef GL_ARB_sampler_objects
- CONST_CAST(GLEW_ARB_sampler_objects) = _glewSearchExtension("GL_ARB_sampler_objects", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_sampler_objects */
-#ifdef GL_ARB_seamless_cube_map
- CONST_CAST(GLEW_ARB_seamless_cube_map) = _glewSearchExtension("GL_ARB_seamless_cube_map", extStart, extEnd);
-#endif /* GL_ARB_seamless_cube_map */
-#ifdef GL_ARB_seamless_cubemap_per_texture
- CONST_CAST(GLEW_ARB_seamless_cubemap_per_texture) = _glewSearchExtension("GL_ARB_seamless_cubemap_per_texture", extStart, extEnd);
-#endif /* GL_ARB_seamless_cubemap_per_texture */
-#ifdef GL_ARB_separate_shader_objects
- CONST_CAST(GLEW_ARB_separate_shader_objects) = _glewSearchExtension("GL_ARB_separate_shader_objects", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_separate_shader_objects */
-#ifdef GL_ARB_shader_atomic_counters
- CONST_CAST(GLEW_ARB_shader_atomic_counters) = _glewSearchExtension("GL_ARB_shader_atomic_counters", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shader_atomic_counters) CONST_CAST(GLEW_ARB_shader_atomic_counters) = !_glewInit_GL_ARB_shader_atomic_counters(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shader_atomic_counters */
-#ifdef GL_ARB_shader_bit_encoding
- CONST_CAST(GLEW_ARB_shader_bit_encoding) = _glewSearchExtension("GL_ARB_shader_bit_encoding", extStart, extEnd);
-#endif /* GL_ARB_shader_bit_encoding */
-#ifdef GL_ARB_shader_draw_parameters
- CONST_CAST(GLEW_ARB_shader_draw_parameters) = _glewSearchExtension("GL_ARB_shader_draw_parameters", extStart, extEnd);
-#endif /* GL_ARB_shader_draw_parameters */
-#ifdef GL_ARB_shader_group_vote
- CONST_CAST(GLEW_ARB_shader_group_vote) = _glewSearchExtension("GL_ARB_shader_group_vote", extStart, extEnd);
-#endif /* GL_ARB_shader_group_vote */
-#ifdef GL_ARB_shader_image_load_store
- CONST_CAST(GLEW_ARB_shader_image_load_store) = _glewSearchExtension("GL_ARB_shader_image_load_store", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shader_image_load_store) CONST_CAST(GLEW_ARB_shader_image_load_store) = !_glewInit_GL_ARB_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shader_image_load_store */
-#ifdef GL_ARB_shader_image_size
- CONST_CAST(GLEW_ARB_shader_image_size) = _glewSearchExtension("GL_ARB_shader_image_size", extStart, extEnd);
-#endif /* GL_ARB_shader_image_size */
-#ifdef GL_ARB_shader_objects
- CONST_CAST(GLEW_ARB_shader_objects) = _glewSearchExtension("GL_ARB_shader_objects", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shader_objects */
-#ifdef GL_ARB_shader_precision
- CONST_CAST(GLEW_ARB_shader_precision) = _glewSearchExtension("GL_ARB_shader_precision", extStart, extEnd);
-#endif /* GL_ARB_shader_precision */
-#ifdef GL_ARB_shader_stencil_export
- CONST_CAST(GLEW_ARB_shader_stencil_export) = _glewSearchExtension("GL_ARB_shader_stencil_export", extStart, extEnd);
-#endif /* GL_ARB_shader_stencil_export */
-#ifdef GL_ARB_shader_storage_buffer_object
- CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = _glewSearchExtension("GL_ARB_shader_storage_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shader_storage_buffer_object) CONST_CAST(GLEW_ARB_shader_storage_buffer_object) = !_glewInit_GL_ARB_shader_storage_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shader_storage_buffer_object */
-#ifdef GL_ARB_shader_subroutine
- CONST_CAST(GLEW_ARB_shader_subroutine) = _glewSearchExtension("GL_ARB_shader_subroutine", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shader_subroutine */
-#ifdef GL_ARB_shader_texture_lod
- CONST_CAST(GLEW_ARB_shader_texture_lod) = _glewSearchExtension("GL_ARB_shader_texture_lod", extStart, extEnd);
-#endif /* GL_ARB_shader_texture_lod */
-#ifdef GL_ARB_shading_language_100
- CONST_CAST(GLEW_ARB_shading_language_100) = _glewSearchExtension("GL_ARB_shading_language_100", extStart, extEnd);
-#endif /* GL_ARB_shading_language_100 */
-#ifdef GL_ARB_shading_language_420pack
- CONST_CAST(GLEW_ARB_shading_language_420pack) = _glewSearchExtension("GL_ARB_shading_language_420pack", extStart, extEnd);
-#endif /* GL_ARB_shading_language_420pack */
-#ifdef GL_ARB_shading_language_include
- CONST_CAST(GLEW_ARB_shading_language_include) = _glewSearchExtension("GL_ARB_shading_language_include", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_shading_language_include */
-#ifdef GL_ARB_shading_language_packing
- CONST_CAST(GLEW_ARB_shading_language_packing) = _glewSearchExtension("GL_ARB_shading_language_packing", extStart, extEnd);
-#endif /* GL_ARB_shading_language_packing */
-#ifdef GL_ARB_shadow
- CONST_CAST(GLEW_ARB_shadow) = _glewSearchExtension("GL_ARB_shadow", extStart, extEnd);
-#endif /* GL_ARB_shadow */
-#ifdef GL_ARB_shadow_ambient
- CONST_CAST(GLEW_ARB_shadow_ambient) = _glewSearchExtension("GL_ARB_shadow_ambient", extStart, extEnd);
-#endif /* GL_ARB_shadow_ambient */
-#ifdef GL_ARB_sparse_texture
- CONST_CAST(GLEW_ARB_sparse_texture) = _glewSearchExtension("GL_ARB_sparse_texture", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_sparse_texture) CONST_CAST(GLEW_ARB_sparse_texture) = !_glewInit_GL_ARB_sparse_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_sparse_texture */
-#ifdef GL_ARB_stencil_texturing
- CONST_CAST(GLEW_ARB_stencil_texturing) = _glewSearchExtension("GL_ARB_stencil_texturing", extStart, extEnd);
-#endif /* GL_ARB_stencil_texturing */
-#ifdef GL_ARB_sync
- CONST_CAST(GLEW_ARB_sync) = _glewSearchExtension("GL_ARB_sync", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_sync */
-#ifdef GL_ARB_tessellation_shader
- CONST_CAST(GLEW_ARB_tessellation_shader) = _glewSearchExtension("GL_ARB_tessellation_shader", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_tessellation_shader */
-#ifdef GL_ARB_texture_border_clamp
- CONST_CAST(GLEW_ARB_texture_border_clamp) = _glewSearchExtension("GL_ARB_texture_border_clamp", extStart, extEnd);
-#endif /* GL_ARB_texture_border_clamp */
-#ifdef GL_ARB_texture_buffer_object
- CONST_CAST(GLEW_ARB_texture_buffer_object) = _glewSearchExtension("GL_ARB_texture_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_buffer_object */
-#ifdef GL_ARB_texture_buffer_object_rgb32
- CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = _glewSearchExtension("GL_ARB_texture_buffer_object_rgb32", extStart, extEnd);
-#endif /* GL_ARB_texture_buffer_object_rgb32 */
-#ifdef GL_ARB_texture_buffer_range
- CONST_CAST(GLEW_ARB_texture_buffer_range) = _glewSearchExtension("GL_ARB_texture_buffer_range", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_buffer_range) CONST_CAST(GLEW_ARB_texture_buffer_range) = !_glewInit_GL_ARB_texture_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_buffer_range */
-#ifdef GL_ARB_texture_compression
- CONST_CAST(GLEW_ARB_texture_compression) = _glewSearchExtension("GL_ARB_texture_compression", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_compression */
-#ifdef GL_ARB_texture_compression_bptc
- CONST_CAST(GLEW_ARB_texture_compression_bptc) = _glewSearchExtension("GL_ARB_texture_compression_bptc", extStart, extEnd);
-#endif /* GL_ARB_texture_compression_bptc */
-#ifdef GL_ARB_texture_compression_rgtc
- CONST_CAST(GLEW_ARB_texture_compression_rgtc) = _glewSearchExtension("GL_ARB_texture_compression_rgtc", extStart, extEnd);
-#endif /* GL_ARB_texture_compression_rgtc */
-#ifdef GL_ARB_texture_cube_map
- CONST_CAST(GLEW_ARB_texture_cube_map) = _glewSearchExtension("GL_ARB_texture_cube_map", extStart, extEnd);
-#endif /* GL_ARB_texture_cube_map */
-#ifdef GL_ARB_texture_cube_map_array
- CONST_CAST(GLEW_ARB_texture_cube_map_array) = _glewSearchExtension("GL_ARB_texture_cube_map_array", extStart, extEnd);
-#endif /* GL_ARB_texture_cube_map_array */
-#ifdef GL_ARB_texture_env_add
- CONST_CAST(GLEW_ARB_texture_env_add) = _glewSearchExtension("GL_ARB_texture_env_add", extStart, extEnd);
-#endif /* GL_ARB_texture_env_add */
-#ifdef GL_ARB_texture_env_combine
- CONST_CAST(GLEW_ARB_texture_env_combine) = _glewSearchExtension("GL_ARB_texture_env_combine", extStart, extEnd);
-#endif /* GL_ARB_texture_env_combine */
-#ifdef GL_ARB_texture_env_crossbar
- CONST_CAST(GLEW_ARB_texture_env_crossbar) = _glewSearchExtension("GL_ARB_texture_env_crossbar", extStart, extEnd);
-#endif /* GL_ARB_texture_env_crossbar */
-#ifdef GL_ARB_texture_env_dot3
- CONST_CAST(GLEW_ARB_texture_env_dot3) = _glewSearchExtension("GL_ARB_texture_env_dot3", extStart, extEnd);
-#endif /* GL_ARB_texture_env_dot3 */
-#ifdef GL_ARB_texture_float
- CONST_CAST(GLEW_ARB_texture_float) = _glewSearchExtension("GL_ARB_texture_float", extStart, extEnd);
-#endif /* GL_ARB_texture_float */
-#ifdef GL_ARB_texture_gather
- CONST_CAST(GLEW_ARB_texture_gather) = _glewSearchExtension("GL_ARB_texture_gather", extStart, extEnd);
-#endif /* GL_ARB_texture_gather */
-#ifdef GL_ARB_texture_mirror_clamp_to_edge
- CONST_CAST(GLEW_ARB_texture_mirror_clamp_to_edge) = _glewSearchExtension("GL_ARB_texture_mirror_clamp_to_edge", extStart, extEnd);
-#endif /* GL_ARB_texture_mirror_clamp_to_edge */
-#ifdef GL_ARB_texture_mirrored_repeat
- CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = _glewSearchExtension("GL_ARB_texture_mirrored_repeat", extStart, extEnd);
-#endif /* GL_ARB_texture_mirrored_repeat */
-#ifdef GL_ARB_texture_multisample
- CONST_CAST(GLEW_ARB_texture_multisample) = _glewSearchExtension("GL_ARB_texture_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_multisample */
-#ifdef GL_ARB_texture_non_power_of_two
- CONST_CAST(GLEW_ARB_texture_non_power_of_two) = _glewSearchExtension("GL_ARB_texture_non_power_of_two", extStart, extEnd);
-#endif /* GL_ARB_texture_non_power_of_two */
-#ifdef GL_ARB_texture_query_levels
- CONST_CAST(GLEW_ARB_texture_query_levels) = _glewSearchExtension("GL_ARB_texture_query_levels", extStart, extEnd);
-#endif /* GL_ARB_texture_query_levels */
-#ifdef GL_ARB_texture_query_lod
- CONST_CAST(GLEW_ARB_texture_query_lod) = _glewSearchExtension("GL_ARB_texture_query_lod", extStart, extEnd);
-#endif /* GL_ARB_texture_query_lod */
-#ifdef GL_ARB_texture_rectangle
- CONST_CAST(GLEW_ARB_texture_rectangle) = _glewSearchExtension("GL_ARB_texture_rectangle", extStart, extEnd);
-#endif /* GL_ARB_texture_rectangle */
-#ifdef GL_ARB_texture_rg
- CONST_CAST(GLEW_ARB_texture_rg) = _glewSearchExtension("GL_ARB_texture_rg", extStart, extEnd);
-#endif /* GL_ARB_texture_rg */
-#ifdef GL_ARB_texture_rgb10_a2ui
- CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = _glewSearchExtension("GL_ARB_texture_rgb10_a2ui", extStart, extEnd);
-#endif /* GL_ARB_texture_rgb10_a2ui */
-#ifdef GL_ARB_texture_stencil8
- CONST_CAST(GLEW_ARB_texture_stencil8) = _glewSearchExtension("GL_ARB_texture_stencil8", extStart, extEnd);
-#endif /* GL_ARB_texture_stencil8 */
-#ifdef GL_ARB_texture_storage
- CONST_CAST(GLEW_ARB_texture_storage) = _glewSearchExtension("GL_ARB_texture_storage", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_storage) CONST_CAST(GLEW_ARB_texture_storage) = !_glewInit_GL_ARB_texture_storage(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_storage */
-#ifdef GL_ARB_texture_storage_multisample
- CONST_CAST(GLEW_ARB_texture_storage_multisample) = _glewSearchExtension("GL_ARB_texture_storage_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_storage_multisample) CONST_CAST(GLEW_ARB_texture_storage_multisample) = !_glewInit_GL_ARB_texture_storage_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_storage_multisample */
-#ifdef GL_ARB_texture_swizzle
- CONST_CAST(GLEW_ARB_texture_swizzle) = _glewSearchExtension("GL_ARB_texture_swizzle", extStart, extEnd);
-#endif /* GL_ARB_texture_swizzle */
-#ifdef GL_ARB_texture_view
- CONST_CAST(GLEW_ARB_texture_view) = _glewSearchExtension("GL_ARB_texture_view", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_texture_view) CONST_CAST(GLEW_ARB_texture_view) = !_glewInit_GL_ARB_texture_view(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_texture_view */
-#ifdef GL_ARB_timer_query
- CONST_CAST(GLEW_ARB_timer_query) = _glewSearchExtension("GL_ARB_timer_query", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_timer_query */
-#ifdef GL_ARB_transform_feedback2
- CONST_CAST(GLEW_ARB_transform_feedback2) = _glewSearchExtension("GL_ARB_transform_feedback2", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_transform_feedback2 */
-#ifdef GL_ARB_transform_feedback3
- CONST_CAST(GLEW_ARB_transform_feedback3) = _glewSearchExtension("GL_ARB_transform_feedback3", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_transform_feedback3 */
-#ifdef GL_ARB_transform_feedback_instanced
- CONST_CAST(GLEW_ARB_transform_feedback_instanced) = _glewSearchExtension("GL_ARB_transform_feedback_instanced", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_transform_feedback_instanced) CONST_CAST(GLEW_ARB_transform_feedback_instanced) = !_glewInit_GL_ARB_transform_feedback_instanced(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_transform_feedback_instanced */
-#ifdef GL_ARB_transpose_matrix
- CONST_CAST(GLEW_ARB_transpose_matrix) = _glewSearchExtension("GL_ARB_transpose_matrix", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_transpose_matrix */
-#ifdef GL_ARB_uniform_buffer_object
- CONST_CAST(GLEW_ARB_uniform_buffer_object) = _glewSearchExtension("GL_ARB_uniform_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_uniform_buffer_object */
-#ifdef GL_ARB_vertex_array_bgra
- CONST_CAST(GLEW_ARB_vertex_array_bgra) = _glewSearchExtension("GL_ARB_vertex_array_bgra", extStart, extEnd);
-#endif /* GL_ARB_vertex_array_bgra */
-#ifdef GL_ARB_vertex_array_object
- CONST_CAST(GLEW_ARB_vertex_array_object) = _glewSearchExtension("GL_ARB_vertex_array_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_array_object */
-#ifdef GL_ARB_vertex_attrib_64bit
- CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = _glewSearchExtension("GL_ARB_vertex_attrib_64bit", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_attrib_64bit */
-#ifdef GL_ARB_vertex_attrib_binding
- CONST_CAST(GLEW_ARB_vertex_attrib_binding) = _glewSearchExtension("GL_ARB_vertex_attrib_binding", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_attrib_binding) CONST_CAST(GLEW_ARB_vertex_attrib_binding) = !_glewInit_GL_ARB_vertex_attrib_binding(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_attrib_binding */
-#ifdef GL_ARB_vertex_blend
- CONST_CAST(GLEW_ARB_vertex_blend) = _glewSearchExtension("GL_ARB_vertex_blend", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_blend */
-#ifdef GL_ARB_vertex_buffer_object
- CONST_CAST(GLEW_ARB_vertex_buffer_object) = _glewSearchExtension("GL_ARB_vertex_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_buffer_object */
-#ifdef GL_ARB_vertex_program
- CONST_CAST(GLEW_ARB_vertex_program) = _glewSearchExtension("GL_ARB_vertex_program", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_program */
-#ifdef GL_ARB_vertex_shader
- CONST_CAST(GLEW_ARB_vertex_shader) = _glewSearchExtension("GL_ARB_vertex_shader", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_shader */
-#ifdef GL_ARB_vertex_type_10f_11f_11f_rev
- CONST_CAST(GLEW_ARB_vertex_type_10f_11f_11f_rev) = _glewSearchExtension("GL_ARB_vertex_type_10f_11f_11f_rev", extStart, extEnd);
-#endif /* GL_ARB_vertex_type_10f_11f_11f_rev */
-#ifdef GL_ARB_vertex_type_2_10_10_10_rev
- CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = _glewSearchExtension("GL_ARB_vertex_type_2_10_10_10_rev", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_vertex_type_2_10_10_10_rev */
-#ifdef GL_ARB_viewport_array
- CONST_CAST(GLEW_ARB_viewport_array) = _glewSearchExtension("GL_ARB_viewport_array", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_viewport_array */
-#ifdef GL_ARB_window_pos
- CONST_CAST(GLEW_ARB_window_pos) = _glewSearchExtension("GL_ARB_window_pos", extStart, extEnd);
- if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ARB_window_pos */
-#ifdef GL_ATIX_point_sprites
- CONST_CAST(GLEW_ATIX_point_sprites) = _glewSearchExtension("GL_ATIX_point_sprites", extStart, extEnd);
-#endif /* GL_ATIX_point_sprites */
-#ifdef GL_ATIX_texture_env_combine3
- CONST_CAST(GLEW_ATIX_texture_env_combine3) = _glewSearchExtension("GL_ATIX_texture_env_combine3", extStart, extEnd);
-#endif /* GL_ATIX_texture_env_combine3 */
-#ifdef GL_ATIX_texture_env_route
- CONST_CAST(GLEW_ATIX_texture_env_route) = _glewSearchExtension("GL_ATIX_texture_env_route", extStart, extEnd);
-#endif /* GL_ATIX_texture_env_route */
-#ifdef GL_ATIX_vertex_shader_output_point_size
- CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = _glewSearchExtension("GL_ATIX_vertex_shader_output_point_size", extStart, extEnd);
-#endif /* GL_ATIX_vertex_shader_output_point_size */
-#ifdef GL_ATI_draw_buffers
- CONST_CAST(GLEW_ATI_draw_buffers) = _glewSearchExtension("GL_ATI_draw_buffers", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_draw_buffers */
-#ifdef GL_ATI_element_array
- CONST_CAST(GLEW_ATI_element_array) = _glewSearchExtension("GL_ATI_element_array", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_element_array */
-#ifdef GL_ATI_envmap_bumpmap
- CONST_CAST(GLEW_ATI_envmap_bumpmap) = _glewSearchExtension("GL_ATI_envmap_bumpmap", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_envmap_bumpmap */
-#ifdef GL_ATI_fragment_shader
- CONST_CAST(GLEW_ATI_fragment_shader) = _glewSearchExtension("GL_ATI_fragment_shader", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_fragment_shader */
-#ifdef GL_ATI_map_object_buffer
- CONST_CAST(GLEW_ATI_map_object_buffer) = _glewSearchExtension("GL_ATI_map_object_buffer", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_map_object_buffer */
-#ifdef GL_ATI_meminfo
- CONST_CAST(GLEW_ATI_meminfo) = _glewSearchExtension("GL_ATI_meminfo", extStart, extEnd);
-#endif /* GL_ATI_meminfo */
-#ifdef GL_ATI_pn_triangles
- CONST_CAST(GLEW_ATI_pn_triangles) = _glewSearchExtension("GL_ATI_pn_triangles", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_pn_triangles */
-#ifdef GL_ATI_separate_stencil
- CONST_CAST(GLEW_ATI_separate_stencil) = _glewSearchExtension("GL_ATI_separate_stencil", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_separate_stencil */
-#ifdef GL_ATI_shader_texture_lod
- CONST_CAST(GLEW_ATI_shader_texture_lod) = _glewSearchExtension("GL_ATI_shader_texture_lod", extStart, extEnd);
-#endif /* GL_ATI_shader_texture_lod */
-#ifdef GL_ATI_text_fragment_shader
- CONST_CAST(GLEW_ATI_text_fragment_shader) = _glewSearchExtension("GL_ATI_text_fragment_shader", extStart, extEnd);
-#endif /* GL_ATI_text_fragment_shader */
-#ifdef GL_ATI_texture_compression_3dc
- CONST_CAST(GLEW_ATI_texture_compression_3dc) = _glewSearchExtension("GL_ATI_texture_compression_3dc", extStart, extEnd);
-#endif /* GL_ATI_texture_compression_3dc */
-#ifdef GL_ATI_texture_env_combine3
- CONST_CAST(GLEW_ATI_texture_env_combine3) = _glewSearchExtension("GL_ATI_texture_env_combine3", extStart, extEnd);
-#endif /* GL_ATI_texture_env_combine3 */
-#ifdef GL_ATI_texture_float
- CONST_CAST(GLEW_ATI_texture_float) = _glewSearchExtension("GL_ATI_texture_float", extStart, extEnd);
-#endif /* GL_ATI_texture_float */
-#ifdef GL_ATI_texture_mirror_once
- CONST_CAST(GLEW_ATI_texture_mirror_once) = _glewSearchExtension("GL_ATI_texture_mirror_once", extStart, extEnd);
-#endif /* GL_ATI_texture_mirror_once */
-#ifdef GL_ATI_vertex_array_object
- CONST_CAST(GLEW_ATI_vertex_array_object) = _glewSearchExtension("GL_ATI_vertex_array_object", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_vertex_array_object */
-#ifdef GL_ATI_vertex_attrib_array_object
- CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = _glewSearchExtension("GL_ATI_vertex_attrib_array_object", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_vertex_attrib_array_object */
-#ifdef GL_ATI_vertex_streams
- CONST_CAST(GLEW_ATI_vertex_streams) = _glewSearchExtension("GL_ATI_vertex_streams", extStart, extEnd);
- if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_ATI_vertex_streams */
-#ifdef GL_EXT_422_pixels
- CONST_CAST(GLEW_EXT_422_pixels) = _glewSearchExtension("GL_EXT_422_pixels", extStart, extEnd);
-#endif /* GL_EXT_422_pixels */
-#ifdef GL_EXT_Cg_shader
- CONST_CAST(GLEW_EXT_Cg_shader) = _glewSearchExtension("GL_EXT_Cg_shader", extStart, extEnd);
-#endif /* GL_EXT_Cg_shader */
-#ifdef GL_EXT_abgr
- CONST_CAST(GLEW_EXT_abgr) = _glewSearchExtension("GL_EXT_abgr", extStart, extEnd);
-#endif /* GL_EXT_abgr */
-#ifdef GL_EXT_bgra
- CONST_CAST(GLEW_EXT_bgra) = _glewSearchExtension("GL_EXT_bgra", extStart, extEnd);
-#endif /* GL_EXT_bgra */
-#ifdef GL_EXT_bindable_uniform
- CONST_CAST(GLEW_EXT_bindable_uniform) = _glewSearchExtension("GL_EXT_bindable_uniform", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_bindable_uniform */
-#ifdef GL_EXT_blend_color
- CONST_CAST(GLEW_EXT_blend_color) = _glewSearchExtension("GL_EXT_blend_color", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_blend_color */
-#ifdef GL_EXT_blend_equation_separate
- CONST_CAST(GLEW_EXT_blend_equation_separate) = _glewSearchExtension("GL_EXT_blend_equation_separate", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_blend_equation_separate */
-#ifdef GL_EXT_blend_func_separate
- CONST_CAST(GLEW_EXT_blend_func_separate) = _glewSearchExtension("GL_EXT_blend_func_separate", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_blend_func_separate */
-#ifdef GL_EXT_blend_logic_op
- CONST_CAST(GLEW_EXT_blend_logic_op) = _glewSearchExtension("GL_EXT_blend_logic_op", extStart, extEnd);
-#endif /* GL_EXT_blend_logic_op */
-#ifdef GL_EXT_blend_minmax
- CONST_CAST(GLEW_EXT_blend_minmax) = _glewSearchExtension("GL_EXT_blend_minmax", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_blend_minmax */
-#ifdef GL_EXT_blend_subtract
- CONST_CAST(GLEW_EXT_blend_subtract) = _glewSearchExtension("GL_EXT_blend_subtract", extStart, extEnd);
-#endif /* GL_EXT_blend_subtract */
-#ifdef GL_EXT_clip_volume_hint
- CONST_CAST(GLEW_EXT_clip_volume_hint) = _glewSearchExtension("GL_EXT_clip_volume_hint", extStart, extEnd);
-#endif /* GL_EXT_clip_volume_hint */
-#ifdef GL_EXT_cmyka
- CONST_CAST(GLEW_EXT_cmyka) = _glewSearchExtension("GL_EXT_cmyka", extStart, extEnd);
-#endif /* GL_EXT_cmyka */
-#ifdef GL_EXT_color_subtable
- CONST_CAST(GLEW_EXT_color_subtable) = _glewSearchExtension("GL_EXT_color_subtable", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_color_subtable */
-#ifdef GL_EXT_compiled_vertex_array
- CONST_CAST(GLEW_EXT_compiled_vertex_array) = _glewSearchExtension("GL_EXT_compiled_vertex_array", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_compiled_vertex_array */
-#ifdef GL_EXT_convolution
- CONST_CAST(GLEW_EXT_convolution) = _glewSearchExtension("GL_EXT_convolution", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_convolution */
-#ifdef GL_EXT_coordinate_frame
- CONST_CAST(GLEW_EXT_coordinate_frame) = _glewSearchExtension("GL_EXT_coordinate_frame", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_coordinate_frame */
-#ifdef GL_EXT_copy_texture
- CONST_CAST(GLEW_EXT_copy_texture) = _glewSearchExtension("GL_EXT_copy_texture", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_copy_texture */
-#ifdef GL_EXT_cull_vertex
- CONST_CAST(GLEW_EXT_cull_vertex) = _glewSearchExtension("GL_EXT_cull_vertex", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_cull_vertex */
-#ifdef GL_EXT_debug_marker
- CONST_CAST(GLEW_EXT_debug_marker) = _glewSearchExtension("GL_EXT_debug_marker", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_debug_marker) CONST_CAST(GLEW_EXT_debug_marker) = !_glewInit_GL_EXT_debug_marker(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_debug_marker */
-#ifdef GL_EXT_depth_bounds_test
- CONST_CAST(GLEW_EXT_depth_bounds_test) = _glewSearchExtension("GL_EXT_depth_bounds_test", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_depth_bounds_test */
-#ifdef GL_EXT_direct_state_access
- CONST_CAST(GLEW_EXT_direct_state_access) = _glewSearchExtension("GL_EXT_direct_state_access", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_direct_state_access */
-#ifdef GL_EXT_draw_buffers2
- CONST_CAST(GLEW_EXT_draw_buffers2) = _glewSearchExtension("GL_EXT_draw_buffers2", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_draw_buffers2 */
-#ifdef GL_EXT_draw_instanced
- CONST_CAST(GLEW_EXT_draw_instanced) = _glewSearchExtension("GL_EXT_draw_instanced", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_draw_instanced */
-#ifdef GL_EXT_draw_range_elements
- CONST_CAST(GLEW_EXT_draw_range_elements) = _glewSearchExtension("GL_EXT_draw_range_elements", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_draw_range_elements */
-#ifdef GL_EXT_fog_coord
- CONST_CAST(GLEW_EXT_fog_coord) = _glewSearchExtension("GL_EXT_fog_coord", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_fog_coord */
-#ifdef GL_EXT_fragment_lighting
- CONST_CAST(GLEW_EXT_fragment_lighting) = _glewSearchExtension("GL_EXT_fragment_lighting", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_fragment_lighting */
-#ifdef GL_EXT_framebuffer_blit
- CONST_CAST(GLEW_EXT_framebuffer_blit) = _glewSearchExtension("GL_EXT_framebuffer_blit", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_framebuffer_blit */
-#ifdef GL_EXT_framebuffer_multisample
- CONST_CAST(GLEW_EXT_framebuffer_multisample) = _glewSearchExtension("GL_EXT_framebuffer_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_framebuffer_multisample */
-#ifdef GL_EXT_framebuffer_multisample_blit_scaled
- CONST_CAST(GLEW_EXT_framebuffer_multisample_blit_scaled) = _glewSearchExtension("GL_EXT_framebuffer_multisample_blit_scaled", extStart, extEnd);
-#endif /* GL_EXT_framebuffer_multisample_blit_scaled */
-#ifdef GL_EXT_framebuffer_object
- CONST_CAST(GLEW_EXT_framebuffer_object) = _glewSearchExtension("GL_EXT_framebuffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_framebuffer_object */
-#ifdef GL_EXT_framebuffer_sRGB
- CONST_CAST(GLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GL_EXT_framebuffer_sRGB", extStart, extEnd);
-#endif /* GL_EXT_framebuffer_sRGB */
-#ifdef GL_EXT_geometry_shader4
- CONST_CAST(GLEW_EXT_geometry_shader4) = _glewSearchExtension("GL_EXT_geometry_shader4", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_geometry_shader4 */
-#ifdef GL_EXT_gpu_program_parameters
- CONST_CAST(GLEW_EXT_gpu_program_parameters) = _glewSearchExtension("GL_EXT_gpu_program_parameters", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_gpu_program_parameters */
-#ifdef GL_EXT_gpu_shader4
- CONST_CAST(GLEW_EXT_gpu_shader4) = _glewSearchExtension("GL_EXT_gpu_shader4", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_gpu_shader4 */
-#ifdef GL_EXT_histogram
- CONST_CAST(GLEW_EXT_histogram) = _glewSearchExtension("GL_EXT_histogram", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_histogram */
-#ifdef GL_EXT_index_array_formats
- CONST_CAST(GLEW_EXT_index_array_formats) = _glewSearchExtension("GL_EXT_index_array_formats", extStart, extEnd);
-#endif /* GL_EXT_index_array_formats */
-#ifdef GL_EXT_index_func
- CONST_CAST(GLEW_EXT_index_func) = _glewSearchExtension("GL_EXT_index_func", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_index_func */
-#ifdef GL_EXT_index_material
- CONST_CAST(GLEW_EXT_index_material) = _glewSearchExtension("GL_EXT_index_material", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_index_material */
-#ifdef GL_EXT_index_texture
- CONST_CAST(GLEW_EXT_index_texture) = _glewSearchExtension("GL_EXT_index_texture", extStart, extEnd);
-#endif /* GL_EXT_index_texture */
-#ifdef GL_EXT_light_texture
- CONST_CAST(GLEW_EXT_light_texture) = _glewSearchExtension("GL_EXT_light_texture", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_light_texture */
-#ifdef GL_EXT_misc_attribute
- CONST_CAST(GLEW_EXT_misc_attribute) = _glewSearchExtension("GL_EXT_misc_attribute", extStart, extEnd);
-#endif /* GL_EXT_misc_attribute */
-#ifdef GL_EXT_multi_draw_arrays
- CONST_CAST(GLEW_EXT_multi_draw_arrays) = _glewSearchExtension("GL_EXT_multi_draw_arrays", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_multi_draw_arrays */
-#ifdef GL_EXT_multisample
- CONST_CAST(GLEW_EXT_multisample) = _glewSearchExtension("GL_EXT_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_multisample */
-#ifdef GL_EXT_packed_depth_stencil
- CONST_CAST(GLEW_EXT_packed_depth_stencil) = _glewSearchExtension("GL_EXT_packed_depth_stencil", extStart, extEnd);
-#endif /* GL_EXT_packed_depth_stencil */
-#ifdef GL_EXT_packed_float
- CONST_CAST(GLEW_EXT_packed_float) = _glewSearchExtension("GL_EXT_packed_float", extStart, extEnd);
-#endif /* GL_EXT_packed_float */
-#ifdef GL_EXT_packed_pixels
- CONST_CAST(GLEW_EXT_packed_pixels) = _glewSearchExtension("GL_EXT_packed_pixels", extStart, extEnd);
-#endif /* GL_EXT_packed_pixels */
-#ifdef GL_EXT_paletted_texture
- CONST_CAST(GLEW_EXT_paletted_texture) = _glewSearchExtension("GL_EXT_paletted_texture", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_paletted_texture */
-#ifdef GL_EXT_pixel_buffer_object
- CONST_CAST(GLEW_EXT_pixel_buffer_object) = _glewSearchExtension("GL_EXT_pixel_buffer_object", extStart, extEnd);
-#endif /* GL_EXT_pixel_buffer_object */
-#ifdef GL_EXT_pixel_transform
- CONST_CAST(GLEW_EXT_pixel_transform) = _glewSearchExtension("GL_EXT_pixel_transform", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_pixel_transform */
-#ifdef GL_EXT_pixel_transform_color_table
- CONST_CAST(GLEW_EXT_pixel_transform_color_table) = _glewSearchExtension("GL_EXT_pixel_transform_color_table", extStart, extEnd);
-#endif /* GL_EXT_pixel_transform_color_table */
-#ifdef GL_EXT_point_parameters
- CONST_CAST(GLEW_EXT_point_parameters) = _glewSearchExtension("GL_EXT_point_parameters", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_point_parameters */
-#ifdef GL_EXT_polygon_offset
- CONST_CAST(GLEW_EXT_polygon_offset) = _glewSearchExtension("GL_EXT_polygon_offset", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_polygon_offset */
-#ifdef GL_EXT_provoking_vertex
- CONST_CAST(GLEW_EXT_provoking_vertex) = _glewSearchExtension("GL_EXT_provoking_vertex", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_provoking_vertex */
-#ifdef GL_EXT_rescale_normal
- CONST_CAST(GLEW_EXT_rescale_normal) = _glewSearchExtension("GL_EXT_rescale_normal", extStart, extEnd);
-#endif /* GL_EXT_rescale_normal */
-#ifdef GL_EXT_scene_marker
- CONST_CAST(GLEW_EXT_scene_marker) = _glewSearchExtension("GL_EXT_scene_marker", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_scene_marker */
-#ifdef GL_EXT_secondary_color
- CONST_CAST(GLEW_EXT_secondary_color) = _glewSearchExtension("GL_EXT_secondary_color", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_secondary_color */
-#ifdef GL_EXT_separate_shader_objects
- CONST_CAST(GLEW_EXT_separate_shader_objects) = _glewSearchExtension("GL_EXT_separate_shader_objects", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_separate_shader_objects */
-#ifdef GL_EXT_separate_specular_color
- CONST_CAST(GLEW_EXT_separate_specular_color) = _glewSearchExtension("GL_EXT_separate_specular_color", extStart, extEnd);
-#endif /* GL_EXT_separate_specular_color */
-#ifdef GL_EXT_shader_image_load_store
- CONST_CAST(GLEW_EXT_shader_image_load_store) = _glewSearchExtension("GL_EXT_shader_image_load_store", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_shader_image_load_store */
-#ifdef GL_EXT_shadow_funcs
- CONST_CAST(GLEW_EXT_shadow_funcs) = _glewSearchExtension("GL_EXT_shadow_funcs", extStart, extEnd);
-#endif /* GL_EXT_shadow_funcs */
-#ifdef GL_EXT_shared_texture_palette
- CONST_CAST(GLEW_EXT_shared_texture_palette) = _glewSearchExtension("GL_EXT_shared_texture_palette", extStart, extEnd);
-#endif /* GL_EXT_shared_texture_palette */
-#ifdef GL_EXT_stencil_clear_tag
- CONST_CAST(GLEW_EXT_stencil_clear_tag) = _glewSearchExtension("GL_EXT_stencil_clear_tag", extStart, extEnd);
-#endif /* GL_EXT_stencil_clear_tag */
-#ifdef GL_EXT_stencil_two_side
- CONST_CAST(GLEW_EXT_stencil_two_side) = _glewSearchExtension("GL_EXT_stencil_two_side", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_stencil_two_side */
-#ifdef GL_EXT_stencil_wrap
- CONST_CAST(GLEW_EXT_stencil_wrap) = _glewSearchExtension("GL_EXT_stencil_wrap", extStart, extEnd);
-#endif /* GL_EXT_stencil_wrap */
-#ifdef GL_EXT_subtexture
- CONST_CAST(GLEW_EXT_subtexture) = _glewSearchExtension("GL_EXT_subtexture", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_subtexture */
-#ifdef GL_EXT_texture
- CONST_CAST(GLEW_EXT_texture) = _glewSearchExtension("GL_EXT_texture", extStart, extEnd);
-#endif /* GL_EXT_texture */
-#ifdef GL_EXT_texture3D
- CONST_CAST(GLEW_EXT_texture3D) = _glewSearchExtension("GL_EXT_texture3D", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture3D */
-#ifdef GL_EXT_texture_array
- CONST_CAST(GLEW_EXT_texture_array) = _glewSearchExtension("GL_EXT_texture_array", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture_array) CONST_CAST(GLEW_EXT_texture_array) = !_glewInit_GL_EXT_texture_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture_array */
-#ifdef GL_EXT_texture_buffer_object
- CONST_CAST(GLEW_EXT_texture_buffer_object) = _glewSearchExtension("GL_EXT_texture_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture_buffer_object */
-#ifdef GL_EXT_texture_compression_dxt1
- CONST_CAST(GLEW_EXT_texture_compression_dxt1) = _glewSearchExtension("GL_EXT_texture_compression_dxt1", extStart, extEnd);
-#endif /* GL_EXT_texture_compression_dxt1 */
-#ifdef GL_EXT_texture_compression_latc
- CONST_CAST(GLEW_EXT_texture_compression_latc) = _glewSearchExtension("GL_EXT_texture_compression_latc", extStart, extEnd);
-#endif /* GL_EXT_texture_compression_latc */
-#ifdef GL_EXT_texture_compression_rgtc
- CONST_CAST(GLEW_EXT_texture_compression_rgtc) = _glewSearchExtension("GL_EXT_texture_compression_rgtc", extStart, extEnd);
-#endif /* GL_EXT_texture_compression_rgtc */
-#ifdef GL_EXT_texture_compression_s3tc
- CONST_CAST(GLEW_EXT_texture_compression_s3tc) = _glewSearchExtension("GL_EXT_texture_compression_s3tc", extStart, extEnd);
-#endif /* GL_EXT_texture_compression_s3tc */
-#ifdef GL_EXT_texture_cube_map
- CONST_CAST(GLEW_EXT_texture_cube_map) = _glewSearchExtension("GL_EXT_texture_cube_map", extStart, extEnd);
-#endif /* GL_EXT_texture_cube_map */
-#ifdef GL_EXT_texture_edge_clamp
- CONST_CAST(GLEW_EXT_texture_edge_clamp) = _glewSearchExtension("GL_EXT_texture_edge_clamp", extStart, extEnd);
-#endif /* GL_EXT_texture_edge_clamp */
-#ifdef GL_EXT_texture_env
- CONST_CAST(GLEW_EXT_texture_env) = _glewSearchExtension("GL_EXT_texture_env", extStart, extEnd);
-#endif /* GL_EXT_texture_env */
-#ifdef GL_EXT_texture_env_add
- CONST_CAST(GLEW_EXT_texture_env_add) = _glewSearchExtension("GL_EXT_texture_env_add", extStart, extEnd);
-#endif /* GL_EXT_texture_env_add */
-#ifdef GL_EXT_texture_env_combine
- CONST_CAST(GLEW_EXT_texture_env_combine) = _glewSearchExtension("GL_EXT_texture_env_combine", extStart, extEnd);
-#endif /* GL_EXT_texture_env_combine */
-#ifdef GL_EXT_texture_env_dot3
- CONST_CAST(GLEW_EXT_texture_env_dot3) = _glewSearchExtension("GL_EXT_texture_env_dot3", extStart, extEnd);
-#endif /* GL_EXT_texture_env_dot3 */
-#ifdef GL_EXT_texture_filter_anisotropic
- CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = _glewSearchExtension("GL_EXT_texture_filter_anisotropic", extStart, extEnd);
-#endif /* GL_EXT_texture_filter_anisotropic */
-#ifdef GL_EXT_texture_integer
- CONST_CAST(GLEW_EXT_texture_integer) = _glewSearchExtension("GL_EXT_texture_integer", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture_integer */
-#ifdef GL_EXT_texture_lod_bias
- CONST_CAST(GLEW_EXT_texture_lod_bias) = _glewSearchExtension("GL_EXT_texture_lod_bias", extStart, extEnd);
-#endif /* GL_EXT_texture_lod_bias */
-#ifdef GL_EXT_texture_mirror_clamp
- CONST_CAST(GLEW_EXT_texture_mirror_clamp) = _glewSearchExtension("GL_EXT_texture_mirror_clamp", extStart, extEnd);
-#endif /* GL_EXT_texture_mirror_clamp */
-#ifdef GL_EXT_texture_object
- CONST_CAST(GLEW_EXT_texture_object) = _glewSearchExtension("GL_EXT_texture_object", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture_object */
-#ifdef GL_EXT_texture_perturb_normal
- CONST_CAST(GLEW_EXT_texture_perturb_normal) = _glewSearchExtension("GL_EXT_texture_perturb_normal", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_texture_perturb_normal */
-#ifdef GL_EXT_texture_rectangle
- CONST_CAST(GLEW_EXT_texture_rectangle) = _glewSearchExtension("GL_EXT_texture_rectangle", extStart, extEnd);
-#endif /* GL_EXT_texture_rectangle */
-#ifdef GL_EXT_texture_sRGB
- CONST_CAST(GLEW_EXT_texture_sRGB) = _glewSearchExtension("GL_EXT_texture_sRGB", extStart, extEnd);
-#endif /* GL_EXT_texture_sRGB */
-#ifdef GL_EXT_texture_sRGB_decode
- CONST_CAST(GLEW_EXT_texture_sRGB_decode) = _glewSearchExtension("GL_EXT_texture_sRGB_decode", extStart, extEnd);
-#endif /* GL_EXT_texture_sRGB_decode */
-#ifdef GL_EXT_texture_shared_exponent
- CONST_CAST(GLEW_EXT_texture_shared_exponent) = _glewSearchExtension("GL_EXT_texture_shared_exponent", extStart, extEnd);
-#endif /* GL_EXT_texture_shared_exponent */
-#ifdef GL_EXT_texture_snorm
- CONST_CAST(GLEW_EXT_texture_snorm) = _glewSearchExtension("GL_EXT_texture_snorm", extStart, extEnd);
-#endif /* GL_EXT_texture_snorm */
-#ifdef GL_EXT_texture_swizzle
- CONST_CAST(GLEW_EXT_texture_swizzle) = _glewSearchExtension("GL_EXT_texture_swizzle", extStart, extEnd);
-#endif /* GL_EXT_texture_swizzle */
-#ifdef GL_EXT_timer_query
- CONST_CAST(GLEW_EXT_timer_query) = _glewSearchExtension("GL_EXT_timer_query", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_timer_query */
-#ifdef GL_EXT_transform_feedback
- CONST_CAST(GLEW_EXT_transform_feedback) = _glewSearchExtension("GL_EXT_transform_feedback", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_transform_feedback */
-#ifdef GL_EXT_vertex_array
- CONST_CAST(GLEW_EXT_vertex_array) = _glewSearchExtension("GL_EXT_vertex_array", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_vertex_array */
-#ifdef GL_EXT_vertex_array_bgra
- CONST_CAST(GLEW_EXT_vertex_array_bgra) = _glewSearchExtension("GL_EXT_vertex_array_bgra", extStart, extEnd);
-#endif /* GL_EXT_vertex_array_bgra */
-#ifdef GL_EXT_vertex_attrib_64bit
- CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = _glewSearchExtension("GL_EXT_vertex_attrib_64bit", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_vertex_attrib_64bit */
-#ifdef GL_EXT_vertex_shader
- CONST_CAST(GLEW_EXT_vertex_shader) = _glewSearchExtension("GL_EXT_vertex_shader", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_vertex_shader */
-#ifdef GL_EXT_vertex_weighting
- CONST_CAST(GLEW_EXT_vertex_weighting) = _glewSearchExtension("GL_EXT_vertex_weighting", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_vertex_weighting */
-#ifdef GL_EXT_x11_sync_object
- CONST_CAST(GLEW_EXT_x11_sync_object) = _glewSearchExtension("GL_EXT_x11_sync_object", extStart, extEnd);
- if (glewExperimental || GLEW_EXT_x11_sync_object) CONST_CAST(GLEW_EXT_x11_sync_object) = !_glewInit_GL_EXT_x11_sync_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_EXT_x11_sync_object */
-#ifdef GL_GREMEDY_frame_terminator
- CONST_CAST(GLEW_GREMEDY_frame_terminator) = _glewSearchExtension("GL_GREMEDY_frame_terminator", extStart, extEnd);
- if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_GREMEDY_frame_terminator */
-#ifdef GL_GREMEDY_string_marker
- CONST_CAST(GLEW_GREMEDY_string_marker) = _glewSearchExtension("GL_GREMEDY_string_marker", extStart, extEnd);
- if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_GREMEDY_string_marker */
-#ifdef GL_HP_convolution_border_modes
- CONST_CAST(GLEW_HP_convolution_border_modes) = _glewSearchExtension("GL_HP_convolution_border_modes", extStart, extEnd);
-#endif /* GL_HP_convolution_border_modes */
-#ifdef GL_HP_image_transform
- CONST_CAST(GLEW_HP_image_transform) = _glewSearchExtension("GL_HP_image_transform", extStart, extEnd);
- if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_HP_image_transform */
-#ifdef GL_HP_occlusion_test
- CONST_CAST(GLEW_HP_occlusion_test) = _glewSearchExtension("GL_HP_occlusion_test", extStart, extEnd);
-#endif /* GL_HP_occlusion_test */
-#ifdef GL_HP_texture_lighting
- CONST_CAST(GLEW_HP_texture_lighting) = _glewSearchExtension("GL_HP_texture_lighting", extStart, extEnd);
-#endif /* GL_HP_texture_lighting */
-#ifdef GL_IBM_cull_vertex
- CONST_CAST(GLEW_IBM_cull_vertex) = _glewSearchExtension("GL_IBM_cull_vertex", extStart, extEnd);
-#endif /* GL_IBM_cull_vertex */
-#ifdef GL_IBM_multimode_draw_arrays
- CONST_CAST(GLEW_IBM_multimode_draw_arrays) = _glewSearchExtension("GL_IBM_multimode_draw_arrays", extStart, extEnd);
- if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_IBM_multimode_draw_arrays */
-#ifdef GL_IBM_rasterpos_clip
- CONST_CAST(GLEW_IBM_rasterpos_clip) = _glewSearchExtension("GL_IBM_rasterpos_clip", extStart, extEnd);
-#endif /* GL_IBM_rasterpos_clip */
-#ifdef GL_IBM_static_data
- CONST_CAST(GLEW_IBM_static_data) = _glewSearchExtension("GL_IBM_static_data", extStart, extEnd);
-#endif /* GL_IBM_static_data */
-#ifdef GL_IBM_texture_mirrored_repeat
- CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = _glewSearchExtension("GL_IBM_texture_mirrored_repeat", extStart, extEnd);
-#endif /* GL_IBM_texture_mirrored_repeat */
-#ifdef GL_IBM_vertex_array_lists
- CONST_CAST(GLEW_IBM_vertex_array_lists) = _glewSearchExtension("GL_IBM_vertex_array_lists", extStart, extEnd);
- if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_IBM_vertex_array_lists */
-#ifdef GL_INGR_color_clamp
- CONST_CAST(GLEW_INGR_color_clamp) = _glewSearchExtension("GL_INGR_color_clamp", extStart, extEnd);
-#endif /* GL_INGR_color_clamp */
-#ifdef GL_INGR_interlace_read
- CONST_CAST(GLEW_INGR_interlace_read) = _glewSearchExtension("GL_INGR_interlace_read", extStart, extEnd);
-#endif /* GL_INGR_interlace_read */
-#ifdef GL_INTEL_map_texture
- CONST_CAST(GLEW_INTEL_map_texture) = _glewSearchExtension("GL_INTEL_map_texture", extStart, extEnd);
- if (glewExperimental || GLEW_INTEL_map_texture) CONST_CAST(GLEW_INTEL_map_texture) = !_glewInit_GL_INTEL_map_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_INTEL_map_texture */
-#ifdef GL_INTEL_parallel_arrays
- CONST_CAST(GLEW_INTEL_parallel_arrays) = _glewSearchExtension("GL_INTEL_parallel_arrays", extStart, extEnd);
- if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_INTEL_parallel_arrays */
-#ifdef GL_INTEL_texture_scissor
- CONST_CAST(GLEW_INTEL_texture_scissor) = _glewSearchExtension("GL_INTEL_texture_scissor", extStart, extEnd);
- if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_INTEL_texture_scissor */
-#ifdef GL_KHR_debug
- CONST_CAST(GLEW_KHR_debug) = _glewSearchExtension("GL_KHR_debug", extStart, extEnd);
- if (glewExperimental || GLEW_KHR_debug) CONST_CAST(GLEW_KHR_debug) = !_glewInit_GL_KHR_debug(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_KHR_debug */
-#ifdef GL_KHR_texture_compression_astc_ldr
- CONST_CAST(GLEW_KHR_texture_compression_astc_ldr) = _glewSearchExtension("GL_KHR_texture_compression_astc_ldr", extStart, extEnd);
-#endif /* GL_KHR_texture_compression_astc_ldr */
-#ifdef GL_KTX_buffer_region
- CONST_CAST(GLEW_KTX_buffer_region) = _glewSearchExtension("GL_KTX_buffer_region", extStart, extEnd);
- if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_KTX_buffer_region */
-#ifdef GL_MESAX_texture_stack
- CONST_CAST(GLEW_MESAX_texture_stack) = _glewSearchExtension("GL_MESAX_texture_stack", extStart, extEnd);
-#endif /* GL_MESAX_texture_stack */
-#ifdef GL_MESA_pack_invert
- CONST_CAST(GLEW_MESA_pack_invert) = _glewSearchExtension("GL_MESA_pack_invert", extStart, extEnd);
-#endif /* GL_MESA_pack_invert */
-#ifdef GL_MESA_resize_buffers
- CONST_CAST(GLEW_MESA_resize_buffers) = _glewSearchExtension("GL_MESA_resize_buffers", extStart, extEnd);
- if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_MESA_resize_buffers */
-#ifdef GL_MESA_window_pos
- CONST_CAST(GLEW_MESA_window_pos) = _glewSearchExtension("GL_MESA_window_pos", extStart, extEnd);
- if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_MESA_window_pos */
-#ifdef GL_MESA_ycbcr_texture
- CONST_CAST(GLEW_MESA_ycbcr_texture) = _glewSearchExtension("GL_MESA_ycbcr_texture", extStart, extEnd);
-#endif /* GL_MESA_ycbcr_texture */
-#ifdef GL_NVX_conditional_render
- CONST_CAST(GLEW_NVX_conditional_render) = _glewSearchExtension("GL_NVX_conditional_render", extStart, extEnd);
- if (glewExperimental || GLEW_NVX_conditional_render) CONST_CAST(GLEW_NVX_conditional_render) = !_glewInit_GL_NVX_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NVX_conditional_render */
-#ifdef GL_NVX_gpu_memory_info
- CONST_CAST(GLEW_NVX_gpu_memory_info) = _glewSearchExtension("GL_NVX_gpu_memory_info", extStart, extEnd);
-#endif /* GL_NVX_gpu_memory_info */
-#ifdef GL_NV_bindless_multi_draw_indirect
- CONST_CAST(GLEW_NV_bindless_multi_draw_indirect) = _glewSearchExtension("GL_NV_bindless_multi_draw_indirect", extStart, extEnd);
- if (glewExperimental || GLEW_NV_bindless_multi_draw_indirect) CONST_CAST(GLEW_NV_bindless_multi_draw_indirect) = !_glewInit_GL_NV_bindless_multi_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_bindless_multi_draw_indirect */
-#ifdef GL_NV_bindless_texture
- CONST_CAST(GLEW_NV_bindless_texture) = _glewSearchExtension("GL_NV_bindless_texture", extStart, extEnd);
- if (glewExperimental || GLEW_NV_bindless_texture) CONST_CAST(GLEW_NV_bindless_texture) = !_glewInit_GL_NV_bindless_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_bindless_texture */
-#ifdef GL_NV_blend_equation_advanced
- CONST_CAST(GLEW_NV_blend_equation_advanced) = _glewSearchExtension("GL_NV_blend_equation_advanced", extStart, extEnd);
- if (glewExperimental || GLEW_NV_blend_equation_advanced) CONST_CAST(GLEW_NV_blend_equation_advanced) = !_glewInit_GL_NV_blend_equation_advanced(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_blend_equation_advanced */
-#ifdef GL_NV_blend_equation_advanced_coherent
- CONST_CAST(GLEW_NV_blend_equation_advanced_coherent) = _glewSearchExtension("GL_NV_blend_equation_advanced_coherent", extStart, extEnd);
-#endif /* GL_NV_blend_equation_advanced_coherent */
-#ifdef GL_NV_blend_square
- CONST_CAST(GLEW_NV_blend_square) = _glewSearchExtension("GL_NV_blend_square", extStart, extEnd);
-#endif /* GL_NV_blend_square */
-#ifdef GL_NV_compute_program5
- CONST_CAST(GLEW_NV_compute_program5) = _glewSearchExtension("GL_NV_compute_program5", extStart, extEnd);
-#endif /* GL_NV_compute_program5 */
-#ifdef GL_NV_conditional_render
- CONST_CAST(GLEW_NV_conditional_render) = _glewSearchExtension("GL_NV_conditional_render", extStart, extEnd);
- if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_conditional_render */
-#ifdef GL_NV_copy_depth_to_color
- CONST_CAST(GLEW_NV_copy_depth_to_color) = _glewSearchExtension("GL_NV_copy_depth_to_color", extStart, extEnd);
-#endif /* GL_NV_copy_depth_to_color */
-#ifdef GL_NV_copy_image
- CONST_CAST(GLEW_NV_copy_image) = _glewSearchExtension("GL_NV_copy_image", extStart, extEnd);
- if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_copy_image */
-#ifdef GL_NV_deep_texture3D
- CONST_CAST(GLEW_NV_deep_texture3D) = _glewSearchExtension("GL_NV_deep_texture3D", extStart, extEnd);
-#endif /* GL_NV_deep_texture3D */
-#ifdef GL_NV_depth_buffer_float
- CONST_CAST(GLEW_NV_depth_buffer_float) = _glewSearchExtension("GL_NV_depth_buffer_float", extStart, extEnd);
- if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_depth_buffer_float */
-#ifdef GL_NV_depth_clamp
- CONST_CAST(GLEW_NV_depth_clamp) = _glewSearchExtension("GL_NV_depth_clamp", extStart, extEnd);
-#endif /* GL_NV_depth_clamp */
-#ifdef GL_NV_depth_range_unclamped
- CONST_CAST(GLEW_NV_depth_range_unclamped) = _glewSearchExtension("GL_NV_depth_range_unclamped", extStart, extEnd);
-#endif /* GL_NV_depth_range_unclamped */
-#ifdef GL_NV_draw_texture
- CONST_CAST(GLEW_NV_draw_texture) = _glewSearchExtension("GL_NV_draw_texture", extStart, extEnd);
- if (glewExperimental || GLEW_NV_draw_texture) CONST_CAST(GLEW_NV_draw_texture) = !_glewInit_GL_NV_draw_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_draw_texture */
-#ifdef GL_NV_evaluators
- CONST_CAST(GLEW_NV_evaluators) = _glewSearchExtension("GL_NV_evaluators", extStart, extEnd);
- if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_evaluators */
-#ifdef GL_NV_explicit_multisample
- CONST_CAST(GLEW_NV_explicit_multisample) = _glewSearchExtension("GL_NV_explicit_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_explicit_multisample */
-#ifdef GL_NV_fence
- CONST_CAST(GLEW_NV_fence) = _glewSearchExtension("GL_NV_fence", extStart, extEnd);
- if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_fence */
-#ifdef GL_NV_float_buffer
- CONST_CAST(GLEW_NV_float_buffer) = _glewSearchExtension("GL_NV_float_buffer", extStart, extEnd);
-#endif /* GL_NV_float_buffer */
-#ifdef GL_NV_fog_distance
- CONST_CAST(GLEW_NV_fog_distance) = _glewSearchExtension("GL_NV_fog_distance", extStart, extEnd);
-#endif /* GL_NV_fog_distance */
-#ifdef GL_NV_fragment_program
- CONST_CAST(GLEW_NV_fragment_program) = _glewSearchExtension("GL_NV_fragment_program", extStart, extEnd);
- if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_fragment_program */
-#ifdef GL_NV_fragment_program2
- CONST_CAST(GLEW_NV_fragment_program2) = _glewSearchExtension("GL_NV_fragment_program2", extStart, extEnd);
-#endif /* GL_NV_fragment_program2 */
-#ifdef GL_NV_fragment_program4
- CONST_CAST(GLEW_NV_fragment_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd);
-#endif /* GL_NV_fragment_program4 */
-#ifdef GL_NV_fragment_program_option
- CONST_CAST(GLEW_NV_fragment_program_option) = _glewSearchExtension("GL_NV_fragment_program_option", extStart, extEnd);
-#endif /* GL_NV_fragment_program_option */
-#ifdef GL_NV_framebuffer_multisample_coverage
- CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = _glewSearchExtension("GL_NV_framebuffer_multisample_coverage", extStart, extEnd);
- if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_framebuffer_multisample_coverage */
-#ifdef GL_NV_geometry_program4
- CONST_CAST(GLEW_NV_geometry_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd);
- if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_geometry_program4 */
-#ifdef GL_NV_geometry_shader4
- CONST_CAST(GLEW_NV_geometry_shader4) = _glewSearchExtension("GL_NV_geometry_shader4", extStart, extEnd);
-#endif /* GL_NV_geometry_shader4 */
-#ifdef GL_NV_gpu_program4
- CONST_CAST(GLEW_NV_gpu_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd);
- if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_gpu_program4 */
-#ifdef GL_NV_gpu_program5
- CONST_CAST(GLEW_NV_gpu_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd);
-#endif /* GL_NV_gpu_program5 */
-#ifdef GL_NV_gpu_program5_mem_extended
- CONST_CAST(GLEW_NV_gpu_program5_mem_extended) = _glewSearchExtension("GL_NV_gpu_program5_mem_extended", extStart, extEnd);
-#endif /* GL_NV_gpu_program5_mem_extended */
-#ifdef GL_NV_gpu_program_fp64
- CONST_CAST(GLEW_NV_gpu_program_fp64) = _glewSearchExtension("GL_NV_gpu_program_fp64", extStart, extEnd);
-#endif /* GL_NV_gpu_program_fp64 */
-#ifdef GL_NV_gpu_shader5
- CONST_CAST(GLEW_NV_gpu_shader5) = _glewSearchExtension("GL_NV_gpu_shader5", extStart, extEnd);
- if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_gpu_shader5 */
-#ifdef GL_NV_half_float
- CONST_CAST(GLEW_NV_half_float) = _glewSearchExtension("GL_NV_half_float", extStart, extEnd);
- if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_half_float */
-#ifdef GL_NV_light_max_exponent
- CONST_CAST(GLEW_NV_light_max_exponent) = _glewSearchExtension("GL_NV_light_max_exponent", extStart, extEnd);
-#endif /* GL_NV_light_max_exponent */
-#ifdef GL_NV_multisample_coverage
- CONST_CAST(GLEW_NV_multisample_coverage) = _glewSearchExtension("GL_NV_multisample_coverage", extStart, extEnd);
-#endif /* GL_NV_multisample_coverage */
-#ifdef GL_NV_multisample_filter_hint
- CONST_CAST(GLEW_NV_multisample_filter_hint) = _glewSearchExtension("GL_NV_multisample_filter_hint", extStart, extEnd);
-#endif /* GL_NV_multisample_filter_hint */
-#ifdef GL_NV_occlusion_query
- CONST_CAST(GLEW_NV_occlusion_query) = _glewSearchExtension("GL_NV_occlusion_query", extStart, extEnd);
- if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_occlusion_query */
-#ifdef GL_NV_packed_depth_stencil
- CONST_CAST(GLEW_NV_packed_depth_stencil) = _glewSearchExtension("GL_NV_packed_depth_stencil", extStart, extEnd);
-#endif /* GL_NV_packed_depth_stencil */
-#ifdef GL_NV_parameter_buffer_object
- CONST_CAST(GLEW_NV_parameter_buffer_object) = _glewSearchExtension("GL_NV_parameter_buffer_object", extStart, extEnd);
- if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_parameter_buffer_object */
-#ifdef GL_NV_parameter_buffer_object2
- CONST_CAST(GLEW_NV_parameter_buffer_object2) = _glewSearchExtension("GL_NV_parameter_buffer_object2", extStart, extEnd);
-#endif /* GL_NV_parameter_buffer_object2 */
-#ifdef GL_NV_path_rendering
- CONST_CAST(GLEW_NV_path_rendering) = _glewSearchExtension("GL_NV_path_rendering", extStart, extEnd);
- if (glewExperimental || GLEW_NV_path_rendering) CONST_CAST(GLEW_NV_path_rendering) = !_glewInit_GL_NV_path_rendering(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_path_rendering */
-#ifdef GL_NV_pixel_data_range
- CONST_CAST(GLEW_NV_pixel_data_range) = _glewSearchExtension("GL_NV_pixel_data_range", extStart, extEnd);
- if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_pixel_data_range */
-#ifdef GL_NV_point_sprite
- CONST_CAST(GLEW_NV_point_sprite) = _glewSearchExtension("GL_NV_point_sprite", extStart, extEnd);
- if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_point_sprite */
-#ifdef GL_NV_present_video
- CONST_CAST(GLEW_NV_present_video) = _glewSearchExtension("GL_NV_present_video", extStart, extEnd);
- if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_present_video */
-#ifdef GL_NV_primitive_restart
- CONST_CAST(GLEW_NV_primitive_restart) = _glewSearchExtension("GL_NV_primitive_restart", extStart, extEnd);
- if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_primitive_restart */
-#ifdef GL_NV_register_combiners
- CONST_CAST(GLEW_NV_register_combiners) = _glewSearchExtension("GL_NV_register_combiners", extStart, extEnd);
- if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_register_combiners */
-#ifdef GL_NV_register_combiners2
- CONST_CAST(GLEW_NV_register_combiners2) = _glewSearchExtension("GL_NV_register_combiners2", extStart, extEnd);
- if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_register_combiners2 */
-#ifdef GL_NV_shader_atomic_counters
- CONST_CAST(GLEW_NV_shader_atomic_counters) = _glewSearchExtension("GL_NV_shader_atomic_counters", extStart, extEnd);
-#endif /* GL_NV_shader_atomic_counters */
-#ifdef GL_NV_shader_atomic_float
- CONST_CAST(GLEW_NV_shader_atomic_float) = _glewSearchExtension("GL_NV_shader_atomic_float", extStart, extEnd);
-#endif /* GL_NV_shader_atomic_float */
-#ifdef GL_NV_shader_buffer_load
- CONST_CAST(GLEW_NV_shader_buffer_load) = _glewSearchExtension("GL_NV_shader_buffer_load", extStart, extEnd);
- if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_shader_buffer_load */
-#ifdef GL_NV_shader_storage_buffer_object
- CONST_CAST(GLEW_NV_shader_storage_buffer_object) = _glewSearchExtension("GL_NV_shader_storage_buffer_object", extStart, extEnd);
-#endif /* GL_NV_shader_storage_buffer_object */
-#ifdef GL_NV_tessellation_program5
- CONST_CAST(GLEW_NV_tessellation_program5) = _glewSearchExtension("GL_NV_gpu_program5", extStart, extEnd);
-#endif /* GL_NV_tessellation_program5 */
-#ifdef GL_NV_texgen_emboss
- CONST_CAST(GLEW_NV_texgen_emboss) = _glewSearchExtension("GL_NV_texgen_emboss", extStart, extEnd);
-#endif /* GL_NV_texgen_emboss */
-#ifdef GL_NV_texgen_reflection
- CONST_CAST(GLEW_NV_texgen_reflection) = _glewSearchExtension("GL_NV_texgen_reflection", extStart, extEnd);
-#endif /* GL_NV_texgen_reflection */
-#ifdef GL_NV_texture_barrier
- CONST_CAST(GLEW_NV_texture_barrier) = _glewSearchExtension("GL_NV_texture_barrier", extStart, extEnd);
- if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_texture_barrier */
-#ifdef GL_NV_texture_compression_vtc
- CONST_CAST(GLEW_NV_texture_compression_vtc) = _glewSearchExtension("GL_NV_texture_compression_vtc", extStart, extEnd);
-#endif /* GL_NV_texture_compression_vtc */
-#ifdef GL_NV_texture_env_combine4
- CONST_CAST(GLEW_NV_texture_env_combine4) = _glewSearchExtension("GL_NV_texture_env_combine4", extStart, extEnd);
-#endif /* GL_NV_texture_env_combine4 */
-#ifdef GL_NV_texture_expand_normal
- CONST_CAST(GLEW_NV_texture_expand_normal) = _glewSearchExtension("GL_NV_texture_expand_normal", extStart, extEnd);
-#endif /* GL_NV_texture_expand_normal */
-#ifdef GL_NV_texture_multisample
- CONST_CAST(GLEW_NV_texture_multisample) = _glewSearchExtension("GL_NV_texture_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_NV_texture_multisample) CONST_CAST(GLEW_NV_texture_multisample) = !_glewInit_GL_NV_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_texture_multisample */
-#ifdef GL_NV_texture_rectangle
- CONST_CAST(GLEW_NV_texture_rectangle) = _glewSearchExtension("GL_NV_texture_rectangle", extStart, extEnd);
-#endif /* GL_NV_texture_rectangle */
-#ifdef GL_NV_texture_shader
- CONST_CAST(GLEW_NV_texture_shader) = _glewSearchExtension("GL_NV_texture_shader", extStart, extEnd);
-#endif /* GL_NV_texture_shader */
-#ifdef GL_NV_texture_shader2
- CONST_CAST(GLEW_NV_texture_shader2) = _glewSearchExtension("GL_NV_texture_shader2", extStart, extEnd);
-#endif /* GL_NV_texture_shader2 */
-#ifdef GL_NV_texture_shader3
- CONST_CAST(GLEW_NV_texture_shader3) = _glewSearchExtension("GL_NV_texture_shader3", extStart, extEnd);
-#endif /* GL_NV_texture_shader3 */
-#ifdef GL_NV_transform_feedback
- CONST_CAST(GLEW_NV_transform_feedback) = _glewSearchExtension("GL_NV_transform_feedback", extStart, extEnd);
- if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_transform_feedback */
-#ifdef GL_NV_transform_feedback2
- CONST_CAST(GLEW_NV_transform_feedback2) = _glewSearchExtension("GL_NV_transform_feedback2", extStart, extEnd);
- if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_transform_feedback2 */
-#ifdef GL_NV_vdpau_interop
- CONST_CAST(GLEW_NV_vdpau_interop) = _glewSearchExtension("GL_NV_vdpau_interop", extStart, extEnd);
- if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_vdpau_interop */
-#ifdef GL_NV_vertex_array_range
- CONST_CAST(GLEW_NV_vertex_array_range) = _glewSearchExtension("GL_NV_vertex_array_range", extStart, extEnd);
- if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_vertex_array_range */
-#ifdef GL_NV_vertex_array_range2
- CONST_CAST(GLEW_NV_vertex_array_range2) = _glewSearchExtension("GL_NV_vertex_array_range2", extStart, extEnd);
-#endif /* GL_NV_vertex_array_range2 */
-#ifdef GL_NV_vertex_attrib_integer_64bit
- CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = _glewSearchExtension("GL_NV_vertex_attrib_integer_64bit", extStart, extEnd);
- if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_vertex_attrib_integer_64bit */
-#ifdef GL_NV_vertex_buffer_unified_memory
- CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = _glewSearchExtension("GL_NV_vertex_buffer_unified_memory", extStart, extEnd);
- if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_vertex_buffer_unified_memory */
-#ifdef GL_NV_vertex_program
- CONST_CAST(GLEW_NV_vertex_program) = _glewSearchExtension("GL_NV_vertex_program", extStart, extEnd);
- if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_vertex_program */
-#ifdef GL_NV_vertex_program1_1
- CONST_CAST(GLEW_NV_vertex_program1_1) = _glewSearchExtension("GL_NV_vertex_program1_1", extStart, extEnd);
-#endif /* GL_NV_vertex_program1_1 */
-#ifdef GL_NV_vertex_program2
- CONST_CAST(GLEW_NV_vertex_program2) = _glewSearchExtension("GL_NV_vertex_program2", extStart, extEnd);
-#endif /* GL_NV_vertex_program2 */
-#ifdef GL_NV_vertex_program2_option
- CONST_CAST(GLEW_NV_vertex_program2_option) = _glewSearchExtension("GL_NV_vertex_program2_option", extStart, extEnd);
-#endif /* GL_NV_vertex_program2_option */
-#ifdef GL_NV_vertex_program3
- CONST_CAST(GLEW_NV_vertex_program3) = _glewSearchExtension("GL_NV_vertex_program3", extStart, extEnd);
-#endif /* GL_NV_vertex_program3 */
-#ifdef GL_NV_vertex_program4
- CONST_CAST(GLEW_NV_vertex_program4) = _glewSearchExtension("GL_NV_gpu_program4", extStart, extEnd);
-#endif /* GL_NV_vertex_program4 */
-#ifdef GL_NV_video_capture
- CONST_CAST(GLEW_NV_video_capture) = _glewSearchExtension("GL_NV_video_capture", extStart, extEnd);
- if (glewExperimental || GLEW_NV_video_capture) CONST_CAST(GLEW_NV_video_capture) = !_glewInit_GL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_NV_video_capture */
-#ifdef GL_OES_byte_coordinates
- CONST_CAST(GLEW_OES_byte_coordinates) = _glewSearchExtension("GL_OES_byte_coordinates", extStart, extEnd);
-#endif /* GL_OES_byte_coordinates */
-#ifdef GL_OES_compressed_paletted_texture
- CONST_CAST(GLEW_OES_compressed_paletted_texture) = _glewSearchExtension("GL_OES_compressed_paletted_texture", extStart, extEnd);
-#endif /* GL_OES_compressed_paletted_texture */
-#ifdef GL_OES_read_format
- CONST_CAST(GLEW_OES_read_format) = _glewSearchExtension("GL_OES_read_format", extStart, extEnd);
-#endif /* GL_OES_read_format */
-#ifdef GL_OES_single_precision
- CONST_CAST(GLEW_OES_single_precision) = _glewSearchExtension("GL_OES_single_precision", extStart, extEnd);
- if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_OES_single_precision */
-#ifdef GL_OML_interlace
- CONST_CAST(GLEW_OML_interlace) = _glewSearchExtension("GL_OML_interlace", extStart, extEnd);
-#endif /* GL_OML_interlace */
-#ifdef GL_OML_resample
- CONST_CAST(GLEW_OML_resample) = _glewSearchExtension("GL_OML_resample", extStart, extEnd);
-#endif /* GL_OML_resample */
-#ifdef GL_OML_subsample
- CONST_CAST(GLEW_OML_subsample) = _glewSearchExtension("GL_OML_subsample", extStart, extEnd);
-#endif /* GL_OML_subsample */
-#ifdef GL_PGI_misc_hints
- CONST_CAST(GLEW_PGI_misc_hints) = _glewSearchExtension("GL_PGI_misc_hints", extStart, extEnd);
-#endif /* GL_PGI_misc_hints */
-#ifdef GL_PGI_vertex_hints
- CONST_CAST(GLEW_PGI_vertex_hints) = _glewSearchExtension("GL_PGI_vertex_hints", extStart, extEnd);
-#endif /* GL_PGI_vertex_hints */
-#ifdef GL_REGAL_ES1_0_compatibility
- CONST_CAST(GLEW_REGAL_ES1_0_compatibility) = _glewSearchExtension("GL_REGAL_ES1_0_compatibility", extStart, extEnd);
- if (glewExperimental || GLEW_REGAL_ES1_0_compatibility) CONST_CAST(GLEW_REGAL_ES1_0_compatibility) = !_glewInit_GL_REGAL_ES1_0_compatibility(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_REGAL_ES1_0_compatibility */
-#ifdef GL_REGAL_ES1_1_compatibility
- CONST_CAST(GLEW_REGAL_ES1_1_compatibility) = _glewSearchExtension("GL_REGAL_ES1_1_compatibility", extStart, extEnd);
- if (glewExperimental || GLEW_REGAL_ES1_1_compatibility) CONST_CAST(GLEW_REGAL_ES1_1_compatibility) = !_glewInit_GL_REGAL_ES1_1_compatibility(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_REGAL_ES1_1_compatibility */
-#ifdef GL_REGAL_enable
- CONST_CAST(GLEW_REGAL_enable) = _glewSearchExtension("GL_REGAL_enable", extStart, extEnd);
-#endif /* GL_REGAL_enable */
-#ifdef GL_REGAL_error_string
- CONST_CAST(GLEW_REGAL_error_string) = _glewSearchExtension("GL_REGAL_error_string", extStart, extEnd);
- if (glewExperimental || GLEW_REGAL_error_string) CONST_CAST(GLEW_REGAL_error_string) = !_glewInit_GL_REGAL_error_string(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_REGAL_error_string */
-#ifdef GL_REGAL_extension_query
- CONST_CAST(GLEW_REGAL_extension_query) = _glewSearchExtension("GL_REGAL_extension_query", extStart, extEnd);
- if (glewExperimental || GLEW_REGAL_extension_query) CONST_CAST(GLEW_REGAL_extension_query) = !_glewInit_GL_REGAL_extension_query(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_REGAL_extension_query */
-#ifdef GL_REGAL_log
- CONST_CAST(GLEW_REGAL_log) = _glewSearchExtension("GL_REGAL_log", extStart, extEnd);
- if (glewExperimental || GLEW_REGAL_log) CONST_CAST(GLEW_REGAL_log) = !_glewInit_GL_REGAL_log(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_REGAL_log */
-#ifdef GL_REND_screen_coordinates
- CONST_CAST(GLEW_REND_screen_coordinates) = _glewSearchExtension("GL_REND_screen_coordinates", extStart, extEnd);
-#endif /* GL_REND_screen_coordinates */
-#ifdef GL_S3_s3tc
- CONST_CAST(GLEW_S3_s3tc) = _glewSearchExtension("GL_S3_s3tc", extStart, extEnd);
-#endif /* GL_S3_s3tc */
-#ifdef GL_SGIS_color_range
- CONST_CAST(GLEW_SGIS_color_range) = _glewSearchExtension("GL_SGIS_color_range", extStart, extEnd);
-#endif /* GL_SGIS_color_range */
-#ifdef GL_SGIS_detail_texture
- CONST_CAST(GLEW_SGIS_detail_texture) = _glewSearchExtension("GL_SGIS_detail_texture", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_detail_texture */
-#ifdef GL_SGIS_fog_function
- CONST_CAST(GLEW_SGIS_fog_function) = _glewSearchExtension("GL_SGIS_fog_function", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_fog_function */
-#ifdef GL_SGIS_generate_mipmap
- CONST_CAST(GLEW_SGIS_generate_mipmap) = _glewSearchExtension("GL_SGIS_generate_mipmap", extStart, extEnd);
-#endif /* GL_SGIS_generate_mipmap */
-#ifdef GL_SGIS_multisample
- CONST_CAST(GLEW_SGIS_multisample) = _glewSearchExtension("GL_SGIS_multisample", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_multisample */
-#ifdef GL_SGIS_pixel_texture
- CONST_CAST(GLEW_SGIS_pixel_texture) = _glewSearchExtension("GL_SGIS_pixel_texture", extStart, extEnd);
-#endif /* GL_SGIS_pixel_texture */
-#ifdef GL_SGIS_point_line_texgen
- CONST_CAST(GLEW_SGIS_point_line_texgen) = _glewSearchExtension("GL_SGIS_point_line_texgen", extStart, extEnd);
-#endif /* GL_SGIS_point_line_texgen */
-#ifdef GL_SGIS_sharpen_texture
- CONST_CAST(GLEW_SGIS_sharpen_texture) = _glewSearchExtension("GL_SGIS_sharpen_texture", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_sharpen_texture */
-#ifdef GL_SGIS_texture4D
- CONST_CAST(GLEW_SGIS_texture4D) = _glewSearchExtension("GL_SGIS_texture4D", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_texture4D */
-#ifdef GL_SGIS_texture_border_clamp
- CONST_CAST(GLEW_SGIS_texture_border_clamp) = _glewSearchExtension("GL_SGIS_texture_border_clamp", extStart, extEnd);
-#endif /* GL_SGIS_texture_border_clamp */
-#ifdef GL_SGIS_texture_edge_clamp
- CONST_CAST(GLEW_SGIS_texture_edge_clamp) = _glewSearchExtension("GL_SGIS_texture_edge_clamp", extStart, extEnd);
-#endif /* GL_SGIS_texture_edge_clamp */
-#ifdef GL_SGIS_texture_filter4
- CONST_CAST(GLEW_SGIS_texture_filter4) = _glewSearchExtension("GL_SGIS_texture_filter4", extStart, extEnd);
- if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIS_texture_filter4 */
-#ifdef GL_SGIS_texture_lod
- CONST_CAST(GLEW_SGIS_texture_lod) = _glewSearchExtension("GL_SGIS_texture_lod", extStart, extEnd);
-#endif /* GL_SGIS_texture_lod */
-#ifdef GL_SGIS_texture_select
- CONST_CAST(GLEW_SGIS_texture_select) = _glewSearchExtension("GL_SGIS_texture_select", extStart, extEnd);
-#endif /* GL_SGIS_texture_select */
-#ifdef GL_SGIX_async
- CONST_CAST(GLEW_SGIX_async) = _glewSearchExtension("GL_SGIX_async", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_async */
-#ifdef GL_SGIX_async_histogram
- CONST_CAST(GLEW_SGIX_async_histogram) = _glewSearchExtension("GL_SGIX_async_histogram", extStart, extEnd);
-#endif /* GL_SGIX_async_histogram */
-#ifdef GL_SGIX_async_pixel
- CONST_CAST(GLEW_SGIX_async_pixel) = _glewSearchExtension("GL_SGIX_async_pixel", extStart, extEnd);
-#endif /* GL_SGIX_async_pixel */
-#ifdef GL_SGIX_blend_alpha_minmax
- CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = _glewSearchExtension("GL_SGIX_blend_alpha_minmax", extStart, extEnd);
-#endif /* GL_SGIX_blend_alpha_minmax */
-#ifdef GL_SGIX_clipmap
- CONST_CAST(GLEW_SGIX_clipmap) = _glewSearchExtension("GL_SGIX_clipmap", extStart, extEnd);
-#endif /* GL_SGIX_clipmap */
-#ifdef GL_SGIX_convolution_accuracy
- CONST_CAST(GLEW_SGIX_convolution_accuracy) = _glewSearchExtension("GL_SGIX_convolution_accuracy", extStart, extEnd);
-#endif /* GL_SGIX_convolution_accuracy */
-#ifdef GL_SGIX_depth_texture
- CONST_CAST(GLEW_SGIX_depth_texture) = _glewSearchExtension("GL_SGIX_depth_texture", extStart, extEnd);
-#endif /* GL_SGIX_depth_texture */
-#ifdef GL_SGIX_flush_raster
- CONST_CAST(GLEW_SGIX_flush_raster) = _glewSearchExtension("GL_SGIX_flush_raster", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_flush_raster */
-#ifdef GL_SGIX_fog_offset
- CONST_CAST(GLEW_SGIX_fog_offset) = _glewSearchExtension("GL_SGIX_fog_offset", extStart, extEnd);
-#endif /* GL_SGIX_fog_offset */
-#ifdef GL_SGIX_fog_texture
- CONST_CAST(GLEW_SGIX_fog_texture) = _glewSearchExtension("GL_SGIX_fog_texture", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_fog_texture */
-#ifdef GL_SGIX_fragment_specular_lighting
- CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = _glewSearchExtension("GL_SGIX_fragment_specular_lighting", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_fragment_specular_lighting */
-#ifdef GL_SGIX_framezoom
- CONST_CAST(GLEW_SGIX_framezoom) = _glewSearchExtension("GL_SGIX_framezoom", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_framezoom */
-#ifdef GL_SGIX_interlace
- CONST_CAST(GLEW_SGIX_interlace) = _glewSearchExtension("GL_SGIX_interlace", extStart, extEnd);
-#endif /* GL_SGIX_interlace */
-#ifdef GL_SGIX_ir_instrument1
- CONST_CAST(GLEW_SGIX_ir_instrument1) = _glewSearchExtension("GL_SGIX_ir_instrument1", extStart, extEnd);
-#endif /* GL_SGIX_ir_instrument1 */
-#ifdef GL_SGIX_list_priority
- CONST_CAST(GLEW_SGIX_list_priority) = _glewSearchExtension("GL_SGIX_list_priority", extStart, extEnd);
-#endif /* GL_SGIX_list_priority */
-#ifdef GL_SGIX_pixel_texture
- CONST_CAST(GLEW_SGIX_pixel_texture) = _glewSearchExtension("GL_SGIX_pixel_texture", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_pixel_texture */
-#ifdef GL_SGIX_pixel_texture_bits
- CONST_CAST(GLEW_SGIX_pixel_texture_bits) = _glewSearchExtension("GL_SGIX_pixel_texture_bits", extStart, extEnd);
-#endif /* GL_SGIX_pixel_texture_bits */
-#ifdef GL_SGIX_reference_plane
- CONST_CAST(GLEW_SGIX_reference_plane) = _glewSearchExtension("GL_SGIX_reference_plane", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_reference_plane */
-#ifdef GL_SGIX_resample
- CONST_CAST(GLEW_SGIX_resample) = _glewSearchExtension("GL_SGIX_resample", extStart, extEnd);
-#endif /* GL_SGIX_resample */
-#ifdef GL_SGIX_shadow
- CONST_CAST(GLEW_SGIX_shadow) = _glewSearchExtension("GL_SGIX_shadow", extStart, extEnd);
-#endif /* GL_SGIX_shadow */
-#ifdef GL_SGIX_shadow_ambient
- CONST_CAST(GLEW_SGIX_shadow_ambient) = _glewSearchExtension("GL_SGIX_shadow_ambient", extStart, extEnd);
-#endif /* GL_SGIX_shadow_ambient */
-#ifdef GL_SGIX_sprite
- CONST_CAST(GLEW_SGIX_sprite) = _glewSearchExtension("GL_SGIX_sprite", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_sprite */
-#ifdef GL_SGIX_tag_sample_buffer
- CONST_CAST(GLEW_SGIX_tag_sample_buffer) = _glewSearchExtension("GL_SGIX_tag_sample_buffer", extStart, extEnd);
- if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGIX_tag_sample_buffer */
-#ifdef GL_SGIX_texture_add_env
- CONST_CAST(GLEW_SGIX_texture_add_env) = _glewSearchExtension("GL_SGIX_texture_add_env", extStart, extEnd);
-#endif /* GL_SGIX_texture_add_env */
-#ifdef GL_SGIX_texture_coordinate_clamp
- CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = _glewSearchExtension("GL_SGIX_texture_coordinate_clamp", extStart, extEnd);
-#endif /* GL_SGIX_texture_coordinate_clamp */
-#ifdef GL_SGIX_texture_lod_bias
- CONST_CAST(GLEW_SGIX_texture_lod_bias) = _glewSearchExtension("GL_SGIX_texture_lod_bias", extStart, extEnd);
-#endif /* GL_SGIX_texture_lod_bias */
-#ifdef GL_SGIX_texture_multi_buffer
- CONST_CAST(GLEW_SGIX_texture_multi_buffer) = _glewSearchExtension("GL_SGIX_texture_multi_buffer", extStart, extEnd);
-#endif /* GL_SGIX_texture_multi_buffer */
-#ifdef GL_SGIX_texture_range
- CONST_CAST(GLEW_SGIX_texture_range) = _glewSearchExtension("GL_SGIX_texture_range", extStart, extEnd);
-#endif /* GL_SGIX_texture_range */
-#ifdef GL_SGIX_texture_scale_bias
- CONST_CAST(GLEW_SGIX_texture_scale_bias) = _glewSearchExtension("GL_SGIX_texture_scale_bias", extStart, extEnd);
-#endif /* GL_SGIX_texture_scale_bias */
-#ifdef GL_SGIX_vertex_preclip
- CONST_CAST(GLEW_SGIX_vertex_preclip) = _glewSearchExtension("GL_SGIX_vertex_preclip", extStart, extEnd);
-#endif /* GL_SGIX_vertex_preclip */
-#ifdef GL_SGIX_vertex_preclip_hint
- CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = _glewSearchExtension("GL_SGIX_vertex_preclip_hint", extStart, extEnd);
-#endif /* GL_SGIX_vertex_preclip_hint */
-#ifdef GL_SGIX_ycrcb
- CONST_CAST(GLEW_SGIX_ycrcb) = _glewSearchExtension("GL_SGIX_ycrcb", extStart, extEnd);
-#endif /* GL_SGIX_ycrcb */
-#ifdef GL_SGI_color_matrix
- CONST_CAST(GLEW_SGI_color_matrix) = _glewSearchExtension("GL_SGI_color_matrix", extStart, extEnd);
-#endif /* GL_SGI_color_matrix */
-#ifdef GL_SGI_color_table
- CONST_CAST(GLEW_SGI_color_table) = _glewSearchExtension("GL_SGI_color_table", extStart, extEnd);
- if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SGI_color_table */
-#ifdef GL_SGI_texture_color_table
- CONST_CAST(GLEW_SGI_texture_color_table) = _glewSearchExtension("GL_SGI_texture_color_table", extStart, extEnd);
-#endif /* GL_SGI_texture_color_table */
-#ifdef GL_SUNX_constant_data
- CONST_CAST(GLEW_SUNX_constant_data) = _glewSearchExtension("GL_SUNX_constant_data", extStart, extEnd);
- if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SUNX_constant_data */
-#ifdef GL_SUN_convolution_border_modes
- CONST_CAST(GLEW_SUN_convolution_border_modes) = _glewSearchExtension("GL_SUN_convolution_border_modes", extStart, extEnd);
-#endif /* GL_SUN_convolution_border_modes */
-#ifdef GL_SUN_global_alpha
- CONST_CAST(GLEW_SUN_global_alpha) = _glewSearchExtension("GL_SUN_global_alpha", extStart, extEnd);
- if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SUN_global_alpha */
-#ifdef GL_SUN_mesh_array
- CONST_CAST(GLEW_SUN_mesh_array) = _glewSearchExtension("GL_SUN_mesh_array", extStart, extEnd);
-#endif /* GL_SUN_mesh_array */
-#ifdef GL_SUN_read_video_pixels
- CONST_CAST(GLEW_SUN_read_video_pixels) = _glewSearchExtension("GL_SUN_read_video_pixels", extStart, extEnd);
- if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SUN_read_video_pixels */
-#ifdef GL_SUN_slice_accum
- CONST_CAST(GLEW_SUN_slice_accum) = _glewSearchExtension("GL_SUN_slice_accum", extStart, extEnd);
-#endif /* GL_SUN_slice_accum */
-#ifdef GL_SUN_triangle_list
- CONST_CAST(GLEW_SUN_triangle_list) = _glewSearchExtension("GL_SUN_triangle_list", extStart, extEnd);
- if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SUN_triangle_list */
-#ifdef GL_SUN_vertex
- CONST_CAST(GLEW_SUN_vertex) = _glewSearchExtension("GL_SUN_vertex", extStart, extEnd);
- if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_SUN_vertex */
-#ifdef GL_WIN_phong_shading
- CONST_CAST(GLEW_WIN_phong_shading) = _glewSearchExtension("GL_WIN_phong_shading", extStart, extEnd);
-#endif /* GL_WIN_phong_shading */
-#ifdef GL_WIN_specular_fog
- CONST_CAST(GLEW_WIN_specular_fog) = _glewSearchExtension("GL_WIN_specular_fog", extStart, extEnd);
-#endif /* GL_WIN_specular_fog */
-#ifdef GL_WIN_swap_hint
- CONST_CAST(GLEW_WIN_swap_hint) = _glewSearchExtension("GL_WIN_swap_hint", extStart, extEnd);
- if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GL_WIN_swap_hint */
-
- return GLEW_OK;
-}
-
-
-#if defined(_WIN32)
-
-#if !defined(GLEW_MX)
-
-PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL;
-
-PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL;
-PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL;
-PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL;
-PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL;
-PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL;
-PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL;
-PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL;
-PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL;
-PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL;
-
-PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL;
-PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL;
-PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL;
-PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL;
-
-PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL;
-
-PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL;
-
-PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL;
-PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL;
-
-PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL;
-PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL;
-PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL;
-PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL;
-PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL;
-
-PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL;
-PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL;
-PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL;
-
-PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL;
-PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL;
-PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL;
-
-PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL;
-PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL;
-PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL;
-PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL;
-
-PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL;
-
-PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL;
-PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL;
-
-PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL;
-PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL;
-PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL;
-PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL;
-PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL;
-
-PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL;
-PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL;
-PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL;
-
-PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL;
-PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL;
-
-PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL;
-PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL;
-
-PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL;
-PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL;
-PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL;
-PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL;
-
-PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL;
-PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL;
-PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL;
-PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL;
-PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL;
-PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL;
-PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL;
-PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL;
-PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL;
-PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL;
-PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL;
-PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL;
-
-PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL;
-PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL;
-PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL;
-PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL;
-
-PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL;
-PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL;
-PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL;
-PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL;
-
-PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL;
-PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL;
-PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL;
-PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL;
-
-PFNWGLDXCLOSEDEVICENVPROC __wglewDXCloseDeviceNV = NULL;
-PFNWGLDXLOCKOBJECTSNVPROC __wglewDXLockObjectsNV = NULL;
-PFNWGLDXOBJECTACCESSNVPROC __wglewDXObjectAccessNV = NULL;
-PFNWGLDXOPENDEVICENVPROC __wglewDXOpenDeviceNV = NULL;
-PFNWGLDXREGISTEROBJECTNVPROC __wglewDXRegisterObjectNV = NULL;
-PFNWGLDXSETRESOURCESHAREHANDLENVPROC __wglewDXSetResourceShareHandleNV = NULL;
-PFNWGLDXUNLOCKOBJECTSNVPROC __wglewDXUnlockObjectsNV = NULL;
-PFNWGLDXUNREGISTEROBJECTNVPROC __wglewDXUnregisterObjectNV = NULL;
-
-PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL;
-
-PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL;
-PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL;
-PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL;
-PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL;
-PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL;
-
-PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL;
-PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL;
-PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL;
-
-PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL;
-PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL;
-PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL;
-PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL;
-PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL;
-PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL;
-
-PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL;
-PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL;
-
-PFNWGLBINDVIDEOCAPTUREDEVICENVPROC __wglewBindVideoCaptureDeviceNV = NULL;
-PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC __wglewEnumerateVideoCaptureDevicesNV = NULL;
-PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC __wglewLockVideoCaptureDeviceNV = NULL;
-PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC __wglewQueryVideoCaptureDeviceNV = NULL;
-PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC __wglewReleaseVideoCaptureDeviceNV = NULL;
-
-PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL;
-PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL;
-PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL;
-PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL;
-PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL;
-PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL;
-
-PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL;
-PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL;
-PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL;
-PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL;
-PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL;
-PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL;
-GLboolean __WGLEW_3DFX_multisample = GL_FALSE;
-GLboolean __WGLEW_3DL_stereo_control = GL_FALSE;
-GLboolean __WGLEW_AMD_gpu_association = GL_FALSE;
-GLboolean __WGLEW_ARB_buffer_region = GL_FALSE;
-GLboolean __WGLEW_ARB_create_context = GL_FALSE;
-GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE;
-GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE;
-GLboolean __WGLEW_ARB_extensions_string = GL_FALSE;
-GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE;
-GLboolean __WGLEW_ARB_make_current_read = GL_FALSE;
-GLboolean __WGLEW_ARB_multisample = GL_FALSE;
-GLboolean __WGLEW_ARB_pbuffer = GL_FALSE;
-GLboolean __WGLEW_ARB_pixel_format = GL_FALSE;
-GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE;
-GLboolean __WGLEW_ARB_render_texture = GL_FALSE;
-GLboolean __WGLEW_ARB_robustness_application_isolation = GL_FALSE;
-GLboolean __WGLEW_ARB_robustness_share_group_isolation = GL_FALSE;
-GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE;
-GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE;
-GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE;
-GLboolean __WGLEW_EXT_create_context_es_profile = GL_FALSE;
-GLboolean __WGLEW_EXT_depth_float = GL_FALSE;
-GLboolean __WGLEW_EXT_display_color_table = GL_FALSE;
-GLboolean __WGLEW_EXT_extensions_string = GL_FALSE;
-GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE;
-GLboolean __WGLEW_EXT_make_current_read = GL_FALSE;
-GLboolean __WGLEW_EXT_multisample = GL_FALSE;
-GLboolean __WGLEW_EXT_pbuffer = GL_FALSE;
-GLboolean __WGLEW_EXT_pixel_format = GL_FALSE;
-GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE;
-GLboolean __WGLEW_EXT_swap_control = GL_FALSE;
-GLboolean __WGLEW_EXT_swap_control_tear = GL_FALSE;
-GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE;
-GLboolean __WGLEW_I3D_gamma = GL_FALSE;
-GLboolean __WGLEW_I3D_genlock = GL_FALSE;
-GLboolean __WGLEW_I3D_image_buffer = GL_FALSE;
-GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE;
-GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE;
-GLboolean __WGLEW_NV_DX_interop = GL_FALSE;
-GLboolean __WGLEW_NV_DX_interop2 = GL_FALSE;
-GLboolean __WGLEW_NV_copy_image = GL_FALSE;
-GLboolean __WGLEW_NV_float_buffer = GL_FALSE;
-GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE;
-GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE;
-GLboolean __WGLEW_NV_present_video = GL_FALSE;
-GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE;
-GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE;
-GLboolean __WGLEW_NV_swap_group = GL_FALSE;
-GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE;
-GLboolean __WGLEW_NV_video_capture = GL_FALSE;
-GLboolean __WGLEW_NV_video_output = GL_FALSE;
-GLboolean __WGLEW_OML_sync_control = GL_FALSE;
-
-#endif /* !GLEW_MX */
-
-#ifdef WGL_3DFX_multisample
-
-#endif /* WGL_3DFX_multisample */
-
-#ifdef WGL_3DL_stereo_control
-
-static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_3DL_stereo_control */
-
-#ifdef WGL_AMD_gpu_association
-
-static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r;
- r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r;
- r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r;
- r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r;
- r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r;
- r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r;
- r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r;
- r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r;
- r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_AMD_gpu_association */
-
-#ifdef WGL_ARB_buffer_region
-
-static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r;
- r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r;
- r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r;
- r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_buffer_region */
-
-#ifdef WGL_ARB_create_context
-
-static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_create_context */
-
-#ifdef WGL_ARB_create_context_profile
-
-#endif /* WGL_ARB_create_context_profile */
-
-#ifdef WGL_ARB_create_context_robustness
-
-#endif /* WGL_ARB_create_context_robustness */
-
-#ifdef WGL_ARB_extensions_string
-
-static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_extensions_string */
-
-#ifdef WGL_ARB_framebuffer_sRGB
-
-#endif /* WGL_ARB_framebuffer_sRGB */
-
-#ifdef WGL_ARB_make_current_read
-
-static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r;
- r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_make_current_read */
-
-#ifdef WGL_ARB_multisample
-
-#endif /* WGL_ARB_multisample */
-
-#ifdef WGL_ARB_pbuffer
-
-static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r;
- r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r;
- r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r;
- r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r;
- r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_pbuffer */
-
-#ifdef WGL_ARB_pixel_format
-
-static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r;
- r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r;
- r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_pixel_format */
-
-#ifdef WGL_ARB_pixel_format_float
-
-#endif /* WGL_ARB_pixel_format_float */
-
-#ifdef WGL_ARB_render_texture
-
-static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r;
- r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r;
- r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_ARB_render_texture */
-
-#ifdef WGL_ARB_robustness_application_isolation
-
-#endif /* WGL_ARB_robustness_application_isolation */
-
-#ifdef WGL_ARB_robustness_share_group_isolation
-
-#endif /* WGL_ARB_robustness_share_group_isolation */
-
-#ifdef WGL_ATI_pixel_format_float
-
-#endif /* WGL_ATI_pixel_format_float */
-
-#ifdef WGL_ATI_render_texture_rectangle
-
-#endif /* WGL_ATI_render_texture_rectangle */
-
-#ifdef WGL_EXT_create_context_es2_profile
-
-#endif /* WGL_EXT_create_context_es2_profile */
-
-#ifdef WGL_EXT_create_context_es_profile
-
-#endif /* WGL_EXT_create_context_es_profile */
-
-#ifdef WGL_EXT_depth_float
-
-#endif /* WGL_EXT_depth_float */
-
-#ifdef WGL_EXT_display_color_table
-
-static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r;
- r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r;
- r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r;
- r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_display_color_table */
-
-#ifdef WGL_EXT_extensions_string
-
-static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_extensions_string */
-
-#ifdef WGL_EXT_framebuffer_sRGB
-
-#endif /* WGL_EXT_framebuffer_sRGB */
-
-#ifdef WGL_EXT_make_current_read
-
-static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r;
- r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_make_current_read */
-
-#ifdef WGL_EXT_multisample
-
-#endif /* WGL_EXT_multisample */
-
-#ifdef WGL_EXT_pbuffer
-
-static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r;
- r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r;
- r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r;
- r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r;
- r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_pbuffer */
-
-#ifdef WGL_EXT_pixel_format
-
-static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r;
- r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r;
- r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_pixel_format */
-
-#ifdef WGL_EXT_pixel_format_packed_float
-
-#endif /* WGL_EXT_pixel_format_packed_float */
-
-#ifdef WGL_EXT_swap_control
-
-static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r;
- r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_EXT_swap_control */
-
-#ifdef WGL_EXT_swap_control_tear
-
-#endif /* WGL_EXT_swap_control_tear */
-
-#ifdef WGL_I3D_digital_video_control
-
-static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r;
- r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_digital_video_control */
-
-#ifdef WGL_I3D_gamma
-
-static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r;
- r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r;
- r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r;
- r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_gamma */
-
-#ifdef WGL_I3D_genlock
-
-static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r;
- r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r;
- r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r;
- r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r;
- r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r;
- r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r;
- r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r;
- r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r;
- r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r;
- r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r;
- r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r;
- r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_genlock */
-
-#ifdef WGL_I3D_image_buffer
-
-static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r;
- r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r;
- r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r;
- r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_image_buffer */
-
-#ifdef WGL_I3D_swap_frame_lock
-
-static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r;
- r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r;
- r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r;
- r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_swap_frame_lock */
-
-#ifdef WGL_I3D_swap_frame_usage
-
-static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r;
- r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r;
- r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r;
- r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_I3D_swap_frame_usage */
-
-#ifdef WGL_NV_DX_interop
-
-static GLboolean _glewInit_WGL_NV_DX_interop (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglDXCloseDeviceNV = (PFNWGLDXCLOSEDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXCloseDeviceNV")) == NULL) || r;
- r = ((wglDXLockObjectsNV = (PFNWGLDXLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXLockObjectsNV")) == NULL) || r;
- r = ((wglDXObjectAccessNV = (PFNWGLDXOBJECTACCESSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXObjectAccessNV")) == NULL) || r;
- r = ((wglDXOpenDeviceNV = (PFNWGLDXOPENDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglDXOpenDeviceNV")) == NULL) || r;
- r = ((wglDXRegisterObjectNV = (PFNWGLDXREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXRegisterObjectNV")) == NULL) || r;
- r = ((wglDXSetResourceShareHandleNV = (PFNWGLDXSETRESOURCESHAREHANDLENVPROC)glewGetProcAddress((const GLubyte*)"wglDXSetResourceShareHandleNV")) == NULL) || r;
- r = ((wglDXUnlockObjectsNV = (PFNWGLDXUNLOCKOBJECTSNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnlockObjectsNV")) == NULL) || r;
- r = ((wglDXUnregisterObjectNV = (PFNWGLDXUNREGISTEROBJECTNVPROC)glewGetProcAddress((const GLubyte*)"wglDXUnregisterObjectNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_DX_interop */
-
-#ifdef WGL_NV_DX_interop2
-
-#endif /* WGL_NV_DX_interop2 */
-
-#ifdef WGL_NV_copy_image
-
-static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_copy_image */
-
-#ifdef WGL_NV_float_buffer
-
-#endif /* WGL_NV_float_buffer */
-
-#ifdef WGL_NV_gpu_affinity
-
-static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r;
- r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r;
- r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r;
- r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r;
- r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_gpu_affinity */
-
-#ifdef WGL_NV_multisample_coverage
-
-#endif /* WGL_NV_multisample_coverage */
-
-#ifdef WGL_NV_present_video
-
-static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r;
- r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r;
- r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_present_video */
-
-#ifdef WGL_NV_render_depth_texture
-
-#endif /* WGL_NV_render_depth_texture */
-
-#ifdef WGL_NV_render_texture_rectangle
-
-#endif /* WGL_NV_render_texture_rectangle */
-
-#ifdef WGL_NV_swap_group
-
-static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r;
- r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r;
- r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r;
- r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r;
- r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r;
- r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_swap_group */
-
-#ifdef WGL_NV_vertex_array_range
-
-static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r;
- r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_vertex_array_range */
-
-#ifdef WGL_NV_video_capture
-
-static GLboolean _glewInit_WGL_NV_video_capture (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindVideoCaptureDeviceNV = (PFNWGLBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoCaptureDeviceNV")) == NULL) || r;
- r = ((wglEnumerateVideoCaptureDevicesNV = (PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoCaptureDevicesNV")) == NULL) || r;
- r = ((wglLockVideoCaptureDeviceNV = (PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglLockVideoCaptureDeviceNV")) == NULL) || r;
- r = ((wglQueryVideoCaptureDeviceNV = (PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglQueryVideoCaptureDeviceNV")) == NULL) || r;
- r = ((wglReleaseVideoCaptureDeviceNV = (PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoCaptureDeviceNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_video_capture */
-
-#ifdef WGL_NV_video_output
-
-static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r;
- r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r;
- r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r;
- r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r;
- r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r;
- r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_NV_video_output */
-
-#ifdef WGL_OML_sync_control
-
-static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r;
- r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r;
- r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r;
- r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r;
- r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r;
- r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r;
-
- return r;
-}
-
-#endif /* WGL_OML_sync_control */
-
-/* ------------------------------------------------------------------------- */
-
-static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL;
-static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL;
-
-GLboolean GLEWAPIENTRY wglewGetExtension (const char* name)
-{
- const GLubyte* start;
- const GLubyte* end;
- if (_wglewGetExtensionsStringARB == NULL)
- if (_wglewGetExtensionsStringEXT == NULL)
- return GL_FALSE;
- else
- start = (const GLubyte*)_wglewGetExtensionsStringEXT();
- else
- start = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
- if (start == 0)
- return GL_FALSE;
- end = start + _glewStrLen(start);
- return _glewSearchExtension(name, start, end);
-}
-
-GLenum GLEWAPIENTRY wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST)
-{
- GLboolean crippled;
- const GLubyte* extStart;
- const GLubyte* extEnd;
- /* find wgl extension string query functions */
- _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB");
- _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT");
- /* query wgl extension string */
- if (_wglewGetExtensionsStringARB == NULL)
- if (_wglewGetExtensionsStringEXT == NULL)
- extStart = (const GLubyte*)"";
- else
- extStart = (const GLubyte*)_wglewGetExtensionsStringEXT();
- else
- extStart = (const GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC());
- extEnd = extStart + _glewStrLen(extStart);
- /* initialize extensions */
- crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL;
-#ifdef WGL_3DFX_multisample
- CONST_CAST(WGLEW_3DFX_multisample) = _glewSearchExtension("WGL_3DFX_multisample", extStart, extEnd);
-#endif /* WGL_3DFX_multisample */
-#ifdef WGL_3DL_stereo_control
- CONST_CAST(WGLEW_3DL_stereo_control) = _glewSearchExtension("WGL_3DL_stereo_control", extStart, extEnd);
- if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_3DL_stereo_control */
-#ifdef WGL_AMD_gpu_association
- CONST_CAST(WGLEW_AMD_gpu_association) = _glewSearchExtension("WGL_AMD_gpu_association", extStart, extEnd);
- if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_AMD_gpu_association */
-#ifdef WGL_ARB_buffer_region
- CONST_CAST(WGLEW_ARB_buffer_region) = _glewSearchExtension("WGL_ARB_buffer_region", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_buffer_region */
-#ifdef WGL_ARB_create_context
- CONST_CAST(WGLEW_ARB_create_context) = _glewSearchExtension("WGL_ARB_create_context", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_create_context */
-#ifdef WGL_ARB_create_context_profile
- CONST_CAST(WGLEW_ARB_create_context_profile) = _glewSearchExtension("WGL_ARB_create_context_profile", extStart, extEnd);
-#endif /* WGL_ARB_create_context_profile */
-#ifdef WGL_ARB_create_context_robustness
- CONST_CAST(WGLEW_ARB_create_context_robustness) = _glewSearchExtension("WGL_ARB_create_context_robustness", extStart, extEnd);
-#endif /* WGL_ARB_create_context_robustness */
-#ifdef WGL_ARB_extensions_string
- CONST_CAST(WGLEW_ARB_extensions_string) = _glewSearchExtension("WGL_ARB_extensions_string", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_extensions_string */
-#ifdef WGL_ARB_framebuffer_sRGB
- CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = _glewSearchExtension("WGL_ARB_framebuffer_sRGB", extStart, extEnd);
-#endif /* WGL_ARB_framebuffer_sRGB */
-#ifdef WGL_ARB_make_current_read
- CONST_CAST(WGLEW_ARB_make_current_read) = _glewSearchExtension("WGL_ARB_make_current_read", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_make_current_read */
-#ifdef WGL_ARB_multisample
- CONST_CAST(WGLEW_ARB_multisample) = _glewSearchExtension("WGL_ARB_multisample", extStart, extEnd);
-#endif /* WGL_ARB_multisample */
-#ifdef WGL_ARB_pbuffer
- CONST_CAST(WGLEW_ARB_pbuffer) = _glewSearchExtension("WGL_ARB_pbuffer", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_pbuffer */
-#ifdef WGL_ARB_pixel_format
- CONST_CAST(WGLEW_ARB_pixel_format) = _glewSearchExtension("WGL_ARB_pixel_format", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_pixel_format */
-#ifdef WGL_ARB_pixel_format_float
- CONST_CAST(WGLEW_ARB_pixel_format_float) = _glewSearchExtension("WGL_ARB_pixel_format_float", extStart, extEnd);
-#endif /* WGL_ARB_pixel_format_float */
-#ifdef WGL_ARB_render_texture
- CONST_CAST(WGLEW_ARB_render_texture) = _glewSearchExtension("WGL_ARB_render_texture", extStart, extEnd);
- if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_ARB_render_texture */
-#ifdef WGL_ARB_robustness_application_isolation
- CONST_CAST(WGLEW_ARB_robustness_application_isolation) = _glewSearchExtension("WGL_ARB_robustness_application_isolation", extStart, extEnd);
-#endif /* WGL_ARB_robustness_application_isolation */
-#ifdef WGL_ARB_robustness_share_group_isolation
- CONST_CAST(WGLEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("WGL_ARB_robustness_share_group_isolation", extStart, extEnd);
-#endif /* WGL_ARB_robustness_share_group_isolation */
-#ifdef WGL_ATI_pixel_format_float
- CONST_CAST(WGLEW_ATI_pixel_format_float) = _glewSearchExtension("WGL_ATI_pixel_format_float", extStart, extEnd);
-#endif /* WGL_ATI_pixel_format_float */
-#ifdef WGL_ATI_render_texture_rectangle
- CONST_CAST(WGLEW_ATI_render_texture_rectangle) = _glewSearchExtension("WGL_ATI_render_texture_rectangle", extStart, extEnd);
-#endif /* WGL_ATI_render_texture_rectangle */
-#ifdef WGL_EXT_create_context_es2_profile
- CONST_CAST(WGLEW_EXT_create_context_es2_profile) = _glewSearchExtension("WGL_EXT_create_context_es2_profile", extStart, extEnd);
-#endif /* WGL_EXT_create_context_es2_profile */
-#ifdef WGL_EXT_create_context_es_profile
- CONST_CAST(WGLEW_EXT_create_context_es_profile) = _glewSearchExtension("WGL_EXT_create_context_es_profile", extStart, extEnd);
-#endif /* WGL_EXT_create_context_es_profile */
-#ifdef WGL_EXT_depth_float
- CONST_CAST(WGLEW_EXT_depth_float) = _glewSearchExtension("WGL_EXT_depth_float", extStart, extEnd);
-#endif /* WGL_EXT_depth_float */
-#ifdef WGL_EXT_display_color_table
- CONST_CAST(WGLEW_EXT_display_color_table) = _glewSearchExtension("WGL_EXT_display_color_table", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_display_color_table */
-#ifdef WGL_EXT_extensions_string
- CONST_CAST(WGLEW_EXT_extensions_string) = _glewSearchExtension("WGL_EXT_extensions_string", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_extensions_string */
-#ifdef WGL_EXT_framebuffer_sRGB
- CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = _glewSearchExtension("WGL_EXT_framebuffer_sRGB", extStart, extEnd);
-#endif /* WGL_EXT_framebuffer_sRGB */
-#ifdef WGL_EXT_make_current_read
- CONST_CAST(WGLEW_EXT_make_current_read) = _glewSearchExtension("WGL_EXT_make_current_read", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_make_current_read */
-#ifdef WGL_EXT_multisample
- CONST_CAST(WGLEW_EXT_multisample) = _glewSearchExtension("WGL_EXT_multisample", extStart, extEnd);
-#endif /* WGL_EXT_multisample */
-#ifdef WGL_EXT_pbuffer
- CONST_CAST(WGLEW_EXT_pbuffer) = _glewSearchExtension("WGL_EXT_pbuffer", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_pbuffer */
-#ifdef WGL_EXT_pixel_format
- CONST_CAST(WGLEW_EXT_pixel_format) = _glewSearchExtension("WGL_EXT_pixel_format", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_pixel_format */
-#ifdef WGL_EXT_pixel_format_packed_float
- CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = _glewSearchExtension("WGL_EXT_pixel_format_packed_float", extStart, extEnd);
-#endif /* WGL_EXT_pixel_format_packed_float */
-#ifdef WGL_EXT_swap_control
- CONST_CAST(WGLEW_EXT_swap_control) = _glewSearchExtension("WGL_EXT_swap_control", extStart, extEnd);
- if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_EXT_swap_control */
-#ifdef WGL_EXT_swap_control_tear
- CONST_CAST(WGLEW_EXT_swap_control_tear) = _glewSearchExtension("WGL_EXT_swap_control_tear", extStart, extEnd);
-#endif /* WGL_EXT_swap_control_tear */
-#ifdef WGL_I3D_digital_video_control
- CONST_CAST(WGLEW_I3D_digital_video_control) = _glewSearchExtension("WGL_I3D_digital_video_control", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_digital_video_control */
-#ifdef WGL_I3D_gamma
- CONST_CAST(WGLEW_I3D_gamma) = _glewSearchExtension("WGL_I3D_gamma", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_gamma */
-#ifdef WGL_I3D_genlock
- CONST_CAST(WGLEW_I3D_genlock) = _glewSearchExtension("WGL_I3D_genlock", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_genlock */
-#ifdef WGL_I3D_image_buffer
- CONST_CAST(WGLEW_I3D_image_buffer) = _glewSearchExtension("WGL_I3D_image_buffer", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_image_buffer */
-#ifdef WGL_I3D_swap_frame_lock
- CONST_CAST(WGLEW_I3D_swap_frame_lock) = _glewSearchExtension("WGL_I3D_swap_frame_lock", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_swap_frame_lock */
-#ifdef WGL_I3D_swap_frame_usage
- CONST_CAST(WGLEW_I3D_swap_frame_usage) = _glewSearchExtension("WGL_I3D_swap_frame_usage", extStart, extEnd);
- if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_I3D_swap_frame_usage */
-#ifdef WGL_NV_DX_interop
- CONST_CAST(WGLEW_NV_DX_interop) = _glewSearchExtension("WGL_NV_DX_interop", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_DX_interop|| crippled) CONST_CAST(WGLEW_NV_DX_interop)= !_glewInit_WGL_NV_DX_interop(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_DX_interop */
-#ifdef WGL_NV_DX_interop2
- CONST_CAST(WGLEW_NV_DX_interop2) = _glewSearchExtension("WGL_NV_DX_interop2", extStart, extEnd);
-#endif /* WGL_NV_DX_interop2 */
-#ifdef WGL_NV_copy_image
- CONST_CAST(WGLEW_NV_copy_image) = _glewSearchExtension("WGL_NV_copy_image", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_copy_image */
-#ifdef WGL_NV_float_buffer
- CONST_CAST(WGLEW_NV_float_buffer) = _glewSearchExtension("WGL_NV_float_buffer", extStart, extEnd);
-#endif /* WGL_NV_float_buffer */
-#ifdef WGL_NV_gpu_affinity
- CONST_CAST(WGLEW_NV_gpu_affinity) = _glewSearchExtension("WGL_NV_gpu_affinity", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_gpu_affinity */
-#ifdef WGL_NV_multisample_coverage
- CONST_CAST(WGLEW_NV_multisample_coverage) = _glewSearchExtension("WGL_NV_multisample_coverage", extStart, extEnd);
-#endif /* WGL_NV_multisample_coverage */
-#ifdef WGL_NV_present_video
- CONST_CAST(WGLEW_NV_present_video) = _glewSearchExtension("WGL_NV_present_video", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_present_video */
-#ifdef WGL_NV_render_depth_texture
- CONST_CAST(WGLEW_NV_render_depth_texture) = _glewSearchExtension("WGL_NV_render_depth_texture", extStart, extEnd);
-#endif /* WGL_NV_render_depth_texture */
-#ifdef WGL_NV_render_texture_rectangle
- CONST_CAST(WGLEW_NV_render_texture_rectangle) = _glewSearchExtension("WGL_NV_render_texture_rectangle", extStart, extEnd);
-#endif /* WGL_NV_render_texture_rectangle */
-#ifdef WGL_NV_swap_group
- CONST_CAST(WGLEW_NV_swap_group) = _glewSearchExtension("WGL_NV_swap_group", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_swap_group */
-#ifdef WGL_NV_vertex_array_range
- CONST_CAST(WGLEW_NV_vertex_array_range) = _glewSearchExtension("WGL_NV_vertex_array_range", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_vertex_array_range */
-#ifdef WGL_NV_video_capture
- CONST_CAST(WGLEW_NV_video_capture) = _glewSearchExtension("WGL_NV_video_capture", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_video_capture|| crippled) CONST_CAST(WGLEW_NV_video_capture)= !_glewInit_WGL_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_video_capture */
-#ifdef WGL_NV_video_output
- CONST_CAST(WGLEW_NV_video_output) = _glewSearchExtension("WGL_NV_video_output", extStart, extEnd);
- if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_NV_video_output */
-#ifdef WGL_OML_sync_control
- CONST_CAST(WGLEW_OML_sync_control) = _glewSearchExtension("WGL_OML_sync_control", extStart, extEnd);
- if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* WGL_OML_sync_control */
-
- return GLEW_OK;
-}
-
-#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
-
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-PFNGLXGETPROCADDRESSARBPROC __glewXGetProcAddressARB = NULL;
-PFNGLXQUERYEXTENSION __glewXQueryExtension=NULL;
-PFNGLXQUERYVERSION __glewXQueryVersion=NULL;
-PFNGLXGETCONFIG __glewXGetConfig=NULL;
-PFNGLXCHOOSEVISUAL __glewXChooseVisual=NULL;
-PFNGLXCREATECONTEXT __glewXCreateContext=NULL;
-PFNGLXDESTROYCONTEXT __glewXDestroyContext=NULL;
-PFNGLXISDIRECT __glewXIsDirect=NULL;
-PFNGLXMAKECURRENT __glewXMakeCurrent=NULL;
-PFNGLXQUERYEXTENSIONSSTRING __glewXQueryExtensionsString=NULL;
-PFNGLXGETCLIENTSTRING __glewXGetClientString=NULL;
-PFNGLXQUERYSERVERSTRING __glewXQueryServerString=NULL;
-PFNGLXSWAPBUFFERS __glewXSwapBuffers=NULL;
-
-#endif//GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL;
-
-PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL;
-PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL;
-PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL;
-PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL;
-PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL;
-PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL;
-PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL;
-PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL;
-PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL;
-PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL;
-PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL;
-PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL;
-PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL;
-PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL;
-PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL;
-PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL;
-PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL;
-
-PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC __glewXBlitContextFramebufferAMD = NULL;
-PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC __glewXCreateAssociatedContextAMD = NULL;
-PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __glewXCreateAssociatedContextAttribsAMD = NULL;
-PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC __glewXDeleteAssociatedContextAMD = NULL;
-PFNGLXGETCONTEXTGPUIDAMDPROC __glewXGetContextGPUIDAMD = NULL;
-PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC __glewXGetCurrentAssociatedContextAMD = NULL;
-PFNGLXGETGPUIDSAMDPROC __glewXGetGPUIDsAMD = NULL;
-PFNGLXGETGPUINFOAMDPROC __glewXGetGPUInfoAMD = NULL;
-PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __glewXMakeAssociatedContextCurrentAMD = NULL;
-
-PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL;
-
-PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL;
-PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL;
-PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL;
-
-PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL;
-PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL;
-PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL;
-PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL;
-
-PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL;
-
-PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL;
-PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL;
-
-PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL;
-
-PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL;
-
-PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL;
-
-PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL;
-
-PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL;
-
-PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA = NULL;
-PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA = NULL;
-
-PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL;
-
-PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL;
-PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL;
-
-PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL;
-PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL;
-PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL;
-PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL;
-PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL;
-PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL;
-
-PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL;
-PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL;
-
-PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV = NULL;
-PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV = NULL;
-PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV = NULL;
-PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV = NULL;
-PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV = NULL;
-
-PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL;
-PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL;
-PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL;
-PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL;
-PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL;
-PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL;
-
-PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL;
-PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL;
-PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL;
-PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL;
-PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL;
-
-PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL;
-PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL;
-PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL;
-PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL;
-PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL;
-PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL;
-
-PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL;
-PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL;
-PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL;
-PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL;
-PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL;
-PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL;
-PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL;
-PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL;
-
-PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL;
-PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL;
-PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL;
-PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL;
-PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL;
-
-PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL;
-PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL;
-
-PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL;
-
-PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL;
-PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL;
-PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL;
-PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL;
-PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL;
-
-PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL;
-
-PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL;
-PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL;
-
-PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL;
-
-PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL;
-PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL;
-
-PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL;
-
-PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL;
-PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL;
-
-#if !defined(GLEW_MX)
-
-GLboolean __GLXEW_VERSION_1_0 = GL_FALSE;
-GLboolean __GLXEW_VERSION_1_1 = GL_FALSE;
-GLboolean __GLXEW_VERSION_1_2 = GL_FALSE;
-GLboolean __GLXEW_VERSION_1_3 = GL_FALSE;
-GLboolean __GLXEW_VERSION_1_4 = GL_FALSE;
-GLboolean __GLXEW_3DFX_multisample = GL_FALSE;
-GLboolean __GLXEW_AMD_gpu_association = GL_FALSE;
-GLboolean __GLXEW_ARB_create_context = GL_FALSE;
-GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE;
-GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE;
-GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE;
-GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE;
-GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE;
-GLboolean __GLXEW_ARB_multisample = GL_FALSE;
-GLboolean __GLXEW_ARB_robustness_application_isolation = GL_FALSE;
-GLboolean __GLXEW_ARB_robustness_share_group_isolation = GL_FALSE;
-GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE;
-GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE;
-GLboolean __GLXEW_ATI_render_texture = GL_FALSE;
-GLboolean __GLXEW_EXT_buffer_age = GL_FALSE;
-GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE;
-GLboolean __GLXEW_EXT_create_context_es_profile = GL_FALSE;
-GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE;
-GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE;
-GLboolean __GLXEW_EXT_import_context = GL_FALSE;
-GLboolean __GLXEW_EXT_scene_marker = GL_FALSE;
-GLboolean __GLXEW_EXT_swap_control = GL_FALSE;
-GLboolean __GLXEW_EXT_swap_control_tear = GL_FALSE;
-GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE;
-GLboolean __GLXEW_EXT_visual_info = GL_FALSE;
-GLboolean __GLXEW_EXT_visual_rating = GL_FALSE;
-GLboolean __GLXEW_INTEL_swap_event = GL_FALSE;
-GLboolean __GLXEW_MESA_agp_offset = GL_FALSE;
-GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE;
-GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE;
-GLboolean __GLXEW_MESA_release_buffers = GL_FALSE;
-GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE;
-GLboolean __GLXEW_MESA_swap_control = GL_FALSE;
-GLboolean __GLXEW_NV_copy_image = GL_FALSE;
-GLboolean __GLXEW_NV_float_buffer = GL_FALSE;
-GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE;
-GLboolean __GLXEW_NV_present_video = GL_FALSE;
-GLboolean __GLXEW_NV_swap_group = GL_FALSE;
-GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE;
-GLboolean __GLXEW_NV_video_capture = GL_FALSE;
-GLboolean __GLXEW_NV_video_output = GL_FALSE;
-GLboolean __GLXEW_OML_swap_method = GL_FALSE;
-GLboolean __GLXEW_OML_sync_control = GL_FALSE;
-GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE;
-GLboolean __GLXEW_SGIS_color_range = GL_FALSE;
-GLboolean __GLXEW_SGIS_multisample = GL_FALSE;
-GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE;
-GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE;
-GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE;
-GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE;
-GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE;
-GLboolean __GLXEW_SGIX_swap_group = GL_FALSE;
-GLboolean __GLXEW_SGIX_video_resize = GL_FALSE;
-GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE;
-GLboolean __GLXEW_SGI_cushion = GL_FALSE;
-GLboolean __GLXEW_SGI_make_current_read = GL_FALSE;
-GLboolean __GLXEW_SGI_swap_control = GL_FALSE;
-GLboolean __GLXEW_SGI_video_sync = GL_FALSE;
-GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE;
-GLboolean __GLXEW_SUN_video_resize = GL_FALSE;
-
-#endif /* !GLEW_MX */
-
-#ifdef GLX_VERSION_1_2
-
-static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_VERSION_1_2 */
-
-#ifdef GLX_VERSION_1_3
-
-static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r;
- r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r;
- r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r;
- r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r;
- r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r;
- r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r;
- r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r;
- r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r;
- r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r;
- r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r;
- r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r;
- r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r;
- r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r;
- r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r;
- r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r;
- r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r;
- r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_VERSION_1_3 */
-
-#ifdef GLX_VERSION_1_4
-
-#endif /* GLX_VERSION_1_4 */
-
-#ifdef GLX_3DFX_multisample
-
-#endif /* GLX_3DFX_multisample */
-
-#ifdef GLX_AMD_gpu_association
-
-static GLboolean _glewInit_GLX_AMD_gpu_association (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBlitContextFramebufferAMD = (PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"glXBlitContextFramebufferAMD")) == NULL) || r;
- r = ((glXCreateAssociatedContextAMD = (PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAMD")) == NULL) || r;
- r = ((glXCreateAssociatedContextAttribsAMD = (PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"glXCreateAssociatedContextAttribsAMD")) == NULL) || r;
- r = ((glXDeleteAssociatedContextAMD = (PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXDeleteAssociatedContextAMD")) == NULL) || r;
- r = ((glXGetContextGPUIDAMD = (PFNGLXGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetContextGPUIDAMD")) == NULL) || r;
- r = ((glXGetCurrentAssociatedContextAMD = (PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentAssociatedContextAMD")) == NULL) || r;
- r = ((glXGetGPUIDsAMD = (PFNGLXGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUIDsAMD")) == NULL) || r;
- r = ((glXGetGPUInfoAMD = (PFNGLXGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glXGetGPUInfoAMD")) == NULL) || r;
- r = ((glXMakeAssociatedContextCurrentAMD = (PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"glXMakeAssociatedContextCurrentAMD")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_AMD_gpu_association */
-
-#ifdef GLX_ARB_create_context
-
-static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_ARB_create_context */
-
-#ifdef GLX_ARB_create_context_profile
-
-#endif /* GLX_ARB_create_context_profile */
-
-#ifdef GLX_ARB_create_context_robustness
-
-#endif /* GLX_ARB_create_context_robustness */
-
-#ifdef GLX_ARB_fbconfig_float
-
-#endif /* GLX_ARB_fbconfig_float */
-
-#ifdef GLX_ARB_framebuffer_sRGB
-
-#endif /* GLX_ARB_framebuffer_sRGB */
-
-#ifdef GLX_ARB_get_proc_address
-
-#endif /* GLX_ARB_get_proc_address */
-
-#ifdef GLX_ARB_multisample
-
-#endif /* GLX_ARB_multisample */
-
-#ifdef GLX_ARB_robustness_application_isolation
-
-#endif /* GLX_ARB_robustness_application_isolation */
-
-#ifdef GLX_ARB_robustness_share_group_isolation
-
-#endif /* GLX_ARB_robustness_share_group_isolation */
-
-#ifdef GLX_ARB_vertex_buffer_object
-
-#endif /* GLX_ARB_vertex_buffer_object */
-
-#ifdef GLX_ATI_pixel_format_float
-
-#endif /* GLX_ATI_pixel_format_float */
-
-#ifdef GLX_ATI_render_texture
-
-static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r;
- r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r;
- r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_ATI_render_texture */
-
-#ifdef GLX_EXT_buffer_age
-
-#endif /* GLX_EXT_buffer_age */
-
-#ifdef GLX_EXT_create_context_es2_profile
-
-#endif /* GLX_EXT_create_context_es2_profile */
-
-#ifdef GLX_EXT_create_context_es_profile
-
-#endif /* GLX_EXT_create_context_es_profile */
-
-#ifdef GLX_EXT_fbconfig_packed_float
-
-#endif /* GLX_EXT_fbconfig_packed_float */
-
-#ifdef GLX_EXT_framebuffer_sRGB
-
-#endif /* GLX_EXT_framebuffer_sRGB */
-
-#ifdef GLX_EXT_import_context
-
-static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r;
- r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r;
- r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r;
- r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_EXT_import_context */
-
-#ifdef GLX_EXT_scene_marker
-
-#endif /* GLX_EXT_scene_marker */
-
-#ifdef GLX_EXT_swap_control
-
-static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_EXT_swap_control */
-
-#ifdef GLX_EXT_swap_control_tear
-
-#endif /* GLX_EXT_swap_control_tear */
-
-#ifdef GLX_EXT_texture_from_pixmap
-
-static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r;
- r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_EXT_texture_from_pixmap */
-
-#ifdef GLX_EXT_visual_info
-
-#endif /* GLX_EXT_visual_info */
-
-#ifdef GLX_EXT_visual_rating
-
-#endif /* GLX_EXT_visual_rating */
-
-#ifdef GLX_INTEL_swap_event
-
-#endif /* GLX_INTEL_swap_event */
-
-#ifdef GLX_MESA_agp_offset
-
-static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_agp_offset */
-
-#ifdef GLX_MESA_copy_sub_buffer
-
-static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_copy_sub_buffer */
-
-#ifdef GLX_MESA_pixmap_colormap
-
-static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_pixmap_colormap */
-
-#ifdef GLX_MESA_release_buffers
-
-static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_release_buffers */
-
-#ifdef GLX_MESA_set_3dfx_mode
-
-static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_set_3dfx_mode */
-
-#ifdef GLX_MESA_swap_control
-
-static GLboolean _glewInit_GLX_MESA_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetSwapIntervalMESA = (PFNGLXGETSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetSwapIntervalMESA")) == NULL) || r;
- r = ((glXSwapIntervalMESA = (PFNGLXSWAPINTERVALMESAPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalMESA")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_MESA_swap_control */
-
-#ifdef GLX_NV_copy_image
-
-static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_copy_image */
-
-#ifdef GLX_NV_float_buffer
-
-#endif /* GLX_NV_float_buffer */
-
-#ifdef GLX_NV_multisample_coverage
-
-#endif /* GLX_NV_multisample_coverage */
-
-#ifdef GLX_NV_present_video
-
-static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r;
- r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_present_video */
-
-#ifdef GLX_NV_swap_group
-
-static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r;
- r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r;
- r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r;
- r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r;
- r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r;
- r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_swap_group */
-
-#ifdef GLX_NV_vertex_array_range
-
-static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r;
- r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_vertex_array_range */
-
-#ifdef GLX_NV_video_capture
-
-static GLboolean _glewInit_GLX_NV_video_capture (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindVideoCaptureDeviceNV = (PFNGLXBINDVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoCaptureDeviceNV")) == NULL) || r;
- r = ((glXEnumerateVideoCaptureDevicesNV = (PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoCaptureDevicesNV")) == NULL) || r;
- r = ((glXLockVideoCaptureDeviceNV = (PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXLockVideoCaptureDeviceNV")) == NULL) || r;
- r = ((glXQueryVideoCaptureDeviceNV = (PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXQueryVideoCaptureDeviceNV")) == NULL) || r;
- r = ((glXReleaseVideoCaptureDeviceNV = (PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoCaptureDeviceNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_video_capture */
-
-#ifdef GLX_NV_video_output
-
-static GLboolean _glewInit_GLX_NV_video_output (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r;
- r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r;
- r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r;
- r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r;
- r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r;
- r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_NV_video_output */
-
-#ifdef GLX_OML_swap_method
-
-#endif /* GLX_OML_swap_method */
-
-#ifdef GLX_OML_sync_control
-
-static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r;
- r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r;
- r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r;
- r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r;
- r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_OML_sync_control */
-
-#ifdef GLX_SGIS_blended_overlay
-
-#endif /* GLX_SGIS_blended_overlay */
-
-#ifdef GLX_SGIS_color_range
-
-#endif /* GLX_SGIS_color_range */
-
-#ifdef GLX_SGIS_multisample
-
-#endif /* GLX_SGIS_multisample */
-
-#ifdef GLX_SGIS_shared_multisample
-
-#endif /* GLX_SGIS_shared_multisample */
-
-#ifdef GLX_SGIX_fbconfig
-
-static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r;
- r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r;
- r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r;
- r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r;
- r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r;
- r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_fbconfig */
-
-#ifdef GLX_SGIX_hyperpipe
-
-static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r;
- r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r;
- r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r;
- r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r;
- r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r;
- r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r;
- r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r;
- r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_hyperpipe */
-
-#ifdef GLX_SGIX_pbuffer
-
-static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r;
- r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r;
- r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r;
- r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r;
- r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_pbuffer */
-
-#ifdef GLX_SGIX_swap_barrier
-
-static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r;
- r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_swap_barrier */
-
-#ifdef GLX_SGIX_swap_group
-
-static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_swap_group */
-
-#ifdef GLX_SGIX_video_resize
-
-static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r;
- r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r;
- r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r;
- r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r;
- r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGIX_video_resize */
-
-#ifdef GLX_SGIX_visual_select_group
-
-#endif /* GLX_SGIX_visual_select_group */
-
-#ifdef GLX_SGI_cushion
-
-static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGI_cushion */
-
-#ifdef GLX_SGI_make_current_read
-
-static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r;
- r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGI_make_current_read */
-
-#ifdef GLX_SGI_swap_control
-
-static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGI_swap_control */
-
-#ifdef GLX_SGI_video_sync
-
-static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r;
- r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SGI_video_sync */
-
-#ifdef GLX_SUN_get_transparent_index
-
-static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SUN_get_transparent_index */
-
-#ifdef GLX_SUN_video_resize
-
-static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r;
- r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r;
-
- return r;
-}
-
-#endif /* GLX_SUN_video_resize */
-
-/* ------------------------------------------------------------------------ */
-
-GLboolean glxewGetExtension (const char* name)
-{
- const GLubyte* start;
- const GLubyte* end;
-
- if (glXGetCurrentDisplay == NULL) return GL_FALSE;
- start = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
- if (0 == start) return GL_FALSE;
- end = start + _glewStrLen(start);
- return _glewSearchExtension(name, start, end);
-}
-
-GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST)
-{
- int major, minor;
- const GLubyte* extStart;
- const GLubyte* extEnd;
- /* initialize core GLX 1.2 */
- if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY;
- /* initialize flags */
- CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE;
- CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE;
- CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE;
- CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE;
- CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE;
- /* query GLX version */
- glXQueryVersion(glXGetCurrentDisplay(), &major, &minor);
- if (major == 1 && minor <= 3)
- {
- switch (minor)
- {
- case 3:
- CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
- break;
- case 2:
- CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE;
- CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE;
- break;
- default:
- return GLEW_ERROR_GLX_VERSION_11_ONLY;
- break;
- }
- }
- /* query GLX extension string */
- extStart = 0;
- if (glXGetCurrentDisplay != NULL)
- extStart = (const GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS);
- if (extStart == 0)
- extStart = (const GLubyte *)"";
- extEnd = extStart + _glewStrLen(extStart);
- /* initialize extensions */
-#ifdef GLX_VERSION_1_3
- if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_VERSION_1_3 */
-#ifdef GLX_3DFX_multisample
- CONST_CAST(GLXEW_3DFX_multisample) = _glewSearchExtension("GLX_3DFX_multisample", extStart, extEnd);
-#endif /* GLX_3DFX_multisample */
-#ifdef GLX_AMD_gpu_association
- CONST_CAST(GLXEW_AMD_gpu_association) = _glewSearchExtension("GLX_AMD_gpu_association", extStart, extEnd);
- if (glewExperimental || GLXEW_AMD_gpu_association) CONST_CAST(GLXEW_AMD_gpu_association) = !_glewInit_GLX_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_AMD_gpu_association */
-#ifdef GLX_ARB_create_context
- CONST_CAST(GLXEW_ARB_create_context) = _glewSearchExtension("GLX_ARB_create_context", extStart, extEnd);
- if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_ARB_create_context */
-#ifdef GLX_ARB_create_context_profile
- CONST_CAST(GLXEW_ARB_create_context_profile) = _glewSearchExtension("GLX_ARB_create_context_profile", extStart, extEnd);
-#endif /* GLX_ARB_create_context_profile */
-#ifdef GLX_ARB_create_context_robustness
- CONST_CAST(GLXEW_ARB_create_context_robustness) = _glewSearchExtension("GLX_ARB_create_context_robustness", extStart, extEnd);
-#endif /* GLX_ARB_create_context_robustness */
-#ifdef GLX_ARB_fbconfig_float
- CONST_CAST(GLXEW_ARB_fbconfig_float) = _glewSearchExtension("GLX_ARB_fbconfig_float", extStart, extEnd);
-#endif /* GLX_ARB_fbconfig_float */
-#ifdef GLX_ARB_framebuffer_sRGB
- CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = _glewSearchExtension("GLX_ARB_framebuffer_sRGB", extStart, extEnd);
-#endif /* GLX_ARB_framebuffer_sRGB */
-#ifdef GLX_ARB_get_proc_address
- CONST_CAST(GLXEW_ARB_get_proc_address) = _glewSearchExtension("GLX_ARB_get_proc_address", extStart, extEnd);
-#endif /* GLX_ARB_get_proc_address */
-#ifdef GLX_ARB_multisample
- CONST_CAST(GLXEW_ARB_multisample) = _glewSearchExtension("GLX_ARB_multisample", extStart, extEnd);
-#endif /* GLX_ARB_multisample */
-#ifdef GLX_ARB_robustness_application_isolation
- CONST_CAST(GLXEW_ARB_robustness_application_isolation) = _glewSearchExtension("GLX_ARB_robustness_application_isolation", extStart, extEnd);
-#endif /* GLX_ARB_robustness_application_isolation */
-#ifdef GLX_ARB_robustness_share_group_isolation
- CONST_CAST(GLXEW_ARB_robustness_share_group_isolation) = _glewSearchExtension("GLX_ARB_robustness_share_group_isolation", extStart, extEnd);
-#endif /* GLX_ARB_robustness_share_group_isolation */
-#ifdef GLX_ARB_vertex_buffer_object
- CONST_CAST(GLXEW_ARB_vertex_buffer_object) = _glewSearchExtension("GLX_ARB_vertex_buffer_object", extStart, extEnd);
-#endif /* GLX_ARB_vertex_buffer_object */
-#ifdef GLX_ATI_pixel_format_float
- CONST_CAST(GLXEW_ATI_pixel_format_float) = _glewSearchExtension("GLX_ATI_pixel_format_float", extStart, extEnd);
-#endif /* GLX_ATI_pixel_format_float */
-#ifdef GLX_ATI_render_texture
- CONST_CAST(GLXEW_ATI_render_texture) = _glewSearchExtension("GLX_ATI_render_texture", extStart, extEnd);
- if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_ATI_render_texture */
-#ifdef GLX_EXT_buffer_age
- CONST_CAST(GLXEW_EXT_buffer_age) = _glewSearchExtension("GLX_EXT_buffer_age", extStart, extEnd);
-#endif /* GLX_EXT_buffer_age */
-#ifdef GLX_EXT_create_context_es2_profile
- CONST_CAST(GLXEW_EXT_create_context_es2_profile) = _glewSearchExtension("GLX_EXT_create_context_es2_profile", extStart, extEnd);
-#endif /* GLX_EXT_create_context_es2_profile */
-#ifdef GLX_EXT_create_context_es_profile
- CONST_CAST(GLXEW_EXT_create_context_es_profile) = _glewSearchExtension("GLX_EXT_create_context_es_profile", extStart, extEnd);
-#endif /* GLX_EXT_create_context_es_profile */
-#ifdef GLX_EXT_fbconfig_packed_float
- CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = _glewSearchExtension("GLX_EXT_fbconfig_packed_float", extStart, extEnd);
-#endif /* GLX_EXT_fbconfig_packed_float */
-#ifdef GLX_EXT_framebuffer_sRGB
- CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = _glewSearchExtension("GLX_EXT_framebuffer_sRGB", extStart, extEnd);
-#endif /* GLX_EXT_framebuffer_sRGB */
-#ifdef GLX_EXT_import_context
- CONST_CAST(GLXEW_EXT_import_context) = _glewSearchExtension("GLX_EXT_import_context", extStart, extEnd);
- if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_EXT_import_context */
-#ifdef GLX_EXT_scene_marker
- CONST_CAST(GLXEW_EXT_scene_marker) = _glewSearchExtension("GLX_EXT_scene_marker", extStart, extEnd);
-#endif /* GLX_EXT_scene_marker */
-#ifdef GLX_EXT_swap_control
- CONST_CAST(GLXEW_EXT_swap_control) = _glewSearchExtension("GLX_EXT_swap_control", extStart, extEnd);
- if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_EXT_swap_control */
-#ifdef GLX_EXT_swap_control_tear
- CONST_CAST(GLXEW_EXT_swap_control_tear) = _glewSearchExtension("GLX_EXT_swap_control_tear", extStart, extEnd);
-#endif /* GLX_EXT_swap_control_tear */
-#ifdef GLX_EXT_texture_from_pixmap
- CONST_CAST(GLXEW_EXT_texture_from_pixmap) = _glewSearchExtension("GLX_EXT_texture_from_pixmap", extStart, extEnd);
- if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_EXT_texture_from_pixmap */
-#ifdef GLX_EXT_visual_info
- CONST_CAST(GLXEW_EXT_visual_info) = _glewSearchExtension("GLX_EXT_visual_info", extStart, extEnd);
-#endif /* GLX_EXT_visual_info */
-#ifdef GLX_EXT_visual_rating
- CONST_CAST(GLXEW_EXT_visual_rating) = _glewSearchExtension("GLX_EXT_visual_rating", extStart, extEnd);
-#endif /* GLX_EXT_visual_rating */
-#ifdef GLX_INTEL_swap_event
- CONST_CAST(GLXEW_INTEL_swap_event) = _glewSearchExtension("GLX_INTEL_swap_event", extStart, extEnd);
-#endif /* GLX_INTEL_swap_event */
-#ifdef GLX_MESA_agp_offset
- CONST_CAST(GLXEW_MESA_agp_offset) = _glewSearchExtension("GLX_MESA_agp_offset", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_agp_offset */
-#ifdef GLX_MESA_copy_sub_buffer
- CONST_CAST(GLXEW_MESA_copy_sub_buffer) = _glewSearchExtension("GLX_MESA_copy_sub_buffer", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_copy_sub_buffer */
-#ifdef GLX_MESA_pixmap_colormap
- CONST_CAST(GLXEW_MESA_pixmap_colormap) = _glewSearchExtension("GLX_MESA_pixmap_colormap", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_pixmap_colormap */
-#ifdef GLX_MESA_release_buffers
- CONST_CAST(GLXEW_MESA_release_buffers) = _glewSearchExtension("GLX_MESA_release_buffers", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_release_buffers */
-#ifdef GLX_MESA_set_3dfx_mode
- CONST_CAST(GLXEW_MESA_set_3dfx_mode) = _glewSearchExtension("GLX_MESA_set_3dfx_mode", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_set_3dfx_mode */
-#ifdef GLX_MESA_swap_control
- CONST_CAST(GLXEW_MESA_swap_control) = _glewSearchExtension("GLX_MESA_swap_control", extStart, extEnd);
- if (glewExperimental || GLXEW_MESA_swap_control) CONST_CAST(GLXEW_MESA_swap_control) = !_glewInit_GLX_MESA_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_MESA_swap_control */
-#ifdef GLX_NV_copy_image
- CONST_CAST(GLXEW_NV_copy_image) = _glewSearchExtension("GLX_NV_copy_image", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_copy_image */
-#ifdef GLX_NV_float_buffer
- CONST_CAST(GLXEW_NV_float_buffer) = _glewSearchExtension("GLX_NV_float_buffer", extStart, extEnd);
-#endif /* GLX_NV_float_buffer */
-#ifdef GLX_NV_multisample_coverage
- CONST_CAST(GLXEW_NV_multisample_coverage) = _glewSearchExtension("GLX_NV_multisample_coverage", extStart, extEnd);
-#endif /* GLX_NV_multisample_coverage */
-#ifdef GLX_NV_present_video
- CONST_CAST(GLXEW_NV_present_video) = _glewSearchExtension("GLX_NV_present_video", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_present_video */
-#ifdef GLX_NV_swap_group
- CONST_CAST(GLXEW_NV_swap_group) = _glewSearchExtension("GLX_NV_swap_group", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_swap_group */
-#ifdef GLX_NV_vertex_array_range
- CONST_CAST(GLXEW_NV_vertex_array_range) = _glewSearchExtension("GLX_NV_vertex_array_range", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_vertex_array_range */
-#ifdef GLX_NV_video_capture
- CONST_CAST(GLXEW_NV_video_capture) = _glewSearchExtension("GLX_NV_video_capture", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_video_capture) CONST_CAST(GLXEW_NV_video_capture) = !_glewInit_GLX_NV_video_capture(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_video_capture */
-#ifdef GLX_NV_video_output
- CONST_CAST(GLXEW_NV_video_output) = _glewSearchExtension("GLX_NV_video_output", extStart, extEnd);
- if (glewExperimental || GLXEW_NV_video_output) CONST_CAST(GLXEW_NV_video_output) = !_glewInit_GLX_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_NV_video_output */
-#ifdef GLX_OML_swap_method
- CONST_CAST(GLXEW_OML_swap_method) = _glewSearchExtension("GLX_OML_swap_method", extStart, extEnd);
-#endif /* GLX_OML_swap_method */
-#ifdef GLX_OML_sync_control
- CONST_CAST(GLXEW_OML_sync_control) = _glewSearchExtension("GLX_OML_sync_control", extStart, extEnd);
- if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_OML_sync_control */
-#ifdef GLX_SGIS_blended_overlay
- CONST_CAST(GLXEW_SGIS_blended_overlay) = _glewSearchExtension("GLX_SGIS_blended_overlay", extStart, extEnd);
-#endif /* GLX_SGIS_blended_overlay */
-#ifdef GLX_SGIS_color_range
- CONST_CAST(GLXEW_SGIS_color_range) = _glewSearchExtension("GLX_SGIS_color_range", extStart, extEnd);
-#endif /* GLX_SGIS_color_range */
-#ifdef GLX_SGIS_multisample
- CONST_CAST(GLXEW_SGIS_multisample) = _glewSearchExtension("GLX_SGIS_multisample", extStart, extEnd);
-#endif /* GLX_SGIS_multisample */
-#ifdef GLX_SGIS_shared_multisample
- CONST_CAST(GLXEW_SGIS_shared_multisample) = _glewSearchExtension("GLX_SGIS_shared_multisample", extStart, extEnd);
-#endif /* GLX_SGIS_shared_multisample */
-#ifdef GLX_SGIX_fbconfig
- CONST_CAST(GLXEW_SGIX_fbconfig) = _glewSearchExtension("GLX_SGIX_fbconfig", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_fbconfig */
-#ifdef GLX_SGIX_hyperpipe
- CONST_CAST(GLXEW_SGIX_hyperpipe) = _glewSearchExtension("GLX_SGIX_hyperpipe", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_hyperpipe */
-#ifdef GLX_SGIX_pbuffer
- CONST_CAST(GLXEW_SGIX_pbuffer) = _glewSearchExtension("GLX_SGIX_pbuffer", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_pbuffer */
-#ifdef GLX_SGIX_swap_barrier
- CONST_CAST(GLXEW_SGIX_swap_barrier) = _glewSearchExtension("GLX_SGIX_swap_barrier", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_swap_barrier */
-#ifdef GLX_SGIX_swap_group
- CONST_CAST(GLXEW_SGIX_swap_group) = _glewSearchExtension("GLX_SGIX_swap_group", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_swap_group */
-#ifdef GLX_SGIX_video_resize
- CONST_CAST(GLXEW_SGIX_video_resize) = _glewSearchExtension("GLX_SGIX_video_resize", extStart, extEnd);
- if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGIX_video_resize */
-#ifdef GLX_SGIX_visual_select_group
- CONST_CAST(GLXEW_SGIX_visual_select_group) = _glewSearchExtension("GLX_SGIX_visual_select_group", extStart, extEnd);
-#endif /* GLX_SGIX_visual_select_group */
-#ifdef GLX_SGI_cushion
- CONST_CAST(GLXEW_SGI_cushion) = _glewSearchExtension("GLX_SGI_cushion", extStart, extEnd);
- if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGI_cushion */
-#ifdef GLX_SGI_make_current_read
- CONST_CAST(GLXEW_SGI_make_current_read) = _glewSearchExtension("GLX_SGI_make_current_read", extStart, extEnd);
- if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGI_make_current_read */
-#ifdef GLX_SGI_swap_control
- CONST_CAST(GLXEW_SGI_swap_control) = _glewSearchExtension("GLX_SGI_swap_control", extStart, extEnd);
- if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGI_swap_control */
-#ifdef GLX_SGI_video_sync
- CONST_CAST(GLXEW_SGI_video_sync) = _glewSearchExtension("GLX_SGI_video_sync", extStart, extEnd);
- if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SGI_video_sync */
-#ifdef GLX_SUN_get_transparent_index
- CONST_CAST(GLXEW_SUN_get_transparent_index) = _glewSearchExtension("GLX_SUN_get_transparent_index", extStart, extEnd);
- if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SUN_get_transparent_index */
-#ifdef GLX_SUN_video_resize
- CONST_CAST(GLXEW_SUN_video_resize) = _glewSearchExtension("GLX_SUN_video_resize", extStart, extEnd);
- if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT);
-#endif /* GLX_SUN_video_resize */
-
- return GLEW_OK;
-}
-
-#endif /* !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) */
-
-/* ------------------------------------------------------------------------ */
-
-const GLubyte * GLEWAPIENTRY glewGetErrorString (GLenum error)
-{
- static const GLubyte* _glewErrorString[] =
- {
- (const GLubyte*)"No error",
- (const GLubyte*)"Missing GL version",
- (const GLubyte*)"GL 1.1 and up are not supported",
- (const GLubyte*)"GLX 1.2 and up are not supported",
- (const GLubyte*)"Unknown error"
- };
- const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1;
- return _glewErrorString[(int)error > max_error ? max_error : (int)error];
-}
-
-const GLubyte * GLEWAPIENTRY glewGetString (GLenum name)
-{
- static const GLubyte* _glewString[] =
- {
- (const GLubyte*)NULL,
- (const GLubyte*)"1.10.0",
- (const GLubyte*)"1",
- (const GLubyte*)"10",
- (const GLubyte*)"0"
- };
- const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1;
- return _glewString[(int)name > max_string ? 0 : (int)name];
-}
-
-/* ------------------------------------------------------------------------ */
-
-GLboolean glewExperimental = GL_FALSE;
-
-#if !defined(GLEW_MX)
-
-#if defined(_WIN32)
-extern GLenum GLEWAPIENTRY wglewContextInit (void);
-#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX))
-extern GLenum GLEWAPIENTRY glxewContextInit (void);
-#endif /* _WIN32 */
-
-#ifdef GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-GLboolean GLEWAPIENTRY glewXInit(void)
-{
- GLboolean r = GL_FALSE;
- r = ((glXGetProcAddressARB = (PFNGLXGETPROCADDRESSARBPROC)dlglXGetProcAddressARB((const GLubyte*)"glXGetProcAddressARB")) == NULL) || r;
- r = ((glXQueryExtension = (PFNGLXQUERYEXTENSION)dlglXGetProcAddressARB((const GLubyte*)"glXQueryExtension")) == NULL) || r;
- r = ((glXQueryVersion = (PFNGLXQUERYVERSION)dlglXGetProcAddressARB((const GLubyte*)"glXQueryVersion")) == NULL) || r;
- r = ((glXGetConfig = (PFNGLXGETCONFIG)dlglXGetProcAddressARB((const GLubyte*)"glXGetConfig")) == NULL) || r;
- r = ((glXChooseVisual = (PFNGLXCHOOSEVISUAL)dlglXGetProcAddressARB((const GLubyte*)"glXChooseVisual")) == NULL) || r;
- r = ((glXCreateContext = (PFNGLXCREATECONTEXT)dlglXGetProcAddressARB((const GLubyte*)"glXCreateContext")) == NULL) || r;
- r = ((glXDestroyContext = (PFNGLXDESTROYCONTEXT)dlglXGetProcAddressARB((const GLubyte*)"glXDestroyContext")) == NULL) || r;
- r = ((glXDestroyContext = (PFNGLXDESTROYCONTEXT)dlglXGetProcAddressARB((const GLubyte*)"glXDestroyContext")) == NULL) || r;
- r = ((glXIsDirect = (PFNGLXISDIRECT)dlglXGetProcAddressARB((const GLubyte*)"glXIsDirect")) == NULL) || r;
- r = ((glXMakeCurrent = (PFNGLXMAKECURRENT)dlglXGetProcAddressARB((const GLubyte*)"glXMakeCurrent")) == NULL) || r;
- r = ((glXQueryExtensionsString = (PFNGLXQUERYEXTENSIONSSTRING)dlglXGetProcAddressARB((const GLubyte*)"glXQueryExtensionsString")) == NULL) || r;
- r = ((glXGetClientString = (PFNGLXGETCLIENTSTRING)dlglXGetProcAddressARB((const GLubyte*)"glXGetClientString")) == NULL) || r;
- r = ((glXQueryServerString = (PFNGLXQUERYSERVERSTRING)dlglXGetProcAddressARB((const GLubyte*)"glXQueryServerString")) == NULL) || r;
- r = ((glXSwapBuffers = (PFNGLXSWAPBUFFERS)dlglXGetProcAddressARB((const GLubyte*)"glXSwapBuffers")) == NULL) || r;
- //glxewContextInit();
- _glewInit_GLX_VERSION_1_3();
-
- if (r==0)
- {
- printf("glewXInit dynamically loaded using dlopen/dlsym OK\n");
- }
- return r;
-}
-#endif //GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS
-
-#ifdef GLEW_INIT_OPENGL11_FUNCTIONS
-
-PFNGLACCUMPROC __glewAccum = NULL;
-PFNGLALPHAFUNCPROC __glewAlphaFunc = NULL;
-PFNGLARETEXTURESRESIDENTPROC __glewAreTexturesResident = NULL;
-PFNGLARRAYELEMENTPROC __glewArrayElement = NULL;
-PFNGLBEGINPROC __glewBegin = NULL;
-PFNGLBINDTEXTUREPROC __glewBindTexture = NULL;
-PFNGLBITMAPPROC __glewBitmap = NULL;
-PFNGLBLENDFUNCPROC __glewBlendFunc = NULL;
-PFNGLCALLLISTPROC __glewCallList = NULL;
-PFNGLCALLLISTSPROC __glewCallLists = NULL;
-PFNGLCLEARPROC __glewClear = NULL;
-PFNGLCLEARACCUMPROC __glewClearAccum = NULL;
-PFNGLCLEARCOLORPROC __glewClearColor = NULL;
-PFNGLCLEARDEPTHPROC __glewClearDepth = NULL;
-PFNGLCLEARINDEXPROC __glewClearIndex = NULL;
-PFNGLCLEARSTENCILPROC __glewClearStencil = NULL;
-PFNGLCLIPPLANEPROC __glewClipPlane = NULL;
-PFNGLCOLOR3BPROC __glewColor3b = NULL;
-PFNGLCOLOR3BVPROC __glewColor3bv = NULL;
-PFNGLCOLOR3DPROC __glewColor3d = NULL;
-PFNGLCOLOR3DVPROC __glewColor3dv = NULL;
-PFNGLCOLOR3FPROC __glewColor3f = NULL;
-PFNGLCOLOR3FVPROC __glewColor3fv = NULL;
-PFNGLCOLOR3IPROC __glewColor3i = NULL;
-PFNGLCOLOR3IVPROC __glewColor3iv = NULL;
-PFNGLCOLOR3SPROC __glewColor3s = NULL;
-PFNGLCOLOR3SVPROC __glewColor3sv = NULL;
-PFNGLCOLOR3UBPROC __glewColor3ub = NULL;
-PFNGLCOLOR3UBVPROC __glewColor3ubv = NULL;
-PFNGLCOLOR3UIPROC __glewColor3ui = NULL;
-PFNGLCOLOR3UIVPROC __glewColor3uiv = NULL;
-PFNGLCOLOR3USPROC __glewColor3us = NULL;
-PFNGLCOLOR3USVPROC __glewColor3usv = NULL;
-PFNGLCOLOR4BPROC __glewColor4b = NULL;
-PFNGLCOLOR4BVPROC __glewColor4bv = NULL;
-PFNGLCOLOR4DPROC __glewColor4d = NULL;
-PFNGLCOLOR4DVPROC __glewColor4dv = NULL;
-PFNGLCOLOR4FPROC __glewColor4f = NULL;
-PFNGLCOLOR4FVPROC __glewColor4fv = NULL;
-PFNGLCOLOR4IPROC __glewColor4i = NULL;
-PFNGLCOLOR4IVPROC __glewColor4iv = NULL;
-PFNGLCOLOR4SPROC __glewColor4s = NULL;
-PFNGLCOLOR4SVPROC __glewColor4sv = NULL;
-PFNGLCOLOR4UBPROC __glewColor4ub = NULL;
-PFNGLCOLOR4UBVPROC __glewColor4ubv = NULL;
-PFNGLCOLOR4UIPROC __glewColor4ui = NULL;
-PFNGLCOLOR4UIVPROC __glewColor4uiv = NULL;
-PFNGLCOLOR4USPROC __glewColor4us = NULL;
-PFNGLCOLOR4USVPROC __glewColor4usv = NULL;
-PFNGLCOLORMASKPROC __glewColorMask = NULL;
-PFNGLCOLORMATERIALPROC __glewColorMaterial = NULL;
-PFNGLCOLORPOINTERPROC __glewColorPointer = NULL;
-PFNGLCOPYPIXELSPROC __glewCopyPixels = NULL;
-PFNGLCOPYTEXIMAGE1DPROC __glewCopyTexImage1D = NULL;
-PFNGLCOPYTEXIMAGE2DPROC __glewCopyTexImage2D = NULL;
-PFNGLCOPYTEXSUBIMAGE1DPROC __glewCopyTexSubImage1D = NULL;
-PFNGLCOPYTEXSUBIMAGE2DPROC __glewCopyTexSubImage2D = NULL;
-PFNGLCULLFACEPROC __glewCullFace = NULL;
-PFNGLDELETELISTSPROC __glewDeleteLists = NULL;
-PFNGLDELETETEXTURESPROC __glewDeleteTextures = NULL;
-PFNGLDEPTHFUNCPROC __glewDepthFunc = NULL;
-PFNGLDEPTHMASKPROC __glewDepthMask = NULL;
-PFNGLDEPTHRANGEPROC __glewDepthRange = NULL;
-PFNGLDISABLEPROC __glewDisable = NULL;
-PFNGLDISABLECLIENTSTATEPROC __glewDisableClientState = NULL;
-PFNGLDRAWARRAYSPROC __glewDrawArrays = NULL;
-PFNGLDRAWBUFFERPROC __glewDrawBuffer = NULL;
-PFNGLDRAWELEMENTSPROC __glewDrawElements = NULL;
-PFNGLDRAWPIXELSPROC __glewDrawPixels = NULL;
-PFNGLEDGEFLAGPROC __glewEdgeFlag = NULL;
-PFNGLEDGEFLAGPOINTERPROC __glewEdgeFlagPointer = NULL;
-PFNGLEDGEFLAGVPROC __glewEdgeFlagv = NULL;
-PFNGLENABLEPROC __glewEnable = NULL;
-PFNGLENABLECLIENTSTATEPROC __glewEnableClientState = NULL;
-PFNGLENDPROC __glewEnd = NULL;
-PFNGLENDLISTPROC __glewEndList = NULL;
-PFNGLEVALCOORD1DPROC __glewEvalCoord1d = NULL;
-PFNGLEVALCOORD1DVPROC __glewEvalCoord1dv = NULL;
-PFNGLEVALCOORD1FPROC __glewEvalCoord1f = NULL;
-PFNGLEVALCOORD1FVPROC __glewEvalCoord1fv = NULL;
-PFNGLEVALCOORD2DPROC __glewEvalCoord2d = NULL;
-PFNGLEVALCOORD2DVPROC __glewEvalCoord2dv = NULL;
-PFNGLEVALCOORD2FPROC __glewEvalCoord2f = NULL;
-PFNGLEVALCOORD2FVPROC __glewEvalCoord2fv = NULL;
-PFNGLEVALMESH1PROC __glewEvalMesh1 = NULL;
-PFNGLEVALMESH2PROC __glewEvalMesh2 = NULL;
-PFNGLEVALPOINT1PROC __glewEvalPoint1 = NULL;
-PFNGLEVALPOINT2PROC __glewEvalPoint2 = NULL;
-PFNGLFEEDBACKBUFFERPROC __glewFeedbackBuffer = NULL;
-PFNGLFINISHPROC __glewFinish = NULL;
-PFNGLFLUSHPROC __glewFlush = NULL;
-PFNGLFOGFPROC __glewFogf = NULL;
-PFNGLFOGFVPROC __glewFogfv = NULL;
-PFNGLFOGIPROC __glewFogi = NULL;
-PFNGLFOGIVPROC __glewFogiv = NULL;
-PFNGLFRONTFACEPROC __glewFrontFace = NULL;
-PFNGLFRUSTUMPROC __glewFrustum = NULL;
-PFNGLGENLISTSPROC __glewGenLists = NULL;
-PFNGLGENTEXTURESPROC __glewGenTextures = NULL;
-PFNGLGETBOOLEANVPROC __glewGetBooleanv = NULL;
-PFNGLGETCLIPPLANEPROC __glewGetClipPlane = NULL;
-PFNGLGETDOUBLEVPROC __glewGetDoublev = NULL;
-PFNGLGETERRORPROC __glewGetError = NULL;
-PFNGLGETFLOATVPROC __glewGetFloatv = NULL;
-PFNGLGETINTEGERVPROC __glewGetIntegerv = NULL;
-PFNGLGETLIGHTFVPROC __glewGetLightfv = NULL;
-PFNGLGETLIGHTIVPROC __glewGetLightiv = NULL;
-PFNGLGETMAPDVPROC __glewGetMapdv = NULL;
-PFNGLGETMAPFVPROC __glewGetMapfv = NULL;
-PFNGLGETMAPIVPROC __glewGetMapiv = NULL;
-PFNGLGETMATERIALFVPROC __glewGetMaterialfv = NULL;
-PFNGLGETMATERIALIVPROC __glewGetMaterialiv = NULL;
-PFNGLGETPIXELMAPFVPROC __glewGetPixelMapfv = NULL;
-PFNGLGETPIXELMAPUIVPROC __glewGetPixelMapuiv = NULL;
-PFNGLGETPIXELMAPUSVPROC __glewGetPixelMapusv = NULL;
-PFNGLGETPOINTERVPROC __glewGetPointerv = NULL;
-PFNGLGETPOLYGONSTIPPLEPROC __glewGetPolygonStipple = NULL;
-PFNGLGETSTRINGPROC __glewGetString = NULL;
-PFNGLGETTEXENVFVPROC __glewGetTexEnvfv = NULL;
-PFNGLGETTEXENVIVPROC __glewGetTexEnviv = NULL;
-PFNGLGETTEXGENDVPROC __glewGetTexGendv = NULL;
-PFNGLGETTEXGENFVPROC __glewGetTexGenfv = NULL;
-PFNGLGETTEXGENIVPROC __glewGetTexGeniv = NULL;
-PFNGLGETTEXIMAGEPROC __glewGetTexImage = NULL;
-PFNGLGETTEXLEVELPARAMETERFVPROC __glewGetTexLevelParameterfv = NULL;
-PFNGLGETTEXLEVELPARAMETERIVPROC __glewGetTexLevelParameteriv = NULL;
-PFNGLGETTEXPARAMETERFVPROC __glewGetTexParameterfv = NULL;
-PFNGLGETTEXPARAMETERIVPROC __glewGetTexParameteriv = NULL;
-PFNGLHINTPROC __glewHint = NULL;
-PFNGLINDEXMASKPROC __glewIndexMask = NULL;
-PFNGLINDEXPOINTERPROC __glewIndexPointer = NULL;
-PFNGLINDEXDPROC __glewIndexd = NULL;
-PFNGLINDEXDVPROC __glewIndexdv = NULL;
-PFNGLINDEXFPROC __glewIndexf = NULL;
-PFNGLINDEXFVPROC __glewIndexfv = NULL;
-PFNGLINDEXIPROC __glewIndexi = NULL;
-PFNGLINDEXIVPROC __glewIndexiv = NULL;
-PFNGLINDEXSPROC __glewIndexs = NULL;
-PFNGLINDEXSVPROC __glewIndexsv = NULL;
-PFNGLINDEXUBPROC __glewIndexub = NULL;
-PFNGLINDEXUBVPROC __glewIndexubv = NULL;
-PFNGLINITNAMESPROC __glewInitNames = NULL;
-PFNGLINTERLEAVEDARRAYSPROC __glewInterleavedArrays = NULL;
-PFNGLISENABLEDPROC __glewIsEnabled = NULL;
-PFNGLISLISTPROC __glewIsList = NULL;
-PFNGLISTEXTUREPROC __glewIsTexture = NULL;
-PFNGLLIGHTMODELFPROC __glewLightModelf = NULL;
-PFNGLLIGHTMODELFVPROC __glewLightModelfv = NULL;
-PFNGLLIGHTMODELIPROC __glewLightModeli = NULL;
-PFNGLLIGHTMODELIVPROC __glewLightModeliv = NULL;
-PFNGLLIGHTFPROC __glewLightf = NULL;
-PFNGLLIGHTFVPROC __glewLightfv = NULL;
-PFNGLLIGHTIPROC __glewLighti = NULL;
-PFNGLLIGHTIVPROC __glewLightiv = NULL;
-PFNGLLINESTIPPLEPROC __glewLineStipple = NULL;
-PFNGLLINEWIDTHPROC __glewLineWidth = NULL;
-PFNGLLISTBASEPROC __glewListBase = NULL;
-PFNGLLOADIDENTITYPROC __glewLoadIdentity = NULL;
-PFNGLLOADMATRIXDPROC __glewLoadMatrixd = NULL;
-PFNGLLOADMATRIXFPROC __glewLoadMatrixf = NULL;
-PFNGLLOADNAMEPROC __glewLoadName = NULL;
-PFNGLLOGICOPPROC __glewLogicOp = NULL;
-PFNGLMAP1DPROC __glewMap1d = NULL;
-PFNGLMAP1FPROC __glewMap1f = NULL;
-PFNGLMAP2DPROC __glewMap2d = NULL;
-PFNGLMAP2FPROC __glewMap2f = NULL;
-PFNGLMAPGRID1DPROC __glewMapGrid1d = NULL;
-PFNGLMAPGRID1FPROC __glewMapGrid1f = NULL;
-PFNGLMAPGRID2DPROC __glewMapGrid2d = NULL;
-PFNGLMAPGRID2FPROC __glewMapGrid2f = NULL;
-PFNGLMATERIALFPROC __glewMaterialf = NULL;
-PFNGLMATERIALFVPROC __glewMaterialfv = NULL;
-PFNGLMATERIALIPROC __glewMateriali = NULL;
-PFNGLMATERIALIVPROC __glewMaterialiv = NULL;
-PFNGLMATRIXMODEPROC __glewMatrixMode = NULL;
-PFNGLMULTMATRIXDPROC __glewMultMatrixd = NULL;
-PFNGLMULTMATRIXFPROC __glewMultMatrixf = NULL;
-PFNGLNEWLISTPROC __glewNewList = NULL;
-PFNGLNORMAL3BPROC __glewNormal3b = NULL;
-PFNGLNORMAL3BVPROC __glewNormal3bv = NULL;
-PFNGLNORMAL3DPROC __glewNormal3d = NULL;
-PFNGLNORMAL3DVPROC __glewNormal3dv = NULL;
-PFNGLNORMAL3FPROC __glewNormal3f = NULL;
-PFNGLNORMAL3FVPROC __glewNormal3fv = NULL;
-PFNGLNORMAL3IPROC __glewNormal3i = NULL;
-PFNGLNORMAL3IVPROC __glewNormal3iv = NULL;
-PFNGLNORMAL3SPROC __glewNormal3s = NULL;
-PFNGLNORMAL3SVPROC __glewNormal3sv = NULL;
-PFNGLNORMALPOINTERPROC __glewNormalPointer = NULL;
-PFNGLORTHOPROC __glewOrtho = NULL;
-PFNGLPASSTHROUGHPROC __glewPassThrough = NULL;
-PFNGLPIXELMAPFVPROC __glewPixelMapfv = NULL;
-PFNGLPIXELMAPUIVPROC __glewPixelMapuiv = NULL;
-PFNGLPIXELMAPUSVPROC __glewPixelMapusv = NULL;
-PFNGLPIXELSTOREFPROC __glewPixelStoref = NULL;
-PFNGLPIXELSTOREIPROC __glewPixelStorei = NULL;
-PFNGLPIXELTRANSFERFPROC __glewPixelTransferf = NULL;
-PFNGLPIXELTRANSFERIPROC __glewPixelTransferi = NULL;
-PFNGLPIXELZOOMPROC __glewPixelZoom = NULL;
-PFNGLPOINTSIZEPROC __glewPointSize = NULL;
-PFNGLPOLYGONMODEPROC __glewPolygonMode = NULL;
-PFNGLPOLYGONOFFSETPROC __glewPolygonOffset = NULL;
-PFNGLPOLYGONSTIPPLEPROC __glewPolygonStipple = NULL;
-PFNGLPOPATTRIBPROC __glewPopAttrib = NULL;
-PFNGLPOPCLIENTATTRIBPROC __glewPopClientAttrib = NULL;
-PFNGLPOPMATRIXPROC __glewPopMatrix = NULL;
-PFNGLPOPNAMEPROC __glewPopName = NULL;
-PFNGLPRIORITIZETEXTURESPROC __glewPrioritizeTextures = NULL;
-PFNGLPUSHATTRIBPROC __glewPushAttrib = NULL;
-PFNGLPUSHCLIENTATTRIBPROC __glewPushClientAttrib = NULL;
-PFNGLPUSHMATRIXPROC __glewPushMatrix = NULL;
-PFNGLPUSHNAMEPROC __glewPushName = NULL;
-PFNGLRASTERPOS2DPROC __glewRasterPos2d = NULL;
-PFNGLRASTERPOS2DVPROC __glewRasterPos2dv = NULL;
-PFNGLRASTERPOS2FPROC __glewRasterPos2f = NULL;
-PFNGLRASTERPOS2FVPROC __glewRasterPos2fv = NULL;
-PFNGLRASTERPOS2IPROC __glewRasterPos2i = NULL;
-PFNGLRASTERPOS2IVPROC __glewRasterPos2iv = NULL;
-PFNGLRASTERPOS2SPROC __glewRasterPos2s = NULL;
-PFNGLRASTERPOS2SVPROC __glewRasterPos2sv = NULL;
-PFNGLRASTERPOS3DPROC __glewRasterPos3d = NULL;
-PFNGLRASTERPOS3DVPROC __glewRasterPos3dv = NULL;
-PFNGLRASTERPOS3FPROC __glewRasterPos3f = NULL;
-PFNGLRASTERPOS3FVPROC __glewRasterPos3fv = NULL;
-PFNGLRASTERPOS3IPROC __glewRasterPos3i = NULL;
-PFNGLRASTERPOS3IVPROC __glewRasterPos3iv = NULL;
-PFNGLRASTERPOS3SPROC __glewRasterPos3s = NULL;
-PFNGLRASTERPOS3SVPROC __glewRasterPos3sv = NULL;
-PFNGLRASTERPOS4DPROC __glewRasterPos4d = NULL;
-PFNGLRASTERPOS4DVPROC __glewRasterPos4dv = NULL;
-PFNGLRASTERPOS4FPROC __glewRasterPos4f = NULL;
-PFNGLRASTERPOS4FVPROC __glewRasterPos4fv = NULL;
-PFNGLRASTERPOS4IPROC __glewRasterPos4i = NULL;
-PFNGLRASTERPOS4IVPROC __glewRasterPos4iv = NULL;
-PFNGLRASTERPOS4SPROC __glewRasterPos4s = NULL;
-PFNGLRASTERPOS4SVPROC __glewRasterPos4sv = NULL;
-PFNGLREADBUFFERPROC __glewReadBuffer = NULL;
-PFNGLREADPIXELSPROC __glewReadPixels = NULL;
-PFNGLRECTDPROC __glewRectd = NULL;
-PFNGLRECTDVPROC __glewRectdv = NULL;
-PFNGLRECTFPROC __glewRectf = NULL;
-PFNGLRECTFVPROC __glewRectfv = NULL;
-PFNGLRECTIPROC __glewRecti = NULL;
-PFNGLRECTIVPROC __glewRectiv = NULL;
-PFNGLRECTSPROC __glewRects = NULL;
-PFNGLRECTSVPROC __glewRectsv = NULL;
-PFNGLRENDERMODEPROC __glewRenderMode = NULL;
-PFNGLROTATEDPROC __glewRotated = NULL;
-PFNGLROTATEFPROC __glewRotatef = NULL;
-PFNGLSCALEDPROC __glewScaled = NULL;
-PFNGLSCALEFPROC __glewScalef = NULL;
-PFNGLSCISSORPROC __glewScissor = NULL;
-PFNGLSELECTBUFFERPROC __glewSelectBuffer = NULL;
-PFNGLSHADEMODELPROC __glewShadeModel = NULL;
-PFNGLSTENCILFUNCPROC __glewStencilFunc = NULL;
-PFNGLSTENCILMASKPROC __glewStencilMask = NULL;
-PFNGLSTENCILOPPROC __glewStencilOp = NULL;
-PFNGLTEXCOORD1DPROC __glewTexCoord1d = NULL;
-PFNGLTEXCOORD1DVPROC __glewTexCoord1dv = NULL;
-PFNGLTEXCOORD1FPROC __glewTexCoord1f = NULL;
-PFNGLTEXCOORD1FVPROC __glewTexCoord1fv = NULL;
-PFNGLTEXCOORD1IPROC __glewTexCoord1i = NULL;
-PFNGLTEXCOORD1IVPROC __glewTexCoord1iv = NULL;
-PFNGLTEXCOORD1SPROC __glewTexCoord1s = NULL;
-PFNGLTEXCOORD1SVPROC __glewTexCoord1sv = NULL;
-PFNGLTEXCOORD2DPROC __glewTexCoord2d = NULL;
-PFNGLTEXCOORD2DVPROC __glewTexCoord2dv = NULL;
-PFNGLTEXCOORD2FPROC __glewTexCoord2f = NULL;
-PFNGLTEXCOORD2FVPROC __glewTexCoord2fv = NULL;
-PFNGLTEXCOORD2IPROC __glewTexCoord2i = NULL;
-PFNGLTEXCOORD2IVPROC __glewTexCoord2iv = NULL;
-PFNGLTEXCOORD2SPROC __glewTexCoord2s = NULL;
-PFNGLTEXCOORD2SVPROC __glewTexCoord2sv = NULL;
-PFNGLTEXCOORD3DPROC __glewTexCoord3d = NULL;
-PFNGLTEXCOORD3DVPROC __glewTexCoord3dv = NULL;
-PFNGLTEXCOORD3FPROC __glewTexCoord3f = NULL;
-PFNGLTEXCOORD3FVPROC __glewTexCoord3fv = NULL;
-PFNGLTEXCOORD3IPROC __glewTexCoord3i = NULL;
-PFNGLTEXCOORD3IVPROC __glewTexCoord3iv = NULL;
-PFNGLTEXCOORD3SPROC __glewTexCoord3s = NULL;
-PFNGLTEXCOORD3SVPROC __glewTexCoord3sv = NULL;
-PFNGLTEXCOORD4DPROC __glewTexCoord4d = NULL;
-PFNGLTEXCOORD4DVPROC __glewTexCoord4dv = NULL;
-PFNGLTEXCOORD4FPROC __glewTexCoord4f = NULL;
-PFNGLTEXCOORD4FVPROC __glewTexCoord4fv = NULL;
-PFNGLTEXCOORD4IPROC __glewTexCoord4i = NULL;
-PFNGLTEXCOORD4IVPROC __glewTexCoord4iv = NULL;
-PFNGLTEXCOORD4SPROC __glewTexCoord4s = NULL;
-PFNGLTEXCOORD4SVPROC __glewTexCoord4sv = NULL;
-PFNGLTEXCOORDPOINTERPROC __glewTexCoordPointer = NULL;
-PFNGLTEXENVFPROC __glewTexEnvf = NULL;
-PFNGLTEXENVFVPROC __glewTexEnvfv = NULL;
-PFNGLTEXENVIPROC __glewTexEnvi = NULL;
-PFNGLTEXENVIVPROC __glewTexEnviv = NULL;
-PFNGLTEXGENDPROC __glewTexGend = NULL;
-PFNGLTEXGENDVPROC __glewTexGendv = NULL;
-PFNGLTEXGENFPROC __glewTexGenf = NULL;
-PFNGLTEXGENFVPROC __glewTexGenfv = NULL;
-PFNGLTEXGENIPROC __glewTexGeni = NULL;
-PFNGLTEXGENIVPROC __glewTexGeniv = NULL;
-PFNGLTEXIMAGE1DPROC __glewTexImage1D = NULL;
-PFNGLTEXIMAGE2DPROC __glewTexImage2D = NULL;
-PFNGLTEXPARAMETERFPROC __glewTexParameterf = NULL;
-PFNGLTEXPARAMETERFVPROC __glewTexParameterfv = NULL;
-PFNGLTEXPARAMETERIPROC __glewTexParameteri = NULL;
-PFNGLTEXPARAMETERIVPROC __glewTexParameteriv = NULL;
-PFNGLTEXSUBIMAGE1DPROC __glewTexSubImage1D = NULL;
-PFNGLTEXSUBIMAGE2DPROC __glewTexSubImage2D = NULL;
-PFNGLTRANSLATEDPROC __glewTranslated = NULL;
-PFNGLTRANSLATEFPROC __glewTranslatef = NULL;
-PFNGLVERTEX2DPROC __glewVertex2d = NULL;
-PFNGLVERTEX2DVPROC __glewVertex2dv = NULL;
-PFNGLVERTEX2FPROC __glewVertex2f = NULL;
-PFNGLVERTEX2FVPROC __glewVertex2fv = NULL;
-PFNGLVERTEX2IPROC __glewVertex2i = NULL;
-PFNGLVERTEX2IVPROC __glewVertex2iv = NULL;
-PFNGLVERTEX2SPROC __glewVertex2s = NULL;
-PFNGLVERTEX2SVPROC __glewVertex2sv = NULL;
-PFNGLVERTEX3DPROC __glewVertex3d = NULL;
-PFNGLVERTEX3DVPROC __glewVertex3dv = NULL;
-PFNGLVERTEX3FPROC __glewVertex3f = NULL;
-PFNGLVERTEX3FVPROC __glewVertex3fv = NULL;
-PFNGLVERTEX3IPROC __glewVertex3i = NULL;
-PFNGLVERTEX3IVPROC __glewVertex3iv = NULL;
-PFNGLVERTEX3SPROC __glewVertex3s = NULL;
-PFNGLVERTEX3SVPROC __glewVertex3sv = NULL;
-PFNGLVERTEX4DPROC __glewVertex4d = NULL;
-PFNGLVERTEX4DVPROC __glewVertex4dv = NULL;
-PFNGLVERTEX4FPROC __glewVertex4f = NULL;
-PFNGLVERTEX4FVPROC __glewVertex4fv = NULL;
-PFNGLVERTEX4IPROC __glewVertex4i = NULL;
-PFNGLVERTEX4IVPROC __glewVertex4iv = NULL;
-PFNGLVERTEX4SPROC __glewVertex4s = NULL;
-PFNGLVERTEX4SVPROC __glewVertex4sv = NULL;
-PFNGLVERTEXPOINTERPROC __glewVertexPointer = NULL;
-PFNGLVIEWPORTPROC __glewViewport = NULL;
-
-#define fqn_from_convention(convention, fqn) \
- (const GLubyte*)fqn
-
-GLboolean GLEWAPIENTRY glewOpenGL11Init(void)
-{
- GLboolean r = GL_FALSE;
-
- r = ((glAccum = (PFNGLACCUMPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glAccum"))) == NULL) || r;
- r = ((glAlphaFunc = (PFNGLALPHAFUNCPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glAlphaFunc"))) == NULL) || r;
- r = ((glAreTexturesResident = (PFNGLARETEXTURESRESIDENTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glAreTexturesResident"))) == NULL) || r;
- r = ((glArrayElement = (PFNGLARRAYELEMENTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glArrayElement"))) == NULL) || r;
- r = ((glBegin = (PFNGLBEGINPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glBegin"))) == NULL) || r;
- r = ((glBindTexture = (PFNGLBINDTEXTUREPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glBindTexture"))) == NULL) || r;
- r = ((glBitmap = (PFNGLBITMAPPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glBitmap"))) == NULL) || r;
- r = ((glBlendFunc = (PFNGLBLENDFUNCPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glBlendFunc"))) == NULL) || r;
- r = ((glCallList = (PFNGLCALLLISTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCallList"))) == NULL) || r;
- r = ((glCallLists = (PFNGLCALLLISTSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCallLists"))) == NULL) || r;
- r = ((glClear = (PFNGLCLEARPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClear"))) == NULL) || r;
- r = ((glClearAccum = (PFNGLCLEARACCUMPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClearAccum"))) == NULL) || r;
- r = ((glClearColor = (PFNGLCLEARCOLORPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClearColor"))) == NULL) || r;
- r = ((glClearDepth = (PFNGLCLEARDEPTHPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClearDepth"))) == NULL) || r;
- r = ((glClearIndex = (PFNGLCLEARINDEXPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClearIndex"))) == NULL) || r;
- r = ((glClearStencil = (PFNGLCLEARSTENCILPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClearStencil"))) == NULL) || r;
- r = ((glClipPlane = (PFNGLCLIPPLANEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glClipPlane"))) == NULL) || r;
- r = ((glColor3b = (PFNGLCOLOR3BPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3b"))) == NULL) || r;
- r = ((glColor3bv = (PFNGLCOLOR3BVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3bv"))) == NULL) || r;
- r = ((glColor3d = (PFNGLCOLOR3DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3d"))) == NULL) || r;
- r = ((glColor3dv = (PFNGLCOLOR3DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3dv"))) == NULL) || r;
- r = ((glColor3f = (PFNGLCOLOR3FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3f"))) == NULL) || r;
- r = ((glColor3fv = (PFNGLCOLOR3FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3fv"))) == NULL) || r;
- r = ((glColor3i = (PFNGLCOLOR3IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3i"))) == NULL) || r;
- r = ((glColor3iv = (PFNGLCOLOR3IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3iv"))) == NULL) || r;
- r = ((glColor3s = (PFNGLCOLOR3SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3s"))) == NULL) || r;
- r = ((glColor3sv = (PFNGLCOLOR3SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3sv"))) == NULL) || r;
- r = ((glColor3ub = (PFNGLCOLOR3UBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3ub"))) == NULL) || r;
- r = ((glColor3ubv = (PFNGLCOLOR3UBVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3ubv"))) == NULL) || r;
- r = ((glColor3ui = (PFNGLCOLOR3UIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3ui"))) == NULL) || r;
- r = ((glColor3uiv = (PFNGLCOLOR3UIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3uiv"))) == NULL) || r;
- r = ((glColor3us = (PFNGLCOLOR3USPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3us"))) == NULL) || r;
- r = ((glColor3usv = (PFNGLCOLOR3USVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor3usv"))) == NULL) || r;
- r = ((glColor4b = (PFNGLCOLOR4BPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4b"))) == NULL) || r;
- r = ((glColor4bv = (PFNGLCOLOR4BVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4bv"))) == NULL) || r;
- r = ((glColor4d = (PFNGLCOLOR4DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4d"))) == NULL) || r;
- r = ((glColor4dv = (PFNGLCOLOR4DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4dv"))) == NULL) || r;
- r = ((glColor4f = (PFNGLCOLOR4FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4f"))) == NULL) || r;
- r = ((glColor4fv = (PFNGLCOLOR4FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4fv"))) == NULL) || r;
- r = ((glColor4i = (PFNGLCOLOR4IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4i"))) == NULL) || r;
- r = ((glColor4iv = (PFNGLCOLOR4IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4iv"))) == NULL) || r;
- r = ((glColor4s = (PFNGLCOLOR4SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4s"))) == NULL) || r;
- r = ((glColor4sv = (PFNGLCOLOR4SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4sv"))) == NULL) || r;
- r = ((glColor4ub = (PFNGLCOLOR4UBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4ub"))) == NULL) || r;
- r = ((glColor4ubv = (PFNGLCOLOR4UBVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4ubv"))) == NULL) || r;
- r = ((glColor4ui = (PFNGLCOLOR4UIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4ui"))) == NULL) || r;
- r = ((glColor4uiv = (PFNGLCOLOR4UIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4uiv"))) == NULL) || r;
- r = ((glColor4us = (PFNGLCOLOR4USPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4us"))) == NULL) || r;
- r = ((glColor4usv = (PFNGLCOLOR4USVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColor4usv"))) == NULL) || r;
- r = ((glColorMask = (PFNGLCOLORMASKPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColorMask"))) == NULL) || r;
- r = ((glColorMaterial = (PFNGLCOLORMATERIALPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColorMaterial"))) == NULL) || r;
- r = ((glColorPointer = (PFNGLCOLORPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glColorPointer"))) == NULL) || r;
- r = ((glCopyPixels = (PFNGLCOPYPIXELSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCopyPixels"))) == NULL) || r;
- r = ((glCopyTexImage1D = (PFNGLCOPYTEXIMAGE1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCopyTexImage1D"))) == NULL) || r;
- r = ((glCopyTexImage2D = (PFNGLCOPYTEXIMAGE2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCopyTexImage2D"))) == NULL) || r;
- r = ((glCopyTexSubImage1D = (PFNGLCOPYTEXSUBIMAGE1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCopyTexSubImage1D"))) == NULL) || r;
- r = ((glCopyTexSubImage2D = (PFNGLCOPYTEXSUBIMAGE2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCopyTexSubImage2D"))) == NULL) || r;
- r = ((glCullFace = (PFNGLCULLFACEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glCullFace"))) == NULL) || r;
- r = ((glDeleteLists = (PFNGLDELETELISTSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDeleteLists"))) == NULL) || r;
- r = ((glDeleteTextures = (PFNGLDELETETEXTURESPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDeleteTextures"))) == NULL) || r;
- r = ((glDepthFunc = (PFNGLDEPTHFUNCPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDepthFunc"))) == NULL) || r;
- r = ((glDepthMask = (PFNGLDEPTHMASKPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDepthMask"))) == NULL) || r;
- r = ((glDepthRange = (PFNGLDEPTHRANGEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDepthRange"))) == NULL) || r;
- r = ((glDisable = (PFNGLDISABLEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDisable"))) == NULL) || r;
- r = ((glDisableClientState = (PFNGLDISABLECLIENTSTATEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDisableClientState"))) == NULL) || r;
- r = ((glDrawArrays = (PFNGLDRAWARRAYSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDrawArrays"))) == NULL) || r;
- r = ((glDrawBuffer = (PFNGLDRAWBUFFERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDrawBuffer"))) == NULL) || r;
- r = ((glDrawElements = (PFNGLDRAWELEMENTSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDrawElements"))) == NULL) || r;
- r = ((glDrawPixels = (PFNGLDRAWPIXELSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glDrawPixels"))) == NULL) || r;
- r = ((glEdgeFlag = (PFNGLEDGEFLAGPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEdgeFlag"))) == NULL) || r;
- r = ((glEdgeFlagPointer = (PFNGLEDGEFLAGPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEdgeFlagPointer"))) == NULL) || r;
- r = ((glEdgeFlagv = (PFNGLEDGEFLAGVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEdgeFlagv"))) == NULL) || r;
- r = ((glEnable = (PFNGLENABLEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEnable"))) == NULL) || r;
- r = ((glEnableClientState = (PFNGLENABLECLIENTSTATEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEnableClientState"))) == NULL) || r;
- r = ((glEnd = (PFNGLENDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEnd"))) == NULL) || r;
- r = ((glEndList = (PFNGLENDLISTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEndList"))) == NULL) || r;
- r = ((glEvalCoord1d = (PFNGLEVALCOORD1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord1d"))) == NULL) || r;
- r = ((glEvalCoord1dv = (PFNGLEVALCOORD1DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord1dv"))) == NULL) || r;
- r = ((glEvalCoord1f = (PFNGLEVALCOORD1FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord1f"))) == NULL) || r;
- r = ((glEvalCoord1fv = (PFNGLEVALCOORD1FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord1fv"))) == NULL) || r;
- r = ((glEvalCoord2d = (PFNGLEVALCOORD2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord2d"))) == NULL) || r;
- r = ((glEvalCoord2dv = (PFNGLEVALCOORD2DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord2dv"))) == NULL) || r;
- r = ((glEvalCoord2f = (PFNGLEVALCOORD2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord2f"))) == NULL) || r;
- r = ((glEvalCoord2fv = (PFNGLEVALCOORD2FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalCoord2fv"))) == NULL) || r;
- r = ((glEvalMesh1 = (PFNGLEVALMESH1PROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalMesh1"))) == NULL) || r;
- r = ((glEvalMesh2 = (PFNGLEVALMESH2PROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalMesh2"))) == NULL) || r;
- r = ((glEvalPoint1 = (PFNGLEVALPOINT1PROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalPoint1"))) == NULL) || r;
- r = ((glEvalPoint2 = (PFNGLEVALPOINT2PROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glEvalPoint2"))) == NULL) || r;
- r = ((glFeedbackBuffer = (PFNGLFEEDBACKBUFFERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFeedbackBuffer"))) == NULL) || r;
- r = ((glFinish = (PFNGLFINISHPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFinish"))) == NULL) || r;
- r = ((glFlush = (PFNGLFLUSHPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFlush"))) == NULL) || r;
- r = ((glFogf = (PFNGLFOGFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFogf"))) == NULL) || r;
- r = ((glFogfv = (PFNGLFOGFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFogfv"))) == NULL) || r;
- r = ((glFogi = (PFNGLFOGIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFogi"))) == NULL) || r;
- r = ((glFogiv = (PFNGLFOGIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFogiv"))) == NULL) || r;
- r = ((glFrontFace = (PFNGLFRONTFACEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFrontFace"))) == NULL) || r;
- r = ((glFrustum = (PFNGLFRUSTUMPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glFrustum"))) == NULL) || r;
- r = ((glGenLists = (PFNGLGENLISTSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGenLists"))) == NULL) || r;
- r = ((glGenTextures = (PFNGLGENTEXTURESPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGenTextures"))) == NULL) || r;
- r = ((glGetBooleanv = (PFNGLGETBOOLEANVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetBooleanv"))) == NULL) || r;
- r = ((glGetClipPlane = (PFNGLGETCLIPPLANEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetClipPlane"))) == NULL) || r;
- r = ((glGetDoublev = (PFNGLGETDOUBLEVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetDoublev"))) == NULL) || r;
- r = ((glGetError = (PFNGLGETERRORPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetError"))) == NULL) || r;
- r = ((glGetFloatv = (PFNGLGETFLOATVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetFloatv"))) == NULL) || r;
- r = ((glGetIntegerv = (PFNGLGETINTEGERVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetIntegerv"))) == NULL) || r;
- r = ((glGetLightfv = (PFNGLGETLIGHTFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetLightfv"))) == NULL) || r;
- r = ((glGetLightiv = (PFNGLGETLIGHTIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetLightiv"))) == NULL) || r;
- r = ((glGetMapdv = (PFNGLGETMAPDVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetMapdv"))) == NULL) || r;
- r = ((glGetMapfv = (PFNGLGETMAPFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetMapfv"))) == NULL) || r;
- r = ((glGetMapiv = (PFNGLGETMAPIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetMapiv"))) == NULL) || r;
- r = ((glGetMaterialfv = (PFNGLGETMATERIALFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetMaterialfv"))) == NULL) || r;
- r = ((glGetMaterialiv = (PFNGLGETMATERIALIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetMaterialiv"))) == NULL) || r;
- r = ((glGetPixelMapfv = (PFNGLGETPIXELMAPFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetPixelMapfv"))) == NULL) || r;
- r = ((glGetPixelMapuiv = (PFNGLGETPIXELMAPUIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetPixelMapuiv"))) == NULL) || r;
- r = ((glGetPixelMapusv = (PFNGLGETPIXELMAPUSVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetPixelMapusv"))) == NULL) || r;
- r = ((glGetPointerv = (PFNGLGETPOINTERVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetPointerv"))) == NULL) || r;
- r = ((glGetPolygonStipple = (PFNGLGETPOLYGONSTIPPLEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetPolygonStipple"))) == NULL) || r;
- r = ((glGetString = (PFNGLGETSTRINGPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetString"))) == NULL) || r;
- r = ((glGetTexEnvfv = (PFNGLGETTEXENVFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexEnvfv"))) == NULL) || r;
- r = ((glGetTexEnviv = (PFNGLGETTEXENVIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexEnviv"))) == NULL) || r;
- r = ((glGetTexGendv = (PFNGLGETTEXGENDVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexGendv"))) == NULL) || r;
- r = ((glGetTexGenfv = (PFNGLGETTEXGENFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexGenfv"))) == NULL) || r;
- r = ((glGetTexGeniv = (PFNGLGETTEXGENIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexGeniv"))) == NULL) || r;
- r = ((glGetTexImage = (PFNGLGETTEXIMAGEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexImage"))) == NULL) || r;
- r = ((glGetTexLevelParameterfv = (PFNGLGETTEXLEVELPARAMETERFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexLevelParameterfv"))) == NULL) || r;
- r = ((glGetTexLevelParameteriv = (PFNGLGETTEXLEVELPARAMETERIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexLevelParameteriv"))) == NULL) || r;
- r = ((glGetTexParameterfv = (PFNGLGETTEXPARAMETERFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexParameterfv"))) == NULL) || r;
- r = ((glGetTexParameteriv = (PFNGLGETTEXPARAMETERIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glGetTexParameteriv"))) == NULL) || r;
- r = ((glHint = (PFNGLHINTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glHint"))) == NULL) || r;
- r = ((glIndexMask = (PFNGLINDEXMASKPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexMask"))) == NULL) || r;
- r = ((glIndexPointer = (PFNGLINDEXPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexPointer"))) == NULL) || r;
- r = ((glIndexd = (PFNGLINDEXDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexd"))) == NULL) || r;
- r = ((glIndexdv = (PFNGLINDEXDVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexdv"))) == NULL) || r;
- r = ((glIndexf = (PFNGLINDEXFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexf"))) == NULL) || r;
- r = ((glIndexfv = (PFNGLINDEXFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexfv"))) == NULL) || r;
- r = ((glIndexi = (PFNGLINDEXIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexi"))) == NULL) || r;
- r = ((glIndexiv = (PFNGLINDEXIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexiv"))) == NULL) || r;
- r = ((glIndexs = (PFNGLINDEXSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexs"))) == NULL) || r;
- r = ((glIndexsv = (PFNGLINDEXSVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexsv"))) == NULL) || r;
- r = ((glIndexub = (PFNGLINDEXUBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexub"))) == NULL) || r;
- r = ((glIndexubv = (PFNGLINDEXUBVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIndexubv"))) == NULL) || r;
- r = ((glInitNames = (PFNGLINITNAMESPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glInitNames"))) == NULL) || r;
- r = ((glInterleavedArrays = (PFNGLINTERLEAVEDARRAYSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glInterleavedArrays"))) == NULL) || r;
- r = ((glIsEnabled = (PFNGLISENABLEDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIsEnabled"))) == NULL) || r;
- r = ((glIsList = (PFNGLISLISTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIsList"))) == NULL) || r;
- r = ((glIsTexture = (PFNGLISTEXTUREPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glIsTexture"))) == NULL) || r;
- r = ((glLightModelf = (PFNGLLIGHTMODELFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightModelf"))) == NULL) || r;
- r = ((glLightModelfv = (PFNGLLIGHTMODELFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightModelfv"))) == NULL) || r;
- r = ((glLightModeli = (PFNGLLIGHTMODELIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightModeli"))) == NULL) || r;
- r = ((glLightModeliv = (PFNGLLIGHTMODELIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightModeliv"))) == NULL) || r;
- r = ((glLightf = (PFNGLLIGHTFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightf"))) == NULL) || r;
- r = ((glLightfv = (PFNGLLIGHTFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightfv"))) == NULL) || r;
- r = ((glLighti = (PFNGLLIGHTIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLighti"))) == NULL) || r;
- r = ((glLightiv = (PFNGLLIGHTIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLightiv"))) == NULL) || r;
- r = ((glLineStipple = (PFNGLLINESTIPPLEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLineStipple"))) == NULL) || r;
- r = ((glLineWidth = (PFNGLLINEWIDTHPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLineWidth"))) == NULL) || r;
- r = ((glListBase = (PFNGLLISTBASEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glListBase"))) == NULL) || r;
- r = ((glLoadIdentity = (PFNGLLOADIDENTITYPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLoadIdentity"))) == NULL) || r;
- r = ((glLoadMatrixd = (PFNGLLOADMATRIXDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLoadMatrixd"))) == NULL) || r;
- r = ((glLoadMatrixf = (PFNGLLOADMATRIXFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLoadMatrixf"))) == NULL) || r;
- r = ((glLoadName = (PFNGLLOADNAMEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLoadName"))) == NULL) || r;
- r = ((glLogicOp = (PFNGLLOGICOPPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glLogicOp"))) == NULL) || r;
- r = ((glMap1d = (PFNGLMAP1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMap1d"))) == NULL) || r;
- r = ((glMap1f = (PFNGLMAP1FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMap1f"))) == NULL) || r;
- r = ((glMap2d = (PFNGLMAP2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMap2d"))) == NULL) || r;
- r = ((glMap2f = (PFNGLMAP2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMap2f"))) == NULL) || r;
- r = ((glMapGrid1d = (PFNGLMAPGRID1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMapGrid1d"))) == NULL) || r;
- r = ((glMapGrid1f = (PFNGLMAPGRID1FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMapGrid1f"))) == NULL) || r;
- r = ((glMapGrid2d = (PFNGLMAPGRID2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMapGrid2d"))) == NULL) || r;
- r = ((glMapGrid2f = (PFNGLMAPGRID2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMapGrid2f"))) == NULL) || r;
- r = ((glMaterialf = (PFNGLMATERIALFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMaterialf"))) == NULL) || r;
- r = ((glMaterialfv = (PFNGLMATERIALFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMaterialfv"))) == NULL) || r;
- r = ((glMateriali = (PFNGLMATERIALIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMateriali"))) == NULL) || r;
- r = ((glMaterialiv = (PFNGLMATERIALIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMaterialiv"))) == NULL) || r;
- r = ((glMatrixMode = (PFNGLMATRIXMODEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMatrixMode"))) == NULL) || r;
- r = ((glMultMatrixd = (PFNGLMULTMATRIXDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMultMatrixd"))) == NULL) || r;
- r = ((glMultMatrixf = (PFNGLMULTMATRIXFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glMultMatrixf"))) == NULL) || r;
- r = ((glNewList = (PFNGLNEWLISTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNewList"))) == NULL) || r;
- r = ((glNormal3b = (PFNGLNORMAL3BPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3b"))) == NULL) || r;
- r = ((glNormal3bv = (PFNGLNORMAL3BVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3bv"))) == NULL) || r;
- r = ((glNormal3d = (PFNGLNORMAL3DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3d"))) == NULL) || r;
- r = ((glNormal3dv = (PFNGLNORMAL3DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3dv"))) == NULL) || r;
- r = ((glNormal3f = (PFNGLNORMAL3FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3f"))) == NULL) || r;
- r = ((glNormal3fv = (PFNGLNORMAL3FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3fv"))) == NULL) || r;
- r = ((glNormal3i = (PFNGLNORMAL3IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3i"))) == NULL) || r;
- r = ((glNormal3iv = (PFNGLNORMAL3IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3iv"))) == NULL) || r;
- r = ((glNormal3s = (PFNGLNORMAL3SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3s"))) == NULL) || r;
- r = ((glNormal3sv = (PFNGLNORMAL3SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormal3sv"))) == NULL) || r;
- r = ((glNormalPointer = (PFNGLNORMALPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glNormalPointer"))) == NULL) || r;
- r = ((glOrtho = (PFNGLORTHOPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glOrtho"))) == NULL) || r;
- r = ((glPassThrough = (PFNGLPASSTHROUGHPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPassThrough"))) == NULL) || r;
- r = ((glPixelMapfv = (PFNGLPIXELMAPFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelMapfv"))) == NULL) || r;
- r = ((glPixelMapuiv = (PFNGLPIXELMAPUIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelMapuiv"))) == NULL) || r;
- r = ((glPixelMapusv = (PFNGLPIXELMAPUSVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelMapusv"))) == NULL) || r;
- r = ((glPixelStoref = (PFNGLPIXELSTOREFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelStoref"))) == NULL) || r;
- r = ((glPixelStorei = (PFNGLPIXELSTOREIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelStorei"))) == NULL) || r;
- r = ((glPixelTransferf = (PFNGLPIXELTRANSFERFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelTransferf"))) == NULL) || r;
- r = ((glPixelTransferi = (PFNGLPIXELTRANSFERIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelTransferi"))) == NULL) || r;
- r = ((glPixelZoom = (PFNGLPIXELZOOMPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPixelZoom"))) == NULL) || r;
- r = ((glPointSize = (PFNGLPOINTSIZEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPointSize"))) == NULL) || r;
- r = ((glPolygonMode = (PFNGLPOLYGONMODEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPolygonMode"))) == NULL) || r;
- r = ((glPolygonOffset = (PFNGLPOLYGONOFFSETPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPolygonOffset"))) == NULL) || r;
- r = ((glPolygonStipple = (PFNGLPOLYGONSTIPPLEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPolygonStipple"))) == NULL) || r;
- r = ((glPopAttrib = (PFNGLPOPATTRIBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPopAttrib"))) == NULL) || r;
- r = ((glPopClientAttrib = (PFNGLPOPCLIENTATTRIBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPopClientAttrib"))) == NULL) || r;
- r = ((glPopMatrix = (PFNGLPOPMATRIXPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPopMatrix"))) == NULL) || r;
- r = ((glPopName = (PFNGLPOPNAMEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPopName"))) == NULL) || r;
- r = ((glPrioritizeTextures = (PFNGLPRIORITIZETEXTURESPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPrioritizeTextures"))) == NULL) || r;
- r = ((glPushAttrib = (PFNGLPUSHATTRIBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPushAttrib"))) == NULL) || r;
- r = ((glPushClientAttrib = (PFNGLPUSHCLIENTATTRIBPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPushClientAttrib"))) == NULL) || r;
- r = ((glPushMatrix = (PFNGLPUSHMATRIXPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPushMatrix"))) == NULL) || r;
- r = ((glPushName = (PFNGLPUSHNAMEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glPushName"))) == NULL) || r;
- r = ((glRasterPos2d = (PFNGLRASTERPOS2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2d"))) == NULL) || r;
- r = ((glRasterPos2dv = (PFNGLRASTERPOS2DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2dv"))) == NULL) || r;
- r = ((glRasterPos2f = (PFNGLRASTERPOS2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2f"))) == NULL) || r;
- r = ((glRasterPos2fv = (PFNGLRASTERPOS2FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2fv"))) == NULL) || r;
- r = ((glRasterPos2i = (PFNGLRASTERPOS2IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2i"))) == NULL) || r;
- r = ((glRasterPos2iv = (PFNGLRASTERPOS2IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2iv"))) == NULL) || r;
- r = ((glRasterPos2s = (PFNGLRASTERPOS2SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2s"))) == NULL) || r;
- r = ((glRasterPos2sv = (PFNGLRASTERPOS2SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos2sv"))) == NULL) || r;
- r = ((glRasterPos3d = (PFNGLRASTERPOS3DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3d"))) == NULL) || r;
- r = ((glRasterPos3dv = (PFNGLRASTERPOS3DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3dv"))) == NULL) || r;
- r = ((glRasterPos3f = (PFNGLRASTERPOS3FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3f"))) == NULL) || r;
- r = ((glRasterPos3fv = (PFNGLRASTERPOS3FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3fv"))) == NULL) || r;
- r = ((glRasterPos3i = (PFNGLRASTERPOS3IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3i"))) == NULL) || r;
- r = ((glRasterPos3iv = (PFNGLRASTERPOS3IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3iv"))) == NULL) || r;
- r = ((glRasterPos3s = (PFNGLRASTERPOS3SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3s"))) == NULL) || r;
- r = ((glRasterPos3sv = (PFNGLRASTERPOS3SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos3sv"))) == NULL) || r;
- r = ((glRasterPos4d = (PFNGLRASTERPOS4DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4d"))) == NULL) || r;
- r = ((glRasterPos4dv = (PFNGLRASTERPOS4DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4dv"))) == NULL) || r;
- r = ((glRasterPos4f = (PFNGLRASTERPOS4FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4f"))) == NULL) || r;
- r = ((glRasterPos4fv = (PFNGLRASTERPOS4FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4fv"))) == NULL) || r;
- r = ((glRasterPos4i = (PFNGLRASTERPOS4IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4i"))) == NULL) || r;
- r = ((glRasterPos4iv = (PFNGLRASTERPOS4IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4iv"))) == NULL) || r;
- r = ((glRasterPos4s = (PFNGLRASTERPOS4SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4s"))) == NULL) || r;
- r = ((glRasterPos4sv = (PFNGLRASTERPOS4SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRasterPos4sv"))) == NULL) || r;
- r = ((glReadBuffer = (PFNGLREADBUFFERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glReadBuffer"))) == NULL) || r;
- r = ((glReadPixels = (PFNGLREADPIXELSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glReadPixels"))) == NULL) || r;
- r = ((glRectd = (PFNGLRECTDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectd"))) == NULL) || r;
- r = ((glRectdv = (PFNGLRECTDVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectdv"))) == NULL) || r;
- r = ((glRectf = (PFNGLRECTFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectf"))) == NULL) || r;
- r = ((glRectfv = (PFNGLRECTFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectfv"))) == NULL) || r;
- r = ((glRecti = (PFNGLRECTIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRecti"))) == NULL) || r;
- r = ((glRectiv = (PFNGLRECTIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectiv"))) == NULL) || r;
- r = ((glRects = (PFNGLRECTSPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRects"))) == NULL) || r;
- r = ((glRectsv = (PFNGLRECTSVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRectsv"))) == NULL) || r;
- r = ((glRenderMode = (PFNGLRENDERMODEPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRenderMode"))) == NULL) || r;
- r = ((glRotated = (PFNGLROTATEDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRotated"))) == NULL) || r;
- r = ((glRotatef = (PFNGLROTATEFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glRotatef"))) == NULL) || r;
- r = ((glScaled = (PFNGLSCALEDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glScaled"))) == NULL) || r;
- r = ((glScalef = (PFNGLSCALEFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glScalef"))) == NULL) || r;
- r = ((glScissor = (PFNGLSCISSORPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glScissor"))) == NULL) || r;
- r = ((glSelectBuffer = (PFNGLSELECTBUFFERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glSelectBuffer"))) == NULL) || r;
- r = ((glShadeModel = (PFNGLSHADEMODELPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glShadeModel"))) == NULL) || r;
- r = ((glStencilFunc = (PFNGLSTENCILFUNCPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glStencilFunc"))) == NULL) || r;
- r = ((glStencilMask = (PFNGLSTENCILMASKPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glStencilMask"))) == NULL) || r;
- r = ((glStencilOp = (PFNGLSTENCILOPPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glStencilOp"))) == NULL) || r;
- r = ((glTexCoord1d = (PFNGLTEXCOORD1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1d"))) == NULL) || r;
- r = ((glTexCoord1dv = (PFNGLTEXCOORD1DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1dv"))) == NULL) || r;
- r = ((glTexCoord1f = (PFNGLTEXCOORD1FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1f"))) == NULL) || r;
- r = ((glTexCoord1fv = (PFNGLTEXCOORD1FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1fv"))) == NULL) || r;
- r = ((glTexCoord1i = (PFNGLTEXCOORD1IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1i"))) == NULL) || r;
- r = ((glTexCoord1iv = (PFNGLTEXCOORD1IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1iv"))) == NULL) || r;
- r = ((glTexCoord1s = (PFNGLTEXCOORD1SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1s"))) == NULL) || r;
- r = ((glTexCoord1sv = (PFNGLTEXCOORD1SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord1sv"))) == NULL) || r;
- r = ((glTexCoord2d = (PFNGLTEXCOORD2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2d"))) == NULL) || r;
- r = ((glTexCoord2dv = (PFNGLTEXCOORD2DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2dv"))) == NULL) || r;
- r = ((glTexCoord2f = (PFNGLTEXCOORD2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2f"))) == NULL) || r;
- r = ((glTexCoord2fv = (PFNGLTEXCOORD2FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2fv"))) == NULL) || r;
- r = ((glTexCoord2i = (PFNGLTEXCOORD2IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2i"))) == NULL) || r;
- r = ((glTexCoord2iv = (PFNGLTEXCOORD2IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2iv"))) == NULL) || r;
- r = ((glTexCoord2s = (PFNGLTEXCOORD2SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2s"))) == NULL) || r;
- r = ((glTexCoord2sv = (PFNGLTEXCOORD2SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord2sv"))) == NULL) || r;
- r = ((glTexCoord3d = (PFNGLTEXCOORD3DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3d"))) == NULL) || r;
- r = ((glTexCoord3dv = (PFNGLTEXCOORD3DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3dv"))) == NULL) || r;
- r = ((glTexCoord3f = (PFNGLTEXCOORD3FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3f"))) == NULL) || r;
- r = ((glTexCoord3fv = (PFNGLTEXCOORD3FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3fv"))) == NULL) || r;
- r = ((glTexCoord3i = (PFNGLTEXCOORD3IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3i"))) == NULL) || r;
- r = ((glTexCoord3iv = (PFNGLTEXCOORD3IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3iv"))) == NULL) || r;
- r = ((glTexCoord3s = (PFNGLTEXCOORD3SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3s"))) == NULL) || r;
- r = ((glTexCoord3sv = (PFNGLTEXCOORD3SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord3sv"))) == NULL) || r;
- r = ((glTexCoord4d = (PFNGLTEXCOORD4DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4d"))) == NULL) || r;
- r = ((glTexCoord4dv = (PFNGLTEXCOORD4DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4dv"))) == NULL) || r;
- r = ((glTexCoord4f = (PFNGLTEXCOORD4FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4f"))) == NULL) || r;
- r = ((glTexCoord4fv = (PFNGLTEXCOORD4FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4fv"))) == NULL) || r;
- r = ((glTexCoord4i = (PFNGLTEXCOORD4IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4i"))) == NULL) || r;
- r = ((glTexCoord4iv = (PFNGLTEXCOORD4IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4iv"))) == NULL) || r;
- r = ((glTexCoord4s = (PFNGLTEXCOORD4SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4s"))) == NULL) || r;
- r = ((glTexCoord4sv = (PFNGLTEXCOORD4SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoord4sv"))) == NULL) || r;
- r = ((glTexCoordPointer = (PFNGLTEXCOORDPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexCoordPointer"))) == NULL) || r;
- r = ((glTexEnvf = (PFNGLTEXENVFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexEnvf"))) == NULL) || r;
- r = ((glTexEnvfv = (PFNGLTEXENVFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexEnvfv"))) == NULL) || r;
- r = ((glTexEnvi = (PFNGLTEXENVIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexEnvi"))) == NULL) || r;
- r = ((glTexEnviv = (PFNGLTEXENVIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexEnviv"))) == NULL) || r;
- r = ((glTexGend = (PFNGLTEXGENDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGend"))) == NULL) || r;
- r = ((glTexGendv = (PFNGLTEXGENDVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGendv"))) == NULL) || r;
- r = ((glTexGenf = (PFNGLTEXGENFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGenf"))) == NULL) || r;
- r = ((glTexGenfv = (PFNGLTEXGENFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGenfv"))) == NULL) || r;
- r = ((glTexGeni = (PFNGLTEXGENIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGeni"))) == NULL) || r;
- r = ((glTexGeniv = (PFNGLTEXGENIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexGeniv"))) == NULL) || r;
- r = ((glTexImage1D = (PFNGLTEXIMAGE1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexImage1D"))) == NULL) || r;
- r = ((glTexImage2D = (PFNGLTEXIMAGE2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexImage2D"))) == NULL) || r;
- r = ((glTexParameterf = (PFNGLTEXPARAMETERFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexParameterf"))) == NULL) || r;
- r = ((glTexParameterfv = (PFNGLTEXPARAMETERFVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexParameterfv"))) == NULL) || r;
- r = ((glTexParameteri = (PFNGLTEXPARAMETERIPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexParameteri"))) == NULL) || r;
- r = ((glTexParameteriv = (PFNGLTEXPARAMETERIVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexParameteriv"))) == NULL) || r;
- r = ((glTexSubImage1D = (PFNGLTEXSUBIMAGE1DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexSubImage1D"))) == NULL) || r;
- r = ((glTexSubImage2D = (PFNGLTEXSUBIMAGE2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTexSubImage2D"))) == NULL) || r;
- r = ((glTranslated = (PFNGLTRANSLATEDPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTranslated"))) == NULL) || r;
- r = ((glTranslatef = (PFNGLTRANSLATEFPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glTranslatef"))) == NULL) || r;
- r = ((glVertex2d = (PFNGLVERTEX2DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2d"))) == NULL) || r;
- r = ((glVertex2dv = (PFNGLVERTEX2DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2dv"))) == NULL) || r;
- r = ((glVertex2f = (PFNGLVERTEX2FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2f"))) == NULL) || r;
- r = ((glVertex2fv = (PFNGLVERTEX2FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2fv"))) == NULL) || r;
- r = ((glVertex2i = (PFNGLVERTEX2IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2i"))) == NULL) || r;
- r = ((glVertex2iv = (PFNGLVERTEX2IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2iv"))) == NULL) || r;
- r = ((glVertex2s = (PFNGLVERTEX2SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2s"))) == NULL) || r;
- r = ((glVertex2sv = (PFNGLVERTEX2SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex2sv"))) == NULL) || r;
- r = ((glVertex3d = (PFNGLVERTEX3DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3d"))) == NULL) || r;
- r = ((glVertex3dv = (PFNGLVERTEX3DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3dv"))) == NULL) || r;
- r = ((glVertex3f = (PFNGLVERTEX3FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3f"))) == NULL) || r;
- r = ((glVertex3fv = (PFNGLVERTEX3FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3fv"))) == NULL) || r;
- r = ((glVertex3i = (PFNGLVERTEX3IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3i"))) == NULL) || r;
- r = ((glVertex3iv = (PFNGLVERTEX3IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3iv"))) == NULL) || r;
- r = ((glVertex3s = (PFNGLVERTEX3SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3s"))) == NULL) || r;
- r = ((glVertex3sv = (PFNGLVERTEX3SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex3sv"))) == NULL) || r;
- r = ((glVertex4d = (PFNGLVERTEX4DPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4d"))) == NULL) || r;
- r = ((glVertex4dv = (PFNGLVERTEX4DVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4dv"))) == NULL) || r;
- r = ((glVertex4f = (PFNGLVERTEX4FPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4f"))) == NULL) || r;
- r = ((glVertex4fv = (PFNGLVERTEX4FVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4fv"))) == NULL) || r;
- r = ((glVertex4i = (PFNGLVERTEX4IPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4i"))) == NULL) || r;
- r = ((glVertex4iv = (PFNGLVERTEX4IVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4iv"))) == NULL) || r;
- r = ((glVertex4s = (PFNGLVERTEX4SPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4s"))) == NULL) || r;
- r = ((glVertex4sv = (PFNGLVERTEX4SVPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertex4sv"))) == NULL) || r;
- r = ((glVertexPointer = (PFNGLVERTEXPOINTERPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glVertexPointer"))) == NULL) || r;
- r = ((glViewport = (PFNGLVIEWPORTPROC)glewGetProcAddress(fqn_from_convention(glew_convention, "glViewport"))) == NULL) || r;
-
- if (r==0)
- {
- printf("glewOpenGL11Init dynamically loaded using dlopen/dlsym OK\n");
- }
- return r;
-}
-#endif //GLEW_INIT_OPENGL11_FUNCTIONS
-
-
-GLenum GLEWAPIENTRY glewInit (void)
-{
- GLenum r;
- r = glewContextInit();
- if ( r != 0 ) return r;
-#if defined(_WIN32)
- return wglewContextInit();
-#elif !defined(__ANDROID__) && !defined(__native_client__) && (!defined(__APPLE__) || defined(GLEW_APPLE_GLX)) /* _UNIX */
- return glxewContextInit();
-#else
- return r;
-#endif /* _WIN32 */
-}
-
-#endif /* !GLEW_MX */
-#ifdef GLEW_MX
-GLboolean GLEWAPIENTRY glewContextIsSupported (const GLEWContext* ctx, const char* name)
-#else
-GLboolean GLEWAPIENTRY glewIsSupported (const char* name)
-#endif
-{
- GLubyte* pos = (GLubyte*)name;
- GLuint len = _glewStrLen(pos);
- GLboolean ret = GL_TRUE;
- while (ret && len > 0)
- {
- if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3))
- {
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8))
- {
-#ifdef GL_VERSION_1_2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3))
- {
- ret = GLEW_VERSION_1_2;
- continue;
- }
-#endif
-#ifdef GL_VERSION_1_2_1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5))
- {
- ret = GLEW_VERSION_1_2_1;
- continue;
- }
-#endif
-#ifdef GL_VERSION_1_3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3))
- {
- ret = GLEW_VERSION_1_3;
- continue;
- }
-#endif
-#ifdef GL_VERSION_1_4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3))
- {
- ret = GLEW_VERSION_1_4;
- continue;
- }
-#endif
-#ifdef GL_VERSION_1_5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3))
- {
- ret = GLEW_VERSION_1_5;
- continue;
- }
-#endif
-#ifdef GL_VERSION_2_0
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3))
- {
- ret = GLEW_VERSION_2_0;
- continue;
- }
-#endif
-#ifdef GL_VERSION_2_1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3))
- {
- ret = GLEW_VERSION_2_1;
- continue;
- }
-#endif
-#ifdef GL_VERSION_3_0
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3))
- {
- ret = GLEW_VERSION_3_0;
- continue;
- }
-#endif
-#ifdef GL_VERSION_3_1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3))
- {
- ret = GLEW_VERSION_3_1;
- continue;
- }
-#endif
-#ifdef GL_VERSION_3_2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3))
- {
- ret = GLEW_VERSION_3_2;
- continue;
- }
-#endif
-#ifdef GL_VERSION_3_3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3))
- {
- ret = GLEW_VERSION_3_3;
- continue;
- }
-#endif
-#ifdef GL_VERSION_4_0
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3))
- {
- ret = GLEW_VERSION_4_0;
- continue;
- }
-#endif
-#ifdef GL_VERSION_4_1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3))
- {
- ret = GLEW_VERSION_4_1;
- continue;
- }
-#endif
-#ifdef GL_VERSION_4_2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_2", 3))
- {
- ret = GLEW_VERSION_4_2;
- continue;
- }
-#endif
-#ifdef GL_VERSION_4_3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_3", 3))
- {
- ret = GLEW_VERSION_4_3;
- continue;
- }
-#endif
-#ifdef GL_VERSION_4_4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_4", 3))
- {
- ret = GLEW_VERSION_4_4;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5))
- {
-#ifdef GL_3DFX_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLEW_3DFX_multisample;
- continue;
- }
-#endif
-#ifdef GL_3DFX_tbuffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7))
- {
- ret = GLEW_3DFX_tbuffer;
- continue;
- }
-#endif
-#ifdef GL_3DFX_texture_compression_FXT1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24))
- {
- ret = GLEW_3DFX_texture_compression_FXT1;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4))
- {
-#ifdef GL_AMD_blend_minmax_factor
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax_factor", 19))
- {
- ret = GLEW_AMD_blend_minmax_factor;
- continue;
- }
-#endif
-#ifdef GL_AMD_conservative_depth
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18))
- {
- ret = GLEW_AMD_conservative_depth;
- continue;
- }
-#endif
-#ifdef GL_AMD_debug_output
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12))
- {
- ret = GLEW_AMD_debug_output;
- continue;
- }
-#endif
-#ifdef GL_AMD_depth_clamp_separate
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20))
- {
- ret = GLEW_AMD_depth_clamp_separate;
- continue;
- }
-#endif
-#ifdef GL_AMD_draw_buffers_blend
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18))
- {
- ret = GLEW_AMD_draw_buffers_blend;
- continue;
- }
-#endif
-#ifdef GL_AMD_interleaved_elements
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"interleaved_elements", 20))
- {
- ret = GLEW_AMD_interleaved_elements;
- continue;
- }
-#endif
-#ifdef GL_AMD_multi_draw_indirect
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19))
- {
- ret = GLEW_AMD_multi_draw_indirect;
- continue;
- }
-#endif
-#ifdef GL_AMD_name_gen_delete
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15))
- {
- ret = GLEW_AMD_name_gen_delete;
- continue;
- }
-#endif
-#ifdef GL_AMD_performance_monitor
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19))
- {
- ret = GLEW_AMD_performance_monitor;
- continue;
- }
-#endif
-#ifdef GL_AMD_pinned_memory
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pinned_memory", 13))
- {
- ret = GLEW_AMD_pinned_memory;
- continue;
- }
-#endif
-#ifdef GL_AMD_query_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19))
- {
- ret = GLEW_AMD_query_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_AMD_sample_positions
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_positions", 16))
- {
- ret = GLEW_AMD_sample_positions;
- continue;
- }
-#endif
-#ifdef GL_AMD_seamless_cubemap_per_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28))
- {
- ret = GLEW_AMD_seamless_cubemap_per_texture;
- continue;
- }
-#endif
-#ifdef GL_AMD_shader_stencil_export
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21))
- {
- ret = GLEW_AMD_shader_stencil_export;
- continue;
- }
-#endif
-#ifdef GL_AMD_shader_trinary_minmax
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_trinary_minmax", 21))
- {
- ret = GLEW_AMD_shader_trinary_minmax;
- continue;
- }
-#endif
-#ifdef GL_AMD_sparse_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14))
- {
- ret = GLEW_AMD_sparse_texture;
- continue;
- }
-#endif
-#ifdef GL_AMD_stencil_operation_extended
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_operation_extended", 26))
- {
- ret = GLEW_AMD_stencil_operation_extended;
- continue;
- }
-#endif
-#ifdef GL_AMD_texture_texture4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16))
- {
- ret = GLEW_AMD_texture_texture4;
- continue;
- }
-#endif
-#ifdef GL_AMD_transform_feedback3_lines_triangles
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35))
- {
- ret = GLEW_AMD_transform_feedback3_lines_triangles;
- continue;
- }
-#endif
-#ifdef GL_AMD_vertex_shader_layer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_layer", 19))
- {
- ret = GLEW_AMD_vertex_shader_layer;
- continue;
- }
-#endif
-#ifdef GL_AMD_vertex_shader_tessellator
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25))
- {
- ret = GLEW_AMD_vertex_shader_tessellator;
- continue;
- }
-#endif
-#ifdef GL_AMD_vertex_shader_viewport_index
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_viewport_index", 28))
- {
- ret = GLEW_AMD_vertex_shader_viewport_index;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ANGLE_", 6))
- {
-#ifdef GL_ANGLE_depth_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13))
- {
- ret = GLEW_ANGLE_depth_texture;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_framebuffer_blit
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16))
- {
- ret = GLEW_ANGLE_framebuffer_blit;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_framebuffer_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23))
- {
- ret = GLEW_ANGLE_framebuffer_multisample;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_instanced_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16))
- {
- ret = GLEW_ANGLE_instanced_arrays;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_pack_reverse_row_order
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_reverse_row_order", 22))
- {
- ret = GLEW_ANGLE_pack_reverse_row_order;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_program_binary
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_binary", 14))
- {
- ret = GLEW_ANGLE_program_binary;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_texture_compression_dxt1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24))
- {
- ret = GLEW_ANGLE_texture_compression_dxt1;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_texture_compression_dxt3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt3", 24))
- {
- ret = GLEW_ANGLE_texture_compression_dxt3;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_texture_compression_dxt5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt5", 24))
- {
- ret = GLEW_ANGLE_texture_compression_dxt5;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_texture_usage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_usage", 13))
- {
- ret = GLEW_ANGLE_texture_usage;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_timer_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11))
- {
- ret = GLEW_ANGLE_timer_query;
- continue;
- }
-#endif
-#ifdef GL_ANGLE_translated_shader_source
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"translated_shader_source", 24))
- {
- ret = GLEW_ANGLE_translated_shader_source;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6))
- {
-#ifdef GL_APPLE_aux_depth_stencil
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17))
- {
- ret = GLEW_APPLE_aux_depth_stencil;
- continue;
- }
-#endif
-#ifdef GL_APPLE_client_storage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14))
- {
- ret = GLEW_APPLE_client_storage;
- continue;
- }
-#endif
-#ifdef GL_APPLE_element_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13))
- {
- ret = GLEW_APPLE_element_array;
- continue;
- }
-#endif
-#ifdef GL_APPLE_fence
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5))
- {
- ret = GLEW_APPLE_fence;
- continue;
- }
-#endif
-#ifdef GL_APPLE_float_pixels
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12))
- {
- ret = GLEW_APPLE_float_pixels;
- continue;
- }
-#endif
-#ifdef GL_APPLE_flush_buffer_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18))
- {
- ret = GLEW_APPLE_flush_buffer_range;
- continue;
- }
-#endif
-#ifdef GL_APPLE_object_purgeable
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16))
- {
- ret = GLEW_APPLE_object_purgeable;
- continue;
- }
-#endif
-#ifdef GL_APPLE_pixel_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12))
- {
- ret = GLEW_APPLE_pixel_buffer;
- continue;
- }
-#endif
-#ifdef GL_APPLE_rgb_422
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7))
- {
- ret = GLEW_APPLE_rgb_422;
- continue;
- }
-#endif
-#ifdef GL_APPLE_row_bytes
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9))
- {
- ret = GLEW_APPLE_row_bytes;
- continue;
- }
-#endif
-#ifdef GL_APPLE_specular_vector
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15))
- {
- ret = GLEW_APPLE_specular_vector;
- continue;
- }
-#endif
-#ifdef GL_APPLE_texture_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13))
- {
- ret = GLEW_APPLE_texture_range;
- continue;
- }
-#endif
-#ifdef GL_APPLE_transform_hint
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14))
- {
- ret = GLEW_APPLE_transform_hint;
- continue;
- }
-#endif
-#ifdef GL_APPLE_vertex_array_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19))
- {
- ret = GLEW_APPLE_vertex_array_object;
- continue;
- }
-#endif
-#ifdef GL_APPLE_vertex_array_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
- {
- ret = GLEW_APPLE_vertex_array_range;
- continue;
- }
-#endif
-#ifdef GL_APPLE_vertex_program_evaluators
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25))
- {
- ret = GLEW_APPLE_vertex_program_evaluators;
- continue;
- }
-#endif
-#ifdef GL_APPLE_ycbcr_422
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9))
- {
- ret = GLEW_APPLE_ycbcr_422;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4))
- {
-#ifdef GL_ARB_ES2_compatibility
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17))
- {
- ret = GLEW_ARB_ES2_compatibility;
- continue;
- }
-#endif
-#ifdef GL_ARB_ES3_compatibility
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES3_compatibility", 17))
- {
- ret = GLEW_ARB_ES3_compatibility;
- continue;
- }
-#endif
-#ifdef GL_ARB_arrays_of_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"arrays_of_arrays", 16))
- {
- ret = GLEW_ARB_arrays_of_arrays;
- continue;
- }
-#endif
-#ifdef GL_ARB_base_instance
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"base_instance", 13))
- {
- ret = GLEW_ARB_base_instance;
- continue;
- }
-#endif
-#ifdef GL_ARB_bindless_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16))
- {
- ret = GLEW_ARB_bindless_texture;
- continue;
- }
-#endif
-#ifdef GL_ARB_blend_func_extended
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19))
- {
- ret = GLEW_ARB_blend_func_extended;
- continue;
- }
-#endif
-#ifdef GL_ARB_buffer_storage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_storage", 14))
- {
- ret = GLEW_ARB_buffer_storage;
- continue;
- }
-#endif
-#ifdef GL_ARB_cl_event
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8))
- {
- ret = GLEW_ARB_cl_event;
- continue;
- }
-#endif
-#ifdef GL_ARB_clear_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_buffer_object", 19))
- {
- ret = GLEW_ARB_clear_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_clear_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"clear_texture", 13))
- {
- ret = GLEW_ARB_clear_texture;
- continue;
- }
-#endif
-#ifdef GL_ARB_color_buffer_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18))
- {
- ret = GLEW_ARB_color_buffer_float;
- continue;
- }
-#endif
-#ifdef GL_ARB_compatibility
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13))
- {
- ret = GLEW_ARB_compatibility;
- continue;
- }
-#endif
-#ifdef GL_ARB_compressed_texture_pixel_storage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_texture_pixel_storage", 32))
- {
- ret = GLEW_ARB_compressed_texture_pixel_storage;
- continue;
- }
-#endif
-#ifdef GL_ARB_compute_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_shader", 14))
- {
- ret = GLEW_ARB_compute_shader;
- continue;
- }
-#endif
-#ifdef GL_ARB_compute_variable_group_size
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_variable_group_size", 27))
- {
- ret = GLEW_ARB_compute_variable_group_size;
- continue;
- }
-#endif
-#ifdef GL_ARB_conservative_depth
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18))
- {
- ret = GLEW_ARB_conservative_depth;
- continue;
- }
-#endif
-#ifdef GL_ARB_copy_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11))
- {
- ret = GLEW_ARB_copy_buffer;
- continue;
- }
-#endif
-#ifdef GL_ARB_copy_image
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10))
- {
- ret = GLEW_ARB_copy_image;
- continue;
- }
-#endif
-#ifdef GL_ARB_debug_output
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12))
- {
- ret = GLEW_ARB_debug_output;
- continue;
- }
-#endif
-#ifdef GL_ARB_depth_buffer_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18))
- {
- ret = GLEW_ARB_depth_buffer_float;
- continue;
- }
-#endif
-#ifdef GL_ARB_depth_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11))
- {
- ret = GLEW_ARB_depth_clamp;
- continue;
- }
-#endif
-#ifdef GL_ARB_depth_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13))
- {
- ret = GLEW_ARB_depth_texture;
- continue;
- }
-#endif
-#ifdef GL_ARB_draw_buffers
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12))
- {
- ret = GLEW_ARB_draw_buffers;
- continue;
- }
-#endif
-#ifdef GL_ARB_draw_buffers_blend
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18))
- {
- ret = GLEW_ARB_draw_buffers_blend;
- continue;
- }
-#endif
-#ifdef GL_ARB_draw_elements_base_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25))
- {
- ret = GLEW_ARB_draw_elements_base_vertex;
- continue;
- }
-#endif
-#ifdef GL_ARB_draw_indirect
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13))
- {
- ret = GLEW_ARB_draw_indirect;
- continue;
- }
-#endif
-#ifdef GL_ARB_draw_instanced
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14))
- {
- ret = GLEW_ARB_draw_instanced;
- continue;
- }
-#endif
-#ifdef GL_ARB_enhanced_layouts
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"enhanced_layouts", 16))
- {
- ret = GLEW_ARB_enhanced_layouts;
- continue;
- }
-#endif
-#ifdef GL_ARB_explicit_attrib_location
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24))
- {
- ret = GLEW_ARB_explicit_attrib_location;
- continue;
- }
-#endif
-#ifdef GL_ARB_explicit_uniform_location
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_uniform_location", 25))
- {
- ret = GLEW_ARB_explicit_uniform_location;
- continue;
- }
-#endif
-#ifdef GL_ARB_fragment_coord_conventions
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26))
- {
- ret = GLEW_ARB_fragment_coord_conventions;
- continue;
- }
-#endif
-#ifdef GL_ARB_fragment_layer_viewport
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_layer_viewport", 23))
- {
- ret = GLEW_ARB_fragment_layer_viewport;
- continue;
- }
-#endif
-#ifdef GL_ARB_fragment_program
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16))
- {
- ret = GLEW_ARB_fragment_program;
- continue;
- }
-#endif
-#ifdef GL_ARB_fragment_program_shadow
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23))
- {
- ret = GLEW_ARB_fragment_program_shadow;
- continue;
- }
-#endif
-#ifdef GL_ARB_fragment_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15))
- {
- ret = GLEW_ARB_fragment_shader;
- continue;
- }
-#endif
-#ifdef GL_ARB_framebuffer_no_attachments
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_no_attachments", 26))
- {
- ret = GLEW_ARB_framebuffer_no_attachments;
- continue;
- }
-#endif
-#ifdef GL_ARB_framebuffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18))
- {
- ret = GLEW_ARB_framebuffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = GLEW_ARB_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef GL_ARB_geometry_shader4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
- {
- ret = GLEW_ARB_geometry_shader4;
- continue;
- }
-#endif
-#ifdef GL_ARB_get_program_binary
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18))
- {
- ret = GLEW_ARB_get_program_binary;
- continue;
- }
-#endif
-#ifdef GL_ARB_gpu_shader5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11))
- {
- ret = GLEW_ARB_gpu_shader5;
- continue;
- }
-#endif
-#ifdef GL_ARB_gpu_shader_fp64
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15))
- {
- ret = GLEW_ARB_gpu_shader_fp64;
- continue;
- }
-#endif
-#ifdef GL_ARB_half_float_pixel
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16))
- {
- ret = GLEW_ARB_half_float_pixel;
- continue;
- }
-#endif
-#ifdef GL_ARB_half_float_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17))
- {
- ret = GLEW_ARB_half_float_vertex;
- continue;
- }
-#endif
-#ifdef GL_ARB_imaging
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7))
- {
- ret = GLEW_ARB_imaging;
- continue;
- }
-#endif
-#ifdef GL_ARB_indirect_parameters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"indirect_parameters", 19))
- {
- ret = GLEW_ARB_indirect_parameters;
- continue;
- }
-#endif
-#ifdef GL_ARB_instanced_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16))
- {
- ret = GLEW_ARB_instanced_arrays;
- continue;
- }
-#endif
-#ifdef GL_ARB_internalformat_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query", 20))
- {
- ret = GLEW_ARB_internalformat_query;
- continue;
- }
-#endif
-#ifdef GL_ARB_internalformat_query2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"internalformat_query2", 21))
- {
- ret = GLEW_ARB_internalformat_query2;
- continue;
- }
-#endif
-#ifdef GL_ARB_invalidate_subdata
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"invalidate_subdata", 18))
- {
- ret = GLEW_ARB_invalidate_subdata;
- continue;
- }
-#endif
-#ifdef GL_ARB_map_buffer_alignment
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_alignment", 20))
- {
- ret = GLEW_ARB_map_buffer_alignment;
- continue;
- }
-#endif
-#ifdef GL_ARB_map_buffer_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16))
- {
- ret = GLEW_ARB_map_buffer_range;
- continue;
- }
-#endif
-#ifdef GL_ARB_matrix_palette
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14))
- {
- ret = GLEW_ARB_matrix_palette;
- continue;
- }
-#endif
-#ifdef GL_ARB_multi_bind
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_bind", 10))
- {
- ret = GLEW_ARB_multi_bind;
- continue;
- }
-#endif
-#ifdef GL_ARB_multi_draw_indirect
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_indirect", 19))
- {
- ret = GLEW_ARB_multi_draw_indirect;
- continue;
- }
-#endif
-#ifdef GL_ARB_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLEW_ARB_multisample;
- continue;
- }
-#endif
-#ifdef GL_ARB_multitexture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12))
- {
- ret = GLEW_ARB_multitexture;
- continue;
- }
-#endif
-#ifdef GL_ARB_occlusion_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15))
- {
- ret = GLEW_ARB_occlusion_query;
- continue;
- }
-#endif
-#ifdef GL_ARB_occlusion_query2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16))
- {
- ret = GLEW_ARB_occlusion_query2;
- continue;
- }
-#endif
-#ifdef GL_ARB_pixel_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19))
- {
- ret = GLEW_ARB_pixel_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_point_parameters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16))
- {
- ret = GLEW_ARB_point_parameters;
- continue;
- }
-#endif
-#ifdef GL_ARB_point_sprite
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12))
- {
- ret = GLEW_ARB_point_sprite;
- continue;
- }
-#endif
-#ifdef GL_ARB_program_interface_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"program_interface_query", 23))
- {
- ret = GLEW_ARB_program_interface_query;
- continue;
- }
-#endif
-#ifdef GL_ARB_provoking_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16))
- {
- ret = GLEW_ARB_provoking_vertex;
- continue;
- }
-#endif
-#ifdef GL_ARB_query_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"query_buffer_object", 19))
- {
- ret = GLEW_ARB_query_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_robust_buffer_access_behavior
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robust_buffer_access_behavior", 29))
- {
- ret = GLEW_ARB_robust_buffer_access_behavior;
- continue;
- }
-#endif
-#ifdef GL_ARB_robustness
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10))
- {
- ret = GLEW_ARB_robustness;
- continue;
- }
-#endif
-#ifdef GL_ARB_robustness_application_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32))
- {
- ret = GLEW_ARB_robustness_application_isolation;
- continue;
- }
-#endif
-#ifdef GL_ARB_robustness_share_group_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32))
- {
- ret = GLEW_ARB_robustness_share_group_isolation;
- continue;
- }
-#endif
-#ifdef GL_ARB_sample_shading
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14))
- {
- ret = GLEW_ARB_sample_shading;
- continue;
- }
-#endif
-#ifdef GL_ARB_sampler_objects
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15))
- {
- ret = GLEW_ARB_sampler_objects;
- continue;
- }
-#endif
-#ifdef GL_ARB_seamless_cube_map
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17))
- {
- ret = GLEW_ARB_seamless_cube_map;
- continue;
- }
-#endif
-#ifdef GL_ARB_seamless_cubemap_per_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28))
- {
- ret = GLEW_ARB_seamless_cubemap_per_texture;
- continue;
- }
-#endif
-#ifdef GL_ARB_separate_shader_objects
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23))
- {
- ret = GLEW_ARB_separate_shader_objects;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_atomic_counters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22))
- {
- ret = GLEW_ARB_shader_atomic_counters;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_bit_encoding
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19))
- {
- ret = GLEW_ARB_shader_bit_encoding;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_draw_parameters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_draw_parameters", 22))
- {
- ret = GLEW_ARB_shader_draw_parameters;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_group_vote
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_group_vote", 17))
- {
- ret = GLEW_ARB_shader_group_vote;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_image_load_store
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23))
- {
- ret = GLEW_ARB_shader_image_load_store;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_image_size
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_size", 17))
- {
- ret = GLEW_ARB_shader_image_size;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_objects
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14))
- {
- ret = GLEW_ARB_shader_objects;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_precision
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16))
- {
- ret = GLEW_ARB_shader_precision;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_stencil_export
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21))
- {
- ret = GLEW_ARB_shader_stencil_export;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_storage_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28))
- {
- ret = GLEW_ARB_shader_storage_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_subroutine
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17))
- {
- ret = GLEW_ARB_shader_subroutine;
- continue;
- }
-#endif
-#ifdef GL_ARB_shader_texture_lod
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18))
- {
- ret = GLEW_ARB_shader_texture_lod;
- continue;
- }
-#endif
-#ifdef GL_ARB_shading_language_100
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20))
- {
- ret = GLEW_ARB_shading_language_100;
- continue;
- }
-#endif
-#ifdef GL_ARB_shading_language_420pack
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_420pack", 24))
- {
- ret = GLEW_ARB_shading_language_420pack;
- continue;
- }
-#endif
-#ifdef GL_ARB_shading_language_include
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24))
- {
- ret = GLEW_ARB_shading_language_include;
- continue;
- }
-#endif
-#ifdef GL_ARB_shading_language_packing
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_packing", 24))
- {
- ret = GLEW_ARB_shading_language_packing;
- continue;
- }
-#endif
-#ifdef GL_ARB_shadow
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6))
- {
- ret = GLEW_ARB_shadow;
- continue;
- }
-#endif
-#ifdef GL_ARB_shadow_ambient
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14))
- {
- ret = GLEW_ARB_shadow_ambient;
- continue;
- }
-#endif
-#ifdef GL_ARB_sparse_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sparse_texture", 14))
- {
- ret = GLEW_ARB_sparse_texture;
- continue;
- }
-#endif
-#ifdef GL_ARB_stencil_texturing
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_texturing", 17))
- {
- ret = GLEW_ARB_stencil_texturing;
- continue;
- }
-#endif
-#ifdef GL_ARB_sync
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4))
- {
- ret = GLEW_ARB_sync;
- continue;
- }
-#endif
-#ifdef GL_ARB_tessellation_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19))
- {
- ret = GLEW_ARB_tessellation_shader;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_border_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20))
- {
- ret = GLEW_ARB_texture_border_clamp;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21))
- {
- ret = GLEW_ARB_texture_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_buffer_object_rgb32
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27))
- {
- ret = GLEW_ARB_texture_buffer_object_rgb32;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_buffer_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_range", 20))
- {
- ret = GLEW_ARB_texture_buffer_range;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_compression
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19))
- {
- ret = GLEW_ARB_texture_compression;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_compression_bptc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24))
- {
- ret = GLEW_ARB_texture_compression_bptc;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_compression_rgtc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24))
- {
- ret = GLEW_ARB_texture_compression_rgtc;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_cube_map
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16))
- {
- ret = GLEW_ARB_texture_cube_map;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_cube_map_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22))
- {
- ret = GLEW_ARB_texture_cube_map_array;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_env_add
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15))
- {
- ret = GLEW_ARB_texture_env_add;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_env_combine
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19))
- {
- ret = GLEW_ARB_texture_env_combine;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_env_crossbar
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20))
- {
- ret = GLEW_ARB_texture_env_crossbar;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_env_dot3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16))
- {
- ret = GLEW_ARB_texture_env_dot3;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13))
- {
- ret = GLEW_ARB_texture_float;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_gather
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14))
- {
- ret = GLEW_ARB_texture_gather;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_mirror_clamp_to_edge
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp_to_edge", 28))
- {
- ret = GLEW_ARB_texture_mirror_clamp_to_edge;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_mirrored_repeat
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23))
- {
- ret = GLEW_ARB_texture_mirrored_repeat;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19))
- {
- ret = GLEW_ARB_texture_multisample;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_non_power_of_two
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24))
- {
- ret = GLEW_ARB_texture_non_power_of_two;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_query_levels
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_levels", 20))
- {
- ret = GLEW_ARB_texture_query_levels;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_query_lod
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17))
- {
- ret = GLEW_ARB_texture_query_lod;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_rectangle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17))
- {
- ret = GLEW_ARB_texture_rectangle;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_rg
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10))
- {
- ret = GLEW_ARB_texture_rg;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_rgb10_a2ui
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18))
- {
- ret = GLEW_ARB_texture_rgb10_a2ui;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_stencil8
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stencil8", 16))
- {
- ret = GLEW_ARB_texture_stencil8;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_storage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage", 15))
- {
- ret = GLEW_ARB_texture_storage;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_storage_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_storage_multisample", 27))
- {
- ret = GLEW_ARB_texture_storage_multisample;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_swizzle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15))
- {
- ret = GLEW_ARB_texture_swizzle;
- continue;
- }
-#endif
-#ifdef GL_ARB_texture_view
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_view", 12))
- {
- ret = GLEW_ARB_texture_view;
- continue;
- }
-#endif
-#ifdef GL_ARB_timer_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11))
- {
- ret = GLEW_ARB_timer_query;
- continue;
- }
-#endif
-#ifdef GL_ARB_transform_feedback2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19))
- {
- ret = GLEW_ARB_transform_feedback2;
- continue;
- }
-#endif
-#ifdef GL_ARB_transform_feedback3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19))
- {
- ret = GLEW_ARB_transform_feedback3;
- continue;
- }
-#endif
-#ifdef GL_ARB_transform_feedback_instanced
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback_instanced", 28))
- {
- ret = GLEW_ARB_transform_feedback_instanced;
- continue;
- }
-#endif
-#ifdef GL_ARB_transpose_matrix
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16))
- {
- ret = GLEW_ARB_transpose_matrix;
- continue;
- }
-#endif
-#ifdef GL_ARB_uniform_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21))
- {
- ret = GLEW_ARB_uniform_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_array_bgra
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17))
- {
- ret = GLEW_ARB_vertex_array_bgra;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_array_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19))
- {
- ret = GLEW_ARB_vertex_array_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_attrib_64bit
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19))
- {
- ret = GLEW_ARB_vertex_attrib_64bit;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_attrib_binding
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_binding", 21))
- {
- ret = GLEW_ARB_vertex_attrib_binding;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_blend
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12))
- {
- ret = GLEW_ARB_vertex_blend;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20))
- {
- ret = GLEW_ARB_vertex_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_program
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14))
- {
- ret = GLEW_ARB_vertex_program;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13))
- {
- ret = GLEW_ARB_vertex_shader;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_type_10f_11f_11f_rev
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_10f_11f_11f_rev", 27))
- {
- ret = GLEW_ARB_vertex_type_10f_11f_11f_rev;
- continue;
- }
-#endif
-#ifdef GL_ARB_vertex_type_2_10_10_10_rev
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26))
- {
- ret = GLEW_ARB_vertex_type_2_10_10_10_rev;
- continue;
- }
-#endif
-#ifdef GL_ARB_viewport_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14))
- {
- ret = GLEW_ARB_viewport_array;
- continue;
- }
-#endif
-#ifdef GL_ARB_window_pos
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10))
- {
- ret = GLEW_ARB_window_pos;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5))
- {
-#ifdef GL_ATIX_point_sprites
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13))
- {
- ret = GLEW_ATIX_point_sprites;
- continue;
- }
-#endif
-#ifdef GL_ATIX_texture_env_combine3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20))
- {
- ret = GLEW_ATIX_texture_env_combine3;
- continue;
- }
-#endif
-#ifdef GL_ATIX_texture_env_route
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17))
- {
- ret = GLEW_ATIX_texture_env_route;
- continue;
- }
-#endif
-#ifdef GL_ATIX_vertex_shader_output_point_size
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31))
- {
- ret = GLEW_ATIX_vertex_shader_output_point_size;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4))
- {
-#ifdef GL_ATI_draw_buffers
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12))
- {
- ret = GLEW_ATI_draw_buffers;
- continue;
- }
-#endif
-#ifdef GL_ATI_element_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13))
- {
- ret = GLEW_ATI_element_array;
- continue;
- }
-#endif
-#ifdef GL_ATI_envmap_bumpmap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14))
- {
- ret = GLEW_ATI_envmap_bumpmap;
- continue;
- }
-#endif
-#ifdef GL_ATI_fragment_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15))
- {
- ret = GLEW_ATI_fragment_shader;
- continue;
- }
-#endif
-#ifdef GL_ATI_map_object_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17))
- {
- ret = GLEW_ATI_map_object_buffer;
- continue;
- }
-#endif
-#ifdef GL_ATI_meminfo
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7))
- {
- ret = GLEW_ATI_meminfo;
- continue;
- }
-#endif
-#ifdef GL_ATI_pn_triangles
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12))
- {
- ret = GLEW_ATI_pn_triangles;
- continue;
- }
-#endif
-#ifdef GL_ATI_separate_stencil
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16))
- {
- ret = GLEW_ATI_separate_stencil;
- continue;
- }
-#endif
-#ifdef GL_ATI_shader_texture_lod
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18))
- {
- ret = GLEW_ATI_shader_texture_lod;
- continue;
- }
-#endif
-#ifdef GL_ATI_text_fragment_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20))
- {
- ret = GLEW_ATI_text_fragment_shader;
- continue;
- }
-#endif
-#ifdef GL_ATI_texture_compression_3dc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23))
- {
- ret = GLEW_ATI_texture_compression_3dc;
- continue;
- }
-#endif
-#ifdef GL_ATI_texture_env_combine3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20))
- {
- ret = GLEW_ATI_texture_env_combine3;
- continue;
- }
-#endif
-#ifdef GL_ATI_texture_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13))
- {
- ret = GLEW_ATI_texture_float;
- continue;
- }
-#endif
-#ifdef GL_ATI_texture_mirror_once
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19))
- {
- ret = GLEW_ATI_texture_mirror_once;
- continue;
- }
-#endif
-#ifdef GL_ATI_vertex_array_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19))
- {
- ret = GLEW_ATI_vertex_array_object;
- continue;
- }
-#endif
-#ifdef GL_ATI_vertex_attrib_array_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26))
- {
- ret = GLEW_ATI_vertex_attrib_array_object;
- continue;
- }
-#endif
-#ifdef GL_ATI_vertex_streams
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14))
- {
- ret = GLEW_ATI_vertex_streams;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4))
- {
-#ifdef GL_EXT_422_pixels
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10))
- {
- ret = GLEW_EXT_422_pixels;
- continue;
- }
-#endif
-#ifdef GL_EXT_Cg_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9))
- {
- ret = GLEW_EXT_Cg_shader;
- continue;
- }
-#endif
-#ifdef GL_EXT_abgr
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4))
- {
- ret = GLEW_EXT_abgr;
- continue;
- }
-#endif
-#ifdef GL_EXT_bgra
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4))
- {
- ret = GLEW_EXT_bgra;
- continue;
- }
-#endif
-#ifdef GL_EXT_bindable_uniform
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16))
- {
- ret = GLEW_EXT_bindable_uniform;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_color
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11))
- {
- ret = GLEW_EXT_blend_color;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_equation_separate
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23))
- {
- ret = GLEW_EXT_blend_equation_separate;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_func_separate
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19))
- {
- ret = GLEW_EXT_blend_func_separate;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_logic_op
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14))
- {
- ret = GLEW_EXT_blend_logic_op;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_minmax
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12))
- {
- ret = GLEW_EXT_blend_minmax;
- continue;
- }
-#endif
-#ifdef GL_EXT_blend_subtract
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14))
- {
- ret = GLEW_EXT_blend_subtract;
- continue;
- }
-#endif
-#ifdef GL_EXT_clip_volume_hint
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16))
- {
- ret = GLEW_EXT_clip_volume_hint;
- continue;
- }
-#endif
-#ifdef GL_EXT_cmyka
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5))
- {
- ret = GLEW_EXT_cmyka;
- continue;
- }
-#endif
-#ifdef GL_EXT_color_subtable
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14))
- {
- ret = GLEW_EXT_color_subtable;
- continue;
- }
-#endif
-#ifdef GL_EXT_compiled_vertex_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21))
- {
- ret = GLEW_EXT_compiled_vertex_array;
- continue;
- }
-#endif
-#ifdef GL_EXT_convolution
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11))
- {
- ret = GLEW_EXT_convolution;
- continue;
- }
-#endif
-#ifdef GL_EXT_coordinate_frame
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16))
- {
- ret = GLEW_EXT_coordinate_frame;
- continue;
- }
-#endif
-#ifdef GL_EXT_copy_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12))
- {
- ret = GLEW_EXT_copy_texture;
- continue;
- }
-#endif
-#ifdef GL_EXT_cull_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11))
- {
- ret = GLEW_EXT_cull_vertex;
- continue;
- }
-#endif
-#ifdef GL_EXT_debug_marker
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_marker", 12))
- {
- ret = GLEW_EXT_debug_marker;
- continue;
- }
-#endif
-#ifdef GL_EXT_depth_bounds_test
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17))
- {
- ret = GLEW_EXT_depth_bounds_test;
- continue;
- }
-#endif
-#ifdef GL_EXT_direct_state_access
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19))
- {
- ret = GLEW_EXT_direct_state_access;
- continue;
- }
-#endif
-#ifdef GL_EXT_draw_buffers2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13))
- {
- ret = GLEW_EXT_draw_buffers2;
- continue;
- }
-#endif
-#ifdef GL_EXT_draw_instanced
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14))
- {
- ret = GLEW_EXT_draw_instanced;
- continue;
- }
-#endif
-#ifdef GL_EXT_draw_range_elements
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19))
- {
- ret = GLEW_EXT_draw_range_elements;
- continue;
- }
-#endif
-#ifdef GL_EXT_fog_coord
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9))
- {
- ret = GLEW_EXT_fog_coord;
- continue;
- }
-#endif
-#ifdef GL_EXT_fragment_lighting
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17))
- {
- ret = GLEW_EXT_fragment_lighting;
- continue;
- }
-#endif
-#ifdef GL_EXT_framebuffer_blit
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16))
- {
- ret = GLEW_EXT_framebuffer_blit;
- continue;
- }
-#endif
-#ifdef GL_EXT_framebuffer_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23))
- {
- ret = GLEW_EXT_framebuffer_multisample;
- continue;
- }
-#endif
-#ifdef GL_EXT_framebuffer_multisample_blit_scaled
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_blit_scaled", 35))
- {
- ret = GLEW_EXT_framebuffer_multisample_blit_scaled;
- continue;
- }
-#endif
-#ifdef GL_EXT_framebuffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18))
- {
- ret = GLEW_EXT_framebuffer_object;
- continue;
- }
-#endif
-#ifdef GL_EXT_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = GLEW_EXT_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef GL_EXT_geometry_shader4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
- {
- ret = GLEW_EXT_geometry_shader4;
- continue;
- }
-#endif
-#ifdef GL_EXT_gpu_program_parameters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22))
- {
- ret = GLEW_EXT_gpu_program_parameters;
- continue;
- }
-#endif
-#ifdef GL_EXT_gpu_shader4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11))
- {
- ret = GLEW_EXT_gpu_shader4;
- continue;
- }
-#endif
-#ifdef GL_EXT_histogram
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9))
- {
- ret = GLEW_EXT_histogram;
- continue;
- }
-#endif
-#ifdef GL_EXT_index_array_formats
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19))
- {
- ret = GLEW_EXT_index_array_formats;
- continue;
- }
-#endif
-#ifdef GL_EXT_index_func
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10))
- {
- ret = GLEW_EXT_index_func;
- continue;
- }
-#endif
-#ifdef GL_EXT_index_material
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14))
- {
- ret = GLEW_EXT_index_material;
- continue;
- }
-#endif
-#ifdef GL_EXT_index_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13))
- {
- ret = GLEW_EXT_index_texture;
- continue;
- }
-#endif
-#ifdef GL_EXT_light_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13))
- {
- ret = GLEW_EXT_light_texture;
- continue;
- }
-#endif
-#ifdef GL_EXT_misc_attribute
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14))
- {
- ret = GLEW_EXT_misc_attribute;
- continue;
- }
-#endif
-#ifdef GL_EXT_multi_draw_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17))
- {
- ret = GLEW_EXT_multi_draw_arrays;
- continue;
- }
-#endif
-#ifdef GL_EXT_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLEW_EXT_multisample;
- continue;
- }
-#endif
-#ifdef GL_EXT_packed_depth_stencil
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20))
- {
- ret = GLEW_EXT_packed_depth_stencil;
- continue;
- }
-#endif
-#ifdef GL_EXT_packed_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12))
- {
- ret = GLEW_EXT_packed_float;
- continue;
- }
-#endif
-#ifdef GL_EXT_packed_pixels
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13))
- {
- ret = GLEW_EXT_packed_pixels;
- continue;
- }
-#endif
-#ifdef GL_EXT_paletted_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16))
- {
- ret = GLEW_EXT_paletted_texture;
- continue;
- }
-#endif
-#ifdef GL_EXT_pixel_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19))
- {
- ret = GLEW_EXT_pixel_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_EXT_pixel_transform
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15))
- {
- ret = GLEW_EXT_pixel_transform;
- continue;
- }
-#endif
-#ifdef GL_EXT_pixel_transform_color_table
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27))
- {
- ret = GLEW_EXT_pixel_transform_color_table;
- continue;
- }
-#endif
-#ifdef GL_EXT_point_parameters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16))
- {
- ret = GLEW_EXT_point_parameters;
- continue;
- }
-#endif
-#ifdef GL_EXT_polygon_offset
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14))
- {
- ret = GLEW_EXT_polygon_offset;
- continue;
- }
-#endif
-#ifdef GL_EXT_provoking_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16))
- {
- ret = GLEW_EXT_provoking_vertex;
- continue;
- }
-#endif
-#ifdef GL_EXT_rescale_normal
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14))
- {
- ret = GLEW_EXT_rescale_normal;
- continue;
- }
-#endif
-#ifdef GL_EXT_scene_marker
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12))
- {
- ret = GLEW_EXT_scene_marker;
- continue;
- }
-#endif
-#ifdef GL_EXT_secondary_color
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15))
- {
- ret = GLEW_EXT_secondary_color;
- continue;
- }
-#endif
-#ifdef GL_EXT_separate_shader_objects
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23))
- {
- ret = GLEW_EXT_separate_shader_objects;
- continue;
- }
-#endif
-#ifdef GL_EXT_separate_specular_color
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23))
- {
- ret = GLEW_EXT_separate_specular_color;
- continue;
- }
-#endif
-#ifdef GL_EXT_shader_image_load_store
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23))
- {
- ret = GLEW_EXT_shader_image_load_store;
- continue;
- }
-#endif
-#ifdef GL_EXT_shadow_funcs
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12))
- {
- ret = GLEW_EXT_shadow_funcs;
- continue;
- }
-#endif
-#ifdef GL_EXT_shared_texture_palette
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22))
- {
- ret = GLEW_EXT_shared_texture_palette;
- continue;
- }
-#endif
-#ifdef GL_EXT_stencil_clear_tag
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17))
- {
- ret = GLEW_EXT_stencil_clear_tag;
- continue;
- }
-#endif
-#ifdef GL_EXT_stencil_two_side
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16))
- {
- ret = GLEW_EXT_stencil_two_side;
- continue;
- }
-#endif
-#ifdef GL_EXT_stencil_wrap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12))
- {
- ret = GLEW_EXT_stencil_wrap;
- continue;
- }
-#endif
-#ifdef GL_EXT_subtexture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10))
- {
- ret = GLEW_EXT_subtexture;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7))
- {
- ret = GLEW_EXT_texture;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture3D
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9))
- {
- ret = GLEW_EXT_texture3D;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13))
- {
- ret = GLEW_EXT_texture_array;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21))
- {
- ret = GLEW_EXT_texture_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_compression_dxt1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24))
- {
- ret = GLEW_EXT_texture_compression_dxt1;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_compression_latc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24))
- {
- ret = GLEW_EXT_texture_compression_latc;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_compression_rgtc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24))
- {
- ret = GLEW_EXT_texture_compression_rgtc;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_compression_s3tc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24))
- {
- ret = GLEW_EXT_texture_compression_s3tc;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_cube_map
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16))
- {
- ret = GLEW_EXT_texture_cube_map;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_edge_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18))
- {
- ret = GLEW_EXT_texture_edge_clamp;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_env
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11))
- {
- ret = GLEW_EXT_texture_env;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_env_add
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15))
- {
- ret = GLEW_EXT_texture_env_add;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_env_combine
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19))
- {
- ret = GLEW_EXT_texture_env_combine;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_env_dot3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16))
- {
- ret = GLEW_EXT_texture_env_dot3;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_filter_anisotropic
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26))
- {
- ret = GLEW_EXT_texture_filter_anisotropic;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_integer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15))
- {
- ret = GLEW_EXT_texture_integer;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_lod_bias
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16))
- {
- ret = GLEW_EXT_texture_lod_bias;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_mirror_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20))
- {
- ret = GLEW_EXT_texture_mirror_clamp;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14))
- {
- ret = GLEW_EXT_texture_object;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_perturb_normal
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22))
- {
- ret = GLEW_EXT_texture_perturb_normal;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_rectangle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17))
- {
- ret = GLEW_EXT_texture_rectangle;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12))
- {
- ret = GLEW_EXT_texture_sRGB;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_sRGB_decode
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19))
- {
- ret = GLEW_EXT_texture_sRGB_decode;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_shared_exponent
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23))
- {
- ret = GLEW_EXT_texture_shared_exponent;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_snorm
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13))
- {
- ret = GLEW_EXT_texture_snorm;
- continue;
- }
-#endif
-#ifdef GL_EXT_texture_swizzle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15))
- {
- ret = GLEW_EXT_texture_swizzle;
- continue;
- }
-#endif
-#ifdef GL_EXT_timer_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11))
- {
- ret = GLEW_EXT_timer_query;
- continue;
- }
-#endif
-#ifdef GL_EXT_transform_feedback
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18))
- {
- ret = GLEW_EXT_transform_feedback;
- continue;
- }
-#endif
-#ifdef GL_EXT_vertex_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12))
- {
- ret = GLEW_EXT_vertex_array;
- continue;
- }
-#endif
-#ifdef GL_EXT_vertex_array_bgra
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17))
- {
- ret = GLEW_EXT_vertex_array_bgra;
- continue;
- }
-#endif
-#ifdef GL_EXT_vertex_attrib_64bit
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19))
- {
- ret = GLEW_EXT_vertex_attrib_64bit;
- continue;
- }
-#endif
-#ifdef GL_EXT_vertex_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13))
- {
- ret = GLEW_EXT_vertex_shader;
- continue;
- }
-#endif
-#ifdef GL_EXT_vertex_weighting
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16))
- {
- ret = GLEW_EXT_vertex_weighting;
- continue;
- }
-#endif
-#ifdef GL_EXT_x11_sync_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"x11_sync_object", 15))
- {
- ret = GLEW_EXT_x11_sync_object;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8))
- {
-#ifdef GL_GREMEDY_frame_terminator
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16))
- {
- ret = GLEW_GREMEDY_frame_terminator;
- continue;
- }
-#endif
-#ifdef GL_GREMEDY_string_marker
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13))
- {
- ret = GLEW_GREMEDY_string_marker;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3))
- {
-#ifdef GL_HP_convolution_border_modes
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24))
- {
- ret = GLEW_HP_convolution_border_modes;
- continue;
- }
-#endif
-#ifdef GL_HP_image_transform
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15))
- {
- ret = GLEW_HP_image_transform;
- continue;
- }
-#endif
-#ifdef GL_HP_occlusion_test
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14))
- {
- ret = GLEW_HP_occlusion_test;
- continue;
- }
-#endif
-#ifdef GL_HP_texture_lighting
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16))
- {
- ret = GLEW_HP_texture_lighting;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4))
- {
-#ifdef GL_IBM_cull_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11))
- {
- ret = GLEW_IBM_cull_vertex;
- continue;
- }
-#endif
-#ifdef GL_IBM_multimode_draw_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21))
- {
- ret = GLEW_IBM_multimode_draw_arrays;
- continue;
- }
-#endif
-#ifdef GL_IBM_rasterpos_clip
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14))
- {
- ret = GLEW_IBM_rasterpos_clip;
- continue;
- }
-#endif
-#ifdef GL_IBM_static_data
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11))
- {
- ret = GLEW_IBM_static_data;
- continue;
- }
-#endif
-#ifdef GL_IBM_texture_mirrored_repeat
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23))
- {
- ret = GLEW_IBM_texture_mirrored_repeat;
- continue;
- }
-#endif
-#ifdef GL_IBM_vertex_array_lists
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18))
- {
- ret = GLEW_IBM_vertex_array_lists;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5))
- {
-#ifdef GL_INGR_color_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11))
- {
- ret = GLEW_INGR_color_clamp;
- continue;
- }
-#endif
-#ifdef GL_INGR_interlace_read
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14))
- {
- ret = GLEW_INGR_interlace_read;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6))
- {
-#ifdef GL_INTEL_map_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_texture", 11))
- {
- ret = GLEW_INTEL_map_texture;
- continue;
- }
-#endif
-#ifdef GL_INTEL_parallel_arrays
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15))
- {
- ret = GLEW_INTEL_parallel_arrays;
- continue;
- }
-#endif
-#ifdef GL_INTEL_texture_scissor
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15))
- {
- ret = GLEW_INTEL_texture_scissor;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"KHR_", 4))
- {
-#ifdef GL_KHR_debug
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug", 5))
- {
- ret = GLEW_KHR_debug;
- continue;
- }
-#endif
-#ifdef GL_KHR_texture_compression_astc_ldr
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_astc_ldr", 28))
- {
- ret = GLEW_KHR_texture_compression_astc_ldr;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4))
- {
-#ifdef GL_KTX_buffer_region
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13))
- {
- ret = GLEW_KTX_buffer_region;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6))
- {
-#ifdef GL_MESAX_texture_stack
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13))
- {
- ret = GLEW_MESAX_texture_stack;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5))
- {
-#ifdef GL_MESA_pack_invert
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11))
- {
- ret = GLEW_MESA_pack_invert;
- continue;
- }
-#endif
-#ifdef GL_MESA_resize_buffers
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14))
- {
- ret = GLEW_MESA_resize_buffers;
- continue;
- }
-#endif
-#ifdef GL_MESA_window_pos
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10))
- {
- ret = GLEW_MESA_window_pos;
- continue;
- }
-#endif
-#ifdef GL_MESA_ycbcr_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13))
- {
- ret = GLEW_MESA_ycbcr_texture;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4))
- {
-#ifdef GL_NVX_conditional_render
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18))
- {
- ret = GLEW_NVX_conditional_render;
- continue;
- }
-#endif
-#ifdef GL_NVX_gpu_memory_info
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15))
- {
- ret = GLEW_NVX_gpu_memory_info;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3))
- {
-#ifdef GL_NV_bindless_multi_draw_indirect
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_multi_draw_indirect", 28))
- {
- ret = GLEW_NV_bindless_multi_draw_indirect;
- continue;
- }
-#endif
-#ifdef GL_NV_bindless_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindless_texture", 16))
- {
- ret = GLEW_NV_bindless_texture;
- continue;
- }
-#endif
-#ifdef GL_NV_blend_equation_advanced
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced", 23))
- {
- ret = GLEW_NV_blend_equation_advanced;
- continue;
- }
-#endif
-#ifdef GL_NV_blend_equation_advanced_coherent
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_advanced_coherent", 32))
- {
- ret = GLEW_NV_blend_equation_advanced_coherent;
- continue;
- }
-#endif
-#ifdef GL_NV_blend_square
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12))
- {
- ret = GLEW_NV_blend_square;
- continue;
- }
-#endif
-#ifdef GL_NV_compute_program5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compute_program5", 16))
- {
- ret = GLEW_NV_compute_program5;
- continue;
- }
-#endif
-#ifdef GL_NV_conditional_render
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18))
- {
- ret = GLEW_NV_conditional_render;
- continue;
- }
-#endif
-#ifdef GL_NV_copy_depth_to_color
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19))
- {
- ret = GLEW_NV_copy_depth_to_color;
- continue;
- }
-#endif
-#ifdef GL_NV_copy_image
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10))
- {
- ret = GLEW_NV_copy_image;
- continue;
- }
-#endif
-#ifdef GL_NV_deep_texture3D
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"deep_texture3D", 14))
- {
- ret = GLEW_NV_deep_texture3D;
- continue;
- }
-#endif
-#ifdef GL_NV_depth_buffer_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18))
- {
- ret = GLEW_NV_depth_buffer_float;
- continue;
- }
-#endif
-#ifdef GL_NV_depth_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11))
- {
- ret = GLEW_NV_depth_clamp;
- continue;
- }
-#endif
-#ifdef GL_NV_depth_range_unclamped
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21))
- {
- ret = GLEW_NV_depth_range_unclamped;
- continue;
- }
-#endif
-#ifdef GL_NV_draw_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_texture", 12))
- {
- ret = GLEW_NV_draw_texture;
- continue;
- }
-#endif
-#ifdef GL_NV_evaluators
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10))
- {
- ret = GLEW_NV_evaluators;
- continue;
- }
-#endif
-#ifdef GL_NV_explicit_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20))
- {
- ret = GLEW_NV_explicit_multisample;
- continue;
- }
-#endif
-#ifdef GL_NV_fence
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5))
- {
- ret = GLEW_NV_fence;
- continue;
- }
-#endif
-#ifdef GL_NV_float_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12))
- {
- ret = GLEW_NV_float_buffer;
- continue;
- }
-#endif
-#ifdef GL_NV_fog_distance
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12))
- {
- ret = GLEW_NV_fog_distance;
- continue;
- }
-#endif
-#ifdef GL_NV_fragment_program
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16))
- {
- ret = GLEW_NV_fragment_program;
- continue;
- }
-#endif
-#ifdef GL_NV_fragment_program2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17))
- {
- ret = GLEW_NV_fragment_program2;
- continue;
- }
-#endif
-#ifdef GL_NV_fragment_program4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17))
- {
- ret = GLEW_NV_fragment_program4;
- continue;
- }
-#endif
-#ifdef GL_NV_fragment_program_option
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23))
- {
- ret = GLEW_NV_fragment_program_option;
- continue;
- }
-#endif
-#ifdef GL_NV_framebuffer_multisample_coverage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32))
- {
- ret = GLEW_NV_framebuffer_multisample_coverage;
- continue;
- }
-#endif
-#ifdef GL_NV_geometry_program4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17))
- {
- ret = GLEW_NV_geometry_program4;
- continue;
- }
-#endif
-#ifdef GL_NV_geometry_shader4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16))
- {
- ret = GLEW_NV_geometry_shader4;
- continue;
- }
-#endif
-#ifdef GL_NV_gpu_program4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12))
- {
- ret = GLEW_NV_gpu_program4;
- continue;
- }
-#endif
-#ifdef GL_NV_gpu_program5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12))
- {
- ret = GLEW_NV_gpu_program5;
- continue;
- }
-#endif
-#ifdef GL_NV_gpu_program5_mem_extended
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5_mem_extended", 25))
- {
- ret = GLEW_NV_gpu_program5_mem_extended;
- continue;
- }
-#endif
-#ifdef GL_NV_gpu_program_fp64
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16))
- {
- ret = GLEW_NV_gpu_program_fp64;
- continue;
- }
-#endif
-#ifdef GL_NV_gpu_shader5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11))
- {
- ret = GLEW_NV_gpu_shader5;
- continue;
- }
-#endif
-#ifdef GL_NV_half_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10))
- {
- ret = GLEW_NV_half_float;
- continue;
- }
-#endif
-#ifdef GL_NV_light_max_exponent
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18))
- {
- ret = GLEW_NV_light_max_exponent;
- continue;
- }
-#endif
-#ifdef GL_NV_multisample_coverage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20))
- {
- ret = GLEW_NV_multisample_coverage;
- continue;
- }
-#endif
-#ifdef GL_NV_multisample_filter_hint
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23))
- {
- ret = GLEW_NV_multisample_filter_hint;
- continue;
- }
-#endif
-#ifdef GL_NV_occlusion_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15))
- {
- ret = GLEW_NV_occlusion_query;
- continue;
- }
-#endif
-#ifdef GL_NV_packed_depth_stencil
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20))
- {
- ret = GLEW_NV_packed_depth_stencil;
- continue;
- }
-#endif
-#ifdef GL_NV_parameter_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23))
- {
- ret = GLEW_NV_parameter_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_NV_parameter_buffer_object2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24))
- {
- ret = GLEW_NV_parameter_buffer_object2;
- continue;
- }
-#endif
-#ifdef GL_NV_path_rendering
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"path_rendering", 14))
- {
- ret = GLEW_NV_path_rendering;
- continue;
- }
-#endif
-#ifdef GL_NV_pixel_data_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16))
- {
- ret = GLEW_NV_pixel_data_range;
- continue;
- }
-#endif
-#ifdef GL_NV_point_sprite
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12))
- {
- ret = GLEW_NV_point_sprite;
- continue;
- }
-#endif
-#ifdef GL_NV_present_video
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
- {
- ret = GLEW_NV_present_video;
- continue;
- }
-#endif
-#ifdef GL_NV_primitive_restart
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17))
- {
- ret = GLEW_NV_primitive_restart;
- continue;
- }
-#endif
-#ifdef GL_NV_register_combiners
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18))
- {
- ret = GLEW_NV_register_combiners;
- continue;
- }
-#endif
-#ifdef GL_NV_register_combiners2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19))
- {
- ret = GLEW_NV_register_combiners2;
- continue;
- }
-#endif
-#ifdef GL_NV_shader_atomic_counters
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_counters", 22))
- {
- ret = GLEW_NV_shader_atomic_counters;
- continue;
- }
-#endif
-#ifdef GL_NV_shader_atomic_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_atomic_float", 19))
- {
- ret = GLEW_NV_shader_atomic_float;
- continue;
- }
-#endif
-#ifdef GL_NV_shader_buffer_load
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18))
- {
- ret = GLEW_NV_shader_buffer_load;
- continue;
- }
-#endif
-#ifdef GL_NV_shader_storage_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_storage_buffer_object", 28))
- {
- ret = GLEW_NV_shader_storage_buffer_object;
- continue;
- }
-#endif
-#ifdef GL_NV_tessellation_program5
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21))
- {
- ret = GLEW_NV_tessellation_program5;
- continue;
- }
-#endif
-#ifdef GL_NV_texgen_emboss
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13))
- {
- ret = GLEW_NV_texgen_emboss;
- continue;
- }
-#endif
-#ifdef GL_NV_texgen_reflection
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17))
- {
- ret = GLEW_NV_texgen_reflection;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_barrier
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15))
- {
- ret = GLEW_NV_texture_barrier;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_compression_vtc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23))
- {
- ret = GLEW_NV_texture_compression_vtc;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_env_combine4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20))
- {
- ret = GLEW_NV_texture_env_combine4;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_expand_normal
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21))
- {
- ret = GLEW_NV_texture_expand_normal;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19))
- {
- ret = GLEW_NV_texture_multisample;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_rectangle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17))
- {
- ret = GLEW_NV_texture_rectangle;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_shader
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14))
- {
- ret = GLEW_NV_texture_shader;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_shader2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15))
- {
- ret = GLEW_NV_texture_shader2;
- continue;
- }
-#endif
-#ifdef GL_NV_texture_shader3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15))
- {
- ret = GLEW_NV_texture_shader3;
- continue;
- }
-#endif
-#ifdef GL_NV_transform_feedback
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18))
- {
- ret = GLEW_NV_transform_feedback;
- continue;
- }
-#endif
-#ifdef GL_NV_transform_feedback2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19))
- {
- ret = GLEW_NV_transform_feedback2;
- continue;
- }
-#endif
-#ifdef GL_NV_vdpau_interop
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13))
- {
- ret = GLEW_NV_vdpau_interop;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_array_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
- {
- ret = GLEW_NV_vertex_array_range;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_array_range2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19))
- {
- ret = GLEW_NV_vertex_array_range2;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_attrib_integer_64bit
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27))
- {
- ret = GLEW_NV_vertex_attrib_integer_64bit;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_buffer_unified_memory
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28))
- {
- ret = GLEW_NV_vertex_buffer_unified_memory;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14))
- {
- ret = GLEW_NV_vertex_program;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program1_1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17))
- {
- ret = GLEW_NV_vertex_program1_1;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15))
- {
- ret = GLEW_NV_vertex_program2;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program2_option
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22))
- {
- ret = GLEW_NV_vertex_program2_option;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15))
- {
- ret = GLEW_NV_vertex_program3;
- continue;
- }
-#endif
-#ifdef GL_NV_vertex_program4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15))
- {
- ret = GLEW_NV_vertex_program4;
- continue;
- }
-#endif
-#ifdef GL_NV_video_capture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13))
- {
- ret = GLEW_NV_video_capture;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4))
- {
-#ifdef GL_OES_byte_coordinates
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16))
- {
- ret = GLEW_OES_byte_coordinates;
- continue;
- }
-#endif
-#ifdef GL_OES_compressed_paletted_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27))
- {
- ret = GLEW_OES_compressed_paletted_texture;
- continue;
- }
-#endif
-#ifdef GL_OES_read_format
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11))
- {
- ret = GLEW_OES_read_format;
- continue;
- }
-#endif
-#ifdef GL_OES_single_precision
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16))
- {
- ret = GLEW_OES_single_precision;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
- {
-#ifdef GL_OML_interlace
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9))
- {
- ret = GLEW_OML_interlace;
- continue;
- }
-#endif
-#ifdef GL_OML_resample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8))
- {
- ret = GLEW_OML_resample;
- continue;
- }
-#endif
-#ifdef GL_OML_subsample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9))
- {
- ret = GLEW_OML_subsample;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4))
- {
-#ifdef GL_PGI_misc_hints
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10))
- {
- ret = GLEW_PGI_misc_hints;
- continue;
- }
-#endif
-#ifdef GL_PGI_vertex_hints
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12))
- {
- ret = GLEW_PGI_vertex_hints;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"REGAL_", 6))
- {
-#ifdef GL_REGAL_ES1_0_compatibility
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_0_compatibility", 19))
- {
- ret = GLEW_REGAL_ES1_0_compatibility;
- continue;
- }
-#endif
-#ifdef GL_REGAL_ES1_1_compatibility
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES1_1_compatibility", 19))
- {
- ret = GLEW_REGAL_ES1_1_compatibility;
- continue;
- }
-#endif
-#ifdef GL_REGAL_enable
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"enable", 6))
- {
- ret = GLEW_REGAL_enable;
- continue;
- }
-#endif
-#ifdef GL_REGAL_error_string
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"error_string", 12))
- {
- ret = GLEW_REGAL_error_string;
- continue;
- }
-#endif
-#ifdef GL_REGAL_extension_query
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"extension_query", 15))
- {
- ret = GLEW_REGAL_extension_query;
- continue;
- }
-#endif
-#ifdef GL_REGAL_log
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"log", 3))
- {
- ret = GLEW_REGAL_log;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5))
- {
-#ifdef GL_REND_screen_coordinates
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18))
- {
- ret = GLEW_REND_screen_coordinates;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3))
- {
-#ifdef GL_S3_s3tc
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4))
- {
- ret = GLEW_S3_s3tc;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5))
- {
-#ifdef GL_SGIS_color_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11))
- {
- ret = GLEW_SGIS_color_range;
- continue;
- }
-#endif
-#ifdef GL_SGIS_detail_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14))
- {
- ret = GLEW_SGIS_detail_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIS_fog_function
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12))
- {
- ret = GLEW_SGIS_fog_function;
- continue;
- }
-#endif
-#ifdef GL_SGIS_generate_mipmap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15))
- {
- ret = GLEW_SGIS_generate_mipmap;
- continue;
- }
-#endif
-#ifdef GL_SGIS_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLEW_SGIS_multisample;
- continue;
- }
-#endif
-#ifdef GL_SGIS_pixel_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13))
- {
- ret = GLEW_SGIS_pixel_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIS_point_line_texgen
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17))
- {
- ret = GLEW_SGIS_point_line_texgen;
- continue;
- }
-#endif
-#ifdef GL_SGIS_sharpen_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15))
- {
- ret = GLEW_SGIS_sharpen_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture4D
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9))
- {
- ret = GLEW_SGIS_texture4D;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture_border_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20))
- {
- ret = GLEW_SGIS_texture_border_clamp;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture_edge_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18))
- {
- ret = GLEW_SGIS_texture_edge_clamp;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture_filter4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15))
- {
- ret = GLEW_SGIS_texture_filter4;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture_lod
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11))
- {
- ret = GLEW_SGIS_texture_lod;
- continue;
- }
-#endif
-#ifdef GL_SGIS_texture_select
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14))
- {
- ret = GLEW_SGIS_texture_select;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5))
- {
-#ifdef GL_SGIX_async
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5))
- {
- ret = GLEW_SGIX_async;
- continue;
- }
-#endif
-#ifdef GL_SGIX_async_histogram
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15))
- {
- ret = GLEW_SGIX_async_histogram;
- continue;
- }
-#endif
-#ifdef GL_SGIX_async_pixel
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11))
- {
- ret = GLEW_SGIX_async_pixel;
- continue;
- }
-#endif
-#ifdef GL_SGIX_blend_alpha_minmax
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18))
- {
- ret = GLEW_SGIX_blend_alpha_minmax;
- continue;
- }
-#endif
-#ifdef GL_SGIX_clipmap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7))
- {
- ret = GLEW_SGIX_clipmap;
- continue;
- }
-#endif
-#ifdef GL_SGIX_convolution_accuracy
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20))
- {
- ret = GLEW_SGIX_convolution_accuracy;
- continue;
- }
-#endif
-#ifdef GL_SGIX_depth_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13))
- {
- ret = GLEW_SGIX_depth_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIX_flush_raster
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12))
- {
- ret = GLEW_SGIX_flush_raster;
- continue;
- }
-#endif
-#ifdef GL_SGIX_fog_offset
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10))
- {
- ret = GLEW_SGIX_fog_offset;
- continue;
- }
-#endif
-#ifdef GL_SGIX_fog_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11))
- {
- ret = GLEW_SGIX_fog_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIX_fragment_specular_lighting
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26))
- {
- ret = GLEW_SGIX_fragment_specular_lighting;
- continue;
- }
-#endif
-#ifdef GL_SGIX_framezoom
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9))
- {
- ret = GLEW_SGIX_framezoom;
- continue;
- }
-#endif
-#ifdef GL_SGIX_interlace
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9))
- {
- ret = GLEW_SGIX_interlace;
- continue;
- }
-#endif
-#ifdef GL_SGIX_ir_instrument1
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14))
- {
- ret = GLEW_SGIX_ir_instrument1;
- continue;
- }
-#endif
-#ifdef GL_SGIX_list_priority
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13))
- {
- ret = GLEW_SGIX_list_priority;
- continue;
- }
-#endif
-#ifdef GL_SGIX_pixel_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13))
- {
- ret = GLEW_SGIX_pixel_texture;
- continue;
- }
-#endif
-#ifdef GL_SGIX_pixel_texture_bits
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18))
- {
- ret = GLEW_SGIX_pixel_texture_bits;
- continue;
- }
-#endif
-#ifdef GL_SGIX_reference_plane
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15))
- {
- ret = GLEW_SGIX_reference_plane;
- continue;
- }
-#endif
-#ifdef GL_SGIX_resample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8))
- {
- ret = GLEW_SGIX_resample;
- continue;
- }
-#endif
-#ifdef GL_SGIX_shadow
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6))
- {
- ret = GLEW_SGIX_shadow;
- continue;
- }
-#endif
-#ifdef GL_SGIX_shadow_ambient
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14))
- {
- ret = GLEW_SGIX_shadow_ambient;
- continue;
- }
-#endif
-#ifdef GL_SGIX_sprite
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6))
- {
- ret = GLEW_SGIX_sprite;
- continue;
- }
-#endif
-#ifdef GL_SGIX_tag_sample_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17))
- {
- ret = GLEW_SGIX_tag_sample_buffer;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_add_env
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15))
- {
- ret = GLEW_SGIX_texture_add_env;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_coordinate_clamp
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24))
- {
- ret = GLEW_SGIX_texture_coordinate_clamp;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_lod_bias
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16))
- {
- ret = GLEW_SGIX_texture_lod_bias;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_multi_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20))
- {
- ret = GLEW_SGIX_texture_multi_buffer;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13))
- {
- ret = GLEW_SGIX_texture_range;
- continue;
- }
-#endif
-#ifdef GL_SGIX_texture_scale_bias
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18))
- {
- ret = GLEW_SGIX_texture_scale_bias;
- continue;
- }
-#endif
-#ifdef GL_SGIX_vertex_preclip
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14))
- {
- ret = GLEW_SGIX_vertex_preclip;
- continue;
- }
-#endif
-#ifdef GL_SGIX_vertex_preclip_hint
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19))
- {
- ret = GLEW_SGIX_vertex_preclip_hint;
- continue;
- }
-#endif
-#ifdef GL_SGIX_ycrcb
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5))
- {
- ret = GLEW_SGIX_ycrcb;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4))
- {
-#ifdef GL_SGI_color_matrix
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12))
- {
- ret = GLEW_SGI_color_matrix;
- continue;
- }
-#endif
-#ifdef GL_SGI_color_table
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11))
- {
- ret = GLEW_SGI_color_table;
- continue;
- }
-#endif
-#ifdef GL_SGI_texture_color_table
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19))
- {
- ret = GLEW_SGI_texture_color_table;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5))
- {
-#ifdef GL_SUNX_constant_data
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13))
- {
- ret = GLEW_SUNX_constant_data;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4))
- {
-#ifdef GL_SUN_convolution_border_modes
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24))
- {
- ret = GLEW_SUN_convolution_border_modes;
- continue;
- }
-#endif
-#ifdef GL_SUN_global_alpha
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12))
- {
- ret = GLEW_SUN_global_alpha;
- continue;
- }
-#endif
-#ifdef GL_SUN_mesh_array
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10))
- {
- ret = GLEW_SUN_mesh_array;
- continue;
- }
-#endif
-#ifdef GL_SUN_read_video_pixels
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17))
- {
- ret = GLEW_SUN_read_video_pixels;
- continue;
- }
-#endif
-#ifdef GL_SUN_slice_accum
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11))
- {
- ret = GLEW_SUN_slice_accum;
- continue;
- }
-#endif
-#ifdef GL_SUN_triangle_list
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13))
- {
- ret = GLEW_SUN_triangle_list;
- continue;
- }
-#endif
-#ifdef GL_SUN_vertex
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6))
- {
- ret = GLEW_SUN_vertex;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4))
- {
-#ifdef GL_WIN_phong_shading
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13))
- {
- ret = GLEW_WIN_phong_shading;
- continue;
- }
-#endif
-#ifdef GL_WIN_specular_fog
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12))
- {
- ret = GLEW_WIN_specular_fog;
- continue;
- }
-#endif
-#ifdef GL_WIN_swap_hint
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9))
- {
- ret = GLEW_WIN_swap_hint;
- continue;
- }
-#endif
- }
- }
- ret = (len == 0);
- }
- return ret;
-}
-
-#if defined(_WIN32)
-
-#if defined(GLEW_MX)
-GLboolean GLEWAPIENTRY wglewContextIsSupported (const WGLEWContext* ctx, const char* name)
-#else
-GLboolean GLEWAPIENTRY wglewIsSupported (const char* name)
-#endif
-{
- GLubyte* pos = (GLubyte*)name;
- GLuint len = _glewStrLen(pos);
- GLboolean ret = GL_TRUE;
- while (ret && len > 0)
- {
- if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4))
- {
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5))
- {
-#ifdef WGL_3DFX_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = WGLEW_3DFX_multisample;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4))
- {
-#ifdef WGL_3DL_stereo_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14))
- {
- ret = WGLEW_3DL_stereo_control;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4))
- {
-#ifdef WGL_AMD_gpu_association
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15))
- {
- ret = WGLEW_AMD_gpu_association;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4))
- {
-#ifdef WGL_ARB_buffer_region
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13))
- {
- ret = WGLEW_ARB_buffer_region;
- continue;
- }
-#endif
-#ifdef WGL_ARB_create_context
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14))
- {
- ret = WGLEW_ARB_create_context;
- continue;
- }
-#endif
-#ifdef WGL_ARB_create_context_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22))
- {
- ret = WGLEW_ARB_create_context_profile;
- continue;
- }
-#endif
-#ifdef WGL_ARB_create_context_robustness
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25))
- {
- ret = WGLEW_ARB_create_context_robustness;
- continue;
- }
-#endif
-#ifdef WGL_ARB_extensions_string
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17))
- {
- ret = WGLEW_ARB_extensions_string;
- continue;
- }
-#endif
-#ifdef WGL_ARB_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = WGLEW_ARB_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef WGL_ARB_make_current_read
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17))
- {
- ret = WGLEW_ARB_make_current_read;
- continue;
- }
-#endif
-#ifdef WGL_ARB_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = WGLEW_ARB_multisample;
- continue;
- }
-#endif
-#ifdef WGL_ARB_pbuffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7))
- {
- ret = WGLEW_ARB_pbuffer;
- continue;
- }
-#endif
-#ifdef WGL_ARB_pixel_format
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12))
- {
- ret = WGLEW_ARB_pixel_format;
- continue;
- }
-#endif
-#ifdef WGL_ARB_pixel_format_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18))
- {
- ret = WGLEW_ARB_pixel_format_float;
- continue;
- }
-#endif
-#ifdef WGL_ARB_render_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14))
- {
- ret = WGLEW_ARB_render_texture;
- continue;
- }
-#endif
-#ifdef WGL_ARB_robustness_application_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32))
- {
- ret = WGLEW_ARB_robustness_application_isolation;
- continue;
- }
-#endif
-#ifdef WGL_ARB_robustness_share_group_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32))
- {
- ret = WGLEW_ARB_robustness_share_group_isolation;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4))
- {
-#ifdef WGL_ATI_pixel_format_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18))
- {
- ret = WGLEW_ATI_pixel_format_float;
- continue;
- }
-#endif
-#ifdef WGL_ATI_render_texture_rectangle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24))
- {
- ret = WGLEW_ATI_render_texture_rectangle;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4))
- {
-#ifdef WGL_EXT_create_context_es2_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26))
- {
- ret = WGLEW_EXT_create_context_es2_profile;
- continue;
- }
-#endif
-#ifdef WGL_EXT_create_context_es_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25))
- {
- ret = WGLEW_EXT_create_context_es_profile;
- continue;
- }
-#endif
-#ifdef WGL_EXT_depth_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11))
- {
- ret = WGLEW_EXT_depth_float;
- continue;
- }
-#endif
-#ifdef WGL_EXT_display_color_table
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19))
- {
- ret = WGLEW_EXT_display_color_table;
- continue;
- }
-#endif
-#ifdef WGL_EXT_extensions_string
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17))
- {
- ret = WGLEW_EXT_extensions_string;
- continue;
- }
-#endif
-#ifdef WGL_EXT_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = WGLEW_EXT_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef WGL_EXT_make_current_read
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17))
- {
- ret = WGLEW_EXT_make_current_read;
- continue;
- }
-#endif
-#ifdef WGL_EXT_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = WGLEW_EXT_multisample;
- continue;
- }
-#endif
-#ifdef WGL_EXT_pbuffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7))
- {
- ret = WGLEW_EXT_pbuffer;
- continue;
- }
-#endif
-#ifdef WGL_EXT_pixel_format
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12))
- {
- ret = WGLEW_EXT_pixel_format;
- continue;
- }
-#endif
-#ifdef WGL_EXT_pixel_format_packed_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25))
- {
- ret = WGLEW_EXT_pixel_format_packed_float;
- continue;
- }
-#endif
-#ifdef WGL_EXT_swap_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12))
- {
- ret = WGLEW_EXT_swap_control;
- continue;
- }
-#endif
-#ifdef WGL_EXT_swap_control_tear
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17))
- {
- ret = WGLEW_EXT_swap_control_tear;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4))
- {
-#ifdef WGL_I3D_digital_video_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21))
- {
- ret = WGLEW_I3D_digital_video_control;
- continue;
- }
-#endif
-#ifdef WGL_I3D_gamma
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5))
- {
- ret = WGLEW_I3D_gamma;
- continue;
- }
-#endif
-#ifdef WGL_I3D_genlock
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7))
- {
- ret = WGLEW_I3D_genlock;
- continue;
- }
-#endif
-#ifdef WGL_I3D_image_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12))
- {
- ret = WGLEW_I3D_image_buffer;
- continue;
- }
-#endif
-#ifdef WGL_I3D_swap_frame_lock
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15))
- {
- ret = WGLEW_I3D_swap_frame_lock;
- continue;
- }
-#endif
-#ifdef WGL_I3D_swap_frame_usage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16))
- {
- ret = WGLEW_I3D_swap_frame_usage;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3))
- {
-#ifdef WGL_NV_DX_interop
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop", 10))
- {
- ret = WGLEW_NV_DX_interop;
- continue;
- }
-#endif
-#ifdef WGL_NV_DX_interop2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"DX_interop2", 11))
- {
- ret = WGLEW_NV_DX_interop2;
- continue;
- }
-#endif
-#ifdef WGL_NV_copy_image
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10))
- {
- ret = WGLEW_NV_copy_image;
- continue;
- }
-#endif
-#ifdef WGL_NV_float_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12))
- {
- ret = WGLEW_NV_float_buffer;
- continue;
- }
-#endif
-#ifdef WGL_NV_gpu_affinity
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12))
- {
- ret = WGLEW_NV_gpu_affinity;
- continue;
- }
-#endif
-#ifdef WGL_NV_multisample_coverage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20))
- {
- ret = WGLEW_NV_multisample_coverage;
- continue;
- }
-#endif
-#ifdef WGL_NV_present_video
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
- {
- ret = WGLEW_NV_present_video;
- continue;
- }
-#endif
-#ifdef WGL_NV_render_depth_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20))
- {
- ret = WGLEW_NV_render_depth_texture;
- continue;
- }
-#endif
-#ifdef WGL_NV_render_texture_rectangle
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24))
- {
- ret = WGLEW_NV_render_texture_rectangle;
- continue;
- }
-#endif
-#ifdef WGL_NV_swap_group
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10))
- {
- ret = WGLEW_NV_swap_group;
- continue;
- }
-#endif
-#ifdef WGL_NV_vertex_array_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
- {
- ret = WGLEW_NV_vertex_array_range;
- continue;
- }
-#endif
-#ifdef WGL_NV_video_capture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13))
- {
- ret = WGLEW_NV_video_capture;
- continue;
- }
-#endif
-#ifdef WGL_NV_video_output
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12))
- {
- ret = WGLEW_NV_video_output;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
- {
-#ifdef WGL_OML_sync_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12))
- {
- ret = WGLEW_OML_sync_control;
- continue;
- }
-#endif
- }
- }
- ret = (len == 0);
- }
- return ret;
-}
-
-#elif !defined(__ANDROID__) && !defined(__native_client__) && !defined(__APPLE__) || defined(GLEW_APPLE_GLX)
-
-#if defined(GLEW_MX)
-GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name)
-#else
-GLboolean glxewIsSupported (const char* name)
-#endif
-{
- GLubyte* pos = (GLubyte*)name;
- GLuint len = _glewStrLen(pos);
- GLboolean ret = GL_TRUE;
- while (ret && len > 0)
- {
- if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4))
- {
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8))
- {
-#ifdef GLX_VERSION_1_2
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3))
- {
- ret = GLXEW_VERSION_1_2;
- continue;
- }
-#endif
-#ifdef GLX_VERSION_1_3
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3))
- {
- ret = GLXEW_VERSION_1_3;
- continue;
- }
-#endif
-#ifdef GLX_VERSION_1_4
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3))
- {
- ret = GLXEW_VERSION_1_4;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5))
- {
-#ifdef GLX_3DFX_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLXEW_3DFX_multisample;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4))
- {
-#ifdef GLX_AMD_gpu_association
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15))
- {
- ret = GLXEW_AMD_gpu_association;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4))
- {
-#ifdef GLX_ARB_create_context
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14))
- {
- ret = GLXEW_ARB_create_context;
- continue;
- }
-#endif
-#ifdef GLX_ARB_create_context_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22))
- {
- ret = GLXEW_ARB_create_context_profile;
- continue;
- }
-#endif
-#ifdef GLX_ARB_create_context_robustness
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25))
- {
- ret = GLXEW_ARB_create_context_robustness;
- continue;
- }
-#endif
-#ifdef GLX_ARB_fbconfig_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14))
- {
- ret = GLXEW_ARB_fbconfig_float;
- continue;
- }
-#endif
-#ifdef GLX_ARB_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = GLXEW_ARB_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef GLX_ARB_get_proc_address
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16))
- {
- ret = GLXEW_ARB_get_proc_address;
- continue;
- }
-#endif
-#ifdef GLX_ARB_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLXEW_ARB_multisample;
- continue;
- }
-#endif
-#ifdef GLX_ARB_robustness_application_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_application_isolation", 32))
- {
- ret = GLXEW_ARB_robustness_application_isolation;
- continue;
- }
-#endif
-#ifdef GLX_ARB_robustness_share_group_isolation
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness_share_group_isolation", 32))
- {
- ret = GLXEW_ARB_robustness_share_group_isolation;
- continue;
- }
-#endif
-#ifdef GLX_ARB_vertex_buffer_object
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20))
- {
- ret = GLXEW_ARB_vertex_buffer_object;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4))
- {
-#ifdef GLX_ATI_pixel_format_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18))
- {
- ret = GLXEW_ATI_pixel_format_float;
- continue;
- }
-#endif
-#ifdef GLX_ATI_render_texture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14))
- {
- ret = GLXEW_ATI_render_texture;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4))
- {
-#ifdef GLX_EXT_buffer_age
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_age", 10))
- {
- ret = GLXEW_EXT_buffer_age;
- continue;
- }
-#endif
-#ifdef GLX_EXT_create_context_es2_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26))
- {
- ret = GLXEW_EXT_create_context_es2_profile;
- continue;
- }
-#endif
-#ifdef GLX_EXT_create_context_es_profile
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es_profile", 25))
- {
- ret = GLXEW_EXT_create_context_es_profile;
- continue;
- }
-#endif
-#ifdef GLX_EXT_fbconfig_packed_float
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21))
- {
- ret = GLXEW_EXT_fbconfig_packed_float;
- continue;
- }
-#endif
-#ifdef GLX_EXT_framebuffer_sRGB
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16))
- {
- ret = GLXEW_EXT_framebuffer_sRGB;
- continue;
- }
-#endif
-#ifdef GLX_EXT_import_context
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14))
- {
- ret = GLXEW_EXT_import_context;
- continue;
- }
-#endif
-#ifdef GLX_EXT_scene_marker
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12))
- {
- ret = GLXEW_EXT_scene_marker;
- continue;
- }
-#endif
-#ifdef GLX_EXT_swap_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12))
- {
- ret = GLXEW_EXT_swap_control;
- continue;
- }
-#endif
-#ifdef GLX_EXT_swap_control_tear
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control_tear", 17))
- {
- ret = GLXEW_EXT_swap_control_tear;
- continue;
- }
-#endif
-#ifdef GLX_EXT_texture_from_pixmap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19))
- {
- ret = GLXEW_EXT_texture_from_pixmap;
- continue;
- }
-#endif
-#ifdef GLX_EXT_visual_info
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11))
- {
- ret = GLXEW_EXT_visual_info;
- continue;
- }
-#endif
-#ifdef GLX_EXT_visual_rating
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13))
- {
- ret = GLXEW_EXT_visual_rating;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6))
- {
-#ifdef GLX_INTEL_swap_event
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10))
- {
- ret = GLXEW_INTEL_swap_event;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5))
- {
-#ifdef GLX_MESA_agp_offset
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10))
- {
- ret = GLXEW_MESA_agp_offset;
- continue;
- }
-#endif
-#ifdef GLX_MESA_copy_sub_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15))
- {
- ret = GLXEW_MESA_copy_sub_buffer;
- continue;
- }
-#endif
-#ifdef GLX_MESA_pixmap_colormap
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15))
- {
- ret = GLXEW_MESA_pixmap_colormap;
- continue;
- }
-#endif
-#ifdef GLX_MESA_release_buffers
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15))
- {
- ret = GLXEW_MESA_release_buffers;
- continue;
- }
-#endif
-#ifdef GLX_MESA_set_3dfx_mode
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13))
- {
- ret = GLXEW_MESA_set_3dfx_mode;
- continue;
- }
-#endif
-#ifdef GLX_MESA_swap_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12))
- {
- ret = GLXEW_MESA_swap_control;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3))
- {
-#ifdef GLX_NV_copy_image
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10))
- {
- ret = GLXEW_NV_copy_image;
- continue;
- }
-#endif
-#ifdef GLX_NV_float_buffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12))
- {
- ret = GLXEW_NV_float_buffer;
- continue;
- }
-#endif
-#ifdef GLX_NV_multisample_coverage
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20))
- {
- ret = GLXEW_NV_multisample_coverage;
- continue;
- }
-#endif
-#ifdef GLX_NV_present_video
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13))
- {
- ret = GLXEW_NV_present_video;
- continue;
- }
-#endif
-#ifdef GLX_NV_swap_group
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10))
- {
- ret = GLXEW_NV_swap_group;
- continue;
- }
-#endif
-#ifdef GLX_NV_vertex_array_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18))
- {
- ret = GLXEW_NV_vertex_array_range;
- continue;
- }
-#endif
-#ifdef GLX_NV_video_capture
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_capture", 13))
- {
- ret = GLXEW_NV_video_capture;
- continue;
- }
-#endif
-#ifdef GLX_NV_video_output
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12))
- {
- ret = GLXEW_NV_video_output;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4))
- {
-#ifdef GLX_OML_swap_method
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11))
- {
- ret = GLXEW_OML_swap_method;
- continue;
- }
-#endif
-#ifdef GLX_OML_sync_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12))
- {
- ret = GLXEW_OML_sync_control;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5))
- {
-#ifdef GLX_SGIS_blended_overlay
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15))
- {
- ret = GLXEW_SGIS_blended_overlay;
- continue;
- }
-#endif
-#ifdef GLX_SGIS_color_range
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11))
- {
- ret = GLXEW_SGIS_color_range;
- continue;
- }
-#endif
-#ifdef GLX_SGIS_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11))
- {
- ret = GLXEW_SGIS_multisample;
- continue;
- }
-#endif
-#ifdef GLX_SGIS_shared_multisample
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18))
- {
- ret = GLXEW_SGIS_shared_multisample;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5))
- {
-#ifdef GLX_SGIX_fbconfig
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8))
- {
- ret = GLXEW_SGIX_fbconfig;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_hyperpipe
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9))
- {
- ret = GLXEW_SGIX_hyperpipe;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_pbuffer
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7))
- {
- ret = GLXEW_SGIX_pbuffer;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_swap_barrier
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12))
- {
- ret = GLXEW_SGIX_swap_barrier;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_swap_group
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10))
- {
- ret = GLXEW_SGIX_swap_group;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_video_resize
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12))
- {
- ret = GLXEW_SGIX_video_resize;
- continue;
- }
-#endif
-#ifdef GLX_SGIX_visual_select_group
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19))
- {
- ret = GLXEW_SGIX_visual_select_group;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4))
- {
-#ifdef GLX_SGI_cushion
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7))
- {
- ret = GLXEW_SGI_cushion;
- continue;
- }
-#endif
-#ifdef GLX_SGI_make_current_read
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17))
- {
- ret = GLXEW_SGI_make_current_read;
- continue;
- }
-#endif
-#ifdef GLX_SGI_swap_control
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12))
- {
- ret = GLXEW_SGI_swap_control;
- continue;
- }
-#endif
-#ifdef GLX_SGI_video_sync
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10))
- {
- ret = GLXEW_SGI_video_sync;
- continue;
- }
-#endif
- }
- if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4))
- {
-#ifdef GLX_SUN_get_transparent_index
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21))
- {
- ret = GLXEW_SUN_get_transparent_index;
- continue;
- }
-#endif
-#ifdef GLX_SUN_video_resize
- if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12))
- {
- ret = GLXEW_SUN_video_resize;
- continue;
- }
-#endif
- }
- }
- ret = (len == 0);
- }
- return ret;
-}
-
-#endif /* _WIN32 */
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/LICENSE b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/LICENSE
deleted file mode 100644
index 3ab103c551..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/LICENSE
+++ /dev/null
@@ -1,16 +0,0 @@
-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.
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/README.md
deleted file mode 100644
index 7ff1008a39..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/README.md
+++ /dev/null
@@ -1,137 +0,0 @@
-# Native File Dialog #
-
-A tiny, neat C library that portably invokes native file open and save dialogs. Write dialog code once and have it pop up native dialogs on all supported platforms. Avoid linking large dependencies like wxWidgets and qt.
-
-Features:
-
- - Lean C API, static library -- no ObjC, no C++, no STL.
- - Zlib licensed.
- - Consistent UTF-8 support on all platforms.
- - Simple universal file filter syntax.
- - Paid support available.
- - Multiple file selection support.
- - 64-bit and 32-bit friendly.
- - GCC, Clang and Visual Studio supported.
- - No third party dependencies.
- - Support for Vista's modern `IFileDialog` on Windows.
- - Support for non-deprecated Cocoa APIs on OS X.
- - GTK+3 dialog on Linux.
- - Tested, works alongside [http://www.libsdl.org](SDL2) on all platforms, for the game developers out there.
-
-# Example Usage #
-
-```C
-#include <nfd.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-int main( void )
-{
- nfdchar_t *outPath = NULL;
- nfdresult_t result = NFD_OpenDialog( NULL, NULL, &outPath );
-
- if ( result == NFD_OKAY ) {
- puts("Success!");
- puts(outPath);
- free(outPath);
- }
- else if ( result == NFD_CANCEL ) {
- puts("User pressed cancel.");
- }
- else {
- printf("Error: %s\n", NFD_GetError() );
- }
-
- return 0;
-}
-```
-
-See [NFD.h](src/include/nfd.h) for more options.
-
-# Screenshots #
-
-![Windows 8 rendering an IFileOpenDialog](screens/open_win8.png?raw=true)
-![GTK3 on Linux](screens/open_gtk3.png?raw=true)
-![Cocoa on Yosemite](screens/open_cocoa.png?raw=true)
-
-
-## Building ##
-
-NFD uses [SCons](http://www.scons.org) for cross-platform builds. After installing SCons, build it with:
-
- cd src
- scons debug=[0,1]
-
-Alternatively, you can avoid Scons by just including NFD files to your existing project:
-
- 1. Add all header files in `src/` and `src/include` to your project.
- 2. Add `src/include` to your include search path or copy it into your existing search path.
- 3. Add `src/nfd_common.c` to your project.
- 4. Add `src/nfd_<platform>` to your project, where `<platform>` is the NFD backend for the platform you are fixing to build.
- 5. On Visual Studio, define `_CRT_SECURE_NO_WARNINGS` to avoid warnings.
-
-### Compiling Your Programs ###
-
- 1. Add `src/include` to your include search path.
- 2. Add `nfd.lib` to the list of list of static libraries to link against.
- 3. Add `src/` to the library search path.
-
-On Linux, you must compile and link against GTK+. Recommend use of `pkg-config --cflags --libs gtk+-3.0`.
-
-On Mac OS X, add `AppKit` to the list of frameworks.
-
-On Windows, ensure you are building against `comctl32.lib`.
-
-## Usage ##
-
-See `NFD.h` for API calls. See `tests/*.c` for example code.
-
-See `tests/SConstruct` for a working build script that compiles on all platforms.
-
-## File Filter Syntax ##
-
-There is a form of file filtering in every file dialog, but no consistent means of supporting it. NFD provides support for filtering files by groups of extensions, providing its own descriptions (where applicable) for the extensions.
-
-A wildcard filter is always added to every dialog.
-
-### Separators ###
-
- - `;` Begin a new filter.
- - `,` Add a separate type to the filter.
-
-#### Examples ####
-
-`txt` The default filter is for text files. There is a wildcard option in a dropdown.
-
-`png,jpg;psd` The default filter is for png and jpg files. A second filter is available for psd files. There is a wildcard option in a dropdown.
-
-`NULL` Wildcard only.
-
-## Iterating Over PathSets ##
-
-See [test_opendialogmultiple.c](test/test_opendialogmultiple.c).
-
-# Known Limitations #
-
-I accept quality code patches, or will resolve these and other matters through support.
-
- - No support for Windows XP's legacy dialogs such as `GetOpenFileName`.
- - No support for file filter names -- ex: "Image Files" (*.png, *.jpg). Nameless filters are supported, though.
- - No support for selecting folders instead of files.
- - On Linux, GTK+ cannot be uninitialized to save memory. Launching a file dialog costs memory. I am open to accepting an alternative `nfd_zenity.c` implementation which uses Zenity and pipes.
-
-# Copyright and Credit #
-
-Copyright &copy; 2014 [Frogtoss Games](http://www.frogtoss.com), Inc.
-File [LICENSE](LICENSE) covers all files in this repo.
-
-Native File Dialog by Michael Labbe
-<mike@frogtoss.com>
-
-Tomasz Konojacki for [microutf8](http://puszcza.gnu.org.ua/software/microutf8/)
-
-## Support ##
-
-Directed support for this work is available from the original author under a paid agreement.
-
-[Contact Frogtoss Games](http://www.frogtoss.com/pages/contact.html).
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_cocoa.png b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_cocoa.png
deleted file mode 100644
index 932306ebac..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_cocoa.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_gtk3.png b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_gtk3.png
deleted file mode 100644
index f835396e66..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_gtk3.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_win8.png b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_win8.png
deleted file mode 100644
index 3ce0a5a3fa..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/screens/open_win8.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/SConstruct b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/SConstruct
deleted file mode 100644
index 342fa1a3a8..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/SConstruct
+++ /dev/null
@@ -1,99 +0,0 @@
-#
-# Native File Dialog
-#
-# Scons build script -- GCC, Clang, Visual Studio
-# Does not build test
-
-
-import os
-
-
-# target arch is build arch -- extend here for OS cross compiling
-target_os=str(Platform())
-
-# Corresponds to TARGET_ARCH set to environ.
-target_arch = ARGUMENTS.get('target_arch', None)
-
-# visual studio does not import from environment
-if target_os != 'win32':
- IMPORT_FROM_ENV =['CC', 'CXX', 'CFLAGS', 'CXXFLAGS', 'ARFLAGS']
-else:
- IMPORT_FROM_ENV =[]
-
-
-debug = int(ARGUMENTS.get( 'debug', 0 ))
-
-nfd_files = ['nfd_common.c']
-
-# Due to a Scons limitation, TARGET_ARCH cannot be appended to an existing environment.
-if target_arch != None:
- nfd_env = Environment( TARGET_ARCH=target_arch )
-else:
- nfd_env = Environment()
-
-# import specific environment variables from the command line, overriding
-# Scons environment defaults
-for env_key in IMPORT_FROM_ENV:
- if env_key in os.environ:
- print "Making %s => %s" % ( env_key, os.environ[env_key] )
- nfd_env[env_key] = os.environ[env_key]
-
-# Windows runtime library types
-win_rtl = {'debug': '/MDd',
- 'release': '/MD'}
-
-def set_debug(env):
- if target_os == 'win32':
- env.Append( CCFLAGS=['/Z7', # obj contains full symbols
- win_rtl['debug']
- ])
- else:
- env.Append( CFLAGS=['-g'] )
-
-
-def set_release(env):
- if target_os == 'win32':
- env.Append( CCFLAGS=[win_rtl['release'],
- '/O2'] )
- else:
- env.Append( CFLAGS=['-O3'] )
-
-
-def set_warnings(env):
- if target_os == 'win32':
- env.Append( CCFLAGS=['/W3'],
- CPPDEFINES=['_CRT_SECURE_NO_WARNINGS'] )
- else:
- env.Append( CFLAGS=['-Wall', '-pedantic'] )
-
-
-def get_lib_name(base, is_debug):
- if is_debug:
- return base + '_d'
- else:
- return base
-
-
-# Cocoa OS X builds - clang
-if target_os == 'darwin':
- nfd_files.append('nfd_cocoa.m')
- nfd_env.CC='clang -fcolor-diagnostics'
-
-# Linux GTK+ 3 builds - GCC
-elif target_os == 'posix':
- nfd_files.append('nfd_gtk.c')
- nfd_env.ParseConfig( 'pkg-config --cflags gtk+-3.0' )
-
-# Windows builds - Visual Studio
-elif target_os == 'win32':
- nfd_files.append('nfd_win.cpp')
-
-if debug:
- set_debug(nfd_env)
-else:
- set_release(nfd_env)
-
-set_warnings(nfd_env)
-
-nfd_env.Append( CPPPATH=['.','./include'] )
-nfd_env.StaticLibrary( get_lib_name('nfd', debug), nfd_files )
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/common.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/common.h
deleted file mode 100644
index 688b0b1fdc..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/common.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- Native File Dialog
-
- Internal, common across platforms
-
- http://www.frogtoss.com/labs
- */
-
-
-#ifndef _NFD_COMMON_H
-#define _NFD_COMMON_H
-
-#define NFD_MAX_STRLEN 256
-#define _NFD_UNUSED(x) ((void)x)
-
-void *NFDi_Malloc( size_t bytes );
-void NFDi_Free( void *ptr );
-void NFDi_SetError( const char *msg );
-void NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy );
-
-#endif
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/include/nfd.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/include/nfd.h
deleted file mode 100644
index 03fe532069..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/include/nfd.h
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- Native File Dialog
-
- User API
-
- http://www.frogtoss.com/labs
- */
-
-
-#ifndef _NFD_H
-#define _NFD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <stddef.h>
-
-/* denotes UTF-8 char */
-typedef char nfdchar_t;
-
-/* opaque data structure -- see NFD_PathSet_* */
-typedef struct {
- nfdchar_t *buf;
- size_t *indices; /* byte offsets into buf */
- size_t count; /* number of indices into buf */
-}nfdpathset_t;
-
-typedef enum {
- NFD_ERROR, /* programmatic error */
- NFD_OKAY, /* user pressed okay, or successful return */
- NFD_CANCEL /* user pressed cancel */
-}nfdresult_t;
-
-
-/* nfd_<targetplatform>.c */
-
-/* single file open dialog */
-nfdresult_t NFD_OpenDialog( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath );
-
-/* multiple file open dialog */
-nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdpathset_t *outPaths );
-
-/* save dialog */
-nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath );
-
-/* nfd_common.c */
-
-/* get last error -- set when nfdresult_t returns NFD_ERROR */
-const char *NFD_GetError( void );
-/* get the number of entries stored in pathSet */
-size_t NFD_PathSet_GetCount( const nfdpathset_t *pathSet );
-/* Get the UTF-8 path at offset index */
-nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathSet, size_t index );
-/* Free the pathSet */
-void NFD_PathSet_Free( nfdpathset_t *pathSet );
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m
deleted file mode 100644
index a73e15714a..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m
+++ /dev/null
@@ -1,235 +0,0 @@
-/*
- Native File Dialog
-
- http://www.frogtoss.com/labs
- */
-
-#include <AppKit/AppKit.h>
-#include "nfd.h"
-#include "nfd_common.h"
-
-static NSArray *BuildAllowedFileTypes( const char *filterList )
-{
- // Commas and semicolons are the same thing on this platform
-
- NSMutableArray *buildFilterList = [[NSMutableArray alloc] init];
-
- char typebuf[NFD_MAX_STRLEN] = {0};
-
- size_t filterListLen = strlen(filterList);
- char *p_typebuf = typebuf;
- for ( size_t i = 0; i < filterListLen+1; ++i )
- {
- if ( filterList[i] == ',' || filterList[i] == ';' || filterList[i] == '\0' )
- {
- ++p_typebuf;
- *p_typebuf = '\0';
- NSString *thisType = [NSString stringWithUTF8String: typebuf];
- [buildFilterList addObject:thisType];
- p_typebuf = typebuf;
- *p_typebuf = '\0';
- }
- else
- {
- *p_typebuf = filterList[i];
- ++p_typebuf;
-
- }
- }
-
- NSArray *returnArray = [NSArray arrayWithArray:buildFilterList];
-
- [buildFilterList release];
- return returnArray;
-}
-
-static void AddFilterListToDialog( NSSavePanel *dialog, const char *filterList )
-{
- if ( !filterList || strlen(filterList) == 0 )
- return;
-
- NSArray *allowedFileTypes = BuildAllowedFileTypes( filterList );
- if ( [allowedFileTypes count] != 0 )
- {
- [dialog setAllowedFileTypes:allowedFileTypes];
- }
-}
-
-static void SetDefaultPath( NSSavePanel *dialog, const nfdchar_t *defaultPath )
-{
- if ( !defaultPath || strlen(defaultPath) == 0 )
- return;
-
- NSString *defaultPathString = [NSString stringWithUTF8String: defaultPath];
- NSURL *url = [NSURL fileURLWithPath:defaultPathString isDirectory:YES];
- [dialog setDirectoryURL:url];
-}
-
-
-/* fixme: pathset should be pathSet */
-static nfdresult_t AllocPathSet( NSArray *urls, nfdpathset_t *pathset )
-{
- assert(pathset);
- assert([urls count]);
-
- pathset->count = (size_t)[urls count];
- pathset->indices = NFDi_Malloc( sizeof(size_t)*pathset->count );
- if ( !pathset->indices )
- {
- return NFD_ERROR;
- }
-
- // count the total space needed for buf
- size_t bufsize = 0;
- for ( NSURL *url in urls )
- {
- NSString *path = [url path];
- bufsize += [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
- }
-
- pathset->buf = NFDi_Malloc( sizeof(nfdchar_t) * bufsize );
- if ( !pathset->buf )
- {
- return NFD_ERROR;
- }
-
- // fill buf
- nfdchar_t *p_buf = pathset->buf;
- size_t count = 0;
- for ( NSURL *url in urls )
- {
- NSString *path = [url path];
- const nfdchar_t *utf8Path = [path UTF8String];
- size_t byteLen = [path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
- memcpy( p_buf, utf8Path, byteLen );
-
- ptrdiff_t index = p_buf - pathset->buf;
- assert( index >= 0 );
- pathset->indices[count] = (size_t)index;
-
- p_buf += byteLen;
- ++count;
- }
-
- return NFD_OKAY;
-}
-
-/* public */
-
-
-nfdresult_t NFD_OpenDialog( const char *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSOpenPanel *dialog = [NSOpenPanel openPanel];
- [dialog setAllowsMultipleSelection:NO];
-
- // Build the filter list
- AddFilterListToDialog(dialog, filterList);
-
- // Set the starting directory
- SetDefaultPath(dialog, defaultPath);
-
- nfdresult_t nfdResult = NFD_CANCEL;
- if ( [dialog runModal] == NSModalResponseOK )
- {
- NSURL *url = [dialog URL];
- const char *utf8Path = [[url path] UTF8String];
-
- // byte count, not char count
- size_t len = strlen(utf8Path);//NFDi_UTF8_Strlen(utf8Path);
-
- *outPath = NFDi_Malloc( len+1 );
- if ( !*outPath )
- {
- [pool release];
- return NFD_ERROR;
- }
- memcpy( *outPath, utf8Path, len+1 ); /* copy null term */
- nfdResult = NFD_OKAY;
- }
- [pool release];
-
- return nfdResult;
-}
-
-
-nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdpathset_t *outPaths )
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSOpenPanel *dialog = [NSOpenPanel openPanel];
- [dialog setAllowsMultipleSelection:YES];
-
- // Build the fiter list.
- AddFilterListToDialog(dialog, filterList);
-
- // Set the starting directory
- SetDefaultPath(dialog, defaultPath);
-
- nfdresult_t nfdResult = NFD_CANCEL;
- if ( [dialog runModal] == NSModalResponseOK )
- {
- NSArray *urls = [dialog URLs];
-
- if ( [urls count] == 0 )
- {
- [pool release];
- return NFD_CANCEL;
- }
-
- if ( AllocPathSet( urls, outPaths ) == NFD_ERROR )
- {
- [pool release];
- return NFD_ERROR;
- }
-
- nfdResult = NFD_OKAY;
- }
- [pool release];
-
- return nfdResult;
-}
-
-
-nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-
- NSSavePanel *dialog = [NSSavePanel savePanel];
- [dialog setExtensionHidden:NO];
-
- // Build the filter list.
- AddFilterListToDialog(dialog, filterList);
-
- // Set the starting directory
- SetDefaultPath(dialog, defaultPath);
-
- nfdresult_t nfdResult = NFD_CANCEL;
- if ( [dialog runModal] == NSModalResponseOK )
- {
- NSURL *url = [dialog URL];
- const char *utf8Path = [[url path] UTF8String];
-
- size_t byteLen = [url.path lengthOfBytesUsingEncoding:NSUTF8StringEncoding] + 1;
-
- *outPath = NFDi_Malloc( byteLen );
- if ( !*outPath )
- {
- [pool release];
- return NFD_ERROR;
- }
- memcpy( *outPath, utf8Path, byteLen );
- nfdResult = NFD_OKAY;
- }
-
- [pool release];
-
- return nfdResult;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.c
deleted file mode 100644
index 269fbd2135..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.c
+++ /dev/null
@@ -1,142 +0,0 @@
-/*
- Native File Dialog
-
- http://www.frogtoss.com/labs
- */
-
-#include <stdlib.h>
-#include <assert.h>
-#include <string.h>
-#include "nfd_common.h"
-
-static char g_errorstr[NFD_MAX_STRLEN] = {0};
-
-/* public routines */
-
-const char *NFD_GetError( void )
-{
- return g_errorstr;
-}
-
-size_t NFD_PathSet_GetCount( const nfdpathset_t *pathset )
-{
- assert(pathset);
- return pathset->count;
-}
-
-nfdchar_t *NFD_PathSet_GetPath( const nfdpathset_t *pathset, size_t num )
-{
- assert(pathset);
- assert(num < pathset->count);
-
- return pathset->buf + pathset->indices[num];
-}
-
-void NFD_PathSet_Free( nfdpathset_t *pathset )
-{
- assert(pathset);
- NFDi_Free( pathset->indices );
- NFDi_Free( pathset->buf );
-}
-
-/* internal routines */
-
-void *NFDi_Malloc( size_t bytes )
-{
- void *ptr = malloc(bytes);
- if ( !ptr )
- NFDi_SetError("NFDi_Malloc failed.");
-
- return ptr;
-}
-
-void NFDi_Free( void *ptr )
-{
- assert(ptr);
- free(ptr);
-}
-
-void NFDi_SetError( const char *msg )
-{
- int bTruncate = NFDi_SafeStrncpy( g_errorstr, msg, NFD_MAX_STRLEN );
- assert( !bTruncate ); _NFD_UNUSED(bTruncate);
-}
-
-
-int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy )
-{
- size_t n = maxCopy;
- char *d = dst;
-
- assert( src );
- assert( dst );
-
- while ( n > 0 && *src != '\0' )
- {
- *d++ = *src++;
- --n;
- }
-
- /* Truncation case -
- terminate string and return true */
- if ( n == 0 )
- {
- dst[maxCopy-1] = '\0';
- return 1;
- }
-
- /* No truncation. Append a single NULL and return. */
- *d = '\0';
- return 0;
-}
-
-
-/* adapted from microutf8 */
-size_t NFDi_UTF8_Strlen( const nfdchar_t *str )
-{
- /* This function doesn't properly check validity of UTF-8 character
- sequence, it is supposed to use only with valid UTF-8 strings. */
-
- size_t character_count = 0;
- size_t i = 0; /* Counter used to iterate over string. */
- nfdchar_t maybe_bom[4];
-
- /* If there is UTF-8 BOM ignore it. */
- if (strlen(str) > 2)
- {
- strncpy(maybe_bom, str, 3);
- maybe_bom[3] = 0;
- if (strcmp(maybe_bom, (nfdchar_t*)NFD_UTF8_BOM) == 0)
- i += 3;
- }
-
- while(str[i])
- {
- if (str[i] >> 7 == 0)
- {
- /* If bit pattern begins with 0 we have ascii character. */
- ++character_count;
- }
- else if (str[i] >> 6 == 3)
- {
- /* If bit pattern begins with 11 it is beginning of UTF-8 byte sequence. */
- ++character_count;
- }
- else if (str[i] >> 6 == 2)
- ; /* If bit pattern begins with 10 it is middle of utf-8 byte sequence. */
- else
- {
- /* In any other case this is not valid UTF-8. */
- return -1;
- }
- ++i;
- }
-
- return character_count;
-}
-
-int NFDi_IsFilterSegmentChar( char ch )
-{
- return (ch==','||ch==';'||ch=='\0');
-}
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.h
deleted file mode 100644
index a3f6b4ad64..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_common.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- Native File Dialog
-
- Internal, common across platforms
-
- http://www.frogtoss.com/labs
- */
-
-
-#ifndef _NFD_COMMON_H
-#define _NFD_COMMON_H
-
-#include "nfd.h"
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define NFD_MAX_STRLEN 256
-#define _NFD_UNUSED(x) ((void)x)
-
-#define NFD_UTF8_BOM "\xEF\xBB\xBF"
-
-
-void *NFDi_Malloc( size_t bytes );
-void NFDi_Free( void *ptr );
-void NFDi_SetError( const char *msg );
-int NFDi_SafeStrncpy( char *dst, const char *src, size_t maxCopy );
-size_t NFDi_UTF8_Strlen( const nfdchar_t *str );
-int NFDi_IsFilterSegmentChar( char ch );
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c
deleted file mode 100644
index 2d7b9b5f6e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- Native File Dialog
-
- http://www.frogtoss.com/labs
-*/
-
-#include <stdio.h>
-#include <assert.h>
-#include <string.h>
-#include <gtk/gtk.h>
-#include "nfd.h"
-#include "nfd_common.h"
-
-
-const char INIT_FAIL_MSG[] = "gtk_init_check failed to initilaize GTK+";
-
-
-static void AddTypeToFilterName( const char *typebuf, char *filterName, size_t bufsize )
-{
- const char SEP[] = ", ";
-
- size_t len = strlen(filterName);
- if ( len != 0 )
- {
- strncat( filterName, SEP, bufsize - len - 1 );
- len += strlen(SEP);
- }
-
- strncat( filterName, typebuf, bufsize - len - 1 );
-}
-
-static void AddFiltersToDialog( GtkWidget *dialog, const char *filterList )
-{
- GtkFileFilter *filter;
- char typebuf[NFD_MAX_STRLEN] = {0};
- const char *p_filterList = filterList;
- char *p_typebuf = typebuf;
- char filterName[NFD_MAX_STRLEN] = {0};
-
- if ( !filterList || strlen(filterList) == 0 )
- return;
-
- filter = gtk_file_filter_new();
- while ( 1 )
- {
-
- if ( NFDi_IsFilterSegmentChar(*p_filterList) )
- {
- char typebufWildcard[NFD_MAX_STRLEN];
- /* add another type to the filter */
- assert( strlen(typebuf) > 0 );
- assert( strlen(typebuf) < NFD_MAX_STRLEN-1 );
-
- snprintf( typebufWildcard, NFD_MAX_STRLEN, "*.%s", typebuf );
- AddTypeToFilterName( typebuf, filterName, NFD_MAX_STRLEN );
-
- gtk_file_filter_add_pattern( filter, typebufWildcard );
-
- p_typebuf = typebuf;
- memset( typebuf, 0, sizeof(char) * NFD_MAX_STRLEN );
- }
-
- if ( *p_filterList == ';' || *p_filterList == '\0' )
- {
- /* end of filter -- add it to the dialog */
-
- gtk_file_filter_set_name( filter, filterName );
- gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
-
- filterName[0] = '\0';
-
- if ( *p_filterList == '\0' )
- break;
-
- filter = gtk_file_filter_new();
- }
-
- if ( !NFDi_IsFilterSegmentChar( *p_filterList ) )
- {
- *p_typebuf = *p_filterList;
- p_typebuf++;
- }
-
- p_filterList++;
- }
-
- /* always append a wildcard option to the end*/
-
- filter = gtk_file_filter_new();
- gtk_file_filter_set_name( filter, "*.*" );
- gtk_file_filter_add_pattern( filter, "*" );
- gtk_file_chooser_add_filter( GTK_FILE_CHOOSER(dialog), filter );
-}
-
-static void SetDefaultPath( GtkWidget *dialog, const char *defaultPath )
-{
- if ( !defaultPath || strlen(defaultPath) == 0 )
- return;
-
- /* GTK+ manual recommends not specifically setting the default path.
- We do it anyway in order to be consistent across platforms.
-
- If consistency with the native OS is preferred, this is the line
- to comment out. -ml */
- gtk_file_chooser_set_current_folder( GTK_FILE_CHOOSER(dialog), defaultPath );
-}
-
-static nfdresult_t AllocPathSet( GSList *fileList, nfdpathset_t *pathSet )
-{
- size_t bufSize = 0;
- GSList *node;
- nfdchar_t *p_buf;
- size_t count = 0;
-
- assert(fileList);
- assert(pathSet);
-
- pathSet->count = (size_t)g_slist_length( fileList );
- assert( pathSet->count > 0 );
-
- pathSet->indices = NFDi_Malloc( sizeof(size_t)*pathSet->count );
- if ( !pathSet->indices )
- {
- return NFD_ERROR;
- }
-
- /* count the total space needed for buf */
- for ( node = fileList; node; node = node->next )
- {
- assert(node->data);
- bufSize += strlen( (const gchar*)node->data ) + 1;
- }
-
- pathSet->buf = NFDi_Malloc( sizeof(nfdchar_t) * bufSize );
-
- /* fill buf */
- p_buf = pathSet->buf;
- for ( node = fileList; node; node = node->next )
- {
- nfdchar_t *path = (nfdchar_t*)(node->data);
- size_t byteLen = strlen(path)+1;
- ptrdiff_t index;
-
- memcpy( p_buf, path, byteLen );
- g_free(node->data);
-
- index = p_buf - pathSet->buf;
- assert( index >= 0 );
- pathSet->indices[count] = (size_t)index;
-
- p_buf += byteLen;
- ++count;
- }
-
- g_slist_free( fileList );
-
- return NFD_OKAY;
-}
-
-static void WaitForCleanup(void)
-{
- while (gtk_events_pending())
- gtk_main_iteration();
-}
-
-/* public */
-
-nfdresult_t NFD_OpenDialog( const char *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- GtkWidget *dialog;
- nfdresult_t result;
-
- if ( !gtk_init_check( NULL, NULL ) )
- {
- NFDi_SetError(INIT_FAIL_MSG);
- return NFD_ERROR;
- }
-
- dialog = gtk_file_chooser_dialog_new( "Open File",
- NULL,
- GTK_FILE_CHOOSER_ACTION_OPEN,
- "_Cancel", GTK_RESPONSE_CANCEL,
- "_Open", GTK_RESPONSE_ACCEPT,
- NULL );
-
- /* Build the filter list */
- AddFiltersToDialog(dialog, filterList);
-
- /* Set the default path */
- SetDefaultPath(dialog, defaultPath);
-
- result = NFD_CANCEL;
- if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT )
- {
- char *filename;
-
- filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
-
- {
- size_t len = strlen(filename);
- *outPath = NFDi_Malloc( len + 1 );
- memcpy( *outPath, filename, len + 1 );
- if ( !*outPath )
- {
- g_free( filename );
- gtk_widget_destroy(dialog);
- return NFD_ERROR;
- }
- }
- g_free( filename );
-
- result = NFD_OKAY;
- }
-
- WaitForCleanup();
- gtk_widget_destroy(dialog);
- WaitForCleanup();
-
- return result;
-}
-
-
-nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdpathset_t *outPaths )
-{
- GtkWidget *dialog;
- nfdresult_t result;
-
- if ( !gtk_init_check( NULL, NULL ) )
- {
- NFDi_SetError(INIT_FAIL_MSG);
- return NFD_ERROR;
- }
-
- dialog = gtk_file_chooser_dialog_new( "Open Files",
- NULL,
- GTK_FILE_CHOOSER_ACTION_OPEN,
- "_Cancel", GTK_RESPONSE_CANCEL,
- "_Open", GTK_RESPONSE_ACCEPT,
- NULL );
- gtk_file_chooser_set_select_multiple( GTK_FILE_CHOOSER(dialog), TRUE );
-
- /* Build the filter list */
- AddFiltersToDialog(dialog, filterList);
-
- /* Set the default path */
- SetDefaultPath(dialog, defaultPath);
-
- result = NFD_CANCEL;
- if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT )
- {
- GSList *fileList = gtk_file_chooser_get_filenames( GTK_FILE_CHOOSER(dialog) );
- if ( AllocPathSet( fileList, outPaths ) == NFD_ERROR )
- {
- gtk_widget_destroy(dialog);
- return NFD_ERROR;
- }
-
- result = NFD_OKAY;
- }
-
- WaitForCleanup();
- gtk_widget_destroy(dialog);
- WaitForCleanup();
-
- return result;
-}
-
-nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- GtkWidget *dialog;
- nfdresult_t result;
-
- if ( !gtk_init_check( NULL, NULL ) )
- {
- NFDi_SetError(INIT_FAIL_MSG);
- return NFD_ERROR;
- }
-
- dialog = gtk_file_chooser_dialog_new( "Save File",
- NULL,
- GTK_FILE_CHOOSER_ACTION_SAVE,
- "_Cancel", GTK_RESPONSE_CANCEL,
- "_Save", GTK_RESPONSE_ACCEPT,
- NULL );
- gtk_file_chooser_set_do_overwrite_confirmation( GTK_FILE_CHOOSER(dialog), TRUE );
-
- /* Build the filter list */
- AddFiltersToDialog(dialog, filterList);
-
- /* Set the default path */
- SetDefaultPath(dialog, defaultPath);
-
- result = NFD_CANCEL;
- if ( gtk_dialog_run( GTK_DIALOG(dialog) ) == GTK_RESPONSE_ACCEPT )
- {
- char *filename;
- filename = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(dialog) );
-
- {
- size_t len = strlen(filename);
- *outPath = NFDi_Malloc( len + 1 );
- memcpy( *outPath, filename, len + 1 );
- if ( !*outPath )
- {
- g_free( filename );
- gtk_widget_destroy(dialog);
- return NFD_ERROR;
- }
- }
- g_free(filename);
-
- result = NFD_OKAY;
- }
-
- WaitForCleanup();
- gtk_widget_destroy(dialog);
- WaitForCleanup();
-
- return result;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp
deleted file mode 100644
index b065d69cb7..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp
+++ /dev/null
@@ -1,619 +0,0 @@
-/*
- Native File Dialog
-
- http://www.frogtoss.com/labs
- */
-
-/* only locally define UNICODE in this compilation unit */
-#ifndef UNICODE
-#define UNICODE
-#endif
-
-
-#include <wchar.h>
-#include <stdio.h>
-#include <assert.h>
-#include <atlbase.h>
-#include <windows.h>
-#include <ShObjIdl.h>
-
-#include "nfd_common.h"
-
-
-// allocs the space in outPath -- call free()
-static void CopyWCharToNFDChar( const wchar_t *inStr, nfdchar_t **outStr )
-{
- int inStrCharacterCount = static_cast<int>(wcslen(inStr));
- int bytesNeeded = WideCharToMultiByte( CP_UTF8, 0,
- inStr, inStrCharacterCount,
- NULL, 0, NULL, NULL );
- assert( bytesNeeded );
- bytesNeeded += 1;
-
- *outStr = (nfdchar_t*)NFDi_Malloc( bytesNeeded );
- if ( !*outStr )
- return;
-
- int bytesWritten = WideCharToMultiByte( CP_UTF8, 0,
- inStr, -1,
- *outStr, bytesNeeded,
- NULL, NULL );
- assert( bytesWritten ); _NFD_UNUSED( bytesWritten );
-}
-
-/* includes NULL terminator byte in return */
-static size_t GetUTF8ByteCountForWChar( const wchar_t *str )
-{
- int bytesNeeded = WideCharToMultiByte( CP_UTF8, 0,
- str, -1,
- NULL, 0, NULL, NULL );
- assert( bytesNeeded );
- return bytesNeeded+1;
-}
-
-// write to outPtr -- no free() necessary. No memory stomp tests are done -- they must be done
-// before entering this function.
-static int CopyWCharToExistingNFDCharBuffer( const wchar_t *inStr, nfdchar_t *outPtr )
-{
- int inStrCharacterCount = static_cast<int>(wcslen(inStr));
- int bytesNeeded = static_cast<int>(GetUTF8ByteCountForWChar( inStr ));
-
- /* invocation copies null term */
- int bytesWritten = WideCharToMultiByte( CP_UTF8, 0,
- inStr, -1,
- outPtr, bytesNeeded,
- NULL, 0 );
- assert( bytesWritten );
-
- return bytesWritten;
-
-}
-
-
-// allocs the space in outStr -- call free()
-static void CopyNFDCharToWChar( const nfdchar_t *inStr, wchar_t **outStr )
-{
- int inStrByteCount = static_cast<int>(strlen(inStr));
- int charsNeeded = MultiByteToWideChar(CP_UTF8, 0,
- inStr, inStrByteCount,
- NULL, 0 );
- assert( charsNeeded );
- assert( !*outStr );
- charsNeeded += 1; // terminator
-
- *outStr = (wchar_t*)NFDi_Malloc( charsNeeded * sizeof(wchar_t) );
- if ( !*outStr )
- return;
-
- int ret = MultiByteToWideChar(CP_UTF8, 0,
- inStr, inStrByteCount,
- *outStr, charsNeeded);
- (*outStr)[charsNeeded-1] = '\0';
-
-#ifdef _DEBUG
- int inStrCharacterCount = static_cast<int>(NFDi_UTF8_Strlen(inStr));
- assert( ret == inStrCharacterCount );
-#else
- _NFD_UNUSED(ret);
-#endif
-}
-
-
-/* ext is in format "jpg", no wildcards or separators */
-static int AppendExtensionToSpecBuf( const char *ext, char *specBuf, size_t specBufLen )
-{
- const char SEP[] = ";";
- assert( specBufLen > strlen(ext)+3 );
-
- if ( strlen(specBuf) > 0 )
- {
- strncat( specBuf, SEP, specBufLen - strlen(specBuf) - 1 );
- specBufLen += strlen(SEP);
- }
-
- char extWildcard[NFD_MAX_STRLEN];
- int bytesWritten = sprintf_s( extWildcard, NFD_MAX_STRLEN, "*.%s", ext );
- assert( bytesWritten == strlen(ext)+2 );
-
- strncat( specBuf, extWildcard, specBufLen - strlen(specBuf) - 1 );
-
- return NFD_OKAY;
-}
-
-static nfdresult_t AddFiltersToDialog( ::IFileDialog *fileOpenDialog, const char *filterList )
-{
- const wchar_t EMPTY_WSTR[] = L"";
- const wchar_t WILDCARD[] = L"*.*";
-
- if ( !filterList || strlen(filterList) == 0 )
- return NFD_OKAY;
-
- // Count rows to alloc
- UINT filterCount = 1; /* guaranteed to have one filter on a correct, non-empty parse */
- const char *p_filterList;
- for ( p_filterList = filterList; *p_filterList; ++p_filterList )
- {
- if ( *p_filterList == ';' )
- ++filterCount;
- }
-
- assert(filterCount);
- if ( !filterCount )
- {
- NFDi_SetError("Error parsing filters.");
- return NFD_ERROR;
- }
-
- /* filterCount plus 1 because we hardcode the *.* wildcard after the while loop */
- COMDLG_FILTERSPEC *specList = (COMDLG_FILTERSPEC*)NFDi_Malloc( sizeof(COMDLG_FILTERSPEC) * (filterCount + 1) );
- if ( !specList )
- {
- return NFD_ERROR;
- }
- for (size_t i = 0; i < filterCount+1; ++i )
- {
- specList[i].pszName = NULL;
- specList[i].pszSpec = NULL;
- }
-
- size_t specIdx = 0;
- p_filterList = filterList;
- char typebuf[NFD_MAX_STRLEN] = {0}; /* one per comma or semicolon */
- char *p_typebuf = typebuf;
- char filterName[NFD_MAX_STRLEN] = {0};
-
- char specbuf[NFD_MAX_STRLEN] = {0}; /* one per semicolon */
-
- while ( 1 )
- {
- if ( NFDi_IsFilterSegmentChar(*p_filterList) )
- {
- /* append a type to the specbuf (pending filter) */
- AppendExtensionToSpecBuf( typebuf, specbuf, NFD_MAX_STRLEN );
-
- p_typebuf = typebuf;
- memset( typebuf, 0, sizeof(char)*NFD_MAX_STRLEN );
- }
-
- if ( *p_filterList == ';' || *p_filterList == '\0' )
- {
- /* end of filter -- add it to specList */
-
- // Empty filter name -- Windows describes them by extension.
- specList[specIdx].pszName = EMPTY_WSTR;
- CopyNFDCharToWChar( specbuf, (wchar_t**)&specList[specIdx].pszSpec );
-
- memset( specbuf, 0, sizeof(char)*NFD_MAX_STRLEN );
- ++specIdx;
- if ( specIdx == filterCount )
- break;
- }
-
- if ( !NFDi_IsFilterSegmentChar( *p_filterList ))
- {
- *p_typebuf = *p_filterList;
- ++p_typebuf;
- }
-
- ++p_filterList;
- }
-
- /* Add wildcard */
- specList[specIdx].pszSpec = WILDCARD;
- specList[specIdx].pszName = EMPTY_WSTR;
-
- fileOpenDialog->SetFileTypes( filterCount+1, specList );
-
- /* free speclist */
- for ( size_t i = 0; i < filterCount; ++i )
- {
- NFDi_Free( (void*)specList[i].pszSpec );
- }
- NFDi_Free( specList );
-
- return NFD_OKAY;
-}
-
-static nfdresult_t AllocPathSet( IShellItemArray *shellItems, nfdpathset_t *pathSet )
-{
- const char ERRORMSG[] = "Error allocating pathset.";
-
- assert(shellItems);
- assert(pathSet);
-
- // How many items in shellItems?
- DWORD numShellItems;
- HRESULT result = shellItems->GetCount(&numShellItems);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError(ERRORMSG);
- return NFD_ERROR;
- }
-
- pathSet->count = static_cast<size_t>(numShellItems);
- assert( pathSet->count > 0 );
-
- pathSet->indices = (size_t*)NFDi_Malloc( sizeof(size_t)*pathSet->count );
- if ( !pathSet->indices )
- {
- return NFD_ERROR;
- }
-
- /* count the total bytes needed for buf */
- size_t bufSize = 0;
- for ( DWORD i = 0; i < numShellItems; ++i )
- {
- ::IShellItem *shellItem;
- result = shellItems->GetItemAt(i, &shellItem);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError(ERRORMSG);
- return NFD_ERROR;
- }
-
- // Confirm SFGAO_FILESYSTEM is true for this shellitem, or ignore it.
- SFGAOF attribs;
- result = shellItem->GetAttributes( SFGAO_FILESYSTEM, &attribs );
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError(ERRORMSG);
- return NFD_ERROR;
- }
- if ( !(attribs & SFGAO_FILESYSTEM) )
- continue;
-
- LPWSTR name;
- shellItem->GetDisplayName(SIGDN_FILESYSPATH, &name);
-
- // Calculate length of name with UTF-8 encoding
- bufSize += GetUTF8ByteCountForWChar( name );
- }
-
- assert(bufSize);
-
- pathSet->buf = (nfdchar_t*)NFDi_Malloc( sizeof(nfdchar_t) * bufSize );
- memset( pathSet->buf, 0, sizeof(nfdchar_t) * bufSize );
-
- /* fill buf */
- nfdchar_t *p_buf = pathSet->buf;
- for (DWORD i = 0; i < numShellItems; ++i )
- {
- ::IShellItem *shellItem;
- result = shellItems->GetItemAt(i, &shellItem);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError(ERRORMSG);
- return NFD_ERROR;
- }
-
- // Confirm SFGAO_FILESYSTEM is true for this shellitem, or ignore it.
- SFGAOF attribs;
- result = shellItem->GetAttributes( SFGAO_FILESYSTEM, &attribs );
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError(ERRORMSG);
- return NFD_ERROR;
- }
- if ( !(attribs & SFGAO_FILESYSTEM) )
- continue;
-
- LPWSTR name;
- shellItem->GetDisplayName(SIGDN_FILESYSPATH, &name);
-
- int bytesWritten = CopyWCharToExistingNFDCharBuffer(name, p_buf);
-
- ptrdiff_t index = p_buf - pathSet->buf;
- assert( index >= 0 );
- pathSet->indices[i] = static_cast<size_t>(index);
-
- p_buf += bytesWritten;
- }
-
- return NFD_OKAY;
-}
-
-
-static nfdresult_t SetDefaultPath( IFileDialog *dialog, const char *defaultPath )
-{
- if ( !defaultPath || strlen(defaultPath) == 0 )
- return NFD_OKAY;
-
- wchar_t *defaultPathW = {0};
- CopyNFDCharToWChar( defaultPath, &defaultPathW );
-
- IShellItem *folder;
- HRESULT result = SHCreateItemFromParsingName( defaultPathW, NULL, IID_PPV_ARGS(&folder) );
-
- // Valid non results.
- if ( result == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND) || result == HRESULT_FROM_WIN32(ERROR_INVALID_DRIVE) )
- {
- NFDi_Free( defaultPathW );
- return NFD_OKAY;
- }
-
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Error creating ShellItem");
- NFDi_Free( defaultPathW );
- return NFD_ERROR;
- }
-
- // Could also call SetDefaultFolder(), but this guarantees defaultPath -- more consistency across API.
- dialog->SetFolder( folder );
-
- NFDi_Free( defaultPathW );
- folder->Release();
-
- return NFD_OKAY;
-}
-
-/* public */
-
-
-nfdresult_t NFD_OpenDialog( const char *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- nfdresult_t nfdResult = NFD_ERROR;
-
- // Init COM library.
- HRESULT result = ::CoInitializeEx(NULL,
- ::COINIT_APARTMENTTHREADED |
- ::COINIT_DISABLE_OLE1DDE );
- if ( !SUCCEEDED(result))
- {
- NFDi_SetError("Could not initialize COM.");
- goto end;
- }
-
- ::IFileOpenDialog *fileOpenDialog(NULL);
-
- // Create dialog
- result = ::CoCreateInstance(::CLSID_FileOpenDialog, NULL,
- CLSCTX_ALL, ::IID_IFileOpenDialog,
- reinterpret_cast<void**>(&fileOpenDialog) );
-
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not create dialog.");
- goto end;
- }
-
- // Build the filter list
- if ( !AddFiltersToDialog( fileOpenDialog, filterList ) )
- {
- goto end;
- }
-
- // Set the default path
- if ( !SetDefaultPath( fileOpenDialog, defaultPath ) )
- {
- goto end;
- }
-
- // Show the dialog.
- result = fileOpenDialog->Show(NULL);
- if ( SUCCEEDED(result) )
- {
- // Get the file name
- ::IShellItem *shellItem(NULL);
- result = fileOpenDialog->GetResult(&shellItem);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get shell item from dialog.");
- goto end;
- }
- wchar_t *filePath(NULL);
- result = shellItem->GetDisplayName(::SIGDN_FILESYSPATH, &filePath);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get file path for selected.");
- goto end;
- }
-
- CopyWCharToNFDChar( filePath, outPath );
- CoTaskMemFree(filePath);
- if ( !*outPath )
- {
- /* error is malloc-based, error message would be redundant */
- goto end;
- }
-
- nfdResult = NFD_OKAY;
- shellItem->Release();
- }
- else if (result == HRESULT_FROM_WIN32(ERROR_CANCELLED) )
- {
- nfdResult = NFD_CANCEL;
- }
- else
- {
- NFDi_SetError("File dialog box show failed.");
- nfdResult = NFD_ERROR;
- }
-
- end:
- ::CoUninitialize();
-
- return nfdResult;
-}
-
-nfdresult_t NFD_OpenDialogMultiple( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdpathset_t *outPaths )
-{
- nfdresult_t nfdResult = NFD_ERROR;
-
- // Init COM library.
- HRESULT result = ::CoInitializeEx(NULL,
- ::COINIT_APARTMENTTHREADED |
- ::COINIT_DISABLE_OLE1DDE );
- if ( !SUCCEEDED(result))
- {
- NFDi_SetError("Could not initialize COM.");
- return NFD_ERROR;
- }
-
- ::IFileOpenDialog *fileOpenDialog(NULL);
-
- // Create dialog
- result = ::CoCreateInstance(::CLSID_FileOpenDialog, NULL,
- CLSCTX_ALL, ::IID_IFileOpenDialog,
- reinterpret_cast<void**>(&fileOpenDialog) );
-
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not create dialog.");
- goto end;
- }
-
- // Build the filter list
- if ( !AddFiltersToDialog( fileOpenDialog, filterList ) )
- {
- goto end;
- }
-
- // Set the default path
- if ( !SetDefaultPath( fileOpenDialog, defaultPath ) )
- {
- goto end;
- }
-
- // Set a flag for multiple options
- DWORD dwFlags;
- result = fileOpenDialog->GetOptions(&dwFlags);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get options.");
- goto end;
- }
- result = fileOpenDialog->SetOptions(dwFlags | FOS_ALLOWMULTISELECT);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not set options.");
- goto end;
- }
-
- // Show the dialog.
- result = fileOpenDialog->Show(NULL);
- if ( SUCCEEDED(result) )
- {
- IShellItemArray *shellItems;
- result = fileOpenDialog->GetResults( &shellItems );
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get shell items.");
- goto end;
- }
-
- if ( AllocPathSet( shellItems, outPaths ) == NFD_ERROR )
- {
- goto end;
- }
-
- shellItems->Release();
- nfdResult = NFD_OKAY;
- }
- else if (result == HRESULT_FROM_WIN32(ERROR_CANCELLED) )
- {
- nfdResult = NFD_CANCEL;
- }
- else
- {
- NFDi_SetError("File dialog box show failed.");
- nfdResult = NFD_ERROR;
- }
-
- end:
- ::CoUninitialize();
-
- return nfdResult;
-}
-
-nfdresult_t NFD_SaveDialog( const nfdchar_t *filterList,
- const nfdchar_t *defaultPath,
- nfdchar_t **outPath )
-{
- nfdresult_t nfdResult = NFD_ERROR;
-
- // Init COM library.
- HRESULT result = ::CoInitializeEx(NULL,
- ::COINIT_APARTMENTTHREADED |
- ::COINIT_DISABLE_OLE1DDE );
- if ( !SUCCEEDED(result))
- {
- NFDi_SetError("Could not initialize COM.");
- return NFD_ERROR;
- }
-
- ::IFileSaveDialog *fileSaveDialog(NULL);
-
- // Create dialog
- result = ::CoCreateInstance(::CLSID_FileSaveDialog, NULL,
- CLSCTX_ALL, ::IID_IFileSaveDialog,
- reinterpret_cast<void**>(&fileSaveDialog) );
-
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not create dialog.");
- goto end;
- }
-
- // Build the filter list
- if ( !AddFiltersToDialog( fileSaveDialog, filterList ) )
- {
- goto end;
- }
-
- // Set the default path
- if ( !SetDefaultPath( fileSaveDialog, defaultPath ) )
- {
- goto end;
- }
-
- // Show the dialog.
- result = fileSaveDialog->Show(NULL);
- if ( SUCCEEDED(result) )
- {
- // Get the file name
- ::IShellItem *shellItem;
- result = fileSaveDialog->GetResult(&shellItem);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get shell item from dialog.");
- goto end;
- }
- wchar_t *filePath(NULL);
- result = shellItem->GetDisplayName(::SIGDN_FILESYSPATH, &filePath);
- if ( !SUCCEEDED(result) )
- {
- NFDi_SetError("Could not get file path for selected.");
- goto end;
- }
-
- CopyWCharToNFDChar( filePath, outPath );
- CoTaskMemFree(filePath);
- if ( !*outPath )
- {
- /* error is malloc-based, error message would be redundant */
- goto end;
- }
-
- nfdResult = NFD_OKAY;
- shellItem->Release();
- }
- else if (result == HRESULT_FROM_WIN32(ERROR_CANCELLED) )
- {
- nfdResult = NFD_CANCEL;
- }
- else
- {
- NFDi_SetError("File dialog box show failed.");
- nfdResult = NFD_ERROR;
- }
-
- end:
- ::CoUninitialize();
-
- return nfdResult;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/SConstruct b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/SConstruct
deleted file mode 100644
index 14e98912b4..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/SConstruct
+++ /dev/null
@@ -1,70 +0,0 @@
-#
-# Native file dialog
-#
-# Build tests
-
-target_arch=str(Platform())
-debug = int(ARGUMENTS.get( 'debug', 0 ))
-
-files = {'test_opendialog': ['test_opendialog.c'],
- 'test_opendialogmultiple': ['test_opendialogmultiple.c'],
- 'test_savedialog': ['test_savedialog.c']}
-
-test_env = Environment()
-
-
-# Windows runtime library types
-win_rtl = {'debug': '/MDd',
- 'release': '/MD'}
-
-
-def set_debug(env):
- if target_arch == 'win32':
- env.Append( CFLAGS=['/Z7', # obj contains full symbols
- win_rtl['debug'] ] )
- else:
- env.Append( CFLAGS=['-g'] )
-
-
-def set_release(env):
- if target_arch == 'win32':
- env.Append( CFLAGS=[win_rtl['release'],
- '/O2',
- ])
- else:
- env.Append( CFLAGS=['-O3'] )
-
-
-def get_lib_name(base, is_debug):
- if is_debug:
- return base + '_d'
- else:
- return base
-
-
-if debug:
- set_debug(test_env)
-else:
- set_release(test_env)
-
-test_env.Append( CPPPATH=['../src/include'], # API header path only, no internals allowed
- LIBPATH=['../src'],
- LIBS=get_lib_name('nfd', debug) )
-
-
-# Cocoa OS X builds
-if target_arch == 'darwin':
- test_env.Append( FRAMEWORKS='AppKit' )
- test_env.CC='clang -fcolor-diagnostics'
-
-# Linux GTK+ 3 builds
-elif target_arch == 'posix':
- test_env.ParseConfig( 'pkg-config --cflags --libs gtk+-3.0' )
-
-elif target_arch == 'win32':
- test_env.Append(
- LINKFLAGS=['/NODEFAULTLIB:LIBCMT'])
-
-for codebase in files:
- output_name = get_lib_name(codebase, debug)
- test_env.Program( output_name, files[codebase] )
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialog.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialog.c
deleted file mode 100644
index 2984acf990..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialog.c
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <nfd.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-
-/* this test should compile on all supported platforms */
-
-int main( void )
-{
- nfdchar_t *outPath = NULL;
- nfdresult_t result = NFD_OpenDialog( "png,jpg;pdf", NULL, &outPath );
- if ( result == NFD_OKAY )
- {
- puts("Success!");
- puts(outPath);
- free(outPath);
- }
- else if ( result == NFD_CANCEL )
- {
- puts("User pressed cancel.");
- }
- else
- {
- printf("Error: %s\n", NFD_GetError() );
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialogmultiple.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialogmultiple.c
deleted file mode 100644
index 16cd675542..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_opendialogmultiple.c
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <nfd.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* this test should compile on all supported platforms */
-
-int main( void )
-{
- nfdchar_t *outPath = NULL;
-
- nfdpathset_t pathSet;
- nfdresult_t result = NFD_OpenDialogMultiple( "png,jpg;pdf", NULL, &pathSet );
- if ( result == NFD_OKAY )
- {
- size_t i;
- for ( i = 0; i < NFD_PathSet_GetCount(&pathSet); ++i )
- {
- nfdchar_t *path = NFD_PathSet_GetPath(&pathSet, i);
- printf("Path %li: %s\n", i, path );
- }
- NFD_PathSet_Free(&pathSet);
- }
- else if ( result == NFD_CANCEL )
- {
- puts("User pressed cancel.");
- }
- else
- {
- printf("Error: %s\n", NFD_GetError() );
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_savedialog.c b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_savedialog.c
deleted file mode 100644
index 4e1f69efc4..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/ThirdPartyLibs/nativefiledialog/test/test_savedialog.c
+++ /dev/null
@@ -1,28 +0,0 @@
-#include <nfd.h>
-
-#include <stdio.h>
-#include <stdlib.h>
-
-/* this test should compile on all supported platforms */
-
-int main( void )
-{
- nfdchar_t *savePath = NULL;
- nfdresult_t result = NFD_SaveDialog( "png,jpg;pdf", NULL, &savePath );
- if ( result == NFD_OKAY )
- {
- puts("Success!");
- puts(savePath);
- free(savePath);
- }
- else if ( result == NFD_CANCEL )
- {
- puts("User pressed cancel.");
- }
- else
- {
- printf("Error: %s\n", NFD_GetError() );
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.cc
deleted file mode 100644
index 5c2821b75b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-
-#include "exr-io.h"
-
-#include <cstdio>
-#include <iostream>
-
-namespace exrio {
-
-bool GetEXRLayers(const char *filename)
-{
- const char** layer_names = nullptr;
- int num_layers = 0;
- const char *err = nullptr;
- int ret = EXRLayers(filename, &layer_names, &num_layers, &err);
-
- if (err) {
- fprintf(stderr, "EXR error = %s\n", err);
- }
-
- if (ret != 0) {
- fprintf(stderr, "Load EXR err: %s\n", err);
- return false;
- }
- if (num_layers > 0)
- {
- fprintf(stdout, "EXR Contains %i Layers\n", num_layers);
- for (size_t i = 0; i < num_layers; ++i) {
- fprintf(stdout, "Layer %i : %s\n", i + 1, layer_names[i]);
- }
- }
- free(layer_names);
- return true;
-}
-
-bool LoadEXRRGBA(float** rgba, int *w, int *h, const char* filename, const char* layername)
-{
- int width, height;
- float* image;
- const char *err = nullptr;
- int ret = LoadEXRWithLayer(&image, &width, &height, filename, layername, &err);
-
- if (err) {
- fprintf(stderr, "EXR error = %s\n", err);
- }
-
- if (ret != 0) {
- fprintf(stderr, "Load EXR err: %s\n", err);
- return false;
- }
-
- (*rgba) = image;
- (*w) = width;
- (*h) = height;
-
- return true;
-}
-
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.h
deleted file mode 100644
index d338ff6977..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/exr-io.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef EXR_IO_H_
-#define EXR_IO_H_
-
-#include "tinyexr.h"
-
-namespace exrio
-{
-
-bool GetEXRLayers(const char *filename);
-
-bool LoadEXRRGBA(float** rgba, int* w, int *h, const char* filename, const char* layername = nullptr);
-
-}
-
-
-#endif // EXR_IO_H_
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/findOpenGLGlewGlut.lua b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/findOpenGLGlewGlut.lua
deleted file mode 100644
index c3c3582ff6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/findOpenGLGlewGlut.lua
+++ /dev/null
@@ -1,90 +0,0 @@
-
- function findOpenGL()
- configuration{}
- if os.is("Linux") then
- return true
- end
- --assume OpenGL is available on Mac OSX, Windows etc
- return true
- end
-
- function findOpenGL3()
- configuration{}
- if os.is("MacOSX") then
- local osversion = os.getversion()
- --Mac OSX 10.9 and above supports OpenGL 3, below doesn't, so ...
- if osversion.majorversion > 10 or (osversion.majorversion == 10 and osversion.minorversion >=9) then
- return findOpenGL()
- else
- return false
- end
- else
- return findOpenGL()
- end
- end
-
-
- function initOpenGL()
- configuration {}
- configuration {"Windows"}
- links {"opengl32","glu32"}
- configuration {"MacOSX"}
- links { "OpenGL.framework"}
- configuration {"not Windows", "not MacOSX"}
- if os.is("Linux") then
- if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
- links {"GL"}
- else
- print("No GL/gl.h found, using dynamic loading of GL using glew")
- defines {"GLEW_INIT_OPENGL11_FUNCTIONS=1"}
- links {"dl"}
- end
- end
- configuration{}
- end
-
-
- function initGlew()
- configuration {}
- if os.is("Windows") then
- configuration {"Windows"}
- defines { "GLEW_STATIC"}
- includedirs {
- projectRootDir .. "ThirdPartyLibs/Glew"
- }
- files { projectRootDir .. "ThirdPartyLibs/Glew/glew.c"}
- end
- if os.is("Linux") then
- configuration{"Linux"}
- if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h") and os.isfile("/usr/include/GL/glew.h")) then
- links {"GLEW"}
- print ("linking against system GLEW")
- else
- print("Using static glew and dynamic loading of glx functions")
- defines { "GLEW_STATIC","GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
- includedirs {
- projectRootDir .. "ThirdPartyLibs/Glew"
- }
- files { projectRootDir .. "ThirdPartyLibs/Glew/glew.c"}
- links {"dl"}
- end
-
- end
- configuration{}
- end
-
- function initX11()
- if os.is("Linux") then
- if _OPTIONS["enable_system_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
- links{"X11","pthread"}
- else
- print("No X11/X.h found, using dynamic loading of X11")
- includedirs {
- projectRootDir .. "ThirdPartyLibs/optionalX11"
- }
- defines {"DYNAMIC_LOAD_X11_FUNCTIONS"}
- links {"dl","pthread"}
- end
- end
- end
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/main.cc b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/main.cc
deleted file mode 100644
index 2254fe7078..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/main.cc
+++ /dev/null
@@ -1,541 +0,0 @@
-#define USE_OPENGL2
-#include "OpenGLWindow/OpenGLInclude.h"
-#ifdef _WIN32
-#include "OpenGLWindow/Win32OpenGLWindow.h"
-#elif defined __APPLE__
-#include "OpenGLWindow/MacOpenGLWindow.h"
-#else
-// assume linux
-#include "OpenGLWindow/X11OpenGLWindow.h"
-#endif
-
-#ifdef _WIN32
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <time.h>
-#else
-#include <fcntl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#endif
-
-#include <cstdio>
-#include <cstdlib>
-#include <string>
-#include <cstring>
-
-#ifdef USE_NATIVEFILEDIALOG
-#include <nfd.h>
-#endif
-
-#define NK_INCLUDE_FIXED_TYPES
-#define NK_INCLUDE_STANDARD_IO
-#define NK_INCLUDE_DEFAULT_ALLOCATOR
-#define NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-#define NK_INCLUDE_FONT_BAKING
-#define NK_INCLUDE_DEFAULT_FONT
-#define NK_IMPLEMENTATION
-#define NK_BTGUI_GL2_IMPLEMENTATION
-#include "nuklear.h"
-#include "nuklear_btgui_gl2.h"
-
-#include "exr-io.h"
-
-b3gDefaultOpenGLWindow* window = 0;
-int gWidth = 512;
-int gHeight = 512;
-GLuint gTexId;
-float gIntensityScale = 1.0;
-float gGamma = 1.0;
-int gExrWidth, gExrHeight;
-float* gExrRGBA;
-int gMousePosX, gMousePosY;
-
-struct nk_context* ctx;
-
-#define MAX_VERTEX_BUFFER 512 * 1024
-#define MAX_ELEMENT_BUFFER 128 * 1024
-
-void checkErrors(std::string desc) {
- GLenum e = glGetError();
- if (e != GL_NO_ERROR) {
- fprintf(stderr, "OpenGL error in \"%s\": %d (%d)\n", desc.c_str(), e, e);
- exit(20);
- }
-}
-
-void keyboardCallback(int keycode, int state) {
- // printf("hello key %d, state %d\n", keycode, state);
- if (keycode == 27) {
- if (window) window->setRequestExit();
- }
-}
-
-void mouseMoveCallback(float x, float y) {
- // printf("Mouse Move: %f, %f\n", x, y);
-
- gMousePosX = (int)x;
- gMousePosY = (int)y;
-
- // @todo { move to nuklear_btgui_gl2.h }
- nk_btgui_update_mouse_pos((int)x, (int)y);
-}
-void mouseButtonCallback(int button, int state, float x, float y) {
- nk_btgui_update_mouse_state((button == 0) && (state == 1), 0, 0);
-}
-
-void resizeCallback(float width, float height) {
- GLfloat h = (GLfloat)height / (GLfloat)width;
- GLfloat xmax, znear, zfar;
-
- znear = 1.0f;
- zfar = 1000.0f;
- xmax = znear * 0.5f;
-
- gWidth = width;
- gHeight = height;
-}
-
-GLuint GenTexture(int w, int h, const float* rgba)
-{
- // Create floating point RGBA texture
- GLuint texHandle;
- glGenTextures(1, &texHandle);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texHandle);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-
- // @todo { Use GL_RGBA32F for internal texture format. }
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, w, h, 0, GL_RGBA, GL_FLOAT, rgba);
- checkErrors("GenTexture");
-
- return texHandle;
-}
-
-
-bool
-LoadShader(
- GLenum shaderType, // GL_VERTEX_SHADER or GL_FRAGMENT_SHADER(or maybe GL_COMPUTE_SHADER)
- GLuint& shader,
- const char* shaderSourceFilename)
-{
- GLint val = 0;
-
- // free old shader/program
- if (shader != 0) glDeleteShader(shader);
-
- static GLchar srcbuf[16384];
- FILE *fp = fopen(shaderSourceFilename, "rb");
- if (!fp) {
- fprintf(stderr, "failed to load shader: %s\n", shaderSourceFilename);
- return false;
- }
- fseek(fp, 0, SEEK_END);
- size_t len = ftell(fp);
- rewind(fp);
- len = fread(srcbuf, 1, len, fp);
- srcbuf[len] = 0;
- fclose(fp);
-
- static const GLchar *src = srcbuf;
-
- shader = glCreateShader(shaderType);
- glShaderSource(shader, 1, &src, NULL);
- glCompileShader(shader);
- glGetShaderiv(shader, GL_COMPILE_STATUS, &val);
- if (val != GL_TRUE) {
- char log[4096];
- GLsizei msglen;
- glGetShaderInfoLog(shader, 4096, &msglen, log);
- printf("%s\n", log);
- assert(val == GL_TRUE && "failed to compile shader");
- }
-
- printf("Load shader [ %s ] OK\n", shaderSourceFilename);
- return true;
-}
-
-bool
-LinkShader(
- GLuint& prog,
- GLuint& vertShader,
- GLuint& fragShader)
-{
- GLint val = 0;
-
- if (prog != 0) {
- glDeleteProgram(prog);
- }
-
- prog = glCreateProgram();
-
- glAttachShader(prog, vertShader);
- glAttachShader(prog, fragShader);
- glLinkProgram(prog);
-
- glGetProgramiv(prog, GL_LINK_STATUS, &val);
- assert(val == GL_TRUE && "failed to link shader");
-
- printf("Link shader OK\n");
-
- return true;
-}
-
-void
-Render(GLuint prog_id, int w, int h)
-{
- glDisable(GL_DEPTH_TEST);
-
- glUseProgram(prog_id);
-
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, gTexId);
-
- glEnable(GL_TEXTURE_2D);
- GLint texLoc = glGetUniformLocation(prog_id, "tex");
- assert(texLoc >= 0);
- glUniform1i(texLoc, 0); // TEXTURE0
-
- GLint intensityScaleLoc = glGetUniformLocation(prog_id, "intensity_scale");
- if (intensityScaleLoc >= 0) {
- glUniform1f(intensityScaleLoc, gIntensityScale);
- }
-
- GLint gammaLoc = glGetUniformLocation(prog_id, "gamma");
- if (gammaLoc >= 0) {
- glUniform1f(gammaLoc, gGamma);
- }
-
- GLint pos_id = glGetAttribLocation(prog_id, "in_position");
- assert(pos_id >= 0);
- GLint texcoord_id = glGetAttribLocation(prog_id, "in_texcoord");
- assert(texcoord_id >= 0);
-
- const float vertices[] = {-1, -1, -1, 1, 1, 1, 1, -1};
- const float texcoords[] = {0, 1, 0, 0, 1, 0, 1, 1};
-
- glVertexAttribPointer(pos_id, 2, GL_FLOAT, GL_FALSE, 0, (const void*)(vertices));
- glVertexAttribPointer(texcoord_id, 2, GL_FLOAT, GL_FALSE, 0, (const void*)(texcoords));
-
- glEnableVertexAttribArray(pos_id);
- glEnableVertexAttribArray(texcoord_id);
-
- glDrawArrays(GL_QUADS, 0, 4);
-
- glDisableVertexAttribArray(pos_id);
- glDisableVertexAttribArray(texcoord_id);
-
- checkErrors("render");
-
- glUseProgram(0);
- checkErrors("UseProgram(0)");
-
- glEnable(GL_DEPTH_TEST);
- glDisable(GL_TEXTURE_2D);
-}
-
-void InspectPixel(float rgba[4], int x, int y) {
- if (x < 0) x = 0;
- if (x > (gExrWidth-1)) x = gExrWidth - 1;
-
- if (y < 0) y = 0;
- if (y > (gExrHeight-1)) y = gExrHeight - 1;
-
- rgba[0] = gExrRGBA[4 * (y * gExrWidth + x) + 0];
- rgba[1] = gExrRGBA[4 * (y * gExrWidth + x) + 1];
- rgba[2] = gExrRGBA[4 * (y * gExrWidth + x) + 2];
- rgba[3] = gExrRGBA[4 * (y * gExrWidth + x) + 3];
-}
-
-int main(int argc, char** argv) {
-
- const char *filename = NULL;
- const char *layername = NULL;
-
-#ifdef USE_NATIVEFILEDIALOG
- if (argc < 2) {
- nfdchar_t *outPath = NULL;
- nfdresult_t result = NFD_OpenDialog( "exr", NULL, &outPath );
- if ( result == NFD_OKAY )
- {
- puts("Success!");
- filename = strdup(outPath);
- }
- else if ( result == NFD_CANCEL )
- {
- puts("User pressed cancel.");
- exit(-1);
- }
- else
- {
- printf("Error: %s\n", NFD_GetError() );
- exit(-1);
- }
- } else {
- filename = argv[1];
- if (argc > 2) {
- layername = argv[2];
- }
- }
-#else
- if (argc < 2) {
- printf("Usage: exrview input.exr [layer name]\n");
- exit(-1);
- }
- filename = argv[1];
- if (argc > 2) {
- layername = argv[2];
- }
-#endif
-
- {
- bool ret = exrio::GetEXRLayers(filename);
- if (!ret) {
- exit(-1);
- }
- }
-
- {
- bool ret = exrio::LoadEXRRGBA(&gExrRGBA, &gExrWidth, &gExrHeight, filename, layername);
- if (!ret) {
- exit(-1);
- }
- }
-
- window = new b3gDefaultOpenGLWindow;
- b3gWindowConstructionInfo ci;
-#ifdef USE_OPENGL2
- ci.m_openglVersion = 2;
-#endif
- ci.m_width = gExrWidth;
- ci.m_height = gExrHeight;
- window->createWindow(ci);
-
- char title[1024];
- sprintf(title, "%s (%d x %d)", filename, gExrWidth, gExrHeight);
- window->setWindowTitle(title);
-
-#ifndef __APPLE__
-#ifndef _WIN32
- //some Linux implementations need the 'glewExperimental' to be true
- glewExperimental = GL_TRUE;
-#endif
- if (glewInit() != GLEW_OK) {
- fprintf(stderr, "Failed to initialize GLEW\n");
- exit(-1);
- }
-
- if (!GLEW_VERSION_2_1) {
- fprintf(stderr, "OpenGL 2.1 is not available\n");
- exit(-1);
- }
-#endif
-
-
- checkErrors("init");
-
- window->setMouseButtonCallback(mouseButtonCallback);
- window->setMouseMoveCallback(mouseMoveCallback);
- checkErrors("mouse");
- window->setKeyboardCallback(keyboardCallback);
- checkErrors("keyboard");
- window->setResizeCallback(resizeCallback);
- checkErrors("resize");
-
- struct nk_color background;
- background = nk_rgb(28,48,62);
-
-
- {
- // Upload EXR image to OpenGL texture.
- gTexId = GenTexture(gExrWidth, gExrHeight, gExrRGBA);
- if (gTexId == 0) {
- fprintf(stderr, "OpenGL texture error\n");
- exit(-1);
- }
- }
-
-
- /* GUI */
- ctx = nk_btgui_init(window, NK_BTGUI3_DEFAULT);
- /* Load Fonts: if none of these are loaded a default font will be used */
- {
- struct nk_font_atlas* atlas;
- nk_btgui_font_stash_begin(&atlas);
- /*struct nk_font *droid = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/DroidSans.ttf", 14, 0);*/
- /*struct nk_font *roboto = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/Roboto-Regular.ttf", 14, 0);*/
- /*struct nk_font *future = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/kenvector_future_thin.ttf", 13, 0);*/
- /*struct nk_font *clean = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/ProggyClean.ttf", 12, 0);*/
- /*struct nk_font *tiny = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/ProggyTiny.ttf", 10, 0);*/
- /*struct nk_font *cousine = nk_font_atlas_add_from_file(atlas,
- * "../../../extra_font/Cousine-Regular.ttf", 13, 0);*/
- struct nk_font *droid = nk_font_atlas_add_from_file(atlas,
- "./DroidSans.ttf", 14, 0);
- nk_btgui_font_stash_end();
- if (droid) {
- nk_style_set_font(ctx, &droid->handle);
- }
-
- // Color
- struct nk_color table[NK_COLOR_COUNT];
- table[NK_COLOR_TEXT] = nk_rgba(210, 210, 210, 255);
- table[NK_COLOR_WINDOW] = nk_rgba(57, 67, 71, 245);
- table[NK_COLOR_HEADER] = nk_rgba(51, 51, 56, 230);
- table[NK_COLOR_BORDER] = nk_rgba(46, 46, 46, 255);
- table[NK_COLOR_BUTTON] = nk_rgba(48, 48, 48, 255);
- table[NK_COLOR_BUTTON_HOVER] = nk_rgba(58, 93, 121, 255);
- table[NK_COLOR_BUTTON_ACTIVE] = nk_rgba(63, 98, 126, 255);
- table[NK_COLOR_TOGGLE] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_TOGGLE_HOVER] = nk_rgba(45, 53, 56, 255);
- table[NK_COLOR_TOGGLE_CURSOR] = nk_rgba(48, 83, 111, 255);
- table[NK_COLOR_SELECT] = nk_rgba(57, 67, 61, 255);
- table[NK_COLOR_SELECT_ACTIVE] = nk_rgba(48, 83, 111, 255);
- table[NK_COLOR_SLIDER] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_SLIDER_CURSOR] = nk_rgba(48, 83, 111, 245);
- table[NK_COLOR_SLIDER_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
- table[NK_COLOR_SLIDER_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
- table[NK_COLOR_PROPERTY] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_EDIT] = nk_rgba(50, 58, 61, 225);
- table[NK_COLOR_EDIT_CURSOR] = nk_rgba(210, 210, 210, 255);
- table[NK_COLOR_COMBO] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_CHART] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_CHART_COLOR] = nk_rgba(48, 83, 111, 255);
- table[NK_COLOR_CHART_COLOR_HIGHLIGHT] = nk_rgba(255, 0, 0, 255);
- table[NK_COLOR_SCROLLBAR] = nk_rgba(50, 58, 61, 255);
- table[NK_COLOR_SCROLLBAR_CURSOR] = nk_rgba(48, 83, 111, 255);
- table[NK_COLOR_SCROLLBAR_CURSOR_HOVER] = nk_rgba(53, 88, 116, 255);
- table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE] = nk_rgba(58, 93, 121, 255);
- table[NK_COLOR_TAB_HEADER] = nk_rgba(48, 83, 111, 255);
- nk_style_from_table(ctx, table);
- }
-
- checkErrors("start");
-
- GLuint vert_id = 0, frag_id = 0, prog_id = 0;
- {
- bool ret = LoadShader(GL_VERTEX_SHADER, vert_id, "shader.vert");
- if (!ret) {
- fprintf(stderr, "Failed to compile vertex shader.\n");
- exit(-1);
- }
- }
- checkErrors("vertex shader load");
-
- {
- bool ret = LoadShader(GL_FRAGMENT_SHADER, frag_id, "shader.frag");
- if (!ret) {
- fprintf(stderr, "Failed to compile fragment shader.\n");
- exit(-1);
- }
- }
- checkErrors("fragment shader load");
-
- {
- bool ret = LinkShader(prog_id, vert_id, frag_id);
- if (!ret) {
- fprintf(stderr, "Failed to link shader.\n");
- exit(-1);
- }
- }
- checkErrors("link shader");
-
-
- while (!window->requestedExit()) {
- window->startRendering();
-
- glClear(GL_COLOR_BUFFER_BIT);
-
- checkErrors("begin frame");
- nk_btgui_new_frame();
-
- float pixel[4];
- InspectPixel(pixel, gMousePosX, gMousePosY);
-
- /* GUI */
- {
- //struct nk_panel layout;
- if (nk_begin(ctx, "UI", nk_rect(50, 50, 350, 250),
- NK_WINDOW_BORDER | NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE |
- NK_WINDOW_MINIMIZABLE | NK_WINDOW_TITLE)) {
- nk_layout_row_static(ctx, 30, 300, 1);
- //if (nk_button_label(ctx, "button", NK_BUTTON_DEFAULT))
- // fprintf(stdout, "button pressed\n");
-
- nk_label(ctx, "Intensity", NK_TEXT_LEFT);
- if (nk_slider_float(ctx, 0, &gIntensityScale, 10.0, 0.1f)) {
- fprintf(stdout, "Intensity: %f\n", gIntensityScale);
- }
- nk_label(ctx, "Display gamma", NK_TEXT_LEFT);
- if (nk_slider_float(ctx, 0, &gGamma, 10.0, 0.01f)) {
- fprintf(stdout, "Gamma: %f\n", gGamma);
- }
-
- nk_label(ctx, "RAW pixel value", NK_TEXT_LEFT);
- char txt[1024];
- sprintf(txt, "(%d, %d) = %f, %f, %f, %f", gMousePosX, gMousePosY, pixel[0], pixel[1], pixel[2], pixel[3]);
- nk_text(ctx, txt, strlen(txt), NK_TEXT_LEFT);
-
-#if 0
- nk_layout_row_dynamic(ctx, 25, 1);
- nk_property_int(ctx, "Compression:", 0, &property, 100, 10, 1);
-
- {
- struct nk_panel combo;
- nk_layout_row_dynamic(ctx, 20, 1);
- nk_label(ctx, "background:", NK_TEXT_LEFT);
- nk_layout_row_dynamic(ctx, 25, 1);
- if (nk_combo_begin_color(ctx, &combo, background, 400)) {
- nk_layout_row_dynamic(ctx, 120, 1);
- background = nk_color_picker(ctx, background, NK_RGBA);
- nk_layout_row_dynamic(ctx, 25, 1);
- background.r =
- (nk_byte)nk_propertyi(ctx, "#R:", 0, background.r, 255, 1, 1);
- background.g =
- (nk_byte)nk_propertyi(ctx, "#G:", 0, background.g, 255, 1, 1);
- background.b =
- (nk_byte)nk_propertyi(ctx, "#B:", 0, background.b, 255, 1, 1);
- background.a =
- (nk_byte)nk_propertyi(ctx, "#A:", 0, background.a, 255, 1, 1);
- nk_combo_end(ctx);
- }
- }
-#endif
- }
- nk_end(ctx);
- }
-
- /* Draw */
- {
- float bg[4];
- nk_color_fv(bg, background);
- glViewport(0, 0, window->getWidth(), window->getHeight());
- glClear(GL_COLOR_BUFFER_BIT);
- glClearColor(bg[0], bg[1], bg[2], bg[3]);
-
- Render(prog_id, window->getWidth(), window->getHeight());
-
- /* IMPORTANT: `nk_glfw_render` modifies some global OpenGL state
- * with blending, scissor, face culling and depth test and defaults
- * everything
- * back into a default state. Make sure to either save and restore or
- * reset your own state after drawing rendering the UI. */
- nk_btgui_render(NK_ANTI_ALIASING_ON, MAX_VERTEX_BUFFER,
- MAX_ELEMENT_BUFFER);
- }
-
- window->endRendering();
- }
-
- nk_btgui_shutdown();
-
- delete window;
-
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear.h
deleted file mode 100644
index 15f2cc7bf3..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear.h
+++ /dev/null
@@ -1,25417 +0,0 @@
-/*/// # Nuklear
-/// ![](https://cloud.githubusercontent.com/assets/8057201/11761525/ae06f0ca-a0c6-11e5-819d-5610b25f6ef4.gif)
-///
-/// ## Contents
-/// 1. About section
-/// 2. Highlights section
-/// 3. Features section
-/// 4. Usage section
-/// 1. Flags section
-/// 2. Constants section
-/// 3. Dependencies section
-/// 5. Example section
-/// 6. API section
-/// 1. Context section
-/// 2. Input section
-/// 3. Drawing section
-/// 4. Window section
-/// 5. Layouting section
-/// 6. Groups section
-/// 7. Tree section
-/// 8. Properties section
-/// 7. License section
-/// 8. Changelog section
-/// 9. Gallery section
-/// 10. Credits section
-///
-/// ## About
-/// This is a minimal state immediate mode graphical user interface toolkit
-/// written in ANSI C and licensed under public domain. It was designed as a simple
-/// embeddable user interface for application and does not have any dependencies,
-/// a default renderbackend or OS window and input handling but instead provides a very modular
-/// library approach by using simple input state for input and draw
-/// commands describing primitive shapes as output. So instead of providing a
-/// layered library that tries to abstract over a number of platform and
-/// render backends it only focuses on the actual UI.
-///
-/// ## Highlights
-/// - Graphical user interface toolkit
-/// - Single header library
-/// - Written in C89 (a.k.a. ANSI C or ISO C90)
-/// - Small codebase (~18kLOC)
-/// - Focus on portability, efficiency and simplicity
-/// - No dependencies (not even the standard library if not wanted)
-/// - Fully skinnable and customizable
-/// - Low memory footprint with total memory control if needed or wanted
-/// - UTF-8 support
-/// - No global or hidden state
-/// - Customizable library modules (you can compile and use only what you need)
-/// - Optional font baker and vertex buffer output
-///
-/// ## Features
-/// - Absolutely no platform dependent code
-/// - Memory management control ranging from/to
-/// - Ease of use by allocating everything from standard library
-/// - Control every byte of memory inside the library
-/// - Font handling control ranging from/to
-/// - Use your own font implementation for everything
-/// - Use this libraries internal font baking and handling API
-/// - Drawing output control ranging from/to
-/// - Simple shapes for more high level APIs which already have drawing capabilities
-/// - Hardware accessible anti-aliased vertex buffer output
-/// - Customizable colors and properties ranging from/to
-/// - Simple changes to color by filling a simple color table
-/// - Complete control with ability to use skinning to decorate widgets
-/// - Bendable UI library with widget ranging from/to
-/// - Basic widgets like buttons, checkboxes, slider, ...
-/// - Advanced widget like abstract comboboxes, contextual menus,...
-/// - Compile time configuration to only compile what you need
-/// - Subset which can be used if you do not want to link or use the standard library
-/// - Can be easily modified to only update on user input instead of frame updates
-///
-/// ## Usage
-/// This library is self contained in one single header file and can be used either
-/// in header only mode or in implementation mode. The header only mode is used
-/// by default when included and allows including this header in other headers
-/// and does not contain the actual implementation. <br /><br />
-///
-/// The implementation mode requires to define the preprocessor macro
-/// NK_IMPLEMENTATION in *one* .c/.cpp file before #includeing this file, e.g.:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~C
-/// #define NK_IMPLEMENTATION
-/// #include "nuklear.h"
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Also optionally define the symbols listed in the section "OPTIONAL DEFINES"
-/// below in header and implementation mode if you want to use additional functionality
-/// or need more control over the library.
-///
-/// !!! WARNING
-/// Every time nuklear is included define the same compiler flags. This very important not doing so could lead to compiler errors or even worse stack corruptions.
-///
-/// ### Flags
-/// Flag | Description
-/// --------------------------------|------------------------------------------
-/// NK_PRIVATE | If defined declares all functions as static, so they can only be accessed inside the file that contains the implementation
-/// NK_INCLUDE_FIXED_TYPES | If defined it will include header `<stdint.h>` for fixed sized types otherwise nuklear tries to select the correct type. If that fails it will throw a compiler error and you have to select the correct types yourself.
-/// NK_INCLUDE_DEFAULT_ALLOCATOR | If defined it will include header `<stdlib.h>` and provide additional functions to use this library without caring for memory allocation control and therefore ease memory management.
-/// NK_INCLUDE_STANDARD_IO | If defined it will include header `<stdio.h>` and provide additional functions depending on file loading.
-/// NK_INCLUDE_STANDARD_VARARGS | If defined it will include header <stdio.h> and provide additional functions depending on file loading.
-/// NK_INCLUDE_VERTEX_BUFFER_OUTPUT | Defining this adds a vertex draw command list backend to this library, which allows you to convert queue commands into vertex draw commands. This is mainly if you need a hardware accessible format for OpenGL, DirectX, Vulkan, Metal,...
-/// NK_INCLUDE_FONT_BAKING | Defining this adds `stb_truetype` and `stb_rect_pack` implementation to this library and provides font baking and rendering. If you already have font handling or do not want to use this font handler you don't have to define it.
-/// NK_INCLUDE_DEFAULT_FONT | Defining this adds the default font: ProggyClean.ttf into this library which can be loaded into a font atlas and allows using this library without having a truetype font
-/// NK_INCLUDE_COMMAND_USERDATA | Defining this adds a userdata pointer into each command. Can be useful for example if you want to provide custom shaders depending on the used widget. Can be combined with the style structures.
-/// NK_BUTTON_TRIGGER_ON_RELEASE | Different platforms require button clicks occurring either on buttons being pressed (up to down) or released (down to up). By default this library will react on buttons being pressed, but if you define this it will only trigger if a button is released.
-/// NK_ZERO_COMMAND_MEMORY | Defining this will zero out memory for each drawing command added to a drawing queue (inside nk_command_buffer_push). Zeroing command memory is very useful for fast checking (using memcmp) if command buffers are equal and avoid drawing frames when nothing on screen has changed since previous frame.
-///
-/// !!! WARNING
-/// The following flags will pull in the standard C library:
-/// - NK_INCLUDE_DEFAULT_ALLOCATOR
-/// - NK_INCLUDE_STANDARD_IO
-/// - NK_INCLUDE_STANDARD_VARARGS
-///
-/// !!! WARNING
-/// The following flags if defined need to be defined for both header and implementation:
-/// - NK_INCLUDE_FIXED_TYPES
-/// - NK_INCLUDE_DEFAULT_ALLOCATOR
-/// - NK_INCLUDE_STANDARD_VARARGS
-/// - NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-/// - NK_INCLUDE_FONT_BAKING
-/// - NK_INCLUDE_DEFAULT_FONT
-/// - NK_INCLUDE_STANDARD_VARARGS
-/// - NK_INCLUDE_COMMAND_USERDATA
-///
-/// ### Constants
-/// Define | Description
-/// --------------------------------|---------------------------------------
-/// NK_BUFFER_DEFAULT_INITIAL_SIZE | Initial buffer size allocated by all buffers while using the default allocator functions included by defining NK_INCLUDE_DEFAULT_ALLOCATOR. If you don't want to allocate the default 4k memory then redefine it.
-/// NK_MAX_NUMBER_BUFFER | Maximum buffer size for the conversion buffer between float and string Under normal circumstances this should be more than sufficient.
-/// NK_INPUT_MAX | Defines the max number of bytes which can be added as text input in one frame. Under normal circumstances this should be more than sufficient.
-///
-/// !!! WARNING
-/// The following constants if defined need to be defined for both header and implementation:
-/// - NK_MAX_NUMBER_BUFFER
-/// - NK_BUFFER_DEFAULT_INITIAL_SIZE
-/// - NK_INPUT_MAX
-///
-/// ### Dependencies
-/// Function | Description
-/// ------------|---------------------------------------------------------------
-/// NK_ASSERT | If you don't define this, nuklear will use <assert.h> with assert().
-/// NK_MEMSET | You can define this to 'memset' or your own memset implementation replacement. If not nuklear will use its own version.
-/// NK_MEMCPY | You can define this to 'memcpy' or your own memcpy implementation replacement. If not nuklear will use its own version.
-/// NK_SQRT | You can define this to 'sqrt' or your own sqrt implementation replacement. If not nuklear will use its own slow and not highly accurate version.
-/// NK_SIN | You can define this to 'sinf' or your own sine implementation replacement. If not nuklear will use its own approximation implementation.
-/// NK_COS | You can define this to 'cosf' or your own cosine implementation replacement. If not nuklear will use its own approximation implementation.
-/// NK_STRTOD | You can define this to `strtod` or your own string to double conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
-/// NK_DTOA | You can define this to `dtoa` or your own double to string conversion implementation replacement. If not defined nuklear will use its own imprecise and possibly unsafe version (does not handle nan or infinity!).
-/// NK_VSNPRINTF| If you define `NK_INCLUDE_STANDARD_VARARGS` as well as `NK_INCLUDE_STANDARD_IO` and want to be safe define this to `vsnprintf` on compilers supporting later versions of C or C++. By default nuklear will check for your stdlib version in C as well as compiler version in C++. if `vsnprintf` is available it will define it to `vsnprintf` directly. If not defined and if you have older versions of C or C++ it will be defined to `vsprintf` which is unsafe.
-///
-/// !!! WARNING
-/// The following dependencies will pull in the standard C library if not redefined:
-/// - NK_ASSERT
-///
-/// !!! WARNING
-/// The following dependencies if defined need to be defined for both header and implementation:
-/// - NK_ASSERT
-///
-/// !!! WARNING
-/// The following dependencies if defined need to be defined only for the implementation part:
-/// - NK_MEMSET
-/// - NK_MEMCPY
-/// - NK_SQRT
-/// - NK_SIN
-/// - NK_COS
-/// - NK_STRTOD
-/// - NK_DTOA
-/// - NK_VSNPRINTF
-///
-/// ## Example
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// // init gui state
-/// enum {EASY, HARD};
-/// static int op = EASY;
-/// static float value = 0.6f;
-/// static int i = 20;
-/// struct nk_context ctx;
-///
-/// nk_init_fixed(&ctx, calloc(1, MAX_MEMORY), MAX_MEMORY, &font);
-/// if (nk_begin(&ctx, "Show", nk_rect(50, 50, 220, 220),
-/// NK_WINDOW_BORDER|NK_WINDOW_MOVABLE|NK_WINDOW_CLOSABLE)) {
-/// // fixed widget pixel width
-/// nk_layout_row_static(&ctx, 30, 80, 1);
-/// if (nk_button_label(&ctx, "button")) {
-/// // event handling
-/// }
-///
-/// // fixed widget window ratio width
-/// nk_layout_row_dynamic(&ctx, 30, 2);
-/// if (nk_option_label(&ctx, "easy", op == EASY)) op = EASY;
-/// if (nk_option_label(&ctx, "hard", op == HARD)) op = HARD;
-///
-/// // custom widget pixel width
-/// nk_layout_row_begin(&ctx, NK_STATIC, 30, 2);
-/// {
-/// nk_layout_row_push(&ctx, 50);
-/// nk_label(&ctx, "Volume:", NK_TEXT_LEFT);
-/// nk_layout_row_push(&ctx, 110);
-/// nk_slider_float(&ctx, 0, &value, 1.0f, 0.1f);
-/// }
-/// nk_layout_row_end(&ctx);
-/// }
-/// nk_end(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// ![](https://cloud.githubusercontent.com/assets/8057201/10187981/584ecd68-675c-11e5-897c-822ef534a876.png)
-///
-/// ## API
-///
-*/
-#ifndef NK_NUKLEAR_H_
-#define NK_NUKLEAR_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * ==============================================================
- *
- * CONSTANTS
- *
- * ===============================================================
- */
-#define NK_UNDEFINED (-1.0f)
-#define NK_UTF_INVALID 0xFFFD /* internal invalid utf8 rune */
-#define NK_UTF_SIZE 4 /* describes the number of bytes a glyph consists of*/
-#ifndef NK_INPUT_MAX
- #define NK_INPUT_MAX 16
-#endif
-#ifndef NK_MAX_NUMBER_BUFFER
- #define NK_MAX_NUMBER_BUFFER 64
-#endif
-#ifndef NK_SCROLLBAR_HIDING_TIMEOUT
- #define NK_SCROLLBAR_HIDING_TIMEOUT 4.0f
-#endif
-/*
- * ==============================================================
- *
- * HELPER
- *
- * ===============================================================
- */
-#ifndef NK_API
- #ifdef NK_PRIVATE
- #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199409L))
- #define NK_API static inline
- #elif defined(__cplusplus)
- #define NK_API static inline
- #else
- #define NK_API static
- #endif
- #else
- #define NK_API extern
- #endif
-#endif
-
-#define NK_INTERN static
-#define NK_STORAGE static
-#define NK_GLOBAL static
-
-#define NK_FLAG(x) (1 << (x))
-#define NK_STRINGIFY(x) #x
-#define NK_MACRO_STRINGIFY(x) NK_STRINGIFY(x)
-#define NK_STRING_JOIN_IMMEDIATE(arg1, arg2) arg1 ## arg2
-#define NK_STRING_JOIN_DELAY(arg1, arg2) NK_STRING_JOIN_IMMEDIATE(arg1, arg2)
-#define NK_STRING_JOIN(arg1, arg2) NK_STRING_JOIN_DELAY(arg1, arg2)
-
-#ifdef _MSC_VER
- #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__COUNTER__)
-#else
- #define NK_UNIQUE_NAME(name) NK_STRING_JOIN(name,__LINE__)
-#endif
-
-#ifndef NK_STATIC_ASSERT
- #define NK_STATIC_ASSERT(exp) typedef char NK_UNIQUE_NAME(_dummy_array)[(exp)?1:-1]
-#endif
-
-#ifndef NK_FILE_LINE
-#ifdef _MSC_VER
- #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__COUNTER__)
-#else
- #define NK_FILE_LINE __FILE__ ":" NK_MACRO_STRINGIFY(__LINE__)
-#endif
-#endif
-
-#define NK_MIN(a,b) ((a) < (b) ? (a) : (b))
-#define NK_MAX(a,b) ((a) < (b) ? (b) : (a))
-#define NK_CLAMP(i,v,x) (NK_MAX(NK_MIN(v,x), i))
-
-#ifdef NK_INCLUDE_STANDARD_VARARGS
- #if defined(_MSC_VER) && (_MSC_VER >= 1600) /* VS 2010 and above */
- #include <sal.h>
- #define NK_PRINTF_FORMAT_STRING _Printf_format_string_
- #else
- #define NK_PRINTF_FORMAT_STRING
- #endif
- #if defined(__GNUC__)
- #define NK_PRINTF_VARARG_FUNC(fmtargnumber) __attribute__((format(__printf__, fmtargnumber, fmtargnumber+1)))
- #else
- #define NK_PRINTF_VARARG_FUNC(fmtargnumber)
- #endif
-#endif
-
-/*
- * ===============================================================
- *
- * BASIC
- *
- * ===============================================================
- */
-#ifdef NK_INCLUDE_FIXED_TYPES
- #include <stdint.h>
- #define NK_INT8 int8_t
- #define NK_UINT8 uint8_t
- #define NK_INT16 int16_t
- #define NK_UINT16 uint16_t
- #define NK_INT32 int32_t
- #define NK_UINT32 uint32_t
- #define NK_SIZE_TYPE uintptr_t
- #define NK_POINTER_TYPE uintptr_t
-#else
- #ifndef NK_INT8
- #define NK_INT8 char
- #endif
- #ifndef NK_UINT8
- #define NK_UINT8 unsigned char
- #endif
- #ifndef NK_INT16
- #define NK_INT16 signed short
- #endif
- #ifndef NK_UINT16
- #define NK_UINT16 unsigned short
- #endif
- #ifndef NK_INT32
- #if defined(_MSC_VER)
- #define NK_INT32 __int32
- #else
- #define NK_INT32 signed int
- #endif
- #endif
- #ifndef NK_UINT32
- #if defined(_MSC_VER)
- #define NK_UINT32 unsigned __int32
- #else
- #define NK_UINT32 unsigned int
- #endif
- #endif
- #ifndef NK_SIZE_TYPE
- #if defined(_WIN64) && defined(_MSC_VER)
- #define NK_SIZE_TYPE unsigned __int64
- #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
- #define NK_SIZE_TYPE unsigned __int32
- #elif defined(__GNUC__) || defined(__clang__)
- #if defined(__x86_64__) || defined(__ppc64__)
- #define NK_SIZE_TYPE unsigned long
- #else
- #define NK_SIZE_TYPE unsigned int
- #endif
- #else
- #define NK_SIZE_TYPE unsigned long
- #endif
- #endif
- #ifndef NK_POINTER_TYPE
- #if defined(_WIN64) && defined(_MSC_VER)
- #define NK_POINTER_TYPE unsigned __int64
- #elif (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
- #define NK_POINTER_TYPE unsigned __int32
- #elif defined(__GNUC__) || defined(__clang__)
- #if defined(__x86_64__) || defined(__ppc64__)
- #define NK_POINTER_TYPE unsigned long
- #else
- #define NK_POINTER_TYPE unsigned int
- #endif
- #else
- #define NK_POINTER_TYPE unsigned long
- #endif
- #endif
-#endif
-
-typedef NK_INT8 nk_char;
-typedef NK_UINT8 nk_uchar;
-typedef NK_UINT8 nk_byte;
-typedef NK_INT16 nk_short;
-typedef NK_UINT16 nk_ushort;
-typedef NK_INT32 nk_int;
-typedef NK_UINT32 nk_uint;
-typedef NK_SIZE_TYPE nk_size;
-typedef NK_POINTER_TYPE nk_ptr;
-
-typedef nk_uint nk_hash;
-typedef nk_uint nk_flags;
-typedef nk_uint nk_rune;
-
-/* Make sure correct type size:
- * This will fire with a negative subscript error if the type sizes
- * are set incorrectly by the compiler, and compile out if not */
-NK_STATIC_ASSERT(sizeof(nk_short) == 2);
-NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
-NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
-NK_STATIC_ASSERT(sizeof(nk_int) == 4);
-NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
-NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
-NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
-NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
-NK_STATIC_ASSERT(sizeof(nk_ptr) >= sizeof(void*));
-
-/* ============================================================================
- *
- * API
- *
- * =========================================================================== */
-struct nk_buffer;
-struct nk_allocator;
-struct nk_command_buffer;
-struct nk_draw_command;
-struct nk_convert_config;
-struct nk_style_item;
-struct nk_text_edit;
-struct nk_draw_list;
-struct nk_user_font;
-struct nk_panel;
-struct nk_context;
-struct nk_draw_vertex_layout_element;
-struct nk_style_button;
-struct nk_style_toggle;
-struct nk_style_selectable;
-struct nk_style_slide;
-struct nk_style_progress;
-struct nk_style_scrollbar;
-struct nk_style_edit;
-struct nk_style_property;
-struct nk_style_chart;
-struct nk_style_combo;
-struct nk_style_tab;
-struct nk_style_window_header;
-struct nk_style_window;
-
-enum {nk_false, nk_true};
-struct nk_color {nk_byte r,g,b,a;};
-struct nk_colorf {float r,g,b,a;};
-struct nk_vec2 {float x,y;};
-struct nk_vec2i {short x, y;};
-struct nk_rect {float x,y,w,h;};
-struct nk_recti {short x,y,w,h;};
-typedef char nk_glyph[NK_UTF_SIZE];
-typedef union {void *ptr; int id;} nk_handle;
-struct nk_image {nk_handle handle;unsigned short w,h;unsigned short region[4];};
-struct nk_cursor {struct nk_image img; struct nk_vec2 size, offset;};
-struct nk_scroll {nk_uint x, y;};
-
-enum nk_heading {NK_UP, NK_RIGHT, NK_DOWN, NK_LEFT};
-enum nk_button_behavior {NK_BUTTON_DEFAULT, NK_BUTTON_REPEATER};
-enum nk_modify {NK_FIXED = nk_false, NK_MODIFIABLE = nk_true};
-enum nk_orientation {NK_VERTICAL, NK_HORIZONTAL};
-enum nk_collapse_states {NK_MINIMIZED = nk_false, NK_MAXIMIZED = nk_true};
-enum nk_show_states {NK_HIDDEN = nk_false, NK_SHOWN = nk_true};
-enum nk_chart_type {NK_CHART_LINES, NK_CHART_COLUMN, NK_CHART_MAX};
-enum nk_chart_event {NK_CHART_HOVERING = 0x01, NK_CHART_CLICKED = 0x02};
-enum nk_color_format {NK_RGB, NK_RGBA};
-enum nk_popup_type {NK_POPUP_STATIC, NK_POPUP_DYNAMIC};
-enum nk_layout_format {NK_DYNAMIC, NK_STATIC};
-enum nk_tree_type {NK_TREE_NODE, NK_TREE_TAB};
-
-typedef void*(*nk_plugin_alloc)(nk_handle, void *old, nk_size);
-typedef void (*nk_plugin_free)(nk_handle, void *old);
-typedef int(*nk_plugin_filter)(const struct nk_text_edit*, nk_rune unicode);
-typedef void(*nk_plugin_paste)(nk_handle, struct nk_text_edit*);
-typedef void(*nk_plugin_copy)(nk_handle, const char*, int len);
-
-struct nk_allocator {
- nk_handle userdata;
- nk_plugin_alloc alloc;
- nk_plugin_free free;
-};
-enum nk_symbol_type {
- NK_SYMBOL_NONE,
- NK_SYMBOL_X,
- NK_SYMBOL_UNDERSCORE,
- NK_SYMBOL_CIRCLE_SOLID,
- NK_SYMBOL_CIRCLE_OUTLINE,
- NK_SYMBOL_RECT_SOLID,
- NK_SYMBOL_RECT_OUTLINE,
- NK_SYMBOL_TRIANGLE_UP,
- NK_SYMBOL_TRIANGLE_DOWN,
- NK_SYMBOL_TRIANGLE_LEFT,
- NK_SYMBOL_TRIANGLE_RIGHT,
- NK_SYMBOL_PLUS,
- NK_SYMBOL_MINUS,
- NK_SYMBOL_MAX
-};
-/* =============================================================================
- *
- * CONTEXT
- *
- * =============================================================================*/
-/*/// ### Context
-/// Contexts are the main entry point and the majestro of nuklear and contain all required state.
-/// They are used for window, memory, input, style, stack, commands and time management and need
-/// to be passed into all nuklear GUI specific functions.
-///
-/// #### Usage
-/// To use a context it first has to be initialized which can be achieved by calling
-/// one of either `nk_init_default`, `nk_init_fixed`, `nk_init`, `nk_init_custom`.
-/// Each takes in a font handle and a specific way of handling memory. Memory control
-/// hereby ranges from standard library to just specifying a fixed sized block of memory
-/// which nuklear has to manage itself from.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// // [...]
-/// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// --------------------|-------------------------------------------------------
-/// __nk_init_default__ | Initializes context with standard library memory allocation (malloc,free)
-/// __nk_init_fixed__ | Initializes context from single fixed size memory block
-/// __nk_init__ | Initializes context with memory allocator callbacks for alloc and free
-/// __nk_init_custom__ | Initializes context from two buffers. One for draw commands the other for window/panel/table allocations
-/// __nk_clear__ | Called at the end of the frame to reset and prepare the context for the next frame
-/// __nk_free__ | Shutdown and free all memory allocated inside the context
-/// __nk_set_user_data__| Utility function to pass user data to draw command
- */
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-/*/// #### nk_init_default
-/// Initializes a `nk_context` struct with a default standard library allocator.
-/// Should be used if you don't want to be bothered with memory management in nuklear.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_init_default(struct nk_context *ctx, const struct nk_user_font *font);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|---------------------------------------------------------------
-/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
-/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
-///
-/// Returns either `false(0)` on failure or `true(1)` on success.
-///
-*/
-NK_API int nk_init_default(struct nk_context*, const struct nk_user_font*);
-#endif
-/*/// #### nk_init_fixed
-/// Initializes a `nk_context` struct from single fixed size memory block
-/// Should be used if you want complete control over nuklear's memory management.
-/// Especially recommended for system with little memory or systems with virtual memory.
-/// For the later case you can just allocate for example 16MB of virtual memory
-/// and only the required amount of memory will actually be committed.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size, const struct nk_user_font *font);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// !!! Warning
-/// make sure the passed memory block is aligned correctly for `nk_draw_commands`.
-///
-/// Parameter | Description
-/// ------------|--------------------------------------------------------------
-/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
-/// __memory__ | Must point to a previously allocated memory block
-/// __size__ | Must contain the total size of __memory__
-/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
-///
-/// Returns either `false(0)` on failure or `true(1)` on success.
-*/
-NK_API int nk_init_fixed(struct nk_context*, void *memory, nk_size size, const struct nk_user_font*);
-/*/// #### nk_init
-/// Initializes a `nk_context` struct with memory allocation callbacks for nuklear to allocate
-/// memory from. Used internally for `nk_init_default` and provides a kitchen sink allocation
-/// interface to nuklear. Can be useful for cases like monitoring memory consumption.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_init(struct nk_context *ctx, struct nk_allocator *alloc, const struct nk_user_font *font);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|---------------------------------------------------------------
-/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
-/// __alloc__ | Must point to a previously allocated memory allocator
-/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
-///
-/// Returns either `false(0)` on failure or `true(1)` on success.
-*/
-NK_API int nk_init(struct nk_context*, struct nk_allocator*, const struct nk_user_font*);
-/*/// #### nk_init_custom
-/// Initializes a `nk_context` struct from two different either fixed or growing
-/// buffers. The first buffer is for allocating draw commands while the second buffer is
-/// used for allocating windows, panels and state tables.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font *font);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|---------------------------------------------------------------
-/// __ctx__ | Must point to an either stack or heap allocated `nk_context` struct
-/// __cmds__ | Must point to a previously initialized memory buffer either fixed or dynamic to store draw commands into
-/// __pool__ | Must point to a previously initialized memory buffer either fixed or dynamic to store windows, panels and tables
-/// __font__ | Must point to a previously initialized font handle for more info look at font documentation
-///
-/// Returns either `false(0)` on failure or `true(1)` on success.
-*/
-NK_API int nk_init_custom(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *pool, const struct nk_user_font*);
-/*/// #### nk_clear
-/// Resets the context state at the end of the frame. This includes mostly
-/// garbage collector tasks like removing windows or table not called and therefore
-/// used anymore.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_clear(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-*/
-NK_API void nk_clear(struct nk_context*);
-/*/// #### nk_free
-/// Frees all memory allocated by nuklear. Not needed if context was
-/// initialized with `nk_init_fixed`.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_free(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-*/
-NK_API void nk_free(struct nk_context*);
-#ifdef NK_INCLUDE_COMMAND_USERDATA
-/*/// #### nk_set_user_data
-/// Sets the currently passed userdata passed down into each draw command.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_set_user_data(struct nk_context *ctx, nk_handle data);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|--------------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __data__ | Handle with either pointer or index to be passed into every draw commands
-*/
-NK_API void nk_set_user_data(struct nk_context*, nk_handle handle);
-#endif
-/* =============================================================================
- *
- * INPUT
- *
- * =============================================================================*/
-/*/// ### Input
-/// The input API is responsible for holding the current input state composed of
-/// mouse, key and text input states.
-/// It is worth noting that no direct os or window handling is done in nuklear.
-/// Instead all input state has to be provided by platform specific code. This in one hand
-/// expects more work from the user and complicates usage but on the other hand
-/// provides simple abstraction over a big number of platforms, libraries and other
-/// already provided functionality.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// // [...]
-/// }
-/// } nk_input_end(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Usage
-/// Input state needs to be provided to nuklear by first calling `nk_input_begin`
-/// which resets internal state like delta mouse position and button transistions.
-/// After `nk_input_begin` all current input state needs to be provided. This includes
-/// mouse motion, button and key pressed and released, text input and scrolling.
-/// Both event- or state-based input handling are supported by this API
-/// and should work without problems. Finally after all input state has been
-/// mirrored `nk_input_end` needs to be called to finish input process.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// Event evt;
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// // [...]
-/// }
-/// }
-/// nk_input_end(&ctx);
-/// // [...]
-/// nk_clear(&ctx);
-/// } nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// --------------------|-------------------------------------------------------
-/// __nk_input_begin__ | Begins the input mirroring process. Needs to be called before all other `nk_input_xxx` calls
-/// __nk_input_motion__ | Mirrors mouse cursor position
-/// __nk_input_key__ | Mirrors key state with either pressed or released
-/// __nk_input_button__ | Mirrors mouse button state with either pressed or released
-/// __nk_input_scroll__ | Mirrors mouse scroll values
-/// __nk_input_char__ | Adds a single ASCII text character into an internal text buffer
-/// __nk_input_glyph__ | Adds a single multi-byte UTF-8 character into an internal text buffer
-/// __nk_input_unicode__| Adds a single unicode rune into an internal text buffer
-/// __nk_input_end__ | Ends the input mirroring process by calculating state changes. Don't call any `nk_input_xxx` function referenced above after this call
-*/
-enum nk_keys {
- NK_KEY_NONE,
- NK_KEY_SHIFT,
- NK_KEY_CTRL,
- NK_KEY_DEL,
- NK_KEY_ENTER,
- NK_KEY_TAB,
- NK_KEY_BACKSPACE,
- NK_KEY_COPY,
- NK_KEY_CUT,
- NK_KEY_PASTE,
- NK_KEY_UP,
- NK_KEY_DOWN,
- NK_KEY_LEFT,
- NK_KEY_RIGHT,
- /* Shortcuts: text field */
- NK_KEY_TEXT_INSERT_MODE,
- NK_KEY_TEXT_REPLACE_MODE,
- NK_KEY_TEXT_RESET_MODE,
- NK_KEY_TEXT_LINE_START,
- NK_KEY_TEXT_LINE_END,
- NK_KEY_TEXT_START,
- NK_KEY_TEXT_END,
- NK_KEY_TEXT_UNDO,
- NK_KEY_TEXT_REDO,
- NK_KEY_TEXT_SELECT_ALL,
- NK_KEY_TEXT_WORD_LEFT,
- NK_KEY_TEXT_WORD_RIGHT,
- /* Shortcuts: scrollbar */
- NK_KEY_SCROLL_START,
- NK_KEY_SCROLL_END,
- NK_KEY_SCROLL_DOWN,
- NK_KEY_SCROLL_UP,
- NK_KEY_MAX
-};
-enum nk_buttons {
- NK_BUTTON_LEFT,
- NK_BUTTON_MIDDLE,
- NK_BUTTON_RIGHT,
- NK_BUTTON_DOUBLE,
- NK_BUTTON_MAX
-};
-/*/// #### nk_input_begin
-/// Begins the input mirroring process by resetting text, scroll
-/// mouse previous mouse position and movement as well as key state transitions,
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_begin(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-*/
-NK_API void nk_input_begin(struct nk_context*);
-/*/// #### nk_input_motion
-/// Mirrors current mouse position to nuklear
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_motion(struct nk_context *ctx, int x, int y);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __x__ | Must hold an integer describing the current mouse cursor x-position
-/// __y__ | Must hold an integer describing the current mouse cursor y-position
-*/
-NK_API void nk_input_motion(struct nk_context*, int x, int y);
-/*/// #### nk_input_key
-/// Mirrors state of a specific key to nuklear
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_key(struct nk_context*, enum nk_keys key, int down);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __key__ | Must be any value specified in enum `nk_keys` that needs to be mirrored
-/// __down__ | Must be 0 for key is up and 1 for key is down
-*/
-NK_API void nk_input_key(struct nk_context*, enum nk_keys, int down);
-/*/// #### nk_input_button
-/// Mirrors the state of a specific mouse button to nuklear
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_button(struct nk_context *ctx, enum nk_buttons btn, int x, int y, int down);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __btn__ | Must be any value specified in enum `nk_buttons` that needs to be mirrored
-/// __x__ | Must contain an integer describing mouse cursor x-position on click up/down
-/// __y__ | Must contain an integer describing mouse cursor y-position on click up/down
-/// __down__ | Must be 0 for key is up and 1 for key is down
-*/
-NK_API void nk_input_button(struct nk_context*, enum nk_buttons, int x, int y, int down);
-/*/// #### nk_input_scroll
-/// Copies the last mouse scroll value to nuklear. Is generally
-/// a scroll value. So does not have to come from mouse and could also originate
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __val__ | vector with both X- as well as Y-scroll value
-*/
-NK_API void nk_input_scroll(struct nk_context*, struct nk_vec2 val);
-/*/// #### nk_input_char
-/// Copies a single ASCII character into an internal text buffer
-/// This is basically a helper function to quickly push ASCII characters into
-/// nuklear.
-///
-/// !!! Note
-/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_char(struct nk_context *ctx, char c);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __c__ | Must be a single ASCII character preferable one that can be printed
-*/
-NK_API void nk_input_char(struct nk_context*, char);
-/*/// #### nk_input_glyph
-/// Converts an encoded unicode rune into UTF-8 and copies the result into an
-/// internal text buffer.
-///
-/// !!! Note
-/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_glyph(struct nk_context *ctx, const nk_glyph g);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __g__ | UTF-32 unicode codepoint
-*/
-NK_API void nk_input_glyph(struct nk_context*, const nk_glyph);
-/*/// #### nk_input_unicode
-/// Converts a unicode rune into UTF-8 and copies the result
-/// into an internal text buffer.
-/// !!! Note
-/// Stores up to NK_INPUT_MAX bytes between `nk_input_begin` and `nk_input_end`.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_unicode(struct nk_context*, nk_rune rune);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-/// __rune__ | UTF-32 unicode codepoint
-*/
-NK_API void nk_input_unicode(struct nk_context*, nk_rune);
-/*/// #### nk_input_end
-/// End the input mirroring process by resetting mouse grabbing
-/// state to ensure the mouse cursor is not grabbed indefinitely.///
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_input_end(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to a previously initialized `nk_context` struct
-*/
-NK_API void nk_input_end(struct nk_context*);
-/* =============================================================================
- *
- * DRAWING
- *
- * =============================================================================*/
-/*/// ### Drawing
-/// This library was designed to be render backend agnostic so it does
-/// not draw anything to screen directly. Instead all drawn shapes, widgets
-/// are made of, are buffered into memory and make up a command queue.
-/// Each frame therefore fills the command buffer with draw commands
-/// that then need to be executed by the user and his own render backend.
-/// After that the command buffer needs to be cleared and a new frame can be
-/// started. It is probably important to note that the command buffer is the main
-/// drawing API and the optional vertex buffer API only takes this format and
-/// converts it into a hardware accessible format.
-///
-/// #### Usage
-/// To draw all draw commands accumulated over a frame you need your own render
-/// backend able to draw a number of 2D primitives. This includes at least
-/// filled and stroked rectangles, circles, text, lines, triangles and scissors.
-/// As soon as this criterion is met you can iterate over each draw command
-/// and execute each draw command in a interpreter like fashion:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case //...:
-/// //[...]
-/// }
-/// }
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// In program flow context draw commands need to be executed after input has been
-/// gathered and the complete UI with windows and their contained widgets have
-/// been executed and before calling `nk_clear` which frees all previously
-/// allocated draw commands.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// Event evt;
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// [...]
-/// }
-/// }
-/// nk_input_end(&ctx);
-/// //
-/// // [...]
-/// //
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case ...:
-/// // [...]
-/// }
-/// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// You probably noticed that you have to draw all of the UI each frame which is
-/// quite wasteful. While the actual UI updating loop is quite fast rendering
-/// without actually needing it is not. So there are multiple things you could do.
-///
-/// First is only update on input. This of course is only an option if your
-/// application only depends on the UI and does not require any outside calculations.
-/// If you actually only update on input make sure to update the UI two times each
-/// frame and call `nk_clear` directly after the first pass and only draw in
-/// the second pass. In addition it is recommended to also add additional timers
-/// to make sure the UI is not drawn more than a fixed number of frames per second.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// // [...wait for input ]
-/// // [...do two UI passes ...]
-/// do_ui(...)
-/// nk_clear(&ctx);
-/// do_ui(...)
-/// //
-/// // draw
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case ...:
-/// //[...]
-/// }
-/// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// The second probably more applicable trick is to only draw if anything changed.
-/// It is not really useful for applications with continuous draw loop but
-/// quite useful for desktop applications. To actually get nuklear to only
-/// draw on changes you first have to define `NK_ZERO_COMMAND_MEMORY` and
-/// allocate a memory buffer that will store each unique drawing output.
-/// After each frame you compare the draw command memory inside the library
-/// with your allocated buffer by memcmp. If memcmp detects differences
-/// you have to copy the command buffer into the allocated buffer
-/// and then draw like usual (this example uses fixed memory but you could
-/// use dynamically allocated memory).
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// //[... other defines ...]
-/// #define NK_ZERO_COMMAND_MEMORY
-/// #include "nuklear.h"
-/// //
-/// // setup context
-/// struct nk_context ctx;
-/// void *last = calloc(1,64*1024);
-/// void *buf = calloc(1,64*1024);
-/// nk_init_fixed(&ctx, buf, 64*1024);
-/// //
-/// // loop
-/// while (1) {
-/// // [...input...]
-/// // [...ui...]
-/// void *cmds = nk_buffer_memory(&ctx.memory);
-/// if (memcmp(cmds, last, ctx.memory.allocated)) {
-/// memcpy(last,cmds,ctx.memory.allocated);
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case ...:
-/// // [...]
-/// }
-/// }
-/// }
-/// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Finally while using draw commands makes sense for higher abstracted platforms like
-/// X11 and Win32 or drawing libraries it is often desirable to use graphics
-/// hardware directly. Therefore it is possible to just define
-/// `NK_INCLUDE_VERTEX_BUFFER_OUTPUT` which includes optional vertex output.
-/// To access the vertex output you first have to convert all draw commands into
-/// vertexes by calling `nk_convert` which takes in your preferred vertex format.
-/// After successfully converting all draw commands just iterate over and execute all
-/// vertex draw commands:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// // fill configuration
-/// struct nk_convert_config cfg = {};
-/// static const struct nk_draw_vertex_layout_element vertex_layout[] = {
-/// {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, pos)},
-/// {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct your_vertex, uv)},
-/// {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct your_vertex, col)},
-/// {NK_VERTEX_LAYOUT_END}
-/// };
-/// cfg.shape_AA = NK_ANTI_ALIASING_ON;
-/// cfg.line_AA = NK_ANTI_ALIASING_ON;
-/// cfg.vertex_layout = vertex_layout;
-/// cfg.vertex_size = sizeof(struct your_vertex);
-/// cfg.vertex_alignment = NK_ALIGNOF(struct your_vertex);
-/// cfg.circle_segment_count = 22;
-/// cfg.curve_segment_count = 22;
-/// cfg.arc_segment_count = 22;
-/// cfg.global_alpha = 1.0f;
-/// cfg.null = dev->null;
-/// //
-/// // setup buffers and convert
-/// struct nk_buffer cmds, verts, idx;
-/// nk_buffer_init_default(&cmds);
-/// nk_buffer_init_default(&verts);
-/// nk_buffer_init_default(&idx);
-/// nk_convert(&ctx, &cmds, &verts, &idx, &cfg);
-/// //
-/// // draw
-/// nk_draw_foreach(cmd, &ctx, &cmds) {
-/// if (!cmd->elem_count) continue;
-/// //[...]
-/// }
-/// nk_buffer_free(&cms);
-/// nk_buffer_free(&verts);
-/// nk_buffer_free(&idx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// --------------------|-------------------------------------------------------
-/// __nk__begin__ | Returns the first draw command in the context draw command list to be drawn
-/// __nk__next__ | Increments the draw command iterator to the next command inside the context draw command list
-/// __nk_foreach__ | Iterates over each draw command inside the context draw command list
-/// __nk_convert__ | Converts from the abstract draw commands list into a hardware accessible vertex format
-/// __nk_draw_begin__ | Returns the first vertex command in the context vertex draw list to be executed
-/// __nk__draw_next__ | Increments the vertex command iterator to the next command inside the context vertex command list
-/// __nk__draw_end__ | Returns the end of the vertex draw list
-/// __nk_draw_foreach__ | Iterates over each vertex draw command inside the vertex draw list
-*/
-enum nk_anti_aliasing {NK_ANTI_ALIASING_OFF, NK_ANTI_ALIASING_ON};
-enum nk_convert_result {
- NK_CONVERT_SUCCESS = 0,
- NK_CONVERT_INVALID_PARAM = 1,
- NK_CONVERT_COMMAND_BUFFER_FULL = NK_FLAG(1),
- NK_CONVERT_VERTEX_BUFFER_FULL = NK_FLAG(2),
- NK_CONVERT_ELEMENT_BUFFER_FULL = NK_FLAG(3)
-};
-struct nk_draw_null_texture {
- nk_handle texture; /* texture handle to a texture with a white pixel */
- struct nk_vec2 uv; /* coordinates to a white pixel in the texture */
-};
-struct nk_convert_config {
- float global_alpha; /* global alpha value */
- enum nk_anti_aliasing line_AA; /* line anti-aliasing flag can be turned off if you are tight on memory */
- enum nk_anti_aliasing shape_AA; /* shape anti-aliasing flag can be turned off if you are tight on memory */
- unsigned circle_segment_count; /* number of segments used for circles: default to 22 */
- unsigned arc_segment_count; /* number of segments used for arcs: default to 22 */
- unsigned curve_segment_count; /* number of segments used for curves: default to 22 */
- struct nk_draw_null_texture null; /* handle to texture with a white pixel for shape drawing */
- const struct nk_draw_vertex_layout_element *vertex_layout; /* describes the vertex output format and packing */
- nk_size vertex_size; /* sizeof one vertex for vertex packing */
- nk_size vertex_alignment; /* vertex alignment: Can be obtained by NK_ALIGNOF */
-};
-/*/// #### nk__begin
-/// Returns a draw command list iterator to iterate all draw
-/// commands accumulated over one frame.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_command* nk__begin(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | must point to an previously initialized `nk_context` struct at the end of a frame
-///
-/// Returns draw command pointer pointing to the first command inside the draw command list
-*/
-NK_API const struct nk_command* nk__begin(struct nk_context*);
-/*/// #### nk__next
-/// Returns a draw command list iterator to iterate all draw
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-/// __cmd__ | Must point to an previously a draw command either returned by `nk__begin` or `nk__next`
-///
-/// Returns draw command pointer pointing to the next command inside the draw command list
-*/
-NK_API const struct nk_command* nk__next(struct nk_context*, const struct nk_command*);
-/*/// #### nk_foreach
-/// Iterates over each draw command inside the context draw command list
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_foreach(c, ctx)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-/// __cmd__ | Command pointer initialized to NULL
-///
-/// Returns draw command pointer pointing to the next command inside the draw command list
-*/
-#define nk_foreach(c, ctx) for((c) = nk__begin(ctx); (c) != 0; (c) = nk__next(ctx,c))
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-/*/// #### nk_convert
-/// Converts all internal draw commands into vertex draw commands and fills
-/// three buffers with vertexes, vertex draw commands and vertex indices. The vertex format
-/// as well as some other configuration values have to be configured by filling out a
-/// `nk_convert_config` struct.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// nk_flags nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
-// struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-/// __cmds__ | Must point to a previously initialized buffer to hold converted vertex draw commands
-/// __vertices__| Must point to a previously initialized buffer to hold all produced vertices
-/// __elements__| Must point to a previously initialized buffer to hold all produced vertex indices
-/// __config__ | Must point to a filled out `nk_config` struct to configure the conversion process
-///
-/// Returns one of enum nk_convert_result error codes
-///
-/// Parameter | Description
-/// --------------------------------|-----------------------------------------------------------
-/// NK_CONVERT_SUCCESS | Signals a successful draw command to vertex buffer conversion
-/// NK_CONVERT_INVALID_PARAM | An invalid argument was passed in the function call
-/// NK_CONVERT_COMMAND_BUFFER_FULL | The provided buffer for storing draw commands is full or failed to allocate more memory
-/// NK_CONVERT_VERTEX_BUFFER_FULL | The provided buffer for storing vertices is full or failed to allocate more memory
-/// NK_CONVERT_ELEMENT_BUFFER_FULL | The provided buffer for storing indicies is full or failed to allocate more memory
-*/
-NK_API nk_flags nk_convert(struct nk_context*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, const struct nk_convert_config*);
-/*/// #### nk__draw_begin
-/// Returns a draw vertex command buffer iterator to iterate each the vertex draw command buffer
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
-///
-/// Returns vertex draw command pointer pointing to the first command inside the vertex draw command buffer
-*/
-NK_API const struct nk_draw_command* nk__draw_begin(const struct nk_context*, const struct nk_buffer*);
-/*/// #### nk__draw_end
-/// Returns the vertex draw command at the end of the vertex draw command buffer
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_draw_command* nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buf);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
-///
-/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
-*/
-NK_API const struct nk_draw_command* nk__draw_end(const struct nk_context*, const struct nk_buffer*);
-/*/// #### nk__draw_next
-/// Increments the vertex draw command buffer iterator
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __cmd__ | Must point to an previously either by `nk__draw_begin` or `nk__draw_next` returned vertex draw command
-/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-///
-/// Returns vertex draw command pointer pointing to the end of the last vertex draw command inside the vertex draw command buffer
-*/
-NK_API const struct nk_draw_command* nk__draw_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_context*);
-/*/// #### nk_draw_foreach
-/// Iterates over each vertex draw command inside a vertex draw command buffer
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_draw_foreach(cmd,ctx, b)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __cmd__ | `nk_draw_command`iterator set to NULL
-/// __buf__ | Must point to an previously by `nk_convert` filled out vertex draw command buffer
-/// __ctx__ | Must point to an previously initialized `nk_context` struct at the end of a frame
-*/
-#define nk_draw_foreach(cmd,ctx, b) for((cmd)=nk__draw_begin(ctx, b); (cmd)!=0; (cmd)=nk__draw_next(cmd, b, ctx))
-#endif
-/* =============================================================================
- *
- * WINDOW
- *
- * =============================================================================
-/// ### Window
-/// Windows are the main persistent state used inside nuklear and are life time
-/// controlled by simply "retouching" (i.e. calling) each window each frame.
-/// All widgets inside nuklear can only be added inside function pair `nk_begin_xxx`
-/// and `nk_end`. Calling any widgets outside these two functions will result in an
-/// assert in debug or no state change in release mode.<br /><br />
-///
-/// Each window holds frame persistent state like position, size, flags, state tables,
-/// and some garbage collected internal persistent widget state. Each window
-/// is linked into a window stack list which determines the drawing and overlapping
-/// order. The topmost window thereby is the currently active window.<br /><br />
-///
-/// To change window position inside the stack occurs either automatically by
-/// user input by being clicked on or programmatically by calling `nk_window_focus`.
-/// Windows by default are visible unless explicitly being defined with flag
-/// `NK_WINDOW_HIDDEN`, the user clicked the close button on windows with flag
-/// `NK_WINDOW_CLOSABLE` or if a window was explicitly hidden by calling
-/// `nk_window_show`. To explicitly close and destroy a window call `nk_window_close`.<br /><br />
-///
-/// #### Usage
-/// To create and keep a window you have to call one of the two `nk_begin_xxx`
-/// functions to start window declarations and `nk_end` at the end. Furthermore it
-/// is recommended to check the return value of `nk_begin_xxx` and only process
-/// widgets inside the window if the value is not 0. Either way you have to call
-/// `nk_end` at the end of window declarations. Furthermore, do not attempt to
-/// nest `nk_begin_xxx` calls which will hopefully result in an assert or if not
-/// in a segmentation fault.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // [... widgets ...]
-/// }
-/// nk_end(ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// In the grand concept window and widget declarations need to occur after input
-/// handling and before drawing to screen. Not doing so can result in higher
-/// latency or at worst invalid behavior. Furthermore make sure that `nk_clear`
-/// is called at the end of the frame. While nuklear's default platform backends
-/// already call `nk_clear` for you if you write your own backend not calling
-/// `nk_clear` can cause asserts or even worse undefined behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// Event evt;
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// nk_input_xxx(...);
-/// }
-/// }
-/// nk_input_end(&ctx);
-///
-/// if (nk_begin_xxx(...) {
-/// //[...]
-/// }
-/// nk_end(ctx);
-///
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case //...:
-/// //[...]
-/// }
-/// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// ------------------------------------|----------------------------------------
-/// nk_begin | Starts a new window; needs to be called every frame for every window (unless hidden) or otherwise the window gets removed
-/// nk_begin_titled | Extended window start with separated title and identifier to allow multiple windows with same name but not title
-/// nk_end | Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup
-//
-/// nk_window_find | Finds and returns the window with give name
-/// nk_window_get_bounds | Returns a rectangle with screen position and size of the currently processed window.
-/// nk_window_get_position | Returns the position of the currently processed window
-/// nk_window_get_size | Returns the size with width and height of the currently processed window
-/// nk_window_get_width | Returns the width of the currently processed window
-/// nk_window_get_height | Returns the height of the currently processed window
-/// nk_window_get_panel | Returns the underlying panel which contains all processing state of the current window
-/// nk_window_get_content_region | Returns the position and size of the currently visible and non-clipped space inside the currently processed window
-/// nk_window_get_content_region_min | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
-/// nk_window_get_content_region_max | Returns the upper rectangle position of the currently visible and non-clipped space inside the currently processed window
-/// nk_window_get_content_region_size | Returns the size of the currently visible and non-clipped space inside the currently processed window
-/// nk_window_get_canvas | Returns the draw command buffer. Can be used to draw custom widgets
-/// nk_window_has_focus | Returns if the currently processed window is currently active
-/// nk_window_is_collapsed | Returns if the window with given name is currently minimized/collapsed
-/// nk_window_is_closed | Returns if the currently processed window was closed
-/// nk_window_is_hidden | Returns if the currently processed window was hidden
-/// nk_window_is_active | Same as nk_window_has_focus for some reason
-/// nk_window_is_hovered | Returns if the currently processed window is currently being hovered by mouse
-/// nk_window_is_any_hovered | Return if any window currently hovered
-/// nk_item_is_any_active | Returns if any window or widgets is currently hovered or active
-//
-/// nk_window_set_bounds | Updates position and size of the currently processed window
-/// nk_window_set_position | Updates position of the currently process window
-/// nk_window_set_size | Updates the size of the currently processed window
-/// nk_window_set_focus | Set the currently processed window as active window
-//
-/// nk_window_close | Closes the window with given window name which deletes the window at the end of the frame
-/// nk_window_collapse | Collapses the window with given window name
-/// nk_window_collapse_if | Collapses the window with given window name if the given condition was met
-/// nk_window_show | Hides a visible or reshows a hidden window
-/// nk_window_show_if | Hides/shows a window depending on condition
-*/
-/*
-/// #### nk_panel_flags
-/// Flag | Description
-/// ----------------------------|----------------------------------------
-/// NK_WINDOW_BORDER | Draws a border around the window to visually separate window from the background
-/// NK_WINDOW_MOVABLE | The movable flag indicates that a window can be moved by user input or by dragging the window header
-/// NK_WINDOW_SCALABLE | The scalable flag indicates that a window can be scaled by user input by dragging a scaler icon at the button of the window
-/// NK_WINDOW_CLOSABLE | Adds a closable icon into the header
-/// NK_WINDOW_MINIMIZABLE | Adds a minimize icon into the header
-/// NK_WINDOW_NO_SCROLLBAR | Removes the scrollbar from the window
-/// NK_WINDOW_TITLE | Forces a header at the top at the window showing the title
-/// NK_WINDOW_SCROLL_AUTO_HIDE | Automatically hides the window scrollbar if no user interaction: also requires delta time in `nk_context` to be set each frame
-/// NK_WINDOW_BACKGROUND | Always keep window in the background
-/// NK_WINDOW_SCALE_LEFT | Puts window scaler in the left-ottom corner instead right-bottom
-/// NK_WINDOW_NO_INPUT | Prevents window of scaling, moving or getting focus
-///
-/// #### nk_collapse_states
-/// State | Description
-/// ----------------|-----------------------------------------------------------
-/// __NK_MINIMIZED__| UI section is collased and not visibile until maximized
-/// __NK_MAXIMIZED__| UI section is extended and visibile until minimized
-/// <br /><br />
-*/
-enum nk_panel_flags {
- NK_WINDOW_BORDER = NK_FLAG(0),
- NK_WINDOW_MOVABLE = NK_FLAG(1),
- NK_WINDOW_SCALABLE = NK_FLAG(2),
- NK_WINDOW_CLOSABLE = NK_FLAG(3),
- NK_WINDOW_MINIMIZABLE = NK_FLAG(4),
- NK_WINDOW_NO_SCROLLBAR = NK_FLAG(5),
- NK_WINDOW_TITLE = NK_FLAG(6),
- NK_WINDOW_SCROLL_AUTO_HIDE = NK_FLAG(7),
- NK_WINDOW_BACKGROUND = NK_FLAG(8),
- NK_WINDOW_SCALE_LEFT = NK_FLAG(9),
- NK_WINDOW_NO_INPUT = NK_FLAG(10)
-};
-/*/// #### nk_begin
-/// Starts a new window; needs to be called every frame for every
-/// window (unless hidden) or otherwise the window gets removed
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __title__ | Window title and identifier. Needs to be persistent over frames to identify the window
-/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
-/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
-///
-/// Returns `true(1)` if the window can be filled up with widgets from this point
-/// until `nk_end` or `false(0)` otherwise for example if minimized
-*/
-NK_API int nk_begin(struct nk_context *ctx, const char *title, struct nk_rect bounds, nk_flags flags);
-/*/// #### nk_begin_titled
-/// Extended window start with separated title and identifier to allow multiple
-/// windows with same name but not title
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Window identifier. Needs to be persistent over frames to identify the window
-/// __title__ | Window title displayed inside header if flag `NK_WINDOW_TITLE` or either `NK_WINDOW_CLOSABLE` or `NK_WINDOW_MINIMIZED` was set
-/// __bounds__ | Initial position and window size. However if you do not define `NK_WINDOW_SCALABLE` or `NK_WINDOW_MOVABLE` you can set window position and size every frame
-/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different window behaviors
-///
-/// Returns `true(1)` if the window can be filled up with widgets from this point
-/// until `nk_end` or `false(0)` otherwise for example if minimized
-*/
-NK_API int nk_begin_titled(struct nk_context *ctx, const char *name, const char *title, struct nk_rect bounds, nk_flags flags);
-/*/// #### nk_end
-/// Needs to be called at the end of the window building process to process scaling, scrollbars and general cleanup.
-/// All widget calls after this functions will result in asserts or no state changes
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_end(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-*/
-NK_API void nk_end(struct nk_context *ctx);
-/*/// #### nk_window_find
-/// Finds and returns a window from passed name
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_end(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Window identifier
-///
-/// Returns a `nk_window` struct pointing to the identified window or NULL if
-/// no window with given name was found
-*/
-NK_API struct nk_window *nk_window_find(struct nk_context *ctx, const char *name);
-/*/// #### nk_window_get_bounds
-///
-/// Returns a rectangle with screen position and size of the currently processed window
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns a `nk_rect` struct with window upper left window position and size
-*/
-NK_API struct nk_rect nk_window_get_bounds(const struct nk_context *ctx);
-/*/// #### nk_window_get_bounds
-///
-/// Returns the position of the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns a `nk_vec2` struct with window upper left position
-*/
-NK_API struct nk_vec2 nk_window_get_position(const struct nk_context *ctx);
-/*/// #### nk_window_get_size
-///
-/// Returns the size with width and height of the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_window_get_size(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns a `nk_vec2` struct with window width and height
-*/
-NK_API struct nk_vec2 nk_window_get_size(const struct nk_context*);
-/*/// #### nk_window_get_width
-///
-/// Returns the width of the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// float nk_window_get_width(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns the current window width
-*/
-NK_API float nk_window_get_width(const struct nk_context*);
-/*/// #### nk_window_get_height
-///
-/// Returns the height of the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// float nk_window_get_height(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns the current window height
-*/
-NK_API float nk_window_get_height(const struct nk_context*);
-/*/// #### nk_window_get_panel
-///
-/// Returns the underlying panel which contains all processing state of the current window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// !!! WARNING
-/// Do not keep the returned panel pointer around it is only valid until `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_panel* nk_window_get_panel(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns a pointer to window internal `nk_panel` state.
-*/
-NK_API struct nk_panel* nk_window_get_panel(struct nk_context*);
-/*/// #### nk_window_get_content_region
-///
-/// Returns the position and size of the currently visible and non-clipped space
-/// inside the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_window_get_content_region(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `nk_rect` struct with screen position and size (no scrollbar offset)
-/// of the visible space inside the current window
-*/
-NK_API struct nk_rect nk_window_get_content_region(struct nk_context*);
-/*/// #### nk_window_get_content_region_min
-///
-/// Returns the upper left position of the currently visible and non-clipped
-/// space inside the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_window_get_content_region_min(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// returns `nk_vec2` struct with upper left screen position (no scrollbar offset)
-/// of the visible space inside the current window
-*/
-NK_API struct nk_vec2 nk_window_get_content_region_min(struct nk_context*);
-/*/// #### nk_window_get_content_region_max
-///
-/// Returns the lower right screen position of the currently visible and
-/// non-clipped space inside the currently processed window.
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_window_get_content_region_max(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `nk_vec2` struct with lower right screen position (no scrollbar offset)
-/// of the visible space inside the current window
-*/
-NK_API struct nk_vec2 nk_window_get_content_region_max(struct nk_context*);
-/*/// #### nk_window_get_content_region_size
-///
-/// Returns the size of the currently visible and non-clipped space inside the
-/// currently processed window
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_window_get_content_region_size(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `nk_vec2` struct with size the visible space inside the current window
-*/
-NK_API struct nk_vec2 nk_window_get_content_region_size(struct nk_context*);
-/*/// #### nk_window_get_canvas
-/// Returns the draw command buffer. Can be used to draw custom widgets
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// !!! WARNING
-/// Do not keep the returned command buffer pointer around it is only valid until `nk_end`
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_command_buffer* nk_window_get_canvas(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns a pointer to window internal `nk_command_buffer` struct used as
-/// drawing canvas. Can be used to do custom drawing.
-*/
-NK_API struct nk_command_buffer* nk_window_get_canvas(struct nk_context*);
-/*/// #### nk_window_has_focus
-/// Returns if the currently processed window is currently active
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_has_focus(const struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `false(0)` if current window is not active or `true(1)` if it is
-*/
-NK_API int nk_window_has_focus(const struct nk_context*);
-/*/// #### nk_window_is_hovered
-/// Return if the current window is being hovered
-/// !!! WARNING
-/// Only call this function between calls `nk_begin_xxx` and `nk_end`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_hovered(struct nk_context *ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `true(1)` if current window is hovered or `false(0)` otherwise
-*/
-NK_API int nk_window_is_hovered(struct nk_context*);
-/*/// #### nk_window_is_collapsed
-/// Returns if the window with given name is currently minimized/collapsed
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of window you want to check if it is collapsed
-///
-/// Returns `true(1)` if current window is minimized and `false(0)` if window not
-/// found or is not minimized
-*/
-NK_API int nk_window_is_collapsed(struct nk_context *ctx, const char *name);
-/*/// #### nk_window_is_closed
-/// Returns if the window with given name was closed by calling `nk_close`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_closed(struct nk_context *ctx, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of window you want to check if it is closed
-///
-/// Returns `true(1)` if current window was closed or `false(0)` window not found or not closed
-*/
-NK_API int nk_window_is_closed(struct nk_context*, const char*);
-/*/// #### nk_window_is_hidden
-/// Returns if the window with given name is hidden
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_hidden(struct nk_context *ctx, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of window you want to check if it is hidden
-///
-/// Returns `true(1)` if current window is hidden or `false(0)` window not found or visible
-*/
-NK_API int nk_window_is_hidden(struct nk_context*, const char*);
-/*/// #### nk_window_is_active
-/// Same as nk_window_has_focus for some reason
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_active(struct nk_context *ctx, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of window you want to check if it is active
-///
-/// Returns `true(1)` if current window is active or `false(0)` window not found or not active
-*/
-NK_API int nk_window_is_active(struct nk_context*, const char*);
-/*/// #### nk_window_is_any_hovered
-/// Returns if the any window is being hovered
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_window_is_any_hovered(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `true(1)` if any window is hovered or `false(0)` otherwise
-*/
-NK_API int nk_window_is_any_hovered(struct nk_context*);
-/*/// #### nk_item_is_any_active
-/// Returns if the any window is being hovered or any widget is currently active.
-/// Can be used to decide if input should be processed by UI or your specific input handling.
-/// Example could be UI and 3D camera to move inside a 3D space.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_item_is_any_active(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-///
-/// Returns `true(1)` if any window is hovered or any item is active or `false(0)` otherwise
-*/
-NK_API int nk_item_is_any_active(struct nk_context*);
-/*/// #### nk_window_set_bounds
-/// Updates position and size of window with passed in name
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to modify both position and size
-/// __bounds__ | Must point to a `nk_rect` struct with the new position and size
-*/
-NK_API void nk_window_set_bounds(struct nk_context*, const char *name, struct nk_rect bounds);
-/*/// #### nk_window_set_position
-/// Updates position of window with passed name
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to modify both position
-/// __pos__ | Must point to a `nk_vec2` struct with the new position
-*/
-NK_API void nk_window_set_position(struct nk_context*, const char *name, struct nk_vec2 pos);
-/*/// #### nk_window_set_size
-/// Updates size of window with passed in name
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to modify both window size
-/// __size__ | Must point to a `nk_vec2` struct with new window size
-*/
-NK_API void nk_window_set_size(struct nk_context*, const char *name, struct nk_vec2);
-/*/// #### nk_window_set_focus
-/// Sets the window with given name as active
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_set_focus(struct nk_context*, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to set focus on
-*/
-NK_API void nk_window_set_focus(struct nk_context*, const char *name);
-/*/// #### nk_window_close
-/// Closes a window and marks it for being freed at the end of the frame
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_close(struct nk_context *ctx, const char *name);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to close
-*/
-NK_API void nk_window_close(struct nk_context *ctx, const char *name);
-/*/// #### nk_window_collapse
-/// Updates collapse state of a window with given name
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to close
-/// __state__ | value out of nk_collapse_states section
-*/
-NK_API void nk_window_collapse(struct nk_context*, const char *name, enum nk_collapse_states state);
-/*/// #### nk_window_collapse_if
-/// Updates collapse state of a window with given name if given condition is met
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to either collapse or maximize
-/// __state__ | value out of nk_collapse_states section the window should be put into
-/// __cond__ | condition that has to be met to actually commit the collapse state change
-*/
-NK_API void nk_window_collapse_if(struct nk_context*, const char *name, enum nk_collapse_states, int cond);
-/*/// #### nk_window_show
-/// updates visibility state of a window with given name
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to either collapse or maximize
-/// __state__ | state with either visible or hidden to modify the window with
-*/
-NK_API void nk_window_show(struct nk_context*, const char *name, enum nk_show_states);
-/*/// #### nk_window_show_if
-/// Updates visibility state of a window with given name if a given condition is met
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __name__ | Identifier of the window to either hide or show
-/// __state__ | state with either visible or hidden to modify the window with
-/// __cond__ | condition that has to be met to actually commit the visbility state change
-*/
-NK_API void nk_window_show_if(struct nk_context*, const char *name, enum nk_show_states, int cond);
-/* =============================================================================
- *
- * LAYOUT
- *
- * =============================================================================
-/// ### Layouting
-/// Layouting in general describes placing widget inside a window with position and size.
-/// While in this particular implementation there are five different APIs for layouting
-/// each with different trade offs between control and ease of use. <br /><br />
-///
-/// All layouting methods in this library are based around the concept of a row.
-/// A row has a height the window content grows by and a number of columns and each
-/// layouting method specifies how each widget is placed inside the row.
-/// After a row has been allocated by calling a layouting functions and then
-/// filled with widgets will advance an internal pointer over the allocated row. <br /><br />
-///
-/// To actually define a layout you just call the appropriate layouting function
-/// and each subsequent widget call will place the widget as specified. Important
-/// here is that if you define more widgets then columns defined inside the layout
-/// functions it will allocate the next row without you having to make another layouting <br /><br />
-/// call.
-///
-/// Biggest limitation with using all these APIs outside the `nk_layout_space_xxx` API
-/// is that you have to define the row height for each. However the row height
-/// often depends on the height of the font. <br /><br />
-///
-/// To fix that internally nuklear uses a minimum row height that is set to the
-/// height plus padding of currently active font and overwrites the row height
-/// value if zero. <br /><br />
-///
-/// If you manually want to change the minimum row height then
-/// use nk_layout_set_min_row_height, and use nk_layout_reset_min_row_height to
-/// reset it back to be derived from font height. <br /><br />
-///
-/// Also if you change the font in nuklear it will automatically change the minimum
-/// row height for you and. This means if you change the font but still want
-/// a minimum row height smaller than the font you have to repush your value. <br /><br />
-///
-/// For actually more advanced UI I would even recommend using the `nk_layout_space_xxx`
-/// layouting method in combination with a cassowary constraint solver (there are
-/// some versions on github with permissive license model) to take over all control over widget
-/// layouting yourself. However for quick and dirty layouting using all the other layouting
-/// functions should be fine.
-///
-/// #### Usage
-/// 1. __nk_layout_row_dynamic__<br /><br />
-/// The easiest layouting function is `nk_layout_row_dynamic`. It provides each
-/// widgets with same horizontal space inside the row and dynamically grows
-/// if the owning window grows in width. So the number of columns dictates
-/// the size of each widget dynamically by formula:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// widget_width = (window_width - padding - spacing) * (1/colum_count)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Just like all other layouting APIs if you define more widget than columns this
-/// library will allocate a new row and keep all layouting parameters previously
-/// defined.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // first row with height: 30 composed of two widgets
-/// nk_layout_row_dynamic(&ctx, 30, 2);
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // second row with same parameter as defined above
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // third row uses 0 for height which will use auto layouting
-/// nk_layout_row_dynamic(&ctx, 0, 2);
-/// nk_widget(...);
-/// nk_widget(...);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// 2. __nk_layout_row_static__<br /><br />
-/// Another easy layouting function is `nk_layout_row_static`. It provides each
-/// widget with same horizontal pixel width inside the row and does not grow
-/// if the owning window scales smaller or bigger.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // first row with height: 30 composed of two widgets with width: 80
-/// nk_layout_row_static(&ctx, 30, 80, 2);
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // second row with same parameter as defined above
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // third row uses 0 for height which will use auto layouting
-/// nk_layout_row_static(&ctx, 0, 80, 2);
-/// nk_widget(...);
-/// nk_widget(...);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// 3. __nk_layout_row_xxx__<br /><br />
-/// A little bit more advanced layouting API are functions `nk_layout_row_begin`,
-/// `nk_layout_row_push` and `nk_layout_row_end`. They allow to directly
-/// specify each column pixel or window ratio in a row. It supports either
-/// directly setting per column pixel width or widget window ratio but not
-/// both. Furthermore it is a immediate mode API so each value is directly
-/// pushed before calling a widget. Therefore the layout is not automatically
-/// repeating like the last two layouting functions.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // first row with height: 25 composed of two widgets with width 60 and 40
-/// nk_layout_row_begin(ctx, NK_STATIC, 25, 2);
-/// nk_layout_row_push(ctx, 60);
-/// nk_widget(...);
-/// nk_layout_row_push(ctx, 40);
-/// nk_widget(...);
-/// nk_layout_row_end(ctx);
-/// //
-/// // second row with height: 25 composed of two widgets with window ratio 0.25 and 0.75
-/// nk_layout_row_begin(ctx, NK_DYNAMIC, 25, 2);
-/// nk_layout_row_push(ctx, 0.25f);
-/// nk_widget(...);
-/// nk_layout_row_push(ctx, 0.75f);
-/// nk_widget(...);
-/// nk_layout_row_end(ctx);
-/// //
-/// // third row with auto generated height: composed of two widgets with window ratio 0.25 and 0.75
-/// nk_layout_row_begin(ctx, NK_DYNAMIC, 0, 2);
-/// nk_layout_row_push(ctx, 0.25f);
-/// nk_widget(...);
-/// nk_layout_row_push(ctx, 0.75f);
-/// nk_widget(...);
-/// nk_layout_row_end(ctx);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// 4. __nk_layout_row__<br /><br />
-/// The array counterpart to API nk_layout_row_xxx is the single nk_layout_row
-/// functions. Instead of pushing either pixel or window ratio for every widget
-/// it allows to define it by array. The trade of for less control is that
-/// `nk_layout_row` is automatically repeating. Otherwise the behavior is the
-/// same.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // two rows with height: 30 composed of two widgets with width 60 and 40
-/// const float size[] = {60,40};
-/// nk_layout_row(ctx, NK_STATIC, 30, 2, ratio);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // two rows with height: 30 composed of two widgets with window ratio 0.25 and 0.75
-/// const float ratio[] = {0.25, 0.75};
-/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// //
-/// // two rows with auto generated height composed of two widgets with window ratio 0.25 and 0.75
-/// const float ratio[] = {0.25, 0.75};
-/// nk_layout_row(ctx, NK_DYNAMIC, 30, 2, ratio);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// 5. __nk_layout_row_template_xxx__<br /><br />
-/// The most complex and second most flexible API is a simplified flexbox version without
-/// line wrapping and weights for dynamic widgets. It is an immediate mode API but
-/// unlike `nk_layout_row_xxx` it has auto repeat behavior and needs to be called
-/// before calling the templated widgets.
-/// The row template layout has three different per widget size specifier. The first
-/// one is the `nk_layout_row_template_push_static` with fixed widget pixel width.
-/// They do not grow if the row grows and will always stay the same.
-/// The second size specifier is `nk_layout_row_template_push_variable`
-/// which defines a minimum widget size but it also can grow if more space is available
-/// not taken by other widgets.
-/// Finally there are dynamic widgets with `nk_layout_row_template_push_dynamic`
-/// which are completely flexible and unlike variable widgets can even shrink
-/// to zero if not enough space is provided.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // two rows with height: 30 composed of three widgets
-/// nk_layout_row_template_begin(ctx, 30);
-/// nk_layout_row_template_push_dynamic(ctx);
-/// nk_layout_row_template_push_variable(ctx, 80);
-/// nk_layout_row_template_push_static(ctx, 80);
-/// nk_layout_row_template_end(ctx);
-/// //
-/// // first row
-/// nk_widget(...); // dynamic widget can go to zero if not enough space
-/// nk_widget(...); // variable widget with min 80 pixel but can grow bigger if enough space
-/// nk_widget(...); // static widget with fixed 80 pixel width
-/// //
-/// // second row same layout
-/// nk_widget(...);
-/// nk_widget(...);
-/// nk_widget(...);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// 6. __nk_layout_space_xxx__<br /><br />
-/// Finally the most flexible API directly allows you to place widgets inside the
-/// window. The space layout API is an immediate mode API which does not support
-/// row auto repeat and directly sets position and size of a widget. Position
-/// and size hereby can be either specified as ratio of allocated space or
-/// allocated space local position and pixel size. Since this API is quite
-/// powerful there are a number of utility functions to get the available space
-/// and convert between local allocated space and screen space.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_begin_xxx(...) {
-/// // static row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
-/// nk_layout_space_begin(ctx, NK_STATIC, 500, INT_MAX);
-/// nk_layout_space_push(ctx, nk_rect(0,0,150,200));
-/// nk_widget(...);
-/// nk_layout_space_push(ctx, nk_rect(200,200,100,200));
-/// nk_widget(...);
-/// nk_layout_space_end(ctx);
-/// //
-/// // dynamic row with height: 500 (you can set column count to INT_MAX if you don't want to be bothered)
-/// nk_layout_space_begin(ctx, NK_DYNAMIC, 500, INT_MAX);
-/// nk_layout_space_push(ctx, nk_rect(0.5,0.5,0.1,0.1));
-/// nk_widget(...);
-/// nk_layout_space_push(ctx, nk_rect(0.7,0.6,0.1,0.1));
-/// nk_widget(...);
-/// }
-/// nk_end(...);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// ----------------------------------------|------------------------------------
-/// nk_layout_set_min_row_height | Set the currently used minimum row height to a specified value
-/// nk_layout_reset_min_row_height | Resets the currently used minimum row height to font height
-/// nk_layout_widget_bounds | Calculates current width a static layout row can fit inside a window
-/// nk_layout_ratio_from_pixel | Utility functions to calculate window ratio from pixel size
-//
-/// nk_layout_row_dynamic | Current layout is divided into n same sized growing columns
-/// nk_layout_row_static | Current layout is divided into n same fixed sized columns
-/// nk_layout_row_begin | Starts a new row with given height and number of columns
-/// nk_layout_row_push | Pushes another column with given size or window ratio
-/// nk_layout_row_end | Finished previously started row
-/// nk_layout_row | Specifies row columns in array as either window ratio or size
-//
-/// nk_layout_row_template_begin | Begins the row template declaration
-/// nk_layout_row_template_push_dynamic | Adds a dynamic column that dynamically grows and can go to zero if not enough space
-/// nk_layout_row_template_push_variable | Adds a variable column that dynamically grows but does not shrink below specified pixel width
-/// nk_layout_row_template_push_static | Adds a static column that does not grow and will always have the same size
-/// nk_layout_row_template_end | Marks the end of the row template
-//
-/// nk_layout_space_begin | Begins a new layouting space that allows to specify each widgets position and size
-/// nk_layout_space_push | Pushes position and size of the next widget in own coordinate space either as pixel or ratio
-/// nk_layout_space_end | Marks the end of the layouting space
-//
-/// nk_layout_space_bounds | Callable after nk_layout_space_begin and returns total space allocated
-/// nk_layout_space_to_screen | Converts vector from nk_layout_space coordinate space into screen space
-/// nk_layout_space_to_local | Converts vector from screen space into nk_layout_space coordinates
-/// nk_layout_space_rect_to_screen | Converts rectangle from nk_layout_space coordinate space into screen space
-/// nk_layout_space_rect_to_local | Converts rectangle from screen space into nk_layout_space coordinates
-*/
-/*/// #### nk_layout_set_min_row_height
-/// Sets the currently used minimum row height.
-/// !!! WARNING
-/// The passed height needs to include both your preferred row height
-/// as well as padding. No internal padding is added.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_set_min_row_height(struct nk_context*, float height);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __height__ | New minimum row height to be used for auto generating the row height
-*/
-NK_API void nk_layout_set_min_row_height(struct nk_context*, float height);
-/*/// #### nk_layout_reset_min_row_height
-/// Reset the currently used minimum row height back to `font_height + text_padding + padding`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_reset_min_row_height(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-*/
-NK_API void nk_layout_reset_min_row_height(struct nk_context*);
-/*/// #### nk_layout_widget_bounds
-/// Returns the width of the next row allocate by one of the layouting functions
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_layout_widget_bounds(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-///
-/// Return `nk_rect` with both position and size of the next row
-*/
-NK_API struct nk_rect nk_layout_widget_bounds(struct nk_context*);
-/*/// #### nk_layout_ratio_from_pixel
-/// Utility functions to calculate window ratio from pixel size
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __pixel__ | Pixel_width to convert to window ratio
-///
-/// Returns `nk_rect` with both position and size of the next row
-*/
-NK_API float nk_layout_ratio_from_pixel(struct nk_context*, float pixel_width);
-/*/// #### nk_layout_row_dynamic
-/// Sets current row layout to share horizontal space
-/// between @cols number of widgets evenly. Once called all subsequent widget
-/// calls greater than @cols will allocate a new row with same layout.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-/// __columns__ | Number of widget inside row
-*/
-NK_API void nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols);
-/*/// #### nk_layout_row_dynamic
-/// Sets current row layout to fill @cols number of widgets
-/// in row with same @item_width horizontal size. Once called all subsequent widget
-/// calls greater than @cols will allocate a new row with same layout.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-/// __width__ | Holds pixel width of each widget in the row
-/// __columns__ | Number of widget inside row
-*/
-NK_API void nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols);
-/*/// #### nk_layout_row_begin
-/// Starts a new dynamic or fixed row with given height and columns.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __fmt__ | either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
-/// __height__ | holds height of each widget in row or zero for auto layouting
-/// __columns__ | Number of widget inside row
-*/
-NK_API void nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt, float row_height, int cols);
-/*/// #### nk_layout_row_push
-/// Specifies either window ratio or width of a single column
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_push(struct nk_context*, float value);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __value__ | either a window ratio or fixed width depending on @fmt in previous `nk_layout_row_begin` call
-*/
-NK_API void nk_layout_row_push(struct nk_context*, float value);
-/*/// #### nk_layout_row_end
-/// Finished previously started row
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_end(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-*/
-NK_API void nk_layout_row_end(struct nk_context*);
-/*/// #### nk_layout_row
-/// Specifies row columns in array as either window ratio or size
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-/// __columns__ | Number of widget inside row
-*/
-NK_API void nk_layout_row(struct nk_context*, enum nk_layout_format, float height, int cols, const float *ratio);
-/*/// #### nk_layout_row_template_begin
-/// Begins the row template declaration
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_template_begin(struct nk_context*, float row_height);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-*/
-NK_API void nk_layout_row_template_begin(struct nk_context*, float row_height);
-/*/// #### nk_layout_row_template_push_dynamic
-/// Adds a dynamic column that dynamically grows and can go to zero if not enough space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_template_push_dynamic(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-*/
-NK_API void nk_layout_row_template_push_dynamic(struct nk_context*);
-/*/// #### nk_layout_row_template_push_variable
-/// Adds a variable column that dynamically grows but does not shrink below specified pixel width
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __width__ | Holds the minimum pixel width the next column must always be
-*/
-NK_API void nk_layout_row_template_push_variable(struct nk_context*, float min_width);
-/*/// #### nk_layout_row_template_push_static
-/// Adds a static column that does not grow and will always have the same size
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_template_push_static(struct nk_context*, float width);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __width__ | Holds the absolute pixel width value the next column must be
-*/
-NK_API void nk_layout_row_template_push_static(struct nk_context*, float width);
-/*/// #### nk_layout_row_template_end
-/// Marks the end of the row template
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_row_template_end(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-*/
-NK_API void nk_layout_row_template_end(struct nk_context*);
-/*/// #### nk_layout_space_begin
-/// Begins a new layouting space that allows to specify each widgets position and size.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_begin_xxx`
-/// __fmt__ | Either `NK_DYNAMIC` for window ratio or `NK_STATIC` for fixed size columns
-/// __height__ | Holds height of each widget in row or zero for auto layouting
-/// __columns__ | Number of widgets inside row
-*/
-NK_API void nk_layout_space_begin(struct nk_context*, enum nk_layout_format, float height, int widget_count);
-/*/// #### nk_layout_space_push
-/// Pushes position and size of the next widget in own coordinate space either as pixel or ratio
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_space_push(struct nk_context *ctx, struct nk_rect bounds);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-/// __bounds__ | Position and size in laoyut space local coordinates
-*/
-NK_API void nk_layout_space_push(struct nk_context*, struct nk_rect bounds);
-/*/// #### nk_layout_space_end
-/// Marks the end of the layout space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_layout_space_end(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-*/
-NK_API void nk_layout_space_end(struct nk_context*);
-/*/// #### nk_layout_space_bounds
-/// Utility function to calculate total space allocated for `nk_layout_space`
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_layout_space_bounds(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-///
-/// Returns `nk_rect` holding the total space allocated
-*/
-NK_API struct nk_rect nk_layout_space_bounds(struct nk_context*);
-/*/// #### nk_layout_space_to_screen
-/// Converts vector from nk_layout_space coordinate space into screen space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-/// __vec__ | Position to convert from layout space into screen coordinate space
-///
-/// Returns transformed `nk_vec2` in screen space coordinates
-*/
-NK_API struct nk_vec2 nk_layout_space_to_screen(struct nk_context*, struct nk_vec2);
-/*/// #### nk_layout_space_to_screen
-/// Converts vector from layout space into screen space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-/// __vec__ | Position to convert from screen space into layout coordinate space
-///
-/// Returns transformed `nk_vec2` in layout space coordinates
-*/
-NK_API struct nk_vec2 nk_layout_space_to_local(struct nk_context*, struct nk_vec2);
-/*/// #### nk_layout_space_rect_to_screen
-/// Converts rectangle from screen space into layout space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-/// __bounds__ | Rectangle to convert from layout space into screen space
-///
-/// Returns transformed `nk_rect` in screen space coordinates
-*/
-NK_API struct nk_rect nk_layout_space_rect_to_screen(struct nk_context*, struct nk_rect);
-/*/// #### nk_layout_space_rect_to_local
-/// Converts rectangle from layout space into screen space
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after call `nk_layout_space_begin`
-/// __bounds__ | Rectangle to convert from layout space into screen space
-///
-/// Returns transformed `nk_rect` in layout space coordinates
-*/
-NK_API struct nk_rect nk_layout_space_rect_to_local(struct nk_context*, struct nk_rect);
-/* =============================================================================
- *
- * GROUP
- *
- * =============================================================================
-/// ### Groups
-/// Groups are basically windows inside windows. They allow to subdivide space
-/// in a window to layout widgets as a group. Almost all more complex widget
-/// layouting requirements can be solved using groups and basic layouting
-/// fuctionality. Groups just like windows are identified by an unique name and
-/// internally keep track of scrollbar offsets by default. However additional
-/// versions are provided to directly manage the scrollbar.
-///
-/// #### Usage
-/// To create a group you have to call one of the three `nk_group_begin_xxx`
-/// functions to start group declarations and `nk_group_end` at the end. Furthermore it
-/// is required to check the return value of `nk_group_begin_xxx` and only process
-/// widgets inside the window if the value is not 0.
-/// Nesting groups is possible and even encouraged since many layouting schemes
-/// can only be achieved by nesting. Groups, unlike windows, need `nk_group_end`
-/// to be only called if the corosponding `nk_group_begin_xxx` call does not return 0:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_group_begin_xxx(ctx, ...) {
-/// // [... widgets ...]
-/// nk_group_end(ctx);
-/// }
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// In the grand concept groups can be called after starting a window
-/// with `nk_begin_xxx` and before calling `nk_end`:
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// // Input
-/// Event evt;
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// nk_input_xxx(...);
-/// }
-/// }
-/// nk_input_end(&ctx);
-/// //
-/// // Window
-/// if (nk_begin_xxx(...) {
-/// // [...widgets...]
-/// nk_layout_row_dynamic(...);
-/// if (nk_group_begin_xxx(ctx, ...) {
-/// //[... widgets ...]
-/// nk_group_end(ctx);
-/// }
-/// }
-/// nk_end(ctx);
-/// //
-/// // Draw
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case ...:
-/// // [...]
-/// }
-// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-/// #### Reference
-/// Function | Description
-/// --------------------------------|-------------------------------------------
-/// nk_group_begin | Start a new group with internal scrollbar handling
-/// nk_group_begin_titled | Start a new group with separeted name and title and internal scrollbar handling
-/// nk_group_end | Ends a group. Should only be called if nk_group_begin returned non-zero
-/// nk_group_scrolled_offset_begin | Start a new group with manual separated handling of scrollbar x- and y-offset
-/// nk_group_scrolled_begin | Start a new group with manual scrollbar handling
-/// nk_group_scrolled_end | Ends a group with manual scrollbar handling. Should only be called if nk_group_begin returned non-zero
-*/
-/*/// #### nk_group_begin
-/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_group_begin(struct nk_context*, const char *title, nk_flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __title__ | Must be an unique identifier for this group that is also used for the group header
-/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_group_begin(struct nk_context*, const char *title, nk_flags);
-/*/// #### nk_group_begin_titled
-/// Starts a new widget group. Requires a previous layouting function to specify a pos/size.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __id__ | Must be an unique identifier for this group
-/// __title__ | Group header title
-/// __flags__ | Window flags defined in the nk_panel_flags section with a number of different group behaviors
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_group_begin_titled(struct nk_context*, const char *name, const char *title, nk_flags);
-/*/// #### nk_group_end
-/// Ends a widget group
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_group_end(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-*/
-NK_API void nk_group_end(struct nk_context*);
-/*/// #### nk_group_scrolled_offset_begin
-/// starts a new widget group. requires a previous layouting function to specify
-/// a size. Does not keep track of scrollbar.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __x_offset__| Scrollbar x-offset to offset all widgets inside the group horizontally.
-/// __y_offset__| Scrollbar y-offset to offset all widgets inside the group vertically
-/// __title__ | Window unique group title used to both identify and display in the group header
-/// __flags__ | Window flags from the nk_panel_flags section
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_group_scrolled_offset_begin(struct nk_context*, nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags);
-/*/// #### nk_group_scrolled_begin
-/// Starts a new widget group. requires a previous
-/// layouting function to specify a size. Does not keep track of scrollbar.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __off__ | Both x- and y- scroll offset. Allows for manual scrollbar control
-/// __title__ | Window unique group title used to both identify and display in the group header
-/// __flags__ | Window flags from nk_panel_flags section
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_group_scrolled_begin(struct nk_context*, struct nk_scroll *off, const char *title, nk_flags);
-/*/// #### nk_group_scrolled_end
-/// Ends a widget group after calling nk_group_scrolled_offset_begin or nk_group_scrolled_begin.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_group_scrolled_end(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-*/
-NK_API void nk_group_scrolled_end(struct nk_context*);
-/* =============================================================================
- *
- * TREE
- *
- * =============================================================================
-/// ### Tree
-/// Trees represent two different concept. First the concept of a collapsable
-/// UI section that can be either in a hidden or visibile state. They allow the UI
-/// user to selectively minimize the current set of visible UI to comprehend.
-/// The second concept are tree widgets for visual UI representation of trees.<br /><br />
-///
-/// Trees thereby can be nested for tree representations and multiple nested
-/// collapsable UI sections. All trees are started by calling of the
-/// `nk_tree_xxx_push_tree` functions and ended by calling one of the
-/// `nk_tree_xxx_pop_xxx()` functions. Each starting functions takes a title label
-/// and optionally an image to be displayed and the initial collapse state from
-/// the nk_collapse_states section.<br /><br />
-///
-/// The runtime state of the tree is either stored outside the library by the caller
-/// or inside which requires a unique ID. The unique ID can either be generated
-/// automatically from `__FILE__` and `__LINE__` with function `nk_tree_push`,
-/// by `__FILE__` and a user provided ID generated for example by loop index with
-/// function `nk_tree_push_id` or completely provided from outside by user with
-/// function `nk_tree_push_hashed`.
-///
-/// #### Usage
-/// To create a tree you have to call one of the seven `nk_tree_xxx_push_xxx`
-/// functions to start a collapsable UI section and `nk_tree_xxx_pop` to mark the
-/// end.
-/// Each starting function will either return `false(0)` if the tree is collapsed
-/// or hidden and therefore does not need to be filled with content or `true(1)`
-/// if visible and required to be filled.
-///
-/// !!! Note
-/// The tree header does not require and layouting function and instead
-/// calculates a auto height based on the currently used font size
-///
-/// The tree ending functions only need to be called if the tree content is
-/// actually visible. So make sure the tree push function is guarded by `if`
-/// and the pop call is only taken if the tree is visible.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// if (nk_tree_push(ctx, NK_TREE_TAB, "Tree", NK_MINIMIZED)) {
-/// nk_layout_row_dynamic(...);
-/// nk_widget(...);
-/// nk_tree_pop(ctx);
-/// }
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// ----------------------------|-------------------------------------------
-/// nk_tree_push | Start a collapsable UI section with internal state management
-/// nk_tree_push_id | Start a collapsable UI section with internal state management callable in a look
-/// nk_tree_push_hashed | Start a collapsable UI section with internal state management with full control over internal unique ID use to store state
-/// nk_tree_image_push | Start a collapsable UI section with image and label header
-/// nk_tree_image_push_id | Start a collapsable UI section with image and label header and internal state management callable in a look
-/// nk_tree_image_push_hashed | Start a collapsable UI section with image and label header and internal state management with full control over internal unique ID use to store state
-/// nk_tree_pop | Ends a collapsable UI section
-//
-/// nk_tree_state_push | Start a collapsable UI section with external state management
-/// nk_tree_state_image_push | Start a collapsable UI section with image and label header and external state management
-/// nk_tree_state_pop | Ends a collapsabale UI section
-///
-/// #### nk_tree_type
-/// Flag | Description
-/// ----------------|----------------------------------------
-/// NK_TREE_NODE | Highlighted tree header to mark a collapsable UI section
-/// NK_TREE_TAB | Non-highighted tree header closer to tree representations
-*/
-/*/// #### nk_tree_push
-/// Starts a collapsable UI section with internal state management
-/// !!! WARNING
-/// To keep track of the runtime tree collapsable state this function uses
-/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want
-/// to call this function in a loop please use `nk_tree_push_id` or
-/// `nk_tree_push_hashed` instead.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_tree_push(ctx, type, title, state)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-#define nk_tree_push(ctx, type, title, state) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
-/*/// #### nk_tree_push_id
-/// Starts a collapsable UI section with internal state management callable in a look
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_tree_push_id(ctx, type, title, state, id)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-/// __id__ | Loop counter index if this function is called in a loop
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-#define nk_tree_push_id(ctx, type, title, state, id) nk_tree_push_hashed(ctx, type, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
-/*/// #### nk_tree_push_hashed
-/// Start a collapsable UI section with internal state management with full
-/// control over internal unique ID used to store state
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-/// __hash__ | Memory block or string to generate the ID from
-/// __len__ | Size of passed memory block or string in __hash__
-/// __seed__ | Seeding value if this function is called in a loop or default to `0`
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_tree_push_hashed(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-/*/// #### nk_tree_image_push
-/// Start a collapsable UI section with image and label header
-/// !!! WARNING
-/// To keep track of the runtime tree collapsable state this function uses
-/// defines `__FILE__` and `__LINE__` to generate a unique ID. If you want
-/// to call this function in a loop please use `nk_tree_image_push_id` or
-/// `nk_tree_image_push_hashed` instead.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_tree_image_push(ctx, type, img, title, state)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-//
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __img__ | Image to display inside the header on the left of the label
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-#define nk_tree_image_push(ctx, type, img, title, state) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),__LINE__)
-/*/// #### nk_tree_image_push_id
-/// Start a collapsable UI section with image and label header and internal state
-/// management callable in a look
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// #define nk_tree_image_push_id(ctx, type, img, title, state, id)
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __img__ | Image to display inside the header on the left of the label
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-/// __id__ | Loop counter index if this function is called in a loop
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-#define nk_tree_image_push_id(ctx, type, img, title, state, id) nk_tree_image_push_hashed(ctx, type, img, title, state, NK_FILE_LINE,nk_strlen(NK_FILE_LINE),id)
-/*/// #### nk_tree_image_push_hashed
-/// Start a collapsable UI section with internal state management with full
-/// control over internal unique ID used to store state
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __img__ | Image to display inside the header on the left of the label
-/// __title__ | Label printed in the tree header
-/// __state__ | Initial tree state value out of nk_collapse_states
-/// __hash__ | Memory block or string to generate the ID from
-/// __len__ | Size of passed memory block or string in __hash__
-/// __seed__ | Seeding value if this function is called in a loop or default to `0`
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_tree_image_push_hashed(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states initial_state, const char *hash, int len,int seed);
-/*/// #### nk_tree_pop
-/// Ends a collapsabale UI section
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_tree_pop(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
-*/
-NK_API void nk_tree_pop(struct nk_context*);
-/*/// #### nk_tree_state_push
-/// Start a collapsable UI section with external state management
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __title__ | Label printed in the tree header
-/// __state__ | Persistent state to update
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_tree_state_push(struct nk_context*, enum nk_tree_type, const char *title, enum nk_collapse_states *state);
-/*/// #### nk_tree_state_image_push
-/// Start a collapsable UI section with image and label header and external state management
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
-/// __img__ | Image to display inside the header on the left of the label
-/// __type__ | Value from the nk_tree_type section to visually mark a tree node header as either a collapseable UI section or tree node
-/// __title__ | Label printed in the tree header
-/// __state__ | Persistent state to update
-///
-/// Returns `true(1)` if visible and fillable with widgets or `false(0)` otherwise
-*/
-NK_API int nk_tree_state_image_push(struct nk_context*, enum nk_tree_type, struct nk_image, const char *title, enum nk_collapse_states *state);
-/*/// #### nk_tree_state_pop
-/// Ends a collapsabale UI section
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_tree_state_pop(struct nk_context*);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// ------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling `nk_tree_xxx_push_xxx`
-*/
-NK_API void nk_tree_state_pop(struct nk_context*);
-/* =============================================================================
- *
- * LIST VIEW
- *
- * ============================================================================= */
-struct nk_list_view {
-/* public: */
- int begin, end, count;
-/* private: */
- int total_height;
- struct nk_context *ctx;
- nk_uint *scroll_pointer;
- nk_uint scroll_value;
-};
-NK_API int nk_list_view_begin(struct nk_context*, struct nk_list_view *out, const char *id, nk_flags, int row_height, int row_count);
-NK_API void nk_list_view_end(struct nk_list_view*);
-/* =============================================================================
- *
- * WIDGET
- *
- * ============================================================================= */
-enum nk_widget_layout_states {
- NK_WIDGET_INVALID, /* The widget cannot be seen and is completely out of view */
- NK_WIDGET_VALID, /* The widget is completely inside the window and can be updated and drawn */
- NK_WIDGET_ROM /* The widget is partially visible and cannot be updated */
-};
-enum nk_widget_states {
- NK_WIDGET_STATE_MODIFIED = NK_FLAG(1),
- NK_WIDGET_STATE_INACTIVE = NK_FLAG(2), /* widget is neither active nor hovered */
- NK_WIDGET_STATE_ENTERED = NK_FLAG(3), /* widget has been hovered on the current frame */
- NK_WIDGET_STATE_HOVER = NK_FLAG(4), /* widget is being hovered */
- NK_WIDGET_STATE_ACTIVED = NK_FLAG(5),/* widget is currently activated */
- NK_WIDGET_STATE_LEFT = NK_FLAG(6), /* widget is from this frame on not hovered anymore */
- NK_WIDGET_STATE_HOVERED = NK_WIDGET_STATE_HOVER|NK_WIDGET_STATE_MODIFIED, /* widget is being hovered */
- NK_WIDGET_STATE_ACTIVE = NK_WIDGET_STATE_ACTIVED|NK_WIDGET_STATE_MODIFIED /* widget is currently activated */
-};
-NK_API enum nk_widget_layout_states nk_widget(struct nk_rect*, const struct nk_context*);
-NK_API enum nk_widget_layout_states nk_widget_fitting(struct nk_rect*, struct nk_context*, struct nk_vec2);
-NK_API struct nk_rect nk_widget_bounds(struct nk_context*);
-NK_API struct nk_vec2 nk_widget_position(struct nk_context*);
-NK_API struct nk_vec2 nk_widget_size(struct nk_context*);
-NK_API float nk_widget_width(struct nk_context*);
-NK_API float nk_widget_height(struct nk_context*);
-NK_API int nk_widget_is_hovered(struct nk_context*);
-NK_API int nk_widget_is_mouse_clicked(struct nk_context*, enum nk_buttons);
-NK_API int nk_widget_has_mouse_click_down(struct nk_context*, enum nk_buttons, int down);
-NK_API void nk_spacing(struct nk_context*, int cols);
-/* =============================================================================
- *
- * TEXT
- *
- * ============================================================================= */
-enum nk_text_align {
- NK_TEXT_ALIGN_LEFT = 0x01,
- NK_TEXT_ALIGN_CENTERED = 0x02,
- NK_TEXT_ALIGN_RIGHT = 0x04,
- NK_TEXT_ALIGN_TOP = 0x08,
- NK_TEXT_ALIGN_MIDDLE = 0x10,
- NK_TEXT_ALIGN_BOTTOM = 0x20
-};
-enum nk_text_alignment {
- NK_TEXT_LEFT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_LEFT,
- NK_TEXT_CENTERED = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_CENTERED,
- NK_TEXT_RIGHT = NK_TEXT_ALIGN_MIDDLE|NK_TEXT_ALIGN_RIGHT
-};
-NK_API void nk_text(struct nk_context*, const char*, int, nk_flags);
-NK_API void nk_text_colored(struct nk_context*, const char*, int, nk_flags, struct nk_color);
-NK_API void nk_text_wrap(struct nk_context*, const char*, int);
-NK_API void nk_text_wrap_colored(struct nk_context*, const char*, int, struct nk_color);
-NK_API void nk_label(struct nk_context*, const char*, nk_flags align);
-NK_API void nk_label_colored(struct nk_context*, const char*, nk_flags align, struct nk_color);
-NK_API void nk_label_wrap(struct nk_context*, const char*);
-NK_API void nk_label_colored_wrap(struct nk_context*, const char*, struct nk_color);
-NK_API void nk_image(struct nk_context*, struct nk_image);
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void nk_labelf(struct nk_context*, nk_flags, NK_PRINTF_FORMAT_STRING const char*, ...) NK_PRINTF_VARARG_FUNC(3);
-NK_API void nk_labelf_colored(struct nk_context*, nk_flags, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(4);
-NK_API void nk_labelf_wrap(struct nk_context*, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(2);
-NK_API void nk_labelf_colored_wrap(struct nk_context*, struct nk_color, NK_PRINTF_FORMAT_STRING const char*,...) NK_PRINTF_VARARG_FUNC(3);
-NK_API void nk_value_bool(struct nk_context*, const char *prefix, int);
-NK_API void nk_value_int(struct nk_context*, const char *prefix, int);
-NK_API void nk_value_uint(struct nk_context*, const char *prefix, unsigned int);
-NK_API void nk_value_float(struct nk_context*, const char *prefix, float);
-NK_API void nk_value_color_byte(struct nk_context*, const char *prefix, struct nk_color);
-NK_API void nk_value_color_float(struct nk_context*, const char *prefix, struct nk_color);
-NK_API void nk_value_color_hex(struct nk_context*, const char *prefix, struct nk_color);
-#endif
-/* =============================================================================
- *
- * BUTTON
- *
- * ============================================================================= */
-NK_API int nk_button_text(struct nk_context*, const char *title, int len);
-NK_API int nk_button_label(struct nk_context*, const char *title);
-NK_API int nk_button_color(struct nk_context*, struct nk_color);
-NK_API int nk_button_symbol(struct nk_context*, enum nk_symbol_type);
-NK_API int nk_button_image(struct nk_context*, struct nk_image img);
-NK_API int nk_button_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags text_alignment);
-NK_API int nk_button_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
-NK_API int nk_button_image_label(struct nk_context*, struct nk_image img, const char*, nk_flags text_alignment);
-NK_API int nk_button_image_text(struct nk_context*, struct nk_image img, const char*, int, nk_flags alignment);
-NK_API int nk_button_text_styled(struct nk_context*, const struct nk_style_button*, const char *title, int len);
-NK_API int nk_button_label_styled(struct nk_context*, const struct nk_style_button*, const char *title);
-NK_API int nk_button_symbol_styled(struct nk_context*, const struct nk_style_button*, enum nk_symbol_type);
-NK_API int nk_button_image_styled(struct nk_context*, const struct nk_style_button*, struct nk_image img);
-NK_API int nk_button_symbol_text_styled(struct nk_context*,const struct nk_style_button*, enum nk_symbol_type, const char*, int, nk_flags alignment);
-NK_API int nk_button_symbol_label_styled(struct nk_context *ctx, const struct nk_style_button *style, enum nk_symbol_type symbol, const char *title, nk_flags align);
-NK_API int nk_button_image_label_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, nk_flags text_alignment);
-NK_API int nk_button_image_text_styled(struct nk_context*,const struct nk_style_button*, struct nk_image img, const char*, int, nk_flags alignment);
-NK_API void nk_button_set_behavior(struct nk_context*, enum nk_button_behavior);
-NK_API int nk_button_push_behavior(struct nk_context*, enum nk_button_behavior);
-NK_API int nk_button_pop_behavior(struct nk_context*);
-/* =============================================================================
- *
- * CHECKBOX
- *
- * ============================================================================= */
-NK_API int nk_check_label(struct nk_context*, const char*, int active);
-NK_API int nk_check_text(struct nk_context*, const char*, int,int active);
-NK_API unsigned nk_check_flags_label(struct nk_context*, const char*, unsigned int flags, unsigned int value);
-NK_API unsigned nk_check_flags_text(struct nk_context*, const char*, int, unsigned int flags, unsigned int value);
-NK_API int nk_checkbox_label(struct nk_context*, const char*, int *active);
-NK_API int nk_checkbox_text(struct nk_context*, const char*, int, int *active);
-NK_API int nk_checkbox_flags_label(struct nk_context*, const char*, unsigned int *flags, unsigned int value);
-NK_API int nk_checkbox_flags_text(struct nk_context*, const char*, int, unsigned int *flags, unsigned int value);
-/* =============================================================================
- *
- * RADIO BUTTON
- *
- * ============================================================================= */
-NK_API int nk_radio_label(struct nk_context*, const char*, int *active);
-NK_API int nk_radio_text(struct nk_context*, const char*, int, int *active);
-NK_API int nk_option_label(struct nk_context*, const char*, int active);
-NK_API int nk_option_text(struct nk_context*, const char*, int, int active);
-/* =============================================================================
- *
- * SELECTABLE
- *
- * ============================================================================= */
-NK_API int nk_selectable_label(struct nk_context*, const char*, nk_flags align, int *value);
-NK_API int nk_selectable_text(struct nk_context*, const char*, int, nk_flags align, int *value);
-NK_API int nk_selectable_image_label(struct nk_context*,struct nk_image, const char*, nk_flags align, int *value);
-NK_API int nk_selectable_image_text(struct nk_context*,struct nk_image, const char*, int, nk_flags align, int *value);
-NK_API int nk_select_label(struct nk_context*, const char*, nk_flags align, int value);
-NK_API int nk_select_text(struct nk_context*, const char*, int, nk_flags align, int value);
-NK_API int nk_select_image_label(struct nk_context*, struct nk_image,const char*, nk_flags align, int value);
-NK_API int nk_select_image_text(struct nk_context*, struct nk_image,const char*, int, nk_flags align, int value);
-/* =============================================================================
- *
- * SLIDER
- *
- * ============================================================================= */
-NK_API float nk_slide_float(struct nk_context*, float min, float val, float max, float step);
-NK_API int nk_slide_int(struct nk_context*, int min, int val, int max, int step);
-NK_API int nk_slider_float(struct nk_context*, float min, float *val, float max, float step);
-NK_API int nk_slider_int(struct nk_context*, int min, int *val, int max, int step);
-/* =============================================================================
- *
- * PROGRESSBAR
- *
- * ============================================================================= */
-NK_API int nk_progress(struct nk_context*, nk_size *cur, nk_size max, int modifyable);
-NK_API nk_size nk_prog(struct nk_context*, nk_size cur, nk_size max, int modifyable);
-
-/* =============================================================================
- *
- * COLOR PICKER
- *
- * ============================================================================= */
-NK_API struct nk_colorf nk_color_picker(struct nk_context*, struct nk_colorf, enum nk_color_format);
-NK_API int nk_color_pick(struct nk_context*, struct nk_colorf*, enum nk_color_format);
-/* =============================================================================
- *
- * PROPERTIES
- *
- * =============================================================================
-/// ### Properties
-/// Properties are the main value modification widgets in Nuklear. Changing a value
-/// can be achieved by dragging, adding/removing incremental steps on button click
-/// or by directly typing a number.
-///
-/// #### Usage
-/// Each property requires a unique name for identifaction that is also used for
-/// displaying a label. If you want to use the same name multiple times make sure
-/// add a '#' before your name. The '#' will not be shown but will generate a
-/// unique ID. Each propery also takes in a minimum and maximum value. If you want
-/// to make use of the complete number range of a type just use the provided
-/// type limits from `limits.h`. For example `INT_MIN` and `INT_MAX` for
-/// `nk_property_int` and `nk_propertyi`. In additional each property takes in
-/// a increment value that will be added or subtracted if either the increment
-/// decrement button is clicked. Finally there is a value for increment per pixel
-/// dragged that is added or subtracted from the value.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int value = 0;
-/// struct nk_context ctx;
-/// nk_init_xxx(&ctx, ...);
-/// while (1) {
-/// // Input
-/// Event evt;
-/// nk_input_begin(&ctx);
-/// while (GetEvent(&evt)) {
-/// if (evt.type == MOUSE_MOVE)
-/// nk_input_motion(&ctx, evt.motion.x, evt.motion.y);
-/// else if (evt.type == [...]) {
-/// nk_input_xxx(...);
-/// }
-/// }
-/// nk_input_end(&ctx);
-/// //
-/// // Window
-/// if (nk_begin_xxx(...) {
-/// // Property
-/// nk_layout_row_dynamic(...);
-/// nk_property_int(ctx, "ID", INT_MIN, &value, INT_MAX, 1, 1);
-/// }
-/// nk_end(ctx);
-/// //
-/// // Draw
-/// const struct nk_command *cmd = 0;
-/// nk_foreach(cmd, &ctx) {
-/// switch (cmd->type) {
-/// case NK_COMMAND_LINE:
-/// your_draw_line_function(...)
-/// break;
-/// case NK_COMMAND_RECT
-/// your_draw_rect_function(...)
-/// break;
-/// case ...:
-/// // [...]
-/// }
-// nk_clear(&ctx);
-/// }
-/// nk_free(&ctx);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// #### Reference
-/// Function | Description
-/// --------------------|-------------------------------------------
-/// nk_property_int | Integer property directly modifing a passed in value
-/// nk_property_float | Float property directly modifing a passed in value
-/// nk_property_double | Double property directly modifing a passed in value
-/// nk_propertyi | Integer property returning the modified int value
-/// nk_propertyf | Float property returning the modified float value
-/// nk_propertyd | Double property returning the modified double value
-///
-*/
-/*/// #### nk_property_int
-/// Integer property directly modifing a passed in value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_property_int(struct nk_context *ctx, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Integer pointer to be modified
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-*/
-NK_API void nk_property_int(struct nk_context*, const char *name, int min, int *val, int max, int step, float inc_per_pixel);
-/*/// #### nk_property_float
-/// Float property directly modifing a passed in value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_property_float(struct nk_context *ctx, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Float pointer to be modified
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-*/
-NK_API void nk_property_float(struct nk_context*, const char *name, float min, float *val, float max, float step, float inc_per_pixel);
-/*/// #### nk_property_double
-/// Double property directly modifing a passed in value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// void nk_property_double(struct nk_context *ctx, const char *name, double min, double *val, double max, double step, double inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Double pointer to be modified
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-*/
-NK_API void nk_property_double(struct nk_context*, const char *name, double min, double *val, double max, double step, float inc_per_pixel);
-/*/// #### nk_propertyi
-/// Integer property modifing a passed in value and returning the new value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// int nk_propertyi(struct nk_context *ctx, const char *name, int min, int val, int max, int step, float inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Current integer value to be modified and returned
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-///
-/// Returns the new modified integer value
-*/
-NK_API int nk_propertyi(struct nk_context*, const char *name, int min, int val, int max, int step, float inc_per_pixel);
-/*/// #### nk_propertyf
-/// Float property modifing a passed in value and returning the new value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// float nk_propertyf(struct nk_context *ctx, const char *name, float min, float val, float max, float step, float inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Current float value to be modified and returned
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-///
-/// Returns the new modified float value
-*/
-NK_API float nk_propertyf(struct nk_context*, const char *name, float min, float val, float max, float step, float inc_per_pixel);
-/*/// #### nk_propertyd
-/// Float property modifing a passed in value and returning the new value
-/// !!! WARNING
-/// To generate a unique property ID using the same label make sure to insert
-/// a `#` at the beginning. It will not be shown but guarantees correct behavior.
-///
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~c
-/// float nk_propertyd(struct nk_context *ctx, const char *name, double min, double val, double max, double step, double inc_per_pixel);
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// Parameter | Description
-/// --------------------|-----------------------------------------------------------
-/// __ctx__ | Must point to an previously initialized `nk_context` struct after calling a layouting function
-/// __name__ | String used both as a label as well as a unique identifier
-/// __min__ | Minimum value not allowed to be underflown
-/// __val__ | Current double value to be modified and returned
-/// __max__ | Maximum value not allowed to be overflown
-/// __step__ | Increment added and subtracted on increment and decrement button
-/// __inc_per_pixel__ | Value per pixel added or subtracted on dragging
-///
-/// Returns the new modified double value
-*/
-NK_API double nk_propertyd(struct nk_context*, const char *name, double min, double val, double max, double step, float inc_per_pixel);
-/* =============================================================================
- *
- * TEXT EDIT
- *
- * ============================================================================= */
-enum nk_edit_flags {
- NK_EDIT_DEFAULT = 0,
- NK_EDIT_READ_ONLY = NK_FLAG(0),
- NK_EDIT_AUTO_SELECT = NK_FLAG(1),
- NK_EDIT_SIG_ENTER = NK_FLAG(2),
- NK_EDIT_ALLOW_TAB = NK_FLAG(3),
- NK_EDIT_NO_CURSOR = NK_FLAG(4),
- NK_EDIT_SELECTABLE = NK_FLAG(5),
- NK_EDIT_CLIPBOARD = NK_FLAG(6),
- NK_EDIT_CTRL_ENTER_NEWLINE = NK_FLAG(7),
- NK_EDIT_NO_HORIZONTAL_SCROLL = NK_FLAG(8),
- NK_EDIT_ALWAYS_INSERT_MODE = NK_FLAG(9),
- NK_EDIT_MULTILINE = NK_FLAG(10),
- NK_EDIT_GOTO_END_ON_ACTIVATE = NK_FLAG(11)
-};
-enum nk_edit_types {
- NK_EDIT_SIMPLE = NK_EDIT_ALWAYS_INSERT_MODE,
- NK_EDIT_FIELD = NK_EDIT_SIMPLE|NK_EDIT_SELECTABLE|NK_EDIT_CLIPBOARD,
- NK_EDIT_BOX = NK_EDIT_ALWAYS_INSERT_MODE| NK_EDIT_SELECTABLE| NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB|NK_EDIT_CLIPBOARD,
- NK_EDIT_EDITOR = NK_EDIT_SELECTABLE|NK_EDIT_MULTILINE|NK_EDIT_ALLOW_TAB| NK_EDIT_CLIPBOARD
-};
-enum nk_edit_events {
- NK_EDIT_ACTIVE = NK_FLAG(0), /* edit widget is currently being modified */
- NK_EDIT_INACTIVE = NK_FLAG(1), /* edit widget is not active and is not being modified */
- NK_EDIT_ACTIVATED = NK_FLAG(2), /* edit widget went from state inactive to state active */
- NK_EDIT_DEACTIVATED = NK_FLAG(3), /* edit widget went from state active to state inactive */
- NK_EDIT_COMMITED = NK_FLAG(4) /* edit widget has received an enter and lost focus */
-};
-NK_API nk_flags nk_edit_string(struct nk_context*, nk_flags, char *buffer, int *len, int max, nk_plugin_filter);
-NK_API nk_flags nk_edit_string_zero_terminated(struct nk_context*, nk_flags, char *buffer, int max, nk_plugin_filter);
-NK_API nk_flags nk_edit_buffer(struct nk_context*, nk_flags, struct nk_text_edit*, nk_plugin_filter);
-NK_API void nk_edit_focus(struct nk_context*, nk_flags flags);
-NK_API void nk_edit_unfocus(struct nk_context*);
-/* =============================================================================
- *
- * CHART
- *
- * ============================================================================= */
-NK_API int nk_chart_begin(struct nk_context*, enum nk_chart_type, int num, float min, float max);
-NK_API int nk_chart_begin_colored(struct nk_context*, enum nk_chart_type, struct nk_color, struct nk_color active, int num, float min, float max);
-NK_API void nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type, int count, float min_value, float max_value);
-NK_API void nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type, struct nk_color, struct nk_color active, int count, float min_value, float max_value);
-NK_API nk_flags nk_chart_push(struct nk_context*, float);
-NK_API nk_flags nk_chart_push_slot(struct nk_context*, float, int);
-NK_API void nk_chart_end(struct nk_context*);
-NK_API void nk_plot(struct nk_context*, enum nk_chart_type, const float *values, int count, int offset);
-NK_API void nk_plot_function(struct nk_context*, enum nk_chart_type, void *userdata, float(*value_getter)(void* user, int index), int count, int offset);
-/* =============================================================================
- *
- * POPUP
- *
- * ============================================================================= */
-NK_API int nk_popup_begin(struct nk_context*, enum nk_popup_type, const char*, nk_flags, struct nk_rect bounds);
-NK_API void nk_popup_close(struct nk_context*);
-NK_API void nk_popup_end(struct nk_context*);
-/* =============================================================================
- *
- * COMBOBOX
- *
- * ============================================================================= */
-NK_API int nk_combo(struct nk_context*, const char **items, int count, int selected, int item_height, struct nk_vec2 size);
-NK_API int nk_combo_separator(struct nk_context*, const char *items_separated_by_separator, int separator, int selected, int count, int item_height, struct nk_vec2 size);
-NK_API int nk_combo_string(struct nk_context*, const char *items_separated_by_zeros, int selected, int count, int item_height, struct nk_vec2 size);
-NK_API int nk_combo_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void *userdata, int selected, int count, int item_height, struct nk_vec2 size);
-NK_API void nk_combobox(struct nk_context*, const char **items, int count, int *selected, int item_height, struct nk_vec2 size);
-NK_API void nk_combobox_string(struct nk_context*, const char *items_separated_by_zeros, int *selected, int count, int item_height, struct nk_vec2 size);
-NK_API void nk_combobox_separator(struct nk_context*, const char *items_separated_by_separator, int separator,int *selected, int count, int item_height, struct nk_vec2 size);
-NK_API void nk_combobox_callback(struct nk_context*, void(*item_getter)(void*, int, const char**), void*, int *selected, int count, int item_height, struct nk_vec2 size);
-/* =============================================================================
- *
- * ABSTRACT COMBOBOX
- *
- * ============================================================================= */
-NK_API int nk_combo_begin_text(struct nk_context*, const char *selected, int, struct nk_vec2 size);
-NK_API int nk_combo_begin_label(struct nk_context*, const char *selected, struct nk_vec2 size);
-NK_API int nk_combo_begin_color(struct nk_context*, struct nk_color color, struct nk_vec2 size);
-NK_API int nk_combo_begin_symbol(struct nk_context*, enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_combo_begin_symbol_label(struct nk_context*, const char *selected, enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_combo_begin_symbol_text(struct nk_context*, const char *selected, int, enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_combo_begin_image(struct nk_context*, struct nk_image img, struct nk_vec2 size);
-NK_API int nk_combo_begin_image_label(struct nk_context*, const char *selected, struct nk_image, struct nk_vec2 size);
-NK_API int nk_combo_begin_image_text(struct nk_context*, const char *selected, int, struct nk_image, struct nk_vec2 size);
-NK_API int nk_combo_item_label(struct nk_context*, const char*, nk_flags alignment);
-NK_API int nk_combo_item_text(struct nk_context*, const char*,int, nk_flags alignment);
-NK_API int nk_combo_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
-NK_API int nk_combo_item_image_text(struct nk_context*, struct nk_image, const char*, int,nk_flags alignment);
-NK_API int nk_combo_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
-NK_API int nk_combo_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
-NK_API void nk_combo_close(struct nk_context*);
-NK_API void nk_combo_end(struct nk_context*);
-/* =============================================================================
- *
- * CONTEXTUAL
- *
- * ============================================================================= */
-NK_API int nk_contextual_begin(struct nk_context*, nk_flags, struct nk_vec2, struct nk_rect trigger_bounds);
-NK_API int nk_contextual_item_text(struct nk_context*, const char*, int,nk_flags align);
-NK_API int nk_contextual_item_label(struct nk_context*, const char*, nk_flags align);
-NK_API int nk_contextual_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
-NK_API int nk_contextual_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
-NK_API int nk_contextual_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
-NK_API int nk_contextual_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
-NK_API void nk_contextual_close(struct nk_context*);
-NK_API void nk_contextual_end(struct nk_context*);
-/* =============================================================================
- *
- * TOOLTIP
- *
- * ============================================================================= */
-NK_API void nk_tooltip(struct nk_context*, const char*);
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void nk_tooltipf(struct nk_context*, const char*, ...);
-#endif
-NK_API int nk_tooltip_begin(struct nk_context*, float width);
-NK_API void nk_tooltip_end(struct nk_context*);
-/* =============================================================================
- *
- * MENU
- *
- * ============================================================================= */
-NK_API void nk_menubar_begin(struct nk_context*);
-NK_API void nk_menubar_end(struct nk_context*);
-NK_API int nk_menu_begin_text(struct nk_context*, const char* title, int title_len, nk_flags align, struct nk_vec2 size);
-NK_API int nk_menu_begin_label(struct nk_context*, const char*, nk_flags align, struct nk_vec2 size);
-NK_API int nk_menu_begin_image(struct nk_context*, const char*, struct nk_image, struct nk_vec2 size);
-NK_API int nk_menu_begin_image_text(struct nk_context*, const char*, int,nk_flags align,struct nk_image, struct nk_vec2 size);
-NK_API int nk_menu_begin_image_label(struct nk_context*, const char*, nk_flags align,struct nk_image, struct nk_vec2 size);
-NK_API int nk_menu_begin_symbol(struct nk_context*, const char*, enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_menu_begin_symbol_text(struct nk_context*, const char*, int,nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_menu_begin_symbol_label(struct nk_context*, const char*, nk_flags align,enum nk_symbol_type, struct nk_vec2 size);
-NK_API int nk_menu_item_text(struct nk_context*, const char*, int,nk_flags align);
-NK_API int nk_menu_item_label(struct nk_context*, const char*, nk_flags alignment);
-NK_API int nk_menu_item_image_label(struct nk_context*, struct nk_image, const char*, nk_flags alignment);
-NK_API int nk_menu_item_image_text(struct nk_context*, struct nk_image, const char*, int len, nk_flags alignment);
-NK_API int nk_menu_item_symbol_text(struct nk_context*, enum nk_symbol_type, const char*, int, nk_flags alignment);
-NK_API int nk_menu_item_symbol_label(struct nk_context*, enum nk_symbol_type, const char*, nk_flags alignment);
-NK_API void nk_menu_close(struct nk_context*);
-NK_API void nk_menu_end(struct nk_context*);
-/* =============================================================================
- *
- * STYLE
- *
- * ============================================================================= */
-enum nk_style_colors {
- NK_COLOR_TEXT,
- NK_COLOR_WINDOW,
- NK_COLOR_HEADER,
- NK_COLOR_BORDER,
- NK_COLOR_BUTTON,
- NK_COLOR_BUTTON_HOVER,
- NK_COLOR_BUTTON_ACTIVE,
- NK_COLOR_TOGGLE,
- NK_COLOR_TOGGLE_HOVER,
- NK_COLOR_TOGGLE_CURSOR,
- NK_COLOR_SELECT,
- NK_COLOR_SELECT_ACTIVE,
- NK_COLOR_SLIDER,
- NK_COLOR_SLIDER_CURSOR,
- NK_COLOR_SLIDER_CURSOR_HOVER,
- NK_COLOR_SLIDER_CURSOR_ACTIVE,
- NK_COLOR_PROPERTY,
- NK_COLOR_EDIT,
- NK_COLOR_EDIT_CURSOR,
- NK_COLOR_COMBO,
- NK_COLOR_CHART,
- NK_COLOR_CHART_COLOR,
- NK_COLOR_CHART_COLOR_HIGHLIGHT,
- NK_COLOR_SCROLLBAR,
- NK_COLOR_SCROLLBAR_CURSOR,
- NK_COLOR_SCROLLBAR_CURSOR_HOVER,
- NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,
- NK_COLOR_TAB_HEADER,
- NK_COLOR_COUNT
-};
-enum nk_style_cursor {
- NK_CURSOR_ARROW,
- NK_CURSOR_TEXT,
- NK_CURSOR_MOVE,
- NK_CURSOR_RESIZE_VERTICAL,
- NK_CURSOR_RESIZE_HORIZONTAL,
- NK_CURSOR_RESIZE_TOP_LEFT_DOWN_RIGHT,
- NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT,
- NK_CURSOR_COUNT
-};
-NK_API void nk_style_default(struct nk_context*);
-NK_API void nk_style_from_table(struct nk_context*, const struct nk_color*);
-NK_API void nk_style_load_cursor(struct nk_context*, enum nk_style_cursor, const struct nk_cursor*);
-NK_API void nk_style_load_all_cursors(struct nk_context*, struct nk_cursor*);
-NK_API const char* nk_style_get_color_by_name(enum nk_style_colors);
-NK_API void nk_style_set_font(struct nk_context*, const struct nk_user_font*);
-NK_API int nk_style_set_cursor(struct nk_context*, enum nk_style_cursor);
-NK_API void nk_style_show_cursor(struct nk_context*);
-NK_API void nk_style_hide_cursor(struct nk_context*);
-
-NK_API int nk_style_push_font(struct nk_context*, const struct nk_user_font*);
-NK_API int nk_style_push_float(struct nk_context*, float*, float);
-NK_API int nk_style_push_vec2(struct nk_context*, struct nk_vec2*, struct nk_vec2);
-NK_API int nk_style_push_style_item(struct nk_context*, struct nk_style_item*, struct nk_style_item);
-NK_API int nk_style_push_flags(struct nk_context*, nk_flags*, nk_flags);
-NK_API int nk_style_push_color(struct nk_context*, struct nk_color*, struct nk_color);
-
-NK_API int nk_style_pop_font(struct nk_context*);
-NK_API int nk_style_pop_float(struct nk_context*);
-NK_API int nk_style_pop_vec2(struct nk_context*);
-NK_API int nk_style_pop_style_item(struct nk_context*);
-NK_API int nk_style_pop_flags(struct nk_context*);
-NK_API int nk_style_pop_color(struct nk_context*);
-/* =============================================================================
- *
- * COLOR
- *
- * ============================================================================= */
-NK_API struct nk_color nk_rgb(int r, int g, int b);
-NK_API struct nk_color nk_rgb_iv(const int *rgb);
-NK_API struct nk_color nk_rgb_bv(const nk_byte* rgb);
-NK_API struct nk_color nk_rgb_f(float r, float g, float b);
-NK_API struct nk_color nk_rgb_fv(const float *rgb);
-NK_API struct nk_color nk_rgb_cf(struct nk_colorf c);
-NK_API struct nk_color nk_rgb_hex(const char *rgb);
-
-NK_API struct nk_color nk_rgba(int r, int g, int b, int a);
-NK_API struct nk_color nk_rgba_u32(nk_uint);
-NK_API struct nk_color nk_rgba_iv(const int *rgba);
-NK_API struct nk_color nk_rgba_bv(const nk_byte *rgba);
-NK_API struct nk_color nk_rgba_f(float r, float g, float b, float a);
-NK_API struct nk_color nk_rgba_fv(const float *rgba);
-NK_API struct nk_color nk_rgba_cf(struct nk_colorf c);
-NK_API struct nk_color nk_rgba_hex(const char *rgb);
-
-NK_API struct nk_colorf nk_hsva_colorf(float h, float s, float v, float a);
-NK_API struct nk_colorf nk_hsva_colorfv(float *c);
-NK_API void nk_colorf_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_colorf in);
-NK_API void nk_colorf_hsva_fv(float *hsva, struct nk_colorf in);
-
-NK_API struct nk_color nk_hsv(int h, int s, int v);
-NK_API struct nk_color nk_hsv_iv(const int *hsv);
-NK_API struct nk_color nk_hsv_bv(const nk_byte *hsv);
-NK_API struct nk_color nk_hsv_f(float h, float s, float v);
-NK_API struct nk_color nk_hsv_fv(const float *hsv);
-
-NK_API struct nk_color nk_hsva(int h, int s, int v, int a);
-NK_API struct nk_color nk_hsva_iv(const int *hsva);
-NK_API struct nk_color nk_hsva_bv(const nk_byte *hsva);
-NK_API struct nk_color nk_hsva_f(float h, float s, float v, float a);
-NK_API struct nk_color nk_hsva_fv(const float *hsva);
-
-/* color (conversion nuklear --> user) */
-NK_API void nk_color_f(float *r, float *g, float *b, float *a, struct nk_color);
-NK_API void nk_color_fv(float *rgba_out, struct nk_color);
-NK_API struct nk_colorf nk_color_cf(struct nk_color);
-NK_API void nk_color_d(double *r, double *g, double *b, double *a, struct nk_color);
-NK_API void nk_color_dv(double *rgba_out, struct nk_color);
-
-NK_API nk_uint nk_color_u32(struct nk_color);
-NK_API void nk_color_hex_rgba(char *output, struct nk_color);
-NK_API void nk_color_hex_rgb(char *output, struct nk_color);
-
-NK_API void nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color);
-NK_API void nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color);
-NK_API void nk_color_hsv_iv(int *hsv_out, struct nk_color);
-NK_API void nk_color_hsv_bv(nk_byte *hsv_out, struct nk_color);
-NK_API void nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color);
-NK_API void nk_color_hsv_fv(float *hsv_out, struct nk_color);
-
-NK_API void nk_color_hsva_i(int *h, int *s, int *v, int *a, struct nk_color);
-NK_API void nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color);
-NK_API void nk_color_hsva_iv(int *hsva_out, struct nk_color);
-NK_API void nk_color_hsva_bv(nk_byte *hsva_out, struct nk_color);
-NK_API void nk_color_hsva_f(float *out_h, float *out_s, float *out_v, float *out_a, struct nk_color);
-NK_API void nk_color_hsva_fv(float *hsva_out, struct nk_color);
-/* =============================================================================
- *
- * IMAGE
- *
- * ============================================================================= */
-NK_API nk_handle nk_handle_ptr(void*);
-NK_API nk_handle nk_handle_id(int);
-NK_API struct nk_image nk_image_handle(nk_handle);
-NK_API struct nk_image nk_image_ptr(void*);
-NK_API struct nk_image nk_image_id(int);
-NK_API int nk_image_is_subimage(const struct nk_image* img);
-NK_API struct nk_image nk_subimage_ptr(void*, unsigned short w, unsigned short h, struct nk_rect sub_region);
-NK_API struct nk_image nk_subimage_id(int, unsigned short w, unsigned short h, struct nk_rect sub_region);
-NK_API struct nk_image nk_subimage_handle(nk_handle, unsigned short w, unsigned short h, struct nk_rect sub_region);
-/* =============================================================================
- *
- * MATH
- *
- * ============================================================================= */
-NK_API nk_hash nk_murmur_hash(const void *key, int len, nk_hash seed);
-NK_API void nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r, float pad_x, float pad_y, enum nk_heading);
-
-NK_API struct nk_vec2 nk_vec2(float x, float y);
-NK_API struct nk_vec2 nk_vec2i(int x, int y);
-NK_API struct nk_vec2 nk_vec2v(const float *xy);
-NK_API struct nk_vec2 nk_vec2iv(const int *xy);
-
-NK_API struct nk_rect nk_get_null_rect(void);
-NK_API struct nk_rect nk_rect(float x, float y, float w, float h);
-NK_API struct nk_rect nk_recti(int x, int y, int w, int h);
-NK_API struct nk_rect nk_recta(struct nk_vec2 pos, struct nk_vec2 size);
-NK_API struct nk_rect nk_rectv(const float *xywh);
-NK_API struct nk_rect nk_rectiv(const int *xywh);
-NK_API struct nk_vec2 nk_rect_pos(struct nk_rect);
-NK_API struct nk_vec2 nk_rect_size(struct nk_rect);
-/* =============================================================================
- *
- * STRING
- *
- * ============================================================================= */
-NK_API int nk_strlen(const char *str);
-NK_API int nk_stricmp(const char *s1, const char *s2);
-NK_API int nk_stricmpn(const char *s1, const char *s2, int n);
-NK_API int nk_strtoi(const char *str, const char **endptr);
-NK_API float nk_strtof(const char *str, const char **endptr);
-NK_API double nk_strtod(const char *str, const char **endptr);
-NK_API int nk_strfilter(const char *text, const char *regexp);
-NK_API int nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score);
-NK_API int nk_strmatch_fuzzy_text(const char *txt, int txt_len, const char *pattern, int *out_score);
-/* =============================================================================
- *
- * UTF-8
- *
- * ============================================================================= */
-NK_API int nk_utf_decode(const char*, nk_rune*, int);
-NK_API int nk_utf_encode(nk_rune, char*, int);
-NK_API int nk_utf_len(const char*, int byte_len);
-NK_API const char* nk_utf_at(const char *buffer, int length, int index, nk_rune *unicode, int *len);
-/* ===============================================================
- *
- * FONT
- *
- * ===============================================================*/
-/* Font handling in this library was designed to be quite customizable and lets
- you decide what you want to use and what you want to provide. There are three
- different ways to use the font atlas. The first two will use your font
- handling scheme and only requires essential data to run nuklear. The next
- slightly more advanced features is font handling with vertex buffer output.
- Finally the most complex API wise is using nuklear's font baking API.
-
- 1.) Using your own implementation without vertex buffer output
- --------------------------------------------------------------
- So first up the easiest way to do font handling is by just providing a
- `nk_user_font` struct which only requires the height in pixel of the used
- font and a callback to calculate the width of a string. This way of handling
- fonts is best fitted for using the normal draw shape command API where you
- do all the text drawing yourself and the library does not require any kind
- of deeper knowledge about which font handling mechanism you use.
- IMPORTANT: the `nk_user_font` pointer provided to nuklear has to persist
- over the complete life time! I know this sucks but it is currently the only
- way to switch between fonts.
-
- float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
- {
- your_font_type *type = handle.ptr;
- float text_width = ...;
- return text_width;
- }
-
- struct nk_user_font font;
- font.userdata.ptr = &your_font_class_or_struct;
- font.height = your_font_height;
- font.width = your_text_width_calculation;
-
- struct nk_context ctx;
- nk_init_default(&ctx, &font);
-
- 2.) Using your own implementation with vertex buffer output
- --------------------------------------------------------------
- While the first approach works fine if you don't want to use the optional
- vertex buffer output it is not enough if you do. To get font handling working
- for these cases you have to provide two additional parameters inside the
- `nk_user_font`. First a texture atlas handle used to draw text as subimages
- of a bigger font atlas texture and a callback to query a character's glyph
- information (offset, size, ...). So it is still possible to provide your own
- font and use the vertex buffer output.
-
- float your_text_width_calculation(nk_handle handle, float height, const char *text, int len)
- {
- your_font_type *type = handle.ptr;
- float text_width = ...;
- return text_width;
- }
- void query_your_font_glyph(nk_handle handle, float font_height, struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
- {
- your_font_type *type = handle.ptr;
- glyph.width = ...;
- glyph.height = ...;
- glyph.xadvance = ...;
- glyph.uv[0].x = ...;
- glyph.uv[0].y = ...;
- glyph.uv[1].x = ...;
- glyph.uv[1].y = ...;
- glyph.offset.x = ...;
- glyph.offset.y = ...;
- }
-
- struct nk_user_font font;
- font.userdata.ptr = &your_font_class_or_struct;
- font.height = your_font_height;
- font.width = your_text_width_calculation;
- font.query = query_your_font_glyph;
- font.texture.id = your_font_texture;
-
- struct nk_context ctx;
- nk_init_default(&ctx, &font);
-
- 3.) Nuklear font baker
- ------------------------------------
- The final approach if you do not have a font handling functionality or don't
- want to use it in this library is by using the optional font baker.
- The font baker APIs can be used to create a font plus font atlas texture
- and can be used with or without the vertex buffer output.
-
- It still uses the `nk_user_font` struct and the two different approaches
- previously stated still work. The font baker is not located inside
- `nk_context` like all other systems since it can be understood as more of
- an extension to nuklear and does not really depend on any `nk_context` state.
-
- Font baker need to be initialized first by one of the nk_font_atlas_init_xxx
- functions. If you don't care about memory just call the default version
- `nk_font_atlas_init_default` which will allocate all memory from the standard library.
- If you want to control memory allocation but you don't care if the allocated
- memory is temporary and therefore can be freed directly after the baking process
- is over or permanent you can call `nk_font_atlas_init`.
-
- After successfully initializing the font baker you can add Truetype(.ttf) fonts from
- different sources like memory or from file by calling one of the `nk_font_atlas_add_xxx`.
- functions. Adding font will permanently store each font, font config and ttf memory block(!)
- inside the font atlas and allows to reuse the font atlas. If you don't want to reuse
- the font baker by for example adding additional fonts you can call
- `nk_font_atlas_cleanup` after the baking process is over (after calling nk_font_atlas_end).
-
- As soon as you added all fonts you wanted you can now start the baking process
- for every selected glyph to image by calling `nk_font_atlas_bake`.
- The baking process returns image memory, width and height which can be used to
- either create your own image object or upload it to any graphics library.
- No matter which case you finally have to call `nk_font_atlas_end` which
- will free all temporary memory including the font atlas image so make sure
- you created our texture beforehand. `nk_font_atlas_end` requires a handle
- to your font texture or object and optionally fills a `struct nk_draw_null_texture`
- which can be used for the optional vertex output. If you don't want it just
- set the argument to `NULL`.
-
- At this point you are done and if you don't want to reuse the font atlas you
- can call `nk_font_atlas_cleanup` to free all truetype blobs and configuration
- memory. Finally if you don't use the font atlas and any of it's fonts anymore
- you need to call `nk_font_atlas_clear` to free all memory still being used.
-
- struct nk_font_atlas atlas;
- nk_font_atlas_init_default(&atlas);
- nk_font_atlas_begin(&atlas);
- nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, 0);
- nk_font *font2 = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font2.ttf", 16, 0);
- const void* img = nk_font_atlas_bake(&atlas, &img_width, &img_height, NK_FONT_ATLAS_RGBA32);
- nk_font_atlas_end(&atlas, nk_handle_id(texture), 0);
-
- struct nk_context ctx;
- nk_init_default(&ctx, &font->handle);
- while (1) {
-
- }
- nk_font_atlas_clear(&atlas);
-
- The font baker API is probably the most complex API inside this library and
- I would suggest reading some of my examples `example/` to get a grip on how
- to use the font atlas. There are a number of details I left out. For example
- how to merge fonts, configure a font with `nk_font_config` to use other languages,
- use another texture coordinate format and a lot more:
-
- struct nk_font_config cfg = nk_font_config(font_pixel_height);
- cfg.merge_mode = nk_false or nk_true;
- cfg.range = nk_font_korean_glyph_ranges();
- cfg.coord_type = NK_COORD_PIXEL;
- nk_font *font = nk_font_atlas_add_from_file(&atlas, "Path/To/Your/TTF_Font.ttf", 13, &cfg);
-
-*/
-struct nk_user_font_glyph;
-typedef float(*nk_text_width_f)(nk_handle, float h, const char*, int len);
-typedef void(*nk_query_font_glyph_f)(nk_handle handle, float font_height,
- struct nk_user_font_glyph *glyph,
- nk_rune codepoint, nk_rune next_codepoint);
-
-#if defined(NK_INCLUDE_VERTEX_BUFFER_OUTPUT) || defined(NK_INCLUDE_SOFTWARE_FONT)
-struct nk_user_font_glyph {
- struct nk_vec2 uv[2];
- /* texture coordinates */
- struct nk_vec2 offset;
- /* offset between top left and glyph */
- float width, height;
- /* size of the glyph */
- float xadvance;
- /* offset to the next glyph */
-};
-#endif
-
-struct nk_user_font {
- nk_handle userdata;
- /* user provided font handle */
- float height;
- /* max height of the font */
- nk_text_width_f width;
- /* font string width in pixel callback */
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- nk_query_font_glyph_f query;
- /* font glyph callback to query drawing info */
- nk_handle texture;
- /* texture handle to the used font atlas or texture */
-#endif
-};
-
-#ifdef NK_INCLUDE_FONT_BAKING
-enum nk_font_coord_type {
- NK_COORD_UV, /* texture coordinates inside font glyphs are clamped between 0-1 */
- NK_COORD_PIXEL /* texture coordinates inside font glyphs are in absolute pixel */
-};
-
-struct nk_font;
-struct nk_baked_font {
- float height;
- /* height of the font */
- float ascent, descent;
- /* font glyphs ascent and descent */
- nk_rune glyph_offset;
- /* glyph array offset inside the font glyph baking output array */
- nk_rune glyph_count;
- /* number of glyphs of this font inside the glyph baking array output */
- const nk_rune *ranges;
- /* font codepoint ranges as pairs of (from/to) and 0 as last element */
-};
-
-struct nk_font_config {
- struct nk_font_config *next;
- /* NOTE: only used internally */
- void *ttf_blob;
- /* pointer to loaded TTF file memory block.
- * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */
- nk_size ttf_size;
- /* size of the loaded TTF file memory block
- * NOTE: not needed for nk_font_atlas_add_from_memory and nk_font_atlas_add_from_file. */
-
- unsigned char ttf_data_owned_by_atlas;
- /* used inside font atlas: default to: 0*/
- unsigned char merge_mode;
- /* merges this font into the last font */
- unsigned char pixel_snap;
- /* align every character to pixel boundary (if true set oversample (1,1)) */
- unsigned char oversample_v, oversample_h;
- /* rasterize at hight quality for sub-pixel position */
- unsigned char padding[3];
-
- float size;
- /* baked pixel height of the font */
- enum nk_font_coord_type coord_type;
- /* texture coordinate format with either pixel or UV coordinates */
- struct nk_vec2 spacing;
- /* extra pixel spacing between glyphs */
- const nk_rune *range;
- /* list of unicode ranges (2 values per range, zero terminated) */
- struct nk_baked_font *font;
- /* font to setup in the baking process: NOTE: not needed for font atlas */
- nk_rune fallback_glyph;
- /* fallback glyph to use if a given rune is not found */
- struct nk_font_config *n;
- struct nk_font_config *p;
-};
-
-struct nk_font_glyph {
- nk_rune codepoint;
- float xadvance;
- float x0, y0, x1, y1, w, h;
- float u0, v0, u1, v1;
-};
-
-struct nk_font {
- struct nk_font *next;
- struct nk_user_font handle;
- struct nk_baked_font info;
- float scale;
- struct nk_font_glyph *glyphs;
- const struct nk_font_glyph *fallback;
- nk_rune fallback_codepoint;
- nk_handle texture;
- struct nk_font_config *config;
-};
-
-enum nk_font_atlas_format {
- NK_FONT_ATLAS_ALPHA8,
- NK_FONT_ATLAS_RGBA32
-};
-
-struct nk_font_atlas {
- void *pixel;
- int tex_width;
- int tex_height;
-
- struct nk_allocator permanent;
- struct nk_allocator temporary;
-
- struct nk_recti custom;
- struct nk_cursor cursors[NK_CURSOR_COUNT];
-
- int glyph_count;
- struct nk_font_glyph *glyphs;
- struct nk_font *default_font;
- struct nk_font *fonts;
- struct nk_font_config *config;
- int font_num;
-};
-
-/* some language glyph codepoint ranges */
-NK_API const nk_rune *nk_font_default_glyph_ranges(void);
-NK_API const nk_rune *nk_font_chinese_glyph_ranges(void);
-NK_API const nk_rune *nk_font_cyrillic_glyph_ranges(void);
-NK_API const nk_rune *nk_font_korean_glyph_ranges(void);
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void nk_font_atlas_init_default(struct nk_font_atlas*);
-#endif
-NK_API void nk_font_atlas_init(struct nk_font_atlas*, struct nk_allocator*);
-NK_API void nk_font_atlas_init_custom(struct nk_font_atlas*, struct nk_allocator *persistent, struct nk_allocator *transient);
-NK_API void nk_font_atlas_begin(struct nk_font_atlas*);
-NK_API struct nk_font_config nk_font_config(float pixel_height);
-NK_API struct nk_font *nk_font_atlas_add(struct nk_font_atlas*, const struct nk_font_config*);
-#ifdef NK_INCLUDE_DEFAULT_FONT
-NK_API struct nk_font* nk_font_atlas_add_default(struct nk_font_atlas*, float height, const struct nk_font_config*);
-#endif
-NK_API struct nk_font* nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory, nk_size size, float height, const struct nk_font_config *config);
-#ifdef NK_INCLUDE_STANDARD_IO
-NK_API struct nk_font* nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path, float height, const struct nk_font_config*);
-#endif
-NK_API struct nk_font *nk_font_atlas_add_compressed(struct nk_font_atlas*, void *memory, nk_size size, float height, const struct nk_font_config*);
-NK_API struct nk_font* nk_font_atlas_add_compressed_base85(struct nk_font_atlas*, const char *data, float height, const struct nk_font_config *config);
-NK_API const void* nk_font_atlas_bake(struct nk_font_atlas*, int *width, int *height, enum nk_font_atlas_format);
-NK_API void nk_font_atlas_end(struct nk_font_atlas*, nk_handle tex, struct nk_draw_null_texture*);
-NK_API const struct nk_font_glyph* nk_font_find_glyph(struct nk_font*, nk_rune unicode);
-NK_API void nk_font_atlas_cleanup(struct nk_font_atlas *atlas);
-NK_API void nk_font_atlas_clear(struct nk_font_atlas*);
-
-#endif
-
-/* ==============================================================
- *
- * MEMORY BUFFER
- *
- * ===============================================================*/
-/* A basic (double)-buffer with linear allocation and resetting as only
- freeing policy. The buffer's main purpose is to control all memory management
- inside the GUI toolkit and still leave memory control as much as possible in
- the hand of the user while also making sure the library is easy to use if
- not as much control is needed.
- In general all memory inside this library can be provided from the user in
- three different ways.
-
- The first way and the one providing most control is by just passing a fixed
- size memory block. In this case all control lies in the hand of the user
- since he can exactly control where the memory comes from and how much memory
- the library should consume. Of course using the fixed size API removes the
- ability to automatically resize a buffer if not enough memory is provided so
- you have to take over the resizing. While being a fixed sized buffer sounds
- quite limiting, it is very effective in this library since the actual memory
- consumption is quite stable and has a fixed upper bound for a lot of cases.
-
- If you don't want to think about how much memory the library should allocate
- at all time or have a very dynamic UI with unpredictable memory consumption
- habits but still want control over memory allocation you can use the dynamic
- allocator based API. The allocator consists of two callbacks for allocating
- and freeing memory and optional userdata so you can plugin your own allocator.
-
- The final and easiest way can be used by defining
- NK_INCLUDE_DEFAULT_ALLOCATOR which uses the standard library memory
- allocation functions malloc and free and takes over complete control over
- memory in this library.
-*/
-struct nk_memory_status {
- void *memory;
- unsigned int type;
- nk_size size;
- nk_size allocated;
- nk_size needed;
- nk_size calls;
-};
-
-enum nk_allocation_type {
- NK_BUFFER_FIXED,
- NK_BUFFER_DYNAMIC
-};
-
-enum nk_buffer_allocation_type {
- NK_BUFFER_FRONT,
- NK_BUFFER_BACK,
- NK_BUFFER_MAX
-};
-
-struct nk_buffer_marker {
- int active;
- nk_size offset;
-};
-
-struct nk_memory {void *ptr;nk_size size;};
-struct nk_buffer {
- struct nk_buffer_marker marker[NK_BUFFER_MAX];
- /* buffer marker to free a buffer to a certain offset */
- struct nk_allocator pool;
- /* allocator callback for dynamic buffers */
- enum nk_allocation_type type;
- /* memory management type */
- struct nk_memory memory;
- /* memory and size of the current memory block */
- float grow_factor;
- /* growing factor for dynamic memory management */
- nk_size allocated;
- /* total amount of memory allocated */
- nk_size needed;
- /* totally consumed memory given that enough memory is present */
- nk_size calls;
- /* number of allocation calls */
- nk_size size;
- /* current size of the buffer */
-};
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void nk_buffer_init_default(struct nk_buffer*);
-#endif
-NK_API void nk_buffer_init(struct nk_buffer*, const struct nk_allocator*, nk_size size);
-NK_API void nk_buffer_init_fixed(struct nk_buffer*, void *memory, nk_size size);
-NK_API void nk_buffer_info(struct nk_memory_status*, struct nk_buffer*);
-NK_API void nk_buffer_push(struct nk_buffer*, enum nk_buffer_allocation_type type, const void *memory, nk_size size, nk_size align);
-NK_API void nk_buffer_mark(struct nk_buffer*, enum nk_buffer_allocation_type type);
-NK_API void nk_buffer_reset(struct nk_buffer*, enum nk_buffer_allocation_type type);
-NK_API void nk_buffer_clear(struct nk_buffer*);
-NK_API void nk_buffer_free(struct nk_buffer*);
-NK_API void *nk_buffer_memory(struct nk_buffer*);
-NK_API const void *nk_buffer_memory_const(const struct nk_buffer*);
-NK_API nk_size nk_buffer_total(struct nk_buffer*);
-
-/* ==============================================================
- *
- * STRING
- *
- * ===============================================================*/
-/* Basic string buffer which is only used in context with the text editor
- * to manage and manipulate dynamic or fixed size string content. This is _NOT_
- * the default string handling method. The only instance you should have any contact
- * with this API is if you interact with an `nk_text_edit` object inside one of the
- * copy and paste functions and even there only for more advanced cases. */
-struct nk_str {
- struct nk_buffer buffer;
- int len; /* in codepoints/runes/glyphs */
-};
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void nk_str_init_default(struct nk_str*);
-#endif
-NK_API void nk_str_init(struct nk_str*, const struct nk_allocator*, nk_size size);
-NK_API void nk_str_init_fixed(struct nk_str*, void *memory, nk_size size);
-NK_API void nk_str_clear(struct nk_str*);
-NK_API void nk_str_free(struct nk_str*);
-
-NK_API int nk_str_append_text_char(struct nk_str*, const char*, int);
-NK_API int nk_str_append_str_char(struct nk_str*, const char*);
-NK_API int nk_str_append_text_utf8(struct nk_str*, const char*, int);
-NK_API int nk_str_append_str_utf8(struct nk_str*, const char*);
-NK_API int nk_str_append_text_runes(struct nk_str*, const nk_rune*, int);
-NK_API int nk_str_append_str_runes(struct nk_str*, const nk_rune*);
-
-NK_API int nk_str_insert_at_char(struct nk_str*, int pos, const char*, int);
-NK_API int nk_str_insert_at_rune(struct nk_str*, int pos, const char*, int);
-
-NK_API int nk_str_insert_text_char(struct nk_str*, int pos, const char*, int);
-NK_API int nk_str_insert_str_char(struct nk_str*, int pos, const char*);
-NK_API int nk_str_insert_text_utf8(struct nk_str*, int pos, const char*, int);
-NK_API int nk_str_insert_str_utf8(struct nk_str*, int pos, const char*);
-NK_API int nk_str_insert_text_runes(struct nk_str*, int pos, const nk_rune*, int);
-NK_API int nk_str_insert_str_runes(struct nk_str*, int pos, const nk_rune*);
-
-NK_API void nk_str_remove_chars(struct nk_str*, int len);
-NK_API void nk_str_remove_runes(struct nk_str *str, int len);
-NK_API void nk_str_delete_chars(struct nk_str*, int pos, int len);
-NK_API void nk_str_delete_runes(struct nk_str*, int pos, int len);
-
-NK_API char *nk_str_at_char(struct nk_str*, int pos);
-NK_API char *nk_str_at_rune(struct nk_str*, int pos, nk_rune *unicode, int *len);
-NK_API nk_rune nk_str_rune_at(const struct nk_str*, int pos);
-NK_API const char *nk_str_at_char_const(const struct nk_str*, int pos);
-NK_API const char *nk_str_at_const(const struct nk_str*, int pos, nk_rune *unicode, int *len);
-
-NK_API char *nk_str_get(struct nk_str*);
-NK_API const char *nk_str_get_const(const struct nk_str*);
-NK_API int nk_str_len(struct nk_str*);
-NK_API int nk_str_len_char(struct nk_str*);
-
-/*===============================================================
- *
- * TEXT EDITOR
- *
- * ===============================================================*/
-/* Editing text in this library is handled by either `nk_edit_string` or
- * `nk_edit_buffer`. But like almost everything in this library there are multiple
- * ways of doing it and a balance between control and ease of use with memory
- * as well as functionality controlled by flags.
- *
- * This library generally allows three different levels of memory control:
- * First of is the most basic way of just providing a simple char array with
- * string length. This method is probably the easiest way of handling simple
- * user text input. Main upside is complete control over memory while the biggest
- * downside in comparison with the other two approaches is missing undo/redo.
- *
- * For UIs that require undo/redo the second way was created. It is based on
- * a fixed size nk_text_edit struct, which has an internal undo/redo stack.
- * This is mainly useful if you want something more like a text editor but don't want
- * to have a dynamically growing buffer.
- *
- * The final way is using a dynamically growing nk_text_edit struct, which
- * has both a default version if you don't care where memory comes from and an
- * allocator version if you do. While the text editor is quite powerful for its
- * complexity I would not recommend editing gigabytes of data with it.
- * It is rather designed for uses cases which make sense for a GUI library not for
- * an full blown text editor.
- */
-#ifndef NK_TEXTEDIT_UNDOSTATECOUNT
-#define NK_TEXTEDIT_UNDOSTATECOUNT 99
-#endif
-
-#ifndef NK_TEXTEDIT_UNDOCHARCOUNT
-#define NK_TEXTEDIT_UNDOCHARCOUNT 999
-#endif
-
-struct nk_text_edit;
-struct nk_clipboard {
- nk_handle userdata;
- nk_plugin_paste paste;
- nk_plugin_copy copy;
-};
-
-struct nk_text_undo_record {
- int where;
- short insert_length;
- short delete_length;
- short char_storage;
-};
-
-struct nk_text_undo_state {
- struct nk_text_undo_record undo_rec[NK_TEXTEDIT_UNDOSTATECOUNT];
- nk_rune undo_char[NK_TEXTEDIT_UNDOCHARCOUNT];
- short undo_point;
- short redo_point;
- short undo_char_point;
- short redo_char_point;
-};
-
-enum nk_text_edit_type {
- NK_TEXT_EDIT_SINGLE_LINE,
- NK_TEXT_EDIT_MULTI_LINE
-};
-
-enum nk_text_edit_mode {
- NK_TEXT_EDIT_MODE_VIEW,
- NK_TEXT_EDIT_MODE_INSERT,
- NK_TEXT_EDIT_MODE_REPLACE
-};
-
-struct nk_text_edit {
- struct nk_clipboard clip;
- struct nk_str string;
- nk_plugin_filter filter;
- struct nk_vec2 scrollbar;
-
- int cursor;
- int select_start;
- int select_end;
- unsigned char mode;
- unsigned char cursor_at_end_of_line;
- unsigned char initialized;
- unsigned char has_preferred_x;
- unsigned char single_line;
- unsigned char active;
- unsigned char padding1;
- float preferred_x;
- struct nk_text_undo_state undo;
-};
-
-/* filter function */
-NK_API int nk_filter_default(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_ascii(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_float(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_decimal(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_hex(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_oct(const struct nk_text_edit*, nk_rune unicode);
-NK_API int nk_filter_binary(const struct nk_text_edit*, nk_rune unicode);
-
-/* text editor */
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void nk_textedit_init_default(struct nk_text_edit*);
-#endif
-NK_API void nk_textedit_init(struct nk_text_edit*, struct nk_allocator*, nk_size size);
-NK_API void nk_textedit_init_fixed(struct nk_text_edit*, void *memory, nk_size size);
-NK_API void nk_textedit_free(struct nk_text_edit*);
-NK_API void nk_textedit_text(struct nk_text_edit*, const char*, int total_len);
-NK_API void nk_textedit_delete(struct nk_text_edit*, int where, int len);
-NK_API void nk_textedit_delete_selection(struct nk_text_edit*);
-NK_API void nk_textedit_select_all(struct nk_text_edit*);
-NK_API int nk_textedit_cut(struct nk_text_edit*);
-NK_API int nk_textedit_paste(struct nk_text_edit*, char const*, int len);
-NK_API void nk_textedit_undo(struct nk_text_edit*);
-NK_API void nk_textedit_redo(struct nk_text_edit*);
-
-/* ===============================================================
- *
- * DRAWING
- *
- * ===============================================================*/
-/* This library was designed to be render backend agnostic so it does
- not draw anything to screen. Instead all drawn shapes, widgets
- are made of, are buffered into memory and make up a command queue.
- Each frame therefore fills the command buffer with draw commands
- that then need to be executed by the user and his own render backend.
- After that the command buffer needs to be cleared and a new frame can be
- started. It is probably important to note that the command buffer is the main
- drawing API and the optional vertex buffer API only takes this format and
- converts it into a hardware accessible format.
-
- To use the command queue to draw your own widgets you can access the
- command buffer of each window by calling `nk_window_get_canvas` after
- previously having called `nk_begin`:
-
- void draw_red_rectangle_widget(struct nk_context *ctx)
- {
- struct nk_command_buffer *canvas;
- struct nk_input *input = &ctx->input;
- canvas = nk_window_get_canvas(ctx);
-
- struct nk_rect space;
- enum nk_widget_layout_states state;
- state = nk_widget(&space, ctx);
- if (!state) return;
-
- if (state != NK_WIDGET_ROM)
- update_your_widget_by_user_input(...);
- nk_fill_rect(canvas, space, 0, nk_rgb(255,0,0));
- }
-
- if (nk_begin(...)) {
- nk_layout_row_dynamic(ctx, 25, 1);
- draw_red_rectangle_widget(ctx);
- }
- nk_end(..)
-
- Important to know if you want to create your own widgets is the `nk_widget`
- call. It allocates space on the panel reserved for this widget to be used,
- but also returns the state of the widget space. If your widget is not seen and does
- not have to be updated it is '0' and you can just return. If it only has
- to be drawn the state will be `NK_WIDGET_ROM` otherwise you can do both
- update and draw your widget. The reason for separating is to only draw and
- update what is actually necessary which is crucial for performance.
-*/
-enum nk_command_type {
- NK_COMMAND_NOP,
- NK_COMMAND_SCISSOR,
- NK_COMMAND_LINE,
- NK_COMMAND_CURVE,
- NK_COMMAND_RECT,
- NK_COMMAND_RECT_FILLED,
- NK_COMMAND_RECT_MULTI_COLOR,
- NK_COMMAND_CIRCLE,
- NK_COMMAND_CIRCLE_FILLED,
- NK_COMMAND_ARC,
- NK_COMMAND_ARC_FILLED,
- NK_COMMAND_TRIANGLE,
- NK_COMMAND_TRIANGLE_FILLED,
- NK_COMMAND_POLYGON,
- NK_COMMAND_POLYGON_FILLED,
- NK_COMMAND_POLYLINE,
- NK_COMMAND_TEXT,
- NK_COMMAND_IMAGE,
- NK_COMMAND_CUSTOM
-};
-
-/* command base and header of every command inside the buffer */
-struct nk_command {
- enum nk_command_type type;
- nk_size next;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_handle userdata;
-#endif
-};
-
-struct nk_command_scissor {
- struct nk_command header;
- short x, y;
- unsigned short w, h;
-};
-
-struct nk_command_line {
- struct nk_command header;
- unsigned short line_thickness;
- struct nk_vec2i begin;
- struct nk_vec2i end;
- struct nk_color color;
-};
-
-struct nk_command_curve {
- struct nk_command header;
- unsigned short line_thickness;
- struct nk_vec2i begin;
- struct nk_vec2i end;
- struct nk_vec2i ctrl[2];
- struct nk_color color;
-};
-
-struct nk_command_rect {
- struct nk_command header;
- unsigned short rounding;
- unsigned short line_thickness;
- short x, y;
- unsigned short w, h;
- struct nk_color color;
-};
-
-struct nk_command_rect_filled {
- struct nk_command header;
- unsigned short rounding;
- short x, y;
- unsigned short w, h;
- struct nk_color color;
-};
-
-struct nk_command_rect_multi_color {
- struct nk_command header;
- short x, y;
- unsigned short w, h;
- struct nk_color left;
- struct nk_color top;
- struct nk_color bottom;
- struct nk_color right;
-};
-
-struct nk_command_triangle {
- struct nk_command header;
- unsigned short line_thickness;
- struct nk_vec2i a;
- struct nk_vec2i b;
- struct nk_vec2i c;
- struct nk_color color;
-};
-
-struct nk_command_triangle_filled {
- struct nk_command header;
- struct nk_vec2i a;
- struct nk_vec2i b;
- struct nk_vec2i c;
- struct nk_color color;
-};
-
-struct nk_command_circle {
- struct nk_command header;
- short x, y;
- unsigned short line_thickness;
- unsigned short w, h;
- struct nk_color color;
-};
-
-struct nk_command_circle_filled {
- struct nk_command header;
- short x, y;
- unsigned short w, h;
- struct nk_color color;
-};
-
-struct nk_command_arc {
- struct nk_command header;
- short cx, cy;
- unsigned short r;
- unsigned short line_thickness;
- float a[2];
- struct nk_color color;
-};
-
-struct nk_command_arc_filled {
- struct nk_command header;
- short cx, cy;
- unsigned short r;
- float a[2];
- struct nk_color color;
-};
-
-struct nk_command_polygon {
- struct nk_command header;
- struct nk_color color;
- unsigned short line_thickness;
- unsigned short point_count;
- struct nk_vec2i points[1];
-};
-
-struct nk_command_polygon_filled {
- struct nk_command header;
- struct nk_color color;
- unsigned short point_count;
- struct nk_vec2i points[1];
-};
-
-struct nk_command_polyline {
- struct nk_command header;
- struct nk_color color;
- unsigned short line_thickness;
- unsigned short point_count;
- struct nk_vec2i points[1];
-};
-
-struct nk_command_image {
- struct nk_command header;
- short x, y;
- unsigned short w, h;
- struct nk_image img;
- struct nk_color col;
-};
-
-typedef void (*nk_command_custom_callback)(void *canvas, short x,short y,
- unsigned short w, unsigned short h, nk_handle callback_data);
-struct nk_command_custom {
- struct nk_command header;
- short x, y;
- unsigned short w, h;
- nk_handle callback_data;
- nk_command_custom_callback callback;
-};
-
-struct nk_command_text {
- struct nk_command header;
- const struct nk_user_font *font;
- struct nk_color background;
- struct nk_color foreground;
- short x, y;
- unsigned short w, h;
- float height;
- int length;
- char string[1];
-};
-
-enum nk_command_clipping {
- NK_CLIPPING_OFF = nk_false,
- NK_CLIPPING_ON = nk_true
-};
-
-struct nk_command_buffer {
- struct nk_buffer *base;
- struct nk_rect clip;
- int use_clipping;
- nk_handle userdata;
- nk_size begin, end, last;
-};
-
-/* shape outlines */
-NK_API void nk_stroke_line(struct nk_command_buffer *b, float x0, float y0, float x1, float y1, float line_thickness, struct nk_color);
-NK_API void nk_stroke_curve(struct nk_command_buffer*, float, float, float, float, float, float, float, float, float line_thickness, struct nk_color);
-NK_API void nk_stroke_rect(struct nk_command_buffer*, struct nk_rect, float rounding, float line_thickness, struct nk_color);
-NK_API void nk_stroke_circle(struct nk_command_buffer*, struct nk_rect, float line_thickness, struct nk_color);
-NK_API void nk_stroke_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, float line_thickness, struct nk_color);
-NK_API void nk_stroke_triangle(struct nk_command_buffer*, float, float, float, float, float, float, float line_thichness, struct nk_color);
-NK_API void nk_stroke_polyline(struct nk_command_buffer*, float *points, int point_count, float line_thickness, struct nk_color col);
-NK_API void nk_stroke_polygon(struct nk_command_buffer*, float*, int point_count, float line_thickness, struct nk_color);
-
-/* filled shades */
-NK_API void nk_fill_rect(struct nk_command_buffer*, struct nk_rect, float rounding, struct nk_color);
-NK_API void nk_fill_rect_multi_color(struct nk_command_buffer*, struct nk_rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
-NK_API void nk_fill_circle(struct nk_command_buffer*, struct nk_rect, struct nk_color);
-NK_API void nk_fill_arc(struct nk_command_buffer*, float cx, float cy, float radius, float a_min, float a_max, struct nk_color);
-NK_API void nk_fill_triangle(struct nk_command_buffer*, float x0, float y0, float x1, float y1, float x2, float y2, struct nk_color);
-NK_API void nk_fill_polygon(struct nk_command_buffer*, float*, int point_count, struct nk_color);
-
-/* misc */
-NK_API void nk_draw_image(struct nk_command_buffer*, struct nk_rect, const struct nk_image*, struct nk_color);
-NK_API void nk_draw_text(struct nk_command_buffer*, struct nk_rect, const char *text, int len, const struct nk_user_font*, struct nk_color, struct nk_color);
-NK_API void nk_push_scissor(struct nk_command_buffer*, struct nk_rect);
-NK_API void nk_push_custom(struct nk_command_buffer*, struct nk_rect, nk_command_custom_callback, nk_handle usr);
-
-/* ===============================================================
- *
- * INPUT
- *
- * ===============================================================*/
-struct nk_mouse_button {
- int down;
- unsigned int clicked;
- struct nk_vec2 clicked_pos;
-};
-struct nk_mouse {
- struct nk_mouse_button buttons[NK_BUTTON_MAX];
- struct nk_vec2 pos;
- struct nk_vec2 prev;
- struct nk_vec2 delta;
- struct nk_vec2 scroll_delta;
- unsigned char grab;
- unsigned char grabbed;
- unsigned char ungrab;
-};
-
-struct nk_key {
- int down;
- unsigned int clicked;
-};
-struct nk_keyboard {
- struct nk_key keys[NK_KEY_MAX];
- char text[NK_INPUT_MAX];
- int text_len;
-};
-
-struct nk_input {
- struct nk_keyboard keyboard;
- struct nk_mouse mouse;
-};
-
-NK_API int nk_input_has_mouse_click(const struct nk_input*, enum nk_buttons);
-NK_API int nk_input_has_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
-NK_API int nk_input_has_mouse_click_down_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect, int down);
-NK_API int nk_input_is_mouse_click_in_rect(const struct nk_input*, enum nk_buttons, struct nk_rect);
-NK_API int nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id, struct nk_rect b, int down);
-NK_API int nk_input_any_mouse_click_in_rect(const struct nk_input*, struct nk_rect);
-NK_API int nk_input_is_mouse_prev_hovering_rect(const struct nk_input*, struct nk_rect);
-NK_API int nk_input_is_mouse_hovering_rect(const struct nk_input*, struct nk_rect);
-NK_API int nk_input_mouse_clicked(const struct nk_input*, enum nk_buttons, struct nk_rect);
-NK_API int nk_input_is_mouse_down(const struct nk_input*, enum nk_buttons);
-NK_API int nk_input_is_mouse_pressed(const struct nk_input*, enum nk_buttons);
-NK_API int nk_input_is_mouse_released(const struct nk_input*, enum nk_buttons);
-NK_API int nk_input_is_key_pressed(const struct nk_input*, enum nk_keys);
-NK_API int nk_input_is_key_released(const struct nk_input*, enum nk_keys);
-NK_API int nk_input_is_key_down(const struct nk_input*, enum nk_keys);
-
-/* ===============================================================
- *
- * DRAW LIST
- *
- * ===============================================================*/
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-/* The optional vertex buffer draw list provides a 2D drawing context
- with antialiasing functionality which takes basic filled or outlined shapes
- or a path and outputs vertexes, elements and draw commands.
- The actual draw list API is not required to be used directly while using this
- library since converting the default library draw command output is done by
- just calling `nk_convert` but I decided to still make this library accessible
- since it can be useful.
-
- The draw list is based on a path buffering and polygon and polyline
- rendering API which allows a lot of ways to draw 2D content to screen.
- In fact it is probably more powerful than needed but allows even more crazy
- things than this library provides by default.
-*/
-typedef nk_ushort nk_draw_index;
-enum nk_draw_list_stroke {
- NK_STROKE_OPEN = nk_false,
- /* build up path has no connection back to the beginning */
- NK_STROKE_CLOSED = nk_true
- /* build up path has a connection back to the beginning */
-};
-
-enum nk_draw_vertex_layout_attribute {
- NK_VERTEX_POSITION,
- NK_VERTEX_COLOR,
- NK_VERTEX_TEXCOORD,
- NK_VERTEX_ATTRIBUTE_COUNT
-};
-
-enum nk_draw_vertex_layout_format {
- NK_FORMAT_SCHAR,
- NK_FORMAT_SSHORT,
- NK_FORMAT_SINT,
- NK_FORMAT_UCHAR,
- NK_FORMAT_USHORT,
- NK_FORMAT_UINT,
- NK_FORMAT_FLOAT,
- NK_FORMAT_DOUBLE,
-
-NK_FORMAT_COLOR_BEGIN,
- NK_FORMAT_R8G8B8 = NK_FORMAT_COLOR_BEGIN,
- NK_FORMAT_R16G15B16,
- NK_FORMAT_R32G32B32,
-
- NK_FORMAT_R8G8B8A8,
- NK_FORMAT_B8G8R8A8,
- NK_FORMAT_R16G15B16A16,
- NK_FORMAT_R32G32B32A32,
- NK_FORMAT_R32G32B32A32_FLOAT,
- NK_FORMAT_R32G32B32A32_DOUBLE,
-
- NK_FORMAT_RGB32,
- NK_FORMAT_RGBA32,
-NK_FORMAT_COLOR_END = NK_FORMAT_RGBA32,
- NK_FORMAT_COUNT
-};
-
-#define NK_VERTEX_LAYOUT_END NK_VERTEX_ATTRIBUTE_COUNT,NK_FORMAT_COUNT,0
-struct nk_draw_vertex_layout_element {
- enum nk_draw_vertex_layout_attribute attribute;
- enum nk_draw_vertex_layout_format format;
- nk_size offset;
-};
-
-struct nk_draw_command {
- unsigned int elem_count;
- /* number of elements in the current draw batch */
- struct nk_rect clip_rect;
- /* current screen clipping rectangle */
- nk_handle texture;
- /* current texture to set */
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_handle userdata;
-#endif
-};
-
-struct nk_draw_list {
- struct nk_rect clip_rect;
- struct nk_vec2 circle_vtx[12];
- struct nk_convert_config config;
-
- struct nk_buffer *buffer;
- struct nk_buffer *vertices;
- struct nk_buffer *elements;
-
- unsigned int element_count;
- unsigned int vertex_count;
- unsigned int cmd_count;
- nk_size cmd_offset;
-
- unsigned int path_count;
- unsigned int path_offset;
-
- enum nk_anti_aliasing line_AA;
- enum nk_anti_aliasing shape_AA;
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_handle userdata;
-#endif
-};
-
-/* draw list */
-NK_API void nk_draw_list_init(struct nk_draw_list*);
-NK_API void nk_draw_list_setup(struct nk_draw_list*, const struct nk_convert_config*, struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements, enum nk_anti_aliasing line_aa,enum nk_anti_aliasing shape_aa);
-NK_API void nk_draw_list_clear(struct nk_draw_list*);
-
-/* drawing */
-#define nk_draw_list_foreach(cmd, can, b) for((cmd)=nk__draw_list_begin(can, b); (cmd)!=0; (cmd)=nk__draw_list_next(cmd, b, can))
-NK_API const struct nk_draw_command* nk__draw_list_begin(const struct nk_draw_list*, const struct nk_buffer*);
-NK_API const struct nk_draw_command* nk__draw_list_next(const struct nk_draw_command*, const struct nk_buffer*, const struct nk_draw_list*);
-NK_API const struct nk_draw_command* nk__draw_list_end(const struct nk_draw_list*, const struct nk_buffer*);
-
-/* path */
-NK_API void nk_draw_list_path_clear(struct nk_draw_list*);
-NK_API void nk_draw_list_path_line_to(struct nk_draw_list*, struct nk_vec2 pos);
-NK_API void nk_draw_list_path_arc_to_fast(struct nk_draw_list*, struct nk_vec2 center, float radius, int a_min, int a_max);
-NK_API void nk_draw_list_path_arc_to(struct nk_draw_list*, struct nk_vec2 center, float radius, float a_min, float a_max, unsigned int segments);
-NK_API void nk_draw_list_path_rect_to(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, float rounding);
-NK_API void nk_draw_list_path_curve_to(struct nk_draw_list*, struct nk_vec2 p2, struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments);
-NK_API void nk_draw_list_path_fill(struct nk_draw_list*, struct nk_color);
-NK_API void nk_draw_list_path_stroke(struct nk_draw_list*, struct nk_color, enum nk_draw_list_stroke closed, float thickness);
-
-/* stroke */
-NK_API void nk_draw_list_stroke_line(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_color, float thickness);
-NK_API void nk_draw_list_stroke_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding, float thickness);
-NK_API void nk_draw_list_stroke_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color, float thickness);
-NK_API void nk_draw_list_stroke_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color, unsigned int segs, float thickness);
-NK_API void nk_draw_list_stroke_curve(struct nk_draw_list*, struct nk_vec2 p0, struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1, struct nk_color, unsigned int segments, float thickness);
-NK_API void nk_draw_list_stroke_poly_line(struct nk_draw_list*, const struct nk_vec2 *pnts, const unsigned int cnt, struct nk_color, enum nk_draw_list_stroke, float thickness, enum nk_anti_aliasing);
-
-/* fill */
-NK_API void nk_draw_list_fill_rect(struct nk_draw_list*, struct nk_rect rect, struct nk_color, float rounding);
-NK_API void nk_draw_list_fill_rect_multi_color(struct nk_draw_list*, struct nk_rect rect, struct nk_color left, struct nk_color top, struct nk_color right, struct nk_color bottom);
-NK_API void nk_draw_list_fill_triangle(struct nk_draw_list*, struct nk_vec2 a, struct nk_vec2 b, struct nk_vec2 c, struct nk_color);
-NK_API void nk_draw_list_fill_circle(struct nk_draw_list*, struct nk_vec2 center, float radius, struct nk_color col, unsigned int segs);
-NK_API void nk_draw_list_fill_poly_convex(struct nk_draw_list*, const struct nk_vec2 *points, const unsigned int count, struct nk_color, enum nk_anti_aliasing);
-
-/* misc */
-NK_API void nk_draw_list_add_image(struct nk_draw_list*, struct nk_image texture, struct nk_rect rect, struct nk_color);
-NK_API void nk_draw_list_add_text(struct nk_draw_list*, const struct nk_user_font*, struct nk_rect, const char *text, int len, float font_height, struct nk_color);
-#ifdef NK_INCLUDE_COMMAND_USERDATA
-NK_API void nk_draw_list_push_userdata(struct nk_draw_list*, nk_handle userdata);
-#endif
-
-#endif
-
-/* ===============================================================
- *
- * GUI
- *
- * ===============================================================*/
-enum nk_style_item_type {
- NK_STYLE_ITEM_COLOR,
- NK_STYLE_ITEM_IMAGE
-};
-
-union nk_style_item_data {
- struct nk_image image;
- struct nk_color color;
-};
-
-struct nk_style_item {
- enum nk_style_item_type type;
- union nk_style_item_data data;
-};
-
-struct nk_style_text {
- struct nk_color color;
- struct nk_vec2 padding;
-};
-
-struct nk_style_button {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* text */
- struct nk_color text_background;
- struct nk_color text_normal;
- struct nk_color text_hover;
- struct nk_color text_active;
- nk_flags text_alignment;
-
- /* properties */
- float border;
- float rounding;
- struct nk_vec2 padding;
- struct nk_vec2 image_padding;
- struct nk_vec2 touch_padding;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle userdata);
- void(*draw_end)(struct nk_command_buffer*, nk_handle userdata);
-};
-
-struct nk_style_toggle {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* cursor */
- struct nk_style_item cursor_normal;
- struct nk_style_item cursor_hover;
-
- /* text */
- struct nk_color text_normal;
- struct nk_color text_hover;
- struct nk_color text_active;
- struct nk_color text_background;
- nk_flags text_alignment;
-
- /* properties */
- struct nk_vec2 padding;
- struct nk_vec2 touch_padding;
- float spacing;
- float border;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_selectable {
- /* background (inactive) */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item pressed;
-
- /* background (active) */
- struct nk_style_item normal_active;
- struct nk_style_item hover_active;
- struct nk_style_item pressed_active;
-
- /* text color (inactive) */
- struct nk_color text_normal;
- struct nk_color text_hover;
- struct nk_color text_pressed;
-
- /* text color (active) */
- struct nk_color text_normal_active;
- struct nk_color text_hover_active;
- struct nk_color text_pressed_active;
- struct nk_color text_background;
- nk_flags text_alignment;
-
- /* properties */
- float rounding;
- struct nk_vec2 padding;
- struct nk_vec2 touch_padding;
- struct nk_vec2 image_padding;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_slider {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* background bar */
- struct nk_color bar_normal;
- struct nk_color bar_hover;
- struct nk_color bar_active;
- struct nk_color bar_filled;
-
- /* cursor */
- struct nk_style_item cursor_normal;
- struct nk_style_item cursor_hover;
- struct nk_style_item cursor_active;
-
- /* properties */
- float border;
- float rounding;
- float bar_height;
- struct nk_vec2 padding;
- struct nk_vec2 spacing;
- struct nk_vec2 cursor_size;
-
- /* optional buttons */
- int show_buttons;
- struct nk_style_button inc_button;
- struct nk_style_button dec_button;
- enum nk_symbol_type inc_symbol;
- enum nk_symbol_type dec_symbol;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_progress {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* cursor */
- struct nk_style_item cursor_normal;
- struct nk_style_item cursor_hover;
- struct nk_style_item cursor_active;
- struct nk_color cursor_border_color;
-
- /* properties */
- float rounding;
- float border;
- float cursor_border;
- float cursor_rounding;
- struct nk_vec2 padding;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_scrollbar {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* cursor */
- struct nk_style_item cursor_normal;
- struct nk_style_item cursor_hover;
- struct nk_style_item cursor_active;
- struct nk_color cursor_border_color;
-
- /* properties */
- float border;
- float rounding;
- float border_cursor;
- float rounding_cursor;
- struct nk_vec2 padding;
-
- /* optional buttons */
- int show_buttons;
- struct nk_style_button inc_button;
- struct nk_style_button dec_button;
- enum nk_symbol_type inc_symbol;
- enum nk_symbol_type dec_symbol;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_edit {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
- struct nk_style_scrollbar scrollbar;
-
- /* cursor */
- struct nk_color cursor_normal;
- struct nk_color cursor_hover;
- struct nk_color cursor_text_normal;
- struct nk_color cursor_text_hover;
-
- /* text (unselected) */
- struct nk_color text_normal;
- struct nk_color text_hover;
- struct nk_color text_active;
-
- /* text (selected) */
- struct nk_color selected_normal;
- struct nk_color selected_hover;
- struct nk_color selected_text_normal;
- struct nk_color selected_text_hover;
-
- /* properties */
- float border;
- float rounding;
- float cursor_size;
- struct nk_vec2 scrollbar_size;
- struct nk_vec2 padding;
- float row_padding;
-};
-
-struct nk_style_property {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* text */
- struct nk_color label_normal;
- struct nk_color label_hover;
- struct nk_color label_active;
-
- /* symbols */
- enum nk_symbol_type sym_left;
- enum nk_symbol_type sym_right;
-
- /* properties */
- float border;
- float rounding;
- struct nk_vec2 padding;
-
- struct nk_style_edit edit;
- struct nk_style_button inc_button;
- struct nk_style_button dec_button;
-
- /* optional user callbacks */
- nk_handle userdata;
- void(*draw_begin)(struct nk_command_buffer*, nk_handle);
- void(*draw_end)(struct nk_command_buffer*, nk_handle);
-};
-
-struct nk_style_chart {
- /* colors */
- struct nk_style_item background;
- struct nk_color border_color;
- struct nk_color selected_color;
- struct nk_color color;
-
- /* properties */
- float border;
- float rounding;
- struct nk_vec2 padding;
-};
-
-struct nk_style_combo {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
- struct nk_color border_color;
-
- /* label */
- struct nk_color label_normal;
- struct nk_color label_hover;
- struct nk_color label_active;
-
- /* symbol */
- struct nk_color symbol_normal;
- struct nk_color symbol_hover;
- struct nk_color symbol_active;
-
- /* button */
- struct nk_style_button button;
- enum nk_symbol_type sym_normal;
- enum nk_symbol_type sym_hover;
- enum nk_symbol_type sym_active;
-
- /* properties */
- float border;
- float rounding;
- struct nk_vec2 content_padding;
- struct nk_vec2 button_padding;
- struct nk_vec2 spacing;
-};
-
-struct nk_style_tab {
- /* background */
- struct nk_style_item background;
- struct nk_color border_color;
- struct nk_color text;
-
- /* button */
- struct nk_style_button tab_maximize_button;
- struct nk_style_button tab_minimize_button;
- struct nk_style_button node_maximize_button;
- struct nk_style_button node_minimize_button;
- enum nk_symbol_type sym_minimize;
- enum nk_symbol_type sym_maximize;
-
- /* properties */
- float border;
- float rounding;
- float indent;
- struct nk_vec2 padding;
- struct nk_vec2 spacing;
-};
-
-enum nk_style_header_align {
- NK_HEADER_LEFT,
- NK_HEADER_RIGHT
-};
-struct nk_style_window_header {
- /* background */
- struct nk_style_item normal;
- struct nk_style_item hover;
- struct nk_style_item active;
-
- /* button */
- struct nk_style_button close_button;
- struct nk_style_button minimize_button;
- enum nk_symbol_type close_symbol;
- enum nk_symbol_type minimize_symbol;
- enum nk_symbol_type maximize_symbol;
-
- /* title */
- struct nk_color label_normal;
- struct nk_color label_hover;
- struct nk_color label_active;
-
- /* properties */
- enum nk_style_header_align align;
- struct nk_vec2 padding;
- struct nk_vec2 label_padding;
- struct nk_vec2 spacing;
-};
-
-struct nk_style_window {
- struct nk_style_window_header header;
- struct nk_style_item fixed_background;
- struct nk_color background;
-
- struct nk_color border_color;
- struct nk_color popup_border_color;
- struct nk_color combo_border_color;
- struct nk_color contextual_border_color;
- struct nk_color menu_border_color;
- struct nk_color group_border_color;
- struct nk_color tooltip_border_color;
- struct nk_style_item scaler;
-
- float border;
- float combo_border;
- float contextual_border;
- float menu_border;
- float group_border;
- float tooltip_border;
- float popup_border;
- float min_row_height_padding;
-
- float rounding;
- struct nk_vec2 spacing;
- struct nk_vec2 scrollbar_size;
- struct nk_vec2 min_size;
-
- struct nk_vec2 padding;
- struct nk_vec2 group_padding;
- struct nk_vec2 popup_padding;
- struct nk_vec2 combo_padding;
- struct nk_vec2 contextual_padding;
- struct nk_vec2 menu_padding;
- struct nk_vec2 tooltip_padding;
-};
-
-struct nk_style {
- const struct nk_user_font *font;
- const struct nk_cursor *cursors[NK_CURSOR_COUNT];
- const struct nk_cursor *cursor_active;
- struct nk_cursor *cursor_last;
- int cursor_visible;
-
- struct nk_style_text text;
- struct nk_style_button button;
- struct nk_style_button contextual_button;
- struct nk_style_button menu_button;
- struct nk_style_toggle option;
- struct nk_style_toggle checkbox;
- struct nk_style_selectable selectable;
- struct nk_style_slider slider;
- struct nk_style_progress progress;
- struct nk_style_property property;
- struct nk_style_edit edit;
- struct nk_style_chart chart;
- struct nk_style_scrollbar scrollh;
- struct nk_style_scrollbar scrollv;
- struct nk_style_tab tab;
- struct nk_style_combo combo;
- struct nk_style_window window;
-};
-
-NK_API struct nk_style_item nk_style_item_image(struct nk_image img);
-NK_API struct nk_style_item nk_style_item_color(struct nk_color);
-NK_API struct nk_style_item nk_style_item_hide(void);
-
-/*==============================================================
- * PANEL
- * =============================================================*/
-#ifndef NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS
-#define NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS 16
-#endif
-#ifndef NK_CHART_MAX_SLOT
-#define NK_CHART_MAX_SLOT 4
-#endif
-
-enum nk_panel_type {
- NK_PANEL_WINDOW = NK_FLAG(0),
- NK_PANEL_GROUP = NK_FLAG(1),
- NK_PANEL_POPUP = NK_FLAG(2),
- NK_PANEL_CONTEXTUAL = NK_FLAG(4),
- NK_PANEL_COMBO = NK_FLAG(5),
- NK_PANEL_MENU = NK_FLAG(6),
- NK_PANEL_TOOLTIP = NK_FLAG(7)
-};
-enum nk_panel_set {
- NK_PANEL_SET_NONBLOCK = NK_PANEL_CONTEXTUAL|NK_PANEL_COMBO|NK_PANEL_MENU|NK_PANEL_TOOLTIP,
- NK_PANEL_SET_POPUP = NK_PANEL_SET_NONBLOCK|NK_PANEL_POPUP,
- NK_PANEL_SET_SUB = NK_PANEL_SET_POPUP|NK_PANEL_GROUP
-};
-
-struct nk_chart_slot {
- enum nk_chart_type type;
- struct nk_color color;
- struct nk_color highlight;
- float min, max, range;
- int count;
- struct nk_vec2 last;
- int index;
-};
-
-struct nk_chart {
- int slot;
- float x, y, w, h;
- struct nk_chart_slot slots[NK_CHART_MAX_SLOT];
-};
-
-enum nk_panel_row_layout_type {
- NK_LAYOUT_DYNAMIC_FIXED = 0,
- NK_LAYOUT_DYNAMIC_ROW,
- NK_LAYOUT_DYNAMIC_FREE,
- NK_LAYOUT_DYNAMIC,
- NK_LAYOUT_STATIC_FIXED,
- NK_LAYOUT_STATIC_ROW,
- NK_LAYOUT_STATIC_FREE,
- NK_LAYOUT_STATIC,
- NK_LAYOUT_TEMPLATE,
- NK_LAYOUT_COUNT
-};
-struct nk_row_layout {
- enum nk_panel_row_layout_type type;
- int index;
- float height;
- float min_height;
- int columns;
- const float *ratio;
- float item_width;
- float item_height;
- float item_offset;
- float filled;
- struct nk_rect item;
- int tree_depth;
- float templates[NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS];
-};
-
-struct nk_popup_buffer {
- nk_size begin;
- nk_size parent;
- nk_size last;
- nk_size end;
- int active;
-};
-
-struct nk_menu_state {
- float x, y, w, h;
- struct nk_scroll offset;
-};
-
-struct nk_panel {
- enum nk_panel_type type;
- nk_flags flags;
- struct nk_rect bounds;
- nk_uint *offset_x;
- nk_uint *offset_y;
- float at_x, at_y, max_x;
- float footer_height;
- float header_height;
- float border;
- unsigned int has_scrolling;
- struct nk_rect clip;
- struct nk_menu_state menu;
- struct nk_row_layout row;
- struct nk_chart chart;
- struct nk_command_buffer *buffer;
- struct nk_panel *parent;
-};
-
-/*==============================================================
- * WINDOW
- * =============================================================*/
-#ifndef NK_WINDOW_MAX_NAME
-#define NK_WINDOW_MAX_NAME 64
-#endif
-
-struct nk_table;
-enum nk_window_flags {
- NK_WINDOW_PRIVATE = NK_FLAG(11),
- NK_WINDOW_DYNAMIC = NK_WINDOW_PRIVATE,
- /* special window type growing up in height while being filled to a certain maximum height */
- NK_WINDOW_ROM = NK_FLAG(12),
- /* sets window widgets into a read only mode and does not allow input changes */
- NK_WINDOW_NOT_INTERACTIVE = NK_WINDOW_ROM|NK_WINDOW_NO_INPUT,
- /* prevents all interaction caused by input to either window or widgets inside */
- NK_WINDOW_HIDDEN = NK_FLAG(13),
- /* Hides window and stops any window interaction and drawing */
- NK_WINDOW_CLOSED = NK_FLAG(14),
- /* Directly closes and frees the window at the end of the frame */
- NK_WINDOW_MINIMIZED = NK_FLAG(15),
- /* marks the window as minimized */
- NK_WINDOW_REMOVE_ROM = NK_FLAG(16)
- /* Removes read only mode at the end of the window */
-};
-
-struct nk_popup_state {
- struct nk_window *win;
- enum nk_panel_type type;
- struct nk_popup_buffer buf;
- nk_hash name;
- int active;
- unsigned combo_count;
- unsigned con_count, con_old;
- unsigned active_con;
- struct nk_rect header;
-};
-
-struct nk_edit_state {
- nk_hash name;
- unsigned int seq;
- unsigned int old;
- int active, prev;
- int cursor;
- int sel_start;
- int sel_end;
- struct nk_scroll scrollbar;
- unsigned char mode;
- unsigned char single_line;
-};
-
-struct nk_property_state {
- int active, prev;
- char buffer[NK_MAX_NUMBER_BUFFER];
- int length;
- int cursor;
- int select_start;
- int select_end;
- nk_hash name;
- unsigned int seq;
- unsigned int old;
- int state;
-};
-
-struct nk_window {
- unsigned int seq;
- nk_hash name;
- char name_string[NK_WINDOW_MAX_NAME];
- nk_flags flags;
-
- struct nk_rect bounds;
- struct nk_scroll scrollbar;
- struct nk_command_buffer buffer;
- struct nk_panel *layout;
- float scrollbar_hiding_timer;
-
- /* persistent widget state */
- struct nk_property_state property;
- struct nk_popup_state popup;
- struct nk_edit_state edit;
- unsigned int scrolled;
-
- struct nk_table *tables;
- unsigned int table_count;
-
- /* window list hooks */
- struct nk_window *next;
- struct nk_window *prev;
- struct nk_window *parent;
-};
-
-/*==============================================================
- * STACK
- * =============================================================*/
-/* The style modifier stack can be used to temporarily change a
- * property inside `nk_style`. For example if you want a special
- * red button you can temporarily push the old button color onto a stack
- * draw the button with a red color and then you just pop the old color
- * back from the stack:
- *
- * nk_style_push_style_item(ctx, &ctx->style.button.normal, nk_style_item_color(nk_rgb(255,0,0)));
- * nk_style_push_style_item(ctx, &ctx->style.button.hover, nk_style_item_color(nk_rgb(255,0,0)));
- * nk_style_push_style_item(ctx, &ctx->style.button.active, nk_style_item_color(nk_rgb(255,0,0)));
- * nk_style_push_vec2(ctx, &cx->style.button.padding, nk_vec2(2,2));
- *
- * nk_button(...);
- *
- * nk_style_pop_style_item(ctx);
- * nk_style_pop_style_item(ctx);
- * nk_style_pop_style_item(ctx);
- * nk_style_pop_vec2(ctx);
- *
- * Nuklear has a stack for style_items, float properties, vector properties,
- * flags, colors, fonts and for button_behavior. Each has it's own fixed size stack
- * which can be changed at compile time.
- */
-#ifndef NK_BUTTON_BEHAVIOR_STACK_SIZE
-#define NK_BUTTON_BEHAVIOR_STACK_SIZE 8
-#endif
-
-#ifndef NK_FONT_STACK_SIZE
-#define NK_FONT_STACK_SIZE 8
-#endif
-
-#ifndef NK_STYLE_ITEM_STACK_SIZE
-#define NK_STYLE_ITEM_STACK_SIZE 16
-#endif
-
-#ifndef NK_FLOAT_STACK_SIZE
-#define NK_FLOAT_STACK_SIZE 32
-#endif
-
-#ifndef NK_VECTOR_STACK_SIZE
-#define NK_VECTOR_STACK_SIZE 16
-#endif
-
-#ifndef NK_FLAGS_STACK_SIZE
-#define NK_FLAGS_STACK_SIZE 32
-#endif
-
-#ifndef NK_COLOR_STACK_SIZE
-#define NK_COLOR_STACK_SIZE 32
-#endif
-
-#define NK_CONFIGURATION_STACK_TYPE(prefix, name, type)\
- struct nk_config_stack_##name##_element {\
- prefix##_##type *address;\
- prefix##_##type old_value;\
- }
-#define NK_CONFIG_STACK(type,size)\
- struct nk_config_stack_##type {\
- int head;\
- struct nk_config_stack_##type##_element elements[size];\
- }
-
-#define nk_float float
-NK_CONFIGURATION_STACK_TYPE(struct nk, style_item, style_item);
-NK_CONFIGURATION_STACK_TYPE(nk ,float, float);
-NK_CONFIGURATION_STACK_TYPE(struct nk, vec2, vec2);
-NK_CONFIGURATION_STACK_TYPE(nk ,flags, flags);
-NK_CONFIGURATION_STACK_TYPE(struct nk, color, color);
-NK_CONFIGURATION_STACK_TYPE(const struct nk, user_font, user_font*);
-NK_CONFIGURATION_STACK_TYPE(enum nk, button_behavior, button_behavior);
-
-NK_CONFIG_STACK(style_item, NK_STYLE_ITEM_STACK_SIZE);
-NK_CONFIG_STACK(float, NK_FLOAT_STACK_SIZE);
-NK_CONFIG_STACK(vec2, NK_VECTOR_STACK_SIZE);
-NK_CONFIG_STACK(flags, NK_FLAGS_STACK_SIZE);
-NK_CONFIG_STACK(color, NK_COLOR_STACK_SIZE);
-NK_CONFIG_STACK(user_font, NK_FONT_STACK_SIZE);
-NK_CONFIG_STACK(button_behavior, NK_BUTTON_BEHAVIOR_STACK_SIZE);
-
-struct nk_configuration_stacks {
- struct nk_config_stack_style_item style_items;
- struct nk_config_stack_float floats;
- struct nk_config_stack_vec2 vectors;
- struct nk_config_stack_flags flags;
- struct nk_config_stack_color colors;
- struct nk_config_stack_user_font fonts;
- struct nk_config_stack_button_behavior button_behaviors;
-};
-
-/*==============================================================
- * CONTEXT
- * =============================================================*/
-#define NK_VALUE_PAGE_CAPACITY \
- (((NK_MAX(sizeof(struct nk_window),sizeof(struct nk_panel)) / sizeof(nk_uint))) / 2)
-
-struct nk_table {
- unsigned int seq;
- unsigned int size;
- nk_hash keys[NK_VALUE_PAGE_CAPACITY];
- nk_uint values[NK_VALUE_PAGE_CAPACITY];
- struct nk_table *next, *prev;
-};
-
-union nk_page_data {
- struct nk_table tbl;
- struct nk_panel pan;
- struct nk_window win;
-};
-
-struct nk_page_element {
- union nk_page_data data;
- struct nk_page_element *next;
- struct nk_page_element *prev;
-};
-
-struct nk_page {
- unsigned int size;
- struct nk_page *next;
- struct nk_page_element win[1];
-};
-
-struct nk_pool {
- struct nk_allocator alloc;
- enum nk_allocation_type type;
- unsigned int page_count;
- struct nk_page *pages;
- struct nk_page_element *freelist;
- unsigned capacity;
- nk_size size;
- nk_size cap;
-};
-
-struct nk_context {
-/* public: can be accessed freely */
- struct nk_input input;
- struct nk_style style;
- struct nk_buffer memory;
- struct nk_clipboard clip;
- nk_flags last_widget_state;
- enum nk_button_behavior button_behavior;
- struct nk_configuration_stacks stacks;
- float delta_time_seconds;
-
-/* private:
- should only be accessed if you
- know what you are doing */
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- struct nk_draw_list draw_list;
-#endif
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_handle userdata;
-#endif
- /* text editor objects are quite big because of an internal
- * undo/redo stack. Therefore it does not make sense to have one for
- * each window for temporary use cases, so I only provide *one* instance
- * for all windows. This works because the content is cleared anyway */
- struct nk_text_edit text_edit;
- /* draw buffer used for overlay drawing operation like cursor */
- struct nk_command_buffer overlay;
-
- /* windows */
- int build;
- int use_pool;
- struct nk_pool pool;
- struct nk_window *begin;
- struct nk_window *end;
- struct nk_window *active;
- struct nk_window *current;
- struct nk_page_element *freelist;
- unsigned int count;
- unsigned int seq;
-};
-
-/* ==============================================================
- * MATH
- * =============================================================== */
-#define NK_PI 3.141592654f
-#define NK_UTF_INVALID 0xFFFD
-#define NK_MAX_FLOAT_PRECISION 2
-
-#define NK_UNUSED(x) ((void)(x))
-#define NK_SATURATE(x) (NK_MAX(0, NK_MIN(1.0f, x)))
-#define NK_LEN(a) (sizeof(a)/sizeof(a)[0])
-#define NK_ABS(a) (((a) < 0) ? -(a) : (a))
-#define NK_BETWEEN(x, a, b) ((a) <= (x) && (x) < (b))
-#define NK_INBOX(px, py, x, y, w, h)\
- (NK_BETWEEN(px,x,x+w) && NK_BETWEEN(py,y,y+h))
-#define NK_INTERSECT(x0, y0, w0, h0, x1, y1, w1, h1) \
- (!(((x1 > (x0 + w0)) || ((x1 + w1) < x0) || (y1 > (y0 + h0)) || (y1 + h1) < y0)))
-#define NK_CONTAINS(x, y, w, h, bx, by, bw, bh)\
- (NK_INBOX(x,y, bx, by, bw, bh) && NK_INBOX(x+w,y+h, bx, by, bw, bh))
-
-#define nk_vec2_sub(a, b) nk_vec2((a).x - (b).x, (a).y - (b).y)
-#define nk_vec2_add(a, b) nk_vec2((a).x + (b).x, (a).y + (b).y)
-#define nk_vec2_len_sqr(a) ((a).x*(a).x+(a).y*(a).y)
-#define nk_vec2_muls(a, t) nk_vec2((a).x * (t), (a).y * (t))
-
-#define nk_ptr_add(t, p, i) ((t*)((void*)((nk_byte*)(p) + (i))))
-#define nk_ptr_add_const(t, p, i) ((const t*)((const void*)((const nk_byte*)(p) + (i))))
-#define nk_zero_struct(s) nk_zero(&s, sizeof(s))
-
-/* ==============================================================
- * ALIGNMENT
- * =============================================================== */
-/* Pointer to Integer type conversion for pointer alignment */
-#if defined(__PTRDIFF_TYPE__) /* This case should work for GCC*/
-# define NK_UINT_TO_PTR(x) ((void*)(__PTRDIFF_TYPE__)(x))
-# define NK_PTR_TO_UINT(x) ((nk_size)(__PTRDIFF_TYPE__)(x))
-#elif !defined(__GNUC__) /* works for compilers other than LLVM */
-# define NK_UINT_TO_PTR(x) ((void*)&((char*)0)[x])
-# define NK_PTR_TO_UINT(x) ((nk_size)(((char*)x)-(char*)0))
-#elif defined(NK_USE_FIXED_TYPES) /* used if we have <stdint.h> */
-# define NK_UINT_TO_PTR(x) ((void*)(uintptr_t)(x))
-# define NK_PTR_TO_UINT(x) ((uintptr_t)(x))
-#else /* generates warning but works */
-# define NK_UINT_TO_PTR(x) ((void*)(x))
-# define NK_PTR_TO_UINT(x) ((nk_size)(x))
-#endif
-
-#define NK_ALIGN_PTR(x, mask)\
- (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x) + (mask-1)) & ~(mask-1))))
-#define NK_ALIGN_PTR_BACK(x, mask)\
- (NK_UINT_TO_PTR((NK_PTR_TO_UINT((nk_byte*)(x)) & ~(mask-1))))
-
-#define NK_OFFSETOF(st,m) ((nk_ptr)&(((st*)0)->m))
-#define NK_CONTAINER_OF(ptr,type,member)\
- (type*)((void*)((char*)(1 ? (ptr): &((type*)0)->member) - NK_OFFSETOF(type, member)))
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-template<typename T> struct nk_alignof;
-template<typename T, int size_diff> struct nk_helper{enum {value = size_diff};};
-template<typename T> struct nk_helper<T,0>{enum {value = nk_alignof<T>::value};};
-template<typename T> struct nk_alignof{struct Big {T x; char c;}; enum {
- diff = sizeof(Big) - sizeof(T), value = nk_helper<Big, diff>::value};};
-#define NK_ALIGNOF(t) (nk_alignof<t>::value)
-#elif defined(_MSC_VER)
-#define NK_ALIGNOF(t) (__alignof(t))
-#else
-#define NK_ALIGNOF(t) ((char*)(&((struct {char c; t _h;}*)0)->_h) - (char*)0)
-#endif
-
-#endif /* NK_NUKLEAR_H_ */
-/*
- * ==============================================================
- *
- * IMPLEMENTATION
- *
- * ===============================================================
- */
-#ifdef NK_IMPLEMENTATION
-
-#ifndef NK_POOL_DEFAULT_CAPACITY
-#define NK_POOL_DEFAULT_CAPACITY 16
-#endif
-
-#ifndef NK_DEFAULT_COMMAND_BUFFER_SIZE
-#define NK_DEFAULT_COMMAND_BUFFER_SIZE (4*1024)
-#endif
-
-#ifndef NK_BUFFER_DEFAULT_INITIAL_SIZE
-#define NK_BUFFER_DEFAULT_INITIAL_SIZE (4*1024)
-#endif
-
-/* standard library headers */
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-#include <stdlib.h> /* malloc, free */
-#endif
-#ifdef NK_INCLUDE_STANDARD_IO
-#include <stdio.h> /* fopen, fclose,... */
-#endif
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-#include <stdarg.h> /* valist, va_start, va_end, ... */
-#endif
-#ifndef NK_ASSERT
-#include <assert.h>
-#define NK_ASSERT(expr) assert(expr)
-#endif
-
-#ifndef NK_MEMSET
-#define NK_MEMSET nk_memset
-#endif
-#ifndef NK_MEMCPY
-#define NK_MEMCPY nk_memcopy
-#endif
-#ifndef NK_SQRT
-#define NK_SQRT nk_sqrt
-#endif
-#ifndef NK_SIN
-#define NK_SIN nk_sin
-#endif
-#ifndef NK_COS
-#define NK_COS nk_cos
-#endif
-#ifndef NK_STRTOD
-#define NK_STRTOD nk_strtod
-#endif
-#ifndef NK_DTOA
-#define NK_DTOA nk_dtoa
-#endif
-
-#define NK_DEFAULT (-1)
-
-#ifndef NK_VSNPRINTF
-/* If your compiler does support `vsnprintf` I would highly recommend
- * defining this to vsnprintf instead since `vsprintf` is basically
- * unbelievable unsafe and should *NEVER* be used. But I have to support
- * it since C89 only provides this unsafe version. */
- #if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)) ||\
- (defined(__cplusplus) && (__cplusplus >= 201103L)) || \
- (defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) ||\
- (defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) ||\
- defined(_ISOC99_SOURCE) || defined(_BSD_SOURCE)
- #define NK_VSNPRINTF(s,n,f,a) vsnprintf(s,n,f,a)
- #else
- #define NK_VSNPRINTF(s,n,f,a) vsprintf(s,f,a)
- #endif
-#endif
-
-#define NK_SCHAR_MIN (-127)
-#define NK_SCHAR_MAX 127
-#define NK_UCHAR_MIN 0
-#define NK_UCHAR_MAX 256
-#define NK_SSHORT_MIN (-32767)
-#define NK_SSHORT_MAX 32767
-#define NK_USHORT_MIN 0
-#define NK_USHORT_MAX 65535
-#define NK_SINT_MIN (-2147483647)
-#define NK_SINT_MAX 2147483647
-#define NK_UINT_MIN 0
-#define NK_UINT_MAX 4294967295u
-
-/* Make sure correct type size:
- * This will fire with a negative subscript error if the type sizes
- * are set incorrectly by the compiler, and compile out if not */
-NK_STATIC_ASSERT(sizeof(nk_size) >= sizeof(void*));
-NK_STATIC_ASSERT(sizeof(nk_ptr) == sizeof(void*));
-NK_STATIC_ASSERT(sizeof(nk_flags) >= 4);
-NK_STATIC_ASSERT(sizeof(nk_rune) >= 4);
-NK_STATIC_ASSERT(sizeof(nk_ushort) == 2);
-NK_STATIC_ASSERT(sizeof(nk_short) == 2);
-NK_STATIC_ASSERT(sizeof(nk_uint) == 4);
-NK_STATIC_ASSERT(sizeof(nk_int) == 4);
-NK_STATIC_ASSERT(sizeof(nk_byte) == 1);
-
-NK_GLOBAL const struct nk_rect nk_null_rect = {-8192.0f, -8192.0f, 16384, 16384};
-#define NK_FLOAT_PRECISION 0.00000000000001
-
-NK_GLOBAL const struct nk_color nk_red = {255,0,0,255};
-NK_GLOBAL const struct nk_color nk_green = {0,255,0,255};
-NK_GLOBAL const struct nk_color nk_blue = {0,0,255,255};
-NK_GLOBAL const struct nk_color nk_white = {255,255,255,255};
-NK_GLOBAL const struct nk_color nk_black = {0,0,0,255};
-NK_GLOBAL const struct nk_color nk_yellow = {255,255,0,255};
-
-/*
- * ==============================================================
- *
- * MATH
- *
- * ===============================================================
- */
-/* Since nuklear is supposed to work on all systems providing floating point
- math without any dependencies I also had to implement my own math functions
- for sqrt, sin and cos. Since the actual highly accurate implementations for
- the standard library functions are quite complex and I do not need high
- precision for my use cases I use approximations.
-
- Sqrt
- ----
- For square root nuklear uses the famous fast inverse square root:
- https://en.wikipedia.org/wiki/Fast_inverse_square_root with
- slightly tweaked magic constant. While on today's hardware it is
- probably not faster it is still fast and accurate enough for
- nuklear's use cases. IMPORTANT: this requires float format IEEE 754
-
- Sine/Cosine
- -----------
- All constants inside both function are generated Remez's minimax
- approximations for value range 0...2*PI. The reason why I decided to
- approximate exactly that range is that nuklear only needs sine and
- cosine to generate circles which only requires that exact range.
- In addition I used Remez instead of Taylor for additional precision:
- www.lolengine.net/blog/2011/12/21/better-function-approximations.
-
- The tool I used to generate constants for both sine and cosine
- (it can actually approximate a lot more functions) can be
- found here: www.lolengine.net/wiki/oss/lolremez
-*/
-NK_INTERN float
-nk_inv_sqrt(float number)
-{
- float x2;
- const float threehalfs = 1.5f;
- union {nk_uint i; float f;} conv = {0};
- conv.f = number;
- x2 = number * 0.5f;
- conv.i = 0x5f375A84 - (conv.i >> 1);
- conv.f = conv.f * (threehalfs - (x2 * conv.f * conv.f));
- return conv.f;
-}
-
-NK_INTERN float
-nk_sqrt(float x)
-{
- return x * nk_inv_sqrt(x);
-}
-
-NK_INTERN float
-nk_sin(float x)
-{
- NK_STORAGE const float a0 = +1.91059300966915117e-31f;
- NK_STORAGE const float a1 = +1.00086760103908896f;
- NK_STORAGE const float a2 = -1.21276126894734565e-2f;
- NK_STORAGE const float a3 = -1.38078780785773762e-1f;
- NK_STORAGE const float a4 = -2.67353392911981221e-2f;
- NK_STORAGE const float a5 = +2.08026600266304389e-2f;
- NK_STORAGE const float a6 = -3.03996055049204407e-3f;
- NK_STORAGE const float a7 = +1.38235642404333740e-4f;
- return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
-}
-
-NK_INTERN float
-nk_cos(float x)
-{
- NK_STORAGE const float a0 = +1.00238601909309722f;
- NK_STORAGE const float a1 = -3.81919947353040024e-2f;
- NK_STORAGE const float a2 = -3.94382342128062756e-1f;
- NK_STORAGE const float a3 = -1.18134036025221444e-1f;
- NK_STORAGE const float a4 = +1.07123798512170878e-1f;
- NK_STORAGE const float a5 = -1.86637164165180873e-2f;
- NK_STORAGE const float a6 = +9.90140908664079833e-4f;
- NK_STORAGE const float a7 = -5.23022132118824778e-14f;
- return a0 + x*(a1 + x*(a2 + x*(a3 + x*(a4 + x*(a5 + x*(a6 + x*a7))))));
-}
-
-NK_INTERN nk_uint
-nk_round_up_pow2(nk_uint v)
-{
- v--;
- v |= v >> 1;
- v |= v >> 2;
- v |= v >> 4;
- v |= v >> 8;
- v |= v >> 16;
- v++;
- return v;
-}
-
-NK_API struct nk_rect
-nk_get_null_rect(void)
-{
- return nk_null_rect;
-}
-
-NK_API struct nk_rect
-nk_rect(float x, float y, float w, float h)
-{
- struct nk_rect r;
- r.x = x; r.y = y;
- r.w = w; r.h = h;
- return r;
-}
-
-NK_API struct nk_rect
-nk_recti(int x, int y, int w, int h)
-{
- struct nk_rect r;
- r.x = (float)x;
- r.y = (float)y;
- r.w = (float)w;
- r.h = (float)h;
- return r;
-}
-
-NK_API struct nk_rect
-nk_recta(struct nk_vec2 pos, struct nk_vec2 size)
-{
- return nk_rect(pos.x, pos.y, size.x, size.y);
-}
-
-NK_API struct nk_rect
-nk_rectv(const float *r)
-{
- return nk_rect(r[0], r[1], r[2], r[3]);
-}
-
-NK_API struct nk_rect
-nk_rectiv(const int *r)
-{
- return nk_recti(r[0], r[1], r[2], r[3]);
-}
-
-NK_API struct nk_vec2
-nk_rect_pos(struct nk_rect r)
-{
- struct nk_vec2 ret;
- ret.x = r.x; ret.y = r.y;
- return ret;
-}
-
-NK_API struct nk_vec2
-nk_rect_size(struct nk_rect r)
-{
- struct nk_vec2 ret;
- ret.x = r.w; ret.y = r.h;
- return ret;
-}
-
-NK_INTERN struct nk_rect
-nk_shrink_rect(struct nk_rect r, float amount)
-{
- struct nk_rect res;
- r.w = NK_MAX(r.w, 2 * amount);
- r.h = NK_MAX(r.h, 2 * amount);
- res.x = r.x + amount;
- res.y = r.y + amount;
- res.w = r.w - 2 * amount;
- res.h = r.h - 2 * amount;
- return res;
-}
-
-NK_INTERN struct nk_rect
-nk_pad_rect(struct nk_rect r, struct nk_vec2 pad)
-{
- r.w = NK_MAX(r.w, 2 * pad.x);
- r.h = NK_MAX(r.h, 2 * pad.y);
- r.x += pad.x; r.y += pad.y;
- r.w -= 2 * pad.x;
- r.h -= 2 * pad.y;
- return r;
-}
-
-NK_API struct nk_vec2
-nk_vec2(float x, float y)
-{
- struct nk_vec2 ret;
- ret.x = x; ret.y = y;
- return ret;
-}
-
-NK_API struct nk_vec2
-nk_vec2i(int x, int y)
-{
- struct nk_vec2 ret;
- ret.x = (float)x;
- ret.y = (float)y;
- return ret;
-}
-
-NK_API struct nk_vec2
-nk_vec2v(const float *v)
-{
- return nk_vec2(v[0], v[1]);
-}
-
-NK_API struct nk_vec2
-nk_vec2iv(const int *v)
-{
- return nk_vec2i(v[0], v[1]);
-}
-
-/*
- * ==============================================================
- *
- * UTIL
- *
- * ===============================================================
- */
-NK_INTERN int nk_str_match_here(const char *regexp, const char *text);
-NK_INTERN int nk_str_match_star(int c, const char *regexp, const char *text);
-NK_INTERN int nk_is_lower(int c) {return (c >= 'a' && c <= 'z') || (c >= 0xE0 && c <= 0xFF);}
-NK_INTERN int nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 && c <= 0xDF);}
-NK_INTERN int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
-NK_INTERN int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
-
-NK_INTERN void*
-nk_memcopy(void *dst0, const void *src0, nk_size length)
-{
- nk_ptr t;
- char *dst = (char*)dst0;
- const char *src = (const char*)src0;
- if (length == 0 || dst == src)
- goto done;
-
- #define nk_word int
- #define nk_wsize sizeof(nk_word)
- #define nk_wmask (nk_wsize-1)
- #define NK_TLOOP(s) if (t) NK_TLOOP1(s)
- #define NK_TLOOP1(s) do { s; } while (--t)
-
- if (dst < src) {
- t = (nk_ptr)src; /* only need low bits */
- if ((t | (nk_ptr)dst) & nk_wmask) {
- if ((t ^ (nk_ptr)dst) & nk_wmask || length < nk_wsize)
- t = length;
- else
- t = nk_wsize - (t & nk_wmask);
- length -= t;
- NK_TLOOP1(*dst++ = *src++);
- }
- t = length / nk_wsize;
- NK_TLOOP(*(nk_word*)(void*)dst = *(const nk_word*)(const void*)src;
- src += nk_wsize; dst += nk_wsize);
- t = length & nk_wmask;
- NK_TLOOP(*dst++ = *src++);
- } else {
- src += length;
- dst += length;
- t = (nk_ptr)src;
- if ((t | (nk_ptr)dst) & nk_wmask) {
- if ((t ^ (nk_ptr)dst) & nk_wmask || length <= nk_wsize)
- t = length;
- else
- t &= nk_wmask;
- length -= t;
- NK_TLOOP1(*--dst = *--src);
- }
- t = length / nk_wsize;
- NK_TLOOP(src -= nk_wsize; dst -= nk_wsize;
- *(nk_word*)(void*)dst = *(const nk_word*)(const void*)src);
- t = length & nk_wmask;
- NK_TLOOP(*--dst = *--src);
- }
- #undef nk_word
- #undef nk_wsize
- #undef nk_wmask
- #undef NK_TLOOP
- #undef NK_TLOOP1
-done:
- return (dst0);
-}
-
-NK_INTERN void
-nk_memset(void *ptr, int c0, nk_size size)
-{
- #define nk_word unsigned
- #define nk_wsize sizeof(nk_word)
- #define nk_wmask (nk_wsize - 1)
- nk_byte *dst = (nk_byte*)ptr;
- unsigned c = 0;
- nk_size t = 0;
-
- if ((c = (nk_byte)c0) != 0) {
- c = (c << 8) | c; /* at least 16-bits */
- if (sizeof(unsigned int) > 2)
- c = (c << 16) | c; /* at least 32-bits*/
- }
-
- /* too small of a word count */
- dst = (nk_byte*)ptr;
- if (size < 3 * nk_wsize) {
- while (size--) *dst++ = (nk_byte)c0;
- return;
- }
-
- /* align destination */
- if ((t = NK_PTR_TO_UINT(dst) & nk_wmask) != 0) {
- t = nk_wsize -t;
- size -= t;
- do {
- *dst++ = (nk_byte)c0;
- } while (--t != 0);
- }
-
- /* fill word */
- t = size / nk_wsize;
- do {
- *(nk_word*)((void*)dst) = c;
- dst += nk_wsize;
- } while (--t != 0);
-
- /* fill trailing bytes */
- t = (size & nk_wmask);
- if (t != 0) {
- do {
- *dst++ = (nk_byte)c0;
- } while (--t != 0);
- }
-
- #undef nk_word
- #undef nk_wsize
- #undef nk_wmask
-}
-
-NK_INTERN void
-nk_zero(void *ptr, nk_size size)
-{
- NK_ASSERT(ptr);
- NK_MEMSET(ptr, 0, size);
-}
-
-NK_API int
-nk_strlen(const char *str)
-{
- int siz = 0;
- NK_ASSERT(str);
- while (str && *str++ != '\0') siz++;
- return siz;
-}
-
-NK_API int
-nk_strtoi(const char *str, const char **endptr)
-{
- int neg = 1;
- const char *p = str;
- int value = 0;
-
- NK_ASSERT(str);
- if (!str) return 0;
-
- /* skip whitespace */
- while (*p == ' ') p++;
- if (*p == '-') {
- neg = -1;
- p++;
- }
- while (*p && *p >= '0' && *p <= '9') {
- value = value * 10 + (int) (*p - '0');
- p++;
- }
- if (endptr)
- *endptr = p;
- return neg*value;
-}
-
-NK_API double
-nk_strtod(const char *str, const char **endptr)
-{
- double m;
- double neg = 1.0;
- const char *p = str;
- double value = 0;
- double number = 0;
-
- NK_ASSERT(str);
- if (!str) return 0;
-
- /* skip whitespace */
- while (*p == ' ') p++;
- if (*p == '-') {
- neg = -1.0;
- p++;
- }
-
- while (*p && *p != '.' && *p != 'e') {
- value = value * 10.0 + (double) (*p - '0');
- p++;
- }
-
- if (*p == '.') {
- p++;
- for(m = 0.1; *p && *p != 'e'; p++ ) {
- value = value + (double) (*p - '0') * m;
- m *= 0.1;
- }
- }
- if (*p == 'e') {
- int i, pow, div;
- p++;
- if (*p == '-') {
- div = nk_true;
- p++;
- } else if (*p == '+') {
- div = nk_false;
- p++;
- } else div = nk_false;
-
- for (pow = 0; *p; p++)
- pow = pow * 10 + (int) (*p - '0');
-
- for (m = 1.0, i = 0; i < pow; i++)
- m *= 10.0;
-
- if (div)
- value /= m;
- else value *= m;
- }
- number = value * neg;
- if (endptr)
- *endptr = p;
- return number;
-}
-
-NK_API float
-nk_strtof(const char *str, const char **endptr)
-{
- float float_value;
- double double_value;
- double_value = NK_STRTOD(str, endptr);
- float_value = (float)double_value;
- return float_value;
-}
-
-NK_API int
-nk_stricmp(const char *s1, const char *s2)
-{
- nk_int c1,c2,d;
- do {
- c1 = *s1++;
- c2 = *s2++;
- d = c1 - c2;
- while (d) {
- if (c1 <= 'Z' && c1 >= 'A') {
- d += ('a' - 'A');
- if (!d) break;
- }
- if (c2 <= 'Z' && c2 >= 'A') {
- d -= ('a' - 'A');
- if (!d) break;
- }
- return ((d >= 0) << 1) - 1;
- }
- } while (c1);
- return 0;
-}
-
-NK_API int
-nk_stricmpn(const char *s1, const char *s2, int n)
-{
- int c1,c2,d;
- NK_ASSERT(n >= 0);
- do {
- c1 = *s1++;
- c2 = *s2++;
- if (!n--) return 0;
-
- d = c1 - c2;
- while (d) {
- if (c1 <= 'Z' && c1 >= 'A') {
- d += ('a' - 'A');
- if (!d) break;
- }
- if (c2 <= 'Z' && c2 >= 'A') {
- d -= ('a' - 'A');
- if (!d) break;
- }
- return ((d >= 0) << 1) - 1;
- }
- } while (c1);
- return 0;
-}
-
-NK_INTERN int
-nk_str_match_here(const char *regexp, const char *text)
-{
- if (regexp[0] == '\0')
- return 1;
- if (regexp[1] == '*')
- return nk_str_match_star(regexp[0], regexp+2, text);
- if (regexp[0] == '$' && regexp[1] == '\0')
- return *text == '\0';
- if (*text!='\0' && (regexp[0]=='.' || regexp[0]==*text))
- return nk_str_match_here(regexp+1, text+1);
- return 0;
-}
-
-NK_INTERN int
-nk_str_match_star(int c, const char *regexp, const char *text)
-{
- do {/* a '* matches zero or more instances */
- if (nk_str_match_here(regexp, text))
- return 1;
- } while (*text != '\0' && (*text++ == c || c == '.'));
- return 0;
-}
-
-NK_API int
-nk_strfilter(const char *text, const char *regexp)
-{
- /*
- c matches any literal character c
- . matches any single character
- ^ matches the beginning of the input string
- $ matches the end of the input string
- * matches zero or more occurrences of the previous character*/
- if (regexp[0] == '^')
- return nk_str_match_here(regexp+1, text);
- do { /* must look even if string is empty */
- if (nk_str_match_here(regexp, text))
- return 1;
- } while (*text++ != '\0');
- return 0;
-}
-
-NK_API int
-nk_strmatch_fuzzy_text(const char *str, int str_len,
- const char *pattern, int *out_score)
-{
- /* Returns true if each character in pattern is found sequentially within str
- * if found then out_score is also set. Score value has no intrinsic meaning.
- * Range varies with pattern. Can only compare scores with same search pattern. */
-
- /* bonus for adjacent matches */
- #define NK_ADJACENCY_BONUS 5
- /* bonus if match occurs after a separator */
- #define NK_SEPARATOR_BONUS 10
- /* bonus if match is uppercase and prev is lower */
- #define NK_CAMEL_BONUS 10
- /* penalty applied for every letter in str before the first match */
- #define NK_LEADING_LETTER_PENALTY (-3)
- /* maximum penalty for leading letters */
- #define NK_MAX_LEADING_LETTER_PENALTY (-9)
- /* penalty for every letter that doesn't matter */
- #define NK_UNMATCHED_LETTER_PENALTY (-1)
-
- /* loop variables */
- int score = 0;
- char const * pattern_iter = pattern;
- int str_iter = 0;
- int prev_matched = nk_false;
- int prev_lower = nk_false;
- /* true so if first letter match gets separator bonus*/
- int prev_separator = nk_true;
-
- /* use "best" matched letter if multiple string letters match the pattern */
- char const * best_letter = 0;
- int best_letter_score = 0;
-
- /* loop over strings */
- NK_ASSERT(str);
- NK_ASSERT(pattern);
- if (!str || !str_len || !pattern) return 0;
- while (str_iter < str_len)
- {
- const char pattern_letter = *pattern_iter;
- const char str_letter = str[str_iter];
-
- int next_match = *pattern_iter != '\0' &&
- nk_to_lower(pattern_letter) == nk_to_lower(str_letter);
- int rematch = best_letter && nk_to_upper(*best_letter) == nk_to_upper(str_letter);
-
- int advanced = next_match && best_letter;
- int pattern_repeat = best_letter && *pattern_iter != '\0';
- pattern_repeat = pattern_repeat &&
- nk_to_lower(*best_letter) == nk_to_lower(pattern_letter);
-
- if (advanced || pattern_repeat) {
- score += best_letter_score;
- best_letter = 0;
- best_letter_score = 0;
- }
-
- if (next_match || rematch)
- {
- int new_score = 0;
- /* Apply penalty for each letter before the first pattern match */
- if (pattern_iter == pattern) {
- int count = (int)(&str[str_iter] - str);
- int penalty = NK_LEADING_LETTER_PENALTY * count;
- if (penalty < NK_MAX_LEADING_LETTER_PENALTY)
- penalty = NK_MAX_LEADING_LETTER_PENALTY;
-
- score += penalty;
- }
-
- /* apply bonus for consecutive bonuses */
- if (prev_matched)
- new_score += NK_ADJACENCY_BONUS;
-
- /* apply bonus for matches after a separator */
- if (prev_separator)
- new_score += NK_SEPARATOR_BONUS;
-
- /* apply bonus across camel case boundaries */
- if (prev_lower && nk_is_upper(str_letter))
- new_score += NK_CAMEL_BONUS;
-
- /* update pattern iter IFF the next pattern letter was matched */
- if (next_match)
- ++pattern_iter;
-
- /* update best letter in str which may be for a "next" letter or a rematch */
- if (new_score >= best_letter_score) {
- /* apply penalty for now skipped letter */
- if (best_letter != 0)
- score += NK_UNMATCHED_LETTER_PENALTY;
-
- best_letter = &str[str_iter];
- best_letter_score = new_score;
- }
- prev_matched = nk_true;
- } else {
- score += NK_UNMATCHED_LETTER_PENALTY;
- prev_matched = nk_false;
- }
-
- /* separators should be more easily defined */
- prev_lower = nk_is_lower(str_letter) != 0;
- prev_separator = str_letter == '_' || str_letter == ' ';
-
- ++str_iter;
- }
-
- /* apply score for last match */
- if (best_letter)
- score += best_letter_score;
-
- /* did not match full pattern */
- if (*pattern_iter != '\0')
- return nk_false;
-
- if (out_score)
- *out_score = score;
- return nk_true;
-}
-
-NK_API int
-nk_strmatch_fuzzy_string(char const *str, char const *pattern, int *out_score)
-{return nk_strmatch_fuzzy_text(str, nk_strlen(str), pattern, out_score);}
-
-NK_INTERN int
-nk_string_float_limit(char *string, int prec)
-{
- int dot = 0;
- char *c = string;
- while (*c) {
- if (*c == '.') {
- dot = 1;
- c++;
- continue;
- }
- if (dot == (prec+1)) {
- *c = 0;
- break;
- }
- if (dot > 0) dot++;
- c++;
- }
- return (int)(c - string);
-}
-
-NK_INTERN double
-nk_pow(double x, int n)
-{
- /* check the sign of n */
- double r = 1;
- int plus = n >= 0;
- n = (plus) ? n : -n;
- while (n > 0) {
- if ((n & 1) == 1)
- r *= x;
- n /= 2;
- x *= x;
- }
- return plus ? r : 1.0 / r;
-}
-
-NK_INTERN int
-nk_ifloord(double x)
-{
- x = (double)((int)x - ((x < 0.0) ? 1 : 0));
- return (int)x;
-}
-
-NK_INTERN int
-nk_ifloorf(float x)
-{
- x = (float)((int)x - ((x < 0.0f) ? 1 : 0));
- return (int)x;
-}
-
-NK_INTERN int
-nk_iceilf(float x)
-{
- if (x >= 0) {
- int i = (int)x;
- return (x > i) ? i+1: i;
- } else {
- int t = (int)x;
- float r = x - (float)t;
- return (r > 0.0f) ? t+1: t;
- }
-}
-
-NK_INTERN int
-nk_log10(double n)
-{
- int neg;
- int ret;
- int exp = 0;
-
- neg = (n < 0) ? 1 : 0;
- ret = (neg) ? (int)-n : (int)n;
- while ((ret / 10) > 0) {
- ret /= 10;
- exp++;
- }
- if (neg) exp = -exp;
- return exp;
-}
-
-NK_INTERN void
-nk_strrev_ascii(char *s)
-{
- int len = nk_strlen(s);
- int end = len / 2;
- int i = 0;
- char t;
- for (; i < end; ++i) {
- t = s[i];
- s[i] = s[len - 1 - i];
- s[len -1 - i] = t;
- }
-}
-
-NK_INTERN char*
-nk_itoa(char *s, long n)
-{
- long i = 0;
- if (n == 0) {
- s[i++] = '0';
- s[i] = 0;
- return s;
- }
- if (n < 0) {
- s[i++] = '-';
- n = -n;
- }
- while (n > 0) {
- s[i++] = (char)('0' + (n % 10));
- n /= 10;
- }
- s[i] = 0;
- if (s[0] == '-')
- ++s;
-
- nk_strrev_ascii(s);
- return s;
-}
-
-NK_INTERN char*
-nk_dtoa(char *s, double n)
-{
- int useExp = 0;
- int digit = 0, m = 0, m1 = 0;
- char *c = s;
- int neg = 0;
-
- NK_ASSERT(s);
- if (!s) return 0;
-
- if (n == 0.0) {
- s[0] = '0'; s[1] = '\0';
- return s;
- }
-
- neg = (n < 0);
- if (neg) n = -n;
-
- /* calculate magnitude */
- m = nk_log10(n);
- useExp = (m >= 14 || (neg && m >= 9) || m <= -9);
- if (neg) *(c++) = '-';
-
- /* set up for scientific notation */
- if (useExp) {
- if (m < 0)
- m -= 1;
- n = n / (double)nk_pow(10.0, m);
- m1 = m;
- m = 0;
- }
- if (m < 1.0) {
- m = 0;
- }
-
- /* convert the number */
- while (n > NK_FLOAT_PRECISION || m >= 0) {
- double weight = nk_pow(10.0, m);
- if (weight > 0) {
- double t = (double)n / weight;
- digit = nk_ifloord(t);
- n -= ((double)digit * weight);
- *(c++) = (char)('0' + (char)digit);
- }
- if (m == 0 && n > 0)
- *(c++) = '.';
- m--;
- }
-
- if (useExp) {
- /* convert the exponent */
- int i, j;
- *(c++) = 'e';
- if (m1 > 0) {
- *(c++) = '+';
- } else {
- *(c++) = '-';
- m1 = -m1;
- }
- m = 0;
- while (m1 > 0) {
- *(c++) = (char)('0' + (char)(m1 % 10));
- m1 /= 10;
- m++;
- }
- c -= m;
- for (i = 0, j = m-1; i<j; i++, j--) {
- /* swap without temporary */
- c[i] ^= c[j];
- c[j] ^= c[i];
- c[i] ^= c[j];
- }
- c += m;
- }
- *(c) = '\0';
- return s;
-}
-
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-#ifndef NK_INCLUDE_STANDARD_IO
-static int
-nk_vsnprintf(char *buf, int buf_size, const char *fmt, va_list args)
-{
- enum nk_arg_type {
- NK_ARG_TYPE_CHAR,
- NK_ARG_TYPE_SHORT,
- NK_ARG_TYPE_DEFAULT,
- NK_ARG_TYPE_LONG
- };
- enum nk_arg_flags {
- NK_ARG_FLAG_LEFT = 0x01,
- NK_ARG_FLAG_PLUS = 0x02,
- NK_ARG_FLAG_SPACE = 0x04,
- NK_ARG_FLAG_NUM = 0x10,
- NK_ARG_FLAG_ZERO = 0x20
- };
-
- char number_buffer[NK_MAX_NUMBER_BUFFER];
- enum nk_arg_type arg_type = NK_ARG_TYPE_DEFAULT;
- int precision = NK_DEFAULT;
- int width = NK_DEFAULT;
- nk_flags flag = 0;
-
- int len = 0;
- int result = -1;
- const char *iter = fmt;
-
- NK_ASSERT(buf);
- NK_ASSERT(buf_size);
- if (!buf || !buf_size || !fmt) return 0;
- for (iter = fmt; *iter && len < buf_size; iter++) {
- /* copy all non-format characters */
- while (*iter && (*iter != '%') && (len < buf_size))
- buf[len++] = *iter++;
- if (!(*iter) || len >= buf_size) break;
- iter++;
-
- /* flag arguments */
- while (*iter) {
- if (*iter == '-') flag |= NK_ARG_FLAG_LEFT;
- else if (*iter == '+') flag |= NK_ARG_FLAG_PLUS;
- else if (*iter == ' ') flag |= NK_ARG_FLAG_SPACE;
- else if (*iter == '#') flag |= NK_ARG_FLAG_NUM;
- else if (*iter == '0') flag |= NK_ARG_FLAG_ZERO;
- else break;
- iter++;
- }
-
- /* width argument */
- width = NK_DEFAULT;
- if (*iter >= '1' && *iter <= '9') {
- const char *end;
- width = nk_strtoi(iter, &end);
- if (end == iter)
- width = -1;
- else iter = end;
- } else if (*iter == '*') {
- width = va_arg(args, int);
- iter++;
- }
-
- /* precision argument */
- precision = NK_DEFAULT;
- if (*iter == '.') {
- iter++;
- if (*iter == '*') {
- precision = va_arg(args, int);
- iter++;
- } else {
- const char *end;
- precision = nk_strtoi(iter, &end);
- if (end == iter)
- precision = -1;
- else iter = end;
- }
- }
-
- /* length modifier */
- if (*iter == 'h') {
- if (*(iter+1) == 'h') {
- arg_type = NK_ARG_TYPE_CHAR;
- iter++;
- } else arg_type = NK_ARG_TYPE_SHORT;
- iter++;
- } else if (*iter == 'l') {
- arg_type = NK_ARG_TYPE_LONG;
- iter++;
- } else arg_type = NK_ARG_TYPE_DEFAULT;
-
- /* specifier */
- if (*iter == '%') {
- NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
- NK_ASSERT(precision == NK_DEFAULT);
- NK_ASSERT(width == NK_DEFAULT);
- if (len < buf_size)
- buf[len++] = '%';
- } else if (*iter == 's') {
- /* string */
- const char *str = va_arg(args, const char*);
- NK_ASSERT(str != buf && "buffer and argument are not allowed to overlap!");
- NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
- NK_ASSERT(precision == NK_DEFAULT);
- NK_ASSERT(width == NK_DEFAULT);
- if (str == buf) return -1;
- while (str && *str && len < buf_size)
- buf[len++] = *str++;
- } else if (*iter == 'n') {
- /* current length callback */
- signed int *n = va_arg(args, int*);
- NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
- NK_ASSERT(precision == NK_DEFAULT);
- NK_ASSERT(width == NK_DEFAULT);
- if (n) *n = len;
- } else if (*iter == 'c' || *iter == 'i' || *iter == 'd') {
- /* signed integer */
- long value = 0;
- const char *num_iter;
- int num_len, num_print, padding;
- int cur_precision = NK_MAX(precision, 1);
- int cur_width = NK_MAX(width, 0);
-
- /* retrieve correct value type */
- if (arg_type == NK_ARG_TYPE_CHAR)
- value = (signed char)va_arg(args, int);
- else if (arg_type == NK_ARG_TYPE_SHORT)
- value = (signed short)va_arg(args, int);
- else if (arg_type == NK_ARG_TYPE_LONG)
- value = va_arg(args, signed long);
- else if (*iter == 'c')
- value = (unsigned char)va_arg(args, int);
- else value = va_arg(args, signed int);
-
- /* convert number to string */
- nk_itoa(number_buffer, value);
- num_len = nk_strlen(number_buffer);
- padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0);
- if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE))
- padding = NK_MAX(padding-1, 0);
-
- /* fill left padding up to a total of `width` characters */
- if (!(flag & NK_ARG_FLAG_LEFT)) {
- while (padding-- > 0 && (len < buf_size)) {
- if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT))
- buf[len++] = '0';
- else buf[len++] = ' ';
- }
- }
-
- /* copy string value representation into buffer */
- if ((flag & NK_ARG_FLAG_PLUS) && value >= 0 && len < buf_size)
- buf[len++] = '+';
- else if ((flag & NK_ARG_FLAG_SPACE) && value >= 0 && len < buf_size)
- buf[len++] = ' ';
-
- /* fill up to precision number of digits with '0' */
- num_print = NK_MAX(cur_precision, num_len);
- while (precision && (num_print > num_len) && (len < buf_size)) {
- buf[len++] = '0';
- num_print--;
- }
-
- /* copy string value representation into buffer */
- num_iter = number_buffer;
- while (precision && *num_iter && len < buf_size)
- buf[len++] = *num_iter++;
-
- /* fill right padding up to width characters */
- if (flag & NK_ARG_FLAG_LEFT) {
- while ((padding-- > 0) && (len < buf_size))
- buf[len++] = ' ';
- }
- } else if (*iter == 'o' || *iter == 'x' || *iter == 'X' || *iter == 'u') {
- /* unsigned integer */
- unsigned long value = 0;
- int num_len = 0, num_print, padding = 0;
- int cur_precision = NK_MAX(precision, 1);
- int cur_width = NK_MAX(width, 0);
- unsigned int base = (*iter == 'o') ? 8: (*iter == 'u')? 10: 16;
-
- /* print oct/hex/dec value */
- const char *upper_output_format = "0123456789ABCDEF";
- const char *lower_output_format = "0123456789abcdef";
- const char *output_format = (*iter == 'x') ?
- lower_output_format: upper_output_format;
-
- /* retrieve correct value type */
- if (arg_type == NK_ARG_TYPE_CHAR)
- value = (unsigned char)va_arg(args, int);
- else if (arg_type == NK_ARG_TYPE_SHORT)
- value = (unsigned short)va_arg(args, int);
- else if (arg_type == NK_ARG_TYPE_LONG)
- value = va_arg(args, unsigned long);
- else value = va_arg(args, unsigned int);
-
- do {
- /* convert decimal number into hex/oct number */
- int digit = output_format[value % base];
- if (num_len < NK_MAX_NUMBER_BUFFER)
- number_buffer[num_len++] = (char)digit;
- value /= base;
- } while (value > 0);
-
- num_print = NK_MAX(cur_precision, num_len);
- padding = NK_MAX(cur_width - NK_MAX(cur_precision, num_len), 0);
- if (flag & NK_ARG_FLAG_NUM)
- padding = NK_MAX(padding-1, 0);
-
- /* fill left padding up to a total of `width` characters */
- if (!(flag & NK_ARG_FLAG_LEFT)) {
- while ((padding-- > 0) && (len < buf_size)) {
- if ((flag & NK_ARG_FLAG_ZERO) && (precision == NK_DEFAULT))
- buf[len++] = '0';
- else buf[len++] = ' ';
- }
- }
-
- /* fill up to precision number of digits */
- if (num_print && (flag & NK_ARG_FLAG_NUM)) {
- if ((*iter == 'o') && (len < buf_size)) {
- buf[len++] = '0';
- } else if ((*iter == 'x') && ((len+1) < buf_size)) {
- buf[len++] = '0';
- buf[len++] = 'x';
- } else if ((*iter == 'X') && ((len+1) < buf_size)) {
- buf[len++] = '0';
- buf[len++] = 'X';
- }
- }
- while (precision && (num_print > num_len) && (len < buf_size)) {
- buf[len++] = '0';
- num_print--;
- }
-
- /* reverse number direction */
- while (num_len > 0) {
- if (precision && (len < buf_size))
- buf[len++] = number_buffer[num_len-1];
- num_len--;
- }
-
- /* fill right padding up to width characters */
- if (flag & NK_ARG_FLAG_LEFT) {
- while ((padding-- > 0) && (len < buf_size))
- buf[len++] = ' ';
- }
- } else if (*iter == 'f') {
- /* floating point */
- const char *num_iter;
- int cur_precision = (precision < 0) ? 6: precision;
- int prefix, cur_width = NK_MAX(width, 0);
- double value = va_arg(args, double);
- int num_len = 0, frac_len = 0, dot = 0;
- int padding = 0;
-
- NK_ASSERT(arg_type == NK_ARG_TYPE_DEFAULT);
- NK_DTOA(number_buffer, value);
- num_len = nk_strlen(number_buffer);
-
- /* calculate padding */
- num_iter = number_buffer;
- while (*num_iter && *num_iter != '.')
- num_iter++;
-
- prefix = (*num_iter == '.')?(int)(num_iter - number_buffer)+1:0;
- padding = NK_MAX(cur_width - (prefix + NK_MIN(cur_precision, num_len - prefix)) , 0);
- if ((flag & NK_ARG_FLAG_PLUS) || (flag & NK_ARG_FLAG_SPACE))
- padding = NK_MAX(padding-1, 0);
-
- /* fill left padding up to a total of `width` characters */
- if (!(flag & NK_ARG_FLAG_LEFT)) {
- while (padding-- > 0 && (len < buf_size)) {
- if (flag & NK_ARG_FLAG_ZERO)
- buf[len++] = '0';
- else buf[len++] = ' ';
- }
- }
-
- /* copy string value representation into buffer */
- num_iter = number_buffer;
- if ((flag & NK_ARG_FLAG_PLUS) && (value >= 0) && (len < buf_size))
- buf[len++] = '+';
- else if ((flag & NK_ARG_FLAG_SPACE) && (value >= 0) && (len < buf_size))
- buf[len++] = ' ';
- while (*num_iter) {
- if (dot) frac_len++;
- if (len < buf_size)
- buf[len++] = *num_iter;
- if (*num_iter == '.') dot = 1;
- if (frac_len >= cur_precision) break;
- num_iter++;
- }
-
- /* fill number up to precision */
- while (frac_len < cur_precision) {
- if (!dot && len < buf_size) {
- buf[len++] = '.';
- dot = 1;
- }
- if (len < buf_size)
- buf[len++] = '0';
- frac_len++;
- }
-
- /* fill right padding up to width characters */
- if (flag & NK_ARG_FLAG_LEFT) {
- while ((padding-- > 0) && (len < buf_size))
- buf[len++] = ' ';
- }
- } else {
- /* Specifier not supported: g,G,e,E,p,z */
- NK_ASSERT(0 && "specifier is not supported!");
- return result;
- }
- }
- buf[(len >= buf_size)?(buf_size-1):len] = 0;
- result = (len >= buf_size)?-1:len;
- return result;
-}
-#endif
-
-NK_INTERN int
-nk_strfmt(char *buf, int buf_size, const char *fmt, va_list args)
-{
- int result = -1;
- NK_ASSERT(buf);
- NK_ASSERT(buf_size);
- if (!buf || !buf_size || !fmt) return 0;
-#ifdef NK_INCLUDE_STANDARD_IO
- result = NK_VSNPRINTF(buf, (nk_size)buf_size, fmt, args);
- result = (result >= buf_size) ? -1: result;
- buf[buf_size-1] = 0;
-#else
- result = nk_vsnprintf(buf, buf_size, fmt, args);
-#endif
- return result;
-}
-#endif
-
-NK_API nk_hash
-nk_murmur_hash(const void * key, int len, nk_hash seed)
-{
- /* 32-Bit MurmurHash3: https://code.google.com/p/smhasher/wiki/MurmurHash3*/
- #define NK_ROTL(x,r) ((x) << (r) | ((x) >> (32 - r)))
- union {const nk_uint *i; const nk_byte *b;} conv = {0};
- const nk_byte *data = (const nk_byte*)key;
- const int nblocks = len/4;
- nk_uint h1 = seed;
- const nk_uint c1 = 0xcc9e2d51;
- const nk_uint c2 = 0x1b873593;
- const nk_byte *tail;
- const nk_uint *blocks;
- nk_uint k1;
- int i;
-
- /* body */
- if (!key) return 0;
- conv.b = (data + nblocks*4);
- blocks = (const nk_uint*)conv.i;
- for (i = -nblocks; i; ++i) {
- k1 = blocks[i];
- k1 *= c1;
- k1 = NK_ROTL(k1,15);
- k1 *= c2;
-
- h1 ^= k1;
- h1 = NK_ROTL(h1,13);
- h1 = h1*5+0xe6546b64;
- }
-
- /* tail */
- tail = (const nk_byte*)(data + nblocks*4);
- k1 = 0;
- switch (len & 3) {
- case 3: k1 ^= (nk_uint)(tail[2] << 16); /* fallthrough */
- case 2: k1 ^= (nk_uint)(tail[1] << 8u); /* fallthrough */
- case 1: k1 ^= tail[0];
- k1 *= c1;
- k1 = NK_ROTL(k1,15);
- k1 *= c2;
- h1 ^= k1;
- break;
- default: break;
- }
-
- /* finalization */
- h1 ^= (nk_uint)len;
- /* fmix32 */
- h1 ^= h1 >> 16;
- h1 *= 0x85ebca6b;
- h1 ^= h1 >> 13;
- h1 *= 0xc2b2ae35;
- h1 ^= h1 >> 16;
-
- #undef NK_ROTL
- return h1;
-}
-
-#ifdef NK_INCLUDE_STANDARD_IO
-NK_INTERN char*
-nk_file_load(const char* path, nk_size* siz, struct nk_allocator *alloc)
-{
- char *buf;
- FILE *fd;
- long ret;
-
- NK_ASSERT(path);
- NK_ASSERT(siz);
- NK_ASSERT(alloc);
- if (!path || !siz || !alloc)
- return 0;
-
- fd = fopen(path, "rb");
- if (!fd) return 0;
- fseek(fd, 0, SEEK_END);
- ret = ftell(fd);
- if (ret < 0) {
- fclose(fd);
- return 0;
- }
- *siz = (nk_size)ret;
- fseek(fd, 0, SEEK_SET);
- buf = (char*)alloc->alloc(alloc->userdata,0, *siz);
- NK_ASSERT(buf);
- if (!buf) {
- fclose(fd);
- return 0;
- }
- *siz = (nk_size)fread(buf, 1,*siz, fd);
- fclose(fd);
- return buf;
-}
-#endif
-
-/*
- * ==============================================================
- *
- * COLOR
- *
- * ===============================================================
- */
-NK_INTERN int
-nk_parse_hex(const char *p, int length)
-{
- int i = 0;
- int len = 0;
- while (len < length) {
- i <<= 4;
- if (p[len] >= 'a' && p[len] <= 'f')
- i += ((p[len] - 'a') + 10);
- else if (p[len] >= 'A' && p[len] <= 'F')
- i += ((p[len] - 'A') + 10);
- else i += (p[len] - '0');
- len++;
- }
- return i;
-}
-
-NK_API struct nk_color
-nk_rgba(int r, int g, int b, int a)
-{
- struct nk_color ret;
- ret.r = (nk_byte)NK_CLAMP(0, r, 255);
- ret.g = (nk_byte)NK_CLAMP(0, g, 255);
- ret.b = (nk_byte)NK_CLAMP(0, b, 255);
- ret.a = (nk_byte)NK_CLAMP(0, a, 255);
- return ret;
-}
-
-NK_API struct nk_color
-nk_rgb_hex(const char *rgb)
-{
- struct nk_color col;
- const char *c = rgb;
- if (*c == '#') c++;
- col.r = (nk_byte)nk_parse_hex(c, 2);
- col.g = (nk_byte)nk_parse_hex(c+2, 2);
- col.b = (nk_byte)nk_parse_hex(c+4, 2);
- col.a = 255;
- return col;
-}
-
-NK_API struct nk_color
-nk_rgba_hex(const char *rgb)
-{
- struct nk_color col;
- const char *c = rgb;
- if (*c == '#') c++;
- col.r = (nk_byte)nk_parse_hex(c, 2);
- col.g = (nk_byte)nk_parse_hex(c+2, 2);
- col.b = (nk_byte)nk_parse_hex(c+4, 2);
- col.a = (nk_byte)nk_parse_hex(c+6, 2);
- return col;
-}
-
-NK_API void
-nk_color_hex_rgba(char *output, struct nk_color col)
-{
- #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i))
- output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4);
- output[1] = (char)NK_TO_HEX((col.r & 0x0F));
- output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4);
- output[3] = (char)NK_TO_HEX((col.g & 0x0F));
- output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4);
- output[5] = (char)NK_TO_HEX((col.b & 0x0F));
- output[6] = (char)NK_TO_HEX((col.a & 0xF0) >> 4);
- output[7] = (char)NK_TO_HEX((col.a & 0x0F));
- output[8] = '\0';
- #undef NK_TO_HEX
-}
-
-NK_API void
-nk_color_hex_rgb(char *output, struct nk_color col)
-{
- #define NK_TO_HEX(i) ((i) <= 9 ? '0' + (i): 'A' - 10 + (i))
- output[0] = (char)NK_TO_HEX((col.r & 0xF0) >> 4);
- output[1] = (char)NK_TO_HEX((col.r & 0x0F));
- output[2] = (char)NK_TO_HEX((col.g & 0xF0) >> 4);
- output[3] = (char)NK_TO_HEX((col.g & 0x0F));
- output[4] = (char)NK_TO_HEX((col.b & 0xF0) >> 4);
- output[5] = (char)NK_TO_HEX((col.b & 0x0F));
- output[6] = '\0';
- #undef NK_TO_HEX
-}
-
-NK_API struct nk_color
-nk_rgba_iv(const int *c)
-{
- return nk_rgba(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_color
-nk_rgba_bv(const nk_byte *c)
-{
- return nk_rgba(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_color
-nk_rgb(int r, int g, int b)
-{
- struct nk_color ret;
- ret.r = (nk_byte)NK_CLAMP(0, r, 255);
- ret.g = (nk_byte)NK_CLAMP(0, g, 255);
- ret.b = (nk_byte)NK_CLAMP(0, b, 255);
- ret.a = (nk_byte)255;
- return ret;
-}
-
-NK_API struct nk_color
-nk_rgb_iv(const int *c)
-{
- return nk_rgb(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_rgb_bv(const nk_byte* c)
-{
- return nk_rgb(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_rgba_u32(nk_uint in)
-{
- struct nk_color ret;
- ret.r = (in & 0xFF);
- ret.g = ((in >> 8) & 0xFF);
- ret.b = ((in >> 16) & 0xFF);
- ret.a = (nk_byte)((in >> 24) & 0xFF);
- return ret;
-}
-
-NK_API struct nk_color
-nk_rgba_f(float r, float g, float b, float a)
-{
- struct nk_color ret;
- ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f);
- ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f);
- ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f);
- ret.a = (nk_byte)(NK_SATURATE(a) * 255.0f);
- return ret;
-}
-
-NK_API struct nk_color
-nk_rgba_fv(const float *c)
-{
- return nk_rgba_f(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_color
-nk_rgba_cf(struct nk_colorf c)
-{
- return nk_rgba_f(c.r, c.g, c.b, c.a);
-}
-
-NK_API struct nk_color
-nk_rgb_f(float r, float g, float b)
-{
- struct nk_color ret;
- ret.r = (nk_byte)(NK_SATURATE(r) * 255.0f);
- ret.g = (nk_byte)(NK_SATURATE(g) * 255.0f);
- ret.b = (nk_byte)(NK_SATURATE(b) * 255.0f);
- ret.a = 255;
- return ret;
-}
-
-NK_API struct nk_color
-nk_rgb_fv(const float *c)
-{
- return nk_rgb_f(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_rgb_cf(struct nk_colorf c)
-{
- return nk_rgb_f(c.r, c.g, c.b);
-}
-
-NK_API struct nk_color
-nk_hsv(int h, int s, int v)
-{
- return nk_hsva(h, s, v, 255);
-}
-
-NK_API struct nk_color
-nk_hsv_iv(const int *c)
-{
- return nk_hsv(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_hsv_bv(const nk_byte *c)
-{
- return nk_hsv(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_hsv_f(float h, float s, float v)
-{
- return nk_hsva_f(h, s, v, 1.0f);
-}
-
-NK_API struct nk_color
-nk_hsv_fv(const float *c)
-{
- return nk_hsv_f(c[0], c[1], c[2]);
-}
-
-NK_API struct nk_color
-nk_hsva(int h, int s, int v, int a)
-{
- float hf = ((float)NK_CLAMP(0, h, 255)) / 255.0f;
- float sf = ((float)NK_CLAMP(0, s, 255)) / 255.0f;
- float vf = ((float)NK_CLAMP(0, v, 255)) / 255.0f;
- float af = ((float)NK_CLAMP(0, a, 255)) / 255.0f;
- return nk_hsva_f(hf, sf, vf, af);
-}
-
-NK_API struct nk_color
-nk_hsva_iv(const int *c)
-{
- return nk_hsva(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_color
-nk_hsva_bv(const nk_byte *c)
-{
- return nk_hsva(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_colorf
-nk_hsva_colorf(float h, float s, float v, float a)
-{
- int i;
- float p, q, t, f;
- struct nk_colorf out = {0,0,0,0};
- if (s <= 0.0f) {
- out.r = v; out.g = v; out.b = v; out.a = a;
- return out;
- }
- h = h / (60.0f/360.0f);
- i = (int)h;
- f = h - (float)i;
- p = v * (1.0f - s);
- q = v * (1.0f - (s * f));
- t = v * (1.0f - s * (1.0f - f));
-
- switch (i) {
- case 0: default: out.r = v; out.g = t; out.b = p; break;
- case 1: out.r = q; out.g = v; out.b = p; break;
- case 2: out.r = p; out.g = v; out.b = t; break;
- case 3: out.r = p; out.g = q; out.b = v; break;
- case 4: out.r = t; out.g = p; out.b = v; break;
- case 5: out.r = v; out.g = p; out.b = q; break;}
- out.a = a;
- return out;
-}
-
-NK_API struct nk_colorf
-nk_hsva_colorfv(float *c)
-{
- return nk_hsva_colorf(c[0], c[1], c[2], c[3]);
-}
-
-NK_API struct nk_color
-nk_hsva_f(float h, float s, float v, float a)
-{
- struct nk_colorf c = nk_hsva_colorf(h, s, v, a);
- return nk_rgba_f(c.r, c.g, c.b, c.a);
-}
-
-NK_API struct nk_color
-nk_hsva_fv(const float *c)
-{
- return nk_hsva_f(c[0], c[1], c[2], c[3]);
-}
-
-NK_API nk_uint
-nk_color_u32(struct nk_color in)
-{
- nk_uint out = (nk_uint)in.r;
- out |= ((nk_uint)in.g << 8);
- out |= ((nk_uint)in.b << 16);
- out |= ((nk_uint)in.a << 24);
- return out;
-}
-
-NK_API void
-nk_color_f(float *r, float *g, float *b, float *a, struct nk_color in)
-{
- NK_STORAGE const float s = 1.0f/255.0f;
- *r = (float)in.r * s;
- *g = (float)in.g * s;
- *b = (float)in.b * s;
- *a = (float)in.a * s;
-}
-
-NK_API void
-nk_color_fv(float *c, struct nk_color in)
-{
- nk_color_f(&c[0], &c[1], &c[2], &c[3], in);
-}
-
-NK_API struct nk_colorf
-nk_color_cf(struct nk_color in)
-{
- struct nk_colorf o;
- nk_color_f(&o.r, &o.g, &o.b, &o.a, in);
- return o;
-}
-
-NK_API void
-nk_color_d(double *r, double *g, double *b, double *a, struct nk_color in)
-{
- NK_STORAGE const double s = 1.0/255.0;
- *r = (double)in.r * s;
- *g = (double)in.g * s;
- *b = (double)in.b * s;
- *a = (double)in.a * s;
-}
-
-NK_API void
-nk_color_dv(double *c, struct nk_color in)
-{
- nk_color_d(&c[0], &c[1], &c[2], &c[3], in);
-}
-
-NK_API void
-nk_color_hsv_f(float *out_h, float *out_s, float *out_v, struct nk_color in)
-{
- float a;
- nk_color_hsva_f(out_h, out_s, out_v, &a, in);
-}
-
-NK_API void
-nk_color_hsv_fv(float *out, struct nk_color in)
-{
- float a;
- nk_color_hsva_f(&out[0], &out[1], &out[2], &a, in);
-}
-
-NK_API void
-nk_colorf_hsva_f(float *out_h, float *out_s,
- float *out_v, float *out_a, struct nk_colorf in)
-{
- float chroma;
- float K = 0.0f;
- if (in.g < in.b) {
- const float t = in.g; in.g = in.b; in.b = t;
- K = -1.f;
- }
- if (in.r < in.g) {
- const float t = in.r; in.r = in.g; in.g = t;
- K = -2.f/6.0f - K;
- }
- chroma = in.r - ((in.g < in.b) ? in.g: in.b);
- *out_h = NK_ABS(K + (in.g - in.b)/(6.0f * chroma + 1e-20f));
- *out_s = chroma / (in.r + 1e-20f);
- *out_v = in.r;
- *out_a = in.a;
-
-}
-
-NK_API void
-nk_colorf_hsva_fv(float *hsva, struct nk_colorf in)
-{
- nk_colorf_hsva_f(&hsva[0], &hsva[1], &hsva[2], &hsva[3], in);
-}
-NK_API void
-nk_color_hsva_f(float *out_h, float *out_s,
- float *out_v, float *out_a, struct nk_color in)
-{
- struct nk_colorf col;
- nk_color_f(&col.r,&col.g,&col.b,&col.a, in);
- nk_colorf_hsva_f(out_h, out_s, out_v, out_a, col);
-}
-
-NK_API void
-nk_color_hsva_fv(float *out, struct nk_color in)
-{
- nk_color_hsva_f(&out[0], &out[1], &out[2], &out[3], in);
-}
-
-NK_API void
-nk_color_hsva_i(int *out_h, int *out_s, int *out_v,
- int *out_a, struct nk_color in)
-{
- float h,s,v,a;
- nk_color_hsva_f(&h, &s, &v, &a, in);
- *out_h = (nk_byte)(h * 255.0f);
- *out_s = (nk_byte)(s * 255.0f);
- *out_v = (nk_byte)(v * 255.0f);
- *out_a = (nk_byte)(a * 255.0f);
-}
-
-NK_API void
-nk_color_hsva_iv(int *out, struct nk_color in)
-{
- nk_color_hsva_i(&out[0], &out[1], &out[2], &out[3], in);
-}
-
-NK_API void
-nk_color_hsva_bv(nk_byte *out, struct nk_color in)
-{
- int tmp[4];
- nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
- out[0] = (nk_byte)tmp[0];
- out[1] = (nk_byte)tmp[1];
- out[2] = (nk_byte)tmp[2];
- out[3] = (nk_byte)tmp[3];
-}
-
-NK_API void
-nk_color_hsva_b(nk_byte *h, nk_byte *s, nk_byte *v, nk_byte *a, struct nk_color in)
-{
- int tmp[4];
- nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
- *h = (nk_byte)tmp[0];
- *s = (nk_byte)tmp[1];
- *v = (nk_byte)tmp[2];
- *a = (nk_byte)tmp[3];
-}
-
-NK_API void
-nk_color_hsv_i(int *out_h, int *out_s, int *out_v, struct nk_color in)
-{
- int a;
- nk_color_hsva_i(out_h, out_s, out_v, &a, in);
-}
-
-NK_API void
-nk_color_hsv_b(nk_byte *out_h, nk_byte *out_s, nk_byte *out_v, struct nk_color in)
-{
- int tmp[4];
- nk_color_hsva_i(&tmp[0], &tmp[1], &tmp[2], &tmp[3], in);
- *out_h = (nk_byte)tmp[0];
- *out_s = (nk_byte)tmp[1];
- *out_v = (nk_byte)tmp[2];
-}
-
-NK_API void
-nk_color_hsv_iv(int *out, struct nk_color in)
-{
- nk_color_hsv_i(&out[0], &out[1], &out[2], in);
-}
-
-NK_API void
-nk_color_hsv_bv(nk_byte *out, struct nk_color in)
-{
- int tmp[4];
- nk_color_hsv_i(&tmp[0], &tmp[1], &tmp[2], in);
- out[0] = (nk_byte)tmp[0];
- out[1] = (nk_byte)tmp[1];
- out[2] = (nk_byte)tmp[2];
-}
-/*
- * ==============================================================
- *
- * IMAGE
- *
- * ===============================================================
- */
-NK_API nk_handle
-nk_handle_ptr(void *ptr)
-{
- nk_handle handle = {0};
- handle.ptr = ptr;
- return handle;
-}
-
-NK_API nk_handle
-nk_handle_id(int id)
-{
- nk_handle handle;
- nk_zero_struct(handle);
- handle.id = id;
- return handle;
-}
-
-NK_API struct nk_image
-nk_subimage_ptr(void *ptr, unsigned short w, unsigned short h, struct nk_rect r)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.ptr = ptr;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
-}
-
-NK_API struct nk_image
-nk_subimage_id(int id, unsigned short w, unsigned short h, struct nk_rect r)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.id = id;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
-}
-
-NK_API struct nk_image
-nk_subimage_handle(nk_handle handle, unsigned short w, unsigned short h,
- struct nk_rect r)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle = handle;
- s.w = w; s.h = h;
- s.region[0] = (unsigned short)r.x;
- s.region[1] = (unsigned short)r.y;
- s.region[2] = (unsigned short)r.w;
- s.region[3] = (unsigned short)r.h;
- return s;
-}
-
-NK_API struct nk_image
-nk_image_handle(nk_handle handle)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle = handle;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
-}
-
-NK_API struct nk_image
-nk_image_ptr(void *ptr)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- NK_ASSERT(ptr);
- s.handle.ptr = ptr;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
-}
-
-NK_API struct nk_image
-nk_image_id(int id)
-{
- struct nk_image s;
- nk_zero(&s, sizeof(s));
- s.handle.id = id;
- s.w = 0; s.h = 0;
- s.region[0] = 0;
- s.region[1] = 0;
- s.region[2] = 0;
- s.region[3] = 0;
- return s;
-}
-
-NK_API int
-nk_image_is_subimage(const struct nk_image* img)
-{
- NK_ASSERT(img);
- return !(img->w == 0 && img->h == 0);
-}
-
-NK_INTERN void
-nk_unify(struct nk_rect *clip, const struct nk_rect *a, float x0, float y0,
- float x1, float y1)
-{
- NK_ASSERT(a);
- NK_ASSERT(clip);
- clip->x = NK_MAX(a->x, x0);
- clip->y = NK_MAX(a->y, y0);
- clip->w = NK_MIN(a->x + a->w, x1) - clip->x;
- clip->h = NK_MIN(a->y + a->h, y1) - clip->y;
- clip->w = NK_MAX(0, clip->w);
- clip->h = NK_MAX(0, clip->h);
-}
-
-NK_API void
-nk_triangle_from_direction(struct nk_vec2 *result, struct nk_rect r,
- float pad_x, float pad_y, enum nk_heading direction)
-{
- float w_half, h_half;
- NK_ASSERT(result);
-
- r.w = NK_MAX(2 * pad_x, r.w);
- r.h = NK_MAX(2 * pad_y, r.h);
- r.w = r.w - 2 * pad_x;
- r.h = r.h - 2 * pad_y;
-
- r.x = r.x + pad_x;
- r.y = r.y + pad_y;
-
- w_half = r.w / 2.0f;
- h_half = r.h / 2.0f;
-
- if (direction == NK_UP) {
- result[0] = nk_vec2(r.x + w_half, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y + r.h);
- result[2] = nk_vec2(r.x, r.y + r.h);
- } else if (direction == NK_RIGHT) {
- result[0] = nk_vec2(r.x, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y + h_half);
- result[2] = nk_vec2(r.x, r.y + r.h);
- } else if (direction == NK_DOWN) {
- result[0] = nk_vec2(r.x, r.y);
- result[1] = nk_vec2(r.x + r.w, r.y);
- result[2] = nk_vec2(r.x + w_half, r.y + r.h);
- } else {
- result[0] = nk_vec2(r.x, r.y + h_half);
- result[1] = nk_vec2(r.x + r.w, r.y);
- result[2] = nk_vec2(r.x + r.w, r.y + r.h);
- }
-}
-
-NK_INTERN int
-nk_text_clamp(const struct nk_user_font *font, const char *text,
- int text_len, float space, int *glyphs, float *text_width,
- nk_rune *sep_list, int sep_count)
-{
- int i = 0;
- int glyph_len = 0;
- float last_width = 0;
- nk_rune unicode = 0;
- float width = 0;
- int len = 0;
- int g = 0;
- float s;
-
- int sep_len = 0;
- int sep_g = 0;
- float sep_width = 0;
- sep_count = NK_MAX(sep_count,0);
-
- glyph_len = nk_utf_decode(text, &unicode, text_len);
- while (glyph_len && (width < space) && (len < text_len)) {
- len += glyph_len;
- s = font->width(font->userdata, font->height, text, len);
- for (i = 0; i < sep_count; ++i) {
- if (unicode != sep_list[i]) continue;
- sep_width = last_width = width;
- sep_g = g+1;
- sep_len = len;
- break;
- }
- if (i == sep_count){
- last_width = sep_width = width;
- sep_g = g+1;
- }
- width = s;
- glyph_len = nk_utf_decode(&text[len], &unicode, text_len - len);
- g++;
- }
- if (len >= text_len) {
- *glyphs = g;
- *text_width = last_width;
- return len;
- } else {
- *glyphs = sep_g;
- *text_width = sep_width;
- return (!sep_len) ? len: sep_len;
- }
-}
-
-enum {NK_DO_NOT_STOP_ON_NEW_LINE, NK_STOP_ON_NEW_LINE};
-NK_INTERN struct nk_vec2
-nk_text_calculate_text_bounds(const struct nk_user_font *font,
- const char *begin, int byte_len, float row_height, const char **remaining,
- struct nk_vec2 *out_offset, int *glyphs, int op)
-{
- float line_height = row_height;
- struct nk_vec2 text_size = nk_vec2(0,0);
- float line_width = 0.0f;
-
- float glyph_width;
- int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- if (!begin || byte_len <= 0 || !font)
- return nk_vec2(0,row_height);
-
- glyph_len = nk_utf_decode(begin, &unicode, byte_len);
- if (!glyph_len) return text_size;
- glyph_width = font->width(font->userdata, font->height, begin, glyph_len);
-
- *glyphs = 0;
- while ((text_len < byte_len) && glyph_len) {
- if (unicode == '\n') {
- text_size.x = NK_MAX(text_size.x, line_width);
- text_size.y += line_height;
- line_width = 0;
- *glyphs+=1;
- if (op == NK_STOP_ON_NEW_LINE)
- break;
-
- text_len++;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- continue;
- }
-
- if (unicode == '\r') {
- text_len++;
- *glyphs+=1;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- continue;
- }
-
- *glyphs = *glyphs + 1;
- text_len += glyph_len;
- line_width += (float)glyph_width;
- glyph_len = nk_utf_decode(begin + text_len, &unicode, byte_len-text_len);
- glyph_width = font->width(font->userdata, font->height, begin+text_len, glyph_len);
- continue;
- }
-
- if (text_size.x < line_width)
- text_size.x = line_width;
- if (out_offset)
- *out_offset = nk_vec2(line_width, text_size.y + line_height);
- if (line_width > 0 || text_size.y == 0.0f)
- text_size.y += line_height;
- if (remaining)
- *remaining = begin+text_len;
- return text_size;
-}
-
-/* ==============================================================
- *
- * UTF-8
- *
- * ===============================================================*/
-NK_GLOBAL const nk_byte nk_utfbyte[NK_UTF_SIZE+1] = {0x80, 0, 0xC0, 0xE0, 0xF0};
-NK_GLOBAL const nk_byte nk_utfmask[NK_UTF_SIZE+1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8};
-NK_GLOBAL const nk_uint nk_utfmin[NK_UTF_SIZE+1] = {0, 0, 0x80, 0x800, 0x10000};
-NK_GLOBAL const nk_uint nk_utfmax[NK_UTF_SIZE+1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF};
-
-NK_INTERN int
-nk_utf_validate(nk_rune *u, int i)
-{
- NK_ASSERT(u);
- if (!u) return 0;
- if (!NK_BETWEEN(*u, nk_utfmin[i], nk_utfmax[i]) ||
- NK_BETWEEN(*u, 0xD800, 0xDFFF))
- *u = NK_UTF_INVALID;
- for (i = 1; *u > nk_utfmax[i]; ++i);
- return i;
-}
-
-NK_INTERN nk_rune
-nk_utf_decode_byte(char c, int *i)
-{
- NK_ASSERT(i);
- if (!i) return 0;
- for(*i = 0; *i < (int)NK_LEN(nk_utfmask); ++(*i)) {
- if (((nk_byte)c & nk_utfmask[*i]) == nk_utfbyte[*i])
- return (nk_byte)(c & ~nk_utfmask[*i]);
- }
- return 0;
-}
-
-NK_API int
-nk_utf_decode(const char *c, nk_rune *u, int clen)
-{
- int i, j, len, type=0;
- nk_rune udecoded;
-
- NK_ASSERT(c);
- NK_ASSERT(u);
-
- if (!c || !u) return 0;
- if (!clen) return 0;
- *u = NK_UTF_INVALID;
-
- udecoded = nk_utf_decode_byte(c[0], &len);
- if (!NK_BETWEEN(len, 1, NK_UTF_SIZE))
- return 1;
-
- for (i = 1, j = 1; i < clen && j < len; ++i, ++j) {
- udecoded = (udecoded << 6) | nk_utf_decode_byte(c[i], &type);
- if (type != 0)
- return j;
- }
- if (j < len)
- return 0;
- *u = udecoded;
- nk_utf_validate(u, len);
- return len;
-}
-
-NK_INTERN char
-nk_utf_encode_byte(nk_rune u, int i)
-{
- return (char)((nk_utfbyte[i]) | ((nk_byte)u & ~nk_utfmask[i]));
-}
-
-NK_API int
-nk_utf_encode(nk_rune u, char *c, int clen)
-{
- int len, i;
- len = nk_utf_validate(&u, 0);
- if (clen < len || !len || len > NK_UTF_SIZE)
- return 0;
-
- for (i = len - 1; i != 0; --i) {
- c[i] = nk_utf_encode_byte(u, 0);
- u >>= 6;
- }
- c[0] = nk_utf_encode_byte(u, len);
- return len;
-}
-
-NK_API int
-nk_utf_len(const char *str, int len)
-{
- const char *text;
- int glyphs = 0;
- int text_len;
- int glyph_len;
- int src_len = 0;
- nk_rune unicode;
-
- NK_ASSERT(str);
- if (!str || !len) return 0;
-
- text = str;
- text_len = len;
- glyph_len = nk_utf_decode(text, &unicode, text_len);
- while (glyph_len && src_len < len) {
- glyphs++;
- src_len = src_len + glyph_len;
- glyph_len = nk_utf_decode(text + src_len, &unicode, text_len - src_len);
- }
- return glyphs;
-}
-
-NK_API const char*
-nk_utf_at(const char *buffer, int length, int index,
- nk_rune *unicode, int *len)
-{
- int i = 0;
- int src_len = 0;
- int glyph_len = 0;
- const char *text;
- int text_len;
-
- NK_ASSERT(buffer);
- NK_ASSERT(unicode);
- NK_ASSERT(len);
-
- if (!buffer || !unicode || !len) return 0;
- if (index < 0) {
- *unicode = NK_UTF_INVALID;
- *len = 0;
- return 0;
- }
-
- text = buffer;
- text_len = length;
- glyph_len = nk_utf_decode(text, unicode, text_len);
- while (glyph_len) {
- if (i == index) {
- *len = glyph_len;
- break;
- }
-
- i++;
- src_len = src_len + glyph_len;
- glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
- }
- if (i != index) return 0;
- return buffer + src_len;
-}
-
-/* ==============================================================
- *
- * BUFFER
- *
- * ===============================================================*/
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_INTERN void* nk_malloc(nk_handle unused, void *old,nk_size size)
-{NK_UNUSED(unused); NK_UNUSED(old); return malloc(size);}
-NK_INTERN void nk_mfree(nk_handle unused, void *ptr)
-{NK_UNUSED(unused); free(ptr);}
-
-NK_API void
-nk_buffer_init_default(struct nk_buffer *buffer)
-{
- struct nk_allocator alloc;
- alloc.userdata.ptr = 0;
- alloc.alloc = nk_malloc;
- alloc.free = nk_mfree;
- nk_buffer_init(buffer, &alloc, NK_BUFFER_DEFAULT_INITIAL_SIZE);
-}
-#endif
-
-NK_API void
-nk_buffer_init(struct nk_buffer *b, const struct nk_allocator *a,
- nk_size initial_size)
-{
- NK_ASSERT(b);
- NK_ASSERT(a);
- NK_ASSERT(initial_size);
- if (!b || !a || !initial_size) return;
-
- nk_zero(b, sizeof(*b));
- b->type = NK_BUFFER_DYNAMIC;
- b->memory.ptr = a->alloc(a->userdata,0, initial_size);
- b->memory.size = initial_size;
- b->size = initial_size;
- b->grow_factor = 2.0f;
- b->pool = *a;
-}
-
-NK_API void
-nk_buffer_init_fixed(struct nk_buffer *b, void *m, nk_size size)
-{
- NK_ASSERT(b);
- NK_ASSERT(m);
- NK_ASSERT(size);
- if (!b || !m || !size) return;
-
- nk_zero(b, sizeof(*b));
- b->type = NK_BUFFER_FIXED;
- b->memory.ptr = m;
- b->memory.size = size;
- b->size = size;
-}
-
-NK_INTERN void*
-nk_buffer_align(void *unaligned, nk_size align, nk_size *alignment,
- enum nk_buffer_allocation_type type)
-{
- void *memory = 0;
- switch (type) {
- default:
- case NK_BUFFER_MAX:
- case NK_BUFFER_FRONT:
- if (align) {
- memory = NK_ALIGN_PTR(unaligned, align);
- *alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
- } else {
- memory = unaligned;
- *alignment = 0;
- }
- break;
- case NK_BUFFER_BACK:
- if (align) {
- memory = NK_ALIGN_PTR_BACK(unaligned, align);
- *alignment = (nk_size)((nk_byte*)unaligned - (nk_byte*)memory);
- } else {
- memory = unaligned;
- *alignment = 0;
- }
- break;
- }
- return memory;
-}
-
-NK_INTERN void*
-nk_buffer_realloc(struct nk_buffer *b, nk_size capacity, nk_size *size)
-{
- void *temp;
- nk_size buffer_size;
-
- NK_ASSERT(b);
- NK_ASSERT(size);
- if (!b || !size || !b->pool.alloc || !b->pool.free)
- return 0;
-
- buffer_size = b->memory.size;
- temp = b->pool.alloc(b->pool.userdata, b->memory.ptr, capacity);
- NK_ASSERT(temp);
- if (!temp) return 0;
-
- *size = capacity;
- if (temp != b->memory.ptr) {
- NK_MEMCPY(temp, b->memory.ptr, buffer_size);
- b->pool.free(b->pool.userdata, b->memory.ptr);
- }
-
- if (b->size == buffer_size) {
- /* no back buffer so just set correct size */
- b->size = capacity;
- return temp;
- } else {
- /* copy back buffer to the end of the new buffer */
- void *dst, *src;
- nk_size back_size;
- back_size = buffer_size - b->size;
- dst = nk_ptr_add(void, temp, capacity - back_size);
- src = nk_ptr_add(void, temp, b->size);
- NK_MEMCPY(dst, src, back_size);
- b->size = capacity - back_size;
- }
- return temp;
-}
-
-NK_INTERN void*
-nk_buffer_alloc(struct nk_buffer *b, enum nk_buffer_allocation_type type,
- nk_size size, nk_size align)
-{
- int full;
- nk_size alignment;
- void *unaligned;
- void *memory;
-
- NK_ASSERT(b);
- NK_ASSERT(size);
- if (!b || !size) return 0;
- b->needed += size;
-
- /* calculate total size with needed alignment + size */
- if (type == NK_BUFFER_FRONT)
- unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated);
- else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size);
- memory = nk_buffer_align(unaligned, align, &alignment, type);
-
- /* check if buffer has enough memory*/
- if (type == NK_BUFFER_FRONT)
- full = ((b->allocated + size + alignment) > b->size);
- else full = ((b->size - NK_MIN(b->size,(size + alignment))) <= b->allocated);
-
- if (full) {
- nk_size capacity;
- if (b->type != NK_BUFFER_DYNAMIC)
- return 0;
- NK_ASSERT(b->pool.alloc && b->pool.free);
- if (b->type != NK_BUFFER_DYNAMIC || !b->pool.alloc || !b->pool.free)
- return 0;
-
- /* buffer is full so allocate bigger buffer if dynamic */
- capacity = (nk_size)((float)b->memory.size * b->grow_factor);
- capacity = NK_MAX(capacity, nk_round_up_pow2((nk_uint)(b->allocated + size)));
- b->memory.ptr = nk_buffer_realloc(b, capacity, &b->memory.size);
- if (!b->memory.ptr) return 0;
-
- /* align newly allocated pointer */
- if (type == NK_BUFFER_FRONT)
- unaligned = nk_ptr_add(void, b->memory.ptr, b->allocated);
- else unaligned = nk_ptr_add(void, b->memory.ptr, b->size - size);
- memory = nk_buffer_align(unaligned, align, &alignment, type);
- }
- if (type == NK_BUFFER_FRONT)
- b->allocated += size + alignment;
- else b->size -= (size + alignment);
- b->needed += alignment;
- b->calls++;
- return memory;
-}
-
-NK_API void
-nk_buffer_push(struct nk_buffer *b, enum nk_buffer_allocation_type type,
- const void *memory, nk_size size, nk_size align)
-{
- void *mem = nk_buffer_alloc(b, type, size, align);
- if (!mem) return;
- NK_MEMCPY(mem, memory, size);
-}
-
-NK_API void
-nk_buffer_mark(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
-{
- NK_ASSERT(buffer);
- if (!buffer) return;
- buffer->marker[type].active = nk_true;
- if (type == NK_BUFFER_BACK)
- buffer->marker[type].offset = buffer->size;
- else buffer->marker[type].offset = buffer->allocated;
-}
-
-NK_API void
-nk_buffer_reset(struct nk_buffer *buffer, enum nk_buffer_allocation_type type)
-{
- NK_ASSERT(buffer);
- if (!buffer) return;
- if (type == NK_BUFFER_BACK) {
- /* reset back buffer either back to marker or empty */
- buffer->needed -= (buffer->memory.size - buffer->marker[type].offset);
- if (buffer->marker[type].active)
- buffer->size = buffer->marker[type].offset;
- else buffer->size = buffer->memory.size;
- buffer->marker[type].active = nk_false;
- } else {
- /* reset front buffer either back to back marker or empty */
- buffer->needed -= (buffer->allocated - buffer->marker[type].offset);
- if (buffer->marker[type].active)
- buffer->allocated = buffer->marker[type].offset;
- else buffer->allocated = 0;
- buffer->marker[type].active = nk_false;
- }
-}
-
-NK_API void
-nk_buffer_clear(struct nk_buffer *b)
-{
- NK_ASSERT(b);
- if (!b) return;
- b->allocated = 0;
- b->size = b->memory.size;
- b->calls = 0;
- b->needed = 0;
-}
-
-NK_API void
-nk_buffer_free(struct nk_buffer *b)
-{
- NK_ASSERT(b);
- if (!b || !b->memory.ptr) return;
- if (b->type == NK_BUFFER_FIXED) return;
- if (!b->pool.free) return;
- NK_ASSERT(b->pool.free);
- b->pool.free(b->pool.userdata, b->memory.ptr);
-}
-
-NK_API void
-nk_buffer_info(struct nk_memory_status *s, struct nk_buffer *b)
-{
- NK_ASSERT(b);
- NK_ASSERT(s);
- if (!s || !b) return;
- s->allocated = b->allocated;
- s->size = b->memory.size;
- s->needed = b->needed;
- s->memory = b->memory.ptr;
- s->calls = b->calls;
-}
-
-NK_API void*
-nk_buffer_memory(struct nk_buffer *buffer)
-{
- NK_ASSERT(buffer);
- if (!buffer) return 0;
- return buffer->memory.ptr;
-}
-
-NK_API const void*
-nk_buffer_memory_const(const struct nk_buffer *buffer)
-{
- NK_ASSERT(buffer);
- if (!buffer) return 0;
- return buffer->memory.ptr;
-}
-
-NK_API nk_size
-nk_buffer_total(struct nk_buffer *buffer)
-{
- NK_ASSERT(buffer);
- if (!buffer) return 0;
- return buffer->memory.size;
-}
-
-/*
- * ==============================================================
- *
- * STRING
- *
- * ===============================================================
- */
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void
-nk_str_init_default(struct nk_str *str)
-{
- struct nk_allocator alloc;
- alloc.userdata.ptr = 0;
- alloc.alloc = nk_malloc;
- alloc.free = nk_mfree;
- nk_buffer_init(&str->buffer, &alloc, 32);
- str->len = 0;
-}
-#endif
-
-NK_API void
-nk_str_init(struct nk_str *str, const struct nk_allocator *alloc, nk_size size)
-{
- nk_buffer_init(&str->buffer, alloc, size);
- str->len = 0;
-}
-
-NK_API void
-nk_str_init_fixed(struct nk_str *str, void *memory, nk_size size)
-{
- nk_buffer_init_fixed(&str->buffer, memory, size);
- str->len = 0;
-}
-
-NK_API int
-nk_str_append_text_char(struct nk_str *s, const char *str, int len)
-{
- char *mem;
- NK_ASSERT(s);
- NK_ASSERT(str);
- if (!s || !str || !len) return 0;
- mem = (char*)nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
- if (!mem) return 0;
- NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
- s->len += nk_utf_len(str, len);
- return len;
-}
-
-NK_API int
-nk_str_append_str_char(struct nk_str *s, const char *str)
-{
- return nk_str_append_text_char(s, str, nk_strlen(str));
-}
-
-NK_API int
-nk_str_append_text_utf8(struct nk_str *str, const char *text, int len)
-{
- int i = 0;
- int byte_len = 0;
- nk_rune unicode;
- if (!str || !text || !len) return 0;
- for (i = 0; i < len; ++i)
- byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
- nk_str_append_text_char(str, text, byte_len);
- return len;
-}
-
-NK_API int
-nk_str_append_str_utf8(struct nk_str *str, const char *text)
-{
- int runes = 0;
- int byte_len = 0;
- int num_runes = 0;
- int glyph_len = 0;
- nk_rune unicode;
- if (!str || !text) return 0;
-
- glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
- while (unicode != '\0' && glyph_len) {
- glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
- byte_len += glyph_len;
- num_runes++;
- }
- nk_str_append_text_char(str, text, byte_len);
- return runes;
-}
-
-NK_API int
-nk_str_append_text_runes(struct nk_str *str, const nk_rune *text, int len)
-{
- int i = 0;
- int byte_len = 0;
- nk_glyph glyph;
-
- NK_ASSERT(str);
- if (!str || !text || !len) return 0;
- for (i = 0; i < len; ++i) {
- byte_len = nk_utf_encode(text[i], glyph, NK_UTF_SIZE);
- if (!byte_len) break;
- nk_str_append_text_char(str, glyph, byte_len);
- }
- return len;
-}
-
-NK_API int
-nk_str_append_str_runes(struct nk_str *str, const nk_rune *runes)
-{
- int i = 0;
- nk_glyph glyph;
- int byte_len;
- NK_ASSERT(str);
- if (!str || !runes) return 0;
- while (runes[i] != '\0') {
- byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
- nk_str_append_text_char(str, glyph, byte_len);
- i++;
- }
- return i;
-}
-
-NK_API int
-nk_str_insert_at_char(struct nk_str *s, int pos, const char *str, int len)
-{
- int i;
- void *mem;
- char *src;
- char *dst;
-
- int copylen;
- NK_ASSERT(s);
- NK_ASSERT(str);
- NK_ASSERT(len >= 0);
- if (!s || !str || !len || (nk_size)pos > s->buffer.allocated) return 0;
- if ((s->buffer.allocated + (nk_size)len >= s->buffer.memory.size) &&
- (s->buffer.type == NK_BUFFER_FIXED)) return 0;
-
- copylen = (int)s->buffer.allocated - pos;
- if (!copylen) {
- nk_str_append_text_char(s, str, len);
- return 1;
- }
- mem = nk_buffer_alloc(&s->buffer, NK_BUFFER_FRONT, (nk_size)len * sizeof(char), 0);
- if (!mem) return 0;
-
- /* memmove */
- NK_ASSERT(((int)pos + (int)len + ((int)copylen - 1)) >= 0);
- NK_ASSERT(((int)pos + ((int)copylen - 1)) >= 0);
- dst = nk_ptr_add(char, s->buffer.memory.ptr, pos + len + (copylen - 1));
- src = nk_ptr_add(char, s->buffer.memory.ptr, pos + (copylen-1));
- for (i = 0; i < copylen; ++i) *dst-- = *src--;
- mem = nk_ptr_add(void, s->buffer.memory.ptr, pos);
- NK_MEMCPY(mem, str, (nk_size)len * sizeof(char));
- s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
- return 1;
-}
-
-NK_API int
-nk_str_insert_at_rune(struct nk_str *str, int pos, const char *cstr, int len)
-{
- int glyph_len;
- nk_rune unicode;
- const char *begin;
- const char *buffer;
-
- NK_ASSERT(str);
- NK_ASSERT(cstr);
- NK_ASSERT(len);
- if (!str || !cstr || !len) return 0;
- begin = nk_str_at_rune(str, pos, &unicode, &glyph_len);
- if (!str->len)
- return nk_str_append_text_char(str, cstr, len);
- buffer = nk_str_get_const(str);
- if (!begin) return 0;
- return nk_str_insert_at_char(str, (int)(begin - buffer), cstr, len);
-}
-
-NK_API int
-nk_str_insert_text_char(struct nk_str *str, int pos, const char *text, int len)
-{
- return nk_str_insert_text_utf8(str, pos, text, len);
-}
-
-NK_API int
-nk_str_insert_str_char(struct nk_str *str, int pos, const char *text)
-{
- return nk_str_insert_text_utf8(str, pos, text, nk_strlen(text));
-}
-
-NK_API int
-nk_str_insert_text_utf8(struct nk_str *str, int pos, const char *text, int len)
-{
- int i = 0;
- int byte_len = 0;
- nk_rune unicode;
-
- NK_ASSERT(str);
- NK_ASSERT(text);
- if (!str || !text || !len) return 0;
- for (i = 0; i < len; ++i)
- byte_len += nk_utf_decode(text+byte_len, &unicode, 4);
- nk_str_insert_at_rune(str, pos, text, byte_len);
- return len;
-}
-
-NK_API int
-nk_str_insert_str_utf8(struct nk_str *str, int pos, const char *text)
-{
- int runes = 0;
- int byte_len = 0;
- int num_runes = 0;
- int glyph_len = 0;
- nk_rune unicode;
- if (!str || !text) return 0;
-
- glyph_len = byte_len = nk_utf_decode(text+byte_len, &unicode, 4);
- while (unicode != '\0' && glyph_len) {
- glyph_len = nk_utf_decode(text+byte_len, &unicode, 4);
- byte_len += glyph_len;
- num_runes++;
- }
- nk_str_insert_at_rune(str, pos, text, byte_len);
- return runes;
-}
-
-NK_API int
-nk_str_insert_text_runes(struct nk_str *str, int pos, const nk_rune *runes, int len)
-{
- int i = 0;
- int byte_len = 0;
- nk_glyph glyph;
-
- NK_ASSERT(str);
- if (!str || !runes || !len) return 0;
- for (i = 0; i < len; ++i) {
- byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
- if (!byte_len) break;
- nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
- }
- return len;
-}
-
-NK_API int
-nk_str_insert_str_runes(struct nk_str *str, int pos, const nk_rune *runes)
-{
- int i = 0;
- nk_glyph glyph;
- int byte_len;
- NK_ASSERT(str);
- if (!str || !runes) return 0;
- while (runes[i] != '\0') {
- byte_len = nk_utf_encode(runes[i], glyph, NK_UTF_SIZE);
- nk_str_insert_at_rune(str, pos+i, glyph, byte_len);
- i++;
- }
- return i;
-}
-
-NK_API void
-nk_str_remove_chars(struct nk_str *s, int len)
-{
- NK_ASSERT(s);
- NK_ASSERT(len >= 0);
- if (!s || len < 0 || (nk_size)len > s->buffer.allocated) return;
- NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
- s->buffer.allocated -= (nk_size)len;
- s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
-}
-
-NK_API void
-nk_str_remove_runes(struct nk_str *str, int len)
-{
- int index;
- const char *begin;
- const char *end;
- nk_rune unicode;
-
- NK_ASSERT(str);
- NK_ASSERT(len >= 0);
- if (!str || len < 0) return;
- if (len >= str->len) {
- str->len = 0;
- return;
- }
-
- index = str->len - len;
- begin = nk_str_at_rune(str, index, &unicode, &len);
- end = (const char*)str->buffer.memory.ptr + str->buffer.allocated;
- nk_str_remove_chars(str, (int)(end-begin)+1);
-}
-
-NK_API void
-nk_str_delete_chars(struct nk_str *s, int pos, int len)
-{
- NK_ASSERT(s);
- if (!s || !len || (nk_size)pos > s->buffer.allocated ||
- (nk_size)(pos + len) > s->buffer.allocated) return;
-
- if ((nk_size)(pos + len) < s->buffer.allocated) {
- /* memmove */
- char *dst = nk_ptr_add(char, s->buffer.memory.ptr, pos);
- char *src = nk_ptr_add(char, s->buffer.memory.ptr, pos + len);
- NK_MEMCPY(dst, src, s->buffer.allocated - (nk_size)(pos + len));
- NK_ASSERT(((int)s->buffer.allocated - (int)len) >= 0);
- s->buffer.allocated -= (nk_size)len;
- } else nk_str_remove_chars(s, len);
- s->len = nk_utf_len((char *)s->buffer.memory.ptr, (int)s->buffer.allocated);
-}
-
-NK_API void
-nk_str_delete_runes(struct nk_str *s, int pos, int len)
-{
- char *temp;
- nk_rune unicode;
- char *begin;
- char *end;
- int unused;
-
- NK_ASSERT(s);
- NK_ASSERT(s->len >= pos + len);
- if (s->len < pos + len)
- len = NK_CLAMP(0, (s->len - pos), s->len);
- if (!len) return;
-
- temp = (char *)s->buffer.memory.ptr;
- begin = nk_str_at_rune(s, pos, &unicode, &unused);
- if (!begin) return;
- s->buffer.memory.ptr = begin;
- end = nk_str_at_rune(s, len, &unicode, &unused);
- s->buffer.memory.ptr = temp;
- if (!end) return;
- nk_str_delete_chars(s, (int)(begin - temp), (int)(end - begin));
-}
-
-NK_API char*
-nk_str_at_char(struct nk_str *s, int pos)
-{
- NK_ASSERT(s);
- if (!s || pos > (int)s->buffer.allocated) return 0;
- return nk_ptr_add(char, s->buffer.memory.ptr, pos);
-}
-
-NK_API char*
-nk_str_at_rune(struct nk_str *str, int pos, nk_rune *unicode, int *len)
-{
- int i = 0;
- int src_len = 0;
- int glyph_len = 0;
- char *text;
- int text_len;
-
- NK_ASSERT(str);
- NK_ASSERT(unicode);
- NK_ASSERT(len);
-
- if (!str || !unicode || !len) return 0;
- if (pos < 0) {
- *unicode = 0;
- *len = 0;
- return 0;
- }
-
- text = (char*)str->buffer.memory.ptr;
- text_len = (int)str->buffer.allocated;
- glyph_len = nk_utf_decode(text, unicode, text_len);
- while (glyph_len) {
- if (i == pos) {
- *len = glyph_len;
- break;
- }
-
- i++;
- src_len = src_len + glyph_len;
- glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
- }
- if (i != pos) return 0;
- return text + src_len;
-}
-
-NK_API const char*
-nk_str_at_char_const(const struct nk_str *s, int pos)
-{
- NK_ASSERT(s);
- if (!s || pos > (int)s->buffer.allocated) return 0;
- return nk_ptr_add(char, s->buffer.memory.ptr, pos);
-}
-
-NK_API const char*
-nk_str_at_const(const struct nk_str *str, int pos, nk_rune *unicode, int *len)
-{
- int i = 0;
- int src_len = 0;
- int glyph_len = 0;
- char *text;
- int text_len;
-
- NK_ASSERT(str);
- NK_ASSERT(unicode);
- NK_ASSERT(len);
-
- if (!str || !unicode || !len) return 0;
- if (pos < 0) {
- *unicode = 0;
- *len = 0;
- return 0;
- }
-
- text = (char*)str->buffer.memory.ptr;
- text_len = (int)str->buffer.allocated;
- glyph_len = nk_utf_decode(text, unicode, text_len);
- while (glyph_len) {
- if (i == pos) {
- *len = glyph_len;
- break;
- }
-
- i++;
- src_len = src_len + glyph_len;
- glyph_len = nk_utf_decode(text + src_len, unicode, text_len - src_len);
- }
- if (i != pos) return 0;
- return text + src_len;
-}
-
-NK_API nk_rune
-nk_str_rune_at(const struct nk_str *str, int pos)
-{
- int len;
- nk_rune unicode = 0;
- nk_str_at_const(str, pos, &unicode, &len);
- return unicode;
-}
-
-NK_API char*
-nk_str_get(struct nk_str *s)
-{
- NK_ASSERT(s);
- if (!s || !s->len || !s->buffer.allocated) return 0;
- return (char*)s->buffer.memory.ptr;
-}
-
-NK_API const char*
-nk_str_get_const(const struct nk_str *s)
-{
- NK_ASSERT(s);
- if (!s || !s->len || !s->buffer.allocated) return 0;
- return (const char*)s->buffer.memory.ptr;
-}
-
-NK_API int
-nk_str_len(struct nk_str *s)
-{
- NK_ASSERT(s);
- if (!s || !s->len || !s->buffer.allocated) return 0;
- return s->len;
-}
-
-NK_API int
-nk_str_len_char(struct nk_str *s)
-{
- NK_ASSERT(s);
- if (!s || !s->len || !s->buffer.allocated) return 0;
- return (int)s->buffer.allocated;
-}
-
-NK_API void
-nk_str_clear(struct nk_str *str)
-{
- NK_ASSERT(str);
- nk_buffer_clear(&str->buffer);
- str->len = 0;
-}
-
-NK_API void
-nk_str_free(struct nk_str *str)
-{
- NK_ASSERT(str);
- nk_buffer_free(&str->buffer);
- str->len = 0;
-}
-
-/*
- * ==============================================================
- *
- * Command buffer
- *
- * ===============================================================
-*/
-NK_INTERN void
-nk_command_buffer_init(struct nk_command_buffer *cmdbuf,
- struct nk_buffer *buffer, enum nk_command_clipping clip)
-{
- NK_ASSERT(cmdbuf);
- NK_ASSERT(buffer);
- if (!cmdbuf || !buffer) return;
- cmdbuf->base = buffer;
- cmdbuf->use_clipping = clip;
- cmdbuf->begin = buffer->allocated;
- cmdbuf->end = buffer->allocated;
- cmdbuf->last = buffer->allocated;
-}
-
-NK_INTERN void
-nk_command_buffer_reset(struct nk_command_buffer *buffer)
-{
- NK_ASSERT(buffer);
- if (!buffer) return;
- buffer->begin = 0;
- buffer->end = 0;
- buffer->last = 0;
- buffer->clip = nk_null_rect;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- buffer->userdata.ptr = 0;
-#endif
-}
-
-NK_INTERN void*
-nk_command_buffer_push(struct nk_command_buffer* b,
- enum nk_command_type t, nk_size size)
-{
- NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_command);
- struct nk_command *cmd;
- nk_size alignment;
- void *unaligned;
- void *memory;
-
- NK_ASSERT(b);
- NK_ASSERT(b->base);
- if (!b) return 0;
- cmd = (struct nk_command*)nk_buffer_alloc(b->base,NK_BUFFER_FRONT,size,align);
- if (!cmd) return 0;
-
- /* make sure the offset to the next command is aligned */
- b->last = (nk_size)((nk_byte*)cmd - (nk_byte*)b->base->memory.ptr);
- unaligned = (nk_byte*)cmd + size;
- memory = NK_ALIGN_PTR(unaligned, align);
- alignment = (nk_size)((nk_byte*)memory - (nk_byte*)unaligned);
-#ifdef NK_ZERO_COMMAND_MEMORY
- NK_MEMSET(cmd, 0, size + alignment);
-#endif
-
- cmd->type = t;
- cmd->next = b->base->allocated + alignment;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- cmd->userdata = b->userdata;
-#endif
- b->end = cmd->next;
- return cmd;
-}
-
-NK_API void
-nk_push_scissor(struct nk_command_buffer *b, struct nk_rect r)
-{
- struct nk_command_scissor *cmd;
- NK_ASSERT(b);
- if (!b) return;
-
- b->clip.x = r.x;
- b->clip.y = r.y;
- b->clip.w = r.w;
- b->clip.h = r.h;
- cmd = (struct nk_command_scissor*)
- nk_command_buffer_push(b, NK_COMMAND_SCISSOR, sizeof(*cmd));
-
- if (!cmd) return;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)NK_MAX(0, r.w);
- cmd->h = (unsigned short)NK_MAX(0, r.h);
-}
-
-NK_API void
-nk_stroke_line(struct nk_command_buffer *b, float x0, float y0,
- float x1, float y1, float line_thickness, struct nk_color c)
-{
- struct nk_command_line *cmd;
- NK_ASSERT(b);
- if (!b || line_thickness <= 0) return;
- cmd = (struct nk_command_line*)
- nk_command_buffer_push(b, NK_COMMAND_LINE, sizeof(*cmd));
- if (!cmd) return;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->begin.x = (short)x0;
- cmd->begin.y = (short)y0;
- cmd->end.x = (short)x1;
- cmd->end.y = (short)y1;
- cmd->color = c;
-}
-
-NK_API void
-nk_stroke_curve(struct nk_command_buffer *b, float ax, float ay,
- float ctrl0x, float ctrl0y, float ctrl1x, float ctrl1y,
- float bx, float by, float line_thickness, struct nk_color col)
-{
- struct nk_command_curve *cmd;
- NK_ASSERT(b);
- if (!b || col.a == 0 || line_thickness <= 0) return;
-
- cmd = (struct nk_command_curve*)
- nk_command_buffer_push(b, NK_COMMAND_CURVE, sizeof(*cmd));
- if (!cmd) return;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->begin.x = (short)ax;
- cmd->begin.y = (short)ay;
- cmd->ctrl[0].x = (short)ctrl0x;
- cmd->ctrl[0].y = (short)ctrl0y;
- cmd->ctrl[1].x = (short)ctrl1x;
- cmd->ctrl[1].y = (short)ctrl1y;
- cmd->end.x = (short)bx;
- cmd->end.y = (short)by;
- cmd->color = col;
-}
-
-NK_API void
-nk_stroke_rect(struct nk_command_buffer *b, struct nk_rect rect,
- float rounding, float line_thickness, struct nk_color c)
-{
- struct nk_command_rect *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0 || rect.w == 0 || rect.h == 0 || line_thickness <= 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
- clip->x, clip->y, clip->w, clip->h)) return;
- }
- cmd = (struct nk_command_rect*)
- nk_command_buffer_push(b, NK_COMMAND_RECT, sizeof(*cmd));
- if (!cmd) return;
- cmd->rounding = (unsigned short)rounding;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->x = (short)rect.x;
- cmd->y = (short)rect.y;
- cmd->w = (unsigned short)NK_MAX(0, rect.w);
- cmd->h = (unsigned short)NK_MAX(0, rect.h);
- cmd->color = c;
-}
-
-NK_API void
-nk_fill_rect(struct nk_command_buffer *b, struct nk_rect rect,
- float rounding, struct nk_color c)
-{
- struct nk_command_rect_filled *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0 || rect.w == 0 || rect.h == 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
- clip->x, clip->y, clip->w, clip->h)) return;
- }
-
- cmd = (struct nk_command_rect_filled*)
- nk_command_buffer_push(b, NK_COMMAND_RECT_FILLED, sizeof(*cmd));
- if (!cmd) return;
- cmd->rounding = (unsigned short)rounding;
- cmd->x = (short)rect.x;
- cmd->y = (short)rect.y;
- cmd->w = (unsigned short)NK_MAX(0, rect.w);
- cmd->h = (unsigned short)NK_MAX(0, rect.h);
- cmd->color = c;
-}
-
-NK_API void
-nk_fill_rect_multi_color(struct nk_command_buffer *b, struct nk_rect rect,
- struct nk_color left, struct nk_color top, struct nk_color right,
- struct nk_color bottom)
-{
- struct nk_command_rect_multi_color *cmd;
- NK_ASSERT(b);
- if (!b || rect.w == 0 || rect.h == 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
- clip->x, clip->y, clip->w, clip->h)) return;
- }
-
- cmd = (struct nk_command_rect_multi_color*)
- nk_command_buffer_push(b, NK_COMMAND_RECT_MULTI_COLOR, sizeof(*cmd));
- if (!cmd) return;
- cmd->x = (short)rect.x;
- cmd->y = (short)rect.y;
- cmd->w = (unsigned short)NK_MAX(0, rect.w);
- cmd->h = (unsigned short)NK_MAX(0, rect.h);
- cmd->left = left;
- cmd->top = top;
- cmd->right = right;
- cmd->bottom = bottom;
-}
-
-NK_API void
-nk_stroke_circle(struct nk_command_buffer *b, struct nk_rect r,
- float line_thickness, struct nk_color c)
-{
- struct nk_command_circle *cmd;
- if (!b || r.w == 0 || r.h == 0 || line_thickness <= 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h))
- return;
- }
-
- cmd = (struct nk_command_circle*)
- nk_command_buffer_push(b, NK_COMMAND_CIRCLE, sizeof(*cmd));
- if (!cmd) return;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)NK_MAX(r.w, 0);
- cmd->h = (unsigned short)NK_MAX(r.h, 0);
- cmd->color = c;
-}
-
-NK_API void
-nk_fill_circle(struct nk_command_buffer *b, struct nk_rect r, struct nk_color c)
-{
- struct nk_command_circle_filled *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0 || r.w == 0 || r.h == 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INTERSECT(r.x, r.y, r.w, r.h, clip->x, clip->y, clip->w, clip->h))
- return;
- }
-
- cmd = (struct nk_command_circle_filled*)
- nk_command_buffer_push(b, NK_COMMAND_CIRCLE_FILLED, sizeof(*cmd));
- if (!cmd) return;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)NK_MAX(r.w, 0);
- cmd->h = (unsigned short)NK_MAX(r.h, 0);
- cmd->color = c;
-}
-
-NK_API void
-nk_stroke_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
- float a_min, float a_max, float line_thickness, struct nk_color c)
-{
- struct nk_command_arc *cmd;
- if (!b || c.a == 0 || line_thickness <= 0) return;
- cmd = (struct nk_command_arc*)
- nk_command_buffer_push(b, NK_COMMAND_ARC, sizeof(*cmd));
- if (!cmd) return;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->cx = (short)cx;
- cmd->cy = (short)cy;
- cmd->r = (unsigned short)radius;
- cmd->a[0] = a_min;
- cmd->a[1] = a_max;
- cmd->color = c;
-}
-
-NK_API void
-nk_fill_arc(struct nk_command_buffer *b, float cx, float cy, float radius,
- float a_min, float a_max, struct nk_color c)
-{
- struct nk_command_arc_filled *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0) return;
- cmd = (struct nk_command_arc_filled*)
- nk_command_buffer_push(b, NK_COMMAND_ARC_FILLED, sizeof(*cmd));
- if (!cmd) return;
- cmd->cx = (short)cx;
- cmd->cy = (short)cy;
- cmd->r = (unsigned short)radius;
- cmd->a[0] = a_min;
- cmd->a[1] = a_max;
- cmd->color = c;
-}
-
-NK_API void
-nk_stroke_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
- float y1, float x2, float y2, float line_thickness, struct nk_color c)
-{
- struct nk_command_triangle *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0 || line_thickness <= 0) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) &&
- !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) &&
- !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h))
- return;
- }
-
- cmd = (struct nk_command_triangle*)
- nk_command_buffer_push(b, NK_COMMAND_TRIANGLE, sizeof(*cmd));
- if (!cmd) return;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->a.x = (short)x0;
- cmd->a.y = (short)y0;
- cmd->b.x = (short)x1;
- cmd->b.y = (short)y1;
- cmd->c.x = (short)x2;
- cmd->c.y = (short)y2;
- cmd->color = c;
-}
-
-NK_API void
-nk_fill_triangle(struct nk_command_buffer *b, float x0, float y0, float x1,
- float y1, float x2, float y2, struct nk_color c)
-{
- struct nk_command_triangle_filled *cmd;
- NK_ASSERT(b);
- if (!b || c.a == 0) return;
- if (!b) return;
- if (b->use_clipping) {
- const struct nk_rect *clip = &b->clip;
- if (!NK_INBOX(x0, y0, clip->x, clip->y, clip->w, clip->h) &&
- !NK_INBOX(x1, y1, clip->x, clip->y, clip->w, clip->h) &&
- !NK_INBOX(x2, y2, clip->x, clip->y, clip->w, clip->h))
- return;
- }
-
- cmd = (struct nk_command_triangle_filled*)
- nk_command_buffer_push(b, NK_COMMAND_TRIANGLE_FILLED, sizeof(*cmd));
- if (!cmd) return;
- cmd->a.x = (short)x0;
- cmd->a.y = (short)y0;
- cmd->b.x = (short)x1;
- cmd->b.y = (short)y1;
- cmd->c.x = (short)x2;
- cmd->c.y = (short)y2;
- cmd->color = c;
-}
-
-NK_API void
-nk_stroke_polygon(struct nk_command_buffer *b, float *points, int point_count,
- float line_thickness, struct nk_color col)
-{
- int i;
- nk_size size = 0;
- struct nk_command_polygon *cmd;
-
- NK_ASSERT(b);
- if (!b || col.a == 0 || line_thickness <= 0) return;
- size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
- cmd = (struct nk_command_polygon*) nk_command_buffer_push(b, NK_COMMAND_POLYGON, size);
- if (!cmd) return;
- cmd->color = col;
- cmd->line_thickness = (unsigned short)line_thickness;
- cmd->point_count = (unsigned short)point_count;
- for (i = 0; i < point_count; ++i) {
- cmd->points[i].x = (short)points[i*2];
- cmd->points[i].y = (short)points[i*2+1];
- }
-}
-
-NK_API void
-nk_fill_polygon(struct nk_command_buffer *b, float *points, int point_count,
- struct nk_color col)
-{
- int i;
- nk_size size = 0;
- struct nk_command_polygon_filled *cmd;
-
- NK_ASSERT(b);
- if (!b || col.a == 0) return;
- size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
- cmd = (struct nk_command_polygon_filled*)
- nk_command_buffer_push(b, NK_COMMAND_POLYGON_FILLED, size);
- if (!cmd) return;
- cmd->color = col;
- cmd->point_count = (unsigned short)point_count;
- for (i = 0; i < point_count; ++i) {
- cmd->points[i].x = (short)points[i*2+0];
- cmd->points[i].y = (short)points[i*2+1];
- }
-}
-
-NK_API void
-nk_stroke_polyline(struct nk_command_buffer *b, float *points, int point_count,
- float line_thickness, struct nk_color col)
-{
- int i;
- nk_size size = 0;
- struct nk_command_polyline *cmd;
-
- NK_ASSERT(b);
- if (!b || col.a == 0 || line_thickness <= 0) return;
- size = sizeof(*cmd) + sizeof(short) * 2 * (nk_size)point_count;
- cmd = (struct nk_command_polyline*) nk_command_buffer_push(b, NK_COMMAND_POLYLINE, size);
- if (!cmd) return;
- cmd->color = col;
- cmd->point_count = (unsigned short)point_count;
- cmd->line_thickness = (unsigned short)line_thickness;
- for (i = 0; i < point_count; ++i) {
- cmd->points[i].x = (short)points[i*2];
- cmd->points[i].y = (short)points[i*2+1];
- }
-}
-
-NK_API void
-nk_draw_image(struct nk_command_buffer *b, struct nk_rect r,
- const struct nk_image *img, struct nk_color col)
-{
- struct nk_command_image *cmd;
- NK_ASSERT(b);
- if (!b) return;
- if (b->use_clipping) {
- const struct nk_rect *c = &b->clip;
- if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
- return;
- }
-
- cmd = (struct nk_command_image*)
- nk_command_buffer_push(b, NK_COMMAND_IMAGE, sizeof(*cmd));
- if (!cmd) return;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)NK_MAX(0, r.w);
- cmd->h = (unsigned short)NK_MAX(0, r.h);
- cmd->img = *img;
- cmd->col = col;
-}
-
-NK_API void
-nk_push_custom(struct nk_command_buffer *b, struct nk_rect r,
- nk_command_custom_callback cb, nk_handle usr)
-{
- struct nk_command_custom *cmd;
- NK_ASSERT(b);
- if (!b) return;
- if (b->use_clipping) {
- const struct nk_rect *c = &b->clip;
- if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
- return;
- }
-
- cmd = (struct nk_command_custom*)
- nk_command_buffer_push(b, NK_COMMAND_CUSTOM, sizeof(*cmd));
- if (!cmd) return;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)NK_MAX(0, r.w);
- cmd->h = (unsigned short)NK_MAX(0, r.h);
- cmd->callback_data = usr;
- cmd->callback = cb;
-}
-
-NK_API void
-nk_draw_text(struct nk_command_buffer *b, struct nk_rect r,
- const char *string, int length, const struct nk_user_font *font,
- struct nk_color bg, struct nk_color fg)
-{
- float text_width = 0;
- struct nk_command_text *cmd;
-
- NK_ASSERT(b);
- NK_ASSERT(font);
- if (!b || !string || !length || (bg.a == 0 && fg.a == 0)) return;
- if (b->use_clipping) {
- const struct nk_rect *c = &b->clip;
- if (c->w == 0 || c->h == 0 || !NK_INTERSECT(r.x, r.y, r.w, r.h, c->x, c->y, c->w, c->h))
- return;
- }
-
- /* make sure text fits inside bounds */
- text_width = font->width(font->userdata, font->height, string, length);
- if (text_width > r.w){
- int glyphs = 0;
- float txt_width = (float)text_width;
- length = nk_text_clamp(font, string, length, r.w, &glyphs, &txt_width, 0,0);
- }
-
- if (!length) return;
- cmd = (struct nk_command_text*)
- nk_command_buffer_push(b, NK_COMMAND_TEXT, sizeof(*cmd) + (nk_size)(length + 1));
- if (!cmd) return;
- cmd->x = (short)r.x;
- cmd->y = (short)r.y;
- cmd->w = (unsigned short)r.w;
- cmd->h = (unsigned short)r.h;
- cmd->background = bg;
- cmd->foreground = fg;
- cmd->font = font;
- cmd->length = length;
- cmd->height = font->height;
- NK_MEMCPY(cmd->string, string, (nk_size)length);
- cmd->string[length] = '\0';
-}
-
-/* ==============================================================
- *
- * DRAW LIST
- *
- * ===============================================================*/
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-NK_API void
-nk_draw_list_init(struct nk_draw_list *list)
-{
- nk_size i = 0;
- NK_ASSERT(list);
- if (!list) return;
- nk_zero(list, sizeof(*list));
- for (i = 0; i < NK_LEN(list->circle_vtx); ++i) {
- const float a = ((float)i / (float)NK_LEN(list->circle_vtx)) * 2 * NK_PI;
- list->circle_vtx[i].x = (float)NK_COS(a);
- list->circle_vtx[i].y = (float)NK_SIN(a);
- }
-}
-
-NK_API void
-nk_draw_list_setup(struct nk_draw_list *canvas, const struct nk_convert_config *config,
- struct nk_buffer *cmds, struct nk_buffer *vertices, struct nk_buffer *elements,
- enum nk_anti_aliasing line_aa, enum nk_anti_aliasing shape_aa)
-{
- NK_ASSERT(canvas);
- NK_ASSERT(config);
- NK_ASSERT(cmds);
- NK_ASSERT(vertices);
- NK_ASSERT(elements);
- if (!canvas || !config || !cmds || !vertices || !elements)
- return;
-
- canvas->buffer = cmds;
- canvas->config = *config;
- canvas->elements = elements;
- canvas->vertices = vertices;
- canvas->line_AA = line_aa;
- canvas->shape_AA = shape_aa;
- canvas->clip_rect = nk_null_rect;
-}
-
-NK_API const struct nk_draw_command*
-nk__draw_list_begin(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
-{
- nk_byte *memory;
- nk_size offset;
- const struct nk_draw_command *cmd;
-
- NK_ASSERT(buffer);
- if (!buffer || !buffer->size || !canvas->cmd_count)
- return 0;
-
- memory = (nk_byte*)buffer->memory.ptr;
- offset = buffer->memory.size - canvas->cmd_offset;
- cmd = nk_ptr_add(const struct nk_draw_command, memory, offset);
- return cmd;
-}
-
-NK_API const struct nk_draw_command*
-nk__draw_list_end(const struct nk_draw_list *canvas, const struct nk_buffer *buffer)
-{
- nk_size size;
- nk_size offset;
- nk_byte *memory;
- const struct nk_draw_command *end;
-
- NK_ASSERT(buffer);
- NK_ASSERT(canvas);
- if (!buffer || !canvas)
- return 0;
-
- memory = (nk_byte*)buffer->memory.ptr;
- size = buffer->memory.size;
- offset = size - canvas->cmd_offset;
- end = nk_ptr_add(const struct nk_draw_command, memory, offset);
- end -= (canvas->cmd_count-1);
- return end;
-}
-
-NK_API const struct nk_draw_command*
-nk__draw_list_next(const struct nk_draw_command *cmd,
- const struct nk_buffer *buffer, const struct nk_draw_list *canvas)
-{
- const struct nk_draw_command *end;
- NK_ASSERT(buffer);
- NK_ASSERT(canvas);
- if (!cmd || !buffer || !canvas)
- return 0;
-
- end = nk__draw_list_end(canvas, buffer);
- if (cmd <= end) return 0;
- return (cmd-1);
-}
-
-NK_API void
-nk_draw_list_clear(struct nk_draw_list *list)
-{
- NK_ASSERT(list);
- if (!list) return;
- if (list->buffer)
- nk_buffer_clear(list->buffer);
- if (list->vertices)
- nk_buffer_clear(list->vertices);
- if (list->elements)
- nk_buffer_clear(list->elements);
-
- list->element_count = 0;
- list->vertex_count = 0;
- list->cmd_offset = 0;
- list->cmd_count = 0;
- list->path_count = 0;
- list->vertices = 0;
- list->elements = 0;
- list->clip_rect = nk_null_rect;
-}
-
-NK_INTERN struct nk_vec2*
-nk_draw_list_alloc_path(struct nk_draw_list *list, int count)
-{
- struct nk_vec2 *points;
- NK_STORAGE const nk_size point_align = NK_ALIGNOF(struct nk_vec2);
- NK_STORAGE const nk_size point_size = sizeof(struct nk_vec2);
- points = (struct nk_vec2*)
- nk_buffer_alloc(list->buffer, NK_BUFFER_FRONT,
- point_size * (nk_size)count, point_align);
-
- if (!points) return 0;
- if (!list->path_offset) {
- void *memory = nk_buffer_memory(list->buffer);
- list->path_offset = (unsigned int)((nk_byte*)points - (nk_byte*)memory);
- }
- list->path_count += (unsigned int)count;
- return points;
-}
-
-NK_INTERN struct nk_vec2
-nk_draw_list_path_last(struct nk_draw_list *list)
-{
- void *memory;
- struct nk_vec2 *point;
- NK_ASSERT(list->path_count);
- memory = nk_buffer_memory(list->buffer);
- point = nk_ptr_add(struct nk_vec2, memory, list->path_offset);
- point += (list->path_count-1);
- return *point;
-}
-
-NK_INTERN struct nk_draw_command*
-nk_draw_list_push_command(struct nk_draw_list *list, struct nk_rect clip,
- nk_handle texture)
-{
- NK_STORAGE const nk_size cmd_align = NK_ALIGNOF(struct nk_draw_command);
- NK_STORAGE const nk_size cmd_size = sizeof(struct nk_draw_command);
- struct nk_draw_command *cmd;
-
- NK_ASSERT(list);
- cmd = (struct nk_draw_command*)
- nk_buffer_alloc(list->buffer, NK_BUFFER_BACK, cmd_size, cmd_align);
-
- if (!cmd) return 0;
- if (!list->cmd_count) {
- nk_byte *memory = (nk_byte*)nk_buffer_memory(list->buffer);
- nk_size total = nk_buffer_total(list->buffer);
- memory = nk_ptr_add(nk_byte, memory, total);
- list->cmd_offset = (nk_size)(memory - (nk_byte*)cmd);
- }
-
- cmd->elem_count = 0;
- cmd->clip_rect = clip;
- cmd->texture = texture;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- cmd->userdata = list->userdata;
-#endif
-
- list->cmd_count++;
- list->clip_rect = clip;
- return cmd;
-}
-
-NK_INTERN struct nk_draw_command*
-nk_draw_list_command_last(struct nk_draw_list *list)
-{
- void *memory;
- nk_size size;
- struct nk_draw_command *cmd;
- NK_ASSERT(list->cmd_count);
-
- memory = nk_buffer_memory(list->buffer);
- size = nk_buffer_total(list->buffer);
- cmd = nk_ptr_add(struct nk_draw_command, memory, size - list->cmd_offset);
- return (cmd - (list->cmd_count-1));
-}
-
-NK_INTERN void
-nk_draw_list_add_clip(struct nk_draw_list *list, struct nk_rect rect)
-{
- NK_ASSERT(list);
- if (!list) return;
- if (!list->cmd_count) {
- nk_draw_list_push_command(list, rect, list->config.null.texture);
- } else {
- struct nk_draw_command *prev = nk_draw_list_command_last(list);
- if (prev->elem_count == 0)
- prev->clip_rect = rect;
- nk_draw_list_push_command(list, rect, prev->texture);
- }
-}
-
-NK_INTERN void
-nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
-{
- NK_ASSERT(list);
- if (!list) return;
- if (!list->cmd_count) {
- nk_draw_list_push_command(list, nk_null_rect, texture);
- } else {
- struct nk_draw_command *prev = nk_draw_list_command_last(list);
- if (prev->elem_count == 0) {
- prev->texture = texture;
- #ifdef NK_INCLUDE_COMMAND_USERDATA
- prev->userdata = list->userdata;
- #endif
- } else if (prev->texture.id != texture.id
- #ifdef NK_INCLUDE_COMMAND_USERDATA
- || prev->userdata.id != list->userdata.id
- #endif
- ) nk_draw_list_push_command(list, prev->clip_rect, texture);
- }
-}
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
-NK_API void
-nk_draw_list_push_userdata(struct nk_draw_list *list, nk_handle userdata)
-{
- list->userdata = userdata;
-}
-#endif
-
-NK_INTERN void*
-nk_draw_list_alloc_vertices(struct nk_draw_list *list, nk_size count)
-{
- void *vtx;
- NK_ASSERT(list);
- if (!list) return 0;
- vtx = nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT,
- list->config.vertex_size*count, list->config.vertex_alignment);
- if (!vtx) return 0;
- list->vertex_count += (unsigned int)count;
- return vtx;
-}
-
-NK_INTERN nk_draw_index*
-nk_draw_list_alloc_elements(struct nk_draw_list *list, nk_size count)
-{
- nk_draw_index *ids;
- struct nk_draw_command *cmd;
- NK_STORAGE const nk_size elem_align = NK_ALIGNOF(nk_draw_index);
- NK_STORAGE const nk_size elem_size = sizeof(nk_draw_index);
- NK_ASSERT(list);
- if (!list) return 0;
-
- ids = (nk_draw_index*)
- nk_buffer_alloc(list->elements, NK_BUFFER_FRONT, elem_size*count, elem_align);
- if (!ids) return 0;
- cmd = nk_draw_list_command_last(list);
- list->element_count += (unsigned int)count;
- cmd->elem_count += (unsigned int)count;
- return ids;
-}
-
-NK_INTERN int
-nk_draw_vertex_layout_element_is_end_of_layout(
- const struct nk_draw_vertex_layout_element *element)
-{
- return (element->attribute == NK_VERTEX_ATTRIBUTE_COUNT ||
- element->format == NK_FORMAT_COUNT);
-}
-
-NK_INTERN void
-nk_draw_vertex_color(void *attr, const float *vals,
- enum nk_draw_vertex_layout_format format)
-{
- /* if this triggers you tried to provide a value format for a color */
- float val[4];
- NK_ASSERT(format >= NK_FORMAT_COLOR_BEGIN);
- NK_ASSERT(format <= NK_FORMAT_COLOR_END);
- if (format < NK_FORMAT_COLOR_BEGIN || format > NK_FORMAT_COLOR_END) return;
-
- val[0] = NK_SATURATE(vals[0]);
- val[1] = NK_SATURATE(vals[1]);
- val[2] = NK_SATURATE(vals[2]);
- val[3] = NK_SATURATE(vals[3]);
-
- switch (format) {
- default: NK_ASSERT(0 && "Invalid vertex layout color format"); break;
- case NK_FORMAT_R8G8B8A8:
- case NK_FORMAT_R8G8B8: {
- struct nk_color col = nk_rgba_fv(val);
- NK_MEMCPY(attr, &col.r, sizeof(col));
- } break;
- case NK_FORMAT_B8G8R8A8: {
- struct nk_color col = nk_rgba_fv(val);
- struct nk_color bgra = nk_rgba(col.b, col.g, col.r, col.a);
- NK_MEMCPY(attr, &bgra, sizeof(bgra));
- } break;
- case NK_FORMAT_R16G15B16: {
- nk_ushort col[3];
- col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
- col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
- col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
- NK_MEMCPY(attr, col, sizeof(col));
- } break;
- case NK_FORMAT_R16G15B16A16: {
- nk_ushort col[4];
- col[0] = (nk_ushort)(val[0]*(float)NK_USHORT_MAX);
- col[1] = (nk_ushort)(val[1]*(float)NK_USHORT_MAX);
- col[2] = (nk_ushort)(val[2]*(float)NK_USHORT_MAX);
- col[3] = (nk_ushort)(val[3]*(float)NK_USHORT_MAX);
- NK_MEMCPY(attr, col, sizeof(col));
- } break;
- case NK_FORMAT_R32G32B32: {
- nk_uint col[3];
- col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
- col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
- col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
- NK_MEMCPY(attr, col, sizeof(col));
- } break;
- case NK_FORMAT_R32G32B32A32: {
- nk_uint col[4];
- col[0] = (nk_uint)(val[0]*(float)NK_UINT_MAX);
- col[1] = (nk_uint)(val[1]*(float)NK_UINT_MAX);
- col[2] = (nk_uint)(val[2]*(float)NK_UINT_MAX);
- col[3] = (nk_uint)(val[3]*(float)NK_UINT_MAX);
- NK_MEMCPY(attr, col, sizeof(col));
- } break;
- case NK_FORMAT_R32G32B32A32_FLOAT:
- NK_MEMCPY(attr, val, sizeof(float)*4);
- break;
- case NK_FORMAT_R32G32B32A32_DOUBLE: {
- double col[4];
- col[0] = (double)val[0];
- col[1] = (double)val[1];
- col[2] = (double)val[2];
- col[3] = (double)val[3];
- NK_MEMCPY(attr, col, sizeof(col));
- } break;
- case NK_FORMAT_RGB32:
- case NK_FORMAT_RGBA32: {
- struct nk_color col = nk_rgba_fv(val);
- nk_uint color = nk_color_u32(col);
- NK_MEMCPY(attr, &color, sizeof(color));
- } break; }
-}
-
-NK_INTERN void
-nk_draw_vertex_element(void *dst, const float *values, int value_count,
- enum nk_draw_vertex_layout_format format)
-{
- int value_index;
- void *attribute = dst;
- /* if this triggers you tried to provide a color format for a value */
- NK_ASSERT(format < NK_FORMAT_COLOR_BEGIN);
- if (format >= NK_FORMAT_COLOR_BEGIN && format <= NK_FORMAT_COLOR_END) return;
- for (value_index = 0; value_index < value_count; ++value_index) {
- switch (format) {
- default: NK_ASSERT(0 && "invalid vertex layout format"); break;
- case NK_FORMAT_SCHAR: {
- char value = (char)NK_CLAMP((float)NK_SCHAR_MIN, values[value_index], (float)NK_SCHAR_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(char));
- } break;
- case NK_FORMAT_SSHORT: {
- nk_short value = (nk_short)NK_CLAMP((float)NK_SSHORT_MIN, values[value_index], (float)NK_SSHORT_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(value));
- } break;
- case NK_FORMAT_SINT: {
- nk_int value = (nk_int)NK_CLAMP((float)NK_SINT_MIN, values[value_index], (float)NK_SINT_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(nk_int));
- } break;
- case NK_FORMAT_UCHAR: {
- unsigned char value = (unsigned char)NK_CLAMP((float)NK_UCHAR_MIN, values[value_index], (float)NK_UCHAR_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(unsigned char));
- } break;
- case NK_FORMAT_USHORT: {
- nk_ushort value = (nk_ushort)NK_CLAMP((float)NK_USHORT_MIN, values[value_index], (float)NK_USHORT_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(value));
- } break;
- case NK_FORMAT_UINT: {
- nk_uint value = (nk_uint)NK_CLAMP((float)NK_UINT_MIN, values[value_index], (float)NK_UINT_MAX);
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(nk_uint));
- } break;
- case NK_FORMAT_FLOAT:
- NK_MEMCPY(attribute, &values[value_index], sizeof(values[value_index]));
- attribute = (void*)((char*)attribute + sizeof(float));
- break;
- case NK_FORMAT_DOUBLE: {
- double value = (double)values[value_index];
- NK_MEMCPY(attribute, &value, sizeof(value));
- attribute = (void*)((char*)attribute + sizeof(double));
- } break;
- }
- }
-}
-
-NK_INTERN void*
-nk_draw_vertex(void *dst, const struct nk_convert_config *config,
- struct nk_vec2 pos, struct nk_vec2 uv, struct nk_colorf color)
-{
- void *result = (void*)((char*)dst + config->vertex_size);
- const struct nk_draw_vertex_layout_element *elem_iter = config->vertex_layout;
- while (!nk_draw_vertex_layout_element_is_end_of_layout(elem_iter)) {
- void *address = (void*)((char*)dst + elem_iter->offset);
- switch (elem_iter->attribute) {
- case NK_VERTEX_ATTRIBUTE_COUNT:
- default: NK_ASSERT(0 && "wrong element attribute"); break;
- case NK_VERTEX_POSITION: nk_draw_vertex_element(address, &pos.x, 2, elem_iter->format); break;
- case NK_VERTEX_TEXCOORD: nk_draw_vertex_element(address, &uv.x, 2, elem_iter->format); break;
- case NK_VERTEX_COLOR: nk_draw_vertex_color(address, &color.r, elem_iter->format); break;
- }
- elem_iter++;
- }
- return result;
-}
-
-NK_API void
-nk_draw_list_stroke_poly_line(struct nk_draw_list *list, const struct nk_vec2 *points,
- const unsigned int points_count, struct nk_color color, enum nk_draw_list_stroke closed,
- float thickness, enum nk_anti_aliasing aliasing)
-{
- nk_size count;
- int thick_line;
- struct nk_colorf col;
- struct nk_colorf col_trans;
- NK_ASSERT(list);
- if (!list || points_count < 2) return;
-
- color.a = (nk_byte)((float)color.a * list->config.global_alpha);
- count = points_count;
- if (!closed) count = points_count-1;
- thick_line = thickness > 1.0f;
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_draw_list_push_userdata(list, list->userdata);
-#endif
-
- color.a = (nk_byte)((float)color.a * list->config.global_alpha);
- nk_color_fv(&col.r, color);
- col_trans = col;
- col_trans.a = 0;
-
- if (aliasing == NK_ANTI_ALIASING_ON) {
- /* ANTI-ALIASED STROKE */
- const float AA_SIZE = 1.0f;
- NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
- NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
-
- /* allocate vertices and elements */
- nk_size i1 = 0;
- nk_size vertex_offset;
- nk_size index = list->vertex_count;
-
- const nk_size idx_count = (thick_line) ? (count * 18) : (count * 12);
- const nk_size vtx_count = (thick_line) ? (points_count * 4): (points_count *3);
-
- void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
- nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
-
- nk_size size;
- struct nk_vec2 *normals, *temp;
- if (!vtx || !ids) return;
-
- /* temporary allocate normals + points */
- vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
- nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
- size = pnt_size * ((thick_line) ? 5 : 3) * points_count;
- normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
- NK_ASSERT(normals);
- if (!normals) return;
- temp = normals + points_count;
-
- /* make sure vertex pointer is still correct */
- vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);
-
- /* calculate normals */
- for (i1 = 0; i1 < count; ++i1) {
- const nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
- struct nk_vec2 diff = nk_vec2_sub(points[i2], points[i1]);
- float len;
-
- /* vec2 inverted length */
- len = nk_vec2_len_sqr(diff);
- if (len != 0.0f)
- len = nk_inv_sqrt(len);
- else len = 1.0f;
-
- diff = nk_vec2_muls(diff, len);
- normals[i1].x = diff.y;
- normals[i1].y = -diff.x;
- }
-
- if (!closed)
- normals[points_count-1] = normals[points_count-2];
-
- if (!thick_line) {
- nk_size idx1, i;
- if (!closed) {
- struct nk_vec2 d;
- temp[0] = nk_vec2_add(points[0], nk_vec2_muls(normals[0], AA_SIZE));
- temp[1] = nk_vec2_sub(points[0], nk_vec2_muls(normals[0], AA_SIZE));
- d = nk_vec2_muls(normals[points_count-1], AA_SIZE);
- temp[(points_count-1) * 2 + 0] = nk_vec2_add(points[points_count-1], d);
- temp[(points_count-1) * 2 + 1] = nk_vec2_sub(points[points_count-1], d);
- }
-
- /* fill elements */
- idx1 = index;
- for (i1 = 0; i1 < count; i1++) {
- struct nk_vec2 dm;
- float dmr2;
- nk_size i2 = ((i1 + 1) == points_count) ? 0 : (i1 + 1);
- nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 3);
-
- /* average normals */
- dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f);
- dmr2 = dm.x * dm.x + dm.y* dm.y;
- if (dmr2 > 0.000001f) {
- float scale = 1.0f/dmr2;
- scale = NK_MIN(100.0f, scale);
- dm = nk_vec2_muls(dm, scale);
- }
-
- dm = nk_vec2_muls(dm, AA_SIZE);
- temp[i2*2+0] = nk_vec2_add(points[i2], dm);
- temp[i2*2+1] = nk_vec2_sub(points[i2], dm);
-
- ids[0] = (nk_draw_index)(idx2 + 0); ids[1] = (nk_draw_index)(idx1+0);
- ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2);
- ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+0);
- ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1);
- ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0);
- ids[10]= (nk_draw_index)(idx2 + 0); ids[11]= (nk_draw_index)(idx2+1);
- ids += 12;
- idx1 = idx2;
- }
-
- /* fill vertices */
- for (i = 0; i < points_count; ++i) {
- const struct nk_vec2 uv = list->config.null.uv;
- vtx = nk_draw_vertex(vtx, &list->config, points[i], uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+0], uv, col_trans);
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*2+1], uv, col_trans);
- }
- } else {
- nk_size idx1, i;
- const float half_inner_thickness = (thickness - AA_SIZE) * 0.5f;
- if (!closed) {
- struct nk_vec2 d1 = nk_vec2_muls(normals[0], half_inner_thickness + AA_SIZE);
- struct nk_vec2 d2 = nk_vec2_muls(normals[0], half_inner_thickness);
-
- temp[0] = nk_vec2_add(points[0], d1);
- temp[1] = nk_vec2_add(points[0], d2);
- temp[2] = nk_vec2_sub(points[0], d2);
- temp[3] = nk_vec2_sub(points[0], d1);
-
- d1 = nk_vec2_muls(normals[points_count-1], half_inner_thickness + AA_SIZE);
- d2 = nk_vec2_muls(normals[points_count-1], half_inner_thickness);
-
- temp[(points_count-1)*4+0] = nk_vec2_add(points[points_count-1], d1);
- temp[(points_count-1)*4+1] = nk_vec2_add(points[points_count-1], d2);
- temp[(points_count-1)*4+2] = nk_vec2_sub(points[points_count-1], d2);
- temp[(points_count-1)*4+3] = nk_vec2_sub(points[points_count-1], d1);
- }
-
- /* add all elements */
- idx1 = index;
- for (i1 = 0; i1 < count; ++i1) {
- struct nk_vec2 dm_out, dm_in;
- const nk_size i2 = ((i1+1) == points_count) ? 0: (i1 + 1);
- nk_size idx2 = ((i1+1) == points_count) ? index: (idx1 + 4);
-
- /* average normals */
- struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(normals[i1], normals[i2]), 0.5f);
- float dmr2 = dm.x * dm.x + dm.y* dm.y;
- if (dmr2 > 0.000001f) {
- float scale = 1.0f/dmr2;
- scale = NK_MIN(100.0f, scale);
- dm = nk_vec2_muls(dm, scale);
- }
-
- dm_out = nk_vec2_muls(dm, ((half_inner_thickness) + AA_SIZE));
- dm_in = nk_vec2_muls(dm, half_inner_thickness);
- temp[i2*4+0] = nk_vec2_add(points[i2], dm_out);
- temp[i2*4+1] = nk_vec2_add(points[i2], dm_in);
- temp[i2*4+2] = nk_vec2_sub(points[i2], dm_in);
- temp[i2*4+3] = nk_vec2_sub(points[i2], dm_out);
-
- /* add indexes */
- ids[0] = (nk_draw_index)(idx2 + 1); ids[1] = (nk_draw_index)(idx1+1);
- ids[2] = (nk_draw_index)(idx1 + 2); ids[3] = (nk_draw_index)(idx1+2);
- ids[4] = (nk_draw_index)(idx2 + 2); ids[5] = (nk_draw_index)(idx2+1);
- ids[6] = (nk_draw_index)(idx2 + 1); ids[7] = (nk_draw_index)(idx1+1);
- ids[8] = (nk_draw_index)(idx1 + 0); ids[9] = (nk_draw_index)(idx1+0);
- ids[10]= (nk_draw_index)(idx2 + 0); ids[11] = (nk_draw_index)(idx2+1);
- ids[12]= (nk_draw_index)(idx2 + 2); ids[13] = (nk_draw_index)(idx1+2);
- ids[14]= (nk_draw_index)(idx1 + 3); ids[15] = (nk_draw_index)(idx1+3);
- ids[16]= (nk_draw_index)(idx2 + 3); ids[17] = (nk_draw_index)(idx2+2);
- ids += 18;
- idx1 = idx2;
- }
-
- /* add vertices */
- for (i = 0; i < points_count; ++i) {
- const struct nk_vec2 uv = list->config.null.uv;
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+0], uv, col_trans);
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+1], uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+2], uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, temp[i*4+3], uv, col_trans);
- }
- }
- /* free temporary normals + points */
- nk_buffer_reset(list->vertices, NK_BUFFER_FRONT);
- } else {
- /* NON ANTI-ALIASED STROKE */
- nk_size i1 = 0;
- nk_size idx = list->vertex_count;
- const nk_size idx_count = count * 6;
- const nk_size vtx_count = count * 4;
- void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
- nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
- if (!vtx || !ids) return;
-
- for (i1 = 0; i1 < count; ++i1) {
- float dx, dy;
- const struct nk_vec2 uv = list->config.null.uv;
- const nk_size i2 = ((i1+1) == points_count) ? 0 : i1 + 1;
- const struct nk_vec2 p1 = points[i1];
- const struct nk_vec2 p2 = points[i2];
- struct nk_vec2 diff = nk_vec2_sub(p2, p1);
- float len;
-
- /* vec2 inverted length */
- len = nk_vec2_len_sqr(diff);
- if (len != 0.0f)
- len = nk_inv_sqrt(len);
- else len = 1.0f;
- diff = nk_vec2_muls(diff, len);
-
- /* add vertices */
- dx = diff.x * (thickness * 0.5f);
- dy = diff.y * (thickness * 0.5f);
-
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x + dy, p1.y - dx), uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x + dy, p2.y - dx), uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p2.x - dy, p2.y + dx), uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(p1.x - dy, p1.y + dx), uv, col);
-
- ids[0] = (nk_draw_index)(idx+0); ids[1] = (nk_draw_index)(idx+1);
- ids[2] = (nk_draw_index)(idx+2); ids[3] = (nk_draw_index)(idx+0);
- ids[4] = (nk_draw_index)(idx+2); ids[5] = (nk_draw_index)(idx+3);
-
- ids += 6;
- idx += 4;
- }
- }
-}
-
-NK_API void
-nk_draw_list_fill_poly_convex(struct nk_draw_list *list,
- const struct nk_vec2 *points, const unsigned int points_count,
- struct nk_color color, enum nk_anti_aliasing aliasing)
-{
- struct nk_colorf col;
- struct nk_colorf col_trans;
-
- NK_STORAGE const nk_size pnt_align = NK_ALIGNOF(struct nk_vec2);
- NK_STORAGE const nk_size pnt_size = sizeof(struct nk_vec2);
- NK_ASSERT(list);
- if (!list || points_count < 3) return;
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- nk_draw_list_push_userdata(list, list->userdata);
-#endif
-
- color.a = (nk_byte)((float)color.a * list->config.global_alpha);
- nk_color_fv(&col.r, color);
- col_trans = col;
- col_trans.a = 0;
-
- if (aliasing == NK_ANTI_ALIASING_ON) {
- nk_size i = 0;
- nk_size i0 = 0;
- nk_size i1 = 0;
-
- const float AA_SIZE = 1.0f;
- nk_size vertex_offset = 0;
- nk_size index = list->vertex_count;
-
- const nk_size idx_count = (points_count-2)*3 + points_count*6;
- const nk_size vtx_count = (points_count*2);
-
- void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
- nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
-
- nk_size size = 0;
- struct nk_vec2 *normals = 0;
- unsigned int vtx_inner_idx = (unsigned int)(index + 0);
- unsigned int vtx_outer_idx = (unsigned int)(index + 1);
- if (!vtx || !ids) return;
-
- /* temporary allocate normals */
- vertex_offset = (nk_size)((nk_byte*)vtx - (nk_byte*)list->vertices->memory.ptr);
- nk_buffer_mark(list->vertices, NK_BUFFER_FRONT);
- size = pnt_size * points_count;
- normals = (struct nk_vec2*) nk_buffer_alloc(list->vertices, NK_BUFFER_FRONT, size, pnt_align);
- NK_ASSERT(normals);
- if (!normals) return;
- vtx = (void*)((nk_byte*)list->vertices->memory.ptr + vertex_offset);
-
- /* add elements */
- for (i = 2; i < points_count; i++) {
- ids[0] = (nk_draw_index)(vtx_inner_idx);
- ids[1] = (nk_draw_index)(vtx_inner_idx + ((i-1) << 1));
- ids[2] = (nk_draw_index)(vtx_inner_idx + (i << 1));
- ids += 3;
- }
-
- /* compute normals */
- for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
- struct nk_vec2 p0 = points[i0];
- struct nk_vec2 p1 = points[i1];
- struct nk_vec2 diff = nk_vec2_sub(p1, p0);
-
- /* vec2 inverted length */
- float len = nk_vec2_len_sqr(diff);
- if (len != 0.0f)
- len = nk_inv_sqrt(len);
- else len = 1.0f;
- diff = nk_vec2_muls(diff, len);
-
- normals[i0].x = diff.y;
- normals[i0].y = -diff.x;
- }
-
- /* add vertices + indexes */
- for (i0 = points_count-1, i1 = 0; i1 < points_count; i0 = i1++) {
- const struct nk_vec2 uv = list->config.null.uv;
- struct nk_vec2 n0 = normals[i0];
- struct nk_vec2 n1 = normals[i1];
- struct nk_vec2 dm = nk_vec2_muls(nk_vec2_add(n0, n1), 0.5f);
- float dmr2 = dm.x*dm.x + dm.y*dm.y;
- if (dmr2 > 0.000001f) {
- float scale = 1.0f / dmr2;
- scale = NK_MIN(scale, 100.0f);
- dm = nk_vec2_muls(dm, scale);
- }
- dm = nk_vec2_muls(dm, AA_SIZE * 0.5f);
-
- /* add vertices */
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_sub(points[i1], dm), uv, col);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2_add(points[i1], dm), uv, col_trans);
-
- /* add indexes */
- ids[0] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
- ids[1] = (nk_draw_index)(vtx_inner_idx+(i0<<1));
- ids[2] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
- ids[3] = (nk_draw_index)(vtx_outer_idx+(i0<<1));
- ids[4] = (nk_draw_index)(vtx_outer_idx+(i1<<1));
- ids[5] = (nk_draw_index)(vtx_inner_idx+(i1<<1));
- ids += 6;
- }
- /* free temporary normals + points */
- nk_buffer_reset(list->vertices, NK_BUFFER_FRONT);
- } else {
- nk_size i = 0;
- nk_size index = list->vertex_count;
- const nk_size idx_count = (points_count-2)*3;
- const nk_size vtx_count = points_count;
- void *vtx = nk_draw_list_alloc_vertices(list, vtx_count);
- nk_draw_index *ids = nk_draw_list_alloc_elements(list, idx_count);
-
- if (!vtx || !ids) return;
- for (i = 0; i < vtx_count; ++i)
- vtx = nk_draw_vertex(vtx, &list->config, points[i], list->config.null.uv, col);
- for (i = 2; i < points_count; ++i) {
- ids[0] = (nk_draw_index)index;
- ids[1] = (nk_draw_index)(index+ i - 1);
- ids[2] = (nk_draw_index)(index+i);
- ids += 3;
- }
- }
-}
-
-NK_API void
-nk_draw_list_path_clear(struct nk_draw_list *list)
-{
- NK_ASSERT(list);
- if (!list) return;
- nk_buffer_reset(list->buffer, NK_BUFFER_FRONT);
- list->path_count = 0;
- list->path_offset = 0;
-}
-
-NK_API void
-nk_draw_list_path_line_to(struct nk_draw_list *list, struct nk_vec2 pos)
-{
- struct nk_vec2 *points = 0;
- struct nk_draw_command *cmd = 0;
- NK_ASSERT(list);
- if (!list) return;
- if (!list->cmd_count)
- nk_draw_list_add_clip(list, nk_null_rect);
-
- cmd = nk_draw_list_command_last(list);
- if (cmd && cmd->texture.ptr != list->config.null.texture.ptr)
- nk_draw_list_push_image(list, list->config.null.texture);
-
- points = nk_draw_list_alloc_path(list, 1);
- if (!points) return;
- points[0] = pos;
-}
-
-NK_API void
-nk_draw_list_path_arc_to_fast(struct nk_draw_list *list, struct nk_vec2 center,
- float radius, int a_min, int a_max)
-{
- int a = 0;
- NK_ASSERT(list);
- if (!list) return;
- if (a_min <= a_max) {
- for (a = a_min; a <= a_max; a++) {
- const struct nk_vec2 c = list->circle_vtx[(nk_size)a % NK_LEN(list->circle_vtx)];
- const float x = center.x + c.x * radius;
- const float y = center.y + c.y * radius;
- nk_draw_list_path_line_to(list, nk_vec2(x, y));
- }
- }
-}
-
-NK_API void
-nk_draw_list_path_arc_to(struct nk_draw_list *list, struct nk_vec2 center,
- float radius, float a_min, float a_max, unsigned int segments)
-{
- unsigned int i = 0;
- NK_ASSERT(list);
- if (!list) return;
- if (radius == 0.0f) return;
-
- /* This algorithm for arc drawing relies on these two trigonometric identities[1]:
- sin(a + b) = sin(a) * cos(b) + cos(a) * sin(b)
- cos(a + b) = cos(a) * cos(b) - sin(a) * sin(b)
-
- Two coordinates (x, y) of a point on a circle centered on
- the origin can be written in polar form as:
- x = r * cos(a)
- y = r * sin(a)
- where r is the radius of the circle,
- a is the angle between (x, y) and the origin.
-
- This allows us to rotate the coordinates around the
- origin by an angle b using the following transformation:
- x' = r * cos(a + b) = x * cos(b) - y * sin(b)
- y' = r * sin(a + b) = y * cos(b) + x * sin(b)
-
- [1] https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Angle_sum_and_difference_identities
- */
- {const float d_angle = (a_max - a_min) / (float)segments;
- const float sin_d = (float)NK_SIN(d_angle);
- const float cos_d = (float)NK_COS(d_angle);
-
- float cx = (float)NK_COS(a_min) * radius;
- float cy = (float)NK_SIN(a_min) * radius;
- for(i = 0; i <= segments; ++i) {
- float new_cx, new_cy;
- const float x = center.x + cx;
- const float y = center.y + cy;
- nk_draw_list_path_line_to(list, nk_vec2(x, y));
-
- new_cx = cx * cos_d - cy * sin_d;
- new_cy = cy * cos_d + cx * sin_d;
- cx = new_cx;
- cy = new_cy;
- }}
-}
-
-NK_API void
-nk_draw_list_path_rect_to(struct nk_draw_list *list, struct nk_vec2 a,
- struct nk_vec2 b, float rounding)
-{
- float r;
- NK_ASSERT(list);
- if (!list) return;
- r = rounding;
- r = NK_MIN(r, ((b.x-a.x) < 0) ? -(b.x-a.x): (b.x-a.x));
- r = NK_MIN(r, ((b.y-a.y) < 0) ? -(b.y-a.y): (b.y-a.y));
-
- if (r == 0.0f) {
- nk_draw_list_path_line_to(list, a);
- nk_draw_list_path_line_to(list, nk_vec2(b.x,a.y));
- nk_draw_list_path_line_to(list, b);
- nk_draw_list_path_line_to(list, nk_vec2(a.x,b.y));
- } else {
- nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, a.y + r), r, 6, 9);
- nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, a.y + r), r, 9, 12);
- nk_draw_list_path_arc_to_fast(list, nk_vec2(b.x - r, b.y - r), r, 0, 3);
- nk_draw_list_path_arc_to_fast(list, nk_vec2(a.x + r, b.y - r), r, 3, 6);
- }
-}
-
-NK_API void
-nk_draw_list_path_curve_to(struct nk_draw_list *list, struct nk_vec2 p2,
- struct nk_vec2 p3, struct nk_vec2 p4, unsigned int num_segments)
-{
- float t_step;
- unsigned int i_step;
- struct nk_vec2 p1;
-
- NK_ASSERT(list);
- NK_ASSERT(list->path_count);
- if (!list || !list->path_count) return;
- num_segments = NK_MAX(num_segments, 1);
-
- p1 = nk_draw_list_path_last(list);
- t_step = 1.0f/(float)num_segments;
- for (i_step = 1; i_step <= num_segments; ++i_step) {
- float t = t_step * (float)i_step;
- float u = 1.0f - t;
- float w1 = u*u*u;
- float w2 = 3*u*u*t;
- float w3 = 3*u*t*t;
- float w4 = t * t *t;
- float x = w1 * p1.x + w2 * p2.x + w3 * p3.x + w4 * p4.x;
- float y = w1 * p1.y + w2 * p2.y + w3 * p3.y + w4 * p4.y;
- nk_draw_list_path_line_to(list, nk_vec2(x,y));
- }
-}
-
-NK_API void
-nk_draw_list_path_fill(struct nk_draw_list *list, struct nk_color color)
-{
- struct nk_vec2 *points;
- NK_ASSERT(list);
- if (!list) return;
- points = (struct nk_vec2*)nk_buffer_memory(list->buffer);
- nk_draw_list_fill_poly_convex(list, points, list->path_count, color, list->config.shape_AA);
- nk_draw_list_path_clear(list);
-}
-
-NK_API void
-nk_draw_list_path_stroke(struct nk_draw_list *list, struct nk_color color,
- enum nk_draw_list_stroke closed, float thickness)
-{
- struct nk_vec2 *points;
- NK_ASSERT(list);
- if (!list) return;
- points = (struct nk_vec2*)nk_buffer_memory(list->buffer);
- nk_draw_list_stroke_poly_line(list, points, list->path_count, color,
- closed, thickness, list->config.line_AA);
- nk_draw_list_path_clear(list);
-}
-
-NK_API void
-nk_draw_list_stroke_line(struct nk_draw_list *list, struct nk_vec2 a,
- struct nk_vec2 b, struct nk_color col, float thickness)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
- if (list->line_AA == NK_ANTI_ALIASING_ON) {
- nk_draw_list_path_line_to(list, a);
- nk_draw_list_path_line_to(list, b);
- } else {
- nk_draw_list_path_line_to(list, nk_vec2_sub(a,nk_vec2(0.5f,0.5f)));
- nk_draw_list_path_line_to(list, nk_vec2_sub(b,nk_vec2(0.5f,0.5f)));
- }
- nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
-}
-
-NK_API void
-nk_draw_list_fill_rect(struct nk_draw_list *list, struct nk_rect rect,
- struct nk_color col, float rounding)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
-
- if (list->line_AA == NK_ANTI_ALIASING_ON) {
- nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y),
- nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
- } else {
- nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f),
- nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
- } nk_draw_list_path_fill(list, col);
-}
-
-NK_API void
-nk_draw_list_stroke_rect(struct nk_draw_list *list, struct nk_rect rect,
- struct nk_color col, float rounding, float thickness)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
- if (list->line_AA == NK_ANTI_ALIASING_ON) {
- nk_draw_list_path_rect_to(list, nk_vec2(rect.x, rect.y),
- nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
- } else {
- nk_draw_list_path_rect_to(list, nk_vec2(rect.x-0.5f, rect.y-0.5f),
- nk_vec2(rect.x + rect.w, rect.y + rect.h), rounding);
- } nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
-}
-
-NK_API void
-nk_draw_list_fill_rect_multi_color(struct nk_draw_list *list, struct nk_rect rect,
- struct nk_color left, struct nk_color top, struct nk_color right,
- struct nk_color bottom)
-{
- void *vtx;
- struct nk_colorf col_left, col_top;
- struct nk_colorf col_right, col_bottom;
- nk_draw_index *idx;
- nk_draw_index index;
-
- nk_color_fv(&col_left.r, left);
- nk_color_fv(&col_right.r, right);
- nk_color_fv(&col_top.r, top);
- nk_color_fv(&col_bottom.r, bottom);
-
- NK_ASSERT(list);
- if (!list) return;
-
- nk_draw_list_push_image(list, list->config.null.texture);
- index = (nk_draw_index)list->vertex_count;
- vtx = nk_draw_list_alloc_vertices(list, 4);
- idx = nk_draw_list_alloc_elements(list, 6);
- if (!vtx || !idx) return;
-
- idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1);
- idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0);
- idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3);
-
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y), list->config.null.uv, col_left);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y), list->config.null.uv, col_top);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x + rect.w, rect.y + rect.h), list->config.null.uv, col_right);
- vtx = nk_draw_vertex(vtx, &list->config, nk_vec2(rect.x, rect.y + rect.h), list->config.null.uv, col_bottom);
-}
-
-NK_API void
-nk_draw_list_fill_triangle(struct nk_draw_list *list, struct nk_vec2 a,
- struct nk_vec2 b, struct nk_vec2 c, struct nk_color col)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
- nk_draw_list_path_line_to(list, a);
- nk_draw_list_path_line_to(list, b);
- nk_draw_list_path_line_to(list, c);
- nk_draw_list_path_fill(list, col);
-}
-
-NK_API void
-nk_draw_list_stroke_triangle(struct nk_draw_list *list, struct nk_vec2 a,
- struct nk_vec2 b, struct nk_vec2 c, struct nk_color col, float thickness)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
- nk_draw_list_path_line_to(list, a);
- nk_draw_list_path_line_to(list, b);
- nk_draw_list_path_line_to(list, c);
- nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
-}
-
-NK_API void
-nk_draw_list_fill_circle(struct nk_draw_list *list, struct nk_vec2 center,
- float radius, struct nk_color col, unsigned int segs)
-{
- float a_max;
- NK_ASSERT(list);
- if (!list || !col.a) return;
- a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs;
- nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
- nk_draw_list_path_fill(list, col);
-}
-
-NK_API void
-nk_draw_list_stroke_circle(struct nk_draw_list *list, struct nk_vec2 center,
- float radius, struct nk_color col, unsigned int segs, float thickness)
-{
- float a_max;
- NK_ASSERT(list);
- if (!list || !col.a) return;
- a_max = NK_PI * 2.0f * ((float)segs - 1.0f) / (float)segs;
- nk_draw_list_path_arc_to(list, center, radius, 0.0f, a_max, segs);
- nk_draw_list_path_stroke(list, col, NK_STROKE_CLOSED, thickness);
-}
-
-NK_API void
-nk_draw_list_stroke_curve(struct nk_draw_list *list, struct nk_vec2 p0,
- struct nk_vec2 cp0, struct nk_vec2 cp1, struct nk_vec2 p1,
- struct nk_color col, unsigned int segments, float thickness)
-{
- NK_ASSERT(list);
- if (!list || !col.a) return;
- nk_draw_list_path_line_to(list, p0);
- nk_draw_list_path_curve_to(list, cp0, cp1, p1, segments);
- nk_draw_list_path_stroke(list, col, NK_STROKE_OPEN, thickness);
-}
-
-NK_INTERN void
-nk_draw_list_push_rect_uv(struct nk_draw_list *list, struct nk_vec2 a,
- struct nk_vec2 c, struct nk_vec2 uva, struct nk_vec2 uvc,
- struct nk_color color)
-{
- void *vtx;
- struct nk_vec2 uvb;
- struct nk_vec2 uvd;
- struct nk_vec2 b;
- struct nk_vec2 d;
-
- struct nk_colorf col;
- nk_draw_index *idx;
- nk_draw_index index;
- NK_ASSERT(list);
- if (!list) return;
-
- nk_color_fv(&col.r, color);
- uvb = nk_vec2(uvc.x, uva.y);
- uvd = nk_vec2(uva.x, uvc.y);
- b = nk_vec2(c.x, a.y);
- d = nk_vec2(a.x, c.y);
-
- index = (nk_draw_index)list->vertex_count;
- vtx = nk_draw_list_alloc_vertices(list, 4);
- idx = nk_draw_list_alloc_elements(list, 6);
- if (!vtx || !idx) return;
-
- idx[0] = (nk_draw_index)(index+0); idx[1] = (nk_draw_index)(index+1);
- idx[2] = (nk_draw_index)(index+2); idx[3] = (nk_draw_index)(index+0);
- idx[4] = (nk_draw_index)(index+2); idx[5] = (nk_draw_index)(index+3);
-
- vtx = nk_draw_vertex(vtx, &list->config, a, uva, col);
- vtx = nk_draw_vertex(vtx, &list->config, b, uvb, col);
- vtx = nk_draw_vertex(vtx, &list->config, c, uvc, col);
- vtx = nk_draw_vertex(vtx, &list->config, d, uvd, col);
-}
-
-NK_API void
-nk_draw_list_add_image(struct nk_draw_list *list, struct nk_image texture,
- struct nk_rect rect, struct nk_color color)
-{
- NK_ASSERT(list);
- if (!list) return;
- /* push new command with given texture */
- nk_draw_list_push_image(list, texture.handle);
- if (nk_image_is_subimage(&texture)) {
- /* add region inside of the texture */
- struct nk_vec2 uv[2];
- uv[0].x = (float)texture.region[0]/(float)texture.w;
- uv[0].y = (float)texture.region[1]/(float)texture.h;
- uv[1].x = (float)(texture.region[0] + texture.region[2])/(float)texture.w;
- uv[1].y = (float)(texture.region[1] + texture.region[3])/(float)texture.h;
- nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y),
- nk_vec2(rect.x + rect.w, rect.y + rect.h), uv[0], uv[1], color);
- } else nk_draw_list_push_rect_uv(list, nk_vec2(rect.x, rect.y),
- nk_vec2(rect.x + rect.w, rect.y + rect.h),
- nk_vec2(0.0f, 0.0f), nk_vec2(1.0f, 1.0f),color);
-}
-
-NK_API void
-nk_draw_list_add_text(struct nk_draw_list *list, const struct nk_user_font *font,
- struct nk_rect rect, const char *text, int len, float font_height,
- struct nk_color fg)
-{
- float x = 0;
- int text_len = 0;
- nk_rune unicode = 0;
- nk_rune next = 0;
- int glyph_len = 0;
- int next_glyph_len = 0;
- struct nk_user_font_glyph g;
-
- NK_ASSERT(list);
- if (!list || !len || !text) return;
- if (!NK_INTERSECT(rect.x, rect.y, rect.w, rect.h,
- list->clip_rect.x, list->clip_rect.y, list->clip_rect.w, list->clip_rect.h)) return;
-
- nk_draw_list_push_image(list, font->texture);
- x = rect.x;
- glyph_len = nk_utf_decode(text, &unicode, len);
- if (!glyph_len) return;
-
- /* draw every glyph image */
- fg.a = (nk_byte)((float)fg.a * list->config.global_alpha);
- while (text_len < len && glyph_len) {
- float gx, gy, gh, gw;
- float char_width = 0;
- if (unicode == NK_UTF_INVALID) break;
-
- /* query currently drawn glyph information */
- next_glyph_len = nk_utf_decode(text + text_len + glyph_len, &next, (int)len - text_len);
- font->query(font->userdata, font_height, &g, unicode,
- (next == NK_UTF_INVALID) ? '\0' : next);
-
- /* calculate and draw glyph drawing rectangle and image */
- gx = x + g.offset.x;
- gy = rect.y + g.offset.y;
- gw = g.width; gh = g.height;
- char_width = g.xadvance;
- nk_draw_list_push_rect_uv(list, nk_vec2(gx,gy), nk_vec2(gx + gw, gy+ gh),
- g.uv[0], g.uv[1], fg);
-
- /* offset next glyph */
- text_len += glyph_len;
- x += char_width;
- glyph_len = next_glyph_len;
- unicode = next;
- }
-}
-
-NK_API nk_flags
-nk_convert(struct nk_context *ctx, struct nk_buffer *cmds,
- struct nk_buffer *vertices, struct nk_buffer *elements,
- const struct nk_convert_config *config)
-{
- nk_flags res = NK_CONVERT_SUCCESS;
- const struct nk_command *cmd;
- NK_ASSERT(ctx);
- NK_ASSERT(cmds);
- NK_ASSERT(vertices);
- NK_ASSERT(elements);
- NK_ASSERT(config);
- NK_ASSERT(config->vertex_layout);
- NK_ASSERT(config->vertex_size);
- if (!ctx || !cmds || !vertices || !elements || !config || !config->vertex_layout)
- return NK_CONVERT_INVALID_PARAM;
-
- nk_draw_list_setup(&ctx->draw_list, config, cmds, vertices, elements,
- config->line_AA, config->shape_AA);
- nk_foreach(cmd, ctx)
- {
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- ctx->draw_list.userdata = cmd->userdata;
-#endif
- switch (cmd->type) {
- case NK_COMMAND_NOP: break;
- case NK_COMMAND_SCISSOR: {
- const struct nk_command_scissor *s = (const struct nk_command_scissor*)cmd;
- nk_draw_list_add_clip(&ctx->draw_list, nk_rect(s->x, s->y, s->w, s->h));
- } break;
- case NK_COMMAND_LINE: {
- const struct nk_command_line *l = (const struct nk_command_line*)cmd;
- nk_draw_list_stroke_line(&ctx->draw_list, nk_vec2(l->begin.x, l->begin.y),
- nk_vec2(l->end.x, l->end.y), l->color, l->line_thickness);
- } break;
- case NK_COMMAND_CURVE: {
- const struct nk_command_curve *q = (const struct nk_command_curve*)cmd;
- nk_draw_list_stroke_curve(&ctx->draw_list, nk_vec2(q->begin.x, q->begin.y),
- nk_vec2(q->ctrl[0].x, q->ctrl[0].y), nk_vec2(q->ctrl[1].x,
- q->ctrl[1].y), nk_vec2(q->end.x, q->end.y), q->color,
- config->curve_segment_count, q->line_thickness);
- } break;
- case NK_COMMAND_RECT: {
- const struct nk_command_rect *r = (const struct nk_command_rect*)cmd;
- nk_draw_list_stroke_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
- r->color, (float)r->rounding, r->line_thickness);
- } break;
- case NK_COMMAND_RECT_FILLED: {
- const struct nk_command_rect_filled *r = (const struct nk_command_rect_filled*)cmd;
- nk_draw_list_fill_rect(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
- r->color, (float)r->rounding);
- } break;
- case NK_COMMAND_RECT_MULTI_COLOR: {
- const struct nk_command_rect_multi_color *r = (const struct nk_command_rect_multi_color*)cmd;
- nk_draw_list_fill_rect_multi_color(&ctx->draw_list, nk_rect(r->x, r->y, r->w, r->h),
- r->left, r->top, r->right, r->bottom);
- } break;
- case NK_COMMAND_CIRCLE: {
- const struct nk_command_circle *c = (const struct nk_command_circle*)cmd;
- nk_draw_list_stroke_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2,
- (float)c->y + (float)c->h/2), (float)c->w/2, c->color,
- config->circle_segment_count, c->line_thickness);
- } break;
- case NK_COMMAND_CIRCLE_FILLED: {
- const struct nk_command_circle_filled *c = (const struct nk_command_circle_filled *)cmd;
- nk_draw_list_fill_circle(&ctx->draw_list, nk_vec2((float)c->x + (float)c->w/2,
- (float)c->y + (float)c->h/2), (float)c->w/2, c->color,
- config->circle_segment_count);
- } break;
- case NK_COMMAND_ARC: {
- const struct nk_command_arc *c = (const struct nk_command_arc*)cmd;
- nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy));
- nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r,
- c->a[0], c->a[1], config->arc_segment_count);
- nk_draw_list_path_stroke(&ctx->draw_list, c->color, NK_STROKE_CLOSED, c->line_thickness);
- } break;
- case NK_COMMAND_ARC_FILLED: {
- const struct nk_command_arc_filled *c = (const struct nk_command_arc_filled*)cmd;
- nk_draw_list_path_line_to(&ctx->draw_list, nk_vec2(c->cx, c->cy));
- nk_draw_list_path_arc_to(&ctx->draw_list, nk_vec2(c->cx, c->cy), c->r,
- c->a[0], c->a[1], config->arc_segment_count);
- nk_draw_list_path_fill(&ctx->draw_list, c->color);
- } break;
- case NK_COMMAND_TRIANGLE: {
- const struct nk_command_triangle *t = (const struct nk_command_triangle*)cmd;
- nk_draw_list_stroke_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y),
- nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color,
- t->line_thickness);
- } break;
- case NK_COMMAND_TRIANGLE_FILLED: {
- const struct nk_command_triangle_filled *t = (const struct nk_command_triangle_filled*)cmd;
- nk_draw_list_fill_triangle(&ctx->draw_list, nk_vec2(t->a.x, t->a.y),
- nk_vec2(t->b.x, t->b.y), nk_vec2(t->c.x, t->c.y), t->color);
- } break;
- case NK_COMMAND_POLYGON: {
- int i;
- const struct nk_command_polygon*p = (const struct nk_command_polygon*)cmd;
- for (i = 0; i < p->point_count; ++i) {
- struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
- nk_draw_list_path_line_to(&ctx->draw_list, pnt);
- }
- nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_CLOSED, p->line_thickness);
- } break;
- case NK_COMMAND_POLYGON_FILLED: {
- int i;
- const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled*)cmd;
- for (i = 0; i < p->point_count; ++i) {
- struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
- nk_draw_list_path_line_to(&ctx->draw_list, pnt);
- }
- nk_draw_list_path_fill(&ctx->draw_list, p->color);
- } break;
- case NK_COMMAND_POLYLINE: {
- int i;
- const struct nk_command_polyline *p = (const struct nk_command_polyline*)cmd;
- for (i = 0; i < p->point_count; ++i) {
- struct nk_vec2 pnt = nk_vec2((float)p->points[i].x, (float)p->points[i].y);
- nk_draw_list_path_line_to(&ctx->draw_list, pnt);
- }
- nk_draw_list_path_stroke(&ctx->draw_list, p->color, NK_STROKE_OPEN, p->line_thickness);
- } break;
- case NK_COMMAND_TEXT: {
- const struct nk_command_text *t = (const struct nk_command_text*)cmd;
- nk_draw_list_add_text(&ctx->draw_list, t->font, nk_rect(t->x, t->y, t->w, t->h),
- t->string, t->length, t->height, t->foreground);
- } break;
- case NK_COMMAND_IMAGE: {
- const struct nk_command_image *i = (const struct nk_command_image*)cmd;
- nk_draw_list_add_image(&ctx->draw_list, i->img, nk_rect(i->x, i->y, i->w, i->h), i->col);
- } break;
- case NK_COMMAND_CUSTOM: {
- const struct nk_command_custom *c = (const struct nk_command_custom*)cmd;
- c->callback(&ctx->draw_list, c->x, c->y, c->w, c->h, c->callback_data);
- } break;
- default: break;
- }
- }
- res |= (cmds->needed > cmds->allocated + (cmds->memory.size - cmds->size)) ? NK_CONVERT_COMMAND_BUFFER_FULL: 0;
- res |= (vertices->needed > vertices->allocated) ? NK_CONVERT_VERTEX_BUFFER_FULL: 0;
- res |= (elements->needed > elements->allocated) ? NK_CONVERT_ELEMENT_BUFFER_FULL: 0;
- return res;
-}
-NK_API const struct nk_draw_command*
-nk__draw_begin(const struct nk_context *ctx,
- const struct nk_buffer *buffer)
-{return nk__draw_list_begin(&ctx->draw_list, buffer);}
-
-NK_API const struct nk_draw_command*
-nk__draw_end(const struct nk_context *ctx, const struct nk_buffer *buffer)
-{return nk__draw_list_end(&ctx->draw_list, buffer);}
-
-NK_API const struct nk_draw_command*
-nk__draw_next(const struct nk_draw_command *cmd,
- const struct nk_buffer *buffer, const struct nk_context *ctx)
-{return nk__draw_list_next(cmd, buffer, &ctx->draw_list);}
-
-#endif
-
-/*
- * ==============================================================
- *
- * FONT HANDLING
- *
- * ===============================================================
- */
-#ifdef NK_INCLUDE_FONT_BAKING
-/* -------------------------------------------------------------
- *
- * RECT PACK
- *
- * --------------------------------------------------------------*/
-/* stb_rect_pack.h - v0.05 - public domain - rectangle packing */
-/* Sean Barrett 2014 */
-#define NK_RP__MAXVAL 0xffff
-typedef unsigned short nk_rp_coord;
-
-struct nk_rp_rect {
- /* reserved for your use: */
- int id;
- /* input: */
- nk_rp_coord w, h;
- /* output: */
- nk_rp_coord x, y;
- int was_packed;
- /* non-zero if valid packing */
-}; /* 16 bytes, nominally */
-
-struct nk_rp_node {
- nk_rp_coord x,y;
- struct nk_rp_node *next;
-};
-
-struct nk_rp_context {
- int width;
- int height;
- int align;
- int init_mode;
- int heuristic;
- int num_nodes;
- struct nk_rp_node *active_head;
- struct nk_rp_node *free_head;
- struct nk_rp_node extra[2];
- /* we allocate two extra nodes so optimal user-node-count is 'width' not 'width+2' */
-};
-
-struct nk_rp__findresult {
- int x,y;
- struct nk_rp_node **prev_link;
-};
-
-enum NK_RP_HEURISTIC {
- NK_RP_HEURISTIC_Skyline_default=0,
- NK_RP_HEURISTIC_Skyline_BL_sortHeight = NK_RP_HEURISTIC_Skyline_default,
- NK_RP_HEURISTIC_Skyline_BF_sortHeight
-};
-enum NK_RP_INIT_STATE{NK_RP__INIT_skyline = 1};
-
-NK_INTERN void
-nk_rp_setup_allow_out_of_mem(struct nk_rp_context *context, int allow_out_of_mem)
-{
- if (allow_out_of_mem)
- /* if it's ok to run out of memory, then don't bother aligning them; */
- /* this gives better packing, but may fail due to OOM (even though */
- /* the rectangles easily fit). @TODO a smarter approach would be to only */
- /* quantize once we've hit OOM, then we could get rid of this parameter. */
- context->align = 1;
- else {
- /* if it's not ok to run out of memory, then quantize the widths */
- /* so that num_nodes is always enough nodes. */
- /* */
- /* I.e. num_nodes * align >= width */
- /* align >= width / num_nodes */
- /* align = ceil(width/num_nodes) */
- context->align = (context->width + context->num_nodes-1) / context->num_nodes;
- }
-}
-
-NK_INTERN void
-nk_rp_init_target(struct nk_rp_context *context, int width, int height,
- struct nk_rp_node *nodes, int num_nodes)
-{
- int i;
-#ifndef STBRP_LARGE_RECTS
- NK_ASSERT(width <= 0xffff && height <= 0xffff);
-#endif
-
- for (i=0; i < num_nodes-1; ++i)
- nodes[i].next = &nodes[i+1];
- nodes[i].next = 0;
- context->init_mode = NK_RP__INIT_skyline;
- context->heuristic = NK_RP_HEURISTIC_Skyline_default;
- context->free_head = &nodes[0];
- context->active_head = &context->extra[0];
- context->width = width;
- context->height = height;
- context->num_nodes = num_nodes;
- nk_rp_setup_allow_out_of_mem(context, 0);
-
- /* node 0 is the full width, node 1 is the sentinel (lets us not store width explicitly) */
- context->extra[0].x = 0;
- context->extra[0].y = 0;
- context->extra[0].next = &context->extra[1];
- context->extra[1].x = (nk_rp_coord) width;
- context->extra[1].y = 65535;
- context->extra[1].next = 0;
-}
-
-/* find minimum y position if it starts at x1 */
-NK_INTERN int
-nk_rp__skyline_find_min_y(struct nk_rp_context *c, struct nk_rp_node *first,
- int x0, int width, int *pwaste)
-{
- struct nk_rp_node *node = first;
- int x1 = x0 + width;
- int min_y, visited_width, waste_area;
- NK_ASSERT(first->x <= x0);
- NK_UNUSED(c);
-
- NK_ASSERT(node->next->x > x0);
- /* we ended up handling this in the caller for efficiency */
- NK_ASSERT(node->x <= x0);
-
- min_y = 0;
- waste_area = 0;
- visited_width = 0;
- while (node->x < x1)
- {
- if (node->y > min_y) {
- /* raise min_y higher. */
- /* we've accounted for all waste up to min_y, */
- /* but we'll now add more waste for everything we've visited */
- waste_area += visited_width * (node->y - min_y);
- min_y = node->y;
- /* the first time through, visited_width might be reduced */
- if (node->x < x0)
- visited_width += node->next->x - x0;
- else
- visited_width += node->next->x - node->x;
- } else {
- /* add waste area */
- int under_width = node->next->x - node->x;
- if (under_width + visited_width > width)
- under_width = width - visited_width;
- waste_area += under_width * (min_y - node->y);
- visited_width += under_width;
- }
- node = node->next;
- }
- *pwaste = waste_area;
- return min_y;
-}
-
-NK_INTERN struct nk_rp__findresult
-nk_rp__skyline_find_best_pos(struct nk_rp_context *c, int width, int height)
-{
- int best_waste = (1<<30), best_x, best_y = (1 << 30);
- struct nk_rp__findresult fr;
- struct nk_rp_node **prev, *node, *tail, **best = 0;
-
- /* align to multiple of c->align */
- width = (width + c->align - 1);
- width -= width % c->align;
- NK_ASSERT(width % c->align == 0);
-
- node = c->active_head;
- prev = &c->active_head;
- while (node->x + width <= c->width) {
- int y,waste;
- y = nk_rp__skyline_find_min_y(c, node, node->x, width, &waste);
- /* actually just want to test BL */
- if (c->heuristic == NK_RP_HEURISTIC_Skyline_BL_sortHeight) {
- /* bottom left */
- if (y < best_y) {
- best_y = y;
- best = prev;
- }
- } else {
- /* best-fit */
- if (y + height <= c->height) {
- /* can only use it if it first vertically */
- if (y < best_y || (y == best_y && waste < best_waste)) {
- best_y = y;
- best_waste = waste;
- best = prev;
- }
- }
- }
- prev = &node->next;
- node = node->next;
- }
- best_x = (best == 0) ? 0 : (*best)->x;
-
- /* if doing best-fit (BF), we also have to try aligning right edge to each node position */
- /* */
- /* e.g, if fitting */
- /* */
- /* ____________________ */
- /* |____________________| */
- /* */
- /* into */
- /* */
- /* | | */
- /* | ____________| */
- /* |____________| */
- /* */
- /* then right-aligned reduces waste, but bottom-left BL is always chooses left-aligned */
- /* */
- /* This makes BF take about 2x the time */
- if (c->heuristic == NK_RP_HEURISTIC_Skyline_BF_sortHeight)
- {
- tail = c->active_head;
- node = c->active_head;
- prev = &c->active_head;
- /* find first node that's admissible */
- while (tail->x < width)
- tail = tail->next;
- while (tail)
- {
- int xpos = tail->x - width;
- int y,waste;
- NK_ASSERT(xpos >= 0);
- /* find the left position that matches this */
- while (node->next->x <= xpos) {
- prev = &node->next;
- node = node->next;
- }
- NK_ASSERT(node->next->x > xpos && node->x <= xpos);
- y = nk_rp__skyline_find_min_y(c, node, xpos, width, &waste);
- if (y + height < c->height) {
- if (y <= best_y) {
- if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
- best_x = xpos;
- NK_ASSERT(y <= best_y);
- best_y = y;
- best_waste = waste;
- best = prev;
- }
- }
- }
- tail = tail->next;
- }
- }
- fr.prev_link = best;
- fr.x = best_x;
- fr.y = best_y;
- return fr;
-}
-
-NK_INTERN struct nk_rp__findresult
-nk_rp__skyline_pack_rectangle(struct nk_rp_context *context, int width, int height)
-{
- /* find best position according to heuristic */
- struct nk_rp__findresult res = nk_rp__skyline_find_best_pos(context, width, height);
- struct nk_rp_node *node, *cur;
-
- /* bail if: */
- /* 1. it failed */
- /* 2. the best node doesn't fit (we don't always check this) */
- /* 3. we're out of memory */
- if (res.prev_link == 0 || res.y + height > context->height || context->free_head == 0) {
- res.prev_link = 0;
- return res;
- }
-
- /* on success, create new node */
- node = context->free_head;
- node->x = (nk_rp_coord) res.x;
- node->y = (nk_rp_coord) (res.y + height);
-
- context->free_head = node->next;
-
- /* insert the new node into the right starting point, and */
- /* let 'cur' point to the remaining nodes needing to be */
- /* stitched back in */
- cur = *res.prev_link;
- if (cur->x < res.x) {
- /* preserve the existing one, so start testing with the next one */
- struct nk_rp_node *next = cur->next;
- cur->next = node;
- cur = next;
- } else {
- *res.prev_link = node;
- }
-
- /* from here, traverse cur and free the nodes, until we get to one */
- /* that shouldn't be freed */
- while (cur->next && cur->next->x <= res.x + width) {
- struct nk_rp_node *next = cur->next;
- /* move the current node to the free list */
- cur->next = context->free_head;
- context->free_head = cur;
- cur = next;
- }
- /* stitch the list back in */
- node->next = cur;
-
- if (cur->x < res.x + width)
- cur->x = (nk_rp_coord) (res.x + width);
- return res;
-}
-
-NK_INTERN int
-nk_rect_height_compare(const void *a, const void *b)
-{
- const struct nk_rp_rect *p = (const struct nk_rp_rect *) a;
- const struct nk_rp_rect *q = (const struct nk_rp_rect *) b;
- if (p->h > q->h)
- return -1;
- if (p->h < q->h)
- return 1;
- return (p->w > q->w) ? -1 : (p->w < q->w);
-}
-
-NK_INTERN int
-nk_rect_original_order(const void *a, const void *b)
-{
- const struct nk_rp_rect *p = (const struct nk_rp_rect *) a;
- const struct nk_rp_rect *q = (const struct nk_rp_rect *) b;
- return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
-}
-
-NK_INTERN void
-nk_rp_qsort(struct nk_rp_rect *array, unsigned int len, int(*cmp)(const void*,const void*))
-{
- /* iterative quick sort */
- #define NK_MAX_SORT_STACK 64
- unsigned right, left = 0, stack[NK_MAX_SORT_STACK], pos = 0;
- unsigned seed = len/2 * 69069+1;
- for (;;) {
- for (; left+1 < len; len++) {
- struct nk_rp_rect pivot, tmp;
- if (pos == NK_MAX_SORT_STACK) len = stack[pos = 0];
- pivot = array[left+seed%(len-left)];
- seed = seed * 69069 + 1;
- stack[pos++] = len;
- for (right = left-1;;) {
- while (cmp(&array[++right], &pivot) < 0);
- while (cmp(&pivot, &array[--len]) < 0);
- if (right >= len) break;
- tmp = array[right];
- array[right] = array[len];
- array[len] = tmp;
- }
- }
- if (pos == 0) break;
- left = len;
- len = stack[--pos];
- }
- #undef NK_MAX_SORT_STACK
-}
-
-NK_INTERN void
-nk_rp_pack_rects(struct nk_rp_context *context, struct nk_rp_rect *rects, int num_rects)
-{
- int i;
- /* we use the 'was_packed' field internally to allow sorting/unsorting */
- for (i=0; i < num_rects; ++i) {
- rects[i].was_packed = i;
- }
-
- /* sort according to heuristic */
- nk_rp_qsort(rects, (unsigned)num_rects, nk_rect_height_compare);
-
- for (i=0; i < num_rects; ++i) {
- struct nk_rp__findresult fr = nk_rp__skyline_pack_rectangle(context, rects[i].w, rects[i].h);
- if (fr.prev_link) {
- rects[i].x = (nk_rp_coord) fr.x;
- rects[i].y = (nk_rp_coord) fr.y;
- } else {
- rects[i].x = rects[i].y = NK_RP__MAXVAL;
- }
- }
-
- /* unsort */
- nk_rp_qsort(rects, (unsigned)num_rects, nk_rect_original_order);
-
- /* set was_packed flags */
- for (i=0; i < num_rects; ++i)
- rects[i].was_packed = !(rects[i].x == NK_RP__MAXVAL && rects[i].y == NK_RP__MAXVAL);
-}
-
-/*
- * ==============================================================
- *
- * TRUETYPE
- *
- * ===============================================================
- */
-/* stb_truetype.h - v1.07 - public domain */
-#define NK_TT_MAX_OVERSAMPLE 8
-#define NK_TT__OVER_MASK (NK_TT_MAX_OVERSAMPLE-1)
-
-struct nk_tt_bakedchar {
- unsigned short x0,y0,x1,y1;
- /* coordinates of bbox in bitmap */
- float xoff,yoff,xadvance;
-};
-
-struct nk_tt_aligned_quad{
- float x0,y0,s0,t0; /* top-left */
- float x1,y1,s1,t1; /* bottom-right */
-};
-
-struct nk_tt_packedchar {
- unsigned short x0,y0,x1,y1;
- /* coordinates of bbox in bitmap */
- float xoff,yoff,xadvance;
- float xoff2,yoff2;
-};
-
-struct nk_tt_pack_range {
- float font_size;
- int first_unicode_codepoint_in_range;
- /* if non-zero, then the chars are continuous, and this is the first codepoint */
- int *array_of_unicode_codepoints;
- /* if non-zero, then this is an array of unicode codepoints */
- int num_chars;
- struct nk_tt_packedchar *chardata_for_range; /* output */
- unsigned char h_oversample, v_oversample;
- /* don't set these, they're used internally */
-};
-
-struct nk_tt_pack_context {
- void *pack_info;
- int width;
- int height;
- int stride_in_bytes;
- int padding;
- unsigned int h_oversample, v_oversample;
- unsigned char *pixels;
- void *nodes;
-};
-
-struct nk_tt_fontinfo {
- const unsigned char* data; /* pointer to .ttf file */
- int fontstart;/* offset of start of font */
- int numGlyphs;/* number of glyphs, needed for range checking */
- int loca,head,glyf,hhea,hmtx,kern; /* table locations as offset from start of .ttf */
- int index_map; /* a cmap mapping for our chosen character encoding */
- int indexToLocFormat; /* format needed to map from glyph index to glyph */
-};
-
-enum {
- NK_TT_vmove=1,
- NK_TT_vline,
- NK_TT_vcurve
-};
-
-struct nk_tt_vertex {
- short x,y,cx,cy;
- unsigned char type,padding;
-};
-
-struct nk_tt__bitmap{
- int w,h,stride;
- unsigned char *pixels;
-};
-
-struct nk_tt__hheap_chunk {
- struct nk_tt__hheap_chunk *next;
-};
-struct nk_tt__hheap {
- struct nk_allocator alloc;
- struct nk_tt__hheap_chunk *head;
- void *first_free;
- int num_remaining_in_head_chunk;
-};
-
-struct nk_tt__edge {
- float x0,y0, x1,y1;
- int invert;
-};
-
-struct nk_tt__active_edge {
- struct nk_tt__active_edge *next;
- float fx,fdx,fdy;
- float direction;
- float sy;
- float ey;
-};
-struct nk_tt__point {float x,y;};
-
-#define NK_TT_MACSTYLE_DONTCARE 0
-#define NK_TT_MACSTYLE_BOLD 1
-#define NK_TT_MACSTYLE_ITALIC 2
-#define NK_TT_MACSTYLE_UNDERSCORE 4
-#define NK_TT_MACSTYLE_NONE 8
-/* <= not same as 0, this makes us check the bitfield is 0 */
-
-enum { /* platformID */
- NK_TT_PLATFORM_ID_UNICODE =0,
- NK_TT_PLATFORM_ID_MAC =1,
- NK_TT_PLATFORM_ID_ISO =2,
- NK_TT_PLATFORM_ID_MICROSOFT =3
-};
-
-enum { /* encodingID for NK_TT_PLATFORM_ID_UNICODE */
- NK_TT_UNICODE_EID_UNICODE_1_0 =0,
- NK_TT_UNICODE_EID_UNICODE_1_1 =1,
- NK_TT_UNICODE_EID_ISO_10646 =2,
- NK_TT_UNICODE_EID_UNICODE_2_0_BMP=3,
- NK_TT_UNICODE_EID_UNICODE_2_0_FULL=4
-};
-
-enum { /* encodingID for NK_TT_PLATFORM_ID_MICROSOFT */
- NK_TT_MS_EID_SYMBOL =0,
- NK_TT_MS_EID_UNICODE_BMP =1,
- NK_TT_MS_EID_SHIFTJIS =2,
- NK_TT_MS_EID_UNICODE_FULL =10
-};
-
-enum { /* encodingID for NK_TT_PLATFORM_ID_MAC; same as Script Manager codes */
- NK_TT_MAC_EID_ROMAN =0, NK_TT_MAC_EID_ARABIC =4,
- NK_TT_MAC_EID_JAPANESE =1, NK_TT_MAC_EID_HEBREW =5,
- NK_TT_MAC_EID_CHINESE_TRAD =2, NK_TT_MAC_EID_GREEK =6,
- NK_TT_MAC_EID_KOREAN =3, NK_TT_MAC_EID_RUSSIAN =7
-};
-
-enum { /* languageID for NK_TT_PLATFORM_ID_MICROSOFT; same as LCID... */
- /* problematic because there are e.g. 16 english LCIDs and 16 arabic LCIDs */
- NK_TT_MS_LANG_ENGLISH =0x0409, NK_TT_MS_LANG_ITALIAN =0x0410,
- NK_TT_MS_LANG_CHINESE =0x0804, NK_TT_MS_LANG_JAPANESE =0x0411,
- NK_TT_MS_LANG_DUTCH =0x0413, NK_TT_MS_LANG_KOREAN =0x0412,
- NK_TT_MS_LANG_FRENCH =0x040c, NK_TT_MS_LANG_RUSSIAN =0x0419,
- NK_TT_MS_LANG_GERMAN =0x0407, NK_TT_MS_LANG_SPANISH =0x0409,
- NK_TT_MS_LANG_HEBREW =0x040d, NK_TT_MS_LANG_SWEDISH =0x041D
-};
-
-enum { /* languageID for NK_TT_PLATFORM_ID_MAC */
- NK_TT_MAC_LANG_ENGLISH =0 , NK_TT_MAC_LANG_JAPANESE =11,
- NK_TT_MAC_LANG_ARABIC =12, NK_TT_MAC_LANG_KOREAN =23,
- NK_TT_MAC_LANG_DUTCH =4 , NK_TT_MAC_LANG_RUSSIAN =32,
- NK_TT_MAC_LANG_FRENCH =1 , NK_TT_MAC_LANG_SPANISH =6 ,
- NK_TT_MAC_LANG_GERMAN =2 , NK_TT_MAC_LANG_SWEDISH =5 ,
- NK_TT_MAC_LANG_HEBREW =10, NK_TT_MAC_LANG_CHINESE_SIMPLIFIED =33,
- NK_TT_MAC_LANG_ITALIAN =3 , NK_TT_MAC_LANG_CHINESE_TRAD =19
-};
-
-#define nk_ttBYTE(p) (* (const nk_byte *) (p))
-#define nk_ttCHAR(p) (* (const char *) (p))
-
-#if defined(NK_BIGENDIAN) && !defined(NK_ALLOW_UNALIGNED_TRUETYPE)
- #define nk_ttUSHORT(p) (* (nk_ushort *) (p))
- #define nk_ttSHORT(p) (* (nk_short *) (p))
- #define nk_ttULONG(p) (* (nk_uint *) (p))
- #define nk_ttLONG(p) (* (nk_int *) (p))
-#else
- static nk_ushort nk_ttUSHORT(const nk_byte *p) { return (nk_ushort)(p[0]*256 + p[1]); }
- static nk_short nk_ttSHORT(const nk_byte *p) { return (nk_short)(p[0]*256 + p[1]); }
- static nk_uint nk_ttULONG(const nk_byte *p) { return (nk_uint)((p[0]<<24) + (p[1]<<16) + (p[2]<<8) + p[3]); }
-#endif
-
-#define nk_tt_tag4(p,c0,c1,c2,c3)\
- ((p)[0] == (c0) && (p)[1] == (c1) && (p)[2] == (c2) && (p)[3] == (c3))
-#define nk_tt_tag(p,str) nk_tt_tag4(p,str[0],str[1],str[2],str[3])
-
-NK_INTERN int nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *alloc,
- int glyph_index, struct nk_tt_vertex **pvertices);
-
-NK_INTERN nk_uint
-nk_tt__find_table(const nk_byte *data, nk_uint fontstart, const char *tag)
-{
- /* @OPTIMIZE: binary search */
- nk_int num_tables = nk_ttUSHORT(data+fontstart+4);
- nk_uint tabledir = fontstart + 12;
- nk_int i;
- for (i = 0; i < num_tables; ++i) {
- nk_uint loc = tabledir + (nk_uint)(16*i);
- if (nk_tt_tag(data+loc+0, tag))
- return nk_ttULONG(data+loc+8);
- }
- return 0;
-}
-
-NK_INTERN int
-nk_tt_InitFont(struct nk_tt_fontinfo *info, const unsigned char *data2, int fontstart)
-{
- nk_uint cmap, t;
- nk_int i,numTables;
- const nk_byte *data = (const nk_byte *) data2;
-
- info->data = data;
- info->fontstart = fontstart;
-
- cmap = nk_tt__find_table(data, (nk_uint)fontstart, "cmap"); /* required */
- info->loca = (int)nk_tt__find_table(data, (nk_uint)fontstart, "loca"); /* required */
- info->head = (int)nk_tt__find_table(data, (nk_uint)fontstart, "head"); /* required */
- info->glyf = (int)nk_tt__find_table(data, (nk_uint)fontstart, "glyf"); /* required */
- info->hhea = (int)nk_tt__find_table(data, (nk_uint)fontstart, "hhea"); /* required */
- info->hmtx = (int)nk_tt__find_table(data, (nk_uint)fontstart, "hmtx"); /* required */
- info->kern = (int)nk_tt__find_table(data, (nk_uint)fontstart, "kern"); /* not required */
- if (!cmap || !info->loca || !info->head || !info->glyf || !info->hhea || !info->hmtx)
- return 0;
-
- t = nk_tt__find_table(data, (nk_uint)fontstart, "maxp");
- if (t) info->numGlyphs = nk_ttUSHORT(data+t+4);
- else info->numGlyphs = 0xffff;
-
- /* find a cmap encoding table we understand *now* to avoid searching */
- /* later. (todo: could make this installable) */
- /* the same regardless of glyph. */
- numTables = nk_ttUSHORT(data + cmap + 2);
- info->index_map = 0;
- for (i=0; i < numTables; ++i)
- {
- nk_uint encoding_record = cmap + 4 + 8 * (nk_uint)i;
- /* find an encoding we understand: */
- switch(nk_ttUSHORT(data+encoding_record)) {
- case NK_TT_PLATFORM_ID_MICROSOFT:
- switch (nk_ttUSHORT(data+encoding_record+2)) {
- case NK_TT_MS_EID_UNICODE_BMP:
- case NK_TT_MS_EID_UNICODE_FULL:
- /* MS/Unicode */
- info->index_map = (int)(cmap + nk_ttULONG(data+encoding_record+4));
- break;
- default: break;
- } break;
- case NK_TT_PLATFORM_ID_UNICODE:
- /* Mac/iOS has these */
- /* all the encodingIDs are unicode, so we don't bother to check it */
- info->index_map = (int)(cmap + nk_ttULONG(data+encoding_record+4));
- break;
- default: break;
- }
- }
- if (info->index_map == 0)
- return 0;
- info->indexToLocFormat = nk_ttUSHORT(data+info->head + 50);
- return 1;
-}
-
-NK_INTERN int
-nk_tt_FindGlyphIndex(const struct nk_tt_fontinfo *info, int unicode_codepoint)
-{
- const nk_byte *data = info->data;
- nk_uint index_map = (nk_uint)info->index_map;
-
- nk_ushort format = nk_ttUSHORT(data + index_map + 0);
- if (format == 0) { /* apple byte encoding */
- nk_int bytes = nk_ttUSHORT(data + index_map + 2);
- if (unicode_codepoint < bytes-6)
- return nk_ttBYTE(data + index_map + 6 + unicode_codepoint);
- return 0;
- } else if (format == 6) {
- nk_uint first = nk_ttUSHORT(data + index_map + 6);
- nk_uint count = nk_ttUSHORT(data + index_map + 8);
- if ((nk_uint) unicode_codepoint >= first && (nk_uint) unicode_codepoint < first+count)
- return nk_ttUSHORT(data + index_map + 10 + (unicode_codepoint - (int)first)*2);
- return 0;
- } else if (format == 2) {
- NK_ASSERT(0); /* @TODO: high-byte mapping for japanese/chinese/korean */
- return 0;
- } else if (format == 4) { /* standard mapping for windows fonts: binary search collection of ranges */
- nk_ushort segcount = nk_ttUSHORT(data+index_map+6) >> 1;
- nk_ushort searchRange = nk_ttUSHORT(data+index_map+8) >> 1;
- nk_ushort entrySelector = nk_ttUSHORT(data+index_map+10);
- nk_ushort rangeShift = nk_ttUSHORT(data+index_map+12) >> 1;
-
- /* do a binary search of the segments */
- nk_uint endCount = index_map + 14;
- nk_uint search = endCount;
-
- if (unicode_codepoint > 0xffff)
- return 0;
-
- /* they lie from endCount .. endCount + segCount */
- /* but searchRange is the nearest power of two, so... */
- if (unicode_codepoint >= nk_ttUSHORT(data + search + rangeShift*2))
- search += (nk_uint)(rangeShift*2);
-
- /* now decrement to bias correctly to find smallest */
- search -= 2;
- while (entrySelector) {
- nk_ushort end;
- searchRange >>= 1;
- end = nk_ttUSHORT(data + search + searchRange*2);
- if (unicode_codepoint > end)
- search += (nk_uint)(searchRange*2);
- --entrySelector;
- }
- search += 2;
-
- {
- nk_ushort offset, start;
- nk_ushort item = (nk_ushort) ((search - endCount) >> 1);
-
- NK_ASSERT(unicode_codepoint <= nk_ttUSHORT(data + endCount + 2*item));
- start = nk_ttUSHORT(data + index_map + 14 + segcount*2 + 2 + 2*item);
- if (unicode_codepoint < start)
- return 0;
-
- offset = nk_ttUSHORT(data + index_map + 14 + segcount*6 + 2 + 2*item);
- if (offset == 0)
- return (nk_ushort) (unicode_codepoint + nk_ttSHORT(data + index_map + 14 + segcount*4 + 2 + 2*item));
-
- return nk_ttUSHORT(data + offset + (unicode_codepoint-start)*2 + index_map + 14 + segcount*6 + 2 + 2*item);
- }
- } else if (format == 12 || format == 13) {
- nk_uint ngroups = nk_ttULONG(data+index_map+12);
- nk_int low,high;
- low = 0; high = (nk_int)ngroups;
- /* Binary search the right group. */
- while (low < high) {
- nk_int mid = low + ((high-low) >> 1); /* rounds down, so low <= mid < high */
- nk_uint start_char = nk_ttULONG(data+index_map+16+mid*12);
- nk_uint end_char = nk_ttULONG(data+index_map+16+mid*12+4);
- if ((nk_uint) unicode_codepoint < start_char)
- high = mid;
- else if ((nk_uint) unicode_codepoint > end_char)
- low = mid+1;
- else {
- nk_uint start_glyph = nk_ttULONG(data+index_map+16+mid*12+8);
- if (format == 12)
- return (int)start_glyph + (int)unicode_codepoint - (int)start_char;
- else /* format == 13 */
- return (int)start_glyph;
- }
- }
- return 0; /* not found */
- }
- /* @TODO */
- NK_ASSERT(0);
- return 0;
-}
-
-NK_INTERN void
-nk_tt_setvertex(struct nk_tt_vertex *v, nk_byte type, nk_int x, nk_int y, nk_int cx, nk_int cy)
-{
- v->type = type;
- v->x = (nk_short) x;
- v->y = (nk_short) y;
- v->cx = (nk_short) cx;
- v->cy = (nk_short) cy;
-}
-
-NK_INTERN int
-nk_tt__GetGlyfOffset(const struct nk_tt_fontinfo *info, int glyph_index)
-{
- int g1,g2;
- if (glyph_index >= info->numGlyphs) return -1; /* glyph index out of range */
- if (info->indexToLocFormat >= 2) return -1; /* unknown index->glyph map format */
-
- if (info->indexToLocFormat == 0) {
- g1 = info->glyf + nk_ttUSHORT(info->data + info->loca + glyph_index * 2) * 2;
- g2 = info->glyf + nk_ttUSHORT(info->data + info->loca + glyph_index * 2 + 2) * 2;
- } else {
- g1 = info->glyf + (int)nk_ttULONG (info->data + info->loca + glyph_index * 4);
- g2 = info->glyf + (int)nk_ttULONG (info->data + info->loca + glyph_index * 4 + 4);
- }
- return g1==g2 ? -1 : g1; /* if length is 0, return -1 */
-}
-
-NK_INTERN int
-nk_tt_GetGlyphBox(const struct nk_tt_fontinfo *info, int glyph_index,
- int *x0, int *y0, int *x1, int *y1)
-{
- int g = nk_tt__GetGlyfOffset(info, glyph_index);
- if (g < 0) return 0;
-
- if (x0) *x0 = nk_ttSHORT(info->data + g + 2);
- if (y0) *y0 = nk_ttSHORT(info->data + g + 4);
- if (x1) *x1 = nk_ttSHORT(info->data + g + 6);
- if (y1) *y1 = nk_ttSHORT(info->data + g + 8);
- return 1;
-}
-
-NK_INTERN int
-nk_tt__close_shape(struct nk_tt_vertex *vertices, int num_vertices, int was_off,
- int start_off, nk_int sx, nk_int sy, nk_int scx, nk_int scy, nk_int cx, nk_int cy)
-{
- if (start_off) {
- if (was_off)
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, (cx+scx)>>1, (cy+scy)>>1, cx,cy);
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, sx,sy,scx,scy);
- } else {
- if (was_off)
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve,sx,sy,cx,cy);
- else
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vline,sx,sy,0,0);
- }
- return num_vertices;
-}
-
-NK_INTERN int
-nk_tt_GetGlyphShape(const struct nk_tt_fontinfo *info, struct nk_allocator *alloc,
- int glyph_index, struct nk_tt_vertex **pvertices)
-{
- nk_short numberOfContours;
- const nk_byte *endPtsOfContours;
- const nk_byte *data = info->data;
- struct nk_tt_vertex *vertices=0;
- int num_vertices=0;
- int g = nk_tt__GetGlyfOffset(info, glyph_index);
- *pvertices = 0;
-
- if (g < 0) return 0;
- numberOfContours = nk_ttSHORT(data + g);
- if (numberOfContours > 0) {
- nk_byte flags=0,flagcount;
- nk_int ins, i,j=0,m,n, next_move, was_off=0, off, start_off=0;
- nk_int x,y,cx,cy,sx,sy, scx,scy;
- const nk_byte *points;
- endPtsOfContours = (data + g + 10);
- ins = nk_ttUSHORT(data + g + 10 + numberOfContours * 2);
- points = data + g + 10 + numberOfContours * 2 + 2 + ins;
-
- n = 1+nk_ttUSHORT(endPtsOfContours + numberOfContours*2-2);
- m = n + 2*numberOfContours; /* a loose bound on how many vertices we might need */
- vertices = (struct nk_tt_vertex *)alloc->alloc(alloc->userdata, 0, (nk_size)m * sizeof(vertices[0]));
- if (vertices == 0)
- return 0;
-
- next_move = 0;
- flagcount=0;
-
- /* in first pass, we load uninterpreted data into the allocated array */
- /* above, shifted to the end of the array so we won't overwrite it when */
- /* we create our final data starting from the front */
- off = m - n; /* starting offset for uninterpreted data, regardless of how m ends up being calculated */
-
- /* first load flags */
- for (i=0; i < n; ++i) {
- if (flagcount == 0) {
- flags = *points++;
- if (flags & 8)
- flagcount = *points++;
- } else --flagcount;
- vertices[off+i].type = flags;
- }
-
- /* now load x coordinates */
- x=0;
- for (i=0; i < n; ++i) {
- flags = vertices[off+i].type;
- if (flags & 2) {
- nk_short dx = *points++;
- x += (flags & 16) ? dx : -dx; /* ??? */
- } else {
- if (!(flags & 16)) {
- x = x + (nk_short) (points[0]*256 + points[1]);
- points += 2;
- }
- }
- vertices[off+i].x = (nk_short) x;
- }
-
- /* now load y coordinates */
- y=0;
- for (i=0; i < n; ++i) {
- flags = vertices[off+i].type;
- if (flags & 4) {
- nk_short dy = *points++;
- y += (flags & 32) ? dy : -dy; /* ??? */
- } else {
- if (!(flags & 32)) {
- y = y + (nk_short) (points[0]*256 + points[1]);
- points += 2;
- }
- }
- vertices[off+i].y = (nk_short) y;
- }
-
- /* now convert them to our format */
- num_vertices=0;
- sx = sy = cx = cy = scx = scy = 0;
- for (i=0; i < n; ++i)
- {
- flags = vertices[off+i].type;
- x = (nk_short) vertices[off+i].x;
- y = (nk_short) vertices[off+i].y;
-
- if (next_move == i) {
- if (i != 0)
- num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
-
- /* now start the new one */
- start_off = !(flags & 1);
- if (start_off) {
- /* if we start off with an off-curve point, then when we need to find a point on the curve */
- /* where we can start, and we need to save some state for when we wraparound. */
- scx = x;
- scy = y;
- if (!(vertices[off+i+1].type & 1)) {
- /* next point is also a curve point, so interpolate an on-point curve */
- sx = (x + (nk_int) vertices[off+i+1].x) >> 1;
- sy = (y + (nk_int) vertices[off+i+1].y) >> 1;
- } else {
- /* otherwise just use the next point as our start point */
- sx = (nk_int) vertices[off+i+1].x;
- sy = (nk_int) vertices[off+i+1].y;
- ++i; /* we're using point i+1 as the starting point, so skip it */
- }
- } else {
- sx = x;
- sy = y;
- }
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vmove,sx,sy,0,0);
- was_off = 0;
- next_move = 1 + nk_ttUSHORT(endPtsOfContours+j*2);
- ++j;
- } else {
- if (!(flags & 1))
- { /* if it's a curve */
- if (was_off) /* two off-curve control points in a row means interpolate an on-curve midpoint */
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, (cx+x)>>1, (cy+y)>>1, cx, cy);
- cx = x;
- cy = y;
- was_off = 1;
- } else {
- if (was_off)
- nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vcurve, x,y, cx, cy);
- else nk_tt_setvertex(&vertices[num_vertices++], NK_TT_vline, x,y,0,0);
- was_off = 0;
- }
- }
- }
- num_vertices = nk_tt__close_shape(vertices, num_vertices, was_off, start_off, sx,sy,scx,scy,cx,cy);
- } else if (numberOfContours == -1) {
- /* Compound shapes. */
- int more = 1;
- const nk_byte *comp = data + g + 10;
- num_vertices = 0;
- vertices = 0;
-
- while (more)
- {
- nk_ushort flags, gidx;
- int comp_num_verts = 0, i;
- struct nk_tt_vertex *comp_verts = 0, *tmp = 0;
- float mtx[6] = {1,0,0,1,0,0}, m, n;
-
- flags = (nk_ushort)nk_ttSHORT(comp); comp+=2;
- gidx = (nk_ushort)nk_ttSHORT(comp); comp+=2;
-
- if (flags & 2) { /* XY values */
- if (flags & 1) { /* shorts */
- mtx[4] = nk_ttSHORT(comp); comp+=2;
- mtx[5] = nk_ttSHORT(comp); comp+=2;
- } else {
- mtx[4] = nk_ttCHAR(comp); comp+=1;
- mtx[5] = nk_ttCHAR(comp); comp+=1;
- }
- } else {
- /* @TODO handle matching point */
- NK_ASSERT(0);
- }
- if (flags & (1<<3)) { /* WE_HAVE_A_SCALE */
- mtx[0] = mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- mtx[1] = mtx[2] = 0;
- } else if (flags & (1<<6)) { /* WE_HAVE_AN_X_AND_YSCALE */
- mtx[0] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- mtx[1] = mtx[2] = 0;
- mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- } else if (flags & (1<<7)) { /* WE_HAVE_A_TWO_BY_TWO */
- mtx[0] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- mtx[1] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- mtx[2] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- mtx[3] = nk_ttSHORT(comp)/16384.0f; comp+=2;
- }
-
- /* Find transformation scales. */
- m = (float) NK_SQRT(mtx[0]*mtx[0] + mtx[1]*mtx[1]);
- n = (float) NK_SQRT(mtx[2]*mtx[2] + mtx[3]*mtx[3]);
-
- /* Get indexed glyph. */
- comp_num_verts = nk_tt_GetGlyphShape(info, alloc, gidx, &comp_verts);
- if (comp_num_verts > 0)
- {
- /* Transform vertices. */
- for (i = 0; i < comp_num_verts; ++i) {
- struct nk_tt_vertex* v = &comp_verts[i];
- short x,y;
- x=v->x; y=v->y;
- v->x = (short)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
- v->y = (short)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
- x=v->cx; y=v->cy;
- v->cx = (short)(m * (mtx[0]*x + mtx[2]*y + mtx[4]));
- v->cy = (short)(n * (mtx[1]*x + mtx[3]*y + mtx[5]));
- }
- /* Append vertices. */
- tmp = (struct nk_tt_vertex*)alloc->alloc(alloc->userdata, 0,
- (nk_size)(num_vertices+comp_num_verts)*sizeof(struct nk_tt_vertex));
- if (!tmp) {
- if (vertices) alloc->free(alloc->userdata, vertices);
- if (comp_verts) alloc->free(alloc->userdata, comp_verts);
- return 0;
- }
- if (num_vertices > 0) NK_MEMCPY(tmp, vertices, (nk_size)num_vertices*sizeof(struct nk_tt_vertex));
- NK_MEMCPY(tmp+num_vertices, comp_verts, (nk_size)comp_num_verts*sizeof(struct nk_tt_vertex));
- if (vertices) alloc->free(alloc->userdata,vertices);
- vertices = tmp;
- alloc->free(alloc->userdata,comp_verts);
- num_vertices += comp_num_verts;
- }
- /* More components ? */
- more = flags & (1<<5);
- }
- } else if (numberOfContours < 0) {
- /* @TODO other compound variations? */
- NK_ASSERT(0);
- } else {
- /* numberOfCounters == 0, do nothing */
- }
- *pvertices = vertices;
- return num_vertices;
-}
-
-NK_INTERN void
-nk_tt_GetGlyphHMetrics(const struct nk_tt_fontinfo *info, int glyph_index,
- int *advanceWidth, int *leftSideBearing)
-{
- nk_ushort numOfLongHorMetrics = nk_ttUSHORT(info->data+info->hhea + 34);
- if (glyph_index < numOfLongHorMetrics) {
- if (advanceWidth)
- *advanceWidth = nk_ttSHORT(info->data + info->hmtx + 4*glyph_index);
- if (leftSideBearing)
- *leftSideBearing = nk_ttSHORT(info->data + info->hmtx + 4*glyph_index + 2);
- } else {
- if (advanceWidth)
- *advanceWidth = nk_ttSHORT(info->data + info->hmtx + 4*(numOfLongHorMetrics-1));
- if (leftSideBearing)
- *leftSideBearing = nk_ttSHORT(info->data + info->hmtx + 4*numOfLongHorMetrics + 2*(glyph_index - numOfLongHorMetrics));
- }
-}
-
-NK_INTERN void
-nk_tt_GetFontVMetrics(const struct nk_tt_fontinfo *info,
- int *ascent, int *descent, int *lineGap)
-{
- if (ascent ) *ascent = nk_ttSHORT(info->data+info->hhea + 4);
- if (descent) *descent = nk_ttSHORT(info->data+info->hhea + 6);
- if (lineGap) *lineGap = nk_ttSHORT(info->data+info->hhea + 8);
-}
-
-NK_INTERN float
-nk_tt_ScaleForPixelHeight(const struct nk_tt_fontinfo *info, float height)
-{
- int fheight = nk_ttSHORT(info->data + info->hhea + 4) - nk_ttSHORT(info->data + info->hhea + 6);
- return (float) height / (float)fheight;
-}
-
-NK_INTERN float
-nk_tt_ScaleForMappingEmToPixels(const struct nk_tt_fontinfo *info, float pixels)
-{
- int unitsPerEm = nk_ttUSHORT(info->data + info->head + 18);
- return pixels / (float)unitsPerEm;
-}
-
-/*-------------------------------------------------------------
- * antialiasing software rasterizer
- * --------------------------------------------------------------*/
-NK_INTERN void
-nk_tt_GetGlyphBitmapBoxSubpixel(const struct nk_tt_fontinfo *font,
- int glyph, float scale_x, float scale_y,float shift_x, float shift_y,
- int *ix0, int *iy0, int *ix1, int *iy1)
-{
- int x0,y0,x1,y1;
- if (!nk_tt_GetGlyphBox(font, glyph, &x0,&y0,&x1,&y1)) {
- /* e.g. space character */
- if (ix0) *ix0 = 0;
- if (iy0) *iy0 = 0;
- if (ix1) *ix1 = 0;
- if (iy1) *iy1 = 0;
- } else {
- /* move to integral bboxes (treating pixels as little squares, what pixels get touched)? */
- if (ix0) *ix0 = nk_ifloorf((float)x0 * scale_x + shift_x);
- if (iy0) *iy0 = nk_ifloorf((float)-y1 * scale_y + shift_y);
- if (ix1) *ix1 = nk_iceilf ((float)x1 * scale_x + shift_x);
- if (iy1) *iy1 = nk_iceilf ((float)-y0 * scale_y + shift_y);
- }
-}
-
-NK_INTERN void
-nk_tt_GetGlyphBitmapBox(const struct nk_tt_fontinfo *font, int glyph,
- float scale_x, float scale_y, int *ix0, int *iy0, int *ix1, int *iy1)
-{
- nk_tt_GetGlyphBitmapBoxSubpixel(font, glyph, scale_x, scale_y,0.0f,0.0f, ix0, iy0, ix1, iy1);
-}
-
-/*-------------------------------------------------------------
- * Rasterizer
- * --------------------------------------------------------------*/
-NK_INTERN void*
-nk_tt__hheap_alloc(struct nk_tt__hheap *hh, nk_size size)
-{
- if (hh->first_free) {
- void *p = hh->first_free;
- hh->first_free = * (void **) p;
- return p;
- } else {
- if (hh->num_remaining_in_head_chunk == 0) {
- int count = (size < 32 ? 2000 : size < 128 ? 800 : 100);
- struct nk_tt__hheap_chunk *c = (struct nk_tt__hheap_chunk *)
- hh->alloc.alloc(hh->alloc.userdata, 0,
- sizeof(struct nk_tt__hheap_chunk) + size * (nk_size)count);
- if (c == 0) return 0;
- c->next = hh->head;
- hh->head = c;
- hh->num_remaining_in_head_chunk = count;
- }
- --hh->num_remaining_in_head_chunk;
- return (char *) (hh->head) + size * (nk_size)hh->num_remaining_in_head_chunk;
- }
-}
-
-NK_INTERN void
-nk_tt__hheap_free(struct nk_tt__hheap *hh, void *p)
-{
- *(void **) p = hh->first_free;
- hh->first_free = p;
-}
-
-NK_INTERN void
-nk_tt__hheap_cleanup(struct nk_tt__hheap *hh)
-{
- struct nk_tt__hheap_chunk *c = hh->head;
- while (c) {
- struct nk_tt__hheap_chunk *n = c->next;
- hh->alloc.free(hh->alloc.userdata, c);
- c = n;
- }
-}
-
-NK_INTERN struct nk_tt__active_edge*
-nk_tt__new_active(struct nk_tt__hheap *hh, struct nk_tt__edge *e,
- int off_x, float start_point)
-{
- struct nk_tt__active_edge *z = (struct nk_tt__active_edge *)
- nk_tt__hheap_alloc(hh, sizeof(*z));
- float dxdy = (e->x1 - e->x0) / (e->y1 - e->y0);
- /*STBTT_assert(e->y0 <= start_point); */
- if (!z) return z;
- z->fdx = dxdy;
- z->fdy = (dxdy != 0) ? (1/dxdy): 0;
- z->fx = e->x0 + dxdy * (start_point - e->y0);
- z->fx -= (float)off_x;
- z->direction = e->invert ? 1.0f : -1.0f;
- z->sy = e->y0;
- z->ey = e->y1;
- z->next = 0;
- return z;
-}
-
-NK_INTERN void
-nk_tt__handle_clipped_edge(float *scanline, int x, struct nk_tt__active_edge *e,
- float x0, float y0, float x1, float y1)
-{
- if (y0 == y1) return;
- NK_ASSERT(y0 < y1);
- NK_ASSERT(e->sy <= e->ey);
- if (y0 > e->ey) return;
- if (y1 < e->sy) return;
- if (y0 < e->sy) {
- x0 += (x1-x0) * (e->sy - y0) / (y1-y0);
- y0 = e->sy;
- }
- if (y1 > e->ey) {
- x1 += (x1-x0) * (e->ey - y1) / (y1-y0);
- y1 = e->ey;
- }
-
- if (x0 == x) NK_ASSERT(x1 <= x+1);
- else if (x0 == x+1) NK_ASSERT(x1 >= x);
- else if (x0 <= x) NK_ASSERT(x1 <= x);
- else if (x0 >= x+1) NK_ASSERT(x1 >= x+1);
- else NK_ASSERT(x1 >= x && x1 <= x+1);
-
- if (x0 <= x && x1 <= x)
- scanline[x] += e->direction * (y1-y0);
- else if (x0 >= x+1 && x1 >= x+1);
- else {
- NK_ASSERT(x0 >= x && x0 <= x+1 && x1 >= x && x1 <= x+1);
- /* coverage = 1 - average x position */
- scanline[x] += (float)e->direction * (float)(y1-y0) * (1.0f-((x0-(float)x)+(x1-(float)x))/2.0f);
- }
-}
-
-NK_INTERN void
-nk_tt__fill_active_edges_new(float *scanline, float *scanline_fill, int len,
- struct nk_tt__active_edge *e, float y_top)
-{
- float y_bottom = y_top+1;
- while (e)
- {
- /* brute force every pixel */
- /* compute intersection points with top & bottom */
- NK_ASSERT(e->ey >= y_top);
- if (e->fdx == 0) {
- float x0 = e->fx;
- if (x0 < len) {
- if (x0 >= 0) {
- nk_tt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom);
- nk_tt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom);
- } else {
- nk_tt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom);
- }
- }
- } else {
- float x0 = e->fx;
- float dx = e->fdx;
- float xb = x0 + dx;
- float x_top, x_bottom;
- float y0,y1;
- float dy = e->fdy;
- NK_ASSERT(e->sy <= y_bottom && e->ey >= y_top);
-
- /* compute endpoints of line segment clipped to this scanline (if the */
- /* line segment starts on this scanline. x0 is the intersection of the */
- /* line with y_top, but that may be off the line segment. */
- if (e->sy > y_top) {
- x_top = x0 + dx * (e->sy - y_top);
- y0 = e->sy;
- } else {
- x_top = x0;
- y0 = y_top;
- }
-
- if (e->ey < y_bottom) {
- x_bottom = x0 + dx * (e->ey - y_top);
- y1 = e->ey;
- } else {
- x_bottom = xb;
- y1 = y_bottom;
- }
-
- if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len)
- {
- /* from here on, we don't have to range check x values */
- if ((int) x_top == (int) x_bottom) {
- float height;
- /* simple case, only spans one pixel */
- int x = (int) x_top;
- height = y1 - y0;
- NK_ASSERT(x >= 0 && x < len);
- scanline[x] += e->direction * (1.0f-(((float)x_top - (float)x) + ((float)x_bottom-(float)x))/2.0f) * (float)height;
- scanline_fill[x] += e->direction * (float)height; /* everything right of this pixel is filled */
- } else {
- int x,x1,x2;
- float y_crossing, step, sign, area;
- /* covers 2+ pixels */
- if (x_top > x_bottom)
- {
- /* flip scanline vertically; signed area is the same */
- float t;
- y0 = y_bottom - (y0 - y_top);
- y1 = y_bottom - (y1 - y_top);
- t = y0; y0 = y1; y1 = t;
- t = x_bottom; x_bottom = x_top; x_top = t;
- dx = -dx;
- dy = -dy;
- t = x0; x0 = xb; xb = t;
- }
-
- x1 = (int) x_top;
- x2 = (int) x_bottom;
- /* compute intersection with y axis at x1+1 */
- y_crossing = ((float)x1+1 - (float)x0) * (float)dy + (float)y_top;
-
- sign = e->direction;
- /* area of the rectangle covered from y0..y_crossing */
- area = sign * (y_crossing-y0);
- /* area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) */
- scanline[x1] += area * (1.0f-((float)((float)x_top - (float)x1)+(float)(x1+1-x1))/2.0f);
-
- step = sign * dy;
- for (x = x1+1; x < x2; ++x) {
- scanline[x] += area + step/2;
- area += step;
- }
- y_crossing += (float)dy * (float)(x2 - (x1+1));
-
- scanline[x2] += area + sign * (1.0f-((float)(x2-x2)+((float)x_bottom-(float)x2))/2.0f) * (y1-y_crossing);
- scanline_fill[x2] += sign * (y1-y0);
- }
- }
- else
- {
- /* if edge goes outside of box we're drawing, we require */
- /* clipping logic. since this does not match the intended use */
- /* of this library, we use a different, very slow brute */
- /* force implementation */
- int x;
- for (x=0; x < len; ++x)
- {
- /* cases: */
- /* */
- /* there can be up to two intersections with the pixel. any intersection */
- /* with left or right edges can be handled by splitting into two (or three) */
- /* regions. intersections with top & bottom do not necessitate case-wise logic. */
- /* */
- /* the old way of doing this found the intersections with the left & right edges, */
- /* then used some simple logic to produce up to three segments in sorted order */
- /* from top-to-bottom. however, this had a problem: if an x edge was epsilon */
- /* across the x border, then the corresponding y position might not be distinct */
- /* from the other y segment, and it might ignored as an empty segment. to avoid */
- /* that, we need to explicitly produce segments based on x positions. */
-
- /* rename variables to clear pairs */
- float ya = y_top;
- float x1 = (float) (x);
- float x2 = (float) (x+1);
- float x3 = xb;
- float y3 = y_bottom;
- float yb,y2;
-
- yb = ((float)x - x0) / dx + y_top;
- y2 = ((float)x+1 - x0) / dx + y_top;
-
- if (x0 < x1 && x3 > x2) { /* three segments descending down-right */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb);
- nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x2,y2);
- nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
- } else if (x3 < x1 && x0 > x2) { /* three segments descending down-left */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2);
- nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x1,yb);
- nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3);
- } else if (x0 < x1 && x3 > x1) { /* two segments across x, down-right */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb);
- nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3);
- } else if (x3 < x1 && x0 > x1) { /* two segments across x, down-left */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x1,yb);
- nk_tt__handle_clipped_edge(scanline,x,e, x1,yb, x3,y3);
- } else if (x0 < x2 && x3 > x2) { /* two segments across x+1, down-right */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2);
- nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
- } else if (x3 < x2 && x0 > x2) { /* two segments across x+1, down-left */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x2,y2);
- nk_tt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
- } else { /* one segment */
- nk_tt__handle_clipped_edge(scanline,x,e, x0,ya, x3,y3);
- }
- }
- }
- }
- e = e->next;
- }
-}
-
-/* directly AA rasterize edges w/o supersampling */
-NK_INTERN void
-nk_tt__rasterize_sorted_edges(struct nk_tt__bitmap *result, struct nk_tt__edge *e,
- int n, int vsubsample, int off_x, int off_y, struct nk_allocator *alloc)
-{
- struct nk_tt__hheap hh;
- struct nk_tt__active_edge *active = 0;
- int y,j=0, i;
- float scanline_data[129], *scanline, *scanline2;
-
- NK_UNUSED(vsubsample);
- nk_zero_struct(hh);
- hh.alloc = *alloc;
-
- if (result->w > 64)
- scanline = (float *) alloc->alloc(alloc->userdata,0, (nk_size)(result->w*2+1) * sizeof(float));
- else scanline = scanline_data;
-
- scanline2 = scanline + result->w;
- y = off_y;
- e[n].y0 = (float) (off_y + result->h) + 1;
-
- while (j < result->h)
- {
- /* find center of pixel for this scanline */
- float scan_y_top = (float)y + 0.0f;
- float scan_y_bottom = (float)y + 1.0f;
- struct nk_tt__active_edge **step = &active;
-
- NK_MEMSET(scanline , 0, (nk_size)result->w*sizeof(scanline[0]));
- NK_MEMSET(scanline2, 0, (nk_size)(result->w+1)*sizeof(scanline[0]));
-
- /* update all active edges; */
- /* remove all active edges that terminate before the top of this scanline */
- while (*step) {
- struct nk_tt__active_edge * z = *step;
- if (z->ey <= scan_y_top) {
- *step = z->next; /* delete from list */
- NK_ASSERT(z->direction);
- z->direction = 0;
- nk_tt__hheap_free(&hh, z);
- } else {
- step = &((*step)->next); /* advance through list */
- }
- }
-
- /* insert all edges that start before the bottom of this scanline */
- while (e->y0 <= scan_y_bottom) {
- if (e->y0 != e->y1) {
- struct nk_tt__active_edge *z = nk_tt__new_active(&hh, e, off_x, scan_y_top);
- if (z != 0) {
- NK_ASSERT(z->ey >= scan_y_top);
- /* insert at front */
- z->next = active;
- active = z;
- }
- }
- ++e;
- }
-
- /* now process all active edges */
- if (active)
- nk_tt__fill_active_edges_new(scanline, scanline2+1, result->w, active, scan_y_top);
-
- {
- float sum = 0;
- for (i=0; i < result->w; ++i) {
- float k;
- int m;
- sum += scanline2[i];
- k = scanline[i] + sum;
- k = (float) NK_ABS(k) * 255.0f + 0.5f;
- m = (int) k;
- if (m > 255) m = 255;
- result->pixels[j*result->stride + i] = (unsigned char) m;
- }
- }
- /* advance all the edges */
- step = &active;
- while (*step) {
- struct nk_tt__active_edge *z = *step;
- z->fx += z->fdx; /* advance to position for current scanline */
- step = &((*step)->next); /* advance through list */
- }
- ++y;
- ++j;
- }
- nk_tt__hheap_cleanup(&hh);
- if (scanline != scanline_data)
- alloc->free(alloc->userdata, scanline);
-}
-
-#define NK_TT__COMPARE(a,b) ((a)->y0 < (b)->y0)
-NK_INTERN void
-nk_tt__sort_edges_ins_sort(struct nk_tt__edge *p, int n)
-{
- int i,j;
- for (i=1; i < n; ++i) {
- struct nk_tt__edge t = p[i], *a = &t;
- j = i;
- while (j > 0) {
- struct nk_tt__edge *b = &p[j-1];
- int c = NK_TT__COMPARE(a,b);
- if (!c) break;
- p[j] = p[j-1];
- --j;
- }
- if (i != j)
- p[j] = t;
- }
-}
-
-NK_INTERN void
-nk_tt__sort_edges_quicksort(struct nk_tt__edge *p, int n)
-{
- /* threshold for transitioning to insertion sort */
- while (n > 12) {
- struct nk_tt__edge t;
- int c01,c12,c,m,i,j;
-
- /* compute median of three */
- m = n >> 1;
- c01 = NK_TT__COMPARE(&p[0],&p[m]);
- c12 = NK_TT__COMPARE(&p[m],&p[n-1]);
-
- /* if 0 >= mid >= end, or 0 < mid < end, then use mid */
- if (c01 != c12) {
- /* otherwise, we'll need to swap something else to middle */
- int z;
- c = NK_TT__COMPARE(&p[0],&p[n-1]);
- /* 0>mid && mid<n: 0>n => n; 0<n => 0 */
- /* 0<mid && mid>n: 0>n => 0; 0<n => n */
- z = (c == c12) ? 0 : n-1;
- t = p[z];
- p[z] = p[m];
- p[m] = t;
- }
-
- /* now p[m] is the median-of-three */
- /* swap it to the beginning so it won't move around */
- t = p[0];
- p[0] = p[m];
- p[m] = t;
-
- /* partition loop */
- i=1;
- j=n-1;
- for(;;) {
- /* handling of equality is crucial here */
- /* for sentinels & efficiency with duplicates */
- for (;;++i) {
- if (!NK_TT__COMPARE(&p[i], &p[0])) break;
- }
- for (;;--j) {
- if (!NK_TT__COMPARE(&p[0], &p[j])) break;
- }
-
- /* make sure we haven't crossed */
- if (i >= j) break;
- t = p[i];
- p[i] = p[j];
- p[j] = t;
-
- ++i;
- --j;
-
- }
-
- /* recurse on smaller side, iterate on larger */
- if (j < (n-i)) {
- nk_tt__sort_edges_quicksort(p,j);
- p = p+i;
- n = n-i;
- } else {
- nk_tt__sort_edges_quicksort(p+i, n-i);
- n = j;
- }
- }
-}
-
-NK_INTERN void
-nk_tt__sort_edges(struct nk_tt__edge *p, int n)
-{
- nk_tt__sort_edges_quicksort(p, n);
- nk_tt__sort_edges_ins_sort(p, n);
-}
-
-NK_INTERN void
-nk_tt__rasterize(struct nk_tt__bitmap *result, struct nk_tt__point *pts,
- int *wcount, int windings, float scale_x, float scale_y,
- float shift_x, float shift_y, int off_x, int off_y, int invert,
- struct nk_allocator *alloc)
-{
- float y_scale_inv = invert ? -scale_y : scale_y;
- struct nk_tt__edge *e;
- int n,i,j,k,m;
- int vsubsample = 1;
- /* vsubsample should divide 255 evenly; otherwise we won't reach full opacity */
-
- /* now we have to blow out the windings into explicit edge lists */
- n = 0;
- for (i=0; i < windings; ++i)
- n += wcount[i];
-
- e = (struct nk_tt__edge*)
- alloc->alloc(alloc->userdata, 0,(sizeof(*e) * (nk_size)(n+1)));
- if (e == 0) return;
- n = 0;
-
- m=0;
- for (i=0; i < windings; ++i)
- {
- struct nk_tt__point *p = pts + m;
- m += wcount[i];
- j = wcount[i]-1;
- for (k=0; k < wcount[i]; j=k++) {
- int a=k,b=j;
- /* skip the edge if horizontal */
- if (p[j].y == p[k].y)
- continue;
-
- /* add edge from j to k to the list */
- e[n].invert = 0;
- if (invert ? p[j].y > p[k].y : p[j].y < p[k].y) {
- e[n].invert = 1;
- a=j,b=k;
- }
- e[n].x0 = p[a].x * scale_x + shift_x;
- e[n].y0 = (p[a].y * y_scale_inv + shift_y) * (float)vsubsample;
- e[n].x1 = p[b].x * scale_x + shift_x;
- e[n].y1 = (p[b].y * y_scale_inv + shift_y) * (float)vsubsample;
- ++n;
- }
- }
-
- /* now sort the edges by their highest point (should snap to integer, and then by x) */
- /*STBTT_sort(e, n, sizeof(e[0]), nk_tt__edge_compare); */
- nk_tt__sort_edges(e, n);
- /* now, traverse the scanlines and find the intersections on each scanline, use xor winding rule */
- nk_tt__rasterize_sorted_edges(result, e, n, vsubsample, off_x, off_y, alloc);
- alloc->free(alloc->userdata, e);
-}
-
-NK_INTERN void
-nk_tt__add_point(struct nk_tt__point *points, int n, float x, float y)
-{
- if (!points) return; /* during first pass, it's unallocated */
- points[n].x = x;
- points[n].y = y;
-}
-
-NK_INTERN int
-nk_tt__tesselate_curve(struct nk_tt__point *points, int *num_points,
- float x0, float y0, float x1, float y1, float x2, float y2,
- float objspace_flatness_squared, int n)
-{
- /* tesselate until threshold p is happy...
- * @TODO warped to compensate for non-linear stretching */
- /* midpoint */
- float mx = (x0 + 2*x1 + x2)/4;
- float my = (y0 + 2*y1 + y2)/4;
- /* versus directly drawn line */
- float dx = (x0+x2)/2 - mx;
- float dy = (y0+y2)/2 - my;
- if (n > 16) /* 65536 segments on one curve better be enough! */
- return 1;
-
- /* half-pixel error allowed... need to be smaller if AA */
- if (dx*dx+dy*dy > objspace_flatness_squared) {
- nk_tt__tesselate_curve(points, num_points, x0,y0,
- (x0+x1)/2.0f,(y0+y1)/2.0f, mx,my, objspace_flatness_squared,n+1);
- nk_tt__tesselate_curve(points, num_points, mx,my,
- (x1+x2)/2.0f,(y1+y2)/2.0f, x2,y2, objspace_flatness_squared,n+1);
- } else {
- nk_tt__add_point(points, *num_points,x2,y2);
- *num_points = *num_points+1;
- }
- return 1;
-}
-
-/* returns number of contours */
-NK_INTERN struct nk_tt__point*
-nk_tt_FlattenCurves(struct nk_tt_vertex *vertices, int num_verts,
- float objspace_flatness, int **contour_lengths, int *num_contours,
- struct nk_allocator *alloc)
-{
- struct nk_tt__point *points=0;
- int num_points=0;
- float objspace_flatness_squared = objspace_flatness * objspace_flatness;
- int i;
- int n=0;
- int start=0;
- int pass;
-
- /* count how many "moves" there are to get the contour count */
- for (i=0; i < num_verts; ++i)
- if (vertices[i].type == NK_TT_vmove) ++n;
-
- *num_contours = n;
- if (n == 0) return 0;
-
- *contour_lengths = (int *)
- alloc->alloc(alloc->userdata,0, (sizeof(**contour_lengths) * (nk_size)n));
- if (*contour_lengths == 0) {
- *num_contours = 0;
- return 0;
- }
-
- /* make two passes through the points so we don't need to realloc */
- for (pass=0; pass < 2; ++pass)
- {
- float x=0,y=0;
- if (pass == 1) {
- points = (struct nk_tt__point *)
- alloc->alloc(alloc->userdata,0, (nk_size)num_points * sizeof(points[0]));
- if (points == 0) goto error;
- }
- num_points = 0;
- n= -1;
-
- for (i=0; i < num_verts; ++i)
- {
- switch (vertices[i].type) {
- case NK_TT_vmove:
- /* start the next contour */
- if (n >= 0)
- (*contour_lengths)[n] = num_points - start;
- ++n;
- start = num_points;
-
- x = vertices[i].x, y = vertices[i].y;
- nk_tt__add_point(points, num_points++, x,y);
- break;
- case NK_TT_vline:
- x = vertices[i].x, y = vertices[i].y;
- nk_tt__add_point(points, num_points++, x, y);
- break;
- case NK_TT_vcurve:
- nk_tt__tesselate_curve(points, &num_points, x,y,
- vertices[i].cx, vertices[i].cy,
- vertices[i].x, vertices[i].y,
- objspace_flatness_squared, 0);
- x = vertices[i].x, y = vertices[i].y;
- break;
- default: break;
- }
- }
- (*contour_lengths)[n] = num_points - start;
- }
- return points;
-
-error:
- alloc->free(alloc->userdata, points);
- alloc->free(alloc->userdata, *contour_lengths);
- *contour_lengths = 0;
- *num_contours = 0;
- return 0;
-}
-
-NK_INTERN void
-nk_tt_Rasterize(struct nk_tt__bitmap *result, float flatness_in_pixels,
- struct nk_tt_vertex *vertices, int num_verts,
- float scale_x, float scale_y, float shift_x, float shift_y,
- int x_off, int y_off, int invert, struct nk_allocator *alloc)
-{
- float scale = scale_x > scale_y ? scale_y : scale_x;
- int winding_count, *winding_lengths;
- struct nk_tt__point *windings = nk_tt_FlattenCurves(vertices, num_verts,
- flatness_in_pixels / scale, &winding_lengths, &winding_count, alloc);
-
- NK_ASSERT(alloc);
- if (windings) {
- nk_tt__rasterize(result, windings, winding_lengths, winding_count,
- scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert, alloc);
- alloc->free(alloc->userdata, winding_lengths);
- alloc->free(alloc->userdata, windings);
- }
-}
-
-NK_INTERN void
-nk_tt_MakeGlyphBitmapSubpixel(const struct nk_tt_fontinfo *info, unsigned char *output,
- int out_w, int out_h, int out_stride, float scale_x, float scale_y,
- float shift_x, float shift_y, int glyph, struct nk_allocator *alloc)
-{
- int ix0,iy0;
- struct nk_tt_vertex *vertices;
- int num_verts = nk_tt_GetGlyphShape(info, alloc, glyph, &vertices);
- struct nk_tt__bitmap gbm;
-
- nk_tt_GetGlyphBitmapBoxSubpixel(info, glyph, scale_x, scale_y, shift_x,
- shift_y, &ix0,&iy0,0,0);
- gbm.pixels = output;
- gbm.w = out_w;
- gbm.h = out_h;
- gbm.stride = out_stride;
-
- if (gbm.w && gbm.h)
- nk_tt_Rasterize(&gbm, 0.35f, vertices, num_verts, scale_x, scale_y,
- shift_x, shift_y, ix0,iy0, 1, alloc);
- alloc->free(alloc->userdata, vertices);
-}
-
-/*-------------------------------------------------------------
- * Bitmap baking
- * --------------------------------------------------------------*/
-NK_INTERN int
-nk_tt_PackBegin(struct nk_tt_pack_context *spc, unsigned char *pixels,
- int pw, int ph, int stride_in_bytes, int padding, struct nk_allocator *alloc)
-{
- int num_nodes = pw - padding;
- struct nk_rp_context *context = (struct nk_rp_context *)
- alloc->alloc(alloc->userdata,0, sizeof(*context));
- struct nk_rp_node *nodes = (struct nk_rp_node*)
- alloc->alloc(alloc->userdata,0, (sizeof(*nodes ) * (nk_size)num_nodes));
-
- if (context == 0 || nodes == 0) {
- if (context != 0) alloc->free(alloc->userdata, context);
- if (nodes != 0) alloc->free(alloc->userdata, nodes);
- return 0;
- }
-
- spc->width = pw;
- spc->height = ph;
- spc->pixels = pixels;
- spc->pack_info = context;
- spc->nodes = nodes;
- spc->padding = padding;
- spc->stride_in_bytes = (stride_in_bytes != 0) ? stride_in_bytes : pw;
- spc->h_oversample = 1;
- spc->v_oversample = 1;
-
- nk_rp_init_target(context, pw-padding, ph-padding, nodes, num_nodes);
- if (pixels)
- NK_MEMSET(pixels, 0, (nk_size)(pw*ph)); /* background of 0 around pixels */
- return 1;
-}
-
-NK_INTERN void
-nk_tt_PackEnd(struct nk_tt_pack_context *spc, struct nk_allocator *alloc)
-{
- alloc->free(alloc->userdata, spc->nodes);
- alloc->free(alloc->userdata, spc->pack_info);
-}
-
-NK_INTERN void
-nk_tt_PackSetOversampling(struct nk_tt_pack_context *spc,
- unsigned int h_oversample, unsigned int v_oversample)
-{
- NK_ASSERT(h_oversample <= NK_TT_MAX_OVERSAMPLE);
- NK_ASSERT(v_oversample <= NK_TT_MAX_OVERSAMPLE);
- if (h_oversample <= NK_TT_MAX_OVERSAMPLE)
- spc->h_oversample = h_oversample;
- if (v_oversample <= NK_TT_MAX_OVERSAMPLE)
- spc->v_oversample = v_oversample;
-}
-
-NK_INTERN void
-nk_tt__h_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
- int kernel_width)
-{
- unsigned char buffer[NK_TT_MAX_OVERSAMPLE];
- int safe_w = w - kernel_width;
- int j;
-
- for (j=0; j < h; ++j)
- {
- int i;
- unsigned int total;
- NK_MEMSET(buffer, 0, (nk_size)kernel_width);
-
- total = 0;
-
- /* make kernel_width a constant in common cases so compiler can optimize out the divide */
- switch (kernel_width) {
- case 2:
- for (i=0; i <= safe_w; ++i) {
- total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i];
- pixels[i] = (unsigned char) (total / 2);
- }
- break;
- case 3:
- for (i=0; i <= safe_w; ++i) {
- total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i];
- pixels[i] = (unsigned char) (total / 3);
- }
- break;
- case 4:
- for (i=0; i <= safe_w; ++i) {
- total += (unsigned int)pixels[i] - buffer[i & NK_TT__OVER_MASK];
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i];
- pixels[i] = (unsigned char) (total / 4);
- }
- break;
- case 5:
- for (i=0; i <= safe_w; ++i) {
- total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i];
- pixels[i] = (unsigned char) (total / 5);
- }
- break;
- default:
- for (i=0; i <= safe_w; ++i) {
- total += (unsigned int)(pixels[i] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i];
- pixels[i] = (unsigned char) (total / (unsigned int)kernel_width);
- }
- break;
- }
-
- for (; i < w; ++i) {
- NK_ASSERT(pixels[i] == 0);
- total -= (unsigned int)(buffer[i & NK_TT__OVER_MASK]);
- pixels[i] = (unsigned char) (total / (unsigned int)kernel_width);
- }
- pixels += stride_in_bytes;
- }
-}
-
-NK_INTERN void
-nk_tt__v_prefilter(unsigned char *pixels, int w, int h, int stride_in_bytes,
- int kernel_width)
-{
- unsigned char buffer[NK_TT_MAX_OVERSAMPLE];
- int safe_h = h - kernel_width;
- int j;
-
- for (j=0; j < w; ++j)
- {
- int i;
- unsigned int total;
- NK_MEMSET(buffer, 0, (nk_size)kernel_width);
-
- total = 0;
-
- /* make kernel_width a constant in common cases so compiler can optimize out the divide */
- switch (kernel_width) {
- case 2:
- for (i=0; i <= safe_h; ++i) {
- total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes];
- pixels[i*stride_in_bytes] = (unsigned char) (total / 2);
- }
- break;
- case 3:
- for (i=0; i <= safe_h; ++i) {
- total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes];
- pixels[i*stride_in_bytes] = (unsigned char) (total / 3);
- }
- break;
- case 4:
- for (i=0; i <= safe_h; ++i) {
- total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes];
- pixels[i*stride_in_bytes] = (unsigned char) (total / 4);
- }
- break;
- case 5:
- for (i=0; i <= safe_h; ++i) {
- total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes];
- pixels[i*stride_in_bytes] = (unsigned char) (total / 5);
- }
- break;
- default:
- for (i=0; i <= safe_h; ++i) {
- total += (unsigned int)(pixels[i*stride_in_bytes] - buffer[i & NK_TT__OVER_MASK]);
- buffer[(i+kernel_width) & NK_TT__OVER_MASK] = pixels[i*stride_in_bytes];
- pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width);
- }
- break;
- }
-
- for (; i < h; ++i) {
- NK_ASSERT(pixels[i*stride_in_bytes] == 0);
- total -= (unsigned int)(buffer[i & NK_TT__OVER_MASK]);
- pixels[i*stride_in_bytes] = (unsigned char) (total / (unsigned int)kernel_width);
- }
- pixels += 1;
- }
-}
-
-NK_INTERN float
-nk_tt__oversample_shift(int oversample)
-{
- if (!oversample)
- return 0.0f;
-
- /* The prefilter is a box filter of width "oversample", */
- /* which shifts phase by (oversample - 1)/2 pixels in */
- /* oversampled space. We want to shift in the opposite */
- /* direction to counter this. */
- return (float)-(oversample - 1) / (2.0f * (float)oversample);
-}
-
-/* rects array must be big enough to accommodate all characters in the given ranges */
-NK_INTERN int
-nk_tt_PackFontRangesGatherRects(struct nk_tt_pack_context *spc,
- struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges,
- int num_ranges, struct nk_rp_rect *rects)
-{
- int i,j,k;
- k = 0;
-
- for (i=0; i < num_ranges; ++i) {
- float fh = ranges[i].font_size;
- float scale = (fh > 0) ? nk_tt_ScaleForPixelHeight(info, fh):
- nk_tt_ScaleForMappingEmToPixels(info, -fh);
- ranges[i].h_oversample = (unsigned char) spc->h_oversample;
- ranges[i].v_oversample = (unsigned char) spc->v_oversample;
- for (j=0; j < ranges[i].num_chars; ++j) {
- int x0,y0,x1,y1;
- int codepoint = ranges[i].first_unicode_codepoint_in_range ?
- ranges[i].first_unicode_codepoint_in_range + j :
- ranges[i].array_of_unicode_codepoints[j];
-
- int glyph = nk_tt_FindGlyphIndex(info, codepoint);
- nk_tt_GetGlyphBitmapBoxSubpixel(info,glyph, scale * (float)spc->h_oversample,
- scale * (float)spc->v_oversample, 0,0, &x0,&y0,&x1,&y1);
- rects[k].w = (nk_rp_coord) (x1-x0 + spc->padding + (int)spc->h_oversample-1);
- rects[k].h = (nk_rp_coord) (y1-y0 + spc->padding + (int)spc->v_oversample-1);
- ++k;
- }
- }
- return k;
-}
-
-NK_INTERN int
-nk_tt_PackFontRangesRenderIntoRects(struct nk_tt_pack_context *spc,
- struct nk_tt_fontinfo *info, struct nk_tt_pack_range *ranges,
- int num_ranges, struct nk_rp_rect *rects, struct nk_allocator *alloc)
-{
- int i,j,k, return_value = 1;
- /* save current values */
- int old_h_over = (int)spc->h_oversample;
- int old_v_over = (int)spc->v_oversample;
- /* rects array must be big enough to accommodate all characters in the given ranges */
-
- k = 0;
- for (i=0; i < num_ranges; ++i)
- {
- float fh = ranges[i].font_size;
- float recip_h,recip_v,sub_x,sub_y;
- float scale = fh > 0 ? nk_tt_ScaleForPixelHeight(info, fh):
- nk_tt_ScaleForMappingEmToPixels(info, -fh);
-
- spc->h_oversample = ranges[i].h_oversample;
- spc->v_oversample = ranges[i].v_oversample;
-
- recip_h = 1.0f / (float)spc->h_oversample;
- recip_v = 1.0f / (float)spc->v_oversample;
-
- sub_x = nk_tt__oversample_shift((int)spc->h_oversample);
- sub_y = nk_tt__oversample_shift((int)spc->v_oversample);
-
- for (j=0; j < ranges[i].num_chars; ++j)
- {
- struct nk_rp_rect *r = &rects[k];
- if (r->was_packed)
- {
- struct nk_tt_packedchar *bc = &ranges[i].chardata_for_range[j];
- int advance, lsb, x0,y0,x1,y1;
- int codepoint = ranges[i].first_unicode_codepoint_in_range ?
- ranges[i].first_unicode_codepoint_in_range + j :
- ranges[i].array_of_unicode_codepoints[j];
- int glyph = nk_tt_FindGlyphIndex(info, codepoint);
- nk_rp_coord pad = (nk_rp_coord) spc->padding;
-
- /* pad on left and top */
- r->x = (nk_rp_coord)((int)r->x + (int)pad);
- r->y = (nk_rp_coord)((int)r->y + (int)pad);
- r->w = (nk_rp_coord)((int)r->w - (int)pad);
- r->h = (nk_rp_coord)((int)r->h - (int)pad);
-
- nk_tt_GetGlyphHMetrics(info, glyph, &advance, &lsb);
- nk_tt_GetGlyphBitmapBox(info, glyph, scale * (float)spc->h_oversample,
- (scale * (float)spc->v_oversample), &x0,&y0,&x1,&y1);
- nk_tt_MakeGlyphBitmapSubpixel(info, spc->pixels + r->x + r->y*spc->stride_in_bytes,
- (int)(r->w - spc->h_oversample+1), (int)(r->h - spc->v_oversample+1),
- spc->stride_in_bytes, scale * (float)spc->h_oversample,
- scale * (float)spc->v_oversample, 0,0, glyph, alloc);
-
- if (spc->h_oversample > 1)
- nk_tt__h_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
- r->w, r->h, spc->stride_in_bytes, (int)spc->h_oversample);
-
- if (spc->v_oversample > 1)
- nk_tt__v_prefilter(spc->pixels + r->x + r->y*spc->stride_in_bytes,
- r->w, r->h, spc->stride_in_bytes, (int)spc->v_oversample);
-
- bc->x0 = (nk_ushort) r->x;
- bc->y0 = (nk_ushort) r->y;
- bc->x1 = (nk_ushort) (r->x + r->w);
- bc->y1 = (nk_ushort) (r->y + r->h);
- bc->xadvance = scale * (float)advance;
- bc->xoff = (float) x0 * recip_h + sub_x;
- bc->yoff = (float) y0 * recip_v + sub_y;
- bc->xoff2 = ((float)x0 + r->w) * recip_h + sub_x;
- bc->yoff2 = ((float)y0 + r->h) * recip_v + sub_y;
- } else {
- return_value = 0; /* if any fail, report failure */
- }
- ++k;
- }
- }
- /* restore original values */
- spc->h_oversample = (unsigned int)old_h_over;
- spc->v_oversample = (unsigned int)old_v_over;
- return return_value;
-}
-
-NK_INTERN void
-nk_tt_GetPackedQuad(struct nk_tt_packedchar *chardata, int pw, int ph,
- int char_index, float *xpos, float *ypos, struct nk_tt_aligned_quad *q,
- int align_to_integer)
-{
- float ipw = 1.0f / (float)pw, iph = 1.0f / (float)ph;
- struct nk_tt_packedchar *b = (struct nk_tt_packedchar*)(chardata + char_index);
- if (align_to_integer) {
- int tx = nk_ifloorf((*xpos + b->xoff) + 0.5f);
- int ty = nk_ifloorf((*ypos + b->yoff) + 0.5f);
-
- float x = (float)tx;
- float y = (float)ty;
-
- q->x0 = x;
- q->y0 = y;
- q->x1 = x + b->xoff2 - b->xoff;
- q->y1 = y + b->yoff2 - b->yoff;
- } else {
- q->x0 = *xpos + b->xoff;
- q->y0 = *ypos + b->yoff;
- q->x1 = *xpos + b->xoff2;
- q->y1 = *ypos + b->yoff2;
- }
- q->s0 = b->x0 * ipw;
- q->t0 = b->y0 * iph;
- q->s1 = b->x1 * ipw;
- q->t1 = b->y1 * iph;
- *xpos += b->xadvance;
-}
-
-/* -------------------------------------------------------------
- *
- * FONT BAKING
- *
- * --------------------------------------------------------------*/
-struct nk_font_bake_data {
- struct nk_tt_fontinfo info;
- struct nk_rp_rect *rects;
- struct nk_tt_pack_range *ranges;
- nk_rune range_count;
-};
-
-struct nk_font_baker {
- struct nk_allocator alloc;
- struct nk_tt_pack_context spc;
- struct nk_font_bake_data *build;
- struct nk_tt_packedchar *packed_chars;
- struct nk_rp_rect *rects;
- struct nk_tt_pack_range *ranges;
-};
-
-NK_GLOBAL const nk_size nk_rect_align = NK_ALIGNOF(struct nk_rp_rect);
-NK_GLOBAL const nk_size nk_range_align = NK_ALIGNOF(struct nk_tt_pack_range);
-NK_GLOBAL const nk_size nk_char_align = NK_ALIGNOF(struct nk_tt_packedchar);
-NK_GLOBAL const nk_size nk_build_align = NK_ALIGNOF(struct nk_font_bake_data);
-NK_GLOBAL const nk_size nk_baker_align = NK_ALIGNOF(struct nk_font_baker);
-
-NK_INTERN int
-nk_range_count(const nk_rune *range)
-{
- const nk_rune *iter = range;
- NK_ASSERT(range);
- if (!range) return 0;
- while (*(iter++) != 0);
- return (iter == range) ? 0 : (int)((iter - range)/2);
-}
-
-NK_INTERN int
-nk_range_glyph_count(const nk_rune *range, int count)
-{
- int i = 0;
- int total_glyphs = 0;
- for (i = 0; i < count; ++i) {
- int diff;
- nk_rune f = range[(i*2)+0];
- nk_rune t = range[(i*2)+1];
- NK_ASSERT(t >= f);
- diff = (int)((t - f) + 1);
- total_glyphs += diff;
- }
- return total_glyphs;
-}
-
-NK_API const nk_rune*
-nk_font_default_glyph_ranges(void)
-{
- NK_STORAGE const nk_rune ranges[] = {0x0020, 0x00FF, 0};
- return ranges;
-}
-
-NK_API const nk_rune*
-nk_font_chinese_glyph_ranges(void)
-{
- NK_STORAGE const nk_rune ranges[] = {
- 0x0020, 0x00FF,
- 0x3000, 0x30FF,
- 0x31F0, 0x31FF,
- 0xFF00, 0xFFEF,
- 0x4e00, 0x9FAF,
- 0
- };
- return ranges;
-}
-
-NK_API const nk_rune*
-nk_font_cyrillic_glyph_ranges(void)
-{
- NK_STORAGE const nk_rune ranges[] = {
- 0x0020, 0x00FF,
- 0x0400, 0x052F,
- 0x2DE0, 0x2DFF,
- 0xA640, 0xA69F,
- 0
- };
- return ranges;
-}
-
-NK_API const nk_rune*
-nk_font_korean_glyph_ranges(void)
-{
- NK_STORAGE const nk_rune ranges[] = {
- 0x0020, 0x00FF,
- 0x3131, 0x3163,
- 0xAC00, 0xD79D,
- 0
- };
- return ranges;
-}
-
-NK_INTERN void
-nk_font_baker_memory(nk_size *temp, int *glyph_count,
- struct nk_font_config *config_list, int count)
-{
- int range_count = 0;
- int total_range_count = 0;
- struct nk_font_config *iter, *i;
-
- NK_ASSERT(config_list);
- NK_ASSERT(glyph_count);
- if (!config_list) {
- *temp = 0;
- *glyph_count = 0;
- return;
- }
- *glyph_count = 0;
- for (iter = config_list; iter; iter = iter->next) {
- i = iter;
- do {if (!i->range) iter->range = nk_font_default_glyph_ranges();
- range_count = nk_range_count(i->range);
- total_range_count += range_count;
- *glyph_count += nk_range_glyph_count(i->range, range_count);
- } while ((i = i->n) != iter);
- }
- *temp = (nk_size)*glyph_count * sizeof(struct nk_rp_rect);
- *temp += (nk_size)total_range_count * sizeof(struct nk_tt_pack_range);
- *temp += (nk_size)*glyph_count * sizeof(struct nk_tt_packedchar);
- *temp += (nk_size)count * sizeof(struct nk_font_bake_data);
- *temp += sizeof(struct nk_font_baker);
- *temp += nk_rect_align + nk_range_align + nk_char_align;
- *temp += nk_build_align + nk_baker_align;
-}
-
-NK_INTERN struct nk_font_baker*
-nk_font_baker(void *memory, int glyph_count, int count, struct nk_allocator *alloc)
-{
- struct nk_font_baker *baker;
- if (!memory) return 0;
- /* setup baker inside a memory block */
- baker = (struct nk_font_baker*)NK_ALIGN_PTR(memory, nk_baker_align);
- baker->build = (struct nk_font_bake_data*)NK_ALIGN_PTR((baker + 1), nk_build_align);
- baker->packed_chars = (struct nk_tt_packedchar*)NK_ALIGN_PTR((baker->build + count), nk_char_align);
- baker->rects = (struct nk_rp_rect*)NK_ALIGN_PTR((baker->packed_chars + glyph_count), nk_rect_align);
- baker->ranges = (struct nk_tt_pack_range*)NK_ALIGN_PTR((baker->rects + glyph_count), nk_range_align);
- baker->alloc = *alloc;
- return baker;
-}
-
-NK_INTERN int
-nk_font_bake_pack(struct nk_font_baker *baker,
- nk_size *image_memory, int *width, int *height, struct nk_recti *custom,
- const struct nk_font_config *config_list, int count,
- struct nk_allocator *alloc)
-{
- NK_STORAGE const nk_size max_height = 1024 * 32;
- const struct nk_font_config *config_iter, *it;
- int total_glyph_count = 0;
- int total_range_count = 0;
- int range_count = 0;
- int i = 0;
-
- NK_ASSERT(image_memory);
- NK_ASSERT(width);
- NK_ASSERT(height);
- NK_ASSERT(config_list);
- NK_ASSERT(count);
- NK_ASSERT(alloc);
-
- if (!image_memory || !width || !height || !config_list || !count) return nk_false;
- for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
- it = config_iter;
- do {range_count = nk_range_count(it->range);
- total_range_count += range_count;
- total_glyph_count += nk_range_glyph_count(it->range, range_count);
- } while ((it = it->n) != config_iter);
- }
- /* setup font baker from temporary memory */
- for (config_iter = config_list; config_iter; config_iter = config_iter->next) {
- it = config_iter;
- do {if (!nk_tt_InitFont(&baker->build[i++].info, (const unsigned char*)it->ttf_blob, 0))
- return nk_false;
- } while ((it = it->n) != config_iter);
- }
- *height = 0;
- *width = (total_glyph_count > 1000) ? 1024 : 512;
- nk_tt_PackBegin(&baker->spc, 0, (int)*width, (int)max_height, 0, 1, alloc);
- {
- int input_i = 0;
- int range_n = 0;
- int rect_n = 0;
- int char_n = 0;
-
- if (custom) {
- /* pack custom user data first so it will be in the upper left corner*/
- struct nk_rp_rect custom_space;
- nk_zero(&custom_space, sizeof(custom_space));
- custom_space.w = (nk_rp_coord)(custom->w);
- custom_space.h = (nk_rp_coord)(custom->h);
-
- nk_tt_PackSetOversampling(&baker->spc, 1, 1);
- nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, &custom_space, 1);
- *height = NK_MAX(*height, (int)(custom_space.y + custom_space.h));
-
- custom->x = (short)custom_space.x;
- custom->y = (short)custom_space.y;
- custom->w = (short)custom_space.w;
- custom->h = (short)custom_space.h;
- }
-
- /* first font pass: pack all glyphs */
- for (input_i = 0, config_iter = config_list; input_i < count && config_iter;
- config_iter = config_iter->next) {
- it = config_iter;
- do {int n = 0;
- int glyph_count;
- const nk_rune *in_range;
- const struct nk_font_config *cfg = it;
- struct nk_font_bake_data *tmp = &baker->build[input_i++];
-
- /* count glyphs + ranges in current font */
- glyph_count = 0; range_count = 0;
- for (in_range = cfg->range; in_range[0] && in_range[1]; in_range += 2) {
- glyph_count += (int)(in_range[1] - in_range[0]) + 1;
- range_count++;
- }
-
- /* setup ranges */
- tmp->ranges = baker->ranges + range_n;
- tmp->range_count = (nk_rune)range_count;
- range_n += range_count;
- for (i = 0; i < range_count; ++i) {
- in_range = &cfg->range[i * 2];
- tmp->ranges[i].font_size = cfg->size;
- tmp->ranges[i].first_unicode_codepoint_in_range = (int)in_range[0];
- tmp->ranges[i].num_chars = (int)(in_range[1]- in_range[0]) + 1;
- tmp->ranges[i].chardata_for_range = baker->packed_chars + char_n;
- char_n += tmp->ranges[i].num_chars;
- }
-
- /* pack */
- tmp->rects = baker->rects + rect_n;
- rect_n += glyph_count;
- nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
- n = nk_tt_PackFontRangesGatherRects(&baker->spc, &tmp->info,
- tmp->ranges, (int)tmp->range_count, tmp->rects);
- nk_rp_pack_rects((struct nk_rp_context*)baker->spc.pack_info, tmp->rects, (int)n);
-
- /* texture height */
- for (i = 0; i < n; ++i) {
- if (tmp->rects[i].was_packed)
- *height = NK_MAX(*height, tmp->rects[i].y + tmp->rects[i].h);
- }
- } while ((it = it->n) != config_iter);
- }
- NK_ASSERT(rect_n == total_glyph_count);
- NK_ASSERT(char_n == total_glyph_count);
- NK_ASSERT(range_n == total_range_count);
- }
- *height = (int)nk_round_up_pow2((nk_uint)*height);
- *image_memory = (nk_size)(*width) * (nk_size)(*height);
- return nk_true;
-}
-
-NK_INTERN void
-nk_font_bake(struct nk_font_baker *baker, void *image_memory, int width, int height,
- struct nk_font_glyph *glyphs, int glyphs_count,
- const struct nk_font_config *config_list, int font_count)
-{
- int input_i = 0;
- nk_rune glyph_n = 0;
- const struct nk_font_config *config_iter;
- const struct nk_font_config *it;
-
- NK_ASSERT(image_memory);
- NK_ASSERT(width);
- NK_ASSERT(height);
- NK_ASSERT(config_list);
- NK_ASSERT(baker);
- NK_ASSERT(font_count);
- NK_ASSERT(glyphs_count);
- if (!image_memory || !width || !height || !config_list ||
- !font_count || !glyphs || !glyphs_count)
- return;
-
- /* second font pass: render glyphs */
- nk_zero(image_memory, (nk_size)((nk_size)width * (nk_size)height));
- baker->spc.pixels = (unsigned char*)image_memory;
- baker->spc.height = (int)height;
- for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
- config_iter = config_iter->next) {
- it = config_iter;
- do {const struct nk_font_config *cfg = it;
- struct nk_font_bake_data *tmp = &baker->build[input_i++];
- nk_tt_PackSetOversampling(&baker->spc, cfg->oversample_h, cfg->oversample_v);
- nk_tt_PackFontRangesRenderIntoRects(&baker->spc, &tmp->info, tmp->ranges,
- (int)tmp->range_count, tmp->rects, &baker->alloc);
- } while ((it = it->n) != config_iter);
- } nk_tt_PackEnd(&baker->spc, &baker->alloc);
-
- /* third pass: setup font and glyphs */
- for (input_i = 0, config_iter = config_list; input_i < font_count && config_iter;
- config_iter = config_iter->next) {
- it = config_iter;
- do {nk_size i = 0;
- int char_idx = 0;
- nk_rune glyph_count = 0;
- const struct nk_font_config *cfg = it;
- struct nk_font_bake_data *tmp = &baker->build[input_i++];
- struct nk_baked_font *dst_font = cfg->font;
-
- float font_scale = nk_tt_ScaleForPixelHeight(&tmp->info, cfg->size);
- int unscaled_ascent, unscaled_descent, unscaled_line_gap;
- nk_tt_GetFontVMetrics(&tmp->info, &unscaled_ascent, &unscaled_descent,
- &unscaled_line_gap);
-
- /* fill baked font */
- if (!cfg->merge_mode) {
- dst_font->ranges = cfg->range;
- dst_font->height = cfg->size;
- dst_font->ascent = ((float)unscaled_ascent * font_scale);
- dst_font->descent = ((float)unscaled_descent * font_scale);
- dst_font->glyph_offset = glyph_n;
- }
-
- /* fill own baked font glyph array */
- for (i = 0; i < tmp->range_count; ++i) {
- struct nk_tt_pack_range *range = &tmp->ranges[i];
- for (char_idx = 0; char_idx < range->num_chars; char_idx++)
- {
- nk_rune codepoint = 0;
- float dummy_x = 0, dummy_y = 0;
- struct nk_tt_aligned_quad q;
- struct nk_font_glyph *glyph;
-
- /* query glyph bounds from stb_truetype */
- const struct nk_tt_packedchar *pc = &range->chardata_for_range[char_idx];
- if (!pc->x0 && !pc->x1 && !pc->y0 && !pc->y1) continue;
- codepoint = (nk_rune)(range->first_unicode_codepoint_in_range + char_idx);
- nk_tt_GetPackedQuad(range->chardata_for_range, (int)width,
- (int)height, char_idx, &dummy_x, &dummy_y, &q, 0);
-
- /* fill own glyph type with data */
- glyph = &glyphs[dst_font->glyph_offset + dst_font->glyph_count + (unsigned int)glyph_count];
- glyph->codepoint = codepoint;
- glyph->x0 = q.x0; glyph->y0 = q.y0;
- glyph->x1 = q.x1; glyph->y1 = q.y1;
- glyph->y0 += (dst_font->ascent + 0.5f);
- glyph->y1 += (dst_font->ascent + 0.5f);
- glyph->w = glyph->x1 - glyph->x0 + 0.5f;
- glyph->h = glyph->y1 - glyph->y0;
-
- if (cfg->coord_type == NK_COORD_PIXEL) {
- glyph->u0 = q.s0 * (float)width;
- glyph->v0 = q.t0 * (float)height;
- glyph->u1 = q.s1 * (float)width;
- glyph->v1 = q.t1 * (float)height;
- } else {
- glyph->u0 = q.s0;
- glyph->v0 = q.t0;
- glyph->u1 = q.s1;
- glyph->v1 = q.t1;
- }
- glyph->xadvance = (pc->xadvance + cfg->spacing.x);
- if (cfg->pixel_snap)
- glyph->xadvance = (float)(int)(glyph->xadvance + 0.5f);
- glyph_count++;
- }
- }
- dst_font->glyph_count += glyph_count;
- glyph_n += glyph_count;
- } while ((it = it->n) != config_iter);
- }
-}
-
-NK_INTERN void
-nk_font_bake_custom_data(void *img_memory, int img_width, int img_height,
- struct nk_recti img_dst, const char *texture_data_mask, int tex_width,
- int tex_height, char white, char black)
-{
- nk_byte *pixels;
- int y = 0;
- int x = 0;
- int n = 0;
-
- NK_ASSERT(img_memory);
- NK_ASSERT(img_width);
- NK_ASSERT(img_height);
- NK_ASSERT(texture_data_mask);
- NK_UNUSED(tex_height);
- if (!img_memory || !img_width || !img_height || !texture_data_mask)
- return;
-
- pixels = (nk_byte*)img_memory;
- for (y = 0, n = 0; y < tex_height; ++y) {
- for (x = 0; x < tex_width; ++x, ++n) {
- const int off0 = ((img_dst.x + x) + (img_dst.y + y) * img_width);
- const int off1 = off0 + 1 + tex_width;
- pixels[off0] = (texture_data_mask[n] == white) ? 0xFF : 0x00;
- pixels[off1] = (texture_data_mask[n] == black) ? 0xFF : 0x00;
- }
- }
-}
-
-NK_INTERN void
-nk_font_bake_convert(void *out_memory, int img_width, int img_height,
- const void *in_memory)
-{
- int n = 0;
- nk_rune *dst;
- const nk_byte *src;
-
- NK_ASSERT(out_memory);
- NK_ASSERT(in_memory);
- NK_ASSERT(img_width);
- NK_ASSERT(img_height);
- if (!out_memory || !in_memory || !img_height || !img_width) return;
-
- dst = (nk_rune*)out_memory;
- src = (const nk_byte*)in_memory;
- for (n = (int)(img_width * img_height); n > 0; n--)
- *dst++ = ((nk_rune)(*src++) << 24) | 0x00FFFFFF;
-}
-
-/* -------------------------------------------------------------
- *
- * FONT
- *
- * --------------------------------------------------------------*/
-NK_INTERN float
-nk_font_text_width(nk_handle handle, float height, const char *text, int len)
-{
- nk_rune unicode;
- int text_len = 0;
- float text_width = 0;
- int glyph_len = 0;
- float scale = 0;
-
- struct nk_font *font = (struct nk_font*)handle.ptr;
- NK_ASSERT(font);
- NK_ASSERT(font->glyphs);
- if (!font || !text || !len)
- return 0;
-
- scale = height/font->info.height;
- glyph_len = text_len = nk_utf_decode(text, &unicode, (int)len);
- if (!glyph_len) return 0;
- while (text_len <= (int)len && glyph_len) {
- const struct nk_font_glyph *g;
- if (unicode == NK_UTF_INVALID) break;
-
- /* query currently drawn glyph information */
- g = nk_font_find_glyph(font, unicode);
- text_width += g->xadvance * scale;
-
- /* offset next glyph */
- glyph_len = nk_utf_decode(text + text_len, &unicode, (int)len - text_len);
- text_len += glyph_len;
- }
- return text_width;
-}
-
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
-NK_INTERN void
-nk_font_query_font_glyph(nk_handle handle, float height,
- struct nk_user_font_glyph *glyph, nk_rune codepoint, nk_rune next_codepoint)
-{
- float scale;
- const struct nk_font_glyph *g;
- struct nk_font *font;
-
- NK_ASSERT(glyph);
- NK_UNUSED(next_codepoint);
-
- font = (struct nk_font*)handle.ptr;
- NK_ASSERT(font);
- NK_ASSERT(font->glyphs);
- if (!font || !glyph)
- return;
-
- scale = height/font->info.height;
- g = nk_font_find_glyph(font, codepoint);
- glyph->width = (g->x1 - g->x0) * scale;
- glyph->height = (g->y1 - g->y0) * scale;
- glyph->offset = nk_vec2(g->x0 * scale, g->y0 * scale);
- glyph->xadvance = (g->xadvance * scale);
- glyph->uv[0] = nk_vec2(g->u0, g->v0);
- glyph->uv[1] = nk_vec2(g->u1, g->v1);
-}
-#endif
-
-NK_API const struct nk_font_glyph*
-nk_font_find_glyph(struct nk_font *font, nk_rune unicode)
-{
- int i = 0;
- int count;
- int total_glyphs = 0;
- const struct nk_font_glyph *glyph = 0;
- const struct nk_font_config *iter = 0;
-
- NK_ASSERT(font);
- NK_ASSERT(font->glyphs);
- NK_ASSERT(font->info.ranges);
- if (!font || !font->glyphs) return 0;
-
- glyph = font->fallback;
- iter = font->config;
- do {count = nk_range_count(iter->range);
- for (i = 0; i < count; ++i) {
- nk_rune f = iter->range[(i*2)+0];
- nk_rune t = iter->range[(i*2)+1];
- int diff = (int)((t - f) + 1);
- if (unicode >= f && unicode <= t)
- return &font->glyphs[((nk_rune)total_glyphs + (unicode - f))];
- total_glyphs += diff;
- }
- } while ((iter = iter->n) != font->config);
- return glyph;
-}
-
-NK_INTERN void
-nk_font_init(struct nk_font *font, float pixel_height,
- nk_rune fallback_codepoint, struct nk_font_glyph *glyphs,
- const struct nk_baked_font *baked_font, nk_handle atlas)
-{
- struct nk_baked_font baked;
- NK_ASSERT(font);
- NK_ASSERT(glyphs);
- NK_ASSERT(baked_font);
- if (!font || !glyphs || !baked_font)
- return;
-
- baked = *baked_font;
- font->fallback = 0;
- font->info = baked;
- font->scale = (float)pixel_height / (float)font->info.height;
- font->glyphs = &glyphs[baked_font->glyph_offset];
- font->texture = atlas;
- font->fallback_codepoint = fallback_codepoint;
- font->fallback = nk_font_find_glyph(font, fallback_codepoint);
-
- font->handle.height = font->info.height * font->scale;
- font->handle.width = nk_font_text_width;
- font->handle.userdata.ptr = font;
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- font->handle.query = nk_font_query_font_glyph;
- font->handle.texture = font->texture;
-#endif
-}
-
-/* ---------------------------------------------------------------------------
- *
- * DEFAULT FONT
- *
- * ProggyClean.ttf
- * Copyright (c) 2004, 2005 Tristan Grimmer
- * MIT license (see License.txt in http://www.upperbounds.net/download/ProggyClean.ttf.zip)
- * Download and more information at http://upperbounds.net
- *-----------------------------------------------------------------------------*/
-#ifdef NK_INCLUDE_DEFAULT_FONT
-
- #ifdef __clang__
-#pragma clang diagnostic push
-
-#pragma clang diagnostic ignored "-Woverlength-strings"
-#elif defined(__GNUC__) || defined(__GNUG__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Woverlength-strings"
-#endif
-
-NK_GLOBAL const char nk_proggy_clean_ttf_compressed_data_base85[11980+1] =
- "7])#######hV0qs'/###[),##/l:$#Q6>##5[n42>c-TH`->>#/e>11NNV=Bv(*:.F?uu#(gRU.o0XGH`$vhLG1hxt9?W`#,5LsCp#-i>.r$<$6pD>Lb';9Crc6tgXmKVeU2cD4Eo3R/"
- "2*>]b(MC;$jPfY.;h^`IWM9<Lh2TlS+f-s$o6Q<BWH`YiU.xfLq$N;$0iR/GX:U(jcW2p/W*q?-qmnUCI;jHSAiFWM.R*kU@C=GH?a9wp8f$e.-4^Qg1)Q-GL(lf(r/7GrRgwV%MS=C#"
- "`8ND>Qo#t'X#(v#Y9w0#1D$CIf;W'#pWUPXOuxXuU(H9M(1<q-UE31#^-V'8IRUo7Qf./L>=Ke$$'5F%)]0^#0X@U.a<r:QLtFsLcL6##lOj)#.Y5<-R&KgLwqJfLgN&;Q?gI^#DY2uL"
- "i@^rMl9t=cWq6##weg>$FBjVQTSDgEKnIS7EM9>ZY9w0#L;>>#Mx&4Mvt//L[MkA#W@lK.N'[0#7RL_&#w+F%HtG9M#XL`N&.,GM4Pg;-<nLENhvx>-VsM.M0rJfLH2eTM`*oJMHRC`N"
- "kfimM2J,W-jXS:)r0wK#@Fge$U>`w'N7G#$#fB#$E^$#:9:hk+eOe--6x)F7*E%?76%^GMHePW-Z5l'&GiF#$956:rS?dA#fiK:)Yr+`&#0j@'DbG&#^$PG.Ll+DNa<XCMKEV*N)LN/N"
- "*b=%Q6pia-Xg8I$<MR&,VdJe$<(7G;Ckl'&hF;;$<_=X(b.RS%%)###MPBuuE1V:v&cX&#2m#(&cV]`k9OhLMbn%s$G2,B$BfD3X*sp5#l,$R#]x_X1xKX%b5U*[r5iMfUo9U`N99hG)"
- "tm+/Us9pG)XPu`<0s-)WTt(gCRxIg(%6sfh=ktMKn3j)<6<b5Sk_/0(^]AaN#(p/L>&VZ>1i%h1S9u5o@YaaW$e+b<TWFn/Z:Oh(Cx2$lNEoN^e)#CFY@@I;BOQ*sRwZtZxRcU7uW6CX"
- "ow0i(?$Q[cjOd[P4d)]>ROPOpxTO7Stwi1::iB1q)C_=dV26J;2,]7op$]uQr@_V7$q^%lQwtuHY]=DX,n3L#0PHDO4f9>dC@O>HBuKPpP*E,N+b3L#lpR/MrTEH.IAQk.a>D[.e;mc."
- "x]Ip.PH^'/aqUO/$1WxLoW0[iLA<QT;5HKD+@qQ'NQ(3_PLhE48R.qAPSwQ0/WK?Z,[x?-J;jQTWA0X@KJ(_Y8N-:/M74:/-ZpKrUss?d#dZq]DAbkU*JqkL+nwX@@47`5>w=4h(9.`G"
- "CRUxHPeR`5Mjol(dUWxZa(>STrPkrJiWx`5U7F#.g*jrohGg`cg:lSTvEY/EV_7H4Q9[Z%cnv;JQYZ5q.l7Zeas:HOIZOB?G<Nald$qs]@]L<J7bR*>gv:[7MI2k).'2($5FNP&EQ(,)"
- "U]W]+fh18.vsai00);D3@4ku5P?DP8aJt+;qUM]=+b'8@;mViBKx0DE[-auGl8:PJ&Dj+M6OC]O^((##]`0i)drT;-7X`=-H3[igUnPG-NZlo.#k@h#=Ork$m>a>$-?Tm$UV(?#P6YY#"
- "'/###xe7q.73rI3*pP/$1>s9)W,JrM7SN]'/4C#v$U`0#V.[0>xQsH$fEmPMgY2u7Kh(G%siIfLSoS+MK2eTM$=5,M8p`A.;_R%#u[K#$x4AG8.kK/HSB==-'Ie/QTtG?-.*^N-4B/ZM"
- "_3YlQC7(p7q)&](`6_c)$/*JL(L-^(]$wIM`dPtOdGA,U3:w2M-0<q-]L_?^)1vw'.,MRsqVr.L;aN&#/EgJ)PBc[-f>+WomX2u7lqM2iEumMTcsF?-aT=Z-97UEnXglEn1K-bnEO`gu"
- "Ft(c%=;Am_Qs@jLooI&NX;]0#j4#F14;gl8-GQpgwhrq8'=l_f-b49'UOqkLu7-##oDY2L(te+Mch&gLYtJ,MEtJfLh'x'M=$CS-ZZ%P]8bZ>#S?YY#%Q&q'3^Fw&?D)UDNrocM3A76/"
- "/oL?#h7gl85[qW/NDOk%16ij;+:1a'iNIdb-ou8.P*w,v5#EI$TWS>Pot-R*H'-SEpA:g)f+O$%%`kA#G=8RMmG1&O`>to8bC]T&$,n.LoO>29sp3dt-52U%VM#q7'DHpg+#Z9%H[K<L"
- "%a2E-grWVM3@2=-k22tL]4$##6We'8UJCKE[d_=%wI;'6X-GsLX4j^SgJ$##R*w,vP3wK#iiW&#*h^D&R?jp7+/u&#(AP##XU8c$fSYW-J95_-Dp[g9wcO&#M-h1OcJlc-*vpw0xUX&#"
- "OQFKNX@QI'IoPp7nb,QU//MQ&ZDkKP)X<WSVL(68uVl&#c'[0#(s1X&xm$Y%B7*K:eDA323j998GXbA#pwMs-jgD$9QISB-A_(aN4xoFM^@C58D0+Q+q3n0#3U1InDjF682-SjMXJK)("
- "h$hxua_K]ul92%'BOU&#BRRh-slg8KDlr:%L71Ka:.A;%YULjDPmL<LYs8i#XwJOYaKPKc1h:'9Ke,g)b),78=I39B;xiY$bgGw-&.Zi9InXDuYa%G*f2Bq7mn9^#p1vv%#(Wi-;/Z5h"
- "o;#2:;%d&#x9v68C5g?ntX0X)pT`;%pB3q7mgGN)3%(P8nTd5L7GeA-GL@+%J3u2:(Yf>et`e;)f#Km8&+DC$I46>#Kr]]u-[=99tts1.qb#q72g1WJO81q+eN'03'eM>&1XxY-caEnO"
- "j%2n8)),?ILR5^.Ibn<-X-Mq7[a82Lq:F&#ce+S9wsCK*x`569E8ew'He]h:sI[2LM$[guka3ZRd6:t%IG:;$%YiJ:Nq=?eAw;/:nnDq0(CYcMpG)qLN4$##&J<j$UpK<Q4a1]MupW^-"
- "sj_$%[HK%'F####QRZJ::Y3EGl4'@%FkiAOg#p[##O`gukTfBHagL<LHw%q&OV0##F=6/:chIm0@eCP8X]:kFI%hl8hgO@RcBhS-@Qb$%+m=hPDLg*%K8ln(wcf3/'DW-$.lR?n[nCH-"
- "eXOONTJlh:.RYF%3'p6sq:UIMA945&^HFS87@$EP2iG<-lCO$%c`uKGD3rC$x0BL8aFn--`ke%#HMP'vh1/R&O_J9'um,.<tx[@%wsJk&bUT2`0uMv7gg#qp/ij.L56'hl;.s5CUrxjO"
- "M7-##.l+Au'A&O:-T72L]P`&=;ctp'XScX*rU.>-XTt,%OVU4)S1+R-#dg0/Nn?Ku1^0f$B*P:Rowwm-`0PKjYDDM'3]d39VZHEl4,.j']Pk-M.h^&:0FACm$maq-&sgw0t7/6(^xtk%"
- "LuH88Fj-ekm>GA#_>568x6(OFRl-IZp`&b,_P'$M<Jnq79VsJW/mWS*PUiq76;]/NM_>hLbxfc$mj`,O;&%W2m`Zh:/)Uetw:aJ%]K9h:TcF]u_-Sj9,VK3M.*'&0D[Ca]J9gp8,kAW]"
- "%(?A%R$f<->Zts'^kn=-^@c4%-pY6qI%J%1IGxfLU9CP8cbPlXv);C=b),<2mOvP8up,UVf3839acAWAW-W?#ao/^#%KYo8fRULNd2.>%m]UK:n%r$'sw]J;5pAoO_#2mO3n,'=H5(et"
- "Hg*`+RLgv>=4U8guD$I%D:W>-r5V*%j*W:Kvej.Lp$<M-SGZ':+Q_k+uvOSLiEo(<aD/K<CCc`'Lx>'?;++O'>()jLR-^u68PHm8ZFWe+ej8h:9r6L*0//c&iH&R8pRbA#Kjm%upV1g:"
- "a_#Ur7FuA#(tRh#.Y5K+@?3<-8m0$PEn;J:rh6?I6uG<-`wMU'ircp0LaE_OtlMb&1#6T.#FDKu#1Lw%u%+GM+X'e?YLfjM[VO0MbuFp7;>Q&#WIo)0@F%q7c#4XAXN-U&VB<HFF*qL("
- "$/V,;(kXZejWO`<[5?\?ewY(*9=%wDc;,u<'9t3W-(H1th3+G]ucQ]kLs7df($/*JL]@*t7Bu_G3_7mp7<iaQjO@.kLg;x3B0lqp7Hf,^Ze7-##@/c58Mo(3;knp0%)A7?-W+eI'o8)b<"
- "nKnw'Ho8C=Y>pqB>0ie&jhZ[?iLR@@_AvA-iQC(=ksRZRVp7`.=+NpBC%rh&3]R:8XDmE5^V8O(x<<aG/1N$#FX$0V5Y6x'aErI3I$7x%E`v<-BY,)%-?Psf*l?%C3.mM(=/M0:JxG'?"
- "7WhH%o'a<-80g0NBxoO(GH<dM]n.+%q@jH?f.UsJ2Ggs&4<-e47&Kl+f//9@`b+?.TeN_&B8Ss?v;^Trk;f#YvJkl&w$]>-+k?'(<S:68tq*WoDfZu';mM?8X[ma8W%*`-=;D.(nc7/;"
- ")g:T1=^J$&BRV(-lTmNB6xqB[@0*o.erM*<SWF]u2=st-*(6v>^](H.aREZSi,#1:[IXaZFOm<-ui#qUq2$##Ri;u75OK#(RtaW-K-F`S+cF]uN`-KMQ%rP/Xri.LRcB##=YL3BgM/3M"
- "D?@f&1'BW-)Ju<L25gl8uhVm1hL$##*8###'A3/LkKW+(^rWX?5W_8g)a(m&K8P>#bmmWCMkk&#TR`C,5d>g)F;t,4:@_l8G/5h4vUd%&%950:VXD'QdWoY-F$BtUwmfe$YqL'8(PWX("
- "P?^@Po3$##`MSs?DWBZ/S>+4%>fX,VWv/w'KD`LP5IbH;rTV>n3cEK8U#bX]l-/V+^lj3;vlMb&[5YQ8#pekX9JP3XUC72L,,?+Ni&co7ApnO*5NK,((W-i:$,kp'UDAO(G0Sq7MVjJs"
- "bIu)'Z,*[>br5fX^:FPAWr-m2KgL<LUN098kTF&#lvo58=/vjDo;.;)Ka*hLR#/k=rKbxuV`>Q_nN6'8uTG&#1T5g)uLv:873UpTLgH+#FgpH'_o1780Ph8KmxQJ8#H72L4@768@Tm&Q"
- "h4CB/5OvmA&,Q&QbUoi$a_%3M01H)4x7I^&KQVgtFnV+;[Pc>[m4k//,]1?#`VY[Jr*3&&slRfLiVZJ:]?=K3Sw=[$=uRB?3xk48@aeg<Z'<$#4H)6,>e0jT6'N#(q%.O=?2S]u*(m<-"
- "V8J'(1)G][68hW$5'q[GC&5j`TE?m'esFGNRM)j,ffZ?-qx8;->g4t*:CIP/[Qap7/9'#(1sao7w-.qNUdkJ)tCF&#B^;xGvn2r9FEPFFFcL@.iFNkTve$m%#QvQS8U@)2Z+3K:AKM5i"
- "sZ88+dKQ)W6>J%CL<KE>`.d*(B`-n8D9oK<Up]c$X$(,)M8Zt7/[rdkqTgl-0cuGMv'?>-XV1q['-5k'cAZ69e;D_?$ZPP&s^+7])$*$#@QYi9,5P&#9r+$%CE=68>K8r0=dSC%%(@p7"
- ".m7jilQ02'0-VWAg<a/''3u.=4L$Y)6k/K:_[3=&jvL<L0C/2'v:^;-DIBW,B4E68:kZ;%?8(Q8BH=kO65BW?xSG&#@uU,DS*,?.+(o(#1vCS8#CHF>TlGW'b)Tq7VT9q^*^$$.:&N@@"
- "$&)WHtPm*5_rO0&e%K&#-30j(E4#'Zb.o/(Tpm$>K'f@[PvFl,hfINTNU6u'0pao7%XUp9]5.>%h`8_=VYbxuel.NTSsJfLacFu3B'lQSu/m6-Oqem8T+oE--$0a/k]uj9EwsG>%veR*"
- "hv^BFpQj:K'#SJ,sB-'#](j.Lg92rTw-*n%@/;39rrJF,l#qV%OrtBeC6/,;qB3ebNW[?,Hqj2L.1NP&GjUR=1D8QaS3Up&@*9wP?+lo7b?@%'k4`p0Z$22%K3+iCZj?XJN4Nm&+YF]u"
- "@-W$U%VEQ/,,>>#)D<h#`)h0:<Q6909ua+&VU%n2:cG3FJ-%@Bj-DgLr`Hw&HAKjKjseK</xKT*)B,N9X3]krc12t'pgTV(Lv-tL[xg_%=M_q7a^x?7Ubd>#%8cY#YZ?=,`Wdxu/ae&#"
- "w6)R89tI#6@s'(6Bf7a&?S=^ZI_kS&ai`&=tE72L_D,;^R)7[$s<Eh#c&)q.MXI%#v9ROa5FZO%sF7q7Nwb&#ptUJ:aqJe$Sl68%.D###EC><?-aF&#RNQv>o8lKN%5/$(vdfq7+ebA#"
- "u1p]ovUKW&Y%q]'>$1@-[xfn$7ZTp7mM,G,Ko7a&Gu%G[RMxJs[0MM%wci.LFDK)(<c`Q8N)jEIF*+?P2a8g%)$q]o2aH8C&<SibC/q,(e:v;-b#6[$NtDZ84Je2KNvB#$P5?tQ3nt(0"
- "d=j.LQf./Ll33+(;q3L-w=8dX$#WF&uIJ@-bfI>%:_i2B5CsR8&9Z&#=mPEnm0f`<&c)QL5uJ#%u%lJj+D-r;BoF&#4DoS97h5g)E#o:&S4weDF,9^Hoe`h*L+_a*NrLW-1pG_&2UdB8"
- "6e%B/:=>)N4xeW.*wft-;$'58-ESqr<b?UI(_%@[P46>#U`'6AQ]m&6/`Z>#S?YY#Vc;r7U2&326d=w&H####?TZ`*4?&.MK?LP8Vxg>$[QXc%QJv92.(Db*B)gb*BM9dM*hJMAo*c&#"
- "b0v=Pjer]$gG&JXDf->'StvU7505l9$AFvgYRI^&<^b68?j#q9QX4SM'RO#&sL1IM.rJfLUAj221]d##DW=m83u5;'bYx,*Sl0hL(W;;$doB&O/TQ:(Z^xBdLjL<Lni;''X.`$#8+1GD"
- ":k$YUWsbn8ogh6rxZ2Z9]%nd+>V#*8U_72Lh+2Q8Cj0i:6hp&$C/:p(HK>T8Y[gHQ4`4)'$Ab(Nof%V'8hL&#<NEdtg(n'=S1A(Q1/I&4([%dM`,Iu'1:_hL>SfD07&6D<fp8dHM7/g+"
- "tlPN9J*rKaPct&?'uBCem^jn%9_K)<,C5K3s=5g&GmJb*[SYq7K;TRLGCsM-$$;S%:Y@r7AK0pprpL<Lrh,q7e/%KWK:50I^+m'vi`3?%Zp+<-d+$L-Sv:@.o19n$s0&39;kn;S%BSq*"
- "$3WoJSCLweV[aZ'MQIjO<7;X-X;&+dMLvu#^UsGEC9WEc[X(wI7#2.(F0jV*eZf<-Qv3J-c+J5AlrB#$p(H68LvEA'q3n0#m,[`*8Ft)FcYgEud]CWfm68,(aLA$@EFTgLXoBq/UPlp7"
- ":d[/;r_ix=:TF`S5H-b<LI&HY(K=h#)]Lk$K14lVfm:x$H<3^Ql<M`$OhapBnkup'D#L$Pb_`N*g]2e;X/Dtg,bsj&K#2[-:iYr'_wgH)NUIR8a1n#S?Yej'h8^58UbZd+^FKD*T@;6A"
- "7aQC[K8d-(v6GI$x:T<&'Gp5Uf>@M.*J:;$-rv29'M]8qMv-tLp,'886iaC=Hb*YJoKJ,(j%K=H`K.v9HggqBIiZu'QvBT.#=)0ukruV&.)3=(^1`o*Pj4<-<aN((^7('#Z0wK#5GX@7"
- "u][`*S^43933A4rl][`*O4CgLEl]v$1Q3AeF37dbXk,.)vj#x'd`;qgbQR%FW,2(?LO=s%Sc68%NP'##Aotl8x=BE#j1UD([3$M(]UI2LX3RpKN@;/#f'f/&_mt&F)XdF<9t4)Qa.*kT"
- "LwQ'(TTB9.xH'>#MJ+gLq9-##@HuZPN0]u:h7.T..G:;$/Usj(T7`Q8tT72LnYl<-qx8;-HV7Q-&Xdx%1a,hC=0u+HlsV>nuIQL-5<N?)NBS)QN*_I,?&)2'IM%L3I)X((e/dl2&8'<M"
- ":^#M*Q+[T.Xri.LYS3v%fF`68h;b-X[/En'CR.q7E)p'/kle2HM,u;^%OKC-N+Ll%F9CF<Nf'^#t2L,;27W:0O@6##U6W7:$rJfLWHj$#)woqBefIZ.PK<b*t7ed;p*_m;4ExK#h@&]>"
- "_>@kXQtMacfD.m-VAb8;IReM3$wf0''hra*so568'Ip&vRs849'MRYSp%:t:h5qSgwpEr$B>Q,;s(C#$)`svQuF$##-D,##,g68@2[T;.XSdN9Qe)rpt._K-#5wF)sP'##p#C0c%-Gb%"
- "hd+<-j'Ai*x&&HMkT]C'OSl##5RG[JXaHN;d'uA#x._U;.`PU@(Z3dt4r152@:v,'R.Sj'w#0<-;kPI)FfJ&#AYJ&#//)>-k=m=*XnK$>=)72L]0I%>.G690a:$##<,);?;72#?x9+d;"
- "^V'9;jY@;)br#q^YQpx:X#Te$Z^'=-=bGhLf:D6&bNwZ9-ZD#n^9HhLMr5G;']d&6'wYmTFmL<LD)F^%[tC'8;+9E#C$g%#5Y>q9wI>P(9mI[>kC-ekLC/R&CH+s'B;K-M6$EB%is00:"
- "+A4[7xks.LrNk0&E)wILYF@2L'0Nb$+pv<(2.768/FrY&h$^3i&@+G%JT'<-,v`3;_)I9M^AE]CN?Cl2AZg+%4iTpT3<n-&%H%b<FDj2M<hH=&Eh<2Len$b*aTX=-8QxN)k11IM1c^j%"
- "9s<L<NFSo)B?+<-(GxsF,^-Eh@$4dXhN$+#rxK8'je'D7k`e;)2pYwPA'_p9&@^18ml1^[@g4t*[JOa*[=Qp7(qJ_oOL^('7fB&Hq-:sf,sNj8xq^>$U4O]GKx'm9)b@p7YsvK3w^YR-"
- "CdQ*:Ir<($u&)#(&?L9Rg3H)4fiEp^iI9O8KnTj,]H?D*r7'M;PwZ9K0E^k&-cpI;.p/6_vwoFMV<->#%Xi.LxVnrU(4&8/P+:hLSKj$#U%]49t'I:rgMi'FL@a:0Y-uA[39',(vbma*"
- "hU%<-SRF`Tt:542R_VV$p@[p8DV[A,?1839FWdF<TddF<9Ah-6&9tWoDlh]&1SpGMq>Ti1O*H&#(AL8[_P%.M>v^-))qOT*F5Cq0`Ye%+$B6i:7@0IX<N+T+0MlMBPQ*Vj>SsD<U4JHY"
- "8kD2)2fU/M#$e.)T4,_=8hLim[&);?UkK'-x?'(:siIfL<$pFM`i<?%W(mGDHM%>iWP,##P`%/L<eXi:@Z9C.7o=@(pXdAO/NLQ8lPl+HPOQa8wD8=^GlPa8TKI1CjhsCTSLJM'/Wl>-"
- "S(qw%sf/@%#B6;/U7K]uZbi^Oc^2n<bhPmUkMw>%t<)'mEVE''n`WnJra$^TKvX5B>;_aSEK',(hwa0:i4G?.Bci.(X[?b*($,=-n<.Q%`(X=?+@Am*Js0&=3bh8K]mL<LoNs'6,'85`"
- "0?t/'_U59@]ddF<#LdF<eWdF<OuN/45rY<-L@&#+fm>69=Lb,OcZV/);TTm8VI;?%OtJ<(b4mq7M6:u?KRdF<gR@2L=FNU-<b[(9c/ML3m;Z[$oF3g)GAWqpARc=<ROu7cL5l;-[A]%/"
- "+fsd;l#SafT/f*W]0=O'$(Tb<[)*@e775R-:Yob%g*>l*:xP?Yb.5)%w_I?7uk5JC+FS(m#i'k.'a0i)9<7b'fs'59hq$*5Uhv##pi^8+hIEBF`nvo`;'l0.^S1<-wUK2/Coh58KKhLj"
- "M=SO*rfO`+qC`W-On.=AJ56>>i2@2LH6A:&5q`?9I3@@'04&p2/LVa*T-4<-i3;M9UvZd+N7>b*eIwg:CC)c<>nO&#<IGe;__.thjZl<%w(Wk2xmp4Q@I#I9,DF]u7-P=.-_:YJ]aS@V"
- "?6*C()dOp7:WL,b&3Rg/.cmM9&r^>$(>.Z-I&J(Q0Hd5Q%7Co-b`-c<N(6r@ip+AurK<m86QIth*#v;-OBqi+L7wDE-Ir8K['m+DDSLwK&/.?-V%U_%3:qKNu$_b*B-kp7NaD'QdWQPK"
- "Yq[@>P)hI;*_F]u`Rb[.j8_Q/<&>uu+VsH$sM9TA%?)(vmJ80),P7E>)tjD%2L=-t#fK[%`v=Q8<FfNkgg^oIbah*#8/Qt$F&:K*-(N/'+1vMB,u()-a.VUU*#[e%gAAO(S>WlA2);Sa"
- ">gXm8YB`1d@K#n]76-a$U,mF<fX]idqd)<3,]J7JmW4`6]uks=4-72L(jEk+:bJ0M^q-8Dm_Z?0olP1C9Sa&H[d&c$ooQUj]Exd*3ZM@-WGW2%s',B-_M%>%Ul:#/'xoFM9QX-$.QN'>"
- "[%$Z$uF6pA6Ki2O5:8w*vP1<-1`[G,)-m#>0`P&#eb#.3i)rtB61(o'$?X3B</R90;eZ]%Ncq;-Tl]#F>2Qft^ae_5tKL9MUe9b*sLEQ95C&`=G?@Mj=wh*'3E>=-<)Gt*Iw)'QG:`@I"
- "wOf7&]1i'S01B+Ev/Nac#9S;=;YQpg_6U`*kVY39xK,[/6Aj7:'1Bm-_1EYfa1+o&o4hp7KN_Q(OlIo@S%;jVdn0'1<Vc52=u`3^o-n1'g4v58Hj&6_t7$##?M)c<$bgQ_'SY((-xkA#"
- "Y(,p'H9rIVY-b,'%bCPF7.J<Up^,(dU1VY*5#WkTU>h19w,WQhLI)3S#f$2(eb,jr*b;3Vw]*7NH%$c4Vs,eD9>XW8?N]o+(*pgC%/72LV-u<Hp,3@e^9UB1J+ak9-TN/mhKPg+AJYd$"
- "MlvAF_jCK*.O-^(63adMT->W%iewS8W6m2rtCpo'RS1R84=@paTKt)>=%&1[)*vp'u+x,VrwN;&]kuO9JDbg=pO$J*.jVe;u'm0dr9l,<*wMK*Oe=g8lV_KEBFkO'oU]^=[-792#ok,)"
- "i]lR8qQ2oA8wcRCZ^7w/Njh;?.stX?Q1>S1q4Bn$)K1<-rGdO'$Wr.Lc.CG)$/*JL4tNR/,SVO3,aUw'DJN:)Ss;wGn9A32ijw%FL+Z0Fn.U9;reSq)bmI32U==5ALuG&#Vf1398/pVo"
- "1*c-(aY168o<`JsSbk-,1N;$>0:OUas(3:8Z972LSfF8eb=c-;>SPw7.6hn3m`9^Xkn(r.qS[0;T%&Qc=+STRxX'q1BNk3&*eu2;&8q$&x>Q#Q7^Tf+6<(d%ZVmj2bDi%.3L2n+4W'$P"
- "iDDG)g,r%+?,$@?uou5tSe2aN_AQU*<h`e-GI7)?OK2A.d7_c)?wQ5AS@DL3r#7fSkgl6-++D:'A,uq7SvlB$pcpH'q3n0#_%dY#xCpr-l<F0NR@-##FEV6NTF6##$l84N1w?AO>'IAO"
- "URQ##V^Fv-XFbGM7Fl(N<3DhLGF%q.1rC$#:T__&Pi68%0xi_&[qFJ(77j_&JWoF.V735&T,[R*:xFR*K5>>#`bW-?4Ne_&6Ne_&6Ne_&n`kr-#GJcM6X;uM6X;uM(.a..^2TkL%oR(#"
- ";u.T%fAr%4tJ8&><1=GHZ_+m9/#H1F^R#SC#*N=BA9(D?v[UiFY>>^8p,KKF.W]L29uLkLlu/+4T<XoIB&hx=T1PcDaB&;HH+-AFr?(m9HZV)FKS8JCw;SD=6[^/DZUL`EUDf]GGlG&>"
- "w$)F./^n3+rlo+DB;5sIYGNk+i1t-69Jg--0pao7Sm#K)pdHW&;LuDNH@H>#/X-TI(;P>#,Gc>#0Su>#4`1?#8lC?#<xU?#@.i?#D:%@#HF7@#LRI@#P_[@#Tkn@#Xw*A#]-=A#a9OA#"
- "d<F&#*;G##.GY##2Sl##6`($#:l:$#>xL$#B.`$#F:r$#JF.%#NR@%#R_R%#Vke%#Zww%#_-4&#3^Rh%Sflr-k'MS.o?.5/sWel/wpEM0%3'/1)K^f1-d>G21&v(35>V`39V7A4=onx4"
- "A1OY5EI0;6Ibgr6M$HS7Q<)58C5w,;WoA*#[%T*#`1g*#d=#+#hI5+#lUG+#pbY+#tnl+#x$),#&1;,#*=M,#.I`,#2Ur,#6b.-#;w[H#iQtA#m^0B#qjBB#uvTB##-hB#'9$C#+E6C#"
- "/QHC#3^ZC#7jmC#;v)D#?,<D#C8ND#GDaD#KPsD#O]/E#g1A5#KA*1#gC17#MGd;#8(02#L-d3#rWM4#Hga1#,<w0#T.j<#O#'2#CYN1#qa^:#_4m3#o@/=#eG8=#t8J5#`+78#4uI-#"
- "m3B2#SB[8#Q0@8#i[*9#iOn8#1Nm;#^sN9#qh<9#:=x-#P;K2#$%X9#bC+.#Rg;<#mN=.#MTF.#RZO.#2?)4#Y#(/#[)1/#b;L/#dAU/#0Sv;#lY$0#n`-0#sf60#(F24#wrH0#%/e0#"
- "TmD<#%JSMFove:CTBEXI:<eh2g)B,3h2^G3i;#d3jD>)4kMYD4lVu`4m`:&5niUA5@(A5BA1]PBB:xlBCC=2CDLXMCEUtiCf&0g2'tN?PGT4CPGT4CPGT4CPGT4CPGT4CPGT4CPGT4CP"
- "GT4CPGT4CPGT4CPGT4CPGT4CPGT4CP-qekC`.9kEg^+F$kwViFJTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5KTB&5o,^<-28ZI'O?;xp"
- "O?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xpO?;xp;7q-#lLYI:xvD=#";
-#endif /* NK_INCLUDE_DEFAULT_FONT */
-
-#define NK_CURSOR_DATA_W 90
-#define NK_CURSOR_DATA_H 27
-NK_GLOBAL const char nk_custom_cursor_data[NK_CURSOR_DATA_W * NK_CURSOR_DATA_H + 1] =
-{
- "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX"
- "..- -X.....X- X.X - X.X -X.....X - X.....X"
- "--- -XXX.XXX- X...X - X...X -X....X - X....X"
- "X - X.X - X.....X - X.....X -X...X - X...X"
- "XX - X.X -X.......X- X.......X -X..X.X - X.X..X"
- "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X"
- "X..X - X.X - X.X - X.X -XX X.X - X.X XX"
- "X...X - X.X - X.X - XX X.X XX - X.X - X.X "
- "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X "
- "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X "
- "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X "
- "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X "
- "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X "
- "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X "
- "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X "
- "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X "
- "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX "
- "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------"
- "X.X X..X - -X.......X- X.......X - XX XX - "
- "XX X..X - - X.....X - X.....X - X.X X.X - "
- " X..X - X...X - X...X - X..X X..X - "
- " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - "
- "------------ - X - X -X.....................X- "
- " ----------------------------------- X...XXXXXXXXXXXXX...X - "
- " - X..X X..X - "
- " - X.X X.X - "
- " - XX XX - "
-};
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#elif defined(__GNUC__) || defined(__GNUG__)
-#pragma GCC diagnostic pop
-#endif
-
-NK_INTERN unsigned int
-nk_decompress_length(unsigned char *input)
-{
- return (unsigned int)((input[8] << 24) + (input[9] << 16) + (input[10] << 8) + input[11]);
-}
-
-NK_GLOBAL unsigned char *nk__barrier;
-NK_GLOBAL unsigned char *nk__barrier2;
-NK_GLOBAL unsigned char *nk__barrier3;
-NK_GLOBAL unsigned char *nk__barrier4;
-NK_GLOBAL unsigned char *nk__dout;
-
-NK_INTERN void
-nk__match(unsigned char *data, unsigned int length)
-{
- /* INVERSE of memmove... write each byte before copying the next...*/
- NK_ASSERT (nk__dout + length <= nk__barrier);
- if (nk__dout + length > nk__barrier) { nk__dout += length; return; }
- if (data < nk__barrier4) { nk__dout = nk__barrier+1; return; }
- while (length--) *nk__dout++ = *data++;
-}
-
-NK_INTERN void
-nk__lit(unsigned char *data, unsigned int length)
-{
- NK_ASSERT (nk__dout + length <= nk__barrier);
- if (nk__dout + length > nk__barrier) { nk__dout += length; return; }
- if (data < nk__barrier2) { nk__dout = nk__barrier+1; return; }
- NK_MEMCPY(nk__dout, data, length);
- nk__dout += length;
-}
-
-#define nk__in2(x) ((i[x] << 8) + i[(x)+1])
-#define nk__in3(x) ((i[x] << 16) + nk__in2((x)+1))
-#define nk__in4(x) ((i[x] << 24) + nk__in3((x)+1))
-
-NK_INTERN unsigned char*
-nk_decompress_token(unsigned char *i)
-{
- if (*i >= 0x20) { /* use fewer if's for cases that expand small */
- if (*i >= 0x80) nk__match(nk__dout-i[1]-1, (unsigned int)i[0] - 0x80 + 1), i += 2;
- else if (*i >= 0x40) nk__match(nk__dout-(nk__in2(0) - 0x4000 + 1), (unsigned int)i[2]+1), i += 3;
- else /* *i >= 0x20 */ nk__lit(i+1, (unsigned int)i[0] - 0x20 + 1), i += 1 + (i[0] - 0x20 + 1);
- } else { /* more ifs for cases that expand large, since overhead is amortized */
- if (*i >= 0x18) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x180000 + 1), (unsigned int)i[3]+1), i += 4;
- else if (*i >= 0x10) nk__match(nk__dout-(unsigned int)(nk__in3(0) - 0x100000 + 1), (unsigned int)nk__in2(3)+1), i += 5;
- else if (*i >= 0x08) nk__lit(i+2, (unsigned int)nk__in2(0) - 0x0800 + 1), i += 2 + (nk__in2(0) - 0x0800 + 1);
- else if (*i == 0x07) nk__lit(i+3, (unsigned int)nk__in2(1) + 1), i += 3 + (nk__in2(1) + 1);
- else if (*i == 0x06) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), i[4]+1u), i += 5;
- else if (*i == 0x04) nk__match(nk__dout-(unsigned int)(nk__in3(1)+1), (unsigned int)nk__in2(4)+1u), i += 6;
- }
- return i;
-}
-
-NK_INTERN unsigned int
-nk_adler32(unsigned int adler32, unsigned char *buffer, unsigned int buflen)
-{
- const unsigned long ADLER_MOD = 65521;
- unsigned long s1 = adler32 & 0xffff, s2 = adler32 >> 16;
- unsigned long blocklen, i;
-
- blocklen = buflen % 5552;
- while (buflen) {
- for (i=0; i + 7 < blocklen; i += 8) {
- s1 += buffer[0]; s2 += s1;
- s1 += buffer[1]; s2 += s1;
- s1 += buffer[2]; s2 += s1;
- s1 += buffer[3]; s2 += s1;
- s1 += buffer[4]; s2 += s1;
- s1 += buffer[5]; s2 += s1;
- s1 += buffer[6]; s2 += s1;
- s1 += buffer[7]; s2 += s1;
- buffer += 8;
- }
- for (; i < blocklen; ++i) {
- s1 += *buffer++; s2 += s1;
- }
-
- s1 %= ADLER_MOD; s2 %= ADLER_MOD;
- buflen -= (unsigned int)blocklen;
- blocklen = 5552;
- }
- return (unsigned int)(s2 << 16) + (unsigned int)s1;
-}
-
-NK_INTERN unsigned int
-nk_decompress(unsigned char *output, unsigned char *i, unsigned int length)
-{
- unsigned int olen;
- if (nk__in4(0) != 0x57bC0000) return 0;
- if (nk__in4(4) != 0) return 0; /* error! stream is > 4GB */
- olen = nk_decompress_length(i);
- nk__barrier2 = i;
- nk__barrier3 = i+length;
- nk__barrier = output + olen;
- nk__barrier4 = output;
- i += 16;
-
- nk__dout = output;
- for (;;) {
- unsigned char *old_i = i;
- i = nk_decompress_token(i);
- if (i == old_i) {
- if (*i == 0x05 && i[1] == 0xfa) {
- NK_ASSERT(nk__dout == output + olen);
- if (nk__dout != output + olen) return 0;
- if (nk_adler32(1, output, olen) != (unsigned int) nk__in4(2))
- return 0;
- return olen;
- } else {
- NK_ASSERT(0); /* NOTREACHED */
- return 0;
- }
- }
- NK_ASSERT(nk__dout <= output + olen);
- if (nk__dout > output + olen)
- return 0;
- }
-}
-
-NK_INTERN unsigned int
-nk_decode_85_byte(char c)
-{ return (unsigned int)((c >= '\\') ? c-36 : c-35); }
-
-NK_INTERN void
-nk_decode_85(unsigned char* dst, const unsigned char* src)
-{
- while (*src)
- {
- unsigned int tmp =
- nk_decode_85_byte((char)src[0]) +
- 85 * (nk_decode_85_byte((char)src[1]) +
- 85 * (nk_decode_85_byte((char)src[2]) +
- 85 * (nk_decode_85_byte((char)src[3]) +
- 85 * nk_decode_85_byte((char)src[4]))));
-
- /* we can't assume little-endianess. */
- dst[0] = (unsigned char)((tmp >> 0) & 0xFF);
- dst[1] = (unsigned char)((tmp >> 8) & 0xFF);
- dst[2] = (unsigned char)((tmp >> 16) & 0xFF);
- dst[3] = (unsigned char)((tmp >> 24) & 0xFF);
-
- src += 5;
- dst += 4;
- }
-}
-
-/* -------------------------------------------------------------
- *
- * FONT ATLAS
- *
- * --------------------------------------------------------------*/
-NK_API struct nk_font_config
-nk_font_config(float pixel_height)
-{
- struct nk_font_config cfg;
- nk_zero_struct(cfg);
- cfg.ttf_blob = 0;
- cfg.ttf_size = 0;
- cfg.ttf_data_owned_by_atlas = 0;
- cfg.size = pixel_height;
- cfg.oversample_h = 3;
- cfg.oversample_v = 1;
- cfg.pixel_snap = 0;
- cfg.coord_type = NK_COORD_UV;
- cfg.spacing = nk_vec2(0,0);
- cfg.range = nk_font_default_glyph_ranges();
- cfg.merge_mode = 0;
- cfg.fallback_glyph = '?';
- cfg.font = 0;
- cfg.n = 0;
- return cfg;
-}
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void
-nk_font_atlas_init_default(struct nk_font_atlas *atlas)
-{
- NK_ASSERT(atlas);
- if (!atlas) return;
- nk_zero_struct(*atlas);
- atlas->temporary.userdata.ptr = 0;
- atlas->temporary.alloc = nk_malloc;
- atlas->temporary.free = nk_mfree;
- atlas->permanent.userdata.ptr = 0;
- atlas->permanent.alloc = nk_malloc;
- atlas->permanent.free = nk_mfree;
-}
-#endif
-
-NK_API void
-nk_font_atlas_init(struct nk_font_atlas *atlas, struct nk_allocator *alloc)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(alloc);
- if (!atlas || !alloc) return;
- nk_zero_struct(*atlas);
- atlas->permanent = *alloc;
- atlas->temporary = *alloc;
-}
-
-NK_API void
-nk_font_atlas_init_custom(struct nk_font_atlas *atlas,
- struct nk_allocator *permanent, struct nk_allocator *temporary)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(permanent);
- NK_ASSERT(temporary);
- if (!atlas || !permanent || !temporary) return;
- nk_zero_struct(*atlas);
- atlas->permanent = *permanent;
- atlas->temporary = *temporary;
-}
-
-NK_API void
-nk_font_atlas_begin(struct nk_font_atlas *atlas)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc && atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc && atlas->permanent.free);
- if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free ||
- !atlas->temporary.alloc || !atlas->temporary.free) return;
- if (atlas->glyphs) {
- atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
- atlas->glyphs = 0;
- }
- if (atlas->pixel) {
- atlas->permanent.free(atlas->permanent.userdata, atlas->pixel);
- atlas->pixel = 0;
- }
-}
-
-NK_API struct nk_font*
-nk_font_atlas_add(struct nk_font_atlas *atlas, const struct nk_font_config *config)
-{
- struct nk_font *font = 0;
- struct nk_font_config *cfg;
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
-
- NK_ASSERT(config);
- NK_ASSERT(config->ttf_blob);
- NK_ASSERT(config->ttf_size);
- NK_ASSERT(config->size > 0.0f);
-
- if (!atlas || !config || !config->ttf_blob || !config->ttf_size || config->size <= 0.0f||
- !atlas->permanent.alloc || !atlas->permanent.free ||
- !atlas->temporary.alloc || !atlas->temporary.free)
- return 0;
-
- /* allocate font config */
- cfg = (struct nk_font_config*)
- atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font_config));
- NK_MEMCPY(cfg, config, sizeof(*config));
- cfg->n = cfg;
- cfg->p = cfg;
-
- if (!config->merge_mode) {
- /* insert font config into list */
- if (!atlas->config) {
- atlas->config = cfg;
- cfg->next = 0;
- } else {
- struct nk_font_config *i = atlas->config;
- while (i->next) i = i->next;
- i->next = cfg;
- cfg->next = 0;
- }
- /* allocate new font */
- font = (struct nk_font*)
- atlas->permanent.alloc(atlas->permanent.userdata,0, sizeof(struct nk_font));
- NK_ASSERT(font);
- nk_zero(font, sizeof(*font));
- if (!font) return 0;
- font->config = cfg;
-
- /* insert font into list */
- if (!atlas->fonts) {
- atlas->fonts = font;
- font->next = 0;
- } else {
- struct nk_font *i = atlas->fonts;
- while (i->next) i = i->next;
- i->next = font;
- font->next = 0;
- }
- cfg->font = &font->info;
- } else {
- /* extend previously added font */
- struct nk_font *f = 0;
- struct nk_font_config *c = 0;
- NK_ASSERT(atlas->font_num);
- f = atlas->fonts;
- c = f->config;
- cfg->font = &f->info;
-
- cfg->n = c;
- cfg->p = c->p;
- c->p->n = cfg;
- c->p = cfg;
- }
- /* create own copy of .TTF font blob */
- if (!config->ttf_data_owned_by_atlas) {
- cfg->ttf_blob = atlas->permanent.alloc(atlas->permanent.userdata,0, cfg->ttf_size);
- NK_ASSERT(cfg->ttf_blob);
- if (!cfg->ttf_blob) {
- atlas->font_num++;
- return 0;
- }
- NK_MEMCPY(cfg->ttf_blob, config->ttf_blob, cfg->ttf_size);
- cfg->ttf_data_owned_by_atlas = 1;
- }
- atlas->font_num++;
- return font;
-}
-
-NK_API struct nk_font*
-nk_font_atlas_add_from_memory(struct nk_font_atlas *atlas, void *memory,
- nk_size size, float height, const struct nk_font_config *config)
-{
- struct nk_font_config cfg;
- NK_ASSERT(memory);
- NK_ASSERT(size);
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
- if (!atlas || !atlas->temporary.alloc || !atlas->temporary.free || !memory || !size ||
- !atlas->permanent.alloc || !atlas->permanent.free)
- return 0;
-
- cfg = (config) ? *config: nk_font_config(height);
- cfg.ttf_blob = memory;
- cfg.ttf_size = size;
- cfg.size = height;
- cfg.ttf_data_owned_by_atlas = 0;
- return nk_font_atlas_add(atlas, &cfg);
-}
-
-#ifdef NK_INCLUDE_STANDARD_IO
-NK_API struct nk_font*
-nk_font_atlas_add_from_file(struct nk_font_atlas *atlas, const char *file_path,
- float height, const struct nk_font_config *config)
-{
- nk_size size;
- char *memory;
- struct nk_font_config cfg;
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
-
- if (!atlas || !file_path) return 0;
- memory = nk_file_load(file_path, &size, &atlas->permanent);
- if (!memory) return 0;
-
- cfg = (config) ? *config: nk_font_config(height);
- cfg.ttf_blob = memory;
- cfg.ttf_size = size;
- cfg.size = height;
- cfg.ttf_data_owned_by_atlas = 1;
- return nk_font_atlas_add(atlas, &cfg);
-}
-#endif
-
-NK_API struct nk_font*
-nk_font_atlas_add_compressed(struct nk_font_atlas *atlas,
- void *compressed_data, nk_size compressed_size, float height,
- const struct nk_font_config *config)
-{
- unsigned int decompressed_size;
- void *decompressed_data;
- struct nk_font_config cfg;
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
-
- NK_ASSERT(compressed_data);
- NK_ASSERT(compressed_size);
- if (!atlas || !compressed_data || !atlas->temporary.alloc || !atlas->temporary.free ||
- !atlas->permanent.alloc || !atlas->permanent.free)
- return 0;
-
- decompressed_size = nk_decompress_length((unsigned char*)compressed_data);
- decompressed_data = atlas->permanent.alloc(atlas->permanent.userdata,0,decompressed_size);
- NK_ASSERT(decompressed_data);
- if (!decompressed_data) return 0;
- nk_decompress((unsigned char*)decompressed_data, (unsigned char*)compressed_data,
- (unsigned int)compressed_size);
-
- cfg = (config) ? *config: nk_font_config(height);
- cfg.ttf_blob = decompressed_data;
- cfg.ttf_size = decompressed_size;
- cfg.size = height;
- cfg.ttf_data_owned_by_atlas = 1;
- return nk_font_atlas_add(atlas, &cfg);
-}
-
-NK_API struct nk_font*
-nk_font_atlas_add_compressed_base85(struct nk_font_atlas *atlas,
- const char *data_base85, float height, const struct nk_font_config *config)
-{
- int compressed_size;
- void *compressed_data;
- struct nk_font *font;
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
-
- NK_ASSERT(data_base85);
- if (!atlas || !data_base85 || !atlas->temporary.alloc || !atlas->temporary.free ||
- !atlas->permanent.alloc || !atlas->permanent.free)
- return 0;
-
- compressed_size = (((int)nk_strlen(data_base85) + 4) / 5) * 4;
- compressed_data = atlas->temporary.alloc(atlas->temporary.userdata,0, (nk_size)compressed_size);
- NK_ASSERT(compressed_data);
- if (!compressed_data) return 0;
- nk_decode_85((unsigned char*)compressed_data, (const unsigned char*)data_base85);
- font = nk_font_atlas_add_compressed(atlas, compressed_data,
- (nk_size)compressed_size, height, config);
- atlas->temporary.free(atlas->temporary.userdata, compressed_data);
- return font;
-}
-
-#ifdef NK_INCLUDE_DEFAULT_FONT
-NK_API struct nk_font*
-nk_font_atlas_add_default(struct nk_font_atlas *atlas,
- float pixel_height, const struct nk_font_config *config)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
- return nk_font_atlas_add_compressed_base85(atlas,
- nk_proggy_clean_ttf_compressed_data_base85, pixel_height, config);
-}
-#endif
-
-NK_API const void*
-nk_font_atlas_bake(struct nk_font_atlas *atlas, int *width, int *height,
- enum nk_font_atlas_format fmt)
-{
- int i = 0;
- void *tmp = 0;
- nk_size tmp_size, img_size;
- struct nk_font *font_iter;
- struct nk_font_baker *baker;
-
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
-
- NK_ASSERT(width);
- NK_ASSERT(height);
- if (!atlas || !width || !height ||
- !atlas->temporary.alloc || !atlas->temporary.free ||
- !atlas->permanent.alloc || !atlas->permanent.free)
- return 0;
-
-#ifdef NK_INCLUDE_DEFAULT_FONT
- /* no font added so just use default font */
- if (!atlas->font_num)
- atlas->default_font = nk_font_atlas_add_default(atlas, 13.0f, 0);
-#endif
- NK_ASSERT(atlas->font_num);
- if (!atlas->font_num) return 0;
-
- /* allocate temporary baker memory required for the baking process */
- nk_font_baker_memory(&tmp_size, &atlas->glyph_count, atlas->config, atlas->font_num);
- tmp = atlas->temporary.alloc(atlas->temporary.userdata,0, tmp_size);
- NK_ASSERT(tmp);
- if (!tmp) goto failed;
-
- /* allocate glyph memory for all fonts */
- baker = nk_font_baker(tmp, atlas->glyph_count, atlas->font_num, &atlas->temporary);
- atlas->glyphs = (struct nk_font_glyph*)atlas->permanent.alloc(
- atlas->permanent.userdata,0, sizeof(struct nk_font_glyph)*(nk_size)atlas->glyph_count);
- NK_ASSERT(atlas->glyphs);
- if (!atlas->glyphs)
- goto failed;
-
- /* pack all glyphs into a tight fit space */
- atlas->custom.w = (NK_CURSOR_DATA_W*2)+1;
- atlas->custom.h = NK_CURSOR_DATA_H + 1;
- if (!nk_font_bake_pack(baker, &img_size, width, height, &atlas->custom,
- atlas->config, atlas->font_num, &atlas->temporary))
- goto failed;
-
- /* allocate memory for the baked image font atlas */
- atlas->pixel = atlas->temporary.alloc(atlas->temporary.userdata,0, img_size);
- NK_ASSERT(atlas->pixel);
- if (!atlas->pixel)
- goto failed;
-
- /* bake glyphs and custom white pixel into image */
- nk_font_bake(baker, atlas->pixel, *width, *height,
- atlas->glyphs, atlas->glyph_count, atlas->config, atlas->font_num);
- nk_font_bake_custom_data(atlas->pixel, *width, *height, atlas->custom,
- nk_custom_cursor_data, NK_CURSOR_DATA_W, NK_CURSOR_DATA_H, '.', 'X');
-
- if (fmt == NK_FONT_ATLAS_RGBA32) {
- /* convert alpha8 image into rgba32 image */
- void *img_rgba = atlas->temporary.alloc(atlas->temporary.userdata,0,
- (nk_size)(*width * *height * 4));
- NK_ASSERT(img_rgba);
- if (!img_rgba) goto failed;
- nk_font_bake_convert(img_rgba, *width, *height, atlas->pixel);
- atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
- atlas->pixel = img_rgba;
- }
- atlas->tex_width = *width;
- atlas->tex_height = *height;
-
- /* initialize each font */
- for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
- struct nk_font *font = font_iter;
- struct nk_font_config *config = font->config;
- nk_font_init(font, config->size, config->fallback_glyph, atlas->glyphs,
- config->font, nk_handle_ptr(0));
- }
-
- /* initialize each cursor */
- {NK_STORAGE const struct nk_vec2 nk_cursor_data[NK_CURSOR_COUNT][3] = {
- /* Pos Size Offset */
- {{ 0, 3}, {12,19}, { 0, 0}},
- {{13, 0}, { 7,16}, { 4, 8}},
- {{31, 0}, {23,23}, {11,11}},
- {{21, 0}, { 9, 23}, { 5,11}},
- {{55,18}, {23, 9}, {11, 5}},
- {{73, 0}, {17,17}, { 9, 9}},
- {{55, 0}, {17,17}, { 9, 9}}
- };
- for (i = 0; i < NK_CURSOR_COUNT; ++i) {
- struct nk_cursor *cursor = &atlas->cursors[i];
- cursor->img.w = (unsigned short)*width;
- cursor->img.h = (unsigned short)*height;
- cursor->img.region[0] = (unsigned short)(atlas->custom.x + nk_cursor_data[i][0].x);
- cursor->img.region[1] = (unsigned short)(atlas->custom.y + nk_cursor_data[i][0].y);
- cursor->img.region[2] = (unsigned short)nk_cursor_data[i][1].x;
- cursor->img.region[3] = (unsigned short)nk_cursor_data[i][1].y;
- cursor->size = nk_cursor_data[i][1];
- cursor->offset = nk_cursor_data[i][2];
- }}
- /* free temporary memory */
- atlas->temporary.free(atlas->temporary.userdata, tmp);
- return atlas->pixel;
-
-failed:
- /* error so cleanup all memory */
- if (tmp) atlas->temporary.free(atlas->temporary.userdata, tmp);
- if (atlas->glyphs) {
- atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
- atlas->glyphs = 0;
- }
- if (atlas->pixel) {
- atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
- atlas->pixel = 0;
- }
- return 0;
-}
-
-NK_API void
-nk_font_atlas_end(struct nk_font_atlas *atlas, nk_handle texture,
- struct nk_draw_null_texture *null)
-{
- int i = 0;
- struct nk_font *font_iter;
- NK_ASSERT(atlas);
- if (!atlas) {
- if (!null) return;
- null->texture = texture;
- null->uv = nk_vec2(0.5f,0.5f);
- }
- if (null) {
- null->texture = texture;
- null->uv.x = (atlas->custom.x + 0.5f)/(float)atlas->tex_width;
- null->uv.y = (atlas->custom.y + 0.5f)/(float)atlas->tex_height;
- }
- for (font_iter = atlas->fonts; font_iter; font_iter = font_iter->next) {
- font_iter->texture = texture;
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- font_iter->handle.texture = texture;
-#endif
- }
- for (i = 0; i < NK_CURSOR_COUNT; ++i)
- atlas->cursors[i].img.handle = texture;
-
- atlas->temporary.free(atlas->temporary.userdata, atlas->pixel);
- atlas->pixel = 0;
- atlas->tex_width = 0;
- atlas->tex_height = 0;
- atlas->custom.x = 0;
- atlas->custom.y = 0;
- atlas->custom.w = 0;
- atlas->custom.h = 0;
-}
-
-NK_API void
-nk_font_atlas_cleanup(struct nk_font_atlas *atlas)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
- if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
- if (atlas->config) {
- struct nk_font_config *iter;
- for (iter = atlas->config; iter; iter = iter->next) {
- struct nk_font_config *i;
- for (i = iter->n; i != iter; i = i->n) {
- atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
- i->ttf_blob = 0;
- }
- atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
- iter->ttf_blob = 0;
- }
- }
-}
-
-NK_API void
-nk_font_atlas_clear(struct nk_font_atlas *atlas)
-{
- NK_ASSERT(atlas);
- NK_ASSERT(atlas->temporary.alloc);
- NK_ASSERT(atlas->temporary.free);
- NK_ASSERT(atlas->permanent.alloc);
- NK_ASSERT(atlas->permanent.free);
- if (!atlas || !atlas->permanent.alloc || !atlas->permanent.free) return;
-
- if (atlas->config) {
- struct nk_font_config *iter, *next;
- for (iter = atlas->config; iter; iter = next) {
- struct nk_font_config *i, *n;
- for (i = iter->n; i != iter; i = n) {
- n = i->n;
- if (i->ttf_blob)
- atlas->permanent.free(atlas->permanent.userdata, i->ttf_blob);
- atlas->permanent.free(atlas->permanent.userdata, i);
- }
- next = iter->next;
- if (i->ttf_blob)
- atlas->permanent.free(atlas->permanent.userdata, iter->ttf_blob);
- atlas->permanent.free(atlas->permanent.userdata, iter);
- }
- atlas->config = 0;
- }
- if (atlas->fonts) {
- struct nk_font *iter, *next;
- for (iter = atlas->fonts; iter; iter = next) {
- next = iter->next;
- atlas->permanent.free(atlas->permanent.userdata, iter);
- }
- atlas->fonts = 0;
- }
- if (atlas->glyphs)
- atlas->permanent.free(atlas->permanent.userdata, atlas->glyphs);
- nk_zero_struct(*atlas);
-}
-#endif
-/* ==============================================================
- *
- * INPUT
- *
- * ===============================================================*/
-NK_API void
-nk_input_begin(struct nk_context *ctx)
-{
- int i;
- struct nk_input *in;
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
- for (i = 0; i < NK_BUTTON_MAX; ++i)
- in->mouse.buttons[i].clicked = 0;
-
- in->keyboard.text_len = 0;
- in->mouse.scroll_delta = nk_vec2(0,0);
- in->mouse.prev.x = in->mouse.pos.x;
- in->mouse.prev.y = in->mouse.pos.y;
- in->mouse.delta.x = 0;
- in->mouse.delta.y = 0;
- for (i = 0; i < NK_KEY_MAX; i++)
- in->keyboard.keys[i].clicked = 0;
-}
-
-NK_API void
-nk_input_end(struct nk_context *ctx)
-{
- struct nk_input *in;
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
- if (in->mouse.grab)
- in->mouse.grab = 0;
- if (in->mouse.ungrab) {
- in->mouse.grabbed = 0;
- in->mouse.ungrab = 0;
- in->mouse.grab = 0;
- }
-}
-
-NK_API void
-nk_input_motion(struct nk_context *ctx, int x, int y)
-{
- struct nk_input *in;
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
- in->mouse.pos.x = (float)x;
- in->mouse.pos.y = (float)y;
- in->mouse.delta.x = in->mouse.pos.x - in->mouse.prev.x;
- in->mouse.delta.y = in->mouse.pos.y - in->mouse.prev.y;
-}
-
-NK_API void
-nk_input_key(struct nk_context *ctx, enum nk_keys key, int down)
-{
- struct nk_input *in;
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
- if (in->keyboard.keys[key].down != down)
- in->keyboard.keys[key].clicked++;
- in->keyboard.keys[key].down = down;
-}
-
-NK_API void
-nk_input_button(struct nk_context *ctx, enum nk_buttons id, int x, int y, int down)
-{
- struct nk_mouse_button *btn;
- struct nk_input *in;
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
- if (in->mouse.buttons[id].down == down) return;
-
- btn = &in->mouse.buttons[id];
- btn->clicked_pos.x = (float)x;
- btn->clicked_pos.y = (float)y;
- btn->down = down;
- btn->clicked++;
-}
-
-NK_API void
-nk_input_scroll(struct nk_context *ctx, struct nk_vec2 val)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- ctx->input.mouse.scroll_delta.x += val.x;
- ctx->input.mouse.scroll_delta.y += val.y;
-}
-
-NK_API void
-nk_input_glyph(struct nk_context *ctx, const nk_glyph glyph)
-{
- int len = 0;
- nk_rune unicode;
- struct nk_input *in;
-
- NK_ASSERT(ctx);
- if (!ctx) return;
- in = &ctx->input;
-
- len = nk_utf_decode(glyph, &unicode, NK_UTF_SIZE);
- if (len && ((in->keyboard.text_len + len) < NK_INPUT_MAX)) {
- nk_utf_encode(unicode, &in->keyboard.text[in->keyboard.text_len],
- NK_INPUT_MAX - in->keyboard.text_len);
- in->keyboard.text_len += len;
- }
-}
-
-NK_API void
-nk_input_char(struct nk_context *ctx, char c)
-{
- nk_glyph glyph;
- NK_ASSERT(ctx);
- if (!ctx) return;
- glyph[0] = c;
- nk_input_glyph(ctx, glyph);
-}
-
-NK_API void
-nk_input_unicode(struct nk_context *ctx, nk_rune unicode)
-{
- nk_glyph rune;
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_utf_encode(unicode, rune, NK_UTF_SIZE);
- nk_input_glyph(ctx, rune);
-}
-
-NK_API int
-nk_input_has_mouse_click(const struct nk_input *i, enum nk_buttons id)
-{
- const struct nk_mouse_button *btn;
- if (!i) return nk_false;
- btn = &i->mouse.buttons[id];
- return (btn->clicked && btn->down == nk_false) ? nk_true : nk_false;
-}
-
-NK_API int
-nk_input_has_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
- struct nk_rect b)
-{
- const struct nk_mouse_button *btn;
- if (!i) return nk_false;
- btn = &i->mouse.buttons[id];
- if (!NK_INBOX(btn->clicked_pos.x,btn->clicked_pos.y,b.x,b.y,b.w,b.h))
- return nk_false;
- return nk_true;
-}
-
-NK_API int
-nk_input_has_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
- struct nk_rect b, int down)
-{
- const struct nk_mouse_button *btn;
- if (!i) return nk_false;
- btn = &i->mouse.buttons[id];
- return nk_input_has_mouse_click_in_rect(i, id, b) && (btn->down == down);
-}
-
-NK_API int
-nk_input_is_mouse_click_in_rect(const struct nk_input *i, enum nk_buttons id,
- struct nk_rect b)
-{
- const struct nk_mouse_button *btn;
- if (!i) return nk_false;
- btn = &i->mouse.buttons[id];
- return (nk_input_has_mouse_click_down_in_rect(i, id, b, nk_false) &&
- btn->clicked) ? nk_true : nk_false;
-}
-
-NK_API int
-nk_input_is_mouse_click_down_in_rect(const struct nk_input *i, enum nk_buttons id,
- struct nk_rect b, int down)
-{
- const struct nk_mouse_button *btn;
- if (!i) return nk_false;
- btn = &i->mouse.buttons[id];
- return (nk_input_has_mouse_click_down_in_rect(i, id, b, down) &&
- btn->clicked) ? nk_true : nk_false;
-}
-
-NK_API int
-nk_input_any_mouse_click_in_rect(const struct nk_input *in, struct nk_rect b)
-{
- int i, down = 0;
- for (i = 0; i < NK_BUTTON_MAX; ++i)
- down = down || nk_input_is_mouse_click_in_rect(in, (enum nk_buttons)i, b);
- return down;
-}
-
-NK_API int
-nk_input_is_mouse_hovering_rect(const struct nk_input *i, struct nk_rect rect)
-{
- if (!i) return nk_false;
- return NK_INBOX(i->mouse.pos.x, i->mouse.pos.y, rect.x, rect.y, rect.w, rect.h);
-}
-
-NK_API int
-nk_input_is_mouse_prev_hovering_rect(const struct nk_input *i, struct nk_rect rect)
-{
- if (!i) return nk_false;
- return NK_INBOX(i->mouse.prev.x, i->mouse.prev.y, rect.x, rect.y, rect.w, rect.h);
-}
-
-NK_API int
-nk_input_mouse_clicked(const struct nk_input *i, enum nk_buttons id, struct nk_rect rect)
-{
- if (!i) return nk_false;
- if (!nk_input_is_mouse_hovering_rect(i, rect)) return nk_false;
- return nk_input_is_mouse_click_in_rect(i, id, rect);
-}
-
-NK_API int
-nk_input_is_mouse_down(const struct nk_input *i, enum nk_buttons id)
-{
- if (!i) return nk_false;
- return i->mouse.buttons[id].down;
-}
-
-NK_API int
-nk_input_is_mouse_pressed(const struct nk_input *i, enum nk_buttons id)
-{
- const struct nk_mouse_button *b;
- if (!i) return nk_false;
- b = &i->mouse.buttons[id];
- if (b->down && b->clicked)
- return nk_true;
- return nk_false;
-}
-
-NK_API int
-nk_input_is_mouse_released(const struct nk_input *i, enum nk_buttons id)
-{
- if (!i) return nk_false;
- return (!i->mouse.buttons[id].down && i->mouse.buttons[id].clicked);
-}
-
-NK_API int
-nk_input_is_key_pressed(const struct nk_input *i, enum nk_keys key)
-{
- const struct nk_key *k;
- if (!i) return nk_false;
- k = &i->keyboard.keys[key];
- if ((k->down && k->clicked) || (!k->down && k->clicked >= 2))
- return nk_true;
- return nk_false;
-}
-
-NK_API int
-nk_input_is_key_released(const struct nk_input *i, enum nk_keys key)
-{
- const struct nk_key *k;
- if (!i) return nk_false;
- k = &i->keyboard.keys[key];
- if ((!k->down && k->clicked) || (k->down && k->clicked >= 2))
- return nk_true;
- return nk_false;
-}
-
-NK_API int
-nk_input_is_key_down(const struct nk_input *i, enum nk_keys key)
-{
- const struct nk_key *k;
- if (!i) return nk_false;
- k = &i->keyboard.keys[key];
- if (k->down) return nk_true;
- return nk_false;
-}
-
-/*
- * ==============================================================
- *
- * TEXT EDITOR
- *
- * ===============================================================
- */
-/* stb_textedit.h - v1.8 - public domain - Sean Barrett */
-struct nk_text_find {
- float x,y; /* position of n'th character */
- float height; /* height of line */
- int first_char, length; /* first char of row, and length */
- int prev_first; /*_ first char of previous row */
-};
-
-struct nk_text_edit_row {
- float x0,x1;
- /* starting x location, end x location (allows for align=right, etc) */
- float baseline_y_delta;
- /* position of baseline relative to previous row's baseline*/
- float ymin,ymax;
- /* height of row above and below baseline */
- int num_chars;
-};
-
-/* forward declarations */
-NK_INTERN void nk_textedit_makeundo_delete(struct nk_text_edit*, int, int);
-NK_INTERN void nk_textedit_makeundo_insert(struct nk_text_edit*, int, int);
-NK_INTERN void nk_textedit_makeundo_replace(struct nk_text_edit*, int, int, int);
-#define NK_TEXT_HAS_SELECTION(s) ((s)->select_start != (s)->select_end)
-
-NK_INTERN float
-nk_textedit_get_width(const struct nk_text_edit *edit, int line_start, int char_id,
- const struct nk_user_font *font)
-{
- int len = 0;
- nk_rune unicode = 0;
- const char *str = nk_str_at_const(&edit->string, line_start + char_id, &unicode, &len);
- return font->width(font->userdata, font->height, str, len);
-}
-
-NK_INTERN void
-nk_textedit_layout_row(struct nk_text_edit_row *r, struct nk_text_edit *edit,
- int line_start_id, float row_height, const struct nk_user_font *font)
-{
- int l;
- int glyphs = 0;
- nk_rune unicode;
- const char *remaining;
- int len = nk_str_len_char(&edit->string);
- const char *end = nk_str_get_const(&edit->string) + len;
- const char *text = nk_str_at_const(&edit->string, line_start_id, &unicode, &l);
- const struct nk_vec2 size = nk_text_calculate_text_bounds(font,
- text, (int)(end - text), row_height, &remaining, 0, &glyphs, NK_STOP_ON_NEW_LINE);
-
- r->x0 = 0.0f;
- r->x1 = size.x;
- r->baseline_y_delta = size.y;
- r->ymin = 0.0f;
- r->ymax = size.y;
- r->num_chars = glyphs;
-}
-
-NK_INTERN int
-nk_textedit_locate_coord(struct nk_text_edit *edit, float x, float y,
- const struct nk_user_font *font, float row_height)
-{
- struct nk_text_edit_row r;
- int n = edit->string.len;
- float base_y = 0, prev_x;
- int i=0, k;
-
- r.x0 = r.x1 = 0;
- r.ymin = r.ymax = 0;
- r.num_chars = 0;
-
- /* search rows to find one that straddles 'y' */
- while (i < n) {
- nk_textedit_layout_row(&r, edit, i, row_height, font);
- if (r.num_chars <= 0)
- return n;
-
- if (i==0 && y < base_y + r.ymin)
- return 0;
-
- if (y < base_y + r.ymax)
- break;
-
- i += r.num_chars;
- base_y += r.baseline_y_delta;
- }
-
- /* below all text, return 'after' last character */
- if (i >= n)
- return n;
-
- /* check if it's before the beginning of the line */
- if (x < r.x0)
- return i;
-
- /* check if it's before the end of the line */
- if (x < r.x1) {
- /* search characters in row for one that straddles 'x' */
- k = i;
- prev_x = r.x0;
- for (i=0; i < r.num_chars; ++i) {
- float w = nk_textedit_get_width(edit, k, i, font);
- if (x < prev_x+w) {
- if (x < prev_x+w/2)
- return k+i;
- else return k+i+1;
- }
- prev_x += w;
- }
- /* shouldn't happen, but if it does, fall through to end-of-line case */
- }
-
- /* if the last character is a newline, return that.
- * otherwise return 'after' the last character */
- if (nk_str_rune_at(&edit->string, i+r.num_chars-1) == '\n')
- return i+r.num_chars-1;
- else return i+r.num_chars;
-}
-
-NK_INTERN void
-nk_textedit_click(struct nk_text_edit *state, float x, float y,
- const struct nk_user_font *font, float row_height)
-{
- /* API click: on mouse down, move the cursor to the clicked location,
- * and reset the selection */
- state->cursor = nk_textedit_locate_coord(state, x, y, font, row_height);
- state->select_start = state->cursor;
- state->select_end = state->cursor;
- state->has_preferred_x = 0;
-}
-
-NK_INTERN void
-nk_textedit_drag(struct nk_text_edit *state, float x, float y,
- const struct nk_user_font *font, float row_height)
-{
- /* API drag: on mouse drag, move the cursor and selection endpoint
- * to the clicked location */
- int p = nk_textedit_locate_coord(state, x, y, font, row_height);
- if (state->select_start == state->select_end)
- state->select_start = state->cursor;
- state->cursor = state->select_end = p;
-}
-
-NK_INTERN void
-nk_textedit_find_charpos(struct nk_text_find *find, struct nk_text_edit *state,
- int n, int single_line, const struct nk_user_font *font, float row_height)
-{
- /* find the x/y location of a character, and remember info about the previous
- * row in case we get a move-up event (for page up, we'll have to rescan) */
- struct nk_text_edit_row r;
- int prev_start = 0;
- int z = state->string.len;
- int i=0, first;
-
- nk_zero_struct(r);
- if (n == z) {
- /* if it's at the end, then find the last line -- simpler than trying to
- explicitly handle this case in the regular code */
- nk_textedit_layout_row(&r, state, 0, row_height, font);
- if (single_line) {
- find->first_char = 0;
- find->length = z;
- } else {
- while (i < z) {
- prev_start = i;
- i += r.num_chars;
- nk_textedit_layout_row(&r, state, i, row_height, font);
- }
-
- find->first_char = i;
- find->length = r.num_chars;
- }
- find->x = r.x1;
- find->y = r.ymin;
- find->height = r.ymax - r.ymin;
- find->prev_first = prev_start;
- return;
- }
-
- /* search rows to find the one that straddles character n */
- find->y = 0;
-
- for(;;) {
- nk_textedit_layout_row(&r, state, i, row_height, font);
- if (n < i + r.num_chars) break;
- prev_start = i;
- i += r.num_chars;
- find->y += r.baseline_y_delta;
- }
-
- find->first_char = first = i;
- find->length = r.num_chars;
- find->height = r.ymax - r.ymin;
- find->prev_first = prev_start;
-
- /* now scan to find xpos */
- find->x = r.x0;
- for (i=0; first+i < n; ++i)
- find->x += nk_textedit_get_width(state, first, i, font);
-}
-
-NK_INTERN void
-nk_textedit_clamp(struct nk_text_edit *state)
-{
- /* make the selection/cursor state valid if client altered the string */
- int n = state->string.len;
- if (NK_TEXT_HAS_SELECTION(state)) {
- if (state->select_start > n) state->select_start = n;
- if (state->select_end > n) state->select_end = n;
- /* if clamping forced them to be equal, move the cursor to match */
- if (state->select_start == state->select_end)
- state->cursor = state->select_start;
- }
- if (state->cursor > n) state->cursor = n;
-}
-
-NK_API void
-nk_textedit_delete(struct nk_text_edit *state, int where, int len)
-{
- /* delete characters while updating undo */
- nk_textedit_makeundo_delete(state, where, len);
- nk_str_delete_runes(&state->string, where, len);
- state->has_preferred_x = 0;
-}
-
-NK_API void
-nk_textedit_delete_selection(struct nk_text_edit *state)
-{
- /* delete the section */
- nk_textedit_clamp(state);
- if (NK_TEXT_HAS_SELECTION(state)) {
- if (state->select_start < state->select_end) {
- nk_textedit_delete(state, state->select_start,
- state->select_end - state->select_start);
- state->select_end = state->cursor = state->select_start;
- } else {
- nk_textedit_delete(state, state->select_end,
- state->select_start - state->select_end);
- state->select_start = state->cursor = state->select_end;
- }
- state->has_preferred_x = 0;
- }
-}
-
-NK_INTERN void
-nk_textedit_sortselection(struct nk_text_edit *state)
-{
- /* canonicalize the selection so start <= end */
- if (state->select_end < state->select_start) {
- int temp = state->select_end;
- state->select_end = state->select_start;
- state->select_start = temp;
- }
-}
-
-NK_INTERN void
-nk_textedit_move_to_first(struct nk_text_edit *state)
-{
- /* move cursor to first character of selection */
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_sortselection(state);
- state->cursor = state->select_start;
- state->select_end = state->select_start;
- state->has_preferred_x = 0;
- }
-}
-
-NK_INTERN void
-nk_textedit_move_to_last(struct nk_text_edit *state)
-{
- /* move cursor to last character of selection */
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_sortselection(state);
- nk_textedit_clamp(state);
- state->cursor = state->select_end;
- state->select_start = state->select_end;
- state->has_preferred_x = 0;
- }
-}
-
-NK_INTERN int
-nk_is_word_boundary( struct nk_text_edit *state, int idx)
-{
- int len;
- nk_rune c;
- if (idx <= 0) return 1;
- if (!nk_str_at_rune(&state->string, idx, &c, &len)) return 1;
- return (c == ' ' || c == '\t' ||c == 0x3000 || c == ',' || c == ';' ||
- c == '(' || c == ')' || c == '{' || c == '}' || c == '[' || c == ']' ||
- c == '|');
-}
-
-NK_INTERN int
-nk_textedit_move_to_word_previous(struct nk_text_edit *state)
-{
- int c = state->cursor - 1;
- while( c >= 0 && !nk_is_word_boundary(state, c))
- --c;
-
- if( c < 0 )
- c = 0;
-
- return c;
-}
-
-NK_INTERN int
-nk_textedit_move_to_word_next(struct nk_text_edit *state)
-{
- const int len = state->string.len;
- int c = state->cursor+1;
- while( c < len && !nk_is_word_boundary(state, c))
- ++c;
-
- if( c > len )
- c = len;
-
- return c;
-}
-
-NK_INTERN void
-nk_textedit_prep_selection_at_cursor(struct nk_text_edit *state)
-{
- /* update selection and cursor to match each other */
- if (!NK_TEXT_HAS_SELECTION(state))
- state->select_start = state->select_end = state->cursor;
- else state->cursor = state->select_end;
-}
-
-NK_API int
-nk_textedit_cut(struct nk_text_edit *state)
-{
- /* API cut: delete selection */
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- return 0;
- if (NK_TEXT_HAS_SELECTION(state)) {
- nk_textedit_delete_selection(state); /* implicitly clamps */
- state->has_preferred_x = 0;
- return 1;
- }
- return 0;
-}
-
-NK_API int
-nk_textedit_paste(struct nk_text_edit *state, char const *ctext, int len)
-{
- /* API paste: replace existing selection with passed-in text */
- int glyphs;
- const char *text = (const char *) ctext;
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW) return 0;
-
- /* if there's a selection, the paste should delete it */
- nk_textedit_clamp(state);
- nk_textedit_delete_selection(state);
-
- /* try to insert the characters */
- glyphs = nk_utf_len(ctext, len);
- if (nk_str_insert_text_char(&state->string, state->cursor, text, len)) {
- nk_textedit_makeundo_insert(state, state->cursor, glyphs);
- state->cursor += len;
- state->has_preferred_x = 0;
- return 1;
- }
- /* remove the undo since we didn't actually insert the characters */
- if (state->undo.undo_point)
- --state->undo.undo_point;
- return 0;
-}
-
-NK_API void
-nk_textedit_text(struct nk_text_edit *state, const char *text, int total_len)
-{
- nk_rune unicode;
- int glyph_len;
- int text_len = 0;
-
- NK_ASSERT(state);
- NK_ASSERT(text);
- if (!text || !total_len || state->mode == NK_TEXT_EDIT_MODE_VIEW) return;
-
- glyph_len = nk_utf_decode(text, &unicode, total_len);
- while ((text_len < total_len) && glyph_len)
- {
- /* don't insert a backward delete, just process the event */
- if (unicode == 127) goto next;
- /* can't add newline in single-line mode */
- if (unicode == '\n' && state->single_line) goto next;
- /* filter incoming text */
- if (state->filter && !state->filter(state, unicode)) goto next;
-
- if (!NK_TEXT_HAS_SELECTION(state) &&
- state->cursor < state->string.len)
- {
- if (state->mode == NK_TEXT_EDIT_MODE_REPLACE) {
- nk_textedit_makeundo_replace(state, state->cursor, 1, 1);
- nk_str_delete_runes(&state->string, state->cursor, 1);
- }
- if (nk_str_insert_text_utf8(&state->string, state->cursor,
- text+text_len, 1))
- {
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- } else {
- nk_textedit_delete_selection(state); /* implicitly clamps */
- if (nk_str_insert_text_utf8(&state->string, state->cursor,
- text+text_len, 1))
- {
- nk_textedit_makeundo_insert(state, state->cursor, 1);
- ++state->cursor;
- state->has_preferred_x = 0;
- }
- }
- next:
- text_len += glyph_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, total_len-text_len);
- }
-}
-
-NK_INTERN void
-nk_textedit_key(struct nk_text_edit *state, enum nk_keys key, int shift_mod,
- const struct nk_user_font *font, float row_height)
-{
-retry:
- switch (key)
- {
- case NK_KEY_NONE:
- case NK_KEY_CTRL:
- case NK_KEY_ENTER:
- case NK_KEY_SHIFT:
- case NK_KEY_TAB:
- case NK_KEY_COPY:
- case NK_KEY_CUT:
- case NK_KEY_PASTE:
- case NK_KEY_MAX:
- default: break;
- case NK_KEY_TEXT_UNDO:
- nk_textedit_undo(state);
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_TEXT_REDO:
- nk_textedit_redo(state);
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_TEXT_SELECT_ALL:
- nk_textedit_select_all(state);
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_TEXT_INSERT_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- state->mode = NK_TEXT_EDIT_MODE_INSERT;
- break;
- case NK_KEY_TEXT_REPLACE_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- state->mode = NK_TEXT_EDIT_MODE_REPLACE;
- break;
- case NK_KEY_TEXT_RESET_MODE:
- if (state->mode == NK_TEXT_EDIT_MODE_INSERT ||
- state->mode == NK_TEXT_EDIT_MODE_REPLACE)
- state->mode = NK_TEXT_EDIT_MODE_VIEW;
- break;
-
- case NK_KEY_LEFT:
- if (shift_mod) {
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- /* move selection left */
- if (state->select_end > 0)
- --state->select_end;
- state->cursor = state->select_end;
- state->has_preferred_x = 0;
- } else {
- /* if currently there's a selection,
- * move cursor to start of selection */
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
- else if (state->cursor > 0)
- --state->cursor;
- state->has_preferred_x = 0;
- } break;
-
- case NK_KEY_RIGHT:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- /* move selection right */
- ++state->select_end;
- nk_textedit_clamp(state);
- state->cursor = state->select_end;
- state->has_preferred_x = 0;
- } else {
- /* if currently there's a selection,
- * move cursor to end of selection */
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
- else ++state->cursor;
- nk_textedit_clamp(state);
- state->has_preferred_x = 0;
- } break;
-
- case NK_KEY_TEXT_WORD_LEFT:
- if (shift_mod) {
- if( !NK_TEXT_HAS_SELECTION( state ) )
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = nk_textedit_move_to_word_previous(state);
- state->select_end = state->cursor;
- nk_textedit_clamp(state );
- } else {
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
- else {
- state->cursor = nk_textedit_move_to_word_previous(state);
- nk_textedit_clamp(state );
- }
- } break;
-
- case NK_KEY_TEXT_WORD_RIGHT:
- if (shift_mod) {
- if( !NK_TEXT_HAS_SELECTION( state ) )
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = nk_textedit_move_to_word_next(state);
- state->select_end = state->cursor;
- nk_textedit_clamp(state);
- } else {
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
- else {
- state->cursor = nk_textedit_move_to_word_next(state);
- nk_textedit_clamp(state );
- }
- } break;
-
- case NK_KEY_DOWN: {
- struct nk_text_find find;
- struct nk_text_edit_row row;
- int i, sel = shift_mod;
-
- if (state->single_line) {
- /* on windows, up&down in single-line behave like left&right */
- key = NK_KEY_RIGHT;
- goto retry;
- }
-
- if (sel)
- nk_textedit_prep_selection_at_cursor(state);
- else if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_last(state);
-
- /* compute current position of cursor point */
- nk_textedit_clamp(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
-
- /* now find character position down a row */
- if (find.length)
- {
- float x;
- float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
- int start = find.first_char + find.length;
-
- state->cursor = start;
- nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
- x = row.x0;
-
- for (i=0; i < row.num_chars && x < row.x1; ++i) {
- float dx = nk_textedit_get_width(state, start, i, font);
- x += dx;
- if (x > goal_x)
- break;
- ++state->cursor;
- }
- nk_textedit_clamp(state);
-
- state->has_preferred_x = 1;
- state->preferred_x = goal_x;
- if (sel)
- state->select_end = state->cursor;
- }
- } break;
-
- case NK_KEY_UP: {
- struct nk_text_find find;
- struct nk_text_edit_row row;
- int i, sel = shift_mod;
-
- if (state->single_line) {
- /* on windows, up&down become left&right */
- key = NK_KEY_LEFT;
- goto retry;
- }
-
- if (sel)
- nk_textedit_prep_selection_at_cursor(state);
- else if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_move_to_first(state);
-
- /* compute current position of cursor point */
- nk_textedit_clamp(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
-
- /* can only go up if there's a previous row */
- if (find.prev_first != find.first_char) {
- /* now find character position up a row */
- float x;
- float goal_x = state->has_preferred_x ? state->preferred_x : find.x;
-
- state->cursor = find.prev_first;
- nk_textedit_layout_row(&row, state, state->cursor, row_height, font);
- x = row.x0;
-
- for (i=0; i < row.num_chars && x < row.x1; ++i) {
- float dx = nk_textedit_get_width(state, find.prev_first, i, font);
- x += dx;
- if (x > goal_x)
- break;
- ++state->cursor;
- }
- nk_textedit_clamp(state);
-
- state->has_preferred_x = 1;
- state->preferred_x = goal_x;
- if (sel) state->select_end = state->cursor;
- }
- } break;
-
- case NK_KEY_DEL:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- break;
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_delete_selection(state);
- else {
- int n = state->string.len;
- if (state->cursor < n)
- nk_textedit_delete(state, state->cursor, 1);
- }
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_BACKSPACE:
- if (state->mode == NK_TEXT_EDIT_MODE_VIEW)
- break;
- if (NK_TEXT_HAS_SELECTION(state))
- nk_textedit_delete_selection(state);
- else {
- nk_textedit_clamp(state);
- if (state->cursor > 0) {
- nk_textedit_delete(state, state->cursor-1, 1);
- --state->cursor;
- }
- }
- state->has_preferred_x = 0;
- break;
-
- case NK_KEY_TEXT_START:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = state->select_end = 0;
- state->has_preferred_x = 0;
- } else {
- state->cursor = state->select_start = state->select_end = 0;
- state->has_preferred_x = 0;
- }
- break;
-
- case NK_KEY_TEXT_END:
- if (shift_mod) {
- nk_textedit_prep_selection_at_cursor(state);
- state->cursor = state->select_end = state->string.len;
- state->has_preferred_x = 0;
- } else {
- state->cursor = state->string.len;
- state->select_start = state->select_end = 0;
- state->has_preferred_x = 0;
- }
- break;
-
- case NK_KEY_TEXT_LINE_START: {
- if (shift_mod) {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- if (state->string.len && state->cursor == state->string.len)
- --state->cursor;
- nk_textedit_find_charpos(&find, state,state->cursor, state->single_line,
- font, row_height);
- state->cursor = state->select_end = find.first_char;
- state->has_preferred_x = 0;
- } else {
- struct nk_text_find find;
- if (state->string.len && state->cursor == state->string.len)
- --state->cursor;
- nk_textedit_clamp(state);
- nk_textedit_move_to_first(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
- state->cursor = find.first_char;
- state->has_preferred_x = 0;
- }
- } break;
-
- case NK_KEY_TEXT_LINE_END: {
- if (shift_mod) {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_prep_selection_at_cursor(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
- state->has_preferred_x = 0;
- state->cursor = find.first_char + find.length;
- if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
- --state->cursor;
- state->select_end = state->cursor;
- } else {
- struct nk_text_find find;
- nk_textedit_clamp(state);
- nk_textedit_move_to_first(state);
- nk_textedit_find_charpos(&find, state, state->cursor, state->single_line,
- font, row_height);
-
- state->has_preferred_x = 0;
- state->cursor = find.first_char + find.length;
- if (find.length > 0 && nk_str_rune_at(&state->string, state->cursor-1) == '\n')
- --state->cursor;
- }} break;
- }
-}
-
-NK_INTERN void
-nk_textedit_flush_redo(struct nk_text_undo_state *state)
-{
- state->redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
- state->redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
-}
-
-NK_INTERN void
-nk_textedit_discard_undo(struct nk_text_undo_state *state)
-{
- /* discard the oldest entry in the undo list */
- if (state->undo_point > 0) {
- /* if the 0th undo state has characters, clean those up */
- if (state->undo_rec[0].char_storage >= 0) {
- int n = state->undo_rec[0].insert_length, i;
- /* delete n characters from all other records */
- state->undo_char_point = (short)(state->undo_char_point - n);
- NK_MEMCPY(state->undo_char, state->undo_char + n,
- (nk_size)state->undo_char_point*sizeof(nk_rune));
- for (i=0; i < state->undo_point; ++i) {
- if (state->undo_rec[i].char_storage >= 0)
- state->undo_rec[i].char_storage = (short)
- (state->undo_rec[i].char_storage - n);
- }
- }
- --state->undo_point;
- NK_MEMCPY(state->undo_rec, state->undo_rec+1,
- (nk_size)((nk_size)state->undo_point * sizeof(state->undo_rec[0])));
- }
-}
-
-NK_INTERN void
-nk_textedit_discard_redo(struct nk_text_undo_state *state)
-{
-/* discard the oldest entry in the redo list--it's bad if this
- ever happens, but because undo & redo have to store the actual
- characters in different cases, the redo character buffer can
- fill up even though the undo buffer didn't */
- nk_size num;
- int k = NK_TEXTEDIT_UNDOSTATECOUNT-1;
- if (state->redo_point <= k) {
- /* if the k'th undo state has characters, clean those up */
- if (state->undo_rec[k].char_storage >= 0) {
- int n = state->undo_rec[k].insert_length, i;
- /* delete n characters from all other records */
- state->redo_char_point = (short)(state->redo_char_point + n);
- num = (nk_size)(NK_TEXTEDIT_UNDOCHARCOUNT - state->redo_char_point);
- NK_MEMCPY(state->undo_char + state->redo_char_point,
- state->undo_char + state->redo_char_point-n, num * sizeof(char));
- for (i = state->redo_point; i < k; ++i) {
- if (state->undo_rec[i].char_storage >= 0) {
- state->undo_rec[i].char_storage = (short)
- (state->undo_rec[i].char_storage + n);
- }
- }
- }
- ++state->redo_point;
- num = (nk_size)(NK_TEXTEDIT_UNDOSTATECOUNT - state->redo_point);
- if (num) NK_MEMCPY(state->undo_rec + state->redo_point-1,
- state->undo_rec + state->redo_point, num * sizeof(state->undo_rec[0]));
- }
-}
-
-NK_INTERN struct nk_text_undo_record*
-nk_textedit_create_undo_record(struct nk_text_undo_state *state, int numchars)
-{
- /* any time we create a new undo record, we discard redo*/
- nk_textedit_flush_redo(state);
-
- /* if we have no free records, we have to make room,
- * by sliding the existing records down */
- if (state->undo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
- nk_textedit_discard_undo(state);
-
- /* if the characters to store won't possibly fit in the buffer,
- * we can't undo */
- if (numchars > NK_TEXTEDIT_UNDOCHARCOUNT) {
- state->undo_point = 0;
- state->undo_char_point = 0;
- return 0;
- }
-
- /* if we don't have enough free characters in the buffer,
- * we have to make room */
- while (state->undo_char_point + numchars > NK_TEXTEDIT_UNDOCHARCOUNT)
- nk_textedit_discard_undo(state);
- return &state->undo_rec[state->undo_point++];
-}
-
-NK_INTERN nk_rune*
-nk_textedit_createundo(struct nk_text_undo_state *state, int pos,
- int insert_len, int delete_len)
-{
- struct nk_text_undo_record *r = nk_textedit_create_undo_record(state, insert_len);
- if (r == 0)
- return 0;
-
- r->where = pos;
- r->insert_length = (short) insert_len;
- r->delete_length = (short) delete_len;
-
- if (insert_len == 0) {
- r->char_storage = -1;
- return 0;
- } else {
- r->char_storage = state->undo_char_point;
- state->undo_char_point = (short)(state->undo_char_point + insert_len);
- return &state->undo_char[r->char_storage];
- }
-}
-
-NK_API void
-nk_textedit_undo(struct nk_text_edit *state)
-{
- struct nk_text_undo_state *s = &state->undo;
- struct nk_text_undo_record u, *r;
- if (s->undo_point == 0)
- return;
-
- /* we need to do two things: apply the undo record, and create a redo record */
- u = s->undo_rec[s->undo_point-1];
- r = &s->undo_rec[s->redo_point-1];
- r->char_storage = -1;
-
- r->insert_length = u.delete_length;
- r->delete_length = u.insert_length;
- r->where = u.where;
-
- if (u.delete_length)
- {
- /* if the undo record says to delete characters, then the redo record will
- need to re-insert the characters that get deleted, so we need to store
- them.
- there are three cases:
- - there's enough room to store the characters
- - characters stored for *redoing* don't leave room for redo
- - characters stored for *undoing* don't leave room for redo
- if the last is true, we have to bail */
- if (s->undo_char_point + u.delete_length >= NK_TEXTEDIT_UNDOCHARCOUNT) {
- /* the undo records take up too much character space; there's no space
- * to store the redo characters */
- r->insert_length = 0;
- } else {
- int i;
- /* there's definitely room to store the characters eventually */
- while (s->undo_char_point + u.delete_length > s->redo_char_point) {
- /* there's currently not enough room, so discard a redo record */
- nk_textedit_discard_redo(s);
- /* should never happen: */
- if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
- return;
- }
-
- r = &s->undo_rec[s->redo_point-1];
- r->char_storage = (short)(s->redo_char_point - u.delete_length);
- s->redo_char_point = (short)(s->redo_char_point - u.delete_length);
-
- /* now save the characters */
- for (i=0; i < u.delete_length; ++i)
- s->undo_char[r->char_storage + i] =
- nk_str_rune_at(&state->string, u.where + i);
- }
- /* now we can carry out the deletion */
- nk_str_delete_runes(&state->string, u.where, u.delete_length);
- }
-
- /* check type of recorded action: */
- if (u.insert_length) {
- /* easy case: was a deletion, so we need to insert n characters */
- nk_str_insert_text_runes(&state->string, u.where,
- &s->undo_char[u.char_storage], u.insert_length);
- s->undo_char_point = (short)(s->undo_char_point - u.insert_length);
- }
- state->cursor = (short)(u.where + u.insert_length);
-
- s->undo_point--;
- s->redo_point--;
-}
-
-NK_API void
-nk_textedit_redo(struct nk_text_edit *state)
-{
- struct nk_text_undo_state *s = &state->undo;
- struct nk_text_undo_record *u, r;
- if (s->redo_point == NK_TEXTEDIT_UNDOSTATECOUNT)
- return;
-
- /* we need to do two things: apply the redo record, and create an undo record */
- u = &s->undo_rec[s->undo_point];
- r = s->undo_rec[s->redo_point];
-
- /* we KNOW there must be room for the undo record, because the redo record
- was derived from an undo record */
- u->delete_length = r.insert_length;
- u->insert_length = r.delete_length;
- u->where = r.where;
- u->char_storage = -1;
-
- if (r.delete_length) {
- /* the redo record requires us to delete characters, so the undo record
- needs to store the characters */
- if (s->undo_char_point + u->insert_length > s->redo_char_point) {
- u->insert_length = 0;
- u->delete_length = 0;
- } else {
- int i;
- u->char_storage = s->undo_char_point;
- s->undo_char_point = (short)(s->undo_char_point + u->insert_length);
-
- /* now save the characters */
- for (i=0; i < u->insert_length; ++i) {
- s->undo_char[u->char_storage + i] =
- nk_str_rune_at(&state->string, u->where + i);
- }
- }
- nk_str_delete_runes(&state->string, r.where, r.delete_length);
- }
-
- if (r.insert_length) {
- /* easy case: need to insert n characters */
- nk_str_insert_text_runes(&state->string, r.where,
- &s->undo_char[r.char_storage], r.insert_length);
- }
- state->cursor = r.where + r.insert_length;
-
- s->undo_point++;
- s->redo_point++;
-}
-
-NK_INTERN void
-nk_textedit_makeundo_insert(struct nk_text_edit *state, int where, int length)
-{
- nk_textedit_createundo(&state->undo, where, 0, length);
-}
-
-NK_INTERN void
-nk_textedit_makeundo_delete(struct nk_text_edit *state, int where, int length)
-{
- int i;
- nk_rune *p = nk_textedit_createundo(&state->undo, where, length, 0);
- if (p) {
- for (i=0; i < length; ++i)
- p[i] = nk_str_rune_at(&state->string, where+i);
- }
-}
-
-NK_INTERN void
-nk_textedit_makeundo_replace(struct nk_text_edit *state, int where,
- int old_length, int new_length)
-{
- int i;
- nk_rune *p = nk_textedit_createundo(&state->undo, where, old_length, new_length);
- if (p) {
- for (i=0; i < old_length; ++i)
- p[i] = nk_str_rune_at(&state->string, where+i);
- }
-}
-
-NK_INTERN void
-nk_textedit_clear_state(struct nk_text_edit *state, enum nk_text_edit_type type,
- nk_plugin_filter filter)
-{
- /* reset the state to default */
- state->undo.undo_point = 0;
- state->undo.undo_char_point = 0;
- state->undo.redo_point = NK_TEXTEDIT_UNDOSTATECOUNT;
- state->undo.redo_char_point = NK_TEXTEDIT_UNDOCHARCOUNT;
- state->select_end = state->select_start = 0;
- state->cursor = 0;
- state->has_preferred_x = 0;
- state->preferred_x = 0;
- state->cursor_at_end_of_line = 0;
- state->initialized = 1;
- state->single_line = (unsigned char)(type == NK_TEXT_EDIT_SINGLE_LINE);
- state->mode = NK_TEXT_EDIT_MODE_VIEW;
- state->filter = filter;
- state->scrollbar = nk_vec2(0,0);
-}
-
-NK_API void
-nk_textedit_init_fixed(struct nk_text_edit *state, void *memory, nk_size size)
-{
- NK_ASSERT(state);
- NK_ASSERT(memory);
- if (!state || !memory || !size) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init_fixed(&state->string, memory, size);
-}
-
-NK_API void
-nk_textedit_init(struct nk_text_edit *state, struct nk_allocator *alloc, nk_size size)
-{
- NK_ASSERT(state);
- NK_ASSERT(alloc);
- if (!state || !alloc) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init(&state->string, alloc, size);
-}
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API void
-nk_textedit_init_default(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- if (!state) return;
- NK_MEMSET(state, 0, sizeof(struct nk_text_edit));
- nk_textedit_clear_state(state, NK_TEXT_EDIT_SINGLE_LINE, 0);
- nk_str_init_default(&state->string);
-}
-#endif
-
-NK_API void
-nk_textedit_select_all(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- state->select_start = 0;
- state->select_end = state->string.len;
-}
-
-NK_API void
-nk_textedit_free(struct nk_text_edit *state)
-{
- NK_ASSERT(state);
- if (!state) return;
- nk_str_free(&state->string);
-}
-
-/* ===============================================================
- *
- * TEXT WIDGET
- *
- * ===============================================================*/
-#define nk_widget_state_reset(s)\
- if ((*(s)) & NK_WIDGET_STATE_MODIFIED)\
- (*(s)) = NK_WIDGET_STATE_INACTIVE|NK_WIDGET_STATE_MODIFIED;\
- else (*(s)) = NK_WIDGET_STATE_INACTIVE;
-
-struct nk_text {
- struct nk_vec2 padding;
- struct nk_color background;
- struct nk_color text;
-};
-
-NK_INTERN void
-nk_widget_text(struct nk_command_buffer *o, struct nk_rect b,
- const char *string, int len, const struct nk_text *t,
- nk_flags a, const struct nk_user_font *f)
-{
- struct nk_rect label;
- float text_width;
-
- NK_ASSERT(o);
- NK_ASSERT(t);
- if (!o || !t) return;
-
- b.h = NK_MAX(b.h, 2 * t->padding.y);
- label.x = 0; label.w = 0;
- label.y = b.y + t->padding.y;
- label.h = NK_MIN(f->height, b.h - 2 * t->padding.y);
-
- text_width = f->width(f->userdata, f->height, (const char*)string, len);
- text_width += (2.0f * t->padding.x);
-
- /* align in x-axis */
- if (a & NK_TEXT_ALIGN_LEFT) {
- label.x = b.x + t->padding.x;
- label.w = NK_MAX(0, b.w - 2 * t->padding.x);
- } else if (a & NK_TEXT_ALIGN_CENTERED) {
- label.w = NK_MAX(1, 2 * t->padding.x + (float)text_width);
- label.x = (b.x + t->padding.x + ((b.w - 2 * t->padding.x) - label.w) / 2);
- label.x = NK_MAX(b.x + t->padding.x, label.x);
- label.w = NK_MIN(b.x + b.w, label.x + label.w);
- if (label.w >= label.x) label.w -= label.x;
- } else if (a & NK_TEXT_ALIGN_RIGHT) {
- label.x = NK_MAX(b.x + t->padding.x, (b.x + b.w) - (2 * t->padding.x + (float)text_width));
- label.w = (float)text_width + 2 * t->padding.x;
- } else return;
-
- /* align in y-axis */
- if (a & NK_TEXT_ALIGN_MIDDLE) {
- label.y = b.y + b.h/2.0f - (float)f->height/2.0f;
- label.h = NK_MAX(b.h/2.0f, b.h - (b.h/2.0f + f->height/2.0f));
- } else if (a & NK_TEXT_ALIGN_BOTTOM) {
- label.y = b.y + b.h - f->height;
- label.h = f->height;
- }
- nk_draw_text(o, label, (const char*)string,
- len, f, t->background, t->text);
-}
-
-NK_INTERN void
-nk_widget_text_wrap(struct nk_command_buffer *o, struct nk_rect b,
- const char *string, int len, const struct nk_text *t,
- const struct nk_user_font *f)
-{
- float width;
- int glyphs = 0;
- int fitting = 0;
- int done = 0;
- struct nk_rect line;
- struct nk_text text;
- NK_INTERN nk_rune seperator[] = {' '};
-
- NK_ASSERT(o);
- NK_ASSERT(t);
- if (!o || !t) return;
-
- text.padding = nk_vec2(0,0);
- text.background = t->background;
- text.text = t->text;
-
- b.w = NK_MAX(b.w, 2 * t->padding.x);
- b.h = NK_MAX(b.h, 2 * t->padding.y);
- b.h = b.h - 2 * t->padding.y;
-
- line.x = b.x + t->padding.x;
- line.y = b.y + t->padding.y;
- line.w = b.w - 2 * t->padding.x;
- line.h = 2 * t->padding.y + f->height;
-
- fitting = nk_text_clamp(f, string, len, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
- while (done < len) {
- if (!fitting || line.y + line.h >= (b.y + b.h)) break;
- nk_widget_text(o, line, &string[done], fitting, &text, NK_TEXT_LEFT, f);
- done += fitting;
- line.y += f->height + 2 * t->padding.y;
- fitting = nk_text_clamp(f, &string[done], len - done, line.w, &glyphs, &width, seperator,NK_LEN(seperator));
- }
-}
-
-/* ===============================================================
- *
- * BUTTON
- *
- * ===============================================================*/
-NK_INTERN void
-nk_draw_symbol(struct nk_command_buffer *out, enum nk_symbol_type type,
- struct nk_rect content, struct nk_color background, struct nk_color foreground,
- float border_width, const struct nk_user_font *font)
-{
- switch (type) {
- case NK_SYMBOL_X:
- case NK_SYMBOL_UNDERSCORE:
- case NK_SYMBOL_PLUS:
- case NK_SYMBOL_MINUS: {
- /* single character text symbol */
- const char *X = (type == NK_SYMBOL_X) ? "x":
- (type == NK_SYMBOL_UNDERSCORE) ? "_":
- (type == NK_SYMBOL_PLUS) ? "+": "-";
- struct nk_text text;
- text.padding = nk_vec2(0,0);
- text.background = background;
- text.text = foreground;
- nk_widget_text(out, content, X, 1, &text, NK_TEXT_CENTERED, font);
- } break;
- case NK_SYMBOL_CIRCLE_SOLID:
- case NK_SYMBOL_CIRCLE_OUTLINE:
- case NK_SYMBOL_RECT_SOLID:
- case NK_SYMBOL_RECT_OUTLINE: {
- /* simple empty/filled shapes */
- if (type == NK_SYMBOL_RECT_SOLID || type == NK_SYMBOL_RECT_OUTLINE) {
- nk_fill_rect(out, content, 0, foreground);
- if (type == NK_SYMBOL_RECT_OUTLINE)
- nk_fill_rect(out, nk_shrink_rect(content, border_width), 0, background);
- } else {
- nk_fill_circle(out, content, foreground);
- if (type == NK_SYMBOL_CIRCLE_OUTLINE)
- nk_fill_circle(out, nk_shrink_rect(content, 1), background);
- }
- } break;
- case NK_SYMBOL_TRIANGLE_UP:
- case NK_SYMBOL_TRIANGLE_DOWN:
- case NK_SYMBOL_TRIANGLE_LEFT:
- case NK_SYMBOL_TRIANGLE_RIGHT: {
- enum nk_heading heading;
- struct nk_vec2 points[3];
- heading = (type == NK_SYMBOL_TRIANGLE_RIGHT) ? NK_RIGHT :
- (type == NK_SYMBOL_TRIANGLE_LEFT) ? NK_LEFT:
- (type == NK_SYMBOL_TRIANGLE_UP) ? NK_UP: NK_DOWN;
- nk_triangle_from_direction(points, content, 0, 0, heading);
- nk_fill_triangle(out, points[0].x, points[0].y, points[1].x, points[1].y,
- points[2].x, points[2].y, foreground);
- } break;
- default:
- case NK_SYMBOL_NONE:
- case NK_SYMBOL_MAX: break;
- }
-}
-
-NK_INTERN int
-nk_button_behavior(nk_flags *state, struct nk_rect r,
- const struct nk_input *i, enum nk_button_behavior behavior)
-{
- int ret = 0;
- nk_widget_state_reset(state);
- if (!i) return 0;
- if (nk_input_is_mouse_hovering_rect(i, r)) {
- *state = NK_WIDGET_STATE_HOVERED;
- if (nk_input_is_mouse_down(i, NK_BUTTON_LEFT))
- *state = NK_WIDGET_STATE_ACTIVE;
- if (nk_input_has_mouse_click_in_rect(i, NK_BUTTON_LEFT, r)) {
- ret = (behavior != NK_BUTTON_DEFAULT) ?
- nk_input_is_mouse_down(i, NK_BUTTON_LEFT):
-#ifdef NK_BUTTON_TRIGGER_ON_RELEASE
- nk_input_is_mouse_released(i, NK_BUTTON_LEFT);
-#else
- nk_input_is_mouse_pressed(i, NK_BUTTON_LEFT);
-#endif
- }
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(i, r))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(i, r))
- *state |= NK_WIDGET_STATE_LEFT;
- return ret;
-}
-
-NK_INTERN const struct nk_style_item*
-nk_draw_button(struct nk_command_buffer *out,
- const struct nk_rect *bounds, nk_flags state,
- const struct nk_style_button *style)
-{
- const struct nk_style_item *background;
- if (state & NK_WIDGET_STATE_HOVER)
- background = &style->hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- background = &style->active;
- else background = &style->normal;
-
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- } else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- }
- return background;
-}
-
-NK_INTERN int
-nk_do_button(nk_flags *state, struct nk_command_buffer *out, struct nk_rect r,
- const struct nk_style_button *style, const struct nk_input *in,
- enum nk_button_behavior behavior, struct nk_rect *content)
-{
- struct nk_rect bounds;
- NK_ASSERT(style);
- NK_ASSERT(state);
- NK_ASSERT(out);
- if (!out || !style)
- return nk_false;
-
- /* calculate button content space */
- content->x = r.x + style->padding.x + style->border + style->rounding;
- content->y = r.y + style->padding.y + style->border + style->rounding;
- content->w = r.w - (2 * style->padding.x + style->border + style->rounding*2);
- content->h = r.h - (2 * style->padding.y + style->border + style->rounding*2);
-
- /* execute button behavior */
- bounds.x = r.x - style->touch_padding.x;
- bounds.y = r.y - style->touch_padding.y;
- bounds.w = r.w + 2 * style->touch_padding.x;
- bounds.h = r.h + 2 * style->touch_padding.y;
- return nk_button_behavior(state, bounds, in, behavior);
-}
-
-NK_INTERN void
-nk_draw_button_text(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content, nk_flags state,
- const struct nk_style_button *style, const char *txt, int len,
- nk_flags text_alignment, const struct nk_user_font *font)
-{
- struct nk_text text;
- const struct nk_style_item *background;
- background = nk_draw_button(out, bounds, state, style);
-
- /* select correct colors/images */
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
- if (state & NK_WIDGET_STATE_HOVER)
- text.text = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- text.text = style->text_active;
- else text.text = style->text_normal;
-
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *content, txt, len, &text, text_alignment, font);
-}
-
-NK_INTERN int
-nk_do_button_text(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- const char *string, int len, nk_flags align, enum nk_button_behavior behavior,
- const struct nk_style_button *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- struct nk_rect content;
- int ret = nk_false;
-
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(string);
- NK_ASSERT(font);
- if (!out || !style || !font || !string)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text(out, &bounds, &content, *state, style, string, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
-
-NK_INTERN void
-nk_draw_button_symbol(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content,
- nk_flags state, const struct nk_style_button *style,
- enum nk_symbol_type type, const struct nk_user_font *font)
-{
- struct nk_color sym, bg;
- const struct nk_style_item *background;
-
- /* select correct colors/images */
- background = nk_draw_button(out, bounds, state, style);
- if (background->type == NK_STYLE_ITEM_COLOR)
- bg = background->data.color;
- else bg = style->text_background;
-
- if (state & NK_WIDGET_STATE_HOVER)
- sym = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- sym = style->text_active;
- else sym = style->text_normal;
- nk_draw_symbol(out, type, *content, bg, sym, 1, font);
-}
-
-NK_INTERN int
-nk_do_button_symbol(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- enum nk_symbol_type symbol, enum nk_button_behavior behavior,
- const struct nk_style_button *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int ret;
- struct nk_rect content;
-
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(font);
- NK_ASSERT(out);
- if (!out || !style || !font || !state)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_symbol(out, &bounds, &content, *state, style, symbol, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
-
-NK_INTERN void
-nk_draw_button_image(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *content,
- nk_flags state, const struct nk_style_button *style, const struct nk_image *img)
-{
- nk_draw_button(out, bounds, state, style);
- nk_draw_image(out, *content, img, nk_white);
-}
-
-NK_INTERN int
-nk_do_button_image(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- struct nk_image img, enum nk_button_behavior b,
- const struct nk_style_button *style, const struct nk_input *in)
-{
- int ret;
- struct nk_rect content;
-
- NK_ASSERT(state);
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style || !state)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, b, &content);
- content.x += style->image_padding.x;
- content.y += style->image_padding.y;
- content.w -= 2 * style->image_padding.x;
- content.h -= 2 * style->image_padding.y;
-
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_image(out, &bounds, &content, *state, style, &img);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
-
-NK_INTERN void
-nk_draw_button_text_symbol(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *label,
- const struct nk_rect *symbol, nk_flags state, const struct nk_style_button *style,
- const char *str, int len, enum nk_symbol_type type,
- const struct nk_user_font *font)
-{
- struct nk_color sym;
- struct nk_text text;
- const struct nk_style_item *background;
-
- /* select correct background colors/images */
- background = nk_draw_button(out, bounds, state, style);
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
-
- /* select correct text colors */
- if (state & NK_WIDGET_STATE_HOVER) {
- sym = style->text_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- sym = style->text_active;
- text.text = style->text_active;
- } else {
- sym = style->text_normal;
- text.text = style->text_normal;
- }
-
- text.padding = nk_vec2(0,0);
- nk_draw_symbol(out, type, *symbol, style->text_background, sym, 0, font);
- nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
-}
-
-NK_INTERN int
-nk_do_button_text_symbol(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- enum nk_symbol_type symbol, const char *str, int len, nk_flags align,
- enum nk_button_behavior behavior, const struct nk_style_button *style,
- const struct nk_user_font *font, const struct nk_input *in)
-{
- int ret;
- struct nk_rect tri = {0,0,0,0};
- struct nk_rect content;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(font);
- if (!out || !style || !font)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- tri.y = content.y + (content.h/2) - font->height/2;
- tri.w = font->height; tri.h = font->height;
- if (align & NK_TEXT_ALIGN_LEFT) {
- tri.x = (content.x + content.w) - (2 * style->padding.x + tri.w);
- tri.x = NK_MAX(tri.x, 0);
- } else tri.x = content.x + 2 * style->padding.x;
-
- /* draw button */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text_symbol(out, &bounds, &content, &tri,
- *state, style, str, len, symbol, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
-
-NK_INTERN void
-nk_draw_button_text_image(struct nk_command_buffer *out,
- const struct nk_rect *bounds, const struct nk_rect *label,
- const struct nk_rect *image, nk_flags state, const struct nk_style_button *style,
- const char *str, int len, const struct nk_user_font *font,
- const struct nk_image *img)
-{
- struct nk_text text;
- const struct nk_style_item *background;
- background = nk_draw_button(out, bounds, state, style);
-
- /* select correct colors */
- if (background->type == NK_STYLE_ITEM_COLOR)
- text.background = background->data.color;
- else text.background = style->text_background;
- if (state & NK_WIDGET_STATE_HOVER)
- text.text = style->text_hover;
- else if (state & NK_WIDGET_STATE_ACTIVED)
- text.text = style->text_active;
- else text.text = style->text_normal;
-
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *label, str, len, &text, NK_TEXT_CENTERED, font);
- nk_draw_image(out, *image, img, nk_white);
-}
-
-NK_INTERN int
-nk_do_button_text_image(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- struct nk_image img, const char* str, int len, nk_flags align,
- enum nk_button_behavior behavior, const struct nk_style_button *style,
- const struct nk_user_font *font, const struct nk_input *in)
-{
- int ret;
- struct nk_rect icon;
- struct nk_rect content;
-
- NK_ASSERT(style);
- NK_ASSERT(state);
- NK_ASSERT(font);
- NK_ASSERT(out);
- if (!out || !font || !style || !str)
- return nk_false;
-
- ret = nk_do_button(state, out, bounds, style, in, behavior, &content);
- icon.y = bounds.y + style->padding.y;
- icon.w = icon.h = bounds.h - 2 * style->padding.y;
- if (align & NK_TEXT_ALIGN_LEFT) {
- icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
- icon.x = NK_MAX(icon.x, 0);
- } else icon.x = bounds.x + 2 * style->padding.x;
-
- icon.x += style->image_padding.x;
- icon.y += style->image_padding.y;
- icon.w -= 2 * style->image_padding.x;
- icon.h -= 2 * style->image_padding.y;
-
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_button_text_image(out, &bounds, &content, &icon, *state, style, str, len, font, &img);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return ret;
-}
-
-/* ===============================================================
- *
- * TOGGLE
- *
- * ===============================================================*/
-enum nk_toggle_type {
- NK_TOGGLE_CHECK,
- NK_TOGGLE_OPTION
-};
-
-NK_INTERN int
-nk_toggle_behavior(const struct nk_input *in, struct nk_rect select,
- nk_flags *state, int active)
-{
- nk_widget_state_reset(state);
- if (nk_button_behavior(state, select, in, NK_BUTTON_DEFAULT)) {
- *state = NK_WIDGET_STATE_ACTIVE;
- active = !active;
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, select))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, select))
- *state |= NK_WIDGET_STATE_LEFT;
- return active;
-}
-
-NK_INTERN void
-nk_draw_checkbox(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_toggle *style, int active,
- const struct nk_rect *label, const struct nk_rect *selector,
- const struct nk_rect *cursors, const char *string, int len,
- const struct nk_user_font *font)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
- struct nk_text text;
-
- /* select correct colors/images */
- if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_active;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- text.text = style->text_normal;
- }
-
- /* draw background and cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *selector, 0, style->border_color);
- nk_fill_rect(out, nk_shrink_rect(*selector, style->border), 0, background->data.color);
- } else nk_draw_image(out, *selector, &background->data.image, nk_white);
- if (active) {
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
- else nk_fill_rect(out, *cursors, 0, cursor->data.color);
- }
-
- text.padding.x = 0;
- text.padding.y = 0;
- text.background = style->text_background;
- nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
-}
-
-NK_INTERN void
-nk_draw_option(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_toggle *style, int active,
- const struct nk_rect *label, const struct nk_rect *selector,
- const struct nk_rect *cursors, const char *string, int len,
- const struct nk_user_font *font)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
- struct nk_text text;
-
- /* select correct colors/images */
- if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_hover;
- } else if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- text.text = style->text_active;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- text.text = style->text_normal;
- }
-
- /* draw background and cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_circle(out, *selector, style->border_color);
- nk_fill_circle(out, nk_shrink_rect(*selector, style->border), background->data.color);
- } else nk_draw_image(out, *selector, &background->data.image, nk_white);
- if (active) {
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *cursors, &cursor->data.image, nk_white);
- else nk_fill_circle(out, *cursors, cursor->data.color);
- }
-
- text.padding.x = 0;
- text.padding.y = 0;
- text.background = style->text_background;
- nk_widget_text(out, *label, string, len, &text, NK_TEXT_LEFT, font);
-}
-
-NK_INTERN int
-nk_do_toggle(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect r,
- int *active, const char *str, int len, enum nk_toggle_type type,
- const struct nk_style_toggle *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int was_active;
- struct nk_rect bounds;
- struct nk_rect select;
- struct nk_rect cursor;
- struct nk_rect label;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- NK_ASSERT(font);
- if (!out || !style || !font || !active)
- return 0;
-
- r.w = NK_MAX(r.w, font->height + 2 * style->padding.x);
- r.h = NK_MAX(r.h, font->height + 2 * style->padding.y);
-
- /* add additional touch padding for touch screen devices */
- bounds.x = r.x - style->touch_padding.x;
- bounds.y = r.y - style->touch_padding.y;
- bounds.w = r.w + 2 * style->touch_padding.x;
- bounds.h = r.h + 2 * style->touch_padding.y;
-
- /* calculate the selector space */
- select.w = font->height;
- select.h = select.w;
- select.y = r.y + r.h/2.0f - select.h/2.0f;
- select.x = r.x;
-
- /* calculate the bounds of the cursor inside the selector */
- cursor.x = select.x + style->padding.x + style->border;
- cursor.y = select.y + style->padding.y + style->border;
- cursor.w = select.w - (2 * style->padding.x + 2 * style->border);
- cursor.h = select.h - (2 * style->padding.y + 2 * style->border);
-
- /* label behind the selector */
- label.x = select.x + select.w + style->spacing;
- label.y = select.y;
- label.w = NK_MAX(r.x + r.w, label.x) - label.x;
- label.h = select.w;
-
- /* update selector */
- was_active = *active;
- *active = nk_toggle_behavior(in, bounds, state, *active);
-
- /* draw selector */
- if (style->draw_begin)
- style->draw_begin(out, style->userdata);
- if (type == NK_TOGGLE_CHECK) {
- nk_draw_checkbox(out, *state, style, *active, &label, &select, &cursor, str, len, font);
- } else {
- nk_draw_option(out, *state, style, *active, &label, &select, &cursor, str, len, font);
- }
- if (style->draw_end)
- style->draw_end(out, style->userdata);
- return (was_active != *active);
-}
-
-/* ===============================================================
- *
- * SELECTABLE
- *
- * ===============================================================*/
-NK_INTERN void
-nk_draw_selectable(struct nk_command_buffer *out,
- nk_flags state, const struct nk_style_selectable *style, int active,
- const struct nk_rect *bounds, const struct nk_rect *icon, const struct nk_image *img,
- const char *string, int len, nk_flags align, const struct nk_user_font *font)
-{
- const struct nk_style_item *background;
- struct nk_text text;
- text.padding = style->padding;
-
- /* select correct colors/images */
- if (!active) {
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->pressed;
- text.text = style->text_pressed;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text.text = style->text_hover;
- } else {
- background = &style->normal;
- text.text = style->text_normal;
- }
- } else {
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->pressed_active;
- text.text = style->text_pressed_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover_active;
- text.text = style->text_hover_active;
- } else {
- background = &style->normal_active;
- text.text = style->text_normal_active;
- }
- }
-
-
- /* draw selectable background and text */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- text.background = background->data.color;
- }
- if (img && icon) nk_draw_image(out, *icon, img, nk_white);
- nk_widget_text(out, *bounds, string, len, &text, align, font);
-}
-
-NK_INTERN int
-nk_do_selectable(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
- const struct nk_style_selectable *style, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int old_value;
- struct nk_rect touch;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(str);
- NK_ASSERT(len);
- NK_ASSERT(value);
- NK_ASSERT(style);
- NK_ASSERT(font);
-
- if (!state || !out || !str || !len || !value || !style || !font) return 0;
- old_value = *value;
-
- /* remove padding */
- touch.x = bounds.x - style->touch_padding.x;
- touch.y = bounds.y - style->touch_padding.y;
- touch.w = bounds.w + style->touch_padding.x * 2;
- touch.h = bounds.h + style->touch_padding.y * 2;
-
- /* update button */
- if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
- *value = !(*value);
-
- /* draw selectable */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_selectable(out, *state, style, *value, &bounds, 0,0, str, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return old_value != *value;
-}
-
-NK_INTERN int
-nk_do_selectable_image(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, const char *str, int len, nk_flags align, int *value,
- const struct nk_image *img, const struct nk_style_selectable *style,
- const struct nk_input *in, const struct nk_user_font *font)
-{
- int old_value;
- struct nk_rect touch;
- struct nk_rect icon;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(str);
- NK_ASSERT(len);
- NK_ASSERT(value);
- NK_ASSERT(style);
- NK_ASSERT(font);
-
- if (!state || !out || !str || !len || !value || !style || !font) return 0;
- old_value = *value;
-
- /* toggle behavior */
- touch.x = bounds.x - style->touch_padding.x;
- touch.y = bounds.y - style->touch_padding.y;
- touch.w = bounds.w + style->touch_padding.x * 2;
- touch.h = bounds.h + style->touch_padding.y * 2;
- if (nk_button_behavior(state, touch, in, NK_BUTTON_DEFAULT))
- *value = !(*value);
-
- icon.y = bounds.y + style->padding.y;
- icon.w = icon.h = bounds.h - 2 * style->padding.y;
- if (align & NK_TEXT_ALIGN_LEFT) {
- icon.x = (bounds.x + bounds.w) - (2 * style->padding.x + icon.w);
- icon.x = NK_MAX(icon.x, 0);
- } else icon.x = bounds.x + 2 * style->padding.x;
-
- icon.x += style->image_padding.x;
- icon.y += style->image_padding.y;
- icon.w -= 2 * style->image_padding.x;
- icon.h -= 2 * style->image_padding.y;
-
- /* draw selectable */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_selectable(out, *state, style, *value, &bounds, &icon, img, str, len, align, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return old_value != *value;
-}
-
-
-/* ===============================================================
- *
- * SLIDER
- *
- * ===============================================================*/
-NK_INTERN float
-nk_slider_behavior(nk_flags *state, struct nk_rect *logical_cursor,
- struct nk_rect *visual_cursor, struct nk_input *in,
- struct nk_rect bounds, float slider_min, float slider_max, float slider_value,
- float slider_step, float slider_steps)
-{
- int left_mouse_down;
- int left_mouse_click_in_cursor;
-
- /* check if visual cursor is being dragged */
- nk_widget_state_reset(state);
- left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, *visual_cursor, nk_true);
-
- if (left_mouse_down && left_mouse_click_in_cursor) {
- float ratio = 0;
- const float d = in->mouse.pos.x - (visual_cursor->x+visual_cursor->w*0.5f);
- const float pxstep = bounds.w / slider_steps;
-
- /* only update value if the next slider step is reached */
- *state = NK_WIDGET_STATE_ACTIVE;
- if (NK_ABS(d) >= pxstep) {
- const float steps = (float)((int)(NK_ABS(d) / pxstep));
- slider_value += (d > 0) ? (slider_step*steps) : -(slider_step*steps);
- slider_value = NK_CLAMP(slider_min, slider_value, slider_max);
- ratio = (slider_value - slider_min)/slider_step;
- logical_cursor->x = bounds.x + (logical_cursor->w * ratio);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = logical_cursor->x;
- }
- }
-
- /* slider widget state */
- if (nk_input_is_mouse_hovering_rect(in, bounds))
- *state = NK_WIDGET_STATE_HOVERED;
- if (*state & NK_WIDGET_STATE_HOVER &&
- !nk_input_is_mouse_prev_hovering_rect(in, bounds))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, bounds))
- *state |= NK_WIDGET_STATE_LEFT;
- return slider_value;
-}
-
-NK_INTERN void
-nk_draw_slider(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_slider *style, const struct nk_rect *bounds,
- const struct nk_rect *visual_cursor, float min, float value, float max)
-{
- struct nk_rect fill;
- struct nk_rect bar;
- const struct nk_style_item *background;
-
- /* select correct slider images/colors */
- struct nk_color bar_color;
- const struct nk_style_item *cursor;
-
- NK_UNUSED(min);
- NK_UNUSED(max);
- NK_UNUSED(value);
-
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- bar_color = style->bar_active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- bar_color = style->bar_hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- bar_color = style->bar_normal;
- cursor = &style->cursor_normal;
- }
-
- /* calculate slider background bar */
- bar.x = bounds->x;
- bar.y = (visual_cursor->y + visual_cursor->h/2) - bounds->h/12;
- bar.w = bounds->w;
- bar.h = bounds->h/6;
-
- /* filled background bar style */
- fill.w = (visual_cursor->x + (visual_cursor->w/2.0f)) - bar.x;
- fill.x = bar.x;
- fill.y = bar.y;
- fill.h = bar.h;
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- } else {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- }
-
- /* draw slider bar */
- nk_fill_rect(out, bar, style->rounding, bar_color);
- nk_fill_rect(out, fill, style->rounding, style->bar_filled);
-
- /* draw cursor */
- if (cursor->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, *visual_cursor, &cursor->data.image, nk_white);
- else nk_fill_circle(out, *visual_cursor, cursor->data.color);
-}
-
-NK_INTERN float
-nk_do_slider(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- float min, float val, float max, float step,
- const struct nk_style_slider *style, struct nk_input *in,
- const struct nk_user_font *font)
-{
- float slider_range;
- float slider_min;
- float slider_max;
- float slider_value;
- float slider_steps;
- float cursor_offset;
-
- struct nk_rect visual_cursor;
- struct nk_rect logical_cursor;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style)
- return 0;
-
- /* remove padding from slider bounds */
- bounds.x = bounds.x + style->padding.x;
- bounds.y = bounds.y + style->padding.y;
- bounds.h = NK_MAX(bounds.h, 2*style->padding.y);
- bounds.w = NK_MAX(bounds.w, 2*style->padding.x + style->cursor_size.x);
- bounds.w -= 2 * style->padding.x;
- bounds.h -= 2 * style->padding.y;
-
- /* optional buttons */
- if (style->show_buttons) {
- nk_flags ws;
- struct nk_rect button;
- button.y = bounds.y;
- button.w = bounds.h;
- button.h = bounds.h;
-
- /* decrement button */
- button.x = bounds.x;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol, NK_BUTTON_DEFAULT,
- &style->dec_button, in, font))
- val -= step;
-
- /* increment button */
- button.x = (bounds.x + bounds.w) - button.w;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol, NK_BUTTON_DEFAULT,
- &style->inc_button, in, font))
- val += step;
-
- bounds.x = bounds.x + button.w + style->spacing.x;
- bounds.w = bounds.w - (2*button.w + 2*style->spacing.x);
- }
-
- /* remove one cursor size to support visual cursor */
- bounds.x += style->cursor_size.x*0.5f;
- bounds.w -= style->cursor_size.x;
-
- /* make sure the provided values are correct */
- slider_max = NK_MAX(min, max);
- slider_min = NK_MIN(min, max);
- slider_value = NK_CLAMP(slider_min, val, slider_max);
- slider_range = slider_max - slider_min;
- slider_steps = slider_range / step;
- cursor_offset = (slider_value - slider_min) / step;
-
- /* calculate cursor
- Basically you have two cursors. One for visual representation and interaction
- and one for updating the actual cursor value. */
- logical_cursor.h = bounds.h;
- logical_cursor.w = bounds.w / slider_steps;
- logical_cursor.x = bounds.x + (logical_cursor.w * cursor_offset);
- logical_cursor.y = bounds.y;
-
- visual_cursor.h = style->cursor_size.y;
- visual_cursor.w = style->cursor_size.x;
- visual_cursor.y = (bounds.y + bounds.h*0.5f) - visual_cursor.h*0.5f;
- visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
-
- slider_value = nk_slider_behavior(state, &logical_cursor, &visual_cursor,
- in, bounds, slider_min, slider_max, slider_value, step, slider_steps);
- visual_cursor.x = logical_cursor.x - visual_cursor.w*0.5f;
-
- /* draw slider */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_slider(out, *state, style, &bounds, &visual_cursor, slider_min, slider_value, slider_max);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return slider_value;
-}
-
-/* ===============================================================
- *
- * PROGRESSBAR
- *
- * ===============================================================*/
-NK_INTERN nk_size
-nk_progress_behavior(nk_flags *state, struct nk_input *in,
- struct nk_rect r, struct nk_rect cursor, nk_size max, nk_size value, int modifiable)
-{
- int left_mouse_down = 0;
- int left_mouse_click_in_cursor = 0;
-
- nk_widget_state_reset(state);
- if (!in || !modifiable) return value;
- left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = in && nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, cursor, nk_true);
- if (nk_input_is_mouse_hovering_rect(in, r))
- *state = NK_WIDGET_STATE_HOVERED;
-
- if (in && left_mouse_down && left_mouse_click_in_cursor) {
- if (left_mouse_down && left_mouse_click_in_cursor) {
- float ratio = NK_MAX(0, (float)(in->mouse.pos.x - cursor.x)) / (float)cursor.w;
- value = (nk_size)NK_CLAMP(0, (float)max * ratio, (float)max);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor.x + cursor.w/2.0f;
- *state |= NK_WIDGET_STATE_ACTIVE;
- }
- }
- /* set progressbar widget state */
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, r))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, r))
- *state |= NK_WIDGET_STATE_LEFT;
- return value;
-}
-
-NK_INTERN void
-nk_draw_progress(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_progress *style, const struct nk_rect *bounds,
- const struct nk_rect *scursor, nk_size value, nk_size max)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
-
- NK_UNUSED(max);
- NK_UNUSED(value);
-
- /* select correct colors/images to draw */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER){
- background = &style->hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- }
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- } else nk_draw_image(out, *bounds, &background->data.image, nk_white);
-
- /* draw cursor */
- if (cursor->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *scursor, style->rounding, cursor->data.color);
- nk_stroke_rect(out, *scursor, style->rounding, style->border, style->border_color);
- } else nk_draw_image(out, *scursor, &cursor->data.image, nk_white);
-}
-
-NK_INTERN nk_size
-nk_do_progress(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect bounds,
- nk_size value, nk_size max, int modifiable,
- const struct nk_style_progress *style, struct nk_input *in)
-{
- float prog_scale;
- nk_size prog_value;
- struct nk_rect cursor;
-
- NK_ASSERT(style);
- NK_ASSERT(out);
- if (!out || !style) return 0;
-
- /* calculate progressbar cursor */
- cursor.w = NK_MAX(bounds.w, 2 * style->padding.x + 2 * style->border);
- cursor.h = NK_MAX(bounds.h, 2 * style->padding.y + 2 * style->border);
- cursor = nk_pad_rect(bounds, nk_vec2(style->padding.x + style->border, style->padding.y + style->border));
- prog_scale = (float)value / (float)max;
-
- /* update progressbar */
- prog_value = NK_MIN(value, max);
- prog_value = nk_progress_behavior(state, in, bounds, cursor,max, prog_value, modifiable);
- cursor.w = cursor.w * prog_scale;
-
- /* draw progressbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_progress(out, *state, style, &bounds, &cursor, value, max);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return prog_value;
-}
-
-/* ===============================================================
- *
- * SCROLLBAR
- *
- * ===============================================================*/
-NK_INTERN float
-nk_scrollbar_behavior(nk_flags *state, struct nk_input *in,
- int has_scrolling, const struct nk_rect *scroll,
- const struct nk_rect *cursor, const struct nk_rect *empty0,
- const struct nk_rect *empty1, float scroll_offset,
- float target, float scroll_step, enum nk_orientation o)
-{
- nk_flags ws = 0;
- int left_mouse_down;
- int left_mouse_click_in_cursor;
- float scroll_delta;
-
- nk_widget_state_reset(state);
- if (!in) return scroll_offset;
-
- left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, *cursor, nk_true);
- if (nk_input_is_mouse_hovering_rect(in, *scroll))
- *state = NK_WIDGET_STATE_HOVERED;
-
- scroll_delta = (o == NK_VERTICAL) ? in->mouse.scroll_delta.y: in->mouse.scroll_delta.x;
- if (left_mouse_down && left_mouse_click_in_cursor) {
- /* update cursor by mouse dragging */
- float pixel, delta;
- *state = NK_WIDGET_STATE_ACTIVE;
- if (o == NK_VERTICAL) {
- float cursor_y;
- pixel = in->mouse.delta.y;
- delta = (pixel / scroll->h) * target;
- scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->h);
- cursor_y = scroll->y + ((scroll_offset/target) * scroll->h);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = cursor_y + cursor->h/2.0f;
- } else {
- float cursor_x;
- pixel = in->mouse.delta.x;
- delta = (pixel / scroll->w) * target;
- scroll_offset = NK_CLAMP(0, scroll_offset + delta, target - scroll->w);
- cursor_x = scroll->x + ((scroll_offset/target) * scroll->w);
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = cursor_x + cursor->w/2.0f;
- }
- } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_UP) && o == NK_VERTICAL && has_scrolling)||
- nk_button_behavior(&ws, *empty0, in, NK_BUTTON_DEFAULT)) {
- /* scroll page up by click on empty space or shortcut */
- if (o == NK_VERTICAL)
- scroll_offset = NK_MAX(0, scroll_offset - scroll->h);
- else scroll_offset = NK_MAX(0, scroll_offset - scroll->w);
- } else if ((nk_input_is_key_pressed(in, NK_KEY_SCROLL_DOWN) && o == NK_VERTICAL && has_scrolling) ||
- nk_button_behavior(&ws, *empty1, in, NK_BUTTON_DEFAULT)) {
- /* scroll page down by click on empty space or shortcut */
- if (o == NK_VERTICAL)
- scroll_offset = NK_MIN(scroll_offset + scroll->h, target - scroll->h);
- else scroll_offset = NK_MIN(scroll_offset + scroll->w, target - scroll->w);
- } else if (has_scrolling) {
- if ((scroll_delta < 0 || (scroll_delta > 0))) {
- /* update cursor by mouse scrolling */
- scroll_offset = scroll_offset + scroll_step * (-scroll_delta);
- if (o == NK_VERTICAL)
- scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->h);
- else scroll_offset = NK_CLAMP(0, scroll_offset, target - scroll->w);
- } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_START)) {
- /* update cursor to the beginning */
- if (o == NK_VERTICAL) scroll_offset = 0;
- } else if (nk_input_is_key_pressed(in, NK_KEY_SCROLL_END)) {
- /* update cursor to the end */
- if (o == NK_VERTICAL) scroll_offset = target - scroll->h;
- }
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *scroll))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, *scroll))
- *state |= NK_WIDGET_STATE_LEFT;
- return scroll_offset;
-}
-
-NK_INTERN void
-nk_draw_scrollbar(struct nk_command_buffer *out, nk_flags state,
- const struct nk_style_scrollbar *style, const struct nk_rect *bounds,
- const struct nk_rect *scroll)
-{
- const struct nk_style_item *background;
- const struct nk_style_item *cursor;
-
- /* select correct colors/images to draw */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- cursor = &style->cursor_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- cursor = &style->cursor_hover;
- } else {
- background = &style->normal;
- cursor = &style->cursor_normal;
- }
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, style->border_color);
- } else {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- }
-
- /* draw cursor */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_fill_rect(out, *scroll, style->rounding_cursor, cursor->data.color);
- nk_stroke_rect(out, *scroll, style->rounding_cursor, style->border_cursor, style->cursor_border_color);
- } else nk_draw_image(out, *scroll, &cursor->data.image, nk_white);
-}
-
-NK_INTERN float
-nk_do_scrollbarv(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
- float offset, float target, float step, float button_pixel_inc,
- const struct nk_style_scrollbar *style, struct nk_input *in,
- const struct nk_user_font *font)
-{
- struct nk_rect empty_north;
- struct nk_rect empty_south;
- struct nk_rect cursor;
-
- float scroll_step;
- float scroll_offset;
- float scroll_off;
- float scroll_ratio;
-
- NK_ASSERT(out);
- NK_ASSERT(style);
- NK_ASSERT(state);
- if (!out || !style) return 0;
-
- scroll.w = NK_MAX(scroll.w, 1);
- scroll.h = NK_MAX(scroll.h, 0);
- if (target <= scroll.h) return 0;
-
- /* optional scrollbar buttons */
- if (style->show_buttons) {
- nk_flags ws;
- float scroll_h;
- struct nk_rect button;
-
- button.x = scroll.x;
- button.w = scroll.w;
- button.h = scroll.w;
-
- scroll_h = NK_MAX(scroll.h - 2 * button.h,0);
- scroll_step = NK_MIN(step, button_pixel_inc);
-
- /* decrement button */
- button.y = scroll.y;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
- NK_BUTTON_REPEATER, &style->dec_button, in, font))
- offset = offset - scroll_step;
-
- /* increment button */
- button.y = scroll.y + scroll.h - button.h;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
- NK_BUTTON_REPEATER, &style->inc_button, in, font))
- offset = offset + scroll_step;
-
- scroll.y = scroll.y + button.h;
- scroll.h = scroll_h;
- }
-
- /* calculate scrollbar constants */
- scroll_step = NK_MIN(step, scroll.h);
- scroll_offset = NK_CLAMP(0, offset, target - scroll.h);
- scroll_ratio = scroll.h / target;
- scroll_off = scroll_offset / target;
-
- /* calculate scrollbar cursor bounds */
- cursor.h = NK_MAX((scroll_ratio * scroll.h) - (2*style->border + 2*style->padding.y), 0);
- cursor.y = scroll.y + (scroll_off * scroll.h) + style->border + style->padding.y;
- cursor.w = scroll.w - (2 * style->border + 2 * style->padding.x);
- cursor.x = scroll.x + style->border + style->padding.x;
-
- /* calculate empty space around cursor */
- empty_north.x = scroll.x;
- empty_north.y = scroll.y;
- empty_north.w = scroll.w;
- empty_north.h = NK_MAX(cursor.y - scroll.y, 0);
-
- empty_south.x = scroll.x;
- empty_south.y = cursor.y + cursor.h;
- empty_south.w = scroll.w;
- empty_south.h = NK_MAX((scroll.y + scroll.h) - (cursor.y + cursor.h), 0);
-
- /* update scrollbar */
- scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
- &empty_north, &empty_south, scroll_offset, target, scroll_step, NK_VERTICAL);
- scroll_off = scroll_offset / target;
- cursor.y = scroll.y + (scroll_off * scroll.h) + style->border_cursor + style->padding.y;
-
- /* draw scrollbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return scroll_offset;
-}
-
-NK_INTERN float
-nk_do_scrollbarh(nk_flags *state,
- struct nk_command_buffer *out, struct nk_rect scroll, int has_scrolling,
- float offset, float target, float step, float button_pixel_inc,
- const struct nk_style_scrollbar *style, struct nk_input *in,
- const struct nk_user_font *font)
-{
- struct nk_rect cursor;
- struct nk_rect empty_west;
- struct nk_rect empty_east;
-
- float scroll_step;
- float scroll_offset;
- float scroll_off;
- float scroll_ratio;
-
- NK_ASSERT(out);
- NK_ASSERT(style);
- if (!out || !style) return 0;
-
- /* scrollbar background */
- scroll.h = NK_MAX(scroll.h, 1);
- scroll.w = NK_MAX(scroll.w, 2 * scroll.h);
- if (target <= scroll.w) return 0;
-
- /* optional scrollbar buttons */
- if (style->show_buttons) {
- nk_flags ws;
- float scroll_w;
- struct nk_rect button;
- button.y = scroll.y;
- button.w = scroll.h;
- button.h = scroll.h;
-
- scroll_w = scroll.w - 2 * button.w;
- scroll_step = NK_MIN(step, button_pixel_inc);
-
- /* decrement button */
- button.x = scroll.x;
- if (nk_do_button_symbol(&ws, out, button, style->dec_symbol,
- NK_BUTTON_REPEATER, &style->dec_button, in, font))
- offset = offset - scroll_step;
-
- /* increment button */
- button.x = scroll.x + scroll.w - button.w;
- if (nk_do_button_symbol(&ws, out, button, style->inc_symbol,
- NK_BUTTON_REPEATER, &style->inc_button, in, font))
- offset = offset + scroll_step;
-
- scroll.x = scroll.x + button.w;
- scroll.w = scroll_w;
- }
-
- /* calculate scrollbar constants */
- scroll_step = NK_MIN(step, scroll.w);
- scroll_offset = NK_CLAMP(0, offset, target - scroll.w);
- scroll_ratio = scroll.w / target;
- scroll_off = scroll_offset / target;
-
- /* calculate cursor bounds */
- cursor.w = (scroll_ratio * scroll.w) - (2*style->border + 2*style->padding.x);
- cursor.x = scroll.x + (scroll_off * scroll.w) + style->border + style->padding.x;
- cursor.h = scroll.h - (2 * style->border + 2 * style->padding.y);
- cursor.y = scroll.y + style->border + style->padding.y;
-
- /* calculate empty space around cursor */
- empty_west.x = scroll.x;
- empty_west.y = scroll.y;
- empty_west.w = cursor.x - scroll.x;
- empty_west.h = scroll.h;
-
- empty_east.x = cursor.x + cursor.w;
- empty_east.y = scroll.y;
- empty_east.w = (scroll.x + scroll.w) - (cursor.x + cursor.w);
- empty_east.h = scroll.h;
-
- /* update scrollbar */
- scroll_offset = nk_scrollbar_behavior(state, in, has_scrolling, &scroll, &cursor,
- &empty_west, &empty_east, scroll_offset, target, scroll_step, NK_HORIZONTAL);
- scroll_off = scroll_offset / target;
- cursor.x = scroll.x + (scroll_off * scroll.w);
-
- /* draw scrollbar */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_scrollbar(out, *state, style, &scroll, &cursor);
- if (style->draw_end) style->draw_end(out, style->userdata);
- return scroll_offset;
-}
-
-/* ===============================================================
- *
- * FILTER
- *
- * ===============================================================*/
-NK_API int nk_filter_default(const struct nk_text_edit *box, nk_rune unicode)
-{(void)unicode;NK_UNUSED(box);return nk_true;}
-
-NK_API int
-nk_filter_ascii(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if (unicode > 128) return nk_false;
- else return nk_true;
-}
-
-NK_API int
-nk_filter_float(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') && unicode != '.' && unicode != '-')
- return nk_false;
- else return nk_true;
-}
-
-NK_API int
-nk_filter_decimal(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') && unicode != '-')
- return nk_false;
- else return nk_true;
-}
-
-NK_API int
-nk_filter_hex(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if ((unicode < '0' || unicode > '9') &&
- (unicode < 'a' || unicode > 'f') &&
- (unicode < 'A' || unicode > 'F'))
- return nk_false;
- else return nk_true;
-}
-
-NK_API int
-nk_filter_oct(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if (unicode < '0' || unicode > '7')
- return nk_false;
- else return nk_true;
-}
-
-NK_API int
-nk_filter_binary(const struct nk_text_edit *box, nk_rune unicode)
-{
- NK_UNUSED(box);
- if (unicode != '0' && unicode != '1')
- return nk_false;
- else return nk_true;
-}
-
-/* ===============================================================
- *
- * EDIT
- *
- * ===============================================================*/
-NK_INTERN void
-nk_edit_draw_text(struct nk_command_buffer *out,
- const struct nk_style_edit *style, float pos_x, float pos_y,
- float x_offset, const char *text, int byte_len, float row_height,
- const struct nk_user_font *font, struct nk_color background,
- struct nk_color foreground, int is_selected)
-{
- NK_ASSERT(out);
- NK_ASSERT(font);
- NK_ASSERT(style);
- if (!text || !byte_len || !out || !style) return;
-
- {int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- float line_width = 0;
- float glyph_width;
- const char *line = text;
- float line_offset = 0;
- int line_count = 0;
-
- struct nk_text txt;
- txt.padding = nk_vec2(0,0);
- txt.background = background;
- txt.text = foreground;
-
- glyph_len = nk_utf_decode(text+text_len, &unicode, byte_len-text_len);
- if (!glyph_len) return;
- while ((text_len < byte_len) && glyph_len)
- {
- if (unicode == '\n') {
- /* new line separator so draw previous line */
- struct nk_rect label;
- label.y = pos_y + line_offset;
- label.h = row_height;
- label.w = line_width;
- label.x = pos_x;
- if (!line_count)
- label.x += x_offset;
-
- if (is_selected) /* selection needs to draw different background color */
- nk_fill_rect(out, label, 0, background);
- nk_widget_text(out, label, line, (int)((text + text_len) - line),
- &txt, NK_TEXT_CENTERED, font);
-
- text_len++;
- line_count++;
- line_width = 0;
- line = text + text_len;
- line_offset += row_height;
- glyph_len = nk_utf_decode(text + text_len, &unicode, (int)(byte_len-text_len));
- continue;
- }
- if (unicode == '\r') {
- text_len++;
- glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
- continue;
- }
- glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
- line_width += (float)glyph_width;
- text_len += glyph_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, byte_len-text_len);
- continue;
- }
- if (line_width > 0) {
- /* draw last line */
- struct nk_rect label;
- label.y = pos_y + line_offset;
- label.h = row_height;
- label.w = line_width;
- label.x = pos_x;
- if (!line_count)
- label.x += x_offset;
-
- if (is_selected)
- nk_fill_rect(out, label, 0, background);
- nk_widget_text(out, label, line, (int)((text + text_len) - line),
- &txt, NK_TEXT_LEFT, font);
- }}
-}
-
-NK_INTERN nk_flags
-nk_do_edit(nk_flags *state, struct nk_command_buffer *out,
- struct nk_rect bounds, nk_flags flags, nk_plugin_filter filter,
- struct nk_text_edit *edit, const struct nk_style_edit *style,
- struct nk_input *in, const struct nk_user_font *font)
-{
- struct nk_rect area;
- nk_flags ret = 0;
- float row_height;
- char prev_state = 0;
- char is_hovered = 0;
- char select_all = 0;
- char cursor_follow = 0;
- struct nk_rect old_clip;
- struct nk_rect clip;
-
- NK_ASSERT(state);
- NK_ASSERT(out);
- NK_ASSERT(style);
- if (!state || !out || !style)
- return ret;
-
- /* visible text area calculation */
- area.x = bounds.x + style->padding.x + style->border;
- area.y = bounds.y + style->padding.y + style->border;
- area.w = bounds.w - (2.0f * style->padding.x + 2 * style->border);
- area.h = bounds.h - (2.0f * style->padding.y + 2 * style->border);
- if (flags & NK_EDIT_MULTILINE)
- area.w = NK_MAX(0, area.w - style->scrollbar_size.x);
- row_height = (flags & NK_EDIT_MULTILINE)? font->height + style->row_padding: area.h;
-
- /* calculate clipping rectangle */
- old_clip = out->clip;
- nk_unify(&clip, &old_clip, area.x, area.y, area.x + area.w, area.y + area.h);
-
- /* update edit state */
- prev_state = (char)edit->active;
- is_hovered = (char)nk_input_is_mouse_hovering_rect(in, bounds);
- if (in && in->mouse.buttons[NK_BUTTON_LEFT].clicked && in->mouse.buttons[NK_BUTTON_LEFT].down) {
- edit->active = NK_INBOX(in->mouse.pos.x, in->mouse.pos.y,
- bounds.x, bounds.y, bounds.w, bounds.h);
- }
-
- /* (de)activate text editor */
- if (!prev_state && edit->active) {
- const enum nk_text_edit_type type = (flags & NK_EDIT_MULTILINE) ?
- NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE;
- nk_textedit_clear_state(edit, type, filter);
- if (flags & NK_EDIT_AUTO_SELECT)
- select_all = nk_true;
- if (flags & NK_EDIT_GOTO_END_ON_ACTIVATE) {
- edit->cursor = edit->string.len;
- in = 0;
- }
- } else if (!edit->active) edit->mode = NK_TEXT_EDIT_MODE_VIEW;
- if (flags & NK_EDIT_READ_ONLY)
- edit->mode = NK_TEXT_EDIT_MODE_VIEW;
- else if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
- edit->mode = NK_TEXT_EDIT_MODE_INSERT;
-
- ret = (edit->active) ? NK_EDIT_ACTIVE: NK_EDIT_INACTIVE;
- if (prev_state != edit->active)
- ret |= (edit->active) ? NK_EDIT_ACTIVATED: NK_EDIT_DEACTIVATED;
-
- /* handle user input */
- if (edit->active && in)
- {
- int shift_mod = in->keyboard.keys[NK_KEY_SHIFT].down;
- const float mouse_x = (in->mouse.pos.x - area.x) + edit->scrollbar.x;
- const float mouse_y = (in->mouse.pos.y - area.y) + edit->scrollbar.y;
-
- /* mouse click handler */
- is_hovered = (char)nk_input_is_mouse_hovering_rect(in, area);
- if (select_all) {
- nk_textedit_select_all(edit);
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
- in->mouse.buttons[NK_BUTTON_LEFT].clicked) {
- nk_textedit_click(edit, mouse_x, mouse_y, font, row_height);
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_LEFT].down &&
- (in->mouse.delta.x != 0.0f || in->mouse.delta.y != 0.0f)) {
- nk_textedit_drag(edit, mouse_x, mouse_y, font, row_height);
- cursor_follow = nk_true;
- } else if (is_hovered && in->mouse.buttons[NK_BUTTON_RIGHT].clicked &&
- in->mouse.buttons[NK_BUTTON_RIGHT].down) {
- nk_textedit_key(edit, NK_KEY_TEXT_WORD_LEFT, nk_false, font, row_height);
- nk_textedit_key(edit, NK_KEY_TEXT_WORD_RIGHT, nk_true, font, row_height);
- cursor_follow = nk_true;
- }
-
- {int i; /* keyboard input */
- int old_mode = edit->mode;
- for (i = 0; i < NK_KEY_MAX; ++i) {
- if (i == NK_KEY_ENTER || i == NK_KEY_TAB) continue; /* special case */
- if (nk_input_is_key_pressed(in, (enum nk_keys)i)) {
- nk_textedit_key(edit, (enum nk_keys)i, shift_mod, font, row_height);
- cursor_follow = nk_true;
- }
- }
- if (old_mode != edit->mode) {
- in->keyboard.text_len = 0;
- }}
-
- /* text input */
- edit->filter = filter;
- if (in->keyboard.text_len) {
- nk_textedit_text(edit, in->keyboard.text, in->keyboard.text_len);
- cursor_follow = nk_true;
- in->keyboard.text_len = 0;
- }
-
- /* enter key handler */
- if (nk_input_is_key_pressed(in, NK_KEY_ENTER)) {
- cursor_follow = nk_true;
- if (flags & NK_EDIT_CTRL_ENTER_NEWLINE && shift_mod)
- nk_textedit_text(edit, "\n", 1);
- else if (flags & NK_EDIT_SIG_ENTER)
- ret |= NK_EDIT_COMMITED;
- else nk_textedit_text(edit, "\n", 1);
- }
-
- /* cut & copy handler */
- {int copy= nk_input_is_key_pressed(in, NK_KEY_COPY);
- int cut = nk_input_is_key_pressed(in, NK_KEY_CUT);
- if ((copy || cut) && (flags & NK_EDIT_CLIPBOARD))
- {
- int glyph_len;
- nk_rune unicode;
- const char *text;
- int b = edit->select_start;
- int e = edit->select_end;
-
- int begin = NK_MIN(b, e);
- int end = NK_MAX(b, e);
- text = nk_str_at_const(&edit->string, begin, &unicode, &glyph_len);
- if (edit->clip.copy)
- edit->clip.copy(edit->clip.userdata, text, end - begin);
- if (cut && !(flags & NK_EDIT_READ_ONLY)){
- nk_textedit_cut(edit);
- cursor_follow = nk_true;
- }
- }}
-
- /* paste handler */
- {int paste = nk_input_is_key_pressed(in, NK_KEY_PASTE);
- if (paste && (flags & NK_EDIT_CLIPBOARD) && edit->clip.paste) {
- edit->clip.paste(edit->clip.userdata, edit);
- cursor_follow = nk_true;
- }}
-
- /* tab handler */
- {int tab = nk_input_is_key_pressed(in, NK_KEY_TAB);
- if (tab && (flags & NK_EDIT_ALLOW_TAB)) {
- nk_textedit_text(edit, " ", 4);
- cursor_follow = nk_true;
- }}
- }
-
- /* set widget state */
- if (edit->active)
- *state = NK_WIDGET_STATE_ACTIVE;
- else nk_widget_state_reset(state);
-
- if (is_hovered)
- *state |= NK_WIDGET_STATE_HOVERED;
-
- /* DRAW EDIT */
- {const char *text = nk_str_get_const(&edit->string);
- int len = nk_str_len_char(&edit->string);
-
- {/* select background colors/images */
- const struct nk_style_item *background;
- if (*state & NK_WIDGET_STATE_ACTIVED)
- background = &style->active;
- else if (*state & NK_WIDGET_STATE_HOVER)
- background = &style->hover;
- else background = &style->normal;
-
- /* draw background frame */
- if (background->type == NK_STYLE_ITEM_COLOR) {
- nk_stroke_rect(out, bounds, style->rounding, style->border, style->border_color);
- nk_fill_rect(out, bounds, style->rounding, background->data.color);
- } else nk_draw_image(out, bounds, &background->data.image, nk_white);}
-
- area.w = NK_MAX(0, area.w - style->cursor_size);
- if (edit->active)
- {
- int total_lines = 1;
- struct nk_vec2 text_size = nk_vec2(0,0);
-
- /* text pointer positions */
- const char *cursor_ptr = 0;
- const char *select_begin_ptr = 0;
- const char *select_end_ptr = 0;
-
- /* 2D pixel positions */
- struct nk_vec2 cursor_pos = nk_vec2(0,0);
- struct nk_vec2 selection_offset_start = nk_vec2(0,0);
- struct nk_vec2 selection_offset_end = nk_vec2(0,0);
-
- int selection_begin = NK_MIN(edit->select_start, edit->select_end);
- int selection_end = NK_MAX(edit->select_start, edit->select_end);
-
- /* calculate total line count + total space + cursor/selection position */
- float line_width = 0.0f;
- if (text && len)
- {
- /* utf8 encoding */
- float glyph_width;
- int glyph_len = 0;
- nk_rune unicode = 0;
- int text_len = 0;
- int glyphs = 0;
- int row_begin = 0;
-
- glyph_len = nk_utf_decode(text, &unicode, len);
- glyph_width = font->width(font->userdata, font->height, text, glyph_len);
- line_width = 0;
-
- /* iterate all lines */
- while ((text_len < len) && glyph_len)
- {
- /* set cursor 2D position and line */
- if (!cursor_ptr && glyphs == edit->cursor)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
-
- /* calculate 2d position */
- cursor_pos.y = (float)(total_lines-1) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- cursor_pos.x = row_size.x;
- cursor_ptr = text + text_len;
- }
-
- /* set start selection 2D position and line */
- if (!select_begin_ptr && edit->select_start != edit->select_end &&
- glyphs == selection_begin)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
-
- /* calculate 2d position */
- selection_offset_start.y = (float)(NK_MAX(total_lines-1,0)) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- selection_offset_start.x = row_size.x;
- select_begin_ptr = text + text_len;
- }
-
- /* set end selection 2D position and line */
- if (!select_end_ptr && edit->select_start != edit->select_end &&
- glyphs == selection_end)
- {
- int glyph_offset;
- struct nk_vec2 out_offset;
- struct nk_vec2 row_size;
- const char *remaining;
-
- /* calculate 2d position */
- selection_offset_end.y = (float)(total_lines-1) * row_height;
- row_size = nk_text_calculate_text_bounds(font, text+row_begin,
- text_len-row_begin, row_height, &remaining,
- &out_offset, &glyph_offset, NK_STOP_ON_NEW_LINE);
- selection_offset_end.x = row_size.x;
- select_end_ptr = text + text_len;
- }
- if (unicode == '\n') {
- text_size.x = NK_MAX(text_size.x, line_width);
- total_lines++;
- line_width = 0;
- text_len++;
- glyphs++;
- row_begin = text_len;
- glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
- glyph_width = font->width(font->userdata, font->height, text+text_len, glyph_len);
- continue;
- }
-
- glyphs++;
- text_len += glyph_len;
- line_width += (float)glyph_width;
-
- glyph_len = nk_utf_decode(text + text_len, &unicode, len-text_len);
- glyph_width = font->width(font->userdata, font->height,
- text+text_len, glyph_len);
- continue;
- }
- text_size.y = (float)total_lines * row_height;
-
- /* handle case when cursor is at end of text buffer */
- if (!cursor_ptr && edit->cursor == edit->string.len) {
- cursor_pos.x = line_width;
- cursor_pos.y = text_size.y - row_height;
- }
- }
- {
- /* scrollbar */
- if (cursor_follow)
- {
- /* update scrollbar to follow cursor */
- if (!(flags & NK_EDIT_NO_HORIZONTAL_SCROLL)) {
- /* horizontal scroll */
- const float scroll_increment = area.w * 0.25f;
- if (cursor_pos.x < edit->scrollbar.x)
- edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x - scroll_increment);
- if (cursor_pos.x >= edit->scrollbar.x + area.w)
- edit->scrollbar.x = (float)(int)NK_MAX(0.0f, cursor_pos.x);
- } else edit->scrollbar.x = 0;
-
- if (flags & NK_EDIT_MULTILINE) {
- /* vertical scroll */
- if (cursor_pos.y < edit->scrollbar.y)
- edit->scrollbar.y = NK_MAX(0.0f, cursor_pos.y - row_height);
- if (cursor_pos.y >= edit->scrollbar.y + area.h)
- edit->scrollbar.y = edit->scrollbar.y + row_height;
- } else edit->scrollbar.y = 0;
- }
-
- /* scrollbar widget */
- if (flags & NK_EDIT_MULTILINE)
- {
- nk_flags ws;
- struct nk_rect scroll;
- float scroll_target;
- float scroll_offset;
- float scroll_step;
- float scroll_inc;
-
- scroll = area;
- scroll.x = (bounds.x + bounds.w - style->border) - style->scrollbar_size.x;
- scroll.w = style->scrollbar_size.x;
-
- scroll_offset = edit->scrollbar.y;
- scroll_step = scroll.h * 0.10f;
- scroll_inc = scroll.h * 0.01f;
- scroll_target = text_size.y;
- edit->scrollbar.y = nk_do_scrollbarv(&ws, out, scroll, 0,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &style->scrollbar, in, font);
- }
- }
-
- /* draw text */
- {struct nk_color background_color;
- struct nk_color text_color;
- struct nk_color sel_background_color;
- struct nk_color sel_text_color;
- struct nk_color cursor_color;
- struct nk_color cursor_text_color;
- const struct nk_style_item *background;
- nk_push_scissor(out, clip);
-
- /* select correct colors to draw */
- if (*state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text_color = style->text_active;
- sel_text_color = style->selected_text_hover;
- sel_background_color = style->selected_hover;
- cursor_color = style->cursor_hover;
- cursor_text_color = style->cursor_text_hover;
- } else if (*state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text_color = style->text_hover;
- sel_text_color = style->selected_text_hover;
- sel_background_color = style->selected_hover;
- cursor_text_color = style->cursor_text_hover;
- cursor_color = style->cursor_hover;
- } else {
- background = &style->normal;
- text_color = style->text_normal;
- sel_text_color = style->selected_text_normal;
- sel_background_color = style->selected_normal;
- cursor_color = style->cursor_normal;
- cursor_text_color = style->cursor_text_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE)
- background_color = nk_rgba(0,0,0,0);
- else background_color = background->data.color;
-
-
- if (edit->select_start == edit->select_end) {
- /* no selection so just draw the complete text */
- const char *begin = nk_str_get_const(&edit->string);
- int l = nk_str_len_char(&edit->string);
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
- background_color, text_color, nk_false);
- } else {
- /* edit has selection so draw 1-3 text chunks */
- if (edit->select_start != edit->select_end && selection_begin > 0){
- /* draw unselected text before selection */
- const char *begin = nk_str_get_const(&edit->string);
- NK_ASSERT(select_begin_ptr);
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, (int)(select_begin_ptr - begin),
- row_height, font, background_color, text_color, nk_false);
- }
- if (edit->select_start != edit->select_end) {
- /* draw selected text */
- NK_ASSERT(select_begin_ptr);
- if (!select_end_ptr) {
- const char *begin = nk_str_get_const(&edit->string);
- select_end_ptr = begin + nk_str_len_char(&edit->string);
- }
- nk_edit_draw_text(out, style,
- area.x - edit->scrollbar.x,
- area.y + selection_offset_start.y - edit->scrollbar.y,
- selection_offset_start.x,
- select_begin_ptr, (int)(select_end_ptr - select_begin_ptr),
- row_height, font, sel_background_color, sel_text_color, nk_true);
- }
- if ((edit->select_start != edit->select_end &&
- selection_end < edit->string.len))
- {
- /* draw unselected text after selected text */
- const char *begin = select_end_ptr;
- const char *end = nk_str_get_const(&edit->string) +
- nk_str_len_char(&edit->string);
- NK_ASSERT(select_end_ptr);
- nk_edit_draw_text(out, style,
- area.x - edit->scrollbar.x,
- area.y + selection_offset_end.y - edit->scrollbar.y,
- selection_offset_end.x,
- begin, (int)(end - begin), row_height, font,
- background_color, text_color, nk_true);
- }
- }
-
- /* cursor */
- if (edit->select_start == edit->select_end)
- {
- if (edit->cursor >= nk_str_len(&edit->string) ||
- (cursor_ptr && *cursor_ptr == '\n')) {
- /* draw cursor at end of line */
- struct nk_rect cursor;
- cursor.w = style->cursor_size;
- cursor.h = font->height;
- cursor.x = area.x + cursor_pos.x - edit->scrollbar.x;
- cursor.y = area.y + cursor_pos.y + row_height/2.0f - cursor.h/2.0f;
- cursor.y -= edit->scrollbar.y;
- nk_fill_rect(out, cursor, 0, cursor_color);
- } else {
- /* draw cursor inside text */
- int glyph_len;
- struct nk_rect label;
- struct nk_text txt;
-
- nk_rune unicode;
- NK_ASSERT(cursor_ptr);
- glyph_len = nk_utf_decode(cursor_ptr, &unicode, 4);
-
- label.x = area.x + cursor_pos.x - edit->scrollbar.x;
- label.y = area.y + cursor_pos.y - edit->scrollbar.y;
- label.w = font->width(font->userdata, font->height, cursor_ptr, glyph_len);
- label.h = row_height;
-
- txt.padding = nk_vec2(0,0);
- txt.background = cursor_color;;
- txt.text = cursor_text_color;
- nk_fill_rect(out, label, 0, cursor_color);
- nk_widget_text(out, label, cursor_ptr, glyph_len, &txt, NK_TEXT_LEFT, font);
- }
- }}
- } else {
- /* not active so just draw text */
- int l = nk_str_len_char(&edit->string);
- const char *begin = nk_str_get_const(&edit->string);
-
- const struct nk_style_item *background;
- struct nk_color background_color;
- struct nk_color text_color;
- nk_push_scissor(out, clip);
- if (*state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text_color = style->text_active;
- } else if (*state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text_color = style->text_hover;
- } else {
- background = &style->normal;
- text_color = style->text_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE)
- background_color = nk_rgba(0,0,0,0);
- else background_color = background->data.color;
- nk_edit_draw_text(out, style, area.x - edit->scrollbar.x,
- area.y - edit->scrollbar.y, 0, begin, l, row_height, font,
- background_color, text_color, nk_false);
- }
- nk_push_scissor(out, old_clip);}
- return ret;
-}
-
-/* ===============================================================
- *
- * PROPERTY
- *
- * ===============================================================*/
-enum nk_property_status {
- NK_PROPERTY_DEFAULT,
- NK_PROPERTY_EDIT,
- NK_PROPERTY_DRAG
-};
-enum nk_property_filter {
- NK_FILTER_INT,
- NK_FILTER_FLOAT
-};
-enum nk_property_kind {
- NK_PROPERTY_INT,
- NK_PROPERTY_FLOAT,
- NK_PROPERTY_DOUBLE
-};
-union nk_property {
- int i;
- float f;
- double d;
-};
-struct nk_property_variant {
- enum nk_property_kind kind;
- union nk_property value;
- union nk_property min_value;
- union nk_property max_value;
- union nk_property step;
-};
-
-NK_INTERN void
-nk_drag_behavior(nk_flags *state, const struct nk_input *in,
- struct nk_rect drag, struct nk_property_variant *variant,
- float inc_per_pixel)
-{
- int left_mouse_down = in && in->mouse.buttons[NK_BUTTON_LEFT].down;
- int left_mouse_click_in_cursor = in &&
- nk_input_has_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, drag, nk_true);
-
- nk_widget_state_reset(state);
- if (nk_input_is_mouse_hovering_rect(in, drag))
- *state = NK_WIDGET_STATE_HOVERED;
-
- if (left_mouse_down && left_mouse_click_in_cursor) {
- float delta, pixels;
- pixels = in->mouse.delta.x;
- delta = pixels * inc_per_pixel;
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = variant->value.i + (int)delta;
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
- break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = variant->value.f + (float)delta;
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
- break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = variant->value.d + (double)delta;
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
- break;
- }
- *state = NK_WIDGET_STATE_ACTIVE;
- }
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, drag))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, drag))
- *state |= NK_WIDGET_STATE_LEFT;
-}
-
-NK_INTERN void
-nk_property_behavior(nk_flags *ws, const struct nk_input *in,
- struct nk_rect property, struct nk_rect label, struct nk_rect edit,
- struct nk_rect empty, int *state, struct nk_property_variant *variant,
- float inc_per_pixel)
-{
- if (in && *state == NK_PROPERTY_DEFAULT) {
- if (nk_button_behavior(ws, edit, in, NK_BUTTON_DEFAULT))
- *state = NK_PROPERTY_EDIT;
- else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, label, nk_true))
- *state = NK_PROPERTY_DRAG;
- else if (nk_input_is_mouse_click_down_in_rect(in, NK_BUTTON_LEFT, empty, nk_true))
- *state = NK_PROPERTY_DRAG;
- }
- if (*state == NK_PROPERTY_DRAG) {
- nk_drag_behavior(ws, in, property, variant, inc_per_pixel);
- if (!(*ws & NK_WIDGET_STATE_ACTIVED)) *state = NK_PROPERTY_DEFAULT;
- }
-}
-
-NK_INTERN void
-nk_draw_property(struct nk_command_buffer *out, const struct nk_style_property *style,
- const struct nk_rect *bounds, const struct nk_rect *label, nk_flags state,
- const char *name, int len, const struct nk_user_font *font)
-{
- struct nk_text text;
- const struct nk_style_item *background;
-
- /* select correct background and text color */
- if (state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->active;
- text.text = style->label_active;
- } else if (state & NK_WIDGET_STATE_HOVER) {
- background = &style->hover;
- text.text = style->label_hover;
- } else {
- background = &style->normal;
- text.text = style->label_normal;
- }
-
- /* draw background */
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, *bounds, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, *bounds, style->rounding, background->data.color);
- nk_stroke_rect(out, *bounds, style->rounding, style->border, background->data.color);
- }
-
- /* draw label */
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, *label, name, len, &text, NK_TEXT_CENTERED, font);
-}
-
-NK_INTERN void
-nk_do_property(nk_flags *ws,
- struct nk_command_buffer *out, struct nk_rect property,
- const char *name, struct nk_property_variant *variant,
- float inc_per_pixel, char *buffer, int *len,
- int *state, int *cursor, int *select_begin, int *select_end,
- const struct nk_style_property *style,
- enum nk_property_filter filter, struct nk_input *in,
- const struct nk_user_font *font, struct nk_text_edit *text_edit,
- enum nk_button_behavior behavior)
-{
- const nk_plugin_filter filters[] = {
- nk_filter_decimal,
- nk_filter_float
- };
- int active, old;
- int num_len, name_len;
- char string[NK_MAX_NUMBER_BUFFER];
- float size;
-
- char *dst = 0;
- int *length;
-
- struct nk_rect left;
- struct nk_rect right;
- struct nk_rect label;
- struct nk_rect edit;
- struct nk_rect empty;
-
- /* left decrement button */
- left.h = font->height/2;
- left.w = left.h;
- left.x = property.x + style->border + style->padding.x;
- left.y = property.y + style->border + property.h/2.0f - left.h/2;
-
- /* text label */
- name_len = nk_strlen(name);
- size = font->width(font->userdata, font->height, name, name_len);
- label.x = left.x + left.w + style->padding.x;
- label.w = (float)size + 2 * style->padding.x;
- label.y = property.y + style->border + style->padding.y;
- label.h = property.h - (2 * style->border + 2 * style->padding.y);
-
- /* right increment button */
- right.y = left.y;
- right.w = left.w;
- right.h = left.h;
- right.x = property.x + property.w - (right.w + style->padding.x);
-
- /* edit */
- if (*state == NK_PROPERTY_EDIT) {
- size = font->width(font->userdata, font->height, buffer, *len);
- size += style->edit.cursor_size;
- length = len;
- dst = buffer;
- } else {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- nk_itoa(string, variant->value.i);
- num_len = nk_strlen(string);
- break;
- case NK_PROPERTY_FLOAT:
- NK_DTOA(string, (double)variant->value.f);
- num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
- break;
- case NK_PROPERTY_DOUBLE:
- NK_DTOA(string, variant->value.d);
- num_len = nk_string_float_limit(string, NK_MAX_FLOAT_PRECISION);
- break;
- }
- size = font->width(font->userdata, font->height, string, num_len);
- dst = string;
- length = &num_len;
- }
-
- edit.w = (float)size + 2 * style->padding.x;
- edit.w = NK_MIN(edit.w, right.x - (label.x + label.w));
- edit.x = right.x - (edit.w + style->padding.x);
- edit.y = property.y + style->border;
- edit.h = property.h - (2 * style->border);
-
- /* empty left space activator */
- empty.w = edit.x - (label.x + label.w);
- empty.x = label.x + label.w;
- empty.y = property.y;
- empty.h = property.h;
-
- /* update property */
- old = (*state == NK_PROPERTY_EDIT);
- nk_property_behavior(ws, in, property, label, edit, empty, state, variant, inc_per_pixel);
-
- /* draw property */
- if (style->draw_begin) style->draw_begin(out, style->userdata);
- nk_draw_property(out, style, &property, &label, *ws, name, name_len, font);
- if (style->draw_end) style->draw_end(out, style->userdata);
-
- /* execute right button */
- if (nk_do_button_symbol(ws, out, left, style->sym_left, behavior, &style->dec_button, in, font)) {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i - variant->step.i, variant->max_value.i); break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f - variant->step.f, variant->max_value.f); break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d - variant->step.d, variant->max_value.d); break;
- }
- }
- /* execute left button */
- if (nk_do_button_symbol(ws, out, right, style->sym_right, behavior, &style->inc_button, in, font)) {
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i + variant->step.i, variant->max_value.i); break;
- case NK_PROPERTY_FLOAT:
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f + variant->step.f, variant->max_value.f); break;
- case NK_PROPERTY_DOUBLE:
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d + variant->step.d, variant->max_value.d); break;
- }
- }
- if (old != NK_PROPERTY_EDIT && (*state == NK_PROPERTY_EDIT)) {
- /* property has been activated so setup buffer */
- NK_MEMCPY(buffer, dst, (nk_size)*length);
- *cursor = nk_utf_len(buffer, *length);
- *len = *length;
- length = len;
- dst = buffer;
- active = 0;
- } else active = (*state == NK_PROPERTY_EDIT);
-
- /* execute and run text edit field */
- nk_textedit_clear_state(text_edit, NK_TEXT_EDIT_SINGLE_LINE, filters[filter]);
- text_edit->active = (unsigned char)active;
- text_edit->string.len = *length;
- text_edit->cursor = NK_CLAMP(0, *cursor, *length);
- text_edit->select_start = NK_CLAMP(0,*select_begin, *length);
- text_edit->select_end = NK_CLAMP(0,*select_end, *length);
- text_edit->string.buffer.allocated = (nk_size)*length;
- text_edit->string.buffer.memory.size = NK_MAX_NUMBER_BUFFER;
- text_edit->string.buffer.memory.ptr = dst;
- text_edit->string.buffer.size = NK_MAX_NUMBER_BUFFER;
- text_edit->mode = NK_TEXT_EDIT_MODE_INSERT;
- nk_do_edit(ws, out, edit, NK_EDIT_FIELD|NK_EDIT_AUTO_SELECT,
- filters[filter], text_edit, &style->edit, (*state == NK_PROPERTY_EDIT) ? in: 0, font);
-
- *length = text_edit->string.len;
- *cursor = text_edit->cursor;
- *select_begin = text_edit->select_start;
- *select_end = text_edit->select_end;
- if (text_edit->active && nk_input_is_key_pressed(in, NK_KEY_ENTER))
- text_edit->active = nk_false;
-
- if (active && !text_edit->active) {
- /* property is now not active so convert edit text to value*/
- *state = NK_PROPERTY_DEFAULT;
- buffer[*len] = '\0';
- switch (variant->kind) {
- default: break;
- case NK_PROPERTY_INT:
- variant->value.i = nk_strtoi(buffer, 0);
- variant->value.i = NK_CLAMP(variant->min_value.i, variant->value.i, variant->max_value.i);
- break;
- case NK_PROPERTY_FLOAT:
- nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
- variant->value.f = nk_strtof(buffer, 0);
- variant->value.f = NK_CLAMP(variant->min_value.f, variant->value.f, variant->max_value.f);
- break;
- case NK_PROPERTY_DOUBLE:
- nk_string_float_limit(buffer, NK_MAX_FLOAT_PRECISION);
- variant->value.d = nk_strtod(buffer, 0);
- variant->value.d = NK_CLAMP(variant->min_value.d, variant->value.d, variant->max_value.d);
- break;
- }
- }
-}
-/* ===============================================================
- *
- * COLOR PICKER
- *
- * ===============================================================*/
-NK_INTERN int
-nk_color_picker_behavior(nk_flags *state,
- const struct nk_rect *bounds, const struct nk_rect *matrix,
- const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
- struct nk_colorf *color, const struct nk_input *in)
-{
- float hsva[4];
- int value_changed = 0;
- int hsv_changed = 0;
-
- NK_ASSERT(state);
- NK_ASSERT(matrix);
- NK_ASSERT(hue_bar);
- NK_ASSERT(color);
-
- /* color matrix */
- nk_colorf_hsva_fv(hsva, *color);
- if (nk_button_behavior(state, *matrix, in, NK_BUTTON_REPEATER)) {
- hsva[1] = NK_SATURATE((in->mouse.pos.x - matrix->x) / (matrix->w-1));
- hsva[2] = 1.0f - NK_SATURATE((in->mouse.pos.y - matrix->y) / (matrix->h-1));
- value_changed = hsv_changed = 1;
- }
- /* hue bar */
- if (nk_button_behavior(state, *hue_bar, in, NK_BUTTON_REPEATER)) {
- hsva[0] = NK_SATURATE((in->mouse.pos.y - hue_bar->y) / (hue_bar->h-1));
- value_changed = hsv_changed = 1;
- }
- /* alpha bar */
- if (alpha_bar) {
- if (nk_button_behavior(state, *alpha_bar, in, NK_BUTTON_REPEATER)) {
- hsva[3] = 1.0f - NK_SATURATE((in->mouse.pos.y - alpha_bar->y) / (alpha_bar->h-1));
- value_changed = 1;
- }
- }
- nk_widget_state_reset(state);
- if (hsv_changed) {
- *color = nk_hsva_colorfv(hsva);
- *state = NK_WIDGET_STATE_ACTIVE;
- }
- if (value_changed) {
- color->a = hsva[3];
- *state = NK_WIDGET_STATE_ACTIVE;
- }
- /* set color picker widget state */
- if (nk_input_is_mouse_hovering_rect(in, *bounds))
- *state = NK_WIDGET_STATE_HOVERED;
- if (*state & NK_WIDGET_STATE_HOVER && !nk_input_is_mouse_prev_hovering_rect(in, *bounds))
- *state |= NK_WIDGET_STATE_ENTERED;
- else if (nk_input_is_mouse_prev_hovering_rect(in, *bounds))
- *state |= NK_WIDGET_STATE_LEFT;
- return value_changed;
-}
-
-NK_INTERN void
-nk_draw_color_picker(struct nk_command_buffer *o, const struct nk_rect *matrix,
- const struct nk_rect *hue_bar, const struct nk_rect *alpha_bar,
- struct nk_colorf col)
-{
- NK_STORAGE const struct nk_color black = {0,0,0,255};
- NK_STORAGE const struct nk_color white = {255, 255, 255, 255};
- NK_STORAGE const struct nk_color black_trans = {0,0,0,0};
-
- const float crosshair_size = 7.0f;
- struct nk_color temp;
- float hsva[4];
- float line_y;
- int i;
-
- NK_ASSERT(o);
- NK_ASSERT(matrix);
- NK_ASSERT(hue_bar);
-
- /* draw hue bar */
- nk_colorf_hsva_fv(hsva, col);
- for (i = 0; i < 6; ++i) {
- NK_GLOBAL const struct nk_color hue_colors[] = {
- {255, 0, 0, 255}, {255,255,0,255}, {0,255,0,255}, {0, 255,255,255},
- {0,0,255,255}, {255, 0, 255, 255}, {255, 0, 0, 255}
- };
- nk_fill_rect_multi_color(o,
- nk_rect(hue_bar->x, hue_bar->y + (float)i * (hue_bar->h/6.0f) + 0.5f,
- hue_bar->w, (hue_bar->h/6.0f) + 0.5f), hue_colors[i], hue_colors[i],
- hue_colors[i+1], hue_colors[i+1]);
- }
- line_y = (float)(int)(hue_bar->y + hsva[0] * matrix->h + 0.5f);
- nk_stroke_line(o, hue_bar->x-1, line_y, hue_bar->x + hue_bar->w + 2,
- line_y, 1, nk_rgb(255,255,255));
-
- /* draw alpha bar */
- if (alpha_bar) {
- float alpha = NK_SATURATE(col.a);
- line_y = (float)(int)(alpha_bar->y + (1.0f - alpha) * matrix->h + 0.5f);
-
- nk_fill_rect_multi_color(o, *alpha_bar, white, white, black, black);
- nk_stroke_line(o, alpha_bar->x-1, line_y, alpha_bar->x + alpha_bar->w + 2,
- line_y, 1, nk_rgb(255,255,255));
- }
-
- /* draw color matrix */
- temp = nk_hsv_f(hsva[0], 1.0f, 1.0f);
- nk_fill_rect_multi_color(o, *matrix, white, temp, temp, white);
- nk_fill_rect_multi_color(o, *matrix, black_trans, black_trans, black, black);
-
- /* draw cross-hair */
- {struct nk_vec2 p; float S = hsva[1]; float V = hsva[2];
- p.x = (float)(int)(matrix->x + S * matrix->w);
- p.y = (float)(int)(matrix->y + (1.0f - V) * matrix->h);
- nk_stroke_line(o, p.x - crosshair_size, p.y, p.x-2, p.y, 1.0f, white);
- nk_stroke_line(o, p.x + crosshair_size + 1, p.y, p.x+3, p.y, 1.0f, white);
- nk_stroke_line(o, p.x, p.y + crosshair_size + 1, p.x, p.y+3, 1.0f, white);
- nk_stroke_line(o, p.x, p.y - crosshair_size, p.x, p.y-2, 1.0f, white);}
-}
-
-NK_INTERN int
-nk_do_color_picker(nk_flags *state,
- struct nk_command_buffer *out, struct nk_colorf *col,
- enum nk_color_format fmt, struct nk_rect bounds,
- struct nk_vec2 padding, const struct nk_input *in,
- const struct nk_user_font *font)
-{
- int ret = 0;
- struct nk_rect matrix;
- struct nk_rect hue_bar;
- struct nk_rect alpha_bar;
- float bar_w;
-
- NK_ASSERT(out);
- NK_ASSERT(col);
- NK_ASSERT(state);
- NK_ASSERT(font);
- if (!out || !col || !state || !font)
- return ret;
-
- bar_w = font->height;
- bounds.x += padding.x;
- bounds.y += padding.x;
- bounds.w -= 2 * padding.x;
- bounds.h -= 2 * padding.y;
-
- matrix.x = bounds.x;
- matrix.y = bounds.y;
- matrix.h = bounds.h;
- matrix.w = bounds.w - (3 * padding.x + 2 * bar_w);
-
- hue_bar.w = bar_w;
- hue_bar.y = bounds.y;
- hue_bar.h = matrix.h;
- hue_bar.x = matrix.x + matrix.w + padding.x;
-
- alpha_bar.x = hue_bar.x + hue_bar.w + padding.x;
- alpha_bar.y = bounds.y;
- alpha_bar.w = bar_w;
- alpha_bar.h = matrix.h;
-
- ret = nk_color_picker_behavior(state, &bounds, &matrix, &hue_bar,
- (fmt == NK_RGBA) ? &alpha_bar:0, col, in);
- nk_draw_color_picker(out, &matrix, &hue_bar, (fmt == NK_RGBA) ? &alpha_bar:0, *col);
- return ret;
-}
-
-/* ==============================================================
- *
- * STYLE
- *
- * ===============================================================*/
-NK_API void nk_style_default(struct nk_context *ctx){nk_style_from_table(ctx, 0);}
-#define NK_COLOR_MAP(NK_COLOR)\
- NK_COLOR(NK_COLOR_TEXT, 175,175,175,255) \
- NK_COLOR(NK_COLOR_WINDOW, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_HEADER, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_BORDER, 65, 65, 65, 255) \
- NK_COLOR(NK_COLOR_BUTTON, 50, 50, 50, 255) \
- NK_COLOR(NK_COLOR_BUTTON_HOVER, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_BUTTON_ACTIVE, 35, 35, 35, 255) \
- NK_COLOR(NK_COLOR_TOGGLE, 100,100,100,255) \
- NK_COLOR(NK_COLOR_TOGGLE_HOVER, 120,120,120,255) \
- NK_COLOR(NK_COLOR_TOGGLE_CURSOR, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_SELECT, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_SELECT_ACTIVE, 35, 35, 35,255) \
- NK_COLOR(NK_COLOR_SLIDER, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR, 100,100,100,255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR_HOVER, 120,120,120,255) \
- NK_COLOR(NK_COLOR_SLIDER_CURSOR_ACTIVE, 150,150,150,255) \
- NK_COLOR(NK_COLOR_PROPERTY, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_EDIT, 38, 38, 38, 255) \
- NK_COLOR(NK_COLOR_EDIT_CURSOR, 175,175,175,255) \
- NK_COLOR(NK_COLOR_COMBO, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_CHART, 120,120,120,255) \
- NK_COLOR(NK_COLOR_CHART_COLOR, 45, 45, 45, 255) \
- NK_COLOR(NK_COLOR_CHART_COLOR_HIGHLIGHT,255, 0, 0, 255) \
- NK_COLOR(NK_COLOR_SCROLLBAR, 40, 40, 40, 255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR, 100,100,100,255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_HOVER,120,120,120,255) \
- NK_COLOR(NK_COLOR_SCROLLBAR_CURSOR_ACTIVE,150,150,150,255) \
- NK_COLOR(NK_COLOR_TAB_HEADER, 40, 40, 40,255)
-
-NK_GLOBAL const struct nk_color
-nk_default_color_style[NK_COLOR_COUNT] = {
-#define NK_COLOR(a,b,c,d,e) {b,c,d,e},
- NK_COLOR_MAP(NK_COLOR)
-#undef NK_COLOR
-};
-
-NK_GLOBAL const char *nk_color_names[NK_COLOR_COUNT] = {
-#define NK_COLOR(a,b,c,d,e) #a,
- NK_COLOR_MAP(NK_COLOR)
-#undef NK_COLOR
-};
-
-NK_API const char *nk_style_get_color_by_name(enum nk_style_colors c)
-{return nk_color_names[c];}
-
-NK_API struct nk_style_item nk_style_item_image(struct nk_image img)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_IMAGE; i.data.image = img; return i;}
-
-NK_API struct nk_style_item nk_style_item_color(struct nk_color col)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_COLOR; i.data.color = col; return i;}
-
-NK_API struct nk_style_item nk_style_item_hide(void)
-{struct nk_style_item i; i.type = NK_STYLE_ITEM_COLOR; i.data.color = nk_rgba(0,0,0,0); return i;}
-
-NK_API void
-nk_style_from_table(struct nk_context *ctx, const struct nk_color *table)
-{
- struct nk_style *style;
- struct nk_style_text *text;
- struct nk_style_button *button;
- struct nk_style_toggle *toggle;
- struct nk_style_selectable *select;
- struct nk_style_slider *slider;
- struct nk_style_progress *prog;
- struct nk_style_scrollbar *scroll;
- struct nk_style_edit *edit;
- struct nk_style_property *property;
- struct nk_style_combo *combo;
- struct nk_style_chart *chart;
- struct nk_style_tab *tab;
- struct nk_style_window *win;
-
- NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- table = (!table) ? nk_default_color_style: table;
-
- /* default text */
- text = &style->text;
- text->color = table[NK_COLOR_TEXT];
- text->padding = nk_vec2(0,0);
-
- /* default button */
- button = &style->button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_BUTTON]);
- button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
- button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
- button->border_color = table[NK_COLOR_BORDER];
- button->text_background = table[NK_COLOR_BUTTON];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->image_padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f, 0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 4.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* contextual button */
- button = &style->contextual_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_BUTTON_HOVER]);
- button->active = nk_style_item_color(table[NK_COLOR_BUTTON_ACTIVE]);
- button->border_color = table[NK_COLOR_WINDOW];
- button->text_background = table[NK_COLOR_WINDOW];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* menu button */
- button = &style->menu_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->border_color = table[NK_COLOR_WINDOW];
- button->text_background = table[NK_COLOR_WINDOW];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 1.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* checkbox toggle */
- toggle = &style->checkbox;
- nk_zero_struct(*toggle);
- toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
- toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->userdata = nk_handle_ptr(0);
- toggle->text_background = table[NK_COLOR_WINDOW];
- toggle->text_normal = table[NK_COLOR_TEXT];
- toggle->text_hover = table[NK_COLOR_TEXT];
- toggle->text_active = table[NK_COLOR_TEXT];
- toggle->padding = nk_vec2(2.0f, 2.0f);
- toggle->touch_padding = nk_vec2(0,0);
- toggle->border_color = nk_rgba(0,0,0,0);
- toggle->border = 0.0f;
- toggle->spacing = 4;
-
- /* option toggle */
- toggle = &style->option;
- nk_zero_struct(*toggle);
- toggle->normal = nk_style_item_color(table[NK_COLOR_TOGGLE]);
- toggle->hover = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->active = nk_style_item_color(table[NK_COLOR_TOGGLE_HOVER]);
- toggle->cursor_normal = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->cursor_hover = nk_style_item_color(table[NK_COLOR_TOGGLE_CURSOR]);
- toggle->userdata = nk_handle_ptr(0);
- toggle->text_background = table[NK_COLOR_WINDOW];
- toggle->text_normal = table[NK_COLOR_TEXT];
- toggle->text_hover = table[NK_COLOR_TEXT];
- toggle->text_active = table[NK_COLOR_TEXT];
- toggle->padding = nk_vec2(3.0f, 3.0f);
- toggle->touch_padding = nk_vec2(0,0);
- toggle->border_color = nk_rgba(0,0,0,0);
- toggle->border = 0.0f;
- toggle->spacing = 4;
-
- /* selectable */
- select = &style->selectable;
- nk_zero_struct(*select);
- select->normal = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->hover = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->pressed = nk_style_item_color(table[NK_COLOR_SELECT]);
- select->normal_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->hover_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->pressed_active = nk_style_item_color(table[NK_COLOR_SELECT_ACTIVE]);
- select->text_normal = table[NK_COLOR_TEXT];
- select->text_hover = table[NK_COLOR_TEXT];
- select->text_pressed = table[NK_COLOR_TEXT];
- select->text_normal_active = table[NK_COLOR_TEXT];
- select->text_hover_active = table[NK_COLOR_TEXT];
- select->text_pressed_active = table[NK_COLOR_TEXT];
- select->padding = nk_vec2(2.0f,2.0f);
- select->touch_padding = nk_vec2(0,0);
- select->userdata = nk_handle_ptr(0);
- select->rounding = 0.0f;
- select->draw_begin = 0;
- select->draw_end = 0;
-
- /* slider */
- slider = &style->slider;
- nk_zero_struct(*slider);
- slider->normal = nk_style_item_hide();
- slider->hover = nk_style_item_hide();
- slider->active = nk_style_item_hide();
- slider->bar_normal = table[NK_COLOR_SLIDER];
- slider->bar_hover = table[NK_COLOR_SLIDER];
- slider->bar_active = table[NK_COLOR_SLIDER];
- slider->bar_filled = table[NK_COLOR_SLIDER_CURSOR];
- slider->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
- slider->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
- slider->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
- slider->inc_symbol = NK_SYMBOL_TRIANGLE_RIGHT;
- slider->dec_symbol = NK_SYMBOL_TRIANGLE_LEFT;
- slider->cursor_size = nk_vec2(16,16);
- slider->padding = nk_vec2(2,2);
- slider->spacing = nk_vec2(2,2);
- slider->userdata = nk_handle_ptr(0);
- slider->show_buttons = nk_false;
- slider->bar_height = 8;
- slider->rounding = 0;
- slider->draw_begin = 0;
- slider->draw_end = 0;
-
- /* slider buttons */
- button = &style->slider.inc_button;
- button->normal = nk_style_item_color(nk_rgb(40,40,40));
- button->hover = nk_style_item_color(nk_rgb(42,42,42));
- button->active = nk_style_item_color(nk_rgb(44,44,44));
- button->border_color = nk_rgb(65,65,65);
- button->text_background = nk_rgb(40,40,40);
- button->text_normal = nk_rgb(175,175,175);
- button->text_hover = nk_rgb(175,175,175);
- button->text_active = nk_rgb(175,175,175);
- button->padding = nk_vec2(8.0f,8.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->slider.dec_button = style->slider.inc_button;
-
- /* progressbar */
- prog = &style->progress;
- nk_zero_struct(*prog);
- prog->normal = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->hover = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->active = nk_style_item_color(table[NK_COLOR_SLIDER]);
- prog->cursor_normal = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR]);
- prog->cursor_hover = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_HOVER]);
- prog->cursor_active = nk_style_item_color(table[NK_COLOR_SLIDER_CURSOR_ACTIVE]);
- prog->border_color = nk_rgba(0,0,0,0);
- prog->cursor_border_color = nk_rgba(0,0,0,0);
- prog->userdata = nk_handle_ptr(0);
- prog->padding = nk_vec2(4,4);
- prog->rounding = 0;
- prog->border = 0;
- prog->cursor_rounding = 0;
- prog->cursor_border = 0;
- prog->draw_begin = 0;
- prog->draw_end = 0;
-
- /* scrollbars */
- scroll = &style->scrollh;
- nk_zero_struct(*scroll);
- scroll->normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->active = nk_style_item_color(table[NK_COLOR_SCROLLBAR]);
- scroll->cursor_normal = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR]);
- scroll->cursor_hover = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_HOVER]);
- scroll->cursor_active = nk_style_item_color(table[NK_COLOR_SCROLLBAR_CURSOR_ACTIVE]);
- scroll->dec_symbol = NK_SYMBOL_CIRCLE_SOLID;
- scroll->inc_symbol = NK_SYMBOL_CIRCLE_SOLID;
- scroll->userdata = nk_handle_ptr(0);
- scroll->border_color = table[NK_COLOR_SCROLLBAR];
- scroll->cursor_border_color = table[NK_COLOR_SCROLLBAR];
- scroll->padding = nk_vec2(0,0);
- scroll->show_buttons = nk_false;
- scroll->border = 0;
- scroll->rounding = 0;
- scroll->border_cursor = 0;
- scroll->rounding_cursor = 0;
- scroll->draw_begin = 0;
- scroll->draw_end = 0;
- style->scrollv = style->scrollh;
-
- /* scrollbars buttons */
- button = &style->scrollh.inc_button;
- button->normal = nk_style_item_color(nk_rgb(40,40,40));
- button->hover = nk_style_item_color(nk_rgb(42,42,42));
- button->active = nk_style_item_color(nk_rgb(44,44,44));
- button->border_color = nk_rgb(65,65,65);
- button->text_background = nk_rgb(40,40,40);
- button->text_normal = nk_rgb(175,175,175);
- button->text_hover = nk_rgb(175,175,175);
- button->text_active = nk_rgb(175,175,175);
- button->padding = nk_vec2(4.0f,4.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 1.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->scrollh.dec_button = style->scrollh.inc_button;
- style->scrollv.inc_button = style->scrollh.inc_button;
- style->scrollv.dec_button = style->scrollh.inc_button;
-
- /* edit */
- edit = &style->edit;
- nk_zero_struct(*edit);
- edit->normal = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->hover = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->active = nk_style_item_color(table[NK_COLOR_EDIT]);
- edit->cursor_normal = table[NK_COLOR_TEXT];
- edit->cursor_hover = table[NK_COLOR_TEXT];
- edit->cursor_text_normal= table[NK_COLOR_EDIT];
- edit->cursor_text_hover = table[NK_COLOR_EDIT];
- edit->border_color = table[NK_COLOR_BORDER];
- edit->text_normal = table[NK_COLOR_TEXT];
- edit->text_hover = table[NK_COLOR_TEXT];
- edit->text_active = table[NK_COLOR_TEXT];
- edit->selected_normal = table[NK_COLOR_TEXT];
- edit->selected_hover = table[NK_COLOR_TEXT];
- edit->selected_text_normal = table[NK_COLOR_EDIT];
- edit->selected_text_hover = table[NK_COLOR_EDIT];
- edit->scrollbar_size = nk_vec2(10,10);
- edit->scrollbar = style->scrollv;
- edit->padding = nk_vec2(4,4);
- edit->row_padding = 2;
- edit->cursor_size = 4;
- edit->border = 1;
- edit->rounding = 0;
-
- /* property */
- property = &style->property;
- nk_zero_struct(*property);
- property->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- property->border_color = table[NK_COLOR_BORDER];
- property->label_normal = table[NK_COLOR_TEXT];
- property->label_hover = table[NK_COLOR_TEXT];
- property->label_active = table[NK_COLOR_TEXT];
- property->sym_left = NK_SYMBOL_TRIANGLE_LEFT;
- property->sym_right = NK_SYMBOL_TRIANGLE_RIGHT;
- property->userdata = nk_handle_ptr(0);
- property->padding = nk_vec2(4,4);
- property->border = 1;
- property->rounding = 10;
- property->draw_begin = 0;
- property->draw_end = 0;
-
- /* property buttons */
- button = &style->property.dec_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_PROPERTY];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->property.inc_button = style->property.dec_button;
-
- /* property edit */
- edit = &style->property.edit;
- nk_zero_struct(*edit);
- edit->normal = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->hover = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->active = nk_style_item_color(table[NK_COLOR_PROPERTY]);
- edit->border_color = nk_rgba(0,0,0,0);
- edit->cursor_normal = table[NK_COLOR_TEXT];
- edit->cursor_hover = table[NK_COLOR_TEXT];
- edit->cursor_text_normal= table[NK_COLOR_EDIT];
- edit->cursor_text_hover = table[NK_COLOR_EDIT];
- edit->text_normal = table[NK_COLOR_TEXT];
- edit->text_hover = table[NK_COLOR_TEXT];
- edit->text_active = table[NK_COLOR_TEXT];
- edit->selected_normal = table[NK_COLOR_TEXT];
- edit->selected_hover = table[NK_COLOR_TEXT];
- edit->selected_text_normal = table[NK_COLOR_EDIT];
- edit->selected_text_hover = table[NK_COLOR_EDIT];
- edit->padding = nk_vec2(0,0);
- edit->cursor_size = 8;
- edit->border = 0;
- edit->rounding = 0;
-
- /* chart */
- chart = &style->chart;
- nk_zero_struct(*chart);
- chart->background = nk_style_item_color(table[NK_COLOR_CHART]);
- chart->border_color = table[NK_COLOR_BORDER];
- chart->selected_color = table[NK_COLOR_CHART_COLOR_HIGHLIGHT];
- chart->color = table[NK_COLOR_CHART_COLOR];
- chart->padding = nk_vec2(4,4);
- chart->border = 0;
- chart->rounding = 0;
-
- /* combo */
- combo = &style->combo;
- combo->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->active = nk_style_item_color(table[NK_COLOR_COMBO]);
- combo->border_color = table[NK_COLOR_BORDER];
- combo->label_normal = table[NK_COLOR_TEXT];
- combo->label_hover = table[NK_COLOR_TEXT];
- combo->label_active = table[NK_COLOR_TEXT];
- combo->sym_normal = NK_SYMBOL_TRIANGLE_DOWN;
- combo->sym_hover = NK_SYMBOL_TRIANGLE_DOWN;
- combo->sym_active = NK_SYMBOL_TRIANGLE_DOWN;
- combo->content_padding = nk_vec2(4,4);
- combo->button_padding = nk_vec2(0,4);
- combo->spacing = nk_vec2(4,0);
- combo->border = 1;
- combo->rounding = 0;
-
- /* combo button */
- button = &style->combo.button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->hover = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->active = nk_style_item_color(table[NK_COLOR_COMBO]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_COMBO];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* tab */
- tab = &style->tab;
- tab->background = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- tab->border_color = table[NK_COLOR_BORDER];
- tab->text = table[NK_COLOR_TEXT];
- tab->sym_minimize = NK_SYMBOL_TRIANGLE_RIGHT;
- tab->sym_maximize = NK_SYMBOL_TRIANGLE_DOWN;
- tab->padding = nk_vec2(4,4);
- tab->spacing = nk_vec2(4,4);
- tab->indent = 10.0f;
- tab->border = 1;
- tab->rounding = 0;
-
- /* tab button */
- button = &style->tab.tab_minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_TAB_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_TAB_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->tab.tab_maximize_button =*button;
-
- /* node button */
- button = &style->tab.node_minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->hover = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->active = nk_style_item_color(table[NK_COLOR_WINDOW]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_TAB_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(2.0f,2.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
- style->tab.node_maximize_button =*button;
-
- /* window header */
- win = &style->window;
- win->header.align = NK_HEADER_RIGHT;
- win->header.close_symbol = NK_SYMBOL_X;
- win->header.minimize_symbol = NK_SYMBOL_MINUS;
- win->header.maximize_symbol = NK_SYMBOL_PLUS;
- win->header.normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.active = nk_style_item_color(table[NK_COLOR_HEADER]);
- win->header.label_normal = table[NK_COLOR_TEXT];
- win->header.label_hover = table[NK_COLOR_TEXT];
- win->header.label_active = table[NK_COLOR_TEXT];
- win->header.label_padding = nk_vec2(4,4);
- win->header.padding = nk_vec2(4,4);
- win->header.spacing = nk_vec2(0,0);
-
- /* window header close button */
- button = &style->window.header.close_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* window header minimize button */
- button = &style->window.header.minimize_button;
- nk_zero_struct(*button);
- button->normal = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->hover = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->active = nk_style_item_color(table[NK_COLOR_HEADER]);
- button->border_color = nk_rgba(0,0,0,0);
- button->text_background = table[NK_COLOR_HEADER];
- button->text_normal = table[NK_COLOR_TEXT];
- button->text_hover = table[NK_COLOR_TEXT];
- button->text_active = table[NK_COLOR_TEXT];
- button->padding = nk_vec2(0.0f,0.0f);
- button->touch_padding = nk_vec2(0.0f,0.0f);
- button->userdata = nk_handle_ptr(0);
- button->text_alignment = NK_TEXT_CENTERED;
- button->border = 0.0f;
- button->rounding = 0.0f;
- button->draw_begin = 0;
- button->draw_end = 0;
-
- /* window */
- win->background = table[NK_COLOR_WINDOW];
- win->fixed_background = nk_style_item_color(table[NK_COLOR_WINDOW]);
- win->border_color = table[NK_COLOR_BORDER];
- win->popup_border_color = table[NK_COLOR_BORDER];
- win->combo_border_color = table[NK_COLOR_BORDER];
- win->contextual_border_color = table[NK_COLOR_BORDER];
- win->menu_border_color = table[NK_COLOR_BORDER];
- win->group_border_color = table[NK_COLOR_BORDER];
- win->tooltip_border_color = table[NK_COLOR_BORDER];
- win->scaler = nk_style_item_color(table[NK_COLOR_TEXT]);
-
- win->rounding = 0.0f;
- win->spacing = nk_vec2(4,4);
- win->scrollbar_size = nk_vec2(10,10);
- win->min_size = nk_vec2(64,64);
-
- win->combo_border = 1.0f;
- win->contextual_border = 1.0f;
- win->menu_border = 1.0f;
- win->group_border = 1.0f;
- win->tooltip_border = 1.0f;
- win->popup_border = 1.0f;
- win->border = 2.0f;
- win->min_row_height_padding = 8;
-
- win->padding = nk_vec2(4,4);
- win->group_padding = nk_vec2(4,4);
- win->popup_padding = nk_vec2(4,4);
- win->combo_padding = nk_vec2(4,4);
- win->contextual_padding = nk_vec2(4,4);
- win->menu_padding = nk_vec2(4,4);
- win->tooltip_padding = nk_vec2(4,4);
-}
-
-NK_API void
-nk_style_set_font(struct nk_context *ctx, const struct nk_user_font *font)
-{
- struct nk_style *style;
- NK_ASSERT(ctx);
-
- if (!ctx) return;
- style = &ctx->style;
- style->font = font;
- ctx->stacks.fonts.head = 0;
- if (ctx->current)
- nk_layout_reset_min_row_height(ctx);
-}
-
-NK_API int
-nk_style_push_font(struct nk_context *ctx, const struct nk_user_font *font)
-{
- struct nk_config_stack_user_font *font_stack;
- struct nk_config_stack_user_font_element *element;
-
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- font_stack = &ctx->stacks.fonts;
- NK_ASSERT(font_stack->head < (int)NK_LEN(font_stack->elements));
- if (font_stack->head >= (int)NK_LEN(font_stack->elements))
- return 0;
-
- element = &font_stack->elements[font_stack->head++];
- element->address = &ctx->style.font;
- element->old_value = ctx->style.font;
- ctx->style.font = font;
- return 1;
-}
-
-NK_API int
-nk_style_pop_font(struct nk_context *ctx)
-{
- struct nk_config_stack_user_font *font_stack;
- struct nk_config_stack_user_font_element *element;
-
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- font_stack = &ctx->stacks.fonts;
- NK_ASSERT(font_stack->head > 0);
- if (font_stack->head < 1)
- return 0;
-
- element = &font_stack->elements[--font_stack->head];
- *element->address = element->old_value;
- return 1;
-}
-
-#define NK_STYLE_PUSH_IMPLEMENATION(prefix, type, stack) \
-nk_style_push_##type(struct nk_context *ctx, prefix##_##type *address, prefix##_##type value)\
-{\
- struct nk_config_stack_##type * type_stack;\
- struct nk_config_stack_##type##_element *element;\
- NK_ASSERT(ctx);\
- if (!ctx) return 0;\
- type_stack = &ctx->stacks.stack;\
- NK_ASSERT(type_stack->head < (int)NK_LEN(type_stack->elements));\
- if (type_stack->head >= (int)NK_LEN(type_stack->elements))\
- return 0;\
- element = &type_stack->elements[type_stack->head++];\
- element->address = address;\
- element->old_value = *address;\
- *address = value;\
- return 1;\
-}
-
-#define NK_STYLE_POP_IMPLEMENATION(type, stack) \
-nk_style_pop_##type(struct nk_context *ctx)\
-{\
- struct nk_config_stack_##type *type_stack;\
- struct nk_config_stack_##type##_element *element;\
- NK_ASSERT(ctx);\
- if (!ctx) return 0;\
- type_stack = &ctx->stacks.stack;\
- NK_ASSERT(type_stack->head > 0);\
- if (type_stack->head < 1)\
- return 0;\
- element = &type_stack->elements[--type_stack->head];\
- *element->address = element->old_value;\
- return 1;\
-}
-
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, style_item, style_items)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,float, floats)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk, vec2, vectors)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(nk,flags, flags)
-NK_API int NK_STYLE_PUSH_IMPLEMENATION(struct nk,color, colors)
-
-NK_API int NK_STYLE_POP_IMPLEMENATION(style_item, style_items)
-NK_API int NK_STYLE_POP_IMPLEMENATION(float,floats)
-NK_API int NK_STYLE_POP_IMPLEMENATION(vec2, vectors)
-NK_API int NK_STYLE_POP_IMPLEMENATION(flags,flags)
-NK_API int NK_STYLE_POP_IMPLEMENATION(color,colors)
-
-NK_API int
-nk_style_set_cursor(struct nk_context *ctx, enum nk_style_cursor c)
-{
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- style = &ctx->style;
- if (style->cursors[c]) {
- style->cursor_active = style->cursors[c];
- return 1;
- }
- return 0;
-}
-
-NK_API void
-nk_style_show_cursor(struct nk_context *ctx)
-{
- ctx->style.cursor_visible = nk_true;
-}
-
-NK_API void
-nk_style_hide_cursor(struct nk_context *ctx)
-{
- ctx->style.cursor_visible = nk_false;
-}
-
-NK_API void
-nk_style_load_cursor(struct nk_context *ctx, enum nk_style_cursor cursor,
- const struct nk_cursor *c)
-{
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- style->cursors[cursor] = c;
-}
-
-NK_API void
-nk_style_load_all_cursors(struct nk_context *ctx, struct nk_cursor *cursors)
-{
- int i = 0;
- struct nk_style *style;
- NK_ASSERT(ctx);
- if (!ctx) return;
- style = &ctx->style;
- for (i = 0; i < NK_CURSOR_COUNT; ++i)
- style->cursors[i] = &cursors[i];
- style->cursor_visible = nk_true;
-}
-
-/* ===============================================================
- *
- * POOL
- *
- * ===============================================================*/
-NK_INTERN void
-nk_pool_init(struct nk_pool *pool, struct nk_allocator *alloc,
- unsigned int capacity)
-{
- nk_zero(pool, sizeof(*pool));
- pool->alloc = *alloc;
- pool->capacity = capacity;
- pool->type = NK_BUFFER_DYNAMIC;
- pool->pages = 0;
-}
-
-NK_INTERN void
-nk_pool_free(struct nk_pool *pool)
-{
- struct nk_page *iter = pool->pages;
- if (!pool) return;
- if (pool->type == NK_BUFFER_FIXED) return;
- while (iter) {
- struct nk_page *next = iter->next;
- pool->alloc.free(pool->alloc.userdata, iter);
- iter = next;
- }
-}
-
-NK_INTERN void
-nk_pool_init_fixed(struct nk_pool *pool, void *memory, nk_size size)
-{
- nk_zero(pool, sizeof(*pool));
- NK_ASSERT(size >= sizeof(struct nk_page));
- if (size < sizeof(struct nk_page)) return;
- pool->capacity = (unsigned)(size - sizeof(struct nk_page)) / sizeof(struct nk_page_element);
- pool->pages = (struct nk_page*)memory;
- pool->type = NK_BUFFER_FIXED;
- pool->size = size;
-}
-
-NK_INTERN struct nk_page_element*
-nk_pool_alloc(struct nk_pool *pool)
-{
- if (!pool->pages || pool->pages->size >= pool->capacity) {
- /* allocate new page */
- struct nk_page *page;
- if (pool->type == NK_BUFFER_FIXED) {
- if (!pool->pages) {
- NK_ASSERT(pool->pages);
- return 0;
- }
- NK_ASSERT(pool->pages->size < pool->capacity);
- return 0;
- } else {
- nk_size size = sizeof(struct nk_page);
- size += NK_POOL_DEFAULT_CAPACITY * sizeof(union nk_page_data);
- page = (struct nk_page*)pool->alloc.alloc(pool->alloc.userdata,0, size);
- page->next = pool->pages;
- pool->pages = page;
- page->size = 0;
- }
- }
- return &pool->pages->win[pool->pages->size++];
-}
-
-/* ===============================================================
- *
- * CONTEXT
- *
- * ===============================================================*/
-NK_INTERN void* nk_create_window(struct nk_context *ctx);
-NK_INTERN void nk_remove_window(struct nk_context*, struct nk_window*);
-NK_INTERN void nk_free_window(struct nk_context *ctx, struct nk_window *win);
-NK_INTERN void nk_free_table(struct nk_context *ctx, struct nk_table *tbl);
-NK_INTERN void nk_remove_table(struct nk_window *win, struct nk_table *tbl);
-NK_INTERN void* nk_create_panel(struct nk_context *ctx);
-NK_INTERN void nk_free_panel(struct nk_context*, struct nk_panel *pan);
-
-NK_INTERN void
-nk_setup(struct nk_context *ctx, const struct nk_user_font *font)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_zero_struct(*ctx);
- nk_style_default(ctx);
- ctx->seq = 1;
- if (font) ctx->style.font = font;
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- nk_draw_list_init(&ctx->draw_list);
-#endif
-}
-
-#ifdef NK_INCLUDE_DEFAULT_ALLOCATOR
-NK_API int
-nk_init_default(struct nk_context *ctx, const struct nk_user_font *font)
-{
- struct nk_allocator alloc;
- alloc.userdata.ptr = 0;
- alloc.alloc = nk_malloc;
- alloc.free = nk_mfree;
- return nk_init(ctx, &alloc, font);
-}
-#endif
-
-NK_API int
-nk_init_fixed(struct nk_context *ctx, void *memory, nk_size size,
- const struct nk_user_font *font)
-{
- NK_ASSERT(memory);
- if (!memory) return 0;
- nk_setup(ctx, font);
- nk_buffer_init_fixed(&ctx->memory, memory, size);
- ctx->use_pool = nk_false;
- return 1;
-}
-
-NK_API int
-nk_init_custom(struct nk_context *ctx, struct nk_buffer *cmds,
- struct nk_buffer *pool, const struct nk_user_font *font)
-{
- NK_ASSERT(cmds);
- NK_ASSERT(pool);
- if (!cmds || !pool) return 0;
-
- nk_setup(ctx, font);
- ctx->memory = *cmds;
- if (pool->type == NK_BUFFER_FIXED) {
- /* take memory from buffer and alloc fixed pool */
- nk_pool_init_fixed(&ctx->pool, pool->memory.ptr, pool->memory.size);
- } else {
- /* create dynamic pool from buffer allocator */
- struct nk_allocator *alloc = &pool->pool;
- nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
- }
- ctx->use_pool = nk_true;
- return 1;
-}
-
-NK_API int
-nk_init(struct nk_context *ctx, struct nk_allocator *alloc,
- const struct nk_user_font *font)
-{
- NK_ASSERT(alloc);
- if (!alloc) return 0;
- nk_setup(ctx, font);
- nk_buffer_init(&ctx->memory, alloc, NK_DEFAULT_COMMAND_BUFFER_SIZE);
- nk_pool_init(&ctx->pool, alloc, NK_POOL_DEFAULT_CAPACITY);
- ctx->use_pool = nk_true;
- return 1;
-}
-
-#ifdef NK_INCLUDE_COMMAND_USERDATA
-NK_API void
-nk_set_user_data(struct nk_context *ctx, nk_handle handle)
-{
- if (!ctx) return;
- ctx->userdata = handle;
- if (ctx->current)
- ctx->current->buffer.userdata = handle;
-}
-#endif
-
-NK_API void
-nk_free(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_buffer_free(&ctx->memory);
- if (ctx->use_pool)
- nk_pool_free(&ctx->pool);
-
- nk_zero(&ctx->input, sizeof(ctx->input));
- nk_zero(&ctx->style, sizeof(ctx->style));
- nk_zero(&ctx->memory, sizeof(ctx->memory));
-
- ctx->seq = 0;
- ctx->build = 0;
- ctx->begin = 0;
- ctx->end = 0;
- ctx->active = 0;
- ctx->current = 0;
- ctx->freelist = 0;
- ctx->count = 0;
-}
-
-NK_API void
-nk_clear(struct nk_context *ctx)
-{
- struct nk_window *iter;
- struct nk_window *next;
- NK_ASSERT(ctx);
-
- if (!ctx) return;
- if (ctx->use_pool)
- nk_buffer_clear(&ctx->memory);
- else nk_buffer_reset(&ctx->memory, NK_BUFFER_FRONT);
-
- ctx->build = 0;
- ctx->memory.calls = 0;
- ctx->last_widget_state = 0;
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
- NK_MEMSET(&ctx->overlay, 0, sizeof(ctx->overlay));
-#ifdef NK_INCLUDE_VERTEX_BUFFER_OUTPUT
- nk_draw_list_clear(&ctx->draw_list);
-#endif
-
- /* garbage collector */
- iter = ctx->begin;
- while (iter) {
- /* make sure valid minimized windows do not get removed */
- if ((iter->flags & NK_WINDOW_MINIMIZED) &&
- !(iter->flags & NK_WINDOW_CLOSED) &&
- iter->seq == ctx->seq) {
- iter = iter->next;
- continue;
- }
- /* remove hotness from hidden or closed windows*/
- if (((iter->flags & NK_WINDOW_HIDDEN) ||
- (iter->flags & NK_WINDOW_CLOSED)) &&
- iter == ctx->active) {
- ctx->active = iter->prev;
- ctx->end = iter->prev;
- if (!ctx->end)
- ctx->begin = 0;
- if (ctx->active)
- ctx->active->flags &= ~(unsigned)NK_WINDOW_ROM;
- }
- /* free unused popup windows */
- if (iter->popup.win && iter->popup.win->seq != ctx->seq) {
- nk_free_window(ctx, iter->popup.win);
- iter->popup.win = 0;
- }
- /* remove unused window state tables */
- {struct nk_table *n, *it = iter->tables;
- while (it) {
- n = it->next;
- if (it->seq != ctx->seq) {
- nk_remove_table(iter, it);
- nk_zero(it, sizeof(union nk_page_data));
- nk_free_table(ctx, it);
- if (it == iter->tables)
- iter->tables = n;
- } it = n;
- }}
- /* window itself is not used anymore so free */
- if (iter->seq != ctx->seq || iter->flags & NK_WINDOW_CLOSED) {
- next = iter->next;
- nk_remove_window(ctx, iter);
- nk_free_window(ctx, iter);
- iter = next;
- } else iter = iter->next;
- }
- ctx->seq++;
-}
-
-/* ----------------------------------------------------------------
- *
- * BUFFERING
- *
- * ---------------------------------------------------------------*/
-NK_INTERN void
-nk_start_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(buffer);
- if (!ctx || !buffer) return;
- buffer->begin = ctx->memory.allocated;
- buffer->end = buffer->begin;
- buffer->last = buffer->begin;
- buffer->clip = nk_null_rect;
-}
-
-NK_INTERN void
-nk_start(struct nk_context *ctx, struct nk_window *win)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- nk_start_buffer(ctx, &win->buffer);
-}
-
-NK_INTERN void
-nk_start_popup(struct nk_context *ctx, struct nk_window *win)
-{
- struct nk_popup_buffer *buf;
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
-
- /* save buffer fill state for popup */
- buf = &win->popup.buf;
- buf->begin = win->buffer.end;
- buf->end = win->buffer.end;
- buf->parent = win->buffer.last;
- buf->last = buf->begin;
- buf->active = nk_true;
-}
-
-NK_INTERN void
-nk_finish_popup(struct nk_context *ctx, struct nk_window *win)
-{
- struct nk_popup_buffer *buf;
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
-
- buf = &win->popup.buf;
- buf->last = win->buffer.last;
- buf->end = win->buffer.end;
-}
-
-NK_INTERN void
-nk_finish_buffer(struct nk_context *ctx, struct nk_command_buffer *buffer)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(buffer);
- if (!ctx || !buffer) return;
- buffer->end = ctx->memory.allocated;
-}
-
-NK_INTERN void
-nk_finish(struct nk_context *ctx, struct nk_window *win)
-{
- struct nk_popup_buffer *buf;
- struct nk_command *parent_last;
- void *memory;
-
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!ctx || !win) return;
- nk_finish_buffer(ctx, &win->buffer);
- if (!win->popup.buf.active) return;
-
- buf = &win->popup.buf;
- memory = ctx->memory.memory.ptr;
- parent_last = nk_ptr_add(struct nk_command, memory, buf->parent);
- parent_last->next = buf->end;
-}
-
-NK_INTERN void
-nk_build(struct nk_context *ctx)
-{
- struct nk_window *it = 0;
- struct nk_command *cmd = 0;
- nk_byte *buffer = 0;
-
- /* draw cursor overlay */
- if (!ctx->style.cursor_active)
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_ARROW];
- if (ctx->style.cursor_active && !ctx->input.mouse.grabbed && ctx->style.cursor_visible) {
- struct nk_rect mouse_bounds;
- const struct nk_cursor *cursor = ctx->style.cursor_active;
- nk_command_buffer_init(&ctx->overlay, &ctx->memory, NK_CLIPPING_OFF);
- nk_start_buffer(ctx, &ctx->overlay);
-
- mouse_bounds.x = ctx->input.mouse.pos.x - cursor->offset.x;
- mouse_bounds.y = ctx->input.mouse.pos.y - cursor->offset.y;
- mouse_bounds.w = cursor->size.x;
- mouse_bounds.h = cursor->size.y;
-
- nk_draw_image(&ctx->overlay, mouse_bounds, &cursor->img, nk_white);
- nk_finish_buffer(ctx, &ctx->overlay);
- }
- /* build one big draw command list out of all window buffers */
- it = ctx->begin;
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- while (it != 0) {
- struct nk_window *next = it->next;
- if (it->buffer.last == it->buffer.begin || (it->flags & NK_WINDOW_HIDDEN)||
- it->seq != ctx->seq)
- goto cont;
-
- cmd = nk_ptr_add(struct nk_command, buffer, it->buffer.last);
- while (next && ((next->buffer.last == next->buffer.begin) ||
- (next->flags & NK_WINDOW_HIDDEN)))
- next = next->next; /* skip empty command buffers */
-
- if (next) cmd->next = next->buffer.begin;
- cont: it = next;
- }
- /* append all popup draw commands into lists */
- it = ctx->begin;
- while (it != 0) {
- struct nk_window *next = it->next;
- struct nk_popup_buffer *buf;
- if (!it->popup.buf.active)
- goto skip;
-
- buf = &it->popup.buf;
- cmd->next = buf->begin;
- cmd = nk_ptr_add(struct nk_command, buffer, buf->last);
- buf->active = nk_false;
- skip: it = next;
- }
- if (cmd) {
- /* append overlay commands */
- if (ctx->overlay.end != ctx->overlay.begin)
- cmd->next = ctx->overlay.begin;
- else cmd->next = ctx->memory.allocated;
- }
-}
-
-NK_API const struct nk_command*
-nk__begin(struct nk_context *ctx)
-{
- struct nk_window *iter;
- nk_byte *buffer;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- if (!ctx->count) return 0;
-
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- if (!ctx->build) {
- nk_build(ctx);
- ctx->build = nk_true;
- }
- iter = ctx->begin;
- while (iter && ((iter->buffer.begin == iter->buffer.end) ||
- (iter->flags & NK_WINDOW_HIDDEN) || iter->seq != ctx->seq))
- iter = iter->next;
- if (!iter) return 0;
- return nk_ptr_add_const(struct nk_command, buffer, iter->buffer.begin);
-}
-
-NK_API const struct nk_command*
-nk__next(struct nk_context *ctx, const struct nk_command *cmd)
-{
- nk_byte *buffer;
- const struct nk_command *next;
- NK_ASSERT(ctx);
- if (!ctx || !cmd || !ctx->count) return 0;
- if (cmd->next >= ctx->memory.allocated) return 0;
- buffer = (nk_byte*)ctx->memory.memory.ptr;
- next = nk_ptr_add_const(struct nk_command, buffer, cmd->next);
- return next;
-}
-
-/* ----------------------------------------------------------------
- *
- * PANEL
- *
- * ---------------------------------------------------------------*/
-static int
-nk_panel_has_header(nk_flags flags, const char *title)
-{
- int active = 0;
- active = (flags & (NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE));
- active = active || (flags & NK_WINDOW_TITLE);
- active = active && !(flags & NK_WINDOW_HIDDEN) && title;
- return active;
-}
-
-NK_INTERN struct nk_vec2
-nk_panel_get_padding(const struct nk_style *style, enum nk_panel_type type)
-{
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.padding;
- case NK_PANEL_GROUP: return style->window.group_padding;
- case NK_PANEL_POPUP: return style->window.popup_padding;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_padding;
- case NK_PANEL_COMBO: return style->window.combo_padding;
- case NK_PANEL_MENU: return style->window.menu_padding;
- case NK_PANEL_TOOLTIP: return style->window.menu_padding;
- }
-}
-
-NK_INTERN float
-nk_panel_get_border(const struct nk_style *style, nk_flags flags,
- enum nk_panel_type type)
-{
- if (flags & NK_WINDOW_BORDER) {
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.border;
- case NK_PANEL_GROUP: return style->window.group_border;
- case NK_PANEL_POPUP: return style->window.popup_border;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_border;
- case NK_PANEL_COMBO: return style->window.combo_border;
- case NK_PANEL_MENU: return style->window.menu_border;
- case NK_PANEL_TOOLTIP: return style->window.menu_border;
- }} else return 0;
-}
-
-NK_INTERN struct nk_color
-nk_panel_get_border_color(const struct nk_style *style, enum nk_panel_type type)
-{
- switch (type) {
- default:
- case NK_PANEL_WINDOW: return style->window.border_color;
- case NK_PANEL_GROUP: return style->window.group_border_color;
- case NK_PANEL_POPUP: return style->window.popup_border_color;
- case NK_PANEL_CONTEXTUAL: return style->window.contextual_border_color;
- case NK_PANEL_COMBO: return style->window.combo_border_color;
- case NK_PANEL_MENU: return style->window.menu_border_color;
- case NK_PANEL_TOOLTIP: return style->window.menu_border_color;
- }
-}
-
-NK_INTERN int
-nk_panel_is_sub(enum nk_panel_type type)
-{
- return (type & NK_PANEL_SET_SUB)?1:0;
-}
-
-NK_INTERN int
-nk_panel_is_nonblock(enum nk_panel_type type)
-{
- return (type & NK_PANEL_SET_NONBLOCK)?1:0;
-}
-
-NK_INTERN int
-nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type panel_type)
-{
- struct nk_input *in;
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_command_buffer *out;
- const struct nk_style *style;
- const struct nk_user_font *font;
-
- struct nk_vec2 scrollbar_size;
- struct nk_vec2 panel_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- nk_zero(ctx->current->layout, sizeof(*ctx->current->layout));
- if ((ctx->current->flags & NK_WINDOW_HIDDEN) || (ctx->current->flags & NK_WINDOW_CLOSED)) {
- nk_zero(ctx->current->layout, sizeof(struct nk_panel));
- ctx->current->layout->type = panel_type;
- return 0;
- }
- /* pull state into local stack */
- style = &ctx->style;
- font = style->font;
- win = ctx->current;
- layout = win->layout;
- out = &win->buffer;
- in = (win->flags & NK_WINDOW_NO_INPUT) ? 0: &ctx->input;
-#ifdef NK_INCLUDE_COMMAND_USERDATA
- win->buffer.userdata = ctx->userdata;
-#endif
- /* pull style configuration into local stack */
- scrollbar_size = style->window.scrollbar_size;
- panel_padding = nk_panel_get_padding(style, panel_type);
-
- /* window movement */
- if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
- int left_mouse_down;
- int left_mouse_click_in_cursor;
-
- /* calculate draggable window space */
- struct nk_rect header;
- header.x = win->bounds.x;
- header.y = win->bounds.y;
- header.w = win->bounds.w;
- if (nk_panel_has_header(win->flags, title)) {
- header.h = font->height + 2.0f * style->window.header.padding.y;
- header.h += 2.0f * style->window.header.label_padding.y;
- } else header.h = panel_padding.y;
-
- /* window movement by dragging */
- left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, header, nk_true);
- if (left_mouse_down && left_mouse_click_in_cursor) {
- win->bounds.x = win->bounds.x + in->mouse.delta.x;
- win->bounds.y = win->bounds.y + in->mouse.delta.y;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y += in->mouse.delta.y;
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_MOVE];
- }
- }
-
- /* setup panel */
- layout->type = panel_type;
- layout->flags = win->flags;
- layout->bounds = win->bounds;
- layout->bounds.x += panel_padding.x;
- layout->bounds.w -= 2*panel_padding.x;
- if (win->flags & NK_WINDOW_BORDER) {
- layout->border = nk_panel_get_border(style, win->flags, panel_type);
- layout->bounds = nk_shrink_rect(layout->bounds, layout->border);
- } else layout->border = 0;
- layout->at_y = layout->bounds.y;
- layout->at_x = layout->bounds.x;
- layout->max_x = 0;
- layout->header_height = 0;
- layout->footer_height = 0;
- nk_layout_reset_min_row_height(ctx);
- layout->row.index = 0;
- layout->row.columns = 0;
- layout->row.ratio = 0;
- layout->row.item_width = 0;
- layout->row.tree_depth = 0;
- layout->row.height = panel_padding.y;
- layout->has_scrolling = nk_true;
- if (!(win->flags & NK_WINDOW_NO_SCROLLBAR))
- layout->bounds.w -= scrollbar_size.x;
- if (!nk_panel_is_nonblock(panel_type)) {
- layout->footer_height = 0;
- if (!(win->flags & NK_WINDOW_NO_SCROLLBAR) || win->flags & NK_WINDOW_SCALABLE)
- layout->footer_height = scrollbar_size.y;
- layout->bounds.h -= layout->footer_height;
- }
-
- /* panel header */
- if (nk_panel_has_header(win->flags, title))
- {
- struct nk_text text;
- struct nk_rect header;
- const struct nk_style_item *background = 0;
-
- /* calculate header bounds */
- header.x = win->bounds.x;
- header.y = win->bounds.y;
- header.w = win->bounds.w;
- header.h = font->height + 2.0f * style->window.header.padding.y;
- header.h += (2.0f * style->window.header.label_padding.y);
-
- /* shrink panel by header */
- layout->header_height = header.h;
- layout->bounds.y += header.h;
- layout->bounds.h -= header.h;
- layout->at_y += header.h;
-
- /* select correct header background and text color */
- if (ctx->active == win) {
- background = &style->window.header.active;
- text.text = style->window.header.label_active;
- } else if (nk_input_is_mouse_hovering_rect(&ctx->input, header)) {
- background = &style->window.header.hover;
- text.text = style->window.header.label_hover;
- } else {
- background = &style->window.header.normal;
- text.text = style->window.header.label_normal;
- }
-
- /* draw header background */
- header.h += 1.0f;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- text.background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, header, 0, background->data.color);
- }
-
- /* window close button */
- {struct nk_rect button;
- button.y = header.y + style->window.header.padding.y;
- button.h = header.h - 2 * style->window.header.padding.y;
- button.w = button.h;
- if (win->flags & NK_WINDOW_CLOSABLE) {
- nk_flags ws = 0;
- if (style->window.header.align == NK_HEADER_RIGHT) {
- button.x = (header.w + header.x) - (button.w + style->window.header.padding.x);
- header.w -= button.w + style->window.header.spacing.x + style->window.header.padding.x;
- } else {
- button.x = header.x + style->window.header.padding.x;
- header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
- }
-
- if (nk_do_button_symbol(&ws, &win->buffer, button,
- style->window.header.close_symbol, NK_BUTTON_DEFAULT,
- &style->window.header.close_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
- {
- layout->flags |= NK_WINDOW_HIDDEN;
- layout->flags &= (nk_flags)~NK_WINDOW_MINIMIZED;
- }
- }
-
- /* window minimize button */
- if (win->flags & NK_WINDOW_MINIMIZABLE) {
- nk_flags ws = 0;
- if (style->window.header.align == NK_HEADER_RIGHT) {
- button.x = (header.w + header.x) - button.w;
- if (!(win->flags & NK_WINDOW_CLOSABLE)) {
- button.x -= style->window.header.padding.x;
- header.w -= style->window.header.padding.x;
- }
- header.w -= button.w + style->window.header.spacing.x;
- } else {
- button.x = header.x;
- header.x += button.w + style->window.header.spacing.x + style->window.header.padding.x;
- }
- if (nk_do_button_symbol(&ws, &win->buffer, button, (layout->flags & NK_WINDOW_MINIMIZED)?
- style->window.header.maximize_symbol: style->window.header.minimize_symbol,
- NK_BUTTON_DEFAULT, &style->window.header.minimize_button, in, style->font) && !(win->flags & NK_WINDOW_ROM))
- layout->flags = (layout->flags & NK_WINDOW_MINIMIZED) ?
- layout->flags & (nk_flags)~NK_WINDOW_MINIMIZED:
- layout->flags | NK_WINDOW_MINIMIZED;
- }}
-
- {/* window header title */
- int text_len = nk_strlen(title);
- struct nk_rect label = {0,0,0,0};
- float t = font->width(font->userdata, font->height, title, text_len);
- text.padding = nk_vec2(0,0);
-
- label.x = header.x + style->window.header.padding.x;
- label.x += style->window.header.label_padding.x;
- label.y = header.y + style->window.header.label_padding.y;
- label.h = font->height + 2 * style->window.header.label_padding.y;
- label.w = t + 2 * style->window.header.spacing.x;
- label.w = NK_CLAMP(0, label.w, header.x + header.w - label.x);
- nk_widget_text(out, label,(const char*)title, text_len, &text, NK_TEXT_LEFT, font);}
- }
-
- /* draw window background */
- if (!(layout->flags & NK_WINDOW_MINIMIZED) && !(layout->flags & NK_WINDOW_DYNAMIC)) {
- struct nk_rect body;
- body.x = win->bounds.x;
- body.w = win->bounds.w;
- body.y = (win->bounds.y + layout->header_height);
- body.h = (win->bounds.h - layout->header_height);
- if (style->window.fixed_background.type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, body, &style->window.fixed_background.data.image, nk_white);
- else nk_fill_rect(out, body, 0, style->window.fixed_background.data.color);
- }
-
- /* set clipping rectangle */
- {struct nk_rect clip;
- layout->clip = layout->bounds;
- nk_unify(&clip, &win->buffer.clip, layout->clip.x, layout->clip.y,
- layout->clip.x + layout->clip.w, layout->clip.y + layout->clip.h);
- nk_push_scissor(out, clip);
- layout->clip = clip;}
- return !(layout->flags & NK_WINDOW_HIDDEN) && !(layout->flags & NK_WINDOW_MINIMIZED);
-}
-
-NK_INTERN void
-nk_panel_end(struct nk_context *ctx)
-{
- struct nk_input *in;
- struct nk_window *window;
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_command_buffer *out;
-
- struct nk_vec2 scrollbar_size;
- struct nk_vec2 panel_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- window = ctx->current;
- layout = window->layout;
- style = &ctx->style;
- out = &window->buffer;
- in = (layout->flags & NK_WINDOW_ROM || layout->flags & NK_WINDOW_NO_INPUT) ? 0 :&ctx->input;
- if (!nk_panel_is_sub(layout->type))
- nk_push_scissor(out, nk_null_rect);
-
- /* cache configuration data */
- scrollbar_size = style->window.scrollbar_size;
- panel_padding = nk_panel_get_padding(style, layout->type);
-
- /* update the current cursor Y-position to point over the last added widget */
- layout->at_y += layout->row.height;
-
- /* dynamic panels */
- if (layout->flags & NK_WINDOW_DYNAMIC && !(layout->flags & NK_WINDOW_MINIMIZED))
- {
- /* update panel height to fit dynamic growth */
- struct nk_rect empty_space;
- if (layout->at_y < (layout->bounds.y + layout->bounds.h))
- layout->bounds.h = layout->at_y - layout->bounds.y;
-
- /* fill top empty space */
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y;
- empty_space.h = panel_padding.y;
- empty_space.w = window->bounds.w;
- nk_fill_rect(out, empty_space, 0, style->window.background);
-
- /* fill left empty space */
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y;
- empty_space.w = panel_padding.x + layout->border;
- empty_space.h = layout->bounds.h;
- nk_fill_rect(out, empty_space, 0, style->window.background);
-
- /* fill right empty space */
- empty_space.x = layout->bounds.x + layout->bounds.w - layout->border;
- empty_space.y = layout->bounds.y;
- empty_space.w = panel_padding.x + layout->border;
- empty_space.h = layout->bounds.h;
- if (*layout->offset_y == 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR))
- empty_space.w += scrollbar_size.x;
- nk_fill_rect(out, empty_space, 0, style->window.background);
-
- /* fill bottom empty space */
- if (*layout->offset_x != 0 && !(layout->flags & NK_WINDOW_NO_SCROLLBAR)) {
- empty_space.x = window->bounds.x;
- empty_space.y = layout->bounds.y + layout->bounds.h;
- empty_space.w = window->bounds.w;
- empty_space.h = scrollbar_size.y;
- nk_fill_rect(out, empty_space, 0, style->window.background);
- }
- }
-
- /* scrollbars */
- if (!(layout->flags & NK_WINDOW_NO_SCROLLBAR) &&
- !(layout->flags & NK_WINDOW_MINIMIZED) &&
- window->scrollbar_hiding_timer < NK_SCROLLBAR_HIDING_TIMEOUT)
- {
- struct nk_rect scroll;
- int scroll_has_scrolling;
- float scroll_target;
- float scroll_offset;
- float scroll_step;
- float scroll_inc;
-
- /* mouse wheel scrolling */
- if (nk_panel_is_sub(layout->type))
- {
- /* sub-window mouse wheel scrolling */
- struct nk_window *root_window = window;
- struct nk_panel *root_panel = window->layout;
- while (root_panel->parent)
- root_panel = root_panel->parent;
- while (root_window->parent)
- root_window = root_window->parent;
-
- /* only allow scrolling if parent window is active */
- scroll_has_scrolling = 0;
- if ((root_window == ctx->active) && layout->has_scrolling) {
- /* and panel is being hovered and inside clip rect*/
- if (nk_input_is_mouse_hovering_rect(in, layout->bounds) &&
- NK_INTERSECT(layout->bounds.x, layout->bounds.y, layout->bounds.w, layout->bounds.h,
- root_panel->clip.x, root_panel->clip.y, root_panel->clip.w, root_panel->clip.h))
- {
- /* deactivate all parent scrolling */
- root_panel = window->layout;
- while (root_panel->parent) {
- root_panel->has_scrolling = nk_false;
- root_panel = root_panel->parent;
- }
- root_panel->has_scrolling = nk_false;
- scroll_has_scrolling = nk_true;
- }
- }
- } else if (!nk_panel_is_sub(layout->type)) {
- /* window mouse wheel scrolling */
- scroll_has_scrolling = (window == ctx->active) && layout->has_scrolling;
- if (in && (in->mouse.scroll_delta.y > 0 || in->mouse.scroll_delta.x > 0) && scroll_has_scrolling)
- window->scrolled = nk_true;
- else window->scrolled = nk_false;
- } else scroll_has_scrolling = nk_false;
-
- {
- /* vertical scrollbar */
- nk_flags state = 0;
- scroll.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
- scroll.y = layout->bounds.y;
- scroll.w = scrollbar_size.x;
- scroll.h = layout->bounds.h;
-
- scroll_offset = (float)*layout->offset_y;
- scroll_step = scroll.h * 0.10f;
- scroll_inc = scroll.h * 0.01f;
- scroll_target = (float)(int)(layout->at_y - scroll.y);
- scroll_offset = nk_do_scrollbarv(&state, out, scroll, scroll_has_scrolling,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &ctx->style.scrollv, in, style->font);
- *layout->offset_y = (nk_uint)scroll_offset;
- if (in && scroll_has_scrolling)
- in->mouse.scroll_delta.y = 0;
- }
- {
- /* horizontal scrollbar */
- nk_flags state = 0;
- scroll.x = layout->bounds.x;
- scroll.y = layout->bounds.y + layout->bounds.h;
- scroll.w = layout->bounds.w;
- scroll.h = scrollbar_size.y;
-
- scroll_offset = (float)*layout->offset_x;
- scroll_target = (float)(int)(layout->max_x - scroll.x);
- scroll_step = layout->max_x * 0.05f;
- scroll_inc = layout->max_x * 0.005f;
- scroll_offset = nk_do_scrollbarh(&state, out, scroll, scroll_has_scrolling,
- scroll_offset, scroll_target, scroll_step, scroll_inc,
- &ctx->style.scrollh, in, style->font);
- *layout->offset_x = (nk_uint)scroll_offset;
- }
- }
-
- /* hide scroll if no user input */
- if (window->flags & NK_WINDOW_SCROLL_AUTO_HIDE) {
- int has_input = ctx->input.mouse.delta.x != 0 || ctx->input.mouse.delta.y != 0 || ctx->input.mouse.scroll_delta.y != 0;
- int is_window_hovered = nk_window_is_hovered(ctx);
- int any_item_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
- if ((!has_input && is_window_hovered) || (!is_window_hovered && !any_item_active))
- window->scrollbar_hiding_timer += ctx->delta_time_seconds;
- else window->scrollbar_hiding_timer = 0;
- } else window->scrollbar_hiding_timer = 0;
-
- /* window border */
- if (layout->flags & NK_WINDOW_BORDER)
- {
- struct nk_color border_color = nk_panel_get_border_color(style, layout->type);
- const float padding_y = (layout->flags & NK_WINDOW_MINIMIZED)
- ? (style->window.border + window->bounds.y + layout->header_height)
- : ((layout->flags & NK_WINDOW_DYNAMIC)
- ? (layout->bounds.y + layout->bounds.h + layout->footer_height)
- : (window->bounds.y + window->bounds.h));
- struct nk_rect b = window->bounds;
- b.h = padding_y - window->bounds.y;
- nk_stroke_rect(out, b, 0, layout->border, border_color);
- }
-
- /* scaler */
- if ((layout->flags & NK_WINDOW_SCALABLE) && in && !(layout->flags & NK_WINDOW_MINIMIZED))
- {
- /* calculate scaler bounds */
- struct nk_rect scaler;
- scaler.w = scrollbar_size.x;
- scaler.h = scrollbar_size.y;
- scaler.y = layout->bounds.y + layout->bounds.h;
- if (layout->flags & NK_WINDOW_SCALE_LEFT)
- scaler.x = layout->bounds.x - panel_padding.x * 0.5f;
- else scaler.x = layout->bounds.x + layout->bounds.w + panel_padding.x;
- if (layout->flags & NK_WINDOW_NO_SCROLLBAR)
- scaler.x -= scaler.w;
-
- /* draw scaler */
- {const struct nk_style_item *item = &style->window.scaler;
- if (item->type == NK_STYLE_ITEM_IMAGE)
- nk_draw_image(out, scaler, &item->data.image, nk_white);
- else {
- if (layout->flags & NK_WINDOW_SCALE_LEFT) {
- nk_fill_triangle(out, scaler.x, scaler.y, scaler.x,
- scaler.y + scaler.h, scaler.x + scaler.w,
- scaler.y + scaler.h, item->data.color);
- } else {
- nk_fill_triangle(out, scaler.x + scaler.w, scaler.y, scaler.x + scaler.w,
- scaler.y + scaler.h, scaler.x, scaler.y + scaler.h, item->data.color);
- }
- }}
-
- /* do window scaling */
- if (!(window->flags & NK_WINDOW_ROM)) {
- struct nk_vec2 window_size = style->window.min_size;
- int left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
- int left_mouse_click_in_scaler = nk_input_has_mouse_click_down_in_rect(in,
- NK_BUTTON_LEFT, scaler, nk_true);
-
- if (left_mouse_down && left_mouse_click_in_scaler) {
- float delta_x = in->mouse.delta.x;
- if (layout->flags & NK_WINDOW_SCALE_LEFT) {
- delta_x = -delta_x;
- window->bounds.x += in->mouse.delta.x;
- }
- /* dragging in x-direction */
- if (window->bounds.w + delta_x >= window_size.x) {
- if ((delta_x < 0) || (delta_x > 0 && in->mouse.pos.x >= scaler.x)) {
- window->bounds.w = window->bounds.w + delta_x;
- scaler.x += in->mouse.delta.x;
- }
- }
- /* dragging in y-direction (only possible if static window) */
- if (!(layout->flags & NK_WINDOW_DYNAMIC)) {
- if (window_size.y < window->bounds.h + in->mouse.delta.y) {
- if ((in->mouse.delta.y < 0) || (in->mouse.delta.y > 0 && in->mouse.pos.y >= scaler.y)) {
- window->bounds.h = window->bounds.h + in->mouse.delta.y;
- scaler.y += in->mouse.delta.y;
- }
- }
- }
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_RESIZE_TOP_RIGHT_DOWN_LEFT];
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x = scaler.x + scaler.w/2.0f;
- in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.y = scaler.y + scaler.h/2.0f;
- }
- }
- }
- if (!nk_panel_is_sub(layout->type)) {
- /* window is hidden so clear command buffer */
- if (layout->flags & NK_WINDOW_HIDDEN)
- nk_command_buffer_reset(&window->buffer);
- /* window is visible and not tab */
- else nk_finish(ctx, window);
- }
-
- /* NK_WINDOW_REMOVE_ROM flag was set so remove NK_WINDOW_ROM */
- if (layout->flags & NK_WINDOW_REMOVE_ROM) {
- layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
- layout->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
- }
- window->flags = layout->flags;
-
- /* property garbage collector */
- if (window->property.active && window->property.old != window->property.seq &&
- window->property.active == window->property.prev) {
- nk_zero(&window->property, sizeof(window->property));
- } else {
- window->property.old = window->property.seq;
- window->property.prev = window->property.active;
- window->property.seq = 0;
- }
- /* edit garbage collector */
- if (window->edit.active && window->edit.old != window->edit.seq &&
- window->edit.active == window->edit.prev) {
- nk_zero(&window->edit, sizeof(window->edit));
- } else {
- window->edit.old = window->edit.seq;
- window->edit.prev = window->edit.active;
- window->edit.seq = 0;
- }
- /* contextual garbage collector */
- if (window->popup.active_con && window->popup.con_old != window->popup.con_count) {
- window->popup.con_count = 0;
- window->popup.con_old = 0;
- window->popup.active_con = 0;
- } else {
- window->popup.con_old = window->popup.con_count;
- window->popup.con_count = 0;
- }
- window->popup.combo_count = 0;
- /* helper to make sure you have a 'nk_tree_push' for every 'nk_tree_pop' */
- NK_ASSERT(!layout->row.tree_depth);
-}
-
-/* ----------------------------------------------------------------
- *
- * PAGE ELEMENT
- *
- * ---------------------------------------------------------------*/
-NK_INTERN struct nk_page_element*
-nk_create_page_element(struct nk_context *ctx)
-{
- struct nk_page_element *elem;
- if (ctx->freelist) {
- /* unlink page element from free list */
- elem = ctx->freelist;
- ctx->freelist = elem->next;
- } else if (ctx->use_pool) {
- /* allocate page element from memory pool */
- elem = nk_pool_alloc(&ctx->pool);
- NK_ASSERT(elem);
- if (!elem) return 0;
- } else {
- /* allocate new page element from back of fixed size memory buffer */
- NK_STORAGE const nk_size size = sizeof(struct nk_page_element);
- NK_STORAGE const nk_size align = NK_ALIGNOF(struct nk_page_element);
- elem = (struct nk_page_element*)nk_buffer_alloc(&ctx->memory, NK_BUFFER_BACK, size, align);
- NK_ASSERT(elem);
- if (!elem) return 0;
- }
- nk_zero_struct(*elem);
- elem->next = 0;
- elem->prev = 0;
- return elem;
-}
-
-NK_INTERN void
-nk_link_page_element_into_freelist(struct nk_context *ctx,
- struct nk_page_element *elem)
-{
- /* link table into freelist */
- if (!ctx->freelist) {
- ctx->freelist = elem;
- } else {
- elem->next = ctx->freelist;
- ctx->freelist = elem;
- }
-}
-
-NK_INTERN void
-nk_free_page_element(struct nk_context *ctx, struct nk_page_element *elem)
-{
- /* we have a pool so just add to free list */
- if (ctx->use_pool) {
- nk_link_page_element_into_freelist(ctx, elem);
- return;
- }
- /* if possible remove last element from back of fixed memory buffer */
- {void *elem_end = (void*)(elem + 1);
- void *buffer_end = (nk_byte*)ctx->memory.memory.ptr + ctx->memory.size;
- if (elem_end == buffer_end)
- ctx->memory.size -= sizeof(struct nk_page_element);
- else nk_link_page_element_into_freelist(ctx, elem);}
-}
-
-/* ----------------------------------------------------------------
- *
- * PANEL
- *
- * ---------------------------------------------------------------*/
-NK_INTERN void*
-nk_create_panel(struct nk_context *ctx)
-{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- nk_zero_struct(*elem);
- return &elem->data.pan;
-}
-
-NK_INTERN void
-nk_free_panel(struct nk_context *ctx, struct nk_panel *pan)
-{
- union nk_page_data *pd = NK_CONTAINER_OF(pan, union nk_page_data, pan);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);
-}
-
-/* ----------------------------------------------------------------
- *
- * TABLES
- *
- * ---------------------------------------------------------------*/
-NK_INTERN struct nk_table*
-nk_create_table(struct nk_context *ctx)
-{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- nk_zero_struct(*elem);
- return &elem->data.tbl;
-}
-
-NK_INTERN void
-nk_free_table(struct nk_context *ctx, struct nk_table *tbl)
-{
- union nk_page_data *pd = NK_CONTAINER_OF(tbl, union nk_page_data, tbl);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);
-}
-
-NK_INTERN void
-nk_push_table(struct nk_window *win, struct nk_table *tbl)
-{
- if (!win->tables) {
- win->tables = tbl;
- tbl->next = 0;
- tbl->prev = 0;
- tbl->size = 0;
- win->table_count = 1;
- return;
- }
- win->tables->prev = tbl;
- tbl->next = win->tables;
- tbl->prev = 0;
- tbl->size = 0;
- win->tables = tbl;
- win->table_count++;
-}
-
-NK_INTERN void
-nk_remove_table(struct nk_window *win, struct nk_table *tbl)
-{
- if (win->tables == tbl)
- win->tables = tbl->next;
- if (tbl->next)
- tbl->next->prev = tbl->prev;
- if (tbl->prev)
- tbl->prev->next = tbl->next;
- tbl->next = 0;
- tbl->prev = 0;
-}
-
-NK_INTERN nk_uint*
-nk_add_value(struct nk_context *ctx, struct nk_window *win,
- nk_hash name, nk_uint value)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!win || !ctx) return 0;
- if (!win->tables || win->tables->size >= NK_VALUE_PAGE_CAPACITY) {
- struct nk_table *tbl = nk_create_table(ctx);
- NK_ASSERT(tbl);
- if (!tbl) return 0;
- nk_push_table(win, tbl);
- }
- win->tables->seq = win->seq;
- win->tables->keys[win->tables->size] = name;
- win->tables->values[win->tables->size] = value;
- return &win->tables->values[win->tables->size++];
-}
-
-NK_INTERN nk_uint*
-nk_find_value(struct nk_window *win, nk_hash name)
-{
- struct nk_table *iter = win->tables;
- while (iter) {
- unsigned int i = 0;
- unsigned int size = iter->size;
- for (i = 0; i < size; ++i) {
- if (iter->keys[i] == name) {
- iter->seq = win->seq;
- return &iter->values[i];
- }
- } size = NK_VALUE_PAGE_CAPACITY;
- iter = iter->next;
- }
- return 0;
-}
-
-/* ----------------------------------------------------------------
- *
- * WINDOW
- *
- * ---------------------------------------------------------------*/
-NK_INTERN void*
-nk_create_window(struct nk_context *ctx)
-{
- struct nk_page_element *elem;
- elem = nk_create_page_element(ctx);
- if (!elem) return 0;
- elem->data.win.seq = ctx->seq;
- return &elem->data.win;
-}
-
-NK_INTERN void
-nk_free_window(struct nk_context *ctx, struct nk_window *win)
-{
- /* unlink windows from list */
- struct nk_table *it = win->tables;
- if (win->popup.win) {
- nk_free_window(ctx, win->popup.win);
- win->popup.win = 0;
- }
- win->next = 0;
- win->prev = 0;
-
- while (it) {
- /*free window state tables */
- struct nk_table *n = it->next;
- nk_remove_table(win, it);
- nk_free_table(ctx, it);
- if (it == win->tables)
- win->tables = n;
- it = n;
- }
-
- /* link windows into freelist */
- {union nk_page_data *pd = NK_CONTAINER_OF(win, union nk_page_data, win);
- struct nk_page_element *pe = NK_CONTAINER_OF(pd, struct nk_page_element, data);
- nk_free_page_element(ctx, pe);}
-}
-
-NK_INTERN struct nk_window*
-nk_find_window(struct nk_context *ctx, nk_hash hash, const char *name)
-{
- struct nk_window *iter;
- iter = ctx->begin;
- while (iter) {
- NK_ASSERT(iter != iter->next);
- if (iter->name == hash) {
- int max_len = nk_strlen(iter->name_string);
- if (!nk_stricmpn(iter->name_string, name, max_len))
- return iter;
- }
- iter = iter->next;
- }
- return 0;
-}
-
-enum nk_window_insert_location {
- NK_INSERT_BACK, /* inserts window into the back of list (front of screen) */
- NK_INSERT_FRONT /* inserts window into the front of list (back of screen) */
-};
-NK_INTERN void
-nk_insert_window(struct nk_context *ctx, struct nk_window *win,
- enum nk_window_insert_location loc)
-{
- const struct nk_window *iter;
- NK_ASSERT(ctx);
- NK_ASSERT(win);
- if (!win || !ctx) return;
-
- iter = ctx->begin;
- while (iter) {
- NK_ASSERT(iter != iter->next);
- NK_ASSERT(iter != win);
- if (iter == win) return;
- iter = iter->next;
- }
-
- if (!ctx->begin) {
- win->next = 0;
- win->prev = 0;
- ctx->begin = win;
- ctx->end = win;
- ctx->count = 1;
- return;
- }
- if (loc == NK_INSERT_BACK) {
- struct nk_window *end;
- end = ctx->end;
- end->flags |= NK_WINDOW_ROM;
- end->next = win;
- win->prev = ctx->end;
- win->next = 0;
- ctx->end = win;
- ctx->active = ctx->end;
- ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
- } else {
- /*ctx->end->flags |= NK_WINDOW_ROM;*/
- ctx->begin->prev = win;
- win->next = ctx->begin;
- win->prev = 0;
- ctx->begin = win;
- ctx->begin->flags &= ~(nk_flags)NK_WINDOW_ROM;
- }
- ctx->count++;
-}
-
-NK_INTERN void
-nk_remove_window(struct nk_context *ctx, struct nk_window *win)
-{
- if (win == ctx->begin || win == ctx->end) {
- if (win == ctx->begin) {
- ctx->begin = win->next;
- if (win->next)
- win->next->prev = 0;
- }
- if (win == ctx->end) {
- ctx->end = win->prev;
- if (win->prev)
- win->prev->next = 0;
- }
- } else {
- if (win->next)
- win->next->prev = win->prev;
- if (win->prev)
- win->prev->next = win->next;
- }
- if (win == ctx->active || !ctx->active) {
- ctx->active = ctx->end;
- if (ctx->end)
- ctx->end->flags &= ~(nk_flags)NK_WINDOW_ROM;
- }
- win->next = 0;
- win->prev = 0;
- ctx->count--;
-}
-
-NK_API int
-nk_begin(struct nk_context *ctx, const char *title,
- struct nk_rect bounds, nk_flags flags)
-{
- return nk_begin_titled(ctx, title, title, bounds, flags);
-}
-
-NK_API int
-nk_begin_titled(struct nk_context *ctx, const char *name, const char *title,
- struct nk_rect bounds, nk_flags flags)
-{
- struct nk_window *win;
- struct nk_style *style;
- nk_hash title_hash;
- int title_len;
- int ret = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(title);
- NK_ASSERT(ctx->style.font && ctx->style.font->width && "if this triggers you forgot to add a font");
- NK_ASSERT(!ctx->current && "if this triggers you missed a `nk_end` call");
- if (!ctx || ctx->current || !title || !name)
- return 0;
-
- /* find or create window */
- style = &ctx->style;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) {
- /* create new window */
- nk_size name_length = (nk_size)nk_strlen(name);
- win = (struct nk_window*)nk_create_window(ctx);
- NK_ASSERT(win);
- if (!win) return 0;
-
- if (flags & NK_WINDOW_BACKGROUND)
- nk_insert_window(ctx, win, NK_INSERT_FRONT);
- else nk_insert_window(ctx, win, NK_INSERT_BACK);
- nk_command_buffer_init(&win->buffer, &ctx->memory, NK_CLIPPING_ON);
-
- win->flags = flags;
- win->bounds = bounds;
- win->name = title_hash;
- name_length = NK_MIN(name_length, NK_WINDOW_MAX_NAME-1);
- NK_MEMCPY(win->name_string, name, name_length);
- win->name_string[name_length] = 0;
- win->popup.win = 0;
- if (!ctx->active)
- ctx->active = win;
- } else {
- /* update window */
- win->flags &= ~(nk_flags)(NK_WINDOW_PRIVATE-1);
- win->flags |= flags;
- if (!(win->flags & (NK_WINDOW_MOVABLE | NK_WINDOW_SCALABLE)))
- win->bounds = bounds;
- /* If this assert triggers you either:
- *
- * I.) Have more than one window with the same name or
- * II.) You forgot to actually draw the window.
- * More specific you did not call `nk_clear` (nk_clear will be
- * automatically called for you if you are using one of the
- * provided demo backends). */
- NK_ASSERT(win->seq != ctx->seq);
- win->seq = ctx->seq;
- if (!ctx->active && !(win->flags & NK_WINDOW_HIDDEN)) {
- ctx->active = win;
- ctx->end = win;
- }
- }
- if (win->flags & NK_WINDOW_HIDDEN) {
- ctx->current = win;
- win->layout = 0;
- return 0;
- } else nk_start(ctx, win);
-
- /* window overlapping */
- if (!(win->flags & NK_WINDOW_HIDDEN) && !(win->flags & NK_WINDOW_NO_INPUT))
- {
- int inpanel, ishovered;
- struct nk_window *iter = win;
- float h = ctx->style.font->height + 2.0f * style->window.header.padding.y +
- (2.0f * style->window.header.label_padding.y);
- struct nk_rect win_bounds = (!(win->flags & NK_WINDOW_MINIMIZED))?
- win->bounds: nk_rect(win->bounds.x, win->bounds.y, win->bounds.w, h);
-
- /* activate window if hovered and no other window is overlapping this window */
- inpanel = nk_input_has_mouse_click_down_in_rect(&ctx->input, NK_BUTTON_LEFT, win_bounds, nk_true);
- inpanel = inpanel && ctx->input.mouse.buttons[NK_BUTTON_LEFT].clicked;
- ishovered = nk_input_is_mouse_hovering_rect(&ctx->input, win_bounds);
- if ((win != ctx->active) && ishovered && !ctx->input.mouse.buttons[NK_BUTTON_LEFT].down) {
- iter = win->next;
- while (iter) {
- struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
- iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
- if (NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
- (!(iter->flags & NK_WINDOW_HIDDEN)))
- break;
-
- if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
- NK_INTERSECT(win->bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter->popup.win->bounds.x, iter->popup.win->bounds.y,
- iter->popup.win->bounds.w, iter->popup.win->bounds.h))
- break;
- iter = iter->next;
- }
- }
-
- /* activate window if clicked */
- if (iter && inpanel && (win != ctx->end)) {
- iter = win->next;
- while (iter) {
- /* try to find a panel with higher priority in the same position */
- struct nk_rect iter_bounds = (!(iter->flags & NK_WINDOW_MINIMIZED))?
- iter->bounds: nk_rect(iter->bounds.x, iter->bounds.y, iter->bounds.w, h);
- if (NK_INBOX(ctx->input.mouse.pos.x, ctx->input.mouse.pos.y,
- iter_bounds.x, iter_bounds.y, iter_bounds.w, iter_bounds.h) &&
- !(iter->flags & NK_WINDOW_HIDDEN))
- break;
- if (iter->popup.win && iter->popup.active && !(iter->flags & NK_WINDOW_HIDDEN) &&
- NK_INTERSECT(win_bounds.x, win_bounds.y, win_bounds.w, win_bounds.h,
- iter->popup.win->bounds.x, iter->popup.win->bounds.y,
- iter->popup.win->bounds.w, iter->popup.win->bounds.h))
- break;
- iter = iter->next;
- }
- }
- if (iter && !(win->flags & NK_WINDOW_ROM) && (win->flags & NK_WINDOW_BACKGROUND)) {
- win->flags |= (nk_flags)NK_WINDOW_ROM;
- iter->flags &= ~(nk_flags)NK_WINDOW_ROM;
- ctx->active = iter;
- if (!(iter->flags & NK_WINDOW_BACKGROUND)) {
- /* current window is active in that position so transfer to top
- * at the highest priority in stack */
- nk_remove_window(ctx, iter);
- nk_insert_window(ctx, iter, NK_INSERT_BACK);
- }
- } else {
- if (!iter && ctx->end != win) {
- if (!(win->flags & NK_WINDOW_BACKGROUND)) {
- /* current window is active in that position so transfer to top
- * at the highest priority in stack */
- nk_remove_window(ctx, win);
- nk_insert_window(ctx, win, NK_INSERT_BACK);
- }
- win->flags &= ~(nk_flags)NK_WINDOW_ROM;
- ctx->active = win;
- }
- if (ctx->end != win && !(win->flags & NK_WINDOW_BACKGROUND))
- win->flags |= NK_WINDOW_ROM;
- }
- }
- win->layout = (struct nk_panel*)nk_create_panel(ctx);
- ctx->current = win;
- ret = nk_panel_begin(ctx, title, NK_PANEL_WINDOW);
- win->layout->offset_x = &win->scrollbar.x;
- win->layout->offset_y = &win->scrollbar.y;
- return ret;
-}
-
-NK_API void
-nk_end(struct nk_context *ctx)
-{
- struct nk_panel *layout;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current && "if this triggers you forgot to call `nk_begin`");
- if (!ctx || !ctx->current)
- return;
-
- layout = ctx->current->layout;
- if (!layout || (layout->type == NK_PANEL_WINDOW && (ctx->current->flags & NK_WINDOW_HIDDEN))) {
- ctx->current = 0;
- return;
- }
- nk_panel_end(ctx);
- nk_free_panel(ctx, ctx->current->layout);
- ctx->current = 0;
-}
-
-NK_API struct nk_rect
-nk_window_get_bounds(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
- return ctx->current->bounds;
-}
-
-NK_API struct nk_vec2
-nk_window_get_position(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->bounds.x, ctx->current->bounds.y);
-}
-
-NK_API struct nk_vec2
-nk_window_get_size(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->bounds.w, ctx->current->bounds.h);
-}
-
-NK_API float
-nk_window_get_width(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->bounds.w;
-}
-
-NK_API float
-nk_window_get_height(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->bounds.h;
-}
-
-NK_API struct nk_rect
-nk_window_get_content_region(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return nk_rect(0,0,0,0);
- return ctx->current->layout->clip;
-}
-
-NK_API struct nk_vec2
-nk_window_get_content_region_min(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.x, ctx->current->layout->clip.y);
-}
-
-NK_API struct nk_vec2
-nk_window_get_content_region_max(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.x + ctx->current->layout->clip.w,
- ctx->current->layout->clip.y + ctx->current->layout->clip.h);
-}
-
-NK_API struct nk_vec2
-nk_window_get_content_region_size(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return nk_vec2(0,0);
- return nk_vec2(ctx->current->layout->clip.w, ctx->current->layout->clip.h);
-}
-
-NK_API struct nk_command_buffer*
-nk_window_get_canvas(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return 0;
- return &ctx->current->buffer;
-}
-
-NK_API struct nk_panel*
-nk_window_get_panel(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- return ctx->current->layout;
-}
-
-NK_API int
-nk_window_has_focus(const struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current) return 0;
- return ctx->current == ctx->active;
-}
-
-NK_API int
-nk_window_is_hovered(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return 0;
- if(ctx->current->flags & NK_WINDOW_HIDDEN)
- return 0;
- return nk_input_is_mouse_hovering_rect(&ctx->input, ctx->current->bounds);
-}
-
-NK_API int
-nk_window_is_any_hovered(struct nk_context *ctx)
-{
- struct nk_window *iter;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- iter = ctx->begin;
- while (iter) {
- /* check if window is being hovered */
- if(!(iter->flags & NK_WINDOW_HIDDEN)) {
- /* check if window popup is being hovered */
- if (iter->popup.active && iter->popup.win && nk_input_is_mouse_hovering_rect(&ctx->input, iter->popup.win->bounds))
- return 1;
-
- if (iter->flags & NK_WINDOW_MINIMIZED) {
- struct nk_rect header = iter->bounds;
- header.h = ctx->style.font->height + 2 * ctx->style.window.header.padding.y;
- if (nk_input_is_mouse_hovering_rect(&ctx->input, header))
- return 1;
- } else if (nk_input_is_mouse_hovering_rect(&ctx->input, iter->bounds)) {
- return 1;
- }
- }
- iter = iter->next;
- }
- return 0;
-}
-
-NK_API int
-nk_item_is_any_active(struct nk_context *ctx)
-{
- int any_hovered = nk_window_is_any_hovered(ctx);
- int any_active = (ctx->last_widget_state & NK_WIDGET_STATE_MODIFIED);
- return any_hovered || any_active;
-}
-
-NK_API int
-nk_window_is_collapsed(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 0;
- return win->flags & NK_WINDOW_MINIMIZED;
-}
-
-NK_API int
-nk_window_is_closed(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return 1;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 1;
- return (win->flags & NK_WINDOW_CLOSED);
-}
-
-NK_API int
-nk_window_is_hidden(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return 1;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 1;
- return (win->flags & NK_WINDOW_HIDDEN);
-}
-
-NK_API int
-nk_window_is_active(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return 0;
- return win == ctx->active;
-}
-
-NK_API struct nk_window*
-nk_window_find(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- return nk_find_window(ctx, title_hash, name);
-}
-
-NK_API void
-nk_window_close(struct nk_context *ctx, const char *name)
-{
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
- win = nk_window_find(ctx, name);
- if (!win) return;
- NK_ASSERT(ctx->current != win && "You cannot close a currently active window");
- if (ctx->current == win) return;
- win->flags |= NK_WINDOW_HIDDEN;
- win->flags |= NK_WINDOW_CLOSED;
-}
-
-NK_API void
-nk_window_set_bounds(struct nk_context *ctx,
- const char *name, struct nk_rect bounds)
-{
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
- win = nk_window_find(ctx, name);
- if (!win) return;
- NK_ASSERT(ctx->current != win && "You cannot update a currently in procecss window");
- win->bounds = bounds;
-}
-
-NK_API void
-nk_window_set_position(struct nk_context *ctx,
- const char *name, struct nk_vec2 pos)
-{
- struct nk_window *win = nk_window_find(ctx, name);
- if (!win) return;
- win->bounds.x = pos.x;
- win->bounds.y = pos.y;
-}
-
-NK_API void
-nk_window_set_size(struct nk_context *ctx,
- const char *name, struct nk_vec2 size)
-{
- struct nk_window *win = nk_window_find(ctx, name);
- if (!win) return;
- win->bounds.w = size.x;
- win->bounds.h = size.y;
-}
-
-NK_API void
-nk_window_collapse(struct nk_context *ctx, const char *name,
- enum nk_collapse_states c)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return;
- if (c == NK_MINIMIZED)
- win->flags |= NK_WINDOW_MINIMIZED;
- else win->flags &= ~(nk_flags)NK_WINDOW_MINIMIZED;
-}
-
-NK_API void
-nk_window_collapse_if(struct nk_context *ctx, const char *name,
- enum nk_collapse_states c, int cond)
-{
- NK_ASSERT(ctx);
- if (!ctx || !cond) return;
- nk_window_collapse(ctx, name, c);
-}
-
-NK_API void
-nk_window_show(struct nk_context *ctx, const char *name, enum nk_show_states s)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (!win) return;
- if (s == NK_HIDDEN) {
- win->flags |= NK_WINDOW_HIDDEN;
- } else win->flags &= ~(nk_flags)NK_WINDOW_HIDDEN;
-}
-
-NK_API void
-nk_window_show_if(struct nk_context *ctx, const char *name,
- enum nk_show_states s, int cond)
-{
- NK_ASSERT(ctx);
- if (!ctx || !cond) return;
- nk_window_show(ctx, name, s);
-}
-
-NK_API void
-nk_window_set_focus(struct nk_context *ctx, const char *name)
-{
- int title_len;
- nk_hash title_hash;
- struct nk_window *win;
- NK_ASSERT(ctx);
- if (!ctx) return;
-
- title_len = (int)nk_strlen(name);
- title_hash = nk_murmur_hash(name, (int)title_len, NK_WINDOW_TITLE);
- win = nk_find_window(ctx, title_hash, name);
- if (win && ctx->end != win) {
- nk_remove_window(ctx, win);
- nk_insert_window(ctx, win, NK_INSERT_BACK);
- }
- ctx->active = win;
-}
-
-/*----------------------------------------------------------------
- *
- * MENUBAR
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_menubar_begin(struct nk_context *ctx)
-{
- struct nk_panel *layout;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- layout = ctx->current->layout;
- NK_ASSERT(layout->at_y == layout->bounds.y);
- /* if this assert triggers you allocated space between nk_begin and nk_menubar_begin.
- If you want a menubar the first nuklear function after `nk_begin` has to be a
- `nk_menubar_begin` call. Inside the menubar you then have to allocate space for
- widgets (also supports multiple rows).
- Example:
- if (nk_begin(...)) {
- nk_menubar_begin(...);
- nk_layout_xxxx(...);
- nk_button(...);
- nk_layout_xxxx(...);
- nk_button(...);
- nk_menubar_end(...);
- }
- nk_end(...);
- */
- if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
- return;
-
- layout->menu.x = layout->at_x;
- layout->menu.y = layout->at_y + layout->row.height;
- layout->menu.w = layout->bounds.w;
- layout->menu.offset.x = *layout->offset_x;
- layout->menu.offset.y = *layout->offset_y;
- *layout->offset_y = 0;
-}
-
-NK_API void
-nk_menubar_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_command_buffer *out;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- out = &win->buffer;
- layout = win->layout;
- if (layout->flags & NK_WINDOW_HIDDEN || layout->flags & NK_WINDOW_MINIMIZED)
- return;
-
- layout->menu.h = layout->at_y - layout->menu.y;
- layout->bounds.y += layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
- layout->bounds.h -= layout->menu.h + ctx->style.window.spacing.y + layout->row.height;
-
- *layout->offset_x = layout->menu.offset.x;
- *layout->offset_y = layout->menu.offset.y;
- layout->at_y = layout->bounds.y - layout->row.height;
-
- layout->clip.y = layout->bounds.y;
- layout->clip.h = layout->bounds.h;
- nk_push_scissor(out, layout->clip);
-}
-/* -------------------------------------------------------------
- *
- * LAYOUT
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_layout_set_min_row_height(struct nk_context *ctx, float height)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- layout->row.min_height = height;
-}
-
-NK_API void
-nk_layout_reset_min_row_height(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- layout->row.min_height = ctx->style.font->height;
- layout->row.min_height += ctx->style.text.padding.y*2;
- layout->row.min_height += ctx->style.window.min_row_height_padding*2;
-}
-
-NK_INTERN float
-nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel_type type,
- float total_space, int columns)
-{
- float panel_padding;
- float panel_spacing;
- float panel_space;
-
- struct nk_vec2 spacing;
- struct nk_vec2 padding;
-
- spacing = style->window.spacing;
- padding = nk_panel_get_padding(style, type);
-
- /* calculate the usable panel space */
- panel_padding = 2 * padding.x;
- panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
- panel_space = total_space - panel_padding - panel_spacing;
- return panel_space;
-}
-
-NK_INTERN void
-nk_panel_layout(const struct nk_context *ctx, struct nk_window *win,
- float height, int cols)
-{
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_command_buffer *out;
-
- struct nk_vec2 item_spacing;
- struct nk_color color;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- /* prefetch some configuration data */
- layout = win->layout;
- style = &ctx->style;
- out = &win->buffer;
- color = style->window.background;
- item_spacing = style->window.spacing;
-
- /* if one of these triggers you forgot to add an `if` condition around either
- a window, group, popup, combobox or contextual menu `begin` and `end` block.
- Example:
- if (nk_begin(...) {...} nk_end(...); or
- if (nk_group_begin(...) { nk_group_end(...);} */
- NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
- NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
- NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
-
- /* update the current row and set the current row layout */
- layout->row.index = 0;
- layout->at_y += layout->row.height;
- layout->row.columns = cols;
- if (height == 0.0f)
- layout->row.height = NK_MAX(height, layout->row.min_height) + item_spacing.y;
- else layout->row.height = height + item_spacing.y;
-
- layout->row.item_offset = 0;
- if (layout->flags & NK_WINDOW_DYNAMIC) {
- /* draw background for dynamic panels */
- struct nk_rect background;
- background.x = win->bounds.x;
- background.w = win->bounds.w;
- background.y = layout->at_y - 1.0f;
- background.h = layout->row.height + 1.0f;
- nk_fill_rect(out, background, 0, color);
- }
-}
-
-NK_INTERN void
-nk_row_layout(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int cols, int width)
-{
- /* update the current row and set the current row layout */
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- nk_panel_layout(ctx, win, height, cols);
- if (fmt == NK_DYNAMIC)
- win->layout->row.type = NK_LAYOUT_DYNAMIC_FIXED;
- else win->layout->row.type = NK_LAYOUT_STATIC_FIXED;
-
- win->layout->row.ratio = 0;
- win->layout->row.filled = 0;
- win->layout->row.item_offset = 0;
- win->layout->row.item_width = (float)width;
-}
-
-NK_API float
-nk_layout_ratio_from_pixel(struct nk_context *ctx, float pixel_width)
-{
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(pixel_width);
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- win = ctx->current;
- return NK_CLAMP(0.0f, pixel_width/win->bounds.x, 1.0f);
-}
-
-NK_API void
-nk_layout_row_dynamic(struct nk_context *ctx, float height, int cols)
-{
- nk_row_layout(ctx, NK_DYNAMIC, height, cols, 0);
-}
-
-NK_API void
-nk_layout_row_static(struct nk_context *ctx, float height, int item_width, int cols)
-{
- nk_row_layout(ctx, NK_STATIC, height, cols, item_width);
-}
-
-NK_API void
-nk_layout_row_begin(struct nk_context *ctx, enum nk_layout_format fmt,
- float row_height, int cols)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, row_height, cols);
- if (fmt == NK_DYNAMIC)
- layout->row.type = NK_LAYOUT_DYNAMIC_ROW;
- else layout->row.type = NK_LAYOUT_STATIC_ROW;
-
- layout->row.ratio = 0;
- layout->row.filled = 0;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
- layout->row.columns = cols;
-}
-
-NK_API void
-nk_layout_row_push(struct nk_context *ctx, float ratio_or_width)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
- if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
- return;
-
- if (layout->row.type == NK_LAYOUT_DYNAMIC_ROW) {
- float ratio = ratio_or_width;
- if ((ratio + layout->row.filled) > 1.0f) return;
- if (ratio > 0.0f)
- layout->row.item_width = NK_SATURATE(ratio);
- else layout->row.item_width = 1.0f - layout->row.filled;
- } else layout->row.item_width = ratio_or_width;
-}
-
-NK_API void
-nk_layout_row_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_STATIC_ROW || layout->row.type == NK_LAYOUT_DYNAMIC_ROW);
- if (layout->row.type != NK_LAYOUT_STATIC_ROW && layout->row.type != NK_LAYOUT_DYNAMIC_ROW)
- return;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
-}
-
-NK_API void
-nk_layout_row(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int cols, const float *ratio)
-{
- int i;
- int n_undef = 0;
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, cols);
- if (fmt == NK_DYNAMIC) {
- /* calculate width of undefined widget ratios */
- float r = 0;
- layout->row.ratio = ratio;
- for (i = 0; i < cols; ++i) {
- if (ratio[i] < 0.0f)
- n_undef++;
- else r += ratio[i];
- }
- r = NK_SATURATE(1.0f - r);
- layout->row.type = NK_LAYOUT_DYNAMIC;
- layout->row.item_width = (r > 0 && n_undef > 0) ? (r / (float)n_undef):0;
- } else {
- layout->row.ratio = ratio;
- layout->row.type = NK_LAYOUT_STATIC;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
- }
- layout->row.item_offset = 0;
- layout->row.filled = 0;
-}
-
-NK_API void
-nk_layout_row_template_begin(struct nk_context *ctx, float height)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, 1);
- layout->row.type = NK_LAYOUT_TEMPLATE;
- layout->row.columns = 0;
- layout->row.ratio = 0;
- layout->row.item_width = 0;
- layout->row.item_height = 0;
- layout->row.item_offset = 0;
- layout->row.filled = 0;
- layout->row.item.x = 0;
- layout->row.item.y = 0;
- layout->row.item.w = 0;
- layout->row.item.h = 0;
-}
-
-NK_API void
-nk_layout_row_template_push_dynamic(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = -1.0f;
-}
-
-NK_API void
-nk_layout_row_template_push_variable(struct nk_context *ctx, float min_width)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = -min_width;
-}
-
-NK_API void
-nk_layout_row_template_push_static(struct nk_context *ctx, float width)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- NK_ASSERT(layout->row.columns < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- if (layout->row.columns >= NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS) return;
- layout->row.templates[layout->row.columns++] = width;
-}
-
-NK_API void
-nk_layout_row_template_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- int i = 0;
- int variable_count = 0;
- int min_variable_count = 0;
- float min_fixed_width = 0.0f;
- float total_fixed_width = 0.0f;
- float max_variable_width = 0.0f;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- NK_ASSERT(layout->row.type == NK_LAYOUT_TEMPLATE);
- if (layout->row.type != NK_LAYOUT_TEMPLATE) return;
- for (i = 0; i < layout->row.columns; ++i) {
- float width = layout->row.templates[i];
- if (width >= 0.0f) {
- total_fixed_width += width;
- min_fixed_width += width;
- } else if (width < -1.0f) {
- width = -width;
- total_fixed_width += width;
- max_variable_width = NK_MAX(max_variable_width, width);
- variable_count++;
- } else {
- min_variable_count++;
- variable_count++;
- }
- }
- if (variable_count) {
- float space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
- layout->bounds.w, layout->row.columns);
- float var_width = (NK_MAX(space-min_fixed_width,0.0f)) / (float)variable_count;
- int enough_space = var_width >= max_variable_width;
- if (!enough_space)
- var_width = (NK_MAX(space-total_fixed_width,0)) / (float)min_variable_count;
- for (i = 0; i < layout->row.columns; ++i) {
- float *width = &layout->row.templates[i];
- *width = (*width >= 0.0f)? *width: (*width < -1.0f && !enough_space)? -(*width): var_width;
- }
- }
-}
-
-NK_API void
-nk_layout_space_begin(struct nk_context *ctx, enum nk_layout_format fmt,
- float height, int widget_count)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- nk_panel_layout(ctx, win, height, widget_count);
- if (fmt == NK_STATIC)
- layout->row.type = NK_LAYOUT_STATIC_FREE;
- else layout->row.type = NK_LAYOUT_DYNAMIC_FREE;
-
- layout->row.ratio = 0;
- layout->row.filled = 0;
- layout->row.item_width = 0;
- layout->row.item_offset = 0;
-}
-
-NK_API void
-nk_layout_space_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- layout->row.item_width = 0;
- layout->row.item_height = 0;
- layout->row.item_offset = 0;
- nk_zero(&layout->row.item, sizeof(layout->row.item));
-}
-
-NK_API void
-nk_layout_space_push(struct nk_context *ctx, struct nk_rect rect)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- layout->row.item = rect;
-}
-
-NK_API struct nk_rect
-nk_layout_space_bounds(struct nk_context *ctx)
-{
- struct nk_rect ret;
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x = layout->clip.x;
- ret.y = layout->clip.y;
- ret.w = layout->clip.w;
- ret.h = layout->row.height;
- return ret;
-}
-
-NK_API struct nk_rect
-nk_layout_widget_bounds(struct nk_context *ctx)
-{
- struct nk_rect ret;
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x = layout->at_x;
- ret.y = layout->at_y;
- ret.w = layout->bounds.w - NK_MAX(layout->at_x - layout->bounds.x,0);
- ret.h = layout->row.height;
- return ret;
-}
-
-NK_API struct nk_vec2
-nk_layout_space_to_screen(struct nk_context *ctx, struct nk_vec2 ret)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += layout->at_x - (float)*layout->offset_x;
- ret.y += layout->at_y - (float)*layout->offset_y;
- return ret;
-}
-
-NK_API struct nk_vec2
-nk_layout_space_to_local(struct nk_context *ctx, struct nk_vec2 ret)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += -layout->at_x + (float)*layout->offset_x;
- ret.y += -layout->at_y + (float)*layout->offset_y;
- return ret;
-}
-
-NK_API struct nk_rect
-nk_layout_space_rect_to_screen(struct nk_context *ctx, struct nk_rect ret)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += layout->at_x - (float)*layout->offset_x;
- ret.y += layout->at_y - (float)*layout->offset_y;
- return ret;
-}
-
-NK_API struct nk_rect
-nk_layout_space_rect_to_local(struct nk_context *ctx, struct nk_rect ret)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- win = ctx->current;
- layout = win->layout;
-
- ret.x += -layout->at_x + (float)*layout->offset_x;
- ret.y += -layout->at_y + (float)*layout->offset_y;
- return ret;
-}
-
-NK_INTERN void
-nk_panel_alloc_row(const struct nk_context *ctx, struct nk_window *win)
-{
- struct nk_panel *layout = win->layout;
- struct nk_vec2 spacing = ctx->style.window.spacing;
- const float row_height = layout->row.height - spacing.y;
- nk_panel_layout(ctx, win, row_height, layout->row.columns);
-}
-
-NK_INTERN void
-nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
- struct nk_window *win, int modify)
-{
- struct nk_panel *layout;
- const struct nk_style *style;
-
- struct nk_vec2 spacing;
- struct nk_vec2 padding;
-
- float item_offset = 0;
- float item_width = 0;
- float item_spacing = 0;
- float panel_space = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
- NK_ASSERT(bounds);
-
- spacing = style->window.spacing;
- padding = nk_panel_get_padding(style, layout->type);
- panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
- layout->bounds.w, layout->row.columns);
-
- /* calculate the width of one item inside the current layout space */
- switch (layout->row.type) {
- case NK_LAYOUT_DYNAMIC_FIXED: {
- /* scaling fixed size widgets item width */
- item_width = NK_MAX(1.0f,panel_space) / (float)layout->row.columns;
- item_offset = (float)layout->row.index * item_width;
- item_spacing = (float)layout->row.index * spacing.x;
- } break;
- case NK_LAYOUT_DYNAMIC_ROW: {
- /* scaling single ratio widget width */
- item_width = layout->row.item_width * panel_space;
- item_offset = layout->row.item_offset;
- item_spacing = 0;
-
- if (modify) {
- layout->row.item_offset += item_width + spacing.x;
- layout->row.filled += layout->row.item_width;
- layout->row.index = 0;
- }
- } break;
- case NK_LAYOUT_DYNAMIC_FREE: {
- /* panel width depended free widget placing */
- bounds->x = layout->at_x + (layout->bounds.w * layout->row.item.x);
- bounds->x -= (float)*layout->offset_x;
- bounds->y = layout->at_y + (layout->row.height * layout->row.item.y);
- bounds->y -= (float)*layout->offset_y;
- bounds->w = layout->bounds.w * layout->row.item.w;
- bounds->h = layout->row.height * layout->row.item.h;
- return;
- } break;
- case NK_LAYOUT_DYNAMIC: {
- /* scaling arrays of panel width ratios for every widget */
- float ratio;
- NK_ASSERT(layout->row.ratio);
- ratio = (layout->row.ratio[layout->row.index] < 0) ?
- layout->row.item_width : layout->row.ratio[layout->row.index];
-
- item_spacing = (float)layout->row.index * spacing.x;
- item_width = (ratio * panel_space);
- item_offset = layout->row.item_offset;
-
- if (modify) {
- layout->row.item_offset += item_width;
- layout->row.filled += ratio;
- }
- } break;
- case NK_LAYOUT_STATIC_FIXED: {
- /* non-scaling fixed widgets item width */
- item_width = layout->row.item_width;
- item_offset = (float)layout->row.index * item_width;
- item_spacing = (float)layout->row.index * spacing.x;
- } break;
- case NK_LAYOUT_STATIC_ROW: {
- /* scaling single ratio widget width */
- item_width = layout->row.item_width;
- item_offset = layout->row.item_offset;
- item_spacing = (float)layout->row.index * spacing.x;
- if (modify) layout->row.item_offset += item_width;
- } break;
- case NK_LAYOUT_STATIC_FREE: {
- /* free widget placing */
- bounds->x = layout->at_x + layout->row.item.x;
- bounds->w = layout->row.item.w;
- if (((bounds->x + bounds->w) > layout->max_x) && modify)
- layout->max_x = (bounds->x + bounds->w);
- bounds->x -= (float)*layout->offset_x;
- bounds->y = layout->at_y + layout->row.item.y;
- bounds->y -= (float)*layout->offset_y;
- bounds->h = layout->row.item.h;
- return;
- } break;
- case NK_LAYOUT_STATIC: {
- /* non-scaling array of panel pixel width for every widget */
- item_spacing = (float)layout->row.index * spacing.x;
- item_width = layout->row.ratio[layout->row.index];
- item_offset = layout->row.item_offset;
- if (modify) layout->row.item_offset += item_width;
- } break;
- case NK_LAYOUT_TEMPLATE: {
- /* stretchy row layout with combined dynamic/static widget width*/
- NK_ASSERT(layout->row.index < layout->row.columns);
- NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS);
- item_width = layout->row.templates[layout->row.index];
- item_offset = layout->row.item_offset;
- item_spacing = (float)layout->row.index * spacing.x;
- if (modify) layout->row.item_offset += item_width;
- } break;
- default: NK_ASSERT(0); break;
- };
-
- /* set the bounds of the newly allocated widget */
- bounds->w = item_width;
- bounds->h = layout->row.height - spacing.y;
- bounds->y = layout->at_y - (float)*layout->offset_y;
- bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
- if (((bounds->x + bounds->w) > layout->max_x) && modify)
- layout->max_x = bounds->x + bounds->w;
- bounds->x -= (float)*layout->offset_x;
-}
-
-NK_INTERN void
-nk_panel_alloc_space(struct nk_rect *bounds, const struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- /* check if the end of the row has been hit and begin new row if so */
- win = ctx->current;
- layout = win->layout;
- if (layout->row.index >= layout->row.columns)
- nk_panel_alloc_row(ctx, win);
-
- /* calculate widget position and size */
- nk_layout_widget_space(bounds, ctx, win, nk_true);
- layout->row.index++;
-}
-
-NK_INTERN void
-nk_layout_peek(struct nk_rect *bounds, struct nk_context *ctx)
-{
- float y;
- int index;
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- y = layout->at_y;
- index = layout->row.index;
- if (layout->row.index >= layout->row.columns) {
- layout->at_y += layout->row.height;
- layout->row.index = 0;
- }
- nk_layout_widget_space(bounds, ctx, win, nk_false);
- if (!layout->row.index) {
- bounds->x -= layout->row.item_offset;
- }
- layout->at_y = y;
- layout->row.index = index;
-}
-
-NK_INTERN int
-nk_tree_state_base(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image *img, const char *title, enum nk_collapse_states *state)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_command_buffer *out;
- const struct nk_input *in;
- const struct nk_style_button *button;
- enum nk_symbol_type symbol;
- float row_height;
-
- struct nk_vec2 item_spacing;
- struct nk_rect header = {0,0,0,0};
- struct nk_rect sym = {0,0,0,0};
- struct nk_text text;
-
- nk_flags ws = 0;
- enum nk_widget_layout_states widget_state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- /* cache some data */
- win = ctx->current;
- layout = win->layout;
- out = &win->buffer;
- style = &ctx->style;
- item_spacing = style->window.spacing;
-
- /* calculate header bounds and draw background */
- row_height = style->font->height + 2 * style->tab.padding.y;
- nk_layout_set_min_row_height(ctx, row_height);
- nk_layout_row_dynamic(ctx, row_height, 1);
- nk_layout_reset_min_row_height(ctx);
-
- widget_state = nk_widget(&header, ctx);
- if (type == NK_TREE_TAB) {
- const struct nk_style_item *background = &style->tab.background;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(out, header, &background->data.image, nk_white);
- text.background = nk_rgba(0,0,0,0);
- } else {
- text.background = background->data.color;
- nk_fill_rect(out, header, 0, style->tab.border_color);
- nk_fill_rect(out, nk_shrink_rect(header, style->tab.border),
- style->tab.rounding, background->data.color);
- }
- } else text.background = style->window.background;
-
- /* update node state */
- in = (!(layout->flags & NK_WINDOW_ROM)) ? &ctx->input: 0;
- in = (in && widget_state == NK_WIDGET_VALID) ? &ctx->input : 0;
- if (nk_button_behavior(&ws, header, in, NK_BUTTON_DEFAULT))
- *state = (*state == NK_MAXIMIZED) ? NK_MINIMIZED : NK_MAXIMIZED;
-
- /* select correct button style */
- if (*state == NK_MAXIMIZED) {
- symbol = style->tab.sym_maximize;
- if (type == NK_TREE_TAB)
- button = &style->tab.tab_maximize_button;
- else button = &style->tab.node_maximize_button;
- } else {
- symbol = style->tab.sym_minimize;
- if (type == NK_TREE_TAB)
- button = &style->tab.tab_minimize_button;
- else button = &style->tab.node_minimize_button;
- }
-
- {/* draw triangle button */
- sym.w = sym.h = style->font->height;
- sym.y = header.y + style->tab.padding.y;
- sym.x = header.x + style->tab.padding.x;
- nk_do_button_symbol(&ws, &win->buffer, sym, symbol, NK_BUTTON_DEFAULT,
- button, 0, style->font);
-
- if (img) {
- /* draw optional image icon */
- sym.x = sym.x + sym.w + 4 * item_spacing.x;
- nk_draw_image(&win->buffer, sym, img, nk_white);
- sym.w = style->font->height + style->tab.spacing.x;}
- }
-
- {/* draw label */
- struct nk_rect label;
- header.w = NK_MAX(header.w, sym.w + item_spacing.x);
- label.x = sym.x + sym.w + item_spacing.x;
- label.y = sym.y;
- label.w = header.w - (sym.w + item_spacing.y + style->tab.indent);
- label.h = style->font->height;
- text.text = style->tab.text;
- text.padding = nk_vec2(0,0);
- nk_widget_text(out, label, title, nk_strlen(title), &text,
- NK_TEXT_LEFT, style->font);}
-
- /* increase x-axis cursor widget position pointer */
- if (*state == NK_MAXIMIZED) {
- layout->at_x = header.x + (float)*layout->offset_x + style->tab.indent;
- layout->bounds.w = NK_MAX(layout->bounds.w, style->tab.indent);
- layout->bounds.w -= (style->tab.indent + style->window.padding.x);
- layout->row.tree_depth++;
- return nk_true;
- } else return nk_false;
-}
-
-NK_INTERN int
-nk_tree_base(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image *img, const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len, int line)
-{
- struct nk_window *win = ctx->current;
- int title_len = 0;
- nk_hash tree_hash = 0;
- nk_uint *state = 0;
-
- /* retrieve tree state from internal widget state tables */
- if (!hash) {
- title_len = (int)nk_strlen(title);
- tree_hash = nk_murmur_hash(title, (int)title_len, (nk_hash)line);
- } else tree_hash = nk_murmur_hash(hash, len, (nk_hash)line);
- state = nk_find_value(win, tree_hash);
- if (!state) {
- state = nk_add_value(ctx, win, tree_hash, 0);
- *state = initial_state;
- }
- return nk_tree_state_base(ctx, type, img, title, (enum nk_collapse_states*)state);
-}
-
-NK_API int
-nk_tree_state_push(struct nk_context *ctx, enum nk_tree_type type,
- const char *title, enum nk_collapse_states *state)
-{return nk_tree_state_base(ctx, type, 0, title, state);}
-
-NK_API int
-nk_tree_state_image_push(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image img, const char *title, enum nk_collapse_states *state)
-{return nk_tree_state_base(ctx, type, &img, title, state);}
-
-NK_API void
-nk_tree_state_pop(struct nk_context *ctx)
-{
- struct nk_window *win = 0;
- struct nk_panel *layout = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- layout->at_x -= ctx->style.tab.indent + ctx->style.window.padding.x;
- layout->bounds.w += ctx->style.tab.indent + ctx->style.window.padding.x;
- NK_ASSERT(layout->row.tree_depth);
- layout->row.tree_depth--;
-}
-
-NK_API int
-nk_tree_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
- const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len, int line)
-{return nk_tree_base(ctx, type, 0, title, initial_state, hash, len, line);}
-
-NK_API int
-nk_tree_image_push_hashed(struct nk_context *ctx, enum nk_tree_type type,
- struct nk_image img, const char *title, enum nk_collapse_states initial_state,
- const char *hash, int len,int seed)
-{return nk_tree_base(ctx, type, &img, title, initial_state, hash, len, seed);}
-
-NK_API void
-nk_tree_pop(struct nk_context *ctx)
-{nk_tree_state_pop(ctx);}
-
-/*----------------------------------------------------------------
- *
- * WIDGETS
- *
- * --------------------------------------------------------------*/
-NK_API struct nk_rect
-nk_widget_bounds(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_rect(0,0,0,0);
- nk_layout_peek(&bounds, ctx);
- return bounds;
-}
-
-NK_API struct nk_vec2
-nk_widget_position(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_vec2(0,0);
-
- nk_layout_peek(&bounds, ctx);
- return nk_vec2(bounds.x, bounds.y);
-}
-
-NK_API struct nk_vec2
-nk_widget_size(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return nk_vec2(0,0);
-
- nk_layout_peek(&bounds, ctx);
- return nk_vec2(bounds.w, bounds.h);
-}
-
-NK_API float
-nk_widget_width(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return 0;
-
- nk_layout_peek(&bounds, ctx);
- return bounds.w;
-}
-
-NK_API float
-nk_widget_height(struct nk_context *ctx)
-{
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return 0;
-
- nk_layout_peek(&bounds, ctx);
- return bounds.h;
-}
-
-NK_API int
-nk_widget_is_hovered(struct nk_context *ctx)
-{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
-
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
-
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_is_mouse_hovering_rect(&ctx->input, bounds);
-}
-
-NK_API int
-nk_widget_is_mouse_clicked(struct nk_context *ctx, enum nk_buttons btn)
-{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
-
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
-
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_mouse_clicked(&ctx->input, btn, bounds);
-}
-
-NK_API int
-nk_widget_has_mouse_click_down(struct nk_context *ctx, enum nk_buttons btn, int down)
-{
- struct nk_rect c, v;
- struct nk_rect bounds;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current || ctx->active != ctx->current)
- return 0;
-
- c = ctx->current->layout->clip;
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
-
- nk_layout_peek(&bounds, ctx);
- nk_unify(&v, &c, bounds.x, bounds.y, bounds.x + bounds.w, bounds.y + bounds.h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds.x, bounds.y, bounds.w, bounds.h))
- return 0;
- return nk_input_has_mouse_click_down_in_rect(&ctx->input, btn, bounds, down);
-}
-
-NK_API enum nk_widget_layout_states
-nk_widget(struct nk_rect *bounds, const struct nk_context *ctx)
-{
- struct nk_rect c, v;
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return NK_WIDGET_INVALID;
-
- /* allocate space and check if the widget needs to be updated and drawn */
- nk_panel_alloc_space(bounds, ctx);
- win = ctx->current;
- layout = win->layout;
- in = &ctx->input;
- c = layout->clip;
-
- /* if one of these triggers you forgot to add an `if` condition around either
- a window, group, popup, combobox or contextual menu `begin` and `end` block.
- Example:
- if (nk_begin(...) {...} nk_end(...); or
- if (nk_group_begin(...) { nk_group_end(...);} */
- NK_ASSERT(!(layout->flags & NK_WINDOW_MINIMIZED));
- NK_ASSERT(!(layout->flags & NK_WINDOW_HIDDEN));
- NK_ASSERT(!(layout->flags & NK_WINDOW_CLOSED));
-
- /* need to convert to int here to remove floating point errors */
- bounds->x = (float)((int)bounds->x);
- bounds->y = (float)((int)bounds->y);
- bounds->w = (float)((int)bounds->w);
- bounds->h = (float)((int)bounds->h);
-
- c.x = (float)((int)c.x);
- c.y = (float)((int)c.y);
- c.w = (float)((int)c.w);
- c.h = (float)((int)c.h);
-
- nk_unify(&v, &c, bounds->x, bounds->y, bounds->x + bounds->w, bounds->y + bounds->h);
- if (!NK_INTERSECT(c.x, c.y, c.w, c.h, bounds->x, bounds->y, bounds->w, bounds->h))
- return NK_WIDGET_INVALID;
- if (!NK_INBOX(in->mouse.pos.x, in->mouse.pos.y, v.x, v.y, v.w, v.h))
- return NK_WIDGET_ROM;
- return NK_WIDGET_VALID;
-}
-
-NK_API enum nk_widget_layout_states
-nk_widget_fitting(struct nk_rect *bounds, struct nk_context *ctx,
- struct nk_vec2 item_padding)
-{
- /* update the bounds to stand without padding */
- struct nk_window *win;
- struct nk_style *style;
- struct nk_panel *layout;
- enum nk_widget_layout_states state;
- struct nk_vec2 panel_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return NK_WIDGET_INVALID;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
- state = nk_widget(bounds, ctx);
-
- panel_padding = nk_panel_get_padding(style, layout->type);
- if (layout->row.index == 1) {
- bounds->w += panel_padding.x;
- bounds->x -= panel_padding.x;
- } else bounds->x -= item_padding.x;
-
- if (layout->row.index == layout->row.columns)
- bounds->w += panel_padding.x;
- else bounds->w += item_padding.x;
- return state;
-}
-
-/*----------------------------------------------------------------
- *
- * MISC
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_spacing(struct nk_context *ctx, int cols)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_rect none;
- int i, index, rows;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- /* spacing over row boundaries */
- win = ctx->current;
- layout = win->layout;
- index = (layout->row.index + cols) % layout->row.columns;
- rows = (layout->row.index + cols) / layout->row.columns;
- if (rows) {
- for (i = 0; i < rows; ++i)
- nk_panel_alloc_row(ctx, win);
- cols = index;
- }
- /* non table layout need to allocate space */
- if (layout->row.type != NK_LAYOUT_DYNAMIC_FIXED &&
- layout->row.type != NK_LAYOUT_STATIC_FIXED) {
- for (i = 0; i < cols; ++i)
- nk_panel_alloc_space(&none, ctx);
- }
- layout->row.index = index;
-}
-
-/*----------------------------------------------------------------
- *
- * TEXT
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_text_colored(struct nk_context *ctx, const char *str, int len,
- nk_flags alignment, struct nk_color color)
-{
- struct nk_window *win;
- const struct nk_style *style;
-
- struct nk_vec2 item_padding;
- struct nk_rect bounds;
- struct nk_text text;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
-
- win = ctx->current;
- style = &ctx->style;
- nk_panel_alloc_space(&bounds, ctx);
- item_padding = style->text.padding;
-
- text.padding.x = item_padding.x;
- text.padding.y = item_padding.y;
- text.background = style->window.background;
- text.text = color;
- nk_widget_text(&win->buffer, bounds, str, len, &text, alignment, style->font);
-}
-
-NK_API void
-nk_text_wrap_colored(struct nk_context *ctx, const char *str,
- int len, struct nk_color color)
-{
- struct nk_window *win;
- const struct nk_style *style;
-
- struct nk_vec2 item_padding;
- struct nk_rect bounds;
- struct nk_text text;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
-
- win = ctx->current;
- style = &ctx->style;
- nk_panel_alloc_space(&bounds, ctx);
- item_padding = style->text.padding;
-
- text.padding.x = item_padding.x;
- text.padding.y = item_padding.y;
- text.background = style->window.background;
- text.text = color;
- nk_widget_text_wrap(&win->buffer, bounds, str, len, &text, style->font);
-}
-
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void
-nk_labelf_colored(struct nk_context *ctx, nk_flags flags,
- struct nk_color color, const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_colored(ctx, buf, flags, color);
- va_end(args);
-}
-
-NK_API void
-nk_labelf_colored_wrap(struct nk_context *ctx, struct nk_color color,
- const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_colored_wrap(ctx, buf, color);
- va_end(args);
-}
-
-NK_API void
-nk_labelf(struct nk_context *ctx, nk_flags flags, const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label(ctx, buf, flags);
- va_end(args);
-}
-
-NK_API void
-nk_labelf_wrap(struct nk_context *ctx, const char *fmt,...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- nk_label_wrap(ctx, buf);
- va_end(args);
-}
-
-NK_API void
-nk_value_bool(struct nk_context *ctx, const char *prefix, int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, ((value) ? "true": "false"));}
-
-NK_API void
-nk_value_int(struct nk_context *ctx, const char *prefix, int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %d", prefix, value);}
-
-NK_API void
-nk_value_uint(struct nk_context *ctx, const char *prefix, unsigned int value)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: %u", prefix, value);}
-
-NK_API void
-nk_value_float(struct nk_context *ctx, const char *prefix, float value)
-{
- double double_value = (double)value;
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: %.3f", prefix, double_value);
-}
-
-NK_API void
-nk_value_color_byte(struct nk_context *ctx, const char *p, struct nk_color c)
-{nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%d, %d, %d, %d)", p, c.r, c.g, c.b, c.a);}
-
-NK_API void
-nk_value_color_float(struct nk_context *ctx, const char *p, struct nk_color color)
-{
- double c[4]; nk_color_dv(c, color);
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: (%.2f, %.2f, %.2f, %.2f)",
- p, c[0], c[1], c[2], c[3]);
-}
-
-NK_API void
-nk_value_color_hex(struct nk_context *ctx, const char *prefix, struct nk_color color)
-{
- char hex[16];
- nk_color_hex_rgba(hex, color);
- nk_labelf(ctx, NK_TEXT_LEFT, "%s: %s", prefix, hex);
-}
-#endif
-
-NK_API void
-nk_text(struct nk_context *ctx, const char *str, int len, nk_flags alignment)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_text_colored(ctx, str, len, alignment, ctx->style.text.color);
-}
-
-NK_API void
-nk_text_wrap(struct nk_context *ctx, const char *str, int len)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- nk_text_wrap_colored(ctx, str, len, ctx->style.text.color);
-}
-
-NK_API void
-nk_label(struct nk_context *ctx, const char *str, nk_flags alignment)
-{nk_text(ctx, str, nk_strlen(str), alignment);}
-
-NK_API void
-nk_label_colored(struct nk_context *ctx, const char *str, nk_flags align,
- struct nk_color color)
-{nk_text_colored(ctx, str, nk_strlen(str), align, color);}
-
-NK_API void
-nk_label_wrap(struct nk_context *ctx, const char *str)
-{nk_text_wrap(ctx, str, nk_strlen(str));}
-
-NK_API void
-nk_label_colored_wrap(struct nk_context *ctx, const char *str, struct nk_color color)
-{nk_text_wrap_colored(ctx, str, nk_strlen(str), color);}
-
-NK_API void
-nk_image(struct nk_context *ctx, struct nk_image img)
-{
- struct nk_window *win;
- struct nk_rect bounds;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
-
- win = ctx->current;
- if (!nk_widget(&bounds, ctx)) return;
- nk_draw_image(&win->buffer, bounds, &img, nk_white);
-}
-
-/*----------------------------------------------------------------
- *
- * BUTTON
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_button_set_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
-{
- NK_ASSERT(ctx);
- if (!ctx) return;
- ctx->button_behavior = behavior;
-}
-
-NK_API int
-nk_button_push_behavior(struct nk_context *ctx, enum nk_button_behavior behavior)
-{
- struct nk_config_stack_button_behavior *button_stack;
- struct nk_config_stack_button_behavior_element *element;
-
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- button_stack = &ctx->stacks.button_behaviors;
- NK_ASSERT(button_stack->head < (int)NK_LEN(button_stack->elements));
- if (button_stack->head >= (int)NK_LEN(button_stack->elements))
- return 0;
-
- element = &button_stack->elements[button_stack->head++];
- element->address = &ctx->button_behavior;
- element->old_value = ctx->button_behavior;
- ctx->button_behavior = behavior;
- return 1;
-}
-
-NK_API int
-nk_button_pop_behavior(struct nk_context *ctx)
-{
- struct nk_config_stack_button_behavior *button_stack;
- struct nk_config_stack_button_behavior_element *element;
-
- NK_ASSERT(ctx);
- if (!ctx) return 0;
-
- button_stack = &ctx->stacks.button_behaviors;
- NK_ASSERT(button_stack->head > 0);
- if (button_stack->head < 1)
- return 0;
-
- element = &button_stack->elements[--button_stack->head];
- *element->address = element->old_value;
- return 1;
-}
-
-NK_API int
-nk_button_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, const char *title, int len)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(style);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!style || !ctx || !ctx->current || !ctx->current->layout) return 0;
-
- win = ctx->current;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
-
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
- title, len, style->text_alignment, ctx->button_behavior,
- style, in, ctx->style.font);
-}
-
-NK_API int
-nk_button_text(struct nk_context *ctx, const char *title, int len)
-{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_text_styled(ctx, &ctx->style.button, title, len);
-}
-
-NK_API int nk_button_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, const char *title)
-{return nk_button_text_styled(ctx, style, title, nk_strlen(title));}
-
-NK_API int nk_button_label(struct nk_context *ctx, const char *title)
-{return nk_button_text(ctx, title, nk_strlen(title));}
-
-NK_API int
-nk_button_color(struct nk_context *ctx, struct nk_color color)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- struct nk_style_button button;
-
- int ret = 0;
- struct nk_rect bounds;
- struct nk_rect content;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-
- button = ctx->style.button;
- button.normal = nk_style_item_color(color);
- button.hover = nk_style_item_color(color);
- button.active = nk_style_item_color(color);
- ret = nk_do_button(&ctx->last_widget_state, &win->buffer, bounds,
- &button, in, ctx->button_behavior, &content);
- nk_draw_button(&win->buffer, &bounds, ctx->last_widget_state, &button);
- return ret;
-}
-
-NK_API int
-nk_button_symbol_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, ctx->button_behavior, style, in, ctx->style.font);
-}
-
-NK_API int
-nk_button_symbol(struct nk_context *ctx, enum nk_symbol_type symbol)
-{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_symbol_styled(ctx, &ctx->style.button, symbol);
-}
-
-NK_API int
-nk_button_image_styled(struct nk_context *ctx, const struct nk_style_button *style,
- struct nk_image img)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_image(&ctx->last_widget_state, &win->buffer, bounds,
- img, ctx->button_behavior, style, in);
-}
-
-NK_API int
-nk_button_image(struct nk_context *ctx, struct nk_image img)
-{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_image_styled(ctx, &ctx->style.button, img);
-}
-
-NK_API int
-nk_button_symbol_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol,
- const char *text, int len, nk_flags align)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, text, len, align, ctx->button_behavior,
- style, ctx->style.font, in);
-}
-
-NK_API int
-nk_button_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char* text, int len, nk_flags align)
-{
- NK_ASSERT(ctx);
- if (!ctx) return 0;
- return nk_button_symbol_text_styled(ctx, &ctx->style.button, symbol, text, len, align);
-}
-
-NK_API int nk_button_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *label, nk_flags align)
-{return nk_button_symbol_text(ctx, symbol, label, nk_strlen(label), align);}
-
-NK_API int nk_button_symbol_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, enum nk_symbol_type symbol,
- const char *title, nk_flags align)
-{return nk_button_symbol_text_styled(ctx, style, symbol, title, nk_strlen(title), align);}
-
-NK_API int
-nk_button_image_text_styled(struct nk_context *ctx,
- const struct nk_style_button *style, struct nk_image img, const char *text,
- int len, nk_flags align)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
- bounds, img, text, len, align, ctx->button_behavior,
- style, ctx->style.font, in);
-}
-
-NK_API int
-nk_button_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
-{return nk_button_image_text_styled(ctx, &ctx->style.button,img, text, len, align);}
-
-
-NK_API int nk_button_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_button_image_text(ctx, img, label, nk_strlen(label), align);}
-
-NK_API int nk_button_image_label_styled(struct nk_context *ctx,
- const struct nk_style_button *style, struct nk_image img,
- const char *label, nk_flags text_alignment)
-{return nk_button_image_text_styled(ctx, style, img, label, nk_strlen(label), text_alignment);}
-
-/*----------------------------------------------------------------
- *
- * SELECTABLE
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_selectable_text(struct nk_context *ctx, const char *str, int len,
- nk_flags align, int *value)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
-
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
-
- NK_ASSERT(ctx);
- NK_ASSERT(value);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_selectable(&ctx->last_widget_state, &win->buffer, bounds,
- str, len, align, value, &style->selectable, in, style->font);
-}
-
-NK_API int
-nk_selectable_image_text(struct nk_context *ctx, struct nk_image img,
- const char *str, int len, nk_flags align, int *value)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
-
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
-
- NK_ASSERT(ctx);
- NK_ASSERT(value);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return 0;
-
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_selectable_image(&ctx->last_widget_state, &win->buffer, bounds,
- str, len, align, value, &img, &style->selectable, in, style->font);
-}
-
-NK_API int nk_select_text(struct nk_context *ctx, const char *str, int len,
- nk_flags align, int value)
-{nk_selectable_text(ctx, str, len, align, &value);return value;}
-
-NK_API int nk_selectable_label(struct nk_context *ctx, const char *str, nk_flags align, int *value)
-{return nk_selectable_text(ctx, str, nk_strlen(str), align, value);}
-
-NK_API int nk_selectable_image_label(struct nk_context *ctx,struct nk_image img,
- const char *str, nk_flags align, int *value)
-{return nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, value);}
-
-NK_API int nk_select_label(struct nk_context *ctx, const char *str, nk_flags align, int value)
-{nk_selectable_text(ctx, str, nk_strlen(str), align, &value);return value;}
-
-NK_API int nk_select_image_label(struct nk_context *ctx, struct nk_image img,
- const char *str, nk_flags align, int value)
-{nk_selectable_image_text(ctx, img, str, nk_strlen(str), align, &value);return value;}
-
-NK_API int nk_select_image_text(struct nk_context *ctx, struct nk_image img,
- const char *str, int len, nk_flags align, int value)
-{nk_selectable_image_text(ctx, img, str, len, align, &value);return value;}
-
-/*----------------------------------------------------------------
- *
- * CHECKBOX
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_check_text(struct nk_context *ctx, const char *text, int len, int active)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return active;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return active;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &active,
- text, len, NK_TOGGLE_CHECK, &style->checkbox, in, style->font);
- return active;
-}
-
-NK_API unsigned int
-nk_check_flags_text(struct nk_context *ctx, const char *text, int len,
- unsigned int flags, unsigned int value)
-{
- int old_active;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- if (!ctx || !text) return flags;
- old_active = (int)((flags & value) & value);
- if (nk_check_text(ctx, text, len, old_active))
- flags |= value;
- else flags &= ~value;
- return flags;
-}
-
-NK_API int
-nk_checkbox_text(struct nk_context *ctx, const char *text, int len, int *active)
-{
- int old_val;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(active);
- if (!ctx || !text || !active) return 0;
- old_val = *active;
- *active = nk_check_text(ctx, text, len, *active);
- return old_val != *active;
-}
-
-NK_API int
-nk_checkbox_flags_text(struct nk_context *ctx, const char *text, int len,
- unsigned int *flags, unsigned int value)
-{
- int active;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(flags);
- if (!ctx || !text || !flags) return 0;
-
- active = (int)((*flags & value) & value);
- if (nk_checkbox_text(ctx, text, len, &active)) {
- if (active) *flags |= value;
- else *flags &= ~value;
- return 1;
- }
- return 0;
-}
-
-NK_API int nk_check_label(struct nk_context *ctx, const char *label, int active)
-{return nk_check_text(ctx, label, nk_strlen(label), active);}
-
-NK_API unsigned int nk_check_flags_label(struct nk_context *ctx, const char *label,
- unsigned int flags, unsigned int value)
-{return nk_check_flags_text(ctx, label, nk_strlen(label), flags, value);}
-
-NK_API int nk_checkbox_label(struct nk_context *ctx, const char *label, int *active)
-{return nk_checkbox_text(ctx, label, nk_strlen(label), active);}
-
-NK_API int nk_checkbox_flags_label(struct nk_context *ctx, const char *label,
- unsigned int *flags, unsigned int value)
-{return nk_checkbox_flags_text(ctx, label, nk_strlen(label), flags, value);}
-
-/*----------------------------------------------------------------
- *
- * OPTION
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_option_text(struct nk_context *ctx, const char *text, int len, int is_active)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return is_active;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return state;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_toggle(&ctx->last_widget_state, &win->buffer, bounds, &is_active,
- text, len, NK_TOGGLE_OPTION, &style->option, in, style->font);
- return is_active;
-}
-
-NK_API int
-nk_radio_text(struct nk_context *ctx, const char *text, int len, int *active)
-{
- int old_value;
- NK_ASSERT(ctx);
- NK_ASSERT(text);
- NK_ASSERT(active);
- if (!ctx || !text || !active) return 0;
- old_value = *active;
- *active = nk_option_text(ctx, text, len, old_value);
- return old_value != *active;
-}
-
-NK_API int
-nk_option_label(struct nk_context *ctx, const char *label, int active)
-{return nk_option_text(ctx, label, nk_strlen(label), active);}
-
-NK_API int
-nk_radio_label(struct nk_context *ctx, const char *label, int *active)
-{return nk_radio_text(ctx, label, nk_strlen(label), active);}
-
-/*----------------------------------------------------------------
- *
- * SLIDER
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_slider_float(struct nk_context *ctx, float min_value, float *value, float max_value,
- float value_step)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_input *in;
- const struct nk_style *style;
-
- int ret = 0;
- float old_value;
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(value);
- if (!ctx || !ctx->current || !ctx->current->layout || !value)
- return ret;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
-
- state = nk_widget(&bounds, ctx);
- if (!state) return ret;
- in = (/*state == NK_WIDGET_ROM || */ layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-
- old_value = *value;
- *value = nk_do_slider(&ctx->last_widget_state, &win->buffer, bounds, min_value,
- old_value, max_value, value_step, &style->slider, in, style->font);
- return (old_value > *value || old_value < *value);
-}
-
-NK_API float
-nk_slide_float(struct nk_context *ctx, float min, float val, float max, float step)
-{
- nk_slider_float(ctx, min, &val, max, step); return val;
-}
-
-NK_API int
-nk_slide_int(struct nk_context *ctx, int min, int val, int max, int step)
-{
- float value = (float)val;
- nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
- return (int)value;
-}
-
-NK_API int
-nk_slider_int(struct nk_context *ctx, int min, int *val, int max, int step)
-{
- int ret;
- float value = (float)*val;
- ret = nk_slider_float(ctx, (float)min, &value, (float)max, (float)step);
- *val = (int)value;
- return ret;
-}
-
-/*----------------------------------------------------------------
- *
- * PROGRESSBAR
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_progress(struct nk_context *ctx, nk_size *cur, nk_size max, int is_modifyable)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_input *in;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
- nk_size old_value;
-
- NK_ASSERT(ctx);
- NK_ASSERT(cur);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !cur)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
-
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- old_value = *cur;
- *cur = nk_do_progress(&ctx->last_widget_state, &win->buffer, bounds,
- *cur, max, is_modifyable, &style->progress, in);
- return (*cur != old_value);
-}
-
-NK_API nk_size nk_prog(struct nk_context *ctx, nk_size cur, nk_size max, int modifyable)
-{nk_progress(ctx, &cur, max, modifyable);return cur;}
-
-/*----------------------------------------------------------------
- *
- * EDIT
- *
- * --------------------------------------------------------------*/
-NK_API void
-nk_edit_focus(struct nk_context *ctx, nk_flags flags)
-{
- nk_hash hash;
- struct nk_window *win;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
-
- win = ctx->current;
- hash = win->edit.seq;
- win->edit.active = nk_true;
- win->edit.name = hash;
- if (flags & NK_EDIT_ALWAYS_INSERT_MODE)
- win->edit.mode = NK_TEXT_EDIT_MODE_INSERT;
-}
-
-NK_API void
-nk_edit_unfocus(struct nk_context *ctx)
-{
- struct nk_window *win;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
-
- win = ctx->current;
- win->edit.active = nk_false;
- win->edit.name = 0;
-}
-
-NK_API nk_flags
-nk_edit_string(struct nk_context *ctx, nk_flags flags,
- char *memory, int *len, int max, nk_plugin_filter filter)
-{
- nk_hash hash;
- nk_flags state;
- struct nk_text_edit *edit;
- struct nk_window *win;
-
- NK_ASSERT(ctx);
- NK_ASSERT(memory);
- NK_ASSERT(len);
- if (!ctx || !memory || !len)
- return 0;
-
- filter = (!filter) ? nk_filter_default: filter;
- win = ctx->current;
- hash = win->edit.seq;
- edit = &ctx->text_edit;
- nk_textedit_clear_state(&ctx->text_edit, (flags & NK_EDIT_MULTILINE)?
- NK_TEXT_EDIT_MULTI_LINE: NK_TEXT_EDIT_SINGLE_LINE, filter);
-
- if (win->edit.active && hash == win->edit.name) {
- if (flags & NK_EDIT_NO_CURSOR)
- edit->cursor = nk_utf_len(memory, *len);
- else edit->cursor = win->edit.cursor;
- if (!(flags & NK_EDIT_SELECTABLE)) {
- edit->select_start = win->edit.cursor;
- edit->select_end = win->edit.cursor;
- } else {
- edit->select_start = win->edit.sel_start;
- edit->select_end = win->edit.sel_end;
- }
- edit->mode = win->edit.mode;
- edit->scrollbar.x = (float)win->edit.scrollbar.x;
- edit->scrollbar.y = (float)win->edit.scrollbar.y;
- edit->active = nk_true;
- } else edit->active = nk_false;
-
- max = NK_MAX(1, max);
- *len = NK_MIN(*len, max-1);
- nk_str_init_fixed(&edit->string, memory, (nk_size)max);
- edit->string.buffer.allocated = (nk_size)*len;
- edit->string.len = nk_utf_len(memory, *len);
- state = nk_edit_buffer(ctx, flags, edit, filter);
- *len = (int)edit->string.buffer.allocated;
-
- if (edit->active) {
- win->edit.cursor = edit->cursor;
- win->edit.sel_start = edit->select_start;
- win->edit.sel_end = edit->select_end;
- win->edit.mode = edit->mode;
- win->edit.scrollbar.x = (nk_uint)edit->scrollbar.x;
- win->edit.scrollbar.y = (nk_uint)edit->scrollbar.y;
- } return state;
-}
-
-NK_API nk_flags
-nk_edit_buffer(struct nk_context *ctx, nk_flags flags,
- struct nk_text_edit *edit, nk_plugin_filter filter)
-{
- struct nk_window *win;
- struct nk_style *style;
- struct nk_input *in;
-
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
-
- nk_flags ret_flags = 0;
- unsigned char prev_state;
- nk_hash hash;
-
- /* make sure correct values */
- NK_ASSERT(ctx);
- NK_ASSERT(edit);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget(&bounds, ctx);
- if (!state) return state;
- in = (win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
-
- /* check if edit is currently hot item */
- hash = win->edit.seq++;
- if (win->edit.active && hash == win->edit.name) {
- if (flags & NK_EDIT_NO_CURSOR)
- edit->cursor = edit->string.len;
- if (!(flags & NK_EDIT_SELECTABLE)) {
- edit->select_start = edit->cursor;
- edit->select_end = edit->cursor;
- }
- if (flags & NK_EDIT_CLIPBOARD)
- edit->clip = ctx->clip;
- edit->active = (unsigned char)win->edit.active;
- } else edit->active = nk_false;
- edit->mode = win->edit.mode;
-
- filter = (!filter) ? nk_filter_default: filter;
- prev_state = (unsigned char)edit->active;
- in = (flags & NK_EDIT_READ_ONLY) ? 0: in;
- ret_flags = nk_do_edit(&ctx->last_widget_state, &win->buffer, bounds, flags,
- filter, edit, &style->edit, in, style->font);
-
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- ctx->style.cursor_active = ctx->style.cursors[NK_CURSOR_TEXT];
- if (edit->active && prev_state != edit->active) {
- /* current edit is now hot */
- win->edit.active = nk_true;
- win->edit.name = hash;
- } else if (prev_state && !edit->active) {
- /* current edit is now cold */
- win->edit.active = nk_false;
- } return ret_flags;
-}
-
-NK_API nk_flags
-nk_edit_string_zero_terminated(struct nk_context *ctx, nk_flags flags,
- char *buffer, int max, nk_plugin_filter filter)
-{
- nk_flags result;
- int len = nk_strlen(buffer);
- result = nk_edit_string(ctx, flags, buffer, &len, max, filter);
- buffer[NK_MIN(NK_MAX(max-1,0), len)] = '\0';
- return result;
-}
-
-/*----------------------------------------------------------------
- *
- * PROPERTY
- *
- * --------------------------------------------------------------*/
-NK_INTERN struct nk_property_variant
-nk_property_variant_int(int value, int min_value, int max_value, int step)
-{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_INT;
- result.value.i = value;
- result.min_value.i = min_value;
- result.max_value.i = max_value;
- result.step.i = step;
- return result;
-}
-
-NK_INTERN struct nk_property_variant
-nk_property_variant_float(float value, float min_value, float max_value, float step)
-{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_FLOAT;
- result.value.f = value;
- result.min_value.f = min_value;
- result.max_value.f = max_value;
- result.step.f = step;
- return result;
-}
-
-NK_INTERN struct nk_property_variant
-nk_property_variant_double(double value, double min_value, double max_value,
- double step)
-{
- struct nk_property_variant result;
- result.kind = NK_PROPERTY_DOUBLE;
- result.value.d = value;
- result.min_value.d = min_value;
- result.max_value.d = max_value;
- result.step.d = step;
- return result;
-}
-
-NK_INTERN void
-nk_property(struct nk_context *ctx, const char *name, struct nk_property_variant *variant,
- float inc_per_pixel, const enum nk_property_filter filter)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states s;
-
- int *state = 0;
- nk_hash hash = 0;
- char *buffer = 0;
- int *len = 0;
- int *cursor = 0;
- int *select_begin = 0;
- int *select_end = 0;
- int old_state;
-
- char dummy_buffer[NK_MAX_NUMBER_BUFFER];
- int dummy_state = NK_PROPERTY_DEFAULT;
- int dummy_length = 0;
- int dummy_cursor = 0;
- int dummy_select_begin = 0;
- int dummy_select_end = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- win = ctx->current;
- layout = win->layout;
- style = &ctx->style;
- s = nk_widget(&bounds, ctx);
- if (!s) return;
-
- /* calculate hash from name */
- if (name[0] == '#') {
- hash = nk_murmur_hash(name, (int)nk_strlen(name), win->property.seq++);
- name++; /* special number hash */
- } else hash = nk_murmur_hash(name, (int)nk_strlen(name), 42);
-
- /* check if property is currently hot item */
- if (win->property.active && hash == win->property.name) {
- buffer = win->property.buffer;
- len = &win->property.length;
- cursor = &win->property.cursor;
- state = &win->property.state;
- select_begin = &win->property.select_start;
- select_end = &win->property.select_end;
- } else {
- buffer = dummy_buffer;
- len = &dummy_length;
- cursor = &dummy_cursor;
- state = &dummy_state;
- select_begin = &dummy_select_begin;
- select_end = &dummy_select_end;
- }
-
- /* execute property widget */
- old_state = *state;
- ctx->text_edit.clip = ctx->clip;
- in = ((s == NK_WIDGET_ROM && !win->property.active) ||
- layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- nk_do_property(&ctx->last_widget_state, &win->buffer, bounds, name,
- variant, inc_per_pixel, buffer, len, state, cursor, select_begin,
- select_end, &style->property, filter, in, style->font, &ctx->text_edit,
- ctx->button_behavior);
-
- if (in && *state != NK_PROPERTY_DEFAULT && !win->property.active) {
- /* current property is now hot */
- win->property.active = 1;
- NK_MEMCPY(win->property.buffer, buffer, (nk_size)*len);
- win->property.length = *len;
- win->property.cursor = *cursor;
- win->property.state = *state;
- win->property.name = hash;
- win->property.select_start = *select_begin;
- win->property.select_end = *select_end;
- if (*state == NK_PROPERTY_DRAG) {
- ctx->input.mouse.grab = nk_true;
- ctx->input.mouse.grabbed = nk_true;
- }
- }
- /* check if previously active property is now inactive */
- if (*state == NK_PROPERTY_DEFAULT && old_state != NK_PROPERTY_DEFAULT) {
- if (old_state == NK_PROPERTY_DRAG) {
- ctx->input.mouse.grab = nk_false;
- ctx->input.mouse.grabbed = nk_false;
- ctx->input.mouse.ungrab = nk_true;
- }
- win->property.select_start = 0;
- win->property.select_end = 0;
- win->property.active = 0;
- }
-}
-
-NK_API void
-nk_property_int(struct nk_context *ctx, const char *name,
- int min, int *val, int max, int step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
-
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_int(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
- *val = variant.value.i;
-}
-
-NK_API void
-nk_property_float(struct nk_context *ctx, const char *name,
- float min, float *val, float max, float step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
-
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_float(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- *val = variant.value.f;
-}
-
-NK_API void
-nk_property_double(struct nk_context *ctx, const char *name,
- double min, double *val, double max, double step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
- NK_ASSERT(val);
-
- if (!ctx || !ctx->current || !name || !val) return;
- variant = nk_property_variant_double(*val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- *val = variant.value.d;
-}
-
-NK_API int
-nk_propertyi(struct nk_context *ctx, const char *name, int min, int val,
- int max, int step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
-
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_int(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_INT);
- val = variant.value.i;
- return val;
-}
-
-NK_API float
-nk_propertyf(struct nk_context *ctx, const char *name, float min,
- float val, float max, float step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
-
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_float(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- val = variant.value.f;
- return val;
-}
-
-NK_API double
-nk_propertyd(struct nk_context *ctx, const char *name, double min,
- double val, double max, double step, float inc_per_pixel)
-{
- struct nk_property_variant variant;
- NK_ASSERT(ctx);
- NK_ASSERT(name);
-
- if (!ctx || !ctx->current || !name) return val;
- variant = nk_property_variant_double(val, min, max, step);
- nk_property(ctx, name, &variant, inc_per_pixel, NK_FILTER_FLOAT);
- val = variant.value.d;
- return val;
-}
-
-/*----------------------------------------------------------------
- *
- * COLOR PICKER
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_color_pick(struct nk_context * ctx, struct nk_colorf *color,
- enum nk_color_format fmt)
-{
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *config;
- const struct nk_input *in;
-
- enum nk_widget_layout_states state;
- struct nk_rect bounds;
-
- NK_ASSERT(ctx);
- NK_ASSERT(color);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !color)
- return 0;
-
- win = ctx->current;
- config = &ctx->style;
- layout = win->layout;
- state = nk_widget(&bounds, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- return nk_do_color_picker(&ctx->last_widget_state, &win->buffer, color, fmt, bounds,
- nk_vec2(0,0), in, config->font);
-}
-
-NK_API struct nk_colorf
-nk_color_picker(struct nk_context *ctx, struct nk_colorf color,
- enum nk_color_format fmt)
-{
- nk_color_pick(ctx, &color, fmt);
- return color;
-}
-
-/* -------------------------------------------------------------
- *
- * CHART
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_chart_begin_colored(struct nk_context *ctx, enum nk_chart_type type,
- struct nk_color color, struct nk_color highlight,
- int count, float min_value, float max_value)
-{
- struct nk_window *win;
- struct nk_chart *chart;
- const struct nk_style *config;
- const struct nk_style_chart *style;
-
- const struct nk_style_item *background;
- struct nk_rect bounds = {0, 0, 0, 0};
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
-
- if (!ctx || !ctx->current || !ctx->current->layout) return 0;
- if (!nk_widget(&bounds, ctx)) {
- chart = &ctx->current->layout->chart;
- nk_zero(chart, sizeof(*chart));
- return 0;
- }
-
- win = ctx->current;
- config = &ctx->style;
- chart = &win->layout->chart;
- style = &config->chart;
-
- /* setup basic generic chart */
- nk_zero(chart, sizeof(*chart));
- chart->x = bounds.x + style->padding.x;
- chart->y = bounds.y + style->padding.y;
- chart->w = bounds.w - 2 * style->padding.x;
- chart->h = bounds.h - 2 * style->padding.y;
- chart->w = NK_MAX(chart->w, 2 * style->padding.x);
- chart->h = NK_MAX(chart->h, 2 * style->padding.y);
-
- /* add first slot into chart */
- {struct nk_chart_slot *slot = &chart->slots[chart->slot++];
- slot->type = type;
- slot->count = count;
- slot->color = color;
- slot->highlight = highlight;
- slot->min = NK_MIN(min_value, max_value);
- slot->max = NK_MAX(min_value, max_value);
- slot->range = slot->max - slot->min;}
-
- /* draw chart background */
- background = &style->background;
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(&win->buffer, bounds, &background->data.image, nk_white);
- } else {
- nk_fill_rect(&win->buffer, bounds, style->rounding, style->border_color);
- nk_fill_rect(&win->buffer, nk_shrink_rect(bounds, style->border),
- style->rounding, style->background.data.color);
- }
- return 1;
-}
-
-NK_API int
-nk_chart_begin(struct nk_context *ctx, const enum nk_chart_type type,
- int count, float min_value, float max_value)
-{return nk_chart_begin_colored(ctx, type, ctx->style.chart.color, ctx->style.chart.selected_color, count, min_value, max_value);}
-
-NK_API void
-nk_chart_add_slot_colored(struct nk_context *ctx, const enum nk_chart_type type,
- struct nk_color color, struct nk_color highlight,
- int count, float min_value, float max_value)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(ctx->current->layout->chart.slot < NK_CHART_MAX_SLOT);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
- if (ctx->current->layout->chart.slot >= NK_CHART_MAX_SLOT) return;
-
- /* add another slot into the graph */
- {struct nk_chart *chart = &ctx->current->layout->chart;
- struct nk_chart_slot *slot = &chart->slots[chart->slot++];
- slot->type = type;
- slot->count = count;
- slot->color = color;
- slot->highlight = highlight;
- slot->min = NK_MIN(min_value, max_value);
- slot->max = NK_MAX(min_value, max_value);
- slot->range = slot->max - slot->min;}
-}
-
-NK_API void
-nk_chart_add_slot(struct nk_context *ctx, const enum nk_chart_type type,
- int count, float min_value, float max_value)
-{nk_chart_add_slot_colored(ctx, type, ctx->style.chart.color, ctx->style.chart.selected_color, count, min_value, max_value);}
-
-NK_INTERN nk_flags
-nk_chart_push_line(struct nk_context *ctx, struct nk_window *win,
- struct nk_chart *g, float value, int slot)
-{
- struct nk_panel *layout = win->layout;
- const struct nk_input *i = &ctx->input;
- struct nk_command_buffer *out = &win->buffer;
-
- nk_flags ret = 0;
- struct nk_vec2 cur;
- struct nk_rect bounds;
- struct nk_color color;
- float step;
- float range;
- float ratio;
-
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- step = g->w / (float)g->slots[slot].count;
- range = g->slots[slot].max - g->slots[slot].min;
- ratio = (value - g->slots[slot].min) / range;
-
- if (g->slots[slot].index == 0) {
- /* first data point does not have a connection */
- g->slots[slot].last.x = g->x;
- g->slots[slot].last.y = (g->y + g->h) - ratio * (float)g->h;
-
- bounds.x = g->slots[slot].last.x - 2;
- bounds.y = g->slots[slot].last.y - 2;
- bounds.w = bounds.h = 4;
-
- color = g->slots[slot].color;
- if (!(layout->flags & NK_WINDOW_ROM) &&
- NK_INBOX(i->mouse.pos.x,i->mouse.pos.y, g->slots[slot].last.x-3, g->slots[slot].last.y-3, 6, 6)){
- ret = nk_input_is_mouse_hovering_rect(i, bounds) ? NK_CHART_HOVERING : 0;
- ret |= (i->mouse.buttons[NK_BUTTON_LEFT].down &&
- i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = g->slots[slot].highlight;
- }
- nk_fill_rect(out, bounds, 0, color);
- g->slots[slot].index += 1;
- return ret;
- }
-
- /* draw a line between the last data point and the new one */
- color = g->slots[slot].color;
- cur.x = g->x + (float)(step * (float)g->slots[slot].index);
- cur.y = (g->y + g->h) - (ratio * (float)g->h);
- nk_stroke_line(out, g->slots[slot].last.x, g->slots[slot].last.y, cur.x, cur.y, 1.0f, color);
-
- bounds.x = cur.x - 3;
- bounds.y = cur.y - 3;
- bounds.w = bounds.h = 6;
-
- /* user selection of current data point */
- if (!(layout->flags & NK_WINDOW_ROM)) {
- if (nk_input_is_mouse_hovering_rect(i, bounds)) {
- ret = NK_CHART_HOVERING;
- ret |= (!i->mouse.buttons[NK_BUTTON_LEFT].down &&
- i->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = g->slots[slot].highlight;
- }
- }
- nk_fill_rect(out, nk_rect(cur.x - 2, cur.y - 2, 4, 4), 0, color);
-
- /* save current data point position */
- g->slots[slot].last.x = cur.x;
- g->slots[slot].last.y = cur.y;
- g->slots[slot].index += 1;
- return ret;
-}
-
-NK_INTERN nk_flags
-nk_chart_push_column(const struct nk_context *ctx, struct nk_window *win,
- struct nk_chart *chart, float value, int slot)
-{
- struct nk_command_buffer *out = &win->buffer;
- const struct nk_input *in = &ctx->input;
- struct nk_panel *layout = win->layout;
-
- float ratio;
- nk_flags ret = 0;
- struct nk_color color;
- struct nk_rect item = {0,0,0,0};
-
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- if (chart->slots[slot].index >= chart->slots[slot].count)
- return nk_false;
- if (chart->slots[slot].count) {
- float padding = (float)(chart->slots[slot].count-1);
- item.w = (chart->w - padding) / (float)(chart->slots[slot].count);
- }
-
- /* calculate bounds of current bar chart entry */
- color = chart->slots[slot].color;;
- item.h = chart->h * NK_ABS((value/chart->slots[slot].range));
- if (value >= 0) {
- ratio = (value + NK_ABS(chart->slots[slot].min)) / NK_ABS(chart->slots[slot].range);
- item.y = (chart->y + chart->h) - chart->h * ratio;
- } else {
- ratio = (value - chart->slots[slot].max) / chart->slots[slot].range;
- item.y = chart->y + (chart->h * NK_ABS(ratio)) - item.h;
- }
- item.x = chart->x + ((float)chart->slots[slot].index * item.w);
- item.x = item.x + ((float)chart->slots[slot].index);
-
- /* user chart bar selection */
- if (!(layout->flags & NK_WINDOW_ROM) &&
- NK_INBOX(in->mouse.pos.x,in->mouse.pos.y,item.x,item.y,item.w,item.h)) {
- ret = NK_CHART_HOVERING;
- ret |= (!in->mouse.buttons[NK_BUTTON_LEFT].down &&
- in->mouse.buttons[NK_BUTTON_LEFT].clicked) ? NK_CHART_CLICKED: 0;
- color = chart->slots[slot].highlight;
- }
- nk_fill_rect(out, item, 0, color);
- chart->slots[slot].index += 1;
- return ret;
-}
-
-NK_API nk_flags
-nk_chart_push_slot(struct nk_context *ctx, float value, int slot)
-{
- nk_flags flags;
- struct nk_window *win;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(slot >= 0 && slot < NK_CHART_MAX_SLOT);
- NK_ASSERT(slot < ctx->current->layout->chart.slot);
- if (!ctx || !ctx->current || slot >= NK_CHART_MAX_SLOT) return nk_false;
- if (slot >= ctx->current->layout->chart.slot) return nk_false;
-
- win = ctx->current;
- if (win->layout->chart.slot < slot) return nk_false;
- switch (win->layout->chart.slots[slot].type) {
- case NK_CHART_LINES:
- flags = nk_chart_push_line(ctx, win, &win->layout->chart, value, slot); break;
- case NK_CHART_COLUMN:
- flags = nk_chart_push_column(ctx, win, &win->layout->chart, value, slot); break;
- default:
- case NK_CHART_MAX:
- flags = 0;
- }
- return flags;
-}
-
-NK_API nk_flags
-nk_chart_push(struct nk_context *ctx, float value)
-{return nk_chart_push_slot(ctx, value, 0);}
-
-NK_API void
-nk_chart_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_chart *chart;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return;
-
- win = ctx->current;
- chart = &win->layout->chart;
- NK_MEMSET(chart, 0, sizeof(*chart));
- return;
-}
-
-NK_API void
-nk_plot(struct nk_context *ctx, enum nk_chart_type type, const float *values,
- int count, int offset)
-{
- int i = 0;
- float min_value;
- float max_value;
-
- NK_ASSERT(ctx);
- NK_ASSERT(values);
- if (!ctx || !values || !count) return;
-
- min_value = values[offset];
- max_value = values[offset];
- for (i = 0; i < count; ++i) {
- min_value = NK_MIN(values[i + offset], min_value);
- max_value = NK_MAX(values[i + offset], max_value);
- }
-
- if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
- for (i = 0; i < count; ++i)
- nk_chart_push(ctx, values[i + offset]);
- nk_chart_end(ctx);
- }
-}
-
-NK_API void
-nk_plot_function(struct nk_context *ctx, enum nk_chart_type type, void *userdata,
- float(*value_getter)(void* user, int index), int count, int offset)
-{
- int i = 0;
- float min_value;
- float max_value;
-
- NK_ASSERT(ctx);
- NK_ASSERT(value_getter);
- if (!ctx || !value_getter || !count) return;
-
- max_value = min_value = value_getter(userdata, offset);
- for (i = 0; i < count; ++i) {
- float value = value_getter(userdata, i + offset);
- min_value = NK_MIN(value, min_value);
- max_value = NK_MAX(value, max_value);
- }
-
- if (nk_chart_begin(ctx, type, count, min_value, max_value)) {
- for (i = 0; i < count; ++i)
- nk_chart_push(ctx, value_getter(userdata, i + offset));
- nk_chart_end(ctx);
- }
-}
-
-/* -------------------------------------------------------------
- *
- * GROUP
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_group_scrolled_offset_begin(struct nk_context *ctx,
- nk_uint *x_offset, nk_uint *y_offset, const char *title, nk_flags flags)
-{
- struct nk_rect bounds;
- struct nk_window panel;
- struct nk_window *win;
-
- win = ctx->current;
- nk_panel_alloc_space(&bounds, ctx);
- {const struct nk_rect *c = &win->layout->clip;
- if (!NK_INTERSECT(c->x, c->y, c->w, c->h, bounds.x, bounds.y, bounds.w, bounds.h) &&
- !(flags & NK_WINDOW_MOVABLE)) {
- return 0;
- }}
- if (win->flags & NK_WINDOW_ROM)
- flags |= NK_WINDOW_ROM;
-
- /* initialize a fake window to create the panel from */
- nk_zero(&panel, sizeof(panel));
- panel.bounds = bounds;
- panel.flags = flags;
- panel.scrollbar.x = *x_offset;
- panel.scrollbar.y = *y_offset;
- panel.buffer = win->buffer;
- panel.layout = (struct nk_panel*)nk_create_panel(ctx);
- ctx->current = &panel;
- nk_panel_begin(ctx, (flags & NK_WINDOW_TITLE) ? title: 0, NK_PANEL_GROUP);
-
- win->buffer = panel.buffer;
- win->buffer.clip = panel.layout->clip;
- panel.layout->offset_x = x_offset;
- panel.layout->offset_y = y_offset;
- panel.layout->parent = win->layout;
- win->layout = panel.layout;
-
- ctx->current = win;
- if ((panel.layout->flags & NK_WINDOW_CLOSED) ||
- (panel.layout->flags & NK_WINDOW_MINIMIZED))
- {
- nk_flags f = panel.layout->flags;
- nk_group_scrolled_end(ctx);
- if (f & NK_WINDOW_CLOSED)
- return NK_WINDOW_CLOSED;
- if (f & NK_WINDOW_MINIMIZED)
- return NK_WINDOW_MINIMIZED;
- }
- return 1;
-}
-
-NK_API void
-nk_group_scrolled_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_panel *parent;
- struct nk_panel *g;
-
- struct nk_rect clip;
- struct nk_window pan;
- struct nk_vec2 panel_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current)
- return;
-
- /* make sure nk_group_begin was called correctly */
- NK_ASSERT(ctx->current);
- win = ctx->current;
- NK_ASSERT(win->layout);
- g = win->layout;
- NK_ASSERT(g->parent);
- parent = g->parent;
-
- /* dummy window */
- nk_zero_struct(pan);
- panel_padding = nk_panel_get_padding(&ctx->style, NK_PANEL_GROUP);
- pan.bounds.y = g->bounds.y - (g->header_height + g->menu.h);
- pan.bounds.x = g->bounds.x - panel_padding.x;
- pan.bounds.w = g->bounds.w + 2 * panel_padding.x;
- pan.bounds.h = g->bounds.h + g->header_height + g->menu.h;
- if (g->flags & NK_WINDOW_BORDER) {
- pan.bounds.x -= g->border;
- pan.bounds.y -= g->border;
- pan.bounds.w += 2*g->border;
- pan.bounds.h += 2*g->border;
- }
- if (!(g->flags & NK_WINDOW_NO_SCROLLBAR)) {
- pan.bounds.w += ctx->style.window.scrollbar_size.x;
- pan.bounds.h += ctx->style.window.scrollbar_size.y;
- }
- pan.scrollbar.x = *g->offset_x;
- pan.scrollbar.y = *g->offset_y;
- pan.flags = g->flags;
- pan.buffer = win->buffer;
- pan.layout = g;
- pan.parent = win;
- ctx->current = &pan;
-
- /* make sure group has correct clipping rectangle */
- nk_unify(&clip, &parent->clip, pan.bounds.x, pan.bounds.y,
- pan.bounds.x + pan.bounds.w, pan.bounds.y + pan.bounds.h + panel_padding.x);
- nk_push_scissor(&pan.buffer, clip);
- nk_end(ctx);
-
- win->buffer = pan.buffer;
- nk_push_scissor(&win->buffer, parent->clip);
- ctx->current = win;
- win->layout = parent;
- g->bounds = pan.bounds;
- return;
-}
-
-NK_API int
-nk_group_scrolled_begin(struct nk_context *ctx,
- struct nk_scroll *scroll, const char *title, nk_flags flags)
-{return nk_group_scrolled_offset_begin(ctx, &scroll->x, &scroll->y, title, flags);}
-
-NK_API int
-nk_group_begin_titled(struct nk_context *ctx, const char *id,
- const char *title, nk_flags flags)
-{
- int id_len;
- nk_hash id_hash;
- struct nk_window *win;
- nk_uint *x_offset;
- nk_uint *y_offset;
-
- NK_ASSERT(ctx);
- NK_ASSERT(id);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !id)
- return 0;
-
- /* find persistent group scrollbar value */
- win = ctx->current;
- id_len = (int)nk_strlen(id);
- id_hash = nk_murmur_hash(id, (int)id_len, NK_PANEL_GROUP);
- x_offset = nk_find_value(win, id_hash);
- if (!x_offset) {
- x_offset = nk_add_value(ctx, win, id_hash, 0);
- y_offset = nk_add_value(ctx, win, id_hash+1, 0);
-
- NK_ASSERT(x_offset);
- NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, id_hash+1);
- return nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
-}
-
-NK_API int
-nk_group_begin(struct nk_context *ctx, const char *title, nk_flags flags)
-{
- return nk_group_begin_titled(ctx, title, title, flags);
-}
-
-NK_API void
-nk_group_end(struct nk_context *ctx)
-{nk_group_scrolled_end(ctx);}
-
-NK_API int
-nk_list_view_begin(struct nk_context *ctx, struct nk_list_view *view,
- const char *title, nk_flags flags, int row_height, int row_count)
-{
- int title_len;
- nk_hash title_hash;
- nk_uint *x_offset;
- nk_uint *y_offset;
-
- int result;
- struct nk_window *win;
- struct nk_panel *layout;
- const struct nk_style *style;
- struct nk_vec2 item_spacing;
-
- NK_ASSERT(ctx);
- NK_ASSERT(view);
- NK_ASSERT(title);
- if (!ctx || !view || !title) return 0;
-
- win = ctx->current;
- style = &ctx->style;
- item_spacing = style->window.spacing;
- row_height += NK_MAX(0, (int)item_spacing.y);
-
- /* find persistent list view scrollbar offset */
- title_len = (int)nk_strlen(title);
- title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_GROUP);
- x_offset = nk_find_value(win, title_hash);
- if (!x_offset) {
- x_offset = nk_add_value(ctx, win, title_hash, 0);
- y_offset = nk_add_value(ctx, win, title_hash+1, 0);
-
- NK_ASSERT(x_offset);
- NK_ASSERT(y_offset);
- if (!x_offset || !y_offset) return 0;
- *x_offset = *y_offset = 0;
- } else y_offset = nk_find_value(win, title_hash+1);
- view->scroll_value = *y_offset;
- view->scroll_pointer = y_offset;
-
- *y_offset = 0;
- result = nk_group_scrolled_offset_begin(ctx, x_offset, y_offset, title, flags);
- win = ctx->current;
- layout = win->layout;
-
- view->total_height = row_height * NK_MAX(row_count,1);
- view->begin = (int)NK_MAX(((float)view->scroll_value / (float)row_height), 0.0f);
- view->count = (int)NK_MAX(nk_iceilf((layout->clip.h)/(float)row_height), 0);
- view->end = view->begin + view->count;
- view->ctx = ctx;
- return result;
-}
-
-NK_API void
-nk_list_view_end(struct nk_list_view *view)
-{
- struct nk_context *ctx;
- struct nk_window *win;
- struct nk_panel *layout;
-
- NK_ASSERT(view);
- NK_ASSERT(view->ctx);
- NK_ASSERT(view->scroll_pointer);
- if (!view || !view->ctx) return;
-
- ctx = view->ctx;
- win = ctx->current;
- layout = win->layout;
- layout->at_y = layout->bounds.y + (float)view->total_height;
- *view->scroll_pointer = *view->scroll_pointer + view->scroll_value;
- nk_group_end(view->ctx);
-}
-
-/* --------------------------------------------------------------
- *
- * POPUP
- *
- * --------------------------------------------------------------*/
-NK_API int
-nk_popup_begin(struct nk_context *ctx, enum nk_popup_type type,
- const char *title, nk_flags flags, struct nk_rect rect)
-{
- struct nk_window *popup;
- struct nk_window *win;
- struct nk_panel *panel;
-
- int title_len;
- nk_hash title_hash;
- nk_size allocated;
-
- NK_ASSERT(ctx);
- NK_ASSERT(title);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- panel = win->layout;
- NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP) && "popups are not allowed to have popups");
- (void)panel;
- title_len = (int)nk_strlen(title);
- title_hash = nk_murmur_hash(title, (int)title_len, NK_PANEL_POPUP);
-
- popup = win->popup.win;
- if (!popup) {
- popup = (struct nk_window*)nk_create_window(ctx);
- popup->parent = win;
- win->popup.win = popup;
- win->popup.active = 0;
- win->popup.type = NK_PANEL_POPUP;
- }
-
- /* make sure we have correct popup */
- if (win->popup.name != title_hash) {
- if (!win->popup.active) {
- nk_zero(popup, sizeof(*popup));
- win->popup.name = title_hash;
- win->popup.active = 1;
- win->popup.type = NK_PANEL_POPUP;
- } else return 0;
- }
-
- /* popup position is local to window */
- ctx->current = popup;
- rect.x += win->layout->clip.x;
- rect.y += win->layout->clip.y;
-
- /* setup popup data */
- popup->parent = win;
- popup->bounds = rect;
- popup->seq = ctx->seq;
- popup->layout = (struct nk_panel*)nk_create_panel(ctx);
- popup->flags = flags;
- popup->flags |= NK_WINDOW_BORDER;
- if (type == NK_POPUP_DYNAMIC)
- popup->flags |= NK_WINDOW_DYNAMIC;
-
- popup->buffer = win->buffer;
- nk_start_popup(ctx, win);
- allocated = ctx->memory.allocated;
- nk_push_scissor(&popup->buffer, nk_null_rect);
-
- if (nk_panel_begin(ctx, title, NK_PANEL_POPUP)) {
- /* popup is running therefore invalidate parent panels */
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_ROM;
- root->flags &= ~(nk_flags)NK_WINDOW_REMOVE_ROM;
- root = root->parent;
- }
- win->popup.active = 1;
- popup->layout->offset_x = &popup->scrollbar.x;
- popup->layout->offset_y = &popup->scrollbar.y;
- popup->layout->parent = win->layout;
- return 1;
- } else {
- /* popup was closed/is invalid so cleanup */
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
- }
- win->popup.buf.active = 0;
- win->popup.active = 0;
- ctx->memory.allocated = allocated;
- ctx->current = win;
- nk_free_panel(ctx, popup->layout);
- popup->layout = 0;
- return 0;
- }
-}
-
-NK_INTERN int
-nk_nonblock_begin(struct nk_context *ctx,
- nk_flags flags, struct nk_rect body, struct nk_rect header,
- enum nk_panel_type panel_type)
-{
- struct nk_window *popup;
- struct nk_window *win;
- struct nk_panel *panel;
- int is_active = nk_true;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- /* popups cannot have popups */
- win = ctx->current;
- panel = win->layout;
- NK_ASSERT(!(panel->type & NK_PANEL_SET_POPUP));
- (void)panel;
- popup = win->popup.win;
- if (!popup) {
- /* create window for nonblocking popup */
- popup = (struct nk_window*)nk_create_window(ctx);
- popup->parent = win;
- win->popup.win = popup;
- win->popup.type = panel_type;
- nk_command_buffer_init(&popup->buffer, &ctx->memory, NK_CLIPPING_ON);
- } else {
- /* close the popup if user pressed outside or in the header */
- int pressed, in_body, in_header;
- pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
- in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
- in_header = nk_input_is_mouse_hovering_rect(&ctx->input, header);
- if (pressed && (!in_body || in_header))
- is_active = nk_false;
- }
- win->popup.header = header;
-
- if (!is_active) {
- /* remove read only mode from all parent panels */
- struct nk_panel *root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
- }
- return is_active;
- }
-
- popup->bounds = body;
- popup->parent = win;
- popup->layout = (struct nk_panel*)nk_create_panel(ctx);
- popup->flags = flags;
- popup->flags |= NK_WINDOW_BORDER;
- popup->flags |= NK_WINDOW_DYNAMIC;
- popup->seq = ctx->seq;
- win->popup.active = 1;
- NK_ASSERT(popup->layout);
-
- nk_start_popup(ctx, win);
- popup->buffer = win->buffer;
- nk_push_scissor(&popup->buffer, nk_null_rect);
- ctx->current = popup;
-
- nk_panel_begin(ctx, 0, panel_type);
- win->buffer = popup->buffer;
- popup->layout->parent = win->layout;
- popup->layout->offset_x = &popup->scrollbar.x;
- popup->layout->offset_y = &popup->scrollbar.y;
-
- /* set read only mode to all parent panels */
- {struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_ROM;
- root = root->parent;
- }}
- return is_active;
-}
-
-NK_API void
-nk_popup_close(struct nk_context *ctx)
-{
- struct nk_window *popup;
- NK_ASSERT(ctx);
- if (!ctx || !ctx->current) return;
-
- popup = ctx->current;
- NK_ASSERT(popup->parent);
- NK_ASSERT(popup->layout->type & NK_PANEL_SET_POPUP);
- popup->flags |= NK_WINDOW_HIDDEN;
-}
-
-NK_API void
-nk_popup_end(struct nk_context *ctx)
-{
- struct nk_window *win;
- struct nk_window *popup;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return;
-
- popup = ctx->current;
- if (!popup->parent) return;
- win = popup->parent;
- if (popup->flags & NK_WINDOW_HIDDEN) {
- struct nk_panel *root;
- root = win->layout;
- while (root) {
- root->flags |= NK_WINDOW_REMOVE_ROM;
- root = root->parent;
- }
- win->popup.active = 0;
- }
- nk_push_scissor(&popup->buffer, nk_null_rect);
- nk_end(ctx);
-
- win->buffer = popup->buffer;
- nk_finish_popup(ctx, win);
- ctx->current = win;
- nk_push_scissor(&win->buffer, win->layout->clip);
-}
-/* -------------------------------------------------------------
- *
- * TOOLTIP
- *
- * -------------------------------------------------------------- */
-NK_API int
-nk_tooltip_begin(struct nk_context *ctx, float width)
-{
- int x,y,w,h;
- struct nk_window *win;
- const struct nk_input *in;
- struct nk_rect bounds;
- int ret;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- /* make sure that no nonblocking popup is currently active */
- win = ctx->current;
- in = &ctx->input;
- if (win->popup.win && (win->popup.type & NK_PANEL_SET_NONBLOCK))
- return 0;
-
- w = nk_iceilf(width);
- h = nk_iceilf(nk_null_rect.h);
- x = nk_ifloorf(in->mouse.pos.x + 1) - (int)win->layout->clip.x;
- y = nk_ifloorf(in->mouse.pos.y + 1) - (int)win->layout->clip.y;
-
- bounds.x = (float)x;
- bounds.y = (float)y;
- bounds.w = (float)w;
- bounds.h = (float)h;
-
- ret = nk_popup_begin(ctx, NK_POPUP_DYNAMIC,
- "__##Tooltip##__", NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_BORDER, bounds);
- if (ret) win->layout->flags &= ~(nk_flags)NK_WINDOW_ROM;
- win->popup.type = NK_PANEL_TOOLTIP;
- ctx->current->layout->type = NK_PANEL_TOOLTIP;
- return ret;
-}
-
-NK_API void
-nk_tooltip_end(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
- ctx->current->seq--;
- nk_popup_close(ctx);
- nk_popup_end(ctx);
-}
-
-NK_API void
-nk_tooltip(struct nk_context *ctx, const char *text)
-{
- const struct nk_style *style;
- struct nk_vec2 padding;
-
- int text_len;
- float text_width;
- float text_height;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- NK_ASSERT(text);
- if (!ctx || !ctx->current || !ctx->current->layout || !text)
- return;
-
- /* fetch configuration data */
- style = &ctx->style;
- padding = style->window.padding;
-
- /* calculate size of the text and tooltip */
- text_len = nk_strlen(text);
- text_width = style->font->width(style->font->userdata,
- style->font->height, text, text_len);
- text_width += (4 * padding.x);
- text_height = (style->font->height + 2 * padding.y);
-
- /* execute tooltip and fill with text */
- if (nk_tooltip_begin(ctx, (float)text_width)) {
- nk_layout_row_dynamic(ctx, (float)text_height, 1);
- nk_text(ctx, text, text_len, NK_TEXT_LEFT);
- nk_tooltip_end(ctx);
- }
-}
-#ifdef NK_INCLUDE_STANDARD_VARARGS
-NK_API void
-nk_tooltipf(struct nk_context *ctx, const char *fmt, ...)
-{
- char buf[256];
- va_list args;
- va_start(args, fmt);
- nk_strfmt(buf, NK_LEN(buf), fmt, args);
- va_end(args);
- nk_tooltip(ctx, buf);
-}
-#endif
-
-/* -------------------------------------------------------------
- *
- * CONTEXTUAL
- *
- * -------------------------------------------------------------- */
-NK_API int
-nk_contextual_begin(struct nk_context *ctx, nk_flags flags, struct nk_vec2 size,
- struct nk_rect trigger_bounds)
-{
- struct nk_window *win;
- struct nk_window *popup;
- struct nk_rect body;
-
- NK_STORAGE const struct nk_rect null_rect = {0,0,0,0};
- int is_clicked = 0;
- int is_active = 0;
- int is_open = 0;
- int ret = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- ++win->popup.con_count;
-
- /* check if currently active contextual is active */
- popup = win->popup.win;
- is_open = (popup && win->popup.type == NK_PANEL_CONTEXTUAL);
- is_clicked = nk_input_mouse_clicked(&ctx->input, NK_BUTTON_RIGHT, trigger_bounds);
- if (win->popup.active_con && win->popup.con_count != win->popup.active_con)
- return 0;
- if ((is_clicked && is_open && !is_active) || (!is_open && !is_active && !is_clicked))
- return 0;
-
- /* calculate contextual position on click */
- win->popup.active_con = win->popup.con_count;
- if (is_clicked) {
- body.x = ctx->input.mouse.pos.x;
- body.y = ctx->input.mouse.pos.y;
- } else {
- body.x = popup->bounds.x;
- body.y = popup->bounds.y;
- }
- body.w = size.x;
- body.h = size.y;
-
- /* start nonblocking contextual popup */
- ret = nk_nonblock_begin(ctx, flags|NK_WINDOW_NO_SCROLLBAR, body,
- null_rect, NK_PANEL_CONTEXTUAL);
- if (ret) win->popup.type = NK_PANEL_CONTEXTUAL;
- else {
- win->popup.active_con = 0;
- if (win->popup.win)
- win->popup.win->flags = 0;
- }
- return ret;
-}
-
-NK_API int
-nk_contextual_item_text(struct nk_context *ctx, const char *text, int len,
- nk_flags alignment)
-{
- struct nk_window *win;
- const struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, bounds,
- text, len, alignment, NK_BUTTON_DEFAULT, &style->contextual_button, in, style->font)) {
- nk_contextual_close(ctx);
- return nk_true;
- }
- return nk_false;
-}
-
-NK_API int nk_contextual_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_text(ctx, label, nk_strlen(label), align);}
-
-NK_API int
-nk_contextual_item_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
-{
- struct nk_window *win;
- const struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer, bounds,
- img, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)){
- nk_contextual_close(ctx);
- return nk_true;
- }
- return nk_false;
-}
-
-NK_API int nk_contextual_item_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_contextual_item_image_text(ctx, img, label, nk_strlen(label), align);}
-
-NK_API int
-nk_contextual_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *text, int len, nk_flags align)
-{
- struct nk_window *win;
- const struct nk_input *in;
- const struct nk_style *style;
-
- struct nk_rect bounds;
- enum nk_widget_layout_states state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- state = nk_widget_fitting(&bounds, ctx, style->contextual_button.padding);
- if (!state) return nk_false;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer, bounds,
- symbol, text, len, align, NK_BUTTON_DEFAULT, &style->contextual_button, style->font, in)) {
- nk_contextual_close(ctx);
- return nk_true;
- }
- return nk_false;
-}
-
-NK_API int nk_contextual_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type symbol,
- const char *text, nk_flags align)
-{return nk_contextual_item_symbol_text(ctx, symbol, text, nk_strlen(text), align);}
-
-NK_API void
-nk_contextual_close(struct nk_context *ctx)
-{
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout) return;
- nk_popup_close(ctx);
-}
-
-NK_API void
-nk_contextual_end(struct nk_context *ctx)
-{
- struct nk_window *popup;
- struct nk_panel *panel;
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- if (!ctx || !ctx->current) return;
-
- popup = ctx->current;
- panel = popup->layout;
- NK_ASSERT(popup->parent);
- NK_ASSERT(panel->type & NK_PANEL_SET_POPUP);
- if (panel->flags & NK_WINDOW_DYNAMIC) {
- /* Close behavior
- This is a bit of a hack solution since we do not know before we end our popup
- how big it will be. We therefore do not directly know when a
- click outside the non-blocking popup must close it at that direct frame.
- Instead it will be closed in the next frame.*/
- struct nk_rect body = {0,0,0,0};
- if (panel->at_y < (panel->bounds.y + panel->bounds.h)) {
- struct nk_vec2 padding = nk_panel_get_padding(&ctx->style, panel->type);
- body = panel->bounds;
- body.y = (panel->at_y + panel->footer_height + panel->border + padding.y + panel->row.height);
- body.h = (panel->bounds.y + panel->bounds.h) - body.y;
- }
- {int pressed = nk_input_is_mouse_pressed(&ctx->input, NK_BUTTON_LEFT);
- int in_body = nk_input_is_mouse_hovering_rect(&ctx->input, body);
- if (pressed && in_body)
- popup->flags |= NK_WINDOW_HIDDEN;
- }
- }
- if (popup->flags & NK_WINDOW_HIDDEN)
- popup->seq = 0;
- nk_popup_end(ctx);
- return;
-}
-/* -------------------------------------------------------------
- *
- * COMBO
- *
- * --------------------------------------------------------------*/
-NK_INTERN int
-nk_combo_begin(struct nk_context *ctx, struct nk_window *win,
- struct nk_vec2 size, int is_clicked, struct nk_rect header)
-{
- struct nk_window *popup;
- int is_open = 0;
- int is_active = 0;
- struct nk_rect body;
- nk_hash hash;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- popup = win->popup.win;
- body.x = header.x;
- body.w = size.x;
- body.y = header.y + header.h-ctx->style.window.combo_border;
- body.h = size.y;
-
- hash = win->popup.combo_count++;
- is_open = (popup) ? nk_true:nk_false;
- is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_COMBO);
- if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
- (!is_open && !is_active && !is_clicked)) return 0;
- if (!nk_nonblock_begin(ctx, 0, body,
- (is_clicked && is_open)?nk_rect(0,0,0,0):header, NK_PANEL_COMBO)) return 0;
-
- win->popup.type = NK_PANEL_COMBO;
- win->popup.name = hash;
- return 1;
-}
-
-NK_API int
-nk_combo_begin_text(struct nk_context *ctx, const char *selected, int len,
- struct nk_vec2 size)
-{
- const struct nk_input *in;
- struct nk_window *win;
- struct nk_style *style;
-
- enum nk_widget_layout_states s;
- int is_clicked = nk_false;
- struct nk_rect header;
- const struct nk_style_item *background;
- struct nk_text text;
-
- NK_ASSERT(ctx);
- NK_ASSERT(selected);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout || !selected)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (s == NK_WIDGET_INVALID)
- return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->combo.active;
- text.text = style->combo.label_active;
- } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
- background = &style->combo.hover;
- text.text = style->combo.label_hover;
- } else {
- background = &style->combo.normal;
- text.text = style->combo.label_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- text.background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- text.background = background->data.color;
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- /* print currently selected text item */
- struct nk_rect label;
- struct nk_rect button;
- struct nk_rect content;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
-
- /* draw selected label */
- text.padding = nk_vec2(0,0);
- label.x = header.x + style->combo.content_padding.x;
- label.y = header.y + style->combo.content_padding.y;
- label.w = button.x - (style->combo.content_padding.x + style->combo.spacing.x) - label.x;;
- label.h = header.h - 2 * style->combo.content_padding.y;
- nk_widget_text(&win->buffer, label, selected, len, &text,
- NK_TEXT_LEFT, ctx->style.font);
-
- /* draw open/close button */
- nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int nk_combo_begin_label(struct nk_context *ctx, const char *selected, struct nk_vec2 size)
-{return nk_combo_begin_text(ctx, selected, nk_strlen(selected), size);}
-
-NK_API int
-nk_combo_begin_color(struct nk_context *ctx, struct nk_color color, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_style *style;
- const struct nk_input *in;
-
- struct nk_rect header;
- int is_clicked = nk_false;
- enum nk_widget_layout_states s;
- const struct nk_style_item *background;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (s == NK_WIDGET_INVALID)
- return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED)
- background = &style->combo.active;
- else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- background = &style->combo.hover;
- else background = &style->combo.normal;
-
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(&win->buffer, header, &background->data.image,nk_white);
- } else {
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- struct nk_rect content;
- struct nk_rect button;
- struct nk_rect bounds;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
-
- /* draw color */
- bounds.h = header.h - 4 * style->combo.content_padding.y;
- bounds.y = header.y + 2 * style->combo.content_padding.y;
- bounds.x = header.x + 2 * style->combo.content_padding.x;
- bounds.w = (button.x - (style->combo.content_padding.x + style->combo.spacing.x)) - bounds.x;
- nk_fill_rect(&win->buffer, bounds, 0, color);
-
- /* draw open/close button */
- nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int
-nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_style *style;
- const struct nk_input *in;
-
- struct nk_rect header;
- int is_clicked = nk_false;
- enum nk_widget_layout_states s;
- const struct nk_style_item *background;
- struct nk_color sym_background;
- struct nk_color symbol_color;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (s == NK_WIDGET_INVALID)
- return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->combo.active;
- symbol_color = style->combo.symbol_active;
- } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
- background = &style->combo.hover;
- symbol_color = style->combo.symbol_hover;
- } else {
- background = &style->combo.normal;
- symbol_color = style->combo.symbol_hover;
- }
-
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- sym_background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- sym_background = background->data.color;
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- struct nk_rect bounds = {0,0,0,0};
- struct nk_rect content;
- struct nk_rect button;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
-
- /* draw symbol */
- bounds.h = header.h - 2 * style->combo.content_padding.y;
- bounds.y = header.y + style->combo.content_padding.y;
- bounds.x = header.x + style->combo.content_padding.x;
- bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
- nk_draw_symbol(&win->buffer, symbol, bounds, sym_background, symbol_color,
- 1.0f, style->font);
-
- /* draw open/close button */
- nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int
-nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len,
- enum nk_symbol_type symbol, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_style *style;
- struct nk_input *in;
-
- struct nk_rect header;
- int is_clicked = nk_false;
- enum nk_widget_layout_states s;
- const struct nk_style_item *background;
- struct nk_color symbol_color;
- struct nk_text text;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (!s) return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->combo.active;
- symbol_color = style->combo.symbol_active;
- text.text = style->combo.label_active;
- } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
- background = &style->combo.hover;
- symbol_color = style->combo.symbol_hover;
- text.text = style->combo.label_hover;
- } else {
- background = &style->combo.normal;
- symbol_color = style->combo.symbol_normal;
- text.text = style->combo.label_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- text.background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- text.background = background->data.color;
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- struct nk_rect content;
- struct nk_rect button;
- struct nk_rect label;
- struct nk_rect image;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
- nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
-
- /* draw symbol */
- image.x = header.x + style->combo.content_padding.x;
- image.y = header.y + style->combo.content_padding.y;
- image.h = header.h - 2 * style->combo.content_padding.y;
- image.w = image.h;
- nk_draw_symbol(&win->buffer, symbol, image, text.background, symbol_color,
- 1.0f, style->font);
-
- /* draw label */
- text.padding = nk_vec2(0,0);
- label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
- label.y = header.y + style->combo.content_padding.y;
- label.w = (button.x - style->combo.content_padding.x) - label.x;
- label.h = header.h - 2 * style->combo.content_padding.y;
- nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int
-nk_combo_begin_image(struct nk_context *ctx, struct nk_image img, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_style *style;
- const struct nk_input *in;
-
- struct nk_rect header;
- int is_clicked = nk_false;
- enum nk_widget_layout_states s;
- const struct nk_style_item *background;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (s == NK_WIDGET_INVALID)
- return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED)
- background = &style->combo.active;
- else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- background = &style->combo.hover;
- else background = &style->combo.normal;
-
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- struct nk_rect bounds = {0,0,0,0};
- struct nk_rect content;
- struct nk_rect button;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.y;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
-
- /* draw image */
- bounds.h = header.h - 2 * style->combo.content_padding.y;
- bounds.y = header.y + style->combo.content_padding.y;
- bounds.x = header.x + style->combo.content_padding.x;
- bounds.w = (button.x - style->combo.content_padding.y) - bounds.x;
- nk_draw_image(&win->buffer, bounds, &img, nk_white);
-
- /* draw open/close button */
- nk_draw_button_symbol(&win->buffer, &bounds, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int
-nk_combo_begin_image_text(struct nk_context *ctx, const char *selected, int len,
- struct nk_image img, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_style *style;
- struct nk_input *in;
-
- struct nk_rect header;
- int is_clicked = nk_false;
- enum nk_widget_layout_states s;
- const struct nk_style_item *background;
- struct nk_text text;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- style = &ctx->style;
- s = nk_widget(&header, ctx);
- if (!s) return 0;
-
- in = (win->layout->flags & NK_WINDOW_ROM || s == NK_WIDGET_ROM)? 0: &ctx->input;
- if (nk_button_behavior(&ctx->last_widget_state, header, in, NK_BUTTON_DEFAULT))
- is_clicked = nk_true;
-
- /* draw combo box header background and border */
- if (ctx->last_widget_state & NK_WIDGET_STATE_ACTIVED) {
- background = &style->combo.active;
- text.text = style->combo.label_active;
- } else if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER) {
- background = &style->combo.hover;
- text.text = style->combo.label_hover;
- } else {
- background = &style->combo.normal;
- text.text = style->combo.label_normal;
- }
- if (background->type == NK_STYLE_ITEM_IMAGE) {
- text.background = nk_rgba(0,0,0,0);
- nk_draw_image(&win->buffer, header, &background->data.image, nk_white);
- } else {
- text.background = background->data.color;
- nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
- nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
- }
- {
- struct nk_rect content;
- struct nk_rect button;
- struct nk_rect label;
- struct nk_rect image;
-
- enum nk_symbol_type sym;
- if (ctx->last_widget_state & NK_WIDGET_STATE_HOVER)
- sym = style->combo.sym_hover;
- else if (is_clicked)
- sym = style->combo.sym_active;
- else sym = style->combo.sym_normal;
-
- /* calculate button */
- button.w = header.h - 2 * style->combo.button_padding.y;
- button.x = (header.x + header.w - header.h) - style->combo.button_padding.x;
- button.y = header.y + style->combo.button_padding.y;
- button.h = button.w;
-
- content.x = button.x + style->combo.button.padding.x;
- content.y = button.y + style->combo.button.padding.y;
- content.w = button.w - 2 * style->combo.button.padding.x;
- content.h = button.h - 2 * style->combo.button.padding.y;
- nk_draw_button_symbol(&win->buffer, &button, &content, ctx->last_widget_state,
- &ctx->style.combo.button, sym, style->font);
-
- /* draw image */
- image.x = header.x + style->combo.content_padding.x;
- image.y = header.y + style->combo.content_padding.y;
- image.h = header.h - 2 * style->combo.content_padding.y;
- image.w = image.h;
- nk_draw_image(&win->buffer, image, &img, nk_white);
-
- /* draw label */
- text.padding = nk_vec2(0,0);
- label.x = image.x + image.w + style->combo.spacing.x + style->combo.content_padding.x;
- label.y = header.y + style->combo.content_padding.y;
- label.w = (button.x - style->combo.content_padding.x) - label.x;
- label.h = header.h - 2 * style->combo.content_padding.y;
- nk_widget_text(&win->buffer, label, selected, len, &text, NK_TEXT_LEFT, style->font);
- }
- return nk_combo_begin(ctx, win, size, is_clicked, header);
-}
-
-NK_API int nk_combo_begin_symbol_label(struct nk_context *ctx,
- const char *selected, enum nk_symbol_type type, struct nk_vec2 size)
-{return nk_combo_begin_symbol_text(ctx, selected, nk_strlen(selected), type, size);}
-
-NK_API int nk_combo_begin_image_label(struct nk_context *ctx,
- const char *selected, struct nk_image img, struct nk_vec2 size)
-{return nk_combo_begin_image_text(ctx, selected, nk_strlen(selected), img, size);}
-
-NK_API int nk_combo_item_text(struct nk_context *ctx, const char *text, int len,nk_flags align)
-{return nk_contextual_item_text(ctx, text, len, align);}
-
-NK_API int nk_combo_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_label(ctx, label, align);}
-
-NK_API int nk_combo_item_image_text(struct nk_context *ctx, struct nk_image img, const char *text,
- int len, nk_flags alignment)
-{return nk_contextual_item_image_text(ctx, img, text, len, alignment);}
-
-NK_API int nk_combo_item_image_label(struct nk_context *ctx, struct nk_image img,
- const char *text, nk_flags alignment)
-{return nk_contextual_item_image_label(ctx, img, text, alignment);}
-
-NK_API int nk_combo_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *text, int len, nk_flags alignment)
-{return nk_contextual_item_symbol_text(ctx, sym, text, len, alignment);}
-
-NK_API int nk_combo_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *label, nk_flags alignment)
-{return nk_contextual_item_symbol_label(ctx, sym, label, alignment);}
-
-NK_API void nk_combo_end(struct nk_context *ctx)
-{nk_contextual_end(ctx);}
-
-NK_API void nk_combo_close(struct nk_context *ctx)
-{nk_contextual_close(ctx);}
-
-NK_API int
-nk_combo(struct nk_context *ctx, const char **items, int count,
- int selected, int item_height, struct nk_vec2 size)
-{
- int i = 0;
- int max_height;
- struct nk_vec2 item_spacing;
- struct nk_vec2 window_padding;
-
- NK_ASSERT(ctx);
- NK_ASSERT(items);
- NK_ASSERT(ctx->current);
- if (!ctx || !items ||!count)
- return selected;
-
- item_spacing = ctx->style.window.spacing;
- window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
- max_height = count * item_height + count * (int)item_spacing.y;
- max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
- size.y = NK_MIN(size.y, (float)max_height);
- if (nk_combo_begin_label(ctx, items[selected], size)) {
- nk_layout_row_dynamic(ctx, (float)item_height, 1);
- for (i = 0; i < count; ++i) {
- if (nk_combo_item_label(ctx, items[i], NK_TEXT_LEFT))
- selected = i;
- }
- nk_combo_end(ctx);
- }
- return selected;
-}
-
-NK_API int
-nk_combo_separator(struct nk_context *ctx, const char *items_separated_by_separator,
- int separator, int selected, int count, int item_height, struct nk_vec2 size)
-{
- int i;
- int max_height;
- struct nk_vec2 item_spacing;
- struct nk_vec2 window_padding;
- const char *current_item;
- const char *iter;
- int length = 0;
-
- NK_ASSERT(ctx);
- NK_ASSERT(items_separated_by_separator);
- if (!ctx || !items_separated_by_separator)
- return selected;
-
- /* calculate popup window */
- item_spacing = ctx->style.window.spacing;
- window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
- max_height = count * item_height + count * (int)item_spacing.y;
- max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
- size.y = NK_MIN(size.y, (float)max_height);
-
- /* find selected item */
- current_item = items_separated_by_separator;
- for (i = 0; i < count; ++i) {
- iter = current_item;
- while (*iter && *iter != separator) iter++;
- length = (int)(iter - current_item);
- if (i == selected) break;
- current_item = iter + 1;
- }
-
- if (nk_combo_begin_text(ctx, current_item, length, size)) {
- current_item = items_separated_by_separator;
- nk_layout_row_dynamic(ctx, (float)item_height, 1);
- for (i = 0; i < count; ++i) {
- iter = current_item;
- while (*iter && *iter != separator) iter++;
- length = (int)(iter - current_item);
- if (nk_combo_item_text(ctx, current_item, length, NK_TEXT_LEFT))
- selected = i;
- current_item = current_item + length + 1;
- }
- nk_combo_end(ctx);
- }
- return selected;
-}
-
-NK_API int
-nk_combo_string(struct nk_context *ctx, const char *items_separated_by_zeros,
- int selected, int count, int item_height, struct nk_vec2 size)
-{return nk_combo_separator(ctx, items_separated_by_zeros, '\0', selected, count, item_height, size);}
-
-NK_API int
-nk_combo_callback(struct nk_context *ctx, void(*item_getter)(void*, int, const char**),
- void *userdata, int selected, int count, int item_height, struct nk_vec2 size)
-{
- int i;
- int max_height;
- struct nk_vec2 item_spacing;
- struct nk_vec2 window_padding;
- const char *item;
-
- NK_ASSERT(ctx);
- NK_ASSERT(item_getter);
- if (!ctx || !item_getter)
- return selected;
-
- /* calculate popup window */
- item_spacing = ctx->style.window.spacing;
- window_padding = nk_panel_get_padding(&ctx->style, ctx->current->layout->type);
- max_height = count * item_height + count * (int)item_spacing.y;
- max_height += (int)item_spacing.y * 2 + (int)window_padding.y * 2;
- size.y = NK_MIN(size.y, (float)max_height);
-
- item_getter(userdata, selected, &item);
- if (nk_combo_begin_label(ctx, item, size)) {
- nk_layout_row_dynamic(ctx, (float)item_height, 1);
- for (i = 0; i < count; ++i) {
- item_getter(userdata, i, &item);
- if (nk_combo_item_label(ctx, item, NK_TEXT_LEFT))
- selected = i;
- }
- nk_combo_end(ctx);
- }
- return selected;
-}
-
-NK_API void nk_combobox(struct nk_context *ctx, const char **items, int count,
- int *selected, int item_height, struct nk_vec2 size)
-{*selected = nk_combo(ctx, items, count, *selected, item_height, size);}
-
-NK_API void nk_combobox_string(struct nk_context *ctx, const char *items_separated_by_zeros,
- int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_string(ctx, items_separated_by_zeros, *selected, count, item_height, size);}
-
-NK_API void nk_combobox_separator(struct nk_context *ctx, const char *items_separated_by_separator,
- int separator,int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_separator(ctx, items_separated_by_separator, separator,
- *selected, count, item_height, size);}
-
-NK_API void nk_combobox_callback(struct nk_context *ctx,
- void(*item_getter)(void* data, int id, const char **out_text),
- void *userdata, int *selected, int count, int item_height, struct nk_vec2 size)
-{*selected = nk_combo_callback(ctx, item_getter, userdata, *selected, count, item_height, size);}
-
-/*
- * -------------------------------------------------------------
- *
- * MENU
- *
- * --------------------------------------------------------------
- */
-NK_INTERN int
-nk_menu_begin(struct nk_context *ctx, struct nk_window *win,
- const char *id, int is_clicked, struct nk_rect header, struct nk_vec2 size)
-{
- int is_open = 0;
- int is_active = 0;
- struct nk_rect body;
- struct nk_window *popup;
- nk_hash hash = nk_murmur_hash(id, (int)nk_strlen(id), NK_PANEL_MENU);
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- body.x = header.x;
- body.w = size.x;
- body.y = header.y + header.h;
- body.h = size.y;
-
- popup = win->popup.win;
- is_open = popup ? nk_true : nk_false;
- is_active = (popup && (win->popup.name == hash) && win->popup.type == NK_PANEL_MENU);
- if ((is_clicked && is_open && !is_active) || (is_open && !is_active) ||
- (!is_open && !is_active && !is_clicked)) return 0;
- if (!nk_nonblock_begin(ctx, NK_WINDOW_NO_SCROLLBAR, body, header, NK_PANEL_MENU))
- return 0;
-
- win->popup.type = NK_PANEL_MENU;
- win->popup.name = hash;
- return 1;
-}
-
-NK_API int
-nk_menu_begin_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, struct nk_vec2 size)
-{
- struct nk_window *win;
- const struct nk_input *in;
- struct nk_rect header;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text(&ctx->last_widget_state, &win->buffer, header,
- title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
-}
-
-NK_API int nk_menu_begin_label(struct nk_context *ctx,
- const char *text, nk_flags align, struct nk_vec2 size)
-{return nk_menu_begin_text(ctx, text, nk_strlen(text), align, size);}
-
-NK_API int
-nk_menu_begin_image(struct nk_context *ctx, const char *id, struct nk_image img,
- struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_image(&ctx->last_widget_state, &win->buffer, header,
- img, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, id, is_clicked, header, size);
-}
-
-NK_API int
-nk_menu_begin_symbol(struct nk_context *ctx, const char *id,
- enum nk_symbol_type sym, struct nk_vec2 size)
-{
- struct nk_window *win;
- const struct nk_input *in;
- struct nk_rect header;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_symbol(&ctx->last_widget_state, &win->buffer, header,
- sym, NK_BUTTON_DEFAULT, &ctx->style.menu_button, in, ctx->style.font))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, id, is_clicked, header, size);
-}
-
-NK_API int
-nk_menu_begin_image_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, struct nk_image img, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_image(&ctx->last_widget_state, &win->buffer,
- header, img, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
- ctx->style.font, in))
- is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
-}
-
-NK_API int nk_menu_begin_image_label(struct nk_context *ctx,
- const char *title, nk_flags align, struct nk_image img, struct nk_vec2 size)
-{return nk_menu_begin_image_text(ctx, title, nk_strlen(title), align, img, size);}
-
-NK_API int
-nk_menu_begin_symbol_text(struct nk_context *ctx, const char *title, int len,
- nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size)
-{
- struct nk_window *win;
- struct nk_rect header;
- const struct nk_input *in;
- int is_clicked = nk_false;
- nk_flags state;
-
- NK_ASSERT(ctx);
- NK_ASSERT(ctx->current);
- NK_ASSERT(ctx->current->layout);
- if (!ctx || !ctx->current || !ctx->current->layout)
- return 0;
-
- win = ctx->current;
- state = nk_widget(&header, ctx);
- if (!state) return 0;
-
- in = (state == NK_WIDGET_ROM || win->layout->flags & NK_WINDOW_ROM) ? 0 : &ctx->input;
- if (nk_do_button_text_symbol(&ctx->last_widget_state, &win->buffer,
- header, sym, title, len, align, NK_BUTTON_DEFAULT, &ctx->style.menu_button,
- ctx->style.font, in)) is_clicked = nk_true;
- return nk_menu_begin(ctx, win, title, is_clicked, header, size);
-}
-
-NK_API int nk_menu_begin_symbol_label(struct nk_context *ctx,
- const char *title, nk_flags align, enum nk_symbol_type sym, struct nk_vec2 size )
-{return nk_menu_begin_symbol_text(ctx, title, nk_strlen(title), align,sym,size);}
-
-NK_API int nk_menu_item_text(struct nk_context *ctx, const char *title, int len, nk_flags align)
-{return nk_contextual_item_text(ctx, title, len, align);}
-
-NK_API int nk_menu_item_label(struct nk_context *ctx, const char *label, nk_flags align)
-{return nk_contextual_item_label(ctx, label, align);}
-
-NK_API int nk_menu_item_image_label(struct nk_context *ctx, struct nk_image img,
- const char *label, nk_flags align)
-{return nk_contextual_item_image_label(ctx, img, label, align);}
-
-NK_API int nk_menu_item_image_text(struct nk_context *ctx, struct nk_image img,
- const char *text, int len, nk_flags align)
-{return nk_contextual_item_image_text(ctx, img, text, len, align);}
-
-NK_API int nk_menu_item_symbol_text(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *text, int len, nk_flags align)
-{return nk_contextual_item_symbol_text(ctx, sym, text, len, align);}
-
-NK_API int nk_menu_item_symbol_label(struct nk_context *ctx, enum nk_symbol_type sym,
- const char *label, nk_flags align)
-{return nk_contextual_item_symbol_label(ctx, sym, label, align);}
-
-NK_API void nk_menu_close(struct nk_context *ctx)
-{nk_contextual_close(ctx);}
-
-NK_API void
-nk_menu_end(struct nk_context *ctx)
-{nk_contextual_end(ctx);}
-
-#endif /* NK_IMPLEMENTATION */
-
-/*
-/// ## License
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none
-/// ------------------------------------------------------------------------------
-/// This software is available under 2 licenses -- choose whichever you prefer.
-/// ------------------------------------------------------------------------------
-/// ALTERNATIVE A - MIT License
-/// Copyright (c) 2016-2018 Micha Mettke
-/// 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.
-/// ------------------------------------------------------------------------------
-/// ALTERNATIVE B - Public Domain (www.unlicense.org)
-/// This is free and unencumbered software released into the public domain.
-/// Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
-/// software, either in source code form or as a compiled binary, for any purpose,
-/// commercial or non-commercial, and by any means.
-/// In jurisdictions that recognize copyright laws, the author or authors of this
-/// software dedicate any and all copyright interest in the software to the public
-/// domain. We make this dedication for the benefit of the public at large and to
-/// the detriment of our heirs and successors. We intend this dedication to be an
-/// overt act of relinquishment in perpetuity of all present and future rights to
-/// this software under copyright law.
-/// 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 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.
-/// ------------------------------------------------------------------------------
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-/// ## Changelog
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~none
-/// [date][x.yy.zz]-[description]
-/// -[date]: date on which the change has been pushed
-/// -[x.yy.zz]: Numerical version string representation. Each version number on the right
-/// resets back to zero if version on the left is incremented.
-/// - [x]: Major version with API and library breaking
-/// - [yy]: Minor version with non-breaking API and library changes
-/// - [zz]: Bug fix version with no direct changes to API
-///
-/// - 2018/02/23 (3.00.6) - Fixed slider dragging behavior
-/// - 2018/01/31 (3.00.5) - Fixed overcalculation of cursor data in font baking process
-/// - 2018/01/31 (3.00.4) - Removed name collision with stb_truetype
-/// - 2018/01/28 (3.00.3) - Fixed panel window border drawing bug
-/// - 2018/01/12 (3.00.2) - Added `nk_group_begin_titled` for separed group identifier and title
-/// - 2018/01/07 (3.00.1) - Started to change documentation style
-/// - 2018/01/05 (3.00.0) - BREAKING CHANGE: The previous color picker API was broken
-/// because of conversions between float and byte color representation.
-/// Color pickers now use floating point values to represent
-/// HSV values. To get back the old behavior I added some additional
-/// color conversion functions to cast between nk_color and
-/// nk_colorf.
-/// - 2017/12/23 (2.00.7) - Fixed small warning
-/// - 2017/12/23 (2.00.7) - Fixed nk_edit_buffer behavior if activated to allow input
-/// - 2017/12/23 (2.00.7) - Fixed modifyable progressbar dragging visuals and input behavior
-/// - 2017/12/04 (2.00.6) - Added formated string tooltip widget
-/// - 2017/11/18 (2.00.5) - Fixed window becoming hidden with flag NK_WINDOW_NO_INPUT
-/// - 2017/11/15 (2.00.4) - Fixed font merging
-/// - 2017/11/07 (2.00.3) - Fixed window size and position modifier functions
-/// - 2017/09/14 (2.00.2) - Fixed nk_edit_buffer and nk_edit_focus behavior
-/// - 2017/09/14 (2.00.1) - Fixed window closing behavior
-/// - 2017/09/14 (2.00.0) - BREAKING CHANGE: Modifing window position and size funtions now
-/// require the name of the window and must happen outside the window
-/// building process (between function call nk_begin and nk_end).
-/// - 2017/09/11 (1.40.9) - Fixed window background flag if background window is declared last
-/// - 2017/08/27 (1.40.8) - Fixed `nk_item_is_any_active` for hidden windows
-/// - 2017/08/27 (1.40.7) - Fixed window background flag
-/// - 2017/07/07 (1.40.6) - Fixed missing clipping rect check for hovering/clicked
-/// query for widgets
-/// - 2017/07/07 (1.40.5) - Fixed drawing bug for vertex output for lines and stroked
-/// and filled rectangles
-/// - 2017/07/07 (1.40.4) - Fixed bug in nk_convert trying to add windows that are in
-/// process of being destroyed.
-/// - 2017/07/07 (1.40.3) - Fixed table internal bug caused by storing table size in
-/// window instead of directly in table.
-/// - 2017/06/30 (1.40.2) - Removed unneeded semicolon in C++ NK_ALIGNOF macro
-/// - 2017/06/30 (1.40.1) - Fixed drawing lines smaller or equal zero
-/// - 2017/06/08 (1.40.0) - Removed the breaking part of last commit. Auto layout now only
-/// comes in effect if you pass in zero was row height argument
-/// - 2017/06/08 (1.40.0) - BREAKING CHANGE: while not directly API breaking it will change
-/// how layouting works. From now there will be an internal minimum
-/// row height derived from font height. If you need a row smaller than
-/// that you can directly set it by `nk_layout_set_min_row_height` and
-/// reset the value back by calling `nk_layout_reset_min_row_height.
-/// - 2017/06/08 (1.39.1) - Fixed property text edit handling bug caused by past `nk_widget` fix
-/// - 2017/06/08 (1.39.0) - Added function to retrieve window space without calling a nk_layout_xxx function
-/// - 2017/06/06 (1.38.5) - Fixed `nk_convert` return flag for command buffer
-/// - 2017/05/23 (1.38.4) - Fixed activation behavior for widgets partially clipped
-/// - 2017/05/10 (1.38.3) - Fixed wrong min window size mouse scaling over boundries
-/// - 2017/05/09 (1.38.2) - Fixed vertical scrollbar drawing with not enough space
-/// - 2017/05/09 (1.38.1) - Fixed scaler dragging behavior if window size hits minimum size
-/// - 2017/05/06 (1.38.0) - Added platform double-click support
-/// - 2017/04/20 (1.37.1) - Fixed key repeat found inside glfw demo backends
-/// - 2017/04/20 (1.37.0) - Extended properties with selection and clipbard support
-/// - 2017/04/20 (1.36.2) - Fixed #405 overlapping rows with zero padding and spacing
-/// - 2017/04/09 (1.36.1) - Fixed #403 with another widget float error
-/// - 2017/04/09 (1.36.0) - Added window `NK_WINDOW_NO_INPUT` and `NK_WINDOW_NOT_INTERACTIVE` flags
-/// - 2017/04/09 (1.35.3) - Fixed buffer heap corruption
-/// - 2017/03/25 (1.35.2) - Fixed popup overlapping for `NK_WINDOW_BACKGROUND` windows
-/// - 2017/03/25 (1.35.1) - Fixed windows closing behavior
-/// - 2017/03/18 (1.35.0) - Added horizontal scroll requested in #377
-/// - 2017/03/18 (1.34.3) - Fixed long window header titles
-/// - 2017/03/04 (1.34.2) - Fixed text edit filtering
-/// - 2017/03/04 (1.34.1) - Fixed group closable flag
-/// - 2017/02/25 (1.34.0) - Added custom draw command for better language binding support
-/// - 2017/01/24 (1.33.0) - Added programatic way of remove edit focus
-/// - 2017/01/24 (1.32.3) - Fixed wrong define for basic type definitions for windows
-/// - 2017/01/21 (1.32.2) - Fixed input capture from hidden or closed windows
-/// - 2017/01/21 (1.32.1) - Fixed slider behavior and drawing
-/// - 2017/01/13 (1.32.0) - Added flag to put scaler into the bottom left corner
-/// - 2017/01/13 (1.31.0) - Added additional row layouting method to combine both
-/// dynamic and static widgets.
-/// - 2016/12/31 (1.30.0) - Extended scrollbar offset from 16-bit to 32-bit
-/// - 2016/12/31 (1.29.2)- Fixed closing window bug of minimized windows
-/// - 2016/12/03 (1.29.1)- Fixed wrapped text with no seperator and C89 error
-/// - 2016/12/03 (1.29.0) - Changed text wrapping to process words not characters
-/// - 2016/11/22 (1.28.6)- Fixed window minimized closing bug
-/// - 2016/11/19 (1.28.5)- Fixed abstract combo box closing behavior
-/// - 2016/11/19 (1.28.4)- Fixed tooltip flickering
-/// - 2016/11/19 (1.28.3)- Fixed memory leak caused by popup repeated closing
-/// - 2016/11/18 (1.28.2)- Fixed memory leak caused by popup panel allocation
-/// - 2016/11/10 (1.28.1)- Fixed some warnings and C++ error
-/// - 2016/11/10 (1.28.0)- Added additional `nk_button` versions which allows to directly
-/// pass in a style struct to change buttons visual.
-/// - 2016/11/10 (1.27.0)- Added additional 'nk_tree' versions to support external state
-/// storage. Just like last the `nk_group` commit the main
-/// advantage is that you optionally can minimize nuklears runtime
-/// memory consumption or handle hash collisions.
-/// - 2016/11/09 (1.26.0)- Added additional `nk_group` version to support external scrollbar
-/// offset storage. Main advantage is that you can externalize
-/// the memory management for the offset. It could also be helpful
-/// if you have a hash collision in `nk_group_begin` but really
-/// want the name. In addition I added `nk_list_view` which allows
-/// to draw big lists inside a group without actually having to
-/// commit the whole list to nuklear (issue #269).
-/// - 2016/10/30 (1.25.1)- Fixed clipping rectangle bug inside `nk_draw_list`
-/// - 2016/10/29 (1.25.0)- Pulled `nk_panel` memory management into nuklear and out of
-/// the hands of the user. From now on users don't have to care
-/// about panels unless they care about some information. If you
-/// still need the panel just call `nk_window_get_panel`.
-/// - 2016/10/21 (1.24.0)- Changed widget border drawing to stroked rectangle from filled
-/// rectangle for less overdraw and widget background transparency.
-/// - 2016/10/18 (1.23.0)- Added `nk_edit_focus` for manually edit widget focus control
-/// - 2016/09/29 (1.22.7)- Fixed deduction of basic type in non `<stdint.h>` compilation
-/// - 2016/09/29 (1.22.6)- Fixed edit widget UTF-8 text cursor drawing bug
-/// - 2016/09/28 (1.22.5)- Fixed edit widget UTF-8 text appending/inserting/removing
-/// - 2016/09/28 (1.22.4)- Fixed drawing bug inside edit widgets which offset all text
-/// text in every edit widget if one of them is scrolled.
-/// - 2016/09/28 (1.22.3)- Fixed small bug in edit widgets if not active. The wrong
-/// text length is passed. It should have been in bytes but
-/// was passed as glyphes.
-/// - 2016/09/20 (1.22.2)- Fixed color button size calculation
-/// - 2016/09/20 (1.22.1)- Fixed some `nk_vsnprintf` behavior bugs and removed
-/// `<stdio.h>` again from `NK_INCLUDE_STANDARD_VARARGS`.
-/// - 2016/09/18 (1.22.0)- C89 does not support vsnprintf only C99 and newer as well
-/// as C++11 and newer. In addition to use vsnprintf you have
-/// to include <stdio.h>. So just defining `NK_INCLUDE_STD_VAR_ARGS`
-/// is not enough. That behavior is now fixed. By default if
-/// both varargs as well as stdio is selected I try to use
-/// vsnprintf if not possible I will revert to vsprintf. If
-/// varargs but not stdio was defined I will use my own function.
-/// - 2016/09/15 (1.21.2)- Fixed panel `close` behavior for deeper panel levels
-/// - 2016/09/15 (1.21.1)- Fixed C++ errors and wrong argument to `nk_panel_get_xxxx`
-/// - 2016/09/13 (1.21.0) - !BREAKING! Fixed nonblocking popup behavior in menu, combo,
-/// and contextual which prevented closing in y-direction if
-/// popup did not reach max height.
-/// In addition the height parameter was changed into vec2
-/// for width and height to have more control over the popup size.
-/// - 2016/09/13 (1.20.3) - Cleaned up and extended type selection
-/// - 2016/09/13 (1.20.2)- Fixed slider behavior hopefully for the last time. This time
-/// all calculation are correct so no more hackery.
-/// - 2016/09/13 (1.20.1)- Internal change to divide window/panel flags into panel flags and types.
-/// Suprisinly spend years in C and still happened to confuse types
-/// with flags. Probably something to take note.
-/// - 2016/09/08 (1.20.0)- Added additional helper function to make it easier to just
-/// take the produced buffers from `nk_convert` and unplug the
-/// iteration process from `nk_context`. So now you can
-/// just use the vertex,element and command buffer + two pointer
-/// inside the command buffer retrieved by calls `nk__draw_begin`
-/// and `nk__draw_end` and macro `nk_draw_foreach_bounded`.
-/// - 2016/09/08 (1.19.0)- Added additional asserts to make sure every `nk_xxx_begin` call
-/// for windows, popups, combobox, menu and contextual is guarded by
-/// `if` condition and does not produce false drawing output.
-/// - 2016/09/08 (1.18.0)- Changed confusing name for `NK_SYMBOL_RECT_FILLED`, `NK_SYMBOL_RECT`
-/// to hopefully easier to understand `NK_SYMBOL_RECT_FILLED` and
-/// `NK_SYMBOL_RECT_OUTLINE`.
-/// - 2016/09/08 (1.17.0)- Changed confusing name for `NK_SYMBOL_CIRLCE_FILLED`, `NK_SYMBOL_CIRCLE`
-/// to hopefully easier to understand `NK_SYMBOL_CIRCLE_FILLED` and
-/// `NK_SYMBOL_CIRCLE_OUTLINE`.
-/// - 2016/09/08 (1.16.0)- Added additional checks to select correct types if `NK_INCLUDE_FIXED_TYPES`
-/// is not defined by supporting the biggest compiler GCC, clang and MSVC.
-/// - 2016/09/07 (1.15.3)- Fixed `NK_INCLUDE_COMMAND_USERDATA` define to not cause an error
-/// - 2016/09/04 (1.15.2)- Fixed wrong combobox height calculation
-/// - 2016/09/03 (1.15.1)- Fixed gaps inside combo boxes in OpenGL
-/// - 2016/09/02 (1.15.0) - Changed nuklear to not have any default vertex layout and
-/// instead made it user provided. The range of types to convert
-/// to is quite limited at the moment, but I would be more than
-/// happy to accept PRs to add additional.
-/// - 2016/08/30 (1.14.2) - Removed unused variables
-/// - 2016/08/30 (1.14.1) - Fixed C++ build errors
-/// - 2016/08/30 (1.14.0) - Removed mouse dragging from SDL demo since it does not work correctly
-/// - 2016/08/30 (1.13.4) - Tweaked some default styling variables
-/// - 2016/08/30 (1.13.3) - Hopefully fixed drawing bug in slider, in general I would
-/// refrain from using slider with a big number of steps.
-/// - 2016/08/30 (1.13.2) - Fixed close and minimize button which would fire even if the
-/// window was in Read Only Mode.
-/// - 2016/08/30 (1.13.1) - Fixed popup panel padding handling which was previously just
-/// a hack for combo box and menu.
-/// - 2016/08/30 (1.13.0) - Removed `NK_WINDOW_DYNAMIC` flag from public API since
-/// it is bugged and causes issues in window selection.
-/// - 2016/08/30 (1.12.0) - Removed scaler size. The size of the scaler is now
-/// determined by the scrollbar size
-/// - 2016/08/30 (1.11.2) - Fixed some drawing bugs caused by changes from 1.11
-/// - 2016/08/30 (1.11.1) - Fixed overlapping minimized window selection
-/// - 2016/08/30 (1.11.0) - Removed some internal complexity and overly complex code
-/// handling panel padding and panel border.
-/// - 2016/08/29 (1.10.0) - Added additional height parameter to `nk_combobox_xxx`
-/// - 2016/08/29 (1.10.0) - Fixed drawing bug in dynamic popups
-/// - 2016/08/29 (1.10.0) - Added experimental mouse scrolling to popups, menus and comboboxes
-/// - 2016/08/26 (1.10.0) - Added window name string prepresentation to account for
-/// hash collisions. Currently limited to NK_WINDOW_MAX_NAME
-/// which in term can be redefined if not big enough.
-/// - 2016/08/26 (1.10.0) - Added stacks for temporary style/UI changes in code
-/// - 2016/08/25 (1.10.0) - Changed `nk_input_is_key_pressed` and 'nk_input_is_key_released'
-/// to account for key press and release happening in one frame.
-/// - 2016/08/25 (1.10.0) - Added additional nk_edit flag to directly jump to the end on activate
-/// - 2016/08/17 (1.09.6)- Removed invalid check for value zero in nk_propertyx
-/// - 2016/08/16 (1.09.5)- Fixed ROM mode for deeper levels of popup windows parents.
-/// - 2016/08/15 (1.09.4)- Editbox are now still active if enter was pressed with flag
-/// `NK_EDIT_SIG_ENTER`. Main reasoning is to be able to keep
-/// typing after commiting.
-/// - 2016/08/15 (1.09.4)- Removed redundant code
-/// - 2016/08/15 (1.09.4)- Fixed negative numbers in `nk_strtoi` and remove unused variable
-/// - 2016/08/15 (1.09.3)- Fixed `NK_WINDOW_BACKGROUND` flag behavior to select a background
-/// window only as selected by hovering and not by clicking.
-/// - 2016/08/14 (1.09.2)- Fixed a bug in font atlas which caused wrong loading
-/// of glyphes for font with multiple ranges.
-/// - 2016/08/12 (1.09.1)- Added additional function to check if window is currently
-/// hidden and therefore not visible.
-/// - 2016/08/12 (1.09.1)- nk_window_is_closed now queries the correct flag `NK_WINDOW_CLOSED`
-/// instead of the old flag `NK_WINDOW_HIDDEN`
-/// - 2016/08/09 (1.09.0) - Added additional double version to nk_property and changed
-/// the underlying implementation to not cast to float and instead
-/// work directly on the given values.
-/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal
-/// floating pointer number to string conversion for additional
-/// precision.
-/// - 2016/08/09 (1.08.0) - Added additional define to overwrite library internal
-/// string to floating point number conversion for additional
-/// precision.
-/// - 2016/08/08 (1.07.2)- Fixed compiling error without define NK_INCLUDE_FIXED_TYPE
-/// - 2016/08/08 (1.07.1)- Fixed possible floating point error inside `nk_widget` leading
-/// to wrong wiget width calculation which results in widgets falsly
-/// becomming tagged as not inside window and cannot be accessed.
-/// - 2016/08/08 (1.07.0) - Nuklear now differentiates between hiding a window (NK_WINDOW_HIDDEN) and
-/// closing a window (NK_WINDOW_CLOSED). A window can be hidden/shown
-/// by using `nk_window_show` and closed by either clicking the close
-/// icon in a window or by calling `nk_window_close`. Only closed
-/// windows get removed at the end of the frame while hidden windows
-/// remain.
-/// - 2016/08/08 (1.06.0) - Added `nk_edit_string_zero_terminated` as a second option to
-/// `nk_edit_string` which takes, edits and outputs a '\0' terminated string.
-/// - 2016/08/08 (1.05.4)- Fixed scrollbar auto hiding behavior
-/// - 2016/08/08 (1.05.3)- Fixed wrong panel padding selection in `nk_layout_widget_space`
-/// - 2016/08/07 (1.05.2)- Fixed old bug in dynamic immediate mode layout API, calculating
-/// wrong item spacing and panel width.
-///- 2016/08/07 (1.05.1)- Hopefully finally fixed combobox popup drawing bug
-///- 2016/08/07 (1.05.0) - Split varargs away from NK_INCLUDE_STANDARD_IO into own
-/// define NK_INCLUDE_STANDARD_VARARGS to allow more fine
-/// grained controlled over library includes.
-/// - 2016/08/06 (1.04.5)- Changed memset calls to NK_MEMSET
-/// - 2016/08/04 (1.04.4)- Fixed fast window scaling behavior
-/// - 2016/08/04 (1.04.3)- Fixed window scaling, movement bug which appears if you
-/// move/scale a window and another window is behind it.
-/// If you are fast enough then the window behind gets activated
-/// and the operation is blocked. I now require activating
-/// by hovering only if mouse is not pressed.
-/// - 2016/08/04 (1.04.2)- Fixed changing fonts
-/// - 2016/08/03 (1.04.1)- Fixed `NK_WINDOW_BACKGROUND` behavior
-/// - 2016/08/03 (1.04.0) - Added color parameter to `nk_draw_image`
-/// - 2016/08/03 (1.04.0) - Added additional window padding style attributes for
-/// sub windows (combo, menu, ...)
-/// - 2016/08/03 (1.04.0) - Added functions to show/hide software cursor
-/// - 2016/08/03 (1.04.0) - Added `NK_WINDOW_BACKGROUND` flag to force a window
-/// to be always in the background of the screen
-/// - 2016/08/03 (1.03.2)- Removed invalid assert macro for NK_RGB color picker
-/// - 2016/08/01 (1.03.1)- Added helper macros into header include guard
-/// - 2016/07/29 (1.03.0) - Moved the window/table pool into the header part to
-/// simplify memory management by removing the need to
-/// allocate the pool.
-/// - 2016/07/29 (1.02.0) - Added auto scrollbar hiding window flag which if enabled
-/// will hide the window scrollbar after NK_SCROLLBAR_HIDING_TIMEOUT
-/// seconds without window interaction. To make it work
-/// you have to also set a delta time inside the `nk_context`.
-/// - 2016/07/25 (1.01.1) - Fixed small panel and panel border drawing bugs
-/// - 2016/07/15 (1.01.0) - Added software cursor to `nk_style` and `nk_context`
-/// - 2016/07/15 (1.01.0) - Added const correctness to `nk_buffer_push' data argument
-/// - 2016/07/15 (1.01.0) - Removed internal font baking API and simplified
-/// font atlas memory management by converting pointer
-/// arrays for fonts and font configurations to lists.
-/// - 2016/07/15 (1.00.0) - Changed button API to use context dependend button
-/// behavior instead of passing it for every function call.
-/// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-///
-/// ## Gallery
-/// ![Figure [blue]: Feature overview with blue color styling](https://cloud.githubusercontent.com/assets/8057201/13538240/acd96876-e249-11e5-9547-5ac0b19667a0.png)
-/// ![Figure [red]: Feature overview with red color styling](https://cloud.githubusercontent.com/assets/8057201/13538243/b04acd4c-e249-11e5-8fd2-ad7744a5b446.png)
-/// ![Figure [widgets]: Widget overview](https://cloud.githubusercontent.com/assets/8057201/11282359/3325e3c6-8eff-11e5-86cb-cf02b0596087.png)
-/// ![Figure [blackwhite]: Black and white](https://cloud.githubusercontent.com/assets/8057201/11033668/59ab5d04-86e5-11e5-8091-c56f16411565.png)
-/// ![Figure [filexp]: File explorer](https://cloud.githubusercontent.com/assets/8057201/10718115/02a9ba08-7b6b-11e5-950f-adacdd637739.png)
-/// ![Figure [opengl]: OpenGL Editor](https://cloud.githubusercontent.com/assets/8057201/12779619/2a20d72c-ca69-11e5-95fe-4edecf820d5c.png)
-/// ![Figure [nodedit]: Node Editor](https://cloud.githubusercontent.com/assets/8057201/9976995/e81ac04a-5ef7-11e5-872b-acd54fbeee03.gif)
-/// ![Figure [skinning]: Using skinning in Nuklear](https://cloud.githubusercontent.com/assets/8057201/15991632/76494854-30b8-11e6-9555-a69840d0d50b.png)
-/// ![Figure [bf]: Heavy modified version](https://cloud.githubusercontent.com/assets/8057201/14902576/339926a8-0d9c-11e6-9fee-a8b73af04473.png)
-///
-/// ## Credits
-/// Developed by Micha Mettke and every direct or indirect github contributor. <br /><br />
-///
-/// Embeds [stb_texedit](https://github.com/nothings/stb/blob/master/stb_textedit.h), [stb_truetype](https://github.com/nothings/stb/blob/master/stb_truetype.h) and [stb_rectpack](https://github.com/nothings/stb/blob/master/stb_rect_pack.h) by Sean Barret (public domain) <br />
-/// Uses [stddoc.c](https://github.com/r-lyeh/stddoc.c) from r-lyeh@github.com for documentation generation <br /><br />
-/// Embeds ProggyClean.ttf font by Tristan Grimmer (MIT license). <br />
-///
-/// Big thank you to Omar Cornut (ocornut@github) for his [imgui library](https://github.com/ocornut/imgui) and
-/// giving me the inspiration for this library, Casey Muratori for handmade hero
-/// and his original immediate mode graphical user interface idea and Sean
-/// Barret for his amazing single header libraries which restored my faith
-/// in libraries and brought me to create some of my own.
-///
-*/
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear_btgui_gl2.h b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear_btgui_gl2.h
deleted file mode 100644
index a89dae4db7..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/nuklear_btgui_gl2.h
+++ /dev/null
@@ -1,386 +0,0 @@
-/*
- * Nuklear - v1.00 - public domain
- * no warrenty implied; use at your own risk.
- * authored from 2015-2016 by Micha Mettke
- */
-/*
- * ==============================================================
- *
- * API
- *
- * ===============================================================
- */
-#ifndef NK_BTGUI_GL2_H_
-#define NK_BTGUI_GL2_H_
-
-enum nk_btgui_init_state{
- NK_BTGUI3_DEFAULT = 0,
- NK_BTGUI3_INSTALL_CALLBACKS
-};
-
-struct nk_btgui_vertex {
- float position[2];
- float uv[2];
- nk_byte col[4];
-};
-
-NK_API struct nk_context* nk_btgui_init(b3gDefaultOpenGLWindow *win, enum nk_btgui_init_state);
-NK_API void nk_btgui_font_stash_begin(struct nk_font_atlas **atlas);
-NK_API void nk_btgui_font_stash_end(void);
-
-NK_API void nk_btgui_update_mouse_pos(int x, int y);
-NK_API void nk_btgui_update_mouse_state(int left_button_state, int middle_button_state, int right_button_state);
-
-NK_API void nk_btgui_new_frame(void);
-NK_API void nk_btgui_render(enum nk_anti_aliasing , int max_vertex_buffer, int max_element_buffer);
-NK_API void nk_btgui_shutdown(void);
-
-NK_API void nk_btgui_char_callback(b3gDefaultOpenGLWindow *win, unsigned int codepoint);
-NK_API void nk_btgui_scroll_callback(b3gDefaultOpenGLWindow *win, double xoff, double yoff);
-
-#endif
-
-/*
- * ==============================================================
- *
- * IMPLEMENTATION
- *
- * ===============================================================
- */
-#ifdef NK_BTGUI_GL2_IMPLEMENTATION
-
-#ifndef NK_BTGUI_TEXT_MAX
-#define NK_BTGUI_TEXT_MAX 256
-#endif
-
-struct nk_btgui_device {
- struct nk_buffer cmds;
- struct nk_draw_null_texture null;
- GLuint font_tex;
-};
-
-static struct nk_btgui {
- b3gDefaultOpenGLWindow *win;
- int width, height;
- int display_width, display_height;
- struct nk_btgui_device ogl;
- struct nk_context ctx;
- struct nk_font_atlas atlas;
- struct nk_vec2 fb_scale;
- unsigned int text[NK_BTGUI_TEXT_MAX];
- int text_len;
- float scroll;
-
- int left_button_state;
- int middle_button_state;
- int right_button_state;
-
- int mouse_pos[2];
-} btgui;
-
-NK_INTERN void
-nk_btgui_device_upload_atlas(const void *image, int width, int height)
-{
- struct nk_btgui_device *dev = &btgui.ogl;
- glGenTextures(1, &dev->font_tex);
- glBindTexture(GL_TEXTURE_2D, dev->font_tex);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, (GLsizei)width, (GLsizei)height, 0,
- GL_RGBA, GL_UNSIGNED_BYTE, image);
- assert(glGetError() == GL_NO_ERROR);
-}
-
-NK_API void
-nk_btgui_update_mouse_state(int left_button_state, int middle_button_state, int right_button_state)
-{
- btgui.left_button_state = left_button_state;
- btgui.middle_button_state = middle_button_state;
- btgui.right_button_state = right_button_state;
-}
-
-NK_API void
-nk_btgui_update_mouse_pos(int x, int y)
-{
- btgui.mouse_pos[0] = x;
- btgui.mouse_pos[1] = y;
-}
-
-
-NK_API void
-nk_btgui_render(enum nk_anti_aliasing AA, int max_vertex_buffer, int max_element_buffer)
-{
- /* setup global state */
- struct nk_btgui_device *dev = &btgui.ogl;
- glPushAttrib(GL_ENABLE_BIT|GL_COLOR_BUFFER_BIT|GL_TRANSFORM_BIT);
- assert(glGetError() == GL_NO_ERROR);
- glDisable(GL_CULL_FACE);
- glDisable(GL_DEPTH_TEST);
- glEnable(GL_SCISSOR_TEST);
- glEnable(GL_BLEND);
- glEnable(GL_TEXTURE_2D);
- glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-
- /* setup viewport/project */
- glViewport(0,0,(GLsizei)btgui.display_width,(GLsizei)btgui.display_height);
- glMatrixMode(GL_PROJECTION);
- glPushMatrix();
- glLoadIdentity();
- glOrtho(0.0f, btgui.width, btgui.height, 0.0f, -1.0f, 1.0f);
- glMatrixMode(GL_MODELVIEW);
- glPushMatrix();
- glLoadIdentity();
-
- glEnableClientState(GL_VERTEX_ARRAY);
- glEnableClientState(GL_TEXTURE_COORD_ARRAY);
- glEnableClientState(GL_COLOR_ARRAY);
- {
- GLsizei vs = sizeof(struct nk_btgui_vertex);
- size_t vp = offsetof(struct nk_btgui_vertex, position);
- size_t vt = offsetof(struct nk_btgui_vertex, uv);
- size_t vc = offsetof(struct nk_btgui_vertex, col);
-
- /* convert from command queue into draw list and draw to screen */
- const struct nk_draw_command *cmd;
- const nk_draw_index *offset = NULL;
- struct nk_buffer vbuf, ebuf;
-
- /* fill converting configuration */
- struct nk_convert_config config;
- static const struct nk_draw_vertex_layout_element vertex_layout[] = {
- {NK_VERTEX_POSITION, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_btgui_vertex, position)},
- {NK_VERTEX_TEXCOORD, NK_FORMAT_FLOAT, NK_OFFSETOF(struct nk_btgui_vertex, uv)},
- {NK_VERTEX_COLOR, NK_FORMAT_R8G8B8A8, NK_OFFSETOF(struct nk_btgui_vertex, col)},
- {NK_VERTEX_LAYOUT_END}
- };
- NK_MEMSET(&config, 0, sizeof(config));
- config.vertex_layout = vertex_layout;
- config.vertex_size = sizeof(struct nk_btgui_vertex);
- config.vertex_alignment = NK_ALIGNOF(struct nk_btgui_vertex);
- config.null = dev->null;
- config.circle_segment_count = 22;
- config.curve_segment_count = 22;
- config.arc_segment_count = 22;
- config.global_alpha = 1.0f;
- config.shape_AA = AA;
- config.line_AA = AA;
-
-
- /* convert shapes into vertexes */
- nk_buffer_init_default(&vbuf);
- nk_buffer_init_default(&ebuf);
- nk_convert(&btgui.ctx, &dev->cmds, &vbuf, &ebuf, &config);
-
- /* setup vertex buffer pointer */
- {const void *vertices = nk_buffer_memory_const(&vbuf);
- glVertexPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vp));
- glTexCoordPointer(2, GL_FLOAT, vs, (const void*)((const nk_byte*)vertices + vt));
- glColorPointer(4, GL_UNSIGNED_BYTE, vs, (const void*)((const nk_byte*)vertices + vc));}
-
- /* iterate over and execute each draw command */
- offset = (const nk_draw_index*)nk_buffer_memory_const(&ebuf);
- nk_draw_foreach(cmd, &btgui.ctx, &dev->cmds)
- {
- if (!cmd->elem_count) continue;
- glBindTexture(GL_TEXTURE_2D, (GLuint)cmd->texture.id);
- glScissor(
- (GLint)(cmd->clip_rect.x * btgui.fb_scale.x),
- (GLint)((btgui.height - (GLint)(cmd->clip_rect.y + cmd->clip_rect.h)) * btgui.fb_scale.y),
- (GLint)(cmd->clip_rect.w * btgui.fb_scale.x),
- (GLint)(cmd->clip_rect.h * btgui.fb_scale.y));
- glDrawElements(GL_TRIANGLES, (GLsizei)cmd->elem_count, GL_UNSIGNED_SHORT, offset);
- offset += cmd->elem_count;
- }
- nk_clear(&btgui.ctx);
- nk_buffer_free(&vbuf);
- nk_buffer_free(&ebuf);
- }
- assert(glGetError() == GL_NO_ERROR);
-
- /* default OpenGL state */
- glDisableClientState(GL_VERTEX_ARRAY);
- glDisableClientState(GL_TEXTURE_COORD_ARRAY);
- glDisableClientState(GL_COLOR_ARRAY);
- assert(glGetError() == GL_NO_ERROR);
-
- glDisable(GL_CULL_FACE);
- glDisable(GL_DEPTH_TEST);
- glDisable(GL_SCISSOR_TEST);
- glDisable(GL_BLEND);
- glDisable(GL_TEXTURE_2D);
-
- glBindTexture(GL_TEXTURE_2D, 0);
- glMatrixMode(GL_MODELVIEW);
- glPopMatrix();
- glMatrixMode(GL_PROJECTION);
- glPopMatrix();
- glPopAttrib();
- assert(glGetError() == GL_NO_ERROR);
-}
-
-#if 0 // @todo
-NK_API void
-nk_btgui_char_callback(b3gDefaultOpenGLWindow *win, unsigned int codepoint)
-{
- (void)win;
- if (btgui.text_len < NK_BTGUI_TEXT_MAX)
- btgui.text[btgui.text_len++] = codepoint;
-}
-
-NK_API void
-nk_gflw3_scroll_callback(b3gDefaultOpenGLWindow *win, double xoff, double yoff)
-{
- (void)win; (void)xoff;
- btgui.scroll += (float)yoff;
-}
-
-static void
-nk_btgui_clipbard_paste(nk_handle usr, struct nk_text_edit *edit)
-{
- const char *text = btguiGetClipboardString(btgui.win);
- if (text) nk_textedit_paste(edit, text, nk_strlen(text));
- (void)usr;
-}
-
-static void
-nk_btgui_clipbard_copy(nk_handle usr, const char *text, int len)
-{
- char *str = 0;
- (void)usr;
- if (!len) return;
- str = (char*)malloc((size_t)len+1);
- if (!str) return;
- memcpy(str, text, (size_t)len);
- str[len] = '\0';
- btguiSetClipboardString(btgui.win, str);
- free(str);
-}
-#endif
-
-NK_API struct nk_context*
-nk_btgui_init(b3gDefaultOpenGLWindow *win, enum nk_btgui_init_state init_state)
-{
- btgui.win = win;
- if (init_state == NK_BTGUI3_INSTALL_CALLBACKS) {
- //btguiSetScrollCallback(win, nk_gflw3_scroll_callback);
- //btguiSetCharCallback(win, nk_btgui_char_callback);
- }
-
- nk_init_default(&btgui.ctx, 0);
- //btgui.ctx.clip.copy = nk_btgui_clipbard_copy;
- //btgui.ctx.clip.paste = nk_btgui_clipbard_paste;
- //btgui.ctx.clip.userdata = nk_handle_ptr(0);
- nk_buffer_init_default(&btgui.ogl.cmds);
- return &btgui.ctx;
-}
-
-NK_API void
-nk_btgui_font_stash_begin(struct nk_font_atlas **atlas)
-{
- nk_font_atlas_init_default(&btgui.atlas);
- nk_font_atlas_begin(&btgui.atlas);
- *atlas = &btgui.atlas;
-}
-
-NK_API void
-nk_btgui_font_stash_end(void)
-{
- const void *image; int w, h;
- image = nk_font_atlas_bake(&btgui.atlas, &w, &h, NK_FONT_ATLAS_RGBA32);
- nk_btgui_device_upload_atlas(image, w, h);
- nk_font_atlas_end(&btgui.atlas, nk_handle_id((int)btgui.ogl.font_tex), &btgui.ogl.null);
- if (btgui.atlas.default_font)
- nk_style_set_font(&btgui.ctx, &btgui.atlas.default_font->handle);
-}
-
-NK_API void
-nk_btgui_new_frame(void)
-{
- int i;
- //double x, y;
- struct nk_context *ctx = &btgui.ctx;
- b3gDefaultOpenGLWindow *win = btgui.win;
-
- btgui.width = win->getWidth();
- btgui.height = win->getHeight();
-
- float fbscale = 1.0;
-#ifdef __APPLE__
- //fbscale = win->getRetinaScale();
-#endif
- btgui.display_width = fbscale * btgui.width;
- btgui.display_height = fbscale * btgui.height;
-
- btgui.fb_scale.x = (float)btgui.display_width/(float)btgui.width;
- btgui.fb_scale.y = (float)btgui.display_height/(float)btgui.height;
-
- // HACK
- btgui.fb_scale.x = 1.0;
- btgui.fb_scale.y = 1.0;
-
-
- nk_input_begin(ctx);
-#if 0
- for (i = 0; i < btgui.text_len; ++i)
- nk_input_unicode(ctx, btgui.text[i]);
-
- nk_input_key(ctx, NK_KEY_DEL, btguiGetKey(win, BTGUI_KEY_DELETE) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_ENTER, btguiGetKey(win, BTGUI_KEY_ENTER) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TAB, btguiGetKey(win, BTGUI_KEY_TAB) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_BACKSPACE, btguiGetKey(win, BTGUI_KEY_BACKSPACE) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_UP, btguiGetKey(win, BTGUI_KEY_UP) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_DOWN, btguiGetKey(win, BTGUI_KEY_DOWN) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_START, btguiGetKey(win, BTGUI_KEY_HOME) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_END, btguiGetKey(win, BTGUI_KEY_END) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_SHIFT, btguiGetKey(win, BTGUI_KEY_LEFT_SHIFT) == BTGUI_PRESS||
- btguiGetKey(win, BTGUI_KEY_RIGHT_SHIFT) == BTGUI_PRESS);
-
- if (btguiGetKey(win, BTGUI_KEY_LEFT_CONTROL) == BTGUI_PRESS ||
- btguiGetKey(win, BTGUI_KEY_RIGHT_CONTROL)) {
- nk_input_key(ctx, NK_KEY_COPY, btguiGetKey(win, BTGUI_KEY_C) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_PASTE, btguiGetKey(win, BTGUI_KEY_P) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_CUT, btguiGetKey(win, BTGUI_KEY_X) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_UNDO, btguiGetKey(win, BTGUI_KEY_Z) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_REDO, btguiGetKey(win, BTGUI_KEY_R) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_WORD_LEFT, btguiGetKey(win, BTGUI_KEY_LEFT) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_WORD_RIGHT, btguiGetKey(win, BTGUI_KEY_RIGHT) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_LINE_START, btguiGetKey(win, BTGUI_KEY_B) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_TEXT_LINE_END, btguiGetKey(win, BTGUI_KEY_E) == BTGUI_PRESS);
- } else {
- nk_input_key(ctx, NK_KEY_LEFT, btguiGetKey(win, BTGUI_KEY_LEFT) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_RIGHT, btguiGetKey(win, BTGUI_KEY_RIGHT) == BTGUI_PRESS);
- nk_input_key(ctx, NK_KEY_COPY, 0);
- nk_input_key(ctx, NK_KEY_PASTE, 0);
- nk_input_key(ctx, NK_KEY_CUT, 0);
- nk_input_key(ctx, NK_KEY_SHIFT, 0);
- }
-
- btguiGetCursorPos(win, &x, &y);
- nk_input_motion(ctx, (int)x, (int)y);
- nk_input_button(ctx, NK_BUTTON_LEFT, (int)x, (int)y, btguiGetMouseButton(win, BTGUI_MOUSE_BUTTON_LEFT) == BTGUI_PRESS);
- nk_input_button(ctx, NK_BUTTON_MIDDLE, (int)x, (int)y, btguiGetMouseButton(win, BTGUI_MOUSE_BUTTON_MIDDLE) == BTGUI_PRESS);
- nk_input_button(ctx, NK_BUTTON_RIGHT, (int)x, (int)y, btguiGetMouseButton(win, BTGUI_MOUSE_BUTTON_RIGHT) == BTGUI_PRESS);
- nk_input_scroll(ctx, btgui.scroll);
-#endif
- nk_input_motion(ctx, btgui.mouse_pos[0], btgui.mouse_pos[1]);
- nk_input_button(ctx, NK_BUTTON_LEFT, btgui.mouse_pos[0], btgui.mouse_pos[1], btgui.left_button_state);
- nk_input_button(ctx, NK_BUTTON_MIDDLE, btgui.mouse_pos[0], btgui.mouse_pos[1], btgui.middle_button_state);
- nk_input_button(ctx, NK_BUTTON_RIGHT, btgui.mouse_pos[0], btgui.mouse_pos[1], btgui.right_button_state);
- nk_input_end(&btgui.ctx);
- btgui.text_len = 0;
- btgui.scroll = 0;
-}
-
-NK_API
-void nk_btgui_shutdown(void)
-{
- struct nk_btgui_device *dev = &btgui.ogl;
- nk_font_atlas_clear(&btgui.atlas);
- nk_free(&btgui.ctx);
- glDeleteTextures(1, &dev->font_tex);
- nk_buffer_free(&dev->cmds);
- memset(&btgui, 0, sizeof(btgui));
-}
-
-#endif
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/premake4.lua b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/premake4.lua
deleted file mode 100644
index caccd7cde7..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/premake4.lua
+++ /dev/null
@@ -1,87 +0,0 @@
-newoption {
- trigger = "with-gtk3nfd",
- description = "Build with nativefiledialog support. GTK3 required(Linux only)"
-}
-
-sources = {
- "main.cc",
- "exr-io.cc",
- "../../deps/miniz/miniz.c"
-}
-
--- premake4.lua
-solution "EXRViewSolution"
- configurations { "Release", "Debug" }
-
- platforms { "native", "x64", "x32" }
-
-
- projectRootDir = os.getcwd() .. "/"
- dofile ("findOpenGLGlewGlut.lua")
- initOpenGL()
- initGlew()
-
- -- A project defines one build target
- project "exrview"
- kind "ConsoleApp"
- language "C++"
- files { sources }
-
- includedirs { "./", "../../", "../../deps/miniz" }
-
- if os.is("Windows") then
- defines { "USE_NATIVEFILEDIALOG" }
- files{
- "OpenGLWindow/Win32OpenGLWindow.cpp",
- "OpenGLWindow/Win32OpenGLWindow.h",
- "OpenGLWindow/Win32Window.cpp",
- "OpenGLWindow/Win32Window.h",
- }
- includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
- files {
- "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
- "ThirdPartyLibs/nativefiledialog/src/nfd_win.cpp"
- }
- end
- if os.is("Linux") then
- files {
- "OpenGLWindow/X11OpenGLWindow.cpp",
- "OpenGLWindow/X11OpenGLWindows.h"
- }
- links {"X11", "pthread", "dl"}
-
- if _OPTIONS["with-gtk3nfd"] then -- NFD + GTK3
- defines { "USE_NATIVEFILEDIALOG" }
- includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
- buildoptions { "`pkg-config --cflags gtk+-3.0`" }
- linkoptions { "`pkg-config --libs gtk+-3.0`" }
- files {
- "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
- "ThirdPartyLibs/nativefiledialog/src/nfd_gtk.c"
- }
- end
-
- end
- if os.is("MacOSX") then
- defines { "USE_NATIVEFILEDIALOG" }
- links {"Cocoa.framework"}
- files {
- "OpenGLWindow/MacOpenGLWindow.h",
- "OpenGLWindow/MacOpenGLWindow.mm",
- }
- includedirs { "./ThirdPartyLibs/nativefiledialog/src/include/" }
- files {
- "ThirdPartyLibs/nativefiledialog/src/nfd_common.c",
- "ThirdPartyLibs/nativefiledialog/src/nfd_cocoa.m"
- }
- end
-
- configuration "Debug"
- defines { "DEBUG" } -- -DDEBUG
- flags { "Symbols" }
- targetname "exrview_debug"
-
- configuration "Release"
- -- defines { "NDEBUG" } -- -NDEBUG
- flags { "Symbols", "Optimize" }
- targetname "exrview"
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/screenshots/exrview.png b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/screenshots/exrview.png
deleted file mode 100644
index 67bec21c24..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/screenshots/exrview.png
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.frag b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.frag
deleted file mode 100644
index 2ad28caef8..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.frag
+++ /dev/null
@@ -1,12 +0,0 @@
-varying vec2 texcoord;
-
-uniform sampler2D tex;
-
-uniform float intensity_scale;
-uniform float gamma;
-
-void main()
-{
- vec4 rgba = texture2D(tex, texcoord);
- gl_FragColor = vec4(pow(intensity_scale * rgba.rgb, vec3(1.0 / gamma)), 1.0);
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.vert b/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.vert
deleted file mode 100644
index e0f91b3ab4..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/exrview/shader.vert
+++ /dev/null
@@ -1,12 +0,0 @@
-#version 110
-
-attribute vec2 in_position;
-attribute vec2 in_texcoord;
-
-varying vec2 texcoord;
-
-void main()
-{
- gl_Position = vec4(in_position, 0.0, 1.0);
- texcoord = in_texcoord;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/Makefile
deleted file mode 100644
index 5ae4ee63be..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- gcc -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- g++ -O2 -o ldr2exr -I../common -I../../ -I../../deps/miniz ldr2exr.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/ldr2exr.cc b/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/ldr2exr.cc
deleted file mode 100644
index 63e0c8a736..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/ldr2exr/ldr2exr.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h"
-
-#include "tinyexr.h"
-
-int main(int argc, char** argv)
-{
- if (argc < 3) {
- printf("Usage: ldr2exr input.[png|bmp|tga|jpg|...] output.exr\n");
- printf(" NOTE: Supported LDR image format = stb_image can load.\n");
- printf(" NOTE: Input pixel value [0, 255] is mapped to [0.0, 1.0] in output EXR file.\n");
- printf(" NOTE: Only supports RGB pixel format.\n");
-
- exit(-1);
- }
-
- int width, height;
- int n;
- unsigned char *rgb = stbi_load(argv[1], &width, &height, &n, 0);
- if (!rgb || n != 3) {
- return -1;
- }
-
- EXRHeader header;
- InitEXRHeader(&header);
-
- EXRImage image;
- InitEXRImage(&image);
-
- image.num_channels = 3;
-
- std::vector<float> images[3];
- images[0].resize(width * height);
- images[1].resize(width * height);
- images[2].resize(width * height);
-
- for (int i = 0; i < width * height; i++) {
- images[0][i] = rgb[3*i+0] / 255.0f;
- images[1][i] = rgb[3*i+1] / 255.0f;
- images[2][i] = rgb[3*i+2] / 255.0f;
- }
-
- float* image_ptr[3];
- image_ptr[0] = &(images[2].at(0)); // B
- image_ptr[1] = &(images[1].at(0)); // G
- image_ptr[2] = &(images[0].at(0)); // R
-
- image.images = (unsigned char**)image_ptr;
- image.width = width;
- image.height = height;
-
- header.num_channels = 3;
- header.channels = (EXRChannelInfo *)malloc(sizeof(EXRChannelInfo) * header.num_channels);
- // Must be BGR(A) order, since most of EXR viewers expect this channel order.
- strncpy(header.channels[0].name, "B", 255); header.channels[0].name[strlen("B")] = '\0';
- strncpy(header.channels[1].name, "G", 255); header.channels[1].name[strlen("G")] = '\0';
- strncpy(header.channels[2].name, "R", 255); header.channels[2].name[strlen("R")] = '\0';
-
- header.pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- header.requested_pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- for (int i = 0; i < header.num_channels; i++) {
- header.pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
- header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_HALF; // pixel type of output image to be stored in .EXR
- }
-
- const char* err;
- int ret = SaveEXRImageToFile(&image, &header, argv[2], &err);
- if (ret != TINYEXR_SUCCESS) {
- fprintf(stderr, "Save EXR err: %s\n", err);
- return ret;
- }
- printf("Saved exr file. [ %s ] \n", argv[2]);
-
- free(rgb);
-
- free(header.channels);
- free(header.pixel_types);
- free(header.requested_pixel_types);
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/Makefile
deleted file mode 100644
index eacf84b5f2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- clang -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- clang++ -O2 -g -fsanitize=address -I../common -I../../ -I../../deps/miniz -o normalmap main.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/README.md
deleted file mode 100644
index 4cbf4b5304..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Normal map generation tool
-
-Load bump or vector displacement map and convert it to normal map.
-(For vector displacement map, it generates approximated normal map)
-
-
-## TODO
-
-* [ ] Mip map generation with normal map prefiltering
-
-## Licenses
-
-* cxxopts.hpp : Copyright (c) 2014, 2015, 2016, 2017 Jarryd Beck. MIT license.
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/main.cc b/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/main.cc
deleted file mode 100644
index 6571739ff3..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/nornalmap/main.cc
+++ /dev/null
@@ -1,267 +0,0 @@
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-#endif
-
-#define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include "stb_image_resize.h"
-
-#define STB_IMAGE_WRITE_IMPLEMENTATION
-#include "stb_image_write.h"
-
-#include "cxxopts.hpp"
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-namespace {
-
-static void vnormalize(float v[3]) {
- const float d2 = v[0] * v[0] + v[1] * v[1] + v[2] * v[2];
- if (d2 > 1.0e-6f) {
- const float inv_d = 1.0f / std::sqrt(d2);
- v[0] *= inv_d;
- v[1] *= inv_d;
- v[2] *= inv_d;
- }
- return;
-}
-
-
-template<typename T>
-static inline T clamp(const T v, const T min_v, const T max_v)
-{
- return std::max(min_v, std::min(max_v, v));
-}
-
-//
-// Compute gradient from scalar field.
-// dx = (x + 1, y ) - (x, y)
-// dy = (x , y + 1) - (x, y)
-//
-// TODO(syoyo): Use central difference with texel filtering.
-//
-static void Gradient(
- const std::vector<float> &src,
- const size_t width,
- const size_t height,
- const size_t x, const size_t y,
- const float bumpness,
- float dir[3])
-{
- const size_t x1 = clamp(x + 1, size_t(0), width - 1);
- const size_t y1 = clamp(y + 1, size_t(0), height - 1);
-
-
- float v00 = src[y * width + x];
- float v01 = src[y * width + x1];
- float v11 = src[y1 * width + x];
-
-
- float dx = bumpness * (v01 - v00);
- float dy = bumpness * (v11 - v00);
-
- dir[0] = dx;
- dir[1] = dy;
- dir[2] = 0.0f;
-
-}
-
-///
-/// Convert image(bump map for single channel, vector displacement map for 3 channels input) to normal map.
-/// @param[in] base Base value fo
-///
-///
-static void ToNormalMap(
- const std::vector<float> &src,
- const size_t width,
- const size_t height,
- const size_t channels,
- const float strength,
- std::vector<float> *dst)
-{
- assert((channels == 1) || (channels == 3) || (channels == 4));
-
- dst->resize(width * height * 3);
-
- if (channels == 1) {
- // bump map
- for (size_t y = 0; y < height; y++) {
- for (size_t x = 0; x < width; x++) {
- float d[3];
- Gradient(src, width, height, x, y, strength, d);
-
- (*dst)[3 * (y * width + x) + 0] = d[0];
- (*dst)[3 * (y * width + x) + 1] = d[1];
- (*dst)[3 * (y * width + x) + 2] = d[2];
-
- }
- }
-
- } else {
- // vector displacement map
-
- for (size_t y = 0; y < height; y++) {
- for (size_t x = 0; x < width; x++) {
-
- float v[3];
- v[0] = src[channels * (y * width + x) + 0];
- v[1] = src[channels * (y * width + x) + 1];
- v[2] = src[channels * (y * width + x) + 2];
-
- v[0] *= strength;
- v[1] *= strength;
- v[2] *= strength;
-
- // Add (0, 0, 1)
- v[2] += 1.0f;
-
- // TODO(syoyo): Add option to not normalize.
- vnormalize(v);
-
- (*dst)[3 * (y * width + x) + 0] = 0.5f * v[0] + 0.5f;
- (*dst)[3 * (y * width + x) + 1] = 0.5f * v[1] + 0.5f;
- (*dst)[3 * (y * width + x) + 2] = 0.5f * v[2] + 0.5f;
-
- }
- }
-
- }
-
-}
-
-inline unsigned char ftouc(float f)
-{
- int i = static_cast<int>(f * 255.0f);
- if (i > 255) i = 255;
- if (i < 0) i = 0;
-
- return static_cast<unsigned char>(i);
-}
-
-bool SaveImage(const char* filename, const float* rgb, int width, int height) {
-
- std::vector<unsigned char> dst(width * height * 3);
-
- for (size_t i = 0; i < width * height; i++) {
- dst[i * 3 + 0] = ftouc(rgb[i * 3 + 0]);
- dst[i * 3 + 1] = ftouc(rgb[i * 3 + 1]);
- dst[i * 3 + 2] = ftouc(rgb[i * 3 + 2]);
- }
-
- int ret = stbi_write_png(filename, width, height, 3, static_cast<const void*>(dst.data()), width * 3);
-
- return (ret > 0);
-}
-
-std::string GetFileExtension(const std::string &filename) {
- if (filename.find_last_of(".") != std::string::npos)
- return filename.substr(filename.find_last_of(".") + 1);
- return "";
-}
-
-} // namespace
-
-int main(int argc, char **argv)
-{
- cxxopts::Options options("normalmap", "help");
- options.add_options()
- ("s,strength", "Strength(scaling) for normal value", cxxopts::value<float>())
- ("i,input", "Input filename", cxxopts::value<std::string>())
- ("o,output", "Output filename", cxxopts::value<std::string>())
- ("r,resize", "Resize image. 0.5 = 50%%, 0.1 = 10%%", cxxopts::value<float>())
- ;
-
- auto result = options.parse(argc, argv);
-
- if (result.count("input") == 0) {
- std::cerr << "input filename missing" << std::endl;
- return EXIT_FAILURE;
- }
-
- if (result.count("output") == 0) {
- std::cerr << "output filename missing" << std::endl;
- return EXIT_FAILURE;
- }
-
- float strength = 1.0f;
- if (result.count("strength")) {
- strength = result["strength"].as<float>();
- }
-
- float resize = 1.0f;
- if (result.count("resize")) {
- resize = result["resize"].as<float>();
- }
-
- std::string input_filename = result["input"].as<std::string>();
- std::string output_filename = result["output"].as<std::string>();
-
- std::vector<float> src;
- size_t src_width;
- size_t src_height;
-
- {
- float *rgba = nullptr;
- int width, height;
- const char *err = nullptr;
- int ret = LoadEXR(&rgba, &width, &height, input_filename.c_str(), &err);
- if (TINYEXR_SUCCESS != ret) {
- std::cerr << "Failed to load EXR file [" << input_filename << "] code = " << ret << std::endl;
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
-
- return EXIT_FAILURE;
- }
-
- std::cout << "loaded EXR. width x height = " << width << "x" << height << std::endl;
- src.resize(size_t(width * height * 3));
-
- // ignore alpha for now
- for (size_t i = 0; i < size_t(width * height); i++) {
- src[3 * i + 0] = rgba[4 * i + 0];
- src[3 * i + 1] = rgba[4 * i + 1];
- src[3 * i + 2] = rgba[4 * i + 2];
- }
-
- src_width = size_t(width);
- src_height = size_t(height);
-
- free(rgba);
- }
-
- std::cout << "strength = " << strength << std::endl;
-
- std::vector<float> dst;
- ToNormalMap(src, src_width, src_height, 3, strength, &dst);
-
-
- std::string ext = GetFileExtension(output_filename);
- if ((ext.compare("png") == 0) ||
- (ext.compare("PNG") == 0)) {
- // Save as LDR image.
- // Do not apply sRGB conversion for PNG(LDR) image.
- if (!SaveImage(output_filename.c_str(), dst.data(), int(src_width), int(src_height))) {
- std::cerr << "Failed to write a file : " << output_filename << std::endl;
- return EXIT_FAILURE;
- }
- } else {
- // assume EXR.
- float *rgba = nullptr;
- int width, height;
- int ret = SaveEXR(dst.data(), int(src_width), int(src_height), /* component */3, /* fp16 */0, output_filename.c_str(), nullptr);
- if (TINYEXR_SUCCESS != ret) {
- std::cerr << "Failed to save EXR file [" << input_filename << "] code = " << ret << std::endl;
- return EXIT_FAILURE;
- }
- }
-
- return EXIT_SUCCESS;
-}
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/resize/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/resize/Makefile
deleted file mode 100644
index 423b221406..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/resize/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- clang -g -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- clang++ -fsanitize=undefined -O2 -o exrresize -I../common -I../../ -I../../deps/miniz resize.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/resize/resize.cc b/graphics/asymptote/cudareflect/tinyexr/examples/resize/resize.cc
deleted file mode 100644
index c78d9a8790..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/resize/resize.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#define STB_IMAGE_RESIZE_IMPLEMENTATION
-#include "stb_image_resize.h"
-
-#include "tinyexr.h"
-
-int main(int argc, char** argv)
-{
- if (argc < 5) {
- printf("Usage: exrresize input.exr output.exr dst_width dst_height.\n");
- printf(" Only supports RGB or RGBA EXR input.\n");
- exit(-1);
- }
-
- int dst_width = atoi(argv[3]);
- int dst_height = atoi(argv[4]);
-
- int width, height;
- float* rgba;
- const char* err;
-
- {
- int ret = LoadEXR(&rgba, &width, &height, argv[1], &err);
- if (ret != TINYEXR_SUCCESS) {
- printf("err: %s\n", err);
- return -1;
- }
- }
-
- std::vector<float> buf(dst_width * dst_height * 4);
- int ret = stbir_resize_float(rgba, width, height, width*4*sizeof(float), &buf.at(0), dst_width, dst_height,dst_width*4*sizeof(float), 4);
- assert(ret != 0);
-
- ret = SaveEXR(buf.data(), dst_width, dst_height, 4, /*fp16*/0, argv[2], &err);
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- fprintf(stderr, "err: %s\n", err);
- FreeEXRErrorMessage(err);
- }
- }
-
- return (ret == TINYEXR_SUCCESS);
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/Makefile
deleted file mode 100644
index 32b5afd84e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- gcc -O2 -c -I../../deps/miniz ../../deps/miniz/miniz.c
- g++ -O2 -o rgbe2exr -I../common -I../../ -I../../deps/miniz rgbe2exr.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/rgbe2exr.cc b/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/rgbe2exr.cc
deleted file mode 100644
index c0da5a6d60..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/rgbe2exr/rgbe2exr.cc
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-
-#define STB_IMAGE_IMPLEMENTATION
-#include "stb_image.h"
-
-#include "tinyexr.h"
-
-int main(int argc, char** argv)
-{
- if (argc < 3) {
- printf("Usage: rgbe2exr input.hdr output.exr\n");
- exit(-1);
- }
-
- int width, height;
- int n;
- float *rgb = stbi_loadf(argv[1], &width, &height, &n, 0);
- if (!rgb || n != 3) {
- return -1;
- }
-
- EXRHeader header;
- InitEXRHeader(&header);
-
- EXRImage image;
- InitEXRImage(&image);
-
- image.num_channels = 3;
-
- std::vector<float> images[3];
- images[0].resize(width * height);
- images[1].resize(width * height);
- images[2].resize(width * height);
-
- for (int i = 0; i < width * height; i++) {
- images[0][i] = rgb[3*i+0];
- images[1][i] = rgb[3*i+1];
- images[2][i] = rgb[3*i+2];
- }
-
- float* image_ptr[3];
- image_ptr[0] = &(images[2].at(0)); // B
- image_ptr[1] = &(images[1].at(0)); // G
- image_ptr[2] = &(images[0].at(0)); // R
-
- image.images = (unsigned char**)image_ptr;
- image.width = width;
- image.height = height;
-
- header.num_channels = 3;
- header.channels = (EXRChannelInfo *)malloc(sizeof(EXRChannelInfo) * header.num_channels);
- // Must be BGR(A) order, since most of EXR viewers expect this channel order.
- strncpy(header.channels[0].name, "B", 255); header.channels[0].name[strlen("B")] = '\0';
- strncpy(header.channels[1].name, "G", 255); header.channels[1].name[strlen("G")] = '\0';
- strncpy(header.channels[2].name, "R", 255); header.channels[2].name[strlen("R")] = '\0';
-
- header.pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- header.requested_pixel_types = (int *)malloc(sizeof(int) * header.num_channels);
- for (int i = 0; i < header.num_channels; i++) {
- header.pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
- header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_HALF; // pixel type of output image to be stored in .EXR
- }
-
- const char* err;
- int ret = SaveEXRImageToFile(&image, &header, argv[2], &err);
- if (ret != TINYEXR_SUCCESS) {
- fprintf(stderr, "Save EXR err: %s\n", err);
- return ret;
- }
- printf("Saved exr file. [ %s ] \n", argv[2]);
-
- free(rgb);
-
- free(header.channels);
- free(header.pixel_types);
- free(header.requested_pixel_types);
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/Makefile b/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/Makefile
deleted file mode 100644
index 0dc31f69d0..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/Makefile
+++ /dev/null
@@ -1,3 +0,0 @@
-all:
- gcc -O2 -I../../deps/miniz -c ../../deps/miniz/miniz.c
- g++ -std=c++11 -O2 -o testmapgen -I../common -I../../ -I../../deps/miniz testmapgen.cc ../../tinyexr.cc miniz.o
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/README.md b/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/README.md
deleted file mode 100644
index 0b5fe97d5d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/README.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Test EXR image map gen
-
-Generate test EXR images for envmap test, composition test, etc.
-
-* white(R=1, G=1, B=1)
-* white10(R=10, G=10, B=10)
-* white100(R=100, G=100, B=100)
-
-
-## TODO
-
-* [ ] red(R=1, G=0, B=0)
-* [ ] green(R=0, G=1, B=0)
-* [ ] blue(R=0, G=0, B=1)
-* [ ] longlat test image
diff --git a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/testmapgen.cc b/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/testmapgen.cc
deleted file mode 100644
index 79514652a6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/examples/testmapgen/testmapgen.cc
+++ /dev/null
@@ -1,86 +0,0 @@
-#include <cstdio>
-#include <cstdlib>
-#include <vector>
-#include <iostream>
-
-#include "tinyexr.h"
-
-static void GenerateWhite1(size_t width, size_t height)
-{
- std::vector<float> rgb;
- rgb.resize(width * height * 3);
-
- for (size_t i = 0; i < width * height * 3; i++) {
- rgb[i] = 1.0f;
- }
-
- const char *err = nullptr;
- int ret = SaveEXR(rgb.data(), int(width), int(height), /* channels */3, /* fp16? */0, "white1.exr", &err);
- if (!ret) {
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
- std::cerr << "failed to write white.exr" << std::endl;
- }
-}
-
-static void GenerateWhite10(size_t width, size_t height)
-{
- std::vector<float> rgb;
- rgb.resize(width * height * 3);
-
- for (size_t i = 0; i < width * height * 3; i++) {
- rgb[i] = 10.0f;
- }
-
- const char *err = nullptr;
- int ret = SaveEXR(rgb.data(), int(width), int(height), /* channels */3, /* fp16? */0, "white10.exr", &err);
- if (!ret) {
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
- std::cerr << "failed to write white10.exr" << std::endl;
- }
-}
-
-static void GenerateWhite100(size_t width, size_t height)
-{
- std::vector<float> rgb;
- rgb.resize(width * height * 3);
-
- for (size_t i = 0; i < width * height * 3; i++) {
- rgb[i] = 100.0f;
- }
-
- const char *err = nullptr;
- int ret = SaveEXR(rgb.data(), int(width), int(height), /* channels */3, /* fp16? */0, "white100.exr", &err);
- if (!ret) {
- if (err) {
- std::cerr << err << std::endl;
- FreeEXRErrorMessage(err);
- }
- std::cerr << "failed to write white100.exr" << std::endl;
- }
-}
-
-int main(int argc, char** argv)
-{
- int width = 512;
- int height = 512;
-
- if (argc > 2) {
- width = std::min(1, atoi(argv[2]));
- }
-
- if (argc > 3) {
- height = std::min(1, atoi(argv[3]));
- }
-
- GenerateWhite1(width, height);
- GenerateWhite10(width, height);
- GenerateWhite100(width, height);
-
- return EXIT_SUCCESS;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/Makefile b/graphics/asymptote/cudareflect/tinyexr/experimental/js/Makefile
deleted file mode 100644
index 4f83f29a74..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-all:
- ./compile_to_js.sh
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/README.md b/graphics/asymptote/cudareflect/tinyexr/experimental/js/README.md
deleted file mode 100644
index 9132541327..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/README.md
+++ /dev/null
@@ -1,38 +0,0 @@
-# Experimental JavaScript port of TinyEXR
-
-Using Emscripten.
-
-## How to compile
-
-edit `compile_to_js.sh`, then
-
-```
-./compile_to_js.sh
-```
-
-## How to run test
-
-Requires node.js
-
-```
-$ node test.js
-```
-
-## How to run a browser example
-
-Edit EXR file in `index.html`
-Copy a EXR file to this directory(default = asakusa.exr).
-(NOTE: Chrome does not allow reading a file from parent path(e.g. `../../asakusa.exr`).
-
-Launch http server, e.g.,
-
-```
-$ python3 -m http.server
-```
-
-Open `http://localhost:8000` with an browser.
-
-## TODO
-
-* [x] Write HTML5 Canvas drawing JS code from Float32Array(
-* [ ] Pollish JS API.
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/binding.cc b/graphics/asymptote/cudareflect/tinyexr/experimental/js/binding.cc
deleted file mode 100644
index 4f6856848b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/binding.cc
+++ /dev/null
@@ -1,79 +0,0 @@
-#include <vector>
-
-#include <emscripten/bind.h>
-
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-
-using namespace emscripten;
-
-///
-/// Simple C++ wrapper class for Emscripten
-///
-class EXRLoader {
- public:
- ///
- /// `binary` is the buffer for EXR binary(e.g. buffer read by fs.readFileSync)
- /// std::string can be used as UInt8Array in JS layer.
- ///
- EXRLoader(const std::string &binary) {
- const float *ptr = reinterpret_cast<const float *>(binary.data());
-
- float *rgba = nullptr;
- width_ = -1;
- height_ = -1;
- const char *err = nullptr;
-
- error_.clear();
-
- result_ = LoadEXRFromMemory(
- &rgba, &width_, &height_,
- reinterpret_cast<const unsigned char *>(binary.data()), binary.size(),
- &err);
-
- if (TINYEXR_SUCCESS == result_) {
- image_.resize(size_t(width_ * height_ * 4));
- memcpy(image_.data(), rgba, sizeof(float) * size_t(width_ * height_ * 4));
- free(rgba);
- } else {
- if (err) {
- error_ = std::string(err);
- }
- }
- }
- ~EXRLoader() {}
-
- // Return as memory views
- emscripten::val getBytes() const {
- return emscripten::val(
- emscripten::typed_memory_view(image_.size(), image_.data()));
- }
-
- bool ok() const { return (TINYEXR_SUCCESS == result_); }
-
- const std::string error() const { return error_; }
-
- int width() const { return width_; }
-
- int height() const { return height_; }
-
- private:
- std::vector<float> image_; // RGBA
- int width_;
- int height_;
- int result_;
- std::string error_;
-};
-
-// Register STL
-EMSCRIPTEN_BINDINGS(stl_wrappters) { register_vector<float>("VectorFloat"); }
-
-EMSCRIPTEN_BINDINGS(tinyexr_module) {
- class_<EXRLoader>("EXRLoader")
- .constructor<const std::string &>()
- .function("getBytes", &EXRLoader::getBytes)
- .function("ok", &EXRLoader::ok)
- .function("error", &EXRLoader::error)
- .function("width", &EXRLoader::width)
- .function("height", &EXRLoader::height);
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/compile_to_js.sh b/graphics/asymptote/cudareflect/tinyexr/experimental/js/compile_to_js.sh
deleted file mode 100755
index dc750844bf..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/compile_to_js.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-EMCC=em++
-MINIZ='-I../../deps/miniz/ ../../deps/miniz/miniz.c'
-
-# Export EXR loader/saver function to JS.
-# TODO: export more functions
-# DEMANGLE_SUPPORT=1
-#${EMCC} -std=c++11 --bind -O2 -I../../ binding.cc ${MINIZ} --memory-init-file 0 -s TOTAL_MEMORY=67108864 -s DEMANGLE_SUPPORT=1 -s EXPORTED_FUNCTIONS="['_ParseEXRHeaderFromMemory', '_LoadEXRFromMemory']" -o tinyexr.js
-${EMCC} --bind -Os -I../../ binding.cc ${MINIZ} --memory-init-file 0 -s TOTAL_MEMORY=67108864 -o tinyexr.js
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/index.html b/graphics/asymptote/cudareflect/tinyexr/experimental/js/index.html
deleted file mode 100644
index d46e342d0e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/index.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <meta http-equiv="X-UA-Compatible" content="ie=edge">
- <title>TinyEXR to Canvas</title>
- <script src="tinyexr.js"></script>
- <style>
- </style>
-</head>
-<body>
- <canvas id="imgCanvas"></canvas>
-</body>
-<script>
- let canvas = document.getElementById('imgCanvas');
- let ctx = canvas.getContext('2d');
-
- fetch("./asakusa.exr").then(response => {
- return response.arrayBuffer();
- }).then(arrayBuffer => {
-
- // let exrImg = parseExr(arrayBuffer);
- let data = new Uint8Array(arrayBuffer);
- let exrImg = new Module.EXRLoader(data);
-
- canvas.width = exrImg.width();
- canvas.height = exrImg.height();
-
- let imageArray = exrImg.getBytes().map(num => {
- // Convert values to 0-255 range and apply gamma curve
- return Math.pow(num, 0.44) * 256;
- });
-
- let image8Array = new Uint8ClampedArray(imageArray);
- let imageData = new ImageData(image8Array, exrImg.width(), exrImg.height());
- ctx.putImageData(imageData, 0, 0);
-
- });
-</script>
-</html>
diff --git a/graphics/asymptote/cudareflect/tinyexr/experimental/js/test.js b/graphics/asymptote/cudareflect/tinyexr/experimental/js/test.js
deleted file mode 100644
index f91d4592ca..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/experimental/js/test.js
+++ /dev/null
@@ -1,21 +0,0 @@
-var fs = require('fs');
-var tinyexr = require('./tinyexr.js')
-
-var data = new Uint8Array(fs.readFileSync("../../asakusa.exr"))
-console.log(data.length)
-
-var instance = new tinyexr.EXRLoader(data);
-
-console.log(instance.ok())
-console.log(instance.width())
-console.log(instance.height())
-
-var image = instance.getBytes()
-console.log(image[0])
-console.log(image[1])
-console.log(image[2])
-console.log(image[3])
-console.log(image[4])
-console.log(image[5])
-console.log(image[6])
-console.log(image[7])
diff --git a/graphics/asymptote/cudareflect/tinyexr/jni/Android.mk b/graphics/asymptote/cudareflect/tinyexr/jni/Android.mk
deleted file mode 100644
index f2268a06fd..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/jni/Android.mk
+++ /dev/null
@@ -1,12 +0,0 @@
-# A simple test for the minimal standard C++ library
-#
-
-LOCAL_PATH := $(call my-dir)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := tinyexr
-LOCAL_SRC_FILES := ../tinyexr.cc
-
-LOCAL_C_INCLUDES := ../
-
-include $(BUILD_SHARED_LIBRARY)
diff --git a/graphics/asymptote/cudareflect/tinyexr/jni/Application.mk b/graphics/asymptote/cudareflect/tinyexr/jni/Application.mk
deleted file mode 100644
index e5d3191944..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/jni/Application.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-APP_ABI := all
-APP_STL := stlport_static
diff --git a/graphics/asymptote/cudareflect/tinyexr/jni/Makefile b/graphics/asymptote/cudareflect/tinyexr/jni/Makefile
deleted file mode 100644
index 86fd1e55c8..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/jni/Makefile
+++ /dev/null
@@ -1,8 +0,0 @@
-ifeq ($(ANDROID_HOME),)
-NDK ?= $(ANDROID_NDK)
-else
-NDK ?= $(lastword $(sort $(wildcard $(dir $(ANDROID_HOME))/android-ndk*)))
-endif
-
-all:
- $(NDK)/ndk-build V=1
diff --git a/graphics/asymptote/cudareflect/tinyexr/jni/README.md b/graphics/asymptote/cudareflect/tinyexr/jni/README.md
deleted file mode 100644
index b3f95d5e34..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/jni/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# Android NDK
-
-Test script to build `tinyexr` with Android NDK r10.
-Just checks compilation on Android NDK.
diff --git a/graphics/asymptote/cudareflect/tinyexr/kuroga.py b/graphics/asymptote/cudareflect/tinyexr/kuroga.py
deleted file mode 100644
index 2c41a08ab3..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/kuroga.py
+++ /dev/null
@@ -1,312 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Kuroga, single python file meta-build system for ninja
-# https://github.com/lighttransport/kuroga
-#
-# Requirements: python 2.6 or 2.7
-#
-# Usage: $ python kuroga.py input.py
-#
-
-import imp
-import re
-import textwrap
-import glob
-import os
-import sys
-
-# gcc preset
-def add_gnu_rule(ninja):
- ninja.rule('gnucxx', description='CXX $out',
- command='$gnucxx -MMD -MF $out.d $gnudefines $gnuincludes $gnucxxflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('gnucc', description='CC $out',
- command='$gnucc -MMD -MF $out.d $gnudefines $gnuincludes $gnucflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('gnulink', description='LINK $out', pool='link_pool',
- command='$gnuld -o $out $in $libs $gnuldflags')
- ninja.rule('gnuar', description='AR $out', pool='link_pool',
- command='$gnuar rsc $out $in')
- ninja.rule('gnustamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('gnucxx', 'g++')
- ninja.variable('gnucc', 'gcc')
- ninja.variable('gnuld', '$gnucxx')
- ninja.variable('gnuar', 'ar')
- ninja.newline()
-
-# clang preset
-def add_clang_rule(ninja):
- ninja.rule('clangcxx', description='CXX $out',
- command='$clangcxx -MMD -MF $out.d $clangdefines $clangincludes $clangcxxflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('clangcc', description='CC $out',
- command='$clangcc -MMD -MF $out.d $clangdefines $clangincludes $clangcflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('clanglink', description='LINK $out', pool='link_pool',
- command='$clangld -o $out $in $libs $gnuldflags')
- ninja.rule('clangar', description='AR $out', pool='link_pool',
- command='$clangar rsc $out $in')
- ninja.rule('clangstamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('clangcxx', 'clang++')
- ninja.variable('clangcc', 'clang')
- ninja.variable('clangld', '$clangcxx')
- ninja.variable('clangar', 'ar')
- ninja.newline()
-
-# msvc preset
-def add_msvc_rule(ninja):
- ninja.rule('msvccxx', description='CXX $out',
- command='$msvccxx /TP /showIncludes $msvcdefines $msvcincludes $msvccxxflags -c $in /Fo$out',
- depfile='$out.d', deps='msvc')
- ninja.rule('msvccc', description='CC $out',
- command='$msvccc /TC /showIncludes $msvcdefines $msvcincludes $msvccflags -c $in /Fo$out',
- depfile='$out.d', deps='msvc')
- ninja.rule('msvclink', description='LINK $out', pool='link_pool',
- command='$msvcld $msvcldflags $in $libs /OUT:$out')
- ninja.rule('msvcar', description='AR $out', pool='link_pool',
- command='$msvcar $in /OUT:$out')
- #ninja.rule('msvcstamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('msvccxx', 'cl.exe')
- ninja.variable('msvccc', 'cl.exe')
- ninja.variable('msvcld', 'link.exe')
- ninja.variable('msvcar', 'lib.exe')
- ninja.newline()
-
-# -- from ninja_syntax.py --
-def escape_path(word):
- return word.replace('$ ', '$$ ').replace(' ', '$ ').replace(':', '$:')
-
-class Writer(object):
- def __init__(self, output, width=78):
- self.output = output
- self.width = width
-
- def newline(self):
- self.output.write('\n')
-
- def comment(self, text, has_path=False):
- for line in textwrap.wrap(text, self.width - 2, break_long_words=False,
- break_on_hyphens=False):
- self.output.write('# ' + line + '\n')
-
- def variable(self, key, value, indent=0):
- if value is None:
- return
- if isinstance(value, list):
- value = ' '.join(filter(None, value)) # Filter out empty strings.
- self._line('%s = %s' % (key, value), indent)
-
- def pool(self, name, depth):
- self._line('pool %s' % name)
- self.variable('depth', depth, indent=1)
-
- def rule(self, name, command, description=None, depfile=None,
- generator=False, pool=None, restat=False, rspfile=None,
- rspfile_content=None, deps=None):
- self._line('rule %s' % name)
- self.variable('command', command, indent=1)
- if description:
- self.variable('description', description, indent=1)
- if depfile:
- self.variable('depfile', depfile, indent=1)
- if generator:
- self.variable('generator', '1', indent=1)
- if pool:
- self.variable('pool', pool, indent=1)
- if restat:
- self.variable('restat', '1', indent=1)
- if rspfile:
- self.variable('rspfile', rspfile, indent=1)
- if rspfile_content:
- self.variable('rspfile_content', rspfile_content, indent=1)
- if deps:
- self.variable('deps', deps, indent=1)
-
- def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
- variables=None):
- outputs = as_list(outputs)
- out_outputs = [escape_path(x) for x in outputs]
- all_inputs = [escape_path(x) for x in as_list(inputs)]
-
- if implicit:
- implicit = [escape_path(x) for x in as_list(implicit)]
- all_inputs.append('|')
- all_inputs.extend(implicit)
- if order_only:
- order_only = [escape_path(x) for x in as_list(order_only)]
- all_inputs.append('||')
- all_inputs.extend(order_only)
-
- self._line('build %s: %s' % (' '.join(out_outputs),
- ' '.join([rule] + all_inputs)))
-
- if variables:
- if isinstance(variables, dict):
- iterator = iter(variables.items())
- else:
- iterator = iter(variables)
-
- for key, val in iterator:
- self.variable(key, val, indent=1)
-
- return outputs
-
- def include(self, path):
- self._line('include %s' % path)
-
- def subninja(self, path):
- self._line('subninja %s' % path)
-
- def default(self, paths):
- self._line('default %s' % ' '.join(as_list(paths)))
-
- def _count_dollars_before_index(self, s, i):
- """Returns the number of '$' characters right in front of s[i]."""
- dollar_count = 0
- dollar_index = i - 1
- while dollar_index > 0 and s[dollar_index] == '$':
- dollar_count += 1
- dollar_index -= 1
- return dollar_count
-
- def _line(self, text, indent=0):
- """Write 'text' word-wrapped at self.width characters."""
- leading_space = ' ' * indent
- while len(leading_space) + len(text) > self.width:
- # The text is too wide; wrap if possible.
-
- # Find the rightmost space that would obey our width constraint and
- # that's not an escaped space.
- available_space = self.width - len(leading_space) - len(' $')
- space = available_space
- while True:
- space = text.rfind(' ', 0, space)
- if (space < 0 or
- self._count_dollars_before_index(text, space) % 2 == 0):
- break
-
- if space < 0:
- # No such space; just use the first unescaped space we can find.
- space = available_space - 1
- while True:
- space = text.find(' ', space + 1)
- if (space < 0 or
- self._count_dollars_before_index(text, space) % 2 == 0):
- break
- if space < 0:
- # Give up on breaking.
- break
-
- self.output.write(leading_space + text[0:space] + ' $\n')
- text = text[space+1:]
-
- # Subsequent lines are continuations, so indent them.
- leading_space = ' ' * (indent+2)
-
- self.output.write(leading_space + text + '\n')
-
- def close(self):
- self.output.close()
-
-
-def as_list(input):
- if input is None:
- return []
- if isinstance(input, list):
- return input
- return [input]
-
-# -- end from ninja_syntax.py --
-
-def gen(ninja, toolchain, config):
-
- ninja.variable('ninja_required_version', '1.4')
- ninja.newline()
-
- if hasattr(config, "builddir"):
- builddir = config.builddir[toolchain]
- ninja.variable(toolchain + 'builddir', builddir)
- else:
- builddir = ''
-
- ninja.variable(toolchain + 'defines', config.defines[toolchain] or [])
- ninja.variable(toolchain + 'includes', config.includes[toolchain] or [])
- ninja.variable(toolchain + 'cflags', config.cflags[toolchain] or [])
- ninja.variable(toolchain + 'cxxflags', config.cxxflags[toolchain] or [])
- ninja.variable(toolchain + 'ldflags', config.ldflags[toolchain] or [])
- ninja.newline()
-
- if hasattr(config, "link_pool_depth"):
- ninja.pool('link_pool', depth=config.link_pool_depth)
- else:
- ninja.pool('link_pool', depth=4)
- ninja.newline()
-
- # Add default toolchain(gnu, clang and msvc)
- add_gnu_rule(ninja)
- add_clang_rule(ninja)
- add_msvc_rule(ninja)
-
- obj_files = []
-
- cc = toolchain + 'cc'
- cxx = toolchain + 'cxx'
- link = toolchain + 'link'
- ar = toolchain + 'ar'
-
- if hasattr(config, "cxx_files"):
- for src in config.cxx_files:
- srcfile = src
- obj = os.path.splitext(srcfile)[0] + '.o'
- obj = os.path.join(builddir, obj);
- obj_files.append(obj)
- ninja.build(obj, cxx, srcfile)
- ninja.newline()
-
- if hasattr(config, "c_files"):
- for src in config.c_files:
- srcfile = src
- obj = os.path.splitext(srcfile)[0] + '.o'
- obj = os.path.join(builddir, obj);
- obj_files.append(obj)
- ninja.build(obj, cc, srcfile)
- ninja.newline()
-
- targetlist = []
- if hasattr(config, "exe"):
- ninja.build(config.exe, link, obj_files)
- targetlist.append(config.exe)
-
- if hasattr(config, "staticlib"):
- ninja.build(config.staticlib, ar, obj_files)
- targetlist.append(config.staticlib)
-
- ninja.build('all', 'phony', targetlist)
- ninja.newline()
-
- ninja.default('all')
-
-def main():
- if len(sys.argv) < 2:
- print("Usage: python kuroga.py config.py")
- sys.exit(1)
-
- config = imp.load_source("config", sys.argv[1])
-
- f = open('build.ninja', 'w')
- ninja = Writer(f)
-
- if hasattr(config, "register_toolchain"):
- config.register_toolchain(ninja)
-
- gen(ninja, config.toolchain, config)
- f.close()
-
-main()
diff --git a/graphics/asymptote/cudareflect/tinyexr/premake4.lua b/graphics/asymptote/cudareflect/tinyexr/premake4.lua
deleted file mode 100644
index 7470417960..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/premake4.lua
+++ /dev/null
@@ -1,55 +0,0 @@
-newoption {
- trigger = "with-zfp",
- description = "Build with ZFP support."
-}
-
-sources = {
- "tinyexr.h",
- "test_tinyexr.cc",
- }
-
-zfp_sources = {
- "./deps/ZFP/src/*.c"
-}
-
-miniz_sources = {
- "./deps/miniz/miniz.c"
-}
-
--- premake4.lua
-solution "TinyEXRSolution"
- configurations { "Release", "Debug" }
-
- if (os.is("windows")) then
- platforms { "x32", "x64" }
- else
- platforms { "native", "x32", "x64" }
- end
-
- if _OPTIONS["with-zfp"] then
- includedirs { "./deps/ZFP/inc" }
- defines { "TINYEXR_USE_ZFP=1" }
- files { zfp_sources }
- end
-
- if _OPTIONS["with-miniz"] then
- includedirs { "./deps/miniz" }
- defines { "TINYEXR_USE_MINIZ=1" }
- files { miniz_sources }
- end
-
- -- A project defines one build target
- project "tinyexrtest"
- kind "ConsoleApp"
- language "C++"
- files { sources }
-
- configuration "Debug"
- defines { "DEBUG" } -- -DDEBUG
- flags { "Symbols" }
- targetname "test_tinyexr_debug"
-
- configuration "Release"
- -- defines { "NDEBUG" } -- -NDEBUG
- flags { "Symbols", "Optimize" }
- targetname "test_tinyexr"
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/CMakeLists.txt b/graphics/asymptote/cudareflect/tinyexr/test/CMakeLists.txt
deleted file mode 100644
index 4a28914486..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/CMakeLists.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-project(tinyexr)
-cmake_minimum_required(VERSION 2.8)
-
-set(tinyexr-Source
- ${CMAKE_CURRENT_SOURCE_DIR}/../tinyexr.cc
- ${CMAKE_CURRENT_SOURCE_DIR}/../tinyexr.h
- )
-
-add_library(tinyexr
- ${tinyexr-Source}
- )
-
-#Installation
-#install ( TARGETS
-# tinyexr
-# DESTINATION
-# lib
-# )
-#install ( FILES
-# tinyexr.h
-# DESTINATION
-# include
-# )
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/c-binding/Makefile b/graphics/asymptote/cudareflect/tinyexr/test/c-binding/Makefile
deleted file mode 100644
index 66b3371838..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/c-binding/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-all:
- gcc -c -I../../deps/miniz ../../deps/miniz/miniz.c
- g++ -c -I../../ -I../../deps/miniz ../../tinyexr.cc
- gcc -c -I../../ test.c
- gcc test.o tinyexr.o miniz.o -lstdc++
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/c-binding/test.c b/graphics/asymptote/cudareflect/tinyexr/test/c-binding/test.c
deleted file mode 100644
index 3c7f4436f4..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/c-binding/test.c
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <tinyexr.h>
-
-int main(int argc, char** argv)
-{
- float *rgba;
- const char* err;
- int width;
- int height;
-
- if (argc < 2) {
- return EXIT_FAILURE;
- }
-
- int ret = LoadEXR(&rgba, &width, &height, argv[1], &err);
-
- return ret;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/exrcat/exrcat.cpp b/graphics/asymptote/cudareflect/tinyexr/test/exrcat/exrcat.cpp
deleted file mode 100644
index bccfc5f815..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/exrcat/exrcat.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-// https://gist.github.com/mmp/ba384e1f509e2e38d5df#file-exrcat-cpp
-
-#include "tinyexr/tinyexr.h"
-#include "tinyexr/tinyexr.cc"
-#include <stdio.h>
-#include <assert.h>
-#include <vector>
-#include <ImfInputFile.h>
-#include <ImfRgbaFile.h>
-#include <ImfChannelList.h>
-#include <ImfFrameBuffer.h>
-#include <half.h>
-using namespace Imf;
-using namespace Imath;
-
-#if 0
-void
-SaveAsPFM(const char* filename, int width, int height, float* data)
-{
- FILE* fp = fopen(filename, "wb");
- if (!fp) {
- fprintf(stderr, "failed to write a PFM file.\n");
- return;
- }
-
- fprintf(fp, "PF\n");
- fprintf(fp, "%d %d\n", width, height);
- fprintf(fp, "-1\n"); // -1: little endian, 1: big endian
-
- // RGBA -> RGB
- std::vector<float> rgb(width*height*3);
-
- for (size_t i = 0; i < width * height; i++) {
- rgb[3*i+0] = data[4*i+0];
- rgb[3*i+1] = data[4*i+1];
- rgb[3*i+2] = data[4*i+2];
- }
-
- fwrite(&rgb.at(0), sizeof(float), width * height * 3, fp);
-
- fclose(fp);
-}
-#endif
-
-static float *OpenExrLoad(const char *name, int *width, int *height) {
- try {
- RgbaInputFile file (name);
- Box2i dw = file.dataWindow();
- *width = dw.max.x - dw.min.x + 1;
- *height = dw.max.y - dw.min.y + 1;
- std::vector<Rgba> pixels(*width * *height);
- file.setFrameBuffer(&pixels[0] - dw.min.x - dw.min.y * *width, 1, *width);
- file.readPixels(dw.min.y, dw.max.y);
-
- printf("OpenExr\n datawindow: (%d %d) - (%d %d)\n", dw.min.x, dw.min.y,
- dw.max.x, dw.max.y);
- printf(" line order %s\n", (file.lineOrder() == INCREASING_Y) ?
- "increasing y" : ((file.lineOrder() == DECREASING_Y) ? "decreasing y"
- : "random y"));
- printf(" compression: ");
- switch (file.compression()) {
- case NO_COMPRESSION: printf("none"); break;
- case RLE_COMPRESSION: printf("RLE"); break;
- case ZIPS_COMPRESSION: printf("zip"); break;
- case ZIP_COMPRESSION: printf("zips"); break;
- case PIZ_COMPRESSION: printf("piz"); break;
- case PXR24_COMPRESSION: printf("pxr24"); break;
- case B44_COMPRESSION: printf("b44"); break;
- case B44A_COMPRESSION: printf("b44a"); break;
- default: printf("unknown!");
- }
- printf("\n");
-
- printf(" channels: ");
- RgbaChannels channels = file.channels();
- if (channels & WRITE_R) printf("R");
- if (channels & WRITE_G) printf("G");
- if (channels & WRITE_B) printf("B");
- if (channels & WRITE_A) printf("A");
- if (channels & WRITE_Y) printf("Y");
- if (channels & WRITE_C) printf("C");
- printf("\n");
-
- float *ret = new float[4 * *width * *height];
- for (int i = 0; i < *width * *height; ++i) {
- ret[4*i] = pixels[i].r;
- ret[4*i+1] = pixels[i].g;
- ret[4*i+2] = pixels[i].b;
- ret[4*i+3] = pixels[i].a;
- }
- return ret;
- } catch (const std::exception &e) {
- return NULL;
- }
-}
-
-int main(int argc, char *argv[]) {
- if (argc != 2) {
- fprintf(stderr, "usage: exrcat <file.exr>\n");
- return 1;
- }
-
- int ow, oh;
- float *orgb = OpenExrLoad(argv[1], &ow, &oh);
-
- //SaveAsPFM("out.pfm", ow, oh, orgb);
-
- int tw, th;
- float *trgb;
- const char *err;
- if (LoadEXR(&trgb, &tw, &th, argv[1], &err) != 0) {
- fprintf(stderr, "exrcat: %s %s\n", argv[1], err);
- return 1;
- }
-
- assert(ow == tw && oh == th);
- int o = 0;
- for (int y = 0; y < th; ++y) {
- for (int x = 0; x < tw; ++x, ++o) {
- printf("(%d, %d): %f %f %f %f - %f %f %f %f\n", x, y,
- orgb[4*o], orgb[4*o+1], orgb[4*o+2], orgb[4*o+3],
- trgb[4*o], trgb[4*o+1], trgb[4*o+2], trgb[4*o+3]);
- }
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/exrwrite/exrwritetest.cpp b/graphics/asymptote/cudareflect/tinyexr/test/exrwrite/exrwritetest.cpp
deleted file mode 100644
index fdcfce6e8e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/exrwrite/exrwritetest.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-// https://gist.github.com/mmp/21ea8ac6d7f682b6252b
-
-#include "tinyexr/tinyexr.h"
-#include "tinyexr/tinyexr.cc"
-#include <stdio.h>
-#include <assert.h>
-#include <vector>
-#include <algorithm>
-#include <ImfInputFile.h>
-#include <ImfRgbaFile.h>
-#include <ImfChannelList.h>
-#include <ImfFrameBuffer.h>
-#include <half.h>
-using namespace Imf;
-using namespace Imath;
-
-static float *OpenExrLoad(const char *name, int *width, int *height) {
- try {
- RgbaInputFile file (name);
- Box2i dw = file.dataWindow();
- *width = dw.max.x - dw.min.x + 1;
- *height = dw.max.y - dw.min.y + 1;
- std::vector<Rgba> pixels(*width * *height);
- file.setFrameBuffer(&pixels[0] - dw.min.x - dw.min.y * *width, 1, *width);
- file.readPixels(dw.min.y, dw.max.y);
-
- printf("OpenExr\n datawindow: (%d %d) - (%d %d)\n", dw.min.x, dw.min.y,
- dw.max.x, dw.max.y);
- printf(" line order %s\n", (file.lineOrder() == INCREASING_Y) ?
- "increasing y" : ((file.lineOrder() == DECREASING_Y) ? "decreasing y"
- : "random y"));
- printf(" compression: ");
- switch (file.compression()) {
- case NO_COMPRESSION: printf("none"); break;
- case RLE_COMPRESSION: printf("RLE"); break;
- case ZIPS_COMPRESSION: printf("zip"); break;
- case ZIP_COMPRESSION: printf("zips"); break;
- case PIZ_COMPRESSION: printf("piz"); break;
- case PXR24_COMPRESSION: printf("pxr24"); break;
- case B44_COMPRESSION: printf("b44"); break;
- case B44A_COMPRESSION: printf("b44a"); break;
- default: printf("unknown!");
- }
- printf("\n");
-
- printf(" channels: ");
- RgbaChannels channels = file.channels();
- if (channels & WRITE_R) printf("R");
- if (channels & WRITE_G) printf("G");
- if (channels & WRITE_B) printf("B");
- if (channels & WRITE_A) printf("A");
- if (channels & WRITE_Y) printf("Y");
- if (channels & WRITE_C) printf("C");
- printf("\n");
-
- float *ret = new float[4 * *width * *height];
- for (int i = 0; i < *width * *height; ++i) {
- ret[4*i] = pixels[i].r;
- ret[4*i+1] = pixels[i].g;
- ret[4*i+2] = pixels[i].b;
- ret[4*i+3] = pixels[i].a;
- }
- return ret;
- } catch (const std::exception &e) {
- return NULL;
- }
-}
-
-static void WriteImageEXR(const char *name, float *rgba,
- int xRes, int yRes) {
- Rgba *hrgba = new Rgba[xRes * yRes];
- for (int i = 0; i < xRes * yRes; ++i)
- hrgba[i] = Rgba(rgba[4*i], rgba[4*i+1], rgba[4*i+2], rgba[4*i+3]);
-
- Box2i displayWindow(V2i(0,0), V2i(xRes-1, yRes-1));
- Box2i dataWindow(V2i(0, 0), V2i(xRes - 1, yRes - 1));
-
- try {
- RgbaOutputFile file(name, displayWindow, dataWindow, WRITE_RGBA);
- file.setFrameBuffer(hrgba, 1, xRes);
- file.writePixels(yRes);
- }
- catch (const std::exception &e) {
- fprintf(stderr, "Unable to write image file \"%s\": %s", name,
- e.what());
- }
-
- delete[] hrgba;
-}
-
-
-int main(int argc, char *argv[]) {
- if (argc != 3) {
- fprintf(stderr, "usage: exrwritetest <tinyexr-filename.exr> <openexr-filename.exr>\n");
- return 1;
- }
-
- int w = 1;
- int h = 2;
- float *rgba = new float[4 * w * h];
- for (int i = 0; i < 4 * w * h; ++i) {
- rgba[i] = drand48();
- }
-
- WriteImageEXR(argv[2], rgba, w, h);
- const char *err;
- SaveEXR(rgba, w, h, argv[1], /* fp16 */1, &err);
-
- int ow, oh;
- float *orgba = OpenExrLoad(argv[2], &ow, &oh);
-
- int tw, th;
- float *trgba;
- if (LoadEXR(&trgba, &tw, &th, argv[1], &err) != 0) {
- fprintf(stderr, "exrwritetest: %s %s\n", argv[2], err);
- return 1;
- }
-
- int offset = 0;
- for (int y = 0; y < h; ++y) {
- for (int x = 0; x < w; ++x)
- for (int c = 0; c < 4; ++c, ++offset)
- if (orgba[offset] != trgba[offset])
- fprintf(stderr, "Mismatch at (%d,%d), component %d: "
- "orig %g, OpenEXR %g (err %g), tinyexr %g (err %g)\n",
- x, y, c, rgba[offset],
- orgba[offset], fabsf(rgba[offset] - orgba[offset]),
- trgba[offset], fabsf(rgba[offset] - trgba[offset]));
- }
-
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/Makefile b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/Makefile
deleted file mode 100644
index e17a9517f6..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-ISSUE_63_FLAGS=-O1 -g -fsanitize=address,bool,float-cast-overflow,integer-divide-by-zero,return,returns-nonnull-attribute,shift-exponent,signed-integer-overflow,unreachable,vla-bound -fno-sanitize-recover=all -funsigned-char
-
-all: miniz
- clang++ -std=c++11 -o fuzz_62 -I../../ -I../../deps/miniz -g -fsanitize=address fuzz.cc /usr/lib/llvm-5.0/lib/libFuzzer.a libminiz.a
- clang++ -std=c++11 -o fuzz_63 -I../../ -I../../deps/miniz ${ISSUE_63_FLAGS} fuzz.cc /usr/lib/llvm-5.0/lib/libFuzzer.a libminiz.a
-
-miniz:
- clang -c -I../../deps/miniz -g ../../deps/miniz/miniz.c
- llvm-ar rc libminiz.a miniz.o
-
-t:
- ./fuzz_62 issue-62-tinyexr_memcpy_heap-buffer-overflow
- ./fuzz_63 issue-63-tinyexr_signed-integer-overflow
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/README.md b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/README.md
deleted file mode 100644
index 616b62e2cb..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/README.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Test with libFuzzer
-
-## Requirements
-
-Ubuntu 16.04 + apt installed clang 5.0 libFuzzer.
-
-## Compile and run
-
-```
-$ make
-$ make t
-```
-
-## TODO
-
-* Move to use Catch unit test framework
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/fuzz.cc b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/fuzz.cc
deleted file mode 100644
index 6de8637e34..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/fuzz.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <stdint.h>
-#include <stddef.h>
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
- EXRVersion exr_version;
- EXRImage exr_image;
- EXRHeader exr_header;
- int ret = ParseEXRVersionFromMemory(&exr_version, data, size);
- if (ret != TINYEXR_SUCCESS) {
- return 0;
- }
- InitEXRHeader(&exr_header);
- ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, data, size, NULL);
- if (ret != TINYEXR_SUCCESS) {
- FreeEXRHeader(&exr_header);
- return 0;
- }
- InitEXRImage(&exr_image);
- ret = LoadEXRImageFromMemory(&exr_image, &exr_header, data, size, NULL);
- if (ret != TINYEXR_SUCCESS) {
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return 0;
- }
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return 0;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-62-tinyexr_memcpy_heap-buffer-overflow b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-62-tinyexr_memcpy_heap-buffer-overflow
deleted file mode 100644
index c9c65b9df4..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-62-tinyexr_memcpy_heap-buffer-overflow
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-63-tinyexr_signed-integer-overflow b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-63-tinyexr_signed-integer-overflow
deleted file mode 100644
index 2169c501b2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-63-tinyexr_signed-integer-overflow
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-77-heap-buffer-overflow b/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-77-heap-buffer-overflow
deleted file mode 100644
index fc326baf43..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/fuzzer/issue-77-heap-buffer-overflow
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/README.md b/graphics/asymptote/cudareflect/tinyexr/test/issues/160/README.md
deleted file mode 100644
index 9077773e8d..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/README.md
+++ /dev/null
@@ -1 +0,0 @@
-Reproducible script for issue #160(PIZ huffman decode issue)
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/main.py b/graphics/asymptote/cudareflect/tinyexr/test/issues/160/main.py
deleted file mode 100644
index 5fd77c5e17..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/main.py
+++ /dev/null
@@ -1,57 +0,0 @@
-import OpenEXR
-import Imath
-import numpy as np
-import simpleimageio as sio
-
-width = 420
-height = 32
-border_left = 0
-border_right = 420 - 80
-num_splats = 10000
-
-red = np.zeros((height, width), dtype=np.float32)
-green = np.zeros((height, width), dtype=np.float32)
-blue = np.zeros((height, width), dtype=np.float32)
-
-# splat random color values
-rng = np.random.default_rng()
-row = rng.integers(low=0, high=height, size=num_splats)
-col = rng.integers(low=border_left, high=border_right, size=num_splats)
-
-# if any of the three channels has a fixed value, the problem goes away!
-red[row, col] = rng.random(num_splats)
-green[row, col] = rng.random(num_splats)
-blue[row, col] = rng.random(num_splats)
-
-# add a bunch of test pixels
-red[-8, -10] = 1
-green[-8, -10] = 1
-blue[-8, -10] = 1
-
-red[-4, -8] = 1
-green[-4, -8] = 1
-blue[-4, -8] = 1
-
-red[-4, -2] = 1
-green[-4, -2] = 1
-blue[-4, -2] = 1
-
-red[-2, -3] = 0 # setting this to anything other than 0 fixes the problem
-green[-2, -3] = 1
-blue[-2, -3] = 1
-
-# fill in all of the black region with 0-red color
-# red[:,border_right:] = 0
-# green[:,border_right:] = 1
-# blue[:,border_right:] = 1
-
-# write PIZ compressed via OpenEXR
-header = OpenEXR.Header(width, height)
-header['compression'] = Imath.Compression(Imath.Compression.PIZ_COMPRESSION)
-exr = OpenEXR.OutputFile("gen.exr", header)
-exr.writePixels({'R': red.tobytes(), 'G': green.tobytes(), 'B': blue.tobytes()})
-exr.close()
-
-# read back in via tinyexr (used internally by simpleimageio)
-tinyresult = sio.read("gen.exr")
-sio.write("test2.exr", tinyresult)
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/requirements.txt b/graphics/asymptote/cudareflect/tinyexr/test/issues/160/requirements.txt
deleted file mode 100644
index cb3f878071..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/issues/160/requirements.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-OpenEXR
-numpy
-simpleimageio
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/Makefile b/graphics/asymptote/cudareflect/tinyexr/test/unit/Makefile
deleted file mode 100644
index 0757dda879..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-.PHONY: clean
-
-CC = clang
-CXX = clang++
-CXXFLAGS = -fsanitize=address,undefined -g -O2 -std=c++11 -I ../../deps/miniz
-CFLAGS = -fsanitize=address,undefined -g -O2 -I ../../deps/miniz
-
-all: tester
-
-miniz.o:
- $(CC) -c $(CFLAGS) ../../deps/miniz/miniz.c
-
-tester: tester.cc ../../tinyexr.h miniz.o
- $(CXX) $(CXXFLAGS) -o tester tester.cc miniz.o
-
-check: tester
- ./tester
-
-clean:
- rm -rf tester miniz.o
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/README.md b/graphics/asymptote/cudareflect/tinyexr/test/unit/README.md
deleted file mode 100644
index 8e3327275e..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/README.md
+++ /dev/null
@@ -1,30 +0,0 @@
-# Build&Test
-
-## Prepare
-
-Clone `https://github.com/openexr/openexr-images` to `../../../` directory.
-(Or edit path to openexr-images in `tester.cc`)
-
-## Use makefile
-
- $ make check
-
-## Use ninja + kuroga
-
-Assume
-
-* ninja 1.4+
-* python 2.6+
-
-Are installed.
-
-### Linux/MacOSX
-
- $ python kuroga.py config-posix.py
- $ ninja
-
-### Windows
-
- > python kuroga.py config-msvc.py
- > vcbuild.bat
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/catch.hpp b/graphics/asymptote/cudareflect/tinyexr/test/unit/catch.hpp
deleted file mode 100644
index 2a7146a7f9..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/catch.hpp
+++ /dev/null
@@ -1,10445 +0,0 @@
-/*
- * Catch v1.4.0
- * Generated: 2016-03-15 07:23:12.623111
- * ----------------------------------------------------------
- * This file has been merged from multiple headers. Please don't edit it directly
- * Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
- *
- * 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)
- */
-#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-
-#define TWOBLUECUBES_CATCH_HPP_INCLUDED
-
-#ifdef __clang__
-# pragma clang system_header
-#elif defined __GNUC__
-# pragma GCC system_header
-#endif
-
-// #included from: internal/catch_suppress_warnings.h
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(push)
-# pragma warning(disable: 161 1682)
-# else // __ICC
-# pragma clang diagnostic ignored "-Wglobal-constructors"
-# pragma clang diagnostic ignored "-Wvariadic-macros"
-# pragma clang diagnostic ignored "-Wc99-extensions"
-# pragma clang diagnostic ignored "-Wunused-variable"
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-# pragma clang diagnostic ignored "-Wc++98-compat"
-# pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
-# pragma clang diagnostic ignored "-Wswitch-enum"
-# pragma clang diagnostic ignored "-Wcovered-switch-default"
-# endif
-#elif defined __GNUC__
-# pragma GCC diagnostic ignored "-Wvariadic-macros"
-# pragma GCC diagnostic ignored "-Wunused-variable"
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wpadded"
-#endif
-#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
-# define CATCH_IMPL
-#endif
-
-#ifdef CATCH_IMPL
-# ifndef CLARA_CONFIG_MAIN
-# define CLARA_CONFIG_MAIN_NOT_DEFINED
-# define CLARA_CONFIG_MAIN
-# endif
-#endif
-
-// #included from: internal/catch_notimplemented_exception.h
-#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_H_INCLUDED
-
-// #included from: catch_common.h
-#define TWOBLUECUBES_CATCH_COMMON_H_INCLUDED
-
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
-#ifdef CATCH_CONFIG_COUNTER
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
-#else
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
-#endif
-
-#define INTERNAL_CATCH_STRINGIFY2( expr ) #expr
-#define INTERNAL_CATCH_STRINGIFY( expr ) INTERNAL_CATCH_STRINGIFY2( expr )
-
-#include <sstream>
-#include <stdexcept>
-#include <algorithm>
-
-// #included from: catch_compiler_capabilities.h
-#define TWOBLUECUBES_CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
-
-// Detect a number of compiler features - mostly C++11/14 conformance - by compiler
-// The following features are defined:
-//
-// CATCH_CONFIG_CPP11_NULLPTR : is nullptr supported?
-// CATCH_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
-// CATCH_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
-// CATCH_CONFIG_CPP11_IS_ENUM : std::is_enum is supported?
-// CATCH_CONFIG_CPP11_TUPLE : std::tuple is supported
-// CATCH_CONFIG_CPP11_LONG_LONG : is long long supported?
-// CATCH_CONFIG_CPP11_OVERRIDE : is override supported?
-// CATCH_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr)
-
-// CATCH_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
-
-// CATCH_CONFIG_VARIADIC_MACROS : are variadic macros supported?
-// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
-// ****************
-// Note to maintainers: if new toggles are added please document them
-// in configuration.md, too
-// ****************
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CATCH_CONFIG_CPP11_NO_NULLPTR) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-// All the C++11 features can be disabled with CATCH_CONFIG_NO_CPP11
-
-#if defined(__cplusplus) && __cplusplus >= 201103L
-# define CATCH_CPP11_OR_GREATER
-#endif
-
-#ifdef __clang__
-
-# if __has_feature(cxx_nullptr)
-# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-# endif
-
-# if __has_feature(cxx_noexcept)
-# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-# endif
-
-# if defined(CATCH_CPP11_OR_GREATER)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
-# endif
-
-#endif // __clang__
-
-////////////////////////////////////////////////////////////////////////////////
-// Borland
-#ifdef __BORLANDC__
-
-#endif // __BORLANDC__
-
-////////////////////////////////////////////////////////////////////////////////
-// EDG
-#ifdef __EDG_VERSION__
-
-#endif // __EDG_VERSION__
-
-////////////////////////////////////////////////////////////////////////////////
-// Digital Mars
-#ifdef __DMC__
-
-#endif // __DMC__
-
-////////////////////////////////////////////////////////////////////////////////
-// GCC
-#ifdef __GNUC__
-
-# if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
-# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-# endif
-
-# if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS) && defined(CATCH_CPP11_OR_GREATER)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
-# endif
-
-// - otherwise more recent versions define __cplusplus >= 201103L
-// and will get picked up below
-
-#endif // __GNUC__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#ifdef _MSC_VER
-
-#if (_MSC_VER >= 1600)
-# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
-#define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#endif
-
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Use variadic macros if the compiler supports them
-#if ( defined _MSC_VER && _MSC_VER > 1400 && !defined __EDGE__) || \
- ( defined __WAVE__ && __WAVE_HAS_VARIADICS ) || \
- ( defined __GNUC__ && __GNUC__ >= 3 ) || \
- ( !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L )
-
-#define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
-
-#endif
-
-// Use __COUNTER__ if the compiler supports it
-#if ( defined _MSC_VER && _MSC_VER >= 1300 ) || \
- ( defined __GNUC__ && __GNUC__ >= 4 && __GNUC_MINOR__ >= 3 ) || \
- ( defined __clang__ && __clang_major__ >= 3 )
-
-#define CATCH_INTERNAL_CONFIG_COUNTER
-
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// C++ language feature support
-
-// catch all support for C++11
-#if defined(CATCH_CPP11_OR_GREATER)
-
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR)
-# define CATCH_INTERNAL_CONFIG_CPP11_NULLPTR
-# endif
-
-# ifndef CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-# define CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT
-# endif
-
-# ifndef CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-# define CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-# endif
-
-# ifndef CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
-# define CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM
-# endif
-
-# ifndef CATCH_INTERNAL_CONFIG_CPP11_TUPLE
-# define CATCH_INTERNAL_CONFIG_CPP11_TUPLE
-# endif
-
-# ifndef CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
-# define CATCH_INTERNAL_CONFIG_VARIADIC_MACROS
-# endif
-
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG)
-# define CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG
-# endif
-
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE)
-# define CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE
-# endif
-# if !defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
-# define CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-# endif
-
-#endif // __cplusplus >= 201103L
-
-// Now set the actual defines based on the above + anything the user has configured
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NO_NULLPTR) && !defined(CATCH_CONFIG_CPP11_NULLPTR) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_NULLPTR
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_NOEXCEPT
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CATCH_CONFIG_CPP11_GENERATED_METHODS) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_GENERATED_METHODS
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_NO_IS_ENUM) && !defined(CATCH_CONFIG_CPP11_IS_ENUM) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_IS_ENUM
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_CPP11_NO_TUPLE) && !defined(CATCH_CONFIG_CPP11_TUPLE) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_TUPLE
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_VARIADIC_MACROS) && !defined(CATCH_CONFIG_NO_VARIADIC_MACROS) && !defined(CATCH_CONFIG_VARIADIC_MACROS)
-# define CATCH_CONFIG_VARIADIC_MACROS
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_LONG_LONG) && !defined(CATCH_CONFIG_CPP11_LONG_LONG) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_LONG_LONG
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_OVERRIDE) && !defined(CATCH_CONFIG_CPP11_OVERRIDE) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_OVERRIDE
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_UNIQUE_PTR) && !defined(CATCH_CONFIG_CPP11_UNIQUE_PTR) && !defined(CATCH_CONFIG_NO_CPP11)
-# define CATCH_CONFIG_CPP11_UNIQUE_PTR
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
-# define CATCH_CONFIG_COUNTER
-#endif
-
-#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
-#endif
-
-// noexcept support:
-#if defined(CATCH_CONFIG_CPP11_NOEXCEPT) && !defined(CATCH_NOEXCEPT)
-# define CATCH_NOEXCEPT noexcept
-# define CATCH_NOEXCEPT_IS(x) noexcept(x)
-#else
-# define CATCH_NOEXCEPT throw()
-# define CATCH_NOEXCEPT_IS(x)
-#endif
-
-// nullptr support
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-# define CATCH_NULL nullptr
-#else
-# define CATCH_NULL NULL
-#endif
-
-// override support
-#ifdef CATCH_CONFIG_CPP11_OVERRIDE
-# define CATCH_OVERRIDE override
-#else
-# define CATCH_OVERRIDE
-#endif
-
-// unique_ptr support
-#ifdef CATCH_CONFIG_CPP11_UNIQUE_PTR
-# define CATCH_AUTO_PTR( T ) std::unique_ptr<T>
-#else
-# define CATCH_AUTO_PTR( T ) std::auto_ptr<T>
-#endif
-
-namespace Catch {
-
- struct IConfig;
-
- struct CaseSensitive { enum Choice {
- Yes,
- No
- }; };
-
- class NonCopyable {
-#ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- NonCopyable( NonCopyable const& ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable& operator = ( NonCopyable const& ) = delete;
- NonCopyable& operator = ( NonCopyable && ) = delete;
-#else
- NonCopyable( NonCopyable const& info );
- NonCopyable& operator = ( NonCopyable const& );
-#endif
-
- protected:
- NonCopyable() {}
- virtual ~NonCopyable();
- };
-
- class SafeBool {
- public:
- typedef void (SafeBool::*type)() const;
-
- static type makeSafe( bool value ) {
- return value ? &SafeBool::trueValue : 0;
- }
- private:
- void trueValue() const {}
- };
-
- template<typename ContainerT>
- inline void deleteAll( ContainerT& container ) {
- typename ContainerT::const_iterator it = container.begin();
- typename ContainerT::const_iterator itEnd = container.end();
- for(; it != itEnd; ++it )
- delete *it;
- }
- template<typename AssociativeContainerT>
- inline void deleteAllValues( AssociativeContainerT& container ) {
- typename AssociativeContainerT::const_iterator it = container.begin();
- typename AssociativeContainerT::const_iterator itEnd = container.end();
- for(; it != itEnd; ++it )
- delete it->second;
- }
-
- bool startsWith( std::string const& s, std::string const& prefix );
- bool endsWith( std::string const& s, std::string const& suffix );
- bool contains( std::string const& s, std::string const& infix );
- void toLowerInPlace( std::string& s );
- std::string toLower( std::string const& s );
- std::string trim( std::string const& str );
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
-
- struct pluralise {
- pluralise( std::size_t count, std::string const& label );
-
- friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
-
- std::size_t m_count;
- std::string m_label;
- };
-
- struct SourceLineInfo {
-
- SourceLineInfo();
- SourceLineInfo( char const* _file, std::size_t _line );
- SourceLineInfo( SourceLineInfo const& other );
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- SourceLineInfo( SourceLineInfo && ) = default;
- SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
- SourceLineInfo& operator = ( SourceLineInfo && ) = default;
-# endif
- bool empty() const;
- bool operator == ( SourceLineInfo const& other ) const;
- bool operator < ( SourceLineInfo const& other ) const;
-
- std::string file;
- std::size_t line;
- };
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
-
- // This is just here to avoid compiler warnings with macro constants and boolean literals
- inline bool isTrue( bool value ){ return value; }
- inline bool alwaysTrue() { return true; }
- inline bool alwaysFalse() { return false; }
-
- void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo );
-
- void seedRng( IConfig const& config );
- unsigned int rngSeed();
-
- // Use this in variadic streaming macros to allow
- // >> +StreamEndStop
- // as well as
- // >> stuff +StreamEndStop
- struct StreamEndStop {
- std::string operator+() {
- return std::string();
- }
- };
- template<typename T>
- T const& operator + ( T const& value, StreamEndStop ) {
- return value;
- }
-}
-
-#define CATCH_INTERNAL_LINEINFO ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-#define CATCH_INTERNAL_ERROR( msg ) ::Catch::throwLogicError( msg, CATCH_INTERNAL_LINEINFO );
-
-#include <ostream>
-
-namespace Catch {
-
- class NotImplementedException : public std::exception
- {
- public:
- NotImplementedException( SourceLineInfo const& lineInfo );
- NotImplementedException( NotImplementedException const& ) {}
-
- virtual ~NotImplementedException() CATCH_NOEXCEPT {}
-
- virtual const char* what() const CATCH_NOEXCEPT;
-
- private:
- std::string m_what;
- SourceLineInfo m_lineInfo;
- };
-
-} // end namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define CATCH_NOT_IMPLEMENTED throw Catch::NotImplementedException( CATCH_INTERNAL_LINEINFO )
-
-// #included from: internal/catch_context.h
-#define TWOBLUECUBES_CATCH_CONTEXT_H_INCLUDED
-
-// #included from: catch_interfaces_generators.h
-#define TWOBLUECUBES_CATCH_INTERFACES_GENERATORS_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- struct IGeneratorInfo {
- virtual ~IGeneratorInfo();
- virtual bool moveNext() = 0;
- virtual std::size_t getCurrentIndex() const = 0;
- };
-
- struct IGeneratorsForTest {
- virtual ~IGeneratorsForTest();
-
- virtual IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) = 0;
- virtual bool moveNext() = 0;
- };
-
- IGeneratorsForTest* createGeneratorsForTest();
-
-} // end namespace Catch
-
-// #included from: catch_ptr.hpp
-#define TWOBLUECUBES_CATCH_PTR_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- // An intrusive reference counting smart pointer.
- // T must implement addRef() and release() methods
- // typically implementing the IShared interface
- template<typename T>
- class Ptr {
- public:
- Ptr() : m_p( CATCH_NULL ){}
- Ptr( T* p ) : m_p( p ){
- if( m_p )
- m_p->addRef();
- }
- Ptr( Ptr const& other ) : m_p( other.m_p ){
- if( m_p )
- m_p->addRef();
- }
- ~Ptr(){
- if( m_p )
- m_p->release();
- }
- void reset() {
- if( m_p )
- m_p->release();
- m_p = CATCH_NULL;
- }
- Ptr& operator = ( T* p ){
- Ptr temp( p );
- swap( temp );
- return *this;
- }
- Ptr& operator = ( Ptr const& other ){
- Ptr temp( other );
- swap( temp );
- return *this;
- }
- void swap( Ptr& other ) { std::swap( m_p, other.m_p ); }
- T* get() const{ return m_p; }
- T& operator*() const { return *m_p; }
- T* operator->() const { return m_p; }
- bool operator !() const { return m_p == CATCH_NULL; }
- operator SafeBool::type() const { return SafeBool::makeSafe( m_p != CATCH_NULL ); }
-
- private:
- T* m_p;
- };
-
- struct IShared : NonCopyable {
- virtual ~IShared();
- virtual void addRef() const = 0;
- virtual void release() const = 0;
- };
-
- template<typename T = IShared>
- struct SharedImpl : T {
-
- SharedImpl() : m_rc( 0 ){}
-
- virtual void addRef() const {
- ++m_rc;
- }
- virtual void release() const {
- if( --m_rc == 0 )
- delete this;
- }
-
- mutable unsigned int m_rc;
- };
-
-} // end namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#include <memory>
-#include <vector>
-#include <stdlib.h>
-
-namespace Catch {
-
- class TestCase;
- class Stream;
- struct IResultCapture;
- struct IRunner;
- struct IGeneratorsForTest;
- struct IConfig;
-
- struct IContext
- {
- virtual ~IContext();
-
- virtual IResultCapture* getResultCapture() = 0;
- virtual IRunner* getRunner() = 0;
- virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) = 0;
- virtual bool advanceGeneratorsForCurrentTest() = 0;
- virtual Ptr<IConfig const> getConfig() const = 0;
- };
-
- struct IMutableContext : IContext
- {
- virtual ~IMutableContext();
- virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
- virtual void setRunner( IRunner* runner ) = 0;
- virtual void setConfig( Ptr<IConfig const> const& config ) = 0;
- };
-
- IContext& getCurrentContext();
- IMutableContext& getCurrentMutableContext();
- void cleanUpContext();
- Stream createStream( std::string const& streamName );
-
-}
-
-// #included from: internal/catch_test_registry.hpp
-#define TWOBLUECUBES_CATCH_TEST_REGISTRY_HPP_INCLUDED
-
-// #included from: catch_interfaces_testcase.h
-#define TWOBLUECUBES_CATCH_INTERFACES_TESTCASE_H_INCLUDED
-
-#include <vector>
-
-namespace Catch {
-
- class TestSpec;
-
- struct ITestCase : IShared {
- virtual void invoke () const = 0;
- protected:
- virtual ~ITestCase();
- };
-
- class TestCase;
- struct IConfig;
-
- struct ITestCaseRegistry {
- virtual ~ITestCaseRegistry();
- virtual std::vector<TestCase> const& getAllTests() const = 0;
- virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
- };
-
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
-}
-
-namespace Catch {
-
-template<typename C>
-class MethodTestCase : public SharedImpl<ITestCase> {
-
-public:
- MethodTestCase( void (C::*method)() ) : m_method( method ) {}
-
- virtual void invoke() const {
- C obj;
- (obj.*m_method)();
- }
-
-private:
- virtual ~MethodTestCase() {}
-
- void (C::*m_method)();
-};
-
-typedef void(*TestFunction)();
-
-struct NameAndDesc {
- NameAndDesc( const char* _name = "", const char* _description= "" )
- : name( _name ), description( _description )
- {}
-
- const char* name;
- const char* description;
-};
-
-void registerTestCase
- ( ITestCase* testCase,
- char const* className,
- NameAndDesc const& nameAndDesc,
- SourceLineInfo const& lineInfo );
-
-struct AutoReg {
-
- AutoReg
- ( TestFunction function,
- SourceLineInfo const& lineInfo,
- NameAndDesc const& nameAndDesc );
-
- template<typename C>
- AutoReg
- ( void (C::*method)(),
- char const* className,
- NameAndDesc const& nameAndDesc,
- SourceLineInfo const& lineInfo ) {
-
- registerTestCase
- ( new MethodTestCase<C>( method ),
- className,
- nameAndDesc,
- lineInfo );
- }
-
- ~AutoReg();
-
-private:
- AutoReg( AutoReg const& );
- void operator= ( AutoReg const& );
-};
-
-void registerTestCaseFunction
- ( TestFunction function,
- SourceLineInfo const& lineInfo,
- NameAndDesc const& nameAndDesc );
-
-} // end namespace Catch
-
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
- static void TestName(); \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) ); }\
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); }
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
- namespace{ \
- struct TestName : ClassName{ \
- void test(); \
- }; \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestName::test, #ClassName, Catch::NameAndDesc( __VA_ARGS__ ), CATCH_INTERNAL_LINEINFO ); \
- } \
- void TestName::test()
- #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
- Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( __VA_ARGS__ ) );
-
-#else
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TESTCASE2( TestName, Name, Desc ) \
- static void TestName(); \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &TestName, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) ); }\
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE( Name, Desc ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), Name, Desc )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, Name, Desc ) \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( &QualifiedMethod, "&" #QualifiedMethod, Catch::NameAndDesc( Name, Desc ), CATCH_INTERNAL_LINEINFO ); }
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestCaseName, ClassName, TestName, Desc )\
- namespace{ \
- struct TestCaseName : ClassName{ \
- void test(); \
- }; \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( &TestCaseName::test, #ClassName, Catch::NameAndDesc( TestName, Desc ), CATCH_INTERNAL_LINEINFO ); \
- } \
- void TestCaseName::test()
- #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, TestName, Desc )\
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, TestName, Desc )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, Name, Desc ) \
- Catch::AutoReg( Function, CATCH_INTERNAL_LINEINFO, Catch::NameAndDesc( Name, Desc ) );
-#endif
-
-// #included from: internal/catch_capture.hpp
-#define TWOBLUECUBES_CATCH_CAPTURE_HPP_INCLUDED
-
-// #included from: catch_result_builder.h
-#define TWOBLUECUBES_CATCH_RESULT_BUILDER_H_INCLUDED
-
-// #included from: catch_result_type.h
-#define TWOBLUECUBES_CATCH_RESULT_TYPE_H_INCLUDED
-
-namespace Catch {
-
- // ResultWas::OfType enum
- struct ResultWas { enum OfType {
- Unknown = -1,
- Ok = 0,
- Info = 1,
- Warning = 2,
-
- FailureBit = 0x10,
-
- ExpressionFailed = FailureBit | 1,
- ExplicitFailure = FailureBit | 2,
-
- Exception = 0x100 | FailureBit,
-
- ThrewException = Exception | 1,
- DidntThrowException = Exception | 2,
-
- FatalErrorCondition = 0x200 | FailureBit
-
- }; };
-
- inline bool isOk( ResultWas::OfType resultType ) {
- return ( resultType & ResultWas::FailureBit ) == 0;
- }
- inline bool isJustInfo( int flags ) {
- return flags == ResultWas::Info;
- }
-
- // ResultDisposition::Flags enum
- struct ResultDisposition { enum Flags {
- Normal = 0x01,
-
- ContinueOnFailure = 0x02, // Failures fail test, but execution continues
- FalseTest = 0x04, // Prefix expression with !
- SuppressFail = 0x08 // Failures are reported but do not fail the test
- }; };
-
- inline ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
- return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
- }
-
- inline bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
- inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
- inline bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
-
-} // end namespace Catch
-
-// #included from: catch_assertionresult.h
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- struct AssertionInfo
- {
- AssertionInfo() {}
- AssertionInfo( std::string const& _macroName,
- SourceLineInfo const& _lineInfo,
- std::string const& _capturedExpression,
- ResultDisposition::Flags _resultDisposition );
-
- std::string macroName;
- SourceLineInfo lineInfo;
- std::string capturedExpression;
- ResultDisposition::Flags resultDisposition;
- };
-
- struct AssertionResultData
- {
- AssertionResultData() : resultType( ResultWas::Unknown ) {}
-
- std::string reconstructedExpression;
- std::string message;
- ResultWas::OfType resultType;
- };
-
- class AssertionResult {
- public:
- AssertionResult();
- AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
- ~AssertionResult();
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- AssertionResult( AssertionResult const& ) = default;
- AssertionResult( AssertionResult && ) = default;
- AssertionResult& operator = ( AssertionResult const& ) = default;
- AssertionResult& operator = ( AssertionResult && ) = default;
-# endif
-
- bool isOk() const;
- bool succeeded() const;
- ResultWas::OfType getResultType() const;
- bool hasExpression() const;
- bool hasMessage() const;
- std::string getExpression() const;
- std::string getExpressionInMacro() const;
- bool hasExpandedExpression() const;
- std::string getExpandedExpression() const;
- std::string getMessage() const;
- SourceLineInfo getSourceInfo() const;
- std::string getTestMacroName() const;
-
- protected:
- AssertionInfo m_info;
- AssertionResultData m_resultData;
- };
-
-} // end namespace Catch
-
-// #included from: catch_matchers.hpp
-#define TWOBLUECUBES_CATCH_MATCHERS_HPP_INCLUDED
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- namespace Generic {
- template<typename ExpressionT> class AllOf;
- template<typename ExpressionT> class AnyOf;
- template<typename ExpressionT> class Not;
- }
-
- template<typename ExpressionT>
- struct Matcher : SharedImpl<IShared>
- {
- typedef ExpressionT ExpressionType;
-
- virtual ~Matcher() {}
- virtual Ptr<Matcher> clone() const = 0;
- virtual bool match( ExpressionT const& expr ) const = 0;
- virtual std::string toString() const = 0;
-
- Generic::AllOf<ExpressionT> operator && ( Matcher<ExpressionT> const& other ) const;
- Generic::AnyOf<ExpressionT> operator || ( Matcher<ExpressionT> const& other ) const;
- Generic::Not<ExpressionT> operator ! () const;
- };
-
- template<typename DerivedT, typename ExpressionT>
- struct MatcherImpl : Matcher<ExpressionT> {
-
- virtual Ptr<Matcher<ExpressionT> > clone() const {
- return Ptr<Matcher<ExpressionT> >( new DerivedT( static_cast<DerivedT const&>( *this ) ) );
- }
- };
-
- namespace Generic {
- template<typename ExpressionT>
- class Not : public MatcherImpl<Not<ExpressionT>, ExpressionT> {
- public:
- explicit Not( Matcher<ExpressionT> const& matcher ) : m_matcher(matcher.clone()) {}
- Not( Not const& other ) : m_matcher( other.m_matcher ) {}
-
- virtual bool match( ExpressionT const& expr ) const CATCH_OVERRIDE {
- return !m_matcher->match( expr );
- }
-
- virtual std::string toString() const CATCH_OVERRIDE {
- return "not " + m_matcher->toString();
- }
- private:
- Ptr< Matcher<ExpressionT> > m_matcher;
- };
-
- template<typename ExpressionT>
- class AllOf : public MatcherImpl<AllOf<ExpressionT>, ExpressionT> {
- public:
-
- AllOf() {}
- AllOf( AllOf const& other ) : m_matchers( other.m_matchers ) {}
-
- AllOf& add( Matcher<ExpressionT> const& matcher ) {
- m_matchers.push_back( matcher.clone() );
- return *this;
- }
- virtual bool match( ExpressionT const& expr ) const
- {
- for( std::size_t i = 0; i < m_matchers.size(); ++i )
- if( !m_matchers[i]->match( expr ) )
- return false;
- return true;
- }
- virtual std::string toString() const {
- std::ostringstream oss;
- oss << "( ";
- for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
- if( i != 0 )
- oss << " and ";
- oss << m_matchers[i]->toString();
- }
- oss << " )";
- return oss.str();
- }
-
- AllOf operator && ( Matcher<ExpressionT> const& other ) const {
- AllOf allOfExpr( *this );
- allOfExpr.add( other );
- return allOfExpr;
- }
-
- private:
- std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
- };
-
- template<typename ExpressionT>
- class AnyOf : public MatcherImpl<AnyOf<ExpressionT>, ExpressionT> {
- public:
-
- AnyOf() {}
- AnyOf( AnyOf const& other ) : m_matchers( other.m_matchers ) {}
-
- AnyOf& add( Matcher<ExpressionT> const& matcher ) {
- m_matchers.push_back( matcher.clone() );
- return *this;
- }
- virtual bool match( ExpressionT const& expr ) const
- {
- for( std::size_t i = 0; i < m_matchers.size(); ++i )
- if( m_matchers[i]->match( expr ) )
- return true;
- return false;
- }
- virtual std::string toString() const {
- std::ostringstream oss;
- oss << "( ";
- for( std::size_t i = 0; i < m_matchers.size(); ++i ) {
- if( i != 0 )
- oss << " or ";
- oss << m_matchers[i]->toString();
- }
- oss << " )";
- return oss.str();
- }
-
- AnyOf operator || ( Matcher<ExpressionT> const& other ) const {
- AnyOf anyOfExpr( *this );
- anyOfExpr.add( other );
- return anyOfExpr;
- }
-
- private:
- std::vector<Ptr<Matcher<ExpressionT> > > m_matchers;
- };
-
- } // namespace Generic
-
- template<typename ExpressionT>
- Generic::AllOf<ExpressionT> Matcher<ExpressionT>::operator && ( Matcher<ExpressionT> const& other ) const {
- Generic::AllOf<ExpressionT> allOfExpr;
- allOfExpr.add( *this );
- allOfExpr.add( other );
- return allOfExpr;
- }
-
- template<typename ExpressionT>
- Generic::AnyOf<ExpressionT> Matcher<ExpressionT>::operator || ( Matcher<ExpressionT> const& other ) const {
- Generic::AnyOf<ExpressionT> anyOfExpr;
- anyOfExpr.add( *this );
- anyOfExpr.add( other );
- return anyOfExpr;
- }
-
- template<typename ExpressionT>
- Generic::Not<ExpressionT> Matcher<ExpressionT>::operator ! () const {
- return Generic::Not<ExpressionT>( *this );
- }
-
- namespace StdString {
-
- inline std::string makeString( std::string const& str ) { return str; }
- inline std::string makeString( const char* str ) { return str ? std::string( str ) : std::string(); }
-
- struct CasedString
- {
- CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_str( adjustString( str ) )
- {}
- std::string adjustString( std::string const& str ) const {
- return m_caseSensitivity == CaseSensitive::No
- ? toLower( str )
- : str;
-
- }
- std::string toStringSuffix() const
- {
- return m_caseSensitivity == CaseSensitive::No
- ? " (case insensitive)"
- : "";
- }
- CaseSensitive::Choice m_caseSensitivity;
- std::string m_str;
- };
-
- struct Equals : MatcherImpl<Equals, std::string> {
- Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes )
- : m_data( str, caseSensitivity )
- {}
- Equals( Equals const& other ) : m_data( other.m_data ){}
-
- virtual ~Equals();
-
- virtual bool match( std::string const& expr ) const {
- return m_data.m_str == m_data.adjustString( expr );;
- }
- virtual std::string toString() const {
- return "equals: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
- }
-
- CasedString m_data;
- };
-
- struct Contains : MatcherImpl<Contains, std::string> {
- Contains( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes )
- : m_data( substr, caseSensitivity ){}
- Contains( Contains const& other ) : m_data( other.m_data ){}
-
- virtual ~Contains();
-
- virtual bool match( std::string const& expr ) const {
- return m_data.adjustString( expr ).find( m_data.m_str ) != std::string::npos;
- }
- virtual std::string toString() const {
- return "contains: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
- }
-
- CasedString m_data;
- };
-
- struct StartsWith : MatcherImpl<StartsWith, std::string> {
- StartsWith( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes )
- : m_data( substr, caseSensitivity ){}
-
- StartsWith( StartsWith const& other ) : m_data( other.m_data ){}
-
- virtual ~StartsWith();
-
- virtual bool match( std::string const& expr ) const {
- return startsWith( m_data.adjustString( expr ), m_data.m_str );
- }
- virtual std::string toString() const {
- return "starts with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
- }
-
- CasedString m_data;
- };
-
- struct EndsWith : MatcherImpl<EndsWith, std::string> {
- EndsWith( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes )
- : m_data( substr, caseSensitivity ){}
- EndsWith( EndsWith const& other ) : m_data( other.m_data ){}
-
- virtual ~EndsWith();
-
- virtual bool match( std::string const& expr ) const {
- return endsWith( m_data.adjustString( expr ), m_data.m_str );
- }
- virtual std::string toString() const {
- return "ends with: \"" + m_data.m_str + "\"" + m_data.toStringSuffix();
- }
-
- CasedString m_data;
- };
- } // namespace StdString
- } // namespace Impl
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
- template<typename ExpressionT>
- inline Impl::Generic::Not<ExpressionT> Not( Impl::Matcher<ExpressionT> const& m ) {
- return Impl::Generic::Not<ExpressionT>( m );
- }
-
- template<typename ExpressionT>
- inline Impl::Generic::AllOf<ExpressionT> AllOf( Impl::Matcher<ExpressionT> const& m1,
- Impl::Matcher<ExpressionT> const& m2 ) {
- return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 );
- }
- template<typename ExpressionT>
- inline Impl::Generic::AllOf<ExpressionT> AllOf( Impl::Matcher<ExpressionT> const& m1,
- Impl::Matcher<ExpressionT> const& m2,
- Impl::Matcher<ExpressionT> const& m3 ) {
- return Impl::Generic::AllOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
- }
- template<typename ExpressionT>
- inline Impl::Generic::AnyOf<ExpressionT> AnyOf( Impl::Matcher<ExpressionT> const& m1,
- Impl::Matcher<ExpressionT> const& m2 ) {
- return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 );
- }
- template<typename ExpressionT>
- inline Impl::Generic::AnyOf<ExpressionT> AnyOf( Impl::Matcher<ExpressionT> const& m1,
- Impl::Matcher<ExpressionT> const& m2,
- Impl::Matcher<ExpressionT> const& m3 ) {
- return Impl::Generic::AnyOf<ExpressionT>().add( m1 ).add( m2 ).add( m3 );
- }
-
- inline Impl::StdString::Equals Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) {
- return Impl::StdString::Equals( str, caseSensitivity );
- }
- inline Impl::StdString::Equals Equals( const char* str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) {
- return Impl::StdString::Equals( Impl::StdString::makeString( str ), caseSensitivity );
- }
- inline Impl::StdString::Contains Contains( std::string const& substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) {
- return Impl::StdString::Contains( substr, caseSensitivity );
- }
- inline Impl::StdString::Contains Contains( const char* substr, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes ) {
- return Impl::StdString::Contains( Impl::StdString::makeString( substr ), caseSensitivity );
- }
- inline Impl::StdString::StartsWith StartsWith( std::string const& substr ) {
- return Impl::StdString::StartsWith( substr );
- }
- inline Impl::StdString::StartsWith StartsWith( const char* substr ) {
- return Impl::StdString::StartsWith( Impl::StdString::makeString( substr ) );
- }
- inline Impl::StdString::EndsWith EndsWith( std::string const& substr ) {
- return Impl::StdString::EndsWith( substr );
- }
- inline Impl::StdString::EndsWith EndsWith( const char* substr ) {
- return Impl::StdString::EndsWith( Impl::StdString::makeString( substr ) );
- }
-
-} // namespace Matchers
-
-using namespace Matchers;
-
-} // namespace Catch
-
-namespace Catch {
-
- struct TestFailureException{};
-
- template<typename T> class ExpressionLhs;
-
- struct STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison;
-
- struct CopyableStream {
- CopyableStream() {}
- CopyableStream( CopyableStream const& other ) {
- oss << other.oss.str();
- }
- CopyableStream& operator=( CopyableStream const& other ) {
- oss.str("");
- oss << other.oss.str();
- return *this;
- }
- std::ostringstream oss;
- };
-
- class ResultBuilder {
- public:
- ResultBuilder( char const* macroName,
- SourceLineInfo const& lineInfo,
- char const* capturedExpression,
- ResultDisposition::Flags resultDisposition,
- char const* secondArg = "" );
-
- template<typename T>
- ExpressionLhs<T const&> operator <= ( T const& operand );
- ExpressionLhs<bool> operator <= ( bool value );
-
- template<typename T>
- ResultBuilder& operator << ( T const& value ) {
- m_stream.oss << value;
- return *this;
- }
-
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& );
-
- ResultBuilder& setResultType( ResultWas::OfType result );
- ResultBuilder& setResultType( bool result );
- ResultBuilder& setLhs( std::string const& lhs );
- ResultBuilder& setRhs( std::string const& rhs );
- ResultBuilder& setOp( std::string const& op );
-
- void endExpression();
-
- std::string reconstructExpression() const;
- AssertionResult build() const;
-
- void useActiveException( ResultDisposition::Flags resultDisposition = ResultDisposition::Normal );
- void captureResult( ResultWas::OfType resultType );
- void captureExpression();
- void captureExpectedException( std::string const& expectedMessage );
- void captureExpectedException( Matchers::Impl::Matcher<std::string> const& matcher );
- void handleResult( AssertionResult const& result );
- void react();
- bool shouldDebugBreak() const;
- bool allowThrows() const;
-
- private:
- AssertionInfo m_assertionInfo;
- AssertionResultData m_data;
- struct ExprComponents {
- ExprComponents() : testFalse( false ) {}
- bool testFalse;
- std::string lhs, rhs, op;
- } m_exprComponents;
- CopyableStream m_stream;
-
- bool m_shouldDebugBreak;
- bool m_shouldThrow;
- };
-
-} // namespace Catch
-
-// Include after due to circular dependency:
-// #included from: catch_expression_lhs.hpp
-#define TWOBLUECUBES_CATCH_EXPRESSION_LHS_HPP_INCLUDED
-
-// #included from: catch_evaluate.hpp
-#define TWOBLUECUBES_CATCH_EVALUATE_HPP_INCLUDED
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#endif
-
-#include <cstddef>
-
-namespace Catch {
-namespace Internal {
-
- enum Operator {
- IsEqualTo,
- IsNotEqualTo,
- IsLessThan,
- IsGreaterThan,
- IsLessThanOrEqualTo,
- IsGreaterThanOrEqualTo
- };
-
- template<Operator Op> struct OperatorTraits { static const char* getName(){ return "*error*"; } };
- template<> struct OperatorTraits<IsEqualTo> { static const char* getName(){ return "=="; } };
- template<> struct OperatorTraits<IsNotEqualTo> { static const char* getName(){ return "!="; } };
- template<> struct OperatorTraits<IsLessThan> { static const char* getName(){ return "<"; } };
- template<> struct OperatorTraits<IsGreaterThan> { static const char* getName(){ return ">"; } };
- template<> struct OperatorTraits<IsLessThanOrEqualTo> { static const char* getName(){ return "<="; } };
- template<> struct OperatorTraits<IsGreaterThanOrEqualTo>{ static const char* getName(){ return ">="; } };
-
- template<typename T>
- inline T& opCast(T const& t) { return const_cast<T&>(t); }
-
-// nullptr_t support based on pull request #154 from Konstantin Baumann
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
- inline std::nullptr_t opCast(std::nullptr_t) { return nullptr; }
-#endif // CATCH_CONFIG_CPP11_NULLPTR
-
- // So the compare overloads can be operator agnostic we convey the operator as a template
- // enum, which is used to specialise an Evaluator for doing the comparison.
- template<typename T1, typename T2, Operator Op>
- class Evaluator{};
-
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsEqualTo> {
- static bool evaluate( T1 const& lhs, T2 const& rhs) {
- return bool( opCast( lhs ) == opCast( rhs ) );
- }
- };
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsNotEqualTo> {
- static bool evaluate( T1 const& lhs, T2 const& rhs ) {
- return bool( opCast( lhs ) != opCast( rhs ) );
- }
- };
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsLessThan> {
- static bool evaluate( T1 const& lhs, T2 const& rhs ) {
- return bool( opCast( lhs ) < opCast( rhs ) );
- }
- };
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsGreaterThan> {
- static bool evaluate( T1 const& lhs, T2 const& rhs ) {
- return bool( opCast( lhs ) > opCast( rhs ) );
- }
- };
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsGreaterThanOrEqualTo> {
- static bool evaluate( T1 const& lhs, T2 const& rhs ) {
- return bool( opCast( lhs ) >= opCast( rhs ) );
- }
- };
- template<typename T1, typename T2>
- struct Evaluator<T1, T2, IsLessThanOrEqualTo> {
- static bool evaluate( T1 const& lhs, T2 const& rhs ) {
- return bool( opCast( lhs ) <= opCast( rhs ) );
- }
- };
-
- template<Operator Op, typename T1, typename T2>
- bool applyEvaluator( T1 const& lhs, T2 const& rhs ) {
- return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
- }
-
- // This level of indirection allows us to specialise for integer types
- // to avoid signed/ unsigned warnings
-
- // "base" overload
- template<Operator Op, typename T1, typename T2>
- bool compare( T1 const& lhs, T2 const& rhs ) {
- return Evaluator<T1, T2, Op>::evaluate( lhs, rhs );
- }
-
- // unsigned X to int
- template<Operator Op> bool compare( unsigned int lhs, int rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
- }
- template<Operator Op> bool compare( unsigned long lhs, int rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
- }
- template<Operator Op> bool compare( unsigned char lhs, int rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned int>( rhs ) );
- }
-
- // unsigned X to long
- template<Operator Op> bool compare( unsigned int lhs, long rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
- }
- template<Operator Op> bool compare( unsigned long lhs, long rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
- }
- template<Operator Op> bool compare( unsigned char lhs, long rhs ) {
- return applyEvaluator<Op>( lhs, static_cast<unsigned long>( rhs ) );
- }
-
- // int to unsigned X
- template<Operator Op> bool compare( int lhs, unsigned int rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
- }
- template<Operator Op> bool compare( int lhs, unsigned long rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
- }
- template<Operator Op> bool compare( int lhs, unsigned char rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned int>( lhs ), rhs );
- }
-
- // long to unsigned X
- template<Operator Op> bool compare( long lhs, unsigned int rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( long lhs, unsigned long rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( long lhs, unsigned char rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
-
- // pointer to long (when comparing against NULL)
- template<Operator Op, typename T> bool compare( long lhs, T* rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
- }
- template<Operator Op, typename T> bool compare( T* lhs, long rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
- }
-
- // pointer to int (when comparing against NULL)
- template<Operator Op, typename T> bool compare( int lhs, T* rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
- }
- template<Operator Op, typename T> bool compare( T* lhs, int rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
- }
-
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
- // long long to unsigned X
- template<Operator Op> bool compare( long long lhs, unsigned int rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( long long lhs, unsigned long rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( long long lhs, unsigned long long rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( long long lhs, unsigned char rhs ) {
- return applyEvaluator<Op>( static_cast<unsigned long>( lhs ), rhs );
- }
-
- // unsigned long long to X
- template<Operator Op> bool compare( unsigned long long lhs, int rhs ) {
- return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( unsigned long long lhs, long rhs ) {
- return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( unsigned long long lhs, long long rhs ) {
- return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
- }
- template<Operator Op> bool compare( unsigned long long lhs, char rhs ) {
- return applyEvaluator<Op>( static_cast<long>( lhs ), rhs );
- }
-
- // pointer to long long (when comparing against NULL)
- template<Operator Op, typename T> bool compare( long long lhs, T* rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
- }
- template<Operator Op, typename T> bool compare( T* lhs, long long rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
- }
-#endif // CATCH_CONFIG_CPP11_LONG_LONG
-
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
- // pointer to nullptr_t (when comparing against nullptr)
- template<Operator Op, typename T> bool compare( std::nullptr_t, T* rhs ) {
- return Evaluator<T*, T*, Op>::evaluate( nullptr, rhs );
- }
- template<Operator Op, typename T> bool compare( T* lhs, std::nullptr_t ) {
- return Evaluator<T*, T*, Op>::evaluate( lhs, nullptr );
- }
-#endif // CATCH_CONFIG_CPP11_NULLPTR
-
-} // end of namespace Internal
-} // end of namespace Catch
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-// #included from: catch_tostring.h
-#define TWOBLUECUBES_CATCH_TOSTRING_H_INCLUDED
-
-#include <sstream>
-#include <iomanip>
-#include <limits>
-#include <vector>
-#include <cstddef>
-
-#ifdef __OBJC__
-// #included from: catch_objc_arc.hpp
-#define TWOBLUECUBES_CATCH_OBJC_ARC_HPP_INCLUDED
-
-#import <Foundation/Foundation.h>
-
-#ifdef __has_feature
-#define CATCH_ARC_ENABLED __has_feature(objc_arc)
-#else
-#define CATCH_ARC_ENABLED 0
-#endif
-
-void arcSafeRelease( NSObject* obj );
-id performOptionalSelector( id obj, SEL sel );
-
-#if !CATCH_ARC_ENABLED
-inline void arcSafeRelease( NSObject* obj ) {
- [obj release];
-}
-inline id performOptionalSelector( id obj, SEL sel ) {
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED
-#define CATCH_ARC_STRONG
-#else
-inline void arcSafeRelease( NSObject* ){}
-inline id performOptionalSelector( id obj, SEL sel ) {
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-#endif
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
-#define CATCH_ARC_STRONG __strong
-#endif
-
-#endif
-
-#ifdef CATCH_CONFIG_CPP11_TUPLE
-#include <tuple>
-#endif
-
-#ifdef CATCH_CONFIG_CPP11_IS_ENUM
-#include <type_traits>
-#endif
-
-namespace Catch {
-
-// Why we're here.
-template<typename T>
-std::string toString( T const& value );
-
-// Built in overloads
-
-std::string toString( std::string const& value );
-std::string toString( std::wstring const& value );
-std::string toString( const char* const value );
-std::string toString( char* const value );
-std::string toString( const wchar_t* const value );
-std::string toString( wchar_t* const value );
-std::string toString( int value );
-std::string toString( unsigned long value );
-std::string toString( unsigned int value );
-std::string toString( const double value );
-std::string toString( const float value );
-std::string toString( bool value );
-std::string toString( char value );
-std::string toString( signed char value );
-std::string toString( unsigned char value );
-
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
-std::string toString( long long value );
-std::string toString( unsigned long long value );
-#endif
-
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-std::string toString( std::nullptr_t );
-#endif
-
-#ifdef __OBJC__
- std::string toString( NSString const * const& nsstring );
- std::string toString( NSString * CATCH_ARC_STRONG const& nsstring );
- std::string toString( NSObject* const& nsObject );
-#endif
-
-namespace Detail {
-
- extern const std::string unprintableString;
-
- struct BorgType {
- template<typename T> BorgType( T const& );
- };
-
- struct TrueType { char sizer[1]; };
- struct FalseType { char sizer[2]; };
-
- TrueType& testStreamable( std::ostream& );
- FalseType testStreamable( FalseType );
-
- FalseType operator<<( std::ostream const&, BorgType const& );
-
- template<typename T>
- struct IsStreamInsertable {
- static std::ostream &s;
- static T const&t;
- enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) };
- };
-
-#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
- template<typename T,
- bool IsEnum = std::is_enum<T>::value
- >
- struct EnumStringMaker
- {
- static std::string convert( T const& ) { return unprintableString; }
- };
-
- template<typename T>
- struct EnumStringMaker<T,true>
- {
- static std::string convert( T const& v )
- {
- return ::Catch::toString(
- static_cast<typename std::underlying_type<T>::type>(v)
- );
- }
- };
-#endif
- template<bool C>
- struct StringMakerBase {
-#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
- template<typename T>
- static std::string convert( T const& v )
- {
- return EnumStringMaker<T>::convert( v );
- }
-#else
- template<typename T>
- static std::string convert( T const& ) { return unprintableString; }
-#endif
- };
-
- template<>
- struct StringMakerBase<true> {
- template<typename T>
- static std::string convert( T const& _value ) {
- std::ostringstream oss;
- oss << _value;
- return oss.str();
- }
- };
-
- std::string rawMemoryToString( const void *object, std::size_t size );
-
- template<typename T>
- inline std::string rawMemoryToString( const T& object ) {
- return rawMemoryToString( &object, sizeof(object) );
- }
-
-} // end namespace Detail
-
-template<typename T>
-struct StringMaker :
- Detail::StringMakerBase<Detail::IsStreamInsertable<T>::value> {};
-
-template<typename T>
-struct StringMaker<T*> {
- template<typename U>
- static std::string convert( U* p ) {
- if( !p )
- return "NULL";
- else
- return Detail::rawMemoryToString( p );
- }
-};
-
-template<typename R, typename C>
-struct StringMaker<R C::*> {
- static std::string convert( R C::* p ) {
- if( !p )
- return "NULL";
- else
- return Detail::rawMemoryToString( p );
- }
-};
-
-namespace Detail {
- template<typename InputIterator>
- std::string rangeToString( InputIterator first, InputIterator last );
-}
-
-//template<typename T, typename Allocator>
-//struct StringMaker<std::vector<T, Allocator> > {
-// static std::string convert( std::vector<T,Allocator> const& v ) {
-// return Detail::rangeToString( v.begin(), v.end() );
-// }
-//};
-
-template<typename T, typename Allocator>
-std::string toString( std::vector<T,Allocator> const& v ) {
- return Detail::rangeToString( v.begin(), v.end() );
-}
-
-#ifdef CATCH_CONFIG_CPP11_TUPLE
-
-// toString for tuples
-namespace TupleDetail {
- template<
- typename Tuple,
- std::size_t N = 0,
- bool = (N < std::tuple_size<Tuple>::value)
- >
- struct ElementPrinter {
- static void print( const Tuple& tuple, std::ostream& os )
- {
- os << ( N ? ", " : " " )
- << Catch::toString(std::get<N>(tuple));
- ElementPrinter<Tuple,N+1>::print(tuple,os);
- }
- };
-
- template<
- typename Tuple,
- std::size_t N
- >
- struct ElementPrinter<Tuple,N,false> {
- static void print( const Tuple&, std::ostream& ) {}
- };
-
-}
-
-template<typename ...Types>
-struct StringMaker<std::tuple<Types...>> {
-
- static std::string convert( const std::tuple<Types...>& tuple )
- {
- std::ostringstream os;
- os << '{';
- TupleDetail::ElementPrinter<std::tuple<Types...>>::print( tuple, os );
- os << " }";
- return os.str();
- }
-};
-#endif // CATCH_CONFIG_CPP11_TUPLE
-
-namespace Detail {
- template<typename T>
- std::string makeString( T const& value ) {
- return StringMaker<T>::convert( value );
- }
-} // end namespace Detail
-
-/// \brief converts any type to a string
-///
-/// The default template forwards on to ostringstream - except when an
-/// ostringstream overload does not exist - in which case it attempts to detect
-/// that and writes {?}.
-/// Overload (not specialise) this template for custom typs that you don't want
-/// to provide an ostream overload for.
-template<typename T>
-std::string toString( T const& value ) {
- return StringMaker<T>::convert( value );
-}
-
- namespace Detail {
- template<typename InputIterator>
- std::string rangeToString( InputIterator first, InputIterator last ) {
- std::ostringstream oss;
- oss << "{ ";
- if( first != last ) {
- oss << Catch::toString( *first );
- for( ++first ; first != last ; ++first )
- oss << ", " << Catch::toString( *first );
- }
- oss << " }";
- return oss.str();
- }
-}
-
-} // end namespace Catch
-
-namespace Catch {
-
-// Wraps the LHS of an expression and captures the operator and RHS (if any) -
-// wrapping them all in a ResultBuilder object
-template<typename T>
-class ExpressionLhs {
- ExpressionLhs& operator = ( ExpressionLhs const& );
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- ExpressionLhs& operator = ( ExpressionLhs && ) = delete;
-# endif
-
-public:
- ExpressionLhs( ResultBuilder& rb, T lhs ) : m_rb( rb ), m_lhs( lhs ) {}
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- ExpressionLhs( ExpressionLhs const& ) = default;
- ExpressionLhs( ExpressionLhs && ) = default;
-# endif
-
- template<typename RhsT>
- ResultBuilder& operator == ( RhsT const& rhs ) {
- return captureExpression<Internal::IsEqualTo>( rhs );
- }
-
- template<typename RhsT>
- ResultBuilder& operator != ( RhsT const& rhs ) {
- return captureExpression<Internal::IsNotEqualTo>( rhs );
- }
-
- template<typename RhsT>
- ResultBuilder& operator < ( RhsT const& rhs ) {
- return captureExpression<Internal::IsLessThan>( rhs );
- }
-
- template<typename RhsT>
- ResultBuilder& operator > ( RhsT const& rhs ) {
- return captureExpression<Internal::IsGreaterThan>( rhs );
- }
-
- template<typename RhsT>
- ResultBuilder& operator <= ( RhsT const& rhs ) {
- return captureExpression<Internal::IsLessThanOrEqualTo>( rhs );
- }
-
- template<typename RhsT>
- ResultBuilder& operator >= ( RhsT const& rhs ) {
- return captureExpression<Internal::IsGreaterThanOrEqualTo>( rhs );
- }
-
- ResultBuilder& operator == ( bool rhs ) {
- return captureExpression<Internal::IsEqualTo>( rhs );
- }
-
- ResultBuilder& operator != ( bool rhs ) {
- return captureExpression<Internal::IsNotEqualTo>( rhs );
- }
-
- void endExpression() {
- bool value = m_lhs ? true : false;
- m_rb
- .setLhs( Catch::toString( value ) )
- .setResultType( value )
- .endExpression();
- }
-
- // Only simple binary expressions are allowed on the LHS.
- // If more complex compositions are required then place the sub expression in parentheses
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator + ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator - ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator / ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator * ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator && ( RhsT const& );
- template<typename RhsT> STATIC_ASSERT_Expression_Too_Complex_Please_Rewrite_As_Binary_Comparison& operator || ( RhsT const& );
-
-private:
- template<Internal::Operator Op, typename RhsT>
- ResultBuilder& captureExpression( RhsT const& rhs ) {
- return m_rb
- .setResultType( Internal::compare<Op>( m_lhs, rhs ) )
- .setLhs( Catch::toString( m_lhs ) )
- .setRhs( Catch::toString( rhs ) )
- .setOp( Internal::OperatorTraits<Op>::getName() );
- }
-
-private:
- ResultBuilder& m_rb;
- T m_lhs;
-};
-
-} // end namespace Catch
-
-
-namespace Catch {
-
- template<typename T>
- inline ExpressionLhs<T const&> ResultBuilder::operator <= ( T const& operand ) {
- return ExpressionLhs<T const&>( *this, operand );
- }
-
- inline ExpressionLhs<bool> ResultBuilder::operator <= ( bool value ) {
- return ExpressionLhs<bool>( *this, value );
- }
-
-} // namespace Catch
-
-// #included from: catch_message.h
-#define TWOBLUECUBES_CATCH_MESSAGE_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- struct MessageInfo {
- MessageInfo( std::string const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type );
-
- std::string macroName;
- SourceLineInfo lineInfo;
- ResultWas::OfType type;
- std::string message;
- unsigned int sequence;
-
- bool operator == ( MessageInfo const& other ) const {
- return sequence == other.sequence;
- }
- bool operator < ( MessageInfo const& other ) const {
- return sequence < other.sequence;
- }
- private:
- static unsigned int globalCount;
- };
-
- struct MessageBuilder {
- MessageBuilder( std::string const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type )
- : m_info( macroName, lineInfo, type )
- {}
-
- template<typename T>
- MessageBuilder& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- MessageInfo m_info;
- std::ostringstream m_stream;
- };
-
- class ScopedMessage {
- public:
- ScopedMessage( MessageBuilder const& builder );
- ScopedMessage( ScopedMessage const& other );
- ~ScopedMessage();
-
- MessageInfo m_info;
- };
-
-} // end namespace Catch
-
-// #included from: catch_interfaces_capture.h
-#define TWOBLUECUBES_CATCH_INTERFACES_CAPTURE_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- class TestCase;
- class AssertionResult;
- struct AssertionInfo;
- struct SectionInfo;
- struct SectionEndInfo;
- struct MessageInfo;
- class ScopedMessageBuilder;
- struct Counts;
-
- struct IResultCapture {
-
- virtual ~IResultCapture();
-
- virtual void assertionEnded( AssertionResult const& result ) = 0;
- virtual bool sectionStarted( SectionInfo const& sectionInfo,
- Counts& assertions ) = 0;
- virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
- virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
- virtual void pushScopedMessage( MessageInfo const& message ) = 0;
- virtual void popScopedMessage( MessageInfo const& message ) = 0;
-
- virtual std::string getCurrentTestName() const = 0;
- virtual const AssertionResult* getLastResult() const = 0;
-
- virtual void handleFatalErrorCondition( std::string const& message ) = 0;
- };
-
- IResultCapture& getResultCapture();
-}
-
-// #included from: catch_debugger.h
-#define TWOBLUECUBES_CATCH_DEBUGGER_H_INCLUDED
-
-// #included from: catch_platform.h
-#define TWOBLUECUBES_CATCH_PLATFORM_H_INCLUDED
-
-#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED)
-#define CATCH_PLATFORM_MAC
-#elif defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
-#define CATCH_PLATFORM_IPHONE
-#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER)
-#define CATCH_PLATFORM_WINDOWS
-#endif
-
-#include <string>
-
-namespace Catch{
-
- bool isDebuggerActive();
- void writeToDebugConsole( std::string const& text );
-}
-
-#ifdef CATCH_PLATFORM_MAC
-
- // The following code snippet based on:
- // http://cocoawithlove.com/2008/03/break-into-debugger.html
- #ifdef DEBUG
- #if defined(__ppc64__) || defined(__ppc__)
- #define CATCH_BREAK_INTO_DEBUGGER() \
- if( Catch::isDebuggerActive() ) { \
- __asm__("li r0, 20\nsc\nnop\nli r0, 37\nli r4, 2\nsc\nnop\n" \
- : : : "memory","r0","r3","r4" ); \
- }
- #else
- #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) {__asm__("int $3\n" : : );}
- #endif
- #endif
-
-#elif defined(_MSC_VER)
- #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { __debugbreak(); }
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) void __stdcall DebugBreak();
- #define CATCH_BREAK_INTO_DEBUGGER() if( Catch::isDebuggerActive() ) { DebugBreak(); }
-#endif
-
-#ifndef CATCH_BREAK_INTO_DEBUGGER
-#define CATCH_BREAK_INTO_DEBUGGER() Catch::alwaysTrue();
-#endif
-
-// #included from: catch_interfaces_runner.h
-#define TWOBLUECUBES_CATCH_INTERFACES_RUNNER_H_INCLUDED
-
-namespace Catch {
- class TestCase;
-
- struct IRunner {
- virtual ~IRunner();
- virtual bool aborting() const = 0;
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-// In the event of a failure works out if the debugger needs to be invoked
-// and/or an exception thrown and takes appropriate action.
-// This needs to be done as a macro so the debugger will stop in the user
-// source code rather than in Catch library code
-#define INTERNAL_CATCH_REACT( resultBuilder ) \
- if( resultBuilder.shouldDebugBreak() ) CATCH_BREAK_INTO_DEBUGGER(); \
- resultBuilder.react();
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
- try { \
- CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- ( __catchResult <= expr ).endExpression(); \
- } \
- catch( ... ) { \
- __catchResult.useActiveException( Catch::ResultDisposition::Normal ); \
- } \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::isTrue( false && static_cast<bool>(expr) ) ) // expr here is never evaluated at runtime but it forces the compiler to give it a look
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( expr, resultDisposition, macroName ) \
- INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
- if( Catch::getResultCapture().getLastResult()->succeeded() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( expr, resultDisposition, macroName ) \
- INTERNAL_CATCH_TEST( expr, resultDisposition, macroName ); \
- if( !Catch::getResultCapture().getLastResult()->succeeded() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( expr, resultDisposition, macroName ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
- try { \
- expr; \
- __catchResult.captureResult( Catch::ResultWas::Ok ); \
- } \
- catch( ... ) { \
- __catchResult.useActiveException( resultDisposition ); \
- } \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( expr, resultDisposition, matcher, macroName ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition, #matcher ); \
- if( __catchResult.allowThrows() ) \
- try { \
- expr; \
- __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
- } \
- catch( ... ) { \
- __catchResult.captureExpectedException( matcher ); \
- } \
- else \
- __catchResult.captureResult( Catch::ResultWas::Ok ); \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_AS( expr, exceptionType, resultDisposition, macroName ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr, resultDisposition ); \
- if( __catchResult.allowThrows() ) \
- try { \
- expr; \
- __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
- } \
- catch( exceptionType ) { \
- __catchResult.captureResult( Catch::ResultWas::Ok ); \
- } \
- catch( ... ) { \
- __catchResult.useActiveException( resultDisposition ); \
- } \
- else \
- __catchResult.captureResult( Catch::ResultWas::Ok ); \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-
-///////////////////////////////////////////////////////////////////////////////
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
- #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, ... ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
- __catchResult << __VA_ARGS__ + ::Catch::StreamEndStop(); \
- __catchResult.captureResult( messageType ); \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-#else
- #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, "", resultDisposition ); \
- __catchResult << log + ::Catch::StreamEndStop(); \
- __catchResult.captureResult( messageType ); \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-#endif
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_INFO( log, macroName ) \
- Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage ) = Catch::MessageBuilder( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log;
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( arg, matcher, resultDisposition, macroName ) \
- do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #arg ", " #matcher, resultDisposition ); \
- try { \
- std::string matcherAsString = (matcher).toString(); \
- __catchResult \
- .setLhs( Catch::toString( arg ) ) \
- .setRhs( matcherAsString == Catch::Detail::unprintableString ? #matcher : matcherAsString ) \
- .setOp( "matches" ) \
- .setResultType( (matcher).match( arg ) ); \
- __catchResult.captureExpression(); \
- } catch( ... ) { \
- __catchResult.useActiveException( resultDisposition | Catch::ResultDisposition::ContinueOnFailure ); \
- } \
- INTERNAL_CATCH_REACT( __catchResult ) \
- } while( Catch::alwaysFalse() )
-
-// #included from: internal/catch_section.h
-#define TWOBLUECUBES_CATCH_SECTION_H_INCLUDED
-
-// #included from: catch_section_info.h
-#define TWOBLUECUBES_CATCH_SECTION_INFO_H_INCLUDED
-
-// #included from: catch_totals.hpp
-#define TWOBLUECUBES_CATCH_TOTALS_HPP_INCLUDED
-
-#include <cstddef>
-
-namespace Catch {
-
- struct Counts {
- Counts() : passed( 0 ), failed( 0 ), failedButOk( 0 ) {}
-
- Counts operator - ( Counts const& other ) const {
- Counts diff;
- diff.passed = passed - other.passed;
- diff.failed = failed - other.failed;
- diff.failedButOk = failedButOk - other.failedButOk;
- return diff;
- }
- Counts& operator += ( Counts const& other ) {
- passed += other.passed;
- failed += other.failed;
- failedButOk += other.failedButOk;
- return *this;
- }
-
- std::size_t total() const {
- return passed + failed + failedButOk;
- }
- bool allPassed() const {
- return failed == 0 && failedButOk == 0;
- }
- bool allOk() const {
- return failed == 0;
- }
-
- std::size_t passed;
- std::size_t failed;
- std::size_t failedButOk;
- };
-
- struct Totals {
-
- Totals operator - ( Totals const& other ) const {
- Totals diff;
- diff.assertions = assertions - other.assertions;
- diff.testCases = testCases - other.testCases;
- return diff;
- }
-
- Totals delta( Totals const& prevTotals ) const {
- Totals diff = *this - prevTotals;
- if( diff.assertions.failed > 0 )
- ++diff.testCases.failed;
- else if( diff.assertions.failedButOk > 0 )
- ++diff.testCases.failedButOk;
- else
- ++diff.testCases.passed;
- return diff;
- }
-
- Totals& operator += ( Totals const& other ) {
- assertions += other.assertions;
- testCases += other.testCases;
- return *this;
- }
-
- Counts assertions;
- Counts testCases;
- };
-}
-
-namespace Catch {
-
- struct SectionInfo {
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name,
- std::string const& _description = std::string() );
-
- std::string name;
- std::string description;
- SourceLineInfo lineInfo;
- };
-
- struct SectionEndInfo {
- SectionEndInfo( SectionInfo const& _sectionInfo, Counts const& _prevAssertions, double _durationInSeconds )
- : sectionInfo( _sectionInfo ), prevAssertions( _prevAssertions ), durationInSeconds( _durationInSeconds )
- {}
-
- SectionInfo sectionInfo;
- Counts prevAssertions;
- double durationInSeconds;
- };
-
-} // end namespace Catch
-
-// #included from: catch_timer.h
-#define TWOBLUECUBES_CATCH_TIMER_H_INCLUDED
-
-#ifdef CATCH_PLATFORM_WINDOWS
-typedef unsigned long long uint64_t;
-#else
-#include <stdint.h>
-#endif
-
-namespace Catch {
-
- class Timer {
- public:
- Timer() : m_ticks( 0 ) {}
- void start();
- unsigned int getElapsedMicroseconds() const;
- unsigned int getElapsedMilliseconds() const;
- double getElapsedSeconds() const;
-
- private:
- uint64_t m_ticks;
- };
-
-} // namespace Catch
-
-#include <string>
-
-namespace Catch {
-
- class Section : NonCopyable {
- public:
- Section( SectionInfo const& info );
- ~Section();
-
- // This indicates whether the section should be executed or not
- operator bool() const;
-
- private:
- SectionInfo m_info;
-
- std::string m_name;
- Counts m_assertions;
- bool m_sectionIncluded;
- Timer m_timer;
- };
-
-} // end namespace Catch
-
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
- #define INTERNAL_CATCH_SECTION( ... ) \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) )
-#else
- #define INTERNAL_CATCH_SECTION( name, desc ) \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, name, desc ) )
-#endif
-
-// #included from: internal/catch_generators.hpp
-#define TWOBLUECUBES_CATCH_GENERATORS_HPP_INCLUDED
-
-#include <iterator>
-#include <vector>
-#include <string>
-#include <stdlib.h>
-
-namespace Catch {
-
-template<typename T>
-struct IGenerator {
- virtual ~IGenerator() {}
- virtual T getValue( std::size_t index ) const = 0;
- virtual std::size_t size () const = 0;
-};
-
-template<typename T>
-class BetweenGenerator : public IGenerator<T> {
-public:
- BetweenGenerator( T from, T to ) : m_from( from ), m_to( to ){}
-
- virtual T getValue( std::size_t index ) const {
- return m_from+static_cast<int>( index );
- }
-
- virtual std::size_t size() const {
- return static_cast<std::size_t>( 1+m_to-m_from );
- }
-
-private:
-
- T m_from;
- T m_to;
-};
-
-template<typename T>
-class ValuesGenerator : public IGenerator<T> {
-public:
- ValuesGenerator(){}
-
- void add( T value ) {
- m_values.push_back( value );
- }
-
- virtual T getValue( std::size_t index ) const {
- return m_values[index];
- }
-
- virtual std::size_t size() const {
- return m_values.size();
- }
-
-private:
- std::vector<T> m_values;
-};
-
-template<typename T>
-class CompositeGenerator {
-public:
- CompositeGenerator() : m_totalSize( 0 ) {}
-
- // *** Move semantics, similar to auto_ptr ***
- CompositeGenerator( CompositeGenerator& other )
- : m_fileInfo( other.m_fileInfo ),
- m_totalSize( 0 )
- {
- move( other );
- }
-
- CompositeGenerator& setFileInfo( const char* fileInfo ) {
- m_fileInfo = fileInfo;
- return *this;
- }
-
- ~CompositeGenerator() {
- deleteAll( m_composed );
- }
-
- operator T () const {
- size_t overallIndex = getCurrentContext().getGeneratorIndex( m_fileInfo, m_totalSize );
-
- typename std::vector<const IGenerator<T>*>::const_iterator it = m_composed.begin();
- typename std::vector<const IGenerator<T>*>::const_iterator itEnd = m_composed.end();
- for( size_t index = 0; it != itEnd; ++it )
- {
- const IGenerator<T>* generator = *it;
- if( overallIndex >= index && overallIndex < index + generator->size() )
- {
- return generator->getValue( overallIndex-index );
- }
- index += generator->size();
- }
- CATCH_INTERNAL_ERROR( "Indexed past end of generated range" );
- return T(); // Suppress spurious "not all control paths return a value" warning in Visual Studio - if you know how to fix this please do so
- }
-
- void add( const IGenerator<T>* generator ) {
- m_totalSize += generator->size();
- m_composed.push_back( generator );
- }
-
- CompositeGenerator& then( CompositeGenerator& other ) {
- move( other );
- return *this;
- }
-
- CompositeGenerator& then( T value ) {
- ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
- valuesGen->add( value );
- add( valuesGen );
- return *this;
- }
-
-private:
-
- void move( CompositeGenerator& other ) {
- std::copy( other.m_composed.begin(), other.m_composed.end(), std::back_inserter( m_composed ) );
- m_totalSize += other.m_totalSize;
- other.m_composed.clear();
- }
-
- std::vector<const IGenerator<T>*> m_composed;
- std::string m_fileInfo;
- size_t m_totalSize;
-};
-
-namespace Generators
-{
- template<typename T>
- CompositeGenerator<T> between( T from, T to ) {
- CompositeGenerator<T> generators;
- generators.add( new BetweenGenerator<T>( from, to ) );
- return generators;
- }
-
- template<typename T>
- CompositeGenerator<T> values( T val1, T val2 ) {
- CompositeGenerator<T> generators;
- ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
- valuesGen->add( val1 );
- valuesGen->add( val2 );
- generators.add( valuesGen );
- return generators;
- }
-
- template<typename T>
- CompositeGenerator<T> values( T val1, T val2, T val3 ){
- CompositeGenerator<T> generators;
- ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
- valuesGen->add( val1 );
- valuesGen->add( val2 );
- valuesGen->add( val3 );
- generators.add( valuesGen );
- return generators;
- }
-
- template<typename T>
- CompositeGenerator<T> values( T val1, T val2, T val3, T val4 ) {
- CompositeGenerator<T> generators;
- ValuesGenerator<T>* valuesGen = new ValuesGenerator<T>();
- valuesGen->add( val1 );
- valuesGen->add( val2 );
- valuesGen->add( val3 );
- valuesGen->add( val4 );
- generators.add( valuesGen );
- return generators;
- }
-
-} // end namespace Generators
-
-using namespace Generators;
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_LINESTR2( line ) #line
-#define INTERNAL_CATCH_LINESTR( line ) INTERNAL_CATCH_LINESTR2( line )
-
-#define INTERNAL_CATCH_GENERATE( expr ) expr.setFileInfo( __FILE__ "(" INTERNAL_CATCH_LINESTR( __LINE__ ) ")" )
-
-// #included from: internal/catch_interfaces_exception.h
-#define TWOBLUECUBES_CATCH_INTERFACES_EXCEPTION_H_INCLUDED
-
-#include <string>
-#include <vector>
-
-// #included from: catch_interfaces_registry_hub.h
-#define TWOBLUECUBES_CATCH_INTERFACES_REGISTRY_HUB_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- class TestCase;
- struct ITestCaseRegistry;
- struct IExceptionTranslatorRegistry;
- struct IExceptionTranslator;
- struct IReporterRegistry;
- struct IReporterFactory;
-
- struct IRegistryHub {
- virtual ~IRegistryHub();
-
- virtual IReporterRegistry const& getReporterRegistry() const = 0;
- virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
- virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() = 0;
- };
-
- struct IMutableRegistryHub {
- virtual ~IMutableRegistryHub();
- virtual void registerReporter( std::string const& name, Ptr<IReporterFactory> const& factory ) = 0;
- virtual void registerListener( Ptr<IReporterFactory> const& factory ) = 0;
- virtual void registerTest( TestCase const& testInfo ) = 0;
- virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
- };
-
- IRegistryHub& getRegistryHub();
- IMutableRegistryHub& getMutableRegistryHub();
- void cleanUp();
- std::string translateActiveException();
-
-}
-
-namespace Catch {
-
- typedef std::string(*exceptionTranslateFunction)();
-
- struct IExceptionTranslator;
- typedef std::vector<const IExceptionTranslator*> ExceptionTranslators;
-
- struct IExceptionTranslator {
- virtual ~IExceptionTranslator();
- virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
- };
-
- struct IExceptionTranslatorRegistry {
- virtual ~IExceptionTranslatorRegistry();
-
- virtual std::string translateActiveException() const = 0;
- };
-
- class ExceptionTranslatorRegistrar {
- template<typename T>
- class ExceptionTranslator : public IExceptionTranslator {
- public:
-
- ExceptionTranslator( std::string(*translateFunction)( T& ) )
- : m_translateFunction( translateFunction )
- {}
-
- virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const CATCH_OVERRIDE {
- try {
- if( it == itEnd )
- throw;
- else
- return (*it)->translate( it+1, itEnd );
- }
- catch( T& ex ) {
- return m_translateFunction( ex );
- }
- }
-
- protected:
- std::string(*m_translateFunction)( T& );
- };
-
- public:
- template<typename T>
- ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
- getMutableRegistryHub().registerTranslator
- ( new ExceptionTranslator<T>( translateFunction ) );
- }
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
- static std::string translatorName( signature ); \
- namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); }\
- static std::string translatorName( signature )
-
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// #included from: internal/catch_approx.hpp
-#define TWOBLUECUBES_CATCH_APPROX_HPP_INCLUDED
-
-#include <cmath>
-#include <limits>
-
-namespace Catch {
-namespace Detail {
-
- class Approx {
- public:
- explicit Approx ( double value )
- : m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
- m_scale( 1.0 ),
- m_value( value )
- {}
-
- Approx( Approx const& other )
- : m_epsilon( other.m_epsilon ),
- m_scale( other.m_scale ),
- m_value( other.m_value )
- {}
-
- static Approx custom() {
- return Approx( 0 );
- }
-
- Approx operator()( double value ) {
- Approx approx( value );
- approx.epsilon( m_epsilon );
- approx.scale( m_scale );
- return approx;
- }
-
- friend bool operator == ( double lhs, Approx const& rhs ) {
- // Thanks to Richard Harris for his help refining this formula
- return fabs( lhs - rhs.m_value ) < rhs.m_epsilon * (rhs.m_scale + (std::max)( fabs(lhs), fabs(rhs.m_value) ) );
- }
-
- friend bool operator == ( Approx const& lhs, double rhs ) {
- return operator==( rhs, lhs );
- }
-
- friend bool operator != ( double lhs, Approx const& rhs ) {
- return !operator==( lhs, rhs );
- }
-
- friend bool operator != ( Approx const& lhs, double rhs ) {
- return !operator==( rhs, lhs );
- }
-
- Approx& epsilon( double newEpsilon ) {
- m_epsilon = newEpsilon;
- return *this;
- }
-
- Approx& scale( double newScale ) {
- m_scale = newScale;
- return *this;
- }
-
- std::string toString() const {
- std::ostringstream oss;
- oss << "Approx( " << Catch::toString( m_value ) << " )";
- return oss.str();
- }
-
- private:
- double m_epsilon;
- double m_scale;
- double m_value;
- };
-}
-
-template<>
-inline std::string toString<Detail::Approx>( Detail::Approx const& value ) {
- return value.toString();
-}
-
-} // end namespace Catch
-
-// #included from: internal/catch_interfaces_tag_alias_registry.h
-#define TWOBLUECUBES_CATCH_INTERFACES_TAG_ALIAS_REGISTRY_H_INCLUDED
-
-// #included from: catch_tag_alias.h
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_H_INCLUDED
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias {
- TagAlias( std::string _tag, SourceLineInfo _lineInfo ) : tag( _tag ), lineInfo( _lineInfo ) {}
-
- std::string tag;
- SourceLineInfo lineInfo;
- };
-
- struct RegistrarForTagAliases {
- RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
- };
-
-} // end namespace Catch
-
-#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); }
-// #included from: catch_option.hpp
-#define TWOBLUECUBES_CATCH_OPTION_HPP_INCLUDED
-
-namespace Catch {
-
- // An optional type
- template<typename T>
- class Option {
- public:
- Option() : nullableValue( CATCH_NULL ) {}
- Option( T const& _value )
- : nullableValue( new( storage ) T( _value ) )
- {}
- Option( Option const& _other )
- : nullableValue( _other ? new( storage ) T( *_other ) : CATCH_NULL )
- {}
-
- ~Option() {
- reset();
- }
-
- Option& operator= ( Option const& _other ) {
- if( &_other != this ) {
- reset();
- if( _other )
- nullableValue = new( storage ) T( *_other );
- }
- return *this;
- }
- Option& operator = ( T const& _value ) {
- reset();
- nullableValue = new( storage ) T( _value );
- return *this;
- }
-
- void reset() {
- if( nullableValue )
- nullableValue->~T();
- nullableValue = CATCH_NULL;
- }
-
- T& operator*() { return *nullableValue; }
- T const& operator*() const { return *nullableValue; }
- T* operator->() { return nullableValue; }
- const T* operator->() const { return nullableValue; }
-
- T valueOr( T const& defaultValue ) const {
- return nullableValue ? *nullableValue : defaultValue;
- }
-
- bool some() const { return nullableValue != CATCH_NULL; }
- bool none() const { return nullableValue == CATCH_NULL; }
-
- bool operator !() const { return nullableValue == CATCH_NULL; }
- operator SafeBool::type() const {
- return SafeBool::makeSafe( some() );
- }
-
- private:
- T* nullableValue;
- char storage[sizeof(T)];
- };
-
-} // end namespace Catch
-
-namespace Catch {
-
- struct ITagAliasRegistry {
- virtual ~ITagAliasRegistry();
- virtual Option<TagAlias> find( std::string const& alias ) const = 0;
- virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
-
- static ITagAliasRegistry const& get();
- };
-
-} // end namespace Catch
-
-// These files are included here so the single_include script doesn't put them
-// in the conditionally compiled sections
-// #included from: internal/catch_test_case_info.h
-#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_H_INCLUDED
-
-#include <string>
-#include <set>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct ITestCase;
-
- struct TestCaseInfo {
- enum SpecialProperties{
- None = 0,
- IsHidden = 1 << 1,
- ShouldFail = 1 << 2,
- MayFail = 1 << 3,
- Throws = 1 << 4
- };
-
- TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::set<std::string> const& _tags,
- SourceLineInfo const& _lineInfo );
-
- TestCaseInfo( TestCaseInfo const& other );
-
- friend void setTags( TestCaseInfo& testCaseInfo, std::set<std::string> const& tags );
-
- bool isHidden() const;
- bool throws() const;
- bool okToFail() const;
- bool expectedToFail() const;
-
- std::string name;
- std::string className;
- std::string description;
- std::set<std::string> tags;
- std::set<std::string> lcaseTags;
- std::string tagsAsString;
- SourceLineInfo lineInfo;
- SpecialProperties properties;
- };
-
- class TestCase : public TestCaseInfo {
- public:
-
- TestCase( ITestCase* testCase, TestCaseInfo const& info );
- TestCase( TestCase const& other );
-
- TestCase withName( std::string const& _newName ) const;
-
- void invoke() const;
-
- TestCaseInfo const& getTestCaseInfo() const;
-
- void swap( TestCase& other );
- bool operator == ( TestCase const& other ) const;
- bool operator < ( TestCase const& other ) const;
- TestCase& operator = ( TestCase const& other );
-
- private:
- Ptr<ITestCase> test;
- };
-
- TestCase makeTestCase( ITestCase* testCase,
- std::string const& className,
- std::string const& name,
- std::string const& description,
- SourceLineInfo const& lineInfo );
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-
-#ifdef __OBJC__
-// #included from: internal/catch_objc.hpp
-#define TWOBLUECUBES_CATCH_OBJC_HPP_INCLUDED
-
-#import <objc/runtime.h>
-
-#include <string>
-
-// NB. Any general catch headers included here must be included
-// in catch.hpp first to make sure they are included by the single
-// header for non obj-usage
-
-///////////////////////////////////////////////////////////////////////////////
-// This protocol is really only here for (self) documenting purposes, since
-// all its methods are optional.
-@protocol OcFixture
-
-@optional
-
--(void) setUp;
--(void) tearDown;
-
-@end
-
-namespace Catch {
-
- class OcMethod : public SharedImpl<ITestCase> {
-
- public:
- OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
-
- virtual void invoke() const {
- id obj = [[m_cls alloc] init];
-
- performOptionalSelector( obj, @selector(setUp) );
- performOptionalSelector( obj, m_sel );
- performOptionalSelector( obj, @selector(tearDown) );
-
- arcSafeRelease( obj );
- }
- private:
- virtual ~OcMethod() {}
-
- Class m_cls;
- SEL m_sel;
- };
-
- namespace Detail{
-
- inline std::string getAnnotation( Class cls,
- std::string const& annotationName,
- std::string const& testCaseName ) {
- NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
- SEL sel = NSSelectorFromString( selStr );
- arcSafeRelease( selStr );
- id value = performOptionalSelector( cls, sel );
- if( value )
- return [(NSString*)value UTF8String];
- return "";
- }
- }
-
- inline size_t registerTestMethods() {
- size_t noTestMethods = 0;
- int noClasses = objc_getClassList( CATCH_NULL, 0 );
-
- Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
- objc_getClassList( classes, noClasses );
-
- for( int c = 0; c < noClasses; c++ ) {
- Class cls = classes[c];
- {
- u_int count;
- Method* methods = class_copyMethodList( cls, &count );
- for( u_int m = 0; m < count ; m++ ) {
- SEL selector = method_getName(methods[m]);
- std::string methodName = sel_getName(selector);
- if( startsWith( methodName, "Catch_TestCase_" ) ) {
- std::string testCaseName = methodName.substr( 15 );
- std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
- std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
- const char* className = class_getName( cls );
-
- getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, name.c_str(), desc.c_str(), SourceLineInfo() ) );
- noTestMethods++;
- }
- }
- free(methods);
- }
- }
- return noTestMethods;
- }
-
- namespace Matchers {
- namespace Impl {
- namespace NSStringMatchers {
-
- template<typename MatcherT>
- struct StringHolder : MatcherImpl<MatcherT, NSString*>{
- StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
- StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
- StringHolder() {
- arcSafeRelease( m_substr );
- }
-
- NSString* m_substr;
- };
-
- struct Equals : StringHolder<Equals> {
- Equals( NSString* substr ) : StringHolder( substr ){}
-
- virtual bool match( ExpressionType const& str ) const {
- return (str != nil || m_substr == nil ) &&
- [str isEqualToString:m_substr];
- }
-
- virtual std::string toString() const {
- return "equals string: " + Catch::toString( m_substr );
- }
- };
-
- struct Contains : StringHolder<Contains> {
- Contains( NSString* substr ) : StringHolder( substr ){}
-
- virtual bool match( ExpressionType const& str ) const {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location != NSNotFound;
- }
-
- virtual std::string toString() const {
- return "contains string: " + Catch::toString( m_substr );
- }
- };
-
- struct StartsWith : StringHolder<StartsWith> {
- StartsWith( NSString* substr ) : StringHolder( substr ){}
-
- virtual bool match( ExpressionType const& str ) const {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == 0;
- }
-
- virtual std::string toString() const {
- return "starts with: " + Catch::toString( m_substr );
- }
- };
- struct EndsWith : StringHolder<EndsWith> {
- EndsWith( NSString* substr ) : StringHolder( substr ){}
-
- virtual bool match( ExpressionType const& str ) const {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == [str length] - [m_substr length];
- }
-
- virtual std::string toString() const {
- return "ends with: " + Catch::toString( m_substr );
- }
- };
-
- } // namespace NSStringMatchers
- } // namespace Impl
-
- inline Impl::NSStringMatchers::Equals
- Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
-
- inline Impl::NSStringMatchers::Contains
- Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
-
- inline Impl::NSStringMatchers::StartsWith
- StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
-
- inline Impl::NSStringMatchers::EndsWith
- EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
-
- } // namespace Matchers
-
- using namespace Matchers;
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define OC_TEST_CASE( name, desc )\
-+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Name_test ) \
-{\
-return @ name; \
-}\
-+(NSString*) INTERNAL_CATCH_UNIQUE_NAME( Catch_Description_test ) \
-{ \
-return @ desc; \
-} \
--(void) INTERNAL_CATCH_UNIQUE_NAME( Catch_TestCase_test )
-
-#endif
-
-#ifdef CATCH_IMPL
-// #included from: internal/catch_impl.hpp
-#define TWOBLUECUBES_CATCH_IMPL_HPP_INCLUDED
-
-// Collect all the implementation files together here
-// These are the equivalent of what would usually be cpp files
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// #included from: ../catch_session.hpp
-#define TWOBLUECUBES_CATCH_RUNNER_HPP_INCLUDED
-
-// #included from: internal/catch_commandline.hpp
-#define TWOBLUECUBES_CATCH_COMMANDLINE_HPP_INCLUDED
-
-// #included from: catch_config.hpp
-#define TWOBLUECUBES_CATCH_CONFIG_HPP_INCLUDED
-
-// #included from: catch_test_spec_parser.hpp
-#define TWOBLUECUBES_CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// #included from: catch_test_spec.hpp
-#define TWOBLUECUBES_CATCH_TEST_SPEC_HPP_INCLUDED
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// #included from: catch_wildcard_pattern.hpp
-#define TWOBLUECUBES_CATCH_WILDCARD_PATTERN_HPP_INCLUDED
-
-namespace Catch
-{
- class WildcardPattern {
- enum WildcardPosition {
- NoWildcard = 0,
- WildcardAtStart = 1,
- WildcardAtEnd = 2,
- WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
- };
-
- public:
-
- WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_wildcard( NoWildcard ),
- m_pattern( adjustCase( pattern ) )
- {
- if( startsWith( m_pattern, "*" ) ) {
- m_pattern = m_pattern.substr( 1 );
- m_wildcard = WildcardAtStart;
- }
- if( endsWith( m_pattern, "*" ) ) {
- m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
- m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
- }
- }
- virtual ~WildcardPattern();
- virtual bool matches( std::string const& str ) const {
- switch( m_wildcard ) {
- case NoWildcard:
- return m_pattern == adjustCase( str );
- case WildcardAtStart:
- return endsWith( adjustCase( str ), m_pattern );
- case WildcardAtEnd:
- return startsWith( adjustCase( str ), m_pattern );
- case WildcardAtBothEnds:
- return contains( adjustCase( str ), m_pattern );
- }
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
- throw std::logic_error( "Unknown enum" );
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
- }
- private:
- std::string adjustCase( std::string const& str ) const {
- return m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str;
- }
- CaseSensitive::Choice m_caseSensitivity;
- WildcardPosition m_wildcard;
- std::string m_pattern;
- };
-}
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-
- class TestSpec {
- struct Pattern : SharedImpl<> {
- virtual ~Pattern();
- virtual bool matches( TestCaseInfo const& testCase ) const = 0;
- };
- class NamePattern : public Pattern {
- public:
- NamePattern( std::string const& name )
- : m_wildcardPattern( toLower( name ), CaseSensitive::No )
- {}
- virtual ~NamePattern();
- virtual bool matches( TestCaseInfo const& testCase ) const {
- return m_wildcardPattern.matches( toLower( testCase.name ) );
- }
- private:
- WildcardPattern m_wildcardPattern;
- };
-
- class TagPattern : public Pattern {
- public:
- TagPattern( std::string const& tag ) : m_tag( toLower( tag ) ) {}
- virtual ~TagPattern();
- virtual bool matches( TestCaseInfo const& testCase ) const {
- return testCase.lcaseTags.find( m_tag ) != testCase.lcaseTags.end();
- }
- private:
- std::string m_tag;
- };
-
- class ExcludedPattern : public Pattern {
- public:
- ExcludedPattern( Ptr<Pattern> const& underlyingPattern ) : m_underlyingPattern( underlyingPattern ) {}
- virtual ~ExcludedPattern();
- virtual bool matches( TestCaseInfo const& testCase ) const { return !m_underlyingPattern->matches( testCase ); }
- private:
- Ptr<Pattern> m_underlyingPattern;
- };
-
- struct Filter {
- std::vector<Ptr<Pattern> > m_patterns;
-
- bool matches( TestCaseInfo const& testCase ) const {
- // All patterns in a filter must match for the filter to be a match
- for( std::vector<Ptr<Pattern> >::const_iterator it = m_patterns.begin(), itEnd = m_patterns.end(); it != itEnd; ++it )
- if( !(*it)->matches( testCase ) )
- return false;
- return true;
- }
- };
-
- public:
- bool hasFilters() const {
- return !m_filters.empty();
- }
- bool matches( TestCaseInfo const& testCase ) const {
- // A TestSpec matches if any filter matches
- for( std::vector<Filter>::const_iterator it = m_filters.begin(), itEnd = m_filters.end(); it != itEnd; ++it )
- if( it->matches( testCase ) )
- return true;
- return false;
- }
-
- private:
- std::vector<Filter> m_filters;
-
- friend class TestSpecParser;
- };
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-namespace Catch {
-
- class TestSpecParser {
- enum Mode{ None, Name, QuotedName, Tag };
- Mode m_mode;
- bool m_exclusion;
- std::size_t m_start, m_pos;
- std::string m_arg;
- TestSpec::Filter m_currentFilter;
- TestSpec m_testSpec;
- ITagAliasRegistry const* m_tagAliases;
-
- public:
- TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
-
- TestSpecParser& parse( std::string const& arg ) {
- m_mode = None;
- m_exclusion = false;
- m_start = std::string::npos;
- m_arg = m_tagAliases->expandAliases( arg );
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- visitChar( m_arg[m_pos] );
- if( m_mode == Name )
- addPattern<TestSpec::NamePattern>();
- return *this;
- }
- TestSpec testSpec() {
- addFilter();
- return m_testSpec;
- }
- private:
- void visitChar( char c ) {
- if( m_mode == None ) {
- switch( c ) {
- case ' ': return;
- case '~': m_exclusion = true; return;
- case '[': return startNewMode( Tag, ++m_pos );
- case '"': return startNewMode( QuotedName, ++m_pos );
- default: startNewMode( Name, m_pos ); break;
- }
- }
- if( m_mode == Name ) {
- if( c == ',' ) {
- addPattern<TestSpec::NamePattern>();
- addFilter();
- }
- else if( c == '[' ) {
- if( subString() == "exclude:" )
- m_exclusion = true;
- else
- addPattern<TestSpec::NamePattern>();
- startNewMode( Tag, ++m_pos );
- }
- }
- else if( m_mode == QuotedName && c == '"' )
- addPattern<TestSpec::NamePattern>();
- else if( m_mode == Tag && c == ']' )
- addPattern<TestSpec::TagPattern>();
- }
- void startNewMode( Mode mode, std::size_t start ) {
- m_mode = mode;
- m_start = start;
- }
- std::string subString() const { return m_arg.substr( m_start, m_pos - m_start ); }
- template<typename T>
- void addPattern() {
- std::string token = subString();
- if( startsWith( token, "exclude:" ) ) {
- m_exclusion = true;
- token = token.substr( 8 );
- }
- if( !token.empty() ) {
- Ptr<TestSpec::Pattern> pattern = new T( token );
- if( m_exclusion )
- pattern = new TestSpec::ExcludedPattern( pattern );
- m_currentFilter.m_patterns.push_back( pattern );
- }
- m_exclusion = false;
- m_mode = None;
- }
- void addFilter() {
- if( !m_currentFilter.m_patterns.empty() ) {
- m_testSpec.m_filters.push_back( m_currentFilter );
- m_currentFilter = TestSpec::Filter();
- }
- }
- };
- inline TestSpec parseTestSpec( std::string const& arg ) {
- return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec();
- }
-
-} // namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// #included from: catch_interfaces_config.h
-#define TWOBLUECUBES_CATCH_INTERFACES_CONFIG_H_INCLUDED
-
-#include <iostream>
-#include <string>
-#include <vector>
-
-namespace Catch {
-
- struct Verbosity { enum Level {
- NoOutput = 0,
- Quiet,
- Normal
- }; };
-
- struct WarnAbout { enum What {
- Nothing = 0x00,
- NoAssertions = 0x01
- }; };
-
- struct ShowDurations { enum OrNot {
- DefaultForReporter,
- Always,
- Never
- }; };
- struct RunTests { enum InWhatOrder {
- InDeclarationOrder,
- InLexicographicalOrder,
- InRandomOrder
- }; };
- struct UseColour { enum YesOrNo {
- Auto,
- Yes,
- No
- }; };
-
- class TestSpec;
-
- struct IConfig : IShared {
-
- virtual ~IConfig();
-
- virtual bool allowThrows() const = 0;
- virtual std::ostream& stream() const = 0;
- virtual std::string name() const = 0;
- virtual bool includeSuccessfulResults() const = 0;
- virtual bool shouldDebugBreak() const = 0;
- virtual bool warnAboutMissingAssertions() const = 0;
- virtual int abortAfter() const = 0;
- virtual bool showInvisibles() const = 0;
- virtual ShowDurations::OrNot showDurations() const = 0;
- virtual TestSpec const& testSpec() const = 0;
- virtual RunTests::InWhatOrder runOrder() const = 0;
- virtual unsigned int rngSeed() const = 0;
- virtual UseColour::YesOrNo useColour() const = 0;
- };
-}
-
-// #included from: catch_stream.h
-#define TWOBLUECUBES_CATCH_STREAM_H_INCLUDED
-
-// #included from: catch_streambuf.h
-#define TWOBLUECUBES_CATCH_STREAMBUF_H_INCLUDED
-
-#include <streambuf>
-
-namespace Catch {
-
- class StreamBufBase : public std::streambuf {
- public:
- virtual ~StreamBufBase() CATCH_NOEXCEPT;
- };
-}
-
-#include <streambuf>
-#include <ostream>
-#include <fstream>
-
-namespace Catch {
-
- std::ostream& cout();
- std::ostream& cerr();
-
- struct IStream {
- virtual ~IStream() CATCH_NOEXCEPT;
- virtual std::ostream& stream() const = 0;
- };
-
- class FileStream : public IStream {
- mutable std::ofstream m_ofs;
- public:
- FileStream( std::string const& filename );
- virtual ~FileStream() CATCH_NOEXCEPT;
- public: // IStream
- virtual std::ostream& stream() const CATCH_OVERRIDE;
- };
-
- class CoutStream : public IStream {
- mutable std::ostream m_os;
- public:
- CoutStream();
- virtual ~CoutStream() CATCH_NOEXCEPT;
-
- public: // IStream
- virtual std::ostream& stream() const CATCH_OVERRIDE;
- };
-
- class DebugOutStream : public IStream {
- std::auto_ptr<StreamBufBase> m_streamBuf;
- mutable std::ostream m_os;
- public:
- DebugOutStream();
- virtual ~DebugOutStream() CATCH_NOEXCEPT;
-
- public: // IStream
- virtual std::ostream& stream() const CATCH_OVERRIDE;
- };
-}
-
-#include <memory>
-#include <vector>
-#include <string>
-#include <iostream>
-#include <ctime>
-
-#ifndef CATCH_CONFIG_CONSOLE_WIDTH
-#define CATCH_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-
- struct ConfigData {
-
- ConfigData()
- : listTests( false ),
- listTags( false ),
- listReporters( false ),
- listTestNamesOnly( false ),
- showSuccessfulTests( false ),
- shouldDebugBreak( false ),
- noThrow( false ),
- showHelp( false ),
- showInvisibles( false ),
- filenamesAsTags( false ),
- abortAfter( -1 ),
- rngSeed( 0 ),
- verbosity( Verbosity::Normal ),
- warnings( WarnAbout::Nothing ),
- showDurations( ShowDurations::DefaultForReporter ),
- runOrder( RunTests::InDeclarationOrder ),
- useColour( UseColour::Auto )
- {}
-
- bool listTests;
- bool listTags;
- bool listReporters;
- bool listTestNamesOnly;
-
- bool showSuccessfulTests;
- bool shouldDebugBreak;
- bool noThrow;
- bool showHelp;
- bool showInvisibles;
- bool filenamesAsTags;
-
- int abortAfter;
- unsigned int rngSeed;
-
- Verbosity::Level verbosity;
- WarnAbout::What warnings;
- ShowDurations::OrNot showDurations;
- RunTests::InWhatOrder runOrder;
- UseColour::YesOrNo useColour;
-
- std::string outputFilename;
- std::string name;
- std::string processName;
-
- std::vector<std::string> reporterNames;
- std::vector<std::string> testsOrTags;
- };
-
- class Config : public SharedImpl<IConfig> {
- private:
- Config( Config const& other );
- Config& operator = ( Config const& other );
- virtual void dummy();
- public:
-
- Config()
- {}
-
- Config( ConfigData const& data )
- : m_data( data ),
- m_stream( openStream() )
- {
- if( !data.testsOrTags.empty() ) {
- TestSpecParser parser( ITagAliasRegistry::get() );
- for( std::size_t i = 0; i < data.testsOrTags.size(); ++i )
- parser.parse( data.testsOrTags[i] );
- m_testSpec = parser.testSpec();
- }
- }
-
- virtual ~Config() {
- }
-
- std::string const& getFilename() const {
- return m_data.outputFilename ;
- }
-
- bool listTests() const { return m_data.listTests; }
- bool listTestNamesOnly() const { return m_data.listTestNamesOnly; }
- bool listTags() const { return m_data.listTags; }
- bool listReporters() const { return m_data.listReporters; }
-
- std::string getProcessName() const { return m_data.processName; }
-
- bool shouldDebugBreak() const { return m_data.shouldDebugBreak; }
-
- std::vector<std::string> getReporterNames() const { return m_data.reporterNames; }
-
- int abortAfter() const { return m_data.abortAfter; }
-
- TestSpec const& testSpec() const { return m_testSpec; }
-
- bool showHelp() const { return m_data.showHelp; }
- bool showInvisibles() const { return m_data.showInvisibles; }
-
- // IConfig interface
- virtual bool allowThrows() const { return !m_data.noThrow; }
- virtual std::ostream& stream() const { return m_stream->stream(); }
- virtual std::string name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
- virtual bool includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
- virtual bool warnAboutMissingAssertions() const { return m_data.warnings & WarnAbout::NoAssertions; }
- virtual ShowDurations::OrNot showDurations() const { return m_data.showDurations; }
- virtual RunTests::InWhatOrder runOrder() const { return m_data.runOrder; }
- virtual unsigned int rngSeed() const { return m_data.rngSeed; }
- virtual UseColour::YesOrNo useColour() const { return m_data.useColour; }
-
- private:
-
- IStream const* openStream() {
- if( m_data.outputFilename.empty() )
- return new CoutStream();
- else if( m_data.outputFilename[0] == '%' ) {
- if( m_data.outputFilename == "%debug" )
- return new DebugOutStream();
- else
- throw std::domain_error( "Unrecognised stream: " + m_data.outputFilename );
- }
- else
- return new FileStream( m_data.outputFilename );
- }
- ConfigData m_data;
-
- std::auto_ptr<IStream const> m_stream;
- TestSpec m_testSpec;
- };
-
-} // end namespace Catch
-
-// #included from: catch_clara.h
-#define TWOBLUECUBES_CATCH_CLARA_H_INCLUDED
-
-// Use Catch's value for console width (store Clara's off to the side, if present)
-#ifdef CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CLARA_CONFIG_CONSOLE_WIDTH
-#undef CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH
-
-// Declare Clara inside the Catch namespace
-#define STITCH_CLARA_OPEN_NAMESPACE namespace Catch {
-// #included from: ../external/clara.h
-
-// Version 0.0.1.1
-
-// Only use header guard if we are not using an outer namespace
-#if !defined(TWOBLUECUBES_CLARA_H_INCLUDED) || defined(STITCH_CLARA_OPEN_NAMESPACE)
-
-#ifndef STITCH_CLARA_OPEN_NAMESPACE
-#define TWOBLUECUBES_CLARA_H_INCLUDED
-#define STITCH_CLARA_OPEN_NAMESPACE
-#define STITCH_CLARA_CLOSE_NAMESPACE
-#else
-#define STITCH_CLARA_CLOSE_NAMESPACE }
-#endif
-
-#define STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE STITCH_CLARA_OPEN_NAMESPACE
-
-// ----------- #included from tbc_text_format.h -----------
-
-// Only use header guard if we are not using an outer namespace
-#if !defined(TBC_TEXT_FORMAT_H_INCLUDED) || defined(STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE)
-#ifndef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-#define TBC_TEXT_FORMAT_H_INCLUDED
-#endif
-
-#include <string>
-#include <vector>
-#include <sstream>
-#include <algorithm>
-
-// Use optional outer namespace
-#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-namespace STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
-#endif
-
-namespace Tbc {
-
-#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
- const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
-#else
- const unsigned int consoleWidth = 80;
-#endif
-
- struct TextAttributes {
- TextAttributes()
- : initialIndent( std::string::npos ),
- indent( 0 ),
- width( consoleWidth-1 ),
- tabChar( '\t' )
- {}
-
- TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; }
- TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; }
- TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; }
- TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; }
-
- std::size_t initialIndent; // indent of first line, or npos
- std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos
- std::size_t width; // maximum width of text, including indent. Longer text will wrap
- char tabChar; // If this char is seen the indent is changed to current pos
- };
-
- class Text {
- public:
- Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
- : attr( _attr )
- {
- std::string wrappableChars = " [({.,/|\\-";
- std::size_t indent = _attr.initialIndent != std::string::npos
- ? _attr.initialIndent
- : _attr.indent;
- std::string remainder = _str;
-
- while( !remainder.empty() ) {
- if( lines.size() >= 1000 ) {
- lines.push_back( "... message truncated due to excessive size" );
- return;
- }
- std::size_t tabPos = std::string::npos;
- std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
- std::size_t pos = remainder.find_first_of( '\n' );
- if( pos <= width ) {
- width = pos;
- }
- pos = remainder.find_last_of( _attr.tabChar, width );
- if( pos != std::string::npos ) {
- tabPos = pos;
- if( remainder[width] == '\n' )
- width--;
- remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
- }
-
- if( width == remainder.size() ) {
- spliceLine( indent, remainder, width );
- }
- else if( remainder[width] == '\n' ) {
- spliceLine( indent, remainder, width );
- if( width <= 1 || remainder.size() != 1 )
- remainder = remainder.substr( 1 );
- indent = _attr.indent;
- }
- else {
- pos = remainder.find_last_of( wrappableChars, width );
- if( pos != std::string::npos && pos > 0 ) {
- spliceLine( indent, remainder, pos );
- if( remainder[0] == ' ' )
- remainder = remainder.substr( 1 );
- }
- else {
- spliceLine( indent, remainder, width-1 );
- lines.back() += "-";
- }
- if( lines.size() == 1 )
- indent = _attr.indent;
- if( tabPos != std::string::npos )
- indent += tabPos;
- }
- }
- }
-
- void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
- lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
- _remainder = _remainder.substr( _pos );
- }
-
- typedef std::vector<std::string>::const_iterator const_iterator;
-
- const_iterator begin() const { return lines.begin(); }
- const_iterator end() const { return lines.end(); }
- std::string const& last() const { return lines.back(); }
- std::size_t size() const { return lines.size(); }
- std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
- std::string toString() const {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-
- inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
- for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
- it != itEnd; ++it ) {
- if( it != _text.begin() )
- _stream << "\n";
- _stream << *it;
- }
- return _stream;
- }
-
- private:
- std::string str;
- TextAttributes attr;
- std::vector<std::string> lines;
- };
-
-} // end namespace Tbc
-
-#ifdef STITCH_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-} // end outer namespace
-#endif
-
-#endif // TBC_TEXT_FORMAT_H_INCLUDED
-
-// ----------- end of #include from tbc_text_format.h -----------
-// ........... back in clara.h
-
-#undef STITCH_TBC_TEXT_FORMAT_OPEN_NAMESPACE
-
-// ----------- #included from clara_compilers.h -----------
-
-#ifndef TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-#define TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-
-// Detect a number of compiler features - mostly C++11/14 conformance - by compiler
-// The following features are defined:
-//
-// CLARA_CONFIG_CPP11_NULLPTR : is nullptr supported?
-// CLARA_CONFIG_CPP11_NOEXCEPT : is noexcept supported?
-// CLARA_CONFIG_CPP11_GENERATED_METHODS : The delete and default keywords for compiler generated methods
-// CLARA_CONFIG_CPP11_OVERRIDE : is override supported?
-// CLARA_CONFIG_CPP11_UNIQUE_PTR : is unique_ptr supported (otherwise use auto_ptr)
-
-// CLARA_CONFIG_CPP11_OR_GREATER : Is C++11 supported?
-
-// CLARA_CONFIG_VARIADIC_MACROS : are variadic macros supported?
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CLARA_CONFIG_CPP11_NO_NULLPTR) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-// All the C++11 features can be disabled with CLARA_CONFIG_NO_CPP11
-
-#ifdef __clang__
-
-#if __has_feature(cxx_nullptr)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-#if __has_feature(cxx_noexcept)
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#endif
-
-#endif // __clang__
-
-////////////////////////////////////////////////////////////////////////////////
-// GCC
-#ifdef __GNUC__
-
-#if __GNUC__ == 4 && __GNUC_MINOR__ >= 6 && defined(__GXX_EXPERIMENTAL_CXX0X__)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-// - otherwise more recent versions define __cplusplus >= 201103L
-// and will get picked up below
-
-#endif // __GNUC__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#ifdef _MSC_VER
-
-#if (_MSC_VER >= 1600)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-#if (_MSC_VER >= 1900 ) // (VC++ 13 (VS2015))
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#endif
-
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-// C++ language feature support
-
-// catch all support for C++11
-#if defined(__cplusplus) && __cplusplus >= 201103L
-
-#define CLARA_CPP11_OR_GREATER
-
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR)
-#define CLARA_INTERNAL_CONFIG_CPP11_NULLPTR
-#endif
-
-#ifndef CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#define CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT
-#endif
-
-#ifndef CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#define CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS
-#endif
-
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE)
-#define CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE
-#endif
-#if !defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR)
-#define CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-#endif // __cplusplus >= 201103L
-
-// Now set the actual defines based on the above + anything the user has configured
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NO_NULLPTR) && !defined(CLARA_CONFIG_CPP11_NULLPTR) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_NULLPTR
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NO_NOEXCEPT) && !defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_NOEXCEPT
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_NO_GENERATED_METHODS) && !defined(CLARA_CONFIG_CPP11_GENERATED_METHODS) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_GENERATED_METHODS
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_OVERRIDE) && !defined(CLARA_CONFIG_CPP11_OVERRIDE) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_OVERRIDE
-#endif
-#if defined(CLARA_INTERNAL_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_UNIQUE_PTR) && !defined(CLARA_CONFIG_CPP11_UNIQUE_PTR) && !defined(CLARA_CONFIG_NO_CPP11)
-#define CLARA_CONFIG_CPP11_UNIQUE_PTR
-#endif
-
-// noexcept support:
-#if defined(CLARA_CONFIG_CPP11_NOEXCEPT) && !defined(CLARA_NOEXCEPT)
-#define CLARA_NOEXCEPT noexcept
-# define CLARA_NOEXCEPT_IS(x) noexcept(x)
-#else
-#define CLARA_NOEXCEPT throw()
-# define CLARA_NOEXCEPT_IS(x)
-#endif
-
-// nullptr support
-#ifdef CLARA_CONFIG_CPP11_NULLPTR
-#define CLARA_NULL nullptr
-#else
-#define CLARA_NULL NULL
-#endif
-
-// override support
-#ifdef CLARA_CONFIG_CPP11_OVERRIDE
-#define CLARA_OVERRIDE override
-#else
-#define CLARA_OVERRIDE
-#endif
-
-// unique_ptr support
-#ifdef CLARA_CONFIG_CPP11_UNIQUE_PTR
-# define CLARA_AUTO_PTR( T ) std::unique_ptr<T>
-#else
-# define CLARA_AUTO_PTR( T ) std::auto_ptr<T>
-#endif
-
-#endif // TWOBLUECUBES_CLARA_COMPILERS_H_INCLUDED
-
-// ----------- end of #include from clara_compilers.h -----------
-// ........... back in clara.h
-
-#include <map>
-#include <stdexcept>
-#include <memory>
-
-// Use optional outer namespace
-#ifdef STITCH_CLARA_OPEN_NAMESPACE
-STITCH_CLARA_OPEN_NAMESPACE
-#endif
-
-namespace Clara {
-
- struct UnpositionalTag {};
-
- extern UnpositionalTag _;
-
-#ifdef CLARA_CONFIG_MAIN
- UnpositionalTag _;
-#endif
-
- namespace Detail {
-
-#ifdef CLARA_CONSOLE_WIDTH
- const unsigned int consoleWidth = CLARA_CONFIG_CONSOLE_WIDTH;
-#else
- const unsigned int consoleWidth = 80;
-#endif
-
- // Use this to try and stop compiler from warning about unreachable code
- inline bool isTrue( bool value ) { return value; }
-
- using namespace Tbc;
-
- inline bool startsWith( std::string const& str, std::string const& prefix ) {
- return str.size() >= prefix.size() && str.substr( 0, prefix.size() ) == prefix;
- }
-
- template<typename T> struct RemoveConstRef{ typedef T type; };
- template<typename T> struct RemoveConstRef<T&>{ typedef T type; };
- template<typename T> struct RemoveConstRef<T const&>{ typedef T type; };
- template<typename T> struct RemoveConstRef<T const>{ typedef T type; };
-
- template<typename T> struct IsBool { static const bool value = false; };
- template<> struct IsBool<bool> { static const bool value = true; };
-
- template<typename T>
- void convertInto( std::string const& _source, T& _dest ) {
- std::stringstream ss;
- ss << _source;
- ss >> _dest;
- if( ss.fail() )
- throw std::runtime_error( "Unable to convert " + _source + " to destination type" );
- }
- inline void convertInto( std::string const& _source, std::string& _dest ) {
- _dest = _source;
- }
- inline void convertInto( std::string const& _source, bool& _dest ) {
- std::string sourceLC = _source;
- std::transform( sourceLC.begin(), sourceLC.end(), sourceLC.begin(), ::tolower );
- if( sourceLC == "y" || sourceLC == "1" || sourceLC == "true" || sourceLC == "yes" || sourceLC == "on" )
- _dest = true;
- else if( sourceLC == "n" || sourceLC == "0" || sourceLC == "false" || sourceLC == "no" || sourceLC == "off" )
- _dest = false;
- else
- throw std::runtime_error( "Expected a boolean value but did not recognise:\n '" + _source + "'" );
- }
- inline void convertInto( bool _source, bool& _dest ) {
- _dest = _source;
- }
- template<typename T>
- inline void convertInto( bool, T& ) {
- if( isTrue( true ) )
- throw std::runtime_error( "Invalid conversion" );
- }
-
- template<typename ConfigT>
- struct IArgFunction {
- virtual ~IArgFunction() {}
-#ifdef CLARA_CONFIG_CPP11_GENERATED_METHODS
- IArgFunction() = default;
- IArgFunction( IArgFunction const& ) = default;
-#endif
- virtual void set( ConfigT& config, std::string const& value ) const = 0;
- virtual void setFlag( ConfigT& config ) const = 0;
- virtual bool takesArg() const = 0;
- virtual IArgFunction* clone() const = 0;
- };
-
- template<typename ConfigT>
- class BoundArgFunction {
- public:
- BoundArgFunction() : functionObj( CLARA_NULL ) {}
- BoundArgFunction( IArgFunction<ConfigT>* _functionObj ) : functionObj( _functionObj ) {}
- BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : CLARA_NULL ) {}
- BoundArgFunction& operator = ( BoundArgFunction const& other ) {
- IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : CLARA_NULL;
- delete functionObj;
- functionObj = newFunctionObj;
- return *this;
- }
- ~BoundArgFunction() { delete functionObj; }
-
- void set( ConfigT& config, std::string const& value ) const {
- functionObj->set( config, value );
- }
- void setFlag( ConfigT& config ) const {
- functionObj->setFlag( config );
- }
- bool takesArg() const { return functionObj->takesArg(); }
-
- bool isSet() const {
- return functionObj != CLARA_NULL;
- }
- private:
- IArgFunction<ConfigT>* functionObj;
- };
-
- template<typename C>
- struct NullBinder : IArgFunction<C>{
- virtual void set( C&, std::string const& ) const {}
- virtual void setFlag( C& ) const {}
- virtual bool takesArg() const { return true; }
- virtual IArgFunction<C>* clone() const { return new NullBinder( *this ); }
- };
-
- template<typename C, typename M>
- struct BoundDataMember : IArgFunction<C>{
- BoundDataMember( M C::* _member ) : member( _member ) {}
- virtual void set( C& p, std::string const& stringValue ) const {
- convertInto( stringValue, p.*member );
- }
- virtual void setFlag( C& p ) const {
- convertInto( true, p.*member );
- }
- virtual bool takesArg() const { return !IsBool<M>::value; }
- virtual IArgFunction<C>* clone() const { return new BoundDataMember( *this ); }
- M C::* member;
- };
- template<typename C, typename M>
- struct BoundUnaryMethod : IArgFunction<C>{
- BoundUnaryMethod( void (C::*_member)( M ) ) : member( _member ) {}
- virtual void set( C& p, std::string const& stringValue ) const {
- typename RemoveConstRef<M>::type value;
- convertInto( stringValue, value );
- (p.*member)( value );
- }
- virtual void setFlag( C& p ) const {
- typename RemoveConstRef<M>::type value;
- convertInto( true, value );
- (p.*member)( value );
- }
- virtual bool takesArg() const { return !IsBool<M>::value; }
- virtual IArgFunction<C>* clone() const { return new BoundUnaryMethod( *this ); }
- void (C::*member)( M );
- };
- template<typename C>
- struct BoundNullaryMethod : IArgFunction<C>{
- BoundNullaryMethod( void (C::*_member)() ) : member( _member ) {}
- virtual void set( C& p, std::string const& stringValue ) const {
- bool value;
- convertInto( stringValue, value );
- if( value )
- (p.*member)();
- }
- virtual void setFlag( C& p ) const {
- (p.*member)();
- }
- virtual bool takesArg() const { return false; }
- virtual IArgFunction<C>* clone() const { return new BoundNullaryMethod( *this ); }
- void (C::*member)();
- };
-
- template<typename C>
- struct BoundUnaryFunction : IArgFunction<C>{
- BoundUnaryFunction( void (*_function)( C& ) ) : function( _function ) {}
- virtual void set( C& obj, std::string const& stringValue ) const {
- bool value;
- convertInto( stringValue, value );
- if( value )
- function( obj );
- }
- virtual void setFlag( C& p ) const {
- function( p );
- }
- virtual bool takesArg() const { return false; }
- virtual IArgFunction<C>* clone() const { return new BoundUnaryFunction( *this ); }
- void (*function)( C& );
- };
-
- template<typename C, typename T>
- struct BoundBinaryFunction : IArgFunction<C>{
- BoundBinaryFunction( void (*_function)( C&, T ) ) : function( _function ) {}
- virtual void set( C& obj, std::string const& stringValue ) const {
- typename RemoveConstRef<T>::type value;
- convertInto( stringValue, value );
- function( obj, value );
- }
- virtual void setFlag( C& obj ) const {
- typename RemoveConstRef<T>::type value;
- convertInto( true, value );
- function( obj, value );
- }
- virtual bool takesArg() const { return !IsBool<T>::value; }
- virtual IArgFunction<C>* clone() const { return new BoundBinaryFunction( *this ); }
- void (*function)( C&, T );
- };
-
- } // namespace Detail
-
- struct Parser {
- Parser() : separators( " \t=:" ) {}
-
- struct Token {
- enum Type { Positional, ShortOpt, LongOpt };
- Token( Type _type, std::string const& _data ) : type( _type ), data( _data ) {}
- Type type;
- std::string data;
- };
-
- void parseIntoTokens( int argc, char const* const argv[], std::vector<Parser::Token>& tokens ) const {
- const std::string doubleDash = "--";
- for( int i = 1; i < argc && argv[i] != doubleDash; ++i )
- parseIntoTokens( argv[i] , tokens);
- }
- void parseIntoTokens( std::string arg, std::vector<Parser::Token>& tokens ) const {
- while( !arg.empty() ) {
- Parser::Token token( Parser::Token::Positional, arg );
- arg = "";
- if( token.data[0] == '-' ) {
- if( token.data.size() > 1 && token.data[1] == '-' ) {
- token = Parser::Token( Parser::Token::LongOpt, token.data.substr( 2 ) );
- }
- else {
- token = Parser::Token( Parser::Token::ShortOpt, token.data.substr( 1 ) );
- if( token.data.size() > 1 && separators.find( token.data[1] ) == std::string::npos ) {
- arg = "-" + token.data.substr( 1 );
- token.data = token.data.substr( 0, 1 );
- }
- }
- }
- if( token.type != Parser::Token::Positional ) {
- std::size_t pos = token.data.find_first_of( separators );
- if( pos != std::string::npos ) {
- arg = token.data.substr( pos+1 );
- token.data = token.data.substr( 0, pos );
- }
- }
- tokens.push_back( token );
- }
- }
- std::string separators;
- };
-
- template<typename ConfigT>
- struct CommonArgProperties {
- CommonArgProperties() {}
- CommonArgProperties( Detail::BoundArgFunction<ConfigT> const& _boundField ) : boundField( _boundField ) {}
-
- Detail::BoundArgFunction<ConfigT> boundField;
- std::string description;
- std::string detail;
- std::string placeholder; // Only value if boundField takes an arg
-
- bool takesArg() const {
- return !placeholder.empty();
- }
- void validate() const {
- if( !boundField.isSet() )
- throw std::logic_error( "option not bound" );
- }
- };
- struct OptionArgProperties {
- std::vector<std::string> shortNames;
- std::string longName;
-
- bool hasShortName( std::string const& shortName ) const {
- return std::find( shortNames.begin(), shortNames.end(), shortName ) != shortNames.end();
- }
- bool hasLongName( std::string const& _longName ) const {
- return _longName == longName;
- }
- };
- struct PositionalArgProperties {
- PositionalArgProperties() : position( -1 ) {}
- int position; // -1 means non-positional (floating)
-
- bool isFixedPositional() const {
- return position != -1;
- }
- };
-
- template<typename ConfigT>
- class CommandLine {
-
- struct Arg : CommonArgProperties<ConfigT>, OptionArgProperties, PositionalArgProperties {
- Arg() {}
- Arg( Detail::BoundArgFunction<ConfigT> const& _boundField ) : CommonArgProperties<ConfigT>( _boundField ) {}
-
- using CommonArgProperties<ConfigT>::placeholder; // !TBD
-
- std::string dbgName() const {
- if( !longName.empty() )
- return "--" + longName;
- if( !shortNames.empty() )
- return "-" + shortNames[0];
- return "positional args";
- }
- std::string commands() const {
- std::ostringstream oss;
- bool first = true;
- std::vector<std::string>::const_iterator it = shortNames.begin(), itEnd = shortNames.end();
- for(; it != itEnd; ++it ) {
- if( first )
- first = false;
- else
- oss << ", ";
- oss << "-" << *it;
- }
- if( !longName.empty() ) {
- if( !first )
- oss << ", ";
- oss << "--" << longName;
- }
- if( !placeholder.empty() )
- oss << " <" << placeholder << ">";
- return oss.str();
- }
- };
-
- typedef CLARA_AUTO_PTR( Arg ) ArgAutoPtr;
-
- friend void addOptName( Arg& arg, std::string const& optName )
- {
- if( optName.empty() )
- return;
- if( Detail::startsWith( optName, "--" ) ) {
- if( !arg.longName.empty() )
- throw std::logic_error( "Only one long opt may be specified. '"
- + arg.longName
- + "' already specified, now attempting to add '"
- + optName + "'" );
- arg.longName = optName.substr( 2 );
- }
- else if( Detail::startsWith( optName, "-" ) )
- arg.shortNames.push_back( optName.substr( 1 ) );
- else
- throw std::logic_error( "option must begin with - or --. Option was: '" + optName + "'" );
- }
- friend void setPositionalArg( Arg& arg, int position )
- {
- arg.position = position;
- }
-
- class ArgBuilder {
- public:
- ArgBuilder( Arg* arg ) : m_arg( arg ) {}
-
- // Bind a non-boolean data member (requires placeholder string)
- template<typename C, typename M>
- void bind( M C::* field, std::string const& placeholder ) {
- m_arg->boundField = new Detail::BoundDataMember<C,M>( field );
- m_arg->placeholder = placeholder;
- }
- // Bind a boolean data member (no placeholder required)
- template<typename C>
- void bind( bool C::* field ) {
- m_arg->boundField = new Detail::BoundDataMember<C,bool>( field );
- }
-
- // Bind a method taking a single, non-boolean argument (requires a placeholder string)
- template<typename C, typename M>
- void bind( void (C::* unaryMethod)( M ), std::string const& placeholder ) {
- m_arg->boundField = new Detail::BoundUnaryMethod<C,M>( unaryMethod );
- m_arg->placeholder = placeholder;
- }
-
- // Bind a method taking a single, boolean argument (no placeholder string required)
- template<typename C>
- void bind( void (C::* unaryMethod)( bool ) ) {
- m_arg->boundField = new Detail::BoundUnaryMethod<C,bool>( unaryMethod );
- }
-
- // Bind a method that takes no arguments (will be called if opt is present)
- template<typename C>
- void bind( void (C::* nullaryMethod)() ) {
- m_arg->boundField = new Detail::BoundNullaryMethod<C>( nullaryMethod );
- }
-
- // Bind a free function taking a single argument - the object to operate on (no placeholder string required)
- template<typename C>
- void bind( void (* unaryFunction)( C& ) ) {
- m_arg->boundField = new Detail::BoundUnaryFunction<C>( unaryFunction );
- }
-
- // Bind a free function taking a single argument - the object to operate on (requires a placeholder string)
- template<typename C, typename T>
- void bind( void (* binaryFunction)( C&, T ), std::string const& placeholder ) {
- m_arg->boundField = new Detail::BoundBinaryFunction<C, T>( binaryFunction );
- m_arg->placeholder = placeholder;
- }
-
- ArgBuilder& describe( std::string const& description ) {
- m_arg->description = description;
- return *this;
- }
- ArgBuilder& detail( std::string const& detail ) {
- m_arg->detail = detail;
- return *this;
- }
-
- protected:
- Arg* m_arg;
- };
-
- class OptBuilder : public ArgBuilder {
- public:
- OptBuilder( Arg* arg ) : ArgBuilder( arg ) {}
- OptBuilder( OptBuilder& other ) : ArgBuilder( other ) {}
-
- OptBuilder& operator[]( std::string const& optName ) {
- addOptName( *ArgBuilder::m_arg, optName );
- return *this;
- }
- };
-
- public:
-
- CommandLine()
- : m_boundProcessName( new Detail::NullBinder<ConfigT>() ),
- m_highestSpecifiedArgPosition( 0 ),
- m_throwOnUnrecognisedTokens( false )
- {}
- CommandLine( CommandLine const& other )
- : m_boundProcessName( other.m_boundProcessName ),
- m_options ( other.m_options ),
- m_positionalArgs( other.m_positionalArgs ),
- m_highestSpecifiedArgPosition( other.m_highestSpecifiedArgPosition ),
- m_throwOnUnrecognisedTokens( other.m_throwOnUnrecognisedTokens )
- {
- if( other.m_floatingArg.get() )
- m_floatingArg.reset( new Arg( *other.m_floatingArg ) );
- }
-
- CommandLine& setThrowOnUnrecognisedTokens( bool shouldThrow = true ) {
- m_throwOnUnrecognisedTokens = shouldThrow;
- return *this;
- }
-
- OptBuilder operator[]( std::string const& optName ) {
- m_options.push_back( Arg() );
- addOptName( m_options.back(), optName );
- OptBuilder builder( &m_options.back() );
- return builder;
- }
-
- ArgBuilder operator[]( int position ) {
- m_positionalArgs.insert( std::make_pair( position, Arg() ) );
- if( position > m_highestSpecifiedArgPosition )
- m_highestSpecifiedArgPosition = position;
- setPositionalArg( m_positionalArgs[position], position );
- ArgBuilder builder( &m_positionalArgs[position] );
- return builder;
- }
-
- // Invoke this with the _ instance
- ArgBuilder operator[]( UnpositionalTag ) {
- if( m_floatingArg.get() )
- throw std::logic_error( "Only one unpositional argument can be added" );
- m_floatingArg.reset( new Arg() );
- ArgBuilder builder( m_floatingArg.get() );
- return builder;
- }
-
- template<typename C, typename M>
- void bindProcessName( M C::* field ) {
- m_boundProcessName = new Detail::BoundDataMember<C,M>( field );
- }
- template<typename C, typename M>
- void bindProcessName( void (C::*_unaryMethod)( M ) ) {
- m_boundProcessName = new Detail::BoundUnaryMethod<C,M>( _unaryMethod );
- }
-
- void optUsage( std::ostream& os, std::size_t indent = 0, std::size_t width = Detail::consoleWidth ) const {
- typename std::vector<Arg>::const_iterator itBegin = m_options.begin(), itEnd = m_options.end(), it;
- std::size_t maxWidth = 0;
- for( it = itBegin; it != itEnd; ++it )
- maxWidth = (std::max)( maxWidth, it->commands().size() );
-
- for( it = itBegin; it != itEnd; ++it ) {
- Detail::Text usage( it->commands(), Detail::TextAttributes()
- .setWidth( maxWidth+indent )
- .setIndent( indent ) );
- Detail::Text desc( it->description, Detail::TextAttributes()
- .setWidth( width - maxWidth - 3 ) );
-
- for( std::size_t i = 0; i < (std::max)( usage.size(), desc.size() ); ++i ) {
- std::string usageCol = i < usage.size() ? usage[i] : "";
- os << usageCol;
-
- if( i < desc.size() && !desc[i].empty() )
- os << std::string( indent + 2 + maxWidth - usageCol.size(), ' ' )
- << desc[i];
- os << "\n";
- }
- }
- }
- std::string optUsage() const {
- std::ostringstream oss;
- optUsage( oss );
- return oss.str();
- }
-
- void argSynopsis( std::ostream& os ) const {
- for( int i = 1; i <= m_highestSpecifiedArgPosition; ++i ) {
- if( i > 1 )
- os << " ";
- typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( i );
- if( it != m_positionalArgs.end() )
- os << "<" << it->second.placeholder << ">";
- else if( m_floatingArg.get() )
- os << "<" << m_floatingArg->placeholder << ">";
- else
- throw std::logic_error( "non consecutive positional arguments with no floating args" );
- }
- // !TBD No indication of mandatory args
- if( m_floatingArg.get() ) {
- if( m_highestSpecifiedArgPosition > 1 )
- os << " ";
- os << "[<" << m_floatingArg->placeholder << "> ...]";
- }
- }
- std::string argSynopsis() const {
- std::ostringstream oss;
- argSynopsis( oss );
- return oss.str();
- }
-
- void usage( std::ostream& os, std::string const& procName ) const {
- validate();
- os << "usage:\n " << procName << " ";
- argSynopsis( os );
- if( !m_options.empty() ) {
- os << " [options]\n\nwhere options are: \n";
- optUsage( os, 2 );
- }
- os << "\n";
- }
- std::string usage( std::string const& procName ) const {
- std::ostringstream oss;
- usage( oss, procName );
- return oss.str();
- }
-
- ConfigT parse( int argc, char const* const argv[] ) const {
- ConfigT config;
- parseInto( argc, argv, config );
- return config;
- }
-
- std::vector<Parser::Token> parseInto( int argc, char const* argv[], ConfigT& config ) const {
- std::string processName = argv[0];
- std::size_t lastSlash = processName.find_last_of( "/\\" );
- if( lastSlash != std::string::npos )
- processName = processName.substr( lastSlash+1 );
- m_boundProcessName.set( config, processName );
- std::vector<Parser::Token> tokens;
- Parser parser;
- parser.parseIntoTokens( argc, argv, tokens );
- return populate( tokens, config );
- }
-
- std::vector<Parser::Token> populate( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
- validate();
- std::vector<Parser::Token> unusedTokens = populateOptions( tokens, config );
- unusedTokens = populateFixedArgs( unusedTokens, config );
- unusedTokens = populateFloatingArgs( unusedTokens, config );
- return unusedTokens;
- }
-
- std::vector<Parser::Token> populateOptions( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
- std::vector<Parser::Token> unusedTokens;
- std::vector<std::string> errors;
- for( std::size_t i = 0; i < tokens.size(); ++i ) {
- Parser::Token const& token = tokens[i];
- typename std::vector<Arg>::const_iterator it = m_options.begin(), itEnd = m_options.end();
- for(; it != itEnd; ++it ) {
- Arg const& arg = *it;
-
- try {
- if( ( token.type == Parser::Token::ShortOpt && arg.hasShortName( token.data ) ) ||
- ( token.type == Parser::Token::LongOpt && arg.hasLongName( token.data ) ) ) {
- if( arg.takesArg() ) {
- if( i == tokens.size()-1 || tokens[i+1].type != Parser::Token::Positional )
- errors.push_back( "Expected argument to option: " + token.data );
- else
- arg.boundField.set( config, tokens[++i].data );
- }
- else {
- arg.boundField.setFlag( config );
- }
- break;
- }
- }
- catch( std::exception& ex ) {
- errors.push_back( std::string( ex.what() ) + "\n- while parsing: (" + arg.commands() + ")" );
- }
- }
- if( it == itEnd ) {
- if( token.type == Parser::Token::Positional || !m_throwOnUnrecognisedTokens )
- unusedTokens.push_back( token );
- else if( errors.empty() && m_throwOnUnrecognisedTokens )
- errors.push_back( "unrecognised option: " + token.data );
- }
- }
- if( !errors.empty() ) {
- std::ostringstream oss;
- for( std::vector<std::string>::const_iterator it = errors.begin(), itEnd = errors.end();
- it != itEnd;
- ++it ) {
- if( it != errors.begin() )
- oss << "\n";
- oss << *it;
- }
- throw std::runtime_error( oss.str() );
- }
- return unusedTokens;
- }
- std::vector<Parser::Token> populateFixedArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
- std::vector<Parser::Token> unusedTokens;
- int position = 1;
- for( std::size_t i = 0; i < tokens.size(); ++i ) {
- Parser::Token const& token = tokens[i];
- typename std::map<int, Arg>::const_iterator it = m_positionalArgs.find( position );
- if( it != m_positionalArgs.end() )
- it->second.boundField.set( config, token.data );
- else
- unusedTokens.push_back( token );
- if( token.type == Parser::Token::Positional )
- position++;
- }
- return unusedTokens;
- }
- std::vector<Parser::Token> populateFloatingArgs( std::vector<Parser::Token> const& tokens, ConfigT& config ) const {
- if( !m_floatingArg.get() )
- return tokens;
- std::vector<Parser::Token> unusedTokens;
- for( std::size_t i = 0; i < tokens.size(); ++i ) {
- Parser::Token const& token = tokens[i];
- if( token.type == Parser::Token::Positional )
- m_floatingArg->boundField.set( config, token.data );
- else
- unusedTokens.push_back( token );
- }
- return unusedTokens;
- }
-
- void validate() const
- {
- if( m_options.empty() && m_positionalArgs.empty() && !m_floatingArg.get() )
- throw std::logic_error( "No options or arguments specified" );
-
- for( typename std::vector<Arg>::const_iterator it = m_options.begin(),
- itEnd = m_options.end();
- it != itEnd; ++it )
- it->validate();
- }
-
- private:
- Detail::BoundArgFunction<ConfigT> m_boundProcessName;
- std::vector<Arg> m_options;
- std::map<int, Arg> m_positionalArgs;
- ArgAutoPtr m_floatingArg;
- int m_highestSpecifiedArgPosition;
- bool m_throwOnUnrecognisedTokens;
- };
-
-} // end namespace Clara
-
-STITCH_CLARA_CLOSE_NAMESPACE
-#undef STITCH_CLARA_OPEN_NAMESPACE
-#undef STITCH_CLARA_CLOSE_NAMESPACE
-
-#endif // TWOBLUECUBES_CLARA_H_INCLUDED
-#undef STITCH_CLARA_OPEN_NAMESPACE
-
-// Restore Clara's value for console width, if present
-#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#define CLARA_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#include <fstream>
-
-namespace Catch {
-
- inline void abortAfterFirst( ConfigData& config ) { config.abortAfter = 1; }
- inline void abortAfterX( ConfigData& config, int x ) {
- if( x < 1 )
- throw std::runtime_error( "Value after -x or --abortAfter must be greater than zero" );
- config.abortAfter = x;
- }
- inline void addTestOrTags( ConfigData& config, std::string const& _testSpec ) { config.testsOrTags.push_back( _testSpec ); }
- inline void addReporterName( ConfigData& config, std::string const& _reporterName ) { config.reporterNames.push_back( _reporterName ); }
-
- inline void addWarning( ConfigData& config, std::string const& _warning ) {
- if( _warning == "NoAssertions" )
- config.warnings = static_cast<WarnAbout::What>( config.warnings | WarnAbout::NoAssertions );
- else
- throw std::runtime_error( "Unrecognised warning: '" + _warning + "'" );
- }
- inline void setOrder( ConfigData& config, std::string const& order ) {
- if( startsWith( "declared", order ) )
- config.runOrder = RunTests::InDeclarationOrder;
- else if( startsWith( "lexical", order ) )
- config.runOrder = RunTests::InLexicographicalOrder;
- else if( startsWith( "random", order ) )
- config.runOrder = RunTests::InRandomOrder;
- else
- throw std::runtime_error( "Unrecognised ordering: '" + order + "'" );
- }
- inline void setRngSeed( ConfigData& config, std::string const& seed ) {
- if( seed == "time" ) {
- config.rngSeed = static_cast<unsigned int>( std::time(0) );
- }
- else {
- std::stringstream ss;
- ss << seed;
- ss >> config.rngSeed;
- if( ss.fail() )
- throw std::runtime_error( "Argment to --rng-seed should be the word 'time' or a number" );
- }
- }
- inline void setVerbosity( ConfigData& config, int level ) {
- // !TBD: accept strings?
- config.verbosity = static_cast<Verbosity::Level>( level );
- }
- inline void setShowDurations( ConfigData& config, bool _showDurations ) {
- config.showDurations = _showDurations
- ? ShowDurations::Always
- : ShowDurations::Never;
- }
- inline void setUseColour( ConfigData& config, std::string const& value ) {
- std::string mode = toLower( value );
-
- if( mode == "yes" )
- config.useColour = UseColour::Yes;
- else if( mode == "no" )
- config.useColour = UseColour::No;
- else if( mode == "auto" )
- config.useColour = UseColour::Auto;
- else
- throw std::runtime_error( "colour mode must be one of: auto, yes or no" );
- }
- inline void forceColour( ConfigData& config ) {
- config.useColour = UseColour::Yes;
- }
- inline void loadTestNamesFromFile( ConfigData& config, std::string const& _filename ) {
- std::ifstream f( _filename.c_str() );
- if( !f.is_open() )
- throw std::domain_error( "Unable to load input file: " + _filename );
-
- std::string line;
- while( std::getline( f, line ) ) {
- line = trim(line);
- if( !line.empty() && !startsWith( line, "#" ) )
- addTestOrTags( config, "\"" + line + "\"," );
- }
- }
-
- inline Clara::CommandLine<ConfigData> makeCommandLineParser() {
-
- using namespace Clara;
- CommandLine<ConfigData> cli;
-
- cli.bindProcessName( &ConfigData::processName );
-
- cli["-?"]["-h"]["--help"]
- .describe( "display usage information" )
- .bind( &ConfigData::showHelp );
-
- cli["-l"]["--list-tests"]
- .describe( "list all/matching test cases" )
- .bind( &ConfigData::listTests );
-
- cli["-t"]["--list-tags"]
- .describe( "list all/matching tags" )
- .bind( &ConfigData::listTags );
-
- cli["-s"]["--success"]
- .describe( "include successful tests in output" )
- .bind( &ConfigData::showSuccessfulTests );
-
- cli["-b"]["--break"]
- .describe( "break into debugger on failure" )
- .bind( &ConfigData::shouldDebugBreak );
-
- cli["-e"]["--nothrow"]
- .describe( "skip exception tests" )
- .bind( &ConfigData::noThrow );
-
- cli["-i"]["--invisibles"]
- .describe( "show invisibles (tabs, newlines)" )
- .bind( &ConfigData::showInvisibles );
-
- cli["-o"]["--out"]
- .describe( "output filename" )
- .bind( &ConfigData::outputFilename, "filename" );
-
- cli["-r"]["--reporter"]
-// .placeholder( "name[:filename]" )
- .describe( "reporter to use (defaults to console)" )
- .bind( &addReporterName, "name" );
-
- cli["-n"]["--name"]
- .describe( "suite name" )
- .bind( &ConfigData::name, "name" );
-
- cli["-a"]["--abort"]
- .describe( "abort at first failure" )
- .bind( &abortAfterFirst );
-
- cli["-x"]["--abortx"]
- .describe( "abort after x failures" )
- .bind( &abortAfterX, "no. failures" );
-
- cli["-w"]["--warn"]
- .describe( "enable warnings" )
- .bind( &addWarning, "warning name" );
-
-// - needs updating if reinstated
-// cli.into( &setVerbosity )
-// .describe( "level of verbosity (0=no output)" )
-// .shortOpt( "v")
-// .longOpt( "verbosity" )
-// .placeholder( "level" );
-
- cli[_]
- .describe( "which test or tests to use" )
- .bind( &addTestOrTags, "test name, pattern or tags" );
-
- cli["-d"]["--durations"]
- .describe( "show test durations" )
- .bind( &setShowDurations, "yes|no" );
-
- cli["-f"]["--input-file"]
- .describe( "load test names to run from a file" )
- .bind( &loadTestNamesFromFile, "filename" );
-
- cli["-#"]["--filenames-as-tags"]
- .describe( "adds a tag for the filename" )
- .bind( &ConfigData::filenamesAsTags );
-
- // Less common commands which don't have a short form
- cli["--list-test-names-only"]
- .describe( "list all/matching test cases names only" )
- .bind( &ConfigData::listTestNamesOnly );
-
- cli["--list-reporters"]
- .describe( "list all reporters" )
- .bind( &ConfigData::listReporters );
-
- cli["--order"]
- .describe( "test case order (defaults to decl)" )
- .bind( &setOrder, "decl|lex|rand" );
-
- cli["--rng-seed"]
- .describe( "set a specific seed for random numbers" )
- .bind( &setRngSeed, "'time'|number" );
-
- cli["--force-colour"]
- .describe( "force colourised output (deprecated)" )
- .bind( &forceColour );
-
- cli["--use-colour"]
- .describe( "should output be colourised" )
- .bind( &setUseColour, "yes|no" );
-
- return cli;
- }
-
-} // end namespace Catch
-
-// #included from: internal/catch_list.hpp
-#define TWOBLUECUBES_CATCH_LIST_HPP_INCLUDED
-
-// #included from: catch_text.h
-#define TWOBLUECUBES_CATCH_TEXT_H_INCLUDED
-
-#define TBC_TEXT_FORMAT_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH
-
-#define CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE Catch
-// #included from: ../external/tbc_text_format.h
-// Only use header guard if we are not using an outer namespace
-#ifndef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-# ifdef TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
-# ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-# define TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-# endif
-# else
-# define TWOBLUECUBES_TEXT_FORMAT_H_INCLUDED
-# endif
-#endif
-#ifndef TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-#include <string>
-#include <vector>
-#include <sstream>
-
-// Use optional outer namespace
-#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-namespace CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE {
-#endif
-
-namespace Tbc {
-
-#ifdef TBC_TEXT_FORMAT_CONSOLE_WIDTH
- const unsigned int consoleWidth = TBC_TEXT_FORMAT_CONSOLE_WIDTH;
-#else
- const unsigned int consoleWidth = 80;
-#endif
-
- struct TextAttributes {
- TextAttributes()
- : initialIndent( std::string::npos ),
- indent( 0 ),
- width( consoleWidth-1 ),
- tabChar( '\t' )
- {}
-
- TextAttributes& setInitialIndent( std::size_t _value ) { initialIndent = _value; return *this; }
- TextAttributes& setIndent( std::size_t _value ) { indent = _value; return *this; }
- TextAttributes& setWidth( std::size_t _value ) { width = _value; return *this; }
- TextAttributes& setTabChar( char _value ) { tabChar = _value; return *this; }
-
- std::size_t initialIndent; // indent of first line, or npos
- std::size_t indent; // indent of subsequent lines, or all if initialIndent is npos
- std::size_t width; // maximum width of text, including indent. Longer text will wrap
- char tabChar; // If this char is seen the indent is changed to current pos
- };
-
- class Text {
- public:
- Text( std::string const& _str, TextAttributes const& _attr = TextAttributes() )
- : attr( _attr )
- {
- std::string wrappableChars = " [({.,/|\\-";
- std::size_t indent = _attr.initialIndent != std::string::npos
- ? _attr.initialIndent
- : _attr.indent;
- std::string remainder = _str;
-
- while( !remainder.empty() ) {
- if( lines.size() >= 1000 ) {
- lines.push_back( "... message truncated due to excessive size" );
- return;
- }
- std::size_t tabPos = std::string::npos;
- std::size_t width = (std::min)( remainder.size(), _attr.width - indent );
- std::size_t pos = remainder.find_first_of( '\n' );
- if( pos <= width ) {
- width = pos;
- }
- pos = remainder.find_last_of( _attr.tabChar, width );
- if( pos != std::string::npos ) {
- tabPos = pos;
- if( remainder[width] == '\n' )
- width--;
- remainder = remainder.substr( 0, tabPos ) + remainder.substr( tabPos+1 );
- }
-
- if( width == remainder.size() ) {
- spliceLine( indent, remainder, width );
- }
- else if( remainder[width] == '\n' ) {
- spliceLine( indent, remainder, width );
- if( width <= 1 || remainder.size() != 1 )
- remainder = remainder.substr( 1 );
- indent = _attr.indent;
- }
- else {
- pos = remainder.find_last_of( wrappableChars, width );
- if( pos != std::string::npos && pos > 0 ) {
- spliceLine( indent, remainder, pos );
- if( remainder[0] == ' ' )
- remainder = remainder.substr( 1 );
- }
- else {
- spliceLine( indent, remainder, width-1 );
- lines.back() += "-";
- }
- if( lines.size() == 1 )
- indent = _attr.indent;
- if( tabPos != std::string::npos )
- indent += tabPos;
- }
- }
- }
-
- void spliceLine( std::size_t _indent, std::string& _remainder, std::size_t _pos ) {
- lines.push_back( std::string( _indent, ' ' ) + _remainder.substr( 0, _pos ) );
- _remainder = _remainder.substr( _pos );
- }
-
- typedef std::vector<std::string>::const_iterator const_iterator;
-
- const_iterator begin() const { return lines.begin(); }
- const_iterator end() const { return lines.end(); }
- std::string const& last() const { return lines.back(); }
- std::size_t size() const { return lines.size(); }
- std::string const& operator[]( std::size_t _index ) const { return lines[_index]; }
- std::string toString() const {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-
- inline friend std::ostream& operator << ( std::ostream& _stream, Text const& _text ) {
- for( Text::const_iterator it = _text.begin(), itEnd = _text.end();
- it != itEnd; ++it ) {
- if( it != _text.begin() )
- _stream << "\n";
- _stream << *it;
- }
- return _stream;
- }
-
- private:
- std::string str;
- TextAttributes attr;
- std::vector<std::string> lines;
- };
-
-} // end namespace Tbc
-
-#ifdef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-} // end outer namespace
-#endif
-
-#endif // TWOBLUECUBES_TEXT_FORMAT_H_ALREADY_INCLUDED
-#undef CLICHE_TBC_TEXT_FORMAT_OUTER_NAMESPACE
-
-namespace Catch {
- using Tbc::Text;
- using Tbc::TextAttributes;
-}
-
-// #included from: catch_console_colour.hpp
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_HPP_INCLUDED
-
-namespace Catch {
-
- struct Colour {
- enum Code {
- None = 0,
-
- White,
- Red,
- Green,
- Blue,
- Cyan,
- Yellow,
- Grey,
-
- Bright = 0x10,
-
- BrightRed = Bright | Red,
- BrightGreen = Bright | Green,
- LightGrey = Bright | Grey,
- BrightWhite = Bright | White,
-
- // By intention
- FileName = LightGrey,
- Warning = Yellow,
- ResultError = BrightRed,
- ResultSuccess = BrightGreen,
- ResultExpectedFailure = Warning,
-
- Error = BrightRed,
- Success = Green,
-
- OriginalExpression = Cyan,
- ReconstructedExpression = Yellow,
-
- SecondaryText = LightGrey,
- Headers = White
- };
-
- // Use constructed object for RAII guard
- Colour( Code _colourCode );
- Colour( Colour const& other );
- ~Colour();
-
- // Use static method for one-shot changes
- static void use( Code _colourCode );
-
- private:
- bool m_moved;
- };
-
- inline std::ostream& operator << ( std::ostream& os, Colour const& ) { return os; }
-
-} // end namespace Catch
-
-// #included from: catch_interfaces_reporter.h
-#define TWOBLUECUBES_CATCH_INTERFACES_REPORTER_H_INCLUDED
-
-#include <string>
-#include <ostream>
-#include <map>
-#include <assert.h>
-
-namespace Catch
-{
- struct ReporterConfig {
- explicit ReporterConfig( Ptr<IConfig const> const& _fullConfig )
- : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
-
- ReporterConfig( Ptr<IConfig const> const& _fullConfig, std::ostream& _stream )
- : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
-
- std::ostream& stream() const { return *m_stream; }
- Ptr<IConfig const> fullConfig() const { return m_fullConfig; }
-
- private:
- std::ostream* m_stream;
- Ptr<IConfig const> m_fullConfig;
- };
-
- struct ReporterPreferences {
- ReporterPreferences()
- : shouldRedirectStdOut( false )
- {}
-
- bool shouldRedirectStdOut;
- };
-
- template<typename T>
- struct LazyStat : Option<T> {
- LazyStat() : used( false ) {}
- LazyStat& operator=( T const& _value ) {
- Option<T>::operator=( _value );
- used = false;
- return *this;
- }
- void reset() {
- Option<T>::reset();
- used = false;
- }
- bool used;
- };
-
- struct TestRunInfo {
- TestRunInfo( std::string const& _name ) : name( _name ) {}
- std::string name;
- };
- struct GroupInfo {
- GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount )
- : name( _name ),
- groupIndex( _groupIndex ),
- groupsCounts( _groupsCount )
- {}
-
- std::string name;
- std::size_t groupIndex;
- std::size_t groupsCounts;
- };
-
- struct AssertionStats {
- AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals )
- : assertionResult( _assertionResult ),
- infoMessages( _infoMessages ),
- totals( _totals )
- {
- if( assertionResult.hasMessage() ) {
- // Copy message into messages list.
- // !TBD This should have been done earlier, somewhere
- MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
- builder << assertionResult.getMessage();
- builder.m_info.message = builder.m_stream.str();
-
- infoMessages.push_back( builder.m_info );
- }
- }
- virtual ~AssertionStats();
-
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- AssertionStats( AssertionStats const& ) = default;
- AssertionStats( AssertionStats && ) = default;
- AssertionStats& operator = ( AssertionStats const& ) = default;
- AssertionStats& operator = ( AssertionStats && ) = default;
-# endif
-
- AssertionResult assertionResult;
- std::vector<MessageInfo> infoMessages;
- Totals totals;
- };
-
- struct SectionStats {
- SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions )
- : sectionInfo( _sectionInfo ),
- assertions( _assertions ),
- durationInSeconds( _durationInSeconds ),
- missingAssertions( _missingAssertions )
- {}
- virtual ~SectionStats();
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- SectionStats( SectionStats const& ) = default;
- SectionStats( SectionStats && ) = default;
- SectionStats& operator = ( SectionStats const& ) = default;
- SectionStats& operator = ( SectionStats && ) = default;
-# endif
-
- SectionInfo sectionInfo;
- Counts assertions;
- double durationInSeconds;
- bool missingAssertions;
- };
-
- struct TestCaseStats {
- TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting )
- : testInfo( _testInfo ),
- totals( _totals ),
- stdOut( _stdOut ),
- stdErr( _stdErr ),
- aborting( _aborting )
- {}
- virtual ~TestCaseStats();
-
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- TestCaseStats( TestCaseStats const& ) = default;
- TestCaseStats( TestCaseStats && ) = default;
- TestCaseStats& operator = ( TestCaseStats const& ) = default;
- TestCaseStats& operator = ( TestCaseStats && ) = default;
-# endif
-
- TestCaseInfo testInfo;
- Totals totals;
- std::string stdOut;
- std::string stdErr;
- bool aborting;
- };
-
- struct TestGroupStats {
- TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting )
- : groupInfo( _groupInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
- TestGroupStats( GroupInfo const& _groupInfo )
- : groupInfo( _groupInfo ),
- aborting( false )
- {}
- virtual ~TestGroupStats();
-
-# ifdef CATCH_CONFIG_CPP11_GENERATED_METHODS
- TestGroupStats( TestGroupStats const& ) = default;
- TestGroupStats( TestGroupStats && ) = default;
- TestGroupStats& operator = ( TestGroupStats const& ) = default;
- TestGroupStats& operator = ( TestGroupStats && ) = default;
-# endif
-
- GroupInfo groupInfo;
- Totals totals;
- bool aborting;
- };
-
- struct TestRunStats {
- TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting )
- : runInfo( _runInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
- virtual ~TestRunStats();
-
-# ifndef CATCH_CONFIG_CPP11_GENERATED_METHODS
- TestRunStats( TestRunStats const& _other )
- : runInfo( _other.runInfo ),
- totals( _other.totals ),
- aborting( _other.aborting )
- {}
-# else
- TestRunStats( TestRunStats const& ) = default;
- TestRunStats( TestRunStats && ) = default;
- TestRunStats& operator = ( TestRunStats const& ) = default;
- TestRunStats& operator = ( TestRunStats && ) = default;
-# endif
-
- TestRunInfo runInfo;
- Totals totals;
- bool aborting;
- };
-
- struct IStreamingReporter : IShared {
- virtual ~IStreamingReporter();
-
- // Implementing class must also provide the following static method:
- // static std::string getDescription();
-
- virtual ReporterPreferences getPreferences() const = 0;
-
- virtual void noMatchingTestCases( std::string const& spec ) = 0;
-
- virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
- virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0;
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
- virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
-
- virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
-
- // The return value indicates if the messages buffer should be cleared:
- virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
-
- virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
- virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
-
- virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
- };
-
- struct IReporterFactory : IShared {
- virtual ~IReporterFactory();
- virtual IStreamingReporter* create( ReporterConfig const& config ) const = 0;
- virtual std::string getDescription() const = 0;
- };
-
- struct IReporterRegistry {
- typedef std::map<std::string, Ptr<IReporterFactory> > FactoryMap;
- typedef std::vector<Ptr<IReporterFactory> > Listeners;
-
- virtual ~IReporterRegistry();
- virtual IStreamingReporter* create( std::string const& name, Ptr<IConfig const> const& config ) const = 0;
- virtual FactoryMap const& getFactories() const = 0;
- virtual Listeners const& getListeners() const = 0;
- };
-
- Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingReporter, Ptr<IStreamingReporter> const& additionalReporter );
-
-}
-
-#include <limits>
-#include <algorithm>
-
-namespace Catch {
-
- inline std::size_t listTests( Config const& config ) {
-
- TestSpec testSpec = config.testSpec();
- if( config.testSpec().hasFilters() )
- Catch::cout() << "Matching test cases:\n";
- else {
- Catch::cout() << "All available test cases:\n";
- testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
- }
-
- std::size_t matchedTests = 0;
- TextAttributes nameAttr, tagsAttr;
- nameAttr.setInitialIndent( 2 ).setIndent( 4 );
- tagsAttr.setIndent( 6 );
-
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
- it != itEnd;
- ++it ) {
- matchedTests++;
- TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
- Colour::Code colour = testCaseInfo.isHidden()
- ? Colour::SecondaryText
- : Colour::None;
- Colour colourGuard( colour );
-
- Catch::cout() << Text( testCaseInfo.name, nameAttr ) << std::endl;
- if( !testCaseInfo.tags.empty() )
- Catch::cout() << Text( testCaseInfo.tagsAsString, tagsAttr ) << std::endl;
- }
-
- if( !config.testSpec().hasFilters() )
- Catch::cout() << pluralise( matchedTests, "test case" ) << "\n" << std::endl;
- else
- Catch::cout() << pluralise( matchedTests, "matching test case" ) << "\n" << std::endl;
- return matchedTests;
- }
-
- inline std::size_t listTestsNamesOnly( Config const& config ) {
- TestSpec testSpec = config.testSpec();
- if( !config.testSpec().hasFilters() )
- testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
- std::size_t matchedTests = 0;
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
- it != itEnd;
- ++it ) {
- matchedTests++;
- TestCaseInfo const& testCaseInfo = it->getTestCaseInfo();
- Catch::cout() << testCaseInfo.name << std::endl;
- }
- return matchedTests;
- }
-
- struct TagInfo {
- TagInfo() : count ( 0 ) {}
- void add( std::string const& spelling ) {
- ++count;
- spellings.insert( spelling );
- }
- std::string all() const {
- std::string out;
- for( std::set<std::string>::const_iterator it = spellings.begin(), itEnd = spellings.end();
- it != itEnd;
- ++it )
- out += "[" + *it + "]";
- return out;
- }
- std::set<std::string> spellings;
- std::size_t count;
- };
-
- inline std::size_t listTags( Config const& config ) {
- TestSpec testSpec = config.testSpec();
- if( config.testSpec().hasFilters() )
- Catch::cout() << "Tags for matching test cases:\n";
- else {
- Catch::cout() << "All available tags:\n";
- testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "*" ).testSpec();
- }
-
- std::map<std::string, TagInfo> tagCounts;
-
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( std::vector<TestCase>::const_iterator it = matchedTestCases.begin(), itEnd = matchedTestCases.end();
- it != itEnd;
- ++it ) {
- for( std::set<std::string>::const_iterator tagIt = it->getTestCaseInfo().tags.begin(),
- tagItEnd = it->getTestCaseInfo().tags.end();
- tagIt != tagItEnd;
- ++tagIt ) {
- std::string tagName = *tagIt;
- std::string lcaseTagName = toLower( tagName );
- std::map<std::string, TagInfo>::iterator countIt = tagCounts.find( lcaseTagName );
- if( countIt == tagCounts.end() )
- countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first;
- countIt->second.add( tagName );
- }
- }
-
- for( std::map<std::string, TagInfo>::const_iterator countIt = tagCounts.begin(),
- countItEnd = tagCounts.end();
- countIt != countItEnd;
- ++countIt ) {
- std::ostringstream oss;
- oss << " " << std::setw(2) << countIt->second.count << " ";
- Text wrapper( countIt->second.all(), TextAttributes()
- .setInitialIndent( 0 )
- .setIndent( oss.str().size() )
- .setWidth( CATCH_CONFIG_CONSOLE_WIDTH-10 ) );
- Catch::cout() << oss.str() << wrapper << "\n";
- }
- Catch::cout() << pluralise( tagCounts.size(), "tag" ) << "\n" << std::endl;
- return tagCounts.size();
- }
-
- inline std::size_t listReporters( Config const& /*config*/ ) {
- Catch::cout() << "Available reporters:\n";
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
- IReporterRegistry::FactoryMap::const_iterator itBegin = factories.begin(), itEnd = factories.end(), it;
- std::size_t maxNameLen = 0;
- for(it = itBegin; it != itEnd; ++it )
- maxNameLen = (std::max)( maxNameLen, it->first.size() );
-
- for(it = itBegin; it != itEnd; ++it ) {
- Text wrapper( it->second->getDescription(), TextAttributes()
- .setInitialIndent( 0 )
- .setIndent( 7+maxNameLen )
- .setWidth( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 ) );
- Catch::cout() << " "
- << it->first
- << ":"
- << std::string( maxNameLen - it->first.size() + 2, ' ' )
- << wrapper << "\n";
- }
- Catch::cout() << std::endl;
- return factories.size();
- }
-
- inline Option<std::size_t> list( Config const& config ) {
- Option<std::size_t> listedCount;
- if( config.listTests() )
- listedCount = listedCount.valueOr(0) + listTests( config );
- if( config.listTestNamesOnly() )
- listedCount = listedCount.valueOr(0) + listTestsNamesOnly( config );
- if( config.listTags() )
- listedCount = listedCount.valueOr(0) + listTags( config );
- if( config.listReporters() )
- listedCount = listedCount.valueOr(0) + listReporters( config );
- return listedCount;
- }
-
-} // end namespace Catch
-
-// #included from: internal/catch_run_context.hpp
-#define TWOBLUECUBES_CATCH_RUNNER_IMPL_HPP_INCLUDED
-
-// #included from: catch_test_case_tracker.hpp
-#define TWOBLUECUBES_CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
-
-#include <map>
-#include <string>
-#include <assert.h>
-#include <vector>
-
-namespace Catch {
-namespace TestCaseTracking {
-
- struct ITracker : SharedImpl<> {
- virtual ~ITracker();
-
- // static queries
- virtual std::string name() const = 0;
-
- // dynamic queries
- virtual bool isComplete() const = 0; // Successfully completed or failed
- virtual bool isSuccessfullyCompleted() const = 0;
- virtual bool isOpen() const = 0; // Started but not complete
- virtual bool hasChildren() const = 0;
-
- virtual ITracker& parent() = 0;
-
- // actions
- virtual void close() = 0; // Successfully complete
- virtual void fail() = 0;
- virtual void markAsNeedingAnotherRun() = 0;
-
- virtual void addChild( Ptr<ITracker> const& child ) = 0;
- virtual ITracker* findChild( std::string const& name ) = 0;
- virtual void openChild() = 0;
- };
-
- class TrackerContext {
-
- enum RunState {
- NotStarted,
- Executing,
- CompletedCycle
- };
-
- Ptr<ITracker> m_rootTracker;
- ITracker* m_currentTracker;
- RunState m_runState;
-
- public:
-
- static TrackerContext& instance() {
- static TrackerContext s_instance;
- return s_instance;
- }
-
- TrackerContext()
- : m_currentTracker( CATCH_NULL ),
- m_runState( NotStarted )
- {}
-
- ITracker& startRun();
-
- void endRun() {
- m_rootTracker.reset();
- m_currentTracker = CATCH_NULL;
- m_runState = NotStarted;
- }
-
- void startCycle() {
- m_currentTracker = m_rootTracker.get();
- m_runState = Executing;
- }
- void completeCycle() {
- m_runState = CompletedCycle;
- }
-
- bool completedCycle() const {
- return m_runState == CompletedCycle;
- }
- ITracker& currentTracker() {
- return *m_currentTracker;
- }
- void setCurrentTracker( ITracker* tracker ) {
- m_currentTracker = tracker;
- }
- };
-
- class TrackerBase : public ITracker {
- protected:
- enum CycleState {
- NotStarted,
- Executing,
- ExecutingChildren,
- NeedsAnotherRun,
- CompletedSuccessfully,
- Failed
- };
- class TrackerHasName {
- std::string m_name;
- public:
- TrackerHasName( std::string const& name ) : m_name( name ) {}
- bool operator ()( Ptr<ITracker> const& tracker ) {
- return tracker->name() == m_name;
- }
- };
- typedef std::vector<Ptr<ITracker> > Children;
- std::string m_name;
- TrackerContext& m_ctx;
- ITracker* m_parent;
- Children m_children;
- CycleState m_runState;
- public:
- TrackerBase( std::string const& name, TrackerContext& ctx, ITracker* parent )
- : m_name( name ),
- m_ctx( ctx ),
- m_parent( parent ),
- m_runState( NotStarted )
- {}
- virtual ~TrackerBase();
-
- virtual std::string name() const CATCH_OVERRIDE {
- return m_name;
- }
- virtual bool isComplete() const CATCH_OVERRIDE {
- return m_runState == CompletedSuccessfully || m_runState == Failed;
- }
- virtual bool isSuccessfullyCompleted() const CATCH_OVERRIDE {
- return m_runState == CompletedSuccessfully;
- }
- virtual bool isOpen() const CATCH_OVERRIDE {
- return m_runState != NotStarted && !isComplete();
- }
- virtual bool hasChildren() const CATCH_OVERRIDE {
- return !m_children.empty();
- }
-
- virtual void addChild( Ptr<ITracker> const& child ) CATCH_OVERRIDE {
- m_children.push_back( child );
- }
-
- virtual ITracker* findChild( std::string const& name ) CATCH_OVERRIDE {
- Children::const_iterator it = std::find_if( m_children.begin(), m_children.end(), TrackerHasName( name ) );
- return( it != m_children.end() )
- ? it->get()
- : CATCH_NULL;
- }
- virtual ITracker& parent() CATCH_OVERRIDE {
- assert( m_parent ); // Should always be non-null except for root
- return *m_parent;
- }
-
- virtual void openChild() CATCH_OVERRIDE {
- if( m_runState != ExecutingChildren ) {
- m_runState = ExecutingChildren;
- if( m_parent )
- m_parent->openChild();
- }
- }
- void open() {
- m_runState = Executing;
- moveToThis();
- if( m_parent )
- m_parent->openChild();
- }
-
- virtual void close() CATCH_OVERRIDE {
-
- // Close any still open children (e.g. generators)
- while( &m_ctx.currentTracker() != this )
- m_ctx.currentTracker().close();
-
- switch( m_runState ) {
- case NotStarted:
- case CompletedSuccessfully:
- case Failed:
- throw std::logic_error( "Illogical state" );
-
- case NeedsAnotherRun:
- break;;
-
- case Executing:
- m_runState = CompletedSuccessfully;
- break;
- case ExecutingChildren:
- if( m_children.empty() || m_children.back()->isComplete() )
- m_runState = CompletedSuccessfully;
- break;
-
- default:
- throw std::logic_error( "Unexpected state" );
- }
- moveToParent();
- m_ctx.completeCycle();
- }
- virtual void fail() CATCH_OVERRIDE {
- m_runState = Failed;
- if( m_parent )
- m_parent->markAsNeedingAnotherRun();
- moveToParent();
- m_ctx.completeCycle();
- }
- virtual void markAsNeedingAnotherRun() CATCH_OVERRIDE {
- m_runState = NeedsAnotherRun;
- }
- private:
- void moveToParent() {
- assert( m_parent );
- m_ctx.setCurrentTracker( m_parent );
- }
- void moveToThis() {
- m_ctx.setCurrentTracker( this );
- }
- };
-
- class SectionTracker : public TrackerBase {
- public:
- SectionTracker( std::string const& name, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( name, ctx, parent )
- {}
- virtual ~SectionTracker();
-
- static SectionTracker& acquire( TrackerContext& ctx, std::string const& name ) {
- SectionTracker* section = CATCH_NULL;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( ITracker* childTracker = currentTracker.findChild( name ) ) {
- section = dynamic_cast<SectionTracker*>( childTracker );
- assert( section );
- }
- else {
- section = new SectionTracker( name, ctx, &currentTracker );
- currentTracker.addChild( section );
- }
- if( !ctx.completedCycle() && !section->isComplete() ) {
-
- section->open();
- }
- return *section;
- }
- };
-
- class IndexTracker : public TrackerBase {
- int m_size;
- int m_index;
- public:
- IndexTracker( std::string const& name, TrackerContext& ctx, ITracker* parent, int size )
- : TrackerBase( name, ctx, parent ),
- m_size( size ),
- m_index( -1 )
- {}
- virtual ~IndexTracker();
-
- static IndexTracker& acquire( TrackerContext& ctx, std::string const& name, int size ) {
- IndexTracker* tracker = CATCH_NULL;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( ITracker* childTracker = currentTracker.findChild( name ) ) {
- tracker = dynamic_cast<IndexTracker*>( childTracker );
- assert( tracker );
- }
- else {
- tracker = new IndexTracker( name, ctx, &currentTracker, size );
- currentTracker.addChild( tracker );
- }
-
- if( !ctx.completedCycle() && !tracker->isComplete() ) {
- if( tracker->m_runState != ExecutingChildren && tracker->m_runState != NeedsAnotherRun )
- tracker->moveNext();
- tracker->open();
- }
-
- return *tracker;
- }
-
- int index() const { return m_index; }
-
- void moveNext() {
- m_index++;
- m_children.clear();
- }
-
- virtual void close() CATCH_OVERRIDE {
- TrackerBase::close();
- if( m_runState == CompletedSuccessfully && m_index < m_size-1 )
- m_runState = Executing;
- }
- };
-
- inline ITracker& TrackerContext::startRun() {
- m_rootTracker = new SectionTracker( "{root}", *this, CATCH_NULL );
- m_currentTracker = CATCH_NULL;
- m_runState = Executing;
- return *m_rootTracker;
- }
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-using TestCaseTracking::IndexTracker;
-
-} // namespace Catch
-
-// #included from: catch_fatal_condition.hpp
-#define TWOBLUECUBES_CATCH_FATAL_CONDITION_H_INCLUDED
-
-namespace Catch {
-
- // Report the error condition then exit the process
- inline void fatal( std::string const& message, int exitCode ) {
- IContext& context = Catch::getCurrentContext();
- IResultCapture* resultCapture = context.getResultCapture();
- resultCapture->handleFatalErrorCondition( message );
-
- if( Catch::alwaysTrue() ) // avoids "no return" warnings
- exit( exitCode );
- }
-
-} // namespace Catch
-
-#if defined ( CATCH_PLATFORM_WINDOWS ) /////////////////////////////////////////
-
-namespace Catch {
-
- struct FatalConditionHandler {
- void reset() {}
- };
-
-} // namespace Catch
-
-#else // Not Windows - assumed to be POSIX compatible //////////////////////////
-
-#include <signal.h>
-
-namespace Catch {
-
- struct SignalDefs { int id; const char* name; };
- extern SignalDefs signalDefs[];
- SignalDefs signalDefs[] = {
- { SIGINT, "SIGINT - Terminal interrupt signal" },
- { SIGILL, "SIGILL - Illegal instruction signal" },
- { SIGFPE, "SIGFPE - Floating point error signal" },
- { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
- { SIGTERM, "SIGTERM - Termination request signal" },
- { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
- };
-
- struct FatalConditionHandler {
-
- static void handleSignal( int sig ) {
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
- if( sig == signalDefs[i].id )
- fatal( signalDefs[i].name, -sig );
- fatal( "<unknown signal>", -sig );
- }
-
- FatalConditionHandler() : m_isSet( true ) {
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
- signal( signalDefs[i].id, handleSignal );
- }
- ~FatalConditionHandler() {
- reset();
- }
- void reset() {
- if( m_isSet ) {
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i )
- signal( signalDefs[i].id, SIG_DFL );
- m_isSet = false;
- }
- }
-
- bool m_isSet;
- };
-
-} // namespace Catch
-
-#endif // not Windows
-
-#include <set>
-#include <string>
-
-namespace Catch {
-
- class StreamRedirect {
-
- public:
- StreamRedirect( std::ostream& stream, std::string& targetString )
- : m_stream( stream ),
- m_prevBuf( stream.rdbuf() ),
- m_targetString( targetString )
- {
- stream.rdbuf( m_oss.rdbuf() );
- }
-
- ~StreamRedirect() {
- m_targetString += m_oss.str();
- m_stream.rdbuf( m_prevBuf );
- }
-
- private:
- std::ostream& m_stream;
- std::streambuf* m_prevBuf;
- std::ostringstream m_oss;
- std::string& m_targetString;
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class RunContext : public IResultCapture, public IRunner {
-
- RunContext( RunContext const& );
- void operator =( RunContext const& );
-
- public:
-
- explicit RunContext( Ptr<IConfig const> const& _config, Ptr<IStreamingReporter> const& reporter )
- : m_runInfo( _config->name() ),
- m_context( getCurrentMutableContext() ),
- m_activeTestCase( CATCH_NULL ),
- m_config( _config ),
- m_reporter( reporter )
- {
- m_context.setRunner( this );
- m_context.setConfig( m_config );
- m_context.setResultCapture( this );
- m_reporter->testRunStarting( m_runInfo );
- }
-
- virtual ~RunContext() {
- m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, aborting() ) );
- }
-
- void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount ) {
- m_reporter->testGroupStarting( GroupInfo( testSpec, groupIndex, groupsCount ) );
- }
- void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount ) {
- m_reporter->testGroupEnded( TestGroupStats( GroupInfo( testSpec, groupIndex, groupsCount ), totals, aborting() ) );
- }
-
- Totals runTest( TestCase const& testCase ) {
- Totals prevTotals = m_totals;
-
- std::string redirectedCout;
- std::string redirectedCerr;
-
- TestCaseInfo testInfo = testCase.getTestCaseInfo();
-
- m_reporter->testCaseStarting( testInfo );
-
- m_activeTestCase = &testCase;
-
- do {
- m_trackerContext.startRun();
- do {
- m_trackerContext.startCycle();
- m_testCaseTracker = &SectionTracker::acquire( m_trackerContext, testInfo.name );
- runCurrentTest( redirectedCout, redirectedCerr );
- }
- while( !m_testCaseTracker->isSuccessfullyCompleted() && !aborting() );
- }
- // !TBD: deprecated - this will be replaced by indexed trackers
- while( getCurrentContext().advanceGeneratorsForCurrentTest() && !aborting() );
-
- Totals deltaTotals = m_totals.delta( prevTotals );
- if( testInfo.expectedToFail() && deltaTotals.testCases.passed > 0 ) {
- deltaTotals.assertions.failed++;
- deltaTotals.testCases.passed--;
- deltaTotals.testCases.failed++;
- }
- m_totals.testCases += deltaTotals.testCases;
- m_reporter->testCaseEnded( TestCaseStats( testInfo,
- deltaTotals,
- redirectedCout,
- redirectedCerr,
- aborting() ) );
-
- m_activeTestCase = CATCH_NULL;
- m_testCaseTracker = CATCH_NULL;
-
- return deltaTotals;
- }
-
- Ptr<IConfig const> config() const {
- return m_config;
- }
-
- private: // IResultCapture
-
- virtual void assertionEnded( AssertionResult const& result ) {
- if( result.getResultType() == ResultWas::Ok ) {
- m_totals.assertions.passed++;
- }
- else if( !result.isOk() ) {
- m_totals.assertions.failed++;
- }
-
- if( m_reporter->assertionEnded( AssertionStats( result, m_messages, m_totals ) ) )
- m_messages.clear();
-
- // Reset working state
- m_lastAssertionInfo = AssertionInfo( "", m_lastAssertionInfo.lineInfo, "{Unknown expression after the reported line}" , m_lastAssertionInfo.resultDisposition );
- m_lastResult = result;
- }
-
- virtual bool sectionStarted (
- SectionInfo const& sectionInfo,
- Counts& assertions
- )
- {
- std::ostringstream oss;
- oss << sectionInfo.name << "@" << sectionInfo.lineInfo;
-
- ITracker& sectionTracker = SectionTracker::acquire( m_trackerContext, oss.str() );
- if( !sectionTracker.isOpen() )
- return false;
- m_activeSections.push_back( &sectionTracker );
-
- m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
-
- m_reporter->sectionStarting( sectionInfo );
-
- assertions = m_totals.assertions;
-
- return true;
- }
- bool testForMissingAssertions( Counts& assertions ) {
- if( assertions.total() != 0 )
- return false;
- if( !m_config->warnAboutMissingAssertions() )
- return false;
- if( m_trackerContext.currentTracker().hasChildren() )
- return false;
- m_totals.assertions.failed++;
- assertions.failed++;
- return true;
- }
-
- virtual void sectionEnded( SectionEndInfo const& endInfo ) {
- Counts assertions = m_totals.assertions - endInfo.prevAssertions;
- bool missingAssertions = testForMissingAssertions( assertions );
-
- if( !m_activeSections.empty() ) {
- m_activeSections.back()->close();
- m_activeSections.pop_back();
- }
-
- m_reporter->sectionEnded( SectionStats( endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions ) );
- m_messages.clear();
- }
-
- virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) {
- if( m_unfinishedSections.empty() )
- m_activeSections.back()->fail();
- else
- m_activeSections.back()->close();
- m_activeSections.pop_back();
-
- m_unfinishedSections.push_back( endInfo );
- }
-
- virtual void pushScopedMessage( MessageInfo const& message ) {
- m_messages.push_back( message );
- }
-
- virtual void popScopedMessage( MessageInfo const& message ) {
- m_messages.erase( std::remove( m_messages.begin(), m_messages.end(), message ), m_messages.end() );
- }
-
- virtual std::string getCurrentTestName() const {
- return m_activeTestCase
- ? m_activeTestCase->getTestCaseInfo().name
- : "";
- }
-
- virtual const AssertionResult* getLastResult() const {
- return &m_lastResult;
- }
-
- virtual void handleFatalErrorCondition( std::string const& message ) {
- ResultBuilder resultBuilder = makeUnexpectedResultBuilder();
- resultBuilder.setResultType( ResultWas::FatalErrorCondition );
- resultBuilder << message;
- resultBuilder.captureExpression();
-
- handleUnfinishedSections();
-
- // Recreate section for test case (as we will lose the one that was in scope)
- TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description );
-
- Counts assertions;
- assertions.failed = 1;
- SectionStats testCaseSectionStats( testCaseSection, assertions, 0, false );
- m_reporter->sectionEnded( testCaseSectionStats );
-
- TestCaseInfo testInfo = m_activeTestCase->getTestCaseInfo();
-
- Totals deltaTotals;
- deltaTotals.testCases.failed = 1;
- m_reporter->testCaseEnded( TestCaseStats( testInfo,
- deltaTotals,
- "",
- "",
- false ) );
- m_totals.testCases.failed++;
- testGroupEnded( "", m_totals, 1, 1 );
- m_reporter->testRunEnded( TestRunStats( m_runInfo, m_totals, false ) );
- }
-
- public:
- // !TBD We need to do this another way!
- bool aborting() const {
- return m_totals.assertions.failed == static_cast<std::size_t>( m_config->abortAfter() );
- }
-
- private:
-
- void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr ) {
- TestCaseInfo const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection( testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description );
- m_reporter->sectionStarting( testCaseSection );
- Counts prevAssertions = m_totals.assertions;
- double duration = 0;
- try {
- m_lastAssertionInfo = AssertionInfo( "TEST_CASE", testCaseInfo.lineInfo, "", ResultDisposition::Normal );
-
- seedRng( *m_config );
-
- Timer timer;
- timer.start();
- if( m_reporter->getPreferences().shouldRedirectStdOut ) {
- StreamRedirect coutRedir( Catch::cout(), redirectedCout );
- StreamRedirect cerrRedir( Catch::cerr(), redirectedCerr );
- invokeActiveTestCase();
- }
- else {
- invokeActiveTestCase();
- }
- duration = timer.getElapsedSeconds();
- }
- catch( TestFailureException& ) {
- // This just means the test was aborted due to failure
- }
- catch(...) {
- makeUnexpectedResultBuilder().useActiveException();
- }
- m_testCaseTracker->close();
- handleUnfinishedSections();
- m_messages.clear();
-
- Counts assertions = m_totals.assertions - prevAssertions;
- bool missingAssertions = testForMissingAssertions( assertions );
-
- if( testCaseInfo.okToFail() ) {
- std::swap( assertions.failedButOk, assertions.failed );
- m_totals.assertions.failed -= assertions.failedButOk;
- m_totals.assertions.failedButOk += assertions.failedButOk;
- }
-
- SectionStats testCaseSectionStats( testCaseSection, assertions, duration, missingAssertions );
- m_reporter->sectionEnded( testCaseSectionStats );
- }
-
- void invokeActiveTestCase() {
- FatalConditionHandler fatalConditionHandler; // Handle signals
- m_activeTestCase->invoke();
- fatalConditionHandler.reset();
- }
-
- private:
-
- ResultBuilder makeUnexpectedResultBuilder() const {
- return ResultBuilder( m_lastAssertionInfo.macroName.c_str(),
- m_lastAssertionInfo.lineInfo,
- m_lastAssertionInfo.capturedExpression.c_str(),
- m_lastAssertionInfo.resultDisposition );
- }
-
- void handleUnfinishedSections() {
- // If sections ended prematurely due to an exception we stored their
- // infos here so we can tear them down outside the unwind process.
- for( std::vector<SectionEndInfo>::const_reverse_iterator it = m_unfinishedSections.rbegin(),
- itEnd = m_unfinishedSections.rend();
- it != itEnd;
- ++it )
- sectionEnded( *it );
- m_unfinishedSections.clear();
- }
-
- TestRunInfo m_runInfo;
- IMutableContext& m_context;
- TestCase const* m_activeTestCase;
- ITracker* m_testCaseTracker;
- ITracker* m_currentSectionTracker;
- AssertionResult m_lastResult;
-
- Ptr<IConfig const> m_config;
- Totals m_totals;
- Ptr<IStreamingReporter> m_reporter;
- std::vector<MessageInfo> m_messages;
- AssertionInfo m_lastAssertionInfo;
- std::vector<SectionEndInfo> m_unfinishedSections;
- std::vector<ITracker*> m_activeSections;
- TrackerContext m_trackerContext;
- };
-
- IResultCapture& getResultCapture() {
- if( IResultCapture* capture = getCurrentContext().getResultCapture() )
- return *capture;
- else
- throw std::logic_error( "No result capture instance" );
- }
-
-} // end namespace Catch
-
-// #included from: internal/catch_version.h
-#define TWOBLUECUBES_CATCH_VERSION_H_INCLUDED
-
-namespace Catch {
-
- // Versioning information
- struct Version {
- Version( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- std::string const& _branchName,
- unsigned int _buildNumber );
-
- unsigned int const majorVersion;
- unsigned int const minorVersion;
- unsigned int const patchNumber;
-
- // buildNumber is only used if branchName is not null
- std::string const branchName;
- unsigned int const buildNumber;
-
- friend std::ostream& operator << ( std::ostream& os, Version const& version );
-
- private:
- void operator=( Version const& );
- };
-
- extern Version libraryVersion;
-}
-
-#include <fstream>
-#include <stdlib.h>
-#include <limits>
-
-namespace Catch {
-
- Ptr<IStreamingReporter> createReporter( std::string const& reporterName, Ptr<Config> const& config ) {
- Ptr<IStreamingReporter> reporter = getRegistryHub().getReporterRegistry().create( reporterName, config.get() );
- if( !reporter ) {
- std::ostringstream oss;
- oss << "No reporter registered with name: '" << reporterName << "'";
- throw std::domain_error( oss.str() );
- }
- return reporter;
- }
-
- Ptr<IStreamingReporter> makeReporter( Ptr<Config> const& config ) {
- std::vector<std::string> reporters = config->getReporterNames();
- if( reporters.empty() )
- reporters.push_back( "console" );
-
- Ptr<IStreamingReporter> reporter;
- for( std::vector<std::string>::const_iterator it = reporters.begin(), itEnd = reporters.end();
- it != itEnd;
- ++it )
- reporter = addReporter( reporter, createReporter( *it, config ) );
- return reporter;
- }
- Ptr<IStreamingReporter> addListeners( Ptr<IConfig const> const& config, Ptr<IStreamingReporter> reporters ) {
- IReporterRegistry::Listeners listeners = getRegistryHub().getReporterRegistry().getListeners();
- for( IReporterRegistry::Listeners::const_iterator it = listeners.begin(), itEnd = listeners.end();
- it != itEnd;
- ++it )
- reporters = addReporter(reporters, (*it)->create( ReporterConfig( config ) ) );
- return reporters;
- }
-
- Totals runTests( Ptr<Config> const& config ) {
-
- Ptr<IConfig const> iconfig = config.get();
-
- Ptr<IStreamingReporter> reporter = makeReporter( config );
- reporter = addListeners( iconfig, reporter );
-
- RunContext context( iconfig, reporter );
-
- Totals totals;
-
- context.testGroupStarting( config->name(), 1, 1 );
-
- TestSpec testSpec = config->testSpec();
- if( !testSpec.hasFilters() )
- testSpec = TestSpecParser( ITagAliasRegistry::get() ).parse( "~[.]" ).testSpec(); // All not hidden tests
-
- std::vector<TestCase> const& allTestCases = getAllTestCasesSorted( *iconfig );
- for( std::vector<TestCase>::const_iterator it = allTestCases.begin(), itEnd = allTestCases.end();
- it != itEnd;
- ++it ) {
- if( !context.aborting() && matchTest( *it, testSpec, *iconfig ) )
- totals += context.runTest( *it );
- else
- reporter->skipTest( *it );
- }
-
- context.testGroupEnded( iconfig->name(), totals, 1, 1 );
- return totals;
- }
-
- void applyFilenamesAsTags( IConfig const& config ) {
- std::vector<TestCase> const& tests = getAllTestCasesSorted( config );
- for(std::size_t i = 0; i < tests.size(); ++i ) {
- TestCase& test = const_cast<TestCase&>( tests[i] );
- std::set<std::string> tags = test.tags;
-
- std::string filename = test.lineInfo.file;
- std::string::size_type lastSlash = filename.find_last_of( "\\/" );
- if( lastSlash != std::string::npos )
- filename = filename.substr( lastSlash+1 );
-
- std::string::size_type lastDot = filename.find_last_of( "." );
- if( lastDot != std::string::npos )
- filename = filename.substr( 0, lastDot );
-
- tags.insert( "#" + filename );
- setTags( test, tags );
- }
- }
-
- class Session : NonCopyable {
- static bool alreadyInstantiated;
-
- public:
-
- struct OnUnusedOptions { enum DoWhat { Ignore, Fail }; };
-
- Session()
- : m_cli( makeCommandLineParser() ) {
- if( alreadyInstantiated ) {
- std::string msg = "Only one instance of Catch::Session can ever be used";
- Catch::cerr() << msg << std::endl;
- throw std::logic_error( msg );
- }
- alreadyInstantiated = true;
- }
- ~Session() {
- Catch::cleanUp();
- }
-
- void showHelp( std::string const& processName ) {
- Catch::cout() << "\nCatch v" << libraryVersion << "\n";
-
- m_cli.usage( Catch::cout(), processName );
- Catch::cout() << "For more detail usage please see the project docs\n" << std::endl;
- }
-
- int applyCommandLine( int argc, char const* argv[], OnUnusedOptions::DoWhat unusedOptionBehaviour = OnUnusedOptions::Fail ) {
- try {
- m_cli.setThrowOnUnrecognisedTokens( unusedOptionBehaviour == OnUnusedOptions::Fail );
- m_unusedTokens = m_cli.parseInto( argc, argv, m_configData );
- if( m_configData.showHelp )
- showHelp( m_configData.processName );
- m_config.reset();
- }
- catch( std::exception& ex ) {
- {
- Colour colourGuard( Colour::Red );
- Catch::cerr()
- << "\nError(s) in input:\n"
- << Text( ex.what(), TextAttributes().setIndent(2) )
- << "\n\n";
- }
- m_cli.usage( Catch::cout(), m_configData.processName );
- return (std::numeric_limits<int>::max)();
- }
- return 0;
- }
-
- void useConfigData( ConfigData const& _configData ) {
- m_configData = _configData;
- m_config.reset();
- }
-
- int run( int argc, char const* argv[] ) {
-
- int returnCode = applyCommandLine( argc, argv );
- if( returnCode == 0 )
- returnCode = run();
- return returnCode;
- }
- int run( int argc, char* argv[] ) {
- return run( argc, const_cast<char const**>( argv ) );
- }
-
- int run() {
- if( m_configData.showHelp )
- return 0;
-
- try
- {
- config(); // Force config to be constructed
-
- seedRng( *m_config );
-
- if( m_configData.filenamesAsTags )
- applyFilenamesAsTags( *m_config );
-
- // Handle list request
- if( Option<std::size_t> listed = list( config() ) )
- return static_cast<int>( *listed );
-
- return static_cast<int>( runTests( m_config ).assertions.failed );
- }
- catch( std::exception& ex ) {
- Catch::cerr() << ex.what() << std::endl;
- return (std::numeric_limits<int>::max)();
- }
- }
-
- Clara::CommandLine<ConfigData> const& cli() const {
- return m_cli;
- }
- std::vector<Clara::Parser::Token> const& unusedTokens() const {
- return m_unusedTokens;
- }
- ConfigData& configData() {
- return m_configData;
- }
- Config& config() {
- if( !m_config )
- m_config = new Config( m_configData );
- return *m_config;
- }
- private:
- Clara::CommandLine<ConfigData> m_cli;
- std::vector<Clara::Parser::Token> m_unusedTokens;
- ConfigData m_configData;
- Ptr<Config> m_config;
- };
-
- bool Session::alreadyInstantiated = false;
-
-} // end namespace Catch
-
-// #included from: catch_registry_hub.hpp
-#define TWOBLUECUBES_CATCH_REGISTRY_HUB_HPP_INCLUDED
-
-// #included from: catch_test_case_registry_impl.hpp
-#define TWOBLUECUBES_CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
-
-#include <vector>
-#include <set>
-#include <sstream>
-#include <iostream>
-#include <algorithm>
-
-namespace Catch {
-
- struct LexSort {
- bool operator() (TestCase i,TestCase j) const { return (i<j);}
- };
- struct RandomNumberGenerator {
- int operator()( int n ) const { return std::rand() % n; }
- };
-
- inline std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
-
- std::vector<TestCase> sorted = unsortedTestCases;
-
- switch( config.runOrder() ) {
- case RunTests::InLexicographicalOrder:
- std::sort( sorted.begin(), sorted.end(), LexSort() );
- break;
- case RunTests::InRandomOrder:
- {
- seedRng( config );
-
- RandomNumberGenerator rng;
- std::random_shuffle( sorted.begin(), sorted.end(), rng );
- }
- break;
- case RunTests::InDeclarationOrder:
- // already in declaration order
- break;
- }
- return sorted;
- }
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
- return testSpec.matches( testCase ) && ( config.allowThrows() || !testCase.throws() );
- }
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
- std::set<TestCase> seenFunctions;
- for( std::vector<TestCase>::const_iterator it = functions.begin(), itEnd = functions.end();
- it != itEnd;
- ++it ) {
- std::pair<std::set<TestCase>::const_iterator, bool> prev = seenFunctions.insert( *it );
- if( !prev.second ){
- Catch::cerr()
- << Colour( Colour::Red )
- << "error: TEST_CASE( \"" << it->name << "\" ) already defined.\n"
- << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
- << "\tRedefined at " << it->getTestCaseInfo().lineInfo << std::endl;
- exit(1);
- }
- }
- }
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config ) {
- std::vector<TestCase> filtered;
- filtered.reserve( testCases.size() );
- for( std::vector<TestCase>::const_iterator it = testCases.begin(), itEnd = testCases.end();
- it != itEnd;
- ++it )
- if( matchTest( *it, testSpec, config ) )
- filtered.push_back( *it );
- return filtered;
- }
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config ) {
- return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
- }
-
- class TestRegistry : public ITestCaseRegistry {
- public:
- TestRegistry()
- : m_currentSortOrder( RunTests::InDeclarationOrder ),
- m_unnamedCount( 0 )
- {}
- virtual ~TestRegistry();
-
- virtual void registerTest( TestCase const& testCase ) {
- std::string name = testCase.getTestCaseInfo().name;
- if( name == "" ) {
- std::ostringstream oss;
- oss << "Anonymous test case " << ++m_unnamedCount;
- return registerTest( testCase.withName( oss.str() ) );
- }
- m_functions.push_back( testCase );
- }
-
- virtual std::vector<TestCase> const& getAllTests() const {
- return m_functions;
- }
- virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const {
- if( m_sortedFunctions.empty() )
- enforceNoDuplicateTestCases( m_functions );
-
- if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
- m_sortedFunctions = sortTests( config, m_functions );
- m_currentSortOrder = config.runOrder();
- }
- return m_sortedFunctions;
- }
-
- private:
- std::vector<TestCase> m_functions;
- mutable RunTests::InWhatOrder m_currentSortOrder;
- mutable std::vector<TestCase> m_sortedFunctions;
- size_t m_unnamedCount;
- std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class FreeFunctionTestCase : public SharedImpl<ITestCase> {
- public:
-
- FreeFunctionTestCase( TestFunction fun ) : m_fun( fun ) {}
-
- virtual void invoke() const {
- m_fun();
- }
-
- private:
- virtual ~FreeFunctionTestCase();
-
- TestFunction m_fun;
- };
-
- inline std::string extractClassName( std::string const& classOrQualifiedMethodName ) {
- std::string className = classOrQualifiedMethodName;
- if( startsWith( className, "&" ) )
- {
- std::size_t lastColons = className.rfind( "::" );
- std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
- if( penultimateColons == std::string::npos )
- penultimateColons = 1;
- className = className.substr( penultimateColons, lastColons-penultimateColons );
- }
- return className;
- }
-
- void registerTestCase
- ( ITestCase* testCase,
- char const* classOrQualifiedMethodName,
- NameAndDesc const& nameAndDesc,
- SourceLineInfo const& lineInfo ) {
-
- getMutableRegistryHub().registerTest
- ( makeTestCase
- ( testCase,
- extractClassName( classOrQualifiedMethodName ),
- nameAndDesc.name,
- nameAndDesc.description,
- lineInfo ) );
- }
- void registerTestCaseFunction
- ( TestFunction function,
- SourceLineInfo const& lineInfo,
- NameAndDesc const& nameAndDesc ) {
- registerTestCase( new FreeFunctionTestCase( function ), "", nameAndDesc, lineInfo );
- }
-
- ///////////////////////////////////////////////////////////////////////////
-
- AutoReg::AutoReg
- ( TestFunction function,
- SourceLineInfo const& lineInfo,
- NameAndDesc const& nameAndDesc ) {
- registerTestCaseFunction( function, lineInfo, nameAndDesc );
- }
-
- AutoReg::~AutoReg() {}
-
-} // end namespace Catch
-
-// #included from: catch_reporter_registry.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRY_HPP_INCLUDED
-
-#include <map>
-
-namespace Catch {
-
- class ReporterRegistry : public IReporterRegistry {
-
- public:
-
- virtual ~ReporterRegistry() CATCH_OVERRIDE {}
-
- virtual IStreamingReporter* create( std::string const& name, Ptr<IConfig const> const& config ) const CATCH_OVERRIDE {
- FactoryMap::const_iterator it = m_factories.find( name );
- if( it == m_factories.end() )
- return CATCH_NULL;
- return it->second->create( ReporterConfig( config ) );
- }
-
- void registerReporter( std::string const& name, Ptr<IReporterFactory> const& factory ) {
- m_factories.insert( std::make_pair( name, factory ) );
- }
- void registerListener( Ptr<IReporterFactory> const& factory ) {
- m_listeners.push_back( factory );
- }
-
- virtual FactoryMap const& getFactories() const CATCH_OVERRIDE {
- return m_factories;
- }
- virtual Listeners const& getListeners() const CATCH_OVERRIDE {
- return m_listeners;
- }
-
- private:
- FactoryMap m_factories;
- Listeners m_listeners;
- };
-}
-
-// #included from: catch_exception_translator_registry.hpp
-#define TWOBLUECUBES_CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
-
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
- class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
- public:
- ~ExceptionTranslatorRegistry() {
- deleteAll( m_translators );
- }
-
- virtual void registerTranslator( const IExceptionTranslator* translator ) {
- m_translators.push_back( translator );
- }
-
- virtual std::string translateActiveException() const {
- try {
-#ifdef __OBJC__
- // In Objective-C try objective-c exceptions first
- @try {
- return tryTranslators();
- }
- @catch (NSException *exception) {
- return Catch::toString( [exception description] );
- }
-#else
- return tryTranslators();
-#endif
- }
- catch( TestFailureException& ) {
- throw;
- }
- catch( std::exception& ex ) {
- return ex.what();
- }
- catch( std::string& msg ) {
- return msg;
- }
- catch( const char* msg ) {
- return msg;
- }
- catch(...) {
- return "Unknown exception";
- }
- }
-
- std::string tryTranslators() const {
- if( m_translators.empty() )
- throw;
- else
- return m_translators[0]->translate( m_translators.begin()+1, m_translators.end() );
- }
-
- private:
- std::vector<const IExceptionTranslator*> m_translators;
- };
-}
-
-namespace Catch {
-
- namespace {
-
- class RegistryHub : public IRegistryHub, public IMutableRegistryHub {
-
- RegistryHub( RegistryHub const& );
- void operator=( RegistryHub const& );
-
- public: // IRegistryHub
- RegistryHub() {
- }
- virtual IReporterRegistry const& getReporterRegistry() const CATCH_OVERRIDE {
- return m_reporterRegistry;
- }
- virtual ITestCaseRegistry const& getTestCaseRegistry() const CATCH_OVERRIDE {
- return m_testCaseRegistry;
- }
- virtual IExceptionTranslatorRegistry& getExceptionTranslatorRegistry() CATCH_OVERRIDE {
- return m_exceptionTranslatorRegistry;
- }
-
- public: // IMutableRegistryHub
- virtual void registerReporter( std::string const& name, Ptr<IReporterFactory> const& factory ) CATCH_OVERRIDE {
- m_reporterRegistry.registerReporter( name, factory );
- }
- virtual void registerListener( Ptr<IReporterFactory> const& factory ) CATCH_OVERRIDE {
- m_reporterRegistry.registerListener( factory );
- }
- virtual void registerTest( TestCase const& testInfo ) CATCH_OVERRIDE {
- m_testCaseRegistry.registerTest( testInfo );
- }
- virtual void registerTranslator( const IExceptionTranslator* translator ) CATCH_OVERRIDE {
- m_exceptionTranslatorRegistry.registerTranslator( translator );
- }
-
- private:
- TestRegistry m_testCaseRegistry;
- ReporterRegistry m_reporterRegistry;
- ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
- };
-
- // Single, global, instance
- inline RegistryHub*& getTheRegistryHub() {
- static RegistryHub* theRegistryHub = CATCH_NULL;
- if( !theRegistryHub )
- theRegistryHub = new RegistryHub();
- return theRegistryHub;
- }
- }
-
- IRegistryHub& getRegistryHub() {
- return *getTheRegistryHub();
- }
- IMutableRegistryHub& getMutableRegistryHub() {
- return *getTheRegistryHub();
- }
- void cleanUp() {
- delete getTheRegistryHub();
- getTheRegistryHub() = CATCH_NULL;
- cleanUpContext();
- }
- std::string translateActiveException() {
- return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
- }
-
-} // end namespace Catch
-
-// #included from: catch_notimplemented_exception.hpp
-#define TWOBLUECUBES_CATCH_NOTIMPLEMENTED_EXCEPTION_HPP_INCLUDED
-
-#include <ostream>
-
-namespace Catch {
-
- NotImplementedException::NotImplementedException( SourceLineInfo const& lineInfo )
- : m_lineInfo( lineInfo ) {
- std::ostringstream oss;
- oss << lineInfo << ": function ";
- oss << "not implemented";
- m_what = oss.str();
- }
-
- const char* NotImplementedException::what() const CATCH_NOEXCEPT {
- return m_what.c_str();
- }
-
-} // end namespace Catch
-
-// #included from: catch_context_impl.hpp
-#define TWOBLUECUBES_CATCH_CONTEXT_IMPL_HPP_INCLUDED
-
-// #included from: catch_stream.hpp
-#define TWOBLUECUBES_CATCH_STREAM_HPP_INCLUDED
-
-#include <stdexcept>
-#include <cstdio>
-#include <iostream>
-
-namespace Catch {
-
- template<typename WriterF, size_t bufferSize=256>
- class StreamBufImpl : public StreamBufBase {
- char data[bufferSize];
- WriterF m_writer;
-
- public:
- StreamBufImpl() {
- setp( data, data + sizeof(data) );
- }
-
- ~StreamBufImpl() CATCH_NOEXCEPT {
- sync();
- }
-
- private:
- int overflow( int c ) {
- sync();
-
- if( c != EOF ) {
- if( pbase() == epptr() )
- m_writer( std::string( 1, static_cast<char>( c ) ) );
- else
- sputc( static_cast<char>( c ) );
- }
- return 0;
- }
-
- int sync() {
- if( pbase() != pptr() ) {
- m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
- setp( pbase(), epptr() );
- }
- return 0;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- FileStream::FileStream( std::string const& filename ) {
- m_ofs.open( filename.c_str() );
- if( m_ofs.fail() ) {
- std::ostringstream oss;
- oss << "Unable to open file: '" << filename << "'";
- throw std::domain_error( oss.str() );
- }
- }
-
- std::ostream& FileStream::stream() const {
- return m_ofs;
- }
-
- struct OutputDebugWriter {
-
- void operator()( std::string const&str ) {
- writeToDebugConsole( str );
- }
- };
-
- DebugOutStream::DebugOutStream()
- : m_streamBuf( new StreamBufImpl<OutputDebugWriter>() ),
- m_os( m_streamBuf.get() )
- {}
-
- std::ostream& DebugOutStream::stream() const {
- return m_os;
- }
-
- // Store the streambuf from cout up-front because
- // cout may get redirected when running tests
- CoutStream::CoutStream()
- : m_os( Catch::cout().rdbuf() )
- {}
-
- std::ostream& CoutStream::stream() const {
- return m_os;
- }
-
-#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions
- std::ostream& cout() {
- return std::cout;
- }
- std::ostream& cerr() {
- return std::cerr;
- }
-#endif
-}
-
-namespace Catch {
-
- class Context : public IMutableContext {
-
- Context() : m_config( CATCH_NULL ), m_runner( CATCH_NULL ), m_resultCapture( CATCH_NULL ) {}
- Context( Context const& );
- void operator=( Context const& );
-
- public: // IContext
- virtual IResultCapture* getResultCapture() {
- return m_resultCapture;
- }
- virtual IRunner* getRunner() {
- return m_runner;
- }
- virtual size_t getGeneratorIndex( std::string const& fileInfo, size_t totalSize ) {
- return getGeneratorsForCurrentTest()
- .getGeneratorInfo( fileInfo, totalSize )
- .getCurrentIndex();
- }
- virtual bool advanceGeneratorsForCurrentTest() {
- IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
- return generators && generators->moveNext();
- }
-
- virtual Ptr<IConfig const> getConfig() const {
- return m_config;
- }
-
- public: // IMutableContext
- virtual void setResultCapture( IResultCapture* resultCapture ) {
- m_resultCapture = resultCapture;
- }
- virtual void setRunner( IRunner* runner ) {
- m_runner = runner;
- }
- virtual void setConfig( Ptr<IConfig const> const& config ) {
- m_config = config;
- }
-
- friend IMutableContext& getCurrentMutableContext();
-
- private:
- IGeneratorsForTest* findGeneratorsForCurrentTest() {
- std::string testName = getResultCapture()->getCurrentTestName();
-
- std::map<std::string, IGeneratorsForTest*>::const_iterator it =
- m_generatorsByTestName.find( testName );
- return it != m_generatorsByTestName.end()
- ? it->second
- : CATCH_NULL;
- }
-
- IGeneratorsForTest& getGeneratorsForCurrentTest() {
- IGeneratorsForTest* generators = findGeneratorsForCurrentTest();
- if( !generators ) {
- std::string testName = getResultCapture()->getCurrentTestName();
- generators = createGeneratorsForTest();
- m_generatorsByTestName.insert( std::make_pair( testName, generators ) );
- }
- return *generators;
- }
-
- private:
- Ptr<IConfig const> m_config;
- IRunner* m_runner;
- IResultCapture* m_resultCapture;
- std::map<std::string, IGeneratorsForTest*> m_generatorsByTestName;
- };
-
- namespace {
- Context* currentContext = CATCH_NULL;
- }
- IMutableContext& getCurrentMutableContext() {
- if( !currentContext )
- currentContext = new Context();
- return *currentContext;
- }
- IContext& getCurrentContext() {
- return getCurrentMutableContext();
- }
-
- void cleanUpContext() {
- delete currentContext;
- currentContext = CATCH_NULL;
- }
-}
-
-// #included from: catch_console_colour_impl.hpp
-#define TWOBLUECUBES_CATCH_CONSOLE_COLOUR_IMPL_HPP_INCLUDED
-
-namespace Catch {
- namespace {
-
- struct IColourImpl {
- virtual ~IColourImpl() {}
- virtual void use( Colour::Code _colourCode ) = 0;
- };
-
- struct NoColourImpl : IColourImpl {
- void use( Colour::Code ) {}
-
- static IColourImpl* instance() {
- static NoColourImpl s_instance;
- return &s_instance;
- }
- };
-
- } // anon namespace
-} // namespace Catch
-
-#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI )
-# ifdef CATCH_PLATFORM_WINDOWS
-# define CATCH_CONFIG_COLOUR_WINDOWS
-# else
-# define CATCH_CONFIG_COLOUR_ANSI
-# endif
-#endif
-
-#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
-
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-
-#ifdef __AFXDLL
-#include <AfxWin.h>
-#else
-#include <windows.h>
-#endif
-
-namespace Catch {
-namespace {
-
- class Win32ColourImpl : public IColourImpl {
- public:
- Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
- {
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
- originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
- originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
- }
-
- virtual void use( Colour::Code _colourCode ) {
- switch( _colourCode ) {
- case Colour::None: return setTextAttribute( originalForegroundAttributes );
- case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::Red: return setTextAttribute( FOREGROUND_RED );
- case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
- case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
- case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
- case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
- case Colour::Grey: return setTextAttribute( 0 );
-
- case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
- case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
- case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
- case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
-
- case Colour::Bright: throw std::logic_error( "not a colour" );
- }
- }
-
- private:
- void setTextAttribute( WORD _textAttribute ) {
- SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
- }
- HANDLE stdoutHandle;
- WORD originalForegroundAttributes;
- WORD originalBackgroundAttributes;
- };
-
- IColourImpl* platformColourInstance() {
- static Win32ColourImpl s_instance;
-
- Ptr<IConfig const> config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = !isDebuggerActive()
- ? UseColour::Yes
- : UseColour::No;
- return colourMode == UseColour::Yes
- ? &s_instance
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
-
-#include <unistd.h>
-
-namespace Catch {
-namespace {
-
- // use POSIX/ ANSI console terminal codes
- // Thanks to Adam Strzelecki for original contribution
- // (http://github.com/nanoant)
- // https://github.com/philsquared/Catch/pull/131
- class PosixColourImpl : public IColourImpl {
- public:
- virtual void use( Colour::Code _colourCode ) {
- switch( _colourCode ) {
- case Colour::None:
- case Colour::White: return setColour( "[0m" );
- case Colour::Red: return setColour( "[0;31m" );
- case Colour::Green: return setColour( "[0;32m" );
- case Colour::Blue: return setColour( "[0:34m" );
- case Colour::Cyan: return setColour( "[0;36m" );
- case Colour::Yellow: return setColour( "[0;33m" );
- case Colour::Grey: return setColour( "[1;30m" );
-
- case Colour::LightGrey: return setColour( "[0;37m" );
- case Colour::BrightRed: return setColour( "[1;31m" );
- case Colour::BrightGreen: return setColour( "[1;32m" );
- case Colour::BrightWhite: return setColour( "[1;37m" );
-
- case Colour::Bright: throw std::logic_error( "not a colour" );
- }
- }
- static IColourImpl* instance() {
- static PosixColourImpl s_instance;
- return &s_instance;
- }
-
- private:
- void setColour( const char* _escapeCode ) {
- Catch::cout() << '\033' << _escapeCode;
- }
- };
-
- IColourImpl* platformColourInstance() {
- Ptr<IConfig const> config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = (!isDebuggerActive() && isatty(STDOUT_FILENO) )
- ? UseColour::Yes
- : UseColour::No;
- return colourMode == UseColour::Yes
- ? PosixColourImpl::instance()
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#else // not Windows or ANSI ///////////////////////////////////////////////
-
-namespace Catch {
-
- static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); }
-
-} // end namespace Catch
-
-#endif // Windows/ ANSI/ None
-
-namespace Catch {
-
- Colour::Colour( Code _colourCode ) : m_moved( false ) { use( _colourCode ); }
- Colour::Colour( Colour const& _other ) : m_moved( false ) { const_cast<Colour&>( _other ).m_moved = true; }
- Colour::~Colour(){ if( !m_moved ) use( None ); }
-
- void Colour::use( Code _colourCode ) {
- static IColourImpl* impl = platformColourInstance();
- impl->use( _colourCode );
- }
-
-} // end namespace Catch
-
-// #included from: catch_generators_impl.hpp
-#define TWOBLUECUBES_CATCH_GENERATORS_IMPL_HPP_INCLUDED
-
-#include <vector>
-#include <string>
-#include <map>
-
-namespace Catch {
-
- struct GeneratorInfo : IGeneratorInfo {
-
- GeneratorInfo( std::size_t size )
- : m_size( size ),
- m_currentIndex( 0 )
- {}
-
- bool moveNext() {
- if( ++m_currentIndex == m_size ) {
- m_currentIndex = 0;
- return false;
- }
- return true;
- }
-
- std::size_t getCurrentIndex() const {
- return m_currentIndex;
- }
-
- std::size_t m_size;
- std::size_t m_currentIndex;
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class GeneratorsForTest : public IGeneratorsForTest {
-
- public:
- ~GeneratorsForTest() {
- deleteAll( m_generatorsInOrder );
- }
-
- IGeneratorInfo& getGeneratorInfo( std::string const& fileInfo, std::size_t size ) {
- std::map<std::string, IGeneratorInfo*>::const_iterator it = m_generatorsByName.find( fileInfo );
- if( it == m_generatorsByName.end() ) {
- IGeneratorInfo* info = new GeneratorInfo( size );
- m_generatorsByName.insert( std::make_pair( fileInfo, info ) );
- m_generatorsInOrder.push_back( info );
- return *info;
- }
- return *it->second;
- }
-
- bool moveNext() {
- std::vector<IGeneratorInfo*>::const_iterator it = m_generatorsInOrder.begin();
- std::vector<IGeneratorInfo*>::const_iterator itEnd = m_generatorsInOrder.end();
- for(; it != itEnd; ++it ) {
- if( (*it)->moveNext() )
- return true;
- }
- return false;
- }
-
- private:
- std::map<std::string, IGeneratorInfo*> m_generatorsByName;
- std::vector<IGeneratorInfo*> m_generatorsInOrder;
- };
-
- IGeneratorsForTest* createGeneratorsForTest()
- {
- return new GeneratorsForTest();
- }
-
-} // end namespace Catch
-
-// #included from: catch_assertionresult.hpp
-#define TWOBLUECUBES_CATCH_ASSERTIONRESULT_HPP_INCLUDED
-
-namespace Catch {
-
- AssertionInfo::AssertionInfo( std::string const& _macroName,
- SourceLineInfo const& _lineInfo,
- std::string const& _capturedExpression,
- ResultDisposition::Flags _resultDisposition )
- : macroName( _macroName ),
- lineInfo( _lineInfo ),
- capturedExpression( _capturedExpression ),
- resultDisposition( _resultDisposition )
- {}
-
- AssertionResult::AssertionResult() {}
-
- AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
- : m_info( info ),
- m_resultData( data )
- {}
-
- AssertionResult::~AssertionResult() {}
-
- // Result was a success
- bool AssertionResult::succeeded() const {
- return Catch::isOk( m_resultData.resultType );
- }
-
- // Result was a success, or failure is suppressed
- bool AssertionResult::isOk() const {
- return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
- }
-
- ResultWas::OfType AssertionResult::getResultType() const {
- return m_resultData.resultType;
- }
-
- bool AssertionResult::hasExpression() const {
- return !m_info.capturedExpression.empty();
- }
-
- bool AssertionResult::hasMessage() const {
- return !m_resultData.message.empty();
- }
-
- std::string AssertionResult::getExpression() const {
- if( isFalseTest( m_info.resultDisposition ) )
- return "!" + m_info.capturedExpression;
- else
- return m_info.capturedExpression;
- }
- std::string AssertionResult::getExpressionInMacro() const {
- if( m_info.macroName.empty() )
- return m_info.capturedExpression;
- else
- return m_info.macroName + "( " + m_info.capturedExpression + " )";
- }
-
- bool AssertionResult::hasExpandedExpression() const {
- return hasExpression() && getExpandedExpression() != getExpression();
- }
-
- std::string AssertionResult::getExpandedExpression() const {
- return m_resultData.reconstructedExpression;
- }
-
- std::string AssertionResult::getMessage() const {
- return m_resultData.message;
- }
- SourceLineInfo AssertionResult::getSourceInfo() const {
- return m_info.lineInfo;
- }
-
- std::string AssertionResult::getTestMacroName() const {
- return m_info.macroName;
- }
-
-} // end namespace Catch
-
-// #included from: catch_test_case_info.hpp
-#define TWOBLUECUBES_CATCH_TEST_CASE_INFO_HPP_INCLUDED
-
-namespace Catch {
-
- inline TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
- if( startsWith( tag, "." ) ||
- tag == "hide" ||
- tag == "!hide" )
- return TestCaseInfo::IsHidden;
- else if( tag == "!throws" )
- return TestCaseInfo::Throws;
- else if( tag == "!shouldfail" )
- return TestCaseInfo::ShouldFail;
- else if( tag == "!mayfail" )
- return TestCaseInfo::MayFail;
- else
- return TestCaseInfo::None;
- }
- inline bool isReservedTag( std::string const& tag ) {
- return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !isalnum( tag[0] );
- }
- inline void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
- if( isReservedTag( tag ) ) {
- {
- Colour colourGuard( Colour::Red );
- Catch::cerr()
- << "Tag name [" << tag << "] not allowed.\n"
- << "Tag names starting with non alpha-numeric characters are reserved\n";
- }
- {
- Colour colourGuard( Colour::FileName );
- Catch::cerr() << _lineInfo << std::endl;
- }
- exit(1);
- }
- }
-
- TestCase makeTestCase( ITestCase* _testCase,
- std::string const& _className,
- std::string const& _name,
- std::string const& _descOrTags,
- SourceLineInfo const& _lineInfo )
- {
- bool isHidden( startsWith( _name, "./" ) ); // Legacy support
-
- // Parse out tags
- std::set<std::string> tags;
- std::string desc, tag;
- bool inTag = false;
- for( std::size_t i = 0; i < _descOrTags.size(); ++i ) {
- char c = _descOrTags[i];
- if( !inTag ) {
- if( c == '[' )
- inTag = true;
- else
- desc += c;
- }
- else {
- if( c == ']' ) {
- TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
- if( prop == TestCaseInfo::IsHidden )
- isHidden = true;
- else if( prop == TestCaseInfo::None )
- enforceNotReservedTag( tag, _lineInfo );
-
- tags.insert( tag );
- tag.clear();
- inTag = false;
- }
- else
- tag += c;
- }
- }
- if( isHidden ) {
- tags.insert( "hide" );
- tags.insert( "." );
- }
-
- TestCaseInfo info( _name, _className, desc, tags, _lineInfo );
- return TestCase( _testCase, info );
- }
-
- void setTags( TestCaseInfo& testCaseInfo, std::set<std::string> const& tags )
- {
- testCaseInfo.tags = tags;
- testCaseInfo.lcaseTags.clear();
-
- std::ostringstream oss;
- for( std::set<std::string>::const_iterator it = tags.begin(), itEnd = tags.end(); it != itEnd; ++it ) {
- oss << "[" << *it << "]";
- std::string lcaseTag = toLower( *it );
- testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
- testCaseInfo.lcaseTags.insert( lcaseTag );
- }
- testCaseInfo.tagsAsString = oss.str();
- }
-
- TestCaseInfo::TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::set<std::string> const& _tags,
- SourceLineInfo const& _lineInfo )
- : name( _name ),
- className( _className ),
- description( _description ),
- lineInfo( _lineInfo ),
- properties( None )
- {
- setTags( *this, _tags );
- }
-
- TestCaseInfo::TestCaseInfo( TestCaseInfo const& other )
- : name( other.name ),
- className( other.className ),
- description( other.description ),
- tags( other.tags ),
- lcaseTags( other.lcaseTags ),
- tagsAsString( other.tagsAsString ),
- lineInfo( other.lineInfo ),
- properties( other.properties )
- {}
-
- bool TestCaseInfo::isHidden() const {
- return ( properties & IsHidden ) != 0;
- }
- bool TestCaseInfo::throws() const {
- return ( properties & Throws ) != 0;
- }
- bool TestCaseInfo::okToFail() const {
- return ( properties & (ShouldFail | MayFail ) ) != 0;
- }
- bool TestCaseInfo::expectedToFail() const {
- return ( properties & (ShouldFail ) ) != 0;
- }
-
- TestCase::TestCase( ITestCase* testCase, TestCaseInfo const& info ) : TestCaseInfo( info ), test( testCase ) {}
-
- TestCase::TestCase( TestCase const& other )
- : TestCaseInfo( other ),
- test( other.test )
- {}
-
- TestCase TestCase::withName( std::string const& _newName ) const {
- TestCase other( *this );
- other.name = _newName;
- return other;
- }
-
- void TestCase::swap( TestCase& other ) {
- test.swap( other.test );
- name.swap( other.name );
- className.swap( other.className );
- description.swap( other.description );
- tags.swap( other.tags );
- lcaseTags.swap( other.lcaseTags );
- tagsAsString.swap( other.tagsAsString );
- std::swap( TestCaseInfo::properties, static_cast<TestCaseInfo&>( other ).properties );
- std::swap( lineInfo, other.lineInfo );
- }
-
- void TestCase::invoke() const {
- test->invoke();
- }
-
- bool TestCase::operator == ( TestCase const& other ) const {
- return test.get() == other.test.get() &&
- name == other.name &&
- className == other.className;
- }
-
- bool TestCase::operator < ( TestCase const& other ) const {
- return name < other.name;
- }
- TestCase& TestCase::operator = ( TestCase const& other ) {
- TestCase temp( other );
- swap( temp );
- return *this;
- }
-
- TestCaseInfo const& TestCase::getTestCaseInfo() const
- {
- return *this;
- }
-
-} // end namespace Catch
-
-// #included from: catch_version.hpp
-#define TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
-
-namespace Catch {
-
- Version::Version
- ( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- std::string const& _branchName,
- unsigned int _buildNumber )
- : majorVersion( _majorVersion ),
- minorVersion( _minorVersion ),
- patchNumber( _patchNumber ),
- branchName( _branchName ),
- buildNumber( _buildNumber )
- {}
-
- std::ostream& operator << ( std::ostream& os, Version const& version ) {
- os << version.majorVersion << "."
- << version.minorVersion << "."
- << version.patchNumber;
-
- if( !version.branchName.empty() ) {
- os << "-" << version.branchName
- << "." << version.buildNumber;
- }
- return os;
- }
-
- Version libraryVersion( 1, 4, 0, "", 0 );
-
-}
-
-// #included from: catch_message.hpp
-#define TWOBLUECUBES_CATCH_MESSAGE_HPP_INCLUDED
-
-namespace Catch {
-
- MessageInfo::MessageInfo( std::string const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type )
- : macroName( _macroName ),
- lineInfo( _lineInfo ),
- type( _type ),
- sequence( ++globalCount )
- {}
-
- // This may need protecting if threading support is added
- unsigned int MessageInfo::globalCount = 0;
-
- ////////////////////////////////////////////////////////////////////////////
-
- ScopedMessage::ScopedMessage( MessageBuilder const& builder )
- : m_info( builder.m_info )
- {
- m_info.message = builder.m_stream.str();
- getResultCapture().pushScopedMessage( m_info );
- }
- ScopedMessage::ScopedMessage( ScopedMessage const& other )
- : m_info( other.m_info )
- {}
-
- ScopedMessage::~ScopedMessage() {
- getResultCapture().popScopedMessage( m_info );
- }
-
-} // end namespace Catch
-
-// #included from: catch_legacy_reporter_adapter.hpp
-#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_HPP_INCLUDED
-
-// #included from: catch_legacy_reporter_adapter.h
-#define TWOBLUECUBES_CATCH_LEGACY_REPORTER_ADAPTER_H_INCLUDED
-
-namespace Catch
-{
- // Deprecated
- struct IReporter : IShared {
- virtual ~IReporter();
-
- virtual bool shouldRedirectStdout() const = 0;
-
- virtual void StartTesting() = 0;
- virtual void EndTesting( Totals const& totals ) = 0;
- virtual void StartGroup( std::string const& groupName ) = 0;
- virtual void EndGroup( std::string const& groupName, Totals const& totals ) = 0;
- virtual void StartTestCase( TestCaseInfo const& testInfo ) = 0;
- virtual void EndTestCase( TestCaseInfo const& testInfo, Totals const& totals, std::string const& stdOut, std::string const& stdErr ) = 0;
- virtual void StartSection( std::string const& sectionName, std::string const& description ) = 0;
- virtual void EndSection( std::string const& sectionName, Counts const& assertions ) = 0;
- virtual void NoAssertionsInSection( std::string const& sectionName ) = 0;
- virtual void NoAssertionsInTestCase( std::string const& testName ) = 0;
- virtual void Aborted() = 0;
- virtual void Result( AssertionResult const& result ) = 0;
- };
-
- class LegacyReporterAdapter : public SharedImpl<IStreamingReporter>
- {
- public:
- LegacyReporterAdapter( Ptr<IReporter> const& legacyReporter );
- virtual ~LegacyReporterAdapter();
-
- virtual ReporterPreferences getPreferences() const;
- virtual void noMatchingTestCases( std::string const& );
- virtual void testRunStarting( TestRunInfo const& );
- virtual void testGroupStarting( GroupInfo const& groupInfo );
- virtual void testCaseStarting( TestCaseInfo const& testInfo );
- virtual void sectionStarting( SectionInfo const& sectionInfo );
- virtual void assertionStarting( AssertionInfo const& );
- virtual bool assertionEnded( AssertionStats const& assertionStats );
- virtual void sectionEnded( SectionStats const& sectionStats );
- virtual void testCaseEnded( TestCaseStats const& testCaseStats );
- virtual void testGroupEnded( TestGroupStats const& testGroupStats );
- virtual void testRunEnded( TestRunStats const& testRunStats );
- virtual void skipTest( TestCaseInfo const& );
-
- private:
- Ptr<IReporter> m_legacyReporter;
- };
-}
-
-namespace Catch
-{
- LegacyReporterAdapter::LegacyReporterAdapter( Ptr<IReporter> const& legacyReporter )
- : m_legacyReporter( legacyReporter )
- {}
- LegacyReporterAdapter::~LegacyReporterAdapter() {}
-
- ReporterPreferences LegacyReporterAdapter::getPreferences() const {
- ReporterPreferences prefs;
- prefs.shouldRedirectStdOut = m_legacyReporter->shouldRedirectStdout();
- return prefs;
- }
-
- void LegacyReporterAdapter::noMatchingTestCases( std::string const& ) {}
- void LegacyReporterAdapter::testRunStarting( TestRunInfo const& ) {
- m_legacyReporter->StartTesting();
- }
- void LegacyReporterAdapter::testGroupStarting( GroupInfo const& groupInfo ) {
- m_legacyReporter->StartGroup( groupInfo.name );
- }
- void LegacyReporterAdapter::testCaseStarting( TestCaseInfo const& testInfo ) {
- m_legacyReporter->StartTestCase( testInfo );
- }
- void LegacyReporterAdapter::sectionStarting( SectionInfo const& sectionInfo ) {
- m_legacyReporter->StartSection( sectionInfo.name, sectionInfo.description );
- }
- void LegacyReporterAdapter::assertionStarting( AssertionInfo const& ) {
- // Not on legacy interface
- }
-
- bool LegacyReporterAdapter::assertionEnded( AssertionStats const& assertionStats ) {
- if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) {
- for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end();
- it != itEnd;
- ++it ) {
- if( it->type == ResultWas::Info ) {
- ResultBuilder rb( it->macroName.c_str(), it->lineInfo, "", ResultDisposition::Normal );
- rb << it->message;
- rb.setResultType( ResultWas::Info );
- AssertionResult result = rb.build();
- m_legacyReporter->Result( result );
- }
- }
- }
- m_legacyReporter->Result( assertionStats.assertionResult );
- return true;
- }
- void LegacyReporterAdapter::sectionEnded( SectionStats const& sectionStats ) {
- if( sectionStats.missingAssertions )
- m_legacyReporter->NoAssertionsInSection( sectionStats.sectionInfo.name );
- m_legacyReporter->EndSection( sectionStats.sectionInfo.name, sectionStats.assertions );
- }
- void LegacyReporterAdapter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- m_legacyReporter->EndTestCase
- ( testCaseStats.testInfo,
- testCaseStats.totals,
- testCaseStats.stdOut,
- testCaseStats.stdErr );
- }
- void LegacyReporterAdapter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- if( testGroupStats.aborting )
- m_legacyReporter->Aborted();
- m_legacyReporter->EndGroup( testGroupStats.groupInfo.name, testGroupStats.totals );
- }
- void LegacyReporterAdapter::testRunEnded( TestRunStats const& testRunStats ) {
- m_legacyReporter->EndTesting( testRunStats.totals );
- }
- void LegacyReporterAdapter::skipTest( TestCaseInfo const& ) {
- }
-}
-
-// #included from: catch_timer.hpp
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wc++11-long-long"
-#endif
-
-#ifdef CATCH_PLATFORM_WINDOWS
-#include <windows.h>
-#else
-#include <sys/time.h>
-#endif
-
-namespace Catch {
-
- namespace {
-#ifdef CATCH_PLATFORM_WINDOWS
- uint64_t getCurrentTicks() {
- static uint64_t hz=0, hzo=0;
- if (!hz) {
- QueryPerformanceFrequency( reinterpret_cast<LARGE_INTEGER*>( &hz ) );
- QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &hzo ) );
- }
- uint64_t t;
- QueryPerformanceCounter( reinterpret_cast<LARGE_INTEGER*>( &t ) );
- return ((t-hzo)*1000000)/hz;
- }
-#else
- uint64_t getCurrentTicks() {
- timeval t;
- gettimeofday(&t,CATCH_NULL);
- return static_cast<uint64_t>( t.tv_sec ) * 1000000ull + static_cast<uint64_t>( t.tv_usec );
- }
-#endif
- }
-
- void Timer::start() {
- m_ticks = getCurrentTicks();
- }
- unsigned int Timer::getElapsedMicroseconds() const {
- return static_cast<unsigned int>(getCurrentTicks() - m_ticks);
- }
- unsigned int Timer::getElapsedMilliseconds() const {
- return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
- }
- double Timer::getElapsedSeconds() const {
- return getElapsedMicroseconds()/1000000.0;
- }
-
-} // namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-// #included from: catch_common.hpp
-#define TWOBLUECUBES_CATCH_COMMON_HPP_INCLUDED
-
-namespace Catch {
-
- bool startsWith( std::string const& s, std::string const& prefix ) {
- return s.size() >= prefix.size() && s.substr( 0, prefix.size() ) == prefix;
- }
- bool endsWith( std::string const& s, std::string const& suffix ) {
- return s.size() >= suffix.size() && s.substr( s.size()-suffix.size(), suffix.size() ) == suffix;
- }
- bool contains( std::string const& s, std::string const& infix ) {
- return s.find( infix ) != std::string::npos;
- }
- void toLowerInPlace( std::string& s ) {
- std::transform( s.begin(), s.end(), s.begin(), ::tolower );
- }
- std::string toLower( std::string const& s ) {
- std::string lc = s;
- toLowerInPlace( lc );
- return lc;
- }
- std::string trim( std::string const& str ) {
- static char const* whitespaceChars = "\n\r\t ";
- std::string::size_type start = str.find_first_not_of( whitespaceChars );
- std::string::size_type end = str.find_last_not_of( whitespaceChars );
-
- return start != std::string::npos ? str.substr( start, 1+end-start ) : "";
- }
-
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
- bool replaced = false;
- std::size_t i = str.find( replaceThis );
- while( i != std::string::npos ) {
- replaced = true;
- str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
- if( i < str.size()-withThis.size() )
- i = str.find( replaceThis, i+withThis.size() );
- else
- i = std::string::npos;
- }
- return replaced;
- }
-
- pluralise::pluralise( std::size_t count, std::string const& label )
- : m_count( count ),
- m_label( label )
- {}
-
- std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
- os << pluraliser.m_count << " " << pluraliser.m_label;
- if( pluraliser.m_count != 1 )
- os << "s";
- return os;
- }
-
- SourceLineInfo::SourceLineInfo() : line( 0 ){}
- SourceLineInfo::SourceLineInfo( char const* _file, std::size_t _line )
- : file( _file ),
- line( _line )
- {}
- SourceLineInfo::SourceLineInfo( SourceLineInfo const& other )
- : file( other.file ),
- line( other.line )
- {}
- bool SourceLineInfo::empty() const {
- return file.empty();
- }
- bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const {
- return line == other.line && file == other.file;
- }
- bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const {
- return line < other.line || ( line == other.line && file < other.file );
- }
-
- void seedRng( IConfig const& config ) {
- if( config.rngSeed() != 0 )
- std::srand( config.rngSeed() );
- }
- unsigned int rngSeed() {
- return getCurrentContext().getConfig()->rngSeed();
- }
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
-#ifndef __GNUG__
- os << info.file << "(" << info.line << ")";
-#else
- os << info.file << ":" << info.line;
-#endif
- return os;
- }
-
- void throwLogicError( std::string const& message, SourceLineInfo const& locationInfo ) {
- std::ostringstream oss;
- oss << locationInfo << ": Internal Catch error: '" << message << "'";
- if( alwaysTrue() )
- throw std::logic_error( oss.str() );
- }
-}
-
-// #included from: catch_section.hpp
-#define TWOBLUECUBES_CATCH_SECTION_HPP_INCLUDED
-
-namespace Catch {
-
- SectionInfo::SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name,
- std::string const& _description )
- : name( _name ),
- description( _description ),
- lineInfo( _lineInfo )
- {}
-
- Section::Section( SectionInfo const& info )
- : m_info( info ),
- m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
- {
- m_timer.start();
- }
-
- Section::~Section() {
- if( m_sectionIncluded ) {
- SectionEndInfo endInfo( m_info, m_assertions, m_timer.getElapsedSeconds() );
- if( std::uncaught_exception() )
- getResultCapture().sectionEndedEarly( endInfo );
- else
- getResultCapture().sectionEnded( endInfo );
- }
- }
-
- // This indicates whether the section should be executed or not
- Section::operator bool() const {
- return m_sectionIncluded;
- }
-
-} // end namespace Catch
-
-// #included from: catch_debugger.hpp
-#define TWOBLUECUBES_CATCH_DEBUGGER_HPP_INCLUDED
-
-#include <iostream>
-
-#ifdef CATCH_PLATFORM_MAC
-
- #include <assert.h>
- #include <stdbool.h>
- #include <sys/types.h>
- #include <unistd.h>
- #include <sys/sysctl.h>
-
- namespace Catch{
-
- // The following function is taken directly from the following technical note:
- // http://developer.apple.com/library/mac/#qa/qa2004/qa1361.html
-
- // Returns true if the current process is being debugged (either
- // running under the debugger or has a debugger attached post facto).
- bool isDebuggerActive(){
-
- int mib[4];
- struct kinfo_proc info;
- size_t size;
-
- // Initialize the flags so that, if sysctl fails for some bizarre
- // reason, we get a predictable result.
-
- info.kp_proc.p_flag = 0;
-
- // Initialize mib, which tells sysctl the info we want, in this case
- // we're looking for information about a specific process ID.
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_PID;
- mib[3] = getpid();
-
- // Call sysctl.
-
- size = sizeof(info);
- if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, CATCH_NULL, 0) != 0 ) {
- Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
- return false;
- }
-
- // We're being debugged if the P_TRACED flag is set.
-
- return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
- }
- } // namespace Catch
-
-#elif defined(_MSC_VER)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#else
- namespace Catch {
- inline bool isDebuggerActive() { return false; }
- }
-#endif // Platform
-
-#ifdef CATCH_PLATFORM_WINDOWS
- extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA( const char* );
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- ::OutputDebugStringA( text.c_str() );
- }
- }
-#else
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- // !TBD: Need a version for Mac/ XCode and other IDEs
- Catch::cout() << text;
- }
- }
-#endif // Platform
-
-// #included from: catch_tostring.hpp
-#define TWOBLUECUBES_CATCH_TOSTRING_HPP_INCLUDED
-
-namespace Catch {
-
-namespace Detail {
-
- const std::string unprintableString = "{?}";
-
- namespace {
- const int hexThreshold = 255;
-
- struct Endianness {
- enum Arch { Big, Little };
-
- static Arch which() {
- union _{
- int asInt;
- char asChar[sizeof (int)];
- } u;
-
- u.asInt = 1;
- return ( u.asChar[sizeof(int)-1] == 1 ) ? Big : Little;
- }
- };
- }
-
- std::string rawMemoryToString( const void *object, std::size_t size )
- {
- // Reverse order for little endian architectures
- int i = 0, end = static_cast<int>( size ), inc = 1;
- if( Endianness::which() == Endianness::Little ) {
- i = end-1;
- end = inc = -1;
- }
-
- unsigned char const *bytes = static_cast<unsigned char const *>(object);
- std::ostringstream os;
- os << "0x" << std::setfill('0') << std::hex;
- for( ; i != end; i += inc )
- os << std::setw(2) << static_cast<unsigned>(bytes[i]);
- return os.str();
- }
-}
-
-std::string toString( std::string const& value ) {
- std::string s = value;
- if( getCurrentContext().getConfig()->showInvisibles() ) {
- for(size_t i = 0; i < s.size(); ++i ) {
- std::string subs;
- switch( s[i] ) {
- case '\n': subs = "\\n"; break;
- case '\t': subs = "\\t"; break;
- default: break;
- }
- if( !subs.empty() ) {
- s = s.substr( 0, i ) + subs + s.substr( i+1 );
- ++i;
- }
- }
- }
- return "\"" + s + "\"";
-}
-std::string toString( std::wstring const& value ) {
-
- std::string s;
- s.reserve( value.size() );
- for(size_t i = 0; i < value.size(); ++i )
- s += value[i] <= 0xff ? static_cast<char>( value[i] ) : '?';
- return Catch::toString( s );
-}
-
-std::string toString( const char* const value ) {
- return value ? Catch::toString( std::string( value ) ) : std::string( "{null string}" );
-}
-
-std::string toString( char* const value ) {
- return Catch::toString( static_cast<const char*>( value ) );
-}
-
-std::string toString( const wchar_t* const value )
-{
- return value ? Catch::toString( std::wstring(value) ) : std::string( "{null string}" );
-}
-
-std::string toString( wchar_t* const value )
-{
- return Catch::toString( static_cast<const wchar_t*>( value ) );
-}
-
-std::string toString( int value ) {
- std::ostringstream oss;
- oss << value;
- if( value > Detail::hexThreshold )
- oss << " (0x" << std::hex << value << ")";
- return oss.str();
-}
-
-std::string toString( unsigned long value ) {
- std::ostringstream oss;
- oss << value;
- if( value > Detail::hexThreshold )
- oss << " (0x" << std::hex << value << ")";
- return oss.str();
-}
-
-std::string toString( unsigned int value ) {
- return Catch::toString( static_cast<unsigned long>( value ) );
-}
-
-template<typename T>
-std::string fpToString( T value, int precision ) {
- std::ostringstream oss;
- oss << std::setprecision( precision )
- << std::fixed
- << value;
- std::string d = oss.str();
- std::size_t i = d.find_last_not_of( '0' );
- if( i != std::string::npos && i != d.size()-1 ) {
- if( d[i] == '.' )
- i++;
- d = d.substr( 0, i+1 );
- }
- return d;
-}
-
-std::string toString( const double value ) {
- return fpToString( value, 10 );
-}
-std::string toString( const float value ) {
- return fpToString( value, 5 ) + "f";
-}
-
-std::string toString( bool value ) {
- return value ? "true" : "false";
-}
-
-std::string toString( char value ) {
- return value < ' '
- ? toString( static_cast<unsigned int>( value ) )
- : Detail::makeString( value );
-}
-
-std::string toString( signed char value ) {
- return toString( static_cast<char>( value ) );
-}
-
-std::string toString( unsigned char value ) {
- return toString( static_cast<char>( value ) );
-}
-
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
-std::string toString( long long value ) {
- std::ostringstream oss;
- oss << value;
- if( value > Detail::hexThreshold )
- oss << " (0x" << std::hex << value << ")";
- return oss.str();
-}
-std::string toString( unsigned long long value ) {
- std::ostringstream oss;
- oss << value;
- if( value > Detail::hexThreshold )
- oss << " (0x" << std::hex << value << ")";
- return oss.str();
-}
-#endif
-
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
-std::string toString( std::nullptr_t ) {
- return "nullptr";
-}
-#endif
-
-#ifdef __OBJC__
- std::string toString( NSString const * const& nsstring ) {
- if( !nsstring )
- return "nil";
- return "@" + toString([nsstring UTF8String]);
- }
- std::string toString( NSString * CATCH_ARC_STRONG const& nsstring ) {
- if( !nsstring )
- return "nil";
- return "@" + toString([nsstring UTF8String]);
- }
- std::string toString( NSObject* const& nsObject ) {
- return toString( [nsObject description] );
- }
-#endif
-
-} // end namespace Catch
-
-// #included from: catch_result_builder.hpp
-#define TWOBLUECUBES_CATCH_RESULT_BUILDER_HPP_INCLUDED
-
-namespace Catch {
-
- std::string capturedExpressionWithSecondArgument( std::string const& capturedExpression, std::string const& secondArg ) {
- return secondArg.empty() || secondArg == "\"\""
- ? capturedExpression
- : capturedExpression + ", " + secondArg;
- }
- ResultBuilder::ResultBuilder( char const* macroName,
- SourceLineInfo const& lineInfo,
- char const* capturedExpression,
- ResultDisposition::Flags resultDisposition,
- char const* secondArg )
- : m_assertionInfo( macroName, lineInfo, capturedExpressionWithSecondArgument( capturedExpression, secondArg ), resultDisposition ),
- m_shouldDebugBreak( false ),
- m_shouldThrow( false )
- {}
-
- ResultBuilder& ResultBuilder::setResultType( ResultWas::OfType result ) {
- m_data.resultType = result;
- return *this;
- }
- ResultBuilder& ResultBuilder::setResultType( bool result ) {
- m_data.resultType = result ? ResultWas::Ok : ResultWas::ExpressionFailed;
- return *this;
- }
- ResultBuilder& ResultBuilder::setLhs( std::string const& lhs ) {
- m_exprComponents.lhs = lhs;
- return *this;
- }
- ResultBuilder& ResultBuilder::setRhs( std::string const& rhs ) {
- m_exprComponents.rhs = rhs;
- return *this;
- }
- ResultBuilder& ResultBuilder::setOp( std::string const& op ) {
- m_exprComponents.op = op;
- return *this;
- }
-
- void ResultBuilder::endExpression() {
- m_exprComponents.testFalse = isFalseTest( m_assertionInfo.resultDisposition );
- captureExpression();
- }
-
- void ResultBuilder::useActiveException( ResultDisposition::Flags resultDisposition ) {
- m_assertionInfo.resultDisposition = resultDisposition;
- m_stream.oss << Catch::translateActiveException();
- captureResult( ResultWas::ThrewException );
- }
-
- void ResultBuilder::captureResult( ResultWas::OfType resultType ) {
- setResultType( resultType );
- captureExpression();
- }
- void ResultBuilder::captureExpectedException( std::string const& expectedMessage ) {
- if( expectedMessage.empty() )
- captureExpectedException( Matchers::Impl::Generic::AllOf<std::string>() );
- else
- captureExpectedException( Matchers::Equals( expectedMessage ) );
- }
-
- void ResultBuilder::captureExpectedException( Matchers::Impl::Matcher<std::string> const& matcher ) {
-
- assert( m_exprComponents.testFalse == false );
- AssertionResultData data = m_data;
- data.resultType = ResultWas::Ok;
- data.reconstructedExpression = m_assertionInfo.capturedExpression;
-
- std::string actualMessage = Catch::translateActiveException();
- if( !matcher.match( actualMessage ) ) {
- data.resultType = ResultWas::ExpressionFailed;
- data.reconstructedExpression = actualMessage;
- }
- AssertionResult result( m_assertionInfo, data );
- handleResult( result );
- }
-
- void ResultBuilder::captureExpression() {
- AssertionResult result = build();
- handleResult( result );
- }
- void ResultBuilder::handleResult( AssertionResult const& result )
- {
- getResultCapture().assertionEnded( result );
-
- if( !result.isOk() ) {
- if( getCurrentContext().getConfig()->shouldDebugBreak() )
- m_shouldDebugBreak = true;
- if( getCurrentContext().getRunner()->aborting() || (m_assertionInfo.resultDisposition & ResultDisposition::Normal) )
- m_shouldThrow = true;
- }
- }
- void ResultBuilder::react() {
- if( m_shouldThrow )
- throw Catch::TestFailureException();
- }
-
- bool ResultBuilder::shouldDebugBreak() const { return m_shouldDebugBreak; }
- bool ResultBuilder::allowThrows() const { return getCurrentContext().getConfig()->allowThrows(); }
-
- AssertionResult ResultBuilder::build() const
- {
- assert( m_data.resultType != ResultWas::Unknown );
-
- AssertionResultData data = m_data;
-
- // Flip bool results if testFalse is set
- if( m_exprComponents.testFalse ) {
- if( data.resultType == ResultWas::Ok )
- data.resultType = ResultWas::ExpressionFailed;
- else if( data.resultType == ResultWas::ExpressionFailed )
- data.resultType = ResultWas::Ok;
- }
-
- data.message = m_stream.oss.str();
- data.reconstructedExpression = reconstructExpression();
- if( m_exprComponents.testFalse ) {
- if( m_exprComponents.op == "" )
- data.reconstructedExpression = "!" + data.reconstructedExpression;
- else
- data.reconstructedExpression = "!(" + data.reconstructedExpression + ")";
- }
- return AssertionResult( m_assertionInfo, data );
- }
- std::string ResultBuilder::reconstructExpression() const {
- if( m_exprComponents.op == "" )
- return m_exprComponents.lhs.empty() ? m_assertionInfo.capturedExpression : m_exprComponents.op + m_exprComponents.lhs;
- else if( m_exprComponents.op == "matches" )
- return m_exprComponents.lhs + " " + m_exprComponents.rhs;
- else if( m_exprComponents.op != "!" ) {
- if( m_exprComponents.lhs.size() + m_exprComponents.rhs.size() < 40 &&
- m_exprComponents.lhs.find("\n") == std::string::npos &&
- m_exprComponents.rhs.find("\n") == std::string::npos )
- return m_exprComponents.lhs + " " + m_exprComponents.op + " " + m_exprComponents.rhs;
- else
- return m_exprComponents.lhs + "\n" + m_exprComponents.op + "\n" + m_exprComponents.rhs;
- }
- else
- return "{can't expand - use " + m_assertionInfo.macroName + "_FALSE( " + m_assertionInfo.capturedExpression.substr(1) + " ) instead of " + m_assertionInfo.macroName + "( " + m_assertionInfo.capturedExpression + " ) for better diagnostics}";
- }
-
-} // end namespace Catch
-
-// #included from: catch_tag_alias_registry.hpp
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
-
-// #included from: catch_tag_alias_registry.h
-#define TWOBLUECUBES_CATCH_TAG_ALIAS_REGISTRY_H_INCLUDED
-
-#include <map>
-
-namespace Catch {
-
- class TagAliasRegistry : public ITagAliasRegistry {
- public:
- virtual ~TagAliasRegistry();
- virtual Option<TagAlias> find( std::string const& alias ) const;
- virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const;
- void add( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
- static TagAliasRegistry& get();
-
- private:
- std::map<std::string, TagAlias> m_registry;
- };
-
-} // end namespace Catch
-
-#include <map>
-#include <iostream>
-
-namespace Catch {
-
- TagAliasRegistry::~TagAliasRegistry() {}
-
- Option<TagAlias> TagAliasRegistry::find( std::string const& alias ) const {
- std::map<std::string, TagAlias>::const_iterator it = m_registry.find( alias );
- if( it != m_registry.end() )
- return it->second;
- else
- return Option<TagAlias>();
- }
-
- std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
- std::string expandedTestSpec = unexpandedTestSpec;
- for( std::map<std::string, TagAlias>::const_iterator it = m_registry.begin(), itEnd = m_registry.end();
- it != itEnd;
- ++it ) {
- std::size_t pos = expandedTestSpec.find( it->first );
- if( pos != std::string::npos ) {
- expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
- it->second.tag +
- expandedTestSpec.substr( pos + it->first.size() );
- }
- }
- return expandedTestSpec;
- }
-
- void TagAliasRegistry::add( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) {
-
- if( !startsWith( alias, "[@" ) || !endsWith( alias, "]" ) ) {
- std::ostringstream oss;
- oss << "error: tag alias, \"" << alias << "\" is not of the form [@alias name].\n" << lineInfo;
- throw std::domain_error( oss.str().c_str() );
- }
- if( !m_registry.insert( std::make_pair( alias, TagAlias( tag, lineInfo ) ) ).second ) {
- std::ostringstream oss;
- oss << "error: tag alias, \"" << alias << "\" already registered.\n"
- << "\tFirst seen at " << find(alias)->lineInfo << "\n"
- << "\tRedefined at " << lineInfo;
- throw std::domain_error( oss.str().c_str() );
- }
- }
-
- TagAliasRegistry& TagAliasRegistry::get() {
- static TagAliasRegistry instance;
- return instance;
-
- }
-
- ITagAliasRegistry::~ITagAliasRegistry() {}
- ITagAliasRegistry const& ITagAliasRegistry::get() { return TagAliasRegistry::get(); }
-
- RegistrarForTagAliases::RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo ) {
- try {
- TagAliasRegistry::get().add( alias, tag, lineInfo );
- }
- catch( std::exception& ex ) {
- Colour colourGuard( Colour::Red );
- Catch::cerr() << ex.what() << std::endl;
- exit(1);
- }
- }
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_multi.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_MULTI_HPP_INCLUDED
-
-namespace Catch {
-
-class MultipleReporters : public SharedImpl<IStreamingReporter> {
- typedef std::vector<Ptr<IStreamingReporter> > Reporters;
- Reporters m_reporters;
-
-public:
- void add( Ptr<IStreamingReporter> const& reporter ) {
- m_reporters.push_back( reporter );
- }
-
-public: // IStreamingReporter
-
- virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE {
- return m_reporters[0]->getPreferences();
- }
-
- virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->noMatchingTestCases( spec );
- }
-
- virtual void testRunStarting( TestRunInfo const& testRunInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testRunStarting( testRunInfo );
- }
-
- virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testGroupStarting( groupInfo );
- }
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testCaseStarting( testInfo );
- }
-
- virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->sectionStarting( sectionInfo );
- }
-
- virtual void assertionStarting( AssertionInfo const& assertionInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->assertionStarting( assertionInfo );
- }
-
- // The return value indicates if the messages buffer should be cleared:
- virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
- bool clearBuffer = false;
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- clearBuffer |= (*it)->assertionEnded( assertionStats );
- return clearBuffer;
- }
-
- virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->sectionEnded( sectionStats );
- }
-
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testCaseEnded( testCaseStats );
- }
-
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testGroupEnded( testGroupStats );
- }
-
- virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->testRunEnded( testRunStats );
- }
-
- virtual void skipTest( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
- for( Reporters::const_iterator it = m_reporters.begin(), itEnd = m_reporters.end();
- it != itEnd;
- ++it )
- (*it)->skipTest( testInfo );
- }
-};
-
-Ptr<IStreamingReporter> addReporter( Ptr<IStreamingReporter> const& existingReporter, Ptr<IStreamingReporter> const& additionalReporter ) {
- Ptr<IStreamingReporter> resultingReporter;
-
- if( existingReporter ) {
- MultipleReporters* multi = dynamic_cast<MultipleReporters*>( existingReporter.get() );
- if( !multi ) {
- multi = new MultipleReporters;
- resultingReporter = Ptr<IStreamingReporter>( multi );
- if( existingReporter )
- multi->add( existingReporter );
- }
- else
- resultingReporter = existingReporter;
- multi->add( additionalReporter );
- }
- else
- resultingReporter = additionalReporter;
-
- return resultingReporter;
-}
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_xml.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_XML_HPP_INCLUDED
-
-// #included from: catch_reporter_bases.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_BASES_HPP_INCLUDED
-
-#include <cstring>
-
-namespace Catch {
-
- struct StreamingReporterBase : SharedImpl<IStreamingReporter> {
-
- StreamingReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- }
-
- virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE {
- return m_reporterPrefs;
- }
-
- virtual ~StreamingReporterBase() CATCH_OVERRIDE;
-
- virtual void noMatchingTestCases( std::string const& ) CATCH_OVERRIDE {}
-
- virtual void testRunStarting( TestRunInfo const& _testRunInfo ) CATCH_OVERRIDE {
- currentTestRunInfo = _testRunInfo;
- }
- virtual void testGroupStarting( GroupInfo const& _groupInfo ) CATCH_OVERRIDE {
- currentGroupInfo = _groupInfo;
- }
-
- virtual void testCaseStarting( TestCaseInfo const& _testInfo ) CATCH_OVERRIDE {
- currentTestCaseInfo = _testInfo;
- }
- virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE {
- m_sectionStack.push_back( _sectionInfo );
- }
-
- virtual void sectionEnded( SectionStats const& /* _sectionStats */ ) CATCH_OVERRIDE {
- m_sectionStack.pop_back();
- }
- virtual void testCaseEnded( TestCaseStats const& /* _testCaseStats */ ) CATCH_OVERRIDE {
- currentTestCaseInfo.reset();
- }
- virtual void testGroupEnded( TestGroupStats const& /* _testGroupStats */ ) CATCH_OVERRIDE {
- currentGroupInfo.reset();
- }
- virtual void testRunEnded( TestRunStats const& /* _testRunStats */ ) CATCH_OVERRIDE {
- currentTestCaseInfo.reset();
- currentGroupInfo.reset();
- currentTestRunInfo.reset();
- }
-
- virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE {
- // Don't do anything with this by default.
- // It can optionally be overridden in the derived class.
- }
-
- Ptr<IConfig const> m_config;
- std::ostream& stream;
-
- LazyStat<TestRunInfo> currentTestRunInfo;
- LazyStat<GroupInfo> currentGroupInfo;
- LazyStat<TestCaseInfo> currentTestCaseInfo;
-
- std::vector<SectionInfo> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- struct CumulativeReporterBase : SharedImpl<IStreamingReporter> {
- template<typename T, typename ChildNodeT>
- struct Node : SharedImpl<> {
- explicit Node( T const& _value ) : value( _value ) {}
- virtual ~Node() {}
-
- typedef std::vector<Ptr<ChildNodeT> > ChildNodes;
- T value;
- ChildNodes children;
- };
- struct SectionNode : SharedImpl<> {
- explicit SectionNode( SectionStats const& _stats ) : stats( _stats ) {}
- virtual ~SectionNode();
-
- bool operator == ( SectionNode const& other ) const {
- return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
- }
- bool operator == ( Ptr<SectionNode> const& other ) const {
- return operator==( *other );
- }
-
- SectionStats stats;
- typedef std::vector<Ptr<SectionNode> > ChildSections;
- typedef std::vector<AssertionStats> Assertions;
- ChildSections childSections;
- Assertions assertions;
- std::string stdOut;
- std::string stdErr;
- };
-
- struct BySectionInfo {
- BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
- BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
- bool operator() ( Ptr<SectionNode> const& node ) const {
- return node->stats.sectionInfo.lineInfo == m_other.lineInfo;
- }
- private:
- void operator=( BySectionInfo const& );
- SectionInfo const& m_other;
- };
-
- typedef Node<TestCaseStats, SectionNode> TestCaseNode;
- typedef Node<TestGroupStats, TestCaseNode> TestGroupNode;
- typedef Node<TestRunStats, TestGroupNode> TestRunNode;
-
- CumulativeReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- }
- ~CumulativeReporterBase();
-
- virtual ReporterPreferences getPreferences() const CATCH_OVERRIDE {
- return m_reporterPrefs;
- }
-
- virtual void testRunStarting( TestRunInfo const& ) CATCH_OVERRIDE {}
- virtual void testGroupStarting( GroupInfo const& ) CATCH_OVERRIDE {}
-
- virtual void testCaseStarting( TestCaseInfo const& ) CATCH_OVERRIDE {}
-
- virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE {
- SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
- Ptr<SectionNode> node;
- if( m_sectionStack.empty() ) {
- if( !m_rootSection )
- m_rootSection = new SectionNode( incompleteStats );
- node = m_rootSection;
- }
- else {
- SectionNode& parentNode = *m_sectionStack.back();
- SectionNode::ChildSections::const_iterator it =
- std::find_if( parentNode.childSections.begin(),
- parentNode.childSections.end(),
- BySectionInfo( sectionInfo ) );
- if( it == parentNode.childSections.end() ) {
- node = new SectionNode( incompleteStats );
- parentNode.childSections.push_back( node );
- }
- else
- node = *it;
- }
- m_sectionStack.push_back( node );
- m_deepestSection = node;
- }
-
- virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {}
-
- virtual bool assertionEnded( AssertionStats const& assertionStats ) {
- assert( !m_sectionStack.empty() );
- SectionNode& sectionNode = *m_sectionStack.back();
- sectionNode.assertions.push_back( assertionStats );
- return true;
- }
- virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE {
- assert( !m_sectionStack.empty() );
- SectionNode& node = *m_sectionStack.back();
- node.stats = sectionStats;
- m_sectionStack.pop_back();
- }
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE {
- Ptr<TestCaseNode> node = new TestCaseNode( testCaseStats );
- assert( m_sectionStack.size() == 0 );
- node->children.push_back( m_rootSection );
- m_testCases.push_back( node );
- m_rootSection.reset();
-
- assert( m_deepestSection );
- m_deepestSection->stdOut = testCaseStats.stdOut;
- m_deepestSection->stdErr = testCaseStats.stdErr;
- }
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE {
- Ptr<TestGroupNode> node = new TestGroupNode( testGroupStats );
- node->children.swap( m_testCases );
- m_testGroups.push_back( node );
- }
- virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE {
- Ptr<TestRunNode> node = new TestRunNode( testRunStats );
- node->children.swap( m_testGroups );
- m_testRuns.push_back( node );
- testRunEndedCumulative();
- }
- virtual void testRunEndedCumulative() = 0;
-
- virtual void skipTest( TestCaseInfo const& ) CATCH_OVERRIDE {}
-
- Ptr<IConfig const> m_config;
- std::ostream& stream;
- std::vector<AssertionStats> m_assertions;
- std::vector<std::vector<Ptr<SectionNode> > > m_sections;
- std::vector<Ptr<TestCaseNode> > m_testCases;
- std::vector<Ptr<TestGroupNode> > m_testGroups;
-
- std::vector<Ptr<TestRunNode> > m_testRuns;
-
- Ptr<SectionNode> m_rootSection;
- Ptr<SectionNode> m_deepestSection;
- std::vector<Ptr<SectionNode> > m_sectionStack;
- ReporterPreferences m_reporterPrefs;
-
- };
-
- template<char C>
- char const* getLineOfChars() {
- static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
- if( !*line ) {
- memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
- line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
- }
- return line;
- }
-
- struct TestEventListenerBase : StreamingReporterBase {
- TestEventListenerBase( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {}
-
- virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {}
- virtual bool assertionEnded( AssertionStats const& ) CATCH_OVERRIDE {
- return false;
- }
- };
-
-} // end namespace Catch
-
-// #included from: ../internal/catch_reporter_registrars.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
-
-namespace Catch {
-
- template<typename T>
- class LegacyReporterRegistrar {
-
- class ReporterFactory : public IReporterFactory {
- virtual IStreamingReporter* create( ReporterConfig const& config ) const {
- return new LegacyReporterAdapter( new T( config ) );
- }
-
- virtual std::string getDescription() const {
- return T::getDescription();
- }
- };
-
- public:
-
- LegacyReporterRegistrar( std::string const& name ) {
- getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
- }
- };
-
- template<typename T>
- class ReporterRegistrar {
-
- class ReporterFactory : public SharedImpl<IReporterFactory> {
-
- // *** Please Note ***:
- // - If you end up here looking at a compiler error because it's trying to register
- // your custom reporter class be aware that the native reporter interface has changed
- // to IStreamingReporter. The "legacy" interface, IReporter, is still supported via
- // an adapter. Just use REGISTER_LEGACY_REPORTER to take advantage of the adapter.
- // However please consider updating to the new interface as the old one is now
- // deprecated and will probably be removed quite soon!
- // Please contact me via github if you have any questions at all about this.
- // In fact, ideally, please contact me anyway to let me know you've hit this - as I have
- // no idea who is actually using custom reporters at all (possibly no-one!).
- // The new interface is designed to minimise exposure to interface changes in the future.
- virtual IStreamingReporter* create( ReporterConfig const& config ) const {
- return new T( config );
- }
-
- virtual std::string getDescription() const {
- return T::getDescription();
- }
- };
-
- public:
-
- ReporterRegistrar( std::string const& name ) {
- getMutableRegistryHub().registerReporter( name, new ReporterFactory() );
- }
- };
-
- template<typename T>
- class ListenerRegistrar {
-
- class ListenerFactory : public SharedImpl<IReporterFactory> {
-
- virtual IStreamingReporter* create( ReporterConfig const& config ) const {
- return new T( config );
- }
- virtual std::string getDescription() const {
- return "";
- }
- };
-
- public:
-
- ListenerRegistrar() {
- getMutableRegistryHub().registerListener( new ListenerFactory() );
- }
- };
-}
-
-#define INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) \
- namespace{ Catch::LegacyReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); }
-
-#define INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType ) \
- namespace{ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); }
-
-#define INTERNAL_CATCH_REGISTER_LISTENER( listenerType ) \
- namespace{ Catch::ListenerRegistrar<listenerType> catch_internal_RegistrarFor##listenerType; }
-
-// #included from: ../internal/catch_xmlwriter.hpp
-#define TWOBLUECUBES_CATCH_XMLWRITER_HPP_INCLUDED
-
-#include <sstream>
-#include <string>
-#include <vector>
-#include <iomanip>
-
-namespace Catch {
-
- class XmlEncode {
- public:
- enum ForWhat { ForTextNodes, ForAttributes };
-
- XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes )
- : m_str( str ),
- m_forWhat( forWhat )
- {}
-
- void encodeTo( std::ostream& os ) const {
-
- // Apostrophe escaping not necessary if we always use " to write attributes
- // (see: http://www.w3.org/TR/xml/#syntax)
-
- for( std::size_t i = 0; i < m_str.size(); ++ i ) {
- char c = m_str[i];
- switch( c ) {
- case '<': os << "&lt;"; break;
- case '&': os << "&amp;"; break;
-
- case '>':
- // See: http://www.w3.org/TR/xml/#syntax
- if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' )
- os << "&gt;";
- else
- os << c;
- break;
-
- case '\"':
- if( m_forWhat == ForAttributes )
- os << "&quot;";
- else
- os << c;
- break;
-
- default:
- // Escape control chars - based on contribution by @espenalb in PR #465
- if ( ( c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' )
- os << "&#x" << std::uppercase << std::hex << static_cast<int>( c );
- else
- os << c;
- }
- }
- }
-
- friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
- xmlEncode.encodeTo( os );
- return os;
- }
-
- private:
- std::string m_str;
- ForWhat m_forWhat;
- };
-
- class XmlWriter {
- public:
-
- class ScopedElement {
- public:
- ScopedElement( XmlWriter* writer )
- : m_writer( writer )
- {}
-
- ScopedElement( ScopedElement const& other )
- : m_writer( other.m_writer ){
- other.m_writer = CATCH_NULL;
- }
-
- ~ScopedElement() {
- if( m_writer )
- m_writer->endElement();
- }
-
- ScopedElement& writeText( std::string const& text, bool indent = true ) {
- m_writer->writeText( text, indent );
- return *this;
- }
-
- template<typename T>
- ScopedElement& writeAttribute( std::string const& name, T const& attribute ) {
- m_writer->writeAttribute( name, attribute );
- return *this;
- }
-
- private:
- mutable XmlWriter* m_writer;
- };
-
- XmlWriter()
- : m_tagIsOpen( false ),
- m_needsNewline( false ),
- m_os( &Catch::cout() )
- {}
-
- XmlWriter( std::ostream& os )
- : m_tagIsOpen( false ),
- m_needsNewline( false ),
- m_os( &os )
- {}
-
- ~XmlWriter() {
- while( !m_tags.empty() )
- endElement();
- }
-
- XmlWriter& startElement( std::string const& name ) {
- ensureTagClosed();
- newlineIfNecessary();
- stream() << m_indent << "<" << name;
- m_tags.push_back( name );
- m_indent += " ";
- m_tagIsOpen = true;
- return *this;
- }
-
- ScopedElement scopedElement( std::string const& name ) {
- ScopedElement scoped( this );
- startElement( name );
- return scoped;
- }
-
- XmlWriter& endElement() {
- newlineIfNecessary();
- m_indent = m_indent.substr( 0, m_indent.size()-2 );
- if( m_tagIsOpen ) {
- stream() << "/>\n";
- m_tagIsOpen = false;
- }
- else {
- stream() << m_indent << "</" << m_tags.back() << ">\n";
- }
- m_tags.pop_back();
- return *this;
- }
-
- XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) {
- if( !name.empty() && !attribute.empty() )
- stream() << " " << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << "\"";
- return *this;
- }
-
- XmlWriter& writeAttribute( std::string const& name, bool attribute ) {
- stream() << " " << name << "=\"" << ( attribute ? "true" : "false" ) << "\"";
- return *this;
- }
-
- template<typename T>
- XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
- std::ostringstream oss;
- oss << attribute;
- return writeAttribute( name, oss.str() );
- }
-
- XmlWriter& writeText( std::string const& text, bool indent = true ) {
- if( !text.empty() ){
- bool tagWasOpen = m_tagIsOpen;
- ensureTagClosed();
- if( tagWasOpen && indent )
- stream() << m_indent;
- stream() << XmlEncode( text );
- m_needsNewline = true;
- }
- return *this;
- }
-
- XmlWriter& writeComment( std::string const& text ) {
- ensureTagClosed();
- stream() << m_indent << "<!--" << text << "-->";
- m_needsNewline = true;
- return *this;
- }
-
- XmlWriter& writeBlankLine() {
- ensureTagClosed();
- stream() << "\n";
- return *this;
- }
-
- void setStream( std::ostream& os ) {
- m_os = &os;
- }
-
- private:
- XmlWriter( XmlWriter const& );
- void operator=( XmlWriter const& );
-
- std::ostream& stream() {
- return *m_os;
- }
-
- void ensureTagClosed() {
- if( m_tagIsOpen ) {
- stream() << ">\n";
- m_tagIsOpen = false;
- }
- }
-
- void newlineIfNecessary() {
- if( m_needsNewline ) {
- stream() << "\n";
- m_needsNewline = false;
- }
- }
-
- bool m_tagIsOpen;
- bool m_needsNewline;
- std::vector<std::string> m_tags;
- std::string m_indent;
- std::ostream* m_os;
- };
-
-}
-// #included from: catch_reenable_warnings.h
-
-#define TWOBLUECUBES_CATCH_REENABLE_WARNINGS_H_INCLUDED
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(pop)
-# else
-# pragma clang diagnostic pop
-# endif
-#elif defined __GNUC__
-# pragma GCC diagnostic pop
-#endif
-
-
-namespace Catch {
- class XmlReporter : public StreamingReporterBase {
- public:
- XmlReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config ),
- m_sectionDepth( 0 )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- }
-
- virtual ~XmlReporter() CATCH_OVERRIDE;
-
- static std::string getDescription() {
- return "Reports test results as an XML document";
- }
-
- public: // StreamingReporterBase
-
- virtual void noMatchingTestCases( std::string const& s ) CATCH_OVERRIDE {
- StreamingReporterBase::noMatchingTestCases( s );
- }
-
- virtual void testRunStarting( TestRunInfo const& testInfo ) CATCH_OVERRIDE {
- StreamingReporterBase::testRunStarting( testInfo );
- m_xml.setStream( stream );
- m_xml.startElement( "Catch" );
- if( !m_config->name().empty() )
- m_xml.writeAttribute( "name", m_config->name() );
- }
-
- virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE {
- StreamingReporterBase::testGroupStarting( groupInfo );
- m_xml.startElement( "Group" )
- .writeAttribute( "name", groupInfo.name );
- }
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) CATCH_OVERRIDE {
- StreamingReporterBase::testCaseStarting(testInfo);
- m_xml.startElement( "TestCase" ).writeAttribute( "name", trim( testInfo.name ) );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- m_testCaseTimer.start();
- }
-
- virtual void sectionStarting( SectionInfo const& sectionInfo ) CATCH_OVERRIDE {
- StreamingReporterBase::sectionStarting( sectionInfo );
- if( m_sectionDepth++ > 0 ) {
- m_xml.startElement( "Section" )
- .writeAttribute( "name", trim( sectionInfo.name ) )
- .writeAttribute( "description", sectionInfo.description );
- }
- }
-
- virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE { }
-
- virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
- const AssertionResult& assertionResult = assertionStats.assertionResult;
-
- // Print any info messages in <Info> tags.
- if( assertionStats.assertionResult.getResultType() != ResultWas::Ok ) {
- for( std::vector<MessageInfo>::const_iterator it = assertionStats.infoMessages.begin(), itEnd = assertionStats.infoMessages.end();
- it != itEnd;
- ++it ) {
- if( it->type == ResultWas::Info ) {
- m_xml.scopedElement( "Info" )
- .writeText( it->message );
- } else if ( it->type == ResultWas::Warning ) {
- m_xml.scopedElement( "Warning" )
- .writeText( it->message );
- }
- }
- }
-
- // Drop out if result was successful but we're not printing them.
- if( !m_config->includeSuccessfulResults() && isOk(assertionResult.getResultType()) )
- return true;
-
- // Print the expression if there is one.
- if( assertionResult.hasExpression() ) {
- m_xml.startElement( "Expression" )
- .writeAttribute( "success", assertionResult.succeeded() )
- .writeAttribute( "type", assertionResult.getTestMacroName() )
- .writeAttribute( "filename", assertionResult.getSourceInfo().file )
- .writeAttribute( "line", assertionResult.getSourceInfo().line );
-
- m_xml.scopedElement( "Original" )
- .writeText( assertionResult.getExpression() );
- m_xml.scopedElement( "Expanded" )
- .writeText( assertionResult.getExpandedExpression() );
- }
-
- // And... Print a result applicable to each result type.
- switch( assertionResult.getResultType() ) {
- case ResultWas::ThrewException:
- m_xml.scopedElement( "Exception" )
- .writeAttribute( "filename", assertionResult.getSourceInfo().file )
- .writeAttribute( "line", assertionResult.getSourceInfo().line )
- .writeText( assertionResult.getMessage() );
- break;
- case ResultWas::FatalErrorCondition:
- m_xml.scopedElement( "Fatal Error Condition" )
- .writeAttribute( "filename", assertionResult.getSourceInfo().file )
- .writeAttribute( "line", assertionResult.getSourceInfo().line )
- .writeText( assertionResult.getMessage() );
- break;
- case ResultWas::Info:
- m_xml.scopedElement( "Info" )
- .writeText( assertionResult.getMessage() );
- break;
- case ResultWas::Warning:
- // Warning will already have been written
- break;
- case ResultWas::ExplicitFailure:
- m_xml.scopedElement( "Failure" )
- .writeText( assertionResult.getMessage() );
- break;
- default:
- break;
- }
-
- if( assertionResult.hasExpression() )
- m_xml.endElement();
-
- return true;
- }
-
- virtual void sectionEnded( SectionStats const& sectionStats ) CATCH_OVERRIDE {
- StreamingReporterBase::sectionEnded( sectionStats );
- if( --m_sectionDepth > 0 ) {
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" );
- e.writeAttribute( "successes", sectionStats.assertions.passed );
- e.writeAttribute( "failures", sectionStats.assertions.failed );
- e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds );
-
- m_xml.endElement();
- }
- }
-
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
- e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
-
- m_xml.endElement();
- }
-
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- // TODO: Check testGroupStats.aborting and act accordingly.
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testGroupStats.totals.assertions.passed )
- .writeAttribute( "failures", testGroupStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
- virtual void testRunEnded( TestRunStats const& testRunStats ) CATCH_OVERRIDE {
- StreamingReporterBase::testRunEnded( testRunStats );
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testRunStats.totals.assertions.passed )
- .writeAttribute( "failures", testRunStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
- m_xml.endElement();
- }
-
- private:
- Timer m_testCaseTimer;
- XmlWriter m_xml;
- int m_sectionDepth;
- };
-
- INTERNAL_CATCH_REGISTER_REPORTER( "xml", XmlReporter )
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_junit.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_JUNIT_HPP_INCLUDED
-
-#include <assert.h>
-
-namespace Catch {
-
- class JunitReporter : public CumulativeReporterBase {
- public:
- JunitReporter( ReporterConfig const& _config )
- : CumulativeReporterBase( _config ),
- xml( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- }
-
- virtual ~JunitReporter() CATCH_OVERRIDE;
-
- static std::string getDescription() {
- return "Reports test results in an XML format that looks like Ant's junitreport target";
- }
-
- virtual void noMatchingTestCases( std::string const& /*spec*/ ) CATCH_OVERRIDE {}
-
- virtual void testRunStarting( TestRunInfo const& runInfo ) CATCH_OVERRIDE {
- CumulativeReporterBase::testRunStarting( runInfo );
- xml.startElement( "testsuites" );
- }
-
- virtual void testGroupStarting( GroupInfo const& groupInfo ) CATCH_OVERRIDE {
- suiteTimer.start();
- stdOutForSuite.str("");
- stdErrForSuite.str("");
- unexpectedExceptions = 0;
- CumulativeReporterBase::testGroupStarting( groupInfo );
- }
-
- virtual bool assertionEnded( AssertionStats const& assertionStats ) CATCH_OVERRIDE {
- if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException )
- unexpectedExceptions++;
- return CumulativeReporterBase::assertionEnded( assertionStats );
- }
-
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) CATCH_OVERRIDE {
- stdOutForSuite << testCaseStats.stdOut;
- stdErrForSuite << testCaseStats.stdErr;
- CumulativeReporterBase::testCaseEnded( testCaseStats );
- }
-
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) CATCH_OVERRIDE {
- double suiteTime = suiteTimer.getElapsedSeconds();
- CumulativeReporterBase::testGroupEnded( testGroupStats );
- writeGroup( *m_testGroups.back(), suiteTime );
- }
-
- virtual void testRunEndedCumulative() CATCH_OVERRIDE {
- xml.endElement();
- }
-
- void writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
- TestGroupStats const& stats = groupNode.value;
- xml.writeAttribute( "name", stats.groupInfo.name );
- xml.writeAttribute( "errors", unexpectedExceptions );
- xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
- xml.writeAttribute( "tests", stats.totals.assertions.total() );
- xml.writeAttribute( "hostname", "tbd" ); // !TBD
- if( m_config->showDurations() == ShowDurations::Never )
- xml.writeAttribute( "time", "" );
- else
- xml.writeAttribute( "time", suiteTime );
- xml.writeAttribute( "timestamp", "tbd" ); // !TBD
-
- // Write test cases
- for( TestGroupNode::ChildNodes::const_iterator
- it = groupNode.children.begin(), itEnd = groupNode.children.end();
- it != itEnd;
- ++it )
- writeTestCase( **it );
-
- xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite.str() ), false );
- xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite.str() ), false );
- }
-
- void writeTestCase( TestCaseNode const& testCaseNode ) {
- TestCaseStats const& stats = testCaseNode.value;
-
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert( testCaseNode.children.size() == 1 );
- SectionNode const& rootSection = *testCaseNode.children.front();
-
- std::string className = stats.testInfo.className;
-
- if( className.empty() ) {
- if( rootSection.childSections.empty() )
- className = "global";
- }
- writeSection( className, "", rootSection );
- }
-
- void writeSection( std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode ) {
- std::string name = trim( sectionNode.stats.sectionInfo.name );
- if( !rootName.empty() )
- name = rootName + "/" + name;
-
- if( !sectionNode.assertions.empty() ||
- !sectionNode.stdOut.empty() ||
- !sectionNode.stdErr.empty() ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
- if( className.empty() ) {
- xml.writeAttribute( "classname", name );
- xml.writeAttribute( "name", "root" );
- }
- else {
- xml.writeAttribute( "classname", className );
- xml.writeAttribute( "name", name );
- }
- xml.writeAttribute( "time", Catch::toString( sectionNode.stats.durationInSeconds ) );
-
- writeAssertions( sectionNode );
-
- if( !sectionNode.stdOut.empty() )
- xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), false );
- if( !sectionNode.stdErr.empty() )
- xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), false );
- }
- for( SectionNode::ChildSections::const_iterator
- it = sectionNode.childSections.begin(),
- itEnd = sectionNode.childSections.end();
- it != itEnd;
- ++it )
- if( className.empty() )
- writeSection( name, "", **it );
- else
- writeSection( className, name, **it );
- }
-
- void writeAssertions( SectionNode const& sectionNode ) {
- for( SectionNode::Assertions::const_iterator
- it = sectionNode.assertions.begin(), itEnd = sectionNode.assertions.end();
- it != itEnd;
- ++it )
- writeAssertion( *it );
- }
- void writeAssertion( AssertionStats const& stats ) {
- AssertionResult const& result = stats.assertionResult;
- if( !result.isOk() ) {
- std::string elementName;
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- elementName = "failure";
- break;
- case ResultWas::ExpressionFailed:
- elementName = "failure";
- break;
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement( elementName );
-
- xml.writeAttribute( "message", result.getExpandedExpression() );
- xml.writeAttribute( "type", result.getTestMacroName() );
-
- std::ostringstream oss;
- if( !result.getMessage().empty() )
- oss << result.getMessage() << "\n";
- for( std::vector<MessageInfo>::const_iterator
- it = stats.infoMessages.begin(),
- itEnd = stats.infoMessages.end();
- it != itEnd;
- ++it )
- if( it->type == ResultWas::Info )
- oss << it->message << "\n";
-
- oss << "at " << result.getSourceInfo();
- xml.writeText( oss.str(), false );
- }
- }
-
- XmlWriter xml;
- Timer suiteTimer;
- std::ostringstream stdOutForSuite;
- std::ostringstream stdErrForSuite;
- unsigned int unexpectedExceptions;
- };
-
- INTERNAL_CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_console.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_CONSOLE_HPP_INCLUDED
-
-namespace Catch {
-
- struct ConsoleReporter : StreamingReporterBase {
- ConsoleReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config ),
- m_headerPrinted( false )
- {}
-
- virtual ~ConsoleReporter() CATCH_OVERRIDE;
- static std::string getDescription() {
- return "Reports test results as plain lines of text";
- }
-
- virtual void noMatchingTestCases( std::string const& spec ) CATCH_OVERRIDE {
- stream << "No test cases matched '" << spec << "'" << std::endl;
- }
-
- virtual void assertionStarting( AssertionInfo const& ) CATCH_OVERRIDE {
- }
-
- virtual bool assertionEnded( AssertionStats const& _assertionStats ) CATCH_OVERRIDE {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool printInfoMessages = true;
-
- // Drop out if result was successful and we're not printing those
- if( !m_config->includeSuccessfulResults() && result.isOk() ) {
- if( result.getResultType() != ResultWas::Warning )
- return false;
- printInfoMessages = false;
- }
-
- lazyPrint();
-
- AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
- printer.print();
- stream << std::endl;
- return true;
- }
-
- virtual void sectionStarting( SectionInfo const& _sectionInfo ) CATCH_OVERRIDE {
- m_headerPrinted = false;
- StreamingReporterBase::sectionStarting( _sectionInfo );
- }
- virtual void sectionEnded( SectionStats const& _sectionStats ) CATCH_OVERRIDE {
- if( _sectionStats.missingAssertions ) {
- lazyPrint();
- Colour colour( Colour::ResultError );
- if( m_sectionStack.size() > 1 )
- stream << "\nNo assertions in section";
- else
- stream << "\nNo assertions in test case";
- stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
- }
- if( m_headerPrinted ) {
- if( m_config->showDurations() == ShowDurations::Always )
- stream << "Completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
- m_headerPrinted = false;
- }
- else {
- if( m_config->showDurations() == ShowDurations::Always )
- stream << _sectionStats.sectionInfo.name << " completed in " << _sectionStats.durationInSeconds << "s" << std::endl;
- }
- StreamingReporterBase::sectionEnded( _sectionStats );
- }
-
- virtual void testCaseEnded( TestCaseStats const& _testCaseStats ) CATCH_OVERRIDE {
- StreamingReporterBase::testCaseEnded( _testCaseStats );
- m_headerPrinted = false;
- }
- virtual void testGroupEnded( TestGroupStats const& _testGroupStats ) CATCH_OVERRIDE {
- if( currentGroupInfo.used ) {
- printSummaryDivider();
- stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n";
- printTotals( _testGroupStats.totals );
- stream << "\n" << std::endl;
- }
- StreamingReporterBase::testGroupEnded( _testGroupStats );
- }
- virtual void testRunEnded( TestRunStats const& _testRunStats ) CATCH_OVERRIDE {
- printTotalsDivider( _testRunStats.totals );
- printTotals( _testRunStats.totals );
- stream << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- private:
-
- class AssertionPrinter {
- void operator= ( AssertionPrinter const& );
- public:
- AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
- : stream( _stream ),
- stats( _stats ),
- result( _stats.assertionResult ),
- colour( Colour::None ),
- message( result.getMessage() ),
- messages( _stats.infoMessages ),
- printInfoMessages( _printInfoMessages )
- {
- switch( result.getResultType() ) {
- case ResultWas::Ok:
- colour = Colour::Success;
- passOrFail = "PASSED";
- //if( result.hasMessage() )
- if( _stats.infoMessages.size() == 1 )
- messageLabel = "with message";
- if( _stats.infoMessages.size() > 1 )
- messageLabel = "with messages";
- break;
- case ResultWas::ExpressionFailed:
- if( result.isOk() ) {
- colour = Colour::Success;
- passOrFail = "FAILED - but was ok";
- }
- else {
- colour = Colour::Error;
- passOrFail = "FAILED";
- }
- if( _stats.infoMessages.size() == 1 )
- messageLabel = "with message";
- if( _stats.infoMessages.size() > 1 )
- messageLabel = "with messages";
- break;
- case ResultWas::ThrewException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to unexpected exception with message";
- break;
- case ResultWas::FatalErrorCondition:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to a fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "because no exception was thrown where one was expected";
- break;
- case ResultWas::Info:
- messageLabel = "info";
- break;
- case ResultWas::Warning:
- messageLabel = "warning";
- break;
- case ResultWas::ExplicitFailure:
- passOrFail = "FAILED";
- colour = Colour::Error;
- if( _stats.infoMessages.size() == 1 )
- messageLabel = "explicitly with message";
- if( _stats.infoMessages.size() > 1 )
- messageLabel = "explicitly with messages";
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- passOrFail = "** internal error **";
- colour = Colour::Error;
- break;
- }
- }
-
- void print() const {
- printSourceInfo();
- if( stats.totals.assertions.total() > 0 ) {
- if( result.isOk() )
- stream << "\n";
- printResultType();
- printOriginalExpression();
- printReconstructedExpression();
- }
- else {
- stream << "\n";
- }
- printMessage();
- }
-
- private:
- void printResultType() const {
- if( !passOrFail.empty() ) {
- Colour colourGuard( colour );
- stream << passOrFail << ":\n";
- }
- }
- void printOriginalExpression() const {
- if( result.hasExpression() ) {
- Colour colourGuard( Colour::OriginalExpression );
- stream << " ";
- stream << result.getExpressionInMacro();
- stream << "\n";
- }
- }
- void printReconstructedExpression() const {
- if( result.hasExpandedExpression() ) {
- stream << "with expansion:\n";
- Colour colourGuard( Colour::ReconstructedExpression );
- stream << Text( result.getExpandedExpression(), TextAttributes().setIndent(2) ) << "\n";
- }
- }
- void printMessage() const {
- if( !messageLabel.empty() )
- stream << messageLabel << ":" << "\n";
- for( std::vector<MessageInfo>::const_iterator it = messages.begin(), itEnd = messages.end();
- it != itEnd;
- ++it ) {
- // If this assertion is a warning ignore any INFO messages
- if( printInfoMessages || it->type != ResultWas::Info )
- stream << Text( it->message, TextAttributes().setIndent(2) ) << "\n";
- }
- }
- void printSourceInfo() const {
- Colour colourGuard( Colour::FileName );
- stream << result.getSourceInfo() << ": ";
- }
-
- std::ostream& stream;
- AssertionStats const& stats;
- AssertionResult const& result;
- Colour::Code colour;
- std::string passOrFail;
- std::string messageLabel;
- std::string message;
- std::vector<MessageInfo> messages;
- bool printInfoMessages;
- };
-
- void lazyPrint() {
-
- if( !currentTestRunInfo.used )
- lazyPrintRunInfo();
- if( !currentGroupInfo.used )
- lazyPrintGroupInfo();
-
- if( !m_headerPrinted ) {
- printTestCaseAndSectionHeader();
- m_headerPrinted = true;
- }
- }
- void lazyPrintRunInfo() {
- stream << "\n" << getLineOfChars<'~'>() << "\n";
- Colour colour( Colour::SecondaryText );
- stream << currentTestRunInfo->name
- << " is a Catch v" << libraryVersion << " host application.\n"
- << "Run with -? for options\n\n";
-
- if( m_config->rngSeed() != 0 )
- stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
-
- currentTestRunInfo.used = true;
- }
- void lazyPrintGroupInfo() {
- if( !currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1 ) {
- printClosedHeader( "Group: " + currentGroupInfo->name );
- currentGroupInfo.used = true;
- }
- }
- void printTestCaseAndSectionHeader() {
- assert( !m_sectionStack.empty() );
- printOpenHeader( currentTestCaseInfo->name );
-
- if( m_sectionStack.size() > 1 ) {
- Colour colourGuard( Colour::Headers );
-
- std::vector<SectionInfo>::const_iterator
- it = m_sectionStack.begin()+1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for( ; it != itEnd; ++it )
- printHeaderString( it->name, 2 );
- }
-
- SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
-
- if( !lineInfo.empty() ){
- stream << getLineOfChars<'-'>() << "\n";
- Colour colourGuard( Colour::FileName );
- stream << lineInfo << "\n";
- }
- stream << getLineOfChars<'.'>() << "\n" << std::endl;
- }
-
- void printClosedHeader( std::string const& _name ) {
- printOpenHeader( _name );
- stream << getLineOfChars<'.'>() << "\n";
- }
- void printOpenHeader( std::string const& _name ) {
- stream << getLineOfChars<'-'>() << "\n";
- {
- Colour colourGuard( Colour::Headers );
- printHeaderString( _name );
- }
- }
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- void printHeaderString( std::string const& _string, std::size_t indent = 0 ) {
- std::size_t i = _string.find( ": " );
- if( i != std::string::npos )
- i+=2;
- else
- i = 0;
- stream << Text( _string, TextAttributes()
- .setIndent( indent+i)
- .setInitialIndent( indent ) ) << "\n";
- }
-
- struct SummaryColumn {
-
- SummaryColumn( std::string const& _label, Colour::Code _colour )
- : label( _label ),
- colour( _colour )
- {}
- SummaryColumn addRow( std::size_t count ) {
- std::ostringstream oss;
- oss << count;
- std::string row = oss.str();
- for( std::vector<std::string>::iterator it = rows.begin(); it != rows.end(); ++it ) {
- while( it->size() < row.size() )
- *it = " " + *it;
- while( it->size() > row.size() )
- row = " " + row;
- }
- rows.push_back( row );
- return *this;
- }
-
- std::string label;
- Colour::Code colour;
- std::vector<std::string> rows;
-
- };
-
- void printTotals( Totals const& totals ) {
- if( totals.testCases.total() == 0 ) {
- stream << Colour( Colour::Warning ) << "No tests ran\n";
- }
- else if( totals.assertions.total() > 0 && totals.testCases.allPassed() ) {
- stream << Colour( Colour::ResultSuccess ) << "All tests passed";
- stream << " ("
- << pluralise( totals.assertions.passed, "assertion" ) << " in "
- << pluralise( totals.testCases.passed, "test case" ) << ")"
- << "\n";
- }
- else {
-
- std::vector<SummaryColumn> columns;
- columns.push_back( SummaryColumn( "", Colour::None )
- .addRow( totals.testCases.total() )
- .addRow( totals.assertions.total() ) );
- columns.push_back( SummaryColumn( "passed", Colour::Success )
- .addRow( totals.testCases.passed )
- .addRow( totals.assertions.passed ) );
- columns.push_back( SummaryColumn( "failed", Colour::ResultError )
- .addRow( totals.testCases.failed )
- .addRow( totals.assertions.failed ) );
- columns.push_back( SummaryColumn( "failed as expected", Colour::ResultExpectedFailure )
- .addRow( totals.testCases.failedButOk )
- .addRow( totals.assertions.failedButOk ) );
-
- printSummaryRow( "test cases", columns, 0 );
- printSummaryRow( "assertions", columns, 1 );
- }
- }
- void printSummaryRow( std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row ) {
- for( std::vector<SummaryColumn>::const_iterator it = cols.begin(); it != cols.end(); ++it ) {
- std::string value = it->rows[row];
- if( it->label.empty() ) {
- stream << label << ": ";
- if( value != "0" )
- stream << value;
- else
- stream << Colour( Colour::Warning ) << "- none -";
- }
- else if( value != "0" ) {
- stream << Colour( Colour::LightGrey ) << " | ";
- stream << Colour( it->colour )
- << value << " " << it->label;
- }
- }
- stream << "\n";
- }
-
- static std::size_t makeRatio( std::size_t number, std::size_t total ) {
- std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number/ total : 0;
- return ( ratio == 0 && number > 0 ) ? 1 : ratio;
- }
- static std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) {
- if( i > j && i > k )
- return i;
- else if( j > k )
- return j;
- else
- return k;
- }
-
- void printTotalsDivider( Totals const& totals ) {
- if( totals.testCases.total() > 0 ) {
- std::size_t failedRatio = makeRatio( totals.testCases.failed, totals.testCases.total() );
- std::size_t failedButOkRatio = makeRatio( totals.testCases.failedButOk, totals.testCases.total() );
- std::size_t passedRatio = makeRatio( totals.testCases.passed, totals.testCases.total() );
- while( failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH-1 )
- findMax( failedRatio, failedButOkRatio, passedRatio )++;
- while( failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH-1 )
- findMax( failedRatio, failedButOkRatio, passedRatio )--;
-
- stream << Colour( Colour::Error ) << std::string( failedRatio, '=' );
- stream << Colour( Colour::ResultExpectedFailure ) << std::string( failedButOkRatio, '=' );
- if( totals.testCases.allPassed() )
- stream << Colour( Colour::ResultSuccess ) << std::string( passedRatio, '=' );
- else
- stream << Colour( Colour::Success ) << std::string( passedRatio, '=' );
- }
- else {
- stream << Colour( Colour::Warning ) << std::string( CATCH_CONFIG_CONSOLE_WIDTH-1, '=' );
- }
- stream << "\n";
- }
- void printSummaryDivider() {
- stream << getLineOfChars<'-'>() << "\n";
- }
-
- private:
- bool m_headerPrinted;
- };
-
- INTERNAL_CATCH_REGISTER_REPORTER( "console", ConsoleReporter )
-
-} // end namespace Catch
-
-// #included from: ../reporters/catch_reporter_compact.hpp
-#define TWOBLUECUBES_CATCH_REPORTER_COMPACT_HPP_INCLUDED
-
-namespace Catch {
-
- struct CompactReporter : StreamingReporterBase {
-
- CompactReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config )
- {}
-
- virtual ~CompactReporter();
-
- static std::string getDescription() {
- return "Reports test results on a single line, suitable for IDEs";
- }
-
- virtual ReporterPreferences getPreferences() const {
- ReporterPreferences prefs;
- prefs.shouldRedirectStdOut = false;
- return prefs;
- }
-
- virtual void noMatchingTestCases( std::string const& spec ) {
- stream << "No test cases matched '" << spec << "'" << std::endl;
- }
-
- virtual void assertionStarting( AssertionInfo const& ) {
- }
-
- virtual bool assertionEnded( AssertionStats const& _assertionStats ) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool printInfoMessages = true;
-
- // Drop out if result was successful and we're not printing those
- if( !m_config->includeSuccessfulResults() && result.isOk() ) {
- if( result.getResultType() != ResultWas::Warning )
- return false;
- printInfoMessages = false;
- }
-
- AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- virtual void testRunEnded( TestRunStats const& _testRunStats ) {
- printTotals( _testRunStats.totals );
- stream << "\n" << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- private:
- class AssertionPrinter {
- void operator= ( AssertionPrinter const& );
- public:
- AssertionPrinter( std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages )
- : stream( _stream )
- , stats( _stats )
- , result( _stats.assertionResult )
- , messages( _stats.infoMessages )
- , itMessage( _stats.infoMessages.begin() )
- , printInfoMessages( _printInfoMessages )
- {}
-
- void print() {
- printSourceInfo();
-
- itMessage = messages.begin();
-
- switch( result.getResultType() ) {
- case ResultWas::Ok:
- printResultType( Colour::ResultSuccess, passedString() );
- printOriginalExpression();
- printReconstructedExpression();
- if ( ! result.hasExpression() )
- printRemainingMessages( Colour::None );
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if( result.isOk() )
- printResultType( Colour::ResultSuccess, failedString() + std::string( " - but was ok" ) );
- else
- printResultType( Colour::Error, failedString() );
- printOriginalExpression();
- printReconstructedExpression();
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType( Colour::Error, failedString() );
- printIssue( "unexpected exception with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType( Colour::Error, failedString() );
- printIssue( "fatal error condition with message:" );
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType( Colour::Error, failedString() );
- printIssue( "expected exception, got none" );
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType( Colour::None, "info" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType( Colour::None, "warning" );
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType( Colour::Error, failedString() );
- printIssue( "explicitly" );
- printRemainingMessages( Colour::None );
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType( Colour::Error, "** internal error **" );
- break;
- }
- }
-
- private:
- // Colour::LightGrey
-
- static Colour::Code dimColour() { return Colour::FileName; }
-
-#ifdef CATCH_PLATFORM_MAC
- static const char* failedString() { return "FAILED"; }
- static const char* passedString() { return "PASSED"; }
-#else
- static const char* failedString() { return "failed"; }
- static const char* passedString() { return "passed"; }
-#endif
-
- void printSourceInfo() const {
- Colour colourGuard( Colour::FileName );
- stream << result.getSourceInfo() << ":";
- }
-
- void printResultType( Colour::Code colour, std::string passOrFail ) const {
- if( !passOrFail.empty() ) {
- {
- Colour colourGuard( colour );
- stream << " " << passOrFail;
- }
- stream << ":";
- }
- }
-
- void printIssue( std::string issue ) const {
- stream << " " << issue;
- }
-
- void printExpressionWas() {
- if( result.hasExpression() ) {
- stream << ";";
- {
- Colour colour( dimColour() );
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if( result.hasExpression() ) {
- stream << " " << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if( result.hasExpandedExpression() ) {
- {
- Colour colour( dimColour() );
- stream << " for: ";
- }
- stream << result.getExpandedExpression();
- }
- }
-
- void printMessage() {
- if ( itMessage != messages.end() ) {
- stream << " '" << itMessage->message << "'";
- ++itMessage;
- }
- }
-
- void printRemainingMessages( Colour::Code colour = dimColour() ) {
- if ( itMessage == messages.end() )
- return;
-
- // using messages.end() directly yields compilation error:
- std::vector<MessageInfo>::const_iterator itEnd = messages.end();
- const std::size_t N = static_cast<std::size_t>( std::distance( itMessage, itEnd ) );
-
- {
- Colour colourGuard( colour );
- stream << " with " << pluralise( N, "message" ) << ":";
- }
-
- for(; itMessage != itEnd; ) {
- // If this assertion is a warning ignore any INFO messages
- if( printInfoMessages || itMessage->type != ResultWas::Info ) {
- stream << " '" << itMessage->message << "'";
- if ( ++itMessage != itEnd ) {
- Colour colourGuard( dimColour() );
- stream << " and";
- }
- }
- }
- }
-
- private:
- std::ostream& stream;
- AssertionStats const& stats;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
- };
-
- // Colour, message variants:
- // - white: No tests ran.
- // - red: Failed [both/all] N test cases, failed [both/all] M assertions.
- // - white: Passed [both/all] N test cases (no assertions).
- // - red: Failed N tests cases, failed M assertions.
- // - green: Passed [both/all] N tests cases with M assertions.
-
- std::string bothOrAll( std::size_t count ) const {
- return count == 1 ? "" : count == 2 ? "both " : "all " ;
- }
-
- void printTotals( const Totals& totals ) const {
- if( totals.testCases.total() == 0 ) {
- stream << "No tests ran.";
- }
- else if( totals.testCases.failed == totals.testCases.total() ) {
- Colour colour( Colour::ResultError );
- const std::string qualify_assertions_failed =
- totals.assertions.failed == totals.assertions.total() ?
- bothOrAll( totals.assertions.failed ) : "";
- stream <<
- "Failed " << bothOrAll( totals.testCases.failed )
- << pluralise( totals.testCases.failed, "test case" ) << ", "
- "failed " << qualify_assertions_failed <<
- pluralise( totals.assertions.failed, "assertion" ) << ".";
- }
- else if( totals.assertions.total() == 0 ) {
- stream <<
- "Passed " << bothOrAll( totals.testCases.total() )
- << pluralise( totals.testCases.total(), "test case" )
- << " (no assertions).";
- }
- else if( totals.assertions.failed ) {
- Colour colour( Colour::ResultError );
- stream <<
- "Failed " << pluralise( totals.testCases.failed, "test case" ) << ", "
- "failed " << pluralise( totals.assertions.failed, "assertion" ) << ".";
- }
- else {
- Colour colour( Colour::ResultSuccess );
- stream <<
- "Passed " << bothOrAll( totals.testCases.passed )
- << pluralise( totals.testCases.passed, "test case" ) <<
- " with " << pluralise( totals.assertions.passed, "assertion" ) << ".";
- }
- }
- };
-
- INTERNAL_CATCH_REGISTER_REPORTER( "compact", CompactReporter )
-
-} // end namespace Catch
-
-namespace Catch {
- // These are all here to avoid warnings about not having any out of line
- // virtual methods
- NonCopyable::~NonCopyable() {}
- IShared::~IShared() {}
- IStream::~IStream() CATCH_NOEXCEPT {}
- FileStream::~FileStream() CATCH_NOEXCEPT {}
- CoutStream::~CoutStream() CATCH_NOEXCEPT {}
- DebugOutStream::~DebugOutStream() CATCH_NOEXCEPT {}
- StreamBufBase::~StreamBufBase() CATCH_NOEXCEPT {}
- IContext::~IContext() {}
- IResultCapture::~IResultCapture() {}
- ITestCase::~ITestCase() {}
- ITestCaseRegistry::~ITestCaseRegistry() {}
- IRegistryHub::~IRegistryHub() {}
- IMutableRegistryHub::~IMutableRegistryHub() {}
- IExceptionTranslator::~IExceptionTranslator() {}
- IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() {}
- IReporter::~IReporter() {}
- IReporterFactory::~IReporterFactory() {}
- IReporterRegistry::~IReporterRegistry() {}
- IStreamingReporter::~IStreamingReporter() {}
- AssertionStats::~AssertionStats() {}
- SectionStats::~SectionStats() {}
- TestCaseStats::~TestCaseStats() {}
- TestGroupStats::~TestGroupStats() {}
- TestRunStats::~TestRunStats() {}
- CumulativeReporterBase::SectionNode::~SectionNode() {}
- CumulativeReporterBase::~CumulativeReporterBase() {}
-
- StreamingReporterBase::~StreamingReporterBase() {}
- ConsoleReporter::~ConsoleReporter() {}
- CompactReporter::~CompactReporter() {}
- IRunner::~IRunner() {}
- IMutableContext::~IMutableContext() {}
- IConfig::~IConfig() {}
- XmlReporter::~XmlReporter() {}
- JunitReporter::~JunitReporter() {}
- TestRegistry::~TestRegistry() {}
- FreeFunctionTestCase::~FreeFunctionTestCase() {}
- IGeneratorInfo::~IGeneratorInfo() {}
- IGeneratorsForTest::~IGeneratorsForTest() {}
- WildcardPattern::~WildcardPattern() {}
- TestSpec::Pattern::~Pattern() {}
- TestSpec::NamePattern::~NamePattern() {}
- TestSpec::TagPattern::~TagPattern() {}
- TestSpec::ExcludedPattern::~ExcludedPattern() {}
-
- Matchers::Impl::StdString::Equals::~Equals() {}
- Matchers::Impl::StdString::Contains::~Contains() {}
- Matchers::Impl::StdString::StartsWith::~StartsWith() {}
- Matchers::Impl::StdString::EndsWith::~EndsWith() {}
-
- void Config::dummy() {}
-
- namespace TestCaseTracking {
- ITracker::~ITracker() {}
- TrackerBase::~TrackerBase() {}
- SectionTracker::~SectionTracker() {}
- IndexTracker::~IndexTracker() {}
- }
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif
-
-#ifdef CATCH_CONFIG_MAIN
-// #included from: internal/catch_default_main.hpp
-#define TWOBLUECUBES_CATCH_DEFAULT_MAIN_HPP_INCLUDED
-
-#ifndef __OBJC__
-
-// Standard C/C++ main entry point
-int main (int argc, char * argv[]) {
- return Catch::Session().run( argc, argv );
-}
-
-#else // __OBJC__
-
-// Objective-C entry point
-int main (int argc, char * const argv[]) {
-#if !CATCH_ARC_ENABLED
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-#endif
-
- Catch::registerTestMethods();
- int result = Catch::Session().run( argc, (char* const*)argv );
-
-#if !CATCH_ARC_ENABLED
- [pool drain];
-#endif
-
- return result;
-}
-
-#endif // __OBJC__
-
-#endif
-
-#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
-# undef CLARA_CONFIG_MAIN
-#endif
-
-//////
-
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE" )
-#define CATCH_REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "CATCH_REQUIRE_FALSE" )
-
-#define CATCH_REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "CATCH_REQUIRE_THROWS" )
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THROWS_AS" )
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, matcher, "CATCH_REQUIRE_THROWS_WITH" )
-#define CATCH_REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_NOTHROW" )
-
-#define CATCH_CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK" )
-#define CATCH_CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CATCH_CHECK_FALSE" )
-#define CATCH_CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_IF" )
-#define CATCH_CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECKED_ELSE" )
-#define CATCH_CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CATCH_CHECK_NOFAIL" )
-
-#define CATCH_CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS" )
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THROWS_AS" )
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, matcher, "CATCH_CHECK_THROWS_WITH" )
-#define CATCH_CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_NOTHROW" )
-
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CATCH_CHECK_THAT" )
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "CATCH_REQUIRE_THAT" )
-
-#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" )
-#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "CATCH_WARN", msg )
-#define CATCH_SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "CATCH_INFO" )
-#define CATCH_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" )
-#define CATCH_SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CATCH_CAPTURE" )
-
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
- #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
- #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
- #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
- #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
- #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
- #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", __VA_ARGS__ )
- #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", __VA_ARGS__ )
-#else
- #define CATCH_TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
- #define CATCH_TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
- #define CATCH_METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
- #define CATCH_REGISTER_TEST_CASE( function, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( function, name, description )
- #define CATCH_SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
- #define CATCH_FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "CATCH_FAIL", msg )
- #define CATCH_SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "CATCH_SUCCEED", msg )
-#endif
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
-
-#define CATCH_REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-#define CATCH_REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
-
-#define CATCH_GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
-
-// "BDD-style" convenience wrappers
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
-#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#else
-#define CATCH_SCENARIO( name, tags ) CATCH_TEST_CASE( "Scenario: " name, tags )
-#define CATCH_SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags )
-#endif
-#define CATCH_GIVEN( desc ) CATCH_SECTION( std::string( "Given: ") + desc, "" )
-#define CATCH_WHEN( desc ) CATCH_SECTION( std::string( " When: ") + desc, "" )
-#define CATCH_AND_WHEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" )
-#define CATCH_THEN( desc ) CATCH_SECTION( std::string( " Then: ") + desc, "" )
-#define CATCH_AND_THEN( desc ) CATCH_SECTION( std::string( " And: ") + desc, "" )
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal, "REQUIRE" )
-#define REQUIRE_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, "REQUIRE_FALSE" )
-
-#define REQUIRE_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, "", "REQUIRE_THROWS" )
-#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::Normal, "REQUIRE_THROWS_AS" )
-#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::Normal, matcher, "REQUIRE_THROWS_WITH" )
-#define REQUIRE_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::Normal, "REQUIRE_NOTHROW" )
-
-#define CHECK( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK" )
-#define CHECK_FALSE( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, "CHECK_FALSE" )
-#define CHECKED_IF( expr ) INTERNAL_CATCH_IF( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_IF" )
-#define CHECKED_ELSE( expr ) INTERNAL_CATCH_ELSE( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECKED_ELSE" )
-#define CHECK_NOFAIL( expr ) INTERNAL_CATCH_TEST( expr, Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, "CHECK_NOFAIL" )
-
-#define CHECK_THROWS( expr ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, "", "CHECK_THROWS" )
-#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( expr, exceptionType, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THROWS_AS" )
-#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS( expr, Catch::ResultDisposition::ContinueOnFailure, matcher, "CHECK_THROWS_WITH" )
-#define CHECK_NOTHROW( expr ) INTERNAL_CATCH_NO_THROW( expr, Catch::ResultDisposition::ContinueOnFailure, "CHECK_NOTHROW" )
-
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::ContinueOnFailure, "CHECK_THAT" )
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( arg, matcher, Catch::ResultDisposition::Normal, "REQUIRE_THAT" )
-
-#define INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" )
-#define WARN( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, "WARN", msg )
-#define SCOPED_INFO( msg ) INTERNAL_CATCH_INFO( msg, "INFO" )
-#define CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" )
-#define SCOPED_CAPTURE( msg ) INTERNAL_CATCH_INFO( #msg " := " << msg, "CAPTURE" )
-
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
- #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
- #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
- #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
- #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
- #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
- #define FAIL( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", __VA_ARGS__ )
- #define SUCCEED( ... ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", __VA_ARGS__ )
-#else
- #define TEST_CASE( name, description ) INTERNAL_CATCH_TESTCASE( name, description )
- #define TEST_CASE_METHOD( className, name, description ) INTERNAL_CATCH_TEST_CASE_METHOD( className, name, description )
- #define METHOD_AS_TEST_CASE( method, name, description ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, name, description )
- #define REGISTER_TEST_CASE( method, name, description ) INTERNAL_CATCH_REGISTER_TESTCASE( method, name, description )
- #define SECTION( name, description ) INTERNAL_CATCH_SECTION( name, description )
- #define FAIL( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, "FAIL", msg )
- #define SUCCEED( msg ) INTERNAL_CATCH_MSG( Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, "SUCCEED", msg )
-#endif
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE( "", "" )
-
-#define REGISTER_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_REPORTER( name, reporterType )
-#define REGISTER_LEGACY_REPORTER( name, reporterType ) INTERNAL_CATCH_REGISTER_LEGACY_REPORTER( name, reporterType )
-
-#define GENERATE( expr) INTERNAL_CATCH_GENERATE( expr )
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
-
-// "BDD-style" convenience wrappers
-#ifdef CATCH_CONFIG_VARIADIC_MACROS
-#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#else
-#define SCENARIO( name, tags ) TEST_CASE( "Scenario: " name, tags )
-#define SCENARIO_METHOD( className, name, tags ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " name, tags )
-#endif
-#define GIVEN( desc ) SECTION( std::string(" Given: ") + desc, "" )
-#define WHEN( desc ) SECTION( std::string(" When: ") + desc, "" )
-#define AND_WHEN( desc ) SECTION( std::string("And when: ") + desc, "" )
-#define THEN( desc ) SECTION( std::string(" Then: ") + desc, "" )
-#define AND_THEN( desc ) SECTION( std::string(" And: ") + desc, "" )
-
-using Catch::Detail::Approx;
-
-#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/config-msvc.py b/graphics/asymptote/cudareflect/tinyexr/test/unit/config-msvc.py
deleted file mode 100644
index a7771defd1..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/config-msvc.py
+++ /dev/null
@@ -1,52 +0,0 @@
-exe = "tester.exe"
-
-toolchain = "msvc"
-
-# optional
-link_pool_depth = 1
-
-# optional
-builddir = {
- "gnu" : "build"
- , "msvc" : "build"
- , "clang" : "build"
- }
-
-includes = {
- "gnu" : [ "-I." ]
- , "msvc" : [ "/I." ]
- , "clang" : [ "-I." ]
- }
-
-defines = {
- "gnu" : [ "-DEXAMPLE=1" ]
- , "msvc" : [ "/DEXAMPLE=1" ]
- , "clang" : [ "-DEXAMPLE=1" ]
- }
-
-cflags = {
- "gnu" : [ "-O2", "-g" ]
- , "msvc" : [ "/O2" ]
- , "clang" : [ "-O2", "-g" ]
- }
-
-cxxflags = {
- "gnu" : [ "-O2", "-g" ]
- , "msvc" : [ "/O2", "/W4", "/EHsc"]
- , "clang" : [ "-O2", "-g", "-fsanitize=address" ]
- }
-
-ldflags = {
- "gnu" : [ ]
- , "msvc" : [ ]
- , "clang" : [ "-fsanitize=address" ]
- }
-
-# optionsl
-cxx_files = [ "tester.cc" ]
-c_files = [ ]
-
-# You can register your own toolchain through register_toolchain function
-def register_toolchain(ninja):
- pass
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/config-posix.py b/graphics/asymptote/cudareflect/tinyexr/test/unit/config-posix.py
deleted file mode 100644
index 29cc4d5518..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/config-posix.py
+++ /dev/null
@@ -1,53 +0,0 @@
-exe = "tester"
-
-# "gnu" or "clang"
-toolchain = "gnu"
-
-# optional
-link_pool_depth = 1
-
-# optional
-builddir = {
- "gnu" : "build"
- , "msvc" : "build"
- , "clang" : "build"
- }
-
-includes = {
- "gnu" : [ "-I." ]
- , "msvc" : [ "/I." ]
- , "clang" : [ "-I." ]
- }
-
-defines = {
- "gnu" : [ ]
- , "msvc" : [ ]
- , "clang" : [ ]
- }
-
-cflags = {
- "gnu" : [ "-O2", "-g" ]
- , "msvc" : [ "/O2" ]
- , "clang" : [ "-O2", "-g" ]
- }
-
-# Warn as much as possible: http://qiita.com/MitsutakaTakeda/items/6b9966f890cc9b944d75
-cxxflags = {
- "gnu" : [ "-O2", "-g", "-pedantic -Wall -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wmissing-declarations -Wmissing-include-dirs -Wold-style-cast -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-overflow=5 -Wswitch-default -Wundef -Werror -Wno-unused", "-fsanitize=address" ]
- , "msvc" : [ "/O2", "/W4" ]
- , "clang" : [ "-O2", "-g", "-Werror -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic", "-fsanitize=address" ]
- }
-
-ldflags = {
- "gnu" : [ "-fsanitize=address" ]
- , "msvc" : [ ]
- , "clang" : [ "-fsanitize=address" ]
- }
-
-cxx_files = [ "tester.cc" ]
-c_files = [ ]
-
-# You can register your own toolchain through register_toolchain function
-def register_toolchain(ninja):
- pass
-
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/kuroga.py b/graphics/asymptote/cudareflect/tinyexr/test/unit/kuroga.py
deleted file mode 100755
index 56d3f863dd..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/kuroga.py
+++ /dev/null
@@ -1,312 +0,0 @@
-#!/usr/bin/env python
-
-#
-# Kuroga, single python file meta-build system for ninja
-# https://github.com/lighttransport/kuroga
-#
-# Requirements: python 2.6 or 2.7
-#
-# Usage: $ python kuroga.py input.py
-#
-
-import imp
-import re
-import textwrap
-import glob
-import os
-import sys
-
-# gcc preset
-def add_gnu_rule(ninja):
- ninja.rule('gnucxx', description='CXX $out',
- command='$gnucxx -MMD -MF $out.d $gnudefines $gnuincludes $gnucxxflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('gnucc', description='CC $out',
- command='$gnucc -MMD -MF $out.d $gnudefines $gnuincludes $gnucflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('gnulink', description='LINK $out', pool='link_pool',
- command='$gnuld -o $out $in $libs $gnuldflags')
- ninja.rule('gnuar', description='AR $out', pool='link_pool',
- command='$gnuar rsc $out $in')
- ninja.rule('gnustamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('gnucxx', 'g++')
- ninja.variable('gnucc', 'gcc')
- ninja.variable('gnuld', '$gnucxx')
- ninja.variable('gnuar', 'ar')
- ninja.newline()
-
-# clang preset
-def add_clang_rule(ninja):
- ninja.rule('clangcxx', description='CXX $out',
- command='$clangcxx -MMD -MF $out.d $clangdefines $clangincludes $clangcxxflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('clangcc', description='CC $out',
- command='$clangcc -MMD -MF $out.d $clangdefines $clangincludes $clangcflags -c $in -o $out',
- depfile='$out.d', deps='gcc')
- ninja.rule('clanglink', description='LINK $out', pool='link_pool',
- command='$clangld -o $out $in $libs $clangldflags')
- ninja.rule('clangar', description='AR $out', pool='link_pool',
- command='$clangar rsc $out $in')
- ninja.rule('clangstamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('clangcxx', 'clang++')
- ninja.variable('clangcc', 'clang')
- ninja.variable('clangld', '$clangcxx')
- ninja.variable('clangar', 'ar')
- ninja.newline()
-
-# msvc preset
-def add_msvc_rule(ninja):
- ninja.rule('msvccxx', description='CXX $out',
- command='$msvccxx /TP /showIncludes $msvcdefines $msvcincludes $msvccxxflags -c $in /Fo$out',
- depfile='$out.d', deps='msvc')
- ninja.rule('msvccc', description='CC $out',
- command='$msvccc /TC /showIncludes $msvcdefines $msvcincludes $msvccflags -c $in /Fo$out',
- depfile='$out.d', deps='msvc')
- ninja.rule('msvclink', description='LINK $out', pool='link_pool',
- command='$msvcld $msvcldflags $in $libs /OUT:$out')
- ninja.rule('msvcar', description='AR $out', pool='link_pool',
- command='$msvcar $in /OUT:$out')
- #ninja.rule('msvcstamp', description='STAMP $out', command='touch $out')
- ninja.newline()
-
- ninja.variable('msvccxx', 'cl.exe')
- ninja.variable('msvccc', 'cl.exe')
- ninja.variable('msvcld', 'link.exe')
- ninja.variable('msvcar', 'lib.exe')
- ninja.newline()
-
-# -- from ninja_syntax.py --
-def escape_path(word):
- return word.replace('$ ', '$$ ').replace(' ', '$ ').replace(':', '$:')
-
-class Writer(object):
- def __init__(self, output, width=78):
- self.output = output
- self.width = width
-
- def newline(self):
- self.output.write('\n')
-
- def comment(self, text, has_path=False):
- for line in textwrap.wrap(text, self.width - 2, break_long_words=False,
- break_on_hyphens=False):
- self.output.write('# ' + line + '\n')
-
- def variable(self, key, value, indent=0):
- if value is None:
- return
- if isinstance(value, list):
- value = ' '.join(filter(None, value)) # Filter out empty strings.
- self._line('%s = %s' % (key, value), indent)
-
- def pool(self, name, depth):
- self._line('pool %s' % name)
- self.variable('depth', depth, indent=1)
-
- def rule(self, name, command, description=None, depfile=None,
- generator=False, pool=None, restat=False, rspfile=None,
- rspfile_content=None, deps=None):
- self._line('rule %s' % name)
- self.variable('command', command, indent=1)
- if description:
- self.variable('description', description, indent=1)
- if depfile:
- self.variable('depfile', depfile, indent=1)
- if generator:
- self.variable('generator', '1', indent=1)
- if pool:
- self.variable('pool', pool, indent=1)
- if restat:
- self.variable('restat', '1', indent=1)
- if rspfile:
- self.variable('rspfile', rspfile, indent=1)
- if rspfile_content:
- self.variable('rspfile_content', rspfile_content, indent=1)
- if deps:
- self.variable('deps', deps, indent=1)
-
- def build(self, outputs, rule, inputs=None, implicit=None, order_only=None,
- variables=None):
- outputs = as_list(outputs)
- out_outputs = [escape_path(x) for x in outputs]
- all_inputs = [escape_path(x) for x in as_list(inputs)]
-
- if implicit:
- implicit = [escape_path(x) for x in as_list(implicit)]
- all_inputs.append('|')
- all_inputs.extend(implicit)
- if order_only:
- order_only = [escape_path(x) for x in as_list(order_only)]
- all_inputs.append('||')
- all_inputs.extend(order_only)
-
- self._line('build %s: %s' % (' '.join(out_outputs),
- ' '.join([rule] + all_inputs)))
-
- if variables:
- if isinstance(variables, dict):
- iterator = iter(variables.items())
- else:
- iterator = iter(variables)
-
- for key, val in iterator:
- self.variable(key, val, indent=1)
-
- return outputs
-
- def include(self, path):
- self._line('include %s' % path)
-
- def subninja(self, path):
- self._line('subninja %s' % path)
-
- def default(self, paths):
- self._line('default %s' % ' '.join(as_list(paths)))
-
- def _count_dollars_before_index(self, s, i):
- """Returns the number of '$' characters right in front of s[i]."""
- dollar_count = 0
- dollar_index = i - 1
- while dollar_index > 0 and s[dollar_index] == '$':
- dollar_count += 1
- dollar_index -= 1
- return dollar_count
-
- def _line(self, text, indent=0):
- """Write 'text' word-wrapped at self.width characters."""
- leading_space = ' ' * indent
- while len(leading_space) + len(text) > self.width:
- # The text is too wide; wrap if possible.
-
- # Find the rightmost space that would obey our width constraint and
- # that's not an escaped space.
- available_space = self.width - len(leading_space) - len(' $')
- space = available_space
- while True:
- space = text.rfind(' ', 0, space)
- if (space < 0 or
- self._count_dollars_before_index(text, space) % 2 == 0):
- break
-
- if space < 0:
- # No such space; just use the first unescaped space we can find.
- space = available_space - 1
- while True:
- space = text.find(' ', space + 1)
- if (space < 0 or
- self._count_dollars_before_index(text, space) % 2 == 0):
- break
- if space < 0:
- # Give up on breaking.
- break
-
- self.output.write(leading_space + text[0:space] + ' $\n')
- text = text[space+1:]
-
- # Subsequent lines are continuations, so indent them.
- leading_space = ' ' * (indent+2)
-
- self.output.write(leading_space + text + '\n')
-
- def close(self):
- self.output.close()
-
-
-def as_list(input):
- if input is None:
- return []
- if isinstance(input, list):
- return input
- return [input]
-
-# -- end from ninja_syntax.py --
-
-def gen(ninja, toolchain, config):
-
- ninja.variable('ninja_required_version', '1.4')
- ninja.newline()
-
- if hasattr(config, "builddir"):
- builddir = config.builddir[toolchain]
- ninja.variable(toolchain + 'builddir', builddir)
- else:
- builddir = ''
-
- ninja.variable(toolchain + 'defines', config.defines[toolchain] or [])
- ninja.variable(toolchain + 'includes', config.includes[toolchain] or [])
- ninja.variable(toolchain + 'cflags', config.cflags[toolchain] or [])
- ninja.variable(toolchain + 'cxxflags', config.cxxflags[toolchain] or [])
- ninja.variable(toolchain + 'ldflags', config.ldflags[toolchain] or [])
- ninja.newline()
-
- if hasattr(config, "link_pool_depth"):
- ninja.pool('link_pool', depth=config.link_pool_depth)
- else:
- ninja.pool('link_pool', depth=4)
- ninja.newline()
-
- # Add default toolchain(gnu, clang and msvc)
- add_gnu_rule(ninja)
- add_clang_rule(ninja)
- add_msvc_rule(ninja)
-
- obj_files = []
-
- cc = toolchain + 'cc'
- cxx = toolchain + 'cxx'
- link = toolchain + 'link'
- ar = toolchain + 'ar'
-
- if hasattr(config, "cxx_files"):
- for src in config.cxx_files:
- srcfile = src
- obj = os.path.splitext(srcfile)[0] + '.o'
- obj = os.path.join(builddir, obj);
- obj_files.append(obj)
- ninja.build(obj, cxx, srcfile)
- ninja.newline()
-
- if hasattr(config, "c_files"):
- for src in config.c_files:
- srcfile = src
- obj = os.path.splitext(srcfile)[0] + '.o'
- obj = os.path.join(builddir, obj);
- obj_files.append(obj)
- ninja.build(obj, cc, srcfile)
- ninja.newline()
-
- targetlist = []
- if hasattr(config, "exe"):
- ninja.build(config.exe, link, obj_files)
- targetlist.append(config.exe)
-
- if hasattr(config, "staticlib"):
- ninja.build(config.staticlib, ar, obj_files)
- targetlist.append(config.staticlib)
-
- ninja.build('all', 'phony', targetlist)
- ninja.newline()
-
- ninja.default('all')
-
-def main():
- if len(sys.argv) < 2:
- print("Usage: python kuroga.py config.py")
- sys.exit(1)
-
- config = imp.load_source("config", sys.argv[1])
-
- f = open('build.ninja', 'w')
- ninja = Writer(f)
-
- if hasattr(config, "register_toolchain"):
- config.register_toolchain(ninja)
-
- gen(ninja, config.toolchain, config)
- f.close()
-
-main()
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/2by2.exr b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/2by2.exr
deleted file mode 100644
index 5cc69a90c1..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/2by2.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/flaga.exr b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/flaga.exr
deleted file mode 100644
index baafcbf976..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/flaga.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/issue-160-piz-decode.exr b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/issue-160-piz-decode.exr
deleted file mode 100644
index 0190859ebf..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/issue-160-piz-decode.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/piz-bug-issue-100.exr b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/piz-bug-issue-100.exr
deleted file mode 100644
index 6be0d2d8f2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/piz-bug-issue-100.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-1383755b301e5f505b2198dc0508918b537fdf48bbfc6deeffe268822e6f6cd6 b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-1383755b301e5f505b2198dc0508918b537fdf48bbfc6deeffe268822e6f6cd6
deleted file mode 100644
index 53d737ff9a..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-1383755b301e5f505b2198dc0508918b537fdf48bbfc6deeffe268822e6f6cd6
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-24322747c47e87a10e4407528b779a1a763a48135384909b3d1010bbba1d4c28_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-24322747c47e87a10e4407528b779a1a763a48135384909b3d1010bbba1d4c28_min
deleted file mode 100644
index bdd036c97c..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-24322747c47e87a10e4407528b779a1a763a48135384909b3d1010bbba1d4c28_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-255456016cca60ddb5c5ed6898182e13739bf687b17d1411e97bb60ad95e7a84_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-255456016cca60ddb5c5ed6898182e13739bf687b17d1411e97bb60ad95e7a84_min
deleted file mode 100644
index 81a2321162..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-255456016cca60ddb5c5ed6898182e13739bf687b17d1411e97bb60ad95e7a84_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-360c3b0555cb979ca108f2d178cf8a80959cfeabaa4ec1d310d062fa653a8c6b_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-360c3b0555cb979ca108f2d178cf8a80959cfeabaa4ec1d310d062fa653a8c6b_min
deleted file mode 100644
index b2543d3109..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-360c3b0555cb979ca108f2d178cf8a80959cfeabaa4ec1d310d062fa653a8c6b_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-3f1f642c3356fd8e8d2a0787613ec09a56572b3a1e38c9629b6db9e8dead1117_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-3f1f642c3356fd8e8d2a0787613ec09a56572b3a1e38c9629b6db9e8dead1117_min
deleted file mode 100644
index 5f844b157b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-3f1f642c3356fd8e8d2a0787613ec09a56572b3a1e38c9629b6db9e8dead1117_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5ace655ef080932dcc7e4abc9eab1d4f82c845453464993dfa3eb6c5822a1621 b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5ace655ef080932dcc7e4abc9eab1d4f82c845453464993dfa3eb6c5822a1621
deleted file mode 100644
index ddafb67aad..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5ace655ef080932dcc7e4abc9eab1d4f82c845453464993dfa3eb6c5822a1621
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5b66774a7498c635334ad386be0c3b359951738ac47f14878a3346d1c6ea0fe5_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5b66774a7498c635334ad386be0c3b359951738ac47f14878a3346d1c6ea0fe5_min
deleted file mode 100644
index eb74f48f44..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-5b66774a7498c635334ad386be0c3b359951738ac47f14878a3346d1c6ea0fe5_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-d5c9c893e559277a3320c196523095b94db93985620ac338d037487e0e613047_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-d5c9c893e559277a3320c196523095b94db93985620ac338d037487e0e613047_min
deleted file mode 100644
index d01d059e99..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-d5c9c893e559277a3320c196523095b94db93985620ac338d037487e0e613047_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-df76d1f27adb8927a1446a603028272140905c168a336128465a1162ec7af270.mini b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-df76d1f27adb8927a1446a603028272140905c168a336128465a1162ec7af270.mini
deleted file mode 100644
index d07b822737..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-df76d1f27adb8927a1446a603028272140905c168a336128465a1162ec7af270.mini
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-e7fa6404daa861369d2172fe68e08f9d38c0989f57da7bcfb510bab67e19ca9f b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-e7fa6404daa861369d2172fe68e08f9d38c0989f57da7bcfb510bab67e19ca9f
deleted file mode 100644
index fef3948e19..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-e7fa6404daa861369d2172fe68e08f9d38c0989f57da7bcfb510bab67e19ca9f
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-eedff3a9e99eb1c0fd3a3b0989e7c44c0a69f04f10b23e5264f362a4773f4397_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-eedff3a9e99eb1c0fd3a3b0989e7c44c0a69f04f10b23e5264f362a4773f4397_min
deleted file mode 100644
index a5168f80dc..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-eedff3a9e99eb1c0fd3a3b0989e7c44c0a69f04f10b23e5264f362a4773f4397_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-efe9007bfdcbbe8a1569bf01fa9acadb8261ead49cb83f6e91fcdc4dae2e99a3_min b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-efe9007bfdcbbe8a1569bf01fa9acadb8261ead49cb83f6e91fcdc4dae2e99a3_min
deleted file mode 100644
index 58184850d2..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/poc-efe9007bfdcbbe8a1569bf01fa9acadb8261ead49cb83f6e91fcdc4dae2e99a3_min
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/tiled_half_1x1_alpha.exr b/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/tiled_half_1x1_alpha.exr
deleted file mode 100644
index 1933c14e8a..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/regression/tiled_half_1x1_alpha.exr
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/tester.cc b/graphics/asymptote/cudareflect/tinyexr/test/unit/tester.cc
deleted file mode 100644
index 5fc722dd20..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/tester.cc
+++ /dev/null
@@ -1,1714 +0,0 @@
-// Assume this file is encoded in UTF-8
-#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do
- // this in one cpp file
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <fstream>
-#include <iostream>
-#include <sstream>
-
-#include "catch.hpp"
-
-#ifdef _WIN32
-#ifndef _CRT_SECURE_NO_WARNINGS
-#define _CRT_SECURE_NO_WARNINGS
-#endif
-#include <windows.h>
-#endif
-
-#define TINYEXR_IMPLEMENTATION
-#include "../../tinyexr.h"
-
-// uncomment it to write out memory-saved images to files
-//#define DUMP_IMAGES
-
-// path to https://github.com/openexr/openexr-images
-// TODO(syoyo): Read openexr-images path from command argument.
-const char* kOpenEXRImagePath = "../../../openexr-images/";
-
-std::string GetPath(const char* basename) {
- std::string s;
- s = std::string(kOpenEXRImagePath) + std::string(basename);
- return s;
-}
-
-// simply dumping to build folder
-std::string GetDumpPath(const char* basename) {
- std::string s = basename;
- size_t index = s.find_last_of("/\\");
-
- if (index != std::string::npos && index + 1 < s.size()) {
- s = s.substr(index + 1);
- }
- //return "dump/" + s;
- return s;
-}
-
-// https://stackoverflow.com/questions/148403/utf8-to-from-wide-char-conversion-in-stl/148665#148665
-std::wstring UTF8_to_wchar(const char* in) {
- std::wstring out;
- unsigned int codepoint;
- while (*in != 0) {
- unsigned char ch = static_cast<unsigned char>(*in);
- if (ch <= 0x7f)
- codepoint = ch;
- else if (ch <= 0xbf)
- codepoint = (codepoint << 6) | (ch & 0x3f);
- else if (ch <= 0xdf)
- codepoint = ch & 0x1f;
- else if (ch <= 0xef)
- codepoint = ch & 0x0f;
- else
- codepoint = ch & 0x07;
- ++in;
- if (((*in & 0xc0) != 0x80) && (codepoint <= 0x10ffff)) {
- if (sizeof(wchar_t) > 2)
- out.append(1, static_cast<wchar_t>(codepoint));
- else if (codepoint > 0xffff) {
- out.append(1, static_cast<wchar_t>(0xd800 + (codepoint >> 10)));
- out.append(1, static_cast<wchar_t>(0xdc00 + (codepoint & 0x03ff)));
- } else if (codepoint < 0xd800 || codepoint >= 0xe000)
- out.append(1, static_cast<wchar_t>(codepoint));
- }
- }
- return out;
-}
-
-#ifdef DUMP_IMAGES
-// return true if success
-static bool WriteMemoryToFile(const char *filename, const unsigned char* memory, size_t size)
-{
- std::cout << "Saving:" << std::string(filename) << std::endl;
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || defined(__MINGW32__) // MSVC, MinGW gcc or clang
- errno_t errcode =
- _wfopen_s(&fp, UTF8_to_wchar(filename).c_str(), L"wb");
- if (errcode != 0) return false;
-#else
- // Unknown compiler
- fp = fopen(filename, "wb");
-#endif
-#else
- fp = fopen(filename, "wb");
-#endif
- if (!fp) return false;
-
- size_t written_size = 0;
- if (size && memory) {
- written_size = fwrite(memory, 1, size, fp);
- }
-
- fclose(fp);
-
- return written_size == size;
-}
-#endif
-
-// some helper funcs
-static bool operator == (const EXRBox2i& a, const EXRBox2i& b)
-{
- return a.min_x == b.min_x && a.min_y == b.min_y &&
- a.max_x == b.max_x && a.max_y == b.max_y;
-}
-
-static int GetWidth(const EXRBox2i& box)
-{
- return box.max_x - box.min_x + 1;
-}
-
-static int GetHeight(const EXRBox2i& box)
-{
- return box.max_y - box.min_y + 1;
-}
-
-static void CompareHeaders(const EXRHeader& header1, const EXRHeader& header2)
-{
-#if 0
- printf("header1.dataWindow = %d, %d, %d, %d\n", header1.data_window.min_x,
- header1.data_window.min_y, header1.data_window.max_x, header1.data_window.max_y);
- printf("header2.dataWindow = %d, %d, %d, %d\n", header2.data_window.min_x,
- header2.data_window.min_y, header2.data_window.max_x, header2.data_window.max_y);
-#endif
- REQUIRE(header1.compression_type == header2.compression_type);
- REQUIRE(header1.num_channels == header2.num_channels);
- REQUIRE(GetWidth(header1.data_window) == GetWidth(header2.data_window));
- REQUIRE(GetHeight(header1.data_window) == GetHeight(header2.data_window));
- //REQUIRE(header1.display_window == header2.display_window);
- //REQUIRE(header1.screen_window_width == header2.screen_window_width);
- //REQUIRE(header1.pixel_aspect_ratio == header2.pixel_aspect_ratio);
- REQUIRE(header1.tiled == header2.tiled);
- REQUIRE(header1.tile_size_x == header2.tile_size_x);
- REQUIRE(header1.tile_size_y == header2.tile_size_y);
- REQUIRE(header1.tile_level_mode == header2.tile_level_mode);
- REQUIRE(header1.tile_rounding_mode == header2.tile_rounding_mode);
-
- REQUIRE(header1.non_image == header2.non_image);
-
- REQUIRE(0 == strcmp(header1.name, header2.name));
-
- for (int c = 0; c < header1.num_channels; c++)
- {
- REQUIRE(header1.pixel_types[c] == header2.pixel_types[c]); // assume no conversion
- REQUIRE(0 == strcmp(header1.channels[c].name, header2.channels[c].name));
- REQUIRE(header1.channels[c].pixel_type == header2.pixel_types[c]);
- //REQUIRE(header1.channels[c].p_linear == header2.channels[c].p_linear);
- //REQUIRE(header1.channels[c].x_sampling == header2.channels[c].x_sampling);
- //REQUIRE(header1.channels[c].y_sampling == header2.channels[c].y_sampling);
- }
-}
-
-static void CompareImages(const EXRImage& image1, const EXRImage& image2)
-{
- bool tiles_ok = image1.tiles && image2.tiles || image1.tiles == NULL && image2.tiles == NULL;
- REQUIRE(true == tiles_ok);
- bool images_ok = image1.images && image2.images || image1.images == NULL && image2.images == NULL;
- REQUIRE(true == images_ok);
- REQUIRE(image1.num_channels == image2.num_channels);
-
- const EXRImage* level_image1 = &image1;
- const EXRImage* level_image2 = &image2;
- while(level_image1 && level_image2)
- {
- REQUIRE(level_image1->level_x == level_image2->level_x);
- REQUIRE(level_image1->level_y == level_image2->level_y);
- REQUIRE(level_image1->width == level_image2->width);
- REQUIRE(level_image1->height == level_image2->height);
- REQUIRE(level_image1->num_tiles == level_image2->num_tiles);
- level_image1 = level_image1->next_level;
- level_image2 = level_image2->next_level;
- bool levels_ok = level_image1 && level_image2 || level_image1 == NULL && level_image2 == NULL;
- REQUIRE(true == levels_ok);
- }
-}
-
-TEST_CASE("asakusa", "[Load]") {
- EXRVersion exr_version;
- EXRImage exr_image;
- InitEXRImage(&exr_image);
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
- const char* err = NULL;
- int ret = ParseEXRVersionFromFile(&exr_version, "../../asakusa.exr");
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, "../../asakusa.exr",
- &err);
- REQUIRE(NULL == err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRImage(&exr_image);
- FreeEXRHeader(&exr_header);
-}
-
-TEST_CASE("utf8filename", "[Load]") {
- EXRVersion exr_version;
-
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
- const char* err = NULL;
-
-#ifdef _WIN32
-
-#if defined(_MSC_VER)
- // Include UTF-16LE encoded string
- const wchar_t* wfilename =
-#include "win32-filelist-utf16le.inc"
- ;
-
- // convert to char*
- // https://stackoverflow.com/questions/12637779/how-to-convert-const-wchar-to-const-char/12637971
-
- FILE* fp;
- errno_t errcode = _wfopen_s(&fp, wfilename, L"rb");
-
- REQUIRE(0 == errcode);
-
- char filename[1024];
- int charlen = 1000;
-
- int strlen = WideCharToMultiByte(65001 /* UTF8 */, 0, wfilename, -1, filename,
- (int)charlen, NULL, NULL);
-
- REQUIRE(strlen == 27);
-#else
- // MinGW or clang.
- // At least clang cannot feed UTF-16LE source code, so provide UTF-8 encoded
- // file path
- const char* utf8filename =
-#include "win32-filelist-utf8.inc"
- ;
-
- // to wchar_t
- const std::wstring wfilename = UTF8_to_wchar(utf8filename);
-
- FILE* fp;
- errno_t errcode = _wfopen_s(&fp, wfilename.c_str(), L"rb");
-
- REQUIRE(0 == errcode);
-
- char filename[1024];
- int charlen = 1000;
-
- // wchar_t to multibyte char
- int strlen = WideCharToMultiByte(65001 /* UTF8 */, 0, wfilename.c_str(), -1,
- filename, (int)charlen, NULL, NULL);
-
- REQUIRE(strlen == 27);
-
-#endif
-
-#else
- // Assume this source code is compiled with UTF-8(UNICODE)
- const char* filename = "./regression/日本語.exr";
-#endif
-
- int ret = ParseEXRVersionFromFile(&exr_version, filename);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, filename, &err);
- REQUIRE(NULL == err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&exr_header);
-}
-
-TEST_CASE("ScanLines", "[Load]") {
- std::vector<std::string> inputs;
- inputs.push_back("ScanLines/Blobbies.exr");
- inputs.push_back("ScanLines/CandleGlass.exr");
- // inputs.push_back("ScanLines/Cannon.exr"); // Cannon.exr will fail since it
- // uses b44 compression which is not yet supported on TinyEXR.
- inputs.push_back("ScanLines/Desk.exr");
- inputs.push_back("ScanLines/MtTamWest.exr");
- inputs.push_back("ScanLines/PrismsLenses.exr");
- inputs.push_back("ScanLines/StillLife.exr");
- inputs.push_back("ScanLines/Tree.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- EXRVersion exr_version;
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("Chromaticities", "[Load]") {
- std::vector<std::string> inputs;
- inputs.push_back("Chromaticities/Rec709.exr");
- inputs.push_back("Chromaticities/Rec709_YC.exr");
- inputs.push_back("Chromaticities/XYZ.exr");
- inputs.push_back("Chromaticities/XYZ_YC.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- EXRVersion exr_version;
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("TestImages", "[Load]") {
- std::vector<std::string> inputs;
- inputs.push_back("TestImages/AllHalfValues.exr");
- inputs.push_back("TestImages/BrightRings.exr");
- inputs.push_back("TestImages/BrightRingsNanInf.exr");
- // inputs.push_back("TestImages/GammaChart.exr"); // disable since this uses
- // pxr24 compression
- // inputs.push_back("TestImages/GrayRampsDiagonal.exr"); // pxr24
- // inputs.push_back("TestImages/GrayRampsHorizontal.exr"); // pxr24
- // inputs.push_back("TestImages/RgbRampsDiagonal.exr"); // pxr24
- // inputs.push_back("TestImages/SquaresSwirls.exr"); // pxr24
- inputs.push_back("TestImages/WideColorGamut.exr");
- // inputs.push_back("TestImages/WideFloatRange.exr"); // pxr24
-
- for (size_t i = 0; i < inputs.size(); i++) {
- EXRVersion exr_version;
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("LuminanceChroma", "[Load]") {
- std::vector<std::string> inputs;
- // inputs.push_back("LuminanceChroma/CrissyField.exr"); // b44
- // inputs.push_back("LuminanceChroma/Flowers.exr"); // b44
- // inputs.push_back("LuminanceChroma/Garden.exr"); // tiled
- inputs.push_back("LuminanceChroma/MtTamNorth.exr");
- inputs.push_back("LuminanceChroma/StarField.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- EXRVersion exr_version;
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("DisplayWindow", "[Load]") {
- std::vector<std::string> inputs;
- inputs.push_back("DisplayWindow/t01.exr");
- inputs.push_back("DisplayWindow/t02.exr");
- inputs.push_back("DisplayWindow/t03.exr");
- inputs.push_back("DisplayWindow/t04.exr");
- inputs.push_back("DisplayWindow/t05.exr");
- inputs.push_back("DisplayWindow/t06.exr");
- inputs.push_back("DisplayWindow/t07.exr");
- inputs.push_back("DisplayWindow/t08.exr");
- inputs.push_back("DisplayWindow/t09.exr");
- inputs.push_back("DisplayWindow/t10.exr");
- inputs.push_back("DisplayWindow/t11.exr");
- inputs.push_back("DisplayWindow/t12.exr");
- inputs.push_back("DisplayWindow/t13.exr");
- inputs.push_back("DisplayWindow/t14.exr");
- inputs.push_back("DisplayWindow/t15.exr");
- inputs.push_back("DisplayWindow/t16.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- EXRVersion exr_version;
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("Tiles/GoldenGate.exr", "[Version]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Tiles/GoldenGate.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
-}
-
-TEST_CASE("Tiles/GoldenGate.exr|Load", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Tiles/GoldenGate.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(1 == header.tiled);
- REQUIRE(TINYEXR_TILE_ONE_LEVEL == header.tile_level_mode);
- REQUIRE(128 == header.tile_size_x);
- REQUIRE(128 == header.tile_size_y);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(NULL != image.tiles);
- REQUIRE(0 == image.level_x);
- REQUIRE(0 == image.level_y);
- REQUIRE(1 == EXRNumLevels(&image));
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-
-TEST_CASE("LuminanceChroma/Garden.exr|Load", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("LuminanceChroma/Garden.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-
-TEST_CASE("Tiles/Ocean.exr", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Tiles/Ocean.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-
-TEST_CASE("MultiResolution/Bonita.exr", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("MultiResolution/Bonita.exr");
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(1 == header.tiled);
- REQUIRE(TINYEXR_TILE_MIPMAP_LEVELS == header.tile_level_mode);
- REQUIRE(TINYEXR_TILE_ROUND_DOWN == header.tile_rounding_mode);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(10 == EXRNumLevels(&image));
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-
-TEST_CASE("MultiResolution/Kapaa.exr", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("MultiResolution/Kapaa.exr");
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(1 == header.tiled);
- REQUIRE(TINYEXR_TILE_RIPMAP_LEVELS == header.tile_level_mode);
- REQUIRE(TINYEXR_TILE_ROUND_UP == header.tile_rounding_mode);
- REQUIRE(64 == header.tile_size_x);
- REQUIRE(64 == header.tile_size_y);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(11*11 == EXRNumLevels(&image));
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-
-TEST_CASE("Saving ScanLines", "[Save]") {
- std::vector<std::string> inputs;
- inputs.push_back("ScanLines/Blobbies.exr");
- inputs.push_back("ScanLines/CandleGlass.exr");
- // inputs.push_back("ScanLines/Cannon.exr"); // Cannon.exr will fail since it
- // uses b44 compression which is not yet supported on TinyEXR.
- inputs.push_back("ScanLines/Desk.exr");
- inputs.push_back("ScanLines/MtTamWest.exr");
- inputs.push_back("ScanLines/PrismsLenses.exr");
- inputs.push_back("ScanLines/StillLife.exr");
- inputs.push_back("ScanLines/Tree.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Input:" << filepath << std::endl;
-
- EXRVersion version1;
- int ret = ParseEXRVersionFromFile(&version1, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- EXRHeader header1;
- EXRImage image1;
- unsigned char *data = NULL;
- size_t data_size;
- // loading from file
- {
- InitEXRHeader(&header1);
- InitEXRImage(&image1);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header1, &version1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image1, &header1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
- // saving to memory
- {
- const char* err = NULL;
- data_size = SaveEXRImageToMemory(&image1, &header1, &data, &err);
- REQUIRE(0 != data_size);
- //FreeEXRHeader(&header);
-#ifdef DUMP_IMAGES
- bool ret = WriteMemoryToFile(GetDumpPath(inputs[i].c_str()).c_str(), data, data_size);
- REQUIRE(true == ret);
-#endif
- }
- // loading back from memory
- {
- EXRVersion version2;
- {
- int ret = ParseEXRVersionFromMemory(&version2, data, data_size);
- REQUIRE(0 == ret);
- }
- EXRHeader header2;
- {
- const char* err = NULL;
- InitEXRHeader(&header2);
- int ret = ParseEXRHeaderFromMemory(&header2, &version2, data, data_size, &err);
- REQUIRE(0 == ret);
- }
- EXRImage image2;
- {
- const char* err = NULL;
- InitEXRImage(&image2);
- int ret = LoadEXRImageFromMemory(&image2, &header2, data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(data);
- }
-
- CompareHeaders(header1, header2);
- CompareImages(image1, image2);
-
- FreeEXRImage(&image2);
- FreeEXRHeader(&header2);
- }
-
- FreeEXRHeader(&header1);
- FreeEXRImage(&image1);
- }
-}
-
-TEST_CASE("Saving MultiResolution", "[Save]") {
- //std::string filepath = GetPath("MultiResolution/Bonita.exr");
- //std::cout << "Load-save-reload:" << filepath << std::endl;
-
- std::vector<std::string> inputs;
- inputs.push_back("MultiResolution/Bonita.exr");
- inputs.push_back("MultiResolution/Kapaa.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Input:" << filepath << std::endl;
-
- EXRVersion version1;
- int ret = ParseEXRVersionFromFile(&version1, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- EXRHeader header1;
- EXRImage image1;
- unsigned char *data = NULL;
- size_t data_size;
- // loading from file
- {
- InitEXRHeader(&header1);
- InitEXRImage(&image1);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header1, &version1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image1, &header1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
- // saving to memory
- {
- const char* err = NULL;
- data_size = SaveEXRImageToMemory(&image1, &header1, &data, &err);
- REQUIRE(0 != data_size);
-#ifdef DUMP_IMAGES
- bool ret = WriteMemoryToFile(GetDumpPath(inputs[i].c_str()).c_str(), data, data_size);
- REQUIRE(true == ret);
-#endif
- }
- // loading back from memory
- {
- EXRVersion version2;
- {
- int ret = ParseEXRVersionFromMemory(&version2, data, data_size);
- REQUIRE(0 == ret);
- }
- EXRHeader header2;
- {
- const char* err = NULL;
- InitEXRHeader(&header2);
- int ret = ParseEXRHeaderFromMemory(&header2, &version2, data, data_size, &err);
- REQUIRE(0 == ret);
- }
- EXRImage image2;
- {
- const char* err = NULL;
- InitEXRImage(&image2);
- int ret = LoadEXRImageFromMemory(&image2, &header2, data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(data);
- }
-
- CompareHeaders(header1, header2);
- CompareImages(image1, image2);
-
- FreeEXRImage(&image2);
- FreeEXRHeader(&header2);
- }
- FreeEXRHeader(&header1);
- FreeEXRImage(&image1);
- }
-}
-
-TEST_CASE("Saving multipart", "[Save]") {
-
- std::vector<std::string> inputs;
- inputs.push_back("Beachball/multipart.0001.exr");
-
- for (size_t i = 0; i < inputs.size(); i++) {
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Input:" << filepath << std::endl;
-
- EXRVersion version1;
- {
- int ret = ParseEXRVersionFromFile(&version1, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == version1.multipart);
- }
-
- EXRHeader** headers1; // list of EXRHeader pointers.
- int num_headers1;
- {
- const char* err = NULL;
- int ret = ParseEXRMultipartHeaderFromFile(&headers1, &num_headers1,
- &version1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
-
- unsigned char *data = NULL;
- size_t data_size;
-
- std::vector<EXRImage> images1(num_headers1);
- // loading from file
- {
- const char* err = NULL;
- for (int j = 0; j < num_headers1; j++) {
- InitEXRImage(&images1[j]);
- }
- int ret = LoadEXRMultipartImageFromFile(&images1[0], const_cast<const EXRHeader**>(headers1),
- static_cast<unsigned int>(num_headers1), filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
- // saving to memory
- {
- const char* err = NULL;
- data_size = SaveEXRMultipartImageToMemory(&images1[0],
- const_cast<const EXRHeader**>(headers1), static_cast<unsigned int>(num_headers1), &data, &err);
- REQUIRE(0 != data_size);
- #ifdef DUMP_IMAGES
- bool ret = WriteMemoryToFile(GetDumpPath(inputs[i].c_str()).c_str(), data, data_size);
- REQUIRE(true == ret);
- #endif
- }
- // loading back from memory
- {
- EXRVersion version2;
- {
- int ret = ParseEXRVersionFromMemory(&version2, data, data_size);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == version2.multipart);
- }
- EXRHeader** headers2;
- int num_headers2;
- {
- const char* err = NULL;
- int ret = ParseEXRMultipartHeaderFromMemory(&headers2, &num_headers2, &version2,
- data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- }
- REQUIRE(num_headers1 == num_headers2);
-
- std::vector<EXRImage> images2(num_headers2);
- {
- for (int j = 0; j < num_headers2; j++) {
- InitEXRImage(&images2[j]);
- }
- const char* err = NULL;
- int ret = LoadEXRMultipartImageFromMemory(&images2[0], const_cast<const EXRHeader**>(headers2),
- static_cast<unsigned int>(num_headers2),
- data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(data);
- }
-
- for (int j = 0; j < num_headers2; j++) {
- CompareHeaders(*headers1[j], *headers2[j]);
- }
- for (int j = 0; j < num_headers2; j++) {
- CompareImages(images1[j], images2[j]);
- }
-
- for (int j = 0; j < num_headers2; j++) {
- FreeEXRImage(&images2[j]);
- FreeEXRHeader(headers2[j]);
- free(headers2[j]);
- }
- free(headers2);
- }
-
- for (int j = 0; j < num_headers1; j++) {
- FreeEXRImage(&images1[j]);
- FreeEXRHeader(headers1[j]);
- free(headers1[j]);
- }
- free(headers1);
- }
-}
-
-TEST_CASE("Saving multipart|Combine", "[Save]") {
-
- std::vector<std::string> inputs;
- inputs.push_back("MultiResolution/Kapaa.exr"); // tiled, ripmap
- inputs.push_back("Tiles/GoldenGate.exr"); // tiled, one level
- inputs.push_back("ScanLines/Desk.exr"); // scanline
- inputs.push_back("MultiResolution/PeriodicPattern.exr"); // tiled, mipmap
-
- const char* dstName = "multipart.collection.exr";
-
- unsigned num_headers1 = inputs.size();
- std::vector<EXRHeader> headers1(num_headers1);
- std::vector<EXRImage> images1(num_headers1);
- // collecting images
- for (size_t i = 0; i < num_headers1; i++) {
- std::string filepath = GetPath(inputs[i].c_str());
- std::cout << "Input:" << filepath << std::endl;
-
- EXRVersion version1;
- {
- int ret = ParseEXRVersionFromFile(&version1, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == version1.multipart);
- }
- {
- InitEXRHeader(&headers1[i]);
- const char* err = NULL;
- int ret = ParseEXRHeaderFromFile(&headers1[i], &version1, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
- {
- InitEXRImage(&images1[i]);
- const char* err = NULL;
- int ret = LoadEXRImageFromFile(&images1[i], &headers1[i], filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- }
- }
-
- unsigned char *data = NULL;
- size_t data_size;
- // saving collection to memory as multipart
- {
- std::vector<EXRHeader*> pheaders1(num_headers1);
- for(unsigned i = 0; i < num_headers1; ++i) pheaders1[i] = &headers1[i];
- for (size_t i = 0; i < num_headers1; i++) {
- EXRSetNameAttr(pheaders1[i], inputs[i].c_str());
- }
- const char* err = NULL;
- data_size = SaveEXRMultipartImageToMemory(&images1[0],
- const_cast<const EXRHeader**>(&pheaders1[0]),
- static_cast<unsigned int>(num_headers1),
- &data, &err);
- REQUIRE(0 != data_size);
-#ifdef DUMP_IMAGES
- bool ret = WriteMemoryToFile(GetDumpPath(dstName).c_str(), data, data_size);
- REQUIRE(true == ret);
-#endif
- }
- // loading back from memory
- {
- EXRVersion version2;
- {
- int ret = ParseEXRVersionFromMemory(&version2, data, data_size);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == version2.multipart);
- }
- EXRHeader** headers2;
- int num_headers2;
- {
- const char* err = NULL;
- int ret = ParseEXRMultipartHeaderFromMemory(&headers2, &num_headers2, &version2,
- data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- }
- REQUIRE(num_headers1 == num_headers2);
-
- std::vector<EXRImage> images2(num_headers2);
- {
- for (int j = 0; j < num_headers2; j++) {
- InitEXRImage(&images2[j]);
- }
- const char* err = NULL;
- int ret = LoadEXRMultipartImageFromMemory(&images2[0], const_cast<const EXRHeader**>(headers2),
- static_cast<unsigned int>(num_headers2),
- data, data_size, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(data);
- }
-
- for (int j = 0; j < num_headers2; j++) {
- CompareHeaders(headers1[j], *headers2[j]);
- }
- for (int j = 0; j < num_headers2; j++) {
- CompareImages(images1[j], images2[j]);
- }
-
- for (int j = 0; j < num_headers2; j++) {
- FreeEXRImage(&images2[j]);
- FreeEXRHeader(headers2[j]);
- free(headers2[j]);
- }
- free(headers2);
- }
-
- for (int i = 0; i < num_headers1; i++) {
- FreeEXRImage(&images1[i]);
- FreeEXRHeader(&headers1[i]);
- }
-}
-
-#if 0 // Spirals.exr uses pxr24 compression
-TEST_CASE("Tiles/Spirals.exr", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Tiles/Spirals.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
-
- ret= LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
-#endif
-
-TEST_CASE("Beachball/multipart.0001.exr", "[Version]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Beachball/multipart.0001.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.multipart);
-
- EXRHeader* headers;
-}
-
-TEST_CASE("Beachball/multipart.0001.exr|Load", "[Load]") {
- EXRVersion exr_version;
- std::string filepath = GetPath("Beachball/multipart.0001.exr");
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.multipart);
-
- EXRHeader** exr_headers; // list of EXRHeader pointers.
- int num_exr_headers;
- const char* err;
-
- ret = ParseEXRMultipartHeaderFromFile(&exr_headers, &num_exr_headers,
- &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- REQUIRE(10 == num_exr_headers);
-
- std::vector<EXRImage> images(static_cast<size_t>(num_exr_headers));
- for (int i = 0; i < num_exr_headers; i++) {
- InitEXRImage(&images[static_cast<size_t>(i)]);
- }
-
- ret = LoadEXRMultipartImageFromFile(
- &images.at(0), const_cast<const EXRHeader**>(exr_headers),
- static_cast<unsigned int>(num_exr_headers), filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- for (int i = 0; i < num_exr_headers; i++) {
- FreeEXRImage(&images.at(static_cast<size_t>(i)));
- }
-
- for (int i = 0; i < num_exr_headers; i++) {
- FreeEXRHeader(exr_headers[static_cast<size_t>(i)]); // free content
- free(exr_headers[static_cast<size_t>(i)]); // free pointer
- }
- free(exr_headers);
-}
-
-TEST_CASE("Beachbal multiparts", "[Load]") {
- int num = 8;
- char buf[1024];
- for (int i = 0; i < num + 1; i++) {
- sprintf(buf, "Beachball/multipart.%04d.exr", i);
- EXRVersion exr_version;
- std::string filepath = GetPath(buf);
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
-
- if (i == 0) { // multipart.0000.exr does not exist.
- REQUIRE(TINYEXR_ERROR_CANT_OPEN_FILE == ret);
- continue;
- }
-
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.multipart);
-
- EXRHeader** exr_headers; // list of EXRHeader pointers.
- int num_exr_headers;
- const char* err;
-
- ret = ParseEXRMultipartHeaderFromFile(&exr_headers, &num_exr_headers,
- &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- REQUIRE(10 == num_exr_headers);
-
- std::vector<EXRImage> images(static_cast<size_t>(num_exr_headers));
- for (int j = 0; j < num_exr_headers; j++) {
- InitEXRImage(&images[static_cast<size_t>(j)]);
- }
-
- ret = LoadEXRMultipartImageFromFile(
- &images.at(0), const_cast<const EXRHeader**>(exr_headers),
- static_cast<unsigned int>(num_exr_headers), filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- for (int j = 0; j < num_exr_headers; j++) {
- FreeEXRImage(&images.at(static_cast<size_t>(j)));
- }
-
- for (int j = 0; j < num_exr_headers; j++) {
- FreeEXRHeader(exr_headers[static_cast<size_t>(j)]);
- free(exr_headers[static_cast<size_t>(j)]);
- }
- free(exr_headers);
- }
-}
-
-TEST_CASE("Beachbal singleparts", "[Load]") {
- int num = 8;
- char buf[1024];
- for (int i = 0; i < num + 1; i++) {
- sprintf(buf, "Beachball/singlepart.%04d.exr", i);
- EXRVersion exr_version;
- std::string filepath = GetPath(buf);
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
-
- if (i == 0) { // multipart.0000.exr does not exist.
- REQUIRE(TINYEXR_ERROR_CANT_OPEN_FILE == ret);
- continue;
- }
-
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- REQUIRE(image.tiles == NULL);
- REQUIRE(image.images);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
- }
-}
-
-TEST_CASE("ParseEXRVersionFromMemory invalid input", "[Parse]") {
- int ret = ParseEXRVersionFromMemory(NULL, NULL, 0);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_ARGUMENT);
-
- {
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- ret = ParseEXRVersionFromMemory(&version, NULL, 0);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_ARGUMENT);
- }
-
- {
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- std::vector<unsigned char> buf(128);
- ret = ParseEXRVersionFromMemory(&version, buf.data(), 0);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_DATA);
- }
-
- {
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- std::vector<unsigned char> buf(4);
- ret = ParseEXRVersionFromMemory(
- &version, buf.data(), 1); // size is less than version header size
- REQUIRE(ret == TINYEXR_ERROR_INVALID_DATA);
- }
-
- {
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- std::vector<unsigned char> buf(8, 0); // invalid magic number
- ret = ParseEXRVersionFromMemory(&version, buf.data(), 8);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_MAGIC_NUMBER);
- }
-}
-
-TEST_CASE("ParseEXRHeaderFromMemory invalid input", "[Parse]") {
- {
- int ret = ParseEXRHeaderFromMemory(NULL, NULL, NULL, 0, NULL);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_ARGUMENT);
- }
-
- {
- EXRHeader header;
- InitEXRHeader(&header);
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
-
- int ret = ParseEXRHeaderFromMemory(&header, &version, NULL, 0, NULL);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_ARGUMENT);
- FreeEXRHeader(&header);
- }
-
- {
- EXRHeader header;
- InitEXRHeader(&header);
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- std::vector<unsigned char> buf(128);
-
- int ret = ParseEXRHeaderFromMemory(&header, &version, buf.data(), 0, NULL);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_DATA);
- FreeEXRHeader(&header);
- }
-
- {
- EXRHeader header;
- InitEXRHeader(&header);
- EXRVersion version;
- memset(&version, 0, sizeof(EXRVersion));
- std::vector<unsigned char> buf(128, 0);
-
- int ret =
- ParseEXRHeaderFromMemory(&header, &version, buf.data(), 128, NULL);
- REQUIRE(ret == TINYEXR_ERROR_INVALID_HEADER);
- FreeEXRHeader(&header);
- }
-}
-
-TEST_CASE("Compressed is smaller than uncompressed", "[Issue40]") {
- EXRHeader header;
- InitEXRHeader(&header);
-
- header.compression_type = TINYEXR_COMPRESSIONTYPE_ZIP;
-
- EXRImage image;
- InitEXRImage(&image);
-
- image.num_channels = 3;
-
- float const images[3][1] = {
- {1.0f},
- {0.0f},
- {0.0f},
- };
-
- float const* const image_ptr[3] = {
- images[2],
- images[1],
- images[0],
- };
-
- image.images = const_cast<unsigned char**>(reinterpret_cast<const unsigned char*const *>(image_ptr));
- image.width = 1;
- image.height = 1;
-
- header.num_channels = 3;
- header.channels =
- static_cast<EXRChannelInfo*>(malloc(sizeof(EXRChannelInfo) * static_cast<size_t>(header.num_channels)));
- // Must be BGR(A) order, since most of EXR viewers expect this channel order.
- strncpy(header.channels[0].name, "B", 255);
- header.channels[0].name[strlen("B")] = '\0';
- strncpy(header.channels[1].name, "G", 255);
- header.channels[1].name[strlen("G")] = '\0';
- strncpy(header.channels[2].name, "R", 255);
- header.channels[2].name[strlen("R")] = '\0';
-
- header.pixel_types = static_cast<int*>(malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
- header.requested_pixel_types =
- static_cast<int*>(malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
- for (int i = 0; i < header.num_channels; i++) {
- header.pixel_types[i] =
- TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
- header.requested_pixel_types[i] =
- TINYEXR_PIXELTYPE_FLOAT; // pixel type of output image to be stored in
- // .EXR
- }
-
- const char* err;
- int const ret = SaveEXRImageToFile(&image, &header, "issue40.exr", &err);
- REQUIRE(ret == TINYEXR_SUCCESS);
-
- free(header.channels);
- free(header.requested_pixel_types);
- free(header.pixel_types);
-}
-
-// TEST_CASE("Regression: Issue54", "[fuzzing]") {
-// EXRVersion exr_version;
-// std::string filepath =
-// "./regression/poc-360c3b0555cb979ca108f2d178cf8a80959cfeabaa4ec1d310d062fa653a8c6b_min";
-// int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
-// REQUIRE(TINYEXR_SUCCESS == ret);
-// REQUIRE(false == exr_version.tiled);
-// REQUIRE(false == exr_version.non_image);
-// REQUIRE(false == exr_version.multipart);
-//
-// EXRVersion version;
-// EXRHeader header;
-// EXRImage image;
-// InitEXRHeader(&header);
-// InitEXRImage(&image);
-//
-// const char* err;
-// ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
-// REQUIRE(TINYEXR_SUCCESS == ret);
-//
-// ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
-// REQUIRE(TINYEXR_SUCCESS == ret);
-//
-// FreeEXRHeader(&header);
-// FreeEXRImage(&image);
-//}
-
-TEST_CASE("Regression: Issue50", "[fuzzing]") {
- EXRVersion exr_version;
- std::string filepath =
- "./regression/"
- "poc-eedff3a9e99eb1c0fd3a3b0989e7c44c0a69f04f10b23e5264f362a4773f4397_"
- "min";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == false);
- if (ret) {
- FreeEXRErrorMessage(err);
- }
-
- FreeEXRHeader(&header);
- // FreeEXRImage(&image);
-}
-
-TEST_CASE("Regression: Issue57", "[fuzzing]") {
- EXRVersion exr_version;
- std::string filepath =
- "./regression/"
- "poc-df76d1f27adb8927a1446a603028272140905c168a336128465a1162ec7af270."
- "mini";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == false);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-
- FreeEXRHeader(&header);
- // FreeEXRImage(&image);
-}
-
-TEST_CASE("Regression: Issue56", "[fuzzing]") {
- EXRVersion exr_version;
- std::string filepath =
- "./regression/"
- "poc-1383755b301e5f505b2198dc0508918b537fdf48bbfc6deeffe268822e6f6cd6";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == false);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-
- FreeEXRHeader(&header);
- // FreeEXRImage(&image);
-}
-
-TEST_CASE("Regression: Issue61", "[fuzzing]") {
- EXRVersion exr_version;
- std::string filepath =
- "./regression/"
- "poc-3f1f642c3356fd8e8d2a0787613ec09a56572b3a1e38c9629b6db9e8dead1117_"
- "min";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == false);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-
- FreeEXRHeader(&header);
- // FreeEXRImage(&image);
-}
-
-TEST_CASE("Regression: Issue60", "[fuzzing]") {
- EXRVersion exr_version;
- std::string filepath =
- "./regression/"
- "poc-5b66774a7498c635334ad386be0c3b359951738ac47f14878a3346d1c6ea0fe5_"
- "min";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(false == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == false);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-
- FreeEXRHeader(&header);
- // FreeEXRImage(&image);
-}
-
-TEST_CASE("Regression: Issue71", "[issue71]") {
- std::string filepath = "./regression/2by2.exr";
-
- const char* err;
- int width, height;
- float* image;
- int ret = LoadEXR(&image, &width, &height, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(2 == width);
- REQUIRE(2 == height);
-
- REQUIRE(0.0f == Approx(image[8]));
- REQUIRE(0.447021f == Approx(image[9]));
- REQUIRE(1.0f == Approx(image[10]));
- REQUIRE(0.250977f == Approx(image[11]));
- REQUIRE(0.0f == Approx(image[12]));
- REQUIRE(0.0f == Approx(image[13]));
- REQUIRE(0.0f == Approx(image[14]));
- REQUIRE(1.0f == Approx(image[15]));
-
- free(image);
-}
-
-// LoadEXRLoadFromMemory fails to load tiled image.
-TEST_CASE("Regression: Issue93", "[issue93]") {
- std::string filepath = GetPath("Tiles/GoldenGate.exr");
-
- std::ifstream f(filepath.c_str(), std::ifstream::binary);
- REQUIRE(f.good());
-
- f.seekg(0, f.end);
- size_t sz = static_cast<size_t>(f.tellg());
- f.seekg(0, f.beg);
-
- REQUIRE(sz > 16);
-
- std::vector<unsigned char> data;
-
- data.resize(sz);
- f.read(reinterpret_cast<char*>(&data.at(0)),
- static_cast<std::streamsize>(sz));
- f.close();
-
- const char* err;
- int width, height;
- float* image;
- int ret = LoadEXRFromMemory(&image, &width, &height, data.data(), data.size(),
- &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- std::cout << "val = " << image[0] << ", " << image[1] << ", " << image[2]
- << ", " << image[3] << std::endl;
-
- REQUIRE(0.0612183 == Approx(image[0]));
- REQUIRE(0.0892334 == Approx(image[1]));
- REQUIRE(0.271973 == Approx(image[2]));
-
- free(image);
-}
-
-// PIZ decompress bug(issue 100)
-TEST_CASE("Regression: Issue100", "[issue100]") {
- std::string filepath = "./regression/piz-bug-issue-100.exr";
-
- std::ifstream f(filepath.c_str(), std::ifstream::binary);
- REQUIRE(f.good());
-
- f.seekg(0, f.end);
- size_t sz = static_cast<size_t>(f.tellg());
- f.seekg(0, f.beg);
-
- REQUIRE(sz > 16);
-
- std::vector<unsigned char> data;
-
- data.resize(sz);
- f.read(reinterpret_cast<char*>(&data.at(0)),
- static_cast<std::streamsize>(sz));
- f.close();
-
- const char* err = nullptr;
- int width, height;
- float* image;
- int ret = LoadEXRFromMemory(&image, &width, &height, data.data(), data.size(),
- &err);
- if (err) {
- std::cerr << "issue100 err " << err << std::endl;
- FreeEXRErrorMessage(err);
- }
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(35 == width);
- REQUIRE(1 == height);
-
- // pixel should be white.
-
- std::cout << "pixel[0] = " << image[0] << ", " << image[1] << ", " << image[2]
- << ", " << image[3] << std::endl;
- std::cout << "pixel[34] = " << image[4 * 34 + 0] << ", " << image[4 * 34 + 1]
- << ", " << image[4 * 34 + 2] << ", " << image[4 * 34 + 3]
- << std::endl;
-
- REQUIRE(0.0 == Approx(image[0]));
- REQUIRE(0.0 == Approx(image[1]));
- REQUIRE(0.0 == Approx(image[2]));
- REQUIRE(0.0 == Approx(image[3]));
-
- REQUIRE(1.0 == Approx(image[4 * 34 + 0]));
- REQUIRE(1.0 == Approx(image[4 * 34 + 1]));
- REQUIRE(1.0 == Approx(image[4 * 34 + 2]));
- REQUIRE(1.0 == Approx(image[4 * 34 + 3]));
-
- free(image);
-}
-
-TEST_CASE("Regression: Issue53|Channels", "[issue53]") {
- EXRVersion exr_version;
- std::string filepath = "./regression/flaga.exr";
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
-
- const char* err = nullptr;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- std::vector<std::string> layer_names;
- tinyexr::GetLayers(header, layer_names);
-
- REQUIRE(2 == layer_names.size());
-
- std::vector<tinyexr::LayerChannel> channels;
- tinyexr::ChannelsInLayer(header, "", channels);
- REQUIRE(8 == channels.size());
-
- channels.clear();
- tinyexr::ChannelsInLayer(header, "Warstwa 3", channels);
- REQUIRE(0 == channels.size());
-
- channels.clear();
- tinyexr::ChannelsInLayer(header, "Warstwa 1", channels);
- REQUIRE(4 == channels.size());
-
- FreeEXRHeader(&header);
-
- if (err) {
- FreeEXRErrorMessage(err);
- }
-}
-
-TEST_CASE("Regression: Issue53|Image", "[issue53]") {
- std::string filepath = "./regression/flaga.exr";
-
- const char* err = nullptr;
- const char** layer_names = nullptr;
- int num_layers = 0;
- int ret = EXRLayers(filepath.c_str(), &layer_names, &num_layers, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(2 == num_layers);
- for (int i = 0; i < num_layers; i++) {
- free(reinterpret_cast<void*>(const_cast<char*>(layer_names[i])));
- }
- free(layer_names);
-
- int width, height;
- float* image;
- ret = LoadEXRWithLayer(&image, &width, &height, filepath.c_str(), NULL, &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(image);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-
- ret = LoadEXRWithLayer(&image, &width, &height, filepath.c_str(), "Warstwa 1",
- &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
- free(image);
- if (err) {
- FreeEXRErrorMessage(err);
- }
-}
-
-TEST_CASE("Regression: Issue53|Image|Missing Layer", "[issue53]") {
- std::string filepath = GetPath("MultiView/Impact.exr");
-
- const char* err = nullptr;
- int width, height;
- float* image = nullptr;
- int ret = LoadEXRWithLayer(&image, &width, &height, filepath.c_str(),
- "Warstwa", &err);
- REQUIRE(TINYEXR_ERROR_LAYER_NOT_FOUND == ret);
- if (image) {
- free(image);
- }
- if (err) {
- FreeEXRErrorMessage(err);
- }
-}
-
-TEST_CASE("Regression: PR150|Read|1x1 1xhalf", "[pr150]") {
- std::string filepath = "./regression/tiled_half_1x1_alpha.exr";
-
- EXRVersion exr_version;
- std::cout << "Loading" << filepath << std::endl;
- int ret = ParseEXRVersionFromFile(&exr_version, filepath.c_str());
- REQUIRE(TINYEXR_SUCCESS == ret);
- REQUIRE(true == exr_version.tiled);
- REQUIRE(false == exr_version.non_image);
- REQUIRE(false == exr_version.multipart);
-
- EXRVersion version;
- EXRHeader header;
- EXRImage image;
- InitEXRHeader(&header);
- InitEXRImage(&image);
-
- const char* err;
- ret = ParseEXRHeaderFromFile(&header, &exr_version, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- ret = LoadEXRImageFromFile(&image, &header, filepath.c_str(), &err);
- REQUIRE(TINYEXR_SUCCESS == ret);
-
- FreeEXRHeader(&header);
- FreeEXRImage(&image);
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/vcbuild.bat b/graphics/asymptote/cudareflect/tinyexr/test/unit/vcbuild.bat
deleted file mode 100644
index e8646735e9..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/vcbuild.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-chcp 437
-python kuroga.py config-msvc.py
-call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
-ninja
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf16le.inc b/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf16le.inc
deleted file mode 100644
index b784ce8c94..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf16le.inc
+++ /dev/null
Binary files differ
diff --git a/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf8.inc b/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf8.inc
deleted file mode 100644
index a2b9366d57..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test/unit/win32-filelist-utf8.inc
+++ /dev/null
@@ -1 +0,0 @@
-u8"./regression/日本語.exr"
diff --git a/graphics/asymptote/cudareflect/tinyexr/test_tinyexr.cc b/graphics/asymptote/cudareflect/tinyexr/test_tinyexr.cc
deleted file mode 100644
index 07a38a4769..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/test_tinyexr.cc
+++ /dev/null
@@ -1,469 +0,0 @@
-#if defined(_WIN32)
-
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#include <tchar.h>
-#include <windows.h>
-#endif
-
-#include <cstdio>
-#include <cstdlib>
-#include <iostream>
-#include <vector>
-
-// Uncomment if you want to use system provided zlib.
-// #define TINYEXR_USE_MINIZ (0)
-// #include <zlib.h>
-
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
-
-#ifdef __clang__
-#if __has_warning("-Wzero-as-null-pointer-constant")
-#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
-#endif
-#endif
-
-#define SIMPLE_API_EXAMPLE
-//#define TEST_ZFP_COMPRESSION
-
-#ifdef SIMPLE_API_EXAMPLE
-
-#if 0
-static void
-SaveAsPFM(const char* filename, int width, int height, float* data)
-{
-#ifdef _WIN32
- FILE* fp = NULL;
- fopen_s(&fp, filename, "wb");
-#else
- FILE* fp = fopen(filename, "wb");
-#endif
- if (!fp) {
- fprintf(stderr, "failed to write a PFM file.\n");
- return;
- }
-
- fprintf(fp, "PF\n");
- fprintf(fp, "%d %d\n", width, height);
- fprintf(fp, "-1\n"); // -1: little endian, 1: big endian
-
- // RGBA -> RGB
- std::vector<float> rgb(static_cast<size_t>(width*height*3));
-
- for (size_t i = 0; i < static_cast<size_t>(width * height); i++) {
- rgb[3*i+0] = data[4*i+0];
- rgb[3*i+1] = data[4*i+1];
- rgb[3*i+2] = data[4*i+2];
- }
-
- fwrite(&rgb.at(0), sizeof(float), static_cast<size_t>(width * height * 3), fp);
-
- fclose(fp);
-}
-#endif
-
-#else
-
-static const char* GetPixelType(int id) {
- if (id == TINYEXR_PIXELTYPE_HALF) {
- return "HALF";
- } else if (id == TINYEXR_PIXELTYPE_FLOAT) {
- return "FLOAT";
- } else if (id == TINYEXR_PIXELTYPE_UINT) {
- return "UINT";
- }
-
- return "???";
-}
-
-// Simple tile -> scanline converter. Assumes FLOAT pixel type for all channels.
-static void TiledImageToScanlineImage(EXRImage* src, const EXRHeader* header) {
- assert(header->data_window.max_x - header->data_window.min_x + 1 >= 0);
- assert(header->data_window.max_y - header->data_window.min_y + 1 >= 0);
- size_t data_width =
- static_cast<size_t>(header->data_window.max_x - header->data_window.min_x + 1);
- size_t data_height =
- static_cast<size_t>(header->data_window.max_y - header->data_window.min_y + 1);
-
- src->images = static_cast<unsigned char**>(
- malloc(sizeof(float*) * static_cast<size_t>(header->num_channels)));
- for (size_t c = 0; c < static_cast<size_t>(header->num_channels); c++) {
- assert(header->pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
- src->images[c] = static_cast<unsigned char*>(
- malloc(sizeof(float) * data_width * data_height));
- memset(src->images[c], 0, sizeof(float) * data_width * data_height);
- }
-
- for (size_t tile_idx = 0; tile_idx < static_cast<size_t>(src->num_tiles);
- tile_idx++) {
- size_t sx = static_cast<size_t>(src->tiles[tile_idx].offset_x *
- header->tile_size_x);
- size_t sy = static_cast<size_t>(src->tiles[tile_idx].offset_y *
- header->tile_size_y);
- size_t ex = static_cast<size_t>(src->tiles[tile_idx].offset_x *
- header->tile_size_x +
- src->tiles[tile_idx].width);
- size_t ey = static_cast<size_t>(src->tiles[tile_idx].offset_y *
- header->tile_size_y +
- src->tiles[tile_idx].height);
-
- for (size_t c = 0; c < static_cast<size_t>(header->num_channels); c++) {
- float* dst_image = reinterpret_cast<float*>(src->images[c]);
- const float* src_image =
- reinterpret_cast<const float*>(src->tiles[tile_idx].images[c]);
- for (size_t y = 0; y < static_cast<size_t>(ey - sy); y++) {
- for (size_t x = 0; x < static_cast<size_t>(ex - sx); x++) {
- dst_image[(y + sy) * data_width + (x + sx)] =
- src_image[y * static_cast<size_t>(header->tile_size_x) + x];
- }
- }
- }
- }
-}
-#endif
-
-#if defined(_WIN32)
-
-#if defined(__MINGW32__)
-// __wgetmainargs is not defined in windows.h
-extern "C" int __wgetmainargs(int*, wchar_t***, wchar_t***, int, int*);
-#endif
-
-// https://gist.github.com/trueroad/fb4d0c3f67285bf66804
-namespace {
-std::vector<char> utf16_to_utf8(const wchar_t* wc) {
- int size = WideCharToMultiByte(CP_UTF8, 0, wc, -1, NULL, 0, NULL, NULL);
- std::vector<char> retval(size);
- if (size) {
- WideCharToMultiByte(CP_UTF8, 0, wc, -1, retval.data(), retval.size(), NULL,
- NULL);
- } else
- retval.push_back('\0');
- return retval;
-}
-} // namespace
-#endif
-
-static int test_main(int argc, char** argv);
-
-#if defined(_WIN32)
-#if defined(__MINGW32__)
-int main() {
- wchar_t** wargv;
- wchar_t** wenpv;
- int argc = 0, si = 0;
- __wgetmainargs(&argc, &wargv, &wenpv, 1, &si);
-
- std::vector<std::vector<char> > argv_vvc(argc);
- std::vector<char*> argv_vc(argc);
-
- for (int i = 0; i < argc; i++) {
- argv_vvc.at(i) = utf16_to_utf8(wargv[i]);
- argv_vc.at(i) = argv_vvc.at(i).data();
- }
-
- // TODO(syoyo): envp
-
- return test_main(argc, argv_vc.data());
-}
-#else // Assume MSVC
-int _tmain(int argc, _TCHAR** wargv) {
- std::vector<std::vector<char> > argv_vvc(argc);
- std::vector<char*> argv_vc(argc);
-
- for (int i = 0; i < argc; i++) {
-#if defined(UNICODE) || defined(_UNICODE)
- argv_vvc.at(i) = utf16_to_utf8(wargv[i]);
-#else
- size_t slen = _tcslen(wargv[i]);
- std::vector<char> buf(slen + 1);
- memcpy(buf.data(), wargv[i], slen);
- buf[slen] = '\0';
- argv_vvc.at(i) = buf;
-#endif
-
- argv_vc.at(i) = argv_vvc.at(i).data();
- }
-
- return test_main(argc, argv_vc.data());
-}
-#endif
-#else
-int main(int argc, char** argv) { return test_main(argc, argv); }
-#endif
-
-int test_main(int argc, char** argv) {
- const char* outfilename = "output_test.exr";
- const char* err = NULL;
-
- if (argc < 2) {
- fprintf(stderr, "Needs input.exr.\n");
- exit(-1);
- }
-
- if (argc > 2) {
- outfilename = argv[2];
- }
-
- const char* input_filename = argv[1];
-
-#ifdef SIMPLE_API_EXAMPLE
- (void)outfilename;
- int width, height;
- float* image;
-
- int ret = IsEXR(input_filename);
- if (ret != TINYEXR_SUCCESS) {
- fprintf(stderr, "Header err. code %d\n", ret);
- exit(-1);
- }
-
- ret = LoadEXR(&image, &width, &height, input_filename, &err);
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- fprintf(stderr, "Load EXR err: %s(code %d)\n", err, ret);
- } else {
- fprintf(stderr, "Load EXR err: code = %d\n", ret);
- }
- FreeEXRErrorMessage(err);
- return ret;
- }
- // SaveAsPFM("output.pfm", width, height, image);
- ret = SaveEXR(image, width, height, 4 /* =RGBA*/,
- 1 /* = save as fp16 format */, "output.exr", &err);
- if (ret != TINYEXR_SUCCESS) {
- if (err) {
- fprintf(stderr, "Save EXR err: %s(code %d)\n", err, ret);
- } else {
- fprintf(stderr, "Failed to save EXR image. code = %d\n", ret);
- }
- }
- free(image);
-
- std::cout << "Wrote output.exr." << std::endl;
-#else
-
- EXRVersion exr_version;
-
- int ret = ParseEXRVersionFromFile(&exr_version, input_filename);
- if (ret != 0) {
- fprintf(stderr, "Invalid EXR file: %s\n", input_filename);
- return -1;
- }
-
- printf(
- "version: tiled = %d, long_name = %d, non_image = %d, multipart = %d\n",
- exr_version.tiled, exr_version.long_name, exr_version.non_image,
- exr_version.multipart);
-
- if (exr_version.multipart) {
- EXRHeader** exr_headers; // list of EXRHeader pointers.
- int num_exr_headers;
-
- ret = ParseEXRMultipartHeaderFromFile(&exr_headers, &num_exr_headers,
- &exr_version, argv[1], &err);
- if (ret != 0) {
- fprintf(stderr, "Parse EXR err: %s\n", err);
- return ret;
- }
-
- printf("num parts = %d\n", num_exr_headers);
-
- for (size_t i = 0; i < static_cast<size_t>(num_exr_headers); i++) {
- const EXRHeader& exr_header = *(exr_headers[i]);
-
- printf("Part: %lu\n", static_cast<unsigned long>(i));
-
- printf("dataWindow = %d, %d, %d, %d\n", exr_header.data_window.min_x,
- exr_header.data_window.min_y, exr_header.data_window.max_x,
- exr_header.data_window.max_y);
- printf("displayWindow = %d, %d, %d, %d\n", exr_header.display_window.min_x,
- exr_header.display_window.min_y, exr_header.display_window.max_x,
- exr_header.display_window.max_y);
- printf("screenWindowCenter = %f, %f\n",
- static_cast<double>(exr_header.screen_window_center[0]),
- static_cast<double>(exr_header.screen_window_center[1]));
- printf("screenWindowWidth = %f\n",
- static_cast<double>(exr_header.screen_window_width));
- printf("pixelAspectRatio = %f\n",
- static_cast<double>(exr_header.pixel_aspect_ratio));
- printf("lineOrder = %d\n", exr_header.line_order);
-
- if (exr_header.num_custom_attributes > 0) {
- printf("# of custom attributes = %d\n",
- exr_header.num_custom_attributes);
- for (int a = 0; a < exr_header.num_custom_attributes; a++) {
- printf(" [%d] name = %s, type = %s, size = %d\n", a,
- exr_header.custom_attributes[a].name,
- exr_header.custom_attributes[a].type,
- exr_header.custom_attributes[a].size);
- // if (strcmp(exr_header.custom_attributes[i].type, "float") == 0) {
- // printf(" value = %f\n", *reinterpret_cast<float
- // *>(exr_header.custom_attributes[i].value));
- //}
- }
- }
- }
-
- std::vector<EXRImage> images(static_cast<size_t>(num_exr_headers));
- for (size_t i = 0; i < static_cast<size_t>(num_exr_headers); i++) {
- InitEXRImage(&images[i]);
- }
-
- ret = LoadEXRMultipartImageFromFile(
- &images.at(0), const_cast<const EXRHeader**>(exr_headers),
- static_cast<unsigned int>(num_exr_headers), input_filename, &err);
- if (ret != 0) {
- fprintf(stderr, "Load EXR err: %s\n", err);
- FreeEXRErrorMessage(err);
- return ret;
- }
-
- printf("Loaded %d part images\n", num_exr_headers);
- printf(
- "There is no saving feature for multi-part images, thus just exit an "
- "application...\n");
-
- for (size_t i = 0; i < static_cast<size_t>(num_exr_headers); i++) {
- FreeEXRImage(&images.at(i));
- }
-
- for (size_t i = 0; i < static_cast<size_t>(num_exr_headers); i++) {
- FreeEXRHeader(exr_headers[i]);
- free(exr_headers[i]);
- }
- free(exr_headers);
-
- } else { // single-part EXR
-
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
-
- ret =
- ParseEXRHeaderFromFile(&exr_header, &exr_version, input_filename, &err);
- if (ret != 0) {
- fprintf(stderr, "Parse single-part EXR err: %s\n", err);
- FreeEXRErrorMessage(err);
- return ret;
- }
-
- printf("dataWindow = %d, %d, %d, %d\n", exr_header.data_window.min_x,
- exr_header.data_window.min_y, exr_header.data_window.max_x,
- exr_header.data_window.max_y);
- printf("displayWindow = %d, %d, %d, %d\n", exr_header.display_window.min_x,
- exr_header.display_window.min_y, exr_header.display_window.max_x,
- exr_header.display_window.max_y);
- printf("screenWindowCenter = %f, %f\n",
- static_cast<double>(exr_header.screen_window_center[0]),
- static_cast<double>(exr_header.screen_window_center[1]));
- printf("screenWindowWidth = %f\n",
- static_cast<double>(exr_header.screen_window_width));
- printf("pixelAspectRatio = %f\n",
- static_cast<double>(exr_header.pixel_aspect_ratio));
- printf("lineOrder = %d\n", exr_header.line_order);
-
- if (exr_header.num_custom_attributes > 0) {
- printf("# of custom attributes = %d\n", exr_header.num_custom_attributes);
- for (int i = 0; i < exr_header.num_custom_attributes; i++) {
- printf(" [%d] name = %s, type = %s, size = %d\n", i,
- exr_header.custom_attributes[i].name,
- exr_header.custom_attributes[i].type,
- exr_header.custom_attributes[i].size);
- // if (strcmp(exr_header.custom_attributes[i].type, "float") == 0) {
- // printf(" value = %f\n", *reinterpret_cast<float
- // *>(exr_header.custom_attributes[i].value));
- //}
- }
- }
-
- // Read HALF channel as FLOAT.
- for (int i = 0; i < exr_header.num_channels; i++) {
- if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) {
- exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
- }
- }
-
- EXRImage exr_image;
- InitEXRImage(&exr_image);
-
- ret = LoadEXRImageFromFile(&exr_image, &exr_header, input_filename, &err);
- if (ret != 0) {
- fprintf(stderr, "Load EXR err: %s\n", err);
- FreeEXRHeader(&exr_header);
- FreeEXRErrorMessage(err);
- return ret;
- }
-
- printf("EXR: %d x %d\n", exr_image.width, exr_image.height);
-
- for (int i = 0; i < exr_header.num_channels; i++) {
- printf("pixelType[%d]: %s\n", i, GetPixelType(exr_header.pixel_types[i]));
- printf("chan[%d] = %s\n", i, exr_header.channels[i].name);
- printf("requestedPixelType[%d]: %s\n", i,
- GetPixelType(exr_header.requested_pixel_types[i]));
- }
-
-#if 0 // example to write custom attribute
- int version_minor = 3;
- exr_header.num_custom_attributes = 1;
- exr_header.custom_attributes = reinterpret_cast<EXRAttribute *>(malloc(sizeof(EXRAttribute) * exr_header.custom_attributes));
- strcpy(exr_header.custom_attributes[0].name, "tinyexr_version_minor");
- exr_header.custom_attributes[0].name[strlen("tinyexr_version_minor")] = '\0';
- strcpy(exr_header.custom_attributes[0].type, "int");
- exr_header.custom_attributes[0].type[strlen("int")] = '\0';
- exr_header.custom_attributes[0].size = sizeof(int);
- exr_header.custom_attributes[0].value = (unsigned char*)malloc(sizeof(int));
- memcpy(exr_header.custom_attributes[0].value, &version_minor, sizeof(int));
-#endif
-
- if (exr_header.tiled) {
- TiledImageToScanlineImage(&exr_image, &exr_header);
- }
-
- exr_header.compression_type = TINYEXR_COMPRESSIONTYPE_NONE;
-
-#ifdef TEST_ZFP_COMPRESSION
- // Assume input image is FLOAT pixel type.
- for (int i = 0; i < exr_header.num_channels; i++) {
- exr_header.channels[i].pixel_type = TINYEXR_PIXELTYPE_FLOAT;
- exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
- }
-
- unsigned char zfp_compression_type = TINYEXR_ZFP_COMPRESSIONTYPE_RATE;
- double zfp_compression_rate = 4;
- exr_header.num_custom_attributes = 2;
- strcpy(exr_header.custom_attributes[0].name, "zfpCompressionType");
- exr_header.custom_attributes[0].name[strlen("zfpCompressionType")] = '\0';
- exr_header.custom_attributes[0].size = 1;
- exr_header.custom_attributes[0].value =
- (unsigned char*)malloc(sizeof(unsigned char));
- exr_header.custom_attributes[0].value[0] = zfp_compression_type;
-
- strcpy(exr_header.custom_attributes[1].name, "zfpCompressionRate");
- exr_header.custom_attributes[1].name[strlen("zfpCompressionRate")] = '\0';
- exr_header.custom_attributes[1].size = sizeof(double);
- exr_header.custom_attributes[1].value =
- (unsigned char*)malloc(sizeof(double));
- memcpy(exr_header.custom_attributes[1].value, &zfp_compression_rate,
- sizeof(double));
- exr_header.compression_type = TINYEXR_COMPRESSIONTYPE_ZFP;
-#endif
-
- ret = SaveEXRImageToFile(&exr_image, &exr_header, outfilename, &err);
- if (ret != 0) {
- fprintf(stderr, "Save EXR err: %s\n", err);
- FreeEXRHeader(&exr_header);
- FreeEXRErrorMessage(err);
- return ret;
- }
- printf("Saved exr file. [ %s ] \n", outfilename);
-
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- }
-#endif
-
- return ret;
-}
diff --git a/graphics/asymptote/cudareflect/tinyexr/tinyexr.cc b/graphics/asymptote/cudareflect/tinyexr/tinyexr.cc
deleted file mode 100644
index fef8f66c98..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/tinyexr.cc
+++ /dev/null
@@ -1,8 +0,0 @@
-#if defined(_WIN32)
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#endif
-
-#define TINYEXR_IMPLEMENTATION
-#include "tinyexr.h"
diff --git a/graphics/asymptote/cudareflect/tinyexr/tinyexr.h b/graphics/asymptote/cudareflect/tinyexr/tinyexr.h
deleted file mode 100644
index 8bc7cd1d44..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/tinyexr.h
+++ /dev/null
@@ -1,8533 +0,0 @@
-#ifndef TINYEXR_H_
-#define TINYEXR_H_
-/*
-Copyright (c) 2014 - 2021, Syoyo Fujita and many contributors.
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of the Syoyo Fujita 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 <COPYRIGHT HOLDER> 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.
-*/
-
-// TinyEXR contains some OpenEXR code, which is licensed under ------------
-
-///////////////////////////////////////////////////////////////////////////
-//
-// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas
-// Digital Ltd. LLC
-//
-// All rights reserved.
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are
-// met:
-// * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-// * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-// * Neither the name of Industrial Light & Magic nor the names of
-// its contributors may be used to endorse or promote products derived
-// from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////
-
-// End of OpenEXR license -------------------------------------------------
-
-
-//
-//
-// Do this:
-// #define TINYEXR_IMPLEMENTATION
-// before you include this file in *one* C or C++ file to create the
-// implementation.
-//
-// // i.e. it should look like this:
-// #include ...
-// #include ...
-// #include ...
-// #define TINYEXR_IMPLEMENTATION
-// #include "tinyexr.h"
-//
-//
-
-#ifdef __CYGWIN__
-extern "C" char *strdup (const char *) __malloc_like __result_use_check;
-extern "C" size_t strnlen (const char *, size_t);
-#endif
-
-#include <stddef.h> // for size_t
-#include <stdint.h> // guess stdint.h is available(C99)
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(_M_IX86) || defined(_M_X64) || defined(__i386__) || \
- defined(__i386) || defined(__i486__) || defined(__i486) || \
- defined(i386) || defined(__ia64__) || defined(__x86_64__)
-#define TINYEXR_X86_OR_X64_CPU 1
-#else
-#define TINYEXR_X86_OR_X64_CPU 0
-#endif
-
-#if (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || TINYEXR_X86_OR_X64_CPU
-#define TINYEXR_LITTLE_ENDIAN 1
-#else
-#define TINYEXR_LITTLE_ENDIAN 0
-#endif
-
-// Use miniz or not to decode ZIP format pixel. Linking with zlib
-// required if this flas is 0.
-#ifndef TINYEXR_USE_MINIZ
-#define TINYEXR_USE_MINIZ (1)
-#endif
-
-// Disable PIZ comporession when applying cpplint.
-#ifndef TINYEXR_USE_PIZ
-#define TINYEXR_USE_PIZ (1)
-#endif
-
-#ifndef TINYEXR_USE_ZFP
-#define TINYEXR_USE_ZFP (0) // TinyEXR extension.
-// http://computation.llnl.gov/projects/floating-point-compression
-#endif
-
-#ifndef TINYEXR_USE_THREAD
-#define TINYEXR_USE_THREAD (0) // No threaded loading.
-// http://computation.llnl.gov/projects/floating-point-compression
-#endif
-
-#ifndef TINYEXR_USE_OPENMP
-#ifdef _OPENMP
-#define TINYEXR_USE_OPENMP (1)
-#else
-#define TINYEXR_USE_OPENMP (0)
-#endif
-#endif
-
-#define TINYEXR_SUCCESS (0)
-#define TINYEXR_ERROR_INVALID_MAGIC_NUMBER (-1)
-#define TINYEXR_ERROR_INVALID_EXR_VERSION (-2)
-#define TINYEXR_ERROR_INVALID_ARGUMENT (-3)
-#define TINYEXR_ERROR_INVALID_DATA (-4)
-#define TINYEXR_ERROR_INVALID_FILE (-5)
-#define TINYEXR_ERROR_INVALID_PARAMETER (-6)
-#define TINYEXR_ERROR_CANT_OPEN_FILE (-7)
-#define TINYEXR_ERROR_UNSUPPORTED_FORMAT (-8)
-#define TINYEXR_ERROR_INVALID_HEADER (-9)
-#define TINYEXR_ERROR_UNSUPPORTED_FEATURE (-10)
-#define TINYEXR_ERROR_CANT_WRITE_FILE (-11)
-#define TINYEXR_ERROR_SERIALZATION_FAILED (-12)
-#define TINYEXR_ERROR_LAYER_NOT_FOUND (-13)
-
-// @note { OpenEXR file format: http://www.openexr.com/openexrfilelayout.pdf }
-
-// pixel type: possible values are: UINT = 0 HALF = 1 FLOAT = 2
-#define TINYEXR_PIXELTYPE_UINT (0)
-#define TINYEXR_PIXELTYPE_HALF (1)
-#define TINYEXR_PIXELTYPE_FLOAT (2)
-
-#define TINYEXR_MAX_HEADER_ATTRIBUTES (1024)
-#define TINYEXR_MAX_CUSTOM_ATTRIBUTES (128)
-
-#define TINYEXR_COMPRESSIONTYPE_NONE (0)
-#define TINYEXR_COMPRESSIONTYPE_RLE (1)
-#define TINYEXR_COMPRESSIONTYPE_ZIPS (2)
-#define TINYEXR_COMPRESSIONTYPE_ZIP (3)
-#define TINYEXR_COMPRESSIONTYPE_PIZ (4)
-#define TINYEXR_COMPRESSIONTYPE_ZFP (128) // TinyEXR extension
-
-#define TINYEXR_ZFP_COMPRESSIONTYPE_RATE (0)
-#define TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION (1)
-#define TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY (2)
-
-#define TINYEXR_TILE_ONE_LEVEL (0)
-#define TINYEXR_TILE_MIPMAP_LEVELS (1)
-#define TINYEXR_TILE_RIPMAP_LEVELS (2)
-
-#define TINYEXR_TILE_ROUND_DOWN (0)
-#define TINYEXR_TILE_ROUND_UP (1)
-
-typedef struct _EXRVersion {
- int version; // this must be 2
- // tile format image;
- // not zero for only a single-part "normal" tiled file (according to spec.)
- int tiled;
- int long_name; // long name attribute
- // deep image(EXR 2.0);
- // for a multi-part file, indicates that at least one part is of type deep* (according to spec.)
- int non_image;
- int multipart; // multi-part(EXR 2.0)
-} EXRVersion;
-
-typedef struct _EXRAttribute {
- char name[256]; // name and type are up to 255 chars long.
- char type[256];
- unsigned char *value; // uint8_t*
- int size;
- int pad0;
-} EXRAttribute;
-
-typedef struct _EXRChannelInfo {
- char name[256]; // less than 255 bytes long
- int pixel_type;
- int x_sampling;
- int y_sampling;
- unsigned char p_linear;
- unsigned char pad[3];
-} EXRChannelInfo;
-
-typedef struct _EXRTile {
- int offset_x;
- int offset_y;
- int level_x;
- int level_y;
-
- int width; // actual width in a tile.
- int height; // actual height int a tile.
-
- unsigned char **images; // image[channels][pixels]
-} EXRTile;
-
-typedef struct _EXRBox2i {
- int min_x;
- int min_y;
- int max_x;
- int max_y;
-} EXRBox2i;
-
-typedef struct _EXRHeader {
- float pixel_aspect_ratio;
- int line_order;
- EXRBox2i data_window;
- EXRBox2i display_window;
- float screen_window_center[2];
- float screen_window_width;
-
- int chunk_count;
-
- // Properties for tiled format(`tiledesc`).
- int tiled;
- int tile_size_x;
- int tile_size_y;
- int tile_level_mode;
- int tile_rounding_mode;
-
- int long_name;
- // for a single-part file, agree with the version field bit 11
- // for a multi-part file, it is consistent with the type of part
- int non_image;
- int multipart;
- unsigned int header_len;
-
- // Custom attributes(exludes required attributes(e.g. `channels`,
- // `compression`, etc)
- int num_custom_attributes;
- EXRAttribute *custom_attributes; // array of EXRAttribute. size =
- // `num_custom_attributes`.
-
- EXRChannelInfo *channels; // [num_channels]
-
- int *pixel_types; // Loaded pixel type(TINYEXR_PIXELTYPE_*) of `images` for
- // each channel. This is overwritten with `requested_pixel_types` when
- // loading.
- int num_channels;
-
- int compression_type; // compression type(TINYEXR_COMPRESSIONTYPE_*)
- int *requested_pixel_types; // Filled initially by
- // ParseEXRHeaderFrom(Meomory|File), then users
- // can edit it(only valid for HALF pixel type
- // channel)
- // name attribute required for multipart files;
- // must be unique and non empty (according to spec.);
- // use EXRSetNameAttr for setting value;
- // max 255 character allowed - excluding terminating zero
- char name[256];
-} EXRHeader;
-
-typedef struct _EXRMultiPartHeader {
- int num_headers;
- EXRHeader *headers;
-
-} EXRMultiPartHeader;
-
-typedef struct _EXRImage {
- EXRTile *tiles; // Tiled pixel data. The application must reconstruct image
- // from tiles manually. NULL if scanline format.
- struct _EXRImage* next_level; // NULL if scanline format or image is the last level.
- int level_x; // x level index
- int level_y; // y level index
-
- unsigned char **images; // image[channels][pixels]. NULL if tiled format.
-
- int width;
- int height;
- int num_channels;
-
- // Properties for tile format.
- int num_tiles;
-
-} EXRImage;
-
-typedef struct _EXRMultiPartImage {
- int num_images;
- EXRImage *images;
-
-} EXRMultiPartImage;
-
-typedef struct _DeepImage {
- const char **channel_names;
- float ***image; // image[channels][scanlines][samples]
- int **offset_table; // offset_table[scanline][offsets]
- int num_channels;
- int width;
- int height;
- int pad0;
-} DeepImage;
-
-// @deprecated { For backward compatibility. Not recommended to use. }
-// Loads single-frame OpenEXR image. Assume EXR image contains A(single channel
-// alpha) or RGB(A) channels.
-// Application must free image data as returned by `out_rgba`
-// Result image format is: float x RGBA x width x hight
-// Returns negative value and may set error string in `err` when there's an
-// error
-extern int LoadEXR(float **out_rgba, int *width, int *height,
- const char *filename, const char **err);
-
-// Loads single-frame OpenEXR image by specifying layer name. Assume EXR image
-// contains A(single channel alpha) or RGB(A) channels. Application must free
-// image data as returned by `out_rgba` Result image format is: float x RGBA x
-// width x hight Returns negative value and may set error string in `err` when
-// there's an error When the specified layer name is not found in the EXR file,
-// the function will return `TINYEXR_ERROR_LAYER_NOT_FOUND`.
-extern int LoadEXRWithLayer(float **out_rgba, int *width, int *height,
- const char *filename, const char *layer_name,
- const char **err);
-
-//
-// Get layer infos from EXR file.
-//
-// @param[out] layer_names List of layer names. Application must free memory
-// after using this.
-// @param[out] num_layers The number of layers
-// @param[out] err Error string(will be filled when the function returns error
-// code). Free it using FreeEXRErrorMessage after using this value.
-//
-// @return TINYEXR_SUCCEES upon success.
-//
-extern int EXRLayers(const char *filename, const char **layer_names[],
- int *num_layers, const char **err);
-
-// @deprecated { to be removed. }
-// Simple wrapper API for ParseEXRHeaderFromFile.
-// checking given file is a EXR file(by just look up header)
-// @return TINYEXR_SUCCEES for EXR image, TINYEXR_ERROR_INVALID_HEADER for
-// others
-extern int IsEXR(const char *filename);
-
-// @deprecated { to be removed. }
-// Saves single-frame OpenEXR image. Assume EXR image contains RGB(A) channels.
-// components must be 1(Grayscale), 3(RGB) or 4(RGBA).
-// Input image format is: `float x width x height`, or `float x RGB(A) x width x
-// hight`
-// Save image as fp16(HALF) format when `save_as_fp16` is positive non-zero
-// value.
-// Save image as fp32(FLOAT) format when `save_as_fp16` is 0.
-// Use ZIP compression by default.
-// Returns negative value and may set error string in `err` when there's an
-// error
-extern int SaveEXR(const float *data, const int width, const int height,
- const int components, const int save_as_fp16,
- const char *filename, const char **err);
-
-// Returns the number of resolution levels of the image (including the base)
-extern int EXRNumLevels(const EXRImage* exr_image);
-
-// Initialize EXRHeader struct
-extern void InitEXRHeader(EXRHeader *exr_header);
-
-// Set name attribute of EXRHeader struct (it makes a copy)
-extern void EXRSetNameAttr(EXRHeader *exr_header, const char* name);
-
-// Initialize EXRImage struct
-extern void InitEXRImage(EXRImage *exr_image);
-
-// Frees internal data of EXRHeader struct
-extern int FreeEXRHeader(EXRHeader *exr_header);
-
-// Frees internal data of EXRImage struct
-extern int FreeEXRImage(EXRImage *exr_image);
-
-// Frees error message
-extern void FreeEXRErrorMessage(const char *msg);
-
-// Parse EXR version header of a file.
-extern int ParseEXRVersionFromFile(EXRVersion *version, const char *filename);
-
-// Parse EXR version header from memory-mapped EXR data.
-extern int ParseEXRVersionFromMemory(EXRVersion *version,
- const unsigned char *memory, size_t size);
-
-// Parse single-part OpenEXR header from a file and initialize `EXRHeader`.
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int ParseEXRHeaderFromFile(EXRHeader *header, const EXRVersion *version,
- const char *filename, const char **err);
-
-// Parse single-part OpenEXR header from a memory and initialize `EXRHeader`.
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int ParseEXRHeaderFromMemory(EXRHeader *header,
- const EXRVersion *version,
- const unsigned char *memory, size_t size,
- const char **err);
-
-// Parse multi-part OpenEXR headers from a file and initialize `EXRHeader*`
-// array.
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int ParseEXRMultipartHeaderFromFile(EXRHeader ***headers,
- int *num_headers,
- const EXRVersion *version,
- const char *filename,
- const char **err);
-
-// Parse multi-part OpenEXR headers from a memory and initialize `EXRHeader*`
-// array
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int ParseEXRMultipartHeaderFromMemory(EXRHeader ***headers,
- int *num_headers,
- const EXRVersion *version,
- const unsigned char *memory,
- size_t size, const char **err);
-
-// Loads single-part OpenEXR image from a file.
-// Application must setup `ParseEXRHeaderFromFile` before calling this function.
-// Application can free EXRImage using `FreeEXRImage`
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadEXRImageFromFile(EXRImage *image, const EXRHeader *header,
- const char *filename, const char **err);
-
-// Loads single-part OpenEXR image from a memory.
-// Application must setup `EXRHeader` with
-// `ParseEXRHeaderFromMemory` before calling this function.
-// Application can free EXRImage using `FreeEXRImage`
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadEXRImageFromMemory(EXRImage *image, const EXRHeader *header,
- const unsigned char *memory,
- const size_t size, const char **err);
-
-// Loads multi-part OpenEXR image from a file.
-// Application must setup `ParseEXRMultipartHeaderFromFile` before calling this
-// function.
-// Application can free EXRImage using `FreeEXRImage`
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadEXRMultipartImageFromFile(EXRImage *images,
- const EXRHeader **headers,
- unsigned int num_parts,
- const char *filename,
- const char **err);
-
-// Loads multi-part OpenEXR image from a memory.
-// Application must setup `EXRHeader*` array with
-// `ParseEXRMultipartHeaderFromMemory` before calling this function.
-// Application can free EXRImage using `FreeEXRImage`
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadEXRMultipartImageFromMemory(EXRImage *images,
- const EXRHeader **headers,
- unsigned int num_parts,
- const unsigned char *memory,
- const size_t size, const char **err);
-
-// Saves multi-channel, single-frame OpenEXR image to a file.
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int SaveEXRImageToFile(const EXRImage *image,
- const EXRHeader *exr_header, const char *filename,
- const char **err);
-
-// Saves multi-channel, single-frame OpenEXR image to a memory.
-// Image is compressed using EXRImage.compression value.
-// Return the number of bytes if success.
-// Return zero and will set error string in `err` when there's an
-// error.
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern size_t SaveEXRImageToMemory(const EXRImage *image,
- const EXRHeader *exr_header,
- unsigned char **memory, const char **err);
-
-// Saves multi-channel, multi-frame OpenEXR image to a memory.
-// Image is compressed using EXRImage.compression value.
-// File global attributes (eg. display_window) must be set in the first header.
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int SaveEXRMultipartImageToFile(const EXRImage *images,
- const EXRHeader **exr_headers,
- unsigned int num_parts,
- const char *filename, const char **err);
-
-// Saves multi-channel, multi-frame OpenEXR image to a memory.
-// Image is compressed using EXRImage.compression value.
-// File global attributes (eg. display_window) must be set in the first header.
-// Return the number of bytes if success.
-// Return zero and will set error string in `err` when there's an
-// error.
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern size_t SaveEXRMultipartImageToMemory(const EXRImage *images,
- const EXRHeader **exr_headers,
- unsigned int num_parts,
- unsigned char **memory, const char **err);
-// Loads single-frame OpenEXR deep image.
-// Application must free memory of variables in DeepImage(image, offset_table)
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadDeepEXR(DeepImage *out_image, const char *filename,
- const char **err);
-
-// NOT YET IMPLEMENTED:
-// Saves single-frame OpenEXR deep image.
-// Returns negative value and may set error string in `err` when there's an
-// error
-// extern int SaveDeepEXR(const DeepImage *in_image, const char *filename,
-// const char **err);
-
-// NOT YET IMPLEMENTED:
-// Loads multi-part OpenEXR deep image.
-// Application must free memory of variables in DeepImage(image, offset_table)
-// extern int LoadMultiPartDeepEXR(DeepImage **out_image, int num_parts, const
-// char *filename,
-// const char **err);
-
-// For emscripten.
-// Loads single-frame OpenEXR image from memory. Assume EXR image contains
-// RGB(A) channels.
-// Returns negative value and may set error string in `err` when there's an
-// error
-// When there was an error message, Application must free `err` with
-// FreeEXRErrorMessage()
-extern int LoadEXRFromMemory(float **out_rgba, int *width, int *height,
- const unsigned char *memory, size_t size,
- const char **err);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // TINYEXR_H_
-
-#ifdef TINYEXR_IMPLEMENTATION
-#ifndef TINYEXR_IMPLEMENTATION_DEFINED
-#define TINYEXR_IMPLEMENTATION_DEFINED
-
-#ifdef _WIN32
-
-#ifndef WIN32_LEAN_AND_MEAN
-#define WIN32_LEAN_AND_MEAN
-#endif
-#ifndef NOMINMAX
-#define NOMINMAX
-#endif
-#include <windows.h> // for UTF-8
-
-#endif
-
-#include <algorithm>
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-#include <cstring>
-#include <sstream>
-
-// #include <iostream> // debug
-
-#include <limits>
-#include <string>
-#include <vector>
-#include <set>
-
-// https://stackoverflow.com/questions/5047971/how-do-i-check-for-c11-support
-#if __cplusplus > 199711L || (defined(_MSC_VER) && _MSC_VER >= 1900)
-#define TINYEXR_HAS_CXX11 (1)
-// C++11
-#include <cstdint>
-
-#if TINYEXR_USE_THREAD
-#include <atomic>
-#include <thread>
-#endif
-
-#endif // __cplusplus > 199711L
-
-#if TINYEXR_USE_OPENMP
-#include <omp.h>
-#endif
-
-#if TINYEXR_USE_MINIZ
-#include <miniz.h>
-#else
-// Issue #46. Please include your own zlib-compatible API header before
-// including `tinyexr.h`
-//#include "zlib.h"
-#endif
-
-#if TINYEXR_USE_ZFP
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Weverything"
-#endif
-
-#include "zfp.h"
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#endif
-
-namespace tinyexr {
-
-#if __cplusplus > 199711L
-// C++11
-typedef uint64_t tinyexr_uint64;
-typedef int64_t tinyexr_int64;
-#else
-// Although `long long` is not a standard type pre C++11, assume it is defined
-// as a compiler's extension.
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wc++11-long-long"
-#endif
-typedef unsigned long long tinyexr_uint64;
-typedef long long tinyexr_int64;
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-#endif
-
-// static bool IsBigEndian(void) {
-// union {
-// unsigned int i;
-// char c[4];
-// } bint = {0x01020304};
-//
-// return bint.c[0] == 1;
-//}
-
-static void SetErrorMessage(const std::string &msg, const char **err) {
- if (err) {
-#ifdef _WIN32
- (*err) = _strdup(msg.c_str());
-#else
- (*err) = strdup(msg.c_str());
-#endif
- }
-}
-
-static const int kEXRVersionSize = 8;
-
-static void cpy2(unsigned short *dst_val, const unsigned short *src_val) {
- unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
- const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
-
- dst[0] = src[0];
- dst[1] = src[1];
-}
-
-static void swap2(unsigned short *val) {
-#ifdef TINYEXR_LITTLE_ENDIAN
- (void)val;
-#else
- unsigned short tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[1];
- dst[1] = src[0];
-#endif
-}
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
-
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-function"
-#endif
-static void cpy4(int *dst_val, const int *src_val) {
- unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
- const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
-
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
-}
-
-static void cpy4(unsigned int *dst_val, const unsigned int *src_val) {
- unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
- const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
-
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
-}
-
-static void cpy4(float *dst_val, const float *src_val) {
- unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
- const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
-
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
-}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
-
-static void swap4(unsigned int *val) {
-#ifdef TINYEXR_LITTLE_ENDIAN
- (void)val;
-#else
- unsigned int tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- dst[3] = src[0];
-#endif
-}
-
-static void swap4(int *val) {
-#ifdef TINYEXR_LITTLE_ENDIAN
- (void)val;
-#else
- int tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- dst[3] = src[0];
-#endif
-}
-
-static void swap4(float *val) {
-#ifdef TINYEXR_LITTLE_ENDIAN
- (void)val;
-#else
- float tmp = *val;
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[3];
- dst[1] = src[2];
- dst[2] = src[1];
- dst[3] = src[0];
-#endif
-}
-
-#if 0
-static void cpy8(tinyexr::tinyexr_uint64 *dst_val, const tinyexr::tinyexr_uint64 *src_val) {
- unsigned char *dst = reinterpret_cast<unsigned char *>(dst_val);
- const unsigned char *src = reinterpret_cast<const unsigned char *>(src_val);
-
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
- dst[3] = src[3];
- dst[4] = src[4];
- dst[5] = src[5];
- dst[6] = src[6];
- dst[7] = src[7];
-}
-#endif
-
-static void swap8(tinyexr::tinyexr_uint64 *val) {
-#ifdef TINYEXR_LITTLE_ENDIAN
- (void)val;
-#else
- tinyexr::tinyexr_uint64 tmp = (*val);
- unsigned char *dst = reinterpret_cast<unsigned char *>(val);
- unsigned char *src = reinterpret_cast<unsigned char *>(&tmp);
-
- dst[0] = src[7];
- dst[1] = src[6];
- dst[2] = src[5];
- dst[3] = src[4];
- dst[4] = src[3];
- dst[5] = src[2];
- dst[6] = src[1];
- dst[7] = src[0];
-#endif
-}
-
-// https://gist.github.com/rygorous/2156668
-union FP32 {
- unsigned int u;
- float f;
- struct {
-#if TINYEXR_LITTLE_ENDIAN
- unsigned int Mantissa : 23;
- unsigned int Exponent : 8;
- unsigned int Sign : 1;
-#else
- unsigned int Sign : 1;
- unsigned int Exponent : 8;
- unsigned int Mantissa : 23;
-#endif
- } s;
-};
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-union FP16 {
- unsigned short u;
- struct {
-#if TINYEXR_LITTLE_ENDIAN
- unsigned int Mantissa : 10;
- unsigned int Exponent : 5;
- unsigned int Sign : 1;
-#else
- unsigned int Sign : 1;
- unsigned int Exponent : 5;
- unsigned int Mantissa : 10;
-#endif
- } s;
-};
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-static FP32 half_to_float(FP16 h) {
- static const FP32 magic = {113 << 23};
- static const unsigned int shifted_exp = 0x7c00
- << 13; // exponent mask after shift
- FP32 o;
-
- o.u = (h.u & 0x7fffU) << 13U; // exponent/mantissa bits
- unsigned int exp_ = shifted_exp & o.u; // just the exponent
- o.u += (127 - 15) << 23; // exponent adjust
-
- // handle exponent special cases
- if (exp_ == shifted_exp) // Inf/NaN?
- o.u += (128 - 16) << 23; // extra exp adjust
- else if (exp_ == 0) // Zero/Denormal?
- {
- o.u += 1 << 23; // extra exp adjust
- o.f -= magic.f; // renormalize
- }
-
- o.u |= (h.u & 0x8000U) << 16U; // sign bit
- return o;
-}
-
-static FP16 float_to_half_full(FP32 f) {
- FP16 o = {0};
-
- // Based on ISPC reference code (with minor modifications)
- if (f.s.Exponent == 0) // Signed zero/denormal (which will underflow)
- o.s.Exponent = 0;
- else if (f.s.Exponent == 255) // Inf or NaN (all exponent bits set)
- {
- o.s.Exponent = 31;
- o.s.Mantissa = f.s.Mantissa ? 0x200 : 0; // NaN->qNaN and Inf->Inf
- } else // Normalized number
- {
- // Exponent unbias the single, then bias the halfp
- int newexp = f.s.Exponent - 127 + 15;
- if (newexp >= 31) // Overflow, return signed infinity
- o.s.Exponent = 31;
- else if (newexp <= 0) // Underflow
- {
- if ((14 - newexp) <= 24) // Mantissa might be non-zero
- {
- unsigned int mant = f.s.Mantissa | 0x800000; // Hidden 1 bit
- o.s.Mantissa = mant >> (14 - newexp);
- if ((mant >> (13 - newexp)) & 1) // Check for rounding
- o.u++; // Round, might overflow into exp bit, but this is OK
- }
- } else {
- o.s.Exponent = static_cast<unsigned int>(newexp);
- o.s.Mantissa = f.s.Mantissa >> 13;
- if (f.s.Mantissa & 0x1000) // Check for rounding
- o.u++; // Round, might overflow to inf, this is OK
- }
- }
-
- o.s.Sign = f.s.Sign;
- return o;
-}
-
-// NOTE: From OpenEXR code
-// #define IMF_INCREASING_Y 0
-// #define IMF_DECREASING_Y 1
-// #define IMF_RAMDOM_Y 2
-//
-// #define IMF_NO_COMPRESSION 0
-// #define IMF_RLE_COMPRESSION 1
-// #define IMF_ZIPS_COMPRESSION 2
-// #define IMF_ZIP_COMPRESSION 3
-// #define IMF_PIZ_COMPRESSION 4
-// #define IMF_PXR24_COMPRESSION 5
-// #define IMF_B44_COMPRESSION 6
-// #define IMF_B44A_COMPRESSION 7
-
-#ifdef __clang__
-#pragma clang diagnostic push
-
-#if __has_warning("-Wzero-as-null-pointer-constant")
-#pragma clang diagnostic ignored "-Wzero-as-null-pointer-constant"
-#endif
-
-#endif
-
-static const char *ReadString(std::string *s, const char *ptr, size_t len) {
- // Read untile NULL(\0).
- const char *p = ptr;
- const char *q = ptr;
- while ((size_t(q - ptr) < len) && (*q) != 0) {
- q++;
- }
-
- if (size_t(q - ptr) >= len) {
- (*s).clear();
- return NULL;
- }
-
- (*s) = std::string(p, q);
-
- return q + 1; // skip '\0'
-}
-
-static bool ReadAttribute(std::string *name, std::string *type,
- std::vector<unsigned char> *data, size_t *marker_size,
- const char *marker, size_t size) {
- size_t name_len = strnlen(marker, size);
- if (name_len == size) {
- // String does not have a terminating character.
- return false;
- }
- *name = std::string(marker, name_len);
-
- marker += name_len + 1;
- size -= name_len + 1;
-
- size_t type_len = strnlen(marker, size);
- if (type_len == size) {
- return false;
- }
- *type = std::string(marker, type_len);
-
- marker += type_len + 1;
- size -= type_len + 1;
-
- if (size < sizeof(uint32_t)) {
- return false;
- }
-
- uint32_t data_len;
- memcpy(&data_len, marker, sizeof(uint32_t));
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&data_len));
-
- if (data_len == 0) {
- if ((*type).compare("string") == 0) {
- // Accept empty string attribute.
-
- marker += sizeof(uint32_t);
- size -= sizeof(uint32_t);
-
- *marker_size = name_len + 1 + type_len + 1 + sizeof(uint32_t);
-
- data->resize(1);
- (*data)[0] = '\0';
-
- return true;
- } else {
- return false;
- }
- }
-
- marker += sizeof(uint32_t);
- size -= sizeof(uint32_t);
-
- if (size < data_len) {
- return false;
- }
-
- data->resize(static_cast<size_t>(data_len));
- memcpy(&data->at(0), marker, static_cast<size_t>(data_len));
-
- *marker_size = name_len + 1 + type_len + 1 + sizeof(uint32_t) + data_len;
- return true;
-}
-
-static void WriteAttributeToMemory(std::vector<unsigned char> *out,
- const char *name, const char *type,
- const unsigned char *data, int len) {
- out->insert(out->end(), name, name + strlen(name) + 1);
- out->insert(out->end(), type, type + strlen(type) + 1);
-
- int outLen = len;
- tinyexr::swap4(&outLen);
- out->insert(out->end(), reinterpret_cast<unsigned char *>(&outLen),
- reinterpret_cast<unsigned char *>(&outLen) + sizeof(int));
- out->insert(out->end(), data, data + len);
-}
-
-typedef struct {
- std::string name; // less than 255 bytes long
- int pixel_type;
- int requested_pixel_type;
- int x_sampling;
- int y_sampling;
- unsigned char p_linear;
- unsigned char pad[3];
-} ChannelInfo;
-
-typedef struct {
- int min_x;
- int min_y;
- int max_x;
- int max_y;
-} Box2iInfo;
-
-struct HeaderInfo {
- std::vector<tinyexr::ChannelInfo> channels;
- std::vector<EXRAttribute> attributes;
-
- Box2iInfo data_window;
- int line_order;
- Box2iInfo display_window;
- float screen_window_center[2];
- float screen_window_width;
- float pixel_aspect_ratio;
-
- int chunk_count;
-
- // Tiled format
- int tiled; // Non-zero if the part is tiled.
- int tile_size_x;
- int tile_size_y;
- int tile_level_mode;
- int tile_rounding_mode;
-
- unsigned int header_len;
-
- int compression_type;
-
- // required for multi-part or non-image files
- std::string name;
- // required for multi-part or non-image files
- std::string type;
-
- void clear() {
- channels.clear();
- attributes.clear();
-
- data_window.min_x = 0;
- data_window.min_y = 0;
- data_window.max_x = 0;
- data_window.max_y = 0;
- line_order = 0;
- display_window.min_x = 0;
- display_window.min_y = 0;
- display_window.max_x = 0;
- display_window.max_y = 0;
- screen_window_center[0] = 0.0f;
- screen_window_center[1] = 0.0f;
- screen_window_width = 0.0f;
- pixel_aspect_ratio = 0.0f;
-
- chunk_count = 0;
-
- // Tiled format
- tiled = 0;
- tile_size_x = 0;
- tile_size_y = 0;
- tile_level_mode = 0;
- tile_rounding_mode = 0;
-
- header_len = 0;
- compression_type = 0;
-
- name.clear();
- type.clear();
- }
-};
-
-static bool ReadChannelInfo(std::vector<ChannelInfo> &channels,
- const std::vector<unsigned char> &data) {
- const char *p = reinterpret_cast<const char *>(&data.at(0));
-
- for (;;) {
- if ((*p) == 0) {
- break;
- }
- ChannelInfo info;
-
- tinyexr_int64 data_len = static_cast<tinyexr_int64>(data.size()) -
- (p - reinterpret_cast<const char *>(data.data()));
- if (data_len < 0) {
- return false;
- }
-
- p = ReadString(&info.name, p, size_t(data_len));
- if ((p == NULL) && (info.name.empty())) {
- // Buffer overrun. Issue #51.
- return false;
- }
-
- const unsigned char *data_end =
- reinterpret_cast<const unsigned char *>(p) + 16;
- if (data_end >= (data.data() + data.size())) {
- return false;
- }
-
- memcpy(&info.pixel_type, p, sizeof(int));
- p += 4;
- info.p_linear = static_cast<unsigned char>(p[0]); // uchar
- p += 1 + 3; // reserved: uchar[3]
- memcpy(&info.x_sampling, p, sizeof(int)); // int
- p += 4;
- memcpy(&info.y_sampling, p, sizeof(int)); // int
- p += 4;
-
- tinyexr::swap4(&info.pixel_type);
- tinyexr::swap4(&info.x_sampling);
- tinyexr::swap4(&info.y_sampling);
-
- channels.push_back(info);
- }
-
- return true;
-}
-
-static void WriteChannelInfo(std::vector<unsigned char> &data,
- const std::vector<ChannelInfo> &channels) {
- size_t sz = 0;
-
- // Calculate total size.
- for (size_t c = 0; c < channels.size(); c++) {
- sz += channels[c].name.length() + 1; // +1 for \0
- sz += 16; // 4 * int
- }
- data.resize(sz + 1);
-
- unsigned char *p = &data.at(0);
-
- for (size_t c = 0; c < channels.size(); c++) {
- memcpy(p, channels[c].name.c_str(), channels[c].name.length());
- p += channels[c].name.length();
- (*p) = '\0';
- p++;
-
- int pixel_type = channels[c].requested_pixel_type;
- int x_sampling = channels[c].x_sampling;
- int y_sampling = channels[c].y_sampling;
- tinyexr::swap4(&pixel_type);
- tinyexr::swap4(&x_sampling);
- tinyexr::swap4(&y_sampling);
-
- memcpy(p, &pixel_type, sizeof(int));
- p += sizeof(int);
-
- (*p) = channels[c].p_linear;
- p += 4;
-
- memcpy(p, &x_sampling, sizeof(int));
- p += sizeof(int);
-
- memcpy(p, &y_sampling, sizeof(int));
- p += sizeof(int);
- }
-
- (*p) = '\0';
-}
-
-static void CompressZip(unsigned char *dst,
- tinyexr::tinyexr_uint64 &compressedSize,
- const unsigned char *src, unsigned long src_size) {
- std::vector<unsigned char> tmpBuf(src_size);
-
- //
- // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
- // ImfZipCompressor.cpp
- //
-
- //
- // Reorder the pixel data.
- //
-
- const char *srcPtr = reinterpret_cast<const char *>(src);
-
- {
- char *t1 = reinterpret_cast<char *>(&tmpBuf.at(0));
- char *t2 = reinterpret_cast<char *>(&tmpBuf.at(0)) + (src_size + 1) / 2;
- const char *stop = srcPtr + src_size;
-
- for (;;) {
- if (srcPtr < stop)
- *(t1++) = *(srcPtr++);
- else
- break;
-
- if (srcPtr < stop)
- *(t2++) = *(srcPtr++);
- else
- break;
- }
- }
-
- //
- // Predictor.
- //
-
- {
- unsigned char *t = &tmpBuf.at(0) + 1;
- unsigned char *stop = &tmpBuf.at(0) + src_size;
- int p = t[-1];
-
- while (t < stop) {
- int d = int(t[0]) - p + (128 + 256);
- p = t[0];
- t[0] = static_cast<unsigned char>(d);
- ++t;
- }
- }
-
-#if TINYEXR_USE_MINIZ
- //
- // Compress the data using miniz
- //
-
- mz_ulong outSize = mz_compressBound(src_size);
- int ret = mz_compress(
- dst, &outSize, static_cast<const unsigned char *>(&tmpBuf.at(0)),
- src_size);
- assert(ret == MZ_OK);
- (void)ret;
-
- compressedSize = outSize;
-#else
- uLong outSize = compressBound(static_cast<uLong>(src_size));
- int ret = compress(dst, &outSize, static_cast<const Bytef *>(&tmpBuf.at(0)),
- src_size);
- assert(ret == Z_OK);
-
- compressedSize = outSize;
-#endif
-
- // Use uncompressed data when compressed data is larger than uncompressed.
- // (Issue 40)
- if (compressedSize >= src_size) {
- compressedSize = src_size;
- memcpy(dst, src, src_size);
- }
-}
-
-static bool DecompressZip(unsigned char *dst,
- unsigned long *uncompressed_size /* inout */,
- const unsigned char *src, unsigned long src_size) {
- if ((*uncompressed_size) == src_size) {
- // Data is not compressed(Issue 40).
- memcpy(dst, src, src_size);
- return true;
- }
- std::vector<unsigned char> tmpBuf(*uncompressed_size);
-
-#if TINYEXR_USE_MINIZ
- int ret =
- mz_uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size);
- if (MZ_OK != ret) {
- return false;
- }
-#else
- int ret = uncompress(&tmpBuf.at(0), uncompressed_size, src, src_size);
- if (Z_OK != ret) {
- return false;
- }
-#endif
-
- //
- // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
- // ImfZipCompressor.cpp
- //
-
- // Predictor.
- {
- unsigned char *t = &tmpBuf.at(0) + 1;
- unsigned char *stop = &tmpBuf.at(0) + (*uncompressed_size);
-
- while (t < stop) {
- int d = int(t[-1]) + int(t[0]) - 128;
- t[0] = static_cast<unsigned char>(d);
- ++t;
- }
- }
-
- // Reorder the pixel data.
- {
- const char *t1 = reinterpret_cast<const char *>(&tmpBuf.at(0));
- const char *t2 = reinterpret_cast<const char *>(&tmpBuf.at(0)) +
- (*uncompressed_size + 1) / 2;
- char *s = reinterpret_cast<char *>(dst);
- char *stop = s + (*uncompressed_size);
-
- for (;;) {
- if (s < stop)
- *(s++) = *(t1++);
- else
- break;
-
- if (s < stop)
- *(s++) = *(t2++);
- else
- break;
- }
- }
-
- return true;
-}
-
-// RLE code from OpenEXR --------------------------------------
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wsign-conversion"
-#if __has_warning("-Wextra-semi-stmt")
-#pragma clang diagnostic ignored "-Wextra-semi-stmt"
-#endif
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable : 4204) // nonstandard extension used : non-constant
- // aggregate initializer (also supported by GNU
- // C and C99, so no big deal)
-#pragma warning(disable : 4244) // 'initializing': conversion from '__int64' to
- // 'int', possible loss of data
-#pragma warning(disable : 4267) // 'argument': conversion from '__int64' to
- // 'int', possible loss of data
-#pragma warning(disable : 4996) // 'strdup': The POSIX name for this item is
- // deprecated. Instead, use the ISO C and C++
- // conformant name: _strdup.
-#endif
-
-const int MIN_RUN_LENGTH = 3;
-const int MAX_RUN_LENGTH = 127;
-
-//
-// Compress an array of bytes, using run-length encoding,
-// and return the length of the compressed data.
-//
-
-static int rleCompress(int inLength, const char in[], signed char out[]) {
- const char *inEnd = in + inLength;
- const char *runStart = in;
- const char *runEnd = in + 1;
- signed char *outWrite = out;
-
- while (runStart < inEnd) {
- while (runEnd < inEnd && *runStart == *runEnd &&
- runEnd - runStart - 1 < MAX_RUN_LENGTH) {
- ++runEnd;
- }
-
- if (runEnd - runStart >= MIN_RUN_LENGTH) {
- //
- // Compressible run
- //
-
- *outWrite++ = static_cast<char>(runEnd - runStart) - 1;
- *outWrite++ = *(reinterpret_cast<const signed char *>(runStart));
- runStart = runEnd;
- } else {
- //
- // Uncompressable run
- //
-
- while (runEnd < inEnd &&
- ((runEnd + 1 >= inEnd || *runEnd != *(runEnd + 1)) ||
- (runEnd + 2 >= inEnd || *(runEnd + 1) != *(runEnd + 2))) &&
- runEnd - runStart < MAX_RUN_LENGTH) {
- ++runEnd;
- }
-
- *outWrite++ = static_cast<char>(runStart - runEnd);
-
- while (runStart < runEnd) {
- *outWrite++ = *(reinterpret_cast<const signed char *>(runStart++));
- }
- }
-
- ++runEnd;
- }
-
- return static_cast<int>(outWrite - out);
-}
-
-//
-// Uncompress an array of bytes compressed with rleCompress().
-// Returns the length of the oncompressed data, or 0 if the
-// length of the uncompressed data would be more than maxLength.
-//
-
-static int rleUncompress(int inLength, int maxLength, const signed char in[],
- char out[]) {
- char *outStart = out;
-
- while (inLength > 0) {
- if (*in < 0) {
- int count = -(static_cast<int>(*in++));
- inLength -= count + 1;
-
- // Fixes #116: Add bounds check to in buffer.
- if ((0 > (maxLength -= count)) || (inLength < 0)) return 0;
-
- memcpy(out, in, count);
- out += count;
- in += count;
- } else {
- int count = *in++;
- inLength -= 2;
-
- if (0 > (maxLength -= count + 1)) return 0;
-
- memset(out, *reinterpret_cast<const char *>(in), count + 1);
- out += count + 1;
-
- in++;
- }
- }
-
- return static_cast<int>(out - outStart);
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// End of RLE code from OpenEXR -----------------------------------
-
-static void CompressRle(unsigned char *dst,
- tinyexr::tinyexr_uint64 &compressedSize,
- const unsigned char *src, unsigned long src_size) {
- std::vector<unsigned char> tmpBuf(src_size);
-
- //
- // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
- // ImfRleCompressor.cpp
- //
-
- //
- // Reorder the pixel data.
- //
-
- const char *srcPtr = reinterpret_cast<const char *>(src);
-
- {
- char *t1 = reinterpret_cast<char *>(&tmpBuf.at(0));
- char *t2 = reinterpret_cast<char *>(&tmpBuf.at(0)) + (src_size + 1) / 2;
- const char *stop = srcPtr + src_size;
-
- for (;;) {
- if (srcPtr < stop)
- *(t1++) = *(srcPtr++);
- else
- break;
-
- if (srcPtr < stop)
- *(t2++) = *(srcPtr++);
- else
- break;
- }
- }
-
- //
- // Predictor.
- //
-
- {
- unsigned char *t = &tmpBuf.at(0) + 1;
- unsigned char *stop = &tmpBuf.at(0) + src_size;
- int p = t[-1];
-
- while (t < stop) {
- int d = int(t[0]) - p + (128 + 256);
- p = t[0];
- t[0] = static_cast<unsigned char>(d);
- ++t;
- }
- }
-
- // outSize will be (srcSiz * 3) / 2 at max.
- int outSize = rleCompress(static_cast<int>(src_size),
- reinterpret_cast<const char *>(&tmpBuf.at(0)),
- reinterpret_cast<signed char *>(dst));
- assert(outSize > 0);
-
- compressedSize = static_cast<tinyexr::tinyexr_uint64>(outSize);
-
- // Use uncompressed data when compressed data is larger than uncompressed.
- // (Issue 40)
- if (compressedSize >= src_size) {
- compressedSize = src_size;
- memcpy(dst, src, src_size);
- }
-}
-
-static bool DecompressRle(unsigned char *dst,
- const unsigned long uncompressed_size,
- const unsigned char *src, unsigned long src_size) {
- if (uncompressed_size == src_size) {
- // Data is not compressed(Issue 40).
- memcpy(dst, src, src_size);
- return true;
- }
-
- // Workaround for issue #112.
- // TODO(syoyo): Add more robust out-of-bounds check in `rleUncompress`.
- if (src_size <= 2) {
- return false;
- }
-
- std::vector<unsigned char> tmpBuf(uncompressed_size);
-
- int ret = rleUncompress(static_cast<int>(src_size),
- static_cast<int>(uncompressed_size),
- reinterpret_cast<const signed char *>(src),
- reinterpret_cast<char *>(&tmpBuf.at(0)));
- if (ret != static_cast<int>(uncompressed_size)) {
- return false;
- }
-
- //
- // Apply EXR-specific? postprocess. Grabbed from OpenEXR's
- // ImfRleCompressor.cpp
- //
-
- // Predictor.
- {
- unsigned char *t = &tmpBuf.at(0) + 1;
- unsigned char *stop = &tmpBuf.at(0) + uncompressed_size;
-
- while (t < stop) {
- int d = int(t[-1]) + int(t[0]) - 128;
- t[0] = static_cast<unsigned char>(d);
- ++t;
- }
- }
-
- // Reorder the pixel data.
- {
- const char *t1 = reinterpret_cast<const char *>(&tmpBuf.at(0));
- const char *t2 = reinterpret_cast<const char *>(&tmpBuf.at(0)) +
- (uncompressed_size + 1) / 2;
- char *s = reinterpret_cast<char *>(dst);
- char *stop = s + uncompressed_size;
-
- for (;;) {
- if (s < stop)
- *(s++) = *(t1++);
- else
- break;
-
- if (s < stop)
- *(s++) = *(t2++);
- else
- break;
- }
- }
-
- return true;
-}
-
-#if TINYEXR_USE_PIZ
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wc++11-long-long"
-#pragma clang diagnostic ignored "-Wold-style-cast"
-#pragma clang diagnostic ignored "-Wpadded"
-#pragma clang diagnostic ignored "-Wsign-conversion"
-#pragma clang diagnostic ignored "-Wc++11-extensions"
-#pragma clang diagnostic ignored "-Wconversion"
-#pragma clang diagnostic ignored "-Wc++98-compat-pedantic"
-
-#if __has_warning("-Wcast-qual")
-#pragma clang diagnostic ignored "-Wcast-qual"
-#endif
-
-#if __has_warning("-Wextra-semi-stmt")
-#pragma clang diagnostic ignored "-Wextra-semi-stmt"
-#endif
-
-#endif
-
-//
-// PIZ compress/uncompress, based on OpenEXR's ImfPizCompressor.cpp
-//
-// -----------------------------------------------------------------
-// Copyright (c) 2004, Industrial Light & Magic, a division of Lucas
-// Digital Ltd. LLC)
-// (3 clause BSD license)
-//
-
-struct PIZChannelData {
- unsigned short *start;
- unsigned short *end;
- int nx;
- int ny;
- int ys;
- int size;
-};
-
-//-----------------------------------------------------------------------------
-//
-// 16-bit Haar Wavelet encoding and decoding
-//
-// The source code in this file is derived from the encoding
-// and decoding routines written by Christian Rouet for his
-// PIZ image file format.
-//
-//-----------------------------------------------------------------------------
-
-//
-// Wavelet basis functions without modulo arithmetic; they produce
-// the best compression ratios when the wavelet-transformed data are
-// Huffman-encoded, but the wavelet transform works only for 14-bit
-// data (untransformed data values must be less than (1 << 14)).
-//
-
-inline void wenc14(unsigned short a, unsigned short b, unsigned short &l,
- unsigned short &h) {
- short as = static_cast<short>(a);
- short bs = static_cast<short>(b);
-
- short ms = (as + bs) >> 1;
- short ds = as - bs;
-
- l = static_cast<unsigned short>(ms);
- h = static_cast<unsigned short>(ds);
-}
-
-inline void wdec14(unsigned short l, unsigned short h, unsigned short &a,
- unsigned short &b) {
- short ls = static_cast<short>(l);
- short hs = static_cast<short>(h);
-
- int hi = hs;
- int ai = ls + (hi & 1) + (hi >> 1);
-
- short as = static_cast<short>(ai);
- short bs = static_cast<short>(ai - hi);
-
- a = static_cast<unsigned short>(as);
- b = static_cast<unsigned short>(bs);
-}
-
-//
-// Wavelet basis functions with modulo arithmetic; they work with full
-// 16-bit data, but Huffman-encoding the wavelet-transformed data doesn't
-// compress the data quite as well.
-//
-
-const int NBITS = 16;
-const int A_OFFSET = 1 << (NBITS - 1);
-const int M_OFFSET = 1 << (NBITS - 1);
-const int MOD_MASK = (1 << NBITS) - 1;
-
-inline void wenc16(unsigned short a, unsigned short b, unsigned short &l,
- unsigned short &h) {
- int ao = (a + A_OFFSET) & MOD_MASK;
- int m = ((ao + b) >> 1);
- int d = ao - b;
-
- if (d < 0) m = (m + M_OFFSET) & MOD_MASK;
-
- d &= MOD_MASK;
-
- l = static_cast<unsigned short>(m);
- h = static_cast<unsigned short>(d);
-}
-
-inline void wdec16(unsigned short l, unsigned short h, unsigned short &a,
- unsigned short &b) {
- int m = l;
- int d = h;
- int bb = (m - (d >> 1)) & MOD_MASK;
- int aa = (d + bb - A_OFFSET) & MOD_MASK;
- b = static_cast<unsigned short>(bb);
- a = static_cast<unsigned short>(aa);
-}
-
-//
-// 2D Wavelet encoding:
-//
-
-static void wav2Encode(
- unsigned short *in, // io: values are transformed in place
- int nx, // i : x size
- int ox, // i : x offset
- int ny, // i : y size
- int oy, // i : y offset
- unsigned short mx) // i : maximum in[x][y] value
-{
- bool w14 = (mx < (1 << 14));
- int n = (nx > ny) ? ny : nx;
- int p = 1; // == 1 << level
- int p2 = 2; // == 1 << (level+1)
-
- //
- // Hierarchical loop on smaller dimension n
- //
-
- while (p2 <= n) {
- unsigned short *py = in;
- unsigned short *ey = in + oy * (ny - p2);
- int oy1 = oy * p;
- int oy2 = oy * p2;
- int ox1 = ox * p;
- int ox2 = ox * p2;
- unsigned short i00, i01, i10, i11;
-
- //
- // Y loop
- //
-
- for (; py <= ey; py += oy2) {
- unsigned short *px = py;
- unsigned short *ex = py + ox * (nx - p2);
-
- //
- // X loop
- //
-
- for (; px <= ex; px += ox2) {
- unsigned short *p01 = px + ox1;
- unsigned short *p10 = px + oy1;
- unsigned short *p11 = p10 + ox1;
-
- //
- // 2D wavelet encoding
- //
-
- if (w14) {
- wenc14(*px, *p01, i00, i01);
- wenc14(*p10, *p11, i10, i11);
- wenc14(i00, i10, *px, *p10);
- wenc14(i01, i11, *p01, *p11);
- } else {
- wenc16(*px, *p01, i00, i01);
- wenc16(*p10, *p11, i10, i11);
- wenc16(i00, i10, *px, *p10);
- wenc16(i01, i11, *p01, *p11);
- }
- }
-
- //
- // Encode (1D) odd column (still in Y loop)
- //
-
- if (nx & p) {
- unsigned short *p10 = px + oy1;
-
- if (w14)
- wenc14(*px, *p10, i00, *p10);
- else
- wenc16(*px, *p10, i00, *p10);
-
- *px = i00;
- }
- }
-
- //
- // Encode (1D) odd line (must loop in X)
- //
-
- if (ny & p) {
- unsigned short *px = py;
- unsigned short *ex = py + ox * (nx - p2);
-
- for (; px <= ex; px += ox2) {
- unsigned short *p01 = px + ox1;
-
- if (w14)
- wenc14(*px, *p01, i00, *p01);
- else
- wenc16(*px, *p01, i00, *p01);
-
- *px = i00;
- }
- }
-
- //
- // Next level
- //
-
- p = p2;
- p2 <<= 1;
- }
-}
-
-//
-// 2D Wavelet decoding:
-//
-
-static void wav2Decode(
- unsigned short *in, // io: values are transformed in place
- int nx, // i : x size
- int ox, // i : x offset
- int ny, // i : y size
- int oy, // i : y offset
- unsigned short mx) // i : maximum in[x][y] value
-{
- bool w14 = (mx < (1 << 14));
- int n = (nx > ny) ? ny : nx;
- int p = 1;
- int p2;
-
- //
- // Search max level
- //
-
- while (p <= n) p <<= 1;
-
- p >>= 1;
- p2 = p;
- p >>= 1;
-
- //
- // Hierarchical loop on smaller dimension n
- //
-
- while (p >= 1) {
- unsigned short *py = in;
- unsigned short *ey = in + oy * (ny - p2);
- int oy1 = oy * p;
- int oy2 = oy * p2;
- int ox1 = ox * p;
- int ox2 = ox * p2;
- unsigned short i00, i01, i10, i11;
-
- //
- // Y loop
- //
-
- for (; py <= ey; py += oy2) {
- unsigned short *px = py;
- unsigned short *ex = py + ox * (nx - p2);
-
- //
- // X loop
- //
-
- for (; px <= ex; px += ox2) {
- unsigned short *p01 = px + ox1;
- unsigned short *p10 = px + oy1;
- unsigned short *p11 = p10 + ox1;
-
- //
- // 2D wavelet decoding
- //
-
- if (w14) {
- wdec14(*px, *p10, i00, i10);
- wdec14(*p01, *p11, i01, i11);
- wdec14(i00, i01, *px, *p01);
- wdec14(i10, i11, *p10, *p11);
- } else {
- wdec16(*px, *p10, i00, i10);
- wdec16(*p01, *p11, i01, i11);
- wdec16(i00, i01, *px, *p01);
- wdec16(i10, i11, *p10, *p11);
- }
- }
-
- //
- // Decode (1D) odd column (still in Y loop)
- //
-
- if (nx & p) {
- unsigned short *p10 = px + oy1;
-
- if (w14)
- wdec14(*px, *p10, i00, *p10);
- else
- wdec16(*px, *p10, i00, *p10);
-
- *px = i00;
- }
- }
-
- //
- // Decode (1D) odd line (must loop in X)
- //
-
- if (ny & p) {
- unsigned short *px = py;
- unsigned short *ex = py + ox * (nx - p2);
-
- for (; px <= ex; px += ox2) {
- unsigned short *p01 = px + ox1;
-
- if (w14)
- wdec14(*px, *p01, i00, *p01);
- else
- wdec16(*px, *p01, i00, *p01);
-
- *px = i00;
- }
- }
-
- //
- // Next level
- //
-
- p2 = p;
- p >>= 1;
- }
-}
-
-//-----------------------------------------------------------------------------
-//
-// 16-bit Huffman compression and decompression.
-//
-// The source code in this file is derived from the 8-bit
-// Huffman compression and decompression routines written
-// by Christian Rouet for his PIZ image file format.
-//
-//-----------------------------------------------------------------------------
-
-// Adds some modification for tinyexr.
-
-const int HUF_ENCBITS = 16; // literal (value) bit length
-const int HUF_DECBITS = 14; // decoding bit size (>= 8)
-
-const int HUF_ENCSIZE = (1 << HUF_ENCBITS) + 1; // encoding table size
-const int HUF_DECSIZE = 1 << HUF_DECBITS; // decoding table size
-const int HUF_DECMASK = HUF_DECSIZE - 1;
-
-struct HufDec { // short code long code
- //-------------------------------
- unsigned int len : 8; // code length 0
- unsigned int lit : 24; // lit p size
- unsigned int *p; // 0 lits
-};
-
-inline long long hufLength(long long code) { return code & 63; }
-
-inline long long hufCode(long long code) { return code >> 6; }
-
-inline void outputBits(int nBits, long long bits, long long &c, int &lc,
- char *&out) {
- c <<= nBits;
- lc += nBits;
-
- c |= bits;
-
- while (lc >= 8) *out++ = static_cast<char>((c >> (lc -= 8)));
-}
-
-inline long long getBits(int nBits, long long &c, int &lc, const char *&in) {
- while (lc < nBits) {
- c = (c << 8) | *(reinterpret_cast<const unsigned char *>(in++));
- lc += 8;
- }
-
- lc -= nBits;
- return (c >> lc) & ((1 << nBits) - 1);
-}
-
-//
-// ENCODING TABLE BUILDING & (UN)PACKING
-//
-
-//
-// Build a "canonical" Huffman code table:
-// - for each (uncompressed) symbol, hcode contains the length
-// of the corresponding code (in the compressed data)
-// - canonical codes are computed and stored in hcode
-// - the rules for constructing canonical codes are as follows:
-// * shorter codes (if filled with zeroes to the right)
-// have a numerically higher value than longer codes
-// * for codes with the same length, numerical values
-// increase with numerical symbol values
-// - because the canonical code table can be constructed from
-// symbol lengths alone, the code table can be transmitted
-// without sending the actual code values
-// - see http://www.compressconsult.com/huffman/
-//
-
-static void hufCanonicalCodeTable(long long hcode[HUF_ENCSIZE]) {
- long long n[59];
-
- //
- // For each i from 0 through 58, count the
- // number of different codes of length i, and
- // store the count in n[i].
- //
-
- for (int i = 0; i <= 58; ++i) n[i] = 0;
-
- for (int i = 0; i < HUF_ENCSIZE; ++i) n[hcode[i]] += 1;
-
- //
- // For each i from 58 through 1, compute the
- // numerically lowest code with length i, and
- // store that code in n[i].
- //
-
- long long c = 0;
-
- for (int i = 58; i > 0; --i) {
- long long nc = ((c + n[i]) >> 1);
- n[i] = c;
- c = nc;
- }
-
- //
- // hcode[i] contains the length, l, of the
- // code for symbol i. Assign the next available
- // code of length l to the symbol and store both
- // l and the code in hcode[i].
- //
-
- for (int i = 0; i < HUF_ENCSIZE; ++i) {
- int l = static_cast<int>(hcode[i]);
-
- if (l > 0) hcode[i] = l | (n[l]++ << 6);
- }
-}
-
-//
-// Compute Huffman codes (based on frq input) and store them in frq:
-// - code structure is : [63:lsb - 6:msb] | [5-0: bit length];
-// - max code length is 58 bits;
-// - codes outside the range [im-iM] have a null length (unused values);
-// - original frequencies are destroyed;
-// - encoding tables are used by hufEncode() and hufBuildDecTable();
-//
-
-struct FHeapCompare {
- bool operator()(long long *a, long long *b) { return *a > *b; }
-};
-
-static void hufBuildEncTable(
- long long *frq, // io: input frequencies [HUF_ENCSIZE], output table
- int *im, // o: min frq index
- int *iM) // o: max frq index
-{
- //
- // This function assumes that when it is called, array frq
- // indicates the frequency of all possible symbols in the data
- // that are to be Huffman-encoded. (frq[i] contains the number
- // of occurrences of symbol i in the data.)
- //
- // The loop below does three things:
- //
- // 1) Finds the minimum and maximum indices that point
- // to non-zero entries in frq:
- //
- // frq[im] != 0, and frq[i] == 0 for all i < im
- // frq[iM] != 0, and frq[i] == 0 for all i > iM
- //
- // 2) Fills array fHeap with pointers to all non-zero
- // entries in frq.
- //
- // 3) Initializes array hlink such that hlink[i] == i
- // for all array entries.
- //
-
- std::vector<int> hlink(HUF_ENCSIZE);
- std::vector<long long *> fHeap(HUF_ENCSIZE);
-
- *im = 0;
-
- while (!frq[*im]) (*im)++;
-
- int nf = 0;
-
- for (int i = *im; i < HUF_ENCSIZE; i++) {
- hlink[i] = i;
-
- if (frq[i]) {
- fHeap[nf] = &frq[i];
- nf++;
- *iM = i;
- }
- }
-
- //
- // Add a pseudo-symbol, with a frequency count of 1, to frq;
- // adjust the fHeap and hlink array accordingly. Function
- // hufEncode() uses the pseudo-symbol for run-length encoding.
- //
-
- (*iM)++;
- frq[*iM] = 1;
- fHeap[nf] = &frq[*iM];
- nf++;
-
- //
- // Build an array, scode, such that scode[i] contains the number
- // of bits assigned to symbol i. Conceptually this is done by
- // constructing a tree whose leaves are the symbols with non-zero
- // frequency:
- //
- // Make a heap that contains all symbols with a non-zero frequency,
- // with the least frequent symbol on top.
- //
- // Repeat until only one symbol is left on the heap:
- //
- // Take the two least frequent symbols off the top of the heap.
- // Create a new node that has first two nodes as children, and
- // whose frequency is the sum of the frequencies of the first
- // two nodes. Put the new node back into the heap.
- //
- // The last node left on the heap is the root of the tree. For each
- // leaf node, the distance between the root and the leaf is the length
- // of the code for the corresponding symbol.
- //
- // The loop below doesn't actually build the tree; instead we compute
- // the distances of the leaves from the root on the fly. When a new
- // node is added to the heap, then that node's descendants are linked
- // into a single linear list that starts at the new node, and the code
- // lengths of the descendants (that is, their distance from the root
- // of the tree) are incremented by one.
- //
-
- std::make_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
-
- std::vector<long long> scode(HUF_ENCSIZE);
- memset(scode.data(), 0, sizeof(long long) * HUF_ENCSIZE);
-
- while (nf > 1) {
- //
- // Find the indices, mm and m, of the two smallest non-zero frq
- // values in fHeap, add the smallest frq to the second-smallest
- // frq, and remove the smallest frq value from fHeap.
- //
-
- int mm = fHeap[0] - frq;
- std::pop_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
- --nf;
-
- int m = fHeap[0] - frq;
- std::pop_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
-
- frq[m] += frq[mm];
- std::push_heap(&fHeap[0], &fHeap[nf], FHeapCompare());
-
- //
- // The entries in scode are linked into lists with the
- // entries in hlink serving as "next" pointers and with
- // the end of a list marked by hlink[j] == j.
- //
- // Traverse the lists that start at scode[m] and scode[mm].
- // For each element visited, increment the length of the
- // corresponding code by one bit. (If we visit scode[j]
- // during the traversal, then the code for symbol j becomes
- // one bit longer.)
- //
- // Merge the lists that start at scode[m] and scode[mm]
- // into a single list that starts at scode[m].
- //
-
- //
- // Add a bit to all codes in the first list.
- //
-
- for (int j = m;; j = hlink[j]) {
- scode[j]++;
-
- assert(scode[j] <= 58);
-
- if (hlink[j] == j) {
- //
- // Merge the two lists.
- //
-
- hlink[j] = mm;
- break;
- }
- }
-
- //
- // Add a bit to all codes in the second list
- //
-
- for (int j = mm;; j = hlink[j]) {
- scode[j]++;
-
- assert(scode[j] <= 58);
-
- if (hlink[j] == j) break;
- }
- }
-
- //
- // Build a canonical Huffman code table, replacing the code
- // lengths in scode with (code, code length) pairs. Copy the
- // code table from scode into frq.
- //
-
- hufCanonicalCodeTable(scode.data());
- memcpy(frq, scode.data(), sizeof(long long) * HUF_ENCSIZE);
-}
-
-//
-// Pack an encoding table:
-// - only code lengths, not actual codes, are stored
-// - runs of zeroes are compressed as follows:
-//
-// unpacked packed
-// --------------------------------
-// 1 zero 0 (6 bits)
-// 2 zeroes 59
-// 3 zeroes 60
-// 4 zeroes 61
-// 5 zeroes 62
-// n zeroes (6 or more) 63 n-6 (6 + 8 bits)
-//
-
-const int SHORT_ZEROCODE_RUN = 59;
-const int LONG_ZEROCODE_RUN = 63;
-const int SHORTEST_LONG_RUN = 2 + LONG_ZEROCODE_RUN - SHORT_ZEROCODE_RUN;
-const int LONGEST_LONG_RUN = 255 + SHORTEST_LONG_RUN;
-
-static void hufPackEncTable(
- const long long *hcode, // i : encoding table [HUF_ENCSIZE]
- int im, // i : min hcode index
- int iM, // i : max hcode index
- char **pcode) // o: ptr to packed table (updated)
-{
- char *p = *pcode;
- long long c = 0;
- int lc = 0;
-
- for (; im <= iM; im++) {
- int l = hufLength(hcode[im]);
-
- if (l == 0) {
- int zerun = 1;
-
- while ((im < iM) && (zerun < LONGEST_LONG_RUN)) {
- if (hufLength(hcode[im + 1]) > 0) break;
- im++;
- zerun++;
- }
-
- if (zerun >= 2) {
- if (zerun >= SHORTEST_LONG_RUN) {
- outputBits(6, LONG_ZEROCODE_RUN, c, lc, p);
- outputBits(8, zerun - SHORTEST_LONG_RUN, c, lc, p);
- } else {
- outputBits(6, SHORT_ZEROCODE_RUN + zerun - 2, c, lc, p);
- }
- continue;
- }
- }
-
- outputBits(6, l, c, lc, p);
- }
-
- if (lc > 0) *p++ = (unsigned char)(c << (8 - lc));
-
- *pcode = p;
-}
-
-//
-// Unpack an encoding table packed by hufPackEncTable():
-//
-
-static bool hufUnpackEncTable(
- const char **pcode, // io: ptr to packed table (updated)
- int ni, // i : input size (in bytes)
- int im, // i : min hcode index
- int iM, // i : max hcode index
- long long *hcode) // o: encoding table [HUF_ENCSIZE]
-{
- memset(hcode, 0, sizeof(long long) * HUF_ENCSIZE);
-
- const char *p = *pcode;
- long long c = 0;
- int lc = 0;
-
- for (; im <= iM; im++) {
- if (p - *pcode >= ni) {
- return false;
- }
-
- long long l = hcode[im] = getBits(6, c, lc, p); // code length
-
- if (l == (long long)LONG_ZEROCODE_RUN) {
- if (p - *pcode > ni) {
- return false;
- }
-
- int zerun = getBits(8, c, lc, p) + SHORTEST_LONG_RUN;
-
- if (im + zerun > iM + 1) {
- return false;
- }
-
- while (zerun--) hcode[im++] = 0;
-
- im--;
- } else if (l >= (long long)SHORT_ZEROCODE_RUN) {
- int zerun = l - SHORT_ZEROCODE_RUN + 2;
-
- if (im + zerun > iM + 1) {
- return false;
- }
-
- while (zerun--) hcode[im++] = 0;
-
- im--;
- }
- }
-
- *pcode = const_cast<char *>(p);
-
- hufCanonicalCodeTable(hcode);
-
- return true;
-}
-
-//
-// DECODING TABLE BUILDING
-//
-
-//
-// Clear a newly allocated decoding table so that it contains only zeroes.
-//
-
-static void hufClearDecTable(HufDec *hdecod) // io: (allocated by caller)
-// decoding table [HUF_DECSIZE]
-{
- for (int i = 0; i < HUF_DECSIZE; i++) {
- hdecod[i].len = 0;
- hdecod[i].lit = 0;
- hdecod[i].p = NULL;
- }
- // memset(hdecod, 0, sizeof(HufDec) * HUF_DECSIZE);
-}
-
-//
-// Build a decoding hash table based on the encoding table hcode:
-// - short codes (<= HUF_DECBITS) are resolved with a single table access;
-// - long code entry allocations are not optimized, because long codes are
-// unfrequent;
-// - decoding tables are used by hufDecode();
-//
-
-static bool hufBuildDecTable(const long long *hcode, // i : encoding table
- int im, // i : min index in hcode
- int iM, // i : max index in hcode
- HufDec *hdecod) // o: (allocated by caller)
-// decoding table [HUF_DECSIZE]
-{
- //
- // Init hashtable & loop on all codes.
- // Assumes that hufClearDecTable(hdecod) has already been called.
- //
-
- for (; im <= iM; im++) {
- long long c = hufCode(hcode[im]);
- int l = hufLength(hcode[im]);
-
- if (c >> l) {
- //
- // Error: c is supposed to be an l-bit code,
- // but c contains a value that is greater
- // than the largest l-bit number.
- //
-
- // invalidTableEntry();
- return false;
- }
-
- if (l > HUF_DECBITS) {
- //
- // Long code: add a secondary entry
- //
-
- HufDec *pl = hdecod + (c >> (l - HUF_DECBITS));
-
- if (pl->len) {
- //
- // Error: a short code has already
- // been stored in table entry *pl.
- //
-
- // invalidTableEntry();
- return false;
- }
-
- pl->lit++;
-
- if (pl->p) {
- unsigned int *p = pl->p;
- pl->p = new unsigned int[pl->lit];
-
- for (int i = 0; i < pl->lit - 1; ++i) pl->p[i] = p[i];
-
- delete[] p;
- } else {
- pl->p = new unsigned int[1];
- }
-
- pl->p[pl->lit - 1] = im;
- } else if (l) {
- //
- // Short code: init all primary entries
- //
-
- HufDec *pl = hdecod + (c << (HUF_DECBITS - l));
-
- for (long long i = 1ULL << (HUF_DECBITS - l); i > 0; i--, pl++) {
- if (pl->len || pl->p) {
- //
- // Error: a short code or a long code has
- // already been stored in table entry *pl.
- //
-
- // invalidTableEntry();
- return false;
- }
-
- pl->len = l;
- pl->lit = im;
- }
- }
- }
-
- return true;
-}
-
-//
-// Free the long code entries of a decoding table built by hufBuildDecTable()
-//
-
-static void hufFreeDecTable(HufDec *hdecod) // io: Decoding table
-{
- for (int i = 0; i < HUF_DECSIZE; i++) {
- if (hdecod[i].p) {
- delete[] hdecod[i].p;
- hdecod[i].p = 0;
- }
- }
-}
-
-//
-// ENCODING
-//
-
-inline void outputCode(long long code, long long &c, int &lc, char *&out) {
- outputBits(hufLength(code), hufCode(code), c, lc, out);
-}
-
-inline void sendCode(long long sCode, int runCount, long long runCode,
- long long &c, int &lc, char *&out) {
- //
- // Output a run of runCount instances of the symbol sCount.
- // Output the symbols explicitly, or if that is shorter, output
- // the sCode symbol once followed by a runCode symbol and runCount
- // expressed as an 8-bit number.
- //
-
- if (hufLength(sCode) + hufLength(runCode) + 8 < hufLength(sCode) * runCount) {
- outputCode(sCode, c, lc, out);
- outputCode(runCode, c, lc, out);
- outputBits(8, runCount, c, lc, out);
- } else {
- while (runCount-- >= 0) outputCode(sCode, c, lc, out);
- }
-}
-
-//
-// Encode (compress) ni values based on the Huffman encoding table hcode:
-//
-
-static int hufEncode // return: output size (in bits)
- (const long long *hcode, // i : encoding table
- const unsigned short *in, // i : uncompressed input buffer
- const int ni, // i : input buffer size (in bytes)
- int rlc, // i : rl code
- char *out) // o: compressed output buffer
-{
- char *outStart = out;
- long long c = 0; // bits not yet written to out
- int lc = 0; // number of valid bits in c (LSB)
- int s = in[0];
- int cs = 0;
-
- //
- // Loop on input values
- //
-
- for (int i = 1; i < ni; i++) {
- //
- // Count same values or send code
- //
-
- if (s == in[i] && cs < 255) {
- cs++;
- } else {
- sendCode(hcode[s], cs, hcode[rlc], c, lc, out);
- cs = 0;
- }
-
- s = in[i];
- }
-
- //
- // Send remaining code
- //
-
- sendCode(hcode[s], cs, hcode[rlc], c, lc, out);
-
- if (lc) *out = (c << (8 - lc)) & 0xff;
-
- return (out - outStart) * 8 + lc;
-}
-
-//
-// DECODING
-//
-
-//
-// In order to force the compiler to inline them,
-// getChar() and getCode() are implemented as macros
-// instead of "inline" functions.
-//
-
-#define getChar(c, lc, in) \
- { \
- c = (c << 8) | *(unsigned char *)(in++); \
- lc += 8; \
- }
-
-#if 0
-#define getCode(po, rlc, c, lc, in, out, ob, oe) \
- { \
- if (po == rlc) { \
- if (lc < 8) getChar(c, lc, in); \
- \
- lc -= 8; \
- \
- unsigned char cs = (c >> lc); \
- \
- if (out + cs > oe) return false; \
- \
- /* TinyEXR issue 78 */ \
- unsigned short s = out[-1]; \
- \
- while (cs-- > 0) *out++ = s; \
- } else if (out < oe) { \
- *out++ = po; \
- } else { \
- return false; \
- } \
- }
-#else
-static bool getCode(int po, int rlc, long long &c, int &lc, const char *&in,
- const char *in_end, unsigned short *&out,
- const unsigned short *ob, const unsigned short *oe) {
- (void)ob;
- if (po == rlc) {
- if (lc < 8) {
- /* TinyEXR issue 78 */
- /* TinyEXR issue 160. in + 1 -> in */
- if (in >= in_end) {
- return false;
- }
-
- getChar(c, lc, in);
- }
-
- lc -= 8;
-
- unsigned char cs = (c >> lc);
-
- if (out + cs > oe) return false;
-
- // Bounds check for safety
- // Issue 100.
- if ((out - 1) < ob) return false;
- unsigned short s = out[-1];
-
- while (cs-- > 0) *out++ = s;
- } else if (out < oe) {
- *out++ = po;
- } else {
- return false;
- }
- return true;
-}
-#endif
-
-//
-// Decode (uncompress) ni bits based on encoding & decoding tables:
-//
-
-static bool hufDecode(const long long *hcode, // i : encoding table
- const HufDec *hdecod, // i : decoding table
- const char *in, // i : compressed input buffer
- int ni, // i : input size (in bits)
- int rlc, // i : run-length code
- int no, // i : expected output size (in bytes)
- unsigned short *out) // o: uncompressed output buffer
-{
- long long c = 0;
- int lc = 0;
- unsigned short *outb = out; // begin
- unsigned short *oe = out + no; // end
- const char *ie = in + (ni + 7) / 8; // input byte size
-
- //
- // Loop on input bytes
- //
-
- while (in < ie) {
- getChar(c, lc, in);
-
- //
- // Access decoding table
- //
-
- while (lc >= HUF_DECBITS) {
- const HufDec pl = hdecod[(c >> (lc - HUF_DECBITS)) & HUF_DECMASK];
-
- if (pl.len) {
- //
- // Get short code
- //
-
- lc -= pl.len;
- // std::cout << "lit = " << pl.lit << std::endl;
- // std::cout << "rlc = " << rlc << std::endl;
- // std::cout << "c = " << c << std::endl;
- // std::cout << "lc = " << lc << std::endl;
- // std::cout << "in = " << in << std::endl;
- // std::cout << "out = " << out << std::endl;
- // std::cout << "oe = " << oe << std::endl;
- if (!getCode(pl.lit, rlc, c, lc, in, ie, out, outb, oe)) {
- return false;
- }
- } else {
- if (!pl.p) {
- return false;
- }
- // invalidCode(); // wrong code
-
- //
- // Search long code
- //
-
- int j;
-
- for (j = 0; j < pl.lit; j++) {
- int l = hufLength(hcode[pl.p[j]]);
-
- while (lc < l && in < ie) // get more bits
- getChar(c, lc, in);
-
- if (lc >= l) {
- if (hufCode(hcode[pl.p[j]]) ==
- ((c >> (lc - l)) & (((long long)(1) << l) - 1))) {
- //
- // Found : get long code
- //
-
- lc -= l;
- if (!getCode(pl.p[j], rlc, c, lc, in, ie, out, outb, oe)) {
- return false;
- }
- break;
- }
- }
- }
-
- if (j == pl.lit) {
- return false;
- // invalidCode(); // Not found
- }
- }
- }
- }
-
- //
- // Get remaining (short) codes
- //
-
- int i = (8 - ni) & 7;
- c >>= i;
- lc -= i;
-
- while (lc > 0) {
- const HufDec pl = hdecod[(c << (HUF_DECBITS - lc)) & HUF_DECMASK];
-
- if (pl.len) {
- lc -= pl.len;
- if (!getCode(pl.lit, rlc, c, lc, in, ie, out, outb, oe)) {
- return false;
- }
- } else {
- return false;
- // invalidCode(); // wrong (long) code
- }
- }
-
- if (out - outb != no) {
- return false;
- }
- // notEnoughData ();
-
- return true;
-}
-
-static void countFrequencies(std::vector<long long> &freq,
- const unsigned short data[/*n*/], int n) {
- for (int i = 0; i < HUF_ENCSIZE; ++i) freq[i] = 0;
-
- for (int i = 0; i < n; ++i) ++freq[data[i]];
-}
-
-static void writeUInt(char buf[4], unsigned int i) {
- unsigned char *b = (unsigned char *)buf;
-
- b[0] = i;
- b[1] = i >> 8;
- b[2] = i >> 16;
- b[3] = i >> 24;
-}
-
-static unsigned int readUInt(const char buf[4]) {
- const unsigned char *b = (const unsigned char *)buf;
-
- return (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) |
- ((b[2] << 16) & 0x00ff0000) | ((b[3] << 24) & 0xff000000);
-}
-
-//
-// EXTERNAL INTERFACE
-//
-
-static int hufCompress(const unsigned short raw[], int nRaw,
- char compressed[]) {
- if (nRaw == 0) return 0;
-
- std::vector<long long> freq(HUF_ENCSIZE);
-
- countFrequencies(freq, raw, nRaw);
-
- int im = 0;
- int iM = 0;
- hufBuildEncTable(freq.data(), &im, &iM);
-
- char *tableStart = compressed + 20;
- char *tableEnd = tableStart;
- hufPackEncTable(freq.data(), im, iM, &tableEnd);
- int tableLength = tableEnd - tableStart;
-
- char *dataStart = tableEnd;
- int nBits = hufEncode(freq.data(), raw, nRaw, iM, dataStart);
- int data_length = (nBits + 7) / 8;
-
- writeUInt(compressed, im);
- writeUInt(compressed + 4, iM);
- writeUInt(compressed + 8, tableLength);
- writeUInt(compressed + 12, nBits);
- writeUInt(compressed + 16, 0); // room for future extensions
-
- return dataStart + data_length - compressed;
-}
-
-static bool hufUncompress(const char compressed[], int nCompressed,
- std::vector<unsigned short> *raw) {
- if (nCompressed == 0) {
- if (raw->size() != 0) return false;
-
- return false;
- }
-
- int im = readUInt(compressed);
- int iM = readUInt(compressed + 4);
- // int tableLength = readUInt (compressed + 8);
- int nBits = readUInt(compressed + 12);
-
- if (im < 0 || im >= HUF_ENCSIZE || iM < 0 || iM >= HUF_ENCSIZE) return false;
-
- const char *ptr = compressed + 20;
-
- //
- // Fast decoder needs at least 2x64-bits of compressed data, and
- // needs to be run-able on this platform. Otherwise, fall back
- // to the original decoder
- //
-
- // if (FastHufDecoder::enabled() && nBits > 128)
- //{
- // FastHufDecoder fhd (ptr, nCompressed - (ptr - compressed), im, iM, iM);
- // fhd.decode ((unsigned char*)ptr, nBits, raw, nRaw);
- //}
- // else
- {
- std::vector<long long> freq(HUF_ENCSIZE);
- std::vector<HufDec> hdec(HUF_DECSIZE);
-
- hufClearDecTable(&hdec.at(0));
-
- hufUnpackEncTable(&ptr, nCompressed - (ptr - compressed), im, iM,
- &freq.at(0));
-
- {
- if (nBits > 8 * (nCompressed - (ptr - compressed))) {
- return false;
- }
-
- hufBuildDecTable(&freq.at(0), im, iM, &hdec.at(0));
- hufDecode(&freq.at(0), &hdec.at(0), ptr, nBits, iM, raw->size(),
- raw->data());
- }
- // catch (...)
- //{
- // hufFreeDecTable (hdec);
- // throw;
- //}
-
- hufFreeDecTable(&hdec.at(0));
- }
-
- return true;
-}
-
-//
-// Functions to compress the range of values in the pixel data
-//
-
-const int USHORT_RANGE = (1 << 16);
-const int BITMAP_SIZE = (USHORT_RANGE >> 3);
-
-static void bitmapFromData(const unsigned short data[/*nData*/], int nData,
- unsigned char bitmap[BITMAP_SIZE],
- unsigned short &minNonZero,
- unsigned short &maxNonZero) {
- for (int i = 0; i < BITMAP_SIZE; ++i) bitmap[i] = 0;
-
- for (int i = 0; i < nData; ++i) bitmap[data[i] >> 3] |= (1 << (data[i] & 7));
-
- bitmap[0] &= ~1; // zero is not explicitly stored in
- // the bitmap; we assume that the
- // data always contain zeroes
- minNonZero = BITMAP_SIZE - 1;
- maxNonZero = 0;
-
- for (int i = 0; i < BITMAP_SIZE; ++i) {
- if (bitmap[i]) {
- if (minNonZero > i) minNonZero = i;
- if (maxNonZero < i) maxNonZero = i;
- }
- }
-}
-
-static unsigned short forwardLutFromBitmap(
- const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
- int k = 0;
-
- for (int i = 0; i < USHORT_RANGE; ++i) {
- if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7))))
- lut[i] = k++;
- else
- lut[i] = 0;
- }
-
- return k - 1; // maximum value stored in lut[],
-} // i.e. number of ones in bitmap minus 1
-
-static unsigned short reverseLutFromBitmap(
- const unsigned char bitmap[BITMAP_SIZE], unsigned short lut[USHORT_RANGE]) {
- int k = 0;
-
- for (int i = 0; i < USHORT_RANGE; ++i) {
- if ((i == 0) || (bitmap[i >> 3] & (1 << (i & 7)))) lut[k++] = i;
- }
-
- int n = k - 1;
-
- while (k < USHORT_RANGE) lut[k++] = 0;
-
- return n; // maximum k where lut[k] is non-zero,
-} // i.e. number of ones in bitmap minus 1
-
-static void applyLut(const unsigned short lut[USHORT_RANGE],
- unsigned short data[/*nData*/], int nData) {
- for (int i = 0; i < nData; ++i) data[i] = lut[data[i]];
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif // __clang__
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-static bool CompressPiz(unsigned char *outPtr, unsigned int *outSize,
- const unsigned char *inPtr, size_t inSize,
- const std::vector<ChannelInfo> &channelInfo,
- int data_width, int num_lines) {
- std::vector<unsigned char> bitmap(BITMAP_SIZE);
- unsigned short minNonZero;
- unsigned short maxNonZero;
-
-#if !TINYEXR_LITTLE_ENDIAN
- // @todo { PIZ compression on BigEndian architecture. }
- assert(0);
- return false;
-#endif
-
- // Assume `inSize` is multiple of 2 or 4.
- std::vector<unsigned short> tmpBuffer(inSize / sizeof(unsigned short));
-
- std::vector<PIZChannelData> channelData(channelInfo.size());
- unsigned short *tmpBufferEnd = &tmpBuffer.at(0);
-
- for (size_t c = 0; c < channelData.size(); c++) {
- PIZChannelData &cd = channelData[c];
-
- cd.start = tmpBufferEnd;
- cd.end = cd.start;
-
- cd.nx = data_width;
- cd.ny = num_lines;
- // cd.ys = c.channel().ySampling;
-
- size_t pixelSize = sizeof(int); // UINT and FLOAT
- if (channelInfo[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
- pixelSize = sizeof(short);
- }
-
- cd.size = static_cast<int>(pixelSize / sizeof(short));
-
- tmpBufferEnd += cd.nx * cd.ny * cd.size;
- }
-
- const unsigned char *ptr = inPtr;
- for (int y = 0; y < num_lines; ++y) {
- for (size_t i = 0; i < channelData.size(); ++i) {
- PIZChannelData &cd = channelData[i];
-
- // if (modp (y, cd.ys) != 0)
- // continue;
-
- size_t n = static_cast<size_t>(cd.nx * cd.size);
- memcpy(cd.end, ptr, n * sizeof(unsigned short));
- ptr += n * sizeof(unsigned short);
- cd.end += n;
- }
- }
-
- bitmapFromData(&tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()),
- bitmap.data(), minNonZero, maxNonZero);
-
- std::vector<unsigned short> lut(USHORT_RANGE);
- unsigned short maxValue = forwardLutFromBitmap(bitmap.data(), lut.data());
- applyLut(lut.data(), &tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()));
-
- //
- // Store range compression info in _outBuffer
- //
-
- char *buf = reinterpret_cast<char *>(outPtr);
-
- memcpy(buf, &minNonZero, sizeof(unsigned short));
- buf += sizeof(unsigned short);
- memcpy(buf, &maxNonZero, sizeof(unsigned short));
- buf += sizeof(unsigned short);
-
- if (minNonZero <= maxNonZero) {
- memcpy(buf, reinterpret_cast<char *>(&bitmap[0] + minNonZero),
- maxNonZero - minNonZero + 1);
- buf += maxNonZero - minNonZero + 1;
- }
-
- //
- // Apply wavelet encoding
- //
-
- for (size_t i = 0; i < channelData.size(); ++i) {
- PIZChannelData &cd = channelData[i];
-
- for (int j = 0; j < cd.size; ++j) {
- wav2Encode(cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size,
- maxValue);
- }
- }
-
- //
- // Apply Huffman encoding; append the result to _outBuffer
- //
-
- // length header(4byte), then huff data. Initialize length header with zero,
- // then later fill it by `length`.
- char *lengthPtr = buf;
- int zero = 0;
- memcpy(buf, &zero, sizeof(int));
- buf += sizeof(int);
-
- int length =
- hufCompress(&tmpBuffer.at(0), static_cast<int>(tmpBuffer.size()), buf);
- memcpy(lengthPtr, &length, sizeof(int));
-
- (*outSize) = static_cast<unsigned int>(
- (reinterpret_cast<unsigned char *>(buf) - outPtr) +
- static_cast<unsigned int>(length));
-
- // Use uncompressed data when compressed data is larger than uncompressed.
- // (Issue 40)
- if ((*outSize) >= inSize) {
- (*outSize) = static_cast<unsigned int>(inSize);
- memcpy(outPtr, inPtr, inSize);
- }
- return true;
-}
-
-static bool DecompressPiz(unsigned char *outPtr, const unsigned char *inPtr,
- size_t tmpBufSizeInBytes, size_t inLen, int num_channels,
- const EXRChannelInfo *channels, int data_width,
- int num_lines) {
- if (inLen == tmpBufSizeInBytes) {
- // Data is not compressed(Issue 40).
- memcpy(outPtr, inPtr, inLen);
- return true;
- }
-
- std::vector<unsigned char> bitmap(BITMAP_SIZE);
- unsigned short minNonZero;
- unsigned short maxNonZero;
-
-#if !TINYEXR_LITTLE_ENDIAN
- // @todo { PIZ compression on BigEndian architecture. }
- assert(0);
- return false;
-#endif
-
- memset(bitmap.data(), 0, BITMAP_SIZE);
-
- const unsigned char *ptr = inPtr;
- // minNonZero = *(reinterpret_cast<const unsigned short *>(ptr));
- tinyexr::cpy2(&minNonZero, reinterpret_cast<const unsigned short *>(ptr));
- // maxNonZero = *(reinterpret_cast<const unsigned short *>(ptr + 2));
- tinyexr::cpy2(&maxNonZero, reinterpret_cast<const unsigned short *>(ptr + 2));
- ptr += 4;
-
- if (maxNonZero >= BITMAP_SIZE) {
- return false;
- }
-
- if (minNonZero <= maxNonZero) {
- memcpy(reinterpret_cast<char *>(&bitmap[0] + minNonZero), ptr,
- maxNonZero - minNonZero + 1);
- ptr += maxNonZero - minNonZero + 1;
- }
-
- std::vector<unsigned short> lut(USHORT_RANGE);
- memset(lut.data(), 0, sizeof(unsigned short) * USHORT_RANGE);
- unsigned short maxValue = reverseLutFromBitmap(bitmap.data(), lut.data());
-
- //
- // Huffman decoding
- //
-
- int length;
-
- // length = *(reinterpret_cast<const int *>(ptr));
- tinyexr::cpy4(&length, reinterpret_cast<const int *>(ptr));
- ptr += sizeof(int);
-
- if (size_t((ptr - inPtr) + length) > inLen) {
- return false;
- }
-
- std::vector<unsigned short> tmpBuffer(tmpBufSizeInBytes / sizeof(unsigned short));
- hufUncompress(reinterpret_cast<const char *>(ptr), length, &tmpBuffer);
-
- //
- // Wavelet decoding
- //
-
- std::vector<PIZChannelData> channelData(static_cast<size_t>(num_channels));
-
- unsigned short *tmpBufferEnd = &tmpBuffer.at(0);
-
- for (size_t i = 0; i < static_cast<size_t>(num_channels); ++i) {
- const EXRChannelInfo &chan = channels[i];
-
- size_t pixelSize = sizeof(int); // UINT and FLOAT
- if (chan.pixel_type == TINYEXR_PIXELTYPE_HALF) {
- pixelSize = sizeof(short);
- }
-
- channelData[i].start = tmpBufferEnd;
- channelData[i].end = channelData[i].start;
- channelData[i].nx = data_width;
- channelData[i].ny = num_lines;
- // channelData[i].ys = 1;
- channelData[i].size = static_cast<int>(pixelSize / sizeof(short));
-
- tmpBufferEnd += channelData[i].nx * channelData[i].ny * channelData[i].size;
- }
-
- for (size_t i = 0; i < channelData.size(); ++i) {
- PIZChannelData &cd = channelData[i];
-
- for (int j = 0; j < cd.size; ++j) {
- wav2Decode(cd.start + j, cd.nx, cd.size, cd.ny, cd.nx * cd.size,
- maxValue);
- }
- }
-
- //
- // Expand the pixel data to their original range
- //
-
- applyLut(lut.data(), &tmpBuffer.at(0), static_cast<int>(tmpBufSizeInBytes / sizeof(unsigned short)));
-
- for (int y = 0; y < num_lines; y++) {
- for (size_t i = 0; i < channelData.size(); ++i) {
- PIZChannelData &cd = channelData[i];
-
- // if (modp (y, cd.ys) != 0)
- // continue;
-
- size_t n = static_cast<size_t>(cd.nx * cd.size);
- memcpy(outPtr, cd.end, static_cast<size_t>(n * sizeof(unsigned short)));
- outPtr += n * sizeof(unsigned short);
- cd.end += n;
- }
- }
-
- return true;
-}
-#endif // TINYEXR_USE_PIZ
-
-#if TINYEXR_USE_ZFP
-
-struct ZFPCompressionParam {
- double rate;
- unsigned int precision;
- unsigned int __pad0;
- double tolerance;
- int type; // TINYEXR_ZFP_COMPRESSIONTYPE_*
- unsigned int __pad1;
-
- ZFPCompressionParam() {
- type = TINYEXR_ZFP_COMPRESSIONTYPE_RATE;
- rate = 2.0;
- precision = 0;
- tolerance = 0.0;
- }
-};
-
-static bool FindZFPCompressionParam(ZFPCompressionParam *param,
- const EXRAttribute *attributes,
- int num_attributes, std::string *err) {
- bool foundType = false;
-
- for (int i = 0; i < num_attributes; i++) {
- if ((strcmp(attributes[i].name, "zfpCompressionType") == 0)) {
- if (attributes[i].size == 1) {
- param->type = static_cast<int>(attributes[i].value[0]);
- foundType = true;
- break;
- } else {
- if (err) {
- (*err) +=
- "zfpCompressionType attribute must be uchar(1 byte) type.\n";
- }
- return false;
- }
- }
- }
-
- if (!foundType) {
- if (err) {
- (*err) += "`zfpCompressionType` attribute not found.\n";
- }
- return false;
- }
-
- if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
- for (int i = 0; i < num_attributes; i++) {
- if ((strcmp(attributes[i].name, "zfpCompressionRate") == 0) &&
- (attributes[i].size == 8)) {
- param->rate = *(reinterpret_cast<double *>(attributes[i].value));
- return true;
- }
- }
-
- if (err) {
- (*err) += "`zfpCompressionRate` attribute not found.\n";
- }
-
- } else if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
- for (int i = 0; i < num_attributes; i++) {
- if ((strcmp(attributes[i].name, "zfpCompressionPrecision") == 0) &&
- (attributes[i].size == 4)) {
- param->rate = *(reinterpret_cast<int *>(attributes[i].value));
- return true;
- }
- }
-
- if (err) {
- (*err) += "`zfpCompressionPrecision` attribute not found.\n";
- }
-
- } else if (param->type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
- for (int i = 0; i < num_attributes; i++) {
- if ((strcmp(attributes[i].name, "zfpCompressionTolerance") == 0) &&
- (attributes[i].size == 8)) {
- param->tolerance = *(reinterpret_cast<double *>(attributes[i].value));
- return true;
- }
- }
-
- if (err) {
- (*err) += "`zfpCompressionTolerance` attribute not found.\n";
- }
- } else {
- if (err) {
- (*err) += "Unknown value specified for `zfpCompressionType`.\n";
- }
- }
-
- return false;
-}
-
-// Assume pixel format is FLOAT for all channels.
-static bool DecompressZfp(float *dst, int dst_width, int dst_num_lines,
- size_t num_channels, const unsigned char *src,
- unsigned long src_size,
- const ZFPCompressionParam &param) {
- size_t uncompressed_size =
- size_t(dst_width) * size_t(dst_num_lines) * num_channels;
-
- if (uncompressed_size == src_size) {
- // Data is not compressed(Issue 40).
- memcpy(dst, src, src_size);
- }
-
- zfp_stream *zfp = NULL;
- zfp_field *field = NULL;
-
- assert((dst_width % 4) == 0);
- assert((dst_num_lines % 4) == 0);
-
- if ((size_t(dst_width) & 3U) || (size_t(dst_num_lines) & 3U)) {
- return false;
- }
-
- field =
- zfp_field_2d(reinterpret_cast<void *>(const_cast<unsigned char *>(src)),
- zfp_type_float, static_cast<unsigned int>(dst_width),
- static_cast<unsigned int>(dst_num_lines) *
- static_cast<unsigned int>(num_channels));
- zfp = zfp_stream_open(NULL);
-
- if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
- zfp_stream_set_rate(zfp, param.rate, zfp_type_float, /* dimension */ 2,
- /* write random access */ 0);
- } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
- zfp_stream_set_precision(zfp, param.precision);
- } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
- zfp_stream_set_accuracy(zfp, param.tolerance);
- } else {
- assert(0);
- }
-
- size_t buf_size = zfp_stream_maximum_size(zfp, field);
- std::vector<unsigned char> buf(buf_size);
- memcpy(&buf.at(0), src, src_size);
-
- bitstream *stream = stream_open(&buf.at(0), buf_size);
- zfp_stream_set_bit_stream(zfp, stream);
- zfp_stream_rewind(zfp);
-
- size_t image_size = size_t(dst_width) * size_t(dst_num_lines);
-
- for (size_t c = 0; c < size_t(num_channels); c++) {
- // decompress 4x4 pixel block.
- for (size_t y = 0; y < size_t(dst_num_lines); y += 4) {
- for (size_t x = 0; x < size_t(dst_width); x += 4) {
- float fblock[16];
- zfp_decode_block_float_2(zfp, fblock);
- for (size_t j = 0; j < 4; j++) {
- for (size_t i = 0; i < 4; i++) {
- dst[c * image_size + ((y + j) * size_t(dst_width) + (x + i))] =
- fblock[j * 4 + i];
- }
- }
- }
- }
- }
-
- zfp_field_free(field);
- zfp_stream_close(zfp);
- stream_close(stream);
-
- return true;
-}
-
-// Assume pixel format is FLOAT for all channels.
-static bool CompressZfp(std::vector<unsigned char> *outBuf,
- unsigned int *outSize, const float *inPtr, int width,
- int num_lines, int num_channels,
- const ZFPCompressionParam &param) {
- zfp_stream *zfp = NULL;
- zfp_field *field = NULL;
-
- assert((width % 4) == 0);
- assert((num_lines % 4) == 0);
-
- if ((size_t(width) & 3U) || (size_t(num_lines) & 3U)) {
- return false;
- }
-
- // create input array.
- field = zfp_field_2d(reinterpret_cast<void *>(const_cast<float *>(inPtr)),
- zfp_type_float, static_cast<unsigned int>(width),
- static_cast<unsigned int>(num_lines * num_channels));
-
- zfp = zfp_stream_open(NULL);
-
- if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_RATE) {
- zfp_stream_set_rate(zfp, param.rate, zfp_type_float, 2, 0);
- } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_PRECISION) {
- zfp_stream_set_precision(zfp, param.precision);
- } else if (param.type == TINYEXR_ZFP_COMPRESSIONTYPE_ACCURACY) {
- zfp_stream_set_accuracy(zfp, param.tolerance);
- } else {
- assert(0);
- }
-
- size_t buf_size = zfp_stream_maximum_size(zfp, field);
-
- outBuf->resize(buf_size);
-
- bitstream *stream = stream_open(&outBuf->at(0), buf_size);
- zfp_stream_set_bit_stream(zfp, stream);
- zfp_field_free(field);
-
- size_t image_size = size_t(width) * size_t(num_lines);
-
- for (size_t c = 0; c < size_t(num_channels); c++) {
- // compress 4x4 pixel block.
- for (size_t y = 0; y < size_t(num_lines); y += 4) {
- for (size_t x = 0; x < size_t(width); x += 4) {
- float fblock[16];
- for (size_t j = 0; j < 4; j++) {
- for (size_t i = 0; i < 4; i++) {
- fblock[j * 4 + i] =
- inPtr[c * image_size + ((y + j) * size_t(width) + (x + i))];
- }
- }
- zfp_encode_block_float_2(zfp, fblock);
- }
- }
- }
-
- zfp_stream_flush(zfp);
- (*outSize) = static_cast<unsigned int>(zfp_stream_compressed_size(zfp));
-
- zfp_stream_close(zfp);
-
- return true;
-}
-
-#endif
-
-//
-// -----------------------------------------------------------------
-//
-
-// heuristics
-#define TINYEXR_DIMENSION_THRESHOLD (1024 * 8192)
-
-// TODO(syoyo): Refactor function arguments.
-static bool DecodePixelData(/* out */ unsigned char **out_images,
- const int *requested_pixel_types,
- const unsigned char *data_ptr, size_t data_len,
- int compression_type, int line_order, int width,
- int height, int x_stride, int y, int line_no,
- int num_lines, size_t pixel_data_size,
- size_t num_attributes,
- const EXRAttribute *attributes, size_t num_channels,
- const EXRChannelInfo *channels,
- const std::vector<size_t> &channel_offset_list) {
- if (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) { // PIZ
-#if TINYEXR_USE_PIZ
- if ((width == 0) || (num_lines == 0) || (pixel_data_size == 0)) {
- // Invalid input #90
- return false;
- }
-
- // Allocate original data size.
- std::vector<unsigned char> outBuf(static_cast<size_t>(
- static_cast<size_t>(width * num_lines) * pixel_data_size));
- size_t tmpBufLen = outBuf.size();
-
- bool ret = tinyexr::DecompressPiz(
- reinterpret_cast<unsigned char *>(&outBuf.at(0)), data_ptr, tmpBufLen,
- data_len, static_cast<int>(num_channels), channels, width, num_lines);
-
- if (!ret) {
- return false;
- }
-
- // For PIZ_COMPRESSION:
- // pixel sample data for channel 0 for scanline 0
- // pixel sample data for channel 1 for scanline 0
- // pixel sample data for channel ... for scanline 0
- // pixel sample data for channel n for scanline 0
- // pixel sample data for channel 0 for scanline 1
- // pixel sample data for channel 1 for scanline 1
- // pixel sample data for channel ... for scanline 1
- // pixel sample data for channel n for scanline 1
- // ...
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- FP16 hf;
-
- // hf.u = line_ptr[u];
- // use `cpy` to avoid unaligned memory access when compiler's
- // optimization is on.
- tinyexr::cpy2(&(hf.u), line_ptr + u);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
-
- if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
- unsigned short *image =
- reinterpret_cast<unsigned short **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += static_cast<size_t>(
- (height - 1 - (line_no + static_cast<int>(v)))) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = hf.u;
- } else { // HALF -> FLOAT
- FP32 f32 = half_to_float(hf);
- float *image = reinterpret_cast<float **>(out_images)[c];
- size_t offset = 0;
- if (line_order == 0) {
- offset = (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- offset = static_cast<size_t>(
- (height - 1 - (line_no + static_cast<int>(v)))) *
- static_cast<size_t>(x_stride) +
- u;
- }
- image += offset;
- *image = f32.f;
- }
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
-
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- unsigned int val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(&val);
-
- unsigned int *image =
- reinterpret_cast<unsigned int **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += static_cast<size_t>(
- (height - 1 - (line_no + static_cast<int>(v)))) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const float *line_ptr = reinterpret_cast<float *>(&outBuf.at(
- v * pixel_data_size * static_cast<size_t>(x_stride) +
- channel_offset_list[c] * static_cast<size_t>(x_stride)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- float val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- float *image = reinterpret_cast<float **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += static_cast<size_t>(
- (height - 1 - (line_no + static_cast<int>(v)))) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else {
- assert(0);
- }
- }
-#else
- assert(0 && "PIZ is enabled in this build");
- return false;
-#endif
-
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS ||
- compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
- // Allocate original data size.
- std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
- static_cast<size_t>(num_lines) *
- pixel_data_size);
-
- unsigned long dstLen = static_cast<unsigned long>(outBuf.size());
- assert(dstLen > 0);
- if (!tinyexr::DecompressZip(
- reinterpret_cast<unsigned char *>(&outBuf.at(0)), &dstLen, data_ptr,
- static_cast<unsigned long>(data_len))) {
- return false;
- }
-
- // For ZIP_COMPRESSION:
- // pixel sample data for channel 0 for scanline 0
- // pixel sample data for channel 1 for scanline 0
- // pixel sample data for channel ... for scanline 0
- // pixel sample data for channel n for scanline 0
- // pixel sample data for channel 0 for scanline 1
- // pixel sample data for channel 1 for scanline 1
- // pixel sample data for channel ... for scanline 1
- // pixel sample data for channel n for scanline 1
- // ...
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
- &outBuf.at(v * static_cast<size_t>(pixel_data_size) *
- static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- tinyexr::FP16 hf;
-
- // hf.u = line_ptr[u];
- tinyexr::cpy2(&(hf.u), line_ptr + u);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
-
- if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
- unsigned short *image =
- reinterpret_cast<unsigned short **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = hf.u;
- } else { // HALF -> FLOAT
- tinyexr::FP32 f32 = half_to_float(hf);
- float *image = reinterpret_cast<float **>(out_images)[c];
- size_t offset = 0;
- if (line_order == 0) {
- offset = (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- offset = (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- image += offset;
-
- *image = f32.f;
- }
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
-
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- unsigned int val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(&val);
-
- unsigned int *image =
- reinterpret_cast<unsigned int **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const float *line_ptr = reinterpret_cast<float *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- float val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- float *image = reinterpret_cast<float **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else {
- assert(0);
- return false;
- }
- }
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) {
- // Allocate original data size.
- std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
- static_cast<size_t>(num_lines) *
- pixel_data_size);
-
- unsigned long dstLen = static_cast<unsigned long>(outBuf.size());
- if (dstLen == 0) {
- return false;
- }
-
- if (!tinyexr::DecompressRle(
- reinterpret_cast<unsigned char *>(&outBuf.at(0)), dstLen, data_ptr,
- static_cast<unsigned long>(data_len))) {
- return false;
- }
-
- // For RLE_COMPRESSION:
- // pixel sample data for channel 0 for scanline 0
- // pixel sample data for channel 1 for scanline 0
- // pixel sample data for channel ... for scanline 0
- // pixel sample data for channel n for scanline 0
- // pixel sample data for channel 0 for scanline 1
- // pixel sample data for channel 1 for scanline 1
- // pixel sample data for channel ... for scanline 1
- // pixel sample data for channel n for scanline 1
- // ...
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
- &outBuf.at(v * static_cast<size_t>(pixel_data_size) *
- static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- tinyexr::FP16 hf;
-
- // hf.u = line_ptr[u];
- tinyexr::cpy2(&(hf.u), line_ptr + u);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
-
- if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
- unsigned short *image =
- reinterpret_cast<unsigned short **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = hf.u;
- } else { // HALF -> FLOAT
- tinyexr::FP32 f32 = half_to_float(hf);
- float *image = reinterpret_cast<float **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = f32.f;
- }
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_UINT);
-
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const unsigned int *line_ptr = reinterpret_cast<unsigned int *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- unsigned int val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(&val);
-
- unsigned int *image =
- reinterpret_cast<unsigned int **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const float *line_ptr = reinterpret_cast<float *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- float val;
- // val = line_ptr[u];
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- float *image = reinterpret_cast<float **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else {
- assert(0);
- return false;
- }
- }
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
-#if TINYEXR_USE_ZFP
- tinyexr::ZFPCompressionParam zfp_compression_param;
- std::string e;
- if (!tinyexr::FindZFPCompressionParam(&zfp_compression_param, attributes,
- int(num_attributes), &e)) {
- // This code path should not be reachable.
- assert(0);
- return false;
- }
-
- // Allocate original data size.
- std::vector<unsigned char> outBuf(static_cast<size_t>(width) *
- static_cast<size_t>(num_lines) *
- pixel_data_size);
-
- unsigned long dstLen = outBuf.size();
- assert(dstLen > 0);
- tinyexr::DecompressZfp(reinterpret_cast<float *>(&outBuf.at(0)), width,
- num_lines, num_channels, data_ptr,
- static_cast<unsigned long>(data_len),
- zfp_compression_param);
-
- // For ZFP_COMPRESSION:
- // pixel sample data for channel 0 for scanline 0
- // pixel sample data for channel 1 for scanline 0
- // pixel sample data for channel ... for scanline 0
- // pixel sample data for channel n for scanline 0
- // pixel sample data for channel 0 for scanline 1
- // pixel sample data for channel 1 for scanline 1
- // pixel sample data for channel ... for scanline 1
- // pixel sample data for channel n for scanline 1
- // ...
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- assert(channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT);
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- assert(requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT);
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- const float *line_ptr = reinterpret_cast<float *>(
- &outBuf.at(v * pixel_data_size * static_cast<size_t>(width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (size_t u = 0; u < static_cast<size_t>(width); u++) {
- float val;
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- float *image = reinterpret_cast<float **>(out_images)[c];
- if (line_order == 0) {
- image += (static_cast<size_t>(line_no) + v) *
- static_cast<size_t>(x_stride) +
- u;
- } else {
- image += (static_cast<size_t>(height) - 1U -
- (static_cast<size_t>(line_no) + v)) *
- static_cast<size_t>(x_stride) +
- u;
- }
- *image = val;
- }
- }
- } else {
- assert(0);
- return false;
- }
- }
-#else
- (void)attributes;
- (void)num_attributes;
- (void)num_channels;
- assert(0);
- return false;
-#endif
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_NONE) {
- for (size_t c = 0; c < num_channels; c++) {
- for (size_t v = 0; v < static_cast<size_t>(num_lines); v++) {
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- const unsigned short *line_ptr =
- reinterpret_cast<const unsigned short *>(
- data_ptr + v * pixel_data_size * size_t(width) +
- channel_offset_list[c] * static_cast<size_t>(width));
-
- if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
- unsigned short *outLine =
- reinterpret_cast<unsigned short *>(out_images[c]);
- if (line_order == 0) {
- outLine += (size_t(y) + v) * size_t(x_stride);
- } else {
- outLine +=
- (size_t(height) - 1 - (size_t(y) + v)) * size_t(x_stride);
- }
-
- for (int u = 0; u < width; u++) {
- tinyexr::FP16 hf;
-
- // hf.u = line_ptr[u];
- tinyexr::cpy2(&(hf.u), line_ptr + u);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
-
- outLine[u] = hf.u;
- }
- } else if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
- float *outLine = reinterpret_cast<float *>(out_images[c]);
- if (line_order == 0) {
- outLine += (size_t(y) + v) * size_t(x_stride);
- } else {
- outLine +=
- (size_t(height) - 1 - (size_t(y) + v)) * size_t(x_stride);
- }
-
- if (reinterpret_cast<const unsigned char *>(line_ptr + width) >
- (data_ptr + data_len)) {
- // Insufficient data size
- return false;
- }
-
- for (int u = 0; u < width; u++) {
- tinyexr::FP16 hf;
-
- // address may not be aliged. use byte-wise copy for safety.#76
- // hf.u = line_ptr[u];
- tinyexr::cpy2(&(hf.u), line_ptr + u);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&hf.u));
-
- tinyexr::FP32 f32 = half_to_float(hf);
-
- outLine[u] = f32.f;
- }
- } else {
- assert(0);
- return false;
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- const float *line_ptr = reinterpret_cast<const float *>(
- data_ptr + v * pixel_data_size * size_t(width) +
- channel_offset_list[c] * static_cast<size_t>(width));
-
- float *outLine = reinterpret_cast<float *>(out_images[c]);
- if (line_order == 0) {
- outLine += (size_t(y) + v) * size_t(x_stride);
- } else {
- outLine +=
- (size_t(height) - 1 - (size_t(y) + v)) * size_t(x_stride);
- }
-
- if (reinterpret_cast<const unsigned char *>(line_ptr + width) >
- (data_ptr + data_len)) {
- // Insufficient data size
- return false;
- }
-
- for (int u = 0; u < width; u++) {
- float val;
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- outLine[u] = val;
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- const unsigned int *line_ptr = reinterpret_cast<const unsigned int *>(
- data_ptr + v * pixel_data_size * size_t(width) +
- channel_offset_list[c] * static_cast<size_t>(width));
-
- unsigned int *outLine =
- reinterpret_cast<unsigned int *>(out_images[c]);
- if (line_order == 0) {
- outLine += (size_t(y) + v) * size_t(x_stride);
- } else {
- outLine +=
- (size_t(height) - 1 - (size_t(y) + v)) * size_t(x_stride);
- }
-
- for (int u = 0; u < width; u++) {
- if (reinterpret_cast<const unsigned char *>(line_ptr + u) >=
- (data_ptr + data_len)) {
- // Corrupsed data?
- return false;
- }
-
- unsigned int val;
- tinyexr::cpy4(&val, line_ptr + u);
-
- tinyexr::swap4(reinterpret_cast<unsigned int *>(&val));
-
- outLine[u] = val;
- }
- }
- }
- }
- }
-
- return true;
-}
-
-static bool DecodeTiledPixelData(
- unsigned char **out_images, int *width, int *height,
- const int *requested_pixel_types, const unsigned char *data_ptr,
- size_t data_len, int compression_type, int line_order, int data_width,
- int data_height, int tile_offset_x, int tile_offset_y, int tile_size_x,
- int tile_size_y, size_t pixel_data_size, size_t num_attributes,
- const EXRAttribute *attributes, size_t num_channels,
- const EXRChannelInfo *channels,
- const std::vector<size_t> &channel_offset_list) {
- // Here, data_width and data_height are the dimensions of the current (sub)level.
- if (tile_size_x * tile_offset_x > data_width ||
- tile_size_y * tile_offset_y > data_height) {
- return false;
- }
-
- // Compute actual image size in a tile.
- if ((tile_offset_x + 1) * tile_size_x >= data_width) {
- (*width) = data_width - (tile_offset_x * tile_size_x);
- } else {
- (*width) = tile_size_x;
- }
-
- if ((tile_offset_y + 1) * tile_size_y >= data_height) {
- (*height) = data_height - (tile_offset_y * tile_size_y);
- } else {
- (*height) = tile_size_y;
- }
-
- // Image size = tile size.
- return DecodePixelData(out_images, requested_pixel_types, data_ptr, data_len,
- compression_type, line_order, (*width), tile_size_y,
- /* stride */ tile_size_x, /* y */ 0, /* line_no */ 0,
- (*height), pixel_data_size, num_attributes, attributes,
- num_channels, channels, channel_offset_list);
-}
-
-static bool ComputeChannelLayout(std::vector<size_t> *channel_offset_list,
- int *pixel_data_size, size_t *channel_offset,
- int num_channels,
- const EXRChannelInfo *channels) {
- channel_offset_list->resize(static_cast<size_t>(num_channels));
-
- (*pixel_data_size) = 0;
- (*channel_offset) = 0;
-
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- (*channel_offset_list)[c] = (*channel_offset);
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- (*pixel_data_size) += sizeof(unsigned short);
- (*channel_offset) += sizeof(unsigned short);
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- (*pixel_data_size) += sizeof(float);
- (*channel_offset) += sizeof(float);
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- (*pixel_data_size) += sizeof(unsigned int);
- (*channel_offset) += sizeof(unsigned int);
- } else {
- // ???
- return false;
- }
- }
- return true;
-}
-
-static unsigned char **AllocateImage(int num_channels,
- const EXRChannelInfo *channels,
- const int *requested_pixel_types,
- int data_width, int data_height) {
- unsigned char **images =
- reinterpret_cast<unsigned char **>(static_cast<float **>(
- malloc(sizeof(float *) * static_cast<size_t>(num_channels))));
-
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- size_t data_len =
- static_cast<size_t>(data_width) * static_cast<size_t>(data_height);
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- // pixel_data_size += sizeof(unsigned short);
- // channel_offset += sizeof(unsigned short);
- // Alloc internal image for half type.
- if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_HALF) {
- images[c] =
- reinterpret_cast<unsigned char *>(static_cast<unsigned short *>(
- malloc(sizeof(unsigned short) * data_len)));
- } else if (requested_pixel_types[c] == TINYEXR_PIXELTYPE_FLOAT) {
- images[c] = reinterpret_cast<unsigned char *>(
- static_cast<float *>(malloc(sizeof(float) * data_len)));
- } else {
- assert(0);
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- // pixel_data_size += sizeof(float);
- // channel_offset += sizeof(float);
- images[c] = reinterpret_cast<unsigned char *>(
- static_cast<float *>(malloc(sizeof(float) * data_len)));
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- // pixel_data_size += sizeof(unsigned int);
- // channel_offset += sizeof(unsigned int);
- images[c] = reinterpret_cast<unsigned char *>(
- static_cast<unsigned int *>(malloc(sizeof(unsigned int) * data_len)));
- } else {
- assert(0);
- }
- }
-
- return images;
-}
-
-#ifdef _WIN32
-static inline std::wstring UTF8ToWchar(const std::string &str) {
- int wstr_size =
- MultiByteToWideChar(CP_UTF8, 0, str.data(), (int)str.size(), NULL, 0);
- std::wstring wstr(wstr_size, 0);
- MultiByteToWideChar(CP_UTF8, 0, str.data(), (int)str.size(), &wstr[0],
- (int)wstr.size());
- return wstr;
-}
-#endif
-
-
-static int ParseEXRHeader(HeaderInfo *info, bool *empty_header,
- const EXRVersion *version, std::string *err,
- const unsigned char *buf, size_t size) {
- const char *marker = reinterpret_cast<const char *>(&buf[0]);
-
- if (empty_header) {
- (*empty_header) = false;
- }
-
- if (version->multipart) {
- if (size > 0 && marker[0] == '\0') {
- // End of header list.
- if (empty_header) {
- (*empty_header) = true;
- }
- return TINYEXR_SUCCESS;
- }
- }
-
- // According to the spec, the header of every OpenEXR file must contain at
- // least the following attributes:
- //
- // channels chlist
- // compression compression
- // dataWindow box2i
- // displayWindow box2i
- // lineOrder lineOrder
- // pixelAspectRatio float
- // screenWindowCenter v2f
- // screenWindowWidth float
- bool has_channels = false;
- bool has_compression = false;
- bool has_data_window = false;
- bool has_display_window = false;
- bool has_line_order = false;
- bool has_pixel_aspect_ratio = false;
- bool has_screen_window_center = false;
- bool has_screen_window_width = false;
- bool has_name = false;
- bool has_type = false;
-
- info->name.clear();
- info->type.clear();
-
- info->data_window.min_x = 0;
- info->data_window.min_y = 0;
- info->data_window.max_x = 0;
- info->data_window.max_y = 0;
- info->line_order = 0; // @fixme
- info->display_window.min_x = 0;
- info->display_window.min_y = 0;
- info->display_window.max_x = 0;
- info->display_window.max_y = 0;
- info->screen_window_center[0] = 0.0f;
- info->screen_window_center[1] = 0.0f;
- info->screen_window_width = -1.0f;
- info->pixel_aspect_ratio = -1.0f;
-
- info->tiled = 0;
- info->tile_size_x = -1;
- info->tile_size_y = -1;
- info->tile_level_mode = -1;
- info->tile_rounding_mode = -1;
-
- info->attributes.clear();
-
- // Read attributes
- size_t orig_size = size;
- for (size_t nattr = 0; nattr < TINYEXR_MAX_HEADER_ATTRIBUTES; nattr++) {
- if (0 == size) {
- if (err) {
- (*err) += "Insufficient data size for attributes.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- } else if (marker[0] == '\0') {
- size--;
- break;
- }
-
- std::string attr_name;
- std::string attr_type;
- std::vector<unsigned char> data;
- size_t marker_size;
- if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size,
- marker, size)) {
- if (err) {
- (*err) += "Failed to read attribute.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
- marker += marker_size;
- size -= marker_size;
-
- // For a multipart file, the version field 9th bit is 0.
- if ((version->tiled || version->multipart || version->non_image) && attr_name.compare("tiles") == 0) {
- unsigned int x_size, y_size;
- unsigned char tile_mode;
- assert(data.size() == 9);
- memcpy(&x_size, &data.at(0), sizeof(int));
- memcpy(&y_size, &data.at(4), sizeof(int));
- tile_mode = data[8];
- tinyexr::swap4(&x_size);
- tinyexr::swap4(&y_size);
-
- if (x_size > static_cast<unsigned int>(std::numeric_limits<int>::max()) ||
- y_size > static_cast<unsigned int>(std::numeric_limits<int>::max())) {
- if (err) {
- (*err) = "Tile sizes were invalid.";
- }
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
- }
-
- info->tile_size_x = static_cast<int>(x_size);
- info->tile_size_y = static_cast<int>(y_size);
-
- // mode = levelMode + roundingMode * 16
- info->tile_level_mode = tile_mode & 0x3;
- info->tile_rounding_mode = (tile_mode >> 4) & 0x1;
- info->tiled = 1;
- } else if (attr_name.compare("compression") == 0) {
- bool ok = false;
- if (data[0] < TINYEXR_COMPRESSIONTYPE_PIZ) {
- ok = true;
- }
-
- if (data[0] == TINYEXR_COMPRESSIONTYPE_PIZ) {
-#if TINYEXR_USE_PIZ
- ok = true;
-#else
- if (err) {
- (*err) = "PIZ compression is not supported.";
- }
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
-#endif
- }
-
- if (data[0] == TINYEXR_COMPRESSIONTYPE_ZFP) {
-#if TINYEXR_USE_ZFP
- ok = true;
-#else
- if (err) {
- (*err) = "ZFP compression is not supported.";
- }
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
-#endif
- }
-
- if (!ok) {
- if (err) {
- (*err) = "Unknown compression type.";
- }
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
- }
-
- info->compression_type = static_cast<int>(data[0]);
- has_compression = true;
-
- } else if (attr_name.compare("channels") == 0) {
- // name: zero-terminated string, from 1 to 255 bytes long
- // pixel type: int, possible values are: UINT = 0 HALF = 1 FLOAT = 2
- // pLinear: unsigned char, possible values are 0 and 1
- // reserved: three chars, should be zero
- // xSampling: int
- // ySampling: int
-
- if (!ReadChannelInfo(info->channels, data)) {
- if (err) {
- (*err) += "Failed to parse channel info.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- if (info->channels.size() < 1) {
- if (err) {
- (*err) += "# of channels is zero.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- has_channels = true;
-
- } else if (attr_name.compare("dataWindow") == 0) {
- if (data.size() >= 16) {
- memcpy(&info->data_window.min_x, &data.at(0), sizeof(int));
- memcpy(&info->data_window.min_y, &data.at(4), sizeof(int));
- memcpy(&info->data_window.max_x, &data.at(8), sizeof(int));
- memcpy(&info->data_window.max_y, &data.at(12), sizeof(int));
- tinyexr::swap4(&info->data_window.min_x);
- tinyexr::swap4(&info->data_window.min_y);
- tinyexr::swap4(&info->data_window.max_x);
- tinyexr::swap4(&info->data_window.max_y);
- has_data_window = true;
- }
- } else if (attr_name.compare("displayWindow") == 0) {
- if (data.size() >= 16) {
- memcpy(&info->display_window.min_x, &data.at(0), sizeof(int));
- memcpy(&info->display_window.min_y, &data.at(4), sizeof(int));
- memcpy(&info->display_window.max_x, &data.at(8), sizeof(int));
- memcpy(&info->display_window.max_y, &data.at(12), sizeof(int));
- tinyexr::swap4(&info->display_window.min_x);
- tinyexr::swap4(&info->display_window.min_y);
- tinyexr::swap4(&info->display_window.max_x);
- tinyexr::swap4(&info->display_window.max_y);
-
- has_display_window = true;
- }
- } else if (attr_name.compare("lineOrder") == 0) {
- if (data.size() >= 1) {
- info->line_order = static_cast<int>(data[0]);
- has_line_order = true;
- }
- } else if (attr_name.compare("pixelAspectRatio") == 0) {
- if (data.size() >= sizeof(float)) {
- memcpy(&info->pixel_aspect_ratio, &data.at(0), sizeof(float));
- tinyexr::swap4(&info->pixel_aspect_ratio);
- has_pixel_aspect_ratio = true;
- }
- } else if (attr_name.compare("screenWindowCenter") == 0) {
- if (data.size() >= 8) {
- memcpy(&info->screen_window_center[0], &data.at(0), sizeof(float));
- memcpy(&info->screen_window_center[1], &data.at(4), sizeof(float));
- tinyexr::swap4(&info->screen_window_center[0]);
- tinyexr::swap4(&info->screen_window_center[1]);
- has_screen_window_center = true;
- }
- } else if (attr_name.compare("screenWindowWidth") == 0) {
- if (data.size() >= sizeof(float)) {
- memcpy(&info->screen_window_width, &data.at(0), sizeof(float));
- tinyexr::swap4(&info->screen_window_width);
-
- has_screen_window_width = true;
- }
- } else if (attr_name.compare("chunkCount") == 0) {
- if (data.size() >= sizeof(int)) {
- memcpy(&info->chunk_count, &data.at(0), sizeof(int));
- tinyexr::swap4(&info->chunk_count);
- }
- } else if (attr_name.compare("name") == 0) {
- if (!data.empty() && data[0]) {
- data.push_back(0);
- size_t len = strlen(reinterpret_cast<const char*>(&data[0]));
- info->name.resize(len);
- info->name.assign(reinterpret_cast<const char*>(&data[0]), len);
- has_name = true;
- }
- } else if (attr_name.compare("type") == 0) {
- if (!data.empty() && data[0]) {
- data.push_back(0);
- size_t len = strlen(reinterpret_cast<const char*>(&data[0]));
- info->type.resize(len);
- info->type.assign(reinterpret_cast<const char*>(&data[0]), len);
- has_type = true;
- }
- } else {
- // Custom attribute(up to TINYEXR_MAX_CUSTOM_ATTRIBUTES)
- if (info->attributes.size() < TINYEXR_MAX_CUSTOM_ATTRIBUTES) {
- EXRAttribute attrib;
-#ifdef _MSC_VER
- strncpy_s(attrib.name, attr_name.c_str(), 255);
- strncpy_s(attrib.type, attr_type.c_str(), 255);
-#else
- strncpy(attrib.name, attr_name.c_str(), 255);
- strncpy(attrib.type, attr_type.c_str(), 255);
-#endif
- attrib.name[255] = '\0';
- attrib.type[255] = '\0';
- attrib.size = static_cast<int>(data.size());
- attrib.value = static_cast<unsigned char *>(malloc(data.size()));
- memcpy(reinterpret_cast<char *>(attrib.value), &data.at(0),
- data.size());
- info->attributes.push_back(attrib);
- }
- }
- }
-
- // Check if required attributes exist
- {
- std::stringstream ss_err;
-
- if (!has_compression) {
- ss_err << "\"compression\" attribute not found in the header."
- << std::endl;
- }
-
- if (!has_channels) {
- ss_err << "\"channels\" attribute not found in the header." << std::endl;
- }
-
- if (!has_line_order) {
- ss_err << "\"lineOrder\" attribute not found in the header." << std::endl;
- }
-
- if (!has_display_window) {
- ss_err << "\"displayWindow\" attribute not found in the header."
- << std::endl;
- }
-
- if (!has_data_window) {
- ss_err << "\"dataWindow\" attribute not found in the header or invalid."
- << std::endl;
- }
-
- if (!has_pixel_aspect_ratio) {
- ss_err << "\"pixelAspectRatio\" attribute not found in the header."
- << std::endl;
- }
-
- if (!has_screen_window_width) {
- ss_err << "\"screenWindowWidth\" attribute not found in the header."
- << std::endl;
- }
-
- if (!has_screen_window_center) {
- ss_err << "\"screenWindowCenter\" attribute not found in the header."
- << std::endl;
- }
-
- if (version->multipart || version->non_image) {
- if (!has_name) {
- ss_err << "\"name\" attribute not found in the header."
- << std::endl;
- }
- if (!has_type) {
- ss_err << "\"type\" attribute not found in the header."
- << std::endl;
- }
- }
-
- if (!(ss_err.str().empty())) {
- if (err) {
- (*err) += ss_err.str();
- }
- return TINYEXR_ERROR_INVALID_HEADER;
- }
- }
-
- info->header_len = static_cast<unsigned int>(orig_size - size);
-
- return TINYEXR_SUCCESS;
-}
-
-// C++ HeaderInfo to C EXRHeader conversion.
-static void ConvertHeader(EXRHeader *exr_header, const HeaderInfo &info) {
- exr_header->pixel_aspect_ratio = info.pixel_aspect_ratio;
- exr_header->screen_window_center[0] = info.screen_window_center[0];
- exr_header->screen_window_center[1] = info.screen_window_center[1];
- exr_header->screen_window_width = info.screen_window_width;
- exr_header->chunk_count = info.chunk_count;
- exr_header->display_window.min_x = info.display_window.min_x;
- exr_header->display_window.min_y = info.display_window.min_y;
- exr_header->display_window.max_x = info.display_window.max_x;
- exr_header->display_window.max_y = info.display_window.max_y;
- exr_header->data_window.min_x = info.data_window.min_x;
- exr_header->data_window.min_y = info.data_window.min_y;
- exr_header->data_window.max_x = info.data_window.max_x;
- exr_header->data_window.max_y = info.data_window.max_y;
- exr_header->line_order = info.line_order;
- exr_header->compression_type = info.compression_type;
- exr_header->tiled = info.tiled;
- exr_header->tile_size_x = info.tile_size_x;
- exr_header->tile_size_y = info.tile_size_y;
- exr_header->tile_level_mode = info.tile_level_mode;
- exr_header->tile_rounding_mode = info.tile_rounding_mode;
-
- EXRSetNameAttr(exr_header, info.name.c_str());
-
- if (!info.type.empty()) {
- if (info.type == "scanlineimage") {
- assert(!exr_header->tiled);
- } else if (info.type == "tiledimage") {
- assert(exr_header->tiled);
- } else if (info.type == "deeptile") {
- exr_header->non_image = 1;
- assert(exr_header->tiled);
- } else if (info.type == "deepscanline") {
- exr_header->non_image = 1;
- assert(!exr_header->tiled);
- } else {
- assert(false);
- }
- }
-
- exr_header->num_channels = static_cast<int>(info.channels.size());
-
- exr_header->channels = static_cast<EXRChannelInfo *>(malloc(
- sizeof(EXRChannelInfo) * static_cast<size_t>(exr_header->num_channels)));
- for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
-#ifdef _MSC_VER
- strncpy_s(exr_header->channels[c].name, info.channels[c].name.c_str(), 255);
-#else
- strncpy(exr_header->channels[c].name, info.channels[c].name.c_str(), 255);
-#endif
- // manually add '\0' for safety.
- exr_header->channels[c].name[255] = '\0';
-
- exr_header->channels[c].pixel_type = info.channels[c].pixel_type;
- exr_header->channels[c].p_linear = info.channels[c].p_linear;
- exr_header->channels[c].x_sampling = info.channels[c].x_sampling;
- exr_header->channels[c].y_sampling = info.channels[c].y_sampling;
- }
-
- exr_header->pixel_types = static_cast<int *>(
- malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
- for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
- exr_header->pixel_types[c] = info.channels[c].pixel_type;
- }
-
- // Initially fill with values of `pixel_types`
- exr_header->requested_pixel_types = static_cast<int *>(
- malloc(sizeof(int) * static_cast<size_t>(exr_header->num_channels)));
- for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
- exr_header->requested_pixel_types[c] = info.channels[c].pixel_type;
- }
-
- exr_header->num_custom_attributes = static_cast<int>(info.attributes.size());
-
- if (exr_header->num_custom_attributes > 0) {
- // TODO(syoyo): Report warning when # of attributes exceeds
- // `TINYEXR_MAX_CUSTOM_ATTRIBUTES`
- if (exr_header->num_custom_attributes > TINYEXR_MAX_CUSTOM_ATTRIBUTES) {
- exr_header->num_custom_attributes = TINYEXR_MAX_CUSTOM_ATTRIBUTES;
- }
-
- exr_header->custom_attributes = static_cast<EXRAttribute *>(malloc(
- sizeof(EXRAttribute) * size_t(exr_header->num_custom_attributes)));
-
- for (size_t i = 0; i < info.attributes.size(); i++) {
- memcpy(exr_header->custom_attributes[i].name, info.attributes[i].name,
- 256);
- memcpy(exr_header->custom_attributes[i].type, info.attributes[i].type,
- 256);
- exr_header->custom_attributes[i].size = info.attributes[i].size;
- // Just copy pointer
- exr_header->custom_attributes[i].value = info.attributes[i].value;
- }
-
- } else {
- exr_header->custom_attributes = NULL;
- }
-
- exr_header->header_len = info.header_len;
-}
-
-struct OffsetData {
- OffsetData() : num_x_levels(0), num_y_levels(0) {}
- std::vector<std::vector<std::vector <tinyexr::tinyexr_uint64> > > offsets;
- int num_x_levels;
- int num_y_levels;
-};
-
-int LevelIndex(int lx, int ly, int tile_level_mode, int num_x_levels) {
- switch (tile_level_mode) {
- case TINYEXR_TILE_ONE_LEVEL:
- return 0;
-
- case TINYEXR_TILE_MIPMAP_LEVELS:
- return lx;
-
- case TINYEXR_TILE_RIPMAP_LEVELS:
- return lx + ly * num_x_levels;
-
- default:
- assert(false);
- }
- return 0;
-}
-
-static int LevelSize(int toplevel_size, int level, int tile_rounding_mode) {
- assert(level >= 0);
-
- int b = (int)(1u << (unsigned)level);
- int level_size = toplevel_size / b;
-
- if (tile_rounding_mode == TINYEXR_TILE_ROUND_UP && level_size * b < toplevel_size)
- level_size += 1;
-
- return std::max(level_size, 1);
-}
-
-static int DecodeTiledLevel(EXRImage* exr_image, const EXRHeader* exr_header,
- const OffsetData& offset_data,
- const std::vector<size_t>& channel_offset_list,
- int pixel_data_size,
- const unsigned char* head, const size_t size,
- std::string* err) {
- int num_channels = exr_header->num_channels;
-
- int level_index = LevelIndex(exr_image->level_x, exr_image->level_y, exr_header->tile_level_mode, offset_data.num_x_levels);
- int num_y_tiles = (int)offset_data.offsets[level_index].size();
- assert(num_y_tiles);
- int num_x_tiles = (int)offset_data.offsets[level_index][0].size();
- assert(num_x_tiles);
- int num_tiles = num_x_tiles * num_y_tiles;
-
- int err_code = TINYEXR_SUCCESS;
-
- enum {
- EF_SUCCESS = 0,
- EF_INVALID_DATA = 1,
- EF_INSUFFICIENT_DATA = 2,
- EF_FAILED_TO_DECODE = 4
- };
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::atomic<unsigned> error_flag(EF_SUCCESS);
-#else
- unsigned error_flag(EF_SUCCESS);
-#endif
-
- // Although the spec says : "...the data window is subdivided into an array of smaller rectangles...",
- // the IlmImf library allows the dimensions of the tile to be larger (or equal) than the dimensions of the data window.
-#if 0
- if ((exr_header->tile_size_x > exr_image->width || exr_header->tile_size_y > exr_image->height) &&
- exr_image->level_x == 0 && exr_image->level_y == 0) {
- if (err) {
- (*err) += "Failed to decode tile data.\n";
- }
- err_code = TINYEXR_ERROR_INVALID_DATA;
- }
-#endif
- exr_image->tiles = static_cast<EXRTile*>(
- calloc(sizeof(EXRTile), static_cast<size_t>(num_tiles)));
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::vector<std::thread> workers;
- std::atomic<int> tile_count(0);
-
- int num_threads = std::max(1, int(std::thread::hardware_concurrency()));
- if (num_threads > int(num_tiles)) {
- num_threads = int(num_tiles);
- }
-
- for (int t = 0; t < num_threads; t++) {
- workers.emplace_back(std::thread([&]()
- {
- int tile_idx = 0;
- while ((tile_idx = tile_count++) < num_tiles) {
-
-#else
-#if TINYEXR_USE_OPENMP
-#pragma omp parallel for
-#endif
- for (int tile_idx = 0; tile_idx < num_tiles; tile_idx++) {
-#endif
- // Allocate memory for each tile.
- exr_image->tiles[tile_idx].images = tinyexr::AllocateImage(
- num_channels, exr_header->channels,
- exr_header->requested_pixel_types, exr_header->tile_size_x,
- exr_header->tile_size_y);
-
- int x_tile = tile_idx % num_x_tiles;
- int y_tile = tile_idx / num_x_tiles;
- // 16 byte: tile coordinates
- // 4 byte : data size
- // ~ : data(uncompressed or compressed)
- tinyexr::tinyexr_uint64 offset = offset_data.offsets[level_index][y_tile][x_tile];
- if (offset + sizeof(int) * 5 > size) {
- // Insufficient data size.
- error_flag |= EF_INSUFFICIENT_DATA;
- continue;
- }
-
- size_t data_size =
- size_t(size - (offset + sizeof(int) * 5));
- const unsigned char* data_ptr =
- reinterpret_cast<const unsigned char*>(head + offset);
-
- int tile_coordinates[4];
- memcpy(tile_coordinates, data_ptr, sizeof(int) * 4);
- tinyexr::swap4(&tile_coordinates[0]);
- tinyexr::swap4(&tile_coordinates[1]);
- tinyexr::swap4(&tile_coordinates[2]);
- tinyexr::swap4(&tile_coordinates[3]);
-
- if (tile_coordinates[2] != exr_image->level_x) {
- // Invalid data.
- error_flag |= EF_INVALID_DATA;
- continue;
- }
- if (tile_coordinates[3] != exr_image->level_y) {
- // Invalid data.
- error_flag |= EF_INVALID_DATA;
- continue;
- }
-
- int data_len;
- memcpy(&data_len, data_ptr + 16,
- sizeof(int)); // 16 = sizeof(tile_coordinates)
- tinyexr::swap4(&data_len);
-
- if (data_len < 2 || size_t(data_len) > data_size) {
- // Insufficient data size.
- error_flag |= EF_INSUFFICIENT_DATA;
- continue;
- }
-
- // Move to data addr: 20 = 16 + 4;
- data_ptr += 20;
- bool ret = tinyexr::DecodeTiledPixelData(
- exr_image->tiles[tile_idx].images,
- &(exr_image->tiles[tile_idx].width),
- &(exr_image->tiles[tile_idx].height),
- exr_header->requested_pixel_types, data_ptr,
- static_cast<size_t>(data_len), exr_header->compression_type,
- exr_header->line_order,
- exr_image->width, exr_image->height,
- tile_coordinates[0], tile_coordinates[1], exr_header->tile_size_x,
- exr_header->tile_size_y, static_cast<size_t>(pixel_data_size),
- static_cast<size_t>(exr_header->num_custom_attributes),
- exr_header->custom_attributes,
- static_cast<size_t>(exr_header->num_channels),
- exr_header->channels, channel_offset_list);
-
- if (!ret) {
- // Failed to decode tile data.
- error_flag |= EF_FAILED_TO_DECODE;
- }
-
- exr_image->tiles[tile_idx].offset_x = tile_coordinates[0];
- exr_image->tiles[tile_idx].offset_y = tile_coordinates[1];
- exr_image->tiles[tile_idx].level_x = tile_coordinates[2];
- exr_image->tiles[tile_idx].level_y = tile_coordinates[3];
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- }
- }));
- } // num_thread loop
-
- for (auto& t : workers) {
- t.join();
- }
-
-#else
- } // parallel for
-#endif
-
- // Even in the event of an error, the reserved memory may be freed.
- exr_image->num_channels = num_channels;
- exr_image->num_tiles = static_cast<int>(num_tiles);
-
- if (error_flag) err_code = TINYEXR_ERROR_INVALID_DATA;
- if (err) {
- if (error_flag & EF_INSUFFICIENT_DATA) {
- (*err) += "Insufficient data length.\n";
- }
- if (error_flag & EF_FAILED_TO_DECODE) {
- (*err) += "Failed to decode tile data.\n";
- }
- }
- return err_code;
-}
-
-static int DecodeChunk(EXRImage *exr_image, const EXRHeader *exr_header,
- const OffsetData& offset_data,
- const unsigned char *head, const size_t size,
- std::string *err) {
- int num_channels = exr_header->num_channels;
-
- int num_scanline_blocks = 1;
- if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
- num_scanline_blocks = 16;
- } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
- num_scanline_blocks = 32;
- } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
- num_scanline_blocks = 16;
-
-#if TINYEXR_USE_ZFP
- tinyexr::ZFPCompressionParam zfp_compression_param;
- if (!FindZFPCompressionParam(&zfp_compression_param,
- exr_header->custom_attributes,
- int(exr_header->num_custom_attributes), err)) {
- return TINYEXR_ERROR_INVALID_HEADER;
- }
-#endif
- }
-
- if (exr_header->data_window.max_x < exr_header->data_window.min_x ||
- exr_header->data_window.max_y < exr_header->data_window.min_y) {
- if (err) {
- (*err) += "Invalid data window.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- int data_width =
- exr_header->data_window.max_x - exr_header->data_window.min_x + 1;
- int data_height =
- exr_header->data_window.max_y - exr_header->data_window.min_y + 1;
-
- // Do not allow too large data_width and data_height. header invalid?
- {
- if ((data_width > TINYEXR_DIMENSION_THRESHOLD) || (data_height > TINYEXR_DIMENSION_THRESHOLD)) {
- if (err) {
- std::stringstream ss;
- ss << "data_with or data_height too large. data_width: " << data_width
- << ", "
- << "data_height = " << data_height << std::endl;
- (*err) += ss.str();
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
- if (exr_header->tiled) {
- if ((exr_header->tile_size_x > TINYEXR_DIMENSION_THRESHOLD) || (exr_header->tile_size_y > TINYEXR_DIMENSION_THRESHOLD)) {
- if (err) {
- std::stringstream ss;
- ss << "tile with or tile height too large. tile width: " << exr_header->tile_size_x
- << ", "
- << "tile height = " << exr_header->tile_size_y << std::endl;
- (*err) += ss.str();
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
- }
-
- const std::vector<tinyexr::tinyexr_uint64>& offsets = offset_data.offsets[0][0];
- size_t num_blocks = offsets.size();
-
- std::vector<size_t> channel_offset_list;
- int pixel_data_size = 0;
- size_t channel_offset = 0;
- if (!tinyexr::ComputeChannelLayout(&channel_offset_list, &pixel_data_size,
- &channel_offset, num_channels,
- exr_header->channels)) {
- if (err) {
- (*err) += "Failed to compute channel layout.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::atomic<bool> invalid_data(false);
-#else
- bool invalid_data(false);
-#endif
-
- if (exr_header->tiled) {
- // value check
- if (exr_header->tile_size_x < 0) {
- if (err) {
- std::stringstream ss;
- ss << "Invalid tile size x : " << exr_header->tile_size_x << "\n";
- (*err) += ss.str();
- }
- return TINYEXR_ERROR_INVALID_HEADER;
- }
-
- if (exr_header->tile_size_y < 0) {
- if (err) {
- std::stringstream ss;
- ss << "Invalid tile size y : " << exr_header->tile_size_y << "\n";
- (*err) += ss.str();
- }
- return TINYEXR_ERROR_INVALID_HEADER;
- }
- if (exr_header->tile_level_mode != TINYEXR_TILE_RIPMAP_LEVELS) {
- EXRImage* level_image = NULL;
- for (int level = 0; level < offset_data.num_x_levels; ++level) {
- if (!level_image) {
- level_image = exr_image;
- } else {
- level_image->next_level = new EXRImage;
- InitEXRImage(level_image->next_level);
- level_image = level_image->next_level;
- }
- level_image->width =
- LevelSize(exr_header->data_window.max_x - exr_header->data_window.min_x + 1, level, exr_header->tile_rounding_mode);
- level_image->height =
- LevelSize(exr_header->data_window.max_y - exr_header->data_window.min_y + 1, level, exr_header->tile_rounding_mode);
- level_image->level_x = level;
- level_image->level_y = level;
-
- int ret = DecodeTiledLevel(level_image, exr_header,
- offset_data,
- channel_offset_list,
- pixel_data_size,
- head, size,
- err);
- if (ret != TINYEXR_SUCCESS) return ret;
- }
- } else {
- EXRImage* level_image = NULL;
- for (int level_y = 0; level_y < offset_data.num_y_levels; ++level_y)
- for (int level_x = 0; level_x < offset_data.num_x_levels; ++level_x) {
- if (!level_image) {
- level_image = exr_image;
- } else {
- level_image->next_level = new EXRImage;
- InitEXRImage(level_image->next_level);
- level_image = level_image->next_level;
- }
-
- level_image->width =
- LevelSize(exr_header->data_window.max_x - exr_header->data_window.min_x + 1, level_x, exr_header->tile_rounding_mode);
- level_image->height =
- LevelSize(exr_header->data_window.max_y - exr_header->data_window.min_y + 1, level_y, exr_header->tile_rounding_mode);
- level_image->level_x = level_x;
- level_image->level_y = level_y;
-
- int ret = DecodeTiledLevel(level_image, exr_header,
- offset_data,
- channel_offset_list,
- pixel_data_size,
- head, size,
- err);
- if (ret != TINYEXR_SUCCESS) return ret;
- }
- }
- } else { // scanline format
- // Don't allow too large image(256GB * pixel_data_size or more). Workaround
- // for #104.
- size_t total_data_len =
- size_t(data_width) * size_t(data_height) * size_t(num_channels);
- const bool total_data_len_overflown =
- sizeof(void *) == 8 ? (total_data_len >= 0x4000000000) : false;
- if ((total_data_len == 0) || total_data_len_overflown) {
- if (err) {
- std::stringstream ss;
- ss << "Image data size is zero or too large: width = " << data_width
- << ", height = " << data_height << ", channels = " << num_channels
- << std::endl;
- (*err) += ss.str();
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- exr_image->images = tinyexr::AllocateImage(
- num_channels, exr_header->channels, exr_header->requested_pixel_types,
- data_width, data_height);
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::vector<std::thread> workers;
- std::atomic<int> y_count(0);
-
- int num_threads = std::max(1, int(std::thread::hardware_concurrency()));
- if (num_threads > int(num_blocks)) {
- num_threads = int(num_blocks);
- }
-
- for (int t = 0; t < num_threads; t++) {
- workers.emplace_back(std::thread([&]() {
- int y = 0;
- while ((y = y_count++) < int(num_blocks)) {
-
-#else
-
-#if TINYEXR_USE_OPENMP
-#pragma omp parallel for
-#endif
- for (int y = 0; y < static_cast<int>(num_blocks); y++) {
-
-#endif
- size_t y_idx = static_cast<size_t>(y);
-
- if (offsets[y_idx] + sizeof(int) * 2 > size) {
- invalid_data = true;
- } else {
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(uncompressed or compressed)
- size_t data_size =
- size_t(size - (offsets[y_idx] + sizeof(int) * 2));
- const unsigned char *data_ptr =
- reinterpret_cast<const unsigned char *>(head + offsets[y_idx]);
-
- int line_no;
- memcpy(&line_no, data_ptr, sizeof(int));
- int data_len;
- memcpy(&data_len, data_ptr + 4, sizeof(int));
- tinyexr::swap4(&line_no);
- tinyexr::swap4(&data_len);
-
- if (size_t(data_len) > data_size) {
- invalid_data = true;
-
- } else if ((line_no > (2 << 20)) || (line_no < -(2 << 20))) {
- // Too large value. Assume this is invalid
- // 2**20 = 1048576 = heuristic value.
- invalid_data = true;
- } else if (data_len == 0) {
- // TODO(syoyo): May be ok to raise the threshold for example
- // `data_len < 4`
- invalid_data = true;
- } else {
- // line_no may be negative.
- int end_line_no = (std::min)(line_no + num_scanline_blocks,
- (exr_header->data_window.max_y + 1));
-
- int num_lines = end_line_no - line_no;
-
- if (num_lines <= 0) {
- invalid_data = true;
- } else {
- // Move to data addr: 8 = 4 + 4;
- data_ptr += 8;
-
- // Adjust line_no with data_window.bmin.y
-
- // overflow check
- tinyexr_int64 lno =
- static_cast<tinyexr_int64>(line_no) -
- static_cast<tinyexr_int64>(exr_header->data_window.min_y);
- if (lno > std::numeric_limits<int>::max()) {
- line_no = -1; // invalid
- } else if (lno < -std::numeric_limits<int>::max()) {
- line_no = -1; // invalid
- } else {
- line_no -= exr_header->data_window.min_y;
- }
-
- if (line_no < 0) {
- invalid_data = true;
- } else {
- if (!tinyexr::DecodePixelData(
- exr_image->images, exr_header->requested_pixel_types,
- data_ptr, static_cast<size_t>(data_len),
- exr_header->compression_type, exr_header->line_order,
- data_width, data_height, data_width, y, line_no,
- num_lines, static_cast<size_t>(pixel_data_size),
- static_cast<size_t>(
- exr_header->num_custom_attributes),
- exr_header->custom_attributes,
- static_cast<size_t>(exr_header->num_channels),
- exr_header->channels, channel_offset_list)) {
- invalid_data = true;
- }
- }
- }
- }
- }
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- }
- }));
- }
-
- for (auto &t : workers) {
- t.join();
- }
-#else
- } // omp parallel
-#endif
- }
-
- if (invalid_data) {
- if (err) {
- (*err) += "Invalid data found when decoding pixels.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- // Overwrite `pixel_type` with `requested_pixel_type`.
- {
- for (int c = 0; c < exr_header->num_channels; c++) {
- exr_header->pixel_types[c] = exr_header->requested_pixel_types[c];
- }
- }
-
- {
- exr_image->num_channels = num_channels;
-
- exr_image->width = data_width;
- exr_image->height = data_height;
- }
-
- return TINYEXR_SUCCESS;
-}
-
-static bool ReconstructLineOffsets(
- std::vector<tinyexr::tinyexr_uint64> *offsets, size_t n,
- const unsigned char *head, const unsigned char *marker, const size_t size) {
- assert(head < marker);
- assert(offsets->size() == n);
-
- for (size_t i = 0; i < n; i++) {
- size_t offset = static_cast<size_t>(marker - head);
- // Offset should not exceed whole EXR file/data size.
- if ((offset + sizeof(tinyexr::tinyexr_uint64)) >= size) {
- return false;
- }
-
- int y;
- unsigned int data_len;
-
- memcpy(&y, marker, sizeof(int));
- memcpy(&data_len, marker + 4, sizeof(unsigned int));
-
- if (data_len >= size) {
- return false;
- }
-
- tinyexr::swap4(&y);
- tinyexr::swap4(&data_len);
-
- (*offsets)[i] = offset;
-
- marker += data_len + 8; // 8 = 4 bytes(y) + 4 bytes(data_len)
- }
-
- return true;
-}
-
-
-static int FloorLog2(unsigned x) {
- //
- // For x > 0, floorLog2(y) returns floor(log(x)/log(2)).
- //
- int y = 0;
- while (x > 1) {
- y += 1;
- x >>= 1u;
- }
- return y;
-}
-
-
-static int CeilLog2(unsigned x) {
- //
- // For x > 0, ceilLog2(y) returns ceil(log(x)/log(2)).
- //
- int y = 0;
- int r = 0;
- while (x > 1) {
- if (x & 1)
- r = 1;
-
- y += 1;
- x >>= 1u;
- }
- return y + r;
-}
-
-static int RoundLog2(int x, int tile_rounding_mode) {
- return (tile_rounding_mode == TINYEXR_TILE_ROUND_DOWN) ? FloorLog2(static_cast<unsigned>(x)) : CeilLog2(static_cast<unsigned>(x));
-}
-
-static int CalculateNumXLevels(const EXRHeader* exr_header) {
- int min_x = exr_header->data_window.min_x;
- int max_x = exr_header->data_window.max_x;
- int min_y = exr_header->data_window.min_y;
- int max_y = exr_header->data_window.max_y;
-
- int num = 0;
- switch (exr_header->tile_level_mode) {
- case TINYEXR_TILE_ONE_LEVEL:
-
- num = 1;
- break;
-
- case TINYEXR_TILE_MIPMAP_LEVELS:
-
- {
- int w = max_x - min_x + 1;
- int h = max_y - min_y + 1;
- num = RoundLog2(std::max(w, h), exr_header->tile_rounding_mode) + 1;
- }
- break;
-
- case TINYEXR_TILE_RIPMAP_LEVELS:
-
- {
- int w = max_x - min_x + 1;
- num = RoundLog2(w, exr_header->tile_rounding_mode) + 1;
- }
- break;
-
- default:
-
- assert(false);
- }
-
- return num;
-}
-
-static int CalculateNumYLevels(const EXRHeader* exr_header) {
- int min_x = exr_header->data_window.min_x;
- int max_x = exr_header->data_window.max_x;
- int min_y = exr_header->data_window.min_y;
- int max_y = exr_header->data_window.max_y;
- int num = 0;
-
- switch (exr_header->tile_level_mode) {
- case TINYEXR_TILE_ONE_LEVEL:
-
- num = 1;
- break;
-
- case TINYEXR_TILE_MIPMAP_LEVELS:
-
- {
- int w = max_x - min_x + 1;
- int h = max_y - min_y + 1;
- num = RoundLog2(std::max(w, h), exr_header->tile_rounding_mode) + 1;
- }
- break;
-
- case TINYEXR_TILE_RIPMAP_LEVELS:
-
- {
- int h = max_y - min_y + 1;
- num = RoundLog2(h, exr_header->tile_rounding_mode) + 1;
- }
- break;
-
- default:
-
- assert(false);
- }
-
- return num;
-}
-
-static void CalculateNumTiles(std::vector<int>& numTiles,
- int toplevel_size,
- int size,
- int tile_rounding_mode) {
- for (unsigned i = 0; i < numTiles.size(); i++) {
- int l = LevelSize(toplevel_size, i, tile_rounding_mode);
- assert(l <= std::numeric_limits<int>::max() - size + 1);
-
- numTiles[i] = (l + size - 1) / size;
- }
-}
-
-static void PrecalculateTileInfo(std::vector<int>& num_x_tiles,
- std::vector<int>& num_y_tiles,
- const EXRHeader* exr_header) {
- int min_x = exr_header->data_window.min_x;
- int max_x = exr_header->data_window.max_x;
- int min_y = exr_header->data_window.min_y;
- int max_y = exr_header->data_window.max_y;
-
- int num_x_levels = CalculateNumXLevels(exr_header);
- int num_y_levels = CalculateNumYLevels(exr_header);
-
- num_x_tiles.resize(num_x_levels);
- num_y_tiles.resize(num_y_levels);
-
- CalculateNumTiles(num_x_tiles,
- max_x - min_x + 1,
- exr_header->tile_size_x,
- exr_header->tile_rounding_mode);
-
- CalculateNumTiles(num_y_tiles,
- max_y - min_y + 1,
- exr_header->tile_size_y,
- exr_header->tile_rounding_mode);
-}
-
-static void InitSingleResolutionOffsets(OffsetData& offset_data, size_t num_blocks) {
- offset_data.offsets.resize(1);
- offset_data.offsets[0].resize(1);
- offset_data.offsets[0][0].resize(num_blocks);
- offset_data.num_x_levels = 1;
- offset_data.num_y_levels = 1;
-}
-
-// Return sum of tile blocks.
-static int InitTileOffsets(OffsetData& offset_data,
- const EXRHeader* exr_header,
- const std::vector<int>& num_x_tiles,
- const std::vector<int>& num_y_tiles) {
- int num_tile_blocks = 0;
- offset_data.num_x_levels = static_cast<int>(num_x_tiles.size());
- offset_data.num_y_levels = static_cast<int>(num_y_tiles.size());
- switch (exr_header->tile_level_mode) {
- case TINYEXR_TILE_ONE_LEVEL:
- case TINYEXR_TILE_MIPMAP_LEVELS:
- assert(offset_data.num_x_levels == offset_data.num_y_levels);
- offset_data.offsets.resize(offset_data.num_x_levels);
-
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
- offset_data.offsets[l].resize(num_y_tiles[l]);
-
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
- offset_data.offsets[l][dy].resize(num_x_tiles[l]);
- num_tile_blocks += num_x_tiles[l];
- }
- }
- break;
-
- case TINYEXR_TILE_RIPMAP_LEVELS:
-
- offset_data.offsets.resize(static_cast<size_t>(offset_data.num_x_levels) * static_cast<size_t>(offset_data.num_y_levels));
-
- for (int ly = 0; ly < offset_data.num_y_levels; ++ly) {
- for (int lx = 0; lx < offset_data.num_x_levels; ++lx) {
- int l = ly * offset_data.num_x_levels + lx;
- offset_data.offsets[l].resize(num_y_tiles[ly]);
-
- for (size_t dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
- offset_data.offsets[l][dy].resize(num_x_tiles[lx]);
- num_tile_blocks += num_x_tiles[lx];
- }
- }
- }
- break;
-
- default:
- assert(false);
- }
- return num_tile_blocks;
-}
-
-static bool IsAnyOffsetsAreInvalid(const OffsetData& offset_data) {
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l)
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy)
- for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx)
- if (reinterpret_cast<const tinyexr::tinyexr_int64&>(offset_data.offsets[l][dy][dx]) <= 0)
- return true;
-
- return false;
-}
-
-static bool isValidTile(const EXRHeader* exr_header,
- const OffsetData& offset_data,
- int dx, int dy, int lx, int ly) {
- if (lx < 0 || ly < 0 || dx < 0 || dy < 0) return false;
- int num_x_levels = offset_data.num_x_levels;
- int num_y_levels = offset_data.num_y_levels;
- switch (exr_header->tile_level_mode) {
- case TINYEXR_TILE_ONE_LEVEL:
-
- if (lx == 0 &&
- ly == 0 &&
- offset_data.offsets.size() > 0 &&
- offset_data.offsets[0].size() > static_cast<size_t>(dy) &&
- offset_data.offsets[0][dy].size() > static_cast<size_t>(dx)) {
- return true;
- }
-
- break;
-
- case TINYEXR_TILE_MIPMAP_LEVELS:
-
- if (lx < num_x_levels &&
- ly < num_y_levels &&
- offset_data.offsets.size() > static_cast<size_t>(lx) &&
- offset_data.offsets[lx].size() > static_cast<size_t>(dy) &&
- offset_data.offsets[lx][dy].size() > static_cast<size_t>(dx)) {
- return true;
- }
-
- break;
-
- case TINYEXR_TILE_RIPMAP_LEVELS:
- {
- size_t idx = static_cast<size_t>(lx) + static_cast<size_t>(ly)* static_cast<size_t>(num_x_levels);
- if (lx < num_x_levels &&
- ly < num_y_levels &&
- (offset_data.offsets.size() > idx) &&
- offset_data.offsets[idx].size() > static_cast<size_t>(dy) &&
- offset_data.offsets[idx][dy].size() > static_cast<size_t>(dx)) {
- return true;
- }
- }
-
- break;
-
- default:
-
- return false;
- }
-
- return false;
-}
-
-static void ReconstructTileOffsets(OffsetData& offset_data,
- const EXRHeader* exr_header,
- const unsigned char* head, const unsigned char* marker, const size_t /*size*/,
- bool isMultiPartFile,
- bool isDeep) {
- int numXLevels = offset_data.num_x_levels;
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
- for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx) {
- tinyexr::tinyexr_uint64 tileOffset = marker - head;
-
- if (isMultiPartFile) {
- //int partNumber;
- marker += sizeof(int);
- }
-
- int tileX;
- memcpy(&tileX, marker, sizeof(int));
- tinyexr::swap4(&tileX);
- marker += sizeof(int);
-
- int tileY;
- memcpy(&tileY, marker, sizeof(int));
- tinyexr::swap4(&tileY);
- marker += sizeof(int);
-
- int levelX;
- memcpy(&levelX, marker, sizeof(int));
- tinyexr::swap4(&levelX);
- marker += sizeof(int);
-
- int levelY;
- memcpy(&levelY, marker, sizeof(int));
- tinyexr::swap4(&levelY);
- marker += sizeof(int);
-
- if (isDeep) {
- tinyexr::tinyexr_int64 packed_offset_table_size;
- memcpy(&packed_offset_table_size, marker, sizeof(tinyexr::tinyexr_int64));
- tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64*>(&packed_offset_table_size));
- marker += sizeof(tinyexr::tinyexr_int64);
-
- tinyexr::tinyexr_int64 packed_sample_size;
- memcpy(&packed_sample_size, marker, sizeof(tinyexr::tinyexr_int64));
- tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64*>(&packed_sample_size));
- marker += sizeof(tinyexr::tinyexr_int64);
-
- // next Int64 is unpacked sample size - skip that too
- marker += packed_offset_table_size + packed_sample_size + 8;
-
- } else {
-
- int dataSize;
- memcpy(&dataSize, marker, sizeof(int));
- tinyexr::swap4(&dataSize);
- marker += sizeof(int);
- marker += dataSize;
- }
-
- if (!isValidTile(exr_header, offset_data,
- tileX, tileY, levelX, levelY))
- return;
-
- int level_idx = LevelIndex(levelX, levelY, exr_header->tile_level_mode, numXLevels);
- offset_data.offsets[level_idx][tileY][tileX] = tileOffset;
- }
- }
- }
-}
-
-// marker output is also
-static int ReadOffsets(OffsetData& offset_data,
- const unsigned char* head,
- const unsigned char*& marker,
- const size_t size,
- const char** err) {
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
- for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx) {
- tinyexr::tinyexr_uint64 offset;
- if ((marker + sizeof(tinyexr_uint64)) >= (head + size)) {
- tinyexr::SetErrorMessage("Insufficient data size in offset table.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- memcpy(&offset, marker, sizeof(tinyexr::tinyexr_uint64));
- tinyexr::swap8(&offset);
- if (offset >= size) {
- tinyexr::SetErrorMessage("Invalid offset value in DecodeEXRImage.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- marker += sizeof(tinyexr::tinyexr_uint64); // = 8
- offset_data.offsets[l][dy][dx] = offset;
- }
- }
- }
- return TINYEXR_SUCCESS;
-}
-
-static int DecodeEXRImage(EXRImage *exr_image, const EXRHeader *exr_header,
- const unsigned char *head,
- const unsigned char *marker, const size_t size,
- const char **err) {
- if (exr_image == NULL || exr_header == NULL || head == NULL ||
- marker == NULL || (size <= tinyexr::kEXRVersionSize)) {
- tinyexr::SetErrorMessage("Invalid argument for DecodeEXRImage().", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- int num_scanline_blocks = 1;
- if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
- num_scanline_blocks = 16;
- } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
- num_scanline_blocks = 32;
- } else if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
- num_scanline_blocks = 16;
- }
-
- if (exr_header->data_window.max_x < exr_header->data_window.min_x ||
- exr_header->data_window.max_x - exr_header->data_window.min_x ==
- std::numeric_limits<int>::max()) {
- // Issue 63
- tinyexr::SetErrorMessage("Invalid data width value", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- int data_width =
- exr_header->data_window.max_x - exr_header->data_window.min_x + 1;
-
- if (exr_header->data_window.max_y < exr_header->data_window.min_y ||
- exr_header->data_window.max_y - exr_header->data_window.min_y ==
- std::numeric_limits<int>::max()) {
- tinyexr::SetErrorMessage("Invalid data height value", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- int data_height =
- exr_header->data_window.max_y - exr_header->data_window.min_y + 1;
-
- // Do not allow too large data_width and data_height. header invalid?
- {
- if (data_width > TINYEXR_DIMENSION_THRESHOLD) {
- tinyexr::SetErrorMessage("data width too large.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- if (data_height > TINYEXR_DIMENSION_THRESHOLD) {
- tinyexr::SetErrorMessage("data height too large.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
-
- if (exr_header->tiled) {
- if (exr_header->tile_size_x > TINYEXR_DIMENSION_THRESHOLD) {
- tinyexr::SetErrorMessage("tile width too large.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- if (exr_header->tile_size_y > TINYEXR_DIMENSION_THRESHOLD) {
- tinyexr::SetErrorMessage("tile height too large.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
-
- // Read offset tables.
- OffsetData offset_data;
- size_t num_blocks = 0;
- // For a multi-resolution image, the size of the offset table will be calculated from the other attributes of the header.
- // If chunk_count > 0 then chunk_count must be equal to the calculated tile count.
- if (exr_header->tiled) {
- {
- std::vector<int> num_x_tiles, num_y_tiles;
- PrecalculateTileInfo(num_x_tiles, num_y_tiles, exr_header);
- num_blocks = InitTileOffsets(offset_data, exr_header, num_x_tiles, num_y_tiles);
- if (exr_header->chunk_count > 0) {
- if (exr_header->chunk_count != static_cast<int>(num_blocks)) {
- tinyexr::SetErrorMessage("Invalid offset table size.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
- }
-
- int ret = ReadOffsets(offset_data, head, marker, size, err);
- if (ret != TINYEXR_SUCCESS) return ret;
- if (IsAnyOffsetsAreInvalid(offset_data)) {
- ReconstructTileOffsets(offset_data, exr_header,
- head, marker, size,
- exr_header->multipart, exr_header->non_image);
- }
- } else if (exr_header->chunk_count > 0) {
- // Use `chunkCount` attribute.
- num_blocks = static_cast<size_t>(exr_header->chunk_count);
- InitSingleResolutionOffsets(offset_data, num_blocks);
- } else {
- num_blocks = static_cast<size_t>(data_height) /
- static_cast<size_t>(num_scanline_blocks);
- if (num_blocks * static_cast<size_t>(num_scanline_blocks) <
- static_cast<size_t>(data_height)) {
- num_blocks++;
- }
-
- InitSingleResolutionOffsets(offset_data, num_blocks);
- }
-
- if (!exr_header->tiled) {
- std::vector<tinyexr::tinyexr_uint64>& offsets = offset_data.offsets[0][0];
- for (size_t y = 0; y < num_blocks; y++) {
- tinyexr::tinyexr_uint64 offset;
- // Issue #81
- if ((marker + sizeof(tinyexr_uint64)) >= (head + size)) {
- tinyexr::SetErrorMessage("Insufficient data size in offset table.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- memcpy(&offset, marker, sizeof(tinyexr::tinyexr_uint64));
- tinyexr::swap8(&offset);
- if (offset >= size) {
- tinyexr::SetErrorMessage("Invalid offset value in DecodeEXRImage.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- marker += sizeof(tinyexr::tinyexr_uint64); // = 8
- offsets[y] = offset;
- }
-
- // If line offsets are invalid, we try to reconstruct it.
- // See OpenEXR/IlmImf/ImfScanLineInputFile.cpp::readLineOffsets() for details.
- for (size_t y = 0; y < num_blocks; y++) {
- if (offsets[y] <= 0) {
- // TODO(syoyo) Report as warning?
- // if (err) {
- // stringstream ss;
- // ss << "Incomplete lineOffsets." << std::endl;
- // (*err) += ss.str();
- //}
- bool ret =
- ReconstructLineOffsets(&offsets, num_blocks, head, marker, size);
- if (ret) {
- // OK
- break;
- } else {
- tinyexr::SetErrorMessage(
- "Cannot reconstruct lineOffset table in DecodeEXRImage.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
- }
- }
-
- {
- std::string e;
- int ret = DecodeChunk(exr_image, exr_header, offset_data, head, size, &e);
-
- if (ret != TINYEXR_SUCCESS) {
- if (!e.empty()) {
- tinyexr::SetErrorMessage(e, err);
- }
-
-#if 1
- FreeEXRImage(exr_image);
-#else
- // release memory(if exists)
- if ((exr_header->num_channels > 0) && exr_image && exr_image->images) {
- for (size_t c = 0; c < size_t(exr_header->num_channels); c++) {
- if (exr_image->images[c]) {
- free(exr_image->images[c]);
- exr_image->images[c] = NULL;
- }
- }
- free(exr_image->images);
- exr_image->images = NULL;
- }
-#endif
- }
-
- return ret;
- }
-}
-
-static void GetLayers(const EXRHeader &exr_header,
- std::vector<std::string> &layer_names) {
- // Naive implementation
- // Group channels by layers
- // go over all channel names, split by periods
- // collect unique names
- layer_names.clear();
- for (int c = 0; c < exr_header.num_channels; c++) {
- std::string full_name(exr_header.channels[c].name);
- const size_t pos = full_name.find_last_of('.');
- if (pos != std::string::npos && pos != 0 && pos + 1 < full_name.size()) {
- full_name.erase(pos);
- if (std::find(layer_names.begin(), layer_names.end(), full_name) ==
- layer_names.end())
- layer_names.push_back(full_name);
- }
- }
-}
-
-struct LayerChannel {
- explicit LayerChannel(size_t i, std::string n) : index(i), name(n) {}
- size_t index;
- std::string name;
-};
-
-static void ChannelsInLayer(const EXRHeader &exr_header,
- const std::string &layer_name,
- std::vector<LayerChannel> &channels) {
- channels.clear();
- for (int c = 0; c < exr_header.num_channels; c++) {
- std::string ch_name(exr_header.channels[c].name);
- if (layer_name.empty()) {
- const size_t pos = ch_name.find_last_of('.');
- if (pos != std::string::npos && pos < ch_name.size()) {
- ch_name = ch_name.substr(pos + 1);
- }
- } else {
- const size_t pos = ch_name.find(layer_name + '.');
- if (pos == std::string::npos) continue;
- if (pos == 0) {
- ch_name = ch_name.substr(layer_name.size() + 1);
- }
- }
- LayerChannel ch(size_t(c), ch_name);
- channels.push_back(ch);
- }
-}
-
-} // namespace tinyexr
-
-int EXRLayers(const char *filename, const char **layer_names[], int *num_layers,
- const char **err) {
- EXRVersion exr_version;
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
-
- {
- int ret = ParseEXRVersionFromFile(&exr_version, filename);
- if (ret != TINYEXR_SUCCESS) {
- tinyexr::SetErrorMessage("Invalid EXR header.", err);
- return ret;
- }
-
- if (exr_version.multipart || exr_version.non_image) {
- tinyexr::SetErrorMessage(
- "Loading multipart or DeepImage is not supported in LoadEXR() API",
- err);
- return TINYEXR_ERROR_INVALID_DATA; // @fixme.
- }
- }
-
- int ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, filename, err);
- if (ret != TINYEXR_SUCCESS) {
- FreeEXRHeader(&exr_header);
- return ret;
- }
-
- std::vector<std::string> layer_vec;
- tinyexr::GetLayers(exr_header, layer_vec);
-
- (*num_layers) = int(layer_vec.size());
- (*layer_names) = static_cast<const char **>(
- malloc(sizeof(const char *) * static_cast<size_t>(layer_vec.size())));
- for (size_t c = 0; c < static_cast<size_t>(layer_vec.size()); c++) {
-#ifdef _MSC_VER
- (*layer_names)[c] = _strdup(layer_vec[c].c_str());
-#else
- (*layer_names)[c] = strdup(layer_vec[c].c_str());
-#endif
- }
-
- FreeEXRHeader(&exr_header);
- return TINYEXR_SUCCESS;
-}
-
-int LoadEXR(float **out_rgba, int *width, int *height, const char *filename,
- const char **err) {
- return LoadEXRWithLayer(out_rgba, width, height, filename,
- /* layername */ NULL, err);
-}
-
-int LoadEXRWithLayer(float **out_rgba, int *width, int *height,
- const char *filename, const char *layername,
- const char **err) {
- if (out_rgba == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for LoadEXR()", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- EXRVersion exr_version;
- EXRImage exr_image;
- EXRHeader exr_header;
- InitEXRHeader(&exr_header);
- InitEXRImage(&exr_image);
-
- {
- int ret = ParseEXRVersionFromFile(&exr_version, filename);
- if (ret != TINYEXR_SUCCESS) {
- std::stringstream ss;
- ss << "Failed to open EXR file or read version info from EXR file. code("
- << ret << ")";
- tinyexr::SetErrorMessage(ss.str(), err);
- return ret;
- }
-
- if (exr_version.multipart || exr_version.non_image) {
- tinyexr::SetErrorMessage(
- "Loading multipart or DeepImage is not supported in LoadEXR() API",
- err);
- return TINYEXR_ERROR_INVALID_DATA; // @fixme.
- }
- }
-
- {
- int ret = ParseEXRHeaderFromFile(&exr_header, &exr_version, filename, err);
- if (ret != TINYEXR_SUCCESS) {
- FreeEXRHeader(&exr_header);
- return ret;
- }
- }
-
- // Read HALF channel as FLOAT.
- for (int i = 0; i < exr_header.num_channels; i++) {
- if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) {
- exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
- }
- }
-
- // TODO: Probably limit loading to layers (channels) selected by layer index
- {
- int ret = LoadEXRImageFromFile(&exr_image, &exr_header, filename, err);
- if (ret != TINYEXR_SUCCESS) {
- FreeEXRHeader(&exr_header);
- return ret;
- }
- }
-
- // RGBA
- int idxR = -1;
- int idxG = -1;
- int idxB = -1;
- int idxA = -1;
-
- std::vector<std::string> layer_names;
- tinyexr::GetLayers(exr_header, layer_names);
-
- std::vector<tinyexr::LayerChannel> channels;
- tinyexr::ChannelsInLayer(
- exr_header, layername == NULL ? "" : std::string(layername), channels);
-
- if (channels.size() < 1) {
- tinyexr::SetErrorMessage("Layer Not Found", err);
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return TINYEXR_ERROR_LAYER_NOT_FOUND;
- }
-
- size_t ch_count = channels.size() < 4 ? channels.size() : 4;
- for (size_t c = 0; c < ch_count; c++) {
- const tinyexr::LayerChannel &ch = channels[c];
-
- if (ch.name == "R") {
- idxR = int(ch.index);
- } else if (ch.name == "G") {
- idxG = int(ch.index);
- } else if (ch.name == "B") {
- idxB = int(ch.index);
- } else if (ch.name == "A") {
- idxA = int(ch.index);
- }
- }
-
- if (channels.size() == 1) {
- int chIdx = int(channels.front().index);
- // Grayscale channel only.
-
- (*out_rgba) = reinterpret_cast<float *>(
- malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) *
- static_cast<size_t>(exr_image.height)));
-
- if (exr_header.tiled) {
- for (int it = 0; it < exr_image.num_tiles; it++) {
- for (int j = 0; j < exr_header.tile_size_y; j++) {
- for (int i = 0; i < exr_header.tile_size_x; i++) {
- const int ii = exr_image.tiles[it].offset_x *
- static_cast<int>(exr_header.tile_size_x) +
- i;
- const int jj = exr_image.tiles[it].offset_y *
- static_cast<int>(exr_header.tile_size_y) +
- j;
- const int idx = ii + jj * static_cast<int>(exr_image.width);
-
- // out of region check.
- if (ii >= exr_image.width) {
- continue;
- }
- if (jj >= exr_image.height) {
- continue;
- }
- const int srcIdx = i + j * exr_header.tile_size_x;
- unsigned char **src = exr_image.tiles[it].images;
- (*out_rgba)[4 * idx + 0] =
- reinterpret_cast<float **>(src)[chIdx][srcIdx];
- (*out_rgba)[4 * idx + 1] =
- reinterpret_cast<float **>(src)[chIdx][srcIdx];
- (*out_rgba)[4 * idx + 2] =
- reinterpret_cast<float **>(src)[chIdx][srcIdx];
- (*out_rgba)[4 * idx + 3] =
- reinterpret_cast<float **>(src)[chIdx][srcIdx];
- }
- }
- }
- } else {
- for (int i = 0; i < exr_image.width * exr_image.height; i++) {
- const float val =
- reinterpret_cast<float **>(exr_image.images)[chIdx][i];
- (*out_rgba)[4 * i + 0] = val;
- (*out_rgba)[4 * i + 1] = val;
- (*out_rgba)[4 * i + 2] = val;
- (*out_rgba)[4 * i + 3] = val;
- }
- }
- } else {
- // Assume RGB(A)
-
- if (idxR == -1) {
- tinyexr::SetErrorMessage("R channel not found", err);
-
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- if (idxG == -1) {
- tinyexr::SetErrorMessage("G channel not found", err);
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- if (idxB == -1) {
- tinyexr::SetErrorMessage("B channel not found", err);
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- (*out_rgba) = reinterpret_cast<float *>(
- malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) *
- static_cast<size_t>(exr_image.height)));
- if (exr_header.tiled) {
- for (int it = 0; it < exr_image.num_tiles; it++) {
- for (int j = 0; j < exr_header.tile_size_y; j++) {
- for (int i = 0; i < exr_header.tile_size_x; i++) {
- const int ii =
- exr_image.tiles[it].offset_x * exr_header.tile_size_x + i;
- const int jj =
- exr_image.tiles[it].offset_y * exr_header.tile_size_y + j;
- const int idx = ii + jj * exr_image.width;
-
- // out of region check.
- if (ii >= exr_image.width) {
- continue;
- }
- if (jj >= exr_image.height) {
- continue;
- }
- const int srcIdx = i + j * exr_header.tile_size_x;
- unsigned char **src = exr_image.tiles[it].images;
- (*out_rgba)[4 * idx + 0] =
- reinterpret_cast<float **>(src)[idxR][srcIdx];
- (*out_rgba)[4 * idx + 1] =
- reinterpret_cast<float **>(src)[idxG][srcIdx];
- (*out_rgba)[4 * idx + 2] =
- reinterpret_cast<float **>(src)[idxB][srcIdx];
- if (idxA != -1) {
- (*out_rgba)[4 * idx + 3] =
- reinterpret_cast<float **>(src)[idxA][srcIdx];
- } else {
- (*out_rgba)[4 * idx + 3] = 1.0;
- }
- }
- }
- }
- } else {
- for (int i = 0; i < exr_image.width * exr_image.height; i++) {
- (*out_rgba)[4 * i + 0] =
- reinterpret_cast<float **>(exr_image.images)[idxR][i];
- (*out_rgba)[4 * i + 1] =
- reinterpret_cast<float **>(exr_image.images)[idxG][i];
- (*out_rgba)[4 * i + 2] =
- reinterpret_cast<float **>(exr_image.images)[idxB][i];
- if (idxA != -1) {
- (*out_rgba)[4 * i + 3] =
- reinterpret_cast<float **>(exr_image.images)[idxA][i];
- } else {
- (*out_rgba)[4 * i + 3] = 1.0;
- }
- }
- }
- }
-
- (*width) = exr_image.width;
- (*height) = exr_image.height;
-
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
-
- return TINYEXR_SUCCESS;
-}
-
-int IsEXR(const char *filename) {
- EXRVersion exr_version;
-
- int ret = ParseEXRVersionFromFile(&exr_version, filename);
- if (ret != TINYEXR_SUCCESS) {
- return ret;
- }
-
- return TINYEXR_SUCCESS;
-}
-
-int ParseEXRHeaderFromMemory(EXRHeader *exr_header, const EXRVersion *version,
- const unsigned char *memory, size_t size,
- const char **err) {
- if (memory == NULL || exr_header == NULL) {
- tinyexr::SetErrorMessage(
- "Invalid argument. `memory` or `exr_header` argument is null in "
- "ParseEXRHeaderFromMemory()",
- err);
-
- // Invalid argument
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (size < tinyexr::kEXRVersionSize) {
- tinyexr::SetErrorMessage("Insufficient header/data size.\n", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- const unsigned char *marker = memory + tinyexr::kEXRVersionSize;
- size_t marker_size = size - tinyexr::kEXRVersionSize;
-
- tinyexr::HeaderInfo info;
- info.clear();
-
- std::string err_str;
- int ret = ParseEXRHeader(&info, NULL, version, &err_str, marker, marker_size);
-
- if (ret != TINYEXR_SUCCESS) {
- if (err && !err_str.empty()) {
- tinyexr::SetErrorMessage(err_str, err);
- }
- }
-
- ConvertHeader(exr_header, info);
-
- exr_header->multipart = version->multipart ? 1 : 0;
- exr_header->non_image = version->non_image ? 1 : 0;
-
- return ret;
-}
-
-int LoadEXRFromMemory(float **out_rgba, int *width, int *height,
- const unsigned char *memory, size_t size,
- const char **err) {
- if (out_rgba == NULL || memory == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for LoadEXRFromMemory", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- EXRVersion exr_version;
- EXRImage exr_image;
- EXRHeader exr_header;
-
- InitEXRHeader(&exr_header);
-
- int ret = ParseEXRVersionFromMemory(&exr_version, memory, size);
- if (ret != TINYEXR_SUCCESS) {
- std::stringstream ss;
- ss << "Failed to parse EXR version. code(" << ret << ")";
- tinyexr::SetErrorMessage(ss.str(), err);
- return ret;
- }
-
- ret = ParseEXRHeaderFromMemory(&exr_header, &exr_version, memory, size, err);
- if (ret != TINYEXR_SUCCESS) {
- return ret;
- }
-
- // Read HALF channel as FLOAT.
- for (int i = 0; i < exr_header.num_channels; i++) {
- if (exr_header.pixel_types[i] == TINYEXR_PIXELTYPE_HALF) {
- exr_header.requested_pixel_types[i] = TINYEXR_PIXELTYPE_FLOAT;
- }
- }
-
- InitEXRImage(&exr_image);
- ret = LoadEXRImageFromMemory(&exr_image, &exr_header, memory, size, err);
- if (ret != TINYEXR_SUCCESS) {
- return ret;
- }
-
- // RGBA
- int idxR = -1;
- int idxG = -1;
- int idxB = -1;
- int idxA = -1;
- for (int c = 0; c < exr_header.num_channels; c++) {
- if (strcmp(exr_header.channels[c].name, "R") == 0) {
- idxR = c;
- } else if (strcmp(exr_header.channels[c].name, "G") == 0) {
- idxG = c;
- } else if (strcmp(exr_header.channels[c].name, "B") == 0) {
- idxB = c;
- } else if (strcmp(exr_header.channels[c].name, "A") == 0) {
- idxA = c;
- }
- }
-
- // TODO(syoyo): Refactor removing same code as used in LoadEXR().
- if (exr_header.num_channels == 1) {
- // Grayscale channel only.
-
- (*out_rgba) = reinterpret_cast<float *>(
- malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) *
- static_cast<size_t>(exr_image.height)));
-
- if (exr_header.tiled) {
- for (int it = 0; it < exr_image.num_tiles; it++) {
- for (int j = 0; j < exr_header.tile_size_y; j++) {
- for (int i = 0; i < exr_header.tile_size_x; i++) {
- const int ii =
- exr_image.tiles[it].offset_x * exr_header.tile_size_x + i;
- const int jj =
- exr_image.tiles[it].offset_y * exr_header.tile_size_y + j;
- const int idx = ii + jj * exr_image.width;
-
- // out of region check.
- if (ii >= exr_image.width) {
- continue;
- }
- if (jj >= exr_image.height) {
- continue;
- }
- const int srcIdx = i + j * exr_header.tile_size_x;
- unsigned char **src = exr_image.tiles[it].images;
- (*out_rgba)[4 * idx + 0] =
- reinterpret_cast<float **>(src)[0][srcIdx];
- (*out_rgba)[4 * idx + 1] =
- reinterpret_cast<float **>(src)[0][srcIdx];
- (*out_rgba)[4 * idx + 2] =
- reinterpret_cast<float **>(src)[0][srcIdx];
- (*out_rgba)[4 * idx + 3] =
- reinterpret_cast<float **>(src)[0][srcIdx];
- }
- }
- }
- } else {
- for (int i = 0; i < exr_image.width * exr_image.height; i++) {
- const float val = reinterpret_cast<float **>(exr_image.images)[0][i];
- (*out_rgba)[4 * i + 0] = val;
- (*out_rgba)[4 * i + 1] = val;
- (*out_rgba)[4 * i + 2] = val;
- (*out_rgba)[4 * i + 3] = val;
- }
- }
-
- } else {
- // TODO(syoyo): Support non RGBA image.
-
- if (idxR == -1) {
- tinyexr::SetErrorMessage("R channel not found", err);
-
- // @todo { free exr_image }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- if (idxG == -1) {
- tinyexr::SetErrorMessage("G channel not found", err);
- // @todo { free exr_image }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- if (idxB == -1) {
- tinyexr::SetErrorMessage("B channel not found", err);
- // @todo { free exr_image }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- (*out_rgba) = reinterpret_cast<float *>(
- malloc(4 * sizeof(float) * static_cast<size_t>(exr_image.width) *
- static_cast<size_t>(exr_image.height)));
-
- if (exr_header.tiled) {
- for (int it = 0; it < exr_image.num_tiles; it++) {
- for (int j = 0; j < exr_header.tile_size_y; j++)
- for (int i = 0; i < exr_header.tile_size_x; i++) {
- const int ii =
- exr_image.tiles[it].offset_x * exr_header.tile_size_x + i;
- const int jj =
- exr_image.tiles[it].offset_y * exr_header.tile_size_y + j;
- const int idx = ii + jj * exr_image.width;
-
- // out of region check.
- if (ii >= exr_image.width) {
- continue;
- }
- if (jj >= exr_image.height) {
- continue;
- }
- const int srcIdx = i + j * exr_header.tile_size_x;
- unsigned char **src = exr_image.tiles[it].images;
- (*out_rgba)[4 * idx + 0] =
- reinterpret_cast<float **>(src)[idxR][srcIdx];
- (*out_rgba)[4 * idx + 1] =
- reinterpret_cast<float **>(src)[idxG][srcIdx];
- (*out_rgba)[4 * idx + 2] =
- reinterpret_cast<float **>(src)[idxB][srcIdx];
- if (idxA != -1) {
- (*out_rgba)[4 * idx + 3] =
- reinterpret_cast<float **>(src)[idxA][srcIdx];
- } else {
- (*out_rgba)[4 * idx + 3] = 1.0;
- }
- }
- }
- } else {
- for (int i = 0; i < exr_image.width * exr_image.height; i++) {
- (*out_rgba)[4 * i + 0] =
- reinterpret_cast<float **>(exr_image.images)[idxR][i];
- (*out_rgba)[4 * i + 1] =
- reinterpret_cast<float **>(exr_image.images)[idxG][i];
- (*out_rgba)[4 * i + 2] =
- reinterpret_cast<float **>(exr_image.images)[idxB][i];
- if (idxA != -1) {
- (*out_rgba)[4 * i + 3] =
- reinterpret_cast<float **>(exr_image.images)[idxA][i];
- } else {
- (*out_rgba)[4 * i + 3] = 1.0;
- }
- }
- }
- }
-
- (*width) = exr_image.width;
- (*height) = exr_image.height;
-
- FreeEXRHeader(&exr_header);
- FreeEXRImage(&exr_image);
-
- return TINYEXR_SUCCESS;
-}
-
-int LoadEXRImageFromFile(EXRImage *exr_image, const EXRHeader *exr_header,
- const char *filename, const char **err) {
- if (exr_image == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for LoadEXRImageFromFile", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- // TODO(syoyo): return wfopen_s erro code
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
-#else
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-
- size_t filesize;
- // Compute size
- fseek(fp, 0, SEEK_END);
- filesize = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- if (filesize < 16) {
- tinyexr::SetErrorMessage("File size too short " + std::string(filename),
- err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
-
- std::vector<unsigned char> buf(filesize); // @todo { use mmap }
- {
- size_t ret;
- ret = fread(&buf[0], 1, filesize, fp);
- assert(ret == filesize);
- fclose(fp);
- (void)ret;
- }
-
- return LoadEXRImageFromMemory(exr_image, exr_header, &buf.at(0), filesize,
- err);
-}
-
-int LoadEXRImageFromMemory(EXRImage *exr_image, const EXRHeader *exr_header,
- const unsigned char *memory, const size_t size,
- const char **err) {
- if (exr_image == NULL || memory == NULL ||
- (size < tinyexr::kEXRVersionSize)) {
- tinyexr::SetErrorMessage("Invalid argument for LoadEXRImageFromMemory",
- err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (exr_header->header_len == 0) {
- tinyexr::SetErrorMessage("EXRHeader variable is not initialized.", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- const unsigned char *head = memory;
- const unsigned char *marker = reinterpret_cast<const unsigned char *>(
- memory + exr_header->header_len +
- 8); // +8 for magic number + version header.
- return tinyexr::DecodeEXRImage(exr_image, exr_header, head, marker, size,
- err);
-}
-
-namespace tinyexr
-{
-
-// out_data must be allocated initially with the block-header size
-// of the current image(-part) type
-static bool EncodePixelData(/* out */ std::vector<unsigned char>& out_data,
- const unsigned char* const* images,
- int compression_type,
- int /*line_order*/,
- int width, // for tiled : tile.width
- int /*height*/, // for tiled : header.tile_size_y
- int x_stride, // for tiled : header.tile_size_x
- int line_no, // for tiled : 0
- int num_lines, // for tiled : tile.height
- size_t pixel_data_size,
- const std::vector<ChannelInfo>& channels,
- const std::vector<size_t>& channel_offset_list,
- const void* compression_param = 0) // zfp compression param
-{
- size_t buf_size = static_cast<size_t>(width) *
- static_cast<size_t>(num_lines) *
- static_cast<size_t>(pixel_data_size);
- //int last2bit = (buf_size & 3);
- // buf_size must be multiple of four
- //if(last2bit) buf_size += 4 - last2bit;
- std::vector<unsigned char> buf(buf_size);
-
- size_t start_y = static_cast<size_t>(line_no);
- for (size_t c = 0; c < channels.size(); c++) {
- if (channels[c].pixel_type == TINYEXR_PIXELTYPE_HALF) {
- if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- for (int y = 0; y < num_lines; y++) {
- // Assume increasing Y
- float *line_ptr = reinterpret_cast<float *>(&buf.at(
- static_cast<size_t>(pixel_data_size * y * width) +
- channel_offset_list[c] *
- static_cast<size_t>(width)));
- for (int x = 0; x < width; x++) {
- tinyexr::FP16 h16;
- h16.u = reinterpret_cast<const unsigned short * const *>(
- images)[c][(y + start_y) * x_stride + x];
-
- tinyexr::FP32 f32 = half_to_float(h16);
-
- tinyexr::swap4(&f32.f);
-
- // line_ptr[x] = f32.f;
- tinyexr::cpy4(line_ptr + x, &(f32.f));
- }
- }
- } else if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
- for (int y = 0; y < num_lines; y++) {
- // Assume increasing Y
- unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
- &buf.at(static_cast<size_t>(pixel_data_size * y *
- width) +
- channel_offset_list[c] *
- static_cast<size_t>(width)));
- for (int x = 0; x < width; x++) {
- unsigned short val = reinterpret_cast<const unsigned short * const *>(
- images)[c][(y + start_y) * x_stride + x];
-
- tinyexr::swap2(&val);
-
- // line_ptr[x] = val;
- tinyexr::cpy2(line_ptr + x, &val);
- }
- }
- } else {
- assert(0);
- }
-
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
- for (int y = 0; y < num_lines; y++) {
- // Assume increasing Y
- unsigned short *line_ptr = reinterpret_cast<unsigned short *>(
- &buf.at(static_cast<size_t>(pixel_data_size * y *
- width) +
- channel_offset_list[c] *
- static_cast<size_t>(width)));
- for (int x = 0; x < width; x++) {
- tinyexr::FP32 f32;
- f32.f = reinterpret_cast<const float * const *>(
- images)[c][(y + start_y) * x_stride + x];
-
- tinyexr::FP16 h16;
- h16 = float_to_half_full(f32);
-
- tinyexr::swap2(reinterpret_cast<unsigned short *>(&h16.u));
-
- // line_ptr[x] = h16.u;
- tinyexr::cpy2(line_ptr + x, &(h16.u));
- }
- }
- } else if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_FLOAT) {
- for (int y = 0; y < num_lines; y++) {
- // Assume increasing Y
- float *line_ptr = reinterpret_cast<float *>(&buf.at(
- static_cast<size_t>(pixel_data_size * y * width) +
- channel_offset_list[c] *
- static_cast<size_t>(width)));
- for (int x = 0; x < width; x++) {
- float val = reinterpret_cast<const float * const *>(
- images)[c][(y + start_y) * x_stride + x];
-
- tinyexr::swap4(&val);
-
- // line_ptr[x] = val;
- tinyexr::cpy4(line_ptr + x, &val);
- }
- }
- } else {
- assert(0);
- }
- } else if (channels[c].pixel_type == TINYEXR_PIXELTYPE_UINT) {
- for (int y = 0; y < num_lines; y++) {
- // Assume increasing Y
- unsigned int *line_ptr = reinterpret_cast<unsigned int *>(&buf.at(
- static_cast<size_t>(pixel_data_size * y * width) +
- channel_offset_list[c] * static_cast<size_t>(width)));
- for (int x = 0; x < width; x++) {
- unsigned int val = reinterpret_cast<const unsigned int * const *>(
- images)[c][(y + start_y) * x_stride + x];
-
- tinyexr::swap4(&val);
-
- // line_ptr[x] = val;
- tinyexr::cpy4(line_ptr + x, &val);
- }
- }
- }
- }
-
- if (compression_type == TINYEXR_COMPRESSIONTYPE_NONE) {
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(uncompressed)
- out_data.insert(out_data.end(), buf.begin(), buf.end());
-
- } else if ((compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) {
-#if TINYEXR_USE_MINIZ
- std::vector<unsigned char> block(mz_compressBound(
- static_cast<unsigned long>(buf.size())));
-#else
- std::vector<unsigned char> block(
- compressBound(static_cast<uLong>(buf.size())));
-#endif
- tinyexr::tinyexr_uint64 outSize = block.size();
-
- tinyexr::CompressZip(&block.at(0), outSize,
- reinterpret_cast<const unsigned char *>(&buf.at(0)),
- static_cast<unsigned long>(buf.size()));
-
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(compressed)
- unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
-
- out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
-
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) {
- // (buf.size() * 3) / 2 would be enough.
- std::vector<unsigned char> block((buf.size() * 3) / 2);
-
- tinyexr::tinyexr_uint64 outSize = block.size();
-
- tinyexr::CompressRle(&block.at(0), outSize,
- reinterpret_cast<const unsigned char *>(&buf.at(0)),
- static_cast<unsigned long>(buf.size()));
-
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(compressed)
- unsigned int data_len = static_cast<unsigned int>(outSize); // truncate
- out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
-
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
-#if TINYEXR_USE_PIZ
- unsigned int bufLen = 512 + // Avoid buffer overflow
- 8192 + static_cast<unsigned int>(
- 2 * static_cast<unsigned int>(
- buf.size())); // @fixme { compute good bound. }
- std::vector<unsigned char> block(bufLen);
- unsigned int outSize = static_cast<unsigned int>(block.size());
-
- CompressPiz(&block.at(0), &outSize,
- reinterpret_cast<const unsigned char *>(&buf.at(0)),
- buf.size(), channels, width, num_lines);
-
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(compressed)
- unsigned int data_len = outSize;
- out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
-
-#else
- assert(0);
-#endif
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
-#if TINYEXR_USE_ZFP
- const ZFPCompressionParam* zfp_compression_param = reinterpret_cast<const ZFPCompressionParam*>(compression_param);
- std::vector<unsigned char> block;
- unsigned int outSize;
-
- tinyexr::CompressZfp(
- &block, &outSize, reinterpret_cast<const float *>(&buf.at(0)),
- width, num_lines, static_cast<int>(channels.size()), *zfp_compression_param);
-
- // 4 byte: scan line
- // 4 byte: data size
- // ~ : pixel data(compressed)
- unsigned int data_len = outSize;
- out_data.insert(out_data.end(), block.begin(), block.begin() + data_len);
-
-#else
- (void)compression_param;
- assert(0);
-#endif
- } else {
- assert(0);
- return false;
- }
-
- return true;
-}
-
-static int EncodeTiledLevel(const EXRImage* level_image, const EXRHeader* exr_header,
- const std::vector<tinyexr::ChannelInfo>& channels,
- std::vector<std::vector<unsigned char> >& data_list,
- size_t start_index, // for data_list
- int num_x_tiles, int num_y_tiles,
- const std::vector<size_t>& channel_offset_list,
- int pixel_data_size,
- const void* compression_param, // must be set if zfp compression is enabled
- std::string* err) {
- int num_tiles = num_x_tiles * num_y_tiles;
- assert(num_tiles == level_image->num_tiles);
-
- if ((exr_header->tile_size_x > level_image->width || exr_header->tile_size_y > level_image->height) &&
- level_image->level_x == 0 && level_image->level_y == 0) {
- if (err) {
- (*err) += "Failed to encode tile data.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::atomic<bool> invalid_data(false);
-#else
- bool invalid_data(false);
-#endif
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::vector<std::thread> workers;
- std::atomic<int> tile_count(0);
-
- int num_threads = std::max(1, int(std::thread::hardware_concurrency()));
- if (num_threads > int(num_tiles)) {
- num_threads = int(num_tiles);
- }
-
- for (int t = 0; t < num_threads; t++) {
- workers.emplace_back(std::thread([&]() {
- int i = 0;
- while ((i = tile_count++) < num_tiles) {
-
-#else
- // Use signed int since some OpenMP compiler doesn't allow unsigned type for
- // `parallel for`
-#if TINYEXR_USE_OPENMP
-#pragma omp parallel for
-#endif
- for (int i = 0; i < num_tiles; i++) {
-
-#endif
- size_t tile_idx = static_cast<size_t>(i);
- size_t data_idx = tile_idx + start_index;
-
- int x_tile = i % num_x_tiles;
- int y_tile = i / num_x_tiles;
-
- EXRTile& tile = level_image->tiles[tile_idx];
-
- const unsigned char* const* images =
- static_cast<const unsigned char* const*>(tile.images);
-
- data_list[data_idx].resize(5*sizeof(int));
- size_t data_header_size = data_list[data_idx].size();
- bool ret = EncodePixelData(data_list[data_idx],
- images,
- exr_header->compression_type,
- 0, // increasing y
- tile.width,
- exr_header->tile_size_y,
- exr_header->tile_size_x,
- 0,
- tile.height,
- pixel_data_size,
- channels,
- channel_offset_list,
- compression_param);
- if (!ret) {
- invalid_data = true;
- continue;
- }
- assert(data_list[data_idx].size() > data_header_size);
- int data_len = static_cast<int>(data_list[data_idx].size() - data_header_size);
- //tileX, tileY, levelX, levelY // pixel_data_size(int)
- memcpy(&data_list[data_idx][0], &x_tile, sizeof(int));
- memcpy(&data_list[data_idx][4], &y_tile, sizeof(int));
- memcpy(&data_list[data_idx][8], &level_image->level_x, sizeof(int));
- memcpy(&data_list[data_idx][12], &level_image->level_y, sizeof(int));
- memcpy(&data_list[data_idx][16], &data_len, sizeof(int));
-
- swap4(reinterpret_cast<int*>(&data_list[data_idx][0]));
- swap4(reinterpret_cast<int*>(&data_list[data_idx][4]));
- swap4(reinterpret_cast<int*>(&data_list[data_idx][8]));
- swap4(reinterpret_cast<int*>(&data_list[data_idx][12]));
- swap4(reinterpret_cast<int*>(&data_list[data_idx][16]));
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- }
-}));
- }
-
- for (auto &t : workers) {
- t.join();
- }
-#else
- } // omp parallel
-#endif
-
- if (invalid_data) {
- if (err) {
- (*err) += "Failed to encode tile data.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
- return TINYEXR_SUCCESS;
-}
-
-static int NumScanlines(int compression_type) {
- int num_scanlines = 1;
- if (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
- num_scanlines = 16;
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
- num_scanlines = 32;
- } else if (compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
- num_scanlines = 16;
- }
- return num_scanlines;
-}
-
-static int EncodeChunk(const EXRImage* exr_image, const EXRHeader* exr_header,
- const std::vector<ChannelInfo>& channels,
- int num_blocks,
- tinyexr_uint64 chunk_offset, // starting offset of current chunk
- bool is_multipart,
- OffsetData& offset_data, // output block offsets, must be initialized
- std::vector<std::vector<unsigned char> >& data_list, // output
- tinyexr_uint64& total_size, // output: ending offset of current chunk
- std::string* err) {
- int num_scanlines = NumScanlines(exr_header->compression_type);
-
- data_list.resize(num_blocks);
-
- std::vector<size_t> channel_offset_list(
- static_cast<size_t>(exr_header->num_channels));
-
- int pixel_data_size = 0;
- {
- size_t channel_offset = 0;
- for (size_t c = 0; c < static_cast<size_t>(exr_header->num_channels); c++) {
- channel_offset_list[c] = channel_offset;
- if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_HALF) {
- pixel_data_size += sizeof(unsigned short);
- channel_offset += sizeof(unsigned short);
- } else if (channels[c].requested_pixel_type ==
- TINYEXR_PIXELTYPE_FLOAT) {
- pixel_data_size += sizeof(float);
- channel_offset += sizeof(float);
- } else if (channels[c].requested_pixel_type == TINYEXR_PIXELTYPE_UINT) {
- pixel_data_size += sizeof(unsigned int);
- channel_offset += sizeof(unsigned int);
- } else {
- assert(0);
- }
- }
- }
-
- const void* compression_param = 0;
-#if TINYEXR_USE_ZFP
- tinyexr::ZFPCompressionParam zfp_compression_param;
-
- // Use ZFP compression parameter from custom attributes(if such a parameter
- // exists)
- {
- std::string e;
- bool ret = tinyexr::FindZFPCompressionParam(
- &zfp_compression_param, exr_header->custom_attributes,
- exr_header->num_custom_attributes, &e);
-
- if (!ret) {
- // Use predefined compression parameter.
- zfp_compression_param.type = 0;
- zfp_compression_param.rate = 2;
- }
- compression_param = &zfp_compression_param;
- }
-#endif
-
- tinyexr_uint64 offset = chunk_offset;
- tinyexr_uint64 doffset = is_multipart ? 4u : 0u;
-
- if (exr_image->tiles) {
- const EXRImage* level_image = exr_image;
- size_t block_idx = 0;
- int num_levels = (exr_header->tile_level_mode != TINYEXR_TILE_RIPMAP_LEVELS) ?
- offset_data.num_x_levels : (offset_data.num_x_levels * offset_data.num_y_levels);
- for (int level_index = 0; level_index < num_levels; ++level_index) {
- if (!level_image) {
- if (err) {
- (*err) += "Invalid number of tiled levels for EncodeChunk\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- int level_index_from_image = LevelIndex(level_image->level_x, level_image->level_y,
- exr_header->tile_level_mode, offset_data.num_x_levels);
- if (level_index_from_image != level_index) {
- if (err) {
- (*err) += "Incorrect level ordering in tiled image\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
- int num_y_tiles = (int)offset_data.offsets[level_index].size();
- assert(num_y_tiles);
- int num_x_tiles = (int)offset_data.offsets[level_index][0].size();
- assert(num_x_tiles);
-
- std::string e;
- int ret = EncodeTiledLevel(level_image,
- exr_header,
- channels,
- data_list,
- block_idx,
- num_x_tiles,
- num_y_tiles,
- channel_offset_list,
- pixel_data_size,
- compression_param,
- &e);
- if (ret != TINYEXR_SUCCESS) {
- if (!e.empty() && err) {
- (*err) += e;
- }
- return ret;
- }
-
- for (size_t j = 0; j < static_cast<size_t>(num_y_tiles); ++j)
- for (size_t i = 0; i < static_cast<size_t>(num_x_tiles); ++i) {
- offset_data.offsets[level_index][j][i] = offset;
- swap8(reinterpret_cast<tinyexr_uint64*>(&offset_data.offsets[level_index][j][i]));
- offset += data_list[block_idx].size() + doffset;
- ++block_idx;
- }
- level_image = level_image->next_level;
- }
- assert(static_cast<int>(block_idx) == num_blocks);
- total_size = offset;
- } else { // scanlines
- std::vector<tinyexr::tinyexr_uint64>& offsets = offset_data.offsets[0][0];
-
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- std::atomic<bool> invalid_data(false);
- std::vector<std::thread> workers;
- std::atomic<int> block_count(0);
-
- int num_threads = std::min(std::max(1, int(std::thread::hardware_concurrency())), num_blocks);
-
- for (int t = 0; t < num_threads; t++) {
- workers.emplace_back(std::thread([&]() {
- int i = 0;
- while ((i = block_count++) < num_blocks) {
-
-#else
- bool invalid_data(false);
-#if TINYEXR_USE_OPENMP
-#pragma omp parallel for
-#endif
- for (int i = 0; i < num_blocks; i++) {
-
-#endif
- int start_y = num_scanlines * i;
- int end_Y = (std::min)(num_scanlines * (i + 1), exr_image->height);
- int num_lines = end_Y - start_y;
-
- const unsigned char* const* images =
- static_cast<const unsigned char* const*>(exr_image->images);
-
- data_list[i].resize(2*sizeof(int));
- size_t data_header_size = data_list[i].size();
-
- bool ret = EncodePixelData(data_list[i],
- images,
- exr_header->compression_type,
- 0, // increasing y
- exr_image->width,
- exr_image->height,
- exr_image->width,
- start_y,
- num_lines,
- pixel_data_size,
- channels,
- channel_offset_list,
- compression_param);
- if (!ret) {
- invalid_data = true;
- continue; // "break" cannot be used with OpenMP
- }
- assert(data_list[i].size() > data_header_size);
- int data_len = static_cast<int>(data_list[i].size() - data_header_size);
- memcpy(&data_list[i][0], &start_y, sizeof(int));
- memcpy(&data_list[i][4], &data_len, sizeof(int));
-
- swap4(reinterpret_cast<int*>(&data_list[i][0]));
- swap4(reinterpret_cast<int*>(&data_list[i][4]));
-#if TINYEXR_HAS_CXX11 && (TINYEXR_USE_THREAD > 0)
- }
- }));
- }
-
- for (auto &t : workers) {
- t.join();
- }
-#else
- } // omp parallel
-#endif
-
- if (invalid_data) {
- if (err) {
- (*err) += "Failed to encode scanline data.\n";
- }
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- for (size_t i = 0; i < static_cast<size_t>(num_blocks); i++) {
- offsets[i] = offset;
- tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64 *>(&offsets[i]));
- offset += data_list[i].size() + doffset;
- }
-
- total_size = static_cast<size_t>(offset);
- }
- return TINYEXR_SUCCESS;
-}
-
-// can save a single or multi-part image (no deep* formats)
-static size_t SaveEXRNPartImageToMemory(const EXRImage* exr_images,
- const EXRHeader** exr_headers,
- unsigned int num_parts,
- unsigned char** memory_out, const char** err) {
- if (exr_images == NULL || exr_headers == NULL || num_parts == 0 ||
- memory_out == NULL) {
- SetErrorMessage("Invalid argument for SaveEXRNPartImageToMemory",
- err);
- return 0;
- }
- {
- for (unsigned int i = 0; i < num_parts; ++i) {
- if (exr_headers[i]->compression_type < 0) {
- SetErrorMessage("Invalid argument for SaveEXRNPartImageToMemory",
- err);
- return 0;
- }
-#if !TINYEXR_USE_PIZ
- if (exr_headers[i]->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
- SetErrorMessage("PIZ compression is not supported in this build",
- err);
- return 0;
- }
-#endif
-#if !TINYEXR_USE_ZFP
- if (exr_headers[i]->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
- SetErrorMessage("ZFP compression is not supported in this build",
- err);
- return 0;
- }
-#else
- for (int c = 0; c < exr_header->num_channels; ++c) {
- if (exr_headers[i]->requested_pixel_types[c] != TINYEXR_PIXELTYPE_FLOAT) {
- SetErrorMessage("Pixel type must be FLOAT for ZFP compression",
- err);
- return 0;
- }
- }
-#endif
- }
- }
-
- std::vector<unsigned char> memory;
-
- // Header
- {
- const char header[] = { 0x76, 0x2f, 0x31, 0x01 };
- memory.insert(memory.end(), header, header + 4);
- }
-
- // Version
- // using value from the first header
- int long_name = exr_headers[0]->long_name;
- {
- char marker[] = { 2, 0, 0, 0 };
- /* @todo
- if (exr_header->non_image) {
- marker[1] |= 0x8;
- }
- */
- // tiled
- if (num_parts == 1 && exr_images[0].tiles) {
- marker[1] |= 0x2;
- }
- // long_name
- if (long_name) {
- marker[1] |= 0x4;
- }
- // multipart
- if (num_parts > 1) {
- marker[1] |= 0x10;
- }
- memory.insert(memory.end(), marker, marker + 4);
- }
-
- int total_chunk_count = 0;
- std::vector<int> chunk_count(num_parts);
- std::vector<OffsetData> offset_data(num_parts);
- for (unsigned int i = 0; i < num_parts; ++i) {
- if (!exr_images[i].tiles) {
- int num_scanlines = NumScanlines(exr_headers[i]->compression_type);
- chunk_count[i] =
- (exr_images[i].height + num_scanlines - 1) / num_scanlines;
- InitSingleResolutionOffsets(offset_data[i], chunk_count[i]);
- total_chunk_count += chunk_count[i];
- } else {
- {
- std::vector<int> num_x_tiles, num_y_tiles;
- PrecalculateTileInfo(num_x_tiles, num_y_tiles, exr_headers[i]);
- chunk_count[i] =
- InitTileOffsets(offset_data[i], exr_headers[i], num_x_tiles, num_y_tiles);
- total_chunk_count += chunk_count[i];
- }
- }
- }
- // Write attributes to memory buffer.
- std::vector< std::vector<tinyexr::ChannelInfo> > channels(num_parts);
- {
- std::set<std::string> partnames;
- for (unsigned int i = 0; i < num_parts; ++i) {
- //channels
- {
- std::vector<unsigned char> data;
-
- for (int c = 0; c < exr_headers[i]->num_channels; c++) {
- tinyexr::ChannelInfo info;
- info.p_linear = 0;
- info.pixel_type = exr_headers[i]->pixel_types[c];
- info.requested_pixel_type = exr_headers[i]->requested_pixel_types[c];
- info.x_sampling = 1;
- info.y_sampling = 1;
- info.name = std::string(exr_headers[i]->channels[c].name);
- channels[i].push_back(info);
- }
-
- tinyexr::WriteChannelInfo(data, channels[i]);
-
- tinyexr::WriteAttributeToMemory(&memory, "channels", "chlist", &data.at(0),
- static_cast<int>(data.size()));
- }
-
- {
- int comp = exr_headers[i]->compression_type;
- swap4(&comp);
- WriteAttributeToMemory(
- &memory, "compression", "compression",
- reinterpret_cast<const unsigned char*>(&comp), 1);
- }
-
- {
- int data[4] = { 0, 0, exr_images[i].width - 1, exr_images[i].height - 1 };
- swap4(&data[0]);
- swap4(&data[1]);
- swap4(&data[2]);
- swap4(&data[3]);
- WriteAttributeToMemory(
- &memory, "dataWindow", "box2i",
- reinterpret_cast<const unsigned char*>(data), sizeof(int) * 4);
-
- int data0[4] = { 0, 0, exr_images[0].width - 1, exr_images[0].height - 1 };
- swap4(&data0[0]);
- swap4(&data0[1]);
- swap4(&data0[2]);
- swap4(&data0[3]);
- // Note: must be the same across parts (currently, using value from the first header)
- WriteAttributeToMemory(
- &memory, "displayWindow", "box2i",
- reinterpret_cast<const unsigned char*>(data0), sizeof(int) * 4);
- }
-
- {
- unsigned char line_order = 0; // @fixme { read line_order from EXRHeader }
- WriteAttributeToMemory(&memory, "lineOrder", "lineOrder",
- &line_order, 1);
- }
-
- {
- // Note: must be the same across parts
- float aspectRatio = 1.0f;
- swap4(&aspectRatio);
- WriteAttributeToMemory(
- &memory, "pixelAspectRatio", "float",
- reinterpret_cast<const unsigned char*>(&aspectRatio), sizeof(float));
- }
-
- {
- float center[2] = { 0.0f, 0.0f };
- swap4(&center[0]);
- swap4(&center[1]);
- WriteAttributeToMemory(
- &memory, "screenWindowCenter", "v2f",
- reinterpret_cast<const unsigned char*>(center), 2 * sizeof(float));
- }
-
- {
- float w = 1.0f;
- swap4(&w);
- WriteAttributeToMemory(&memory, "screenWindowWidth", "float",
- reinterpret_cast<const unsigned char*>(&w),
- sizeof(float));
- }
-
- if (exr_images[i].tiles) {
- unsigned char tile_mode = static_cast<unsigned char>(exr_headers[i]->tile_level_mode & 0x3);
- if (exr_headers[i]->tile_rounding_mode) tile_mode |= (1u << 4u);
- //unsigned char data[9] = { 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- unsigned int datai[3] = { 0, 0, 0 };
- unsigned char* data = reinterpret_cast<unsigned char*>(&datai[0]);
- datai[0] = static_cast<unsigned int>(exr_headers[i]->tile_size_x);
- datai[1] = static_cast<unsigned int>(exr_headers[i]->tile_size_y);
- data[8] = tile_mode;
- swap4(reinterpret_cast<unsigned int*>(&data[0]));
- swap4(reinterpret_cast<unsigned int*>(&data[4]));
- WriteAttributeToMemory(
- &memory, "tiles", "tiledesc",
- reinterpret_cast<const unsigned char*>(data), 9);
- }
-
- // must be present for multi-part files - according to spec.
- if (num_parts > 1) {
- // name
- {
- size_t len = 0;
- if ((len = strlen(exr_headers[i]->name)) > 0) {
- partnames.emplace(exr_headers[i]->name);
- if (partnames.size() != i + 1) {
- SetErrorMessage("'name' attributes must be unique for a multi-part file", err);
- return 0;
- }
- WriteAttributeToMemory(
- &memory, "name", "string",
- reinterpret_cast<const unsigned char*>(exr_headers[i]->name),
- static_cast<int>(len));
- } else {
- SetErrorMessage("Invalid 'name' attribute for a multi-part file", err);
- return 0;
- }
- }
- // type
- {
- const char* type = "scanlineimage";
- if (exr_images[i].tiles) type = "tiledimage";
- WriteAttributeToMemory(
- &memory, "type", "string",
- reinterpret_cast<const unsigned char*>(type),
- static_cast<int>(strlen(type)));
- }
- // chunkCount
- {
- WriteAttributeToMemory(
- &memory, "chunkCount", "int",
- reinterpret_cast<const unsigned char*>(&chunk_count[i]),
- 4);
- }
- }
-
- // Custom attributes
- if (exr_headers[i]->num_custom_attributes > 0) {
- for (int j = 0; j < exr_headers[i]->num_custom_attributes; j++) {
- tinyexr::WriteAttributeToMemory(
- &memory, exr_headers[i]->custom_attributes[j].name,
- exr_headers[i]->custom_attributes[j].type,
- reinterpret_cast<const unsigned char*>(
- exr_headers[i]->custom_attributes[j].value),
- exr_headers[i]->custom_attributes[j].size);
- }
- }
-
- { // end of header
- memory.push_back(0);
- }
- }
- }
- if (num_parts > 1) {
- // end of header list
- memory.push_back(0);
- }
-
- tinyexr_uint64 chunk_offset = memory.size() + size_t(total_chunk_count) * sizeof(tinyexr_uint64);
-
- tinyexr_uint64 total_size = 0;
- std::vector< std::vector< std::vector<unsigned char> > > data_lists(num_parts);
- for (unsigned int i = 0; i < num_parts; ++i) {
- std::string e;
- int ret = EncodeChunk(&exr_images[i], exr_headers[i],
- channels[i],
- chunk_count[i],
- // starting offset of current chunk after part-number
- chunk_offset,
- num_parts > 1,
- offset_data[i], // output: block offsets, must be initialized
- data_lists[i], // output
- total_size, // output
- &e);
- if (ret != TINYEXR_SUCCESS) {
- if (!e.empty()) {
- tinyexr::SetErrorMessage(e, err);
- }
- return 0;
- }
- chunk_offset = total_size;
- }
-
- // Allocating required memory
- if (total_size == 0) { // something went wrong
- tinyexr::SetErrorMessage("Output memory size is zero", err);
- return 0;
- }
- (*memory_out) = static_cast<unsigned char*>(malloc(total_size));
-
- // Writing header
- memcpy((*memory_out), &memory[0], memory.size());
- unsigned char* memory_ptr = *memory_out + memory.size();
- size_t sum = memory.size();
-
- // Writing offset data for chunks
- for (unsigned int i = 0; i < num_parts; ++i) {
- if (exr_images[i].tiles) {
- const EXRImage* level_image = &exr_images[i];
- int num_levels = (exr_headers[i]->tile_level_mode != TINYEXR_TILE_RIPMAP_LEVELS) ?
- offset_data[i].num_x_levels : (offset_data[i].num_x_levels * offset_data[i].num_y_levels);
- for (int level_index = 0; level_index < num_levels; ++level_index) {
- for (size_t j = 0; j < offset_data[i].offsets[level_index].size(); ++j) {
- size_t num_bytes = sizeof(tinyexr_uint64) * offset_data[i].offsets[level_index][j].size();
- sum += num_bytes;
- assert(sum <= total_size);
- memcpy(memory_ptr,
- reinterpret_cast<unsigned char*>(&offset_data[i].offsets[level_index][j][0]),
- num_bytes);
- memory_ptr += num_bytes;
- }
- level_image = level_image->next_level;
- }
- } else {
- size_t num_bytes = sizeof(tinyexr::tinyexr_uint64) * static_cast<size_t>(chunk_count[i]);
- sum += num_bytes;
- assert(sum <= total_size);
- std::vector<tinyexr::tinyexr_uint64>& offsets = offset_data[i].offsets[0][0];
- memcpy(memory_ptr, reinterpret_cast<unsigned char*>(&offsets[0]), num_bytes);
- memory_ptr += num_bytes;
- }
- }
-
- // Writing chunk data
- for (unsigned int i = 0; i < num_parts; ++i) {
- for (size_t j = 0; j < static_cast<size_t>(chunk_count[i]); ++j) {
- if (num_parts > 1) {
- sum += 4;
- assert(sum <= total_size);
- unsigned int part_number = i;
- swap4(&part_number);
- memcpy(memory_ptr, &part_number, 4);
- memory_ptr += 4;
- }
- sum += data_lists[i][j].size();
- assert(sum <= total_size);
- memcpy(memory_ptr, &data_lists[i][j][0], data_lists[i][j].size());
- memory_ptr += data_lists[i][j].size();
- }
- }
- assert(sum == total_size);
- return total_size; // OK
-}
-
-} // tinyexr
-
-size_t SaveEXRImageToMemory(const EXRImage* exr_image,
- const EXRHeader* exr_header,
- unsigned char** memory_out, const char** err) {
- return tinyexr::SaveEXRNPartImageToMemory(exr_image, &exr_header, 1, memory_out, err);
-}
-
-int SaveEXRImageToFile(const EXRImage *exr_image, const EXRHeader *exr_header,
- const char *filename, const char **err) {
- if (exr_image == NULL || filename == NULL ||
- exr_header->compression_type < 0) {
- tinyexr::SetErrorMessage("Invalid argument for SaveEXRImageToFile", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
-#if !TINYEXR_USE_PIZ
- if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_PIZ) {
- tinyexr::SetErrorMessage("PIZ compression is not supported in this build",
- err);
- return TINYEXR_ERROR_UNSUPPORTED_FEATURE;
- }
-#endif
-
-#if !TINYEXR_USE_ZFP
- if (exr_header->compression_type == TINYEXR_COMPRESSIONTYPE_ZFP) {
- tinyexr::SetErrorMessage("ZFP compression is not supported in this build",
- err);
- return TINYEXR_ERROR_UNSUPPORTED_FEATURE;
- }
-#endif
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"wb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "wb");
-#endif
-#else
- fp = fopen(filename, "wb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-
- unsigned char *mem = NULL;
- size_t mem_size = SaveEXRImageToMemory(exr_image, exr_header, &mem, err);
- if (mem_size == 0) {
- return TINYEXR_ERROR_SERIALZATION_FAILED;
- }
-
- size_t written_size = 0;
- if ((mem_size > 0) && mem) {
- written_size = fwrite(mem, 1, mem_size, fp);
- }
- free(mem);
-
- fclose(fp);
-
- if (written_size != mem_size) {
- tinyexr::SetErrorMessage("Cannot write a file", err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-
- return TINYEXR_SUCCESS;
-}
-
-size_t SaveEXRMultipartImageToMemory(const EXRImage* exr_images,
- const EXRHeader** exr_headers,
- unsigned int num_parts,
- unsigned char** memory_out, const char** err) {
- if (exr_images == NULL || exr_headers == NULL || num_parts < 2 ||
- memory_out == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for SaveEXRNPartImageToMemory",
- err);
- return 0;
- }
- return tinyexr::SaveEXRNPartImageToMemory(exr_images, exr_headers, num_parts, memory_out, err);
-}
-
-int SaveEXRMultipartImageToFile(const EXRImage* exr_images,
- const EXRHeader** exr_headers,
- unsigned int num_parts,
- const char* filename,
- const char** err) {
- if (exr_images == NULL || exr_headers == NULL || num_parts < 2) {
- tinyexr::SetErrorMessage("Invalid argument for SaveEXRMultipartImageToFile",
- err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"wb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "wb");
-#endif
-#else
- fp = fopen(filename, "wb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot write a file: " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-
- unsigned char *mem = NULL;
- size_t mem_size = SaveEXRMultipartImageToMemory(exr_images, exr_headers, num_parts, &mem, err);
- if (mem_size == 0) {
- return TINYEXR_ERROR_SERIALZATION_FAILED;
- }
-
- size_t written_size = 0;
- if ((mem_size > 0) && mem) {
- written_size = fwrite(mem, 1, mem_size, fp);
- }
- free(mem);
-
- fclose(fp);
-
- if (written_size != mem_size) {
- tinyexr::SetErrorMessage("Cannot write a file", err);
- return TINYEXR_ERROR_CANT_WRITE_FILE;
- }
-
- return TINYEXR_SUCCESS;
-}
-
-int LoadDeepEXR(DeepImage *deep_image, const char *filename, const char **err) {
- if (deep_image == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for LoadDeepEXR", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
-#ifdef _WIN32
- FILE *fp = NULL;
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot read a file " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read a file " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#else
- FILE *fp = fopen(filename, "rb");
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read a file " + std::string(filename),
- err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#endif
-
- size_t filesize;
- // Compute size
- fseek(fp, 0, SEEK_END);
- filesize = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- if (filesize == 0) {
- fclose(fp);
- tinyexr::SetErrorMessage("File size is zero : " + std::string(filename),
- err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
-
- std::vector<char> buf(filesize); // @todo { use mmap }
- {
- size_t ret;
- ret = fread(&buf[0], 1, filesize, fp);
- assert(ret == filesize);
- (void)ret;
- }
- fclose(fp);
-
- const char *head = &buf[0];
- const char *marker = &buf[0];
-
- // Header check.
- {
- const char header[] = {0x76, 0x2f, 0x31, 0x01};
-
- if (memcmp(marker, header, 4) != 0) {
- tinyexr::SetErrorMessage("Invalid magic number", err);
- return TINYEXR_ERROR_INVALID_MAGIC_NUMBER;
- }
- marker += 4;
- }
-
- // Version, scanline.
- {
- // ver 2.0, scanline, deep bit on(0x800)
- // must be [2, 0, 0, 0]
- if (marker[0] != 2 || marker[1] != 8 || marker[2] != 0 || marker[3] != 0) {
- tinyexr::SetErrorMessage("Unsupported version or scanline", err);
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
- }
-
- marker += 4;
- }
-
- int dx = -1;
- int dy = -1;
- int dw = -1;
- int dh = -1;
- int num_scanline_blocks = 1; // 16 for ZIP compression.
- int compression_type = -1;
- int num_channels = -1;
- std::vector<tinyexr::ChannelInfo> channels;
-
- // Read attributes
- size_t size = filesize - tinyexr::kEXRVersionSize;
- for (;;) {
- if (0 == size) {
- return TINYEXR_ERROR_INVALID_DATA;
- } else if (marker[0] == '\0') {
- marker++;
- size--;
- break;
- }
-
- std::string attr_name;
- std::string attr_type;
- std::vector<unsigned char> data;
- size_t marker_size;
- if (!tinyexr::ReadAttribute(&attr_name, &attr_type, &data, &marker_size,
- marker, size)) {
- std::stringstream ss;
- ss << "Failed to parse attribute\n";
- tinyexr::SetErrorMessage(ss.str(), err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- marker += marker_size;
- size -= marker_size;
-
- if (attr_name.compare("compression") == 0) {
- compression_type = data[0];
- if (compression_type > TINYEXR_COMPRESSIONTYPE_PIZ) {
- std::stringstream ss;
- ss << "Unsupported compression type : " << compression_type;
- tinyexr::SetErrorMessage(ss.str(), err);
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
- }
-
- if (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) {
- num_scanline_blocks = 16;
- }
-
- } else if (attr_name.compare("channels") == 0) {
- // name: zero-terminated string, from 1 to 255 bytes long
- // pixel type: int, possible values are: UINT = 0 HALF = 1 FLOAT = 2
- // pLinear: unsigned char, possible values are 0 and 1
- // reserved: three chars, should be zero
- // xSampling: int
- // ySampling: int
-
- if (!tinyexr::ReadChannelInfo(channels, data)) {
- tinyexr::SetErrorMessage("Failed to parse channel info", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- num_channels = static_cast<int>(channels.size());
-
- if (num_channels < 1) {
- tinyexr::SetErrorMessage("Invalid channels format", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- } else if (attr_name.compare("dataWindow") == 0) {
- memcpy(&dx, &data.at(0), sizeof(int));
- memcpy(&dy, &data.at(4), sizeof(int));
- memcpy(&dw, &data.at(8), sizeof(int));
- memcpy(&dh, &data.at(12), sizeof(int));
- tinyexr::swap4(&dx);
- tinyexr::swap4(&dy);
- tinyexr::swap4(&dw);
- tinyexr::swap4(&dh);
-
- } else if (attr_name.compare("displayWindow") == 0) {
- int x;
- int y;
- int w;
- int h;
- memcpy(&x, &data.at(0), sizeof(int));
- memcpy(&y, &data.at(4), sizeof(int));
- memcpy(&w, &data.at(8), sizeof(int));
- memcpy(&h, &data.at(12), sizeof(int));
- tinyexr::swap4(&x);
- tinyexr::swap4(&y);
- tinyexr::swap4(&w);
- tinyexr::swap4(&h);
- }
- }
-
- assert(dx >= 0);
- assert(dy >= 0);
- assert(dw >= 0);
- assert(dh >= 0);
- assert(num_channels >= 1);
-
- int data_width = dw - dx + 1;
- int data_height = dh - dy + 1;
-
- // Read offset tables.
- int num_blocks = data_height / num_scanline_blocks;
- if (num_blocks * num_scanline_blocks < data_height) {
- num_blocks++;
- }
-
- std::vector<tinyexr::tinyexr_int64> offsets(static_cast<size_t>(num_blocks));
-
- for (size_t y = 0; y < static_cast<size_t>(num_blocks); y++) {
- tinyexr::tinyexr_int64 offset;
- memcpy(&offset, marker, sizeof(tinyexr::tinyexr_int64));
- tinyexr::swap8(reinterpret_cast<tinyexr::tinyexr_uint64 *>(&offset));
- marker += sizeof(tinyexr::tinyexr_int64); // = 8
- offsets[y] = offset;
- }
-
-#if TINYEXR_USE_PIZ
- if ((compression_type == TINYEXR_COMPRESSIONTYPE_NONE) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_PIZ)) {
-#else
- if ((compression_type == TINYEXR_COMPRESSIONTYPE_NONE) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_RLE) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_ZIPS) ||
- (compression_type == TINYEXR_COMPRESSIONTYPE_ZIP)) {
-#endif
- // OK
- } else {
- tinyexr::SetErrorMessage("Unsupported compression format", err);
- return TINYEXR_ERROR_UNSUPPORTED_FORMAT;
- }
-
- deep_image->image = static_cast<float ***>(
- malloc(sizeof(float **) * static_cast<size_t>(num_channels)));
- for (int c = 0; c < num_channels; c++) {
- deep_image->image[c] = static_cast<float **>(
- malloc(sizeof(float *) * static_cast<size_t>(data_height)));
- for (int y = 0; y < data_height; y++) {
- }
- }
-
- deep_image->offset_table = static_cast<int **>(
- malloc(sizeof(int *) * static_cast<size_t>(data_height)));
- for (int y = 0; y < data_height; y++) {
- deep_image->offset_table[y] = static_cast<int *>(
- malloc(sizeof(int) * static_cast<size_t>(data_width)));
- }
-
- for (size_t y = 0; y < static_cast<size_t>(num_blocks); y++) {
- const unsigned char *data_ptr =
- reinterpret_cast<const unsigned char *>(head + offsets[y]);
-
- // int: y coordinate
- // int64: packed size of pixel offset table
- // int64: packed size of sample data
- // int64: unpacked size of sample data
- // compressed pixel offset table
- // compressed sample data
- int line_no;
- tinyexr::tinyexr_int64 packedOffsetTableSize;
- tinyexr::tinyexr_int64 packedSampleDataSize;
- tinyexr::tinyexr_int64 unpackedSampleDataSize;
- memcpy(&line_no, data_ptr, sizeof(int));
- memcpy(&packedOffsetTableSize, data_ptr + 4,
- sizeof(tinyexr::tinyexr_int64));
- memcpy(&packedSampleDataSize, data_ptr + 12,
- sizeof(tinyexr::tinyexr_int64));
- memcpy(&unpackedSampleDataSize, data_ptr + 20,
- sizeof(tinyexr::tinyexr_int64));
-
- tinyexr::swap4(&line_no);
- tinyexr::swap8(
- reinterpret_cast<tinyexr::tinyexr_uint64 *>(&packedOffsetTableSize));
- tinyexr::swap8(
- reinterpret_cast<tinyexr::tinyexr_uint64 *>(&packedSampleDataSize));
- tinyexr::swap8(
- reinterpret_cast<tinyexr::tinyexr_uint64 *>(&unpackedSampleDataSize));
-
- std::vector<int> pixelOffsetTable(static_cast<size_t>(data_width));
-
- // decode pixel offset table.
- {
- unsigned long dstLen =
- static_cast<unsigned long>(pixelOffsetTable.size() * sizeof(int));
- if (!tinyexr::DecompressZip(
- reinterpret_cast<unsigned char *>(&pixelOffsetTable.at(0)),
- &dstLen, data_ptr + 28,
- static_cast<unsigned long>(packedOffsetTableSize))) {
- return false;
- }
-
- assert(dstLen == pixelOffsetTable.size() * sizeof(int));
- for (size_t i = 0; i < static_cast<size_t>(data_width); i++) {
- deep_image->offset_table[y][i] = pixelOffsetTable[i];
- }
- }
-
- std::vector<unsigned char> sample_data(
- static_cast<size_t>(unpackedSampleDataSize));
-
- // decode sample data.
- {
- unsigned long dstLen = static_cast<unsigned long>(unpackedSampleDataSize);
- if (dstLen) {
- if (!tinyexr::DecompressZip(
- reinterpret_cast<unsigned char *>(&sample_data.at(0)), &dstLen,
- data_ptr + 28 + packedOffsetTableSize,
- static_cast<unsigned long>(packedSampleDataSize))) {
- return false;
- }
- assert(dstLen == static_cast<unsigned long>(unpackedSampleDataSize));
- }
- }
-
- // decode sample
- int sampleSize = -1;
- std::vector<int> channel_offset_list(static_cast<size_t>(num_channels));
- {
- int channel_offset = 0;
- for (size_t i = 0; i < static_cast<size_t>(num_channels); i++) {
- channel_offset_list[i] = channel_offset;
- if (channels[i].pixel_type == TINYEXR_PIXELTYPE_UINT) { // UINT
- channel_offset += 4;
- } else if (channels[i].pixel_type == TINYEXR_PIXELTYPE_HALF) { // half
- channel_offset += 2;
- } else if (channels[i].pixel_type ==
- TINYEXR_PIXELTYPE_FLOAT) { // float
- channel_offset += 4;
- } else {
- assert(0);
- }
- }
- sampleSize = channel_offset;
- }
- assert(sampleSize >= 2);
-
- assert(static_cast<size_t>(
- pixelOffsetTable[static_cast<size_t>(data_width - 1)] *
- sampleSize) == sample_data.size());
- int samples_per_line = static_cast<int>(sample_data.size()) / sampleSize;
-
- //
- // Alloc memory
- //
-
- //
- // pixel data is stored as image[channels][pixel_samples]
- //
- {
- tinyexr::tinyexr_uint64 data_offset = 0;
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
- deep_image->image[c][y] = static_cast<float *>(
- malloc(sizeof(float) * static_cast<size_t>(samples_per_line)));
-
- if (channels[c].pixel_type == 0) { // UINT
- for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
- unsigned int ui;
- unsigned int *src_ptr = reinterpret_cast<unsigned int *>(
- &sample_data.at(size_t(data_offset) + x * sizeof(int)));
- tinyexr::cpy4(&ui, src_ptr);
- deep_image->image[c][y][x] = static_cast<float>(ui); // @fixme
- }
- data_offset +=
- sizeof(unsigned int) * static_cast<size_t>(samples_per_line);
- } else if (channels[c].pixel_type == 1) { // half
- for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
- tinyexr::FP16 f16;
- const unsigned short *src_ptr = reinterpret_cast<unsigned short *>(
- &sample_data.at(size_t(data_offset) + x * sizeof(short)));
- tinyexr::cpy2(&(f16.u), src_ptr);
- tinyexr::FP32 f32 = half_to_float(f16);
- deep_image->image[c][y][x] = f32.f;
- }
- data_offset += sizeof(short) * static_cast<size_t>(samples_per_line);
- } else { // float
- for (size_t x = 0; x < static_cast<size_t>(samples_per_line); x++) {
- float f;
- const float *src_ptr = reinterpret_cast<float *>(
- &sample_data.at(size_t(data_offset) + x * sizeof(float)));
- tinyexr::cpy4(&f, src_ptr);
- deep_image->image[c][y][x] = f;
- }
- data_offset += sizeof(float) * static_cast<size_t>(samples_per_line);
- }
- }
- }
- } // y
-
- deep_image->width = data_width;
- deep_image->height = data_height;
-
- deep_image->channel_names = static_cast<const char **>(
- malloc(sizeof(const char *) * static_cast<size_t>(num_channels)));
- for (size_t c = 0; c < static_cast<size_t>(num_channels); c++) {
-#ifdef _WIN32
- deep_image->channel_names[c] = _strdup(channels[c].name.c_str());
-#else
- deep_image->channel_names[c] = strdup(channels[c].name.c_str());
-#endif
- }
- deep_image->num_channels = num_channels;
-
- return TINYEXR_SUCCESS;
-}
-
-void InitEXRImage(EXRImage *exr_image) {
- if (exr_image == NULL) {
- return;
- }
-
- exr_image->width = 0;
- exr_image->height = 0;
- exr_image->num_channels = 0;
-
- exr_image->images = NULL;
- exr_image->tiles = NULL;
- exr_image->next_level = NULL;
- exr_image->level_x = 0;
- exr_image->level_y = 0;
-
- exr_image->num_tiles = 0;
-}
-
-void FreeEXRErrorMessage(const char *msg) {
- if (msg) {
- free(reinterpret_cast<void *>(const_cast<char *>(msg)));
- }
- return;
-}
-
-void InitEXRHeader(EXRHeader *exr_header) {
- if (exr_header == NULL) {
- return;
- }
-
- memset(exr_header, 0, sizeof(EXRHeader));
-}
-
-int FreeEXRHeader(EXRHeader *exr_header) {
- if (exr_header == NULL) {
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (exr_header->channels) {
- free(exr_header->channels);
- }
-
- if (exr_header->pixel_types) {
- free(exr_header->pixel_types);
- }
-
- if (exr_header->requested_pixel_types) {
- free(exr_header->requested_pixel_types);
- }
-
- for (int i = 0; i < exr_header->num_custom_attributes; i++) {
- if (exr_header->custom_attributes[i].value) {
- free(exr_header->custom_attributes[i].value);
- }
- }
-
- if (exr_header->custom_attributes) {
- free(exr_header->custom_attributes);
- }
-
- EXRSetNameAttr(exr_header, NULL);
-
- return TINYEXR_SUCCESS;
-}
-
-void EXRSetNameAttr(EXRHeader* exr_header, const char* name) {
- if (exr_header == NULL) {
- return;
- }
- memset(exr_header->name, 0, 256);
- if (name != NULL) {
- size_t len = std::min(strlen(name), (size_t)255);
- if (len) {
- memcpy(exr_header->name, name, len);
- }
- }
-}
-
-int EXRNumLevels(const EXRImage* exr_image) {
- if (exr_image == NULL) return 0;
- if(exr_image->images) return 1; // scanlines
- int levels = 1;
- const EXRImage* level_image = exr_image;
- while((level_image = level_image->next_level)) ++levels;
- return levels;
-}
-
-int FreeEXRImage(EXRImage *exr_image) {
- if (exr_image == NULL) {
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (exr_image->next_level) {
- FreeEXRImage(exr_image->next_level);
- delete exr_image->next_level;
- }
-
- for (int i = 0; i < exr_image->num_channels; i++) {
- if (exr_image->images && exr_image->images[i]) {
- free(exr_image->images[i]);
- }
- }
-
- if (exr_image->images) {
- free(exr_image->images);
- }
-
- if (exr_image->tiles) {
- for (int tid = 0; tid < exr_image->num_tiles; tid++) {
- for (int i = 0; i < exr_image->num_channels; i++) {
- if (exr_image->tiles[tid].images && exr_image->tiles[tid].images[i]) {
- free(exr_image->tiles[tid].images[i]);
- }
- }
- if (exr_image->tiles[tid].images) {
- free(exr_image->tiles[tid].images);
- }
- }
- free(exr_image->tiles);
- }
-
- return TINYEXR_SUCCESS;
-}
-
-int ParseEXRHeaderFromFile(EXRHeader *exr_header, const EXRVersion *exr_version,
- const char *filename, const char **err) {
- if (exr_header == NULL || exr_version == NULL || filename == NULL) {
- tinyexr::SetErrorMessage("Invalid argument for ParseEXRHeaderFromFile",
- err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
-#else
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-
- size_t filesize;
- // Compute size
- fseek(fp, 0, SEEK_END);
- filesize = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- std::vector<unsigned char> buf(filesize); // @todo { use mmap }
- {
- size_t ret;
- ret = fread(&buf[0], 1, filesize, fp);
- assert(ret == filesize);
- fclose(fp);
-
- if (ret != filesize) {
- tinyexr::SetErrorMessage("fread() error on " + std::string(filename),
- err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
- }
-
- return ParseEXRHeaderFromMemory(exr_header, exr_version, &buf.at(0), filesize,
- err);
-}
-
-int ParseEXRMultipartHeaderFromMemory(EXRHeader ***exr_headers,
- int *num_headers,
- const EXRVersion *exr_version,
- const unsigned char *memory, size_t size,
- const char **err) {
- if (memory == NULL || exr_headers == NULL || num_headers == NULL ||
- exr_version == NULL) {
- // Invalid argument
- tinyexr::SetErrorMessage(
- "Invalid argument for ParseEXRMultipartHeaderFromMemory", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (size < tinyexr::kEXRVersionSize) {
- tinyexr::SetErrorMessage("Data size too short", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- const unsigned char *marker = memory + tinyexr::kEXRVersionSize;
- size_t marker_size = size - tinyexr::kEXRVersionSize;
-
- std::vector<tinyexr::HeaderInfo> infos;
-
- for (;;) {
- tinyexr::HeaderInfo info;
- info.clear();
-
- std::string err_str;
- bool empty_header = false;
- int ret = ParseEXRHeader(&info, &empty_header, exr_version, &err_str,
- marker, marker_size);
-
- if (ret != TINYEXR_SUCCESS) {
- tinyexr::SetErrorMessage(err_str, err);
- return ret;
- }
-
- if (empty_header) {
- marker += 1; // skip '\0'
- break;
- }
-
- // `chunkCount` must exist in the header.
- if (info.chunk_count == 0) {
- tinyexr::SetErrorMessage(
- "`chunkCount' attribute is not found in the header.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- infos.push_back(info);
-
- // move to next header.
- marker += info.header_len;
- size -= info.header_len;
- }
-
- // allocate memory for EXRHeader and create array of EXRHeader pointers.
- (*exr_headers) =
- static_cast<EXRHeader **>(malloc(sizeof(EXRHeader *) * infos.size()));
- for (size_t i = 0; i < infos.size(); i++) {
- EXRHeader *exr_header = static_cast<EXRHeader *>(malloc(sizeof(EXRHeader)));
- memset(exr_header, 0, sizeof(EXRHeader));
-
- ConvertHeader(exr_header, infos[i]);
-
- exr_header->multipart = exr_version->multipart ? 1 : 0;
-
- (*exr_headers)[i] = exr_header;
- }
-
- (*num_headers) = static_cast<int>(infos.size());
-
- return TINYEXR_SUCCESS;
-}
-
-int ParseEXRMultipartHeaderFromFile(EXRHeader ***exr_headers, int *num_headers,
- const EXRVersion *exr_version,
- const char *filename, const char **err) {
- if (exr_headers == NULL || num_headers == NULL || exr_version == NULL ||
- filename == NULL) {
- tinyexr::SetErrorMessage(
- "Invalid argument for ParseEXRMultipartHeaderFromFile()", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
-#else
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-
- size_t filesize;
- // Compute size
- fseek(fp, 0, SEEK_END);
- filesize = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- std::vector<unsigned char> buf(filesize); // @todo { use mmap }
- {
- size_t ret;
- ret = fread(&buf[0], 1, filesize, fp);
- assert(ret == filesize);
- fclose(fp);
-
- if (ret != filesize) {
- tinyexr::SetErrorMessage("`fread' error. file may be corrupted.", err);
- return TINYEXR_ERROR_INVALID_FILE;
- }
- }
-
- return ParseEXRMultipartHeaderFromMemory(
- exr_headers, num_headers, exr_version, &buf.at(0), filesize, err);
-}
-
-int ParseEXRVersionFromMemory(EXRVersion *version, const unsigned char *memory,
- size_t size) {
- if (version == NULL || memory == NULL) {
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- if (size < tinyexr::kEXRVersionSize) {
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- const unsigned char *marker = memory;
-
- // Header check.
- {
- const char header[] = {0x76, 0x2f, 0x31, 0x01};
-
- if (memcmp(marker, header, 4) != 0) {
- return TINYEXR_ERROR_INVALID_MAGIC_NUMBER;
- }
- marker += 4;
- }
-
- version->tiled = false;
- version->long_name = false;
- version->non_image = false;
- version->multipart = false;
-
- // Parse version header.
- {
- // must be 2
- if (marker[0] != 2) {
- return TINYEXR_ERROR_INVALID_EXR_VERSION;
- }
-
- if (version == NULL) {
- return TINYEXR_SUCCESS; // May OK
- }
-
- version->version = 2;
-
- if (marker[1] & 0x2) { // 9th bit
- version->tiled = true;
- }
- if (marker[1] & 0x4) { // 10th bit
- version->long_name = true;
- }
- if (marker[1] & 0x8) { // 11th bit
- version->non_image = true; // (deep image)
- }
- if (marker[1] & 0x10) { // 12th bit
- version->multipart = true;
- }
- }
-
- return TINYEXR_SUCCESS;
-}
-
-int ParseEXRVersionFromFile(EXRVersion *version, const char *filename) {
- if (filename == NULL) {
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t err = _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (err != 0) {
- // TODO(syoyo): return wfopen_s erro code
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
-#else
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-
- size_t file_size;
- // Compute size
- fseek(fp, 0, SEEK_END);
- file_size = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- if (file_size < tinyexr::kEXRVersionSize) {
- return TINYEXR_ERROR_INVALID_FILE;
- }
-
- unsigned char buf[tinyexr::kEXRVersionSize];
- size_t ret = fread(&buf[0], 1, tinyexr::kEXRVersionSize, fp);
- fclose(fp);
-
- if (ret != tinyexr::kEXRVersionSize) {
- return TINYEXR_ERROR_INVALID_FILE;
- }
-
- return ParseEXRVersionFromMemory(version, buf, tinyexr::kEXRVersionSize);
-}
-
-int LoadEXRMultipartImageFromMemory(EXRImage *exr_images,
- const EXRHeader **exr_headers,
- unsigned int num_parts,
- const unsigned char *memory,
- const size_t size, const char **err) {
- if (exr_images == NULL || exr_headers == NULL || num_parts == 0 ||
- memory == NULL || (size <= tinyexr::kEXRVersionSize)) {
- tinyexr::SetErrorMessage(
- "Invalid argument for LoadEXRMultipartImageFromMemory()", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- // compute total header size.
- size_t total_header_size = 0;
- for (unsigned int i = 0; i < num_parts; i++) {
- if (exr_headers[i]->header_len == 0) {
- tinyexr::SetErrorMessage("EXRHeader variable is not initialized.", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- total_header_size += exr_headers[i]->header_len;
- }
-
- const char *marker = reinterpret_cast<const char *>(
- memory + total_header_size + 4 +
- 4); // +8 for magic number and version header.
-
- marker += 1; // Skip empty header.
-
- // NOTE 1:
- // In multipart image, There is 'part number' before chunk data.
- // 4 byte : part number
- // 4+ : chunk
- //
- // NOTE 2:
- // EXR spec says 'part number' is 'unsigned long' but actually this is
- // 'unsigned int(4 bytes)' in OpenEXR implementation...
- // http://www.openexr.com/openexrfilelayout.pdf
-
- // Load chunk offset table.
- std::vector<tinyexr::OffsetData> chunk_offset_table_list;
- chunk_offset_table_list.reserve(num_parts);
- for (size_t i = 0; i < static_cast<size_t>(num_parts); i++) {
- chunk_offset_table_list.resize(chunk_offset_table_list.size() + 1);
- tinyexr::OffsetData& offset_data = chunk_offset_table_list.back();
- if (!exr_headers[i]->tiled || exr_headers[i]->tile_level_mode == TINYEXR_TILE_ONE_LEVEL) {
- tinyexr::InitSingleResolutionOffsets(offset_data, exr_headers[i]->chunk_count);
- std::vector<tinyexr::tinyexr_uint64>& offset_table = offset_data.offsets[0][0];
-
- for (size_t c = 0; c < offset_table.size(); c++) {
- tinyexr::tinyexr_uint64 offset;
- memcpy(&offset, marker, 8);
- tinyexr::swap8(&offset);
-
- if (offset >= size) {
- tinyexr::SetErrorMessage("Invalid offset size in EXR header chunks.",
- err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
-
- offset_table[c] = offset + 4; // +4 to skip 'part number'
- marker += 8;
- }
- } else {
- {
- std::vector<int> num_x_tiles, num_y_tiles;
- tinyexr::PrecalculateTileInfo(num_x_tiles, num_y_tiles, exr_headers[i]);
- int num_blocks = InitTileOffsets(offset_data, exr_headers[i], num_x_tiles, num_y_tiles);
- if (num_blocks != exr_headers[i]->chunk_count) {
- tinyexr::SetErrorMessage("Invalid offset table size.", err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l) {
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy) {
- for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx) {
- tinyexr::tinyexr_uint64 offset;
- memcpy(&offset, marker, sizeof(tinyexr::tinyexr_uint64));
- tinyexr::swap8(&offset);
- if (offset >= size) {
- tinyexr::SetErrorMessage("Invalid offset size in EXR header chunks.",
- err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- offset_data.offsets[l][dy][dx] = offset + 4; // +4 to skip 'part number'
- marker += sizeof(tinyexr::tinyexr_uint64); // = 8
- }
- }
- }
- }
- }
-
- // Decode image.
- for (size_t i = 0; i < static_cast<size_t>(num_parts); i++) {
- tinyexr::OffsetData &offset_data = chunk_offset_table_list[i];
-
- // First check 'part number' is identitical to 'i'
- for (unsigned int l = 0; l < offset_data.offsets.size(); ++l)
- for (unsigned int dy = 0; dy < offset_data.offsets[l].size(); ++dy)
- for (unsigned int dx = 0; dx < offset_data.offsets[l][dy].size(); ++dx) {
-
- const unsigned char *part_number_addr =
- memory + offset_data.offsets[l][dy][dx] - 4; // -4 to move to 'part number' field.
- unsigned int part_no;
- memcpy(&part_no, part_number_addr, sizeof(unsigned int)); // 4
- tinyexr::swap4(&part_no);
-
- if (part_no != i) {
- tinyexr::SetErrorMessage("Invalid `part number' in EXR header chunks.",
- err);
- return TINYEXR_ERROR_INVALID_DATA;
- }
- }
-
- std::string e;
- int ret = tinyexr::DecodeChunk(&exr_images[i], exr_headers[i], offset_data,
- memory, size, &e);
- if (ret != TINYEXR_SUCCESS) {
- if (!e.empty()) {
- tinyexr::SetErrorMessage(e, err);
- }
- return ret;
- }
- }
-
- return TINYEXR_SUCCESS;
-}
-
-int LoadEXRMultipartImageFromFile(EXRImage *exr_images,
- const EXRHeader **exr_headers,
- unsigned int num_parts, const char *filename,
- const char **err) {
- if (exr_images == NULL || exr_headers == NULL || num_parts == 0) {
- tinyexr::SetErrorMessage(
- "Invalid argument for LoadEXRMultipartImageFromFile", err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- FILE *fp = NULL;
-#ifdef _WIN32
-#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API) // MSVC, MinGW GCC, or Clang.
- errno_t errcode =
- _wfopen_s(&fp, tinyexr::UTF8ToWchar(filename).c_str(), L"rb");
- if (errcode != 0) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-#else
- // Unknown compiler or MinGW without MINGW_HAS_SECURE_API.
- fp = fopen(filename, "rb");
-#endif
-#else
- fp = fopen(filename, "rb");
-#endif
- if (!fp) {
- tinyexr::SetErrorMessage("Cannot read file " + std::string(filename), err);
- return TINYEXR_ERROR_CANT_OPEN_FILE;
- }
-
- size_t filesize;
- // Compute size
- fseek(fp, 0, SEEK_END);
- filesize = static_cast<size_t>(ftell(fp));
- fseek(fp, 0, SEEK_SET);
-
- std::vector<unsigned char> buf(filesize); // @todo { use mmap }
- {
- size_t ret;
- ret = fread(&buf[0], 1, filesize, fp);
- assert(ret == filesize);
- fclose(fp);
- (void)ret;
- }
-
- return LoadEXRMultipartImageFromMemory(exr_images, exr_headers, num_parts,
- &buf.at(0), filesize, err);
-}
-
-int SaveEXR(const float *data, int width, int height, int components,
- const int save_as_fp16, const char *outfilename, const char **err) {
- if ((components == 1) || components == 3 || components == 4) {
- // OK
- } else {
- std::stringstream ss;
- ss << "Unsupported component value : " << components << std::endl;
-
- tinyexr::SetErrorMessage(ss.str(), err);
- return TINYEXR_ERROR_INVALID_ARGUMENT;
- }
-
- EXRHeader header;
- InitEXRHeader(&header);
-
- if ((width < 16) && (height < 16)) {
- // No compression for small image.
- header.compression_type = TINYEXR_COMPRESSIONTYPE_NONE;
- } else {
- header.compression_type = TINYEXR_COMPRESSIONTYPE_ZIP;
- }
-
- EXRImage image;
- InitEXRImage(&image);
-
- image.num_channels = components;
-
- std::vector<float> images[4];
-
- if (components == 1) {
- images[0].resize(static_cast<size_t>(width * height));
- memcpy(images[0].data(), data, sizeof(float) * size_t(width * height));
- } else {
- images[0].resize(static_cast<size_t>(width * height));
- images[1].resize(static_cast<size_t>(width * height));
- images[2].resize(static_cast<size_t>(width * height));
- images[3].resize(static_cast<size_t>(width * height));
-
- // Split RGB(A)RGB(A)RGB(A)... into R, G and B(and A) layers
- for (size_t i = 0; i < static_cast<size_t>(width * height); i++) {
- images[0][i] = data[static_cast<size_t>(components) * i + 0];
- images[1][i] = data[static_cast<size_t>(components) * i + 1];
- images[2][i] = data[static_cast<size_t>(components) * i + 2];
- if (components == 4) {
- images[3][i] = data[static_cast<size_t>(components) * i + 3];
- }
- }
- }
-
- float *image_ptr[4] = {0, 0, 0, 0};
- if (components == 4) {
- image_ptr[0] = &(images[3].at(0)); // A
- image_ptr[1] = &(images[2].at(0)); // B
- image_ptr[2] = &(images[1].at(0)); // G
- image_ptr[3] = &(images[0].at(0)); // R
- } else if (components == 3) {
- image_ptr[0] = &(images[2].at(0)); // B
- image_ptr[1] = &(images[1].at(0)); // G
- image_ptr[2] = &(images[0].at(0)); // R
- } else if (components == 1) {
- image_ptr[0] = &(images[0].at(0)); // A
- }
-
- image.images = reinterpret_cast<unsigned char **>(image_ptr);
- image.width = width;
- image.height = height;
-
- header.num_channels = components;
- header.channels = static_cast<EXRChannelInfo *>(malloc(
- sizeof(EXRChannelInfo) * static_cast<size_t>(header.num_channels)));
- // Must be (A)BGR order, since most of EXR viewers expect this channel order.
- if (components == 4) {
-#ifdef _MSC_VER
- strncpy_s(header.channels[0].name, "A", 255);
- strncpy_s(header.channels[1].name, "B", 255);
- strncpy_s(header.channels[2].name, "G", 255);
- strncpy_s(header.channels[3].name, "R", 255);
-#else
- strncpy(header.channels[0].name, "A", 255);
- strncpy(header.channels[1].name, "B", 255);
- strncpy(header.channels[2].name, "G", 255);
- strncpy(header.channels[3].name, "R", 255);
-#endif
- header.channels[0].name[strlen("A")] = '\0';
- header.channels[1].name[strlen("B")] = '\0';
- header.channels[2].name[strlen("G")] = '\0';
- header.channels[3].name[strlen("R")] = '\0';
- } else if (components == 3) {
-#ifdef _MSC_VER
- strncpy_s(header.channels[0].name, "B", 255);
- strncpy_s(header.channels[1].name, "G", 255);
- strncpy_s(header.channels[2].name, "R", 255);
-#else
- strncpy(header.channels[0].name, "B", 255);
- strncpy(header.channels[1].name, "G", 255);
- strncpy(header.channels[2].name, "R", 255);
-#endif
- header.channels[0].name[strlen("B")] = '\0';
- header.channels[1].name[strlen("G")] = '\0';
- header.channels[2].name[strlen("R")] = '\0';
- } else {
-#ifdef _MSC_VER
- strncpy_s(header.channels[0].name, "A", 255);
-#else
- strncpy(header.channels[0].name, "A", 255);
-#endif
- header.channels[0].name[strlen("A")] = '\0';
- }
-
- header.pixel_types = static_cast<int *>(
- malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
- header.requested_pixel_types = static_cast<int *>(
- malloc(sizeof(int) * static_cast<size_t>(header.num_channels)));
- for (int i = 0; i < header.num_channels; i++) {
- header.pixel_types[i] =
- TINYEXR_PIXELTYPE_FLOAT; // pixel type of input image
-
- if (save_as_fp16 > 0) {
- header.requested_pixel_types[i] =
- TINYEXR_PIXELTYPE_HALF; // save with half(fp16) pixel format
- } else {
- header.requested_pixel_types[i] =
- TINYEXR_PIXELTYPE_FLOAT; // save with float(fp32) pixel format(i.e.
- // no precision reduction)
- }
- }
-
- int ret = SaveEXRImageToFile(&image, &header, outfilename, err);
- if (ret != TINYEXR_SUCCESS) {
- return ret;
- }
-
- free(header.channels);
- free(header.pixel_types);
- free(header.requested_pixel_types);
-
- return ret;
-}
-
-#ifdef __clang__
-// zero-as-null-ppinter-constant
-#pragma clang diagnostic pop
-#endif
-
-#endif // TINYEXR_IMPLEMENTATION_DEFINED
-#endif // TINYEXR_IMPLEMENTATION
diff --git a/graphics/asymptote/cudareflect/tinyexr/vcbuild.bat b/graphics/asymptote/cudareflect/tinyexr/vcbuild.bat
deleted file mode 100644
index c465052f2b..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/vcbuild.bat
+++ /dev/null
@@ -1,11 +0,0 @@
-rem Run
-rem
-rem > python.py kuroga.py config-msvc.py
-rem
-rem before to generate build.ninja
-rem
-
-chcp 437
-rem call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86_amd64
-call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x86_amd64
-ninja
diff --git a/graphics/asymptote/cudareflect/tinyexr/vcsetup2019.bat b/graphics/asymptote/cudareflect/tinyexr/vcsetup2019.bat
deleted file mode 100644
index 799f6da780..0000000000
--- a/graphics/asymptote/cudareflect/tinyexr/vcsetup2019.bat
+++ /dev/null
@@ -1,4 +0,0 @@
-rmdir /q /s build
-mkdir build
-
-cmake.exe -G "Visual Studio 16 2019" -A x64 -Bbuild .
diff --git a/graphics/asymptote/cxxtests/CMakeLists.txt b/graphics/asymptote/cxxtests/CMakeLists.txt
new file mode 100644
index 0000000000..a8316cb134
--- /dev/null
+++ b/graphics/asymptote/cxxtests/CMakeLists.txt
@@ -0,0 +1,21 @@
+if (NOT ENABLE_ASY_CXXTEST)
+ message(FATAL_ERROR "cxxtests require asy-cxxtest enabled")
+endif()
+
+set(TEST_CXX_SRC_ROOT ${CMAKE_CURRENT_LIST_DIR})
+
+include(${TEST_CXX_SRC_ROOT}/cmake-scripts/external-libs.cmake)
+include(${TEST_CXX_SRC_ROOT}/cmake-scripts/tests.cmake)
+
+# test target
+
+add_executable(asyCxxTests ${ASY_TEST_SOURCES} ${TEST_CXX_SRC_ROOT}/src/testMain.cc)
+target_include_directories(
+ asyCxxTests
+ PRIVATE ${TEST_CXX_SRC_ROOT}/include
+)
+target_link_libraries(asyCxxTests
+ PRIVATE asycore GTest::gtest GTest::gmock)
+
+include(GoogleTest)
+gtest_discover_tests(asyCxxTests TEST_PREFIX cxxtests.)
diff --git a/graphics/asymptote/cxxtests/cmake-scripts/external-libs.cmake b/graphics/asymptote/cxxtests/cmake-scripts/external-libs.cmake
new file mode 100644
index 0000000000..4cda46f6e8
--- /dev/null
+++ b/graphics/asymptote/cxxtests/cmake-scripts/external-libs.cmake
@@ -0,0 +1,19 @@
+# Use directly downloaded library because vcpkg's version has some
+# linking issues with windows + clang64-msys2
+
+if (DOWNLOAD_GTEST_FROM_SRC)
+ include(FetchContent)
+ FetchContent_Declare(
+ googletest
+ GIT_REPOSITORY https://github.com/google/googletest
+ GIT_TAG v1.14.0
+ )
+
+ if (WIN32)
+ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
+ endif()
+
+ FetchContent_MakeAvailable(googletest)
+else()
+ find_package(GTest REQUIRED)
+endif()
diff --git a/graphics/asymptote/cxxtests/cmake-scripts/tests.cmake b/graphics/asymptote/cxxtests/cmake-scripts/tests.cmake
new file mode 100644
index 0000000000..d76bcf7f3c
--- /dev/null
+++ b/graphics/asymptote/cxxtests/cmake-scripts/tests.cmake
@@ -0,0 +1,12 @@
+# add tests here
+
+set(ASY_CXX_TESTS
+ placeholder
+)
+
+# ----- transform tests --------
+list(TRANSFORM ASY_CXX_TESTS APPEND .cc)
+list(TRANSFORM ASY_CXX_TESTS
+ PREPEND ${TEST_CXX_SRC_ROOT}/tests/
+ OUTPUT_VARIABLE ASY_TEST_SOURCES
+)
diff --git a/graphics/asymptote/cxxtests/include/asycxxtests/common.h b/graphics/asymptote/cxxtests/include/asycxxtests/common.h
new file mode 100644
index 0000000000..6a0640d082
--- /dev/null
+++ b/graphics/asymptote/cxxtests/include/asycxxtests/common.h
@@ -0,0 +1,9 @@
+/**
+ * @param asycxxtests/common.h
+ * @brief Common header file for all asymptote C++-side testing
+ */
+
+#pragma once
+
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
diff --git a/graphics/asymptote/cxxtests/src/testMain.cc b/graphics/asymptote/cxxtests/src/testMain.cc
new file mode 100644
index 0000000000..596daa3ce9
--- /dev/null
+++ b/graphics/asymptote/cxxtests/src/testMain.cc
@@ -0,0 +1,14 @@
+#include <gtest/gtest.h>
+#include <gmock/gmock.h>
+#include "common.h"
+
+int main(int argc, char* argv[])
+{
+#if defined(USEGC)
+ GC_init();
+#endif
+
+ ::testing::InitGoogleTest(&argc,argv);
+ ::testing::InitGoogleMock(&argc,argv);
+ return RUN_ALL_TESTS();
+}
diff --git a/graphics/asymptote/cxxtests/tests/placeholder.cc b/graphics/asymptote/cxxtests/tests/placeholder.cc
new file mode 100644
index 0000000000..938775294b
--- /dev/null
+++ b/graphics/asymptote/cxxtests/tests/placeholder.cc
@@ -0,0 +1,8 @@
+#include "asycxxtests/common.h"
+
+#define TESTING_FILE_NAME placeholder
+
+TEST(TESTING_FILE_NAME, alwaysTrue)
+{
+ ASSERT_TRUE(1==1);
+}
diff --git a/graphics/asymptote/dec.cc b/graphics/asymptote/dec.cc
index 8b48479485..e928fd999d 100644
--- a/graphics/asymptote/dec.cc
+++ b/graphics/asymptote/dec.cc
@@ -17,7 +17,7 @@
#include "modifier.h"
#include "runtime.h"
#include "locate.h"
-#include "parser.h"
+#include "asyparser.h"
// #include "builtin.h" // for trans::addRecordOps
namespace absyntax {
diff --git a/graphics/asymptote/determine_pkg_info.py b/graphics/asymptote/determine_pkg_info.py
new file mode 100644
index 0000000000..722b3333dd
--- /dev/null
+++ b/graphics/asymptote/determine_pkg_info.py
@@ -0,0 +1,78 @@
+#!/usr/bin/env python3
+__doc__ = """
+Determine package version information from configure.ac file for Asymptote
+"""
+__author__ = "Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>"
+
+import os
+import pathlib
+from typing import TextIO
+import re
+
+REGEXES: dict[str, re.Pattern[str]] = {
+ "base": re.compile(
+ r"AC_INIT\(\s*\[\s*(.+)\s*]\s*," # pkg name
+ + r"\s*\[\s*(.+)\s*]\s*," # pkg version
+ + r"\s*\[\s*(.+)\s*]\s*\)" # issue url
+ ),
+ "asygl": re.compile(r"ASYGLVERSION\s*=\s*(.+)"),
+}
+
+
+def process_configure_ac_file(f: TextIO) -> dict:
+ """
+ Returns a dictionary containing version information, if found
+ from the configure.ac file object
+ """
+ regexes_to_search = dict(REGEXES)
+ result = dict()
+ for line in f:
+ if not regexes_to_search:
+ return result # done now, can return
+ regex_result = {key: val.match(line) for key, val in regexes_to_search.items()}
+ regex_result_not_none: dict[str, re.Match[str]] = {
+ key: val for key, val in regex_result.items() if val is not None
+ }
+ for key, match_obj in regex_result_not_none.items():
+ regexes_to_search.pop(key)
+ if key == "base":
+ result.update(
+ {
+ "name": match_obj.group(1),
+ "version-base": match_obj.group(2),
+ "issue-url": match_obj.group(3),
+ }
+ )
+ if key == "asygl":
+ result["asygl-version"] = match_obj.group(1)
+ return result
+
+
+def determine_asy_pkg_info(ac_file: os.PathLike = "configure.ac") -> dict:
+ """
+ Returns a dictionary containing version information, if found
+ from the ac_file specified
+ """
+ with open(
+ ac_file,
+ "r",
+ encoding="utf-8",
+ ) as f:
+ return process_configure_ac_file(f)
+
+
+def main():
+ pkg_version_info = determine_asy_pkg_info(
+ pathlib.Path(__file__).parent / "configure.ac"
+ )
+ version_tuple = (
+ pkg_version_info.get("name", "NAME-UNKNOWN"),
+ pkg_version_info.get("version-base", "VERSION-UNKNOWN"),
+ pkg_version_info.get("issue-url", "ISSUE-URL-UNKNOWN"),
+ pkg_version_info.get("asygl-version", "ASYGL-UNKNOWN"),
+ )
+ print(";".join(version_tuple), end="")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/doc/CAD.pdf b/graphics/asymptote/doc/CAD.pdf
index 4702f7216d..a09a8bcb33 100644
--- a/graphics/asymptote/doc/CAD.pdf
+++ b/graphics/asymptote/doc/CAD.pdf
Binary files differ
diff --git a/graphics/asymptote/doc/FAQ/asy-faq.info b/graphics/asymptote/doc/FAQ/asy-faq.info
index 9467905ebb..8ecd3ea8f8 100644
--- a/graphics/asymptote/doc/FAQ/asy-faq.info
+++ b/graphics/asymptote/doc/FAQ/asy-faq.info
@@ -10,7 +10,7 @@ END-INFO-DIR-ENTRY
File: asy-faq.info, Node: Top, Next: Question 1.1, Up: (dir)
ASYMPTOTE FREQUENTLY ASKED QUESTIONS
- 2024-10-07
+ 2024-11-11
This is the list of Frequently Asked Questions about Asymptote (asy).
diff --git a/graphics/asymptote/doc/TeXShopAndAsymptote.pdf b/graphics/asymptote/doc/TeXShopAndAsymptote.pdf
index 76778796d5..132b3b214f 100644
--- a/graphics/asymptote/doc/TeXShopAndAsymptote.pdf
+++ b/graphics/asymptote/doc/TeXShopAndAsymptote.pdf
Binary files differ
diff --git a/graphics/asymptote/doc/asy-latex.pdf b/graphics/asymptote/doc/asy-latex.pdf
index 9e7522006a..9c12644699 100644
--- a/graphics/asymptote/doc/asy-latex.pdf
+++ b/graphics/asymptote/doc/asy-latex.pdf
Binary files differ
diff --git a/graphics/asymptote/doc/asy.1 b/graphics/asymptote/doc/asy.1
index ca1a45e120..8084d8dcf3 100644
--- a/graphics/asymptote/doc/asy.1
+++ b/graphics/asymptote/doc/asy.1
@@ -370,9 +370,6 @@ Use webgl2 if available [false].
.B \-where
Show where listed variables are declared [false].
.TP
-.B \-wsl
-Run asy under the Windows Subsystem for Linux [false].
-.TP
.B \-xasy
Interactive mode for xasy [false].
.TP
diff --git a/graphics/asymptote/doc/asyRefCard.pdf b/graphics/asymptote/doc/asyRefCard.pdf
index bbecbf9342..2107cfcba9 100644
--- a/graphics/asymptote/doc/asyRefCard.pdf
+++ b/graphics/asymptote/doc/asyRefCard.pdf
Binary files differ
diff --git a/graphics/asymptote/doc/asymptote.pdf b/graphics/asymptote/doc/asymptote.pdf
index 9da6092d4e..2b1a4d7c42 100644
--- a/graphics/asymptote/doc/asymptote.pdf
+++ b/graphics/asymptote/doc/asymptote.pdf
Binary files differ
diff --git a/graphics/asymptote/doc/asymptote.texi b/graphics/asymptote/doc/asymptote.texi
index 61e6bbb962..824b12b7e3 100644
--- a/graphics/asymptote/doc/asymptote.texi
+++ b/graphics/asymptote/doc/asymptote.texi
@@ -10046,6 +10046,10 @@ and the @code{librsvg} package on @code{MacOS X}; under
@url{https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z}
+Ensure that @code{rsvg-convert} is available in @code{PATH}, or
+specify the location of @code{rsvg-convert} in @code{rsvgConverterPath}
+option within @code{xasy}'s settings.
+
@cindex @code{dvisvgmMultipleFiles}
Deconstruction of a picture into its components is fastest when using
the @code{LaTeX} TeX engine. The default setting
diff --git a/graphics/asymptote/doc/build-asymptote-pdf-win.py b/graphics/asymptote/doc/build-asymptote-pdf-win.py
new file mode 100644
index 0000000000..63a7089716
--- /dev/null
+++ b/graphics/asymptote/doc/build-asymptote-pdf-win.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python3
+import argparse
+import os
+import subprocess
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--texify-loc", required=True)
+ parser.add_argument("--texindex-loc", required=True)
+ parser.add_argument("--texi-file", required=True)
+ return parser.parse_args()
+
+
+def main():
+ args = parse_args()
+ env = os.environ.copy()
+ env["TEXINDEX"] = args.texindex_loc
+ subprocess.run(
+ [args.texify_loc, "--pdf", args.texi_file],
+ env=env,
+ check=True,
+ )
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/doc/build-latexusage-pdf.py b/graphics/asymptote/doc/build-latexusage-pdf.py
new file mode 100644
index 0000000000..22ed5eebf1
--- /dev/null
+++ b/graphics/asymptote/doc/build-latexusage-pdf.py
@@ -0,0 +1,103 @@
+#!/usr/bin/env python3
+
+import argparse
+import contextlib
+import os
+import pathlib
+import sys
+import shutil
+import subprocess as sp
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--build-dir", type=str, default=".")
+ parser.add_argument("--latexusage-name", type=str, default="latexusage")
+ parser.add_argument("--latexusage-source-dir", type=str, required=True)
+ parser.add_argument("--pdflatex-executable", type=str, default="pdflatex")
+ parser.add_argument("--asy-executable", type=str, default="asy")
+ parser.add_argument("--asy-base-dir", type=str, required=True)
+ return parser.parse_args()
+
+
+def print_called_process_error(e: sp.CalledProcessError):
+ if e.stderr is not None:
+ sys.stderr.write("Process stderr:\n")
+ sys.stderr.write(e.stderr)
+
+ if e.stdout is not None:
+ sys.stderr.write("Process output:\n")
+ sys.stderr.write(e.stdout)
+ sys.stderr.flush()
+
+
+def clean_artifacts(buildroot_path: pathlib.Path, latexusage_file_prefix: str):
+ if (buildroot_path / (latexusage_file_prefix + ".tex")).is_file():
+ os.remove((buildroot_path / (latexusage_file_prefix + ".tex")))
+ for asyartifacts in buildroot_path.glob("latexusage-*"):
+ os.remove(asyartifacts)
+ for exts in ["pre", "aux", "out"]:
+ with contextlib.suppress(FileNotFoundError):
+ os.remove(buildroot_path / (latexusage_file_prefix + "." + exts))
+
+
+def run_pdflatex(
+ pdflatex_exec: str, buildroot_path: pathlib.Path, latexusage_name: str
+):
+ sp.run(
+ [pdflatex_exec, latexusage_name + ".tex"],
+ text=True,
+ cwd=buildroot_path,
+ check=True,
+ )
+
+
+def main():
+ args = parse_args()
+ buildroot_path = pathlib.Path(args.build_dir)
+ clean_artifacts(buildroot_path, args.latexusage_name)
+
+ # copy latexusage.pdf to build root, since TeX Live has some issues with
+ # out of source builds
+
+ shutil.copy2(
+ pathlib.Path(args.latexusage_source_dir) / (args.latexusage_name + ".tex"),
+ buildroot_path / (args.latexusage_name + ".tex"),
+ )
+
+ asy_base_dir = pathlib.Path(args.asy_base_dir)
+ asy_base_args = [
+ args.asy_executable,
+ "-dir",
+ str(asy_base_dir),
+ "-noprc",
+ "-config",
+ '""',
+ "-render=0",
+ "-noV",
+ ]
+
+ try:
+ # first pdflatex run
+ run_pdflatex(args.pdflatex_executable, buildroot_path, args.latexusage_name)
+ # asy run
+ for asyfile in buildroot_path.glob("latexusage-*.asy"):
+ sp.run(
+ asy_base_args + [str(asyfile.name)],
+ check=True,
+ text=True,
+ cwd=str(buildroot_path),
+ )
+
+ # second pdflatex run
+ run_pdflatex(args.pdflatex_executable, buildroot_path, args.latexusage_name)
+ except sp.CalledProcessError as e:
+ print_called_process_error(e)
+ raise
+ finally:
+ # clean up any latexusage-* files
+ clean_artifacts(buildroot_path, args.latexusage_name)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/doc/gen-asy-options-file.py b/graphics/asymptote/doc/gen-asy-options-file.py
new file mode 100644
index 0000000000..e1cd76131e
--- /dev/null
+++ b/graphics/asymptote/doc/gen-asy-options-file.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python3
+import argparse
+import subprocess
+import subprocess as sp
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument("--asy-executable", type=str, default="asy")
+ parser.add_argument("--output-file", type=str, required=True)
+ return parser.parse_args()
+
+
+def main():
+ args = parse_args()
+ asy_output = sp.run(
+ [args.asy_executable, "-h"],
+ check=True,
+ stderr=subprocess.STDOUT,
+ stdout=subprocess.PIPE,
+ text=True,
+ )
+
+ with open(args.output_file, "w", encoding="utf-8") as f:
+ for line in asy_output.stdout.splitlines():
+ stripped_lines = line.strip()
+ if (
+ stripped_lines.startswith("Asymptote")
+ or stripped_lines.startswith("http")
+ or stripped_lines.startswith("Usage:")
+ ):
+ continue
+ f.write(line)
+ f.write("\n")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/doc/png/asymptote.info b/graphics/asymptote/doc/png/asymptote.info
index bd90cfe389..8b68eace3a 100644
--- a/graphics/asymptote/doc/png/asymptote.info
+++ b/graphics/asymptote/doc/png/asymptote.info
@@ -1,7 +1,7 @@
This is asymptote.info, produced by makeinfo version 7.1 from
asymptote.texi.
-This file documents ‘Asymptote’, version 2.92.
+This file documents ‘Asymptote’, version 2.93.
<https://asymptote.sourceforge.io>
@@ -22,7 +22,7 @@ File: asymptote.info, Node: Top, Next: Description, Prev: (dir), Up: (dir)
Asymptote
*********
-This file documents ‘Asymptote’, version 2.92.
+This file documents ‘Asymptote’, version 2.93.
<https://asymptote.sourceforge.io>
@@ -8640,7 +8640,6 @@ Options (negate boolean options by replacing - with -no):
-warn str Enable warning; command-line only
-webgl2 Use webgl2 if available [false]
-where Show where listed variables are declared [false]
--wsl Run asy under the Windows Subsystem for Linux [false]
-xasy Interactive mode for xasy [false]
-zoomPinchCap limit WebGL maximum zoom pinch [100]
-zoomPinchFactor n WebGL zoom pinch sensitivity [10]
@@ -8886,6 +8885,10 @@ available as
<https://sourceforge.net/projects/tumagcc/files/rsvg-convert-2.40.20.7z>
+ Ensure that ‘rsvg-convert’ is available in ‘PATH’, or specify the
+location of ‘rsvg-convert’ in ‘rsvgConverterPath’ option within ‘xasy’'s
+settings.
+
Deconstruction of a picture into its components is fastest when using
the ‘LaTeX’ TeX engine. The default setting ‘dvisvgmMultipleFiles=true’
speeds up deconstruction under PDF TeX engines.
@@ -9168,9 +9171,9 @@ Index
* ---: Bezier curves. (line 84)
* -=: Self & prefix operators.
(line 6)
-* -c: Options. (line 222)
-* -l: Options. (line 241)
-* -u: Options. (line 232)
+* -c: Options. (line 221)
+* -l: Options. (line 240)
+* -u: Options. (line 231)
* -V: Configuring. (line 6)
* -V <1>: Drawing in batch mode.
(line 16)
@@ -9280,7 +9283,7 @@ Index
* alias: Structures. (line 62)
* alias <1>: Arrays. (line 183)
* Align: label. (line 20)
-* aligndir: Options. (line 214)
+* aligndir: Options. (line 213)
* all: Arrays. (line 350)
* Allow: Pens. (line 416)
* and: Bezier curves. (line 56)
@@ -9294,7 +9297,7 @@ Index
* animation <1>: animation. (line 6)
* annotate: annotate. (line 6)
* antialias: three. (line 274)
-* antialias <1>: Options. (line 188)
+* antialias <1>: Options. (line 187)
* append: Files. (line 38)
* append <1>: Arrays. (line 39)
* arc: Paths and guides. (line 24)
@@ -9348,7 +9351,7 @@ Index
* asygl: Configuring. (line 69)
* asyinclude: LaTeX usage. (line 42)
* Asymptote Web Application: Description. (line 6)
-* ASYMPTOTE_CONFIG: Options. (line 159)
+* ASYMPTOTE_CONFIG: Options. (line 158)
* asymptote.sty: LaTeX usage. (line 6)
* asymptote.xml: Editing modes. (line 48)
* atan: Mathematical functions.
@@ -9365,7 +9368,7 @@ Index
* attach <1>: LaTeX usage. (line 47)
* attach <2>: graph. (line 407)
* autoadjust: three. (line 441)
-* autoimport: Options. (line 155)
+* autoimport: Options. (line 154)
* automatic scaling: graph. (line 711)
* automatic scaling <1>: graph. (line 711)
* axialshade: fill. (line 43)
@@ -9522,13 +9525,13 @@ Index
* conditional <1>: Arithmetic & logical.
(line 61)
* config: Configuring. (line 69)
-* config <1>: Options. (line 159)
+* config <1>: Options. (line 158)
* configuration file: Configuring. (line 15)
-* configuration file <1>: Options. (line 159)
+* configuration file <1>: Options. (line 158)
* configuring: Configuring. (line 6)
* conj: Data types. (line 62)
* constructors: Structures. (line 91)
-* context: Options. (line 188)
+* context: Options. (line 187)
* continue: Programming. (line 49)
* continue <1>: Debugger. (line 31)
* contour: contour. (line 6)
@@ -9537,7 +9540,7 @@ Index
* controls <1>: three. (line 6)
* controlSpecifier: Paths and guides. (line 397)
* convert: Files. (line 159)
-* convertOptions: Options. (line 174)
+* convertOptions: Options. (line 173)
* Coons shading: fill. (line 78)
* copy: Arrays. (line 176)
* cos: Mathematical functions.
@@ -9651,11 +9654,11 @@ Index
* drawline: math. (line 9)
* drawtree: drawtree. (line 6)
* dvips: Configuring. (line 69)
-* dvipsOptions: Options. (line 174)
+* dvipsOptions: Options. (line 173)
* dvisvgm: Configuring. (line 69)
-* dvisvgm <1>: Options. (line 193)
-* dvisvgmMultipleFiles: GUI installation. (line 20)
-* dvisvgmOptions: Options. (line 174)
+* dvisvgm <1>: Options. (line 192)
+* dvisvgmMultipleFiles: GUI installation. (line 24)
+* dvisvgmOptions: Options. (line 173)
* E: Labels. (line 18)
* E <1>: Mathematical functions.
(line 49)
@@ -9694,7 +9697,7 @@ Index
* eol: Files. (line 97)
* eol <1>: Arrays. (line 364)
* EPS: label. (line 85)
-* EPS <1>: Options. (line 188)
+* EPS <1>: Options. (line 187)
* erase: Drawing in interactive mode.
(line 11)
* erase <1>: Data types. (line 257)
@@ -9783,7 +9786,7 @@ Index
* fontsize: Pens. (line 245)
* for: Programming. (line 27)
* format: Data types. (line 290)
-* format <1>: Options. (line 188)
+* format <1>: Options. (line 187)
* forum: Help. (line 6)
* frame: Frames and pictures.
(line 7)
@@ -9812,7 +9815,7 @@ Index
* globalwrite: Files. (line 40)
* globalwrite <1>: Files. (line 154)
* glOptions: three. (line 274)
-* glOptions <1>: Options. (line 174)
+* glOptions <1>: Options. (line 173)
* GNU Scientific Library: Mathematical functions.
(line 49)
* gouraudshade: fill. (line 63)
@@ -9821,7 +9824,7 @@ Index
* graph: graph. (line 6)
* graph3: graph3. (line 6)
* graphic: label. (line 85)
-* graphic <1>: Options. (line 193)
+* graphic <1>: Options. (line 192)
* graphical user interface: GUI. (line 6)
* graphwithderiv: graph. (line 671)
* gray: Pens. (line 25)
@@ -9835,7 +9838,7 @@ Index
(line 62)
* gsl: Mathematical functions.
(line 49)
-* gsOptions: Options. (line 174)
+* gsOptions: Options. (line 173)
* GUI: GUI. (line 6)
* GUI installation: GUI installation. (line 6)
* GUI usage: GUI usage. (line 6)
@@ -9865,8 +9868,8 @@ Index
* HTML5: three. (line 246)
* htmlviewer: Configuring. (line 15)
* htmlviewer <1>: Configuring. (line 38)
-* htmlviewerOptions: Options. (line 174)
-* hyperrefOptions: Options. (line 174)
+* htmlviewerOptions: Options. (line 173)
+* hyperrefOptions: Options. (line 173)
* hypot: Mathematical functions.
(line 6)
* I: Mathematical functions.
@@ -9888,7 +9891,7 @@ Index
* image-based lighting: three. (line 117)
* ImageMagick: Configuring. (line 69)
* ImageMagick <1>: animation. (line 6)
-* ImageMagick <2>: Options. (line 188)
+* ImageMagick <2>: Options. (line 187)
* images: palette. (line 6)
* implicit casts: Casts. (line 6)
* implicit linear solver: MetaPost. (line 10)
@@ -9996,7 +9999,7 @@ Index
(line 6)
* lastcut: Paths and guides. (line 266)
* lasy-mode: Editing modes. (line 6)
-* latex: Options. (line 188)
+* latex: Options. (line 187)
* LaTeX NFSS fonts: Pens. (line 259)
* LaTeX usage: LaTeX usage. (line 6)
* latexmk: LaTeX usage. (line 30)
@@ -10062,8 +10065,8 @@ Index
* loop: Programming. (line 27)
* LSP: Language server protocol.
(line 6)
-* lualatex: Options. (line 188)
-* luatex: Options. (line 188)
+* lualatex: Options. (line 187)
+* luatex: Options. (line 187)
* MacOS X binary distributions: MacOS X binary distributions.
(line 6)
* MacOS X configuration: Compiling from UNIX source.
@@ -10071,7 +10074,7 @@ Index
* magick: Configuring. (line 69)
* magick <1>: Files. (line 159)
* magick <2>: animation. (line 6)
-* magick <3>: Options. (line 188)
+* magick <3>: Options. (line 187)
* makepen: Pens. (line 391)
* map: Arrays. (line 135)
* map <1>: Arrays. (line 140)
@@ -10171,7 +10174,7 @@ Index
* None <1>: draw. (line 26)
* none: Files. (line 65)
* normal: three. (line 565)
-* nosafe: Options. (line 209)
+* nosafe: Options. (line 208)
* NOT: Arithmetic & logical.
(line 68)
* notaknot: graph. (line 36)
@@ -10192,7 +10195,7 @@ Index
* obliqueZ: three. (line 401)
* ode: ode. (line 6)
* offset: Pens. (line 123)
-* offset <1>: Options. (line 214)
+* offset <1>: Options. (line 213)
* OmitTick: graph. (line 224)
* OmitTickInterval: graph. (line 224)
* OmitTickIntervals: graph. (line 224)
@@ -10224,7 +10227,7 @@ Index
* outprefix: Frames and pictures.
(line 78)
* output: Files. (line 38)
-* output <1>: Options. (line 188)
+* output <1>: Options. (line 187)
* OutTicks: graph3. (line 38)
* overloading functions: Functions. (line 55)
* overwrite: Pens. (line 413)
@@ -10257,11 +10260,11 @@ Index
* patterns: Pens. (line 324)
* patterns <1>: patterns. (line 6)
* PBR: three. (line 74)
-* PDF: Options. (line 188)
-* pdflatex: Options. (line 188)
-* pdfreloadOptions: Options. (line 174)
+* PDF: Options. (line 187)
+* pdflatex: Options. (line 187)
+* pdfreloadOptions: Options. (line 173)
* pdfviewer: Configuring. (line 15)
-* pdfviewerOptions: Options. (line 174)
+* pdfviewerOptions: Options. (line 173)
* pen: Pens. (line 6)
* PenMargin: draw. (line 78)
* PenMargin2: three. (line 661)
@@ -10326,7 +10329,7 @@ Index
* pstoedit: PostScript to Asymptote.
(line 6)
* psviewer: Configuring. (line 15)
-* psviewerOptions: Options. (line 174)
+* psviewerOptions: Options. (line 173)
* pt: Figure size. (line 18)
* public: Structures. (line 6)
* push: Arrays. (line 39)
@@ -10380,7 +10383,7 @@ Index
* rename: Files. (line 156)
* render: three. (line 46)
* render <1>: three. (line 197)
-* render <2>: Options. (line 188)
+* render <2>: Options. (line 187)
* replace: Data types. (line 270)
* resetdefaultpen: Pens. (line 440)
* rest arguments: Rest arguments. (line 6)
@@ -10419,7 +10422,7 @@ Index
* runtime imports: Import. (line 102)
* Russian: Pens. (line 291)
* S: Labels. (line 18)
-* safe: Options. (line 209)
+* safe: Options. (line 208)
* save: Frames and pictures.
(line 276)
* saveline: Files. (line 139)
@@ -10453,7 +10456,7 @@ Index
(line 6)
* sequence: Arrays. (line 118)
* settings: Configuring. (line 15)
-* settings <1>: Options. (line 159)
+* settings <1>: Options. (line 158)
* sgn: Mathematical functions.
(line 26)
* shading: fill. (line 32)
@@ -10498,7 +10501,7 @@ Index
* size <4>: Frames and pictures.
(line 61)
* size <5>: three. (line 579)
-* size <6>: Options. (line 188)
+* size <6>: Options. (line 187)
* size3: three. (line 343)
* Slant: label. (line 49)
* slant: Transforms. (line 38)
@@ -10569,9 +10572,9 @@ Index
* surface <3>: three. (line 155)
* surface <4>: graph3. (line 102)
* surface <5>: graph3. (line 131)
-* SVG: Options. (line 193)
+* SVG: Options. (line 192)
* system: Data types. (line 354)
-* system <1>: Options. (line 209)
+* system <1>: Options. (line 208)
* syzygy: syzygy. (line 6)
* tab: Files. (line 65)
* tab completion: Drawing in interactive mode.
@@ -10593,7 +10596,7 @@ Index
* tessellation: three. (line 167)
* tex: Frames and pictures.
(line 293)
-* tex <1>: Options. (line 188)
+* tex <1>: Options. (line 187)
* TeX fonts: Pens. (line 266)
* TeX string: Data types. (line 208)
* texcommand: Configuring. (line 69)
@@ -10737,7 +10740,7 @@ Index
* xasy: GUI. (line 6)
* xaxis3: graph3. (line 7)
* xdr: Files. (line 80)
-* xelatex: Options. (line 188)
+* xelatex: Options. (line 187)
* XEquals: graph. (line 266)
* xequals: graph. (line 279)
* xlimits: graph. (line 640)
@@ -10936,22 +10939,22 @@ Node: smoothcontour3347536
Node: slopefield349303
Node: ode350848
Node: Options351117
-Ref: configuration file359569
-Ref: settings359569
-Ref: texengines360917
-Ref: magick360917
-Node: Interactive mode364312
-Ref: history366541
-Node: GUI367912
-Node: GUI installation368482
-Node: GUI usage369478
-Node: Command-Line Interface370545
-Node: Language server protocol372033
-Node: PostScript to Asymptote373514
-Node: Help374341
-Node: Debugger376071
-Node: Credits377919
-Node: Index379176
+Ref: configuration file359492
+Ref: settings359492
+Ref: texengines360840
+Ref: magick360840
+Node: Interactive mode364235
+Ref: history366464
+Node: GUI367835
+Node: GUI installation368405
+Node: GUI usage369574
+Node: Command-Line Interface370641
+Node: Language server protocol372129
+Node: PostScript to Asymptote373610
+Node: Help374437
+Node: Debugger376167
+Node: Credits378015
+Node: Index379272

End Tag Table
diff --git a/graphics/asymptote/drawlabel.cc b/graphics/asymptote/drawlabel.cc
index 491ec4f8d0..3d3b370975 100644
--- a/graphics/asymptote/drawlabel.cc
+++ b/graphics/asymptote/drawlabel.cc
@@ -6,6 +6,8 @@
*****/
#include <sstream>
+#include <random>
+#include <chrono>
#include "drawlabel.h"
#include "settings.h"
@@ -66,8 +68,10 @@ void texbounds(double& width, double& height, double& depth,
inline double urand()
{
- static const double factor=2.0/RANDOM_MAX;
- return random()*factor-1.0;
+ auto seed = std::chrono::system_clock::now().time_since_epoch().count();
+ std::minstd_rand engine(seed);
+ std::uniform_real_distribution<double> dist(-1.0, 1.0);
+ return dist(engine);
}
void setpen(iopipestream& tex, const string& texengine, const pen& pentype)
diff --git a/graphics/asymptote/envcompleter.cc b/graphics/asymptote/envcompleter.cc
index 9477a77f3c..0462d8aad0 100644
--- a/graphics/asymptote/envcompleter.cc
+++ b/graphics/asymptote/envcompleter.cc
@@ -20,7 +20,7 @@ static void loadBasicList() {
assert(basicListLoaded==false);
#define ADD(word) basicList.push_back(symbol::literalTrans(#word))
-#include "keywords.cc"
+#include "keywords.h"
#undef ADD
basicListLoaded=true;
diff --git a/graphics/asymptote/errormsg.h b/graphics/asymptote/errormsg.h
index 95edbeedaf..df6398a2c2 100644
--- a/graphics/asymptote/errormsg.h
+++ b/graphics/asymptote/errormsg.h
@@ -19,7 +19,7 @@ using std::ostream;
struct handled_error : std::exception {}; // Exception to process next file.
struct interrupted : std::exception {}; // Exception to interrupt execution.
struct quit : std::exception {}; // Exception to quit current operation.
-struct eof : std::exception {}; // Exception to exit interactive mode.
+struct EofException : std::exception {}; // Exception to exit interactive mode.
class fileinfo : public gc {
string filename;
diff --git a/graphics/asymptote/examples/venn.asy b/graphics/asymptote/examples/venn.asy
index 33100a72e8..82e783fdb7 100644
--- a/graphics/asymptote/examples/venn.asy
+++ b/graphics/asymptote/examples/venn.asy
@@ -31,6 +31,6 @@ margin BigMargin=Margin(0,m*dot(unit(z1-z),unit(z0-z)));
draw(Label("$A\cap B$",0),conj(z)--z0,Arrow,BigMargin);
draw(Label("$A\cup B$",0),z--z0,Arrow,BigMargin);
draw(z--z1,Arrow,Margin(0,m));
-draw(z--z2,Arrow,Margin(0,m));
+draw(KEY="34.5",z--z2,Arrow,Margin(0,m));
shipout(bbox(0.25cm));
diff --git a/graphics/asymptote/exithandlers.cc b/graphics/asymptote/exithandlers.cc
new file mode 100644
index 0000000000..7b81a18258
--- /dev/null
+++ b/graphics/asymptote/exithandlers.cc
@@ -0,0 +1,61 @@
+/**
+ * @file exithandlers.cc
+ * @brief Definitions for exit handlers
+ */
+
+#include "exithandlers.h"
+
+#include <csignal>
+
+#include "common.h"
+#include "util.h"
+#include "interact.h"
+#include "errormsg.h"
+#include "vm.h"
+
+#ifdef HAVE_LIBFFTW3
+#include "fftw++.h"
+#endif
+
+#if defined(HAVE_LIBCURSES) && defined(HAVE_LIBREADLINE)
+#include <readline/readline.h>
+#endif
+
+void interruptHandler(int)
+{
+#ifdef HAVE_LIBFFTW3
+ fftwpp::saveWisdom();
+#endif
+ em.Interrupt(true);
+}
+
+bool hangup=false;
+
+int returnCode()
+{
+ return em.processStatus() || interact::interactive ? 0 : 1;
+}
+
+void exitHandler(int)
+{
+#if defined(HAVE_READLINE) && defined(HAVE_LIBCURSES)
+ rl_cleanup_after_signal();
+#endif
+ exit(returnCode());
+}
+
+void signalHandler(int)
+{
+ // Print the position and trust the shell to print an error message.
+ em.runtime(vm::getPos());
+
+#if !defined(_WIN32)
+ Signal(SIGBUS,SIG_DFL);
+#endif
+ Signal(SIGFPE,SIG_DFL);
+}
+
+void hangup_handler(int sig)
+{
+ hangup=true;
+}
diff --git a/graphics/asymptote/exithandlers.h b/graphics/asymptote/exithandlers.h
new file mode 100644
index 0000000000..efc3931fe5
--- /dev/null
+++ b/graphics/asymptote/exithandlers.h
@@ -0,0 +1,15 @@
+/**
+ * @file exithandlers.h
+ * @brief Declarations for exit handlers
+ */
+
+#pragma once
+
+int returnCode();
+
+extern bool hangup;
+
+void interruptHandler(int);
+void exitHandler(int);
+void signalHandler(int);
+void hangup_handler(int sig);
diff --git a/graphics/asymptote/exp.cc b/graphics/asymptote/exp.cc
index f683330158..cde747d68f 100644
--- a/graphics/asymptote/exp.cc
+++ b/graphics/asymptote/exp.cc
@@ -22,7 +22,7 @@
#include "stm.h"
#include "inst.h"
#include "opsymbols.h"
-#include "process.h"
+#include "asyprocess.h"
//void runCode(absyntax::block *code);
diff --git a/graphics/asymptote/fileio.cc b/graphics/asymptote/fileio.cc
index b28269b2b1..86911d9e5d 100644
--- a/graphics/asymptote/fileio.cc
+++ b/graphics/asymptote/fileio.cc
@@ -8,6 +8,10 @@
#include "fileio.h"
#include "settings.h"
+#if !defined(_WIN32)
+#define _fdopen fdopen
+#endif
+
namespace camp {
FILE *pipeout=NULL;
@@ -18,6 +22,103 @@ string newline="\n";
ofile Stdout("");
file nullfile("",false,NOMODE,false,true);
+void openpipeout()
+{
+ int fd=intcast(settings::getSetting<Int>("outpipe"));
+ if(!pipeout && fd >= 0) pipeout=_fdopen(fd,"w");
+ if(!pipeout) {
+ cerr << "Cannot open outpipe " << fd << endl;
+ exit(-1);
+ }
+}
+
+string locatefile(string name)
+{
+ string s=settings::locateFile(name,false,"");
+ return s.empty() ? name : s;
+}
+
+#pragma region "class file"
+
+bool file::Standard()
+{
+ return standard;
+}
+
+void file::standardEOF()
+{
+#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
+ cout << endl;
+#endif
+}
+
+void file::purgeStandard(string&)
+{
+ if(cin.eof())
+ standardEOF();
+}
+
+void file::dimension(Int Nx, Int Ny, Int Nz)
+{
+ if(Nx < -2 || Ny < -2 || Nz < -2) {
+ ostringstream buf;
+ buf << "Invalid array dimensions: " << Nx << ", " << Ny << ", " << Nz;
+ reportError(buf);
+ }
+
+ nx=Nx; ny=Ny; nz=Nz;
+}
+
+file::file(
+ string const& name, bool check,
+ Mode type, bool binary,
+ bool closed
+ ) :
+ name(name), check(check), type(type), linemode(false), csvmode(false),
+ wordmode(false), singlereal(false), singleint(true), signedint(true),
+ closed(closed), standard(name.empty()), binary(binary), nullfield(false),
+ whitespace("")
+{
+ dimension();
+}
+
+void file::Check()
+{
+ if(error()) {
+ ostringstream buf;
+ buf << "Cannot open file \"" << name << "\"";
+ reportError(buf);
+ }
+}
+
+file::~file()
+{
+
+}
+
+bool file::isOpen()
+{
+ if(closed) {
+ ostringstream buf;
+ buf << "I/O operation attempted on ";
+ if(name != "") buf << "closed file \'" << name << "\'";
+ else buf << "null file";
+ reportError(buf);
+ }
+ return true;
+}
+void file::unsupported(char const* rw, char const* type)
+{
+ ostringstream buf;
+ buf << rw << " of type " << type << " not supported in " << FileMode()
+ << " mode";
+ reportError(buf);
+}
+
+#pragma endregion
+
+#pragma region "class ifile"
+
void ifile::open()
{
if(standard) {
@@ -229,6 +330,8 @@ void ifile::Read(string& val)
val=whitespace+s;
}
+#pragma endregion
+
void ofile::writeline()
{
if(standard && interact::query && !vm::indebugger) {
@@ -253,4 +356,112 @@ void ofile::writeline()
if(errorstream::interrupt) {interact::lines=0; throw interrupted();}
}
+void ofile::open()
+{
+ if(standard) {
+ if(mode & std::ios::binary)
+ reportError("Cannot open standard output in binary mode");
+ stream=&cout;
+ } else {
+ name=outpath(name);
+ stream=fstream=new std::ofstream(name.c_str(),mode | std::ios::trunc);
+ stream->precision(settings::getSetting<Int>("digits"));
+ index=processData().ofile.add(fstream);
+ Check();
+ }
+}
+
+void ofile::close()
+{
+ if(!standard && fstream) {
+ fstream->close();
+ closed=true;
+ delete fstream;
+ fstream=NULL;
+ processData().ofile.remove(index);
+ }
+}
+
+Int ofile::precision(Int p)
+{
+ return p == 0 ? stream->precision(settings::getSetting<Int>("digits")) :
+ stream->precision(p);
+}
+
+void ofile::seek(Int pos, bool begin)
+{
+ if(!standard && fstream) {
+ clear();
+ fstream->seekp(pos,begin ? std::ios::beg : std::ios::end);
+ }
+}
+size_t ofile::tell()
+{
+ if(fstream)
+ return fstream->tellp();
+ else
+ return 0;
+}
+
+bool ofile::enabled()
+{
+ return !standard || settings::verbose > 1 ||
+ interact::interactive || !settings::getSetting<bool>("quiet");
+}
+
+
+#pragma region opipe
+void opipe::write(const string& val) {
+ if (fprintf(pipeout,"%s",val.c_str()) < 0)
+ {
+ reportError("Write failed to pipe");
+ }
+}
+
+void opipe::flush()
+{
+ if(pipeout)
+ {
+ if (fflush(pipeout) == EOF)
+ {
+ reportError("Flushing pipe failed");
+ }
+ }
+}
+
+#pragma endregion
+
+void iofile::writeline()
+{
+ *fstream << newline;
+ if(errorstream::interrupt) throw interrupted();
+}
+
+void igzxfile::open()
+{
+ name=locatefile(inpath(name));
+ gzfile=gzopen(name.c_str(),"rb");
+ Check();
+
+ while(!gzeof(gzfile)) {
+ std::vector<char> tmpBuf(readSize);
+ auto filSz = gzread(gzfile,tmpBuf.data(),readSize);
+ std::copy(tmpBuf.begin(),tmpBuf.begin()+filSz,std::back_inserter(readData));
+ }
+ gzclose(gzfile);
+
+ fstream=new xdr::memixstream(readData);
+ index=processData().ixfile.add(fstream);
+}
+
+void igzxfile::closeFile()
+{
+ if(fstream) {
+ fstream->close();
+ closed=true;
+ delete fstream;
+ processData().ixfile.remove(index);
+ }
+}
+
} // namespace camp
diff --git a/graphics/asymptote/fileio.h b/graphics/asymptote/fileio.h
index e23bf343f6..607b7ef567 100644
--- a/graphics/asymptote/fileio.h
+++ b/graphics/asymptote/fileio.h
@@ -28,9 +28,9 @@
#include "interact.h"
#include "errormsg.h"
#include "util.h"
-#include "process.h"
+#include "asyprocess.h"
#include "locate.h"
-#include "parser.h"
+#include "asyparser.h"
namespace vm {
extern bool indebugger;
@@ -51,20 +51,8 @@ static const string FileModes[]=
extern FILE *pipeout;
-inline void openpipeout()
-{
- int fd=intcast(settings::getSetting<Int>("outpipe"));
- if(!pipeout && fd >= 0) pipeout=fdopen(fd,"w");
- if(!pipeout) {
- cerr << "Cannot open outpipe " << fd << endl;
- exit(-1);
- }
-}
-
-inline string locatefile(string name) {
- string s=settings::locateFile(name,false,"");
- return s.empty() ? name : s;
-}
+void openpipeout();
+string locatefile(string name);
class file : public gc {
protected:
@@ -90,16 +78,11 @@ protected:
public:
- bool Standard() {return standard;}
-
+ bool Standard();
bool enabled() {return !standard || settings::verbose > 1 ||
interact::interactive || !settings::getSetting<bool>("quiet");}
- void standardEOF() {
-#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
- cout << endl;
-#endif
- }
+ void standardEOF();
template<class T>
void purgeStandard(T&) {
@@ -117,50 +100,20 @@ public:
}
}
- void purgeStandard(string&) {
- if(cin.eof())
- standardEOF();
- }
+ void purgeStandard(string&);
- void dimension(Int Nx=-1, Int Ny=-1, Int Nz=-1) {
- if(Nx < -2 || Ny < -2 || Nz < -2) {
- ostringstream buf;
- buf << "Invalid array dimensions: " << Nx << ", " << Ny << ", " << Nz;
- reportError(buf);
- }
-
- nx=Nx; ny=Ny; nz=Nz;
- }
+ void dimension(Int Nx=-1, Int Ny=-1, Int Nz=-1);
file(const string& name, bool check=true, Mode type=NOMODE,
- bool binary=false, bool closed=false) :
- name(name), check(check), type(type), linemode(false), csvmode(false),
- wordmode(false), singlereal(false), singleint(true), signedint(true),
- closed(closed), standard(name.empty()), binary(binary), nullfield(false),
- whitespace("") {dimension();}
+ bool binary=false, bool closed=false);
virtual void open() {}
- void Check() {
- if(error()) {
- ostringstream buf;
- buf << "Cannot open file \"" << name << "\"";
- reportError(buf);
- }
- }
+ void Check();
- virtual ~file() {}
+ virtual ~file();
- bool isOpen() {
- if(closed) {
- ostringstream buf;
- buf << "I/O operation attempted on ";
- if(name != "") buf << "closed file \'" << name << "\'";
- else buf << "null file";
- reportError(buf);
- }
- return true;
- }
+ bool isOpen();
string filename() {return name;}
virtual bool eol() {return false;}
@@ -177,12 +130,7 @@ public:
string FileMode() {return FileModes[type];}
- void unsupported(const char *rw, const char *type) {
- ostringstream buf;
- buf << rw << " of type " << type << " not supported in " << FileMode()
- << " mode";
- reportError(buf);
- }
+ void unsupported(const char *rw, const char *type);
void noread(const char *type) {unsupported("Read",type);}
void nowrite(const char *type) {unsupported("Write",type);}
@@ -286,7 +234,7 @@ public:
bool eof() {return pipeout ? feof(pipeout) : true;}
bool error() {return pipeout ? ferror(pipeout) : true;}
void clear() {if(pipeout) clearerr(pipeout);}
- void flush() {if(pipeout) fflush(pipeout);}
+ void flush();
void seek(Int pos, bool begin=true) {
if(!standard && pipeout) {
@@ -299,9 +247,7 @@ public:
return pipeout ? ftell(pipeout) : 0;
}
- void write(const string& val) {
- fprintf(pipeout,"%s",val.c_str());
- }
+ void write(const string& val);
void write(bool val) {
ostringstream s;
@@ -447,10 +393,7 @@ public:
void write(guide *val) {*fstream << *val;}
void write(const transform& val) {*fstream << val;}
- void writeline() {
- *fstream << newline;
- if(errorstream::interrupt) throw interrupted();
- }
+ void writeline();
};
class ofile : public file {
@@ -465,53 +408,22 @@ public:
~ofile() {close();}
- void open() {
- if(standard) {
- if(mode & std::ios::binary)
- reportError("Cannot open standard output in binary mode");
- stream=&cout;
- } else {
- name=outpath(name);
- stream=fstream=new std::ofstream(name.c_str(),mode | std::ios::trunc);
- stream->precision(settings::getSetting<Int>("digits"));
- index=processData().ofile.add(fstream);
- Check();
- }
- }
+ void open();
bool text() {return true;}
bool eof() {return stream->eof();}
bool error() {return stream->fail();}
- void close() {
- if(!standard && fstream) {
- fstream->close();
- closed=true;
- delete fstream;
- fstream=NULL;
- processData().ofile.remove(index);
- }
- }
+ void close();
void clear() {stream->clear();}
- Int precision(Int p) {
- return p == 0 ? stream->precision(settings::getSetting<Int>("digits")) :
- stream->precision(p);
- }
+ Int precision(Int p);
void flush() {stream->flush();}
- void seek(Int pos, bool begin=true) {
- if(!standard && fstream) {
- clear();
- fstream->seekp(pos,begin ? std::ios::beg : std::ios::end);
- }
- }
+ void seek(Int pos, bool begin=true);
- size_t tell() {
- if(fstream)
- return fstream->tellp();
- else
- return 0;
- }
+ size_t tell();
+
+ bool enabled();
void write(bool val) {*stream << (val ? "true " : "false ");}
void write(Int val) {*stream << val;}
@@ -734,21 +646,7 @@ public:
bool error() override {return !gzfile;}
- void open() override {
- name=locatefile(inpath(name));
- gzfile=gzopen(name.c_str(),"rb");
- Check();
-
- while(!gzeof(gzfile)) {
- std::vector<char> tmpBuf(readSize);
- auto filSz = gzread(gzfile,tmpBuf.data(),readSize);
- std::copy(tmpBuf.begin(),tmpBuf.begin()+filSz,std::back_inserter(readData));
- }
- gzclose(gzfile);
-
- fstream=new xdr::memixstream(readData);
- index=processData().ixfile.add(fstream);
- }
+ void open() override;
void close() override {
closeFile();
@@ -758,15 +656,7 @@ public:
protected:
- void closeFile()
- {
- if(fstream) {
- fstream->close();
- closed=true;
- delete fstream;
- processData().ixfile.remove(index);
- }
- }
+ void closeFile();
};
class ioxfile : public ixfile {
diff --git a/graphics/asymptote/findsym.pl b/graphics/asymptote/findsym.pl
index 9cfe6c131b..57a356cc82 100755..100644
--- a/graphics/asymptote/findsym.pl
+++ b/graphics/asymptote/findsym.pl
@@ -7,16 +7,19 @@
# translated only once when creating the symbol table.
#####
-$outname = shift(@ARGV);
+use strict;
+use warnings;
+
+my $outname = shift(@ARGV);
if (not $outname) {
print STDERR "usage ./findsym.pl out_symbols.h file1.cc file2.cc ...\n";
exit(1);
}
-open(header, ">$outname") ||
+open(my $header, ">$outname") ||
die("Couldn't open $outname for writing");
-print header <<END;
+print $header <<END;
/*****
* This file is automatically generated by findsym.pl
* Changes will be overwritten.
@@ -33,21 +36,24 @@ print header <<END;
END
sub add {
- print header "ADDSYMBOL(".$_[0].");\n";
+ print $header "ADDSYMBOL(".$_[0].");\n";
}
my %symbols = ();
foreach my $inname (@ARGV) {
- open(infile, $inname) ||
+ open(my $infile, $inname) ||
die("Couldn't open $inname");
- while (<infile>) {
+ while (<$infile>) {
while (m/SYM\(([_A-Za-z][_A-Za-z0-9]*)\)/gx) {
$symbols{ $1 } = 1;
}
}
+ close($infile)
}
foreach my $s (sort keys %symbols) {
add($s);
}
+
+close($header)
diff --git a/graphics/asymptote/gen_preprocessed_depfile.py b/graphics/asymptote/gen_preprocessed_depfile.py
new file mode 100644
index 0000000000..2c98089620
--- /dev/null
+++ b/graphics/asymptote/gen_preprocessed_depfile.py
@@ -0,0 +1,251 @@
+#!/usr/bin/env python3
+import io
+from argparse import ArgumentParser
+from typing import List, Optional
+import subprocess as sp
+import sys
+import tempfile
+import shlex
+import json
+
+
+def execute_and_report_err(args: List[str], error_heading="Error"):
+ try:
+ return sp.run(
+ args, stdout=sp.PIPE, stderr=sp.PIPE, universal_newlines=True, check=True
+ )
+ except sp.CalledProcessError as e:
+ sys.stderr.write(f"{error_heading}\n")
+ sys.stderr.write(e.stderr)
+ sys.stderr.write(f"stdout:\n{e.stdout}")
+ sys.stderr.write("\n")
+ sys.stderr.flush()
+ raise
+
+
+def parse_args():
+ args_parser = ArgumentParser()
+ args_parser.add_argument(
+ "--out-i-file", type=str, required=True, help="Output for preprocessed file"
+ )
+
+ args_parser.add_argument(
+ "--out-dep-file",
+ type=str,
+ required=False,
+ help="Location of output depfile. Optional when used with gcc. "
+ + "If not given, will not output dep file",
+ )
+
+ args_parser.add_argument(
+ "--in-src-file",
+ type=str,
+ required=True,
+ help="Location of source file to process",
+ )
+
+ args_parser.add_argument(
+ "--cxx-compiler", type=str, required=True, help="C++ compiler to use"
+ )
+
+ args_parser.add_argument("--msvc", action="store_true")
+
+ args_parser.add_argument(
+ "--include-dirs", type=str, help="Include directories separated by semicolon"
+ )
+
+ args_parser.add_argument(
+ "--additional-raw-arguments",
+ type=str,
+ help="Additional arguments to pass to the compiler. "
+ + "Only for use on UNIX systems",
+ )
+
+ args_parser.add_argument(
+ "--macro-defs",
+ type=str,
+ help="Macro definitions in the form VALA=CONTENTA or VALB",
+ )
+
+ args_parser.add_argument(
+ "--cxx-standard",
+ type=str,
+ )
+
+ args_parser.add_argument(
+ "--dep-file-only",
+ action="store_true",
+ help="If given, will only generate dependency file without preprocessed file."
+ + "For gcc usage only.",
+ )
+ return args_parser.parse_args()
+
+
+class CompileOptions:
+ def __init__(
+ self,
+ compiler: str,
+ include_dirs: Optional[List[str]] = None,
+ macros: Optional[List[str]] = None,
+ extra_flags: Optional[List[str]] = None,
+ standard: Optional[str] = None,
+ ):
+ self._compiler = compiler
+ self._include_dirs = include_dirs or []
+ self._macros = macros or []
+ self._extra_flags = extra_flags or []
+ self._standard = standard or "17"
+
+ @property
+ def compiler(self):
+ return self._compiler
+
+ def build_args_for_gcc(
+ self,
+ src_file: str,
+ out_file: Optional[str],
+ addr_flags: Optional[List[str]] = None,
+ ):
+ base_args = (
+ [f"-I{include_dir}" for include_dir in self._include_dirs]
+ + [f"-D{macro}" for macro in self._macros]
+ + [f"-std=c++{self._standard}"]
+ + self._extra_flags
+ )
+
+ if addr_flags:
+ base_args.extend(addr_flags)
+
+ if out_file:
+ base_args.extend(["-o", out_file])
+
+ base_args.append(src_file)
+ return base_args
+
+ def build_args_for_msvc(
+ self,
+ src_file: str,
+ out_file: Optional[str],
+ addr_flags: Optional[List[str]] = None,
+ ):
+ base_args = (
+ [f"/I{include_dir}" for include_dir in self._include_dirs]
+ + [f"/D{macro}" for macro in self._macros]
+ + [f"/std:c++{self._standard}", "/Zc:__cplusplus"]
+ + self._extra_flags
+ )
+ if addr_flags:
+ base_args.extend(addr_flags)
+
+ if out_file:
+ base_args.extend(["/F", out_file])
+ base_args.append(src_file)
+ return base_args
+
+
+def compile_for_depfile_gcc(
+ compile_opt: CompileOptions, src_in: str, src_out: str, depfile_out: str
+):
+ args = [compile_opt.compiler] + compile_opt.build_args_for_gcc(
+ src_in,
+ None,
+ ["-DDEPEND", "-DNOSYM", "-M", "-MG", "-O0", "-MT", src_out, "-MF", depfile_out],
+ )
+ try:
+ sp.run(args, check=True, stdout=sp.PIPE, stderr=sp.PIPE, text=True)
+ except sp.CalledProcessError as e:
+ sys.stderr.write("Process stderr:\n")
+ sys.stderr.write(e.stderr)
+ sys.stderr.write("Process output:\n")
+ sys.stderr.write(e.stdout)
+ sys.stderr.flush()
+ raise
+
+
+def compile_for_preproc_gcc(compile_opt: CompileOptions, src_in: str, preproc_out: str):
+ args = [compile_opt.compiler] + compile_opt.build_args_for_gcc(
+ src_in, preproc_out, ["-E", "-DNOSYM"]
+ )
+ try:
+ sp.run(args, check=True, stdout=sp.PIPE, stderr=sp.PIPE, text=True)
+ except sp.CalledProcessError as e:
+ sys.stderr.write("Process stderr:\n")
+ sys.stderr.write(e.stderr)
+ sys.stderr.write("Process out:\n")
+ sys.stderr.write(e.stdout)
+ sys.stderr.flush()
+ raise
+
+
+def escape_windows_path(raw_path: str) -> str:
+ escape_chars = {" ", "$", "#"}
+ with io.StringIO() as ret_str_io:
+ for char in raw_path:
+ if char in escape_chars:
+ ret_str_io.write("\\")
+ ret_str_io.write(char)
+ return ret_str_io.getvalue()
+
+
+def compile_for_preproc_and_depfile_msvc(
+ compile_opt: CompileOptions, src_in: str, preproc_out: str, depfile_out: str
+):
+ with tempfile.TemporaryDirectory() as td:
+ args = [compile_opt.compiler] + compile_opt.build_args_for_msvc(
+ src_in,
+ None,
+ [
+ "/DNOSYM",
+ "/DDEPEND",
+ "/P",
+ f"/Fi{preproc_out}",
+ "/sourceDependencies",
+ f"{td}/srcdep.json",
+ ],
+ )
+ execute_and_report_err(args, "MSVC Error")
+ with open(f"{td}/srcdep.json", "r", encoding="utf-8") as fread:
+ dep_data = json.load(fread)
+
+ include_fil_str = " ".join(
+ escape_windows_path(include_fil)
+ for include_fil in dep_data["Data"].get("Includes", [])
+ )
+
+ with open(depfile_out, "w", encoding="utf-8") as depfile_writer:
+ depfile_writer.write(escape_windows_path(preproc_out))
+ depfile_writer.write(": ")
+ depfile_writer.write(include_fil_str)
+
+
+def main():
+ args = parse_args()
+ opt = CompileOptions(
+ args.cxx_compiler,
+ args.include_dirs.split(";") if args.include_dirs else None,
+ args.macro_defs.split(";") if args.macro_defs else None,
+ extra_flags=(
+ shlex.split(args.additional_raw_arguments)
+ if args.additional_raw_arguments
+ else None
+ ),
+ standard=args.cxx_standard,
+ )
+
+ if args.msvc:
+ compile_for_preproc_and_depfile_msvc(
+ opt, args.in_src_file, args.out_i_file, args.out_dep_file
+ )
+ else:
+ if not args.out_dep_file and args.dep_file_only:
+ raise RuntimeError("Dependency file output must be given")
+ if args.out_dep_file:
+ compile_for_depfile_gcc(
+ opt, args.in_src_file, args.out_i_file, args.out_dep_file
+ )
+ if not args.dep_file_only:
+ compile_for_preproc_gcc(opt, args.in_src_file, args.out_i_file)
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/generate_asy_ver_info.py b/graphics/asymptote/generate_asy_ver_info.py
new file mode 100644
index 0000000000..609338e19e
--- /dev/null
+++ b/graphics/asymptote/generate_asy_ver_info.py
@@ -0,0 +1,75 @@
+#!/usr/bin/env python3
+
+__doc__ = """
+Determines asymptote version for release, or with git info for development
+"""
+__author__ = "Supakorn 'Jamie' Rassameemasmuang <jamievlin@outlook.com>"
+
+import pathlib
+import re
+import subprocess
+from argparse import ArgumentParser
+from subprocess import CalledProcessError
+
+from determine_pkg_info import determine_asy_pkg_info
+
+
+def parse_args():
+ parser = ArgumentParser()
+ parser.add_argument(
+ "--base-version",
+ type=str,
+ help="Base version string. If blank, this information is fetched from configure.ac",
+ )
+ version_mode = parser.add_mutually_exclusive_group()
+ version_mode.add_argument("--version-for-release", action="store_true")
+ version_mode.add_argument(
+ "--version-with-git-info",
+ action="store_true",
+ help="Includes number of commits since last tag, if directory is a git repo. "
+ + "If commit information cannot be determined, reverts to baseline version",
+ )
+
+ return parser.parse_args()
+
+
+def determine_version_for_release(version_base: str):
+ git_string = "git"
+ if version_base.endswith("git"):
+ return version_base[: -len(git_string)]
+ return version_base
+
+
+def determine_version_with_git_info(version_base: str):
+ try:
+ long_description = subprocess.run(
+ ["git", "describe", "--long"],
+ cwd=pathlib.Path(__file__).parent,
+ check=True,
+ stderr=subprocess.DEVNULL,
+ stdout=subprocess.PIPE,
+ text=True,
+ )
+ except CalledProcessError:
+ return version_base
+
+ first_version_base = re.sub(r"git-([0-9]*)-g.*", r"-\1", long_description.stdout)
+ return re.sub(r"-0-g.*", r"", first_version_base)
+
+
+def main():
+ args = parse_args()
+ version_base = args.base_version or determine_asy_pkg_info()["version-base"]
+
+ if args.version_for_release:
+ version = determine_version_for_release(version_base)
+ elif args.version_with_git_info:
+ version = determine_version_with_git_info(version_base)
+ else:
+ version = version_base
+
+ print(version, end="")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/generate_enums.py b/graphics/asymptote/generate_enums.py
index 2843b9c3fe..6e6e5aa12c 100755..100644
--- a/graphics/asymptote/generate_enums.py
+++ b/graphics/asymptote/generate_enums.py
@@ -12,11 +12,11 @@
from typing import List, Tuple, Any, Union
from datetime import datetime, timezone
+import os
+import time
import io
import argparse
-import os
import sys
-import time
import re
def cleanComment(s):
@@ -58,7 +58,6 @@ def generate_enum_cpp(outname, enums, name, comment=None, *args, **kwargs):
fil.write('// Enum class for {0}\n'.format(name))
if comment is not None:
fil.write('// {0}\n'.format(comment))
- fil.write('// Generated at {0}\n\n'.format(datetime_now()))
if 'namespace' in kwargs:
fil.write('namespace {0}\n'.format(kwargs['namespace']))
fil.write('{\n')
@@ -67,11 +66,11 @@ def generate_enum_cpp(outname, enums, name, comment=None, *args, **kwargs):
fil.write('{\n')
for enumTxt, enumNum, *ar in enums:
- fil.write('{0}={1},\n'.format(enumTxt, enumNum))
if len(ar) > 0:
comment=cleanComment(ar[-1])
if comment is not None:
- fil.write('// {0}\n\n'.format(comment.strip()))
+ fil.write('// {0}\n'.format(comment.strip()))
+ fil.write('{0}={1},\n\n'.format(enumTxt, enumNum))
fil.write('};\n\n')
@@ -85,8 +84,6 @@ def generate_enum_java(outname, enums, name, comment=None, *args, **kwargs):
fil.write('// Enum class for {0}\n'.format(name))
if comment is not None:
fil.write('// {0}\n'.format(comment))
- fil.write('// Generated at {0}\n\n'.format(datetime_now()))
-
if 'package' in kwargs:
fil.write('package {0};\n'.format(kwargs['package']))
fil.write('\n')
@@ -128,8 +125,6 @@ def generate_enum_asy(outname, enums, name, comment=None, *args, **kwargs):
fil.write('// Enum class for {0}\n'.format(name))
if comment is not None:
fil.write('// {0}\n'.format(comment))
- fil.write('// Generated at {0}\n\n'.format(datetime_now()))
-
fil.write('struct {0}\n'.format(name))
fil.write('{\n')
@@ -151,7 +146,6 @@ def generate_enum_py(outname, enums, name, comment=None, *args, **kwargs):
fil.write('# Enum class for {0}\n'.format(name))
if comment is not None:
fil.write('""" {0} """\n'.format(comment))
- fil.write('# Generated at {0}\n\n'.format(datetime_now()))
fil.write('class {0}:\n'.format(name))
for enumTxt, enumNum, *ar in enums:
fil.write(' {0}_{2}={1}\n'.format(name, enumNum, enumTxt))
diff --git a/graphics/asymptote/genv.cc b/graphics/asymptote/genv.cc
index f58294101c..5ba9b81424 100644
--- a/graphics/asymptote/genv.cc
+++ b/graphics/asymptote/genv.cc
@@ -14,7 +14,7 @@
*****/
#include <sstream>
-#include <unistd.h>
+
#include <algorithm>
#include "genv.h"
@@ -24,11 +24,15 @@
#include "types.h"
#include "settings.h"
#include "runtime.h"
-#include "parser.h"
+#include "asyparser.h"
#include "locate.h"
#include "interact.h"
#include "builtin.h"
+#if !defined(_WIN32)
+#include <unistd.h>
+#endif
+
using namespace types;
using settings::getSetting;
using settings::Setting;
diff --git a/graphics/asymptote/glew.c b/graphics/asymptote/glew.c
deleted file mode 100644
index a6009a40e8..0000000000
--- a/graphics/asymptote/glew.c
+++ /dev/null
@@ -1,22 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#ifdef __MSDOS__
-#define _WIN32
-#endif
-
-#ifndef GLEW_INCLUDE
-#include <GL/glew.h>
-#else
-#include GLEW_INCLUDE
-#endif
-
-#ifdef HAVE_LIBGL
-#ifdef HAVE_LIBOSMESA
-#define GLEW_OSMESA
-#define APIENTRY
-#endif
-
-#include "GL/glew.c"
-#endif /* HAVE_LIBGL */
diff --git a/graphics/asymptote/glrender.cc b/graphics/asymptote/glrender.cc
index e3d8973be1..e35d34c4ba 100644
--- a/graphics/asymptote/glrender.cc
+++ b/graphics/asymptote/glrender.cc
@@ -11,8 +11,14 @@
#include <stdlib.h>
#include <fstream>
#include <cstring>
+#include <cmath>
+#include <chrono>
+#include <thread>
+
+#if !defined(_WIN32)
#include <sys/time.h>
#include <unistd.h>
+#endif
#include "common.h"
#include "locate.h"
@@ -64,10 +70,6 @@ pthread_t mainthread;
#include "GLTextures.h"
#include "EXRFiles.h"
-#ifdef HAVE_LIBOPENIMAGEIO
-#include <OpenImageIO/imageio.h>
-#endif
-
using settings::locateFile;
using utils::stopWatch;
@@ -485,7 +487,11 @@ GLTexture3<float,GL_FLOAT> fromEXR3(
std::copy(fil3.getData(),fil3.getData()+imSize,std::back_inserter(data));
}
- return GLTexture3<float,GL_FLOAT> {data.data(),std::tuple<int,int,int>(wi,ht,count),textureNumber,fmt};
+ return GLTexture3<float,GL_FLOAT> {
+ data.data(),
+ std::tuple<int,int,int>(wi,ht,static_cast<int>(count)),textureNumber,
+ fmt
+ };
}
void initIBL()
@@ -1206,12 +1212,7 @@ void nextframe()
double seconds=frameTimer.seconds(true);
delay -= seconds;
if(delay > 0) {
- timespec req;
- timespec rem;
- req.tv_sec=(unsigned int) delay;
- req.tv_nsec=(unsigned int) (1.0e9*(delay-req.tv_sec));
- while(nanosleep(&req,&rem) < 0 && errno == EINTR)
- req=rem;
+ std::this_thread::sleep_for(std::chrono::duration<double>(delay));
}
if(Step) Animate=false;
}
@@ -1255,10 +1256,12 @@ void display()
queueExport=false;
}
if(!glthread) {
+#if !defined(_WIN32)
if(Oldpid != 0 && waitpid(Oldpid,NULL,WNOHANG) != Oldpid) {
kill(Oldpid,SIGHUP);
Oldpid=0;
}
+#endif
}
}
@@ -1323,7 +1326,9 @@ void reshape(int width, int height)
static bool initialize=true;
if(initialize) {
initialize=false;
+#if !defined(_WIN32)
Signal(SIGUSR1,updateHandler);
+#endif
}
}
@@ -1924,41 +1929,36 @@ bool NVIDIA()
#endif /* HAVE_GL */
// angle=0 means orthographic.
-void glrender(const string& prefix, const picture *pic, const string& format,
- double width, double height, double angle, double zoom,
- const triple& m, const triple& M, const pair& shift,
- const pair& margin, double *t, double *tup,
- double *background, size_t nlightsin, triple *lights,
- double *diffuse, double *specular, bool view, int oldpid)
+void glrender(GLRenderArgs const& args, int oldpid)
{
Iconify=getSetting<bool>("iconify");
- if(zoom == 0.0) zoom=1.0;
+ auto zoomVal = fpclassify(args.zoom) == FP_NORMAL ? args.zoom : 1.0;
- Prefix=prefix;
- Picture=pic;
- Format=format;
+ Prefix=args.prefix;
+ Picture=args.pic;
+ Format=args.format;
- nlights0=nlights=nlightsin;
+ nlights0=nlights=args.nlights;
- Lights=lights;
- Diffuse=diffuse;
- Specular=specular;
- View=view;
- Angle=angle*radians;
- Zoom0=zoom;
+ Lights=args.lights;
+ Diffuse=args.diffuse;
+ Specular=args.specular;
+ View=args.view;
+ Angle=args.angle*radians;
+ Zoom0=zoomVal;
Oldpid=oldpid;
- Shift=shift/zoom;
- Margin=margin;
+ Shift=args.shift/zoomVal;
+ Margin=args.margin;
for(size_t i=0; i < 4; ++i)
- Background[i]=background[i];
+ Background[i]=args.background[i];
- Xmin=m.getx();
- Xmax=M.getx();
- Ymin=m.gety();
- Ymax=M.gety();
- Zmin=m.getz();
- Zmax=M.getz();
+ Xmin=args.m.getx();
+ Xmax=args.M.getx();
+ Ymin=args.m.gety();
+ Ymax=args.M.gety();
+ Zmin=args.m.getz();
+ Zmax=args.M.getz();
haveScene=Xmin < Xmax && Ymin < Ymax && Zmin < Zmax;
orthographic=Angle == 0.0;
@@ -1973,8 +1973,8 @@ void glrender(const string& prefix, const picture *pic, const string& format,
if(maxTileWidth <= 0) maxTileWidth=1024;
if(maxTileHeight <= 0) maxTileHeight=768;
- bool v3d=format == "v3d";
- bool webgl=format == "html";
+ bool v3d=args.format == "v3d";
+ bool webgl=args.format == "html";
bool format3d=webgl || v3d;
#ifdef HAVE_GL
@@ -2006,10 +2006,10 @@ void glrender(const string& prefix, const picture *pic, const string& format,
#endif
for(int i=0; i < 16; ++i)
- T[i]=t[i];
+ T[i]=args.t[i];
for(int i=0; i < 16; ++i)
- Tup[i]=tup[i];
+ Tup[i]=args.tup[i];
static bool initialized=false;
@@ -2026,9 +2026,9 @@ void glrender(const string& prefix, const picture *pic, const string& format,
if(antialias) expand *= 2.0;
}
- oWidth=width;
- oHeight=height;
- Aspect=width/height;
+ oWidth=args.width;
+ oHeight=args.height;
+ Aspect=args.width/args.height;
// Force a hard viewport limit to work around direct rendering bugs.
// Alternatively, one can use -glOptions=-indirect (with a performance
@@ -2046,8 +2046,8 @@ void glrender(const string& prefix, const picture *pic, const string& format,
if(screenHeight <= 0) screenHeight=maxHeight;
else screenHeight=min(screenHeight,maxHeight);
- fullWidth=(int) ceil(expand*width);
- fullHeight=(int) ceil(expand*height);
+ fullWidth=(int) ceil(expand*args.width);
+ fullHeight=(int) ceil(expand*args.height);
if(format3d) {
Width=fullWidth;
@@ -2141,7 +2141,7 @@ void glrender(const string& prefix, const picture *pic, const string& format,
glutSetOption(GLUT_MULTISAMPLE,multisample);
#endif
#endif
- string title=string(settings::PROGRAM)+": "+prefix;
+ string title=string(PACKAGE_NAME)+": "+args.prefix;
fpu_trap(false); // Work around FE_INVALID
window=glutCreateWindow(title.c_str());
fpu_trap(settings::trap());
@@ -2230,7 +2230,7 @@ void glrender(const string& prefix, const picture *pic, const string& format,
setBuffers();
}
- glClearColor(background[0],background[1],background[2],background[3]);
+ glClearColor(args.background[0],args.background[1],args.background[2],args.background[3]);
#ifdef HAVE_LIBGLUT
#ifndef HAVE_LIBOSMESA
@@ -2289,12 +2289,16 @@ void glrender(const string& prefix, const picture *pic, const string& format,
if(havewindow) {
readyAfterExport=true;
#ifdef HAVE_PTHREAD
+#if !defined(_WIN32)
pthread_kill(mainthread,SIGUSR1);
#endif
+#endif
} else {
initialized=true;
readyAfterExport=true;
+#if !defined(_WIN32)
Signal(SIGUSR1,exportHandler);
+#endif
exportHandler();
}
} else {
diff --git a/graphics/asymptote/glrender.h b/graphics/asymptote/glrender.h
index 2b3285b157..7d297765ec 100644
--- a/graphics/asymptote/glrender.h
+++ b/graphics/asymptote/glrender.h
@@ -21,15 +21,7 @@
#ifdef HAVE_GL
#include <csignal>
-
-#define GLEW_NO_GLU
-
-#ifdef __MSDOS__
-#define GLEW_STATIC
-#define _WIN32
-#endif
-
-#include "GL/glew.h"
+#include <GL/glew.h>
#ifdef __APPLE__
#define GL_SILENCE_DEPRECATION
@@ -52,13 +44,6 @@
#else
-#ifdef __MSDOS__
-#undef _WIN32
-#include <GL/gl.h>
-#include <GL/wglew.h>
-#include <GL/wglext.h>
-#endif
-
#ifdef HAVE_LIBGLUT
#include <GL/glut.h>
#endif
@@ -168,13 +153,30 @@ GLuint initHDR();
projection camera(bool user=true);
-void glrender(const string& prefix, const camp::picture* pic,
- const string& format, double width, double height, double angle,
- double zoom, const camp::triple& m, const camp::triple& M,
- const camp::pair& shift, const camp::pair& margin,
- double *t, double *tup,
- double *background, size_t nlights, camp::triple *lights,
- double *diffuse, double *specular, bool view, int oldpid=0);
+struct GLRenderArgs
+{
+ string prefix;
+ camp::picture* pic;
+ string format;
+ double width;
+ double height;
+ double angle;
+ double zoom;
+ camp::triple m;
+ camp::triple M;
+ camp::pair shift;
+ camp::pair margin;
+ double *t;
+ double *tup;
+ double *background;
+ size_t nlights;
+ camp::triple *lights;
+ double *diffuse;
+ double *specular;
+ bool view;
+};
+
+void glrender(GLRenderArgs const& args, int oldpid=0);
extern const double *dprojView;
extern const double *dView;
diff --git a/graphics/asymptote/gsl.cc b/graphics/asymptote/gsl.cc
index f058773624..55a625e8fa 100644
--- a/graphics/asymptote/gsl.cc
+++ b/graphics/asymptote/gsl.cc
@@ -5,7 +5,9 @@
* Initialize gsl builtins.
*****/
+#if defined(HAVE_CONFIG_H)
#include "config.h"
+#endif
#ifdef HAVE_LIBGSL
diff --git a/graphics/asymptote/interact.cc b/graphics/asymptote/interact.cc
index 1009b1d477..e7cf959732 100644
--- a/graphics/asymptote/interact.cc
+++ b/graphics/asymptote/interact.cc
@@ -8,13 +8,20 @@
#include <cassert>
#include <iostream>
#include <sstream>
-#include <sys/wait.h>
#include <sys/types.h>
-#include <unistd.h>
#include <csignal>
#include <cstdio>
#include <cstring>
+#if !defined(_WIN32)
+#include <sys/wait.h>
+#include <unistd.h>
+#else
+#include <Windows.h>
+#include <io.h>
+#define isatty _isatty
+#endif
+
#include "interact.h"
#include "runhistory.h"
@@ -40,6 +47,10 @@ extern "C" rl_compentry_func_t *rl_completion_entry_function;
#include "util.h"
#include "errormsg.h"
+#if !defined(_WIN32)
+#define _fdopen fdopen
+#endif
+
using namespace settings;
namespace run {
@@ -122,7 +133,10 @@ void pre_readline()
{
int fd=intcast(settings::getSetting<Int>("inpipe"));
if(fd >= 0) {
- if(!fin) fin=fdopen(fd,"r");
+ if(!fin)
+ {
+ fin=_fdopen(fd,"r");
+ }
if(!fin) {
cerr << "Cannot open inpipe " << fd << endl;
exit(-1);
@@ -183,7 +197,7 @@ string simpleline(string prompt) {
#endif
{
cout << endl;
- throw eof();
+ throw EofException();
}
return "";
}
diff --git a/graphics/asymptote/keywords.cc b/graphics/asymptote/keywords.h
index 19c9bbe4df..19c9bbe4df 100644
--- a/graphics/asymptote/keywords.cc
+++ b/graphics/asymptote/keywords.h
diff --git a/graphics/asymptote/keywords.pl b/graphics/asymptote/keywords.pl
index d3b48c5220..f663290f98 100755..100644
--- a/graphics/asymptote/keywords.pl
+++ b/graphics/asymptote/keywords.pl
@@ -7,14 +7,29 @@
# keywords are used in autocompletion at the interactive prompt.
#####
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+my $camplfile;
+my $output_keywords_file;
+my $process_file;
+
+GetOptions(
+ "camplfile=s" => \$camplfile,
+ "output=s" => \$output_keywords_file,
+ "process-file=s" => \$process_file
+) || die("Argument error");
+
# Extra keywords to add that aren't automatically extracted, currently none.
-@extrawords = ();
+my @extrawords = ();
-open(keywords, ">keywords.cc") ||
- die("Couldn't open keywords.out for writing.");
+open(my $keywords, ">$output_keywords_file") ||
+ die("Couldn't open $output_keywords_file for writing.");
-print keywords <<END;
+print $keywords <<END;
/*****
* This file is automatically generated by keywords.pl.
* Changes will be overwritten.
@@ -23,24 +38,23 @@ print keywords <<END;
END
sub add {
- print keywords "ADD(".$_[0].");\n";
+ print $keywords "ADD(".$_[0].");\n";
}
-foreach $word (@extrawords) {
+foreach my $word (@extrawords) {
add($word);
}
-
-open(camp, "camp.l") || die("Couldn't open camp.l");
+open(my $camp, $camplfile) || die("Couldn't open $camplfile");
# Search for the %% separator, after which the definitions start.
-while (<camp>) {
+while (<$camp>) {
if (/^%%\s*$/) {
last; # Break out of the loop.
}
}
# Grab simple keyword definitions from camp.l
-while (<camp>) {
+while (<$camp>) {
if (/^%%\s*$/) {
last; # A second %% indicates the end of definitions.
}
@@ -50,11 +64,14 @@ while (<camp>) {
}
# Grab the special commands from the interactive prompt.
-open(process, "process.cc") || dir("Couldn't open process.cc");
+open(my $process, $process_file) || die("Couldn't open $process_file");
-while (<process>) {
+while (<$process>) {
if (/^\s*ADDCOMMAND\(\s*([A-Za-z_][A-Za-z0-9_]*),/) {
add($1);
}
}
+close($process);
+close($keywords);
+close($camp);
diff --git a/graphics/asymptote/lex.yy.cc b/graphics/asymptote/lex.yy.cc
index 56f0af8529..68a4e3c482 100644
--- a/graphics/asymptote/lex.yy.cc
+++ b/graphics/asymptote/lex.yy.cc
@@ -823,7 +823,7 @@ Int tokPos;
Int charPos;
//int commentDepth = 0;
-bool eof;
+bool isEof;
string eofMessage;
extern errorstream em;
@@ -846,7 +846,7 @@ void setlexer(input_f input, string filename)
yy_input = input;
tokPos = charPos = 1;
- eof=false;
+ isEof=false;
eofMessage="<no eof>";
}
@@ -935,7 +935,7 @@ void error(void)
// the error message that should be reported, and may differ if, say the input
// ends in the middle of a string or comment.
void setEOF(string message) {
- eof=true;
+ isEof=true;
eofMessage=message;
}
@@ -943,13 +943,13 @@ void setEOF(string message) {
// running out of input.
bool lexerEOF()
{
- return eof;
+ return isEof;
}
// Called by code outside of the lexer when it wants to report the unexpected
// eof as an error (instead of looking for more input).
void reportEOF() {
- assert(eof);
+ assert(isEof);
error();
em << eofMessage;
em.sync(true);
@@ -1940,7 +1940,7 @@ YY_RULE_SETUP
case 103:
YY_RULE_SETUP
#line 378 "camp.l"
-{adjust(); return THIS; }
+{adjust(); return THIS_TOK; }
YY_BREAK
case 104:
YY_RULE_SETUP
diff --git a/graphics/asymptote/locate.cc b/graphics/asymptote/locate.cc
index d1c11a1f27..afea7272d0 100644
--- a/graphics/asymptote/locate.cc
+++ b/graphics/asymptote/locate.cc
@@ -5,14 +5,11 @@
* Locate files in search path.
*****/
-#include <unistd.h>
-
#include "settings.h"
#include "util.h"
#include "locate.h"
-
namespace settings {
namespace fs {
@@ -28,7 +25,7 @@ string extension(string name)
bool exists(string filename)
{
- return ::access(filename.c_str(), R_OK) == 0;
+ return fileExists(filename);
}
} // namespace fs
@@ -66,28 +63,14 @@ string locateFile(string id, bool full, string suffix)
{
if(id.empty()) return "";
file_list_t filenames = mungeFileName(id,suffix);
- for (file_list_t::iterator leaf = filenames.begin();
- leaf != filenames.end();
- ++leaf) {
-#ifdef __MSDOS__
- size_t p;
- while ((p=leaf->find('\\')) < string::npos)
- (*leaf)[p]='/';
- if ((p=leaf->find(':')) < string::npos && p > 0) {
- (*leaf)[p]='/';
- leaf->insert(0,"/cygdrive/");
- }
-#endif
-
- if ((*leaf)[0] == '/') {
- string file = *leaf;
+ for (auto const& leaf : filenames) {
+ if (leaf[0] == '/') { // FIXME: Add windows path check
+ string file = leaf;
if (fs::exists(file))
return file;
} else {
- for (file_list_t::iterator dir = searchPath.begin();
- dir != searchPath.end();
- ++dir) {
- string file = join(*dir,*leaf,full);
+ for (auto const& dir : searchPath) {
+ string file = join(dir,leaf,full);
if (fs::exists(file))
return file;
}
@@ -97,5 +80,3 @@ string locateFile(string id, bool full, string suffix)
}
} // namespace settings
-
-
diff --git a/graphics/asymptote/lspserv.cc b/graphics/asymptote/lspserv.cc
index 6ec74e2ccf..c4f00ceecd 100644
--- a/graphics/asymptote/lspserv.cc
+++ b/graphics/asymptote/lspserv.cc
@@ -2,10 +2,11 @@
// Created by Supakorn on 5/13/2021.
//
-#include "common.h"
+#if HAVE_CONFIG_H
+#include "config.h"
+#endif
#ifdef HAVE_LSP
-
#include "lspserv.h"
#include <LibLsp/JsonRpc/stream.h>
@@ -18,8 +19,9 @@
#include <thread>
+#include "common.h"
#include "dec.h"
-#include "process.h"
+#include "asyprocess.h"
#include "locate.h"
#define REGISTER_REQ_FN(typ, fn) remoteEndPoint->registerHandler(\
@@ -54,6 +56,8 @@ namespace AsymptoteLsp
}
};
+#if defined(LINUX_SYSTEM) // WSL mode is only relevant if we are compiling under linux
+
std::string wslDos2Unix(std::string const& dosPath)
{
bool isDrivePath=false;
@@ -110,6 +114,7 @@ std::string wslUnix2Dos(std::string const& unixPath)
return std::string(fullPath);
}
}
+#endif
TextDocumentHover::Either fromString(std::string const& str)
{
@@ -151,8 +156,12 @@ std::string wslUnix2Dos(std::string const& unixPath)
std::string getDocIdentifierRawPath(lsTextDocumentIdentifier const& textDocIdentifier)
{
lsDocumentUri fileUri(textDocIdentifier.uri);
+#if defined(LINUX_SYSTEM)
std::string rawPath=settings::getSetting<bool>("wsl") ?
wslDos2Unix(fileUri.GetRawPath()) : std::string(fileUri.GetRawPath());
+#else
+ std::string rawPath=std::string(fileUri.GetRawPath());
+#endif
return static_cast<std::string>(rawPath);
}
@@ -587,8 +596,12 @@ std::string wslUnix2Dos(std::string const& unixPath)
auto& posEnd=std::get<2>(posRange);
lsRange rng(toLsPosition(posBegin), toLsPosition(posEnd));
+#if defined(LINUX_SYSTEM)
std::string filReturn(
settings::getSetting<bool>("wsl") ? static_cast<std::string>(wslUnix2Dos(fil)) : fil);
+#else
+ std::string filReturn(fil);
+#endif
lsDocumentUri uri(filReturn);
return lsLocation(uri, rng);
@@ -599,7 +612,11 @@ std::string wslUnix2Dos(std::string const& unixPath)
//#pragma endregion
void AsymptoteLspServer::reloadFile(std::string const& filename)
{
+#if defined(LINUX_SYSTEM)
std::string rawPath=settings::getSetting<bool>("wsl") ? wslDos2Unix(filename) : std::string(filename);
+#else
+ std::string rawPath(filename);
+#endif
reloadFileRaw(static_cast<std::string>(rawPath));
}
diff --git a/graphics/asymptote/lspserv.h b/graphics/asymptote/lspserv.h
index 44f6b8978e..286c75b6c8 100644
--- a/graphics/asymptote/lspserv.h
+++ b/graphics/asymptote/lspserv.h
@@ -1,6 +1,4 @@
#pragma once
-#include "common.h"
-#include "symbolmaps.h"
#include "LibLsp/lsp/ProtocolJsonHandler.h"
#include "LibLsp/lsp/AbsolutePath.h"
@@ -23,12 +21,16 @@
#include "LibLsp/lsp/textDocument/did_change.h"
#include "LibLsp/lsp/textDocument/did_save.h"
#include "LibLsp/lsp/textDocument/did_close.h"
+#include "LibLsp/JsonRpc/stream.h"
+
+
+#include "common.h"
+#include "symbolmaps.h"
//everything else
#include <functional>
#include <cctype>
#include <unordered_map>
-#include "LibLsp/JsonRpc/stream.h"
namespace absyntax
{
@@ -81,8 +83,11 @@ namespace AsymptoteLsp
TextDocumentHover::Either fromMarkedStr(std::vector<std::string> const& stringList,
std::string const& language="asymptote");
+#if defined(LINUX_SYSTEM)
+ // these functions have no use for apple or windows builds
std::string wslDos2Unix(std::string const& dosPath);
std::string wslUnix2Dos(std::string const& unixPath);
+#endif
std::string getDocIdentifierRawPath(lsTextDocumentIdentifier const&);
typedef std::unordered_map<std::string, std::unique_ptr<SymbolContext>> SymContextFilemap;
diff --git a/graphics/asymptote/main.cc b/graphics/asymptote/main.cc
index 5f440c24c7..bbb664c1b4 100644
--- a/graphics/asymptote/main.cc
+++ b/graphics/asymptote/main.cc
@@ -26,10 +26,11 @@
#include <iostream>
#include <cstdlib>
#include <cerrno>
-#include <sys/wait.h>
#include <sys/types.h>
-#define GC_PTHREAD_SIGMASK_NEEDED
+#if !defined(_WIN32)
+#include <sys/wait.h>
+#endif
#include "common.h"
@@ -37,29 +38,31 @@
#include <sigsegv.h>
#endif
+#define GC_PTHREAD_SIGMASK_NEEDED
+
+#ifdef HAVE_LSP
+#include "lspserv.h"
+#endif
+
+#include "exithandlers.h"
#include "errormsg.h"
#include "fpu.h"
#include "settings.h"
#include "locate.h"
#include "interact.h"
#include "fileio.h"
+#include "stack.h"
#ifdef HAVE_LIBFFTW3
#include "fftw++.h"
#endif
-#ifdef HAVE_LSP
-#include "lspserv.h"
+#if defined(_WIN32)
+#include <combaseapi.h>
#endif
#include "stack.h"
-#ifdef HAVE_LIBCURSES
-#ifdef HAVE_LIBREADLINE
-#include <readline/readline.h>
-#endif
-#endif
-
using namespace settings;
using interact::interactive;
@@ -109,31 +112,10 @@ void setsignal(void (*handler)(int))
mystack,sizeof (mystack));
sigsegv_install_handler(&sigsegv_handler);
#endif
+#if !defined(_WIN32)
Signal(SIGBUS,handler);
- Signal(SIGFPE,handler);
-}
-
-void signalHandler(int)
-{
- // Print the position and trust the shell to print an error message.
- em.runtime(vm::getPos());
-
- Signal(SIGBUS,SIG_DFL);
- Signal(SIGFPE,SIG_DFL);
-}
-
-void interruptHandler(int)
-{
-#ifdef HAVE_LIBFFTW3
- fftwpp::saveWisdom();
#endif
- em.Interrupt(true);
-}
-
-bool hangup=false;
-void hangup_handler(int sig)
-{
- hangup=true;
+ Signal(SIGFPE,handler);
}
struct Args
@@ -143,11 +125,6 @@ struct Args
Args(int argc, char **argv) : argc(argc), argv(argv) {}
};
-int returnCode()
-{
- return em.processStatus() || interact::interactive ? 0 : 1;
-}
-
void *asymain(void *A)
{
setsignal(signalHandler);
@@ -157,6 +134,11 @@ void *asymain(void *A)
fftwpp::wisdomName=".wisdom";
#endif
+#if defined(_WIN32)
+ // see https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecuteexa
+ CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
+#endif
+
if(interactive) {
Signal(SIGINT,interruptHandler);
#ifdef HAVE_LSP
@@ -191,8 +173,11 @@ void *asymain(void *A)
int n=numArgs();
if(n == 0) {
int inpipe=intcast(settings::getSetting<Int>("inpipe"));
- if(inpipe >= 0) {
+ bool hasInpipe=inpipe >= 0;
+ if(hasInpipe) {
+#if !defined(_WIN32)
Signal(SIGHUP,hangup_handler);
+#endif
camp::openpipeout();
fprintf(camp::pipeout,"\n");
fflush(camp::pipeout);
@@ -231,8 +216,12 @@ void *asymain(void *A)
#endif
if(getSetting<bool>("wait")) {
+#if defined(_WIN32)
+#pragma message("TODO: wait option not implement yet")
+#else
int status;
while(wait(&status) > 0);
+#endif
}
#ifdef HAVE_GL
#ifdef HAVE_PTHREAD
@@ -249,20 +238,17 @@ void *asymain(void *A)
exit(returnCode());
}
-void exitHandler(int)
-{
-#if defined(HAVE_READLINE) && defined(HAVE_LIBCURSES)
- rl_cleanup_after_signal();
-#endif
- exit(returnCode());
-}
-
int main(int argc, char *argv[])
{
#ifdef HAVE_LIBGSL
+#if defined(_WIN32)
+ _putenv("GSL_RNG_SEED=");
+ _putenv("GSL_RNG_TYPE=");
+#else
unsetenv("GSL_RNG_SEED");
unsetenv("GSL_RNG_TYPE");
#endif
+#endif
setsignal(signalHandler);
try {
@@ -273,7 +259,12 @@ int main(int argc, char *argv[])
Args args(argc,argv);
#ifdef HAVE_GL
-#ifdef __APPLE__
+#if defined(__APPLE__) || defined(_WIN32)
+
+#if defined(_WIN32)
+#pragma message("TODO: Check if (1) we need detach-based gl renderer")
+#endif
+
bool usethreads=true;
#else
bool usethreads=view();
@@ -284,14 +275,36 @@ int main(int argc, char *argv[])
if(gl::glthread) {
pthread_t thread;
try {
- if(pthread_create(&thread,NULL,asymain,&args) == 0) {
+#if defined(_WIN32)
+ auto asymainPtr = [](void* args) -> void*
+ {
+#if defined(USEGC)
+ GC_stack_base gsb {};
+ GC_get_stack_base(&gsb);
+ GC_register_my_thread(&gsb);
+#endif
+ auto* ret = asymain(args);
+
+#if defined(USEGC)
+ GC_unregister_my_thread();
+#endif
+ return reinterpret_cast<void*>(ret);
+ };
+#else
+ auto* asymainPtr = asymain;
+#endif
+ if(pthread_create(&thread,NULL,asymainPtr,&args) == 0) {
gl::mainthread=pthread_self();
+#if !defined(_WIN32)
sigset_t set;
sigemptyset(&set);
sigaddset(&set, SIGCHLD);
pthread_sigmask(SIG_BLOCK, &set, NULL);
+#endif
for(;;) {
+#if !defined(_WIN32)
Signal(SIGURG,exitHandler);
+#endif
camp::glrenderWrapper();
gl::initialize=true;
}
@@ -306,9 +319,3 @@ int main(int argc, char *argv[])
#endif
asymain(&args);
}
-
-#ifdef USEGC
-GC_API void GC_CALL GC_throw_bad_alloc() {
- std::bad_alloc();
-}
-#endif
diff --git a/graphics/asymptote/memory.cc b/graphics/asymptote/memory.cc
new file mode 100644
index 0000000000..8715483a85
--- /dev/null
+++ b/graphics/asymptote/memory.cc
@@ -0,0 +1,74 @@
+/**
+ * @file memory.cc
+ * @brief Implementation of certain gc-related functions
+ */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include "memory.h"
+#include <memory>
+
+// asy_malloc functions + GC_throw_bad_alloc
+
+#if defined(USEGC)
+
+void* asy_malloc(size_t n)
+{
+#ifdef GC_DEBUG
+ if(void *mem=GC_debug_malloc_ignore_off_page(n, GC_EXTRAS))
+#else
+ if(void *mem=GC_malloc_ignore_off_page(n))
+#endif
+ return mem;
+ throw std::bad_alloc();
+}
+
+void* asy_malloc_atomic(size_t n)
+{
+#ifdef GC_DEBUG
+ if(void *mem=GC_debug_malloc_atomic_ignore_off_page(n, GC_EXTRAS))
+#else
+ if(void *mem=GC_malloc_atomic_ignore_off_page(n))
+#endif
+ return mem;
+ throw std::bad_alloc();
+}
+
+#if !defined(_WIN32)
+GC_API void GC_CALL GC_throw_bad_alloc()
+{
+ throw std::bad_alloc();
+}
+#endif
+
+#endif // defined(USEGC)
+
+// compact & stdString functions
+
+namespace mem
+{
+#if defined(USEGC)
+
+void compact(int x)
+{
+ GC_set_dont_expand(x);
+}
+
+std::string stdString(string s)
+{
+ return std::string(s.c_str());
+}
+
+#else // defined(USEGC)
+
+std::string stdString(string s)
+{
+ return s;
+}
+
+#endif // defined(USEGC)
+}
+
+// throw bad alloc
diff --git a/graphics/asymptote/memory.h b/graphics/asymptote/memory.h
index 3ddc2aaea1..7804e00520 100644
--- a/graphics/asymptote/memory.h
+++ b/graphics/asymptote/memory.h
@@ -52,35 +52,16 @@
#define GC_ATTR_EXPLICIT
#define GC_NOEXCEPT
#endif
-#include <gc.h>
+#include <gc/gc.h>
#ifdef GC_DEBUG
extern "C" {
-#include <gc_backptr.h>
+#include <gc/gc_backptr.h>
}
#endif
-inline void *asy_malloc(size_t n)
-{
-#ifdef GC_DEBUG
- if(void *mem=GC_debug_malloc_ignore_off_page(n, GC_EXTRAS))
-#else
- if(void *mem=GC_malloc_ignore_off_page(n))
-#endif
- return mem;
- throw std::bad_alloc();
-}
-
-inline void *asy_malloc_atomic(size_t n)
-{
-#ifdef GC_DEBUG
- if(void *mem=GC_debug_malloc_atomic_ignore_off_page(n, GC_EXTRAS))
-#else
- if(void *mem=GC_malloc_atomic_ignore_off_page(n))
-#endif
- return mem;
- throw std::bad_alloc();
-}
+void* asy_malloc(size_t n);
+void* asy_malloc_atomic(size_t n);
#undef GC_MALLOC
#undef GC_MALLOC_ATOMIC
@@ -88,8 +69,8 @@ inline void *asy_malloc_atomic(size_t n)
#define GC_MALLOC(sz) asy_malloc(sz)
#define GC_MALLOC_ATOMIC(sz) asy_malloc_atomic(sz)
-#include <gc_allocator.h>
-#include <gc_cpp.h>
+#include <gc/gc_allocator.h>
+#include <gc/gc_cpp.h>
#define gc_allocator gc_allocator_ignore_off_page
@@ -191,8 +172,8 @@ typedef std::basic_ostringstream<char,std::char_traits<char>,
gc_allocator<char> > ostringstream;
typedef std::basic_stringbuf<char,std::char_traits<char>,
gc_allocator<char> > stringbuf;
-inline void compact(int x) {GC_set_dont_expand(x);}
-inline std::string stdString(string s) {return std::string(s.c_str());}
+
+void compact(int x);
#else
inline void compact(int) {}
typedef std::string string;
@@ -200,9 +181,10 @@ typedef std::stringstream stringstream;
typedef std::istringstream istringstream;
typedef std::ostringstream ostringstream;
typedef std::stringbuf stringbuf;
-inline std::string stdString(string s) {return s;}
#endif // USEGC
+std::string stdString(string s);
+
} // namespace mem
#endif
diff --git a/graphics/asymptote/aspy.py b/graphics/asymptote/misc/aspy.py
index 6c657c7bde..6c657c7bde 100644
--- a/graphics/asymptote/aspy.py
+++ b/graphics/asymptote/misc/aspy.py
diff --git a/graphics/asymptote/profile.py b/graphics/asymptote/misc/profile.py
index bfdd52015b..bfdd52015b 100644
--- a/graphics/asymptote/profile.py
+++ b/graphics/asymptote/misc/profile.py
diff --git a/graphics/asymptote/testv3d.asy b/graphics/asymptote/misc/testv3d.asy
index ab558f7fd4..ab558f7fd4 100644
--- a/graphics/asymptote/testv3d.asy
+++ b/graphics/asymptote/misc/testv3d.asy
diff --git a/graphics/asymptote/opsymbols.pl b/graphics/asymptote/opsymbols.pl
index 06491ad1c6..37c87d1676 100755..100644
--- a/graphics/asymptote/opsymbols.pl
+++ b/graphics/asymptote/opsymbols.pl
@@ -6,10 +6,23 @@
# Extract mapping such as '+' --> SYM_PLUS from camp.l
#####
-open(header, ">opsymbols.h") ||
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+my $campfile;
+my $outfile;
+
+GetOptions(
+ 'campfile=s' => \$campfile,
+ 'output=s' => \$outfile
+) || die("Argument errors");
+
+open(my $header, ">$outfile") ||
die("Couldn't open opsymbols.h for writing");
-print header <<END;
+print $header <<END;
/*****
* This file is automatically generated by opsymbols.pl
* Changes will be overwritten.
@@ -26,13 +39,14 @@ print header <<END;
END
sub add {
- print header "OPSYMBOL(\"".$_[0]."\", " . $_[1] . ");\n";
+ print $header "OPSYMBOL(\"".$_[0]."\", " . $_[1] . ");\n";
}
-open(lexer, "camp.l") ||
+
+open(my $lexer, $campfile) ||
die("Couldn't open camp.l");
-while (<lexer>) {
+while (<$lexer>) {
if (m/^"(\S+)"\s*{\s*DEFSYMBOL\((\w+)\);/) {
add($1, $2);
}
@@ -44,7 +58,7 @@ while (<lexer>) {
}
}
-print header <<END
+print $header <<END
/* This file is automatically generated. */
END
diff --git a/graphics/asymptote/path3.h b/graphics/asymptote/path3.h
index 095d4698af..df4837912a 100644
--- a/graphics/asymptote/path3.h
+++ b/graphics/asymptote/path3.h
@@ -17,10 +17,6 @@
#include "path.h"
#include "arrayop.h"
-// For CYGWIN
-#undef near
-#undef far
-
namespace camp {
void checkEmpty3(Int n);
@@ -287,13 +283,13 @@ public:
triple mintimes() const {
checkEmpty3(n);
bounds();
- return camp::triple(times.left,times.bottom,times.near);
+ return camp::triple(times.leftBound,times.bottomBound,times.nearBound);
}
triple maxtimes() const {
checkEmpty3(n);
bounds();
- return camp::triple(times.right,times.top,times.far);
+ return camp::triple(times.rightBound,times.topBound,times.farBound);
}
template<class T>
diff --git a/graphics/asymptote/picture.cc b/graphics/asymptote/picture.cc
index e7ce1a15f5..a040ffe44b 100644
--- a/graphics/asymptote/picture.cc
+++ b/graphics/asymptote/picture.cc
@@ -16,11 +16,18 @@
#include "drawlayer.h"
#include "drawsurface.h"
#include "drawpath3.h"
+#include "win32helpers.h"
-#ifdef __MSDOS__
-#include "sys/cygwin.h"
+#if defined(_WIN32)
+#include <Windows.h>
+#include <shellapi.h>
+#include <cstdio>
+#define unlink _unlink
#endif
+#include <thread>
+#include <chrono>
+
using std::ifstream;
using std::ofstream;
using vm::array;
@@ -518,7 +525,15 @@ bool picture::texprocess(const string& texname, const string& outname,
string dvipsrc=getSetting<string>("dir");
if(dvipsrc.empty()) dvipsrc=systemDir;
dvipsrc += dirsep+"nopapersize.ps";
+#if !defined(_WIN32)
setenv("DVIPSRC",dvipsrc.c_str(),1);
+#else
+ auto setEnvResult = SetEnvironmentVariableA("DVIPSRC",dvipsrc.c_str());
+ if (!setEnvResult)
+ {
+ camp::reportError("Cannot set DVIPSRC environment variable");
+ }
+#endif
string papertype=getSetting<string>("papertype") == "letter" ?
"letterSize" : "a4size";
cmd.push_back(getSetting<string>("dvips"));
@@ -786,21 +801,44 @@ int picture::epstosvg(const string& epsname, const string& outname,
void htmlView(string name)
{
- mem::vector<string> cmd;
- push_command(cmd,getSetting<string>("htmlviewer"));
-#ifdef __MSDOS__
- ssize_t size=cygwin_conv_path(CCP_POSIX_TO_WIN_A,
- locateFile(name,true).c_str(),NULL,0);
- if(size <= 0) return;
- char filename[size];
- size=cygwin_conv_path(CCP_POSIX_TO_WIN_A,locateFile(name,true).c_str(),
- filename,size);
- cmd.push_back("file://"+string(filename));
+ string const browser=getSetting<string>("htmlviewer");
+ string const htmlFile=locateFile(name, true);
+
+ if (browser.empty())
+ {
+#if defined(_WIN32)
+ // for windows, no browser means to use the windows' default
+ auto const result = reinterpret_cast<INT_PTR>(
+ ShellExecuteA(
+ nullptr,
+ "open",
+ htmlFile.c_str(),
+ nullptr,
+ nullptr,
+ SW_SHOWNORMAL
+ ));
+ // see https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea
+ if (result <= 32)
+ {
+ // error code should be stored in GetLastError
+ w32::reportAndFailWithLastError( "Cannot open browser for viewing");
+ }
#else
- cmd.push_back(locateFile(name,true));
+ reportError("No browser specified; please specify your browser in htmlviewer");
#endif
- push_split(cmd,getSetting<string>("htmlviewerOptions"));
- System(cmd,2,false);
+ }
+ else
+ {
+ string const browserOptions= getSetting<string>("htmlviewerOptions");
+ mem::vector<string> cmd;
+ push_command(cmd, browser);
+ cmd.push_back(htmlFile);
+ if (browserOptions.empty())
+ {
+ push_split(cmd, browserOptions);
+ }
+ System(cmd, 2, false);
+ }
}
bool picture::postprocess(const string& prename, const string& outname,
@@ -882,55 +920,127 @@ bool picture::postprocess(const string& prename, const string& outname,
bool picture::display(const string& outname, const string& outputformat,
bool wait, bool view, bool epsformat)
{
- int status=0;
static mem::map<CONST string,int> pids;
- bool View=settings::view() && view;
+ if (settings::view() && view)
+ {
+ int status;
- if(View) {
- bool pdf=settings::pdf(getSetting<string>("tex"));
- bool pdfformat=(pdf && outputformat == "") || outputformat == "pdf";
+ bool const pdf=settings::pdf(getSetting<string>("tex"));
+ bool pdfformat=(pdf && outputformat.empty()) || outputformat == "pdf";
if(epsformat || pdfformat) {
// Check to see if there is an existing viewer for this outname.
- mem::map<CONST string,int>::iterator p=pids.find(outname);
+ mem::map<CONST string,int>::iterator const p=pids.find(outname);
bool running=(p != pids.end());
- string Viewer=pdfformat ? getSetting<string>("pdfviewer") :
- getSetting<string>("psviewer");
+ string Viewer=
+ pdfformat ?
+ getSetting<string>("pdfviewer") : getSetting<string>("psviewer");
int pid;
if(running) {
pid=p->second;
if(pid)
- running=(waitpid(pid, &status, WNOHANG) != pid);
+ {
+#if defined(_WIN32)
+ running=w32::isProcessRunning(pid);
+#else
+ running= (waitpid(pid, &status, WNOHANG) != pid);
+#endif
+ }
}
bool pdfreload=pdfformat && getSetting<bool>("pdfreload");
if(running) {
+#if defined(_WIN32)
+ if (pdfreload)
+ {
+ reloadPDF(Viewer,outname);
+ }
+#else // win32 does not support reload by sighup
// Tell gv/acroread to reread file.
- if(Viewer == "gv") kill(pid,SIGHUP);
+ if(Viewer == "gv")
+ {
+ kill(pid,SIGHUP);
+ }
else if(pdfreload)
+ {
reloadPDF(Viewer,outname);
+ }
+#endif
} else {
- mem::vector<string> cmd;
- push_command(cmd,Viewer);
- string viewerOptions=getSetting<string>(pdfformat ?
- "pdfviewerOptions" :
- "psviewerOptions");
- if(!viewerOptions.empty())
- push_split(cmd,viewerOptions);
- cmd.push_back(outname);
- status=System(cmd,0,wait,
- pdfformat ? "pdfviewer" : "psviewer",
- pdfformat ? "your PDF viewer" : "your PostScript viewer",
- &pid);
- if(status != 0) return false;
+ // start new process
+ if (Viewer.empty())
+ {
+#if defined(_WIN32)
+ // no viewer, use default
+
+ string const fullOutFilePath= locateFile(outname, true);
+ SHELLEXECUTEINFOA execInfo = {};
+ execInfo.cbSize= sizeof(execInfo);
+ execInfo.hwnd = nullptr;
+ execInfo.lpVerb= "open";
+ execInfo.lpFile= fullOutFilePath.c_str();
+ execInfo.lpDirectory = nullptr;
+ execInfo.nShow= SW_SHOWNORMAL;
+ execInfo.fMask= SEE_MASK_NOCLOSEPROCESS;
+
+ if (!ShellExecuteExA(&execInfo))
+ {
+ return false;
+ }
+
+ if (!w32::checkShellExecuteResult(reinterpret_cast<INT_PTR>(execInfo.hInstApp),false))
+ {
+ // see https://learn.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-shellexecuteinfoa
+ return false;
+ }
+
+ if (execInfo.hProcess!=nullptr)
+ {
+ // wait option does not always work, especially if a new process is not created
+ // for example, if an existing PDF viewer with multiple tabs open is the viewer,
+ // asymptote thinks no process is being created;
+ // in this case, treat it as "no wait"
+ pid=static_cast<int>(GetProcessId(execInfo.hProcess));
+ CloseHandle(execInfo.hProcess);
+ }
+#else
+ cerr << "No viewer specified" << endl;
+ return false;
+#endif
+ }
+ else
+ {
+ string viewerOptions= getSetting<string>(pdfformat ? "pdfviewerOptions" : "psviewerOptions");
+ mem::vector<string> cmd;
+
+ push_command(cmd, Viewer);
+ if (!viewerOptions.empty()) push_split(cmd, viewerOptions);
+ cmd.push_back(outname);
+
+ status=System(cmd,
+ 0,
+ wait,
+ pdfformat ? "pdfviewer" : "psviewer",
+ pdfformat ? "your PDF viewer" : "your PostScript viewer",
+ &pid);
+
+ if (status != 0) return false;
+ }
if(!wait) pids[outname]=pid;
if(pdfreload) {
// Work around race conditions in acroread initialization script
- usleep(getSetting<Int>("pdfreloaddelay"));
- // Only reload if pdf viewer process is already running.
- if(waitpid(pid, &status, WNOHANG) == pid)
+ std::this_thread::sleep_for(std::chrono::microseconds(
+ getSetting<Int>("pdfreloaddelay")
+ ));
+ // Only reload if pdf viewer process is already running
+#if defined(_WIN32)
+ bool processRunning=w32::isProcessRunning(pid);
+#else
+ bool processRunning= waitpid(pid, &status, WNOHANG) == pid;
+#endif
+ if (processRunning)
reloadPDF(Viewer,outname);
}
}
@@ -938,16 +1048,39 @@ bool picture::display(const string& outname, const string& outputformat,
if(outputformat == "svg" || outputformat == "html")
htmlView(outname);
else {
- mem::vector<string> cmd;
- push_command(cmd,getSetting<string>("display"));
- cmd.push_back(outname);
- string application="your "+outputformat+" viewer";
- status=System(cmd,0,wait,"display",application.c_str());
- if(status != 0) return false;
+ string displayProgram=getSetting<string>("display");
+ if (displayProgram.empty())
+ {
+#if defined(_WIN32)
+
+ auto const result = reinterpret_cast<INT_PTR>(ShellExecuteA(
+ nullptr,
+ "open",
+ outname.c_str(), nullptr,
+ nullptr, SW_SHOWNORMAL));
+
+ if (result <= 32)
+ {
+ cerr << "Cannot start display viewer" << endl;
+ return false;
+ }
+#else
+ cerr << "No viewer specified; please specify a viewer in 'display' setting" << endl;
+ return false;
+#endif
+ }
+ else
+ {
+ mem::vector<string> cmd;
+ push_command(cmd, displayProgram);
+ cmd.push_back(outname);
+ string const application= "your " + outputformat + " viewer";
+ status= System(cmd, 0, wait, "display", application.c_str());
+ if (status != 0) return false;
+ }
}
}
}
-
return true;
}
@@ -1308,27 +1441,7 @@ void picture::render(double size2, const triple& Min, const triple& Max,
#endif
}
-struct Communicate : public gc {
- string prefix;
- picture* pic;
- string format;
- double width;
- double height;
- double angle;
- double zoom;
- triple m;
- triple M;
- pair shift;
- pair margin;
- double *t;
- double *tup;
- double *background;
- size_t nlights;
- triple *lights;
- double *diffuse;
- double *specular;
- bool view;
-};
+typedef gl::GLRenderArgs Communicate;
Communicate com;
@@ -1342,10 +1455,7 @@ void glrenderWrapper()
endwait(initSignal,initLock);
#endif
if(allowRender)
- glrender(com.prefix,com.pic,com.format,com.width,com.height,com.angle,
- com.zoom,com.m,com.M,com.shift,com.margin,com.t,com.tup,
- com.background,com.nlights,com.lights,com.diffuse,com.specular,
- com.view);
+ glrender(com);
#endif
}
@@ -1472,6 +1582,7 @@ bool picture::shipout3(const string& prefix, const string& format,
pthread_mutex_lock(&readyLock);
#endif
} else {
+#if !defined(_WIN32)
int pid=fork();
if(pid == -1)
camp::reportError("Cannot fork process");
@@ -1480,13 +1591,36 @@ bool picture::shipout3(const string& prefix, const string& format,
waitpid(pid,NULL,interact::interactive && View ? WNOHANG : 0);
return true;
}
+#else
+#pragma message("TODO: Check if (1) we need detach-based gl renderer")
+#endif
}
#endif
}
#if HAVE_LIBGLM
- glrender(prefix,pic,outputformat,width,height,angle,zoom,m,M,shift,margin,
- t,tup,background,nlights,lights,diffuse,specular,View,oldpid);
+ gl::GLRenderArgs args;
+ args.prefix=prefix;
+ args.pic=pic;
+ args.format=outputformat;
+ args.width=width;
+ args.height=height;
+ args.angle=angle;
+ args.zoom=zoom;
+ args.m=m;
+ args.M=M;
+ args.shift=shift;
+ args.margin=margin;
+ args.t=t;
+ args.tup=tup;
+ args.background=background;
+ args.nlights=nlights;
+ args.lights=lights;
+ args.diffuse=diffuse;
+ args.specular=specular;
+ args.view=View;
+
+ glrender(args,oldpid);
if(format3d) {
string name=buildname(prefix,format);
diff --git a/graphics/asymptote/pipestream.cc b/graphics/asymptote/pipestream.cc
index bdde519e86..c17e7168a9 100644
--- a/graphics/asymptote/pipestream.cc
+++ b/graphics/asymptote/pipestream.cc
@@ -16,11 +16,14 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+#if !defined(_WIN32)
+
#include <iostream>
#include <cstring>
#include <cerrno>
#include <sstream>
-#include <signal.h>
+#include <csignal>
+#include <fcntl.h>
#include "pipestream.h"
#include "common.h"
@@ -222,3 +225,5 @@ void iopipestream::Write(const string &s)
camp::reportFatal("write to pipe failed");
}
}
+
+#endif
diff --git a/graphics/asymptote/pipestream.h b/graphics/asymptote/pipestream.h
index eedad63f6b..1ccab7ecde 100644
--- a/graphics/asymptote/pipestream.h
+++ b/graphics/asymptote/pipestream.h
@@ -19,11 +19,15 @@
#ifndef PIPESTREAM_H
#define PIPESTREAM_H
+#if defined(_WIN32)
+
+#include "win32pipestream.h"
+typedef w32::Win32IoPipeStream iopipestream;
+
+#else
#include <sys/wait.h>
#include <unistd.h>
-#include <fcntl.h>
-
#include "common.h"
// bidirectional stream for reading and writing to pipes
@@ -103,3 +107,4 @@ public:
};
#endif
+#endif
diff --git a/graphics/asymptote/pkg-info.cmake b/graphics/asymptote/pkg-info.cmake
new file mode 100644
index 0000000000..c1f1761318
--- /dev/null
+++ b/graphics/asymptote/pkg-info.cmake
@@ -0,0 +1,16 @@
+# ASY_VERSION is set by base version + suffix, if present
+
+execute_process(
+ COMMAND ${PY3_INTERPRETER} ${CMAKE_CURRENT_LIST_DIR}/determine_pkg_info.py
+ OUTPUT_VARIABLE ASY_VERSION_INFO_RAW_OUTPUT
+) # name, version-base, issue-url, asygl
+
+macro(SET_ASY_VERSION_INFO INDEX OUTPUT_VAR_NAME)
+ list(GET ASY_VERSION_INFO_RAW_OUTPUT ${INDEX} ${OUTPUT_VAR_NAME})
+ message(STATUS "package info: ${OUTPUT_VAR_NAME} = ${${OUTPUT_VAR_NAME}}")
+endmacro()
+
+SET_ASY_VERSION_INFO(0 ASY_PACKAGE_NAME)
+SET_ASY_VERSION_INFO(1 ASY_VERSION_BASE)
+SET_ASY_VERSION_INFO(2 ASY_BUGREPORT)
+SET_ASY_VERSION_INFO(3 ASY_GL_VERSION)
diff --git a/graphics/asymptote/prc/CMakeLists.txt b/graphics/asymptote/prc/CMakeLists.txt
new file mode 100644
index 0000000000..1a032f3705
--- /dev/null
+++ b/graphics/asymptote/prc/CMakeLists.txt
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 3.26)
+project(PRC)
+
+add_library(PRC
+ ${CMAKE_CURRENT_LIST_DIR}/oPRCFile.cc
+ ${CMAKE_CURRENT_LIST_DIR}/PRCbitStream.cc
+ ${CMAKE_CURRENT_LIST_DIR}/PRCdouble.cc
+ ${CMAKE_CURRENT_LIST_DIR}/writePRC.cc
+)
+find_package(ZLIB REQUIRED)
+
+if (CMAKE_CXX_BYTE_ORDER EQUAL BIG_ENDIAN)
+ target_compile_definitions(PRC PUBLIC WORDS_BIGENDIAN=1)
+elseif (NOT CMAKE_CXX_BYTE_ORDER) # only on apple platforms
+ message(STATUS "Targeting multiple platforms with different endianness")
+ target_compile_definitions(PRC PUBLIC UNIVERSAL_ENDIAN_BUILD)
+endif()
+
+target_include_directories(
+ PRC
+ PUBLIC ${CMAKE_CURRENT_LIST_DIR}/include
+)
+
+target_link_libraries(
+ PRC
+ PRIVATE ZLIB::ZLIB
+)
diff --git a/graphics/asymptote/prc/Makefile b/graphics/asymptote/prc/Makefile
deleted file mode 100644
index 23dd32aa3b..0000000000
--- a/graphics/asymptote/prc/Makefile
+++ /dev/null
@@ -1,42 +0,0 @@
-# Makefile.
-
-CFLAGS = -O3 -g -Wall
-CXX = g++
-
-MAKEDEPEND = $(CFLAGS) -O0 -M -DDEPEND
-
-FILES = PRCbitStream oPRCFile PRCdouble writePRC
-
-all: $(FILES:=.o)
-
-#test: $(FILES:=.o) test.o
-# $(CXX) $(CFLAGS) -o test $(FILES:=.o) test.o -lz
-
-#test_tess: $(FILES:=.o) test_tess.o
-# $(CXX) $(CFLAGS) -o test_tess $(FILES:=.o) test_tess.o -lz
-
-#test_mesh: $(FILES:=.o) test_mesh.o
-# $(CXX) $(CFLAGS) -o test_mesh $(FILES:=.o) test_mesh.o -lz
-
-.SUFFIXES: .c .cc .o .d
-.cc.o:
- $(CXX) $(CFLAGS) $(INCL) -o $@ -c $<
-.cc.d:
- @echo Creating $@; \
- rm -f $@; \
- ${CXX} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \
- sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
- rm -f $@.$$$$
-.c.d:
- @echo Creating $@; \
- rm -f $@; \
- ${CC} $(MAKEDEPEND) $(INCL) $(MDOPTS) $< > $@.$$$$ 2>/dev/null && \
- sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
- rm -f $@.$$$$
-
-ifeq (,$(findstring clean,${MAKECMDGOALS}))
--include $(FILES:=.d)
-endif
-
-clean:
- rm -f *.o *.d test test_tess
diff --git a/graphics/asymptote/prc/PRCTools/bitData.cc b/graphics/asymptote/prc/PRCTools/bitData.cc
index 9fba0eb0b1..5314ec3176 100644
--- a/graphics/asymptote/prc/PRCTools/bitData.cc
+++ b/graphics/asymptote/prc/PRCTools/bitData.cc
@@ -18,9 +18,9 @@
*
*************/
-#include "../PRC.h"
-#include "../PRCdouble.h"
#include "bitData.h"
+#include "../include/prc/PRC.h"
+#include "../include/prc/PRCdouble.h"
using std::cout; using std::endl; using std::hex; using std::cerr;
diff --git a/graphics/asymptote/prc/PRCTools/describePRC.cc b/graphics/asymptote/prc/PRCTools/describePRC.cc
index 1efedecb72..2e9ee65f2c 100644
--- a/graphics/asymptote/prc/PRCTools/describePRC.cc
+++ b/graphics/asymptote/prc/PRCTools/describePRC.cc
@@ -24,7 +24,7 @@
#include <string>
#include <sstream>
-#include "../PRC.h"
+#include "../include/prc/PRC.h"
#include "describePRC.h"
using std::ostringstream; using std::cout; using std::endl;
@@ -374,7 +374,7 @@ void describeModelFileData(BitByBitData &mData,
// subsections
// void describe(BitByBitData &mData)
// {
-//
+//
// }
void describeLight(BitByBitData &mData)
@@ -646,7 +646,7 @@ void describeCurvPolyLine(BitByBitData &mData)
unsigned int number_of_points = mData.readUnsignedInt();
cout << getIndent() << "number_of_points " << number_of_points << endl;
-
+
indent();
for(unsigned int i = 0; i < number_of_points; ++i)
{
@@ -785,7 +785,7 @@ void describeTopoLoop(BitByBitData &mData)
indent();
describeBaseTopology(mData);
-
+
cout << getIndent() << "orientation_with_surface "
<< static_cast<unsigned int>(mData.readChar()) << endl;
unsigned int number_of_coedge = mData.readUnsignedInt();
@@ -1089,7 +1089,7 @@ void describeBody(BitByBitData &mData)
describeObject(mData); // curve
break;
- }
+ }
case PRC_TYPE_TOPO_BrepDataCompress:
case PRC_TYPE_TOPO_SingleWireBodyCompress:
cout << getIndent() << "TODO: Unhandled body type " << type << endl;
@@ -1838,7 +1838,7 @@ void describeTextureDefinition(BitByBitData &mData)
cout << getIndent() << "--Texture Definition--" << endl;
if(!checkSectionCode(mData,PRC_TYPE_GRAPH_TextureDefinition))
return;
-
+
cout << getIndent() << "TODO: Can't describe textures yet." << endl;
}
@@ -1913,7 +1913,7 @@ void describeCategory1LineStyle(BitByBitData &mData)
indent();
// This was missing from the docs!!!!! argh!
- describeContentPRCBase(mData,true);
+ describeContentPRCBase(mData,true);
cout << getIndent() << "line_width " << mData.readDouble() << " mm" << endl;
diff --git a/graphics/asymptote/prc/PRCTools/iPRCFile.h b/graphics/asymptote/prc/PRCTools/iPRCFile.h
index 2622cb966d..a66c94a2ec 100644
--- a/graphics/asymptote/prc/PRCTools/iPRCFile.h
+++ b/graphics/asymptote/prc/PRCTools/iPRCFile.h
@@ -21,14 +21,14 @@
#ifndef __READPRC_H
#define __READPRC_H
-#include <iostream>
+#include "../include/prc/PRC.h"
+#include "inflation.h"
#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <sstream>
#include <string>
#include <vector>
-#include <sstream>
-#include <iomanip>
-#include "../PRC.h"
-#include "inflation.h"
struct FileStructureInformation
{
diff --git a/graphics/asymptote/prc/PRCTools/makePRC.cc b/graphics/asymptote/prc/PRCTools/makePRC.cc
index f757300020..7d57e102c4 100644
--- a/graphics/asymptote/prc/PRCTools/makePRC.cc
+++ b/graphics/asymptote/prc/PRCTools/makePRC.cc
@@ -18,12 +18,12 @@
*
*************/
-#include <iostream>
-#include <iomanip>
+#include "../include/prc/oPRCFile.h"
+#include <cstdlib>
#include <fstream>
+#include <iomanip>
+#include <iostream>
#include <unistd.h>
-#include <cstdlib>
-#include "../oPRCFile.h"
using namespace std;
diff --git a/graphics/asymptote/prc/PRCbitStream.cc b/graphics/asymptote/prc/PRCbitStream.cc
index 9b18186a46..15f5ca6cff 100644
--- a/graphics/asymptote/prc/PRCbitStream.cc
+++ b/graphics/asymptote/prc/PRCbitStream.cc
@@ -19,13 +19,13 @@
*
*************/
+#include "prc/PRCbitStream.h"
+#include "prc/PRCdouble.h"
+#include <cassert>
#include <iostream>
-#include <zlib.h>
#include <stdlib.h>
#include <string.h>
-#include <cassert>
-#include "PRCbitStream.h"
-#include "PRCdouble.h"
+#include <zlib.h>
using std::string;
using std::cerr;
diff --git a/graphics/asymptote/prc/PRCdouble.cc b/graphics/asymptote/prc/PRCdouble.cc
index 69d4b02f16..aaf5a8d58d 100644
--- a/graphics/asymptote/prc/PRCdouble.cc
+++ b/graphics/asymptote/prc/PRCdouble.cc
@@ -1,4 +1,4 @@
-#include "PRCdouble.h"
+#include "prc/PRCdouble.h"
// from Adobe's documentation
diff --git a/graphics/asymptote/prc/PRC.h b/graphics/asymptote/prc/include/prc/PRC.h
index 9ce6ea70e0..acb0a44ec6 100644
--- a/graphics/asymptote/prc/PRC.h
+++ b/graphics/asymptote/prc/include/prc/PRC.h
@@ -1,6 +1,8 @@
#ifndef __PRC_H
#define __PRC_H
+#include "PRCuniversalendianness.h"
+
#ifdef _MSC_VER
#if _MSC_VER >= 1600
#include <stdint.h>
@@ -25,8 +27,8 @@ const uint32_t PRCVersion=8137; // For Adobe Reader 9 or later
#define PRC_TYPE_ROOT 0 // This type does not correspond to any entity
-#define PRC_TYPE_ROOT_PRCBase ( PRC_TYPE_ROOT + 1 ) // Abstract root type for any PRC entity.
-#define PRC_TYPE_ROOT_PRCBaseWithGraphics ( PRC_TYPE_ROOT + 2 ) // Abstract root type for any PRC entity which can bear graphics.
+#define PRC_TYPE_ROOT_PRCBase ( PRC_TYPE_ROOT + 1 ) // Abstract root type for any PRC entity.
+#define PRC_TYPE_ROOT_PRCBaseWithGraphics ( PRC_TYPE_ROOT + 2 ) // Abstract root type for any PRC entity which can bear graphics.
#define PRC_TYPE_CRV ( PRC_TYPE_ROOT + 10 ) // Types for PRC geometrical curves
#define PRC_TYPE_SURF ( PRC_TYPE_ROOT + 75 ) // Types for PRC geometrical surfaces
@@ -39,44 +41,44 @@ const uint32_t PRCVersion=8137; // For Adobe Reader 9 or later
#define PRC_TYPE_GRAPH ( PRC_TYPE_ROOT + 700 ) // Types for PRC graphics
#define PRC_TYPE_MATH ( PRC_TYPE_ROOT + 900 ) // Types for PRC mathematical operators
-#define PRC_TYPE_CRV_Base ( PRC_TYPE_CRV + 1 ) // Abstract type for all geometric curves.
-#define PRC_TYPE_CRV_Blend02Boundary ( PRC_TYPE_CRV + 2 ) // Boundary Curve.
-#define PRC_TYPE_CRV_NURBS ( PRC_TYPE_CRV + 3 ) // Non Uniform BSpline curve.
-#define PRC_TYPE_CRV_Circle ( PRC_TYPE_CRV + 4 ) // Circle.
-#define PRC_TYPE_CRV_Composite ( PRC_TYPE_CRV + 5 ) // Array of oriented curves.
-#define PRC_TYPE_CRV_OnSurf ( PRC_TYPE_CRV + 6 ) // Curve defined by a UV curve on a surface.
-#define PRC_TYPE_CRV_Ellipse ( PRC_TYPE_CRV + 7 ) // Ellipse.
-#define PRC_TYPE_CRV_Equation ( PRC_TYPE_CRV + 8 ) // curve described by specific law elements
-#define PRC_TYPE_CRV_Helix ( PRC_TYPE_CRV + 9 ) // Helix curve.
-#define PRC_TYPE_CRV_Hyperbola ( PRC_TYPE_CRV + 10 ) // Hyperbola.
-#define PRC_TYPE_CRV_Intersection ( PRC_TYPE_CRV + 11 ) // Intersection between 2 surfaces.
-#define PRC_TYPE_CRV_Line ( PRC_TYPE_CRV + 12 ) // Line.
-#define PRC_TYPE_CRV_Offset ( PRC_TYPE_CRV + 13 ) // Offset curve.
-#define PRC_TYPE_CRV_Parabola ( PRC_TYPE_CRV + 14 ) // Parabola.
-#define PRC_TYPE_CRV_PolyLine ( PRC_TYPE_CRV + 15 ) // Polyedric curve.
-#define PRC_TYPE_CRV_Transform ( PRC_TYPE_CRV + 16 ) // Transformed curve.
-
-#define PRC_TYPE_SURF_Base ( PRC_TYPE_SURF + 1 ) // Abstract type for all geometric surfaces.
-#define PRC_TYPE_SURF_Blend01 ( PRC_TYPE_SURF + 2 ) // Blend surface.
-#define PRC_TYPE_SURF_Blend02 ( PRC_TYPE_SURF + 3 ) // Blend Surface.
-#define PRC_TYPE_SURF_Blend03 ( PRC_TYPE_SURF + 4 ) // Blend Surface.
-#define PRC_TYPE_SURF_NURBS ( PRC_TYPE_SURF + 5 ) // Non Uniform BSpline surface.
-#define PRC_TYPE_SURF_Cone ( PRC_TYPE_SURF + 6 ) // Cone.
-#define PRC_TYPE_SURF_Cylinder ( PRC_TYPE_SURF + 7 ) // Cylinder.
-#define PRC_TYPE_SURF_Cylindrical ( PRC_TYPE_SURF + 8 ) // Surface who is defined in cylindrical space.
-#define PRC_TYPE_SURF_Offset ( PRC_TYPE_SURF + 9 ) // Offset surface.
-#define PRC_TYPE_SURF_Pipe ( PRC_TYPE_SURF + 10 ) // Pipe.
-#define PRC_TYPE_SURF_Plane ( PRC_TYPE_SURF + 11 ) // Plane.
-#define PRC_TYPE_SURF_Ruled ( PRC_TYPE_SURF + 12 ) // Ruled surface.
-#define PRC_TYPE_SURF_Sphere ( PRC_TYPE_SURF + 13 ) // Sphere.
-#define PRC_TYPE_SURF_Revolution ( PRC_TYPE_SURF + 14 ) // Surface of revolution.
-#define PRC_TYPE_SURF_Extrusion ( PRC_TYPE_SURF + 15 ) // Surface of extrusion.
-#define PRC_TYPE_SURF_FromCurves ( PRC_TYPE_SURF + 16 ) // Surface from two curves.
-#define PRC_TYPE_SURF_Torus ( PRC_TYPE_SURF + 17 ) // Torus.
-#define PRC_TYPE_SURF_Transform ( PRC_TYPE_SURF + 18 ) // Transformed surface.
-#define PRC_TYPE_SURF_Blend04 ( PRC_TYPE_SURF + 19 ) // defined for future use.
-
-#define PRC_TYPE_TOPO_Context ( PRC_TYPE_TOPO + 1 ) // Self-containing set of topological entities.
+#define PRC_TYPE_CRV_Base ( PRC_TYPE_CRV + 1 ) // Abstract type for all geometric curves.
+#define PRC_TYPE_CRV_Blend02Boundary ( PRC_TYPE_CRV + 2 ) // Boundary Curve.
+#define PRC_TYPE_CRV_NURBS ( PRC_TYPE_CRV + 3 ) // Non Uniform BSpline curve.
+#define PRC_TYPE_CRV_Circle ( PRC_TYPE_CRV + 4 ) // Circle.
+#define PRC_TYPE_CRV_Composite ( PRC_TYPE_CRV + 5 ) // Array of oriented curves.
+#define PRC_TYPE_CRV_OnSurf ( PRC_TYPE_CRV + 6 ) // Curve defined by a UV curve on a surface.
+#define PRC_TYPE_CRV_Ellipse ( PRC_TYPE_CRV + 7 ) // Ellipse.
+#define PRC_TYPE_CRV_Equation ( PRC_TYPE_CRV + 8 ) // curve described by specific law elements
+#define PRC_TYPE_CRV_Helix ( PRC_TYPE_CRV + 9 ) // Helix curve.
+#define PRC_TYPE_CRV_Hyperbola ( PRC_TYPE_CRV + 10 ) // Hyperbola.
+#define PRC_TYPE_CRV_Intersection ( PRC_TYPE_CRV + 11 ) // Intersection between 2 surfaces.
+#define PRC_TYPE_CRV_Line ( PRC_TYPE_CRV + 12 ) // Line.
+#define PRC_TYPE_CRV_Offset ( PRC_TYPE_CRV + 13 ) // Offset curve.
+#define PRC_TYPE_CRV_Parabola ( PRC_TYPE_CRV + 14 ) // Parabola.
+#define PRC_TYPE_CRV_PolyLine ( PRC_TYPE_CRV + 15 ) // Polyedric curve.
+#define PRC_TYPE_CRV_Transform ( PRC_TYPE_CRV + 16 ) // Transformed curve.
+
+#define PRC_TYPE_SURF_Base ( PRC_TYPE_SURF + 1 ) // Abstract type for all geometric surfaces.
+#define PRC_TYPE_SURF_Blend01 ( PRC_TYPE_SURF + 2 ) // Blend surface.
+#define PRC_TYPE_SURF_Blend02 ( PRC_TYPE_SURF + 3 ) // Blend Surface.
+#define PRC_TYPE_SURF_Blend03 ( PRC_TYPE_SURF + 4 ) // Blend Surface.
+#define PRC_TYPE_SURF_NURBS ( PRC_TYPE_SURF + 5 ) // Non Uniform BSpline surface.
+#define PRC_TYPE_SURF_Cone ( PRC_TYPE_SURF + 6 ) // Cone.
+#define PRC_TYPE_SURF_Cylinder ( PRC_TYPE_SURF + 7 ) // Cylinder.
+#define PRC_TYPE_SURF_Cylindrical ( PRC_TYPE_SURF + 8 ) // Surface who is defined in cylindrical space.
+#define PRC_TYPE_SURF_Offset ( PRC_TYPE_SURF + 9 ) // Offset surface.
+#define PRC_TYPE_SURF_Pipe ( PRC_TYPE_SURF + 10 ) // Pipe.
+#define PRC_TYPE_SURF_Plane ( PRC_TYPE_SURF + 11 ) // Plane.
+#define PRC_TYPE_SURF_Ruled ( PRC_TYPE_SURF + 12 ) // Ruled surface.
+#define PRC_TYPE_SURF_Sphere ( PRC_TYPE_SURF + 13 ) // Sphere.
+#define PRC_TYPE_SURF_Revolution ( PRC_TYPE_SURF + 14 ) // Surface of revolution.
+#define PRC_TYPE_SURF_Extrusion ( PRC_TYPE_SURF + 15 ) // Surface of extrusion.
+#define PRC_TYPE_SURF_FromCurves ( PRC_TYPE_SURF + 16 ) // Surface from two curves.
+#define PRC_TYPE_SURF_Torus ( PRC_TYPE_SURF + 17 ) // Torus.
+#define PRC_TYPE_SURF_Transform ( PRC_TYPE_SURF + 18 ) // Transformed surface.
+#define PRC_TYPE_SURF_Blend04 ( PRC_TYPE_SURF + 19 ) // defined for future use.
+
+#define PRC_TYPE_TOPO_Context ( PRC_TYPE_TOPO + 1 ) // Self-containing set of topological entities.
#define PRC_TYPE_TOPO_Item ( PRC_TYPE_TOPO + 2 ) // Abstract root type for any topological entity (body or single item).
#define PRC_TYPE_TOPO_MultipleVertex ( PRC_TYPE_TOPO + 3 ) // Vertex whose position is the average of all edges' extremity positions to whom it belongs.
#define PRC_TYPE_TOPO_UniqueVertex ( PRC_TYPE_TOPO + 4 ) // Vertex with one set of coordinates (absolute position).
@@ -86,86 +88,86 @@ const uint32_t PRCVersion=8137; // For Adobe Reader 9 or later
#define PRC_TYPE_TOPO_Loop ( PRC_TYPE_TOPO + 8 ) // Array of co edges which delimits a face.
#define PRC_TYPE_TOPO_Face ( PRC_TYPE_TOPO + 9 ) // Topological face delimiting a shell.
#define PRC_TYPE_TOPO_Shell ( PRC_TYPE_TOPO + 10 ) // Topological shell (open or closed).
-#define PRC_TYPE_TOPO_Connex ( PRC_TYPE_TOPO + 11 ) // Topological region delimited by one or several shells.
+#define PRC_TYPE_TOPO_Connex ( PRC_TYPE_TOPO + 11 ) // Topological region delimited by one or several shells.
#define PRC_TYPE_TOPO_Body ( PRC_TYPE_TOPO + 12 ) // Abstract root type for any topological body.
#define PRC_TYPE_TOPO_SingleWireBody ( PRC_TYPE_TOPO + 13 ) // Single wire body.
#define PRC_TYPE_TOPO_BrepData ( PRC_TYPE_TOPO + 14 ) // Main entry to solid and surface topology (regular form).
#define PRC_TYPE_TOPO_SingleWireBodyCompress ( PRC_TYPE_TOPO + 15 ) // Single wire body. (ultra compressed form).
#define PRC_TYPE_TOPO_BrepDataCompress ( PRC_TYPE_TOPO + 16 ) // Main entry to solid and surface topology (ultra compressed form).
-#define PRC_TYPE_TOPO_WireBody ( PRC_TYPE_TOPO + 17 ) // This type is the main entry to wire topology.
-
-#define PRC_TYPE_TESS_Base ( PRC_TYPE_TESS + 1 ) // Abstract root type for any tessellated entity.
-#define PRC_TYPE_TESS_3D ( PRC_TYPE_TESS + 2 ) // Tessellated faceted data; regular form.
-#define PRC_TYPE_TESS_3D_Compressed ( PRC_TYPE_TESS + 3 ) // Tessellated faceted data; highly compressed form.
-#define PRC_TYPE_TESS_Face ( PRC_TYPE_TESS + 4 ) // Tessellated face.
-#define PRC_TYPE_TESS_3D_Wire ( PRC_TYPE_TESS + 5 ) // Tessellated wireframe.
-#define PRC_TYPE_TESS_Markup ( PRC_TYPE_TESS + 6 ) // Tessellated markup.
-
-#define PRC_TYPE_MISC_Attribute ( PRC_TYPE_MISC + 1 ) // Entity attribute.
-#define PRC_TYPE_MISC_CartesianTransformation ( PRC_TYPE_MISC + 2 ) // Cartesian transformation.
-#define PRC_TYPE_MISC_EntityReference ( PRC_TYPE_MISC + 3 ) // Entity reference.
-#define PRC_TYPE_MISC_MarkupLinkedItem ( PRC_TYPE_MISC + 4 ) // Link between a markup and an entity.
-#define PRC_TYPE_MISC_ReferenceOnPRCBase ( PRC_TYPE_MISC + 5 ) // Reference pointing on a regular entity (not topological).
-#define PRC_TYPE_MISC_ReferenceOnTopology ( PRC_TYPE_MISC + 6 ) // Reference pointing on a topological entity.
+#define PRC_TYPE_TOPO_WireBody ( PRC_TYPE_TOPO + 17 ) // This type is the main entry to wire topology.
+
+#define PRC_TYPE_TESS_Base ( PRC_TYPE_TESS + 1 ) // Abstract root type for any tessellated entity.
+#define PRC_TYPE_TESS_3D ( PRC_TYPE_TESS + 2 ) // Tessellated faceted data; regular form.
+#define PRC_TYPE_TESS_3D_Compressed ( PRC_TYPE_TESS + 3 ) // Tessellated faceted data; highly compressed form.
+#define PRC_TYPE_TESS_Face ( PRC_TYPE_TESS + 4 ) // Tessellated face.
+#define PRC_TYPE_TESS_3D_Wire ( PRC_TYPE_TESS + 5 ) // Tessellated wireframe.
+#define PRC_TYPE_TESS_Markup ( PRC_TYPE_TESS + 6 ) // Tessellated markup.
+
+#define PRC_TYPE_MISC_Attribute ( PRC_TYPE_MISC + 1 ) // Entity attribute.
+#define PRC_TYPE_MISC_CartesianTransformation ( PRC_TYPE_MISC + 2 ) // Cartesian transformation.
+#define PRC_TYPE_MISC_EntityReference ( PRC_TYPE_MISC + 3 ) // Entity reference.
+#define PRC_TYPE_MISC_MarkupLinkedItem ( PRC_TYPE_MISC + 4 ) // Link between a markup and an entity.
+#define PRC_TYPE_MISC_ReferenceOnPRCBase ( PRC_TYPE_MISC + 5 ) // Reference pointing on a regular entity (not topological).
+#define PRC_TYPE_MISC_ReferenceOnTopology ( PRC_TYPE_MISC + 6 ) // Reference pointing on a topological entity.
#define PRC_TYPE_MISC_GeneralTransformation ( PRC_TYPE_MISC + 7 ) // General transformation.
-#define PRC_TYPE_RI_RepresentationItem ( PRC_TYPE_RI + 1 ) // Basic abstract type for representation items.
-#define PRC_TYPE_RI_BrepModel ( PRC_TYPE_RI + 2 ) // Basic type for surfaces and solids.
-#define PRC_TYPE_RI_Curve ( PRC_TYPE_RI + 3 ) // Basic type for curves.
-#define PRC_TYPE_RI_Direction ( PRC_TYPE_RI + 4 ) // Optional point + vector.
-#define PRC_TYPE_RI_Plane ( PRC_TYPE_RI + 5 ) // Construction plane, as opposed to planar surface.
-#define PRC_TYPE_RI_PointSet ( PRC_TYPE_RI + 6 ) // Set of points.
-#define PRC_TYPE_RI_PolyBrepModel ( PRC_TYPE_RI + 7 ) // Basic type to polyhedral surfaces and solids.
-#define PRC_TYPE_RI_PolyWire ( PRC_TYPE_RI + 8 ) // Polyedric wireframe entity.
-#define PRC_TYPE_RI_Set ( PRC_TYPE_RI + 9 ) // Logical grouping of arbitrary number of representation items.
-#define PRC_TYPE_RI_CoordinateSystem ( PRC_TYPE_RI + 10 ) // Coordinate system.
-
-#define PRC_TYPE_ASM_ModelFile ( PRC_TYPE_ASM + 1 ) // Basic entry type for PRC.
-#define PRC_TYPE_ASM_FileStructure ( PRC_TYPE_ASM + 2 ) // Basic structure for PRC files.
-#define PRC_TYPE_ASM_FileStructureGlobals ( PRC_TYPE_ASM + 3 ) // Basic structure for PRC files : globals.
-#define PRC_TYPE_ASM_FileStructureTree ( PRC_TYPE_ASM + 4 ) // Basic structure for PRC files : tree.
-#define PRC_TYPE_ASM_FileStructureTessellation ( PRC_TYPE_ASM + 5 ) // Basic structure for PRC files : tessellation.
-#define PRC_TYPE_ASM_FileStructureGeometry ( PRC_TYPE_ASM + 6 ) // Basic structure for PRC files : geometry.
+#define PRC_TYPE_RI_RepresentationItem ( PRC_TYPE_RI + 1 ) // Basic abstract type for representation items.
+#define PRC_TYPE_RI_BrepModel ( PRC_TYPE_RI + 2 ) // Basic type for surfaces and solids.
+#define PRC_TYPE_RI_Curve ( PRC_TYPE_RI + 3 ) // Basic type for curves.
+#define PRC_TYPE_RI_Direction ( PRC_TYPE_RI + 4 ) // Optional point + vector.
+#define PRC_TYPE_RI_Plane ( PRC_TYPE_RI + 5 ) // Construction plane, as opposed to planar surface.
+#define PRC_TYPE_RI_PointSet ( PRC_TYPE_RI + 6 ) // Set of points.
+#define PRC_TYPE_RI_PolyBrepModel ( PRC_TYPE_RI + 7 ) // Basic type to polyhedral surfaces and solids.
+#define PRC_TYPE_RI_PolyWire ( PRC_TYPE_RI + 8 ) // Polyedric wireframe entity.
+#define PRC_TYPE_RI_Set ( PRC_TYPE_RI + 9 ) // Logical grouping of arbitrary number of representation items.
+#define PRC_TYPE_RI_CoordinateSystem ( PRC_TYPE_RI + 10 ) // Coordinate system.
+
+#define PRC_TYPE_ASM_ModelFile ( PRC_TYPE_ASM + 1 ) // Basic entry type for PRC.
+#define PRC_TYPE_ASM_FileStructure ( PRC_TYPE_ASM + 2 ) // Basic structure for PRC files.
+#define PRC_TYPE_ASM_FileStructureGlobals ( PRC_TYPE_ASM + 3 ) // Basic structure for PRC files : globals.
+#define PRC_TYPE_ASM_FileStructureTree ( PRC_TYPE_ASM + 4 ) // Basic structure for PRC files : tree.
+#define PRC_TYPE_ASM_FileStructureTessellation ( PRC_TYPE_ASM + 5 ) // Basic structure for PRC files : tessellation.
+#define PRC_TYPE_ASM_FileStructureGeometry ( PRC_TYPE_ASM + 6 ) // Basic structure for PRC files : geometry.
#define PRC_TYPE_ASM_FileStructureExtraGeometry ( PRC_TYPE_ASM + 7 ) // Basic structure for PRC files : extra geometry data.
-#define PRC_TYPE_ASM_ProductOccurence ( PRC_TYPE_ASM + 10 ) // Basic contruct for assemblies.
-#define PRC_TYPE_ASM_PartDefinition ( PRC_TYPE_ASM + 11 ) // Basic construct for parts.
+#define PRC_TYPE_ASM_ProductOccurence ( PRC_TYPE_ASM + 10 ) // Basic contruct for assemblies.
+#define PRC_TYPE_ASM_PartDefinition ( PRC_TYPE_ASM + 11 ) // Basic construct for parts.
#define PRC_TYPE_ASM_Filter ( PRC_TYPE_ASM + 20 )
-#define PRC_TYPE_MKP_View ( PRC_TYPE_MKP + 1 ) // Grouping of markup by views.
-#define PRC_TYPE_MKP_Markup ( PRC_TYPE_MKP + 2 ) // Basic type for simple markups.
-#define PRC_TYPE_MKP_Leader ( PRC_TYPE_MKP + 3 ) // basic type for markup leader
+#define PRC_TYPE_MKP_View ( PRC_TYPE_MKP + 1 ) // Grouping of markup by views.
+#define PRC_TYPE_MKP_Markup ( PRC_TYPE_MKP + 2 ) // Basic type for simple markups.
+#define PRC_TYPE_MKP_Leader ( PRC_TYPE_MKP + 3 ) // basic type for markup leader
#define PRC_TYPE_MKP_AnnotationItem ( PRC_TYPE_MKP + 4 ) // Usage of a markup.
#define PRC_TYPE_MKP_AnnotationSet ( PRC_TYPE_MKP + 5 ) // Group of annotations.
#define PRC_TYPE_MKP_AnnotationReference ( PRC_TYPE_MKP + 6 ) // Logical grouping of annotations for reference.
-#define PRC_TYPE_GRAPH_Style ( PRC_TYPE_GRAPH + 1 ) // Display style.
-#define PRC_TYPE_GRAPH_Material ( PRC_TYPE_GRAPH + 2 ) // Display material properties.
-#define PRC_TYPE_GRAPH_Picture ( PRC_TYPE_GRAPH + 3 ) // Picture.
-#define PRC_TYPE_GRAPH_TextureApplication ( PRC_TYPE_GRAPH + 11 ) // Texture application.
-#define PRC_TYPE_GRAPH_TextureDefinition ( PRC_TYPE_GRAPH + 12 ) // Texture definition.
-#define PRC_TYPE_GRAPH_TextureTransformation ( PRC_TYPE_GRAPH + 13 ) // Texture transformation.
-#define PRC_TYPE_GRAPH_LinePattern ( PRC_TYPE_GRAPH + 21 ) // One dimensional display style.
-#define PRC_TYPE_GRAPH_FillPattern ( PRC_TYPE_GRAPH + 22 ) // Abstract class for two-dimensional display style.
-#define PRC_TYPE_GRAPH_DottingPattern ( PRC_TYPE_GRAPH + 23 ) // Two-dimensional filling with dots.
-#define PRC_TYPE_GRAPH_HatchingPattern ( PRC_TYPE_GRAPH + 24 ) // Two-dimensional filling with hatches.
-#define PRC_TYPE_GRAPH_SolidPattern ( PRC_TYPE_GRAPH + 25 ) // Two-dimensional filling with particular style (color, material, texture).
-#define PRC_TYPE_GRAPH_VPicturePattern ( PRC_TYPE_GRAPH + 26 ) // Two-dimensional filling with vectorised picture.
-#define PRC_TYPE_GRAPH_AmbientLight ( PRC_TYPE_GRAPH + 31 ) // Scene ambient illumination.
-#define PRC_TYPE_GRAPH_PointLight ( PRC_TYPE_GRAPH + 32 ) // Scene point illumination.
-#define PRC_TYPE_GRAPH_DirectionalLight ( PRC_TYPE_GRAPH + 33 ) // Scene directional illumination.
-#define PRC_TYPE_GRAPH_SpotLight ( PRC_TYPE_GRAPH + 34 ) // Scene spot illumination.
-#define PRC_TYPE_GRAPH_SceneDisplayParameters ( PRC_TYPE_GRAPH + 41 ) // Parameters for scene visualisation.
-#define PRC_TYPE_GRAPH_Camera ( PRC_TYPE_GRAPH + 42 ) //
-
-#define PRC_TYPE_MATH_FCT_1D ( PRC_TYPE_MATH + 1 ) // Basic type for one degree equation object.
-#define PRC_TYPE_MATH_FCT_1D_Polynom ( PRC_TYPE_MATH_FCT_1D + 1 ) // Polynomial equation.
-#define PRC_TYPE_MATH_FCT_1D_Trigonometric ( PRC_TYPE_MATH_FCT_1D + 2 ) // Cosinus based equation.
-#define PRC_TYPE_MATH_FCT_1D_Fraction ( PRC_TYPE_MATH_FCT_1D + 3 ) // Fraction between 2 one degree equation object.
-#define PRC_TYPE_MATH_FCT_1D_ArctanCos ( PRC_TYPE_MATH_FCT_1D + 4 ) // Specific equation.
-#define PRC_TYPE_MATH_FCT_1D_Combination ( PRC_TYPE_MATH_FCT_1D + 5 ) // Combination of one degree equation object.
-#define PRC_TYPE_MATH_FCT_3D ( PRC_TYPE_MATH + 10 ) // Basic type for 3rd degree equation object.
-#define PRC_TYPE_MATH_FCT_3D_Linear ( PRC_TYPE_MATH_FCT_3D + 1 ) // Linear transformation ( with a matrix ).
-#define PRC_TYPE_MATH_FCT_3D_NonLinear ( PRC_TYPE_MATH_FCT_3D + 2 ) // Specific transformation.
+#define PRC_TYPE_GRAPH_Style ( PRC_TYPE_GRAPH + 1 ) // Display style.
+#define PRC_TYPE_GRAPH_Material ( PRC_TYPE_GRAPH + 2 ) // Display material properties.
+#define PRC_TYPE_GRAPH_Picture ( PRC_TYPE_GRAPH + 3 ) // Picture.
+#define PRC_TYPE_GRAPH_TextureApplication ( PRC_TYPE_GRAPH + 11 ) // Texture application.
+#define PRC_TYPE_GRAPH_TextureDefinition ( PRC_TYPE_GRAPH + 12 ) // Texture definition.
+#define PRC_TYPE_GRAPH_TextureTransformation ( PRC_TYPE_GRAPH + 13 ) // Texture transformation.
+#define PRC_TYPE_GRAPH_LinePattern ( PRC_TYPE_GRAPH + 21 ) // One dimensional display style.
+#define PRC_TYPE_GRAPH_FillPattern ( PRC_TYPE_GRAPH + 22 ) // Abstract class for two-dimensional display style.
+#define PRC_TYPE_GRAPH_DottingPattern ( PRC_TYPE_GRAPH + 23 ) // Two-dimensional filling with dots.
+#define PRC_TYPE_GRAPH_HatchingPattern ( PRC_TYPE_GRAPH + 24 ) // Two-dimensional filling with hatches.
+#define PRC_TYPE_GRAPH_SolidPattern ( PRC_TYPE_GRAPH + 25 ) // Two-dimensional filling with particular style (color, material, texture).
+#define PRC_TYPE_GRAPH_VPicturePattern ( PRC_TYPE_GRAPH + 26 ) // Two-dimensional filling with vectorised picture.
+#define PRC_TYPE_GRAPH_AmbientLight ( PRC_TYPE_GRAPH + 31 ) // Scene ambient illumination.
+#define PRC_TYPE_GRAPH_PointLight ( PRC_TYPE_GRAPH + 32 ) // Scene point illumination.
+#define PRC_TYPE_GRAPH_DirectionalLight ( PRC_TYPE_GRAPH + 33 ) // Scene directional illumination.
+#define PRC_TYPE_GRAPH_SpotLight ( PRC_TYPE_GRAPH + 34 ) // Scene spot illumination.
+#define PRC_TYPE_GRAPH_SceneDisplayParameters ( PRC_TYPE_GRAPH + 41 ) // Parameters for scene visualisation.
+#define PRC_TYPE_GRAPH_Camera ( PRC_TYPE_GRAPH + 42 ) //
+
+#define PRC_TYPE_MATH_FCT_1D ( PRC_TYPE_MATH + 1 ) // Basic type for one degree equation object.
+#define PRC_TYPE_MATH_FCT_1D_Polynom ( PRC_TYPE_MATH_FCT_1D + 1 ) // Polynomial equation.
+#define PRC_TYPE_MATH_FCT_1D_Trigonometric ( PRC_TYPE_MATH_FCT_1D + 2 ) // Cosinus based equation.
+#define PRC_TYPE_MATH_FCT_1D_Fraction ( PRC_TYPE_MATH_FCT_1D + 3 ) // Fraction between 2 one degree equation object.
+#define PRC_TYPE_MATH_FCT_1D_ArctanCos ( PRC_TYPE_MATH_FCT_1D + 4 ) // Specific equation.
+#define PRC_TYPE_MATH_FCT_1D_Combination ( PRC_TYPE_MATH_FCT_1D + 5 ) // Combination of one degree equation object.
+#define PRC_TYPE_MATH_FCT_3D ( PRC_TYPE_MATH + 10 ) // Basic type for 3rd degree equation object.
+#define PRC_TYPE_MATH_FCT_3D_Linear ( PRC_TYPE_MATH_FCT_3D + 1 ) // Linear transformation ( with a matrix ).
+#define PRC_TYPE_MATH_FCT_3D_NonLinear ( PRC_TYPE_MATH_FCT_3D + 2 ) // Specific transformation.
#define PRC_PRODUCT_FLAG_DEFAULT 0x0001
#define PRC_PRODUCT_FLAG_INTERNAL 0x0002
@@ -253,7 +255,7 @@ enum EPRCProductLoadStatus {
KEPRCProductLoadStatus_Loaded
};
-enum EPRCExtendType {
+enum EPRCExtendType {
KEPRCExtendTypeNone = 0, // Discontinuous position.
KEPRCExtendTypeExt1 = 2, // Same as EPRCExtendTypeCInfinity.
KEPRCExtendTypeExt2 = 4, // Same as EPRCExtendTypeG1R for surface, and EPRCExtendTypeG1 for curve.
@@ -386,7 +388,7 @@ enum EPRCMarkupType {
KEPRCMarkupType_Roughness,
KEPRCMarkupType_Welding,
KEPRCMarkupType_Table,
- KEPRCMarkupType_Other
+ KEPRCMarkupType_Other
};
enum EPRCMarkupSubType {
@@ -394,7 +396,7 @@ enum EPRCMarkupSubType {
KEPRCMarkupSubType_EnumMax,
KEPRCMarkupSubType_Datum_Ident = 1 ,
- KEPRCMarkupSubType_Datum_EnumMax,
+ KEPRCMarkupSubType_Datum_EnumMax,
KEPRCMarkupSubType_Dimension_Distance = 1,
KEPRCMarkupSubType_Dimension_Radius_Tangent,
@@ -403,7 +405,7 @@ enum EPRCMarkupSubType {
KEPRCMarkupSubType_Dimension_Diameter,
KEPRCMarkupSubType_Dimension_Diameter_Tangent,
KEPRCMarkupSubType_Dimension_Diameter_Cylinder,
- KEPRCMarkupSubType_Dimension_Diameter_Edge,
+ KEPRCMarkupSubType_Dimension_Diameter_Edge,
KEPRCMarkupSubType_Dimension_Diameter_Cone,
KEPRCMarkupSubType_Dimension_Length,
KEPRCMarkupSubType_Dimension_Length_Curvilinear,
@@ -418,7 +420,7 @@ enum EPRCMarkupSubType {
KEPRCMarkupSubType_Welding_EnumMax,
KEPRCMarkupSubType_Other_Symbol_User = 1,
- KEPRCMarkupSubType_Other_EnumMax
+ KEPRCMarkupSubType_Other_EnumMax
};
#define PRC_MARKUP_IsHidden 0x01 // The tessellation is hidden.
@@ -501,12 +503,12 @@ enum EPRCCharSet
#define PRC_Font_Wired 0x80 /*!< Wired. Indicates that the original font is a wirefame font. */
#define PRC_Font_FixedWidth 0x100 /*!< Fixed width. Indicates that the original font is not proportional (each glyph has the same width). */
-#define PRC_CONTEXT_OuterLoopFirst 0x0001 // Outer loops are always first loops (specific to PRC_TYPE_TOPO_BrepData).
-#define PRC_CONTEXT_NoClamp 0x0002 // UV curves are clamped on the surface (specific to PRC_TYPE_TOPO_BrepData).
-#define PRC_CONTEXT_NoSplit 0x0004 // Faces are split (specific to PRC_TYPE_TOPO_BrepData).
+#define PRC_CONTEXT_OuterLoopFirst 0x0001 // Outer loops are always first loops (specific to PRC_TYPE_TOPO_BrepData).
+#define PRC_CONTEXT_NoClamp 0x0002 // UV curves are clamped on the surface (specific to PRC_TYPE_TOPO_BrepData).
+#define PRC_CONTEXT_NoSplit 0x0004 // Faces are split (specific to PRC_TYPE_TOPO_BrepData).
-#define PRC_BODY_BBOX_Evaluation 0x0001 // Bounding box based on geometry.
-#define PRC_BODY_BBOX_Precise 0x0002 // Bounding box based on tessellation.
-#define PRC_BODY_BBOX_CADData 0x0003 // Bounding box given by a CAD data file.
+#define PRC_BODY_BBOX_Evaluation 0x0001 // Bounding box based on geometry.
+#define PRC_BODY_BBOX_Precise 0x0002 // Bounding box based on tessellation.
+#define PRC_BODY_BBOX_CADData 0x0003 // Bounding box given by a CAD data file.
#endif // __PRC_H
diff --git a/graphics/asymptote/prc/PRCbitStream.h b/graphics/asymptote/prc/include/prc/PRCbitStream.h
index 5f189e428b..012234983c 100644
--- a/graphics/asymptote/prc/PRCbitStream.h
+++ b/graphics/asymptote/prc/include/prc/PRCbitStream.h
@@ -22,6 +22,8 @@
#ifndef __PRC_BIT_STREAM_H
#define __PRC_BIT_STREAM_H
+#include "PRCuniversalendianness.h"
+
#ifdef _MSC_VER
#include <stdio.h>
#if _MSC_VER >= 1600
diff --git a/graphics/asymptote/prc/PRCdouble.h b/graphics/asymptote/prc/include/prc/PRCdouble.h
index 4a3a79dccc..ed96715974 100644
--- a/graphics/asymptote/prc/PRCdouble.h
+++ b/graphics/asymptote/prc/include/prc/PRCdouble.h
@@ -9,16 +9,7 @@
#include "config.h"
#endif
-#ifdef BYTE_ORDER
-# undef WORDS_BIG_ENDIAN
-# undef WORDS_LITTLE_ENDIAN
-# if BYTE_ORDER == BIG_ENDIAN
-# define WORDS_BIG_ENDIAN 1
-# endif
-# if BYTE_ORDER == LITTLE_ENDIAN
-# define WORDS_LITTLE_ENDIAN 1
-# endif
-#endif
+#include "PRCuniversalendianness.h"
// from Adobe's documentation
@@ -118,7 +109,7 @@ extern PRCdword stadwZero[2],stadwNegativeZero[2];
#define NUMBEROFELEMENTINACOFDOE (2077)
#ifdef WORDS_BIGENDIAN
-# define DOUBLEWITHTWODWORDINTREE(upper,lower) {upper,lower}
+# define DOUBLEWITHTWODWORDINTREE(upper,lower) {upper,lower}
#else
# define DOUBLEWITHTWODWORDINTREE(upper,lower) {lower,upper}
#endif
diff --git a/graphics/asymptote/prc/include/prc/PRCuniversalendianness.h b/graphics/asymptote/prc/include/prc/PRCuniversalendianness.h
new file mode 100644
index 0000000000..18e0ece623
--- /dev/null
+++ b/graphics/asymptote/prc/include/prc/PRCuniversalendianness.h
@@ -0,0 +1,11 @@
+#pragma once
+
+#if defined(UNIVERSAL_ENDIAN_BUILD)
+#if defined(__BIG_ENDIAN__)
+#define WORDS_BIGENDIAN 1
+#endif // defined(__BIG_ENDIAN__)
+#else // defined(UNIVERSAL_ENDIAN_BUILD)
+#ifndef WORDS_BIGENDIAN
+#undef WORDS_BIGENDIAN
+#endif // !defined(WORDS_BIGENDIAN)
+#endif // defined(UNIVERSAL_ENDIAN_BUILD)
diff --git a/graphics/asymptote/prc/oPRCFile.h b/graphics/asymptote/prc/include/prc/oPRCFile.h
index e5f7dc9d4f..64770b18cd 100644
--- a/graphics/asymptote/prc/oPRCFile.h
+++ b/graphics/asymptote/prc/include/prc/oPRCFile.h
@@ -36,9 +36,11 @@
#include "config.h"
#endif
+
#include "PRC.h"
#include "PRCbitStream.h"
#include "writePRC.h"
+#include "PRCuniversalendianness.h"
#ifdef HAVE_LIBTIRPC
diff --git a/graphics/asymptote/prc/writePRC.h b/graphics/asymptote/prc/include/prc/writePRC.h
index 7a9313e45c..f017a7d092 100644
--- a/graphics/asymptote/prc/writePRC.h
+++ b/graphics/asymptote/prc/include/prc/writePRC.h
@@ -26,11 +26,12 @@
#include <deque>
#include <list>
-#include <map>
-#include <iostream>
-#include "PRCbitStream.h"
+#include "PRCuniversalendianness.h"
#include "PRC.h"
+#include "PRCbitStream.h"
#include <float.h>
+#include <iostream>
+#include <map>
#include <math.h>
static const uint32_t m1=(uint32_t)-1;
@@ -164,7 +165,7 @@ class PRCSingleAttribute : public PRCAttributeEntry
PRCSingleAttribute(uint32_t time) : PRCAttributeEntry(), type(KEPRCModellerAttributeTypeTime)
{
value.time = time;
- }
+ }
PRCSingleAttribute(const std::string &text) : PRCAttributeEntry(), type(KEPRCModellerAttributeTypeString)
{
value_text = text;}
@@ -179,7 +180,7 @@ class PRCSingleAttribute : public PRCAttributeEntry
PRCSingleAttribute(uint32_t title, uint32_t time) : PRCAttributeEntry(title), type(KEPRCModellerAttributeTypeTime)
{
value.time = time;
- }
+ }
PRCSingleAttribute(uint32_t title, const std::string &text) : PRCAttributeEntry(title), type(KEPRCModellerAttributeTypeString)
{
value_text = text;
@@ -195,7 +196,7 @@ class PRCSingleAttribute : public PRCAttributeEntry
PRCSingleAttribute(const std::string title, uint32_t time) : PRCAttributeEntry(title), type(KEPRCModellerAttributeTypeTime)
{
value.time = time;
- }
+ }
PRCSingleAttribute(const std::string title, const std::string &text) : PRCAttributeEntry(title), type(KEPRCModellerAttributeTypeString)
{
value_text = text;
@@ -333,14 +334,14 @@ struct PRCVector2d
x(c?c[0]:fx), y(c?c[1]:fy) {}
PRCVector2d(const PRCVector2d& sVector2d) :
x(sVector2d.x), y(sVector2d.y) {}
-
+
void Set(double fx, double fy)
{ x = fx; y = fy; }
double Dot(const PRCVector2d & sPt) const
{ return(x*sPt.x)+(y*sPt.y); }
double LengthSquared()
{ return(x*x+y*y); }
-
+
friend PRCVector2d operator + (const PRCVector2d& a, const PRCVector2d& b)
{ return PRCVector2d(a.x+b.x,a.y+b.y); }
friend PRCVector2d operator - (const PRCVector2d& a)
@@ -353,10 +354,10 @@ struct PRCVector2d
{ return PRCVector2d(a.x*d,a.y*d); }
friend PRCVector2d operator / (const PRCVector2d& a, const double d)
{ return PRCVector2d(a.x/d,a.y/d); }
-
+
double Length();
bool Normalize();
-
+
bool operator==(const PRCVector2d &v) const
{
return x==v.x && y==v.y;
@@ -426,7 +427,7 @@ class PRCMaterialGeneric : public ContentPRCBase, public PRCMaterial
public:
PRCMaterialGeneric(std::string n="") :
ContentPRCBase(PRC_TYPE_GRAPH_Material,n),
- ambient(m1), diffuse(m1), emissive(m1), specular(m1),
+ ambient(m1), diffuse(m1), emissive(m1), specular(m1),
shininess(0.0),
ambient_alpha(1.0), diffuse_alpha(1.0), emissive_alpha(1.0), specular_alpha(1.0)
{}
@@ -503,7 +504,7 @@ class PRCTessFace
public:
PRCTessFace() :
start_wire(0), used_entities_flag(0),
- start_triangulated(0), number_of_texture_coordinate_indexes(0),
+ start_triangulated(0), number_of_texture_coordinate_indexes(0),
is_rgba(false), behaviour(PRC_GRAPHICS_Show)
{}
void serializeTessFace(PRCbitStream&);
@@ -742,7 +743,7 @@ public:
{
set(t);
}
-
+
void serializeGeneralTransformation3d(PRCbitStream&) const;
void serializeTransformation3d(PRCbitStream& pbs) const { serializeGeneralTransformation3d(pbs); }
double mat[4][4];
@@ -766,7 +767,7 @@ public:
}
void set(const double t[])
{
- if(t!=NULL)
+ if(t!=NULL)
for (size_t i=0;i<4;i++)
for (size_t j=0;j<4;j++)
mat[i][j]=t[4*i+j];
@@ -861,8 +862,8 @@ public:
~PRCCoordinateSystem() { delete axis_set; }
void serializeCoordinateSystem(PRCbitStream&);
void serializeRepresentationItem(PRCbitStream &pbs) { serializeCoordinateSystem(pbs); }
- void setAxisSet(PRCGeneralTransformation3d*& transform) { axis_set = transform; transform = NULL; }
- void setAxisSet(PRCCartesianTransformation3d*& transform) { axis_set = transform; transform = NULL; }
+ void setAxisSet(PRCGeneralTransformation3d*& transform) { axis_set = transform; transform = NULL; }
+ void setAxisSet(PRCCartesianTransformation3d*& transform) { axis_set = transform; transform = NULL; }
PRCTransformation3d *axis_set;
bool operator==(const PRCCoordinateSystem &t) const
{
@@ -873,9 +874,9 @@ public:
PRCCartesianTransformation3d* axis_set_cartesian = dynamic_cast<PRCCartesianTransformation3d*>(axis_set);
PRCCartesianTransformation3d* t_axis_set_cartesian = dynamic_cast<PRCCartesianTransformation3d*>(t.axis_set);
if(axis_set_general!=NULL)
- return (t_axis_set_general!=NULL?(*axis_set_general==*t_axis_set_general):false);
+ return (t_axis_set_general!=NULL?(*axis_set_general==*t_axis_set_general):false);
if(axis_set_cartesian!=NULL)
- return (t_axis_set_cartesian!=NULL?(*axis_set_cartesian==*t_axis_set_cartesian):false);
+ return (t_axis_set_cartesian!=NULL?(*axis_set_cartesian==*t_axis_set_cartesian):false);
return false;
}
};
@@ -988,7 +989,7 @@ public:
PRCContentSurface() :
PRCBaseGeometry(), extend_info(KEPRCExtendTypeNone) {}
PRCContentSurface(std::string n) :
- PRCBaseGeometry(n,makeCADID()),extend_info(KEPRCExtendTypeNone) {}
+ PRCBaseGeometry(n,makeCADID()),extend_info(KEPRCExtendTypeNone) {}
void serializeContentSurface(PRCbitStream&);
EPRCExtendType extend_info;
};
@@ -1029,7 +1030,7 @@ public:
PRCContentCurve() :
PRCBaseGeometry(), extend_info(KEPRCExtendTypeNone), is_3d(true) {}
PRCContentCurve(std::string n) :
- PRCBaseGeometry(n,makeCADID()),extend_info(KEPRCExtendTypeNone), is_3d(true) {}
+ PRCBaseGeometry(n,makeCADID()),extend_info(KEPRCExtendTypeNone), is_3d(true) {}
void serializeContentCurve(PRCbitStream&);
EPRCExtendType extend_info;
bool is_3d;
@@ -1241,7 +1242,7 @@ public:
PRCContentWireEdge() :
PRCBaseTopology(), curve_3d(NULL), has_curve_trim_interval(false) {}
PRCContentWireEdge(std::string n) :
- PRCBaseTopology(n,makeCADID()), curve_3d(NULL), has_curve_trim_interval(false) {}
+ PRCBaseTopology(n,makeCADID()), curve_3d(NULL), has_curve_trim_interval(false) {}
~PRCContentWireEdge() { delete curve_3d; }
void serializeContentWireEdge(PRCbitStream &pbs);
// void setCurve(PRCCurve*& curve) { curve_3d = curve; curve = NULL; }
@@ -1267,7 +1268,7 @@ public:
~PRCSingleWireBody() { delete wire_edge; }
void serializeSingleWireBody(PRCbitStream &pbs);
void serializeBody(PRCbitStream &pbs) { serializeSingleWireBody(pbs); }
- void setWireEdge(PRCWireEdge*& wireEdge) { wire_edge = wireEdge; wireEdge = NULL; }
+ void setWireEdge(PRCWireEdge*& wireEdge) { wire_edge = wireEdge; wireEdge = NULL; }
PRCWireEdge* wire_edge;
};
@@ -1277,7 +1278,7 @@ public:
PRCFace() :
PRCBaseTopology(), base_surface(NULL), have_surface_trim_domain(false), have_tolerance(false), tolerance(0), number_of_loop(0), outer_loop_index(-1) {}
PRCFace(std::string n) :
- PRCBaseTopology(n,makeCADID()), base_surface(NULL), have_surface_trim_domain(false), have_tolerance(false), tolerance(0), number_of_loop(0), outer_loop_index(-1) {}
+ PRCBaseTopology(n,makeCADID()), base_surface(NULL), have_surface_trim_domain(false), have_tolerance(false), tolerance(0), number_of_loop(0), outer_loop_index(-1) {}
~PRCFace() { delete base_surface; }
void serializeFace(PRCbitStream &pbs);
void serializeTopoItem(PRCbitStream &pbs) { serializeFace(pbs); }
@@ -1316,7 +1317,7 @@ public:
PRCConnex() :
PRCBaseTopology() {}
PRCConnex(std::string n) :
- PRCBaseTopology(n,makeCADID()) {}
+ PRCBaseTopology(n,makeCADID()) {}
~PRCConnex() { for(PRCShellList::iterator it=shell.begin(); it!=shell.end(); ++it) delete *it; }
void serializeConnex(PRCbitStream &pbs);
void serializeTopoItem(PRCbitStream &pbs) { serializeConnex(pbs); }
@@ -1346,7 +1347,7 @@ public:
PRCCompressedFace() :
PRCBaseTopology(), orientation_surface_with_shell(true), degree(0) {}
PRCCompressedFace(std::string n) :
- PRCBaseTopology(n,makeCADID()), orientation_surface_with_shell(true), degree(0) {}
+ PRCBaseTopology(n,makeCADID()), orientation_surface_with_shell(true), degree(0) {}
void serializeCompressedFace(PRCbitStream &pbs, double brep_data_compressed_tolerance);
void serializeContentCompressedFace(PRCbitStream &pbs);
void serializeCompressedAnaNurbs(PRCbitStream &pbs, double brep_data_compressed_tolerance);
diff --git a/graphics/asymptote/prc/oPRCFile.cc b/graphics/asymptote/prc/oPRCFile.cc
index 859d6597c0..56f164793e 100644
--- a/graphics/asymptote/prc/oPRCFile.cc
+++ b/graphics/asymptote/prc/oPRCFile.cc
@@ -19,13 +19,13 @@
*
*************/
-#include "oPRCFile.h"
-#include <time.h>
-#include <sstream>
-#include <iostream>
+#include "prc/oPRCFile.h"
+#include <cstring>
#include <fstream>
#include <iomanip>
-#include <cstring>
+#include <iostream>
+#include <sstream>
+#include <time.h>
#include <zlib.h>
namespace prc {
@@ -154,7 +154,7 @@ void PRCFileStructure::serializeFileStructureTree(PRCbitStream &out)
WriteUnsignedInteger (number_of_part_definitions)
for (size_t i=0;i<number_of_part_definitions;i++)
SerializePartDefinition (part_definitions[i])
-
+
const size_t number_of_product_occurrences = product_occurrences.size();
WriteUnsignedInteger (number_of_product_occurrences)
for (size_t i=0;i<number_of_product_occurrences;i++)
@@ -556,7 +556,7 @@ void oPRCFile::doGroup(PRCgroup& group)
break;
}
}
-
+
for(PRCtessquadList::const_iterator qit=group.quads.begin(); qit!=group.quads.end(); qit++)
{
const RGBAColour* C = qit->colours;
@@ -588,13 +588,13 @@ void oPRCFile::doGroup(PRCgroup& group)
tessFace->rgba_vertices.push_back(byte(C[1].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[1].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[2].R));
tessFace->rgba_vertices.push_back(byte(C[2].G));
tessFace->rgba_vertices.push_back(byte(C[2].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[2].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[3].R));
tessFace->rgba_vertices.push_back(byte(C[3].G));
tessFace->rgba_vertices.push_back(byte(C[3].B));
@@ -615,13 +615,13 @@ void oPRCFile::doGroup(PRCgroup& group)
tessFace->rgba_vertices.push_back(byte(C[0].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[0].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[2].R));
tessFace->rgba_vertices.push_back(byte(C[2].G));
tessFace->rgba_vertices.push_back(byte(C[2].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[2].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[3].R));
tessFace->rgba_vertices.push_back(byte(C[3].G));
tessFace->rgba_vertices.push_back(byte(C[3].B));
@@ -639,13 +639,13 @@ void oPRCFile::doGroup(PRCgroup& group)
tessFace->rgba_vertices.push_back(byte(C[3].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[3].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[1].R));
tessFace->rgba_vertices.push_back(byte(C[1].G));
tessFace->rgba_vertices.push_back(byte(C[1].B));
if(tessFace->is_rgba)
tessFace->rgba_vertices.push_back(byte(C[1].A));
-
+
tessFace->rgba_vertices.push_back(byte(C[0].R));
tessFace->rgba_vertices.push_back(byte(C[0].G));
tessFace->rgba_vertices.push_back(byte(C[0].B));
@@ -857,7 +857,7 @@ void oPRCFile::doGroup(PRCgroup& group)
}
// Simplify and reduce to as simple entities as possible
- // products with named representation items can not be reduced to sets, since
+ // products with named representation items can not be reduced to sets, since
// outside references are already set
bool nonamedparts = true;
for(PRCRepresentationItemList::const_iterator it=part_definition->representation_item.begin(); it!=part_definition->representation_item.end(); it++)
@@ -963,7 +963,7 @@ std::string oPRCFile::calculate_unique_name(const ContentPRCBase *prc_entity,con
serialization << prc_entity->getPRCID();
if (prc_occurence)
{
-// serialization_buffer = Flush serialization (serialization)
+// serialization_buffer = Flush serialization (serialization)
{
const uint32_t size_serialization = serialization.getSize();
while(size_serialization == serialization.getSize())
diff --git a/graphics/asymptote/prc/test.cc b/graphics/asymptote/prc/test.cc
index baf942fc7d..0f8e0bdb4a 100644
--- a/graphics/asymptote/prc/test.cc
+++ b/graphics/asymptote/prc/test.cc
@@ -19,12 +19,12 @@
*
*************/
-#include <iostream>
-#include <iomanip>
-#include <fstream>
+#include "include/prc/oPRCFile.h"
#include <cmath>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
#include <string>
-#include "oPRCFile.h"
using namespace std;
@@ -51,7 +51,7 @@ int main()
colours[i%N_COLOURS].B = 0.95;
colours[i%N_COLOURS].A = 0.75;
}
-
+
PRCmaterial materials[N_COLOURS];
for(size_t i = 0; i < N_COLOURS; ++i)
{
@@ -74,12 +74,12 @@ int main()
materials[i%N_COLOURS].alpha = 0.75;
materials[i%N_COLOURS].shininess = 0.1;
}
-
+
if(1) {
double knotsU[] = {1,1,1,1,2,2,2,2};
double knotsV[] = {1,1,1,1,2,2,2,2};
const size_t NUMBER_OF_PATCHES = 32;
- double controlPoints[NUMBER_OF_PATCHES][16][3] =
+ double controlPoints[NUMBER_OF_PATCHES][16][3] =
{
{ // Patch 0
{1.4,0,2.4},{1.4,-0.784,2.4},{0.784,-1.4,2.4},{0,-1.4,2.4},
@@ -300,7 +300,7 @@ int main()
}
file.endgroup();
}
-
+
const size_t NUMBER_OF_POINTS = 31;
double points[NUMBER_OF_POINTS][3];
for(size_t i = 0; i < NUMBER_OF_POINTS; ++i)
@@ -742,11 +742,11 @@ int main()
// following box examples show a) different ways to represent a surface consisting of flat rectangles
// b) that the only way to have almost working transparency is a set of NURBS bodies.
// (Or may be other topology types like plane also work
-// demonstration how non-transparent materials work the same for all kinds of objects
+// demonstration how non-transparent materials work the same for all kinds of objects
- if(1) { // demonstration how non-transparent materials work the same for all kinds of objects
+ if(1) { // demonstration how non-transparent materials work the same for all kinds of objects
const size_t NUMBER_OF_PATCHES = 6;
- double vertices[NUMBER_OF_PATCHES][4][3] =
+ double vertices[NUMBER_OF_PATCHES][4][3] =
{
{ // Patch 0
{-1,-1,-1},
@@ -951,4 +951,3 @@ int main()
#endif
return 0;
}
-
diff --git a/graphics/asymptote/prc/writePRC.cc b/graphics/asymptote/prc/writePRC.cc
index a2877b0899..8d04c0f76e 100644
--- a/graphics/asymptote/prc/writePRC.cc
+++ b/graphics/asymptote/prc/writePRC.cc
@@ -19,9 +19,9 @@
*
*************/
-#include "writePRC.h"
-#include <climits>
+#include "prc/writePRC.h"
#include <cassert>
+#include <climits>
// debug print includes
#include <iostream>
@@ -40,7 +40,7 @@ using namespace std;
#endif
// Count leading zeros.
-uint32_t CLZ(uint32_t a)
+uint32_t CLZ(uint32_t a)
{
#if __GNUC_PREREQ(3,4)
return __builtin_clz(a);
@@ -51,7 +51,7 @@ uint32_t CLZ(uint32_t a)
8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31
};
- a |= a >> 1; // first round down to one less than a power of 2
+ a |= a >> 1; // first round down to one less than a power of 2
a |= a >> 2;
a |= a >> 4;
a |= a >> 8;
@@ -62,7 +62,7 @@ uint32_t CLZ(uint32_t a)
}
// Portable integer implementation of ceil(log2(x)).
-uint32_t Log2(uint32_t x)
+uint32_t Log2(uint32_t x)
{
assert(x != 0);
uint32_t L=31-CLZ(x);
@@ -243,10 +243,10 @@ void UserData::write(PRCbitStream &pbs)
void PRCAttributeEntry::serializeAttributeEntry(PRCbitStream &pbs) const
{
- WriteBoolean (title_is_integer)
+ WriteBoolean (title_is_integer)
if (title_is_integer)
WriteUnsignedInteger (title_integer)
- else
+ else
WriteString (title_text)
}
@@ -267,7 +267,7 @@ void PRCSingleAttribute::serializeSingleAttribute(PRCbitStream &pbs) const
break;
case KEPRCModellerAttributeTypeString:
WriteString (value_text)
- break;
+ break;
default:
break;
}
@@ -275,24 +275,24 @@ void PRCSingleAttribute::serializeSingleAttribute(PRCbitStream &pbs) const
void PRCAttribute::serializeAttribute(PRCbitStream &pbs) const
{
- WriteUnsignedInteger (PRC_TYPE_MISC_Attribute)
-
+ WriteUnsignedInteger (PRC_TYPE_MISC_Attribute)
+
SerializeAttributeEntry
const uint32_t size_of_attribute_keys = attribute_keys.size();
- WriteUnsignedInteger (size_of_attribute_keys)
- for(uint32_t i=0;i<size_of_attribute_keys;i++)
- SerializeContentSingleAttribute (attribute_keys[i])
+ WriteUnsignedInteger (size_of_attribute_keys)
+ for(uint32_t i=0;i<size_of_attribute_keys;i++)
+ SerializeContentSingleAttribute (attribute_keys[i])
}
void PRCAttributes::serializeAttributes(PRCbitStream &pbs) const
{
if (attributes.empty()) { // shortcut for most typical case
const uint32_t number_of_attributes = 0;
- WriteUnsignedInteger (number_of_attributes)
+ WriteUnsignedInteger (number_of_attributes)
return;
}
const uint32_t number_of_attributes = attributes.size();
- WriteUnsignedInteger (number_of_attributes)
+ WriteUnsignedInteger (number_of_attributes)
for(PRCAttributeList::const_iterator it = attributes.begin(); it != attributes.end(); ++it)
{
SerializeAttribute(*it)
@@ -356,7 +356,7 @@ void PRCTextureDefinition::serializeTextureDefinition(PRCbitStream &pbs)
const uint32_t size_texture_mapping_attributes_components = 1;
const uint8_t *texture_mapping_attributes_components = &texture_mapping_attribute_components;
const EPRCTextureMappingType eMappingType = KEPRCTextureMappingType_Stored;
-
+
const double red = 1.0;
const double green = 1.0;
const double blue = 1.0;
@@ -374,8 +374,8 @@ void PRCTextureDefinition::serializeTextureDefinition(PRCbitStream &pbs)
SerializeContentPRCBase
- WriteUnsignedInteger (picture_index+1)
- WriteCharacter (texture_dimension)
+ WriteUnsignedInteger (picture_index+1)
+ WriteCharacter (texture_dimension)
// SerializeTextureMappingType
WriteInteger (eMappingType) // Texture mapping type
@@ -384,19 +384,19 @@ void PRCTextureDefinition::serializeTextureDefinition(PRCbitStream &pbs)
// WriteInteger (eMappingOperator) // Texture mapping operator
// WriteInteger (transformation)
// if (transformation)
- // SerializeCartesianTransformation3d (transformation)
+ // SerializeCartesianTransformation3d (transformation)
// }
- WriteUnsignedInteger (texture_mapping_attributes) // Texture mapping attributes
+ WriteUnsignedInteger (texture_mapping_attributes) // Texture mapping attributes
WriteUnsignedInteger (size_texture_mapping_attributes_intensities)
for (i=0;i<size_texture_mapping_attributes_intensities;i++)
WriteDouble (texture_mapping_attributes_intensities[i])
WriteUnsignedInteger (size_texture_mapping_attributes_components)
for (i=0;i<size_texture_mapping_attributes_components;i++)
- WriteCharacter (texture_mapping_attributes_components[i])
+ WriteCharacter (texture_mapping_attributes_components[i])
WriteInteger (texture_function)
- // reserved for future use; see Texture function
+ // reserved for future use; see Texture function
if (texture_function == KEPRCTextureFunction_Blend)
{
WriteDouble (red) // blend color component in the range [0.0,1.0]
@@ -405,20 +405,20 @@ void PRCTextureDefinition::serializeTextureDefinition(PRCbitStream &pbs)
WriteDouble (alpha) // blend color component in the range [0.0,1.0]
}
- WriteInteger (blend_src_rgb) // Texture blend parameter
- // reserved for future use; see Texture blend parameter
+ WriteInteger (blend_src_rgb) // Texture blend parameter
+ // reserved for future use; see Texture blend parameter
if (blend_src_rgb != KEPRCTextureBlendParameter_Unknown)
- WriteInteger (blend_dst_rgb) // Texture blend parameter
+ WriteInteger (blend_dst_rgb) // Texture blend parameter
- WriteInteger (blend_src_alpha) // Texture blend parameter
- // reserved for future use; see Texture blend parameter
+ WriteInteger (blend_src_alpha) // Texture blend parameter
+ // reserved for future use; see Texture blend parameter
if (blend_src_alpha != KEPRCTextureBlendParameter_Unknown)
- WriteInteger (blend_dst_alpha) // Texture blend parameter
+ WriteInteger (blend_dst_alpha) // Texture blend parameter
- WriteCharacter (texture_applying_mode) // Texture applying mode
+ WriteCharacter (texture_applying_mode) // Texture applying mode
if (texture_applying_mode & PRC_TEXTURE_APPLYING_MODE_ALPHATEST)
{
- WriteInteger (alpha_test) // Texture alpha test
+ WriteInteger (alpha_test) // Texture alpha test
WriteDouble (alpha_test_reference)
}
@@ -448,14 +448,14 @@ void PRCMaterialGeneric::serializeMaterialGeneric(PRCbitStream &pbs)
WriteDouble (specular_alpha)
}
-void PRCTextureApplication::serializeTextureApplication(PRCbitStream &pbs)
+void PRCTextureApplication::serializeTextureApplication(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_GRAPH_TextureApplication)
SerializeContentPRCBase
- WriteUnsignedInteger (material_generic_index+1)
- WriteUnsignedInteger (texture_definition_index+1)
- WriteUnsignedInteger (next_texture_index+1)
+ WriteUnsignedInteger (material_generic_index+1)
+ WriteUnsignedInteger (texture_definition_index+1)
+ WriteUnsignedInteger (next_texture_index+1)
WriteUnsignedInteger (UV_coordinates_index+1)
}
@@ -464,7 +464,7 @@ void PRCLinePattern::serializeLinePattern(PRCbitStream &pbs)
uint32_t i = 0;
WriteUnsignedInteger (PRC_TYPE_GRAPH_LinePattern)
SerializeContentPRCBase
-
+
const uint32_t size_lengths = lengths.size();
WriteUnsignedInteger (size_lengths)
for (i=0;i<size_lengths;i++)
@@ -599,19 +599,19 @@ void resetGraphicsAndName()
void PRCMarkup::serializeMarkup(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_MKP_Markup)
- SerializeContentPRCBase
+ SerializeContentPRCBase
SerializeGraphics
- WriteUnsignedInteger (type)
- WriteUnsignedInteger (sub_type)
+ WriteUnsignedInteger (type)
+ WriteUnsignedInteger (sub_type)
const uint32_t number_of_linked_items = 0;
- WriteUnsignedInteger (number_of_linked_items)
-// for (i=0;i<number_of_linked_items;i++)
+ WriteUnsignedInteger (number_of_linked_items)
+// for (i=0;i<number_of_linked_items;i++)
// SerializeReferenceUniqueIdentifier (linked_items[i])
const uint32_t number_of_leaders = 0;
- WriteUnsignedInteger (number_of_leaders)
-// for (i=0;i<number_of_leaders;i++)
+ WriteUnsignedInteger (number_of_leaders)
+// for (i=0;i<number_of_leaders;i++)
// SerializeReferenceUniqueIdentifier (leaders[i])
- WriteUnsignedInteger (index_tessellation + 1)
+ WriteUnsignedInteger (index_tessellation + 1)
SerializeUserData
}
@@ -621,7 +621,7 @@ void PRCAnnotationItem::serializeAnnotationItem(PRCbitStream &pbs)
// group___tf_annotation_item_____serialize_content2.html
// group___tf_annotation_entity_____serialize_content2.html
WriteUnsignedInteger (PRC_TYPE_MKP_AnnotationItem)
- SerializeContentPRCBase
+ SerializeContentPRCBase
SerializeGraphics
SerializeReferenceUniqueIdentifier (markup)
SerializeUserData
@@ -629,7 +629,7 @@ void PRCAnnotationItem::serializeAnnotationItem(PRCbitStream &pbs)
void PRCRepresentationItemContent::serializeRepresentationItemContent(PRCbitStream &pbs)
{
- SerializeContentPRCBase
+ SerializeContentPRCBase
SerializeGraphics
WriteUnsignedInteger (index_local_coordinate_system + 1)
WriteUnsignedInteger (index_tessellation + 1)
@@ -639,7 +639,7 @@ void PRCBrepModel::serializeBrepModel(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_BrepModel)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
WriteBit (has_brep_data)
if (has_brep_data)
{
@@ -654,7 +654,7 @@ void PRCPolyBrepModel::serializePolyBrepModel(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_PolyBrepModel)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
WriteBoolean (is_closed)
SerializeUserData
}
@@ -663,7 +663,7 @@ void PRCPointSet::serializePointSet(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_PointSet)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
const uint32_t number_of_points = point.size();
WriteUnsignedInteger (number_of_points)
@@ -678,7 +678,7 @@ void PRCSet::serializeSet(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_Set)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
const uint32_t number_of_elements = elements.size();
WriteUnsignedInteger (number_of_elements)
@@ -742,7 +742,7 @@ void PRCWire::serializeWire(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_Curve)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
WriteBit (has_wire_body)
if (has_wire_body)
{
@@ -757,7 +757,7 @@ void PRCPolyWire::serializePolyWire(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_PolyWire)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
SerializeUserData
}
@@ -767,7 +767,7 @@ void PRCGeneralTransformation3d::serializeGeneralTransformation3d(PRCbitStream
// Like Fortran, PRC uses transposed (column-major) format!
for (int j=0;j<4;j++)
for (int i=0;i<4;i++)
- WriteDouble(mat[i][j]);
+ WriteDouble(mat[i][j]);
}
void PRCCartesianTransformation3d::serializeCartesianTransformation3d(PRCbitStream &pbs) const
@@ -807,7 +807,7 @@ void PRCCartesianTransformation3d::serializeCartesianTransformation3d(PRCbitStr
}
void PRCTransformation::serializeTransformation(PRCbitStream &pbs)
-{
+{
WriteBit ( has_transformation )
if (has_transformation)
{
@@ -842,7 +842,7 @@ void PRCCoordinateSystem::serializeCoordinateSystem(PRCbitStream &pbs)
{
WriteUnsignedInteger (PRC_TYPE_RI_CoordinateSystem)
- SerializeRepresentationItemContent
+ SerializeRepresentationItemContent
axis_set->serializeTransformation3d(pbs);
SerializeUserData
}
@@ -871,10 +871,10 @@ void SerializeArrayRGBA (const std::vector<uint8_t> &rgba_vertices,const bool is
const std::vector<uint8_t> &vector_color = rgba_vertices;
const uint32_t number_of_colors=vector_color.size();
const uint32_t number_of_vectors=number_of_colors / number_by_vector;
- // first one
+ // first one
for (i=0;i<number_by_vector;i++)
WriteCharacter (vector_color[i])
-
+
for (i=1;i<number_of_vectors;i++)
{
bool b_same = true;
@@ -901,22 +901,22 @@ void PRCTessFace::serializeTessFace(PRCbitStream &pbs)
WriteUnsignedInteger (PRC_TYPE_TESS_Face)
const uint32_t size_of_line_attributes=line_attributes.size();
- WriteUnsignedInteger (size_of_line_attributes)
- for (i=0;i<size_of_line_attributes;i++)
+ WriteUnsignedInteger (size_of_line_attributes)
+ for (i=0;i<size_of_line_attributes;i++)
SerializeLineAttr (line_attributes[i])
- WriteUnsignedInteger (start_wire)
+ WriteUnsignedInteger (start_wire)
const uint32_t size_of_sizes_wire=sizes_wire.size();
- WriteUnsignedInteger (size_of_sizes_wire)
- for (i=0;i<size_of_sizes_wire;i++)
+ WriteUnsignedInteger (size_of_sizes_wire)
+ for (i=0;i<size_of_sizes_wire;i++)
WriteUnsignedInteger (sizes_wire[i])
- WriteUnsignedInteger (used_entities_flag)
+ WriteUnsignedInteger (used_entities_flag)
- WriteUnsignedInteger (start_triangulated)
+ WriteUnsignedInteger (start_triangulated)
const uint32_t size_of_sizes_triangulated=sizes_triangulated.size();
- WriteUnsignedInteger (size_of_sizes_triangulated)
- for (i=0;i<size_of_sizes_triangulated;i++)
+ WriteUnsignedInteger (size_of_sizes_triangulated)
+ for (i=0;i<size_of_sizes_triangulated;i++)
WriteUnsignedInteger (sizes_triangulated[i])
if(number_of_texture_coordinate_indexes==0 &&
@@ -932,7 +932,7 @@ void PRCTessFace::serializeTessFace(PRCbitStream &pbs)
PRC_FACETESSDATA_TriangleStripeOneNormalTextured
))
WriteUnsignedInteger (1) // workaround for error of not setting number_of_texture_coordinate_indexes
- else
+ else
WriteUnsignedInteger (number_of_texture_coordinate_indexes)
const bool has_vertex_colors = !rgba_vertices.empty();
@@ -951,7 +951,7 @@ void PRCTessFace::serializeTessFace(PRCbitStream &pbs)
// not described
}
}
- if (size_of_line_attributes)
+ if (size_of_line_attributes)
WriteUnsignedInteger (behaviour)
}
@@ -969,7 +969,7 @@ void PRC3DTess::serialize3DTess(PRCbitStream &pbs)
{
uint32_t i=0; // universal index for PRC standart compatibility
WriteUnsignedInteger (PRC_TYPE_TESS_3D)
- SerializeContentBaseTessData
+ SerializeContentBaseTessData
WriteBoolean (has_faces)
WriteBoolean (has_loops)
const bool must_recalculate_normals=normal_coordinate.empty();
@@ -982,28 +982,28 @@ void PRC3DTess::serialize3DTess(PRCbitStream &pbs)
// definition similar to VRML
WriteDouble (crease_angle)
}
-
+
const uint32_t number_of_normal_coordinates=normal_coordinate.size();
WriteUnsignedInteger (number_of_normal_coordinates)
for (i=0;i<number_of_normal_coordinates;i++)
WriteDouble (normal_coordinate[i])
-
+
const uint32_t number_of_wire_indices=wire_index.size();
WriteUnsignedInteger (number_of_wire_indices)
for (i=0;i<number_of_wire_indices;i++)
WriteUnsignedInteger (wire_index[i])
-
+
// note : those can be single triangles, triangle fans or stripes
const uint32_t number_of_triangulated_indices=triangulated_index.size();
WriteUnsignedInteger (number_of_triangulated_indices)
for (i=0;i<number_of_triangulated_indices;i++)
WriteUnsignedInteger (triangulated_index[i])
-
+
const uint32_t number_of_face_tessellation=face_tessellation.size();
WriteUnsignedInteger (number_of_face_tessellation)
for (i=0;i<number_of_face_tessellation;i++)
SerializeTessFace (face_tessellation[i])
-
+
const uint32_t number_of_texture_coordinates=texture_coordinate.size();
WriteUnsignedInteger (number_of_texture_coordinates)
for (i=0;i<number_of_texture_coordinates;i++)
@@ -1022,12 +1022,12 @@ void PRC3DWireTess::serialize3DWireTess(PRCbitStream &pbs)
// group___tf3_d_wire_tess_data_____serialize_content2.html
uint32_t i=0; // universal index for PRC standart compatibility
WriteUnsignedInteger (PRC_TYPE_TESS_3D_Wire)
- SerializeContentBaseTessData
+ SerializeContentBaseTessData
const uint32_t number_of_wire_indexes=wire_indexes.size();
WriteUnsignedInteger (number_of_wire_indexes)
for (i=0;i<number_of_wire_indexes;i++)
WriteUnsignedInteger (wire_indexes[i])
-
+
const bool has_vertex_colors = !rgba_vertices.empty();
WriteBoolean (has_vertex_colors)
if (has_vertex_colors)
@@ -1053,7 +1053,7 @@ void PRCMarkupTess::serializeMarkupTess(PRCbitStream &pbs)
// group___tf_markup_tess_data_____serialize_content2.html
uint32_t i=0; // universal index for PRC standart compatibility
WriteUnsignedInteger (PRC_TYPE_TESS_Markup)
- SerializeContentBaseTessData
+ SerializeContentBaseTessData
const uint32_t number_of_codes=codes.size();
WriteUnsignedInteger (number_of_codes)
@@ -1150,12 +1150,12 @@ void PRCContentSurface::serializeContentSurface(PRCbitStream &pbs)
}
void PRCNURBSSurface::serializeNURBSSurface(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
// uint32_t i=0, j=0;
- WriteUnsignedInteger (PRC_TYPE_SURF_NURBS)
+ WriteUnsignedInteger (PRC_TYPE_SURF_NURBS)
- SerializeContentSurface
+ SerializeContentSurface
WriteBoolean ( is_rational )
WriteUnsignedInteger ( degree_in_u )
WriteUnsignedInteger ( degree_in_v )
@@ -1202,7 +1202,7 @@ void writeUnsignedIntegerWithVariableBitNumber(PRCbitStream &pbs, uint32_t value
if( value >= 1u<<(bit_number - 1 - i) )
{
WriteBoolean (true)
-
+
value -= 1u<<(bit_number - 1 - i);
}
else
@@ -1214,7 +1214,7 @@ void writeUnsignedIntegerWithVariableBitNumber(PRCbitStream &pbs, uint32_t value
#define WriteUnsignedIntegerWithVariableBitNumber( value, bit_number ) writeUnsignedIntegerWithVariableBitNumber( pbs, (value), (bit_number) );
void writeIntegerWithVariableBitNumber(PRCbitStream &pbs, int32_t iValue, uint32_t uBitNumber)
-{
+{
WriteBoolean(iValue<0);
WriteUnsignedIntegerWithVariableBitNumber(abs(iValue), uBitNumber - 1);
}
@@ -1259,7 +1259,7 @@ int32_t intdiv(double dValue, double dTolerance)
assert(ratio <= INT_MAX);
int32_t iTempValue=(int32_t) ratio;
if(ratio - iTempValue >= 0.5) iTempValue++;
- if(dValue < 0)
+ if(dValue < 0)
return -iTempValue;
else
return iTempValue;
@@ -1331,7 +1331,7 @@ void PRCCompressedFace::serializeCompressedAnaNurbs(PRCbitStream &pbs, double b
{
// WriteCompressedEntityType ( PRC_HCG_AnaNurbs )
const bool is_a_curve = false;
- WriteBoolean ( is_a_curve )
+ WriteBoolean ( is_a_curve )
WriteUnsignedIntegerWithVariableBitNumber (13 , 4)
serializeContentCompressedFace( pbs );
serializeCompressedNurbs( pbs, brep_data_compressed_tolerance );
@@ -1342,7 +1342,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
const double nurbs_tolerance = 0.2*brep_data_compressed_tolerance;
const uint32_t degree_in_u = degree;
const uint32_t degree_in_v = degree;
-
+
WriteUnsignedIntegerWithVariableBitNumber ( degree_in_u, 5)
WriteUnsignedIntegerWithVariableBitNumber ( degree_in_v, 5)
@@ -1358,10 +1358,10 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
WriteBoolean (false) // Multiplicity_is_already_stored - no
WriteUnsignedIntegerWithVariableBitNumber( degree_in_v+1,number_bit)
WriteBoolean (true) // Multiplicity_is_already_stored - yes
-
- const bool is_closed_u = false;
+
+ const bool is_closed_u = false;
WriteBoolean ( is_closed_u )
- const bool is_closed_v = false;
+ const bool is_closed_v = false;
WriteBoolean ( is_closed_v )
const uint32_t number_of_control_point_in_u = degree_in_u + 1;
@@ -1385,7 +1385,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
uint32_t number_of_bits_for_isomin = 1;
uint32_t number_of_bits_for_rest = 1;
-
+
for(uint32_t j = 1; j < number_of_control_point_in_v; j++)
{
compressed_control_point[0][j] = iroundto(P[0][j]-P[0][j-1], nurbs_tolerance );
@@ -1410,7 +1410,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
compressed_control_point[i][j].x = 0;
compressed_control_point[i][j].y = 0;
compressed_control_point[i][j].z = 0;
-
+
PRCVector3d V = P[i-1][j] - P[i-1][j-1];
PRCVector3d U = P[i][j-1] - P[i-1][j-1];
PRCVector3d Pc = P[i][j] - (P[i-1][j-1] + U + V);
@@ -1420,7 +1420,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
control_point_type[i][j] = 0;
P[i][j] = P[i-1][j-1] + U + V;
}
- else
+ else
{
PRCVector3d N = U*V;
PRCVector3d Ue = U;
@@ -1473,27 +1473,27 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
WriteDouble ( P[0][0].x )
WriteDouble ( P[0][0].y )
WriteDouble ( P[0][0].z )
-
+
for(uint32_t j = 1; j < number_of_control_point_in_v; j++)
{
WriteIntegerWithVariableBitNumber(compressed_control_point[0][j].x, number_of_bits_for_isomin+1)
WriteIntegerWithVariableBitNumber(compressed_control_point[0][j].y, number_of_bits_for_isomin+1)
WriteIntegerWithVariableBitNumber(compressed_control_point[0][j].z, number_of_bits_for_isomin+1)
}
-
+
for(uint32_t i = 1; i < number_of_control_point_in_u; i++)
{
WriteIntegerWithVariableBitNumber(compressed_control_point[i][0].x, number_of_bits_for_isomin+1)
WriteIntegerWithVariableBitNumber(compressed_control_point[i][0].y, number_of_bits_for_isomin+1)
WriteIntegerWithVariableBitNumber(compressed_control_point[i][0].z, number_of_bits_for_isomin+1)
}
-
+
for(uint32_t i = 1; i < number_of_control_point_in_u; i++)
{
for(uint32_t j = 1; j < number_of_control_point_in_v; j++)
{
WriteUnsignedIntegerWithVariableBitNumber ( control_point_type[i][j], 2 )
-
+
if(control_point_type[i][j] == 1)
{
WriteIntegerWithVariableBitNumber ( compressed_control_point[i][j].z, number_of_bits_for_rest+1 )
@@ -1511,7 +1511,7 @@ void PRCCompressedFace::serializeCompressedNurbs(PRCbitStream &pbs, double brep
}
}
}
-
+
const uint32_t type_param_u = 0;
WriteBoolean( type_param_u == 0 )
const uint32_t type_param_v = 0;
@@ -1528,10 +1528,10 @@ void PRCCompressedBrepData::serializeCompressedShell(PRCbitStream &pbs)
if( number_of_face != 1 )
WriteNumberOfBitsThenUnsignedInteger (number_of_face)
-
+
for( i=0; i < number_of_face; i++)
SerializeCompressedFace ( face[i] )
-
+
const bool is_an_iso_face = false;
for( i=0; i < number_of_face; i++)
WriteBoolean ( is_an_iso_face )
@@ -1541,7 +1541,7 @@ void PRCCompressedBrepData::serializeCompressedBrepData(PRCbitStream &pbs)
{
WriteUnsignedInteger ( PRC_TYPE_TOPO_BrepDataCompress )
SerializeContentBody
-
+
WriteDouble ( brep_data_compressed_tolerance )
const uint32_t number_of_bits_to_store_reference = 1;
WriteNumberOfBitsThenUnsignedInteger ( number_of_bits_to_store_reference )
@@ -1549,7 +1549,7 @@ void PRCCompressedBrepData::serializeCompressedBrepData(PRCbitStream &pbs)
WriteUnsignedIntegerWithVariableBitNumber ( number_vertex_iso, number_of_bits_to_store_reference )
const uint32_t number_edge_iso = 0;
WriteUnsignedIntegerWithVariableBitNumber ( number_edge_iso, number_of_bits_to_store_reference )
-
+
const uint32_t number_of_shell = 1;
const uint32_t number_of_connex = 1;
WriteBoolean ( number_of_shell == 1 && number_of_connex == 1 )
@@ -1562,31 +1562,31 @@ void PRCCompressedBrepData::serializeCompressedBrepData(PRCbitStream &pbs)
}
void PRCBlend01::serializeBlend01(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Blend01)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Blend01)
SerializeContentSurface
SerializeTransformation
SerializeUVParameterization
- SerializePtrCurve ( center_curve )
- SerializePtrCurve ( origin_curve )
- SerializePtrCurve ( tangent_curve )
+ SerializePtrCurve ( center_curve )
+ SerializePtrCurve ( origin_curve )
+ SerializePtrCurve ( tangent_curve )
}
void PRCRuled::serializeRuled(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Ruled)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Ruled)
SerializeContentSurface
SerializeTransformation
SerializeUVParameterization
- SerializePtrCurve ( first_curve )
- SerializePtrCurve ( second_curve )
+ SerializePtrCurve ( first_curve )
+ SerializePtrCurve ( second_curve )
}
void PRCSphere::serializeSphere(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Sphere)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Sphere)
SerializeContentSurface
SerializeTransformation
@@ -1595,8 +1595,8 @@ void PRCSphere::serializeSphere(PRCbitStream &pbs)
}
void PRCCone::serializeCone(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Cone)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Cone)
SerializeContentSurface
SerializeTransformation
@@ -1606,8 +1606,8 @@ void PRCCone::serializeCone(PRCbitStream &pbs)
}
void PRCCylinder::serializeCylinder(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Cylinder)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Cylinder)
SerializeContentSurface
SerializeTransformation
@@ -1616,8 +1616,8 @@ void PRCCylinder::serializeCylinder(PRCbitStream &pbs)
}
void PRCTorus::serializeTorus(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_SURF_Torus)
+{
+ WriteUnsignedInteger (PRC_TYPE_SURF_Torus)
SerializeContentSurface
SerializeTransformation
@@ -1627,18 +1627,18 @@ void PRCTorus::serializeTorus(PRCbitStream &pbs)
}
void PRCFace::serializeFace(PRCbitStream &pbs)
-{
+{
uint32_t i = 0;
- WriteUnsignedInteger (PRC_TYPE_TOPO_Face)
+ WriteUnsignedInteger (PRC_TYPE_TOPO_Face)
SerializeBaseTopology
SerializePtrSurface ( base_surface )
WriteBit ( have_surface_trim_domain )
if ( have_surface_trim_domain )
- SerializeDomain ( surface_trim_domain )
+ SerializeDomain ( surface_trim_domain )
WriteBit ( have_tolerance )
if ( have_tolerance )
- WriteDouble ( tolerance )
+ WriteDouble ( tolerance )
WriteUnsignedInteger ( number_of_loop )
WriteInteger ( outer_loop_index )
for (i=0;i<number_of_loop;i++)
@@ -1648,14 +1648,14 @@ void PRCFace::serializeFace(PRCbitStream &pbs)
}
void PRCShell::serializeShell(PRCbitStream &pbs)
-{
+{
uint32_t i = 0;
- WriteUnsignedInteger (PRC_TYPE_TOPO_Shell)
+ WriteUnsignedInteger (PRC_TYPE_TOPO_Shell)
SerializeBaseTopology
WriteBoolean ( shell_is_closed )
uint32_t number_of_face = face.size();
- WriteUnsignedInteger ( number_of_face )
+ WriteUnsignedInteger ( number_of_face )
for (i=0;i<number_of_face;i++)
{
SerializePtrTopology ( face[i] )
@@ -1671,13 +1671,13 @@ void PRCShell::addFace(PRCFace*& pFace, uint8_t orientation)
}
void PRCConnex::serializeConnex(PRCbitStream &pbs)
-{
+{
uint32_t i = 0;
- WriteUnsignedInteger (PRC_TYPE_TOPO_Connex)
+ WriteUnsignedInteger (PRC_TYPE_TOPO_Connex)
SerializeBaseTopology
uint32_t number_of_shell = shell.size();
- WriteUnsignedInteger ( number_of_shell )
+ WriteUnsignedInteger ( number_of_shell )
for (i=0;i<number_of_shell;i++)
{
SerializePtrTopology ( shell[i] )
@@ -1694,11 +1694,11 @@ void PRCConnex::addShell(PRCShell*& pShell)
void PRCBrepData::serializeBrepData(PRCbitStream &pbs)
{
uint32_t i = 0;
- WriteUnsignedInteger ( PRC_TYPE_TOPO_BrepData)
+ WriteUnsignedInteger ( PRC_TYPE_TOPO_BrepData)
- SerializeContentBody
+ SerializeContentBody
uint32_t number_of_connex = connex.size();
- WriteUnsignedInteger ( number_of_connex )
+ WriteUnsignedInteger ( number_of_connex )
for ( i=0; i<number_of_connex; i++)
{
SerializePtrTopology ( connex[i] )
@@ -1725,8 +1725,8 @@ void PRCContentWireEdge::serializeContentWireEdge(PRCbitStream &pbs)
void PRCWireEdge::serializeWireEdge(PRCbitStream &pbs)
{
- WriteUnsignedInteger (PRC_TYPE_TOPO_WireEdge)
- SerializeContentWireEdge
+ WriteUnsignedInteger (PRC_TYPE_TOPO_WireEdge)
+ SerializeContentWireEdge
}
void PRCContentCurve::serializeContentCurve(PRCbitStream &pbs)
@@ -1737,11 +1737,11 @@ void PRCContentCurve::serializeContentCurve(PRCbitStream &pbs)
}
void PRCNURBSCurve::serializeNURBSCurve(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
- WriteUnsignedInteger (PRC_TYPE_CRV_NURBS)
+ WriteUnsignedInteger (PRC_TYPE_CRV_NURBS)
- SerializeContentCurve
+ SerializeContentCurve
WriteBoolean ( is_rational )
WriteUnsignedInteger ( degree )
uint32_t highest_index_of_control_point = control_point.size()-1;
@@ -1764,16 +1764,16 @@ void PRCNURBSCurve::serializeNURBSCurve(PRCbitStream &pbs)
}
void PRCPolyLine::serializePolyLine(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
- WriteUnsignedInteger (PRC_TYPE_CRV_PolyLine)
+ WriteUnsignedInteger (PRC_TYPE_CRV_PolyLine)
- SerializeContentCurve
+ SerializeContentCurve
SerializeTransformation
SerializeParameterization
uint32_t number_of_point = point.size();
- WriteUnsignedInteger ( number_of_point )
- for (i=0; i<number_of_point; i++)
+ WriteUnsignedInteger ( number_of_point )
+ for (i=0; i<number_of_point; i++)
{
if (is_3d)
SerializeVector3d ( point[i] )
@@ -1783,26 +1783,26 @@ void PRCPolyLine::serializePolyLine(PRCbitStream &pbs)
}
void PRCCircle::serializeCircle(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_CRV_Circle)
+{
+ WriteUnsignedInteger (PRC_TYPE_CRV_Circle)
- SerializeContentCurve
+ SerializeContentCurve
SerializeTransformation
SerializeParameterization
WriteDouble ( radius )
}
void PRCComposite::serializeComposite(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
- WriteUnsignedInteger (PRC_TYPE_CRV_Composite)
+ WriteUnsignedInteger (PRC_TYPE_CRV_Composite)
- SerializeContentCurve
+ SerializeContentCurve
SerializeTransformation
SerializeParameterization
uint32_t number_of_curves = base_curve.size();
- WriteUnsignedInteger ( number_of_curves )
- for (i=0; i<number_of_curves; i++)
+ WriteUnsignedInteger ( number_of_curves )
+ for (i=0; i<number_of_curves; i++)
{
SerializePtrCurve ( base_curve[i] )
WriteBoolean ( base_sense[i] )
@@ -1811,8 +1811,8 @@ void PRCComposite::serializeComposite(PRCbitStream &pbs)
}
void PRCTopoContext::serializeTopoContext(PRCbitStream &pbs)
-{
- WriteUnsignedInteger (PRC_TYPE_TOPO_Context)
+{
+ WriteUnsignedInteger (PRC_TYPE_TOPO_Context)
SerializeContentPRCBase
WriteCharacter ( behaviour )
@@ -1827,32 +1827,32 @@ void PRCTopoContext::serializeTopoContext(PRCbitStream &pbs)
}
void PRCTopoContext::serializeContextAndBodies(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
- SerializeTopoContext
+ SerializeTopoContext
uint32_t number_of_bodies = body.size();
- WriteUnsignedInteger (number_of_bodies)
- for (i=0;i<number_of_bodies;i++)
- SerializeBody (body[i])
+ WriteUnsignedInteger (number_of_bodies)
+ for (i=0;i<number_of_bodies;i++)
+ SerializeBody (body[i])
}
void PRCTopoContext::serializeGeometrySummary(PRCbitStream &pbs)
-{
+{
uint32_t i=0;
uint32_t number_of_bodies = body.size();
- WriteUnsignedInteger (number_of_bodies)
- for (i=0;i<number_of_bodies;i++)
+ WriteUnsignedInteger (number_of_bodies)
+ for (i=0;i<number_of_bodies;i++)
{
- WriteUnsignedInteger ( body[i]->serialType() )
+ WriteUnsignedInteger ( body[i]->serialType() )
if ( IsCompressedType(body[i]->serialType()) )
{
- WriteDouble ( body[i]->serialTolerance() )
+ WriteDouble ( body[i]->serialTolerance() )
}
}
}
void PRCTopoContext::serializeContextGraphics(PRCbitStream &pbs)
-{
+{
uint32_t i=0, j=0, k=0, l=0;
ResetCurrentGraphics
uint32_t number_of_body = body.size();
@@ -1888,17 +1888,17 @@ void PRCTopoContext::serializeContextGraphics(PRCbitStream &pbs)
uint32_t number_of_treat_type = 0;
if (has_graphics && !element.empty())
number_of_treat_type = 1;
- WriteUnsignedInteger (number_of_treat_type)
- for (i=0;i<number_of_treat_type;i++)
+ WriteUnsignedInteger (number_of_treat_type)
+ for (i=0;i<number_of_treat_type;i++)
{
const uint32_t element_type = PRC_TYPE_TOPO_Face;
- WriteUnsignedInteger (element_type)
+ WriteUnsignedInteger (element_type)
const uint32_t number_of_element = element.size();
- WriteUnsignedInteger (number_of_element)
- for (j=0;j<number_of_element;j++)
+ WriteUnsignedInteger (number_of_element)
+ for (j=0;j<number_of_element;j++)
{
- WriteBoolean ( element[j]->has_graphics() )
- if (element[j]->has_graphics())
+ WriteBoolean ( element[j]->has_graphics() )
+ if (element[j]->has_graphics())
{
element[j]->serializeGraphics(pbs);
}
@@ -1929,26 +1929,26 @@ uint32_t PRCTopoContext::addCompressedBrepData(PRCCompressedBrepData*& pCompress
void PRCSingleWireBody::serializeSingleWireBody(PRCbitStream &pbs)
{
- WriteUnsignedInteger ( PRC_TYPE_TOPO_SingleWireBody)
+ WriteUnsignedInteger ( PRC_TYPE_TOPO_SingleWireBody)
- SerializeContentBody
+ SerializeContentBody
SerializePtrTopology ( wire_edge )
}
void PRCUniqueId::serializeCompressedUniqueId(PRCbitStream &pbs) const
{
- WriteUnsignedInteger (id0)
- WriteUnsignedInteger (id1)
- WriteUnsignedInteger (id2)
- WriteUnsignedInteger (id3)
+ WriteUnsignedInteger (id0)
+ WriteUnsignedInteger (id1)
+ WriteUnsignedInteger (id2)
+ WriteUnsignedInteger (id3)
}
void PRCUniqueId::serializeFileStructureUncompressedUniqueId(std::ostream& out) const
{
- WriteUncompressedUnsignedInteger (id0)
- WriteUncompressedUnsignedInteger (id1)
- WriteUncompressedUnsignedInteger (id2)
- WriteUncompressedUnsignedInteger (id3)
+ WriteUncompressedUnsignedInteger (id0)
+ WriteUncompressedUnsignedInteger (id1)
+ WriteUncompressedUnsignedInteger (id2)
+ WriteUncompressedUnsignedInteger (id3)
}
void PRCUnit::serializeUnit(PRCbitStream &pbs)
@@ -1959,11 +1959,11 @@ void PRCUnit::serializeUnit(PRCbitStream &pbs)
void PRCProductOccurrence::serializeProductOccurrence(PRCbitStream &pbs)
{
- WriteUnsignedInteger ( PRC_TYPE_ASM_ProductOccurence )
+ WriteUnsignedInteger ( PRC_TYPE_ASM_ProductOccurence )
- SerializePRCBaseWithGraphics
+ SerializePRCBaseWithGraphics
-// SerializeReferencesOfProductOccurrence
+// SerializeReferencesOfProductOccurrence
WriteUnsignedInteger (index_part+1)
WriteUnsignedInteger (index_prototype+1)
if (index_prototype != m1)
@@ -1995,16 +1995,16 @@ void PRCProductOccurrence::serializeProductOccurrence(PRCbitStream &pbs)
WriteBit (has_location)
if (has_location)
location->serializeTransformation3d (pbs);
-
+
WriteUnsignedInteger (0) // number_of_references
-
+
// SerializeMarkups (markups)
- WriteUnsignedInteger (0) // number_of_linked_items
- WriteUnsignedInteger (0) // number_of_leaders
- WriteUnsignedInteger (0) // number_of_markups
- WriteUnsignedInteger (0) // number_of_annotation_entities
+ WriteUnsignedInteger (0) // number_of_linked_items
+ WriteUnsignedInteger (0) // number_of_leaders
+ WriteUnsignedInteger (0) // number_of_markups
+ WriteUnsignedInteger (0) // number_of_annotation_entities
+
-
WriteUnsignedInteger (0) // number_of_views
WriteBit (false) // has_entity_filter
WriteUnsignedInteger (0) // number_of_display_filters
@@ -2064,8 +2064,8 @@ uint32_t PRCPartDefinition::addRepresentationItem(PRCRepresentationItem*& pRepre
void PRCPartDefinition::serializePartDefinition(PRCbitStream &pbs)
{
- WriteUnsignedInteger ( PRC_TYPE_ASM_PartDefinition )
-
+ WriteUnsignedInteger ( PRC_TYPE_ASM_PartDefinition )
+
SerializePRCBaseWithGraphics
SerializeBoundingBox
@@ -2073,13 +2073,13 @@ void PRCPartDefinition::serializePartDefinition(PRCbitStream &pbs)
WriteUnsignedInteger (number_of_representation_items)
for (uint32_t i=0;i<number_of_representation_items;i++)
SerializeRepresentationItem (representation_item[i])
-
+
// SerializeMarkups (markups)
- WriteUnsignedInteger (0) // number_of_linked_items
- WriteUnsignedInteger (0) // number_of_leaders
- WriteUnsignedInteger (0) // number_of_markups
- WriteUnsignedInteger (0) // number_of_annotation_entities
+ WriteUnsignedInteger (0) // number_of_linked_items
+ WriteUnsignedInteger (0) // number_of_leaders
+ WriteUnsignedInteger (0) // number_of_markups
+ WriteUnsignedInteger (0) // number_of_annotation_entities
WriteUnsignedInteger (0) // number_of_views
SerializeUserData
-}
+}
diff --git a/graphics/asymptote/primitives.h b/graphics/asymptote/primitives.h
index 1d9f88e2d6..cbf37601c7 100644
--- a/graphics/asymptote/primitives.h
+++ b/graphics/asymptote/primitives.h
@@ -35,7 +35,7 @@ PRIMITIVE(path3,Path3,path3)
PRIMITIVE(cycleToken,CycleToken,cycleToken)
PRIMITIVE(tensionSpecifier,TensionSpecifier,tensionSpecifier)
PRIMITIVE(curlSpecifier,CurlSpecifier,curlSpecifier)
- PRIMITIVE(pen,Pen,pen)
+PRIMITIVE(pen,Pen,pen)
PRIMITIVE(picture,Picture,frame)
PRIMITIVE(file,File,file)
PRIMITIVE(code,Code,code)
diff --git a/graphics/asymptote/profiler.h b/graphics/asymptote/profiler.h
index 4c69d8d7f6..e544e1a61e 100644
--- a/graphics/asymptote/profiler.h
+++ b/graphics/asymptote/profiler.h
@@ -8,7 +8,9 @@
#ifndef PROFILER_H
#define PROFILER_H
+#if !defined(_WIN32)
#include <sys/time.h>
+#endif
#include <iostream>
diff --git a/graphics/asymptote/psfile.cc b/graphics/asymptote/psfile.cc
index 60152e8d18..fe7208f62a 100644
--- a/graphics/asymptote/psfile.cc
+++ b/graphics/asymptote/psfile.cc
@@ -122,7 +122,9 @@ void psfile::close()
if(out) {
out->flush();
if(!filename.empty()) {
-#ifdef __MSDOS__
+#if defined(_MSC_VER)
+
+#else
chmod(filename.c_str(),~settings::mask & 0777);
#endif
if(!out->good())
@@ -152,7 +154,7 @@ void psfile::prologue(const bbox& box)
{
header(true);
BoundingBox(box);
- *out << "%%Creator: " << settings::PROGRAM << " " << settings::VERSION
+ *out << "%%Creator: " << PACKAGE_NAME << " " << PACKAGE_VERSION
<< REVISION << newl;
time_t t; time(&t);
diff --git a/graphics/asymptote/quick-start-win32.ps1 b/graphics/asymptote/quick-start-win32.ps1
new file mode 100644
index 0000000000..c29cfc78d5
--- /dev/null
+++ b/graphics/asymptote/quick-start-win32.ps1
@@ -0,0 +1,60 @@
+#!/usr/bin/env pwsh
+
+# Windows check
+if ($PSVersionTable.PSVersion.Major -gt 5)
+{
+ if (-Not $IsWindows)
+ {
+ Write-Output "This script is only for windows."
+ Break
+ }
+}
+
+# check for vcpkg
+$vcpkgDefaultLoc = "$env:USERPROFILE/.vcpkg"
+if (-Not $env:VCPKG_ROOT)
+{
+ Write-Host "VCPKG_ROOT Not found, checking for $vcpkgDefaultLoc"
+ if (-Not (Test-Path $vcpkgDefaultLoc/vcpkg.exe))
+ {
+ Write-Host "vcpkg not found; will clone vcpkg"
+ Remove-Item -Force -Recurse $vcpkgDefaultLoc
+ git clone https://github.com/microsoft/vcpkg.git "$vcpkgDefaultLoc"
+
+ Push-Location "$vcpkgDefaultLoc"
+ & ./bootstrap-vcpkg.bat
+ Pop-Location
+ }
+ else
+ {
+ Write-Host "vcpkg.exe found, will pull to latest"
+ Push-Location "$vcpkgDefaultLoc"
+ git pull --autostash
+ Pop-Location
+ }
+
+ $env:VCPKG_ROOT = $vcpkgDefaultLoc
+}
+else
+{
+ Write-Host "Using VCPKG_ROOT at $($env:VCPKG_ROOT)"
+}
+
+# check for visual studio
+$vsInfo = Get-CimInstance MSFT_VSInstance -Namespace root/cimv2/vs
+if ($vsInfo -eq $null)
+{
+ Write-Output "Visual Studio not found. Please install visual studio."
+ Break
+}
+
+Write-Output "Using $($vsInfo.Name) at $($vsInfo.InstallLocation)"
+& "$($vsInfo.InstallLocation)\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -HostArch amd64 -SkipAutomaticLocation
+
+cmake --preset msvc/release
+
+Write-Output "Configuration done. Please run
+cmake --build --preset msvc/release --target asy-with-basefiles
+to build Asymptote."
+
+Exit-PSSession
diff --git a/graphics/asymptote/revision.cc b/graphics/asymptote/revision.cc
index 84044921b3..bcee1e2be0 100644
--- a/graphics/asymptote/revision.cc
+++ b/graphics/asymptote/revision.cc
@@ -1,2 +1,2 @@
-const char *REVISION="2.92";
+const char *REVISION="2.93";
const char *AsyGLVersion="1.02";
diff --git a/graphics/asymptote/rounding.h b/graphics/asymptote/rounding.h
index 4c02d0042a..57f565199d 100644
--- a/graphics/asymptote/rounding.h
+++ b/graphics/asymptote/rounding.h
@@ -51,11 +51,16 @@ static fpu_control_t fpu_init;
# else /* not __FreeBSD__ */
# ifdef WIN32
# ifdef _MSC_VER
-# include <float.h>
+# ifdef _M_IX86 /* only supported on x86 systems (not 64 bit) */
+# include <float.h>
static unsigned int fpu_init;
-# define FPU_ROUND_DOUBLE (fpu_init = _controlfp (0, 0), \
- _controlfp (_PC_53, MCW_PC))
-# define FPU_RESTORE (_controlfp (fpu_init, 0xfffff))
+# define FPU_ROUND_DOUBLE (fpu_init = _controlfp (0, 0), \
+ _controlfp (_PC_53, MCW_PC))
+# define FPU_RESTORE (_controlfp (fpu_init, 0xfffff))
+# else /* _M_X64 */
+# define FPU_ROUND_DOUBLE
+# define FPU_RESTORE
+# endif /* _M_X64 */
# elif __MINGW32__
# include <float.h>
static unsigned int fpu_init;
diff --git a/graphics/asymptote/runarray.cc b/graphics/asymptote/runarray.cc
index f841e0f522..8684614f1b 100644
--- a/graphics/asymptote/runarray.cc
+++ b/graphics/asymptote/runarray.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runarray.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runarray.in"
+#line 1 "./runarray.in"
/*****
* runarray.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -655,10 +655,10 @@ void integeroverflow(size_t i)
#endif
namespace run {
// Create an empty array.
-#line 610 "runarray.in"
+#line 610 "./runarray.in"
void emptyArray(stack *Stack)
{
-#line 611 "runarray.in"
+#line 611 "./runarray.in"
{Stack->push<array*>(new array(0)); return;}
}
@@ -667,11 +667,11 @@ void emptyArray(stack *Stack)
// is popped off the stack, followed by each dimension in reverse order.
// The array itself is technically a one dimensional array of one
// dimension arrays and so on.
-#line 620 "runarray.in"
+#line 620 "./runarray.in"
void newDeepArray(stack *Stack)
{
Int depth=vm::pop<Int>(Stack);
-#line 621 "runarray.in"
+#line 621 "./runarray.in"
assert(depth > 0);
Int *dims = new Int[depth];
@@ -690,11 +690,11 @@ void newDeepArray(stack *Stack)
// Creates an array with elements already specified. First, the number
// of elements is popped off the stack, followed by each element in
// reverse order.
-#line 640 "runarray.in"
+#line 640 "./runarray.in"
void newInitializedArray(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 641 "runarray.in"
+#line 641 "./runarray.in"
assert(n >= 0);
array *a = new array(n);
@@ -707,12 +707,12 @@ void newInitializedArray(stack *Stack)
// Similar to newInitializedArray, but after the n elements, append another
// array to it.
-#line 654 "runarray.in"
+#line 654 "./runarray.in"
void newAppendedArray(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
array* tail=vm::pop<array*>(Stack);
-#line 655 "runarray.in"
+#line 655 "./runarray.in"
assert(n >= 0);
array *a = new array(n);
@@ -729,14 +729,14 @@ void newAppendedArray(stack *Stack)
// typeDepth is the true depth of the array determined at compile-time when the
// operations for the array type are added. This typeDepth argument is
// automatically pushed on the stack and is not visible to the user.
-#line 672 "runarray.in"
+#line 672 "./runarray.in"
void copyArrayValue(stack *Stack)
{
Int typeDepth=vm::pop<Int>(Stack);
Int depth=vm::pop<Int>(Stack,Int_MAX);
item value=vm::pop(Stack);
Int n=vm::pop<Int>(Stack);
-#line 673 "runarray.in"
+#line 673 "./runarray.in"
if(n < 0) error("cannot create a negative length array");
if(depth < 0) error("cannot copy to a negative depth");
if(depth > typeDepth) depth=typeDepth;
@@ -747,13 +747,13 @@ void copyArrayValue(stack *Stack)
// typeDepth is the true depth of the array determined at compile-time when the
// operations for the array type are added. This typeDepth argument is
// automatically pushed on the stack and is not visible to the user.
-#line 684 "runarray.in"
+#line 684 "./runarray.in"
void copyArray(stack *Stack)
{
Int typeDepth=vm::pop<Int>(Stack);
Int depth=vm::pop<Int>(Stack,Int_MAX);
array * a=vm::pop<array *>(Stack);
-#line 685 "runarray.in"
+#line 685 "./runarray.in"
if(a == 0) vm::error(dereferenceNullArray);
if(depth < 0) error("cannot copy to a negative depth");
if(depth > typeDepth) depth=typeDepth;
@@ -761,12 +761,12 @@ void copyArray(stack *Stack)
}
// Read an element from an array. Checks for initialization & bounds.
-#line 693 "runarray.in"
+#line 693 "./runarray.in"
void arrayRead(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 694 "runarray.in"
+#line 694 "./runarray.in"
item& i=arrayRead(a,n);
if (i.empty()) {
ostringstream buf;
@@ -777,37 +777,37 @@ void arrayRead(stack *Stack)
}
// Slice a substring from an array.
-#line 705 "runarray.in"
+#line 705 "./runarray.in"
void arraySliceRead(stack *Stack)
{
Int right=vm::pop<Int>(Stack);
Int left=vm::pop<Int>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 706 "runarray.in"
+#line 706 "./runarray.in"
checkArray(a);
{Stack->push(a->slice(left, right)); return;}
}
// Slice a substring from an array. This implements the cases a[i:] and a[:]
// where the endpoint is not given, and assumed to be the length of the array.
-#line 713 "runarray.in"
+#line 713 "./runarray.in"
void arraySliceReadToEnd(stack *Stack)
{
Int left=vm::pop<Int>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 714 "runarray.in"
+#line 714 "./runarray.in"
size_t len=checkArray(a);
{Stack->push(a->slice(left, (Int)len)); return;}
}
// Read an element from an array of arrays. Check bounds and initialize
// as necessary.
-#line 721 "runarray.in"
+#line 721 "./runarray.in"
void arrayArrayRead(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 722 "runarray.in"
+#line 722 "./runarray.in"
item& i=arrayRead(a,n);
if (i.empty()) i=new array(0);
{Stack->push(i); return;}
@@ -815,13 +815,13 @@ void arrayArrayRead(stack *Stack)
// Write an element to an array. Increase size if necessary.
// TODO: Add arrayWriteAndPop
-#line 730 "runarray.in"
+#line 730 "./runarray.in"
void arrayWrite(stack *Stack)
{
item value=vm::pop(Stack);
Int n=vm::pop<Int>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 731 "runarray.in"
+#line 731 "./runarray.in"
size_t len=checkArray(a);
bool cyclic=a->cyclic();
if(cyclic && len > 0) n=imod(n,len);
@@ -835,27 +835,27 @@ void arrayWrite(stack *Stack)
{Stack->push(value); return;}
}
-#line 745 "runarray.in"
+#line 745 "./runarray.in"
void arraySliceWrite(stack *Stack)
{
array * src=vm::pop<array *>(Stack);
Int right=vm::pop<Int>(Stack);
Int left=vm::pop<Int>(Stack);
array * dest=vm::pop<array *>(Stack);
-#line 746 "runarray.in"
+#line 746 "./runarray.in"
checkArray(src);
checkArray(dest);
dest->setSlice(left, right, src);
{Stack->push<array*>(src); return;}
}
-#line 753 "runarray.in"
+#line 753 "./runarray.in"
void arraySliceWriteToEnd(stack *Stack)
{
array * src=vm::pop<array *>(Stack);
Int left=vm::pop<Int>(Stack);
array * dest=vm::pop<array *>(Stack);
-#line 754 "runarray.in"
+#line 754 "./runarray.in"
checkArray(src);
size_t len=checkArray(dest);
dest->setSlice(left, (Int) len, src);
@@ -863,20 +863,20 @@ void arraySliceWriteToEnd(stack *Stack)
}
// Returns the length of an array.
-#line 762 "runarray.in"
+#line 762 "./runarray.in"
void arrayLength(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 763 "runarray.in"
+#line 763 "./runarray.in"
{Stack->push<Int>((Int) checkArray(a)); return;}
}
// Returns an array of integers representing the keys of the array.
-#line 768 "runarray.in"
+#line 768 "./runarray.in"
void arrayKeys(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 769 "runarray.in"
+#line 769 "./runarray.in"
size_t size=checkArray(a);
array *keys=new array();
@@ -890,33 +890,33 @@ void arrayKeys(stack *Stack)
}
// Return the cyclic flag for an array.
-#line 783 "runarray.in"
+#line 783 "./runarray.in"
void arrayCyclicFlag(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 784 "runarray.in"
+#line 784 "./runarray.in"
checkArray(a);
{Stack->push<bool>(a->cyclic()); return;}
}
-#line 789 "runarray.in"
+#line 789 "./runarray.in"
void arraySetCyclicFlag(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
bool b=vm::pop<bool>(Stack);
-#line 790 "runarray.in"
+#line 790 "./runarray.in"
checkArray(a);
a->cyclic(b);
{Stack->push<bool>(b); return;}
}
// Check to see if an array element is initialized.
-#line 797 "runarray.in"
+#line 797 "./runarray.in"
void arrayInitializedHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
Int n=vm::pop<Int>(Stack);
-#line 798 "runarray.in"
+#line 798 "./runarray.in"
size_t len=checkArray(a);
bool cyclic=a->cyclic();
if(cyclic && len > 0) n=imod(n,len);
@@ -926,62 +926,62 @@ void arrayInitializedHelper(stack *Stack)
}
// Returns the initialize method for an array.
-#line 808 "runarray.in"
+#line 808 "./runarray.in"
void arrayInitialized(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 809 "runarray.in"
+#line 809 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayInitializedHelper),a)); return;}
}
// The helper function for the cyclic method that sets the cyclic flag.
-#line 814 "runarray.in"
+#line 814 "./runarray.in"
void arrayCyclicHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
bool b=vm::pop<bool>(Stack);
-#line 815 "runarray.in"
+#line 815 "./runarray.in"
checkArray(a);
a->cyclic(b);
}
// Set the cyclic flag for an array.
-#line 821 "runarray.in"
+#line 821 "./runarray.in"
void arrayCyclic(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 822 "runarray.in"
+#line 822 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayCyclicHelper),a)); return;}
}
// The helper function for the push method that does the actual operation.
-#line 827 "runarray.in"
+#line 827 "./runarray.in"
void arrayPushHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
item x=vm::pop(Stack);
-#line 828 "runarray.in"
+#line 828 "./runarray.in"
checkArray(a);
a->push(x);
{Stack->push(x); return;}
}
// Returns the push method for an array.
-#line 835 "runarray.in"
+#line 835 "./runarray.in"
void arrayPush(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 836 "runarray.in"
+#line 836 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayPushHelper),a)); return;}
}
// The helper function for the append method that appends b to a.
-#line 841 "runarray.in"
+#line 841 "./runarray.in"
void arrayAppendHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
array * b=vm::pop<array *>(Stack);
-#line 842 "runarray.in"
+#line 842 "./runarray.in"
checkArray(a);
size_t size=checkArray(b);
for(size_t i=0; i < size; i++)
@@ -989,20 +989,20 @@ void arrayAppendHelper(stack *Stack)
}
// Returns the append method for an array.
-#line 850 "runarray.in"
+#line 850 "./runarray.in"
void arrayAppend(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 851 "runarray.in"
+#line 851 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayAppendHelper),a)); return;}
}
// The helper function for the pop method.
-#line 856 "runarray.in"
+#line 856 "./runarray.in"
void arrayPopHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 857 "runarray.in"
+#line 857 "./runarray.in"
size_t asize=checkArray(a);
if(asize == 0)
error("cannot pop element from empty array");
@@ -1010,22 +1010,22 @@ void arrayPopHelper(stack *Stack)
}
// Returns the pop method for an array.
-#line 865 "runarray.in"
+#line 865 "./runarray.in"
void arrayPop(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 866 "runarray.in"
+#line 866 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayPopHelper),a)); return;}
}
// The helper function for the insert method.
-#line 871 "runarray.in"
+#line 871 "./runarray.in"
void arrayInsertHelper(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
array * x=vm::pop<array *>(Stack);
Int i=vm::pop<Int>(Stack);
-#line 872 "runarray.in"
+#line 872 "./runarray.in"
size_t asize=checkArray(a);
checkArray(x);
if(a->cyclic() && asize > 0) i=imod(i,asize);
@@ -1035,39 +1035,39 @@ void arrayInsertHelper(stack *Stack)
}
// Returns the insert method for an array.
-#line 882 "runarray.in"
+#line 882 "./runarray.in"
void arrayInsert(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 883 "runarray.in"
+#line 883 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayInsertHelper),a)); return;}
}
// Returns the delete method for an array.
-#line 888 "runarray.in"
+#line 888 "./runarray.in"
void arrayDelete(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 889 "runarray.in"
+#line 889 "./runarray.in"
{Stack->push<callable*>(new thunk(new bfunc(arrayDeleteHelper),a)); return;}
}
-#line 893 "runarray.in"
+#line 893 "./runarray.in"
void arrayAlias(stack *Stack)
{
array * b=vm::pop<array *>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 894 "runarray.in"
+#line 894 "./runarray.in"
{Stack->push<bool>(a==b); return;}
}
// Return array formed by indexing array a with elements of integer array b
-#line 899 "runarray.in"
+#line 899 "./runarray.in"
void arrayIntArray(stack *Stack)
{
array * b=vm::pop<array *>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 900 "runarray.in"
+#line 900 "./runarray.in"
size_t asize=checkArray(a);
size_t bsize=checkArray(b);
array *r=new array(bsize);
@@ -1085,13 +1085,13 @@ void arrayIntArray(stack *Stack)
// returns the complement of the integer array a in {0,2,...,n-1},
// so that b[complement(a,b.length)] yields the complement of b[a].
-#line 918 "runarray.in"
+#line 918 "./runarray.in"
// Intarray* complement(Intarray *a, Int n);
void gen_runarray32(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
Intarray * a=vm::pop<Intarray *>(Stack);
-#line 919 "runarray.in"
+#line 919 "./runarray.in"
size_t asize=checkArray(a);
array *r=new array(0);
bool *keep=new bool[n];
@@ -1108,12 +1108,12 @@ void gen_runarray32(stack *Stack)
}
// Generate the sequence {f(i) : i=0,1,...n-1} given a function f and integer n
-#line 936 "runarray.in"
+#line 936 "./runarray.in"
void arraySequence(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
callable * f=vm::pop<callable *>(Stack);
-#line 937 "runarray.in"
+#line 937 "./runarray.in"
if(n < 0) n=0;
array *a=new array(n);
for(Int i=0; i < n; ++i) {
@@ -1125,12 +1125,12 @@ void arraySequence(stack *Stack)
}
// Return the array {0,1,...n-1}
-#line 949 "runarray.in"
+#line 949 "./runarray.in"
// Intarray* sequence(Int n);
void gen_runarray34(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 950 "runarray.in"
+#line 950 "./runarray.in"
if(n < 0) n=0;
array *a=new array(n);
for(Int i=0; i < n; ++i) {
@@ -1140,12 +1140,12 @@ void gen_runarray34(stack *Stack)
}
// Apply a function to each element of an array
-#line 960 "runarray.in"
+#line 960 "./runarray.in"
void arrayFunction(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
callable * f=vm::pop<callable *>(Stack);
-#line 961 "runarray.in"
+#line 961 "./runarray.in"
size_t size=checkArray(a);
array *b=new array(size);
for(size_t i=0; i < size; ++i) {
@@ -1156,13 +1156,13 @@ void arrayFunction(stack *Stack)
{Stack->push<array*>(b); return;}
}
-#line 972 "runarray.in"
+#line 972 "./runarray.in"
void arraySort(stack *Stack)
{
bool stable=vm::pop<bool>(Stack,true);
callable * less=vm::pop<callable *>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 973 "runarray.in"
+#line 973 "./runarray.in"
array *c=copyArray(a);
compareFunc=less;
FuncStack=Stack;
@@ -1171,13 +1171,13 @@ void arraySort(stack *Stack)
{Stack->push<array*>(c); return;}
}
-#line 982 "runarray.in"
+#line 982 "./runarray.in"
void arraySearch(stack *Stack)
{
callable * less=vm::pop<callable *>(Stack);
item key=vm::pop(Stack);
array * a=vm::pop<array *>(Stack);
-#line 983 "runarray.in"
+#line 983 "./runarray.in"
size_t size=a->size();
compareFunc=less;
FuncStack=Stack;
@@ -1195,12 +1195,12 @@ void arraySearch(stack *Stack)
{Stack->push<Int>(0); return;}
}
-#line 1001 "runarray.in"
+#line 1001 "./runarray.in"
// bool all(boolarray *a);
void gen_runarray38(stack *Stack)
{
boolarray * a=vm::pop<boolarray *>(Stack);
-#line 1002 "runarray.in"
+#line 1002 "./runarray.in"
size_t size=checkArray(a);
bool c=true;
for(size_t i=0; i < size; i++)
@@ -1208,12 +1208,12 @@ void gen_runarray38(stack *Stack)
{Stack->push<bool>(c); return;}
}
-#line 1010 "runarray.in"
+#line 1010 "./runarray.in"
// boolarray* !(boolarray* a);
void gen_runarray39(stack *Stack)
{
boolarray* a=vm::pop<boolarray*>(Stack);
-#line 1011 "runarray.in"
+#line 1011 "./runarray.in"
size_t size=checkArray(a);
array *c=new array(size);
for(size_t i=0; i < size; i++)
@@ -1221,12 +1221,12 @@ void gen_runarray39(stack *Stack)
{Stack->push<boolarray*>(c); return;}
}
-#line 1019 "runarray.in"
+#line 1019 "./runarray.in"
// Int sum(boolarray *a);
void gen_runarray40(stack *Stack)
{
boolarray * a=vm::pop<boolarray *>(Stack);
-#line 1020 "runarray.in"
+#line 1020 "./runarray.in"
size_t size=checkArray(a);
Int sum=0;
for(size_t i=0; i < size; i++)
@@ -1234,11 +1234,11 @@ void gen_runarray40(stack *Stack)
{Stack->push<Int>(sum); return;}
}
-#line 1028 "runarray.in"
+#line 1028 "./runarray.in"
void arrayConcat(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 1029 "runarray.in"
+#line 1029 "./runarray.in"
// a is an array of arrays to be concatenated together.
// The signature is
// T[] concat(... T[][] a);
@@ -1265,11 +1265,11 @@ void arrayConcat(stack *Stack)
{Stack->push<array*>(result); return;}
}
-#line 1056 "runarray.in"
+#line 1056 "./runarray.in"
void array2Transpose(stack *Stack)
{
array * a=vm::pop<array *>(Stack);
-#line 1057 "runarray.in"
+#line 1057 "./runarray.in"
size_t asize=checkArray(a);
array *c=new array(0);
size_t csize=0;
@@ -1298,12 +1298,12 @@ void array2Transpose(stack *Stack)
// permutation (021 or 120, etc; original is 012).
// Transpose by sending respective members to the permutated locations:
// return the array obtained by putting a[i][j][k] into position perm{ijk}.
-#line 1086 "runarray.in"
+#line 1086 "./runarray.in"
void array3Transpose(stack *Stack)
{
array * perm=vm::pop<array *>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 1087 "runarray.in"
+#line 1087 "./runarray.in"
const size_t DIM=3;
if(checkArray(perm) != DIM) {
@@ -1387,13 +1387,13 @@ void array3Transpose(stack *Stack)
// Find the index of the nth true value in a boolean array or -1 if not found.
// If n is negative, search backwards.
-#line 1171 "runarray.in"
+#line 1171 "./runarray.in"
// Int find(boolarray *a, Int n=1);
void gen_runarray44(stack *Stack)
{
Int n=vm::pop<Int>(Stack,1);
boolarray * a=vm::pop<boolarray *>(Stack);
-#line 1172 "runarray.in"
+#line 1172 "./runarray.in"
size_t size=checkArray(a);
Int j=-1;
if(n > 0)
@@ -1410,12 +1410,12 @@ void gen_runarray44(stack *Stack)
}
// Find all indices of true values in a boolean array.
-#line 1189 "runarray.in"
+#line 1189 "./runarray.in"
// Intarray* findall(boolarray *a);
void gen_runarray45(stack *Stack)
{
boolarray * a=vm::pop<boolarray *>(Stack);
-#line 1190 "runarray.in"
+#line 1190 "./runarray.in"
size_t size=checkArray(a);
array *b=new array(0);
for(size_t i=0; i < size; i++) {
@@ -1428,13 +1428,13 @@ void gen_runarray45(stack *Stack)
// construct vector obtained by replacing those elements of b for which the
// corresponding elements of a are false by the corresponding element of c.
-#line 1203 "runarray.in"
+#line 1203 "./runarray.in"
void arrayConditional(stack *Stack)
{
array * c=vm::pop<array *>(Stack);
array * b=vm::pop<array *>(Stack);
array * a=vm::pop<array *>(Stack);
-#line 1204 "runarray.in"
+#line 1204 "./runarray.in"
size_t size=checkArray(a);
array *r=new array(size);
if(b && c) {
@@ -1458,22 +1458,22 @@ void arrayConditional(stack *Stack)
}
// Return an n x n identity matrix.
-#line 1228 "runarray.in"
+#line 1228 "./runarray.in"
// realarray2* identity(Int n);
void gen_runarray47(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 1229 "runarray.in"
+#line 1229 "./runarray.in"
{Stack->push<realarray2*>(Identity(n)); return;}
}
// Return the inverse of an n x n matrix a using Gauss-Jordan elimination.
-#line 1234 "runarray.in"
+#line 1234 "./runarray.in"
// realarray2* inverse(realarray2 *a);
void gen_runarray48(stack *Stack)
{
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1235 "runarray.in"
+#line 1235 "./runarray.in"
size_t n=checkArray(a);
double *A;
copyArray2C(A,a,true,0,NoGC);
@@ -1486,14 +1486,14 @@ void gen_runarray48(stack *Stack)
// Solve the linear equation ax=b by LU decomposition, returning the
// solution x, where a is an n x n matrix and b is an array of length n.
// If no solution exists, return an empty array.
-#line 1248 "runarray.in"
+#line 1248 "./runarray.in"
// realarray* solve(realarray2 *a, realarray *b, bool warn=true);
void gen_runarray49(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
realarray * b=vm::pop<realarray *>(Stack);
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1249 "runarray.in"
+#line 1249 "./runarray.in"
size_t n=checkArray(a);
if(n == 0) {Stack->push<realarray*>(new array(0)); return;}
@@ -1545,14 +1545,14 @@ void gen_runarray49(stack *Stack)
// Solve the linear equation ax=b by LU decomposition, returning the
// solution x, where a is an n x n matrix and b is an n x m matrix.
// If no solution exists, return an empty array.
-#line 1301 "runarray.in"
+#line 1301 "./runarray.in"
// realarray2* solve(realarray2 *a, realarray2 *b, bool warn=true);
void gen_runarray50(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
realarray2 * b=vm::pop<realarray2 *>(Stack);
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1302 "runarray.in"
+#line 1302 "./runarray.in"
size_t n=checkArray(a);
if(n == 0) {Stack->push<realarray2*>(new array(0)); return;}
@@ -1614,12 +1614,12 @@ void gen_runarray50(stack *Stack)
}
// Compute the determinant of an n x n matrix.
-#line 1364 "runarray.in"
+#line 1364 "./runarray.in"
// real determinant(realarray2 *a);
void gen_runarray51(stack *Stack)
{
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1365 "runarray.in"
+#line 1365 "./runarray.in"
real *A;
copyArray2C(A,a);
size_t n=checkArray(a);
@@ -1634,13 +1634,13 @@ void gen_runarray51(stack *Stack)
{Stack->push<real>(det); return;}
}
-#line 1380 "runarray.in"
+#line 1380 "./runarray.in"
// realarray* *(realarray2 *a, realarray *b);
void gen_runarray52(stack *Stack)
{
realarray * b=vm::pop<realarray *>(Stack);
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1381 "runarray.in"
+#line 1381 "./runarray.in"
size_t n=checkArray(a);
size_t m=checkArray(b);
array *c=new array(n);
@@ -1658,13 +1658,13 @@ void gen_runarray52(stack *Stack)
{Stack->push<realarray*>(c); return;}
}
-#line 1399 "runarray.in"
+#line 1399 "./runarray.in"
// realarray* *(realarray *a, realarray2 *b);
void gen_runarray53(stack *Stack)
{
realarray2 * b=vm::pop<realarray2 *>(Stack);
realarray * a=vm::pop<realarray *>(Stack);
-#line 1400 "runarray.in"
+#line 1400 "./runarray.in"
size_t n=checkArray(a);
if(n != checkArray(b)) error(incommensurate);
real *A;
@@ -1692,62 +1692,62 @@ void gen_runarray53(stack *Stack)
{Stack->push<realarray*>(c); return;}
}
-#line 1428 "runarray.in"
+#line 1428 "./runarray.in"
// Intarray2* *(Intarray2 *a, Intarray2 *b);
void gen_runarray54(stack *Stack)
{
Intarray2 * b=vm::pop<Intarray2 *>(Stack);
Intarray2 * a=vm::pop<Intarray2 *>(Stack);
-#line 1429 "runarray.in"
+#line 1429 "./runarray.in"
{Stack->push<Intarray2*>(mult<Int>(a,b)); return;}
}
-#line 1433 "runarray.in"
+#line 1433 "./runarray.in"
// realarray2* *(realarray2 *a, realarray2 *b);
void gen_runarray55(stack *Stack)
{
realarray2 * b=vm::pop<realarray2 *>(Stack);
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1434 "runarray.in"
+#line 1434 "./runarray.in"
{Stack->push<realarray2*>(mult<real>(a,b)); return;}
}
-#line 1438 "runarray.in"
+#line 1438 "./runarray.in"
// pairarray2* *(pairarray2 *a, pairarray2 *b);
void gen_runarray56(stack *Stack)
{
pairarray2 * b=vm::pop<pairarray2 *>(Stack);
pairarray2 * a=vm::pop<pairarray2 *>(Stack);
-#line 1439 "runarray.in"
+#line 1439 "./runarray.in"
{Stack->push<pairarray2*>(mult<pair>(a,b)); return;}
}
-#line 1443 "runarray.in"
+#line 1443 "./runarray.in"
// triple *(realarray2 *t, triple v);
void gen_runarray57(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
realarray2 * t=vm::pop<realarray2 *>(Stack);
-#line 1444 "runarray.in"
+#line 1444 "./runarray.in"
{Stack->push<triple>(*t*v); return;}
}
-#line 1448 "runarray.in"
+#line 1448 "./runarray.in"
// realarray2* AtA(realarray2 *a);
void gen_runarray58(stack *Stack)
{
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1449 "runarray.in"
+#line 1449 "./runarray.in"
{Stack->push<realarray2*>(AtA<real>(a)); return;}
}
-#line 1453 "runarray.in"
+#line 1453 "./runarray.in"
// pair project(triple v, realarray2 *t);
void gen_runarray59(stack *Stack)
{
realarray2 * t=vm::pop<realarray2 *>(Stack);
triple v=vm::pop<triple>(Stack);
-#line 1454 "runarray.in"
+#line 1454 "./runarray.in"
size_t n=checkArray(t);
if(n != 4) error(incommensurate);
array *t0=read<array*>(t,0);
@@ -1772,13 +1772,13 @@ void gen_runarray59(stack *Stack)
}
// Compute the dot product of vectors a and b.
-#line 1479 "runarray.in"
+#line 1479 "./runarray.in"
// real dot(realarray *a, realarray *b);
void gen_runarray60(stack *Stack)
{
realarray * b=vm::pop<realarray *>(Stack);
realarray * a=vm::pop<realarray *>(Stack);
-#line 1480 "runarray.in"
+#line 1480 "./runarray.in"
size_t n=checkArrays(a,b);
real sum=0.0;
for(size_t i=0; i < n; ++i)
@@ -1787,13 +1787,13 @@ void gen_runarray60(stack *Stack)
}
// Compute the complex dot product of vectors a and b.
-#line 1489 "runarray.in"
+#line 1489 "./runarray.in"
// pair dot(pairarray *a, pairarray *b);
void gen_runarray61(stack *Stack)
{
pairarray * b=vm::pop<pairarray *>(Stack);
pairarray * a=vm::pop<pairarray *>(Stack);
-#line 1490 "runarray.in"
+#line 1490 "./runarray.in"
size_t n=checkArrays(a,b);
pair sum=zero;
for(size_t i=0; i < n; ++i)
@@ -1808,7 +1808,7 @@ void gen_runarray61(stack *Stack)
// [ a[2] b[2] c[2] ]
// [ ... ]
// [ c[n-1] a[n-1] b[n-1] ]
-#line 1505 "runarray.in"
+#line 1505 "./runarray.in"
// realarray* tridiagonal(realarray *a, realarray *b, realarray *c, realarray *f);
void gen_runarray62(stack *Stack)
{
@@ -1816,7 +1816,7 @@ void gen_runarray62(stack *Stack)
realarray * c=vm::pop<realarray *>(Stack);
realarray * b=vm::pop<realarray *>(Stack);
realarray * a=vm::pop<realarray *>(Stack);
-#line 1506 "runarray.in"
+#line 1506 "./runarray.in"
size_t n=checkArrays(a,b);
checkEqual(n,checkArray(c));
checkEqual(n,checkArray(f));
@@ -1913,7 +1913,7 @@ void gen_runarray62(stack *Stack)
}
// Root solve by Newton-Raphson
-#line 1603 "runarray.in"
+#line 1603 "./runarray.in"
// real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x, bool verbose=false);
void gen_runarray63(stack *Stack)
{
@@ -1922,7 +1922,7 @@ void gen_runarray63(stack *Stack)
callableReal * fprime=vm::pop<callableReal *>(Stack);
callableReal * f=vm::pop<callableReal *>(Stack);
Int iterations=vm::pop<Int>(Stack,100);
-#line 1605 "runarray.in"
+#line 1605 "./runarray.in"
static const real fuzz=1000.0*DBL_EPSILON;
Int i=0;
size_t oldPrec=0;
@@ -1968,7 +1968,7 @@ void gen_runarray63(stack *Stack)
// Root solve by Newton-Raphson bisection
// cf. routine rtsafe (Press et al., Numerical Recipes, 1991).
-#line 1651 "runarray.in"
+#line 1651 "./runarray.in"
// real newton(Int iterations=100, callableReal *f, callableReal *fprime, real x1, real x2, bool verbose=false);
void gen_runarray64(stack *Stack)
{
@@ -1978,7 +1978,7 @@ void gen_runarray64(stack *Stack)
callableReal * fprime=vm::pop<callableReal *>(Stack);
callableReal * f=vm::pop<callableReal *>(Stack);
Int iterations=vm::pop<Int>(Stack,100);
-#line 1653 "runarray.in"
+#line 1653 "./runarray.in"
static const real fuzz=1000.0*DBL_EPSILON;
size_t oldPrec=0;
if(verbose)
@@ -2064,7 +2064,7 @@ void gen_runarray64(stack *Stack)
// In this implementation, the binary search is interleaved
// with a modified version of quadratic interpolation.
// This is a C++ port of the Asymptote routine written by Charles Staats III.
-#line 1739 "runarray.in"
+#line 1739 "./runarray.in"
// real _findroot(callableReal *f, real a, real b, real tolerance, real fa, real fb);
void gen_runarray65(stack *Stack)
{
@@ -2074,7 +2074,7 @@ void gen_runarray65(stack *Stack)
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
callableReal * f=vm::pop<callableReal *>(Stack);
-#line 1741 "runarray.in"
+#line 1741 "./runarray.in"
if(fa == 0.0) {Stack->push<real>(a); return;}
if(fb == 0.0) {Stack->push<real>(b); return;}
@@ -2166,7 +2166,7 @@ void gen_runarray65(stack *Stack)
{Stack->push<real>(a-(b-a)/(fb-fa)*fa); return;}
}
-#line 1833 "runarray.in"
+#line 1833 "./runarray.in"
// real simpson(callableReal *f, real a, real b, real acc=DBL_EPSILON, real dxmax=0);
void gen_runarray66(stack *Stack)
{
@@ -2175,7 +2175,7 @@ void gen_runarray66(stack *Stack)
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
callableReal * f=vm::pop<callableReal *>(Stack);
-#line 1835 "runarray.in"
+#line 1835 "./runarray.in"
real integral;
if(dxmax <= 0) dxmax=fabs(b-a);
callable *oldFunc=Func;
@@ -2188,13 +2188,13 @@ void gen_runarray66(stack *Stack)
}
// Compute the fast Fourier transform of a pair array
-#line 1848 "runarray.in"
+#line 1848 "./runarray.in"
// pairarray* fft(pairarray *a, Int sign=1);
void gen_runarray67(stack *Stack)
{
Int sign=vm::pop<Int>(Stack,1);
pairarray * a=vm::pop<pairarray *>(Stack);
-#line 1849 "runarray.in"
+#line 1849 "./runarray.in"
#ifdef HAVE_LIBFFTW3
unsigned n=(unsigned) checkArray(a);
array *c=new array(n);
@@ -2224,13 +2224,13 @@ void gen_runarray67(stack *Stack)
}
// Compute the fast Fourier transform of a 2D pair array
-#line 1879 "runarray.in"
+#line 1879 "./runarray.in"
// pairarray2* fft(pairarray2 *a, Int sign=1);
void gen_runarray68(stack *Stack)
{
Int sign=vm::pop<Int>(Stack,1);
pairarray2 * a=vm::pop<pairarray2 *>(Stack);
-#line 1880 "runarray.in"
+#line 1880 "./runarray.in"
#ifdef HAVE_LIBFFTW3
size_t n=checkArray(a);
size_t m=n == 0 ? 0 : checkArray(read<array*>(a,0));
@@ -2275,13 +2275,13 @@ void gen_runarray68(stack *Stack)
}
// Compute the fast Fourier transform of a 3D pair array
-#line 1925 "runarray.in"
+#line 1925 "./runarray.in"
// pairarray3* fft(pairarray3 *a, Int sign=1);
void gen_runarray69(stack *Stack)
{
Int sign=vm::pop<Int>(Stack,1);
pairarray3 * a=vm::pop<pairarray3 *>(Stack);
-#line 1926 "runarray.in"
+#line 1926 "./runarray.in"
#ifdef HAVE_LIBFFTW3
size_t n=checkArray(a);
array *a0=read<array*>(a,0);
@@ -2339,12 +2339,12 @@ void gen_runarray69(stack *Stack)
}
// Compute the real Schur decomposition of a 2D pair array
-#line 1984 "runarray.in"
+#line 1984 "./runarray.in"
// realarray3* _schur(realarray2 *a);
void gen_runarray70(stack *Stack)
{
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 1985 "runarray.in"
+#line 1985 "./runarray.in"
#ifdef HAVE_EIGEN_DENSE
size_t n=checkArray(a);
@@ -2391,12 +2391,12 @@ void gen_runarray70(stack *Stack)
}
// Compute the Schur decomposition of a 2D pair array
-#line 2032 "runarray.in"
+#line 2032 "./runarray.in"
// pairarray3* _schur(pairarray2 *a);
void gen_runarray71(stack *Stack)
{
pairarray2 * a=vm::pop<pairarray2 *>(Stack);
-#line 2033 "runarray.in"
+#line 2033 "./runarray.in"
#ifdef HAVE_EIGEN_DENSE
size_t n=checkArray(a);
@@ -2446,12 +2446,12 @@ void gen_runarray71(stack *Stack)
{Stack->push<pairarray3*>(S); return;}
}
-#line 2083 "runarray.in"
+#line 2083 "./runarray.in"
// Intarray2* triangulate(pairarray *z);
void gen_runarray72(stack *Stack)
{
pairarray * z=vm::pop<pairarray *>(Stack);
-#line 2084 "runarray.in"
+#line 2084 "./runarray.in"
size_t nv=checkArray(z);
// Call robust version of Gilles Dumoulin's port of Paul Bourke's
// triangulation code.
@@ -2485,12 +2485,12 @@ void gen_runarray72(stack *Stack)
{Stack->push<Intarray2*>(t); return;}
}
-#line 2118 "runarray.in"
+#line 2118 "./runarray.in"
// real norm(realarray *a);
void gen_runarray73(stack *Stack)
{
realarray * a=vm::pop<realarray *>(Stack);
-#line 2119 "runarray.in"
+#line 2119 "./runarray.in"
size_t n=checkArray(a);
real M=0.0;
for(size_t i=0; i < n; ++i) {
@@ -2500,12 +2500,12 @@ void gen_runarray73(stack *Stack)
{Stack->push<real>(M); return;}
}
-#line 2129 "runarray.in"
+#line 2129 "./runarray.in"
// real norm(realarray2 *a);
void gen_runarray74(stack *Stack)
{
realarray2 * a=vm::pop<realarray2 *>(Stack);
-#line 2130 "runarray.in"
+#line 2130 "./runarray.in"
size_t n=checkArray(a);
real M=0.0;
for(size_t i=0; i < n; ++i) {
@@ -2519,12 +2519,12 @@ void gen_runarray74(stack *Stack)
{Stack->push<real>(M); return;}
}
-#line 2144 "runarray.in"
+#line 2144 "./runarray.in"
// real norm(triplearray2 *a);
void gen_runarray75(stack *Stack)
{
triplearray2 * a=vm::pop<triplearray2 *>(Stack);
-#line 2145 "runarray.in"
+#line 2145 "./runarray.in"
size_t n=checkArray(a);
real M=0.0;
for(size_t i=0; i < n; ++i) {
@@ -2538,12 +2538,12 @@ void gen_runarray75(stack *Stack)
{Stack->push<real>(sqrt(M)); return;}
}
-#line 2159 "runarray.in"
+#line 2159 "./runarray.in"
// real change2(triplearray2 *a);
void gen_runarray76(stack *Stack)
{
triplearray2 * a=vm::pop<triplearray2 *>(Stack);
-#line 2160 "runarray.in"
+#line 2160 "./runarray.in"
size_t n=checkArray(a);
if(n == 0) {Stack->push<real>(0.0); return;}
@@ -2564,13 +2564,13 @@ void gen_runarray76(stack *Stack)
{Stack->push<real>(M); return;}
}
-#line 2181 "runarray.in"
+#line 2181 "./runarray.in"
// triple minbezier(triplearray2 *P, triple b);
void gen_runarray77(stack *Stack)
{
triple b=vm::pop<triple>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
-#line 2182 "runarray.in"
+#line 2182 "./runarray.in"
size_t N;
real *A=copyTripleArray2Components(P,N);
bound_double *B=bounddouble(N);
@@ -2581,13 +2581,13 @@ void gen_runarray77(stack *Stack)
{Stack->push<triple>(b); return;}
}
-#line 2193 "runarray.in"
+#line 2193 "./runarray.in"
// triple maxbezier(triplearray2 *P, triple b);
void gen_runarray78(stack *Stack)
{
triple b=vm::pop<triple>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
-#line 2194 "runarray.in"
+#line 2194 "./runarray.in"
size_t N;
real *A=copyTripleArray2Components(P,N);
bound_double *B=bounddouble(N);
@@ -2598,13 +2598,13 @@ void gen_runarray78(stack *Stack)
{Stack->push<triple>(b); return;}
}
-#line 2205 "runarray.in"
+#line 2205 "./runarray.in"
// pair minratio(triplearray2 *P, pair b);
void gen_runarray79(stack *Stack)
{
pair b=vm::pop<pair>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
-#line 2206 "runarray.in"
+#line 2206 "./runarray.in"
size_t N;
triple *A=copyTripleArray2C(P,N);
real fuzz=Fuzz*norm(A,N);
@@ -2615,13 +2615,13 @@ void gen_runarray79(stack *Stack)
{Stack->push<pair>(b); return;}
}
-#line 2217 "runarray.in"
+#line 2217 "./runarray.in"
// pair maxratio(triplearray2 *P, pair b);
void gen_runarray80(stack *Stack)
{
pair b=vm::pop<pair>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
-#line 2218 "runarray.in"
+#line 2218 "./runarray.in"
size_t N;
triple *A=copyTripleArray2C(P,N);
bound_triple *B=boundtriple(N);
@@ -2632,11 +2632,11 @@ void gen_runarray80(stack *Stack)
{Stack->push<pair>(b); return;}
}
-#line 2229 "runarray.in"
+#line 2229 "./runarray.in"
// realarray* _projection();
void gen_runarray81(stack *Stack)
{
-#line 2230 "runarray.in"
+#line 2230 "./runarray.in"
#ifdef HAVE_GL
array *a=new array(14);
gl::projection P=gl::camera();
@@ -2673,169 +2673,169 @@ namespace trans {
void gen_runarray_venv(venv &ve)
{
-#line 609 "runarray.in"
+#line 609 "./runarray.in"
REGISTER_BLTIN(run::emptyArray,"emptyArray");
-#line 615 "runarray.in"
+#line 615 "./runarray.in"
REGISTER_BLTIN(run::newDeepArray,"newDeepArray");
-#line 637 "runarray.in"
+#line 637 "./runarray.in"
REGISTER_BLTIN(run::newInitializedArray,"newInitializedArray");
-#line 652 "runarray.in"
+#line 652 "./runarray.in"
REGISTER_BLTIN(run::newAppendedArray,"newAppendedArray");
-#line 668 "runarray.in"
+#line 668 "./runarray.in"
REGISTER_BLTIN(run::copyArrayValue,"copyArrayValue");
-#line 680 "runarray.in"
+#line 680 "./runarray.in"
REGISTER_BLTIN(run::copyArray,"copyArray");
-#line 692 "runarray.in"
+#line 692 "./runarray.in"
REGISTER_BLTIN(run::arrayRead,"arrayRead");
-#line 704 "runarray.in"
+#line 704 "./runarray.in"
REGISTER_BLTIN(run::arraySliceRead,"arraySliceRead");
-#line 711 "runarray.in"
+#line 711 "./runarray.in"
REGISTER_BLTIN(run::arraySliceReadToEnd,"arraySliceReadToEnd");
-#line 719 "runarray.in"
+#line 719 "./runarray.in"
REGISTER_BLTIN(run::arrayArrayRead,"arrayArrayRead");
-#line 728 "runarray.in"
+#line 728 "./runarray.in"
REGISTER_BLTIN(run::arrayWrite,"arrayWrite");
-#line 745 "runarray.in"
+#line 745 "./runarray.in"
REGISTER_BLTIN(run::arraySliceWrite,"arraySliceWrite");
-#line 753 "runarray.in"
+#line 753 "./runarray.in"
REGISTER_BLTIN(run::arraySliceWriteToEnd,"arraySliceWriteToEnd");
-#line 761 "runarray.in"
+#line 761 "./runarray.in"
REGISTER_BLTIN(run::arrayLength,"arrayLength");
-#line 767 "runarray.in"
+#line 767 "./runarray.in"
REGISTER_BLTIN(run::arrayKeys,"arrayKeys");
-#line 782 "runarray.in"
+#line 782 "./runarray.in"
REGISTER_BLTIN(run::arrayCyclicFlag,"arrayCyclicFlag");
-#line 789 "runarray.in"
+#line 789 "./runarray.in"
REGISTER_BLTIN(run::arraySetCyclicFlag,"arraySetCyclicFlag");
-#line 796 "runarray.in"
+#line 796 "./runarray.in"
REGISTER_BLTIN(run::arrayInitializedHelper,"arrayInitializedHelper");
-#line 807 "runarray.in"
+#line 807 "./runarray.in"
REGISTER_BLTIN(run::arrayInitialized,"arrayInitialized");
-#line 813 "runarray.in"
+#line 813 "./runarray.in"
REGISTER_BLTIN(run::arrayCyclicHelper,"arrayCyclicHelper");
-#line 820 "runarray.in"
+#line 820 "./runarray.in"
REGISTER_BLTIN(run::arrayCyclic,"arrayCyclic");
-#line 826 "runarray.in"
+#line 826 "./runarray.in"
REGISTER_BLTIN(run::arrayPushHelper,"arrayPushHelper");
-#line 834 "runarray.in"
+#line 834 "./runarray.in"
REGISTER_BLTIN(run::arrayPush,"arrayPush");
-#line 840 "runarray.in"
+#line 840 "./runarray.in"
REGISTER_BLTIN(run::arrayAppendHelper,"arrayAppendHelper");
-#line 849 "runarray.in"
+#line 849 "./runarray.in"
REGISTER_BLTIN(run::arrayAppend,"arrayAppend");
-#line 855 "runarray.in"
+#line 855 "./runarray.in"
REGISTER_BLTIN(run::arrayPopHelper,"arrayPopHelper");
-#line 864 "runarray.in"
+#line 864 "./runarray.in"
REGISTER_BLTIN(run::arrayPop,"arrayPop");
-#line 870 "runarray.in"
+#line 870 "./runarray.in"
REGISTER_BLTIN(run::arrayInsertHelper,"arrayInsertHelper");
-#line 881 "runarray.in"
+#line 881 "./runarray.in"
REGISTER_BLTIN(run::arrayInsert,"arrayInsert");
-#line 887 "runarray.in"
+#line 887 "./runarray.in"
REGISTER_BLTIN(run::arrayDelete,"arrayDelete");
-#line 893 "runarray.in"
+#line 893 "./runarray.in"
REGISTER_BLTIN(run::arrayAlias,"arrayAlias");
-#line 898 "runarray.in"
+#line 898 "./runarray.in"
REGISTER_BLTIN(run::arrayIntArray,"arrayIntArray");
-#line 916 "runarray.in"
+#line 916 "./runarray.in"
addFunc(ve, run::gen_runarray32, IntArray(), SYM(complement), formal(IntArray(), SYM(a), false, false), formal(primInt(), SYM(n), false, false));
-#line 935 "runarray.in"
+#line 935 "./runarray.in"
REGISTER_BLTIN(run::arraySequence,"arraySequence");
-#line 948 "runarray.in"
+#line 948 "./runarray.in"
addFunc(ve, run::gen_runarray34, IntArray(), SYM(sequence), formal(primInt(), SYM(n), false, false));
-#line 959 "runarray.in"
+#line 959 "./runarray.in"
REGISTER_BLTIN(run::arrayFunction,"arrayFunction");
-#line 972 "runarray.in"
+#line 972 "./runarray.in"
REGISTER_BLTIN(run::arraySort,"arraySort");
-#line 982 "runarray.in"
+#line 982 "./runarray.in"
REGISTER_BLTIN(run::arraySearch,"arraySearch");
-#line 1001 "runarray.in"
+#line 1001 "./runarray.in"
addFunc(ve, run::gen_runarray38, primBoolean(), SYM(all), formal(booleanArray(), SYM(a), false, false));
-#line 1010 "runarray.in"
+#line 1010 "./runarray.in"
addFunc(ve, run::gen_runarray39, booleanArray(), SYM_LOGNOT, formal(booleanArray(), SYM(a), false, false));
-#line 1019 "runarray.in"
+#line 1019 "./runarray.in"
addFunc(ve, run::gen_runarray40, primInt(), SYM(sum), formal(booleanArray(), SYM(a), false, false));
-#line 1028 "runarray.in"
+#line 1028 "./runarray.in"
REGISTER_BLTIN(run::arrayConcat,"arrayConcat");
-#line 1056 "runarray.in"
+#line 1056 "./runarray.in"
REGISTER_BLTIN(run::array2Transpose,"array2Transpose");
-#line 1082 "runarray.in"
+#line 1082 "./runarray.in"
REGISTER_BLTIN(run::array3Transpose,"array3Transpose");
-#line 1169 "runarray.in"
+#line 1169 "./runarray.in"
addFunc(ve, run::gen_runarray44, primInt(), SYM(find), formal(booleanArray(), SYM(a), false, false), formal(primInt(), SYM(n), true, false));
-#line 1188 "runarray.in"
+#line 1188 "./runarray.in"
addFunc(ve, run::gen_runarray45, IntArray(), SYM(findall), formal(booleanArray(), SYM(a), false, false));
-#line 1201 "runarray.in"
+#line 1201 "./runarray.in"
REGISTER_BLTIN(run::arrayConditional,"arrayConditional");
-#line 1227 "runarray.in"
+#line 1227 "./runarray.in"
addFunc(ve, run::gen_runarray47, realArray2(), SYM(identity), formal(primInt(), SYM(n), false, false));
-#line 1233 "runarray.in"
+#line 1233 "./runarray.in"
addFunc(ve, run::gen_runarray48, realArray2(), SYM(inverse), formal(realArray2(), SYM(a), false, false));
-#line 1245 "runarray.in"
+#line 1245 "./runarray.in"
addFunc(ve, run::gen_runarray49, realArray(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 1298 "runarray.in"
+#line 1298 "./runarray.in"
addFunc(ve, run::gen_runarray50, realArray2(), SYM(solve), formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 1363 "runarray.in"
+#line 1363 "./runarray.in"
addFunc(ve, run::gen_runarray51, primReal(), SYM(determinant), formal(realArray2(), SYM(a), false, false));
-#line 1380 "runarray.in"
+#line 1380 "./runarray.in"
addFunc(ve, run::gen_runarray52, realArray(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray(), SYM(b), false, false));
-#line 1399 "runarray.in"
+#line 1399 "./runarray.in"
addFunc(ve, run::gen_runarray53, realArray(), SYM_TIMES, formal(realArray(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false));
-#line 1428 "runarray.in"
+#line 1428 "./runarray.in"
addFunc(ve, run::gen_runarray54, IntArray2(), SYM_TIMES, formal(IntArray2(), SYM(a), false, false), formal(IntArray2(), SYM(b), false, false));
-#line 1433 "runarray.in"
+#line 1433 "./runarray.in"
addFunc(ve, run::gen_runarray55, realArray2(), SYM_TIMES, formal(realArray2(), SYM(a), false, false), formal(realArray2(), SYM(b), false, false));
-#line 1438 "runarray.in"
+#line 1438 "./runarray.in"
addFunc(ve, run::gen_runarray56, pairArray2(), SYM_TIMES, formal(pairArray2(), SYM(a), false, false), formal(pairArray2(), SYM(b), false, false));
-#line 1443 "runarray.in"
+#line 1443 "./runarray.in"
addFunc(ve, run::gen_runarray57, primTriple(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primTriple(), SYM(v), false, false));
-#line 1448 "runarray.in"
+#line 1448 "./runarray.in"
addFunc(ve, run::gen_runarray58, realArray2(), SYM(AtA), formal(realArray2(), SYM(a), false, false));
-#line 1453 "runarray.in"
+#line 1453 "./runarray.in"
addFunc(ve, run::gen_runarray59, primPair(), SYM(project), formal(primTriple(), SYM(v), false, false), formal(realArray2(), SYM(t), false, false));
-#line 1478 "runarray.in"
+#line 1478 "./runarray.in"
addFunc(ve, run::gen_runarray60, primReal(), SYM(dot), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false));
-#line 1488 "runarray.in"
+#line 1488 "./runarray.in"
addFunc(ve, run::gen_runarray61, primPair(), SYM(dot), formal(pairArray(), SYM(a), false, false), formal(pairArray(), SYM(b), false, false));
-#line 1498 "runarray.in"
+#line 1498 "./runarray.in"
addFunc(ve, run::gen_runarray62, realArray(), SYM(tridiagonal), formal(realArray(), SYM(a), false, false), formal(realArray(), SYM(b), false, false), formal(realArray(), SYM(c), false, false), formal(realArray(), SYM(f), false, false));
-#line 1602 "runarray.in"
+#line 1602 "./runarray.in"
addFunc(ve, run::gen_runarray63, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x), false, false), formal(primBoolean(), SYM(verbose), true, false));
-#line 1649 "runarray.in"
+#line 1649 "./runarray.in"
addFunc(ve, run::gen_runarray64, primReal(), SYM(newton), formal(primInt(), SYM(iterations), true, false), formal(realRealFunction(), SYM(f), false, false), formal(realRealFunction(), SYM(fprime), false, false), formal(primReal(), SYM(x1), false, false), formal(primReal(), SYM(x2), false, false), formal(primBoolean(), SYM(verbose), true, false));
-#line 1731 "runarray.in"
+#line 1731 "./runarray.in"
addFunc(ve, run::gen_runarray65, primReal(), SYM(_findroot), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(tolerance), false, false), formal(primReal(), SYM(fa), false, false), formal(primReal(), SYM(fb), false, false));
-#line 1833 "runarray.in"
+#line 1833 "./runarray.in"
addFunc(ve, run::gen_runarray66, primReal(), SYM(simpson), formal(realRealFunction(), SYM(f), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(acc), true, false), formal(primReal(), SYM(dxmax), true, false));
-#line 1847 "runarray.in"
+#line 1847 "./runarray.in"
addFunc(ve, run::gen_runarray67, pairArray(), SYM(fft), formal(pairArray(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false));
-#line 1878 "runarray.in"
+#line 1878 "./runarray.in"
addFunc(ve, run::gen_runarray68, pairArray2(), SYM(fft), formal(pairArray2(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false));
-#line 1924 "runarray.in"
+#line 1924 "./runarray.in"
addFunc(ve, run::gen_runarray69, pairArray3(), SYM(fft), formal(pairArray3(), SYM(a), false, false), formal(primInt(), SYM(sign), true, false));
-#line 1983 "runarray.in"
+#line 1983 "./runarray.in"
addFunc(ve, run::gen_runarray70, realArray3(), SYM(_schur), formal(realArray2(), SYM(a), false, false));
-#line 2031 "runarray.in"
+#line 2031 "./runarray.in"
addFunc(ve, run::gen_runarray71, pairArray3(), SYM(_schur), formal(pairArray2(), SYM(a), false, false));
-#line 2083 "runarray.in"
+#line 2083 "./runarray.in"
addFunc(ve, run::gen_runarray72, IntArray2(), SYM(triangulate), formal(pairArray(), SYM(z), false, false));
-#line 2118 "runarray.in"
+#line 2118 "./runarray.in"
addFunc(ve, run::gen_runarray73, primReal(), SYM(norm), formal(realArray(), SYM(a), false, false));
-#line 2129 "runarray.in"
+#line 2129 "./runarray.in"
addFunc(ve, run::gen_runarray74, primReal(), SYM(norm), formal(realArray2(), SYM(a), false, false));
-#line 2144 "runarray.in"
+#line 2144 "./runarray.in"
addFunc(ve, run::gen_runarray75, primReal(), SYM(norm), formal(tripleArray2(), SYM(a), false, false));
-#line 2159 "runarray.in"
+#line 2159 "./runarray.in"
addFunc(ve, run::gen_runarray76, primReal(), SYM(change2), formal(tripleArray2(), SYM(a), false, false));
-#line 2181 "runarray.in"
+#line 2181 "./runarray.in"
addFunc(ve, run::gen_runarray77, primTriple(), SYM(minbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false));
-#line 2193 "runarray.in"
+#line 2193 "./runarray.in"
addFunc(ve, run::gen_runarray78, primTriple(), SYM(maxbezier), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(b), false, false));
-#line 2205 "runarray.in"
+#line 2205 "./runarray.in"
addFunc(ve, run::gen_runarray79, primPair(), SYM(minratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false));
-#line 2217 "runarray.in"
+#line 2217 "./runarray.in"
addFunc(ve, run::gen_runarray80, primPair(), SYM(maxratio), formal(tripleArray2(), SYM(p), false, false), formal(primPair(), SYM(b), false, false));
-#line 2229 "runarray.in"
+#line 2229 "./runarray.in"
addFunc(ve, run::gen_runarray81, realArray(), SYM(_projection));
}
diff --git a/graphics/asymptote/runarray.h b/graphics/asymptote/runarray.h
index 0a1baf7267..e2112b530b 100644
--- a/graphics/asymptote/runarray.h
+++ b/graphics/asymptote/runarray.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runarray.in; changes will be overwritten *****/
-#ifndef runarray_H
-#define runarray_H
+#pragma once
namespace run {
void emptyArray(vm::stack *);
void newDeepArray(vm::stack *);
@@ -45,4 +44,3 @@ void array3Transpose(vm::stack *);
void arrayConditional(vm::stack *);
}
-#endif // runarray_H
diff --git a/graphics/asymptote/runbacktrace.cc b/graphics/asymptote/runbacktrace.cc
index 14ad27acc8..6b034babf9 100644
--- a/graphics/asymptote/runbacktrace.cc
+++ b/graphics/asymptote/runbacktrace.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runbacktrace.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runbacktrace.in"
+#line 1 "./runbacktrace.in"
/*****
* backtrace.in
* Andy Hammerlindl 2009/07/28
@@ -19,7 +19,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -74,11 +74,11 @@ function *realRealFunction();
#endif
namespace run {
-#line 16 "runbacktrace.in"
+#line 16 "./runbacktrace.in"
// void generate_random_backtrace();
void gen_runbacktrace0(stack *)
{
-#line 17 "runbacktrace.in"
+#line 17 "./runbacktrace.in"
#if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE)
GC_generate_random_backtrace();
#else
@@ -86,12 +86,12 @@ void gen_runbacktrace0(stack *)
#endif
}
-#line 25 "runbacktrace.in"
+#line 25 "./runbacktrace.in"
// void print_random_addresses(Int n=1);
void gen_runbacktrace1(stack *Stack)
{
Int n=vm::pop<Int>(Stack,1);
-#line 26 "runbacktrace.in"
+#line 26 "./runbacktrace.in"
#if defined(USEGC) && defined(GC_DEBUG) && defined(GC_BACKTRACE)
GC_gcollect();
for (Int i=0; i < n; ++i)
@@ -108,9 +108,9 @@ namespace trans {
void gen_runbacktrace_venv(venv &ve)
{
-#line 16 "runbacktrace.in"
+#line 16 "./runbacktrace.in"
addFunc(ve, run::gen_runbacktrace0, primVoid(), SYM(generate_random_backtrace));
-#line 25 "runbacktrace.in"
+#line 25 "./runbacktrace.in"
addFunc(ve, run::gen_runbacktrace1, primVoid(), SYM(print_random_addresses), formal(primInt(), SYM(n), true, false));
}
diff --git a/graphics/asymptote/runbacktrace.h b/graphics/asymptote/runbacktrace.h
index 9ddef1a996..14671e4b55 100644
--- a/graphics/asymptote/runbacktrace.h
+++ b/graphics/asymptote/runbacktrace.h
@@ -1,8 +1,6 @@
/***** Autogenerated from runbacktrace.in; changes will be overwritten *****/
-#ifndef runbacktrace_H
-#define runbacktrace_H
+#pragma once
namespace run {
}
-#endif // runbacktrace_H
diff --git a/graphics/asymptote/runfile.cc b/graphics/asymptote/runfile.cc
index 7ab1f0aad5..d85b4d7748 100644
--- a/graphics/asymptote/runfile.cc
+++ b/graphics/asymptote/runfile.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runfile.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runfile.in"
+#line 1 "./runfile.in"
/*****
* runfile.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -67,8 +67,10 @@ function *realRealFunction();
#include "triple.h"
#include "array.h"
-#ifdef __CYGWIN__
- extern "C" int mkstemp(char *c);
+#if defined(_WIN32)
+#include <io.h>
+#else
+#include <unistd.h>
#endif
using namespace camp;
@@ -86,34 +88,34 @@ string commentchar="#";
#endif
namespace run {
-#line 28 "runfile.in"
+#line 30 "./runfile.in"
// bool ==(file *a, file *b);
void gen_runfile0(stack *Stack)
{
file * b=vm::pop<file *>(Stack);
file * a=vm::pop<file *>(Stack);
-#line 29 "runfile.in"
+#line 31 "./runfile.in"
{Stack->push<bool>(a == b); return;}
}
-#line 33 "runfile.in"
+#line 35 "./runfile.in"
// bool !=(file *a, file *b);
void gen_runfile1(stack *Stack)
{
file * b=vm::pop<file *>(Stack);
file * a=vm::pop<file *>(Stack);
-#line 34 "runfile.in"
+#line 36 "./runfile.in"
{Stack->push<bool>(a != b); return;}
}
-#line 38 "runfile.in"
+#line 40 "./runfile.in"
void nullFile(stack *Stack)
{
-#line 39 "runfile.in"
+#line 41 "./runfile.in"
{Stack->push<file*>(&camp::nullfile); return;}
}
-#line 43 "runfile.in"
+#line 45 "./runfile.in"
// file* input(string name=emptystring, bool check=true, string comment=commentchar, string mode=emptystring);
void gen_runfile3(stack *Stack)
{
@@ -121,7 +123,7 @@ void gen_runfile3(stack *Stack)
string comment=vm::pop<string>(Stack,commentchar);
bool check=vm::pop<bool>(Stack,true);
string name=vm::pop<string>(Stack,emptystring);
-#line 45 "runfile.in"
+#line 47 "./runfile.in"
file *f=NULL;
if(mode == "binary")
f=new ibfile(name,check);
@@ -150,7 +152,7 @@ void gen_runfile3(stack *Stack)
{Stack->push<file*>(f); return;}
}
-#line 74 "runfile.in"
+#line 76 "./runfile.in"
// file* output(string name=emptystring, bool update=false, string comment=commentchar, string mode=emptystring);
void gen_runfile4(stack *Stack)
{
@@ -158,7 +160,7 @@ void gen_runfile4(stack *Stack)
string comment=vm::pop<string>(Stack,commentchar);
bool update=vm::pop<bool>(Stack,false);
string name=vm::pop<string>(Stack,emptystring);
-#line 76 "runfile.in"
+#line 78 "./runfile.in"
file *f=NULL;
if(mode == "pipe") {
f=new opipe(name);
@@ -193,152 +195,152 @@ void gen_runfile4(stack *Stack)
{Stack->push<file*>(f); return;}
}
-#line 111 "runfile.in"
+#line 113 "./runfile.in"
// bool eof(file *f);
void gen_runfile5(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 112 "runfile.in"
+#line 114 "./runfile.in"
{Stack->push<bool>(f->eof()); return;}
}
-#line 116 "runfile.in"
+#line 118 "./runfile.in"
// bool eol(file *f);
void gen_runfile6(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 117 "runfile.in"
+#line 119 "./runfile.in"
{Stack->push<bool>(f->eol()); return;}
}
-#line 121 "runfile.in"
+#line 123 "./runfile.in"
// bool error(file *f);
void gen_runfile7(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 122 "runfile.in"
+#line 124 "./runfile.in"
{Stack->push<bool>(f->error()); return;}
}
-#line 126 "runfile.in"
+#line 128 "./runfile.in"
// void clear(file *f);
void gen_runfile8(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 127 "runfile.in"
+#line 129 "./runfile.in"
f->clear();
}
-#line 131 "runfile.in"
+#line 133 "./runfile.in"
// void close(file *f);
void gen_runfile9(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 132 "runfile.in"
+#line 134 "./runfile.in"
f->close();
}
-#line 136 "runfile.in"
+#line 138 "./runfile.in"
// Int precision(file *f=NULL, Int digits=0);
void gen_runfile10(stack *Stack)
{
Int digits=vm::pop<Int>(Stack,0);
file * f=vm::pop<file *>(Stack,NULL);
-#line 137 "runfile.in"
+#line 139 "./runfile.in"
if(f == 0) f=&camp::Stdout;
{Stack->push<Int>(f->precision(digits)); return;}
}
-#line 142 "runfile.in"
+#line 144 "./runfile.in"
// void flush(file *f);
void gen_runfile11(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 143 "runfile.in"
+#line 145 "./runfile.in"
f->flush();
}
-#line 147 "runfile.in"
+#line 149 "./runfile.in"
// string getc(file *f);
void gen_runfile12(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 148 "runfile.in"
+#line 150 "./runfile.in"
char c=0;
if(f->isOpen()) f->read(c);
{Stack->push<string>(string(1,c)); return;}
}
-#line 154 "runfile.in"
+#line 156 "./runfile.in"
// Int tell(file *f);
void gen_runfile13(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 155 "runfile.in"
+#line 157 "./runfile.in"
{Stack->push<Int>(f->tell()); return;}
}
-#line 159 "runfile.in"
+#line 161 "./runfile.in"
// void seek(file *f, Int pos);
void gen_runfile14(stack *Stack)
{
Int pos=vm::pop<Int>(Stack);
file * f=vm::pop<file *>(Stack);
-#line 160 "runfile.in"
+#line 162 "./runfile.in"
f->seek(pos,pos >= 0);
}
-#line 164 "runfile.in"
+#line 166 "./runfile.in"
// void seekeof(file *f);
void gen_runfile15(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 165 "runfile.in"
+#line 167 "./runfile.in"
f->seek(0,false);
}
-#line 169 "runfile.in"
+#line 171 "./runfile.in"
void namePart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 170 "runfile.in"
+#line 172 "./runfile.in"
{Stack->push<string>(f.filename()); return;}
}
-#line 174 "runfile.in"
+#line 176 "./runfile.in"
void modePart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 175 "runfile.in"
+#line 177 "./runfile.in"
{Stack->push<string>(f.FileMode()); return;}
}
// Set file dimensions
-#line 180 "runfile.in"
+#line 182 "./runfile.in"
void dimensionSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
Int nz=vm::pop<Int>(Stack,-1);
Int ny=vm::pop<Int>(Stack,-1);
Int nx=vm::pop<Int>(Stack,-1);
-#line 181 "runfile.in"
+#line 183 "./runfile.in"
f->dimension(nx,ny,nz);
{Stack->push<file*>(f); return;}
}
-#line 186 "runfile.in"
+#line 188 "./runfile.in"
void dimensionSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 187 "runfile.in"
+#line 189 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(dimensionSetHelper),f)); return;}
}
-#line 191 "runfile.in"
+#line 193 "./runfile.in"
void dimensionPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 192 "runfile.in"
+#line 194 "./runfile.in"
array *a=new array(3);
(*a)[0]=f.Nx();
(*a)[1]=f.Ny();
@@ -347,174 +349,174 @@ void dimensionPart(stack *Stack)
}
// Set file f to read arrays in line-at-a-time mode
-#line 201 "runfile.in"
+#line 203 "./runfile.in"
void lineSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 202 "runfile.in"
+#line 204 "./runfile.in"
f->LineMode(b);
{Stack->push<file*>(f); return;}
}
-#line 207 "runfile.in"
+#line 209 "./runfile.in"
void lineSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 208 "runfile.in"
+#line 210 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(lineSetHelper),f)); return;}
}
-#line 212 "runfile.in"
+#line 214 "./runfile.in"
void linePart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 213 "runfile.in"
+#line 215 "./runfile.in"
{Stack->push<bool>(f.LineMode()); return;}
}
// Set file to read comma-separated values
-#line 218 "runfile.in"
+#line 220 "./runfile.in"
void csvSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 219 "runfile.in"
+#line 221 "./runfile.in"
f->CSVMode(b);
{Stack->push<file*>(f); return;}
}
-#line 224 "runfile.in"
+#line 226 "./runfile.in"
void csvSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 225 "runfile.in"
+#line 227 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(csvSetHelper),f)); return;}
}
-#line 229 "runfile.in"
+#line 231 "./runfile.in"
void csvPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 230 "runfile.in"
+#line 232 "./runfile.in"
{Stack->push<bool>(f.CSVMode()); return;}
}
// Set file to read whitespace-separated values
-#line 235 "runfile.in"
+#line 237 "./runfile.in"
void wordSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 236 "runfile.in"
+#line 238 "./runfile.in"
f->WordMode(b);
{Stack->push<file*>(f); return;}
}
-#line 241 "runfile.in"
+#line 243 "./runfile.in"
void wordSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 242 "runfile.in"
+#line 244 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(wordSetHelper),f)); return;}
}
-#line 246 "runfile.in"
+#line 248 "./runfile.in"
void wordPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 247 "runfile.in"
+#line 249 "./runfile.in"
{Stack->push<bool>(f.WordMode()); return;}
}
// Set file to read/write single precision real XDR values.
-#line 252 "runfile.in"
+#line 254 "./runfile.in"
void singlerealSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 253 "runfile.in"
+#line 255 "./runfile.in"
f->SingleReal(b);
{Stack->push<file*>(f); return;}
}
-#line 258 "runfile.in"
+#line 260 "./runfile.in"
void singlerealSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 259 "runfile.in"
+#line 261 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(singlerealSetHelper),f)); return;}
}
-#line 263 "runfile.in"
+#line 265 "./runfile.in"
void singlerealPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 264 "runfile.in"
+#line 266 "./runfile.in"
{Stack->push<bool>(f.SingleReal()); return;}
}
// Set file to read/write single precision int XDR values.
-#line 269 "runfile.in"
+#line 271 "./runfile.in"
void singleintSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 270 "runfile.in"
+#line 272 "./runfile.in"
f->SingleInt(b);
{Stack->push<file*>(f); return;}
}
-#line 275 "runfile.in"
+#line 277 "./runfile.in"
void singleintSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 276 "runfile.in"
+#line 278 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(singleintSetHelper),f)); return;}
}
-#line 280 "runfile.in"
+#line 282 "./runfile.in"
void singleintPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 281 "runfile.in"
+#line 283 "./runfile.in"
{Stack->push<bool>(f.SingleInt()); return;}
}
// Set file to read/write signed int XDR values.
-#line 286 "runfile.in"
+#line 288 "./runfile.in"
void signedintSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
bool b=vm::pop<bool>(Stack,true);
-#line 287 "runfile.in"
+#line 289 "./runfile.in"
f->SignedInt(b);
{Stack->push<file*>(f); return;}
}
-#line 292 "runfile.in"
+#line 294 "./runfile.in"
void signedintSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 293 "runfile.in"
+#line 295 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(signedintSetHelper),f)); return;}
}
-#line 297 "runfile.in"
+#line 299 "./runfile.in"
void signedintPart(stack *Stack)
{
file f=vm::pop<file>(Stack);
-#line 298 "runfile.in"
+#line 300 "./runfile.in"
{Stack->push<bool>(f.SignedInt()); return;}
}
// Set file to read an arrayi (i int sizes followed by an i-dimensional array)
-#line 303 "runfile.in"
+#line 305 "./runfile.in"
void readSetHelper(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
Int i=vm::pop<Int>(Stack);
-#line 304 "runfile.in"
+#line 306 "./runfile.in"
switch(i) {
case 1:
f->dimension(-2);
@@ -535,21 +537,21 @@ void readSetHelper(stack *Stack)
{Stack->push<file*>(f); return;}
}
-#line 325 "runfile.in"
+#line 327 "./runfile.in"
void readSet(stack *Stack)
{
file * f=vm::pop<file *>(Stack);
-#line 326 "runfile.in"
+#line 328 "./runfile.in"
{Stack->push<callable*>(new thunk(new bfunc(readSetHelper),f)); return;}
}
// Delete file named s.
-#line 331 "runfile.in"
+#line 333 "./runfile.in"
// Int delete(string s);
void gen_runfile41(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 332 "runfile.in"
+#line 334 "./runfile.in"
s=outpath(s);
Int rc=unlink(s.c_str());
if(rc == 0 && verbose > 0)
@@ -558,13 +560,13 @@ void gen_runfile41(stack *Stack)
}
// Rename file "from" to file "to".
-#line 341 "runfile.in"
+#line 343 "./runfile.in"
// Int rename(string from, string to);
void gen_runfile42(stack *Stack)
{
string to=vm::pop<string>(Stack);
string from=vm::pop<string>(Stack);
-#line 342 "runfile.in"
+#line 344 "./runfile.in"
from=outpath(from);
to=outpath(to);
Int rc=rename(from.c_str(),to.c_str());
@@ -574,21 +576,53 @@ void gen_runfile42(stack *Stack)
}
// Create a uniquely named temporary file.
-#line 352 "runfile.in"
+#line 354 "./runfile.in"
// string mktemp(string s);
void gen_runfile43(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 353 "runfile.in"
- char *S=StrdupMalloc(s+"XXXXXX");
+#line 355 "./runfile.in"
+ string baseTemplate=s+"XXXXXX";
+ char *S=StrdupMalloc(baseTemplate);
+ bool success=true;
+#if defined(_WIN32)
+ if (_mktemp_s(S,baseTemplate.length()+1) != 0)
+ {
+ success = false;
+ }
+ FILE* fp;
+ if (success && (fopen_s(&fp,S,"w") != 0))
+ {
+ success = false;
+ }
+#else
int fd=mkstemp(S);
- if(fd < 0) {
+ if (fd < 0)
+ {
+ success = false;
+ }
+#endif
+ if(!success)
+ {
ostringstream buf;
buf << "Could not create unique temporary filename based on " << s;
error(buf);
}
string T(S);
free(S);
+
+#if defined(_WIN32)
+ bool closeSuccess = fclose(fp) == 0;
+#else
+ bool closeSuccess = close(fd) == 0;
+#endif
+
+ if (!closeSuccess)
+ {
+ ostringstream buf;
+ buf << "Could not finalize temporary file based on " << s;
+ error(buf);
+ }
{Stack->push<string>(T); return;}
}
@@ -598,93 +632,93 @@ namespace trans {
void gen_runfile_venv(venv &ve)
{
-#line 28 "runfile.in"
+#line 30 "./runfile.in"
addFunc(ve, run::gen_runfile0, primBoolean(), SYM_EQ, formal(primFile(), SYM(a), false, false), formal(primFile(), SYM(b), false, false));
-#line 33 "runfile.in"
+#line 35 "./runfile.in"
addFunc(ve, run::gen_runfile1, primBoolean(), SYM_NEQ, formal(primFile(), SYM(a), false, false), formal(primFile(), SYM(b), false, false));
-#line 38 "runfile.in"
+#line 40 "./runfile.in"
REGISTER_BLTIN(run::nullFile,"nullFile");
-#line 43 "runfile.in"
+#line 45 "./runfile.in"
addFunc(ve, run::gen_runfile3, primFile(), SYM(input), formal(primString(), SYM(name), true, false), formal(primBoolean(), SYM(check), true, false), formal(primString(), SYM(comment), true, false), formal(primString(), SYM(mode), true, false));
-#line 74 "runfile.in"
+#line 76 "./runfile.in"
addFunc(ve, run::gen_runfile4, primFile(), SYM(output), formal(primString(), SYM(name), true, false), formal(primBoolean(), SYM(update), true, false), formal(primString(), SYM(comment), true, false), formal(primString(), SYM(mode), true, false));
-#line 111 "runfile.in"
+#line 113 "./runfile.in"
addFunc(ve, run::gen_runfile5, primBoolean(), SYM(eof), formal(primFile(), SYM(f), false, false));
-#line 116 "runfile.in"
+#line 118 "./runfile.in"
addFunc(ve, run::gen_runfile6, primBoolean(), SYM(eol), formal(primFile(), SYM(f), false, false));
-#line 121 "runfile.in"
+#line 123 "./runfile.in"
addFunc(ve, run::gen_runfile7, primBoolean(), SYM(error), formal(primFile(), SYM(f), false, false));
-#line 126 "runfile.in"
+#line 128 "./runfile.in"
addFunc(ve, run::gen_runfile8, primVoid(), SYM(clear), formal(primFile(), SYM(f), false, false));
-#line 131 "runfile.in"
+#line 133 "./runfile.in"
addFunc(ve, run::gen_runfile9, primVoid(), SYM(close), formal(primFile(), SYM(f), false, false));
-#line 136 "runfile.in"
+#line 138 "./runfile.in"
addFunc(ve, run::gen_runfile10, primInt(), SYM(precision), formal(primFile(), SYM(f), true, false), formal(primInt(), SYM(digits), true, false));
-#line 142 "runfile.in"
+#line 144 "./runfile.in"
addFunc(ve, run::gen_runfile11, primVoid(), SYM(flush), formal(primFile(), SYM(f), false, false));
-#line 147 "runfile.in"
+#line 149 "./runfile.in"
addFunc(ve, run::gen_runfile12, primString(), SYM(getc), formal(primFile(), SYM(f), false, false));
-#line 154 "runfile.in"
+#line 156 "./runfile.in"
addFunc(ve, run::gen_runfile13, primInt(), SYM(tell), formal(primFile(), SYM(f), false, false));
-#line 159 "runfile.in"
+#line 161 "./runfile.in"
addFunc(ve, run::gen_runfile14, primVoid(), SYM(seek), formal(primFile(), SYM(f), false, false), formal(primInt(), SYM(pos), false, false));
-#line 164 "runfile.in"
+#line 166 "./runfile.in"
addFunc(ve, run::gen_runfile15, primVoid(), SYM(seekeof), formal(primFile(), SYM(f), false, false));
-#line 169 "runfile.in"
+#line 171 "./runfile.in"
REGISTER_BLTIN(run::namePart,"namePart");
-#line 174 "runfile.in"
+#line 176 "./runfile.in"
REGISTER_BLTIN(run::modePart,"modePart");
-#line 179 "runfile.in"
+#line 181 "./runfile.in"
REGISTER_BLTIN(run::dimensionSetHelper,"dimensionSetHelper");
-#line 186 "runfile.in"
+#line 188 "./runfile.in"
REGISTER_BLTIN(run::dimensionSet,"dimensionSet");
-#line 191 "runfile.in"
+#line 193 "./runfile.in"
REGISTER_BLTIN(run::dimensionPart,"dimensionPart");
-#line 200 "runfile.in"
+#line 202 "./runfile.in"
REGISTER_BLTIN(run::lineSetHelper,"lineSetHelper");
-#line 207 "runfile.in"
+#line 209 "./runfile.in"
REGISTER_BLTIN(run::lineSet,"lineSet");
-#line 212 "runfile.in"
+#line 214 "./runfile.in"
REGISTER_BLTIN(run::linePart,"linePart");
-#line 217 "runfile.in"
+#line 219 "./runfile.in"
REGISTER_BLTIN(run::csvSetHelper,"csvSetHelper");
-#line 224 "runfile.in"
+#line 226 "./runfile.in"
REGISTER_BLTIN(run::csvSet,"csvSet");
-#line 229 "runfile.in"
+#line 231 "./runfile.in"
REGISTER_BLTIN(run::csvPart,"csvPart");
-#line 234 "runfile.in"
+#line 236 "./runfile.in"
REGISTER_BLTIN(run::wordSetHelper,"wordSetHelper");
-#line 241 "runfile.in"
+#line 243 "./runfile.in"
REGISTER_BLTIN(run::wordSet,"wordSet");
-#line 246 "runfile.in"
+#line 248 "./runfile.in"
REGISTER_BLTIN(run::wordPart,"wordPart");
-#line 251 "runfile.in"
+#line 253 "./runfile.in"
REGISTER_BLTIN(run::singlerealSetHelper,"singlerealSetHelper");
-#line 258 "runfile.in"
+#line 260 "./runfile.in"
REGISTER_BLTIN(run::singlerealSet,"singlerealSet");
-#line 263 "runfile.in"
+#line 265 "./runfile.in"
REGISTER_BLTIN(run::singlerealPart,"singlerealPart");
-#line 268 "runfile.in"
+#line 270 "./runfile.in"
REGISTER_BLTIN(run::singleintSetHelper,"singleintSetHelper");
-#line 275 "runfile.in"
+#line 277 "./runfile.in"
REGISTER_BLTIN(run::singleintSet,"singleintSet");
-#line 280 "runfile.in"
+#line 282 "./runfile.in"
REGISTER_BLTIN(run::singleintPart,"singleintPart");
-#line 285 "runfile.in"
+#line 287 "./runfile.in"
REGISTER_BLTIN(run::signedintSetHelper,"signedintSetHelper");
-#line 292 "runfile.in"
+#line 294 "./runfile.in"
REGISTER_BLTIN(run::signedintSet,"signedintSet");
-#line 297 "runfile.in"
+#line 299 "./runfile.in"
REGISTER_BLTIN(run::signedintPart,"signedintPart");
-#line 302 "runfile.in"
+#line 304 "./runfile.in"
REGISTER_BLTIN(run::readSetHelper,"readSetHelper");
-#line 325 "runfile.in"
+#line 327 "./runfile.in"
REGISTER_BLTIN(run::readSet,"readSet");
-#line 330 "runfile.in"
+#line 332 "./runfile.in"
addFunc(ve, run::gen_runfile41, primInt(), SYM(delete), formal(primString(), SYM(s), false, false));
-#line 340 "runfile.in"
+#line 342 "./runfile.in"
addFunc(ve, run::gen_runfile42, primInt(), SYM(rename), formal(primString(), SYM(from), false, false), formal(primString(), SYM(to), false, false));
-#line 351 "runfile.in"
+#line 353 "./runfile.in"
addFunc(ve, run::gen_runfile43, primString(), SYM(mktemp), formal(primString(), SYM(s), false, false));
}
diff --git a/graphics/asymptote/runfile.h b/graphics/asymptote/runfile.h
index f523c58815..aa22067cd3 100644
--- a/graphics/asymptote/runfile.h
+++ b/graphics/asymptote/runfile.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runfile.in; changes will be overwritten *****/
-#ifndef runfile_H
-#define runfile_H
+#pragma once
namespace run {
void nullFile(vm::stack *);
void namePart(vm::stack *);
@@ -31,4 +30,3 @@ void readSetHelper(vm::stack *);
void readSet(vm::stack *);
}
-#endif // runfile_H
diff --git a/graphics/asymptote/runfile.in b/graphics/asymptote/runfile.in
index 4e7e3302ec..e77d10d275 100644
--- a/graphics/asymptote/runfile.in
+++ b/graphics/asymptote/runfile.in
@@ -12,8 +12,10 @@ file* => primFile()
#include "triple.h"
#include "array.h"
-#ifdef __CYGWIN__
- extern "C" int mkstemp(char *c);
+#if defined(_WIN32)
+#include <io.h>
+#else
+#include <unistd.h>
#endif
using namespace camp;
@@ -351,14 +353,46 @@ Int rename(string from, string to)
// Create a uniquely named temporary file.
string mktemp(string s)
{
- char *S=StrdupMalloc(s+"XXXXXX");
+ string baseTemplate=s+"XXXXXX";
+ char *S=StrdupMalloc(baseTemplate);
+ bool success=true;
+#if defined(_WIN32)
+ if (_mktemp_s(S,baseTemplate.length()+1) != 0)
+ {
+ success = false;
+ }
+ FILE* fp;
+ if (success && (fopen_s(&fp,S,"w") != 0))
+ {
+ success = false;
+ }
+#else
int fd=mkstemp(S);
- if(fd < 0) {
+ if (fd < 0)
+ {
+ success = false;
+ }
+#endif
+ if(!success)
+ {
ostringstream buf;
buf << "Could not create unique temporary filename based on " << s;
error(buf);
}
string T(S);
free(S);
+
+#if defined(_WIN32)
+ bool closeSuccess = fclose(fp) == 0;
+#else
+ bool closeSuccess = close(fd) == 0;
+#endif
+
+ if (!closeSuccess)
+ {
+ ostringstream buf;
+ buf << "Could not finalize temporary file based on " << s;
+ error(buf);
+ }
return T;
}
diff --git a/graphics/asymptote/runhistory.cc b/graphics/asymptote/runhistory.cc
index 089807c5a0..011ad21814 100644
--- a/graphics/asymptote/runhistory.cc
+++ b/graphics/asymptote/runhistory.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runhistory.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runhistory.in"
+#line 1 "./runhistory.in"
/*****
* runhistory.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -67,6 +67,13 @@ function *realRealFunction();
#include "mathop.h"
#include "builtin.h"
+#if defined(_WIN32)
+#include <io.h>
+#define isatty _isatty
+#else
+#include <unistd.h>
+#endif
+
using namespace camp;
using namespace settings;
using namespace vm;
@@ -166,13 +173,13 @@ void cleanup()
#endif
namespace run {
// Return the last n lines of the history named name.
-#line 110 "runhistory.in"
+#line 117 "./runhistory.in"
// stringarray* history(string name, Int n=1);
void gen_runhistory0(stack *Stack)
{
Int n=vm::pop<Int>(Stack,1);
string name=vm::pop<string>(Stack);
-#line 111 "runhistory.in"
+#line 118 "./runhistory.in"
#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
bool newhistory=historyMap.find(name) == historyMap.end();
@@ -204,12 +211,12 @@ void gen_runhistory0(stack *Stack)
}
// Return the last n lines of the interactive history.
-#line 143 "runhistory.in"
+#line 150 "./runhistory.in"
// stringarray* history(Int n=0);
void gen_runhistory1(stack *Stack)
{
Int n=vm::pop<Int>(Stack,0);
-#line 144 "runhistory.in"
+#line 151 "./runhistory.in"
#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
{Stack->push<stringarray*>(get_history(n)); return;}
#else
@@ -220,16 +227,20 @@ void gen_runhistory1(stack *Stack)
// Prompt for a string using prompt, the GNU readline library, and a
// local history named name.
-#line 155 "runhistory.in"
+#line 162 "./runhistory.in"
// string readline(string prompt=emptystring, string name=emptystring, bool tabcompletion=false);
void gen_runhistory2(stack *Stack)
{
bool tabcompletion=vm::pop<bool>(Stack,false);
string name=vm::pop<string>(Stack,emptystring);
string prompt=vm::pop<string>(Stack,emptystring);
-#line 157 "runhistory.in"
- if(!(isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0))
+#line 164 "./runhistory.in"
+ bool stdinIsTty=isatty(STDIN_FILENO);
+ bool hasInpipe=getSetting<Int>("inpipe") >= 0;
+ if(!(stdinIsTty || hasInpipe))
+ {
{Stack->push<string>(emptystring); return;}
+ }
#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
interact::init_readline(tabcompletion);
@@ -271,14 +282,14 @@ void gen_runhistory2(stack *Stack)
// Save a string in a local history named name.
// If store=true, store the local history in the file historyfilename(name).
-#line 201 "runhistory.in"
+#line 212 "./runhistory.in"
// void saveline(string name, string value, bool store=true);
void gen_runhistory3(stack *Stack)
{
bool store=vm::pop<bool>(Stack,true);
string value=vm::pop<string>(Stack);
string name=vm::pop<string>(Stack);
-#line 202 "runhistory.in"
+#line 213 "./runhistory.in"
#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
store_history(&history_save);
bool newhistory=historyMap.find(name) == historyMap.end();
@@ -311,13 +322,13 @@ namespace trans {
void gen_runhistory_venv(venv &ve)
{
-#line 109 "runhistory.in"
+#line 116 "./runhistory.in"
addFunc(ve, run::gen_runhistory0, stringArray(), SYM(history), formal(primString(), SYM(name), false, false), formal(primInt(), SYM(n), true, false));
-#line 142 "runhistory.in"
+#line 149 "./runhistory.in"
addFunc(ve, run::gen_runhistory1, stringArray(), SYM(history), formal(primInt(), SYM(n), true, false));
-#line 153 "runhistory.in"
+#line 160 "./runhistory.in"
addFunc(ve, run::gen_runhistory2, primString(), SYM(readline), formal(primString(), SYM(prompt), true, false), formal(primString(), SYM(name), true, false), formal(primBoolean(), SYM(tabcompletion), true, false));
-#line 199 "runhistory.in"
+#line 210 "./runhistory.in"
addFunc(ve, run::gen_runhistory3, primVoid(), SYM(saveline), formal(primString(), SYM(name), false, false), formal(primString(), SYM(value), false, false), formal(primBoolean(), SYM(store), true, false));
}
diff --git a/graphics/asymptote/runhistory.h b/graphics/asymptote/runhistory.h
index 50be6f77f1..424b904fcb 100644
--- a/graphics/asymptote/runhistory.h
+++ b/graphics/asymptote/runhistory.h
@@ -1,8 +1,6 @@
/***** Autogenerated from runhistory.in; changes will be overwritten *****/
-#ifndef runhistory_H
-#define runhistory_H
+#pragma once
namespace run {
}
-#endif // runhistory_H
diff --git a/graphics/asymptote/runhistory.in b/graphics/asymptote/runhistory.in
index 78dcbb6d54..8943733854 100644
--- a/graphics/asymptote/runhistory.in
+++ b/graphics/asymptote/runhistory.in
@@ -14,6 +14,13 @@ stringarray* => stringArray()
#include "mathop.h"
#include "builtin.h"
+#if defined(_WIN32)
+#include <io.h>
+#define isatty _isatty
+#else
+#include <unistd.h>
+#endif
+
using namespace camp;
using namespace settings;
using namespace vm;
@@ -155,8 +162,12 @@ stringarray* history(Int n=0)
string readline(string prompt=emptystring, string name=emptystring,
bool tabcompletion=false)
{
- if(!(isatty(STDIN_FILENO) || getSetting<Int>("inpipe") >= 0))
+ bool stdinIsTty=isatty(STDIN_FILENO);
+ bool hasInpipe=getSetting<Int>("inpipe") >= 0;
+ if(!(stdinIsTty || hasInpipe))
+ {
return emptystring;
+ }
#if defined(HAVE_LIBREADLINE) && defined(HAVE_LIBCURSES)
interact::init_readline(tabcompletion);
diff --git a/graphics/asymptote/runlabel.cc b/graphics/asymptote/runlabel.cc
index fc55f079bc..373f121c0a 100644
--- a/graphics/asymptote/runlabel.cc
+++ b/graphics/asymptote/runlabel.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runlabel.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runlabel.in"
+#line 1 "./runlabel.in"
/*****
* runlabel.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -263,7 +263,7 @@ array *readpath(const string& psname, bool keep,
#endif
namespace run {
-#line 214 "runlabel.in"
+#line 214 "./runlabel.in"
// void label(picture *f, string *s, string *size, transform t, pair position, pair align, pen p);
void gen_runlabel0(stack *Stack)
{
@@ -274,26 +274,26 @@ void gen_runlabel0(stack *Stack)
string * size=vm::pop<string *>(Stack);
string * s=vm::pop<string *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 216 "runlabel.in"
+#line 216 "./runlabel.in"
f->append(new drawLabel(*s,*size,t,position,align,p));
}
-#line 220 "runlabel.in"
+#line 220 "./runlabel.in"
// bool labels(picture *f);
void gen_runlabel1(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 221 "runlabel.in"
+#line 221 "./runlabel.in"
{Stack->push<bool>(f->havelabels()); return;}
}
-#line 225 "runlabel.in"
+#line 225 "./runlabel.in"
// realarray* texsize(string *s, pen p=CURRENTPEN);
void gen_runlabel2(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
string * s=vm::pop<string *>(Stack);
-#line 226 "runlabel.in"
+#line 226 "./runlabel.in"
texinit();
processDataStruct &pd=processData();
@@ -310,13 +310,13 @@ void gen_runlabel2(stack *Stack)
{Stack->push<realarray*>(t); return;}
}
-#line 243 "runlabel.in"
+#line 243 "./runlabel.in"
// patharray2* _texpath(stringarray *s, penarray *p);
void gen_runlabel3(stack *Stack)
{
penarray * p=vm::pop<penarray *>(Stack);
stringarray * s=vm::pop<stringarray *>(Stack);
-#line 244 "runlabel.in"
+#line 244 "./runlabel.in"
size_t n=checkArrays(s,p);
if(n == 0) {Stack->push<patharray2*>(new array(0)); return;}
@@ -421,13 +421,13 @@ void gen_runlabel3(stack *Stack)
{Stack->push<patharray2*>(xe ? readpath(psname,keep,0.1) : readpath(psname,keep,0.12,-1.0)); return;}
}
-#line 349 "runlabel.in"
+#line 349 "./runlabel.in"
// patharray2* textpath(stringarray *s, penarray *p);
void gen_runlabel4(stack *Stack)
{
penarray * p=vm::pop<penarray *>(Stack);
stringarray * s=vm::pop<stringarray *>(Stack);
-#line 350 "runlabel.in"
+#line 350 "./runlabel.in"
size_t n=checkArrays(s,p);
if(n == 0) {Stack->push<patharray2*>(new array(0)); return;}
@@ -500,13 +500,13 @@ void gen_runlabel4(stack *Stack)
{Stack->push<patharray2*>(readpath(psname,keep,0.1)); return;}
}
-#line 423 "runlabel.in"
+#line 423 "./runlabel.in"
// patharray* _strokepath(path g, pen p=CURRENTPEN);
void gen_runlabel5(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
path g=vm::pop<path>(Stack);
-#line 424 "runlabel.in"
+#line 424 "./runlabel.in"
array *P=new array(0);
if(g.size() == 0) {Stack->push<patharray*>(P); return;}
@@ -536,17 +536,17 @@ namespace trans {
void gen_runlabel_venv(venv &ve)
{
-#line 214 "runlabel.in"
+#line 214 "./runlabel.in"
addFunc(ve, run::gen_runlabel0, primVoid(), SYM(label), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false), formal(primString(), SYM(size), false, false), formal(primTransform(), SYM(t), false, false), formal(primPair(), SYM(position), false, false), formal(primPair(), SYM(align), false, false), formal(primPen(), SYM(p), false, false));
-#line 220 "runlabel.in"
+#line 220 "./runlabel.in"
addFunc(ve, run::gen_runlabel1, primBoolean(), SYM(labels), formal(primPicture(), SYM(f), false, false));
-#line 225 "runlabel.in"
+#line 225 "./runlabel.in"
addFunc(ve, run::gen_runlabel2, realArray(), SYM(texsize), formal(primString(), SYM(s), false, false), formal(primPen(), SYM(p), true, false));
-#line 243 "runlabel.in"
+#line 243 "./runlabel.in"
addFunc(ve, run::gen_runlabel3, pathArray2(), SYM(_texpath), formal(stringArray(), SYM(s), false, false), formal(penArray(), SYM(p), false, false));
-#line 349 "runlabel.in"
+#line 349 "./runlabel.in"
addFunc(ve, run::gen_runlabel4, pathArray2(), SYM(textpath), formal(stringArray(), SYM(s), false, false), formal(penArray(), SYM(p), false, false));
-#line 423 "runlabel.in"
+#line 423 "./runlabel.in"
addFunc(ve, run::gen_runlabel5, pathArray(), SYM(_strokepath), formal(primPath(), SYM(g), false, false), formal(primPen(), SYM(p), true, false));
}
diff --git a/graphics/asymptote/runlabel.h b/graphics/asymptote/runlabel.h
index b710d65cee..da4322798d 100644
--- a/graphics/asymptote/runlabel.h
+++ b/graphics/asymptote/runlabel.h
@@ -1,8 +1,6 @@
/***** Autogenerated from runlabel.in; changes will be overwritten *****/
-#ifndef runlabel_H
-#define runlabel_H
+#pragma once
namespace run {
}
-#endif // runlabel_H
diff --git a/graphics/asymptote/runmath.cc b/graphics/asymptote/runmath.cc
index c7d4c65bba..7df1ffeae1 100644
--- a/graphics/asymptote/runmath.cc
+++ b/graphics/asymptote/runmath.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runmath.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runmath.in"
+#line 1 "./runmath.in"
/*****
* runmath.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -62,6 +62,10 @@ function *realRealFunction();
#define CURRENTPEN processData().currentpen
#line 12 "runmath.in"
+#include <chrono>
+#include <random>
+#include <memory>
+#include <cmath>
#include <inttypes.h>
#include "mathop.h"
@@ -227,14 +231,16 @@ inline Int sgn(double x)
return (x > 0.0 ? 1 : (x < 0.0 ? -1 : 0));
}
-static bool initializeRandom=true;
+namespace
+{
+bool initializeRandom=true;
+std::minstd_rand randEngine;
+}
void Srand(Int seed)
{
initializeRandom=false;
- const int n=256;
- static char state[n];
- initstate(intcast(seed),state,n);
+ randEngine=std::minstd_rand(seed);
}
// Autogenerated routines:
@@ -246,233 +252,235 @@ void Srand(Int seed)
#endif
namespace run {
-#line 190 "runmath.in"
+#line 196 "./runmath.in"
// real ^(real x, Int y);
void gen_runmath0(stack *Stack)
{
Int y=vm::pop<Int>(Stack);
real x=vm::pop<real>(Stack);
-#line 191 "runmath.in"
+#line 197 "./runmath.in"
{Stack->push<real>(pow(x,y)); return;}
}
-#line 195 "runmath.in"
+#line 201 "./runmath.in"
// pair ^(pair z, Int y);
void gen_runmath1(stack *Stack)
{
Int y=vm::pop<Int>(Stack);
pair z=vm::pop<pair>(Stack);
-#line 196 "runmath.in"
+#line 202 "./runmath.in"
{Stack->push<pair>(pow(z,y)); return;}
}
-#line 200 "runmath.in"
+#line 206 "./runmath.in"
// Int quotient(Int x, Int y);
void gen_runmath2(stack *Stack)
{
Int y=vm::pop<Int>(Stack);
Int x=vm::pop<Int>(Stack);
-#line 201 "runmath.in"
+#line 207 "./runmath.in"
{Stack->push<Int>(quotient<Int>()(x,y)); return;}
}
-#line 205 "runmath.in"
+#line 211 "./runmath.in"
// Int abs(Int x);
void gen_runmath3(stack *Stack)
{
Int x=vm::pop<Int>(Stack);
-#line 206 "runmath.in"
+#line 212 "./runmath.in"
{Stack->push<Int>(Abs(x)); return;}
}
-#line 210 "runmath.in"
+#line 216 "./runmath.in"
// Int sgn(real x);
void gen_runmath4(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 211 "runmath.in"
+#line 217 "./runmath.in"
{Stack->push<Int>(sgn(x)); return;}
}
-#line 215 "runmath.in"
+#line 221 "./runmath.in"
// Int rand();
void gen_runmath5(stack *Stack)
{
-#line 216 "runmath.in"
+#line 222 "./runmath.in"
if(initializeRandom)
Srand(1);
- {Stack->push<Int>(random()); return;}
+ std::uniform_int_distribution dist(0, RANDOM_MAX);
+ {Stack->push<Int>(dist(randEngine)); return;}
}
-#line 222 "runmath.in"
+#line 229 "./runmath.in"
// void srand(Int seed);
void gen_runmath6(stack *Stack)
{
Int seed=vm::pop<Int>(Stack);
-#line 223 "runmath.in"
+#line 230 "./runmath.in"
Srand(seed);
}
// a random number uniformly distributed in the interval [0,1]
-#line 228 "runmath.in"
+#line 235 "./runmath.in"
// real unitrand();
void gen_runmath7(stack *Stack)
{
-#line 229 "runmath.in"
- {Stack->push<real>(((real) random())/RANDOM_MAX); return;}
+#line 236 "./runmath.in"
+ std::uniform_real_distribution<double> dist(0.0, 1.0);
+ {Stack->push<real>(dist(randEngine)); return;}
}
-#line 233 "runmath.in"
+#line 241 "./runmath.in"
// Int ceil(real x);
void gen_runmath8(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 234 "runmath.in"
+#line 242 "./runmath.in"
{Stack->push<Int>(Intcast(ceil(x))); return;}
}
-#line 238 "runmath.in"
+#line 246 "./runmath.in"
// Int floor(real x);
void gen_runmath9(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 239 "runmath.in"
+#line 247 "./runmath.in"
{Stack->push<Int>(Intcast(floor(x))); return;}
}
-#line 243 "runmath.in"
+#line 251 "./runmath.in"
// Int round(real x);
void gen_runmath10(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 244 "runmath.in"
+#line 252 "./runmath.in"
if(validInt(x)) {Stack->push<Int>(Round(x)); return;}
integeroverflow(0);
}
-#line 249 "runmath.in"
+#line 257 "./runmath.in"
// Int Ceil(real x);
void gen_runmath11(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 250 "runmath.in"
+#line 258 "./runmath.in"
{Stack->push<Int>(Ceil(x)); return;}
}
-#line 254 "runmath.in"
+#line 262 "./runmath.in"
// Int Floor(real x);
void gen_runmath12(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 255 "runmath.in"
+#line 263 "./runmath.in"
{Stack->push<Int>(Floor(x)); return;}
}
-#line 259 "runmath.in"
+#line 267 "./runmath.in"
// Int Round(real x);
void gen_runmath13(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 260 "runmath.in"
+#line 268 "./runmath.in"
{Stack->push<Int>(Round(Intcap(x))); return;}
}
-#line 264 "runmath.in"
+#line 272 "./runmath.in"
// real fmod(real x, real y);
void gen_runmath14(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 265 "runmath.in"
+#line 273 "./runmath.in"
if (y == 0.0) dividebyzero();
{Stack->push<real>(fmod(x,y)); return;}
}
-#line 270 "runmath.in"
+#line 278 "./runmath.in"
// real atan2(real y, real x);
void gen_runmath15(stack *Stack)
{
real x=vm::pop<real>(Stack);
real y=vm::pop<real>(Stack);
-#line 271 "runmath.in"
+#line 279 "./runmath.in"
{Stack->push<real>(atan2(y,x)); return;}
}
-#line 275 "runmath.in"
+#line 283 "./runmath.in"
// real hypot(real x, real y);
void gen_runmath16(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 276 "runmath.in"
+#line 284 "./runmath.in"
{Stack->push<real>(hypot(x,y)); return;}
}
-#line 280 "runmath.in"
+#line 288 "./runmath.in"
// real remainder(real x, real y);
void gen_runmath17(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 281 "runmath.in"
+#line 289 "./runmath.in"
{Stack->push<real>(remainder(x,y)); return;}
}
-#line 285 "runmath.in"
+#line 293 "./runmath.in"
// real Jn(Int n, real x);
void gen_runmath18(stack *Stack)
{
real x=vm::pop<real>(Stack);
Int n=vm::pop<Int>(Stack);
-#line 286 "runmath.in"
+#line 294 "./runmath.in"
{Stack->push<real>(jn(n,x)); return;}
}
-#line 290 "runmath.in"
+#line 298 "./runmath.in"
// real Yn(Int n, real x);
void gen_runmath19(stack *Stack)
{
real x=vm::pop<real>(Stack);
Int n=vm::pop<Int>(Stack);
-#line 291 "runmath.in"
+#line 299 "./runmath.in"
{Stack->push<real>(yn(n,x)); return;}
}
-#line 295 "runmath.in"
+#line 303 "./runmath.in"
// real erf(real x);
void gen_runmath20(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 296 "runmath.in"
+#line 304 "./runmath.in"
{Stack->push<real>(erf(x)); return;}
}
-#line 300 "runmath.in"
+#line 308 "./runmath.in"
// real erfc(real x);
void gen_runmath21(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 301 "runmath.in"
+#line 309 "./runmath.in"
{Stack->push<real>(erfc(x)); return;}
}
-#line 305 "runmath.in"
+#line 313 "./runmath.in"
// Int factorial(Int n);
void gen_runmath22(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 306 "runmath.in"
+#line 314 "./runmath.in"
if(n < 0) error(invalidargument);
{Stack->push<Int>(factorial(n)); return;}
}
-#line 310 "runmath.in"
+#line 318 "./runmath.in"
// Int choose(Int n, Int k);
void gen_runmath23(stack *Stack)
{
Int k=vm::pop<Int>(Stack);
Int n=vm::pop<Int>(Stack);
-#line 311 "runmath.in"
+#line 319 "./runmath.in"
if(n < 0 || k < 0 || k > n) error(invalidargument);
Int f=1;
Int r=n-k;
@@ -483,28 +491,23 @@ void gen_runmath23(stack *Stack)
{Stack->push<Int>(f); return;}
}
-#line 321 "runmath.in"
+#line 329 "./runmath.in"
// real gamma(real x);
void gen_runmath24(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 322 "runmath.in"
-#ifdef HAVE_TGAMMA
- {Stack->push<real>(tgamma(x)); return;}
-#else
- real lg = lgamma(x);
- {Stack->push<real>(signgam*exp(lg)); return;}
-#endif
+#line 330 "./runmath.in"
+ {Stack->push<real>(std::tgamma(x)); return;}
}
-#line 331 "runmath.in"
+#line 334 "./runmath.in"
// realarray* quadraticroots(real a, real b, real c);
void gen_runmath25(stack *Stack)
{
real c=vm::pop<real>(Stack);
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
-#line 332 "runmath.in"
+#line 335 "./runmath.in"
quadraticroots q(a,b,c);
array *roots=new array(q.roots);
if(q.roots >= 1) (*roots)[0]=q.t1;
@@ -512,14 +515,14 @@ void gen_runmath25(stack *Stack)
{Stack->push<realarray*>(roots); return;}
}
-#line 340 "runmath.in"
+#line 343 "./runmath.in"
// pairarray* quadraticroots(explicit pair a, explicit pair b, explicit pair c);
void gen_runmath26(stack *Stack)
{
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 341 "runmath.in"
+#line 344 "./runmath.in"
Quadraticroots q(a,b,c);
array *roots=new array(q.roots);
if(q.roots >= 1) (*roots)[0]=q.z1;
@@ -527,7 +530,7 @@ void gen_runmath26(stack *Stack)
{Stack->push<pairarray*>(roots); return;}
}
-#line 349 "runmath.in"
+#line 352 "./runmath.in"
// realarray* cubicroots(real a, real b, real c, real d);
void gen_runmath27(stack *Stack)
{
@@ -535,7 +538,7 @@ void gen_runmath27(stack *Stack)
real c=vm::pop<real>(Stack);
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
-#line 350 "runmath.in"
+#line 353 "./runmath.in"
cubicroots q(a,b,c,d);
array *roots=new array(q.roots);
if(q.roots >= 1) (*roots)[0]=q.t1;
@@ -546,98 +549,98 @@ void gen_runmath27(stack *Stack)
// Logical operations
-#line 361 "runmath.in"
+#line 364 "./runmath.in"
// bool !(bool b);
void gen_runmath28(stack *Stack)
{
bool b=vm::pop<bool>(Stack);
-#line 362 "runmath.in"
+#line 365 "./runmath.in"
{Stack->push<bool>(!b); return;}
}
-#line 367 "runmath.in"
+#line 370 "./runmath.in"
void boolMemEq(stack *Stack)
{
vmFrame * b=vm::pop<vmFrame *>(Stack);
vmFrame * a=vm::pop<vmFrame *>(Stack);
-#line 368 "runmath.in"
+#line 371 "./runmath.in"
{Stack->push<bool>(a == b); return;}
}
-#line 372 "runmath.in"
+#line 375 "./runmath.in"
void boolMemNeq(stack *Stack)
{
vmFrame * b=vm::pop<vmFrame *>(Stack);
vmFrame * a=vm::pop<vmFrame *>(Stack);
-#line 373 "runmath.in"
+#line 376 "./runmath.in"
{Stack->push<bool>(a != b); return;}
}
-#line 377 "runmath.in"
+#line 380 "./runmath.in"
void boolFuncEq(stack *Stack)
{
callable * b=vm::pop<callable *>(Stack);
callable * a=vm::pop<callable *>(Stack);
-#line 378 "runmath.in"
+#line 381 "./runmath.in"
{Stack->push<bool>(a->compare(b)); return;}
}
-#line 382 "runmath.in"
+#line 385 "./runmath.in"
void boolFuncNeq(stack *Stack)
{
callable * b=vm::pop<callable *>(Stack);
callable * a=vm::pop<callable *>(Stack);
-#line 383 "runmath.in"
+#line 386 "./runmath.in"
{Stack->push<bool>(!(a->compare(b))); return;}
}
// Bit operations
-#line 389 "runmath.in"
+#line 392 "./runmath.in"
// Int AND(Int a, Int b);
void gen_runmath33(stack *Stack)
{
Int b=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
-#line 390 "runmath.in"
+#line 393 "./runmath.in"
{Stack->push<Int>(a & b); return;}
}
-#line 395 "runmath.in"
+#line 398 "./runmath.in"
// Int OR(Int a, Int b);
void gen_runmath34(stack *Stack)
{
Int b=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
-#line 396 "runmath.in"
+#line 399 "./runmath.in"
{Stack->push<Int>(a | b); return;}
}
-#line 400 "runmath.in"
+#line 403 "./runmath.in"
// Int XOR(Int a, Int b);
void gen_runmath35(stack *Stack)
{
Int b=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
-#line 401 "runmath.in"
+#line 404 "./runmath.in"
{Stack->push<Int>(a ^ b); return;}
}
-#line 405 "runmath.in"
+#line 408 "./runmath.in"
// Int NOT(Int a);
void gen_runmath36(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
-#line 406 "runmath.in"
+#line 409 "./runmath.in"
{Stack->push<Int>(~a); return;}
}
-#line 410 "runmath.in"
+#line 413 "./runmath.in"
// Int CLZ(Int a);
void gen_runmath37(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
-#line 411 "runmath.in"
+#line 414 "./runmath.in"
if((unsigned long long) a > 0xFFFFFFFF)
{Stack->push<Int>(CLZ((uint32_t) ((unsigned long long) a >> 32))); return;}
else {
@@ -647,32 +650,32 @@ void gen_runmath37(stack *Stack)
}
}
-#line 421 "runmath.in"
+#line 424 "./runmath.in"
// Int popcount(Int a);
void gen_runmath38(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
-#line 422 "runmath.in"
+#line 425 "./runmath.in"
{Stack->push<Int>(popcount(a)); return;}
}
-#line 426 "runmath.in"
+#line 429 "./runmath.in"
// Int CTZ(Int a);
void gen_runmath39(stack *Stack)
{
Int a=vm::pop<Int>(Stack);
-#line 427 "runmath.in"
+#line 430 "./runmath.in"
{Stack->push<Int>(popcount((a&-a)-1)); return;}
}
// bitreverse a within a word of length bits.
-#line 432 "runmath.in"
+#line 435 "./runmath.in"
// Int bitreverse(Int a, Int bits);
void gen_runmath40(stack *Stack)
{
Int bits=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
-#line 433 "runmath.in"
+#line 436 "./runmath.in"
typedef unsigned long long Bitreverse(unsigned long long a);
static Bitreverse *B[]={bitreverse8,bitreverse16,bitreverse24,bitreverse32,
bitreverse40,bitreverse48,bitreverse56,bitreverse64};
@@ -693,87 +696,87 @@ namespace trans {
void gen_runmath_venv(venv &ve)
{
-#line 190 "runmath.in"
+#line 196 "./runmath.in"
addFunc(ve, run::gen_runmath0, primReal(), SYM_CARET, formal(primReal(), SYM(x), false, false), formal(primInt(), SYM(y), false, false));
-#line 195 "runmath.in"
+#line 201 "./runmath.in"
addFunc(ve, run::gen_runmath1, primPair(), SYM_CARET, formal(primPair(), SYM(z), false, false), formal(primInt(), SYM(y), false, false));
-#line 200 "runmath.in"
+#line 206 "./runmath.in"
addFunc(ve, run::gen_runmath2, primInt(), SYM(quotient), formal(primInt(), SYM(x), false, false), formal(primInt(), SYM(y), false, false));
-#line 205 "runmath.in"
+#line 211 "./runmath.in"
addFunc(ve, run::gen_runmath3, primInt(), SYM(abs), formal(primInt(), SYM(x), false, false));
-#line 210 "runmath.in"
+#line 216 "./runmath.in"
addFunc(ve, run::gen_runmath4, primInt(), SYM(sgn), formal(primReal(), SYM(x), false, false));
-#line 215 "runmath.in"
+#line 221 "./runmath.in"
addFunc(ve, run::gen_runmath5, primInt(), SYM(rand));
-#line 222 "runmath.in"
+#line 229 "./runmath.in"
addFunc(ve, run::gen_runmath6, primVoid(), SYM(srand), formal(primInt(), SYM(seed), false, false));
-#line 227 "runmath.in"
+#line 234 "./runmath.in"
addFunc(ve, run::gen_runmath7, primReal(), SYM(unitrand));
-#line 233 "runmath.in"
+#line 241 "./runmath.in"
addFunc(ve, run::gen_runmath8, primInt(), SYM(ceil), formal(primReal(), SYM(x), false, false));
-#line 238 "runmath.in"
+#line 246 "./runmath.in"
addFunc(ve, run::gen_runmath9, primInt(), SYM(floor), formal(primReal(), SYM(x), false, false));
-#line 243 "runmath.in"
+#line 251 "./runmath.in"
addFunc(ve, run::gen_runmath10, primInt(), SYM(round), formal(primReal(), SYM(x), false, false));
-#line 249 "runmath.in"
+#line 257 "./runmath.in"
addFunc(ve, run::gen_runmath11, primInt(), SYM(Ceil), formal(primReal(), SYM(x), false, false));
-#line 254 "runmath.in"
+#line 262 "./runmath.in"
addFunc(ve, run::gen_runmath12, primInt(), SYM(Floor), formal(primReal(), SYM(x), false, false));
-#line 259 "runmath.in"
+#line 267 "./runmath.in"
addFunc(ve, run::gen_runmath13, primInt(), SYM(Round), formal(primReal(), SYM(x), false, false));
-#line 264 "runmath.in"
+#line 272 "./runmath.in"
addFunc(ve, run::gen_runmath14, primReal(), SYM(fmod), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false));
-#line 270 "runmath.in"
+#line 278 "./runmath.in"
addFunc(ve, run::gen_runmath15, primReal(), SYM(atan2), formal(primReal(), SYM(y), false, false), formal(primReal(), SYM(x), false, false));
-#line 275 "runmath.in"
+#line 283 "./runmath.in"
addFunc(ve, run::gen_runmath16, primReal(), SYM(hypot), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false));
-#line 280 "runmath.in"
+#line 288 "./runmath.in"
addFunc(ve, run::gen_runmath17, primReal(), SYM(remainder), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false));
-#line 285 "runmath.in"
+#line 293 "./runmath.in"
addFunc(ve, run::gen_runmath18, primReal(), SYM(Jn), formal(primInt(), SYM(n), false, false), formal(primReal(), SYM(x), false, false));
-#line 290 "runmath.in"
+#line 298 "./runmath.in"
addFunc(ve, run::gen_runmath19, primReal(), SYM(Yn), formal(primInt(), SYM(n), false, false), formal(primReal(), SYM(x), false, false));
-#line 295 "runmath.in"
+#line 303 "./runmath.in"
addFunc(ve, run::gen_runmath20, primReal(), SYM(erf), formal(primReal(), SYM(x), false, false));
-#line 300 "runmath.in"
+#line 308 "./runmath.in"
addFunc(ve, run::gen_runmath21, primReal(), SYM(erfc), formal(primReal(), SYM(x), false, false));
-#line 305 "runmath.in"
+#line 313 "./runmath.in"
addFunc(ve, run::gen_runmath22, primInt(), SYM(factorial), formal(primInt(), SYM(n), false, false));
-#line 310 "runmath.in"
+#line 318 "./runmath.in"
addFunc(ve, run::gen_runmath23, primInt(), SYM(choose), formal(primInt(), SYM(n), false, false), formal(primInt(), SYM(k), false, false));
-#line 321 "runmath.in"
+#line 329 "./runmath.in"
addFunc(ve, run::gen_runmath24, primReal(), SYM(gamma), formal(primReal(), SYM(x), false, false));
-#line 331 "runmath.in"
+#line 334 "./runmath.in"
addFunc(ve, run::gen_runmath25, realArray(), SYM(quadraticroots), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false));
-#line 340 "runmath.in"
+#line 343 "./runmath.in"
addFunc(ve, run::gen_runmath26, pairArray(), SYM(quadraticroots), formal(primPair(), SYM(a), false, true), formal(primPair(), SYM(b), false, true), formal(primPair(), SYM(c), false, true));
-#line 349 "runmath.in"
+#line 352 "./runmath.in"
addFunc(ve, run::gen_runmath27, realArray(), SYM(cubicroots), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(d), false, false));
-#line 359 "runmath.in"
+#line 362 "./runmath.in"
addFunc(ve, run::gen_runmath28, primBoolean(), SYM_LOGNOT, formal(primBoolean(), SYM(b), false, false));
-#line 367 "runmath.in"
+#line 370 "./runmath.in"
REGISTER_BLTIN(run::boolMemEq,"boolMemEq");
-#line 372 "runmath.in"
+#line 375 "./runmath.in"
REGISTER_BLTIN(run::boolMemNeq,"boolMemNeq");
-#line 377 "runmath.in"
+#line 380 "./runmath.in"
REGISTER_BLTIN(run::boolFuncEq,"boolFuncEq");
-#line 382 "runmath.in"
+#line 385 "./runmath.in"
REGISTER_BLTIN(run::boolFuncNeq,"boolFuncNeq");
-#line 387 "runmath.in"
+#line 390 "./runmath.in"
addFunc(ve, run::gen_runmath33, primInt(), SYM(AND), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false));
-#line 395 "runmath.in"
+#line 398 "./runmath.in"
addFunc(ve, run::gen_runmath34, primInt(), SYM(OR), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false));
-#line 400 "runmath.in"
+#line 403 "./runmath.in"
addFunc(ve, run::gen_runmath35, primInt(), SYM(XOR), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false));
-#line 405 "runmath.in"
+#line 408 "./runmath.in"
addFunc(ve, run::gen_runmath36, primInt(), SYM(NOT), formal(primInt(), SYM(a), false, false));
-#line 410 "runmath.in"
+#line 413 "./runmath.in"
addFunc(ve, run::gen_runmath37, primInt(), SYM(CLZ), formal(primInt(), SYM(a), false, false));
-#line 421 "runmath.in"
+#line 424 "./runmath.in"
addFunc(ve, run::gen_runmath38, primInt(), SYM(popcount), formal(primInt(), SYM(a), false, false));
-#line 426 "runmath.in"
+#line 429 "./runmath.in"
addFunc(ve, run::gen_runmath39, primInt(), SYM(CTZ), formal(primInt(), SYM(a), false, false));
-#line 431 "runmath.in"
+#line 434 "./runmath.in"
addFunc(ve, run::gen_runmath40, primInt(), SYM(bitreverse), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(bits), false, false));
}
diff --git a/graphics/asymptote/runmath.h b/graphics/asymptote/runmath.h
index a9e030cb73..deaf19a19d 100644
--- a/graphics/asymptote/runmath.h
+++ b/graphics/asymptote/runmath.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runmath.in; changes will be overwritten *****/
-#ifndef runmath_H
-#define runmath_H
+#pragma once
namespace run {
void boolMemEq(vm::stack *);
void boolMemNeq(vm::stack *);
@@ -9,4 +8,3 @@ void boolFuncEq(vm::stack *);
void boolFuncNeq(vm::stack *);
}
-#endif // runmath_H
diff --git a/graphics/asymptote/runmath.in b/graphics/asymptote/runmath.in
index 36ca583744..cecf2a3cc0 100644
--- a/graphics/asymptote/runmath.in
+++ b/graphics/asymptote/runmath.in
@@ -9,6 +9,10 @@ pair => primPair()
realarray* => realArray()
pairarray* => pairArray()
+#include <chrono>
+#include <random>
+#include <memory>
+#include <cmath>
#include <inttypes.h>
#include "mathop.h"
@@ -174,14 +178,16 @@ inline Int sgn(double x)
return (x > 0.0 ? 1 : (x < 0.0 ? -1 : 0));
}
-static bool initializeRandom=true;
+namespace
+{
+bool initializeRandom=true;
+std::minstd_rand randEngine;
+}
void Srand(Int seed)
{
initializeRandom=false;
- const int n=256;
- static char state[n];
- initstate(intcast(seed),state,n);
+ randEngine=std::minstd_rand(seed);
}
// Autogenerated routines:
@@ -216,7 +222,8 @@ Int rand()
{
if(initializeRandom)
Srand(1);
- return random();
+ std::uniform_int_distribution dist(0, RANDOM_MAX);
+ return dist(randEngine);
}
void srand(Int seed)
@@ -227,7 +234,8 @@ void srand(Int seed)
// a random number uniformly distributed in the interval [0,1]
real unitrand()
{
- return ((real) random())/RANDOM_MAX;
+ std::uniform_real_distribution<double> dist(0.0, 1.0);
+ return dist(randEngine);
}
Int ceil(real x)
@@ -320,12 +328,7 @@ Int choose(Int n, Int k) {
real gamma(real x)
{
-#ifdef HAVE_TGAMMA
- return tgamma(x);
-#else
- real lg = lgamma(x);
- return signgam*exp(lg);
-#endif
+ return std::tgamma(x);
}
realarray *quadraticroots(real a, real b, real c)
diff --git a/graphics/asymptote/runpair.cc b/graphics/asymptote/runpair.cc
index bbae654ec3..acc283b00a 100644
--- a/graphics/asymptote/runpair.cc
+++ b/graphics/asymptote/runpair.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runpair.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runpair.in"
+#line 1 "./runpair.in"
/*****
* runpair.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -107,142 +107,142 @@ pair gamma(pair z)
#endif
namespace run {
-#line 49 "runpair.in"
+#line 49 "./runpair.in"
void pairZero(stack *Stack)
{
-#line 50 "runpair.in"
+#line 50 "./runpair.in"
{Stack->push<pair>(zero); return;}
}
-#line 54 "runpair.in"
+#line 54 "./runpair.in"
void realRealToPair(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 55 "runpair.in"
+#line 55 "./runpair.in"
{Stack->push<pair>(pair(x,y)); return;}
}
-#line 59 "runpair.in"
+#line 59 "./runpair.in"
void pairNegate(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 60 "runpair.in"
+#line 60 "./runpair.in"
{Stack->push<pair>(-z); return;}
}
-#line 64 "runpair.in"
+#line 64 "./runpair.in"
// real xpart(pair z);
void pairXPart(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 65 "runpair.in"
+#line 65 "./runpair.in"
{Stack->push<real>(z.getx()); return;}
}
-#line 69 "runpair.in"
+#line 69 "./runpair.in"
// real ypart(pair z);
void pairYPart(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 70 "runpair.in"
+#line 70 "./runpair.in"
{Stack->push<real>(z.gety()); return;}
}
-#line 74 "runpair.in"
+#line 74 "./runpair.in"
// real length(pair z);
void gen_runpair5(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 75 "runpair.in"
+#line 75 "./runpair.in"
{Stack->push<real>(z.length()); return;}
}
-#line 79 "runpair.in"
+#line 79 "./runpair.in"
// real abs(pair z);
void gen_runpair6(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 80 "runpair.in"
+#line 80 "./runpair.in"
{Stack->push<real>(z.length()); return;}
}
-#line 84 "runpair.in"
+#line 84 "./runpair.in"
// real abs2(pair z);
void gen_runpair7(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 85 "runpair.in"
+#line 85 "./runpair.in"
{Stack->push<real>(z.abs2()); return;}
}
-#line 89 "runpair.in"
+#line 89 "./runpair.in"
// pair sqrt(explicit pair z);
void gen_runpair8(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 90 "runpair.in"
+#line 90 "./runpair.in"
{Stack->push<pair>(Sqrt(z)); return;}
}
// Return the angle of z in radians.
-#line 95 "runpair.in"
+#line 95 "./runpair.in"
// real angle(pair z, bool warn=true);
void gen_runpair9(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
pair z=vm::pop<pair>(Stack);
-#line 96 "runpair.in"
+#line 96 "./runpair.in"
{Stack->push<real>(z.angle(warn)); return;}
}
// Return the angle of z in degrees in the interval [0,360).
-#line 101 "runpair.in"
+#line 101 "./runpair.in"
// real degrees(pair z, bool warn=true);
void gen_runpair10(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
pair z=vm::pop<pair>(Stack);
-#line 102 "runpair.in"
+#line 102 "./runpair.in"
{Stack->push<real>(principalBranch(degrees(z.angle(warn)))); return;}
}
// Convert degrees to radians.
-#line 107 "runpair.in"
+#line 107 "./runpair.in"
// real radians(real degrees);
void gen_runpair11(stack *Stack)
{
real degrees=vm::pop<real>(Stack);
-#line 108 "runpair.in"
+#line 108 "./runpair.in"
{Stack->push<real>(radians(degrees)); return;}
}
// Convert radians to degrees.
-#line 113 "runpair.in"
+#line 113 "./runpair.in"
// real degrees(real radians);
void gen_runpair12(stack *Stack)
{
real radians=vm::pop<real>(Stack);
-#line 114 "runpair.in"
+#line 114 "./runpair.in"
{Stack->push<real>(degrees(radians)); return;}
}
// Convert radians to degrees in [0,360).
-#line 119 "runpair.in"
+#line 119 "./runpair.in"
// real Degrees(real radians);
void gen_runpair13(stack *Stack)
{
real radians=vm::pop<real>(Stack);
-#line 120 "runpair.in"
+#line 120 "./runpair.in"
{Stack->push<real>(principalBranch(degrees(radians))); return;}
}
-#line 124 "runpair.in"
+#line 124 "./runpair.in"
// real Sin(real deg);
void gen_runpair14(stack *Stack)
{
real deg=vm::pop<real>(Stack);
-#line 125 "runpair.in"
+#line 125 "./runpair.in"
int n=(int) (deg/90.0);
if(deg == n*90.0) {
int m=n % 4;
@@ -254,12 +254,12 @@ void gen_runpair14(stack *Stack)
{Stack->push<real>(sin(radians(deg))); return;}
}
-#line 137 "runpair.in"
+#line 137 "./runpair.in"
// real Cos(real deg);
void gen_runpair15(stack *Stack)
{
real deg=vm::pop<real>(Stack);
-#line 138 "runpair.in"
+#line 138 "./runpair.in"
int n=(int) (deg/90.0);
if(deg == n*90.0) {
int m=n % 4;
@@ -271,12 +271,12 @@ void gen_runpair15(stack *Stack)
{Stack->push<real>(cos(radians(deg))); return;}
}
-#line 150 "runpair.in"
+#line 150 "./runpair.in"
// real Tan(real deg);
void gen_runpair16(stack *Stack)
{
real deg=vm::pop<real>(Stack);
-#line 151 "runpair.in"
+#line 151 "./runpair.in"
int n=(int) (deg/90.0);
if(deg == n*90.0) {
int m=n % 4;
@@ -288,157 +288,157 @@ void gen_runpair16(stack *Stack)
{Stack->push<real>(tan(radians(deg))); return;}
}
-#line 163 "runpair.in"
+#line 163 "./runpair.in"
// real aSin(real x);
void gen_runpair17(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 164 "runpair.in"
+#line 164 "./runpair.in"
{Stack->push<real>(degrees(asin(x))); return;}
}
-#line 168 "runpair.in"
+#line 168 "./runpair.in"
// real aCos(real x);
void gen_runpair18(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 169 "runpair.in"
+#line 169 "./runpair.in"
{Stack->push<real>(degrees(acos(x))); return;}
}
-#line 173 "runpair.in"
+#line 173 "./runpair.in"
// real aTan(real x);
void gen_runpair19(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 174 "runpair.in"
+#line 174 "./runpair.in"
{Stack->push<real>(degrees(atan(x))); return;}
}
-#line 178 "runpair.in"
+#line 178 "./runpair.in"
// pair unit(pair z);
void gen_runpair20(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 179 "runpair.in"
+#line 179 "./runpair.in"
{Stack->push<pair>(unit(z)); return;}
}
-#line 183 "runpair.in"
+#line 183 "./runpair.in"
// pair dir(real degrees);
void gen_runpair21(stack *Stack)
{
real degrees=vm::pop<real>(Stack);
-#line 184 "runpair.in"
+#line 184 "./runpair.in"
{Stack->push<pair>(expi(radians(degrees))); return;}
}
-#line 188 "runpair.in"
+#line 188 "./runpair.in"
// pair dir(explicit pair z);
void gen_runpair22(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 189 "runpair.in"
+#line 189 "./runpair.in"
{Stack->push<pair>(unit(z)); return;}
}
-#line 193 "runpair.in"
+#line 193 "./runpair.in"
// pair expi(real angle);
void gen_runpair23(stack *Stack)
{
real angle=vm::pop<real>(Stack);
-#line 194 "runpair.in"
+#line 194 "./runpair.in"
{Stack->push<pair>(expi(angle)); return;}
}
-#line 198 "runpair.in"
+#line 198 "./runpair.in"
// pair exp(explicit pair z);
void gen_runpair24(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 199 "runpair.in"
+#line 199 "./runpair.in"
{Stack->push<pair>(exp(z)); return;}
}
-#line 203 "runpair.in"
+#line 203 "./runpair.in"
// pair log(explicit pair z);
void gen_runpair25(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 204 "runpair.in"
+#line 204 "./runpair.in"
{Stack->push<pair>(pair(log(z.length()),z.angle())); return;}
}
-#line 208 "runpair.in"
+#line 208 "./runpair.in"
// pair sin(explicit pair z);
void gen_runpair26(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 209 "runpair.in"
+#line 209 "./runpair.in"
{Stack->push<pair>(sin(z)); return;}
}
-#line 213 "runpair.in"
+#line 213 "./runpair.in"
// pair cos(explicit pair z);
void gen_runpair27(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 214 "runpair.in"
+#line 214 "./runpair.in"
{Stack->push<pair>(pair(cos(z.getx())*cosh(z.gety()),-sin(z.getx())*sinh(z.gety()))); return;}
}
// Complex Gamma function
-#line 219 "runpair.in"
+#line 219 "./runpair.in"
// pair gamma(explicit pair z);
void gen_runpair28(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 220 "runpair.in"
+#line 220 "./runpair.in"
{Stack->push<pair>(gamma(z)); return;}
}
-#line 224 "runpair.in"
+#line 224 "./runpair.in"
// pair conj(pair z);
void gen_runpair29(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 225 "runpair.in"
+#line 225 "./runpair.in"
{Stack->push<pair>(conj(z)); return;}
}
-#line 229 "runpair.in"
+#line 229 "./runpair.in"
// pair realmult(pair z, pair w);
void gen_runpair30(stack *Stack)
{
pair w=vm::pop<pair>(Stack);
pair z=vm::pop<pair>(Stack);
-#line 230 "runpair.in"
+#line 230 "./runpair.in"
{Stack->push<pair>(pair(z.getx()*w.getx(),z.gety()*w.gety())); return;}
}
// To avoid confusion, a dot product requires explicit pair arguments.
-#line 235 "runpair.in"
+#line 235 "./runpair.in"
// real dot(explicit pair z, explicit pair w);
void gen_runpair31(stack *Stack)
{
pair w=vm::pop<pair>(Stack);
pair z=vm::pop<pair>(Stack);
-#line 236 "runpair.in"
+#line 236 "./runpair.in"
{Stack->push<real>(dot(z,w)); return;}
}
// Return the 2D scalar cross product z.x*w.y-z.y*w.x.
-#line 241 "runpair.in"
+#line 241 "./runpair.in"
// real cross(explicit pair z, explicit pair w);
void gen_runpair32(stack *Stack)
{
pair w=vm::pop<pair>(Stack);
pair z=vm::pop<pair>(Stack);
-#line 242 "runpair.in"
+#line 242 "./runpair.in"
{Stack->push<real>(cross(z,w)); return;}
}
-#line 246 "runpair.in"
+#line 246 "./runpair.in"
// pair bezier(pair a, pair b, pair c, pair d, real t);
void gen_runpair33(stack *Stack)
{
@@ -447,13 +447,13 @@ void gen_runpair33(stack *Stack)
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 247 "runpair.in"
+#line 247 "./runpair.in"
real onemt=1-t;
real onemt2=onemt*onemt;
{Stack->push<pair>(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;}
}
-#line 253 "runpair.in"
+#line 253 "./runpair.in"
// pair bezierP(pair a, pair b, pair c, pair d, real t);
void gen_runpair34(stack *Stack)
{
@@ -462,11 +462,11 @@ void gen_runpair34(stack *Stack)
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 254 "runpair.in"
+#line 254 "./runpair.in"
{Stack->push<pair>(3.0*(t*t*(d-a+3.0*(b-c))+t*(2.0*(a+c)-4.0*b)+b-a)); return;}
}
-#line 258 "runpair.in"
+#line 258 "./runpair.in"
// pair bezierPP(pair a, pair b, pair c, pair d, real t);
void gen_runpair35(stack *Stack)
{
@@ -475,11 +475,11 @@ void gen_runpair35(stack *Stack)
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 259 "runpair.in"
+#line 259 "./runpair.in"
{Stack->push<pair>(6.0*(t*(d-a+3.0*(b-c))+a+c)-12.0*b); return;}
}
-#line 263 "runpair.in"
+#line 263 "./runpair.in"
// pair bezierPPP(pair a, pair b, pair c, pair d);
void gen_runpair36(stack *Stack)
{
@@ -487,7 +487,7 @@ void gen_runpair36(stack *Stack)
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 264 "runpair.in"
+#line 264 "./runpair.in"
{Stack->push<pair>(6.0*(d-a)+18.0*(b-c)); return;}
}
@@ -497,79 +497,79 @@ namespace trans {
void gen_runpair_venv(venv &ve)
{
-#line 49 "runpair.in"
+#line 49 "./runpair.in"
REGISTER_BLTIN(run::pairZero,"pairZero");
-#line 54 "runpair.in"
+#line 54 "./runpair.in"
REGISTER_BLTIN(run::realRealToPair,"realRealToPair");
-#line 59 "runpair.in"
+#line 59 "./runpair.in"
REGISTER_BLTIN(run::pairNegate,"pairNegate");
-#line 64 "runpair.in"
+#line 64 "./runpair.in"
addFunc(ve, run::pairXPart, primReal(), SYM(xpart), formal(primPair(), SYM(z), false, false));
-#line 69 "runpair.in"
+#line 69 "./runpair.in"
addFunc(ve, run::pairYPart, primReal(), SYM(ypart), formal(primPair(), SYM(z), false, false));
-#line 74 "runpair.in"
+#line 74 "./runpair.in"
addFunc(ve, run::gen_runpair5, primReal(), SYM(length), formal(primPair(), SYM(z), false, false));
-#line 79 "runpair.in"
+#line 79 "./runpair.in"
addFunc(ve, run::gen_runpair6, primReal(), SYM(abs), formal(primPair(), SYM(z), false, false));
-#line 84 "runpair.in"
+#line 84 "./runpair.in"
addFunc(ve, run::gen_runpair7, primReal(), SYM(abs2), formal(primPair(), SYM(z), false, false));
-#line 89 "runpair.in"
+#line 89 "./runpair.in"
addFunc(ve, run::gen_runpair8, primPair(), SYM(sqrt), formal(primPair(), SYM(z), false, true));
-#line 94 "runpair.in"
+#line 94 "./runpair.in"
addFunc(ve, run::gen_runpair9, primReal(), SYM(angle), formal(primPair(), SYM(z), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 100 "runpair.in"
+#line 100 "./runpair.in"
addFunc(ve, run::gen_runpair10, primReal(), SYM(degrees), formal(primPair(), SYM(z), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 106 "runpair.in"
+#line 106 "./runpair.in"
addFunc(ve, run::gen_runpair11, primReal(), SYM(radians), formal(primReal(), SYM(degrees), false, false));
-#line 112 "runpair.in"
+#line 112 "./runpair.in"
addFunc(ve, run::gen_runpair12, primReal(), SYM(degrees), formal(primReal(), SYM(radians), false, false));
-#line 118 "runpair.in"
+#line 118 "./runpair.in"
addFunc(ve, run::gen_runpair13, primReal(), SYM(Degrees), formal(primReal(), SYM(radians), false, false));
-#line 124 "runpair.in"
+#line 124 "./runpair.in"
addFunc(ve, run::gen_runpair14, primReal(), SYM(Sin), formal(primReal(), SYM(deg), false, false));
-#line 137 "runpair.in"
+#line 137 "./runpair.in"
addFunc(ve, run::gen_runpair15, primReal(), SYM(Cos), formal(primReal(), SYM(deg), false, false));
-#line 150 "runpair.in"
+#line 150 "./runpair.in"
addFunc(ve, run::gen_runpair16, primReal(), SYM(Tan), formal(primReal(), SYM(deg), false, false));
-#line 163 "runpair.in"
+#line 163 "./runpair.in"
addFunc(ve, run::gen_runpair17, primReal(), SYM(aSin), formal(primReal(), SYM(x), false, false));
-#line 168 "runpair.in"
+#line 168 "./runpair.in"
addFunc(ve, run::gen_runpair18, primReal(), SYM(aCos), formal(primReal(), SYM(x), false, false));
-#line 173 "runpair.in"
+#line 173 "./runpair.in"
addFunc(ve, run::gen_runpair19, primReal(), SYM(aTan), formal(primReal(), SYM(x), false, false));
-#line 178 "runpair.in"
+#line 178 "./runpair.in"
addFunc(ve, run::gen_runpair20, primPair(), SYM(unit), formal(primPair(), SYM(z), false, false));
-#line 183 "runpair.in"
+#line 183 "./runpair.in"
addFunc(ve, run::gen_runpair21, primPair(), SYM(dir), formal(primReal(), SYM(degrees), false, false));
-#line 188 "runpair.in"
+#line 188 "./runpair.in"
addFunc(ve, run::gen_runpair22, primPair(), SYM(dir), formal(primPair(), SYM(z), false, true));
-#line 193 "runpair.in"
+#line 193 "./runpair.in"
addFunc(ve, run::gen_runpair23, primPair(), SYM(expi), formal(primReal(), SYM(angle), false, false));
-#line 198 "runpair.in"
+#line 198 "./runpair.in"
addFunc(ve, run::gen_runpair24, primPair(), SYM(exp), formal(primPair(), SYM(z), false, true));
-#line 203 "runpair.in"
+#line 203 "./runpair.in"
addFunc(ve, run::gen_runpair25, primPair(), SYM(log), formal(primPair(), SYM(z), false, true));
-#line 208 "runpair.in"
+#line 208 "./runpair.in"
addFunc(ve, run::gen_runpair26, primPair(), SYM(sin), formal(primPair(), SYM(z), false, true));
-#line 213 "runpair.in"
+#line 213 "./runpair.in"
addFunc(ve, run::gen_runpair27, primPair(), SYM(cos), formal(primPair(), SYM(z), false, true));
-#line 218 "runpair.in"
+#line 218 "./runpair.in"
addFunc(ve, run::gen_runpair28, primPair(), SYM(gamma), formal(primPair(), SYM(z), false, true));
-#line 224 "runpair.in"
+#line 224 "./runpair.in"
addFunc(ve, run::gen_runpair29, primPair(), SYM(conj), formal(primPair(), SYM(z), false, false));
-#line 229 "runpair.in"
+#line 229 "./runpair.in"
addFunc(ve, run::gen_runpair30, primPair(), SYM(realmult), formal(primPair(), SYM(z), false, false), formal(primPair(), SYM(w), false, false));
-#line 234 "runpair.in"
+#line 234 "./runpair.in"
addFunc(ve, run::gen_runpair31, primReal(), SYM(dot), formal(primPair(), SYM(z), false, true), formal(primPair(), SYM(w), false, true));
-#line 240 "runpair.in"
+#line 240 "./runpair.in"
addFunc(ve, run::gen_runpair32, primReal(), SYM(cross), formal(primPair(), SYM(z), false, true), formal(primPair(), SYM(w), false, true));
-#line 246 "runpair.in"
+#line 246 "./runpair.in"
addFunc(ve, run::gen_runpair33, primPair(), SYM(bezier), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false), formal(primPair(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 253 "runpair.in"
+#line 253 "./runpair.in"
addFunc(ve, run::gen_runpair34, primPair(), SYM(bezierP), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false), formal(primPair(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 258 "runpair.in"
+#line 258 "./runpair.in"
addFunc(ve, run::gen_runpair35, primPair(), SYM(bezierPP), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false), formal(primPair(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 263 "runpair.in"
+#line 263 "./runpair.in"
addFunc(ve, run::gen_runpair36, primPair(), SYM(bezierPPP), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false), formal(primPair(), SYM(d), false, false));
}
diff --git a/graphics/asymptote/runpair.h b/graphics/asymptote/runpair.h
index b53a7c02e9..11ccc61870 100644
--- a/graphics/asymptote/runpair.h
+++ b/graphics/asymptote/runpair.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runpair.in; changes will be overwritten *****/
-#ifndef runpair_H
-#define runpair_H
+#pragma once
namespace run {
void pairZero(vm::stack *);
void realRealToPair(vm::stack *);
@@ -10,4 +9,3 @@ void pairXPart(vm::stack *);
void pairYPart(vm::stack *);
}
-#endif // runpair_H
diff --git a/graphics/asymptote/runpath.cc b/graphics/asymptote/runpath.cc
index b346cecd73..2cd45df237 100644
--- a/graphics/asymptote/runpath.cc
+++ b/graphics/asymptote/runpath.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runpath.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runpath.in"
+#line 1 "./runpath.in"
/*****
* runpath.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -95,94 +95,94 @@ Int windingnumber(array *p, camp::pair z)
#endif
namespace run {
-#line 44 "runpath.in"
+#line 44 "./runpath.in"
void nullPath(stack *Stack)
{
-#line 45 "runpath.in"
+#line 45 "./runpath.in"
{Stack->push<path>(nullpath); return;}
}
-#line 49 "runpath.in"
+#line 49 "./runpath.in"
// bool ==(path a, path b);
void gen_runpath1(stack *Stack)
{
path b=vm::pop<path>(Stack);
path a=vm::pop<path>(Stack);
-#line 50 "runpath.in"
+#line 50 "./runpath.in"
{Stack->push<bool>(a == b); return;}
}
-#line 54 "runpath.in"
+#line 54 "./runpath.in"
// bool !=(path a, path b);
void gen_runpath2(stack *Stack)
{
path b=vm::pop<path>(Stack);
path a=vm::pop<path>(Stack);
-#line 55 "runpath.in"
+#line 55 "./runpath.in"
{Stack->push<bool>(!(a == b)); return;}
}
-#line 59 "runpath.in"
+#line 59 "./runpath.in"
// pair point(path p, Int t);
void gen_runpath3(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 60 "runpath.in"
+#line 60 "./runpath.in"
{Stack->push<pair>(p.point((Int) t)); return;}
}
-#line 64 "runpath.in"
+#line 64 "./runpath.in"
// pair point(path p, real t);
void gen_runpath4(stack *Stack)
{
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 65 "runpath.in"
+#line 65 "./runpath.in"
{Stack->push<pair>(p.point(t)); return;}
}
-#line 69 "runpath.in"
+#line 69 "./runpath.in"
// pair precontrol(path p, Int t);
void gen_runpath5(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 70 "runpath.in"
+#line 70 "./runpath.in"
{Stack->push<pair>(p.precontrol((Int) t)); return;}
}
-#line 74 "runpath.in"
+#line 74 "./runpath.in"
// pair precontrol(path p, real t);
void gen_runpath6(stack *Stack)
{
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 75 "runpath.in"
+#line 75 "./runpath.in"
{Stack->push<pair>(p.precontrol(t)); return;}
}
-#line 79 "runpath.in"
+#line 79 "./runpath.in"
// pair postcontrol(path p, Int t);
void gen_runpath7(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 80 "runpath.in"
+#line 80 "./runpath.in"
{Stack->push<pair>(p.postcontrol((Int) t)); return;}
}
-#line 84 "runpath.in"
+#line 84 "./runpath.in"
// pair postcontrol(path p, real t);
void gen_runpath8(stack *Stack)
{
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 85 "runpath.in"
+#line 85 "./runpath.in"
{Stack->push<pair>(p.postcontrol(t)); return;}
}
-#line 89 "runpath.in"
+#line 89 "./runpath.in"
// pair dir(path p, Int t, Int sign=0, bool normalize=true);
void gen_runpath9(stack *Stack)
{
@@ -190,49 +190,49 @@ void gen_runpath9(stack *Stack)
Int sign=vm::pop<Int>(Stack,0);
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 90 "runpath.in"
+#line 90 "./runpath.in"
{Stack->push<pair>(p.dir(t,sign,normalize)); return;}
}
-#line 94 "runpath.in"
+#line 94 "./runpath.in"
// pair dir(path p, real t, bool normalize=true);
void gen_runpath10(stack *Stack)
{
bool normalize=vm::pop<bool>(Stack,true);
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 95 "runpath.in"
+#line 95 "./runpath.in"
{Stack->push<pair>(p.dir(t,normalize)); return;}
}
-#line 99 "runpath.in"
+#line 99 "./runpath.in"
// pair accel(path p, Int t, Int sign=0);
void gen_runpath11(stack *Stack)
{
Int sign=vm::pop<Int>(Stack,0);
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 100 "runpath.in"
+#line 100 "./runpath.in"
{Stack->push<pair>(p.accel(t,sign)); return;}
}
-#line 104 "runpath.in"
+#line 104 "./runpath.in"
// pair accel(path p, real t);
void gen_runpath12(stack *Stack)
{
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 105 "runpath.in"
+#line 105 "./runpath.in"
{Stack->push<pair>(p.accel(t)); return;}
}
-#line 109 "runpath.in"
+#line 109 "./runpath.in"
// real radius(path p, real t);
void gen_runpath13(stack *Stack)
{
real t=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 110 "runpath.in"
+#line 110 "./runpath.in"
pair v=p.dir(t,false);
pair a=p.accel(t);
real d=dot(a,v);
@@ -243,38 +243,38 @@ void gen_runpath13(stack *Stack)
{Stack->push<real>(denom > 0 ? r/sqrt(denom) : 0.0); return;}
}
-#line 121 "runpath.in"
+#line 121 "./runpath.in"
// path reverse(path p);
void gen_runpath14(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 122 "runpath.in"
+#line 122 "./runpath.in"
{Stack->push<path>(p.reverse()); return;}
}
-#line 126 "runpath.in"
+#line 126 "./runpath.in"
// path subpath(path p, Int a, Int b);
void gen_runpath15(stack *Stack)
{
Int b=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 127 "runpath.in"
+#line 127 "./runpath.in"
{Stack->push<path>(p.subpath((Int) a, (Int) b)); return;}
}
-#line 131 "runpath.in"
+#line 131 "./runpath.in"
// path subpath(path p, real a, real b);
void gen_runpath16(stack *Stack)
{
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 132 "runpath.in"
+#line 132 "./runpath.in"
{Stack->push<path>(p.subpath(a,b)); return;}
}
-#line 136 "runpath.in"
+#line 136 "./runpath.in"
// path nurb(pair z0, pair z1, pair z2, pair z3, real w0, real w1, real w2, real w3, Int m);
void gen_runpath17(stack *Stack)
{
@@ -287,66 +287,66 @@ void gen_runpath17(stack *Stack)
pair z2=vm::pop<pair>(Stack);
pair z1=vm::pop<pair>(Stack);
pair z0=vm::pop<pair>(Stack);
-#line 138 "runpath.in"
+#line 138 "./runpath.in"
{Stack->push<path>(nurb(z0,z1,z2,z3,w0,w1,w2,w3,m)); return;}
}
-#line 142 "runpath.in"
+#line 142 "./runpath.in"
// Int length(path p);
void gen_runpath18(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 143 "runpath.in"
+#line 143 "./runpath.in"
{Stack->push<Int>(p.length()); return;}
}
-#line 147 "runpath.in"
+#line 147 "./runpath.in"
// bool cyclic(path p);
void gen_runpath19(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 148 "runpath.in"
+#line 148 "./runpath.in"
{Stack->push<bool>(p.cyclic()); return;}
}
-#line 152 "runpath.in"
+#line 152 "./runpath.in"
// bool straight(path p, Int t);
void gen_runpath20(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path p=vm::pop<path>(Stack);
-#line 153 "runpath.in"
+#line 153 "./runpath.in"
{Stack->push<bool>(p.straight(t)); return;}
}
-#line 157 "runpath.in"
+#line 157 "./runpath.in"
// path unstraighten(path p);
void gen_runpath21(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 158 "runpath.in"
+#line 158 "./runpath.in"
{Stack->push<path>(p.unstraighten()); return;}
}
-#line 162 "runpath.in"
+#line 162 "./runpath.in"
// bool piecewisestraight(path p);
void gen_runpath22(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 163 "runpath.in"
+#line 163 "./runpath.in"
{Stack->push<bool>(p.piecewisestraight()); return;}
}
-#line 167 "runpath.in"
+#line 167 "./runpath.in"
// real arclength(path p);
void gen_runpath23(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 168 "runpath.in"
+#line 168 "./runpath.in"
{Stack->push<real>(p.arclength()); return;}
}
-#line 172 "runpath.in"
+#line 172 "./runpath.in"
// real arclength(pair z0, pair c0, pair c1, pair z1);
void gen_runpath24(stack *Stack)
{
@@ -354,38 +354,38 @@ void gen_runpath24(stack *Stack)
pair c1=vm::pop<pair>(Stack);
pair c0=vm::pop<pair>(Stack);
pair z0=vm::pop<pair>(Stack);
-#line 173 "runpath.in"
+#line 173 "./runpath.in"
{Stack->push<real>(arcLength(z0,c0,c1,z1)); return;}
}
-#line 177 "runpath.in"
+#line 177 "./runpath.in"
// real arctime(path p, real L);
void gen_runpath25(stack *Stack)
{
real L=vm::pop<real>(Stack);
path p=vm::pop<path>(Stack);
-#line 178 "runpath.in"
+#line 178 "./runpath.in"
{Stack->push<real>(p.arctime(L)); return;}
}
-#line 182 "runpath.in"
+#line 182 "./runpath.in"
// real dirtime(path p, pair z);
void gen_runpath26(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
path p=vm::pop<path>(Stack);
-#line 183 "runpath.in"
+#line 183 "./runpath.in"
{Stack->push<real>(p.directiontime(z)); return;}
}
-#line 187 "runpath.in"
+#line 187 "./runpath.in"
// realarray* intersect(path p, path q, real fuzz=-1);
void gen_runpath27(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
path q=vm::pop<path>(Stack);
path p=vm::pop<path>(Stack);
-#line 188 "runpath.in"
+#line 188 "./runpath.in"
bool exact=fuzz <= 0.0;
if(fuzz < 0)
fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -401,14 +401,14 @@ void gen_runpath27(stack *Stack)
{Stack->push<realarray*>(new array(0)); return;}
}
-#line 204 "runpath.in"
+#line 204 "./runpath.in"
// realarray2* intersections(path p, path q, real fuzz=-1);
void gen_runpath28(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
path q=vm::pop<path>(Stack);
path p=vm::pop<path>(Stack);
-#line 205 "runpath.in"
+#line 205 "./runpath.in"
bool exact=fuzz <= 0.0;
if(fuzz < 0.0)
fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -438,7 +438,7 @@ void gen_runpath28(stack *Stack)
{Stack->push<realarray2*>(V); return;}
}
-#line 235 "runpath.in"
+#line 235 "./runpath.in"
// realarray* intersections(path p, explicit pair a, explicit pair b, real fuzz=-1);
void gen_runpath29(stack *Stack)
{
@@ -446,7 +446,7 @@ void gen_runpath29(stack *Stack)
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
path p=vm::pop<path>(Stack);
-#line 236 "runpath.in"
+#line 236 "./runpath.in"
if(fuzz < 0)
fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
::max(length(a),length(b)));
@@ -462,7 +462,7 @@ void gen_runpath29(stack *Stack)
// Return the intersection point of the extensions of the line segments
// PQ and pq.
-#line 252 "runpath.in"
+#line 252 "./runpath.in"
// pair extension(pair P, pair Q, pair p, pair q);
void gen_runpath30(stack *Stack)
{
@@ -470,7 +470,7 @@ void gen_runpath30(stack *Stack)
pair p=vm::pop<pair>(Stack);
pair Q=vm::pop<pair>(Stack);
pair P=vm::pop<pair>(Stack);
-#line 253 "runpath.in"
+#line 253 "./runpath.in"
pair ac=P-Q;
pair bd=q-p;
real det=ac.getx()*bd.gety()-ac.gety()*bd.getx();
@@ -478,49 +478,49 @@ void gen_runpath30(stack *Stack)
{Stack->push<pair>(P+((p.getx()-P.getx())*bd.gety()-(p.gety()-P.gety())*bd.getx())*ac/det); return;}
}
-#line 261 "runpath.in"
+#line 261 "./runpath.in"
// Int size(path p);
void gen_runpath31(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 262 "runpath.in"
+#line 262 "./runpath.in"
{Stack->push<Int>(p.size()); return;}
}
-#line 266 "runpath.in"
+#line 266 "./runpath.in"
// path &(path p, path q);
void gen_runpath32(stack *Stack)
{
path q=vm::pop<path>(Stack);
path p=vm::pop<path>(Stack);
-#line 267 "runpath.in"
+#line 267 "./runpath.in"
{Stack->push<path>(camp::concat(p,q)); return;}
}
-#line 271 "runpath.in"
+#line 271 "./runpath.in"
// pair min(explicit path p);
void gen_runpath33(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 272 "runpath.in"
+#line 272 "./runpath.in"
{Stack->push<pair>(p.min()); return;}
}
-#line 276 "runpath.in"
+#line 276 "./runpath.in"
// pair max(explicit path p);
void gen_runpath34(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 277 "runpath.in"
+#line 277 "./runpath.in"
{Stack->push<pair>(p.max()); return;}
}
-#line 281 "runpath.in"
+#line 281 "./runpath.in"
// Int size(patharray *p);
void gen_runpath35(stack *Stack)
{
patharray * p=vm::pop<patharray *>(Stack);
-#line 282 "runpath.in"
+#line 282 "./runpath.in"
size_t size=checkArray(p);
Int count=0;
for (size_t i = 0; i < size; i++)
@@ -528,12 +528,12 @@ void gen_runpath35(stack *Stack)
{Stack->push<Int>(count); return;}
}
-#line 290 "runpath.in"
+#line 290 "./runpath.in"
// pair min(patharray *p);
void gen_runpath36(stack *Stack)
{
patharray * p=vm::pop<patharray *>(Stack);
-#line 291 "runpath.in"
+#line 291 "./runpath.in"
size_t size=checkArray(p);
if(size == 0)
@@ -556,12 +556,12 @@ void gen_runpath36(stack *Stack)
{Stack->push<pair>(pair(minx, miny)); return;}
}
-#line 314 "runpath.in"
+#line 314 "./runpath.in"
// pair max(patharray *p);
void gen_runpath37(stack *Stack)
{
patharray * p=vm::pop<patharray *>(Stack);
-#line 315 "runpath.in"
+#line 315 "./runpath.in"
size_t size=checkArray(p);
if(size == 0)
@@ -584,13 +584,13 @@ void gen_runpath37(stack *Stack)
{Stack->push<pair>(pair(maxx, maxy)); return;}
}
-#line 338 "runpath.in"
+#line 338 "./runpath.in"
// pair minAfterTransform(transform t, patharray *p);
void gen_runpath38(stack *Stack)
{
patharray * p=vm::pop<patharray *>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 339 "runpath.in"
+#line 339 "./runpath.in"
size_t size=checkArray(p);
if(size == 0)
@@ -613,13 +613,13 @@ void gen_runpath38(stack *Stack)
{Stack->push<pair>(pair(minx, miny)); return;}
}
-#line 362 "runpath.in"
+#line 362 "./runpath.in"
// pair maxAfterTransform(transform t, patharray *p);
void gen_runpath39(stack *Stack)
{
patharray * p=vm::pop<patharray *>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 363 "runpath.in"
+#line 363 "./runpath.in"
size_t size=checkArray(p);
if(size == 0)
@@ -642,12 +642,12 @@ void gen_runpath39(stack *Stack)
{Stack->push<pair>(pair(maxx, maxy)); return;}
}
-#line 386 "runpath.in"
+#line 386 "./runpath.in"
// realarray* mintimes(path p);
void gen_runpath40(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 387 "runpath.in"
+#line 387 "./runpath.in"
array *V=new array(2);
pair z=p.mintimes();
(*V)[0]=z.getx();
@@ -655,12 +655,12 @@ void gen_runpath40(stack *Stack)
{Stack->push<realarray*>(V); return;}
}
-#line 395 "runpath.in"
+#line 395 "./runpath.in"
// realarray* maxtimes(path p);
void gen_runpath41(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 396 "runpath.in"
+#line 396 "./runpath.in"
array *V=new array(2);
pair z=p.maxtimes();
(*V)[0]=z.getx();
@@ -668,7 +668,7 @@ void gen_runpath41(stack *Stack)
{Stack->push<realarray*>(V); return;}
}
-#line 404 "runpath.in"
+#line 404 "./runpath.in"
// real relativedistance(real theta, real phi, real t, bool atleast);
void gen_runpath42(stack *Stack)
{
@@ -676,39 +676,39 @@ void gen_runpath42(stack *Stack)
real t=vm::pop<real>(Stack);
real phi=vm::pop<real>(Stack);
real theta=vm::pop<real>(Stack);
-#line 405 "runpath.in"
+#line 405 "./runpath.in"
{Stack->push<real>(camp::velocity(theta,phi,tension(t,atleast))); return;}
}
-#line 409 "runpath.in"
+#line 409 "./runpath.in"
// Int windingnumber(patharray *p, pair z);
void gen_runpath43(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
patharray * p=vm::pop<patharray *>(Stack);
-#line 410 "runpath.in"
+#line 410 "./runpath.in"
{Stack->push<Int>(windingnumber(p,z)); return;}
}
-#line 414 "runpath.in"
+#line 414 "./runpath.in"
// bool inside(explicit patharray *g, pair z, pen fillrule=CURRENTPEN);
void gen_runpath44(stack *Stack)
{
pen fillrule=vm::pop<pen>(Stack,CURRENTPEN);
pair z=vm::pop<pair>(Stack);
patharray * g=vm::pop<patharray *>(Stack);
-#line 415 "runpath.in"
+#line 415 "./runpath.in"
{Stack->push<bool>(fillrule.inside(windingnumber(g,z))); return;}
}
-#line 419 "runpath.in"
+#line 419 "./runpath.in"
// bool inside(path g, pair z, pen fillrule=CURRENTPEN);
void gen_runpath45(stack *Stack)
{
pen fillrule=vm::pop<pen>(Stack,CURRENTPEN);
pair z=vm::pop<pair>(Stack);
path g=vm::pop<path>(Stack);
-#line 420 "runpath.in"
+#line 420 "./runpath.in"
{Stack->push<bool>(fillrule.inside(g.windingnumber(z))); return;}
}
@@ -721,14 +721,14 @@ void gen_runpath45(stack *Stack)
// |b.x b.y 1|
// |c.x c.y 1|
//
-#line 433 "runpath.in"
+#line 433 "./runpath.in"
// real orient(pair a, pair b, pair c);
void gen_runpath46(stack *Stack)
{
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 434 "runpath.in"
+#line 434 "./runpath.in"
{Stack->push<real>(orient2d(a,b,c)); return;}
}
@@ -740,7 +740,7 @@ void gen_runpath46(stack *Stack)
// |b.x b.y b.x^2+b.y^2 1|
// |c.x c.y c.x^2+c.y^2 1|
// |d.x d.y d.x^2+d.y^2 1|
-#line 446 "runpath.in"
+#line 446 "./runpath.in"
// real incircle(pair a, pair b, pair c, pair d);
void gen_runpath47(stack *Stack)
{
@@ -748,7 +748,7 @@ void gen_runpath47(stack *Stack)
pair c=vm::pop<pair>(Stack);
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 447 "runpath.in"
+#line 447 "./runpath.in"
{Stack->push<real>(incircle(a.getx(),a.gety(),b.getx(),b.gety(),c.getx(),c.gety(),
d.getx(),d.gety())); return;}
}
@@ -759,101 +759,101 @@ namespace trans {
void gen_runpath_venv(venv &ve)
{
-#line 44 "runpath.in"
+#line 44 "./runpath.in"
REGISTER_BLTIN(run::nullPath,"nullPath");
-#line 49 "runpath.in"
+#line 49 "./runpath.in"
addFunc(ve, run::gen_runpath1, primBoolean(), SYM_EQ, formal(primPath(), SYM(a), false, false), formal(primPath(), SYM(b), false, false));
-#line 54 "runpath.in"
+#line 54 "./runpath.in"
addFunc(ve, run::gen_runpath2, primBoolean(), SYM_NEQ, formal(primPath(), SYM(a), false, false), formal(primPath(), SYM(b), false, false));
-#line 59 "runpath.in"
+#line 59 "./runpath.in"
addFunc(ve, run::gen_runpath3, primPair(), SYM(point), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 64 "runpath.in"
+#line 64 "./runpath.in"
addFunc(ve, run::gen_runpath4, primPair(), SYM(point), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 69 "runpath.in"
+#line 69 "./runpath.in"
addFunc(ve, run::gen_runpath5, primPair(), SYM(precontrol), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 74 "runpath.in"
+#line 74 "./runpath.in"
addFunc(ve, run::gen_runpath6, primPair(), SYM(precontrol), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 79 "runpath.in"
+#line 79 "./runpath.in"
addFunc(ve, run::gen_runpath7, primPair(), SYM(postcontrol), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 84 "runpath.in"
+#line 84 "./runpath.in"
addFunc(ve, run::gen_runpath8, primPair(), SYM(postcontrol), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 89 "runpath.in"
+#line 89 "./runpath.in"
addFunc(ve, run::gen_runpath9, primPair(), SYM(dir), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false), formal(primInt(), SYM(sign), true, false), formal(primBoolean(), SYM(normalize), true, false));
-#line 94 "runpath.in"
+#line 94 "./runpath.in"
addFunc(ve, run::gen_runpath10, primPair(), SYM(dir), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false), formal(primBoolean(), SYM(normalize), true, false));
-#line 99 "runpath.in"
+#line 99 "./runpath.in"
addFunc(ve, run::gen_runpath11, primPair(), SYM(accel), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false), formal(primInt(), SYM(sign), true, false));
-#line 104 "runpath.in"
+#line 104 "./runpath.in"
addFunc(ve, run::gen_runpath12, primPair(), SYM(accel), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 109 "runpath.in"
+#line 109 "./runpath.in"
addFunc(ve, run::gen_runpath13, primReal(), SYM(radius), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 121 "runpath.in"
+#line 121 "./runpath.in"
addFunc(ve, run::gen_runpath14, primPath(), SYM(reverse), formal(primPath(), SYM(p), false, false));
-#line 126 "runpath.in"
+#line 126 "./runpath.in"
addFunc(ve, run::gen_runpath15, primPath(), SYM(subpath), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false));
-#line 131 "runpath.in"
+#line 131 "./runpath.in"
addFunc(ve, run::gen_runpath16, primPath(), SYM(subpath), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false));
-#line 136 "runpath.in"
+#line 136 "./runpath.in"
addFunc(ve, run::gen_runpath17, primPath(), SYM(nurb), formal(primPair(), SYM(z0), false, false), formal(primPair(), SYM(z1), false, false), formal(primPair(), SYM(z2), false, false), formal(primPair(), SYM(z3), false, false), formal(primReal(), SYM(w0), false, false), formal(primReal(), SYM(w1), false, false), formal(primReal(), SYM(w2), false, false), formal(primReal(), SYM(w3), false, false), formal(primInt(), SYM(m), false, false));
-#line 142 "runpath.in"
+#line 142 "./runpath.in"
addFunc(ve, run::gen_runpath18, primInt(), SYM(length), formal(primPath(), SYM(p), false, false));
-#line 147 "runpath.in"
+#line 147 "./runpath.in"
addFunc(ve, run::gen_runpath19, primBoolean(), SYM(cyclic), formal(primPath(), SYM(p), false, false));
-#line 152 "runpath.in"
+#line 152 "./runpath.in"
addFunc(ve, run::gen_runpath20, primBoolean(), SYM(straight), formal(primPath(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 157 "runpath.in"
+#line 157 "./runpath.in"
addFunc(ve, run::gen_runpath21, primPath(), SYM(unstraighten), formal(primPath(), SYM(p), false, false));
-#line 162 "runpath.in"
+#line 162 "./runpath.in"
addFunc(ve, run::gen_runpath22, primBoolean(), SYM(piecewisestraight), formal(primPath(), SYM(p), false, false));
-#line 167 "runpath.in"
+#line 167 "./runpath.in"
addFunc(ve, run::gen_runpath23, primReal(), SYM(arclength), formal(primPath(), SYM(p), false, false));
-#line 172 "runpath.in"
+#line 172 "./runpath.in"
addFunc(ve, run::gen_runpath24, primReal(), SYM(arclength), formal(primPair(), SYM(z0), false, false), formal(primPair(), SYM(c0), false, false), formal(primPair(), SYM(c1), false, false), formal(primPair(), SYM(z1), false, false));
-#line 177 "runpath.in"
+#line 177 "./runpath.in"
addFunc(ve, run::gen_runpath25, primReal(), SYM(arctime), formal(primPath(), SYM(p), false, false), formal(primReal(), SYM(l), false, false));
-#line 182 "runpath.in"
+#line 182 "./runpath.in"
addFunc(ve, run::gen_runpath26, primReal(), SYM(dirtime), formal(primPath(), SYM(p), false, false), formal(primPair(), SYM(z), false, false));
-#line 187 "runpath.in"
+#line 187 "./runpath.in"
addFunc(ve, run::gen_runpath27, realArray(), SYM(intersect), formal(primPath(), SYM(p), false, false), formal(primPath(), SYM(q), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 204 "runpath.in"
+#line 204 "./runpath.in"
addFunc(ve, run::gen_runpath28, realArray2(), SYM(intersections), formal(primPath(), SYM(p), false, false), formal(primPath(), SYM(q), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 235 "runpath.in"
+#line 235 "./runpath.in"
addFunc(ve, run::gen_runpath29, realArray(), SYM(intersections), formal(primPath(), SYM(p), false, false), formal(primPair(), SYM(a), false, true), formal(primPair(), SYM(b), false, true), formal(primReal(), SYM(fuzz), true, false));
-#line 250 "runpath.in"
+#line 250 "./runpath.in"
addFunc(ve, run::gen_runpath30, primPair(), SYM(extension), formal(primPair(), SYM(p), false, false), formal(primPair(), SYM(q), false, false), formal(primPair(), SYM(p), false, false), formal(primPair(), SYM(q), false, false));
-#line 261 "runpath.in"
+#line 261 "./runpath.in"
addFunc(ve, run::gen_runpath31, primInt(), SYM(size), formal(primPath(), SYM(p), false, false));
-#line 266 "runpath.in"
+#line 266 "./runpath.in"
addFunc(ve, run::gen_runpath32, primPath(), SYM_AMPERSAND, formal(primPath(), SYM(p), false, false), formal(primPath(), SYM(q), false, false));
-#line 271 "runpath.in"
+#line 271 "./runpath.in"
addFunc(ve, run::gen_runpath33, primPair(), SYM(min), formal(primPath(), SYM(p), false, true));
-#line 276 "runpath.in"
+#line 276 "./runpath.in"
addFunc(ve, run::gen_runpath34, primPair(), SYM(max), formal(primPath(), SYM(p), false, true));
-#line 281 "runpath.in"
+#line 281 "./runpath.in"
addFunc(ve, run::gen_runpath35, primInt(), SYM(size), formal(pathArray(), SYM(p), false, false));
-#line 290 "runpath.in"
+#line 290 "./runpath.in"
addFunc(ve, run::gen_runpath36, primPair(), SYM(min), formal(pathArray(), SYM(p), false, false));
-#line 314 "runpath.in"
+#line 314 "./runpath.in"
addFunc(ve, run::gen_runpath37, primPair(), SYM(max), formal(pathArray(), SYM(p), false, false));
-#line 338 "runpath.in"
+#line 338 "./runpath.in"
addFunc(ve, run::gen_runpath38, primPair(), SYM(minAfterTransform), formal(primTransform(), SYM(t), false, false), formal(pathArray(), SYM(p), false, false));
-#line 362 "runpath.in"
+#line 362 "./runpath.in"
addFunc(ve, run::gen_runpath39, primPair(), SYM(maxAfterTransform), formal(primTransform(), SYM(t), false, false), formal(pathArray(), SYM(p), false, false));
-#line 386 "runpath.in"
+#line 386 "./runpath.in"
addFunc(ve, run::gen_runpath40, realArray(), SYM(mintimes), formal(primPath(), SYM(p), false, false));
-#line 395 "runpath.in"
+#line 395 "./runpath.in"
addFunc(ve, run::gen_runpath41, realArray(), SYM(maxtimes), formal(primPath(), SYM(p), false, false));
-#line 404 "runpath.in"
+#line 404 "./runpath.in"
addFunc(ve, run::gen_runpath42, primReal(), SYM(relativedistance), formal(primReal(), SYM(theta), false, false), formal(primReal(), SYM(phi), false, false), formal(primReal(), SYM(t), false, false), formal(primBoolean(), SYM(atleast), false, false));
-#line 409 "runpath.in"
+#line 409 "./runpath.in"
addFunc(ve, run::gen_runpath43, primInt(), SYM(windingnumber), formal(pathArray(), SYM(p), false, false), formal(primPair(), SYM(z), false, false));
-#line 414 "runpath.in"
+#line 414 "./runpath.in"
addFunc(ve, run::gen_runpath44, primBoolean(), SYM(inside), formal(pathArray(), SYM(g), false, true), formal(primPair(), SYM(z), false, false), formal(primPen(), SYM(fillrule), true, false));
-#line 419 "runpath.in"
+#line 419 "./runpath.in"
addFunc(ve, run::gen_runpath45, primBoolean(), SYM(inside), formal(primPath(), SYM(g), false, false), formal(primPair(), SYM(z), false, false), formal(primPen(), SYM(fillrule), true, false));
-#line 424 "runpath.in"
+#line 424 "./runpath.in"
addFunc(ve, run::gen_runpath46, primReal(), SYM(orient), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false));
-#line 438 "runpath.in"
+#line 438 "./runpath.in"
addFunc(ve, run::gen_runpath47, primReal(), SYM(incircle), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false), formal(primPair(), SYM(c), false, false), formal(primPair(), SYM(d), false, false));
}
diff --git a/graphics/asymptote/runpath.h b/graphics/asymptote/runpath.h
index 18ee20cb57..ef1e6ed25b 100644
--- a/graphics/asymptote/runpath.h
+++ b/graphics/asymptote/runpath.h
@@ -1,9 +1,7 @@
/***** Autogenerated from runpath.in; changes will be overwritten *****/
-#ifndef runpath_H
-#define runpath_H
+#pragma once
namespace run {
void nullPath(vm::stack *);
}
-#endif // runpath_H
diff --git a/graphics/asymptote/runpath3d.cc b/graphics/asymptote/runpath3d.cc
index cb80e3b692..bbbdbb6747 100644
--- a/graphics/asymptote/runpath3d.cc
+++ b/graphics/asymptote/runpath3d.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runpath3d.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runpath3d.in"
+#line 1 "./runpath3d.in"
/*****
* runpath3.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -91,7 +91,7 @@ using types::tripleArray2;
#endif
namespace run {
-#line 40 "runpath3d.in"
+#line 40 "./runpath3d.in"
// path3 path3(triplearray *pre, triplearray *point, triplearray *post, boolarray *straight, bool cyclic);
void gen_runpath3d0(stack *Stack)
{
@@ -100,7 +100,7 @@ void gen_runpath3d0(stack *Stack)
triplearray * post=vm::pop<triplearray *>(Stack);
triplearray * point=vm::pop<triplearray *>(Stack);
triplearray * pre=vm::pop<triplearray *>(Stack);
-#line 42 "runpath3d.in"
+#line 42 "./runpath3d.in"
size_t n=checkArrays(pre,point);
checkEqual(n,checkArray(post));
checkEqual(n,checkArray(straight));
@@ -115,94 +115,94 @@ void gen_runpath3d0(stack *Stack)
{Stack->push<path3>(path3(nodes,(Int) n,cyclic)); return;}
}
-#line 57 "runpath3d.in"
+#line 57 "./runpath3d.in"
void nullPath3(stack *Stack)
{
-#line 58 "runpath3d.in"
+#line 58 "./runpath3d.in"
{Stack->push<path3>(nullpath3); return;}
}
-#line 62 "runpath3d.in"
+#line 62 "./runpath3d.in"
// bool ==(path3 a, path3 b);
void gen_runpath3d2(stack *Stack)
{
path3 b=vm::pop<path3>(Stack);
path3 a=vm::pop<path3>(Stack);
-#line 63 "runpath3d.in"
+#line 63 "./runpath3d.in"
{Stack->push<bool>(a == b); return;}
}
-#line 67 "runpath3d.in"
+#line 67 "./runpath3d.in"
// bool !=(path3 a, path3 b);
void gen_runpath3d3(stack *Stack)
{
path3 b=vm::pop<path3>(Stack);
path3 a=vm::pop<path3>(Stack);
-#line 68 "runpath3d.in"
+#line 68 "./runpath3d.in"
{Stack->push<bool>(!(a == b)); return;}
}
-#line 72 "runpath3d.in"
+#line 72 "./runpath3d.in"
// triple point(path3 p, Int t);
void gen_runpath3d4(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 73 "runpath3d.in"
+#line 73 "./runpath3d.in"
{Stack->push<triple>(p.point((Int) t)); return;}
}
-#line 77 "runpath3d.in"
+#line 77 "./runpath3d.in"
// triple point(path3 p, real t);
void gen_runpath3d5(stack *Stack)
{
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 78 "runpath3d.in"
+#line 78 "./runpath3d.in"
{Stack->push<triple>(p.point(t)); return;}
}
-#line 82 "runpath3d.in"
+#line 82 "./runpath3d.in"
// triple precontrol(path3 p, Int t);
void gen_runpath3d6(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 83 "runpath3d.in"
+#line 83 "./runpath3d.in"
{Stack->push<triple>(p.precontrol((Int) t)); return;}
}
-#line 87 "runpath3d.in"
+#line 87 "./runpath3d.in"
// triple precontrol(path3 p, real t);
void gen_runpath3d7(stack *Stack)
{
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 88 "runpath3d.in"
+#line 88 "./runpath3d.in"
{Stack->push<triple>(p.precontrol(t)); return;}
}
-#line 92 "runpath3d.in"
+#line 92 "./runpath3d.in"
// triple postcontrol(path3 p, Int t);
void gen_runpath3d8(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 93 "runpath3d.in"
+#line 93 "./runpath3d.in"
{Stack->push<triple>(p.postcontrol((Int) t)); return;}
}
-#line 97 "runpath3d.in"
+#line 97 "./runpath3d.in"
// triple postcontrol(path3 p, real t);
void gen_runpath3d9(stack *Stack)
{
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 98 "runpath3d.in"
+#line 98 "./runpath3d.in"
{Stack->push<triple>(p.postcontrol(t)); return;}
}
-#line 102 "runpath3d.in"
+#line 102 "./runpath3d.in"
// triple dir(path3 p, Int t, Int sign=0, bool normalize=true);
void gen_runpath3d10(stack *Stack)
{
@@ -210,49 +210,49 @@ void gen_runpath3d10(stack *Stack)
Int sign=vm::pop<Int>(Stack,0);
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 103 "runpath3d.in"
+#line 103 "./runpath3d.in"
{Stack->push<triple>(p.dir(t,sign,normalize)); return;}
}
-#line 107 "runpath3d.in"
+#line 107 "./runpath3d.in"
// triple dir(path3 p, real t, bool normalize=true);
void gen_runpath3d11(stack *Stack)
{
bool normalize=vm::pop<bool>(Stack,true);
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 108 "runpath3d.in"
+#line 108 "./runpath3d.in"
{Stack->push<triple>(p.dir(t,normalize)); return;}
}
-#line 112 "runpath3d.in"
+#line 112 "./runpath3d.in"
// triple accel(path3 p, Int t, Int sign=0);
void gen_runpath3d12(stack *Stack)
{
Int sign=vm::pop<Int>(Stack,0);
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 113 "runpath3d.in"
+#line 113 "./runpath3d.in"
{Stack->push<triple>(p.accel(t,sign)); return;}
}
-#line 117 "runpath3d.in"
+#line 117 "./runpath3d.in"
// triple accel(path3 p, real t);
void gen_runpath3d13(stack *Stack)
{
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 118 "runpath3d.in"
+#line 118 "./runpath3d.in"
{Stack->push<triple>(p.accel(t)); return;}
}
-#line 122 "runpath3d.in"
+#line 122 "./runpath3d.in"
// real radius(path3 p, real t);
void gen_runpath3d14(stack *Stack)
{
real t=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 123 "runpath3d.in"
+#line 123 "./runpath3d.in"
triple v=p.dir(t,false);
triple a=p.accel(t);
real d=dot(a,v);
@@ -263,7 +263,7 @@ void gen_runpath3d14(stack *Stack)
{Stack->push<real>(denom > 0 ? r/sqrt(denom) : 0.0); return;}
}
-#line 134 "runpath3d.in"
+#line 134 "./runpath3d.in"
// real radius(triple z0, triple c0, triple c1, triple z1, real t);
void gen_runpath3d15(stack *Stack)
{
@@ -272,7 +272,7 @@ void gen_runpath3d15(stack *Stack)
triple c1=vm::pop<triple>(Stack);
triple c0=vm::pop<triple>(Stack);
triple z0=vm::pop<triple>(Stack);
-#line 135 "runpath3d.in"
+#line 135 "./runpath3d.in"
triple v=(3.0*(z1-z0)+9.0*(c0-c1))*t*t+(6.0*(z0+c1)-12.0*c0)*t+3.0*(c0-z0);
triple a=6.0*(z1-z0+3.0*(c0-c1))*t+6.0*(z0+c1)-12.0*c0;
real d=dot(a,v);
@@ -283,77 +283,77 @@ void gen_runpath3d15(stack *Stack)
{Stack->push<real>(denom > 0 ? r/sqrt(denom) : 0.0); return;}
}
-#line 146 "runpath3d.in"
+#line 146 "./runpath3d.in"
// path3 reverse(path3 p);
void gen_runpath3d16(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 147 "runpath3d.in"
+#line 147 "./runpath3d.in"
{Stack->push<path3>(p.reverse()); return;}
}
-#line 151 "runpath3d.in"
+#line 151 "./runpath3d.in"
// path3 subpath(path3 p, Int a, Int b);
void gen_runpath3d17(stack *Stack)
{
Int b=vm::pop<Int>(Stack);
Int a=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 152 "runpath3d.in"
+#line 152 "./runpath3d.in"
{Stack->push<path3>(p.subpath((Int) a, (Int) b)); return;}
}
-#line 156 "runpath3d.in"
+#line 156 "./runpath3d.in"
// path3 subpath(path3 p, real a, real b);
void gen_runpath3d18(stack *Stack)
{
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 157 "runpath3d.in"
+#line 157 "./runpath3d.in"
{Stack->push<path3>(p.subpath(a,b)); return;}
}
-#line 161 "runpath3d.in"
+#line 161 "./runpath3d.in"
// Int length(path3 p);
void gen_runpath3d19(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 162 "runpath3d.in"
+#line 162 "./runpath3d.in"
{Stack->push<Int>(p.length()); return;}
}
-#line 166 "runpath3d.in"
+#line 166 "./runpath3d.in"
// bool cyclic(path3 p);
void gen_runpath3d20(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 167 "runpath3d.in"
+#line 167 "./runpath3d.in"
{Stack->push<bool>(p.cyclic()); return;}
}
-#line 171 "runpath3d.in"
+#line 171 "./runpath3d.in"
// bool straight(path3 p, Int t);
void gen_runpath3d21(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 172 "runpath3d.in"
+#line 172 "./runpath3d.in"
{Stack->push<bool>(p.straight(t)); return;}
}
-#line 176 "runpath3d.in"
+#line 176 "./runpath3d.in"
// path3 unstraighten(path3 p);
void gen_runpath3d22(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 177 "runpath3d.in"
+#line 177 "./runpath3d.in"
{Stack->push<path3>(p.unstraighten()); return;}
}
// return the maximum distance squared of points c0 and c1 from
// the respective internal control points of z0--z1.
-#line 183 "runpath3d.in"
+#line 183 "./runpath3d.in"
// real straightness(triple z0, triple c0, triple c1, triple z1);
void gen_runpath3d23(stack *Stack)
{
@@ -361,42 +361,42 @@ void gen_runpath3d23(stack *Stack)
triple c1=vm::pop<triple>(Stack);
triple c0=vm::pop<triple>(Stack);
triple z0=vm::pop<triple>(Stack);
-#line 184 "runpath3d.in"
+#line 184 "./runpath3d.in"
{Stack->push<real>(Straightness(z0,c0,c1,z1)); return;}
}
// return the straightness of segment i of path3 g.
-#line 189 "runpath3d.in"
+#line 189 "./runpath3d.in"
// real straightness(path3 p, Int t);
void gen_runpath3d24(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 190 "runpath3d.in"
+#line 190 "./runpath3d.in"
if(p.straight(t)) {Stack->push<real>(0); return;}
{Stack->push<real>(Straightness(p.point(t),p.postcontrol(t),p.precontrol(t+1),
p.point(t+1))); return;}
}
-#line 196 "runpath3d.in"
+#line 196 "./runpath3d.in"
// bool piecewisestraight(path3 p);
void gen_runpath3d25(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 197 "runpath3d.in"
+#line 197 "./runpath3d.in"
{Stack->push<bool>(p.piecewisestraight()); return;}
}
-#line 201 "runpath3d.in"
+#line 201 "./runpath3d.in"
// real arclength(path3 p);
void gen_runpath3d26(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 202 "runpath3d.in"
+#line 202 "./runpath3d.in"
{Stack->push<real>(p.arclength()); return;}
}
-#line 206 "runpath3d.in"
+#line 206 "./runpath3d.in"
// real arclength(triple z0, triple c0, triple c1, triple z1);
void gen_runpath3d27(stack *Stack)
{
@@ -404,28 +404,28 @@ void gen_runpath3d27(stack *Stack)
triple c1=vm::pop<triple>(Stack);
triple c0=vm::pop<triple>(Stack);
triple z0=vm::pop<triple>(Stack);
-#line 207 "runpath3d.in"
+#line 207 "./runpath3d.in"
{Stack->push<real>(arcLength(z0,c0,c1,z1)); return;}
}
-#line 211 "runpath3d.in"
+#line 211 "./runpath3d.in"
// real arctime(path3 p, real dval);
void gen_runpath3d28(stack *Stack)
{
real dval=vm::pop<real>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 212 "runpath3d.in"
+#line 212 "./runpath3d.in"
{Stack->push<real>(p.arctime(dval)); return;}
}
-#line 216 "runpath3d.in"
+#line 216 "./runpath3d.in"
// realarray* intersect(path3 p, path3 q, real fuzz=-1);
void gen_runpath3d29(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
path3 q=vm::pop<path3>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 217 "runpath3d.in"
+#line 217 "./runpath3d.in"
bool exact=fuzz <= 0.0;
if(fuzz < 0)
fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -442,14 +442,14 @@ void gen_runpath3d29(stack *Stack)
{Stack->push<realarray*>(new array(0)); return;}
}
-#line 234 "runpath3d.in"
+#line 234 "./runpath3d.in"
// realarray2* intersections(path3 p, path3 q, real fuzz=-1);
void gen_runpath3d30(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
path3 q=vm::pop<path3>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 235 "runpath3d.in"
+#line 235 "./runpath3d.in"
bool exact=fuzz <= 0.0;
if(fuzz < 0)
fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -481,14 +481,14 @@ void gen_runpath3d30(stack *Stack)
{Stack->push<realarray2*>(V); return;}
}
-#line 267 "runpath3d.in"
+#line 267 "./runpath3d.in"
// realarray* intersect(path3 p, triplearray2 *P, real fuzz=-1);
void gen_runpath3d31(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 268 "runpath3d.in"
+#line 268 "./runpath3d.in"
triple *A;
copyArray2C(A,P,true,4);
if(fuzz <= 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -506,14 +506,14 @@ void gen_runpath3d31(stack *Stack)
{Stack->push<realarray*>(new array(0)); return;}
}
-#line 286 "runpath3d.in"
+#line 286 "./runpath3d.in"
// realarray2* intersections(path3 p, triplearray2 *P, real fuzz=-1);
void gen_runpath3d32(stack *Stack)
{
real fuzz=vm::pop<real>(Stack,-1);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 287 "runpath3d.in"
+#line 287 "./runpath3d.in"
triple *A;
copyArray2C(A,P,true,4);
if(fuzz <= 0) fuzz=BigFuzz*::max(::max(length(p.max()),length(p.min())),
@@ -533,49 +533,49 @@ void gen_runpath3d32(stack *Stack)
{Stack->push<realarray2*>(W); return;} // Sorting will done in asy.
}
-#line 307 "runpath3d.in"
+#line 307 "./runpath3d.in"
// Int size(path3 p);
void gen_runpath3d33(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 308 "runpath3d.in"
+#line 308 "./runpath3d.in"
{Stack->push<Int>(p.size()); return;}
}
-#line 312 "runpath3d.in"
+#line 312 "./runpath3d.in"
// path3 &(path3 p, path3 q);
void gen_runpath3d34(stack *Stack)
{
path3 q=vm::pop<path3>(Stack);
path3 p=vm::pop<path3>(Stack);
-#line 313 "runpath3d.in"
+#line 313 "./runpath3d.in"
{Stack->push<path3>(camp::concat(p,q)); return;}
}
-#line 317 "runpath3d.in"
+#line 317 "./runpath3d.in"
// triple min(path3 p);
void gen_runpath3d35(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 318 "runpath3d.in"
+#line 318 "./runpath3d.in"
{Stack->push<triple>(p.min()); return;}
}
-#line 322 "runpath3d.in"
+#line 322 "./runpath3d.in"
// triple max(path3 p);
void gen_runpath3d36(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 323 "runpath3d.in"
+#line 323 "./runpath3d.in"
{Stack->push<triple>(p.max()); return;}
}
-#line 327 "runpath3d.in"
+#line 327 "./runpath3d.in"
// realarray* mintimes(path3 p);
void gen_runpath3d37(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 328 "runpath3d.in"
+#line 328 "./runpath3d.in"
array *V=new array(3);
triple v=p.mintimes();
(*V)[0]=v.getx();
@@ -584,12 +584,12 @@ void gen_runpath3d37(stack *Stack)
{Stack->push<realarray*>(V); return;}
}
-#line 337 "runpath3d.in"
+#line 337 "./runpath3d.in"
// realarray* maxtimes(path3 p);
void gen_runpath3d38(stack *Stack)
{
path3 p=vm::pop<path3>(Stack);
-#line 338 "runpath3d.in"
+#line 338 "./runpath3d.in"
array *V=new array(3);
triple v=p.maxtimes();
(*V)[0]=v.getx();
@@ -598,31 +598,31 @@ void gen_runpath3d38(stack *Stack)
{Stack->push<realarray*>(V); return;}
}
-#line 347 "runpath3d.in"
+#line 347 "./runpath3d.in"
// path3 *(realarray2 *t, path3 g);
void gen_runpath3d39(stack *Stack)
{
path3 g=vm::pop<path3>(Stack);
realarray2 * t=vm::pop<realarray2 *>(Stack);
-#line 348 "runpath3d.in"
+#line 348 "./runpath3d.in"
{Stack->push<path3>(transformed(*t,g)); return;}
}
-#line 352 "runpath3d.in"
+#line 352 "./runpath3d.in"
// pair minratio(path3 g);
void gen_runpath3d40(stack *Stack)
{
path3 g=vm::pop<path3>(Stack);
-#line 353 "runpath3d.in"
+#line 353 "./runpath3d.in"
{Stack->push<pair>(g.ratio(::min)); return;}
}
-#line 357 "runpath3d.in"
+#line 357 "./runpath3d.in"
// pair maxratio(path3 g);
void gen_runpath3d41(stack *Stack)
{
path3 g=vm::pop<path3>(Stack);
-#line 358 "runpath3d.in"
+#line 358 "./runpath3d.in"
{Stack->push<pair>(g.ratio(::max)); return;}
}
@@ -634,7 +634,7 @@ void gen_runpath3d41(stack *Stack)
// |b.x b.y b.z 1|
// |c.x c.y c.z 1|
// |d.x d.y d.z 1|
-#line 370 "runpath3d.in"
+#line 370 "./runpath3d.in"
// real orient(triple a, triple b, triple c, triple d);
void gen_runpath3d42(stack *Stack)
{
@@ -642,7 +642,7 @@ void gen_runpath3d42(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 371 "runpath3d.in"
+#line 371 "./runpath3d.in"
real A[]={a.getx(),a.gety(),a.getz()};
real B[]={b.getx(),b.gety(),b.getz()};
real C[]={c.getx(),c.gety(),c.getz()};
@@ -660,7 +660,7 @@ void gen_runpath3d42(stack *Stack)
// |c.x c.y c.z c.x^2+c.y^2+c.z^2 1|
// |d.x d.y d.z d.x^2+d.y^2+d.z^2 1|
// |e.x e.y e.z e.x^2+e.y^2+e.z^2 1|
-#line 389 "runpath3d.in"
+#line 389 "./runpath3d.in"
// real insphere(triple a, triple b, triple c, triple d, triple e);
void gen_runpath3d43(stack *Stack)
{
@@ -669,7 +669,7 @@ void gen_runpath3d43(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 390 "runpath3d.in"
+#line 390 "./runpath3d.in"
real A[]={a.getx(),a.gety(),a.getz()};
real B[]={b.getx(),b.gety(),b.getz()};
real C[]={c.getx(),c.gety(),c.getz()};
@@ -684,93 +684,93 @@ namespace trans {
void gen_runpath3d_venv(venv &ve)
{
-#line 40 "runpath3d.in"
+#line 40 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d0, primPath3(), SYM(path3), formal(tripleArray(), SYM(pre), false, false), formal(tripleArray(), SYM(point), false, false), formal(tripleArray(), SYM(post), false, false), formal(booleanArray(), SYM(straight), false, false), formal(primBoolean(), SYM(cyclic), false, false));
-#line 57 "runpath3d.in"
+#line 57 "./runpath3d.in"
REGISTER_BLTIN(run::nullPath3,"nullPath3");
-#line 62 "runpath3d.in"
+#line 62 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d2, primBoolean(), SYM_EQ, formal(primPath3(), SYM(a), false, false), formal(primPath3(), SYM(b), false, false));
-#line 67 "runpath3d.in"
+#line 67 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d3, primBoolean(), SYM_NEQ, formal(primPath3(), SYM(a), false, false), formal(primPath3(), SYM(b), false, false));
-#line 72 "runpath3d.in"
+#line 72 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d4, primTriple(), SYM(point), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 77 "runpath3d.in"
+#line 77 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d5, primTriple(), SYM(point), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 82 "runpath3d.in"
+#line 82 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d6, primTriple(), SYM(precontrol), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 87 "runpath3d.in"
+#line 87 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d7, primTriple(), SYM(precontrol), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 92 "runpath3d.in"
+#line 92 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d8, primTriple(), SYM(postcontrol), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 97 "runpath3d.in"
+#line 97 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d9, primTriple(), SYM(postcontrol), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 102 "runpath3d.in"
+#line 102 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d10, primTriple(), SYM(dir), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false), formal(primInt(), SYM(sign), true, false), formal(primBoolean(), SYM(normalize), true, false));
-#line 107 "runpath3d.in"
+#line 107 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d11, primTriple(), SYM(dir), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false), formal(primBoolean(), SYM(normalize), true, false));
-#line 112 "runpath3d.in"
+#line 112 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d12, primTriple(), SYM(accel), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false), formal(primInt(), SYM(sign), true, false));
-#line 117 "runpath3d.in"
+#line 117 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d13, primTriple(), SYM(accel), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 122 "runpath3d.in"
+#line 122 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d14, primReal(), SYM(radius), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(t), false, false));
-#line 134 "runpath3d.in"
+#line 134 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d15, primReal(), SYM(radius), formal(primTriple(), SYM(z0), false, false), formal(primTriple(), SYM(c0), false, false), formal(primTriple(), SYM(c1), false, false), formal(primTriple(), SYM(z1), false, false), formal(primReal(), SYM(t), false, false));
-#line 146 "runpath3d.in"
+#line 146 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d16, primPath3(), SYM(reverse), formal(primPath3(), SYM(p), false, false));
-#line 151 "runpath3d.in"
+#line 151 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d17, primPath3(), SYM(subpath), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(a), false, false), formal(primInt(), SYM(b), false, false));
-#line 156 "runpath3d.in"
+#line 156 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d18, primPath3(), SYM(subpath), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false));
-#line 161 "runpath3d.in"
+#line 161 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d19, primInt(), SYM(length), formal(primPath3(), SYM(p), false, false));
-#line 166 "runpath3d.in"
+#line 166 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d20, primBoolean(), SYM(cyclic), formal(primPath3(), SYM(p), false, false));
-#line 171 "runpath3d.in"
+#line 171 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d21, primBoolean(), SYM(straight), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 176 "runpath3d.in"
+#line 176 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d22, primPath3(), SYM(unstraighten), formal(primPath3(), SYM(p), false, false));
-#line 181 "runpath3d.in"
+#line 181 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d23, primReal(), SYM(straightness), formal(primTriple(), SYM(z0), false, false), formal(primTriple(), SYM(c0), false, false), formal(primTriple(), SYM(c1), false, false), formal(primTriple(), SYM(z1), false, false));
-#line 188 "runpath3d.in"
+#line 188 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d24, primReal(), SYM(straightness), formal(primPath3(), SYM(p), false, false), formal(primInt(), SYM(t), false, false));
-#line 196 "runpath3d.in"
+#line 196 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d25, primBoolean(), SYM(piecewisestraight), formal(primPath3(), SYM(p), false, false));
-#line 201 "runpath3d.in"
+#line 201 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d26, primReal(), SYM(arclength), formal(primPath3(), SYM(p), false, false));
-#line 206 "runpath3d.in"
+#line 206 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d27, primReal(), SYM(arclength), formal(primTriple(), SYM(z0), false, false), formal(primTriple(), SYM(c0), false, false), formal(primTriple(), SYM(c1), false, false), formal(primTriple(), SYM(z1), false, false));
-#line 211 "runpath3d.in"
+#line 211 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d28, primReal(), SYM(arctime), formal(primPath3(), SYM(p), false, false), formal(primReal(), SYM(dval), false, false));
-#line 216 "runpath3d.in"
+#line 216 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d29, realArray(), SYM(intersect), formal(primPath3(), SYM(p), false, false), formal(primPath3(), SYM(q), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 234 "runpath3d.in"
+#line 234 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d30, realArray2(), SYM(intersections), formal(primPath3(), SYM(p), false, false), formal(primPath3(), SYM(q), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 267 "runpath3d.in"
+#line 267 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d31, realArray(), SYM(intersect), formal(primPath3(), SYM(p), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 286 "runpath3d.in"
+#line 286 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d32, realArray2(), SYM(intersections), formal(primPath3(), SYM(p), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primReal(), SYM(fuzz), true, false));
-#line 307 "runpath3d.in"
+#line 307 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d33, primInt(), SYM(size), formal(primPath3(), SYM(p), false, false));
-#line 312 "runpath3d.in"
+#line 312 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d34, primPath3(), SYM_AMPERSAND, formal(primPath3(), SYM(p), false, false), formal(primPath3(), SYM(q), false, false));
-#line 317 "runpath3d.in"
+#line 317 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d35, primTriple(), SYM(min), formal(primPath3(), SYM(p), false, false));
-#line 322 "runpath3d.in"
+#line 322 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d36, primTriple(), SYM(max), formal(primPath3(), SYM(p), false, false));
-#line 327 "runpath3d.in"
+#line 327 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d37, realArray(), SYM(mintimes), formal(primPath3(), SYM(p), false, false));
-#line 337 "runpath3d.in"
+#line 337 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d38, realArray(), SYM(maxtimes), formal(primPath3(), SYM(p), false, false));
-#line 347 "runpath3d.in"
+#line 347 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d39, primPath3(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primPath3(), SYM(g), false, false));
-#line 352 "runpath3d.in"
+#line 352 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d40, primPair(), SYM(minratio), formal(primPath3(), SYM(g), false, false));
-#line 357 "runpath3d.in"
+#line 357 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d41, primPair(), SYM(maxratio), formal(primPath3(), SYM(g), false, false));
-#line 362 "runpath3d.in"
+#line 362 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d42, primReal(), SYM(orient), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false));
-#line 379 "runpath3d.in"
+#line 379 "./runpath3d.in"
addFunc(ve, run::gen_runpath3d43, primReal(), SYM(insphere), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false), formal(primTriple(), SYM(e), false, false));
}
diff --git a/graphics/asymptote/runpath3d.h b/graphics/asymptote/runpath3d.h
index cdb6480460..84155974c0 100644
--- a/graphics/asymptote/runpath3d.h
+++ b/graphics/asymptote/runpath3d.h
@@ -1,9 +1,7 @@
/***** Autogenerated from runpath3d.in; changes will be overwritten *****/
-#ifndef runpath3d_H
-#define runpath3d_H
+#pragma once
namespace run {
void nullPath3(vm::stack *);
}
-#endif // runpath3d_H
diff --git a/graphics/asymptote/runpicture.cc b/graphics/asymptote/runpicture.cc
index e3e75a179b..dde895c30e 100644
--- a/graphics/asymptote/runpicture.cc
+++ b/graphics/asymptote/runpicture.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runpicture.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runpicture.in"
+#line 1 "./runpicture.in"
/*****
* runpicture.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -166,71 +166,71 @@ string defaultformat3="prc";
#endif
namespace run {
-#line 126 "runpicture.in"
+#line 126 "./runpicture.in"
void newPicture(stack *Stack)
{
-#line 127 "runpicture.in"
+#line 127 "./runpicture.in"
{Stack->push<picture*>(new picture()); return;}
}
-#line 131 "runpicture.in"
+#line 131 "./runpicture.in"
// bool empty(picture *f);
void gen_runpicture1(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 132 "runpicture.in"
+#line 132 "./runpicture.in"
{Stack->push<bool>(f->null()); return;}
}
-#line 136 "runpicture.in"
+#line 136 "./runpicture.in"
// void erase(picture *f);
void gen_runpicture2(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 137 "runpicture.in"
+#line 137 "./runpicture.in"
f->nodes.clear();
}
-#line 141 "runpicture.in"
+#line 141 "./runpicture.in"
// pair min(picture *f);
void gen_runpicture3(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 142 "runpicture.in"
+#line 142 "./runpicture.in"
{Stack->push<pair>(f->bounds().Min()); return;}
}
-#line 146 "runpicture.in"
+#line 146 "./runpicture.in"
// pair max(picture *f);
void gen_runpicture4(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 147 "runpicture.in"
+#line 147 "./runpicture.in"
{Stack->push<pair>(f->bounds().Max()); return;}
}
-#line 151 "runpicture.in"
+#line 151 "./runpicture.in"
// pair size(picture *f);
void gen_runpicture5(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 152 "runpicture.in"
+#line 152 "./runpicture.in"
bbox b=f->bounds();
{Stack->push<pair>(b.Max()-b.Min()); return;}
}
-#line 157 "runpicture.in"
+#line 157 "./runpicture.in"
// void _draw(picture *f, path g, pen p);
void gen_runpicture6(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
path g=vm::pop<path>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 158 "runpicture.in"
+#line 158 "./runpicture.in"
f->append(new drawPath(g,p));
}
-#line 162 "runpicture.in"
+#line 162 "./runpicture.in"
// void fill(picture *f, patharray *g, pen p=CURRENTPEN, bool copy=true);
void gen_runpicture7(stack *Stack)
{
@@ -238,12 +238,12 @@ void gen_runpicture7(stack *Stack)
pen p=vm::pop<pen>(Stack,CURRENTPEN);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 163 "runpicture.in"
+#line 163 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawFill(*copyarray(g),false,p));
}
-#line 168 "runpicture.in"
+#line 168 "./runpicture.in"
// void latticeshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray2 *p, transform t=identity, bool copy=true);
void gen_runpicture8(stack *Stack)
{
@@ -254,13 +254,13 @@ void gen_runpicture8(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 171 "runpicture.in"
+#line 171 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawLatticeShade(*copyarray(g),stroke,fillrule,*copyarray(p),
t));
}
-#line 177 "runpicture.in"
+#line 177 "./runpicture.in"
// void axialshade(picture *f, patharray *g, bool stroke=false, pen pena, pair a, bool extenda=true, pen penb, pair b, bool extendb=true, bool copy=true);
void gen_runpicture9(stack *Stack)
{
@@ -274,13 +274,13 @@ void gen_runpicture9(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 180 "runpicture.in"
+#line 180 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawAxialShade(*copyarray(g),stroke,pena,a,extenda,penb,b,
extendb));
}
-#line 186 "runpicture.in"
+#line 186 "./runpicture.in"
// void radialshade(picture *f, patharray *g, bool stroke=false, pen pena, pair a, real ra, bool extenda=true, pen penb, pair b, real rb, bool extendb=true, bool copy=true);
void gen_runpicture10(stack *Stack)
{
@@ -296,13 +296,13 @@ void gen_runpicture10(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 189 "runpicture.in"
+#line 189 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawRadialShade(*copyarray(g),stroke,pena,a,ra,extenda,
penb,b,rb,extendb));
}
-#line 195 "runpicture.in"
+#line 195 "./runpicture.in"
// void gouraudshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray *p, pairarray *z, Intarray *edges, bool copy=true);
void gen_runpicture11(stack *Stack)
{
@@ -314,7 +314,7 @@ void gen_runpicture11(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 198 "runpicture.in"
+#line 198 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
checkArrays(p,z);
checkArrays(z,edges);
@@ -322,7 +322,7 @@ void gen_runpicture11(stack *Stack)
*copyarray(z),*copyarray(edges)));
}
-#line 206 "runpicture.in"
+#line 206 "./runpicture.in"
// void gouraudshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray *p, Intarray *edges, bool copy=true);
void gen_runpicture12(stack *Stack)
{
@@ -333,7 +333,7 @@ void gen_runpicture12(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 209 "runpicture.in"
+#line 209 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
size_t n=checkArrays(p,edges);
size_t m=checkArray(g);
@@ -354,7 +354,7 @@ void gen_runpicture12(stack *Stack)
*z,*copyarray(edges)));
}
-#line 230 "runpicture.in"
+#line 230 "./runpicture.in"
// void tensorshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, penarray2 *p, patharray *b=NULL, pairarray2 *z=emptyarray, bool copy=true);
void gen_runpicture13(stack *Stack)
{
@@ -366,7 +366,7 @@ void gen_runpicture13(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 233 "runpicture.in"
+#line 233 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
array *(*copyarray2)(array *a)=copy ? copyArray2 : nop;
size_t n=checkArrays(p,b ? b : g);
@@ -379,7 +379,7 @@ void gen_runpicture13(stack *Stack)
*copyarray2(z)));
}
-#line 246 "runpicture.in"
+#line 246 "./runpicture.in"
// void functionshade(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, string shader=emptystring, bool copy=true);
void gen_runpicture14(stack *Stack)
{
@@ -389,14 +389,14 @@ void gen_runpicture14(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 249 "runpicture.in"
+#line 249 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawFunctionShade(*copyarray(g),stroke,fillrule,shader));
}
// Clip a picture to a superpath using the given fill rule.
// Subsequent additions to the picture will not be affected by the clipping.
-#line 256 "runpicture.in"
+#line 256 "./runpicture.in"
// void clip(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, bool copy=true);
void gen_runpicture15(stack *Stack)
{
@@ -405,13 +405,13 @@ void gen_runpicture15(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 258 "runpicture.in"
+#line 258 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
drawClipBegin *begin=new drawClipBegin(*copyarray(g),stroke,fillrule,true);
f->enclose(begin,new drawClipEnd(true,begin));
}
-#line 264 "runpicture.in"
+#line 264 "./runpicture.in"
// void beginclip(picture *f, patharray *g, bool stroke=false, pen fillrule=CURRENTPEN, bool copy=true);
void gen_runpicture16(stack *Stack)
{
@@ -420,57 +420,57 @@ void gen_runpicture16(stack *Stack)
bool stroke=vm::pop<bool>(Stack,false);
patharray * g=vm::pop<patharray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 266 "runpicture.in"
+#line 266 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
f->append(new drawClipBegin(*copyarray(g),stroke,fillrule,false));
}
-#line 271 "runpicture.in"
+#line 271 "./runpicture.in"
// void endclip(picture *f);
void gen_runpicture17(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 272 "runpicture.in"
+#line 272 "./runpicture.in"
f->append(new drawClipEnd(false));
}
-#line 276 "runpicture.in"
+#line 276 "./runpicture.in"
// void gsave(picture *f);
void gen_runpicture18(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 277 "runpicture.in"
+#line 277 "./runpicture.in"
f->append(new drawGsave());
}
-#line 281 "runpicture.in"
+#line 281 "./runpicture.in"
// void grestore(picture *f);
void gen_runpicture19(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 282 "runpicture.in"
+#line 282 "./runpicture.in"
f->append(new drawGrestore());
}
-#line 286 "runpicture.in"
+#line 286 "./runpicture.in"
// void begingroup(picture *f);
void gen_runpicture20(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 287 "runpicture.in"
+#line 287 "./runpicture.in"
f->append(new drawBegin());
}
-#line 291 "runpicture.in"
+#line 291 "./runpicture.in"
// void endgroup(picture *f);
void gen_runpicture21(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 292 "runpicture.in"
+#line 292 "./runpicture.in"
f->append(new drawEnd());
}
-#line 296 "runpicture.in"
+#line 296 "./runpicture.in"
// void _begingroup3(picture *f, string name, real compression, real granularity, bool closed, bool tessellate, bool dobreak, bool nobreak, triple center, Int interaction);
void gen_runpicture22(stack *Stack)
{
@@ -484,62 +484,62 @@ void gen_runpicture22(stack *Stack)
real compression=vm::pop<real>(Stack);
string name=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 299 "runpicture.in"
+#line 299 "./runpicture.in"
f->append(new drawBegin3(name,compression,granularity,
closed,tessellate,dobreak,nobreak,
center,(Interaction) intcast(interaction)));
}
-#line 305 "runpicture.in"
+#line 305 "./runpicture.in"
// void endgroup3(picture *f);
void gen_runpicture23(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 306 "runpicture.in"
+#line 306 "./runpicture.in"
f->append(new drawEnd3());
}
-#line 310 "runpicture.in"
+#line 310 "./runpicture.in"
// void add(picture *dest, picture *src);
void gen_runpicture24(stack *Stack)
{
picture * src=vm::pop<picture *>(Stack);
picture * dest=vm::pop<picture *>(Stack);
-#line 311 "runpicture.in"
+#line 311 "./runpicture.in"
dest->add(*src);
}
-#line 315 "runpicture.in"
+#line 315 "./runpicture.in"
// void prepend(picture *dest, picture *src);
void gen_runpicture25(stack *Stack)
{
picture * src=vm::pop<picture *>(Stack);
picture * dest=vm::pop<picture *>(Stack);
-#line 316 "runpicture.in"
+#line 316 "./runpicture.in"
dest->prepend(*src);
}
-#line 320 "runpicture.in"
+#line 320 "./runpicture.in"
// void postscript(picture *f, string s);
void gen_runpicture26(stack *Stack)
{
string s=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 321 "runpicture.in"
+#line 321 "./runpicture.in"
f->append(new drawVerbatim(PostScript,s));
}
-#line 325 "runpicture.in"
+#line 325 "./runpicture.in"
// void tex(picture *f, string s);
void gen_runpicture27(stack *Stack)
{
string s=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 326 "runpicture.in"
+#line 326 "./runpicture.in"
f->append(new drawVerbatim(TeX,s));
}
-#line 330 "runpicture.in"
+#line 330 "./runpicture.in"
// void postscript(picture *f, string s, pair min, pair max);
void gen_runpicture28(stack *Stack)
{
@@ -547,11 +547,11 @@ void gen_runpicture28(stack *Stack)
pair min=vm::pop<pair>(Stack);
string s=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 331 "runpicture.in"
+#line 331 "./runpicture.in"
f->append(new drawVerbatim(PostScript,s,min,max));
}
-#line 335 "runpicture.in"
+#line 335 "./runpicture.in"
// void tex(picture *f, string s, pair min, pair max);
void gen_runpicture29(stack *Stack)
{
@@ -559,33 +559,33 @@ void gen_runpicture29(stack *Stack)
pair min=vm::pop<pair>(Stack);
string s=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 336 "runpicture.in"
+#line 336 "./runpicture.in"
f->append(new drawVerbatim(TeX,s,min,max));
}
-#line 340 "runpicture.in"
+#line 340 "./runpicture.in"
// void texpreamble(string s);
void gen_runpicture30(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 341 "runpicture.in"
+#line 341 "./runpicture.in"
string t=s+"\n";
processDataStruct &pd=processData();
pd.TeXpipepreamble.push_back(t);
pd.TeXpreamble.push_back(t);
}
-#line 348 "runpicture.in"
+#line 348 "./runpicture.in"
// void deletepreamble();
void gen_runpicture31(stack *)
{
-#line 349 "runpicture.in"
+#line 349 "./runpicture.in"
if(getSetting<bool>("inlinetex")) {
unlink(buildname(outname(),"pre").c_str());
}
}
-#line 355 "runpicture.in"
+#line 355 "./runpicture.in"
// void _labelpath(picture *f, string s, string size, path g, string justify, pair offset, pen p);
void gen_runpicture32(stack *Stack)
{
@@ -596,40 +596,40 @@ void gen_runpicture32(stack *Stack)
string size=vm::pop<string>(Stack);
string s=vm::pop<string>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 357 "runpicture.in"
+#line 357 "./runpicture.in"
f->append(new drawLabelPath(s,size,g,justify,offset,p));
}
-#line 361 "runpicture.in"
+#line 361 "./runpicture.in"
// void texreset();
void gen_runpicture33(stack *)
{
-#line 362 "runpicture.in"
+#line 362 "./runpicture.in"
processDataStruct &pd=processData();
pd.TeXpipepreamble.clear();
pd.TeXpreamble.clear();
pd.tex.pipeclose();
}
-#line 369 "runpicture.in"
+#line 369 "./runpicture.in"
// void layer(picture *f);
void gen_runpicture34(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 370 "runpicture.in"
+#line 370 "./runpicture.in"
f->append(new drawLayer());
}
-#line 374 "runpicture.in"
+#line 374 "./runpicture.in"
// void newpage(picture *f);
void gen_runpicture35(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 375 "runpicture.in"
+#line 375 "./runpicture.in"
f->append(new drawNewPage());
}
-#line 379 "runpicture.in"
+#line 379 "./runpicture.in"
// void _image(picture *f, realarray2 *data, pair initial, pair final, penarray *palette=NULL, transform t=identity, bool copy=true, bool antialias=false);
void gen_runpicture36(stack *Stack)
{
@@ -641,14 +641,14 @@ void gen_runpicture36(stack *Stack)
pair initial=vm::pop<pair>(Stack);
realarray2 * data=vm::pop<realarray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 382 "runpicture.in"
+#line 382 "./runpicture.in"
array *(*copyarray)(array *a)=copy ? copyArray : nop;
array *(*copyarray2)(array *a)=copy ? copyArray2 : nop;
f->append(new drawPaletteImage(*copyarray2(data),*copyarray(palette),
t*matrix(initial,final),antialias));
}
-#line 389 "runpicture.in"
+#line 389 "./runpicture.in"
// void _image(picture *f, penarray2 *data, pair initial, pair final, transform t=identity, bool copy=true, bool antialias=false);
void gen_runpicture37(stack *Stack)
{
@@ -659,13 +659,13 @@ void gen_runpicture37(stack *Stack)
pair initial=vm::pop<pair>(Stack);
penarray2 * data=vm::pop<penarray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 391 "runpicture.in"
+#line 391 "./runpicture.in"
array *(*copyarray2)(array *a)=copy ? copyArray2 : nop;
f->append(new drawNoPaletteImage(*copyarray2(data),t*matrix(initial,final),
antialias));
}
-#line 397 "runpicture.in"
+#line 397 "./runpicture.in"
// void _image(picture *f, callablePen *F, Int width, Int height, pair initial, pair final, transform t=identity, bool antialias=false);
void gen_runpicture38(stack *Stack)
{
@@ -677,36 +677,36 @@ void gen_runpicture38(stack *Stack)
Int width=vm::pop<Int>(Stack);
callablePen * F=vm::pop<callablePen *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 399 "runpicture.in"
+#line 399 "./runpicture.in"
f->append(new drawFunctionImage(Stack,F,width,height,
t*matrix(initial,final),antialias));
}
-#line 404 "runpicture.in"
+#line 404 "./runpicture.in"
// string nativeformat();
void gen_runpicture39(stack *Stack)
{
-#line 405 "runpicture.in"
+#line 405 "./runpicture.in"
{Stack->push<string>(nativeformat()); return;}
}
-#line 409 "runpicture.in"
+#line 409 "./runpicture.in"
// bool latex();
void gen_runpicture40(stack *Stack)
{
-#line 410 "runpicture.in"
+#line 410 "./runpicture.in"
{Stack->push<bool>(latex(getSetting<string>("tex"))); return;}
}
-#line 414 "runpicture.in"
+#line 414 "./runpicture.in"
// bool pdf();
void gen_runpicture41(stack *Stack)
{
-#line 415 "runpicture.in"
+#line 415 "./runpicture.in"
{Stack->push<bool>(pdf(getSetting<string>("tex"))); return;}
}
-#line 419 "runpicture.in"
+#line 419 "./runpicture.in"
// void _shipout(string prefix=emptystring, picture *f, picture *preamble=NULL, string format=emptystring, bool wait=false, bool view=true, transform T=identity);
void gen_runpicture42(stack *Stack)
{
@@ -717,7 +717,7 @@ void gen_runpicture42(stack *Stack)
picture * preamble=vm::pop<picture *>(Stack,NULL);
picture * f=vm::pop<picture *>(Stack);
string prefix=vm::pop<string>(Stack,emptystring);
-#line 422 "runpicture.in"
+#line 422 "./runpicture.in"
if(prefix.empty()) prefix=outname();
picture *result=new picture;
@@ -765,7 +765,7 @@ void gen_runpicture42(stack *Stack)
delete result;
}
-#line 470 "runpicture.in"
+#line 470 "./runpicture.in"
// void shipout3(string prefix, picture *f, string format=emptystring, real width, real height, real angle, real zoom, triple m, triple M, pair shift, pair margin, realarray2 *t, realarray2 *tup, realarray *background, triplearray *lights, realarray2 *diffuse, realarray2 *specular, bool view=true);
void gen_runpicture43(stack *Stack)
{
@@ -787,7 +787,7 @@ void gen_runpicture43(stack *Stack)
string format=vm::pop<string>(Stack,emptystring);
picture * f=vm::pop<picture *>(Stack);
string prefix=vm::pop<string>(Stack);
-#line 476 "runpicture.in"
+#line 476 "./runpicture.in"
size_t n=checkArrays(lights,diffuse);
checkEqual(n,checkArray(specular));
@@ -809,24 +809,24 @@ void gen_runpicture43(stack *Stack)
delete[] Tup;
}
-#line 498 "runpicture.in"
+#line 498 "./runpicture.in"
// void shipout3(string prefix, picture *f, string format=defaultformat3);
void gen_runpicture44(stack *Stack)
{
string format=vm::pop<string>(Stack,defaultformat3);
picture * f=vm::pop<picture *>(Stack);
string prefix=vm::pop<string>(Stack);
-#line 499 "runpicture.in"
+#line 499 "./runpicture.in"
f->shipout3(prefix,format);
}
-#line 503 "runpicture.in"
+#line 503 "./runpicture.in"
// void xmap(string key, transform t=identity);
void gen_runpicture45(stack *Stack)
{
transform t=vm::pop<transform>(Stack,identity);
string key=vm::pop<string>(Stack);
-#line 504 "runpicture.in"
+#line 504 "./runpicture.in"
processDataStruct *P=&processData();
xmap_t &xmap=P->xmap;
xmap_t::iterator p=xmap.find(key);
@@ -840,14 +840,14 @@ void gen_runpicture45(stack *Stack)
P->xmapCount++;
}
-#line 518 "runpicture.in"
+#line 518 "./runpicture.in"
// void deconstruct(picture *f, picture *preamble=NULL, transform T=identity);
void gen_runpicture46(stack *Stack)
{
transform T=vm::pop<transform>(Stack,identity);
picture * preamble=vm::pop<picture *>(Stack,NULL);
picture * f=vm::pop<picture *>(Stack);
-#line 519 "runpicture.in"
+#line 519 "./runpicture.in"
unsigned level=0;
bool first=pdf(getSetting<string>("tex"));
@@ -962,7 +962,7 @@ void gen_runpicture46(stack *Stack)
// Three-dimensional picture and surface operations
// Bezier curve
-#line 634 "runpicture.in"
+#line 634 "./runpicture.in"
// void _draw(picture *f, path3 g, triple center=Zero, penarray *p, real opacity, real shininess, real metallic, real fresnel0, Int interaction=0);
void gen_runpicture47(stack *Stack)
{
@@ -975,7 +975,7 @@ void gen_runpicture47(stack *Stack)
triple center=vm::pop<triple>(Stack,Zero);
path3 g=vm::pop<path3>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 637 "runpicture.in"
+#line 637 "./runpicture.in"
size_t n=g.size();
for(unsigned int i=0; i < n; ++i)
f->append(new drawPath3(g.subpath((Int) i,Int(i+1)),center,*p,opacity,
@@ -984,7 +984,7 @@ void gen_runpicture47(stack *Stack)
}
// Bezier patch
-#line 646 "runpicture.in"
+#line 646 "./runpicture.in"
// void draw(picture *f, triplearray2 *P, triple center, bool straight, penarray *p, real opacity, real shininess, real metallic, real fresnel0, penarray *colors, Int interaction, Int digits, bool primitive=false);
void gen_runpicture48(stack *Stack)
{
@@ -1001,7 +1001,7 @@ void gen_runpicture48(stack *Stack)
triple center=vm::pop<triple>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 650 "runpicture.in"
+#line 650 "./runpicture.in"
f->append(new drawBezierPatch(*P,center,straight,*p,opacity,shininess,
metallic,fresnel0,*colors,
(Interaction) intcast(interaction),
@@ -1009,7 +1009,7 @@ void gen_runpicture48(stack *Stack)
}
// Bezier triangle
-#line 658 "runpicture.in"
+#line 658 "./runpicture.in"
// void drawbeziertriangle(picture *f, triplearray2 *P, triple center, bool straight, penarray *p, real opacity, real shininess, real metallic, real fresnel0, penarray *colors, Int interaction, Int digits, bool primitive=false);
void gen_runpicture49(stack *Stack)
{
@@ -1026,7 +1026,7 @@ void gen_runpicture49(stack *Stack)
triple center=vm::pop<triple>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 663 "runpicture.in"
+#line 663 "./runpicture.in"
f->append(new drawBezierTriangle(*P,center,straight,*p,opacity,shininess,
metallic,fresnel0,*colors,
(Interaction) intcast(interaction),
@@ -1034,7 +1034,7 @@ void gen_runpicture49(stack *Stack)
}
// General NURBS curve
-#line 671 "runpicture.in"
+#line 671 "./runpicture.in"
// void draw(picture *f, triplearray *P, realarray *knot, realarray *weights=emptyarray, pen p);
void gen_runpicture50(stack *Stack)
{
@@ -1043,12 +1043,12 @@ void gen_runpicture50(stack *Stack)
realarray * knot=vm::pop<realarray *>(Stack);
triplearray * P=vm::pop<triplearray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 673 "runpicture.in"
+#line 673 "./runpicture.in"
f->append(new drawNurbsPath3(*P,knot,weights,p));
}
// General NURBS surface
-#line 678 "runpicture.in"
+#line 678 "./runpicture.in"
// void draw(picture *f, triplearray2 *P, realarray *uknot, realarray *vknot, realarray2 *weights=emptyarray, penarray *p, real opacity, real shininess,real metallic, real fresnel0, penarray *colors);
void gen_runpicture51(stack *Stack)
{
@@ -1063,13 +1063,13 @@ void gen_runpicture51(stack *Stack)
realarray * uknot=vm::pop<realarray *>(Stack);
triplearray2 * P=vm::pop<triplearray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 681 "runpicture.in"
+#line 681 "./runpicture.in"
f->append(new drawNurbs(*P,uknot,vknot,weights,*p,opacity,shininess,
metallic,fresnel0,*colors));
}
// Sphere primitive
-#line 687 "runpicture.in"
+#line 687 "./runpicture.in"
// void drawSphere(picture *f, realarray2 *t, bool half=false, penarray *p, real opacity, real shininess, real metallic, real fresnel0, Int type);
void gen_runpicture52(stack *Stack)
{
@@ -1082,13 +1082,13 @@ void gen_runpicture52(stack *Stack)
bool half=vm::pop<bool>(Stack,false);
realarray2 * t=vm::pop<realarray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 690 "runpicture.in"
+#line 690 "./runpicture.in"
f->append(new drawSphere(*t,half,*p,opacity,shininess,metallic,fresnel0,
intcast(type)));
}
// Cylinder primitive
-#line 696 "runpicture.in"
+#line 696 "./runpicture.in"
// void drawCylinder(picture *f, realarray2 *t, penarray *p, real opacity, real shininess, real metallic, real fresnel0, bool core=false);
void gen_runpicture53(stack *Stack)
{
@@ -1100,12 +1100,12 @@ void gen_runpicture53(stack *Stack)
penarray * p=vm::pop<penarray *>(Stack);
realarray2 * t=vm::pop<realarray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 699 "runpicture.in"
+#line 699 "./runpicture.in"
f->append(new drawCylinder(*t,*p,opacity,shininess,metallic,fresnel0,core));
}
// Disk primitive
-#line 704 "runpicture.in"
+#line 704 "./runpicture.in"
// void drawDisk(picture *f, realarray2 *t, penarray *p, real opacity, real shininess, real metallic, real fresnel0);
void gen_runpicture54(stack *Stack)
{
@@ -1116,12 +1116,12 @@ void gen_runpicture54(stack *Stack)
penarray * p=vm::pop<penarray *>(Stack);
realarray2 * t=vm::pop<realarray2 *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 706 "runpicture.in"
+#line 706 "./runpicture.in"
f->append(new drawDisk(*t,*p,opacity,shininess,metallic,fresnel0));
}
// Tube primitive
-#line 711 "runpicture.in"
+#line 711 "./runpicture.in"
// void drawTube(picture *f, triplearray *g, real width, penarray *p, real opacity, real shininess, real metallic, real fresnel0, triple min, triple max, bool core=false);
void gen_runpicture55(stack *Stack)
{
@@ -1136,13 +1136,13 @@ void gen_runpicture55(stack *Stack)
real width=vm::pop<real>(Stack);
triplearray * g=vm::pop<triplearray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 714 "runpicture.in"
+#line 714 "./runpicture.in"
f->append(new drawTube(*g,width,*p,opacity,shininess,metallic,fresnel0,
min,max,core));
}
// Draw pixel
-#line 720 "runpicture.in"
+#line 720 "./runpicture.in"
// void drawpixel(picture *f, triple v, pen p, real width=1.0);
void gen_runpicture56(stack *Stack)
{
@@ -1150,12 +1150,12 @@ void gen_runpicture56(stack *Stack)
pen p=vm::pop<pen>(Stack);
triple v=vm::pop<triple>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 721 "runpicture.in"
+#line 721 "./runpicture.in"
f->append(new drawPixel(v,p,width));
}
// Draw triangles
-#line 726 "runpicture.in"
+#line 726 "./runpicture.in"
// void draw(picture *f, triplearray *v, Intarray2 *vi, triple center=Zero, triplearray *n, Intarray2 *ni, penarray *p, real opacity, real shininess, real metallic, real fresnel0, penarray *c=emptyarray, Intarray2 *ci=emptyarray, Int interaction);
void gen_runpicture57(stack *Stack)
{
@@ -1173,64 +1173,64 @@ void gen_runpicture57(stack *Stack)
Intarray2 * vi=vm::pop<Intarray2 *>(Stack);
triplearray * v=vm::pop<triplearray *>(Stack);
picture * f=vm::pop<picture *>(Stack);
-#line 731 "runpicture.in"
+#line 731 "./runpicture.in"
f->append(new drawTriangles(*v,*vi,center,*n,*ni,*p,opacity,shininess,
metallic,fresnel0,*c,*ci,
(Interaction) intcast(interaction)));
}
-#line 737 "runpicture.in"
+#line 737 "./runpicture.in"
// triple min3(picture *f);
void gen_runpicture58(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 738 "runpicture.in"
+#line 738 "./runpicture.in"
{Stack->push<triple>(f->bounds3().Min()); return;}
}
-#line 742 "runpicture.in"
+#line 742 "./runpicture.in"
// triple max3(picture *f);
void gen_runpicture59(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 743 "runpicture.in"
+#line 743 "./runpicture.in"
{Stack->push<triple>(f->bounds3().Max()); return;}
}
-#line 747 "runpicture.in"
+#line 747 "./runpicture.in"
// triple size3(picture *f);
void gen_runpicture60(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 748 "runpicture.in"
+#line 748 "./runpicture.in"
bbox3 b=f->bounds3();
{Stack->push<triple>(b.Max()-b.Min()); return;}
}
-#line 753 "runpicture.in"
+#line 753 "./runpicture.in"
// pair minratio(picture *f);
void gen_runpicture61(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 754 "runpicture.in"
+#line 754 "./runpicture.in"
{Stack->push<pair>(f->ratio(::min)); return;}
}
-#line 758 "runpicture.in"
+#line 758 "./runpicture.in"
// pair maxratio(picture *f);
void gen_runpicture62(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 759 "runpicture.in"
+#line 759 "./runpicture.in"
{Stack->push<pair>(f->ratio(::max)); return;}
}
-#line 763 "runpicture.in"
+#line 763 "./runpicture.in"
// bool is3D(picture *f);
void gen_runpicture63(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
-#line 764 "runpicture.in"
+#line 764 "./runpicture.in"
{Stack->push<bool>(f->have3D()); return;}
}
@@ -1240,133 +1240,133 @@ namespace trans {
void gen_runpicture_venv(venv &ve)
{
-#line 126 "runpicture.in"
+#line 126 "./runpicture.in"
REGISTER_BLTIN(run::newPicture,"newPicture");
-#line 131 "runpicture.in"
+#line 131 "./runpicture.in"
addFunc(ve, run::gen_runpicture1, primBoolean(), SYM(empty), formal(primPicture(), SYM(f), false, false));
-#line 136 "runpicture.in"
+#line 136 "./runpicture.in"
addFunc(ve, run::gen_runpicture2, primVoid(), SYM(erase), formal(primPicture(), SYM(f), false, false));
-#line 141 "runpicture.in"
+#line 141 "./runpicture.in"
addFunc(ve, run::gen_runpicture3, primPair(), SYM(min), formal(primPicture(), SYM(f), false, false));
-#line 146 "runpicture.in"
+#line 146 "./runpicture.in"
addFunc(ve, run::gen_runpicture4, primPair(), SYM(max), formal(primPicture(), SYM(f), false, false));
-#line 151 "runpicture.in"
+#line 151 "./runpicture.in"
addFunc(ve, run::gen_runpicture5, primPair(), SYM(size), formal(primPicture(), SYM(f), false, false));
-#line 157 "runpicture.in"
+#line 157 "./runpicture.in"
addFunc(ve, run::gen_runpicture6, primVoid(), SYM(_draw), formal(primPicture(), SYM(f), false, false), formal(primPath(), SYM(g), false, false), formal(primPen(), SYM(p), false, false));
-#line 162 "runpicture.in"
+#line 162 "./runpicture.in"
addFunc(ve, run::gen_runpicture7, primVoid(), SYM(fill), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primPen(), SYM(p), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 168 "runpicture.in"
+#line 168 "./runpicture.in"
addFunc(ve, run::gen_runpicture8, primVoid(), SYM(latticeshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(penArray2(), SYM(p), false, false), formal(primTransform(), SYM(t), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 177 "runpicture.in"
+#line 177 "./runpicture.in"
addFunc(ve, run::gen_runpicture9, primVoid(), SYM(axialshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(pena), false, false), formal(primPair(), SYM(a), false, false), formal(primBoolean(), SYM(extenda), true, false), formal(primPen(), SYM(penb), false, false), formal(primPair(), SYM(b), false, false), formal(primBoolean(), SYM(extendb), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 186 "runpicture.in"
+#line 186 "./runpicture.in"
addFunc(ve, run::gen_runpicture10, primVoid(), SYM(radialshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(pena), false, false), formal(primPair(), SYM(a), false, false), formal(primReal(), SYM(ra), false, false), formal(primBoolean(), SYM(extenda), true, false), formal(primPen(), SYM(penb), false, false), formal(primPair(), SYM(b), false, false), formal(primReal(), SYM(rb), false, false), formal(primBoolean(), SYM(extendb), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 195 "runpicture.in"
+#line 195 "./runpicture.in"
addFunc(ve, run::gen_runpicture11, primVoid(), SYM(gouraudshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(penArray(), SYM(p), false, false), formal(pairArray(), SYM(z), false, false), formal(IntArray(), SYM(edges), false, false), formal(primBoolean(), SYM(copy), true, false));
-#line 206 "runpicture.in"
+#line 206 "./runpicture.in"
addFunc(ve, run::gen_runpicture12, primVoid(), SYM(gouraudshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(penArray(), SYM(p), false, false), formal(IntArray(), SYM(edges), false, false), formal(primBoolean(), SYM(copy), true, false));
-#line 230 "runpicture.in"
+#line 230 "./runpicture.in"
addFunc(ve, run::gen_runpicture13, primVoid(), SYM(tensorshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(penArray2(), SYM(p), false, false), formal(pathArray(), SYM(b), true, false), formal(pairArray2(), SYM(z), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 246 "runpicture.in"
+#line 246 "./runpicture.in"
addFunc(ve, run::gen_runpicture14, primVoid(), SYM(functionshade), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(primString(), SYM(shader), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 254 "runpicture.in"
+#line 254 "./runpicture.in"
addFunc(ve, run::gen_runpicture15, primVoid(), SYM(clip), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 264 "runpicture.in"
+#line 264 "./runpicture.in"
addFunc(ve, run::gen_runpicture16, primVoid(), SYM(beginclip), formal(primPicture(), SYM(f), false, false), formal(pathArray(), SYM(g), false, false), formal(primBoolean(), SYM(stroke), true, false), formal(primPen(), SYM(fillrule), true, false), formal(primBoolean(), SYM(copy), true, false));
-#line 271 "runpicture.in"
+#line 271 "./runpicture.in"
addFunc(ve, run::gen_runpicture17, primVoid(), SYM(endclip), formal(primPicture(), SYM(f), false, false));
-#line 276 "runpicture.in"
+#line 276 "./runpicture.in"
addFunc(ve, run::gen_runpicture18, primVoid(), SYM(gsave), formal(primPicture(), SYM(f), false, false));
-#line 281 "runpicture.in"
+#line 281 "./runpicture.in"
addFunc(ve, run::gen_runpicture19, primVoid(), SYM(grestore), formal(primPicture(), SYM(f), false, false));
-#line 286 "runpicture.in"
+#line 286 "./runpicture.in"
addFunc(ve, run::gen_runpicture20, primVoid(), SYM(begingroup), formal(primPicture(), SYM(f), false, false));
-#line 291 "runpicture.in"
+#line 291 "./runpicture.in"
addFunc(ve, run::gen_runpicture21, primVoid(), SYM(endgroup), formal(primPicture(), SYM(f), false, false));
-#line 296 "runpicture.in"
+#line 296 "./runpicture.in"
addFunc(ve, run::gen_runpicture22, primVoid(), SYM(_begingroup3), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(name), false, false), formal(primReal(), SYM(compression), false, false), formal(primReal(), SYM(granularity), false, false), formal(primBoolean(), SYM(closed), false, false), formal(primBoolean(), SYM(tessellate), false, false), formal(primBoolean(), SYM(dobreak), false, false), formal(primBoolean(), SYM(nobreak), false, false), formal(primTriple(), SYM(center), false, false), formal(primInt(), SYM(interaction), false, false));
-#line 305 "runpicture.in"
+#line 305 "./runpicture.in"
addFunc(ve, run::gen_runpicture23, primVoid(), SYM(endgroup3), formal(primPicture(), SYM(f), false, false));
-#line 310 "runpicture.in"
+#line 310 "./runpicture.in"
addFunc(ve, run::gen_runpicture24, primVoid(), SYM(add), formal(primPicture(), SYM(dest), false, false), formal(primPicture(), SYM(src), false, false));
-#line 315 "runpicture.in"
+#line 315 "./runpicture.in"
addFunc(ve, run::gen_runpicture25, primVoid(), SYM(prepend), formal(primPicture(), SYM(dest), false, false), formal(primPicture(), SYM(src), false, false));
-#line 320 "runpicture.in"
+#line 320 "./runpicture.in"
addFunc(ve, run::gen_runpicture26, primVoid(), SYM(postscript), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false));
-#line 325 "runpicture.in"
+#line 325 "./runpicture.in"
addFunc(ve, run::gen_runpicture27, primVoid(), SYM(tex), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false));
-#line 330 "runpicture.in"
+#line 330 "./runpicture.in"
addFunc(ve, run::gen_runpicture28, primVoid(), SYM(postscript), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false), formal(primPair(), SYM(min), false, false), formal(primPair(), SYM(max), false, false));
-#line 335 "runpicture.in"
+#line 335 "./runpicture.in"
addFunc(ve, run::gen_runpicture29, primVoid(), SYM(tex), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false), formal(primPair(), SYM(min), false, false), formal(primPair(), SYM(max), false, false));
-#line 340 "runpicture.in"
+#line 340 "./runpicture.in"
addFunc(ve, run::gen_runpicture30, primVoid(), SYM(texpreamble), formal(primString(), SYM(s), false, false));
-#line 348 "runpicture.in"
+#line 348 "./runpicture.in"
addFunc(ve, run::gen_runpicture31, primVoid(), SYM(deletepreamble));
-#line 355 "runpicture.in"
+#line 355 "./runpicture.in"
addFunc(ve, run::gen_runpicture32, primVoid(), SYM(_labelpath), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(s), false, false), formal(primString(), SYM(size), false, false), formal(primPath(), SYM(g), false, false), formal(primString(), SYM(justify), false, false), formal(primPair(), SYM(offset), false, false), formal(primPen(), SYM(p), false, false));
-#line 361 "runpicture.in"
+#line 361 "./runpicture.in"
addFunc(ve, run::gen_runpicture33, primVoid(), SYM(texreset));
-#line 369 "runpicture.in"
+#line 369 "./runpicture.in"
addFunc(ve, run::gen_runpicture34, primVoid(), SYM(layer), formal(primPicture(), SYM(f), false, false));
-#line 374 "runpicture.in"
+#line 374 "./runpicture.in"
addFunc(ve, run::gen_runpicture35, primVoid(), SYM(newpage), formal(primPicture(), SYM(f), false, false));
-#line 379 "runpicture.in"
+#line 379 "./runpicture.in"
addFunc(ve, run::gen_runpicture36, primVoid(), SYM(_image), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(data), false, false), formal(primPair(), SYM(initial), false, false), formal(primPair(), SYM(final), false, false), formal(penArray(), SYM(palette), true, false), formal(primTransform(), SYM(t), true, false), formal(primBoolean(), SYM(copy), true, false), formal(primBoolean(), SYM(antialias), true, false));
-#line 389 "runpicture.in"
+#line 389 "./runpicture.in"
addFunc(ve, run::gen_runpicture37, primVoid(), SYM(_image), formal(primPicture(), SYM(f), false, false), formal(penArray2(), SYM(data), false, false), formal(primPair(), SYM(initial), false, false), formal(primPair(), SYM(final), false, false), formal(primTransform(), SYM(t), true, false), formal(primBoolean(), SYM(copy), true, false), formal(primBoolean(), SYM(antialias), true, false));
-#line 397 "runpicture.in"
+#line 397 "./runpicture.in"
addFunc(ve, run::gen_runpicture38, primVoid(), SYM(_image), formal(primPicture(), SYM(f), false, false), formal(penFunction(), SYM(f), false, false), formal(primInt(), SYM(width), false, false), formal(primInt(), SYM(height), false, false), formal(primPair(), SYM(initial), false, false), formal(primPair(), SYM(final), false, false), formal(primTransform(), SYM(t), true, false), formal(primBoolean(), SYM(antialias), true, false));
-#line 404 "runpicture.in"
+#line 404 "./runpicture.in"
addFunc(ve, run::gen_runpicture39, primString(), SYM(nativeformat));
-#line 409 "runpicture.in"
+#line 409 "./runpicture.in"
addFunc(ve, run::gen_runpicture40, primBoolean(), SYM(latex));
-#line 414 "runpicture.in"
+#line 414 "./runpicture.in"
addFunc(ve, run::gen_runpicture41, primBoolean(), SYM(pdf));
-#line 419 "runpicture.in"
+#line 419 "./runpicture.in"
addFunc(ve, run::gen_runpicture42, primVoid(), SYM(_shipout), formal(primString(), SYM(prefix), true, false), formal(primPicture(), SYM(f), false, false), formal(primPicture(), SYM(preamble), true, false), formal(primString(), SYM(format), true, false), formal(primBoolean(), SYM(wait), true, false), formal(primBoolean(), SYM(view), true, false), formal(primTransform(), SYM(t), true, false));
-#line 470 "runpicture.in"
+#line 470 "./runpicture.in"
addFunc(ve, run::gen_runpicture43, primVoid(), SYM(shipout3), formal(primString(), SYM(prefix), false, false), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(format), true, false), formal(primReal(), SYM(width), false, false), formal(primReal(), SYM(height), false, false), formal(primReal(), SYM(angle), false, false), formal(primReal(), SYM(zoom), false, false), formal(primTriple(), SYM(m), false, false), formal(primTriple(), SYM(m), false, false), formal(primPair(), SYM(shift), false, false), formal(primPair(), SYM(margin), false, false), formal(realArray2(), SYM(t), false, false), formal(realArray2(), SYM(tup), false, false), formal(realArray(), SYM(background), false, false), formal(tripleArray(), SYM(lights), false, false), formal(realArray2(), SYM(diffuse), false, false), formal(realArray2(), SYM(specular), false, false), formal(primBoolean(), SYM(view), true, false));
-#line 498 "runpicture.in"
+#line 498 "./runpicture.in"
addFunc(ve, run::gen_runpicture44, primVoid(), SYM(shipout3), formal(primString(), SYM(prefix), false, false), formal(primPicture(), SYM(f), false, false), formal(primString(), SYM(format), true, false));
-#line 503 "runpicture.in"
+#line 503 "./runpicture.in"
addFunc(ve, run::gen_runpicture45, primVoid(), SYM(xmap), formal(primString(), SYM(key), false, false), formal(primTransform(), SYM(t), true, false));
-#line 518 "runpicture.in"
+#line 518 "./runpicture.in"
addFunc(ve, run::gen_runpicture46, primVoid(), SYM(deconstruct), formal(primPicture(), SYM(f), false, false), formal(primPicture(), SYM(preamble), true, false), formal(primTransform(), SYM(t), true, false));
-#line 630 "runpicture.in"
+#line 630 "./runpicture.in"
addFunc(ve, run::gen_runpicture47, primVoid(), SYM(_draw), formal(primPicture(), SYM(f), false, false), formal(primPath3(), SYM(g), false, false), formal(primTriple(), SYM(center), true, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(primInt(), SYM(interaction), true, false));
-#line 645 "runpicture.in"
+#line 645 "./runpicture.in"
addFunc(ve, run::gen_runpicture48, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(center), false, false), formal(primBoolean(), SYM(straight), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(penArray(), SYM(colors), false, false), formal(primInt(), SYM(interaction), false, false), formal(primInt(), SYM(digits), false, false), formal(primBoolean(), SYM(primitive), true, false));
-#line 657 "runpicture.in"
+#line 657 "./runpicture.in"
addFunc(ve, run::gen_runpicture49, primVoid(), SYM(drawbeziertriangle), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(primTriple(), SYM(center), false, false), formal(primBoolean(), SYM(straight), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(penArray(), SYM(colors), false, false), formal(primInt(), SYM(interaction), false, false), formal(primInt(), SYM(digits), false, false), formal(primBoolean(), SYM(primitive), true, false));
-#line 670 "runpicture.in"
+#line 670 "./runpicture.in"
addFunc(ve, run::gen_runpicture50, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(p), false, false), formal(realArray(), SYM(knot), false, false), formal(realArray(), SYM(weights), true, false), formal(primPen(), SYM(p), false, false));
-#line 677 "runpicture.in"
+#line 677 "./runpicture.in"
addFunc(ve, run::gen_runpicture51, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray2(), SYM(p), false, false), formal(realArray(), SYM(uknot), false, false), formal(realArray(), SYM(vknot), false, false), formal(realArray2(), SYM(weights), true, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(penArray(), SYM(colors), false, false));
-#line 686 "runpicture.in"
+#line 686 "./runpicture.in"
addFunc(ve, run::gen_runpicture52, primVoid(), SYM(drawSphere), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(primBoolean(), SYM(half), true, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(primInt(), SYM(type), false, false));
-#line 695 "runpicture.in"
+#line 695 "./runpicture.in"
addFunc(ve, run::gen_runpicture53, primVoid(), SYM(drawCylinder), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(primBoolean(), SYM(core), true, false));
-#line 703 "runpicture.in"
+#line 703 "./runpicture.in"
addFunc(ve, run::gen_runpicture54, primVoid(), SYM(drawDisk), formal(primPicture(), SYM(f), false, false), formal(realArray2(), SYM(t), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false));
-#line 710 "runpicture.in"
+#line 710 "./runpicture.in"
addFunc(ve, run::gen_runpicture55, primVoid(), SYM(drawTube), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(g), false, false), formal(primReal(), SYM(width), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(primTriple(), SYM(min), false, false), formal(primTriple(), SYM(max), false, false), formal(primBoolean(), SYM(core), true, false));
-#line 719 "runpicture.in"
+#line 719 "./runpicture.in"
addFunc(ve, run::gen_runpicture56, primVoid(), SYM(drawpixel), formal(primPicture(), SYM(f), false, false), formal(primTriple(), SYM(v), false, false), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(width), true, false));
-#line 725 "runpicture.in"
+#line 725 "./runpicture.in"
addFunc(ve, run::gen_runpicture57, primVoid(), SYM(draw), formal(primPicture(), SYM(f), false, false), formal(tripleArray(), SYM(v), false, false), formal(IntArray2(), SYM(vi), false, false), formal(primTriple(), SYM(center), true, false), formal(tripleArray(), SYM(n), false, false), formal(IntArray2(), SYM(ni), false, false), formal(penArray(), SYM(p), false, false), formal(primReal(), SYM(opacity), false, false), formal(primReal(), SYM(shininess), false, false), formal(primReal(), SYM(metallic), false, false), formal(primReal(), SYM(fresnel0), false, false), formal(penArray(), SYM(c), true, false), formal(IntArray2(), SYM(ci), true, false), formal(primInt(), SYM(interaction), false, false));
-#line 737 "runpicture.in"
+#line 737 "./runpicture.in"
addFunc(ve, run::gen_runpicture58, primTriple(), SYM(min3), formal(primPicture(), SYM(f), false, false));
-#line 742 "runpicture.in"
+#line 742 "./runpicture.in"
addFunc(ve, run::gen_runpicture59, primTriple(), SYM(max3), formal(primPicture(), SYM(f), false, false));
-#line 747 "runpicture.in"
+#line 747 "./runpicture.in"
addFunc(ve, run::gen_runpicture60, primTriple(), SYM(size3), formal(primPicture(), SYM(f), false, false));
-#line 753 "runpicture.in"
+#line 753 "./runpicture.in"
addFunc(ve, run::gen_runpicture61, primPair(), SYM(minratio), formal(primPicture(), SYM(f), false, false));
-#line 758 "runpicture.in"
+#line 758 "./runpicture.in"
addFunc(ve, run::gen_runpicture62, primPair(), SYM(maxratio), formal(primPicture(), SYM(f), false, false));
-#line 763 "runpicture.in"
+#line 763 "./runpicture.in"
addFunc(ve, run::gen_runpicture63, primBoolean(), SYM(is3D), formal(primPicture(), SYM(f), false, false));
}
diff --git a/graphics/asymptote/runpicture.h b/graphics/asymptote/runpicture.h
index db7db84248..ae990b8c29 100644
--- a/graphics/asymptote/runpicture.h
+++ b/graphics/asymptote/runpicture.h
@@ -1,9 +1,7 @@
/***** Autogenerated from runpicture.in; changes will be overwritten *****/
-#ifndef runpicture_H
-#define runpicture_H
+#pragma once
namespace run {
void newPicture(vm::stack *);
}
-#endif // runpicture_H
diff --git a/graphics/asymptote/runstring.cc b/graphics/asymptote/runstring.cc
index a9c557af78..2d0b4a4a0b 100644
--- a/graphics/asymptote/runstring.cc
+++ b/graphics/asymptote/runstring.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runstring.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runstring.in"
+#line 1 "./runstring.in"
/*****
* runstring.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -64,6 +64,9 @@ function *realRealFunction();
#line 10 "runstring.in"
#include <cfloat>
#include <cstring>
+#include <iomanip>
+#include <ctime>
+#include <chrono>
#include <algorithm>
#include "array.h"
@@ -171,124 +174,124 @@ void checkformat(const char *ptr, bool intformat)
#endif
namespace run {
// String operations
-#line 113 "runstring.in"
+#line 116 "./runstring.in"
void emptyString(stack *Stack)
{
-#line 114 "runstring.in"
+#line 117 "./runstring.in"
{Stack->push<string>(emptystring); return;}
}
-#line 119 "runstring.in"
+#line 122 "./runstring.in"
// Int length(string *s);
void gen_runstring1(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 120 "runstring.in"
+#line 123 "./runstring.in"
{Stack->push<Int>((Int) s->length()); return;}
}
-#line 124 "runstring.in"
+#line 127 "./runstring.in"
// Int find(string *s, string t, Int pos=0);
void gen_runstring2(stack *Stack)
{
Int pos=vm::pop<Int>(Stack,0);
string t=vm::pop<string>(Stack);
string * s=vm::pop<string *>(Stack);
-#line 125 "runstring.in"
+#line 128 "./runstring.in"
size_t n=s->find(t,pos);
{Stack->push<Int>(n == string::npos ? (Int) -1 : (Int) n); return;}
}
-#line 130 "runstring.in"
+#line 133 "./runstring.in"
// Int rfind(string *s, string t, Int pos=-1);
void gen_runstring3(stack *Stack)
{
Int pos=vm::pop<Int>(Stack,-1);
string t=vm::pop<string>(Stack);
string * s=vm::pop<string *>(Stack);
-#line 131 "runstring.in"
+#line 134 "./runstring.in"
size_t n=s->rfind(t,pos);
{Stack->push<Int>(n == string::npos ? (Int) -1 : (Int) n); return;}
}
-#line 136 "runstring.in"
+#line 139 "./runstring.in"
// string reverse(string s);
void gen_runstring4(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 137 "runstring.in"
+#line 140 "./runstring.in"
reverse(s.begin(),s.end());
{Stack->push<string>(s); return;}
}
-#line 142 "runstring.in"
+#line 145 "./runstring.in"
// string insert(string s, Int pos, string t);
void gen_runstring5(stack *Stack)
{
string t=vm::pop<string>(Stack);
Int pos=vm::pop<Int>(Stack);
string s=vm::pop<string>(Stack);
-#line 143 "runstring.in"
+#line 146 "./runstring.in"
if ((size_t) pos < s.length())
{Stack->push<string>(s.insert(pos,t)); return;}
{Stack->push<string>(s); return;}
}
-#line 149 "runstring.in"
+#line 152 "./runstring.in"
// string substr(string* s, Int pos, Int n=-1);
void gen_runstring6(stack *Stack)
{
Int n=vm::pop<Int>(Stack,-1);
Int pos=vm::pop<Int>(Stack);
string* s=vm::pop<string*>(Stack);
-#line 150 "runstring.in"
+#line 153 "./runstring.in"
if ((size_t) pos < s->length())
{Stack->push<string>(s->substr(pos,n)); return;}
{Stack->push<string>(emptystring); return;}
}
-#line 156 "runstring.in"
+#line 159 "./runstring.in"
// string erase(string s, Int pos, Int n);
void gen_runstring7(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
Int pos=vm::pop<Int>(Stack);
string s=vm::pop<string>(Stack);
-#line 157 "runstring.in"
+#line 160 "./runstring.in"
if ((size_t) pos < s.length())
{Stack->push<string>(s.erase(pos,n)); return;}
{Stack->push<string>(s); return;}
}
-#line 163 "runstring.in"
+#line 166 "./runstring.in"
// string downcase(string s);
void gen_runstring8(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 164 "runstring.in"
+#line 167 "./runstring.in"
std::transform(s.begin(),s.end(),s.begin(),tolower);
{Stack->push<string>(s); return;}
}
-#line 169 "runstring.in"
+#line 172 "./runstring.in"
// string upcase(string s);
void gen_runstring9(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 170 "runstring.in"
+#line 173 "./runstring.in"
std::transform(s.begin(),s.end(),s.begin(),toupper);
{Stack->push<string>(s); return;}
}
// returns a string constructed by translating all occurrences of the string
// from in an array of string pairs {from,to} to the string to in string s.
-#line 177 "runstring.in"
+#line 180 "./runstring.in"
// string replace(string *S, stringarray2 *translate);
void gen_runstring10(stack *Stack)
{
stringarray2 * translate=vm::pop<stringarray2 *>(Stack);
string * S=vm::pop<string *>(Stack);
-#line 178 "runstring.in"
+#line 181 "./runstring.in"
size_t size=checkArray(translate);
for(size_t i=0; i < size; i++) {
array *a=read<array*>(translate,i);
@@ -318,14 +321,14 @@ void gen_runstring10(stack *Stack)
{Stack->push<string>(buf.str()); return;}
}
-#line 208 "runstring.in"
+#line 211 "./runstring.in"
// string format(string *format, Int x, string locale=emptystring);
void gen_runstring11(stack *Stack)
{
string locale=vm::pop<string>(Stack,emptystring);
Int x=vm::pop<Int>(Stack);
string * format=vm::pop<string *>(Stack);
-#line 209 "runstring.in"
+#line 212 "./runstring.in"
ostringstream out;
const char *p0=format->c_str();
checkformat(p0,true);
@@ -379,7 +382,7 @@ void gen_runstring11(stack *Stack)
{Stack->push<string>(out.str()); return;}
}
-#line 263 "runstring.in"
+#line 266 "./runstring.in"
// string format(string *format, bool forcemath=false, string separator, real x, string locale=emptystring);
void gen_runstring12(stack *Stack)
{
@@ -388,7 +391,7 @@ void gen_runstring12(stack *Stack)
string separator=vm::pop<string>(Stack);
bool forcemath=vm::pop<bool>(Stack,false);
string * format=vm::pop<string *>(Stack);
-#line 265 "runstring.in"
+#line 268 "./runstring.in"
if(*format == "%") {Stack->push<string>(""); return;} // Temporary workaround for github Issue #29.
bool tex=getSetting<string>("tex") != "none";
@@ -515,12 +518,12 @@ void gen_runstring12(stack *Stack)
{Stack->push<string>(out.str()); return;}
}
-#line 392 "runstring.in"
+#line 395 "./runstring.in"
// Int hex(string s);
void gen_runstring13(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 393 "runstring.in"
+#line 396 "./runstring.in"
istringstream is(s);
is.setf(std::ios::hex,std::ios::basefield);
Int value;
@@ -530,45 +533,45 @@ void gen_runstring13(stack *Stack)
error(buf);
}
-#line 403 "runstring.in"
+#line 406 "./runstring.in"
// Int ascii(string s);
void gen_runstring14(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 404 "runstring.in"
+#line 407 "./runstring.in"
{Stack->push<Int>(s.empty() ? -1 : (unsigned char) s[0]); return;}
}
-#line 408 "runstring.in"
+#line 411 "./runstring.in"
// string string(Int x);
void gen_runstring15(stack *Stack)
{
Int x=vm::pop<Int>(Stack);
-#line 409 "runstring.in"
+#line 412 "./runstring.in"
ostringstream buf;
buf << x;
{Stack->push<string>(buf.str()); return;}
}
-#line 415 "runstring.in"
+#line 418 "./runstring.in"
// string string(real x, Int digits=DBL_DIG);
void gen_runstring16(stack *Stack)
{
Int digits=vm::pop<Int>(Stack,DBL_DIG);
real x=vm::pop<real>(Stack);
-#line 416 "runstring.in"
+#line 419 "./runstring.in"
ostringstream buf;
buf.precision(digits);
buf << x;
{Stack->push<string>(buf.str()); return;}
}
-#line 423 "runstring.in"
+#line 426 "./runstring.in"
// string time(string format=defaulttimeformat);
void gen_runstring17(stack *Stack)
{
string format=vm::pop<string>(Stack,defaulttimeformat);
-#line 424 "runstring.in"
+#line 427 "./runstring.in"
#ifdef HAVE_STRFTIME
const time_t bintime=time(NULL);
if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push<string>(""); return;}
@@ -578,13 +581,13 @@ void gen_runstring17(stack *Stack)
#endif
}
-#line 434 "runstring.in"
+#line 437 "./runstring.in"
// string time(Int seconds, string format=defaulttimeformat);
void gen_runstring18(stack *Stack)
{
string format=vm::pop<string>(Stack,defaulttimeformat);
Int seconds=vm::pop<Int>(Stack);
-#line 435 "runstring.in"
+#line 438 "./runstring.in"
#ifdef HAVE_STRFTIME
const time_t bintime=seconds;
if(!strftime(Time,nTime,format.c_str(),localtime(&bintime))) {Stack->push<string>(""); return;}
@@ -596,21 +599,34 @@ void gen_runstring18(stack *Stack)
#endif
}
-#line 447 "runstring.in"
+#line 450 "./runstring.in"
// Int seconds(string t=emptystring, string format=emptystring);
void gen_runstring19(stack *Stack)
{
string format=vm::pop<string>(Stack,emptystring);
string t=vm::pop<string>(Stack,emptystring);
-#line 448 "runstring.in"
-#if defined(HAVE_STRPTIME)
- const time_t bintime=time(NULL);
- tm tm=*localtime(&bintime);
- if(t != "" && !strptime(t.c_str(),format.c_str(),&tm)) {Stack->push<Int>(-1); return;}
- {Stack->push<Int>((Int) mktime(&tm)); return;}
-#else
- {Stack->push<Int>(-1); return;}
-#endif
+#line 451 "./runstring.in"
+ if (t == "")
+ {
+ auto clock = std::chrono::system_clock::now();
+ {Stack->push<Int>(static_cast<Int>(
+ std::chrono::duration_cast<std::chrono::seconds>(
+ clock.time_since_epoch()
+ ).count()
+ )); return;}
+ }
+
+ std::tm tmObj = {};
+ istringstream instream(t);
+ instream.imbue(std::locale(""));
+ instream >> std::get_time(&tmObj,format.c_str());
+
+ if(instream.fail())
+ {
+ {Stack->push<Int>(-1); return;}
+ }
+
+ {Stack->push<Int>(static_cast<Int>(std::mktime(&tmObj))); return;}
}
} // namespace run
@@ -619,45 +635,45 @@ namespace trans {
void gen_runstring_venv(venv &ve)
{
-#line 112 "runstring.in"
+#line 115 "./runstring.in"
REGISTER_BLTIN(run::emptyString,"emptyString");
-#line 119 "runstring.in"
+#line 122 "./runstring.in"
addFunc(ve, run::gen_runstring1, primInt(), SYM(length), formal(primString(), SYM(s), false, false));
-#line 124 "runstring.in"
+#line 127 "./runstring.in"
addFunc(ve, run::gen_runstring2, primInt(), SYM(find), formal(primString(), SYM(s), false, false), formal(primString(), SYM(t), false, false), formal(primInt(), SYM(pos), true, false));
-#line 130 "runstring.in"
+#line 133 "./runstring.in"
addFunc(ve, run::gen_runstring3, primInt(), SYM(rfind), formal(primString(), SYM(s), false, false), formal(primString(), SYM(t), false, false), formal(primInt(), SYM(pos), true, false));
-#line 136 "runstring.in"
+#line 139 "./runstring.in"
addFunc(ve, run::gen_runstring4, primString(), SYM(reverse), formal(primString(), SYM(s), false, false));
-#line 142 "runstring.in"
+#line 145 "./runstring.in"
addFunc(ve, run::gen_runstring5, primString(), SYM(insert), formal(primString(), SYM(s), false, false), formal(primInt(), SYM(pos), false, false), formal(primString(), SYM(t), false, false));
-#line 149 "runstring.in"
+#line 152 "./runstring.in"
addFunc(ve, run::gen_runstring6, primString(), SYM(substr), formal(primString(), SYM(s), false, false), formal(primInt(), SYM(pos), false, false), formal(primInt(), SYM(n), true, false));
-#line 156 "runstring.in"
+#line 159 "./runstring.in"
addFunc(ve, run::gen_runstring7, primString(), SYM(erase), formal(primString(), SYM(s), false, false), formal(primInt(), SYM(pos), false, false), formal(primInt(), SYM(n), false, false));
-#line 163 "runstring.in"
+#line 166 "./runstring.in"
addFunc(ve, run::gen_runstring8, primString(), SYM(downcase), formal(primString(), SYM(s), false, false));
-#line 169 "runstring.in"
+#line 172 "./runstring.in"
addFunc(ve, run::gen_runstring9, primString(), SYM(upcase), formal(primString(), SYM(s), false, false));
-#line 175 "runstring.in"
+#line 178 "./runstring.in"
addFunc(ve, run::gen_runstring10, primString(), SYM(replace), formal(primString(), SYM(s), false, false), formal(stringArray2(), SYM(translate), false, false));
-#line 208 "runstring.in"
+#line 211 "./runstring.in"
addFunc(ve, run::gen_runstring11, primString(), SYM(format), formal(primString(), SYM(format), false, false), formal(primInt(), SYM(x), false, false), formal(primString(), SYM(locale), true, false));
-#line 263 "runstring.in"
+#line 266 "./runstring.in"
addFunc(ve, run::gen_runstring12, primString(), SYM(format), formal(primString(), SYM(format), false, false), formal(primBoolean(), SYM(forcemath), true, false), formal(primString(), SYM(separator), false, false), formal(primReal(), SYM(x), false, false), formal(primString(), SYM(locale), true, false));
-#line 392 "runstring.in"
+#line 395 "./runstring.in"
addFunc(ve, run::gen_runstring13, primInt(), SYM(hex), formal(primString(), SYM(s), false, false));
-#line 403 "runstring.in"
+#line 406 "./runstring.in"
addFunc(ve, run::gen_runstring14, primInt(), SYM(ascii), formal(primString(), SYM(s), false, false));
-#line 408 "runstring.in"
+#line 411 "./runstring.in"
addFunc(ve, run::gen_runstring15, primString(), SYM(string), formal(primInt(), SYM(x), false, false));
-#line 415 "runstring.in"
+#line 418 "./runstring.in"
addFunc(ve, run::gen_runstring16, primString(), SYM(string), formal(primReal(), SYM(x), false, false), formal(primInt(), SYM(digits), true, false));
-#line 423 "runstring.in"
+#line 426 "./runstring.in"
addFunc(ve, run::gen_runstring17, primString(), SYM(time), formal(primString(), SYM(format), true, false));
-#line 434 "runstring.in"
+#line 437 "./runstring.in"
addFunc(ve, run::gen_runstring18, primString(), SYM(time), formal(primInt(), SYM(seconds), false, false), formal(primString(), SYM(format), true, false));
-#line 447 "runstring.in"
+#line 450 "./runstring.in"
addFunc(ve, run::gen_runstring19, primInt(), SYM(seconds), formal(primString(), SYM(t), true, false), formal(primString(), SYM(format), true, false));
}
diff --git a/graphics/asymptote/runstring.h b/graphics/asymptote/runstring.h
index 0092cf5d57..aba6f0a10a 100644
--- a/graphics/asymptote/runstring.h
+++ b/graphics/asymptote/runstring.h
@@ -1,9 +1,7 @@
/***** Autogenerated from runstring.in; changes will be overwritten *****/
-#ifndef runstring_H
-#define runstring_H
+#pragma once
namespace run {
void emptyString(vm::stack *);
}
-#endif // runstring_H
diff --git a/graphics/asymptote/runstring.in b/graphics/asymptote/runstring.in
index b57a921515..24c4ef89b1 100644
--- a/graphics/asymptote/runstring.in
+++ b/graphics/asymptote/runstring.in
@@ -9,6 +9,9 @@ stringarray2* => stringArray2()
#include <cfloat>
#include <cstring>
+#include <iomanip>
+#include <ctime>
+#include <chrono>
#include <algorithm>
#include "array.h"
@@ -446,12 +449,25 @@ string time(Int seconds, string format=defaulttimeformat)
Int seconds(string t=emptystring, string format=emptystring)
{
-#if defined(HAVE_STRPTIME)
- const time_t bintime=time(NULL);
- tm tm=*localtime(&bintime);
- if(t != "" && !strptime(t.c_str(),format.c_str(),&tm)) return -1;
- return (Int) mktime(&tm);
-#else
- return -1;
-#endif
+ if (t == "")
+ {
+ auto clock = std::chrono::system_clock::now();
+ return static_cast<Int>(
+ std::chrono::duration_cast<std::chrono::seconds>(
+ clock.time_since_epoch()
+ ).count()
+ );
+ }
+
+ std::tm tmObj = {};
+ istringstream instream(t);
+ instream.imbue(std::locale(""));
+ instream >> std::get_time(&tmObj,format.c_str());
+
+ if(instream.fail())
+ {
+ return -1;
+ }
+
+ return static_cast<Int>(std::mktime(&tmObj));
}
diff --git a/graphics/asymptote/runsystem.cc b/graphics/asymptote/runsystem.cc
index 365be1396a..96a24b5507 100644
--- a/graphics/asymptote/runsystem.cc
+++ b/graphics/asymptote/runsystem.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runsystem.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runsystem.in"
+#line 1 "./runsystem.in"
/*****
* runsystem.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -62,7 +62,7 @@ function *realRealFunction();
#define CURRENTPEN processData().currentpen
#line 12 "runsystem.in"
-#include "process.h"
+#include "asyprocess.h"
#include "stack.h"
#include "locate.h"
@@ -163,144 +163,144 @@ void exitFunction(stack *Stack)
#endif
namespace run {
-#line 107 "runsystem.in"
+#line 107 "./runsystem.in"
// string outname();
void gen_runsystem0(stack *Stack)
{
-#line 108 "runsystem.in"
+#line 108 "./runsystem.in"
{Stack->push<string>(outname()); return;}
}
-#line 112 "runsystem.in"
+#line 112 "./runsystem.in"
// void atupdate(callable *f);
void gen_runsystem1(stack *Stack)
{
callable * f=vm::pop<callable *>(Stack);
-#line 113 "runsystem.in"
+#line 113 "./runsystem.in"
processData().atUpdateFunction=f;
}
-#line 117 "runsystem.in"
+#line 117 "./runsystem.in"
// callable* atupdate();
void gen_runsystem2(stack *Stack)
{
-#line 118 "runsystem.in"
+#line 118 "./runsystem.in"
{Stack->push<callable*>(processData().atUpdateFunction); return;}
}
-#line 122 "runsystem.in"
+#line 122 "./runsystem.in"
// void atexit(callable *f);
void gen_runsystem3(stack *Stack)
{
callable * f=vm::pop<callable *>(Stack);
-#line 123 "runsystem.in"
+#line 123 "./runsystem.in"
processData().atExitFunction=f;
}
-#line 127 "runsystem.in"
+#line 127 "./runsystem.in"
// callable* atexit();
void gen_runsystem4(stack *Stack)
{
-#line 128 "runsystem.in"
+#line 128 "./runsystem.in"
{Stack->push<callable*>(processData().atExitFunction); return;}
}
-#line 132 "runsystem.in"
+#line 132 "./runsystem.in"
// void atbreakpoint(callableBp *f);
void gen_runsystem5(stack *Stack)
{
callableBp * f=vm::pop<callableBp *>(Stack);
-#line 133 "runsystem.in"
+#line 133 "./runsystem.in"
processData().atBreakpointFunction=f;
}
-#line 137 "runsystem.in"
+#line 137 "./runsystem.in"
// void breakpoint(runnable *s=NULL);
void gen_runsystem6(stack *Stack)
{
runnable * s=vm::pop<runnable *>(Stack,NULL);
-#line 138 "runsystem.in"
+#line 138 "./runsystem.in"
breakpoint(Stack,s);
}
-#line 142 "runsystem.in"
+#line 142 "./runsystem.in"
// string locatefile(string file, bool full=true);
void gen_runsystem7(stack *Stack)
{
bool full=vm::pop<bool>(Stack,true);
string file=vm::pop<string>(Stack);
-#line 143 "runsystem.in"
+#line 143 "./runsystem.in"
{Stack->push<string>(locateFile(file,full)); return;}
}
-#line 147 "runsystem.in"
+#line 147 "./runsystem.in"
// void stop(string file, Int line, runnable *s=NULL);
void gen_runsystem8(stack *Stack)
{
runnable * s=vm::pop<runnable *>(Stack,NULL);
Int line=vm::pop<Int>(Stack);
string file=vm::pop<string>(Stack);
-#line 148 "runsystem.in"
+#line 148 "./runsystem.in"
file=locateFile(file);
clear(file,line);
cout << "setting breakpoint at " << file << ": " << line << endl;
bplist.push_back(bpinfo(file,line,s));
}
-#line 155 "runsystem.in"
+#line 155 "./runsystem.in"
// void breakpoints();
void gen_runsystem9(stack *)
{
-#line 156 "runsystem.in"
+#line 156 "./runsystem.in"
for(mem::list<bpinfo>::iterator p=bplist.begin(); p != bplist.end(); ++p)
cout << p->f.name() << ": " << p->f.line() << endl;
}
-#line 161 "runsystem.in"
+#line 161 "./runsystem.in"
// void clear(string file, Int line);
void gen_runsystem10(stack *Stack)
{
Int line=vm::pop<Int>(Stack);
string file=vm::pop<string>(Stack);
-#line 162 "runsystem.in"
+#line 162 "./runsystem.in"
file=locateFile(file);
clear(file,line,true);
}
-#line 167 "runsystem.in"
+#line 167 "./runsystem.in"
// void clear();
void gen_runsystem11(stack *)
{
-#line 168 "runsystem.in"
+#line 168 "./runsystem.in"
bplist.clear();
}
-#line 172 "runsystem.in"
+#line 172 "./runsystem.in"
// void warn(string s);
void gen_runsystem12(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 173 "runsystem.in"
+#line 173 "./runsystem.in"
Warn(s);
}
-#line 177 "runsystem.in"
+#line 177 "./runsystem.in"
// void nowarn(string s);
void gen_runsystem13(stack *Stack)
{
string s=vm::pop<string>(Stack);
-#line 178 "runsystem.in"
+#line 178 "./runsystem.in"
noWarn(s);
}
-#line 182 "runsystem.in"
+#line 182 "./runsystem.in"
// void warning(string s, string t, bool position=false);
void gen_runsystem14(stack *Stack)
{
bool position=vm::pop<bool>(Stack,false);
string t=vm::pop<string>(Stack);
string s=vm::pop<string>(Stack);
-#line 183 "runsystem.in"
+#line 183 "./runsystem.in"
if(settings::warn(s)) {
em.warning(position ? getPos() : nullPos,s);
em << t;
@@ -309,44 +309,44 @@ void gen_runsystem14(stack *Stack)
}
// Strip directory from string
-#line 192 "runsystem.in"
+#line 192 "./runsystem.in"
// string stripdirectory(string *s);
void gen_runsystem15(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 193 "runsystem.in"
+#line 193 "./runsystem.in"
{Stack->push<string>(stripDir(*s)); return;}
}
// Strip directory from string
-#line 198 "runsystem.in"
+#line 198 "./runsystem.in"
// string stripfile(string *s);
void gen_runsystem16(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 199 "runsystem.in"
+#line 199 "./runsystem.in"
{Stack->push<string>(stripFile(*s)); return;}
}
// Strip file extension from string
-#line 204 "runsystem.in"
+#line 204 "./runsystem.in"
// string stripextension(string *s);
void gen_runsystem17(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 205 "runsystem.in"
+#line 205 "./runsystem.in"
{Stack->push<string>(stripExt(*s)); return;}
}
// Call ImageMagick convert.
-#line 210 "runsystem.in"
+#line 210 "./runsystem.in"
// Int convert(string args=emptystring, string file=emptystring, string format=emptystring);
void gen_runsystem18(stack *Stack)
{
string format=vm::pop<string>(Stack,emptystring);
string file=vm::pop<string>(Stack,emptystring);
string args=vm::pop<string>(Stack,emptystring);
-#line 212 "runsystem.in"
+#line 212 "./runsystem.in"
string name=convertname(file,format);
mem::vector<string> cmd;
string s=getSetting<string>("convert");
@@ -373,14 +373,14 @@ void gen_runsystem18(stack *Stack)
}
// Call ImageMagick animate.
-#line 239 "runsystem.in"
+#line 239 "./runsystem.in"
// Int animate(string args=emptystring, string file=emptystring, string format=emptystring);
void gen_runsystem19(stack *Stack)
{
string format=vm::pop<string>(Stack,emptystring);
string file=vm::pop<string>(Stack,emptystring);
string args=vm::pop<string>(Stack,emptystring);
-#line 241 "runsystem.in"
+#line 241 "./runsystem.in"
string name=convertname(file,format);
if(view()) {
mem::vector<string> cmd;
@@ -395,12 +395,12 @@ void gen_runsystem19(stack *Stack)
{Stack->push<Int>(0); return;}
}
-#line 256 "runsystem.in"
+#line 256 "./runsystem.in"
// void purge(Int divisor=0);
void gen_runsystem20(stack *Stack)
{
Int divisor=vm::pop<Int>(Stack,0);
-#line 257 "runsystem.in"
+#line 257 "./runsystem.in"
purge(divisor);
}
@@ -410,47 +410,47 @@ namespace trans {
void gen_runsystem_venv(venv &ve)
{
-#line 107 "runsystem.in"
+#line 107 "./runsystem.in"
addFunc(ve, run::gen_runsystem0, primString(), SYM(outname));
-#line 112 "runsystem.in"
+#line 112 "./runsystem.in"
addFunc(ve, run::gen_runsystem1, primVoid(), SYM(atupdate), formal(voidFunction(), SYM(f), false, false));
-#line 117 "runsystem.in"
+#line 117 "./runsystem.in"
addFunc(ve, run::gen_runsystem2, voidFunction(), SYM(atupdate));
-#line 122 "runsystem.in"
+#line 122 "./runsystem.in"
addFunc(ve, run::gen_runsystem3, primVoid(), SYM(atexit), formal(voidFunction(), SYM(f), false, false));
-#line 127 "runsystem.in"
+#line 127 "./runsystem.in"
addFunc(ve, run::gen_runsystem4, voidFunction(), SYM(atexit));
-#line 132 "runsystem.in"
+#line 132 "./runsystem.in"
addFunc(ve, run::gen_runsystem5, primVoid(), SYM(atbreakpoint), formal(breakpointFunction(), SYM(f), false, false));
-#line 137 "runsystem.in"
+#line 137 "./runsystem.in"
addFunc(ve, run::gen_runsystem6, primVoid(), SYM(breakpoint), formal(primCode(), SYM(s), true, false));
-#line 142 "runsystem.in"
+#line 142 "./runsystem.in"
addFunc(ve, run::gen_runsystem7, primString(), SYM(locatefile), formal(primString(), SYM(file), false, false), formal(primBoolean(), SYM(full), true, false));
-#line 147 "runsystem.in"
+#line 147 "./runsystem.in"
addFunc(ve, run::gen_runsystem8, primVoid(), SYM(stop), formal(primString(), SYM(file), false, false), formal(primInt(), SYM(line), false, false), formal(primCode(), SYM(s), true, false));
-#line 155 "runsystem.in"
+#line 155 "./runsystem.in"
addFunc(ve, run::gen_runsystem9, primVoid(), SYM(breakpoints));
-#line 161 "runsystem.in"
+#line 161 "./runsystem.in"
addFunc(ve, run::gen_runsystem10, primVoid(), SYM(clear), formal(primString(), SYM(file), false, false), formal(primInt(), SYM(line), false, false));
-#line 167 "runsystem.in"
+#line 167 "./runsystem.in"
addFunc(ve, run::gen_runsystem11, primVoid(), SYM(clear));
-#line 172 "runsystem.in"
+#line 172 "./runsystem.in"
addFunc(ve, run::gen_runsystem12, primVoid(), SYM(warn), formal(primString(), SYM(s), false, false));
-#line 177 "runsystem.in"
+#line 177 "./runsystem.in"
addFunc(ve, run::gen_runsystem13, primVoid(), SYM(nowarn), formal(primString(), SYM(s), false, false));
-#line 182 "runsystem.in"
+#line 182 "./runsystem.in"
addFunc(ve, run::gen_runsystem14, primVoid(), SYM(warning), formal(primString(), SYM(s), false, false), formal(primString(), SYM(t), false, false), formal(primBoolean(), SYM(position), true, false));
-#line 191 "runsystem.in"
+#line 191 "./runsystem.in"
addFunc(ve, run::gen_runsystem15, primString(), SYM(stripdirectory), formal(primString(), SYM(s), false, false));
-#line 197 "runsystem.in"
+#line 197 "./runsystem.in"
addFunc(ve, run::gen_runsystem16, primString(), SYM(stripfile), formal(primString(), SYM(s), false, false));
-#line 203 "runsystem.in"
+#line 203 "./runsystem.in"
addFunc(ve, run::gen_runsystem17, primString(), SYM(stripextension), formal(primString(), SYM(s), false, false));
-#line 209 "runsystem.in"
+#line 209 "./runsystem.in"
addFunc(ve, run::gen_runsystem18, primInt(), SYM(convert), formal(primString(), SYM(args), true, false), formal(primString(), SYM(file), true, false), formal(primString(), SYM(format), true, false));
-#line 238 "runsystem.in"
+#line 238 "./runsystem.in"
addFunc(ve, run::gen_runsystem19, primInt(), SYM(animate), formal(primString(), SYM(args), true, false), formal(primString(), SYM(file), true, false), formal(primString(), SYM(format), true, false));
-#line 256 "runsystem.in"
+#line 256 "./runsystem.in"
addFunc(ve, run::gen_runsystem20, primVoid(), SYM(purge), formal(primInt(), SYM(divisor), true, false));
}
diff --git a/graphics/asymptote/runsystem.h b/graphics/asymptote/runsystem.h
index f6912e1076..3386d3d943 100644
--- a/graphics/asymptote/runsystem.h
+++ b/graphics/asymptote/runsystem.h
@@ -1,8 +1,6 @@
/***** Autogenerated from runsystem.in; changes will be overwritten *****/
-#ifndef runsystem_H
-#define runsystem_H
+#pragma once
namespace run {
}
-#endif // runsystem_H
diff --git a/graphics/asymptote/runsystem.in b/graphics/asymptote/runsystem.in
index 6bf34358c2..76c40e4a32 100644
--- a/graphics/asymptote/runsystem.in
+++ b/graphics/asymptote/runsystem.in
@@ -9,7 +9,7 @@ callable* => voidFunction()
callableBp* => breakpointFunction()
runnable* => primCode()
-#include "process.h"
+#include "asyprocess.h"
#include "stack.h"
#include "locate.h"
diff --git a/graphics/asymptote/runtime.cc b/graphics/asymptote/runtime.cc
index ba5a6d0f66..9d4b0d01e2 100644
--- a/graphics/asymptote/runtime.cc
+++ b/graphics/asymptote/runtime.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runtime.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runtime.in"
+#line 1 "./runtime.in"
/*****
* runtime.in
* Tom Prince 2005/4/15
@@ -30,7 +30,7 @@
// Use Void f() instead of void f() to force an explicit Stack argument.
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -78,9 +78,15 @@ function *realRealFunction();
#include <iostream>
#include <fstream>
#include <time.h>
+
+#include <chrono>
+#include <thread>
+
+#if !defined(_WIN32)
#include <sys/times.h>
-#include <locale.h>
+#endif
+#include <locale.h>
#include "angle.h"
#include "pair.h"
#include "triple.h"
@@ -96,7 +102,7 @@ function *realRealFunction();
#include "builtin.h"
#include "texfile.h"
#include "pipestream.h"
-#include "parser.h"
+#include "asyparser.h"
#include "stack.h"
#include "util.h"
#include "locate.h"
@@ -104,7 +110,7 @@ function *realRealFunction();
#include "callable.h"
#include "stm.h"
#include "lexical.h"
-#include "process.h"
+#include "asyprocess.h"
#include "arrayop.h"
#include "seconds.h"
@@ -257,54 +263,54 @@ void unused(void *)
namespace run {
// Initializers
-#line 229 "runtime.in"
+#line 235 "./runtime.in"
void IntZero(stack *Stack)
{
-#line 230 "runtime.in"
+#line 236 "./runtime.in"
{Stack->push<Int>(0); return;}
}
-#line 235 "runtime.in"
+#line 241 "./runtime.in"
void realZero(stack *Stack)
{
-#line 236 "runtime.in"
+#line 242 "./runtime.in"
{Stack->push<real>(0.0); return;}
}
-#line 240 "runtime.in"
+#line 246 "./runtime.in"
void boolFalse(stack *Stack)
{
-#line 241 "runtime.in"
+#line 247 "./runtime.in"
{Stack->push<bool>(false); return;}
}
-#line 245 "runtime.in"
+#line 251 "./runtime.in"
// bool isnan(real x);
void gen_runtime3(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 246 "runtime.in"
+#line 252 "./runtime.in"
{Stack->push<bool>(std::isnan(x)); return;}
}
-#line 250 "runtime.in"
+#line 256 "./runtime.in"
void pushNullArray(stack *Stack)
{
-#line 251 "runtime.in"
+#line 257 "./runtime.in"
{Stack->push<array*>(0); return;}
}
-#line 255 "runtime.in"
+#line 261 "./runtime.in"
void pushNullRecord(stack *Stack)
{
-#line 256 "runtime.in"
+#line 262 "./runtime.in"
{Stack->push<vmFrame*>(0); return;}
}
-#line 260 "runtime.in"
+#line 266 "./runtime.in"
void pushNullFunction(stack *Stack)
{
-#line 261 "runtime.in"
+#line 267 "./runtime.in"
{Stack->push(nullfunc::instance()); return;}
}
@@ -313,222 +319,222 @@ void pushNullFunction(stack *Stack)
// Put the default value token on the stack (in place of an argument when
// making a function call).
-#line 270 "runtime.in"
+#line 276 "./runtime.in"
void pushDefault(stack *Stack)
{
-#line 271 "runtime.in"
+#line 277 "./runtime.in"
{Stack->push(Default); return;}
}
// Test if the value on the stack is the default value token.
-#line 277 "runtime.in"
+#line 283 "./runtime.in"
void isDefault(stack *Stack)
{
item i=vm::pop(Stack);
-#line 278 "runtime.in"
+#line 284 "./runtime.in"
{Stack->push<bool>(isdefault(i)); return;}
}
// Casts
-#line 284 "runtime.in"
+#line 290 "./runtime.in"
void pairToGuide(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 285 "runtime.in"
+#line 291 "./runtime.in"
{Stack->push<guide*>(new pairguide(z)); return;}
}
-#line 290 "runtime.in"
+#line 296 "./runtime.in"
void pathToGuide(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 291 "runtime.in"
+#line 297 "./runtime.in"
{Stack->push<guide*>(new pathguide(p)); return;}
}
-#line 295 "runtime.in"
+#line 301 "./runtime.in"
void guideToPath(stack *Stack)
{
guide * g=vm::pop<guide *>(Stack);
-#line 296 "runtime.in"
+#line 302 "./runtime.in"
{Stack->push<path>(g->solve()); return;}
}
// Pen operations
-#line 302 "runtime.in"
+#line 308 "./runtime.in"
void newPen(stack *Stack)
{
-#line 303 "runtime.in"
+#line 309 "./runtime.in"
{Stack->push<pen>(pen()); return;}
}
-#line 308 "runtime.in"
+#line 314 "./runtime.in"
// bool ==(pen a, pen b);
void gen_runtime13(stack *Stack)
{
pen b=vm::pop<pen>(Stack);
pen a=vm::pop<pen>(Stack);
-#line 309 "runtime.in"
+#line 315 "./runtime.in"
{Stack->push<bool>(a == b); return;}
}
-#line 313 "runtime.in"
+#line 319 "./runtime.in"
// bool !=(pen a, pen b);
void gen_runtime14(stack *Stack)
{
pen b=vm::pop<pen>(Stack);
pen a=vm::pop<pen>(Stack);
-#line 314 "runtime.in"
+#line 320 "./runtime.in"
{Stack->push<bool>(a != b); return;}
}
-#line 318 "runtime.in"
+#line 324 "./runtime.in"
// pen +(pen a, pen b);
void gen_runtime15(stack *Stack)
{
pen b=vm::pop<pen>(Stack);
pen a=vm::pop<pen>(Stack);
-#line 319 "runtime.in"
+#line 325 "./runtime.in"
{Stack->push<pen>(a+b); return;}
}
-#line 323 "runtime.in"
+#line 329 "./runtime.in"
// pen *(real a, pen b);
void gen_runtime16(stack *Stack)
{
pen b=vm::pop<pen>(Stack);
real a=vm::pop<real>(Stack);
-#line 324 "runtime.in"
+#line 330 "./runtime.in"
{Stack->push<pen>(a*b); return;}
}
-#line 328 "runtime.in"
+#line 334 "./runtime.in"
// pen *(pen a, real b);
void gen_runtime17(stack *Stack)
{
real b=vm::pop<real>(Stack);
pen a=vm::pop<pen>(Stack);
-#line 329 "runtime.in"
+#line 335 "./runtime.in"
{Stack->push<pen>(b*a); return;}
}
-#line 333 "runtime.in"
+#line 339 "./runtime.in"
// pair max(pen p);
void gen_runtime18(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 334 "runtime.in"
+#line 340 "./runtime.in"
{Stack->push<pair>(p.bounds().Max()); return;}
}
-#line 338 "runtime.in"
+#line 344 "./runtime.in"
// pair min(pen p);
void gen_runtime19(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 339 "runtime.in"
+#line 345 "./runtime.in"
{Stack->push<pair>(p.bounds().Min()); return;}
}
// Reset the meaning of pen default attributes.
-#line 344 "runtime.in"
+#line 350 "./runtime.in"
// void resetdefaultpen();
void gen_runtime20(stack *)
{
-#line 345 "runtime.in"
+#line 351 "./runtime.in"
processData().defaultpen=camp::pen::initialpen();
}
-#line 349 "runtime.in"
+#line 355 "./runtime.in"
// void defaultpen(pen p);
void gen_runtime21(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 350 "runtime.in"
+#line 356 "./runtime.in"
processData().defaultpen=pen(resolvepen,p);
}
-#line 354 "runtime.in"
+#line 360 "./runtime.in"
// pen defaultpen();
void gen_runtime22(stack *Stack)
{
-#line 355 "runtime.in"
+#line 361 "./runtime.in"
{Stack->push<pen>(processData().defaultpen); return;}
}
-#line 359 "runtime.in"
+#line 365 "./runtime.in"
// bool invisible(pen p);
void gen_runtime23(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 360 "runtime.in"
+#line 366 "./runtime.in"
{Stack->push<bool>(p.invisible()); return;}
}
-#line 364 "runtime.in"
+#line 370 "./runtime.in"
// pen invisible();
void gen_runtime24(stack *Stack)
{
-#line 365 "runtime.in"
+#line 371 "./runtime.in"
{Stack->push<pen>(pen(invisiblepen)); return;}
}
-#line 369 "runtime.in"
+#line 375 "./runtime.in"
// pen gray(pen p);
void gen_runtime25(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 370 "runtime.in"
+#line 376 "./runtime.in"
p.togrey();
{Stack->push<pen>(p); return;}
}
-#line 375 "runtime.in"
+#line 381 "./runtime.in"
// pen rgb(pen p);
void gen_runtime26(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 376 "runtime.in"
+#line 382 "./runtime.in"
p.torgb();
{Stack->push<pen>(p); return;}
}
-#line 381 "runtime.in"
+#line 387 "./runtime.in"
// pen cmyk(pen p);
void gen_runtime27(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 382 "runtime.in"
+#line 388 "./runtime.in"
p.tocmyk();
{Stack->push<pen>(p); return;}
}
-#line 387 "runtime.in"
+#line 393 "./runtime.in"
// pen interp(pen a, pen b, real t);
void gen_runtime28(stack *Stack)
{
real t=vm::pop<real>(Stack);
pen b=vm::pop<pen>(Stack);
pen a=vm::pop<pen>(Stack);
-#line 388 "runtime.in"
+#line 394 "./runtime.in"
{Stack->push<pen>(interpolate(a,b,t)); return;}
}
-#line 392 "runtime.in"
+#line 398 "./runtime.in"
// pen rgb(real r, real g, real b);
void gen_runtime29(stack *Stack)
{
real b=vm::pop<real>(Stack);
real g=vm::pop<real>(Stack);
real r=vm::pop<real>(Stack);
-#line 393 "runtime.in"
+#line 399 "./runtime.in"
{Stack->push<pen>(pen(r,g,b)); return;}
}
-#line 397 "runtime.in"
+#line 403 "./runtime.in"
// pen cmyk(real c, real m, real y, real k);
void gen_runtime30(stack *Stack)
{
@@ -536,25 +542,25 @@ void gen_runtime30(stack *Stack)
real y=vm::pop<real>(Stack);
real m=vm::pop<real>(Stack);
real c=vm::pop<real>(Stack);
-#line 398 "runtime.in"
+#line 404 "./runtime.in"
{Stack->push<pen>(pen(c,m,y,k)); return;}
}
-#line 402 "runtime.in"
+#line 408 "./runtime.in"
// pen gray(real gray);
void gen_runtime31(stack *Stack)
{
real gray=vm::pop<real>(Stack);
-#line 403 "runtime.in"
+#line 409 "./runtime.in"
{Stack->push<pen>(pen(gray)); return;}
}
-#line 407 "runtime.in"
+#line 413 "./runtime.in"
// realarray* colors(pen p);
void gen_runtime32(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 408 "runtime.in"
+#line 414 "./runtime.in"
size_t n=ColorComponents[p.colorspace()];
array *a=new array(n);
@@ -581,87 +587,87 @@ void gen_runtime32(stack *Stack)
{Stack->push<realarray*>(a); return;}
}
-#line 435 "runtime.in"
+#line 441 "./runtime.in"
// string hex(pen p);
void gen_runtime33(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 436 "runtime.in"
+#line 442 "./runtime.in"
{Stack->push<string>(p.hex()); return;}
}
-#line 440 "runtime.in"
+#line 446 "./runtime.in"
// Int byte(real x);
void gen_runtime34(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 441 "runtime.in"
+#line 447 "./runtime.in"
{Stack->push<Int>(camp::byte(x)); return;}
}
-#line 445 "runtime.in"
+#line 451 "./runtime.in"
// real byteinv(Int x);
void gen_runtime35(stack *Stack)
{
Int x=vm::pop<Int>(Stack);
-#line 446 "runtime.in"
+#line 452 "./runtime.in"
{Stack->push<real>(x >= 0 ? camp::byteinv(x) : 0.0); return;}
}
-#line 450 "runtime.in"
+#line 456 "./runtime.in"
// string colorspace(pen p);
void gen_runtime36(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 451 "runtime.in"
+#line 457 "./runtime.in"
string s=ColorDeviceSuffix[p.colorspace()];
std::transform(s.begin(),s.end(),s.begin(),tolower);
{Stack->push<string>(s); return;}
}
-#line 457 "runtime.in"
+#line 463 "./runtime.in"
// pen pattern(string *s);
void gen_runtime37(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 458 "runtime.in"
+#line 464 "./runtime.in"
{Stack->push<pen>(pen(setpattern,*s)); return;}
}
-#line 462 "runtime.in"
+#line 468 "./runtime.in"
// string pattern(pen p);
void gen_runtime38(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 463 "runtime.in"
+#line 469 "./runtime.in"
{Stack->push<string>(p.fillpattern()); return;}
}
-#line 467 "runtime.in"
+#line 473 "./runtime.in"
// pen fillrule(Int n);
void gen_runtime39(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 468 "runtime.in"
+#line 474 "./runtime.in"
{Stack->push<pen>(pen(n >= 0 && n < nFill ? (FillRule) n : DEFFILL)); return;}
}
-#line 472 "runtime.in"
+#line 478 "./runtime.in"
// Int fillrule(pen p);
void gen_runtime40(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 473 "runtime.in"
+#line 479 "./runtime.in"
{Stack->push<Int>(p.Fillrule()); return;}
}
-#line 477 "runtime.in"
+#line 483 "./runtime.in"
// pen opacity(real opacity=1.0, string blend=defaulttransparency);
void gen_runtime41(stack *Stack)
{
string blend=vm::pop<string>(Stack,defaulttransparency);
real opacity=vm::pop<real>(Stack,1.0);
-#line 478 "runtime.in"
+#line 484 "./runtime.in"
for(Int i=0; i < nBlendMode; ++i)
if(blend == BlendMode[i]) {Stack->push<pen>(pen(Transparency(blend,opacity))); return;}
@@ -670,25 +676,25 @@ void gen_runtime41(stack *Stack)
error(buf);
}
-#line 487 "runtime.in"
+#line 493 "./runtime.in"
// real opacity(pen p);
void gen_runtime42(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 488 "runtime.in"
+#line 494 "./runtime.in"
{Stack->push<real>(p.opacity()); return;}
}
-#line 492 "runtime.in"
+#line 498 "./runtime.in"
// string blend(pen p);
void gen_runtime43(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 493 "runtime.in"
+#line 499 "./runtime.in"
{Stack->push<string>(p.blend()); return;}
}
-#line 497 "runtime.in"
+#line 503 "./runtime.in"
// pen linetype(realarray *pattern, real offset=0, bool scale=true, bool adjust=true);
void gen_runtime44(stack *Stack)
{
@@ -696,7 +702,7 @@ void gen_runtime44(stack *Stack)
bool scale=vm::pop<bool>(Stack,true);
real offset=vm::pop<real>(Stack,0);
realarray * pattern=vm::pop<realarray *>(Stack);
-#line 499 "runtime.in"
+#line 505 "./runtime.in"
size_t size=checkArray(pattern);
array *a=new array(size);
for(size_t i=0; i < size; ++i)
@@ -705,272 +711,272 @@ void gen_runtime44(stack *Stack)
{Stack->push<pen>(pen(LineType(*a,offset,scale,adjust))); return;}
}
-#line 508 "runtime.in"
+#line 514 "./runtime.in"
// realarray* linetype(pen p=CURRENTPEN);
void gen_runtime45(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 509 "runtime.in"
+#line 515 "./runtime.in"
array a=p.linetype()->pattern;
{Stack->push<realarray*>(copyArray(&a)); return;}
}
-#line 514 "runtime.in"
+#line 520 "./runtime.in"
// real offset(pen p);
void gen_runtime46(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 515 "runtime.in"
+#line 521 "./runtime.in"
{Stack->push<real>(p.linetype()->offset); return;}
}
-#line 519 "runtime.in"
+#line 525 "./runtime.in"
// bool scale(pen p);
void gen_runtime47(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 520 "runtime.in"
+#line 526 "./runtime.in"
{Stack->push<bool>(p.linetype()->scale); return;}
}
-#line 524 "runtime.in"
+#line 530 "./runtime.in"
// bool adjust(pen p);
void gen_runtime48(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 525 "runtime.in"
+#line 531 "./runtime.in"
{Stack->push<bool>(p.linetype()->adjust); return;}
}
-#line 529 "runtime.in"
+#line 535 "./runtime.in"
// pen adjust(pen p, real arclength, bool cyclic);
void gen_runtime49(stack *Stack)
{
bool cyclic=vm::pop<bool>(Stack);
real arclength=vm::pop<real>(Stack);
pen p=vm::pop<pen>(Stack);
-#line 530 "runtime.in"
+#line 536 "./runtime.in"
{Stack->push<pen>(adjustdash(p,arclength,cyclic)); return;}
}
-#line 534 "runtime.in"
+#line 540 "./runtime.in"
// pen linecap(Int n);
void gen_runtime50(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 535 "runtime.in"
+#line 541 "./runtime.in"
{Stack->push<pen>(pen(setlinecap,n >= 0 && n < nCap ? n : DEFCAP)); return;}
}
-#line 539 "runtime.in"
+#line 545 "./runtime.in"
// Int linecap(pen p=CURRENTPEN);
void gen_runtime51(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 540 "runtime.in"
+#line 546 "./runtime.in"
{Stack->push<Int>(p.cap()); return;}
}
-#line 544 "runtime.in"
+#line 550 "./runtime.in"
// pen linejoin(Int n);
void gen_runtime52(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 545 "runtime.in"
+#line 551 "./runtime.in"
{Stack->push<pen>(pen(setlinejoin,n >= 0 && n < nJoin ? n : DEFJOIN)); return;}
}
-#line 549 "runtime.in"
+#line 555 "./runtime.in"
// Int linejoin(pen p=CURRENTPEN);
void gen_runtime53(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 550 "runtime.in"
+#line 556 "./runtime.in"
{Stack->push<Int>(p.join()); return;}
}
-#line 554 "runtime.in"
+#line 560 "./runtime.in"
// pen miterlimit(real x);
void gen_runtime54(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 555 "runtime.in"
+#line 561 "./runtime.in"
{Stack->push<pen>(pen(setmiterlimit,x >= 1.0 ? x : DEFJOIN)); return;}
}
-#line 559 "runtime.in"
+#line 565 "./runtime.in"
// real miterlimit(pen p=CURRENTPEN);
void gen_runtime55(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 560 "runtime.in"
+#line 566 "./runtime.in"
{Stack->push<real>(p.miter()); return;}
}
-#line 564 "runtime.in"
+#line 570 "./runtime.in"
// pen linewidth(real x);
void gen_runtime56(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 565 "runtime.in"
+#line 571 "./runtime.in"
{Stack->push<pen>(pen(setlinewidth,x >= 0.0 ? x : DEFWIDTH)); return;}
}
-#line 569 "runtime.in"
+#line 575 "./runtime.in"
// real linewidth(pen p=CURRENTPEN);
void gen_runtime57(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 570 "runtime.in"
+#line 576 "./runtime.in"
{Stack->push<real>(p.width()); return;}
}
-#line 574 "runtime.in"
+#line 580 "./runtime.in"
// pen fontcommand(string *s);
void gen_runtime58(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 575 "runtime.in"
+#line 581 "./runtime.in"
{Stack->push<pen>(pen(setfont,*s)); return;}
}
-#line 579 "runtime.in"
+#line 585 "./runtime.in"
// string font(pen p=CURRENTPEN);
void gen_runtime59(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 580 "runtime.in"
+#line 586 "./runtime.in"
{Stack->push<string>(p.Font()); return;}
}
-#line 584 "runtime.in"
+#line 590 "./runtime.in"
// pen fontsize(real size, real lineskip);
void gen_runtime60(stack *Stack)
{
real lineskip=vm::pop<real>(Stack);
real size=vm::pop<real>(Stack);
-#line 585 "runtime.in"
+#line 591 "./runtime.in"
{Stack->push<pen>(pen(setfontsize,size > 0.0 ? size : 0.0,
lineskip > 0.0 ? lineskip : 0.0)); return;}
}
-#line 590 "runtime.in"
+#line 596 "./runtime.in"
// real fontsize(pen p=CURRENTPEN);
void gen_runtime61(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 591 "runtime.in"
+#line 597 "./runtime.in"
{Stack->push<real>(p.size()); return;}
}
-#line 595 "runtime.in"
+#line 601 "./runtime.in"
// real lineskip(pen p=CURRENTPEN);
void gen_runtime62(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 596 "runtime.in"
+#line 602 "./runtime.in"
{Stack->push<real>(p.Lineskip()); return;}
}
-#line 600 "runtime.in"
+#line 606 "./runtime.in"
// pen overwrite(Int n);
void gen_runtime63(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 601 "runtime.in"
+#line 607 "./runtime.in"
{Stack->push<pen>(pen(setoverwrite,n >= 0 && n < nOverwrite ? (overwrite_t) n :
DEFWRITE)); return;}
}
-#line 606 "runtime.in"
+#line 612 "./runtime.in"
// Int overwrite(pen p=CURRENTPEN);
void gen_runtime64(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 607 "runtime.in"
+#line 613 "./runtime.in"
{Stack->push<Int>(p.Overwrite()); return;}
}
-#line 611 "runtime.in"
+#line 617 "./runtime.in"
// pen basealign(Int n);
void gen_runtime65(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
-#line 612 "runtime.in"
+#line 618 "./runtime.in"
{Stack->push<pen>(pen(n >= 0 && n < nBaseLine ? (BaseLine) n : DEFBASE)); return;}
}
-#line 616 "runtime.in"
+#line 622 "./runtime.in"
// Int basealign(pen p=CURRENTPEN);
void gen_runtime66(stack *Stack)
{
pen p=vm::pop<pen>(Stack,CURRENTPEN);
-#line 617 "runtime.in"
+#line 623 "./runtime.in"
{Stack->push<Int>(p.Baseline()); return;}
}
-#line 621 "runtime.in"
+#line 627 "./runtime.in"
// transform transform(pen p);
void gen_runtime67(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 622 "runtime.in"
+#line 628 "./runtime.in"
{Stack->push<transform>(p.getTransform()); return;}
}
-#line 626 "runtime.in"
+#line 632 "./runtime.in"
// path nib(pen p);
void gen_runtime68(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 627 "runtime.in"
+#line 633 "./runtime.in"
{Stack->push<path>(p.Path()); return;}
}
-#line 631 "runtime.in"
+#line 637 "./runtime.in"
// pen makepen(path p);
void gen_runtime69(stack *Stack)
{
path p=vm::pop<path>(Stack);
-#line 632 "runtime.in"
+#line 638 "./runtime.in"
{Stack->push<pen>(pen(p)); return;}
}
-#line 636 "runtime.in"
+#line 642 "./runtime.in"
// pen colorless(pen p);
void gen_runtime70(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
-#line 637 "runtime.in"
+#line 643 "./runtime.in"
p.colorless();
{Stack->push<pen>(p); return;}
}
// Interactive mode
-#line 643 "runtime.in"
+#line 649 "./runtime.in"
// bool interactive();
void gen_runtime71(stack *Stack)
{
-#line 644 "runtime.in"
+#line 650 "./runtime.in"
{Stack->push<bool>(interact::interactive); return;}
}
-#line 649 "runtime.in"
+#line 655 "./runtime.in"
// bool uptodate();
void gen_runtime72(stack *Stack)
{
-#line 650 "runtime.in"
+#line 656 "./runtime.in"
{Stack->push<bool>(interact::uptodate); return;}
}
// System commands
-#line 656 "runtime.in"
+#line 662 "./runtime.in"
// Int system(stringarray *s);
void gen_runtime73(stack *Stack)
{
stringarray * s=vm::pop<stringarray *>(Stack);
-#line 657 "runtime.in"
+#line 663 "./runtime.in"
if(safe) error("system() call disabled; override with option -nosafe");
size_t size=checkArray(s);
if(size == 0) {Stack->push<Int>(0); return;}
@@ -980,57 +986,57 @@ void gen_runtime73(stack *Stack)
{Stack->push<Int>(System(cmd)); return;}
}
-#line 668 "runtime.in"
+#line 674 "./runtime.in"
// bool view();
void gen_runtime74(stack *Stack)
{
-#line 669 "runtime.in"
+#line 675 "./runtime.in"
{Stack->push<bool>(view()); return;}
}
-#line 673 "runtime.in"
+#line 679 "./runtime.in"
// string asydir();
void gen_runtime75(stack *Stack)
{
-#line 674 "runtime.in"
+#line 680 "./runtime.in"
{Stack->push<string>(systemDir); return;}
}
-#line 678 "runtime.in"
+#line 684 "./runtime.in"
// string locale(string s=emptystring);
void gen_runtime76(stack *Stack)
{
string s=vm::pop<string>(Stack,emptystring);
-#line 679 "runtime.in"
+#line 685 "./runtime.in"
char *L=setlocale(LC_ALL,s.empty() ? NULL : s.c_str());
{Stack->push<string>(L != NULL ? string(L) : ""); return;}
}
-#line 684 "runtime.in"
+#line 690 "./runtime.in"
// void abort(string s=emptystring);
void gen_runtime77(stack *Stack)
{
string s=vm::pop<string>(Stack,emptystring);
-#line 685 "runtime.in"
+#line 691 "./runtime.in"
if(s.empty()) throw handled_error();
error(s.c_str());
}
-#line 690 "runtime.in"
+#line 696 "./runtime.in"
// void exit();
void gen_runtime78(stack *)
{
-#line 691 "runtime.in"
+#line 697 "./runtime.in"
throw quit();
}
-#line 695 "runtime.in"
+#line 701 "./runtime.in"
// void assert(bool b, string s=emptystring);
void gen_runtime79(stack *Stack)
{
string s=vm::pop<string>(Stack,emptystring);
bool b=vm::pop<bool>(Stack);
-#line 696 "runtime.in"
+#line 702 "./runtime.in"
flush(cout);
if(!b) {
ostringstream buf;
@@ -1040,34 +1046,34 @@ void gen_runtime79(stack *Stack)
}
}
-#line 706 "runtime.in"
+#line 712 "./runtime.in"
// void sleep(Int seconds);
void gen_runtime80(stack *Stack)
{
Int seconds=vm::pop<Int>(Stack);
-#line 707 "runtime.in"
+#line 713 "./runtime.in"
if(seconds <= 0) return;
- sleep(seconds);
+ std::this_thread::sleep_for(std::chrono::seconds(seconds));
}
-#line 712 "runtime.in"
+#line 718 "./runtime.in"
// void usleep(Int microseconds);
void gen_runtime81(stack *Stack)
{
Int microseconds=vm::pop<Int>(Stack);
-#line 713 "runtime.in"
+#line 719 "./runtime.in"
if(microseconds <= 0) return;
- usleep((unsigned long) microseconds);
+ std::this_thread::sleep_for(std::chrono::microseconds(microseconds));
}
-#line 718 "runtime.in"
+#line 724 "./runtime.in"
// void _eval(string *s, bool embedded, bool interactiveWrite=false);
void gen_runtime82(stack *Stack)
{
bool interactiveWrite=vm::pop<bool>(Stack,false);
bool embedded=vm::pop<bool>(Stack);
string * s=vm::pop<string *>(Stack);
-#line 719 "runtime.in"
+#line 725 "./runtime.in"
if(embedded) {
trans::coenv *e=Stack->getEnvironment();
vm::interactiveStack *is=dynamic_cast<vm::interactiveStack *>(Stack);
@@ -1079,13 +1085,13 @@ void gen_runtime82(stack *Stack)
runString(*s,interactiveWrite);
}
-#line 731 "runtime.in"
+#line 737 "./runtime.in"
// void _eval(runnable *s, bool embedded);
void gen_runtime83(stack *Stack)
{
bool embedded=vm::pop<bool>(Stack);
runnable * s=vm::pop<runnable *>(Stack);
-#line 732 "runtime.in"
+#line 738 "./runtime.in"
absyntax::block *ast=new absyntax::block(s->getPos(), false);
ast->add(s);
@@ -1100,51 +1106,51 @@ void gen_runtime83(stack *Stack)
runCode(ast);
}
-#line 747 "runtime.in"
+#line 753 "./runtime.in"
// string xasyKEY();
void gen_runtime84(stack *Stack)
{
-#line 748 "runtime.in"
+#line 754 "./runtime.in"
processDataStruct& P=processData();
xkey_t& xkey=P.xkey;
xkey_t::iterator p=xkey.find(P.topPos.LineColumn());
{Stack->push<string>(p != xkey.end() ? p->second+" 1" : toplocation()+" 0"); return;}
}
-#line 754 "runtime.in"
+#line 760 "./runtime.in"
// void xasyKEY(string *s);
void gen_runtime85(stack *Stack)
{
string * s=vm::pop<string *>(Stack);
-#line 755 "runtime.in"
+#line 761 "./runtime.in"
processData().KEY=*s;
}
-#line 758 "runtime.in"
+#line 764 "./runtime.in"
// string location();
void gen_runtime86(stack *Stack)
{
-#line 759 "runtime.in"
+#line 765 "./runtime.in"
ostringstream buf;
buf << getPos();
{Stack->push<string>(buf.str()); return;}
}
// Wrapper for the stack::load() method.
-#line 765 "runtime.in"
+#line 771 "./runtime.in"
void loadModule(stack *Stack)
{
string * index=vm::pop<string *>(Stack);
-#line 766 "runtime.in"
+#line 772 "./runtime.in"
Stack->load(*index);
}
-#line 770 "runtime.in"
+#line 776 "./runtime.in"
// string cd(string s=emptystring);
void gen_runtime88(stack *Stack)
{
string s=vm::pop<string>(Stack,emptystring);
-#line 771 "runtime.in"
+#line 777 "./runtime.in"
if(!globalread()) readDisabled();
if(!s.empty() && !globalwrite()) {
string outname=settings::outname();
@@ -1154,13 +1160,13 @@ void gen_runtime88(stack *Stack)
{Stack->push<string>(setPath(s.c_str())); return;}
}
-#line 781 "runtime.in"
+#line 787 "./runtime.in"
// void list(string *s, bool imports=false);
void gen_runtime89(stack *Stack)
{
bool imports=vm::pop<bool>(Stack,false);
string * s=vm::pop<string *>(Stack);
-#line 782 "runtime.in"
+#line 788 "./runtime.in"
if(*s == "-") return;
trans::genv ge;
symbol name=symbol::trans(*s);
@@ -1170,18 +1176,18 @@ void gen_runtime89(stack *Stack)
// Guide operations
-#line 792 "runtime.in"
+#line 798 "./runtime.in"
void nullGuide(stack *Stack)
{
-#line 793 "runtime.in"
+#line 799 "./runtime.in"
{Stack->push<guide*>(new pathguide(path())); return;}
}
-#line 798 "runtime.in"
+#line 804 "./runtime.in"
void dotsGuide(stack *Stack)
{
guidearray * a=vm::pop<guidearray *>(Stack);
-#line 799 "runtime.in"
+#line 805 "./runtime.in"
guidevector v;
size_t size=checkArray(a);
for (size_t i=0; i < size; ++i)
@@ -1190,11 +1196,11 @@ void dotsGuide(stack *Stack)
{Stack->push<guide*>(new multiguide(v)); return;}
}
-#line 808 "runtime.in"
+#line 814 "./runtime.in"
void dashesGuide(stack *Stack)
{
guidearray * a=vm::pop<guidearray *>(Stack);
-#line 809 "runtime.in"
+#line 815 "./runtime.in"
static camp::curlSpec curly;
static camp::specguide curlout(&curly, camp::OUT);
static camp::specguide curlin(&curly, camp::IN);
@@ -1220,179 +1226,179 @@ void dashesGuide(stack *Stack)
{Stack->push<guide*>(new multiguide(v)); return;}
}
-#line 835 "runtime.in"
+#line 841 "./runtime.in"
void newCycleToken(stack *Stack)
{
-#line 836 "runtime.in"
+#line 842 "./runtime.in"
{Stack->push<cycleToken>(cycleToken()); return;}
}
-#line 840 "runtime.in"
+#line 846 "./runtime.in"
// guide* operator cast(cycleToken tok);
void gen_runtime94(stack *Stack)
{
cycleToken tok=vm::pop<cycleToken>(Stack);
-#line 841 "runtime.in"
+#line 847 "./runtime.in"
// Avoid unused variable warning messages.
unused(&tok);
{Stack->push<guide*>(new cycletokguide()); return;}
}
-#line 847 "runtime.in"
+#line 853 "./runtime.in"
// guide* operator spec(pair z, Int p);
void gen_runtime95(stack *Stack)
{
Int p=vm::pop<Int>(Stack);
pair z=vm::pop<pair>(Stack);
-#line 848 "runtime.in"
+#line 854 "./runtime.in"
camp::side d=(camp::side) p;
camp::dirSpec *sp=new camp::dirSpec(z);
{Stack->push<guide*>(new specguide(sp,d)); return;}
}
-#line 855 "runtime.in"
+#line 861 "./runtime.in"
// curlSpecifier operator curl(real gamma, Int p);
void gen_runtime96(stack *Stack)
{
Int p=vm::pop<Int>(Stack);
real gamma=vm::pop<real>(Stack);
-#line 856 "runtime.in"
+#line 862 "./runtime.in"
camp::side s=(camp::side) p;
{Stack->push<curlSpecifier>(curlSpecifier(gamma,s)); return;}
}
-#line 861 "runtime.in"
+#line 867 "./runtime.in"
void curlSpecifierValuePart(stack *Stack)
{
curlSpecifier spec=vm::pop<curlSpecifier>(Stack);
-#line 862 "runtime.in"
+#line 868 "./runtime.in"
{Stack->push<real>(spec.getValue()); return;}
}
-#line 866 "runtime.in"
+#line 872 "./runtime.in"
void curlSpecifierSidePart(stack *Stack)
{
curlSpecifier spec=vm::pop<curlSpecifier>(Stack);
-#line 867 "runtime.in"
+#line 873 "./runtime.in"
{Stack->push<Int>(spec.getSide()); return;}
}
-#line 871 "runtime.in"
+#line 877 "./runtime.in"
// guide* operator cast(curlSpecifier spec);
void gen_runtime99(stack *Stack)
{
curlSpecifier spec=vm::pop<curlSpecifier>(Stack);
-#line 872 "runtime.in"
+#line 878 "./runtime.in"
{Stack->push<guide*>(new specguide(spec)); return;}
}
-#line 876 "runtime.in"
+#line 882 "./runtime.in"
// tensionSpecifier operator tension(real tout, real tin, bool atleast);
void gen_runtime100(stack *Stack)
{
bool atleast=vm::pop<bool>(Stack);
real tin=vm::pop<real>(Stack);
real tout=vm::pop<real>(Stack);
-#line 877 "runtime.in"
+#line 883 "./runtime.in"
{Stack->push<tensionSpecifier>(tensionSpecifier(tout, tin, atleast)); return;}
}
-#line 881 "runtime.in"
+#line 887 "./runtime.in"
void tensionSpecifierOutPart(stack *Stack)
{
tensionSpecifier t=vm::pop<tensionSpecifier>(Stack);
-#line 882 "runtime.in"
+#line 888 "./runtime.in"
{Stack->push<real>(t.getOut()); return;}
}
-#line 886 "runtime.in"
+#line 892 "./runtime.in"
void tensionSpecifierInPart(stack *Stack)
{
tensionSpecifier t=vm::pop<tensionSpecifier>(Stack);
-#line 887 "runtime.in"
+#line 893 "./runtime.in"
{Stack->push<real>(t.getIn()); return;}
}
-#line 891 "runtime.in"
+#line 897 "./runtime.in"
void tensionSpecifierAtleastPart(stack *Stack)
{
tensionSpecifier t=vm::pop<tensionSpecifier>(Stack);
-#line 892 "runtime.in"
+#line 898 "./runtime.in"
{Stack->push<bool>(t.getAtleast()); return;}
}
-#line 896 "runtime.in"
+#line 902 "./runtime.in"
// guide* operator cast(tensionSpecifier t);
void gen_runtime104(stack *Stack)
{
tensionSpecifier t=vm::pop<tensionSpecifier>(Stack);
-#line 897 "runtime.in"
+#line 903 "./runtime.in"
{Stack->push<guide*>(new tensionguide(t)); return;}
}
-#line 901 "runtime.in"
+#line 907 "./runtime.in"
// guide* operator controls(pair zout, pair zin);
void gen_runtime105(stack *Stack)
{
pair zin=vm::pop<pair>(Stack);
pair zout=vm::pop<pair>(Stack);
-#line 902 "runtime.in"
+#line 908 "./runtime.in"
{Stack->push<guide*>(new controlguide(zout, zin)); return;}
}
-#line 906 "runtime.in"
+#line 912 "./runtime.in"
// Int size(guide *g);
void gen_runtime106(stack *Stack)
{
guide * g=vm::pop<guide *>(Stack);
-#line 907 "runtime.in"
+#line 913 "./runtime.in"
flatguide f;
g->flatten(f,false);
{Stack->push<Int>(f.size()); return;}
}
-#line 913 "runtime.in"
+#line 919 "./runtime.in"
// Int length(guide *g);
void gen_runtime107(stack *Stack)
{
guide * g=vm::pop<guide *>(Stack);
-#line 914 "runtime.in"
+#line 920 "./runtime.in"
flatguide f;
g->flatten(f,false);
{Stack->push<Int>(g->cyclic() ? f.size() : f.size()-1); return;}
}
-#line 920 "runtime.in"
+#line 926 "./runtime.in"
// bool cyclic(guide *g);
void gen_runtime108(stack *Stack)
{
guide * g=vm::pop<guide *>(Stack);
-#line 921 "runtime.in"
+#line 927 "./runtime.in"
flatguide f;
g->flatten(f,false);
{Stack->push<bool>(g->cyclic()); return;}
}
-#line 927 "runtime.in"
+#line 933 "./runtime.in"
// pair point(guide *g, Int t);
void gen_runtime109(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
guide * g=vm::pop<guide *>(Stack);
-#line 928 "runtime.in"
+#line 934 "./runtime.in"
flatguide f;
g->flatten(f,false);
{Stack->push<pair>(f.Nodes(adjustedIndex(t,f.size(),g->cyclic())).z); return;}
}
-#line 934 "runtime.in"
+#line 940 "./runtime.in"
// pairarray* dirSpecifier(guide *g, Int t);
void gen_runtime110(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
guide * g=vm::pop<guide *>(Stack);
-#line 935 "runtime.in"
+#line 941 "./runtime.in"
flatguide f;
g->flatten(f,false);
Int n=f.size();
@@ -1403,13 +1409,13 @@ void gen_runtime110(stack *Stack)
{Stack->push<pairarray*>(c); return;}
}
-#line 946 "runtime.in"
+#line 952 "./runtime.in"
// pairarray* controlSpecifier(guide *g, Int t);
void gen_runtime111(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
guide * g=vm::pop<guide *>(Stack);
-#line 947 "runtime.in"
+#line 953 "./runtime.in"
flatguide f;
g->flatten(f,false);
Int n=f.size();
@@ -1425,13 +1431,13 @@ void gen_runtime111(stack *Stack)
} else {Stack->push<pairarray*>(new array(0)); return;}
}
-#line 963 "runtime.in"
+#line 969 "./runtime.in"
// tensionSpecifier tensionSpecifier(guide *g, Int t);
void gen_runtime112(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
guide * g=vm::pop<guide *>(Stack);
-#line 964 "runtime.in"
+#line 970 "./runtime.in"
flatguide f;
g->flatten(f,false);
Int n=f.size();
@@ -1440,13 +1446,13 @@ void gen_runtime112(stack *Stack)
{Stack->push<tensionSpecifier>(tensionSpecifier(curr.tout.val,f.Nodes(t+1).tin.val,curr.tout.atleast)); return;}
}
-#line 973 "runtime.in"
+#line 979 "./runtime.in"
// realarray* curlSpecifier(guide *g, Int t);
void gen_runtime113(stack *Stack)
{
Int t=vm::pop<Int>(Stack);
guide * g=vm::pop<guide *>(Stack);
-#line 974 "runtime.in"
+#line 980 "./runtime.in"
flatguide f;
g->flatten(f,false);
Int n=f.size();
@@ -1459,12 +1465,12 @@ void gen_runtime113(stack *Stack)
{Stack->push<realarray*>(c); return;}
}
-#line 987 "runtime.in"
+#line 993 "./runtime.in"
// guide* reverse(guide *g);
void gen_runtime114(stack *Stack)
{
guide * g=vm::pop<guide *>(Stack);
-#line 988 "runtime.in"
+#line 994 "./runtime.in"
flatguide f;
g->flatten(f,false);
if(f.precyclic())
@@ -1515,123 +1521,133 @@ void gen_runtime114(stack *Stack)
{Stack->push<guide*>(new multiguide(v)); return;}
}
-#line 1040 "runtime.in"
+#line 1046 "./runtime.in"
// realarray* _cputime();
void gen_runtime115(stack *Stack)
{
-#line 1041 "runtime.in"
+#line 1047 "./runtime.in"
+#if !defined(_WIN32)
static const real ticktime=1.0/sysconf(_SC_CLK_TCK);
struct tms buf;
-
::times(&buf);
+
+ real realCutime=((real)buf.tms_cutime)*ticktime;
+ real realCstime=((real)buf.tms_cstime)*ticktime;
+#else
+ // FIXME: See if there's a way to get cutime/cstime on windows,
+ // if it's possible.
+ real realCutime=0.0;
+ real realCstime=0.0;
+#endif
+
array *t=new array(5);
(*t)[0]=cpuTime.seconds(); // Includes system time
(*t)[1]=0.0;
- (*t)[2]=((real) buf.tms_cutime)*ticktime;
- (*t)[3]=((real) buf.tms_cstime)*ticktime;
+ (*t)[2]=realCutime;
+ (*t)[3]=realCstime;
(*t)[4]=wallClock.seconds();
{Stack->push<realarray*>(t); return;}
}
// Transforms
-#line 1057 "runtime.in"
+#line 1073 "./runtime.in"
// bool ==(transform a, transform b);
void gen_runtime116(stack *Stack)
{
transform b=vm::pop<transform>(Stack);
transform a=vm::pop<transform>(Stack);
-#line 1058 "runtime.in"
+#line 1074 "./runtime.in"
{Stack->push<bool>(a == b); return;}
}
-#line 1063 "runtime.in"
+#line 1079 "./runtime.in"
// bool !=(transform a, transform b);
void gen_runtime117(stack *Stack)
{
transform b=vm::pop<transform>(Stack);
transform a=vm::pop<transform>(Stack);
-#line 1064 "runtime.in"
+#line 1080 "./runtime.in"
{Stack->push<bool>(a != b); return;}
}
-#line 1068 "runtime.in"
+#line 1084 "./runtime.in"
// transform +(transform a, transform b);
void gen_runtime118(stack *Stack)
{
transform b=vm::pop<transform>(Stack);
transform a=vm::pop<transform>(Stack);
-#line 1069 "runtime.in"
+#line 1085 "./runtime.in"
{Stack->push<transform>(a+b); return;}
}
-#line 1073 "runtime.in"
+#line 1089 "./runtime.in"
// transform *(transform a, transform b);
void gen_runtime119(stack *Stack)
{
transform b=vm::pop<transform>(Stack);
transform a=vm::pop<transform>(Stack);
-#line 1074 "runtime.in"
+#line 1090 "./runtime.in"
{Stack->push<transform>(a*b); return;}
}
-#line 1078 "runtime.in"
+#line 1094 "./runtime.in"
// pair *(transform t, pair z);
void gen_runtime120(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 1079 "runtime.in"
+#line 1095 "./runtime.in"
{Stack->push<pair>(t*z); return;}
}
-#line 1083 "runtime.in"
+#line 1099 "./runtime.in"
// path *(transform t, path g);
void gen_runtime121(stack *Stack)
{
path g=vm::pop<path>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 1084 "runtime.in"
+#line 1100 "./runtime.in"
{Stack->push<path>(transformed(t,g)); return;}
}
-#line 1088 "runtime.in"
+#line 1104 "./runtime.in"
// pen *(transform t, pen p);
void gen_runtime122(stack *Stack)
{
pen p=vm::pop<pen>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 1089 "runtime.in"
+#line 1105 "./runtime.in"
{Stack->push<pen>(transformed(t,p)); return;}
}
-#line 1093 "runtime.in"
+#line 1109 "./runtime.in"
// picture* *(transform t, picture *f);
void gen_runtime123(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 1094 "runtime.in"
+#line 1110 "./runtime.in"
{Stack->push<picture*>(transformed(t,f)); return;}
}
-#line 1098 "runtime.in"
+#line 1114 "./runtime.in"
// picture* *(realarray2 *t, picture *f);
void gen_runtime124(stack *Stack)
{
picture * f=vm::pop<picture *>(Stack);
realarray2 * t=vm::pop<realarray2 *>(Stack);
-#line 1099 "runtime.in"
+#line 1115 "./runtime.in"
{Stack->push<picture*>(transformed(*t,f)); return;}
}
-#line 1103 "runtime.in"
+#line 1119 "./runtime.in"
// transform ^(transform t, Int n);
void gen_runtime125(stack *Stack)
{
Int n=vm::pop<Int>(Stack);
transform t=vm::pop<transform>(Stack);
-#line 1104 "runtime.in"
+#line 1120 "./runtime.in"
transform T;
if(n < 0) {
n=-n;
@@ -1641,55 +1657,55 @@ void gen_runtime125(stack *Stack)
{Stack->push<transform>(T); return;}
}
-#line 1114 "runtime.in"
+#line 1130 "./runtime.in"
void transformXPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1115 "runtime.in"
+#line 1131 "./runtime.in"
{Stack->push<real>(t.getx()); return;}
}
-#line 1119 "runtime.in"
+#line 1135 "./runtime.in"
void transformYPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1120 "runtime.in"
+#line 1136 "./runtime.in"
{Stack->push<real>(t.gety()); return;}
}
-#line 1124 "runtime.in"
+#line 1140 "./runtime.in"
void transformXXPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1125 "runtime.in"
+#line 1141 "./runtime.in"
{Stack->push<real>(t.getxx()); return;}
}
-#line 1129 "runtime.in"
+#line 1145 "./runtime.in"
void transformXYPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1130 "runtime.in"
+#line 1146 "./runtime.in"
{Stack->push<real>(t.getxy()); return;}
}
-#line 1134 "runtime.in"
+#line 1150 "./runtime.in"
void transformYXPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1135 "runtime.in"
+#line 1151 "./runtime.in"
{Stack->push<real>(t.getyx()); return;}
}
-#line 1139 "runtime.in"
+#line 1155 "./runtime.in"
void transformYYPart(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1140 "runtime.in"
+#line 1156 "./runtime.in"
{Stack->push<real>(t.getyy()); return;}
}
-#line 1144 "runtime.in"
+#line 1160 "./runtime.in"
void real6ToTransform(stack *Stack)
{
real yy=vm::pop<real>(Stack);
@@ -1698,140 +1714,140 @@ void real6ToTransform(stack *Stack)
real xx=vm::pop<real>(Stack);
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 1146 "runtime.in"
+#line 1162 "./runtime.in"
{Stack->push<transform>(transform(x,y,xx,xy,yx,yy)); return;}
}
-#line 1150 "runtime.in"
+#line 1166 "./runtime.in"
// transform shift(transform t);
void gen_runtime133(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1151 "runtime.in"
+#line 1167 "./runtime.in"
{Stack->push<transform>(transform(t.getx(),t.gety(),0,0,0,0)); return;}
}
-#line 1155 "runtime.in"
+#line 1171 "./runtime.in"
// transform shiftless(transform t);
void gen_runtime134(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1156 "runtime.in"
+#line 1172 "./runtime.in"
{Stack->push<transform>(transform(0,0,t.getxx(),t.getxy(),t.getyx(),t.getyy())); return;}
}
-#line 1160 "runtime.in"
+#line 1176 "./runtime.in"
// transform identity();
void transformIdentity(stack *Stack)
{
-#line 1161 "runtime.in"
+#line 1177 "./runtime.in"
{Stack->push<transform>(identity); return;}
}
-#line 1165 "runtime.in"
+#line 1181 "./runtime.in"
// transform inverse(transform t);
void gen_runtime136(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1166 "runtime.in"
+#line 1182 "./runtime.in"
{Stack->push<transform>(inverse(t)); return;}
}
-#line 1170 "runtime.in"
+#line 1186 "./runtime.in"
// transform shift(pair z);
void gen_runtime137(stack *Stack)
{
pair z=vm::pop<pair>(Stack);
-#line 1171 "runtime.in"
+#line 1187 "./runtime.in"
{Stack->push<transform>(shift(z)); return;}
}
-#line 1175 "runtime.in"
+#line 1191 "./runtime.in"
// transform shift(real x, real y);
void gen_runtime138(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 1176 "runtime.in"
+#line 1192 "./runtime.in"
{Stack->push<transform>(shift(pair(x,y))); return;}
}
-#line 1180 "runtime.in"
+#line 1196 "./runtime.in"
// transform xscale(real x);
void gen_runtime139(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 1181 "runtime.in"
+#line 1197 "./runtime.in"
{Stack->push<transform>(xscale(x)); return;}
}
-#line 1185 "runtime.in"
+#line 1201 "./runtime.in"
// transform yscale(real y);
void gen_runtime140(stack *Stack)
{
real y=vm::pop<real>(Stack);
-#line 1186 "runtime.in"
+#line 1202 "./runtime.in"
{Stack->push<transform>(yscale(y)); return;}
}
-#line 1190 "runtime.in"
+#line 1206 "./runtime.in"
// transform scale(real x);
void gen_runtime141(stack *Stack)
{
real x=vm::pop<real>(Stack);
-#line 1191 "runtime.in"
+#line 1207 "./runtime.in"
{Stack->push<transform>(scale(x)); return;}
}
-#line 1195 "runtime.in"
+#line 1211 "./runtime.in"
// transform scale(real x, real y);
void gen_runtime142(stack *Stack)
{
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 1196 "runtime.in"
+#line 1212 "./runtime.in"
{Stack->push<transform>(scale(x,y)); return;}
}
-#line 1200 "runtime.in"
+#line 1216 "./runtime.in"
// transform slant(real s);
void gen_runtime143(stack *Stack)
{
real s=vm::pop<real>(Stack);
-#line 1201 "runtime.in"
+#line 1217 "./runtime.in"
{Stack->push<transform>(slant(s)); return;}
}
-#line 1205 "runtime.in"
+#line 1221 "./runtime.in"
// transform rotate(real angle, pair z=0);
void gen_runtime144(stack *Stack)
{
pair z=vm::pop<pair>(Stack,0);
real angle=vm::pop<real>(Stack);
-#line 1206 "runtime.in"
+#line 1222 "./runtime.in"
{Stack->push<transform>(rotatearound(z,radians(angle))); return;}
}
-#line 1210 "runtime.in"
+#line 1226 "./runtime.in"
// transform reflect(pair a, pair b);
void gen_runtime145(stack *Stack)
{
pair b=vm::pop<pair>(Stack);
pair a=vm::pop<pair>(Stack);
-#line 1211 "runtime.in"
+#line 1227 "./runtime.in"
{Stack->push<transform>(reflectabout(a,b)); return;}
}
-#line 1215 "runtime.in"
+#line 1231 "./runtime.in"
// bool isometry(transform t);
void gen_runtime146(stack *Stack)
{
transform t=vm::pop<transform>(Stack);
-#line 1216 "runtime.in"
+#line 1232 "./runtime.in"
{Stack->push<bool>(t.isIsometry()); return;}
}
-#line 1220 "runtime.in"
+#line 1236 "./runtime.in"
// real bezier(real a, real b, real c, real d, real t);
void gen_runtime147(stack *Stack)
{
@@ -1840,7 +1856,7 @@ void gen_runtime147(stack *Stack)
real c=vm::pop<real>(Stack);
real b=vm::pop<real>(Stack);
real a=vm::pop<real>(Stack);
-#line 1221 "runtime.in"
+#line 1237 "./runtime.in"
real onemt=1-t;
real onemt2=onemt*onemt;
{Stack->push<real>(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;}
@@ -1852,301 +1868,301 @@ namespace trans {
void gen_runtime_venv(venv &ve)
{
-#line 227 "runtime.in"
+#line 233 "./runtime.in"
REGISTER_BLTIN(run::IntZero,"IntZero");
-#line 235 "runtime.in"
+#line 241 "./runtime.in"
REGISTER_BLTIN(run::realZero,"realZero");
-#line 240 "runtime.in"
+#line 246 "./runtime.in"
REGISTER_BLTIN(run::boolFalse,"boolFalse");
-#line 245 "runtime.in"
+#line 251 "./runtime.in"
addFunc(ve, run::gen_runtime3, primBoolean(), SYM(isnan), formal(primReal(), SYM(x), false, false));
-#line 250 "runtime.in"
+#line 256 "./runtime.in"
REGISTER_BLTIN(run::pushNullArray,"pushNullArray");
-#line 255 "runtime.in"
+#line 261 "./runtime.in"
REGISTER_BLTIN(run::pushNullRecord,"pushNullRecord");
-#line 260 "runtime.in"
+#line 266 "./runtime.in"
REGISTER_BLTIN(run::pushNullFunction,"pushNullFunction");
-#line 265 "runtime.in"
+#line 271 "./runtime.in"
REGISTER_BLTIN(run::pushDefault,"pushDefault");
-#line 275 "runtime.in"
+#line 281 "./runtime.in"
REGISTER_BLTIN(run::isDefault,"isDefault");
-#line 282 "runtime.in"
+#line 288 "./runtime.in"
REGISTER_BLTIN(run::pairToGuide,"pairToGuide");
-#line 290 "runtime.in"
+#line 296 "./runtime.in"
REGISTER_BLTIN(run::pathToGuide,"pathToGuide");
-#line 295 "runtime.in"
+#line 301 "./runtime.in"
REGISTER_BLTIN(run::guideToPath,"guideToPath");
-#line 300 "runtime.in"
+#line 306 "./runtime.in"
REGISTER_BLTIN(run::newPen,"newPen");
-#line 308 "runtime.in"
+#line 314 "./runtime.in"
addFunc(ve, run::gen_runtime13, primBoolean(), SYM_EQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false));
-#line 313 "runtime.in"
+#line 319 "./runtime.in"
addFunc(ve, run::gen_runtime14, primBoolean(), SYM_NEQ, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false));
-#line 318 "runtime.in"
+#line 324 "./runtime.in"
addFunc(ve, run::gen_runtime15, primPen(), SYM_PLUS, formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false));
-#line 323 "runtime.in"
+#line 329 "./runtime.in"
addFunc(ve, run::gen_runtime16, primPen(), SYM_TIMES, formal(primReal(), SYM(a), false, false), formal(primPen(), SYM(b), false, false));
-#line 328 "runtime.in"
+#line 334 "./runtime.in"
addFunc(ve, run::gen_runtime17, primPen(), SYM_TIMES, formal(primPen(), SYM(a), false, false), formal(primReal(), SYM(b), false, false));
-#line 333 "runtime.in"
+#line 339 "./runtime.in"
addFunc(ve, run::gen_runtime18, primPair(), SYM(max), formal(primPen(), SYM(p), false, false));
-#line 338 "runtime.in"
+#line 344 "./runtime.in"
addFunc(ve, run::gen_runtime19, primPair(), SYM(min), formal(primPen(), SYM(p), false, false));
-#line 343 "runtime.in"
+#line 349 "./runtime.in"
addFunc(ve, run::gen_runtime20, primVoid(), SYM(resetdefaultpen));
-#line 349 "runtime.in"
+#line 355 "./runtime.in"
addFunc(ve, run::gen_runtime21, primVoid(), SYM(defaultpen), formal(primPen(), SYM(p), false, false));
-#line 354 "runtime.in"
+#line 360 "./runtime.in"
addFunc(ve, run::gen_runtime22, primPen(), SYM(defaultpen));
-#line 359 "runtime.in"
+#line 365 "./runtime.in"
addFunc(ve, run::gen_runtime23, primBoolean(), SYM(invisible), formal(primPen(), SYM(p), false, false));
-#line 364 "runtime.in"
+#line 370 "./runtime.in"
addFunc(ve, run::gen_runtime24, primPen(), SYM(invisible));
-#line 369 "runtime.in"
+#line 375 "./runtime.in"
addFunc(ve, run::gen_runtime25, primPen(), SYM(gray), formal(primPen(), SYM(p), false, false));
-#line 375 "runtime.in"
+#line 381 "./runtime.in"
addFunc(ve, run::gen_runtime26, primPen(), SYM(rgb), formal(primPen(), SYM(p), false, false));
-#line 381 "runtime.in"
+#line 387 "./runtime.in"
addFunc(ve, run::gen_runtime27, primPen(), SYM(cmyk), formal(primPen(), SYM(p), false, false));
-#line 387 "runtime.in"
+#line 393 "./runtime.in"
addFunc(ve, run::gen_runtime28, primPen(), SYM(interp), formal(primPen(), SYM(a), false, false), formal(primPen(), SYM(b), false, false), formal(primReal(), SYM(t), false, false));
-#line 392 "runtime.in"
+#line 398 "./runtime.in"
addFunc(ve, run::gen_runtime29, primPen(), SYM(rgb), formal(primReal(), SYM(r), false, false), formal(primReal(), SYM(g), false, false), formal(primReal(), SYM(b), false, false));
-#line 397 "runtime.in"
+#line 403 "./runtime.in"
addFunc(ve, run::gen_runtime30, primPen(), SYM(cmyk), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(m), false, false), formal(primReal(), SYM(y), false, false), formal(primReal(), SYM(k), false, false));
-#line 402 "runtime.in"
+#line 408 "./runtime.in"
addFunc(ve, run::gen_runtime31, primPen(), SYM(gray), formal(primReal(), SYM(gray), false, false));
-#line 407 "runtime.in"
+#line 413 "./runtime.in"
addFunc(ve, run::gen_runtime32, realArray(), SYM(colors), formal(primPen(), SYM(p), false, false));
-#line 435 "runtime.in"
+#line 441 "./runtime.in"
addFunc(ve, run::gen_runtime33, primString(), SYM(hex), formal(primPen(), SYM(p), false, false));
-#line 440 "runtime.in"
+#line 446 "./runtime.in"
addFunc(ve, run::gen_runtime34, primInt(), SYM(byte), formal(primReal(), SYM(x), false, false));
-#line 445 "runtime.in"
+#line 451 "./runtime.in"
addFunc(ve, run::gen_runtime35, primReal(), SYM(byteinv), formal(primInt(), SYM(x), false, false));
-#line 450 "runtime.in"
+#line 456 "./runtime.in"
addFunc(ve, run::gen_runtime36, primString(), SYM(colorspace), formal(primPen(), SYM(p), false, false));
-#line 457 "runtime.in"
+#line 463 "./runtime.in"
addFunc(ve, run::gen_runtime37, primPen(), SYM(pattern), formal(primString(), SYM(s), false, false));
-#line 462 "runtime.in"
+#line 468 "./runtime.in"
addFunc(ve, run::gen_runtime38, primString(), SYM(pattern), formal(primPen(), SYM(p), false, false));
-#line 467 "runtime.in"
+#line 473 "./runtime.in"
addFunc(ve, run::gen_runtime39, primPen(), SYM(fillrule), formal(primInt(), SYM(n), false, false));
-#line 472 "runtime.in"
+#line 478 "./runtime.in"
addFunc(ve, run::gen_runtime40, primInt(), SYM(fillrule), formal(primPen(), SYM(p), false, false));
-#line 477 "runtime.in"
+#line 483 "./runtime.in"
addFunc(ve, run::gen_runtime41, primPen(), SYM(opacity), formal(primReal(), SYM(opacity), true, false), formal(primString(), SYM(blend), true, false));
-#line 487 "runtime.in"
+#line 493 "./runtime.in"
addFunc(ve, run::gen_runtime42, primReal(), SYM(opacity), formal(primPen(), SYM(p), false, false));
-#line 492 "runtime.in"
+#line 498 "./runtime.in"
addFunc(ve, run::gen_runtime43, primString(), SYM(blend), formal(primPen(), SYM(p), false, false));
-#line 497 "runtime.in"
+#line 503 "./runtime.in"
addFunc(ve, run::gen_runtime44, primPen(), SYM(linetype), formal(realArray(), SYM(pattern), false, false), formal(primReal(), SYM(offset), true, false), formal(primBoolean(), SYM(scale), true, false), formal(primBoolean(), SYM(adjust), true, false));
-#line 508 "runtime.in"
+#line 514 "./runtime.in"
addFunc(ve, run::gen_runtime45, realArray(), SYM(linetype), formal(primPen(), SYM(p), true, false));
-#line 514 "runtime.in"
+#line 520 "./runtime.in"
addFunc(ve, run::gen_runtime46, primReal(), SYM(offset), formal(primPen(), SYM(p), false, false));
-#line 519 "runtime.in"
+#line 525 "./runtime.in"
addFunc(ve, run::gen_runtime47, primBoolean(), SYM(scale), formal(primPen(), SYM(p), false, false));
-#line 524 "runtime.in"
+#line 530 "./runtime.in"
addFunc(ve, run::gen_runtime48, primBoolean(), SYM(adjust), formal(primPen(), SYM(p), false, false));
-#line 529 "runtime.in"
+#line 535 "./runtime.in"
addFunc(ve, run::gen_runtime49, primPen(), SYM(adjust), formal(primPen(), SYM(p), false, false), formal(primReal(), SYM(arclength), false, false), formal(primBoolean(), SYM(cyclic), false, false));
-#line 534 "runtime.in"
+#line 540 "./runtime.in"
addFunc(ve, run::gen_runtime50, primPen(), SYM(linecap), formal(primInt(), SYM(n), false, false));
-#line 539 "runtime.in"
+#line 545 "./runtime.in"
addFunc(ve, run::gen_runtime51, primInt(), SYM(linecap), formal(primPen(), SYM(p), true, false));
-#line 544 "runtime.in"
+#line 550 "./runtime.in"
addFunc(ve, run::gen_runtime52, primPen(), SYM(linejoin), formal(primInt(), SYM(n), false, false));
-#line 549 "runtime.in"
+#line 555 "./runtime.in"
addFunc(ve, run::gen_runtime53, primInt(), SYM(linejoin), formal(primPen(), SYM(p), true, false));
-#line 554 "runtime.in"
+#line 560 "./runtime.in"
addFunc(ve, run::gen_runtime54, primPen(), SYM(miterlimit), formal(primReal(), SYM(x), false, false));
-#line 559 "runtime.in"
+#line 565 "./runtime.in"
addFunc(ve, run::gen_runtime55, primReal(), SYM(miterlimit), formal(primPen(), SYM(p), true, false));
-#line 564 "runtime.in"
+#line 570 "./runtime.in"
addFunc(ve, run::gen_runtime56, primPen(), SYM(linewidth), formal(primReal(), SYM(x), false, false));
-#line 569 "runtime.in"
+#line 575 "./runtime.in"
addFunc(ve, run::gen_runtime57, primReal(), SYM(linewidth), formal(primPen(), SYM(p), true, false));
-#line 574 "runtime.in"
+#line 580 "./runtime.in"
addFunc(ve, run::gen_runtime58, primPen(), SYM(fontcommand), formal(primString(), SYM(s), false, false));
-#line 579 "runtime.in"
+#line 585 "./runtime.in"
addFunc(ve, run::gen_runtime59, primString(), SYM(font), formal(primPen(), SYM(p), true, false));
-#line 584 "runtime.in"
+#line 590 "./runtime.in"
addFunc(ve, run::gen_runtime60, primPen(), SYM(fontsize), formal(primReal(), SYM(size), false, false), formal(primReal(), SYM(lineskip), false, false));
-#line 590 "runtime.in"
+#line 596 "./runtime.in"
addFunc(ve, run::gen_runtime61, primReal(), SYM(fontsize), formal(primPen(), SYM(p), true, false));
-#line 595 "runtime.in"
+#line 601 "./runtime.in"
addFunc(ve, run::gen_runtime62, primReal(), SYM(lineskip), formal(primPen(), SYM(p), true, false));
-#line 600 "runtime.in"
+#line 606 "./runtime.in"
addFunc(ve, run::gen_runtime63, primPen(), SYM(overwrite), formal(primInt(), SYM(n), false, false));
-#line 606 "runtime.in"
+#line 612 "./runtime.in"
addFunc(ve, run::gen_runtime64, primInt(), SYM(overwrite), formal(primPen(), SYM(p), true, false));
-#line 611 "runtime.in"
+#line 617 "./runtime.in"
addFunc(ve, run::gen_runtime65, primPen(), SYM(basealign), formal(primInt(), SYM(n), false, false));
-#line 616 "runtime.in"
+#line 622 "./runtime.in"
addFunc(ve, run::gen_runtime66, primInt(), SYM(basealign), formal(primPen(), SYM(p), true, false));
-#line 621 "runtime.in"
+#line 627 "./runtime.in"
addFunc(ve, run::gen_runtime67, primTransform(), SYM(transform), formal(primPen(), SYM(p), false, false));
-#line 626 "runtime.in"
+#line 632 "./runtime.in"
addFunc(ve, run::gen_runtime68, primPath(), SYM(nib), formal(primPen(), SYM(p), false, false));
-#line 631 "runtime.in"
+#line 637 "./runtime.in"
addFunc(ve, run::gen_runtime69, primPen(), SYM(makepen), formal(primPath(), SYM(p), false, false));
-#line 636 "runtime.in"
+#line 642 "./runtime.in"
addFunc(ve, run::gen_runtime70, primPen(), SYM(colorless), formal(primPen(), SYM(p), false, false));
-#line 642 "runtime.in"
+#line 648 "./runtime.in"
addFunc(ve, run::gen_runtime71, primBoolean(), SYM(interactive));
-#line 649 "runtime.in"
+#line 655 "./runtime.in"
addFunc(ve, run::gen_runtime72, primBoolean(), SYM(uptodate));
-#line 654 "runtime.in"
+#line 660 "./runtime.in"
addFunc(ve, run::gen_runtime73, primInt(), SYM(system), formal(stringArray(), SYM(s), false, false));
-#line 668 "runtime.in"
+#line 674 "./runtime.in"
addFunc(ve, run::gen_runtime74, primBoolean(), SYM(view));
-#line 673 "runtime.in"
+#line 679 "./runtime.in"
addFunc(ve, run::gen_runtime75, primString(), SYM(asydir));
-#line 678 "runtime.in"
+#line 684 "./runtime.in"
addFunc(ve, run::gen_runtime76, primString(), SYM(locale), formal(primString(), SYM(s), true, false));
-#line 684 "runtime.in"
+#line 690 "./runtime.in"
addFunc(ve, run::gen_runtime77, primVoid(), SYM(abort), formal(primString(), SYM(s), true, false));
-#line 690 "runtime.in"
+#line 696 "./runtime.in"
addFunc(ve, run::gen_runtime78, primVoid(), SYM(exit));
-#line 695 "runtime.in"
+#line 701 "./runtime.in"
addFunc(ve, run::gen_runtime79, primVoid(), SYM(assert), formal(primBoolean(), SYM(b), false, false), formal(primString(), SYM(s), true, false));
-#line 706 "runtime.in"
+#line 712 "./runtime.in"
addFunc(ve, run::gen_runtime80, primVoid(), SYM(sleep), formal(primInt(), SYM(seconds), false, false));
-#line 712 "runtime.in"
+#line 718 "./runtime.in"
addFunc(ve, run::gen_runtime81, primVoid(), SYM(usleep), formal(primInt(), SYM(microseconds), false, false));
-#line 718 "runtime.in"
+#line 724 "./runtime.in"
addFunc(ve, run::gen_runtime82, primVoid(), SYM(_eval), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false), formal(primBoolean(), SYM(interactivewrite), true, false));
-#line 731 "runtime.in"
+#line 737 "./runtime.in"
addFunc(ve, run::gen_runtime83, primVoid(), SYM(_eval), formal(primCode(), SYM(s), false, false), formal(primBoolean(), SYM(embedded), false, false));
-#line 747 "runtime.in"
+#line 753 "./runtime.in"
addFunc(ve, run::gen_runtime84, primString(), SYM(xasyKEY));
-#line 754 "runtime.in"
+#line 760 "./runtime.in"
addFunc(ve, run::gen_runtime85, primVoid(), SYM(xasyKEY), formal(primString(), SYM(s), false, false));
-#line 758 "runtime.in"
+#line 764 "./runtime.in"
addFunc(ve, run::gen_runtime86, primString(), SYM(location));
-#line 764 "runtime.in"
+#line 770 "./runtime.in"
REGISTER_BLTIN(run::loadModule,"loadModule");
-#line 770 "runtime.in"
+#line 776 "./runtime.in"
addFunc(ve, run::gen_runtime88, primString(), SYM(cd), formal(primString(), SYM(s), true, false));
-#line 781 "runtime.in"
+#line 787 "./runtime.in"
addFunc(ve, run::gen_runtime89, primVoid(), SYM(list), formal(primString(), SYM(s), false, false), formal(primBoolean(), SYM(imports), true, false));
-#line 790 "runtime.in"
+#line 796 "./runtime.in"
REGISTER_BLTIN(run::nullGuide,"nullGuide");
-#line 798 "runtime.in"
+#line 804 "./runtime.in"
REGISTER_BLTIN(run::dotsGuide,"dotsGuide");
-#line 808 "runtime.in"
+#line 814 "./runtime.in"
REGISTER_BLTIN(run::dashesGuide,"dashesGuide");
-#line 835 "runtime.in"
+#line 841 "./runtime.in"
REGISTER_BLTIN(run::newCycleToken,"newCycleToken");
-#line 840 "runtime.in"
+#line 846 "./runtime.in"
addFunc(ve, run::gen_runtime94, primGuide(), symbol::trans("operator cast"), formal(primCycleToken(), SYM(tok), false, false));
-#line 847 "runtime.in"
+#line 853 "./runtime.in"
addFunc(ve, run::gen_runtime95, primGuide(), symbol::trans("operator spec"), formal(primPair(), SYM(z), false, false), formal(primInt(), SYM(p), false, false));
-#line 855 "runtime.in"
+#line 861 "./runtime.in"
addFunc(ve, run::gen_runtime96, primCurlSpecifier(), SYM_CURL, formal(primReal(), SYM(gamma), false, false), formal(primInt(), SYM(p), false, false));
-#line 861 "runtime.in"
+#line 867 "./runtime.in"
REGISTER_BLTIN(run::curlSpecifierValuePart,"curlSpecifierValuePart");
-#line 866 "runtime.in"
+#line 872 "./runtime.in"
REGISTER_BLTIN(run::curlSpecifierSidePart,"curlSpecifierSidePart");
-#line 871 "runtime.in"
+#line 877 "./runtime.in"
addFunc(ve, run::gen_runtime99, primGuide(), symbol::trans("operator cast"), formal(primCurlSpecifier(), SYM(spec), false, false));
-#line 876 "runtime.in"
+#line 882 "./runtime.in"
addFunc(ve, run::gen_runtime100, primTensionSpecifier(), SYM_TENSION, formal(primReal(), SYM(tout), false, false), formal(primReal(), SYM(tin), false, false), formal(primBoolean(), SYM(atleast), false, false));
-#line 881 "runtime.in"
+#line 887 "./runtime.in"
REGISTER_BLTIN(run::tensionSpecifierOutPart,"tensionSpecifierOutPart");
-#line 886 "runtime.in"
+#line 892 "./runtime.in"
REGISTER_BLTIN(run::tensionSpecifierInPart,"tensionSpecifierInPart");
-#line 891 "runtime.in"
+#line 897 "./runtime.in"
REGISTER_BLTIN(run::tensionSpecifierAtleastPart,"tensionSpecifierAtleastPart");
-#line 896 "runtime.in"
+#line 902 "./runtime.in"
addFunc(ve, run::gen_runtime104, primGuide(), symbol::trans("operator cast"), formal(primTensionSpecifier(), SYM(t), false, false));
-#line 901 "runtime.in"
+#line 907 "./runtime.in"
addFunc(ve, run::gen_runtime105, primGuide(), SYM_CONTROLS, formal(primPair(), SYM(zout), false, false), formal(primPair(), SYM(zin), false, false));
-#line 906 "runtime.in"
+#line 912 "./runtime.in"
addFunc(ve, run::gen_runtime106, primInt(), SYM(size), formal(primGuide(), SYM(g), false, false));
-#line 913 "runtime.in"
+#line 919 "./runtime.in"
addFunc(ve, run::gen_runtime107, primInt(), SYM(length), formal(primGuide(), SYM(g), false, false));
-#line 920 "runtime.in"
+#line 926 "./runtime.in"
addFunc(ve, run::gen_runtime108, primBoolean(), SYM(cyclic), formal(primGuide(), SYM(g), false, false));
-#line 927 "runtime.in"
+#line 933 "./runtime.in"
addFunc(ve, run::gen_runtime109, primPair(), SYM(point), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false));
-#line 934 "runtime.in"
+#line 940 "./runtime.in"
addFunc(ve, run::gen_runtime110, pairArray(), SYM(dirSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false));
-#line 946 "runtime.in"
+#line 952 "./runtime.in"
addFunc(ve, run::gen_runtime111, pairArray(), SYM(controlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false));
-#line 963 "runtime.in"
+#line 969 "./runtime.in"
addFunc(ve, run::gen_runtime112, primTensionSpecifier(), SYM(tensionSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false));
-#line 973 "runtime.in"
+#line 979 "./runtime.in"
addFunc(ve, run::gen_runtime113, realArray(), SYM(curlSpecifier), formal(primGuide(), SYM(g), false, false), formal(primInt(), SYM(t), false, false));
-#line 987 "runtime.in"
+#line 993 "./runtime.in"
addFunc(ve, run::gen_runtime114, primGuide(), SYM(reverse), formal(primGuide(), SYM(g), false, false));
-#line 1040 "runtime.in"
+#line 1046 "./runtime.in"
addFunc(ve, run::gen_runtime115, realArray(), SYM(_cputime));
-#line 1055 "runtime.in"
+#line 1071 "./runtime.in"
addFunc(ve, run::gen_runtime116, primBoolean(), SYM_EQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false));
-#line 1063 "runtime.in"
+#line 1079 "./runtime.in"
addFunc(ve, run::gen_runtime117, primBoolean(), SYM_NEQ, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false));
-#line 1068 "runtime.in"
+#line 1084 "./runtime.in"
addFunc(ve, run::gen_runtime118, primTransform(), SYM_PLUS, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false));
-#line 1073 "runtime.in"
+#line 1089 "./runtime.in"
addFunc(ve, run::gen_runtime119, primTransform(), SYM_TIMES, formal(primTransform(), SYM(a), false, false), formal(primTransform(), SYM(b), false, false));
-#line 1078 "runtime.in"
+#line 1094 "./runtime.in"
addFunc(ve, run::gen_runtime120, primPair(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPair(), SYM(z), false, false));
-#line 1083 "runtime.in"
+#line 1099 "./runtime.in"
addFunc(ve, run::gen_runtime121, primPath(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPath(), SYM(g), false, false));
-#line 1088 "runtime.in"
+#line 1104 "./runtime.in"
addFunc(ve, run::gen_runtime122, primPen(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPen(), SYM(p), false, false));
-#line 1093 "runtime.in"
+#line 1109 "./runtime.in"
addFunc(ve, run::gen_runtime123, primPicture(), SYM_TIMES, formal(primTransform(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false));
-#line 1098 "runtime.in"
+#line 1114 "./runtime.in"
addFunc(ve, run::gen_runtime124, primPicture(), SYM_TIMES, formal(realArray2(), SYM(t), false, false), formal(primPicture(), SYM(f), false, false));
-#line 1103 "runtime.in"
+#line 1119 "./runtime.in"
addFunc(ve, run::gen_runtime125, primTransform(), SYM_CARET, formal(primTransform(), SYM(t), false, false), formal(primInt(), SYM(n), false, false));
-#line 1114 "runtime.in"
+#line 1130 "./runtime.in"
REGISTER_BLTIN(run::transformXPart,"transformXPart");
-#line 1119 "runtime.in"
+#line 1135 "./runtime.in"
REGISTER_BLTIN(run::transformYPart,"transformYPart");
-#line 1124 "runtime.in"
+#line 1140 "./runtime.in"
REGISTER_BLTIN(run::transformXXPart,"transformXXPart");
-#line 1129 "runtime.in"
+#line 1145 "./runtime.in"
REGISTER_BLTIN(run::transformXYPart,"transformXYPart");
-#line 1134 "runtime.in"
+#line 1150 "./runtime.in"
REGISTER_BLTIN(run::transformYXPart,"transformYXPart");
-#line 1139 "runtime.in"
+#line 1155 "./runtime.in"
REGISTER_BLTIN(run::transformYYPart,"transformYYPart");
-#line 1144 "runtime.in"
+#line 1160 "./runtime.in"
REGISTER_BLTIN(run::real6ToTransform,"real6ToTransform");
-#line 1150 "runtime.in"
+#line 1166 "./runtime.in"
addFunc(ve, run::gen_runtime133, primTransform(), SYM(shift), formal(primTransform(), SYM(t), false, false));
-#line 1155 "runtime.in"
+#line 1171 "./runtime.in"
addFunc(ve, run::gen_runtime134, primTransform(), SYM(shiftless), formal(primTransform(), SYM(t), false, false));
-#line 1160 "runtime.in"
+#line 1176 "./runtime.in"
addFunc(ve, run::transformIdentity, primTransform(), SYM(identity));
-#line 1165 "runtime.in"
+#line 1181 "./runtime.in"
addFunc(ve, run::gen_runtime136, primTransform(), SYM(inverse), formal(primTransform(), SYM(t), false, false));
-#line 1170 "runtime.in"
+#line 1186 "./runtime.in"
addFunc(ve, run::gen_runtime137, primTransform(), SYM(shift), formal(primPair(), SYM(z), false, false));
-#line 1175 "runtime.in"
+#line 1191 "./runtime.in"
addFunc(ve, run::gen_runtime138, primTransform(), SYM(shift), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false));
-#line 1180 "runtime.in"
+#line 1196 "./runtime.in"
addFunc(ve, run::gen_runtime139, primTransform(), SYM(xscale), formal(primReal(), SYM(x), false, false));
-#line 1185 "runtime.in"
+#line 1201 "./runtime.in"
addFunc(ve, run::gen_runtime140, primTransform(), SYM(yscale), formal(primReal(), SYM(y), false, false));
-#line 1190 "runtime.in"
+#line 1206 "./runtime.in"
addFunc(ve, run::gen_runtime141, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false));
-#line 1195 "runtime.in"
+#line 1211 "./runtime.in"
addFunc(ve, run::gen_runtime142, primTransform(), SYM(scale), formal(primReal(), SYM(x), false, false), formal(primReal(), SYM(y), false, false));
-#line 1200 "runtime.in"
+#line 1216 "./runtime.in"
addFunc(ve, run::gen_runtime143, primTransform(), SYM(slant), formal(primReal(), SYM(s), false, false));
-#line 1205 "runtime.in"
+#line 1221 "./runtime.in"
addFunc(ve, run::gen_runtime144, primTransform(), SYM(rotate), formal(primReal(), SYM(angle), false, false), formal(primPair(), SYM(z), true, false));
-#line 1210 "runtime.in"
+#line 1226 "./runtime.in"
addFunc(ve, run::gen_runtime145, primTransform(), SYM(reflect), formal(primPair(), SYM(a), false, false), formal(primPair(), SYM(b), false, false));
-#line 1215 "runtime.in"
+#line 1231 "./runtime.in"
addFunc(ve, run::gen_runtime146, primBoolean(), SYM(isometry), formal(primTransform(), SYM(t), false, false));
-#line 1220 "runtime.in"
+#line 1236 "./runtime.in"
addFunc(ve, run::gen_runtime147, primReal(), SYM(bezier), formal(primReal(), SYM(a), false, false), formal(primReal(), SYM(b), false, false), formal(primReal(), SYM(c), false, false), formal(primReal(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
}
diff --git a/graphics/asymptote/runtime.h b/graphics/asymptote/runtime.h
index e7864e5441..dc9f9e6c69 100644
--- a/graphics/asymptote/runtime.h
+++ b/graphics/asymptote/runtime.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runtime.in; changes will be overwritten *****/
-#ifndef runtime_H
-#define runtime_H
+#pragma once
namespace run {
void IntZero(vm::stack *);
void realZero(vm::stack *);
@@ -35,4 +34,3 @@ void real6ToTransform(vm::stack *);
void transformIdentity(vm::stack *);
}
-#endif // runtime_H
diff --git a/graphics/asymptote/runtime.in b/graphics/asymptote/runtime.in
index bc9154e4f6..d3b3b5488d 100644
--- a/graphics/asymptote/runtime.in
+++ b/graphics/asymptote/runtime.in
@@ -53,9 +53,15 @@ stringarray2* => stringArray2()
#include <iostream>
#include <fstream>
#include <time.h>
+
+#include <chrono>
+#include <thread>
+
+#if !defined(_WIN32)
#include <sys/times.h>
-#include <locale.h>
+#endif
+#include <locale.h>
#include "angle.h"
#include "pair.h"
#include "triple.h"
@@ -71,7 +77,7 @@ stringarray2* => stringArray2()
#include "builtin.h"
#include "texfile.h"
#include "pipestream.h"
-#include "parser.h"
+#include "asyparser.h"
#include "stack.h"
#include "util.h"
#include "locate.h"
@@ -79,7 +85,7 @@ stringarray2* => stringArray2()
#include "callable.h"
#include "stm.h"
#include "lexical.h"
-#include "process.h"
+#include "asyprocess.h"
#include "arrayop.h"
#include "seconds.h"
@@ -706,13 +712,13 @@ void assert(bool b, string s=emptystring)
void sleep(Int seconds)
{
if(seconds <= 0) return;
- sleep(seconds);
+ std::this_thread::sleep_for(std::chrono::seconds(seconds));
}
void usleep(Int microseconds)
{
if(microseconds <= 0) return;
- usleep((unsigned long) microseconds);
+ std::this_thread::sleep_for(std::chrono::microseconds(microseconds));
}
void _eval(string *s, bool embedded, bool interactiveWrite=false)
@@ -1039,15 +1045,25 @@ guide *reverse(guide *g)
realarray *_cputime()
{
+#if !defined(_WIN32)
static const real ticktime=1.0/sysconf(_SC_CLK_TCK);
struct tms buf;
-
::times(&buf);
+
+ real realCutime=((real)buf.tms_cutime)*ticktime;
+ real realCstime=((real)buf.tms_cstime)*ticktime;
+#else
+ // FIXME: See if there's a way to get cutime/cstime on windows,
+ // if it's possible.
+ real realCutime=0.0;
+ real realCstime=0.0;
+#endif
+
array *t=new array(5);
(*t)[0]=cpuTime.seconds(); // Includes system time
(*t)[1]=0.0;
- (*t)[2]=((real) buf.tms_cutime)*ticktime;
- (*t)[3]=((real) buf.tms_cstime)*ticktime;
+ (*t)[2]=realCutime;
+ (*t)[3]=realCstime;
(*t)[4]=wallClock.seconds();
return t;
}
diff --git a/graphics/asymptote/runtime.pl b/graphics/asymptote/runtime.pl
index 4a694c60bc..36a2e5475f 100755..100644
--- a/graphics/asymptote/runtime.pl
+++ b/graphics/asymptote/runtime.pl
@@ -7,13 +7,31 @@
#
#####
-$prefix = shift(@ARGV);
-if (not $prefix) {
- print STDERR "usage: ./runtime.pl module_name\n";
- exit(1);
-}
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+my $opsymbolsFile;
+my $runtimeBaseFile;
+my $prefix;
+my $srcTemplateDir;
+my $headerOutDir;
+my $srcOutDir;
-$stack = "Stack";
+GetOptions(
+ "opsym-file=s" => \$opsymbolsFile,
+ "runtime-base-file=s" => \$runtimeBaseFile,
+ "src-template-dir=s" => \$srcTemplateDir,
+ "prefix=s" => \$prefix,
+ "header-out-dir=s" => \$headerOutDir,
+ "src-out-dir=s" => \$srcOutDir
+) || die("Argument error");
+
+my $outHeaderFile = "$headerOutDir/$prefix.h";
+my $outSrcFile = "$srcOutDir/$prefix.cc";
+
+my $stack = "Stack";
my $errors = 0;
@@ -72,14 +90,16 @@ sub read_types {
# Scrape the symbol names of the operators from opsymbols.h.
my %opsymbols = ();
-open(opsyms, "opsymbols.h") ||
- die("Couldn't open opsymbols.h");
-while (<opsyms>) {
+open(my $opsyms, $opsymbolsFile) ||
+ die("Couldn't open $opsymbolsFile");
+while (<$opsyms>) {
if (m/^OPSYMBOL\(\"(.*)\", ([A-Za-z_]+)\);/) {
$opsymbols{ $1 } = $2;
}
}
+close($opsyms);
+
# Turn a name into a symbol.
sub symbolize {
my $name = shift;
@@ -134,9 +154,9 @@ sub c_params {
$/ = "\f\n";
-open STDIN, "<$prefix.in" or die "can't open input file $prefix.in";
-open BASE, "<runtimebase.in" or die "can't open runtimebase.in";
-open STDOUT, ">$prefix.cc" or die "can't open output file $prefix.cc";
+open STDIN, "<$srcTemplateDir/$prefix.in" or die "can't open input file $srcTemplateDir/$prefix.in";
+open BASE, "<$runtimeBaseFile" or die "can't open $runtimeBaseFile";
+open STDOUT, ">$outSrcFile" or die "can't open output file $outSrcFile";
binmode STDIN, ":unix:crlf";
binmode BASE, ":unix:crlf";
@@ -149,25 +169,25 @@ my $source_line = 1;
print $autogenerated;
-print "#line $base_source_line \"runtimebase.in\"\n";
-$baseheader = <BASE>;
+print "#line $base_source_line \"$srcTemplateDir/runtimebase.in\"\n";
+my $baseheader = <BASE>;
print $baseheader;
-$basesource_line += ($baseheader =~ tr/\n//);;
+my $basesource_line += ($baseheader =~ tr/\n//);;
my $basesource_type_line = $basesource_line;
-print "#line $source_line \"$prefix.in\"\n";
-$header = <>;
+print "#line $source_line \"$srcTemplateDir/$prefix.in\"\n";
+my $header = <>;
print $header;
$source_line += ($header =~ tr/\n//);;
my $source_type_line = $source_line;
-$basetypes = <BASE>;
+my $basetypes = <BASE>;
$basesource_line += ($basetypes =~ tr/\n//);;
-$types = <>;
+my $types = <>;
$source_line += ($types =~ tr/\n//);;
-print "#line $base_source_line \"runtimebase.in\"\n";
+print "#line $base_source_line \"$srcTemplateDir/runtimebase.in\"\n";
$baseheader = <BASE>;
print $baseheader;
$basesource_line += ($baseheader =~ tr/\n//);;
@@ -187,13 +207,14 @@ read_types($basetypes, "runtimebase.in", $basesource_type_line);
read_types($types, "$prefix.in", $source_type_line);
### Begining of `$prefix.h'
+my @header;
push @header, $autogenerated;
# TODO: Capitalize prefix
-push @header, "#ifndef " . $prefix . "_H\n";
-push @header, "#define " . $prefix . "_H\n";
+push @header, "#pragma once\n";
push @header, "namespace run {\n";
my $count = 0;
+my @builtin;
while (<>) {
my ($comments,$type,$name,$cname,$params,$code) =
m|^((?:\s*//[^\n]*\n)*) # comment lines
@@ -225,7 +246,7 @@ while (<>) {
assoc_error("$prefix.in", $source_line, $type);
}
my @asy_params = asy_params($params, "$prefix.in", $source_line);
- push @builtin, "#line $source_line \"$prefix.in\"\n"
+ push @builtin, "#line $source_line \"$srcTemplateDir/$prefix.in\"\n"
. " addFunc(ve, run::" . $cname
. ", " . $type_map{$type}
. ", " . symbolize($name)
@@ -237,22 +258,22 @@ while (<>) {
# Build REGISTER_BLTIN command for builtin functions which are not added to
# the environment.
if (not $name and $cname) {
- push @builtin, "#line $source_line \"$prefix.in\"\n"
+ push @builtin, "#line $source_line \"$srcTemplateDir/$prefix.in\"\n"
. " REGISTER_BLTIN(run::" . $cname
. ',"' . $cname . '"' . ");\n";
}
# Handle marshalling of values to/from stack
- $qualifier = ($type eq "item" ? "" : "<$type>");
+ my $qualifier = ($type eq "item" ? "" : "<$type>");
$code =~ s/\breturn ([^;]*);/{$stack->push$qualifier($1); return;}/g;
- $args = join("",c_params(@params));
+ my $args = join("",c_params(@params));
print $comments;
- $ncomments = ($comments =~ tr/\n//);
+ my $ncomments = ($comments =~ tr/\n//);
$source_line += $ncomments;
- print "#line $source_line \"$prefix.in\"\n";
+ print "#line $source_line \"$srcTemplateDir/$prefix.in\"\n";
my $prototype=$type . " " . $name . "(" . $params . ");";
- $nprototype = ($prototype =~ tr/\n//)+1;
+ my $nprototype = ($prototype =~ tr/\n//)+1;
$source_line += $nprototype;
if($name) {
clean_params($prototype);
@@ -261,7 +282,7 @@ while (<>) {
print "void $cname(stack *";
if($type ne "void" or $params ne "") {print $stack;}
print ")\n{\n$args";
- print "#line $source_line \"$prefix.in\"";
+ print "#line $source_line \"$srcTemplateDir/$prefix.in\"";
print "$code}\n\n";
$source_line -= $ncomments+$nprototype;
@@ -279,19 +300,21 @@ print "} // namespace trans\n";
### End of `header.h'
push @header, "}\n\n";
-push @header, "#endif // ". $prefix . "_H\n";
undef $/;
-open HEADER, "<", "$prefix.h";
-$orig_header = <HEADER>;
-$new_header = join "", @header;
+open my $HEADER, "<", $outHeaderFile;
+my $orig_header = <$HEADER>;
+close $HEADER;
+
+my $new_header = join "", @header;
if ($new_header ne $orig_header) {
- open HEADER, ">", "$prefix.h";
- print HEADER $new_header;
+ open $HEADER, ">", $outHeaderFile;
+ print $HEADER $new_header;
+ close $HEADER;
}
if ($errors) {
- unlink("$prefix.h");
- unlink("$prefix.cc");
+ unlink($outHeaderFile);
+ unlink($outSrcFile);
}
exit($errors);
diff --git a/graphics/asymptote/runtriple.cc b/graphics/asymptote/runtriple.cc
index 919f2957f1..221006c945 100644
--- a/graphics/asymptote/runtriple.cc
+++ b/graphics/asymptote/runtriple.cc
@@ -1,6 +1,6 @@
/***** Autogenerated from runtriple.in; changes will be overwritten *****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
/*****
* runtimebase.in
* Andy Hammerlindl 2009/07/28
@@ -10,7 +10,7 @@
*****/
-#line 1 "runtriple.in"
+#line 1 "./runtriple.in"
/*****
* runtriple.in
*
@@ -18,7 +18,7 @@
*
*****/
-#line 1 "runtimebase.in"
+#line 1 "./runtimebase.in"
#include "stack.h"
#include "types.h"
#include "builtin.h"
@@ -77,243 +77,243 @@ using namespace camp;
#endif
namespace run {
-#line 19 "runtriple.in"
+#line 19 "./runtriple.in"
void tripleZero(stack *Stack)
{
-#line 20 "runtriple.in"
+#line 20 "./runtriple.in"
static triple zero;
{Stack->push<triple>(zero); return;}
}
-#line 25 "runtriple.in"
+#line 25 "./runtriple.in"
void realRealRealToTriple(stack *Stack)
{
real z=vm::pop<real>(Stack);
real y=vm::pop<real>(Stack);
real x=vm::pop<real>(Stack);
-#line 26 "runtriple.in"
+#line 26 "./runtriple.in"
{Stack->push<triple>(triple(x,y,z)); return;}
}
-#line 30 "runtriple.in"
+#line 30 "./runtriple.in"
// real xpart(triple v);
void tripleXPart(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 31 "runtriple.in"
+#line 31 "./runtriple.in"
{Stack->push<real>(v.getx()); return;}
}
-#line 35 "runtriple.in"
+#line 35 "./runtriple.in"
// real ypart(triple v);
void tripleYPart(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 36 "runtriple.in"
+#line 36 "./runtriple.in"
{Stack->push<real>(v.gety()); return;}
}
-#line 40 "runtriple.in"
+#line 40 "./runtriple.in"
// real zpart(triple v);
void tripleZPart(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 41 "runtriple.in"
+#line 41 "./runtriple.in"
{Stack->push<real>(v.getz()); return;}
}
-#line 45 "runtriple.in"
+#line 45 "./runtriple.in"
// triple *(real x, triple v);
void gen_runtriple5(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
real x=vm::pop<real>(Stack);
-#line 46 "runtriple.in"
+#line 46 "./runtriple.in"
{Stack->push<triple>(x*v); return;}
}
-#line 50 "runtriple.in"
+#line 50 "./runtriple.in"
// triple *(triple v, real x);
void gen_runtriple6(stack *Stack)
{
real x=vm::pop<real>(Stack);
triple v=vm::pop<triple>(Stack);
-#line 51 "runtriple.in"
+#line 51 "./runtriple.in"
{Stack->push<triple>(v*x); return;}
}
-#line 55 "runtriple.in"
+#line 55 "./runtriple.in"
// triple /(triple v, real x);
void gen_runtriple7(stack *Stack)
{
real x=vm::pop<real>(Stack);
triple v=vm::pop<triple>(Stack);
-#line 56 "runtriple.in"
+#line 56 "./runtriple.in"
{Stack->push<triple>(v/x); return;}
}
-#line 60 "runtriple.in"
+#line 60 "./runtriple.in"
// real length(triple v);
void gen_runtriple8(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 61 "runtriple.in"
+#line 61 "./runtriple.in"
{Stack->push<real>(v.length()); return;}
}
-#line 65 "runtriple.in"
+#line 65 "./runtriple.in"
// real abs(triple v);
void gen_runtriple9(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 66 "runtriple.in"
+#line 66 "./runtriple.in"
{Stack->push<real>(v.length()); return;}
}
-#line 70 "runtriple.in"
+#line 70 "./runtriple.in"
// real abs2(triple v);
void gen_runtriple10(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 71 "runtriple.in"
+#line 71 "./runtriple.in"
{Stack->push<real>(abs2(v)); return;}
}
-#line 75 "runtriple.in"
+#line 75 "./runtriple.in"
// real polar(triple v, bool warn=true);
void gen_runtriple11(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
triple v=vm::pop<triple>(Stack);
-#line 76 "runtriple.in"
+#line 76 "./runtriple.in"
{Stack->push<real>(v.polar(warn)); return;}
}
-#line 80 "runtriple.in"
+#line 80 "./runtriple.in"
// real azimuth(triple v, bool warn=true);
void gen_runtriple12(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
triple v=vm::pop<triple>(Stack);
-#line 81 "runtriple.in"
+#line 81 "./runtriple.in"
if(!warn && v.getx() == 0.0 && v.gety() == 0.0) {Stack->push<real>(0.0); return;}
{Stack->push<real>(v.azimuth()); return;}
}
-#line 86 "runtriple.in"
+#line 86 "./runtriple.in"
// real colatitude(triple v, bool warn=true);
void gen_runtriple13(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
triple v=vm::pop<triple>(Stack);
-#line 87 "runtriple.in"
+#line 87 "./runtriple.in"
if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) {Stack->push<real>(0.0); return;}
{Stack->push<real>(degrees(v.polar())); return;}
}
-#line 92 "runtriple.in"
+#line 92 "./runtriple.in"
// real latitude(triple v, bool warn=true);
void gen_runtriple14(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
triple v=vm::pop<triple>(Stack);
-#line 93 "runtriple.in"
+#line 93 "./runtriple.in"
if(!warn && v.getx() == 0.0 && v.gety() == 0.0 && v.getz() == 0.0) {Stack->push<real>(0.0); return;}
{Stack->push<real>(90.0-degrees(v.polar())); return;}
}
// Return the longitude of v in [0,360).
-#line 99 "runtriple.in"
+#line 99 "./runtriple.in"
// real longitude(triple v, bool warn=true);
void gen_runtriple15(stack *Stack)
{
bool warn=vm::pop<bool>(Stack,true);
triple v=vm::pop<triple>(Stack);
-#line 100 "runtriple.in"
+#line 100 "./runtriple.in"
if(!warn && v.getx() == 0.0 && v.gety() == 0.0) {Stack->push<real>(0.0); return;}
{Stack->push<real>(principalBranch(degrees(v.azimuth()))); return;}
}
-#line 105 "runtriple.in"
+#line 105 "./runtriple.in"
// triple unit(triple v);
void gen_runtriple16(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
-#line 106 "runtriple.in"
+#line 106 "./runtriple.in"
{Stack->push<triple>(unit(v)); return;}
}
-#line 110 "runtriple.in"
+#line 110 "./runtriple.in"
// real dot(triple u, triple v);
void gen_runtriple17(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
triple u=vm::pop<triple>(Stack);
-#line 111 "runtriple.in"
+#line 111 "./runtriple.in"
{Stack->push<real>(dot(u,v)); return;}
}
-#line 115 "runtriple.in"
+#line 115 "./runtriple.in"
// triple cross(triple u, triple v);
void gen_runtriple18(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
triple u=vm::pop<triple>(Stack);
-#line 116 "runtriple.in"
+#line 116 "./runtriple.in"
{Stack->push<triple>(cross(u,v)); return;}
}
-#line 120 "runtriple.in"
+#line 120 "./runtriple.in"
// triple dir(explicit triple z);
void gen_runtriple19(stack *Stack)
{
triple z=vm::pop<triple>(Stack);
-#line 121 "runtriple.in"
+#line 121 "./runtriple.in"
{Stack->push<triple>(unit(z)); return;}
}
-#line 125 "runtriple.in"
+#line 125 "./runtriple.in"
// triple expi(real polar, real azimuth);
void gen_runtriple20(stack *Stack)
{
real azimuth=vm::pop<real>(Stack);
real polar=vm::pop<real>(Stack);
-#line 126 "runtriple.in"
+#line 126 "./runtriple.in"
{Stack->push<triple>(expi(polar,azimuth)); return;}
}
-#line 130 "runtriple.in"
+#line 130 "./runtriple.in"
// triple dir(real colatitude, real longitude);
void gen_runtriple21(stack *Stack)
{
real longitude=vm::pop<real>(Stack);
real colatitude=vm::pop<real>(Stack);
-#line 131 "runtriple.in"
+#line 131 "./runtriple.in"
{Stack->push<triple>(expi(radians(colatitude),radians(longitude))); return;}
}
-#line 135 "runtriple.in"
+#line 135 "./runtriple.in"
// triple realmult(triple u, triple v);
void gen_runtriple22(stack *Stack)
{
triple v=vm::pop<triple>(Stack);
triple u=vm::pop<triple>(Stack);
-#line 136 "runtriple.in"
+#line 136 "./runtriple.in"
{Stack->push<triple>(triple (u.getx()*v.getx(),u.gety()*v.gety(),u.getz()*v.getz())); return;}
}
// Return the component of vector v perpendicular to a unit vector u.
-#line 141 "runtriple.in"
+#line 141 "./runtriple.in"
// triple perp(triple v, triple u);
void gen_runtriple23(stack *Stack)
{
triple u=vm::pop<triple>(Stack);
triple v=vm::pop<triple>(Stack);
-#line 142 "runtriple.in"
+#line 142 "./runtriple.in"
{Stack->push<triple>(perp(v,u)); return;}
}
-#line 146 "runtriple.in"
+#line 146 "./runtriple.in"
// triple bezier(triple a, triple b, triple c, triple d, real t);
void gen_runtriple24(stack *Stack)
{
@@ -322,13 +322,13 @@ void gen_runtriple24(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 147 "runtriple.in"
+#line 147 "./runtriple.in"
real onemt=1-t;
real onemt2=onemt*onemt;
{Stack->push<triple>(onemt2*onemt*a+t*(3.0*(onemt2*b+t*onemt*c)+t*t*d)); return;}
}
-#line 153 "runtriple.in"
+#line 153 "./runtriple.in"
// triple bezierP(triple a, triple b, triple c, triple d, real t);
void gen_runtriple25(stack *Stack)
{
@@ -337,11 +337,11 @@ void gen_runtriple25(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 154 "runtriple.in"
+#line 154 "./runtriple.in"
{Stack->push<triple>(3.0*(t*t*(d-a+3.0*(b-c))+t*(2.0*(a+c)-4.0*b)+b-a)); return;}
}
-#line 158 "runtriple.in"
+#line 158 "./runtriple.in"
// triple bezierPP(triple a, triple b, triple c, triple d, real t);
void gen_runtriple26(stack *Stack)
{
@@ -350,11 +350,11 @@ void gen_runtriple26(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 159 "runtriple.in"
+#line 159 "./runtriple.in"
{Stack->push<triple>(6.0*(t*(d-a+3.0*(b-c))+a+c)-12.0*b); return;}
}
-#line 163 "runtriple.in"
+#line 163 "./runtriple.in"
// triple bezierPPP(triple a, triple b, triple c, triple d);
void gen_runtriple27(stack *Stack)
{
@@ -362,7 +362,7 @@ void gen_runtriple27(stack *Stack)
triple c=vm::pop<triple>(Stack);
triple b=vm::pop<triple>(Stack);
triple a=vm::pop<triple>(Stack);
-#line 164 "runtriple.in"
+#line 164 "./runtriple.in"
{Stack->push<triple>(6.0*(d-a)+18.0*(b-c)); return;}
}
@@ -372,61 +372,61 @@ namespace trans {
void gen_runtriple_venv(venv &ve)
{
-#line 19 "runtriple.in"
+#line 19 "./runtriple.in"
REGISTER_BLTIN(run::tripleZero,"tripleZero");
-#line 25 "runtriple.in"
+#line 25 "./runtriple.in"
REGISTER_BLTIN(run::realRealRealToTriple,"realRealRealToTriple");
-#line 30 "runtriple.in"
+#line 30 "./runtriple.in"
addFunc(ve, run::tripleXPart, primReal(), SYM(xpart), formal(primTriple(), SYM(v), false, false));
-#line 35 "runtriple.in"
+#line 35 "./runtriple.in"
addFunc(ve, run::tripleYPart, primReal(), SYM(ypart), formal(primTriple(), SYM(v), false, false));
-#line 40 "runtriple.in"
+#line 40 "./runtriple.in"
addFunc(ve, run::tripleZPart, primReal(), SYM(zpart), formal(primTriple(), SYM(v), false, false));
-#line 45 "runtriple.in"
+#line 45 "./runtriple.in"
addFunc(ve, run::gen_runtriple5, primTriple(), SYM_TIMES, formal(primReal(), SYM(x), false, false), formal(primTriple(), SYM(v), false, false));
-#line 50 "runtriple.in"
+#line 50 "./runtriple.in"
addFunc(ve, run::gen_runtriple6, primTriple(), SYM_TIMES, formal(primTriple(), SYM(v), false, false), formal(primReal(), SYM(x), false, false));
-#line 55 "runtriple.in"
+#line 55 "./runtriple.in"
addFunc(ve, run::gen_runtriple7, primTriple(), SYM_DIVIDE, formal(primTriple(), SYM(v), false, false), formal(primReal(), SYM(x), false, false));
-#line 60 "runtriple.in"
+#line 60 "./runtriple.in"
addFunc(ve, run::gen_runtriple8, primReal(), SYM(length), formal(primTriple(), SYM(v), false, false));
-#line 65 "runtriple.in"
+#line 65 "./runtriple.in"
addFunc(ve, run::gen_runtriple9, primReal(), SYM(abs), formal(primTriple(), SYM(v), false, false));
-#line 70 "runtriple.in"
+#line 70 "./runtriple.in"
addFunc(ve, run::gen_runtriple10, primReal(), SYM(abs2), formal(primTriple(), SYM(v), false, false));
-#line 75 "runtriple.in"
+#line 75 "./runtriple.in"
addFunc(ve, run::gen_runtriple11, primReal(), SYM(polar), formal(primTriple(), SYM(v), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 80 "runtriple.in"
+#line 80 "./runtriple.in"
addFunc(ve, run::gen_runtriple12, primReal(), SYM(azimuth), formal(primTriple(), SYM(v), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 86 "runtriple.in"
+#line 86 "./runtriple.in"
addFunc(ve, run::gen_runtriple13, primReal(), SYM(colatitude), formal(primTriple(), SYM(v), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 92 "runtriple.in"
+#line 92 "./runtriple.in"
addFunc(ve, run::gen_runtriple14, primReal(), SYM(latitude), formal(primTriple(), SYM(v), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 98 "runtriple.in"
+#line 98 "./runtriple.in"
addFunc(ve, run::gen_runtriple15, primReal(), SYM(longitude), formal(primTriple(), SYM(v), false, false), formal(primBoolean(), SYM(warn), true, false));
-#line 105 "runtriple.in"
+#line 105 "./runtriple.in"
addFunc(ve, run::gen_runtriple16, primTriple(), SYM(unit), formal(primTriple(), SYM(v), false, false));
-#line 110 "runtriple.in"
+#line 110 "./runtriple.in"
addFunc(ve, run::gen_runtriple17, primReal(), SYM(dot), formal(primTriple(), SYM(u), false, false), formal(primTriple(), SYM(v), false, false));
-#line 115 "runtriple.in"
+#line 115 "./runtriple.in"
addFunc(ve, run::gen_runtriple18, primTriple(), SYM(cross), formal(primTriple(), SYM(u), false, false), formal(primTriple(), SYM(v), false, false));
-#line 120 "runtriple.in"
+#line 120 "./runtriple.in"
addFunc(ve, run::gen_runtriple19, primTriple(), SYM(dir), formal(primTriple(), SYM(z), false, true));
-#line 125 "runtriple.in"
+#line 125 "./runtriple.in"
addFunc(ve, run::gen_runtriple20, primTriple(), SYM(expi), formal(primReal(), SYM(polar), false, false), formal(primReal(), SYM(azimuth), false, false));
-#line 130 "runtriple.in"
+#line 130 "./runtriple.in"
addFunc(ve, run::gen_runtriple21, primTriple(), SYM(dir), formal(primReal(), SYM(colatitude), false, false), formal(primReal(), SYM(longitude), false, false));
-#line 135 "runtriple.in"
+#line 135 "./runtriple.in"
addFunc(ve, run::gen_runtriple22, primTriple(), SYM(realmult), formal(primTriple(), SYM(u), false, false), formal(primTriple(), SYM(v), false, false));
-#line 140 "runtriple.in"
+#line 140 "./runtriple.in"
addFunc(ve, run::gen_runtriple23, primTriple(), SYM(perp), formal(primTriple(), SYM(v), false, false), formal(primTriple(), SYM(u), false, false));
-#line 146 "runtriple.in"
+#line 146 "./runtriple.in"
addFunc(ve, run::gen_runtriple24, primTriple(), SYM(bezier), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 153 "runtriple.in"
+#line 153 "./runtriple.in"
addFunc(ve, run::gen_runtriple25, primTriple(), SYM(bezierP), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 158 "runtriple.in"
+#line 158 "./runtriple.in"
addFunc(ve, run::gen_runtriple26, primTriple(), SYM(bezierPP), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false), formal(primReal(), SYM(t), false, false));
-#line 163 "runtriple.in"
+#line 163 "./runtriple.in"
addFunc(ve, run::gen_runtriple27, primTriple(), SYM(bezierPPP), formal(primTriple(), SYM(a), false, false), formal(primTriple(), SYM(b), false, false), formal(primTriple(), SYM(c), false, false), formal(primTriple(), SYM(d), false, false));
}
diff --git a/graphics/asymptote/runtriple.h b/graphics/asymptote/runtriple.h
index aff21b39fc..1de776f9e2 100644
--- a/graphics/asymptote/runtriple.h
+++ b/graphics/asymptote/runtriple.h
@@ -1,7 +1,6 @@
/***** Autogenerated from runtriple.in; changes will be overwritten *****/
-#ifndef runtriple_H
-#define runtriple_H
+#pragma once
namespace run {
void tripleZero(vm::stack *);
void realRealRealToTriple(vm::stack *);
@@ -10,4 +9,3 @@ void tripleYPart(vm::stack *);
void tripleZPart(vm::stack *);
}
-#endif // runtriple_H
diff --git a/graphics/asymptote/seconds.h b/graphics/asymptote/seconds.h
index f8d94b92c1..3b78042c04 100644
--- a/graphics/asymptote/seconds.h
+++ b/graphics/asymptote/seconds.h
@@ -2,7 +2,10 @@
#define __seconds_h__ 1
#include <chrono>
+
+#if !defined(_WIN32)
#include <sys/resource.h>
+#endif
namespace utils {
diff --git a/graphics/asymptote/settings.cc b/graphics/asymptote/settings.cc
index f7fa46afe0..7f606812aa 100644
--- a/graphics/asymptote/settings.cc
+++ b/graphics/asymptote/settings.cc
@@ -11,10 +11,19 @@
#include <cerrno>
#include <sys/stat.h>
#include <cfloat>
-#include <locale.h>
-#include <unistd.h>
+#include <clocale>
#include <algorithm>
+#if defined(_WIN32)
+#include <Windows.h>
+#include <io.h>
+#define isatty _isatty
+
+#include "win32helpers.h"
+#else
+#include <unistd.h>
+#endif
+
#include "common.h"
#if HAVE_GNU_GETOPT_H
@@ -41,15 +50,22 @@
extern "C" {
#ifdef HAVE_NCURSES_CURSES_H
+#define USE_SETUPTERM
#include <ncurses/curses.h>
#include <ncurses/term.h>
#elif HAVE_NCURSES_H
+#define USE_SETUPTERM
#include <ncurses.h>
#include <term.h>
#elif HAVE_CURSES_H
#include <curses.h>
+
+#if defined(HAVE_TERM_H)
+#define USE_SETUPTERM
#include <term.h>
#endif
+
+#endif
}
#endif
@@ -81,7 +97,9 @@ const bool havegl=true;
const bool havegl=false;
#endif
+#if !defined(_WIN32)
mode_t mask;
+#endif
string systemDir=ASYMPTOTE_SYSDIR;
string defaultPSdriver="ps2write";
@@ -90,7 +108,7 @@ string defaultPNGdriver="png16m"; // pngalpha has issues at high resolutions
string defaultAsyGL="https://vectorgraphics.github.io/asymptote/base/webgl/asygl-"+
string(AsyGLVersion)+".js";
-#ifndef __MSDOS__
+#if !defined(_WIN32)
bool msdos=false;
string HOME="HOME";
@@ -118,92 +136,185 @@ bool msdos=true;
string HOME="USERPROFILE";
string docdir="c:\\Program Files\\Asymptote";
const char pathSeparator=';';
-string defaultPSViewer="cmd";
+string defaultPSViewer;
//string defaultPDFViewer="AcroRd32.exe";
-string defaultPDFViewer="cmd";
-string defaultHTMLViewer="cmd";
+string defaultPDFViewer;
+string defaultHTMLViewer;
string defaultGhostscript;
string defaultGhostscriptLibrary;
-string defaultDisplay="cmd";
+string defaultDisplay;
//string defaultAnimate="magick";
-string defaultAnimate="cmd";
+string defaultAnimate="";
const string dirsep="\\";
-#include <dirent.h>
-
-// Use key to look up an entry in the MSWindows registry, respecting wild cards
-string getEntry(const string& location, const string& key)
+/**
+ * Use key to look up an entry in the MSWindows registry,
+ * @param baseRegLocation base location for a key
+ * @param key Key to look up, respecting wild cards
+ * @remark Wildcards can only be in keys, not in the final value
+ * @return Entry value, or an empty string if not found
+ */
+string getEntry(const HKEY& baseRegLocation, const string& key)
{
- string path="/proc/registry"+location+key;
+ string path=key;
size_t star;
string head;
- while((star=path.find("*")) < string::npos) {
+ while((star=path.find('*')) < string::npos)
+ {
+ // has asterisk in the path
+
string prefix=path.substr(0,star);
- string suffix=path.substr(star+1);
- size_t slash=suffix.find("/");
+ string pathSuffix=path.substr(star+1);
+ // path = prefix [*] pathSuffix
+ size_t slash=pathSuffix.find('\\');
if(slash < string::npos) {
- path=suffix.substr(slash);
- suffix=suffix.substr(0,slash);
+ // pathsuffix is not leaf yet
+ // pathSuffix = <new path suffix>[/<new path>]
+ path=pathSuffix.substr(slash);
+ pathSuffix=pathSuffix.substr(0,slash);
} else {
- path=suffix;
- suffix="";
+ // pathSuffix is entirely part of registry value name
+ // pathSuffix = <new path>, new path suffix is empty
+ path=pathSuffix;
+ pathSuffix="";
}
string directory=head+stripFile(prefix);
string file=stripDir(prefix);
- DIR *dir=opendir(directory.c_str());
- if(dir == NULL) return "";
- dirent *p;
- string rsuffix=suffix;
- reverse(rsuffix.begin(),rsuffix.end());
- while((p=readdir(dir)) != NULL) {
- string dname=p->d_name;
+ // prefix = directory/file
+ // [old path] = directory/file [*] pathSuffix [/path]
+ // or, if asterisk is in the leaf
+ // [old path] = directory/file[*]path, pathSuffix is empty
+
+ camp::w32::RegKeyWrapper currRegDirectory;
+ if (RegOpenKeyExA(baseRegLocation, directory.c_str(), 0, KEY_READ, currRegDirectory.put()) != ERROR_SUCCESS)
+ {
+ currRegDirectory.release();
+ return "";
+ }
+
+ DWORD numSubKeys;
+ DWORD longestSubkeySize;
+
+ if (RegQueryInfoKeyA(
+ currRegDirectory.getKey(),
+ nullptr, nullptr, nullptr,
+ &numSubKeys, &longestSubkeySize,
+ nullptr, nullptr, nullptr, nullptr, nullptr, nullptr) != ERROR_SUCCESS)
+ {
+ numSubKeys = 0;
+ longestSubkeySize = 0;
+ }
+ mem::vector<char> subkeyBuffer(longestSubkeySize + 1);
+ bool found=false;
+
+ string rsuffix= pathSuffix;
+ reverse(rsuffix.begin(), rsuffix.end());
+ for (DWORD i=0;i<numSubKeys;++i)
+ {
+ DWORD cchValue=longestSubkeySize + 1;
+
+ if (auto const regQueryResult= RegEnumKeyExA(
+ currRegDirectory.getKey(),
+ i,
+ subkeyBuffer.data(),
+ &cchValue,
+ nullptr,
+ nullptr,
+ nullptr,
+ nullptr
+ );
+ regQueryResult != ERROR_SUCCESS)
+ {
+ continue;
+ }
+
+ string const dname(subkeyBuffer.data());
string rdname=dname;
reverse(rdname.begin(),rdname.end());
- if(dname != "." && dname != ".." &&
- dname.substr(0,file.size()) == file &&
- rdname.substr(0,suffix.size()) == rsuffix) {
- head=directory+p->d_name;
+ if(dname.substr(0,file.size()) == file &&
+ rdname.substr(0, pathSuffix.size()) == rsuffix) {
+ // dname matches file [*} pathSuffix
+ head=directory+dname;
+ found=true;
break;
}
}
- if(p == NULL) return "";
+
+ if (!found)
+ {
+ return "";
+ }
}
- std::ifstream fin((head+path).c_str());
- if(fin) {
- string s;
- getline(fin,s);
- size_t end=s.find('\0');
- if(end < string::npos)
- return s.substr(0,end);
+
+ if (path.find('\\') == 0)
+ {
+ path = path.substr(1); // strip the prefix separator
}
- return "";
+
+ if (path == "@")
+ {
+ path= "";// default registry key
+ }
+
+ DWORD requiredStrSize=0;
+ // FIXME: Add handling of additional types
+ if (RegGetValueA(baseRegLocation, head.c_str(), path.c_str(), RRF_RT_REG_SZ, nullptr, nullptr, &requiredStrSize) !=
+ ERROR_SUCCESS)
+ {
+ return "";
+ }
+
+ mem::vector<BYTE> outputBuffer(requiredStrSize);
+
+ if (auto const retCheck = RegGetValueA(baseRegLocation, head.c_str(), path.c_str(),
+ RRF_RT_REG_SZ,
+ nullptr,
+ outputBuffer.data(),
+ &requiredStrSize
+ );
+ retCheck != ERROR_SUCCESS)
+ {
+ return "";
+ }
+
+ return reinterpret_cast<char const*>(outputBuffer.data());
}
// Use key to look up an entry in the MSWindows registry, respecting wild cards
string getEntry(const string& key)
{
- string entry=getEntry("64/HKEY_CURRENT_USER/Software/",key);
- if(entry.empty()) entry=getEntry("64/HKEY_LOCAL_MACHINE/SOFTWARE/",key);
- if(entry.empty()) entry=getEntry("/HKEY_CURRENT_USER/Software/",key);
- if(entry.empty()) entry=getEntry("/HKEY_LOCAL_MACHINE/SOFTWARE/",key);
- return entry;
+ for (HKEY const keyToSearch : { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER })
+ {
+ camp::w32::RegKeyWrapper baseRegKey;
+ if (RegOpenKeyExA(keyToSearch, "Software", 0, KEY_READ, baseRegKey.put()) != ERROR_SUCCESS)
+ {
+ baseRegKey.release();
+ continue;
+ }
+
+ if (string entry=getEntry(baseRegKey.getKey(),key); !entry.empty())
+ {
+ return entry;
+ }
+ }
+
+ return "";
}
void queryRegistry()
{
- string defaultGhostscriptLibrary=getEntry("GPL Ghostscript/*/GS_DLL");
+ defaultGhostscriptLibrary= getEntry(R"(GPL Ghostscript\*\GS_DLL)");
if(defaultGhostscriptLibrary.empty())
- defaultGhostscriptLibrary=getEntry("AFPL Ghostscript/*/GS_DLL");
+ defaultGhostscriptLibrary=getEntry(R"(AFPL Ghostscript\*\GS_DLL)");
string gslib=stripDir(defaultGhostscriptLibrary);
defaultGhostscript=stripFile(defaultGhostscriptLibrary)+
((gslib.empty() || gslib.substr(5,2) == "32") ? "gswin32c.exe" : "gswin64c.exe");
- if(defaultPDFViewer != "cmd")
- defaultPDFViewer=getEntry("Adobe/Acrobat Reader/*/InstallPath/@")+"\\"+
- defaultPDFViewer;
- string s;
- s=getEntry("Microsoft/Windows/CurrentVersion/App Paths/Asymptote/Path");
- if(!s.empty()) docdir=s;
+
+ if (string const s= getEntry(R"(Microsoft\Windows\CurrentVersion\App Paths\Asymptote\Path)"); !s.empty())
+ {
+ docdir= s;
+ }
// An empty systemDir indicates a TeXLive build
if(!systemDir.empty() && !docdir.empty())
systemDir=docdir;
@@ -211,10 +322,6 @@ void queryRegistry()
#endif
-const char PROGRAM[]=PACKAGE_NAME;
-const char VERSION[]=PACKAGE_VERSION;
-const char BUGREPORT[]=PACKAGE_BUGREPORT;
-
// The name of the program (as called). Used when displaying help info.
char *argv0;
@@ -896,7 +1003,7 @@ void addOption(option *o) {
void version()
{
- cerr << PROGRAM << " version " << REVISION
+ cerr << PACKAGE_NAME << " version " << REVISION
<< " [(C) 2004 Andy Hammerlindl, John C. Bowman, Tom Prince]"
<< endl;
}
@@ -1194,7 +1301,9 @@ array* stringArray(const char **s)
void initSettings() {
static bool initialize=true;
if(initialize) {
+#if defined(_WIN32)
queryRegistry();
+#endif
initialize=false;
}
@@ -1415,7 +1524,9 @@ void initSettings() {
addOption(new envSetting("lsphost", "127.0.0.1"));
#endif
+#if defined(LINUX_SYSTEM)
addOption(new boolSetting("wsl", 0, "Run asy under the Windows Subsystem for Linux"));
+#endif
addOption(new boolSetting("wait", 0,
"Wait for child processes to finish before exiting"));
@@ -1537,15 +1648,28 @@ void setInteractive()
exit(-1);
}
+#if defined(HAVE_LSP)
+ bool lspmode=getSetting<Int>("lsp");
+#else
+ bool lspmode=false;
+#endif
+
if(numArgs() == 0 && !getSetting<bool>("listvariables") &&
getSetting<string>("command").empty() &&
- (isatty(STDIN_FILENO) || xasy || getSetting<Int>("lsp")))
+ (isatty(STDIN_FILENO) || xasy || lspmode))
interact::interactive=true;
if(getSetting<bool>("localhistory"))
historyname=string(getPath())+dirsep+"."+suffix+"_history";
else {
- if(mkdir(initdir.c_str(),0777) != 0 && errno != EEXIST)
+#if defined(_WIN32)
+ bool mkdirResult = CreateDirectoryA(initdir.c_str(), nullptr);
+ bool mkdirSuccess = mkdirResult || GetLastError() == ERROR_ALREADY_EXISTS;
+#else
+ int mkdirResult = mkdir(initdir.c_str(),0777);
+ bool mkdirSuccess = mkdirResult == 0 || errno == EEXIST;
+#endif
+ if(!mkdirSuccess)
cerr << "failed to create directory "+initdir+"." << endl;
historyname=initdir+"/history";
}
@@ -1618,12 +1742,14 @@ void initDir() {
if(initdir.empty())
initdir=Getenv(HOME.c_str(),msdos)+dirsep+"."+suffix;
-#ifdef __MSDOS__
- mask=umask(0);
- if(mask == 0) mask=0027;
- umask(mask);
+#if defined(_WIN32)
+ DWORD dirAttrib = GetFileAttributesA(initdir.c_str());
+ bool dirExists = dirAttrib != INVALID_FILE_ATTRIBUTES && ((dirAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0);
+#else
+ bool dirExists = access(initdir.c_str(),F_OK) == 0;
#endif
- if(access(initdir.c_str(),F_OK) == 0) {
+
+ if(dirExists) {
if(!quiet && verbose > 1)
cerr << "Using configuration directory " << initdir << endl;
}
@@ -1641,7 +1767,14 @@ void setPath() {
}
if(i < asydir.length()) searchPath.push_back(asydir.substr(i));
}
- if(access(initdir.c_str(),F_OK) == 0)
+#if defined(_WIN32)
+ DWORD dirAttrib = GetFileAttributesA(initdir.c_str());
+ bool dirExists = dirAttrib != INVALID_FILE_ATTRIBUTES && ((dirAttrib & FILE_ATTRIBUTE_DIRECTORY) != 0);
+#else
+ bool dirExists = access(initdir.c_str(),F_OK) == 0;
+#endif
+
+ if(dirExists)
searchPath.push_back(initdir);
string sysdir=getSetting<string>("sysdir");
if(sysdir != "")
@@ -1812,7 +1945,7 @@ Int getScroll()
if(!terminal)
terminal=getenv("TERM");
if(terminal) {
-#ifndef __MSDOS__
+#if defined(USE_SETUPTERM)
int error=setupterm(terminal,1,&error);
if(error == 0) scroll=lines > 2 ? lines-1 : 1;
else
diff --git a/graphics/asymptote/settings.h b/graphics/asymptote/settings.h
index 6d55aae962..27686a6acb 100644
--- a/graphics/asymptote/settings.h
+++ b/graphics/asymptote/settings.h
@@ -39,10 +39,6 @@ void endwait(pthread_cond_t& signal, pthread_mutex_t& lock);
}
namespace settings {
-extern const char PROGRAM[];
-extern const char VERSION[];
-extern const char BUGREPORT[];
-
extern char *argv0;
void Warn(const string& s);
@@ -94,7 +90,9 @@ char *getArg(int n);
Int getScroll();
+#if !defined(_MSC_VER)
extern mode_t mask;
+#endif
bool xe(const string& texengine);
bool lua(const string& texengine);
diff --git a/graphics/asymptote/shaders.h b/graphics/asymptote/shaders.h
index 734044e2d0..9546ce198e 100644
--- a/graphics/asymptote/shaders.h
+++ b/graphics/asymptote/shaders.h
@@ -2,19 +2,7 @@
#define __TOGL_SHADERSPROC
#define GLEW_NO_GLU
-
-#ifdef __MSDOS__
-#define GLEW_STATIC
-#define _WIN32
-#endif
-
-#include "GL/glew.h"
-
-#ifdef __MSDOS__
-#undef _WIN32
-#include <GL/wglew.h>
-#include <GL/wglext.h>
-#endif
+#include <GL/glew.h>
#include <string>
diff --git a/graphics/asymptote/stack.cc b/graphics/asymptote/stack.cc
index 4bb1a7b548..719dd5bfcb 100644
--- a/graphics/asymptote/stack.cc
+++ b/graphics/asymptote/stack.cc
@@ -14,7 +14,7 @@
#include "errormsg.h"
#include "util.h"
#include "runtime.h"
-#include "process.h"
+#include "asyprocess.h"
#include "profiler.h"
@@ -159,10 +159,10 @@ void stack::marshall(size_t args, stack::vars_t vars)
#ifdef PROFILE
#ifndef DEBUG_FRAME
-#warning "profiler needs DEBUG_FRAME for function names"
+#pragma message("WARNING: profiler needs DEBUG_FRAME for function names")
#endif
#ifndef DEBUG_BLTIN
-#warning "profiler needs DEBUG_BLTIN for builtin function names"
+#pragma message("WARNING: profiler needs DEBUG_BLTIN for builtin function names")
#endif
profiler prof;
diff --git a/graphics/asymptote/template_rev.cc.in b/graphics/asymptote/template_rev.cc.in
new file mode 100644
index 0000000000..2f46560480
--- /dev/null
+++ b/graphics/asymptote/template_rev.cc.in
@@ -0,0 +1,4 @@
+// This file is automatically generated; do not modify manually
+
+char const* REVISION="${ASY_VERSION}";
+char const* AsyGLVersion="${ASY_GL_VERSION}";
diff --git a/graphics/asymptote/texfile.h b/graphics/asymptote/texfile.h
index 7387349c4c..db237424bc 100644
--- a/graphics/asymptote/texfile.h
+++ b/graphics/asymptote/texfile.h
@@ -22,7 +22,7 @@
#include "array.h"
#include "psfile.h"
#include "settings.h"
-#include "process.h"
+#include "asyprocess.h"
namespace camp {
@@ -57,18 +57,21 @@ void latexfontencoding(T& out)
<< "\\makeatother%" << newl;
}
+std::unordered_set const latexCharacters = {'#', '$', '%', '&', '\\', '^', '_', '{', '}', '~'};
+
template<class T>
void texpreamble(T& out, mem::list<string>& preamble=processData().TeXpreamble,
bool pipe=false, bool ASYbox=true)
{
texuserpreamble(out,preamble,pipe);
string texengine=settings::getSetting<string>("tex");
+ string outPath=stripFile(settings::outname());
if(settings::context(texengine))
out << "\\disabledirectives[system.errorcontext]%" << newl;
if(ASYbox)
out << "\\newbox\\ASYbox" << newl
<< "\\newdimen\\ASYdimen" << newl;
- out << "\\def\\ASYprefix{" << stripFile(settings::outname()) << "}" << newl
+ out << "\\def\\ASYprefix{" << escapeCharacters(outPath, latexCharacters) << "}" << newl
<< "\\long\\def\\ASYbase#1#2{\\leavevmode\\setbox\\ASYbox=\\hbox{#1}%"
<< "\\ASYdimen=\\ht\\ASYbox%" << newl
<< "\\setbox\\ASYbox=\\hbox{#2}\\lower\\ASYdimen\\box\\ASYbox}" << newl;
diff --git a/graphics/asymptote/thirdparty_impl/tinyexr_impl/CMakeLists.txt b/graphics/asymptote/thirdparty_impl/tinyexr_impl/CMakeLists.txt
new file mode 100644
index 0000000000..c20d846392
--- /dev/null
+++ b/graphics/asymptote/thirdparty_impl/tinyexr_impl/CMakeLists.txt
@@ -0,0 +1,28 @@
+# Implementation library for tinyexr
+
+cmake_minimum_required(VERSION 3.26)
+project(tinyexr-impl)
+
+# fetch content
+include(FetchContent)
+FetchContent_Declare(
+ tinyexr
+ GIT_REPOSITORY https://github.com/syoyo/tinyexr
+ GIT_TAG v1.0.7
+)
+FetchContent_Populate(tinyexr)
+
+add_library(tinyexr-impl src/tinyexr_impl.cc)
+target_include_directories(
+ tinyexr-impl PUBLIC ${tinyexr_SOURCE_DIR}
+)
+
+# zlib
+find_package(ZLIB REQUIRED)
+if (ZLIB_FOUND)
+ target_compile_definitions(tinyexr-impl PRIVATE HAVE_ZLIB)
+else()
+ message(WARNING "zlib not found; will use miniz")
+endif()
+
+target_link_libraries(tinyexr-impl PRIVATE ZLIB::ZLIB)
diff --git a/graphics/asymptote/thirdparty_impl/tinyexr_impl/src/tinyexr_impl.cc b/graphics/asymptote/thirdparty_impl/tinyexr_impl/src/tinyexr_impl.cc
new file mode 100644
index 0000000000..3a07954036
--- /dev/null
+++ b/graphics/asymptote/thirdparty_impl/tinyexr_impl/src/tinyexr_impl.cc
@@ -0,0 +1,21 @@
+/**
+ * @file tinyexr_impl.cc
+ * @brief Implementation file for tinyexr
+ */
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+// zlib
+#if defined(HAVE_ZLIB)
+#define TINYEXR_USE_MINIZ 0
+#include <zlib.h>
+#else
+#define TINYEXR_USE_MINIZ 1
+#endif
+
+#define TINYEXR_USE_THREAD 1
+
+#define TINYEXR_IMPLEMENTATION
+#include <tinyexr.h>
diff --git a/graphics/asymptote/tinyexr.cc b/graphics/asymptote/tinyexr.cc
deleted file mode 100644
index 4a50c9d0f2..0000000000
--- a/graphics/asymptote/tinyexr.cc
+++ /dev/null
@@ -1,34 +0,0 @@
-/**
-* @file tinyexr.cc
-* @brief An implementation object file for tinyexr mandated by the repository.
-*
-* On Windows, use vcpkg to install zlib instead of nuget. On Linux, this should work naturally
-*/
-
-#include <zlib.h>
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#define TINYEXR_IMPLEMENTATION
-#define TINYEXR_USE_MINIZ 0
-
-#ifdef HAVE_PTHREAD
-#define TINYEXR_USE_THREAD 1
-#else
-#define TINYEXR_USE_THREAD 0
-#endif
-
-#ifndef HAVE_STRNLEN
-#include <cstring>
-#include <iostream>
-
-inline size_t strnlen(const char *s, size_t maxlen)
-{
- const char *p=(const char *) memchr(s,0,maxlen);
- return p ? p-s : maxlen;
-}
-#endif
-
-#include "cudareflect/tinyexr/tinyexr.h"
diff --git a/graphics/asymptote/tr.h b/graphics/asymptote/tr.h
index d1c7dfb04e..1e3ed0ac4e 100644
--- a/graphics/asymptote/tr.h
+++ b/graphics/asymptote/tr.h
@@ -78,12 +78,8 @@
#include <OpenGL/gl.h>
#else
-#ifdef __MSDOS__
-#include </usr/include/w32api/GL/gl.h>
-#else
#include <GL/gl.h>
#endif
-#endif
#ifdef __cplusplus
diff --git a/graphics/asymptote/types.cc b/graphics/asymptote/types.cc
index ecbb409cdf..8c46091c1d 100644
--- a/graphics/asymptote/types.cc
+++ b/graphics/asymptote/types.cc
@@ -18,7 +18,7 @@
#include "runtriple.h"
#include "access.h"
#include "virtualfieldaccess.h"
-#include "process.h"
+#include "asyprocess.h"
namespace run {
void arrayDeleteHelper(vm::stack *Stack);
@@ -31,6 +31,8 @@ void arrayDeleteHelper(vm::stack *Stack);
namespace types {
+const signature::OPEN_t signature::OPEN;
+
/* Base types */
#define PRIMITIVE(name,Name,asyName) \
primitiveTy p##Name(ty_##name); \
diff --git a/graphics/asymptote/types.h b/graphics/asymptote/types.h
index 36d44d0009..a5fff69593 100644
--- a/graphics/asymptote/types.h
+++ b/graphics/asymptote/types.h
@@ -345,7 +345,9 @@ struct signature : public gc {
: numKeywordOnly(0), rest(0), isOpen(false)
{}
- static const struct OPEN_t {} OPEN;
+ struct OPEN_t {};
+
+ static const OPEN_t OPEN;
explicit signature(OPEN_t) : numKeywordOnly(0), rest(0), isOpen(true) {}
diff --git a/graphics/asymptote/util.cc b/graphics/asymptote/util.cc
index 8cc0a76aee..bfabacdebd 100644
--- a/graphics/asymptote/util.cc
+++ b/graphics/asymptote/util.cc
@@ -15,15 +15,29 @@
#include <cfloat>
#include <sstream>
#include <cerrno>
-#include <sys/wait.h>
-#include <sys/param.h>
+#include <cstdlib>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
-#include <unistd.h>
#include <cstring>
#include <algorithm>
+
+
+#if !defined(_WIN32)
+#include <sys/wait.h>
+#include <sys/param.h>
+#include <unistd.h>
#include <dirent.h>
+#else
+#include <Windows.h>
+#include <Shlwapi.h>
+#include <Shellapi.h>
+#include <direct.h>
+#include "win32helpers.h"
+
+#define getcwd _getcwd
+#define chdir _chdir
+#endif
#include "util.h"
#include "settings.h"
@@ -66,6 +80,106 @@ string demangle(const char* s)
}
#endif
+// windows specific unnamed spaces
+#if defined(_WIN32)
+namespace w32 = camp::w32;
+
+namespace
+{
+/** @brief System, but for Windows.
+ * Any handle placed in outHandle must be properly closed */
+int SystemWin32(const mem::vector<string>& command, int quiet, bool wait,
+ const char* hint, const char* application, int* ppid);
+}
+
+namespace
+{
+int SystemWin32(const mem::vector<string>& command, int quiet, bool wait,
+ const char* hint, const char* application, int* ppid)
+{
+ cout.flush();
+ if (command.empty())
+ {
+ camp::reportError("Command cannot be empty");
+ return -1;
+ }
+ string cmdlineStr=camp::w32::buildWindowsCmd(command);
+
+ STARTUPINFOA startInfo={};
+ startInfo.cb=sizeof(startInfo);
+ startInfo.dwFlags=STARTF_USESTDHANDLES;
+
+ SECURITY_ATTRIBUTES sa;
+ sa.nLength= sizeof(sa);
+ sa.lpSecurityDescriptor=nullptr;
+ sa.bInheritHandle=true;
+
+ PROCESS_INFORMATION procInfo= {};
+
+ // windows' "/dev/null" file (a.k.a. "NUL")
+ {
+ w32::HandleRaiiWrapper const nulFileHandle=CreateFileA(
+ "NUL", GENERIC_WRITE, FILE_SHARE_WRITE | FILE_SHARE_READ,
+ &sa,
+ CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ nullptr);
+
+ // set quiet info
+ startInfo.hStdInput= GetStdHandle(STD_INPUT_HANDLE);
+ startInfo.hStdOutput= quiet >= 1 ? nulFileHandle.getHandle() : GetStdHandle(STD_OUTPUT_HANDLE);
+ startInfo.hStdError= quiet >= 2 ? nulFileHandle.getHandle() : GetStdHandle(STD_ERROR_HANDLE);
+
+ ostringstream errorMessage;
+ errorMessage << "Cannot open " << application << "\n";
+ string const errorMessageOut=errorMessage.str();
+ w32::checkResult(CreateProcessA(
+ nullptr,
+ cmdlineStr.data(),
+ nullptr, nullptr, true,
+ 0,
+ nullptr, nullptr,
+ &startInfo,
+ &procInfo),
+ errorMessageOut.c_str());
+ }
+ if (ppid)
+ {
+ *ppid=static_cast<int>(procInfo.dwProcessId);
+ }
+
+ w32::HandleRaiiWrapper const procHandle(procInfo.hProcess);
+ w32::HandleRaiiWrapper const threadHandle(procInfo.hThread);
+
+
+ if (!wait)
+ {
+ return 0;
+ }
+
+ DWORD retcode=-1;
+ // else, wait
+ switch (WaitForSingleObject(procHandle.getHandle(), INFINITE))
+ {
+ case WAIT_OBJECT_0: {
+ w32::checkResult(GetExitCodeProcess(
+ procHandle.getHandle(), &retcode
+ ),"Cannot get exit code of process");
+ break;
+ }
+ case WAIT_ABANDONED:// also impossible, we are waiting for a process
+ case WAIT_TIMEOUT: // impossible, since we set timeout to infinite
+ case WAIT_FAILED:
+ default:
+ camp::reportError("Waiting for process failed");
+ break;
+ }
+ return static_cast<int>(retcode);
+}
+}
+
+#endif
+
char *Strdup(string s)
{
size_t size=s.size()+1;
@@ -92,32 +206,32 @@ char *StrdupMalloc(string s)
string stripDir(string name)
{
- size_t p;
-#ifdef __MSDOS__
- p=name.rfind('\\');
- if(p < string::npos) name.erase(0,p+1);
+#if defined(_WIN32)
+ char constexpr separator= '\\';
+ std::replace(name.begin(), name.end(), '/', separator);
+#else
+ char constexpr separator= '/';
#endif
- p=name.rfind('/');
+
+ size_t p=name.rfind(separator);
if(p < string::npos) name.erase(0,p+1);
return name;
}
string stripFile(string name)
{
- size_t p;
- bool dir=false;
-#ifdef __MSDOS__
- p=name.rfind('\\');
- if(p < string::npos) {
- dir=true;
- while(p > 0 && name[p-1] == '\\') --p;
- name.erase(p+1);
- }
+#if defined(_WIN32)
+ char constexpr separator = '\\';
+ std::replace(name.begin(), name.end(), '/', separator);
+#else
+ char constexpr separator= '/';
#endif
- p=name.rfind('/');
+
+ bool dir=false;
+ size_t p=name.rfind(separator);
if(p < string::npos) {
dir=true;
- while(p > 0 && name[p-1] == '/') --p;
+ while(p > 0 && name[p-1] == separator) --p;
name.erase(p+1);
}
@@ -148,13 +262,49 @@ void spaceToUnderscore(string& s)
s[p]='_';
}
+string escapeCharacters(string const& inText, std::unordered_set<char> const& charactersToEscape)
+{
+ mem::vector<char> retBuffer;
+ retBuffer.reserve(inText.length() + 1);
+
+ for (const char textChar : inText)
+ {
+ if (charactersToEscape.find(textChar) != charactersToEscape.end())
+ {
+ retBuffer.emplace_back('\\');
+ }
+ retBuffer.emplace_back(textChar);
+ }
+ retBuffer.emplace_back(0);
+
+ return retBuffer.data();
+}
+
string Getenv(const char *name, bool msdos)
{
+#if defined(_WIN32)
+ size_t envSize=0;
+ getenv_s(&envSize,nullptr,0,name);
+ if (envSize == 0)
+ {
+ return "";
+ }
+
+ mem::vector<char> resultingData(envSize);
+ if (getenv_s(&envSize, resultingData.data(), resultingData.size(), name) != 0)
+ {
+ camp::reportError("Cannot retrieve environment variable");
+ }
+
+ return resultingData.data();
+
+#else
char *s=getenv(name);
if(!s) return "";
string S=string(s);
if(msdos) backslashToSlash(S);
return S;
+#endif
}
void readDisabled()
@@ -209,12 +359,16 @@ string auxname(string filename, string suffix)
sighandler_t Signal(int signum, sighandler_t handler)
{
+#if !defined(_WIN32)
struct sigaction action,oldaction;
action.sa_handler=handler;
sigemptyset(&action.sa_mask);
action.sa_flags=0;
return sigaction(signum,&action,&oldaction) == 0 ? oldaction.sa_handler :
SIG_ERR;
+#else
+ return signal(signum, handler);
+#endif
}
void push_split(mem::vector<string>& a, const string& S)
@@ -278,6 +432,9 @@ void execError(const char *command, const char *hint, const char *application)
int System(const mem::vector<string> &command, int quiet, bool wait,
const char *hint, const char *application, int *ppid)
{
+#if _WIN32
+ return SystemWin32(command, quiet, wait, hint, application, ppid);
+#else
int status;
cout.flush(); // Flush stdout to avoid duplicate output.
@@ -288,10 +445,6 @@ int System(const mem::vector<string> &command, int quiet, bool wait,
if(pid == -1)
camp::reportError("Cannot fork process");
-#ifdef __MSDOS__
- wait=true;
-#endif
-
if(pid == 0) {
if(interact::interactive) signal(SIGINT,SIG_IGN);
if(quiet) {
@@ -343,6 +496,7 @@ int System(const mem::vector<string> &command, int quiet, bool wait,
}
}
}
+#endif
}
string stripblanklines(const string& s)
@@ -415,6 +569,38 @@ void push_command(mem::vector<string>& a, const string& s)
}
void popupHelp() {
+#if defined(_WIN32)
+ auto const pdfviewer= getSetting<string>("pdfviewer");
+ string const docPath= docdir + dirsep + "asymptote.pdf";
+ if (!pdfviewer.empty())
+ {
+ mem::vector<string> cmd;
+ push_command(cmd, pdfviewer);
+
+ if (auto const viewerOpts= getSetting<string>("pdfviewerOptions"); !viewerOpts.empty())
+ {
+ istringstream viewerOptStream(viewerOpts);
+ string tmp;
+ while (viewerOptStream >> tmp)
+ {
+ if (!tmp.empty())
+ {
+ cmd.push_back(tmp);
+ }
+ }
+ }
+ cmd.push_back(docPath);
+ System(cmd, 0, false, "pdfviewer", "your PDF viewer");
+ }
+ else
+ {
+ // pdf viewer not given, let windows decide which program to use
+ camp::w32::checkShellExecuteResult(
+ reinterpret_cast<INT_PTR>(ShellExecuteA(nullptr, "open", docPath.c_str(), nullptr, nullptr, SW_SHOWNORMAL)),
+ false
+ );
+ }
+#else
// If the popped-up help is already running, pid stores the pid of the viewer.
static int pid=0;
@@ -432,6 +618,7 @@ void popupHelp() {
cmd.push_back(docdir+dirsep+"asymptote.pdf");
status=System(cmd,0,false,"pdfviewer","your PDF viewer",&pid);
}
+#endif
}
const char *intrange="integer argument is outside valid range";
@@ -464,3 +651,12 @@ Int Intcast(unsignedInt n)
vm::error(intrange);
return (Int) n;
}
+
+bool fileExists(string const& path)
+{
+#if defined(_WIN32)
+ return PathFileExistsA(path.c_str());
+#else
+ return access(path.c_str(), R_OK) == 0;
+#endif
+}
diff --git a/graphics/asymptote/util.h b/graphics/asymptote/util.h
index 699cef521e..44eac86efd 100644
--- a/graphics/asymptote/util.h
+++ b/graphics/asymptote/util.h
@@ -21,8 +21,15 @@ extern "C" int sigaction(int signum, const struct sigaction *act, struct sigacti
#include <csignal>
#include "common.h"
+#include <unordered_set>
+#if !defined(_MSC_VER)
#include <strings.h>
+#else
+#include <cstring>
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#endif
// Demangle a typeid name (if the proper library is installed.
string demangle(const char *s);
@@ -41,6 +48,9 @@ string stripFile(string name);
// Strip the extension from a filename.
string stripExt(string name, const string& suffix="");
+// Escapes characters specified in set
+string escapeCharacters(string const& inText, std::unordered_set<char> const& charactersToEscape);
+
void readDisabled();
void writeDisabled();
@@ -163,4 +173,6 @@ unsignedInt unsignedIntcast(Int n);
int intcast(Int n);
Int Intcast(unsignedInt n);
+bool fileExists(string const& path);
+
#endif
diff --git a/graphics/asymptote/v3dfile.cc b/graphics/asymptote/v3dfile.cc
index f9a66e84e6..73ac829aeb 100644
--- a/graphics/asymptote/v3dfile.cc
+++ b/graphics/asymptote/v3dfile.cc
@@ -316,9 +316,12 @@ void gzv3dfile::close()
{
if(!destroyed) {
finalize();
+
+ std::vector<uint8_t> const resultingData = memxdrfile.createCopyOfCurrentData();
+
memxdrfile.close();
gzFile file=gzopen(name.c_str(), "wb9");
- gzwrite(file,data(),length());
+ gzwrite(file, resultingData.data(), resultingData.size());
gzclose(file);
if(settings::verbose > 0)
cout << "Wrote " << name << endl;
@@ -326,16 +329,6 @@ void gzv3dfile::close()
}
}
-char const* gzv3dfile::data() const
-{
- return memxdrfile.stream();
-}
-
-size_t const& gzv3dfile::length() const
-{
- return memxdrfile.getLength();
-}
-
uint32_t LightHeader::getWordSize(bool singleprecision) const
{
return (singleprecision ? 1 : 2)*3+3;
diff --git a/graphics/asymptote/v3dfile.h b/graphics/asymptote/v3dfile.h
index 0c296919b8..8b145c6fef 100644
--- a/graphics/asymptote/v3dfile.h
+++ b/graphics/asymptote/v3dfile.h
@@ -159,12 +159,6 @@ public:
protected:
xdr::oxstream& getXDRFile() override;
- [[nodiscard]]
- char const* data() const;
-
- [[nodiscard]]
- size_t const& length() const;
-
private:
xdr::memoxstream memxdrfile;
string name;
diff --git a/graphics/asymptote/v3dheadertypes.h b/graphics/asymptote/v3dheadertypes.h
index 79b5bfb025..b5e0c42e22 100644
--- a/graphics/asymptote/v3dheadertypes.h
+++ b/graphics/asymptote/v3dheadertypes.h
@@ -1,67 +1,65 @@
// Enum class for v3dheadertypes
// AUTO-GENERATED from v3dheadertypes.csv
-// Generated at 2024-10-07 18:22:49+00:00
-
namespace camp
{
enum v3dheadertypes : uint32_t
{
-canvasWidth=1,
// UINT Canvas width
+canvasWidth=1,
-canvasHeight=2,
// UINT Canvas heighot
+canvasHeight=2,
-absolute=3,
// BOOL true: absolute size; false: scale to canvas
+absolute=3,
-minBound=4,
// TRIPLE Scene minimum bounding box corners
+minBound=4,
-maxBound=5,
// TRIPLE Scene maximum bounding box corners
+maxBound=5,
-orthographic=6,
// BOOL true: orthographic; false: perspective
+orthographic=6,
-angleOfView=7,
// REAL Field of view angle (in radians)
+angleOfView=7,
-initialZoom=8,
// REAL Initial zoom
+initialZoom=8,
-viewportShift=9,
// PAIR Viewport shift (for perspective projection)
+viewportShift=9,
-viewportMargin=10,
// PAIR Margin around viewport
+viewportMargin=10,
-light=11,
// RGB Direction and color of each point light source
+light=11,
-background=12,
// RGBA Background color
+background=12,
-zoomFactor=13,
// REAL Zoom base factor
+zoomFactor=13,
-zoomPinchFactor=14,
// REAL Zoom pinch factor
+zoomPinchFactor=14,
-zoomPinchCap=15,
// REAL Zoom pinch limit
+zoomPinchCap=15,
-zoomStep=16,
// REAL Zoom power step
+zoomStep=16,
-shiftHoldDistance=17,
// REAL Shift-mode maximum hold distance (pixels)
+shiftHoldDistance=17,
-shiftWaitTime=18,
// REAL Shift-mode hold time (milliseconds)
+shiftWaitTime=18,
-vibrateTime=19,
// REAL Shift-mode vibrate time (milliseconds)
+vibrateTime=19,
};
diff --git a/graphics/asymptote/v3dheadertypes.py b/graphics/asymptote/v3dheadertypes.py
deleted file mode 100644
index 809c71e009..0000000000
--- a/graphics/asymptote/v3dheadertypes.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python3
-# Enum class for v3dheadertypes
-""" AUTO-GENERATED from v3dheadertypes.csv """
-# Generated at 2024-10-07 18:23:17+00:00
-
-class v3dheadertypes:
- v3dheadertypes_canvasWidth=1
- # UINT Canvas width
-
- v3dheadertypes_canvasHeight=2
- # UINT Canvas heighot
-
- v3dheadertypes_absolute=3
- # BOOL true: absolute size; false: scale to canvas
-
- v3dheadertypes_minBound=4
- # TRIPLE Scene minimum bounding box corners
-
- v3dheadertypes_maxBound=5
- # TRIPLE Scene maximum bounding box corners
-
- v3dheadertypes_orthographic=6
- # BOOL true: orthographic; false: perspective
-
- v3dheadertypes_angleOfView=7
- # REAL Field of view angle (in radians)
-
- v3dheadertypes_initialZoom=8
- # REAL Initial zoom
-
- v3dheadertypes_viewportShift=9
- # PAIR Viewport shift (for perspective projection)
-
- v3dheadertypes_viewportMargin=10
- # PAIR Margin around viewport
-
- v3dheadertypes_light=11
- # RGB Direction and color of each point light source
-
- v3dheadertypes_background=12
- # RGBA Background color
-
- v3dheadertypes_zoomFactor=13
- # REAL Zoom base factor
-
- v3dheadertypes_zoomPinchFactor=14
- # REAL Zoom pinch factor
-
- v3dheadertypes_zoomPinchCap=15
- # REAL Zoom pinch limit
-
- v3dheadertypes_zoomStep=16
- # REAL Zoom power step
-
- v3dheadertypes_shiftHoldDistance=17
- # REAL Shift-mode maximum hold distance (pixels)
-
- v3dheadertypes_shiftWaitTime=18
- # REAL Shift-mode hold time (milliseconds)
-
- v3dheadertypes_vibrateTime=19
- # REAL Shift-mode vibrate time (milliseconds)
-
-# End of File
diff --git a/graphics/asymptote/v3dtypes.h b/graphics/asymptote/v3dtypes.h
index 9bfc257951..e8e50cadc7 100644
--- a/graphics/asymptote/v3dtypes.h
+++ b/graphics/asymptote/v3dtypes.h
@@ -1,36 +1,59 @@
// Enum class for v3dtypes
// AUTO-GENERATED from v3dtypes.csv
-// Generated at 2024-10-07 18:22:50+00:00
-
namespace camp
{
enum v3dtypes : uint32_t
{
material=1,
+
transform=2,
+
element=3,
+
centers=4,
+
header=5,
+
line=64,
+
triangle=65,
+
quad=66,
+
curve=128,
+
bezierTriangle=129,
+
bezierPatch=130,
+
lineColor=192,
+
triangleColor=193,
+
quadColor=194,
+
curveColor=256,
+
bezierTriangleColor=257,
+
bezierPatchColor=258,
+
triangles=512,
+
disk=1024,
+
cylinder=1025,
+
tube=1026,
+
sphere=1027,
+
halfSphere=1028,
+
animation=2048,
+
pixel=4096,
+
};
} // namespace camp
diff --git a/graphics/asymptote/v3dtypes.py b/graphics/asymptote/v3dtypes.py
deleted file mode 100644
index fbe3332304..0000000000
--- a/graphics/asymptote/v3dtypes.py
+++ /dev/null
@@ -1,32 +0,0 @@
-#!/usr/bin/env python3
-# Enum class for v3dtypes
-""" AUTO-GENERATED from v3dtypes.csv """
-# Generated at 2024-10-07 18:23:17+00:00
-
-class v3dtypes:
- v3dtypes_material=1
- v3dtypes_transform=2
- v3dtypes_element=3
- v3dtypes_centers=4
- v3dtypes_header=5
- v3dtypes_line=64
- v3dtypes_triangle=65
- v3dtypes_quad=66
- v3dtypes_curve=128
- v3dtypes_bezierTriangle=129
- v3dtypes_bezierPatch=130
- v3dtypes_lineColor=192
- v3dtypes_triangleColor=193
- v3dtypes_quadColor=194
- v3dtypes_curveColor=256
- v3dtypes_bezierTriangleColor=257
- v3dtypes_bezierPatchColor=258
- v3dtypes_triangles=512
- v3dtypes_disk=1024
- v3dtypes_cylinder=1025
- v3dtypes_tube=1026
- v3dtypes_sphere=1027
- v3dtypes_halfSphere=1028
- v3dtypes_animation=2048
- v3dtypes_pixel=4096
-# End of File
diff --git a/graphics/asymptote/vcpkg.json b/graphics/asymptote/vcpkg.json
new file mode 100644
index 0000000000..d295b74f13
--- /dev/null
+++ b/graphics/asymptote/vcpkg.json
@@ -0,0 +1,78 @@
+{
+ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json",
+
+ "builtin-baseline": "76d153790caf0592fce8fc4484aa6db18c7d00d4",
+ "name": "asymptote",
+ "version": "0.0-snapshot",
+ "dependencies": [
+ "zlib",
+ "glm",
+ {
+ "name": "getopt-win32",
+ "platform": "windows"
+ }
+ ],
+ "features": {
+ "threading": {
+ "description": "Enable threading support",
+ "dependencies": ["pthreads"]
+ },
+ "readline": {
+ "description": "Enable readline support",
+ "dependencies": [
+ "readline",
+ {
+ "name": "ncurses",
+ "platform": "!windows"
+ },
+ {
+ "name": "pdcurses",
+ "platform": "windows"
+ }
+ ]
+ },
+ "gc": {
+ "description": "Enable garbage collection support",
+ "dependencies": ["bdwgc"]
+ },
+ "curl": {
+ "description": "Enable curl support",
+ "dependencies": ["curl"]
+ },
+ "eigen3": {
+ "description": "eigen3 support",
+ "dependencies": ["eigen3"]
+ },
+ "gsl": {
+ "description": "GSL support",
+ "dependencies": ["gsl"]
+ },
+ "fftw3": {
+ "description": "fftw3 support",
+ "dependencies": ["fftw3"]
+ },
+ "opengl": {
+ "description": "OpenGL Support",
+ "dependencies": [
+ "opengl",
+ "freeglut"
+ ]
+ },
+ "lsp": {
+ "description": "Language Server Protocol Support",
+ "dependencies": [
+ "rapidjson",
+ "boost-asio",
+ "boost-beast",
+ "boost-date-time",
+ "boost-chrono",
+ "boost-filesystem",
+ "boost-system",
+ "boost-uuid",
+ "boost-thread",
+ "boost-process",
+ "boost-program-options"
+ ]
+ }
+ }
+}
diff --git a/graphics/asymptote/version.texi.in b/graphics/asymptote/version.texi.in
new file mode 100644
index 0000000000..02d9702388
--- /dev/null
+++ b/graphics/asymptote/version.texi.in
@@ -0,0 +1,3 @@
+@set VERSION ${ASY_VERSION}
+@set Datadir asy-datadir
+@set Docdir asy-docdir
diff --git a/graphics/asymptote/versionTemplate.asy.in b/graphics/asymptote/versionTemplate.asy.in
new file mode 100644
index 0000000000..a9cc2fc568
--- /dev/null
+++ b/graphics/asymptote/versionTemplate.asy.in
@@ -0,0 +1,3 @@
+// This file is automatically generated. Do not modify manually
+
+string VERSION="${ASY_VERSION}";
diff --git a/graphics/asymptote/win32helpers.cc b/graphics/asymptote/win32helpers.cc
new file mode 100644
index 0000000000..c8a5cfe65e
--- /dev/null
+++ b/graphics/asymptote/win32helpers.cc
@@ -0,0 +1,240 @@
+/**
+ * @file win32helpers.cc
+ * @brief Windows-specific utility functions
+ * @author Supakorn "Jamie" Rassameemasmuang (jamievlin [at] outlook.com)
+ */
+
+#if defined(_WIN32)
+#include "win32helpers.h"
+#include "errormsg.h"
+#include <shellapi.h>
+
+using camp::reportError;
+
+namespace camp::w32
+{
+
+bool checkShellExecuteResult(INT_PTR const shellExecResult, bool const reportWarning)
+{
+ switch (shellExecResult)
+ {
+ // see https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea
+ // ERROR_FILE_NOT_FOUND and ERROR_PATH_NOT_FOUND shares the same error code as
+ // SE_ERR_FNF and SE_ERR_PNF, respectively
+ case 0:
+ case ERROR_BAD_FORMAT:
+ case SE_ERR_ACCESSDENIED:
+ case SE_ERR_ASSOCINCOMPLETE:
+ case SE_ERR_DDEBUSY:
+ case SE_ERR_DDEFAIL:
+ case SE_ERR_DDETIMEOUT:
+ case SE_ERR_DLLNOTFOUND:
+ case SE_ERR_FNF:
+ case SE_ERR_NOASSOC:
+ case SE_ERR_OOM:
+ case SE_ERR_PNF:
+ case SE_ERR_SHARE:
+ {
+ if (reportWarning)
+ {
+ DWORD const errorCode= GetLastError();
+ ostringstream msg;
+ msg << "Error code: 0x" << std::hex << errorCode << std::dec << "; message: " << getErrorMessage(errorCode);
+ camp::reportWarning(msg.str());
+ }
+ }
+ return false;
+ default:
+ return true;
+ }
+}
+
+void reportAndFailWithLastError(string const& message)
+{
+ DWORD errorCode= GetLastError();
+ ostringstream msg;
+ msg << message << "; error code = 0x" << std::hex << errorCode << std::dec
+ << "; Windows Message: " << getErrorMessage(errorCode);
+ reportError(msg);
+}
+
+void checkResult(BOOL result, string const& message)
+{
+ if (!result)
+ {
+ reportAndFailWithLastError(message);
+ }
+}
+
+void checkLStatus(LSTATUS result, string const& message)
+{
+ checkResult(result == ERROR_SUCCESS, message);
+}
+
+bool isProcessRunning(DWORD const& pid)
+{
+ if (pid == 0)
+ {
+ return true; // system idle is always running
+ }
+
+ HandleRaiiWrapper const processHandle(OpenProcess(PROCESS_QUERY_INFORMATION, false, pid));
+ if (processHandle.getHandle() == nullptr)
+ {
+ // handle not in system, returns false
+ return false;
+ }
+
+ DWORD exitCode=999;
+ if (GetExitCodeProcess(processHandle.getHandle(), &exitCode))
+ {
+ if (exitCode == STILL_ACTIVE)
+ {
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+ }
+
+ return false;
+}
+
+#pragma region RegKeyWrapper
+
+RegKeyWrapper::RegKeyWrapper(HKEY const& regKey)
+ : key(regKey)
+{
+}
+RegKeyWrapper::RegKeyWrapper() : key(nullptr)
+{
+}
+RegKeyWrapper::~RegKeyWrapper()
+{
+ closeExistingKey();
+}
+RegKeyWrapper::RegKeyWrapper(RegKeyWrapper&& other) noexcept
+ : key(std::exchange(other.key, nullptr))
+{
+}
+
+RegKeyWrapper& RegKeyWrapper::operator=(RegKeyWrapper&& other) noexcept
+{
+ if (this != &other)
+ {
+ closeExistingKey();
+ this->key = std::exchange(other.key, nullptr);
+ }
+ return *this;
+}
+
+HKEY RegKeyWrapper::getKey() const
+{
+ return key;
+}
+
+void RegKeyWrapper::closeExistingKey()
+{
+ if (this->key != nullptr)
+ {
+ RegCloseKey(this->key);
+ this->key = nullptr;
+ }
+}
+
+PHKEY RegKeyWrapper::put()
+{
+ closeExistingKey();
+ return &(this->key);
+}
+void RegKeyWrapper::release()
+{
+ this->key = nullptr;
+}
+
+#pragma endregion
+
+#pragma region HandleRaiiWrapper
+
+HandleRaiiWrapper::HandleRaiiWrapper(HANDLE const& handle)
+ : hd(handle)
+{
+}
+
+HandleRaiiWrapper::~HandleRaiiWrapper()
+{
+ if (hd)
+ {
+ if (!CloseHandle(hd))
+ {
+ cerr << "Warning: Cannot close handle" << endl;
+ }
+ }
+}
+
+HandleRaiiWrapper::HandleRaiiWrapper(HandleRaiiWrapper&& other) noexcept
+: hd(std::exchange(other.hd, nullptr))
+{
+}
+
+HANDLE HandleRaiiWrapper::getHandle() const
+{
+ return hd;
+}
+
+LPHANDLE HandleRaiiWrapper::put()
+{
+ if (hd)
+ {
+ w32::checkResult(CloseHandle(hd));
+ hd = nullptr;
+ }
+
+ return &hd;
+}
+
+#pragma endregion
+
+string buildWindowsCmd(const mem::vector<string>& command)
+{
+ ostringstream out;
+ for (auto it= command.begin(); it != command.end(); ++it)
+ {
+ out << '"' << *it << '"';
+ if (std::next(it) != command.end())
+ {
+ out << ' ';
+ }
+ }
+
+ return out.str();
+}
+
+string getErrorMessage(DWORD const& errorCode)
+{
+ LPSTR messageOut= nullptr;
+ auto ret = FormatMessageA(
+ FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+ nullptr,
+ errorCode,
+ MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
+ reinterpret_cast<LPSTR>(&messageOut),
+ 0,
+ nullptr
+ );
+
+ if (ret == 0)
+ {
+ return "Cannot determine error message";
+ }
+
+ string retString(messageOut);
+ LocalFree(messageOut);
+
+ return retString;
+}
+
+}// namespace camp::w32
+
+#endif
diff --git a/graphics/asymptote/win32helpers.h b/graphics/asymptote/win32helpers.h
new file mode 100644
index 0000000000..266a65f3bd
--- /dev/null
+++ b/graphics/asymptote/win32helpers.h
@@ -0,0 +1,92 @@
+/**
+ * @file win32helpers.h
+ * @brief Windows-specific utility functions header
+ * @author Supakorn "Jamie" Rassameemasmuang (jamievlin [at] outlook.com)
+ */
+
+#pragma once
+
+#if defined(_WIN32)
+
+#include <Windows.h>
+#include "common.h"
+
+namespace camp::w32
+{
+
+/**
+ * Checks if result from ShellExecute/ShellExecuteEx indicates a successful execution or not.
+ * This function does not raise an error in itself, but can generate a warning if specified
+ */
+bool checkShellExecuteResult(INT_PTR shellExecResult, bool reportWarning=false);
+
+void checkResult(BOOL result, string const& message= "");
+void checkLStatus(LSTATUS result, string const& message="");
+
+string buildWindowsCmd(const mem::vector<string>& command);
+
+string getErrorMessage(DWORD const& errorCode);
+
+bool isProcessRunning(DWORD const& pid);
+
+/** Reports error with message from GetLastError and the user specified message */
+void reportAndFailWithLastError(string const& message);
+
+/**
+ * A simple wraper for <tt>HKEY</tt>
+ */
+class RegKeyWrapper
+{
+public:
+ RegKeyWrapper(HKEY const& regKey);
+ RegKeyWrapper();
+
+ ~RegKeyWrapper();
+ RegKeyWrapper(RegKeyWrapper const&) = delete;
+ RegKeyWrapper& operator=(RegKeyWrapper const&) = delete;
+
+ RegKeyWrapper(RegKeyWrapper&& other) noexcept;
+ RegKeyWrapper& operator=(RegKeyWrapper&& other) noexcept;
+
+ /**
+ * @return The registry key held by the wrapper
+ */
+ [[nodiscard]]
+ HKEY getKey() const;
+ PHKEY put();
+
+ void release();
+
+private:
+ void closeExistingKey();
+ HKEY key;
+};
+
+class HandleRaiiWrapper
+{
+public:
+ HandleRaiiWrapper() = default;
+ HandleRaiiWrapper(HANDLE const& handle);
+ ~HandleRaiiWrapper();
+
+ HandleRaiiWrapper(HandleRaiiWrapper const&) = delete;
+ HandleRaiiWrapper& operator=(HandleRaiiWrapper const&) = delete;
+
+ HandleRaiiWrapper(HandleRaiiWrapper&& other) noexcept;
+
+ // already hold a handle, should not consume another one
+ HandleRaiiWrapper& operator=(HandleRaiiWrapper&& other) = delete;
+
+ [[nodiscard]]
+ HANDLE getHandle() const;
+
+ LPHANDLE put();
+
+private:
+ HANDLE hd = nullptr;
+
+};
+
+} // namespace camp::w32
+
+#endif
diff --git a/graphics/asymptote/win32pipestream.cc b/graphics/asymptote/win32pipestream.cc
new file mode 100644
index 0000000000..ab8c0af7e9
--- /dev/null
+++ b/graphics/asymptote/win32pipestream.cc
@@ -0,0 +1,320 @@
+/**
+ * @file win32pipestream.cc
+ * @brief A reimplementation of pipestream for win32
+ * @author Supakorn "Jamie" Rassameemasmuang (jamievlin [at] outlook.com)
+ */
+#if defined(_WIN32)
+#include "win32pipestream.h"
+#include "win32helpers.h"
+#include "util.h"
+#include "errormsg.h"
+
+namespace w32
+{
+
+namespace cw32 = camp::w32;
+
+Win32IoPipeStream::~Win32IoPipeStream()
+{
+ // this is not the best idea, but this is what the
+ // original code looks like (pipestream.h)
+ pipeclose();
+}
+
+void Win32IoPipeStream::open(
+ mem::vector<string> const& command, char const* hint,
+ char const* application, int out_fileno)
+{
+ if (out_fileno != STDOUT_FILENO && out_fileno != STDERR_FILENO)
+ {
+ camp::reportError("out_fileno must be stdout or stdin");
+ }
+
+ // creating pipes
+ SECURITY_ATTRIBUTES pipeSecurityAttr = {};
+ pipeSecurityAttr.nLength = sizeof(SECURITY_ATTRIBUTES);
+ pipeSecurityAttr.bInheritHandle = true;
+ pipeSecurityAttr.lpSecurityDescriptor = nullptr;
+
+ {
+ cw32::HandleRaiiWrapper processStdinRd;
+ cw32::checkResult(CreatePipe(processStdinRd.put(), &processStdinWr, &pipeSecurityAttr, 0));
+
+ cw32::HandleRaiiWrapper processOutWr;
+ cw32::checkResult(CreatePipe(&processOutRd, processOutWr.put(), &pipeSecurityAttr, 0));
+
+ // building command
+ string cmd= camp::w32::buildWindowsCmd(command);
+
+ STARTUPINFOA startInfo= {};
+ startInfo.cb= sizeof(startInfo);
+ startInfo.dwFlags= STARTF_USESTDHANDLES;
+ startInfo.hStdInput= processStdinRd.getHandle();
+ startInfo.hStdOutput= out_fileno == STDOUT_FILENO ? processOutWr.getHandle() : GetStdHandle(STD_OUTPUT_HANDLE);
+ startInfo.hStdError= out_fileno == STDERR_FILENO ? processOutWr.getHandle() : GetStdHandle(STD_ERROR_HANDLE);
+
+ auto const result= CreateProcessA(
+ nullptr,
+ cmd.data(),
+ nullptr, nullptr, true,
+ 0,
+ nullptr, nullptr,
+ &startInfo,
+ &procInfo);
+ if (!result)
+ {
+ execError(command.at(0).c_str(), hint, application);
+ cw32::checkResult(result, "Cannot open application");
+ }
+ }
+
+ ZeroMemory(buffer, BUFFER_LEN);
+ Running=true;
+ pipeopen=true;
+ pipein=true;
+ block(false,true);
+}
+
+void Win32IoPipeStream::block(bool write, bool read)
+{
+ /*
+ * Side note: what the hell, microsoft?
+ *
+ * Why is setting mode for anonymous pipe also called
+ * "SetNamedPipeHandleState", why not "SetPipeHandleState"?
+ *
+ * (see https://learn.microsoft.com/en-us/windows/win32/api/namedpipeapi/nf-namedpipeapi-setnamedpipehandlestate?redirectedfrom=MSDN)
+ */
+
+ DWORD blockMode = PIPE_WAIT;
+ DWORD noBlockMode = PIPE_NOWAIT;
+
+ cw32::checkResult(SetNamedPipeHandleState(
+ processStdinWr,
+ write ? &blockMode : &noBlockMode,
+ nullptr, nullptr
+ ));
+
+ cw32::checkResult(SetNamedPipeHandleState(
+ processOutRd,
+ read ? &blockMode : &noBlockMode,
+ nullptr, nullptr
+ ));
+}
+
+void Win32IoPipeStream::eof()
+{
+ if(pipeopen && pipein) {
+ camp::w32::checkResult(CloseHandle(&processStdinWr));
+ pipein=false;
+ }
+}
+
+void Win32IoPipeStream::pipeclose()
+{
+ if(pipeopen) {
+ cw32::checkResult(CloseHandle(processOutRd));
+
+ if (procInfo.hProcess != nullptr)
+ {
+ if (!TerminateProcess(procInfo.hProcess, 0) && GetLastError() != ERROR_ACCESS_DENIED)
+ {
+ camp::reportError("cannot terminate process");
+ }
+ }
+ Running=false;
+ pipeopen=false;
+ wait();
+ }
+}
+
+bool Win32IoPipeStream::isopen() const
+{
+ return pipeopen;
+}
+
+Win32IoPipeStream::Win32IoPipeStream(
+ mem::vector<string> const& command, char const* hint, char const* application, int out_fileno)
+{
+ open(command, hint, application, out_fileno);
+}
+
+int Win32IoPipeStream::wait()
+{
+ DWORD retcode = 0;
+ if (procInfo.hProcess == nullptr)
+ {
+ return static_cast<int>(retcode);
+ }
+
+ switch(WaitForSingleObject(procInfo.hProcess, INFINITE))
+ {
+ case WAIT_OBJECT_0:
+ cw32::checkResult(GetExitCodeProcess(procInfo.hProcess, &retcode));
+ break;
+ default:
+ closeProcessHandles();
+ camp::reportError("Wait for process error");
+ break;
+ }
+
+ closeProcessHandles();
+ return static_cast<int>(retcode);
+}
+
+void Win32IoPipeStream::Write(string const& s)
+{
+ if (!pipeopen)
+ {
+ return;
+ }
+ if(settings::verbose > 2) cerr << s;
+
+ DWORD bytesWritten=0;
+
+ cw32::checkResult(WriteFile(
+ processStdinWr,
+ s.c_str(), s.length(),
+ &bytesWritten, nullptr
+ ));
+
+ if (static_cast<DWORD>(s.length()) != bytesWritten)
+ {
+ camp::reportFatal("write to pipe failed");
+ }
+
+}
+
+void Win32IoPipeStream::wait(char const* prompt)
+{
+ sbuffer.clear();
+ size_t plen=strlen(prompt);
+
+ do {
+ readbuffer();
+ if(*buffer == 0) camp::reportError(sbuffer);
+ sbuffer.append(buffer);
+
+ if(tailequals(sbuffer.c_str(),sbuffer.size(),prompt,plen)) break;
+ } while(true);
+}
+
+ssize_t Win32IoPipeStream::readbuffer()
+{
+ if (!(Running && pipeopen))
+ {
+ return 0;
+ }
+
+ DWORD nc;
+
+ if (!ReadFile(processOutRd, buffer, BUFFER_LEN - 1, &nc, nullptr))
+ {
+ if (GetLastError() != ERROR_BROKEN_PIPE)
+ {
+ // process could have exited
+ camp::reportError("read failed from pipe");
+ }
+ }
+
+ buffer[nc]=0;
+
+ if (nc > 0)
+ {
+ if (settings::verbose > 2)
+ {
+ cerr << buffer;
+ }
+ }
+ else if (procInfo.hProcess != nullptr)
+ {
+ switch (WaitForSingleObject(procInfo.hProcess, 0))
+ {
+ case WAIT_OBJECT_0:
+ {
+ closeProcessHandles();
+ Running=false;
+ break;
+ }
+ case WAIT_TIMEOUT:
+ break;
+ default:
+ camp::reportError("Waiting for process failed");
+ break;
+ }
+ }
+ return nc;
+}
+
+string Win32IoPipeStream::readline()
+{
+ sbuffer.clear();
+ int nc;
+ do {
+ nc=readbuffer();
+ sbuffer.append(buffer);
+ } while(buffer[nc-1] != '\n' && Running);
+ return sbuffer;
+}
+
+bool Win32IoPipeStream::tailequals(char const* buf, size_t len, char const* prompt, size_t plen)
+{
+ const char *a=buf+len;
+ const char *b=prompt+plen;
+ while(b >= prompt) {
+ if(a < buf) return false;
+ if(*a != *b) return false;
+ // Handle MSDOS incompatibility:
+ if(a > buf && *a == '\n' && *(a-1) == '\r') --a;
+ --a; --b;
+ }
+ return true;
+}
+
+#pragma region "private functions"
+void Win32IoPipeStream::closeProcessHandles()
+{
+ if (procInfo.hProcess != nullptr)
+ {
+ cw32::checkResult(CloseHandle(procInfo.hProcess));
+ procInfo.hProcess=nullptr;
+ }
+
+ if (procInfo.hThread != nullptr)
+ {
+ cw32::checkResult(CloseHandle(procInfo.hThread));
+ procInfo.hThread=nullptr;
+ }
+}
+
+Win32IoPipeStream& Win32IoPipeStream::operator<< (imanip func)
+{
+ return (*func)(*this);
+}
+
+Win32IoPipeStream& Win32IoPipeStream::operator>>(string& s)
+{
+ readbuffer();
+ s=buffer;
+ return *this;
+}
+
+Win32IoPipeStream& Win32IoPipeStream::operator<<(const string& s)
+{
+ Write(s);
+ return *this;
+}
+string Win32IoPipeStream::getbuffer()
+{
+ return sbuffer;
+}
+
+bool Win32IoPipeStream::running()
+{
+ return Running;
+}
+
+#pragma endregion
+
+}
+#endif
diff --git a/graphics/asymptote/win32pipestream.h b/graphics/asymptote/win32pipestream.h
new file mode 100644
index 0000000000..79b216ea8b
--- /dev/null
+++ b/graphics/asymptote/win32pipestream.h
@@ -0,0 +1,94 @@
+/**
+ * @file win32pipestream.h
+ * @brief A reimplementation of pipestream for win32
+ * @author Supakorn "Jamie" Rassameemasmuang (jamievlin [at] outlook.com)
+ */
+
+#pragma once
+
+#if defined(_WIN32)
+#include "common.h"
+#include <array>
+#include <iomanip>
+
+#include <Windows.h>
+
+namespace w32
+{
+
+class Win32IoPipeStream
+{
+public:
+ static const size_t BUFFER_LEN = SHRT_MAX;
+
+ void open(
+ const mem::vector<string> &command,
+ const char *hint=NULL,
+ const char *application="",
+ int out_fileno=STDOUT_FILENO);
+
+ virtual ~Win32IoPipeStream();
+
+ [[nodiscard]]
+ bool isopen() const;
+
+ Win32IoPipeStream() = default;
+ Win32IoPipeStream(
+ const mem::vector<string> &command,
+ const char *hint=NULL,
+ const char *application="",
+ int out_fileno=STDOUT_FILENO);
+
+ void eof();
+ virtual void pipeclose();
+ void block(bool write, bool read);
+ int wait();
+
+ void Write(const string &s);
+ void wait(const char *prompt);
+ string readline();
+
+ bool tailequals(
+ const char *buf,
+ size_t len,
+ const char *prompt,
+ size_t plen);
+
+ ssize_t readbuffer();
+
+ Win32IoPipeStream& operator>>(string& s);
+ Win32IoPipeStream& operator<<(const string& s);
+
+ typedef Win32IoPipeStream& (*imanip)(Win32IoPipeStream&);
+ Win32IoPipeStream& operator<< (imanip func);
+
+ string getbuffer();
+ bool running();
+
+ template<class T>
+ Win32IoPipeStream& operator<<(T x) {
+ ostringstream os;
+ os << x;
+ Write(os.str());
+ return *this;
+ }
+
+private:
+ void closeProcessHandles();
+
+protected:
+ PROCESS_INFORMATION procInfo = {};
+ bool pipeopen = false;
+
+ HANDLE processStdinWr;
+ HANDLE processOutRd;
+ bool Running;
+ bool pipein;
+
+ char buffer[BUFFER_LEN];
+ string sbuffer;
+};
+
+}
+
+#endif
diff --git a/graphics/asymptote/win32xdr.cc b/graphics/asymptote/win32xdr.cc
new file mode 100644
index 0000000000..227bc59391
--- /dev/null
+++ b/graphics/asymptote/win32xdr.cc
@@ -0,0 +1,95 @@
+#if defined(_WIN32) && defined(HAVE_LIBTIRPC)
+
+#include "win32xdr.h"
+
+void w32_xdrstdio_create(Win32XDR* xdrs, FILE* file, uint32_t op)
+{
+ xdrs->file = file;
+ xdrs->fileMode = op;
+}
+
+void w32_xdr_destroy(Win32XDR* xdrs)
+{
+}
+
+void w32_xdrmem_create(
+ Win32XDR* xdrs, char* addr, unsigned int size,
+ uint32_t op
+)
+{
+ xdrs->file = nullptr;
+ xdrs->fileMode = op;
+ xdrs->nonFileMem.data = addr;
+ xdrs->nonFileMem.memSize = size;
+ xdrs->nonFileMem.dataCursor = addr;
+ xdrs->fileMode = op;
+}
+
+// treat int/long/ulong/other types as by Microsoft's specs:
+// https://learn.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=msvc-170
+
+bool w32_xdr_u_int(Win32XDR* xdrs, uint32_t* ip)
+{
+ return w32_internal_xdr_u_type<uint32_t>(xdrs, ip);
+}
+
+bool w32_xdr_u_long(Win32XDR* xdrs, unsigned long* ip)
+{
+ static_assert(sizeof(unsigned long) == sizeof(uint32_t));
+ return w32_xdr_u_int(xdrs, reinterpret_cast<uint32_t*>(ip));
+}
+
+bool w32_xdr_long(Win32XDR* xdrs, long* ip)
+{
+ static_assert(sizeof(long) == sizeof(int32_t));
+ return w32_xdr_u_long(xdrs, reinterpret_cast<unsigned long*>(ip));
+}
+
+bool w32_xdr_int(Win32XDR* xdrs, int32_t* ip)
+{
+ return w32_xdr_u_int(xdrs, reinterpret_cast<uint32_t*>(ip));
+}
+
+bool w32_xdr_u_short(Win32XDR* xdrs, uint16_t* ip)
+{
+ return w32_internal_xdr_u_type<uint16_t>(xdrs, ip);
+}
+
+bool w32_xdr_short(Win32XDR* xdrs, int16_t* ip)
+{
+ return w32_xdr_u_short(xdrs, reinterpret_cast<uint16_t*>(ip));
+}
+
+bool w32_xdr_u_longlong_t(Win32XDR* xdrs, uint64_t* ip)
+{
+ return w32_internal_xdr_u_type<uint64_t>(xdrs, ip);
+}
+
+bool w32_xdr_longlong_t(Win32XDR* xdrs, int64_t* ip)
+{
+ return w32_xdr_u_longlong_t(xdrs, reinterpret_cast<uint64_t*>(ip));
+}
+
+bool w32_xdr_float(Win32XDR* xdrs, float* ip)
+{
+ return w32_internal_xdr_u_type<float>(xdrs, ip);
+}
+
+bool w32_xdr_double(Win32XDR* xdrs, double* ip)
+{
+ return w32_internal_xdr_u_type<double>(xdrs, ip);
+}
+
+bool w32_xdr_char(Win32XDR* xdrs, char* ip)
+{
+ static_assert(sizeof(char) == sizeof(int8_t));
+ return w32_xdr_u_char(xdrs, reinterpret_cast<unsigned char*>(ip));
+}
+
+bool w32_xdr_u_char(Win32XDR* xdrs, unsigned char* ip)
+{
+ static_assert(sizeof(unsigned char) == sizeof(uint8_t));
+ return w32_internal_xdr_u_type<uint8_t>(xdrs, ip);
+}
+
+#endif
diff --git a/graphics/asymptote/win32xdr.h b/graphics/asymptote/win32xdr.h
new file mode 100644
index 0000000000..bc57ede14b
--- /dev/null
+++ b/graphics/asymptote/win32xdr.h
@@ -0,0 +1,175 @@
+#pragma once
+
+#if defined(_WIN32)
+
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#if defined(HAVE_LIBTIRPC)
+#include <cstdint>
+#include <cstring>
+#include <cstdio>
+
+#include <Winsock2.h>
+
+uint32_t constexpr W32_XDR_DECODE = 0U;
+uint32_t constexpr W32_XDR_ENCODE = 1U;
+
+struct Win32XDR
+{
+ FILE* file;
+ struct
+ {
+ char* data;
+ char* dataCursor;
+ size_t memSize;
+ } nonFileMem;
+ uint32_t fileMode;
+};
+
+void w32_xdrstdio_create(Win32XDR* xdrs, FILE* file, uint32_t op);
+
+void w32_xdr_destroy(Win32XDR* xdrs);
+
+void w32_xdrmem_create(
+ Win32XDR* xdrs, char* addr, unsigned int size,
+ uint32_t op
+);
+
+template<typename T>
+bool w32_internal_xdr_write_raw_bytes(Win32XDR* xdr, T& data)
+{
+ if (xdr->file != nullptr)
+ {
+ auto written = fwrite(&data, sizeof(T), 1, xdr->file);
+ return written == 1;
+ }
+ else
+ {
+ memcpy(xdr->nonFileMem.dataCursor, reinterpret_cast<char*>(&data), sizeof(T));
+ xdr->nonFileMem.dataCursor += sizeof(T);
+ return true;
+ }
+}
+
+template<typename T>
+bool w32_internal_xdr_read_raw_bytes(Win32XDR* xdr, T& result)
+{
+ if (xdr->file != nullptr)
+ {
+ auto readNum = fread(&result, sizeof(T), 1, xdr->file);
+ return readNum == 1;
+ }
+ else
+ {
+ result = *reinterpret_cast<T*>(xdr->nonFileMem.dataCursor);
+ xdr->nonFileMem.dataCursor += sizeof(T);
+ return true;
+ }
+}
+
+template<typename THostType>
+struct w32_internal_xdr_conv_fn {};
+
+template<>
+struct w32_internal_xdr_conv_fn<uint8_t>
+{
+ typedef uint8_t NetType;
+ static uint8_t identity(uint8_t in)
+ {
+ return in;
+ }
+
+ static auto constexpr host2NetFn = identity;
+ static auto constexpr net2HostFn = identity;
+
+};
+
+template<>
+struct w32_internal_xdr_conv_fn<uint16_t>
+{
+ typedef u_short NetType;
+ static auto constexpr host2NetFn = htons;
+ static auto constexpr net2HostFn = ntohs;
+};
+
+template<>
+struct w32_internal_xdr_conv_fn<uint32_t>
+{
+ typedef u_long NetType;
+ static auto constexpr host2NetFn = htonl;
+ static auto constexpr net2HostFn = ntohl;
+};
+
+template<>
+struct w32_internal_xdr_conv_fn<uint64_t>
+{
+ typedef unsigned __int64 NetType;
+ static auto constexpr host2NetFn = htonll;
+ static auto constexpr net2HostFn = ntohll;
+};
+
+template<>
+struct w32_internal_xdr_conv_fn<double>
+{
+ typedef unsigned __int64 NetType;
+ static auto constexpr host2NetFn = htond;
+ static auto constexpr net2HostFn = ntohd;
+};
+
+template<>
+struct w32_internal_xdr_conv_fn<float>
+{
+ typedef unsigned __int32 NetType;
+ static auto constexpr host2NetFn = htonf;
+ static auto constexpr net2HostFn = ntohf;
+};
+
+
+template<typename THostType>
+bool w32_internal_xdr_u_type(Win32XDR* xdrs, THostType* ip)
+{
+ typedef w32_internal_xdr_conv_fn<THostType>::NetType NetType;
+ static_assert(sizeof(NetType) == sizeof(THostType));
+ if (xdrs->fileMode == W32_XDR_DECODE)
+ {
+ NetType rawValue;
+ auto const result = w32_internal_xdr_read_raw_bytes<NetType>(xdrs, rawValue);
+ if (result)
+ {
+ *ip = w32_internal_xdr_conv_fn<THostType>::net2HostFn(rawValue);
+ }
+ return result;
+ }
+ else
+ {
+ NetType translated = w32_internal_xdr_conv_fn<THostType>::host2NetFn(*ip);
+ return w32_internal_xdr_write_raw_bytes<NetType>(xdrs, translated);
+ }
+}
+
+bool w32_xdr_int(Win32XDR* xdrs, int32_t* ip);
+bool w32_xdr_u_int(Win32XDR* xdrs, uint32_t* ip);
+
+// See https://learn.microsoft.com/en-us/cpp/cpp/data-type-ranges?view=msvc-170
+// long and int are both 4 bits
+
+bool w32_xdr_u_long(Win32XDR* xdrs, unsigned long* ip);
+bool w32_xdr_long(Win32XDR* xdrs, long* ip);
+
+bool w32_xdr_short(Win32XDR* xdrs, int16_t* ip);
+bool w32_xdr_u_short(Win32XDR* xdrs, uint16_t* ip);
+
+bool w32_xdr_char(Win32XDR* xdrs, char* ip);
+bool w32_xdr_u_char(Win32XDR* xdrs, unsigned char* ip);
+
+bool w32_xdr_u_longlong_t(Win32XDR* xdrs, uint64_t* ip);
+bool w32_xdr_longlong_t(Win32XDR* xdrs, int64_t* ip);
+
+bool w32_xdr_float(Win32XDR* xdrs, float* ip);
+bool w32_xdr_double(Win32XDR* xdrs, double* ip);
+
+
+#endif
+#endif \ No newline at end of file
diff --git a/graphics/asymptote/windows/AsymptoteInstallInfo.nsi.in b/graphics/asymptote/windows/AsymptoteInstallInfo.nsi.in
new file mode 100644
index 0000000000..4a89399513
--- /dev/null
+++ b/graphics/asymptote/windows/AsymptoteInstallInfo.nsi.in
@@ -0,0 +1 @@
+!define PRODUCT_VERSION "${ASY_VERSION}"
diff --git a/graphics/asymptote/EnvVarUpdate.nsh b/graphics/asymptote/windows/EnvVarUpdate.nsh
index 839d6a0206..39682000c3 100755..100644
--- a/graphics/asymptote/EnvVarUpdate.nsh
+++ b/graphics/asymptote/windows/EnvVarUpdate.nsh
@@ -1,327 +1,327 @@
-/**
- * EnvVarUpdate.nsh
- * : Environmental Variables: append, prepend, and remove entries
- *
- * WARNING: If you use StrFunc.nsh header then include it before this file
- * with all required definitions. This is to avoid conflicts
- *
- * Usage:
- * ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString"
- *
- * Credits:
- * Version 1.0
- * * Cal Turney (turnec2)
- * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this
- * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar,
- * WriteEnvStr, and un.DeleteEnvStr
- * * Diego Pedroso (deguix) for StrTok
- * * Kevin English (kenglish_hi) for StrContains
- * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry
- * (dandaman32) for StrReplace
- *
- * Version 1.1 (compatibility with StrFunc.nsh)
- * * techtonik
- *
- * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
- *
- */
-
-
-!ifndef ENVVARUPDATE_FUNCTION
-!define ENVVARUPDATE_FUNCTION
-!verbose push
-!verbose 3
-!include "LogicLib.nsh"
-!include "WinMessages.NSH"
-!include "StrFunc.nsh"
-
-; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
-!macro _IncludeStrFunction StrFuncName
- !ifndef ${StrFuncName}_INCLUDED
- ${${StrFuncName}}
- !endif
- !ifndef Un${StrFuncName}_INCLUDED
- ${Un${StrFuncName}}
- !endif
- !define un.${StrFuncName} "${Un${StrFuncName}}"
-!macroend
-
-!insertmacro _IncludeStrFunction StrTok
-!insertmacro _IncludeStrFunction StrStr
-!insertmacro _IncludeStrFunction StrRep
-
-; ---------------------------------- Macro Definitions ----------------------------------------
-!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
- Push "${EnvVarName}"
- Push "${Action}"
- Push "${RegLoc}"
- Push "${PathString}"
- Call EnvVarUpdate
- Pop "${ResultVar}"
-!macroend
-!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
-
-!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
- Push "${EnvVarName}"
- Push "${Action}"
- Push "${RegLoc}"
- Push "${PathString}"
- Call un.EnvVarUpdate
- Pop "${ResultVar}"
-!macroend
-!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
-; ---------------------------------- Macro Definitions end-------------------------------------
-
-;----------------------------------- EnvVarUpdate start----------------------------------------
-!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
-!define hkcu_current_user 'HKCU "Environment"'
-
-!macro EnvVarUpdate UN
-
-Function ${UN}EnvVarUpdate
-
- Push $0
- Exch 4
- Exch $1
- Exch 3
- Exch $2
- Exch 2
- Exch $3
- Exch
- Exch $4
- Push $5
- Push $6
- Push $7
- Push $8
- Push $9
- Push $R0
-
- /* After this point:
- -------------------------
- $0 = ResultVar (returned)
- $1 = EnvVarName (input)
- $2 = Action (input)
- $3 = RegLoc (input)
- $4 = PathString (input)
- $5 = Orig EnvVar (read from registry)
- $6 = Len of $0 (temp)
- $7 = tempstr1 (temp)
- $8 = Entry counter (temp)
- $9 = tempstr2 (temp)
- $R0 = tempChar (temp) */
-
- ; Step 1: Read contents of EnvVarName from RegLoc
- ;
- ; Check for empty EnvVarName
- ${If} $1 == ""
- SetErrors
- DetailPrint "ERROR: EnvVarName is blank"
- Goto EnvVarUpdate_Restore_Vars
- ${EndIf}
-
- ; Check for valid Action
- ${If} $2 != "A"
- ${AndIf} $2 != "P"
- ${AndIf} $2 != "R"
- SetErrors
- DetailPrint "ERROR: Invalid Action - must be A, P, or R"
- Goto EnvVarUpdate_Restore_Vars
- ${EndIf}
-
- ${If} $3 == HKLM
- ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5
- ${ElseIf} $3 == HKCU
- ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5
- ${Else}
- SetErrors
- DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"'
- Goto EnvVarUpdate_Restore_Vars
- ${EndIf}
-
- ; Check for empty PathString
- ${If} $4 == ""
- SetErrors
- DetailPrint "ERROR: PathString is blank"
- Goto EnvVarUpdate_Restore_Vars
- ${EndIf}
-
- ; Make sure we've got some work to do
- ${If} $5 == ""
- ${AndIf} $2 == "R"
- SetErrors
- DetailPrint "$1 is empty - Nothing to remove"
- Goto EnvVarUpdate_Restore_Vars
- ${EndIf}
-
- ; Step 2: Scrub EnvVar
- ;
- StrCpy $0 $5 ; Copy the contents to $0
- ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or
- ; after the last one are not removed here but instead in Step 3)
- ${If} $0 != "" ; If EnvVar is not empty ...
- ${Do}
- ${${UN}StrStr} $7 $0 " ;"
- ${If} $7 == ""
- ${ExitDo}
- ${EndIf}
- ${${UN}StrRep} $0 $0 " ;" ";" ; Remove '<space>;'
- ${Loop}
- ${Do}
- ${${UN}StrStr} $7 $0 "; "
- ${If} $7 == ""
- ${ExitDo}
- ${EndIf}
- ${${UN}StrRep} $0 $0 "; " ";" ; Remove ';<space>'
- ${Loop}
- ${Do}
- ${${UN}StrStr} $7 $0 ";;"
- ${If} $7 == ""
- ${ExitDo}
- ${EndIf}
- ${${UN}StrRep} $0 $0 ";;" ";"
- ${Loop}
-
- ; Remove a leading or trailing semicolon from EnvVar
- StrCpy $7 $0 1 0
- ${If} $7 == ";"
- StrCpy $0 $0 "" 1 ; Change ';<EnvVar>' to '<EnvVar>'
- ${EndIf}
- StrLen $6 $0
- IntOp $6 $6 - 1
- StrCpy $7 $0 1 $6
- ${If} $7 == ";"
- StrCpy $0 $0 $6 ; Change ';<EnvVar>' to '<EnvVar>'
- ${EndIf}
- ; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug
- ${EndIf}
-
- /* Step 3. Remove all instances of the target path/string (even if "A" or "P")
- $6 = bool flag (1 = found and removed PathString)
- $7 = a string (e.g. path) delimited by semicolon(s)
- $8 = entry counter starting at 0
- $9 = copy of $0
- $R0 = tempChar */
-
- ${If} $5 != "" ; If EnvVar is not empty ...
- StrCpy $9 $0
- StrCpy $0 ""
- StrCpy $8 0
- StrCpy $6 0
-
- ${Do}
- ${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter
-
- ${If} $7 == "" ; If we've run out of entries,
- ${ExitDo} ; were done
- ${EndIf} ;
-
- ; Remove leading and trailing spaces from this entry (critical step for Action=Remove)
- ${Do}
- StrCpy $R0 $7 1
- ${If} $R0 != " "
- ${ExitDo}
- ${EndIf}
- StrCpy $7 $7 "" 1 ; Remove leading space
- ${Loop}
- ${Do}
- StrCpy $R0 $7 1 -1
- ${If} $R0 != " "
- ${ExitDo}
- ${EndIf}
- StrCpy $7 $7 -1 ; Remove trailing space
- ${Loop}
- ${If} $7 == $4 ; If string matches, remove it by not appending it
- StrCpy $6 1 ; Set 'found' flag
- ${ElseIf} $7 != $4 ; If string does NOT match
- ${AndIf} $0 == "" ; and the 1st string being added to $0,
- StrCpy $0 $7 ; copy it to $0 without a prepended semicolon
- ${ElseIf} $7 != $4 ; If string does NOT match
- ${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0,
- StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon
- ${EndIf} ;
-
- IntOp $8 $8 + 1 ; Bump counter
- ${Loop} ; Check for duplicates until we run out of paths
- ${EndIf}
-
- ; Step 4: Perform the requested Action
- ;
- ${If} $2 != "R" ; If Append or Prepend
- ${If} $6 == 1 ; And if we found the target
- DetailPrint "Target is already present in $1. It will be removed and"
- ${EndIf}
- ${If} $0 == "" ; If EnvVar is (now) empty
- StrCpy $0 $4 ; just copy PathString to EnvVar
- ${If} $6 == 0 ; If found flag is either 0
- ${OrIf} $6 == "" ; or blank (if EnvVarName is empty)
- DetailPrint "$1 was empty and has been updated with the target"
- ${EndIf}
- ${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty),
- StrCpy $0 $0;$4 ; append PathString
- ${If} $6 == 1
- DetailPrint "appended to $1"
- ${Else}
- DetailPrint "Target was appended to $1"
- ${EndIf}
- ${Else} ; If Prepend (and EnvVar is not empty),
- StrCpy $0 $4;$0 ; prepend PathString
- ${If} $6 == 1
- DetailPrint "prepended to $1"
- ${Else}
- DetailPrint "Target was prepended to $1"
- ${EndIf}
- ${EndIf}
- ${Else} ; If Action = Remove
- ${If} $6 == 1 ; and we found the target
- DetailPrint "Target was found and removed from $1"
- ${Else}
- DetailPrint "Target was NOT found in $1 (nothing to remove)"
- ${EndIf}
- ${If} $0 == ""
- DetailPrint "$1 is now empty"
- ${EndIf}
- ${EndIf}
-
- ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change
- ;
- ClearErrors
- ${If} $3 == HKLM
- WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section
- ${ElseIf} $3 == HKCU
- WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
- ${EndIf}
-
- IfErrors 0 +4
- MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3"
- DetailPrint "Could not write updated $1 to $3"
- Goto EnvVarUpdate_Restore_Vars
-
- ; "Export" our change
- SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
-
- EnvVarUpdate_Restore_Vars:
- ;
- ; Restore the user's variables and return ResultVar
- Pop $R0
- Pop $9
- Pop $8
- Pop $7
- Pop $6
- Pop $5
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Push $0 ; Push my $0 (ResultVar)
- Exch
- Pop $0 ; Restore his $0
-
-FunctionEnd
-
-!macroend ; EnvVarUpdate UN
-!insertmacro EnvVarUpdate ""
-!insertmacro EnvVarUpdate "un."
-;----------------------------------- EnvVarUpdate end----------------------------------------
-
-!verbose pop
-!endif
+/**
+ * EnvVarUpdate.nsh
+ * : Environmental Variables: append, prepend, and remove entries
+ *
+ * WARNING: If you use StrFunc.nsh header then include it before this file
+ * with all required definitions. This is to avoid conflicts
+ *
+ * Usage:
+ * ${EnvVarUpdate} "ResultVar" "EnvVarName" "Action" "RegLoc" "PathString"
+ *
+ * Credits:
+ * Version 1.0
+ * * Cal Turney (turnec2)
+ * * Amir Szekely (KiCHiK) and e-circ for developing the forerunners of this
+ * function: AddToPath, un.RemoveFromPath, AddToEnvVar, un.RemoveFromEnvVar,
+ * WriteEnvStr, and un.DeleteEnvStr
+ * * Diego Pedroso (deguix) for StrTok
+ * * Kevin English (kenglish_hi) for StrContains
+ * * Hendri Adriaens (Smile2Me), Diego Pedroso (deguix), and Dan Fuhry
+ * (dandaman32) for StrReplace
+ *
+ * Version 1.1 (compatibility with StrFunc.nsh)
+ * * techtonik
+ *
+ * http://nsis.sourceforge.net/Environmental_Variables:_append%2C_prepend%2C_and_remove_entries
+ *
+ */
+
+
+!ifndef ENVVARUPDATE_FUNCTION
+!define ENVVARUPDATE_FUNCTION
+!verbose push
+!verbose 3
+!include "LogicLib.nsh"
+!include "WinMessages.NSH"
+!include "StrFunc.nsh"
+
+; ---- Fix for conflict if StrFunc.nsh is already includes in main file -----------------------
+!macro _IncludeStrFunction StrFuncName
+ !ifndef ${StrFuncName}_INCLUDED
+ ${${StrFuncName}}
+ !endif
+ !ifndef Un${StrFuncName}_INCLUDED
+ ${Un${StrFuncName}}
+ !endif
+ !define un.${StrFuncName} "${Un${StrFuncName}}"
+!macroend
+
+!insertmacro _IncludeStrFunction StrTok
+!insertmacro _IncludeStrFunction StrStr
+!insertmacro _IncludeStrFunction StrRep
+
+; ---------------------------------- Macro Definitions ----------------------------------------
+!macro _EnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define EnvVarUpdate '!insertmacro "_EnvVarUpdateConstructor"'
+
+!macro _unEnvVarUpdateConstructor ResultVar EnvVarName Action Regloc PathString
+ Push "${EnvVarName}"
+ Push "${Action}"
+ Push "${RegLoc}"
+ Push "${PathString}"
+ Call un.EnvVarUpdate
+ Pop "${ResultVar}"
+!macroend
+!define un.EnvVarUpdate '!insertmacro "_unEnvVarUpdateConstructor"'
+; ---------------------------------- Macro Definitions end-------------------------------------
+
+;----------------------------------- EnvVarUpdate start----------------------------------------
+!define hklm_all_users 'HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"'
+!define hkcu_current_user 'HKCU "Environment"'
+
+!macro EnvVarUpdate UN
+
+Function ${UN}EnvVarUpdate
+
+ Push $0
+ Exch 4
+ Exch $1
+ Exch 3
+ Exch $2
+ Exch 2
+ Exch $3
+ Exch
+ Exch $4
+ Push $5
+ Push $6
+ Push $7
+ Push $8
+ Push $9
+ Push $R0
+
+ /* After this point:
+ -------------------------
+ $0 = ResultVar (returned)
+ $1 = EnvVarName (input)
+ $2 = Action (input)
+ $3 = RegLoc (input)
+ $4 = PathString (input)
+ $5 = Orig EnvVar (read from registry)
+ $6 = Len of $0 (temp)
+ $7 = tempstr1 (temp)
+ $8 = Entry counter (temp)
+ $9 = tempstr2 (temp)
+ $R0 = tempChar (temp) */
+
+ ; Step 1: Read contents of EnvVarName from RegLoc
+ ;
+ ; Check for empty EnvVarName
+ ${If} $1 == ""
+ SetErrors
+ DetailPrint "ERROR: EnvVarName is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for valid Action
+ ${If} $2 != "A"
+ ${AndIf} $2 != "P"
+ ${AndIf} $2 != "R"
+ SetErrors
+ DetailPrint "ERROR: Invalid Action - must be A, P, or R"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ${If} $3 == HKLM
+ ReadRegStr $5 ${hklm_all_users} $1 ; Get EnvVarName from all users into $5
+ ${ElseIf} $3 == HKCU
+ ReadRegStr $5 ${hkcu_current_user} $1 ; Read EnvVarName from current user into $5
+ ${Else}
+ SetErrors
+ DetailPrint 'ERROR: Action is [$3] but must be "HKLM" or HKCU"'
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Check for empty PathString
+ ${If} $4 == ""
+ SetErrors
+ DetailPrint "ERROR: PathString is blank"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Make sure we've got some work to do
+ ${If} $5 == ""
+ ${AndIf} $2 == "R"
+ SetErrors
+ DetailPrint "$1 is empty - Nothing to remove"
+ Goto EnvVarUpdate_Restore_Vars
+ ${EndIf}
+
+ ; Step 2: Scrub EnvVar
+ ;
+ StrCpy $0 $5 ; Copy the contents to $0
+ ; Remove spaces around semicolons (NOTE: spaces before the 1st entry or
+ ; after the last one are not removed here but instead in Step 3)
+ ${If} $0 != "" ; If EnvVar is not empty ...
+ ${Do}
+ ${${UN}StrStr} $7 $0 " ;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 " ;" ";" ; Remove '<space>;'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 "; "
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 "; " ";" ; Remove ';<space>'
+ ${Loop}
+ ${Do}
+ ${${UN}StrStr} $7 $0 ";;"
+ ${If} $7 == ""
+ ${ExitDo}
+ ${EndIf}
+ ${${UN}StrRep} $0 $0 ";;" ";"
+ ${Loop}
+
+ ; Remove a leading or trailing semicolon from EnvVar
+ StrCpy $7 $0 1 0
+ ${If} $7 == ";"
+ StrCpy $0 $0 "" 1 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ StrLen $6 $0
+ IntOp $6 $6 - 1
+ StrCpy $7 $0 1 $6
+ ${If} $7 == ";"
+ StrCpy $0 $0 $6 ; Change ';<EnvVar>' to '<EnvVar>'
+ ${EndIf}
+ ; DetailPrint "Scrubbed $1: [$0]" ; Uncomment to debug
+ ${EndIf}
+
+ /* Step 3. Remove all instances of the target path/string (even if "A" or "P")
+ $6 = bool flag (1 = found and removed PathString)
+ $7 = a string (e.g. path) delimited by semicolon(s)
+ $8 = entry counter starting at 0
+ $9 = copy of $0
+ $R0 = tempChar */
+
+ ${If} $5 != "" ; If EnvVar is not empty ...
+ StrCpy $9 $0
+ StrCpy $0 ""
+ StrCpy $8 0
+ StrCpy $6 0
+
+ ${Do}
+ ${${UN}StrTok} $7 $9 ";" $8 "0" ; $7 = next entry, $8 = entry counter
+
+ ${If} $7 == "" ; If we've run out of entries,
+ ${ExitDo} ; were done
+ ${EndIf} ;
+
+ ; Remove leading and trailing spaces from this entry (critical step for Action=Remove)
+ ${Do}
+ StrCpy $R0 $7 1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 "" 1 ; Remove leading space
+ ${Loop}
+ ${Do}
+ StrCpy $R0 $7 1 -1
+ ${If} $R0 != " "
+ ${ExitDo}
+ ${EndIf}
+ StrCpy $7 $7 -1 ; Remove trailing space
+ ${Loop}
+ ${If} $7 == $4 ; If string matches, remove it by not appending it
+ StrCpy $6 1 ; Set 'found' flag
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 == "" ; and the 1st string being added to $0,
+ StrCpy $0 $7 ; copy it to $0 without a prepended semicolon
+ ${ElseIf} $7 != $4 ; If string does NOT match
+ ${AndIf} $0 != "" ; and this is NOT the 1st string to be added to $0,
+ StrCpy $0 $0;$7 ; append path to $0 with a prepended semicolon
+ ${EndIf} ;
+
+ IntOp $8 $8 + 1 ; Bump counter
+ ${Loop} ; Check for duplicates until we run out of paths
+ ${EndIf}
+
+ ; Step 4: Perform the requested Action
+ ;
+ ${If} $2 != "R" ; If Append or Prepend
+ ${If} $6 == 1 ; And if we found the target
+ DetailPrint "Target is already present in $1. It will be removed and"
+ ${EndIf}
+ ${If} $0 == "" ; If EnvVar is (now) empty
+ StrCpy $0 $4 ; just copy PathString to EnvVar
+ ${If} $6 == 0 ; If found flag is either 0
+ ${OrIf} $6 == "" ; or blank (if EnvVarName is empty)
+ DetailPrint "$1 was empty and has been updated with the target"
+ ${EndIf}
+ ${ElseIf} $2 == "A" ; If Append (and EnvVar is not empty),
+ StrCpy $0 $0;$4 ; append PathString
+ ${If} $6 == 1
+ DetailPrint "appended to $1"
+ ${Else}
+ DetailPrint "Target was appended to $1"
+ ${EndIf}
+ ${Else} ; If Prepend (and EnvVar is not empty),
+ StrCpy $0 $4;$0 ; prepend PathString
+ ${If} $6 == 1
+ DetailPrint "prepended to $1"
+ ${Else}
+ DetailPrint "Target was prepended to $1"
+ ${EndIf}
+ ${EndIf}
+ ${Else} ; If Action = Remove
+ ${If} $6 == 1 ; and we found the target
+ DetailPrint "Target was found and removed from $1"
+ ${Else}
+ DetailPrint "Target was NOT found in $1 (nothing to remove)"
+ ${EndIf}
+ ${If} $0 == ""
+ DetailPrint "$1 is now empty"
+ ${EndIf}
+ ${EndIf}
+
+ ; Step 5: Update the registry at RegLoc with the updated EnvVar and announce the change
+ ;
+ ClearErrors
+ ${If} $3 == HKLM
+ WriteRegExpandStr ${hklm_all_users} $1 $0 ; Write it in all users section
+ ${ElseIf} $3 == HKCU
+ WriteRegExpandStr ${hkcu_current_user} $1 $0 ; Write it to current user section
+ ${EndIf}
+
+ IfErrors 0 +4
+ MessageBox MB_OK|MB_ICONEXCLAMATION "Could not write updated $1 to $3"
+ DetailPrint "Could not write updated $1 to $3"
+ Goto EnvVarUpdate_Restore_Vars
+
+ ; "Export" our change
+ SendMessage ${HWND_BROADCAST} ${WM_WININICHANGE} 0 "STR:Environment" /TIMEOUT=5000
+
+ EnvVarUpdate_Restore_Vars:
+ ;
+ ; Restore the user's variables and return ResultVar
+ Pop $R0
+ Pop $9
+ Pop $8
+ Pop $7
+ Pop $6
+ Pop $5
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Push $0 ; Push my $0 (ResultVar)
+ Exch
+ Pop $0 ; Restore his $0
+
+FunctionEnd
+
+!macroend ; EnvVarUpdate UN
+!insertmacro EnvVarUpdate ""
+!insertmacro EnvVarUpdate "un."
+;----------------------------------- EnvVarUpdate end----------------------------------------
+
+!verbose pop
+!endif
diff --git a/graphics/asymptote/asy.ico b/graphics/asymptote/windows/asy.ico
index f9c89bc2be..f9c89bc2be 100644
--- a/graphics/asymptote/asy.ico
+++ b/graphics/asymptote/windows/asy.ico
Binary files differ
diff --git a/graphics/asymptote/asy.rc b/graphics/asymptote/windows/asy.rc
index 62b2e91dd3..62b2e91dd3 100644
--- a/graphics/asymptote/asy.rc
+++ b/graphics/asymptote/windows/asy.rc
diff --git a/graphics/asymptote/asymptote.nsi b/graphics/asymptote/windows/asymptote.nsi
index 9c4f16ec74..9c4f16ec74 100644
--- a/graphics/asymptote/asymptote.nsi
+++ b/graphics/asymptote/windows/asymptote.nsi
diff --git a/graphics/asymptote/windows/build-asy-installer.ps1.in b/graphics/asymptote/windows/build-asy-installer.ps1.in
new file mode 100644
index 0000000000..d82d5d9e22
--- /dev/null
+++ b/graphics/asymptote/windows/build-asy-installer.ps1.in
@@ -0,0 +1,11 @@
+#!/usr/bin/env pwsh
+
+param(
+ [Parameter(Mandatory=$true)]
+ [string]$MakeNsisExec
+)
+
+& "${PY3_INTERPRETER}" "${BUILD_ASY_INSTALLER_SCRIPT}" `
+ --cmake-install-root="${CMAKE_INSTALL_PREFIX}" `
+ --asy-install-build-dir="${ASY_INSTALL_DIRECTORY}" `
+ --makensis-exec="$MakeNsisExec"
diff --git a/graphics/asymptote/windows/build-asymptote-installer.py b/graphics/asymptote/windows/build-asymptote-installer.py
new file mode 100644
index 0000000000..65e8fa2e2e
--- /dev/null
+++ b/graphics/asymptote/windows/build-asymptote-installer.py
@@ -0,0 +1,114 @@
+#!/usr/bin/env python3
+
+import argparse
+import pathlib
+import shutil
+import subprocess
+
+ASYMPTOTE_SOURCE_ROOT = pathlib.Path(__file__).parent.parent
+GUI_DIR = gui_dir = ASYMPTOTE_SOURCE_ROOT / "GUI"
+
+
+def parse_args():
+ parser = argparse.ArgumentParser()
+ parser.add_argument(
+ "--makensis-exec",
+ type=str,
+ required=True,
+ help="Executable file to makensis.exe",
+ )
+ parser.add_argument(
+ "--cmake-install-root",
+ type=str,
+ required=True,
+ help="CMake Pre-NSIS install root",
+ )
+ parser.add_argument(
+ "--asy-install-build-dir",
+ type=str,
+ required=True,
+ help=(
+ "Name of the install directory for asymptote build contained in the "
+ + "cmake-install-root directory"
+ ),
+ )
+ return parser.parse_args()
+
+
+def check_gui_built():
+ dirs_to_check = {"xasyicons", "xasyqtui", "xasyversion"}
+
+ message = (
+ "GUI is not fully built. "
+ + "Please ensure GUI is built before running this build script."
+ )
+ if not all((GUI_DIR / dir_to_check).exists() for dir_to_check in dirs_to_check):
+ raise RuntimeError(message)
+
+
+def copy_gui_files(asy_install_root: pathlib.Path):
+ gui_install_dir = asy_install_root / "GUI"
+ if gui_install_dir.is_file():
+ gui_install_dir.unlink(missing_ok=True)
+ elif gui_install_dir.is_dir():
+ shutil.rmtree(gui_install_dir)
+
+ gui_install_dir.mkdir(exist_ok=True)
+
+ exclude_prefixes = {
+ ".vscode",
+ ".fleet",
+ ".idea"
+ "__pycache__",
+ ".python-version",
+ ".gitignore",
+ "buildtool.py",
+ "requirements.",
+ "setup.py",
+ "xasy-launcher",
+ }
+
+ for file in GUI_DIR.iterdir():
+ if any(
+ file.name.lower().startswith(exclude_prefix.lower())
+ for exclude_prefix in exclude_prefixes
+ ):
+ continue
+ if file.is_dir():
+ shutil.copytree(file, gui_install_dir / file.name)
+ else:
+ shutil.copy2(file, gui_install_dir / file.name)
+
+
+def main():
+ # check GUI built
+ args = parse_args()
+ check_gui_built()
+
+ makensis_exec = pathlib.Path(args.makensis_exec)
+ if not makensis_exec.is_file():
+ raise RuntimeError("makensis executable cannot be found")
+
+ # copy GUI to
+ cmake_install_root = pathlib.Path(args.cmake_install_root)
+ asy_install_root = cmake_install_root / args.asy_install_build_dir
+ copy_gui_files(asy_install_root)
+
+ # generate uninstall file
+ with open(cmake_install_root / "AsymptoteUninstallList.nsi", "w") as f:
+ for file in asy_install_root.iterdir():
+ if file.is_dir():
+ f.write("RMDir /r $INSTDIR\\" + file.name)
+ else:
+ f.write("Delete $INSTDIR\\" + file.name)
+ f.write("\n")
+
+ # call nsis builder
+ subprocess.run(
+ [args.makensis_exec, str(cmake_install_root / "asymptote.nsi")], check=True
+ )
+ print("Build succeeded")
+
+
+if __name__ == "__main__":
+ main()
diff --git a/graphics/asymptote/lnkX64IconFix.nsh b/graphics/asymptote/windows/lnkX64IconFix.nsh
index d1a4c9f311..ded187c8f1 100644
--- a/graphics/asymptote/lnkX64IconFix.nsh
+++ b/graphics/asymptote/windows/lnkX64IconFix.nsh
@@ -1,74 +1,74 @@
-/******************************************************************************
- WORKAROUND - lnkX64IconFix
- This snippet was developed to address an issue with Windows
- x64 incorrectly redirecting the shortcuts icon from $PROGRAMFILES32
- to $PROGRAMFILES64.
-
- See Forum post: http://forums.winamp.com/newreply.php?do=postreply&t=327806
-
- Example:
- CreateShortcut "$SMPROGRAMS\My App\My App.lnk" "$INSTDIR\My App.exe" "" "$INSTDIR\My App.exe"
- ${lnkX64IconFix} "$SMPROGRAMS\My App\My App.lnk"
-
- Original Code by Anders [http://forums.winamp.com/member.php?u=70852]
- ******************************************************************************/
-!ifndef ___lnkX64IconFix___
- !verbose push
- !verbose 0
-
- !include "LogicLib.nsh"
- !include "x64.nsh"
-
- !define ___lnkX64IconFix___
- !define lnkX64IconFix `!insertmacro _lnkX64IconFix`
- !macro _lnkX64IconFix _lnkPath
- !verbose push
- !verbose 0
- ${If} ${RunningX64}
- DetailPrint "WORKAROUND: 64bit OS Detected, Attempting to apply lnkX64IconFix"
- Push "${_lnkPath}"
- Call lnkX64IconFix
- ${EndIf}
- !verbose pop
- !macroend
-
- Function lnkX64IconFix ; _lnkPath
- Exch $5
- Push $0
- Push $1
- Push $2
- Push $3
- Push $4
- System::Call 'OLE32::CoCreateInstance(g "{00021401-0000-0000-c000-000000000046}",i 0,i 1,g "{000214ee-0000-0000-c000-000000000046}",*i.r1)i'
- ${If} $1 <> 0
- System::Call '$1->0(g "{0000010b-0000-0000-C000-000000000046}",*i.r2)'
- ${If} $2 <> 0
- System::Call '$2->5(w r5,i 2)i.r0'
- ${If} $0 = 0
- System::Call '$1->0(g "{45e2b4ae-b1c3-11d0-b92f-00a0c90312e1}",*i.r3)i.r0'
- ${If} $3 <> 0
- System::Call '$3->5(i 0xA0000007)i.r0'
- System::Call '$3->6(*i.r4)i.r0'
- ${If} $0 = 0
- IntOp $4 $4 & 0xffffBFFF
- System::Call '$3->7(ir4)i.r0'
- ${If} $0 = 0
- System::Call '$2->6(i0,i0)'
- DetailPrint "WORKAROUND: lnkX64IconFix Applied successfully"
- ${EndIf}
- ${EndIf}
- System::Call $3->2()
- ${EndIf}
- ${EndIf}
- System::Call $2->2()
- ${EndIf}
- System::Call $1->2()
- ${EndIf}
- Pop $4
- Pop $3
- Pop $2
- Pop $1
- Pop $0
- FunctionEnd
- !verbose pop
-!endif
+/******************************************************************************
+ WORKAROUND - lnkX64IconFix
+ This snippet was developed to address an issue with Windows
+ x64 incorrectly redirecting the shortcuts icon from $PROGRAMFILES32
+ to $PROGRAMFILES64.
+
+ See Forum post: http://forums.winamp.com/newreply.php?do=postreply&t=327806
+
+ Example:
+ CreateShortcut "$SMPROGRAMS\My App\My App.lnk" "$INSTDIR\My App.exe" "" "$INSTDIR\My App.exe"
+ ${lnkX64IconFix} "$SMPROGRAMS\My App\My App.lnk"
+
+ Original Code by Anders [http://forums.winamp.com/member.php?u=70852]
+ ******************************************************************************/
+!ifndef ___lnkX64IconFix___
+ !verbose push
+ !verbose 0
+
+ !include "LogicLib.nsh"
+ !include "x64.nsh"
+
+ !define ___lnkX64IconFix___
+ !define lnkX64IconFix `!insertmacro _lnkX64IconFix`
+ !macro _lnkX64IconFix _lnkPath
+ !verbose push
+ !verbose 0
+ ${If} ${RunningX64}
+ DetailPrint "WORKAROUND: 64bit OS Detected, Attempting to apply lnkX64IconFix"
+ Push "${_lnkPath}"
+ Call lnkX64IconFix
+ ${EndIf}
+ !verbose pop
+ !macroend
+
+ Function lnkX64IconFix ; _lnkPath
+ Exch $5
+ Push $0
+ Push $1
+ Push $2
+ Push $3
+ Push $4
+ System::Call 'OLE32::CoCreateInstance(g "{00021401-0000-0000-c000-000000000046}",i 0,i 1,g "{000214ee-0000-0000-c000-000000000046}",*i.r1)i'
+ ${If} $1 <> 0
+ System::Call '$1->0(g "{0000010b-0000-0000-C000-000000000046}",*i.r2)'
+ ${If} $2 <> 0
+ System::Call '$2->5(w r5,i 2)i.r0'
+ ${If} $0 = 0
+ System::Call '$1->0(g "{45e2b4ae-b1c3-11d0-b92f-00a0c90312e1}",*i.r3)i.r0'
+ ${If} $3 <> 0
+ System::Call '$3->5(i 0xA0000007)i.r0'
+ System::Call '$3->6(*i.r4)i.r0'
+ ${If} $0 = 0
+ IntOp $4 $4 & 0xffffBFFF
+ System::Call '$3->7(ir4)i.r0'
+ ${If} $0 = 0
+ System::Call '$2->6(i0,i0)'
+ DetailPrint "WORKAROUND: lnkX64IconFix Applied successfully"
+ ${EndIf}
+ ${EndIf}
+ System::Call $3->2()
+ ${EndIf}
+ ${EndIf}
+ System::Call $2->2()
+ ${EndIf}
+ System::Call $1->2()
+ ${EndIf}
+ Pop $4
+ Pop $3
+ Pop $2
+ Pop $1
+ Pop $0
+ FunctionEnd
+ !verbose pop
+!endif
diff --git a/graphics/asymptote/windows/texindex-wsl.cmd b/graphics/asymptote/windows/texindex-wsl.cmd
new file mode 100644
index 0000000000..76d314b9f1
--- /dev/null
+++ b/graphics/asymptote/windows/texindex-wsl.cmd
@@ -0,0 +1,2 @@
+@echo off
+wsl texindex %*
diff --git a/graphics/asymptote/xdrcommon.h b/graphics/asymptote/xdrcommon.h
new file mode 100644
index 0000000000..f62d2dcb5f
--- /dev/null
+++ b/graphics/asymptote/xdrcommon.h
@@ -0,0 +1,82 @@
+#pragma once
+
+#if defined(HAVE_LIBTIRPC)
+#if defined(_WIN32)
+#include "win32xdr.h"
+typedef Win32XDR XDR;
+#define xdrstdio_create w32_xdrstdio_create
+#define xdr_destroy w32_xdr_destroy
+#define xdrmem_create w32_xdrmem_create
+
+#define xdr_u_int w32_xdr_u_int
+#define xdr_int w32_xdr_int
+#define xdr_float w32_xdr_float
+#define xdr_double w32_xdr_double
+#define xdr_long w32_xdr_long
+#define xdr_u_long w32_xdr_u_long
+
+#define xdr_longlong_t w32_xdr_longlong_t
+#define xdr_u_longlong_t w32_xdr_u_longlong_t
+
+#define xdr_short w32_xdr_short
+#define xdr_u_short w32_xdr_u_short
+
+#define xdr_char w32_xdr_char
+#define xdr_u_char w32_xdr_u_char
+
+#define XDR_DECODE W32_XDR_DECODE
+#define XDR_ENCODE W32_XDR_ENCODE
+
+#else
+#ifndef _ALL_SOURCE
+#define _ALL_SOURCE 1
+#endif
+
+#include <cstdio>
+#include <vector>
+#include <algorithm>
+
+#include <sys/types.h>
+#include <rpc/types.h>
+
+#define quad_t long long
+#define u_quad_t unsigned long long
+
+#if defined(__CYGWIN__) || defined(__FreeBSD__)
+#include <sys/select.h>
+#define u_char unsigned char
+#define u_int unsigned int
+#define u_short unsigned short
+#define u_long unsigned long
+extern "C" int fseeko(FILE*, off_t, int);
+extern "C" off_t ftello(FILE*);
+extern "C" FILE * open_memstream(char**, size_t*);
+#endif
+
+#ifdef __APPLE__
+#include <rpc/xdr.h>
+
+inline bool_t xdr_long(XDR* __xdrs, long* __lp) {
+ return xdr_longlong_t(__xdrs, (long long*)__lp);
+}
+
+inline bool_t xdr_u_long(XDR* __xdrs, unsigned long* __lp) {
+ return xdr_u_longlong_t(__xdrs, (unsigned long long*) __lp);
+}
+
+#endif
+
+#ifdef __OpenBSD__
+#define xdr_longlong_t xdr_int64_t
+#define xdr_u_longlong_t xdr_u_int64_t
+#endif
+
+#ifdef _POSIX_SOURCE
+#undef _POSIX_SOURCE
+#include <rpc/rpc.h>
+#define _POSIX_SOURCE
+#else
+#include <rpc/rpc.h>
+#endif
+#endif
+#endif
diff --git a/graphics/asymptote/xstream.cc b/graphics/asymptote/xstream.cc
new file mode 100644
index 0000000000..9656e37b19
--- /dev/null
+++ b/graphics/asymptote/xstream.cc
@@ -0,0 +1,372 @@
+#if defined(HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#if defined(HAVE_LIBTIRPC)
+#include "xstream.h"
+
+namespace xdr
+{
+
+// xbyte
+xbyte::xbyte() {}
+xbyte::xbyte(unsigned char c0): c(c0) {}
+xbyte::xbyte(int c0): c((unsigned char) c0) {}
+xbyte::xbyte(unsigned c0): c((unsigned char) c0) {}
+
+int xbyte::byte() const
+{
+ return c;
+}
+
+xbyte::operator unsigned char() const
+{
+ return c;
+}
+
+// xios
+int xios::good() const { return _state == 0; }
+int xios::eof() const { return _state & eofbit; }
+int xios::fail() const { return !good();}
+int xios::bad() const { return _state & badbit; }
+void xios::clear(int state) {_state=state;}
+void xios::set(int flag) {_state |= flag;}
+xios::operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
+int xios::operator!() const { return fail(); }
+
+// xstream
+xstream::~xstream() {}
+xstream::xstream(): xios(), buf(nullptr) {}
+void xstream::precision(int) {}
+xstream& xstream::seek(OffsetType pos, seekdir dir) {
+ if(buf) {
+ clear();
+ if(fseeko(buf,pos,dir) != 0) set(failbit);
+ }
+ return *this;
+}
+OffsetType xstream::tell() {
+ return ftello(buf);
+}
+
+// ixstream
+
+ixstream::ixstream(bool singleprecision)
+ : singleprecision(singleprecision)
+{
+
+}
+
+void ixstream::open(const char* filename, open_mode)
+{
+ clear();
+ buf=fopen(filename,"r");
+ if(buf) xdrstdio_create(&xdri,buf,XDR_DECODE);
+ else set(badbit);
+}
+
+void ixstream::close()
+{
+ closeFile();
+}
+
+void ixstream::closeFile()
+{
+ if(buf) {
+#ifndef _CRAY
+ xdr_destroy(&xdri);
+#endif
+ fclose(buf);
+ buf=nullptr;
+ }
+}
+
+ixstream::ixstream(const char* filename, bool singleprecision)
+ : singleprecision(singleprecision)
+{
+ ixstream::open(filename);
+}
+
+ixstream::ixstream(const char* filename, open_mode mode, bool singleprecision)
+ : singleprecision(singleprecision)
+{
+ ixstream::open(filename,mode);
+}
+
+ixstream::~ixstream()
+{
+ ixstream::close();
+}
+
+ixstream& ixstream::operator>>(imanip func)
+{
+ return (*func)(*this);
+}
+
+ixstream& ixstream::operator>>(double& x)
+{
+ if(singleprecision)
+ {
+ float f;
+ *this >> f;
+ x=(double) f;
+ } else
+ if(!xdr_double(&xdri, &x)) set(eofbit);
+ return *this;
+}
+ixstream& ixstream::operator>>(xbyte& x)
+{
+ int c=fgetc(buf);
+ if(c != EOF) x=c;
+ else set(eofbit);
+ return *this;
+}
+
+// oxstream
+oxstream::oxstream(bool singleprecision): singleprecision(singleprecision)
+{
+
+}
+void oxstream::open(const char* filename, open_mode mode)
+{
+ clear();
+ buf=fopen(filename,(mode & app) ? "a" : "w");
+ if(buf) xdrstdio_create(&xdro,buf,XDR_ENCODE);
+ else set(badbit);
+}
+void oxstream::close()
+{
+ closefile();
+}
+void oxstream::closefile()
+{
+ if(buf) {
+#ifndef _CRAY
+ xdr_destroy(&xdro);
+#endif
+ fclose(buf);
+ buf=NULL;
+ }
+}
+oxstream::oxstream(const char* filename, bool singleprecision)
+ : singleprecision(singleprecision)
+{
+ oxstream::open(filename);
+}
+
+oxstream::oxstream(const char* filename, open_mode mode, bool singleprecision)
+ : singleprecision(singleprecision)
+{
+ oxstream::open(filename,mode);
+}
+
+oxstream::~oxstream()
+{
+ closefile();
+}
+
+oxstream& oxstream::flush() {if(buf) fflush(buf); return *this;}
+oxstream& oxstream::operator<<(omanip func) { return (*func)(*this); }
+oxstream& oxstream::operator<<(double x)
+{
+ if(singleprecision)
+ *this << (float) x;
+ else
+ if(!xdr_double(&xdro, &x)) set(badbit);
+ return *this;
+}
+oxstream& oxstream::operator<<(xbyte x) {
+ if(fputc(x.byte(),buf) == EOF) set(badbit);
+ return *this;
+}
+
+memoxstream::memoxstream(bool singleprecision)
+ : oxstream(singleprecision)
+#if defined(_WIN32)
+ ,fmInstance()
+#endif
+{
+ clear();
+#if defined(_WIN32)
+ fmem_init(&fmInstance);
+ buf=fmem_open(&fmInstance, "w+");
+#else
+ buf=open_memstream(&buffer,&size);
+#endif
+ if(buf)
+ xdrstdio_create(&xdro,buf,XDR_ENCODE);
+ else
+ set(badbit);
+}
+
+memoxstream::~memoxstream()
+{
+ closefile();
+#if defined(_WIN32)
+ fmem_term(&fmInstance);
+#else
+ free(buffer);
+#endif
+}
+std::vector<uint8_t> memoxstream::createCopyOfCurrentData() {
+ auto flushResult = fflush(buf);
+ if (flushResult != 0)
+ {
+ std::cerr << "cannot flush memory xstream";
+ exit(EXIT_FAILURE);
+ }
+#if defined(_WIN32)
+ size_t retSize=0;
+ void* streamPtr=nullptr;
+
+ // DANGER: There's a /severe/ issue with certain systems (though such cases should be rare)
+ // about a potential memory leak.
+
+ // See https://github.com/Kreijstal/fmem/issues/6
+
+ // Right now, we have no reasonable way to determine if tmpfile implementation is being used
+ // or not, so we cannot have a way to conditionally free the memory.
+
+ // In most systems, we have open_memstream and Windows tmpfile API
+ // which the allocation/mapping is handled by the system and hence
+ // no need to free the pointer ourselves, but tmpfile implementation uses malloc that doesn't
+ // get freed, so it is our job to manually free it.
+ fmem_mem(&fmInstance, &streamPtr, &retSize);
+
+ if (streamPtr == nullptr)
+ {
+ return {};
+ }
+
+ auto* bytePtr = static_cast<uint8_t*>(streamPtr);
+ std::vector ret(bytePtr, bytePtr + retSize);
+ return ret;
+#else
+ // for sanity check, always want to make sure we have a vector of bytes
+ static_assert(sizeof(char) == sizeof(uint8_t));
+
+ if (buffer == nullptr)
+ {
+ return {};
+ }
+
+ auto* retPtr = reinterpret_cast<uint8_t*>(buffer);
+ return {retPtr, retPtr + size};
+#endif
+}
+
+// memixstream
+memixstream::memixstream(char* data, size_t length, bool singleprecision)
+ : ixstream(singleprecision)
+{
+ xdrmem_create(&xdri,data,length,XDR_DECODE);
+}
+memixstream::memixstream(std::vector<char>& data, bool singleprecision)
+ : memixstream(data.data(), data.size(), singleprecision)
+{
+}
+
+memixstream::~memixstream()
+{
+ xdr_destroy(&xdri);
+}
+void memixstream::close()
+{
+ xdr_destroy(&xdri);
+}
+
+void memixstream::open(const char* filename, open_mode openMode)
+{
+}
+
+// ioxstream
+
+void ioxstream::open(const char* filename, open_mode mode)
+{
+ clear();
+ if(mode & app)
+ buf=fopen(filename,"a+");
+ else if(mode & trunc)
+ buf=fopen(filename,"w+");
+ else if(mode & out) {
+ buf=fopen(filename,"r+");
+ if(!buf)
+ buf=fopen(filename,"w+");
+ } else
+ buf=fopen(filename,"r");
+ if(buf) {
+ xdrstdio_create(&xdri,buf,XDR_DECODE);
+ xdrstdio_create(&xdro,buf,XDR_ENCODE);
+ } else set(badbit);
+}
+void ioxstream::close() {
+ if(buf) {
+#ifndef _CRAY
+ xdr_destroy(&xdri);
+ xdr_destroy(&xdro);
+#endif
+ fclose(buf);
+ buf=NULL;
+ }
+}
+ioxstream::ioxstream()
+{
+
+}
+ioxstream::ioxstream(const char* filename)
+{
+ ioxstream::open(filename);
+}
+ioxstream::ioxstream(const char* filename, open_mode mode)
+{
+ ioxstream::open(filename,mode);
+}
+ioxstream::~ioxstream()
+{
+ ioxstream::close();
+}
+
+
+// ixstream + oxstream operator implementation
+
+#define IXSTREAM_CC_DECL(T) ixstream& ixstream::operator >> (T& x)
+#define IXSTREAM_IMPL(T,N) IXSTREAM_CC_DECL(T) {if(!xdr_##N(&xdri, &x)) set(eofbit); return *this;}
+
+IXSTREAM_IMPL(int, int);
+IXSTREAM_IMPL(unsigned int, u_int);
+IXSTREAM_IMPL(long, long);
+IXSTREAM_IMPL(unsigned long, u_long);
+IXSTREAM_IMPL(long long, longlong_t);
+IXSTREAM_IMPL(unsigned long long, u_longlong_t);
+IXSTREAM_IMPL(short, short);
+IXSTREAM_IMPL(unsigned short, u_short);
+IXSTREAM_IMPL(char, char);
+#ifndef _CRAY
+IXSTREAM_IMPL(unsigned char, u_char);
+#endif
+IXSTREAM_IMPL(float, float);
+
+#define OXSTREAM_CC_DECL(T) oxstream& oxstream::operator << (T x)
+#define OXSTREAM_IMPL(T,N) OXSTREAM_CC_DECL(T) {if(!xdr_##N(&xdro, &x)) set(badbit); return *this;}
+
+OXSTREAM_IMPL(int, int);
+OXSTREAM_IMPL(unsigned int, u_int);
+OXSTREAM_IMPL(long, long);
+OXSTREAM_IMPL(unsigned long, u_long);
+OXSTREAM_IMPL(long long, longlong_t);
+OXSTREAM_IMPL(unsigned long long, u_longlong_t);
+OXSTREAM_IMPL(short, short);
+OXSTREAM_IMPL(unsigned short, u_short);
+OXSTREAM_IMPL(char, char);
+
+#ifndef _CRAY
+OXSTREAM_IMPL(unsigned char, u_char);
+#endif
+OXSTREAM_IMPL(float, float);
+
+oxstream& endl(oxstream& s) { s.flush(); return s; }
+oxstream& flush(oxstream& s) {s.flush(); return s;}
+
+
+}
+#endif
diff --git a/graphics/asymptote/xstream.h b/graphics/asymptote/xstream.h
index c2c2f4cdeb..b87f917904 100644
--- a/graphics/asymptote/xstream.h
+++ b/graphics/asymptote/xstream.h
@@ -19,55 +19,24 @@
#ifndef __xstream_h__
#define __xstream_h__ 1
-#ifndef _ALL_SOURCE
-#define _ALL_SOURCE 1
-#endif
+#if defined(HAVE_LIBTIRPC)
#include <cstdio>
+#include <iostream>
#include <vector>
-#include <algorithm>
-
-#include <sys/types.h>
-#include <rpc/types.h>
-
-#define quad_t long long
-#define u_quad_t unsigned long long
-
-#if defined(__CYGWIN__) || defined(__FreeBSD__)
-#include <sys/select.h>
-#define u_char unsigned char
-#define u_int unsigned int
-#define u_short unsigned short
-#define u_long unsigned long
-extern "C" int fseeko(FILE *, off_t, int);
-extern "C" off_t ftello(FILE *);
-extern "C" FILE *open_memstream(char **, size_t *);
-#endif
-
-#ifdef __APPLE__
-#include <rpc/xdr.h>
-
-inline bool_t xdr_long(XDR *__xdrs, long *__lp) {
- return xdr_longlong_t(__xdrs,(long long *) __lp);
-}
-
-inline bool_t xdr_u_long(XDR *__xdrs, unsigned long *__lp) {
- return xdr_u_longlong_t(__xdrs,(unsigned long long *) __lp);
-}
-
+#include <cstdlib>
+#if defined(_WIN32)
+#include <fmem.h>
#endif
-#ifdef __OpenBSD__
-#define xdr_longlong_t xdr_int64_t
-#define xdr_u_longlong_t xdr_u_int64_t
-#endif
+#include "xdrcommon.h"
-#ifdef _POSIX_SOURCE
-#undef _POSIX_SOURCE
-#include <rpc/rpc.h>
-#define _POSIX_SOURCE
+#if defined(_WIN32)
+typedef __int64 OffsetType;
+#define fseeko _fseeki64
+#define ftello _ftelli64
#else
-#include <rpc/rpc.h>
+#define OffsetType off_t
#endif
namespace xdr {
@@ -75,12 +44,12 @@ namespace xdr {
class xbyte {
unsigned char c;
public:
- xbyte() {}
- xbyte(unsigned char c0) : c(c0) {}
- xbyte(int c0) : c((unsigned char) c0) {}
- xbyte(unsigned int c0) : c((unsigned char) c0) {}
- int byte() const {return c;}
- operator unsigned char () const {return c;}
+ xbyte();
+ xbyte(unsigned char c0);
+ xbyte(int c0);
+ xbyte(unsigned int c0);
+ int byte() const;
+ operator unsigned char () const;
};
class xios {
@@ -91,42 +60,32 @@ public:
private:
int _state;
public:
- int good() const { return _state == 0; }
- int eof() const { return _state & eofbit; }
- int fail() const { return !good();}
- int bad() const { return _state & badbit; }
- void clear(int state = 0) {_state=state;}
- void set(int flag) {_state |= flag;}
- operator void*() const { return fail() ? (void*)0 : (void*)(-1); }
- int operator!() const { return fail(); }
+ int good() const;
+ int eof() const;
+ int fail() const;
+ int bad() const;
+ void clear(int state = 0);
+ void set(int flag);
+ operator void*() const;
+ int operator!() const;
};
class xstream : public xios {
protected:
FILE *buf;
public:
- virtual ~xstream() {}
- xstream() : xios(), buf(nullptr) {}
-
- void precision(int) {}
-
- xstream& seek(off_t pos, seekdir dir=beg) {
- if(buf) {
- clear();
- if(fseeko(buf,pos,dir) != 0) set(failbit);
- }
- return *this;
- }
- off_t tell() {
- return ftello(buf);
- }
-};
+ virtual ~xstream();
+ xstream();
-#define IXSTREAM(T,N) ixstream& operator >> (T& x) \
- {if(!xdr_##N(&xdri, &x)) set(eofbit); return *this;}
+ void precision(int);
-#define OXSTREAM(T,N) oxstream& operator << (T x) \
- {if(!xdr_##N(&xdro, &x)) set(badbit); return *this;}
+ xstream& seek(OffsetType pos, seekdir dir=beg);
+
+ OffsetType tell();
+};
+
+#define IXSTREAM_DECL(T) ixstream& operator >> (T& x)
+#define OXSTREAM_DECL(T) oxstream& operator << (T x)
class ixstream : virtual public xstream {
private:
@@ -134,68 +93,35 @@ private:
protected:
XDR xdri;
public:
- ixstream(bool singleprecision=false) : singleprecision(singleprecision) {}
+ ixstream(bool singleprecision=false);
- virtual void open(const char *filename, open_mode=in) {
- clear();
- buf=fopen(filename,"r");
- if(buf) xdrstdio_create(&xdri,buf,XDR_DECODE);
- else set(badbit);
- }
+ virtual void open(const char *filename, open_mode=in);
+ virtual void close();
+ void closeFile();
- virtual void close() {
- closeFile();
- }
-
- void closeFile() {
- if(buf) {
-#ifndef _CRAY
- xdr_destroy(&xdri);
-#endif
- fclose(buf);
- buf=nullptr;
- }
- }
- ixstream(const char *filename, bool singleprecision=false) :
- singleprecision(singleprecision) {open(filename);}
- ixstream(const char *filename, open_mode mode, bool singleprecision=false) :
- singleprecision(singleprecision) {open(filename,mode);}
- virtual ~ixstream() {close();}
+ ixstream(const char *filename, bool singleprecision=false);
+ ixstream(const char *filename, open_mode mode, bool singleprecision=false);
+ virtual ~ixstream();
typedef ixstream& (*imanip)(ixstream&);
- ixstream& operator >> (imanip func) { return (*func)(*this); }
-
- IXSTREAM(int,int);
- IXSTREAM(unsigned int,u_int);
- IXSTREAM(long,long);
- IXSTREAM(unsigned long,u_long);
- IXSTREAM(long long,longlong_t);
- IXSTREAM(unsigned long long,u_longlong_t);
- IXSTREAM(short,short);
- IXSTREAM(unsigned short,u_short);
- IXSTREAM(char,char);
+ ixstream& operator >> (imanip func);
+
+ IXSTREAM_DECL(int);
+ IXSTREAM_DECL(unsigned int);
+ IXSTREAM_DECL(long);
+ IXSTREAM_DECL(unsigned long);
+ IXSTREAM_DECL(long long);
+ IXSTREAM_DECL(unsigned long long);
+ IXSTREAM_DECL(short);
+ IXSTREAM_DECL(unsigned short);
+ IXSTREAM_DECL(char);
#ifndef _CRAY
- IXSTREAM(unsigned char,u_char);
+ IXSTREAM_DECL(unsigned char);
#endif
- IXSTREAM(float,float);
-
- ixstream& operator >> (double& x)
- {
- if(singleprecision) {
- float f;
- *this >> f;
- x=(double) f;
- } else
- if(!xdr_double(&xdri, &x)) set(eofbit);
- return *this;
- }
-
- ixstream& operator >> (xbyte& x) {
- int c=fgetc(buf);
- if(c != EOF) x=c;
- else set(eofbit);
- return *this;
- }
+ IXSTREAM_DECL(float);
+
+ ixstream& operator >> (double& x);
+ ixstream& operator >> (xbyte& x);
};
class oxstream : virtual public xstream {
@@ -204,181 +130,95 @@ private:
protected:
XDR xdro;
public:
- oxstream(bool singleprecision=false) : singleprecision(singleprecision) {}
-
- virtual void open(const char *filename, open_mode mode=trunc) {
- clear();
- buf=fopen(filename,(mode & app) ? "a" : "w");
- if(buf) xdrstdio_create(&xdro,buf,XDR_ENCODE);
- else set(badbit);
- }
-
- virtual void close()
- {
- closefile();
- }
-
- void closefile() {
- if(buf) {
-#ifndef _CRAY
- xdr_destroy(&xdro);
-#endif
- fclose(buf);
- buf=NULL;
- }
- }
+ oxstream(bool singleprecision=false);
- oxstream(const char *filename, bool singleprecision=false) :
- singleprecision(singleprecision) {open(filename);}
- oxstream(const char *filename, open_mode mode, bool singleprecision=false) :
- singleprecision(singleprecision) {
- open(filename,mode);
- }
- virtual ~oxstream() {closefile();}
+ virtual void open(const char *filename, open_mode mode=trunc);
- oxstream& flush() {if(buf) fflush(buf); return *this;}
+ virtual void close();
+
+ void closefile();
+
+ oxstream(const char *filename, bool singleprecision=false);
+
+ oxstream(const char *filename, open_mode mode, bool singleprecision=false);
+ virtual ~oxstream();
+
+ oxstream& flush();
typedef oxstream& (*omanip)(oxstream&);
- oxstream& operator << (omanip func) { return (*func)(*this); }
-
- OXSTREAM(int,int);
- OXSTREAM(unsigned int,u_int);
- OXSTREAM(long,long);
- OXSTREAM(unsigned long,u_long);
- OXSTREAM(long long,longlong_t);
- OXSTREAM(unsigned long long,u_longlong_t);
- OXSTREAM(short,short);
- OXSTREAM(unsigned short,u_short);
- OXSTREAM(char,char);
+ oxstream& operator << (omanip func);
+
+ OXSTREAM_DECL(int);
+ OXSTREAM_DECL(unsigned int);
+ OXSTREAM_DECL(long);
+ OXSTREAM_DECL(unsigned long);
+ OXSTREAM_DECL(long long);
+ OXSTREAM_DECL(unsigned long long);
+ OXSTREAM_DECL(short);
+ OXSTREAM_DECL(unsigned short);
+ OXSTREAM_DECL(char);
#ifndef _CRAY
- OXSTREAM(unsigned char,u_char);
+ OXSTREAM_DECL(unsigned char);
#endif
- OXSTREAM(float,float);
-
- oxstream& operator << (double x) {
- if(singleprecision)
- *this << (float) x;
- else
- if(!xdr_double(&xdro, &x)) set(badbit);
- return *this;
- }
-
- oxstream& operator << (xbyte x) {
- if(fputc(x.byte(),buf) == EOF) set(badbit);
- return *this;
- }
+ OXSTREAM_DECL(float);
+
+ oxstream& operator << (double x);
+
+ oxstream& operator << (xbyte x);
};
class memoxstream : public oxstream
{
private:
- char* baseBuf;
- size_t len;
+#if defined(_WIN32)
+ fmem fmInstance;
+#else
+ char* buffer=nullptr;
+ size_t size=0;
+#endif
public:
- memoxstream(bool singleprecision=false) :
- oxstream(singleprecision), baseBuf(nullptr), len(0)
- {
- clear();
- buf=open_memstream(&baseBuf,&len);
- if(buf)
- xdrstdio_create(&xdro,buf,XDR_ENCODE);
- else
- set(badbit);
- }
-
- ~memoxstream() override
- {
- closefile();
- free(baseBuf);
- }
-
- [[nodiscard]]
- char const* stream() const
- {
- return baseBuf;
- }
-
- [[nodiscard]]
- size_t const& getLength() const
- {
- return len;
- }
+ memoxstream(bool singleprecision=false);
+ ~memoxstream() override;
+ std::vector<uint8_t> createCopyOfCurrentData();
};
class memixstream: public ixstream
{
public:
- memixstream(char* data, size_t length, bool singleprecision=false) : ixstream(singleprecision)
- {
- xdrmem_create(&xdri,data,length,XDR_DECODE);
- }
-
- explicit memixstream(std::vector<char>& data, bool singleprecision=false) :
- memixstream(data.data(), data.size(), singleprecision)
- {
- }
-
- ~memixstream() override
- {
- xdr_destroy(&xdri);
- }
-
- void close() override
- {
- xdr_destroy(&xdri);
- }
-
- void open(const char *filename, open_mode = in) override
- {
- }
+ memixstream(char* data, size_t length, bool singleprecision=false);
+
+ explicit memixstream(std::vector<char>& data, bool singleprecision=false);
+
+ ~memixstream() override;
+
+ void close() override;
+
+ void open(const char *filename, open_mode = in) override;
};
class ioxstream : public ixstream, public oxstream {
public:
- void open(const char *filename, open_mode mode=out) override {
- clear();
- if(mode & app)
- buf=fopen(filename,"a+");
- else if(mode & trunc)
- buf=fopen(filename,"w+");
- else if(mode & out) {
- buf=fopen(filename,"r+");
- if(!buf)
- buf=fopen(filename,"w+");
- } else
- buf=fopen(filename,"r");
- if(buf) {
- xdrstdio_create(&xdri,buf,XDR_DECODE);
- xdrstdio_create(&xdro,buf,XDR_ENCODE);
- } else set(badbit);
- }
-
- void close() override {
- if(buf) {
-#ifndef _CRAY
- xdr_destroy(&xdri);
- xdr_destroy(&xdro);
-#endif
- fclose(buf);
- buf=NULL;
- }
- }
-
- ioxstream() {}
- ioxstream(const char *filename) {open(filename);}
- ioxstream(const char *filename, open_mode mode) {open(filename,mode);}
- virtual ~ioxstream() {close();}
+ void open(const char *filename, open_mode mode=out) override;
+
+ void close() override;
+
+ ioxstream();
+ ioxstream(const char *filename);
+ ioxstream(const char *filename, open_mode mode);
+ ~ioxstream() override;
};
-inline oxstream& endl(oxstream& s) {s.flush(); return s;}
-inline oxstream& flush(oxstream& s) {s.flush(); return s;}
+oxstream& endl(oxstream& s);
+oxstream& flush(oxstream& s);
-#undef IXSTREAM
-#undef OXSTREAM
+#undef IXSTREAM_DECL
+#undef OXSTREAM_DECL
}
#undef quad_t
#endif
+
+#endif